Built motion from commit faf3c706.|2.6.8
authorsupport <support@xcally.com>
Mon, 11 Apr 2022 12:51:58 +0000 (12:51 +0000)
committersupport <support@xcally.com>
Mon, 11 Apr 2022 12:51:58 +0000 (12:51 +0000)
1194 files changed:
apidoc/api_project.js
apidoc/api_project.json
server/api/action/action.attributes.js
server/api/action/action.controller.js
server/api/action/action.model.js
server/api/action/action.rpc.js
server/api/action/index.js
server/api/analyticCustomReport/analyticCustomReport.attributes.js
server/api/analyticCustomReport/analyticCustomReport.controller.js
server/api/analyticCustomReport/analyticCustomReport.model.js
server/api/analyticCustomReport/analyticCustomReport.rpc.js
server/api/analyticCustomReport/index.js
server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
server/api/analyticDefaultReport/analyticDefaultReport.controller.js
server/api/analyticDefaultReport/analyticDefaultReport.model.js
server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
server/api/analyticDefaultReport/index.js
server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
server/api/analyticExtractedReport/analyticExtractedReport.controller.js
server/api/analyticExtractedReport/analyticExtractedReport.model.js
server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
server/api/analyticExtractedReport/index.js
server/api/analyticFieldReport/analyticFieldReport.attributes.js
server/api/analyticFieldReport/analyticFieldReport.controller.js
server/api/analyticFieldReport/analyticFieldReport.model.js
server/api/analyticFieldReport/analyticFieldReport.rpc.js
server/api/analyticFieldReport/index.js
server/api/analyticMetric/analyticMetric.attributes.js
server/api/analyticMetric/analyticMetric.controller.js
server/api/analyticMetric/analyticMetric.model.js
server/api/analyticMetric/analyticMetric.rpc.js
server/api/analyticMetric/index.js
server/api/analyticTreeReport/analyticTreeReport.attributes.js
server/api/analyticTreeReport/analyticTreeReport.controller.js
server/api/analyticTreeReport/analyticTreeReport.model.js
server/api/analyticTreeReport/analyticTreeReport.rpc.js
server/api/analyticTreeReport/index.js
server/api/attachment/attachment.attributes.js
server/api/attachment/attachment.controller.js
server/api/attachment/attachment.model.js
server/api/attachment/attachment.rpc.js
server/api/attachment/index.js
server/api/authActiveDirectory/authActiveDirectory.controller.js
server/api/authActiveDirectory/index.js
server/api/authGoogle/authGoogle.controller.js
server/api/authGoogle/index.js
server/api/authLocal/authLocal.controller.js
server/api/authLocal/index.js
server/api/automation/automation.attributes.js
server/api/automation/automation.controller.js
server/api/automation/automation.model.js
server/api/automation/automation.rpc.js
server/api/automation/index.js
server/api/campaign/campaign.attributes.js
server/api/campaign/campaign.controller.js
server/api/campaign/campaign.model.js
server/api/campaign/campaign.rpc.js
server/api/campaign/index.js
server/api/cannedAnswer/cannedAnswer.attributes.js
server/api/cannedAnswer/cannedAnswer.controller.js
server/api/cannedAnswer/cannedAnswer.model.js
server/api/cannedAnswer/cannedAnswer.rpc.js
server/api/cannedAnswer/index.js
server/api/cdr/cdr.attributes.js
server/api/cdr/cdr.controller.js
server/api/cdr/cdr.model.js
server/api/cdr/cdr.rpc.js
server/api/cdr/index.js
server/api/chatApplication/chatApplication.attributes.js
server/api/chatApplication/chatApplication.controller.js
server/api/chatApplication/chatApplication.model.js
server/api/chatApplication/chatApplication.rpc.js
server/api/chatApplication/index.js
server/api/chatGroup/chatGroup.attributes.js
server/api/chatGroup/chatGroup.controller.js
server/api/chatGroup/chatGroup.events.js
server/api/chatGroup/chatGroup.model.js
server/api/chatGroup/chatGroup.rpc.js
server/api/chatGroup/chatGroup.socket.js
server/api/chatGroup/index.js
server/api/chatInteraction/chatInteraction.attributes.js
server/api/chatInteraction/chatInteraction.controller.js
server/api/chatInteraction/chatInteraction.events.js
server/api/chatInteraction/chatInteraction.model.js
server/api/chatInteraction/chatInteraction.rpc.js
server/api/chatInteraction/chatInteraction.socket.js
server/api/chatInteraction/index.js
server/api/chatInternalMessage/chatInternalMessage.attributes.js
server/api/chatInternalMessage/chatInternalMessage.controller.js
server/api/chatInternalMessage/chatInternalMessage.events.js
server/api/chatInternalMessage/chatInternalMessage.model.js
server/api/chatInternalMessage/chatInternalMessage.rpc.js
server/api/chatInternalMessage/chatInternalMessage.socket.js
server/api/chatInternalMessage/index.js
server/api/chatMessage/chatMessage.attributes.js
server/api/chatMessage/chatMessage.controller.js
server/api/chatMessage/chatMessage.events.js
server/api/chatMessage/chatMessage.model.js
server/api/chatMessage/chatMessage.rpc.js
server/api/chatMessage/chatMessage.socket.js
server/api/chatMessage/index.js
server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
server/api/chatOfflineMessage/chatOfflineMessage.controller.js
server/api/chatOfflineMessage/chatOfflineMessage.events.js
server/api/chatOfflineMessage/chatOfflineMessage.model.js
server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
server/api/chatOfflineMessage/index.js
server/api/chatProactiveAction/chatProactiveAction.attributes.js
server/api/chatProactiveAction/chatProactiveAction.controller.js
server/api/chatProactiveAction/chatProactiveAction.model.js
server/api/chatProactiveAction/chatProactiveAction.rpc.js
server/api/chatProactiveAction/index.js
server/api/chatQueue/chatQueue.attributes.js
server/api/chatQueue/chatQueue.controller.js
server/api/chatQueue/chatQueue.events.js
server/api/chatQueue/chatQueue.model.js
server/api/chatQueue/chatQueue.rpc.js
server/api/chatQueue/chatQueue.socket.js
server/api/chatQueue/index.js
server/api/chatQueueReport/chatQueueReport.attributes.js
server/api/chatQueueReport/chatQueueReport.controller.js
server/api/chatQueueReport/chatQueueReport.model.js
server/api/chatQueueReport/chatQueueReport.rpc.js
server/api/chatQueueReport/index.js
server/api/chatTransferReport/chatTransferReport.attributes.js
server/api/chatTransferReport/chatTransferReport.controller.js
server/api/chatTransferReport/chatTransferReport.model.js
server/api/chatTransferReport/chatTransferReport.rpc.js
server/api/chatTransferReport/index.js
server/api/chatWebsite/chatWebsite.attributes.js
server/api/chatWebsite/chatWebsite.controller.js
server/api/chatWebsite/chatWebsite.events.js
server/api/chatWebsite/chatWebsite.model.js
server/api/chatWebsite/chatWebsite.rpc.js
server/api/chatWebsite/chatWebsite.socket.js
server/api/chatWebsite/index.js
server/api/client-side-logs.js
server/api/cloudProvider/cloudProvider.attributes.js
server/api/cloudProvider/cloudProvider.controller.js
server/api/cloudProvider/cloudProvider.model.js
server/api/cloudProvider/cloudProvider.oauth.js
server/api/cloudProvider/cloudProvider.rpc.js
server/api/cloudProvider/index.js
server/api/cmCompany/cmCompany.attributes.js
server/api/cmCompany/cmCompany.controller.js
server/api/cmCompany/cmCompany.model.js
server/api/cmCompany/cmCompany.rpc.js
server/api/cmCompany/index.js
server/api/cmContact/cmContact.attributes.js
server/api/cmContact/cmContact.controller.js
server/api/cmContact/cmContact.events.js
server/api/cmContact/cmContact.model.js
server/api/cmContact/cmContact.rpc.js
server/api/cmContact/cmContact.socket.js
server/api/cmContact/index.js
server/api/cmContactHasItem/cmContactHasItem.attributes.js
server/api/cmContactHasItem/cmContactHasItem.controller.js
server/api/cmContactHasItem/cmContactHasItem.model.js
server/api/cmContactHasItem/cmContactHasItem.rpc.js
server/api/cmContactHasItem/index.js
server/api/cmCustomField/cmCustomField.attributes.js
server/api/cmCustomField/cmCustomField.controller.js
server/api/cmCustomField/cmCustomField.model.js
server/api/cmCustomField/cmCustomField.rpc.js
server/api/cmCustomField/index.js
server/api/cmHopper/cmHopper.attributes.js
server/api/cmHopper/cmHopper.controller.js
server/api/cmHopper/cmHopper.model.js
server/api/cmHopper/cmHopper.rpc.js
server/api/cmHopper/index.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js
server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js
server/api/cmHopperAdditionalPhone/index.js
server/api/cmHopperBlack/cmHopperBlack.attributes.js
server/api/cmHopperBlack/cmHopperBlack.controller.js
server/api/cmHopperBlack/cmHopperBlack.model.js
server/api/cmHopperBlack/cmHopperBlack.rpc.js
server/api/cmHopperBlack/index.js
server/api/cmHopperFinal/cmHopperFinal.attributes.js
server/api/cmHopperFinal/cmHopperFinal.controller.js
server/api/cmHopperFinal/cmHopperFinal.model.js
server/api/cmHopperFinal/cmHopperFinal.rpc.js
server/api/cmHopperFinal/index.js
server/api/cmHopperHistory/cmHopperHistory.attributes.js
server/api/cmHopperHistory/cmHopperHistory.controller.js
server/api/cmHopperHistory/cmHopperHistory.model.js
server/api/cmHopperHistory/cmHopperHistory.rpc.js
server/api/cmHopperHistory/index.js
server/api/cmList/cmList.attributes.js
server/api/cmList/cmList.controller.js
server/api/cmList/cmList.events.js
server/api/cmList/cmList.model.js
server/api/cmList/cmList.rpc.js
server/api/cmList/cmList.socket.js
server/api/cmList/index.js
server/api/condition/condition.attributes.js
server/api/condition/condition.controller.js
server/api/condition/condition.model.js
server/api/condition/condition.rpc.js
server/api/condition/index.js
server/api/contactItemType/contactItemType.attributes.js
server/api/contactItemType/contactItemType.controller.js
server/api/contactItemType/contactItemType.model.js
server/api/contactItemType/contactItemType.rpc.js
server/api/contactItemType/index.js
server/api/dashboard/dashboard.attributes.js
server/api/dashboard/dashboard.controller.js
server/api/dashboard/dashboard.events.js
server/api/dashboard/dashboard.model.js
server/api/dashboard/dashboard.rpc.js
server/api/dashboard/dashboard.socket.js
server/api/dashboard/index.js
server/api/dashboardItem/dashboardItem.attributes.js
server/api/dashboardItem/dashboardItem.controller.js
server/api/dashboardItem/dashboardItem.events.js
server/api/dashboardItem/dashboardItem.model.js
server/api/dashboardItem/dashboardItem.rpc.js
server/api/dashboardItem/dashboardItem.socket.js
server/api/dashboardItem/index.js
server/api/disposition/disposition.attributes.js
server/api/disposition/disposition.controller.js
server/api/disposition/disposition.model.js
server/api/disposition/disposition.rpc.js
server/api/disposition/index.js
server/api/faxAccount/faxAccount.attributes.js
server/api/faxAccount/faxAccount.controller.js
server/api/faxAccount/faxAccount.events.js
server/api/faxAccount/faxAccount.model.js
server/api/faxAccount/faxAccount.rpc.js
server/api/faxAccount/faxAccount.socket.js
server/api/faxAccount/index.js
server/api/faxApplication/faxApplication.attributes.js
server/api/faxApplication/faxApplication.controller.js
server/api/faxApplication/faxApplication.model.js
server/api/faxApplication/faxApplication.rpc.js
server/api/faxApplication/index.js
server/api/faxInteraction/faxInteraction.attributes.js
server/api/faxInteraction/faxInteraction.controller.js
server/api/faxInteraction/faxInteraction.events.js
server/api/faxInteraction/faxInteraction.model.js
server/api/faxInteraction/faxInteraction.rpc.js
server/api/faxInteraction/faxInteraction.socket.js
server/api/faxInteraction/index.js
server/api/faxMessage/faxMessage.attributes.js
server/api/faxMessage/faxMessage.controller.js
server/api/faxMessage/faxMessage.events.js
server/api/faxMessage/faxMessage.model.js
server/api/faxMessage/faxMessage.rpc.js
server/api/faxMessage/faxMessage.socket.js
server/api/faxMessage/index.js
server/api/faxQueue/faxQueue.attributes.js
server/api/faxQueue/faxQueue.controller.js
server/api/faxQueue/faxQueue.events.js
server/api/faxQueue/faxQueue.model.js
server/api/faxQueue/faxQueue.rpc.js
server/api/faxQueue/faxQueue.socket.js
server/api/faxQueue/index.js
server/api/faxQueueReport/faxQueueReport.attributes.js
server/api/faxQueueReport/faxQueueReport.controller.js
server/api/faxQueueReport/faxQueueReport.model.js
server/api/faxQueueReport/faxQueueReport.rpc.js
server/api/faxQueueReport/index.js
server/api/faxTransferReport/faxTransferReport.attributes.js
server/api/faxTransferReport/faxTransferReport.controller.js
server/api/faxTransferReport/faxTransferReport.model.js
server/api/faxTransferReport/faxTransferReport.rpc.js
server/api/faxTransferReport/index.js
server/api/intDeskAccount/index.js
server/api/intDeskAccount/intDeskAccount.attributes.js
server/api/intDeskAccount/intDeskAccount.controller.js
server/api/intDeskAccount/intDeskAccount.model.js
server/api/intDeskAccount/intDeskAccount.rpc.js
server/api/intDeskConfiguration/index.js
server/api/intDeskConfiguration/intDeskConfiguration.attributes.js
server/api/intDeskConfiguration/intDeskConfiguration.controller.js
server/api/intDeskConfiguration/intDeskConfiguration.model.js
server/api/intDeskConfiguration/intDeskConfiguration.rpc.js
server/api/intDeskField/index.js
server/api/intDeskField/intDeskField.attributes.js
server/api/intDeskField/intDeskField.controller.js
server/api/intDeskField/intDeskField.model.js
server/api/intDeskField/intDeskField.rpc.js
server/api/intDynamics365Account/index.js
server/api/intDynamics365Account/intDynamics365Account.attributes.js
server/api/intDynamics365Account/intDynamics365Account.controller.js
server/api/intDynamics365Account/intDynamics365Account.model.js
server/api/intDynamics365Account/intDynamics365Account.rpc.js
server/api/intDynamics365Configuration/index.js
server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js
server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js
server/api/intDynamics365Configuration/intDynamics365Configuration.model.js
server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js
server/api/intDynamics365Field/index.js
server/api/intDynamics365Field/intDynamics365Field.attributes.js
server/api/intDynamics365Field/intDynamics365Field.controller.js
server/api/intDynamics365Field/intDynamics365Field.model.js
server/api/intDynamics365Field/intDynamics365Field.rpc.js
server/api/intFreshdeskAccount/index.js
server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js
server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js
server/api/intFreshdeskAccount/intFreshdeskAccount.model.js
server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js
server/api/intFreshdeskConfiguration/index.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js
server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js
server/api/intFreshdeskField/index.js
server/api/intFreshdeskField/intFreshdeskField.attributes.js
server/api/intFreshdeskField/intFreshdeskField.controller.js
server/api/intFreshdeskField/intFreshdeskField.model.js
server/api/intFreshdeskField/intFreshdeskField.rpc.js
server/api/intFreshsalesAccount/index.js
server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js
server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js
server/api/intFreshsalesAccount/intFreshsalesAccount.model.js
server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js
server/api/intFreshsalesConfiguration/index.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js
server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js
server/api/intFreshsalesField/index.js
server/api/intFreshsalesField/intFreshsalesField.attributes.js
server/api/intFreshsalesField/intFreshsalesField.controller.js
server/api/intFreshsalesField/intFreshsalesField.model.js
server/api/intFreshsalesField/intFreshsalesField.rpc.js
server/api/intSalesforceAccount/index.js
server/api/intSalesforceAccount/intSalesforceAccount.attributes.js
server/api/intSalesforceAccount/intSalesforceAccount.controller.js
server/api/intSalesforceAccount/intSalesforceAccount.model.js
server/api/intSalesforceAccount/intSalesforceAccount.rpc.js
server/api/intSalesforceConfiguration/index.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js
server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js
server/api/intSalesforceField/index.js
server/api/intSalesforceField/intSalesforceField.attributes.js
server/api/intSalesforceField/intSalesforceField.controller.js
server/api/intSalesforceField/intSalesforceField.model.js
server/api/intSalesforceField/intSalesforceField.rpc.js
server/api/intServicenowAccount/index.js
server/api/intServicenowAccount/intServicenowAccount.attributes.js
server/api/intServicenowAccount/intServicenowAccount.controller.js
server/api/intServicenowAccount/intServicenowAccount.model.js
server/api/intServicenowAccount/intServicenowAccount.rpc.js
server/api/intServicenowConfiguration/index.js
server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js
server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js
server/api/intServicenowConfiguration/intServicenowConfiguration.model.js
server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js
server/api/intServicenowField/index.js
server/api/intServicenowField/intServicenowField.attributes.js
server/api/intServicenowField/intServicenowField.controller.js
server/api/intServicenowField/intServicenowField.model.js
server/api/intServicenowField/intServicenowField.rpc.js
server/api/intSugarcrmAccount/index.js
server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js
server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js
server/api/intSugarcrmAccount/intSugarcrmAccount.model.js
server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js
server/api/intSugarcrmConfiguration/index.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js
server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js
server/api/intSugarcrmField/index.js
server/api/intSugarcrmField/intSugarcrmField.attributes.js
server/api/intSugarcrmField/intSugarcrmField.controller.js
server/api/intSugarcrmField/intSugarcrmField.model.js
server/api/intSugarcrmField/intSugarcrmField.rpc.js
server/api/intVtigerAccount/index.js
server/api/intVtigerAccount/intVtigerAccount.attributes.js
server/api/intVtigerAccount/intVtigerAccount.controller.js
server/api/intVtigerAccount/intVtigerAccount.model.js
server/api/intVtigerAccount/intVtigerAccount.rpc.js
server/api/intVtigerConfiguration/index.js
server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js
server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js
server/api/intVtigerConfiguration/intVtigerConfiguration.model.js
server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js
server/api/intVtigerField/index.js
server/api/intVtigerField/intVtigerField.attributes.js
server/api/intVtigerField/intVtigerField.controller.js
server/api/intVtigerField/intVtigerField.model.js
server/api/intVtigerField/intVtigerField.rpc.js
server/api/intZendeskAccount/index.js
server/api/intZendeskAccount/intZendeskAccount.attributes.js
server/api/intZendeskAccount/intZendeskAccount.controller.js
server/api/intZendeskAccount/intZendeskAccount.model.js
server/api/intZendeskAccount/intZendeskAccount.rpc.js
server/api/intZendeskConfiguration/index.js
server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js
server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js
server/api/intZendeskConfiguration/intZendeskConfiguration.model.js
server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js
server/api/intZendeskField/index.js
server/api/intZendeskField/intZendeskField.attributes.js
server/api/intZendeskField/intZendeskField.controller.js
server/api/intZendeskField/intZendeskField.model.js
server/api/intZendeskField/intZendeskField.rpc.js
server/api/intZohoAccount/index.js
server/api/intZohoAccount/intZohoAccount.attributes.js
server/api/intZohoAccount/intZohoAccount.controller.js
server/api/intZohoAccount/intZohoAccount.model.js
server/api/intZohoAccount/intZohoAccount.rpc.js
server/api/intZohoConfiguration/index.js
server/api/intZohoConfiguration/intZohoConfiguration.attributes.js
server/api/intZohoConfiguration/intZohoConfiguration.controller.js
server/api/intZohoConfiguration/intZohoConfiguration.model.js
server/api/intZohoConfiguration/intZohoConfiguration.rpc.js
server/api/intZohoField/index.js
server/api/intZohoField/intZohoField.attributes.js
server/api/intZohoField/intZohoField.controller.js
server/api/intZohoField/intZohoField.model.js
server/api/intZohoField/intZohoField.rpc.js
server/api/integration/index.js
server/api/integration/integration.attributes.js
server/api/integration/integration.controller.js
server/api/integration/integration.model.js
server/api/integration/integration.rpc.js
server/api/integrationReport/index.js
server/api/integrationReport/integrationReport.attributes.js
server/api/integrationReport/integrationReport.controller.js
server/api/integrationReport/integrationReport.model.js
server/api/integrationReport/integrationReport.rpc.js
server/api/interval/index.js
server/api/interval/interval.attributes.js
server/api/interval/interval.controller.js
server/api/interval/interval.model.js
server/api/interval/interval.rpc.js
server/api/jira/index.js
server/api/jira/jira.controller.js
server/api/jscriptyAnswerReport/index.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js
server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js
server/api/jscriptyProject/index.js
server/api/jscriptyProject/jscriptyProject.attributes.js
server/api/jscriptyProject/jscriptyProject.controller.js
server/api/jscriptyProject/jscriptyProject.model.js
server/api/jscriptyProject/jscriptyProject.rpc.js
server/api/jscriptyQuestionReport/index.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js
server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js
server/api/jscriptySessionReport/index.js
server/api/jscriptySessionReport/jscriptySessionReport.attributes.js
server/api/jscriptySessionReport/jscriptySessionReport.controller.js
server/api/jscriptySessionReport/jscriptySessionReport.model.js
server/api/jscriptySessionReport/jscriptySessionReport.rpc.js
server/api/license/index.js
server/api/license/license.attributes.js
server/api/license/license.controller.js
server/api/license/license.model.js
server/api/license/license.rpc.js
server/api/mailAccount/index.js
server/api/mailAccount/mailAccount.attributes.js
server/api/mailAccount/mailAccount.controller.js
server/api/mailAccount/mailAccount.events.js
server/api/mailAccount/mailAccount.model.js
server/api/mailAccount/mailAccount.rpc.js
server/api/mailAccount/mailAccount.socket.js
server/api/mailApplication/index.js
server/api/mailApplication/mailApplication.attributes.js
server/api/mailApplication/mailApplication.controller.js
server/api/mailApplication/mailApplication.model.js
server/api/mailApplication/mailApplication.rpc.js
server/api/mailInteraction/index.js
server/api/mailInteraction/mailInteraction.attributes.js
server/api/mailInteraction/mailInteraction.controller.js
server/api/mailInteraction/mailInteraction.events.js
server/api/mailInteraction/mailInteraction.model.js
server/api/mailInteraction/mailInteraction.rpc.js
server/api/mailInteraction/mailInteraction.socket.js
server/api/mailMessage/index.js
server/api/mailMessage/mailMessage.attributes.js
server/api/mailMessage/mailMessage.controller.js
server/api/mailMessage/mailMessage.events.js
server/api/mailMessage/mailMessage.model.js
server/api/mailMessage/mailMessage.rpc.js
server/api/mailMessage/mailMessage.socket.js
server/api/mailQueue/index.js
server/api/mailQueue/mailQueue.attributes.js
server/api/mailQueue/mailQueue.controller.js
server/api/mailQueue/mailQueue.events.js
server/api/mailQueue/mailQueue.model.js
server/api/mailQueue/mailQueue.rpc.js
server/api/mailQueue/mailQueue.socket.js
server/api/mailQueueReport/index.js
server/api/mailQueueReport/mailQueueReport.attributes.js
server/api/mailQueueReport/mailQueueReport.controller.js
server/api/mailQueueReport/mailQueueReport.model.js
server/api/mailQueueReport/mailQueueReport.rpc.js
server/api/mailServerIn/index.js
server/api/mailServerIn/mailServerIn.attributes.js
server/api/mailServerIn/mailServerIn.model.js
server/api/mailServerIn/mailServerIn.rpc.js
server/api/mailServerOut/index.js
server/api/mailServerOut/mailServerOut.attributes.js
server/api/mailServerOut/mailServerOut.controller.js
server/api/mailServerOut/mailServerOut.model.js
server/api/mailServerOut/mailServerOut.rpc.js
server/api/mailSubstatus/index.js
server/api/mailSubstatus/mailSubstatus.attributes.js
server/api/mailSubstatus/mailSubstatus.controller.js
server/api/mailSubstatus/mailSubstatus.events.js
server/api/mailSubstatus/mailSubstatus.model.js
server/api/mailSubstatus/mailSubstatus.rpc.js
server/api/mailTransferReport/index.js
server/api/mailTransferReport/mailTransferReport.attributes.js
server/api/mailTransferReport/mailTransferReport.controller.js
server/api/mailTransferReport/mailTransferReport.model.js
server/api/mailTransferReport/mailTransferReport.rpc.js
server/api/memberReport/index.js
server/api/memberReport/memberReport.attributes.js
server/api/memberReport/memberReport.controller.js
server/api/memberReport/memberReport.model.js
server/api/memberReport/memberReport.rpc.js
server/api/migration/index.js
server/api/migration/migration.attributes.js
server/api/migration/migration.controller.js
server/api/migration/migration.model.js
server/api/migration/migration.rpc.js
server/api/network/index.js
server/api/network/network.attributes.js
server/api/network/network.controller.js
server/api/network/network.model.js
server/api/network/network.rpc.js
server/api/openchannelAccount/index.js
server/api/openchannelAccount/openchannelAccount.attributes.js
server/api/openchannelAccount/openchannelAccount.controller.js
server/api/openchannelAccount/openchannelAccount.events.js
server/api/openchannelAccount/openchannelAccount.model.js
server/api/openchannelAccount/openchannelAccount.rpc.js
server/api/openchannelAccount/openchannelAccount.socket.js
server/api/openchannelApplication/index.js
server/api/openchannelApplication/openchannelApplication.attributes.js
server/api/openchannelApplication/openchannelApplication.controller.js
server/api/openchannelApplication/openchannelApplication.model.js
server/api/openchannelApplication/openchannelApplication.rpc.js
server/api/openchannelInteraction/index.js
server/api/openchannelInteraction/openchannelInteraction.attributes.js
server/api/openchannelInteraction/openchannelInteraction.controller.js
server/api/openchannelInteraction/openchannelInteraction.events.js
server/api/openchannelInteraction/openchannelInteraction.model.js
server/api/openchannelInteraction/openchannelInteraction.rpc.js
server/api/openchannelInteraction/openchannelInteraction.socket.js
server/api/openchannelMessage/index.js
server/api/openchannelMessage/openchannelMessage.attributes.js
server/api/openchannelMessage/openchannelMessage.controller.js
server/api/openchannelMessage/openchannelMessage.events.js
server/api/openchannelMessage/openchannelMessage.model.js
server/api/openchannelMessage/openchannelMessage.rpc.js
server/api/openchannelMessage/openchannelMessage.socket.js
server/api/openchannelQueue/index.js
server/api/openchannelQueue/openchannelQueue.attributes.js
server/api/openchannelQueue/openchannelQueue.controller.js
server/api/openchannelQueue/openchannelQueue.events.js
server/api/openchannelQueue/openchannelQueue.model.js
server/api/openchannelQueue/openchannelQueue.rpc.js
server/api/openchannelQueue/openchannelQueue.socket.js
server/api/openchannelQueueReport/index.js
server/api/openchannelQueueReport/openchannelQueueReport.attributes.js
server/api/openchannelQueueReport/openchannelQueueReport.controller.js
server/api/openchannelQueueReport/openchannelQueueReport.model.js
server/api/openchannelQueueReport/openchannelQueueReport.rpc.js
server/api/openchannelTransferReport/index.js
server/api/openchannelTransferReport/openchannelTransferReport.attributes.js
server/api/openchannelTransferReport/openchannelTransferReport.controller.js
server/api/openchannelTransferReport/openchannelTransferReport.model.js
server/api/openchannelTransferReport/openchannelTransferReport.rpc.js
server/api/pause/index.js
server/api/pause/pause.attributes.js
server/api/pause/pause.controller.js
server/api/pause/pause.model.js
server/api/pause/pause.rpc.js
server/api/plugin/index.js
server/api/plugin/plugin.attributes.js
server/api/plugin/plugin.controller.js
server/api/plugin/plugin.events.js
server/api/plugin/plugin.model.js
server/api/plugin/plugin.rpc.js
server/api/plugin/plugin.socket.js
server/api/pm2/index.js
server/api/pm2/pm2.controller.js
server/api/realtime/index.js
server/api/realtime/realtime.controller.js
server/api/reportAgentPreview/index.js
server/api/reportAgentPreview/reportAgentPreview.attributes.js
server/api/reportAgentPreview/reportAgentPreview.model.js
server/api/reportAgentPreview/reportAgentPreview.rpc.js
server/api/rpc/index.js
server/api/rpc/rpc.controller.js
server/api/schedule/index.js
server/api/schedule/schedule.attributes.js
server/api/schedule/schedule.controller.js
server/api/schedule/schedule.model.js
server/api/schedule/schedule.rpc.js
server/api/screenRecording/index.js
server/api/screenRecording/screenRecording.attributes.js
server/api/screenRecording/screenRecording.controller.js
server/api/screenRecording/screenRecording.model.js
server/api/screenRecording/screenRecording.rpc.js
server/api/setting/index.js
server/api/setting/setting.attributes.js
server/api/setting/setting.controller.js
server/api/setting/setting.model.js
server/api/setting/setting.rpc.js
server/api/smsAccount/index.js
server/api/smsAccount/smsAccount.attributes.js
server/api/smsAccount/smsAccount.controller.js
server/api/smsAccount/smsAccount.events.js
server/api/smsAccount/smsAccount.model.js
server/api/smsAccount/smsAccount.rpc.js
server/api/smsAccount/smsAccount.socket.js
server/api/smsApplication/index.js
server/api/smsApplication/smsApplication.attributes.js
server/api/smsApplication/smsApplication.controller.js
server/api/smsApplication/smsApplication.model.js
server/api/smsApplication/smsApplication.rpc.js
server/api/smsInteraction/index.js
server/api/smsInteraction/smsInteraction.attributes.js
server/api/smsInteraction/smsInteraction.controller.js
server/api/smsInteraction/smsInteraction.events.js
server/api/smsInteraction/smsInteraction.model.js
server/api/smsInteraction/smsInteraction.rpc.js
server/api/smsInteraction/smsInteraction.socket.js
server/api/smsMessage/index.js
server/api/smsMessage/smsMessage.attributes.js
server/api/smsMessage/smsMessage.controller.js
server/api/smsMessage/smsMessage.events.js
server/api/smsMessage/smsMessage.model.js
server/api/smsMessage/smsMessage.rpc.js
server/api/smsMessage/smsMessage.socket.js
server/api/smsQueue/index.js
server/api/smsQueue/smsQueue.attributes.js
server/api/smsQueue/smsQueue.controller.js
server/api/smsQueue/smsQueue.events.js
server/api/smsQueue/smsQueue.model.js
server/api/smsQueue/smsQueue.rpc.js
server/api/smsQueue/smsQueue.socket.js
server/api/smsQueueReport/index.js
server/api/smsQueueReport/smsQueueReport.attributes.js
server/api/smsQueueReport/smsQueueReport.controller.js
server/api/smsQueueReport/smsQueueReport.model.js
server/api/smsQueueReport/smsQueueReport.rpc.js
server/api/smsTransferReport/index.js
server/api/smsTransferReport/smsTransferReport.attributes.js
server/api/smsTransferReport/smsTransferReport.controller.js
server/api/smsTransferReport/smsTransferReport.model.js
server/api/smsTransferReport/smsTransferReport.rpc.js
server/api/sound/index.js
server/api/sound/sound.attributes.js
server/api/sound/sound.controller.js
server/api/sound/sound.model.js
server/api/sound/sound.rpc.js
server/api/squareMessage/index.js
server/api/squareMessage/squareMessage.attributes.js
server/api/squareMessage/squareMessage.controller.js
server/api/squareMessage/squareMessage.model.js
server/api/squareMessage/squareMessage.rpc.js
server/api/squareOdbc/index.js
server/api/squareOdbc/squareOdbc.attributes.js
server/api/squareOdbc/squareOdbc.controller.js
server/api/squareOdbc/squareOdbc.model.js
server/api/squareOdbc/squareOdbc.rpc.js
server/api/squareProject/index.js
server/api/squareProject/squareProject.attributes.js
server/api/squareProject/squareProject.controller.js
server/api/squareProject/squareProject.events.js
server/api/squareProject/squareProject.model.js
server/api/squareProject/squareProject.rpc.js
server/api/squareProject/squareProject.socket.js
server/api/squareRecording/index.js
server/api/squareRecording/squareRecording.attributes.js
server/api/squareRecording/squareRecording.controller.js
server/api/squareRecording/squareRecording.model.js
server/api/squareRecording/squareRecording.rpc.js
server/api/squareReport/index.js
server/api/squareReport/squareReport.attributes.js
server/api/squareReport/squareReport.controller.js
server/api/squareReport/squareReport.model.js
server/api/squareReport/squareReport.rpc.js
server/api/squareReportDetail/index.js
server/api/squareReportDetail/squareReportDetail.attributes.js
server/api/squareReportDetail/squareReportDetail.controller.js
server/api/squareReportDetail/squareReportDetail.model.js
server/api/squareReportDetail/squareReportDetail.rpc.js
server/api/system/index.js
server/api/system/system.controller.js
server/api/tag/index.js
server/api/tag/tag.attributes.js
server/api/tag/tag.controller.js
server/api/tag/tag.model.js
server/api/tag/tag.rpc.js
server/api/team/index.js
server/api/team/team.attributes.js
server/api/team/team.controller.js
server/api/team/team.events.js
server/api/team/team.model.js
server/api/team/team.rpc.js
server/api/team/team.socket.js
server/api/teamVoicePrefix/teamVoicePrefix.attributes.js
server/api/teamVoicePrefix/teamVoicePrefix.model.js
server/api/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.js
server/api/template/index.js
server/api/template/template.attributes.js
server/api/template/template.controller.js
server/api/template/template.model.js
server/api/template/template.rpc.js
server/api/trigger/index.js
server/api/trigger/trigger.attributes.js
server/api/trigger/trigger.controller.js
server/api/trigger/trigger.model.js
server/api/trigger/trigger.rpc.js
server/api/trunk/index.js
server/api/trunk/trunk.attributes.js
server/api/trunk/trunk.controller.js
server/api/trunk/trunk.model.js
server/api/trunk/trunk.rpc.js
server/api/user-setting/index.js
server/api/user-setting/user-setting.attributes.js
server/api/user-setting/user-setting.controller.js
server/api/user-setting/user-setting.events.js
server/api/user-setting/user-setting.model.js
server/api/user-setting/user-setting.socket.js
server/api/user/index.js
server/api/user/user.attributes.js
server/api/user/user.controller.js
server/api/user/user.events.js
server/api/user/user.model.js
server/api/user/user.rpc.js
server/api/user/user.socket.js
server/api/userChatQueue/index.js
server/api/userChatQueue/userChatQueue.attributes.js
server/api/userChatQueue/userChatQueue.model.js
server/api/userChatQueue/userChatQueue.rpc.js
server/api/userFaxQueue/index.js
server/api/userFaxQueue/userFaxQueue.attributes.js
server/api/userFaxQueue/userFaxQueue.model.js
server/api/userFaxQueue/userFaxQueue.rpc.js
server/api/userMailQueue/index.js
server/api/userMailQueue/userMailQueue.attributes.js
server/api/userMailQueue/userMailQueue.model.js
server/api/userMailQueue/userMailQueue.rpc.js
server/api/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.js
server/api/userOpenchannelQueue/index.js
server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js
server/api/userOpenchannelQueue/userOpenchannelQueue.model.js
server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js
server/api/userProfile/index.js
server/api/userProfile/userProfile.attributes.js
server/api/userProfile/userProfile.controller.js
server/api/userProfile/userProfile.events.js
server/api/userProfile/userProfile.model.js
server/api/userProfile/userProfile.rpc.js
server/api/userProfile/userProfile.socket.js
server/api/userProfileResource/index.js
server/api/userProfileResource/userProfileResource.attributes.js
server/api/userProfileResource/userProfileResource.controller.js
server/api/userProfileResource/userProfileResource.model.js
server/api/userProfileResource/userProfileResource.rpc.js
server/api/userProfileSection/index.js
server/api/userProfileSection/userProfileSection.attributes.js
server/api/userProfileSection/userProfileSection.controller.js
server/api/userProfileSection/userProfileSection.model.js
server/api/userProfileSection/userProfileSection.rpc.js
server/api/userSmsQueue/index.js
server/api/userSmsQueue/userSmsQueue.attributes.js
server/api/userSmsQueue/userSmsQueue.model.js
server/api/userSmsQueue/userSmsQueue.rpc.js
server/api/userVoicePrefix/userVoicePrefix.attributes.js
server/api/userVoicePrefix/userVoicePrefix.model.js
server/api/userVoiceQueue/index.js
server/api/userVoiceQueue/userVoiceQueue.attributes.js
server/api/userVoiceQueue/userVoiceQueue.model.js
server/api/userVoiceQueue/userVoiceQueue.rpc.js
server/api/userVoiceQueueRt/index.js
server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js
server/api/userVoiceQueueRt/userVoiceQueueRt.events.js
server/api/userVoiceQueueRt/userVoiceQueueRt.model.js
server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js
server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js
server/api/userWhatsappQueue/index.js
server/api/userWhatsappQueue/userWhatsappQueue.attributes.js
server/api/userWhatsappQueue/userWhatsappQueue.model.js
server/api/userWhatsappQueue/userWhatsappQueue.rpc.js
server/api/variable/index.js
server/api/variable/variable.attributes.js
server/api/variable/variable.controller.js
server/api/variable/variable.model.js
server/api/variable/variable.rpc.js
server/api/version/index.js
server/api/version/version.controller.js
server/api/voiceAgentReport/index.js
server/api/voiceAgentReport/voiceAgentReport.attributes.js
server/api/voiceAgentReport/voiceAgentReport.controller.js
server/api/voiceAgentReport/voiceAgentReport.model.js
server/api/voiceAgentReport/voiceAgentReport.rpc.js
server/api/voiceCallReport/index.js
server/api/voiceCallReport/voiceCallReport.attributes.js
server/api/voiceCallReport/voiceCallReport.controller.js
server/api/voiceCallReport/voiceCallReport.model.js
server/api/voiceCallReport/voiceCallReport.rpc.js
server/api/voiceChanSpy/index.js
server/api/voiceChanSpy/voiceChanSpy.attributes.js
server/api/voiceChanSpy/voiceChanSpy.controller.js
server/api/voiceChanSpy/voiceChanSpy.model.js
server/api/voiceChanSpy/voiceChanSpy.rpc.js
server/api/voiceContext/index.js
server/api/voiceContext/voiceContext.attributes.js
server/api/voiceContext/voiceContext.controller.js
server/api/voiceContext/voiceContext.model.js
server/api/voiceContext/voiceContext.rpc.js
server/api/voiceDialReport/index.js
server/api/voiceDialReport/voiceDialReport.attributes.js
server/api/voiceDialReport/voiceDialReport.controller.js
server/api/voiceDialReport/voiceDialReport.model.js
server/api/voiceDialReport/voiceDialReport.rpc.js
server/api/voiceExtension/index.js
server/api/voiceExtension/voiceExtension.attributes.js
server/api/voiceExtension/voiceExtension.controller.js
server/api/voiceExtension/voiceExtension.events.js
server/api/voiceExtension/voiceExtension.model.js
server/api/voiceExtension/voiceExtension.rpc.js
server/api/voiceExtension/voiceExtension.socket.js
server/api/voiceMail/index.js
server/api/voiceMail/voiceMail.attributes.js
server/api/voiceMail/voiceMail.controller.js
server/api/voiceMail/voiceMail.model.js
server/api/voiceMail/voiceMail.rpc.js
server/api/voiceMailMessage/index.js
server/api/voiceMailMessage/voiceMailMessage.attributes.js
server/api/voiceMailMessage/voiceMailMessage.controller.js
server/api/voiceMailMessage/voiceMailMessage.model.js
server/api/voiceMailMessage/voiceMailMessage.rpc.js
server/api/voiceMusicOnHold/index.js
server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js
server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js
server/api/voiceMusicOnHold/voiceMusicOnHold.model.js
server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js
server/api/voicePrefix/index.js
server/api/voicePrefix/voicePrefix.attributes.js
server/api/voicePrefix/voicePrefix.controller.js
server/api/voicePrefix/voicePrefix.events.js
server/api/voicePrefix/voicePrefix.model.js
server/api/voicePrefix/voicePrefix.rpc.js
server/api/voicePrefix/voicePrefix.socket.js
server/api/voiceQueue/index.js
server/api/voiceQueue/voiceQueue.attributes.js
server/api/voiceQueue/voiceQueue.controller.js
server/api/voiceQueue/voiceQueue.events.js
server/api/voiceQueue/voiceQueue.model.js
server/api/voiceQueue/voiceQueue.rpc.js
server/api/voiceQueue/voiceQueue.socket.js
server/api/voiceQueueReport/index.js
server/api/voiceQueueReport/voiceQueueReport.attributes.js
server/api/voiceQueueReport/voiceQueueReport.controller.js
server/api/voiceQueueReport/voiceQueueReport.events.js
server/api/voiceQueueReport/voiceQueueReport.model.js
server/api/voiceQueueReport/voiceQueueReport.rpc.js
server/api/voiceQueueReport/voiceQueueReport.socket.js
server/api/voiceQueuesLog/index.js
server/api/voiceQueuesLog/voiceQueuesLog.attributes.js
server/api/voiceQueuesLog/voiceQueuesLog.controller.js
server/api/voiceQueuesLog/voiceQueuesLog.model.js
server/api/voiceQueuesLog/voiceQueuesLog.rpc.js
server/api/voiceRecording/index.js
server/api/voiceRecording/voiceRecording.attributes.js
server/api/voiceRecording/voiceRecording.controller.js
server/api/voiceRecording/voiceRecording.model.js
server/api/voiceRecording/voiceRecording.rpc.js
server/api/voiceTransferReport/index.js
server/api/voiceTransferReport/voiceTransferReport.attributes.js
server/api/voiceTransferReport/voiceTransferReport.controller.js
server/api/voiceTransferReport/voiceTransferReport.model.js
server/api/voiceTransferReport/voiceTransferReport.rpc.js
server/api/webbar/index.js
server/api/webbar/webbar.controller.js
server/api/whatsappAccount/index.js
server/api/whatsappAccount/whatsappAccount.attributes.js
server/api/whatsappAccount/whatsappAccount.controller.js
server/api/whatsappAccount/whatsappAccount.events.js
server/api/whatsappAccount/whatsappAccount.model.js
server/api/whatsappAccount/whatsappAccount.rpc.js
server/api/whatsappAccount/whatsappAccount.socket.js
server/api/whatsappApplication/index.js
server/api/whatsappApplication/whatsappApplication.attributes.js
server/api/whatsappApplication/whatsappApplication.controller.js
server/api/whatsappApplication/whatsappApplication.model.js
server/api/whatsappApplication/whatsappApplication.rpc.js
server/api/whatsappInteraction/index.js
server/api/whatsappInteraction/whatsappInteraction.attributes.js
server/api/whatsappInteraction/whatsappInteraction.controller.js
server/api/whatsappInteraction/whatsappInteraction.events.js
server/api/whatsappInteraction/whatsappInteraction.model.js
server/api/whatsappInteraction/whatsappInteraction.rpc.js
server/api/whatsappInteraction/whatsappInteraction.socket.js
server/api/whatsappMessage/index.js
server/api/whatsappMessage/whatsappMessage.attributes.js
server/api/whatsappMessage/whatsappMessage.controller.js
server/api/whatsappMessage/whatsappMessage.events.js
server/api/whatsappMessage/whatsappMessage.model.js
server/api/whatsappMessage/whatsappMessage.rpc.js
server/api/whatsappMessage/whatsappMessage.socket.js
server/api/whatsappQueue/index.js
server/api/whatsappQueue/whatsappQueue.attributes.js
server/api/whatsappQueue/whatsappQueue.controller.js
server/api/whatsappQueue/whatsappQueue.events.js
server/api/whatsappQueue/whatsappQueue.model.js
server/api/whatsappQueue/whatsappQueue.rpc.js
server/api/whatsappQueue/whatsappQueue.socket.js
server/api/whatsappQueueReport/index.js
server/api/whatsappQueueReport/whatsappQueueReport.attributes.js
server/api/whatsappQueueReport/whatsappQueueReport.controller.js
server/api/whatsappQueueReport/whatsappQueueReport.model.js
server/api/whatsappQueueReport/whatsappQueueReport.rpc.js
server/api/whatsappTransferReport/index.js
server/api/whatsappTransferReport/whatsappTransferReport.attributes.js
server/api/whatsappTransferReport/whatsappTransferReport.controller.js
server/api/whatsappTransferReport/whatsappTransferReport.model.js
server/api/whatsappTransferReport/whatsappTransferReport.rpc.js
server/app.js
server/components/auth/service.js
server/components/contacts/index.js
server/components/contacts/sql-utils.js
server/components/encryptor/index.js
server/components/export/csv.js
server/components/export/pdf.js
server/components/export/xlsx.js
server/components/extensions/rewrite.js
server/components/import/cm/csv.js
server/components/import/cm/csv2.js
server/components/import/cm/csvUpdates.js
server/components/integrations/configuration.js
server/components/interaction/service.js
server/components/interaction/sql-utils.js
server/components/interaction/update-interaction.js
server/components/interaction/utils.js
server/components/license/service.js
server/components/parsers/advancedSearch.js
server/components/parsers/qs.js
server/components/realtime/agents.js
server/config/express.js
server/config/license/hardware.js
server/config/license/index.js
server/config/license/util.js
server/config/local.env.js
server/config/logger.js
server/config/pm2/config.js
server/config/pm2/index.js
server/config/schedule/chat.js
server/config/schedule/cloud-provider.js
server/config/schedule/index.js
server/config/schedule/transcribe.js
server/config/schedule/whatsapp.js
server/config/seedContact.js
server/config/seedUsers.js
server/config/socketio.js
server/config/triggers/index.js
server/config/utils.js
server/errors/api.js
server/errors/index.js
server/mysqldb/index.js
server/routes.js
server/rpc/index.js
server/services/agi/channel.js
server/services/agi/error.js
server/services/agi/events.js
server/services/agi/graph/index.js
server/services/agi/index.js
server/services/agi/mailRpc/index.js
server/services/agi/project.js
server/services/agi/reply.js
server/services/agi/rpc/index.js
server/services/agi/scripts/aws/index.js
server/services/agi/scripts/aws/lex/index.js
server/services/agi/scripts/aws/lex/lib/api.js
server/services/agi/scripts/aws/polly/index.js
server/services/agi/scripts/aws/polly/lib/api.js
server/services/agi/scripts/google/asr/index.js
server/services/agi/scripts/google/asr/lib/api.js
server/services/agi/scripts/index.js
server/services/agi/scripts/sestek/index.js
server/services/agi/scripts/sestek/nda/index.js
server/services/agi/scripts/tilde/asr/index.js
server/services/agi/scripts/tilde/asr/lib/api.js
server/services/agi/scripts/tilde/index.js
server/services/agi/server.js
server/services/agi/vertices.js
server/services/ami/acw/index.js
server/services/ami/ami.js
server/services/ami/client.js
server/services/ami/dialer/action.js
server/services/ami/dialer/agentComplete.js
server/services/ami/dialer/final.js
server/services/ami/dialer/hangup.js
server/services/ami/dialer/history.js
server/services/ami/dialer/index.js
server/services/ami/dialer/queueCallerAbandon.js
server/services/ami/fax/action.js
server/services/ami/fax/index.js
server/services/ami/fax/rpcDb.js
server/services/ami/fax/util/gs.js
server/services/ami/fax/util/util.js
server/services/ami/index.js
server/services/ami/model/agent.js
server/services/ami/model/campaign.js
server/services/ami/model/channel.js
server/services/ami/model/deskAccount.js
server/services/ami/model/dynamics365Account.js
server/services/ami/model/faxAccount.js
server/services/ami/model/freshdeskAccount.js
server/services/ami/model/freshsalesAccount.js
server/services/ami/model/queueReport.js
server/services/ami/model/salesforceAccount.js
server/services/ami/model/servicenowAccount.js
server/services/ami/model/sugarcrmAccount.js
server/services/ami/model/telephone.js
server/services/ami/model/template.js
server/services/ami/model/trigger.js
server/services/ami/model/trunk.js
server/services/ami/model/voiceExtension.js
server/services/ami/model/voiceQueue.js
server/services/ami/model/vtigerAccount.js
server/services/ami/model/zendeskAccount.js
server/services/ami/model/zohoAccount.js
server/services/ami/preview/action.js
server/services/ami/preview/index.js
server/services/ami/preview/rpcDb.js
server/services/ami/preview/util/util.js
server/services/ami/properties.js
server/services/ami/realtime/index.js
server/services/ami/report/index.js
server/services/ami/report/userReport.js
server/services/ami/report/voiceAgentReport.js
server/services/ami/report/voiceCallReport.js
server/services/ami/report/voiceDialReport.js
server/services/ami/report/voiceQueueReport.js
server/services/ami/rpc/agentReportPreview.js
server/services/ami/rpc/attachment.js
server/services/ami/rpc/campaign.js
server/services/ami/rpc/cmContact.js
server/services/ami/rpc/cmHopper.js
server/services/ami/rpc/cmHopperAdditionalPhone.js
server/services/ami/rpc/cmHopperBlack.js
server/services/ami/rpc/cmHopperFinal.js
server/services/ami/rpc/cmHopperHistory.js
server/services/ami/rpc/faxAccount.js
server/services/ami/rpc/faxMessage.js
server/services/ami/rpc/integrations/desk.js
server/services/ami/rpc/integrations/dynamics365.js
server/services/ami/rpc/integrations/freshdesk.js
server/services/ami/rpc/integrations/freshsales.js
server/services/ami/rpc/integrations/salesforce.js
server/services/ami/rpc/integrations/servicenow.js
server/services/ami/rpc/integrations/sugarcrm.js
server/services/ami/rpc/integrations/vtiger.js
server/services/ami/rpc/integrations/zendesk.js
server/services/ami/rpc/integrations/zoho.js
server/services/ami/rpc/memberReport.js
server/services/ami/rpc/setting.js
server/services/ami/rpc/template.js
server/services/ami/rpc/trigger.js
server/services/ami/rpc/trunk.js
server/services/ami/rpc/user.js
server/services/ami/rpc/voiceAgentReport.js
server/services/ami/rpc/voiceCallReport.js
server/services/ami/rpc/voiceDialReport.js
server/services/ami/rpc/voiceExtension.js
server/services/ami/rpc/voiceQueue.js
server/services/ami/rpc/voiceQueueReport.js
server/services/ami/rpc/voiceQueueRt.js
server/services/ami/rpc/voiceRecording.js
server/services/ami/rpc/voiceTransferReport.js
server/services/ami/server/index.js
server/services/ami/trigger/cmContact/index.js
server/services/ami/trigger/index.js
server/services/ami/trigger/integration/desk.js
server/services/ami/trigger/integration/dynamics365.js
server/services/ami/trigger/integration/freshdesk.js
server/services/ami/trigger/integration/freshsales.js
server/services/ami/trigger/integration/index.js
server/services/ami/trigger/integration/salesforce.js
server/services/ami/trigger/integration/servicenow.js
server/services/ami/trigger/integration/sugarcrm.js
server/services/ami/trigger/integration/util.js
server/services/ami/trigger/integration/vtiger.js
server/services/ami/trigger/integration/zendesk.js
server/services/ami/trigger/integration/zoho.js
server/services/ami/trigger/script/index.js
server/services/ami/trigger/urlforward/index.js
server/services/email/client.js
server/services/email/index.js
server/services/email/lib/email.js
server/services/email/lib/imap.js
server/services/email/lib/smtp.js
server/services/email/lib/utils.js
server/services/email/model/mailAccount.js
server/services/email/realtime/index.js
server/services/email/rpc/mailAccount.js
server/services/email/rpc/setting.js
server/services/email/server/index.js
server/services/express/index.js
server/services/routing/client.js
server/services/routing/index.js
server/services/routing/lib/rule-engine.js
server/services/routing/mailRpc/index.js
server/services/routing/model/agent.js
server/services/routing/model/chatQueue.js
server/services/routing/model/faxQueue.js
server/services/routing/model/interval.js
server/services/routing/model/mailQueue.js
server/services/routing/model/openchannelQueue.js
server/services/routing/model/smsQueue.js
server/services/routing/model/whatsappQueue.js
server/services/routing/realtime/index.js
server/services/routing/rpc/chatInteraction.js
server/services/routing/rpc/chatMessage.js
server/services/routing/rpc/chatQueue.js
server/services/routing/rpc/chatQueueReport.js
server/services/routing/rpc/faxInteraction.js
server/services/routing/rpc/faxMessage.js
server/services/routing/rpc/faxQueue.js
server/services/routing/rpc/faxQueueReport.js
server/services/routing/rpc/interval.js
server/services/routing/rpc/mailInteraction.js
server/services/routing/rpc/mailMessage.js
server/services/routing/rpc/mailQueue.js
server/services/routing/rpc/mailQueueReport.js
server/services/routing/rpc/openchannelInteraction.js
server/services/routing/rpc/openchannelMessage.js
server/services/routing/rpc/openchannelQueue.js
server/services/routing/rpc/openchannelQueueReport.js
server/services/routing/rpc/smsInteraction.js
server/services/routing/rpc/smsMessage.js
server/services/routing/rpc/smsQueue.js
server/services/routing/rpc/smsQueueReport.js
server/services/routing/rpc/user.js
server/services/routing/rpc/whatsappInteraction.js
server/services/routing/rpc/whatsappMessage.js
server/services/routing/rpc/whatsappQueue.js
server/services/routing/rpc/whatsappQueueReport.js
server/services/routing/server/applications/agent.js
server/services/routing/server/applications/amazonlex.js
server/services/routing/server/applications/autoreply.js
server/services/routing/server/applications/close.js
server/services/routing/server/applications/dialogflow.js
server/services/routing/server/applications/dialogflowV2.js
server/services/routing/server/applications/gotoif.js
server/services/routing/server/applications/gotop.js
server/services/routing/server/applications/message.js
server/services/routing/server/applications/noop.js
server/services/routing/server/applications/queue.js
server/services/routing/server/applications/strategy/agent.js
server/services/routing/server/applications/strategy/beepall.js
server/services/routing/server/applications/strategy/index.js
server/services/routing/server/applications/strategy/rrmemory.js
server/services/routing/server/applications/strategy/util.js
server/services/routing/server/applications/system.js
server/services/routing/server/applications/tag.js
server/services/routing/server/applications/tvox.js
server/services/routing/server/applications/utils.js
server/services/routing/server/index.js
server/services/routing/server/interval.js
server/services/xdr/agents.controller.js
server/services/xdr/calls.controller.js
server/services/xdr/core.controller.js
server/services/xdr/dials.controller.js
server/services/xdr/index.js
server/services/xdr/members.controller.js
server/services/xdr/queues.controller.js
server/services/xdr/recordings.controller.js
server/services/xdr/transfers.controller.js
server/services/xdr/utils.js
server/utils/client-side-logger.js
server/utils/loggers.js
server/utils/mask-sensitive-data.js
server/utils/safe-template.js

index 8fd175c..a2df435 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-04-11T08:01:41.115Z",
+    "time": "2022-04-11T12:44:26.952Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 0bd6e6d..fa055b4 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2022-04-11T08:01:41.115Z",
+    "time": "2022-04-11T12:44:26.952Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 43e9ce6..62487db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd88=['motionbar','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x15579d,_0x15f60b){var _0x17f3ae=function(_0x3360d8){while(--_0x3360d8){_0x15579d['push'](_0x15579d['shift']());}};_0x17f3ae(++_0x15f60b);}(_0xcd88,0xb6));var _0x8cd8=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0xcd88[_0x2e41e2];return _0x2844d6;};'use strict';var Sequelize=require(_0x8cd8('0x0'));module[_0x8cd8('0x1')]={'name':{'type':Sequelize[_0x8cd8('0x2')],'get':function(_0x56268b){return this[_0x8cd8('0x3')](_0x8cd8('0x4'));}},'action':{'type':Sequelize[_0x8cd8('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x8cd8('0x6'),_0x8cd8('0x7'),_0x8cd8('0x8'),'jscripty',_0x8cd8('0x9'),'browser',_0x8cd8('0xa'),_0x8cd8('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x8cd8('0xc')},'data1':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comment':_0x8cd8('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x8cd8('0xe')},'data3':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comment':_0x8cd8('0xf')},'data4':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comments':_0x8cd8('0x10')},'data5':{'type':Sequelize[_0x8cd8('0x5')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x8cd8('0x5')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x8cd8('0x11')],'comments':_0x8cd8('0x12')}};
\ No newline at end of file
+var _0x7ece=['motionbar','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x345571,_0x3e5f77){var _0xfd5a25=function(_0x2ebc68){while(--_0x2ebc68){_0x345571['push'](_0x345571['shift']());}};_0xfd5a25(++_0x3e5f77);}(_0x7ece,0xc9));var _0xe7ec=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x7ece[_0x1e4360];return _0x31e6b4;};'use strict';var Sequelize=require('sequelize');module[_0xe7ec('0x0')]={'name':{'type':Sequelize[_0xe7ec('0x1')],'get':function(_0x47b71f){return this[_0xe7ec('0x2')](_0xe7ec('0x3'));}},'action':{'type':Sequelize[_0xe7ec('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe7ec('0x5'),_0xe7ec('0x6'),_0xe7ec('0x7'),'jscripty','urlForward',_0xe7ec('0x8'),'bot',_0xe7ec('0x9')]],'msg':_0xe7ec('0xa')}},'comment':_0xe7ec('0xa')},'data1':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':_0xe7ec('0xb')},'data2':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xe7ec('0x4')](0x1000),'comments':_0xe7ec('0xc')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0xe7ec('0xd')},'data6':{'type':Sequelize[_0xe7ec('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xe7ec('0xe')],'comments':_0xe7ec('0xf')}};
\ No newline at end of file
index 3495334..4327031 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8540=['to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','stack','name','send','update','body','params','catch','Action','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x51feac,_0x34a74f){var _0x52f5b2=function(_0x28e60f){while(--_0x28e60f){_0x51feac['push'](_0x51feac['shift']());}};_0x52f5b2(++_0x34a74f);}(_0x8540,0xba));var _0x0854=function(_0xca1f0e,_0x2713d5){_0xca1f0e=_0xca1f0e-0x0;var _0x35e4ef=_0x8540[_0xca1f0e];return _0x35e4ef;};'use strict';var emlformat=require(_0x0854('0x0'));var rimraf=require(_0x0854('0x1'));var zipdir=require(_0x0854('0x2'));var jsonpatch=require(_0x0854('0x3'));var rp=require(_0x0854('0x4'));var moment=require(_0x0854('0x5'));var BPromise=require(_0x0854('0x6'));var Mustache=require(_0x0854('0x7'));var util=require(_0x0854('0x8'));var path=require(_0x0854('0x9'));var sox=require('sox');var csv=require(_0x0854('0xa'));var ejs=require(_0x0854('0xb'));var fs=require('fs');var fs_extra=require(_0x0854('0xc'));var _=require('lodash');var squel=require(_0x0854('0xd'));var crypto=require('crypto');var jsforce=require(_0x0854('0xe'));var deskjs=require(_0x0854('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0854('0x10'));var Papa=require(_0x0854('0x11'));var Redis=require('ioredis');var authService=require(_0x0854('0x12'));var qs=require(_0x0854('0x13'));var as=require(_0x0854('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0854('0x15'))(_0x0854('0x16'));var utils=require(_0x0854('0x17'));var config=require(_0x0854('0x18'));var licenseUtil=require(_0x0854('0x19'));var db=require(_0x0854('0x1a'))['db'];function respondWithStatusCode(_0xcae5f,_0x3f2717){_0x3f2717=_0x3f2717||0xcc;return function(_0x4861ca){if(_0x4861ca){return _0xcae5f[_0x0854('0x1b')](_0x3f2717);}return _0xcae5f['status'](_0x3f2717)[_0x0854('0x1c')]();};}function respondWithResult(_0xf64fe0,_0x39618c){_0x39618c=_0x39618c||0xc8;return function(_0x11cf68){if(_0x11cf68){return _0xf64fe0[_0x0854('0x1d')](_0x39618c)[_0x0854('0x1e')](_0x11cf68);}};}function respondWithFilteredResult(_0x2d5935,_0x3d1942){return function(_0x597fe3){if(_0x597fe3){var _0x6f6557=typeof _0x3d1942[_0x0854('0x1f')]===_0x0854('0x20')&&typeof _0x3d1942[_0x0854('0x21')]===_0x0854('0x20');var _0x1f08ff=_0x597fe3[_0x0854('0x22')];var _0x3fbfba=_0x6f6557?0x0:_0x3d1942[_0x0854('0x1f')];var _0x53e8c2=_0x6f6557?_0x597fe3['count']:_0x3d1942[_0x0854('0x1f')]+_0x3d1942['limit'];var _0x5b3968;if(_0x53e8c2>=_0x1f08ff){_0x53e8c2=_0x1f08ff;_0x5b3968=0xc8;}else{_0x5b3968=0xce;}_0x2d5935[_0x0854('0x1d')](_0x5b3968);return _0x2d5935[_0x0854('0x23')](_0x0854('0x24'),_0x3fbfba+'-'+_0x53e8c2+'/'+_0x1f08ff)[_0x0854('0x1e')](_0x597fe3);}return null;};}function patchUpdates(_0x7a95f7){return function(_0x44d314){try{jsonpatch[_0x0854('0x25')](_0x44d314,_0x7a95f7,!![]);}catch(_0x3bf9a0){return BPromise['reject'](_0x3bf9a0);}return _0x44d314['save']();};}function saveUpdates(_0xe58a99,_0x6e9226){return function(_0x28b959){if(_0x28b959){return _0x28b959['update'](_0xe58a99)[_0x0854('0x26')](function(_0x30a0e0){return _0x30a0e0;});}return null;};}function removeEntity(_0x16792e,_0x61b3f2){return function(_0x1d3897){if(_0x1d3897){return _0x1d3897[_0x0854('0x27')]()['then'](function(){_0x16792e[_0x0854('0x1d')](0xcc)[_0x0854('0x1c')]();});}};}function handleEntityNotFound(_0x22709c,_0x43fc04){return function(_0x213075){if(!_0x213075){_0x22709c['sendStatus'](0x194);}return _0x213075;};}function handleError(_0x4c457e,_0x27302b){_0x27302b=_0x27302b||0x1f4;return function(_0x37dd46){logger['error'](_0x37dd46[_0x0854('0x28')]);if(_0x37dd46[_0x0854('0x29')]){delete _0x37dd46[_0x0854('0x29')];}_0x4c457e[_0x0854('0x1d')](_0x27302b)[_0x0854('0x2a')](_0x37dd46);};}exports[_0x0854('0x2b')]=function(_0x30640d,_0x6d97e6){if(_0x30640d[_0x0854('0x2c')]['id']){delete _0x30640d[_0x0854('0x2c')]['id'];}return db['Action']['find']({'where':{'id':_0x30640d[_0x0854('0x2d')]['id']}})['then'](handleEntityNotFound(_0x6d97e6,null))[_0x0854('0x26')](saveUpdates(_0x30640d[_0x0854('0x2c')],null))[_0x0854('0x26')](respondWithResult(_0x6d97e6,null))[_0x0854('0x2e')](handleError(_0x6d97e6,null));};exports[_0x0854('0x27')]=function(_0xd5b8c,_0x50d981){return db[_0x0854('0x2f')][_0x0854('0x30')]({'where':{'id':_0xd5b8c['params']['id']}})[_0x0854('0x26')](handleEntityNotFound(_0x50d981,null))[_0x0854('0x26')](removeEntity(_0x50d981,null))[_0x0854('0x2e')](handleError(_0x50d981,null));};
\ No newline at end of file
+var _0x0654=['undefined','limit','count','offset','set','Content-Range','json','reject','save','update','destroy','then','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0xa201ee,_0x37da32){var _0x3e104d=function(_0x4cd637){while(--_0x4cd637){_0xa201ee['push'](_0xa201ee['shift']());}};_0x3e104d(++_0x37da32);}(_0x0654,0xa2));var _0x4065=function(_0xc7f8f6,_0x533440){_0xc7f8f6=_0xc7f8f6-0x0;var _0x1f98da=_0x0654[_0xc7f8f6];return _0x1f98da;};'use strict';var emlformat=require(_0x4065('0x0'));var rimraf=require(_0x4065('0x1'));var zipdir=require(_0x4065('0x2'));var jsonpatch=require(_0x4065('0x3'));var rp=require(_0x4065('0x4'));var moment=require('moment');var BPromise=require(_0x4065('0x5'));var Mustache=require('mustache');var util=require(_0x4065('0x6'));var path=require(_0x4065('0x7'));var sox=require(_0x4065('0x8'));var csv=require('to-csv');var ejs=require(_0x4065('0x9'));var fs=require('fs');var fs_extra=require(_0x4065('0xa'));var _=require(_0x4065('0xb'));var squel=require('squel');var crypto=require(_0x4065('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4065('0xd'));var toCsv=require(_0x4065('0xe'));var querystring=require('querystring');var Papa=require(_0x4065('0xf'));var Redis=require(_0x4065('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4065('0x11'));var as=require(_0x4065('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4065('0x13'))(_0x4065('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4065('0x15'));var db=require(_0x4065('0x16'))['db'];function respondWithStatusCode(_0xdd9097,_0x537a87){_0x537a87=_0x537a87||0xcc;return function(_0x4fc507){if(_0x4fc507){return _0xdd9097[_0x4065('0x17')](_0x537a87);}return _0xdd9097[_0x4065('0x18')](_0x537a87)[_0x4065('0x19')]();};}function respondWithResult(_0x514739,_0x57a813){_0x57a813=_0x57a813||0xc8;return function(_0x574483){if(_0x574483){return _0x514739[_0x4065('0x18')](_0x57a813)['json'](_0x574483);}};}function respondWithFilteredResult(_0x36e91c,_0x5a1f27){return function(_0x14cc53){if(_0x14cc53){var _0x48e9fd=typeof _0x5a1f27['offset']===_0x4065('0x1a')&&typeof _0x5a1f27[_0x4065('0x1b')]===_0x4065('0x1a');var _0x52f517=_0x14cc53[_0x4065('0x1c')];var _0x177a5b=_0x48e9fd?0x0:_0x5a1f27[_0x4065('0x1d')];var _0x901b30=_0x48e9fd?_0x14cc53['count']:_0x5a1f27[_0x4065('0x1d')]+_0x5a1f27[_0x4065('0x1b')];var _0x1ae04c;if(_0x901b30>=_0x52f517){_0x901b30=_0x52f517;_0x1ae04c=0xc8;}else{_0x1ae04c=0xce;}_0x36e91c[_0x4065('0x18')](_0x1ae04c);return _0x36e91c[_0x4065('0x1e')](_0x4065('0x1f'),_0x177a5b+'-'+_0x901b30+'/'+_0x52f517)[_0x4065('0x20')](_0x14cc53);}return null;};}function patchUpdates(_0x9b2664){return function(_0x772be4){try{jsonpatch['apply'](_0x772be4,_0x9b2664,!![]);}catch(_0x4ae5d8){return BPromise[_0x4065('0x21')](_0x4ae5d8);}return _0x772be4[_0x4065('0x22')]();};}function saveUpdates(_0x4dee0f,_0x4a36d7){return function(_0x3f31ee){if(_0x3f31ee){return _0x3f31ee[_0x4065('0x23')](_0x4dee0f)['then'](function(_0x1be742){return _0x1be742;});}return null;};}function removeEntity(_0x1c7ec0,_0x359278){return function(_0x80bd4c){if(_0x80bd4c){return _0x80bd4c[_0x4065('0x24')]()[_0x4065('0x25')](function(){_0x1c7ec0['status'](0xcc)[_0x4065('0x19')]();});}};}function handleEntityNotFound(_0x4a5def,_0x45030b){return function(_0x279cd8){if(!_0x279cd8){_0x4a5def[_0x4065('0x17')](0x194);}return _0x279cd8;};}function handleError(_0x37816f,_0x4e0ce3){_0x4e0ce3=_0x4e0ce3||0x1f4;return function(_0x46ad1f){logger[_0x4065('0x26')](_0x46ad1f[_0x4065('0x27')]);if(_0x46ad1f[_0x4065('0x28')]){delete _0x46ad1f[_0x4065('0x28')];}_0x37816f[_0x4065('0x18')](_0x4e0ce3)[_0x4065('0x29')](_0x46ad1f);};}exports[_0x4065('0x23')]=function(_0x3e6081,_0x51a0dc){if(_0x3e6081[_0x4065('0x2a')]['id']){delete _0x3e6081[_0x4065('0x2a')]['id'];}return db[_0x4065('0x2b')][_0x4065('0x2c')]({'where':{'id':_0x3e6081[_0x4065('0x2d')]['id']}})[_0x4065('0x25')](handleEntityNotFound(_0x51a0dc,null))['then'](saveUpdates(_0x3e6081['body'],null))[_0x4065('0x25')](respondWithResult(_0x51a0dc,null))[_0x4065('0x2e')](handleError(_0x51a0dc,null));};exports['destroy']=function(_0x5a590a,_0x5696ac){return db[_0x4065('0x2b')]['find']({'where':{'id':_0x5a590a[_0x4065('0x2d')]['id']}})['then'](handleEntityNotFound(_0x5696ac,null))[_0x4065('0x25')](removeEntity(_0x5696ac,null))[_0x4065('0x2e')](handleError(_0x5696ac,null));};
\ No newline at end of file
index d8b3569..16959f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5989=['request-promise','path','rimraf','exports','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbab2fe,_0x4a1066){var _0x2b4aee=function(_0x31c17a){while(--_0x31c17a){_0xbab2fe['push'](_0xbab2fe['shift']());}};_0x2b4aee(++_0x4a1066);}(_0x5989,0xd6));var _0x9598=function(_0x614dc5,_0x3dd98e){_0x614dc5=_0x614dc5-0x0;var _0x571e07=_0x5989[_0x614dc5];return _0x571e07;};'use strict';var _=require(_0x9598('0x0'));var util=require(_0x9598('0x1'));var logger=require(_0x9598('0x2'))(_0x9598('0x3'));var moment=require(_0x9598('0x4'));var BPromise=require(_0x9598('0x5'));var rp=require(_0x9598('0x6'));var fs=require('fs');var path=require(_0x9598('0x7'));var rimraf=require(_0x9598('0x8'));var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x9598('0x9')]=function(_0x45cd37,_0x1fe04a){return _0x45cd37['define']('Action',attributes,{'tableName':_0x9598('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x129d=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions'];(function(_0x4cbb3b,_0x13b6a9){var _0x48f15c=function(_0x311792){while(--_0x311792){_0x4cbb3b['push'](_0x4cbb3b['shift']());}};_0x48f15c(++_0x13b6a9);}(_0x129d,0x15f));var _0xd129=function(_0x1335e9,_0x3dcc22){_0x1335e9=_0x1335e9-0x0;var _0x55144f=_0x129d[_0x1335e9];return _0x55144f;};'use strict';var _=require('lodash');var util=require(_0xd129('0x0'));var logger=require(_0xd129('0x1'))('api');var moment=require(_0xd129('0x2'));var BPromise=require(_0xd129('0x3'));var rp=require(_0xd129('0x4'));var fs=require('fs');var path=require(_0xd129('0x5'));var rimraf=require(_0xd129('0x6'));var config=require(_0xd129('0x7'));var attributes=require(_0xd129('0x8'));module[_0xd129('0x9')]=function(_0x260a6e,_0x2762be){return _0x260a6e[_0xd129('0xa')](_0xd129('0xb'),attributes,{'tableName':_0xd129('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7591e09..6e3c1b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x118cdb,_0x4db43f){var _0x1b312e=function(_0x45a678){while(--_0x45a678){_0x118cdb['push'](_0x118cdb['shift']());}};_0x1b312e(++_0x4db43f);}(_0x326f,0xd1));var _0xf326=function(_0x4aaca5,_0x1430b5){_0x4aaca5=_0x4aaca5-0x0;var _0x3b180d=_0x326f[_0x4aaca5];return _0x3b180d;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1d08c6,_0x1447e5){var _0x474b22=function(_0x3282e9){while(--_0x3282e9){_0x1d08c6['push'](_0x1d08c6['shift']());}};_0x474b22(++_0x1447e5);}(_0xabce,0x103));var _0xeabc=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0xabce[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
index 6ba6bac..c70c899 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a34=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','isAuthenticated','destroy','multer'];(function(_0x3480cd,_0x4be7bc){var _0xa7a30e=function(_0x53a971){while(--_0x53a971){_0x3480cd['push'](_0x3480cd['shift']());}};_0xa7a30e(++_0x4be7bc);}(_0x8a34,0xff));var _0x48a3=function(_0x2350dd,_0x53e293){_0x2350dd=_0x2350dd-0x0;var _0x5ca2db=_0x8a34[_0x2350dd];return _0x5ca2db;};'use strict';var multer=require(_0x48a3('0x0'));var util=require(_0x48a3('0x1'));var path=require(_0x48a3('0x2'));var timeout=require(_0x48a3('0x3'));var express=require(_0x48a3('0x4'));var router=express[_0x48a3('0x5')]();var fs_extra=require(_0x48a3('0x6'));var auth=require(_0x48a3('0x7'));var interaction=require(_0x48a3('0x8'));var config=require(_0x48a3('0x9'));var controller=require('./action.controller');router[_0x48a3('0xa')](_0x48a3('0xb'),auth['isAuthenticated'](),controller[_0x48a3('0xc')]);router[_0x48a3('0xd')]('/:id',auth[_0x48a3('0xe')](),controller[_0x48a3('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x04af=['Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x2e4dc9,_0x4a3666){var _0x3c047a=function(_0xf10516){while(--_0xf10516){_0x2e4dc9['push'](_0x2e4dc9['shift']());}};_0x3c047a(++_0x4a3666);}(_0x04af,0x74));var _0xf04a=function(_0x36b144,_0x4d8208){_0x36b144=_0x36b144-0x0;var _0x4fd301=_0x04af[_0x36b144];return _0x4fd301;};'use strict';var multer=require(_0xf04a('0x0'));var util=require(_0xf04a('0x1'));var path=require('path');var timeout=require(_0xf04a('0x2'));var express=require(_0xf04a('0x3'));var router=express[_0xf04a('0x4')]();var fs_extra=require(_0xf04a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf04a('0x6'));var config=require(_0xf04a('0x7'));var controller=require(_0xf04a('0x8'));router['put'](_0xf04a('0x9'),auth[_0xf04a('0xa')](),controller[_0xf04a('0xb')]);router[_0xf04a('0xc')](_0xf04a('0x9'),auth[_0xf04a('0xa')](),controller[_0xf04a('0xd')]);module[_0xf04a('0xe')]=router;
\ No newline at end of file
index 8015d84..07b1d28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd51=['sequelize','STRING'];(function(_0x46723d,_0x3d6bd5){var _0x5e2b3a=function(_0x1a3c33){while(--_0x1a3c33){_0x46723d['push'](_0x46723d['shift']());}};_0x5e2b3a(++_0x3d6bd5);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3eafbd,_0x188a3d){_0x3eafbd=_0x3eafbd-0x0;var _0x5150bc=_0xbd51[_0x3eafbd];return _0x5150bc;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xee14=['STRING','TEXT'];(function(_0x45a587,_0x1d20af){var _0x2f5cf5=function(_0x1bb80d){while(--_0x1bb80d){_0x45a587['push'](_0x45a587['shift']());}};_0x2f5cf5(++_0x1d20af);}(_0xee14,0x13a));var _0x4ee1=function(_0x5c2847,_0x1b45a4){_0x5c2847=_0x5c2847-0x0;var _0x335929=_0xee14[_0x5c2847];return _0x335929;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4ee1('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x4ee1('0x0')]},'parent':{'type':Sequelize[_0x4ee1('0x0')]},'table':{'type':Sequelize[_0x4ee1('0x0')]},'conditions':{'type':Sequelize[_0x4ee1('0x1')]},'joins':{'type':Sequelize[_0x4ee1('0x1')]}};
\ No newline at end of file
index 7694073..e048e58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0cf9=['length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Reports','UserProfileSection','userProfileId','UserProfileResource','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','from','MetricId','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','join','right_join','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','AnalyticMetric','select','output','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','keyBy','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','get','end','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields'];(function(_0x595343,_0x751cb4){var _0x279ff2=function(_0x3c0697){while(--_0x3c0697){_0x595343['push'](_0x595343['shift']());}};_0x279ff2(++_0x751cb4);}(_0x0cf9,0x6d));var _0x90cf=function(_0x3f9584,_0x5ab12c){_0x3f9584=_0x3f9584-0x0;var _0x9d54c=_0x0cf9[_0x3f9584];return _0x9d54c;};'use strict';var emlformat=require(_0x90cf('0x0'));var rimraf=require(_0x90cf('0x1'));var zipdir=require(_0x90cf('0x2'));var jsonpatch=require(_0x90cf('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90cf('0x4'));var util=require(_0x90cf('0x5'));var path=require(_0x90cf('0x6'));var sox=require('sox');var csv=require(_0x90cf('0x7'));var ejs=require(_0x90cf('0x8'));var fs=require('fs');var fs_extra=require(_0x90cf('0x9'));var _=require('lodash');var squel=require(_0x90cf('0xa'));var crypto=require(_0x90cf('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x90cf('0xc'));var Papa=require(_0x90cf('0xd'));var Redis=require(_0x90cf('0xe'));var authService=require(_0x90cf('0xf'));var qs=require(_0x90cf('0x10'));var as=require(_0x90cf('0x11'));var hardwareService=require(_0x90cf('0x12'));var logger=require('../../config/logger')(_0x90cf('0x13'));var utils=require(_0x90cf('0x14'));var config=require(_0x90cf('0x15'));var licenseUtil=require(_0x90cf('0x16'));var db=require('../../mysqldb')['db'];var dbH=require(_0x90cf('0x17'))['dbH'];function respondWithStatusCode(_0x2ca6a7,_0x2f044a){_0x2f044a=_0x2f044a||0xcc;return function(_0x31cc63){if(_0x31cc63){return _0x2ca6a7[_0x90cf('0x18')](_0x2f044a);}return _0x2ca6a7['status'](_0x2f044a)['end']();};}function respondWithResult(_0x40fc6a,_0x9f55a9){_0x9f55a9=_0x9f55a9||0xc8;return function(_0x1e66ca){if(_0x1e66ca){return _0x40fc6a[_0x90cf('0x19')](_0x9f55a9)[_0x90cf('0x1a')](_0x1e66ca);}};}function respondWithFilteredResult(_0x199b7d,_0x2235c4){return function(_0x484d90){if(_0x484d90){var _0x2d913b=typeof _0x2235c4[_0x90cf('0x1b')]===_0x90cf('0x1c')&&typeof _0x2235c4['limit']===_0x90cf('0x1c');var _0x37e3d4=_0x484d90['count'];var _0x58e037=_0x2d913b?0x0:_0x2235c4[_0x90cf('0x1b')];var _0x1ad73c=_0x2d913b?_0x484d90[_0x90cf('0x1d')]:_0x2235c4[_0x90cf('0x1b')]+_0x2235c4[_0x90cf('0x1e')];var _0x37db67;if(_0x1ad73c>=_0x37e3d4){_0x1ad73c=_0x37e3d4;_0x37db67=0xc8;}else{_0x37db67=0xce;}_0x199b7d[_0x90cf('0x19')](_0x37db67);return _0x199b7d[_0x90cf('0x1f')](_0x90cf('0x20'),_0x58e037+'-'+_0x1ad73c+'/'+_0x37e3d4)[_0x90cf('0x1a')](_0x484d90);}return null;};}function patchUpdates(_0x3dd91b){return function(_0x34c00a){try{jsonpatch[_0x90cf('0x21')](_0x34c00a,_0x3dd91b,!![]);}catch(_0x94f94b){return BPromise['reject'](_0x94f94b);}return _0x34c00a['save']();};}function saveUpdates(_0xf59213,_0x23bf41){return function(_0x3cb0fa){if(_0x3cb0fa){return _0x3cb0fa[_0x90cf('0x22')](_0xf59213)[_0x90cf('0x23')](function(_0x293ef0){return _0x293ef0;});}return null;};}function removeEntity(_0x4f9415,_0x47fc4d){return function(_0x1bc2db){if(_0x1bc2db){return _0x1bc2db[_0x90cf('0x24')]()[_0x90cf('0x23')](function(){var _0x1cc07e=_0x1bc2db[_0x90cf('0x25')]({'plain':!![]});var _0x3268e5='CustomReports';return db['UserProfileResource'][_0x90cf('0x24')]({'where':{'type':_0x3268e5,'resourceId':_0x1cc07e['id']}})['then'](function(){return _0x1bc2db;});})[_0x90cf('0x23')](function(){_0x4f9415[_0x90cf('0x19')](0xcc)[_0x90cf('0x26')]();});}};}function handleEntityNotFound(_0x2a78a6,_0x55621e){return function(_0x24ac31){if(!_0x24ac31){_0x2a78a6['sendStatus'](0x194);}return _0x24ac31;};}function handleError(_0x41a11c,_0xeee69b){_0xeee69b=_0xeee69b||0x1f4;return function(_0x35316e){logger[_0x90cf('0x27')](_0x35316e[_0x90cf('0x28')]);if(_0x35316e[_0x90cf('0x29')]){delete _0x35316e[_0x90cf('0x29')];}_0x41a11c[_0x90cf('0x19')](_0xeee69b)[_0x90cf('0x2a')](_0x35316e);};}exports[_0x90cf('0x2b')]=function(_0x4ec92e,_0x2e8ac1){var _0x2e143f={},_0x76c837={},_0x97f100={'count':0x0,'rows':[]};var _0x40542e=_['map'](db[_0x90cf('0x2c')][_0x90cf('0x2d')],function(_0x1c392f){return{'name':_0x1c392f[_0x90cf('0x2e')],'type':_0x1c392f['type'][_0x90cf('0x2f')]};});_0x76c837[_0x90cf('0x30')]=_['map'](_0x40542e,_0x90cf('0x29'));_0x76c837[_0x90cf('0x31')]=_[_0x90cf('0x32')](_0x4ec92e[_0x90cf('0x31')]);_0x76c837[_0x90cf('0x33')]=_['intersection'](_0x76c837[_0x90cf('0x30')],_0x76c837[_0x90cf('0x31')]);_0x2e143f[_0x90cf('0x34')]=_['intersection'](_0x76c837[_0x90cf('0x30')],qs['fields'](_0x4ec92e['query'][_0x90cf('0x35')]));_0x2e143f[_0x90cf('0x34')]=_0x2e143f[_0x90cf('0x34')][_0x90cf('0x36')]?_0x2e143f[_0x90cf('0x34')]:_0x76c837['model'];if(!_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x37')]('nolimit')){_0x2e143f['limit']=qs['limit'](_0x4ec92e[_0x90cf('0x31')]['limit']);_0x2e143f['offset']=qs[_0x90cf('0x1b')](_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x1b')]);}_0x2e143f[_0x90cf('0x38')]=qs[_0x90cf('0x39')](_0x4ec92e['query'][_0x90cf('0x39')]);_0x2e143f[_0x90cf('0x3a')]=qs[_0x90cf('0x33')](_[_0x90cf('0x3b')](_0x4ec92e[_0x90cf('0x31')],_0x76c837[_0x90cf('0x33')]),_0x40542e);if(_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3c')]){_0x2e143f['where']=_[_0x90cf('0x3d')](_0x2e143f[_0x90cf('0x3a')],{'$or':_['map'](_0x40542e,function(_0x12249f){if(_0x12249f['type']!=='VIRTUAL'){var _0x143ae4={};_0x143ae4[_0x12249f[_0x90cf('0x29')]]={'$like':'%'+_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3c')]+'%'};return _0x143ae4;}})});}_0x2e143f=_[_0x90cf('0x3d')]({},_0x2e143f,_0x4ec92e[_0x90cf('0x3e')]);var _0x505d53={'where':_0x2e143f[_0x90cf('0x3a')]};return db['AnalyticCustomReport']['count'](_0x505d53)[_0x90cf('0x23')](function(_0x1ed5b0){_0x97f100[_0x90cf('0x1d')]=_0x1ed5b0;if(_0x4ec92e[_0x90cf('0x31')][_0x90cf('0x3f')]){_0x2e143f[_0x90cf('0x40')]=[{'all':!![]}];}return db[_0x90cf('0x2c')][_0x90cf('0x41')](_0x2e143f);})[_0x90cf('0x23')](function(_0x2384d2){_0x97f100[_0x90cf('0x42')]=_0x2384d2;return _0x97f100;})[_0x90cf('0x23')](respondWithFilteredResult(_0x2e8ac1,_0x2e143f))[_0x90cf('0x43')](handleError(_0x2e8ac1,null));};exports[_0x90cf('0x44')]=function(_0x19abd5,_0x26b9ad){var _0x143ff7={'raw':![],'where':{'id':_0x19abd5[_0x90cf('0x45')]['id']}},_0x3f8975={};_0x3f8975[_0x90cf('0x30')]=_[_0x90cf('0x32')](db['AnalyticCustomReport'][_0x90cf('0x2d')]);_0x3f8975[_0x90cf('0x31')]=_[_0x90cf('0x32')](_0x19abd5[_0x90cf('0x31')]);_0x3f8975['filters']=_[_0x90cf('0x46')](_0x3f8975[_0x90cf('0x30')],_0x3f8975[_0x90cf('0x31')]);_0x143ff7['attributes']=_[_0x90cf('0x46')](_0x3f8975['model'],qs[_0x90cf('0x35')](_0x19abd5[_0x90cf('0x31')]['fields']));_0x143ff7[_0x90cf('0x34')]=_0x143ff7[_0x90cf('0x34')][_0x90cf('0x36')]?_0x143ff7[_0x90cf('0x34')]:_0x3f8975['model'];if(_0x19abd5[_0x90cf('0x31')][_0x90cf('0x3f')]){_0x143ff7[_0x90cf('0x40')]=[{'all':!![]}];}_0x143ff7=_[_0x90cf('0x3d')]({},_0x143ff7,_0x19abd5['options']);return db['AnalyticCustomReport'][_0x90cf('0x47')](_0x143ff7)[_0x90cf('0x23')](handleEntityNotFound(_0x26b9ad,null))['then'](respondWithResult(_0x26b9ad,null))[_0x90cf('0x43')](handleError(_0x26b9ad,null));};exports[_0x90cf('0x48')]=function(_0x592a80,_0x4c2d27){return db[_0x90cf('0x2c')][_0x90cf('0x48')](_0x592a80[_0x90cf('0x49')],{})[_0x90cf('0x23')](function(_0x40f069){var _0x5a8005=_0x592a80[_0x90cf('0x4a')][_0x90cf('0x25')]({'plain':!![]});if(!_0x5a8005)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a8005['role']==='user'){var _0x33e6bf=_0x40f069['get']({'plain':!![]});var _0x43d415=_0x90cf('0x4b');return db[_0x90cf('0x4c')][_0x90cf('0x47')]({'where':{'name':_0x43d415,'userProfileId':_0x5a8005[_0x90cf('0x4d')]},'raw':!![]})[_0x90cf('0x23')](function(_0x45535f){if(_0x45535f&&_0x45535f['autoAssociation']===0x0){return db[_0x90cf('0x4e')][_0x90cf('0x48')]({'name':_0x33e6bf['name'],'resourceId':_0x33e6bf['id'],'type':_0x90cf('0x4f'),'sectionId':_0x45535f['id']},{})[_0x90cf('0x23')](function(){return _0x40f069;});}else{return _0x40f069;}})['catch'](function(_0x5e74a6){logger[_0x90cf('0x27')](_0x90cf('0x50'),_0x5e74a6);throw _0x5e74a6;});}return _0x40f069;})[_0x90cf('0x23')](respondWithResult(_0x4c2d27,0xc9))[_0x90cf('0x43')](handleError(_0x4c2d27,null));};exports[_0x90cf('0x22')]=function(_0x49fd56,_0x378f12){if(_0x49fd56[_0x90cf('0x49')]['id']){delete _0x49fd56['body']['id'];}return db[_0x90cf('0x2c')]['find']({'where':{'id':_0x49fd56[_0x90cf('0x45')]['id']}})[_0x90cf('0x23')](handleEntityNotFound(_0x378f12,null))[_0x90cf('0x23')](saveUpdates(_0x49fd56[_0x90cf('0x49')],null))[_0x90cf('0x23')](respondWithResult(_0x378f12,null))[_0x90cf('0x43')](handleError(_0x378f12,null));};exports[_0x90cf('0x24')]=function(_0x2d6d9e,_0x515dbf){return db['AnalyticCustomReport'][_0x90cf('0x47')]({'where':{'id':_0x2d6d9e[_0x90cf('0x45')]['id']}})[_0x90cf('0x23')](handleEntityNotFound(_0x515dbf,null))[_0x90cf('0x23')](removeEntity(_0x515dbf,null))['catch'](handleError(_0x515dbf,null));};exports[_0x90cf('0x51')]=function(_0x4ee8d2,_0x47c369){var _0x243483=0xa;var _0x27e6b3=['join',_0x90cf('0x52'),'right_join',_0x90cf('0x53')];var _0x4dddc3={'SUM':_0x90cf('0x54'),'COUNT':_0x90cf('0x55'),'COUNT DISTINCT':_0x90cf('0x56'),'MAX':_0x90cf('0x57'),'MIN':_0x90cf('0x58'),'AVG':_0x90cf('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x90cf('0x5a'),'GROUP_CONCAT DESC':_0x90cf('0x5b')};var _0xf99173={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x90cf('0x5c'),'ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':_0x90cf('0x5e')};var _0x4f4fbc=function(_0x31d1d1){return!_[_0x90cf('0x5f')]([_0x90cf('0x60'),_0x90cf('0x61'),'IS\x20EMPTY',_0x90cf('0x62')],_0x31d1d1);};var _0x18140d=function(_0x47a3ce){if(!_0x47a3ce||!_0x47a3ce[_0x90cf('0x63')][_0x90cf('0x36')]){return'';}for(var _0x1166b2='(',_0x1ddf42=0x0;_0x1ddf42<_0x47a3ce[_0x90cf('0x63')][_0x90cf('0x36')];_0x1ddf42+=0x1){_0x1ddf42>0x0&&(_0x1166b2+='\x20'+_0x47a3ce[_0x90cf('0x64')]+'\x20');_0x1166b2+=_0x47a3ce['rules'][_0x1ddf42][_0x90cf('0x65')]?_0x18140d(_0x47a3ce[_0x90cf('0x63')][_0x1ddf42]['group']):_0x47a3ce[_0x90cf('0x63')][_0x1ddf42][_0x90cf('0x66')]+'\x20'+_0x47a3ce['rules'][_0x1ddf42]['condition']+(_0x4f4fbc(_0x47a3ce[_0x90cf('0x63')][_0x1ddf42][_0x90cf('0x67')])?'\x20'+_0x47a3ce['rules'][_0x1ddf42][_0x90cf('0x68')]:'');}return _0x1166b2+')';};var _0x51614b={'where':{'id':_0x4ee8d2['params']['id']}},_0x4a66f6,_0x28b9e4,_0x226162,_0x185d01,_0x1f6282;_0x51614b=_[_0x90cf('0x3d')]({},_0x51614b,_0x4ee8d2[_0x90cf('0x3e')]);return db[_0x90cf('0x2c')]['find'](_0x51614b)['then'](function(_0x7a35be){if(_0x7a35be){_0x4a66f6=_0x7a35be;return _0x7a35be['getFields']();}return null;})['then'](function(_0x3efd18){if(_0x3efd18){if(!_0x3efd18[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))]['ValidationErrorItem'](_0x90cf('0x6a'),0x193);}_0x28b9e4=_0x3efd18;return db['AnalyticMetric'][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x27b865){if(_0x27b865){_0x226162=_['keyBy'](_0x27b865,'id');var _0x41483e;var _0x3f7376=squel['select']();_0x3f7376[_0x90cf('0x6b')](_0x4a66f6['table']);for(var _0x2ba1e6=0x0;_0x2ba1e6<_0x28b9e4[_0x90cf('0x36')];_0x2ba1e6+=0x1){_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6c')]?_0x226162[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6c')]]['metric']:_0x28b9e4[_0x2ba1e6][_0x90cf('0x66')];_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6d')]?_[_0x90cf('0x6e')](_0x4dddc3[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6d')]],'%s',_0x41483e):_0x41483e;_0x41483e=_0x28b9e4[_0x2ba1e6][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0xf99173[_0x28b9e4[_0x2ba1e6][_0x90cf('0x6f')]],'%s',_0x41483e):_0x41483e;if(_0x28b9e4[_0x2ba1e6][_0x90cf('0x70')]){_0x3f7376[_0x90cf('0x65')](_0x41483e);}_0x28b9e4[_0x2ba1e6][_0x90cf('0x71')]&&_0x3f7376['order'](_0x41483e,_0x28b9e4[_0x2ba1e6][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x3f7376[_0x90cf('0x66')](_0x41483e,_0x28b9e4[_0x2ba1e6][_0x90cf('0x73')]||_0x41483e);}if(_0x4a66f6[_0x90cf('0x74')]){_0x4a66f6[_0x90cf('0x74')]=JSON[_0x90cf('0x75')](_0x4a66f6['joins']);for(var _0x126919=0x0;_0x126919<_0x4a66f6[_0x90cf('0x74')][_0x90cf('0x36')];_0x126919+=0x1){if(_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')]&&_[_0x90cf('0x5f')](_0x27e6b3,_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')])&&_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x77')]&&_0x4a66f6[_0x90cf('0x74')][_0x126919]['foreignTable']&&_0x4a66f6[_0x90cf('0x74')][_0x126919]['foreignKey']){_0x3f7376[_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x76')]](_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x78')],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x4a66f6[_0x90cf('0x7a')],_0x4a66f6['joins'][_0x126919][_0x90cf('0x77')],_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x78')],_0x4a66f6[_0x90cf('0x74')][_0x126919][_0x90cf('0x7b')]));}}}if(_0x4a66f6[_0x90cf('0x7c')]){_0x4a66f6[_0x90cf('0x7c')]=JSON['parse'](_0x4a66f6[_0x90cf('0x7c')]);_0x3f7376[_0x90cf('0x3a')](_0x18140d(_0x4a66f6['conditions'][_0x90cf('0x65')]));}_0x1f6282=_0x3f7376[_0x90cf('0x7d')]();_0x3f7376[_0x90cf('0x1e')](_0x243483);_0x3f7376['offset'](0x0);logger[_0x90cf('0x7e')]('Limited\x20Query:',_0x3f7376['toString']());return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x3f7376[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]});}})[_0x90cf('0x23')](respondWithResult(_0x47c369,null))['catch'](handleError(_0x47c369,null));};function runReport(_0x3b2dd7,_0x295b01,_0x548b85){var _0x4c7826=_0x295b01['name'];var _0x2b73a3=0xa;var _0x3a560f=[_0x90cf('0x83'),_0x90cf('0x52'),_0x90cf('0x84'),_0x90cf('0x53')];var _0x52d564={'SUM':_0x90cf('0x54'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x90cf('0x57'),'MIN':'MIN(%s)','AVG':_0x90cf('0x59'),'GROUP_CONCAT':_0x90cf('0x85'),'GROUP_CONCAT ASC':_0x90cf('0x5a'),'GROUP_CONCAT DESC':_0x90cf('0x5b')};var _0x46af15={'SEC_TO_TIME':_0x90cf('0x86'),'DATE':_0x90cf('0x87'),'HOUR':_0x90cf('0x5c'),'ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a30fd=function(_0x1ca3e3){return!_[_0x90cf('0x5f')]([_0x90cf('0x60'),_0x90cf('0x61'),_0x90cf('0x88'),_0x90cf('0x62')],_0x1ca3e3);};var _0x30bfd6=function(_0x1042cb){if(!_0x1042cb||!_0x1042cb[_0x90cf('0x63')]['length']){return'';}for(var _0x2a1e53='(',_0x2494f8=0x0;_0x2494f8<_0x1042cb['rules']['length'];_0x2494f8+=0x1){_0x2494f8>0x0&&(_0x2a1e53+='\x20'+_0x1042cb[_0x90cf('0x64')]+'\x20');_0x2a1e53+=_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x65')]?_0x30bfd6(_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x65')]):_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x66')]+'\x20'+_0x1042cb[_0x90cf('0x63')][_0x2494f8]['condition']+(_0x5a30fd(_0x1042cb[_0x90cf('0x63')][_0x2494f8][_0x90cf('0x67')])?'\x20'+_0x1042cb['rules'][_0x2494f8]['value']:'');}return _0x2a1e53+')';};var _0x1dd90c={'where':{'id':_0x3b2dd7['id']}},_0x953156,_0x20ed99,_0x198176,_0x1698ef,_0x3e6e3a;_0x1dd90c=_['merge']({},_0x1dd90c,_0x548b85);return db[_0x90cf('0x2c')][_0x90cf('0x47')](_0x1dd90c)[_0x90cf('0x23')](function(_0x566244){if(_0x566244){_0x953156=_0x566244;return _0x566244[_0x90cf('0x89')]();}return null;})[_0x90cf('0x23')](function(_0x1455aa){if(_0x1455aa){if(!_0x1455aa[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))][(_0x90cf('0x8a'))](_0x90cf('0x6a'),0x193);}_0x20ed99=_0x1455aa;return db[_0x90cf('0x8b')][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x17f4e0){if(_0x17f4e0){_0x198176=_['keyBy'](_0x17f4e0,'id');var _0x969b42;var _0x534632=squel[_0x90cf('0x8c')]();_0x534632[_0x90cf('0x6b')](_0x953156[_0x90cf('0x7a')]);for(var _0x27607e=0x0;_0x27607e<_0x20ed99[_0x90cf('0x36')];_0x27607e+=0x1){_0x969b42=_0x20ed99[_0x27607e][_0x90cf('0x6c')]?_0x198176[_0x20ed99[_0x27607e][_0x90cf('0x6c')]]['metric']:_0x20ed99[_0x27607e][_0x90cf('0x66')];_0x969b42=_0x20ed99[_0x27607e]['function']?_[_0x90cf('0x6e')](_0x52d564[_0x20ed99[_0x27607e][_0x90cf('0x6d')]],'%s',_0x969b42):_0x969b42;_0x969b42=_0x20ed99[_0x27607e][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0x46af15[_0x20ed99[_0x27607e][_0x90cf('0x6f')]],'%s',_0x969b42):_0x969b42;if(_0x20ed99[_0x27607e][_0x90cf('0x70')]){_0x534632[_0x90cf('0x65')](_0x969b42);}_0x20ed99[_0x27607e]['orderBy']&&_0x534632['order'](_0x969b42,_0x20ed99[_0x27607e][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x534632[_0x90cf('0x66')](_0x969b42,_0x20ed99[_0x27607e]['alias']||_0x969b42);}if(_0x953156[_0x90cf('0x74')]){_0x953156['joins']=JSON[_0x90cf('0x75')](_0x953156[_0x90cf('0x74')]);for(var _0x3aebb8=0x0;_0x3aebb8<_0x953156[_0x90cf('0x74')][_0x90cf('0x36')];_0x3aebb8+=0x1){if(_0x953156['joins'][_0x3aebb8][_0x90cf('0x76')]&&_[_0x90cf('0x5f')](_0x3a560f,_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x76')])&&_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x77')]&&_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')]&&_0x953156['joins'][_0x3aebb8][_0x90cf('0x7b')]){_0x534632[_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x76')]](_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x953156[_0x90cf('0x7a')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x77')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x78')],_0x953156[_0x90cf('0x74')][_0x3aebb8][_0x90cf('0x7b')]));}}}if(_0x953156['conditions']){_0x953156[_0x90cf('0x7c')]=JSON['parse'](_0x953156[_0x90cf('0x7c')]);_0x534632['where'](_0x30bfd6(_0x953156[_0x90cf('0x7c')][_0x90cf('0x65')]));}_0x3e6e3a=_0x534632['clone']();_0x534632[_0x90cf('0x1e')](_0x2b73a3);_0x534632[_0x90cf('0x1b')](0x0);return;}})[_0x90cf('0x23')](function(){if(_0x295b01[_0x90cf('0x8d')]==='web'){return null;}var _0x1c1677=_[_0x90cf('0x3d')](_0x295b01,{'name':_0x295b01['fullPath']||_0x295b01[_0x90cf('0x29')]||_0x953156['name'],'basename':_0x4c7826,'savename':util['format']('%s-%s.%s',_0x295b01[_0x90cf('0x29')]||_0x953156[_0x90cf('0x29')],require('randomstring')[_0x90cf('0x8e')](0x4),_0x295b01[_0x90cf('0x8d')]||_0x90cf('0x8f')),'reportId':_0x953156['id'],'reportType':_0x90cf('0x90')});return db[_0x90cf('0x91')][_0x90cf('0x48')](_0x1c1677,{'raw':!![]});})[_0x90cf('0x23')](function(_0xd52cbc){if(_0x953156[_0x90cf('0x7a')]===_0x90cf('0x92')){_0x3e6e3a[_0x90cf('0x3a')](_0x953156[_0x90cf('0x7a')]+_0x90cf('0x93'),_0x295b01['startDate'],_0x295b01[_0x90cf('0x94')]);}else{_0x3e6e3a[_0x90cf('0x3a')](_0x953156[_0x90cf('0x7a')]+_0x90cf('0x95'),_0x295b01['startDate'],_0x295b01[_0x90cf('0x94')]);}if(_0xd52cbc){logger[_0x90cf('0x96')](_0x90cf('0x97'),_0x3e6e3a[_0x90cf('0x80')]());require(_0x90cf('0x98'))[_0x90cf('0x99')](path[_0x90cf('0x83')](__dirname,_0x90cf('0x9a'),_0xd52cbc[_0x90cf('0x8d')]),[_0xd52cbc['id'],_0x3e6e3a[_0x90cf('0x80')](),path[_0x90cf('0x83')](__dirname,_0x90cf('0x9b'),_0xd52cbc[_0x90cf('0x9c')]),_0x4c7826]);return _0xd52cbc;}else{var _0x4c7cd0=squel[_0x90cf('0x8c')]();_0x4c7cd0[_0x90cf('0x6b')]('('+_0x3e6e3a[_0x90cf('0x80')]()+')',_0x90cf('0x9d'));_0x4c7cd0[_0x90cf('0x66')]('COUNT(*)',_0x90cf('0x1d'));_0x3e6e3a[_0x90cf('0x1e')](_0x295b01[_0x90cf('0x1e')]||_0x2b73a3);_0x3e6e3a['offset'](_0x295b01[_0x90cf('0x1b')]||0x0);return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x4c7cd0[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]})['then'](function(_0x3e1706){if(!_0x3e1706[_0x90cf('0x36')]){_0x1698ef=0x0;}else{_0x1698ef=_0x3e1706[0x0][_0x90cf('0x1d')]||0x0;}return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x3e6e3a[_0x90cf('0x80')](),{'type':dbH['sequelize'][_0x90cf('0x81')][_0x90cf('0x82')]});})[_0x90cf('0x23')](function(_0x1268bd){return{'rows':_0x1268bd||[],'count':_0x1698ef};});}});}exports[_0x90cf('0x9e')]=function(_0x26f553,_0x1417ef){return runReport(_0x26f553['params'],_0x26f553['query'],_0x26f553[_0x90cf('0x3e')])['then'](respondWithResult(_0x1417ef,null))[_0x90cf('0x43')](handleError(_0x1417ef,null));};exports[_0x90cf('0x9f')]=runReport;exports[_0x90cf('0x31')]=function(_0x46cc16,_0x3d7417){var _0x1fd6cb=0xa;var _0x5d8401=[_0x90cf('0x83'),_0x90cf('0x52'),'right_join','cross_join'];var _0x157cee={'SUM':_0x90cf('0x54'),'COUNT':_0x90cf('0x55'),'COUNT DISTINCT':_0x90cf('0x56'),'MAX':_0x90cf('0x57'),'MIN':_0x90cf('0x58'),'AVG':_0x90cf('0x59'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x58c2f4={'SEC_TO_TIME':_0x90cf('0x86'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x90cf('0x5d'),'UNIX_TIMESTAMP':_0x90cf('0x5e')};var _0x3aca47=function(_0x33b892){return!_[_0x90cf('0x5f')](['IS\x20NULL',_0x90cf('0x61'),_0x90cf('0x88'),_0x90cf('0x62')],_0x33b892);};var _0x2bf9dd=function(_0x4e5cb4){if(!_0x4e5cb4||!_0x4e5cb4[_0x90cf('0x63')][_0x90cf('0x36')]){return'';}for(var _0x35d72e='(',_0x103819=0x0;_0x103819<_0x4e5cb4[_0x90cf('0x63')][_0x90cf('0x36')];_0x103819+=0x1){_0x103819>0x0&&(_0x35d72e+='\x20'+_0x4e5cb4[_0x90cf('0x64')]+'\x20');_0x35d72e+=_0x4e5cb4['rules'][_0x103819]['group']?_0x2bf9dd(_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x65')]):_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x66')]+'\x20'+_0x4e5cb4['rules'][_0x103819]['condition']+(_0x3aca47(_0x4e5cb4[_0x90cf('0x63')][_0x103819][_0x90cf('0x67')])?'\x20'+_0x4e5cb4['rules'][_0x103819][_0x90cf('0x68')]:'');}return _0x35d72e+')';};var _0x534613={'where':{'id':_0x46cc16[_0x90cf('0x45')]['id']}},_0x3ae665,_0x4bdefa,_0x2bfc73,_0x41d92c,_0x3ceee7;_0x534613=_[_0x90cf('0x3d')]({},_0x534613,_0x46cc16[_0x90cf('0x3e')]);return db[_0x90cf('0x2c')]['find'](_0x534613)[_0x90cf('0x23')](function(_0x33095d){if(_0x33095d){_0x3ae665=_0x33095d;return _0x33095d['getFields']();}return null;})[_0x90cf('0x23')](function(_0x26c2fc){if(_0x26c2fc){if(!_0x26c2fc[_0x90cf('0x36')]){throw new db[(_0x90cf('0x69'))]['ValidationErrorItem'](_0x90cf('0x6a'),0x193);}_0x4bdefa=_0x26c2fc;return db[_0x90cf('0x8b')][_0x90cf('0x41')]({'raw':!![]});}return null;})[_0x90cf('0x23')](function(_0x4604b1){if(_0x4604b1){_0x2bfc73=_[_0x90cf('0xa0')](_0x4604b1,'id');var _0x39a8be;var _0x4d3537=squel[_0x90cf('0x8c')]();_0x4d3537[_0x90cf('0x6b')](_0x3ae665[_0x90cf('0x7a')]);for(var _0x2491d2=0x0;_0x2491d2<_0x4bdefa[_0x90cf('0x36')];_0x2491d2+=0x1){_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6c')]?_0x2bfc73[_0x4bdefa[_0x2491d2][_0x90cf('0x6c')]][_0x90cf('0xa1')]:_0x4bdefa[_0x2491d2][_0x90cf('0x66')];_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6d')]?_[_0x90cf('0x6e')](_0x157cee[_0x4bdefa[_0x2491d2]['function']],'%s',_0x39a8be):_0x39a8be;_0x39a8be=_0x4bdefa[_0x2491d2][_0x90cf('0x6f')]?_[_0x90cf('0x6e')](_0x58c2f4[_0x4bdefa[_0x2491d2][_0x90cf('0x6f')]],'%s',_0x39a8be):_0x39a8be;if(_0x4bdefa[_0x2491d2][_0x90cf('0x70')]){_0x4d3537[_0x90cf('0x65')](_0x39a8be);}_0x4bdefa[_0x2491d2][_0x90cf('0x71')]&&_0x4d3537[_0x90cf('0x38')](_0x39a8be,_0x4bdefa[_0x2491d2][_0x90cf('0x71')]===_0x90cf('0x72')?![]:!![]);_0x4d3537[_0x90cf('0x66')](_0x39a8be,_0x4bdefa[_0x2491d2][_0x90cf('0x73')]||_0x39a8be);}if(_0x3ae665[_0x90cf('0x74')]){_0x3ae665[_0x90cf('0x74')]=JSON['parse'](_0x3ae665['joins']);for(var _0x42d234=0x0;_0x42d234<_0x3ae665[_0x90cf('0x74')]['length'];_0x42d234+=0x1){if(_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')]&&_['includes'](_0x5d8401,_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')])&&_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x77')]&&_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x78')]&&_0x3ae665['joins'][_0x42d234]['foreignKey']){_0x4d3537[_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x76')]](_0x3ae665[_0x90cf('0x74')][_0x42d234]['foreignTable'],null,util[_0x90cf('0x6f')](_0x90cf('0x79'),_0x3ae665[_0x90cf('0x7a')],_0x3ae665[_0x90cf('0x74')][_0x42d234]['parentKey'],_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x78')],_0x3ae665[_0x90cf('0x74')][_0x42d234][_0x90cf('0x7b')]));}}}if(_0x3ae665[_0x90cf('0x7c')]){_0x3ae665['conditions']=JSON['parse'](_0x3ae665['conditions']);_0x4d3537['where'](_0x2bf9dd(_0x3ae665['conditions'][_0x90cf('0x65')]));}_0x3ceee7=_0x4d3537[_0x90cf('0x7d')]();_0x4d3537['limit'](_0x1fd6cb);_0x4d3537[_0x90cf('0x1b')](0x0);logger[_0x90cf('0x7e')](_0x90cf('0xa2'),_0x4d3537[_0x90cf('0x80')]());return dbH[_0x90cf('0x7f')][_0x90cf('0x31')](_0x4d3537[_0x90cf('0x80')](),{'type':dbH[_0x90cf('0x7f')][_0x90cf('0x81')][_0x90cf('0x82')]});}})['then'](function(){return{'sql':_0x3ceee7['toString']()};})['then'](respondWithResult(_0x3d7417,null))[_0x90cf('0x43')](handleError(_0x3d7417,null));};
\ No newline at end of file
+var _0x30ad=['startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SUM(%s)','MIN(%s)','IS\x20EMPTY','AnalyticMetric','%s.%s\x20=\x20%s.%s','debug','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','get','CustomReports','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','findAll','keyBy','select','table','MetricId','metric','field','replace','function','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','DATE(%s)','UNIX_TIMESTAMP(%s)','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','from','format','includes','output','web','%s-%s.%s','randomstring','generate','csv','custom','cdr'];(function(_0x4e44ed,_0x2cca5e){var _0x95afcf=function(_0x279023){while(--_0x279023){_0x4e44ed['push'](_0x4e44ed['shift']());}};_0x95afcf(++_0x2cca5e);}(_0x30ad,0xb7));var _0xd30a=function(_0x59e66d,_0x516cc0){_0x59e66d=_0x59e66d-0x0;var _0x4aae15=_0x30ad[_0x59e66d];return _0x4aae15;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd30a('0x0'));var jsonpatch=require(_0xd30a('0x1'));var rp=require(_0xd30a('0x2'));var moment=require('moment');var BPromise=require(_0xd30a('0x3'));var Mustache=require(_0xd30a('0x4'));var util=require('util');var path=require(_0xd30a('0x5'));var sox=require(_0xd30a('0x6'));var csv=require(_0xd30a('0x7'));var ejs=require(_0xd30a('0x8'));var fs=require('fs');var fs_extra=require(_0xd30a('0x9'));var _=require('lodash');var squel=require(_0xd30a('0xa'));var crypto=require(_0xd30a('0xb'));var jsforce=require(_0xd30a('0xc'));var deskjs=require(_0xd30a('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd30a('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd30a('0xf'));var hardwareService=require(_0xd30a('0x10'));var logger=require(_0xd30a('0x11'))(_0xd30a('0x12'));var utils=require(_0xd30a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd30a('0x14'));var db=require('../../mysqldb')['db'];var dbH=require(_0xd30a('0x15'))[_0xd30a('0x16')];function respondWithStatusCode(_0x51d0fe,_0x5a7769){_0x5a7769=_0x5a7769||0xcc;return function(_0xc1b83f){if(_0xc1b83f){return _0x51d0fe['sendStatus'](_0x5a7769);}return _0x51d0fe[_0xd30a('0x17')](_0x5a7769)[_0xd30a('0x18')]();};}function respondWithResult(_0x5b7020,_0x20c072){_0x20c072=_0x20c072||0xc8;return function(_0xc545aa){if(_0xc545aa){return _0x5b7020[_0xd30a('0x17')](_0x20c072)['json'](_0xc545aa);}};}function respondWithFilteredResult(_0x124df3,_0xdb4cda){return function(_0x59e89d){if(_0x59e89d){var _0xced212=typeof _0xdb4cda[_0xd30a('0x19')]==='undefined'&&typeof _0xdb4cda[_0xd30a('0x1a')]===_0xd30a('0x1b');var _0x11cced=_0x59e89d[_0xd30a('0x1c')];var _0xc6d976=_0xced212?0x0:_0xdb4cda[_0xd30a('0x19')];var _0x365568=_0xced212?_0x59e89d[_0xd30a('0x1c')]:_0xdb4cda[_0xd30a('0x19')]+_0xdb4cda[_0xd30a('0x1a')];var _0x241e7c;if(_0x365568>=_0x11cced){_0x365568=_0x11cced;_0x241e7c=0xc8;}else{_0x241e7c=0xce;}_0x124df3[_0xd30a('0x17')](_0x241e7c);return _0x124df3[_0xd30a('0x1d')]('Content-Range',_0xc6d976+'-'+_0x365568+'/'+_0x11cced)[_0xd30a('0x1e')](_0x59e89d);}return null;};}function patchUpdates(_0x3432a2){return function(_0x3b5603){try{jsonpatch[_0xd30a('0x1f')](_0x3b5603,_0x3432a2,!![]);}catch(_0x2d5a85){return BPromise[_0xd30a('0x20')](_0x2d5a85);}return _0x3b5603['save']();};}function saveUpdates(_0x593cd1,_0x87b97a){return function(_0x172a62){if(_0x172a62){return _0x172a62[_0xd30a('0x21')](_0x593cd1)[_0xd30a('0x22')](function(_0x329e67){return _0x329e67;});}return null;};}function removeEntity(_0x300b86,_0x2fb43c){return function(_0x216109){if(_0x216109){return _0x216109['destroy']()['then'](function(){var _0x3360cd=_0x216109[_0xd30a('0x23')]({'plain':!![]});var _0xadd3a0=_0xd30a('0x24');return db[_0xd30a('0x25')][_0xd30a('0x26')]({'where':{'type':_0xadd3a0,'resourceId':_0x3360cd['id']}})[_0xd30a('0x22')](function(){return _0x216109;});})[_0xd30a('0x22')](function(){_0x300b86[_0xd30a('0x17')](0xcc)[_0xd30a('0x18')]();});}};}function handleEntityNotFound(_0x149aff,_0x13bf7a){return function(_0x481752){if(!_0x481752){_0x149aff[_0xd30a('0x27')](0x194);}return _0x481752;};}function handleError(_0x333a02,_0x2a86fe){_0x2a86fe=_0x2a86fe||0x1f4;return function(_0x1da005){logger[_0xd30a('0x28')](_0x1da005[_0xd30a('0x29')]);if(_0x1da005[_0xd30a('0x2a')]){delete _0x1da005['name'];}_0x333a02['status'](_0x2a86fe)[_0xd30a('0x2b')](_0x1da005);};}exports[_0xd30a('0x2c')]=function(_0x59fa23,_0x236915){var _0x4a131b={},_0x48c239={},_0x12d582={'count':0x0,'rows':[]};var _0x52bf2b=_[_0xd30a('0x2d')](db[_0xd30a('0x2e')][_0xd30a('0x2f')],function(_0x5969b3){return{'name':_0x5969b3[_0xd30a('0x30')],'type':_0x5969b3[_0xd30a('0x31')][_0xd30a('0x32')]};});_0x48c239['model']=_[_0xd30a('0x2d')](_0x52bf2b,_0xd30a('0x2a'));_0x48c239[_0xd30a('0x33')]=_[_0xd30a('0x34')](_0x59fa23[_0xd30a('0x33')]);_0x48c239[_0xd30a('0x35')]=_[_0xd30a('0x36')](_0x48c239['model'],_0x48c239[_0xd30a('0x33')]);_0x4a131b['attributes']=_['intersection'](_0x48c239[_0xd30a('0x37')],qs['fields'](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x38')]));_0x4a131b[_0xd30a('0x39')]=_0x4a131b[_0xd30a('0x39')]['length']?_0x4a131b['attributes']:_0x48c239['model'];if(!_0x59fa23['query']['hasOwnProperty']('nolimit')){_0x4a131b[_0xd30a('0x1a')]=qs[_0xd30a('0x1a')](_0x59fa23[_0xd30a('0x33')]['limit']);_0x4a131b[_0xd30a('0x19')]=qs[_0xd30a('0x19')](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x19')]);}_0x4a131b[_0xd30a('0x3a')]=qs['sort'](_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3b')]);_0x4a131b[_0xd30a('0x3c')]=qs['filters'](_[_0xd30a('0x3d')](_0x59fa23['query'],_0x48c239[_0xd30a('0x35')]),_0x52bf2b);if(_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3e')]){_0x4a131b[_0xd30a('0x3c')]=_[_0xd30a('0x3f')](_0x4a131b[_0xd30a('0x3c')],{'$or':_['map'](_0x52bf2b,function(_0x196d35){if(_0x196d35[_0xd30a('0x31')]!==_0xd30a('0x40')){var _0x359b90={};_0x359b90[_0x196d35['name']]={'$like':'%'+_0x59fa23[_0xd30a('0x33')][_0xd30a('0x3e')]+'%'};return _0x359b90;}})});}_0x4a131b=_[_0xd30a('0x3f')]({},_0x4a131b,_0x59fa23[_0xd30a('0x41')]);var _0x2b2d00={'where':_0x4a131b[_0xd30a('0x3c')]};return db[_0xd30a('0x2e')][_0xd30a('0x1c')](_0x2b2d00)[_0xd30a('0x22')](function(_0xbff6c0){_0x12d582['count']=_0xbff6c0;if(_0x59fa23[_0xd30a('0x33')][_0xd30a('0x42')]){_0x4a131b[_0xd30a('0x43')]=[{'all':!![]}];}return db[_0xd30a('0x2e')]['findAll'](_0x4a131b);})[_0xd30a('0x22')](function(_0x25da0b){_0x12d582[_0xd30a('0x44')]=_0x25da0b;return _0x12d582;})[_0xd30a('0x22')](respondWithFilteredResult(_0x236915,_0x4a131b))[_0xd30a('0x45')](handleError(_0x236915,null));};exports['show']=function(_0x2c07be,_0x47d297){var _0x52436e={'raw':![],'where':{'id':_0x2c07be[_0xd30a('0x46')]['id']}},_0x235fa9={};_0x235fa9['model']=_[_0xd30a('0x34')](db[_0xd30a('0x2e')][_0xd30a('0x2f')]);_0x235fa9[_0xd30a('0x33')]=_[_0xd30a('0x34')](_0x2c07be[_0xd30a('0x33')]);_0x235fa9[_0xd30a('0x35')]=_[_0xd30a('0x36')](_0x235fa9[_0xd30a('0x37')],_0x235fa9[_0xd30a('0x33')]);_0x52436e[_0xd30a('0x39')]=_[_0xd30a('0x36')](_0x235fa9[_0xd30a('0x37')],qs['fields'](_0x2c07be[_0xd30a('0x33')][_0xd30a('0x38')]));_0x52436e[_0xd30a('0x39')]=_0x52436e['attributes'][_0xd30a('0x47')]?_0x52436e[_0xd30a('0x39')]:_0x235fa9['model'];if(_0x2c07be['query'][_0xd30a('0x42')]){_0x52436e[_0xd30a('0x43')]=[{'all':!![]}];}_0x52436e=_[_0xd30a('0x3f')]({},_0x52436e,_0x2c07be[_0xd30a('0x41')]);return db[_0xd30a('0x2e')]['find'](_0x52436e)[_0xd30a('0x22')](handleEntityNotFound(_0x47d297,null))[_0xd30a('0x22')](respondWithResult(_0x47d297,null))[_0xd30a('0x45')](handleError(_0x47d297,null));};exports['create']=function(_0x18a420,_0x67499e){return db[_0xd30a('0x2e')][_0xd30a('0x48')](_0x18a420['body'],{})[_0xd30a('0x22')](function(_0x3d3035){var _0x492d99=_0x18a420[_0xd30a('0x49')][_0xd30a('0x23')]({'plain':!![]});if(!_0x492d99)throw new Error(_0xd30a('0x4a'));if(_0x492d99[_0xd30a('0x4b')]===_0xd30a('0x49')){var _0xa3db4d=_0x3d3035['get']({'plain':!![]});var _0x3e3c19='Reports';return db[_0xd30a('0x4c')][_0xd30a('0x4d')]({'where':{'name':_0x3e3c19,'userProfileId':_0x492d99[_0xd30a('0x4e')]},'raw':!![]})['then'](function(_0x3274aa){if(_0x3274aa&&_0x3274aa[_0xd30a('0x4f')]===0x0){return db[_0xd30a('0x25')][_0xd30a('0x48')]({'name':_0xa3db4d['name'],'resourceId':_0xa3db4d['id'],'type':_0xd30a('0x24'),'sectionId':_0x3274aa['id']},{})[_0xd30a('0x22')](function(){return _0x3d3035;});}else{return _0x3d3035;}})[_0xd30a('0x45')](function(_0x2658c8){logger['error'](_0xd30a('0x50'),_0x2658c8);throw _0x2658c8;});}return _0x3d3035;})[_0xd30a('0x22')](respondWithResult(_0x67499e,0xc9))[_0xd30a('0x45')](handleError(_0x67499e,null));};exports[_0xd30a('0x21')]=function(_0x67ffec,_0x5f026c){if(_0x67ffec[_0xd30a('0x51')]['id']){delete _0x67ffec[_0xd30a('0x51')]['id'];}return db['AnalyticCustomReport'][_0xd30a('0x4d')]({'where':{'id':_0x67ffec[_0xd30a('0x46')]['id']}})[_0xd30a('0x22')](handleEntityNotFound(_0x5f026c,null))[_0xd30a('0x22')](saveUpdates(_0x67ffec['body'],null))[_0xd30a('0x22')](respondWithResult(_0x5f026c,null))[_0xd30a('0x45')](handleError(_0x5f026c,null));};exports[_0xd30a('0x26')]=function(_0x5688bd,_0xae549b){return db[_0xd30a('0x2e')]['find']({'where':{'id':_0x5688bd[_0xd30a('0x46')]['id']}})[_0xd30a('0x22')](handleEntityNotFound(_0xae549b,null))[_0xd30a('0x22')](removeEntity(_0xae549b,null))[_0xd30a('0x45')](handleError(_0xae549b,null));};exports[_0xd30a('0x52')]=function(_0x52ea51,_0x368440){var _0x47ff06=0xa;var _0x1eb803=[_0xd30a('0x53'),_0xd30a('0x54'),_0xd30a('0x55'),_0xd30a('0x56')];var _0x1d0fba={'SUM':'SUM(%s)','COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':'MIN(%s)','AVG':_0xd30a('0x5a'),'GROUP_CONCAT':_0xd30a('0x5b'),'GROUP_CONCAT ASC':_0xd30a('0x5c'),'GROUP_CONCAT DESC':_0xd30a('0x5d')};var _0x20ce78={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':'DATE(%s)','HOUR':_0xd30a('0x5f'),'ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1701e5=function(_0x1d317b){return!_['includes']([_0xd30a('0x61'),_0xd30a('0x62'),'IS\x20EMPTY',_0xd30a('0x63')],_0x1d317b);};var _0x4eb5e0=function(_0x4a37cf){if(!_0x4a37cf||!_0x4a37cf[_0xd30a('0x64')][_0xd30a('0x47')]){return'';}for(var _0x55bde1='(',_0x26b221=0x0;_0x26b221<_0x4a37cf[_0xd30a('0x64')]['length'];_0x26b221+=0x1){_0x26b221>0x0&&(_0x55bde1+='\x20'+_0x4a37cf[_0xd30a('0x65')]+'\x20');_0x55bde1+=_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x66')]?_0x4eb5e0(_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x66')]):_0x4a37cf['rules'][_0x26b221]['field']+'\x20'+_0x4a37cf[_0xd30a('0x64')][_0x26b221][_0xd30a('0x67')]+(_0x1701e5(_0x4a37cf['rules'][_0x26b221][_0xd30a('0x67')])?'\x20'+_0x4a37cf['rules'][_0x26b221][_0xd30a('0x68')]:'');}return _0x55bde1+')';};var _0x1cd245={'where':{'id':_0x52ea51['params']['id']}},_0x174915,_0x11c427,_0x5dd34f,_0x4b9b2a,_0x42de2c;_0x1cd245=_[_0xd30a('0x3f')]({},_0x1cd245,_0x52ea51[_0xd30a('0x41')]);return db['AnalyticCustomReport'][_0xd30a('0x4d')](_0x1cd245)[_0xd30a('0x22')](function(_0x595199){if(_0x595199){_0x174915=_0x595199;return _0x595199[_0xd30a('0x69')]();}return null;})[_0xd30a('0x22')](function(_0x2b9196){if(_0x2b9196){if(!_0x2b9196[_0xd30a('0x47')]){throw new db[(_0xd30a('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x11c427=_0x2b9196;return db['AnalyticMetric'][_0xd30a('0x6b')]({'raw':!![]});}return null;})['then'](function(_0x9c58e){if(_0x9c58e){_0x5dd34f=_[_0xd30a('0x6c')](_0x9c58e,'id');var _0x369c2b;var _0x2695cc=squel[_0xd30a('0x6d')]();_0x2695cc['from'](_0x174915[_0xd30a('0x6e')]);for(var _0x54a5ef=0x0;_0x54a5ef<_0x11c427['length'];_0x54a5ef+=0x1){_0x369c2b=_0x11c427[_0x54a5ef][_0xd30a('0x6f')]?_0x5dd34f[_0x11c427[_0x54a5ef][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x11c427[_0x54a5ef][_0xd30a('0x71')];_0x369c2b=_0x11c427[_0x54a5ef]['function']?_[_0xd30a('0x72')](_0x1d0fba[_0x11c427[_0x54a5ef][_0xd30a('0x73')]],'%s',_0x369c2b):_0x369c2b;_0x369c2b=_0x11c427[_0x54a5ef]['format']?_[_0xd30a('0x72')](_0x20ce78[_0x11c427[_0x54a5ef]['format']],'%s',_0x369c2b):_0x369c2b;if(_0x11c427[_0x54a5ef][_0xd30a('0x74')]){_0x2695cc[_0xd30a('0x66')](_0x369c2b);}_0x11c427[_0x54a5ef][_0xd30a('0x75')]&&_0x2695cc[_0xd30a('0x3a')](_0x369c2b,_0x11c427[_0x54a5ef][_0xd30a('0x75')]===_0xd30a('0x76')?![]:!![]);_0x2695cc[_0xd30a('0x71')](_0x369c2b,_0x11c427[_0x54a5ef][_0xd30a('0x77')]||_0x369c2b);}if(_0x174915[_0xd30a('0x78')]){_0x174915[_0xd30a('0x78')]=JSON['parse'](_0x174915[_0xd30a('0x78')]);for(var _0x140245=0x0;_0x140245<_0x174915[_0xd30a('0x78')][_0xd30a('0x47')];_0x140245+=0x1){if(_0x174915['joins'][_0x140245][_0xd30a('0x31')]&&_['includes'](_0x1eb803,_0x174915['joins'][_0x140245][_0xd30a('0x31')])&&_0x174915['joins'][_0x140245][_0xd30a('0x79')]&&_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7a')]&&_0x174915[_0xd30a('0x78')][_0x140245]['foreignKey']){_0x2695cc[_0x174915[_0xd30a('0x78')][_0x140245]['type']](_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x174915['table'],_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x79')],_0x174915[_0xd30a('0x78')][_0x140245]['foreignTable'],_0x174915[_0xd30a('0x78')][_0x140245][_0xd30a('0x7b')]));}}}if(_0x174915[_0xd30a('0x7c')]){_0x174915[_0xd30a('0x7c')]=JSON[_0xd30a('0x7d')](_0x174915[_0xd30a('0x7c')]);_0x2695cc[_0xd30a('0x3c')](_0x4eb5e0(_0x174915[_0xd30a('0x7c')][_0xd30a('0x66')]));}_0x42de2c=_0x2695cc[_0xd30a('0x7e')]();_0x2695cc['limit'](_0x47ff06);_0x2695cc['offset'](0x0);logger['debug'](_0xd30a('0x7f'),_0x2695cc[_0xd30a('0x80')]());return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x2695cc['toString'](),{'type':dbH['sequelize'][_0xd30a('0x82')][_0xd30a('0x83')]});}})[_0xd30a('0x22')](respondWithResult(_0x368440,null))['catch'](handleError(_0x368440,null));};function runReport(_0xaf7180,_0x437d63,_0x231f92){var _0xd1aa0e=_0x437d63['name'];var _0x36f3a7=0xa;var _0x5d2b02=[_0xd30a('0x53'),'left_join','right_join',_0xd30a('0x56')];var _0x170dab={'SUM':'SUM(%s)','COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd30a('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x3d1b87={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':_0xd30a('0x84'),'HOUR':_0xd30a('0x5f'),'ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':_0xd30a('0x85')};var _0x5df45d=function(_0xcaabe4){return!_['includes']([_0xd30a('0x61'),_0xd30a('0x62'),'IS\x20EMPTY',_0xd30a('0x63')],_0xcaabe4);};var _0x495e53=function(_0x575b71){if(!_0x575b71||!_0x575b71[_0xd30a('0x64')]['length']){return'';}for(var _0x1667a5='(',_0x8c2001=0x0;_0x8c2001<_0x575b71['rules'][_0xd30a('0x47')];_0x8c2001+=0x1){_0x8c2001>0x0&&(_0x1667a5+='\x20'+_0x575b71[_0xd30a('0x65')]+'\x20');_0x1667a5+=_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x66')]?_0x495e53(_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x66')]):_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x71')]+'\x20'+_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x67')]+(_0x5df45d(_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x67')])?'\x20'+_0x575b71[_0xd30a('0x64')][_0x8c2001][_0xd30a('0x68')]:'');}return _0x1667a5+')';};var _0x2a187e={'where':{'id':_0xaf7180['id']}},_0x1f02d6,_0x428785,_0x20136b,_0x1a7e7c,_0x4a84f6;_0x2a187e=_[_0xd30a('0x3f')]({},_0x2a187e,_0x231f92);return db[_0xd30a('0x2e')][_0xd30a('0x4d')](_0x2a187e)['then'](function(_0x3280f2){if(_0x3280f2){_0x1f02d6=_0x3280f2;return _0x3280f2['getFields']();}return null;})['then'](function(_0xe7986f){if(_0xe7986f){if(!_0xe7986f[_0xd30a('0x47')]){throw new db['Sequelize'][(_0xd30a('0x86'))](_0xd30a('0x87'),0x193);}_0x428785=_0xe7986f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xd30a('0x22')](function(_0x1bc56a){if(_0x1bc56a){_0x20136b=_['keyBy'](_0x1bc56a,'id');var _0x50bb91;var _0x242a41=squel[_0xd30a('0x6d')]();_0x242a41[_0xd30a('0x88')](_0x1f02d6['table']);for(var _0x320202=0x0;_0x320202<_0x428785[_0xd30a('0x47')];_0x320202+=0x1){_0x50bb91=_0x428785[_0x320202][_0xd30a('0x6f')]?_0x20136b[_0x428785[_0x320202][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x428785[_0x320202][_0xd30a('0x71')];_0x50bb91=_0x428785[_0x320202][_0xd30a('0x73')]?_[_0xd30a('0x72')](_0x170dab[_0x428785[_0x320202][_0xd30a('0x73')]],'%s',_0x50bb91):_0x50bb91;_0x50bb91=_0x428785[_0x320202][_0xd30a('0x89')]?_[_0xd30a('0x72')](_0x3d1b87[_0x428785[_0x320202]['format']],'%s',_0x50bb91):_0x50bb91;if(_0x428785[_0x320202][_0xd30a('0x74')]){_0x242a41[_0xd30a('0x66')](_0x50bb91);}_0x428785[_0x320202][_0xd30a('0x75')]&&_0x242a41[_0xd30a('0x3a')](_0x50bb91,_0x428785[_0x320202]['orderBy']===_0xd30a('0x76')?![]:!![]);_0x242a41[_0xd30a('0x71')](_0x50bb91,_0x428785[_0x320202][_0xd30a('0x77')]||_0x50bb91);}if(_0x1f02d6[_0xd30a('0x78')]){_0x1f02d6[_0xd30a('0x78')]=JSON['parse'](_0x1f02d6[_0xd30a('0x78')]);for(var _0x4d831a=0x0;_0x4d831a<_0x1f02d6[_0xd30a('0x78')]['length'];_0x4d831a+=0x1){if(_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')]&&_[_0xd30a('0x8a')](_0x5d2b02,_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')])&&_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x79')]&&_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7a')]&&_0x1f02d6[_0xd30a('0x78')][_0x4d831a]['foreignKey']){_0x242a41[_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x31')]](_0x1f02d6[_0xd30a('0x78')][_0x4d831a][_0xd30a('0x7a')],null,util[_0xd30a('0x89')]('%s.%s\x20=\x20%s.%s',_0x1f02d6['table'],_0x1f02d6[_0xd30a('0x78')][_0x4d831a]['parentKey'],_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7a')],_0x1f02d6['joins'][_0x4d831a][_0xd30a('0x7b')]));}}}if(_0x1f02d6[_0xd30a('0x7c')]){_0x1f02d6[_0xd30a('0x7c')]=JSON[_0xd30a('0x7d')](_0x1f02d6['conditions']);_0x242a41['where'](_0x495e53(_0x1f02d6['conditions'][_0xd30a('0x66')]));}_0x4a84f6=_0x242a41['clone']();_0x242a41[_0xd30a('0x1a')](_0x36f3a7);_0x242a41['offset'](0x0);return;}})[_0xd30a('0x22')](function(){if(_0x437d63[_0xd30a('0x8b')]===_0xd30a('0x8c')){return null;}var _0x5cb959=_[_0xd30a('0x3f')](_0x437d63,{'name':_0x437d63['fullPath']||_0x437d63[_0xd30a('0x2a')]||_0x1f02d6[_0xd30a('0x2a')],'basename':_0xd1aa0e,'savename':util[_0xd30a('0x89')](_0xd30a('0x8d'),_0x437d63[_0xd30a('0x2a')]||_0x1f02d6[_0xd30a('0x2a')],require(_0xd30a('0x8e'))[_0xd30a('0x8f')](0x4),_0x437d63[_0xd30a('0x8b')]||_0xd30a('0x90')),'reportId':_0x1f02d6['id'],'reportType':_0xd30a('0x91')});return db['AnalyticExtractedReport'][_0xd30a('0x48')](_0x5cb959,{'raw':!![]});})[_0xd30a('0x22')](function(_0x38538f){if(_0x1f02d6['table']===_0xd30a('0x92')){_0x4a84f6[_0xd30a('0x3c')](_0x1f02d6[_0xd30a('0x6e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x437d63[_0xd30a('0x93')],_0x437d63[_0xd30a('0x94')]);}else{_0x4a84f6[_0xd30a('0x3c')](_0x1f02d6[_0xd30a('0x6e')]+_0xd30a('0x95'),_0x437d63[_0xd30a('0x93')],_0x437d63[_0xd30a('0x94')]);}if(_0x38538f){logger[_0xd30a('0x96')](_0xd30a('0x97'),_0x4a84f6['toString']());require(_0xd30a('0x98'))[_0xd30a('0x99')](path[_0xd30a('0x53')](__dirname,_0xd30a('0x9a'),_0x38538f[_0xd30a('0x8b')]),[_0x38538f['id'],_0x4a84f6['toString'](),path[_0xd30a('0x53')](__dirname,_0xd30a('0x9b'),_0x38538f[_0xd30a('0x9c')]),_0xd1aa0e]);return _0x38538f;}else{var _0x31179f=squel['select']();_0x31179f[_0xd30a('0x88')]('('+_0x4a84f6[_0xd30a('0x80')]()+')',_0xd30a('0x9d'));_0x31179f[_0xd30a('0x71')](_0xd30a('0x9e'),_0xd30a('0x1c'));_0x4a84f6[_0xd30a('0x1a')](_0x437d63['limit']||_0x36f3a7);_0x4a84f6[_0xd30a('0x19')](_0x437d63[_0xd30a('0x19')]||0x0);return dbH['sequelize'][_0xd30a('0x33')](_0x31179f[_0xd30a('0x80')](),{'type':dbH['sequelize'][_0xd30a('0x82')][_0xd30a('0x83')]})[_0xd30a('0x22')](function(_0x36eb1b){if(!_0x36eb1b['length']){_0x1a7e7c=0x0;}else{_0x1a7e7c=_0x36eb1b[0x0][_0xd30a('0x1c')]||0x0;}return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x4a84f6[_0xd30a('0x80')](),{'type':dbH[_0xd30a('0x81')][_0xd30a('0x82')]['SELECT']});})['then'](function(_0x39223d){return{'rows':_0x39223d||[],'count':_0x1a7e7c};});}});}exports['run']=function(_0x3a7a51,_0x19a76b){return runReport(_0x3a7a51[_0xd30a('0x46')],_0x3a7a51[_0xd30a('0x33')],_0x3a7a51['options'])[_0xd30a('0x22')](respondWithResult(_0x19a76b,null))[_0xd30a('0x45')](handleError(_0x19a76b,null));};exports['runReport']=runReport;exports['query']=function(_0x5b75ff,_0x5e2d36){var _0x7e67a1=0xa;var _0x557f06=[_0xd30a('0x53'),'left_join','right_join',_0xd30a('0x56')];var _0x34d7bf={'SUM':_0xd30a('0x9f'),'COUNT':_0xd30a('0x57'),'COUNT DISTINCT':_0xd30a('0x58'),'MAX':_0xd30a('0x59'),'MIN':_0xd30a('0xa0'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd30a('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xd30a('0x5d')};var _0x4d1ba6={'SEC_TO_TIME':_0xd30a('0x5e'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd30a('0x60'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xba424a=function(_0x396acf){return!_[_0xd30a('0x8a')]([_0xd30a('0x61'),_0xd30a('0x62'),_0xd30a('0xa1'),_0xd30a('0x63')],_0x396acf);};var _0x50b1de=function(_0x5ad07d){if(!_0x5ad07d||!_0x5ad07d[_0xd30a('0x64')][_0xd30a('0x47')]){return'';}for(var _0x1de4d8='(',_0x4254d7=0x0;_0x4254d7<_0x5ad07d[_0xd30a('0x64')]['length'];_0x4254d7+=0x1){_0x4254d7>0x0&&(_0x1de4d8+='\x20'+_0x5ad07d[_0xd30a('0x65')]+'\x20');_0x1de4d8+=_0x5ad07d[_0xd30a('0x64')][_0x4254d7]['group']?_0x50b1de(_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x66')]):_0x5ad07d['rules'][_0x4254d7][_0xd30a('0x71')]+'\x20'+_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x67')]+(_0xba424a(_0x5ad07d[_0xd30a('0x64')][_0x4254d7][_0xd30a('0x67')])?'\x20'+_0x5ad07d['rules'][_0x4254d7][_0xd30a('0x68')]:'');}return _0x1de4d8+')';};var _0x335df7={'where':{'id':_0x5b75ff[_0xd30a('0x46')]['id']}},_0x58fc5b,_0x16eb13,_0x3c70f3,_0x3f54b1,_0x36d144;_0x335df7=_['merge']({},_0x335df7,_0x5b75ff[_0xd30a('0x41')]);return db[_0xd30a('0x2e')][_0xd30a('0x4d')](_0x335df7)[_0xd30a('0x22')](function(_0x5c2844){if(_0x5c2844){_0x58fc5b=_0x5c2844;return _0x5c2844[_0xd30a('0x69')]();}return null;})[_0xd30a('0x22')](function(_0x153c94){if(_0x153c94){if(!_0x153c94[_0xd30a('0x47')]){throw new db[(_0xd30a('0x6a'))][(_0xd30a('0x86'))](_0xd30a('0x87'),0x193);}_0x16eb13=_0x153c94;return db[_0xd30a('0xa2')][_0xd30a('0x6b')]({'raw':!![]});}return null;})['then'](function(_0xef892b){if(_0xef892b){_0x3c70f3=_[_0xd30a('0x6c')](_0xef892b,'id');var _0x577671;var _0x589920=squel[_0xd30a('0x6d')]();_0x589920[_0xd30a('0x88')](_0x58fc5b[_0xd30a('0x6e')]);for(var _0x2d5c42=0x0;_0x2d5c42<_0x16eb13[_0xd30a('0x47')];_0x2d5c42+=0x1){_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x6f')]?_0x3c70f3[_0x16eb13[_0x2d5c42][_0xd30a('0x6f')]][_0xd30a('0x70')]:_0x16eb13[_0x2d5c42][_0xd30a('0x71')];_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x73')]?_[_0xd30a('0x72')](_0x34d7bf[_0x16eb13[_0x2d5c42][_0xd30a('0x73')]],'%s',_0x577671):_0x577671;_0x577671=_0x16eb13[_0x2d5c42][_0xd30a('0x89')]?_[_0xd30a('0x72')](_0x4d1ba6[_0x16eb13[_0x2d5c42][_0xd30a('0x89')]],'%s',_0x577671):_0x577671;if(_0x16eb13[_0x2d5c42]['groupBy']){_0x589920[_0xd30a('0x66')](_0x577671);}_0x16eb13[_0x2d5c42][_0xd30a('0x75')]&&_0x589920[_0xd30a('0x3a')](_0x577671,_0x16eb13[_0x2d5c42]['orderBy']===_0xd30a('0x76')?![]:!![]);_0x589920[_0xd30a('0x71')](_0x577671,_0x16eb13[_0x2d5c42][_0xd30a('0x77')]||_0x577671);}if(_0x58fc5b[_0xd30a('0x78')]){_0x58fc5b[_0xd30a('0x78')]=JSON[_0xd30a('0x7d')](_0x58fc5b['joins']);for(var _0x232cf5=0x0;_0x232cf5<_0x58fc5b['joins'][_0xd30a('0x47')];_0x232cf5+=0x1){if(_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x31')]&&_[_0xd30a('0x8a')](_0x557f06,_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['type'])&&_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x79')]&&_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x7a')]&&_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7b')]){_0x589920[_0x58fc5b['joins'][_0x232cf5][_0xd30a('0x31')]](_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['foreignTable'],null,util[_0xd30a('0x89')](_0xd30a('0xa3'),_0x58fc5b[_0xd30a('0x6e')],_0x58fc5b[_0xd30a('0x78')][_0x232cf5]['parentKey'],_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7a')],_0x58fc5b[_0xd30a('0x78')][_0x232cf5][_0xd30a('0x7b')]));}}}if(_0x58fc5b[_0xd30a('0x7c')]){_0x58fc5b['conditions']=JSON[_0xd30a('0x7d')](_0x58fc5b['conditions']);_0x589920[_0xd30a('0x3c')](_0x50b1de(_0x58fc5b[_0xd30a('0x7c')][_0xd30a('0x66')]));}_0x36d144=_0x589920[_0xd30a('0x7e')]();_0x589920[_0xd30a('0x1a')](_0x7e67a1);_0x589920[_0xd30a('0x19')](0x0);logger[_0xd30a('0xa4')](_0xd30a('0x7f'),_0x589920[_0xd30a('0x80')]());return dbH[_0xd30a('0x81')][_0xd30a('0x33')](_0x589920[_0xd30a('0x80')](),{'type':dbH[_0xd30a('0x81')][_0xd30a('0x82')]['SELECT']});}})[_0xd30a('0x22')](function(){return{'sql':_0x36d144[_0xd30a('0x80')]()};})[_0xd30a('0x22')](respondWithResult(_0x5e2d36,null))[_0xd30a('0x45')](handleError(_0x5e2d36,null));};
\ No newline at end of file
index b7a2150..3e05ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1869=['analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticCustomReport'];(function(_0x4785f4,_0xa0c5a9){var _0x15872c=function(_0x3bb39d){while(--_0x3bb39d){_0x4785f4['push'](_0x4785f4['shift']());}};_0x15872c(++_0xa0c5a9);}(_0x1869,0x9d));var _0x9186=function(_0x1e188c,_0x5d81aa){_0x1e188c=_0x1e188c-0x0;var _0x37b334=_0x1869[_0x1e188c];return _0x37b334;};'use strict';var _=require(_0x9186('0x0'));var util=require('util');var logger=require(_0x9186('0x1'))(_0x9186('0x2'));var moment=require(_0x9186('0x3'));var BPromise=require(_0x9186('0x4'));var rp=require(_0x9186('0x5'));var fs=require('fs');var path=require(_0x9186('0x6'));var rimraf=require('rimraf');var config=require(_0x9186('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x9186('0x8')]=function(_0x276863,_0x48a65b){return _0x276863[_0x9186('0x9')](_0x9186('0xa'),attributes,{'tableName':_0x9186('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee25=['analytics_custom_reports','lodash','util','api','moment','bluebird','path','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xee25,0x1b1));var _0x5ee2=function(_0x3026ed,_0x1baae0){_0x3026ed=_0x3026ed-0x0;var _0x7c98a8=_0xee25[_0x3026ed];return _0x7c98a8;};'use strict';var _=require(_0x5ee2('0x0'));var util=require(_0x5ee2('0x1'));var logger=require('../../config/logger')(_0x5ee2('0x2'));var moment=require(_0x5ee2('0x3'));var BPromise=require(_0x5ee2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5ee2('0x5'));var rimraf=require(_0x5ee2('0x6'));var config=require('../../config/environment');var attributes=require(_0x5ee2('0x7'));module[_0x5ee2('0x8')]=function(_0x97060a,_0x1c148c){return _0x97060a[_0x5ee2('0x9')](_0x5ee2('0xa'),attributes,{'tableName':_0x5ee2('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2071d72..4a0faab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3601=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x5490f8,_0x3e2a7b){var _0x269782=function(_0x5ddb27){while(--_0x5ddb27){_0x5490f8['push'](_0x5490f8['shift']());}};_0x269782(++_0x3e2a7b);}(_0x3601,0x10d));var _0x1360=function(_0x52376f,_0x229438){_0x52376f=_0x52376f-0x0;var _0x343fa5=_0x3601[_0x52376f];return _0x343fa5;};'use strict';var _=require(_0x1360('0x0'));var util=require('util');var moment=require(_0x1360('0x1'));var BPromise=require('bluebird');var rs=require(_0x1360('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1360('0x3'))['db'];var utils=require(_0x1360('0x4'));var logger=require(_0x1360('0x5'))(_0x1360('0x6'));var config=require(_0x1360('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1360('0x8')][_0x1360('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19724f,_0x2ee164,_0x51d0f1){return new BPromise(function(_0x19cea2,_0x1705de){return client['request'](_0x19724f,_0x51d0f1)[_0x1360('0xa')](function(_0x1de9bd){logger[_0x1360('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2ee164,_0x1360('0xc'));logger[_0x1360('0xd')](_0x1360('0xe'),_0x2ee164,'request\x20sent',JSON[_0x1360('0xf')](_0x1de9bd));if(_0x1de9bd[_0x1360('0x10')]){if(_0x1de9bd['error']['code']===0x1f4){logger['error'](_0x1360('0x11'),_0x2ee164,_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);return _0x1705de(_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);}logger['error'](_0x1360('0x11'),_0x2ee164,_0x1de9bd['error']['message']);return _0x19cea2(_0x1de9bd[_0x1360('0x10')][_0x1360('0x12')]);}else{logger[_0x1360('0xb')](_0x1360('0x11'),_0x2ee164,'request\x20sent');_0x19cea2(_0x1de9bd[_0x1360('0x13')][_0x1360('0x12')]);}})[_0x1360('0x14')](function(_0x193f23){logger[_0x1360('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2ee164,_0x193f23);_0x1705de(_0x193f23);});});}
\ No newline at end of file
+var _0xdc18=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0xdc18,0xd0));var _0x8dc1=function(_0x37f036,_0x55a7bf){_0x37f036=_0x37f036-0x0;var _0x4bfd21=_0xdc18[_0x37f036];return _0x4bfd21;};'use strict';var _=require(_0x8dc1('0x0'));var util=require('util');var moment=require(_0x8dc1('0x1'));var BPromise=require(_0x8dc1('0x2'));var rs=require(_0x8dc1('0x3'));var fs=require('fs');var Redis=require(_0x8dc1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8dc1('0x5'))(_0x8dc1('0x6'));var config=require(_0x8dc1('0x7'));var jayson=require(_0x8dc1('0x8'));var client=jayson[_0x8dc1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4763d3,_0x2eef60,_0xa3cc0d){return new BPromise(function(_0x274ca0,_0x133ce6){return client[_0x8dc1('0xa')](_0x4763d3,_0xa3cc0d)[_0x8dc1('0xb')](function(_0x8567e7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x8dc1('0xc'));logger[_0x8dc1('0xd')](_0x8dc1('0xe'),_0x2eef60,'request\x20sent',JSON[_0x8dc1('0xf')](_0x8567e7));if(_0x8567e7[_0x8dc1('0x10')]){if(_0x8567e7[_0x8dc1('0x10')]['code']===0x1f4){logger['error'](_0x8dc1('0x11'),_0x2eef60,_0x8567e7[_0x8dc1('0x10')]['message']);return _0x133ce6(_0x8567e7[_0x8dc1('0x10')][_0x8dc1('0x12')]);}logger[_0x8dc1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x8567e7[_0x8dc1('0x10')][_0x8dc1('0x12')]);return _0x274ca0(_0x8567e7[_0x8dc1('0x10')]['message']);}else{logger['info'](_0x8dc1('0x11'),_0x2eef60,_0x8dc1('0xc'));_0x274ca0(_0x8567e7[_0x8dc1('0x13')][_0x8dc1('0x12')]);}})[_0x8dc1('0x14')](function(_0x2c8513){logger[_0x8dc1('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2eef60,_0x2c8513);_0x133ce6(_0x2c8513);});});}
\ No newline at end of file
index 3a3805e..9c483b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee47=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','run','create','put','update','delete','destroy','util','express','Router'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0xee47,0x1dd));var _0x7ee4=function(_0x4ae461,_0x32f69f){_0x4ae461=_0x4ae461-0x0;var _0x5c86c3=_0xee47[_0x4ae461];return _0x5c86c3;};'use strict';var multer=require('multer');var util=require(_0x7ee4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7ee4('0x1'));var router=express[_0x7ee4('0x2')]();var fs_extra=require(_0x7ee4('0x3'));var auth=require(_0x7ee4('0x4'));var interaction=require(_0x7ee4('0x5'));var config=require(_0x7ee4('0x6'));var controller=require(_0x7ee4('0x7'));router[_0x7ee4('0x8')]('/',auth[_0x7ee4('0x9')](),controller['index']);router['get'](_0x7ee4('0xa'),auth['isAuthenticated'](),controller[_0x7ee4('0xb')]);router[_0x7ee4('0x8')](_0x7ee4('0xc'),auth['isAuthenticated'](),controller['preview']);router[_0x7ee4('0x8')](_0x7ee4('0xd'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0xe')]);router[_0x7ee4('0x8')]('/:id/query',auth[_0x7ee4('0x9')](),controller['query']);router['post']('/',auth[_0x7ee4('0x9')](),controller[_0x7ee4('0xf')]);router[_0x7ee4('0x10')](_0x7ee4('0xa'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0x11')]);router[_0x7ee4('0x12')](_0x7ee4('0xa'),auth[_0x7ee4('0x9')](),controller[_0x7ee4('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7258=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x7258,0x17a));var _0x8725=function(_0x16f248,_0x4ec807){_0x16f248=_0x16f248-0x0;var _0x537197=_0x7258[_0x16f248];return _0x537197;};'use strict';var multer=require(_0x8725('0x0'));var util=require(_0x8725('0x1'));var path=require(_0x8725('0x2'));var timeout=require(_0x8725('0x3'));var express=require(_0x8725('0x4'));var router=express['Router']();var fs_extra=require(_0x8725('0x5'));var auth=require(_0x8725('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8725('0x7'));var controller=require(_0x8725('0x8'));router[_0x8725('0x9')]('/',auth[_0x8725('0xa')](),controller['index']);router[_0x8725('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8725('0xb')]);router[_0x8725('0x9')](_0x8725('0xc'),auth[_0x8725('0xa')](),controller[_0x8725('0xd')]);router[_0x8725('0x9')](_0x8725('0xe'),auth[_0x8725('0xa')](),controller[_0x8725('0xf')]);router[_0x8725('0x9')](_0x8725('0x10'),auth[_0x8725('0xa')](),controller[_0x8725('0x11')]);router[_0x8725('0x12')]('/',auth[_0x8725('0xa')](),controller['create']);router[_0x8725('0x13')](_0x8725('0x14'),auth['isAuthenticated'](),controller[_0x8725('0x15')]);router[_0x8725('0x16')]('/:id',auth[_0x8725('0xa')](),controller[_0x8725('0x17')]);module[_0x8725('0x18')]=router;
\ No newline at end of file
index 1d87a19..3f56e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['TEXT','exports'];(function(_0x576e2b,_0x328953){var _0x46461a=function(_0xce4d9e){while(--_0xce4d9e){_0x576e2b['push'](_0x576e2b['shift']());}};_0x46461a(++_0x328953);}(_0x8958,0x93));var _0x8895=function(_0x3a9f80,_0x51a873){_0x3a9f80=_0x3a9f80-0x0;var _0x5a68ab=_0x8958[_0x3a9f80];return _0x5a68ab;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x40c49c,_0x2c97c6){var _0x8f4fb4=function(_0xd6cf3b){while(--_0xd6cf3b){_0x40c49c['push'](_0x40c49c['shift']());}};_0x8f4fb4(++_0x2c97c6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x5fc3[_0x5a26f5];return _0x2e9ef7;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
index af6de47..a96d3b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x243d9e,_0x2a7490){var _0x329a57=function(_0x16788f){while(--_0x16788f){_0x243d9e['push'](_0x243d9e['shift']());}};_0x329a57(++_0x2a7490);}(_0x4975,0x86));var _0x5497=function(_0x2b1745,_0x536156){_0x2b1745=_0x2b1745-0x0;var _0x5169c9=_0x4975[_0x2b1745];return _0x5169c9;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
+var _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x561fc8,_0x37336a){var _0x9a413e=function(_0x5b395a){while(--_0x5b395a){_0x561fc8['push'](_0x561fc8['shift']());}};_0x9a413e(++_0x37336a);}(_0x0295,0x1f0));var _0x5029=function(_0xa62a6b,_0x50f390){_0xa62a6b=_0xa62a6b-0x0;var _0x57380b=_0x0295[_0xa62a6b];return _0x57380b;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
index 56b6c99..4998cdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c1d=['api','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','lodash','util'];(function(_0x338367,_0xc2ed00){var _0x5ee2b4=function(_0x34968f){while(--_0x34968f){_0x338367['push'](_0x338367['shift']());}};_0x5ee2b4(++_0xc2ed00);}(_0x2c1d,0x6a));var _0xd2c1=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x2c1d[_0x2d2c16];return _0x53f2fb;};'use strict';var _=require(_0xd2c1('0x0'));var util=require(_0xd2c1('0x1'));var logger=require('../../config/logger')(_0xd2c1('0x2'));var moment=require('moment');var BPromise=require(_0xd2c1('0x3'));var rp=require(_0xd2c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd2c1('0x5'));var config=require(_0xd2c1('0x6'));var attributes=require(_0xd2c1('0x7'));module[_0xd2c1('0x8')]=function(_0x3adf48,_0x5997e3){return _0x3adf48['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ea4=['AnalyticDefaultReport','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./analyticDefaultReport.attributes','exports','define'];(function(_0x366e99,_0x15d82d){var _0x180bbe=function(_0x282498){while(--_0x282498){_0x366e99['push'](_0x366e99['shift']());}};_0x180bbe(++_0x15d82d);}(_0x4ea4,0x16c));var _0x44ea=function(_0xf466fc,_0xe6b550){_0xf466fc=_0xf466fc-0x0;var _0x1e6330=_0x4ea4[_0xf466fc];return _0x1e6330;};'use strict';var _=require(_0x44ea('0x0'));var util=require('util');var logger=require(_0x44ea('0x1'))('api');var moment=require(_0x44ea('0x2'));var BPromise=require(_0x44ea('0x3'));var rp=require(_0x44ea('0x4'));var fs=require('fs');var path=require(_0x44ea('0x5'));var rimraf=require(_0x44ea('0x6'));var config=require('../../config/environment');var attributes=require(_0x44ea('0x7'));module[_0x44ea('0x8')]=function(_0x20d8f4,_0x9380d9){return _0x20d8f4[_0x44ea('0x9')](_0x44ea('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6d5a670..b83ffee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd600=['stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x474fc5,_0x341734){var _0x629fcd=function(_0x1addb6){while(--_0x1addb6){_0x474fc5['push'](_0x474fc5['shift']());}};_0x629fcd(++_0x341734);}(_0xd600,0x14f));var _0x0d60=function(_0x27e5f2,_0x1461bc){_0x27e5f2=_0x27e5f2-0x0;var _0x4369f4=_0xd600[_0x27e5f2];return _0x4369f4;};'use strict';var _=require(_0x0d60('0x0'));var util=require(_0x0d60('0x1'));var moment=require('moment');var BPromise=require(_0x0d60('0x2'));var rs=require(_0x0d60('0x3'));var fs=require('fs');var Redis=require(_0x0d60('0x4'));var db=require(_0x0d60('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d60('0x6'))(_0x0d60('0x7'));var config=require(_0x0d60('0x8'));var jayson=require(_0x0d60('0x9'));var client=jayson[_0x0d60('0xa')][_0x0d60('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x166373,_0xebc01,_0x456229){return new BPromise(function(_0xffcba8,_0x5e6be4){return client['request'](_0x166373,_0x456229)[_0x0d60('0xc')](function(_0x580f09){logger[_0x0d60('0xd')](_0x0d60('0xe'),_0xebc01,_0x0d60('0xf'));logger['debug'](_0x0d60('0x10'),_0xebc01,_0x0d60('0xf'),JSON[_0x0d60('0x11')](_0x580f09));if(_0x580f09[_0x0d60('0x12')]){if(_0x580f09[_0x0d60('0x12')]['code']===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xebc01,_0x580f09['error'][_0x0d60('0x13')]);return _0x5e6be4(_0x580f09['error']['message']);}logger[_0x0d60('0x12')](_0x0d60('0xe'),_0xebc01,_0x580f09['error']['message']);return _0xffcba8(_0x580f09[_0x0d60('0x12')]['message']);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0xebc01,'request\x20sent');_0xffcba8(_0x580f09[_0x0d60('0x14')][_0x0d60('0x13')]);}})[_0x0d60('0x15')](function(_0x189540){logger['error'](_0x0d60('0xe'),_0xebc01,_0x189540);_0x5e6be4(_0x189540);});});}
\ No newline at end of file
+var _0xf9db=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9db,0x16c));var _0xbf9d=function(_0x429821,_0x16d603){_0x429821=_0x429821-0x0;var _0x36e9b6=_0xf9db[_0x429821];return _0x36e9b6;};'use strict';var _=require(_0xbf9d('0x0'));var util=require(_0xbf9d('0x1'));var moment=require('moment');var BPromise=require(_0xbf9d('0x2'));var rs=require(_0xbf9d('0x3'));var fs=require('fs');var Redis=require(_0xbf9d('0x4'));var db=require(_0xbf9d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbf9d('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbf9d('0x7')][_0xbf9d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f741d,_0x1ee0a1,_0x28bc66){return new BPromise(function(_0x5a80db,_0x3af10a){return client[_0xbf9d('0x9')](_0x2f741d,_0x28bc66)[_0xbf9d('0xa')](function(_0x35e380){logger[_0xbf9d('0xb')](_0xbf9d('0xc'),_0x1ee0a1,_0xbf9d('0xd'));logger[_0xbf9d('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1ee0a1,_0xbf9d('0xd'),JSON['stringify'](_0x35e380));if(_0x35e380[_0xbf9d('0xf')]){if(_0x35e380['error'][_0xbf9d('0x10')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ee0a1,_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);return _0x3af10a(_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);}logger[_0xbf9d('0xf')](_0xbf9d('0xc'),_0x1ee0a1,_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);return _0x5a80db(_0x35e380[_0xbf9d('0xf')][_0xbf9d('0x11')]);}else{logger[_0xbf9d('0xb')](_0xbf9d('0xc'),_0x1ee0a1,_0xbf9d('0xd'));_0x5a80db(_0x35e380[_0xbf9d('0x12')]['message']);}})[_0xbf9d('0x13')](function(_0x1a0b2f){logger['error'](_0xbf9d('0xc'),_0x1ee0a1,_0x1a0b2f);_0x3af10a(_0x1a0b2f);});});}
\ No newline at end of file
index 0a73afe..fddc8fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a9b=['create','put','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query'];(function(_0x3f0b26,_0x90a328){var _0x230931=function(_0x3f8d23){while(--_0x3f8d23){_0x3f0b26['push'](_0x3f0b26['shift']());}};_0x230931(++_0x90a328);}(_0x3a9b,0x10d));var _0xb3a9=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x3a9b[_0x819464];return _0x49dcc0;};'use strict';var multer=require(_0xb3a9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb3a9('0x1'));var express=require(_0xb3a9('0x2'));var router=express[_0xb3a9('0x3')]();var fs_extra=require(_0xb3a9('0x4'));var auth=require(_0xb3a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb3a9('0x6'));var controller=require('./analyticDefaultReport.controller');router[_0xb3a9('0x7')]('/',auth[_0xb3a9('0x8')](),controller[_0xb3a9('0x9')]);router['get'](_0xb3a9('0xa'),auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xb')]);router['get']('/:id/preview',auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xc')]);router[_0xb3a9('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0xb3a9('0xd')]);router[_0xb3a9('0x7')](_0xb3a9('0xe'),auth[_0xb3a9('0x8')](),controller[_0xb3a9('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb3a9('0x10')]);router[_0xb3a9('0x11')](_0xb3a9('0xa'),auth[_0xb3a9('0x8')](),controller['update']);router['delete'](_0xb3a9('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb3a9('0x12')]=router;
\ No newline at end of file
+var _0xaefd=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','multer','util'];(function(_0x373925,_0x57badd){var _0x305525=function(_0x3249f1){while(--_0x3249f1){_0x373925['push'](_0x373925['shift']());}};_0x305525(++_0x57badd);}(_0xaefd,0x1c6));var _0xdaef=function(_0x462fc9,_0x355e35){_0x462fc9=_0x462fc9-0x0;var _0x240ef1=_0xaefd[_0x462fc9];return _0x240ef1;};'use strict';var multer=require(_0xdaef('0x0'));var util=require(_0xdaef('0x1'));var path=require(_0xdaef('0x2'));var timeout=require(_0xdaef('0x3'));var express=require(_0xdaef('0x4'));var router=express[_0xdaef('0x5')]();var fs_extra=require(_0xdaef('0x6'));var auth=require(_0xdaef('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdaef('0x8'));var controller=require(_0xdaef('0x9'));router[_0xdaef('0xa')]('/',auth[_0xdaef('0xb')](),controller['index']);router[_0xdaef('0xa')](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller[_0xdaef('0xd')]);router[_0xdaef('0xa')](_0xdaef('0xe'),auth['isAuthenticated'](),controller[_0xdaef('0xf')]);router[_0xdaef('0xa')](_0xdaef('0x10'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x11')]);router['get'](_0xdaef('0x12'),auth[_0xdaef('0xb')](),controller[_0xdaef('0x13')]);router[_0xdaef('0x14')]('/',auth[_0xdaef('0xb')](),controller[_0xdaef('0x15')]);router[_0xdaef('0x16')](_0xdaef('0xc'),auth['isAuthenticated'](),controller[_0xdaef('0x17')]);router['delete'](_0xdaef('0xc'),auth[_0xdaef('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bdb0ccf..74b0b2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2120=['xlsx','csv','DATE','Loading','scheduled','manual','INTEGER','sequelize','moment','STRING','ENUM','pdf'];(function(_0x23c0f1,_0x1d6ce8){var _0x3c735d=function(_0x182530){while(--_0x182530){_0x23c0f1['push'](_0x23c0f1['shift']());}};_0x3c735d(++_0x1d6ce8);}(_0x2120,0x67));var _0x0212=function(_0x1d5400,_0x567e3c){_0x1d5400=_0x1d5400-0x0;var _0x21d9fe=_0x2120[_0x1d5400];return _0x21d9fe;};'use strict';var Sequelize=require(_0x0212('0x0'));var moment=require(_0x0212('0x1'));module['exports']={'name':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x0212('0x3')]('csv',_0x0212('0x4'),_0x0212('0x5')),'allowNull':![],'defaultValue':_0x0212('0x6')},'savename':{'type':Sequelize[_0x0212('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x0212('0x7')]},'endDate':{'type':Sequelize[_0x0212('0x7')]},'status':{'type':Sequelize[_0x0212('0x2')],'defaultValue':_0x0212('0x8')},'type':{'type':Sequelize[_0x0212('0x3')]('manual',_0x0212('0x9')),'allowNull':![],'defaultValue':_0x0212('0xa')},'reportId':{'type':Sequelize[_0x0212('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x0212('0x2')]}};
\ No newline at end of file
+var _0xb9ff=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE'];(function(_0x170adf,_0x377b82){var _0x4944d9=function(_0x19e95c){while(--_0x19e95c){_0x170adf['push'](_0x170adf['shift']());}};_0x4944d9(++_0x377b82);}(_0xb9ff,0xc9));var _0xfb9f=function(_0x2cc79d,_0x3e8cec){_0x2cc79d=_0x2cc79d-0x0;var _0x2fbf42=_0xb9ff[_0x2cc79d];return _0x2fbf42;};'use strict';var Sequelize=require(_0xfb9f('0x0'));var moment=require(_0xfb9f('0x1'));module[_0xfb9f('0x2')]={'name':{'type':Sequelize[_0xfb9f('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0x5'),_0xfb9f('0x6'),_0xfb9f('0x7')),'allowNull':![],'defaultValue':_0xfb9f('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xfb9f('0x8')]},'status':{'type':Sequelize[_0xfb9f('0x3')],'defaultValue':_0xfb9f('0x9')},'type':{'type':Sequelize[_0xfb9f('0x4')](_0xfb9f('0xa'),_0xfb9f('0xb')),'allowNull':![],'defaultValue':_0xfb9f('0xa')},'reportId':{'type':Sequelize[_0xfb9f('0xc')](0xb)[_0xfb9f('0xd')]},'reportType':{'type':Sequelize[_0xfb9f('0x3')]}};
\ No newline at end of file
index 61aff2a..3b7d643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4c7=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','get','ExtractedReports','UserProfileResource','stack','name','send','index','map','AnalyticExtractedReport','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','params','keys','rawAttributes','intersection','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','body','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','format','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x282e7a,_0x36d4ed){var _0x1395cc=function(_0x237653){while(--_0x237653){_0x282e7a['push'](_0x282e7a['shift']());}};_0x1395cc(++_0x36d4ed);}(_0xc4c7,0x10a));var _0x7c4c=function(_0x1f7996,_0x299a14){_0x1f7996=_0x1f7996-0x0;var _0x584609=_0xc4c7[_0x1f7996];return _0x584609;};'use strict';var emlformat=require(_0x7c4c('0x0'));var rimraf=require(_0x7c4c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7c4c('0x2'));var rp=require(_0x7c4c('0x3'));var moment=require('moment');var BPromise=require(_0x7c4c('0x4'));var Mustache=require(_0x7c4c('0x5'));var util=require(_0x7c4c('0x6'));var path=require('path');var sox=require(_0x7c4c('0x7'));var csv=require('to-csv');var ejs=require(_0x7c4c('0x8'));var fs=require('fs');var fs_extra=require(_0x7c4c('0x9'));var _=require(_0x7c4c('0xa'));var squel=require(_0x7c4c('0xb'));var crypto=require(_0x7c4c('0xc'));var jsforce=require(_0x7c4c('0xd'));var deskjs=require(_0x7c4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7c4c('0xf'));var Papa=require(_0x7c4c('0x10'));var Redis=require(_0x7c4c('0x11'));var authService=require(_0x7c4c('0x12'));var qs=require(_0x7c4c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c4c('0x14'));var logger=require(_0x7c4c('0x15'))(_0x7c4c('0x16'));var utils=require(_0x7c4c('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7c4c('0x18'))['db'];function respondWithStatusCode(_0x31cb3b,_0x201692){_0x201692=_0x201692||0xcc;return function(_0x8499e9){if(_0x8499e9){return _0x31cb3b[_0x7c4c('0x19')](_0x201692);}return _0x31cb3b['status'](_0x201692)[_0x7c4c('0x1a')]();};}function respondWithResult(_0x37e59e,_0x17d1bf){_0x17d1bf=_0x17d1bf||0xc8;return function(_0x481418){if(_0x481418){return _0x37e59e[_0x7c4c('0x1b')](_0x17d1bf)[_0x7c4c('0x1c')](_0x481418);}};}function respondWithFilteredResult(_0x1c55f6,_0xb76f69){return function(_0x1680ef){if(_0x1680ef){var _0x2621b6=typeof _0xb76f69[_0x7c4c('0x1d')]===_0x7c4c('0x1e')&&typeof _0xb76f69[_0x7c4c('0x1f')]==='undefined';var _0x7ce384=_0x1680ef[_0x7c4c('0x20')];var _0x3d24c2=_0x2621b6?0x0:_0xb76f69['offset'];var _0x32e4d8=_0x2621b6?_0x1680ef[_0x7c4c('0x20')]:_0xb76f69[_0x7c4c('0x1d')]+_0xb76f69[_0x7c4c('0x1f')];var _0x2afb27;if(_0x32e4d8>=_0x7ce384){_0x32e4d8=_0x7ce384;_0x2afb27=0xc8;}else{_0x2afb27=0xce;}_0x1c55f6[_0x7c4c('0x1b')](_0x2afb27);return _0x1c55f6[_0x7c4c('0x21')](_0x7c4c('0x22'),_0x3d24c2+'-'+_0x32e4d8+'/'+_0x7ce384)[_0x7c4c('0x1c')](_0x1680ef);}return null;};}function patchUpdates(_0x2a7352){return function(_0x1adda2){try{jsonpatch['apply'](_0x1adda2,_0x2a7352,!![]);}catch(_0x1d6039){return BPromise[_0x7c4c('0x23')](_0x1d6039);}return _0x1adda2[_0x7c4c('0x24')]();};}function saveUpdates(_0x1cd863,_0x3935e5){return function(_0x1637eb){if(_0x1637eb){return _0x1637eb[_0x7c4c('0x25')](_0x1cd863)['then'](function(_0x100233){return _0x100233;});}return null;};}function removeEntity(_0x4fd0ea,_0x412783){return function(_0xff5941){if(_0xff5941){return _0xff5941[_0x7c4c('0x26')]()[_0x7c4c('0x27')](function(){var _0x260b64=_0xff5941[_0x7c4c('0x28')]({'plain':!![]});var _0x51a624=_0x7c4c('0x29');return db[_0x7c4c('0x2a')]['destroy']({'where':{'type':_0x51a624,'resourceId':_0x260b64['id']}})[_0x7c4c('0x27')](function(){return _0xff5941;});})[_0x7c4c('0x27')](function(){_0x4fd0ea[_0x7c4c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47ba37,_0x589e86){return function(_0x272dff){if(!_0x272dff){_0x47ba37['sendStatus'](0x194);}return _0x272dff;};}function handleError(_0x1d05cf,_0x4c52b7){_0x4c52b7=_0x4c52b7||0x1f4;return function(_0x1ddf7e){logger['error'](_0x1ddf7e[_0x7c4c('0x2b')]);if(_0x1ddf7e['name']){delete _0x1ddf7e[_0x7c4c('0x2c')];}_0x1d05cf[_0x7c4c('0x1b')](_0x4c52b7)[_0x7c4c('0x2d')](_0x1ddf7e);};}exports[_0x7c4c('0x2e')]=function(_0x50d6c5,_0x5c5cee){var _0x53af88={},_0xc332cd={},_0x3c72b9={'count':0x0,'rows':[]};var _0x495b00=_[_0x7c4c('0x2f')](db[_0x7c4c('0x30')]['rawAttributes'],function(_0x52d93a){return{'name':_0x52d93a[_0x7c4c('0x31')],'type':_0x52d93a['type'][_0x7c4c('0x32')]};});_0xc332cd[_0x7c4c('0x33')]=_[_0x7c4c('0x2f')](_0x495b00,'name');_0xc332cd[_0x7c4c('0x34')]=_['keys'](_0x50d6c5[_0x7c4c('0x34')]);_0xc332cd[_0x7c4c('0x35')]=_['intersection'](_0xc332cd['model'],_0xc332cd[_0x7c4c('0x34')]);_0x53af88['attributes']=_['intersection'](_0xc332cd[_0x7c4c('0x33')],qs['fields'](_0x50d6c5['query'][_0x7c4c('0x36')]));_0x53af88[_0x7c4c('0x37')]=_0x53af88[_0x7c4c('0x37')][_0x7c4c('0x38')]?_0x53af88[_0x7c4c('0x37')]:_0xc332cd[_0x7c4c('0x33')];if(!_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x39')](_0x7c4c('0x3a'))){_0x53af88['limit']=qs[_0x7c4c('0x1f')](_0x50d6c5['query'][_0x7c4c('0x1f')]);_0x53af88['offset']=qs['offset'](_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x1d')]);}_0x53af88[_0x7c4c('0x3b')]=qs['sort'](_0x50d6c5['query']['sort']);_0x53af88[_0x7c4c('0x3c')]=qs[_0x7c4c('0x35')](_['pick'](_0x50d6c5[_0x7c4c('0x34')],_0xc332cd['filters']),_0x495b00);if(_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x3d')]){_0x53af88['where']=_['merge'](_0x53af88[_0x7c4c('0x3c')],{'$or':_[_0x7c4c('0x2f')](_0x495b00,function(_0x580f5f){if(_0x580f5f[_0x7c4c('0x3e')]!==_0x7c4c('0x3f')){var _0x1ca99c={};_0x1ca99c[_0x580f5f[_0x7c4c('0x2c')]]={'$like':'%'+_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x3d')]+'%'};return _0x1ca99c;}})});}_0x53af88=_['merge']({},_0x53af88,_0x50d6c5[_0x7c4c('0x40')]);var _0x1b6cad={'where':_0x53af88[_0x7c4c('0x3c')]};return db['AnalyticExtractedReport'][_0x7c4c('0x20')](_0x1b6cad)['then'](function(_0xc3ef1b){_0x3c72b9[_0x7c4c('0x20')]=_0xc3ef1b;if(_0x50d6c5[_0x7c4c('0x34')][_0x7c4c('0x41')]){_0x53af88[_0x7c4c('0x42')]=[{'all':!![]}];}return db[_0x7c4c('0x30')][_0x7c4c('0x43')](_0x53af88);})['then'](function(_0x13b198){_0x3c72b9[_0x7c4c('0x44')]=_0x13b198;return _0x3c72b9;})[_0x7c4c('0x27')](respondWithFilteredResult(_0x5c5cee,_0x53af88))['catch'](handleError(_0x5c5cee,null));};exports['show']=function(_0x54abe7,_0x221638){var _0xbcd13b={'raw':!![],'where':{'id':_0x54abe7[_0x7c4c('0x45')]['id']}},_0x1bd9dd={};_0x1bd9dd[_0x7c4c('0x33')]=_[_0x7c4c('0x46')](db[_0x7c4c('0x30')][_0x7c4c('0x47')]);_0x1bd9dd[_0x7c4c('0x34')]=_[_0x7c4c('0x46')](_0x54abe7[_0x7c4c('0x34')]);_0x1bd9dd[_0x7c4c('0x35')]=_[_0x7c4c('0x48')](_0x1bd9dd[_0x7c4c('0x33')],_0x1bd9dd['query']);_0xbcd13b[_0x7c4c('0x37')]=_[_0x7c4c('0x48')](_0x1bd9dd[_0x7c4c('0x33')],qs[_0x7c4c('0x36')](_0x54abe7[_0x7c4c('0x34')][_0x7c4c('0x36')]));_0xbcd13b[_0x7c4c('0x37')]=_0xbcd13b[_0x7c4c('0x37')][_0x7c4c('0x38')]?_0xbcd13b[_0x7c4c('0x37')]:_0x1bd9dd['model'];if(_0x54abe7[_0x7c4c('0x34')][_0x7c4c('0x41')]){_0xbcd13b[_0x7c4c('0x42')]=[{'all':!![]}];}_0xbcd13b=_['merge']({},_0xbcd13b,_0x54abe7[_0x7c4c('0x40')]);return db['AnalyticExtractedReport'][_0x7c4c('0x49')](_0xbcd13b)['then'](handleEntityNotFound(_0x221638,null))[_0x7c4c('0x27')](respondWithResult(_0x221638,null))[_0x7c4c('0x4a')](handleError(_0x221638,null));};exports['create']=function(_0x156be7,_0x26fc0f){return db[_0x7c4c('0x30')][_0x7c4c('0x4b')](_0x156be7['body'],{})[_0x7c4c('0x27')](function(_0x4f9630){var _0x36e9c7=_0x156be7[_0x7c4c('0x4c')]['get']({'plain':!![]});if(!_0x36e9c7)throw new Error(_0x7c4c('0x4d'));if(_0x36e9c7[_0x7c4c('0x4e')]===_0x7c4c('0x4c')){var _0x4f3eea=_0x4f9630['get']({'plain':!![]});var _0x5e8f55='ExtractedReports';return db[_0x7c4c('0x4f')]['find']({'where':{'name':_0x5e8f55,'userProfileId':_0x36e9c7[_0x7c4c('0x50')]},'raw':!![]})[_0x7c4c('0x27')](function(_0x4f3fb6){if(_0x4f3fb6&&_0x4f3fb6['autoAssociation']===0x0){return db[_0x7c4c('0x2a')]['create']({'name':_0x4f3eea[_0x7c4c('0x2c')],'resourceId':_0x4f3eea['id'],'type':_0x4f3fb6[_0x7c4c('0x2c')],'sectionId':_0x4f3fb6['id']},{})[_0x7c4c('0x27')](function(){return _0x4f9630;});}else{return _0x4f9630;}})[_0x7c4c('0x4a')](function(_0x410b92){logger[_0x7c4c('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x410b92);throw _0x410b92;});}return _0x4f9630;})[_0x7c4c('0x27')](respondWithResult(_0x26fc0f,0xc9))[_0x7c4c('0x4a')](handleError(_0x26fc0f,null));};exports[_0x7c4c('0x25')]=function(_0x342015,_0x29e2e6){if(_0x342015[_0x7c4c('0x52')]['id']){delete _0x342015[_0x7c4c('0x52')]['id'];}return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x342015[_0x7c4c('0x45')]['id']}})['then'](handleEntityNotFound(_0x29e2e6,null))[_0x7c4c('0x27')](saveUpdates(_0x342015[_0x7c4c('0x52')],null))[_0x7c4c('0x27')](respondWithResult(_0x29e2e6,null))['catch'](handleError(_0x29e2e6,null));};exports[_0x7c4c('0x26')]=function(_0x44b15b,_0x5b8afd){return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x44b15b['params']['id']}})[_0x7c4c('0x27')](handleEntityNotFound(_0x5b8afd,null))['then'](removeEntity(_0x5b8afd,null))[_0x7c4c('0x4a')](handleError(_0x5b8afd,null));};exports['download']=function(_0x2184eb,_0x191930,_0x117b47){return db[_0x7c4c('0x30')][_0x7c4c('0x49')]({'where':{'id':_0x2184eb[_0x7c4c('0x45')]['id']},'attributes':[_0x7c4c('0x2c'),_0x7c4c('0x53'),_0x7c4c('0x54'),_0x7c4c('0x55')],'raw':!![]})[_0x7c4c('0x27')](handleEntityNotFound(_0x191930,null))[_0x7c4c('0x27')](function(_0x33bc93){if(_0x33bc93){if(!fs[_0x7c4c('0x56')](path[_0x7c4c('0x57')](config[_0x7c4c('0x58')],_0x7c4c('0x59'),_0x33bc93[_0x7c4c('0x54')]))){throw new db[(_0x7c4c('0x5a'))][(_0x7c4c('0x5b'))](_0x7c4c('0x5c'));}if(_0x2184eb[_0x7c4c('0x34')]['exists']){return _0x191930[_0x7c4c('0x19')](0xc8);}return _0x191930[_0x7c4c('0x5d')](path[_0x7c4c('0x57')](config[_0x7c4c('0x58')],_0x7c4c('0x59'),_0x33bc93['savename']),util[_0x7c4c('0x5e')]('%s.%s',_0x33bc93[_0x7c4c('0x53')]||_0x33bc93[_0x7c4c('0x2c')],_0x33bc93[_0x7c4c('0x55')]['toLowerCase']()));}})[_0x7c4c('0x4a')](handleError(_0x191930,null));};
\ No newline at end of file
+var _0xce3b=['AnalyticExtractedReport','fieldName','type','key','model','name','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','rawAttributes','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','params','basename','savename','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','send','index','map'];(function(_0x23c550,_0x7e41c4){var _0x5635b1=function(_0x68f9ce){while(--_0x68f9ce){_0x23c550['push'](_0x23c550['shift']());}};_0x5635b1(++_0x7e41c4);}(_0xce3b,0xfd));var _0xbce3=function(_0x3edee7,_0x7f56de){_0x3edee7=_0x3edee7-0x0;var _0x58d09b=_0xce3b[_0x3edee7];return _0x58d09b;};'use strict';var emlformat=require(_0xbce3('0x0'));var rimraf=require(_0xbce3('0x1'));var zipdir=require(_0xbce3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbce3('0x3'));var Mustache=require(_0xbce3('0x4'));var util=require('util');var path=require(_0xbce3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbce3('0x6'));var fs=require('fs');var fs_extra=require(_0xbce3('0x7'));var _=require(_0xbce3('0x8'));var squel=require(_0xbce3('0x9'));var crypto=require(_0xbce3('0xa'));var jsforce=require(_0xbce3('0xb'));var deskjs=require(_0xbce3('0xc'));var toCsv=require(_0xbce3('0xd'));var querystring=require(_0xbce3('0xe'));var Papa=require(_0xbce3('0xf'));var Redis=require(_0xbce3('0x10'));var authService=require(_0xbce3('0x11'));var qs=require(_0xbce3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbce3('0x13'));var logger=require('../../config/logger')(_0xbce3('0x14'));var utils=require(_0xbce3('0x15'));var config=require(_0xbce3('0x16'));var licenseUtil=require(_0xbce3('0x17'));var db=require(_0xbce3('0x18'))['db'];function respondWithStatusCode(_0x22c033,_0x1003cd){_0x1003cd=_0x1003cd||0xcc;return function(_0x263ddb){if(_0x263ddb){return _0x22c033['sendStatus'](_0x1003cd);}return _0x22c033[_0xbce3('0x19')](_0x1003cd)[_0xbce3('0x1a')]();};}function respondWithResult(_0x55d3fa,_0x42f00f){_0x42f00f=_0x42f00f||0xc8;return function(_0x2d0cd5){if(_0x2d0cd5){return _0x55d3fa[_0xbce3('0x19')](_0x42f00f)[_0xbce3('0x1b')](_0x2d0cd5);}};}function respondWithFilteredResult(_0x3fe8bb,_0x1951a3){return function(_0x233d11){if(_0x233d11){var _0x37cfd0=typeof _0x1951a3[_0xbce3('0x1c')]===_0xbce3('0x1d')&&typeof _0x1951a3[_0xbce3('0x1e')]===_0xbce3('0x1d');var _0xf565be=_0x233d11['count'];var _0x5d0af2=_0x37cfd0?0x0:_0x1951a3['offset'];var _0x3e3bea=_0x37cfd0?_0x233d11[_0xbce3('0x1f')]:_0x1951a3[_0xbce3('0x1c')]+_0x1951a3[_0xbce3('0x1e')];var _0xfe905d;if(_0x3e3bea>=_0xf565be){_0x3e3bea=_0xf565be;_0xfe905d=0xc8;}else{_0xfe905d=0xce;}_0x3fe8bb[_0xbce3('0x19')](_0xfe905d);return _0x3fe8bb[_0xbce3('0x20')](_0xbce3('0x21'),_0x5d0af2+'-'+_0x3e3bea+'/'+_0xf565be)[_0xbce3('0x1b')](_0x233d11);}return null;};}function patchUpdates(_0x48c923){return function(_0xecee1c){try{jsonpatch[_0xbce3('0x22')](_0xecee1c,_0x48c923,!![]);}catch(_0x544a73){return BPromise[_0xbce3('0x23')](_0x544a73);}return _0xecee1c[_0xbce3('0x24')]();};}function saveUpdates(_0x5d00f4,_0x158a07){return function(_0x3d006a){if(_0x3d006a){return _0x3d006a[_0xbce3('0x25')](_0x5d00f4)[_0xbce3('0x26')](function(_0x234a52){return _0x234a52;});}return null;};}function removeEntity(_0xcebcb9,_0x4ab3ce){return function(_0x1045fe){if(_0x1045fe){return _0x1045fe[_0xbce3('0x27')]()[_0xbce3('0x26')](function(){var _0x463abb=_0x1045fe['get']({'plain':!![]});var _0x2c91c9=_0xbce3('0x28');return db[_0xbce3('0x29')][_0xbce3('0x27')]({'where':{'type':_0x2c91c9,'resourceId':_0x463abb['id']}})['then'](function(){return _0x1045fe;});})[_0xbce3('0x26')](function(){_0xcebcb9[_0xbce3('0x19')](0xcc)[_0xbce3('0x1a')]();});}};}function handleEntityNotFound(_0xfb3e37,_0x73f2ad){return function(_0x9f621b){if(!_0x9f621b){_0xfb3e37['sendStatus'](0x194);}return _0x9f621b;};}function handleError(_0x37e302,_0x54d1cd){_0x54d1cd=_0x54d1cd||0x1f4;return function(_0x48e3a7){logger[_0xbce3('0x2a')](_0x48e3a7[_0xbce3('0x2b')]);if(_0x48e3a7['name']){delete _0x48e3a7['name'];}_0x37e302[_0xbce3('0x19')](_0x54d1cd)[_0xbce3('0x2c')](_0x48e3a7);};}exports[_0xbce3('0x2d')]=function(_0x5c2115,_0x4ca805){var _0x5dabc5={},_0x7b9d63={},_0x5eccfa={'count':0x0,'rows':[]};var _0x58f2b5=_[_0xbce3('0x2e')](db[_0xbce3('0x2f')]['rawAttributes'],function(_0x23350a){return{'name':_0x23350a[_0xbce3('0x30')],'type':_0x23350a[_0xbce3('0x31')][_0xbce3('0x32')]};});_0x7b9d63[_0xbce3('0x33')]=_[_0xbce3('0x2e')](_0x58f2b5,_0xbce3('0x34'));_0x7b9d63[_0xbce3('0x35')]=_[_0xbce3('0x36')](_0x5c2115[_0xbce3('0x35')]);_0x7b9d63[_0xbce3('0x37')]=_['intersection'](_0x7b9d63[_0xbce3('0x33')],_0x7b9d63[_0xbce3('0x35')]);_0x5dabc5[_0xbce3('0x38')]=_[_0xbce3('0x39')](_0x7b9d63[_0xbce3('0x33')],qs[_0xbce3('0x3a')](_0x5c2115['query'][_0xbce3('0x3a')]));_0x5dabc5[_0xbce3('0x38')]=_0x5dabc5['attributes']['length']?_0x5dabc5[_0xbce3('0x38')]:_0x7b9d63['model'];if(!_0x5c2115['query'][_0xbce3('0x3b')](_0xbce3('0x3c'))){_0x5dabc5['limit']=qs[_0xbce3('0x1e')](_0x5c2115[_0xbce3('0x35')][_0xbce3('0x1e')]);_0x5dabc5[_0xbce3('0x1c')]=qs['offset'](_0x5c2115[_0xbce3('0x35')][_0xbce3('0x1c')]);}_0x5dabc5[_0xbce3('0x3d')]=qs['sort'](_0x5c2115[_0xbce3('0x35')]['sort']);_0x5dabc5[_0xbce3('0x3e')]=qs[_0xbce3('0x37')](_[_0xbce3('0x3f')](_0x5c2115[_0xbce3('0x35')],_0x7b9d63[_0xbce3('0x37')]),_0x58f2b5);if(_0x5c2115[_0xbce3('0x35')][_0xbce3('0x40')]){_0x5dabc5[_0xbce3('0x3e')]=_['merge'](_0x5dabc5[_0xbce3('0x3e')],{'$or':_[_0xbce3('0x2e')](_0x58f2b5,function(_0x435b9f){if(_0x435b9f['type']!==_0xbce3('0x41')){var _0xe11b38={};_0xe11b38[_0x435b9f[_0xbce3('0x34')]]={'$like':'%'+_0x5c2115[_0xbce3('0x35')][_0xbce3('0x40')]+'%'};return _0xe11b38;}})});}_0x5dabc5=_['merge']({},_0x5dabc5,_0x5c2115[_0xbce3('0x42')]);var _0x56a15c={'where':_0x5dabc5[_0xbce3('0x3e')]};return db[_0xbce3('0x2f')]['count'](_0x56a15c)['then'](function(_0x47be37){_0x5eccfa[_0xbce3('0x1f')]=_0x47be37;if(_0x5c2115[_0xbce3('0x35')][_0xbce3('0x43')]){_0x5dabc5[_0xbce3('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xbce3('0x45')](_0x5dabc5);})[_0xbce3('0x26')](function(_0x2c4657){_0x5eccfa['rows']=_0x2c4657;return _0x5eccfa;})[_0xbce3('0x26')](respondWithFilteredResult(_0x4ca805,_0x5dabc5))[_0xbce3('0x46')](handleError(_0x4ca805,null));};exports[_0xbce3('0x47')]=function(_0x25dd31,_0x4fc0d4){var _0x13d4d3={'raw':!![],'where':{'id':_0x25dd31['params']['id']}},_0x1d5c10={};_0x1d5c10['model']=_[_0xbce3('0x36')](db['AnalyticExtractedReport'][_0xbce3('0x48')]);_0x1d5c10[_0xbce3('0x35')]=_['keys'](_0x25dd31[_0xbce3('0x35')]);_0x1d5c10['filters']=_[_0xbce3('0x39')](_0x1d5c10[_0xbce3('0x33')],_0x1d5c10['query']);_0x13d4d3[_0xbce3('0x38')]=_[_0xbce3('0x39')](_0x1d5c10['model'],qs['fields'](_0x25dd31[_0xbce3('0x35')][_0xbce3('0x3a')]));_0x13d4d3['attributes']=_0x13d4d3[_0xbce3('0x38')][_0xbce3('0x49')]?_0x13d4d3[_0xbce3('0x38')]:_0x1d5c10['model'];if(_0x25dd31[_0xbce3('0x35')]['includeAll']){_0x13d4d3[_0xbce3('0x44')]=[{'all':!![]}];}_0x13d4d3=_[_0xbce3('0x4a')]({},_0x13d4d3,_0x25dd31['options']);return db[_0xbce3('0x2f')][_0xbce3('0x4b')](_0x13d4d3)[_0xbce3('0x26')](handleEntityNotFound(_0x4fc0d4,null))[_0xbce3('0x26')](respondWithResult(_0x4fc0d4,null))[_0xbce3('0x46')](handleError(_0x4fc0d4,null));};exports[_0xbce3('0x4c')]=function(_0x35a9e0,_0x239030){return db[_0xbce3('0x2f')][_0xbce3('0x4c')](_0x35a9e0[_0xbce3('0x4d')],{})[_0xbce3('0x26')](function(_0x274f73){var _0x9b67bc=_0x35a9e0[_0xbce3('0x4e')][_0xbce3('0x4f')]({'plain':!![]});if(!_0x9b67bc)throw new Error(_0xbce3('0x50'));if(_0x9b67bc['role']===_0xbce3('0x4e')){var _0x31aaa4=_0x274f73[_0xbce3('0x4f')]({'plain':!![]});var _0x5e3177=_0xbce3('0x28');return db[_0xbce3('0x51')]['find']({'where':{'name':_0x5e3177,'userProfileId':_0x9b67bc[_0xbce3('0x52')]},'raw':!![]})['then'](function(_0x51f909){if(_0x51f909&&_0x51f909['autoAssociation']===0x0){return db[_0xbce3('0x29')][_0xbce3('0x4c')]({'name':_0x31aaa4[_0xbce3('0x34')],'resourceId':_0x31aaa4['id'],'type':_0x51f909[_0xbce3('0x34')],'sectionId':_0x51f909['id']},{})[_0xbce3('0x26')](function(){return _0x274f73;});}else{return _0x274f73;}})[_0xbce3('0x46')](function(_0x1a211d){logger[_0xbce3('0x2a')](_0xbce3('0x53'),_0x1a211d);throw _0x1a211d;});}return _0x274f73;})['then'](respondWithResult(_0x239030,0xc9))[_0xbce3('0x46')](handleError(_0x239030,null));};exports[_0xbce3('0x25')]=function(_0x557fd2,_0x167f56){if(_0x557fd2[_0xbce3('0x4d')]['id']){delete _0x557fd2[_0xbce3('0x4d')]['id'];}return db[_0xbce3('0x2f')]['find']({'where':{'id':_0x557fd2['params']['id']}})[_0xbce3('0x26')](handleEntityNotFound(_0x167f56,null))[_0xbce3('0x26')](saveUpdates(_0x557fd2[_0xbce3('0x4d')],null))[_0xbce3('0x26')](respondWithResult(_0x167f56,null))[_0xbce3('0x46')](handleError(_0x167f56,null));};exports[_0xbce3('0x27')]=function(_0x55c338,_0x36d250){return db[_0xbce3('0x2f')]['find']({'where':{'id':_0x55c338['params']['id']}})[_0xbce3('0x26')](handleEntityNotFound(_0x36d250,null))['then'](removeEntity(_0x36d250,null))[_0xbce3('0x46')](handleError(_0x36d250,null));};exports[_0xbce3('0x54')]=function(_0xdc119c,_0x919877,_0x1766a6){return db['AnalyticExtractedReport']['find']({'where':{'id':_0xdc119c[_0xbce3('0x55')]['id']},'attributes':[_0xbce3('0x34'),_0xbce3('0x56'),_0xbce3('0x57'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x919877,null))['then'](function(_0x40e8bc){if(_0x40e8bc){if(!fs[_0xbce3('0x58')](path[_0xbce3('0x59')](config[_0xbce3('0x5a')],_0xbce3('0x5b'),_0x40e8bc[_0xbce3('0x57')]))){throw new db[(_0xbce3('0x5c'))][(_0xbce3('0x5d'))](_0xbce3('0x5e'));}if(_0xdc119c[_0xbce3('0x35')][_0xbce3('0x5f')]){return _0x919877[_0xbce3('0x60')](0xc8);}return _0x919877['download'](path['join'](config[_0xbce3('0x5a')],'server/files/reports',_0x40e8bc['savename']),util[_0xbce3('0x61')](_0xbce3('0x62'),_0x40e8bc[_0xbce3('0x56')]||_0x40e8bc[_0xbce3('0x34')],_0x40e8bc['output'][_0xbce3('0x63')]()));}})[_0xbce3('0x46')](handleError(_0x919877,null));};
\ No newline at end of file
index d7c1a4b..ca0d3c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29ec=['./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x5de121,_0x263670){var _0x37042e=function(_0xbd1385){while(--_0xbd1385){_0x5de121['push'](_0x5de121['shift']());}};_0x37042e(++_0x263670);}(_0x29ec,0x1dd));var _0xc29e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc29e('0x0'));var util=require(_0xc29e('0x1'));var logger=require('../../config/logger')(_0xc29e('0x2'));var moment=require(_0xc29e('0x3'));var BPromise=require(_0xc29e('0x4'));var rp=require(_0xc29e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc29e('0x6'));var attributes=require(_0xc29e('0x7'));module[_0xc29e('0x8')]=function(_0x1ca3b9,_0x3cf169){return _0x1ca3b9[_0xc29e('0x9')](_0xc29e('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe9a5=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash'];(function(_0x2578fc,_0x33c460){var _0x2a25c6=function(_0x354945){while(--_0x354945){_0x2578fc['push'](_0x2578fc['shift']());}};_0x2a25c6(++_0x33c460);}(_0xe9a5,0x1cd));var _0x5e9a=function(_0x2c7c59,_0x53aece){_0x2c7c59=_0x2c7c59-0x0;var _0x57eae2=_0xe9a5[_0x2c7c59];return _0x57eae2;};'use strict';var _=require(_0x5e9a('0x0'));var util=require('util');var logger=require(_0x5e9a('0x1'))(_0x5e9a('0x2'));var moment=require(_0x5e9a('0x3'));var BPromise=require(_0x5e9a('0x4'));var rp=require(_0x5e9a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e9a('0x6'));var attributes=require(_0x5e9a('0x7'));module[_0x5e9a('0x8')]=function(_0x25cc67,_0xba0362){return _0x25cc67[_0x5e9a('0x9')](_0x5e9a('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 82657b5..149fb2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaea2=['info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x479b99,_0x1e5bec){var _0x1e7eb7=function(_0x52ac6c){while(--_0x52ac6c){_0x479b99['push'](_0x479b99['shift']());}};_0x1e7eb7(++_0x1e5bec);}(_0xaea2,0x9d));var _0x2aea=function(_0x20bedd,_0x39694b){_0x20bedd=_0x20bedd-0x0;var _0x3041f3=_0xaea2[_0x20bedd];return _0x3041f3;};'use strict';var _=require(_0x2aea('0x0'));var util=require('util');var moment=require(_0x2aea('0x1'));var BPromise=require(_0x2aea('0x2'));var rs=require(_0x2aea('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2aea('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2aea('0x5'))(_0x2aea('0x6'));var config=require(_0x2aea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2aea('0x8')][_0x2aea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f8f58,_0x74a170,_0x4d99f3){return new BPromise(function(_0x5d5f17,_0x83f295){return client['request'](_0x2f8f58,_0x4d99f3)[_0x2aea('0xa')](function(_0x2eac57){logger[_0x2aea('0xb')](_0x2aea('0xc'),_0x74a170,_0x2aea('0xd'));logger[_0x2aea('0xe')](_0x2aea('0xf'),_0x74a170,_0x2aea('0xd'),JSON[_0x2aea('0x10')](_0x2eac57));if(_0x2eac57[_0x2aea('0x11')]){if(_0x2eac57[_0x2aea('0x11')][_0x2aea('0x12')]===0x1f4){logger[_0x2aea('0x11')](_0x2aea('0xc'),_0x74a170,_0x2eac57[_0x2aea('0x11')]['message']);return _0x83f295(_0x2eac57['error'][_0x2aea('0x13')]);}logger[_0x2aea('0x11')](_0x2aea('0xc'),_0x74a170,_0x2eac57[_0x2aea('0x11')][_0x2aea('0x13')]);return _0x5d5f17(_0x2eac57['error']['message']);}else{logger[_0x2aea('0xb')](_0x2aea('0xc'),_0x74a170,_0x2aea('0xd'));_0x5d5f17(_0x2eac57['result'][_0x2aea('0x13')]);}})[_0x2aea('0x14')](function(_0x27c7ee){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x74a170,_0x27c7ee);_0x83f295(_0x27c7ee);});});}
\ No newline at end of file
+var _0xbfba=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','request','info','AnalyticExtractedReport,\x20%s,\x20%s','debug'];(function(_0x175186,_0x2549a4){var _0xe02d75=function(_0x452e53){while(--_0x452e53){_0x175186['push'](_0x175186['shift']());}};_0xe02d75(++_0x2549a4);}(_0xbfba,0x1ac));var _0xabfb=function(_0x2f37e0,_0x35590f){_0x2f37e0=_0x2f37e0-0x0;var _0x549acb=_0xbfba[_0x2f37e0];return _0x549acb;};'use strict';var _=require(_0xabfb('0x0'));var util=require(_0xabfb('0x1'));var moment=require(_0xabfb('0x2'));var BPromise=require(_0xabfb('0x3'));var rs=require(_0xabfb('0x4'));var fs=require('fs');var Redis=require(_0xabfb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xabfb('0x6'));var logger=require('../../config/logger')(_0xabfb('0x7'));var config=require(_0xabfb('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5aed1e,_0x1f992a,_0x3af781){return new BPromise(function(_0x1d5320,_0x3e2904){return client[_0xabfb('0x9')](_0x5aed1e,_0x3af781)['then'](function(_0x42d549){logger[_0xabfb('0xa')](_0xabfb('0xb'),_0x1f992a,'request\x20sent');logger[_0xabfb('0xc')](_0xabfb('0xd'),_0x1f992a,_0xabfb('0xe'),JSON[_0xabfb('0xf')](_0x42d549));if(_0x42d549['error']){if(_0x42d549[_0xabfb('0x10')][_0xabfb('0x11')]===0x1f4){logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);return _0x3e2904(_0x42d549[_0xabfb('0x10')]['message']);}logger[_0xabfb('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1f992a,_0x42d549['error'][_0xabfb('0x12')]);return _0x1d5320(_0x42d549[_0xabfb('0x10')][_0xabfb('0x12')]);}else{logger['info'](_0xabfb('0xb'),_0x1f992a,_0xabfb('0xe'));_0x1d5320(_0x42d549[_0xabfb('0x13')][_0xabfb('0x12')]);}})[_0xabfb('0x14')](function(_0x327708){logger[_0xabfb('0x10')](_0xabfb('0xb'),_0x1f992a,_0x327708);_0x3e2904(_0x327708);});});}
\ No newline at end of file
index 61cc93c..58d9c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98bf=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','/:id/download','post','create','put','update','delete','destroy','multer'];(function(_0x5758e5,_0x545eb3){var _0x3ab924=function(_0x53f19f){while(--_0x53f19f){_0x5758e5['push'](_0x5758e5['shift']());}};_0x3ab924(++_0x545eb3);}(_0x98bf,0x1da));var _0xf98b=function(_0x27975e,_0x4856c2){_0x27975e=_0x27975e-0x0;var _0x383887=_0x98bf[_0x27975e];return _0x383887;};'use strict';var multer=require(_0xf98b('0x0'));var util=require(_0xf98b('0x1'));var path=require(_0xf98b('0x2'));var timeout=require(_0xf98b('0x3'));var express=require(_0xf98b('0x4'));var router=express['Router']();var fs_extra=require(_0xf98b('0x5'));var auth=require(_0xf98b('0x6'));var interaction=require(_0xf98b('0x7'));var config=require('../../config/environment');var controller=require(_0xf98b('0x8'));router['get']('/',auth[_0xf98b('0x9')](),controller['index']);router[_0xf98b('0xa')](_0xf98b('0xb'),auth[_0xf98b('0x9')](),controller['show']);router[_0xf98b('0xa')](_0xf98b('0xc'),auth['isAuthenticated'](),controller['download']);router[_0xf98b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf98b('0xe')]);router[_0xf98b('0xf')]('/:id',auth[_0xf98b('0x9')](),controller[_0xf98b('0x10')]);router[_0xf98b('0x11')](_0xf98b('0xb'),auth[_0xf98b('0x9')](),controller[_0xf98b('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x649f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','put','update','destroy','exports'];(function(_0x3df871,_0xda2e11){var _0x570f7b=function(_0xfaac78){while(--_0xfaac78){_0x3df871['push'](_0x3df871['shift']());}};_0x570f7b(++_0xda2e11);}(_0x649f,0x168));var _0xf649=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x649f[_0xa148b7];return _0x51efd3;};'use strict';var multer=require(_0xf649('0x0'));var util=require(_0xf649('0x1'));var path=require(_0xf649('0x2'));var timeout=require(_0xf649('0x3'));var express=require(_0xf649('0x4'));var router=express[_0xf649('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf649('0x6'));var interaction=require(_0xf649('0x7'));var config=require('../../config/environment');var controller=require(_0xf649('0x8'));router['get']('/',auth[_0xf649('0x9')](),controller['index']);router[_0xf649('0xa')](_0xf649('0xb'),auth[_0xf649('0x9')](),controller[_0xf649('0xc')]);router[_0xf649('0xa')](_0xf649('0xd'),auth[_0xf649('0x9')](),controller[_0xf649('0xe')]);router[_0xf649('0xf')]('/',auth[_0xf649('0x9')](),controller['create']);router[_0xf649('0x10')]('/:id',auth[_0xf649('0x9')](),controller[_0xf649('0x11')]);router['delete'](_0xf649('0xb'),auth[_0xf649('0x9')](),controller[_0xf649('0x12')]);module[_0xf649('0x13')]=router;
\ No newline at end of file
index 2a74fa0..c4c6500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7238=['BOOLEAN','exports','TEXT','STRING'];(function(_0x3efa96,_0x29d114){var _0x127486=function(_0x54e1a3){while(--_0x54e1a3){_0x3efa96['push'](_0x3efa96['shift']());}};_0x127486(++_0x29d114);}(_0x7238,0x165));var _0x8723=function(_0x2fd910,_0x1b3b3e){_0x2fd910=_0x2fd910-0x0;var _0x1d7d9c=_0x7238[_0x2fd910];return _0x1d7d9c;};'use strict';var Sequelize=require('sequelize');module[_0x8723('0x0')]={'field':{'type':Sequelize[_0x8723('0x1')]},'alias':{'type':Sequelize[_0x8723('0x2')]},'function':{'type':Sequelize[_0x8723('0x2')]},'format':{'type':Sequelize[_0x8723('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x8723('0x2')]},'custom':{'type':Sequelize[_0x8723('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc23d=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x1001d4,_0x2dc30c){var _0x53b9f2=function(_0x29524d){while(--_0x29524d){_0x1001d4['push'](_0x1001d4['shift']());}};_0x53b9f2(++_0x2dc30c);}(_0xc23d,0x9d));var _0xdc23=function(_0x1857d0,_0x6eade0){_0x1857d0=_0x1857d0-0x0;var _0x3e3c46=_0xc23d[_0x1857d0];return _0x3e3c46;};'use strict';var Sequelize=require(_0xdc23('0x0'));module[_0xdc23('0x1')]={'field':{'type':Sequelize[_0xdc23('0x2')]},'alias':{'type':Sequelize[_0xdc23('0x3')]},'function':{'type':Sequelize[_0xdc23('0x3')]},'format':{'type':Sequelize[_0xdc23('0x3')]},'groupBy':{'type':Sequelize[_0xdc23('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xdc23('0x3')]},'custom':{'type':Sequelize[_0xdc23('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 6585685..6d5fb57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2f0=['query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','AnalyticFieldReport','rawAttributes','type','key','map'];(function(_0x28014d,_0x383e2f){var _0x2572cc=function(_0x17aabd){while(--_0x17aabd){_0x28014d['push'](_0x28014d['shift']());}};_0x2572cc(++_0x383e2f);}(_0xe2f0,0x11d));var _0x0e2f=function(_0x36153d,_0x4fed67){_0x36153d=_0x36153d-0x0;var _0xfdacff=_0xe2f0[_0x36153d];return _0xfdacff;};'use strict';var emlformat=require(_0x0e2f('0x0'));var rimraf=require(_0x0e2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e2f('0x2'));var rp=require(_0x0e2f('0x3'));var moment=require(_0x0e2f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0e2f('0x5'));var util=require('util');var path=require(_0x0e2f('0x6'));var sox=require(_0x0e2f('0x7'));var csv=require(_0x0e2f('0x8'));var ejs=require(_0x0e2f('0x9'));var fs=require('fs');var fs_extra=require(_0x0e2f('0xa'));var _=require(_0x0e2f('0xb'));var squel=require('squel');var crypto=require(_0x0e2f('0xc'));var jsforce=require(_0x0e2f('0xd'));var deskjs=require(_0x0e2f('0xe'));var toCsv=require(_0x0e2f('0x8'));var querystring=require(_0x0e2f('0xf'));var Papa=require(_0x0e2f('0x10'));var Redis=require('ioredis');var authService=require(_0x0e2f('0x11'));var qs=require(_0x0e2f('0x12'));var as=require(_0x0e2f('0x13'));var hardwareService=require(_0x0e2f('0x14'));var logger=require(_0x0e2f('0x15'))(_0x0e2f('0x16'));var utils=require(_0x0e2f('0x17'));var config=require(_0x0e2f('0x18'));var licenseUtil=require(_0x0e2f('0x19'));var db=require(_0x0e2f('0x1a'))['db'];function respondWithStatusCode(_0x1a1c0c,_0x3fe931){_0x3fe931=_0x3fe931||0xcc;return function(_0x58de95){if(_0x58de95){return _0x1a1c0c['sendStatus'](_0x3fe931);}return _0x1a1c0c[_0x0e2f('0x1b')](_0x3fe931)[_0x0e2f('0x1c')]();};}function respondWithResult(_0x447746,_0x4885e0){_0x4885e0=_0x4885e0||0xc8;return function(_0x19a521){if(_0x19a521){return _0x447746[_0x0e2f('0x1b')](_0x4885e0)[_0x0e2f('0x1d')](_0x19a521);}};}function respondWithFilteredResult(_0x5d3895,_0x23a2d7){return function(_0x4e3c5f){if(_0x4e3c5f){var _0x107cb2=typeof _0x23a2d7[_0x0e2f('0x1e')]==='undefined'&&typeof _0x23a2d7[_0x0e2f('0x1f')]==='undefined';var _0xeaa009=_0x4e3c5f[_0x0e2f('0x20')];var _0x5b4dd5=_0x107cb2?0x0:_0x23a2d7[_0x0e2f('0x1e')];var _0x39b0ee=_0x107cb2?_0x4e3c5f['count']:_0x23a2d7[_0x0e2f('0x1e')]+_0x23a2d7[_0x0e2f('0x1f')];var _0x2148c7;if(_0x39b0ee>=_0xeaa009){_0x39b0ee=_0xeaa009;_0x2148c7=0xc8;}else{_0x2148c7=0xce;}_0x5d3895[_0x0e2f('0x1b')](_0x2148c7);return _0x5d3895[_0x0e2f('0x21')](_0x0e2f('0x22'),_0x5b4dd5+'-'+_0x39b0ee+'/'+_0xeaa009)[_0x0e2f('0x1d')](_0x4e3c5f);}return null;};}function patchUpdates(_0x36d535){return function(_0x4f1584){try{jsonpatch[_0x0e2f('0x23')](_0x4f1584,_0x36d535,!![]);}catch(_0x4337a2){return BPromise[_0x0e2f('0x24')](_0x4337a2);}return _0x4f1584[_0x0e2f('0x25')]();};}function saveUpdates(_0x222b2f,_0x156d8b){return function(_0x5b7191){if(_0x5b7191){return _0x5b7191[_0x0e2f('0x26')](_0x222b2f)['then'](function(_0x1e4457){return _0x1e4457;});}return null;};}function removeEntity(_0x36d70e,_0x335419){return function(_0x3d04d8){if(_0x3d04d8){return _0x3d04d8[_0x0e2f('0x27')]()[_0x0e2f('0x28')](function(){_0x36d70e[_0x0e2f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47dcaa,_0x322e72){return function(_0x2f38c4){if(!_0x2f38c4){_0x47dcaa[_0x0e2f('0x29')](0x194);}return _0x2f38c4;};}function handleError(_0x53b6bb,_0x25a41c){_0x25a41c=_0x25a41c||0x1f4;return function(_0x3d934c){logger[_0x0e2f('0x2a')](_0x3d934c[_0x0e2f('0x2b')]);if(_0x3d934c[_0x0e2f('0x2c')]){delete _0x3d934c[_0x0e2f('0x2c')];}_0x53b6bb['status'](_0x25a41c)[_0x0e2f('0x2d')](_0x3d934c);};}exports['index']=function(_0x16f4f2,_0x3a179c){var _0x59ace3={},_0x5b963b={},_0x21aae8={'count':0x0,'rows':[]};var _0x3bb3b4=_['map'](db[_0x0e2f('0x2e')][_0x0e2f('0x2f')],function(_0x152762){return{'name':_0x152762['fieldName'],'type':_0x152762[_0x0e2f('0x30')][_0x0e2f('0x31')]};});_0x5b963b['model']=_[_0x0e2f('0x32')](_0x3bb3b4,_0x0e2f('0x2c'));_0x5b963b[_0x0e2f('0x33')]=_['keys'](_0x16f4f2[_0x0e2f('0x33')]);_0x5b963b[_0x0e2f('0x34')]=_[_0x0e2f('0x35')](_0x5b963b[_0x0e2f('0x36')],_0x5b963b[_0x0e2f('0x33')]);_0x59ace3[_0x0e2f('0x37')]=_['intersection'](_0x5b963b['model'],qs[_0x0e2f('0x38')](_0x16f4f2[_0x0e2f('0x33')]['fields']));_0x59ace3[_0x0e2f('0x37')]=_0x59ace3['attributes'][_0x0e2f('0x39')]?_0x59ace3[_0x0e2f('0x37')]:_0x5b963b[_0x0e2f('0x36')];if(!_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3a')](_0x0e2f('0x3b'))){_0x59ace3[_0x0e2f('0x1f')]=qs[_0x0e2f('0x1f')](_0x16f4f2['query'][_0x0e2f('0x1f')]);_0x59ace3[_0x0e2f('0x1e')]=qs[_0x0e2f('0x1e')](_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x1e')]);}_0x59ace3['order']=qs[_0x0e2f('0x3c')](_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3c')]);_0x59ace3[_0x0e2f('0x3d')]=qs[_0x0e2f('0x34')](_[_0x0e2f('0x3e')](_0x16f4f2['query'],_0x5b963b[_0x0e2f('0x34')]),_0x3bb3b4);if(_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3f')]){_0x59ace3[_0x0e2f('0x3d')]=_[_0x0e2f('0x40')](_0x59ace3[_0x0e2f('0x3d')],{'$or':_[_0x0e2f('0x32')](_0x3bb3b4,function(_0x3c766a){if(_0x3c766a['type']!==_0x0e2f('0x41')){var _0x39ee03={};_0x39ee03[_0x3c766a[_0x0e2f('0x2c')]]={'$like':'%'+_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x3f')]+'%'};return _0x39ee03;}})});}_0x59ace3=_[_0x0e2f('0x40')]({},_0x59ace3,_0x16f4f2[_0x0e2f('0x42')]);var _0x2f69d2={'where':_0x59ace3[_0x0e2f('0x3d')]};return db[_0x0e2f('0x2e')][_0x0e2f('0x20')](_0x2f69d2)[_0x0e2f('0x28')](function(_0x564f0a){_0x21aae8['count']=_0x564f0a;if(_0x16f4f2[_0x0e2f('0x33')][_0x0e2f('0x43')]){_0x59ace3[_0x0e2f('0x44')]=[{'all':!![]}];}return db[_0x0e2f('0x2e')]['findAll'](_0x59ace3);})[_0x0e2f('0x28')](function(_0x410fb2){_0x21aae8[_0x0e2f('0x45')]=_0x410fb2;return _0x21aae8;})[_0x0e2f('0x28')](respondWithFilteredResult(_0x3a179c,_0x59ace3))['catch'](handleError(_0x3a179c,null));};exports[_0x0e2f('0x46')]=function(_0x54596b,_0x5b6365){var _0x442e66={'raw':![],'where':{'id':_0x54596b[_0x0e2f('0x47')]['id']}},_0x3769fd={};_0x3769fd['model']=_['keys'](db[_0x0e2f('0x2e')][_0x0e2f('0x2f')]);_0x3769fd['query']=_[_0x0e2f('0x48')](_0x54596b[_0x0e2f('0x33')]);_0x3769fd[_0x0e2f('0x34')]=_[_0x0e2f('0x35')](_0x3769fd[_0x0e2f('0x36')],_0x3769fd[_0x0e2f('0x33')]);_0x442e66[_0x0e2f('0x37')]=_['intersection'](_0x3769fd[_0x0e2f('0x36')],qs[_0x0e2f('0x38')](_0x54596b[_0x0e2f('0x33')]['fields']));_0x442e66['attributes']=_0x442e66[_0x0e2f('0x37')][_0x0e2f('0x39')]?_0x442e66[_0x0e2f('0x37')]:_0x3769fd['model'];if(_0x54596b[_0x0e2f('0x33')][_0x0e2f('0x43')]){_0x442e66[_0x0e2f('0x44')]=[{'all':!![]}];}_0x442e66=_[_0x0e2f('0x40')]({},_0x442e66,_0x54596b[_0x0e2f('0x42')]);return db[_0x0e2f('0x2e')][_0x0e2f('0x49')](_0x442e66)['then'](handleEntityNotFound(_0x5b6365,null))[_0x0e2f('0x28')](respondWithResult(_0x5b6365,null))[_0x0e2f('0x4a')](handleError(_0x5b6365,null));};exports[_0x0e2f('0x4b')]=function(_0x5ef757,_0x3d37b3){return db[_0x0e2f('0x2e')][_0x0e2f('0x4b')](_0x5ef757['body'],{})[_0x0e2f('0x28')](respondWithResult(_0x3d37b3,0xc9))[_0x0e2f('0x4a')](handleError(_0x3d37b3,null));};exports['bulkCreate']=function(_0x107d08,_0x4ca6bc){return db['AnalyticFieldReport']['bulkCreate'](_0x107d08[_0x0e2f('0x4c')],{'raw':![],'individualHooks':!![]})[_0x0e2f('0x28')](respondWithResult(_0x4ca6bc,0xc9))[_0x0e2f('0x4a')](handleError(_0x4ca6bc,null));};exports[_0x0e2f('0x26')]=function(_0x2654ff,_0x549989){if(_0x2654ff[_0x0e2f('0x4c')]['id']){delete _0x2654ff['body']['id'];}return db[_0x0e2f('0x2e')][_0x0e2f('0x49')]({'where':{'id':_0x2654ff[_0x0e2f('0x47')]['id']}})[_0x0e2f('0x28')](handleEntityNotFound(_0x549989,null))[_0x0e2f('0x28')](saveUpdates(_0x2654ff[_0x0e2f('0x4c')],null))['then'](respondWithResult(_0x549989,null))[_0x0e2f('0x4a')](handleError(_0x549989,null));};exports[_0x0e2f('0x27')]=function(_0x164fb6,_0x169922){return db[_0x0e2f('0x2e')][_0x0e2f('0x49')]({'where':{'id':_0x164fb6[_0x0e2f('0x47')]['id']}})['then'](handleEntityNotFound(_0x169922,null))['then'](removeEntity(_0x169922,null))[_0x0e2f('0x4a')](handleError(_0x169922,null));};exports[_0x0e2f('0x4d')]=function(_0x1fa804,_0x1553cc){return db[_0x0e2f('0x2e')][_0x0e2f('0x27')]({'where':{'id':_0x1fa804[_0x0e2f('0x33')][_0x0e2f('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x0e2f('0x28')](respondWithResult(_0x1553cc,0xcc))[_0x0e2f('0x4a')](handleError(_0x1553cc,null));};exports[_0x0e2f('0x4f')]=function(_0x5334ad,_0x5700f7,_0x20c55a){return db[_0x0e2f('0x50')][_0x0e2f('0x51')]({'where':{'id':_0x5334ad['params']['id']}})['then'](handleEntityNotFound(_0x5700f7,null))[_0x0e2f('0x28')](function(_0x5dfda8){if(_0x5dfda8){return db[_0x0e2f('0x52')]['transaction'](function(_0x3c0a4c){return db[_0x0e2f('0x2e')][_0x0e2f('0x27')]({'where':{'CustomReportId':_0x5334ad[_0x0e2f('0x47')]['id']},'transaction':_0x3c0a4c})[_0x0e2f('0x28')](function(_0x40074d){var _0x3c9584=_[_0x0e2f('0x32')](_0x5334ad[_0x0e2f('0x4c')],function(_0x571fd9){delete _0x571fd9['id'];_0x571fd9['CustomReportId']=_0x5334ad[_0x0e2f('0x47')]['id'];return _0x571fd9;});return db[_0x0e2f('0x2e')][_0x0e2f('0x53')](_0x3c9584,{'transaction':_0x3c0a4c});});})['then'](function(){return db[_0x0e2f('0x2e')]['findAll']({'where':{'CustomReportId':_0x5334ad[_0x0e2f('0x47')]['id']}});});}})['then'](respondWithResult(_0x5700f7,null))[_0x0e2f('0x4a')](handleError(_0x5700f7,null));};
\ No newline at end of file
+var _0x5c83=['rawAttributes','length','includeAll','find','catch','create','body','bulkCreate','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','map','AnalyticFieldReport','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filters','pick','where','merge','options','include','rows','show','params'];(function(_0x1d79ba,_0x2a2106){var _0x161296=function(_0x5166ea){while(--_0x5166ea){_0x1d79ba['push'](_0x1d79ba['shift']());}};_0x161296(++_0x2a2106);}(_0x5c83,0xb2));var _0x35c8=function(_0x1cc961,_0x2c42ee){_0x1cc961=_0x1cc961-0x0;var _0x471d86=_0x5c83[_0x1cc961];return _0x471d86;};'use strict';var emlformat=require(_0x35c8('0x0'));var rimraf=require(_0x35c8('0x1'));var zipdir=require(_0x35c8('0x2'));var jsonpatch=require(_0x35c8('0x3'));var rp=require(_0x35c8('0x4'));var moment=require(_0x35c8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c8('0x6'));var util=require(_0x35c8('0x7'));var path=require('path');var sox=require(_0x35c8('0x8'));var csv=require('to-csv');var ejs=require(_0x35c8('0x9'));var fs=require('fs');var fs_extra=require(_0x35c8('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x35c8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35c8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x35c8('0xd'));var Papa=require(_0x35c8('0xe'));var Redis=require(_0x35c8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x35c8('0x10'));var as=require(_0x35c8('0x11'));var hardwareService=require(_0x35c8('0x12'));var logger=require(_0x35c8('0x13'))(_0x35c8('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x35c8('0x15'));var db=require(_0x35c8('0x16'))['db'];function respondWithStatusCode(_0x3b3c91,_0x4c597e){_0x4c597e=_0x4c597e||0xcc;return function(_0x1802b2){if(_0x1802b2){return _0x3b3c91[_0x35c8('0x17')](_0x4c597e);}return _0x3b3c91[_0x35c8('0x18')](_0x4c597e)[_0x35c8('0x19')]();};}function respondWithResult(_0x52bbd7,_0x17ab37){_0x17ab37=_0x17ab37||0xc8;return function(_0x39390c){if(_0x39390c){return _0x52bbd7[_0x35c8('0x18')](_0x17ab37)[_0x35c8('0x1a')](_0x39390c);}};}function respondWithFilteredResult(_0x1da72f,_0x3f1a1e){return function(_0x71a68f){if(_0x71a68f){var _0x2eee79=typeof _0x3f1a1e[_0x35c8('0x1b')]==='undefined'&&typeof _0x3f1a1e[_0x35c8('0x1c')]===_0x35c8('0x1d');var _0x203277=_0x71a68f[_0x35c8('0x1e')];var _0x3b54d0=_0x2eee79?0x0:_0x3f1a1e['offset'];var _0x23f337=_0x2eee79?_0x71a68f[_0x35c8('0x1e')]:_0x3f1a1e['offset']+_0x3f1a1e[_0x35c8('0x1c')];var _0xd76bba;if(_0x23f337>=_0x203277){_0x23f337=_0x203277;_0xd76bba=0xc8;}else{_0xd76bba=0xce;}_0x1da72f['status'](_0xd76bba);return _0x1da72f['set'](_0x35c8('0x1f'),_0x3b54d0+'-'+_0x23f337+'/'+_0x203277)[_0x35c8('0x1a')](_0x71a68f);}return null;};}function patchUpdates(_0x22273b){return function(_0x13873c){try{jsonpatch[_0x35c8('0x20')](_0x13873c,_0x22273b,!![]);}catch(_0x33bc60){return BPromise[_0x35c8('0x21')](_0x33bc60);}return _0x13873c[_0x35c8('0x22')]();};}function saveUpdates(_0x80d4a7,_0x1801c7){return function(_0x4f895d){if(_0x4f895d){return _0x4f895d['update'](_0x80d4a7)[_0x35c8('0x23')](function(_0x488472){return _0x488472;});}return null;};}function removeEntity(_0x4867ec,_0x4afec9){return function(_0xc6b330){if(_0xc6b330){return _0xc6b330[_0x35c8('0x24')]()[_0x35c8('0x23')](function(){_0x4867ec[_0x35c8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1869fc,_0x20569c){return function(_0x1bbe32){if(!_0x1bbe32){_0x1869fc[_0x35c8('0x17')](0x194);}return _0x1bbe32;};}function handleError(_0x33d28f,_0x48ab3c){_0x48ab3c=_0x48ab3c||0x1f4;return function(_0x38821f){logger[_0x35c8('0x25')](_0x38821f['stack']);if(_0x38821f[_0x35c8('0x26')]){delete _0x38821f['name'];}_0x33d28f[_0x35c8('0x18')](_0x48ab3c)[_0x35c8('0x27')](_0x38821f);};}exports['index']=function(_0x5397e4,_0x5e10c8){var _0x2314b6={},_0x2b4787={},_0x32998a={'count':0x0,'rows':[]};var _0x2e8d37=_[_0x35c8('0x28')](db[_0x35c8('0x29')]['rawAttributes'],function(_0x250c02){return{'name':_0x250c02[_0x35c8('0x2a')],'type':_0x250c02[_0x35c8('0x2b')]['key']};});_0x2b4787[_0x35c8('0x2c')]=_[_0x35c8('0x28')](_0x2e8d37,'name');_0x2b4787[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x5397e4[_0x35c8('0x2d')]);_0x2b4787['filters']=_['intersection'](_0x2b4787[_0x35c8('0x2c')],_0x2b4787[_0x35c8('0x2d')]);_0x2314b6[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x2b4787[_0x35c8('0x2c')],qs[_0x35c8('0x31')](_0x5397e4[_0x35c8('0x2d')]['fields']));_0x2314b6[_0x35c8('0x2f')]=_0x2314b6['attributes']['length']?_0x2314b6[_0x35c8('0x2f')]:_0x2b4787[_0x35c8('0x2c')];if(!_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x32')](_0x35c8('0x33'))){_0x2314b6[_0x35c8('0x1c')]=qs[_0x35c8('0x1c')](_0x5397e4[_0x35c8('0x2d')]['limit']);_0x2314b6[_0x35c8('0x1b')]=qs['offset'](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x1b')]);}_0x2314b6['order']=qs[_0x35c8('0x34')](_0x5397e4[_0x35c8('0x2d')][_0x35c8('0x34')]);_0x2314b6['where']=qs[_0x35c8('0x35')](_[_0x35c8('0x36')](_0x5397e4[_0x35c8('0x2d')],_0x2b4787['filters']),_0x2e8d37);if(_0x5397e4[_0x35c8('0x2d')]['filter']){_0x2314b6[_0x35c8('0x37')]=_[_0x35c8('0x38')](_0x2314b6['where'],{'$or':_[_0x35c8('0x28')](_0x2e8d37,function(_0x241e06){if(_0x241e06[_0x35c8('0x2b')]!=='VIRTUAL'){var _0x4210a2={};_0x4210a2[_0x241e06[_0x35c8('0x26')]]={'$like':'%'+_0x5397e4[_0x35c8('0x2d')]['filter']+'%'};return _0x4210a2;}})});}_0x2314b6=_[_0x35c8('0x38')]({},_0x2314b6,_0x5397e4[_0x35c8('0x39')]);var _0x45b470={'where':_0x2314b6[_0x35c8('0x37')]};return db[_0x35c8('0x29')][_0x35c8('0x1e')](_0x45b470)['then'](function(_0x441383){_0x32998a[_0x35c8('0x1e')]=_0x441383;if(_0x5397e4[_0x35c8('0x2d')]['includeAll']){_0x2314b6[_0x35c8('0x3a')]=[{'all':!![]}];}return db[_0x35c8('0x29')]['findAll'](_0x2314b6);})[_0x35c8('0x23')](function(_0x1ce112){_0x32998a[_0x35c8('0x3b')]=_0x1ce112;return _0x32998a;})[_0x35c8('0x23')](respondWithFilteredResult(_0x5e10c8,_0x2314b6))['catch'](handleError(_0x5e10c8,null));};exports[_0x35c8('0x3c')]=function(_0x4f22c0,_0x500bed){var _0x95f09e={'raw':![],'where':{'id':_0x4f22c0[_0x35c8('0x3d')]['id']}},_0x568f77={};_0x568f77[_0x35c8('0x2c')]=_['keys'](db['AnalyticFieldReport'][_0x35c8('0x3e')]);_0x568f77[_0x35c8('0x2d')]=_[_0x35c8('0x2e')](_0x4f22c0[_0x35c8('0x2d')]);_0x568f77[_0x35c8('0x35')]=_[_0x35c8('0x30')](_0x568f77[_0x35c8('0x2c')],_0x568f77[_0x35c8('0x2d')]);_0x95f09e[_0x35c8('0x2f')]=_[_0x35c8('0x30')](_0x568f77['model'],qs[_0x35c8('0x31')](_0x4f22c0[_0x35c8('0x2d')][_0x35c8('0x31')]));_0x95f09e[_0x35c8('0x2f')]=_0x95f09e[_0x35c8('0x2f')][_0x35c8('0x3f')]?_0x95f09e[_0x35c8('0x2f')]:_0x568f77[_0x35c8('0x2c')];if(_0x4f22c0['query'][_0x35c8('0x40')]){_0x95f09e['include']=[{'all':!![]}];}_0x95f09e=_[_0x35c8('0x38')]({},_0x95f09e,_0x4f22c0[_0x35c8('0x39')]);return db[_0x35c8('0x29')][_0x35c8('0x41')](_0x95f09e)['then'](handleEntityNotFound(_0x500bed,null))[_0x35c8('0x23')](respondWithResult(_0x500bed,null))[_0x35c8('0x42')](handleError(_0x500bed,null));};exports[_0x35c8('0x43')]=function(_0x44a9a4,_0x148f16){return db[_0x35c8('0x29')][_0x35c8('0x43')](_0x44a9a4[_0x35c8('0x44')],{})[_0x35c8('0x23')](respondWithResult(_0x148f16,0xc9))[_0x35c8('0x42')](handleError(_0x148f16,null));};exports[_0x35c8('0x45')]=function(_0x8cd018,_0x38ef88){return db[_0x35c8('0x29')][_0x35c8('0x45')](_0x8cd018[_0x35c8('0x44')],{'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x38ef88,0xc9))[_0x35c8('0x42')](handleError(_0x38ef88,null));};exports[_0x35c8('0x46')]=function(_0x32a7e3,_0x434904){if(_0x32a7e3[_0x35c8('0x44')]['id']){delete _0x32a7e3['body']['id'];}return db[_0x35c8('0x29')]['find']({'where':{'id':_0x32a7e3[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x434904,null))['then'](saveUpdates(_0x32a7e3[_0x35c8('0x44')],null))[_0x35c8('0x23')](respondWithResult(_0x434904,null))['catch'](handleError(_0x434904,null));};exports[_0x35c8('0x24')]=function(_0x3d8f2f,_0x520d39){return db[_0x35c8('0x29')]['find']({'where':{'id':_0x3d8f2f[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x520d39,null))['then'](removeEntity(_0x520d39,null))[_0x35c8('0x42')](handleError(_0x520d39,null));};exports[_0x35c8('0x47')]=function(_0x12f7e7,_0x2d1c7f){return db[_0x35c8('0x29')][_0x35c8('0x24')]({'where':{'id':_0x12f7e7[_0x35c8('0x2d')][_0x35c8('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x35c8('0x23')](respondWithResult(_0x2d1c7f,0xcc))[_0x35c8('0x42')](handleError(_0x2d1c7f,null));};exports[_0x35c8('0x49')]=function(_0xc52713,_0x1c913a,_0x691b3c){return db[_0x35c8('0x4a')][_0x35c8('0x4b')]({'where':{'id':_0xc52713[_0x35c8('0x3d')]['id']}})[_0x35c8('0x23')](handleEntityNotFound(_0x1c913a,null))[_0x35c8('0x23')](function(_0x4d74c0){if(_0x4d74c0){return db[_0x35c8('0x4c')][_0x35c8('0x4d')](function(_0x27b62c){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']},'transaction':_0x27b62c})[_0x35c8('0x23')](function(_0x417f3c){var _0x1a843b=_['map'](_0xc52713[_0x35c8('0x44')],function(_0x51b850){delete _0x51b850['id'];_0x51b850[_0x35c8('0x4e')]=_0xc52713[_0x35c8('0x3d')]['id'];return _0x51b850;});return db['AnalyticFieldReport'][_0x35c8('0x45')](_0x1a843b,{'transaction':_0x27b62c});});})['then'](function(){return db[_0x35c8('0x29')][_0x35c8('0x4f')]({'where':{'CustomReportId':_0xc52713[_0x35c8('0x3d')]['id']}});});}})[_0x35c8('0x23')](respondWithResult(_0x1c913a,null))[_0x35c8('0x42')](handleError(_0x1c913a,null));};
\ No newline at end of file
index 1a98cbd..bb0121f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6cd=['path','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x21ba12,_0x2d96b2){var _0x49981d=function(_0x435ed7){while(--_0x435ed7){_0x21ba12['push'](_0x21ba12['shift']());}};_0x49981d(++_0x2d96b2);}(_0xe6cd,0x1b6));var _0xde6c=function(_0x519d64,_0x15828c){_0x519d64=_0x519d64-0x0;var _0x58700e=_0xe6cd[_0x519d64];return _0x58700e;};'use strict';var _=require(_0xde6c('0x0'));var util=require(_0xde6c('0x1'));var logger=require(_0xde6c('0x2'))(_0xde6c('0x3'));var moment=require('moment');var BPromise=require(_0xde6c('0x4'));var rp=require(_0xde6c('0x5'));var fs=require('fs');var path=require(_0xde6c('0x6'));var rimraf=require(_0xde6c('0x7'));var config=require('../../config/environment');var attributes=require(_0xde6c('0x8'));module[_0xde6c('0x9')]=function(_0xf5ffc4,_0x44ff10){return _0xf5ffc4['define'](_0xde6c('0xa'),attributes,{'tableName':_0xde6c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cab=['AnalyticFieldReport','analytics_report_fields','util','api','moment','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','define'];(function(_0x3ae7b7,_0x469102){var _0x550b35=function(_0x5dd4ea){while(--_0x5dd4ea){_0x3ae7b7['push'](_0x3ae7b7['shift']());}};_0x550b35(++_0x469102);}(_0x8cab,0x70));var _0xb8ca=function(_0x2cc846,_0x162211){_0x2cc846=_0x2cc846-0x0;var _0x119261=_0x8cab[_0x2cc846];return _0x119261;};'use strict';var _=require('lodash');var util=require(_0xb8ca('0x0'));var logger=require('../../config/logger')(_0xb8ca('0x1'));var moment=require(_0xb8ca('0x2'));var BPromise=require(_0xb8ca('0x3'));var rp=require(_0xb8ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb8ca('0x5'));var attributes=require(_0xb8ca('0x6'));module['exports']=function(_0xedfec6,_0x104775){return _0xedfec6[_0xb8ca('0x7')](_0xb8ca('0x8'),attributes,{'tableName':_0xb8ca('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09850f9..0d1d763 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8510=['http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x2b31ad,_0x4f9f32){var _0x2ea20c=function(_0x3acae7){while(--_0x3acae7){_0x2b31ad['push'](_0x2b31ad['shift']());}};_0x2ea20c(++_0x4f9f32);}(_0x8510,0x171));var _0x0851=function(_0x4bcf14,_0x1e1a26){_0x4bcf14=_0x4bcf14-0x0;var _0x9acc80=_0x8510[_0x4bcf14];return _0x9acc80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0851('0x0'));var BPromise=require(_0x0851('0x1'));var rs=require(_0x0851('0x2'));var fs=require('fs');var Redis=require(_0x0851('0x3'));var db=require(_0x0851('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0851('0x5'))(_0x0851('0x6'));var config=require(_0x0851('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0851('0x8')][_0x0851('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c156c,_0x10a25b,_0x1aabf9){return new BPromise(function(_0x2f6ed2,_0x2436c9){return client[_0x0851('0xa')](_0x2c156c,_0x1aabf9)[_0x0851('0xb')](function(_0x1e7727){logger[_0x0851('0xc')](_0x0851('0xd'),_0x10a25b,_0x0851('0xe'));logger[_0x0851('0xf')](_0x0851('0x10'),_0x10a25b,_0x0851('0xe'),JSON[_0x0851('0x11')](_0x1e7727));if(_0x1e7727['error']){if(_0x1e7727[_0x0851('0x12')]['code']===0x1f4){logger[_0x0851('0x12')](_0x0851('0xd'),_0x10a25b,_0x1e7727[_0x0851('0x12')][_0x0851('0x13')]);return _0x2436c9(_0x1e7727['error'][_0x0851('0x13')]);}logger[_0x0851('0x12')](_0x0851('0xd'),_0x10a25b,_0x1e7727[_0x0851('0x12')][_0x0851('0x13')]);return _0x2f6ed2(_0x1e7727[_0x0851('0x12')]['message']);}else{logger[_0x0851('0xc')](_0x0851('0xd'),_0x10a25b,'request\x20sent');_0x2f6ed2(_0x1e7727[_0x0851('0x14')][_0x0851('0x13')]);}})['catch'](function(_0x32955c){logger['error'](_0x0851('0xd'),_0x10a25b,_0x32955c);_0x2436c9(_0x32955c);});});}
\ No newline at end of file
+var _0xf479=['client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1cd784,_0x5d4804){var _0x25c73a=function(_0x3c0ca9){while(--_0x3c0ca9){_0x1cd784['push'](_0x1cd784['shift']());}};_0x25c73a(++_0x5d4804);}(_0xf479,0x142));var _0x9f47=function(_0x5e3bda,_0x108667){_0x5e3bda=_0x5e3bda-0x0;var _0x3f02cf=_0xf479[_0x5e3bda];return _0x3f02cf;};'use strict';var _=require(_0x9f47('0x0'));var util=require('util');var moment=require(_0x9f47('0x1'));var BPromise=require(_0x9f47('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f47('0x3'))['db'];var utils=require(_0x9f47('0x4'));var logger=require(_0x9f47('0x5'))('rpc');var config=require(_0x9f47('0x6'));var jayson=require(_0x9f47('0x7'));var client=jayson[_0x9f47('0x8')][_0x9f47('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x453c74,_0x3fd73b,_0x3c435d){return new BPromise(function(_0x488d28,_0x39ae27){return client[_0x9f47('0xa')](_0x453c74,_0x3c435d)['then'](function(_0x57a99e){logger[_0x9f47('0xb')](_0x9f47('0xc'),_0x3fd73b,_0x9f47('0xd'));logger[_0x9f47('0xe')](_0x9f47('0xf'),_0x3fd73b,_0x9f47('0xd'),JSON[_0x9f47('0x10')](_0x57a99e));if(_0x57a99e[_0x9f47('0x11')]){if(_0x57a99e[_0x9f47('0x11')][_0x9f47('0x12')]===0x1f4){logger['error'](_0x9f47('0xc'),_0x3fd73b,_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);return _0x39ae27(_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);}logger[_0x9f47('0x11')](_0x9f47('0xc'),_0x3fd73b,_0x57a99e[_0x9f47('0x11')][_0x9f47('0x13')]);return _0x488d28(_0x57a99e['error'][_0x9f47('0x13')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x3fd73b,'request\x20sent');_0x488d28(_0x57a99e[_0x9f47('0x14')][_0x9f47('0x13')]);}})[_0x9f47('0x15')](function(_0x424a1d){logger[_0x9f47('0x11')](_0x9f47('0xc'),_0x3fd73b,_0x424a1d);_0x39ae27(_0x424a1d);});});}
\ No newline at end of file
index 4b1c838..e4a1029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5afcb0,_0x2e7b25){var _0x2f55b2=function(_0x135b1a){while(--_0x135b1a){_0x5afcb0['push'](_0x5afcb0['shift']());}};_0x2f55b2(++_0x2e7b25);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x202e3c,_0x532538){var _0x2743d7=function(_0x4a18d9){while(--_0x4a18d9){_0x202e3c['push'](_0x202e3c['shift']());}};_0x2743d7(++_0x532538);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
index e2a48c8..aeb4902 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['STRING','name','TEXT','exports'];(function(_0xf00cf4,_0xfb1b71){var _0x51914c=function(_0x164acb){while(--_0x164acb){_0xf00cf4['push'](_0xf00cf4['shift']());}};_0x51914c(++_0xfb1b71);}(_0xb688,0xcf));var _0x8b68=function(_0xef1737,_0x4d0aa6){_0xef1737=_0xef1737-0x0;var _0x4068e4=_0xb688[_0xef1737];return _0x4068e4;};'use strict';var Sequelize=require('sequelize');module[_0x8b68('0x0')]={'name':{'type':Sequelize[_0x8b68('0x1')],'allowNull':![],'unique':_0x8b68('0x2')},'table':{'type':Sequelize[_0x8b68('0x1')]},'metric':{'type':Sequelize[_0x8b68('0x3')]},'description':{'type':Sequelize[_0x8b68('0x1')]}};
\ No newline at end of file
+var _0x95c5=['exports','name','STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x153));var _0x595c=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x95c5[_0x487b0c];return _0x1adbdc;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x595c('0x2')},'table':{'type':Sequelize[_0x595c('0x3')]},'metric':{'type':Sequelize[_0x595c('0x4')]},'description':{'type':Sequelize[_0x595c('0x3')]}};
\ No newline at end of file
index eec26f1..3b285ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3ed69b,_0x53c5ab){var _0x4b0cfd=function(_0x9ee065){while(--_0x9ee065){_0x3ed69b['push'](_0x3ed69b['shift']());}};_0x4b0cfd(++_0x53c5ab);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2f1908,_0x5d837d){_0x2f1908=_0x2f1908-0x0;var _0x357795=_0x7fbe[_0x2f1908];return _0x357795;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0x8d0e=['then','get','Metrics','UserProfileResource','end','sendStatus','error','stack','name','send','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','fields','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy'];(function(_0xee0152,_0xfe1ea7){var _0x1a69d1=function(_0x51e881){while(--_0x51e881){_0xee0152['push'](_0xee0152['shift']());}};_0x1a69d1(++_0xfe1ea7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x552af4,_0x37915b){_0x552af4=_0x552af4-0x0;var _0x10dc30=_0x8d0e[_0x552af4];return _0x10dc30;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];function respondWithStatusCode(_0x5934b2,_0x38fac0){_0x38fac0=_0x38fac0||0xcc;return function(_0x15b9e5){if(_0x15b9e5){return _0x5934b2['sendStatus'](_0x38fac0);}return _0x5934b2[_0xe8d0('0x1b')](_0x38fac0)['end']();};}function respondWithResult(_0x59b4b7,_0x90a1ea){_0x90a1ea=_0x90a1ea||0xc8;return function(_0x2aa906){if(_0x2aa906){return _0x59b4b7[_0xe8d0('0x1b')](_0x90a1ea)[_0xe8d0('0x1c')](_0x2aa906);}};}function respondWithFilteredResult(_0x15d3a1,_0x7151c6){return function(_0x52818a){if(_0x52818a){var _0x6ccffa=typeof _0x7151c6['offset']===_0xe8d0('0x1d')&&typeof _0x7151c6[_0xe8d0('0x1e')]===_0xe8d0('0x1d');var _0x4d1db4=_0x52818a['count'];var _0x47c67a=_0x6ccffa?0x0:_0x7151c6[_0xe8d0('0x1f')];var _0x384854=_0x6ccffa?_0x52818a[_0xe8d0('0x20')]:_0x7151c6[_0xe8d0('0x1f')]+_0x7151c6[_0xe8d0('0x1e')];var _0x588133;if(_0x384854>=_0x4d1db4){_0x384854=_0x4d1db4;_0x588133=0xc8;}else{_0x588133=0xce;}_0x15d3a1[_0xe8d0('0x1b')](_0x588133);return _0x15d3a1[_0xe8d0('0x21')]('Content-Range',_0x47c67a+'-'+_0x384854+'/'+_0x4d1db4)['json'](_0x52818a);}return null;};}function patchUpdates(_0x554402){return function(_0x384a60){try{jsonpatch[_0xe8d0('0x22')](_0x384a60,_0x554402,!![]);}catch(_0x25363b){return BPromise[_0xe8d0('0x23')](_0x25363b);}return _0x384a60[_0xe8d0('0x24')]();};}function saveUpdates(_0x23a945,_0x1bd25c){return function(_0x28a6b5){if(_0x28a6b5){return _0x28a6b5[_0xe8d0('0x25')](_0x23a945)['then'](function(_0xed8f2e){return _0xed8f2e;});}return null;};}function removeEntity(_0x9f747,_0x572c25){return function(_0x106614){if(_0x106614){return _0x106614[_0xe8d0('0x26')]()[_0xe8d0('0x27')](function(){var _0xd86c76=_0x106614[_0xe8d0('0x28')]({'plain':!![]});var _0x149dfd=_0xe8d0('0x29');return db[_0xe8d0('0x2a')][_0xe8d0('0x26')]({'where':{'type':_0x149dfd,'resourceId':_0xd86c76['id']}})[_0xe8d0('0x27')](function(){return _0x106614;});})[_0xe8d0('0x27')](function(){_0x9f747['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0x26dd52,_0x10dec2){return function(_0x486f49){if(!_0x486f49){_0x26dd52[_0xe8d0('0x2c')](0x194);}return _0x486f49;};}function handleError(_0x343b08,_0x526240){_0x526240=_0x526240||0x1f4;return function(_0x1519e2){logger[_0xe8d0('0x2d')](_0x1519e2[_0xe8d0('0x2e')]);if(_0x1519e2[_0xe8d0('0x2f')]){delete _0x1519e2[_0xe8d0('0x2f')];}_0x343b08['status'](_0x526240)[_0xe8d0('0x30')](_0x1519e2);};}exports['index']=function(_0x5d3276,_0x50ad3c){var _0x547a2b={},_0x13cd4c={},_0x36ccec={'count':0x0,'rows':[]};var _0x5151fa=_['map'](db[_0xe8d0('0x31')]['rawAttributes'],function(_0x3b5d31){return{'name':_0x3b5d31[_0xe8d0('0x32')],'type':_0x3b5d31[_0xe8d0('0x33')][_0xe8d0('0x34')]};});_0x13cd4c[_0xe8d0('0x35')]=_['map'](_0x5151fa,_0xe8d0('0x2f'));_0x13cd4c[_0xe8d0('0x36')]=_[_0xe8d0('0x37')](_0x5d3276[_0xe8d0('0x36')]);_0x13cd4c['filters']=_[_0xe8d0('0x38')](_0x13cd4c[_0xe8d0('0x35')],_0x13cd4c['query']);_0x547a2b[_0xe8d0('0x39')]=_['intersection'](_0x13cd4c[_0xe8d0('0x35')],qs['fields'](_0x5d3276[_0xe8d0('0x36')]['fields']));_0x547a2b[_0xe8d0('0x39')]=_0x547a2b[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x547a2b[_0xe8d0('0x39')]:_0x13cd4c['model'];if(!_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3b')](_0xe8d0('0x3c'))){_0x547a2b['limit']=qs[_0xe8d0('0x1e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x1e')]);_0x547a2b[_0xe8d0('0x1f')]=qs[_0xe8d0('0x1f')](_0x5d3276['query'][_0xe8d0('0x1f')]);}_0x547a2b[_0xe8d0('0x3d')]=qs[_0xe8d0('0x3e')](_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x3e')]);_0x547a2b[_0xe8d0('0x3f')]=qs[_0xe8d0('0x40')](_[_0xe8d0('0x41')](_0x5d3276['query'],_0x13cd4c['filters']),_0x5151fa);if(_0x5d3276[_0xe8d0('0x36')][_0xe8d0('0x42')]){_0x547a2b[_0xe8d0('0x3f')]=_[_0xe8d0('0x43')](_0x547a2b[_0xe8d0('0x3f')],{'$or':_['map'](_0x5151fa,function(_0x2e4362){if(_0x2e4362['type']!==_0xe8d0('0x44')){var _0x458294={};_0x458294[_0x2e4362[_0xe8d0('0x2f')]]={'$like':'%'+_0x5d3276['query'][_0xe8d0('0x42')]+'%'};return _0x458294;}})});}_0x547a2b=_[_0xe8d0('0x43')]({},_0x547a2b,_0x5d3276[_0xe8d0('0x45')]);var _0x230a90={'where':_0x547a2b[_0xe8d0('0x3f')]};return db['AnalyticMetric']['count'](_0x230a90)['then'](function(_0x4cf0da){_0x36ccec[_0xe8d0('0x20')]=_0x4cf0da;if(_0x5d3276['query'][_0xe8d0('0x46')]){_0x547a2b[_0xe8d0('0x47')]=[{'all':!![]}];}return db[_0xe8d0('0x31')][_0xe8d0('0x48')](_0x547a2b);})[_0xe8d0('0x27')](function(_0x1156da){_0x36ccec[_0xe8d0('0x49')]=_0x1156da;return _0x36ccec;})[_0xe8d0('0x27')](respondWithFilteredResult(_0x50ad3c,_0x547a2b))['catch'](handleError(_0x50ad3c,null));};exports[_0xe8d0('0x4a')]=function(_0x1da8b2,_0x4a3740){var _0x4bcdff={'raw':!![],'where':{'id':_0x1da8b2[_0xe8d0('0x4b')]['id']}},_0x3825a1={};_0x3825a1[_0xe8d0('0x35')]=_['keys'](db[_0xe8d0('0x31')][_0xe8d0('0x4c')]);_0x3825a1['query']=_[_0xe8d0('0x37')](_0x1da8b2[_0xe8d0('0x36')]);_0x3825a1['filters']=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],_0x3825a1[_0xe8d0('0x36')]);_0x4bcdff[_0xe8d0('0x39')]=_[_0xe8d0('0x38')](_0x3825a1[_0xe8d0('0x35')],qs[_0xe8d0('0x4d')](_0x1da8b2[_0xe8d0('0x36')]['fields']));_0x4bcdff[_0xe8d0('0x39')]=_0x4bcdff[_0xe8d0('0x39')][_0xe8d0('0x3a')]?_0x4bcdff[_0xe8d0('0x39')]:_0x3825a1[_0xe8d0('0x35')];if(_0x1da8b2[_0xe8d0('0x36')][_0xe8d0('0x46')]){_0x4bcdff[_0xe8d0('0x47')]=[{'all':!![]}];}_0x4bcdff=_[_0xe8d0('0x43')]({},_0x4bcdff,_0x1da8b2[_0xe8d0('0x45')]);return db[_0xe8d0('0x31')][_0xe8d0('0x4e')](_0x4bcdff)['then'](handleEntityNotFound(_0x4a3740,null))[_0xe8d0('0x27')](respondWithResult(_0x4a3740,null))[_0xe8d0('0x4f')](handleError(_0x4a3740,null));};exports[_0xe8d0('0x50')]=function(_0xad7d94,_0x34047c){return db[_0xe8d0('0x31')][_0xe8d0('0x50')](_0xad7d94['body'],{})[_0xe8d0('0x27')](function(_0x424764){var _0x151cf4=_0xad7d94[_0xe8d0('0x51')]['get']({'plain':!![]});if(!_0x151cf4)throw new Error(_0xe8d0('0x52'));if(_0x151cf4['role']===_0xe8d0('0x51')){var _0x382ae9=_0x424764[_0xe8d0('0x28')]({'plain':!![]});var _0x158d24=_0xe8d0('0x29');return db[_0xe8d0('0x53')][_0xe8d0('0x4e')]({'where':{'name':_0x158d24,'userProfileId':_0x151cf4['userProfileId']},'raw':!![]})[_0xe8d0('0x27')](function(_0x55f93d){if(_0x55f93d&&_0x55f93d['autoAssociation']===0x0){return db[_0xe8d0('0x2a')]['create']({'name':_0x382ae9[_0xe8d0('0x2f')],'resourceId':_0x382ae9['id'],'type':_0x55f93d['name'],'sectionId':_0x55f93d['id']},{})[_0xe8d0('0x27')](function(){return _0x424764;});}else{return _0x424764;}})[_0xe8d0('0x4f')](function(_0x13713c){logger[_0xe8d0('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13713c);throw _0x13713c;});}return _0x424764;})[_0xe8d0('0x27')](respondWithResult(_0x34047c,0xc9))[_0xe8d0('0x4f')](handleError(_0x34047c,null));};exports[_0xe8d0('0x25')]=function(_0x2e3f1d,_0x18cc14){if(_0x2e3f1d['body']['id']){delete _0x2e3f1d[_0xe8d0('0x54')]['id'];}return db[_0xe8d0('0x31')][_0xe8d0('0x4e')]({'where':{'id':_0x2e3f1d['params']['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x18cc14,null))['then'](saveUpdates(_0x2e3f1d['body'],null))[_0xe8d0('0x27')](respondWithResult(_0x18cc14,null))[_0xe8d0('0x4f')](handleError(_0x18cc14,null));};exports['destroy']=function(_0xcb6ce2,_0x3a8074){return db['AnalyticMetric'][_0xe8d0('0x4e')]({'where':{'id':_0xcb6ce2[_0xe8d0('0x4b')]['id']}})[_0xe8d0('0x27')](handleEntityNotFound(_0x3a8074,null))[_0xe8d0('0x27')](removeEntity(_0x3a8074,null))['catch'](handleError(_0x3a8074,null));};
\ No newline at end of file
index 52ca6dd..e05e309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff22=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','lodash','util','api','moment'];(function(_0x245bea,_0x17c058){var _0x40ccb4=function(_0x931843){while(--_0x931843){_0x245bea['push'](_0x245bea['shift']());}};_0x40ccb4(++_0x17c058);}(_0xff22,0x1a0));var _0x2ff2=function(_0x19223d,_0x53120f){_0x19223d=_0x19223d-0x0;var _0x1331c9=_0xff22[_0x19223d];return _0x1331c9;};'use strict';var _=require(_0x2ff2('0x0'));var util=require(_0x2ff2('0x1'));var logger=require('../../config/logger')(_0x2ff2('0x2'));var moment=require(_0x2ff2('0x3'));var BPromise=require(_0x2ff2('0x4'));var rp=require(_0x2ff2('0x5'));var fs=require('fs');var path=require(_0x2ff2('0x6'));var rimraf=require(_0x2ff2('0x7'));var config=require(_0x2ff2('0x8'));var attributes=require(_0x2ff2('0x9'));module[_0x2ff2('0xa')]=function(_0x47906b,_0x21f303){return _0x47906b[_0x2ff2('0xb')](_0x2ff2('0xc'),attributes,{'tableName':_0x2ff2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5031=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x7bb949,_0xafa335){var _0x500e31=function(_0x2b5769){while(--_0x2b5769){_0x7bb949['push'](_0x7bb949['shift']());}};_0x500e31(++_0xafa335);}(_0x5031,0x144));var _0x1503=function(_0x5cd939,_0xac0983){_0x5cd939=_0x5cd939-0x0;var _0x6c5526=_0x5031[_0x5cd939];return _0x6c5526;};'use strict';var _=require(_0x1503('0x0'));var util=require(_0x1503('0x1'));var logger=require(_0x1503('0x2'))(_0x1503('0x3'));var moment=require(_0x1503('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1503('0x5'));var rimraf=require(_0x1503('0x6'));var config=require(_0x1503('0x7'));var attributes=require(_0x1503('0x8'));module[_0x1503('0x9')]=function(_0x3b44d1,_0xaeae3){return _0x3b44d1[_0x1503('0xa')](_0x1503('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d71eb99..f626189 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b6=['request\x20sent','debug','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x22f54b,_0x4f2265){var _0xa7b5a4=function(_0x4333a2){while(--_0x4333a2){_0x22f54b['push'](_0x22f54b['shift']());}};_0xa7b5a4(++_0x4f2265);}(_0x76b6,0x172));var _0x676b=function(_0x562813,_0x24da27){_0x562813=_0x562813-0x0;var _0xe3d11c=_0x76b6[_0x562813];return _0xe3d11c;};'use strict';var _=require(_0x676b('0x0'));var util=require(_0x676b('0x1'));var moment=require(_0x676b('0x2'));var BPromise=require(_0x676b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x676b('0x4'));var db=require(_0x676b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x676b('0x6'))(_0x676b('0x7'));var config=require(_0x676b('0x8'));var jayson=require(_0x676b('0x9'));var client=jayson[_0x676b('0xa')][_0x676b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf2c6b7,_0x6ad979,_0x2c4db2){return new BPromise(function(_0x545aa2,_0x177636){return client[_0x676b('0xc')](_0xf2c6b7,_0x2c4db2)[_0x676b('0xd')](function(_0xd7ebff){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x6ad979,_0x676b('0xe'));logger[_0x676b('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x6ad979,_0x676b('0xe'),JSON[_0x676b('0x10')](_0xd7ebff));if(_0xd7ebff[_0x676b('0x11')]){if(_0xd7ebff['error'][_0x676b('0x12')]===0x1f4){logger['error'](_0x676b('0x13'),_0x6ad979,_0xd7ebff[_0x676b('0x11')]['message']);return _0x177636(_0xd7ebff[_0x676b('0x11')][_0x676b('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x6ad979,_0xd7ebff[_0x676b('0x11')][_0x676b('0x14')]);return _0x545aa2(_0xd7ebff['error'][_0x676b('0x14')]);}else{logger[_0x676b('0x15')](_0x676b('0x13'),_0x6ad979,_0x676b('0xe'));_0x545aa2(_0xd7ebff[_0x676b('0x16')]['message']);}})[_0x676b('0x17')](function(_0x26442c){logger[_0x676b('0x11')](_0x676b('0x13'),_0x6ad979,_0x26442c);_0x177636(_0x26442c);});});}
\ No newline at end of file
+var _0xf2ef=['http','request','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticMetric,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x32b301,_0x380389){var _0xd0c417=function(_0xd9cde3){while(--_0xd9cde3){_0x32b301['push'](_0x32b301['shift']());}};_0xd0c417(++_0x380389);}(_0xf2ef,0x182));var _0xff2e=function(_0xa279ef,_0x472af6){_0xa279ef=_0xa279ef-0x0;var _0x383bf1=_0xf2ef[_0xa279ef];return _0x383bf1;};'use strict';var _=require(_0xff2e('0x0'));var util=require(_0xff2e('0x1'));var moment=require(_0xff2e('0x2'));var BPromise=require(_0xff2e('0x3'));var rs=require(_0xff2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xff2e('0x5'))['db'];var utils=require(_0xff2e('0x6'));var logger=require(_0xff2e('0x7'))(_0xff2e('0x8'));var config=require('../../config/environment');var jayson=require(_0xff2e('0x9'));var client=jayson['client'][_0xff2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8bec70,_0x5c0cf0,_0x159585){return new BPromise(function(_0x25fbd8,_0x1689ca){return client[_0xff2e('0xb')](_0x8bec70,_0x159585)['then'](function(_0x4ea0f7){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,'request\x20sent');logger[_0xff2e('0xc')](_0xff2e('0xd'),_0x5c0cf0,_0xff2e('0xe'),JSON[_0xff2e('0xf')](_0x4ea0f7));if(_0x4ea0f7[_0xff2e('0x10')]){if(_0x4ea0f7[_0xff2e('0x10')]['code']===0x1f4){logger[_0xff2e('0x10')](_0xff2e('0x11'),_0x5c0cf0,_0x4ea0f7[_0xff2e('0x10')][_0xff2e('0x12')]);return _0x1689ca(_0x4ea0f7[_0xff2e('0x10')][_0xff2e('0x12')]);}logger[_0xff2e('0x10')](_0xff2e('0x11'),_0x5c0cf0,_0x4ea0f7['error'][_0xff2e('0x12')]);return _0x25fbd8(_0x4ea0f7[_0xff2e('0x10')]['message']);}else{logger[_0xff2e('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,'request\x20sent');_0x25fbd8(_0x4ea0f7[_0xff2e('0x14')][_0xff2e('0x12')]);}})[_0xff2e('0x15')](function(_0x314064){logger[_0xff2e('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x5c0cf0,_0x314064);_0x1689ca(_0x314064);});});}
\ No newline at end of file
index 10bbdea..420db19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa992=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','exports','multer','util','path'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa992,0x18c));var _0x2a99=function(_0x596b0f,_0x4cb5a3){_0x596b0f=_0x596b0f-0x0;var _0x4ea3c2=_0xa992[_0x596b0f];return _0x4ea3c2;};'use strict';var multer=require(_0x2a99('0x0'));var util=require(_0x2a99('0x1'));var path=require(_0x2a99('0x2'));var timeout=require(_0x2a99('0x3'));var express=require('express');var router=express[_0x2a99('0x4')]();var fs_extra=require(_0x2a99('0x5'));var auth=require(_0x2a99('0x6'));var interaction=require(_0x2a99('0x7'));var config=require(_0x2a99('0x8'));var controller=require(_0x2a99('0x9'));router[_0x2a99('0xa')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xc')]);router[_0x2a99('0xa')]('/:id',auth[_0x2a99('0xb')](),controller[_0x2a99('0xd')]);router[_0x2a99('0xe')]('/',auth[_0x2a99('0xb')](),controller[_0x2a99('0xf')]);router[_0x2a99('0x10')](_0x2a99('0x11'),auth[_0x2a99('0xb')](),controller[_0x2a99('0x12')]);router[_0x2a99('0x13')](_0x2a99('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x2a99('0x14')]=router;
\ No newline at end of file
+var _0xc73a=['./analyticMetric.controller','get','isAuthenticated','/:id','show','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4cd7f8,_0x1b9f91){var _0x179122=function(_0x1b2145){while(--_0x1b2145){_0x4cd7f8['push'](_0x4cd7f8['shift']());}};_0x179122(++_0x1b9f91);}(_0xc73a,0x72));var _0xac73=function(_0x8566eb,_0x2e8dc6){_0x8566eb=_0x8566eb-0x0;var _0x4fd545=_0xc73a[_0x8566eb];return _0x4fd545;};'use strict';var multer=require('multer');var util=require(_0xac73('0x0'));var path=require(_0xac73('0x1'));var timeout=require(_0xac73('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xac73('0x3'));var auth=require(_0xac73('0x4'));var interaction=require(_0xac73('0x5'));var config=require('../../config/environment');var controller=require(_0xac73('0x6'));router[_0xac73('0x7')]('/',auth[_0xac73('0x8')](),controller['index']);router[_0xac73('0x7')](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xa')]);router['post']('/',auth[_0xac73('0x8')](),controller['create']);router['put'](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xb')]);router[_0xac73('0xc')](_0xac73('0x9'),auth[_0xac73('0x8')](),controller[_0xac73('0xd')]);module[_0xac73('0xe')]=router;
\ No newline at end of file
index 6b551da..524cdc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4148=['TEXT'];(function(_0x578862,_0x51e17f){var _0x19c7e9=function(_0xdd1ed6){while(--_0xdd1ed6){_0x578862['push'](_0x578862['shift']());}};_0x19c7e9(++_0x51e17f);}(_0x4148,0xb8));var _0x8414=function(_0x6f5598,_0xabeb74){_0x6f5598=_0x6f5598-0x0;var _0x1e1325=_0x4148[_0x6f5598];return _0x1e1325;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0x8414('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0xbaef=['TEXT','sequelize','exports'];(function(_0xc66e23,_0x3e0786){var _0x4c46fd=function(_0x4e4caf){while(--_0x4e4caf){_0xc66e23['push'](_0xc66e23['shift']());}};_0x4c46fd(++_0x3e0786);}(_0xbaef,0x1db));var _0xfbae=function(_0x32de41,_0x191241){_0x32de41=_0x32de41-0x0;var _0x5b33ec=_0xbaef[_0x32de41];return _0x5b33ec;};'use strict';var Sequelize=require(_0xfbae('0x0'));module[_0xfbae('0x1')]={'tree':{'type':Sequelize[_0xfbae('0x2')],'allowNull':![]}};
\ No newline at end of file
index 270e49a..9826900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd30=['count','set','apply','update','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x3ad12c,_0x2527c0){var _0x4dda5c=function(_0x1a1a94){while(--_0x1a1a94){_0x3ad12c['push'](_0x3ad12c['shift']());}};_0x4dda5c(++_0x2527c0);}(_0xbd30,0xc5));var _0x0bd3=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xbd30[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0bd3('0x0'));var zipdir=require(_0x0bd3('0x1'));var jsonpatch=require(_0x0bd3('0x2'));var rp=require('request-promise');var moment=require(_0x0bd3('0x3'));var BPromise=require(_0x0bd3('0x4'));var Mustache=require(_0x0bd3('0x5'));var util=require(_0x0bd3('0x6'));var path=require(_0x0bd3('0x7'));var sox=require(_0x0bd3('0x8'));var csv=require(_0x0bd3('0x9'));var ejs=require(_0x0bd3('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd3('0xb'));var _=require(_0x0bd3('0xc'));var squel=require(_0x0bd3('0xd'));var crypto=require('crypto');var jsforce=require(_0x0bd3('0xe'));var deskjs=require(_0x0bd3('0xf'));var toCsv=require(_0x0bd3('0x9'));var querystring=require(_0x0bd3('0x10'));var Papa=require(_0x0bd3('0x11'));var Redis=require(_0x0bd3('0x12'));var authService=require(_0x0bd3('0x13'));var qs=require(_0x0bd3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0bd3('0x15'));var logger=require(_0x0bd3('0x16'))(_0x0bd3('0x17'));var utils=require(_0x0bd3('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x0bd3('0x19'));var db=require(_0x0bd3('0x1a'))['db'];function respondWithStatusCode(_0x1c5194,_0x22736d){_0x22736d=_0x22736d||0xcc;return function(_0x4ade39){if(_0x4ade39){return _0x1c5194[_0x0bd3('0x1b')](_0x22736d);}return _0x1c5194[_0x0bd3('0x1c')](_0x22736d)[_0x0bd3('0x1d')]();};}function respondWithResult(_0x10aaee,_0x1d3ea1){_0x1d3ea1=_0x1d3ea1||0xc8;return function(_0x225e87){if(_0x225e87){return _0x10aaee[_0x0bd3('0x1c')](_0x1d3ea1)[_0x0bd3('0x1e')](_0x225e87);}};}function respondWithFilteredResult(_0x3ede23,_0x14796a){return function(_0x5b207b){if(_0x5b207b){var _0x55e83f=typeof _0x14796a[_0x0bd3('0x1f')]===_0x0bd3('0x20')&&typeof _0x14796a[_0x0bd3('0x21')]===_0x0bd3('0x20');var _0x21400b=_0x5b207b[_0x0bd3('0x22')];var _0x2a5699=_0x55e83f?0x0:_0x14796a[_0x0bd3('0x1f')];var _0x38e269=_0x55e83f?_0x5b207b[_0x0bd3('0x22')]:_0x14796a[_0x0bd3('0x1f')]+_0x14796a[_0x0bd3('0x21')];var _0xd2f5fe;if(_0x38e269>=_0x21400b){_0x38e269=_0x21400b;_0xd2f5fe=0xc8;}else{_0xd2f5fe=0xce;}_0x3ede23[_0x0bd3('0x1c')](_0xd2f5fe);return _0x3ede23[_0x0bd3('0x23')]('Content-Range',_0x2a5699+'-'+_0x38e269+'/'+_0x21400b)[_0x0bd3('0x1e')](_0x5b207b);}return null;};}function patchUpdates(_0xb91ea1){return function(_0x46a846){try{jsonpatch[_0x0bd3('0x24')](_0x46a846,_0xb91ea1,!![]);}catch(_0x256b83){return BPromise['reject'](_0x256b83);}return _0x46a846['save']();};}function saveUpdates(_0x15fde3,_0xab7c45){return function(_0x2868c0){if(_0x2868c0){return _0x2868c0[_0x0bd3('0x25')](_0x15fde3)['then'](function(_0x121e10){return _0x121e10;});}return null;};}function removeEntity(_0x54ce57,_0x580a11){return function(_0x2fef65){if(_0x2fef65){return _0x2fef65[_0x0bd3('0x26')]()['then'](function(){_0x54ce57[_0x0bd3('0x1c')](0xcc)[_0x0bd3('0x1d')]();});}};}function handleEntityNotFound(_0x49940a,_0x4ca4c8){return function(_0x572334){if(!_0x572334){_0x49940a[_0x0bd3('0x1b')](0x194);}return _0x572334;};}function handleError(_0x53faf9,_0x288f35){_0x288f35=_0x288f35||0x1f4;return function(_0x39c308){logger[_0x0bd3('0x27')](_0x39c308['stack']);if(_0x39c308[_0x0bd3('0x28')]){delete _0x39c308[_0x0bd3('0x28')];}_0x53faf9['status'](_0x288f35)[_0x0bd3('0x29')](_0x39c308);};}exports[_0x0bd3('0x2a')]=function(_0xbec01b,_0x21ea6e){var _0x32ee16={},_0xbaf9ce={},_0x6bc2e5={'count':0x0,'rows':[]};var _0x26345f=_[_0x0bd3('0x2b')](db[_0x0bd3('0x2c')][_0x0bd3('0x2d')],function(_0x59ea57){return{'name':_0x59ea57[_0x0bd3('0x2e')],'type':_0x59ea57[_0x0bd3('0x2f')][_0x0bd3('0x30')]};});_0xbaf9ce[_0x0bd3('0x31')]=_['map'](_0x26345f,_0x0bd3('0x28'));_0xbaf9ce[_0x0bd3('0x32')]=_['keys'](_0xbec01b['query']);_0xbaf9ce[_0x0bd3('0x33')]=_[_0x0bd3('0x34')](_0xbaf9ce[_0x0bd3('0x31')],_0xbaf9ce[_0x0bd3('0x32')]);_0x32ee16[_0x0bd3('0x35')]=_[_0x0bd3('0x34')](_0xbaf9ce[_0x0bd3('0x31')],qs['fields'](_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x36')]));_0x32ee16[_0x0bd3('0x35')]=_0x32ee16[_0x0bd3('0x35')][_0x0bd3('0x37')]?_0x32ee16[_0x0bd3('0x35')]:_0xbaf9ce[_0x0bd3('0x31')];if(!_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x38')](_0x0bd3('0x39'))){_0x32ee16[_0x0bd3('0x21')]=qs[_0x0bd3('0x21')](_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x21')]);_0x32ee16[_0x0bd3('0x1f')]=qs['offset'](_0xbec01b['query']['offset']);}_0x32ee16[_0x0bd3('0x3a')]=qs[_0x0bd3('0x3b')](_0xbec01b['query'][_0x0bd3('0x3b')]);_0x32ee16[_0x0bd3('0x3c')]=qs['filters'](_[_0x0bd3('0x3d')](_0xbec01b[_0x0bd3('0x32')],_0xbaf9ce[_0x0bd3('0x33')]),_0x26345f);if(_0xbec01b['query'][_0x0bd3('0x3e')]){_0x32ee16[_0x0bd3('0x3c')]=_[_0x0bd3('0x3f')](_0x32ee16['where'],{'$or':_[_0x0bd3('0x2b')](_0x26345f,function(_0x5200eb){if(_0x5200eb[_0x0bd3('0x2f')]!=='VIRTUAL'){var _0x39be57={};_0x39be57[_0x5200eb[_0x0bd3('0x28')]]={'$like':'%'+_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x3e')]+'%'};return _0x39be57;}})});}_0x32ee16=_['merge']({},_0x32ee16,_0xbec01b[_0x0bd3('0x40')]);var _0x3a471b={'where':_0x32ee16[_0x0bd3('0x3c')]};return db['AnalyticTreeReport']['count'](_0x3a471b)[_0x0bd3('0x41')](function(_0x2157ce){_0x6bc2e5[_0x0bd3('0x22')]=_0x2157ce;if(_0xbec01b[_0x0bd3('0x32')][_0x0bd3('0x42')]){_0x32ee16[_0x0bd3('0x43')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x0bd3('0x44')](_0x32ee16);})[_0x0bd3('0x41')](function(_0x595bfc){_0x6bc2e5[_0x0bd3('0x45')]=_0x595bfc;return _0x6bc2e5;})[_0x0bd3('0x41')](respondWithFilteredResult(_0x21ea6e,_0x32ee16))['catch'](handleError(_0x21ea6e,null));};exports[_0x0bd3('0x46')]=function(_0x4a7c0c,_0x5965e3){var _0x298250={'raw':!![],'where':{'id':_0x4a7c0c[_0x0bd3('0x47')]['id']}},_0x95b67d={};_0x95b67d['model']=_[_0x0bd3('0x48')](db['AnalyticTreeReport'][_0x0bd3('0x2d')]);_0x95b67d[_0x0bd3('0x32')]=_[_0x0bd3('0x48')](_0x4a7c0c[_0x0bd3('0x32')]);_0x95b67d[_0x0bd3('0x33')]=_['intersection'](_0x95b67d['model'],_0x95b67d['query']);_0x298250[_0x0bd3('0x35')]=_[_0x0bd3('0x34')](_0x95b67d[_0x0bd3('0x31')],qs[_0x0bd3('0x36')](_0x4a7c0c[_0x0bd3('0x32')]['fields']));_0x298250[_0x0bd3('0x35')]=_0x298250['attributes']['length']?_0x298250[_0x0bd3('0x35')]:_0x95b67d[_0x0bd3('0x31')];if(_0x4a7c0c[_0x0bd3('0x32')][_0x0bd3('0x42')]){_0x298250['include']=[{'all':!![]}];}_0x298250=_[_0x0bd3('0x3f')]({},_0x298250,_0x4a7c0c[_0x0bd3('0x40')]);return db[_0x0bd3('0x2c')][_0x0bd3('0x49')](_0x298250)[_0x0bd3('0x41')](handleEntityNotFound(_0x5965e3,null))['then'](respondWithResult(_0x5965e3,null))[_0x0bd3('0x4a')](handleError(_0x5965e3,null));};exports['create']=function(_0x57d096,_0x25cd86){return db[_0x0bd3('0x2c')][_0x0bd3('0x4b')](_0x57d096[_0x0bd3('0x4c')],{})[_0x0bd3('0x41')](respondWithResult(_0x25cd86,0xc9))[_0x0bd3('0x4a')](handleError(_0x25cd86,null));};exports[_0x0bd3('0x25')]=function(_0x5527ec,_0x2917c7){if(_0x5527ec['body']['id']){delete _0x5527ec[_0x0bd3('0x4c')]['id'];}return db[_0x0bd3('0x2c')][_0x0bd3('0x49')]({'where':{'id':_0x5527ec[_0x0bd3('0x47')]['id']}})[_0x0bd3('0x41')](handleEntityNotFound(_0x2917c7,null))['then'](saveUpdates(_0x5527ec['body'],null))[_0x0bd3('0x41')](respondWithResult(_0x2917c7,null))[_0x0bd3('0x4a')](handleError(_0x2917c7,null));};exports['destroy']=function(_0xf3672e,_0x3a37c9){return db[_0x0bd3('0x2c')][_0x0bd3('0x49')]({'where':{'id':_0xf3672e[_0x0bd3('0x47')]['id']}})[_0x0bd3('0x41')](handleEntityNotFound(_0x3a37c9,null))['then'](removeEntity(_0x3a37c9,null))[_0x0bd3('0x4a')](handleError(_0x3a37c9,null));};
\ No newline at end of file
+var _0xf213=['querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf213,0x86));var _0x3f21=function(_0x3a8747,_0x2be23d){_0x3a8747=_0x3a8747-0x0;var _0x3e80f5=_0xf213[_0x3a8747];return _0x3e80f5;};'use strict';var emlformat=require(_0x3f21('0x0'));var rimraf=require(_0x3f21('0x1'));var zipdir=require(_0x3f21('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f21('0x3'));var moment=require(_0x3f21('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f21('0x5'));var path=require(_0x3f21('0x6'));var sox=require(_0x3f21('0x7'));var csv=require(_0x3f21('0x8'));var ejs=require(_0x3f21('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3f21('0xa'));var squel=require(_0x3f21('0xb'));var crypto=require(_0x3f21('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3f21('0xd'));var toCsv=require(_0x3f21('0x8'));var querystring=require(_0x3f21('0xe'));var Papa=require(_0x3f21('0xf'));var Redis=require(_0x3f21('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f21('0x11'));var logger=require(_0x3f21('0x12'))('api');var utils=require(_0x3f21('0x13'));var config=require(_0x3f21('0x14'));var licenseUtil=require(_0x3f21('0x15'));var db=require(_0x3f21('0x16'))['db'];function respondWithStatusCode(_0x4920f4,_0x2a6b63){_0x2a6b63=_0x2a6b63||0xcc;return function(_0x29c4c8){if(_0x29c4c8){return _0x4920f4[_0x3f21('0x17')](_0x2a6b63);}return _0x4920f4[_0x3f21('0x18')](_0x2a6b63)[_0x3f21('0x19')]();};}function respondWithResult(_0x43a22d,_0x4236c3){_0x4236c3=_0x4236c3||0xc8;return function(_0x3b67ae){if(_0x3b67ae){return _0x43a22d[_0x3f21('0x18')](_0x4236c3)[_0x3f21('0x1a')](_0x3b67ae);}};}function respondWithFilteredResult(_0x72f347,_0x5c3fdb){return function(_0x459ac3){if(_0x459ac3){var _0x1fb411=typeof _0x5c3fdb['offset']===_0x3f21('0x1b')&&typeof _0x5c3fdb[_0x3f21('0x1c')]==='undefined';var _0x31cafd=_0x459ac3['count'];var _0x4e060c=_0x1fb411?0x0:_0x5c3fdb[_0x3f21('0x1d')];var _0x17e394=_0x1fb411?_0x459ac3[_0x3f21('0x1e')]:_0x5c3fdb[_0x3f21('0x1d')]+_0x5c3fdb[_0x3f21('0x1c')];var _0x360b40;if(_0x17e394>=_0x31cafd){_0x17e394=_0x31cafd;_0x360b40=0xc8;}else{_0x360b40=0xce;}_0x72f347[_0x3f21('0x18')](_0x360b40);return _0x72f347[_0x3f21('0x1f')]('Content-Range',_0x4e060c+'-'+_0x17e394+'/'+_0x31cafd)[_0x3f21('0x1a')](_0x459ac3);}return null;};}function patchUpdates(_0x54bd62){return function(_0x103fa3){try{jsonpatch[_0x3f21('0x20')](_0x103fa3,_0x54bd62,!![]);}catch(_0x5dc58f){return BPromise[_0x3f21('0x21')](_0x5dc58f);}return _0x103fa3[_0x3f21('0x22')]();};}function saveUpdates(_0x3b43bd,_0x102b80){return function(_0x12e0f1){if(_0x12e0f1){return _0x12e0f1[_0x3f21('0x23')](_0x3b43bd)[_0x3f21('0x24')](function(_0x221943){return _0x221943;});}return null;};}function removeEntity(_0x4a01d9,_0x129b6f){return function(_0x4d3f18){if(_0x4d3f18){return _0x4d3f18[_0x3f21('0x25')]()[_0x3f21('0x24')](function(){_0x4a01d9[_0x3f21('0x18')](0xcc)[_0x3f21('0x19')]();});}};}function handleEntityNotFound(_0x4c48ec,_0x4dc0e3){return function(_0x24686c){if(!_0x24686c){_0x4c48ec[_0x3f21('0x17')](0x194);}return _0x24686c;};}function handleError(_0x443f42,_0x24b218){_0x24b218=_0x24b218||0x1f4;return function(_0x1480b8){logger[_0x3f21('0x26')](_0x1480b8[_0x3f21('0x27')]);if(_0x1480b8['name']){delete _0x1480b8[_0x3f21('0x28')];}_0x443f42[_0x3f21('0x18')](_0x24b218)[_0x3f21('0x29')](_0x1480b8);};}exports[_0x3f21('0x2a')]=function(_0x43fb8f,_0x1a96ee){var _0x4b28d5={},_0x115e5f={},_0x5802cc={'count':0x0,'rows':[]};var _0x8fe49c=_[_0x3f21('0x2b')](db[_0x3f21('0x2c')][_0x3f21('0x2d')],function(_0x177a0e){return{'name':_0x177a0e[_0x3f21('0x2e')],'type':_0x177a0e[_0x3f21('0x2f')]['key']};});_0x115e5f[_0x3f21('0x30')]=_[_0x3f21('0x2b')](_0x8fe49c,_0x3f21('0x28'));_0x115e5f[_0x3f21('0x31')]=_[_0x3f21('0x32')](_0x43fb8f[_0x3f21('0x31')]);_0x115e5f[_0x3f21('0x33')]=_[_0x3f21('0x34')](_0x115e5f[_0x3f21('0x30')],_0x115e5f[_0x3f21('0x31')]);_0x4b28d5[_0x3f21('0x35')]=_[_0x3f21('0x34')](_0x115e5f[_0x3f21('0x30')],qs[_0x3f21('0x36')](_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x36')]));_0x4b28d5[_0x3f21('0x35')]=_0x4b28d5['attributes'][_0x3f21('0x37')]?_0x4b28d5['attributes']:_0x115e5f[_0x3f21('0x30')];if(!_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x38')]('nolimit')){_0x4b28d5[_0x3f21('0x1c')]=qs['limit'](_0x43fb8f['query'][_0x3f21('0x1c')]);_0x4b28d5[_0x3f21('0x1d')]=qs[_0x3f21('0x1d')](_0x43fb8f['query'][_0x3f21('0x1d')]);}_0x4b28d5[_0x3f21('0x39')]=qs[_0x3f21('0x3a')](_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x3a')]);_0x4b28d5[_0x3f21('0x3b')]=qs[_0x3f21('0x33')](_[_0x3f21('0x3c')](_0x43fb8f[_0x3f21('0x31')],_0x115e5f[_0x3f21('0x33')]),_0x8fe49c);if(_0x43fb8f[_0x3f21('0x31')]['filter']){_0x4b28d5['where']=_[_0x3f21('0x3d')](_0x4b28d5[_0x3f21('0x3b')],{'$or':_['map'](_0x8fe49c,function(_0x2b288a){if(_0x2b288a[_0x3f21('0x2f')]!==_0x3f21('0x3e')){var _0x2698b8={};_0x2698b8[_0x2b288a[_0x3f21('0x28')]]={'$like':'%'+_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x3f')]+'%'};return _0x2698b8;}})});}_0x4b28d5=_['merge']({},_0x4b28d5,_0x43fb8f[_0x3f21('0x40')]);var _0x5623dd={'where':_0x4b28d5[_0x3f21('0x3b')]};return db['AnalyticTreeReport'][_0x3f21('0x1e')](_0x5623dd)[_0x3f21('0x24')](function(_0x21ca4b){_0x5802cc[_0x3f21('0x1e')]=_0x21ca4b;if(_0x43fb8f[_0x3f21('0x31')][_0x3f21('0x41')]){_0x4b28d5[_0x3f21('0x42')]=[{'all':!![]}];}return db[_0x3f21('0x2c')][_0x3f21('0x43')](_0x4b28d5);})[_0x3f21('0x24')](function(_0x43cfb7){_0x5802cc[_0x3f21('0x44')]=_0x43cfb7;return _0x5802cc;})[_0x3f21('0x24')](respondWithFilteredResult(_0x1a96ee,_0x4b28d5))['catch'](handleError(_0x1a96ee,null));};exports['show']=function(_0x328cf8,_0x8b7f8b){var _0xa2f477={'raw':!![],'where':{'id':_0x328cf8[_0x3f21('0x45')]['id']}},_0x1dc75f={};_0x1dc75f[_0x3f21('0x30')]=_[_0x3f21('0x32')](db[_0x3f21('0x2c')]['rawAttributes']);_0x1dc75f['query']=_[_0x3f21('0x32')](_0x328cf8[_0x3f21('0x31')]);_0x1dc75f['filters']=_['intersection'](_0x1dc75f[_0x3f21('0x30')],_0x1dc75f[_0x3f21('0x31')]);_0xa2f477[_0x3f21('0x35')]=_[_0x3f21('0x34')](_0x1dc75f['model'],qs[_0x3f21('0x36')](_0x328cf8[_0x3f21('0x31')]['fields']));_0xa2f477[_0x3f21('0x35')]=_0xa2f477['attributes'][_0x3f21('0x37')]?_0xa2f477[_0x3f21('0x35')]:_0x1dc75f[_0x3f21('0x30')];if(_0x328cf8[_0x3f21('0x31')][_0x3f21('0x41')]){_0xa2f477[_0x3f21('0x42')]=[{'all':!![]}];}_0xa2f477=_['merge']({},_0xa2f477,_0x328cf8[_0x3f21('0x40')]);return db[_0x3f21('0x2c')]['find'](_0xa2f477)['then'](handleEntityNotFound(_0x8b7f8b,null))['then'](respondWithResult(_0x8b7f8b,null))[_0x3f21('0x46')](handleError(_0x8b7f8b,null));};exports[_0x3f21('0x47')]=function(_0x34069a,_0x255c94){return db[_0x3f21('0x2c')]['create'](_0x34069a[_0x3f21('0x48')],{})['then'](respondWithResult(_0x255c94,0xc9))[_0x3f21('0x46')](handleError(_0x255c94,null));};exports[_0x3f21('0x23')]=function(_0x1cbdf6,_0x4be1ba){if(_0x1cbdf6['body']['id']){delete _0x1cbdf6['body']['id'];}return db[_0x3f21('0x2c')][_0x3f21('0x49')]({'where':{'id':_0x1cbdf6[_0x3f21('0x45')]['id']}})[_0x3f21('0x24')](handleEntityNotFound(_0x4be1ba,null))['then'](saveUpdates(_0x1cbdf6['body'],null))['then'](respondWithResult(_0x4be1ba,null))['catch'](handleError(_0x4be1ba,null));};exports[_0x3f21('0x25')]=function(_0x3e95c0,_0x119439){return db['AnalyticTreeReport'][_0x3f21('0x49')]({'where':{'id':_0x3e95c0['params']['id']}})[_0x3f21('0x24')](handleEntityNotFound(_0x119439,null))[_0x3f21('0x24')](removeEntity(_0x119439,null))['catch'](handleError(_0x119439,null));};
\ No newline at end of file
index 8b71ca9..e4e10fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff4=['api','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger'];(function(_0x363ed1,_0x18d67){var _0x1b6df0=function(_0x1ca7c9){while(--_0x1ca7c9){_0x363ed1['push'](_0x363ed1['shift']());}};_0x1b6df0(++_0x18d67);}(_0x5ff4,0x1de));var _0x45ff=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5ff4[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0x45ff('0x0'));var logger=require(_0x45ff('0x1'))(_0x45ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x45ff('0x3'));var fs=require('fs');var path=require(_0x45ff('0x4'));var rimraf=require(_0x45ff('0x5'));var config=require(_0x45ff('0x6'));var attributes=require(_0x45ff('0x7'));module['exports']=function(_0x1f482f,_0x5493c0){return _0x1f482f[_0x45ff('0x8')](_0x45ff('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x39ed=['exports','AnalyticTreeReport','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x39ed,0x1c4));var _0xd39e=function(_0x5a2019,_0x22a3aa){_0x5a2019=_0x5a2019-0x0;var _0x537ef3=_0x39ed[_0x5a2019];return _0x537ef3;};'use strict';var _=require('lodash');var util=require(_0xd39e('0x0'));var logger=require(_0xd39e('0x1'))(_0xd39e('0x2'));var moment=require(_0xd39e('0x3'));var BPromise=require(_0xd39e('0x4'));var rp=require(_0xd39e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd39e('0x6'));var config=require(_0xd39e('0x7'));var attributes=require('./analyticTreeReport.attributes');module[_0xd39e('0x8')]=function(_0x3e59c3,_0x4efd25){return _0x3e59c3['define'](_0xd39e('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 109f66f..47e4e26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4f21cd,_0x30f06f){var _0x1af331=function(_0x51145e){while(--_0x51145e){_0x4f21cd['push'](_0x4f21cd['shift']());}};_0x1af331(++_0x30f06f);}(_0xadb5,0xad));var _0x5adb=function(_0x563658,_0x5512dc){_0x563658=_0x563658-0x0;var _0x384716=_0xadb5[_0x563658];return _0x384716;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x2244f5,_0xf5a038){var _0x3ee41c=function(_0xaecef4){while(--_0xaecef4){_0x2244f5['push'](_0x2244f5['shift']());}};_0x3ee41c(++_0xf5a038);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'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')]('AnalyticTreeReport,\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
index c2afefb..2415734 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0679=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','get','/:id','show','create','put','update','delete','exports','multer','util','path'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x0679,0x1c5));var _0x9067=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0679[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x9067('0x0'));var util=require(_0x9067('0x1'));var path=require(_0x9067('0x2'));var timeout=require(_0x9067('0x3'));var express=require('express');var router=express[_0x9067('0x4')]();var fs_extra=require(_0x9067('0x5'));var auth=require(_0x9067('0x6'));var interaction=require(_0x9067('0x7'));var config=require(_0x9067('0x8'));var controller=require(_0x9067('0x9'));router['get']('/',auth[_0x9067('0xa')](),controller['index']);router[_0x9067('0xb')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller[_0x9067('0xd')]);router['post']('/',auth[_0x9067('0xa')](),controller[_0x9067('0xe')]);router[_0x9067('0xf')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller[_0x9067('0x10')]);router[_0x9067('0x11')](_0x9067('0xc'),auth[_0x9067('0xa')](),controller['destroy']);module[_0x9067('0x12')]=router;
\ No newline at end of file
+var _0xcbc0=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/:id','post','create','put','isAuthenticated','delete','destroy','multer'];(function(_0x53abde,_0x4892be){var _0x4234a7=function(_0x4b4b8f){while(--_0x4b4b8f){_0x53abde['push'](_0x53abde['shift']());}};_0x4234a7(++_0x4892be);}(_0xcbc0,0x186));var _0x0cbc=function(_0x196910,_0x1a2f0d){_0x196910=_0x196910-0x0;var _0x2706f6=_0xcbc0[_0x196910];return _0x2706f6;};'use strict';var multer=require(_0x0cbc('0x0'));var util=require(_0x0cbc('0x1'));var path=require(_0x0cbc('0x2'));var timeout=require(_0x0cbc('0x3'));var express=require(_0x0cbc('0x4'));var router=express[_0x0cbc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0cbc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0cbc('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x0cbc('0x8')]('/',auth['isAuthenticated'](),controller[_0x0cbc('0x9')]);router[_0x0cbc('0x8')](_0x0cbc('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0cbc('0xb')]('/',auth['isAuthenticated'](),controller[_0x0cbc('0xc')]);router[_0x0cbc('0xd')](_0x0cbc('0xa'),auth[_0x0cbc('0xe')](),controller['update']);router[_0x0cbc('0xf')](_0x0cbc('0xa'),auth[_0x0cbc('0xe')](),controller[_0x0cbc('0x10')]);module['exports']=router;
\ No newline at end of file
index 9092db4..f5a1713 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0834=['STRING'];(function(_0x54ad80,_0x5192e1){var _0x2a1c47=function(_0x359bba){while(--_0x359bba){_0x54ad80['push'](_0x54ad80['shift']());}};_0x2a1c47(++_0x5192e1);}(_0x0834,0x18e));var _0x4083=function(_0x37bf46,_0xef491d){_0x37bf46=_0x37bf46-0x0;var _0x256dff=_0x0834[_0x37bf46];return _0x256dff;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4083('0x0')]},'basename':{'type':Sequelize[_0x4083('0x0')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd4b6=['STRING','sequelize','exports'];(function(_0x3c0ef6,_0x450944){var _0x5b363c=function(_0xa07dbc){while(--_0xa07dbc){_0x3c0ef6['push'](_0x3c0ef6['shift']());}};_0x5b363c(++_0x450944);}(_0xd4b6,0x13f));var _0x6d4b=function(_0x49f73d,_0x5cb41e){_0x49f73d=_0x49f73d-0x0;var _0x372d74=_0xd4b6[_0x49f73d];return _0x372d74;};'use strict';var Sequelize=require(_0x6d4b('0x0'));module[_0x6d4b('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x6d4b('0x2')]},'type':{'type':Sequelize[_0x6d4b('0x2')]}};
\ No newline at end of file
index 649df41..881981f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5242=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','Attachment','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','clone','params','get','omit','updatedAt','body','createdAt','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x1465e3,_0x536a46){var _0x3c136f=function(_0x2a36c8){while(--_0x2a36c8){_0x1465e3['push'](_0x1465e3['shift']());}};_0x3c136f(++_0x536a46);}(_0x5242,0xa4));var _0x2524=function(_0x57acea,_0x559f88){_0x57acea=_0x57acea-0x0;var _0x39a157=_0x5242[_0x57acea];return _0x39a157;};'use strict';var emlformat=require(_0x2524('0x0'));var rimraf=require(_0x2524('0x1'));var zipdir=require(_0x2524('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2524('0x3'));var moment=require('moment');var BPromise=require(_0x2524('0x4'));var Mustache=require(_0x2524('0x5'));var util=require('util');var path=require(_0x2524('0x6'));var sox=require(_0x2524('0x7'));var csv=require(_0x2524('0x8'));var ejs=require(_0x2524('0x9'));var fs=require('fs');var fs_extra=require(_0x2524('0xa'));var _=require(_0x2524('0xb'));var squel=require(_0x2524('0xc'));var crypto=require(_0x2524('0xd'));var jsforce=require(_0x2524('0xe'));var deskjs=require(_0x2524('0xf'));var toCsv=require(_0x2524('0x8'));var querystring=require(_0x2524('0x10'));var Papa=require(_0x2524('0x11'));var Redis=require('ioredis');var authService=require(_0x2524('0x12'));var qs=require(_0x2524('0x13'));var as=require(_0x2524('0x14'));var hardwareService=require(_0x2524('0x15'));var logger=require(_0x2524('0x16'))('api');var utils=require(_0x2524('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2524('0x18'));var db=require(_0x2524('0x19'))['db'];function respondWithStatusCode(_0x217c2f,_0x525bfd){_0x525bfd=_0x525bfd||0xcc;return function(_0x55ae0a){if(_0x55ae0a){return _0x217c2f['sendStatus'](_0x525bfd);}return _0x217c2f[_0x2524('0x1a')](_0x525bfd)[_0x2524('0x1b')]();};}function respondWithResult(_0x4ec996,_0x4dfdd2){_0x4dfdd2=_0x4dfdd2||0xc8;return function(_0x413a48){if(_0x413a48){return _0x4ec996['status'](_0x4dfdd2)[_0x2524('0x1c')](_0x413a48);}};}function respondWithFilteredResult(_0x4862fc,_0x5d5eb2){return function(_0x43fe24){if(_0x43fe24){var _0x3beb02=typeof _0x5d5eb2[_0x2524('0x1d')]===_0x2524('0x1e')&&typeof _0x5d5eb2[_0x2524('0x1f')]==='undefined';var _0xc365bb=_0x43fe24['count'];var _0x4a32be=_0x3beb02?0x0:_0x5d5eb2[_0x2524('0x1d')];var _0x1e46f6=_0x3beb02?_0x43fe24[_0x2524('0x20')]:_0x5d5eb2[_0x2524('0x1d')]+_0x5d5eb2[_0x2524('0x1f')];var _0x2b889c;if(_0x1e46f6>=_0xc365bb){_0x1e46f6=_0xc365bb;_0x2b889c=0xc8;}else{_0x2b889c=0xce;}_0x4862fc[_0x2524('0x1a')](_0x2b889c);return _0x4862fc[_0x2524('0x21')](_0x2524('0x22'),_0x4a32be+'-'+_0x1e46f6+'/'+_0xc365bb)[_0x2524('0x1c')](_0x43fe24);}return null;};}function patchUpdates(_0x30eb66){return function(_0x5cb952){try{jsonpatch[_0x2524('0x23')](_0x5cb952,_0x30eb66,!![]);}catch(_0x2d7c6e){return BPromise[_0x2524('0x24')](_0x2d7c6e);}return _0x5cb952[_0x2524('0x25')]();};}function saveUpdates(_0x50b051,_0x2cbcf6){return function(_0x6d7f9f){if(_0x6d7f9f){return _0x6d7f9f[_0x2524('0x26')](_0x50b051)[_0x2524('0x27')](function(_0x28ffe9){return _0x28ffe9;});}return null;};}function removeEntity(_0x35cb36,_0x2b6425){return function(_0x3f64b4){if(_0x3f64b4){return _0x3f64b4[_0x2524('0x28')]()[_0x2524('0x27')](function(){_0x35cb36[_0x2524('0x1a')](0xcc)[_0x2524('0x1b')]();});}};}function handleEntityNotFound(_0xfea3e0,_0x438c70){return function(_0x47fac3){if(!_0x47fac3){_0xfea3e0[_0x2524('0x29')](0x194);}return _0x47fac3;};}function handleError(_0x26286a,_0x4767bf){_0x4767bf=_0x4767bf||0x1f4;return function(_0x4d0443){logger['error'](_0x4d0443[_0x2524('0x2a')]);if(_0x4d0443[_0x2524('0x2b')]){delete _0x4d0443['name'];}_0x26286a[_0x2524('0x1a')](_0x4767bf)[_0x2524('0x2c')](_0x4d0443);};}exports[_0x2524('0x2d')]=function(_0x5ae69c,_0x10b73d){var _0x33b10d={},_0x297d7c={},_0x1bfb7a={'count':0x0,'rows':[]};var _0x397d87=_[_0x2524('0x2e')](db[_0x2524('0x2f')]['rawAttributes'],function(_0x1d9a39){return{'name':_0x1d9a39[_0x2524('0x30')],'type':_0x1d9a39[_0x2524('0x31')][_0x2524('0x32')]};});_0x297d7c[_0x2524('0x33')]=_[_0x2524('0x2e')](_0x397d87,_0x2524('0x2b'));_0x297d7c[_0x2524('0x34')]=_['keys'](_0x5ae69c[_0x2524('0x34')]);_0x297d7c[_0x2524('0x35')]=_[_0x2524('0x36')](_0x297d7c[_0x2524('0x33')],_0x297d7c[_0x2524('0x34')]);_0x33b10d[_0x2524('0x37')]=_['intersection'](_0x297d7c[_0x2524('0x33')],qs[_0x2524('0x38')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x38')]));_0x33b10d[_0x2524('0x37')]=_0x33b10d['attributes'][_0x2524('0x39')]?_0x33b10d[_0x2524('0x37')]:_0x297d7c[_0x2524('0x33')];if(!_0x5ae69c[_0x2524('0x34')][_0x2524('0x3a')](_0x2524('0x3b'))){_0x33b10d[_0x2524('0x1f')]=qs[_0x2524('0x1f')](_0x5ae69c[_0x2524('0x34')]['limit']);_0x33b10d[_0x2524('0x1d')]=qs[_0x2524('0x1d')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x1d')]);}_0x33b10d['order']=qs[_0x2524('0x3c')](_0x5ae69c[_0x2524('0x34')][_0x2524('0x3c')]);_0x33b10d[_0x2524('0x3d')]=qs['filters'](_[_0x2524('0x3e')](_0x5ae69c[_0x2524('0x34')],_0x297d7c[_0x2524('0x35')]),_0x397d87);if(_0x5ae69c['query'][_0x2524('0x3f')]){_0x33b10d[_0x2524('0x3d')]=_[_0x2524('0x40')](_0x33b10d[_0x2524('0x3d')],{'$or':_[_0x2524('0x2e')](_0x397d87,function(_0x5d14e1){if(_0x5d14e1[_0x2524('0x31')]!=='VIRTUAL'){var _0x3cccc1={};_0x3cccc1[_0x5d14e1[_0x2524('0x2b')]]={'$like':'%'+_0x5ae69c[_0x2524('0x34')][_0x2524('0x3f')]+'%'};return _0x3cccc1;}})});}_0x33b10d=_[_0x2524('0x40')]({},_0x33b10d,_0x5ae69c[_0x2524('0x41')]);var _0x1187ba={'where':_0x33b10d['where']};return db['Attachment'][_0x2524('0x20')](_0x1187ba)[_0x2524('0x27')](function(_0x5f0726){_0x1bfb7a[_0x2524('0x20')]=_0x5f0726;if(_0x5ae69c[_0x2524('0x34')][_0x2524('0x42')]){_0x33b10d[_0x2524('0x43')]=[{'all':!![]}];}return db[_0x2524('0x2f')][_0x2524('0x44')](_0x33b10d);})[_0x2524('0x27')](function(_0x2fd18f){_0x1bfb7a[_0x2524('0x45')]=_0x2fd18f;return _0x1bfb7a;})[_0x2524('0x27')](respondWithFilteredResult(_0x10b73d,_0x33b10d))[_0x2524('0x46')](handleError(_0x10b73d,null));};exports[_0x2524('0x47')]=function(_0x4bfb51,_0x16aeaf){var _0x2cc090={'raw':!![],'where':{'id':_0x4bfb51['params']['id']}},_0x1772a8={};_0x1772a8[_0x2524('0x33')]=_[_0x2524('0x48')](db[_0x2524('0x2f')][_0x2524('0x49')]);_0x1772a8['query']=_[_0x2524('0x48')](_0x4bfb51['query']);_0x1772a8[_0x2524('0x35')]=_['intersection'](_0x1772a8['model'],_0x1772a8['query']);_0x2cc090[_0x2524('0x37')]=_[_0x2524('0x36')](_0x1772a8[_0x2524('0x33')],qs['fields'](_0x4bfb51[_0x2524('0x34')][_0x2524('0x38')]));_0x2cc090[_0x2524('0x37')]=_0x2cc090[_0x2524('0x37')][_0x2524('0x39')]?_0x2cc090[_0x2524('0x37')]:_0x1772a8[_0x2524('0x33')];if(_0x4bfb51[_0x2524('0x34')]['includeAll']){_0x2cc090[_0x2524('0x43')]=[{'all':!![]}];}_0x2cc090=_[_0x2524('0x40')]({},_0x2cc090,_0x4bfb51[_0x2524('0x41')]);return db[_0x2524('0x2f')][_0x2524('0x4a')](_0x2cc090)[_0x2524('0x27')](handleEntityNotFound(_0x16aeaf,null))[_0x2524('0x27')](respondWithResult(_0x16aeaf,null))[_0x2524('0x46')](handleError(_0x16aeaf,null));};exports[_0x2524('0x4b')]=function(_0x5ee82b,_0x438d25){var _0x2d7abb={'where':{'id':_0x5ee82b[_0x2524('0x4c')]['id']}},_0x125004={};_0x125004[_0x2524('0x33')]=_[_0x2524('0x48')](db[_0x2524('0x2f')]['rawAttributes']);_0x2d7abb[_0x2524('0x37')]=_[_0x2524('0x36')](_0x125004[_0x2524('0x33')],qs[_0x2524('0x38')](_0x5ee82b[_0x2524('0x34')][_0x2524('0x38')]));_0x2d7abb[_0x2524('0x37')]=_0x2d7abb[_0x2524('0x37')][_0x2524('0x39')]?_0x2d7abb[_0x2524('0x37')]:_0x125004['model'];if(_0x5ee82b['query']['includeAll']){_0x2d7abb[_0x2524('0x43')]=[{'all':!![]}];}_0x2d7abb=_[_0x2524('0x40')]({},_0x2d7abb,_0x5ee82b[_0x2524('0x41')]);return db[_0x2524('0x2f')][_0x2524('0x4a')](_0x2d7abb)[_0x2524('0x27')](handleEntityNotFound(_0x438d25,null))[_0x2524('0x27')](function(_0xc17a8){if(_0xc17a8){var _0x482599=_0xc17a8[_0x2524('0x4d')]({'plain':!![]});_0x482599=qs[_0x2524('0x4e')](_0x482599,['id','createdAt',_0x2524('0x4f')]);_0x5ee82b[_0x2524('0x50')]=_[_0x2524('0x4e')](_0x5ee82b['body'],['id',_0x2524('0x51'),_0x2524('0x4f')]);return db[_0x2524('0x2f')][_0x2524('0x52')](_[_0x2524('0x40')](_0x482599,_0x5ee82b['body']),{'include':_0x5ee82b[_0x2524('0x34')][_0x2524('0x42')]?[{'all':!![]}]:undefined});}})[_0x2524('0x27')](respondWithResult(_0x438d25,0xc9))[_0x2524('0x46')](handleError(_0x438d25,null));};exports['update']=function(_0x54135c,_0x58d016){if(_0x54135c[_0x2524('0x50')]['id']){delete _0x54135c[_0x2524('0x50')]['id'];}return db[_0x2524('0x2f')]['find']({'where':{'id':_0x54135c[_0x2524('0x4c')]['id']}})[_0x2524('0x27')](handleEntityNotFound(_0x58d016,null))['then'](saveUpdates(_0x54135c[_0x2524('0x50')],null))[_0x2524('0x27')](respondWithResult(_0x58d016,null))[_0x2524('0x46')](handleError(_0x58d016,null));};exports[_0x2524('0x28')]=function(_0x1640d8,_0x2d2459){return db['Attachment'][_0x2524('0x4a')]({'where':{'id':_0x1640d8['params']['id']}})[_0x2524('0x27')](handleEntityNotFound(_0x2d2459,null))['then'](removeEntity(_0x2d2459,null))[_0x2524('0x46')](handleError(_0x2d2459,null));};exports[_0x2524('0x52')]=function(_0x66c076,_0x4b9743,_0xae325f){_0x66c076[_0x2524('0x50')][_0x2524('0x2b')]=_0x66c076[_0x2524('0x53')][_0x2524('0x54')];_0x66c076[_0x2524('0x50')]['basename']=_0x66c076[_0x2524('0x53')][_0x2524('0x55')];_0x66c076['body']['type']=_0x66c076[_0x2524('0x53')][_0x2524('0x56')];return db['Attachment'][_0x2524('0x52')](_0x66c076[_0x2524('0x50')])[_0x2524('0x27')](respondWithResult(_0x4b9743,0xc9))[_0x2524('0x46')](handleError(_0x4b9743,null));};exports[_0x2524('0x57')]=function(_0x1fc4e6,_0x5d7e6c,_0x4b8c57){return db[_0x2524('0x2f')][_0x2524('0x58')]({'where':{'id':_0x1fc4e6[_0x2524('0x4c')]['id']},'raw':!![]})[_0x2524('0x27')](handleEntityNotFound(_0x5d7e6c,null))[_0x2524('0x27')](function(_0x411136){if(_0x411136){var _0x2aa7cb=_0x411136[_0x2524('0x59')]!==null;var _0x4ec036=path[_0x2524('0x5a')](config[_0x2524('0x5b')],_0x2524('0x5c'));if(_0x2aa7cb){_0x4ec036=path['join'](_0x4ec036,_0x2524('0x5d'));}var _0x4446fa=path['join'](_0x4ec036,_0x411136[_0x2524('0x5e')]);return _0x5d7e6c[_0x2524('0x57')](_0x4446fa);}})[_0x2524('0x46')](handleError(_0x5d7e6c,null));};
\ No newline at end of file
+var _0xecae=['../../config/environment','../../config/license/util','../../mysqldb','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','Attachment','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','sort','where','pick','filter','merge','map','options','includeAll','catch','show','params','rawAttributes','include','clone','length','find','omit','createdAt','updatedAt','body','create','file','originalname','basename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x32432f,_0x4413c3){var _0x2ddffd=function(_0x46eabe){while(--_0x46eabe){_0x32432f['push'](_0x32432f['shift']());}};_0x2ddffd(++_0x4413c3);}(_0xecae,0xf0));var _0xeeca=function(_0x217e80,_0x1919e8){_0x217e80=_0x217e80-0x0;var _0x6af0c9=_0xecae[_0x217e80];return _0x6af0c9;};'use strict';var emlformat=require(_0xeeca('0x0'));var rimraf=require(_0xeeca('0x1'));var zipdir=require(_0xeeca('0x2'));var jsonpatch=require(_0xeeca('0x3'));var rp=require(_0xeeca('0x4'));var moment=require(_0xeeca('0x5'));var BPromise=require(_0xeeca('0x6'));var Mustache=require('mustache');var util=require(_0xeeca('0x7'));var path=require('path');var sox=require(_0xeeca('0x8'));var csv=require(_0xeeca('0x9'));var ejs=require(_0xeeca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeeca('0xb'));var squel=require(_0xeeca('0xc'));var crypto=require(_0xeeca('0xd'));var jsforce=require(_0xeeca('0xe'));var deskjs=require(_0xeeca('0xf'));var toCsv=require(_0xeeca('0x9'));var querystring=require('querystring');var Papa=require(_0xeeca('0x10'));var Redis=require(_0xeeca('0x11'));var authService=require(_0xeeca('0x12'));var qs=require(_0xeeca('0x13'));var as=require(_0xeeca('0x14'));var hardwareService=require(_0xeeca('0x15'));var logger=require(_0xeeca('0x16'))(_0xeeca('0x17'));var utils=require('../../config/utils');var config=require(_0xeeca('0x18'));var licenseUtil=require(_0xeeca('0x19'));var db=require(_0xeeca('0x1a'))['db'];function respondWithStatusCode(_0x5be891,_0x3388f0){_0x3388f0=_0x3388f0||0xcc;return function(_0x968d55){if(_0x968d55){return _0x5be891['sendStatus'](_0x3388f0);}return _0x5be891['status'](_0x3388f0)['end']();};}function respondWithResult(_0x326430,_0xa9c800){_0xa9c800=_0xa9c800||0xc8;return function(_0x4b0be7){if(_0x4b0be7){return _0x326430['status'](_0xa9c800)[_0xeeca('0x1b')](_0x4b0be7);}};}function respondWithFilteredResult(_0x474bca,_0x3e289b){return function(_0x58d272){if(_0x58d272){var _0x2ac57c=typeof _0x3e289b['offset']===_0xeeca('0x1c')&&typeof _0x3e289b[_0xeeca('0x1d')]==='undefined';var _0x3d33c2=_0x58d272[_0xeeca('0x1e')];var _0x3a2f06=_0x2ac57c?0x0:_0x3e289b[_0xeeca('0x1f')];var _0x5710a7=_0x2ac57c?_0x58d272[_0xeeca('0x1e')]:_0x3e289b[_0xeeca('0x1f')]+_0x3e289b['limit'];var _0x565d09;if(_0x5710a7>=_0x3d33c2){_0x5710a7=_0x3d33c2;_0x565d09=0xc8;}else{_0x565d09=0xce;}_0x474bca[_0xeeca('0x20')](_0x565d09);return _0x474bca[_0xeeca('0x21')](_0xeeca('0x22'),_0x3a2f06+'-'+_0x5710a7+'/'+_0x3d33c2)[_0xeeca('0x1b')](_0x58d272);}return null;};}function patchUpdates(_0x2aea61){return function(_0x5983fa){try{jsonpatch[_0xeeca('0x23')](_0x5983fa,_0x2aea61,!![]);}catch(_0x148ff1){return BPromise[_0xeeca('0x24')](_0x148ff1);}return _0x5983fa[_0xeeca('0x25')]();};}function saveUpdates(_0x51b873,_0x4e248d){return function(_0x2e1e4a){if(_0x2e1e4a){return _0x2e1e4a[_0xeeca('0x26')](_0x51b873)[_0xeeca('0x27')](function(_0x1b05e7){return _0x1b05e7;});}return null;};}function removeEntity(_0xb62c43,_0x756c0){return function(_0x531dfa){if(_0x531dfa){return _0x531dfa[_0xeeca('0x28')]()[_0xeeca('0x27')](function(){_0xb62c43[_0xeeca('0x20')](0xcc)[_0xeeca('0x29')]();});}};}function handleEntityNotFound(_0x43da57,_0x593547){return function(_0x5a1b04){if(!_0x5a1b04){_0x43da57['sendStatus'](0x194);}return _0x5a1b04;};}function handleError(_0x3f7918,_0xf86b0b){_0xf86b0b=_0xf86b0b||0x1f4;return function(_0x3428e9){logger[_0xeeca('0x2a')](_0x3428e9['stack']);if(_0x3428e9['name']){delete _0x3428e9[_0xeeca('0x2b')];}_0x3f7918[_0xeeca('0x20')](_0xf86b0b)[_0xeeca('0x2c')](_0x3428e9);};}exports[_0xeeca('0x2d')]=function(_0x14980c,_0x529923){var _0x2afc79={},_0x3fcf3c={},_0x4149c5={'count':0x0,'rows':[]};var _0x192920=_['map'](db[_0xeeca('0x2e')]['rawAttributes'],function(_0x68fc35){return{'name':_0x68fc35[_0xeeca('0x2f')],'type':_0x68fc35[_0xeeca('0x30')][_0xeeca('0x31')]};});_0x3fcf3c[_0xeeca('0x32')]=_['map'](_0x192920,_0xeeca('0x2b'));_0x3fcf3c[_0xeeca('0x33')]=_[_0xeeca('0x34')](_0x14980c[_0xeeca('0x33')]);_0x3fcf3c[_0xeeca('0x35')]=_['intersection'](_0x3fcf3c[_0xeeca('0x32')],_0x3fcf3c[_0xeeca('0x33')]);_0x2afc79[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x3fcf3c[_0xeeca('0x32')],qs[_0xeeca('0x38')](_0x14980c[_0xeeca('0x33')]['fields']));_0x2afc79[_0xeeca('0x36')]=_0x2afc79[_0xeeca('0x36')]['length']?_0x2afc79['attributes']:_0x3fcf3c[_0xeeca('0x32')];if(!_0x14980c[_0xeeca('0x33')][_0xeeca('0x39')]('nolimit')){_0x2afc79[_0xeeca('0x1d')]=qs[_0xeeca('0x1d')](_0x14980c[_0xeeca('0x33')][_0xeeca('0x1d')]);_0x2afc79[_0xeeca('0x1f')]=qs[_0xeeca('0x1f')](_0x14980c['query'][_0xeeca('0x1f')]);}_0x2afc79['order']=qs[_0xeeca('0x3a')](_0x14980c['query'][_0xeeca('0x3a')]);_0x2afc79[_0xeeca('0x3b')]=qs[_0xeeca('0x35')](_[_0xeeca('0x3c')](_0x14980c[_0xeeca('0x33')],_0x3fcf3c['filters']),_0x192920);if(_0x14980c[_0xeeca('0x33')][_0xeeca('0x3d')]){_0x2afc79[_0xeeca('0x3b')]=_[_0xeeca('0x3e')](_0x2afc79['where'],{'$or':_[_0xeeca('0x3f')](_0x192920,function(_0x233a32){if(_0x233a32['type']!=='VIRTUAL'){var _0x462580={};_0x462580[_0x233a32[_0xeeca('0x2b')]]={'$like':'%'+_0x14980c[_0xeeca('0x33')][_0xeeca('0x3d')]+'%'};return _0x462580;}})});}_0x2afc79=_['merge']({},_0x2afc79,_0x14980c[_0xeeca('0x40')]);var _0x545af3={'where':_0x2afc79[_0xeeca('0x3b')]};return db[_0xeeca('0x2e')][_0xeeca('0x1e')](_0x545af3)[_0xeeca('0x27')](function(_0x3247aa){_0x4149c5[_0xeeca('0x1e')]=_0x3247aa;if(_0x14980c['query'][_0xeeca('0x41')]){_0x2afc79['include']=[{'all':!![]}];}return db[_0xeeca('0x2e')]['findAll'](_0x2afc79);})[_0xeeca('0x27')](function(_0x2f9e02){_0x4149c5['rows']=_0x2f9e02;return _0x4149c5;})[_0xeeca('0x27')](respondWithFilteredResult(_0x529923,_0x2afc79))[_0xeeca('0x42')](handleError(_0x529923,null));};exports[_0xeeca('0x43')]=function(_0x3d59d9,_0x294210){var _0x8616b4={'raw':!![],'where':{'id':_0x3d59d9[_0xeeca('0x44')]['id']}},_0x4481ce={};_0x4481ce[_0xeeca('0x32')]=_[_0xeeca('0x34')](db[_0xeeca('0x2e')][_0xeeca('0x45')]);_0x4481ce['query']=_[_0xeeca('0x34')](_0x3d59d9[_0xeeca('0x33')]);_0x4481ce[_0xeeca('0x35')]=_['intersection'](_0x4481ce[_0xeeca('0x32')],_0x4481ce['query']);_0x8616b4[_0xeeca('0x36')]=_[_0xeeca('0x37')](_0x4481ce['model'],qs[_0xeeca('0x38')](_0x3d59d9[_0xeeca('0x33')][_0xeeca('0x38')]));_0x8616b4[_0xeeca('0x36')]=_0x8616b4['attributes']['length']?_0x8616b4[_0xeeca('0x36')]:_0x4481ce[_0xeeca('0x32')];if(_0x3d59d9[_0xeeca('0x33')][_0xeeca('0x41')]){_0x8616b4[_0xeeca('0x46')]=[{'all':!![]}];}_0x8616b4=_[_0xeeca('0x3e')]({},_0x8616b4,_0x3d59d9['options']);return db['Attachment']['find'](_0x8616b4)[_0xeeca('0x27')](handleEntityNotFound(_0x294210,null))['then'](respondWithResult(_0x294210,null))[_0xeeca('0x42')](handleError(_0x294210,null));};exports[_0xeeca('0x47')]=function(_0x42f985,_0x6ff743){var _0x52c956={'where':{'id':_0x42f985['params']['id']}},_0x479b37={};_0x479b37['model']=_['keys'](db[_0xeeca('0x2e')]['rawAttributes']);_0x52c956['attributes']=_[_0xeeca('0x37')](_0x479b37['model'],qs[_0xeeca('0x38')](_0x42f985[_0xeeca('0x33')][_0xeeca('0x38')]));_0x52c956['attributes']=_0x52c956[_0xeeca('0x36')][_0xeeca('0x48')]?_0x52c956[_0xeeca('0x36')]:_0x479b37[_0xeeca('0x32')];if(_0x42f985[_0xeeca('0x33')][_0xeeca('0x41')]){_0x52c956[_0xeeca('0x46')]=[{'all':!![]}];}_0x52c956=_['merge']({},_0x52c956,_0x42f985['options']);return db[_0xeeca('0x2e')][_0xeeca('0x49')](_0x52c956)[_0xeeca('0x27')](handleEntityNotFound(_0x6ff743,null))[_0xeeca('0x27')](function(_0x51594c){if(_0x51594c){var _0xfcedd1=_0x51594c['get']({'plain':!![]});_0xfcedd1=qs[_0xeeca('0x4a')](_0xfcedd1,['id',_0xeeca('0x4b'),_0xeeca('0x4c')]);_0x42f985[_0xeeca('0x4d')]=_[_0xeeca('0x4a')](_0x42f985[_0xeeca('0x4d')],['id',_0xeeca('0x4b'),_0xeeca('0x4c')]);return db[_0xeeca('0x2e')][_0xeeca('0x4e')](_[_0xeeca('0x3e')](_0xfcedd1,_0x42f985['body']),{'include':_0x42f985[_0xeeca('0x33')][_0xeeca('0x41')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x6ff743,0xc9))[_0xeeca('0x42')](handleError(_0x6ff743,null));};exports['update']=function(_0x1e728c,_0x1c8652){if(_0x1e728c[_0xeeca('0x4d')]['id']){delete _0x1e728c[_0xeeca('0x4d')]['id'];}return db[_0xeeca('0x2e')][_0xeeca('0x49')]({'where':{'id':_0x1e728c['params']['id']}})[_0xeeca('0x27')](handleEntityNotFound(_0x1c8652,null))[_0xeeca('0x27')](saveUpdates(_0x1e728c[_0xeeca('0x4d')],null))[_0xeeca('0x27')](respondWithResult(_0x1c8652,null))[_0xeeca('0x42')](handleError(_0x1c8652,null));};exports[_0xeeca('0x28')]=function(_0x228147,_0x464c16){return db[_0xeeca('0x2e')]['find']({'where':{'id':_0x228147['params']['id']}})[_0xeeca('0x27')](handleEntityNotFound(_0x464c16,null))[_0xeeca('0x27')](removeEntity(_0x464c16,null))[_0xeeca('0x42')](handleError(_0x464c16,null));};exports[_0xeeca('0x4e')]=function(_0x13d7a9,_0x42c802,_0x402860){_0x13d7a9[_0xeeca('0x4d')][_0xeeca('0x2b')]=_0x13d7a9[_0xeeca('0x4f')][_0xeeca('0x50')];_0x13d7a9[_0xeeca('0x4d')][_0xeeca('0x51')]=_0x13d7a9[_0xeeca('0x4f')]['filename'];_0x13d7a9['body'][_0xeeca('0x30')]=_0x13d7a9[_0xeeca('0x4f')][_0xeeca('0x52')];return db[_0xeeca('0x2e')]['create'](_0x13d7a9[_0xeeca('0x4d')])['then'](respondWithResult(_0x42c802,0xc9))[_0xeeca('0x42')](handleError(_0x42c802,null));};exports[_0xeeca('0x53')]=function(_0x452ca2,_0x592376,_0x2a46bc){return db[_0xeeca('0x2e')]['findOne']({'where':{'id':_0x452ca2[_0xeeca('0x44')]['id']},'raw':!![]})[_0xeeca('0x27')](handleEntityNotFound(_0x592376,null))[_0xeeca('0x27')](function(_0x430513){if(_0x430513){var _0x42b2d3=_0x430513[_0xeeca('0x54')]!==null;var _0x838d15=path['join'](config[_0xeeca('0x55')],_0xeeca('0x56'));if(_0x42b2d3){_0x838d15=path['join'](_0x838d15,'offline-chat/');}var _0xac84a9=path[_0xeeca('0x57')](_0x838d15,_0x430513['basename']);return _0x592376[_0xeeca('0x53')](_0xac84a9);}})[_0xeeca('0x42')](handleError(_0x592376,null));};
\ No newline at end of file
index 516c862..c0e1f8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8048=['Attachment','attachments','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x33c1cb,_0x165064){var _0x28fe90=function(_0x2d2442){while(--_0x2d2442){_0x33c1cb['push'](_0x33c1cb['shift']());}};_0x28fe90(++_0x165064);}(_0x8048,0x183));var _0x8804=function(_0x113bee,_0x1ded16){_0x113bee=_0x113bee-0x0;var _0x19875f=_0x8048[_0x113bee];return _0x19875f;};'use strict';var _=require('lodash');var util=require(_0x8804('0x0'));var logger=require(_0x8804('0x1'))('api');var moment=require(_0x8804('0x2'));var BPromise=require(_0x8804('0x3'));var rp=require(_0x8804('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8804('0x5'));var config=require(_0x8804('0x6'));var attributes=require(_0x8804('0x7'));module['exports']=function(_0x570780,_0x35825e){return _0x570780[_0x8804('0x8')](_0x8804('0x9'),attributes,{'tableName':_0x8804('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa39a=['exports','define','Attachment','attachments','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x1a7099,_0x58bb8d){var _0x7187fe=function(_0x20d33e){while(--_0x20d33e){_0x1a7099['push'](_0x1a7099['shift']());}};_0x7187fe(++_0x58bb8d);}(_0xa39a,0x108));var _0xaa39=function(_0x2b6e77,_0x569fe8){_0x2b6e77=_0x2b6e77-0x0;var _0x492041=_0xa39a[_0x2b6e77];return _0x492041;};'use strict';var _=require(_0xaa39('0x0'));var util=require('util');var logger=require(_0xaa39('0x1'))(_0xaa39('0x2'));var moment=require(_0xaa39('0x3'));var BPromise=require(_0xaa39('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa39('0x5'));var rimraf=require(_0xaa39('0x6'));var config=require(_0xaa39('0x7'));var attributes=require(_0xaa39('0x8'));module[_0xaa39('0x9')]=function(_0x2ab01b,_0x912512){return _0x2ab01b[_0xaa39('0xa')](_0xaa39('0xb'),attributes,{'tableName':_0xaa39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24b6fe2..2e38187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21a3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Attachment','create','body','options','raw','CreateAttachment','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21a3,0x66));var _0x321a=function(_0xa720e9,_0xf162db){_0xa720e9=_0xa720e9-0x0;var _0x902310=_0x21a3[_0xa720e9];return _0x902310;};'use strict';var _=require(_0x321a('0x0'));var util=require('util');var moment=require(_0x321a('0x1'));var BPromise=require(_0x321a('0x2'));var rs=require(_0x321a('0x3'));var fs=require('fs');var Redis=require(_0x321a('0x4'));var db=require(_0x321a('0x5'))['db'];var utils=require(_0x321a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x321a('0x7'));var jayson=require(_0x321a('0x8'));var client=jayson[_0x321a('0x9')][_0x321a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f3b81,_0x388901,_0x24a04c){return new BPromise(function(_0x10c1d3,_0xdfd6b8){return client[_0x321a('0xb')](_0x5f3b81,_0x24a04c)[_0x321a('0xc')](function(_0x2c52dc){logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,_0x321a('0xf'));logger[_0x321a('0x10')](_0x321a('0x11'),_0x388901,'request\x20sent',JSON[_0x321a('0x12')](_0x2c52dc));if(_0x2c52dc[_0x321a('0x13')]){if(_0x2c52dc['error']['code']===0x1f4){logger[_0x321a('0x13')]('Attachment,\x20%s,\x20%s',_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0xdfd6b8(_0x2c52dc['error']['message']);}logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);return _0x10c1d3(_0x2c52dc[_0x321a('0x13')][_0x321a('0x14')]);}else{logger[_0x321a('0xd')](_0x321a('0xe'),_0x388901,'request\x20sent');_0x10c1d3(_0x2c52dc[_0x321a('0x15')][_0x321a('0x14')]);}})['catch'](function(_0x45ceb2){logger[_0x321a('0x13')](_0x321a('0xe'),_0x388901,_0x45ceb2);_0xdfd6b8(_0x45ceb2);});});}exports['CreateAttachment']=function(_0x5b1810){var _0x464bd7=this;return new Promise(function(_0x35fd6f,_0x58595b){return db[_0x321a('0x16')][_0x321a('0x17')](_0x5b1810[_0x321a('0x18')],{'raw':_0x5b1810['options']?_0x5b1810[_0x321a('0x19')][_0x321a('0x1a')]===undefined?!![]:![]:!![]})[_0x321a('0xc')](function(_0x423cb8){logger[_0x321a('0xd')](_0x321a('0x1b'),_0x5b1810);logger[_0x321a('0x10')](_0x321a('0x1b'),_0x5b1810,JSON[_0x321a('0x12')](_0x423cb8));_0x35fd6f(_0x423cb8);})[_0x321a('0x1c')](function(_0x1b94a1){logger[_0x321a('0x13')]('CreateAttachment',_0x1b94a1[_0x321a('0x14')],_0x5b1810);_0x58595b(_0x464bd7[_0x321a('0x13')](0x1f4,_0x1b94a1[_0x321a('0x14')]));});});};
\ No newline at end of file
+var _0xa5ca=['rpc','../../config/environment','request','then','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','options','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x61ce2f,_0x569707){var _0x482d56=function(_0x348ca3){while(--_0x348ca3){_0x61ce2f['push'](_0x61ce2f['shift']());}};_0x482d56(++_0x569707);}(_0xa5ca,0xb1));var _0xaa5c=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0xa5ca[_0x154192];return _0x3c2792;};'use strict';var _=require(_0xaa5c('0x0'));var util=require(_0xaa5c('0x1'));var moment=require(_0xaa5c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa5c('0x3'));var db=require(_0xaa5c('0x4'))['db'];var utils=require(_0xaa5c('0x5'));var logger=require(_0xaa5c('0x6'))(_0xaa5c('0x7'));var config=require(_0xaa5c('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41b86b,_0x10bee5,_0x283bc5){return new BPromise(function(_0x5b39a7,_0x496243){return client[_0xaa5c('0x9')](_0x41b86b,_0x283bc5)[_0xaa5c('0xa')](function(_0x170d3b){logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));logger[_0xaa5c('0xd')](_0xaa5c('0xe'),_0x10bee5,_0xaa5c('0xc'),JSON[_0xaa5c('0xf')](_0x170d3b));if(_0x170d3b[_0xaa5c('0x10')]){if(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x11')]===0x1f4){logger[_0xaa5c('0x10')](_0xaa5c('0xb'),_0x10bee5,_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);return _0x496243(_0x170d3b['error'][_0xaa5c('0x12')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x170d3b['error'][_0xaa5c('0x12')]);return _0x5b39a7(_0x170d3b[_0xaa5c('0x10')][_0xaa5c('0x12')]);}else{logger['info'](_0xaa5c('0xb'),_0x10bee5,_0xaa5c('0xc'));_0x5b39a7(_0x170d3b[_0xaa5c('0x13')][_0xaa5c('0x12')]);}})[_0xaa5c('0x14')](function(_0x272d06){logger['error']('Attachment,\x20%s,\x20%s',_0x10bee5,_0x272d06);_0x496243(_0x272d06);});});}exports[_0xaa5c('0x15')]=function(_0x5ebbf0){var _0x43990d=this;return new Promise(function(_0xa016ba,_0x4f5038){return db['Attachment']['create'](_0x5ebbf0['body'],{'raw':_0x5ebbf0[_0xaa5c('0x16')]?_0x5ebbf0[_0xaa5c('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xaa5c('0xa')](function(_0x114363){logger['info']('CreateAttachment',_0x5ebbf0);logger[_0xaa5c('0xd')](_0xaa5c('0x15'),_0x5ebbf0,JSON[_0xaa5c('0xf')](_0x114363));_0xa016ba(_0x114363);})[_0xaa5c('0x14')](function(_0xa280bc){logger[_0xaa5c('0x10')]('CreateAttachment',_0xa280bc[_0xaa5c('0x12')],_0x5ebbf0);_0x4f5038(_0x43990d[_0xaa5c('0x10')](0x1f4,_0xa280bc['message']));});});};
\ No newline at end of file
index e5f174d..cf60ac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x4fc71e,_0x270fb3){_0x4fc71e=_0x4fc71e-0x0;var _0x30fa94=_0xdb28[_0x4fc71e];return _0x30fa94;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x44c8fa,_0x30a53d){var _0x2a60e4=function(_0x5424c6){while(--_0x5424c6){_0x44c8fa['push'](_0x44c8fa['shift']());}};_0x2a60e4(++_0x30a53d);}(_0xadb5,0xad));var _0x5adb=function(_0x13eaef,_0x42cc2d){_0x13eaef=_0x13eaef-0x0;var _0x2adf9b=_0xadb5[_0x13eaef];return _0x2adf9b;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
index 4e73a10..34468f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66c4=['../../mysqldb','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','disabled','blocked','blockedAt','online','admin','agent','then','blockDuration','add','minutes','getLicense','catch','send','message','login','ad-login','role','signToken','json','User','passport','passport-local','Strategy','bluebird','util'];(function(_0x5c2929,_0x1b8216){var _0x4c6dd8=function(_0x491589){while(--_0x491589){_0x5c2929['push'](_0x5c2929['shift']());}};_0x4c6dd8(++_0x1b8216);}(_0x66c4,0x1bd));var _0x466c=function(_0x3056d0,_0x3ce8a0){_0x3056d0=_0x3056d0-0x0;var _0x3e29d8=_0x66c4[_0x3056d0];return _0x3e29d8;};'use strict';var passport=require(_0x466c('0x0'));var LocalStrategy=require(_0x466c('0x1'))[_0x466c('0x2')];var moment=require('moment');var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x466c('0x3'));var util=require(_0x466c('0x4'));var db=require(_0x466c('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x466c('0x6'));var config=require(_0x466c('0x7'));var logger=require(_0x466c('0x8'))(_0x466c('0x9'));function isActiveDirectoryConfigured(_0x4e585d){var _0x120d03=![];if(typeof _0x4e585d['activedirectory']!=='undefined'){_0x120d03=_0x4e585d[_0x466c('0xa')][_0x466c('0xb')]&&_0x4e585d[_0x466c('0xa')][_0x466c('0xc')]&&_0x4e585d[_0x466c('0xa')][_0x466c('0xd')];}return _0x120d03;}function adAuthenticate(_0x5c7d46,_0x49f105,_0x21bae2){return new BPromise(function(_0x5e4cce,_0x46c906){try{var _0x15ccda=new ActiveDirectory(_0x5c7d46);_0x15ccda[_0x466c('0xe')](_0x49f105,_0x21bae2,function(_0x174b1d,_0x2cf159){if(_0x174b1d){logger[_0x466c('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x49f105,util['inspect'](_0x174b1d,{'showHidden':![],'depth':null}));_0x46c906('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x2cf159){logger[_0x466c('0xf')](_0x466c('0x10'),_0x49f105);_0x46c906(_0x466c('0x11'));}else{_0x5e4cce(_0x2cf159);}});}catch(_0x4b5e12){_0x46c906(_0x4b5e12);}});}function ActiveDirectoryAuthenticate(_0x141d25,_0x274887,_0x402505,_0x56beb4){var _0x5718cd,_0x6dd2f6;if(!isActiveDirectoryConfigured(config)){logger[_0x466c('0xf')](_0x466c('0x12'),_0x274887);return _0x56beb4(null,![],{'message':_0x466c('0x11')});}return db[_0x466c('0x13')]['findOne']({'where':{'id':0x1},'attributes':[_0x466c('0x14'),'blockDuration'],'raw':!![]})['then'](function(_0x1dffc0){_0x5718cd=_0x1dffc0;if(!_0x5718cd[_0x466c('0x14')]){logger['error'](_0x466c('0x15'),_0x274887);throw new Error(_0x466c('0x11'));}return _0x141d25['findOne']({'attributes':['id',_0x466c('0x16'),_0x466c('0x17'),_0x466c('0x18'),'role',_0x466c('0x19'),_0x466c('0x1a'),_0x466c('0x1b'),_0x466c('0x1c')],'where':{'name':_0x274887,'role':{'$or':[_0x466c('0x1d'),'user',_0x466c('0x1e')]},'adSsoEnabled':!![]}});})['then'](function(_0x1b0124){if(!_0x1b0124||_0x1b0124&&_0x1b0124[_0x466c('0x16')]!==_0x274887){throw new Error(_0x466c('0x11'));}_0x6dd2f6=_0x1b0124;var _0x1feb33=_0x6dd2f6[_0x466c('0x16')]+'@'+config[_0x466c('0xa')][_0x466c('0xd')];return adAuthenticate(config['activedirectory'],_0x1feb33,_0x402505);})[_0x466c('0x1f')](function(_0x2aadf5){if(_0x6dd2f6[_0x466c('0x19')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x5718cd[_0x466c('0x20')]>0x0){if(_0x6dd2f6[_0x466c('0x1a')]){if(moment(_0x6dd2f6[_0x466c('0x1b')])[_0x466c('0x21')](_0x5718cd[_0x466c('0x20')],_0x466c('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x6dd2f6,0x0,![],null)[_0x466c('0x1f')](function(){return utils[_0x466c('0x23')](_0x6dd2f6);})['then'](function(){return _0x56beb4(null,_0x6dd2f6);});}else{return utils[_0x466c('0x23')](_0x6dd2f6)['then'](function(){return _0x56beb4(null,_0x6dd2f6);});}}else{return utils['getLicense'](_0x6dd2f6)[_0x466c('0x1f')](function(){return _0x56beb4(null,_0x6dd2f6);});}})[_0x466c('0x24')](function(_0x552331){return _0x56beb4(null,![],_0x552331);});}function handleError(_0x552aa8,_0x11b4b1,_0x2b787a){return _0x552aa8['status'](_0x11b4b1||0x1f4)[_0x466c('0x25')]({'message':_0x2b787a?_0x2b787a[_0x466c('0x26')]||_0x2b787a:''});}exports[_0x466c('0x27')]=function(_0x5c28eb,_0x624516,_0x549ed4){passport[_0x466c('0xe')](_0x466c('0x28'),function(_0x1ad0eb,_0x4d360b,_0x2bbab7){var _0x224ec2=_0x1ad0eb||_0x2bbab7;if(_0x224ec2){return handleError(_0x624516,0x191,_0x224ec2);}if(!_0x4d360b){return handleError(_0x624516,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x589506={'payload':{'id':_0x4d360b['id'],'role':_0x4d360b[_0x466c('0x29')]},'options':{'expiresIn':0x15180}};return authService[_0x466c('0x2a')](_0x589506)['then'](function(_0x4b08ef){_0x624516[_0x466c('0x2b')]({'id':_0x4d360b['id'],'token':_0x4b08ef,'statusCall':'','isAlreadyLogged':_0x4d360b[_0x466c('0x1c')]});});}})(_0x5c28eb,_0x624516,_0x549ed4);};passport['use'](_0x466c('0x28'),new LocalStrategy({'usernameField':_0x466c('0x16'),'passwordField':_0x466c('0x17')},function(_0x277c1c,_0x5939f8,_0x5d68fa){return ActiveDirectoryAuthenticate(db[_0x466c('0x2c')],_0x277c1c,_0x5939f8,_0x5d68fa);}));
\ No newline at end of file
+var _0x6893=['adSsoEnabled','blockDuration','name','password','salt','role','blocked','online','admin','user','agent','disabled','blockedAt','add','clearBlockUser','then','getLicense','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Setting','findOne'];(function(_0x1e20ef,_0x145409){var _0x100270=function(_0x2dc2a4){while(--_0x2dc2a4){_0x1e20ef['push'](_0x1e20ef['shift']());}};_0x100270(++_0x145409);}(_0x6893,0x16a));var _0x3689=function(_0x296e0e,_0x342fa4){_0x296e0e=_0x296e0e-0x0;var _0x101c03=_0x6893[_0x296e0e];return _0x101c03;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x3689('0x0'))['Strategy'];var moment=require(_0x3689('0x1'));var ActiveDirectory=require(_0x3689('0x2'));var BPromise=require(_0x3689('0x3'));var util=require(_0x3689('0x4'));var db=require(_0x3689('0x5'))['db'];var authService=require(_0x3689('0x6'));var utils=require(_0x3689('0x7'));var config=require(_0x3689('0x8'));var logger=require(_0x3689('0x9'))(_0x3689('0xa'));function isActiveDirectoryConfigured(_0x14f5c1){var _0x5dda6a=![];if(typeof _0x14f5c1[_0x3689('0xb')]!==_0x3689('0xc')){_0x5dda6a=_0x14f5c1[_0x3689('0xb')]['baseDN']&&_0x14f5c1[_0x3689('0xb')][_0x3689('0xd')]&&_0x14f5c1[_0x3689('0xb')][_0x3689('0xe')];}return _0x5dda6a;}function adAuthenticate(_0x18d237,_0x2fcdbc,_0xc663ab){return new BPromise(function(_0x2c03e5,_0xf3c620){try{var _0x390abc=new ActiveDirectory(_0x18d237);_0x390abc[_0x3689('0xf')](_0x2fcdbc,_0xc663ab,function(_0x2508c5,_0x1476ec){if(_0x2508c5){logger[_0x3689('0x10')](_0x3689('0x11'),_0x2fcdbc,util['inspect'](_0x2508c5,{'showHidden':![],'depth':null}));_0xf3c620('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x1476ec){logger[_0x3689('0x10')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2fcdbc);_0xf3c620('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2c03e5(_0x1476ec);}});}catch(_0x1f0ab4){_0xf3c620(_0x1f0ab4);}});}function ActiveDirectoryAuthenticate(_0x31b215,_0x18e5dc,_0x5557cf,_0x249b28){var _0x448778,_0x50c70a;if(!isActiveDirectoryConfigured(config)){logger[_0x3689('0x10')](_0x3689('0x12'),_0x18e5dc);return _0x249b28(null,![],{'message':_0x3689('0x13')});}return db[_0x3689('0x14')][_0x3689('0x15')]({'where':{'id':0x1},'attributes':[_0x3689('0x16'),_0x3689('0x17')],'raw':!![]})['then'](function(_0x4d2f32){_0x448778=_0x4d2f32;if(!_0x448778[_0x3689('0x16')]){logger[_0x3689('0x10')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x18e5dc);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x31b215[_0x3689('0x15')]({'attributes':['id',_0x3689('0x18'),_0x3689('0x19'),_0x3689('0x1a'),_0x3689('0x1b'),'disabled',_0x3689('0x1c'),'blockedAt',_0x3689('0x1d')],'where':{'name':_0x18e5dc,'role':{'$or':[_0x3689('0x1e'),_0x3689('0x1f'),_0x3689('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x118fe5){if(!_0x118fe5||_0x118fe5&&_0x118fe5[_0x3689('0x18')]!==_0x18e5dc){throw new Error(_0x3689('0x13'));}_0x50c70a=_0x118fe5;var _0x1da3d7=_0x50c70a[_0x3689('0x18')]+'@'+config[_0x3689('0xb')][_0x3689('0xe')];return adAuthenticate(config['activedirectory'],_0x1da3d7,_0x5557cf);})['then'](function(_0x3a4ee6){if(_0x50c70a[_0x3689('0x21')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x448778[_0x3689('0x17')]>0x0){if(_0x50c70a[_0x3689('0x1c')]){if(moment(_0x50c70a[_0x3689('0x22')])[_0x3689('0x23')](_0x448778[_0x3689('0x17')],'minutes')>moment()){throw new Error(_0x3689('0x13'));}return utils[_0x3689('0x24')](_0x50c70a,0x0,![],null)[_0x3689('0x25')](function(){return utils[_0x3689('0x26')](_0x50c70a);})[_0x3689('0x25')](function(){return _0x249b28(null,_0x50c70a);});}else{return utils[_0x3689('0x26')](_0x50c70a)[_0x3689('0x25')](function(){return _0x249b28(null,_0x50c70a);});}}else{return utils['getLicense'](_0x50c70a)['then'](function(){return _0x249b28(null,_0x50c70a);});}})['catch'](function(_0x15ab58){return _0x249b28(null,![],_0x15ab58);});}function handleError(_0x429f1b,_0x863f0b,_0x3b8e9d){return _0x429f1b[_0x3689('0x27')](_0x863f0b||0x1f4)[_0x3689('0x28')]({'message':_0x3b8e9d?_0x3b8e9d['message']||_0x3b8e9d:''});}exports[_0x3689('0x29')]=function(_0x3b7c91,_0x11e6bc,_0x3cb987){passport[_0x3689('0xf')](_0x3689('0x2a'),function(_0x88282a,_0x192059,_0x24ed93){var _0x24dd33=_0x88282a||_0x24ed93;if(_0x24dd33){return handleError(_0x11e6bc,0x191,_0x24dd33);}if(!_0x192059){return handleError(_0x11e6bc,0x194,{'message':_0x3689('0x2b')});}else{var _0x1cac23={'payload':{'id':_0x192059['id'],'role':_0x192059[_0x3689('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x3689('0x2c')](_0x1cac23)[_0x3689('0x25')](function(_0x245cc5){_0x11e6bc[_0x3689('0x2d')]({'id':_0x192059['id'],'token':_0x245cc5,'statusCall':'','isAlreadyLogged':_0x192059['online']});});}})(_0x3b7c91,_0x11e6bc,_0x3cb987);};passport[_0x3689('0x2e')](_0x3689('0x2a'),new LocalStrategy({'usernameField':_0x3689('0x18'),'passwordField':_0x3689('0x19')},function(_0x4a20ed,_0xe7f87f,_0x4b02c4){return ActiveDirectoryAuthenticate(db[_0x3689('0x2f')],_0x4a20ed,_0xe7f87f,_0x4b02c4);}));
\ No newline at end of file
index 0a8cf08..f5febdf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe42a=['express','Router','./authActiveDirectory.controller','post','login'];(function(_0x3573fb,_0x158452){var _0x1eafb6=function(_0x2f75a8){while(--_0x2f75a8){_0x3573fb['push'](_0x3573fb['shift']());}};_0x1eafb6(++_0x158452);}(_0xe42a,0x91));var _0xae42=function(_0x3a1e8a,_0x5e08aa){_0x3a1e8a=_0x3a1e8a-0x0;var _0x56337e=_0xe42a[_0x3a1e8a];return _0x56337e;};'use strict';var express=require(_0xae42('0x0'));var router=express[_0xae42('0x1')]();var controller=require(_0xae42('0x2'));router[_0xae42('0x3')]('/',controller[_0xae42('0x4')]);module['exports']=router;
\ No newline at end of file
+var _0x51e5=['exports','express','Router','./authActiveDirectory.controller','post','login'];(function(_0x569b58,_0xc01048){var _0x40efd2=function(_0x2bf657){while(--_0x2bf657){_0x569b58['push'](_0x569b58['shift']());}};_0x40efd2(++_0xc01048);}(_0x51e5,0x1b7));var _0x551e=function(_0x2519c3,_0x533fe8){_0x2519c3=_0x2519c3-0x0;var _0x4eb73d=_0x51e5[_0x2519c3];return _0x4eb73d;};'use strict';var express=require(_0x551e('0x0'));var router=express[_0x551e('0x1')]();var controller=require(_0x551e('0x2'));router[_0x551e('0x3')]('/',controller[_0x551e('0x4')]);module[_0x551e('0x5')]=router;
\ No newline at end of file
index 1a4f25f..a8ca4a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x7a54,0x106));var _0x47a5=function(_0x237d0d,_0x412e3d){_0x237d0d=_0x237d0d-0x0;var _0x10d0e1=_0x7a54[_0x237d0d];return _0x10d0e1;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0xc0acde,_0x4df117){var _0x2d9a9d=function(_0xc8e4a7){while(--_0xc8e4a7){_0xc0acde['push'](_0xc0acde['shift']());}};_0x2d9a9d(++_0x4df117);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
index 9a23f00..6931c44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6959=['login','setTokenCookie','passport','Router','./authGoogle.controller','../../components/auth/service','get','isMiddleware'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x6959,0x9a));var _0x9695=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6959[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var passport=require(_0x9695('0x0'));var router=express[_0x9695('0x1')]();var controller=require(_0x9695('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x9695('0x3'));router[_0x9695('0x4')]('/',controller['login']);router[_0x9695('0x4')]('/callback',controller['callback'],authService[_0x9695('0x5')],userController[_0x9695('0x6')],authService[_0x9695('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x580f=['login','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js'];(function(_0x55c3fe,_0x58175c){var _0x26201d=function(_0x4d3e1a){while(--_0x4d3e1a){_0x55c3fe['push'](_0x55c3fe['shift']());}};_0x26201d(++_0x58175c);}(_0x580f,0x8c));var _0xf580=function(_0x353ca5,_0x13431f){_0x353ca5=_0x353ca5-0x0;var _0x1107a0=_0x580f[_0x353ca5];return _0x1107a0;};'use strict';var express=require('express');var passport=require(_0xf580('0x0'));var router=express[_0xf580('0x1')]();var controller=require(_0xf580('0x2'));var userController=require(_0xf580('0x3'));var authService=require('../../components/auth/service');router['get']('/',controller[_0xf580('0x4')]);router['get']('/callback',controller[_0xf580('0x5')],authService[_0xf580('0x6')],userController[_0xf580('0x4')],authService[_0xf580('0x7')]);module[_0xf580('0x8')]=router;
\ No newline at end of file
index f67840d..0b7e856 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b4=['passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','allowedLoginAttempts','then','findOne','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','getLicense','catch','MailAccount','name','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','request','SendMail','error','stringify','status','send','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','find','params','token','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','save','Password\x20reset!','util'];(function(_0x21786f,_0x5db1a2){var _0x1fc90a=function(_0x40197d){while(--_0x40197d){_0x21786f['push'](_0x21786f['shift']());}};_0x1fc90a(++_0x5db1a2);}(_0xd3b4,0x194));var _0x4d3b=function(_0x46f1c7,_0xf533eb){_0x46f1c7=_0x46f1c7-0x0;var _0x25edd9=_0xd3b4[_0x46f1c7];return _0x25edd9;};'use strict';var util=require(_0x4d3b('0x0'));var passport=require(_0x4d3b('0x1'));var LocalStrategy=require(_0x4d3b('0x2'))[_0x4d3b('0x3')];var jayson=require(_0x4d3b('0x4'));var _=require(_0x4d3b('0x5'));var rs=require(_0x4d3b('0x6'));var moment=require(_0x4d3b('0x7'));var db=require(_0x4d3b('0x8'))['db'];var authService=require(_0x4d3b('0x9'));var utils=require(_0x4d3b('0xa'));var client=jayson[_0x4d3b('0xb')]['http']({'port':0x232b});function localAuthenticate(_0x31cd0a,_0x5d5f02,_0x312424,_0x16ffb2){var _0x493be3,_0x2cc046;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x4d3b('0xc'),'blockDuration'],'raw':!![]})[_0x4d3b('0xd')](function(_0x5c1f92){_0x493be3=_0x5c1f92;return _0x31cd0a[_0x4d3b('0xe')]({'attributes':['id','name',_0x4d3b('0xf'),_0x4d3b('0x10'),_0x4d3b('0x11'),_0x4d3b('0x12'),_0x4d3b('0x13'),_0x4d3b('0x14'),_0x4d3b('0x15')],'where':{'name':_0x5d5f02,'role':{'$or':[_0x4d3b('0x16'),'user','agent']}}});})['then'](function(_0x407e4a){if(!_0x407e4a||_0x407e4a&&_0x407e4a['name']!==_0x5d5f02){throw new Error(_0x4d3b('0x17'));}else{_0x2cc046=_0x407e4a;return _0x2cc046;}})['then'](function(){_0x2cc046[_0x4d3b('0x18')](_0x312424,function(_0x1721ef,_0x1b7f1d){var _0x365813=_0x2cc046[_0x4d3b('0x15')]+0x1;if(_0x1721ef){return _0x16ffb2(_0x1721ef);}else if(!_0x1b7f1d){if(_0x2cc046[_0x4d3b('0x12')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else if(_0x493be3['allowedLoginAttempts']>0x0){if(_0x2cc046[_0x4d3b('0x13')]){if(_0x493be3[_0x4d3b('0x19')]>0x0){if(moment(_0x2cc046['blockedAt'])[_0x4d3b('0x1a')](_0x493be3['blockDuration'],'minutes')>moment()){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1b')](_0x2cc046,_0x365813,![],null)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});});}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{if(_0x365813>=_0x493be3[_0x4d3b('0xc')]){return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,!![],moment())[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x2cc046,_0x365813,![],null)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});});}}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{if(_0x2cc046[_0x4d3b('0x12')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else if(_0x493be3[_0x4d3b('0xc')]>0x0){if(_0x2cc046[_0x4d3b('0x13')]){if(_0x493be3['blockDuration']>0x0){if(moment(_0x2cc046[_0x4d3b('0x14')])['add'](_0x493be3[_0x4d3b('0x19')],'minutes')>moment()){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,![],null)[_0x4d3b('0xd')](function(){return utils['getLicense'](_0x2cc046);})[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);});}}else{return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}}else{return utils[_0x4d3b('0x1b')](_0x2cc046,0x0,![],null)[_0x4d3b('0xd')](function(){return utils[_0x4d3b('0x1c')](_0x2cc046);})[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);})['catch'](function(_0x4c4a4f){return _0x16ffb2(null,![],_0x4c4a4f);});}}else{if(_0x2cc046[_0x4d3b('0x13')]){return _0x16ffb2(null,![],{'message':_0x4d3b('0x17')});}else{return utils[_0x4d3b('0x1c')](_0x2cc046)[_0x4d3b('0xd')](function(){return _0x16ffb2(null,_0x2cc046);});}}}});})[_0x4d3b('0x1d')](function(_0x1d65c3){return _0x16ffb2(null,![],_0x1d65c3);});}function sendServiceMail(_0x412816){return db[_0x4d3b('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x4d3b('0x1f'),_0x4d3b('0x20')],'include':[{'model':db[_0x4d3b('0x21')],'as':_0x4d3b('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x4d3b('0x23')}]}]})[_0x4d3b('0xd')](function(_0x526f7a){if(!_0x526f7a){throw new Error(_0x4d3b('0x24'));}var _0x577138=_0x526f7a['getSmtpOptions']();var _0x4b5972={'account':_0x577138,'message':_[_0x4d3b('0x25')]({'from':util[_0x4d3b('0x26')]('\x22%s\x22\x20<%s>',_0x526f7a[_0x4d3b('0x1f')],_0x526f7a[_0x4d3b('0x20')]||_0x526f7a['Smtp']['user'])},_0x412816)};return client[_0x4d3b('0x27')](_0x4d3b('0x28'),_0x4b5972);})[_0x4d3b('0xd')](function(_0x4eb2a0){if(_0x4eb2a0['error']){throw new Error(util[_0x4d3b('0x26')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x4eb2a0[_0x4d3b('0x29')]['message']||JSON[_0x4d3b('0x2a')](_0x4eb2a0[_0x4d3b('0x29')])));}return!![];});}function handleError(_0x3cc884,_0xec7862,_0x30166b){return _0x3cc884[_0x4d3b('0x2b')](_0xec7862||0x1f4)[_0x4d3b('0x2c')]({'message':_0x30166b?_0x30166b[_0x4d3b('0x2d')]||_0x30166b:''});}exports[_0x4d3b('0x2e')]=function(_0x186891,_0x4ef04f,_0x5b0fec){passport[_0x4d3b('0x18')](_0x4d3b('0x2f'),function(_0x266a1f,_0x1aa0f4,_0x5565b4){var _0x58a26b=_0x266a1f||_0x5565b4;if(_0x58a26b){return handleError(_0x4ef04f,0x191,_0x58a26b);}if(!_0x1aa0f4){return handleError(_0x4ef04f,0x194,{'message':_0x4d3b('0x30')});}else{var _0x114abd={'payload':{'id':_0x1aa0f4['id'],'role':_0x1aa0f4[_0x4d3b('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x4d3b('0x31')](_0x114abd)[_0x4d3b('0xd')](function(_0x3f4426){_0x4ef04f[_0x4d3b('0x32')]({'id':_0x1aa0f4['id'],'token':_0x3f4426,'statusCall':'','isAlreadyLogged':_0x1aa0f4['online']});});}})(_0x186891,_0x4ef04f,_0x5b0fec);};exports[_0x4d3b('0x33')]=function(_0x25bccf,_0x376521){if(!_0x25bccf['body'][_0x4d3b('0x20')]){return handleError(_0x376521,0x1f4,{'message':_0x4d3b('0x34')});}var _0x15014a=rs[_0x4d3b('0x35')]();_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')]=_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')][_0x4d3b('0x37')]()[_0x4d3b('0x38')]();var _0xe5c965;return db[_0x4d3b('0x39')][_0x4d3b('0xe')]({'where':{'id':0x1},'attributes':[_0x4d3b('0xc'),_0x4d3b('0x19')],'raw':!![]})[_0x4d3b('0xd')](function(_0x35af38){_0xe5c965=_0x35af38;return db[_0x4d3b('0x3a')]['find']({'where':{'email':_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')]}});})[_0x4d3b('0xd')](function(_0x157d15){if(!_0x157d15){throw new Error(_0x4d3b('0x3b'));}if(_0x157d15['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x157d15[_0x4d3b('0x13')]){if(moment(_0x157d15[_0x4d3b('0x14')])[_0x4d3b('0x1a')](_0xe5c965[_0x4d3b('0x19')],_0x4d3b('0x3c'))>moment()){throw new Error(_0x4d3b('0x3d'));}else{_0x157d15[_0x4d3b('0x13')]=![];_0x157d15[_0x4d3b('0x14')]=null;}}_0x157d15[_0x4d3b('0x3e')]=_0x15014a;_0x157d15['resetPasswordExpires']=Date[_0x4d3b('0x3f')]()+0x36ee80;return _0x157d15['save']();})[_0x4d3b('0xd')](function(){return sendServiceMail({'to':_0x25bccf[_0x4d3b('0x36')][_0x4d3b('0x20')],'subject':_0x4d3b('0x40'),'text':'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'+_0x4d3b('0x41')+_0x25bccf[_0x4d3b('0x42')][_0x4d3b('0x43')]+_0x4d3b('0x44')+_0x15014a+'\x0a\x0a'+_0x4d3b('0x45')});})[_0x4d3b('0xd')](function(){_0x376521[_0x4d3b('0x2b')](0xc8)[_0x4d3b('0x2c')]({'message':_0x4d3b('0x46')});})[_0x4d3b('0x1d')](function(_0x2dd06e){return handleError(_0x376521,0x1f4,_0x2dd06e);});};exports['reset']=function(_0x29d285,_0x23c7b2){return db[_0x4d3b('0x3a')][_0x4d3b('0x47')]({'where':{'resetPasswordToken':_0x29d285[_0x4d3b('0x48')][_0x4d3b('0x49')],'resetPasswordExpires':{'$gt':Date[_0x4d3b('0x3f')]()}}})[_0x4d3b('0xd')](function(_0x5174f8){if(!_0x5174f8){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x4d3b('0x39')][_0x4d3b('0xe')]({'attributes':['id',_0x4d3b('0x4a'),_0x4d3b('0x4b'),'passwordHistoryLimit']})['then'](function(_0x2d9ee4){if(_0x2d9ee4[_0x4d3b('0x4a')])authService['validatePasswordPattern'](_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')]);if(!_0x2d9ee4[_0x4d3b('0x4b')]||!_0x5174f8[_0x4d3b('0x4c')])return _0x5174f8;authService[_0x4d3b('0x4d')](_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')],_0x5174f8['previousPasswords'],_0x2d9ee4[_0x4d3b('0x4e')]);return _0x5174f8;})[_0x4d3b('0xd')](function(){_0x5174f8[_0x4d3b('0xf')]=_0x29d285[_0x4d3b('0x36')][_0x4d3b('0xf')];_0x5174f8['resetPasswordToken']=null;_0x5174f8['resetPasswordExpires']=null;return _0x5174f8[_0x4d3b('0x4f')]();});})[_0x4d3b('0xd')](function(){_0x23c7b2['status'](0xc8)['send']({'message':_0x4d3b('0x50')});})[_0x4d3b('0x1d')](function(_0x1e2c6e){return handleError(_0x23c7b2,0x1f4,_0x1e2c6e);});};passport['use'](_0x4d3b('0x2f'),new LocalStrategy({'usernameField':'name','passwordField':_0x4d3b('0xf')},function(_0xa4bdcf,_0x514995,_0x2649de){return localAuthenticate(db[_0x4d3b('0x3a')],_0xa4bdcf,_0x514995,_0x2649de);}));
\ No newline at end of file
+var _0xf16f=['headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','blockDuration','then','name','password','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','add','clearBlockUser','minutes','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','email','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','authenticate','local-login','signToken','forgot','body','generate','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://'];(function(_0x8c89bd,_0x4d9989){var _0x2d0a25=function(_0x332d6c){while(--_0x332d6c){_0x8c89bd['push'](_0x8c89bd['shift']());}};_0x2d0a25(++_0x4d9989);}(_0xf16f,0x1ab));var _0xff16=function(_0x86c056,_0x3ed77c){_0x86c056=_0x86c056-0x0;var _0xd6192e=_0xf16f[_0x86c056];return _0xd6192e;};'use strict';var util=require(_0xff16('0x0'));var passport=require(_0xff16('0x1'));var LocalStrategy=require(_0xff16('0x2'))[_0xff16('0x3')];var jayson=require(_0xff16('0x4'));var _=require(_0xff16('0x5'));var rs=require('randomstring');var moment=require(_0xff16('0x6'));var db=require(_0xff16('0x7'))['db'];var authService=require(_0xff16('0x8'));var utils=require(_0xff16('0x9'));var client=jayson['client'][_0xff16('0xa')]({'port':0x232b});function localAuthenticate(_0x4d9d43,_0x1c7e57,_0x34e42a,_0x3f8f47){var _0x3d04ef,_0x12c197;return db['Setting'][_0xff16('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xff16('0xc')],'raw':!![]})[_0xff16('0xd')](function(_0x110794){_0x3d04ef=_0x110794;return _0x4d9d43[_0xff16('0xb')]({'attributes':['id',_0xff16('0xe'),_0xff16('0xf'),'salt',_0xff16('0x10'),_0xff16('0x11'),_0xff16('0x12'),_0xff16('0x13'),_0xff16('0x14')],'where':{'name':_0x1c7e57,'role':{'$or':[_0xff16('0x15'),_0xff16('0x16'),_0xff16('0x17')]}}});})[_0xff16('0xd')](function(_0x1d2f53){if(!_0x1d2f53||_0x1d2f53&&_0x1d2f53['name']!==_0x1c7e57){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x12c197=_0x1d2f53;return _0x12c197;}})[_0xff16('0xd')](function(){_0x12c197['authenticate'](_0x34e42a,function(_0x2228fe,_0x257fd3){var _0x1acf9a=_0x12c197[_0xff16('0x14')]+0x1;if(_0x2228fe){return _0x3f8f47(_0x2228fe);}else if(!_0x257fd3){if(_0x12c197[_0xff16('0x11')]){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else if(_0x3d04ef[_0xff16('0x19')]>0x0){if(_0x12c197['blocked']){if(_0x3d04ef[_0xff16('0xc')]>0x0){if(moment(_0x12c197['blockedAt'])[_0xff16('0x1a')](_0x3d04ef[_0xff16('0xc')],'minutes')>moment()){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils['clearBlockUser'](_0x12c197,_0x1acf9a,![],null)['then'](function(){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});});}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{if(_0x1acf9a>=_0x3d04ef['allowedLoginAttempts']){return utils[_0xff16('0x1b')](_0x12c197,0x0,!![],moment())[_0xff16('0xd')](function(){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});});}else{return utils[_0xff16('0x1b')](_0x12c197,_0x1acf9a,![],null)[_0xff16('0xd')](function(){return _0x3f8f47(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{if(_0x12c197['disabled']){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else if(_0x3d04ef[_0xff16('0x19')]>0x0){if(_0x12c197[_0xff16('0x12')]){if(_0x3d04ef[_0xff16('0xc')]>0x0){if(moment(_0x12c197[_0xff16('0x13')])[_0xff16('0x1a')](_0x3d04ef[_0xff16('0xc')],_0xff16('0x1c'))>moment()){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils[_0xff16('0x1b')](_0x12c197,0x0,![],null)[_0xff16('0xd')](function(){return utils[_0xff16('0x1d')](_0x12c197);})[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);});}}else{return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}}else{return utils[_0xff16('0x1b')](_0x12c197,0x0,![],null)[_0xff16('0xd')](function(){return utils[_0xff16('0x1d')](_0x12c197);})[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);})[_0xff16('0x1e')](function(_0x8d644f){return _0x3f8f47(null,![],_0x8d644f);});}}else{if(_0x12c197[_0xff16('0x12')]){return _0x3f8f47(null,![],{'message':_0xff16('0x18')});}else{return utils[_0xff16('0x1d')](_0x12c197)[_0xff16('0xd')](function(){return _0x3f8f47(null,_0x12c197);});}}}});})['catch'](function(_0x59d096){return _0x3f8f47(null,![],_0x59d096);});}function sendServiceMail(_0x59b4ab){return db[_0xff16('0x1f')][_0xff16('0x20')]({'where':{'service':!![]},'attributes':['id',_0xff16('0xe'),'email'],'include':[{'model':db[_0xff16('0x21')],'as':_0xff16('0x22'),'include':[{'model':db[_0xff16('0x23')],'as':_0xff16('0x23')}]}]})[_0xff16('0xd')](function(_0x47391b){if(!_0x47391b){throw new Error(_0xff16('0x24'));}var _0x1ad28b=_0x47391b['getSmtpOptions']();var _0x9df679={'account':_0x1ad28b,'message':_['merge']({'from':util[_0xff16('0x25')](_0xff16('0x26'),_0x47391b[_0xff16('0xe')],_0x47391b[_0xff16('0x27')]||_0x47391b[_0xff16('0x22')]['user'])},_0x59b4ab)};return client['request'](_0xff16('0x28'),_0x9df679);})['then'](function(_0x43b659){if(_0x43b659[_0xff16('0x29')]){throw new Error(util[_0xff16('0x25')](_0xff16('0x2a'),_0x43b659[_0xff16('0x29')][_0xff16('0x2b')]||JSON[_0xff16('0x2c')](_0x43b659[_0xff16('0x29')])));}return!![];});}function handleError(_0x433130,_0x4c1da4,_0x26ef3d){return _0x433130[_0xff16('0x2d')](_0x4c1da4||0x1f4)[_0xff16('0x2e')]({'message':_0x26ef3d?_0x26ef3d[_0xff16('0x2b')]||_0x26ef3d:''});}exports[_0xff16('0x2f')]=function(_0x13e3b3,_0x129891,_0x504637){passport[_0xff16('0x30')](_0xff16('0x31'),function(_0x38f71e,_0x4ac619,_0x5717c2){var _0x148d0f=_0x38f71e||_0x5717c2;if(_0x148d0f){return handleError(_0x129891,0x191,_0x148d0f);}if(!_0x4ac619){return handleError(_0x129891,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0xc85a2e={'payload':{'id':_0x4ac619['id'],'role':_0x4ac619['role']},'options':{'expiresIn':0x15180}};return authService[_0xff16('0x32')](_0xc85a2e)['then'](function(_0x110cb9){_0x129891['json']({'id':_0x4ac619['id'],'token':_0x110cb9,'statusCall':'','isAlreadyLogged':_0x4ac619['online']});});}})(_0x13e3b3,_0x129891,_0x504637);};exports[_0xff16('0x33')]=function(_0x1e1682,_0x2f986b){if(!_0x1e1682[_0xff16('0x34')]['email']){return handleError(_0x2f986b,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xd3c362=rs[_0xff16('0x35')]();_0x1e1682[_0xff16('0x34')]['email']=_0x1e1682[_0xff16('0x34')][_0xff16('0x27')][_0xff16('0x36')]()[_0xff16('0x37')]();var _0x447db3;return db[_0xff16('0x38')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xff16('0xc')],'raw':!![]})[_0xff16('0xd')](function(_0x54d4c1){_0x447db3=_0x54d4c1;return db[_0xff16('0x39')][_0xff16('0x20')]({'where':{'email':_0x1e1682[_0xff16('0x34')][_0xff16('0x27')]}});})[_0xff16('0xd')](function(_0x4ea0e7){if(!_0x4ea0e7){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x4ea0e7['disabled']){throw new Error(_0xff16('0x3a'));}if(_0x4ea0e7[_0xff16('0x12')]){if(moment(_0x4ea0e7[_0xff16('0x13')])[_0xff16('0x1a')](_0x447db3['blockDuration'],_0xff16('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4ea0e7[_0xff16('0x12')]=![];_0x4ea0e7[_0xff16('0x13')]=null;}}_0x4ea0e7[_0xff16('0x3b')]=_0xd3c362;_0x4ea0e7[_0xff16('0x3c')]=Date['now']()+0x36ee80;return _0x4ea0e7['save']();})['then'](function(){return sendServiceMail({'to':_0x1e1682[_0xff16('0x34')][_0xff16('0x27')],'subject':_0xff16('0x3d'),'text':_0xff16('0x3e')+_0xff16('0x3f')+_0xff16('0x40')+_0x1e1682[_0xff16('0x41')][_0xff16('0x42')]+_0xff16('0x43')+_0xd3c362+'\x0a\x0a'+_0xff16('0x44')});})[_0xff16('0xd')](function(){_0x2f986b[_0xff16('0x2d')](0xc8)[_0xff16('0x2e')]({'message':_0xff16('0x45')});})[_0xff16('0x1e')](function(_0x445532){return handleError(_0x2f986b,0x1f4,_0x445532);});};exports[_0xff16('0x46')]=function(_0x236ad3,_0x4094d3){return db[_0xff16('0x39')]['find']({'where':{'resetPasswordToken':_0x236ad3[_0xff16('0x47')][_0xff16('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0xff16('0xd')](function(_0x138927){if(!_0x138927){throw new Error(_0xff16('0x49'));}return db[_0xff16('0x38')]['findOne']({'attributes':['id',_0xff16('0x4a'),'enforcePasswordHistory',_0xff16('0x4b')]})[_0xff16('0xd')](function(_0x58d7b2){if(_0x58d7b2[_0xff16('0x4a')])authService[_0xff16('0x4c')](_0x236ad3[_0xff16('0x34')][_0xff16('0xf')]);if(!_0x58d7b2[_0xff16('0x4d')]||!_0x138927[_0xff16('0x4e')])return _0x138927;authService[_0xff16('0x4f')](_0x236ad3[_0xff16('0x34')][_0xff16('0xf')],_0x138927[_0xff16('0x4e')],_0x58d7b2[_0xff16('0x4b')]);return _0x138927;})['then'](function(){_0x138927['password']=_0x236ad3[_0xff16('0x34')][_0xff16('0xf')];_0x138927[_0xff16('0x3b')]=null;_0x138927[_0xff16('0x3c')]=null;return _0x138927['save']();});})['then'](function(){_0x4094d3['status'](0xc8)[_0xff16('0x2e')]({'message':_0xff16('0x50')});})['catch'](function(_0x3dc293){return handleError(_0x4094d3,0x1f4,_0x3dc293);});};passport[_0xff16('0x51')](_0xff16('0x31'),new LocalStrategy({'usernameField':_0xff16('0xe'),'passwordField':_0xff16('0xf')},function(_0x3f43d4,_0x3ab1a6,_0x2eeed7){return localAuthenticate(db['User'],_0x3f43d4,_0x3ab1a6,_0x2eeed7);}));
\ No newline at end of file
index 9a4d9c5..0fa1703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbde7=['login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x4e2883,_0x2a8bb7){var _0x35ab6b=function(_0x208e8f){while(--_0x208e8f){_0x4e2883['push'](_0x4e2883['shift']());}};_0x35ab6b(++_0x2a8bb7);}(_0xbde7,0xa7));var _0x7bde=function(_0x53cfae,_0x44a7c5){_0x53cfae=_0x53cfae-0x0;var _0xc056ac=_0xbde7[_0x53cfae];return _0xc056ac;};'use strict';var express=require(_0x7bde('0x0'));var router=express[_0x7bde('0x1')]();var controller=require(_0x7bde('0x2'));router[_0x7bde('0x3')]('/',controller[_0x7bde('0x4')]);router[_0x7bde('0x3')](_0x7bde('0x5'),controller['forgot']);router['post'](_0x7bde('0x6'),controller[_0x7bde('0x7')]);module[_0x7bde('0x8')]=router;
\ No newline at end of file
+var _0x3822=['/reset/:token','reset','exports','express','./authLocal.controller','login','/forgot','post'];(function(_0x11223f,_0x17b8a1){var _0x567018=function(_0x36bd2c){while(--_0x36bd2c){_0x11223f['push'](_0x11223f['shift']());}};_0x567018(++_0x17b8a1);}(_0x3822,0x1bb));var _0x2382=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3822[_0x2641f9];return _0x585741;};'use strict';var express=require(_0x2382('0x0'));var router=express['Router']();var controller=require(_0x2382('0x1'));router['post']('/',controller[_0x2382('0x2')]);router['post'](_0x2382('0x3'),controller['forgot']);router[_0x2382('0x4')](_0x2382('0x5'),controller[_0x2382('0x6')]);module[_0x2382('0x7')]=router;
\ No newline at end of file
index 92248aa..000dce2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd5=['BOOLEAN','INTEGER','STRING'];(function(_0x4d05a0,_0x53aa7e){var _0x4c999c=function(_0x358867){while(--_0x358867){_0x4d05a0['push'](_0x4d05a0['shift']());}};_0x4c999c(++_0x53aa7e);}(_0xedd5,0x1eb));var _0x5edd=function(_0x4d32e9,_0x390d44){_0x4d32e9=_0x4d32e9-0x0;var _0x2d9ece=_0xedd5[_0x4d32e9];return _0x2d9ece;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x5edd('0x0')],'allowNull':![]},'channel':{'type':Sequelize[_0x5edd('0x0')]},'description':{'type':Sequelize[_0x5edd('0x0')]},'status':{'type':Sequelize[_0x5edd('0x1')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x5edd('0x2')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xa449=['BOOLEAN','INTEGER','exports','STRING'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0xa449,0x19a));var _0x9a44=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xa449[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require('sequelize');module[_0x9a44('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x9a44('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9a44('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9a44('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 884c8d3..2a9d3b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf6a=['desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','apply','reject','save','update','then','error','name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','Automation','findAll','catch','params','include','find','create','body','destroy','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xdf6a,0xde));var _0xadf6=function(_0xbca777,_0x242a64){_0xbca777=_0xbca777-0x0;var _0x20c416=_0xdf6a[_0xbca777];return _0x20c416;};'use strict';var emlformat=require(_0xadf6('0x0'));var rimraf=require(_0xadf6('0x1'));var zipdir=require(_0xadf6('0x2'));var jsonpatch=require(_0xadf6('0x3'));var rp=require(_0xadf6('0x4'));var moment=require(_0xadf6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xadf6('0x6'));var sox=require(_0xadf6('0x7'));var csv=require(_0xadf6('0x8'));var ejs=require(_0xadf6('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xadf6('0xa'));var squel=require(_0xadf6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadf6('0xc'));var toCsv=require(_0xadf6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xadf6('0xd'));var authService=require(_0xadf6('0xe'));var qs=require(_0xadf6('0xf'));var as=require(_0xadf6('0x10'));var hardwareService=require(_0xadf6('0x11'));var logger=require(_0xadf6('0x12'))('api');var utils=require(_0xadf6('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xadf6('0x14'));var db=require(_0xadf6('0x15'))['db'];function respondWithStatusCode(_0x1b94a0,_0x2685ec){_0x2685ec=_0x2685ec||0xcc;return function(_0x6229fa){if(_0x6229fa){return _0x1b94a0[_0xadf6('0x16')](_0x2685ec);}return _0x1b94a0['status'](_0x2685ec)[_0xadf6('0x17')]();};}function respondWithResult(_0x43456c,_0x31ab99){_0x31ab99=_0x31ab99||0xc8;return function(_0x52b851){if(_0x52b851){return _0x43456c[_0xadf6('0x18')](_0x31ab99)['json'](_0x52b851);}};}function respondWithFilteredResult(_0x544f25,_0x30aa3d){return function(_0x4be42c){if(_0x4be42c){var _0x1f5bed=typeof _0x30aa3d[_0xadf6('0x19')]===_0xadf6('0x1a')&&typeof _0x30aa3d[_0xadf6('0x1b')]==='undefined';var _0x8c1353=_0x4be42c[_0xadf6('0x1c')];var _0x57f76b=_0x1f5bed?0x0:_0x30aa3d[_0xadf6('0x19')];var _0x4e8b77=_0x1f5bed?_0x4be42c[_0xadf6('0x1c')]:_0x30aa3d[_0xadf6('0x19')]+_0x30aa3d[_0xadf6('0x1b')];var _0x22faab;if(_0x4e8b77>=_0x8c1353){_0x4e8b77=_0x8c1353;_0x22faab=0xc8;}else{_0x22faab=0xce;}_0x544f25[_0xadf6('0x18')](_0x22faab);return _0x544f25['set']('Content-Range',_0x57f76b+'-'+_0x4e8b77+'/'+_0x8c1353)['json'](_0x4be42c);}return null;};}function patchUpdates(_0x42825b){return function(_0x186802){try{jsonpatch[_0xadf6('0x1d')](_0x186802,_0x42825b,!![]);}catch(_0x159a9f){return BPromise[_0xadf6('0x1e')](_0x159a9f);}return _0x186802[_0xadf6('0x1f')]();};}function saveUpdates(_0x770836,_0x24cac4){return function(_0x302f81){if(_0x302f81){return _0x302f81[_0xadf6('0x20')](_0x770836)[_0xadf6('0x21')](function(_0x202c76){return _0x202c76;});}return null;};}function removeEntity(_0xcaedca,_0x154597){return function(_0x1c90bd){if(_0x1c90bd){return _0x1c90bd['destroy']()[_0xadf6('0x21')](function(){_0xcaedca[_0xadf6('0x18')](0xcc)[_0xadf6('0x17')]();});}};}function handleEntityNotFound(_0x127eee,_0x5826e5){return function(_0xc0d593){if(!_0xc0d593){_0x127eee[_0xadf6('0x16')](0x194);}return _0xc0d593;};}function handleError(_0xf8bb1a,_0x27ed6b){_0x27ed6b=_0x27ed6b||0x1f4;return function(_0x58295b){logger[_0xadf6('0x22')](_0x58295b['stack']);if(_0x58295b[_0xadf6('0x23')]){delete _0x58295b[_0xadf6('0x23')];}_0xf8bb1a[_0xadf6('0x18')](_0x27ed6b)[_0xadf6('0x24')](_0x58295b);};}exports[_0xadf6('0x25')]=function(_0x4cf86e,_0x5492b9){var _0x414472={},_0x4373ed={},_0x32bc0f={'count':0x0,'rows':[]};var _0x22ed45=_[_0xadf6('0x26')](db['Automation'][_0xadf6('0x27')],function(_0x1b7522){return{'name':_0x1b7522['fieldName'],'type':_0x1b7522[_0xadf6('0x28')]['key']};});_0x4373ed[_0xadf6('0x29')]=_['map'](_0x22ed45,_0xadf6('0x23'));_0x4373ed[_0xadf6('0x2a')]=_[_0xadf6('0x2b')](_0x4cf86e[_0xadf6('0x2a')]);_0x4373ed['filters']=_[_0xadf6('0x2c')](_0x4373ed[_0xadf6('0x29')],_0x4373ed[_0xadf6('0x2a')]);_0x414472[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x4373ed['model'],qs[_0xadf6('0x2e')](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x2e')]));_0x414472[_0xadf6('0x2d')]=_0x414472[_0xadf6('0x2d')][_0xadf6('0x2f')]?_0x414472[_0xadf6('0x2d')]:_0x4373ed[_0xadf6('0x29')];if(!_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x414472[_0xadf6('0x1b')]=qs[_0xadf6('0x1b')](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x1b')]);_0x414472['offset']=qs['offset'](_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x19')]);}_0x414472[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x4cf86e[_0xadf6('0x2a')]['sort']);_0x414472[_0xadf6('0x34')]=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x4cf86e[_0xadf6('0x2a')],_0x4373ed['filters']),_0x22ed45);if(_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x37')]){_0x414472[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x414472[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x22ed45,function(_0x287255){if(_0x287255[_0xadf6('0x28')]!==_0xadf6('0x39')){var _0x238a17={};_0x238a17[_0x287255[_0xadf6('0x23')]]={'$like':'%'+_0x4cf86e['query'][_0xadf6('0x37')]+'%'};return _0x238a17;}})});}_0x414472=_[_0xadf6('0x38')]({},_0x414472,_0x4cf86e[_0xadf6('0x3a')]);var _0x406f5f={'where':_0x414472[_0xadf6('0x34')]};return db['Automation']['count'](_0x406f5f)[_0xadf6('0x21')](function(_0x20d335){_0x32bc0f[_0xadf6('0x1c')]=_0x20d335;if(_0x4cf86e[_0xadf6('0x2a')][_0xadf6('0x3b')]){_0x414472['include']=[{'all':!![]}];}return db[_0xadf6('0x3c')][_0xadf6('0x3d')](_0x414472);})[_0xadf6('0x21')](function(_0x1a18db){_0x32bc0f['rows']=_0x1a18db;return _0x32bc0f;})[_0xadf6('0x21')](respondWithFilteredResult(_0x5492b9,_0x414472))[_0xadf6('0x3e')](handleError(_0x5492b9,null));};exports['show']=function(_0x30ac0b,_0x491c1c){var _0x5f304d={'raw':![],'where':{'id':_0x30ac0b[_0xadf6('0x3f')]['id']}},_0x35f262={};_0x35f262['model']=_['keys'](db[_0xadf6('0x3c')][_0xadf6('0x27')]);_0x35f262['query']=_[_0xadf6('0x2b')](_0x30ac0b['query']);_0x35f262['filters']=_[_0xadf6('0x2c')](_0x35f262['model'],_0x35f262[_0xadf6('0x2a')]);_0x5f304d[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x35f262[_0xadf6('0x29')],qs['fields'](_0x30ac0b[_0xadf6('0x2a')]['fields']));_0x5f304d[_0xadf6('0x2d')]=_0x5f304d[_0xadf6('0x2d')]['length']?_0x5f304d[_0xadf6('0x2d')]:_0x35f262[_0xadf6('0x29')];if(_0x30ac0b[_0xadf6('0x2a')][_0xadf6('0x3b')]){_0x5f304d[_0xadf6('0x40')]=[{'all':!![]}];}_0x5f304d=_['merge']({},_0x5f304d,_0x30ac0b[_0xadf6('0x3a')]);return db['Automation'][_0xadf6('0x41')](_0x5f304d)[_0xadf6('0x21')](handleEntityNotFound(_0x491c1c,null))[_0xadf6('0x21')](respondWithResult(_0x491c1c,null))[_0xadf6('0x3e')](handleError(_0x491c1c,null));};exports[_0xadf6('0x42')]=function(_0x11148,_0x40dbc9){return db[_0xadf6('0x3c')][_0xadf6('0x42')](_0x11148[_0xadf6('0x43')],{})['then'](respondWithResult(_0x40dbc9,0xc9))[_0xadf6('0x3e')](handleError(_0x40dbc9,null));};exports[_0xadf6('0x20')]=function(_0x5588f5,_0xf7768a){if(_0x5588f5[_0xadf6('0x43')]['id']){delete _0x5588f5[_0xadf6('0x43')]['id'];}return db[_0xadf6('0x3c')][_0xadf6('0x41')]({'where':{'id':_0x5588f5['params']['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0xf7768a,null))[_0xadf6('0x21')](saveUpdates(_0x5588f5[_0xadf6('0x43')],null))['then'](respondWithResult(_0xf7768a,null))[_0xadf6('0x3e')](handleError(_0xf7768a,null));};exports[_0xadf6('0x44')]=function(_0x53ecf8,_0x7f58d8){return db[_0xadf6('0x3c')][_0xadf6('0x41')]({'where':{'id':_0x53ecf8[_0xadf6('0x3f')]['id']}})['then'](handleEntityNotFound(_0x7f58d8,null))[_0xadf6('0x21')](removeEntity(_0x7f58d8,null))[_0xadf6('0x3e')](handleError(_0x7f58d8,null));};exports[_0xadf6('0x45')]=function(_0x43d23b,_0x664856,_0x148c10){return db['Condition'][_0xadf6('0x41')]({'where':{'id':_0x43d23b[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x664856,null))[_0xadf6('0x21')](function(_0x1ca532){if(_0x1ca532){return _0x1ca532['addConditions'](_0x43d23b[_0xadf6('0x43')][_0xadf6('0x46')],_[_0xadf6('0x47')](_0x43d23b['body'],[_0xadf6('0x46'),'id'])||{});}})['then'](respondWithResult(_0x664856,null))[_0xadf6('0x3e')](handleError(_0x664856,null));};exports[_0xadf6('0x48')]=function(_0x382dac,_0xe26e6a,_0x3ba91d){var _0x1d80c7={};var _0x228a24={};var _0x47f8d8;var _0x2272c3;return db[_0xadf6('0x3c')][_0xadf6('0x49')]({'where':{'id':_0x382dac['params']['id']}})['then'](handleEntityNotFound(_0xe26e6a,null))[_0xadf6('0x21')](function(_0x16d0eb){if(_0x16d0eb){_0x47f8d8=_0x16d0eb;_0x228a24[_0xadf6('0x29')]=_[_0xadf6('0x2b')](db[_0xadf6('0x4a')][_0xadf6('0x27')]);_0x228a24[_0xadf6('0x2a')]=_[_0xadf6('0x2b')](_0x382dac[_0xadf6('0x2a')]);_0x228a24[_0xadf6('0x35')]=_[_0xadf6('0x2c')](_0x228a24[_0xadf6('0x29')],_0x228a24['query']);_0x1d80c7['attributes']=_[_0xadf6('0x2c')](_0x228a24[_0xadf6('0x29')],qs[_0xadf6('0x2e')](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x2e')]));_0x1d80c7['attributes']=_0x1d80c7[_0xadf6('0x2d')]['length']?_0x1d80c7[_0xadf6('0x2d')]:_0x228a24['model'];_0x1d80c7[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x382dac['query'][_0xadf6('0x33')]);_0x1d80c7[_0xadf6('0x34')]=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x382dac[_0xadf6('0x2a')],_0x228a24['filters']));if(_0x382dac['query'][_0xadf6('0x37')]){_0x1d80c7[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x1d80c7[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x1d80c7[_0xadf6('0x2d')],function(_0x24ffcf){var _0x263e1f={};_0x263e1f[_0x24ffcf]={'$like':'%'+_0x382dac[_0xadf6('0x2a')][_0xadf6('0x37')]+'%'};return _0x263e1f;})});}_0x1d80c7=_['merge']({},_0x1d80c7,_0x382dac[_0xadf6('0x3a')]);return _0x47f8d8[_0xadf6('0x48')](_0x1d80c7);}})['then'](function(_0x3fa5ca){if(_0x3fa5ca){_0x2272c3=_0x3fa5ca[_0xadf6('0x2f')];if(!_0x382dac[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x1d80c7['limit']=qs[_0xadf6('0x1b')](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x1b')]);_0x1d80c7[_0xadf6('0x19')]=qs['offset'](_0x382dac[_0xadf6('0x2a')][_0xadf6('0x19')]);}return _0x47f8d8['getConditions'](_0x1d80c7);}})[_0xadf6('0x21')](function(_0x268d04){if(_0x268d04){return _0x268d04?{'count':_0x2272c3,'rows':_0x268d04}:null;}})[_0xadf6('0x21')](respondWithResult(_0xe26e6a,null))[_0xadf6('0x3e')](handleError(_0xe26e6a,null));};exports[_0xadf6('0x4b')]=function(_0x2419ee,_0x41653b,_0xdbb4dc){return db[_0xadf6('0x4c')]['find']({'where':{'id':_0x2419ee[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x41653b,null))[_0xadf6('0x21')](function(_0x231340){if(_0x231340){return _0x231340['addActions'](_0x2419ee[_0xadf6('0x43')][_0xadf6('0x46')],_['omit'](_0x2419ee[_0xadf6('0x43')],['ids','id'])||{});}})[_0xadf6('0x21')](respondWithResult(_0x41653b,null))['catch'](handleError(_0x41653b,null));};exports[_0xadf6('0x4d')]=function(_0x16d243,_0x56e404,_0x2fb0f9){var _0x3e035f={};var _0x26337c={};var _0x146167;var _0x1cc15a;return db[_0xadf6('0x3c')][_0xadf6('0x49')]({'where':{'id':_0x16d243[_0xadf6('0x3f')]['id']}})[_0xadf6('0x21')](handleEntityNotFound(_0x56e404,null))['then'](function(_0x7236ed){if(_0x7236ed){_0x146167=_0x7236ed;_0x26337c['model']=_['keys'](db[_0xadf6('0x4c')][_0xadf6('0x27')]);_0x26337c['query']=_[_0xadf6('0x2b')](_0x16d243[_0xadf6('0x2a')]);_0x26337c['filters']=_['intersection'](_0x26337c[_0xadf6('0x29')],_0x26337c['query']);_0x3e035f[_0xadf6('0x2d')]=_[_0xadf6('0x2c')](_0x26337c['model'],qs[_0xadf6('0x2e')](_0x16d243['query'][_0xadf6('0x2e')]));_0x3e035f[_0xadf6('0x2d')]=_0x3e035f[_0xadf6('0x2d')][_0xadf6('0x2f')]?_0x3e035f[_0xadf6('0x2d')]:_0x26337c[_0xadf6('0x29')];_0x3e035f[_0xadf6('0x32')]=qs[_0xadf6('0x33')](_0x16d243[_0xadf6('0x2a')]['sort']);_0x3e035f['where']=qs[_0xadf6('0x35')](_[_0xadf6('0x36')](_0x16d243[_0xadf6('0x2a')],_0x26337c[_0xadf6('0x35')]));if(_0x16d243[_0xadf6('0x2a')]['filter']){_0x3e035f[_0xadf6('0x34')]=_[_0xadf6('0x38')](_0x3e035f[_0xadf6('0x34')],{'$or':_[_0xadf6('0x26')](_0x3e035f[_0xadf6('0x2d')],function(_0x294787){var _0x252d5d={};_0x252d5d[_0x294787]={'$like':'%'+_0x16d243[_0xadf6('0x2a')][_0xadf6('0x37')]+'%'};return _0x252d5d;})});}_0x3e035f=_[_0xadf6('0x38')]({},_0x3e035f,_0x16d243[_0xadf6('0x3a')]);return _0x146167[_0xadf6('0x4d')](_0x3e035f);}})['then'](function(_0x354650){if(_0x354650){_0x1cc15a=_0x354650[_0xadf6('0x2f')];if(!_0x16d243[_0xadf6('0x2a')][_0xadf6('0x30')](_0xadf6('0x31'))){_0x3e035f[_0xadf6('0x1b')]=qs[_0xadf6('0x1b')](_0x16d243['query'][_0xadf6('0x1b')]);_0x3e035f[_0xadf6('0x19')]=qs['offset'](_0x16d243[_0xadf6('0x2a')][_0xadf6('0x19')]);}return _0x146167['getActions'](_0x3e035f);}})['then'](function(_0x181829){if(_0x181829){return _0x181829?{'count':_0x1cc15a,'rows':_0x181829}:null;}})[_0xadf6('0x21')](respondWithResult(_0x56e404,null))['catch'](handleError(_0x56e404,null));};
\ No newline at end of file
+var _0x7e34=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','Automation','rawAttributes','fieldName','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','rows','catch','params','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','pick','options','addActions','Action','getActions','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring'];(function(_0x28f1db,_0x487815){var _0x4ffcab=function(_0x4af3f0){while(--_0x4af3f0){_0x28f1db['push'](_0x28f1db['shift']());}};_0x4ffcab(++_0x487815);}(_0x7e34,0xe8));var _0x47e3=function(_0x3c4321,_0x471f6e){_0x3c4321=_0x3c4321-0x0;var _0x3eff75=_0x7e34[_0x3c4321];return _0x3eff75;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x47e3('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47e3('0x1'));var moment=require(_0x47e3('0x2'));var BPromise=require(_0x47e3('0x3'));var Mustache=require(_0x47e3('0x4'));var util=require(_0x47e3('0x5'));var path=require(_0x47e3('0x6'));var sox=require('sox');var csv=require(_0x47e3('0x7'));var ejs=require(_0x47e3('0x8'));var fs=require('fs');var fs_extra=require(_0x47e3('0x9'));var _=require(_0x47e3('0xa'));var squel=require(_0x47e3('0xb'));var crypto=require('crypto');var jsforce=require(_0x47e3('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x47e3('0xd'));var Papa=require(_0x47e3('0xe'));var Redis=require(_0x47e3('0xf'));var authService=require(_0x47e3('0x10'));var qs=require(_0x47e3('0x11'));var as=require(_0x47e3('0x12'));var hardwareService=require(_0x47e3('0x13'));var logger=require(_0x47e3('0x14'))(_0x47e3('0x15'));var utils=require(_0x47e3('0x16'));var config=require(_0x47e3('0x17'));var licenseUtil=require(_0x47e3('0x18'));var db=require(_0x47e3('0x19'))['db'];function respondWithStatusCode(_0xff1e55,_0x4b98d1){_0x4b98d1=_0x4b98d1||0xcc;return function(_0xb18a96){if(_0xb18a96){return _0xff1e55[_0x47e3('0x1a')](_0x4b98d1);}return _0xff1e55['status'](_0x4b98d1)[_0x47e3('0x1b')]();};}function respondWithResult(_0x4cbf7c,_0x451e3){_0x451e3=_0x451e3||0xc8;return function(_0x4d70ca){if(_0x4d70ca){return _0x4cbf7c[_0x47e3('0x1c')](_0x451e3)[_0x47e3('0x1d')](_0x4d70ca);}};}function respondWithFilteredResult(_0x1e8f37,_0xd3831f){return function(_0x3a42da){if(_0x3a42da){var _0x459dc9=typeof _0xd3831f['offset']==='undefined'&&typeof _0xd3831f[_0x47e3('0x1e')]==='undefined';var _0x3b9d20=_0x3a42da[_0x47e3('0x1f')];var _0x356628=_0x459dc9?0x0:_0xd3831f[_0x47e3('0x20')];var _0x16a1c7=_0x459dc9?_0x3a42da[_0x47e3('0x1f')]:_0xd3831f['offset']+_0xd3831f['limit'];var _0x234eb9;if(_0x16a1c7>=_0x3b9d20){_0x16a1c7=_0x3b9d20;_0x234eb9=0xc8;}else{_0x234eb9=0xce;}_0x1e8f37['status'](_0x234eb9);return _0x1e8f37[_0x47e3('0x21')](_0x47e3('0x22'),_0x356628+'-'+_0x16a1c7+'/'+_0x3b9d20)[_0x47e3('0x1d')](_0x3a42da);}return null;};}function patchUpdates(_0x3898db){return function(_0x2e8b3b){try{jsonpatch['apply'](_0x2e8b3b,_0x3898db,!![]);}catch(_0x19bd83){return BPromise[_0x47e3('0x23')](_0x19bd83);}return _0x2e8b3b[_0x47e3('0x24')]();};}function saveUpdates(_0x2bf075,_0x48d69f){return function(_0x4816ae){if(_0x4816ae){return _0x4816ae[_0x47e3('0x25')](_0x2bf075)['then'](function(_0x3c28b8){return _0x3c28b8;});}return null;};}function removeEntity(_0x4d7b15,_0x13a05c){return function(_0x545ebe){if(_0x545ebe){return _0x545ebe['destroy']()[_0x47e3('0x26')](function(){_0x4d7b15[_0x47e3('0x1c')](0xcc)[_0x47e3('0x1b')]();});}};}function handleEntityNotFound(_0x2fa343,_0x1588f3){return function(_0x510148){if(!_0x510148){_0x2fa343[_0x47e3('0x1a')](0x194);}return _0x510148;};}function handleError(_0x214510,_0x1b6e6e){_0x1b6e6e=_0x1b6e6e||0x1f4;return function(_0x4075cb){logger[_0x47e3('0x27')](_0x4075cb['stack']);if(_0x4075cb[_0x47e3('0x28')]){delete _0x4075cb[_0x47e3('0x28')];}_0x214510[_0x47e3('0x1c')](_0x1b6e6e)[_0x47e3('0x29')](_0x4075cb);};}exports['index']=function(_0x2a28ee,_0x561fe9){var _0x379c13={},_0x1c05fa={},_0x50768e={'count':0x0,'rows':[]};var _0x1afcd5=_['map'](db[_0x47e3('0x2a')][_0x47e3('0x2b')],function(_0x2ba406){return{'name':_0x2ba406[_0x47e3('0x2c')],'type':_0x2ba406['type'][_0x47e3('0x2d')]};});_0x1c05fa['model']=_[_0x47e3('0x2e')](_0x1afcd5,_0x47e3('0x28'));_0x1c05fa[_0x47e3('0x2f')]=_[_0x47e3('0x30')](_0x2a28ee[_0x47e3('0x2f')]);_0x1c05fa['filters']=_[_0x47e3('0x31')](_0x1c05fa[_0x47e3('0x32')],_0x1c05fa[_0x47e3('0x2f')]);_0x379c13[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x1c05fa[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x2a28ee['query'][_0x47e3('0x34')]));_0x379c13[_0x47e3('0x33')]=_0x379c13[_0x47e3('0x33')][_0x47e3('0x35')]?_0x379c13[_0x47e3('0x33')]:_0x1c05fa[_0x47e3('0x32')];if(!_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x36')](_0x47e3('0x37'))){_0x379c13[_0x47e3('0x1e')]=qs[_0x47e3('0x1e')](_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x1e')]);_0x379c13[_0x47e3('0x20')]=qs['offset'](_0x2a28ee[_0x47e3('0x2f')]['offset']);}_0x379c13[_0x47e3('0x38')]=qs['sort'](_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x39')]);_0x379c13[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_['pick'](_0x2a28ee[_0x47e3('0x2f')],_0x1c05fa['filters']),_0x1afcd5);if(_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x379c13[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x379c13['where'],{'$or':_[_0x47e3('0x2e')](_0x1afcd5,function(_0x255863){if(_0x255863['type']!=='VIRTUAL'){var _0x4cba57={};_0x4cba57[_0x255863['name']]={'$like':'%'+_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3c')]+'%'};return _0x4cba57;}})});}_0x379c13=_['merge']({},_0x379c13,_0x2a28ee['options']);var _0x164ad3={'where':_0x379c13[_0x47e3('0x3a')]};return db['Automation'][_0x47e3('0x1f')](_0x164ad3)[_0x47e3('0x26')](function(_0x52d788){_0x50768e[_0x47e3('0x1f')]=_0x52d788;if(_0x2a28ee[_0x47e3('0x2f')][_0x47e3('0x3e')]){_0x379c13[_0x47e3('0x3f')]=[{'all':!![]}];}return db[_0x47e3('0x2a')]['findAll'](_0x379c13);})[_0x47e3('0x26')](function(_0x557b30){_0x50768e[_0x47e3('0x40')]=_0x557b30;return _0x50768e;})['then'](respondWithFilteredResult(_0x561fe9,_0x379c13))[_0x47e3('0x41')](handleError(_0x561fe9,null));};exports['show']=function(_0x5666aa,_0x39ff9d){var _0x2a9f5a={'raw':![],'where':{'id':_0x5666aa[_0x47e3('0x42')]['id']}},_0x414fa2={};_0x414fa2[_0x47e3('0x32')]=_[_0x47e3('0x30')](db['Automation'][_0x47e3('0x2b')]);_0x414fa2['query']=_[_0x47e3('0x30')](_0x5666aa[_0x47e3('0x2f')]);_0x414fa2['filters']=_[_0x47e3('0x31')](_0x414fa2[_0x47e3('0x32')],_0x414fa2[_0x47e3('0x2f')]);_0x2a9f5a[_0x47e3('0x33')]=_['intersection'](_0x414fa2[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x5666aa[_0x47e3('0x2f')][_0x47e3('0x34')]));_0x2a9f5a[_0x47e3('0x33')]=_0x2a9f5a['attributes'][_0x47e3('0x35')]?_0x2a9f5a[_0x47e3('0x33')]:_0x414fa2[_0x47e3('0x32')];if(_0x5666aa[_0x47e3('0x2f')][_0x47e3('0x3e')]){_0x2a9f5a[_0x47e3('0x3f')]=[{'all':!![]}];}_0x2a9f5a=_[_0x47e3('0x3d')]({},_0x2a9f5a,_0x5666aa['options']);return db['Automation'][_0x47e3('0x43')](_0x2a9f5a)['then'](handleEntityNotFound(_0x39ff9d,null))[_0x47e3('0x26')](respondWithResult(_0x39ff9d,null))[_0x47e3('0x41')](handleError(_0x39ff9d,null));};exports[_0x47e3('0x44')]=function(_0x1f0ee9,_0x17f2b7){return db[_0x47e3('0x2a')][_0x47e3('0x44')](_0x1f0ee9[_0x47e3('0x45')],{})[_0x47e3('0x26')](respondWithResult(_0x17f2b7,0xc9))[_0x47e3('0x41')](handleError(_0x17f2b7,null));};exports[_0x47e3('0x25')]=function(_0x3b5b58,_0x290404){if(_0x3b5b58['body']['id']){delete _0x3b5b58[_0x47e3('0x45')]['id'];}return db[_0x47e3('0x2a')][_0x47e3('0x43')]({'where':{'id':_0x3b5b58[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x290404,null))[_0x47e3('0x26')](saveUpdates(_0x3b5b58[_0x47e3('0x45')],null))[_0x47e3('0x26')](respondWithResult(_0x290404,null))['catch'](handleError(_0x290404,null));};exports[_0x47e3('0x46')]=function(_0x232dda,_0x444a2a){return db[_0x47e3('0x2a')][_0x47e3('0x43')]({'where':{'id':_0x232dda[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x444a2a,null))['then'](removeEntity(_0x444a2a,null))['catch'](handleError(_0x444a2a,null));};exports[_0x47e3('0x47')]=function(_0x3d6499,_0x31f2db,_0x4b9b71){return db[_0x47e3('0x48')]['find']({'where':{'id':_0x3d6499[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x31f2db,null))['then'](function(_0x1c7b94){if(_0x1c7b94){return _0x1c7b94[_0x47e3('0x47')](_0x3d6499[_0x47e3('0x45')][_0x47e3('0x49')],_[_0x47e3('0x4a')](_0x3d6499[_0x47e3('0x45')],[_0x47e3('0x49'),'id'])||{});}})[_0x47e3('0x26')](respondWithResult(_0x31f2db,null))[_0x47e3('0x41')](handleError(_0x31f2db,null));};exports[_0x47e3('0x4b')]=function(_0x245b7d,_0x31292b,_0x1b6a9e){var _0x342238={};var _0x3ee3de={};var _0x585fad;var _0x539ea0;return db[_0x47e3('0x2a')][_0x47e3('0x4c')]({'where':{'id':_0x245b7d[_0x47e3('0x42')]['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x31292b,null))[_0x47e3('0x26')](function(_0x56274a){if(_0x56274a){_0x585fad=_0x56274a;_0x3ee3de[_0x47e3('0x32')]=_[_0x47e3('0x30')](db[_0x47e3('0x48')]['rawAttributes']);_0x3ee3de[_0x47e3('0x2f')]=_[_0x47e3('0x30')](_0x245b7d[_0x47e3('0x2f')]);_0x3ee3de['filters']=_[_0x47e3('0x31')](_0x3ee3de[_0x47e3('0x32')],_0x3ee3de[_0x47e3('0x2f')]);_0x342238[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x3ee3de[_0x47e3('0x32')],qs[_0x47e3('0x34')](_0x245b7d[_0x47e3('0x2f')]['fields']));_0x342238[_0x47e3('0x33')]=_0x342238[_0x47e3('0x33')][_0x47e3('0x35')]?_0x342238[_0x47e3('0x33')]:_0x3ee3de['model'];_0x342238[_0x47e3('0x38')]=qs[_0x47e3('0x39')](_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x39')]);_0x342238[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_[_0x47e3('0x4d')](_0x245b7d[_0x47e3('0x2f')],_0x3ee3de[_0x47e3('0x3b')]));if(_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x342238[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x342238[_0x47e3('0x3a')],{'$or':_[_0x47e3('0x2e')](_0x342238[_0x47e3('0x33')],function(_0x4ec926){var _0x5223b3={};_0x5223b3[_0x4ec926]={'$like':'%'+_0x245b7d['query'][_0x47e3('0x3c')]+'%'};return _0x5223b3;})});}_0x342238=_[_0x47e3('0x3d')]({},_0x342238,_0x245b7d[_0x47e3('0x4e')]);return _0x585fad[_0x47e3('0x4b')](_0x342238);}})[_0x47e3('0x26')](function(_0x185f52){if(_0x185f52){_0x539ea0=_0x185f52[_0x47e3('0x35')];if(!_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x36')]('nolimit')){_0x342238['limit']=qs['limit'](_0x245b7d['query'][_0x47e3('0x1e')]);_0x342238[_0x47e3('0x20')]=qs[_0x47e3('0x20')](_0x245b7d[_0x47e3('0x2f')][_0x47e3('0x20')]);}return _0x585fad[_0x47e3('0x4b')](_0x342238);}})[_0x47e3('0x26')](function(_0x52dbf0){if(_0x52dbf0){return _0x52dbf0?{'count':_0x539ea0,'rows':_0x52dbf0}:null;}})[_0x47e3('0x26')](respondWithResult(_0x31292b,null))[_0x47e3('0x41')](handleError(_0x31292b,null));};exports[_0x47e3('0x4f')]=function(_0x58b0b2,_0xe53d68,_0x4692db){return db[_0x47e3('0x50')][_0x47e3('0x43')]({'where':{'id':_0x58b0b2[_0x47e3('0x42')]['id']}})['then'](handleEntityNotFound(_0xe53d68,null))[_0x47e3('0x26')](function(_0x5ef865){if(_0x5ef865){return _0x5ef865[_0x47e3('0x4f')](_0x58b0b2['body'][_0x47e3('0x49')],_[_0x47e3('0x4a')](_0x58b0b2[_0x47e3('0x45')],[_0x47e3('0x49'),'id'])||{});}})[_0x47e3('0x26')](respondWithResult(_0xe53d68,null))[_0x47e3('0x41')](handleError(_0xe53d68,null));};exports['getActions']=function(_0x58c0f0,_0x3f11cb,_0x49d811){var _0x492a27={};var _0x1b07e1={};var _0x568fdf;var _0x329192;return db[_0x47e3('0x2a')][_0x47e3('0x4c')]({'where':{'id':_0x58c0f0['params']['id']}})[_0x47e3('0x26')](handleEntityNotFound(_0x3f11cb,null))[_0x47e3('0x26')](function(_0x30f804){if(_0x30f804){_0x568fdf=_0x30f804;_0x1b07e1[_0x47e3('0x32')]=_[_0x47e3('0x30')](db['Action'][_0x47e3('0x2b')]);_0x1b07e1[_0x47e3('0x2f')]=_['keys'](_0x58c0f0['query']);_0x1b07e1['filters']=_[_0x47e3('0x31')](_0x1b07e1[_0x47e3('0x32')],_0x1b07e1[_0x47e3('0x2f')]);_0x492a27[_0x47e3('0x33')]=_[_0x47e3('0x31')](_0x1b07e1['model'],qs[_0x47e3('0x34')](_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x34')]));_0x492a27[_0x47e3('0x33')]=_0x492a27[_0x47e3('0x33')][_0x47e3('0x35')]?_0x492a27[_0x47e3('0x33')]:_0x1b07e1['model'];_0x492a27['order']=qs['sort'](_0x58c0f0[_0x47e3('0x2f')]['sort']);_0x492a27[_0x47e3('0x3a')]=qs[_0x47e3('0x3b')](_[_0x47e3('0x4d')](_0x58c0f0[_0x47e3('0x2f')],_0x1b07e1[_0x47e3('0x3b')]));if(_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x3c')]){_0x492a27[_0x47e3('0x3a')]=_[_0x47e3('0x3d')](_0x492a27[_0x47e3('0x3a')],{'$or':_['map'](_0x492a27['attributes'],function(_0x1ed220){var _0x4b64f6={};_0x4b64f6[_0x1ed220]={'$like':'%'+_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x3c')]+'%'};return _0x4b64f6;})});}_0x492a27=_[_0x47e3('0x3d')]({},_0x492a27,_0x58c0f0[_0x47e3('0x4e')]);return _0x568fdf[_0x47e3('0x51')](_0x492a27);}})[_0x47e3('0x26')](function(_0x19436f){if(_0x19436f){_0x329192=_0x19436f[_0x47e3('0x35')];if(!_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x36')](_0x47e3('0x37'))){_0x492a27[_0x47e3('0x1e')]=qs['limit'](_0x58c0f0[_0x47e3('0x2f')][_0x47e3('0x1e')]);_0x492a27['offset']=qs[_0x47e3('0x20')](_0x58c0f0[_0x47e3('0x2f')]['offset']);}return _0x568fdf[_0x47e3('0x51')](_0x492a27);}})[_0x47e3('0x26')](function(_0x1c8ea3){if(_0x1c8ea3){return _0x1c8ea3?{'count':_0x329192,'rows':_0x1c8ea3}:null;}})['then'](respondWithResult(_0x3f11cb,null))[_0x47e3('0x41')](handleError(_0x3f11cb,null));};
\ No newline at end of file
index 1700e9e..a32f8f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dcf=['rimraf','./automation.attributes','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x13a92a,_0x7a2223){var _0x36cca4=function(_0x1fc0c4){while(--_0x1fc0c4){_0x13a92a['push'](_0x13a92a['shift']());}};_0x36cca4(++_0x7a2223);}(_0x3dcf,0xca));var _0xf3dc=function(_0x1d908f,_0xc9d055){_0x1d908f=_0x1d908f-0x0;var _0x3cea2e=_0x3dcf[_0x1d908f];return _0x3cea2e;};'use strict';var _=require(_0xf3dc('0x0'));var util=require(_0xf3dc('0x1'));var logger=require(_0xf3dc('0x2'))(_0xf3dc('0x3'));var moment=require(_0xf3dc('0x4'));var BPromise=require(_0xf3dc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3dc('0x6'));var rimraf=require(_0xf3dc('0x7'));var config=require('../../config/environment');var attributes=require(_0xf3dc('0x8'));module['exports']=function(_0x13f3d4,_0x38550b){return _0x13f3d4['define'](_0xf3dc('0x9'),attributes,{'tableName':_0xf3dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9781=['api','bluebird','request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x9781,0x129));var _0x1978=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x9781[_0x4c445a];return _0x2f611c;};'use strict';var _=require(_0x1978('0x0'));var util=require(_0x1978('0x1'));var logger=require(_0x1978('0x2'))(_0x1978('0x3'));var moment=require('moment');var BPromise=require(_0x1978('0x4'));var rp=require(_0x1978('0x5'));var fs=require('fs');var path=require(_0x1978('0x6'));var rimraf=require(_0x1978('0x7'));var config=require('../../config/environment');var attributes=require(_0x1978('0x8'));module[_0x1978('0x9')]=function(_0xfff9d9,_0x6288cc){return _0xfff9d9[_0x1978('0xa')]('Automation',attributes,{'tableName':_0x1978('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c2fc687..61d72ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird'];(function(_0x116867,_0x1011a8){var _0x585ba0=function(_0x2738ff){while(--_0x2738ff){_0x116867['push'](_0x116867['shift']());}};_0x585ba0(++_0x1011a8);}(_0x958a,0x128));var _0xa958=function(_0x5a2886,_0x161de5){_0x5a2886=_0x5a2886-0x0;var _0x41635d=_0x958a[_0x5a2886];return _0x41635d;};'use strict';var _=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var moment=require('moment');var BPromise=require(_0xa958('0x2'));var rs=require(_0xa958('0x3'));var fs=require('fs');var Redis=require(_0xa958('0x4'));var db=require(_0xa958('0x5'))['db'];var utils=require(_0xa958('0x6'));var logger=require('../../config/logger')(_0xa958('0x7'));var config=require('../../config/environment');var jayson=require(_0xa958('0x8'));var client=jayson[_0xa958('0x9')][_0xa958('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ddaa9,_0x3ca01f,_0x3b2693){return new BPromise(function(_0x1895da,_0x54c0e0){return client['request'](_0x3ddaa9,_0x3b2693)[_0xa958('0xb')](function(_0x249764){logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));logger[_0xa958('0xf')](_0xa958('0x10'),_0x3ca01f,_0xa958('0xe'),JSON[_0xa958('0x11')](_0x249764));if(_0x249764[_0xa958('0x12')]){if(_0x249764[_0xa958('0x12')][_0xa958('0x13')]===0x1f4){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764['error']['message']);return _0x54c0e0(_0x249764[_0xa958('0x12')][_0xa958('0x14')]);}logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x249764[_0xa958('0x12')]['message']);return _0x1895da(_0x249764['error']['message']);}else{logger[_0xa958('0xc')](_0xa958('0xd'),_0x3ca01f,_0xa958('0xe'));_0x1895da(_0x249764[_0xa958('0x15')][_0xa958('0x14')]);}})[_0xa958('0x16')](function(_0x23736f){logger[_0xa958('0x12')]('Automation,\x20%s,\x20%s',_0x3ca01f,_0x23736f);_0x54c0e0(_0x23736f);});});}
\ No newline at end of file
+var _0x96f2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring'];(function(_0x1228b2,_0x1445c1){var _0x2fc1ed=function(_0x125122){while(--_0x125122){_0x1228b2['push'](_0x1228b2['shift']());}};_0x2fc1ed(++_0x1445c1);}(_0x96f2,0xb0));var _0x296f=function(_0x3b684e,_0x357ce4){_0x3b684e=_0x3b684e-0x0;var _0x21a5cb=_0x96f2[_0x3b684e];return _0x21a5cb;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x164031,_0x1d019f,_0x2dc0ca){return new BPromise(function(_0x28f708,_0x30ed43){return client[_0x296f('0x9')](_0x164031,_0x2dc0ca)[_0x296f('0xa')](function(_0x3ea699){logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,'request\x20sent');logger[_0x296f('0xd')](_0x296f('0xe'),_0x1d019f,_0x296f('0xf'),JSON['stringify'](_0x3ea699));if(_0x3ea699[_0x296f('0x10')]){if(_0x3ea699[_0x296f('0x10')][_0x296f('0x11')]===0x1f4){logger[_0x296f('0x10')]('Automation,\x20%s,\x20%s',_0x1d019f,_0x3ea699['error']['message']);return _0x30ed43(_0x3ea699[_0x296f('0x10')][_0x296f('0x12')]);}logger[_0x296f('0x10')](_0x296f('0xc'),_0x1d019f,_0x3ea699['error'][_0x296f('0x12')]);return _0x28f708(_0x3ea699['error']['message']);}else{logger[_0x296f('0xb')](_0x296f('0xc'),_0x1d019f,_0x296f('0xf'));_0x28f708(_0x3ea699[_0x296f('0x13')]['message']);}})['catch'](function(_0x3e3860){logger['error'](_0x296f('0xc'),_0x1d019f,_0x3e3860);_0x30ed43(_0x3e3860);});});}
\ No newline at end of file
index 2d4aa3c..af28334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20a2=['../../components/interaction/service','./automation.controller','get','isAuthenticated','index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4906f0,_0x44ffc9){var _0x414b60=function(_0x3848a9){while(--_0x3848a9){_0x4906f0['push'](_0x4906f0['shift']());}};_0x414b60(++_0x44ffc9);}(_0x20a2,0x102));var _0x220a=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0x20a2[_0x36bc58];return _0x4a547e;};'use strict';var multer=require(_0x220a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x220a('0x1'));var express=require(_0x220a('0x2'));var router=express[_0x220a('0x3')]();var fs_extra=require(_0x220a('0x4'));var auth=require(_0x220a('0x5'));var interaction=require(_0x220a('0x6'));var config=require('../../config/environment');var controller=require(_0x220a('0x7'));router[_0x220a('0x8')]('/',auth[_0x220a('0x9')](),controller[_0x220a('0xa')]);router[_0x220a('0x8')](_0x220a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x220a('0x8')](_0x220a('0xc'),auth[_0x220a('0x9')](),controller[_0x220a('0xd')]);router[_0x220a('0x8')](_0x220a('0xe'),auth[_0x220a('0x9')](),controller[_0x220a('0xf')]);router['post']('/',auth[_0x220a('0x9')](),controller['create']);router[_0x220a('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x220a('0x11')]);router[_0x220a('0x10')]('/:id/actions',auth[_0x220a('0x9')](),controller['addActions']);router[_0x220a('0x12')](_0x220a('0xb'),auth[_0x220a('0x9')](),controller[_0x220a('0x13')]);router[_0x220a('0x14')](_0x220a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x220a('0x15')]=router;
\ No newline at end of file
+var _0x9879=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','/:id','delete'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x9879,0x98));var _0x9987=function(_0x4e7089,_0x2eab9e){_0x4e7089=_0x4e7089-0x0;var _0xd6b060=_0x9879[_0x4e7089];return _0xd6b060;};'use strict';var multer=require(_0x9987('0x0'));var util=require(_0x9987('0x1'));var path=require(_0x9987('0x2'));var timeout=require('connect-timeout');var express=require(_0x9987('0x3'));var router=express['Router']();var fs_extra=require(_0x9987('0x4'));var auth=require(_0x9987('0x5'));var interaction=require(_0x9987('0x6'));var config=require(_0x9987('0x7'));var controller=require(_0x9987('0x8'));router[_0x9987('0x9')]('/',auth[_0x9987('0xa')](),controller['index']);router[_0x9987('0x9')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0xb')]);router[_0x9987('0x9')](_0x9987('0xc'),auth[_0x9987('0xa')](),controller[_0x9987('0xd')]);router[_0x9987('0x9')](_0x9987('0xe'),auth[_0x9987('0xa')](),controller[_0x9987('0xf')]);router[_0x9987('0x10')]('/',auth[_0x9987('0xa')](),controller[_0x9987('0x11')]);router[_0x9987('0x10')](_0x9987('0xc'),auth[_0x9987('0xa')](),controller[_0x9987('0x12')]);router[_0x9987('0x10')]('/:id/actions',auth[_0x9987('0xa')](),controller[_0x9987('0x13')]);router[_0x9987('0x14')](_0x9987('0x15'),auth[_0x9987('0xa')](),controller['update']);router[_0x9987('0x16')]('/:id',auth[_0x9987('0xa')](),controller[_0x9987('0x17')]);module[_0x9987('0x18')]=router;
\ No newline at end of file
index 739337f..4930703 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80fa=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD'];(function(_0x48e538,_0x4199b9){var _0xfbe826=function(_0x37adf4){while(--_0x37adf4){_0x48e538['push'](_0x48e538['shift']());}};_0xfbe826(++_0x4199b9);}(_0x80fa,0xd9));var _0xa80f=function(_0x5fa506,_0x5bc55f){_0x5fa506=_0x5fa506-0x0;var _0x1ae1bf=_0x80fa[_0x5fa506];return _0x1ae1bf;};'use strict';var Sequelize=require(_0xa80f('0x0'));module['exports']={'name':{'type':Sequelize[_0xa80f('0x1')],'unique':_0xa80f('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xa80f('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xa80f('0x4')},'description':{'type':Sequelize[_0xa80f('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa80f('0x5')},'limitCalls':{'type':Sequelize[_0xa80f('0x6')](0x4)[_0xa80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xa80f('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'comment':_0xa80f('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa80f('0xf')},'dialTimezone':{'type':Sequelize[_0xa80f('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa80f('0x1')],'defaultValue':_0xa80f('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0xa80f('0x3')]('always',_0xa80f('0x11'),_0xa80f('0x12')),'defaultValue':_0xa80f('0x13')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xa80f('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa80f('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xa80f('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa80f('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa80f('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa80f('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa80f('0x6')](0x9)[_0xa80f('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa80f('0x3')](_0xa80f('0x19'),'ASC'),'defaultValue':_0xa80f('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa80f('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa80f('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)[_0xa80f('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xa80f('0x6')](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa80f('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xa80f('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa80f('0x21')}};
\ No newline at end of file
+var _0xdd72=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','#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','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time'];(function(_0x20d5ea,_0x293bec){var _0x58d095=function(_0x1828ea){while(--_0x1828ea){_0x20d5ea['push'](_0x20d5ea['shift']());}};_0x58d095(++_0x293bec);}(_0xdd72,0xb4));var _0x2dd7=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xdd72[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x2dd7('0x0'));module[_0x2dd7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2dd7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2dd7('0x3')](_0x2dd7('0x4')),'allowNull':![],'defaultValue':_0x2dd7('0x4')},'description':{'type':Sequelize[_0x2dd7('0x5')]},'active':{'type':Sequelize[_0x2dd7('0x6')],'defaultValue':0x0,'comment':_0x2dd7('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2dd7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2dd7('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2dd7('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'comment':_0x2dd7('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2dd7('0x10')},'dialTimezone':{'type':Sequelize[_0x2dd7('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2dd7('0x5')],'defaultValue':_0x2dd7('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x2dd7('0x3')](_0x2dd7('0x12'),'never','onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2dd7('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2dd7('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2dd7('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2dd7('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2dd7('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2dd7('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2dd7('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2dd7('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2dd7('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2dd7('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2dd7('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2dd7('0x9')](0x9)[_0x2dd7('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2dd7('0x3')]('DESC','ASC'),'defaultValue':_0x2dd7('0x1b')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2dd7('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2dd7('0x20')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)[_0x2dd7('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2dd7('0x9')](0x3)[_0x2dd7('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2dd7('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2dd7('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
index c0142c6..152ede9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1724=['createdAt','body','updatedAt','user','role','UserProfileSection','userProfileId','getHoppers','CmHopper','CampaignId','findOne','CmHopperHistory','nolimit','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','always','insert','cm_hopper','phone','scheduledAt','select','NOW()','field','ContactId','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','fromQuery','OrderBy','ci.OrderBY','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','all','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','find','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone'];(function(_0x49dfe3,_0x5fb8f){var _0xb2a3ec=function(_0x3af028){while(--_0x3af028){_0x49dfe3['push'](_0x49dfe3['shift']());}};_0xb2a3ec(++_0x5fb8f);}(_0x1724,0xca));var _0x4172=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x1724[_0x24237f];return _0x48298e;};'use strict';var emlformat=require(_0x4172('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4172('0x1'));var jsonpatch=require(_0x4172('0x2'));var rp=require(_0x4172('0x3'));var moment=require('moment');var BPromise=require(_0x4172('0x4'));var Mustache=require('mustache');var util=require(_0x4172('0x5'));var path=require(_0x4172('0x6'));var sox=require(_0x4172('0x7'));var csv=require(_0x4172('0x8'));var ejs=require(_0x4172('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4172('0xa'));var squel=require(_0x4172('0xb'));var crypto=require('crypto');var jsforce=require(_0x4172('0xc'));var deskjs=require(_0x4172('0xd'));var toCsv=require(_0x4172('0x8'));var querystring=require(_0x4172('0xe'));var Papa=require(_0x4172('0xf'));var Redis=require(_0x4172('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4172('0x11'));var as=require(_0x4172('0x12'));var hardwareService=require(_0x4172('0x13'));var logger=require(_0x4172('0x14'))(_0x4172('0x15'));var utils=require(_0x4172('0x16'));var config=require(_0x4172('0x17'));var licenseUtil=require(_0x4172('0x18'));var db=require(_0x4172('0x19'))['db'];function respondWithStatusCode(_0x2d5e1b,_0x403c17){_0x403c17=_0x403c17||0xcc;return function(_0xdac044){if(_0xdac044){return _0x2d5e1b[_0x4172('0x1a')](_0x403c17);}return _0x2d5e1b['status'](_0x403c17)['end']();};}function respondWithResult(_0x1d41e3,_0x3b5ccd){_0x3b5ccd=_0x3b5ccd||0xc8;return function(_0x5c83de){if(_0x5c83de){return _0x1d41e3[_0x4172('0x1b')](_0x3b5ccd)[_0x4172('0x1c')](_0x5c83de);}};}function respondWithFilteredResult(_0x34a3f3,_0x21e990){return function(_0xf7f7df){if(_0xf7f7df){var _0x4a0b4e=typeof _0x21e990[_0x4172('0x1d')]===_0x4172('0x1e')&&typeof _0x21e990['limit']===_0x4172('0x1e');var _0x3a505d=_0xf7f7df[_0x4172('0x1f')];var _0x594a77=_0x4a0b4e?0x0:_0x21e990['offset'];var _0x3840c3=_0x4a0b4e?_0xf7f7df['count']:_0x21e990[_0x4172('0x1d')]+_0x21e990[_0x4172('0x20')];var _0x16cb53;if(_0x3840c3>=_0x3a505d){_0x3840c3=_0x3a505d;_0x16cb53=0xc8;}else{_0x16cb53=0xce;}_0x34a3f3[_0x4172('0x1b')](_0x16cb53);return _0x34a3f3[_0x4172('0x21')](_0x4172('0x22'),_0x594a77+'-'+_0x3840c3+'/'+_0x3a505d)['json'](_0xf7f7df);}return null;};}function patchUpdates(_0x560c32){return function(_0x4dd773){try{jsonpatch[_0x4172('0x23')](_0x4dd773,_0x560c32,!![]);}catch(_0xb6f7f2){return BPromise['reject'](_0xb6f7f2);}return _0x4dd773['save']();};}function saveUpdates(_0xfa0157,_0x29b01a){return function(_0x1a5667){if(_0x1a5667){return _0x1a5667[_0x4172('0x24')](_0xfa0157)[_0x4172('0x25')](function(_0x2924de){return _0x2924de;});}return null;};}function removeEntity(_0x38a941,_0x2c393f){return function(_0x5e90a4){if(_0x5e90a4){return _0x5e90a4[_0x4172('0x26')]()[_0x4172('0x25')](function(){var _0xe276e=_0x5e90a4['get']({'plain':!![]});var _0x33b36b=_0x4172('0x27');return db[_0x4172('0x28')][_0x4172('0x26')]({'where':{'type':_0x33b36b,'resourceId':_0xe276e['id']}})[_0x4172('0x25')](function(){return _0x5e90a4;});})[_0x4172('0x25')](function(){_0x38a941[_0x4172('0x1b')](0xcc)[_0x4172('0x29')]();});}};}function handleEntityNotFound(_0xc758a2,_0x469893){return function(_0x21b175){if(!_0x21b175){_0xc758a2[_0x4172('0x1a')](0x194);}return _0x21b175;};}function handleError(_0x455ec6,_0x29b59d){_0x29b59d=_0x29b59d||0x1f4;return function(_0x5f090d){logger[_0x4172('0x2a')](_0x5f090d[_0x4172('0x2b')]);if(_0x5f090d[_0x4172('0x2c')]){delete _0x5f090d[_0x4172('0x2c')];}_0x455ec6[_0x4172('0x1b')](_0x29b59d)[_0x4172('0x2d')](_0x5f090d);};}exports[_0x4172('0x2e')]=function(_0x5c7877,_0x30ed4e){var _0x2f6ece={},_0x43c40b={},_0x32929a={'count':0x0,'rows':[]};var _0x5cbd60=_[_0x4172('0x2f')](db[_0x4172('0x30')][_0x4172('0x31')],function(_0x4a40c6){return{'name':_0x4a40c6['fieldName'],'type':_0x4a40c6[_0x4172('0x32')]['key']};});_0x43c40b[_0x4172('0x33')]=_['map'](_0x5cbd60,_0x4172('0x2c'));_0x43c40b[_0x4172('0x34')]=_[_0x4172('0x35')](_0x5c7877[_0x4172('0x34')]);_0x43c40b[_0x4172('0x36')]=_[_0x4172('0x37')](_0x43c40b[_0x4172('0x33')],_0x43c40b['query']);_0x2f6ece['attributes']=_[_0x4172('0x37')](_0x43c40b[_0x4172('0x33')],qs[_0x4172('0x38')](_0x5c7877[_0x4172('0x34')]['fields']));_0x2f6ece[_0x4172('0x39')]=_0x2f6ece['attributes'][_0x4172('0x3a')]?_0x2f6ece[_0x4172('0x39')]:_0x43c40b[_0x4172('0x33')];if(!_0x5c7877[_0x4172('0x34')][_0x4172('0x3b')]('nolimit')){_0x2f6ece[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x5c7877[_0x4172('0x34')]['limit']);_0x2f6ece['offset']=qs[_0x4172('0x1d')](_0x5c7877[_0x4172('0x34')]['offset']);}_0x2f6ece[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x5c7877[_0x4172('0x34')]['sort']);_0x2f6ece[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x5c7877['query'],_0x43c40b[_0x4172('0x36')]),_0x5cbd60);if(_0x5c7877[_0x4172('0x34')][_0x4172('0x40')]){_0x2f6ece[_0x4172('0x3e')]=_['merge'](_0x2f6ece['where'],{'$or':_[_0x4172('0x2f')](_0x5cbd60,function(_0x382363){if(_0x382363[_0x4172('0x32')]!=='VIRTUAL'){var _0x24f1fa={};_0x24f1fa[_0x382363[_0x4172('0x2c')]]={'$like':'%'+_0x5c7877[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x24f1fa;}})});}_0x2f6ece=_[_0x4172('0x41')]({},_0x2f6ece,_0x5c7877[_0x4172('0x42')]);var _0xc1b7dc={'where':_0x2f6ece[_0x4172('0x3e')]};return db[_0x4172('0x30')][_0x4172('0x1f')](_0xc1b7dc)[_0x4172('0x25')](function(_0x26741b){_0x32929a[_0x4172('0x1f')]=_0x26741b;if(_0x5c7877[_0x4172('0x34')][_0x4172('0x43')]){_0x2f6ece[_0x4172('0x44')]=[{'all':!![]}];}return db[_0x4172('0x30')][_0x4172('0x45')](_0x2f6ece);})['then'](function(_0x21b37a){_0x32929a[_0x4172('0x46')]=_0x21b37a;return _0x32929a;})[_0x4172('0x25')](respondWithFilteredResult(_0x30ed4e,_0x2f6ece))['catch'](handleError(_0x30ed4e,null));};exports['show']=function(_0x4bb948,_0x53dc70){var _0x2290b5={'raw':![],'where':{'id':_0x4bb948[_0x4172('0x47')]['id']}},_0x17f62e={};_0x17f62e['model']=_[_0x4172('0x35')](db[_0x4172('0x30')][_0x4172('0x31')]);_0x17f62e[_0x4172('0x34')]=_[_0x4172('0x35')](_0x4bb948[_0x4172('0x34')]);_0x17f62e[_0x4172('0x36')]=_['intersection'](_0x17f62e['model'],_0x17f62e[_0x4172('0x34')]);_0x2290b5['attributes']=_[_0x4172('0x37')](_0x17f62e[_0x4172('0x33')],qs['fields'](_0x4bb948[_0x4172('0x34')][_0x4172('0x38')]));_0x2290b5['attributes']=_0x2290b5[_0x4172('0x39')][_0x4172('0x3a')]?_0x2290b5[_0x4172('0x39')]:_0x17f62e[_0x4172('0x33')];if(_0x4bb948[_0x4172('0x34')]['includeAll']){_0x2290b5[_0x4172('0x44')]=[{'all':!![]}];}_0x2290b5=_[_0x4172('0x41')]({},_0x2290b5,_0x4bb948[_0x4172('0x42')]);return db[_0x4172('0x30')][_0x4172('0x48')](_0x2290b5)[_0x4172('0x25')](handleEntityNotFound(_0x53dc70,null))['then'](respondWithResult(_0x53dc70,null))['catch'](handleError(_0x53dc70,null));};exports['create']=function(_0x11ec87,_0xcf6937){return db[_0x4172('0x30')]['create'](_0x11ec87['body'],{})['then'](function(_0x3d9043){var _0x4904eb=_0x11ec87['user'][_0x4172('0x49')]({'plain':!![]});if(!_0x4904eb)throw new Error(_0x4172('0x4a'));if(_0x4904eb['role']==='user'){var _0x5e3e78=_0x3d9043['get']({'plain':!![]});var _0x25aece=_0x4172('0x27');return db['UserProfileSection'][_0x4172('0x48')]({'where':{'name':_0x25aece,'userProfileId':_0x4904eb['userProfileId']},'raw':!![]})[_0x4172('0x25')](function(_0x3c4db8){if(_0x3c4db8&&_0x3c4db8[_0x4172('0x4b')]===0x0){return db['UserProfileResource'][_0x4172('0x4c')]({'name':_0x5e3e78[_0x4172('0x2c')],'resourceId':_0x5e3e78['id'],'type':_0x3c4db8[_0x4172('0x2c')],'sectionId':_0x3c4db8['id']},{})['then'](function(){return _0x3d9043;});}else{return _0x3d9043;}})['catch'](function(_0x44bee6){logger[_0x4172('0x2a')](_0x4172('0x4d'),_0x44bee6);throw _0x44bee6;});}return _0x3d9043;})[_0x4172('0x25')](respondWithResult(_0xcf6937,0xc9))[_0x4172('0x4e')](handleError(_0xcf6937,null));};exports[_0x4172('0x4f')]=function(_0x5c80c0,_0x356ec4){var _0xd7568={'where':{'id':_0x5c80c0[_0x4172('0x47')]['id']}},_0xf25cd4={};_0xf25cd4['model']=_[_0x4172('0x35')](db['Campaign'][_0x4172('0x31')]);_0xd7568[_0x4172('0x39')]=_[_0x4172('0x37')](_0xf25cd4[_0x4172('0x33')],qs[_0x4172('0x38')](_0x5c80c0[_0x4172('0x34')][_0x4172('0x38')]));_0xd7568[_0x4172('0x39')]=_0xd7568[_0x4172('0x39')][_0x4172('0x3a')]?_0xd7568[_0x4172('0x39')]:_0xf25cd4[_0x4172('0x33')];if(_0x5c80c0[_0x4172('0x34')][_0x4172('0x43')]){_0xd7568[_0x4172('0x44')]=[{'all':!![]}];}_0xd7568=_[_0x4172('0x41')]({},_0xd7568,_0x5c80c0[_0x4172('0x42')]);return db[_0x4172('0x30')][_0x4172('0x48')](_0xd7568)[_0x4172('0x25')](handleEntityNotFound(_0x356ec4,null))[_0x4172('0x25')](function(_0x4903b3){if(_0x4903b3){var _0x161312=_0x4903b3['get']({'plain':!![]});_0x161312=qs['omit'](_0x161312,['id',_0x4172('0x50'),'updatedAt']);_0x5c80c0['body']=_['omit'](_0x5c80c0[_0x4172('0x51')],['id','createdAt',_0x4172('0x52')]);return db[_0x4172('0x30')][_0x4172('0x4c')](_['merge'](_0x161312,_0x5c80c0['body']),{'include':_0x5c80c0[_0x4172('0x34')]['includeAll']?[{'all':!![]}]:undefined})[_0x4172('0x25')](function(_0x1c615b){var _0x5d085c=_0x5c80c0[_0x4172('0x53')][_0x4172('0x49')]({'plain':!![]});if(!_0x5d085c)throw new Error(_0x4172('0x4a'));if(_0x5d085c[_0x4172('0x54')]===_0x4172('0x53')){var _0xda1680=_0x1c615b[_0x4172('0x49')]({'plain':!![]});var _0x2a9a9c=_0x4172('0x27');return db[_0x4172('0x55')][_0x4172('0x48')]({'where':{'name':_0x2a9a9c,'userProfileId':_0x5d085c[_0x4172('0x56')]},'raw':!![]})[_0x4172('0x25')](function(_0x4e97c8){if(_0x4e97c8&&_0x4e97c8[_0x4172('0x4b')]===0x0){return db['UserProfileResource'][_0x4172('0x4c')]({'name':_0xda1680['name'],'resourceId':_0xda1680['id'],'type':_0x4e97c8[_0x4172('0x2c')],'sectionId':_0x4e97c8['id']},{})[_0x4172('0x25')](function(){return _0x1c615b;});}else{return _0x1c615b;}})[_0x4172('0x4e')](function(_0x2d82e8){logger[_0x4172('0x2a')](_0x4172('0x4d'),_0x2d82e8);throw _0x2d82e8;});}return _0x1c615b;});}})[_0x4172('0x25')](respondWithResult(_0x356ec4,0xc9))['catch'](handleError(_0x356ec4,null));};exports[_0x4172('0x24')]=function(_0x2f055f,_0xbe4ae4){if(_0x2f055f['body']['id']){delete _0x2f055f[_0x4172('0x51')]['id'];}return db['Campaign'][_0x4172('0x48')]({'where':{'id':_0x2f055f['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xbe4ae4,null))[_0x4172('0x25')](saveUpdates(_0x2f055f[_0x4172('0x51')],null))[_0x4172('0x25')](respondWithResult(_0xbe4ae4,null))[_0x4172('0x4e')](handleError(_0xbe4ae4,null));};exports[_0x4172('0x26')]=function(_0x56461b,_0x291c7f){return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x56461b['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x291c7f,null))['then'](removeEntity(_0x291c7f,null))[_0x4172('0x4e')](handleError(_0x291c7f,null));};exports[_0x4172('0x57')]=function(_0x3b8303,_0xf4ed1b,_0x2a2faf){var _0x5a459e={'raw':!![],'where':{}};var _0x11fa24={};var _0x514f64={'count':0x0,'rows':[]};return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x3b8303['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xf4ed1b,null))[_0x4172('0x25')](function(_0x2ef626){if(_0x2ef626){_0x11fa24['model']=_[_0x4172('0x35')](db[_0x4172('0x58')][_0x4172('0x31')]);_0x11fa24['query']=_[_0x4172('0x35')](_0x3b8303[_0x4172('0x34')]);_0x11fa24[_0x4172('0x36')]=_[_0x4172('0x37')](_0x11fa24[_0x4172('0x33')],_0x11fa24[_0x4172('0x34')]);_0x5a459e['attributes']=_[_0x4172('0x37')](_0x11fa24[_0x4172('0x33')],qs['fields'](_0x3b8303[_0x4172('0x34')]['fields']));_0x5a459e['attributes']=_0x5a459e[_0x4172('0x39')][_0x4172('0x3a')]?_0x5a459e[_0x4172('0x39')]:_0x11fa24['model'];if(!_0x3b8303['query'][_0x4172('0x3b')]('nolimit')){_0x5a459e['limit']=qs[_0x4172('0x20')](_0x3b8303[_0x4172('0x34')][_0x4172('0x20')]);_0x5a459e[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0x3b8303['query'][_0x4172('0x1d')]);}_0x5a459e[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x3b8303[_0x4172('0x34')]['sort']);_0x5a459e[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x3b8303[_0x4172('0x34')],_0x11fa24[_0x4172('0x36')]));_0x5a459e[_0x4172('0x3e')][_0x4172('0x59')]=_0x2ef626['id'];if(_0x3b8303[_0x4172('0x34')]['filter']){_0x5a459e[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x5a459e['where'],{'$or':_[_0x4172('0x2f')](_0x5a459e[_0x4172('0x39')],function(_0x10d0a1){var _0x597db7={};_0x597db7[_0x10d0a1]={'$like':'%'+_0x3b8303[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x597db7;})});}_0x5a459e=_[_0x4172('0x41')]({},_0x5a459e,_0x3b8303[_0x4172('0x42')]);return db['CmHopper'][_0x4172('0x1f')]({'where':_0x5a459e[_0x4172('0x3e')]})['then'](function(_0x4d54e0){_0x514f64[_0x4172('0x1f')]=_0x4d54e0;if(_0x3b8303[_0x4172('0x34')][_0x4172('0x43')]){_0x5a459e[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopper'][_0x4172('0x45')](_0x5a459e);})[_0x4172('0x25')](function(_0x5ca8b5){_0x514f64['rows']=_0x5ca8b5;return _0x514f64;});}})['then'](respondWithFilteredResult(_0xf4ed1b,_0x5a459e))[_0x4172('0x4e')](handleError(_0xf4ed1b,null));};exports['getHopperHistories']=function(_0xd3010b,_0x283194,_0x45204f){var _0x368ce8={'raw':!![],'where':{}};var _0xf6f3c9={};var _0x1b8355={'count':0x0,'rows':[]};return db['Campaign'][_0x4172('0x5a')]({'where':{'id':_0xd3010b[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x283194,null))[_0x4172('0x25')](function(_0xf7d2c7){if(_0xf7d2c7){_0xf6f3c9[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5b')][_0x4172('0x31')]);_0xf6f3c9[_0x4172('0x34')]=_[_0x4172('0x35')](_0xd3010b[_0x4172('0x34')]);_0xf6f3c9['filters']=_[_0x4172('0x37')](_0xf6f3c9[_0x4172('0x33')],_0xf6f3c9['query']);_0x368ce8[_0x4172('0x39')]=_['intersection'](_0xf6f3c9[_0x4172('0x33')],qs[_0x4172('0x38')](_0xd3010b[_0x4172('0x34')][_0x4172('0x38')]));_0x368ce8[_0x4172('0x39')]=_0x368ce8['attributes'][_0x4172('0x3a')]?_0x368ce8['attributes']:_0xf6f3c9[_0x4172('0x33')];if(!_0xd3010b[_0x4172('0x34')][_0x4172('0x3b')](_0x4172('0x5c'))){_0x368ce8[_0x4172('0x20')]=qs[_0x4172('0x20')](_0xd3010b[_0x4172('0x34')][_0x4172('0x20')]);_0x368ce8[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0xd3010b[_0x4172('0x34')][_0x4172('0x1d')]);}_0x368ce8[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0xd3010b[_0x4172('0x34')][_0x4172('0x3d')]);_0x368ce8['where']=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0xd3010b[_0x4172('0x34')],_0xf6f3c9[_0x4172('0x36')]));_0x368ce8['where']['CampaignId']=_0xf7d2c7['id'];if(_0xd3010b['query'][_0x4172('0x40')]){_0x368ce8[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x368ce8['where'],{'$or':_[_0x4172('0x2f')](_0x368ce8[_0x4172('0x39')],function(_0x49b5e9){var _0x3f18ba={};_0x3f18ba[_0x49b5e9]={'$like':'%'+_0xd3010b['query'][_0x4172('0x40')]+'%'};return _0x3f18ba;})});}_0x368ce8=_[_0x4172('0x41')]({},_0x368ce8,_0xd3010b[_0x4172('0x42')]);return db['CmHopperHistory'][_0x4172('0x1f')]({'where':_0x368ce8[_0x4172('0x3e')]})[_0x4172('0x25')](function(_0x47b6df){_0x1b8355[_0x4172('0x1f')]=_0x47b6df;if(_0xd3010b['query'][_0x4172('0x43')]){_0x368ce8[_0x4172('0x44')]=[{'all':!![]}];}return db[_0x4172('0x5b')][_0x4172('0x45')](_0x368ce8);})[_0x4172('0x25')](function(_0x36d994){_0x1b8355['rows']=_0x36d994;return _0x1b8355;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x283194,_0x368ce8))['catch'](handleError(_0x283194,null));};exports['getHopperFinals']=function(_0x5039c1,_0x386003,_0x41d473){var _0x384ccd={'raw':!![],'where':{}};var _0x52b15c={};var _0x24ee32={'count':0x0,'rows':[]};return db[_0x4172('0x30')][_0x4172('0x5a')]({'where':{'id':_0x5039c1[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x386003,null))[_0x4172('0x25')](function(_0x41c25d){if(_0x41c25d){_0x52b15c[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5d')][_0x4172('0x31')]);_0x52b15c[_0x4172('0x34')]=_[_0x4172('0x35')](_0x5039c1[_0x4172('0x34')]);_0x52b15c[_0x4172('0x36')]=_['intersection'](_0x52b15c[_0x4172('0x33')],_0x52b15c[_0x4172('0x34')]);_0x384ccd[_0x4172('0x39')]=_[_0x4172('0x37')](_0x52b15c['model'],qs[_0x4172('0x38')](_0x5039c1[_0x4172('0x34')][_0x4172('0x38')]));_0x384ccd['attributes']=_0x384ccd[_0x4172('0x39')][_0x4172('0x3a')]?_0x384ccd[_0x4172('0x39')]:_0x52b15c[_0x4172('0x33')];if(!_0x5039c1['query'][_0x4172('0x3b')](_0x4172('0x5c'))){_0x384ccd['limit']=qs[_0x4172('0x20')](_0x5039c1['query'][_0x4172('0x20')]);_0x384ccd['offset']=qs['offset'](_0x5039c1['query'][_0x4172('0x1d')]);}_0x384ccd['order']=qs[_0x4172('0x3d')](_0x5039c1['query']['sort']);_0x384ccd['where']=qs['filters'](_[_0x4172('0x3f')](_0x5039c1[_0x4172('0x34')],_0x52b15c[_0x4172('0x36')]));_0x384ccd[_0x4172('0x3e')][_0x4172('0x59')]=_0x41c25d['id'];if(_0x5039c1[_0x4172('0x34')][_0x4172('0x40')]){_0x384ccd[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x384ccd[_0x4172('0x3e')],{'$or':_[_0x4172('0x2f')](_0x384ccd['attributes'],function(_0x3b7770){var _0x230335={};_0x230335[_0x3b7770]={'$like':'%'+_0x5039c1['query'][_0x4172('0x40')]+'%'};return _0x230335;})});}_0x384ccd=_[_0x4172('0x41')]({},_0x384ccd,_0x5039c1[_0x4172('0x42')]);return db[_0x4172('0x5d')][_0x4172('0x1f')]({'where':_0x384ccd[_0x4172('0x3e')]})['then'](function(_0x36cd5f){_0x24ee32[_0x4172('0x1f')]=_0x36cd5f;if(_0x5039c1[_0x4172('0x34')]['includeAll']){_0x384ccd[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x4172('0x45')](_0x384ccd);})['then'](function(_0x4989d6){_0x24ee32[_0x4172('0x46')]=_0x4989d6;return _0x24ee32;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x386003,_0x384ccd))[_0x4172('0x4e')](handleError(_0x386003,null));};exports['getHopperBlacks']=function(_0x399886,_0x5be83a,_0x559016){var _0x513b42={'raw':!![],'where':{}};var _0x9ca7d8={};var _0x3bcebc={'count':0x0,'rows':[]};return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x399886['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x5be83a,null))[_0x4172('0x25')](function(_0x2f6173){if(_0x2f6173){_0x9ca7d8[_0x4172('0x33')]=_[_0x4172('0x35')](db['CmHopperBlack']['rawAttributes']);_0x9ca7d8[_0x4172('0x34')]=_[_0x4172('0x35')](_0x399886[_0x4172('0x34')]);_0x9ca7d8[_0x4172('0x36')]=_[_0x4172('0x37')](_0x9ca7d8[_0x4172('0x33')],_0x9ca7d8[_0x4172('0x34')]);_0x513b42['attributes']=_[_0x4172('0x37')](_0x9ca7d8[_0x4172('0x33')],qs[_0x4172('0x38')](_0x399886[_0x4172('0x34')][_0x4172('0x38')]));_0x513b42[_0x4172('0x39')]=_0x513b42[_0x4172('0x39')][_0x4172('0x3a')]?_0x513b42['attributes']:_0x9ca7d8[_0x4172('0x33')];if(!_0x399886[_0x4172('0x34')][_0x4172('0x3b')](_0x4172('0x5c'))){_0x513b42[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x399886[_0x4172('0x34')][_0x4172('0x20')]);_0x513b42['offset']=qs['offset'](_0x399886[_0x4172('0x34')][_0x4172('0x1d')]);}_0x513b42[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x399886[_0x4172('0x34')][_0x4172('0x3d')]);_0x513b42['where']=qs['filters'](_[_0x4172('0x3f')](_0x399886[_0x4172('0x34')],_0x9ca7d8[_0x4172('0x36')]));_0x513b42[_0x4172('0x3e')][_0x4172('0x59')]=_0x2f6173['id'];if(_0x399886[_0x4172('0x34')][_0x4172('0x40')]){_0x513b42[_0x4172('0x3e')]=_[_0x4172('0x41')](_0x513b42[_0x4172('0x3e')],{'$or':_['map'](_0x513b42['attributes'],function(_0x1a64e9){var _0x3ee540={};_0x3ee540[_0x1a64e9]={'$like':'%'+_0x399886['query'][_0x4172('0x40')]+'%'};return _0x3ee540;})});}_0x513b42=_[_0x4172('0x41')]({},_0x513b42,_0x399886['options']);return db[_0x4172('0x5e')][_0x4172('0x1f')]({'where':_0x513b42[_0x4172('0x3e')]})['then'](function(_0x219d72){_0x3bcebc[_0x4172('0x1f')]=_0x219d72;if(_0x399886[_0x4172('0x34')][_0x4172('0x43')]){_0x513b42[_0x4172('0x44')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x513b42);})[_0x4172('0x25')](function(_0x11d362){_0x3bcebc[_0x4172('0x46')]=_0x11d362;return _0x3bcebc;});}})[_0x4172('0x25')](respondWithFilteredResult(_0x5be83a,_0x513b42))[_0x4172('0x4e')](handleError(_0x5be83a,null));};exports['getLists']=function(_0x2aa463,_0x4f286a,_0x2a8900){var _0xed3181={};var _0xd800b9={};var _0x5268ee;var _0x3c9bc6;return db[_0x4172('0x30')]['findOne']({'where':{'id':_0x2aa463[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x4f286a,null))[_0x4172('0x25')](function(_0xc4abb6){if(_0xc4abb6){_0x5268ee=_0xc4abb6;_0xd800b9[_0x4172('0x33')]=_[_0x4172('0x35')](db[_0x4172('0x5f')][_0x4172('0x31')]);_0xd800b9[_0x4172('0x34')]=_[_0x4172('0x35')](_0x2aa463[_0x4172('0x34')]);_0xd800b9[_0x4172('0x36')]=_[_0x4172('0x37')](_0xd800b9[_0x4172('0x33')],_0xd800b9['query']);_0xed3181[_0x4172('0x39')]=_[_0x4172('0x37')](_0xd800b9[_0x4172('0x33')],qs[_0x4172('0x38')](_0x2aa463[_0x4172('0x34')][_0x4172('0x38')]));_0xed3181[_0x4172('0x39')]=_0xed3181[_0x4172('0x39')]['length']?_0xed3181[_0x4172('0x39')]:_0xd800b9[_0x4172('0x33')];_0xed3181[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x2aa463[_0x4172('0x34')][_0x4172('0x3d')]);_0xed3181[_0x4172('0x3e')]=qs[_0x4172('0x36')](_['pick'](_0x2aa463[_0x4172('0x34')],_0xd800b9['filters']));if(_0x2aa463['query'][_0x4172('0x40')]){_0xed3181[_0x4172('0x3e')]=_[_0x4172('0x41')](_0xed3181[_0x4172('0x3e')],{'$or':_[_0x4172('0x2f')](_0xed3181[_0x4172('0x39')],function(_0x1faf8f){var _0x7f0e75={};_0x7f0e75[_0x1faf8f]={'$like':'%'+_0x2aa463['query']['filter']+'%'};return _0x7f0e75;})});}_0xed3181=_[_0x4172('0x41')]({},_0xed3181,_0x2aa463[_0x4172('0x42')]);return _0x5268ee[_0x4172('0x60')](_0xed3181);}})[_0x4172('0x25')](function(_0x542f52){if(_0x542f52){_0x3c9bc6=_0x542f52['length'];if(!_0x2aa463['query'][_0x4172('0x3b')](_0x4172('0x5c'))){_0xed3181[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x2aa463[_0x4172('0x34')]['limit']);_0xed3181['offset']=qs[_0x4172('0x1d')](_0x2aa463[_0x4172('0x34')][_0x4172('0x1d')]);}return _0x5268ee[_0x4172('0x60')](_0xed3181);}})[_0x4172('0x25')](function(_0x33efe2){if(_0x33efe2){return _0x33efe2?{'count':_0x3c9bc6,'rows':_0x33efe2}:null;}})[_0x4172('0x25')](respondWithResult(_0x4f286a,null))[_0x4172('0x4e')](handleError(_0x4f286a,null));};exports[_0x4172('0x61')]=function(_0x4aa228,_0xcaa109,_0x15eab4){var _0x53fae5,_0x5a403d;var _0x28bba3=[];var _0x5401a1=moment()['format'](_0x4172('0x62'));return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x4aa228['params']['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xcaa109,null))[_0x4172('0x25')](function(_0x16e953){if(_0x16e953){_0x5a403d=_0x16e953;return _0x16e953[_0x4172('0x61')](_0x4aa228[_0x4172('0x51')][_0x4172('0x63')],_[_0x4172('0x64')](_0x4aa228[_0x4172('0x51')],['ids','id'])||{});}return null;})[_0x4172('0x65')](function(_0x18a354){var _0xc43191;var _0x1d7a76;_0x53fae5=_0x18a354||[];var _0x571455=[];if(_0x18a354){for(var _0x5b2030=0x0;_0x5b2030<_0x18a354[_0x4172('0x3a')];_0x5b2030+=0x1){var _0x43c6e3=_0x18a354[_0x5b2030][_0x4172('0x49')]({'plain':!![]});_0x5a403d[_0x4172('0x66')]=_0x4aa228['body'][_0x4172('0x66')]?_0x4aa228[_0x4172('0x51')][_0x4172('0x66')]:_0x5a403d[_0x4172('0x66')];switch(_0x5a403d[_0x4172('0x66')]){case _0x4172('0x67'):_0xc43191=squel[_0x4172('0x68')]()['into'](_0x4172('0x69'))['fromQuery']([_0x4172('0x6a'),_0x4172('0x6b'),'ContactId','ListId','CampaignId','createdAt',_0x4172('0x52')],squel[_0x4172('0x6c')]()['field']('phone',_0x4172('0x6a'))['field'](_0x4172('0x6d'),_0x4172('0x6b'))[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3[_0x4172('0x70')][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228['params']['id'][_0x4172('0x71')](),'CampaignId')['field']('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')](_0x4172('0x74'))[_0x4172('0x3e')](_0x4172('0x75'))[_0x4172('0x3e')](_0x4172('0x76'),_0x43c6e3['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x77'))[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()[_0x4172('0x6e')](_0x4172('0x79'))['from'](_0x4172('0x7a'))['where'](_0x4172('0x7b'),_0x4aa228['params']['id'][_0x4172('0x71')]()))[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()['field']('COALESCE(phone,\x27\x27)')[_0x4172('0x73')](_0x4172('0x69'))[_0x4172('0x3e')]('CampaignId\x20=\x20?',_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')]())))[_0x4172('0x71')]();break;case _0x4172('0x7c'):_0xc43191=squel['insert']()[_0x4172('0x7d')](_0x4172('0x69'))[_0x4172('0x7e')]([_0x4172('0x6a'),'scheduledAt',_0x4172('0x6f'),'ListId',_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel[_0x4172('0x6c')]()[_0x4172('0x6e')](_0x4172('0x6a'),_0x4172('0x6a'))['field'](_0x4172('0x6d'),_0x4172('0x6b'))[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3['CmListId'][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228['params']['id'][_0x4172('0x71')](),_0x4172('0x59'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27','createdAt')[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))['from'](_0x4172('0x74'))[_0x4172('0x3e')](_0x4172('0x75'))['where']('ListId\x20=\x20?',_0x43c6e3[_0x4172('0x70')]['toString']())[_0x4172('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x4172('0x3e')](_0x4172('0x78'),squel[_0x4172('0x6c')]()['field']('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x4172('0x7b'),_0x4aa228[_0x4172('0x47')]['id']['toString']())))[_0x4172('0x71')]();break;default:_0xc43191=squel[_0x4172('0x68')]()[_0x4172('0x7d')]('cm_hopper')[_0x4172('0x7e')]([_0x4172('0x6a'),_0x4172('0x6b'),_0x4172('0x6f'),'ListId',_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel['select']()[_0x4172('0x6e')](_0x4172('0x6a'),_0x4172('0x6a'))[_0x4172('0x6e')](_0x4172('0x6d'),'scheduledAt')[_0x4172('0x6e')]('id',_0x4172('0x6f'))[_0x4172('0x6e')](_0x43c6e3[_0x4172('0x70')][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')](),_0x4172('0x59'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x4172('0x3e')](_0x4172('0x76'),_0x43c6e3['CmListId'][_0x4172('0x71')]())[_0x4172('0x3e')](_0x4172('0x77')))['toString']();}_0x1d7a76=squel['insert']()[_0x4172('0x7d')]('cm_hopper_additional_phones')['fromQuery'](['cmHopperId','scheduledAt',_0x4172('0x6a'),_0x4172('0x7f'),'createdAt',_0x4172('0x52')],squel[_0x4172('0x6c')]()['field']('h.id','id')[_0x4172('0x6e')](_0x4172('0x6d'),'scheduledAt')[_0x4172('0x6e')]('ci.item','phone')['field'](_0x4172('0x80'),'OrderBy')['field']('\x27'+_0x5401a1+'\x27',_0x4172('0x50'))[_0x4172('0x6e')]('\x27'+_0x5401a1+'\x27',_0x4172('0x52'))[_0x4172('0x73')]('cm_contact_has_items','ci')['join']('cm_hopper','h',_0x4172('0x81'))[_0x4172('0x3e')](_0x4172('0x82'),_0x43c6e3['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x83'),_0x4aa228[_0x4172('0x47')]['id'][_0x4172('0x71')]())[_0x4172('0x3e')](_0x4172('0x84'),_0x5401a1))[_0x4172('0x71')]();_0x571455[_0x4172('0x85')](db['sequelize']['query'](_0xc43191));_0x28bba3['push'](db['sequelize'][_0x4172('0x34')](_0x1d7a76));}return BPromise['all'](_0x571455);}})[_0x4172('0x25')](function(){return BPromise['all'](_0x28bba3);})[_0x4172('0x25')](function(){return _0x53fae5;})['then'](respondWithResult(_0xcaa109,null))[_0x4172('0x4e')](handleError(_0xcaa109,null));};exports[_0x4172('0x86')]=function(_0x3bee17,_0x57a2fa,_0x20ca89){return db[_0x4172('0x30')]['find']({'where':{'id':_0x3bee17[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x57a2fa,null))[_0x4172('0x25')](function(_0x444b2a){if(_0x444b2a){return _0x444b2a[_0x4172('0x86')](_0x3bee17[_0x4172('0x34')][_0x4172('0x63')]);}})['then'](function(_0x3f1cd1){if(_0x3f1cd1){return db[_0x4172('0x58')][_0x4172('0x26')]({'where':{'ListId':_0x3bee17[_0x4172('0x34')]['ids'],'CampaignId':_0x3bee17['params']['id']}})[_0x4172('0x25')](function(){return _0x3f1cd1;});}})[_0x4172('0x25')](respondWithStatusCode(_0x57a2fa,null))[_0x4172('0x4e')](handleError(_0x57a2fa,null));};exports[_0x4172('0x87')]=function(_0x455e2e,_0xd6aeb3,_0x45433b){var _0x412f17={};var _0x1e92ba={};var _0x5a1750;var _0x110ff2;return db['Campaign'][_0x4172('0x5a')]({'where':{'id':_0x455e2e[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0xd6aeb3,null))[_0x4172('0x25')](function(_0x451021){if(_0x451021){_0x5a1750=_0x451021;_0x1e92ba[_0x4172('0x33')]=_['keys'](db[_0x4172('0x5f')][_0x4172('0x31')]);_0x1e92ba[_0x4172('0x34')]=_[_0x4172('0x35')](_0x455e2e[_0x4172('0x34')]);_0x1e92ba['filters']=_[_0x4172('0x37')](_0x1e92ba[_0x4172('0x33')],_0x1e92ba[_0x4172('0x34')]);_0x412f17[_0x4172('0x39')]=_[_0x4172('0x37')](_0x1e92ba[_0x4172('0x33')],qs[_0x4172('0x38')](_0x455e2e[_0x4172('0x34')][_0x4172('0x38')]));_0x412f17['attributes']=_0x412f17[_0x4172('0x39')][_0x4172('0x3a')]?_0x412f17[_0x4172('0x39')]:_0x1e92ba[_0x4172('0x33')];_0x412f17[_0x4172('0x3c')]=qs[_0x4172('0x3d')](_0x455e2e[_0x4172('0x34')][_0x4172('0x3d')]);_0x412f17[_0x4172('0x3e')]=qs[_0x4172('0x36')](_[_0x4172('0x3f')](_0x455e2e['query'],_0x1e92ba[_0x4172('0x36')]));if(_0x455e2e[_0x4172('0x34')][_0x4172('0x40')]){_0x412f17[_0x4172('0x3e')]=_['merge'](_0x412f17[_0x4172('0x3e')],{'$or':_['map'](_0x412f17[_0x4172('0x39')],function(_0x1e0490){var _0x409fe1={};_0x409fe1[_0x1e0490]={'$like':'%'+_0x455e2e[_0x4172('0x34')][_0x4172('0x40')]+'%'};return _0x409fe1;})});}_0x412f17=_[_0x4172('0x41')]({},_0x412f17,_0x455e2e[_0x4172('0x42')]);return _0x5a1750[_0x4172('0x87')](_0x412f17);}})[_0x4172('0x25')](function(_0x2722f6){if(_0x2722f6){_0x110ff2=_0x2722f6[_0x4172('0x3a')];if(!_0x455e2e['query']['hasOwnProperty'](_0x4172('0x5c'))){_0x412f17[_0x4172('0x20')]=qs[_0x4172('0x20')](_0x455e2e['query'][_0x4172('0x20')]);_0x412f17[_0x4172('0x1d')]=qs[_0x4172('0x1d')](_0x455e2e[_0x4172('0x34')][_0x4172('0x1d')]);}return _0x5a1750[_0x4172('0x87')](_0x412f17);}})['then'](function(_0x5b14b7){if(_0x5b14b7){return _0x5b14b7?{'count':_0x110ff2,'rows':_0x5b14b7}:null;}})[_0x4172('0x25')](respondWithResult(_0xd6aeb3,null))[_0x4172('0x4e')](handleError(_0xd6aeb3,null));};exports['addBlackLists']=function(_0x22f1d3,_0x48101a,_0x3ef8c8){var _0x723ab7,_0x2dc7db;var _0x4c0d76=[];var _0x156a10=moment()['format'](_0x4172('0x62'));return db['Campaign'][_0x4172('0x48')]({'where':{'id':_0x22f1d3[_0x4172('0x47')]['id']}})[_0x4172('0x25')](handleEntityNotFound(_0x48101a,null))['then'](function(_0x2342e7){if(_0x2342e7){_0x2dc7db=_0x2342e7;return _0x2342e7[_0x4172('0x88')](_0x22f1d3[_0x4172('0x51')][_0x4172('0x63')],_['omit'](_0x22f1d3[_0x4172('0x51')],['ids','id'])||{});}return null;})[_0x4172('0x65')](function(_0x308d0d){var _0x32a8f1;var _0x55f493;_0x723ab7=_0x308d0d||[];var _0x469ef6=[];if(_0x308d0d){for(var _0x3ba3f6=0x0;_0x3ba3f6<_0x308d0d['length'];_0x3ba3f6+=0x1){var _0x3770c2=_0x308d0d[_0x3ba3f6]['get']({'plain':!![]});_0x32a8f1=squel['insert']()[_0x4172('0x7d')](_0x4172('0x89'))['fromQuery']([_0x4172('0x6a'),'ContactId',_0x4172('0x72'),_0x4172('0x59'),_0x4172('0x50'),_0x4172('0x52')],squel[_0x4172('0x6c')]()['field'](_0x4172('0x6a'),_0x4172('0x6a'))[_0x4172('0x6e')]('id','ContactId')['field'](_0x3770c2['CmListId'][_0x4172('0x71')](),_0x4172('0x72'))[_0x4172('0x6e')](_0x22f1d3[_0x4172('0x47')]['id']['toString'](),'CampaignId')['field']('NOW()',_0x4172('0x50'))[_0x4172('0x6e')](_0x4172('0x6d'),'updatedAt')[_0x4172('0x73')]('cm_contacts')[_0x4172('0x3e')](_0x4172('0x75'))[_0x4172('0x3e')](_0x4172('0x76'),_0x3770c2['CmListId']['toString']())[_0x4172('0x3e')](_0x4172('0x77')))['toString']();_0x469ef6[_0x4172('0x85')](db[_0x4172('0x8a')][_0x4172('0x34')](_0x32a8f1));}return BPromise[_0x4172('0x8b')](_0x469ef6);}})[_0x4172('0x25')](function(){return _0x723ab7;})[_0x4172('0x25')](respondWithResult(_0x48101a,null))[_0x4172('0x4e')](handleError(_0x48101a,null));};exports[_0x4172('0x8c')]=function(_0x42ceba,_0x73accd,_0x3e024b){return db[_0x4172('0x30')][_0x4172('0x48')]({'where':{'id':_0x42ceba[_0x4172('0x47')]['id']}})['then'](handleEntityNotFound(_0x73accd,null))[_0x4172('0x25')](function(_0x14df57){if(_0x14df57){return _0x14df57[_0x4172('0x8c')](_0x42ceba[_0x4172('0x34')][_0x4172('0x63')]);}})[_0x4172('0x25')](function(_0x3c57c6){if(_0x3c57c6){return db[_0x4172('0x5e')]['destroy']({'where':{'ListId':_0x42ceba[_0x4172('0x34')]['ids'],'CampaignId':_0x42ceba[_0x4172('0x47')]['id']}})[_0x4172('0x25')](function(){return _0x3c57c6;});}})[_0x4172('0x25')](respondWithStatusCode(_0x73accd,null))[_0x4172('0x4e')](handleError(_0x73accd,null));};
\ No newline at end of file
+var _0x7b08=['findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','ContactId','ListId','phone','field','scheduledAt','CmListId','toString','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','select','NOW()','cm_contacts','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','h.id','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','sequelize','push','all','removeLists','addBlackLists','format','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','map','Campaign','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','filter','options','findAll','rows','catch','show','params','includeAll','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','getHoppers'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7b08,0x163));var _0x87b0=function(_0x1e0104,_0x5f3de8){_0x1e0104=_0x1e0104-0x0;var _0x4309aa=_0x7b08[_0x1e0104];return _0x4309aa;};'use strict';var emlformat=require(_0x87b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x87b0('0x1'));var jsonpatch=require(_0x87b0('0x2'));var rp=require(_0x87b0('0x3'));var moment=require('moment');var BPromise=require(_0x87b0('0x4'));var Mustache=require(_0x87b0('0x5'));var util=require(_0x87b0('0x6'));var path=require(_0x87b0('0x7'));var sox=require('sox');var csv=require(_0x87b0('0x8'));var ejs=require(_0x87b0('0x9'));var fs=require('fs');var fs_extra=require(_0x87b0('0xa'));var _=require(_0x87b0('0xb'));var squel=require(_0x87b0('0xc'));var crypto=require(_0x87b0('0xd'));var jsforce=require(_0x87b0('0xe'));var deskjs=require(_0x87b0('0xf'));var toCsv=require(_0x87b0('0x8'));var querystring=require(_0x87b0('0x10'));var Papa=require('papaparse');var Redis=require(_0x87b0('0x11'));var authService=require(_0x87b0('0x12'));var qs=require(_0x87b0('0x13'));var as=require(_0x87b0('0x14'));var hardwareService=require(_0x87b0('0x15'));var logger=require(_0x87b0('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x87b0('0x17'));var licenseUtil=require(_0x87b0('0x18'));var db=require(_0x87b0('0x19'))['db'];function respondWithStatusCode(_0x4ab82c,_0x11cc41){_0x11cc41=_0x11cc41||0xcc;return function(_0x417b8e){if(_0x417b8e){return _0x4ab82c['sendStatus'](_0x11cc41);}return _0x4ab82c[_0x87b0('0x1a')](_0x11cc41)[_0x87b0('0x1b')]();};}function respondWithResult(_0x567f17,_0x525195){_0x525195=_0x525195||0xc8;return function(_0x1f44b6){if(_0x1f44b6){return _0x567f17['status'](_0x525195)['json'](_0x1f44b6);}};}function respondWithFilteredResult(_0x5880a4,_0xb802c6){return function(_0x32b53b){if(_0x32b53b){var _0x47b023=typeof _0xb802c6[_0x87b0('0x1c')]===_0x87b0('0x1d')&&typeof _0xb802c6[_0x87b0('0x1e')]===_0x87b0('0x1d');var _0x2960ec=_0x32b53b[_0x87b0('0x1f')];var _0x27bf79=_0x47b023?0x0:_0xb802c6[_0x87b0('0x1c')];var _0xb9fca8=_0x47b023?_0x32b53b[_0x87b0('0x1f')]:_0xb802c6['offset']+_0xb802c6[_0x87b0('0x1e')];var _0x45c423;if(_0xb9fca8>=_0x2960ec){_0xb9fca8=_0x2960ec;_0x45c423=0xc8;}else{_0x45c423=0xce;}_0x5880a4['status'](_0x45c423);return _0x5880a4[_0x87b0('0x20')](_0x87b0('0x21'),_0x27bf79+'-'+_0xb9fca8+'/'+_0x2960ec)[_0x87b0('0x22')](_0x32b53b);}return null;};}function patchUpdates(_0x5c29e6){return function(_0x1fcaeb){try{jsonpatch[_0x87b0('0x23')](_0x1fcaeb,_0x5c29e6,!![]);}catch(_0x21924d){return BPromise[_0x87b0('0x24')](_0x21924d);}return _0x1fcaeb['save']();};}function saveUpdates(_0x2d1eba,_0xc1ec21){return function(_0x305b9d){if(_0x305b9d){return _0x305b9d[_0x87b0('0x25')](_0x2d1eba)[_0x87b0('0x26')](function(_0x37076f){return _0x37076f;});}return null;};}function removeEntity(_0xe1c9ff,_0x17a2d0){return function(_0x203e44){if(_0x203e44){return _0x203e44['destroy']()[_0x87b0('0x26')](function(){var _0x4a3bd5=_0x203e44[_0x87b0('0x27')]({'plain':!![]});var _0x464296='IvrCampaigns';return db[_0x87b0('0x28')][_0x87b0('0x29')]({'where':{'type':_0x464296,'resourceId':_0x4a3bd5['id']}})['then'](function(){return _0x203e44;});})['then'](function(){_0xe1c9ff[_0x87b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cb783,_0x3eb83e){return function(_0xf440b9){if(!_0xf440b9){_0x1cb783[_0x87b0('0x2a')](0x194);}return _0xf440b9;};}function handleError(_0x550e2a,_0x30fe04){_0x30fe04=_0x30fe04||0x1f4;return function(_0x31bd55){logger[_0x87b0('0x2b')](_0x31bd55[_0x87b0('0x2c')]);if(_0x31bd55[_0x87b0('0x2d')]){delete _0x31bd55[_0x87b0('0x2d')];}_0x550e2a[_0x87b0('0x1a')](_0x30fe04)[_0x87b0('0x2e')](_0x31bd55);};}exports['index']=function(_0x3d285b,_0x382f7d){var _0x4e159b={},_0x42e85c={},_0x226fdd={'count':0x0,'rows':[]};var _0x3298d8=_[_0x87b0('0x2f')](db[_0x87b0('0x30')][_0x87b0('0x31')],function(_0x3e17e1){return{'name':_0x3e17e1[_0x87b0('0x32')],'type':_0x3e17e1[_0x87b0('0x33')][_0x87b0('0x34')]};});_0x42e85c['model']=_[_0x87b0('0x2f')](_0x3298d8,_0x87b0('0x2d'));_0x42e85c[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x3d285b[_0x87b0('0x35')]);_0x42e85c['filters']=_['intersection'](_0x42e85c['model'],_0x42e85c['query']);_0x4e159b['attributes']=_[_0x87b0('0x37')](_0x42e85c[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x3d285b[_0x87b0('0x35')][_0x87b0('0x39')]));_0x4e159b['attributes']=_0x4e159b[_0x87b0('0x3a')]['length']?_0x4e159b[_0x87b0('0x3a')]:_0x42e85c['model'];if(!_0x3d285b[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x4e159b[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x3d285b[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4e159b[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0x3d285b[_0x87b0('0x35')]['offset']);}_0x4e159b[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x3d285b[_0x87b0('0x35')]['sort']);_0x4e159b[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x3d285b[_0x87b0('0x35')],_0x42e85c[_0x87b0('0x3f')]),_0x3298d8);if(_0x3d285b[_0x87b0('0x35')][_0x87b0('0x41')]){_0x4e159b[_0x87b0('0x3e')]=_['merge'](_0x4e159b[_0x87b0('0x3e')],{'$or':_['map'](_0x3298d8,function(_0x2fab47){if(_0x2fab47['type']!=='VIRTUAL'){var _0x51c53a={};_0x51c53a[_0x2fab47[_0x87b0('0x2d')]]={'$like':'%'+_0x3d285b[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x51c53a;}})});}_0x4e159b=_['merge']({},_0x4e159b,_0x3d285b[_0x87b0('0x42')]);var _0x3ce2a0={'where':_0x4e159b['where']};return db['Campaign'][_0x87b0('0x1f')](_0x3ce2a0)[_0x87b0('0x26')](function(_0x14b908){_0x226fdd[_0x87b0('0x1f')]=_0x14b908;if(_0x3d285b[_0x87b0('0x35')]['includeAll']){_0x4e159b['include']=[{'all':!![]}];}return db[_0x87b0('0x30')][_0x87b0('0x43')](_0x4e159b);})['then'](function(_0x220a02){_0x226fdd[_0x87b0('0x44')]=_0x220a02;return _0x226fdd;})[_0x87b0('0x26')](respondWithFilteredResult(_0x382f7d,_0x4e159b))[_0x87b0('0x45')](handleError(_0x382f7d,null));};exports[_0x87b0('0x46')]=function(_0x5415a4,_0x43cd60){var _0x351605={'raw':![],'where':{'id':_0x5415a4[_0x87b0('0x47')]['id']}},_0x389792={};_0x389792[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x30')][_0x87b0('0x31')]);_0x389792['query']=_[_0x87b0('0x36')](_0x5415a4[_0x87b0('0x35')]);_0x389792[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x389792[_0x87b0('0x38')],_0x389792[_0x87b0('0x35')]);_0x351605[_0x87b0('0x3a')]=_['intersection'](_0x389792[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x5415a4['query'][_0x87b0('0x39')]));_0x351605['attributes']=_0x351605['attributes']['length']?_0x351605[_0x87b0('0x3a')]:_0x389792[_0x87b0('0x38')];if(_0x5415a4['query'][_0x87b0('0x48')]){_0x351605[_0x87b0('0x49')]=[{'all':!![]}];}_0x351605=_[_0x87b0('0x4a')]({},_0x351605,_0x5415a4[_0x87b0('0x42')]);return db['Campaign'][_0x87b0('0x4b')](_0x351605)['then'](handleEntityNotFound(_0x43cd60,null))[_0x87b0('0x26')](respondWithResult(_0x43cd60,null))[_0x87b0('0x45')](handleError(_0x43cd60,null));};exports[_0x87b0('0x4c')]=function(_0x20a1ff,_0x110335){return db[_0x87b0('0x30')][_0x87b0('0x4c')](_0x20a1ff[_0x87b0('0x4d')],{})[_0x87b0('0x26')](function(_0x36b608){var _0x17f10e=_0x20a1ff[_0x87b0('0x4e')]['get']({'plain':!![]});if(!_0x17f10e)throw new Error(_0x87b0('0x4f'));if(_0x17f10e[_0x87b0('0x50')]===_0x87b0('0x4e')){var _0x32c1bd=_0x36b608[_0x87b0('0x27')]({'plain':!![]});var _0x472917=_0x87b0('0x51');return db[_0x87b0('0x52')][_0x87b0('0x4b')]({'where':{'name':_0x472917,'userProfileId':_0x17f10e[_0x87b0('0x53')]},'raw':!![]})[_0x87b0('0x26')](function(_0x13fed3){if(_0x13fed3&&_0x13fed3[_0x87b0('0x54')]===0x0){return db['UserProfileResource'][_0x87b0('0x4c')]({'name':_0x32c1bd[_0x87b0('0x2d')],'resourceId':_0x32c1bd['id'],'type':_0x13fed3[_0x87b0('0x2d')],'sectionId':_0x13fed3['id']},{})[_0x87b0('0x26')](function(){return _0x36b608;});}else{return _0x36b608;}})['catch'](function(_0x22d97c){logger[_0x87b0('0x2b')](_0x87b0('0x55'),_0x22d97c);throw _0x22d97c;});}return _0x36b608;})['then'](respondWithResult(_0x110335,0xc9))[_0x87b0('0x45')](handleError(_0x110335,null));};exports[_0x87b0('0x56')]=function(_0x85bdbe,_0x8a04e2){var _0x107397={'where':{'id':_0x85bdbe['params']['id']}},_0x5b645e={};_0x5b645e[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x30')][_0x87b0('0x31')]);_0x107397[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x5b645e[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x85bdbe['query'][_0x87b0('0x39')]));_0x107397[_0x87b0('0x3a')]=_0x107397[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x107397[_0x87b0('0x3a')]:_0x5b645e[_0x87b0('0x38')];if(_0x85bdbe[_0x87b0('0x35')][_0x87b0('0x48')]){_0x107397['include']=[{'all':!![]}];}_0x107397=_[_0x87b0('0x4a')]({},_0x107397,_0x85bdbe[_0x87b0('0x42')]);return db[_0x87b0('0x30')][_0x87b0('0x4b')](_0x107397)[_0x87b0('0x26')](handleEntityNotFound(_0x8a04e2,null))[_0x87b0('0x26')](function(_0x337844){if(_0x337844){var _0x152f72=_0x337844[_0x87b0('0x27')]({'plain':!![]});_0x152f72=qs[_0x87b0('0x58')](_0x152f72,['id',_0x87b0('0x59'),'updatedAt']);_0x85bdbe[_0x87b0('0x4d')]=_[_0x87b0('0x58')](_0x85bdbe['body'],['id',_0x87b0('0x59'),_0x87b0('0x5a')]);return db[_0x87b0('0x30')]['create'](_[_0x87b0('0x4a')](_0x152f72,_0x85bdbe[_0x87b0('0x4d')]),{'include':_0x85bdbe[_0x87b0('0x35')][_0x87b0('0x48')]?[{'all':!![]}]:undefined})[_0x87b0('0x26')](function(_0x451cb1){var _0x30f8ca=_0x85bdbe[_0x87b0('0x4e')][_0x87b0('0x27')]({'plain':!![]});if(!_0x30f8ca)throw new Error(_0x87b0('0x4f'));if(_0x30f8ca[_0x87b0('0x50')]===_0x87b0('0x4e')){var _0x5dfcc8=_0x451cb1[_0x87b0('0x27')]({'plain':!![]});var _0x55813c=_0x87b0('0x51');return db[_0x87b0('0x52')][_0x87b0('0x4b')]({'where':{'name':_0x55813c,'userProfileId':_0x30f8ca[_0x87b0('0x53')]},'raw':!![]})['then'](function(_0x4c6462){if(_0x4c6462&&_0x4c6462['autoAssociation']===0x0){return db['UserProfileResource'][_0x87b0('0x4c')]({'name':_0x5dfcc8[_0x87b0('0x2d')],'resourceId':_0x5dfcc8['id'],'type':_0x4c6462[_0x87b0('0x2d')],'sectionId':_0x4c6462['id']},{})['then'](function(){return _0x451cb1;});}else{return _0x451cb1;}})[_0x87b0('0x45')](function(_0x2edec2){logger['error'](_0x87b0('0x55'),_0x2edec2);throw _0x2edec2;});}return _0x451cb1;});}})[_0x87b0('0x26')](respondWithResult(_0x8a04e2,0xc9))[_0x87b0('0x45')](handleError(_0x8a04e2,null));};exports[_0x87b0('0x25')]=function(_0x337e75,_0x2d5615){if(_0x337e75['body']['id']){delete _0x337e75[_0x87b0('0x4d')]['id'];}return db[_0x87b0('0x30')]['find']({'where':{'id':_0x337e75[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x2d5615,null))[_0x87b0('0x26')](saveUpdates(_0x337e75[_0x87b0('0x4d')],null))[_0x87b0('0x26')](respondWithResult(_0x2d5615,null))[_0x87b0('0x45')](handleError(_0x2d5615,null));};exports[_0x87b0('0x29')]=function(_0x354692,_0x3645f3){return db[_0x87b0('0x30')]['find']({'where':{'id':_0x354692[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x3645f3,null))[_0x87b0('0x26')](removeEntity(_0x3645f3,null))[_0x87b0('0x45')](handleError(_0x3645f3,null));};exports[_0x87b0('0x5b')]=function(_0x2b7241,_0x46ad4b,_0x1db7a8){var _0x58ad46={'raw':!![],'where':{}};var _0x54d908={};var _0x541a43={'count':0x0,'rows':[]};return db['Campaign'][_0x87b0('0x5c')]({'where':{'id':_0x2b7241[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x46ad4b,null))[_0x87b0('0x26')](function(_0x3bd8a5){if(_0x3bd8a5){_0x54d908[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x5d')][_0x87b0('0x31')]);_0x54d908[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x2b7241[_0x87b0('0x35')]);_0x54d908[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x54d908[_0x87b0('0x38')],_0x54d908[_0x87b0('0x35')]);_0x58ad46[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x54d908[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x2b7241['query'][_0x87b0('0x39')]));_0x58ad46[_0x87b0('0x3a')]=_0x58ad46[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x58ad46[_0x87b0('0x3a')]:_0x54d908[_0x87b0('0x38')];if(!_0x2b7241[_0x87b0('0x35')][_0x87b0('0x5e')](_0x87b0('0x3b'))){_0x58ad46[_0x87b0('0x1e')]=qs['limit'](_0x2b7241['query'][_0x87b0('0x1e')]);_0x58ad46[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0x2b7241[_0x87b0('0x35')][_0x87b0('0x1c')]);}_0x58ad46[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x2b7241[_0x87b0('0x35')]['sort']);_0x58ad46['where']=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x2b7241[_0x87b0('0x35')],_0x54d908[_0x87b0('0x3f')]));_0x58ad46[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x3bd8a5['id'];if(_0x2b7241[_0x87b0('0x35')][_0x87b0('0x41')]){_0x58ad46[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x58ad46[_0x87b0('0x3e')],{'$or':_['map'](_0x58ad46[_0x87b0('0x3a')],function(_0x5846cc){var _0x5cc167={};_0x5cc167[_0x5846cc]={'$like':'%'+_0x2b7241['query']['filter']+'%'};return _0x5cc167;})});}_0x58ad46=_[_0x87b0('0x4a')]({},_0x58ad46,_0x2b7241[_0x87b0('0x42')]);return db[_0x87b0('0x5d')][_0x87b0('0x1f')]({'where':_0x58ad46[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x1d4ba2){_0x541a43['count']=_0x1d4ba2;if(_0x2b7241[_0x87b0('0x35')]['includeAll']){_0x58ad46[_0x87b0('0x49')]=[{'all':!![]}];}return db[_0x87b0('0x5d')][_0x87b0('0x43')](_0x58ad46);})[_0x87b0('0x26')](function(_0x546fb9){_0x541a43[_0x87b0('0x44')]=_0x546fb9;return _0x541a43;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x46ad4b,_0x58ad46))[_0x87b0('0x45')](handleError(_0x46ad4b,null));};exports[_0x87b0('0x60')]=function(_0x2548f7,_0x39b0b7,_0x379af5){var _0x4abd18={'raw':!![],'where':{}};var _0x394a54={};var _0x2407e7={'count':0x0,'rows':[]};return db[_0x87b0('0x30')][_0x87b0('0x5c')]({'where':{'id':_0x2548f7[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x39b0b7,null))[_0x87b0('0x26')](function(_0x1fab01){if(_0x1fab01){_0x394a54[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x61')][_0x87b0('0x31')]);_0x394a54['query']=_[_0x87b0('0x36')](_0x2548f7['query']);_0x394a54[_0x87b0('0x3f')]=_['intersection'](_0x394a54['model'],_0x394a54[_0x87b0('0x35')]);_0x4abd18[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x394a54[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0x2548f7['query'][_0x87b0('0x39')]));_0x4abd18[_0x87b0('0x3a')]=_0x4abd18[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x4abd18[_0x87b0('0x3a')]:_0x394a54[_0x87b0('0x38')];if(!_0x2548f7[_0x87b0('0x35')][_0x87b0('0x5e')]('nolimit')){_0x4abd18[_0x87b0('0x1e')]=qs['limit'](_0x2548f7[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4abd18[_0x87b0('0x1c')]=qs['offset'](_0x2548f7[_0x87b0('0x35')][_0x87b0('0x1c')]);}_0x4abd18['order']=qs[_0x87b0('0x3d')](_0x2548f7['query'][_0x87b0('0x3d')]);_0x4abd18[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_['pick'](_0x2548f7['query'],_0x394a54[_0x87b0('0x3f')]));_0x4abd18[_0x87b0('0x3e')]['CampaignId']=_0x1fab01['id'];if(_0x2548f7['query'][_0x87b0('0x41')]){_0x4abd18[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x4abd18[_0x87b0('0x3e')],{'$or':_[_0x87b0('0x2f')](_0x4abd18[_0x87b0('0x3a')],function(_0x2b834e){var _0x4ef4da={};_0x4ef4da[_0x2b834e]={'$like':'%'+_0x2548f7[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x4ef4da;})});}_0x4abd18=_['merge']({},_0x4abd18,_0x2548f7[_0x87b0('0x42')]);return db[_0x87b0('0x61')][_0x87b0('0x1f')]({'where':_0x4abd18[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x577fe8){_0x2407e7[_0x87b0('0x1f')]=_0x577fe8;if(_0x2548f7['query'][_0x87b0('0x48')]){_0x4abd18[_0x87b0('0x49')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x87b0('0x43')](_0x4abd18);})[_0x87b0('0x26')](function(_0x2f7d82){_0x2407e7[_0x87b0('0x44')]=_0x2f7d82;return _0x2407e7;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x39b0b7,_0x4abd18))[_0x87b0('0x45')](handleError(_0x39b0b7,null));};exports['getHopperFinals']=function(_0xc86d31,_0x4b5c77,_0x458fdf){var _0x425326={'raw':!![],'where':{}};var _0x480cf0={};var _0x154ca8={'count':0x0,'rows':[]};return db[_0x87b0('0x30')]['findOne']({'where':{'id':_0xc86d31[_0x87b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x4b5c77,null))[_0x87b0('0x26')](function(_0x124b4b){if(_0x124b4b){_0x480cf0[_0x87b0('0x38')]=_[_0x87b0('0x36')](db['CmHopperFinal'][_0x87b0('0x31')]);_0x480cf0[_0x87b0('0x35')]=_['keys'](_0xc86d31['query']);_0x480cf0[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x480cf0[_0x87b0('0x38')],_0x480cf0['query']);_0x425326[_0x87b0('0x3a')]=_['intersection'](_0x480cf0[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x39')]));_0x425326[_0x87b0('0x3a')]=_0x425326[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x425326[_0x87b0('0x3a')]:_0x480cf0[_0x87b0('0x38')];if(!_0xc86d31['query'][_0x87b0('0x5e')](_0x87b0('0x3b'))){_0x425326['limit']=qs['limit'](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x425326[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0xc86d31['query'][_0x87b0('0x1c')]);}_0x425326[_0x87b0('0x3c')]=qs['sort'](_0xc86d31[_0x87b0('0x35')][_0x87b0('0x3d')]);_0x425326[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0xc86d31[_0x87b0('0x35')],_0x480cf0[_0x87b0('0x3f')]));_0x425326[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x124b4b['id'];if(_0xc86d31[_0x87b0('0x35')][_0x87b0('0x41')]){_0x425326['where']=_[_0x87b0('0x4a')](_0x425326['where'],{'$or':_[_0x87b0('0x2f')](_0x425326[_0x87b0('0x3a')],function(_0x3ec4df){var _0x1aa505={};_0x1aa505[_0x3ec4df]={'$like':'%'+_0xc86d31[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x1aa505;})});}_0x425326=_[_0x87b0('0x4a')]({},_0x425326,_0xc86d31[_0x87b0('0x42')]);return db[_0x87b0('0x62')][_0x87b0('0x1f')]({'where':_0x425326['where']})[_0x87b0('0x26')](function(_0x2ff2a0){_0x154ca8[_0x87b0('0x1f')]=_0x2ff2a0;if(_0xc86d31[_0x87b0('0x35')]['includeAll']){_0x425326['include']=[{'all':!![]}];}return db[_0x87b0('0x62')][_0x87b0('0x43')](_0x425326);})[_0x87b0('0x26')](function(_0xcc1acb){_0x154ca8['rows']=_0xcc1acb;return _0x154ca8;});}})['then'](respondWithFilteredResult(_0x4b5c77,_0x425326))[_0x87b0('0x45')](handleError(_0x4b5c77,null));};exports['getHopperBlacks']=function(_0x514cb9,_0x2e677d,_0x38d90e){var _0x6a6ab5={'raw':!![],'where':{}};var _0x46a73c={};var _0x51b804={'count':0x0,'rows':[]};return db['Campaign'][_0x87b0('0x5c')]({'where':{'id':_0x514cb9['params']['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x2e677d,null))[_0x87b0('0x26')](function(_0x1c04c8){if(_0x1c04c8){_0x46a73c[_0x87b0('0x38')]=_['keys'](db[_0x87b0('0x63')][_0x87b0('0x31')]);_0x46a73c[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x514cb9[_0x87b0('0x35')]);_0x46a73c[_0x87b0('0x3f')]=_['intersection'](_0x46a73c[_0x87b0('0x38')],_0x46a73c[_0x87b0('0x35')]);_0x6a6ab5[_0x87b0('0x3a')]=_[_0x87b0('0x37')](_0x46a73c['model'],qs[_0x87b0('0x39')](_0x514cb9[_0x87b0('0x35')][_0x87b0('0x39')]));_0x6a6ab5[_0x87b0('0x3a')]=_0x6a6ab5[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x6a6ab5[_0x87b0('0x3a')]:_0x46a73c[_0x87b0('0x38')];if(!_0x514cb9[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x6a6ab5[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x514cb9[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x6a6ab5[_0x87b0('0x1c')]=qs['offset'](_0x514cb9[_0x87b0('0x35')]['offset']);}_0x6a6ab5[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0x514cb9[_0x87b0('0x35')]['sort']);_0x6a6ab5['where']=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x514cb9[_0x87b0('0x35')],_0x46a73c[_0x87b0('0x3f')]));_0x6a6ab5[_0x87b0('0x3e')][_0x87b0('0x5f')]=_0x1c04c8['id'];if(_0x514cb9[_0x87b0('0x35')][_0x87b0('0x41')]){_0x6a6ab5[_0x87b0('0x3e')]=_[_0x87b0('0x4a')](_0x6a6ab5['where'],{'$or':_['map'](_0x6a6ab5[_0x87b0('0x3a')],function(_0x2066ea){var _0x6bb3bd={};_0x6bb3bd[_0x2066ea]={'$like':'%'+_0x514cb9['query'][_0x87b0('0x41')]+'%'};return _0x6bb3bd;})});}_0x6a6ab5=_['merge']({},_0x6a6ab5,_0x514cb9[_0x87b0('0x42')]);return db[_0x87b0('0x63')][_0x87b0('0x1f')]({'where':_0x6a6ab5[_0x87b0('0x3e')]})[_0x87b0('0x26')](function(_0x962c38){_0x51b804[_0x87b0('0x1f')]=_0x962c38;if(_0x514cb9[_0x87b0('0x35')][_0x87b0('0x48')]){_0x6a6ab5[_0x87b0('0x49')]=[{'all':!![]}];}return db[_0x87b0('0x63')][_0x87b0('0x43')](_0x6a6ab5);})[_0x87b0('0x26')](function(_0x3dbb54){_0x51b804[_0x87b0('0x44')]=_0x3dbb54;return _0x51b804;});}})[_0x87b0('0x26')](respondWithFilteredResult(_0x2e677d,_0x6a6ab5))['catch'](handleError(_0x2e677d,null));};exports['getLists']=function(_0xa24580,_0x1096a3,_0x384213){var _0x4290a6={};var _0x3fe457={};var _0x48b8b5;var _0x5be076;return db[_0x87b0('0x30')][_0x87b0('0x5c')]({'where':{'id':_0xa24580[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x1096a3,null))[_0x87b0('0x26')](function(_0x49ebb4){if(_0x49ebb4){_0x48b8b5=_0x49ebb4;_0x3fe457['model']=_['keys'](db[_0x87b0('0x64')][_0x87b0('0x31')]);_0x3fe457[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0xa24580[_0x87b0('0x35')]);_0x3fe457[_0x87b0('0x3f')]=_[_0x87b0('0x37')](_0x3fe457[_0x87b0('0x38')],_0x3fe457[_0x87b0('0x35')]);_0x4290a6['attributes']=_[_0x87b0('0x37')](_0x3fe457[_0x87b0('0x38')],qs[_0x87b0('0x39')](_0xa24580[_0x87b0('0x35')]['fields']));_0x4290a6[_0x87b0('0x3a')]=_0x4290a6[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x4290a6['attributes']:_0x3fe457['model'];_0x4290a6[_0x87b0('0x3c')]=qs[_0x87b0('0x3d')](_0xa24580[_0x87b0('0x35')]['sort']);_0x4290a6[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0xa24580[_0x87b0('0x35')],_0x3fe457[_0x87b0('0x3f')]));if(_0xa24580[_0x87b0('0x35')][_0x87b0('0x41')]){_0x4290a6['where']=_[_0x87b0('0x4a')](_0x4290a6[_0x87b0('0x3e')],{'$or':_[_0x87b0('0x2f')](_0x4290a6[_0x87b0('0x3a')],function(_0x21414b){var _0x1123f4={};_0x1123f4[_0x21414b]={'$like':'%'+_0xa24580[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x1123f4;})});}_0x4290a6=_[_0x87b0('0x4a')]({},_0x4290a6,_0xa24580[_0x87b0('0x42')]);return _0x48b8b5[_0x87b0('0x65')](_0x4290a6);}})[_0x87b0('0x26')](function(_0x2e38d4){if(_0x2e38d4){_0x5be076=_0x2e38d4[_0x87b0('0x57')];if(!_0xa24580[_0x87b0('0x35')]['hasOwnProperty'](_0x87b0('0x3b'))){_0x4290a6[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0xa24580[_0x87b0('0x35')][_0x87b0('0x1e')]);_0x4290a6[_0x87b0('0x1c')]=qs[_0x87b0('0x1c')](_0xa24580[_0x87b0('0x35')][_0x87b0('0x1c')]);}return _0x48b8b5[_0x87b0('0x65')](_0x4290a6);}})[_0x87b0('0x26')](function(_0x39a34a){if(_0x39a34a){return _0x39a34a?{'count':_0x5be076,'rows':_0x39a34a}:null;}})[_0x87b0('0x26')](respondWithResult(_0x1096a3,null))[_0x87b0('0x45')](handleError(_0x1096a3,null));};exports['addLists']=function(_0x2a33aa,_0x81e936,_0x54f4d4){var _0x38bbba,_0x5a6df2;var _0xd855b4=[];var _0x59ddf8=moment()['format'](_0x87b0('0x66'));return db['Campaign'][_0x87b0('0x4b')]({'where':{'id':_0x2a33aa['params']['id']}})['then'](handleEntityNotFound(_0x81e936,null))[_0x87b0('0x26')](function(_0x378d63){if(_0x378d63){_0x5a6df2=_0x378d63;return _0x378d63[_0x87b0('0x67')](_0x2a33aa['body'][_0x87b0('0x68')],_[_0x87b0('0x58')](_0x2a33aa['body'],[_0x87b0('0x68'),'id'])||{});}return null;})[_0x87b0('0x69')](function(_0x227eef){var _0x1ec998;var _0x49094c;_0x38bbba=_0x227eef||[];var _0xbf5960=[];if(_0x227eef){for(var _0xe81ff3=0x0;_0xe81ff3<_0x227eef[_0x87b0('0x57')];_0xe81ff3+=0x1){var _0x365a1f=_0x227eef[_0xe81ff3]['get']({'plain':!![]});_0x5a6df2['dialCheckDuplicateType']=_0x2a33aa[_0x87b0('0x4d')]['dialCheckDuplicateType']?_0x2a33aa[_0x87b0('0x4d')][_0x87b0('0x6a')]:_0x5a6df2[_0x87b0('0x6a')];switch(_0x5a6df2[_0x87b0('0x6a')]){case _0x87b0('0x6b'):_0x1ec998=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x6e'))[_0x87b0('0x6f')](['phone','scheduledAt',_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel['select']()['field'](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')]('NOW()',_0x87b0('0x74'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),'ListId')[_0x87b0('0x73')](_0x2a33aa[_0x87b0('0x47')]['id']['toString'](),_0x87b0('0x5f'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27','createdAt')[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))[_0x87b0('0x77')]('cm_contacts')['where'](_0x87b0('0x78'))[_0x87b0('0x3e')](_0x87b0('0x79'),_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a'))[_0x87b0('0x3e')](_0x87b0('0x7b'),squel['select']()[_0x87b0('0x73')](_0x87b0('0x7c'))[_0x87b0('0x77')]('cm_hopper_final')[_0x87b0('0x3e')](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]()))['where'](_0x87b0('0x7b'),squel[_0x87b0('0x7e')]()[_0x87b0('0x73')]('COALESCE(phone,\x27\x27)')[_0x87b0('0x77')](_0x87b0('0x6e'))[_0x87b0('0x3e')](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())))[_0x87b0('0x76')]();break;case'onlyIfOpen':_0x1ec998=squel['insert']()[_0x87b0('0x6d')](_0x87b0('0x6e'))[_0x87b0('0x6f')]([_0x87b0('0x72'),_0x87b0('0x74'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')](_0x87b0('0x7f'),_0x87b0('0x74'))['field']('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),_0x87b0('0x71'))['field'](_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),_0x87b0('0x5f'))['field']('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))['from'](_0x87b0('0x80'))[_0x87b0('0x3e')](_0x87b0('0x78'))[_0x87b0('0x3e')](_0x87b0('0x79'),_0x365a1f[_0x87b0('0x75')]['toString']())[_0x87b0('0x3e')](_0x87b0('0x7a'))[_0x87b0('0x3e')](_0x87b0('0x7b'),squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x81'))[_0x87b0('0x77')](_0x87b0('0x6e'))['where'](_0x87b0('0x7d'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())))[_0x87b0('0x76')]();break;default:_0x1ec998=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x6e'))['fromQuery']([_0x87b0('0x72'),_0x87b0('0x74'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()['field'](_0x87b0('0x72'),'phone')['field'](_0x87b0('0x7f'),_0x87b0('0x74'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')](),_0x87b0('0x71'))[_0x87b0('0x73')](_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),_0x87b0('0x5f'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x5a'))[_0x87b0('0x77')](_0x87b0('0x80'))[_0x87b0('0x3e')]('deletedAt\x20IS\x20NULL')[_0x87b0('0x3e')]('ListId\x20=\x20?',_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a')))[_0x87b0('0x76')]();}_0x49094c=squel[_0x87b0('0x6c')]()[_0x87b0('0x6d')](_0x87b0('0x82'))[_0x87b0('0x6f')]([_0x87b0('0x83'),_0x87b0('0x74'),'phone','OrderBy',_0x87b0('0x59'),_0x87b0('0x5a')],squel[_0x87b0('0x7e')]()['field'](_0x87b0('0x84'),'id')[_0x87b0('0x73')](_0x87b0('0x7f'),'scheduledAt')[_0x87b0('0x73')](_0x87b0('0x85'),_0x87b0('0x72'))['field'](_0x87b0('0x86'),_0x87b0('0x87'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27',_0x87b0('0x59'))[_0x87b0('0x73')]('\x27'+_0x59ddf8+'\x27','updatedAt')['from'](_0x87b0('0x88'),'ci')[_0x87b0('0x89')]('cm_hopper','h',_0x87b0('0x8a'))[_0x87b0('0x3e')](_0x87b0('0x8b'),_0x365a1f[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x8c'),_0x2a33aa[_0x87b0('0x47')]['id'][_0x87b0('0x76')]())['where'](_0x87b0('0x8d'),_0x59ddf8))[_0x87b0('0x76')]();_0xbf5960['push'](db[_0x87b0('0x8e')]['query'](_0x1ec998));_0xd855b4[_0x87b0('0x8f')](db[_0x87b0('0x8e')][_0x87b0('0x35')](_0x49094c));}return BPromise['all'](_0xbf5960);}})[_0x87b0('0x26')](function(){return BPromise[_0x87b0('0x90')](_0xd855b4);})['then'](function(){return _0x38bbba;})[_0x87b0('0x26')](respondWithResult(_0x81e936,null))[_0x87b0('0x45')](handleError(_0x81e936,null));};exports[_0x87b0('0x91')]=function(_0x3e4ce1,_0xe8b643,_0x463296){return db['Campaign']['find']({'where':{'id':_0x3e4ce1[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0xe8b643,null))[_0x87b0('0x26')](function(_0x42c898){if(_0x42c898){return _0x42c898[_0x87b0('0x91')](_0x3e4ce1[_0x87b0('0x35')][_0x87b0('0x68')]);}})['then'](function(_0xc68fac){if(_0xc68fac){return db[_0x87b0('0x5d')][_0x87b0('0x29')]({'where':{'ListId':_0x3e4ce1[_0x87b0('0x35')]['ids'],'CampaignId':_0x3e4ce1[_0x87b0('0x47')]['id']}})['then'](function(){return _0xc68fac;});}})[_0x87b0('0x26')](respondWithStatusCode(_0xe8b643,null))[_0x87b0('0x45')](handleError(_0xe8b643,null));};exports['getBlackLists']=function(_0x102c76,_0x7af439,_0xd2aea6){var _0x38576e={};var _0xad2ccb={};var _0x246a7f;var _0x2c6091;return db[_0x87b0('0x30')]['findOne']({'where':{'id':_0x102c76[_0x87b0('0x47')]['id']}})['then'](handleEntityNotFound(_0x7af439,null))[_0x87b0('0x26')](function(_0xdb8b7b){if(_0xdb8b7b){_0x246a7f=_0xdb8b7b;_0xad2ccb[_0x87b0('0x38')]=_[_0x87b0('0x36')](db[_0x87b0('0x64')][_0x87b0('0x31')]);_0xad2ccb[_0x87b0('0x35')]=_[_0x87b0('0x36')](_0x102c76['query']);_0xad2ccb['filters']=_[_0x87b0('0x37')](_0xad2ccb[_0x87b0('0x38')],_0xad2ccb[_0x87b0('0x35')]);_0x38576e['attributes']=_[_0x87b0('0x37')](_0xad2ccb['model'],qs[_0x87b0('0x39')](_0x102c76[_0x87b0('0x35')]['fields']));_0x38576e[_0x87b0('0x3a')]=_0x38576e[_0x87b0('0x3a')][_0x87b0('0x57')]?_0x38576e['attributes']:_0xad2ccb[_0x87b0('0x38')];_0x38576e[_0x87b0('0x3c')]=qs['sort'](_0x102c76[_0x87b0('0x35')][_0x87b0('0x3d')]);_0x38576e[_0x87b0('0x3e')]=qs[_0x87b0('0x3f')](_[_0x87b0('0x40')](_0x102c76['query'],_0xad2ccb[_0x87b0('0x3f')]));if(_0x102c76[_0x87b0('0x35')][_0x87b0('0x41')]){_0x38576e['where']=_[_0x87b0('0x4a')](_0x38576e['where'],{'$or':_[_0x87b0('0x2f')](_0x38576e['attributes'],function(_0x2097d2){var _0x527d5c={};_0x527d5c[_0x2097d2]={'$like':'%'+_0x102c76[_0x87b0('0x35')][_0x87b0('0x41')]+'%'};return _0x527d5c;})});}_0x38576e=_[_0x87b0('0x4a')]({},_0x38576e,_0x102c76[_0x87b0('0x42')]);return _0x246a7f['getBlackLists'](_0x38576e);}})['then'](function(_0x282282){if(_0x282282){_0x2c6091=_0x282282[_0x87b0('0x57')];if(!_0x102c76[_0x87b0('0x35')]['hasOwnProperty']('nolimit')){_0x38576e[_0x87b0('0x1e')]=qs[_0x87b0('0x1e')](_0x102c76[_0x87b0('0x35')]['limit']);_0x38576e['offset']=qs['offset'](_0x102c76[_0x87b0('0x35')][_0x87b0('0x1c')]);}return _0x246a7f['getBlackLists'](_0x38576e);}})[_0x87b0('0x26')](function(_0x544ae2){if(_0x544ae2){return _0x544ae2?{'count':_0x2c6091,'rows':_0x544ae2}:null;}})[_0x87b0('0x26')](respondWithResult(_0x7af439,null))[_0x87b0('0x45')](handleError(_0x7af439,null));};exports[_0x87b0('0x92')]=function(_0x740036,_0x5696b0,_0x220624){var _0x306a30,_0x55e2f5;var _0xc7b6f7=[];var _0x48efeb=moment()[_0x87b0('0x93')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x87b0('0x30')][_0x87b0('0x4b')]({'where':{'id':_0x740036[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x5696b0,null))['then'](function(_0x5397b3){if(_0x5397b3){_0x55e2f5=_0x5397b3;return _0x5397b3['addBlackLists'](_0x740036['body'][_0x87b0('0x68')],_[_0x87b0('0x58')](_0x740036[_0x87b0('0x4d')],[_0x87b0('0x68'),'id'])||{});}return null;})[_0x87b0('0x69')](function(_0x5bcd31){var _0x5a9f64;var _0x3b4a3b;_0x306a30=_0x5bcd31||[];var _0x3cecb8=[];if(_0x5bcd31){for(var _0x254583=0x0;_0x254583<_0x5bcd31['length'];_0x254583+=0x1){var _0x3791a4=_0x5bcd31[_0x254583][_0x87b0('0x27')]({'plain':!![]});_0x5a9f64=squel[_0x87b0('0x6c')]()['into']('cm_hopper_black')['fromQuery']([_0x87b0('0x72'),_0x87b0('0x70'),_0x87b0('0x71'),_0x87b0('0x5f'),'createdAt','updatedAt'],squel[_0x87b0('0x7e')]()[_0x87b0('0x73')](_0x87b0('0x72'),_0x87b0('0x72'))[_0x87b0('0x73')]('id',_0x87b0('0x70'))[_0x87b0('0x73')](_0x3791a4[_0x87b0('0x75')]['toString'](),_0x87b0('0x71'))[_0x87b0('0x73')](_0x740036[_0x87b0('0x47')]['id'][_0x87b0('0x76')](),'CampaignId')[_0x87b0('0x73')]('NOW()',_0x87b0('0x59'))['field']('NOW()',_0x87b0('0x5a'))['from'](_0x87b0('0x80'))[_0x87b0('0x3e')](_0x87b0('0x78'))[_0x87b0('0x3e')]('ListId\x20=\x20?',_0x3791a4[_0x87b0('0x75')][_0x87b0('0x76')]())[_0x87b0('0x3e')](_0x87b0('0x7a')))[_0x87b0('0x76')]();_0x3cecb8[_0x87b0('0x8f')](db[_0x87b0('0x8e')][_0x87b0('0x35')](_0x5a9f64));}return BPromise[_0x87b0('0x90')](_0x3cecb8);}})['then'](function(){return _0x306a30;})['then'](respondWithResult(_0x5696b0,null))[_0x87b0('0x45')](handleError(_0x5696b0,null));};exports['removeBlackLists']=function(_0x2261c2,_0x3f8108,_0x15e56c){return db[_0x87b0('0x30')][_0x87b0('0x4b')]({'where':{'id':_0x2261c2[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](handleEntityNotFound(_0x3f8108,null))[_0x87b0('0x26')](function(_0x19357b){if(_0x19357b){return _0x19357b[_0x87b0('0x94')](_0x2261c2[_0x87b0('0x35')]['ids']);}})['then'](function(_0x4e8c43){if(_0x4e8c43){return db[_0x87b0('0x63')]['destroy']({'where':{'ListId':_0x2261c2[_0x87b0('0x35')][_0x87b0('0x68')],'CampaignId':_0x2261c2[_0x87b0('0x47')]['id']}})[_0x87b0('0x26')](function(){return _0x4e8c43;});}})[_0x87b0('0x26')](respondWithStatusCode(_0x3f8108,null))[_0x87b0('0x45')](handleError(_0x3f8108,null));};
\ No newline at end of file
index d7761bb..6f178fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_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 logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6b70c39..45a3c36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8696=['jayson/promise','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCampaign','options','raw','where','attributes','limit','include','map','model','info','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8696,0x143));var _0x6869=function(_0x1079fb,_0x2ae37b){_0x1079fb=_0x1079fb-0x0;var _0x53a190=_0x8696[_0x1079fb];return _0x53a190;};'use strict';var _=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var moment=require('moment');var BPromise=require(_0x6869('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6869('0x3'));var db=require(_0x6869('0x4'))['db'];var utils=require(_0x6869('0x5'));var logger=require('../../config/logger')(_0x6869('0x6'));var config=require('../../config/environment');var jayson=require(_0x6869('0x7'));var client=jayson[_0x6869('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c8ad5,_0xa00fe5,_0x1e667d){return new BPromise(function(_0xa343ab,_0x3fff8a){return client[_0x6869('0x9')](_0x4c8ad5,_0x1e667d)[_0x6869('0xa')](function(_0x3c8486){logger['info'](_0x6869('0xb'),_0xa00fe5,_0x6869('0xc'));logger[_0x6869('0xd')](_0x6869('0xe'),_0xa00fe5,'request\x20sent',JSON['stringify'](_0x3c8486));if(_0x3c8486['error']){if(_0x3c8486[_0x6869('0xf')][_0x6869('0x10')]===0x1f4){logger[_0x6869('0xf')](_0x6869('0xb'),_0xa00fe5,_0x3c8486[_0x6869('0xf')]['message']);return _0x3fff8a(_0x3c8486[_0x6869('0xf')][_0x6869('0x11')]);}logger['error'](_0x6869('0xb'),_0xa00fe5,_0x3c8486[_0x6869('0xf')][_0x6869('0x11')]);return _0xa343ab(_0x3c8486['error'][_0x6869('0x11')]);}else{logger['info'](_0x6869('0xb'),_0xa00fe5,'request\x20sent');_0xa343ab(_0x3c8486[_0x6869('0x12')][_0x6869('0x11')]);}})[_0x6869('0x13')](function(_0x199a26){logger['error'](_0x6869('0xb'),_0xa00fe5,_0x199a26);_0x3fff8a(_0x199a26);});});}exports[_0x6869('0x14')]=function(_0x36da1f){var _0x4e2905=this;return new Promise(function(_0x327094,_0xdb1f89){return db['Campaign']['findAll']({'raw':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x16')]===undefined?!![]:![]:!![],'where':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x17')]||null:null,'attributes':_0x36da1f[_0x6869('0x15')]?_0x36da1f['options'][_0x6869('0x18')]||null:null,'limit':_0x36da1f[_0x6869('0x15')]?_0x36da1f[_0x6869('0x15')][_0x6869('0x19')]||null:null,'include':_0x36da1f[_0x6869('0x15')]?_0x36da1f[_0x6869('0x15')]['include']?_['map'](_0x36da1f[_0x6869('0x15')][_0x6869('0x1a')],function(_0x35f962){return{'model':db[_0x35f962['model']],'as':_0x35f962['as'],'attributes':_0x35f962['attributes'],'include':_0x35f962[_0x6869('0x1a')]?_[_0x6869('0x1b')](_0x35f962['include'],function(_0x44e798){return{'model':db[_0x44e798[_0x6869('0x1c')]],'as':_0x44e798['as'],'attributes':_0x44e798[_0x6869('0x18')],'include':_0x44e798['include']?_['map'](_0x44e798[_0x6869('0x1a')],function(_0xceb447){return{'model':db[_0xceb447['model']],'as':_0xceb447['as'],'attributes':_0xceb447[_0x6869('0x18')]};}):[]};}):[]};}):[]:[]})[_0x6869('0xa')](function(_0x35d9c4){logger[_0x6869('0x1d')](_0x6869('0x14'),_0x36da1f);logger[_0x6869('0xd')]('GetCampaign',_0x36da1f,JSON['stringify'](_0x35d9c4));_0x327094(_0x35d9c4);})[_0x6869('0x13')](function(_0x1bfba2){logger[_0x6869('0xf')](_0x6869('0x14'),_0x1bfba2[_0x6869('0x11')],_0x36da1f);_0xdb1f89(_0x4e2905[_0x6869('0xf')](0x1f4,_0x1bfba2[_0x6869('0x11')]));});});};
\ No newline at end of file
+var _0x5640=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5640,0x111));var _0x0564=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x5640[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0564('0x0'));var util=require('util');var moment=require(_0x0564('0x1'));var BPromise=require(_0x0564('0x2'));var rs=require(_0x0564('0x3'));var fs=require('fs');var Redis=require(_0x0564('0x4'));var db=require(_0x0564('0x5'))['db'];var utils=require(_0x0564('0x6'));var logger=require(_0x0564('0x7'))(_0x0564('0x8'));var config=require(_0x0564('0x9'));var jayson=require(_0x0564('0xa'));var client=jayson[_0x0564('0xb')][_0x0564('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3deac1,_0x545a39,_0x52b032){return new BPromise(function(_0x9e3a60,_0x37a190){return client[_0x0564('0xd')](_0x3deac1,_0x52b032)[_0x0564('0xe')](function(_0x4f5a64){logger[_0x0564('0xf')](_0x0564('0x10'),_0x545a39,'request\x20sent');logger[_0x0564('0x11')](_0x0564('0x12'),_0x545a39,'request\x20sent',JSON[_0x0564('0x13')](_0x4f5a64));if(_0x4f5a64[_0x0564('0x14')]){if(_0x4f5a64[_0x0564('0x14')]['code']===0x1f4){logger['error'](_0x0564('0x10'),_0x545a39,_0x4f5a64['error'][_0x0564('0x15')]);return _0x37a190(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}logger[_0x0564('0x14')](_0x0564('0x10'),_0x545a39,_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);return _0x9e3a60(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}else{logger['info'](_0x0564('0x10'),_0x545a39,_0x0564('0x16'));_0x9e3a60(_0x4f5a64[_0x0564('0x17')][_0x0564('0x15')]);}})[_0x0564('0x18')](function(_0x49173f){logger['error'](_0x0564('0x10'),_0x545a39,_0x49173f);_0x37a190(_0x49173f);});});}exports[_0x0564('0x19')]=function(_0x28c807){var _0x35ebe3=this;return new Promise(function(_0x31b612,_0x471645){return db[_0x0564('0x1a')]['findAll']({'raw':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1c')]===undefined?!![]:![]:!![],'where':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1d')]||null:null,'attributes':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1e')]||null:null,'limit':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x1f')]||null:null,'include':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x20')]?_[_0x0564('0x21')](_0x28c807[_0x0564('0x1b')]['include'],function(_0x542b1d){return{'model':db[_0x542b1d[_0x0564('0x22')]],'as':_0x542b1d['as'],'attributes':_0x542b1d[_0x0564('0x1e')],'include':_0x542b1d['include']?_[_0x0564('0x21')](_0x542b1d['include'],function(_0x4ed225){return{'model':db[_0x4ed225[_0x0564('0x22')]],'as':_0x4ed225['as'],'attributes':_0x4ed225['attributes'],'include':_0x4ed225['include']?_[_0x0564('0x21')](_0x4ed225[_0x0564('0x20')],function(_0x23d59d){return{'model':db[_0x23d59d[_0x0564('0x22')]],'as':_0x23d59d['as'],'attributes':_0x23d59d[_0x0564('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0564('0xe')](function(_0x2da082){logger[_0x0564('0xf')](_0x0564('0x19'),_0x28c807);logger[_0x0564('0x11')](_0x0564('0x19'),_0x28c807,JSON['stringify'](_0x2da082));_0x31b612(_0x2da082);})[_0x0564('0x18')](function(_0x2bd9c7){logger['error']('GetCampaign',_0x2bd9c7[_0x0564('0x15')],_0x28c807);_0x471645(_0x35ebe3['error'](0x1f4,_0x2bd9c7[_0x0564('0x15')]));});});};
\ No newline at end of file
index e81e5e0..4729a40 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd139=['index','/:id','show','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','/:id/lists','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5643ae,_0x58470a){var _0x33cfec=function(_0x41c421){while(--_0x41c421){_0x5643ae['push'](_0x5643ae['shift']());}};_0x33cfec(++_0x58470a);}(_0xd139,0x177));var _0x9d13=function(_0x497ded,_0x3bb53c){_0x497ded=_0x497ded-0x0;var _0x21f720=_0xd139[_0x497ded];return _0x21f720;};'use strict';var multer=require(_0x9d13('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9d13('0x1'));var express=require(_0x9d13('0x2'));var router=express[_0x9d13('0x3')]();var fs_extra=require(_0x9d13('0x4'));var auth=require(_0x9d13('0x5'));var interaction=require(_0x9d13('0x6'));var config=require(_0x9d13('0x7'));var controller=require('./campaign.controller');router[_0x9d13('0x8')]('/',auth[_0x9d13('0x9')](),controller[_0x9d13('0xa')]);router[_0x9d13('0x8')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0xc')]);router[_0x9d13('0x8')]('/:id/hoppers',auth[_0x9d13('0x9')](),controller[_0x9d13('0xd')]);router[_0x9d13('0x8')](_0x9d13('0xe'),auth[_0x9d13('0x9')](),controller['getHopperHistories']);router[_0x9d13('0x8')](_0x9d13('0xf'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x10')]);router[_0x9d13('0x8')]('/:id/hopper_black',auth[_0x9d13('0x9')](),controller[_0x9d13('0x11')]);router[_0x9d13('0x8')]('/:id/lists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x12')]);router[_0x9d13('0x8')](_0x9d13('0x13'),auth['isAuthenticated'](),controller[_0x9d13('0x14')]);router['post']('/',auth[_0x9d13('0x9')](),controller[_0x9d13('0x15')]);router[_0x9d13('0x16')](_0x9d13('0x17'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x18')]);router[_0x9d13('0x16')](_0x9d13('0x19'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1a')]);router[_0x9d13('0x16')]('/:id/blacklists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x1b')]);router[_0x9d13('0x1c')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1d')]);router[_0x9d13('0x1e')](_0x9d13('0xb'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x1f')]);router[_0x9d13('0x1e')]('/:id/lists',auth[_0x9d13('0x9')](),controller[_0x9d13('0x20')]);router[_0x9d13('0x1e')](_0x9d13('0x13'),auth[_0x9d13('0x9')](),controller[_0x9d13('0x21')]);module[_0x9d13('0x22')]=router;
\ No newline at end of file
+var _0xac2c=['removeBlackLists','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','/:id','update','delete','/:id/lists','removeLists'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xac2c,0x195));var _0xcac2=function(_0x1e1858,_0x2bc0ec){_0x1e1858=_0x1e1858-0x0;var _0x4d8d7a=_0xac2c[_0x1e1858];return _0x4d8d7a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcac2('0x0'));var timeout=require(_0xcac2('0x1'));var express=require(_0xcac2('0x2'));var router=express['Router']();var fs_extra=require(_0xcac2('0x3'));var auth=require(_0xcac2('0x4'));var interaction=require(_0xcac2('0x5'));var config=require('../../config/environment');var controller=require(_0xcac2('0x6'));router[_0xcac2('0x7')]('/',auth[_0xcac2('0x8')](),controller[_0xcac2('0x9')]);router['get']('/:id',auth[_0xcac2('0x8')](),controller[_0xcac2('0xa')]);router[_0xcac2('0x7')]('/:id/hoppers',auth[_0xcac2('0x8')](),controller[_0xcac2('0xb')]);router[_0xcac2('0x7')](_0xcac2('0xc'),auth[_0xcac2('0x8')](),controller[_0xcac2('0xd')]);router[_0xcac2('0x7')](_0xcac2('0xe'),auth['isAuthenticated'](),controller[_0xcac2('0xf')]);router['get']('/:id/hopper_black',auth[_0xcac2('0x8')](),controller[_0xcac2('0x10')]);router[_0xcac2('0x7')]('/:id/lists',auth['isAuthenticated'](),controller[_0xcac2('0x11')]);router['get'](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller['getBlackLists']);router[_0xcac2('0x13')]('/',auth['isAuthenticated'](),controller[_0xcac2('0x14')]);router[_0xcac2('0x13')](_0xcac2('0x15'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x16')]);router[_0xcac2('0x13')]('/:id/lists',auth[_0xcac2('0x8')](),controller[_0xcac2('0x17')]);router[_0xcac2('0x13')](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller['addBlackLists']);router['put'](_0xcac2('0x18'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x19')]);router['delete'](_0xcac2('0x18'),auth[_0xcac2('0x8')](),controller['destroy']);router[_0xcac2('0x1a')](_0xcac2('0x1b'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x1c')]);router[_0xcac2('0x1a')](_0xcac2('0x12'),auth[_0xcac2('0x8')](),controller[_0xcac2('0x1d')]);module[_0xcac2('0x1e')]=router;
\ No newline at end of file
index d630b3e..bff7e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf08=['getDataValue','key','sequelize','exports','TEXT'];(function(_0x5ac7b3,_0x5246a6){var _0x2d878a=function(_0x1a38cc){while(--_0x1a38cc){_0x5ac7b3['push'](_0x5ac7b3['shift']());}};_0x2d878a(++_0x5246a6);}(_0xdf08,0xe3));var _0x8df0=function(_0x7e6223,_0x1f78ac){_0x7e6223=_0x7e6223-0x0;var _0x1cf5a1=_0xdf08[_0x7e6223];return _0x1cf5a1;};'use strict';var Sequelize=require(_0x8df0('0x0'));module[_0x8df0('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x8df0('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8df0('0x3')](_0x8df0('0x4'));}}};
\ No newline at end of file
+var _0x74f2=['sequelize','STRING','TEXT','VIRTUAL','getDataValue','key'];(function(_0x4e7551,_0x398ee5){var _0x2c2ae8=function(_0x31f000){while(--_0x31f000){_0x4e7551['push'](_0x4e7551['shift']());}};_0x2c2ae8(++_0x398ee5);}(_0x74f2,0xc0));var _0x274f=function(_0x3ae25d,_0x17ec14){_0x3ae25d=_0x3ae25d-0x0;var _0x11522b=_0x74f2[_0x3ae25d];return _0x11522b;};'use strict';var Sequelize=require(_0x274f('0x0'));module['exports']={'key':{'type':Sequelize[_0x274f('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x274f('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x274f('0x3')],'get':function(){return this[_0x274f('0x4')](_0x274f('0x5'));}}};
\ No newline at end of file
index 67c8906..dfd3280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8877=['count','set','Content-Range','apply','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','stack','send','index','map','CannedAnswer','fieldName','key','name','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','filter','options','include','findAll','rows','params','includeAll','merge','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit'];(function(_0x199b67,_0x50c0ab){var _0x5a72e7=function(_0x35784d){while(--_0x35784d){_0x199b67['push'](_0x199b67['shift']());}};_0x5a72e7(++_0x50c0ab);}(_0x8877,0x18c));var _0x7887=function(_0x4db9ef,_0x4ea5bf){_0x4db9ef=_0x4db9ef-0x0;var _0x407a4f=_0x8877[_0x4db9ef];return _0x407a4f;};'use strict';var emlformat=require(_0x7887('0x0'));var rimraf=require(_0x7887('0x1'));var zipdir=require(_0x7887('0x2'));var jsonpatch=require(_0x7887('0x3'));var rp=require('request-promise');var moment=require(_0x7887('0x4'));var BPromise=require(_0x7887('0x5'));var Mustache=require('mustache');var util=require(_0x7887('0x6'));var path=require(_0x7887('0x7'));var sox=require(_0x7887('0x8'));var csv=require(_0x7887('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7887('0xa'));var _=require(_0x7887('0xb'));var squel=require(_0x7887('0xc'));var crypto=require(_0x7887('0xd'));var jsforce=require(_0x7887('0xe'));var deskjs=require(_0x7887('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7887('0x10'));var Papa=require(_0x7887('0x11'));var Redis=require(_0x7887('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7887('0x13'));var as=require(_0x7887('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7887('0x15'))('api');var utils=require(_0x7887('0x16'));var config=require(_0x7887('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7887('0x18'))['db'];function respondWithStatusCode(_0x20c707,_0x28e44d){_0x28e44d=_0x28e44d||0xcc;return function(_0x1002c3){if(_0x1002c3){return _0x20c707['sendStatus'](_0x28e44d);}return _0x20c707[_0x7887('0x19')](_0x28e44d)['end']();};}function respondWithResult(_0x446f38,_0x5459c4){_0x5459c4=_0x5459c4||0xc8;return function(_0x40c7e6){if(_0x40c7e6){return _0x446f38['status'](_0x5459c4)[_0x7887('0x1a')](_0x40c7e6);}};}function respondWithFilteredResult(_0x50fde8,_0x20cd0b){return function(_0x572b93){if(_0x572b93){var _0x24d503=typeof _0x20cd0b[_0x7887('0x1b')]==='undefined'&&typeof _0x20cd0b[_0x7887('0x1c')]==='undefined';var _0x150c27=_0x572b93[_0x7887('0x1d')];var _0x1a536b=_0x24d503?0x0:_0x20cd0b['offset'];var _0x27d3b6=_0x24d503?_0x572b93['count']:_0x20cd0b['offset']+_0x20cd0b[_0x7887('0x1c')];var _0x4c59d1;if(_0x27d3b6>=_0x150c27){_0x27d3b6=_0x150c27;_0x4c59d1=0xc8;}else{_0x4c59d1=0xce;}_0x50fde8[_0x7887('0x19')](_0x4c59d1);return _0x50fde8[_0x7887('0x1e')](_0x7887('0x1f'),_0x1a536b+'-'+_0x27d3b6+'/'+_0x150c27)['json'](_0x572b93);}return null;};}function patchUpdates(_0x4cc2f8){return function(_0x22a52a){try{jsonpatch[_0x7887('0x20')](_0x22a52a,_0x4cc2f8,!![]);}catch(_0x7368f9){return BPromise[_0x7887('0x21')](_0x7368f9);}return _0x22a52a[_0x7887('0x22')]();};}function saveUpdates(_0x598e0d,_0x4d4ca7){return function(_0x39bb8d){if(_0x39bb8d){return _0x39bb8d[_0x7887('0x23')](_0x598e0d)['then'](function(_0x2533ab){return _0x2533ab;});}return null;};}function removeEntity(_0x42ad95,_0x14718b){return function(_0x159cbb){if(_0x159cbb){return _0x159cbb[_0x7887('0x24')]()[_0x7887('0x25')](function(){var _0x42634e=_0x159cbb[_0x7887('0x26')]({'plain':!![]});var _0x5c4bd6=_0x7887('0x27');return db[_0x7887('0x28')][_0x7887('0x24')]({'where':{'type':_0x5c4bd6,'resourceId':_0x42634e['id']}})[_0x7887('0x25')](function(){return _0x159cbb;});})[_0x7887('0x25')](function(){_0x42ad95[_0x7887('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c0272,_0x14e14b){return function(_0xdd42e7){if(!_0xdd42e7){_0x1c0272[_0x7887('0x29')](0x194);}return _0xdd42e7;};}function handleError(_0x4d5dfa,_0x173eee){_0x173eee=_0x173eee||0x1f4;return function(_0x5960ef){logger['error'](_0x5960ef[_0x7887('0x2a')]);if(_0x5960ef['name']){delete _0x5960ef['name'];}_0x4d5dfa[_0x7887('0x19')](_0x173eee)[_0x7887('0x2b')](_0x5960ef);};}exports[_0x7887('0x2c')]=function(_0x3b69c7,_0x45a3b6){var _0x37d9f5={},_0x60cc26={},_0x9cd458={'count':0x0,'rows':[]};var _0x1db1af=_[_0x7887('0x2d')](db[_0x7887('0x2e')]['rawAttributes'],function(_0x11e268){return{'name':_0x11e268[_0x7887('0x2f')],'type':_0x11e268['type'][_0x7887('0x30')]};});_0x60cc26['model']=_[_0x7887('0x2d')](_0x1db1af,_0x7887('0x31'));_0x60cc26[_0x7887('0x32')]=_[_0x7887('0x33')](_0x3b69c7[_0x7887('0x32')]);_0x60cc26[_0x7887('0x34')]=_[_0x7887('0x35')](_0x60cc26['model'],_0x60cc26[_0x7887('0x32')]);_0x37d9f5[_0x7887('0x36')]=_[_0x7887('0x35')](_0x60cc26[_0x7887('0x37')],qs[_0x7887('0x38')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x38')]));_0x37d9f5[_0x7887('0x36')]=_0x37d9f5[_0x7887('0x36')][_0x7887('0x39')]?_0x37d9f5['attributes']:_0x60cc26[_0x7887('0x37')];if(!_0x3b69c7[_0x7887('0x32')]['hasOwnProperty']('nolimit')){_0x37d9f5[_0x7887('0x1c')]=qs['limit'](_0x3b69c7[_0x7887('0x32')][_0x7887('0x1c')]);_0x37d9f5[_0x7887('0x1b')]=qs[_0x7887('0x1b')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x1b')]);}_0x37d9f5[_0x7887('0x3a')]=qs[_0x7887('0x3b')](_0x3b69c7[_0x7887('0x32')][_0x7887('0x3b')]);_0x37d9f5['where']=qs['filters'](_['pick'](_0x3b69c7[_0x7887('0x32')],_0x60cc26[_0x7887('0x34')]),_0x1db1af);if(_0x3b69c7['query']['filter']){_0x37d9f5['where']=_['merge'](_0x37d9f5[_0x7887('0x3c')],{'$or':[{'key':{'$like':'%'+_0x3b69c7[_0x7887('0x32')][_0x7887('0x3d')]+'%'}},{'value':{'$like':'%'+_0x3b69c7[_0x7887('0x32')][_0x7887('0x3d')]+'%'}}]});}_0x37d9f5=_['merge']({},_0x37d9f5,_0x3b69c7[_0x7887('0x3e')]);var _0x36b491={'where':_0x37d9f5[_0x7887('0x3c')]};return db[_0x7887('0x2e')][_0x7887('0x1d')](_0x36b491)['then'](function(_0x1d2f3d){_0x9cd458['count']=_0x1d2f3d;if(_0x3b69c7[_0x7887('0x32')]['includeAll']){_0x37d9f5[_0x7887('0x3f')]=[{'all':!![]}];}return db[_0x7887('0x2e')][_0x7887('0x40')](_0x37d9f5);})[_0x7887('0x25')](function(_0x45c5c9){_0x9cd458[_0x7887('0x41')]=_0x45c5c9;return _0x9cd458;})[_0x7887('0x25')](respondWithFilteredResult(_0x45a3b6,_0x37d9f5))['catch'](handleError(_0x45a3b6,null));};exports['show']=function(_0x36c51d,_0x3885f3){var _0x402eb5={'raw':!![],'where':{'id':_0x36c51d[_0x7887('0x42')]['id']}},_0x357881={};_0x357881[_0x7887('0x37')]=_['keys'](db[_0x7887('0x2e')]['rawAttributes']);_0x357881[_0x7887('0x32')]=_[_0x7887('0x33')](_0x36c51d['query']);_0x357881[_0x7887('0x34')]=_[_0x7887('0x35')](_0x357881[_0x7887('0x37')],_0x357881['query']);_0x402eb5[_0x7887('0x36')]=_[_0x7887('0x35')](_0x357881['model'],qs[_0x7887('0x38')](_0x36c51d[_0x7887('0x32')][_0x7887('0x38')]));_0x402eb5[_0x7887('0x36')]=_0x402eb5[_0x7887('0x36')][_0x7887('0x39')]?_0x402eb5['attributes']:_0x357881['model'];if(_0x36c51d[_0x7887('0x32')][_0x7887('0x43')]){_0x402eb5[_0x7887('0x3f')]=[{'all':!![]}];}_0x402eb5=_[_0x7887('0x44')]({},_0x402eb5,_0x36c51d[_0x7887('0x3e')]);return db[_0x7887('0x2e')][_0x7887('0x45')](_0x402eb5)['then'](handleEntityNotFound(_0x3885f3,null))['then'](respondWithResult(_0x3885f3,null))[_0x7887('0x46')](handleError(_0x3885f3,null));};exports[_0x7887('0x23')]=function(_0xa67377,_0x305e67){if(_0xa67377['body']['id']){delete _0xa67377['body']['id'];}return db[_0x7887('0x2e')][_0x7887('0x45')]({'where':{'id':_0xa67377['params']['id']}})[_0x7887('0x25')](handleEntityNotFound(_0x305e67,null))['then'](saveUpdates(_0xa67377[_0x7887('0x47')],null))['then'](respondWithResult(_0x305e67,null))['catch'](handleError(_0x305e67,null));};exports['destroy']=function(_0x25cd60,_0x5e11dd){return db[_0x7887('0x2e')]['find']({'where':{'id':_0x25cd60[_0x7887('0x42')]['id']}})[_0x7887('0x25')](handleEntityNotFound(_0x5e11dd,null))[_0x7887('0x25')](removeEntity(_0x5e11dd,null))[_0x7887('0x46')](handleError(_0x5e11dd,null));};exports[_0x7887('0x48')]=function(_0x277d96,_0x2b3811){var _0x27d9bd={'key':_0x277d96[_0x7887('0x47')][_0x7887('0x30')]};if(_0x277d96[_0x7887('0x47')][_0x7887('0x49')]){_0x27d9bd[_0x7887('0x49')]=_0x277d96[_0x7887('0x47')][_0x7887('0x49')];}else if(_0x277d96[_0x7887('0x47')]['SmsAccountId']){_0x27d9bd[_0x7887('0x4a')]=_0x277d96[_0x7887('0x47')]['SmsAccountId'];}else if(_0x277d96['body'][_0x7887('0x4b')]){_0x27d9bd[_0x7887('0x4b')]=_0x277d96[_0x7887('0x47')][_0x7887('0x4b')];}else if(_0x277d96[_0x7887('0x47')][_0x7887('0x4c')]){_0x27d9bd[_0x7887('0x4c')]=_0x277d96[_0x7887('0x47')][_0x7887('0x4c')];}return db[_0x7887('0x2e')][_0x7887('0x45')]({'where':_0x27d9bd})[_0x7887('0x25')](function(_0x231e58){if(_0x231e58){throw new db[(_0x7887('0x4d'))]['ValidationError']('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x7887('0x2e')][_0x7887('0x48')](_0x277d96[_0x7887('0x47')]);})['then'](function(_0x50dd30){var _0x37652d=_0x277d96[_0x7887('0x4e')][_0x7887('0x26')]({'plain':!![]});if(!_0x37652d)throw new Error(_0x7887('0x4f'));if(_0x37652d['role']===_0x7887('0x4e')){var _0x25fe3d=_0x50dd30['get']({'plain':!![]});return db[_0x7887('0x50')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x37652d[_0x7887('0x51')]},'raw':!![]})[_0x7887('0x25')](function(_0xc3c585){if(_0xc3c585&&_0xc3c585[_0x7887('0x52')]===0x0){return db[_0x7887('0x28')][_0x7887('0x48')]({'name':_0x25fe3d[_0x7887('0x31')],'resourceId':_0x25fe3d['id'],'type':_0xc3c585[_0x7887('0x31')],'sectionId':_0xc3c585['id']},{})['then'](function(){return _0x50dd30;});}else{return _0x50dd30;}})['catch'](function(_0x9f1391){logger[_0x7887('0x53')](_0x7887('0x54'),_0x9f1391);throw _0x9f1391;});}return _0x50dd30;})[_0x7887('0x25')](respondWithResult(_0x2b3811,0xc9))['catch'](handleError(_0x2b3811,null));};
\ No newline at end of file
+var _0xfd5e=['../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xfd5e,0x1ac));var _0xefd5=function(_0x754f7f,_0x5a0753){_0x754f7f=_0x754f7f-0x0;var _0x20d21b=_0xfd5e[_0x754f7f];return _0x20d21b;};'use strict';var emlformat=require(_0xefd5('0x0'));var rimraf=require(_0xefd5('0x1'));var zipdir=require(_0xefd5('0x2'));var jsonpatch=require(_0xefd5('0x3'));var rp=require(_0xefd5('0x4'));var moment=require(_0xefd5('0x5'));var BPromise=require(_0xefd5('0x6'));var Mustache=require('mustache');var util=require(_0xefd5('0x7'));var path=require(_0xefd5('0x8'));var sox=require('sox');var csv=require(_0xefd5('0x9'));var ejs=require(_0xefd5('0xa'));var fs=require('fs');var fs_extra=require(_0xefd5('0xb'));var _=require(_0xefd5('0xc'));var squel=require(_0xefd5('0xd'));var crypto=require(_0xefd5('0xe'));var jsforce=require(_0xefd5('0xf'));var deskjs=require(_0xefd5('0x10'));var toCsv=require(_0xefd5('0x9'));var querystring=require(_0xefd5('0x11'));var Papa=require(_0xefd5('0x12'));var Redis=require('ioredis');var authService=require(_0xefd5('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xefd5('0x14'));var hardwareService=require(_0xefd5('0x15'));var logger=require(_0xefd5('0x16'))(_0xefd5('0x17'));var utils=require('../../config/utils');var config=require(_0xefd5('0x18'));var licenseUtil=require(_0xefd5('0x19'));var db=require(_0xefd5('0x1a'))['db'];function respondWithStatusCode(_0x40b17c,_0x379109){_0x379109=_0x379109||0xcc;return function(_0x43bae6){if(_0x43bae6){return _0x40b17c[_0xefd5('0x1b')](_0x379109);}return _0x40b17c['status'](_0x379109)[_0xefd5('0x1c')]();};}function respondWithResult(_0x5af415,_0x534a06){_0x534a06=_0x534a06||0xc8;return function(_0x3d4313){if(_0x3d4313){return _0x5af415[_0xefd5('0x1d')](_0x534a06)[_0xefd5('0x1e')](_0x3d4313);}};}function respondWithFilteredResult(_0x2c08ad,_0x213b9f){return function(_0x50525c){if(_0x50525c){var _0x51b86b=typeof _0x213b9f[_0xefd5('0x1f')]===_0xefd5('0x20')&&typeof _0x213b9f[_0xefd5('0x21')]===_0xefd5('0x20');var _0x185ed0=_0x50525c['count'];var _0x2f93ad=_0x51b86b?0x0:_0x213b9f[_0xefd5('0x1f')];var _0x3ad200=_0x51b86b?_0x50525c['count']:_0x213b9f[_0xefd5('0x1f')]+_0x213b9f[_0xefd5('0x21')];var _0x5d36d6;if(_0x3ad200>=_0x185ed0){_0x3ad200=_0x185ed0;_0x5d36d6=0xc8;}else{_0x5d36d6=0xce;}_0x2c08ad[_0xefd5('0x1d')](_0x5d36d6);return _0x2c08ad['set'](_0xefd5('0x22'),_0x2f93ad+'-'+_0x3ad200+'/'+_0x185ed0)[_0xefd5('0x1e')](_0x50525c);}return null;};}function patchUpdates(_0x45dc07){return function(_0x363e9b){try{jsonpatch[_0xefd5('0x23')](_0x363e9b,_0x45dc07,!![]);}catch(_0x26bd1d){return BPromise[_0xefd5('0x24')](_0x26bd1d);}return _0x363e9b[_0xefd5('0x25')]();};}function saveUpdates(_0x42ed06,_0x330611){return function(_0x5413a0){if(_0x5413a0){return _0x5413a0[_0xefd5('0x26')](_0x42ed06)[_0xefd5('0x27')](function(_0xedd858){return _0xedd858;});}return null;};}function removeEntity(_0x50dca7,_0x29e895){return function(_0xc945f9){if(_0xc945f9){return _0xc945f9[_0xefd5('0x28')]()[_0xefd5('0x27')](function(){var _0x237d16=_0xc945f9[_0xefd5('0x29')]({'plain':!![]});var _0x19185b=_0xefd5('0x2a');return db[_0xefd5('0x2b')]['destroy']({'where':{'type':_0x19185b,'resourceId':_0x237d16['id']}})['then'](function(){return _0xc945f9;});})[_0xefd5('0x27')](function(){_0x50dca7[_0xefd5('0x1d')](0xcc)[_0xefd5('0x1c')]();});}};}function handleEntityNotFound(_0x670250,_0x480b79){return function(_0x29f4ec){if(!_0x29f4ec){_0x670250[_0xefd5('0x1b')](0x194);}return _0x29f4ec;};}function handleError(_0x29d567,_0x2ab172){_0x2ab172=_0x2ab172||0x1f4;return function(_0x3db66f){logger['error'](_0x3db66f[_0xefd5('0x2c')]);if(_0x3db66f[_0xefd5('0x2d')]){delete _0x3db66f[_0xefd5('0x2d')];}_0x29d567[_0xefd5('0x1d')](_0x2ab172)[_0xefd5('0x2e')](_0x3db66f);};}exports[_0xefd5('0x2f')]=function(_0x248873,_0x14da83){var _0x532035={},_0x570b87={},_0x214f00={'count':0x0,'rows':[]};var _0x3b9253=_[_0xefd5('0x30')](db[_0xefd5('0x31')][_0xefd5('0x32')],function(_0x1f282e){return{'name':_0x1f282e[_0xefd5('0x33')],'type':_0x1f282e[_0xefd5('0x34')][_0xefd5('0x35')]};});_0x570b87['model']=_[_0xefd5('0x30')](_0x3b9253,'name');_0x570b87[_0xefd5('0x36')]=_[_0xefd5('0x37')](_0x248873[_0xefd5('0x36')]);_0x570b87[_0xefd5('0x38')]=_[_0xefd5('0x39')](_0x570b87[_0xefd5('0x3a')],_0x570b87[_0xefd5('0x36')]);_0x532035[_0xefd5('0x3b')]=_['intersection'](_0x570b87['model'],qs[_0xefd5('0x3c')](_0x248873[_0xefd5('0x36')][_0xefd5('0x3c')]));_0x532035[_0xefd5('0x3b')]=_0x532035['attributes'][_0xefd5('0x3d')]?_0x532035[_0xefd5('0x3b')]:_0x570b87[_0xefd5('0x3a')];if(!_0x248873['query']['hasOwnProperty'](_0xefd5('0x3e'))){_0x532035['limit']=qs['limit'](_0x248873[_0xefd5('0x36')]['limit']);_0x532035[_0xefd5('0x1f')]=qs[_0xefd5('0x1f')](_0x248873['query'][_0xefd5('0x1f')]);}_0x532035[_0xefd5('0x3f')]=qs[_0xefd5('0x40')](_0x248873[_0xefd5('0x36')][_0xefd5('0x40')]);_0x532035[_0xefd5('0x41')]=qs['filters'](_[_0xefd5('0x42')](_0x248873['query'],_0x570b87[_0xefd5('0x38')]),_0x3b9253);if(_0x248873[_0xefd5('0x36')][_0xefd5('0x43')]){_0x532035[_0xefd5('0x41')]=_[_0xefd5('0x44')](_0x532035[_0xefd5('0x41')],{'$or':[{'key':{'$like':'%'+_0x248873['query']['filter']+'%'}},{'value':{'$like':'%'+_0x248873[_0xefd5('0x36')][_0xefd5('0x43')]+'%'}}]});}_0x532035=_[_0xefd5('0x44')]({},_0x532035,_0x248873[_0xefd5('0x45')]);var _0x5efffe={'where':_0x532035[_0xefd5('0x41')]};return db[_0xefd5('0x31')][_0xefd5('0x46')](_0x5efffe)['then'](function(_0xdeadf3){_0x214f00[_0xefd5('0x46')]=_0xdeadf3;if(_0x248873[_0xefd5('0x36')][_0xefd5('0x47')]){_0x532035[_0xefd5('0x48')]=[{'all':!![]}];}return db['CannedAnswer'][_0xefd5('0x49')](_0x532035);})['then'](function(_0x496a75){_0x214f00[_0xefd5('0x4a')]=_0x496a75;return _0x214f00;})['then'](respondWithFilteredResult(_0x14da83,_0x532035))[_0xefd5('0x4b')](handleError(_0x14da83,null));};exports['show']=function(_0x476c3a,_0xe3344c){var _0x44f85f={'raw':!![],'where':{'id':_0x476c3a['params']['id']}},_0x298128={};_0x298128['model']=_[_0xefd5('0x37')](db['CannedAnswer']['rawAttributes']);_0x298128[_0xefd5('0x36')]=_[_0xefd5('0x37')](_0x476c3a[_0xefd5('0x36')]);_0x298128[_0xefd5('0x38')]=_[_0xefd5('0x39')](_0x298128[_0xefd5('0x3a')],_0x298128[_0xefd5('0x36')]);_0x44f85f['attributes']=_['intersection'](_0x298128[_0xefd5('0x3a')],qs[_0xefd5('0x3c')](_0x476c3a[_0xefd5('0x36')][_0xefd5('0x3c')]));_0x44f85f['attributes']=_0x44f85f['attributes'][_0xefd5('0x3d')]?_0x44f85f[_0xefd5('0x3b')]:_0x298128[_0xefd5('0x3a')];if(_0x476c3a['query'][_0xefd5('0x47')]){_0x44f85f[_0xefd5('0x48')]=[{'all':!![]}];}_0x44f85f=_[_0xefd5('0x44')]({},_0x44f85f,_0x476c3a[_0xefd5('0x45')]);return db['CannedAnswer']['find'](_0x44f85f)[_0xefd5('0x27')](handleEntityNotFound(_0xe3344c,null))[_0xefd5('0x27')](respondWithResult(_0xe3344c,null))[_0xefd5('0x4b')](handleError(_0xe3344c,null));};exports[_0xefd5('0x26')]=function(_0x11b87e,_0x484cfa){if(_0x11b87e[_0xefd5('0x4c')]['id']){delete _0x11b87e[_0xefd5('0x4c')]['id'];}return db['CannedAnswer'][_0xefd5('0x4d')]({'where':{'id':_0x11b87e['params']['id']}})[_0xefd5('0x27')](handleEntityNotFound(_0x484cfa,null))['then'](saveUpdates(_0x11b87e[_0xefd5('0x4c')],null))[_0xefd5('0x27')](respondWithResult(_0x484cfa,null))[_0xefd5('0x4b')](handleError(_0x484cfa,null));};exports[_0xefd5('0x28')]=function(_0x210762,_0x2291b8){return db[_0xefd5('0x31')]['find']({'where':{'id':_0x210762['params']['id']}})[_0xefd5('0x27')](handleEntityNotFound(_0x2291b8,null))['then'](removeEntity(_0x2291b8,null))[_0xefd5('0x4b')](handleError(_0x2291b8,null));};exports[_0xefd5('0x4e')]=function(_0x219557,_0x2e2d76){var _0x2c688f={'key':_0x219557[_0xefd5('0x4c')][_0xefd5('0x35')]};if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x4f')]){_0x2c688f['MailAccountId']=_0x219557[_0xefd5('0x4c')]['MailAccountId'];}else if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x50')]){_0x2c688f[_0xefd5('0x50')]=_0x219557[_0xefd5('0x4c')][_0xefd5('0x50')];}else if(_0x219557[_0xefd5('0x4c')][_0xefd5('0x51')]){_0x2c688f[_0xefd5('0x51')]=_0x219557[_0xefd5('0x4c')][_0xefd5('0x51')];}else if(_0x219557['body'][_0xefd5('0x52')]){_0x2c688f['ChatWebsiteId']=_0x219557[_0xefd5('0x4c')][_0xefd5('0x52')];}return db[_0xefd5('0x31')]['find']({'where':_0x2c688f})['then'](function(_0x54cd67){if(_0x54cd67){throw new db['Sequelize'][(_0xefd5('0x53'))](_0xefd5('0x54'));}return db[_0xefd5('0x31')][_0xefd5('0x4e')](_0x219557[_0xefd5('0x4c')]);})[_0xefd5('0x27')](function(_0x1e67b0){var _0x168a3b=_0x219557[_0xefd5('0x55')][_0xefd5('0x29')]({'plain':!![]});if(!_0x168a3b)throw new Error(_0xefd5('0x56'));if(_0x168a3b[_0xefd5('0x57')]===_0xefd5('0x55')){var _0x2888c1=_0x1e67b0[_0xefd5('0x29')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'CannedAnswers','userProfileId':_0x168a3b[_0xefd5('0x58')]},'raw':!![]})[_0xefd5('0x27')](function(_0x27279a){if(_0x27279a&&_0x27279a['autoAssociation']===0x0){return db[_0xefd5('0x2b')][_0xefd5('0x4e')]({'name':_0x2888c1[_0xefd5('0x2d')],'resourceId':_0x2888c1['id'],'type':_0x27279a[_0xefd5('0x2d')],'sectionId':_0x27279a['id']},{})[_0xefd5('0x27')](function(){return _0x1e67b0;});}else{return _0x1e67b0;}})[_0xefd5('0x4b')](function(_0x1f9d7a){logger[_0xefd5('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f9d7a);throw _0x1f9d7a;});}return _0x1e67b0;})[_0xefd5('0x27')](respondWithResult(_0x2e2d76,0xc9))[_0xefd5('0x4b')](handleError(_0x2e2d76,null));};
\ No newline at end of file
index 5cf6bac..9a70578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a28=['./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a28,0x1cd));var _0x87a2=function(_0x33efba,_0x4ddf7f){_0x33efba=_0x33efba-0x0;var _0x4ac6c3=_0x7a28[_0x33efba];return _0x4ac6c3;};'use strict';var _=require('lodash');var util=require(_0x87a2('0x0'));var logger=require(_0x87a2('0x1'))(_0x87a2('0x2'));var moment=require('moment');var BPromise=require(_0x87a2('0x3'));var rp=require(_0x87a2('0x4'));var fs=require('fs');var path=require(_0x87a2('0x5'));var rimraf=require('rimraf');var config=require(_0x87a2('0x6'));var attributes=require(_0x87a2('0x7'));module[_0x87a2('0x8')]=function(_0x12b55a,_0x4c513b){return _0x12b55a['define'](_0x87a2('0x9'),attributes,{'tableName':_0x87a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x87a2('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5dbc=['path','rimraf','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x253d9c,_0x4442c5){var _0x4d0a3d=function(_0x97fc0e){while(--_0x97fc0e){_0x253d9c['push'](_0x253d9c['shift']());}};_0x4d0a3d(++_0x4442c5);}(_0x5dbc,0x162));var _0xc5db=function(_0x150da1,_0x249791){_0x150da1=_0x150da1-0x0;var _0x9413be=_0x5dbc[_0x150da1];return _0x9413be;};'use strict';var _=require(_0xc5db('0x0'));var util=require(_0xc5db('0x1'));var logger=require(_0xc5db('0x2'))(_0xc5db('0x3'));var moment=require(_0xc5db('0x4'));var BPromise=require(_0xc5db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5db('0x6'));var rimraf=require(_0xc5db('0x7'));var config=require('../../config/environment');var attributes=require(_0xc5db('0x8'));module['exports']=function(_0x5ad154,_0x4d451d){return _0x5ad154['define'](_0xc5db('0x9'),attributes,{'tableName':_0xc5db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc5db('0xb')});};
\ No newline at end of file
index cd311ef..e748190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x107959,_0x27f36e){var _0x90360d=function(_0x2e8894){while(--_0x2e8894){_0x107959['push'](_0x107959['shift']());}};_0x90360d(++_0x27f36e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4a5e98,_0x127885){var _0x33f12f=function(_0x36a15f){while(--_0x36a15f){_0x4a5e98['push'](_0x4a5e98['shift']());}};_0x33f12f(++_0x127885);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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
index c495ff2..48d1062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ba2=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','post','update','destroy','exports','multer','util'];(function(_0x37b209,_0x242888){var _0x5ca54e=function(_0x1e231a){while(--_0x1e231a){_0x37b209['push'](_0x37b209['shift']());}};_0x5ca54e(++_0x242888);}(_0x6ba2,0x1ce));var _0x26ba=function(_0x4a9d87,_0x2cc20f){_0x4a9d87=_0x4a9d87-0x0;var _0x1ad978=_0x6ba2[_0x4a9d87];return _0x1ad978;};'use strict';var multer=require(_0x26ba('0x0'));var util=require(_0x26ba('0x1'));var path=require(_0x26ba('0x2'));var timeout=require(_0x26ba('0x3'));var express=require(_0x26ba('0x4'));var router=express[_0x26ba('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x26ba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x26ba('0x7'));var controller=require(_0x26ba('0x8'));router[_0x26ba('0x9')]('/',auth[_0x26ba('0xa')](),controller['index']);router['get'](_0x26ba('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x26ba('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x26ba('0xb'),auth['isAuthenticated'](),controller[_0x26ba('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x26ba('0xe')]);module[_0x26ba('0xf')]=router;
\ No newline at end of file
+var _0xf7dc=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x91450b,_0x2328e7){var _0x426729=function(_0x1a550e){while(--_0x1a550e){_0x91450b['push'](_0x91450b['shift']());}};_0x426729(++_0x2328e7);}(_0xf7dc,0x1b0));var _0xcf7d=function(_0x33b6f3,_0xc95c82){_0x33b6f3=_0x33b6f3-0x0;var _0x5ae135=_0xf7dc[_0x33b6f3];return _0x5ae135;};'use strict';var multer=require(_0xcf7d('0x0'));var util=require(_0xcf7d('0x1'));var path=require(_0xcf7d('0x2'));var timeout=require(_0xcf7d('0x3'));var express=require(_0xcf7d('0x4'));var router=express[_0xcf7d('0x5')]();var fs_extra=require(_0xcf7d('0x6'));var auth=require(_0xcf7d('0x7'));var interaction=require(_0xcf7d('0x8'));var config=require(_0xcf7d('0x9'));var controller=require(_0xcf7d('0xa'));router[_0xcf7d('0xb')]('/',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0xd')]);router[_0xcf7d('0xb')](_0xcf7d('0xe'),auth[_0xcf7d('0xc')](),controller[_0xcf7d('0xf')]);router['post']('/',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x10')]);router[_0xcf7d('0x11')]('/:id',auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x12')]);router[_0xcf7d('0x13')](_0xcf7d('0xe'),auth[_0xcf7d('0xc')](),controller[_0xcf7d('0x14')]);module[_0xcf7d('0x15')]=router;
\ No newline at end of file
index de604d5..1dcd1e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb37b=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports'];(function(_0x3eb2ea,_0x401c21){var _0x516fe4=function(_0x337c89){while(--_0x337c89){_0x3eb2ea['push'](_0x3eb2ea['shift']());}};_0x516fe4(++_0x401c21);}(_0xb37b,0x1de));var _0xbb37=function(_0x143137,_0x36be5b){_0x143137=_0x143137-0x0;var _0x6e60c6=_0xb37b[_0x143137];return _0x6e60c6;};'use strict';var Sequelize=require(_0xbb37('0x0'));module[_0xbb37('0x1')]={'calldate':{'type':Sequelize[_0xbb37('0x2')],'allowNull':![],'defaultValue':_0xbb37('0x3')},'clid':{'type':Sequelize[_0xbb37('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xbb37('0x4')]},'channel':{'type':Sequelize[_0xbb37('0x4')]},'dstchannel':{'type':Sequelize[_0xbb37('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbb37('0x4')]},'duration':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbb37('0x4')]},'amaflags':{'type':Sequelize[_0xbb37('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbb37('0x4')]},'userfield':{'type':Sequelize[_0xbb37('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xbb37('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xbb37('0x4')]}};
\ No newline at end of file
+var _0x90c7=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x36cfcb,_0x5969fd){var _0x51631b=function(_0x9c096e){while(--_0x9c096e){_0x36cfcb['push'](_0x36cfcb['shift']());}};_0x51631b(++_0x5969fd);}(_0x90c7,0x9c));var _0x790c=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x90c7[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x790c('0x0'));module[_0x790c('0x1')]={'calldate':{'type':Sequelize[_0x790c('0x2')],'allowNull':![],'defaultValue':_0x790c('0x3')},'clid':{'type':Sequelize[_0x790c('0x4')]},'src':{'type':Sequelize[_0x790c('0x4')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x790c('0x4')]},'channel':{'type':Sequelize[_0x790c('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x790c('0x4')]},'lastdata':{'type':Sequelize[_0x790c('0x4')]},'duration':{'type':Sequelize[_0x790c('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x790c('0x4')]},'amaflags':{'type':Sequelize[_0x790c('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x790c('0x4')]},'userfield':{'type':Sequelize[_0x790c('0x4')]},'uniqueid':{'type':Sequelize[_0x790c('0x4')]},'linkedid':{'type':Sequelize[_0x790c('0x4')]},'sequence':{'type':Sequelize[_0x790c('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x790c('0x4')]},'tag':{'type':Sequelize[_0x790c('0x4')]}};
\ No newline at end of file
index f1e5f08..8eb35b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1f6=['error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x3b5049,_0x495a94){_0x3b5049=_0x3b5049-0x0;var _0x12454e=_0xa1f6[_0x3b5049];return _0x12454e;};'use strict';var emlformat=require(_0x6a1f('0x0'));var rimraf=require(_0x6a1f('0x1'));var zipdir=require(_0x6a1f('0x2'));var jsonpatch=require(_0x6a1f('0x3'));var rp=require(_0x6a1f('0x4'));var moment=require(_0x6a1f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6a1f('0x6'));var ejs=require(_0x6a1f('0x7'));var fs=require('fs');var fs_extra=require(_0x6a1f('0x8'));var _=require(_0x6a1f('0x9'));var squel=require(_0x6a1f('0xa'));var crypto=require(_0x6a1f('0xb'));var jsforce=require(_0x6a1f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6a1f('0x6'));var querystring=require(_0x6a1f('0xd'));var Papa=require(_0x6a1f('0xe'));var Redis=require(_0x6a1f('0xf'));var authService=require(_0x6a1f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6a1f('0x11'));var hardwareService=require(_0x6a1f('0x12'));var logger=require(_0x6a1f('0x13'))(_0x6a1f('0x14'));var utils=require('../../config/utils');var config=require(_0x6a1f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a1f('0x16'))['db'];function respondWithStatusCode(_0x17edb6,_0x2a4e94){_0x2a4e94=_0x2a4e94||0xcc;return function(_0x442576){if(_0x442576){return _0x17edb6[_0x6a1f('0x17')](_0x2a4e94);}return _0x17edb6[_0x6a1f('0x18')](_0x2a4e94)[_0x6a1f('0x19')]();};}function respondWithResult(_0x8c3a36,_0x1918c6){_0x1918c6=_0x1918c6||0xc8;return function(_0x27d8f8){if(_0x27d8f8){return _0x8c3a36[_0x6a1f('0x18')](_0x1918c6)[_0x6a1f('0x1a')](_0x27d8f8);}};}function respondWithFilteredResult(_0x253305,_0x2677c1){return function(_0x14ecec){if(_0x14ecec){var _0x11ee0e=typeof _0x2677c1[_0x6a1f('0x1b')]===_0x6a1f('0x1c')&&typeof _0x2677c1[_0x6a1f('0x1d')]==='undefined';var _0x392ccb=_0x14ecec[_0x6a1f('0x1e')];var _0x1ccbed=_0x11ee0e?0x0:_0x2677c1[_0x6a1f('0x1b')];var _0x21d268=_0x11ee0e?_0x14ecec[_0x6a1f('0x1e')]:_0x2677c1[_0x6a1f('0x1b')]+_0x2677c1[_0x6a1f('0x1d')];var _0x5cb044;if(_0x21d268>=_0x392ccb){_0x21d268=_0x392ccb;_0x5cb044=0xc8;}else{_0x5cb044=0xce;}_0x253305[_0x6a1f('0x18')](_0x5cb044);return _0x253305['set'](_0x6a1f('0x1f'),_0x1ccbed+'-'+_0x21d268+'/'+_0x392ccb)[_0x6a1f('0x1a')](_0x14ecec);}return null;};}function patchUpdates(_0x3c7ed0){return function(_0x1b5856){try{jsonpatch[_0x6a1f('0x20')](_0x1b5856,_0x3c7ed0,!![]);}catch(_0x4eae7f){return BPromise[_0x6a1f('0x21')](_0x4eae7f);}return _0x1b5856[_0x6a1f('0x22')]();};}function saveUpdates(_0xa43cd5,_0x1be0c3){return function(_0x312e75){if(_0x312e75){return _0x312e75[_0x6a1f('0x23')](_0xa43cd5)[_0x6a1f('0x24')](function(_0x2736ab){return _0x2736ab;});}return null;};}function removeEntity(_0x53229b,_0x1eb146){return function(_0x3d953d){if(_0x3d953d){return _0x3d953d['destroy']()['then'](function(){_0x53229b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ea158,_0x5e6013){return function(_0x5abe40){if(!_0x5abe40){_0x3ea158[_0x6a1f('0x17')](0x194);}return _0x5abe40;};}function handleError(_0x286d1d,_0x2b53ca){_0x2b53ca=_0x2b53ca||0x1f4;return function(_0x1e8db8){logger[_0x6a1f('0x25')](_0x1e8db8[_0x6a1f('0x26')]);if(_0x1e8db8[_0x6a1f('0x27')]){delete _0x1e8db8[_0x6a1f('0x27')];}_0x286d1d['status'](_0x2b53ca)[_0x6a1f('0x28')](_0x1e8db8);};}exports[_0x6a1f('0x29')]=function(_0x3f0730,_0x574d80){var _0x1e951c={},_0x155c58={},_0x257cee={'count':0x0,'rows':[]};var _0x113422=_[_0x6a1f('0x2a')](db[_0x6a1f('0x2b')][_0x6a1f('0x2c')],function(_0x58d879){return{'name':_0x58d879['fieldName'],'type':_0x58d879[_0x6a1f('0x2d')][_0x6a1f('0x2e')]};});_0x155c58[_0x6a1f('0x2f')]=_[_0x6a1f('0x2a')](_0x113422,_0x6a1f('0x27'));_0x155c58[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x3f0730['query']);_0x155c58[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x155c58['model'],_0x155c58[_0x6a1f('0x30')]);_0x1e951c[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x155c58['model'],qs['fields'](_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x35')]));_0x1e951c[_0x6a1f('0x34')]=_0x1e951c['attributes']['length']?_0x1e951c[_0x6a1f('0x34')]:_0x155c58[_0x6a1f('0x2f')];if(!_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x36')](_0x6a1f('0x37'))){_0x1e951c[_0x6a1f('0x1d')]=qs[_0x6a1f('0x1d')](_0x3f0730['query'][_0x6a1f('0x1d')]);_0x1e951c['offset']=qs[_0x6a1f('0x1b')](_0x3f0730[_0x6a1f('0x30')]['offset']);}_0x1e951c[_0x6a1f('0x38')]=qs[_0x6a1f('0x39')](_0x3f0730['query'][_0x6a1f('0x39')]);_0x1e951c['where']=qs[_0x6a1f('0x32')](_['pick'](_0x3f0730[_0x6a1f('0x30')],_0x155c58['filters']),_0x113422);if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]){_0x1e951c['where']=_[_0x6a1f('0x3b')](_0x1e951c[_0x6a1f('0x3c')],{'$or':_['map'](_0x113422,function(_0x5beb28){if(_0x5beb28[_0x6a1f('0x2d')]!==_0x6a1f('0x3d')){var _0x314fef={};_0x314fef[_0x5beb28[_0x6a1f('0x27')]]={'$like':'%'+_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3a')]+'%'};return _0x314fef;}})});}_0x1e951c=_['merge']({},_0x1e951c,_0x3f0730[_0x6a1f('0x3e')]);var _0x2da23a={'where':_0x1e951c[_0x6a1f('0x3c')]};return db[_0x6a1f('0x2b')][_0x6a1f('0x1e')](_0x2da23a)[_0x6a1f('0x24')](function(_0x27be0a){_0x257cee[_0x6a1f('0x1e')]=_0x27be0a;if(_0x3f0730[_0x6a1f('0x30')][_0x6a1f('0x3f')]){_0x1e951c[_0x6a1f('0x40')]=[{'all':!![]}];}return db['Cdr'][_0x6a1f('0x41')](_0x1e951c);})[_0x6a1f('0x24')](function(_0x334fc4){_0x257cee[_0x6a1f('0x42')]=_0x334fc4;return _0x257cee;})[_0x6a1f('0x24')](respondWithFilteredResult(_0x574d80,_0x1e951c))[_0x6a1f('0x43')](handleError(_0x574d80,null));};exports['show']=function(_0x211009,_0x482c3a){var _0x3a6f80={'raw':!![],'where':{'id':_0x211009[_0x6a1f('0x44')]['id']}},_0x33208d={};_0x33208d[_0x6a1f('0x2f')]=_[_0x6a1f('0x31')](db[_0x6a1f('0x2b')]['rawAttributes']);_0x33208d[_0x6a1f('0x30')]=_[_0x6a1f('0x31')](_0x211009[_0x6a1f('0x30')]);_0x33208d[_0x6a1f('0x32')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],_0x33208d[_0x6a1f('0x30')]);_0x3a6f80[_0x6a1f('0x34')]=_[_0x6a1f('0x33')](_0x33208d[_0x6a1f('0x2f')],qs['fields'](_0x211009['query']['fields']));_0x3a6f80[_0x6a1f('0x34')]=_0x3a6f80[_0x6a1f('0x34')][_0x6a1f('0x45')]?_0x3a6f80[_0x6a1f('0x34')]:_0x33208d[_0x6a1f('0x2f')];if(_0x211009[_0x6a1f('0x30')]['includeAll']){_0x3a6f80[_0x6a1f('0x40')]=[{'all':!![]}];}_0x3a6f80=_['merge']({},_0x3a6f80,_0x211009[_0x6a1f('0x3e')]);return db[_0x6a1f('0x2b')]['find'](_0x3a6f80)[_0x6a1f('0x24')](handleEntityNotFound(_0x482c3a,null))['then'](respondWithResult(_0x482c3a,null))[_0x6a1f('0x43')](handleError(_0x482c3a,null));};exports[_0x6a1f('0x46')]=function(_0xa864f3,_0x4318fd){return db[_0x6a1f('0x2b')][_0x6a1f('0x46')](_0xa864f3['body'],{})[_0x6a1f('0x24')](respondWithResult(_0x4318fd,0xc9))[_0x6a1f('0x43')](handleError(_0x4318fd,null));};exports[_0x6a1f('0x23')]=function(_0x2bea1a,_0x34fa17){if(_0x2bea1a[_0x6a1f('0x47')]['id']){delete _0x2bea1a[_0x6a1f('0x47')]['id'];}return db[_0x6a1f('0x2b')]['find']({'where':{'id':_0x2bea1a[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x34fa17,null))[_0x6a1f('0x24')](saveUpdates(_0x2bea1a['body'],null))[_0x6a1f('0x24')](respondWithResult(_0x34fa17,null))['catch'](handleError(_0x34fa17,null));};exports[_0x6a1f('0x48')]=function(_0x52c262,_0x366a60){return db['Cdr'][_0x6a1f('0x49')]({'where':{'id':_0x52c262[_0x6a1f('0x44')]['id']}})[_0x6a1f('0x24')](handleEntityNotFound(_0x366a60,null))['then'](removeEntity(_0x366a60,null))[_0x6a1f('0x43')](handleError(_0x366a60,null));};exports['describe']=function(_0x143873,_0x55d114){return db['Cdr'][_0x6a1f('0x4a')]()[_0x6a1f('0x24')](respondWithResult(_0x55d114,null))['catch'](handleError(_0x55d114,null));};
\ No newline at end of file
+var _0x44e8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x5bd0fa,_0x5edb23){var _0x293f8f=function(_0x1372dd){while(--_0x1372dd){_0x5bd0fa['push'](_0x5bd0fa['shift']());}};_0x293f8f(++_0x5edb23);}(_0x44e8,0xd7));var _0x844e=function(_0x5c208b,_0x4c4753){_0x5c208b=_0x5c208b-0x0;var _0x1ac24b=_0x44e8[_0x5c208b];return _0x1ac24b;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x1'));var rp=require(_0x844e('0x2'));var moment=require(_0x844e('0x3'));var BPromise=require(_0x844e('0x4'));var Mustache=require('mustache');var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0x9'));var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xe'));var Papa=require(_0x844e('0xf'));var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var licenseUtil=require(_0x844e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d3bea,_0x23df3f){_0x23df3f=_0x23df3f||0xcc;return function(_0x52ac76){if(_0x52ac76){return _0x8d3bea[_0x844e('0x19')](_0x23df3f);}return _0x8d3bea[_0x844e('0x1a')](_0x23df3f)['end']();};}function respondWithResult(_0x1f48e2,_0x6b542d){_0x6b542d=_0x6b542d||0xc8;return function(_0x1c1689){if(_0x1c1689){return _0x1f48e2['status'](_0x6b542d)[_0x844e('0x1b')](_0x1c1689);}};}function respondWithFilteredResult(_0x465e49,_0x380eb4){return function(_0x935134){if(_0x935134){var _0x2588a3=typeof _0x380eb4[_0x844e('0x1c')]===_0x844e('0x1d')&&typeof _0x380eb4[_0x844e('0x1e')]==='undefined';var _0x36286c=_0x935134['count'];var _0x3c307f=_0x2588a3?0x0:_0x380eb4['offset'];var _0x315c50=_0x2588a3?_0x935134['count']:_0x380eb4[_0x844e('0x1c')]+_0x380eb4[_0x844e('0x1e')];var _0x2d6ba8;if(_0x315c50>=_0x36286c){_0x315c50=_0x36286c;_0x2d6ba8=0xc8;}else{_0x2d6ba8=0xce;}_0x465e49[_0x844e('0x1a')](_0x2d6ba8);return _0x465e49[_0x844e('0x1f')](_0x844e('0x20'),_0x3c307f+'-'+_0x315c50+'/'+_0x36286c)[_0x844e('0x1b')](_0x935134);}return null;};}function patchUpdates(_0x243aeb){return function(_0x4ffb86){try{jsonpatch[_0x844e('0x21')](_0x4ffb86,_0x243aeb,!![]);}catch(_0x50aeec){return BPromise['reject'](_0x50aeec);}return _0x4ffb86[_0x844e('0x22')]();};}function saveUpdates(_0x345dcc,_0x439b26){return function(_0x286fdd){if(_0x286fdd){return _0x286fdd['update'](_0x345dcc)[_0x844e('0x23')](function(_0x3dde07){return _0x3dde07;});}return null;};}function removeEntity(_0x571498,_0x2520f8){return function(_0x13489b){if(_0x13489b){return _0x13489b[_0x844e('0x24')]()[_0x844e('0x23')](function(){_0x571498[_0x844e('0x1a')](0xcc)[_0x844e('0x25')]();});}};}function handleEntityNotFound(_0x498ae0,_0x399a81){return function(_0xadf0d8){if(!_0xadf0d8){_0x498ae0[_0x844e('0x19')](0x194);}return _0xadf0d8;};}function handleError(_0x263702,_0x2c915f){_0x2c915f=_0x2c915f||0x1f4;return function(_0x5d6856){logger[_0x844e('0x26')](_0x5d6856['stack']);if(_0x5d6856['name']){delete _0x5d6856[_0x844e('0x27')];}_0x263702[_0x844e('0x1a')](_0x2c915f)[_0x844e('0x28')](_0x5d6856);};}exports['index']=function(_0x489349,_0x2d4acd){var _0xc3ec93={},_0x54fd73={},_0x228cc1={'count':0x0,'rows':[]};var _0x81d4de=_[_0x844e('0x29')](db[_0x844e('0x2a')][_0x844e('0x2b')],function(_0x799cde){return{'name':_0x799cde[_0x844e('0x2c')],'type':_0x799cde[_0x844e('0x2d')][_0x844e('0x2e')]};});_0x54fd73[_0x844e('0x2f')]=_['map'](_0x81d4de,_0x844e('0x27'));_0x54fd73[_0x844e('0x30')]=_[_0x844e('0x31')](_0x489349[_0x844e('0x30')]);_0x54fd73[_0x844e('0x32')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],_0x54fd73['query']);_0xc3ec93[_0x844e('0x34')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],qs['fields'](_0x489349[_0x844e('0x30')][_0x844e('0x35')]));_0xc3ec93['attributes']=_0xc3ec93[_0x844e('0x34')][_0x844e('0x36')]?_0xc3ec93['attributes']:_0x54fd73[_0x844e('0x2f')];if(!_0x489349[_0x844e('0x30')][_0x844e('0x37')](_0x844e('0x38'))){_0xc3ec93[_0x844e('0x1e')]=qs[_0x844e('0x1e')](_0x489349[_0x844e('0x30')]['limit']);_0xc3ec93[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x489349[_0x844e('0x30')][_0x844e('0x1c')]);}_0xc3ec93[_0x844e('0x39')]=qs[_0x844e('0x3a')](_0x489349[_0x844e('0x30')][_0x844e('0x3a')]);_0xc3ec93[_0x844e('0x3b')]=qs[_0x844e('0x32')](_[_0x844e('0x3c')](_0x489349['query'],_0x54fd73['filters']),_0x81d4de);if(_0x489349[_0x844e('0x30')][_0x844e('0x3d')]){_0xc3ec93[_0x844e('0x3b')]=_[_0x844e('0x3e')](_0xc3ec93[_0x844e('0x3b')],{'$or':_[_0x844e('0x29')](_0x81d4de,function(_0x6f902e){if(_0x6f902e[_0x844e('0x2d')]!==_0x844e('0x3f')){var _0x539077={};_0x539077[_0x6f902e[_0x844e('0x27')]]={'$like':'%'+_0x489349['query'][_0x844e('0x3d')]+'%'};return _0x539077;}})});}_0xc3ec93=_['merge']({},_0xc3ec93,_0x489349[_0x844e('0x40')]);var _0x5dc530={'where':_0xc3ec93[_0x844e('0x3b')]};return db[_0x844e('0x2a')][_0x844e('0x41')](_0x5dc530)[_0x844e('0x23')](function(_0x2eb412){_0x228cc1[_0x844e('0x41')]=_0x2eb412;if(_0x489349[_0x844e('0x30')][_0x844e('0x42')]){_0xc3ec93[_0x844e('0x43')]=[{'all':!![]}];}return db[_0x844e('0x2a')][_0x844e('0x44')](_0xc3ec93);})['then'](function(_0x3ecb60){_0x228cc1[_0x844e('0x45')]=_0x3ecb60;return _0x228cc1;})[_0x844e('0x23')](respondWithFilteredResult(_0x2d4acd,_0xc3ec93))['catch'](handleError(_0x2d4acd,null));};exports['show']=function(_0x213a9f,_0x3e24ca){var _0x1a7817={'raw':!![],'where':{'id':_0x213a9f['params']['id']}},_0x5d8cd9={};_0x5d8cd9['model']=_['keys'](db[_0x844e('0x2a')][_0x844e('0x2b')]);_0x5d8cd9[_0x844e('0x30')]=_[_0x844e('0x31')](_0x213a9f[_0x844e('0x30')]);_0x5d8cd9['filters']=_[_0x844e('0x33')](_0x5d8cd9['model'],_0x5d8cd9['query']);_0x1a7817[_0x844e('0x34')]=_[_0x844e('0x33')](_0x5d8cd9[_0x844e('0x2f')],qs[_0x844e('0x35')](_0x213a9f['query'][_0x844e('0x35')]));_0x1a7817[_0x844e('0x34')]=_0x1a7817[_0x844e('0x34')]['length']?_0x1a7817[_0x844e('0x34')]:_0x5d8cd9[_0x844e('0x2f')];if(_0x213a9f['query'][_0x844e('0x42')]){_0x1a7817[_0x844e('0x43')]=[{'all':!![]}];}_0x1a7817=_[_0x844e('0x3e')]({},_0x1a7817,_0x213a9f[_0x844e('0x40')]);return db[_0x844e('0x2a')][_0x844e('0x46')](_0x1a7817)['then'](handleEntityNotFound(_0x3e24ca,null))[_0x844e('0x23')](respondWithResult(_0x3e24ca,null))[_0x844e('0x47')](handleError(_0x3e24ca,null));};exports[_0x844e('0x48')]=function(_0x29dd8b,_0x1dcfcb){return db[_0x844e('0x2a')][_0x844e('0x48')](_0x29dd8b[_0x844e('0x49')],{})[_0x844e('0x23')](respondWithResult(_0x1dcfcb,0xc9))[_0x844e('0x47')](handleError(_0x1dcfcb,null));};exports['update']=function(_0x32e097,_0x694791){if(_0x32e097[_0x844e('0x49')]['id']){delete _0x32e097['body']['id'];}return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x32e097[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x694791,null))[_0x844e('0x23')](saveUpdates(_0x32e097[_0x844e('0x49')],null))[_0x844e('0x23')](respondWithResult(_0x694791,null))['catch'](handleError(_0x694791,null));};exports[_0x844e('0x24')]=function(_0x3c680c,_0x43e1f5){return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x3c680c[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x43e1f5,null))[_0x844e('0x23')](removeEntity(_0x43e1f5,null))[_0x844e('0x47')](handleError(_0x43e1f5,null));};exports[_0x844e('0x4b')]=function(_0x3af2fe,_0x1dda1d){return db[_0x844e('0x2a')]['describe']()[_0x844e('0x23')](respondWithResult(_0x1dda1d,null))[_0x844e('0x47')](handleError(_0x1dda1d,null));};
\ No newline at end of file
index 6861652..1fbdb36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4d5f29,_0x15dfc6){var _0x15caff=function(_0x5bd352){while(--_0x5bd352){_0x4d5f29['push'](_0x4d5f29['shift']());}};_0x15caff(++_0x15dfc6);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x44b4b7,_0x485b5d){var _0x41d798=function(_0x307b96){while(--_0x307b96){_0x44b4b7['push'](_0x44b4b7['shift']());}};_0x41d798(++_0x485b5d);}(_0x7a54,0x106));var _0x47a5=function(_0x1d864c,_0x1b6310){_0x1d864c=_0x1d864c-0x0;var _0x57cbea=_0x7a54[_0x1d864c];return _0x57cbea;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index ce51b63..43d4e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12fc=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x547957,_0x2c61a8){var _0x495282=function(_0x404db1){while(--_0x404db1){_0x547957['push'](_0x547957['shift']());}};_0x495282(++_0x2c61a8);}(_0x12fc,0x6a));var _0xc12f=function(_0x1c5228,_0x2fcf2f){_0x1c5228=_0x1c5228-0x0;var _0x31c046=_0x12fc[_0x1c5228];return _0x31c046;};'use strict';var _=require(_0xc12f('0x0'));var util=require('util');var moment=require(_0xc12f('0x1'));var BPromise=require(_0xc12f('0x2'));var rs=require(_0xc12f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc12f('0x4'))['db'];var utils=require(_0xc12f('0x5'));var logger=require('../../config/logger')(_0xc12f('0x6'));var config=require(_0xc12f('0x7'));var jayson=require(_0xc12f('0x8'));var client=jayson[_0xc12f('0x9')][_0xc12f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42765c,_0x40e1e2,_0xc435c9){return new BPromise(function(_0x227bbb,_0x28b917){return client[_0xc12f('0xb')](_0x42765c,_0xc435c9)['then'](function(_0x2be440){logger['info'](_0xc12f('0xc'),_0x40e1e2,_0xc12f('0xd'));logger[_0xc12f('0xe')](_0xc12f('0xf'),_0x40e1e2,'request\x20sent',JSON[_0xc12f('0x10')](_0x2be440));if(_0x2be440['error']){if(_0x2be440[_0xc12f('0x11')][_0xc12f('0x12')]===0x1f4){logger['error'](_0xc12f('0xc'),_0x40e1e2,_0x2be440['error']['message']);return _0x28b917(_0x2be440[_0xc12f('0x11')][_0xc12f('0x13')]);}logger[_0xc12f('0x11')]('Cdr,\x20%s,\x20%s',_0x40e1e2,_0x2be440[_0xc12f('0x11')][_0xc12f('0x13')]);return _0x227bbb(_0x2be440['error']['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x40e1e2,_0xc12f('0xd'));_0x227bbb(_0x2be440[_0xc12f('0x14')][_0xc12f('0x13')]);}})['catch'](function(_0x53815b){logger[_0xc12f('0x11')](_0xc12f('0xc'),_0x40e1e2,_0x53815b);_0x28b917(_0x53815b);});});}
\ No newline at end of file
+var _0x129f=['code','message','info','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x8e23b8,_0x3c520d){var _0x14bd74=function(_0xa4f16e){while(--_0xa4f16e){_0x8e23b8['push'](_0x8e23b8['shift']());}};_0x14bd74(++_0x3c520d);}(_0x129f,0x6f));var _0xf129=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x129f[_0x3b0731];return _0x4204d7;};'use strict';var _=require('lodash');var util=require(_0xf129('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf129('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf129('0x2'));var logger=require(_0xf129('0x3'))(_0xf129('0x4'));var config=require(_0xf129('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf129('0x6')][_0xf129('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x258674,_0x4a93bb,_0x20bc6f){return new BPromise(function(_0xe1b0b,_0x31ed2d){return client[_0xf129('0x8')](_0x258674,_0x20bc6f)[_0xf129('0x9')](function(_0x2b3f4f){logger['info'](_0xf129('0xa'),_0x4a93bb,'request\x20sent');logger['debug'](_0xf129('0xb'),_0x4a93bb,_0xf129('0xc'),JSON[_0xf129('0xd')](_0x2b3f4f));if(_0x2b3f4f[_0xf129('0xe')]){if(_0x2b3f4f['error'][_0xf129('0xf')]===0x1f4){logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);return _0x31ed2d(_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);}logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);return _0xe1b0b(_0x2b3f4f[_0xf129('0xe')][_0xf129('0x10')]);}else{logger[_0xf129('0x11')](_0xf129('0xa'),_0x4a93bb,_0xf129('0xc'));_0xe1b0b(_0x2b3f4f['result']['message']);}})['catch'](function(_0x355bc3){logger[_0xf129('0xe')](_0xf129('0xa'),_0x4a93bb,_0x355bc3);_0x31ed2d(_0x355bc3);});});}
\ No newline at end of file
index 3606b6d..e371663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x25831a,_0x3027d1){var _0x141686=function(_0xac7268){while(--_0xac7268){_0x25831a['push'](_0x25831a['shift']());}};_0x141686(++_0x3027d1);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5b733d,_0x272606){var _0x2b7995=function(_0x1e5bf8){while(--_0x1e5bf8){_0x5b733d['push'](_0x5b733d['shift']());}};_0x2b7995(++_0x272606);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index d6c4bd5..90dbdea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd53d=['exports','STRING','*,*,*,*'];(function(_0x4387a0,_0x1650ac){var _0x1184af=function(_0x4771a7){while(--_0x4771a7){_0x4387a0['push'](_0x4387a0['shift']());}};_0x1184af(++_0x1650ac);}(_0xd53d,0xb1));var _0xdd53=function(_0x144b64,_0x22055b){_0x144b64=_0x144b64-0x0;var _0x3d5704=_0xd53d[_0x144b64];return _0x3d5704;};'use strict';var Sequelize=require('sequelize');module[_0xdd53('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xdd53('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xdd53('0x1')]},'interval':{'type':Sequelize[_0xdd53('0x1')],'defaultValue':_0xdd53('0x2')}};
\ No newline at end of file
+var _0xf5d6=['STRING','sequelize','exports','INTEGER','noop'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xf5d6,0x79));var _0x6f5d=function(_0x1c5fb8,_0x1e6729){_0x1c5fb8=_0x1c5fb8-0x0;var _0x2c8c70=_0xf5d6[_0x1c5fb8];return _0x2c8c70;};'use strict';var Sequelize=require(_0x6f5d('0x0'));module[_0x6f5d('0x1')]={'priority':{'type':Sequelize[_0x6f5d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f5d('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6f5d('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 4497b07..51390ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe148=['bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','params','model','keys','rawAttributes','query','intersection','attributes','fields','merge','options','find','catch','body','ChatApplication','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe148,0x9e));var _0x8e14=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xe148[_0x2341c6];return _0x54c34d;};'use strict';var emlformat=require(_0x8e14('0x0'));var rimraf=require(_0x8e14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8e14('0x2'));var rp=require(_0x8e14('0x3'));var moment=require('moment');var BPromise=require(_0x8e14('0x4'));var Mustache=require(_0x8e14('0x5'));var util=require(_0x8e14('0x6'));var path=require(_0x8e14('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8e14('0x8'));var fs=require('fs');var fs_extra=require(_0x8e14('0x9'));var _=require('lodash');var squel=require(_0x8e14('0xa'));var crypto=require(_0x8e14('0xb'));var jsforce=require(_0x8e14('0xc'));var deskjs=require(_0x8e14('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8e14('0xe'));var Papa=require('papaparse');var Redis=require(_0x8e14('0xf'));var authService=require(_0x8e14('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8e14('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8e14('0x12'));var utils=require(_0x8e14('0x13'));var config=require(_0x8e14('0x14'));var licenseUtil=require(_0x8e14('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x243e4f,_0x5712fe){_0x5712fe=_0x5712fe||0xcc;return function(_0x5c49d9){if(_0x5c49d9){return _0x243e4f[_0x8e14('0x16')](_0x5712fe);}return _0x243e4f['status'](_0x5712fe)[_0x8e14('0x17')]();};}function respondWithResult(_0x4e1223,_0x59e069){_0x59e069=_0x59e069||0xc8;return function(_0x4f36a5){if(_0x4f36a5){return _0x4e1223[_0x8e14('0x18')](_0x59e069)[_0x8e14('0x19')](_0x4f36a5);}};}function respondWithFilteredResult(_0x13bdc0,_0x128217){return function(_0x40b964){if(_0x40b964){var _0x50db2e=typeof _0x128217[_0x8e14('0x1a')]===_0x8e14('0x1b')&&typeof _0x128217['limit']===_0x8e14('0x1b');var _0x201f86=_0x40b964[_0x8e14('0x1c')];var _0x169b84=_0x50db2e?0x0:_0x128217[_0x8e14('0x1a')];var _0x2510ce=_0x50db2e?_0x40b964[_0x8e14('0x1c')]:_0x128217[_0x8e14('0x1a')]+_0x128217[_0x8e14('0x1d')];var _0x2d1771;if(_0x2510ce>=_0x201f86){_0x2510ce=_0x201f86;_0x2d1771=0xc8;}else{_0x2d1771=0xce;}_0x13bdc0['status'](_0x2d1771);return _0x13bdc0[_0x8e14('0x1e')](_0x8e14('0x1f'),_0x169b84+'-'+_0x2510ce+'/'+_0x201f86)['json'](_0x40b964);}return null;};}function patchUpdates(_0x13587d){return function(_0x5a7d38){try{jsonpatch[_0x8e14('0x20')](_0x5a7d38,_0x13587d,!![]);}catch(_0x5550cb){return BPromise[_0x8e14('0x21')](_0x5550cb);}return _0x5a7d38[_0x8e14('0x22')]();};}function saveUpdates(_0x16d8e6,_0x4b3de5){return function(_0x23c5eb){if(_0x23c5eb){return _0x23c5eb[_0x8e14('0x23')](_0x16d8e6)['then'](function(_0x184cbd){return _0x184cbd;});}return null;};}function removeEntity(_0x2b7ff5,_0x1244d3){return function(_0x52b041){if(_0x52b041){return _0x52b041[_0x8e14('0x24')]()[_0x8e14('0x25')](function(){_0x2b7ff5[_0x8e14('0x18')](0xcc)[_0x8e14('0x17')]();});}};}function handleEntityNotFound(_0x5a0860,_0x28ee4a){return function(_0x5b4af3){if(!_0x5b4af3){_0x5a0860['sendStatus'](0x194);}return _0x5b4af3;};}function handleError(_0x2ad93d,_0x43b6db){_0x43b6db=_0x43b6db||0x1f4;return function(_0x356200){logger['error'](_0x356200[_0x8e14('0x26')]);if(_0x356200[_0x8e14('0x27')]){delete _0x356200[_0x8e14('0x27')];}_0x2ad93d[_0x8e14('0x18')](_0x43b6db)['send'](_0x356200);};}exports['show']=function(_0x2d88db,_0x46e737){var _0x170e0b={'raw':!![],'where':{'id':_0x2d88db[_0x8e14('0x28')]['id']}},_0x9eb6a7={};_0x9eb6a7[_0x8e14('0x29')]=_[_0x8e14('0x2a')](db['ChatApplication'][_0x8e14('0x2b')]);_0x9eb6a7[_0x8e14('0x2c')]=_[_0x8e14('0x2a')](_0x2d88db[_0x8e14('0x2c')]);_0x9eb6a7['filters']=_[_0x8e14('0x2d')](_0x9eb6a7[_0x8e14('0x29')],_0x9eb6a7[_0x8e14('0x2c')]);_0x170e0b[_0x8e14('0x2e')]=_[_0x8e14('0x2d')](_0x9eb6a7[_0x8e14('0x29')],qs[_0x8e14('0x2f')](_0x2d88db[_0x8e14('0x2c')][_0x8e14('0x2f')]));_0x170e0b[_0x8e14('0x2e')]=_0x170e0b[_0x8e14('0x2e')]['length']?_0x170e0b[_0x8e14('0x2e')]:_0x9eb6a7[_0x8e14('0x29')];if(_0x2d88db[_0x8e14('0x2c')]['includeAll']){_0x170e0b['include']=[{'all':!![]}];}_0x170e0b=_[_0x8e14('0x30')]({},_0x170e0b,_0x2d88db[_0x8e14('0x31')]);return db['ChatApplication'][_0x8e14('0x32')](_0x170e0b)[_0x8e14('0x25')](handleEntityNotFound(_0x46e737,null))['then'](respondWithResult(_0x46e737,null))[_0x8e14('0x33')](handleError(_0x46e737,null));};exports['update']=function(_0x70225c,_0xa71666){if(_0x70225c[_0x8e14('0x34')]['id']){delete _0x70225c[_0x8e14('0x34')]['id'];}return db['ChatApplication'][_0x8e14('0x32')]({'where':{'id':_0x70225c[_0x8e14('0x28')]['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0xa71666,null))['then'](saveUpdates(_0x70225c[_0x8e14('0x34')],null))[_0x8e14('0x25')](respondWithResult(_0xa71666,null))[_0x8e14('0x33')](handleError(_0xa71666,null));};exports['destroy']=function(_0x3d1558,_0x2256c0){return db[_0x8e14('0x35')][_0x8e14('0x32')]({'where':{'id':_0x3d1558['params']['id']}})[_0x8e14('0x25')](handleEntityNotFound(_0x2256c0,null))[_0x8e14('0x25')](removeEntity(_0x2256c0,null))['catch'](handleError(_0x2256c0,null));};
\ No newline at end of file
+var _0xfb3f=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','error','stack','name','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','ChatApplication','find','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x15c206,_0x41ee3f){var _0x16ac3b=function(_0x1c16f6){while(--_0x1c16f6){_0x15c206['push'](_0x15c206['shift']());}};_0x16ac3b(++_0x41ee3f);}(_0xfb3f,0xd9));var _0xffb3=function(_0x24023e,_0xc174d5){_0x24023e=_0x24023e-0x0;var _0x513000=_0xfb3f[_0x24023e];return _0x513000;};'use strict';var emlformat=require(_0xffb3('0x0'));var rimraf=require(_0xffb3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffb3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xffb3('0x3'));var Mustache=require('mustache');var util=require(_0xffb3('0x4'));var path=require(_0xffb3('0x5'));var sox=require(_0xffb3('0x6'));var csv=require(_0xffb3('0x7'));var ejs=require(_0xffb3('0x8'));var fs=require('fs');var fs_extra=require(_0xffb3('0x9'));var _=require(_0xffb3('0xa'));var squel=require(_0xffb3('0xb'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xc'));var deskjs=require(_0xffb3('0xd'));var toCsv=require(_0xffb3('0x7'));var querystring=require(_0xffb3('0xe'));var Papa=require(_0xffb3('0xf'));var Redis=require('ioredis');var authService=require(_0xffb3('0x10'));var qs=require(_0xffb3('0x11'));var as=require(_0xffb3('0x12'));var hardwareService=require(_0xffb3('0x13'));var logger=require(_0xffb3('0x14'))(_0xffb3('0x15'));var utils=require(_0xffb3('0x16'));var config=require(_0xffb3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xffb3('0x18'))['db'];function respondWithStatusCode(_0x40c953,_0x55192c){_0x55192c=_0x55192c||0xcc;return function(_0x21924a){if(_0x21924a){return _0x40c953[_0xffb3('0x19')](_0x55192c);}return _0x40c953[_0xffb3('0x1a')](_0x55192c)[_0xffb3('0x1b')]();};}function respondWithResult(_0x65ef59,_0x420156){_0x420156=_0x420156||0xc8;return function(_0x19ce6e){if(_0x19ce6e){return _0x65ef59[_0xffb3('0x1a')](_0x420156)[_0xffb3('0x1c')](_0x19ce6e);}};}function respondWithFilteredResult(_0x3183bd,_0x38daab){return function(_0x2c3ef7){if(_0x2c3ef7){var _0x4d3c48=typeof _0x38daab[_0xffb3('0x1d')]===_0xffb3('0x1e')&&typeof _0x38daab[_0xffb3('0x1f')]==='undefined';var _0x51f3bb=_0x2c3ef7[_0xffb3('0x20')];var _0x167ed7=_0x4d3c48?0x0:_0x38daab['offset'];var _0x3b35de=_0x4d3c48?_0x2c3ef7[_0xffb3('0x20')]:_0x38daab[_0xffb3('0x1d')]+_0x38daab['limit'];var _0x2dfb40;if(_0x3b35de>=_0x51f3bb){_0x3b35de=_0x51f3bb;_0x2dfb40=0xc8;}else{_0x2dfb40=0xce;}_0x3183bd[_0xffb3('0x1a')](_0x2dfb40);return _0x3183bd['set'](_0xffb3('0x21'),_0x167ed7+'-'+_0x3b35de+'/'+_0x51f3bb)[_0xffb3('0x1c')](_0x2c3ef7);}return null;};}function patchUpdates(_0x223ad5){return function(_0x21c9ad){try{jsonpatch[_0xffb3('0x22')](_0x21c9ad,_0x223ad5,!![]);}catch(_0x46858f){return BPromise[_0xffb3('0x23')](_0x46858f);}return _0x21c9ad['save']();};}function saveUpdates(_0x473cff,_0xe4c60e){return function(_0x5e0f48){if(_0x5e0f48){return _0x5e0f48[_0xffb3('0x24')](_0x473cff)['then'](function(_0x5b707a){return _0x5b707a;});}return null;};}function removeEntity(_0x24c502,_0x3d55e6){return function(_0x22bbea){if(_0x22bbea){return _0x22bbea[_0xffb3('0x25')]()[_0xffb3('0x26')](function(){_0x24c502[_0xffb3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x796b8e,_0x588608){return function(_0x1390c6){if(!_0x1390c6){_0x796b8e[_0xffb3('0x19')](0x194);}return _0x1390c6;};}function handleError(_0x5267f7,_0x32e047){_0x32e047=_0x32e047||0x1f4;return function(_0x5e0474){logger[_0xffb3('0x27')](_0x5e0474[_0xffb3('0x28')]);if(_0x5e0474[_0xffb3('0x29')]){delete _0x5e0474[_0xffb3('0x29')];}_0x5267f7['status'](_0x32e047)['send'](_0x5e0474);};}exports['show']=function(_0x52fc8c,_0xe3d338){var _0x5d1630={'raw':!![],'where':{'id':_0x52fc8c[_0xffb3('0x2a')]['id']}},_0x17f601={};_0x17f601[_0xffb3('0x2b')]=_[_0xffb3('0x2c')](db['ChatApplication'][_0xffb3('0x2d')]);_0x17f601[_0xffb3('0x2e')]=_['keys'](_0x52fc8c[_0xffb3('0x2e')]);_0x17f601[_0xffb3('0x2f')]=_[_0xffb3('0x30')](_0x17f601['model'],_0x17f601[_0xffb3('0x2e')]);_0x5d1630[_0xffb3('0x31')]=_[_0xffb3('0x30')](_0x17f601['model'],qs[_0xffb3('0x32')](_0x52fc8c[_0xffb3('0x2e')]['fields']));_0x5d1630[_0xffb3('0x31')]=_0x5d1630[_0xffb3('0x31')][_0xffb3('0x33')]?_0x5d1630[_0xffb3('0x31')]:_0x17f601[_0xffb3('0x2b')];if(_0x52fc8c['query'][_0xffb3('0x34')]){_0x5d1630[_0xffb3('0x35')]=[{'all':!![]}];}_0x5d1630=_[_0xffb3('0x36')]({},_0x5d1630,_0x52fc8c['options']);return db[_0xffb3('0x37')][_0xffb3('0x38')](_0x5d1630)['then'](handleEntityNotFound(_0xe3d338,null))[_0xffb3('0x26')](respondWithResult(_0xe3d338,null))[_0xffb3('0x39')](handleError(_0xe3d338,null));};exports['update']=function(_0x43f16c,_0x27b4f2){if(_0x43f16c['body']['id']){delete _0x43f16c['body']['id'];}return db['ChatApplication'][_0xffb3('0x38')]({'where':{'id':_0x43f16c[_0xffb3('0x2a')]['id']}})['then'](handleEntityNotFound(_0x27b4f2,null))[_0xffb3('0x26')](saveUpdates(_0x43f16c['body'],null))[_0xffb3('0x26')](respondWithResult(_0x27b4f2,null))[_0xffb3('0x39')](handleError(_0x27b4f2,null));};exports['destroy']=function(_0xbe01ca,_0x562740){return db[_0xffb3('0x37')][_0xffb3('0x38')]({'where':{'id':_0xbe01ca['params']['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x562740,null))[_0xffb3('0x26')](removeEntity(_0x562740,null))[_0xffb3('0x39')](handleError(_0x562740,null));};
\ No newline at end of file
index d322857..a2ce367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3e=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x5d0006,_0xe5a19a){var _0x3d5da6=function(_0x3abe5d){while(--_0x3abe5d){_0x5d0006['push'](_0x5d0006['shift']());}};_0x3d5da6(++_0xe5a19a);}(_0xed3e,0x1a0));var _0xeed3=function(_0x3d09b0,_0x75f6c6){_0x3d09b0=_0x3d09b0-0x0;var _0x29e940=_0xed3e[_0x3d09b0];return _0x29e940;};'use strict';var _=require(_0xeed3('0x0'));var util=require(_0xeed3('0x1'));var logger=require(_0xeed3('0x2'))(_0xeed3('0x3'));var moment=require('moment');var BPromise=require(_0xeed3('0x4'));var rp=require(_0xeed3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeed3('0x6'));var config=require(_0xeed3('0x7'));var attributes=require(_0xeed3('0x8'));module['exports']=function(_0x5f06c8,_0x3c8852){return _0x5f06c8['define'](_0xeed3('0x9'),attributes,{'tableName':_0xeed3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeed3('0xb')});};
\ No newline at end of file
+var _0x8a30=['util','api','moment','bluebird','rimraf','../../config/environment','./chatApplication.attributes','define','ChatApplication','utf8mb4','lodash'];(function(_0x533589,_0x7ea74f){var _0x1370ed=function(_0x1c573c){while(--_0x1c573c){_0x533589['push'](_0x533589['shift']());}};_0x1370ed(++_0x7ea74f);}(_0x8a30,0x1a1));var _0x08a3=function(_0x1f1ab1,_0x3bba8a){_0x1f1ab1=_0x1f1ab1-0x0;var _0x3955b0=_0x8a30[_0x1f1ab1];return _0x3955b0;};'use strict';var _=require(_0x08a3('0x0'));var util=require(_0x08a3('0x1'));var logger=require('../../config/logger')(_0x08a3('0x2'));var moment=require(_0x08a3('0x3'));var BPromise=require(_0x08a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x08a3('0x5'));var config=require(_0x08a3('0x6'));var attributes=require(_0x08a3('0x7'));module['exports']=function(_0xddad70,_0x5d969b){return _0xddad70[_0x08a3('0x8')](_0x08a3('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x08a3('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 49ce122..8b33002 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x662f=['code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x45c6a8,_0x354d52){var _0x8efab8=function(_0x324ecb){while(--_0x324ecb){_0x45c6a8['push'](_0x45c6a8['shift']());}};_0x8efab8(++_0x354d52);}(_0x662f,0x70));var _0xf662=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x662f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf662('0x0'));var util=require(_0xf662('0x1'));var moment=require('moment');var BPromise=require(_0xf662('0x2'));var rs=require(_0xf662('0x3'));var fs=require('fs');var Redis=require(_0xf662('0x4'));var db=require(_0xf662('0x5'))['db'];var utils=require(_0xf662('0x6'));var logger=require(_0xf662('0x7'))(_0xf662('0x8'));var config=require(_0xf662('0x9'));var jayson=require(_0xf662('0xa'));var client=jayson[_0xf662('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b7ddd,_0x366bd8,_0x105c4b){return new BPromise(function(_0x1a37e,_0x53fe6b){return client[_0xf662('0xc')](_0x5b7ddd,_0x105c4b)[_0xf662('0xd')](function(_0x180022){logger[_0xf662('0xe')](_0xf662('0xf'),_0x366bd8,_0xf662('0x10'));logger['debug'](_0xf662('0x11'),_0x366bd8,_0xf662('0x10'),JSON[_0xf662('0x12')](_0x180022));if(_0x180022[_0xf662('0x13')]){if(_0x180022[_0xf662('0x13')][_0xf662('0x14')]===0x1f4){logger[_0xf662('0x13')](_0xf662('0xf'),_0x366bd8,_0x180022[_0xf662('0x13')]['message']);return _0x53fe6b(_0x180022[_0xf662('0x13')][_0xf662('0x15')]);}logger['error'](_0xf662('0xf'),_0x366bd8,_0x180022[_0xf662('0x13')][_0xf662('0x15')]);return _0x1a37e(_0x180022[_0xf662('0x13')][_0xf662('0x15')]);}else{logger[_0xf662('0xe')](_0xf662('0xf'),_0x366bd8,_0xf662('0x10'));_0x1a37e(_0x180022['result'][_0xf662('0x15')]);}})['catch'](function(_0x3f8174){logger['error']('ChatApplication,\x20%s,\x20%s',_0x366bd8,_0x3f8174);_0x53fe6b(_0x3f8174);});});}
\ No newline at end of file
+var _0xc6dc=['randomstring','../../config/logger','rpc','../../config/environment','then','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','moment','bluebird'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0xc6dc,0x152));var _0xcc6d=function(_0x2213be,_0x514e4a){_0x2213be=_0x2213be-0x0;var _0x539784=_0xc6dc[_0x2213be];return _0x539784;};'use strict';var _=require(_0xcc6d('0x0'));var util=require(_0xcc6d('0x1'));var moment=require(_0xcc6d('0x2'));var BPromise=require(_0xcc6d('0x3'));var rs=require(_0xcc6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcc6d('0x5'))(_0xcc6d('0x6'));var config=require(_0xcc6d('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x23c442,_0x16da88,_0x11cd2c){return new BPromise(function(_0x1e7dd9,_0x236fe7){return client['request'](_0x23c442,_0x11cd2c)[_0xcc6d('0x8')](function(_0x3b125f){logger['info'](_0xcc6d('0x9'),_0x16da88,'request\x20sent');logger[_0xcc6d('0xa')](_0xcc6d('0xb'),_0x16da88,'request\x20sent',JSON[_0xcc6d('0xc')](_0x3b125f));if(_0x3b125f['error']){if(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xe')]===0x1f4){logger['error'](_0xcc6d('0x9'),_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x236fe7(_0x3b125f['error'][_0xcc6d('0xf')]);}logger[_0xcc6d('0xd')]('ChatApplication,\x20%s,\x20%s',_0x16da88,_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);return _0x1e7dd9(_0x3b125f[_0xcc6d('0xd')][_0xcc6d('0xf')]);}else{logger[_0xcc6d('0x10')]('ChatApplication,\x20%s,\x20%s',_0x16da88,_0xcc6d('0x11'));_0x1e7dd9(_0x3b125f['result'][_0xcc6d('0xf')]);}})[_0xcc6d('0x12')](function(_0x37a63e){logger[_0xcc6d('0xd')](_0xcc6d('0x9'),_0x16da88,_0x37a63e);_0x236fe7(_0x37a63e);});});}
\ No newline at end of file
index 62c13ea..2f8263d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1003=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4a599b,_0x3f4138){var _0x397cb3=function(_0x119ce5){while(--_0x119ce5){_0x4a599b['push'](_0x4a599b['shift']());}};_0x397cb3(++_0x3f4138);}(_0x1003,0x167));var _0x3100=function(_0x38bb06,_0x42ed06){_0x38bb06=_0x38bb06-0x0;var _0x16df36=_0x1003[_0x38bb06];return _0x16df36;};'use strict';var multer=require(_0x3100('0x0'));var util=require(_0x3100('0x1'));var path=require('path');var timeout=require(_0x3100('0x2'));var express=require(_0x3100('0x3'));var router=express[_0x3100('0x4')]();var fs_extra=require(_0x3100('0x5'));var auth=require(_0x3100('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3100('0x7'));var controller=require(_0x3100('0x8'));router[_0x3100('0x9')]('/:id',auth[_0x3100('0xa')](),controller[_0x3100('0xb')]);router[_0x3100('0xc')](_0x3100('0xd'),auth['isAuthenticated'](),controller[_0x3100('0xe')]);router[_0x3100('0xf')](_0x3100('0xd'),auth[_0x3100('0xa')](),controller[_0x3100('0x10')]);module[_0x3100('0x11')]=router;
\ No newline at end of file
+var _0xa68d=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','isAuthenticated','show','put','/:id','delete','destroy','multer'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xa68d,0x1ee));var _0xda68=function(_0x451ccc,_0x46b2ad){_0x451ccc=_0x451ccc-0x0;var _0x1b0978=_0xa68d[_0x451ccc];return _0x1b0978;};'use strict';var multer=require(_0xda68('0x0'));var util=require(_0xda68('0x1'));var path=require(_0xda68('0x2'));var timeout=require(_0xda68('0x3'));var express=require('express');var router=express[_0xda68('0x4')]();var fs_extra=require(_0xda68('0x5'));var auth=require(_0xda68('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xda68('0x7'));var controller=require(_0xda68('0x8'));router['get']('/:id',auth[_0xda68('0x9')](),controller[_0xda68('0xa')]);router[_0xda68('0xb')](_0xda68('0xc'),auth[_0xda68('0x9')](),controller['update']);router[_0xda68('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xda68('0xe')]);module['exports']=router;
\ No newline at end of file
index 20b8b7a..110c204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5418=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2fa457,_0x7021df){var _0x4f250a=function(_0xef901e){while(--_0xef901e){_0x2fa457['push'](_0x2fa457['shift']());}};_0x4f250a(++_0x7021df);}(_0x5418,0x7e));var _0x8541=function(_0x25e801,_0x57dcf2){_0x25e801=_0x25e801-0x0;var _0x14f4fd=_0x5418[_0x25e801];return _0x14f4fd;};'use strict';var Sequelize=require(_0x8541('0x0'));module[_0x8541('0x1')]={'name':{'type':Sequelize[_0x8541('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x8541('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xec79=['BOOLEAN','STRING'];(function(_0x567d9c,_0x50405d){var _0x472c9b=function(_0x1e0ba){while(--_0x1e0ba){_0x567d9c['push'](_0x567d9c['shift']());}};_0x472c9b(++_0x50405d);}(_0xec79,0x1b7));var _0x9ec7=function(_0x385f77,_0x27f2a0){_0x385f77=_0x385f77-0x0;var _0x5b21c6=_0xec79[_0x385f77];return _0x5b21c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9ec7('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x9ec7('0x0')]},'write':{'type':Sequelize[_0x9ec7('0x1')],'defaultValue':!![]}};
\ No newline at end of file
index 1b5d3c5..c9377b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a8a=['register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','end','error','name','send','index','ChatGroup','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','options','includeAll','include','findAll','catch','show','params','keys','fields','merge','find','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','findOne','User','getMembers','removeMembers','ChatGroupId','create','split','format','getMessages','nolimit','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket'];(function(_0x431deb,_0x598e00){var _0x149073=function(_0x19fb4c){while(--_0x19fb4c){_0x431deb['push'](_0x431deb['shift']());}};_0x149073(++_0x598e00);}(_0x1a8a,0x1cb));var _0xa1a8=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x1a8a[_0x3ec333];return _0x15ccb8;};'use strict';var emlformat=require(_0xa1a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa1a8('0x1'));var jsonpatch=require(_0xa1a8('0x2'));var rp=require(_0xa1a8('0x3'));var moment=require(_0xa1a8('0x4'));var BPromise=require(_0xa1a8('0x5'));var Mustache=require('mustache');var util=require(_0xa1a8('0x6'));var path=require(_0xa1a8('0x7'));var sox=require(_0xa1a8('0x8'));var csv=require(_0xa1a8('0x9'));var ejs=require(_0xa1a8('0xa'));var fs=require('fs');var fs_extra=require(_0xa1a8('0xb'));var _=require(_0xa1a8('0xc'));var squel=require(_0xa1a8('0xd'));var crypto=require(_0xa1a8('0xe'));var jsforce=require(_0xa1a8('0xf'));var deskjs=require(_0xa1a8('0x10'));var toCsv=require(_0xa1a8('0x9'));var querystring=require(_0xa1a8('0x11'));var Papa=require(_0xa1a8('0x12'));var Redis=require(_0xa1a8('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1a8('0x14'));var logger=require(_0xa1a8('0x15'))(_0xa1a8('0x16'));var utils=require(_0xa1a8('0x17'));var config=require(_0xa1a8('0x18'));var licenseUtil=require(_0xa1a8('0x19'));var db=require(_0xa1a8('0x1a'))['db'];config[_0xa1a8('0x1b')]=_[_0xa1a8('0x1c')](config[_0xa1a8('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1a8('0x1d'))(new Redis(config[_0xa1a8('0x1b')]));require(_0xa1a8('0x1e'))[_0xa1a8('0x1f')](socket);function respondWithStatusCode(_0x3c7786,_0x191452){_0x191452=_0x191452||0xcc;return function(_0x537f5c){if(_0x537f5c){return _0x3c7786[_0xa1a8('0x20')](_0x191452);}return _0x3c7786[_0xa1a8('0x21')](_0x191452)['end']();};}function respondWithResult(_0xc59077,_0x155f2f){_0x155f2f=_0x155f2f||0xc8;return function(_0x3304ed){if(_0x3304ed){return _0xc59077[_0xa1a8('0x21')](_0x155f2f)[_0xa1a8('0x22')](_0x3304ed);}};}function respondWithFilteredResult(_0x3069e8,_0x13bf41){return function(_0x22dc63){if(_0x22dc63){var _0x36b5bc=typeof _0x13bf41[_0xa1a8('0x23')]==='undefined'&&typeof _0x13bf41[_0xa1a8('0x24')]===_0xa1a8('0x25');var _0x52822d=_0x22dc63[_0xa1a8('0x26')];var _0x120aa0=_0x36b5bc?0x0:_0x13bf41[_0xa1a8('0x23')];var _0x167aae=_0x36b5bc?_0x22dc63[_0xa1a8('0x26')]:_0x13bf41[_0xa1a8('0x23')]+_0x13bf41[_0xa1a8('0x24')];var _0x267b1d;if(_0x167aae>=_0x52822d){_0x167aae=_0x52822d;_0x267b1d=0xc8;}else{_0x267b1d=0xce;}_0x3069e8[_0xa1a8('0x21')](_0x267b1d);return _0x3069e8[_0xa1a8('0x27')](_0xa1a8('0x28'),_0x120aa0+'-'+_0x167aae+'/'+_0x52822d)[_0xa1a8('0x22')](_0x22dc63);}return null;};}function patchUpdates(_0x1bd96c){return function(_0x2c0005){try{jsonpatch[_0xa1a8('0x29')](_0x2c0005,_0x1bd96c,!![]);}catch(_0x163a35){return BPromise[_0xa1a8('0x2a')](_0x163a35);}return _0x2c0005[_0xa1a8('0x2b')]();};}function saveUpdates(_0x57447b,_0x532886){return function(_0x1ab3bf){if(_0x1ab3bf){return _0x1ab3bf[_0xa1a8('0x2c')](_0x57447b)['then'](function(_0x235fbb){return _0x235fbb;});}return null;};}function removeEntity(_0x325144,_0x49bdf6){return function(_0x5c0c5c){if(_0x5c0c5c){return _0x5c0c5c[_0xa1a8('0x2d')]()[_0xa1a8('0x2e')](function(){_0x325144[_0xa1a8('0x21')](0xcc)[_0xa1a8('0x2f')]();});}};}function handleEntityNotFound(_0x42c7d2,_0xdf2aee){return function(_0x5333ae){if(!_0x5333ae){_0x42c7d2[_0xa1a8('0x20')](0x194);}return _0x5333ae;};}function handleError(_0x31b419,_0x1648de){_0x1648de=_0x1648de||0x1f4;return function(_0x47a18a){logger[_0xa1a8('0x30')](_0x47a18a['stack']);if(_0x47a18a[_0xa1a8('0x31')]){delete _0x47a18a[_0xa1a8('0x31')];}_0x31b419['status'](_0x1648de)[_0xa1a8('0x32')](_0x47a18a);};}exports[_0xa1a8('0x33')]=function(_0x405afc,_0x46e477){var _0x45ef1c={},_0x396cb6={},_0x16961a={'count':0x0,'rows':[]};var _0x349bdb=_['map'](db[_0xa1a8('0x34')][_0xa1a8('0x35')],function(_0x217d0c){return{'name':_0x217d0c[_0xa1a8('0x36')],'type':_0x217d0c[_0xa1a8('0x37')][_0xa1a8('0x38')]};});_0x396cb6[_0xa1a8('0x39')]=_[_0xa1a8('0x3a')](_0x349bdb,_0xa1a8('0x31'));_0x396cb6[_0xa1a8('0x3b')]=_['keys'](_0x405afc[_0xa1a8('0x3b')]);_0x396cb6[_0xa1a8('0x3c')]=_['intersection'](_0x396cb6[_0xa1a8('0x39')],_0x396cb6['query']);_0x45ef1c[_0xa1a8('0x3d')]=_[_0xa1a8('0x3e')](_0x396cb6[_0xa1a8('0x39')],qs['fields'](_0x405afc[_0xa1a8('0x3b')]['fields']));_0x45ef1c[_0xa1a8('0x3d')]=_0x45ef1c[_0xa1a8('0x3d')][_0xa1a8('0x3f')]?_0x45ef1c[_0xa1a8('0x3d')]:_0x396cb6[_0xa1a8('0x39')];if(!_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x40')]('nolimit')){_0x45ef1c['limit']=qs[_0xa1a8('0x24')](_0x405afc['query']['limit']);_0x45ef1c[_0xa1a8('0x23')]=qs['offset'](_0x405afc['query'][_0xa1a8('0x23')]);}_0x45ef1c[_0xa1a8('0x41')]=qs['sort'](_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x45ef1c[_0xa1a8('0x43')]=qs[_0xa1a8('0x3c')](_[_0xa1a8('0x44')](_0x405afc[_0xa1a8('0x3b')],_0x396cb6[_0xa1a8('0x3c')]),_0x349bdb);if(_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x45ef1c['where']=_['merge'](_0x45ef1c[_0xa1a8('0x43')],{'$or':_[_0xa1a8('0x3a')](_0x349bdb,function(_0x41a66d){if(_0x41a66d[_0xa1a8('0x37')]!=='VIRTUAL'){var _0x42c21a={};_0x42c21a[_0x41a66d[_0xa1a8('0x31')]]={'$like':'%'+_0x405afc[_0xa1a8('0x3b')][_0xa1a8('0x45')]+'%'};return _0x42c21a;}})});}_0x45ef1c=_['merge']({},_0x45ef1c,_0x405afc[_0xa1a8('0x46')]);var _0x2833cd={'where':_0x45ef1c[_0xa1a8('0x43')]};return db[_0xa1a8('0x34')][_0xa1a8('0x26')](_0x2833cd)[_0xa1a8('0x2e')](function(_0x277a6b){_0x16961a[_0xa1a8('0x26')]=_0x277a6b;if(_0x405afc['query'][_0xa1a8('0x47')]){_0x45ef1c[_0xa1a8('0x48')]=[{'all':!![]}];}return db[_0xa1a8('0x34')][_0xa1a8('0x49')](_0x45ef1c);})[_0xa1a8('0x2e')](function(_0x16a61e){_0x16961a['rows']=_0x16a61e;return _0x16961a;})[_0xa1a8('0x2e')](respondWithFilteredResult(_0x46e477,_0x45ef1c))[_0xa1a8('0x4a')](handleError(_0x46e477,null));};exports[_0xa1a8('0x4b')]=function(_0x150a57,_0x50ee2b){var _0x23e4d={'raw':!![],'where':{'id':_0x150a57[_0xa1a8('0x4c')]['id']}},_0xc127cf={};_0xc127cf[_0xa1a8('0x39')]=_[_0xa1a8('0x4d')](db[_0xa1a8('0x34')][_0xa1a8('0x35')]);_0xc127cf[_0xa1a8('0x3b')]=_['keys'](_0x150a57[_0xa1a8('0x3b')]);_0xc127cf[_0xa1a8('0x3c')]=_[_0xa1a8('0x3e')](_0xc127cf[_0xa1a8('0x39')],_0xc127cf[_0xa1a8('0x3b')]);_0x23e4d['attributes']=_[_0xa1a8('0x3e')](_0xc127cf[_0xa1a8('0x39')],qs['fields'](_0x150a57[_0xa1a8('0x3b')][_0xa1a8('0x4e')]));_0x23e4d['attributes']=_0x23e4d['attributes'][_0xa1a8('0x3f')]?_0x23e4d[_0xa1a8('0x3d')]:_0xc127cf[_0xa1a8('0x39')];if(_0x150a57['query'][_0xa1a8('0x47')]){_0x23e4d['include']=[{'all':!![]}];}_0x23e4d=_[_0xa1a8('0x4f')]({},_0x23e4d,_0x150a57[_0xa1a8('0x46')]);return db[_0xa1a8('0x34')][_0xa1a8('0x50')](_0x23e4d)[_0xa1a8('0x2e')](handleEntityNotFound(_0x50ee2b,null))[_0xa1a8('0x2e')](respondWithResult(_0x50ee2b,null))['catch'](handleError(_0x50ee2b,null));};exports['create']=function(_0x38cad3,_0x551212){return db[_0xa1a8('0x34')]['create'](_0x38cad3[_0xa1a8('0x51')],{})[_0xa1a8('0x2e')](respondWithResult(_0x551212,0xc9))['catch'](handleError(_0x551212,null));};exports[_0xa1a8('0x2c')]=function(_0x517990,_0x193ae1){if(_0x517990[_0xa1a8('0x51')]['id']){delete _0x517990[_0xa1a8('0x51')]['id'];}return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x517990[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x193ae1,null))[_0xa1a8('0x2e')](saveUpdates(_0x517990[_0xa1a8('0x51')],null))[_0xa1a8('0x2e')](respondWithResult(_0x193ae1,null))[_0xa1a8('0x4a')](handleError(_0x193ae1,null));};exports['destroy']=function(_0x4ca62d,_0x357b8a){return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x4ca62d[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x357b8a,null))['then'](removeEntity(_0x357b8a,null))[_0xa1a8('0x4a')](handleError(_0x357b8a,null));};exports[_0xa1a8('0x52')]=function(_0x42d67e,_0x34d13f){return db[_0xa1a8('0x34')][_0xa1a8('0x52')]()[_0xa1a8('0x2e')](respondWithResult(_0x34d13f,null))[_0xa1a8('0x4a')](handleError(_0x34d13f,null));};exports[_0xa1a8('0x53')]=function(_0x3ee6cd,_0x27bb67,_0xe6a3c7){return db[_0xa1a8('0x54')][_0xa1a8('0x26')]({'where':{'ChatGroupId':_0x3ee6cd[_0xa1a8('0x4c')]['id'],'ToId':_0x3ee6cd['user']['id'],'read':![]}})[_0xa1a8('0x2e')](function(_0x4a3f09){return{'id':_['toInteger'](_0x3ee6cd[_0xa1a8('0x4c')]['id']),'count':_0x4a3f09};})['then'](respondWithResult(_0x27bb67,null))[_0xa1a8('0x4a')](handleError(_0x27bb67,null));};exports[_0xa1a8('0x55')]=function(_0x2ce24f,_0x522c48,_0x46702f){return db['ChatGroup'][_0xa1a8('0x50')]({'where':{'id':_0x2ce24f[_0xa1a8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x522c48,null))[_0xa1a8('0x2e')](function(_0x4b842b){if(_0x4b842b){return _0x4b842b[_0xa1a8('0x55')](_0x2ce24f[_0xa1a8('0x51')][_0xa1a8('0x56')],_[_0xa1a8('0x57')](_0x2ce24f[_0xa1a8('0x51')],[_0xa1a8('0x56'),'id'])||{});}})['then'](respondWithResult(_0x522c48,null))['catch'](handleError(_0x522c48,null));};exports['getMembers']=function(_0x2b00a2,_0x32b874,_0xdd8ab6){var _0x290cc3={};var _0xaec39c={};var _0x5616b0;var _0x409e01;return db[_0xa1a8('0x34')][_0xa1a8('0x58')]({'where':{'id':_0x2b00a2['params']['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x32b874,null))[_0xa1a8('0x2e')](function(_0x5272dd){if(_0x5272dd){_0x5616b0=_0x5272dd;_0xaec39c[_0xa1a8('0x39')]=_[_0xa1a8('0x4d')](db[_0xa1a8('0x59')]['rawAttributes']);_0xaec39c['query']=_['keys'](_0x2b00a2['query']);_0xaec39c[_0xa1a8('0x3c')]=_[_0xa1a8('0x3e')](_0xaec39c[_0xa1a8('0x39')],_0xaec39c['query']);_0x290cc3[_0xa1a8('0x3d')]=_[_0xa1a8('0x3e')](_0xaec39c['model'],qs[_0xa1a8('0x4e')](_0x2b00a2[_0xa1a8('0x3b')]['fields']));_0x290cc3[_0xa1a8('0x3d')]=_0x290cc3[_0xa1a8('0x3d')][_0xa1a8('0x3f')]?_0x290cc3[_0xa1a8('0x3d')]:_0xaec39c[_0xa1a8('0x39')];_0x290cc3[_0xa1a8('0x41')]=qs[_0xa1a8('0x42')](_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x290cc3['where']=qs[_0xa1a8('0x3c')](_[_0xa1a8('0x44')](_0x2b00a2[_0xa1a8('0x3b')],_0xaec39c[_0xa1a8('0x3c')]));if(_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x290cc3['where']=_[_0xa1a8('0x4f')](_0x290cc3['where'],{'$or':_[_0xa1a8('0x3a')](_0x290cc3['attributes'],function(_0xa996f2){var _0x17af3a={};_0x17af3a[_0xa996f2]={'$like':'%'+_0x2b00a2[_0xa1a8('0x3b')][_0xa1a8('0x45')]+'%'};return _0x17af3a;})});}_0x290cc3=_['merge']({},_0x290cc3,_0x2b00a2['options']);return _0x5616b0[_0xa1a8('0x5a')](_0x290cc3);}})[_0xa1a8('0x2e')](function(_0x4576c3){if(_0x4576c3){_0x409e01=_0x4576c3[_0xa1a8('0x3f')];if(!_0x2b00a2['query'][_0xa1a8('0x40')]('nolimit')){_0x290cc3[_0xa1a8('0x24')]=qs[_0xa1a8('0x24')](_0x2b00a2['query'][_0xa1a8('0x24')]);_0x290cc3[_0xa1a8('0x23')]=qs[_0xa1a8('0x23')](_0x2b00a2['query']['offset']);}return _0x5616b0['getMembers'](_0x290cc3);}})[_0xa1a8('0x2e')](function(_0x17433b){if(_0x17433b){return _0x17433b?{'count':_0x409e01,'rows':_0x17433b}:null;}})[_0xa1a8('0x2e')](respondWithResult(_0x32b874,null))[_0xa1a8('0x4a')](handleError(_0x32b874,null));};exports[_0xa1a8('0x5b')]=function(_0x5482c6,_0x3ef7a7,_0x488794){return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x5482c6[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x3ef7a7,null))[_0xa1a8('0x2e')](function(_0x16856a){if(_0x16856a){return _0x16856a[_0xa1a8('0x5b')](_0x5482c6[_0xa1a8('0x3b')][_0xa1a8('0x56')]);}})[_0xa1a8('0x2e')](respondWithStatusCode(_0x3ef7a7,null))[_0xa1a8('0x4a')](handleError(_0x3ef7a7,null));};exports['addMessage']=function(_0x36c219,_0x31feaa,_0xa8c914){if(_0x36c219[_0xa1a8('0x51')]['id']){delete _0x36c219['body']['id'];}return db[_0xa1a8('0x34')][_0xa1a8('0x50')]({'where':{'id':_0x36c219[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x31feaa,null))[_0xa1a8('0x2e')](function(_0x36b02e){if(_0x36b02e){_0x36c219[_0xa1a8('0x51')][_0xa1a8('0x5c')]=_0x36b02e['id'];return db[_0xa1a8('0x54')][_0xa1a8('0x5d')](_0x36c219[_0xa1a8('0x51')]);}})[_0xa1a8('0x2e')](respondWithResult(_0x31feaa,null))[_0xa1a8('0x4a')](handleError(_0x31feaa,null));};exports['getMessages']=function(_0x445a9d,_0x1e08ca,_0x520071){var _0x44fd01={};var _0x3813de={};var _0x1caaf6;var _0x3dd4ac;return db[_0xa1a8('0x34')]['findOne']({'where':{'id':_0x445a9d[_0xa1a8('0x4c')]['id']}})[_0xa1a8('0x2e')](handleEntityNotFound(_0x1e08ca,null))[_0xa1a8('0x2e')](function(_0x36ad21){if(_0x36ad21){_0x1caaf6=_0x36ad21;_0x3813de['model']=_[_0xa1a8('0x4d')](db['ChatInternalMessage'][_0xa1a8('0x35')]);_0x3813de[_0xa1a8('0x3b')]=_[_0xa1a8('0x4d')](_0x445a9d['query']);_0x3813de['filters']=_['intersection'](_0x3813de[_0xa1a8('0x39')],_0x3813de['query']);_0x44fd01['attributes']=_[_0xa1a8('0x3e')](_0x3813de[_0xa1a8('0x39')],qs[_0xa1a8('0x4e')](_0x445a9d['query'][_0xa1a8('0x4e')]));_0x44fd01['attributes']=_0x44fd01['attributes']['length']?_0x44fd01[_0xa1a8('0x3d')]:_0x3813de[_0xa1a8('0x39')];_0x44fd01['order']=qs['sort'](_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x42')]);_0x44fd01[_0xa1a8('0x43')]=qs['filters'](_['pick'](_0x445a9d[_0xa1a8('0x3b')],_0x3813de[_0xa1a8('0x3c')]));if(_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x45')]){_0x44fd01[_0xa1a8('0x43')]=_[_0xa1a8('0x4f')](_0x44fd01['where'],{'$or':_[_0xa1a8('0x3a')](_0x44fd01['attributes'],function(_0x5c4ed7){var _0xfb5858={};_0xfb5858[_0x5c4ed7]={'$like':'%'+_0x445a9d[_0xa1a8('0x3b')]['filter']+'%'};return _0xfb5858;})});}if(_0x445a9d[_0xa1a8('0x3b')]['$gte']){var _0x249961=_0x445a9d[_0xa1a8('0x3b')]['$gte'][_0xa1a8('0x5e')](',');var _0x1785a0={};_0x1785a0[_0x249961[0x0]]={'$gte':moment(_0x249961[0x1])[_0xa1a8('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x44fd01['where']=_['merge'](_0x44fd01['where'],_0x1785a0);}_0x44fd01=_['merge']({},_0x44fd01,_0x445a9d['options']);return _0x1caaf6[_0xa1a8('0x60')](_0x44fd01);}})[_0xa1a8('0x2e')](function(_0x2088e0){if(_0x2088e0){_0x3dd4ac=_0x2088e0['length'];if(!_0x445a9d['query'][_0xa1a8('0x40')](_0xa1a8('0x61'))){_0x44fd01['limit']=qs[_0xa1a8('0x24')](_0x445a9d['query'][_0xa1a8('0x24')]);_0x44fd01[_0xa1a8('0x23')]=qs[_0xa1a8('0x23')](_0x445a9d[_0xa1a8('0x3b')][_0xa1a8('0x23')]);}return _0x1caaf6[_0xa1a8('0x60')](_0x44fd01);}})[_0xa1a8('0x2e')](function(_0x295039){if(_0x295039){return _0x295039?{'count':_0x3dd4ac,'rows':_0x295039}:null;}})[_0xa1a8('0x2e')](respondWithResult(_0x1e08ca,null))['catch'](handleError(_0x1e08ca,null));};
\ No newline at end of file
+var _0x2a25=['to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','offset','undefined','limit','Content-Range','json','apply','reject','then','error','stack','name','index','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','keys','rawAttributes','fields','create','body','update','find','params','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x59c301,_0x359c50){var _0x3866b9=function(_0x2d380e){while(--_0x2d380e){_0x59c301['push'](_0x59c301['shift']());}};_0x3866b9(++_0x359c50);}(_0x2a25,0x124));var _0x52a2=function(_0x11405c,_0x5ec03b){_0x11405c=_0x11405c-0x0;var _0x31ce9c=_0x2a25[_0x11405c];return _0x31ce9c;};'use strict';var emlformat=require(_0x52a2('0x0'));var rimraf=require(_0x52a2('0x1'));var zipdir=require(_0x52a2('0x2'));var jsonpatch=require(_0x52a2('0x3'));var rp=require(_0x52a2('0x4'));var moment=require(_0x52a2('0x5'));var BPromise=require(_0x52a2('0x6'));var Mustache=require(_0x52a2('0x7'));var util=require(_0x52a2('0x8'));var path=require(_0x52a2('0x9'));var sox=require(_0x52a2('0xa'));var csv=require(_0x52a2('0xb'));var ejs=require(_0x52a2('0xc'));var fs=require('fs');var fs_extra=require(_0x52a2('0xd'));var _=require(_0x52a2('0xe'));var squel=require(_0x52a2('0xf'));var crypto=require('crypto');var jsforce=require(_0x52a2('0x10'));var deskjs=require(_0x52a2('0x11'));var toCsv=require(_0x52a2('0xb'));var querystring=require('querystring');var Papa=require(_0x52a2('0x12'));var Redis=require(_0x52a2('0x13'));var authService=require(_0x52a2('0x14'));var qs=require(_0x52a2('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52a2('0x16'));var logger=require('../../config/logger')(_0x52a2('0x17'));var utils=require(_0x52a2('0x18'));var config=require(_0x52a2('0x19'));var licenseUtil=require(_0x52a2('0x1a'));var db=require('../../mysqldb')['db'];config[_0x52a2('0x1b')]=_[_0x52a2('0x1c')](config[_0x52a2('0x1b')],{'host':_0x52a2('0x1d'),'port':0x18eb});var socket=require(_0x52a2('0x1e'))(new Redis(config['redis']));require(_0x52a2('0x1f'))[_0x52a2('0x20')](socket);function respondWithStatusCode(_0x5d46f4,_0x1144e1){_0x1144e1=_0x1144e1||0xcc;return function(_0x20d553){if(_0x20d553){return _0x5d46f4[_0x52a2('0x21')](_0x1144e1);}return _0x5d46f4[_0x52a2('0x22')](_0x1144e1)[_0x52a2('0x23')]();};}function respondWithResult(_0x8867f3,_0x2ba584){_0x2ba584=_0x2ba584||0xc8;return function(_0x2fa715){if(_0x2fa715){return _0x8867f3[_0x52a2('0x22')](_0x2ba584)['json'](_0x2fa715);}};}function respondWithFilteredResult(_0x592370,_0x3b8f84){return function(_0x27c683){if(_0x27c683){var _0x40564c=typeof _0x3b8f84[_0x52a2('0x24')]===_0x52a2('0x25')&&typeof _0x3b8f84[_0x52a2('0x26')]==='undefined';var _0x3e62ba=_0x27c683['count'];var _0x362432=_0x40564c?0x0:_0x3b8f84[_0x52a2('0x24')];var _0x126702=_0x40564c?_0x27c683['count']:_0x3b8f84[_0x52a2('0x24')]+_0x3b8f84[_0x52a2('0x26')];var _0x3097d4;if(_0x126702>=_0x3e62ba){_0x126702=_0x3e62ba;_0x3097d4=0xc8;}else{_0x3097d4=0xce;}_0x592370[_0x52a2('0x22')](_0x3097d4);return _0x592370['set'](_0x52a2('0x27'),_0x362432+'-'+_0x126702+'/'+_0x3e62ba)[_0x52a2('0x28')](_0x27c683);}return null;};}function patchUpdates(_0xd44942){return function(_0x3ec0b4){try{jsonpatch[_0x52a2('0x29')](_0x3ec0b4,_0xd44942,!![]);}catch(_0x30b334){return BPromise[_0x52a2('0x2a')](_0x30b334);}return _0x3ec0b4['save']();};}function saveUpdates(_0x1e4e35,_0x508957){return function(_0x52f96e){if(_0x52f96e){return _0x52f96e['update'](_0x1e4e35)[_0x52a2('0x2b')](function(_0xec4025){return _0xec4025;});}return null;};}function removeEntity(_0x2fdb51,_0x44b10d){return function(_0x923a17){if(_0x923a17){return _0x923a17['destroy']()[_0x52a2('0x2b')](function(){_0x2fdb51['status'](0xcc)[_0x52a2('0x23')]();});}};}function handleEntityNotFound(_0x5b6e78,_0x315864){return function(_0x458e1d){if(!_0x458e1d){_0x5b6e78[_0x52a2('0x21')](0x194);}return _0x458e1d;};}function handleError(_0x51fa0c,_0x32be22){_0x32be22=_0x32be22||0x1f4;return function(_0x5c1f95){logger[_0x52a2('0x2c')](_0x5c1f95[_0x52a2('0x2d')]);if(_0x5c1f95['name']){delete _0x5c1f95[_0x52a2('0x2e')];}_0x51fa0c['status'](_0x32be22)['send'](_0x5c1f95);};}exports[_0x52a2('0x2f')]=function(_0x4eb220,_0x3218e4){var _0x24863b={},_0x53057a={},_0x4db7f3={'count':0x0,'rows':[]};var _0x4d29a7=_[_0x52a2('0x30')](db[_0x52a2('0x31')]['rawAttributes'],function(_0x51b204){return{'name':_0x51b204[_0x52a2('0x32')],'type':_0x51b204[_0x52a2('0x33')][_0x52a2('0x34')]};});_0x53057a[_0x52a2('0x35')]=_[_0x52a2('0x30')](_0x4d29a7,_0x52a2('0x2e'));_0x53057a[_0x52a2('0x36')]=_['keys'](_0x4eb220[_0x52a2('0x36')]);_0x53057a[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x53057a[_0x52a2('0x35')],_0x53057a['query']);_0x24863b[_0x52a2('0x39')]=_['intersection'](_0x53057a['model'],qs['fields'](_0x4eb220[_0x52a2('0x36')]['fields']));_0x24863b[_0x52a2('0x39')]=_0x24863b[_0x52a2('0x39')][_0x52a2('0x3a')]?_0x24863b['attributes']:_0x53057a[_0x52a2('0x35')];if(!_0x4eb220[_0x52a2('0x36')]['hasOwnProperty']('nolimit')){_0x24863b['limit']=qs[_0x52a2('0x26')](_0x4eb220['query']['limit']);_0x24863b[_0x52a2('0x24')]=qs['offset'](_0x4eb220[_0x52a2('0x36')][_0x52a2('0x24')]);}_0x24863b[_0x52a2('0x3b')]=qs[_0x52a2('0x3c')](_0x4eb220[_0x52a2('0x36')]['sort']);_0x24863b['where']=qs[_0x52a2('0x37')](_[_0x52a2('0x3d')](_0x4eb220[_0x52a2('0x36')],_0x53057a[_0x52a2('0x37')]),_0x4d29a7);if(_0x4eb220[_0x52a2('0x36')][_0x52a2('0x3e')]){_0x24863b[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0x24863b['where'],{'$or':_[_0x52a2('0x30')](_0x4d29a7,function(_0x295543){if(_0x295543[_0x52a2('0x33')]!==_0x52a2('0x41')){var _0x510655={};_0x510655[_0x295543[_0x52a2('0x2e')]]={'$like':'%'+_0x4eb220[_0x52a2('0x36')][_0x52a2('0x3e')]+'%'};return _0x510655;}})});}_0x24863b=_[_0x52a2('0x40')]({},_0x24863b,_0x4eb220[_0x52a2('0x42')]);var _0x51d168={'where':_0x24863b[_0x52a2('0x3f')]};return db[_0x52a2('0x31')][_0x52a2('0x43')](_0x51d168)[_0x52a2('0x2b')](function(_0x3619b3){_0x4db7f3[_0x52a2('0x43')]=_0x3619b3;if(_0x4eb220[_0x52a2('0x36')][_0x52a2('0x44')]){_0x24863b[_0x52a2('0x45')]=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x24863b);})[_0x52a2('0x2b')](function(_0x1b694e){_0x4db7f3[_0x52a2('0x46')]=_0x1b694e;return _0x4db7f3;})[_0x52a2('0x2b')](respondWithFilteredResult(_0x3218e4,_0x24863b))[_0x52a2('0x47')](handleError(_0x3218e4,null));};exports[_0x52a2('0x48')]=function(_0x2608c2,_0x424eef){var _0x566f39={'raw':!![],'where':{'id':_0x2608c2['params']['id']}},_0x1c6d88={};_0x1c6d88[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x31')][_0x52a2('0x4a')]);_0x1c6d88[_0x52a2('0x36')]=_[_0x52a2('0x49')](_0x2608c2['query']);_0x1c6d88[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x1c6d88['model'],_0x1c6d88[_0x52a2('0x36')]);_0x566f39[_0x52a2('0x39')]=_[_0x52a2('0x38')](_0x1c6d88[_0x52a2('0x35')],qs[_0x52a2('0x4b')](_0x2608c2[_0x52a2('0x36')][_0x52a2('0x4b')]));_0x566f39['attributes']=_0x566f39[_0x52a2('0x39')][_0x52a2('0x3a')]?_0x566f39[_0x52a2('0x39')]:_0x1c6d88[_0x52a2('0x35')];if(_0x2608c2['query'][_0x52a2('0x44')]){_0x566f39[_0x52a2('0x45')]=[{'all':!![]}];}_0x566f39=_['merge']({},_0x566f39,_0x2608c2[_0x52a2('0x42')]);return db['ChatGroup']['find'](_0x566f39)[_0x52a2('0x2b')](handleEntityNotFound(_0x424eef,null))['then'](respondWithResult(_0x424eef,null))[_0x52a2('0x47')](handleError(_0x424eef,null));};exports[_0x52a2('0x4c')]=function(_0x31c628,_0x2a807a){return db[_0x52a2('0x31')][_0x52a2('0x4c')](_0x31c628[_0x52a2('0x4d')],{})[_0x52a2('0x2b')](respondWithResult(_0x2a807a,0xc9))[_0x52a2('0x47')](handleError(_0x2a807a,null));};exports[_0x52a2('0x4e')]=function(_0x5b75e4,_0x32f1fc){if(_0x5b75e4[_0x52a2('0x4d')]['id']){delete _0x5b75e4[_0x52a2('0x4d')]['id'];}return db[_0x52a2('0x31')][_0x52a2('0x4f')]({'where':{'id':_0x5b75e4[_0x52a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x32f1fc,null))[_0x52a2('0x2b')](saveUpdates(_0x5b75e4[_0x52a2('0x4d')],null))[_0x52a2('0x2b')](respondWithResult(_0x32f1fc,null))[_0x52a2('0x47')](handleError(_0x32f1fc,null));};exports[_0x52a2('0x51')]=function(_0xf589fd,_0x336447){return db[_0x52a2('0x31')]['find']({'where':{'id':_0xf589fd[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x336447,null))[_0x52a2('0x2b')](removeEntity(_0x336447,null))[_0x52a2('0x47')](handleError(_0x336447,null));};exports[_0x52a2('0x52')]=function(_0x15b25f,_0x2c4434){return db[_0x52a2('0x31')][_0x52a2('0x52')]()['then'](respondWithResult(_0x2c4434,null))[_0x52a2('0x47')](handleError(_0x2c4434,null));};exports[_0x52a2('0x53')]=function(_0x130b8c,_0x3d26eb,_0x14cbf5){return db[_0x52a2('0x54')][_0x52a2('0x43')]({'where':{'ChatGroupId':_0x130b8c[_0x52a2('0x50')]['id'],'ToId':_0x130b8c['user']['id'],'read':![]}})[_0x52a2('0x2b')](function(_0x20d9f2){return{'id':_[_0x52a2('0x55')](_0x130b8c[_0x52a2('0x50')]['id']),'count':_0x20d9f2};})[_0x52a2('0x2b')](respondWithResult(_0x3d26eb,null))['catch'](handleError(_0x3d26eb,null));};exports[_0x52a2('0x56')]=function(_0x6840f4,_0xb40ce5,_0x15fa7d){return db[_0x52a2('0x31')]['find']({'where':{'id':_0x6840f4['params']['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0xb40ce5,null))[_0x52a2('0x2b')](function(_0x5c19a2){if(_0x5c19a2){return _0x5c19a2['addMembers'](_0x6840f4[_0x52a2('0x4d')][_0x52a2('0x57')],_[_0x52a2('0x58')](_0x6840f4[_0x52a2('0x4d')],[_0x52a2('0x57'),'id'])||{});}})[_0x52a2('0x2b')](respondWithResult(_0xb40ce5,null))['catch'](handleError(_0xb40ce5,null));};exports[_0x52a2('0x59')]=function(_0x6616d7,_0x5eb12f,_0x2c6b44){var _0x19fcfa={};var _0x3df534={};var _0x120db4;var _0x4a33e8;return db[_0x52a2('0x31')][_0x52a2('0x5a')]({'where':{'id':_0x6616d7[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x5eb12f,null))[_0x52a2('0x2b')](function(_0x375f1d){if(_0x375f1d){_0x120db4=_0x375f1d;_0x3df534[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x5b')][_0x52a2('0x4a')]);_0x3df534[_0x52a2('0x36')]=_[_0x52a2('0x49')](_0x6616d7[_0x52a2('0x36')]);_0x3df534[_0x52a2('0x37')]=_['intersection'](_0x3df534[_0x52a2('0x35')],_0x3df534[_0x52a2('0x36')]);_0x19fcfa[_0x52a2('0x39')]=_[_0x52a2('0x38')](_0x3df534['model'],qs[_0x52a2('0x4b')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x4b')]));_0x19fcfa[_0x52a2('0x39')]=_0x19fcfa[_0x52a2('0x39')]['length']?_0x19fcfa[_0x52a2('0x39')]:_0x3df534['model'];_0x19fcfa[_0x52a2('0x3b')]=qs['sort'](_0x6616d7[_0x52a2('0x36')]['sort']);_0x19fcfa['where']=qs[_0x52a2('0x37')](_[_0x52a2('0x3d')](_0x6616d7['query'],_0x3df534['filters']));if(_0x6616d7['query'][_0x52a2('0x3e')]){_0x19fcfa[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0x19fcfa['where'],{'$or':_[_0x52a2('0x30')](_0x19fcfa[_0x52a2('0x39')],function(_0x5ca566){var _0x991cfe={};_0x991cfe[_0x5ca566]={'$like':'%'+_0x6616d7['query'][_0x52a2('0x3e')]+'%'};return _0x991cfe;})});}_0x19fcfa=_[_0x52a2('0x40')]({},_0x19fcfa,_0x6616d7[_0x52a2('0x42')]);return _0x120db4['getMembers'](_0x19fcfa);}})[_0x52a2('0x2b')](function(_0x1ccedd){if(_0x1ccedd){_0x4a33e8=_0x1ccedd['length'];if(!_0x6616d7[_0x52a2('0x36')]['hasOwnProperty']('nolimit')){_0x19fcfa[_0x52a2('0x26')]=qs[_0x52a2('0x26')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x26')]);_0x19fcfa[_0x52a2('0x24')]=qs[_0x52a2('0x24')](_0x6616d7[_0x52a2('0x36')][_0x52a2('0x24')]);}return _0x120db4[_0x52a2('0x59')](_0x19fcfa);}})[_0x52a2('0x2b')](function(_0x1c92b7){if(_0x1c92b7){return _0x1c92b7?{'count':_0x4a33e8,'rows':_0x1c92b7}:null;}})[_0x52a2('0x2b')](respondWithResult(_0x5eb12f,null))[_0x52a2('0x47')](handleError(_0x5eb12f,null));};exports['removeMembers']=function(_0x2a8b98,_0x3d771b,_0x5f4ffe){return db['ChatGroup'][_0x52a2('0x4f')]({'where':{'id':_0x2a8b98[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x3d771b,null))[_0x52a2('0x2b')](function(_0xcad25d){if(_0xcad25d){return _0xcad25d[_0x52a2('0x5c')](_0x2a8b98[_0x52a2('0x36')][_0x52a2('0x57')]);}})['then'](respondWithStatusCode(_0x3d771b,null))[_0x52a2('0x47')](handleError(_0x3d771b,null));};exports[_0x52a2('0x5d')]=function(_0x15d40b,_0x38c3c9,_0x32fd9e){if(_0x15d40b[_0x52a2('0x4d')]['id']){delete _0x15d40b[_0x52a2('0x4d')]['id'];}return db[_0x52a2('0x31')][_0x52a2('0x4f')]({'where':{'id':_0x15d40b[_0x52a2('0x50')]['id']}})[_0x52a2('0x2b')](handleEntityNotFound(_0x38c3c9,null))[_0x52a2('0x2b')](function(_0x45a2cd){if(_0x45a2cd){_0x15d40b[_0x52a2('0x4d')]['ChatGroupId']=_0x45a2cd['id'];return db['ChatInternalMessage']['create'](_0x15d40b[_0x52a2('0x4d')]);}})[_0x52a2('0x2b')](respondWithResult(_0x38c3c9,null))[_0x52a2('0x47')](handleError(_0x38c3c9,null));};exports[_0x52a2('0x5e')]=function(_0x5870dc,_0x232748,_0x81acb4){var _0xe2fa78={};var _0x3d5df7={};var _0x1c7cbc;var _0x2845af;return db['ChatGroup']['findOne']({'where':{'id':_0x5870dc[_0x52a2('0x50')]['id']}})['then'](handleEntityNotFound(_0x232748,null))[_0x52a2('0x2b')](function(_0x315a82){if(_0x315a82){_0x1c7cbc=_0x315a82;_0x3d5df7[_0x52a2('0x35')]=_[_0x52a2('0x49')](db[_0x52a2('0x54')][_0x52a2('0x4a')]);_0x3d5df7['query']=_[_0x52a2('0x49')](_0x5870dc['query']);_0x3d5df7[_0x52a2('0x37')]=_[_0x52a2('0x38')](_0x3d5df7['model'],_0x3d5df7['query']);_0xe2fa78[_0x52a2('0x39')]=_['intersection'](_0x3d5df7['model'],qs[_0x52a2('0x4b')](_0x5870dc['query']['fields']));_0xe2fa78[_0x52a2('0x39')]=_0xe2fa78[_0x52a2('0x39')]['length']?_0xe2fa78[_0x52a2('0x39')]:_0x3d5df7[_0x52a2('0x35')];_0xe2fa78[_0x52a2('0x3b')]=qs[_0x52a2('0x3c')](_0x5870dc[_0x52a2('0x36')][_0x52a2('0x3c')]);_0xe2fa78[_0x52a2('0x3f')]=qs[_0x52a2('0x37')](_['pick'](_0x5870dc[_0x52a2('0x36')],_0x3d5df7[_0x52a2('0x37')]));if(_0x5870dc[_0x52a2('0x36')]['filter']){_0xe2fa78[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0xe2fa78[_0x52a2('0x3f')],{'$or':_['map'](_0xe2fa78[_0x52a2('0x39')],function(_0x4f9b3b){var _0x27cef7={};_0x27cef7[_0x4f9b3b]={'$like':'%'+_0x5870dc[_0x52a2('0x36')][_0x52a2('0x3e')]+'%'};return _0x27cef7;})});}if(_0x5870dc['query'][_0x52a2('0x5f')]){var _0x300ad2=_0x5870dc[_0x52a2('0x36')][_0x52a2('0x5f')][_0x52a2('0x60')](',');var _0x4430df={};_0x4430df[_0x300ad2[0x0]]={'$gte':moment(_0x300ad2[0x1])[_0x52a2('0x61')](_0x52a2('0x62'))};_0xe2fa78[_0x52a2('0x3f')]=_[_0x52a2('0x40')](_0xe2fa78[_0x52a2('0x3f')],_0x4430df);}_0xe2fa78=_[_0x52a2('0x40')]({},_0xe2fa78,_0x5870dc['options']);return _0x1c7cbc[_0x52a2('0x5e')](_0xe2fa78);}})['then'](function(_0x4b25b){if(_0x4b25b){_0x2845af=_0x4b25b[_0x52a2('0x3a')];if(!_0x5870dc[_0x52a2('0x36')][_0x52a2('0x63')](_0x52a2('0x64'))){_0xe2fa78['limit']=qs[_0x52a2('0x26')](_0x5870dc['query']['limit']);_0xe2fa78[_0x52a2('0x24')]=qs[_0x52a2('0x24')](_0x5870dc[_0x52a2('0x36')][_0x52a2('0x24')]);}return _0x1c7cbc['getMessages'](_0xe2fa78);}})[_0x52a2('0x2b')](function(_0x26b7b5){if(_0x26b7b5){return _0x26b7b5?{'count':_0x2845af,'rows':_0x26b7b5}:null;}})[_0x52a2('0x2b')](respondWithResult(_0x232748,null))[_0x52a2('0x47')](handleError(_0x232748,null));};
\ No newline at end of file
index 634029d..f04d6ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd668=['events','../../mysqldb','ChatGroup','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x1be782,_0x11b259){var _0x3f58b6=function(_0x2bd850){while(--_0x2bd850){_0x1be782['push'](_0x1be782['shift']());}};_0x3f58b6(++_0x11b259);}(_0xd668,0x15e));var _0x8d66=function(_0x573e4d,_0x5db9f6){_0x573e4d=_0x573e4d-0x0;var _0xd07395=_0xd668[_0x573e4d];return _0xd07395;};'use strict';var EventEmitter=require(_0x8d66('0x0'));var ChatGroup=require(_0x8d66('0x1'))['db'][_0x8d66('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8d66('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x8d66('0x4')};function emitEvent(_0xd441a){return function(_0xcf5b34,_0x130aab,_0xa33fdd){ChatGroupEvents[_0x8d66('0x5')](_0xd441a+':'+_0xcf5b34['id'],_0xcf5b34);ChatGroupEvents[_0x8d66('0x5')](_0xd441a,_0xcf5b34);_0xa33fdd(null);};}for(var e in events){if(events[_0x8d66('0x6')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0x1c52=['ChatGroup','setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x1c52,0x7c));var _0x21c5=function(_0x146b5a,_0x3b6def){_0x146b5a=_0x146b5a-0x0;var _0x1fec16=_0x1c52[_0x146b5a];return _0x1fec16;};'use strict';var EventEmitter=require(_0x21c5('0x0'));var ChatGroup=require(_0x21c5('0x1'))['db'][_0x21c5('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x21c5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x26e3eb){return function(_0x67781f,_0x5374cd,_0x13c1a9){ChatGroupEvents[_0x21c5('0x4')](_0x26e3eb+':'+_0x67781f['id'],_0x67781f);ChatGroupEvents[_0x21c5('0x4')](_0x26e3eb,_0x67781f);_0x13c1a9(null);};}for(var e in events){if(events[_0x21c5('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x21c5('0x6')]=ChatGroupEvents;
\ No newline at end of file
index d686056..0d52163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09ae=['request-promise','path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x32f724,_0x279a99){var _0x28dd3d=function(_0x532539){while(--_0x532539){_0x32f724['push'](_0x32f724['shift']());}};_0x28dd3d(++_0x279a99);}(_0x09ae,0x156));var _0xe09a=function(_0x20ade1,_0x4ccc9f){_0x20ade1=_0x20ade1-0x0;var _0x57555a=_0x09ae[_0x20ade1];return _0x57555a;};'use strict';var _=require(_0xe09a('0x0'));var util=require(_0xe09a('0x1'));var logger=require(_0xe09a('0x2'))(_0xe09a('0x3'));var moment=require(_0xe09a('0x4'));var BPromise=require(_0xe09a('0x5'));var rp=require(_0xe09a('0x6'));var fs=require('fs');var path=require(_0xe09a('0x7'));var rimraf=require(_0xe09a('0x8'));var config=require(_0xe09a('0x9'));var attributes=require('./chatGroup.attributes');module[_0xe09a('0xa')]=function(_0x28f668,_0x1d3e06){return _0x28f668[_0xe09a('0xb')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5711=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x379aa6,_0x2ebf0f){var _0x39c23e=function(_0x57b9c6){while(--_0x57b9c6){_0x379aa6['push'](_0x379aa6['shift']());}};_0x39c23e(++_0x2ebf0f);}(_0x5711,0x1ce));var _0x1571=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x5711[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x1571('0x0'));var util=require(_0x1571('0x1'));var logger=require(_0x1571('0x2'))(_0x1571('0x3'));var moment=require(_0x1571('0x4'));var BPromise=require(_0x1571('0x5'));var rp=require(_0x1571('0x6'));var fs=require('fs');var path=require(_0x1571('0x7'));var rimraf=require('rimraf');var config=require(_0x1571('0x8'));var attributes=require(_0x1571('0x9'));module[_0x1571('0xa')]=function(_0x168e27,_0x3b52c3){return _0x168e27[_0x1571('0xb')](_0x1571('0xc'),attributes,{'tableName':_0x1571('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eb0fee4..4531982 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf864=['info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x41bfa8,_0x2222f0){var _0x5a689e=function(_0x9c9b27){while(--_0x9c9b27){_0x41bfa8['push'](_0x41bfa8['shift']());}};_0x5a689e(++_0x2222f0);}(_0xf864,0x1de));var _0x4f86=function(_0x53f808,_0x27dfe7){_0x53f808=_0x53f808-0x0;var _0x2c4c3d=_0xf864[_0x53f808];return _0x2c4c3d;};'use strict';var _=require('lodash');var util=require(_0x4f86('0x0'));var moment=require('moment');var BPromise=require(_0x4f86('0x1'));var rs=require(_0x4f86('0x2'));var fs=require('fs');var Redis=require(_0x4f86('0x3'));var db=require(_0x4f86('0x4'))['db'];var utils=require(_0x4f86('0x5'));var logger=require(_0x4f86('0x6'))(_0x4f86('0x7'));var config=require('../../config/environment');var jayson=require(_0x4f86('0x8'));var client=jayson[_0x4f86('0x9')][_0x4f86('0xa')]({'port':0x232a});config[_0x4f86('0xb')]=_[_0x4f86('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4f86('0xd'))(new Redis(config['redis']));require('./chatGroup.socket')['register'](socket);function respondWithRpcPromise(_0x473c33,_0x49005f,_0x2c7c7c){return new BPromise(function(_0x1026d8,_0x2a0615){return client[_0x4f86('0xe')](_0x473c33,_0x2c7c7c)['then'](function(_0x136583){logger['info'](_0x4f86('0xf'),_0x49005f,_0x4f86('0x10'));logger['debug'](_0x4f86('0x11'),_0x49005f,_0x4f86('0x10'),JSON[_0x4f86('0x12')](_0x136583));if(_0x136583[_0x4f86('0x13')]){if(_0x136583['error'][_0x4f86('0x14')]===0x1f4){logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);return _0x2a0615(_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);}logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x136583[_0x4f86('0x13')][_0x4f86('0x15')]);return _0x1026d8(_0x136583[_0x4f86('0x13')]['message']);}else{logger[_0x4f86('0x16')](_0x4f86('0xf'),_0x49005f,_0x4f86('0x10'));_0x1026d8(_0x136583[_0x4f86('0x17')][_0x4f86('0x15')]);}})[_0x4f86('0x18')](function(_0x13377c){logger[_0x4f86('0x13')](_0x4f86('0xf'),_0x49005f,_0x13377c);_0x2a0615(_0x13377c);});});}
\ No newline at end of file
+var _0x5636=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x515f3d,_0x178777){var _0xc8a93c=function(_0x2bd923){while(--_0x2bd923){_0x515f3d['push'](_0x515f3d['shift']());}};_0xc8a93c(++_0x178777);}(_0x5636,0x102));var _0x6563=function(_0x464ced,_0x151ad7){_0x464ced=_0x464ced-0x0;var _0x10bb0b=_0x5636[_0x464ced];return _0x10bb0b;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});config[_0x6563('0xa')]=_[_0x6563('0xb')](config[_0x6563('0xa')],{'host':_0x6563('0xc'),'port':0x18eb});var socket=require(_0x6563('0xd'))(new Redis(config[_0x6563('0xa')]));require(_0x6563('0xe'))[_0x6563('0xf')](socket);function respondWithRpcPromise(_0x516d1a,_0x51fdc2,_0x2946f3){return new BPromise(function(_0x129fa3,_0x490a56){return client['request'](_0x516d1a,_0x2946f3)['then'](function(_0x1ef002){logger[_0x6563('0x10')](_0x6563('0x11'),_0x51fdc2,_0x6563('0x12'));logger[_0x6563('0x13')](_0x6563('0x14'),_0x51fdc2,_0x6563('0x12'),JSON[_0x6563('0x15')](_0x1ef002));if(_0x1ef002[_0x6563('0x16')]){if(_0x1ef002['error'][_0x6563('0x17')]===0x1f4){logger['error'](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x490a56(_0x1ef002[_0x6563('0x16')]['message']);}logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x1ef002[_0x6563('0x16')][_0x6563('0x18')]);return _0x129fa3(_0x1ef002['error'][_0x6563('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x51fdc2,'request\x20sent');_0x129fa3(_0x1ef002[_0x6563('0x19')]['message']);}})['catch'](function(_0x27651b){logger[_0x6563('0x16')](_0x6563('0x11'),_0x51fdc2,_0x27651b);_0x490a56(_0x27651b);});});}
\ No newline at end of file
index 199ab3d..fac1185 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x772c=['./chatGroup.events','save','remove','update','emit','removeListener','register','length','chatGroup:'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x772c,0x195));var _0xc772=function(_0x3a0a1e,_0x41ffdc){_0x3a0a1e=_0x3a0a1e-0x0;var _0x137ae4=_0x772c[_0x3a0a1e];return _0x137ae4;};'use strict';var ChatGroupEvents=require(_0xc772('0x0'));var events=[_0xc772('0x1'),_0xc772('0x2'),_0xc772('0x3')];function createListener(_0x3d166d,_0x4923d3){return function(_0x56c82f){_0x4923d3[_0xc772('0x4')](_0x3d166d,_0x56c82f);};}function removeListener(_0x2ba75b,_0x4f06c3){return function(){ChatGroupEvents[_0xc772('0x5')](_0x2ba75b,_0x4f06c3);};}exports[_0xc772('0x6')]=function(_0x4b070d){for(var _0x5936c4=0x0,_0xfafc0e=events[_0xc772('0x7')];_0x5936c4<_0xfafc0e;_0x5936c4++){var _0x502f1f=events[_0x5936c4];var _0x33938d=createListener(_0xc772('0x8')+_0x502f1f,_0x4b070d);ChatGroupEvents['on'](_0x502f1f,_0x33938d);}};
\ No newline at end of file
+var _0x3cab=['register','length','chatGroup:','save','remove','update','removeListener'];(function(_0xd27eaa,_0x148204){var _0x12611d=function(_0x5d0b3b){while(--_0x5d0b3b){_0xd27eaa['push'](_0xd27eaa['shift']());}};_0x12611d(++_0x148204);}(_0x3cab,0x73));var _0xb3ca=function(_0x28a5ad,_0x520afa){_0x28a5ad=_0x28a5ad-0x0;var _0x176b8a=_0x3cab[_0x28a5ad];return _0x176b8a;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xb3ca('0x0'),_0xb3ca('0x1'),_0xb3ca('0x2')];function createListener(_0x6777de,_0x31ddb8){return function(_0x1147b8){_0x31ddb8['emit'](_0x6777de,_0x1147b8);};}function removeListener(_0x4ce829,_0x34490e){return function(){ChatGroupEvents[_0xb3ca('0x3')](_0x4ce829,_0x34490e);};}exports[_0xb3ca('0x4')]=function(_0x3d7f34){for(var _0x15c995=0x0,_0x2203a4=events[_0xb3ca('0x5')];_0x15c995<_0x2203a4;_0x15c995++){var _0x7de238=events[_0x15c995];var _0x1c3053=createListener(_0xb3ca('0x6')+_0x7de238,_0x3d7f34);ChatGroupEvents['on'](_0x7de238,_0x1c3053);}};
\ No newline at end of file
index 39223d8..e8b9ef6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd78c=['describe','/:id','/:id/unread','getUnread','getMembers','create','addMembers','post','/:id/messages','addMessage','update','destroy','delete','/:id/members','removeMembers','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0xd78c,0x160));var _0xcd78=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd78c[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xcd78('0x0'));var util=require(_0xcd78('0x1'));var path=require(_0xcd78('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd78('0x3'));var router=express['Router']();var fs_extra=require(_0xcd78('0x4'));var auth=require(_0xcd78('0x5'));var interaction=require(_0xcd78('0x6'));var config=require(_0xcd78('0x7'));var controller=require(_0xcd78('0x8'));router[_0xcd78('0x9')]('/',auth[_0xcd78('0xa')](),controller[_0xcd78('0xb')]);router[_0xcd78('0x9')]('/describe',auth[_0xcd78('0xa')](),controller[_0xcd78('0xc')]);router[_0xcd78('0x9')](_0xcd78('0xd'),auth[_0xcd78('0xa')](),controller['show']);router[_0xcd78('0x9')](_0xcd78('0xe'),auth['isAuthenticated'](),controller[_0xcd78('0xf')]);router[_0xcd78('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xcd78('0x10')]);router['get']('/:id/messages',auth[_0xcd78('0xa')](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0xcd78('0x11')]);router['post']('/:id/members',auth[_0xcd78('0xa')](),controller[_0xcd78('0x12')]);router[_0xcd78('0x13')](_0xcd78('0x14'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x15')]);router['put'](_0xcd78('0xd'),auth['isAuthenticated'](),controller[_0xcd78('0x16')]);router['delete'](_0xcd78('0xd'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x17')]);router[_0xcd78('0x18')](_0xcd78('0x19'),auth[_0xcd78('0xa')](),controller[_0xcd78('0x1a')]);module[_0xcd78('0x1b')]=router;
\ No newline at end of file
+var _0x9b2c=['addMessage','/:id','update','destroy','delete','removeMembers','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','show','getMembers','/:id/messages','getMessages','create','post','/:id/members','addMembers'];(function(_0x2c1fb7,_0x2d6fc4){var _0x494e07=function(_0x2f19fa){while(--_0x2f19fa){_0x2c1fb7['push'](_0x2c1fb7['shift']());}};_0x494e07(++_0x2d6fc4);}(_0x9b2c,0x124));var _0xc9b2=function(_0x57ee1d,_0x54111b){_0x57ee1d=_0x57ee1d-0x0;var _0x12a933=_0x9b2c[_0x57ee1d];return _0x12a933;};'use strict';var multer=require('multer');var util=require(_0xc9b2('0x0'));var path=require(_0xc9b2('0x1'));var timeout=require(_0xc9b2('0x2'));var express=require(_0xc9b2('0x3'));var router=express[_0xc9b2('0x4')]();var fs_extra=require(_0xc9b2('0x5'));var auth=require(_0xc9b2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc9b2('0x7'));var controller=require(_0xc9b2('0x8'));router[_0xc9b2('0x9')]('/',auth[_0xc9b2('0xa')](),controller['index']);router['get'](_0xc9b2('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xc')]);router['get']('/:id/unread',auth[_0xc9b2('0xa')](),controller['getUnread']);router[_0xc9b2('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xc9b2('0xd')]);router['get'](_0xc9b2('0xe'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0xf')]);router['post']('/',auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x10')]);router[_0xc9b2('0x11')](_0xc9b2('0x12'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x13')]);router[_0xc9b2('0x11')](_0xc9b2('0xe'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x14')]);router['put'](_0xc9b2('0x15'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x16')]);router['delete'](_0xc9b2('0x15'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x17')]);router[_0xc9b2('0x18')](_0xc9b2('0x12'),auth[_0xc9b2('0xa')](),controller[_0xc9b2('0x19')]);module['exports']=router;
\ No newline at end of file
index 3bbda30..3275b91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x5323d9,_0x328eb1){var _0x4e7790=function(_0x26f26b){while(--_0x26f26b){_0x5323d9['push'](_0x5323d9['shift']());}};_0x4e7790(++_0x328eb1);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x4ec791,_0x561b09){_0x4ec791=_0x4ec791-0x0;var _0x46e14e=_0x2f3a[_0x4ec791];return _0x46e14e;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xa2f3('0x1')]},'ratingType':{'type':Sequelize[_0xa2f3('0x2')](_0xa2f3('0x3'),_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x3')},'ratingMessage':{'type':Sequelize[_0xa2f3('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0xa2f3('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa2f3('0x6')]},'secondDisposition':{'type':Sequelize[_0xa2f3('0x6')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xa2f3('0x6')]},'browserVersion':{'type':Sequelize[_0xa2f3('0x6')]},'osName':{'type':Sequelize[_0xa2f3('0x6')]},'osVersion':{'type':Sequelize[_0xa2f3('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xa2f3('0x6')]},'deviceType':{'type':Sequelize[_0xa2f3('0x6')]},'referer':{'type':Sequelize[_0xa2f3('0x5')]},'customerIp':{'type':Sequelize[_0xa2f3('0x6')]},'formData':{'type':Sequelize[_0xa2f3('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgAt':{'type':Sequelize[_0xa2f3('0x7')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa2f3('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa2f3('0x6')]},'customerPort':{'type':Sequelize[_0xa2f3('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xa2f3('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4dd2=['out','exports','BOOLEAN','INTEGER','star','TEXT','STRING','DATE','long','ENUM'];(function(_0x33f186,_0x239ab9){var _0x235704=function(_0x458758){while(--_0x458758){_0x33f186['push'](_0x33f186['shift']());}};_0x235704(++_0x239ab9);}(_0x4dd2,0xf1));var _0x24dd=function(_0xe39824,_0xbdf61f){_0xe39824=_0xe39824-0x0;var _0x4bc31e=_0x4dd2[_0xe39824];return _0x4bc31e;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'closed':{'type':Sequelize[_0x24dd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x24dd('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x24dd('0x3'),'thumb'),'defaultValue':_0x24dd('0x3')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x24dd('0x4')]},'mailTranscript':{'type':Sequelize[_0x24dd('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x24dd('0x6')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x24dd('0x5')]},'note':{'type':Sequelize[_0x24dd('0x5')]},'browserName':{'type':Sequelize[_0x24dd('0x5')]},'browserVersion':{'type':Sequelize[_0x24dd('0x5')]},'osName':{'type':Sequelize[_0x24dd('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x24dd('0x5')]},'deviceVendor':{'type':Sequelize[_0x24dd('0x5')]},'deviceType':{'type':Sequelize[_0x24dd('0x5')]},'referer':{'type':Sequelize[_0x24dd('0x4')]},'customerIp':{'type':Sequelize[_0x24dd('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x24dd('0x7'))},'read1stAt':{'type':Sequelize[_0x24dd('0x6')]},'lastMsgAt':{'type':Sequelize[_0x24dd('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x24dd('0x8')]('in',_0x24dd('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x24dd('0x5')]},'customerPort':{'type':Sequelize[_0x24dd('0x5')]},'vidaooSessionId':{'type':Sequelize[_0x24dd('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 6fd3b11..0ba4299 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b45=['entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','originalname','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','download','close','root','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','ChatWebsite','ContactId','%s%d','agentAlias','System','Visitor','website_alias','agent_alias','User','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','hasOwnProperty','order','sort','pick','where','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','rows','nolimit','push','alias','includeAll','addTags','setTags','Tag','findAll','emit','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','get','Chat','Account','Owner','closedAt','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','existsSync','pipe','createWriteStream','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','zip-dir','moment','bluebird','mustache','util','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','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','result','catch','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','destroy','stack','name','send','render','merge','contact','agent','account','ChatInteraction','fieldName','type','key','getOptions','query','user','then','show','params','keys','rawAttributes','model','intersection','fields','attributes','length','include','options','find','create','body','describe','createVidaooSession','findOne','vidaooApiKey','vidaooEscalation','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','parse','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x511664,_0x2a7df1){var _0x12c43d=function(_0xf7e0ac){while(--_0xf7e0ac){_0x511664['push'](_0x511664['shift']());}};_0x12c43d(++_0x2a7df1);}(_0x0b45,0x6e));var _0x50b4=function(_0x43d87a,_0x5be6fc){_0x43d87a=_0x43d87a-0x0;var _0x4fb610=_0x0b45[_0x43d87a];return _0x4fb610;};'use strict';var rimraf=require(_0x50b4('0x0'));var zipdir=require(_0x50b4('0x1'));var rp=require('request-promise');var moment=require(_0x50b4('0x2'));var BPromise=require(_0x50b4('0x3'));var Mustache=require(_0x50b4('0x4'));var util=require(_0x50b4('0x5'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x50b4('0x6'));var interaction=require(_0x50b4('0x7'));var qs=require(_0x50b4('0x8'));var pdf=require(_0x50b4('0x9'));var logger=require(_0x50b4('0xa'))(_0x50b4('0xb'));var config=require(_0x50b4('0xc'));var db=require(_0x50b4('0xd'))['db'];config[_0x50b4('0xe')]=_[_0x50b4('0xf')](config[_0x50b4('0xe')],{'host':_0x50b4('0x10'),'port':0x18eb});var socket=require(_0x50b4('0x11'))(new Redis(config[_0x50b4('0xe')]));require(_0x50b4('0x12'))[_0x50b4('0x13')](socket);var jayson=require(_0x50b4('0x14'));var client=jayson[_0x50b4('0x15')][_0x50b4('0x16')]({'port':0x232b});var client9004=jayson[_0x50b4('0x15')][_0x50b4('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x355952,_0x4fcdc3,_0x37de3b,_0xe0ddff){return new BPromise(function(_0x466b87,_0x2fe440){var _0x2fc76f=_0xe0ddff||client;return _0x2fc76f[_0x50b4('0x17')](_0x355952,_0x37de3b)['then'](function(_0xc3cfad){logger[_0x50b4('0x18')](_0x50b4('0x19'),_0x4fcdc3,_0x50b4('0x1a'));logger[_0x50b4('0x1b')](_0x50b4('0x1c'),_0x4fcdc3,_0x50b4('0x1a'),JSON[_0x50b4('0x1d')](_0xc3cfad));if(_0xc3cfad[_0x50b4('0x1e')]){if(_0xc3cfad[_0x50b4('0x1e')][_0x50b4('0x1f')]===0x1f4){logger[_0x50b4('0x1e')](_0x50b4('0x19'),_0x4fcdc3,_0xc3cfad['error'][_0x50b4('0x20')]);return _0x2fe440(_0xc3cfad['error'][_0x50b4('0x20')]);}logger[_0x50b4('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x4fcdc3,_0xc3cfad['error'][_0x50b4('0x20')]);return _0x466b87(_0xc3cfad[_0x50b4('0x1e')]['message']);}else{logger[_0x50b4('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x4fcdc3,_0x50b4('0x1a'));_0x466b87(_0xc3cfad[_0x50b4('0x21')][_0x50b4('0x20')]);}})[_0x50b4('0x22')](function(_0x5e92f2){logger[_0x50b4('0x1e')](_0x50b4('0x19'),_0x4fcdc3,_0x5e92f2);_0x2fe440(_0x5e92f2);});});}function respondWithStatusCode(_0x44a329,_0x1dffee){_0x1dffee=_0x1dffee||0xcc;return function(_0x5a23c8){if(_0x5a23c8){return _0x44a329[_0x50b4('0x23')](_0x1dffee);}return _0x44a329[_0x50b4('0x24')](_0x1dffee)[_0x50b4('0x25')]();};}function respondWithResult(_0x5c14bd,_0x48d1b5){_0x48d1b5=_0x48d1b5||0xc8;return function(_0x574c7e){if(_0x574c7e){return _0x5c14bd[_0x50b4('0x24')](_0x48d1b5)[_0x50b4('0x26')](_0x574c7e);}};}function respondWithFilteredResult(_0x180616,_0x3bb284){return function(_0x395ef0){if(_0x395ef0){var _0x5f27ec=typeof _0x3bb284[_0x50b4('0x27')]==='undefined'&&typeof _0x3bb284[_0x50b4('0x28')]===_0x50b4('0x29');var _0x578227=_0x395ef0['count'];var _0x255eb7=_0x5f27ec?0x0:_0x3bb284['offset'];var _0x382235=_0x5f27ec?_0x395ef0['count']:_0x3bb284[_0x50b4('0x27')]+_0x3bb284[_0x50b4('0x28')];var _0x4e6020;if(_0x382235>=_0x578227){_0x382235=_0x578227;_0x4e6020=0xc8;}else{_0x4e6020=0xce;}_0x180616[_0x50b4('0x24')](_0x4e6020);return _0x180616[_0x50b4('0x2a')](_0x50b4('0x2b'),_0x255eb7+'-'+_0x382235+'/'+_0x578227)[_0x50b4('0x26')](_0x395ef0);}return null;};}function saveUpdates(_0x1401f7){return function(_0x17c6e5){if(_0x17c6e5){return _0x17c6e5[_0x50b4('0x2c')](_0x1401f7)['then'](function(_0x3f8ef4){return _0x3f8ef4;});}return null;};}function removeEntity(_0xe46bfc){return function(_0x10fbc0){if(_0x10fbc0){return _0x10fbc0[_0x50b4('0x2d')]()['then'](function(){_0xe46bfc[_0x50b4('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2485a7){return function(_0x227b7c){if(!_0x227b7c){_0x2485a7['sendStatus'](0x194);}return _0x227b7c;};}function handleError(_0x3b3f46,_0x5894b1){_0x5894b1=_0x5894b1||0x1f4;return function(_0x6a79ac){logger[_0x50b4('0x1e')](_0x6a79ac[_0x50b4('0x2e')]);if(_0x6a79ac[_0x50b4('0x2f')]){delete _0x6a79ac['name'];}_0x3b3f46[_0x50b4('0x24')](_0x5894b1)[_0x50b4('0x30')](_0x6a79ac);};}function getMustacheRender(_0x4ca061,_0x15b519){return Mustache[_0x50b4('0x31')](_0x4ca061,_[_0x50b4('0x32')](_0x15b519['body'],{'contact':_0x15b519[_0x50b4('0x33')],'message':_0x15b519[_0x50b4('0x20')],'agent':_0x15b519[_0x50b4('0x34')],'interaction':_0x15b519['interaction'],'account':_0x15b519[_0x50b4('0x35')]}))||'';}exports['index']=function(_0x2327b1,_0x5d580c){var _0x1d5e70={};var _0x43a345=_['map'](db[_0x50b4('0x36')]['rawAttributes'],function(_0x7655){return{'name':_0x7655[_0x50b4('0x37')],'type':_0x7655[_0x50b4('0x38')][_0x50b4('0x39')]};});_0x1d5e70=qs[_0x50b4('0x3a')](_0x43a345,_0x2327b1);return interaction['findAll']('chat',_0x2327b1[_0x50b4('0x3b')],_0x2327b1[_0x50b4('0x3c')],_0x1d5e70,_0x43a345)[_0x50b4('0x3d')](respondWithFilteredResult(_0x5d580c,_0x1d5e70))[_0x50b4('0x22')](handleError(_0x5d580c,null));};exports[_0x50b4('0x3e')]=function(_0x5e2007,_0x40f026){var _0xd6708c={'raw':![],'where':{'id':_0x5e2007[_0x50b4('0x3f')]['id']}},_0x44b3a0={};_0x44b3a0['model']=_[_0x50b4('0x40')](db[_0x50b4('0x36')][_0x50b4('0x41')]);_0x44b3a0[_0x50b4('0x3b')]=_['keys'](_0x5e2007[_0x50b4('0x3b')]);_0x44b3a0['filters']=_['intersection'](_0x44b3a0[_0x50b4('0x42')],_0x44b3a0['query']);_0xd6708c['attributes']=_[_0x50b4('0x43')](_0x44b3a0[_0x50b4('0x42')],qs['fields'](_0x5e2007[_0x50b4('0x3b')][_0x50b4('0x44')]));_0xd6708c[_0x50b4('0x45')]=_0xd6708c[_0x50b4('0x45')][_0x50b4('0x46')]?_0xd6708c['attributes']:_0x44b3a0[_0x50b4('0x42')];if(_0x5e2007[_0x50b4('0x3b')]['includeAll']){_0xd6708c[_0x50b4('0x47')]=[{'all':!![]}];}_0xd6708c=_[_0x50b4('0x32')]({},_0xd6708c,_0x5e2007[_0x50b4('0x48')]);return db[_0x50b4('0x36')][_0x50b4('0x49')](_0xd6708c)[_0x50b4('0x3d')](handleEntityNotFound(_0x40f026,null))[_0x50b4('0x3d')](respondWithResult(_0x40f026,null))['catch'](handleError(_0x40f026,null));};exports[_0x50b4('0x4a')]=function(_0x2fd69a,_0x593cb4){return db['ChatInteraction'][_0x50b4('0x4a')](_0x2fd69a['body'],{})[_0x50b4('0x3d')](respondWithResult(_0x593cb4,0xc9))[_0x50b4('0x22')](handleError(_0x593cb4,null));};exports[_0x50b4('0x2c')]=function(_0x5b490c,_0x5d08e0){if(_0x5b490c[_0x50b4('0x4b')]['id']){delete _0x5b490c['body']['id'];}return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x5b490c['params']['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x5d08e0,null))[_0x50b4('0x3d')](saveUpdates(_0x5b490c[_0x50b4('0x4b')],null))['then'](respondWithResult(_0x5d08e0,null))[_0x50b4('0x22')](handleError(_0x5d08e0,null));};exports['destroy']=function(_0x79facc,_0x1f9af8){return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x79facc['params']['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x1f9af8,null))['then'](removeEntity(_0x1f9af8,null))['catch'](handleError(_0x1f9af8,null));};exports['describe']=function(_0x1a9b9a,_0x3acd78){return db[_0x50b4('0x36')][_0x50b4('0x4c')]()[_0x50b4('0x3d')](respondWithResult(_0x3acd78,null))['catch'](handleError(_0x3acd78,null));};exports[_0x50b4('0x4d')]=function(_0x5a6bc4,_0x4ea6bf){var _0xae2806=_0x5a6bc4[_0x50b4('0x3f')]['id'];var _0x91b51;var _0x23b503;var _0x23b659;return db[_0x50b4('0x36')]['findOne']({'where':{'id':_0xae2806}})[_0x50b4('0x3d')](function(_0x13f24f){_0x91b51=_0x13f24f;return db['ChatWebsite'][_0x50b4('0x4e')]({'where':{'id':_0x13f24f['ChatWebsiteId']},'attributes':['id',_0x50b4('0x4f'),_0x50b4('0x50'),'vidaooTopic',_0x50b4('0x51'),_0x50b4('0x52')],'raw':!![]});})[_0x50b4('0x3d')](function(_0x336710){if(_0x336710&&_0x336710['vidaooApiKey']&&_0x336710[_0x50b4('0x50')]){_0x23b503=_0x336710;var _0x340cac={'interaction':{'id':_0xae2806},'agent':{'id':_0x5a6bc4['user']['id'],'name':_0x5a6bc4['user'][_0x50b4('0x2f')],'fullname':_0x5a6bc4['user'][_0x50b4('0x53')],'email':_0x5a6bc4[_0x50b4('0x3c')][_0x50b4('0x54')]},'contact':_0x5a6bc4['body'][_0x50b4('0x33')],'account':_0x5a6bc4[_0x50b4('0x4b')][_0x50b4('0x35')]};var _0x5ef2c1={'rejectUnauthorized':![],'method':_0x50b4('0x55'),'url':_0x50b4('0x56'),'headers':{'X-APIKEY':_0x336710[_0x50b4('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5a6bc4['user'][_0x50b4('0x54')]],'buttons':null,'topic':_0x23b503[_0x50b4('0x57')],'note':_[_0x50b4('0x58')](_0x23b503[_0x50b4('0x51')])?null:getMustacheRender(_0x23b503['vidaooNote'],_0x340cac),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x50b4('0x58')](_0x23b503[_0x50b4('0x52')])){var _0x3bec05=getMustacheRender(_0x23b503['vidaooMetadata'],_0x340cac);var _0x22f03b=JSON[_0x50b4('0x59')](_0x3bec05);_0x5ef2c1[_0x50b4('0x4b')]['metadata']=_0x22f03b;}}catch(_0x354592){throw new db['Sequelize'][(_0x50b4('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5ef2c1);}else{throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x5c'));}})[_0x50b4('0x3d')](function(_0x13d79b){_0x23b659=_0x13d79b;if(_0x23b659['id']){var _0x740545={'body':_0x23b659[_0x50b4('0x5d')],'ChatWebsiteId':_0x23b503['id'],'ChatInteractionId':_0x91b51['id'],'direction':_0x50b4('0x5e'),'UserId':_0x5a6bc4[_0x50b4('0x3c')]['id']};return db[_0x50b4('0x5f')][_0x50b4('0x4a')](_0x740545,{});}else{throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x60'));}})['then'](function(){return _0x91b51[_0x50b4('0x61')]({'vidaooSessionId':_0x23b659['id']});})['then'](respondWithResult(_0x4ea6bf,null))['catch'](handleError(_0x4ea6bf,null));};exports[_0x50b4('0x62')]=function(_0x2e9357,_0x4eb9d0){if(_0x2e9357[_0x50b4('0x4b')]['id']){delete _0x2e9357['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x2e9357[_0x50b4('0x3f')]['id']},'include':[{'model':db[_0x50b4('0x63')],'as':_0x50b4('0x64')}]})[_0x50b4('0x3d')](handleEntityNotFound(_0x4eb9d0,null))[_0x50b4('0x3d')](saveUpdates(_0x2e9357[_0x50b4('0x4b')],null))[_0x50b4('0x3d')](respondWithResult(_0x4eb9d0,null))['catch'](handleError(_0x4eb9d0,null));};exports[_0x50b4('0x65')]=function(_0x59de6f,_0x5db366){if(_0x59de6f['body']['id']){delete _0x59de6f[_0x50b4('0x4b')]['id'];}return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x59de6f['params']['id']}})[_0x50b4('0x3d')](function(_0x2c65f4){if(!_0x2c65f4){logger[_0x50b4('0x1e')](_0x50b4('0x66'),'abandon',0x194,_0x50b4('0x67'));_0x5db366[_0x50b4('0x23')](0x194);}else{if(_0x2c65f4[_0x50b4('0x68')]){throw new db[(_0x50b4('0x5b'))][(_0x50b4('0x5a'))](_0x50b4('0x69'));}}return _0x2c65f4;})[_0x50b4('0x3d')](function(_0x3148d9){if(_0x3148d9){return _0x3148d9[_0x50b4('0x2c')]({'closed':_0x59de6f['body']['closed'],'disposition':_0x59de6f[_0x50b4('0x4b')]['disposition']})[_0x50b4('0x3d')](function(_0x447002){return _0x447002;});}})[_0x50b4('0x3d')](function(){return respondWithRpcPromise(_0x50b4('0x6a'),_0x50b4('0x65'),_0x59de6f[_0x50b4('0x4b')],client9004);})[_0x50b4('0x3d')](respondWithResult(_0x5db366,null))[_0x50b4('0x22')](handleError(_0x5db366,null));};exports[_0x50b4('0x6b')]=function(_0x547c75,_0x12fae3){_0x547c75[_0x50b4('0x4b')][_0x50b4('0x2f')]=_0x547c75[_0x50b4('0x6c')][_0x50b4('0x6d')];_0x547c75[_0x50b4('0x4b')]['basename']=_0x547c75['file'][_0x50b4('0x6e')];_0x547c75[_0x50b4('0x4b')][_0x50b4('0x38')]=_0x547c75[_0x50b4('0x6c')][_0x50b4('0x6f')];return db[_0x50b4('0x70')][_0x50b4('0x4a')](_0x547c75[_0x50b4('0x4b')])['then'](respondWithResult(_0x12fae3,0xc9))[_0x50b4('0x22')](handleError(_0x12fae3,null));};exports[_0x50b4('0x71')]=function(_0x6bea9,_0x1e0ec5){return db['ChatInteraction'][_0x50b4('0x4e')]({'where':{'id':_0x6bea9[_0x50b4('0x3f')]['id']},'raw':!![]})[_0x50b4('0x3d')](handleEntityNotFound(_0x1e0ec5,null))[_0x50b4('0x3d')](function(_0x530949){if(_0x530949){if(_0x530949[_0x50b4('0x72')]){return _0x1e0ec5['status'](0x193)[_0x50b4('0x26')]({'status':0x193,'message':_0x50b4('0x73')});}return db[_0x50b4('0x70')]['findOne']({'where':{'id':_0x6bea9[_0x50b4('0x3b')][_0x50b4('0x74')]},'raw':!![]})[_0x50b4('0x3d')](handleEntityNotFound(_0x1e0ec5,null));}})['then'](function(_0x1cc159){if(_0x1cc159){var _0x29a248=_0x1cc159[_0x50b4('0x75')]!==null;var _0x34e173=path[_0x50b4('0x76')](config['root'],_0x50b4('0x77'));if(_0x29a248){_0x34e173=path[_0x50b4('0x76')](_0x34e173,_0x50b4('0x78'));}var _0x1714cf=path['join'](_0x34e173,_0x1cc159[_0x50b4('0x79')]);return _0x1e0ec5[_0x50b4('0x7a')](_0x1714cf);}})[_0x50b4('0x22')](handleError(_0x1e0ec5,null));};exports[_0x50b4('0x7b')]=function(_0x86852b,_0x57a6f6){var _0x85b646=null;var _0xd18230=null;var _0x4b09d3=null;if(_0x86852b[_0x50b4('0x4b')]['id']){delete _0x86852b[_0x50b4('0x4b')]['id'];}if(_0x86852b[_0x50b4('0x4b')]['mailTranscript']){_0x4b09d3=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],_0x50b4('0x7d'),util[_0x50b4('0x7e')](_0x50b4('0x7f'),Date[_0x50b4('0x80')]()));_0x86852b[_0x50b4('0x4b')][_0x50b4('0x81')]=_0x4b09d3;}return db[_0x50b4('0x36')]['find']({'where':{'id':_0x86852b['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x50b4('0x82'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x57a6f6,null))[_0x50b4('0x3d')](saveUpdates(_0x86852b[_0x50b4('0x4b')],null))[_0x50b4('0x3d')](function(_0x11a91a){if(_0x11a91a){_0x85b646=_0x11a91a;return db[_0x50b4('0x83')][_0x50b4('0x49')]({'where':{'id':_0x85b646['ChatWebsiteId']}});}})[_0x50b4('0x3d')](function(_0x4555ab){if(_0x4555ab){_0xd18230=_0x4555ab;return db[_0x50b4('0x63')][_0x50b4('0x49')]({'where':{'id':_0x85b646[_0x50b4('0x84')]}});}})[_0x50b4('0x3d')](function(_0x37c2de){if(_0x37c2de){if(_0x4b09d3){var _0x33ebd3=null;for(var _0x439d11=0x1;_0x439d11<_0x85b646[_0x50b4('0x82')][_0x50b4('0x46')];++_0x439d11){_0x33ebd3=_0x85b646['Messages'][_0x439d11];var _0x13c1cc=_0x33ebd3['UserId']?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230[_0x50b4('0x86')],_0x33ebd3['UserId']):_0x50b4('0x87');var _0x188c1e=_0x86852b[_0x50b4('0x4b')]['customer']||util[_0x50b4('0x7e')](_0x50b4('0x85'),_0x50b4('0x88'),_0x33ebd3[_0x50b4('0x84')]);switch(_0xd18230['agentIdentifier']){case _0x50b4('0x89'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230['agentAlias'],_0x33ebd3['UserId']):_0x50b4('0x87');break;case _0x50b4('0x8a'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?_0x33ebd3[_0x50b4('0x8b')]['alias']||_0x33ebd3['User']['fullname']:_0x50b4('0x87');break;case _0x50b4('0x8c'):_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?_0x33ebd3[_0x50b4('0x8b')]['fullname']:_0x50b4('0x87');break;default:_0x13c1cc=_0x33ebd3[_0x50b4('0x68')]?util[_0x50b4('0x7e')](_0x50b4('0x85'),_0xd18230[_0x50b4('0x86')],_0x33ebd3['UserId']):'System';}var _0x27b43e=util[_0x50b4('0x7e')](_0x50b4('0x8d'),moment(_0x33ebd3[_0x50b4('0x8e')])[_0x50b4('0x7e')](_0x50b4('0x8f')),_0x33ebd3[_0x50b4('0x90')]==='in'?_0x188c1e:_0x13c1cc,_0x33ebd3['body']);if(!_0x33ebd3[_0x50b4('0x91')]){fs['appendFileSync'](_0x4b09d3,_0x27b43e);}}return db[_0x50b4('0x92')][_0x50b4('0x4e')]({'where':{'service':!![]},'include':[{'model':db[_0x50b4('0x93')],'as':_0x50b4('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x50b4('0x3d')](function(_0x1cec94){if(!_0x1cec94||!_0x1cec94[_0x50b4('0x94')]||!_0x86852b['body'])return _0x85b646;var _0x45ca48=_0x1cec94[_0x50b4('0x95')]();return respondWithRpcPromise(_0x50b4('0x96'),'sendMail',{'account':_0x45ca48,'message':{'from':util['format'](_0x50b4('0x97'),_0x1cec94[_0x50b4('0x2f')],_0x1cec94[_0x50b4('0x54')]||_0x1cec94[_0x50b4('0x94')][_0x50b4('0x3c')]),'to':_0x86852b[_0x50b4('0x4b')][_0x50b4('0x98')],'subject':_0x50b4('0x99'),'text':util[_0x50b4('0x7e')](_0x50b4('0x9a'),_0x86852b[_0x50b4('0x4b')][_0x50b4('0x98')]),'attachments':[{'path':_0x4b09d3}]}})[_0x50b4('0x3d')](function(){return _0x85b646;})[_0x50b4('0x22')](function(_0x27636b){logger[_0x50b4('0x1e')](_0x27636b);});})[_0x50b4('0x3d')](respondWithStatusCode(_0x57a6f6,0xc8))[_0x50b4('0x22')](handleError(_0x57a6f6,null));};exports['addMessage']=function(_0x44e65d,_0x22e4b6){return db['ChatMessage']['find']({'where':{'id':_0x44e65d[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0x22e4b6,null))[_0x50b4('0x3d')](function(_0x34fbfc){if(_0x34fbfc){return _0x34fbfc[_0x50b4('0x9b')](_0x44e65d['body'][_0x50b4('0x9c')],_[_0x50b4('0x9d')](_0x44e65d['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x22e4b6,null))[_0x50b4('0x22')](handleError(_0x22e4b6,null));};exports[_0x50b4('0x9e')]=function(_0x112cda,_0xa99ab8){var _0x362a69={'raw':![],'where':{}};var _0x46260c={};var _0x3da943={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x112cda[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0xa99ab8,null))[_0x50b4('0x3d')](function(_0x3dd036){if(_0x3dd036){_0x46260c[_0x50b4('0x42')]=_[_0x50b4('0x40')](db[_0x50b4('0x5f')][_0x50b4('0x41')]);_0x46260c[_0x50b4('0x3b')]=_[_0x50b4('0x40')](_0x112cda[_0x50b4('0x3b')]);_0x46260c[_0x50b4('0x9f')]=_[_0x50b4('0x43')](_0x46260c[_0x50b4('0x42')],_0x46260c[_0x50b4('0x3b')]);_0x362a69[_0x50b4('0x45')]=_[_0x50b4('0x43')](_0x46260c['model'],qs['fields'](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x44')]));_0x362a69[_0x50b4('0x45')]=_0x362a69[_0x50b4('0x45')]['length']?_0x362a69[_0x50b4('0x45')]:_0x46260c[_0x50b4('0x42')];if(!_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa0')]('nolimit')){_0x362a69[_0x50b4('0x28')]=qs['limit'](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x28')]);_0x362a69['offset']=qs[_0x50b4('0x27')](_0x112cda[_0x50b4('0x3b')][_0x50b4('0x27')]);}_0x362a69[_0x50b4('0xa1')]=qs[_0x50b4('0xa2')](_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa2')]);_0x362a69['where']=qs[_0x50b4('0x9f')](_[_0x50b4('0xa3')](_0x112cda['query'],_0x46260c[_0x50b4('0x9f')]));_0x362a69[_0x50b4('0xa4')][_0x50b4('0xa5')]=_0x3dd036['id'];if(_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa6')]){_0x362a69[_0x50b4('0xa4')]=_['merge'](_0x362a69[_0x50b4('0xa4')],{'$or':_[_0x50b4('0xa7')](_0x362a69[_0x50b4('0x45')],function(_0x428b35){var _0x46cafa={};_0x46cafa[_0x428b35]={'$like':'%'+_0x112cda['query'][_0x50b4('0xa6')]+'%'};return _0x46cafa;})});}if(_0x112cda[_0x50b4('0x3b')][_0x50b4('0xa8')]){var _0x2afe6f=_0x112cda['query'][_0x50b4('0xa8')][_0x50b4('0xa9')](',');var _0x372042={};_0x372042[_0x2afe6f[0x0]]={'$gte':moment(_0x2afe6f[0x1])['format'](_0x50b4('0xaa'))};_0x362a69[_0x50b4('0xa4')]=_['merge'](_0x362a69['where'],_0x372042);}_0x362a69=_[_0x50b4('0x32')]({},_0x362a69,_0x112cda[_0x50b4('0x48')]);return db['ChatMessage']['count']({'where':_0x362a69[_0x50b4('0xa4')]})[_0x50b4('0x3d')](function(_0x2f14ce){_0x3da943[_0x50b4('0xab')]=_0x2f14ce;if(_0x112cda['query']['includeAll']){_0x362a69['include']=[{'all':!![]}];}return db[_0x50b4('0x5f')]['findAll'](_0x362a69);})['then'](function(_0x219893){_0x3da943[_0x50b4('0xac')]=_0x219893;return _0x3da943;});}})[_0x50b4('0x3d')](respondWithFilteredResult(_0xa99ab8,_0x362a69))['catch'](handleError(_0xa99ab8,null));};exports['getMyMessages']=function(_0x222476,_0xcd9e44){var _0x142eea={'where':{}},_0x396f9c={},_0x278a00={'count':0x0,'rows':[]};return db[_0x50b4('0x36')][_0x50b4('0x4e')]({'where':{'id':_0x222476[_0x50b4('0x3f')]['id']}})[_0x50b4('0x3d')](handleEntityNotFound(_0xcd9e44,null))[_0x50b4('0x3d')](function(_0x5e0dce){if(_0x5e0dce){_0x396f9c[_0x50b4('0x42')]=_['keys'](db[_0x50b4('0x5f')][_0x50b4('0x41')]);_0x396f9c[_0x50b4('0x3b')]=_[_0x50b4('0x40')](_0x222476[_0x50b4('0x3b')]);_0x396f9c[_0x50b4('0x9f')]=_['intersection'](_0x396f9c[_0x50b4('0x42')],_0x396f9c['query']);_0x142eea['attributes']=_[_0x50b4('0x43')](_0x396f9c[_0x50b4('0x42')],qs[_0x50b4('0x44')](_0x222476[_0x50b4('0x3b')]['fields']));_0x142eea['attributes']=_0x142eea[_0x50b4('0x45')][_0x50b4('0x46')]?_0x142eea[_0x50b4('0x45')]:_0x396f9c[_0x50b4('0x42')];if(!_0x222476[_0x50b4('0x3b')]['hasOwnProperty'](_0x50b4('0xad'))){_0x142eea[_0x50b4('0x28')]=qs[_0x50b4('0x28')](_0x222476['query'][_0x50b4('0x28')]);_0x142eea['offset']=qs['offset'](_0x222476['query'][_0x50b4('0x27')]);}_0x142eea[_0x50b4('0xa1')]=qs[_0x50b4('0xa2')](_0x222476['query'][_0x50b4('0xa2')]);_0x142eea['where']=qs['filters'](_['pick'](_0x222476[_0x50b4('0x3b')],_0x396f9c[_0x50b4('0x9f')]));_0x142eea['where'][_0x50b4('0xa5')]=_0x5e0dce['id'];if(_0x222476[_0x50b4('0x3b')]['filter']){_0x142eea[_0x50b4('0xa4')]=_[_0x50b4('0x32')](_0x142eea[_0x50b4('0xa4')],{'$or':_[_0x50b4('0xa7')](_0x142eea[_0x50b4('0x45')],function(_0x4de1d5){var _0x37ef3a={};_0x37ef3a[_0x4de1d5]={'$like':'%'+_0x222476[_0x50b4('0x3b')][_0x50b4('0xa6')]+'%'};return _0x37ef3a;})});}_0x142eea['where'][_0x50b4('0x91')]=![];if(_0x222476[_0x50b4('0x3b')]['id']){_0x142eea['where']['id']={'$gt':_0x222476['query']['id']};}_0x142eea=_[_0x50b4('0x32')]({},_0x142eea,_0x222476['options']);return db[_0x50b4('0x5f')][_0x50b4('0xab')]({'where':_0x142eea[_0x50b4('0xa4')]})['then'](function(_0xb620cd){_0x278a00['count']=_0xb620cd;_0x142eea[_0x50b4('0x47')]=[];if(_0x222476[_0x50b4('0x3b')]['includeAgent']){_0x142eea['include'][_0x50b4('0xae')]({'model':db[_0x50b4('0x8b')],'as':_0x50b4('0x8b'),'attributes':['id','fullname',_0x50b4('0xaf')]});}if(_0x222476[_0x50b4('0x3b')][_0x50b4('0xb0')]){_0x142eea['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x142eea);})[_0x50b4('0x3d')](function(_0x5e5e56){_0x278a00[_0x50b4('0xac')]=_0x5e5e56;return _0x278a00;});}})[_0x50b4('0x3d')](respondWithFilteredResult(_0xcd9e44,_0x142eea))['catch'](handleError(_0xcd9e44,null));};exports[_0x50b4('0xb1')]=function(_0x2f029c,_0x5d2a3a){return db[_0x50b4('0x36')][_0x50b4('0x49')]({'where':{'id':_0x2f029c[_0x50b4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5d2a3a,null))[_0x50b4('0x3d')](function(_0x3e60f7){if(_0x3e60f7){return _0x3e60f7[_0x50b4('0xb2')](_0x2f029c[_0x50b4('0x4b')]['ids'],_[_0x50b4('0x9d')](_0x2f029c['body'],[_0x50b4('0x9c'),'id'])||{})['spread'](function(){return db[_0x50b4('0xb3')][_0x50b4('0xb4')]({'attributes':['id',_0x50b4('0x2f'),'color'],'where':{'id':_0x2f029c['body'][_0x50b4('0x9c')]}});})[_0x50b4('0x3d')](function(_0x56e3dc){socket[_0x50b4('0xb5')]('chatInteractionTags:save',{'id':Number(_0x2f029c[_0x50b4('0x3f')]['id']),'tags':_0x56e3dc||[]});return{'id':Number(_0x2f029c['params']['id']),'tags':_0x56e3dc||[]};});}})['then'](respondWithResult(_0x5d2a3a,null))[_0x50b4('0x22')](handleError(_0x5d2a3a,null));};exports[_0x50b4('0xb6')]=function(_0x108d11,_0x51e495){return db[_0x50b4('0x36')]['find']({'where':{'id':_0x108d11[_0x50b4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x51e495,null))[_0x50b4('0x3d')](function(_0x158480){if(_0x158480){return _0x158480[_0x50b4('0xb6')](_0x108d11['query'][_0x50b4('0x9c')]);}})[_0x50b4('0x3d')](respondWithStatusCode(_0x51e495,null))[_0x50b4('0x22')](handleError(_0x51e495,null));};exports[_0x50b4('0x7a')]=function(_0x7500e,_0x1ea496){var _0x3cff4e=moment()['unix']()[_0x50b4('0xb7')]();var _0x4b657a=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],'server',_0x50b4('0xb8'),_0x50b4('0xb9'));var _0x40a1da=path[_0x50b4('0x76')](config[_0x50b4('0x7c')],_0x50b4('0xba'),_0x50b4('0xb8'),_0x50b4('0xbb'));var _0x114949=path[_0x50b4('0x76')](_0x4b657a,_0x3cff4e);var _0x318c51=util['format'](_0x50b4('0xbc'),_0x7500e[_0x50b4('0x3f')]['id'],_0x3cff4e);var _0x1d70fe=path[_0x50b4('0x76')](_0x4b657a,_0x318c51);var _0x15708b=[];_0x15708b[_0x50b4('0xae')]({'model':db[_0x50b4('0x8b')],'as':'User','attributes':['id',_0x50b4('0x53')],'raw':!![]});_0x15708b['push']({'model':db['CmContact'],'as':_0x50b4('0x64'),'attributes':['id',_0x50b4('0xbd'),_0x50b4('0xbe')],'raw':!![]});if(_0x7500e[_0x50b4('0x3b')][_0x50b4('0xbb')]){_0x15708b[_0x50b4('0xae')]({'model':db['Attachment'],'as':_0x50b4('0x70'),'raw':!![]});}var _0x248393=[{'model':db[_0x50b4('0x5f')],'as':'Messages','attributes':['id',_0x50b4('0x4b'),_0x50b4('0x8e'),_0x50b4('0x90'),_0x50b4('0x91'),_0x50b4('0xbf')],'include':_0x15708b}];_0x248393['push']({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x50b4('0x2f')]});_0x248393[_0x50b4('0xae')]({'model':db['User'],'as':'Owner','attributes':['id',_0x50b4('0x53')]});return db[_0x50b4('0x36')]['find']({'where':{'id':_0x7500e[_0x50b4('0x3f')]['id']},'include':_0x248393})[_0x50b4('0x3d')](handleEntityNotFound(_0x1ea496,null))['then'](function(_0x57c73f){if(_0x57c73f){var _0x40d159=_0x57c73f[_0x50b4('0xc0')]({'plain':!![]});fs['mkdirSync'](_0x114949);var _0x265bf9={'channel':_0x50b4('0xc1'),'account':_0x40d159[_0x50b4('0xc2')][_0x50b4('0x2f')],'agent':_0x40d159[_0x50b4('0xc3')]?_0x40d159[_0x50b4('0xc3')][_0x50b4('0x53')]:'N.A.','createdAt':moment(_0x40d159[_0x50b4('0x8e')])[_0x50b4('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x50b4('0xb7')](),'closedAt':_0x40d159[_0x50b4('0x72')]?moment(_0x40d159[_0x50b4('0xc4')])[_0x50b4('0x7e')](_0x50b4('0xaa'))[_0x50b4('0xb7')]():'','disposition':_0x40d159[_0x50b4('0xc5')],'chatInfo':{'browser':_0x40d159[_0x50b4('0xc6')],'os':_0x40d159[_0x50b4('0xc7')],'referer':_0x40d159[_0x50b4('0xc8')],'customerIp':_0x40d159[_0x50b4('0xc9')],'customerPort':_0x40d159[_0x50b4('0xca')]?_0x40d159[_0x50b4('0xca')]:_0x50b4('0xcb')},'messages':_(_0x40d159[_0x50b4('0x82')])['tail']()[_0x50b4('0xa6')]({'secret':![]})['map'](function(_0x2a68d1){if(_0x2a68d1[_0x50b4('0x70')]){var _0x5a7564=path[_0x50b4('0x76')](_0x40a1da,_0x2a68d1['Attachment'][_0x50b4('0x79')]);if(fs[_0x50b4('0xcc')](_0x5a7564)){fs['createReadStream'](_0x5a7564)[_0x50b4('0xcd')](fs[_0x50b4('0xce')](path['join'](_0x114949,_0x2a68d1[_0x50b4('0x70')][_0x50b4('0x79')])));}}return{'date':moment(_0x2a68d1[_0x50b4('0x8e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x50b4('0xb7')](),'sender':_0x2a68d1[_0x50b4('0x90')]===_0x50b4('0x5e')?_0x2a68d1['User']?_0x2a68d1[_0x50b4('0x8b')]['fullname']:_0x50b4('0x87'):_0x2a68d1['Contact'][_0x50b4('0xbd')]+(_0x2a68d1[_0x50b4('0x64')][_0x50b4('0xbe')]?'\x20'+_0x2a68d1['Contact'][_0x50b4('0xbe')]:''),'body':_0x2a68d1['Attachment']?_0x2a68d1[_0x50b4('0x70')][_0x50b4('0x79')]:_0x2a68d1[_0x50b4('0x4b')],'direction':_0x2a68d1[_0x50b4('0x90')]===_0x50b4('0x5e')?'A':'C','secret':_0x2a68d1[_0x50b4('0x91')],'read':_0x2a68d1[_0x50b4('0xbf')],'attachment':_0x2a68d1[_0x50b4('0x70')]};})[_0x50b4('0xcf')]()};return ejs['renderFile'](path[_0x50b4('0x76')](config[_0x50b4('0x7c')],'server','views',_0x50b4('0xd0')),{'interaction':_0x265bf9})['then'](function(_0x4a5e6d){var _0x11eb07=path['join'](_0x114949,_0x50b4('0xd1')+_0x40d159['id']+'-'+_0x3cff4e+_0x50b4('0xd2'));var _0x5b63fa={'path':_0x11eb07,'channel':'Chat','interactionId':_0x40d159['id']};return pdf[_0x50b4('0xd3')](_0x4a5e6d,_0x5b63fa);})['then'](function(){return new Promise(function(_0x42ff8c,_0x2d49b2){zipdir(_0x114949,{'saveTo':_0x1d70fe},function(_0x1c32c4,_0x26c39a){if(_0x1c32c4)return _0x2d49b2(_0x1c32c4);return _0x42ff8c(_0x26c39a);});})['then'](function(){return new BPromise(function(_0x1c95e8,_0x24d505){rimraf(_0x114949,function(_0x361d43){if(_0x361d43)_0x24d505(_0x361d43);return _0x1c95e8();});});})[_0x50b4('0x3d')](function(){return _0x1ea496['download'](_0x1d70fe,_0x318c51,function(_0x9f5975){if(_0x9f5975){logger[_0x50b4('0x1e')]('err',_0x9f5975);}else{fs[_0x50b4('0xd4')](_0x1d70fe);}});});});}else{return _0x1ea496['sendStatus'](0xc8);}})[_0x50b4('0x22')](handleError(_0x1ea496,null));};
\ No newline at end of file
+var _0x66da=['root','server/files/attachments/','download','server/files/chat/upload/','format','transcript-%s.txt','now','Messages','User','ChatWebsiteId','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','keys','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','includeAgent','push','spread','emit','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','value','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','name','send','render','merge','agent','interaction','index','map','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','user','show','params','model','filters','attributes','intersection','fields','length','include','options','find','create','body','destroy','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','fullname','email','contact','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','vidaooMetadata','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','type','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','join'];(function(_0x1bf662,_0x3f7906){var _0x55c6af=function(_0x2a2d9a){while(--_0x2a2d9a){_0x1bf662['push'](_0x1bf662['shift']());}};_0x55c6af(++_0x3f7906);}(_0x66da,0x126));var _0xa66d=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x66da[_0x50e593];return _0x3821d0;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa66d('0x0'));var rp=require(_0xa66d('0x1'));var moment=require(_0xa66d('0x2'));var BPromise=require(_0xa66d('0x3'));var Mustache=require(_0xa66d('0x4'));var util=require(_0xa66d('0x5'));var path=require(_0xa66d('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa66d('0x7'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0xa66d('0x8'));var logger=require(_0xa66d('0x9'))(_0xa66d('0xa'));var config=require(_0xa66d('0xb'));var db=require(_0xa66d('0xc'))['db'];config[_0xa66d('0xd')]=_['defaults'](config[_0xa66d('0xd')],{'host':_0xa66d('0xe'),'port':0x18eb});var socket=require(_0xa66d('0xf'))(new Redis(config[_0xa66d('0xd')]));require(_0xa66d('0x10'))[_0xa66d('0x11')](socket);var jayson=require(_0xa66d('0x12'));var client=jayson[_0xa66d('0x13')][_0xa66d('0x14')]({'port':0x232b});var client9004=jayson[_0xa66d('0x13')]['http']({'port':0x232c});function respondWithRpcPromise(_0x17c0cd,_0xf260c3,_0x1577f4,_0x149586){return new BPromise(function(_0x364337,_0x554bbb){var _0x225ffa=_0x149586||client;return _0x225ffa[_0xa66d('0x15')](_0x17c0cd,_0x1577f4)['then'](function(_0x3d23f8){logger[_0xa66d('0x16')]('ChatInteraction,\x20%s,\x20%s',_0xf260c3,'request\x20sent');logger[_0xa66d('0x17')](_0xa66d('0x18'),_0xf260c3,_0xa66d('0x19'),JSON[_0xa66d('0x1a')](_0x3d23f8));if(_0x3d23f8[_0xa66d('0x1b')]){if(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1c')]===0x1f4){logger['error'](_0xa66d('0x1d'),_0xf260c3,_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);return _0x554bbb(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);}logger[_0xa66d('0x1b')](_0xa66d('0x1d'),_0xf260c3,_0x3d23f8['error']['message']);return _0x364337(_0x3d23f8[_0xa66d('0x1b')][_0xa66d('0x1e')]);}else{logger[_0xa66d('0x16')](_0xa66d('0x1d'),_0xf260c3,_0xa66d('0x19'));_0x364337(_0x3d23f8[_0xa66d('0x1f')]['message']);}})[_0xa66d('0x20')](function(_0x26d92a){logger['error'](_0xa66d('0x1d'),_0xf260c3,_0x26d92a);_0x554bbb(_0x26d92a);});});}function respondWithStatusCode(_0x2f0085,_0x5d64b9){_0x5d64b9=_0x5d64b9||0xcc;return function(_0x368d9a){if(_0x368d9a){return _0x2f0085[_0xa66d('0x21')](_0x5d64b9);}return _0x2f0085[_0xa66d('0x22')](_0x5d64b9)[_0xa66d('0x23')]();};}function respondWithResult(_0x1f1c5d,_0x44c21a){_0x44c21a=_0x44c21a||0xc8;return function(_0x30363c){if(_0x30363c){return _0x1f1c5d['status'](_0x44c21a)[_0xa66d('0x24')](_0x30363c);}};}function respondWithFilteredResult(_0x29661e,_0x31e8a2){return function(_0x37fea6){if(_0x37fea6){var _0x1caacc=typeof _0x31e8a2['offset']===_0xa66d('0x25')&&typeof _0x31e8a2[_0xa66d('0x26')]===_0xa66d('0x25');var _0x56aab7=_0x37fea6[_0xa66d('0x27')];var _0x4629d2=_0x1caacc?0x0:_0x31e8a2[_0xa66d('0x28')];var _0x280da6=_0x1caacc?_0x37fea6[_0xa66d('0x27')]:_0x31e8a2['offset']+_0x31e8a2[_0xa66d('0x26')];var _0x28b99b;if(_0x280da6>=_0x56aab7){_0x280da6=_0x56aab7;_0x28b99b=0xc8;}else{_0x28b99b=0xce;}_0x29661e[_0xa66d('0x22')](_0x28b99b);return _0x29661e[_0xa66d('0x29')](_0xa66d('0x2a'),_0x4629d2+'-'+_0x280da6+'/'+_0x56aab7)[_0xa66d('0x24')](_0x37fea6);}return null;};}function saveUpdates(_0xcb4adf){return function(_0x59408d){if(_0x59408d){return _0x59408d[_0xa66d('0x2b')](_0xcb4adf)[_0xa66d('0x2c')](function(_0x26646e){return _0x26646e;});}return null;};}function removeEntity(_0x2b1ab5){return function(_0x2d9cf2){if(_0x2d9cf2){return _0x2d9cf2['destroy']()[_0xa66d('0x2c')](function(){_0x2b1ab5[_0xa66d('0x22')](0xcc)[_0xa66d('0x23')]();});}};}function handleEntityNotFound(_0xd9bfba){return function(_0x365811){if(!_0x365811){_0xd9bfba[_0xa66d('0x21')](0x194);}return _0x365811;};}function handleError(_0x304ec9,_0x223cdb){_0x223cdb=_0x223cdb||0x1f4;return function(_0x1b298c){logger['error'](_0x1b298c['stack']);if(_0x1b298c['name']){delete _0x1b298c[_0xa66d('0x2d')];}_0x304ec9['status'](_0x223cdb)[_0xa66d('0x2e')](_0x1b298c);};}function getMustacheRender(_0x13308d,_0x418baf){return Mustache[_0xa66d('0x2f')](_0x13308d,_[_0xa66d('0x30')](_0x418baf['body'],{'contact':_0x418baf['contact'],'message':_0x418baf[_0xa66d('0x1e')],'agent':_0x418baf[_0xa66d('0x31')],'interaction':_0x418baf[_0xa66d('0x32')],'account':_0x418baf['account']}))||'';}exports[_0xa66d('0x33')]=function(_0x3d60a9,_0x1ccb7f){var _0x29a558={};var _0x49afad=_[_0xa66d('0x34')](db[_0xa66d('0x35')][_0xa66d('0x36')],function(_0x52d465){return{'name':_0x52d465['fieldName'],'type':_0x52d465['type'][_0xa66d('0x37')]};});_0x29a558=qs[_0xa66d('0x38')](_0x49afad,_0x3d60a9);return interaction[_0xa66d('0x39')](_0xa66d('0x3a'),_0x3d60a9[_0xa66d('0x3b')],_0x3d60a9[_0xa66d('0x3c')],_0x29a558,_0x49afad)[_0xa66d('0x2c')](respondWithFilteredResult(_0x1ccb7f,_0x29a558))[_0xa66d('0x20')](handleError(_0x1ccb7f,null));};exports[_0xa66d('0x3d')]=function(_0x5a616d,_0x23a03e){var _0x46a958={'raw':![],'where':{'id':_0x5a616d[_0xa66d('0x3e')]['id']}},_0x526502={};_0x526502[_0xa66d('0x3f')]=_['keys'](db[_0xa66d('0x35')][_0xa66d('0x36')]);_0x526502[_0xa66d('0x3b')]=_['keys'](_0x5a616d[_0xa66d('0x3b')]);_0x526502[_0xa66d('0x40')]=_['intersection'](_0x526502[_0xa66d('0x3f')],_0x526502[_0xa66d('0x3b')]);_0x46a958[_0xa66d('0x41')]=_[_0xa66d('0x42')](_0x526502[_0xa66d('0x3f')],qs['fields'](_0x5a616d[_0xa66d('0x3b')][_0xa66d('0x43')]));_0x46a958[_0xa66d('0x41')]=_0x46a958['attributes'][_0xa66d('0x44')]?_0x46a958['attributes']:_0x526502['model'];if(_0x5a616d['query']['includeAll']){_0x46a958[_0xa66d('0x45')]=[{'all':!![]}];}_0x46a958=_[_0xa66d('0x30')]({},_0x46a958,_0x5a616d[_0xa66d('0x46')]);return db[_0xa66d('0x35')][_0xa66d('0x47')](_0x46a958)['then'](handleEntityNotFound(_0x23a03e,null))[_0xa66d('0x2c')](respondWithResult(_0x23a03e,null))[_0xa66d('0x20')](handleError(_0x23a03e,null));};exports[_0xa66d('0x48')]=function(_0x5e9235,_0x290a54){return db[_0xa66d('0x35')]['create'](_0x5e9235[_0xa66d('0x49')],{})[_0xa66d('0x2c')](respondWithResult(_0x290a54,0xc9))[_0xa66d('0x20')](handleError(_0x290a54,null));};exports[_0xa66d('0x2b')]=function(_0x49347a,_0x1a17cd){if(_0x49347a['body']['id']){delete _0x49347a[_0xa66d('0x49')]['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x49347a[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x1a17cd,null))['then'](saveUpdates(_0x49347a[_0xa66d('0x49')],null))['then'](respondWithResult(_0x1a17cd,null))[_0xa66d('0x20')](handleError(_0x1a17cd,null));};exports[_0xa66d('0x4a')]=function(_0x109112,_0x58aa90){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x109112[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x58aa90,null))['then'](removeEntity(_0x58aa90,null))['catch'](handleError(_0x58aa90,null));};exports[_0xa66d('0x4b')]=function(_0x5e6c37,_0x439dff){return db[_0xa66d('0x35')]['describe']()[_0xa66d('0x2c')](respondWithResult(_0x439dff,null))[_0xa66d('0x20')](handleError(_0x439dff,null));};exports['createVidaooSession']=function(_0x1e85ef,_0x1f6e67){var _0x1a673e=_0x1e85ef[_0xa66d('0x3e')]['id'];var _0x1e0c13;var _0x3c5abd;var _0x556189;return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x1a673e}})['then'](function(_0x4501ca){_0x1e0c13=_0x4501ca;return db[_0xa66d('0x4d')][_0xa66d('0x4c')]({'where':{'id':_0x4501ca['ChatWebsiteId']},'attributes':['id',_0xa66d('0x4e'),_0xa66d('0x4f'),'vidaooTopic',_0xa66d('0x50'),'vidaooMetadata'],'raw':!![]});})[_0xa66d('0x2c')](function(_0x11f35c){if(_0x11f35c&&_0x11f35c[_0xa66d('0x4e')]&&_0x11f35c[_0xa66d('0x4f')]){_0x3c5abd=_0x11f35c;var _0x51ddc1={'interaction':{'id':_0x1a673e},'agent':{'id':_0x1e85ef[_0xa66d('0x3c')]['id'],'name':_0x1e85ef[_0xa66d('0x3c')]['name'],'fullname':_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x51')],'email':_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x52')]},'contact':_0x1e85ef[_0xa66d('0x49')][_0xa66d('0x53')],'account':_0x1e85ef[_0xa66d('0x49')]['account']};var _0x2c9334={'rejectUnauthorized':![],'method':_0xa66d('0x54'),'url':_0xa66d('0x55'),'headers':{'X-APIKEY':_0x11f35c[_0xa66d('0x4e')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1e85ef[_0xa66d('0x3c')][_0xa66d('0x52')]],'buttons':null,'topic':_0x3c5abd[_0xa66d('0x56')],'note':_[_0xa66d('0x57')](_0x3c5abd['vidaooNote'])?null:getMustacheRender(_0x3c5abd[_0xa66d('0x50')],_0x51ddc1),'metadata':null},'redirect':_0xa66d('0x58'),'json':!![]};try{if(!_[_0xa66d('0x57')](_0x3c5abd['vidaooMetadata'])){var _0x9d604b=getMustacheRender(_0x3c5abd[_0xa66d('0x59')],_0x51ddc1);var _0x2e5925=JSON[_0xa66d('0x5a')](_0x9d604b);_0x2c9334[_0xa66d('0x49')]['metadata']=_0x2e5925;}}catch(_0x3dec5e){throw new db[(_0xa66d('0x5b'))][(_0xa66d('0x5c'))](_0xa66d('0x5d'));}return rp(_0x2c9334);}else{throw new db[(_0xa66d('0x5b'))][(_0xa66d('0x5c'))](_0xa66d('0x5e'));}})['then'](function(_0x53406b){_0x556189=_0x53406b;if(_0x556189['id']){var _0x1adb4d={'body':_0x556189[_0xa66d('0x5f')],'ChatWebsiteId':_0x3c5abd['id'],'ChatInteractionId':_0x1e0c13['id'],'direction':'out','UserId':_0x1e85ef['user']['id']};return db[_0xa66d('0x60')]['create'](_0x1adb4d,{});}else{throw new db['Sequelize'][(_0xa66d('0x5c'))](_0xa66d('0x61'));}})['then'](function(){return _0x1e0c13[_0xa66d('0x62')]({'vidaooSessionId':_0x556189['id']});})[_0xa66d('0x2c')](respondWithResult(_0x1f6e67,null))[_0xa66d('0x20')](handleError(_0x1f6e67,null));};exports[_0xa66d('0x63')]=function(_0x97da2f,_0x208b04){if(_0x97da2f[_0xa66d('0x49')]['id']){delete _0x97da2f['body']['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x97da2f[_0xa66d('0x3e')]['id']},'include':[{'model':db[_0xa66d('0x64')],'as':_0xa66d('0x65')}]})[_0xa66d('0x2c')](handleEntityNotFound(_0x208b04,null))[_0xa66d('0x2c')](saveUpdates(_0x97da2f[_0xa66d('0x49')],null))[_0xa66d('0x2c')](respondWithResult(_0x208b04,null))[_0xa66d('0x20')](handleError(_0x208b04,null));};exports[_0xa66d('0x66')]=function(_0x5428a6,_0x587f58){if(_0x5428a6[_0xa66d('0x49')]['id']){delete _0x5428a6['body']['id'];}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x5428a6[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](function(_0x43e3ea){if(!_0x43e3ea){logger[_0xa66d('0x1b')](_0xa66d('0x67'),_0xa66d('0x66'),0x194,_0xa66d('0x68'));_0x587f58[_0xa66d('0x21')](0x194);}else{if(_0x43e3ea['UserId']){throw new db['Sequelize'][(_0xa66d('0x5c'))](_0xa66d('0x69'));}}return _0x43e3ea;})['then'](function(_0x50da73){if(_0x50da73){return _0x50da73[_0xa66d('0x2b')]({'closed':_0x5428a6[_0xa66d('0x49')][_0xa66d('0x6a')],'disposition':_0x5428a6[_0xa66d('0x49')][_0xa66d('0x6b')]})[_0xa66d('0x2c')](function(_0x17fe00){return _0x17fe00;});}})['then'](function(){return respondWithRpcPromise(_0xa66d('0x6c'),_0xa66d('0x66'),_0x5428a6[_0xa66d('0x49')],client9004);})[_0xa66d('0x2c')](respondWithResult(_0x587f58,null))['catch'](handleError(_0x587f58,null));};exports[_0xa66d('0x6d')]=function(_0xc9c811,_0x4d0916){_0xc9c811[_0xa66d('0x49')][_0xa66d('0x2d')]=_0xc9c811[_0xa66d('0x6e')][_0xa66d('0x6f')];_0xc9c811[_0xa66d('0x49')][_0xa66d('0x70')]=_0xc9c811['file'][_0xa66d('0x71')];_0xc9c811[_0xa66d('0x49')][_0xa66d('0x72')]=_0xc9c811[_0xa66d('0x6e')][_0xa66d('0x73')];return db[_0xa66d('0x74')]['create'](_0xc9c811[_0xa66d('0x49')])[_0xa66d('0x2c')](respondWithResult(_0x4d0916,0xc9))[_0xa66d('0x20')](handleError(_0x4d0916,null));};exports[_0xa66d('0x75')]=function(_0x22efe4,_0x41a578){return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x22efe4['params']['id']},'raw':!![]})[_0xa66d('0x2c')](handleEntityNotFound(_0x41a578,null))['then'](function(_0x27c8df){if(_0x27c8df){if(_0x27c8df[_0xa66d('0x6a')]){return _0x41a578[_0xa66d('0x22')](0x193)[_0xa66d('0x24')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0xa66d('0x4c')]({'where':{'id':_0x22efe4[_0xa66d('0x3b')]['attachId']},'raw':!![]})[_0xa66d('0x2c')](handleEntityNotFound(_0x41a578,null));}})[_0xa66d('0x2c')](function(_0x72ac7b){if(_0x72ac7b){var _0x3ab252=_0x72ac7b[_0xa66d('0x76')]!==null;var _0x6c399f=path[_0xa66d('0x77')](config[_0xa66d('0x78')],_0xa66d('0x79'));if(_0x3ab252){_0x6c399f=path[_0xa66d('0x77')](_0x6c399f,'offline-chat/');}var _0x385c3f=path[_0xa66d('0x77')](_0x6c399f,_0x72ac7b['basename']);return _0x41a578[_0xa66d('0x7a')](_0x385c3f);}})['catch'](handleError(_0x41a578,null));};exports['close']=function(_0x10d4f2,_0x2861a5){var _0x28c875=null;var _0x47aa2d=null;var _0x1c09c9=null;if(_0x10d4f2[_0xa66d('0x49')]['id']){delete _0x10d4f2['body']['id'];}if(_0x10d4f2[_0xa66d('0x49')]['mailTranscript']){_0x1c09c9=path['join'](config['root'],_0xa66d('0x7b'),util[_0xa66d('0x7c')](_0xa66d('0x7d'),Date[_0xa66d('0x7e')]()));_0x10d4f2[_0xa66d('0x49')]['pathTranscript']=_0x1c09c9;}return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x10d4f2[_0xa66d('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':_0xa66d('0x7f'),'include':[{'model':db[_0xa66d('0x80')],'as':'User'}]}]})['then'](handleEntityNotFound(_0x2861a5,null))[_0xa66d('0x2c')](saveUpdates(_0x10d4f2[_0xa66d('0x49')],null))[_0xa66d('0x2c')](function(_0x11c730){if(_0x11c730){_0x28c875=_0x11c730;return db[_0xa66d('0x4d')][_0xa66d('0x47')]({'where':{'id':_0x28c875[_0xa66d('0x81')]}});}})[_0xa66d('0x2c')](function(_0x1744a5){if(_0x1744a5){_0x47aa2d=_0x1744a5;return db[_0xa66d('0x64')][_0xa66d('0x47')]({'where':{'id':_0x28c875[_0xa66d('0x82')]}});}})[_0xa66d('0x2c')](function(_0x41cb4e){if(_0x41cb4e){if(_0x1c09c9){var _0x4d956b=null;for(var _0x147604=0x1;_0x147604<_0x28c875[_0xa66d('0x7f')]['length'];++_0x147604){_0x4d956b=_0x28c875[_0xa66d('0x7f')][_0x147604];var _0x292853=_0x4d956b[_0xa66d('0x83')]?util[_0xa66d('0x7c')](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):_0xa66d('0x86');var _0x68b002=_0x10d4f2['body'][_0xa66d('0x87')]||util[_0xa66d('0x7c')](_0xa66d('0x84'),_0xa66d('0x88'),_0x4d956b[_0xa66d('0x82')]);switch(_0x47aa2d[_0xa66d('0x89')]){case _0xa66d('0x8a'):_0x292853=_0x4d956b['UserId']?util['format'](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):'System';break;case _0xa66d('0x8b'):_0x292853=_0x4d956b[_0xa66d('0x83')]?_0x4d956b['User'][_0xa66d('0x8c')]||_0x4d956b[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86');break;case _0xa66d('0x8d'):_0x292853=_0x4d956b[_0xa66d('0x83')]?_0x4d956b[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86');break;default:_0x292853=_0x4d956b[_0xa66d('0x83')]?util[_0xa66d('0x7c')](_0xa66d('0x84'),_0x47aa2d[_0xa66d('0x85')],_0x4d956b[_0xa66d('0x83')]):_0xa66d('0x86');}var _0x15ad89=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x4d956b[_0xa66d('0x8e')])['format'](_0xa66d('0x8f')),_0x4d956b[_0xa66d('0x90')]==='in'?_0x68b002:_0x292853,_0x4d956b['body']);if(!_0x4d956b[_0xa66d('0x91')]){fs[_0xa66d('0x92')](_0x1c09c9,_0x15ad89);}}return db['MailAccount'][_0xa66d('0x4c')]({'where':{'service':!![]},'include':[{'model':db[_0xa66d('0x93')],'as':_0xa66d('0x94'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xa66d('0x95'),'raw':!![]}]}]});}}})[_0xa66d('0x2c')](function(_0x456de1){if(!_0x456de1||!_0x456de1['Smtp']||!_0x10d4f2[_0xa66d('0x49')])return _0x28c875;var _0x3d7126=_0x456de1[_0xa66d('0x96')]();return respondWithRpcPromise(_0xa66d('0x97'),_0xa66d('0x98'),{'account':_0x3d7126,'message':{'from':util[_0xa66d('0x7c')]('\x22%s\x22\x20<%s>',_0x456de1[_0xa66d('0x2d')],_0x456de1[_0xa66d('0x52')]||_0x456de1[_0xa66d('0x94')][_0xa66d('0x3c')]),'to':_0x10d4f2[_0xa66d('0x49')][_0xa66d('0x99')],'subject':'Mail\x20Transcript','text':util['format'](_0xa66d('0x9a'),_0x10d4f2['body'][_0xa66d('0x99')]),'attachments':[{'path':_0x1c09c9}]}})['then'](function(){return _0x28c875;})[_0xa66d('0x20')](function(_0x75b4af){logger[_0xa66d('0x1b')](_0x75b4af);});})[_0xa66d('0x2c')](respondWithStatusCode(_0x2861a5,0xc8))['catch'](handleError(_0x2861a5,null));};exports['addMessage']=function(_0x11dffe,_0xed0aa4){return db[_0xa66d('0x60')][_0xa66d('0x47')]({'where':{'id':_0x11dffe[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0xed0aa4,null))['then'](function(_0x22752f){if(_0x22752f){return _0x22752f['addMessage'](_0x11dffe['body'][_0xa66d('0x9b')],_[_0xa66d('0x9c')](_0x11dffe['body'],[_0xa66d('0x9b'),'id'])||{});}})[_0xa66d('0x2c')](respondWithResult(_0xed0aa4,null))[_0xa66d('0x20')](handleError(_0xed0aa4,null));};exports['getMessages']=function(_0x55f3e3,_0x10bd93){var _0x3c72d6={'raw':![],'where':{}};var _0x3859c2={};var _0x520c54={'count':0x0,'rows':[]};return db[_0xa66d('0x35')][_0xa66d('0x4c')]({'where':{'id':_0x55f3e3[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x10bd93,null))['then'](function(_0x2251fa){if(_0x2251fa){_0x3859c2[_0xa66d('0x3f')]=_[_0xa66d('0x9d')](db['ChatMessage'][_0xa66d('0x36')]);_0x3859c2[_0xa66d('0x3b')]=_[_0xa66d('0x9d')](_0x55f3e3[_0xa66d('0x3b')]);_0x3859c2[_0xa66d('0x40')]=_[_0xa66d('0x42')](_0x3859c2[_0xa66d('0x3f')],_0x3859c2[_0xa66d('0x3b')]);_0x3c72d6[_0xa66d('0x41')]=_[_0xa66d('0x42')](_0x3859c2[_0xa66d('0x3f')],qs[_0xa66d('0x43')](_0x55f3e3[_0xa66d('0x3b')]['fields']));_0x3c72d6[_0xa66d('0x41')]=_0x3c72d6[_0xa66d('0x41')]['length']?_0x3c72d6[_0xa66d('0x41')]:_0x3859c2[_0xa66d('0x3f')];if(!_0x55f3e3['query'][_0xa66d('0x9e')](_0xa66d('0x9f'))){_0x3c72d6[_0xa66d('0x26')]=qs[_0xa66d('0x26')](_0x55f3e3[_0xa66d('0x3b')]['limit']);_0x3c72d6[_0xa66d('0x28')]=qs[_0xa66d('0x28')](_0x55f3e3['query'][_0xa66d('0x28')]);}_0x3c72d6[_0xa66d('0xa0')]=qs[_0xa66d('0xa1')](_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa1')]);_0x3c72d6[_0xa66d('0xa2')]=qs[_0xa66d('0x40')](_[_0xa66d('0xa3')](_0x55f3e3[_0xa66d('0x3b')],_0x3859c2[_0xa66d('0x40')]));_0x3c72d6[_0xa66d('0xa2')][_0xa66d('0xa4')]=_0x2251fa['id'];if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa5')]){_0x3c72d6[_0xa66d('0xa2')]=_[_0xa66d('0x30')](_0x3c72d6[_0xa66d('0xa2')],{'$or':_[_0xa66d('0x34')](_0x3c72d6['attributes'],function(_0x1b69b7){var _0x4b8c2a={};_0x4b8c2a[_0x1b69b7]={'$like':'%'+_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa5')]+'%'};return _0x4b8c2a;})});}if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa6')]){var _0x2873c0=_0x55f3e3[_0xa66d('0x3b')]['$gte'][_0xa66d('0xa7')](',');var _0x4457d9={};_0x4457d9[_0x2873c0[0x0]]={'$gte':moment(_0x2873c0[0x1])['format'](_0xa66d('0xa8'))};_0x3c72d6[_0xa66d('0xa2')]=_['merge'](_0x3c72d6[_0xa66d('0xa2')],_0x4457d9);}_0x3c72d6=_[_0xa66d('0x30')]({},_0x3c72d6,_0x55f3e3['options']);return db['ChatMessage'][_0xa66d('0x27')]({'where':_0x3c72d6['where']})[_0xa66d('0x2c')](function(_0x12ca59){_0x520c54[_0xa66d('0x27')]=_0x12ca59;if(_0x55f3e3[_0xa66d('0x3b')][_0xa66d('0xa9')]){_0x3c72d6['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa66d('0x39')](_0x3c72d6);})[_0xa66d('0x2c')](function(_0x346387){_0x520c54[_0xa66d('0xaa')]=_0x346387;return _0x520c54;});}})['then'](respondWithFilteredResult(_0x10bd93,_0x3c72d6))[_0xa66d('0x20')](handleError(_0x10bd93,null));};exports['getMyMessages']=function(_0x17c846,_0x5f072b){var _0x8dd16e={'where':{}},_0x1424f3={},_0x4edf26={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xa66d('0x4c')]({'where':{'id':_0x17c846[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x5f072b,null))[_0xa66d('0x2c')](function(_0x52fc7){if(_0x52fc7){_0x1424f3[_0xa66d('0x3f')]=_[_0xa66d('0x9d')](db['ChatMessage'][_0xa66d('0x36')]);_0x1424f3[_0xa66d('0x3b')]=_[_0xa66d('0x9d')](_0x17c846[_0xa66d('0x3b')]);_0x1424f3[_0xa66d('0x40')]=_['intersection'](_0x1424f3[_0xa66d('0x3f')],_0x1424f3[_0xa66d('0x3b')]);_0x8dd16e[_0xa66d('0x41')]=_['intersection'](_0x1424f3[_0xa66d('0x3f')],qs[_0xa66d('0x43')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x43')]));_0x8dd16e['attributes']=_0x8dd16e[_0xa66d('0x41')][_0xa66d('0x44')]?_0x8dd16e['attributes']:_0x1424f3[_0xa66d('0x3f')];if(!_0x17c846[_0xa66d('0x3b')][_0xa66d('0x9e')](_0xa66d('0x9f'))){_0x8dd16e[_0xa66d('0x26')]=qs[_0xa66d('0x26')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x26')]);_0x8dd16e[_0xa66d('0x28')]=qs[_0xa66d('0x28')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0x28')]);}_0x8dd16e[_0xa66d('0xa0')]=qs[_0xa66d('0xa1')](_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa1')]);_0x8dd16e[_0xa66d('0xa2')]=qs[_0xa66d('0x40')](_[_0xa66d('0xa3')](_0x17c846[_0xa66d('0x3b')],_0x1424f3[_0xa66d('0x40')]));_0x8dd16e[_0xa66d('0xa2')][_0xa66d('0xa4')]=_0x52fc7['id'];if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa5')]){_0x8dd16e[_0xa66d('0xa2')]=_[_0xa66d('0x30')](_0x8dd16e[_0xa66d('0xa2')],{'$or':_['map'](_0x8dd16e[_0xa66d('0x41')],function(_0x196119){var _0x11cc00={};_0x11cc00[_0x196119]={'$like':'%'+_0x17c846[_0xa66d('0x3b')]['filter']+'%'};return _0x11cc00;})});}_0x8dd16e['where'][_0xa66d('0x91')]=![];if(_0x17c846[_0xa66d('0x3b')]['id']){_0x8dd16e[_0xa66d('0xa2')]['id']={'$gt':_0x17c846['query']['id']};}_0x8dd16e=_[_0xa66d('0x30')]({},_0x8dd16e,_0x17c846[_0xa66d('0x46')]);return db['ChatMessage'][_0xa66d('0x27')]({'where':_0x8dd16e[_0xa66d('0xa2')]})[_0xa66d('0x2c')](function(_0x4534bb){_0x4edf26[_0xa66d('0x27')]=_0x4534bb;_0x8dd16e[_0xa66d('0x45')]=[];if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xab')]){_0x8dd16e['include'][_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0x80'),'attributes':['id',_0xa66d('0x51'),'alias']});}if(_0x17c846[_0xa66d('0x3b')][_0xa66d('0xa9')]){_0x8dd16e[_0xa66d('0x45')]=[{'all':!![]}];}return db[_0xa66d('0x60')]['findAll'](_0x8dd16e);})[_0xa66d('0x2c')](function(_0x3445a3){_0x4edf26[_0xa66d('0xaa')]=_0x3445a3;return _0x4edf26;});}})[_0xa66d('0x2c')](respondWithFilteredResult(_0x5f072b,_0x8dd16e))[_0xa66d('0x20')](handleError(_0x5f072b,null));};exports['addTags']=function(_0x1afe5e,_0x1ddf6a){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x1afe5e[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x1ddf6a,null))[_0xa66d('0x2c')](function(_0x3bfd46){if(_0x3bfd46){return _0x3bfd46['setTags'](_0x1afe5e['body']['ids'],_[_0xa66d('0x9c')](_0x1afe5e[_0xa66d('0x49')],['ids','id'])||{})[_0xa66d('0xad')](function(){return db['Tag'][_0xa66d('0x39')]({'attributes':['id',_0xa66d('0x2d'),'color'],'where':{'id':_0x1afe5e[_0xa66d('0x49')][_0xa66d('0x9b')]}});})[_0xa66d('0x2c')](function(_0x24f8e9){socket[_0xa66d('0xae')]('chatInteractionTags:save',{'id':Number(_0x1afe5e['params']['id']),'tags':_0x24f8e9||[]});return{'id':Number(_0x1afe5e[_0xa66d('0x3e')]['id']),'tags':_0x24f8e9||[]};});}})[_0xa66d('0x2c')](respondWithResult(_0x1ddf6a,null))['catch'](handleError(_0x1ddf6a,null));};exports[_0xa66d('0xaf')]=function(_0x4a1b39,_0x42333b){return db[_0xa66d('0x35')][_0xa66d('0x47')]({'where':{'id':_0x4a1b39[_0xa66d('0x3e')]['id']}})[_0xa66d('0x2c')](handleEntityNotFound(_0x42333b,null))[_0xa66d('0x2c')](function(_0x40aa9d){if(_0x40aa9d){return _0x40aa9d[_0xa66d('0xaf')](_0x4a1b39['query'][_0xa66d('0x9b')]);}})[_0xa66d('0x2c')](respondWithStatusCode(_0x42333b,null))[_0xa66d('0x20')](handleError(_0x42333b,null));};exports[_0xa66d('0x7a')]=function(_0x3c7271,_0x1c685a){var _0x17b5b8=moment()[_0xa66d('0xb0')]()[_0xa66d('0xb1')]();var _0xef3cdb=path['join'](config[_0xa66d('0x78')],_0xa66d('0xb2'),'files',_0xa66d('0xb3'));var _0x47d241=path[_0xa66d('0x77')](config[_0xa66d('0x78')],_0xa66d('0xb2'),'files',_0xa66d('0xb4'));var _0x346ec2=path[_0xa66d('0x77')](_0xef3cdb,_0x17b5b8);var _0x2fe7d7=util[_0xa66d('0x7c')](_0xa66d('0xb5'),_0x3c7271[_0xa66d('0x3e')]['id'],_0x17b5b8);var _0x26eccf=path[_0xa66d('0x77')](_0xef3cdb,_0x2fe7d7);var _0x5ea9d3=[];_0x5ea9d3[_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0x80'),'attributes':['id',_0xa66d('0x51')],'raw':!![]});_0x5ea9d3['push']({'model':db[_0xa66d('0x64')],'as':_0xa66d('0x65'),'attributes':['id',_0xa66d('0xb6'),_0xa66d('0xb7')],'raw':!![]});if(_0x3c7271[_0xa66d('0x3b')][_0xa66d('0xb4')]){_0x5ea9d3[_0xa66d('0xac')]({'model':db[_0xa66d('0x74')],'as':_0xa66d('0x74'),'raw':!![]});}var _0x2d1372=[{'model':db['ChatMessage'],'as':'Messages','attributes':['id',_0xa66d('0x49'),_0xa66d('0x8e'),'direction',_0xa66d('0x91'),_0xa66d('0xb8')],'include':_0x5ea9d3}];_0x2d1372[_0xa66d('0xac')]({'model':db[_0xa66d('0x4d')],'as':_0xa66d('0xb9'),'attributes':['id',_0xa66d('0x2d')]});_0x2d1372[_0xa66d('0xac')]({'model':db[_0xa66d('0x80')],'as':_0xa66d('0xba'),'attributes':['id',_0xa66d('0x51')]});return db['ChatInteraction'][_0xa66d('0x47')]({'where':{'id':_0x3c7271[_0xa66d('0x3e')]['id']},'include':_0x2d1372})['then'](handleEntityNotFound(_0x1c685a,null))[_0xa66d('0x2c')](function(_0x249fc6){if(_0x249fc6){var _0x5712fd=_0x249fc6[_0xa66d('0xbb')]({'plain':!![]});fs[_0xa66d('0xbc')](_0x346ec2);var _0x1abbfa={'channel':_0xa66d('0xbd'),'account':_0x5712fd['Account'][_0xa66d('0x2d')],'agent':_0x5712fd[_0xa66d('0xba')]?_0x5712fd['Owner']['fullname']:'N.A.','createdAt':moment(_0x5712fd[_0xa66d('0x8e')])[_0xa66d('0x7c')](_0xa66d('0xa8'))[_0xa66d('0xb1')](),'closedAt':_0x5712fd[_0xa66d('0x6a')]?moment(_0x5712fd[_0xa66d('0xbe')])['format'](_0xa66d('0xa8'))[_0xa66d('0xb1')]():'','disposition':_0x5712fd[_0xa66d('0x6b')],'chatInfo':{'browser':_0x5712fd[_0xa66d('0xbf')],'os':_0x5712fd['osName'],'referer':_0x5712fd[_0xa66d('0xc0')],'customerIp':_0x5712fd[_0xa66d('0xc1')],'customerPort':_0x5712fd['customerPort']?_0x5712fd[_0xa66d('0xc2')]:'N.A.'},'messages':_(_0x5712fd[_0xa66d('0x7f')])['tail']()['filter']({'secret':![]})['map'](function(_0x44906f){if(_0x44906f[_0xa66d('0x74')]){var _0x3ca138=path['join'](_0x47d241,_0x44906f[_0xa66d('0x74')][_0xa66d('0x70')]);if(fs[_0xa66d('0xc3')](_0x3ca138)){fs[_0xa66d('0xc4')](_0x3ca138)[_0xa66d('0xc5')](fs[_0xa66d('0xc6')](path[_0xa66d('0x77')](_0x346ec2,_0x44906f[_0xa66d('0x74')][_0xa66d('0x70')])));}}return{'date':moment(_0x44906f[_0xa66d('0x8e')])[_0xa66d('0x7c')](_0xa66d('0xa8'))[_0xa66d('0xb1')](),'sender':_0x44906f[_0xa66d('0x90')]===_0xa66d('0xc7')?_0x44906f[_0xa66d('0x80')]?_0x44906f[_0xa66d('0x80')][_0xa66d('0x51')]:_0xa66d('0x86'):_0x44906f[_0xa66d('0x65')][_0xa66d('0xb6')]+(_0x44906f[_0xa66d('0x65')]['lastName']?'\x20'+_0x44906f[_0xa66d('0x65')][_0xa66d('0xb7')]:''),'body':_0x44906f[_0xa66d('0x74')]?_0x44906f[_0xa66d('0x74')]['basename']:_0x44906f[_0xa66d('0x49')],'direction':_0x44906f[_0xa66d('0x90')]===_0xa66d('0xc7')?'A':'C','secret':_0x44906f[_0xa66d('0x91')],'read':_0x44906f['read'],'attachment':_0x44906f['Attachment']};})[_0xa66d('0xc8')]()};return ejs[_0xa66d('0xc9')](path[_0xa66d('0x77')](config['root'],_0xa66d('0xb2'),_0xa66d('0xca'),_0xa66d('0xcb')),{'interaction':_0x1abbfa})[_0xa66d('0x2c')](function(_0x43d54c){var _0x2463cd=path[_0xa66d('0x77')](_0x346ec2,_0xa66d('0xcc')+_0x5712fd['id']+'-'+_0x17b5b8+'.pdf');var _0x508b64={'path':_0x2463cd,'channel':_0xa66d('0xbd'),'interactionId':_0x5712fd['id']};return pdf[_0xa66d('0xcd')](_0x43d54c,_0x508b64);})['then'](function(){return new Promise(function(_0x474cc4,_0x4033d2){zipdir(_0x346ec2,{'saveTo':_0x26eccf},function(_0x4267f9,_0x54df1e){if(_0x4267f9)return _0x4033d2(_0x4267f9);return _0x474cc4(_0x54df1e);});})[_0xa66d('0x2c')](function(){return new BPromise(function(_0x59c050,_0x209863){rimraf(_0x346ec2,function(_0x419eb){if(_0x419eb)_0x209863(_0x419eb);return _0x59c050();});});})['then'](function(){return _0x1c685a[_0xa66d('0x7a')](_0x26eccf,_0x2fe7d7,function(_0x2014a8){if(_0x2014a8){logger[_0xa66d('0x1b')](_0xa66d('0xce'),_0x2014a8);}else{fs['unlinkSync'](_0x26eccf);}});});});}else{return _0x1c685a[_0xa66d('0x21')](0xc8);}})[_0xa66d('0x20')](handleError(_0x1c685a,null));};
\ No newline at end of file
index ef32a9f..194db3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf022=['setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','Users','map','then'];(function(_0xb4f89c,_0x4b0f0c){var _0x5bfda3=function(_0x6395cc){while(--_0x6395cc){_0xb4f89c['push'](_0xb4f89c['shift']());}};_0x5bfda3(++_0x4b0f0c);}(_0xf022,0xa9));var _0x2f02=function(_0x50b66d,_0x11c61c){_0x50b66d=_0x50b66d-0x0;var _0x41aa8e=_0xf022[_0x50b66d];return _0x41aa8e;};'use strict';var EventEmitter=require(_0x2f02('0x0'));var ChatInteraction=require(_0x2f02('0x1'))['db'][_0x2f02('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x2f02('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2f02('0x4')](0x0);var events={'afterCreate':_0x2f02('0x5'),'afterUpdate':'update','afterDestroy':_0x2f02('0x6')};function emitEvent(_0x19cbad){return function(_0x1f5499,_0x1db134,_0x4340f0){_0x1f5499[_0x2f02('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xdd29b8){_0x1f5499['setDataValue'](_0x2f02('0x8'),_0xdd29b8[_0x2f02('0x9')](function(_0x5404a4){return{'id':_0x5404a4['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x1f5499['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2f02('0xa')](function(_0x154d8d){_0x1f5499[_0x2f02('0xb')](_0x2f02('0xc'),_0x154d8d[_0x2f02('0xd')]);ChatInteractionEvents[_0x2f02('0xe')](_0x19cbad+':'+_0x1f5499['id'],_0x1f5499);ChatInteractionEvents[_0x2f02('0xe')](_0x19cbad,_0x1f5499);_0x4340f0(null);})[_0x2f02('0xf')](_0x4340f0(null));};}for(var e in events){if(events[_0x2f02('0x10')](e)){var event=events[e];ChatInteraction[_0x2f02('0x11')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x52d9=['update','remove','getUsers','then','setDataValue','Users','map','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x52d9,0xa5));var _0x952d=function(_0x4cce8,_0x22d1fe){_0x4cce8=_0x4cce8-0x0;var _0x458440=_0x52d9[_0x4cce8];return _0x458440;};'use strict';var EventEmitter=require(_0x952d('0x0'));var ChatInteraction=require(_0x952d('0x1'))['db'][_0x952d('0x2')];var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x952d('0x3')](0x0);var events={'afterCreate':_0x952d('0x4'),'afterUpdate':_0x952d('0x5'),'afterDestroy':_0x952d('0x6')};function emitEvent(_0x4b3162){return function(_0x25bae7,_0x424244,_0xe5a688){_0x25bae7[_0x952d('0x7')]({'attributes':['id'],'raw':!![]})[_0x952d('0x8')](function(_0x290c5b){_0x25bae7[_0x952d('0x9')](_0x952d('0xa'),_0x290c5b[_0x952d('0xb')](function(_0x245a5d){return{'id':_0x245a5d['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x25bae7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x952d('0x8')](function(_0x5f105e){_0x25bae7[_0x952d('0x9')]('unreadMessages',_0x5f105e[_0x952d('0xc')]);ChatInteractionEvents[_0x952d('0xd')](_0x4b3162+':'+_0x25bae7['id'],_0x25bae7);ChatInteractionEvents[_0x952d('0xd')](_0x4b3162,_0x25bae7);_0xe5a688(null);})[_0x952d('0xe')](_0xe5a688(null));};}for(var e in events){if(events[_0x952d('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x952d('0x10')]=ChatInteractionEvents;
\ No newline at end of file
index d09e6a2..0e5aaf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ae7=['./chatInteraction.attributes','exports','define','ChatInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x2ae7,0x1b2));var _0x72ae=function(_0x49c24a,_0x3a4daf){_0x49c24a=_0x49c24a-0x0;var _0x5184cf=_0x2ae7[_0x49c24a];return _0x5184cf;};'use strict';var _=require('lodash');var util=require(_0x72ae('0x0'));var logger=require(_0x72ae('0x1'))(_0x72ae('0x2'));var moment=require(_0x72ae('0x3'));var BPromise=require(_0x72ae('0x4'));var rp=require(_0x72ae('0x5'));var fs=require('fs');var path=require(_0x72ae('0x6'));var rimraf=require(_0x72ae('0x7'));var config=require('../../config/environment');var attributes=require(_0x72ae('0x8'));module[_0x72ae('0x9')]=function(_0x55b29b,_0xafe7b1){return _0x55b29b[_0x72ae('0xa')](_0x72ae('0xb'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f21cb,_0x3f53f6,_0x4ecae2){if(_0x1f21cb['changed'](_0x72ae('0xc'))){_0x1f21cb['closedAt']=moment()[_0x72ae('0xd')](_0x72ae('0xe'));}_0x4ecae2(null,_0x1f21cb);}},'charset':_0x72ae('0xf'),'collate':_0x72ae('0x10')});};
\ No newline at end of file
+var _0x3d30=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x153260,_0x2ece9f){var _0x4ed302=function(_0x3d441a){while(--_0x3d441a){_0x153260['push'](_0x153260['shift']());}};_0x4ed302(++_0x2ece9f);}(_0x3d30,0x1c4));var _0x03d3=function(_0x5b7d11,_0x268642){_0x5b7d11=_0x5b7d11-0x0;var _0x1a1e5e=_0x3d30[_0x5b7d11];return _0x1a1e5e;};'use strict';var _=require('lodash');var util=require(_0x03d3('0x0'));var logger=require(_0x03d3('0x1'))('api');var moment=require(_0x03d3('0x2'));var BPromise=require('bluebird');var rp=require(_0x03d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x03d3('0x4'));var config=require(_0x03d3('0x5'));var attributes=require(_0x03d3('0x6'));module['exports']=function(_0x4ffed1,_0x33c55a){return _0x4ffed1[_0x03d3('0x7')](_0x03d3('0x8'),attributes,{'tableName':_0x03d3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x251d01,_0x15174a,_0x484e7b){if(_0x251d01[_0x03d3('0xa')](_0x03d3('0xb'))){_0x251d01[_0x03d3('0xc')]=moment()['format'](_0x03d3('0xd'));}_0x484e7b(null,_0x251d01);}},'charset':_0x03d3('0xe'),'collate':_0x03d3('0xf')});};
\ No newline at end of file
index 557a69c..3c3a013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae01=['UpdateChatInteraction','find','addTags','ids','omit','AddTags','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','body','options','raw','where','attributes','limit'];(function(_0x4a25e3,_0xffc2aa){var _0xc2ac02=function(_0x1f0eba){while(--_0x1f0eba){_0x4a25e3['push'](_0x4a25e3['shift']());}};_0xc2ac02(++_0xffc2aa);}(_0xae01,0x81));var _0x1ae0=function(_0x5343ca,_0x93427e){_0x5343ca=_0x5343ca-0x0;var _0x1b84c1=_0xae01[_0x5343ca];return _0x1b84c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ae0('0x0'));var BPromise=require(_0x1ae0('0x1'));var rs=require(_0x1ae0('0x2'));var fs=require('fs');var Redis=require(_0x1ae0('0x3'));var db=require(_0x1ae0('0x4'))['db'];var utils=require(_0x1ae0('0x5'));var logger=require(_0x1ae0('0x6'))('rpc');var config=require(_0x1ae0('0x7'));var jayson=require(_0x1ae0('0x8'));var client=jayson['client'][_0x1ae0('0x9')]({'port':0x232a});config[_0x1ae0('0xa')]=_[_0x1ae0('0xb')](config[_0x1ae0('0xa')],{'host':_0x1ae0('0xc'),'port':0x18eb});var socket=require(_0x1ae0('0xd'))(new Redis(config[_0x1ae0('0xa')]));require(_0x1ae0('0xe'))[_0x1ae0('0xf')](socket);function respondWithRpcPromise(_0x26bf61,_0x39cad0,_0x174697){return new BPromise(function(_0x46e122,_0x372b2f){return client[_0x1ae0('0x10')](_0x26bf61,_0x174697)[_0x1ae0('0x11')](function(_0x2caeaa){logger[_0x1ae0('0x12')](_0x1ae0('0x13'),_0x39cad0,_0x1ae0('0x14'));logger[_0x1ae0('0x15')](_0x1ae0('0x16'),_0x39cad0,_0x1ae0('0x14'),JSON[_0x1ae0('0x17')](_0x2caeaa));if(_0x2caeaa[_0x1ae0('0x18')]){if(_0x2caeaa[_0x1ae0('0x18')]['code']===0x1f4){logger[_0x1ae0('0x18')](_0x1ae0('0x13'),_0x39cad0,_0x2caeaa[_0x1ae0('0x18')]['message']);return _0x372b2f(_0x2caeaa[_0x1ae0('0x18')][_0x1ae0('0x19')]);}logger[_0x1ae0('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x39cad0,_0x2caeaa['error'][_0x1ae0('0x19')]);return _0x46e122(_0x2caeaa[_0x1ae0('0x18')]['message']);}else{logger[_0x1ae0('0x12')](_0x1ae0('0x13'),_0x39cad0,'request\x20sent');_0x46e122(_0x2caeaa[_0x1ae0('0x1a')]['message']);}})[_0x1ae0('0x1b')](function(_0x5e8bde){logger['error'](_0x1ae0('0x13'),_0x39cad0,_0x5e8bde);_0x372b2f(_0x5e8bde);});});}exports['UpdateChatInteraction']=function(_0x4354f8){var _0x41a005=this;return new Promise(function(_0x5eb931,_0x53e9e0){return db['ChatInteraction'][_0x1ae0('0x1c')](_0x4354f8[_0x1ae0('0x1d')],{'raw':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x20')]||null:null,'attributes':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8[_0x1ae0('0x1e')][_0x1ae0('0x21')]||null:null,'limit':_0x4354f8[_0x1ae0('0x1e')]?_0x4354f8['options'][_0x1ae0('0x22')]||null:null})['then'](function(_0x4ddda2){logger[_0x1ae0('0x12')]('UpdateChatInteraction',_0x4354f8);logger[_0x1ae0('0x15')]('UpdateChatInteraction',_0x4354f8,JSON[_0x1ae0('0x17')](_0x4ddda2));_0x5eb931(_0x4ddda2);})[_0x1ae0('0x1b')](function(_0x24eef0){logger[_0x1ae0('0x18')](_0x1ae0('0x23'),_0x24eef0['message'],_0x4354f8);_0x53e9e0(_0x41a005[_0x1ae0('0x18')](0x1f4,_0x24eef0[_0x1ae0('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x1e57c8){return new Promise(function(_0x4664c4,_0x37862a){return db['ChatInteraction'][_0x1ae0('0x24')]({'where':_0x1e57c8[_0x1ae0('0x1e')]?_0x1e57c8['options'][_0x1ae0('0x20')]||null:null})[_0x1ae0('0x11')](function(_0xfed526){if(_0xfed526){return _0xfed526[_0x1ae0('0x25')](_0x1e57c8[_0x1ae0('0x1d')][_0x1ae0('0x26')],_[_0x1ae0('0x27')](_0x1e57c8[_0x1ae0('0x1d')],['ids','id'])||{});}})['spread'](function(_0x3c4f77){logger['info'](_0x1ae0('0x28'),_0x1e57c8);logger[_0x1ae0('0x15')](_0x1ae0('0x28'),_0x1e57c8,JSON[_0x1ae0('0x17')](_0x3c4f77));_0x4664c4(_0x3c4f77);})['catch'](function(_0x2bf8d3){logger[_0x1ae0('0x18')](_0x1ae0('0x28'),_0x2bf8d3[_0x1ae0('0x19')],_0x1e57c8);_0x37862a(_this[_0x1ae0('0x18')](0x1f4,_0x2bf8d3[_0x1ae0('0x19')]));});});};
\ No newline at end of file
+var _0x28b4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','ChatInteraction,\x20%s,\x20%s','message','info','result','catch','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','ChatInteraction','addTags','omit','AddTags','util','moment','bluebird','randomstring'];(function(_0x344f1c,_0x5a0a0e){var _0xe6b281=function(_0x44a686){while(--_0x44a686){_0x344f1c['push'](_0x344f1c['shift']());}};_0xe6b281(++_0x5a0a0e);}(_0x28b4,0x176));var _0x428b=function(_0x201c56,_0x42849f){_0x201c56=_0x201c56-0x0;var _0x2e4bc8=_0x28b4[_0x201c56];return _0x2e4bc8;};'use strict';var _=require('lodash');var util=require(_0x428b('0x0'));var moment=require(_0x428b('0x1'));var BPromise=require(_0x428b('0x2'));var rs=require(_0x428b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x428b('0x4'))['db'];var utils=require(_0x428b('0x5'));var logger=require(_0x428b('0x6'))(_0x428b('0x7'));var config=require(_0x428b('0x8'));var jayson=require(_0x428b('0x9'));var client=jayson['client'][_0x428b('0xa')]({'port':0x232a});config[_0x428b('0xb')]=_[_0x428b('0xc')](config[_0x428b('0xb')],{'host':_0x428b('0xd'),'port':0x18eb});var socket=require(_0x428b('0xe'))(new Redis(config[_0x428b('0xb')]));require('./chatInteraction.socket')[_0x428b('0xf')](socket);function respondWithRpcPromise(_0x50774c,_0x5500b2,_0x2c6949){return new BPromise(function(_0x35f9a3,_0x2d0b1e){return client[_0x428b('0x10')](_0x50774c,_0x2c6949)[_0x428b('0x11')](function(_0xed9a40){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5500b2,_0x428b('0x12'));logger[_0x428b('0x13')](_0x428b('0x14'),_0x5500b2,_0x428b('0x12'),JSON['stringify'](_0xed9a40));if(_0xed9a40[_0x428b('0x15')]){if(_0xed9a40['error'][_0x428b('0x16')]===0x1f4){logger['error'](_0x428b('0x17'),_0x5500b2,_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);return _0x2d0b1e(_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);}logger[_0x428b('0x15')](_0x428b('0x17'),_0x5500b2,_0xed9a40[_0x428b('0x15')][_0x428b('0x18')]);return _0x35f9a3(_0xed9a40['error']['message']);}else{logger[_0x428b('0x19')](_0x428b('0x17'),_0x5500b2,_0x428b('0x12'));_0x35f9a3(_0xed9a40[_0x428b('0x1a')][_0x428b('0x18')]);}})[_0x428b('0x1b')](function(_0x37cba4){logger[_0x428b('0x15')](_0x428b('0x17'),_0x5500b2,_0x37cba4);_0x2d0b1e(_0x37cba4);});});}exports['UpdateChatInteraction']=function(_0xcb58d4){var _0x441c71=this;return new Promise(function(_0x4ffc79,_0x3dfda5){return db['ChatInteraction'][_0x428b('0x1c')](_0xcb58d4[_0x428b('0x1d')],{'raw':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4['options'][_0x428b('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x20')]||null:null,'attributes':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x21')]||null:null,'limit':_0xcb58d4[_0x428b('0x1e')]?_0xcb58d4[_0x428b('0x1e')][_0x428b('0x22')]||null:null})[_0x428b('0x11')](function(_0xf86a8b){logger['info'](_0x428b('0x23'),_0xcb58d4);logger[_0x428b('0x13')](_0x428b('0x23'),_0xcb58d4,JSON[_0x428b('0x24')](_0xf86a8b));_0x4ffc79(_0xf86a8b);})[_0x428b('0x1b')](function(_0x375f34){logger[_0x428b('0x15')](_0x428b('0x23'),_0x375f34['message'],_0xcb58d4);_0x3dfda5(_0x441c71[_0x428b('0x15')](0x1f4,_0x375f34[_0x428b('0x18')]));});});};exports[_0x428b('0x25')]=function(_0x297302){return new Promise(function(_0x55ba3d,_0x339e64){return db[_0x428b('0x26')]['find']({'where':_0x297302[_0x428b('0x1e')]?_0x297302['options']['where']||null:null})[_0x428b('0x11')](function(_0xec0bf4){if(_0xec0bf4){return _0xec0bf4[_0x428b('0x27')](_0x297302[_0x428b('0x1d')]['ids'],_[_0x428b('0x28')](_0x297302['body'],['ids','id'])||{});}})['spread'](function(_0x4b0d5b){logger[_0x428b('0x19')](_0x428b('0x29'),_0x297302);logger['debug']('AddTags',_0x297302,JSON[_0x428b('0x24')](_0x4b0d5b));_0x55ba3d(_0x4b0d5b);})[_0x428b('0x1b')](function(_0x4ad957){logger[_0x428b('0x15')](_0x428b('0x29'),_0x4ad957[_0x428b('0x18')],_0x297302);_0x339e64(_this[_0x428b('0x15')](0x1f4,_0x4ad957[_0x428b('0x18')]));});});};
\ No newline at end of file
index 304e260..f1499a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea89=['./chatInteraction.events','remove','emit','register','length','chatInteraction:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xea89,0xf6));var _0x9ea8=function(_0x2267e6,_0x19cd1e){_0x2267e6=_0x2267e6-0x0;var _0xc608a=_0xea89[_0x2267e6];return _0xc608a;};'use strict';var ChatInteractionEvents=require(_0x9ea8('0x0'));var events=['save',_0x9ea8('0x1'),'update'];function createListener(_0x2eef33,_0x395150){return function(_0x2df473){_0x395150[_0x9ea8('0x2')](_0x2eef33,_0x2df473);};}function removeListener(_0x1d06ec,_0x371110){return function(){ChatInteractionEvents['removeListener'](_0x1d06ec,_0x371110);};}exports[_0x9ea8('0x3')]=function(_0x23402d){for(var _0x4a3b29=0x0,_0x18dc01=events[_0x9ea8('0x4')];_0x4a3b29<_0x18dc01;_0x4a3b29++){var _0x56a80c=events[_0x4a3b29];var _0x3e1d9d=createListener(_0x9ea8('0x5')+_0x56a80c,_0x23402d);ChatInteractionEvents['on'](_0x56a80c,_0x3e1d9d);}};
\ No newline at end of file
+var _0x75b4=['update','emit','removeListener','register','chatInteraction:','save','remove'];(function(_0x2881e2,_0x341293){var _0x5c1e1f=function(_0x10ba61){while(--_0x10ba61){_0x2881e2['push'](_0x2881e2['shift']());}};_0x5c1e1f(++_0x341293);}(_0x75b4,0xc2));var _0x475b=function(_0x14725b,_0xe66d95){_0x14725b=_0x14725b-0x0;var _0xf95764=_0x75b4[_0x14725b];return _0xf95764;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x475b('0x0'),_0x475b('0x1'),_0x475b('0x2')];function createListener(_0x54859d,_0x5c6649){return function(_0xb93fbb){_0x5c6649[_0x475b('0x3')](_0x54859d,_0xb93fbb);};}function removeListener(_0x2eefae,_0x599c96){return function(){ChatInteractionEvents[_0x475b('0x4')](_0x2eefae,_0x599c96);};}exports[_0x475b('0x5')]=function(_0x54fe3f){for(var _0x5dbb7b=0x0,_0x2fa3ce=events['length'];_0x5dbb7b<_0x2fa3ce;_0x5dbb7b++){var _0x7d7f31=events[_0x5dbb7b];var _0x3cdfcb=createListener(_0x475b('0x6')+_0x7d7f31,_0x54fe3f);ChatInteractionEvents['on'](_0x7d7f31,_0x3cdfcb);}};
\ No newline at end of file
index 32774ef..31ed335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x982f=['put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','file','attachmentUpload','isChatInteractionAuthorized','tracked','chat','chatinteraction:addtags','addTags'];(function(_0x2d7fa1,_0x4cca90){var _0x4dc8cc=function(_0x4bd463){while(--_0x4bd463){_0x2d7fa1['push'](_0x2d7fa1['shift']());}};_0x4dc8cc(++_0x4cca90);}(_0x982f,0x1bc));var _0xf982=function(_0x53721f,_0x16d681){_0x53721f=_0x53721f-0x0;var _0x322dea=_0x982f[_0x53721f];return _0x322dea;};'use strict';var multer=require('multer');var util=require(_0xf982('0x0'));var path=require(_0xf982('0x1'));var timeout=require(_0xf982('0x2'));var express=require('express');var router=express[_0xf982('0x3')]();var fs_extra=require(_0xf982('0x4'));var auth=require(_0xf982('0x5'));var interaction=require(_0xf982('0x6'));var config=require(_0xf982('0x7'));var controller=require(_0xf982('0x8'));router[_0xf982('0x9')]('/',auth[_0xf982('0xa')](),controller[_0xf982('0xb')]);router[_0xf982('0x9')](_0xf982('0xc'),auth[_0xf982('0xa')](),controller[_0xf982('0xd')]);router['get'](_0xf982('0xe'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0xf')]);router[_0xf982('0x9')](_0xf982('0x10'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get'](_0xf982('0x11'),auth[_0xf982('0xa')](),controller[_0xf982('0x12')]);router[_0xf982('0x9')](_0xf982('0x13'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0x14')]);router['get'](_0xf982('0x15'),auth[_0xf982('0xa')](),controller[_0xf982('0x16')]);router[_0xf982('0x17')]('/',auth[_0xf982('0xa')](),controller[_0xf982('0x18')]);router[_0xf982('0x17')]('/:id/vidaoo',auth[_0xf982('0xa')](),controller[_0xf982('0x19')]);var upload=multer({'storage':multer[_0xf982('0x1a')]({'destination':function(_0x1cd90d,_0x5271d2,_0x4c9e58){_0x4c9e58(null,path[_0xf982('0x1b')](config[_0xf982('0x1c')],_0xf982('0x1d')));},'filename':function(_0x59f229,_0x580ecb,_0xeca8ab){_0xeca8ab(null,util['format'](_0xf982('0x1e'),Date[_0xf982('0x1f')](),_0x580ecb[_0xf982('0x20')][_0xf982('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xf982('0x22'),upload['single'](_0xf982('0x23')),controller[_0xf982('0x24')]);router[_0xf982('0x17')](_0xf982('0x11'),auth[_0xf982('0x25')](),controller['addMessage']);router[_0xf982('0x17')]('/:id/tags',auth[_0xf982('0xa')](),interaction[_0xf982('0x26')](_0xf982('0x27'),_0xf982('0x28')),controller[_0xf982('0x29')]);router[_0xf982('0x2a')](_0xf982('0xe'),auth[_0xf982('0xa')](),interaction['tracked'](_0xf982('0x27'),_0xf982('0x2b')),controller[_0xf982('0x2c')]);router[_0xf982('0x2a')]('/:id/custom_update',controller[_0xf982('0x2d')]);router['put'](_0xf982('0x2e'),auth['isChatInteractionAuthorized'](),controller[_0xf982('0x2f')]);router['put'](_0xf982('0x30'),controller[_0xf982('0x31')]);router[_0xf982('0x32')](_0xf982('0xe'),auth[_0xf982('0xa')](),interaction[_0xf982('0x26')](_0xf982('0x27'),_0xf982('0x33')),controller[_0xf982('0x34')]);router[_0xf982('0x32')]('/:id/tags',auth['isAuthenticated'](),controller[_0xf982('0x35')]);module['exports']=router;
\ No newline at end of file
+var _0x55dd=['delete','removeTags','multer','util','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','describe','get','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy'];(function(_0x1f3d3c,_0x5dcab4){var _0x484443=function(_0xc10a36){while(--_0xc10a36){_0x1f3d3c['push'](_0x1f3d3c['shift']());}};_0x484443(++_0x5dcab4);}(_0x55dd,0x6e));var _0xd55d=function(_0x3f2228,_0x3b27d5){_0x3f2228=_0x3f2228-0x0;var _0x285ae4=_0x55dd[_0x3f2228];return _0x285ae4;};'use strict';var multer=require(_0xd55d('0x0'));var util=require(_0xd55d('0x1'));var path=require('path');var timeout=require(_0xd55d('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd55d('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd55d('0x4'));var config=require(_0xd55d('0x5'));var controller=require(_0xd55d('0x6'));router['get']('/',auth[_0xd55d('0x7')](),controller[_0xd55d('0x8')]);router['get']('/describe',auth[_0xd55d('0x7')](),controller[_0xd55d('0x9')]);router[_0xd55d('0xa')](_0xd55d('0xb'),auth[_0xd55d('0xc')](),controller[_0xd55d('0xd')]);router['get'](_0xd55d('0xe'),auth[_0xd55d('0xc')](),controller[_0xd55d('0xf')]);router[_0xd55d('0xa')](_0xd55d('0x10'),auth[_0xd55d('0x7')](),controller['getMessages']);router[_0xd55d('0xa')](_0xd55d('0x11'),auth[_0xd55d('0xc')](),controller[_0xd55d('0x12')]);router[_0xd55d('0xa')](_0xd55d('0x13'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x14')]);router[_0xd55d('0x15')]('/',auth['isAuthenticated'](),controller[_0xd55d('0x16')]);router[_0xd55d('0x15')](_0xd55d('0x17'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x18')]);var upload=multer({'storage':multer[_0xd55d('0x19')]({'destination':function(_0x3c6631,_0x10f231,_0x3f04f3){_0x3f04f3(null,path[_0xd55d('0x1a')](config['root'],_0xd55d('0x1b')));},'filename':function(_0x5c15b6,_0xe5fb3c,_0x2c84b6){_0x2c84b6(null,util['format'](_0xd55d('0x1c'),Date[_0xd55d('0x1d')](),_0xe5fb3c[_0xd55d('0x1e')][_0xd55d('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xd55d('0x20'),upload[_0xd55d('0x21')](_0xd55d('0x22')),controller[_0xd55d('0x23')]);router[_0xd55d('0x15')](_0xd55d('0x10'),auth[_0xd55d('0xc')](),controller[_0xd55d('0x24')]);router[_0xd55d('0x15')](_0xd55d('0x25'),auth[_0xd55d('0x7')](),interaction['tracked']('chat',_0xd55d('0x26')),controller[_0xd55d('0x27')]);router[_0xd55d('0x28')]('/:id',auth[_0xd55d('0x7')](),interaction[_0xd55d('0x29')](_0xd55d('0x2a'),_0xd55d('0x2b')),controller[_0xd55d('0x2c')]);router[_0xd55d('0x28')](_0xd55d('0x2d'),controller[_0xd55d('0x2e')]);router[_0xd55d('0x28')](_0xd55d('0x2f'),auth[_0xd55d('0xc')](),controller['abandon']);router[_0xd55d('0x28')](_0xd55d('0x30'),controller[_0xd55d('0x31')]);router['delete'](_0xd55d('0xb'),auth[_0xd55d('0x7')](),interaction['tracked'](_0xd55d('0x2a'),_0xd55d('0x32')),controller[_0xd55d('0x33')]);router[_0xd55d('0x34')](_0xd55d('0x25'),auth[_0xd55d('0x7')](),controller[_0xd55d('0x35')]);module['exports']=router;
\ No newline at end of file
index 9a49e60..acd00c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e69=['sequelize','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x4c9574,_0x441b91){var _0x59d1e5=function(_0x46be2b){while(--_0x46be2b){_0x4c9574['push'](_0x4c9574['shift']());}};_0x59d1e5(++_0x441b91);}(_0x7e69,0x1b3));var _0x97e6=function(_0x4e3843,_0x571529){_0x4e3843=_0x4e3843-0x0;var _0x2537db=_0x7e69[_0x4e3843];return _0x2537db;};'use strict';var Sequelize=require(_0x97e6('0x0'));module['exports']={'body':{'type':Sequelize[_0x97e6('0x1')](_0x97e6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x97e6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x97e6('0x4')]}};
\ No newline at end of file
+var _0xe1af=['sequelize','exports','TEXT','medium','BOOLEAN','INTEGER'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0xe1af,0xa8));var _0xfe1a=function(_0x4dbac8,_0x21d060){_0x4dbac8=_0x4dbac8-0x0;var _0x343db9=_0xe1af[_0x4dbac8];return _0x343db9;};'use strict';var Sequelize=require(_0xfe1a('0x0'));module[_0xfe1a('0x1')]={'body':{'type':Sequelize[_0xfe1a('0x2')](_0xfe1a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xfe1a('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xfe1a('0x5')]}};
\ No newline at end of file
index e945779..5fa9bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacad=['order','sort','filters','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','fields','length','include','find','catch','create','body','params','destroy','describe','get','messages','format','getUsers','User','agent','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueue','type','role','UserProfileSection','Agents','UserProfileResource','resourceId','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','count','set','apply','reject','save','update','then','end','error','stack','name','index','ChatInternalMessage','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','nolimit'];(function(_0x4a323a,_0x440a6a){var _0x3e1083=function(_0x16eefc){while(--_0x16eefc){_0x4a323a['push'](_0x4a323a['shift']());}};_0x3e1083(++_0x440a6a);}(_0xacad,0x172));var _0xdaca=function(_0x42420b,_0x11a2eb){_0x42420b=_0x42420b-0x0;var _0x2d0e82=_0xacad[_0x42420b];return _0x2d0e82;};'use strict';var emlformat=require(_0xdaca('0x0'));var rimraf=require(_0xdaca('0x1'));var zipdir=require(_0xdaca('0x2'));var jsonpatch=require(_0xdaca('0x3'));var rp=require(_0xdaca('0x4'));var moment=require(_0xdaca('0x5'));var BPromise=require(_0xdaca('0x6'));var Mustache=require(_0xdaca('0x7'));var util=require(_0xdaca('0x8'));var path=require(_0xdaca('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xdaca('0xa'));var fs=require('fs');var fs_extra=require(_0xdaca('0xb'));var _=require('lodash');var squel=require(_0xdaca('0xc'));var crypto=require(_0xdaca('0xd'));var jsforce=require(_0xdaca('0xe'));var deskjs=require(_0xdaca('0xf'));var toCsv=require(_0xdaca('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdaca('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdaca('0x12'));var as=require(_0xdaca('0x13'));var hardwareService=require(_0xdaca('0x14'));var logger=require('../../config/logger')(_0xdaca('0x15'));var utils=require('../../config/utils');var config=require(_0xdaca('0x16'));var licenseUtil=require(_0xdaca('0x17'));var db=require(_0xdaca('0x18'))['db'];config['redis']=_[_0xdaca('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdaca('0x1a'))(new Redis(config[_0xdaca('0x1b')]));require(_0xdaca('0x1c'))[_0xdaca('0x1d')](socket);function respondWithStatusCode(_0x57e520,_0x1f813c){_0x1f813c=_0x1f813c||0xcc;return function(_0x2dbf74){if(_0x2dbf74){return _0x57e520[_0xdaca('0x1e')](_0x1f813c);}return _0x57e520[_0xdaca('0x1f')](_0x1f813c)['end']();};}function respondWithResult(_0x216a26,_0x18f9f8){_0x18f9f8=_0x18f9f8||0xc8;return function(_0x42ba7e){if(_0x42ba7e){return _0x216a26[_0xdaca('0x1f')](_0x18f9f8)[_0xdaca('0x20')](_0x42ba7e);}};}function respondWithFilteredResult(_0x1fd790,_0xebbe4f){return function(_0x12aab0){if(_0x12aab0){var _0x269e8b=typeof _0xebbe4f[_0xdaca('0x21')]==='undefined'&&typeof _0xebbe4f[_0xdaca('0x22')]==='undefined';var _0x5b1e0c=_0x12aab0[_0xdaca('0x23')];var _0x496124=_0x269e8b?0x0:_0xebbe4f[_0xdaca('0x21')];var _0x4f9ba2=_0x269e8b?_0x12aab0[_0xdaca('0x23')]:_0xebbe4f[_0xdaca('0x21')]+_0xebbe4f[_0xdaca('0x22')];var _0x27deff;if(_0x4f9ba2>=_0x5b1e0c){_0x4f9ba2=_0x5b1e0c;_0x27deff=0xc8;}else{_0x27deff=0xce;}_0x1fd790[_0xdaca('0x1f')](_0x27deff);return _0x1fd790[_0xdaca('0x24')]('Content-Range',_0x496124+'-'+_0x4f9ba2+'/'+_0x5b1e0c)[_0xdaca('0x20')](_0x12aab0);}return null;};}function patchUpdates(_0x15200e){return function(_0x1088bd){try{jsonpatch[_0xdaca('0x25')](_0x1088bd,_0x15200e,!![]);}catch(_0x1924cb){return BPromise[_0xdaca('0x26')](_0x1924cb);}return _0x1088bd[_0xdaca('0x27')]();};}function saveUpdates(_0x126e74,_0x4f63f1){return function(_0x112e1d){if(_0x112e1d){return _0x112e1d[_0xdaca('0x28')](_0x126e74)[_0xdaca('0x29')](function(_0x511712){return _0x511712;});}return null;};}function removeEntity(_0x116e6d,_0x46df66){return function(_0x54a417){if(_0x54a417){return _0x54a417['destroy']()[_0xdaca('0x29')](function(){_0x116e6d[_0xdaca('0x1f')](0xcc)[_0xdaca('0x2a')]();});}};}function handleEntityNotFound(_0x126d42,_0x5c1a97){return function(_0x29df68){if(!_0x29df68){_0x126d42[_0xdaca('0x1e')](0x194);}return _0x29df68;};}function handleError(_0x10e5fa,_0x3fde9e){_0x3fde9e=_0x3fde9e||0x1f4;return function(_0x3a3f54){logger[_0xdaca('0x2b')](_0x3a3f54[_0xdaca('0x2c')]);if(_0x3a3f54[_0xdaca('0x2d')]){delete _0x3a3f54[_0xdaca('0x2d')];}_0x10e5fa[_0xdaca('0x1f')](_0x3fde9e)['send'](_0x3a3f54);};}exports[_0xdaca('0x2e')]=function(_0x2a824e,_0x467c1d){var _0x5e5545={},_0x5d0300={},_0x4ef109={'count':0x0,'rows':[]};var _0x311f1b=_['map'](db[_0xdaca('0x2f')][_0xdaca('0x30')],function(_0x51118f){return{'name':_0x51118f[_0xdaca('0x31')],'type':_0x51118f['type'][_0xdaca('0x32')]};});_0x5d0300[_0xdaca('0x33')]=_[_0xdaca('0x34')](_0x311f1b,'name');_0x5d0300[_0xdaca('0x35')]=_[_0xdaca('0x36')](_0x2a824e['query']);_0x5d0300['filters']=_[_0xdaca('0x37')](_0x5d0300['model'],_0x5d0300['query']);_0x5e5545[_0xdaca('0x38')]=_[_0xdaca('0x37')](_0x5d0300[_0xdaca('0x33')],qs['fields'](_0x2a824e[_0xdaca('0x35')]['fields']));_0x5e5545[_0xdaca('0x38')]=_0x5e5545[_0xdaca('0x38')]['length']?_0x5e5545[_0xdaca('0x38')]:_0x5d0300[_0xdaca('0x33')];if(!_0x2a824e[_0xdaca('0x35')]['hasOwnProperty'](_0xdaca('0x39'))){_0x5e5545['limit']=qs['limit'](_0x2a824e['query'][_0xdaca('0x22')]);_0x5e5545[_0xdaca('0x21')]=qs[_0xdaca('0x21')](_0x2a824e[_0xdaca('0x35')][_0xdaca('0x21')]);}_0x5e5545[_0xdaca('0x3a')]=qs[_0xdaca('0x3b')](_0x2a824e[_0xdaca('0x35')][_0xdaca('0x3b')]);_0x5e5545['where']=qs[_0xdaca('0x3c')](_['pick'](_0x2a824e['query'],_0x5d0300[_0xdaca('0x3c')]),_0x311f1b);if(_0x2a824e['query']['filter']){_0x5e5545[_0xdaca('0x3d')]=_['merge'](_0x5e5545[_0xdaca('0x3d')],{'$or':_[_0xdaca('0x34')](_0x311f1b,function(_0x122072){if(_0x122072['type']!==_0xdaca('0x3e')){var _0x422a23={};_0x422a23[_0x122072['name']]={'$like':'%'+_0x2a824e[_0xdaca('0x35')][_0xdaca('0x3f')]+'%'};return _0x422a23;}})});}_0x5e5545=_[_0xdaca('0x40')]({},_0x5e5545,_0x2a824e[_0xdaca('0x41')]);var _0x408fa0={'where':_0x5e5545[_0xdaca('0x3d')]};return db[_0xdaca('0x2f')][_0xdaca('0x23')](_0x408fa0)['then'](function(_0x354d98){_0x4ef109[_0xdaca('0x23')]=_0x354d98;if(_0x2a824e[_0xdaca('0x35')][_0xdaca('0x42')]){_0x5e5545['include']=[{'all':!![]}];}return db['ChatInternalMessage'][_0xdaca('0x43')](_0x5e5545);})[_0xdaca('0x29')](function(_0xa47f5c){_0x4ef109[_0xdaca('0x44')]=_0xa47f5c;return _0x4ef109;})[_0xdaca('0x29')](respondWithFilteredResult(_0x467c1d,_0x5e5545))['catch'](handleError(_0x467c1d,null));};exports[_0xdaca('0x45')]=function(_0x5e9c1d,_0x17f20d){var _0x2c71b5={'raw':!![],'where':{'id':_0x5e9c1d['params']['id']}},_0x314e50={};_0x314e50['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x314e50[_0xdaca('0x35')]=_[_0xdaca('0x36')](_0x5e9c1d['query']);_0x314e50['filters']=_[_0xdaca('0x37')](_0x314e50[_0xdaca('0x33')],_0x314e50['query']);_0x2c71b5[_0xdaca('0x38')]=_[_0xdaca('0x37')](_0x314e50[_0xdaca('0x33')],qs[_0xdaca('0x46')](_0x5e9c1d[_0xdaca('0x35')]['fields']));_0x2c71b5[_0xdaca('0x38')]=_0x2c71b5[_0xdaca('0x38')][_0xdaca('0x47')]?_0x2c71b5[_0xdaca('0x38')]:_0x314e50[_0xdaca('0x33')];if(_0x5e9c1d[_0xdaca('0x35')][_0xdaca('0x42')]){_0x2c71b5[_0xdaca('0x48')]=[{'all':!![]}];}_0x2c71b5=_[_0xdaca('0x40')]({},_0x2c71b5,_0x5e9c1d[_0xdaca('0x41')]);return db['ChatInternalMessage'][_0xdaca('0x49')](_0x2c71b5)['then'](handleEntityNotFound(_0x17f20d,null))[_0xdaca('0x29')](respondWithResult(_0x17f20d,null))[_0xdaca('0x4a')](handleError(_0x17f20d,null));};exports['create']=function(_0x5f4a2b,_0x5f0527){return db[_0xdaca('0x2f')][_0xdaca('0x4b')](_0x5f4a2b[_0xdaca('0x4c')],{})['then'](respondWithResult(_0x5f0527,0xc9))[_0xdaca('0x4a')](handleError(_0x5f0527,null));};exports[_0xdaca('0x28')]=function(_0x11119f,_0x26f6e5){if(_0x11119f[_0xdaca('0x4c')]['id']){delete _0x11119f[_0xdaca('0x4c')]['id'];}return db[_0xdaca('0x2f')][_0xdaca('0x49')]({'where':{'id':_0x11119f[_0xdaca('0x4d')]['id']}})[_0xdaca('0x29')](handleEntityNotFound(_0x26f6e5,null))[_0xdaca('0x29')](saveUpdates(_0x11119f[_0xdaca('0x4c')],null))[_0xdaca('0x29')](respondWithResult(_0x26f6e5,null))['catch'](handleError(_0x26f6e5,null));};exports[_0xdaca('0x4e')]=function(_0x2a4c54,_0x4437c3){return db['ChatInternalMessage'][_0xdaca('0x49')]({'where':{'id':_0x2a4c54[_0xdaca('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4437c3,null))['then'](removeEntity(_0x4437c3,null))[_0xdaca('0x4a')](handleError(_0x4437c3,null));};exports[_0xdaca('0x4f')]=function(_0x170457,_0xac6dd){return db['ChatInternalMessage']['describe']()['then'](respondWithResult(_0xac6dd,null))[_0xdaca('0x4a')](handleError(_0xac6dd,null));};function wrapUser(_0x4504a2){return function(_0x334875){var _0x4a9d5a=_0x4504a2[_0xdaca('0x50')]({'plain':!![]});_0x4a9d5a[_0xdaca('0x51')]=[];if(_0x334875){_0x4a9d5a['lastMessageAt']=_0x334875['createdAt'];_0x4a9d5a['lastMessage']=_0x334875;}else{_0x4a9d5a['lastMessageAt']=moment(0x0)[_0xdaca('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a9d5a['lastMessage']={};}return _0x4a9d5a;};}exports[_0xdaca('0x53')]=function(_0x40ee3b,_0x58b255,_0x532f5c){var _0x9b7d7=[];return db[_0xdaca('0x54')][_0xdaca('0x43')]({'where':{'role':[_0xdaca('0x55'),'admin',_0xdaca('0x56')]},'attributes':['id',_0xdaca('0x57'),_0xdaca('0x2d'),'role',_0xdaca('0x58'),_0xdaca('0x59'),_0xdaca('0x5a'),_0xdaca('0x5b'),_0xdaca('0x5c'),'showWebBar'],'order':qs[_0xdaca('0x3b')]('-online'),'include':[{'model':db[_0xdaca('0x5d')],'as':'VoiceQueues','attributes':['id',_0xdaca('0x2d'),_0xdaca('0x5e')],'through':{'attributes':[]}}]})[_0xdaca('0x29')](function(_0x2e7345){if(_0x2e7345){var _0x1e50bc=_0x40ee3b['user'][_0xdaca('0x50')]({'plain':!![]});if(!_0x1e50bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e50bc[_0xdaca('0x5f')]==='user'){return db[_0xdaca('0x60')][_0xdaca('0x49')]({'where':{'name':_0xdaca('0x61'),'userProfileId':_0x1e50bc['userProfileId']},'raw':!![]})['then'](function(_0x1a51cb){if(_0x1a51cb){if(_0x1a51cb['autoAssociation']===0x0){return db[_0xdaca('0x62')]['findAll']({'where':{'sectionId':_0x1a51cb['id']},'raw':!![]})[_0xdaca('0x29')](function(_0x702cf5){var _0x1caa59=[];if(_['isEmpty'](_0x702cf5)){_0x1caa59=_[_0xdaca('0x3f')](_0x2e7345,function(_0x1caefc){if(_0x1caefc[_0xdaca('0x5f')]!=='agent'){return _0x1caefc;}});return _0x1caa59;}else{for(var _0x2d3066=0x0;_0x2d3066<_0x2e7345[_0xdaca('0x47')];_0x2d3066++){var _0x556e54=_0x2e7345[_0x2d3066];if(_0x556e54[_0xdaca('0x5f')]==='agent'){var _0x3500d2=_['find'](_0x702cf5,function(_0x22d822){return _0x22d822[_0xdaca('0x63')]===_0x556e54['id'];});if(_0x3500d2)_0x1caa59['push'](_0x556e54);}else{_0x1caa59[_0xdaca('0x64')](_0x556e54);}}return _0x1caa59;}});}else{return _0x2e7345;}}else{var _0x1b77a2=_[_0xdaca('0x3f')](_0x2e7345,function(_0x47d294){if(_0x47d294[_0xdaca('0x5f')]!=='agent'){return _0x47d294;}});return _0x1b77a2;}});}else{return _0x2e7345;}}})[_0xdaca('0x29')](function(_0x373eda){var _0x1a000e=[];if(_0x373eda){_0x9b7d7=_0x373eda;for(var _0x4d1975=0x0;_0x4d1975<_0x373eda[_0xdaca('0x47')];_0x4d1975+=0x1){_0x9b7d7[_0x4d1975][_0xdaca('0x51')]=[];_0x1a000e['push'](db['ChatInternalMessage'][_0xdaca('0x49')]({'where':{'FromId':[_0x40ee3b[_0xdaca('0x56')]['id'],_0x373eda[_0x4d1975]['id']],'ToId':[_0x40ee3b[_0xdaca('0x56')]['id'],_0x373eda[_0x4d1975]['id']],'ChatGroupId':null},'attributes':['id',_0xdaca('0x65'),_0xdaca('0x66'),_0xdaca('0x67'),_0xdaca('0x68'),_0xdaca('0x4c')],'order':qs['sort'](_0xdaca('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xdaca('0x29')](wrapUser(_0x373eda[_0x4d1975])));}return BPromise[_0xdaca('0x6a')](_0x1a000e);}return[];})[_0xdaca('0x29')](function(_0x2c523f){return{'rows':_0x2c523f,'count':_0x2c523f[_0xdaca('0x47')]};})[_0xdaca('0x29')](respondWithResult(_0x58b255,null))[_0xdaca('0x4a')](handleError(_0x58b255,null));};
\ No newline at end of file
+var _0x73b0=['socket.io-emitter','./chatInternalMessage.socket','register','status','end','json','undefined','offset','count','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','messages','FromId','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost'];(function(_0x1847c3,_0x4155c9){var _0x1802af=function(_0x25a210){while(--_0x25a210){_0x1847c3['push'](_0x1847c3['shift']());}};_0x1802af(++_0x4155c9);}(_0x73b0,0x149));var _0x073b=function(_0x48a1ee,_0x4354fe){_0x48a1ee=_0x48a1ee-0x0;var _0x5ce1d3=_0x73b0[_0x48a1ee];return _0x5ce1d3;};'use strict';var emlformat=require(_0x073b('0x0'));var rimraf=require(_0x073b('0x1'));var zipdir=require(_0x073b('0x2'));var jsonpatch=require(_0x073b('0x3'));var rp=require(_0x073b('0x4'));var moment=require(_0x073b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x073b('0x6'));var sox=require(_0x073b('0x7'));var csv=require('to-csv');var ejs=require(_0x073b('0x8'));var fs=require('fs');var fs_extra=require(_0x073b('0x9'));var _=require('lodash');var squel=require(_0x073b('0xa'));var crypto=require(_0x073b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x073b('0xc'));var toCsv=require(_0x073b('0xd'));var querystring=require(_0x073b('0xe'));var Papa=require(_0x073b('0xf'));var Redis=require('ioredis');var authService=require(_0x073b('0x10'));var qs=require(_0x073b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x073b('0x12'));var logger=require(_0x073b('0x13'))(_0x073b('0x14'));var utils=require(_0x073b('0x15'));var config=require(_0x073b('0x16'));var licenseUtil=require(_0x073b('0x17'));var db=require(_0x073b('0x18'))['db'];config['redis']=_[_0x073b('0x19')](config[_0x073b('0x1a')],{'host':_0x073b('0x1b'),'port':0x18eb});var socket=require(_0x073b('0x1c'))(new Redis(config[_0x073b('0x1a')]));require(_0x073b('0x1d'))[_0x073b('0x1e')](socket);function respondWithStatusCode(_0x588681,_0xa144fc){_0xa144fc=_0xa144fc||0xcc;return function(_0x467ebd){if(_0x467ebd){return _0x588681['sendStatus'](_0xa144fc);}return _0x588681[_0x073b('0x1f')](_0xa144fc)[_0x073b('0x20')]();};}function respondWithResult(_0x5e8bb6,_0x1590e9){_0x1590e9=_0x1590e9||0xc8;return function(_0x28abc5){if(_0x28abc5){return _0x5e8bb6[_0x073b('0x1f')](_0x1590e9)[_0x073b('0x21')](_0x28abc5);}};}function respondWithFilteredResult(_0x404f1f,_0x24748a){return function(_0x39a790){if(_0x39a790){var _0x4749a2=typeof _0x24748a['offset']===_0x073b('0x22')&&typeof _0x24748a['limit']===_0x073b('0x22');var _0x5b411f=_0x39a790['count'];var _0x2be0a0=_0x4749a2?0x0:_0x24748a[_0x073b('0x23')];var _0x783e5b=_0x4749a2?_0x39a790[_0x073b('0x24')]:_0x24748a[_0x073b('0x23')]+_0x24748a[_0x073b('0x25')];var _0x2c3d80;if(_0x783e5b>=_0x5b411f){_0x783e5b=_0x5b411f;_0x2c3d80=0xc8;}else{_0x2c3d80=0xce;}_0x404f1f[_0x073b('0x1f')](_0x2c3d80);return _0x404f1f['set'](_0x073b('0x26'),_0x2be0a0+'-'+_0x783e5b+'/'+_0x5b411f)[_0x073b('0x21')](_0x39a790);}return null;};}function patchUpdates(_0x175466){return function(_0x2ee0a6){try{jsonpatch[_0x073b('0x27')](_0x2ee0a6,_0x175466,!![]);}catch(_0x289207){return BPromise[_0x073b('0x28')](_0x289207);}return _0x2ee0a6['save']();};}function saveUpdates(_0x39b3fa,_0x50de29){return function(_0x22be4b){if(_0x22be4b){return _0x22be4b[_0x073b('0x29')](_0x39b3fa)[_0x073b('0x2a')](function(_0x1f4cc5){return _0x1f4cc5;});}return null;};}function removeEntity(_0x292d6a,_0x2426cc){return function(_0x7fb180){if(_0x7fb180){return _0x7fb180[_0x073b('0x2b')]()['then'](function(){_0x292d6a[_0x073b('0x1f')](0xcc)[_0x073b('0x20')]();});}};}function handleEntityNotFound(_0xdd1989,_0x1c44a9){return function(_0x2132b3){if(!_0x2132b3){_0xdd1989[_0x073b('0x2c')](0x194);}return _0x2132b3;};}function handleError(_0xc8c729,_0x4c5dfb){_0x4c5dfb=_0x4c5dfb||0x1f4;return function(_0x4a8175){logger[_0x073b('0x2d')](_0x4a8175[_0x073b('0x2e')]);if(_0x4a8175[_0x073b('0x2f')]){delete _0x4a8175['name'];}_0xc8c729[_0x073b('0x1f')](_0x4c5dfb)[_0x073b('0x30')](_0x4a8175);};}exports[_0x073b('0x31')]=function(_0x2d950b,_0x15d214){var _0x23cc84={},_0x1cf9b2={},_0x426be7={'count':0x0,'rows':[]};var _0x335c71=_['map'](db[_0x073b('0x32')][_0x073b('0x33')],function(_0xec5eef){return{'name':_0xec5eef[_0x073b('0x34')],'type':_0xec5eef[_0x073b('0x35')][_0x073b('0x36')]};});_0x1cf9b2['model']=_[_0x073b('0x37')](_0x335c71,_0x073b('0x2f'));_0x1cf9b2[_0x073b('0x38')]=_['keys'](_0x2d950b[_0x073b('0x38')]);_0x1cf9b2[_0x073b('0x39')]=_[_0x073b('0x3a')](_0x1cf9b2[_0x073b('0x3b')],_0x1cf9b2[_0x073b('0x38')]);_0x23cc84[_0x073b('0x3c')]=_[_0x073b('0x3a')](_0x1cf9b2[_0x073b('0x3b')],qs[_0x073b('0x3d')](_0x2d950b[_0x073b('0x38')][_0x073b('0x3d')]));_0x23cc84[_0x073b('0x3c')]=_0x23cc84[_0x073b('0x3c')][_0x073b('0x3e')]?_0x23cc84[_0x073b('0x3c')]:_0x1cf9b2[_0x073b('0x3b')];if(!_0x2d950b[_0x073b('0x38')][_0x073b('0x3f')](_0x073b('0x40'))){_0x23cc84[_0x073b('0x25')]=qs['limit'](_0x2d950b[_0x073b('0x38')][_0x073b('0x25')]);_0x23cc84[_0x073b('0x23')]=qs[_0x073b('0x23')](_0x2d950b[_0x073b('0x38')]['offset']);}_0x23cc84[_0x073b('0x41')]=qs[_0x073b('0x42')](_0x2d950b[_0x073b('0x38')]['sort']);_0x23cc84[_0x073b('0x43')]=qs[_0x073b('0x39')](_['pick'](_0x2d950b[_0x073b('0x38')],_0x1cf9b2['filters']),_0x335c71);if(_0x2d950b[_0x073b('0x38')][_0x073b('0x44')]){_0x23cc84[_0x073b('0x43')]=_['merge'](_0x23cc84[_0x073b('0x43')],{'$or':_[_0x073b('0x37')](_0x335c71,function(_0x2d1ef0){if(_0x2d1ef0[_0x073b('0x35')]!==_0x073b('0x45')){var _0x17a536={};_0x17a536[_0x2d1ef0[_0x073b('0x2f')]]={'$like':'%'+_0x2d950b[_0x073b('0x38')]['filter']+'%'};return _0x17a536;}})});}_0x23cc84=_[_0x073b('0x46')]({},_0x23cc84,_0x2d950b[_0x073b('0x47')]);var _0x41be60={'where':_0x23cc84[_0x073b('0x43')]};return db[_0x073b('0x32')][_0x073b('0x24')](_0x41be60)[_0x073b('0x2a')](function(_0x5c8ceb){_0x426be7[_0x073b('0x24')]=_0x5c8ceb;if(_0x2d950b[_0x073b('0x38')][_0x073b('0x48')]){_0x23cc84[_0x073b('0x49')]=[{'all':!![]}];}return db[_0x073b('0x32')][_0x073b('0x4a')](_0x23cc84);})[_0x073b('0x2a')](function(_0x4614e1){_0x426be7[_0x073b('0x4b')]=_0x4614e1;return _0x426be7;})[_0x073b('0x2a')](respondWithFilteredResult(_0x15d214,_0x23cc84))[_0x073b('0x4c')](handleError(_0x15d214,null));};exports[_0x073b('0x4d')]=function(_0x4e7bc4,_0x155df0){var _0x531670={'raw':!![],'where':{'id':_0x4e7bc4[_0x073b('0x4e')]['id']}},_0x1231a5={};_0x1231a5[_0x073b('0x3b')]=_[_0x073b('0x4f')](db[_0x073b('0x32')]['rawAttributes']);_0x1231a5['query']=_[_0x073b('0x4f')](_0x4e7bc4[_0x073b('0x38')]);_0x1231a5['filters']=_[_0x073b('0x3a')](_0x1231a5[_0x073b('0x3b')],_0x1231a5[_0x073b('0x38')]);_0x531670[_0x073b('0x3c')]=_[_0x073b('0x3a')](_0x1231a5['model'],qs[_0x073b('0x3d')](_0x4e7bc4['query']['fields']));_0x531670[_0x073b('0x3c')]=_0x531670[_0x073b('0x3c')][_0x073b('0x3e')]?_0x531670[_0x073b('0x3c')]:_0x1231a5[_0x073b('0x3b')];if(_0x4e7bc4[_0x073b('0x38')][_0x073b('0x48')]){_0x531670['include']=[{'all':!![]}];}_0x531670=_[_0x073b('0x46')]({},_0x531670,_0x4e7bc4[_0x073b('0x47')]);return db['ChatInternalMessage']['find'](_0x531670)[_0x073b('0x2a')](handleEntityNotFound(_0x155df0,null))[_0x073b('0x2a')](respondWithResult(_0x155df0,null))[_0x073b('0x4c')](handleError(_0x155df0,null));};exports[_0x073b('0x50')]=function(_0xb26273,_0x4d30c1){return db[_0x073b('0x32')]['create'](_0xb26273[_0x073b('0x51')],{})[_0x073b('0x2a')](respondWithResult(_0x4d30c1,0xc9))[_0x073b('0x4c')](handleError(_0x4d30c1,null));};exports['update']=function(_0x13117e,_0x51aac4){if(_0x13117e[_0x073b('0x51')]['id']){delete _0x13117e['body']['id'];}return db['ChatInternalMessage'][_0x073b('0x52')]({'where':{'id':_0x13117e[_0x073b('0x4e')]['id']}})[_0x073b('0x2a')](handleEntityNotFound(_0x51aac4,null))['then'](saveUpdates(_0x13117e[_0x073b('0x51')],null))[_0x073b('0x2a')](respondWithResult(_0x51aac4,null))[_0x073b('0x4c')](handleError(_0x51aac4,null));};exports[_0x073b('0x2b')]=function(_0x56db47,_0x41cc27){return db[_0x073b('0x32')][_0x073b('0x52')]({'where':{'id':_0x56db47[_0x073b('0x4e')]['id']}})[_0x073b('0x2a')](handleEntityNotFound(_0x41cc27,null))[_0x073b('0x2a')](removeEntity(_0x41cc27,null))[_0x073b('0x4c')](handleError(_0x41cc27,null));};exports[_0x073b('0x53')]=function(_0x36fe81,_0x2240d8){return db[_0x073b('0x32')][_0x073b('0x53')]()['then'](respondWithResult(_0x2240d8,null))[_0x073b('0x4c')](handleError(_0x2240d8,null));};function wrapUser(_0x2eb614){return function(_0x17c993){var _0x147a1c=_0x2eb614[_0x073b('0x54')]({'plain':!![]});_0x147a1c['messages']=[];if(_0x17c993){_0x147a1c[_0x073b('0x55')]=_0x17c993[_0x073b('0x56')];_0x147a1c['lastMessage']=_0x17c993;}else{_0x147a1c[_0x073b('0x55')]=moment(0x0)[_0x073b('0x57')](_0x073b('0x58'));_0x147a1c[_0x073b('0x59')]={};}return _0x147a1c;};}exports[_0x073b('0x5a')]=function(_0x5376ca,_0x2d17e2,_0x2a0e4b){var _0x4219ef=[];return db[_0x073b('0x5b')][_0x073b('0x4a')]({'where':{'role':[_0x073b('0x5c'),_0x073b('0x5d'),_0x073b('0x5e')]},'attributes':['id',_0x073b('0x5f'),_0x073b('0x2f'),_0x073b('0x60'),_0x073b('0x61'),_0x073b('0x62'),_0x073b('0x63'),_0x073b('0x64'),_0x073b('0x65'),_0x073b('0x66')],'order':qs[_0x073b('0x42')]('-online'),'include':[{'model':db[_0x073b('0x67')],'as':_0x073b('0x68'),'attributes':['id',_0x073b('0x2f'),_0x073b('0x35')],'through':{'attributes':[]}}]})[_0x073b('0x2a')](function(_0xe5ee3d){if(_0xe5ee3d){var _0x16d7f5=_0x5376ca['user']['get']({'plain':!![]});if(!_0x16d7f5)throw new Error(_0x073b('0x69'));if(_0x16d7f5[_0x073b('0x60')]===_0x073b('0x5e')){return db[_0x073b('0x6a')][_0x073b('0x52')]({'where':{'name':_0x073b('0x6b'),'userProfileId':_0x16d7f5[_0x073b('0x6c')]},'raw':!![]})[_0x073b('0x2a')](function(_0x24ba39){if(_0x24ba39){if(_0x24ba39[_0x073b('0x6d')]===0x0){return db[_0x073b('0x6e')][_0x073b('0x4a')]({'where':{'sectionId':_0x24ba39['id']},'raw':!![]})['then'](function(_0xc4d8e3){var _0x1b3abe=[];if(_[_0x073b('0x6f')](_0xc4d8e3)){_0x1b3abe=_[_0x073b('0x44')](_0xe5ee3d,function(_0x1be5d1){if(_0x1be5d1[_0x073b('0x60')]!==_0x073b('0x5c')){return _0x1be5d1;}});return _0x1b3abe;}else{for(var _0xf582e2=0x0;_0xf582e2<_0xe5ee3d[_0x073b('0x3e')];_0xf582e2++){var _0x33e867=_0xe5ee3d[_0xf582e2];if(_0x33e867['role']==='agent'){var _0x20efdb=_[_0x073b('0x52')](_0xc4d8e3,function(_0xcf07a8){return _0xcf07a8[_0x073b('0x70')]===_0x33e867['id'];});if(_0x20efdb)_0x1b3abe[_0x073b('0x71')](_0x33e867);}else{_0x1b3abe['push'](_0x33e867);}}return _0x1b3abe;}});}else{return _0xe5ee3d;}}else{var _0x39c80a=_[_0x073b('0x44')](_0xe5ee3d,function(_0x5e9a1c){if(_0x5e9a1c['role']!=='agent'){return _0x5e9a1c;}});return _0x39c80a;}});}else{return _0xe5ee3d;}}})[_0x073b('0x2a')](function(_0x1d2405){var _0x59fc48=[];if(_0x1d2405){_0x4219ef=_0x1d2405;for(var _0x2669a7=0x0;_0x2669a7<_0x1d2405[_0x073b('0x3e')];_0x2669a7+=0x1){_0x4219ef[_0x2669a7][_0x073b('0x72')]=[];_0x59fc48[_0x073b('0x71')](db[_0x073b('0x32')][_0x073b('0x52')]({'where':{'FromId':[_0x5376ca[_0x073b('0x5e')]['id'],_0x1d2405[_0x2669a7]['id']],'ToId':[_0x5376ca[_0x073b('0x5e')]['id'],_0x1d2405[_0x2669a7]['id']],'ChatGroupId':null},'attributes':['id',_0x073b('0x56'),_0x073b('0x73'),_0x073b('0x74'),_0x073b('0x75'),_0x073b('0x51')],'order':qs[_0x073b('0x42')](_0x073b('0x76')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x1d2405[_0x2669a7])));}return BPromise['all'](_0x59fc48);}return[];})[_0x073b('0x2a')](function(_0xd93eaf){return{'rows':_0xd93eaf,'count':_0xd93eaf[_0x073b('0x3e')]};})[_0x073b('0x2a')](respondWithResult(_0x2d17e2,null))[_0x073b('0x4c')](handleError(_0x2d17e2,null));};
\ No newline at end of file
index 1278efd..820d6c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5939=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5939,0x1dc));var _0x9593=function(_0x2f6bf5,_0x5e5945){_0x2f6bf5=_0x2f6bf5-0x0;var _0x467833=_0x5939[_0x2f6bf5];return _0x467833;};'use strict';var EventEmitter=require(_0x9593('0x0'));var ChatInternalMessage=require(_0x9593('0x1'))['db'][_0x9593('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9593('0x3')](0x0);var events={'afterCreate':_0x9593('0x4'),'afterUpdate':_0x9593('0x5'),'afterDestroy':_0x9593('0x6')};function emitEvent(_0x455ea7){return function(_0x1c7d72,_0x31f79c,_0x5ba4a7){ChatInternalMessageEvents['emit'](_0x455ea7+':'+_0x1c7d72['id'],_0x1c7d72);ChatInternalMessageEvents[_0x9593('0x7')](_0x455ea7,_0x1c7d72);_0x5ba4a7(null);};}for(var e in events){if(events[_0x9593('0x8')](e)){var event=events[e];ChatInternalMessage[_0x9593('0x9')](e,emitEvent(event));}}module[_0x9593('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x95c8=['hook','exports','../../mysqldb','ChatInternalMessage','save','update','emit','hasOwnProperty'];(function(_0x47f2eb,_0x17bb2e){var _0x7dee61=function(_0x366457){while(--_0x366457){_0x47f2eb['push'](_0x47f2eb['shift']());}};_0x7dee61(++_0x17bb2e);}(_0x95c8,0x16a));var _0x895c=function(_0x257aa2,_0x38baa0){_0x257aa2=_0x257aa2-0x0;var _0x293652=_0x95c8[_0x257aa2];return _0x293652;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x895c('0x0'))['db'][_0x895c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x895c('0x2'),'afterUpdate':_0x895c('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25a39e){return function(_0x8f63a,_0x3d77b0,_0x38a8e9){ChatInternalMessageEvents[_0x895c('0x4')](_0x25a39e+':'+_0x8f63a['id'],_0x8f63a);ChatInternalMessageEvents[_0x895c('0x4')](_0x25a39e,_0x8f63a);_0x38a8e9(null);};}for(var e in events){if(events[_0x895c('0x5')](e)){var event=events[e];ChatInternalMessage[_0x895c('0x6')](e,emitEvent(event));}}module[_0x895c('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
index 21bdbfd..7386506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe18c=['util','api','moment','bluebird','rimraf','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe18c,0xdb));var _0xce18=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe18c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xce18('0x0'));var util=require(_0xce18('0x1'));var logger=require('../../config/logger')(_0xce18('0x2'));var moment=require(_0xce18('0x3'));var BPromise=require(_0xce18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce18('0x5'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0xce18('0x6')]=function(_0x1dc780,_0x4b0899){return _0x1dc780['define'](_0xce18('0x7'),attributes,{'tableName':_0xce18('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce18('0x9'),'collate':_0xce18('0xa')});};
\ No newline at end of file
+var _0x18ef=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x1206a3,_0xd655f1){var _0x4d2ad5=function(_0x4cc1c6){while(--_0x4cc1c6){_0x1206a3['push'](_0x1206a3['shift']());}};_0x4d2ad5(++_0xd655f1);}(_0x18ef,0x146));var _0xf18e=function(_0x2a3003,_0x12142a){_0x2a3003=_0x2a3003-0x0;var _0xe6ae37=_0x18ef[_0x2a3003];return _0xe6ae37;};'use strict';var _=require(_0xf18e('0x0'));var util=require(_0xf18e('0x1'));var logger=require(_0xf18e('0x2'))(_0xf18e('0x3'));var moment=require(_0xf18e('0x4'));var BPromise=require(_0xf18e('0x5'));var rp=require(_0xf18e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf18e('0x7'));var config=require(_0xf18e('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0xf18e('0x9')]=function(_0x449547,_0x3cefcf){return _0x449547[_0xf18e('0xa')](_0xf18e('0xb'),attributes,{'tableName':_0xf18e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf18e('0xd'),'collate':_0xf18e('0xe')});};
\ No newline at end of file
index dfb2b60..0cc5ff3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a66=['info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','then'];(function(_0x9ae685,_0x2c6652){var _0x4c492e=function(_0xde76ce){while(--_0xde76ce){_0x9ae685['push'](_0x9ae685['shift']());}};_0x4c492e(++_0x2c6652);}(_0x5a66,0x169));var _0x65a6=function(_0x1ac9f1,_0x2de131){_0x1ac9f1=_0x1ac9f1-0x0;var _0x2924dc=_0x5a66[_0x1ac9f1];return _0x2924dc;};'use strict';var _=require('lodash');var util=require(_0x65a6('0x0'));var moment=require(_0x65a6('0x1'));var BPromise=require(_0x65a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65a6('0x3'));var db=require(_0x65a6('0x4'))['db'];var utils=require(_0x65a6('0x5'));var logger=require(_0x65a6('0x6'))('rpc');var config=require(_0x65a6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65a6('0x8')][_0x65a6('0x9')]({'port':0x232a});config[_0x65a6('0xa')]=_[_0x65a6('0xb')](config[_0x65a6('0xa')],{'host':_0x65a6('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65a6('0xa')]));require(_0x65a6('0xd'))[_0x65a6('0xe')](socket);function respondWithRpcPromise(_0x277237,_0x303db0,_0x1de468){return new BPromise(function(_0x17bcd3,_0x43e5fe){return client[_0x65a6('0xf')](_0x277237,_0x1de468)[_0x65a6('0x10')](function(_0x56ad8a){logger[_0x65a6('0x11')](_0x65a6('0x12'),_0x303db0,_0x65a6('0x13'));logger[_0x65a6('0x14')](_0x65a6('0x15'),_0x303db0,_0x65a6('0x13'),JSON[_0x65a6('0x16')](_0x56ad8a));if(_0x56ad8a[_0x65a6('0x17')]){if(_0x56ad8a['error']['code']===0x1f4){logger['error'](_0x65a6('0x12'),_0x303db0,_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);return _0x43e5fe(_0x56ad8a[_0x65a6('0x17')]['message']);}logger['error'](_0x65a6('0x12'),_0x303db0,_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);return _0x17bcd3(_0x56ad8a[_0x65a6('0x17')][_0x65a6('0x18')]);}else{logger[_0x65a6('0x11')]('ChatInternalMessage,\x20%s,\x20%s',_0x303db0,_0x65a6('0x13'));_0x17bcd3(_0x56ad8a[_0x65a6('0x19')][_0x65a6('0x18')]);}})[_0x65a6('0x1a')](function(_0x1a9473){logger[_0x65a6('0x17')](_0x65a6('0x12'),_0x303db0,_0x1a9473);_0x43e5fe(_0x1a9473);});});}
\ No newline at end of file
+var _0x6a8e=['defaults','localhost','./chatInternalMessage.socket','register','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','ChatInternalMessage,\x20%s,\x20%s','message','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x1bcf34,_0xf080e3){_0x1bcf34=_0x1bcf34-0x0;var _0x1691b1=_0x6a8e[_0x1bcf34];return _0x1691b1;};'use strict';var _=require('lodash');var util=require(_0xe6a8('0x0'));var moment=require('moment');var BPromise=require(_0xe6a8('0x1'));var rs=require(_0xe6a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe6a8('0x3'))['db'];var utils=require(_0xe6a8('0x4'));var logger=require(_0xe6a8('0x5'))(_0xe6a8('0x6'));var config=require(_0xe6a8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe6a8('0x8')][_0xe6a8('0x9')]({'port':0x232a});config[_0xe6a8('0xa')]=_[_0xe6a8('0xb')](config[_0xe6a8('0xa')],{'host':_0xe6a8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe6a8('0xd'))[_0xe6a8('0xe')](socket);function respondWithRpcPromise(_0x5819d2,_0x3a2de1,_0x1f4e1f){return new BPromise(function(_0x26f98b,_0x1cbb69){return client['request'](_0x5819d2,_0x1f4e1f)[_0xe6a8('0xf')](function(_0x4ba96c){logger[_0xe6a8('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,'request\x20sent');logger[_0xe6a8('0x11')](_0xe6a8('0x12'),_0x3a2de1,_0xe6a8('0x13'),JSON['stringify'](_0x4ba96c));if(_0x4ba96c[_0xe6a8('0x14')]){if(_0x4ba96c[_0xe6a8('0x14')]['code']===0x1f4){logger[_0xe6a8('0x14')](_0xe6a8('0x15'),_0x3a2de1,_0x4ba96c[_0xe6a8('0x14')]['message']);return _0x1cbb69(_0x4ba96c[_0xe6a8('0x14')]['message']);}logger[_0xe6a8('0x14')](_0xe6a8('0x15'),_0x3a2de1,_0x4ba96c[_0xe6a8('0x14')]['message']);return _0x26f98b(_0x4ba96c[_0xe6a8('0x14')][_0xe6a8('0x16')]);}else{logger[_0xe6a8('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,_0xe6a8('0x13'));_0x26f98b(_0x4ba96c['result'][_0xe6a8('0x16')]);}})['catch'](function(_0x4753ba){logger[_0xe6a8('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x3a2de1,_0x4753ba);_0x1cbb69(_0x4753ba);});});}
\ No newline at end of file
index 03f0af3..b0d914a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12bc=['save','remove','update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0x35f193,_0xe0e187){var _0x31127b=function(_0xb99605){while(--_0xb99605){_0x35f193['push'](_0x35f193['shift']());}};_0x31127b(++_0xe0e187);}(_0x12bc,0x8f));var _0xc12b=function(_0x158dd7,_0x1f5f90){_0x158dd7=_0x158dd7-0x0;var _0x1772ba=_0x12bc[_0x158dd7];return _0x1772ba;};'use strict';var ChatInternalMessageEvents=require(_0xc12b('0x0'));var events=[_0xc12b('0x1'),_0xc12b('0x2'),_0xc12b('0x3')];function createListener(_0x185ff1,_0x3a1e49){return function(_0x4b3207){_0x3a1e49[_0xc12b('0x4')](_0x185ff1,_0x4b3207);};}function removeListener(_0x6f667a,_0x4b36e6){return function(){ChatInternalMessageEvents['removeListener'](_0x6f667a,_0x4b36e6);};}exports[_0xc12b('0x5')]=function(_0x1de8af){for(var _0x3ddd3d=0x0,_0x5f066f=events[_0xc12b('0x6')];_0x3ddd3d<_0x5f066f;_0x3ddd3d++){var _0x9b4cc7=events[_0x3ddd3d];var _0x59ad4a=createListener(_0xc12b('0x7')+_0x9b4cc7,_0x1de8af);ChatInternalMessageEvents['on'](_0x9b4cc7,_0x59ad4a);}};
\ No newline at end of file
+var _0xe0df=['removeListener','register','length','./chatInternalMessage.events','save','emit'];(function(_0x1b29b2,_0x3b6b11){var _0x560b68=function(_0x50a4ea){while(--_0x50a4ea){_0x1b29b2['push'](_0x1b29b2['shift']());}};_0x560b68(++_0x3b6b11);}(_0xe0df,0xcf));var _0xfe0d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xe0df[_0x618414];return _0x21c19a;};'use strict';var ChatInternalMessageEvents=require(_0xfe0d('0x0'));var events=[_0xfe0d('0x1'),'remove','update'];function createListener(_0x297130,_0x558376){return function(_0x45c74d){_0x558376[_0xfe0d('0x2')](_0x297130,_0x45c74d);};}function removeListener(_0x5de162,_0x535162){return function(){ChatInternalMessageEvents[_0xfe0d('0x3')](_0x5de162,_0x535162);};}exports[_0xfe0d('0x4')]=function(_0x4fdc54){for(var _0x232986=0x0,_0x24fd73=events[_0xfe0d('0x5')];_0x232986<_0x24fd73;_0x232986++){var _0x5f0449=events[_0x232986];var _0x4b23ff=createListener('chatInternalMessage:'+_0x5f0449,_0x4fdc54);ChatInternalMessageEvents['on'](_0x5f0449,_0x4b23ff);}};
\ No newline at end of file
index b739011..6e4b70b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76b4=['describe','/users','getUsers','/:id','show','create','put','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x58f29c,_0x551df2){var _0x5266ed=function(_0x421cbc){while(--_0x421cbc){_0x58f29c['push'](_0x58f29c['shift']());}};_0x5266ed(++_0x551df2);}(_0x76b4,0x110));var _0x476b=function(_0x14eb67,_0x3d8244){_0x14eb67=_0x14eb67-0x0;var _0x13d982=_0x76b4[_0x14eb67];return _0x13d982;};'use strict';var multer=require(_0x476b('0x0'));var util=require('util');var path=require(_0x476b('0x1'));var timeout=require(_0x476b('0x2'));var express=require(_0x476b('0x3'));var router=express[_0x476b('0x4')]();var fs_extra=require(_0x476b('0x5'));var auth=require(_0x476b('0x6'));var interaction=require(_0x476b('0x7'));var config=require(_0x476b('0x8'));var controller=require(_0x476b('0x9'));router['get']('/',auth[_0x476b('0xa')](),controller[_0x476b('0xb')]);router[_0x476b('0xc')](_0x476b('0xd'),auth[_0x476b('0xa')](),controller[_0x476b('0xe')]);router[_0x476b('0xc')](_0x476b('0xf'),auth[_0x476b('0xa')](),controller[_0x476b('0x10')]);router[_0x476b('0xc')](_0x476b('0x11'),auth[_0x476b('0xa')](),controller[_0x476b('0x12')]);router['post']('/',auth[_0x476b('0xa')](),controller[_0x476b('0x13')]);router[_0x476b('0x14')]('/:id',controller['update']);router['delete']('/:id',auth[_0x476b('0xa')](),controller[_0x476b('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x07df=['post','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x3f4c86,_0xb0070f){var _0xb18ffa=function(_0x3570cf){while(--_0x3570cf){_0x3f4c86['push'](_0x3f4c86['shift']());}};_0xb18ffa(++_0xb0070f);}(_0x07df,0x123));var _0xf07d=function(_0xafae14,_0x4ffe00){_0xafae14=_0xafae14-0x0;var _0x26024c=_0x07df[_0xafae14];return _0x26024c;};'use strict';var multer=require(_0xf07d('0x0'));var util=require('util');var path=require(_0xf07d('0x1'));var timeout=require(_0xf07d('0x2'));var express=require('express');var router=express[_0xf07d('0x3')]();var fs_extra=require(_0xf07d('0x4'));var auth=require(_0xf07d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf07d('0x6'));var controller=require(_0xf07d('0x7'));router[_0xf07d('0x8')]('/',auth[_0xf07d('0x9')](),controller[_0xf07d('0xa')]);router['get'](_0xf07d('0xb'),auth[_0xf07d('0x9')](),controller[_0xf07d('0xc')]);router['get'](_0xf07d('0xd'),auth[_0xf07d('0x9')](),controller[_0xf07d('0xe')]);router[_0xf07d('0x8')](_0xf07d('0xf'),auth[_0xf07d('0x9')](),controller[_0xf07d('0x10')]);router[_0xf07d('0x11')]('/',auth[_0xf07d('0x9')](),controller[_0xf07d('0x12')]);router['put'](_0xf07d('0xf'),controller[_0xf07d('0x13')]);router['delete'](_0xf07d('0xf'),auth[_0xf07d('0x9')](),controller[_0xf07d('0x14')]);module[_0xf07d('0x15')]=router;
\ No newline at end of file
index ac39fa5..e5468fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5fb=['medium','BOOLEAN','out','DATE','STRING','TEXT','sequelize','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe5fb,0xce));var _0xbe5f=function(_0x457b64,_0x49a219){_0x457b64=_0x457b64-0x0;var _0x437111=_0xe5fb[_0x457b64];return _0x437111;};'use strict';var Sequelize=require(_0xbe5f('0x0'));module[_0xbe5f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xbe5f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe5f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe5f('0x4')),'defaultValue':_0xbe5f('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe5f('0x5')]},'providerName':{'type':Sequelize[_0xbe5f('0x6')]},'providerResponse':{'type':Sequelize[_0xbe5f('0x7')]}};
\ No newline at end of file
+var _0xdef9=['TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0xdef9,0x1ed));var _0x9def=function(_0x362a9c,_0x434fd5){_0x362a9c=_0x362a9c-0x0;var _0x159079=_0xdef9[_0x362a9c];return _0x159079;};'use strict';var Sequelize=require(_0x9def('0x0'));module[_0x9def('0x1')]={'body':{'type':Sequelize[_0x9def('0x2')](_0x9def('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9def('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9def('0x5')]('in',_0x9def('0x6')),'defaultValue':_0x9def('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9def('0x7')]},'providerName':{'type':Sequelize[_0x9def('0x8')]},'providerResponse':{'type':Sequelize[_0x9def('0x2')]}};
\ No newline at end of file
index 1cbb7d1..62c70fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['message','result','catch','status','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','name','send','map','ChatMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','keys','rawAttributes','options','create','body','find','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','sequelize','Sequelize','SELECT','contact','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','User','email','parse','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0xa3fadc,_0xd1e16){var _0x23ecb8=function(_0x2c71f7){while(--_0x2c71f7){_0xa3fadc['push'](_0xa3fadc['shift']());}};_0x23ecb8(++_0xd1e16);}(_0xac4a,0x1f3));var _0xaac4=function(_0x3bccf3,_0x5943e1){_0x3bccf3=_0x3bccf3-0x0;var _0x2dd306=_0xac4a[_0x3bccf3];return _0x2dd306;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaac4('0x2'));var rp=require(_0xaac4('0x3'));var moment=require('moment');var BPromise=require(_0xaac4('0x4'));var Mustache=require(_0xaac4('0x5'));var util=require('util');var path=require(_0xaac4('0x6'));var sox=require('sox');var csv=require(_0xaac4('0x7'));var ejs=require(_0xaac4('0x8'));var fs=require('fs');var fs_extra=require(_0xaac4('0x9'));var _=require(_0xaac4('0xa'));var squel=require(_0xaac4('0xb'));var crypto=require(_0xaac4('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xaac4('0xd'));var toCsv=require(_0xaac4('0x7'));var querystring=require(_0xaac4('0xe'));var Papa=require(_0xaac4('0xf'));var Redis=require(_0xaac4('0x10'));var authService=require(_0xaac4('0x11'));var qs=require(_0xaac4('0x12'));var as=require(_0xaac4('0x13'));var hardwareService=require(_0xaac4('0x14'));var logger=require(_0xaac4('0x15'))(_0xaac4('0x16'));var utils=require('../../config/utils');var config=require(_0xaac4('0x17'));var licenseUtil=require(_0xaac4('0x18'));var db=require('../../mysqldb')['db'];config[_0xaac4('0x19')]=_['defaults'](config['redis'],{'host':_0xaac4('0x1a'),'port':0x18eb});var socket=require(_0xaac4('0x1b'))(new Redis(config[_0xaac4('0x19')]));require(_0xaac4('0x1c'))[_0xaac4('0x1d')](socket);var jayson=require(_0xaac4('0x1e'));var client=jayson[_0xaac4('0x1f')][_0xaac4('0x20')]({'port':0x232c});var client9002=jayson[_0xaac4('0x1f')][_0xaac4('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1b8367,_0x191604,_0x450d47,_0x5704cd){return new BPromise(function(_0x1a1761,_0x11a29e){var _0x15cd5c=_0x5704cd||client;return _0x15cd5c[_0xaac4('0x21')](_0x1b8367,_0x450d47)['then'](function(_0x4a41d2){logger[_0xaac4('0x22')](_0xaac4('0x23'),_0x191604,_0xaac4('0x24'));logger[_0xaac4('0x25')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x191604,_0xaac4('0x24'),JSON[_0xaac4('0x26')](_0x4a41d2));if(_0x4a41d2[_0xaac4('0x27')]){if(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x28')]===0x1f4){logger['error'](_0xaac4('0x23'),_0x191604,_0x4a41d2[_0xaac4('0x27')]['message']);return _0x11a29e(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);}logger[_0xaac4('0x27')](_0xaac4('0x23'),_0x191604,_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);return _0x1a1761(_0x4a41d2[_0xaac4('0x27')][_0xaac4('0x29')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x191604,_0xaac4('0x24'));_0x1a1761(_0x4a41d2[_0xaac4('0x2a')][_0xaac4('0x29')]);}})[_0xaac4('0x2b')](function(_0x767463){logger[_0xaac4('0x27')](_0xaac4('0x23'),_0x191604,_0x767463);_0x11a29e(_0x767463);});});}function respondWithStatusCode(_0x534f32,_0x4fa6c3){_0x4fa6c3=_0x4fa6c3||0xcc;return function(_0x4853de){if(_0x4853de){return _0x534f32['sendStatus'](_0x4fa6c3);}return _0x534f32[_0xaac4('0x2c')](_0x4fa6c3)['end']();};}function respondWithResult(_0xeeb791,_0x312cac){_0x312cac=_0x312cac||0xc8;return function(_0x44fdf7){if(_0x44fdf7){return _0xeeb791[_0xaac4('0x2c')](_0x312cac)[_0xaac4('0x2d')](_0x44fdf7);}};}function respondWithFilteredResult(_0x30b049,_0x51f5f8){return function(_0xe3a4bf){if(_0xe3a4bf){var _0x26bb11=typeof _0x51f5f8[_0xaac4('0x2e')]==='undefined'&&typeof _0x51f5f8[_0xaac4('0x2f')]==='undefined';var _0x2e89d1=_0xe3a4bf['count'];var _0xa44051=_0x26bb11?0x0:_0x51f5f8[_0xaac4('0x2e')];var _0x4e7c33=_0x26bb11?_0xe3a4bf[_0xaac4('0x30')]:_0x51f5f8[_0xaac4('0x2e')]+_0x51f5f8['limit'];var _0x5de0f0;if(_0x4e7c33>=_0x2e89d1){_0x4e7c33=_0x2e89d1;_0x5de0f0=0xc8;}else{_0x5de0f0=0xce;}_0x30b049['status'](_0x5de0f0);return _0x30b049[_0xaac4('0x31')](_0xaac4('0x32'),_0xa44051+'-'+_0x4e7c33+'/'+_0x2e89d1)['json'](_0xe3a4bf);}return null;};}function patchUpdates(_0x54e025){return function(_0x9f3d11){try{jsonpatch[_0xaac4('0x33')](_0x9f3d11,_0x54e025,!![]);}catch(_0x2b713b){return BPromise[_0xaac4('0x34')](_0x2b713b);}return _0x9f3d11[_0xaac4('0x35')]();};}function saveUpdates(_0x4a1d74,_0x355e57){return function(_0x14fcef){if(_0x14fcef){return _0x14fcef[_0xaac4('0x36')](_0x4a1d74)[_0xaac4('0x37')](function(_0x38a437){return _0x38a437;});}return null;};}function removeEntity(_0x3d56b1,_0xf6ba28){return function(_0x2bed81){if(_0x2bed81){return _0x2bed81['destroy']()['then'](function(){_0x3d56b1[_0xaac4('0x2c')](0xcc)[_0xaac4('0x38')]();});}};}function handleEntityNotFound(_0x59f882,_0x396a2c){return function(_0x2d1202){if(!_0x2d1202){_0x59f882[_0xaac4('0x39')](0x194);}return _0x2d1202;};}function handleError(_0x377033,_0xf30d0b){_0xf30d0b=_0xf30d0b||0x1f4;return function(_0x24623b){logger['error'](_0x24623b['stack']);if(_0x24623b[_0xaac4('0x3a')]){delete _0x24623b[_0xaac4('0x3a')];}_0x377033['status'](_0xf30d0b)[_0xaac4('0x3b')](_0x24623b);};}exports['index']=function(_0x4ffbf2,_0x470003){var _0x2054af={},_0x46af8e={},_0x8c9bcf={'count':0x0,'rows':[]};var _0x507cc6=_[_0xaac4('0x3c')](db[_0xaac4('0x3d')]['rawAttributes'],function(_0x210ed8){return{'name':_0x210ed8[_0xaac4('0x3e')],'type':_0x210ed8[_0xaac4('0x3f')][_0xaac4('0x40')]};});_0x46af8e[_0xaac4('0x41')]=_[_0xaac4('0x3c')](_0x507cc6,'name');_0x46af8e[_0xaac4('0x42')]=_['keys'](_0x4ffbf2['query']);_0x46af8e[_0xaac4('0x43')]=_[_0xaac4('0x44')](_0x46af8e['model'],_0x46af8e[_0xaac4('0x42')]);_0x2054af[_0xaac4('0x45')]=_[_0xaac4('0x44')](_0x46af8e[_0xaac4('0x41')],qs[_0xaac4('0x46')](_0x4ffbf2['query'][_0xaac4('0x46')]));_0x2054af[_0xaac4('0x45')]=_0x2054af[_0xaac4('0x45')]['length']?_0x2054af['attributes']:_0x46af8e[_0xaac4('0x41')];if(!_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x47')](_0xaac4('0x48'))){_0x2054af[_0xaac4('0x2f')]=qs[_0xaac4('0x2f')](_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x2f')]);_0x2054af['offset']=qs[_0xaac4('0x2e')](_0x4ffbf2[_0xaac4('0x42')]['offset']);}_0x2054af[_0xaac4('0x49')]=qs['sort'](_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4a')]);_0x2054af[_0xaac4('0x4b')]=qs[_0xaac4('0x43')](_[_0xaac4('0x4c')](_0x4ffbf2[_0xaac4('0x42')],_0x46af8e[_0xaac4('0x43')]),_0x507cc6);if(_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4d')]){_0x2054af['where']=_[_0xaac4('0x4e')](_0x2054af['where'],{'$or':_[_0xaac4('0x3c')](_0x507cc6,function(_0x3d13f7){if(_0x3d13f7[_0xaac4('0x3f')]!==_0xaac4('0x4f')){var _0x158008={};_0x158008[_0x3d13f7[_0xaac4('0x3a')]]={'$like':'%'+_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x4d')]+'%'};return _0x158008;}})});}_0x2054af=_['merge']({},_0x2054af,_0x4ffbf2['options']);var _0x57b038={'where':_0x2054af[_0xaac4('0x4b')]};return db[_0xaac4('0x3d')][_0xaac4('0x30')](_0x57b038)[_0xaac4('0x37')](function(_0x59165e){_0x8c9bcf['count']=_0x59165e;if(_0x4ffbf2[_0xaac4('0x42')][_0xaac4('0x50')]){_0x2054af[_0xaac4('0x51')]=[{'all':!![]}];}return db[_0xaac4('0x3d')][_0xaac4('0x52')](_0x2054af);})['then'](function(_0xd7d54d){_0x8c9bcf[_0xaac4('0x53')]=_0xd7d54d;return _0x8c9bcf;})[_0xaac4('0x37')](respondWithFilteredResult(_0x470003,_0x2054af))[_0xaac4('0x2b')](handleError(_0x470003,null));};exports['show']=function(_0x4b8fbd,_0x1cf412){var _0x2fbc0a={'raw':!![],'where':{'id':_0x4b8fbd[_0xaac4('0x54')]['id']}},_0x1a3258={};_0x1a3258[_0xaac4('0x41')]=_[_0xaac4('0x55')](db[_0xaac4('0x3d')][_0xaac4('0x56')]);_0x1a3258['query']=_[_0xaac4('0x55')](_0x4b8fbd[_0xaac4('0x42')]);_0x1a3258['filters']=_[_0xaac4('0x44')](_0x1a3258[_0xaac4('0x41')],_0x1a3258[_0xaac4('0x42')]);_0x2fbc0a[_0xaac4('0x45')]=_[_0xaac4('0x44')](_0x1a3258[_0xaac4('0x41')],qs['fields'](_0x4b8fbd[_0xaac4('0x42')][_0xaac4('0x46')]));_0x2fbc0a[_0xaac4('0x45')]=_0x2fbc0a['attributes']['length']?_0x2fbc0a[_0xaac4('0x45')]:_0x1a3258[_0xaac4('0x41')];if(_0x4b8fbd['query']['includeAll']){_0x2fbc0a[_0xaac4('0x51')]=[{'all':!![]}];}_0x2fbc0a=_[_0xaac4('0x4e')]({},_0x2fbc0a,_0x4b8fbd[_0xaac4('0x57')]);return db[_0xaac4('0x3d')]['find'](_0x2fbc0a)['then'](handleEntityNotFound(_0x1cf412,null))[_0xaac4('0x37')](respondWithResult(_0x1cf412,null))[_0xaac4('0x2b')](handleError(_0x1cf412,null));};exports[_0xaac4('0x58')]=function(_0x13c569,_0x743658){return db[_0xaac4('0x3d')]['create'](_0x13c569[_0xaac4('0x59')],{})[_0xaac4('0x37')](respondWithResult(_0x743658,0xc9))[_0xaac4('0x2b')](handleError(_0x743658,null));};exports[_0xaac4('0x36')]=function(_0x2e1c04,_0x4551fe){if(_0x2e1c04[_0xaac4('0x59')]['id']){delete _0x2e1c04['body']['id'];}return db['ChatMessage'][_0xaac4('0x5a')]({'where':{'id':_0x2e1c04[_0xaac4('0x54')]['id']}})[_0xaac4('0x37')](handleEntityNotFound(_0x4551fe,null))[_0xaac4('0x37')](saveUpdates(_0x2e1c04[_0xaac4('0x59')],null))[_0xaac4('0x37')](respondWithResult(_0x4551fe,null))[_0xaac4('0x2b')](handleError(_0x4551fe,null));};exports['destroy']=function(_0x2fddf7,_0x53e6b2){return db[_0xaac4('0x3d')]['find']({'where':{'id':_0x2fddf7[_0xaac4('0x54')]['id']}})[_0xaac4('0x37')](handleEntityNotFound(_0x53e6b2,null))[_0xaac4('0x37')](removeEntity(_0x53e6b2,null))[_0xaac4('0x2b')](handleError(_0x53e6b2,null));};exports['describe']=function(_0x449414,_0x2ef47f){return db['ChatMessage']['describe']()[_0xaac4('0x37')](respondWithResult(_0x2ef47f,null))[_0xaac4('0x2b')](handleError(_0x2ef47f,null));};var interaction_log=require(_0xaac4('0x15'))(_0xaac4('0x5b'));exports[_0xaac4('0x5c')]=function(_0x54f83f,_0x5c7bee,_0x1eb655){var _0x5cfcbc={'agent':{},'channel':_0xaac4('0x5d')};if(_0x54f83f[_0xaac4('0x59')]['id']){delete _0x54f83f[_0xaac4('0x59')]['id'];}_0x54f83f[_0xaac4('0x59')][_0xaac4('0x5e')]=!![];_0x54f83f['body'][_0xaac4('0x5f')]=moment()[_0xaac4('0x60')](_0xaac4('0x61'));_0x54f83f[_0xaac4('0x59')]['UserId']=_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')]||_0x54f83f[_0xaac4('0x63')]['id'];_0x5cfcbc[_0xaac4('0x64')]['id']=_0x54f83f['body'][_0xaac4('0x62')];return db[_0xaac4('0x3d')][_0xaac4('0x5a')]({'where':{'id':_0x54f83f[_0xaac4('0x54')]['id'],'UserId':null}})[_0xaac4('0x37')](handleEntityNotFound(_0x5c7bee,null))[_0xaac4('0x37')](saveUpdates(_0x54f83f[_0xaac4('0x59')],null))[_0xaac4('0x37')](function(_0x558332){if(_0x558332){_0x5cfcbc[_0xaac4('0x29')]=_0x558332[_0xaac4('0x65')]({'plain':!![]});return db[_0xaac4('0x66')]['find']({'where':{'id':_0x558332[_0xaac4('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x5c7bee,null))['then'](function(_0x9c4214){if(_0x9c4214){return _0x9c4214['update']({'UserId':_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')],'read1stAt':_[_0xaac4('0x68')](_0x9c4214[_0xaac4('0x69')])?moment()[_0xaac4('0x60')](_0xaac4('0x61')):undefined});}return null;})[_0xaac4('0x37')](function(_0x2bc772){if(_0x2bc772){_0x5cfcbc[_0xaac4('0x6a')]=_0x2bc772[_0xaac4('0x65')]({'plain':!![]});interaction_log[_0xaac4('0x22')](_0xaac4('0x6b'),_0x54f83f[_0xaac4('0x63')]['id'],_0x54f83f[_0xaac4('0x63')][_0xaac4('0x3a')],_0x54f83f[_0xaac4('0x63')]['role'],_0x5cfcbc['interaction']['id'],_0x54f83f['body']?JSON[_0xaac4('0x26')](_0x54f83f[_0xaac4('0x59')]):_0xaac4('0x6c'));return respondWithRpcPromise('AcceptMessage',_0xaac4('0x6d'),_0x5cfcbc);}return null;})['then'](function(_0x5f38fd){var _0x10fb08='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5f38fd['message'][_0xaac4('0x6e')];return db[_0xaac4('0x6f')]['query'](_0x10fb08,{'type':db[_0xaac4('0x70')]['QueryTypes'][_0xaac4('0x71')],'raw':!![]})[_0xaac4('0x37')](function(_0x3df02f){return _0x3df02f;});})[_0xaac4('0x37')](function(_0x5aa938){if(_0x5aa938){_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x72')]=_0x5aa938[0x0];if(!_0x54f83f[_0xaac4('0x59')][_0xaac4('0x62')])return;return db['User'][_0xaac4('0x5a')]({'where':{'id':_0x54f83f[_0xaac4('0x59')]['UserId'],'role':_0xaac4('0x64')},'attributes':['id',_0xaac4('0x3a'),_0xaac4('0x73'),'email',_0xaac4('0x74')],'raw':!![]});}return null;})[_0xaac4('0x37')](function(_0x59e62e){if(!_0x59e62e)return null;_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x64')]=_0x59e62e;return _0x5cfcbc;})['then'](function(_0x26c16c){if(_0x26c16c){if(_0x54f83f['body'][_0xaac4('0x75')]){_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x76')]=util[_0xaac4('0x60')](_0xaac4('0x77'),_0x54f83f[_0xaac4('0x63')]['name']);_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x78')]=_0x5cfcbc['channel'];_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x79')]=_0x5cfcbc['channel'];_0x5cfcbc[_0xaac4('0x29')][_0xaac4('0x7a')]=_0xaac4('0x5c');return respondWithRpcPromise(_0xaac4('0x7b'),_0xaac4('0x7b'),{'event':_0xaac4('0x7c'),'message':_[_0xaac4('0x4e')](_0x5cfcbc[_0xaac4('0x29')],JSON['parse'](_0x5cfcbc['interaction'][_0xaac4('0x7d')]))},client9002)[_0xaac4('0x37')](function(){return _0x5cfcbc;});}return _0x5cfcbc;}return null;})[_0xaac4('0x37')](respondWithResult(_0x5c7bee,null))[_0xaac4('0x2b')](handleError(_0x5c7bee,null));};var interaction_log=require(_0xaac4('0x15'))(_0xaac4('0x5b'));exports[_0xaac4('0x34')]=function(_0xe24fb4,_0xa5b973,_0x4ac340){var _0x3ed0cd={'agent':{},'channel':_0xaac4('0x5d')};if(_0xe24fb4[_0xaac4('0x59')]['id']){delete _0xe24fb4[_0xaac4('0x59')]['id'];}_0xe24fb4['body'][_0xaac4('0x62')]=_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')]||_0xe24fb4['user']['id'];_0x3ed0cd['agent']['id']=_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')];return db[_0xaac4('0x3d')][_0xaac4('0x5a')]({'where':{'id':_0xe24fb4['params']['id'],'UserId':null}})[_0xaac4('0x37')](handleEntityNotFound(_0xa5b973,null))[_0xaac4('0x37')](function(_0x9364ae){if(_0x9364ae){_0x3ed0cd[_0xaac4('0x29')]=_0x9364ae[_0xaac4('0x65')]({'plain':!![]});return db[_0xaac4('0x66')][_0xaac4('0x5a')]({'where':{'id':_0x9364ae[_0xaac4('0x67')]}});}return null;})[_0xaac4('0x37')](handleEntityNotFound(_0xa5b973,null))[_0xaac4('0x37')](function(_0x386382){if(_0x386382){_0x3ed0cd[_0xaac4('0x6a')]=_0x386382['get']({'plain':!![]});interaction_log[_0xaac4('0x22')](_0xaac4('0x7e'),_0xe24fb4[_0xaac4('0x63')]['id'],_0xe24fb4[_0xaac4('0x63')]['name'],_0xe24fb4[_0xaac4('0x63')][_0xaac4('0x7f')],_0x3ed0cd[_0xaac4('0x6a')]['id'],_0xe24fb4['body']?JSON[_0xaac4('0x26')](_0xe24fb4['body']):_0xaac4('0x6c'));return respondWithRpcPromise(_0xaac4('0x80'),_0xaac4('0x81'),_0x3ed0cd);}return null;})[_0xaac4('0x37')](function(_0x22a9ce){var _0x3c11a3=_0xaac4('0x82')+_0x22a9ce[_0xaac4('0x29')][_0xaac4('0x6e')];return db[_0xaac4('0x6f')][_0xaac4('0x42')](_0x3c11a3,{'type':db[_0xaac4('0x70')][_0xaac4('0x83')]['SELECT'],'raw':!![]})[_0xaac4('0x37')](function(_0x514334){return _0x514334;});})[_0xaac4('0x37')](function(_0x38262f){if(_0x38262f){_0x3ed0cd[_0xaac4('0x29')][_0xaac4('0x72')]=_0x38262f[0x0];if(!_0xe24fb4['body']['UserId'])return;return db[_0xaac4('0x84')][_0xaac4('0x5a')]({'where':{'id':_0xe24fb4[_0xaac4('0x59')][_0xaac4('0x62')],'role':_0xaac4('0x64')},'attributes':['id',_0xaac4('0x3a'),_0xaac4('0x73'),_0xaac4('0x85'),_0xaac4('0x74')],'raw':!![]});}return null;})['then'](function(_0x3dd417){if(!_0x3dd417)return null;_0x3ed0cd[_0xaac4('0x29')][_0xaac4('0x64')]=_0x3dd417;return _0x3ed0cd;})[_0xaac4('0x37')](function(_0x23f24b){if(_0x23f24b){_0x23f24b[_0xaac4('0x29')][_0xaac4('0x76')]=util['format']('SIP/%s',_0xe24fb4['user'][_0xaac4('0x3a')]);_0x23f24b[_0xaac4('0x29')][_0xaac4('0x78')]=_0x3ed0cd[_0xaac4('0x78')];_0x23f24b['message'][_0xaac4('0x79')]=_0x3ed0cd[_0xaac4('0x78')];_0x23f24b[_0xaac4('0x29')][_0xaac4('0x7a')]=_0xaac4('0x34');respondWithRpcPromise(_0xaac4('0x7b'),_0xaac4('0x7b'),{'event':'rejectmessage','message':_[_0xaac4('0x4e')](_0x3ed0cd[_0xaac4('0x29')],JSON[_0xaac4('0x86')](_0x3ed0cd[_0xaac4('0x6a')][_0xaac4('0x7d')]))},client9002);return _0x3ed0cd;}return null;})['then'](respondWithResult(_0xa5b973,null))[_0xaac4('0x2b')](handleError(_0xa5b973,null));};
\ No newline at end of file
+var _0xdabf=['ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','undefined','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','filter','merge','where','options','include','findAll','rows','catch','show','includeAll','create','body','params','find','describe','chat-interactions','chat','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteractionId','isNil','read1stAt','format','interaction','get','role','stringify','null','AcceptMessage','acceptMessage','sequelize','SELECT','contact','User','fullname','internal','manual','motionChannel','channel','EventManager','acceptmessage','formData','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','email','interface','SIP/%s','event','reject','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','jayson/promise','client','http','then','info'];(function(_0x20478d,_0x52e97f){var _0x2d6038=function(_0xc2f63e){while(--_0xc2f63e){_0x20478d['push'](_0x20478d['shift']());}};_0x2d6038(++_0x52e97f);}(_0xdabf,0x171));var _0xfdab=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdabf[_0x13d07a];return _0x5ee0ee;};'use strict';var emlformat=require(_0xfdab('0x0'));var rimraf=require(_0xfdab('0x1'));var zipdir=require(_0xfdab('0x2'));var jsonpatch=require(_0xfdab('0x3'));var rp=require(_0xfdab('0x4'));var moment=require('moment');var BPromise=require(_0xfdab('0x5'));var Mustache=require(_0xfdab('0x6'));var util=require(_0xfdab('0x7'));var path=require(_0xfdab('0x8'));var sox=require(_0xfdab('0x9'));var csv=require(_0xfdab('0xa'));var ejs=require(_0xfdab('0xb'));var fs=require('fs');var fs_extra=require(_0xfdab('0xc'));var _=require(_0xfdab('0xd'));var squel=require('squel');var crypto=require(_0xfdab('0xe'));var jsforce=require(_0xfdab('0xf'));var deskjs=require(_0xfdab('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfdab('0x11'));var Redis=require(_0xfdab('0x12'));var authService=require(_0xfdab('0x13'));var qs=require(_0xfdab('0x14'));var as=require(_0xfdab('0x15'));var hardwareService=require(_0xfdab('0x16'));var logger=require(_0xfdab('0x17'))(_0xfdab('0x18'));var utils=require(_0xfdab('0x19'));var config=require(_0xfdab('0x1a'));var licenseUtil=require(_0xfdab('0x1b'));var db=require(_0xfdab('0x1c'))['db'];config[_0xfdab('0x1d')]=_[_0xfdab('0x1e')](config[_0xfdab('0x1d')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfdab('0x1d')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0xfdab('0x1f'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xfdab('0x20')][_0xfdab('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2d303f,_0x10df02,_0x426dba,_0x43af34){return new BPromise(function(_0x51b5f0,_0x3f79ed){var _0x1492c4=_0x43af34||client;return _0x1492c4['request'](_0x2d303f,_0x426dba)[_0xfdab('0x22')](function(_0x21e3d5){logger[_0xfdab('0x23')](_0xfdab('0x24'),_0x10df02,_0xfdab('0x25'));logger[_0xfdab('0x26')](_0xfdab('0x27'),_0x10df02,_0xfdab('0x25'),JSON['stringify'](_0x21e3d5));if(_0x21e3d5[_0xfdab('0x28')]){if(_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x29')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x10df02,_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x2a')]);return _0x3f79ed(_0x21e3d5['error'][_0xfdab('0x2a')]);}logger[_0xfdab('0x28')](_0xfdab('0x24'),_0x10df02,_0x21e3d5['error']['message']);return _0x51b5f0(_0x21e3d5[_0xfdab('0x28')][_0xfdab('0x2a')]);}else{logger[_0xfdab('0x23')](_0xfdab('0x24'),_0x10df02,_0xfdab('0x25'));_0x51b5f0(_0x21e3d5[_0xfdab('0x2b')][_0xfdab('0x2a')]);}})['catch'](function(_0x422e8c){logger['error']('ChatMessage,\x20%s,\x20%s',_0x10df02,_0x422e8c);_0x3f79ed(_0x422e8c);});});}function respondWithStatusCode(_0x597136,_0xc54d6f){_0xc54d6f=_0xc54d6f||0xcc;return function(_0x3882f6){if(_0x3882f6){return _0x597136['sendStatus'](_0xc54d6f);}return _0x597136[_0xfdab('0x2c')](_0xc54d6f)[_0xfdab('0x2d')]();};}function respondWithResult(_0x1105d9,_0x2430de){_0x2430de=_0x2430de||0xc8;return function(_0x479c88){if(_0x479c88){return _0x1105d9[_0xfdab('0x2c')](_0x2430de)[_0xfdab('0x2e')](_0x479c88);}};}function respondWithFilteredResult(_0x4c97f8,_0x9b60ae){return function(_0x54ef7a){if(_0x54ef7a){var _0x14a9e1=typeof _0x9b60ae['offset']===_0xfdab('0x2f')&&typeof _0x9b60ae['limit']===_0xfdab('0x2f');var _0x4dd9bc=_0x54ef7a[_0xfdab('0x30')];var _0x547a32=_0x14a9e1?0x0:_0x9b60ae[_0xfdab('0x31')];var _0x403650=_0x14a9e1?_0x54ef7a['count']:_0x9b60ae[_0xfdab('0x31')]+_0x9b60ae['limit'];var _0x27d76d;if(_0x403650>=_0x4dd9bc){_0x403650=_0x4dd9bc;_0x27d76d=0xc8;}else{_0x27d76d=0xce;}_0x4c97f8[_0xfdab('0x2c')](_0x27d76d);return _0x4c97f8[_0xfdab('0x32')](_0xfdab('0x33'),_0x547a32+'-'+_0x403650+'/'+_0x4dd9bc)['json'](_0x54ef7a);}return null;};}function patchUpdates(_0x4edfb0){return function(_0x3da194){try{jsonpatch[_0xfdab('0x34')](_0x3da194,_0x4edfb0,!![]);}catch(_0x3cab46){return BPromise['reject'](_0x3cab46);}return _0x3da194[_0xfdab('0x35')]();};}function saveUpdates(_0x1397c,_0x5b0860){return function(_0x153ecd){if(_0x153ecd){return _0x153ecd[_0xfdab('0x36')](_0x1397c)[_0xfdab('0x22')](function(_0x33dcb5){return _0x33dcb5;});}return null;};}function removeEntity(_0x944d18,_0x51c6a9){return function(_0x1bc22b){if(_0x1bc22b){return _0x1bc22b[_0xfdab('0x37')]()[_0xfdab('0x22')](function(){_0x944d18[_0xfdab('0x2c')](0xcc)[_0xfdab('0x2d')]();});}};}function handleEntityNotFound(_0x15c45e,_0x224d31){return function(_0x6c4f90){if(!_0x6c4f90){_0x15c45e['sendStatus'](0x194);}return _0x6c4f90;};}function handleError(_0x1ef02b,_0x504c1f){_0x504c1f=_0x504c1f||0x1f4;return function(_0x514869){logger['error'](_0x514869[_0xfdab('0x38')]);if(_0x514869[_0xfdab('0x39')]){delete _0x514869['name'];}_0x1ef02b['status'](_0x504c1f)[_0xfdab('0x3a')](_0x514869);};}exports[_0xfdab('0x3b')]=function(_0x473de4,_0x3ba5e2){var _0x363f92={},_0x3ce230={},_0x234854={'count':0x0,'rows':[]};var _0x42c384=_[_0xfdab('0x3c')](db[_0xfdab('0x3d')][_0xfdab('0x3e')],function(_0x2073f7){return{'name':_0x2073f7[_0xfdab('0x3f')],'type':_0x2073f7[_0xfdab('0x40')][_0xfdab('0x41')]};});_0x3ce230['model']=_[_0xfdab('0x3c')](_0x42c384,_0xfdab('0x39'));_0x3ce230[_0xfdab('0x42')]=_[_0xfdab('0x43')](_0x473de4[_0xfdab('0x42')]);_0x3ce230[_0xfdab('0x44')]=_[_0xfdab('0x45')](_0x3ce230[_0xfdab('0x46')],_0x3ce230['query']);_0x363f92[_0xfdab('0x47')]=_[_0xfdab('0x45')](_0x3ce230[_0xfdab('0x46')],qs[_0xfdab('0x48')](_0x473de4[_0xfdab('0x42')][_0xfdab('0x48')]));_0x363f92['attributes']=_0x363f92[_0xfdab('0x47')]['length']?_0x363f92[_0xfdab('0x47')]:_0x3ce230[_0xfdab('0x46')];if(!_0x473de4[_0xfdab('0x42')][_0xfdab('0x49')]('nolimit')){_0x363f92['limit']=qs['limit'](_0x473de4[_0xfdab('0x42')]['limit']);_0x363f92[_0xfdab('0x31')]=qs[_0xfdab('0x31')](_0x473de4['query']['offset']);}_0x363f92[_0xfdab('0x4a')]=qs[_0xfdab('0x4b')](_0x473de4[_0xfdab('0x42')][_0xfdab('0x4b')]);_0x363f92['where']=qs[_0xfdab('0x44')](_['pick'](_0x473de4['query'],_0x3ce230['filters']),_0x42c384);if(_0x473de4[_0xfdab('0x42')][_0xfdab('0x4c')]){_0x363f92['where']=_[_0xfdab('0x4d')](_0x363f92[_0xfdab('0x4e')],{'$or':_[_0xfdab('0x3c')](_0x42c384,function(_0x4eb59b){if(_0x4eb59b[_0xfdab('0x40')]!=='VIRTUAL'){var _0xef901d={};_0xef901d[_0x4eb59b[_0xfdab('0x39')]]={'$like':'%'+_0x473de4[_0xfdab('0x42')][_0xfdab('0x4c')]+'%'};return _0xef901d;}})});}_0x363f92=_['merge']({},_0x363f92,_0x473de4[_0xfdab('0x4f')]);var _0x43250b={'where':_0x363f92[_0xfdab('0x4e')]};return db[_0xfdab('0x3d')]['count'](_0x43250b)['then'](function(_0x3ab961){_0x234854[_0xfdab('0x30')]=_0x3ab961;if(_0x473de4['query']['includeAll']){_0x363f92[_0xfdab('0x50')]=[{'all':!![]}];}return db[_0xfdab('0x3d')][_0xfdab('0x51')](_0x363f92);})[_0xfdab('0x22')](function(_0x118a03){_0x234854[_0xfdab('0x52')]=_0x118a03;return _0x234854;})[_0xfdab('0x22')](respondWithFilteredResult(_0x3ba5e2,_0x363f92))[_0xfdab('0x53')](handleError(_0x3ba5e2,null));};exports[_0xfdab('0x54')]=function(_0x4051b3,_0x1e85ab){var _0x386f97={'raw':!![],'where':{'id':_0x4051b3['params']['id']}},_0x2e755d={};_0x2e755d['model']=_[_0xfdab('0x43')](db[_0xfdab('0x3d')][_0xfdab('0x3e')]);_0x2e755d['query']=_['keys'](_0x4051b3[_0xfdab('0x42')]);_0x2e755d['filters']=_['intersection'](_0x2e755d[_0xfdab('0x46')],_0x2e755d[_0xfdab('0x42')]);_0x386f97['attributes']=_['intersection'](_0x2e755d['model'],qs['fields'](_0x4051b3[_0xfdab('0x42')]['fields']));_0x386f97[_0xfdab('0x47')]=_0x386f97['attributes']['length']?_0x386f97[_0xfdab('0x47')]:_0x2e755d['model'];if(_0x4051b3[_0xfdab('0x42')][_0xfdab('0x55')]){_0x386f97[_0xfdab('0x50')]=[{'all':!![]}];}_0x386f97=_['merge']({},_0x386f97,_0x4051b3[_0xfdab('0x4f')]);return db['ChatMessage']['find'](_0x386f97)[_0xfdab('0x22')](handleEntityNotFound(_0x1e85ab,null))['then'](respondWithResult(_0x1e85ab,null))[_0xfdab('0x53')](handleError(_0x1e85ab,null));};exports[_0xfdab('0x56')]=function(_0x12a7e1,_0x50ca41){return db[_0xfdab('0x3d')]['create'](_0x12a7e1[_0xfdab('0x57')],{})[_0xfdab('0x22')](respondWithResult(_0x50ca41,0xc9))[_0xfdab('0x53')](handleError(_0x50ca41,null));};exports[_0xfdab('0x36')]=function(_0x39fb1b,_0x54ae88){if(_0x39fb1b[_0xfdab('0x57')]['id']){delete _0x39fb1b[_0xfdab('0x57')]['id'];}return db[_0xfdab('0x3d')]['find']({'where':{'id':_0x39fb1b[_0xfdab('0x58')]['id']}})[_0xfdab('0x22')](handleEntityNotFound(_0x54ae88,null))[_0xfdab('0x22')](saveUpdates(_0x39fb1b[_0xfdab('0x57')],null))[_0xfdab('0x22')](respondWithResult(_0x54ae88,null))[_0xfdab('0x53')](handleError(_0x54ae88,null));};exports[_0xfdab('0x37')]=function(_0xb51293,_0x2c1915){return db['ChatMessage'][_0xfdab('0x59')]({'where':{'id':_0xb51293[_0xfdab('0x58')]['id']}})[_0xfdab('0x22')](handleEntityNotFound(_0x2c1915,null))[_0xfdab('0x22')](removeEntity(_0x2c1915,null))[_0xfdab('0x53')](handleError(_0x2c1915,null));};exports[_0xfdab('0x5a')]=function(_0x4a4b05,_0x485138){return db['ChatMessage'][_0xfdab('0x5a')]()['then'](respondWithResult(_0x485138,null))['catch'](handleError(_0x485138,null));};var interaction_log=require(_0xfdab('0x17'))(_0xfdab('0x5b'));exports['accept']=function(_0x340b4b,_0x2b22d9,_0x589726){var _0x1652ce={'agent':{},'channel':_0xfdab('0x5c')};if(_0x340b4b[_0xfdab('0x57')]['id']){delete _0x340b4b[_0xfdab('0x57')]['id'];}_0x340b4b[_0xfdab('0x57')][_0xfdab('0x5d')]=!![];_0x340b4b[_0xfdab('0x57')][_0xfdab('0x5e')]=moment()['format'](_0xfdab('0x5f'));_0x340b4b['body'][_0xfdab('0x60')]=_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')]||_0x340b4b[_0xfdab('0x61')]['id'];_0x1652ce[_0xfdab('0x62')]['id']=_0x340b4b['body'][_0xfdab('0x60')];return db['ChatMessage'][_0xfdab('0x59')]({'where':{'id':_0x340b4b[_0xfdab('0x58')]['id'],'UserId':null}})[_0xfdab('0x22')](handleEntityNotFound(_0x2b22d9,null))[_0xfdab('0x22')](saveUpdates(_0x340b4b[_0xfdab('0x57')],null))[_0xfdab('0x22')](function(_0x5dca95){if(_0x5dca95){_0x1652ce[_0xfdab('0x2a')]=_0x5dca95['get']({'plain':!![]});return db['ChatInteraction'][_0xfdab('0x59')]({'where':{'id':_0x5dca95[_0xfdab('0x63')]}});}return null;})[_0xfdab('0x22')](handleEntityNotFound(_0x2b22d9,null))['then'](function(_0x5d8036){if(_0x5d8036){return _0x5d8036[_0xfdab('0x36')]({'UserId':_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')],'read1stAt':_[_0xfdab('0x64')](_0x5d8036[_0xfdab('0x65')])?moment()[_0xfdab('0x66')](_0xfdab('0x5f')):undefined});}return null;})[_0xfdab('0x22')](function(_0x3c1599){if(_0x3c1599){_0x1652ce[_0xfdab('0x67')]=_0x3c1599[_0xfdab('0x68')]({'plain':!![]});interaction_log[_0xfdab('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x340b4b['user']['id'],_0x340b4b[_0xfdab('0x61')][_0xfdab('0x39')],_0x340b4b['user'][_0xfdab('0x69')],_0x1652ce[_0xfdab('0x67')]['id'],_0x340b4b['body']?JSON[_0xfdab('0x6a')](_0x340b4b[_0xfdab('0x57')]):_0xfdab('0x6b'));return respondWithRpcPromise(_0xfdab('0x6c'),_0xfdab('0x6d'),_0x1652ce);}return null;})[_0xfdab('0x22')](function(_0x109ed1){var _0x15f263='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x109ed1[_0xfdab('0x2a')]['ContactId'];return db[_0xfdab('0x6e')][_0xfdab('0x42')](_0x15f263,{'type':db['Sequelize']['QueryTypes'][_0xfdab('0x6f')],'raw':!![]})['then'](function(_0x270fb1){return _0x270fb1;});})['then'](function(_0x1808d7){if(_0x1808d7){_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x70')]=_0x1808d7[0x0];if(!_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')])return;return db[_0xfdab('0x71')][_0xfdab('0x59')]({'where':{'id':_0x340b4b[_0xfdab('0x57')][_0xfdab('0x60')],'role':'agent'},'attributes':['id','name',_0xfdab('0x72'),'email',_0xfdab('0x73')],'raw':!![]});}return null;})[_0xfdab('0x22')](function(_0x4c47e9){if(!_0x4c47e9)return null;_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x62')]=_0x4c47e9;return _0x1652ce;})[_0xfdab('0x22')](function(_0x3c9d3a){if(_0x3c9d3a){if(_0x340b4b[_0xfdab('0x57')][_0xfdab('0x74')]){_0x1652ce[_0xfdab('0x2a')]['interface']=util['format']('SIP/%s',_0x340b4b['user'][_0xfdab('0x39')]);_0x1652ce[_0xfdab('0x2a')]['channel']=_0x1652ce['channel'];_0x1652ce[_0xfdab('0x2a')][_0xfdab('0x75')]=_0x1652ce[_0xfdab('0x76')];_0x1652ce[_0xfdab('0x2a')]['event']='accept';return respondWithRpcPromise(_0xfdab('0x77'),'EventManager',{'event':_0xfdab('0x78'),'message':_[_0xfdab('0x4d')](_0x1652ce[_0xfdab('0x2a')],JSON['parse'](_0x1652ce[_0xfdab('0x67')][_0xfdab('0x79')]))},client9002)[_0xfdab('0x22')](function(){return _0x1652ce;});}return _0x1652ce;}return null;})[_0xfdab('0x22')](respondWithResult(_0x2b22d9,null))[_0xfdab('0x53')](handleError(_0x2b22d9,null));};var interaction_log=require(_0xfdab('0x17'))(_0xfdab('0x5b'));exports['reject']=function(_0x59d587,_0x1b8c91,_0x4cde07){var _0x3d3955={'agent':{},'channel':'chat'};if(_0x59d587[_0xfdab('0x57')]['id']){delete _0x59d587[_0xfdab('0x57')]['id'];}_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')]=_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')]||_0x59d587[_0xfdab('0x61')]['id'];_0x3d3955[_0xfdab('0x62')]['id']=_0x59d587[_0xfdab('0x57')][_0xfdab('0x60')];return db[_0xfdab('0x3d')][_0xfdab('0x59')]({'where':{'id':_0x59d587[_0xfdab('0x58')]['id'],'UserId':null}})[_0xfdab('0x22')](handleEntityNotFound(_0x1b8c91,null))['then'](function(_0x46b8bb){if(_0x46b8bb){_0x3d3955[_0xfdab('0x2a')]=_0x46b8bb['get']({'plain':!![]});return db[_0xfdab('0x7a')][_0xfdab('0x59')]({'where':{'id':_0x46b8bb[_0xfdab('0x63')]}});}return null;})[_0xfdab('0x22')](handleEntityNotFound(_0x1b8c91,null))[_0xfdab('0x22')](function(_0x6d2fba){if(_0x6d2fba){_0x3d3955[_0xfdab('0x67')]=_0x6d2fba[_0xfdab('0x68')]({'plain':!![]});interaction_log[_0xfdab('0x23')](_0xfdab('0x7b'),_0x59d587['user']['id'],_0x59d587[_0xfdab('0x61')][_0xfdab('0x39')],_0x59d587[_0xfdab('0x61')]['role'],_0x3d3955[_0xfdab('0x67')]['id'],_0x59d587[_0xfdab('0x57')]?JSON[_0xfdab('0x6a')](_0x59d587[_0xfdab('0x57')]):_0xfdab('0x6b'));return respondWithRpcPromise(_0xfdab('0x7c'),_0xfdab('0x7d'),_0x3d3955);}return null;})[_0xfdab('0x22')](function(_0x10b1fd){var _0x52c538=_0xfdab('0x7e')+_0x10b1fd[_0xfdab('0x2a')][_0xfdab('0x7f')];return db[_0xfdab('0x6e')][_0xfdab('0x42')](_0x52c538,{'type':db[_0xfdab('0x80')]['QueryTypes'][_0xfdab('0x6f')],'raw':!![]})['then'](function(_0x55baf7){return _0x55baf7;});})['then'](function(_0x1e5129){if(_0x1e5129){_0x3d3955[_0xfdab('0x2a')][_0xfdab('0x70')]=_0x1e5129[0x0];if(!_0x59d587['body'][_0xfdab('0x60')])return;return db[_0xfdab('0x71')][_0xfdab('0x59')]({'where':{'id':_0x59d587['body'][_0xfdab('0x60')],'role':_0xfdab('0x62')},'attributes':['id','name',_0xfdab('0x72'),_0xfdab('0x81'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4b1a1f){if(!_0x4b1a1f)return null;_0x3d3955[_0xfdab('0x2a')]['agent']=_0x4b1a1f;return _0x3d3955;})[_0xfdab('0x22')](function(_0x71b6dc){if(_0x71b6dc){_0x71b6dc['message'][_0xfdab('0x82')]=util[_0xfdab('0x66')](_0xfdab('0x83'),_0x59d587[_0xfdab('0x61')][_0xfdab('0x39')]);_0x71b6dc['message']['channel']=_0x3d3955[_0xfdab('0x76')];_0x71b6dc[_0xfdab('0x2a')][_0xfdab('0x75')]=_0x3d3955[_0xfdab('0x76')];_0x71b6dc[_0xfdab('0x2a')][_0xfdab('0x84')]=_0xfdab('0x85');respondWithRpcPromise('EventManager',_0xfdab('0x77'),{'event':_0xfdab('0x86'),'message':_['merge'](_0x3d3955[_0xfdab('0x2a')],JSON['parse'](_0x3d3955[_0xfdab('0x67')]['formData']))},client9002);return _0x3d3955;}return null;})[_0xfdab('0x22')](respondWithResult(_0x1b8c91,null))[_0xfdab('0x53')](handleError(_0x1b8c91,null));};
\ No newline at end of file
index 89ce6ed..c8a16bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01b2=['emit','hasOwnProperty','events','../../mysqldb','setMaxListeners','remove'];(function(_0x444d17,_0x25a17c){var _0x16d94b=function(_0x33b969){while(--_0x33b969){_0x444d17['push'](_0x444d17['shift']());}};_0x16d94b(++_0x25a17c);}(_0x01b2,0xd4));var _0x201b=function(_0x1b25c1,_0x2c6ce6){_0x1b25c1=_0x1b25c1-0x0;var _0x1e4447=_0x01b2[_0x1b25c1];return _0x1e4447;};'use strict';var EventEmitter=require(_0x201b('0x0'));var ChatMessage=require(_0x201b('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x201b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x201b('0x3')};function emitEvent(_0x4432ec){return function(_0x2340ab,_0x2b5e51,_0x5d3791){ChatMessageEvents[_0x201b('0x4')](_0x4432ec+':'+_0x2340ab['id'],_0x2340ab);ChatMessageEvents[_0x201b('0x4')](_0x4432ec,_0x2340ab);_0x5d3791(null);};}for(var e in events){if(events[_0x201b('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0x968c=['exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xe0e35f,_0x50fb45){var _0x99dd01=function(_0x138e85){while(--_0x138e85){_0xe0e35f['push'](_0xe0e35f['shift']());}};_0x99dd01(++_0x50fb45);}(_0x968c,0x1d5));var _0xc968=function(_0x100d8a,_0x1959fa){_0x100d8a=_0x100d8a-0x0;var _0x1e0c96=_0x968c[_0x100d8a];return _0x1e0c96;};'use strict';var EventEmitter=require(_0xc968('0x0'));var ChatMessage=require(_0xc968('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc968('0x2')](0x0);var events={'afterCreate':_0xc968('0x3'),'afterUpdate':'update','afterDestroy':_0xc968('0x4')};function emitEvent(_0xc8aa0b){return function(_0x48dae1,_0x5cbee7,_0xc1f5ea){ChatMessageEvents[_0xc968('0x5')](_0xc8aa0b+':'+_0x48dae1['id'],_0x48dae1);ChatMessageEvents[_0xc968('0x5')](_0xc8aa0b,_0x48dae1);_0xc1f5ea(null);};}for(var e in events){if(events[_0xc968('0x6')](e)){var event=events[e];ChatMessage[_0xc968('0x7')](e,emitEvent(event));}}module[_0xc968('0x8')]=ChatMessageEvents;
\ No newline at end of file
index eca6437..472a2cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff8=['body','FULLTEXT','toLowerCase','out','UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','direction','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages'];(function(_0x1806cf,_0x4a1f20){var _0x5944a6=function(_0x5de697){while(--_0x5de697){_0x1806cf['push'](_0x1806cf['shift']());}};_0x5944a6(++_0x4a1f20);}(_0xaff8,0x78));var _0x8aff=function(_0x360d26,_0x700e92){_0x360d26=_0x360d26-0x0;var _0x180eef=_0xaff8[_0x360d26];return _0x180eef;};'use strict';var _=require(_0x8aff('0x0'));var util=require('util');var logger=require(_0x8aff('0x1'))(_0x8aff('0x2'));var moment=require(_0x8aff('0x3'));var BPromise=require('bluebird');var rp=require(_0x8aff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8aff('0x5'));var attributes=require(_0x8aff('0x6'));module[_0x8aff('0x7')]=function(_0x22b296,_0x2577a7){return _0x22b296['define'](_0x8aff('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x8aff('0x9'),'fields':[_0x8aff('0xa')],'type':_0x8aff('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2b0ff9,_0x3992e4,_0x3b8a8c){var _0x1e6747=_0x22b296['models'];var _0x3ecdc9=_0x2b0ff9['get']({'plain':!![]});if(_0x3ecdc9['direction'][_0x8aff('0xc')]()==='in'||_0x3ecdc9['direction'][_0x8aff('0xc')]()===_0x8aff('0xd')&&!_0x3ecdc9['secret']&&!_['isNil'](_0x3ecdc9[_0x8aff('0xe')])){_0x1e6747[_0x8aff('0xf')][_0x8aff('0x10')]({'where':{'id':_0x3ecdc9[_0x8aff('0x11')]}})[_0x8aff('0x12')](function(_0x1480cc){if(_0x1480cc){_0x1480cc[_0x8aff('0x13')]({'lastMsgAt':_0x3ecdc9[_0x8aff('0x14')],'lastMsgDirection':_0x3ecdc9[_0x8aff('0x15')]['toLowerCase']()});}})[_0x8aff('0x16')](function(_0xd5e118){console[_0x8aff('0x17')](_0xd5e118);});}_0x3b8a8c();}},'charset':_0x8aff('0x18'),'collate':_0x8aff('0x19')});};
\ No newline at end of file
+var _0x5ac8=['out','secret','isNil','UserId','ChatInteraction','findOne','then','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','ChatMessage','fti_chat_messages','body','models','direction','toLowerCase'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5ac8,0x14e));var _0x85ac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5ac8[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x85ac('0x0'));var util=require(_0x85ac('0x1'));var logger=require(_0x85ac('0x2'))(_0x85ac('0x3'));var moment=require('moment');var BPromise=require(_0x85ac('0x4'));var rp=require(_0x85ac('0x5'));var fs=require('fs');var path=require(_0x85ac('0x6'));var rimraf=require(_0x85ac('0x7'));var config=require(_0x85ac('0x8'));var attributes=require(_0x85ac('0x9'));module['exports']=function(_0x426f5d,_0x443fc0){return _0x426f5d[_0x85ac('0xa')](_0x85ac('0xb'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x85ac('0xc'),'fields':[_0x85ac('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x174b6f,_0x56b48a,_0x3c7a27){var _0x433628=_0x426f5d[_0x85ac('0xe')];var _0x1de95c=_0x174b6f['get']({'plain':!![]});if(_0x1de95c[_0x85ac('0xf')]['toLowerCase']()==='in'||_0x1de95c['direction'][_0x85ac('0x10')]()===_0x85ac('0x11')&&!_0x1de95c[_0x85ac('0x12')]&&!_[_0x85ac('0x13')](_0x1de95c[_0x85ac('0x14')])){_0x433628[_0x85ac('0x15')][_0x85ac('0x16')]({'where':{'id':_0x1de95c['ChatInteractionId']}})[_0x85ac('0x17')](function(_0x299c0a){if(_0x299c0a){_0x299c0a['update']({'lastMsgAt':_0x1de95c[_0x85ac('0x18')],'lastMsgDirection':_0x1de95c[_0x85ac('0xf')]['toLowerCase']()});}})[_0x85ac('0x19')](function(_0x539d33){console[_0x85ac('0x1a')](_0x539d33);});}_0x3c7a27();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 140140c..0c767a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaa1=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3c4f93,_0x24be5c){var _0x56d097=function(_0x30ad6e){while(--_0x30ad6e){_0x3c4f93['push'](_0x3c4f93['shift']());}};_0x56d097(++_0x24be5c);}(_0xbaa1,0x7d));var _0x1baa=function(_0x4532e3,_0x4919f5){_0x4532e3=_0x4532e3-0x0;var _0x447bc5=_0xbaa1[_0x4532e3];return _0x447bc5;};'use strict';var _=require(_0x1baa('0x0'));var util=require(_0x1baa('0x1'));var moment=require(_0x1baa('0x2'));var BPromise=require(_0x1baa('0x3'));var rs=require(_0x1baa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1baa('0x5'))['db'];var utils=require(_0x1baa('0x6'));var logger=require(_0x1baa('0x7'))(_0x1baa('0x8'));var config=require('../../config/environment');var jayson=require(_0x1baa('0x9'));var client=jayson[_0x1baa('0xa')][_0x1baa('0xb')]({'port':0x232a});config[_0x1baa('0xc')]=_[_0x1baa('0xd')](config['redis'],{'host':_0x1baa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1baa('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3df72f,_0x383d08,_0x11b617){return new BPromise(function(_0xc8bd33,_0x175006){return client[_0x1baa('0xf')](_0x3df72f,_0x11b617)[_0x1baa('0x10')](function(_0x13939b){logger[_0x1baa('0x11')](_0x1baa('0x12'),_0x383d08,_0x1baa('0x13'));logger[_0x1baa('0x14')](_0x1baa('0x15'),_0x383d08,_0x1baa('0x13'),JSON[_0x1baa('0x16')](_0x13939b));if(_0x13939b[_0x1baa('0x17')]){if(_0x13939b['error'][_0x1baa('0x18')]===0x1f4){logger[_0x1baa('0x17')](_0x1baa('0x12'),_0x383d08,_0x13939b[_0x1baa('0x17')][_0x1baa('0x19')]);return _0x175006(_0x13939b[_0x1baa('0x17')][_0x1baa('0x19')]);}logger['error'](_0x1baa('0x12'),_0x383d08,_0x13939b[_0x1baa('0x17')]['message']);return _0xc8bd33(_0x13939b['error'][_0x1baa('0x19')]);}else{logger[_0x1baa('0x11')](_0x1baa('0x12'),_0x383d08,'request\x20sent');_0xc8bd33(_0x13939b['result'][_0x1baa('0x19')]);}})[_0x1baa('0x1a')](function(_0x174b37){logger[_0x1baa('0x17')](_0x1baa('0x12'),_0x383d08,_0x174b37);_0x175006(_0x174b37);});});}exports[_0x1baa('0x1b')]=function(_0x55733c){var _0x2bc23b=this;return new Promise(function(_0x2ead8a,_0xa30e9c){return db[_0x1baa('0x1c')][_0x1baa('0x1d')](_0x55733c[_0x1baa('0x1e')],{'raw':_0x55733c[_0x1baa('0x1f')]?_0x55733c[_0x1baa('0x1f')][_0x1baa('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x181ce7){logger['info']('CreateChatMessage',_0x55733c);logger[_0x1baa('0x14')](_0x1baa('0x1b'),_0x55733c,JSON[_0x1baa('0x16')](_0x181ce7));_0x2ead8a(_0x181ce7);})[_0x1baa('0x1a')](function(_0xf533c9){logger[_0x1baa('0x17')](_0x1baa('0x1b'),_0xf533c9['message'],_0x55733c);_0xa30e9c(_0x2bc23b[_0x1baa('0x17')](0x1f4,_0xf533c9[_0x1baa('0x19')]));});});};
\ No newline at end of file
+var _0x370b=['ChatMessage','create','body','options','stringify','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','error','code','message','CreateChatMessage'];(function(_0x499b28,_0x4dda2a){var _0x210233=function(_0xafd0be){while(--_0xafd0be){_0x499b28['push'](_0x499b28['shift']());}};_0x210233(++_0x4dda2a);}(_0x370b,0x1b3));var _0xb370=function(_0x5ba5c7,_0x1caf61){_0x5ba5c7=_0x5ba5c7-0x0;var _0x574a48=_0x370b[_0x5ba5c7];return _0x574a48;};'use strict';var _=require(_0xb370('0x0'));var util=require('util');var moment=require(_0xb370('0x1'));var BPromise=require('bluebird');var rs=require(_0xb370('0x2'));var fs=require('fs');var Redis=require(_0xb370('0x3'));var db=require(_0xb370('0x4'))['db'];var utils=require(_0xb370('0x5'));var logger=require(_0xb370('0x6'))(_0xb370('0x7'));var config=require(_0xb370('0x8'));var jayson=require(_0xb370('0x9'));var client=jayson[_0xb370('0xa')][_0xb370('0xb')]({'port':0x232a});config['redis']=_[_0xb370('0xc')](config['redis'],{'host':_0xb370('0xd'),'port':0x18eb});var socket=require(_0xb370('0xe'))(new Redis(config['redis']));require(_0xb370('0xf'))[_0xb370('0x10')](socket);function respondWithRpcPromise(_0x4031f8,_0x467b92,_0x586481){return new BPromise(function(_0x3d0e60,_0xb91192){return client[_0xb370('0x11')](_0x4031f8,_0x586481)[_0xb370('0x12')](function(_0x37f5a5){logger[_0xb370('0x13')](_0xb370('0x14'),_0x467b92,'request\x20sent');logger[_0xb370('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x467b92,_0xb370('0x16'),JSON['stringify'](_0x37f5a5));if(_0x37f5a5[_0xb370('0x17')]){if(_0x37f5a5[_0xb370('0x17')][_0xb370('0x18')]===0x1f4){logger['error'](_0xb370('0x14'),_0x467b92,_0x37f5a5[_0xb370('0x17')]['message']);return _0xb91192(_0x37f5a5[_0xb370('0x17')]['message']);}logger[_0xb370('0x17')](_0xb370('0x14'),_0x467b92,_0x37f5a5[_0xb370('0x17')][_0xb370('0x19')]);return _0x3d0e60(_0x37f5a5['error']['message']);}else{logger[_0xb370('0x13')](_0xb370('0x14'),_0x467b92,_0xb370('0x16'));_0x3d0e60(_0x37f5a5['result'][_0xb370('0x19')]);}})['catch'](function(_0x2f25ab){logger[_0xb370('0x17')]('ChatMessage,\x20%s,\x20%s',_0x467b92,_0x2f25ab);_0xb91192(_0x2f25ab);});});}exports[_0xb370('0x1a')]=function(_0x547d4e){var _0x1ff008=this;return new Promise(function(_0x4373f0,_0x12ac84){return db[_0xb370('0x1b')][_0xb370('0x1c')](_0x547d4e[_0xb370('0x1d')],{'raw':_0x547d4e[_0xb370('0x1e')]?_0x547d4e['options']['raw']===undefined?!![]:![]:!![]})[_0xb370('0x12')](function(_0x599113){logger[_0xb370('0x13')](_0xb370('0x1a'),_0x547d4e);logger[_0xb370('0x15')](_0xb370('0x1a'),_0x547d4e,JSON[_0xb370('0x1f')](_0x599113));_0x4373f0(_0x599113);})[_0xb370('0x20')](function(_0x299d75){logger['error']('CreateChatMessage',_0x299d75[_0xb370('0x19')],_0x547d4e);_0x12ac84(_0x1ff008[_0xb370('0x17')](0x1f4,_0x299d75[_0xb370('0x19')]));});});};
\ No newline at end of file
index 84aadda..7a01719 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x294b=['./chatMessage.events','remove','update','emit','removeListener','register'];(function(_0x1d128b,_0x953850){var _0x4bfb1f=function(_0x4f48eb){while(--_0x4f48eb){_0x1d128b['push'](_0x1d128b['shift']());}};_0x4bfb1f(++_0x953850);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var ChatMessageEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){ChatMessageEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('chatMessage:'+_0x39dfbf,_0xaa6a67);ChatMessageEvents['on'](_0x39dfbf,_0x5110aa);}};
\ No newline at end of file
+var _0xea31=['register','chatMessage:','./chatMessage.events','remove','update','emit','removeListener'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xea31,0x6b));var _0x1ea3=function(_0x38381e,_0x35f46f){_0x38381e=_0x38381e-0x0;var _0x2b0b49=_0xea31[_0x38381e];return _0x2b0b49;};'use strict';var ChatMessageEvents=require(_0x1ea3('0x0'));var events=['save',_0x1ea3('0x1'),_0x1ea3('0x2')];function createListener(_0x3b1d99,_0x153625){return function(_0x2dc24e){_0x153625[_0x1ea3('0x3')](_0x3b1d99,_0x2dc24e);};}function removeListener(_0x1142f1,_0x555620){return function(){ChatMessageEvents[_0x1ea3('0x4')](_0x1142f1,_0x555620);};}exports[_0x1ea3('0x5')]=function(_0x6810da){for(var _0x27c695=0x0,_0x13e6fb=events['length'];_0x27c695<_0x13e6fb;_0x27c695++){var _0x1fa3a8=events[_0x27c695];var _0x1b578e=createListener(_0x1ea3('0x6')+_0x1fa3a8,_0x6810da);ChatMessageEvents['on'](_0x1fa3a8,_0x1b578e);}};
\ No newline at end of file
index 60153cd..95b02bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a7d=['update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','chatmessage:create','create','put'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x3a7d,0x120));var _0xd3a7=function(_0x330129,_0x4fca8b){_0x330129=_0x330129-0x0;var _0x7edb92=_0x3a7d[_0x330129];return _0x7edb92;};'use strict';var multer=require(_0xd3a7('0x0'));var util=require('util');var path=require(_0xd3a7('0x1'));var timeout=require(_0xd3a7('0x2'));var express=require(_0xd3a7('0x3'));var router=express[_0xd3a7('0x4')]();var fs_extra=require(_0xd3a7('0x5'));var auth=require(_0xd3a7('0x6'));var interaction=require(_0xd3a7('0x7'));var config=require(_0xd3a7('0x8'));var controller=require('./chatMessage.controller');router['get']('/',auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xa')]);router[_0xd3a7('0xb')](_0xd3a7('0xc'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xd')]);router['get'](_0xd3a7('0xe'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0xf')]);router[_0xd3a7('0x10')]('/',auth[_0xd3a7('0x9')](),interaction['tracked']('chat',_0xd3a7('0x11')),controller[_0xd3a7('0x12')]);router[_0xd3a7('0x13')](_0xd3a7('0xe'),controller[_0xd3a7('0x14')]);router[_0xd3a7('0x13')](_0xd3a7('0x15'),auth[_0xd3a7('0x9')](),controller[_0xd3a7('0x16')]);router[_0xd3a7('0x13')](_0xd3a7('0x17'),auth['isAuthenticated'](),controller[_0xd3a7('0x18')]);router[_0xd3a7('0x19')](_0xd3a7('0xe'),auth['isAuthenticated'](),controller[_0xd3a7('0x1a')]);module[_0xd3a7('0x1b')]=router;
\ No newline at end of file
+var _0xb5fa=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','index','/describe','isAuthenticated','show','post','tracked','chat','chatmessage:create','put','update'];(function(_0x4a0f82,_0xb53ebc){var _0x4676e7=function(_0x11e290){while(--_0x11e290){_0x4a0f82['push'](_0x4a0f82['shift']());}};_0x4676e7(++_0xb53ebc);}(_0xb5fa,0x133));var _0xab5f=function(_0x228044,_0x53bbd4){_0x228044=_0x228044-0x0;var _0x33a054=_0xb5fa[_0x228044];return _0x33a054;};'use strict';var multer=require(_0xab5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xab5f('0x1'));var express=require(_0xab5f('0x2'));var router=express[_0xab5f('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab5f('0x4'));var config=require(_0xab5f('0x5'));var controller=require(_0xab5f('0x6'));router[_0xab5f('0x7')]('/',auth['isAuthenticated'](),controller[_0xab5f('0x8')]);router['get'](_0xab5f('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xab5f('0x7')]('/:id',auth[_0xab5f('0xa')](),controller[_0xab5f('0xb')]);router[_0xab5f('0xc')]('/',auth[_0xab5f('0xa')](),interaction[_0xab5f('0xd')](_0xab5f('0xe'),_0xab5f('0xf')),controller['create']);router[_0xab5f('0x10')]('/:id',controller[_0xab5f('0x11')]);router[_0xab5f('0x10')](_0xab5f('0x12'),auth[_0xab5f('0xa')](),controller[_0xab5f('0x13')]);router[_0xab5f('0x10')](_0xab5f('0x14'),auth[_0xab5f('0xa')](),controller[_0xab5f('0x15')]);router[_0xab5f('0x16')]('/:id',auth[_0xab5f('0xa')](),controller[_0xab5f('0x17')]);module[_0xab5f('0x18')]=router;
\ No newline at end of file
index 1ec1233..6808fdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x85f077,_0x362348){var _0x37f55d=function(_0x2d10f4){while(--_0x2d10f4){_0x85f077['push'](_0x85f077['shift']());}};_0x37f55d(++_0x362348);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56012d,_0x9d9ee5){_0x56012d=_0x56012d-0x0;var _0x133e44=_0x5f2f[_0x56012d];return _0x133e44;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x757a=['exports','TEXT'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x757a,0xde));var _0xa757=function(_0x141d9e,_0x3e5c36){_0x141d9e=_0x141d9e-0x0;var _0x4c23db=_0x757a[_0x141d9e];return _0x4c23db;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'body':{'type':Sequelize[_0xa757('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium'),'allowNull':![]}};
\ No newline at end of file
index 9b34b86..f372a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0xd96a1f,_0x4a21f4){var _0x4d8029=function(_0x5a6b36){while(--_0x5a6b36){_0xd96a1f['push'](_0xd96a1f['shift']());}};_0x4d8029(++_0x4a21f4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x25fc52,_0x47b064){var _0x425627=function(_0x219dc2){while(--_0x219dc2){_0x25fc52['push'](_0x25fc52['shift']());}};_0x425627(++_0x47b064);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index c5b805b..06d5ab3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f54=['events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x28e9ff,_0x4ad761){var _0x530fc6=function(_0x5b9f79){while(--_0x5b9f79){_0x28e9ff['push'](_0x28e9ff['shift']());}};_0x530fc6(++_0x4ad761);}(_0x6f54,0xc6));var _0x46f5=function(_0x3be306,_0x2eb550){_0x3be306=_0x3be306-0x0;var _0x183e3c=_0x6f54[_0x3be306];return _0x183e3c;};'use strict';var EventEmitter=require(_0x46f5('0x0'));var ChatOfflineMessage=require(_0x46f5('0x1'))['db'][_0x46f5('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x46f5('0x3')](0x0);var events={'afterCreate':_0x46f5('0x4'),'afterUpdate':_0x46f5('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a54e8){return function(_0x33567f,_0x496ef4,_0x49a045){ChatOfflineMessageEvents['emit'](_0x1a54e8+':'+_0x33567f['id'],_0x33567f);ChatOfflineMessageEvents[_0x46f5('0x6')](_0x1a54e8,_0x33567f);_0x49a045(null);};}for(var e in events){if(events[_0x46f5('0x7')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x46f5('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x93a6=['update','remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x49d65e,_0x1459dd){var _0x36d964=function(_0x184436){while(--_0x184436){_0x49d65e['push'](_0x49d65e['shift']());}};_0x36d964(++_0x1459dd);}(_0x93a6,0x1ac));var _0x693a=function(_0x234459,_0x8da0cc){_0x234459=_0x234459-0x0;var _0x2a73fb=_0x93a6[_0x234459];return _0x2a73fb;};'use strict';var EventEmitter=require(_0x693a('0x0'));var ChatOfflineMessage=require(_0x693a('0x1'))['db'][_0x693a('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x693a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x693a('0x4'),'afterDestroy':_0x693a('0x5')};function emitEvent(_0x2b7074){return function(_0x47d558,_0x319a09,_0x170f39){ChatOfflineMessageEvents[_0x693a('0x6')](_0x2b7074+':'+_0x47d558['id'],_0x47d558);ChatOfflineMessageEvents[_0x693a('0x6')](_0x2b7074,_0x47d558);_0x170f39(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x693a('0x7')](e,emitEvent(event));}}module[_0x693a('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
index 7dd6edf..16dba74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03f8=['define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x341aeb,_0x46ff72){var _0x20b8ef=function(_0x571b0d){while(--_0x571b0d){_0x341aeb['push'](_0x341aeb['shift']());}};_0x20b8ef(++_0x46ff72);}(_0x03f8,0x19e));var _0x803f=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0x03f8[_0x421263];return _0x34e4b5;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x803f('0x0')]=function(_0x2d7a8a){return _0x2d7a8a[_0x803f('0x1')](_0x803f('0x2'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x803f('0x3'),'collate':_0x803f('0x4')});};
\ No newline at end of file
+var _0x778d=['ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','exports'];(function(_0x7be932,_0x25578e){var _0x1d1386=function(_0x32474f){while(--_0x32474f){_0x7be932['push'](_0x7be932['shift']());}};_0x1d1386(++_0x25578e);}(_0x778d,0x163));var _0xd778=function(_0x5e0531,_0x387e57){_0x5e0531=_0x5e0531-0x0;var _0x4c3154=_0x778d[_0x5e0531];return _0x4c3154;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0xd778('0x0')]=function(_0x418b1d){return _0x418b1d['define'](_0xd778('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd778('0x2'),'collate':_0xd778('0x3')});};
\ No newline at end of file
index bd7e2dd..f8051d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34f2=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x5673c4,_0x5b672d){var _0x32b859=function(_0x4aa620){while(--_0x4aa620){_0x5673c4['push'](_0x5673c4['shift']());}};_0x32b859(++_0x5b672d);}(_0x34f2,0x15a));var _0x234f=function(_0x1950c3,_0x388947){_0x1950c3=_0x1950c3-0x0;var _0x4cfd10=_0x34f2[_0x1950c3];return _0x4cfd10;};'use strict';var _=require(_0x234f('0x0'));var util=require(_0x234f('0x1'));var moment=require('moment');var BPromise=require(_0x234f('0x2'));var rs=require(_0x234f('0x3'));var fs=require('fs');var Redis=require(_0x234f('0x4'));var db=require(_0x234f('0x5'))['db'];var utils=require(_0x234f('0x6'));var logger=require(_0x234f('0x7'))(_0x234f('0x8'));var config=require(_0x234f('0x9'));var jayson=require(_0x234f('0xa'));var client=jayson[_0x234f('0xb')][_0x234f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x254f37,_0x3aaf6c,_0x477918){return new BPromise(function(_0x691793,_0x514588){return client[_0x234f('0xd')](_0x254f37,_0x477918)[_0x234f('0xe')](function(_0x5d9661){logger['info'](_0x234f('0xf'),_0x3aaf6c,_0x234f('0x10'));logger[_0x234f('0x11')](_0x234f('0x12'),_0x3aaf6c,_0x234f('0x10'),JSON['stringify'](_0x5d9661));if(_0x5d9661[_0x234f('0x13')]){if(_0x5d9661[_0x234f('0x13')][_0x234f('0x14')]===0x1f4){logger[_0x234f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3aaf6c,_0x5d9661[_0x234f('0x13')]['message']);return _0x514588(_0x5d9661[_0x234f('0x13')][_0x234f('0x15')]);}logger[_0x234f('0x13')](_0x234f('0xf'),_0x3aaf6c,_0x5d9661[_0x234f('0x13')][_0x234f('0x15')]);return _0x691793(_0x5d9661[_0x234f('0x13')]['message']);}else{logger['info'](_0x234f('0xf'),_0x3aaf6c,_0x234f('0x10'));_0x691793(_0x5d9661['result'][_0x234f('0x15')]);}})[_0x234f('0x16')](function(_0x228dcc){logger[_0x234f('0x13')](_0x234f('0xf'),_0x3aaf6c,_0x228dcc);_0x514588(_0x228dcc);});});}
\ No newline at end of file
+var _0x6a2e=['request\x20sent','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x28aa7d,_0x31e5f5){var _0x2e7096=function(_0x560508){while(--_0x560508){_0x28aa7d['push'](_0x28aa7d['shift']());}};_0x2e7096(++_0x31e5f5);}(_0x6a2e,0x14d));var _0xe6a2=function(_0x1ee244,_0x5143fd){_0x1ee244=_0x1ee244-0x0;var _0x3485e1=_0x6a2e[_0x1ee244];return _0x3485e1;};'use strict';var _=require(_0xe6a2('0x0'));var util=require(_0xe6a2('0x1'));var moment=require(_0xe6a2('0x2'));var BPromise=require(_0xe6a2('0x3'));var rs=require(_0xe6a2('0x4'));var fs=require('fs');var Redis=require(_0xe6a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6a2('0x6'));var logger=require(_0xe6a2('0x7'))('rpc');var config=require(_0xe6a2('0x8'));var jayson=require(_0xe6a2('0x9'));var client=jayson[_0xe6a2('0xa')][_0xe6a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d43bd,_0x345f6c,_0x40980f){return new BPromise(function(_0x221378,_0x51b25b){return client[_0xe6a2('0xc')](_0x5d43bd,_0x40980f)[_0xe6a2('0xd')](function(_0x4fe50f){logger[_0xe6a2('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x345f6c,'request\x20sent');logger[_0xe6a2('0xf')](_0xe6a2('0x10'),_0x345f6c,_0xe6a2('0x11'),JSON[_0xe6a2('0x12')](_0x4fe50f));if(_0x4fe50f[_0xe6a2('0x13')]){if(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x14')]===0x1f4){logger[_0xe6a2('0x13')](_0xe6a2('0x15'),_0x345f6c,_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);return _0x51b25b(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);}logger[_0xe6a2('0x13')](_0xe6a2('0x15'),_0x345f6c,_0x4fe50f['error']['message']);return _0x221378(_0x4fe50f[_0xe6a2('0x13')][_0xe6a2('0x16')]);}else{logger[_0xe6a2('0xe')](_0xe6a2('0x15'),_0x345f6c,_0xe6a2('0x11'));_0x221378(_0x4fe50f[_0xe6a2('0x17')][_0xe6a2('0x16')]);}})[_0xe6a2('0x18')](function(_0x430c3c){logger['error'](_0xe6a2('0x15'),_0x345f6c,_0x430c3c);_0x51b25b(_0x430c3c);});});}
\ No newline at end of file
index 884372f..bfb5de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc709=['put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','create'];(function(_0x131335,_0x1eaf97){var _0x3090bd=function(_0x135bc0){while(--_0x135bc0){_0x131335['push'](_0x131335['shift']());}};_0x3090bd(++_0x1eaf97);}(_0xc709,0xaf));var _0x9c70=function(_0x34a8c8,_0x31e259){_0x34a8c8=_0x34a8c8-0x0;var _0x1fe6e5=_0xc709[_0x34a8c8];return _0x1fe6e5;};'use strict';var multer=require(_0x9c70('0x0'));var util=require(_0x9c70('0x1'));var path=require(_0x9c70('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c70('0x3'));var router=express[_0x9c70('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c70('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c70('0x6'));var controller=require(_0x9c70('0x7'));router['get']('/',auth[_0x9c70('0x8')](),controller['index']);router[_0x9c70('0x9')](_0x9c70('0xa'),auth[_0x9c70('0x8')](),controller[_0x9c70('0xb')]);router[_0x9c70('0x9')](_0x9c70('0xc'),auth[_0x9c70('0x8')](),controller[_0x9c70('0xd')]);router['post']('/',auth[_0x9c70('0x8')](),controller[_0x9c70('0xe')]);router[_0x9c70('0xf')](_0x9c70('0xc'),auth['isAuthenticated'](),controller[_0x9c70('0x10')]);router['delete'](_0x9c70('0xc'),auth[_0x9c70('0x8')](),controller[_0x9c70('0x11')]);module[_0x9c70('0x12')]=router;
\ No newline at end of file
+var _0xe429=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x1f1511,_0x4ea911){var _0x1d9ab8=function(_0x53276a){while(--_0x53276a){_0x1f1511['push'](_0x1f1511['shift']());}};_0x1d9ab8(++_0x4ea911);}(_0xe429,0x94));var _0x9e42=function(_0x1a6701,_0x1cdd3c){_0x1a6701=_0x1a6701-0x0;var _0x34a966=_0xe429[_0x1a6701];return _0x34a966;};'use strict';var multer=require(_0x9e42('0x0'));var util=require(_0x9e42('0x1'));var path=require(_0x9e42('0x2'));var timeout=require(_0x9e42('0x3'));var express=require(_0x9e42('0x4'));var router=express['Router']();var fs_extra=require(_0x9e42('0x5'));var auth=require(_0x9e42('0x6'));var interaction=require(_0x9e42('0x7'));var config=require(_0x9e42('0x8'));var controller=require(_0x9e42('0x9'));router[_0x9e42('0xa')]('/',auth[_0x9e42('0xb')](),controller[_0x9e42('0xc')]);router['get'](_0x9e42('0xd'),auth[_0x9e42('0xb')](),controller[_0x9e42('0xe')]);router[_0x9e42('0xa')](_0x9e42('0xf'),auth[_0x9e42('0xb')](),controller[_0x9e42('0x10')]);router[_0x9e42('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e42('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9e42('0x13')]);router['delete'](_0x9e42('0xf'),auth[_0x9e42('0xb')](),controller[_0x9e42('0x14')]);module[_0x9e42('0x15')]=router;
\ No newline at end of file
index ef17d4f..0c9cfa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc606=['INTEGER','sequelize','exports','STRING','mouseOver','timeout'];(function(_0x1484ed,_0x16e78e){var _0x1bb1d9=function(_0x67c48b){while(--_0x67c48b){_0x1484ed['push'](_0x1484ed['shift']());}};_0x1bb1d9(++_0x16e78e);}(_0xc606,0xa9));var _0x6c60=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0xc606[_0x350182];return _0x4a0892;};'use strict';var Sequelize=require(_0x6c60('0x0'));module[_0x6c60('0x1')]={'name':{'type':Sequelize[_0x6c60('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6c60('0x3'),_0x6c60('0x4')),'defaultValue':_0x6c60('0x3')},'selector':{'type':Sequelize[_0x6c60('0x2')]},'timeout':{'type':Sequelize[_0x6c60('0x5')]}};
\ No newline at end of file
+var _0xd456=['sequelize','exports','STRING','ENUM','timeout','mouseOver'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0xd456,0x19e));var _0x6d45=function(_0x28cf39,_0x1ee9f4){_0x28cf39=_0x28cf39-0x0;var _0x17f8d4=_0xd456[_0x28cf39];return _0x17f8d4;};'use strict';var Sequelize=require(_0x6d45('0x0'));module[_0x6d45('0x1')]={'name':{'type':Sequelize[_0x6d45('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6d45('0x3')]('mouseOver',_0x6d45('0x4')),'defaultValue':_0x6d45('0x5')},'selector':{'type':Sequelize[_0x6d45('0x2')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 1d74bfa..5e89d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de0=['desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','then','end','error','name','params','model','keys','query','filters','intersection','attributes','fields','length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3de0,0x143));var _0x03de=function(_0x645a74,_0x37fcf1){_0x645a74=_0x645a74-0x0;var _0x3a712c=_0x3de0[_0x645a74];return _0x3a712c;};'use strict';var emlformat=require(_0x03de('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x03de('0x1'));var jsonpatch=require(_0x03de('0x2'));var rp=require('request-promise');var moment=require(_0x03de('0x3'));var BPromise=require(_0x03de('0x4'));var Mustache=require('mustache');var util=require(_0x03de('0x5'));var path=require(_0x03de('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x03de('0x7'));var fs=require('fs');var fs_extra=require(_0x03de('0x8'));var _=require(_0x03de('0x9'));var squel=require(_0x03de('0xa'));var crypto=require(_0x03de('0xb'));var jsforce=require(_0x03de('0xc'));var deskjs=require(_0x03de('0xd'));var toCsv=require(_0x03de('0xe'));var querystring=require('querystring');var Papa=require(_0x03de('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x03de('0x10'));var as=require(_0x03de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03de('0x12'))(_0x03de('0x13'));var utils=require('../../config/utils');var config=require(_0x03de('0x14'));var licenseUtil=require(_0x03de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d6629,_0x10ab8b){_0x10ab8b=_0x10ab8b||0xcc;return function(_0x40dd5d){if(_0x40dd5d){return _0x3d6629[_0x03de('0x16')](_0x10ab8b);}return _0x3d6629[_0x03de('0x17')](_0x10ab8b)['end']();};}function respondWithResult(_0xf9553d,_0x1b467e){_0x1b467e=_0x1b467e||0xc8;return function(_0x14d19c){if(_0x14d19c){return _0xf9553d[_0x03de('0x17')](_0x1b467e)['json'](_0x14d19c);}};}function respondWithFilteredResult(_0x453564,_0xedbc6b){return function(_0x1aa88d){if(_0x1aa88d){var _0x45881e=typeof _0xedbc6b[_0x03de('0x18')]===_0x03de('0x19')&&typeof _0xedbc6b[_0x03de('0x1a')]===_0x03de('0x19');var _0x313a71=_0x1aa88d['count'];var _0x4835c0=_0x45881e?0x0:_0xedbc6b[_0x03de('0x18')];var _0x42962e=_0x45881e?_0x1aa88d[_0x03de('0x1b')]:_0xedbc6b['offset']+_0xedbc6b[_0x03de('0x1a')];var _0x5f6058;if(_0x42962e>=_0x313a71){_0x42962e=_0x313a71;_0x5f6058=0xc8;}else{_0x5f6058=0xce;}_0x453564[_0x03de('0x17')](_0x5f6058);return _0x453564[_0x03de('0x1c')](_0x03de('0x1d'),_0x4835c0+'-'+_0x42962e+'/'+_0x313a71)[_0x03de('0x1e')](_0x1aa88d);}return null;};}function patchUpdates(_0x3cb6ff){return function(_0x5cb66b){try{jsonpatch['apply'](_0x5cb66b,_0x3cb6ff,!![]);}catch(_0x528862){return BPromise[_0x03de('0x1f')](_0x528862);}return _0x5cb66b[_0x03de('0x20')]();};}function saveUpdates(_0x512d82,_0x12337f){return function(_0x4447d7){if(_0x4447d7){return _0x4447d7[_0x03de('0x21')](_0x512d82)['then'](function(_0x23e463){return _0x23e463;});}return null;};}function removeEntity(_0x396a57,_0x5f2317){return function(_0x13fb22){if(_0x13fb22){return _0x13fb22[_0x03de('0x22')]()[_0x03de('0x23')](function(){_0x396a57[_0x03de('0x17')](0xcc)[_0x03de('0x24')]();});}};}function handleEntityNotFound(_0x54b4fc,_0xf54687){return function(_0x13ab64){if(!_0x13ab64){_0x54b4fc[_0x03de('0x16')](0x194);}return _0x13ab64;};}function handleError(_0x1ed415,_0x5a9631){_0x5a9631=_0x5a9631||0x1f4;return function(_0x14e785){logger[_0x03de('0x25')](_0x14e785['stack']);if(_0x14e785['name']){delete _0x14e785[_0x03de('0x26')];}_0x1ed415[_0x03de('0x17')](_0x5a9631)['send'](_0x14e785);};}exports['show']=function(_0x261b19,_0x17463b){var _0x514232={'raw':!![],'where':{'id':_0x261b19[_0x03de('0x27')]['id']}},_0x405c25={};_0x405c25[_0x03de('0x28')]=_[_0x03de('0x29')](db['ChatProactiveAction']['rawAttributes']);_0x405c25[_0x03de('0x2a')]=_[_0x03de('0x29')](_0x261b19[_0x03de('0x2a')]);_0x405c25[_0x03de('0x2b')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],_0x405c25['query']);_0x514232[_0x03de('0x2d')]=_[_0x03de('0x2c')](_0x405c25[_0x03de('0x28')],qs[_0x03de('0x2e')](_0x261b19[_0x03de('0x2a')][_0x03de('0x2e')]));_0x514232['attributes']=_0x514232[_0x03de('0x2d')][_0x03de('0x2f')]?_0x514232['attributes']:_0x405c25[_0x03de('0x28')];if(_0x261b19[_0x03de('0x2a')][_0x03de('0x30')]){_0x514232[_0x03de('0x31')]=[{'all':!![]}];}_0x514232=_['merge']({},_0x514232,_0x261b19[_0x03de('0x32')]);return db[_0x03de('0x33')][_0x03de('0x34')](_0x514232)[_0x03de('0x23')](handleEntityNotFound(_0x17463b,null))['then'](respondWithResult(_0x17463b,null))[_0x03de('0x35')](handleError(_0x17463b,null));};exports[_0x03de('0x36')]=function(_0x1e7dc7,_0x4930a6){return db[_0x03de('0x33')][_0x03de('0x36')](_0x1e7dc7[_0x03de('0x37')],{})[_0x03de('0x23')](respondWithResult(_0x4930a6,0xc9))[_0x03de('0x35')](handleError(_0x4930a6,null));};exports[_0x03de('0x21')]=function(_0xdb21c3,_0x5bc7dd){if(_0xdb21c3[_0x03de('0x37')]['id']){delete _0xdb21c3[_0x03de('0x37')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0xdb21c3[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x5bc7dd,null))[_0x03de('0x23')](saveUpdates(_0xdb21c3[_0x03de('0x37')],null))[_0x03de('0x23')](respondWithResult(_0x5bc7dd,null))[_0x03de('0x35')](handleError(_0x5bc7dd,null));};exports[_0x03de('0x22')]=function(_0x152a59,_0x294c92){return db[_0x03de('0x33')][_0x03de('0x34')]({'where':{'id':_0x152a59[_0x03de('0x27')]['id']}})[_0x03de('0x23')](handleEntityNotFound(_0x294c92,null))[_0x03de('0x23')](removeEntity(_0x294c92,null))[_0x03de('0x35')](handleError(_0x294c92,null));};
\ No newline at end of file
+var _0xdd0c=['moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','error','stack','name','send','show','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','include','merge','find','then','create','body','catch','rimraf','zip-dir','fast-json-patch'];(function(_0x1c0227,_0xce514d){var _0x1e777a=function(_0x4979a6){while(--_0x4979a6){_0x1c0227['push'](_0x1c0227['shift']());}};_0x1e777a(++_0xce514d);}(_0xdd0c,0x165));var _0xcdd0=function(_0x203ed1,_0x6fb319){_0x203ed1=_0x203ed1-0x0;var _0x27a73c=_0xdd0c[_0x203ed1];return _0x27a73c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcdd0('0x0'));var zipdir=require(_0xcdd0('0x1'));var jsonpatch=require(_0xcdd0('0x2'));var rp=require('request-promise');var moment=require(_0xcdd0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcdd0('0x4'));var util=require(_0xcdd0('0x5'));var path=require(_0xcdd0('0x6'));var sox=require(_0xcdd0('0x7'));var csv=require(_0xcdd0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcdd0('0x9'));var _=require(_0xcdd0('0xa'));var squel=require(_0xcdd0('0xb'));var crypto=require(_0xcdd0('0xc'));var jsforce=require(_0xcdd0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcdd0('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xcdd0('0xe'));var authService=require(_0xcdd0('0xf'));var qs=require(_0xcdd0('0x10'));var as=require(_0xcdd0('0x11'));var hardwareService=require(_0xcdd0('0x12'));var logger=require(_0xcdd0('0x13'))(_0xcdd0('0x14'));var utils=require(_0xcdd0('0x15'));var config=require(_0xcdd0('0x16'));var licenseUtil=require(_0xcdd0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1ff6,_0x356501){_0x356501=_0x356501||0xcc;return function(_0x14c775){if(_0x14c775){return _0x4a1ff6['sendStatus'](_0x356501);}return _0x4a1ff6[_0xcdd0('0x18')](_0x356501)[_0xcdd0('0x19')]();};}function respondWithResult(_0x4f4aa4,_0x1fc89a){_0x1fc89a=_0x1fc89a||0xc8;return function(_0x1d5bff){if(_0x1d5bff){return _0x4f4aa4[_0xcdd0('0x18')](_0x1fc89a)[_0xcdd0('0x1a')](_0x1d5bff);}};}function respondWithFilteredResult(_0xc1c3d5,_0x52aef5){return function(_0x5b5c06){if(_0x5b5c06){var _0x189f54=typeof _0x52aef5[_0xcdd0('0x1b')]===_0xcdd0('0x1c')&&typeof _0x52aef5[_0xcdd0('0x1d')]===_0xcdd0('0x1c');var _0x3b07a1=_0x5b5c06[_0xcdd0('0x1e')];var _0x2c199f=_0x189f54?0x0:_0x52aef5[_0xcdd0('0x1b')];var _0x14d55b=_0x189f54?_0x5b5c06['count']:_0x52aef5[_0xcdd0('0x1b')]+_0x52aef5[_0xcdd0('0x1d')];var _0x5060fa;if(_0x14d55b>=_0x3b07a1){_0x14d55b=_0x3b07a1;_0x5060fa=0xc8;}else{_0x5060fa=0xce;}_0xc1c3d5['status'](_0x5060fa);return _0xc1c3d5[_0xcdd0('0x1f')](_0xcdd0('0x20'),_0x2c199f+'-'+_0x14d55b+'/'+_0x3b07a1)['json'](_0x5b5c06);}return null;};}function patchUpdates(_0x12128e){return function(_0x4f7325){try{jsonpatch['apply'](_0x4f7325,_0x12128e,!![]);}catch(_0x4d038f){return BPromise[_0xcdd0('0x21')](_0x4d038f);}return _0x4f7325[_0xcdd0('0x22')]();};}function saveUpdates(_0x4afcfa,_0x2ab7e4){return function(_0x31a3e6){if(_0x31a3e6){return _0x31a3e6[_0xcdd0('0x23')](_0x4afcfa)['then'](function(_0x9d4727){return _0x9d4727;});}return null;};}function removeEntity(_0x7be0ac,_0x509e9c){return function(_0x3c81b1){if(_0x3c81b1){return _0x3c81b1[_0xcdd0('0x24')]()['then'](function(){_0x7be0ac[_0xcdd0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3797c2,_0x64b52){return function(_0x476018){if(!_0x476018){_0x3797c2['sendStatus'](0x194);}return _0x476018;};}function handleError(_0x22fd47,_0x10cba2){_0x10cba2=_0x10cba2||0x1f4;return function(_0x5e5cc){logger[_0xcdd0('0x25')](_0x5e5cc[_0xcdd0('0x26')]);if(_0x5e5cc[_0xcdd0('0x27')]){delete _0x5e5cc[_0xcdd0('0x27')];}_0x22fd47[_0xcdd0('0x18')](_0x10cba2)[_0xcdd0('0x28')](_0x5e5cc);};}exports[_0xcdd0('0x29')]=function(_0x4074e0,_0x49cfe0){var _0x28084c={'raw':!![],'where':{'id':_0x4074e0[_0xcdd0('0x2a')]['id']}},_0xd6d64f={};_0xd6d64f['model']=_[_0xcdd0('0x2b')](db[_0xcdd0('0x2c')][_0xcdd0('0x2d')]);_0xd6d64f[_0xcdd0('0x2e')]=_[_0xcdd0('0x2b')](_0x4074e0['query']);_0xd6d64f[_0xcdd0('0x2f')]=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],_0xd6d64f['query']);_0x28084c['attributes']=_[_0xcdd0('0x30')](_0xd6d64f[_0xcdd0('0x31')],qs[_0xcdd0('0x32')](_0x4074e0['query'][_0xcdd0('0x32')]));_0x28084c[_0xcdd0('0x33')]=_0x28084c['attributes'][_0xcdd0('0x34')]?_0x28084c[_0xcdd0('0x33')]:_0xd6d64f[_0xcdd0('0x31')];if(_0x4074e0[_0xcdd0('0x2e')]['includeAll']){_0x28084c[_0xcdd0('0x35')]=[{'all':!![]}];}_0x28084c=_[_0xcdd0('0x36')]({},_0x28084c,_0x4074e0['options']);return db[_0xcdd0('0x2c')][_0xcdd0('0x37')](_0x28084c)[_0xcdd0('0x38')](handleEntityNotFound(_0x49cfe0,null))[_0xcdd0('0x38')](respondWithResult(_0x49cfe0,null))['catch'](handleError(_0x49cfe0,null));};exports[_0xcdd0('0x39')]=function(_0x358139,_0x95d87f){return db[_0xcdd0('0x2c')][_0xcdd0('0x39')](_0x358139['body'],{})[_0xcdd0('0x38')](respondWithResult(_0x95d87f,0xc9))['catch'](handleError(_0x95d87f,null));};exports['update']=function(_0x4fd705,_0x407725){if(_0x4fd705[_0xcdd0('0x3a')]['id']){delete _0x4fd705[_0xcdd0('0x3a')]['id'];}return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4fd705[_0xcdd0('0x2a')]['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x407725,null))['then'](saveUpdates(_0x4fd705[_0xcdd0('0x3a')],null))[_0xcdd0('0x38')](respondWithResult(_0x407725,null))[_0xcdd0('0x3b')](handleError(_0x407725,null));};exports[_0xcdd0('0x24')]=function(_0x4e6d31,_0x4934a5){return db[_0xcdd0('0x2c')][_0xcdd0('0x37')]({'where':{'id':_0x4e6d31['params']['id']}})[_0xcdd0('0x38')](handleEntityNotFound(_0x4934a5,null))[_0xcdd0('0x38')](removeEntity(_0x4934a5,null))['catch'](handleError(_0x4934a5,null));};
\ No newline at end of file
index 7104c3a..9f65e6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69fc=['lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x51e5bd,_0x3c2cf1){var _0x250aed=function(_0x17120c){while(--_0x17120c){_0x51e5bd['push'](_0x51e5bd['shift']());}};_0x250aed(++_0x3c2cf1);}(_0x69fc,0xa5));var _0xc69f=function(_0x536f02,_0x17a4f3){_0x536f02=_0x536f02-0x0;var _0x102273=_0x69fc[_0x536f02];return _0x102273;};'use strict';var _=require(_0xc69f('0x0'));var util=require(_0xc69f('0x1'));var logger=require(_0xc69f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc69f('0x3'));var rp=require(_0xc69f('0x4'));var fs=require('fs');var path=require(_0xc69f('0x5'));var rimraf=require('rimraf');var config=require(_0xc69f('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0xc69f('0x7')]=function(_0x537023,_0x262f7a){return _0x537023[_0xc69f('0x8')](_0xc69f('0x9'),attributes,{'tableName':_0xc69f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0694=['lodash','util','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x513b2c,_0x4cf8f7){var _0x5a8e07=function(_0x481f31){while(--_0x481f31){_0x513b2c['push'](_0x513b2c['shift']());}};_0x5a8e07(++_0x4cf8f7);}(_0x0694,0x181));var _0x4069=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x0694[_0x47b58b];return _0x46bebe;};'use strict';var _=require(_0x4069('0x0'));var util=require(_0x4069('0x1'));var logger=require('../../config/logger')(_0x4069('0x2'));var moment=require(_0x4069('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4069('0x4'));var rimraf=require(_0x4069('0x5'));var config=require(_0x4069('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x4069('0x7')]=function(_0x2f953e,_0x23a011){return _0x2f953e[_0x4069('0x8')](_0x4069('0x9'),attributes,{'tableName':_0x4069('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1002409..e102abb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02fb=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','ChatProactiveAction,\x20%s,\x20%s'];(function(_0x474f02,_0x44c5af){var _0x47321d=function(_0x40e0de){while(--_0x40e0de){_0x474f02['push'](_0x474f02['shift']());}};_0x47321d(++_0x44c5af);}(_0x02fb,0x1b0));var _0xb02f=function(_0x422a8a,_0x530cca){_0x422a8a=_0x422a8a-0x0;var _0x3d349e=_0x02fb[_0x422a8a];return _0x3d349e;};'use strict';var _=require(_0xb02f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb02f('0x1'));var rs=require(_0xb02f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb02f('0x3'))['db'];var utils=require(_0xb02f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb02f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb02f('0x6')][_0xb02f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55d040,_0x26d7aa,_0x56575d){return new BPromise(function(_0x1c0a53,_0x352a43){return client[_0xb02f('0x8')](_0x55d040,_0x56575d)['then'](function(_0x309459){logger['info'](_0xb02f('0x9'),_0x26d7aa,_0xb02f('0xa'));logger[_0xb02f('0xb')](_0xb02f('0xc'),_0x26d7aa,'request\x20sent',JSON[_0xb02f('0xd')](_0x309459));if(_0x309459[_0xb02f('0xe')]){if(_0x309459[_0xb02f('0xe')]['code']===0x1f4){logger['error'](_0xb02f('0x9'),_0x26d7aa,_0x309459[_0xb02f('0xe')][_0xb02f('0xf')]);return _0x352a43(_0x309459[_0xb02f('0xe')][_0xb02f('0xf')]);}logger[_0xb02f('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x26d7aa,_0x309459[_0xb02f('0xe')]['message']);return _0x1c0a53(_0x309459[_0xb02f('0xe')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x26d7aa,_0xb02f('0xa'));_0x1c0a53(_0x309459[_0xb02f('0x10')]['message']);}})['catch'](function(_0x4b8e62){logger[_0xb02f('0xe')](_0xb02f('0x9'),_0x26d7aa,_0x4b8e62);_0x352a43(_0x4b8e62);});});}
\ No newline at end of file
+var _0x5ef8=['../../config/environment','jayson/promise','client','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','rpc'];(function(_0x12a21c,_0x4660a0){var _0x1d5a61=function(_0x17bbf0){while(--_0x17bbf0){_0x12a21c['push'](_0x12a21c['shift']());}};_0x1d5a61(++_0x4660a0);}(_0x5ef8,0x7f));var _0x85ef=function(_0xb88d2f,_0x93cfe1){_0xb88d2f=_0xb88d2f-0x0;var _0x3d9d4f=_0x5ef8[_0xb88d2f];return _0x3d9d4f;};'use strict';var _=require(_0x85ef('0x0'));var util=require(_0x85ef('0x1'));var moment=require(_0x85ef('0x2'));var BPromise=require(_0x85ef('0x3'));var rs=require(_0x85ef('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85ef('0x5'));var config=require(_0x85ef('0x6'));var jayson=require(_0x85ef('0x7'));var client=jayson[_0x85ef('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e1cf8,_0x4c44f6,_0x43e96d){return new BPromise(function(_0xfa9518,_0xbbe5b2){return client[_0x85ef('0x9')](_0x2e1cf8,_0x43e96d)[_0x85ef('0xa')](function(_0x4e3964){logger[_0x85ef('0xb')](_0x85ef('0xc'),_0x4c44f6,'request\x20sent');logger[_0x85ef('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x4c44f6,_0x85ef('0xe'),JSON[_0x85ef('0xf')](_0x4e3964));if(_0x4e3964[_0x85ef('0x10')]){if(_0x4e3964[_0x85ef('0x10')]['code']===0x1f4){logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x4e3964[_0x85ef('0x10')][_0x85ef('0x11')]);return _0xbbe5b2(_0x4e3964[_0x85ef('0x10')][_0x85ef('0x11')]);}logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x4e3964[_0x85ef('0x10')]['message']);return _0xfa9518(_0x4e3964[_0x85ef('0x10')]['message']);}else{logger[_0x85ef('0xb')](_0x85ef('0xc'),_0x4c44f6,_0x85ef('0xe'));_0xfa9518(_0x4e3964[_0x85ef('0x12')]['message']);}})['catch'](function(_0x28ab1c){logger[_0x85ef('0x10')](_0x85ef('0xc'),_0x4c44f6,_0x28ab1c);_0xbbe5b2(_0x28ab1c);});});}
\ No newline at end of file
index 2e9f9f9..df5dd28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','create','put','update','delete','exports','multer','util'];(function(_0x5cef8d,_0x273c5b){var _0x104599=function(_0x4360bf){while(--_0x4360bf){_0x5cef8d['push'](_0x5cef8d['shift']());}};_0x104599(++_0x273c5b);}(_0xf494,0x1c6));var _0x4f49=function(_0xa73287,_0x36fdda){_0xa73287=_0xa73287-0x0;var _0x93e564=_0xf494[_0xa73287];return _0x93e564;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')](_0x4f49('0xb'),auth[_0x4f49('0xc')](),controller['destroy']);module[_0x4f49('0x12')]=router;
\ No newline at end of file
+var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x34d2a0,_0x6cde4f){var _0x505c5b=function(_0x2130a3){while(--_0x2130a3){_0x34d2a0['push'](_0x34d2a0['shift']());}};_0x505c5b(++_0x6cde4f);}(_0x31f0,0xb7));var _0x031f=function(_0x5b868b,_0x14997e){_0x5b868b=_0x5b868b-0x0;var _0x2adf3f=_0x31f0[_0x5b868b];return _0x2adf3f;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router;
\ No newline at end of file
index c7704ee..f70be87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac09=['rrmemory','beepall','exports','STRING','name'];(function(_0xe836b8,_0xe8b231){var _0xfcf4e0=function(_0x7a2e95){while(--_0x7a2e95){_0xe836b8['push'](_0xe836b8['shift']());}};_0xfcf4e0(++_0xe8b231);}(_0xac09,0x11f));var _0x9ac0=function(_0x2b486d,_0x5825b5){_0x2b486d=_0x2b486d-0x0;var _0x2a7511=_0xac09[_0x2b486d];return _0x2a7511;};'use strict';var Sequelize=require('sequelize');module[_0x9ac0('0x0')]={'name':{'type':Sequelize[_0x9ac0('0x1')],'unique':_0x9ac0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9ac0('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9ac0('0x3'),_0x9ac0('0x4'),'roundrobin')}};
\ No newline at end of file
+var _0xf825=['sequelize','exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xf825,0x168));var _0x5f82=function(_0x5ca3fe,_0x2446c3){_0x5ca3fe=_0x5ca3fe-0x0;var _0x341dc4=_0xf825[_0x5ca3fe];return _0x341dc4;};'use strict';var Sequelize=require(_0x5f82('0x0'));module[_0x5f82('0x1')]={'name':{'type':Sequelize[_0x5f82('0x2')],'unique':_0x5f82('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5f82('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5f82('0x5'),_0x5f82('0x6'),_0x5f82('0x7'))}};
\ No newline at end of file
index 502e27d..a8d34fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1795=['removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','agent','chatPause','createdAt','%s/%s','SIP','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x1795,0x150));var _0x5179=function(_0x2b72f5,_0x1d1f7b){_0x2b72f5=_0x2b72f5-0x0;var _0x49adb5=_0x1795[_0x2b72f5];return _0x49adb5;};'use strict';var emlformat=require(_0x5179('0x0'));var rimraf=require(_0x5179('0x1'));var zipdir=require(_0x5179('0x2'));var jsonpatch=require(_0x5179('0x3'));var rp=require('request-promise');var moment=require(_0x5179('0x4'));var BPromise=require(_0x5179('0x5'));var Mustache=require('mustache');var util=require(_0x5179('0x6'));var path=require(_0x5179('0x7'));var sox=require('sox');var csv=require(_0x5179('0x8'));var ejs=require(_0x5179('0x9'));var fs=require('fs');var fs_extra=require(_0x5179('0xa'));var _=require('lodash');var squel=require(_0x5179('0xb'));var crypto=require('crypto');var jsforce=require(_0x5179('0xc'));var deskjs=require(_0x5179('0xd'));var toCsv=require(_0x5179('0x8'));var querystring=require('querystring');var Papa=require(_0x5179('0xe'));var Redis=require(_0x5179('0xf'));var authService=require(_0x5179('0x10'));var qs=require(_0x5179('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5179('0x12'));var logger=require(_0x5179('0x13'))(_0x5179('0x14'));var utils=require('../../config/utils');var config=require(_0x5179('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x5179('0x16'))['db'];config['redis']=_[_0x5179('0x17')](config[_0x5179('0x18')],{'host':_0x5179('0x19'),'port':0x18eb});var socket=require(_0x5179('0x1a'))(new Redis(config[_0x5179('0x18')]));require('./chatQueue.socket')[_0x5179('0x1b')](socket);var jayson=require(_0x5179('0x1c'));var client=jayson[_0x5179('0x1d')][_0x5179('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x1a53a3,_0x320418,_0x2effc,_0x38999b){return new BPromise(function(_0x3df23b,_0xf22974){var _0x4384d3=_0x38999b||client;return _0x4384d3[_0x5179('0x1f')](_0x1a53a3,_0x2effc)['then'](function(_0x44bbbd){logger['info'](_0x5179('0x20'),_0x320418,_0x5179('0x21'));logger[_0x5179('0x22')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x320418,'request\x20sent',JSON[_0x5179('0x23')](_0x44bbbd));if(_0x44bbbd[_0x5179('0x24')]){if(_0x44bbbd['error'][_0x5179('0x25')]===0x1f4){logger[_0x5179('0x24')](_0x5179('0x20'),_0x320418,_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);return _0xf22974(_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);}logger[_0x5179('0x24')]('ChatQueue,\x20%s,\x20%s',_0x320418,_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);return _0x3df23b(_0x44bbbd[_0x5179('0x24')][_0x5179('0x26')]);}else{logger[_0x5179('0x27')](_0x5179('0x20'),_0x320418,_0x5179('0x21'));_0x3df23b(_0x44bbbd[_0x5179('0x28')]['message']);}})[_0x5179('0x29')](function(_0xc57b32){logger['error']('ChatQueue,\x20%s,\x20%s',_0x320418,_0xc57b32);_0xf22974(_0xc57b32);});});}function respondWithStatusCode(_0x2a12af,_0x2fa56c){_0x2fa56c=_0x2fa56c||0xcc;return function(_0x203da8){if(_0x203da8){return _0x2a12af[_0x5179('0x2a')](_0x2fa56c);}return _0x2a12af['status'](_0x2fa56c)[_0x5179('0x2b')]();};}function respondWithResult(_0x3c0bcb,_0x2f96b2){_0x2f96b2=_0x2f96b2||0xc8;return function(_0x57f5bd){if(_0x57f5bd){return _0x3c0bcb[_0x5179('0x2c')](_0x2f96b2)[_0x5179('0x2d')](_0x57f5bd);}};}function respondWithFilteredResult(_0x22b102,_0x182c07){return function(_0xa99936){if(_0xa99936){var _0x272941=typeof _0x182c07['offset']==='undefined'&&typeof _0x182c07[_0x5179('0x2e')]===_0x5179('0x2f');var _0xc0cb28=_0xa99936['count'];var _0x1789f2=_0x272941?0x0:_0x182c07['offset'];var _0x5a3b5f=_0x272941?_0xa99936[_0x5179('0x30')]:_0x182c07[_0x5179('0x31')]+_0x182c07[_0x5179('0x2e')];var _0x2356e4;if(_0x5a3b5f>=_0xc0cb28){_0x5a3b5f=_0xc0cb28;_0x2356e4=0xc8;}else{_0x2356e4=0xce;}_0x22b102['status'](_0x2356e4);return _0x22b102['set']('Content-Range',_0x1789f2+'-'+_0x5a3b5f+'/'+_0xc0cb28)[_0x5179('0x2d')](_0xa99936);}return null;};}function patchUpdates(_0x39bb50){return function(_0x5c0fb1){try{jsonpatch[_0x5179('0x32')](_0x5c0fb1,_0x39bb50,!![]);}catch(_0x10af4f){return BPromise[_0x5179('0x33')](_0x10af4f);}return _0x5c0fb1[_0x5179('0x34')]();};}function saveUpdates(_0x43aa1d,_0x1e6b20){return function(_0x1c6754){if(_0x1c6754){return _0x1c6754[_0x5179('0x35')](_0x43aa1d)[_0x5179('0x36')](function(_0x3ee43){return _0x3ee43;});}return null;};}function removeEntity(_0x37abad,_0x2b4604){return function(_0x3a3493){if(_0x3a3493){return _0x3a3493[_0x5179('0x37')]()[_0x5179('0x36')](function(){var _0x1b056b=_0x3a3493[_0x5179('0x38')]({'plain':!![]});var _0x52ce61='ChatQueues';return db[_0x5179('0x39')][_0x5179('0x37')]({'where':{'type':_0x52ce61,'resourceId':_0x1b056b['id']}})['then'](function(){return _0x3a3493;});})[_0x5179('0x36')](function(){_0x37abad[_0x5179('0x2c')](0xcc)[_0x5179('0x2b')]();});}};}function handleEntityNotFound(_0x3b9be8,_0x30469e){return function(_0x3af034){if(!_0x3af034){_0x3b9be8[_0x5179('0x2a')](0x194);}return _0x3af034;};}function handleError(_0x39f2de,_0x350ed5){_0x350ed5=_0x350ed5||0x1f4;return function(_0x2e7967){logger['error'](_0x2e7967[_0x5179('0x3a')]);if(_0x2e7967['name']){delete _0x2e7967[_0x5179('0x3b')];}_0x39f2de[_0x5179('0x2c')](_0x350ed5)[_0x5179('0x3c')](_0x2e7967);};}exports['index']=function(_0x37d31d,_0x4b9cbb){var _0x215b47={},_0x4f2585={},_0x57f27b={'count':0x0,'rows':[]};var _0x48a11b=_[_0x5179('0x3d')](db[_0x5179('0x3e')][_0x5179('0x3f')],function(_0x26ed94){return{'name':_0x26ed94[_0x5179('0x40')],'type':_0x26ed94[_0x5179('0x41')][_0x5179('0x42')]};});_0x4f2585[_0x5179('0x43')]=_[_0x5179('0x3d')](_0x48a11b,_0x5179('0x3b'));_0x4f2585['query']=_[_0x5179('0x44')](_0x37d31d[_0x5179('0x45')]);_0x4f2585[_0x5179('0x46')]=_[_0x5179('0x47')](_0x4f2585['model'],_0x4f2585[_0x5179('0x45')]);_0x215b47[_0x5179('0x48')]=_['intersection'](_0x4f2585['model'],qs[_0x5179('0x49')](_0x37d31d['query'][_0x5179('0x49')]));_0x215b47[_0x5179('0x48')]=_0x215b47[_0x5179('0x48')][_0x5179('0x4a')]?_0x215b47[_0x5179('0x48')]:_0x4f2585[_0x5179('0x43')];if(!_0x37d31d[_0x5179('0x45')]['hasOwnProperty'](_0x5179('0x4b'))){_0x215b47[_0x5179('0x2e')]=qs['limit'](_0x37d31d['query'][_0x5179('0x2e')]);_0x215b47[_0x5179('0x31')]=qs[_0x5179('0x31')](_0x37d31d[_0x5179('0x45')][_0x5179('0x31')]);}_0x215b47[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x37d31d[_0x5179('0x45')][_0x5179('0x4d')]);_0x215b47['where']=qs['filters'](_[_0x5179('0x4e')](_0x37d31d['query'],_0x4f2585[_0x5179('0x46')]),_0x48a11b);if(_0x37d31d[_0x5179('0x45')][_0x5179('0x4f')]){_0x215b47[_0x5179('0x50')]=_[_0x5179('0x51')](_0x215b47['where'],{'$or':_[_0x5179('0x3d')](_0x48a11b,function(_0x318f1f){if(_0x318f1f[_0x5179('0x41')]!==_0x5179('0x52')){var _0x4c40f7={};_0x4c40f7[_0x318f1f[_0x5179('0x3b')]]={'$like':'%'+_0x37d31d['query'][_0x5179('0x4f')]+'%'};return _0x4c40f7;}})});}_0x215b47=_[_0x5179('0x51')]({},_0x215b47,_0x37d31d[_0x5179('0x53')]);var _0x3786ce={'where':_0x215b47['where']};return db['ChatQueue'][_0x5179('0x30')](_0x3786ce)['then'](function(_0x946802){_0x57f27b['count']=_0x946802;if(_0x37d31d[_0x5179('0x45')][_0x5179('0x54')]){_0x215b47['include']=[{'all':!![]}];}return db[_0x5179('0x3e')][_0x5179('0x55')](_0x215b47);})[_0x5179('0x36')](function(_0x4c32f1){_0x57f27b[_0x5179('0x56')]=_0x4c32f1;return _0x57f27b;})['then'](respondWithFilteredResult(_0x4b9cbb,_0x215b47))[_0x5179('0x29')](handleError(_0x4b9cbb,null));};exports['show']=function(_0x4b2104,_0x1e2d80){var _0x56c57f={'raw':!![],'where':{'id':_0x4b2104[_0x5179('0x57')]['id']}},_0x2e483c={};_0x2e483c['model']=_[_0x5179('0x44')](db[_0x5179('0x3e')]['rawAttributes']);_0x2e483c[_0x5179('0x45')]=_[_0x5179('0x44')](_0x4b2104[_0x5179('0x45')]);_0x2e483c['filters']=_[_0x5179('0x47')](_0x2e483c[_0x5179('0x43')],_0x2e483c[_0x5179('0x45')]);_0x56c57f[_0x5179('0x48')]=_[_0x5179('0x47')](_0x2e483c[_0x5179('0x43')],qs[_0x5179('0x49')](_0x4b2104[_0x5179('0x45')][_0x5179('0x49')]));_0x56c57f['attributes']=_0x56c57f[_0x5179('0x48')][_0x5179('0x4a')]?_0x56c57f[_0x5179('0x48')]:_0x2e483c[_0x5179('0x43')];if(_0x4b2104[_0x5179('0x45')][_0x5179('0x54')]){_0x56c57f[_0x5179('0x58')]=[{'all':!![]}];}_0x56c57f=_['merge']({},_0x56c57f,_0x4b2104[_0x5179('0x53')]);return db['ChatQueue'][_0x5179('0x59')](_0x56c57f)[_0x5179('0x36')](handleEntityNotFound(_0x1e2d80,null))['then'](respondWithResult(_0x1e2d80,null))[_0x5179('0x29')](handleError(_0x1e2d80,null));};exports[_0x5179('0x5a')]=function(_0x3b6b3e,_0x107e57){return db[_0x5179('0x3e')]['create'](_0x3b6b3e[_0x5179('0x5b')],{})[_0x5179('0x36')](function(_0x1dc143){var _0x2f8fe7=_0x3b6b3e[_0x5179('0x5c')][_0x5179('0x38')]({'plain':!![]});if(!_0x2f8fe7)throw new Error(_0x5179('0x5d'));if(_0x2f8fe7[_0x5179('0x5e')]===_0x5179('0x5c')){var _0x228d69=_0x1dc143[_0x5179('0x38')]({'plain':!![]});var _0x186721=_0x5179('0x5f');return db[_0x5179('0x60')]['find']({'where':{'name':_0x186721,'userProfileId':_0x2f8fe7['userProfileId']},'raw':!![]})[_0x5179('0x36')](function(_0x2a635e){if(_0x2a635e&&_0x2a635e['autoAssociation']===0x0){return db[_0x5179('0x39')][_0x5179('0x5a')]({'name':_0x228d69[_0x5179('0x3b')],'resourceId':_0x228d69['id'],'type':_0x2a635e[_0x5179('0x3b')],'sectionId':_0x2a635e['id']},{})['then'](function(){return _0x1dc143;});}else{return _0x1dc143;}})['catch'](function(_0x1a1f6f){logger['error'](_0x5179('0x61'),_0x1a1f6f);throw _0x1a1f6f;});}return _0x1dc143;})[_0x5179('0x36')](respondWithResult(_0x107e57,0xc9))[_0x5179('0x29')](handleError(_0x107e57,null));};exports[_0x5179('0x35')]=function(_0x1a4300,_0x4814e4){if(_0x1a4300[_0x5179('0x5b')]['id']){delete _0x1a4300[_0x5179('0x5b')]['id'];}return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x1a4300[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x4814e4,null))[_0x5179('0x36')](saveUpdates(_0x1a4300['body'],null))[_0x5179('0x36')](respondWithResult(_0x4814e4,null))[_0x5179('0x29')](handleError(_0x4814e4,null));};exports[_0x5179('0x37')]=function(_0x321a3f,_0x5c47ee){return db['ChatQueue'][_0x5179('0x59')]({'where':{'id':_0x321a3f[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x5c47ee,null))[_0x5179('0x36')](removeEntity(_0x5c47ee,null))[_0x5179('0x29')](handleError(_0x5c47ee,null));};exports[_0x5179('0x62')]=function(_0x12fbef,_0x3638fc){return db['ChatQueue'][_0x5179('0x62')]()[_0x5179('0x36')](respondWithResult(_0x3638fc,null))[_0x5179('0x29')](handleError(_0x3638fc,null));};exports[_0x5179('0x63')]=function(_0x5e9cca,_0x30edaa,_0x2103ad){var _0x44de8d={'raw':!![],'where':{}},_0x507716={},_0x1f894b;return db[_0x5179('0x3e')][_0x5179('0x64')]({'where':{'id':_0x5e9cca['params']['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x30edaa,null))[_0x5179('0x36')](function(_0x1d384b){if(_0x1d384b){_0x1f894b=_0x1d384b['get']({'plain':!![]});_0x507716[_0x5179('0x43')]=_['keys'](db[_0x5179('0x65')][_0x5179('0x3f')]);_0x507716[_0x5179('0x45')]=_[_0x5179('0x44')](_0x5e9cca[_0x5179('0x45')]);_0x507716['filters']=_[_0x5179('0x47')](_0x507716[_0x5179('0x43')],_0x507716[_0x5179('0x45')]);_0x44de8d[_0x5179('0x48')]=_[_0x5179('0x47')](_0x507716[_0x5179('0x43')],qs[_0x5179('0x49')](_0x5e9cca[_0x5179('0x45')][_0x5179('0x49')]));_0x44de8d[_0x5179('0x48')]=_0x44de8d[_0x5179('0x48')][_0x5179('0x4a')]?_0x44de8d[_0x5179('0x48')]:_0x507716[_0x5179('0x43')];if(!_0x5e9cca[_0x5179('0x45')][_0x5179('0x66')](_0x5179('0x4b'))){_0x44de8d[_0x5179('0x2e')]=qs['limit'](_0x5e9cca[_0x5179('0x45')][_0x5179('0x2e')]);_0x44de8d['offset']=qs[_0x5179('0x31')](_0x5e9cca[_0x5179('0x45')]['offset']);}_0x44de8d['order']=qs[_0x5179('0x4d')](_0x5e9cca['query'][_0x5179('0x4d')]);_0x44de8d[_0x5179('0x50')]=qs[_0x5179('0x46')](_[_0x5179('0x4e')](_0x5e9cca['query'],_0x507716['filters']));_0x44de8d[_0x5179('0x50')][_0x5179('0x67')]=_0x1d384b['id'];if(_0x5e9cca[_0x5179('0x45')]['filter']){_0x44de8d['where']=_['merge'](_0x44de8d['where'],{'$or':_[_0x5179('0x3d')](_0x44de8d[_0x5179('0x48')],function(_0x2d821c){var _0x1971a4={};_0x1971a4[_0x2d821c]={'$like':'%'+_0x5e9cca[_0x5179('0x45')][_0x5179('0x4f')]+'%'};return _0x1971a4;})});}_0x44de8d=_[_0x5179('0x51')]({},_0x44de8d,_0x5e9cca[_0x5179('0x53')]);return db[_0x5179('0x65')][_0x5179('0x55')](_0x44de8d);}})[_0x5179('0x36')](function(_0xd82940){if(_0xd82940){return db[_0x5179('0x68')][_0x5179('0x69')]({'where':{'id':_['map'](_0xd82940,'UserId'),'role':_0x5179('0x6a')},'attributes':['id',_0x5179('0x3b'),_0x5179('0x6b'),'updatedAt',_0x5179('0x6c')]});}})[_0x5179('0x36')](function(_0x3d16fc){if(_0x3d16fc){return{'count':_0x3d16fc['count'],'rows':_[_0x5179('0x3d')](_0x3d16fc['rows'],function(_0x9cd4a8){return{'membername':_0x9cd4a8['name'],'UserId':_0x9cd4a8['id'],'queue_name':_0x1f894b[_0x5179('0x3b')],'ChatQueueId':_0x1f894b['id'],'interface':util['format'](_0x5179('0x6d'),_0x5179('0x6e'),_0x9cd4a8[_0x5179('0x3b')]),'penalty':0x0,'paused':_0x9cd4a8[_0x5179('0x6b')],'createdAt':_0x9cd4a8[_0x5179('0x6c')],'updatedAt':_0x9cd4a8[_0x5179('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5179('0x36')](respondWithFilteredResult(_0x30edaa,_0x44de8d))['catch'](handleError(_0x30edaa,null));};exports[_0x5179('0x70')]=function(_0x3ea2ea,_0x1644ea,_0x1138a6){var _0x41eb64={};var _0x144d28={};var _0x33ec2e;var _0x52b261;return db[_0x5179('0x3e')]['findOne']({'where':{'id':_0x3ea2ea[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x1644ea,null))[_0x5179('0x36')](function(_0x23b77a){if(_0x23b77a){_0x33ec2e=_0x23b77a;_0x144d28[_0x5179('0x43')]=_[_0x5179('0x44')](db[_0x5179('0x71')][_0x5179('0x3f')]);_0x144d28[_0x5179('0x45')]=_['keys'](_0x3ea2ea[_0x5179('0x45')]);_0x144d28[_0x5179('0x46')]=_[_0x5179('0x47')](_0x144d28[_0x5179('0x43')],_0x144d28['query']);_0x41eb64[_0x5179('0x48')]=_[_0x5179('0x47')](_0x144d28[_0x5179('0x43')],qs['fields'](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x49')]));_0x41eb64[_0x5179('0x48')]=_0x41eb64[_0x5179('0x48')]['length']?_0x41eb64['attributes']:_0x144d28[_0x5179('0x43')];_0x41eb64[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x4d')]);_0x41eb64['where']=qs[_0x5179('0x46')](_[_0x5179('0x4e')](_0x3ea2ea[_0x5179('0x45')],_0x144d28[_0x5179('0x46')]));if(_0x3ea2ea[_0x5179('0x45')]['filter']){_0x41eb64['where']=_[_0x5179('0x51')](_0x41eb64[_0x5179('0x50')],{'$or':_[_0x5179('0x3d')](_0x41eb64['attributes'],function(_0x4fb9bd){var _0xb26d24={};_0xb26d24[_0x4fb9bd]={'$like':'%'+_0x3ea2ea[_0x5179('0x45')]['filter']+'%'};return _0xb26d24;})});}_0x41eb64=_['merge']({},_0x41eb64,_0x3ea2ea[_0x5179('0x53')]);return _0x33ec2e['getTeams'](_0x41eb64);}})[_0x5179('0x36')](function(_0x850a68){if(_0x850a68){_0x52b261=_0x850a68[_0x5179('0x4a')];if(!_0x3ea2ea[_0x5179('0x45')][_0x5179('0x66')]('nolimit')){_0x41eb64[_0x5179('0x2e')]=qs[_0x5179('0x2e')](_0x3ea2ea[_0x5179('0x45')]['limit']);_0x41eb64['offset']=qs['offset'](_0x3ea2ea[_0x5179('0x45')][_0x5179('0x31')]);}return _0x33ec2e[_0x5179('0x70')](_0x41eb64);}})[_0x5179('0x36')](function(_0x83a96c){if(_0x83a96c){return _0x83a96c?{'count':_0x52b261,'rows':_0x83a96c}:null;}})[_0x5179('0x36')](respondWithResult(_0x1644ea,null))['catch'](handleError(_0x1644ea,null));};exports[_0x5179('0x72')]=function(_0x31cc65,_0x107b68,_0x59c04e){var _0x6a6533=_0x31cc65[_0x5179('0x5b')][_0x5179('0x73')];return db['Team'][_0x5179('0x55')]({'where':{'id':_0x6a6533},'attributes':['id'],'include':[{'model':db[_0x5179('0x68')],'as':_0x5179('0x74'),'attributes':['id',_0x5179('0x3b'),_0x5179('0x75'),_0x5179('0x76'),'interface'],'raw':!![]}]})[_0x5179('0x36')](function(_0x25b33f){if(_0x25b33f){var _0x1abb60=_[_0x5179('0x77')](_0x25b33f,function(_0x3f55c5){var _0xcb7ecd=_0x3f55c5['get']({'plain':!![]});return _0xcb7ecd[_0x5179('0x74')];});return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x31cc65[_0x5179('0x57')]['id']}})[_0x5179('0x36')](function(_0x460df2){return db['sequelize'][_0x5179('0x78')](function(_0x558542){return _0x460df2[_0x5179('0x72')](_0x6a6533,{'transaction':_0x558542})[_0x5179('0x36')](function(){return BPromise[_0x5179('0x79')](_0x1abb60,function(_0x3b2fb7){return db['UserChatQueue'][_0x5179('0x7a')]({'where':{'UserId':_0x3b2fb7['id'],'ChatQueueId':_0x31cc65['params']['id']},'transaction':_0x558542});});})[_0x5179('0x36')](function(){_0x1abb60[_0x5179('0x7b')](function(_0x37eeeb){socket[_0x5179('0x7c')](_0x5179('0x7d'),{'UserId':_0x37eeeb['id'],'ChatQueueId':_0x460df2['id']});});});});});}})[_0x5179('0x36')](respondWithStatusCode(_0x107b68,null))[_0x5179('0x29')](handleError(_0x107b68,null));};exports[_0x5179('0x7e')]=function(_0x9f269e,_0x4a0e8f,_0x4c9085){return db[_0x5179('0x71')][_0x5179('0x55')]({'where':{'id':_0x9f269e[_0x5179('0x45')][_0x5179('0x73')]},'attributes':['id'],'include':[{'model':db[_0x5179('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4a0e8f,null))[_0x5179('0x36')](function(_0xe75b5){var _0x4c2af1=_[_0x5179('0x3d')](_0xe75b5,'id');var _0x41b57b=[];var _0x123788=[];var _0x5577fc=squel[_0x5179('0x7f')]();_0x5577fc[_0x5179('0x80')](_0x5179('0x81'))[_0x5179('0x82')](_0x5179('0x83'),'tq')[_0x5179('0x84')]('user_has_teams','ut',_0x5179('0x85'))[_0x5179('0x50')](_0x5179('0x86'),_0x9f269e['params']['id']);for(var _0x201050=0x0;_0x201050<_0xe75b5['length'];_0x201050+=0x1){let _0x29490d=_0xe75b5[_0x201050];for(var _0x4ea70a=0x0;_0x4ea70a<_0x29490d[_0x5179('0x74')][_0x5179('0x4a')];_0x4ea70a+=0x1){let _0x25adb3=_0x29490d[_0x5179('0x74')][_0x4ea70a];var _0x146b18=_0x5577fc[_0x5179('0x87')]();_0x146b18[_0x5179('0x50')](_0x5179('0x88'),_0x25adb3['id']);_0x123788[_0x5179('0x89')](db[_0x5179('0x8a')]['query'](_0x146b18[_0x5179('0x8b')](),{'type':db[_0x5179('0x8a')][_0x5179('0x8c')]['SELECT']})[_0x5179('0x36')](function(_0x410aff){if(_0x410aff[_0x5179('0x4a')]===0x1){return _0x25adb3['id'];}else{var _0x401ebe=_[_0x5179('0x8d')](_[_0x5179('0x3d')](_0x410aff,_0x5179('0x8e')),function(_0xa35f){return _[_0x5179('0x8f')](_0x4c2af1,_0xa35f);});if(_0x401ebe){return _0x25adb3['id'];}}}));}}return BPromise[_0x5179('0x90')](_0x123788)['then'](function(_0x11f737){_0x41b57b=_(_0x41b57b)[_0x5179('0x91')](_0x11f737)[_0x5179('0x92')]()[_0x5179('0x93')]();return db['ChatQueue'][_0x5179('0x59')]({'where':{'id':_0x9f269e[_0x5179('0x57')]['id']}})[_0x5179('0x36')](function(_0x353a4e){return db[_0x5179('0x8a')]['transaction'](function(_0x31ab7d){return _0x353a4e['removeTeams'](_0x9f269e[_0x5179('0x45')][_0x5179('0x73')],{'transaction':_0x31ab7d})[_0x5179('0x36')](function(){if(!_['isEmpty'](_0x41b57b)){return _0x353a4e[_0x5179('0x94')](_0x41b57b,{'transaction':_0x31ab7d});}})['then'](function(){_0x41b57b[_0x5179('0x7b')](function(_0x2ef2e6){socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':_0x2ef2e6,'ChatQueueId':_0x353a4e['id']});});});});});});})[_0x5179('0x36')](respondWithStatusCode(_0x4a0e8f,null))[_0x5179('0x29')](handleError(_0x4a0e8f,null));};exports[_0x5179('0x96')]=function(_0xb05ba5,_0x1e316d,_0x3ace40){return db[_0x5179('0x3e')]['find']({'where':{'id':_0xb05ba5[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x1e316d,null))[_0x5179('0x36')](function(_0x27d6d9){if(_0x27d6d9){return _0x27d6d9[_0x5179('0x96')](_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')],_[_0x5179('0x97')](_0xb05ba5[_0x5179('0x5b')],[_0x5179('0x73'),'id'])||{})[_0x5179('0x98')](function(_0x443b34){for(var _0x381cdb=0x0;_0x381cdb<_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')][_0x5179('0x4a')];_0x381cdb+=0x1){socket[_0x5179('0x7c')](_0x5179('0x7d'),{'UserId':Number(_0xb05ba5[_0x5179('0x5b')][_0x5179('0x73')][_0x381cdb]),'ChatQueueId':Number(_0xb05ba5[_0x5179('0x57')]['id'])});}return _0x443b34;});}})[_0x5179('0x36')](respondWithResult(_0x1e316d,null))['catch'](handleError(_0x1e316d,null));};exports['removeAgents']=function(_0x41b5d1,_0x48c061,_0x4ce802){return db[_0x5179('0x3e')][_0x5179('0x59')]({'where':{'id':_0x41b5d1[_0x5179('0x57')]['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x48c061,null))[_0x5179('0x36')](function(_0x5e435f){if(_0x5e435f){return _0x5e435f['removeAgents'](_0x41b5d1['query']['ids'])[_0x5179('0x36')](function(){if(_['isArray'](_0x41b5d1['query'][_0x5179('0x73')])){for(var _0x386e42=0x0;_0x386e42<_0x41b5d1['query']['ids'][_0x5179('0x4a')];_0x386e42+=0x1){socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':Number(_0x41b5d1[_0x5179('0x45')][_0x5179('0x73')][_0x386e42]),'ChatQueueId':Number(_0x41b5d1[_0x5179('0x57')]['id'])});}}else{socket[_0x5179('0x7c')](_0x5179('0x95'),{'UserId':Number(_0x41b5d1['query'][_0x5179('0x73')]),'ChatQueueId':Number(_0x41b5d1[_0x5179('0x57')]['id'])});}});}})[_0x5179('0x36')](respondWithStatusCode(_0x48c061,null))[_0x5179('0x29')](handleError(_0x48c061,null));};exports[_0x5179('0x99')]=function(_0x90bde7,_0x804e84,_0x308e87){var _0x1c2dbb={};var _0x3bfd10={};var _0x1abc43;var _0x211546;return db[_0x5179('0x3e')][_0x5179('0x64')]({'where':{'id':_0x90bde7['params']['id']}})[_0x5179('0x36')](handleEntityNotFound(_0x804e84,null))[_0x5179('0x36')](function(_0x30545a){if(_0x30545a){_0x1abc43=_0x30545a;_0x3bfd10['model']=_['keys'](db[_0x5179('0x68')][_0x5179('0x3f')]);_0x3bfd10['query']=_[_0x5179('0x44')](_0x90bde7[_0x5179('0x45')]);_0x3bfd10[_0x5179('0x46')]=_['intersection'](_0x3bfd10[_0x5179('0x43')],_0x3bfd10[_0x5179('0x45')]);_0x1c2dbb[_0x5179('0x48')]=_['intersection'](_0x3bfd10[_0x5179('0x43')],qs[_0x5179('0x49')](_0x90bde7[_0x5179('0x45')][_0x5179('0x49')]));_0x1c2dbb[_0x5179('0x48')]=_0x1c2dbb[_0x5179('0x48')]['length']?_0x1c2dbb[_0x5179('0x48')]:_0x3bfd10[_0x5179('0x43')];_0x1c2dbb[_0x5179('0x4c')]=qs[_0x5179('0x4d')](_0x90bde7[_0x5179('0x45')][_0x5179('0x4d')]);_0x1c2dbb[_0x5179('0x50')]=qs['filters'](_[_0x5179('0x4e')](_0x90bde7[_0x5179('0x45')],_0x3bfd10[_0x5179('0x46')]));if(_0x90bde7[_0x5179('0x45')][_0x5179('0x4f')]){_0x1c2dbb[_0x5179('0x50')]=_[_0x5179('0x51')](_0x1c2dbb[_0x5179('0x50')],{'$or':_[_0x5179('0x3d')](_0x1c2dbb[_0x5179('0x48')],function(_0x24ea84){var _0x4d1fa9={};_0x4d1fa9[_0x24ea84]={'$like':'%'+_0x90bde7[_0x5179('0x45')][_0x5179('0x4f')]+'%'};return _0x4d1fa9;})});}_0x1c2dbb=_[_0x5179('0x51')]({},_0x1c2dbb,_0x90bde7[_0x5179('0x53')]);return _0x1abc43[_0x5179('0x99')](_0x1c2dbb);}})['then'](function(_0x224c22){if(_0x224c22){_0x211546=_0x224c22[_0x5179('0x4a')];if(!_0x90bde7[_0x5179('0x45')][_0x5179('0x66')](_0x5179('0x4b'))){_0x1c2dbb['limit']=qs[_0x5179('0x2e')](_0x90bde7[_0x5179('0x45')][_0x5179('0x2e')]);_0x1c2dbb[_0x5179('0x31')]=qs['offset'](_0x90bde7[_0x5179('0x45')][_0x5179('0x31')]);}return _0x1abc43[_0x5179('0x99')](_0x1c2dbb);}})[_0x5179('0x36')](function(_0xe641b1){if(_0xe641b1){return _0xe641b1?{'count':_0x211546,'rows':_0xe641b1}:null;}})[_0x5179('0x36')](respondWithResult(_0x804e84,null))[_0x5179('0x29')](handleError(_0x804e84,null));};
\ No newline at end of file
+var _0xc705=['rawAttributes','includeAll','find','create','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','getMembers','findOne','UserChatQueue','ChatQueueId','User','findAndCountAll','agent','chatPause','updatedAt','format','Team','getTeams','nolimit','ids','Agents','voicePause','interface','sequelize','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','transaction','removeAgents','userChatQueue:remove','addAgents','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','./chatQueue.socket','register','jayson/promise','client','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','get','UserProfileResource','stack','name','send','map','ChatQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys'];(function(_0x12254f,_0x100cfe){var _0x3a4fa2=function(_0x1ce891){while(--_0x1ce891){_0x12254f['push'](_0x12254f['shift']());}};_0x3a4fa2(++_0x100cfe);}(_0xc705,0x1e9));var _0x5c70=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0xc705[_0x39780c];return _0x53c19b;};'use strict';var emlformat=require(_0x5c70('0x0'));var rimraf=require(_0x5c70('0x1'));var zipdir=require(_0x5c70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c70('0x3'));var moment=require(_0x5c70('0x4'));var BPromise=require(_0x5c70('0x5'));var Mustache=require(_0x5c70('0x6'));var util=require(_0x5c70('0x7'));var path=require(_0x5c70('0x8'));var sox=require(_0x5c70('0x9'));var csv=require(_0x5c70('0xa'));var ejs=require(_0x5c70('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5c70('0xc'));var jsforce=require(_0x5c70('0xd'));var deskjs=require(_0x5c70('0xe'));var toCsv=require(_0x5c70('0xa'));var querystring=require(_0x5c70('0xf'));var Papa=require(_0x5c70('0x10'));var Redis=require(_0x5c70('0x11'));var authService=require(_0x5c70('0x12'));var qs=require(_0x5c70('0x13'));var as=require(_0x5c70('0x14'));var hardwareService=require(_0x5c70('0x15'));var logger=require('../../config/logger')(_0x5c70('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5c70('0x17'));var db=require('../../mysqldb')['db'];config[_0x5c70('0x18')]=_[_0x5c70('0x19')](config[_0x5c70('0x18')],{'host':_0x5c70('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5c70('0x18')]));require(_0x5c70('0x1b'))[_0x5c70('0x1c')](socket);var jayson=require(_0x5c70('0x1d'));var client=jayson[_0x5c70('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd78192,_0x37a296,_0x4941d0,_0x91471c){return new BPromise(function(_0x262f2e,_0x10ac7c){var _0x1ae873=_0x91471c||client;return _0x1ae873[_0x5c70('0x1f')](_0xd78192,_0x4941d0)[_0x5c70('0x20')](function(_0x4584f7){logger['info'](_0x5c70('0x21'),_0x37a296,'request\x20sent');logger[_0x5c70('0x22')](_0x5c70('0x23'),_0x37a296,_0x5c70('0x24'),JSON[_0x5c70('0x25')](_0x4584f7));if(_0x4584f7[_0x5c70('0x26')]){if(_0x4584f7['error']['code']===0x1f4){logger[_0x5c70('0x26')](_0x5c70('0x21'),_0x37a296,_0x4584f7[_0x5c70('0x26')]['message']);return _0x10ac7c(_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);}logger[_0x5c70('0x26')](_0x5c70('0x21'),_0x37a296,_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);return _0x262f2e(_0x4584f7[_0x5c70('0x26')][_0x5c70('0x27')]);}else{logger[_0x5c70('0x28')](_0x5c70('0x21'),_0x37a296,'request\x20sent');_0x262f2e(_0x4584f7[_0x5c70('0x29')]['message']);}})['catch'](function(_0x14d467){logger[_0x5c70('0x26')]('ChatQueue,\x20%s,\x20%s',_0x37a296,_0x14d467);_0x10ac7c(_0x14d467);});});}function respondWithStatusCode(_0x19d6e3,_0x3f0369){_0x3f0369=_0x3f0369||0xcc;return function(_0xfbc354){if(_0xfbc354){return _0x19d6e3[_0x5c70('0x2a')](_0x3f0369);}return _0x19d6e3[_0x5c70('0x2b')](_0x3f0369)[_0x5c70('0x2c')]();};}function respondWithResult(_0x59814c,_0x2ed737){_0x2ed737=_0x2ed737||0xc8;return function(_0x58c711){if(_0x58c711){return _0x59814c[_0x5c70('0x2b')](_0x2ed737)[_0x5c70('0x2d')](_0x58c711);}};}function respondWithFilteredResult(_0x3dc80b,_0x2f1d2d){return function(_0xebc58f){if(_0xebc58f){var _0x58c242=typeof _0x2f1d2d[_0x5c70('0x2e')]===_0x5c70('0x2f')&&typeof _0x2f1d2d[_0x5c70('0x30')]===_0x5c70('0x2f');var _0xf7f468=_0xebc58f[_0x5c70('0x31')];var _0x86615=_0x58c242?0x0:_0x2f1d2d[_0x5c70('0x2e')];var _0x45a7fb=_0x58c242?_0xebc58f[_0x5c70('0x31')]:_0x2f1d2d[_0x5c70('0x2e')]+_0x2f1d2d['limit'];var _0x59716b;if(_0x45a7fb>=_0xf7f468){_0x45a7fb=_0xf7f468;_0x59716b=0xc8;}else{_0x59716b=0xce;}_0x3dc80b[_0x5c70('0x2b')](_0x59716b);return _0x3dc80b[_0x5c70('0x32')]('Content-Range',_0x86615+'-'+_0x45a7fb+'/'+_0xf7f468)[_0x5c70('0x2d')](_0xebc58f);}return null;};}function patchUpdates(_0x14aeab){return function(_0xdb11a0){try{jsonpatch[_0x5c70('0x33')](_0xdb11a0,_0x14aeab,!![]);}catch(_0x2d1617){return BPromise[_0x5c70('0x34')](_0x2d1617);}return _0xdb11a0[_0x5c70('0x35')]();};}function saveUpdates(_0x479207,_0x5677af){return function(_0x4cff9a){if(_0x4cff9a){return _0x4cff9a[_0x5c70('0x36')](_0x479207)[_0x5c70('0x20')](function(_0x58d9f1){return _0x58d9f1;});}return null;};}function removeEntity(_0x33632b,_0x3bdcb8){return function(_0x7a40ee){if(_0x7a40ee){return _0x7a40ee['destroy']()['then'](function(){var _0x71aec3=_0x7a40ee[_0x5c70('0x37')]({'plain':!![]});var _0x4563aa='ChatQueues';return db[_0x5c70('0x38')]['destroy']({'where':{'type':_0x4563aa,'resourceId':_0x71aec3['id']}})[_0x5c70('0x20')](function(){return _0x7a40ee;});})[_0x5c70('0x20')](function(){_0x33632b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2080dd,_0x3579a8){return function(_0x1e1837){if(!_0x1e1837){_0x2080dd[_0x5c70('0x2a')](0x194);}return _0x1e1837;};}function handleError(_0x513a88,_0x14c058){_0x14c058=_0x14c058||0x1f4;return function(_0x4e58c7){logger['error'](_0x4e58c7[_0x5c70('0x39')]);if(_0x4e58c7[_0x5c70('0x3a')]){delete _0x4e58c7[_0x5c70('0x3a')];}_0x513a88[_0x5c70('0x2b')](_0x14c058)[_0x5c70('0x3b')](_0x4e58c7);};}exports['index']=function(_0x74690,_0x3ab51e){var _0x116efe={},_0x37b415={},_0x38eacb={'count':0x0,'rows':[]};var _0x47e762=_[_0x5c70('0x3c')](db[_0x5c70('0x3d')]['rawAttributes'],function(_0x3e3cfd){return{'name':_0x3e3cfd[_0x5c70('0x3e')],'type':_0x3e3cfd[_0x5c70('0x3f')][_0x5c70('0x40')]};});_0x37b415[_0x5c70('0x41')]=_['map'](_0x47e762,_0x5c70('0x3a'));_0x37b415[_0x5c70('0x42')]=_['keys'](_0x74690[_0x5c70('0x42')]);_0x37b415[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x37b415[_0x5c70('0x41')],_0x37b415[_0x5c70('0x42')]);_0x116efe[_0x5c70('0x45')]=_['intersection'](_0x37b415[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x74690[_0x5c70('0x42')][_0x5c70('0x46')]));_0x116efe['attributes']=_0x116efe['attributes'][_0x5c70('0x47')]?_0x116efe[_0x5c70('0x45')]:_0x37b415[_0x5c70('0x41')];if(!_0x74690[_0x5c70('0x42')][_0x5c70('0x48')]('nolimit')){_0x116efe[_0x5c70('0x30')]=qs[_0x5c70('0x30')](_0x74690[_0x5c70('0x42')][_0x5c70('0x30')]);_0x116efe[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0x74690[_0x5c70('0x42')][_0x5c70('0x2e')]);}_0x116efe[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0x74690[_0x5c70('0x42')][_0x5c70('0x4a')]);_0x116efe[_0x5c70('0x4b')]=qs[_0x5c70('0x43')](_[_0x5c70('0x4c')](_0x74690['query'],_0x37b415['filters']),_0x47e762);if(_0x74690[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x116efe[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x116efe[_0x5c70('0x4b')],{'$or':_['map'](_0x47e762,function(_0x326ac9){if(_0x326ac9['type']!=='VIRTUAL'){var _0x1376de={};_0x1376de[_0x326ac9[_0x5c70('0x3a')]]={'$like':'%'+_0x74690[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x1376de;}})});}_0x116efe=_['merge']({},_0x116efe,_0x74690[_0x5c70('0x4f')]);var _0x4e4b5f={'where':_0x116efe[_0x5c70('0x4b')]};return db[_0x5c70('0x3d')][_0x5c70('0x31')](_0x4e4b5f)[_0x5c70('0x20')](function(_0x384c58){_0x38eacb[_0x5c70('0x31')]=_0x384c58;if(_0x74690[_0x5c70('0x42')]['includeAll']){_0x116efe[_0x5c70('0x50')]=[{'all':!![]}];}return db[_0x5c70('0x3d')][_0x5c70('0x51')](_0x116efe);})[_0x5c70('0x20')](function(_0x2b9964){_0x38eacb[_0x5c70('0x52')]=_0x2b9964;return _0x38eacb;})[_0x5c70('0x20')](respondWithFilteredResult(_0x3ab51e,_0x116efe))[_0x5c70('0x53')](handleError(_0x3ab51e,null));};exports[_0x5c70('0x54')]=function(_0x1b5ef3,_0xc15f87){var _0x2df318={'raw':!![],'where':{'id':_0x1b5ef3[_0x5c70('0x55')]['id']}},_0xc440d={};_0xc440d[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x3d')][_0x5c70('0x57')]);_0xc440d[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x1b5ef3[_0x5c70('0x42')]);_0xc440d['filters']=_[_0x5c70('0x44')](_0xc440d[_0x5c70('0x41')],_0xc440d[_0x5c70('0x42')]);_0x2df318[_0x5c70('0x45')]=_[_0x5c70('0x44')](_0xc440d['model'],qs[_0x5c70('0x46')](_0x1b5ef3[_0x5c70('0x42')][_0x5c70('0x46')]));_0x2df318[_0x5c70('0x45')]=_0x2df318[_0x5c70('0x45')][_0x5c70('0x47')]?_0x2df318[_0x5c70('0x45')]:_0xc440d[_0x5c70('0x41')];if(_0x1b5ef3[_0x5c70('0x42')][_0x5c70('0x58')]){_0x2df318[_0x5c70('0x50')]=[{'all':!![]}];}_0x2df318=_[_0x5c70('0x4e')]({},_0x2df318,_0x1b5ef3[_0x5c70('0x4f')]);return db[_0x5c70('0x3d')][_0x5c70('0x59')](_0x2df318)[_0x5c70('0x20')](handleEntityNotFound(_0xc15f87,null))[_0x5c70('0x20')](respondWithResult(_0xc15f87,null))[_0x5c70('0x53')](handleError(_0xc15f87,null));};exports[_0x5c70('0x5a')]=function(_0x14114b,_0x433ff){return db[_0x5c70('0x3d')][_0x5c70('0x5a')](_0x14114b['body'],{})[_0x5c70('0x20')](function(_0x45eac1){var _0x45a595=_0x14114b[_0x5c70('0x5b')][_0x5c70('0x37')]({'plain':!![]});if(!_0x45a595)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45a595['role']===_0x5c70('0x5b')){var _0x1c809d=_0x45eac1['get']({'plain':!![]});var _0x1aa1a4=_0x5c70('0x5c');return db[_0x5c70('0x5d')][_0x5c70('0x59')]({'where':{'name':_0x1aa1a4,'userProfileId':_0x45a595[_0x5c70('0x5e')]},'raw':!![]})['then'](function(_0x6edaa2){if(_0x6edaa2&&_0x6edaa2[_0x5c70('0x5f')]===0x0){return db[_0x5c70('0x38')][_0x5c70('0x5a')]({'name':_0x1c809d[_0x5c70('0x3a')],'resourceId':_0x1c809d['id'],'type':_0x6edaa2['name'],'sectionId':_0x6edaa2['id']},{})[_0x5c70('0x20')](function(){return _0x45eac1;});}else{return _0x45eac1;}})[_0x5c70('0x53')](function(_0x969120){logger['error'](_0x5c70('0x60'),_0x969120);throw _0x969120;});}return _0x45eac1;})[_0x5c70('0x20')](respondWithResult(_0x433ff,0xc9))[_0x5c70('0x53')](handleError(_0x433ff,null));};exports[_0x5c70('0x36')]=function(_0x2ebfb6,_0xb9c0e9){if(_0x2ebfb6[_0x5c70('0x61')]['id']){delete _0x2ebfb6['body']['id'];}return db['ChatQueue'][_0x5c70('0x59')]({'where':{'id':_0x2ebfb6[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0xb9c0e9,null))[_0x5c70('0x20')](saveUpdates(_0x2ebfb6[_0x5c70('0x61')],null))[_0x5c70('0x20')](respondWithResult(_0xb9c0e9,null))[_0x5c70('0x53')](handleError(_0xb9c0e9,null));};exports[_0x5c70('0x62')]=function(_0x5f3ff6,_0x1499d4){return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x5f3ff6[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0x1499d4,null))[_0x5c70('0x20')](removeEntity(_0x1499d4,null))[_0x5c70('0x53')](handleError(_0x1499d4,null));};exports[_0x5c70('0x63')]=function(_0x42b764,_0x1885c7){return db[_0x5c70('0x3d')][_0x5c70('0x63')]()[_0x5c70('0x20')](respondWithResult(_0x1885c7,null))[_0x5c70('0x53')](handleError(_0x1885c7,null));};exports[_0x5c70('0x64')]=function(_0x151fd8,_0x4a6e32,_0x22bd18){var _0x2de336={'raw':!![],'where':{}},_0x23c038={},_0x2a0c14;return db[_0x5c70('0x3d')][_0x5c70('0x65')]({'where':{'id':_0x151fd8[_0x5c70('0x55')]['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x4a6e32,null))[_0x5c70('0x20')](function(_0x3dca00){if(_0x3dca00){_0x2a0c14=_0x3dca00[_0x5c70('0x37')]({'plain':!![]});_0x23c038[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x66')]['rawAttributes']);_0x23c038[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x151fd8['query']);_0x23c038[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x23c038[_0x5c70('0x41')],_0x23c038['query']);_0x2de336['attributes']=_['intersection'](_0x23c038[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x151fd8[_0x5c70('0x42')][_0x5c70('0x46')]));_0x2de336[_0x5c70('0x45')]=_0x2de336[_0x5c70('0x45')]['length']?_0x2de336['attributes']:_0x23c038[_0x5c70('0x41')];if(!_0x151fd8[_0x5c70('0x42')][_0x5c70('0x48')]('nolimit')){_0x2de336[_0x5c70('0x30')]=qs['limit'](_0x151fd8[_0x5c70('0x42')]['limit']);_0x2de336['offset']=qs[_0x5c70('0x2e')](_0x151fd8['query'][_0x5c70('0x2e')]);}_0x2de336['order']=qs[_0x5c70('0x4a')](_0x151fd8[_0x5c70('0x42')]['sort']);_0x2de336['where']=qs[_0x5c70('0x43')](_[_0x5c70('0x4c')](_0x151fd8[_0x5c70('0x42')],_0x23c038[_0x5c70('0x43')]));_0x2de336[_0x5c70('0x4b')][_0x5c70('0x67')]=_0x3dca00['id'];if(_0x151fd8[_0x5c70('0x42')]['filter']){_0x2de336[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x2de336['where'],{'$or':_[_0x5c70('0x3c')](_0x2de336[_0x5c70('0x45')],function(_0x18d2a1){var _0x42dc97={};_0x42dc97[_0x18d2a1]={'$like':'%'+_0x151fd8[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x42dc97;})});}_0x2de336=_[_0x5c70('0x4e')]({},_0x2de336,_0x151fd8[_0x5c70('0x4f')]);return db[_0x5c70('0x66')]['findAll'](_0x2de336);}})[_0x5c70('0x20')](function(_0x57308c){if(_0x57308c){return db[_0x5c70('0x68')][_0x5c70('0x69')]({'where':{'id':_[_0x5c70('0x3c')](_0x57308c,'UserId'),'role':_0x5c70('0x6a')},'attributes':['id',_0x5c70('0x3a'),_0x5c70('0x6b'),_0x5c70('0x6c'),'createdAt']});}})[_0x5c70('0x20')](function(_0x50ee6d){if(_0x50ee6d){return{'count':_0x50ee6d['count'],'rows':_[_0x5c70('0x3c')](_0x50ee6d['rows'],function(_0xbbda4f){return{'membername':_0xbbda4f[_0x5c70('0x3a')],'UserId':_0xbbda4f['id'],'queue_name':_0x2a0c14['name'],'ChatQueueId':_0x2a0c14['id'],'interface':util[_0x5c70('0x6d')]('%s/%s','SIP',_0xbbda4f['name']),'penalty':0x0,'paused':_0xbbda4f[_0x5c70('0x6b')],'createdAt':_0xbbda4f['createdAt'],'updatedAt':_0xbbda4f[_0x5c70('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c70('0x20')](respondWithFilteredResult(_0x4a6e32,_0x2de336))[_0x5c70('0x53')](handleError(_0x4a6e32,null));};exports['getTeams']=function(_0xbffeec,_0x221a5e,_0x468800){var _0x2b8d8b={};var _0x49e3df={};var _0x2b9525;var _0x4f456d;return db[_0x5c70('0x3d')]['findOne']({'where':{'id':_0xbffeec['params']['id']}})['then'](handleEntityNotFound(_0x221a5e,null))[_0x5c70('0x20')](function(_0x368c4b){if(_0x368c4b){_0x2b9525=_0x368c4b;_0x49e3df[_0x5c70('0x41')]=_[_0x5c70('0x56')](db[_0x5c70('0x6e')][_0x5c70('0x57')]);_0x49e3df[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0xbffeec[_0x5c70('0x42')]);_0x49e3df[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x49e3df[_0x5c70('0x41')],_0x49e3df['query']);_0x2b8d8b['attributes']=_[_0x5c70('0x44')](_0x49e3df['model'],qs[_0x5c70('0x46')](_0xbffeec['query']['fields']));_0x2b8d8b[_0x5c70('0x45')]=_0x2b8d8b[_0x5c70('0x45')][_0x5c70('0x47')]?_0x2b8d8b[_0x5c70('0x45')]:_0x49e3df[_0x5c70('0x41')];_0x2b8d8b[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x4a')]);_0x2b8d8b[_0x5c70('0x4b')]=qs[_0x5c70('0x43')](_['pick'](_0xbffeec['query'],_0x49e3df[_0x5c70('0x43')]));if(_0xbffeec[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x2b8d8b[_0x5c70('0x4b')]=_[_0x5c70('0x4e')](_0x2b8d8b[_0x5c70('0x4b')],{'$or':_[_0x5c70('0x3c')](_0x2b8d8b['attributes'],function(_0x30d879){var _0x19f979={};_0x19f979[_0x30d879]={'$like':'%'+_0xbffeec[_0x5c70('0x42')]['filter']+'%'};return _0x19f979;})});}_0x2b8d8b=_['merge']({},_0x2b8d8b,_0xbffeec[_0x5c70('0x4f')]);return _0x2b9525[_0x5c70('0x6f')](_0x2b8d8b);}})[_0x5c70('0x20')](function(_0x488934){if(_0x488934){_0x4f456d=_0x488934['length'];if(!_0xbffeec[_0x5c70('0x42')]['hasOwnProperty'](_0x5c70('0x70'))){_0x2b8d8b[_0x5c70('0x30')]=qs['limit'](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x30')]);_0x2b8d8b[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0xbffeec[_0x5c70('0x42')][_0x5c70('0x2e')]);}return _0x2b9525[_0x5c70('0x6f')](_0x2b8d8b);}})[_0x5c70('0x20')](function(_0x2cb0f7){if(_0x2cb0f7){return _0x2cb0f7?{'count':_0x4f456d,'rows':_0x2cb0f7}:null;}})[_0x5c70('0x20')](respondWithResult(_0x221a5e,null))[_0x5c70('0x53')](handleError(_0x221a5e,null));};exports['addTeams']=function(_0x19057b,_0x33373c,_0x4477c5){var _0x85a3fe=_0x19057b['body'][_0x5c70('0x71')];return db['Team'][_0x5c70('0x51')]({'where':{'id':_0x85a3fe},'attributes':['id'],'include':[{'model':db[_0x5c70('0x68')],'as':_0x5c70('0x72'),'attributes':['id',_0x5c70('0x3a'),'online',_0x5c70('0x73'),_0x5c70('0x74')],'raw':!![]}]})[_0x5c70('0x20')](function(_0x52f3a8){if(_0x52f3a8){var _0xcf4cfb=_['flatMap'](_0x52f3a8,function(_0xfe895e){var _0x4781dc=_0xfe895e[_0x5c70('0x37')]({'plain':!![]});return _0x4781dc[_0x5c70('0x72')];});return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x19057b['params']['id']}})[_0x5c70('0x20')](function(_0x1b5ec2){return db[_0x5c70('0x75')]['transaction'](function(_0x46dd30){return _0x1b5ec2['addTeams'](_0x85a3fe,{'transaction':_0x46dd30})[_0x5c70('0x20')](function(){return BPromise['each'](_0xcf4cfb,function(_0x1484b1){return db[_0x5c70('0x66')]['findOrCreate']({'where':{'UserId':_0x1484b1['id'],'ChatQueueId':_0x19057b[_0x5c70('0x55')]['id']},'transaction':_0x46dd30});});})['then'](function(){_0xcf4cfb[_0x5c70('0x76')](function(_0x546e2b){socket[_0x5c70('0x77')](_0x5c70('0x78'),{'UserId':_0x546e2b['id'],'ChatQueueId':_0x1b5ec2['id']});});});});});}})[_0x5c70('0x20')](respondWithStatusCode(_0x33373c,null))[_0x5c70('0x53')](handleError(_0x33373c,null));};exports[_0x5c70('0x79')]=function(_0x48fa9b,_0x2d4a61,_0x5d29bf){return db[_0x5c70('0x6e')][_0x5c70('0x51')]({'where':{'id':_0x48fa9b[_0x5c70('0x42')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5c70('0x68')],'as':_0x5c70('0x72'),'attributes':['id'],'raw':!![]}]})[_0x5c70('0x20')](handleEntityNotFound(_0x2d4a61,null))[_0x5c70('0x20')](function(_0x4604cf){var _0x108cfb=_[_0x5c70('0x3c')](_0x4604cf,'id');var _0x167265=[];var _0x3423fc=[];var _0x30e520=squel[_0x5c70('0x7a')]();_0x30e520[_0x5c70('0x7b')](_0x5c70('0x7c'))['from'](_0x5c70('0x7d'),'tq')[_0x5c70('0x7e')](_0x5c70('0x7f'),'ut',_0x5c70('0x80'))[_0x5c70('0x4b')](_0x5c70('0x81'),_0x48fa9b[_0x5c70('0x55')]['id']);for(var _0xcc483d=0x0;_0xcc483d<_0x4604cf[_0x5c70('0x47')];_0xcc483d+=0x1){let _0x36d8a8=_0x4604cf[_0xcc483d];for(var _0x2b005f=0x0;_0x2b005f<_0x36d8a8[_0x5c70('0x72')][_0x5c70('0x47')];_0x2b005f+=0x1){let _0x405286=_0x36d8a8['Agents'][_0x2b005f];var _0x32cf29=_0x30e520['clone']();_0x32cf29[_0x5c70('0x4b')]('ut.UserId\x20=\x20?',_0x405286['id']);_0x3423fc[_0x5c70('0x82')](db['sequelize'][_0x5c70('0x42')](_0x32cf29[_0x5c70('0x83')](),{'type':db[_0x5c70('0x75')][_0x5c70('0x84')][_0x5c70('0x85')]})['then'](function(_0x2d5490){if(_0x2d5490[_0x5c70('0x47')]===0x1){return _0x405286['id'];}else{var _0x2a0214=_['every'](_['map'](_0x2d5490,_0x5c70('0x86')),function(_0x302d56){return _[_0x5c70('0x87')](_0x108cfb,_0x302d56);});if(_0x2a0214){return _0x405286['id'];}}}));}}return BPromise['all'](_0x3423fc)['then'](function(_0x56d350){_0x167265=_(_0x167265)[_0x5c70('0x88')](_0x56d350)[_0x5c70('0x89')]()['value']();return db[_0x5c70('0x3d')][_0x5c70('0x59')]({'where':{'id':_0x48fa9b['params']['id']}})[_0x5c70('0x20')](function(_0x2b6e56){return db[_0x5c70('0x75')][_0x5c70('0x8a')](function(_0x39e74c){return _0x2b6e56[_0x5c70('0x79')](_0x48fa9b[_0x5c70('0x42')]['ids'],{'transaction':_0x39e74c})[_0x5c70('0x20')](function(){if(!_['isEmpty'](_0x167265)){return _0x2b6e56[_0x5c70('0x8b')](_0x167265,{'transaction':_0x39e74c});}})[_0x5c70('0x20')](function(){_0x167265[_0x5c70('0x76')](function(_0x2200ef){socket[_0x5c70('0x77')](_0x5c70('0x8c'),{'UserId':_0x2200ef,'ChatQueueId':_0x2b6e56['id']});});});});});});})[_0x5c70('0x20')](respondWithStatusCode(_0x2d4a61,null))[_0x5c70('0x53')](handleError(_0x2d4a61,null));};exports['addAgents']=function(_0xeb055b,_0x576521,_0x47ec4e){return db[_0x5c70('0x3d')][_0x5c70('0x59')]({'where':{'id':_0xeb055b['params']['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x576521,null))['then'](function(_0x472d78){if(_0x472d78){return _0x472d78[_0x5c70('0x8d')](_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')],_['omit'](_0xeb055b[_0x5c70('0x61')],['ids','id'])||{})[_0x5c70('0x8e')](function(_0x3b79a6){for(var _0x3b0bee=0x0;_0x3b0bee<_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')][_0x5c70('0x47')];_0x3b0bee+=0x1){socket[_0x5c70('0x77')](_0x5c70('0x78'),{'UserId':Number(_0xeb055b[_0x5c70('0x61')][_0x5c70('0x71')][_0x3b0bee]),'ChatQueueId':Number(_0xeb055b['params']['id'])});}return _0x3b79a6;});}})[_0x5c70('0x20')](respondWithResult(_0x576521,null))[_0x5c70('0x53')](handleError(_0x576521,null));};exports[_0x5c70('0x8b')]=function(_0x10e6d2,_0x59c818,_0x22f42){return db[_0x5c70('0x3d')]['find']({'where':{'id':_0x10e6d2[_0x5c70('0x55')]['id']}})['then'](handleEntityNotFound(_0x59c818,null))[_0x5c70('0x20')](function(_0x3968cb){if(_0x3968cb){return _0x3968cb[_0x5c70('0x8b')](_0x10e6d2['query'][_0x5c70('0x71')])[_0x5c70('0x20')](function(){if(_['isArray'](_0x10e6d2[_0x5c70('0x42')][_0x5c70('0x71')])){for(var _0xcf2faa=0x0;_0xcf2faa<_0x10e6d2['query'][_0x5c70('0x71')][_0x5c70('0x47')];_0xcf2faa+=0x1){socket['emit'](_0x5c70('0x8c'),{'UserId':Number(_0x10e6d2['query'][_0x5c70('0x71')][_0xcf2faa]),'ChatQueueId':Number(_0x10e6d2[_0x5c70('0x55')]['id'])});}}else{socket[_0x5c70('0x77')](_0x5c70('0x8c'),{'UserId':Number(_0x10e6d2['query'][_0x5c70('0x71')]),'ChatQueueId':Number(_0x10e6d2[_0x5c70('0x55')]['id'])});}});}})[_0x5c70('0x20')](respondWithStatusCode(_0x59c818,null))['catch'](handleError(_0x59c818,null));};exports[_0x5c70('0x8f')]=function(_0x5be402,_0x340c96,_0x1d5466){var _0x296230={};var _0x540533={};var _0x4df05c;var _0x42da8f;return db[_0x5c70('0x3d')][_0x5c70('0x65')]({'where':{'id':_0x5be402[_0x5c70('0x55')]['id']}})[_0x5c70('0x20')](handleEntityNotFound(_0x340c96,null))[_0x5c70('0x20')](function(_0x303fce){if(_0x303fce){_0x4df05c=_0x303fce;_0x540533[_0x5c70('0x41')]=_[_0x5c70('0x56')](db['User']['rawAttributes']);_0x540533[_0x5c70('0x42')]=_[_0x5c70('0x56')](_0x5be402['query']);_0x540533[_0x5c70('0x43')]=_[_0x5c70('0x44')](_0x540533[_0x5c70('0x41')],_0x540533[_0x5c70('0x42')]);_0x296230['attributes']=_[_0x5c70('0x44')](_0x540533[_0x5c70('0x41')],qs[_0x5c70('0x46')](_0x5be402[_0x5c70('0x42')][_0x5c70('0x46')]));_0x296230['attributes']=_0x296230['attributes'][_0x5c70('0x47')]?_0x296230[_0x5c70('0x45')]:_0x540533[_0x5c70('0x41')];_0x296230[_0x5c70('0x49')]=qs[_0x5c70('0x4a')](_0x5be402['query'][_0x5c70('0x4a')]);_0x296230['where']=qs['filters'](_[_0x5c70('0x4c')](_0x5be402[_0x5c70('0x42')],_0x540533[_0x5c70('0x43')]));if(_0x5be402[_0x5c70('0x42')][_0x5c70('0x4d')]){_0x296230['where']=_[_0x5c70('0x4e')](_0x296230[_0x5c70('0x4b')],{'$or':_[_0x5c70('0x3c')](_0x296230[_0x5c70('0x45')],function(_0x4d7452){var _0x24812d={};_0x24812d[_0x4d7452]={'$like':'%'+_0x5be402[_0x5c70('0x42')][_0x5c70('0x4d')]+'%'};return _0x24812d;})});}_0x296230=_['merge']({},_0x296230,_0x5be402[_0x5c70('0x4f')]);return _0x4df05c['getAgents'](_0x296230);}})[_0x5c70('0x20')](function(_0x413904){if(_0x413904){_0x42da8f=_0x413904[_0x5c70('0x47')];if(!_0x5be402['query']['hasOwnProperty']('nolimit')){_0x296230[_0x5c70('0x30')]=qs[_0x5c70('0x30')](_0x5be402['query'][_0x5c70('0x30')]);_0x296230[_0x5c70('0x2e')]=qs[_0x5c70('0x2e')](_0x5be402['query'][_0x5c70('0x2e')]);}return _0x4df05c[_0x5c70('0x8f')](_0x296230);}})[_0x5c70('0x20')](function(_0x597688){if(_0x597688){return _0x597688?{'count':_0x42da8f,'rows':_0x597688}:null;}})[_0x5c70('0x20')](respondWithResult(_0x340c96,null))['catch'](handleError(_0x340c96,null));};
\ No newline at end of file
index 7bb082f..d52ef9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6122=['exports','events','ChatQueue','setMaxListeners','save','update','emit','hook'];(function(_0x21a51d,_0x544088){var _0x145a1b=function(_0x240c51){while(--_0x240c51){_0x21a51d['push'](_0x21a51d['shift']());}};_0x145a1b(++_0x544088);}(_0x6122,0xb9));var _0x2612=function(_0x482b06,_0x475ea9){_0x482b06=_0x482b06-0x0;var _0x404a0a=_0x6122[_0x482b06];return _0x404a0a;};'use strict';var EventEmitter=require(_0x2612('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x2612('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x2612('0x2')](0x0);var events={'afterCreate':_0x2612('0x3'),'afterUpdate':_0x2612('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3275ab){return function(_0x3a1ba1,_0x4b8456,_0x306f01){ChatQueueEvents['emit'](_0x3275ab+':'+_0x3a1ba1['id'],_0x3a1ba1);ChatQueueEvents[_0x2612('0x5')](_0x3275ab,_0x3a1ba1);_0x306f01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x2612('0x6')](e,emitEvent(event));}}module[_0x2612('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x0ad2=['setMaxListeners','save','remove','hasOwnProperty','exports','events','../../mysqldb','ChatQueue'];(function(_0x48a6b7,_0x4628d5){var _0x374b67=function(_0x112fe7){while(--_0x112fe7){_0x48a6b7['push'](_0x48a6b7['shift']());}};_0x374b67(++_0x4628d5);}(_0x0ad2,0xdd));var _0x20ad=function(_0x38832e,_0x2cc705){_0x38832e=_0x38832e-0x0;var _0x2be939=_0x0ad2[_0x38832e];return _0x2be939;};'use strict';var EventEmitter=require(_0x20ad('0x0'));var ChatQueue=require(_0x20ad('0x1'))['db'][_0x20ad('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x20ad('0x3')](0x0);var events={'afterCreate':_0x20ad('0x4'),'afterUpdate':'update','afterDestroy':_0x20ad('0x5')};function emitEvent(_0x51f5a9){return function(_0x23fb13,_0x1a1439,_0x56b45b){ChatQueueEvents['emit'](_0x51f5a9+':'+_0x23fb13['id'],_0x23fb13);ChatQueueEvents['emit'](_0x51f5a9,_0x23fb13);_0x56b45b(null);};}for(var e in events){if(events[_0x20ad('0x6')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x20ad('0x7')]=ChatQueueEvents;
\ No newline at end of file
index 2e48ec1..c1411df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8206=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','request-promise','./chatQueue.attributes','exports'];(function(_0x58af0b,_0x52fbf5){var _0x210c68=function(_0x136bdc){while(--_0x136bdc){_0x58af0b['push'](_0x58af0b['shift']());}};_0x210c68(++_0x52fbf5);}(_0x8206,0x1ce));var _0x6820=function(_0x5d76ad,_0x26158d){_0x5d76ad=_0x5d76ad-0x0;var _0x4f7937=_0x8206[_0x5d76ad];return _0x4f7937;};'use strict';var _=require(_0x6820('0x0'));var util=require(_0x6820('0x1'));var logger=require(_0x6820('0x2'))(_0x6820('0x3'));var moment=require(_0x6820('0x4'));var BPromise=require('bluebird');var rp=require(_0x6820('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6820('0x6'));module[_0x6820('0x7')]=function(_0x6d97d1,_0x4b61a6){return _0x6d97d1['define'](_0x6820('0x8'),attributes,{'tableName':_0x6820('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbd23=['../../config/environment','./chatQueue.attributes','chat_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xf529ae,_0x5e330f){var _0x147546=function(_0x19a7bc){while(--_0x19a7bc){_0xf529ae['push'](_0xf529ae['shift']());}};_0x147546(++_0x5e330f);}(_0xbd23,0xcb));var _0x3bd2=function(_0x3a2d7d,_0xb04dfc){_0x3a2d7d=_0x3a2d7d-0x0;var _0x2b6e0a=_0xbd23[_0x3a2d7d];return _0x2b6e0a;};'use strict';var _=require(_0x3bd2('0x0'));var util=require(_0x3bd2('0x1'));var logger=require(_0x3bd2('0x2'))(_0x3bd2('0x3'));var moment=require(_0x3bd2('0x4'));var BPromise=require(_0x3bd2('0x5'));var rp=require(_0x3bd2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3bd2('0x7'));var attributes=require(_0x3bd2('0x8'));module['exports']=function(_0x23a6c5,_0x314194){return _0x23a6c5['define']('ChatQueue',attributes,{'tableName':_0x3bd2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30ecb9e..062d41e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63ef=['error','code','message','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','model','map','stringify','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63ef,0x11a));var _0xf63e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x63ef[_0x34bc30];return _0x5706de;};'use strict';var _=require(_0xf63e('0x0'));var util=require(_0xf63e('0x1'));var moment=require(_0xf63e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf63e('0x3'));var fs=require('fs');var Redis=require(_0xf63e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf63e('0x5'))(_0xf63e('0x6'));var config=require('../../config/environment');var jayson=require(_0xf63e('0x7'));var client=jayson[_0xf63e('0x8')]['http']({'port':0x232a});config[_0xf63e('0x9')]=_[_0xf63e('0xa')](config[_0xf63e('0x9')],{'host':_0xf63e('0xb'),'port':0x18eb});var socket=require(_0xf63e('0xc'))(new Redis(config[_0xf63e('0x9')]));require(_0xf63e('0xd'))[_0xf63e('0xe')](socket);function respondWithRpcPromise(_0x29f321,_0xe8f9f9,_0x237479){return new BPromise(function(_0x450c6c,_0x2dac2d){return client[_0xf63e('0xf')](_0x29f321,_0x237479)[_0xf63e('0x10')](function(_0x485524){logger[_0xf63e('0x11')](_0xf63e('0x12'),_0xe8f9f9,_0xf63e('0x13'));logger[_0xf63e('0x14')](_0xf63e('0x15'),_0xe8f9f9,_0xf63e('0x13'),JSON['stringify'](_0x485524));if(_0x485524[_0xf63e('0x16')]){if(_0x485524[_0xf63e('0x16')][_0xf63e('0x17')]===0x1f4){logger['error'](_0xf63e('0x12'),_0xe8f9f9,_0x485524['error'][_0xf63e('0x18')]);return _0x2dac2d(_0x485524['error'][_0xf63e('0x18')]);}logger[_0xf63e('0x16')](_0xf63e('0x12'),_0xe8f9f9,_0x485524['error'][_0xf63e('0x18')]);return _0x450c6c(_0x485524[_0xf63e('0x16')]['message']);}else{logger[_0xf63e('0x11')](_0xf63e('0x12'),_0xe8f9f9,_0xf63e('0x13'));_0x450c6c(_0x485524['result'][_0xf63e('0x18')]);}})[_0xf63e('0x19')](function(_0x2a1726){logger[_0xf63e('0x16')](_0xf63e('0x12'),_0xe8f9f9,_0x2a1726);_0x2dac2d(_0x2a1726);});});}exports[_0xf63e('0x1a')]=function(_0x71d83e){var _0xdcaaba=this;return new Promise(function(_0x3c2a9a,_0x35b095){return db[_0xf63e('0x1b')]['findAll']({'raw':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e[_0xf63e('0x1c')][_0xf63e('0x1d')]===undefined?!![]:![]:!![],'where':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e['options'][_0xf63e('0x1e')]||null:null,'attributes':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e[_0xf63e('0x1c')][_0xf63e('0x1f')]||null:null,'limit':_0x71d83e[_0xf63e('0x1c')]?_0x71d83e['options'][_0xf63e('0x20')]||null:null,'include':_0x71d83e['options']?_0x71d83e['options'][_0xf63e('0x21')]?_['map'](_0x71d83e['options'][_0xf63e('0x21')],function(_0x55c699){return{'model':db[_0x55c699[_0xf63e('0x22')]],'as':_0x55c699['as'],'attributes':_0x55c699[_0xf63e('0x1f')],'include':_0x55c699['include']?_[_0xf63e('0x23')](_0x55c699[_0xf63e('0x21')],function(_0x17a211){return{'model':db[_0x17a211[_0xf63e('0x22')]],'as':_0x17a211['as'],'attributes':_0x17a211[_0xf63e('0x1f')],'include':_0x17a211[_0xf63e('0x21')]?_[_0xf63e('0x23')](_0x17a211['include'],function(_0x30f5a3){return{'model':db[_0x30f5a3[_0xf63e('0x22')]],'as':_0x30f5a3['as'],'attributes':_0x30f5a3[_0xf63e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf63e('0x10')](function(_0x3ad882){logger['info']('GetChatQueue',_0x71d83e);logger[_0xf63e('0x14')](_0xf63e('0x1a'),_0x71d83e,JSON[_0xf63e('0x24')](_0x3ad882));_0x3c2a9a(_0x3ad882);})[_0xf63e('0x19')](function(_0x30a397){logger['error'](_0xf63e('0x1a'),_0x30a397[_0xf63e('0x18')],_0x71d83e);_0x35b095(_0xdcaaba['error'](0x1f4,_0x30a397[_0xf63e('0x18')]));});});};exports[_0xf63e('0x25')]=function(_0x2b04eb){var _0x201cea=this;return new Promise(function(_0x26ce8f,_0x37c96c){return db['ChatQueue']['find']({'raw':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb[_0xf63e('0x1c')][_0xf63e('0x1d')]===undefined?!![]:![]:!![],'where':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb[_0xf63e('0x1c')]['where']||null:null,'attributes':_0x2b04eb['options']?_0x2b04eb[_0xf63e('0x1c')][_0xf63e('0x1f')]||null:null,'include':_0x2b04eb[_0xf63e('0x1c')]?_0x2b04eb['options']['include']?_[_0xf63e('0x23')](_0x2b04eb['options'][_0xf63e('0x21')],function(_0x427d50){return{'model':db[_0x427d50[_0xf63e('0x22')]],'as':_0x427d50['as'],'attributes':_0x427d50[_0xf63e('0x1f')],'include':_0x427d50['include']?_[_0xf63e('0x23')](_0x427d50['include'],function(_0x279659){return{'model':db[_0x279659[_0xf63e('0x22')]],'as':_0x279659['as'],'attributes':_0x279659[_0xf63e('0x1f')],'include':_0x279659['include']?_[_0xf63e('0x23')](_0x279659[_0xf63e('0x21')],function(_0x34a659){return{'model':db[_0x34a659[_0xf63e('0x22')]],'as':_0x34a659['as'],'attributes':_0x34a659['attributes']};}):[]};}):[]};}):[]:[]})[_0xf63e('0x10')](function(_0x5cdf03){logger['info'](_0xf63e('0x25'),_0x2b04eb);logger['debug'](_0xf63e('0x25'),_0x2b04eb,JSON[_0xf63e('0x24')](_0x5cdf03));_0x26ce8f(_0x5cdf03);})['catch'](function(_0x5cffb4){logger['error'](_0xf63e('0x25'),_0x5cffb4[_0xf63e('0x18')],_0x2b04eb);_0x37c96c(_0x201cea[_0xf63e('0x16')](0x1f4,_0x5cffb4[_0xf63e('0x18')]));});});};
\ No newline at end of file
+var _0xe1e3=['util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','stringify','code','error','ChatQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model','ShowChatQueue','raw','lodash'];(function(_0x16d523,_0x21b346){var _0x511b64=function(_0x47d6f1){while(--_0x47d6f1){_0x16d523['push'](_0x16d523['shift']());}};_0x511b64(++_0x21b346);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x5deccc,_0x4f82b0){_0x5deccc=_0x5deccc-0x0;var _0x31d90f=_0xe1e3[_0x5deccc];return _0x31d90f;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});config['redis']=_[_0x3e1e('0xa')](config[_0x3e1e('0xb')],{'host':_0x3e1e('0xc'),'port':0x18eb});var socket=require(_0x3e1e('0xd'))(new Redis(config[_0x3e1e('0xb')]));require(_0x3e1e('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c4c25,_0x5060e8,_0x31d205){return new BPromise(function(_0x5b0df8,_0x349460){return client[_0x3e1e('0xf')](_0x5c4c25,_0x31d205)[_0x3e1e('0x10')](function(_0x594c59){logger[_0x3e1e('0x11')]('ChatQueue,\x20%s,\x20%s',_0x5060e8,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5060e8,'request\x20sent',JSON[_0x3e1e('0x12')](_0x594c59));if(_0x594c59['error']){if(_0x594c59['error'][_0x3e1e('0x13')]===0x1f4){logger[_0x3e1e('0x14')](_0x3e1e('0x15'),_0x5060e8,_0x594c59['error']['message']);return _0x349460(_0x594c59[_0x3e1e('0x14')][_0x3e1e('0x16')]);}logger['error'](_0x3e1e('0x15'),_0x5060e8,_0x594c59[_0x3e1e('0x14')]['message']);return _0x5b0df8(_0x594c59[_0x3e1e('0x14')]['message']);}else{logger[_0x3e1e('0x11')](_0x3e1e('0x15'),_0x5060e8,_0x3e1e('0x17'));_0x5b0df8(_0x594c59[_0x3e1e('0x18')][_0x3e1e('0x16')]);}})[_0x3e1e('0x19')](function(_0x569f49){logger['error']('ChatQueue,\x20%s,\x20%s',_0x5060e8,_0x569f49);_0x349460(_0x569f49);});});}exports[_0x3e1e('0x1a')]=function(_0x30acbf){var _0xa3e99c=this;return new Promise(function(_0x57c660,_0x1c5acd){return db['ChatQueue'][_0x3e1e('0x1b')]({'raw':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x1d')]||null:null,'attributes':_0x30acbf['options']?_0x30acbf['options'][_0x3e1e('0x1e')]||null:null,'limit':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf['options'][_0x3e1e('0x1f')]||null:null,'include':_0x30acbf[_0x3e1e('0x1c')]?_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x30acbf[_0x3e1e('0x1c')][_0x3e1e('0x20')],function(_0x21c898){return{'model':db[_0x21c898['model']],'as':_0x21c898['as'],'attributes':_0x21c898['attributes'],'include':_0x21c898[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x21c898['include'],function(_0x4be84e){return{'model':db[_0x4be84e['model']],'as':_0x4be84e['as'],'attributes':_0x4be84e[_0x3e1e('0x1e')],'include':_0x4be84e[_0x3e1e('0x20')]?_['map'](_0x4be84e[_0x3e1e('0x20')],function(_0x5ac814){return{'model':db[_0x5ac814[_0x3e1e('0x22')]],'as':_0x5ac814['as'],'attributes':_0x5ac814[_0x3e1e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43e029){logger[_0x3e1e('0x11')](_0x3e1e('0x1a'),_0x30acbf);logger['debug'](_0x3e1e('0x1a'),_0x30acbf,JSON['stringify'](_0x43e029));_0x57c660(_0x43e029);})['catch'](function(_0x494c75){logger[_0x3e1e('0x14')]('GetChatQueue',_0x494c75['message'],_0x30acbf);_0x1c5acd(_0xa3e99c[_0x3e1e('0x14')](0x1f4,_0x494c75[_0x3e1e('0x16')]));});});};exports[_0x3e1e('0x23')]=function(_0x233b18){var _0xc9762c=this;return new Promise(function(_0x54df5a,_0x5522ba){return db['ChatQueue']['find']({'raw':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x24')]===undefined?!![]:![]:!![],'where':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x1d')]||null:null,'attributes':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')]['attributes']||null:null,'include':_0x233b18[_0x3e1e('0x1c')]?_0x233b18[_0x3e1e('0x1c')]['include']?_[_0x3e1e('0x21')](_0x233b18[_0x3e1e('0x1c')][_0x3e1e('0x20')],function(_0xd6300b){return{'model':db[_0xd6300b['model']],'as':_0xd6300b['as'],'attributes':_0xd6300b['attributes'],'include':_0xd6300b[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0xd6300b['include'],function(_0x266958){return{'model':db[_0x266958[_0x3e1e('0x22')]],'as':_0x266958['as'],'attributes':_0x266958['attributes'],'include':_0x266958[_0x3e1e('0x20')]?_[_0x3e1e('0x21')](_0x266958[_0x3e1e('0x20')],function(_0x3e4eb1){return{'model':db[_0x3e4eb1[_0x3e1e('0x22')]],'as':_0x3e4eb1['as'],'attributes':_0x3e4eb1['attributes']};}):[]};}):[]};}):[]:[]})[_0x3e1e('0x10')](function(_0x42556a){logger[_0x3e1e('0x11')](_0x3e1e('0x23'),_0x233b18);logger['debug'](_0x3e1e('0x23'),_0x233b18,JSON[_0x3e1e('0x12')](_0x42556a));_0x54df5a(_0x42556a);})[_0x3e1e('0x19')](function(_0xfc4f2a){logger[_0x3e1e('0x14')](_0x3e1e('0x23'),_0xfc4f2a[_0x3e1e('0x16')],_0x233b18);_0x5522ba(_0xc9762c['error'](0x1f4,_0xfc4f2a[_0x3e1e('0x16')]));});});};
\ No newline at end of file
index 27bae2c..5960016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a9a=['update','register','chatQueue:','save'];(function(_0x5d33da,_0x277ad4){var _0xfaa7e0=function(_0x465286){while(--_0x465286){_0x5d33da['push'](_0x5d33da['shift']());}};_0xfaa7e0(++_0x277ad4);}(_0x0a9a,0x183));var _0xa0a9=function(_0x3d2df8,_0x4104b0){_0x3d2df8=_0x3d2df8-0x0;var _0x4e3710=_0x0a9a[_0x3d2df8];return _0x4e3710;};'use strict';var ChatQueueEvents=require('./chatQueue.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(){ChatQueueEvents['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);ChatQueueEvents['on'](_0x2b2eb4,_0x520f42);}};
\ No newline at end of file
+var _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x1c3fd7,_0x5d6f7a){var _0x1649ca=function(_0x2b3b17){while(--_0x2b3b17){_0x1c3fd7['push'](_0x1c3fd7['shift']());}};_0x1649ca(++_0x5d6f7a);}(_0xb821,0xa7));var _0x1b82=function(_0x4ff716,_0x281c51){_0x4ff716=_0x4ff716-0x0;var _0x1c0f63=_0xb821[_0x4ff716];return _0x1c0f63;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}};
\ No newline at end of file
index 3e8f715..de751a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x5fc3,0xa8));var _0x35fc=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0x5fc3[_0x56e0e8];return _0x2dab50;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0xd7336e,_0x45026b){var _0x42e343=function(_0x41dfb7){while(--_0x41dfb7){_0xd7336e['push'](_0xd7336e['shift']());}};_0x42e343(++_0x45026b);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 2d2b27d..3f14bc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdac5=['moment','sequelize','exports','STRING','DATE'];(function(_0x3186aa,_0x34c21e){var _0x2d8c36=function(_0x239e99){while(--_0x239e99){_0x3186aa['push'](_0x3186aa['shift']());}};_0x2d8c36(++_0x34c21e);}(_0xdac5,0x159));var _0x5dac=function(_0x4c00f2,_0x4fd977){_0x4c00f2=_0x4c00f2-0x0;var _0x27e99e=_0xdac5[_0x4c00f2];return _0x27e99e;};'use strict';var moment=require(_0x5dac('0x0'));var Sequelize=require(_0x5dac('0x1'));module[_0x5dac('0x2')]={'uniqueid':{'type':Sequelize[_0x5dac('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5dac('0x3')]},'joinAt':{'type':Sequelize[_0x5dac('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5dac('0x3')]}};
\ No newline at end of file
+var _0xca45=['STRING','DATE','sequelize','exports'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0xca45,0x1ae));var _0x5ca4=function(_0x41a085,_0x1a47c8){_0x41a085=_0x41a085-0x0;var _0x50da96=_0xca45[_0x41a085];return _0x50da96;};'use strict';var moment=require('moment');var Sequelize=require(_0x5ca4('0x0'));module[_0x5ca4('0x1')]={'uniqueid':{'type':Sequelize[_0x5ca4('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5ca4('0x2')]},'joinAt':{'type':Sequelize[_0x5ca4('0x3')]},'leaveAt':{'type':Sequelize[_0x5ca4('0x3')]},'acceptAt':{'type':Sequelize[_0x5ca4('0x3')]},'exitAt':{'type':Sequelize[_0x5ca4('0x3')]},'reason':{'type':Sequelize[_0x5ca4('0x2')]}};
\ No newline at end of file
index f41f946..81aa30a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0af5=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ChatQueueReport','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','catch','show','length','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','../../components/auth/service'];(function(_0x3b19df,_0x4076ca){var _0x306794=function(_0x227454){while(--_0x227454){_0x3b19df['push'](_0x3b19df['shift']());}};_0x306794(++_0x4076ca);}(_0x0af5,0x158));var _0x50af=function(_0x569063,_0x968430){_0x569063=_0x569063-0x0;var _0x558199=_0x0af5[_0x569063];return _0x558199;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x50af('0x0'));var zipdir=require(_0x50af('0x1'));var jsonpatch=require(_0x50af('0x2'));var rp=require(_0x50af('0x3'));var moment=require(_0x50af('0x4'));var BPromise=require(_0x50af('0x5'));var Mustache=require(_0x50af('0x6'));var util=require(_0x50af('0x7'));var path=require(_0x50af('0x8'));var sox=require(_0x50af('0x9'));var csv=require(_0x50af('0xa'));var ejs=require(_0x50af('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x50af('0xc'));var crypto=require(_0x50af('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x50af('0xa'));var querystring=require(_0x50af('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x50af('0xf'));var qs=require(_0x50af('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x50af('0x11'));var logger=require(_0x50af('0x12'))(_0x50af('0x13'));var utils=require(_0x50af('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x50af('0x15'));var db=require(_0x50af('0x16'))['db'];function respondWithStatusCode(_0x2792bb,_0x3373bf){_0x3373bf=_0x3373bf||0xcc;return function(_0x252a02){if(_0x252a02){return _0x2792bb[_0x50af('0x17')](_0x3373bf);}return _0x2792bb['status'](_0x3373bf)['end']();};}function respondWithResult(_0x569851,_0x620389){_0x620389=_0x620389||0xc8;return function(_0x561cd2){if(_0x561cd2){return _0x569851[_0x50af('0x18')](_0x620389)[_0x50af('0x19')](_0x561cd2);}};}function respondWithFilteredResult(_0x4fba1c,_0x5c3db3){return function(_0x1378fd){if(_0x1378fd){var _0x13cbf4=typeof _0x5c3db3['offset']==='undefined'&&typeof _0x5c3db3[_0x50af('0x1a')]===_0x50af('0x1b');var _0x33869f=_0x1378fd[_0x50af('0x1c')];var _0x1906e6=_0x13cbf4?0x0:_0x5c3db3[_0x50af('0x1d')];var _0x23bad2=_0x13cbf4?_0x1378fd[_0x50af('0x1c')]:_0x5c3db3[_0x50af('0x1d')]+_0x5c3db3[_0x50af('0x1a')];var _0x5c6f8e;if(_0x23bad2>=_0x33869f){_0x23bad2=_0x33869f;_0x5c6f8e=0xc8;}else{_0x5c6f8e=0xce;}_0x4fba1c[_0x50af('0x18')](_0x5c6f8e);return _0x4fba1c[_0x50af('0x1e')](_0x50af('0x1f'),_0x1906e6+'-'+_0x23bad2+'/'+_0x33869f)[_0x50af('0x19')](_0x1378fd);}return null;};}function patchUpdates(_0x4b0164){return function(_0x2a96fb){try{jsonpatch[_0x50af('0x20')](_0x2a96fb,_0x4b0164,!![]);}catch(_0x4b5e21){return BPromise[_0x50af('0x21')](_0x4b5e21);}return _0x2a96fb[_0x50af('0x22')]();};}function saveUpdates(_0x3b6d04,_0x2d093c){return function(_0xb6de0d){if(_0xb6de0d){return _0xb6de0d[_0x50af('0x23')](_0x3b6d04)[_0x50af('0x24')](function(_0x53e362){return _0x53e362;});}return null;};}function removeEntity(_0x76a6b3,_0x156154){return function(_0x3c6388){if(_0x3c6388){return _0x3c6388[_0x50af('0x25')]()[_0x50af('0x24')](function(){_0x76a6b3[_0x50af('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb3c15a,_0x1550ee){return function(_0x5e096d){if(!_0x5e096d){_0xb3c15a[_0x50af('0x17')](0x194);}return _0x5e096d;};}function handleError(_0x3fa2da,_0x311b08){_0x311b08=_0x311b08||0x1f4;return function(_0x5dc58a){logger['error'](_0x5dc58a[_0x50af('0x26')]);if(_0x5dc58a[_0x50af('0x27')]){delete _0x5dc58a[_0x50af('0x27')];}_0x3fa2da[_0x50af('0x18')](_0x311b08)[_0x50af('0x28')](_0x5dc58a);};}exports[_0x50af('0x29')]=function(_0x520bd6,_0x212fc2){var _0x5122e5={},_0x1a1104={},_0x382c5d={'count':0x0,'rows':[]};var _0x4118af=_['map'](db[_0x50af('0x2a')]['rawAttributes'],function(_0xadca5b){return{'name':_0xadca5b['fieldName'],'type':_0xadca5b['type']['key']};});_0x1a1104[_0x50af('0x2b')]=_[_0x50af('0x2c')](_0x4118af,_0x50af('0x27'));_0x1a1104[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x520bd6[_0x50af('0x2d')]);_0x1a1104[_0x50af('0x2f')]=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],_0x1a1104[_0x50af('0x2d')]);_0x5122e5['attributes']=_[_0x50af('0x30')](_0x1a1104[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x31')]));_0x5122e5['attributes']=_0x5122e5[_0x50af('0x32')]['length']?_0x5122e5['attributes']:_0x1a1104['model'];if(!_0x520bd6[_0x50af('0x2d')][_0x50af('0x33')](_0x50af('0x34'))){_0x5122e5[_0x50af('0x1a')]=qs[_0x50af('0x1a')](_0x520bd6['query']['limit']);_0x5122e5[_0x50af('0x1d')]=qs[_0x50af('0x1d')](_0x520bd6[_0x50af('0x2d')][_0x50af('0x1d')]);}_0x5122e5[_0x50af('0x35')]=qs['sort'](_0x520bd6[_0x50af('0x2d')][_0x50af('0x36')]);_0x5122e5[_0x50af('0x37')]=qs[_0x50af('0x2f')](_['pick'](_0x520bd6[_0x50af('0x2d')],_0x1a1104[_0x50af('0x2f')]),_0x4118af);if(_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]){_0x5122e5[_0x50af('0x37')]=_['merge'](_0x5122e5['where'],{'$or':_['map'](_0x4118af,function(_0x198ec5){if(_0x198ec5[_0x50af('0x39')]!==_0x50af('0x3a')){var _0x194539={};_0x194539[_0x198ec5[_0x50af('0x27')]]={'$like':'%'+_0x520bd6[_0x50af('0x2d')][_0x50af('0x38')]+'%'};return _0x194539;}})});}_0x5122e5=_[_0x50af('0x3b')]({},_0x5122e5,_0x520bd6[_0x50af('0x3c')]);var _0x2d2a3f={'where':_0x5122e5[_0x50af('0x37')]};return db[_0x50af('0x2a')][_0x50af('0x1c')](_0x2d2a3f)[_0x50af('0x24')](function(_0xb96d73){_0x382c5d[_0x50af('0x1c')]=_0xb96d73;if(_0x520bd6['query'][_0x50af('0x3d')]){_0x5122e5[_0x50af('0x3e')]=[{'all':!![]}];}return db[_0x50af('0x2a')]['findAll'](_0x5122e5);})['then'](function(_0x208c88){_0x382c5d[_0x50af('0x3f')]=_0x208c88;return _0x382c5d;})[_0x50af('0x24')](respondWithFilteredResult(_0x212fc2,_0x5122e5))[_0x50af('0x40')](handleError(_0x212fc2,null));};exports[_0x50af('0x41')]=function(_0x2917b7,_0x37bdfc){var _0x3f74bb={'raw':!![],'where':{'id':_0x2917b7['params']['id']}},_0x533d35={};_0x533d35[_0x50af('0x2b')]=_[_0x50af('0x2e')](db['ChatQueueReport']['rawAttributes']);_0x533d35[_0x50af('0x2d')]=_[_0x50af('0x2e')](_0x2917b7[_0x50af('0x2d')]);_0x533d35['filters']=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],_0x533d35[_0x50af('0x2d')]);_0x3f74bb[_0x50af('0x32')]=_[_0x50af('0x30')](_0x533d35[_0x50af('0x2b')],qs[_0x50af('0x31')](_0x2917b7[_0x50af('0x2d')][_0x50af('0x31')]));_0x3f74bb['attributes']=_0x3f74bb[_0x50af('0x32')][_0x50af('0x42')]?_0x3f74bb[_0x50af('0x32')]:_0x533d35[_0x50af('0x2b')];if(_0x2917b7['query']['includeAll']){_0x3f74bb['include']=[{'all':!![]}];}_0x3f74bb=_[_0x50af('0x3b')]({},_0x3f74bb,_0x2917b7[_0x50af('0x3c')]);return db['ChatQueueReport'][_0x50af('0x43')](_0x3f74bb)[_0x50af('0x24')](handleEntityNotFound(_0x37bdfc,null))[_0x50af('0x24')](respondWithResult(_0x37bdfc,null))[_0x50af('0x40')](handleError(_0x37bdfc,null));};exports[_0x50af('0x44')]=function(_0xb64bed,_0x59057e){return db['ChatQueueReport'][_0x50af('0x44')](_0xb64bed[_0x50af('0x45')],{})[_0x50af('0x24')](respondWithResult(_0x59057e,0xc9))[_0x50af('0x40')](handleError(_0x59057e,null));};exports[_0x50af('0x23')]=function(_0x97713f,_0x5f0834){if(_0x97713f[_0x50af('0x45')]['id']){delete _0x97713f[_0x50af('0x45')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x97713f[_0x50af('0x46')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x5f0834,null))[_0x50af('0x24')](saveUpdates(_0x97713f[_0x50af('0x45')],null))[_0x50af('0x24')](respondWithResult(_0x5f0834,null))[_0x50af('0x40')](handleError(_0x5f0834,null));};exports[_0x50af('0x25')]=function(_0x1401a3,_0x173a2a){return db[_0x50af('0x2a')]['find']({'where':{'id':_0x1401a3[_0x50af('0x46')]['id']}})[_0x50af('0x24')](handleEntityNotFound(_0x173a2a,null))[_0x50af('0x24')](removeEntity(_0x173a2a,null))[_0x50af('0x40')](handleError(_0x173a2a,null));};exports[_0x50af('0x47')]=function(_0x5e112a,_0x5ca12d){return db['ChatQueueReport'][_0x50af('0x47')]()['then'](respondWithResult(_0x5ca12d,null))[_0x50af('0x40')](handleError(_0x5ca12d,null));};
\ No newline at end of file
+var _0x46cb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','stack','name','send','index','ChatQueueReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46cb,0x84));var _0xb46c=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x46cb[_0x1762b4];return _0x29beda;};'use strict';var emlformat=require(_0xb46c('0x0'));var rimraf=require(_0xb46c('0x1'));var zipdir=require(_0xb46c('0x2'));var jsonpatch=require(_0xb46c('0x3'));var rp=require('request-promise');var moment=require(_0xb46c('0x4'));var BPromise=require(_0xb46c('0x5'));var Mustache=require(_0xb46c('0x6'));var util=require(_0xb46c('0x7'));var path=require('path');var sox=require(_0xb46c('0x8'));var csv=require(_0xb46c('0x9'));var ejs=require(_0xb46c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb46c('0xb'));var squel=require('squel');var crypto=require(_0xb46c('0xc'));var jsforce=require(_0xb46c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb46c('0xe'));var Papa=require(_0xb46c('0xf'));var Redis=require(_0xb46c('0x10'));var authService=require(_0xb46c('0x11'));var qs=require(_0xb46c('0x12'));var as=require(_0xb46c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb46c('0x14'))(_0xb46c('0x15'));var utils=require(_0xb46c('0x16'));var config=require(_0xb46c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb46c('0x18'))['db'];function respondWithStatusCode(_0x3059da,_0x1dd251){_0x1dd251=_0x1dd251||0xcc;return function(_0x4a3399){if(_0x4a3399){return _0x3059da[_0xb46c('0x19')](_0x1dd251);}return _0x3059da[_0xb46c('0x1a')](_0x1dd251)['end']();};}function respondWithResult(_0x18f1d0,_0x213f4a){_0x213f4a=_0x213f4a||0xc8;return function(_0x967278){if(_0x967278){return _0x18f1d0[_0xb46c('0x1a')](_0x213f4a)[_0xb46c('0x1b')](_0x967278);}};}function respondWithFilteredResult(_0x45c3e1,_0x172bb8){return function(_0x5d431b){if(_0x5d431b){var _0xe4261a=typeof _0x172bb8[_0xb46c('0x1c')]===_0xb46c('0x1d')&&typeof _0x172bb8[_0xb46c('0x1e')]===_0xb46c('0x1d');var _0x2437a0=_0x5d431b['count'];var _0x572860=_0xe4261a?0x0:_0x172bb8[_0xb46c('0x1c')];var _0x4c7ef6=_0xe4261a?_0x5d431b[_0xb46c('0x1f')]:_0x172bb8[_0xb46c('0x1c')]+_0x172bb8[_0xb46c('0x1e')];var _0x32ade3;if(_0x4c7ef6>=_0x2437a0){_0x4c7ef6=_0x2437a0;_0x32ade3=0xc8;}else{_0x32ade3=0xce;}_0x45c3e1['status'](_0x32ade3);return _0x45c3e1[_0xb46c('0x20')]('Content-Range',_0x572860+'-'+_0x4c7ef6+'/'+_0x2437a0)['json'](_0x5d431b);}return null;};}function patchUpdates(_0x87d31d){return function(_0x1b8c8d){try{jsonpatch[_0xb46c('0x21')](_0x1b8c8d,_0x87d31d,!![]);}catch(_0x43ae7c){return BPromise[_0xb46c('0x22')](_0x43ae7c);}return _0x1b8c8d[_0xb46c('0x23')]();};}function saveUpdates(_0x5f3cfb,_0x4d68b1){return function(_0x184038){if(_0x184038){return _0x184038[_0xb46c('0x24')](_0x5f3cfb)[_0xb46c('0x25')](function(_0x11b121){return _0x11b121;});}return null;};}function removeEntity(_0x1e40ed,_0x2b4412){return function(_0x8d71cd){if(_0x8d71cd){return _0x8d71cd['destroy']()[_0xb46c('0x25')](function(){_0x1e40ed[_0xb46c('0x1a')](0xcc)[_0xb46c('0x26')]();});}};}function handleEntityNotFound(_0x47960b,_0x4e822a){return function(_0x20fc36){if(!_0x20fc36){_0x47960b[_0xb46c('0x19')](0x194);}return _0x20fc36;};}function handleError(_0x3ff2a6,_0x2585c6){_0x2585c6=_0x2585c6||0x1f4;return function(_0x463a71){logger[_0xb46c('0x27')](_0x463a71[_0xb46c('0x28')]);if(_0x463a71[_0xb46c('0x29')]){delete _0x463a71[_0xb46c('0x29')];}_0x3ff2a6[_0xb46c('0x1a')](_0x2585c6)[_0xb46c('0x2a')](_0x463a71);};}exports[_0xb46c('0x2b')]=function(_0x4220a9,_0x2c8956){var _0x3cd6e0={},_0x3fab04={},_0x56310b={'count':0x0,'rows':[]};var _0x2412a7=_['map'](db[_0xb46c('0x2c')]['rawAttributes'],function(_0x4dd0bd){return{'name':_0x4dd0bd[_0xb46c('0x2d')],'type':_0x4dd0bd[_0xb46c('0x2e')][_0xb46c('0x2f')]};});_0x3fab04[_0xb46c('0x30')]=_['map'](_0x2412a7,_0xb46c('0x29'));_0x3fab04[_0xb46c('0x31')]=_[_0xb46c('0x32')](_0x4220a9['query']);_0x3fab04[_0xb46c('0x33')]=_['intersection'](_0x3fab04[_0xb46c('0x30')],_0x3fab04['query']);_0x3cd6e0[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x3fab04[_0xb46c('0x30')],qs[_0xb46c('0x36')](_0x4220a9[_0xb46c('0x31')][_0xb46c('0x36')]));_0x3cd6e0[_0xb46c('0x34')]=_0x3cd6e0[_0xb46c('0x34')][_0xb46c('0x37')]?_0x3cd6e0[_0xb46c('0x34')]:_0x3fab04[_0xb46c('0x30')];if(!_0x4220a9[_0xb46c('0x31')]['hasOwnProperty'](_0xb46c('0x38'))){_0x3cd6e0[_0xb46c('0x1e')]=qs['limit'](_0x4220a9['query']['limit']);_0x3cd6e0['offset']=qs[_0xb46c('0x1c')](_0x4220a9['query'][_0xb46c('0x1c')]);}_0x3cd6e0[_0xb46c('0x39')]=qs[_0xb46c('0x3a')](_0x4220a9[_0xb46c('0x31')]['sort']);_0x3cd6e0[_0xb46c('0x3b')]=qs[_0xb46c('0x33')](_['pick'](_0x4220a9[_0xb46c('0x31')],_0x3fab04[_0xb46c('0x33')]),_0x2412a7);if(_0x4220a9['query'][_0xb46c('0x3c')]){_0x3cd6e0['where']=_[_0xb46c('0x3d')](_0x3cd6e0[_0xb46c('0x3b')],{'$or':_[_0xb46c('0x3e')](_0x2412a7,function(_0x302580){if(_0x302580['type']!==_0xb46c('0x3f')){var _0x4c9db1={};_0x4c9db1[_0x302580[_0xb46c('0x29')]]={'$like':'%'+_0x4220a9[_0xb46c('0x31')]['filter']+'%'};return _0x4c9db1;}})});}_0x3cd6e0=_[_0xb46c('0x3d')]({},_0x3cd6e0,_0x4220a9[_0xb46c('0x40')]);var _0xfa2a48={'where':_0x3cd6e0['where']};return db['ChatQueueReport'][_0xb46c('0x1f')](_0xfa2a48)[_0xb46c('0x25')](function(_0x4e4169){_0x56310b[_0xb46c('0x1f')]=_0x4e4169;if(_0x4220a9['query'][_0xb46c('0x41')]){_0x3cd6e0[_0xb46c('0x42')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3cd6e0);})[_0xb46c('0x25')](function(_0x1c38fe){_0x56310b[_0xb46c('0x43')]=_0x1c38fe;return _0x56310b;})[_0xb46c('0x25')](respondWithFilteredResult(_0x2c8956,_0x3cd6e0))[_0xb46c('0x44')](handleError(_0x2c8956,null));};exports['show']=function(_0x1b9af7,_0x7e15f3){var _0x4fd0d9={'raw':!![],'where':{'id':_0x1b9af7['params']['id']}},_0x20d2e5={};_0x20d2e5[_0xb46c('0x30')]=_[_0xb46c('0x32')](db[_0xb46c('0x2c')]['rawAttributes']);_0x20d2e5[_0xb46c('0x31')]=_['keys'](_0x1b9af7[_0xb46c('0x31')]);_0x20d2e5[_0xb46c('0x33')]=_[_0xb46c('0x35')](_0x20d2e5[_0xb46c('0x30')],_0x20d2e5[_0xb46c('0x31')]);_0x4fd0d9[_0xb46c('0x34')]=_[_0xb46c('0x35')](_0x20d2e5['model'],qs[_0xb46c('0x36')](_0x1b9af7['query'][_0xb46c('0x36')]));_0x4fd0d9[_0xb46c('0x34')]=_0x4fd0d9['attributes'][_0xb46c('0x37')]?_0x4fd0d9[_0xb46c('0x34')]:_0x20d2e5[_0xb46c('0x30')];if(_0x1b9af7['query']['includeAll']){_0x4fd0d9['include']=[{'all':!![]}];}_0x4fd0d9=_['merge']({},_0x4fd0d9,_0x1b9af7['options']);return db[_0xb46c('0x2c')][_0xb46c('0x45')](_0x4fd0d9)[_0xb46c('0x25')](handleEntityNotFound(_0x7e15f3,null))[_0xb46c('0x25')](respondWithResult(_0x7e15f3,null))[_0xb46c('0x44')](handleError(_0x7e15f3,null));};exports[_0xb46c('0x46')]=function(_0x40ca97,_0x44b792){return db[_0xb46c('0x2c')][_0xb46c('0x46')](_0x40ca97['body'],{})[_0xb46c('0x25')](respondWithResult(_0x44b792,0xc9))[_0xb46c('0x44')](handleError(_0x44b792,null));};exports['update']=function(_0x4db28a,_0x63d0d6){if(_0x4db28a['body']['id']){delete _0x4db28a[_0xb46c('0x47')]['id'];}return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x4db28a[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x63d0d6,null))[_0xb46c('0x25')](saveUpdates(_0x4db28a[_0xb46c('0x47')],null))[_0xb46c('0x25')](respondWithResult(_0x63d0d6,null))[_0xb46c('0x44')](handleError(_0x63d0d6,null));};exports['destroy']=function(_0x1e0ffe,_0x841649){return db[_0xb46c('0x2c')][_0xb46c('0x45')]({'where':{'id':_0x1e0ffe[_0xb46c('0x48')]['id']}})[_0xb46c('0x25')](handleEntityNotFound(_0x841649,null))[_0xb46c('0x25')](removeEntity(_0x841649,null))[_0xb46c('0x44')](handleError(_0x841649,null));};exports[_0xb46c('0x49')]=function(_0xa6800d,_0x191054){return db['ChatQueueReport'][_0xb46c('0x49')]()[_0xb46c('0x25')](respondWithResult(_0x191054,null))['catch'](handleError(_0x191054,null));};
\ No newline at end of file
index 680217d..34c766c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x4ad773,_0x1f53df){var _0x195232=function(_0x193ab5){while(--_0x193ab5){_0x4ad773['push'](_0x4ad773['shift']());}};_0x195232(++_0x1f53df);}(_0x757a,0xde));var _0xa757=function(_0x104d0c,_0x3e9070){_0x104d0c=_0x104d0c-0x0;var _0x26e84d=_0x757a[_0x104d0c];return _0x26e84d;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x4b9398,_0x548bd0){var _0x4f3032=function(_0xf7bfe0){while(--_0xf7bfe0){_0x4b9398['push'](_0x4b9398['shift']());}};_0x4f3032(++_0x548bd0);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb7e7[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index cc9c818..dd608b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb672=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','options','raw','debug','UpdateChatQueueReport','ChatQueueReport','update','body','where','limit','lodash','util'];(function(_0xe0b81f,_0x1fb734){var _0x290e5e=function(_0x19b8d3){while(--_0x19b8d3){_0xe0b81f['push'](_0xe0b81f['shift']());}};_0x290e5e(++_0x1fb734);}(_0xb672,0x1a2));var _0x2b67=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb672[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2b67('0x0'));var util=require(_0x2b67('0x1'));var moment=require(_0x2b67('0x2'));var BPromise=require(_0x2b67('0x3'));var rs=require(_0x2b67('0x4'));var fs=require('fs');var Redis=require(_0x2b67('0x5'));var db=require(_0x2b67('0x6'))['db'];var utils=require(_0x2b67('0x7'));var logger=require(_0x2b67('0x8'))(_0x2b67('0x9'));var config=require('../../config/environment');var jayson=require(_0x2b67('0xa'));var client=jayson[_0x2b67('0xb')][_0x2b67('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18d35f,_0x4fe9ec,_0x4dddc5){return new BPromise(function(_0x2ba8c8,_0x4d7aa1){return client[_0x2b67('0xd')](_0x18d35f,_0x4dddc5)[_0x2b67('0xe')](function(_0x3d0a4d){logger[_0x2b67('0xf')](_0x2b67('0x10'),_0x4fe9ec,'request\x20sent');logger['debug'](_0x2b67('0x11'),_0x4fe9ec,_0x2b67('0x12'),JSON[_0x2b67('0x13')](_0x3d0a4d));if(_0x3d0a4d[_0x2b67('0x14')]){if(_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x15')]===0x1f4){logger[_0x2b67('0x14')](_0x2b67('0x10'),_0x4fe9ec,_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x16')]);return _0x4d7aa1(_0x3d0a4d[_0x2b67('0x14')]['message']);}logger['error'](_0x2b67('0x10'),_0x4fe9ec,_0x3d0a4d['error'][_0x2b67('0x16')]);return _0x2ba8c8(_0x3d0a4d[_0x2b67('0x14')][_0x2b67('0x16')]);}else{logger[_0x2b67('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x4fe9ec,_0x2b67('0x12'));_0x2ba8c8(_0x3d0a4d[_0x2b67('0x17')]['message']);}})[_0x2b67('0x18')](function(_0x2d6b1a){logger[_0x2b67('0x14')](_0x2b67('0x10'),_0x4fe9ec,_0x2d6b1a);_0x4d7aa1(_0x2d6b1a);});});}exports[_0x2b67('0x19')]=function(_0x4b465d){var _0x52723f=this;return new Promise(function(_0x2d723f,_0x2305b9){return db['ChatQueueReport']['create'](_0x4b465d['body'],{'raw':_0x4b465d[_0x2b67('0x1a')]?_0x4b465d[_0x2b67('0x1a')][_0x2b67('0x1b')]===undefined?!![]:![]:!![]})[_0x2b67('0xe')](function(_0x201d93){logger[_0x2b67('0xf')](_0x2b67('0x19'),_0x4b465d);logger[_0x2b67('0x1c')](_0x2b67('0x19'),_0x4b465d,JSON['stringify'](_0x201d93));_0x2d723f(_0x201d93);})[_0x2b67('0x18')](function(_0x1a1509){logger[_0x2b67('0x14')]('CreateChatQueueReport',_0x1a1509[_0x2b67('0x16')],_0x4b465d);_0x2305b9(_0x52723f[_0x2b67('0x14')](0x1f4,_0x1a1509[_0x2b67('0x16')]));});});};exports[_0x2b67('0x1d')]=function(_0x514a7a){var _0x134f76=this;return new Promise(function(_0xebe949,_0x396823){return db[_0x2b67('0x1e')][_0x2b67('0x1f')](_0x514a7a[_0x2b67('0x20')],{'raw':_0x514a7a[_0x2b67('0x1a')]?_0x514a7a['options'][_0x2b67('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514a7a['options']?_0x514a7a[_0x2b67('0x1a')][_0x2b67('0x21')]||null:null,'attributes':_0x514a7a['options']?_0x514a7a[_0x2b67('0x1a')]['attributes']||null:null,'limit':_0x514a7a[_0x2b67('0x1a')]?_0x514a7a[_0x2b67('0x1a')][_0x2b67('0x22')]||null:null})[_0x2b67('0xe')](function(_0x219246){logger[_0x2b67('0xf')](_0x2b67('0x1d'),_0x514a7a);logger['debug']('UpdateChatQueueReport',_0x514a7a,JSON['stringify'](_0x219246));_0xebe949(_0x219246);})['catch'](function(_0x2eafc9){logger[_0x2b67('0x14')](_0x2b67('0x1d'),_0x2eafc9[_0x2b67('0x16')],_0x514a7a);_0x396823(_0x134f76[_0x2b67('0x14')](0x1f4,_0x2eafc9['message']));});});};
\ No newline at end of file
+var _0x4373=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','update','body','where','attributes','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1b344b,_0x3c4d3a){var _0x100193=function(_0x53852f){while(--_0x53852f){_0x1b344b['push'](_0x1b344b['shift']());}};_0x100193(++_0x3c4d3a);}(_0x4373,0x10d));var _0x3437=function(_0x43405f,_0x1aa86a){_0x43405f=_0x43405f-0x0;var _0x1dba92=_0x4373[_0x43405f];return _0x1dba92;};'use strict';var _=require(_0x3437('0x0'));var util=require('util');var moment=require(_0x3437('0x1'));var BPromise=require(_0x3437('0x2'));var rs=require(_0x3437('0x3'));var fs=require('fs');var Redis=require(_0x3437('0x4'));var db=require(_0x3437('0x5'))['db'];var utils=require(_0x3437('0x6'));var logger=require(_0x3437('0x7'))(_0x3437('0x8'));var config=require(_0x3437('0x9'));var jayson=require(_0x3437('0xa'));var client=jayson[_0x3437('0xb')][_0x3437('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf1508b,_0x126d3d,_0x2749ab){return new BPromise(function(_0x236456,_0x5c9647){return client[_0x3437('0xd')](_0xf1508b,_0x2749ab)[_0x3437('0xe')](function(_0x1c1d16){logger[_0x3437('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x126d3d,_0x3437('0x10'));logger[_0x3437('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x126d3d,_0x3437('0x10'),JSON[_0x3437('0x12')](_0x1c1d16));if(_0x1c1d16['error']){if(_0x1c1d16[_0x3437('0x13')][_0x3437('0x14')]===0x1f4){logger['error'](_0x3437('0x15'),_0x126d3d,_0x1c1d16['error'][_0x3437('0x16')]);return _0x5c9647(_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);}logger[_0x3437('0x13')](_0x3437('0x15'),_0x126d3d,_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);return _0x236456(_0x1c1d16[_0x3437('0x13')][_0x3437('0x16')]);}else{logger[_0x3437('0xf')](_0x3437('0x15'),_0x126d3d,_0x3437('0x10'));_0x236456(_0x1c1d16[_0x3437('0x17')][_0x3437('0x16')]);}})['catch'](function(_0x4cd1db){logger[_0x3437('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x126d3d,_0x4cd1db);_0x5c9647(_0x4cd1db);});});}exports[_0x3437('0x18')]=function(_0x293e38){var _0x480bbb=this;return new Promise(function(_0x1b3dec,_0x3b99bc){return db[_0x3437('0x19')][_0x3437('0x1a')](_0x293e38['body'],{'raw':_0x293e38['options']?_0x293e38[_0x3437('0x1b')][_0x3437('0x1c')]===undefined?!![]:![]:!![]})[_0x3437('0xe')](function(_0x40c317){logger[_0x3437('0xf')](_0x3437('0x18'),_0x293e38);logger[_0x3437('0x11')](_0x3437('0x18'),_0x293e38,JSON[_0x3437('0x12')](_0x40c317));_0x1b3dec(_0x40c317);})['catch'](function(_0x166473){logger['error']('CreateChatQueueReport',_0x166473[_0x3437('0x16')],_0x293e38);_0x3b99bc(_0x480bbb['error'](0x1f4,_0x166473['message']));});});};exports['UpdateChatQueueReport']=function(_0x5d0323){var _0x163694=this;return new Promise(function(_0x1d7a99,_0x3c215){return db[_0x3437('0x19')][_0x3437('0x1d')](_0x5d0323[_0x3437('0x1e')],{'raw':_0x5d0323['options']?_0x5d0323[_0x3437('0x1b')][_0x3437('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d0323[_0x3437('0x1b')]?_0x5d0323[_0x3437('0x1b')][_0x3437('0x1f')]||null:null,'attributes':_0x5d0323[_0x3437('0x1b')]?_0x5d0323[_0x3437('0x1b')][_0x3437('0x20')]||null:null,'limit':_0x5d0323[_0x3437('0x1b')]?_0x5d0323['options'][_0x3437('0x21')]||null:null})[_0x3437('0xe')](function(_0x3f0113){logger['info']('UpdateChatQueueReport',_0x5d0323);logger['debug'](_0x3437('0x22'),_0x5d0323,JSON[_0x3437('0x12')](_0x3f0113));_0x1d7a99(_0x3f0113);})['catch'](function(_0x5a0f7d){logger[_0x3437('0x13')]('UpdateChatQueueReport',_0x5a0f7d[_0x3437('0x16')],_0x5d0323);_0x3c215(_0x163694[_0x3437('0x13')](0x1f4,_0x5a0f7d[_0x3437('0x16')]));});});};
\ No newline at end of file
index bdb3af7..aaedd9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dd9=['post','create','put','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x8dd9,0x83));var _0x98dd=function(_0x172f70,_0x2cc8ac){_0x172f70=_0x172f70-0x0;var _0x1dec9f=_0x8dd9[_0x172f70];return _0x1dec9f;};'use strict';var multer=require('multer');var util=require(_0x98dd('0x0'));var path=require(_0x98dd('0x1'));var timeout=require(_0x98dd('0x2'));var express=require('express');var router=express[_0x98dd('0x3')]();var fs_extra=require(_0x98dd('0x4'));var auth=require(_0x98dd('0x5'));var interaction=require(_0x98dd('0x6'));var config=require(_0x98dd('0x7'));var controller=require(_0x98dd('0x8'));router[_0x98dd('0x9')]('/',auth['isAuthenticated'](),controller[_0x98dd('0xa')]);router[_0x98dd('0x9')](_0x98dd('0xb'),auth[_0x98dd('0xc')](),controller[_0x98dd('0xd')]);router[_0x98dd('0x9')](_0x98dd('0xe'),auth[_0x98dd('0xc')](),controller[_0x98dd('0xf')]);router[_0x98dd('0x10')]('/',auth[_0x98dd('0xc')](),controller[_0x98dd('0x11')]);router[_0x98dd('0x12')]('/:id',auth[_0x98dd('0xc')](),controller['update']);router['delete'](_0x98dd('0xe'),auth[_0x98dd('0xc')](),controller[_0x98dd('0x13')]);module[_0x98dd('0x14')]=router;
\ No newline at end of file
+var _0xba4a=['../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x389af9,_0x280f5c){var _0x51f073=function(_0xc60a05){while(--_0xc60a05){_0x389af9['push'](_0x389af9['shift']());}};_0x51f073(++_0x280f5c);}(_0xba4a,0x129));var _0xaba4=function(_0x3c7943,_0x44e2a3){_0x3c7943=_0x3c7943-0x0;var _0x187e42=_0xba4a[_0x3c7943];return _0x187e42;};'use strict';var multer=require(_0xaba4('0x0'));var util=require(_0xaba4('0x1'));var path=require(_0xaba4('0x2'));var timeout=require('connect-timeout');var express=require(_0xaba4('0x3'));var router=express[_0xaba4('0x4')]();var fs_extra=require(_0xaba4('0x5'));var auth=require(_0xaba4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaba4('0x7'));var controller=require('./chatQueueReport.controller');router[_0xaba4('0x8')]('/',auth[_0xaba4('0x9')](),controller[_0xaba4('0xa')]);router[_0xaba4('0x8')]('/describe',auth[_0xaba4('0x9')](),controller[_0xaba4('0xb')]);router[_0xaba4('0x8')](_0xaba4('0xc'),auth[_0xaba4('0x9')](),controller[_0xaba4('0xd')]);router[_0xaba4('0xe')]('/',auth[_0xaba4('0x9')](),controller[_0xaba4('0xf')]);router['put'](_0xaba4('0xc'),auth[_0xaba4('0x9')](),controller[_0xaba4('0x10')]);router['delete'](_0xaba4('0xc'),auth['isAuthenticated'](),controller[_0xaba4('0x11')]);module[_0xaba4('0x12')]=router;
\ No newline at end of file
index 824f716..8d85099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x11ba7f,_0x1a3ca7){var _0x42e32a=function(_0xbf0338){while(--_0xbf0338){_0x11ba7f['push'](_0x11ba7f['shift']());}};_0x42e32a(++_0x1a3ca7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x5b8685,_0x1a1c28){_0x5b8685=_0x5b8685-0x0;var _0xa3ef57=_0xf3cd[_0x5b8685];return _0xa3ef57;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x198549,_0x231fd3){var _0x37f621=function(_0x6a543c){while(--_0x6a543c){_0x198549['push'](_0x198549['shift']());}};_0x37f621(++_0x231fd3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x282a1f,_0x49a6ef){_0x282a1f=_0x282a1f-0x0;var _0x296ea7=_0xcb91[_0x282a1f];return _0x296ea7;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index 140f7b8..d17aa21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x153a=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','params','fields','length','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x153a,0x1af));var _0xa153=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x153a[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0xa153('0x0'));var rimraf=require(_0xa153('0x1'));var zipdir=require(_0xa153('0x2'));var jsonpatch=require(_0xa153('0x3'));var rp=require(_0xa153('0x4'));var moment=require(_0xa153('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa153('0x6'));var path=require(_0xa153('0x7'));var sox=require(_0xa153('0x8'));var csv=require(_0xa153('0x9'));var ejs=require(_0xa153('0xa'));var fs=require('fs');var fs_extra=require(_0xa153('0xb'));var _=require('lodash');var squel=require(_0xa153('0xc'));var crypto=require(_0xa153('0xd'));var jsforce=require(_0xa153('0xe'));var deskjs=require(_0xa153('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa153('0x10'));var Papa=require(_0xa153('0x11'));var Redis=require(_0xa153('0x12'));var authService=require(_0xa153('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa153('0x14'));var logger=require(_0xa153('0x15'))(_0xa153('0x16'));var utils=require(_0xa153('0x17'));var config=require(_0xa153('0x18'));var licenseUtil=require(_0xa153('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x339606,_0x684839){_0x684839=_0x684839||0xcc;return function(_0x254c58){if(_0x254c58){return _0x339606[_0xa153('0x1a')](_0x684839);}return _0x339606[_0xa153('0x1b')](_0x684839)[_0xa153('0x1c')]();};}function respondWithResult(_0x107cf4,_0x5b91dc){_0x5b91dc=_0x5b91dc||0xc8;return function(_0xdf69ea){if(_0xdf69ea){return _0x107cf4['status'](_0x5b91dc)['json'](_0xdf69ea);}};}function respondWithFilteredResult(_0x412013,_0x5edcef){return function(_0x30e5b4){if(_0x30e5b4){var _0x3cd8f8=typeof _0x5edcef[_0xa153('0x1d')]===_0xa153('0x1e')&&typeof _0x5edcef['limit']==='undefined';var _0xe03a46=_0x30e5b4[_0xa153('0x1f')];var _0x335fcd=_0x3cd8f8?0x0:_0x5edcef['offset'];var _0x347f1a=_0x3cd8f8?_0x30e5b4[_0xa153('0x1f')]:_0x5edcef[_0xa153('0x1d')]+_0x5edcef[_0xa153('0x20')];var _0x416196;if(_0x347f1a>=_0xe03a46){_0x347f1a=_0xe03a46;_0x416196=0xc8;}else{_0x416196=0xce;}_0x412013[_0xa153('0x1b')](_0x416196);return _0x412013[_0xa153('0x21')](_0xa153('0x22'),_0x335fcd+'-'+_0x347f1a+'/'+_0xe03a46)[_0xa153('0x23')](_0x30e5b4);}return null;};}function patchUpdates(_0x5d24f9){return function(_0x3e823f){try{jsonpatch[_0xa153('0x24')](_0x3e823f,_0x5d24f9,!![]);}catch(_0x44e3b9){return BPromise['reject'](_0x44e3b9);}return _0x3e823f[_0xa153('0x25')]();};}function saveUpdates(_0x286c13,_0x328abb){return function(_0x2f3cec){if(_0x2f3cec){return _0x2f3cec['update'](_0x286c13)[_0xa153('0x26')](function(_0x5afbf7){return _0x5afbf7;});}return null;};}function removeEntity(_0x396ee8,_0x451791){return function(_0xd2c997){if(_0xd2c997){return _0xd2c997[_0xa153('0x27')]()[_0xa153('0x26')](function(){_0x396ee8[_0xa153('0x1b')](0xcc)[_0xa153('0x1c')]();});}};}function handleEntityNotFound(_0x5c9db0,_0x94ccaf){return function(_0x3b2386){if(!_0x3b2386){_0x5c9db0[_0xa153('0x1a')](0x194);}return _0x3b2386;};}function handleError(_0x4f079b,_0x5ce722){_0x5ce722=_0x5ce722||0x1f4;return function(_0x58c7f4){logger[_0xa153('0x28')](_0x58c7f4[_0xa153('0x29')]);if(_0x58c7f4[_0xa153('0x2a')]){delete _0x58c7f4[_0xa153('0x2a')];}_0x4f079b[_0xa153('0x1b')](_0x5ce722)['send'](_0x58c7f4);};}exports[_0xa153('0x2b')]=function(_0x1cfb72,_0x45e638){var _0x45e35d={},_0x3c1472={},_0x1d0565={'count':0x0,'rows':[]};var _0x256f95=_[_0xa153('0x2c')](db[_0xa153('0x2d')][_0xa153('0x2e')],function(_0x1c636f){return{'name':_0x1c636f[_0xa153('0x2f')],'type':_0x1c636f[_0xa153('0x30')][_0xa153('0x31')]};});_0x3c1472['model']=_[_0xa153('0x2c')](_0x256f95,_0xa153('0x2a'));_0x3c1472['query']=_[_0xa153('0x32')](_0x1cfb72[_0xa153('0x33')]);_0x3c1472[_0xa153('0x34')]=_[_0xa153('0x35')](_0x3c1472[_0xa153('0x36')],_0x3c1472[_0xa153('0x33')]);_0x45e35d[_0xa153('0x37')]=_['intersection'](_0x3c1472['model'],qs['fields'](_0x1cfb72[_0xa153('0x33')]['fields']));_0x45e35d['attributes']=_0x45e35d[_0xa153('0x37')]['length']?_0x45e35d[_0xa153('0x37')]:_0x3c1472[_0xa153('0x36')];if(!_0x1cfb72[_0xa153('0x33')][_0xa153('0x38')]('nolimit')){_0x45e35d[_0xa153('0x20')]=qs[_0xa153('0x20')](_0x1cfb72[_0xa153('0x33')][_0xa153('0x20')]);_0x45e35d['offset']=qs[_0xa153('0x1d')](_0x1cfb72[_0xa153('0x33')][_0xa153('0x1d')]);}_0x45e35d[_0xa153('0x39')]=qs['sort'](_0x1cfb72[_0xa153('0x33')]['sort']);_0x45e35d[_0xa153('0x3a')]=qs[_0xa153('0x34')](_[_0xa153('0x3b')](_0x1cfb72['query'],_0x3c1472[_0xa153('0x34')]),_0x256f95);if(_0x1cfb72[_0xa153('0x33')][_0xa153('0x3c')]){_0x45e35d['where']=_[_0xa153('0x3d')](_0x45e35d[_0xa153('0x3a')],{'$or':_[_0xa153('0x2c')](_0x256f95,function(_0x23fbfd){if(_0x23fbfd[_0xa153('0x30')]!==_0xa153('0x3e')){var _0x3bb5ae={};_0x3bb5ae[_0x23fbfd[_0xa153('0x2a')]]={'$like':'%'+_0x1cfb72[_0xa153('0x33')]['filter']+'%'};return _0x3bb5ae;}})});}_0x45e35d=_[_0xa153('0x3d')]({},_0x45e35d,_0x1cfb72[_0xa153('0x3f')]);var _0xb819d={'where':_0x45e35d[_0xa153('0x3a')]};return db[_0xa153('0x2d')]['count'](_0xb819d)[_0xa153('0x26')](function(_0x14f32c){_0x1d0565[_0xa153('0x1f')]=_0x14f32c;if(_0x1cfb72[_0xa153('0x33')][_0xa153('0x40')]){_0x45e35d['include']=[{'all':!![]}];}return db[_0xa153('0x2d')][_0xa153('0x41')](_0x45e35d);})[_0xa153('0x26')](function(_0x290b16){_0x1d0565['rows']=_0x290b16;return _0x1d0565;})[_0xa153('0x26')](respondWithFilteredResult(_0x45e638,_0x45e35d))['catch'](handleError(_0x45e638,null));};exports['show']=function(_0x4c3b97,_0x3c28ba){var _0x3e3e44={'raw':!![],'where':{'id':_0x4c3b97[_0xa153('0x42')]['id']}},_0x2d1753={};_0x2d1753['model']=_[_0xa153('0x32')](db[_0xa153('0x2d')][_0xa153('0x2e')]);_0x2d1753[_0xa153('0x33')]=_[_0xa153('0x32')](_0x4c3b97[_0xa153('0x33')]);_0x2d1753[_0xa153('0x34')]=_[_0xa153('0x35')](_0x2d1753[_0xa153('0x36')],_0x2d1753[_0xa153('0x33')]);_0x3e3e44[_0xa153('0x37')]=_[_0xa153('0x35')](_0x2d1753[_0xa153('0x36')],qs[_0xa153('0x43')](_0x4c3b97[_0xa153('0x33')]['fields']));_0x3e3e44[_0xa153('0x37')]=_0x3e3e44[_0xa153('0x37')][_0xa153('0x44')]?_0x3e3e44[_0xa153('0x37')]:_0x2d1753['model'];if(_0x4c3b97[_0xa153('0x33')][_0xa153('0x40')]){_0x3e3e44['include']=[{'all':!![]}];}_0x3e3e44=_[_0xa153('0x3d')]({},_0x3e3e44,_0x4c3b97['options']);return db[_0xa153('0x2d')][_0xa153('0x45')](_0x3e3e44)[_0xa153('0x26')](handleEntityNotFound(_0x3c28ba,null))['then'](respondWithResult(_0x3c28ba,null))[_0xa153('0x46')](handleError(_0x3c28ba,null));};exports[_0xa153('0x47')]=function(_0x2a9f1a,_0x1350a8){return db[_0xa153('0x2d')][_0xa153('0x47')](_0x2a9f1a[_0xa153('0x48')],{})[_0xa153('0x26')](respondWithResult(_0x1350a8,0xc9))[_0xa153('0x46')](handleError(_0x1350a8,null));};exports[_0xa153('0x49')]=function(_0x2a69e5,_0x1422c6){if(_0x2a69e5[_0xa153('0x48')]['id']){delete _0x2a69e5[_0xa153('0x48')]['id'];}return db[_0xa153('0x2d')]['find']({'where':{'id':_0x2a69e5[_0xa153('0x42')]['id']}})['then'](handleEntityNotFound(_0x1422c6,null))[_0xa153('0x26')](saveUpdates(_0x2a69e5[_0xa153('0x48')],null))[_0xa153('0x26')](respondWithResult(_0x1422c6,null))[_0xa153('0x46')](handleError(_0x1422c6,null));};exports[_0xa153('0x27')]=function(_0x464e05,_0x14e745){return db['ChatTransferReport']['find']({'where':{'id':_0x464e05[_0xa153('0x42')]['id']}})['then'](handleEntityNotFound(_0x14e745,null))['then'](removeEntity(_0x14e745,null))[_0xa153('0x46')](handleError(_0x14e745,null));};exports[_0xa153('0x4a')]=function(_0x3927e1,_0x1ece42){return db[_0xa153('0x2d')]['describe']()[_0xa153('0x26')](respondWithResult(_0x1ece42,null))[_0xa153('0x46')](handleError(_0x1ece42,null));};
\ No newline at end of file
+var _0x8813=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','update','destroy','then','end','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','include','find','catch','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3590ed,_0x3a4587){var _0x21f72f=function(_0x45be21){while(--_0x45be21){_0x3590ed['push'](_0x3590ed['shift']());}};_0x21f72f(++_0x3a4587);}(_0x8813,0xd3));var _0x3881=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8813[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3881('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3881('0x1'));var rp=require(_0x3881('0x2'));var moment=require(_0x3881('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3881('0x4'));var util=require(_0x3881('0x5'));var path=require(_0x3881('0x6'));var sox=require(_0x3881('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3881('0x8'));var crypto=require(_0x3881('0x9'));var jsforce=require(_0x3881('0xa'));var deskjs=require(_0x3881('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3881('0xc'));var Papa=require(_0x3881('0xd'));var Redis=require(_0x3881('0xe'));var authService=require(_0x3881('0xf'));var qs=require(_0x3881('0x10'));var as=require(_0x3881('0x11'));var hardwareService=require(_0x3881('0x12'));var logger=require(_0x3881('0x13'))(_0x3881('0x14'));var utils=require(_0x3881('0x15'));var config=require(_0x3881('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3881('0x17'))['db'];function respondWithStatusCode(_0x188ea8,_0x559f94){_0x559f94=_0x559f94||0xcc;return function(_0x330764){if(_0x330764){return _0x188ea8[_0x3881('0x18')](_0x559f94);}return _0x188ea8['status'](_0x559f94)['end']();};}function respondWithResult(_0x416e1b,_0x297869){_0x297869=_0x297869||0xc8;return function(_0x44b541){if(_0x44b541){return _0x416e1b[_0x3881('0x19')](_0x297869)['json'](_0x44b541);}};}function respondWithFilteredResult(_0x422f00,_0x254d87){return function(_0x3f7533){if(_0x3f7533){var _0x4c07be=typeof _0x254d87[_0x3881('0x1a')]===_0x3881('0x1b')&&typeof _0x254d87['limit']===_0x3881('0x1b');var _0x5dce5a=_0x3f7533['count'];var _0x1ecde4=_0x4c07be?0x0:_0x254d87['offset'];var _0x362ae4=_0x4c07be?_0x3f7533[_0x3881('0x1c')]:_0x254d87[_0x3881('0x1a')]+_0x254d87[_0x3881('0x1d')];var _0x44bd1d;if(_0x362ae4>=_0x5dce5a){_0x362ae4=_0x5dce5a;_0x44bd1d=0xc8;}else{_0x44bd1d=0xce;}_0x422f00['status'](_0x44bd1d);return _0x422f00[_0x3881('0x1e')]('Content-Range',_0x1ecde4+'-'+_0x362ae4+'/'+_0x5dce5a)[_0x3881('0x1f')](_0x3f7533);}return null;};}function patchUpdates(_0x2aae61){return function(_0x4b964f){try{jsonpatch[_0x3881('0x20')](_0x4b964f,_0x2aae61,!![]);}catch(_0xe54d38){return BPromise[_0x3881('0x21')](_0xe54d38);}return _0x4b964f['save']();};}function saveUpdates(_0x253b65,_0x2b5f57){return function(_0x158b61){if(_0x158b61){return _0x158b61[_0x3881('0x22')](_0x253b65)['then'](function(_0x5cd4c1){return _0x5cd4c1;});}return null;};}function removeEntity(_0x2255bd,_0xd9249a){return function(_0x1dc1e7){if(_0x1dc1e7){return _0x1dc1e7[_0x3881('0x23')]()[_0x3881('0x24')](function(){_0x2255bd['status'](0xcc)[_0x3881('0x25')]();});}};}function handleEntityNotFound(_0x14a3fc,_0x30d718){return function(_0x15caeb){if(!_0x15caeb){_0x14a3fc[_0x3881('0x18')](0x194);}return _0x15caeb;};}function handleError(_0x474bd7,_0x46d898){_0x46d898=_0x46d898||0x1f4;return function(_0x483ee5){logger[_0x3881('0x26')](_0x483ee5['stack']);if(_0x483ee5[_0x3881('0x27')]){delete _0x483ee5[_0x3881('0x27')];}_0x474bd7[_0x3881('0x19')](_0x46d898)['send'](_0x483ee5);};}exports[_0x3881('0x28')]=function(_0x2847ff,_0x3b15c2){var _0x106905={},_0xfd9ec6={},_0x48565b={'count':0x0,'rows':[]};var _0x2e40e5=_[_0x3881('0x29')](db[_0x3881('0x2a')][_0x3881('0x2b')],function(_0x19b3f1){return{'name':_0x19b3f1[_0x3881('0x2c')],'type':_0x19b3f1[_0x3881('0x2d')][_0x3881('0x2e')]};});_0xfd9ec6[_0x3881('0x2f')]=_[_0x3881('0x29')](_0x2e40e5,_0x3881('0x27'));_0xfd9ec6[_0x3881('0x30')]=_[_0x3881('0x31')](_0x2847ff['query']);_0xfd9ec6['filters']=_[_0x3881('0x32')](_0xfd9ec6[_0x3881('0x2f')],_0xfd9ec6[_0x3881('0x30')]);_0x106905['attributes']=_[_0x3881('0x32')](_0xfd9ec6['model'],qs[_0x3881('0x33')](_0x2847ff[_0x3881('0x30')]['fields']));_0x106905['attributes']=_0x106905[_0x3881('0x34')][_0x3881('0x35')]?_0x106905['attributes']:_0xfd9ec6[_0x3881('0x2f')];if(!_0x2847ff[_0x3881('0x30')][_0x3881('0x36')](_0x3881('0x37'))){_0x106905['limit']=qs[_0x3881('0x1d')](_0x2847ff['query'][_0x3881('0x1d')]);_0x106905[_0x3881('0x1a')]=qs['offset'](_0x2847ff[_0x3881('0x30')][_0x3881('0x1a')]);}_0x106905[_0x3881('0x38')]=qs[_0x3881('0x39')](_0x2847ff[_0x3881('0x30')]['sort']);_0x106905[_0x3881('0x3a')]=qs[_0x3881('0x3b')](_[_0x3881('0x3c')](_0x2847ff[_0x3881('0x30')],_0xfd9ec6[_0x3881('0x3b')]),_0x2e40e5);if(_0x2847ff[_0x3881('0x30')][_0x3881('0x3d')]){_0x106905[_0x3881('0x3a')]=_[_0x3881('0x3e')](_0x106905['where'],{'$or':_['map'](_0x2e40e5,function(_0x27db35){if(_0x27db35[_0x3881('0x2d')]!==_0x3881('0x3f')){var _0x21ba4d={};_0x21ba4d[_0x27db35['name']]={'$like':'%'+_0x2847ff[_0x3881('0x30')][_0x3881('0x3d')]+'%'};return _0x21ba4d;}})});}_0x106905=_[_0x3881('0x3e')]({},_0x106905,_0x2847ff[_0x3881('0x40')]);var _0x58720a={'where':_0x106905[_0x3881('0x3a')]};return db['ChatTransferReport'][_0x3881('0x1c')](_0x58720a)['then'](function(_0x1eb531){_0x48565b[_0x3881('0x1c')]=_0x1eb531;if(_0x2847ff[_0x3881('0x30')][_0x3881('0x41')]){_0x106905['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x3881('0x42')](_0x106905);})[_0x3881('0x24')](function(_0x48080a){_0x48565b['rows']=_0x48080a;return _0x48565b;})[_0x3881('0x24')](respondWithFilteredResult(_0x3b15c2,_0x106905))['catch'](handleError(_0x3b15c2,null));};exports[_0x3881('0x43')]=function(_0x43cf9a,_0xd5b8c1){var _0x126b58={'raw':!![],'where':{'id':_0x43cf9a[_0x3881('0x44')]['id']}},_0x553edc={};_0x553edc['model']=_[_0x3881('0x31')](db[_0x3881('0x2a')][_0x3881('0x2b')]);_0x553edc[_0x3881('0x30')]=_[_0x3881('0x31')](_0x43cf9a['query']);_0x553edc[_0x3881('0x3b')]=_['intersection'](_0x553edc['model'],_0x553edc[_0x3881('0x30')]);_0x126b58[_0x3881('0x34')]=_[_0x3881('0x32')](_0x553edc[_0x3881('0x2f')],qs[_0x3881('0x33')](_0x43cf9a['query'][_0x3881('0x33')]));_0x126b58[_0x3881('0x34')]=_0x126b58['attributes'][_0x3881('0x35')]?_0x126b58[_0x3881('0x34')]:_0x553edc['model'];if(_0x43cf9a[_0x3881('0x30')][_0x3881('0x41')]){_0x126b58[_0x3881('0x45')]=[{'all':!![]}];}_0x126b58=_[_0x3881('0x3e')]({},_0x126b58,_0x43cf9a[_0x3881('0x40')]);return db[_0x3881('0x2a')][_0x3881('0x46')](_0x126b58)[_0x3881('0x24')](handleEntityNotFound(_0xd5b8c1,null))[_0x3881('0x24')](respondWithResult(_0xd5b8c1,null))[_0x3881('0x47')](handleError(_0xd5b8c1,null));};exports[_0x3881('0x48')]=function(_0x2f97ee,_0x575ce3){return db[_0x3881('0x2a')][_0x3881('0x48')](_0x2f97ee['body'],{})[_0x3881('0x24')](respondWithResult(_0x575ce3,0xc9))[_0x3881('0x47')](handleError(_0x575ce3,null));};exports[_0x3881('0x22')]=function(_0x162126,_0x43d93b){if(_0x162126['body']['id']){delete _0x162126[_0x3881('0x49')]['id'];}return db[_0x3881('0x2a')]['find']({'where':{'id':_0x162126['params']['id']}})[_0x3881('0x24')](handleEntityNotFound(_0x43d93b,null))[_0x3881('0x24')](saveUpdates(_0x162126[_0x3881('0x49')],null))[_0x3881('0x24')](respondWithResult(_0x43d93b,null))['catch'](handleError(_0x43d93b,null));};exports[_0x3881('0x23')]=function(_0x4a0e81,_0x1babe7){return db[_0x3881('0x2a')][_0x3881('0x46')]({'where':{'id':_0x4a0e81[_0x3881('0x44')]['id']}})[_0x3881('0x24')](handleEntityNotFound(_0x1babe7,null))[_0x3881('0x24')](removeEntity(_0x1babe7,null))['catch'](handleError(_0x1babe7,null));};exports['describe']=function(_0x31c29e,_0xdd6da1){return db['ChatTransferReport'][_0x3881('0x4a')]()['then'](respondWithResult(_0xdd6da1,null))[_0x3881('0x47')](handleError(_0xdd6da1,null));};
\ No newline at end of file
index 1f39f20..bb8ea5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2967=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x2967,0x15d));var _0x7296=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x2967[_0x3f477c];return _0x4c36b3;};'use strict';var _=require(_0x7296('0x0'));var util=require(_0x7296('0x1'));var logger=require('../../config/logger')(_0x7296('0x2'));var moment=require(_0x7296('0x3'));var BPromise=require(_0x7296('0x4'));var rp=require(_0x7296('0x5'));var fs=require('fs');var path=require(_0x7296('0x6'));var rimraf=require(_0x7296('0x7'));var config=require(_0x7296('0x8'));var attributes=require(_0x7296('0x9'));module[_0x7296('0xa')]=function(_0x3be96a,_0xec8756){return _0x3be96a[_0x7296('0xb')](_0x7296('0xc'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x7296('0xd'),'fields':[_0x7296('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2766=['ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x2370e8,_0x2f4a38){var _0x384b32=function(_0x318984){while(--_0x318984){_0x2370e8['push'](_0x2370e8['shift']());}};_0x384b32(++_0x2f4a38);}(_0x2766,0xdb));var _0x6276=function(_0x3dc85,_0x4f2d39){_0x3dc85=_0x3dc85-0x0;var _0x3e938e=_0x2766[_0x3dc85];return _0x3e938e;};'use strict';var _=require('lodash');var util=require(_0x6276('0x0'));var logger=require(_0x6276('0x1'))(_0x6276('0x2'));var moment=require(_0x6276('0x3'));var BPromise=require(_0x6276('0x4'));var rp=require(_0x6276('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6276('0x6'));var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x6276('0x7')]=function(_0x23d61e,_0x104b18){return _0x23d61e[_0x6276('0x8')](_0x6276('0x9'),attributes,{'tableName':_0x6276('0xa'),'paranoid':![],'indexes':[{'name':_0x6276('0xb'),'fields':[_0x6276('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 609b902..6e5941e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eee=['http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4fc583,_0x1c9563){var _0x3b884d=function(_0xe8ac6f){while(--_0xe8ac6f){_0x4fc583['push'](_0x4fc583['shift']());}};_0x3b884d(++_0x1c9563);}(_0x7eee,0x108));var _0xe7ee=function(_0x4b8b6a,_0x3aa424){_0x4b8b6a=_0x4b8b6a-0x0;var _0x4445ba=_0x7eee[_0x4b8b6a];return _0x4445ba;};'use strict';var _=require(_0xe7ee('0x0'));var util=require(_0xe7ee('0x1'));var moment=require(_0xe7ee('0x2'));var BPromise=require(_0xe7ee('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7ee('0x4'))['db'];var utils=require(_0xe7ee('0x5'));var logger=require(_0xe7ee('0x6'))(_0xe7ee('0x7'));var config=require(_0xe7ee('0x8'));var jayson=require(_0xe7ee('0x9'));var client=jayson[_0xe7ee('0xa')][_0xe7ee('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x82345,_0x2a7f35,_0x4c203e){return new BPromise(function(_0x99ecc5,_0x523806){return client[_0xe7ee('0xc')](_0x82345,_0x4c203e)[_0xe7ee('0xd')](function(_0x5f6e82){logger[_0xe7ee('0xe')](_0xe7ee('0xf'),_0x2a7f35,_0xe7ee('0x10'));logger[_0xe7ee('0x11')](_0xe7ee('0x12'),_0x2a7f35,_0xe7ee('0x10'),JSON[_0xe7ee('0x13')](_0x5f6e82));if(_0x5f6e82[_0xe7ee('0x14')]){if(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x15')]===0x1f4){logger[_0xe7ee('0x14')](_0xe7ee('0xf'),_0x2a7f35,_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);return _0x523806(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);}logger['error'](_0xe7ee('0xf'),_0x2a7f35,_0x5f6e82[_0xe7ee('0x14')]['message']);return _0x99ecc5(_0x5f6e82[_0xe7ee('0x14')][_0xe7ee('0x16')]);}else{logger[_0xe7ee('0xe')](_0xe7ee('0xf'),_0x2a7f35,'request\x20sent');_0x99ecc5(_0x5f6e82[_0xe7ee('0x17')]['message']);}})[_0xe7ee('0x18')](function(_0x491867){logger['error'](_0xe7ee('0xf'),_0x2a7f35,_0x491867);_0x523806(_0x491867);});});}
\ No newline at end of file
+var _0xb1ef=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2538cc,_0x19ea15){var _0xa8c32e=function(_0x26b383){while(--_0x26b383){_0x2538cc['push'](_0x2538cc['shift']());}};_0xa8c32e(++_0x19ea15);}(_0xb1ef,0x186));var _0xfb1e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1ef[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfb1e('0x0'));var util=require(_0xfb1e('0x1'));var moment=require(_0xfb1e('0x2'));var BPromise=require(_0xfb1e('0x3'));var rs=require(_0xfb1e('0x4'));var fs=require('fs');var Redis=require(_0xfb1e('0x5'));var db=require(_0xfb1e('0x6'))['db'];var utils=require(_0xfb1e('0x7'));var logger=require(_0xfb1e('0x8'))(_0xfb1e('0x9'));var config=require(_0xfb1e('0xa'));var jayson=require(_0xfb1e('0xb'));var client=jayson[_0xfb1e('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399ad2,_0x1464f0,_0x56fa58){return new BPromise(function(_0x265c21,_0x2480a5){return client['request'](_0x399ad2,_0x56fa58)['then'](function(_0x56d58c){logger['info'](_0xfb1e('0xd'),_0x1464f0,_0xfb1e('0xe'));logger['debug'](_0xfb1e('0xf'),_0x1464f0,_0xfb1e('0xe'),JSON[_0xfb1e('0x10')](_0x56d58c));if(_0x56d58c[_0xfb1e('0x11')]){if(_0x56d58c[_0xfb1e('0x11')]['code']===0x1f4){logger[_0xfb1e('0x11')](_0xfb1e('0xd'),_0x1464f0,_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);return _0x2480a5(_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);}logger[_0xfb1e('0x11')](_0xfb1e('0xd'),_0x1464f0,_0x56d58c[_0xfb1e('0x11')][_0xfb1e('0x12')]);return _0x265c21(_0x56d58c[_0xfb1e('0x11')]['message']);}else{logger[_0xfb1e('0x13')](_0xfb1e('0xd'),_0x1464f0,'request\x20sent');_0x265c21(_0x56d58c[_0xfb1e('0x14')]['message']);}})[_0xfb1e('0x15')](function(_0x6af7fb){logger[_0xfb1e('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x1464f0,_0x6af7fb);_0x2480a5(_0x6af7fb);});});}
\ No newline at end of file
index f9fb6b6..29f1f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5045=['../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4edd47,_0x58e0e1){var _0x61a0b5=function(_0x4c8e18){while(--_0x4c8e18){_0x4edd47['push'](_0x4edd47['shift']());}};_0x61a0b5(++_0x58e0e1);}(_0x5045,0xec));var _0x5504=function(_0x2b6e8b,_0x549fa4){_0x2b6e8b=_0x2b6e8b-0x0;var _0x4c6a40=_0x5045[_0x2b6e8b];return _0x4c6a40;};'use strict';var multer=require(_0x5504('0x0'));var util=require(_0x5504('0x1'));var path=require(_0x5504('0x2'));var timeout=require(_0x5504('0x3'));var express=require(_0x5504('0x4'));var router=express[_0x5504('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5504('0x6'));var interaction=require(_0x5504('0x7'));var config=require(_0x5504('0x8'));var controller=require(_0x5504('0x9'));router[_0x5504('0xa')]('/',auth['isAuthenticated'](),controller[_0x5504('0xb')]);router[_0x5504('0xa')](_0x5504('0xc'),auth[_0x5504('0xd')](),controller['describe']);router[_0x5504('0xa')]('/:id',auth[_0x5504('0xd')](),controller[_0x5504('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5504('0xf')]);router[_0x5504('0x10')](_0x5504('0x11'),auth['isAuthenticated'](),controller[_0x5504('0x12')]);router[_0x5504('0x13')](_0x5504('0x11'),auth[_0x5504('0xd')](),controller[_0x5504('0x14')]);module[_0x5504('0x15')]=router;
\ No newline at end of file
+var _0x95a7=['get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller'];(function(_0x156e8a,_0x5f4379){var _0x10da89=function(_0x2c212e){while(--_0x2c212e){_0x156e8a['push'](_0x156e8a['shift']());}};_0x10da89(++_0x5f4379);}(_0x95a7,0x129));var _0x795a=function(_0x24f862,_0x4b645a){_0x24f862=_0x24f862-0x0;var _0x198aa4=_0x95a7[_0x24f862];return _0x198aa4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x795a('0x0'));var timeout=require(_0x795a('0x1'));var express=require(_0x795a('0x2'));var router=express[_0x795a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x795a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x795a('0x5'));var controller=require(_0x795a('0x6'));router[_0x795a('0x7')]('/',auth[_0x795a('0x8')](),controller[_0x795a('0x9')]);router[_0x795a('0x7')](_0x795a('0xa'),auth[_0x795a('0x8')](),controller['describe']);router[_0x795a('0x7')]('/:id',auth[_0x795a('0x8')](),controller[_0x795a('0xb')]);router[_0x795a('0xc')]('/',auth[_0x795a('0x8')](),controller[_0x795a('0xd')]);router[_0x795a('0xe')](_0x795a('0xf'),auth[_0x795a('0x8')](),controller[_0x795a('0x10')]);router[_0x795a('0x11')]('/:id',auth[_0x795a('0x8')](),controller[_0x795a('0x12')]);module['exports']=router;
\ No newline at end of file
index c969b26..0a57923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x2dae,0xc3));var _0xe2da=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x2dae[_0x3a78a0];return _0x48e917;};'use strict';var Sequelize=require(_0xe2da('0x0'));var rs=require('randomstring');module[_0xe2da('0x1')]={'name':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'unique':_0xe2da('0x3')},'description':{'type':Sequelize[_0xe2da('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x4')},'mapKeyOffline':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x4')},'key':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x5')},'customerAlias':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xe2da('0x2')]},'animation':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xe2da('0xa')](_0xe2da('0xb'),_0xe2da('0xc')),'defaultValue':_0xe2da('0xb')},'header_online':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'header_offline':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xe')},'download_transcript':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xe2da('0x11')},'noteTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x12')},'placeholderMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x13')},'closingMessageButton':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'skipMessageButton':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x14')},'ratingType':{'type':Sequelize[_0xe2da('0xa')](_0xe2da('0x15'),_0xe2da('0x16')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xe2da('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xe2da('0x17')]({'items':[{'type':_0xe2da('0x18'),'variable':null,'config':{'placeholder':_0xe2da('0x19'),'type':_0xe2da('0x1a'),'required':!![]},'props':{'title':_0xe2da('0x19'),'helpText':''}},{'type':_0xe2da('0x18'),'props':{'title':_0xe2da('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe2da('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xe2da('0x1b')](_0xe2da('0x1c'))?JSON[_0xe2da('0x1d')](this[_0xe2da('0x1b')](_0xe2da('0x1c'))):{};},'set':function(_0x230fb8){return this[_0xe2da('0x1e')]('onlineForm',JSON[_0xe2da('0x17')](_0x230fb8));}},'offlineForm':{'type':Sequelize[_0xe2da('0x1f')],'defaultValue':function(){return JSON[_0xe2da('0x17')]({'items':[{'type':_0xe2da('0x18'),'props':{'title':_0xe2da('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xe2da('0x4'),'type':_0xe2da('0x4')},'variable':null},{'type':_0xe2da('0x20'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xe2da('0x1b')](_0xe2da('0x21'))?JSON[_0xe2da('0x1d')](this[_0xe2da('0x1b')]('offlineForm')):{};},'set':function(_0x490794){return this[_0xe2da('0x1e')](_0xe2da('0x21'),JSON[_0xe2da('0x17')](_0x490794));}},'token':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':function(){return rs[_0xe2da('0x22')]();}},'autoclose':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xe2da('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x23')},'waitingMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x25')},'offlineMessageBody':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x27')},'skipUnmanaged':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x28')},'sendUnmanaged':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xe2da('0x1f')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xe2da('0x2')]},'notificationTemplate':{'type':Sequelize[_0xe2da('0x1f')],'defaultValue':function(){return _0xe2da('0x29');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2b')},'messagesAlignment':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2c')},'defaultTitle':{'type':Sequelize[_0xe2da('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe2da('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe2da('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':_0xe2da('0x2e')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![],'comment':_0xe2da('0x2f'),'set':function(_0x26ba99){if(!_0x26ba99)this[_0xe2da('0x1e')](_0xe2da('0x30'),null);this[_0xe2da('0x1e')](_0xe2da('0x31'),_0x26ba99);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xe2da('0x2')]},'vidaooTopic':{'type':Sequelize[_0xe2da('0x2')],'allowNull':![],'defaultValue':_0xe2da('0x32')},'vidaooNote':{'type':Sequelize[_0xe2da('0x2')],'defaultValue':function(){return _0xe2da('0x33');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xe2da('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xe2da('0x1f')]}};
\ No newline at end of file
+var _0x41bb=['Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','We\x20are\x20here!','Chat','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','star','thumb','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion'];(function(_0x2b1fc7,_0x55d41f){var _0x2bf78f=function(_0x3414f0){while(--_0x3414f0){_0x2b1fc7['push'](_0x2b1fc7['shift']());}};_0x2bf78f(++_0x55d41f);}(_0x41bb,0xc5));var _0xb41b=function(_0x366653,_0x4ec323){_0x366653=_0x366653-0x0;var _0x2a5739=_0x41bb[_0x366653];return _0x2a5739;};'use strict';var Sequelize=require(_0xb41b('0x0'));var rs=require(_0xb41b('0x1'));module['exports']={'name':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb41b('0x3')},'description':{'type':Sequelize[_0xb41b('0x2')]},'mapKey':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x4')},'key':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xb41b('0x2')]},'animation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xb41b('0x9'),'squared'),'defaultValue':_0xb41b('0x9')},'header_online':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xa')},'start_chat_button':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0xc')},'header_offline':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xd')},'download_transcript':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xb41b('0xe')]},'closingQuestion':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xf')},'formSubmitSuccessMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x10')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x11')},'noteTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x12')},'placeholderMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x13')},'closingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x14')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xb41b('0x16')](_0xb41b('0x17'),_0xb41b('0x18')),'defaultValue':_0xb41b('0x17')},'ratingStarsNumber':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xb41b('0x19'),'type':_0xb41b('0x1a'),'required':!![]},'props':{'title':_0xb41b('0x19'),'helpText':''}},{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xb41b('0x1b')](_0xb41b('0x1c'))?JSON['parse'](this[_0xb41b('0x1b')]('onlineForm')):{};},'set':function(_0x2d0f27){return this[_0xb41b('0x1d')]('onlineForm',JSON[_0xb41b('0x1e')](_0x2d0f27));}},'offlineForm':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0xb41b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xb41b('0x4'),'type':_0xb41b('0x4')},'variable':null},{'type':_0xb41b('0x1f'),'config':{'placeholder':_0xb41b('0x20')},'props':{'title':_0xb41b('0x20'),'helpText':_0xb41b('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xb41b('0x22'))?JSON[_0xb41b('0x23')](this['getDataValue'](_0xb41b('0x22'))):{};},'set':function(_0x482764){return this[_0xb41b('0x1d')](_0xb41b('0x22'),JSON['stringify'](_0x482764));}},'token':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xb41b('0x2')]},'forwardOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xb41b('0x2')]},'waitingTitle':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x24')},'waitingMessage':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x25')},'offlineMessageSubject':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x26')},'offlineMessageBody':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x15')},'sendUnmanaged':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xb41b('0x2')]},'notificationTemplate':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':function(){return _0xb41b('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x29')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xb41b('0x2a')},'defaultTitle':{'type':Sequelize[_0xb41b('0x2')]},'customerAvatar':{'type':Sequelize[_0xb41b('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xb41b('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb41b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb41b('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':_0xb41b('0x2c')},'systemAvatar':{'type':Sequelize[_0xb41b('0xe')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb41b('0x7')],'comment':_0xb41b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49e8c4){if(!_0x49e8c4)this['setDataValue'](_0xb41b('0x2e'),null);this['setDataValue']('mandatoryDisposition',_0x49e8c4);}},'vidaooEscalation':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![],'defaultValue':_0xb41b('0x2f')},'vidaooNote':{'type':Sequelize[_0xb41b('0x2')],'defaultValue':function(){return _0xb41b('0x30');}},'vidaooMetadata':{'type':Sequelize[_0xb41b('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xb41b('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xb41b('0xe')]}};
\ No newline at end of file
index f4a69b8..127d9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7995=['offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','offline-chat','basename','openNewInteraction','sequelize','transaction','bulkCreate','findOne','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','attachments','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','timezone','inspect','Interval','getProactiveActions','../../config/license/util','License','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.ejs','remote','x-real-ip','virtual','replace','alignment','labelText','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','destroy','ChatWebsites','UserProfileResource','stack','send','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','name','filter','ChatWebsite','includeAll','include','findAll','show','params','Pause','mandatoryDispositionPause','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','ChatWebsiteId','getDispositions','Disposition','map','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','options','removeAnswers','addLogo','sitepic','filename','addAvatar','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','root','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','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','setUA','user-agent','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','ChatApplication','Applications','List','applications','list','orderBy','account','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','%s\x20%s\x20%s','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','contact','messageId','update','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7995,0x19f));var _0x5799=function(_0x10329c,_0x84cda4){_0x10329c=_0x10329c-0x0;var _0x59a9ee=_0x7995[_0x10329c];return _0x59a9ee;};'use strict';var BPromise=require(_0x5799('0x0'));var Mustache=require(_0x5799('0x1'));var util=require(_0x5799('0x2'));var path=require('path');var ejs=require(_0x5799('0x3'));var fs=require('fs');var fs_extra=require(_0x5799('0x4'));var _=require(_0x5799('0x5'));var querystring=require('querystring');var Redis=require(_0x5799('0x6'));var qs=require(_0x5799('0x7'));var logger=require('../../config/logger')(_0x5799('0x8'));var config=require(_0x5799('0x9'));var db=require('../../mysqldb')['db'];config[_0x5799('0xa')]=_[_0x5799('0xb')](config[_0x5799('0xa')],{'host':_0x5799('0xc'),'port':0x18eb});var socket=require(_0x5799('0xd'))(new Redis(config[_0x5799('0xa')]));require(_0x5799('0xe'))[_0x5799('0xf')](socket);var htmlToText=require(_0x5799('0x10'));var jayson=require(_0x5799('0x11'));var client=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x232c});var client9002=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x232a});var client9003=jayson['client'][_0x5799('0x13')]({'port':0x232b});var client9001=jayson[_0x5799('0x12')][_0x5799('0x13')]({'port':0x2329});function respondWithRpcPromise(_0x10b478,_0x22ec26,_0x398ee4,_0x1bedf5){return new BPromise(function(_0x21eb3d,_0x5b8352){var _0x462468=_0x1bedf5||client;return _0x462468[_0x5799('0x14')](_0x10b478,_0x398ee4)[_0x5799('0x15')](function(_0x30931d){logger['info'](_0x5799('0x16'),_0x22ec26,_0x5799('0x17'));logger[_0x5799('0x18')](_0x5799('0x19'),_0x22ec26,'request\x20sent',JSON[_0x5799('0x1a')](_0x30931d));if(_0x30931d['error']){if(_0x30931d[_0x5799('0x1b')][_0x5799('0x1c')]===0x1f4){logger[_0x5799('0x1b')](_0x5799('0x16'),_0x22ec26,_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);return _0x5b8352(_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x22ec26,_0x30931d[_0x5799('0x1b')][_0x5799('0x1d')]);return _0x21eb3d(_0x30931d[_0x5799('0x1b')]['message']);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x22ec26,'request\x20sent');_0x21eb3d(_0x30931d[_0x5799('0x1e')][_0x5799('0x1d')]);}})[_0x5799('0x1f')](function(_0x11351f){logger[_0x5799('0x1b')](_0x5799('0x16'),_0x22ec26,_0x11351f);_0x5b8352(_0x11351f);});});}function respondWithStatusCode(_0x15218a,_0x122e60){_0x122e60=_0x122e60||0xcc;return function(_0x32de29){if(_0x32de29){return _0x15218a[_0x5799('0x20')](_0x122e60);}return _0x15218a['status'](_0x122e60)[_0x5799('0x21')]();};}function respondWithResult(_0x5c196e,_0x5e0d86){_0x5e0d86=_0x5e0d86||0xc8;return function(_0x1cb708){if(_0x1cb708){return _0x5c196e[_0x5799('0x22')](_0x5e0d86)[_0x5799('0x23')](_0x1cb708);}};}function respondWithFilteredResult(_0xc8aae6,_0x506ab3){return function(_0x385144){if(_0x385144){var _0x92786a=typeof _0x506ab3['offset']===_0x5799('0x24')&&typeof _0x506ab3[_0x5799('0x25')]===_0x5799('0x24');var _0x4901df=_0x385144[_0x5799('0x26')];var _0x53afa7=_0x92786a?0x0:_0x506ab3[_0x5799('0x27')];var _0x22eb16=_0x92786a?_0x385144[_0x5799('0x26')]:_0x506ab3[_0x5799('0x27')]+_0x506ab3[_0x5799('0x25')];var _0x1036ea;if(_0x22eb16>=_0x4901df){_0x22eb16=_0x4901df;_0x1036ea=0xc8;}else{_0x1036ea=0xce;}_0xc8aae6[_0x5799('0x22')](_0x1036ea);return _0xc8aae6[_0x5799('0x28')](_0x5799('0x29'),_0x53afa7+'-'+_0x22eb16+'/'+_0x4901df)['json'](_0x385144);}return null;};}function saveUpdates(_0x3a5dec){return function(_0xb7afac){if(_0xb7afac){return _0xb7afac['update'](_0x3a5dec)[_0x5799('0x15')](function(_0x117161){return _0x117161;});}return null;};}function removeEntity(_0x68dd1a){return function(_0x3ecfba){if(_0x3ecfba){return _0x3ecfba[_0x5799('0x2a')]()[_0x5799('0x15')](function(){var _0x12cdd1=_0x3ecfba['get']({'plain':!![]});var _0x51e1fb=_0x5799('0x2b');return db[_0x5799('0x2c')]['destroy']({'where':{'type':_0x51e1fb,'resourceId':_0x12cdd1['id']}})[_0x5799('0x15')](function(){return _0x3ecfba;});})['then'](function(){_0x68dd1a[_0x5799('0x22')](0xcc)[_0x5799('0x21')]();});}};}function handleEntityNotFound(_0x526200){return function(_0x159f6b){if(!_0x159f6b){_0x526200[_0x5799('0x20')](0x194);}return _0x159f6b;};}function handleError(_0x1b363a,_0x1850a7){_0x1850a7=_0x1850a7||0x1f4;return function(_0x12c533){logger['error'](_0x12c533[_0x5799('0x2d')]);if(_0x12c533['name']){delete _0x12c533['name'];}_0x1b363a['status'](_0x1850a7)[_0x5799('0x2e')](_0x12c533);};}exports[_0x5799('0x2f')]=function(_0x5102bb,_0x23119b){var _0x1d9e35={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3f9215={},_0x29d695={'count':0x0,'rows':[]};var _0x5c3ae7=_['map'](db['ChatWebsite'][_0x5799('0x30')],function(_0x1172b7){return{'name':_0x1172b7['fieldName'],'type':_0x1172b7[_0x5799('0x31')][_0x5799('0x32')]};});_0x3f9215[_0x5799('0x33')]=_['map'](_0x5c3ae7,'name');_0x3f9215[_0x5799('0x34')]=_[_0x5799('0x35')](_0x5102bb[_0x5799('0x34')]);_0x3f9215[_0x5799('0x36')]=_[_0x5799('0x37')](_0x3f9215[_0x5799('0x33')],_0x3f9215[_0x5799('0x34')]);_0x1d9e35[_0x5799('0x38')]=_[_0x5799('0x37')](_0x3f9215[_0x5799('0x33')],qs[_0x5799('0x39')](_0x5102bb['query'][_0x5799('0x39')]));_0x1d9e35[_0x5799('0x38')]=_0x1d9e35[_0x5799('0x38')]['length']?_0x1d9e35[_0x5799('0x38')]:_0x3f9215['model'];if(!_0x5102bb[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x1d9e35[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x5102bb[_0x5799('0x34')][_0x5799('0x25')]);_0x1d9e35['offset']=qs['offset'](_0x5102bb[_0x5799('0x34')]['offset']);}_0x1d9e35[_0x5799('0x3c')]=qs[_0x5799('0x3d')](_0x5102bb['query'][_0x5799('0x3d')]);_0x1d9e35[_0x5799('0x3e')]=qs['filters'](_[_0x5799('0x3f')](_0x5102bb[_0x5799('0x34')],_0x3f9215[_0x5799('0x36')]),_0x5c3ae7);if(_0x5102bb[_0x5799('0x34')]['filter']){_0x1d9e35[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x1d9e35[_0x5799('0x3e')],{'$or':_['map'](_0x5c3ae7,function(_0xc35794){if(_0xc35794[_0x5799('0x31')]!==_0x5799('0x41')){var _0x5b7ecf={};_0x5b7ecf[_0xc35794[_0x5799('0x42')]]={'$like':'%'+_0x5102bb[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x5b7ecf;}})});}_0x1d9e35=_[_0x5799('0x40')]({},_0x1d9e35,_0x5102bb['options']);var _0x40beb7={'where':_0x1d9e35['where']};return db[_0x5799('0x44')]['count'](_0x40beb7)[_0x5799('0x15')](function(_0x1817df){_0x29d695[_0x5799('0x26')]=_0x1817df;if(_0x5102bb[_0x5799('0x34')][_0x5799('0x45')]){_0x1d9e35[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x44')][_0x5799('0x47')](_0x1d9e35);})[_0x5799('0x15')](function(_0x9cd928){_0x29d695['rows']=_0x9cd928;return _0x29d695;})[_0x5799('0x15')](respondWithFilteredResult(_0x23119b,_0x1d9e35))[_0x5799('0x1f')](handleError(_0x23119b,null));};exports[_0x5799('0x48')]=function(_0x4c612c,_0x178369){var _0x1c396c={'raw':![],'where':{'id':_0x4c612c[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x4a')],'as':_0x5799('0x4b')}]},_0xb78ffb={};_0xb78ffb[_0x5799('0x33')]=_[_0x5799('0x35')](db['ChatWebsite'][_0x5799('0x30')]);_0xb78ffb[_0x5799('0x34')]=_[_0x5799('0x35')](_0x4c612c[_0x5799('0x34')]);_0xb78ffb[_0x5799('0x36')]=_[_0x5799('0x37')](_0xb78ffb[_0x5799('0x33')],_0xb78ffb[_0x5799('0x34')]);_0x1c396c[_0x5799('0x38')]=_[_0x5799('0x37')](_0xb78ffb[_0x5799('0x33')],qs['fields'](_0x4c612c[_0x5799('0x34')]['fields']));_0x1c396c[_0x5799('0x38')]=_0x1c396c[_0x5799('0x38')][_0x5799('0x4c')]?_0x1c396c['attributes']:_0xb78ffb[_0x5799('0x33')];if(_0x4c612c[_0x5799('0x34')][_0x5799('0x45')]){_0x1c396c[_0x5799('0x46')]=[{'all':!![]}];}_0x1c396c=_[_0x5799('0x40')]({},_0x1c396c,_0x4c612c['options']);return db[_0x5799('0x44')][_0x5799('0x4d')](_0x1c396c)['then'](handleEntityNotFound(_0x178369,null))['then'](respondWithResult(_0x178369,null))['catch'](handleError(_0x178369,null));};exports[_0x5799('0x4e')]=function(_0x38e63d,_0x5c35fd){return db[_0x5799('0x44')][_0x5799('0x4e')](_0x38e63d[_0x5799('0x4f')],{})[_0x5799('0x15')](function(_0x5ea290){var _0x38d1d2=_0x38e63d[_0x5799('0x50')][_0x5799('0x51')]({'plain':!![]});if(!_0x38d1d2)throw new Error(_0x5799('0x52'));if(_0x38d1d2[_0x5799('0x53')]==='user'){var _0x402f8a=_0x5ea290[_0x5799('0x51')]({'plain':!![]});var _0x223d8e=_0x5799('0x2b');return db[_0x5799('0x54')][_0x5799('0x4d')]({'where':{'name':_0x223d8e,'userProfileId':_0x38d1d2[_0x5799('0x55')]},'raw':!![]})[_0x5799('0x15')](function(_0x5c7d40){if(_0x5c7d40&&_0x5c7d40['autoAssociation']===0x0){return db[_0x5799('0x2c')][_0x5799('0x4e')]({'name':_0x402f8a[_0x5799('0x42')],'resourceId':_0x402f8a['id'],'type':_0x5c7d40['name'],'sectionId':_0x5c7d40['id']},{})[_0x5799('0x15')](function(){return _0x5ea290;});}else{return _0x5ea290;}})[_0x5799('0x1f')](function(_0x3a7dfd){logger[_0x5799('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3a7dfd);throw _0x3a7dfd;});}return _0x5ea290;})[_0x5799('0x15')](respondWithResult(_0x5c35fd,0xc9))[_0x5799('0x1f')](handleError(_0x5c35fd,null));};exports['update']=function(_0x538a1f,_0x3631e7){if(_0x538a1f['body']['id']){delete _0x538a1f[_0x5799('0x4f')]['id'];}return db[_0x5799('0x44')]['find']({'where':{'id':_0x538a1f[_0x5799('0x49')]['id']},'include':[{'model':db['Pause'],'as':_0x5799('0x4b')}]})['then'](handleEntityNotFound(_0x3631e7,null))['then'](saveUpdates(_0x538a1f['body'],null))['then'](respondWithResult(_0x3631e7,null))[_0x5799('0x1f')](handleError(_0x3631e7,null));};exports[_0x5799('0x2a')]=function(_0x4f6e72,_0x537355){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4f6e72[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x537355,null))[_0x5799('0x15')](removeEntity(_0x537355,null))[_0x5799('0x1f')](handleError(_0x537355,null));};exports['describe']=function(_0x32ce18,_0xbcb0e6){return db[_0x5799('0x44')][_0x5799('0x56')]()[_0x5799('0x15')](respondWithResult(_0xbcb0e6,null))['catch'](handleError(_0xbcb0e6,null));};exports[_0x5799('0x57')]=function(_0x388460,_0x4baf86){if(_0x388460[_0x5799('0x4f')]['id']){delete _0x388460['body']['id'];}return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x388460[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x4baf86,null))['then'](function(_0x59378c){if(_0x59378c){_0x388460[_0x5799('0x4f')][_0x5799('0x58')]=_0x59378c['id'];return db['Disposition'][_0x5799('0x4e')](_0x388460[_0x5799('0x4f')]);}})['then'](respondWithResult(_0x4baf86,null))[_0x5799('0x1f')](handleError(_0x4baf86,null));};exports[_0x5799('0x59')]=function(_0x50320a,_0x677a9){var _0x3bf202={'raw':![],'where':{}};var _0x132cb6={};var _0x35f997={'count':0x0,'rows':[]};return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x50320a['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x677a9,null))[_0x5799('0x15')](function(_0x4fb734){if(_0x4fb734){_0x132cb6[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0x5a')][_0x5799('0x30')]);_0x132cb6[_0x5799('0x34')]=_['keys'](_0x50320a[_0x5799('0x34')]);_0x132cb6[_0x5799('0x36')]=_[_0x5799('0x37')](_0x132cb6[_0x5799('0x33')],_0x132cb6[_0x5799('0x34')]);_0x3bf202['attributes']=_[_0x5799('0x37')](_0x132cb6[_0x5799('0x33')],qs[_0x5799('0x39')](_0x50320a['query'][_0x5799('0x39')]));_0x3bf202[_0x5799('0x38')]=_0x3bf202[_0x5799('0x38')][_0x5799('0x4c')]?_0x3bf202[_0x5799('0x38')]:_0x132cb6[_0x5799('0x33')];if(!_0x50320a[_0x5799('0x34')][_0x5799('0x3a')]('nolimit')){_0x3bf202[_0x5799('0x25')]=qs['limit'](_0x50320a[_0x5799('0x34')][_0x5799('0x25')]);_0x3bf202['offset']=qs['offset'](_0x50320a[_0x5799('0x34')][_0x5799('0x27')]);}_0x3bf202['order']=qs[_0x5799('0x3d')](_0x50320a[_0x5799('0x34')][_0x5799('0x3d')]);_0x3bf202[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0x50320a[_0x5799('0x34')],_0x132cb6['filters']));_0x3bf202[_0x5799('0x3e')]['ChatWebsiteId']=_0x4fb734['id'];if(_0x50320a['query'][_0x5799('0x43')]){_0x3bf202[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x3bf202[_0x5799('0x3e')],{'$or':_[_0x5799('0x5b')](_0x3bf202[_0x5799('0x38')],function(_0x3e8083){var _0x4c0b42={};_0x4c0b42[_0x3e8083]={'$like':'%'+_0x50320a[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x4c0b42;})});}_0x3bf202=_[_0x5799('0x40')]({},_0x3bf202,_0x50320a['options']);return db[_0x5799('0x5a')][_0x5799('0x26')]({'where':_0x3bf202[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x5aee4b){_0x35f997[_0x5799('0x26')]=_0x5aee4b;if(_0x50320a[_0x5799('0x34')][_0x5799('0x45')]){_0x3bf202[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x5a')][_0x5799('0x47')](_0x3bf202);})[_0x5799('0x15')](function(_0x1edd2b){_0x35f997[_0x5799('0x5c')]=_0x1edd2b;return _0x35f997;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x677a9,_0x3bf202))[_0x5799('0x1f')](handleError(_0x677a9,null));};exports[_0x5799('0x5d')]=function(_0x461965,_0x34e089){return db[_0x5799('0x44')]['find']({'where':{'id':_0x461965[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x34e089,null))[_0x5799('0x15')](function(_0x5c24fc){if(_0x5c24fc){return _0x5c24fc[_0x5799('0x5d')](_0x461965[_0x5799('0x34')][_0x5799('0x5e')]);}})[_0x5799('0x15')](respondWithStatusCode(_0x34e089,null))[_0x5799('0x1f')](handleError(_0x34e089,null));};exports[_0x5799('0x5f')]=function(_0x36cad4,_0x1f4aee){if(_0x36cad4[_0x5799('0x4f')]['id']){delete _0x36cad4[_0x5799('0x4f')]['id'];}return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x36cad4[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x1f4aee,null))[_0x5799('0x15')](function(_0x39bfc0){if(_0x39bfc0){_0x36cad4[_0x5799('0x4f')][_0x5799('0x58')]=_0x39bfc0['id'];return db['CannedAnswer'][_0x5799('0x4e')](_0x36cad4[_0x5799('0x4f')]);}})[_0x5799('0x15')](respondWithResult(_0x1f4aee,null))[_0x5799('0x1f')](handleError(_0x1f4aee,null));};exports[_0x5799('0x60')]=function(_0x13b453,_0x59e100){var _0x3f9329={'raw':![],'where':{}};var _0x376688={};var _0x4a093c={'count':0x0,'rows':[]};return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x13b453['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x59e100,null))[_0x5799('0x15')](function(_0x5b2cb3){if(_0x5b2cb3){_0x376688['model']=_[_0x5799('0x35')](db[_0x5799('0x61')][_0x5799('0x30')]);_0x376688['query']=_['keys'](_0x13b453[_0x5799('0x34')]);_0x376688[_0x5799('0x36')]=_[_0x5799('0x37')](_0x376688[_0x5799('0x33')],_0x376688[_0x5799('0x34')]);_0x3f9329[_0x5799('0x38')]=_[_0x5799('0x37')](_0x376688['model'],qs[_0x5799('0x39')](_0x13b453[_0x5799('0x34')]['fields']));_0x3f9329['attributes']=_0x3f9329[_0x5799('0x38')]['length']?_0x3f9329[_0x5799('0x38')]:_0x376688['model'];if(!_0x13b453[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x3f9329[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x13b453[_0x5799('0x34')][_0x5799('0x25')]);_0x3f9329['offset']=qs[_0x5799('0x27')](_0x13b453['query']['offset']);}_0x3f9329[_0x5799('0x3c')]=qs['sort'](_0x13b453[_0x5799('0x34')]['sort']);_0x3f9329[_0x5799('0x3e')]=qs[_0x5799('0x36')](_[_0x5799('0x3f')](_0x13b453[_0x5799('0x34')],_0x376688['filters']));_0x3f9329[_0x5799('0x3e')][_0x5799('0x58')]=_0x5b2cb3['id'];if(_0x13b453[_0x5799('0x34')][_0x5799('0x43')]){_0x3f9329[_0x5799('0x3e')]=_['merge'](_0x3f9329['where'],{'$or':_[_0x5799('0x5b')](_0x3f9329['attributes'],function(_0x113ce5){var _0x468191={};_0x468191[_0x113ce5]={'$like':'%'+_0x13b453[_0x5799('0x34')]['filter']+'%'};return _0x468191;})});}_0x3f9329=_['merge']({},_0x3f9329,_0x13b453[_0x5799('0x62')]);return db[_0x5799('0x61')]['count']({'where':_0x3f9329['where']})['then'](function(_0x1ab558){_0x4a093c[_0x5799('0x26')]=_0x1ab558;if(_0x13b453[_0x5799('0x34')][_0x5799('0x45')]){_0x3f9329[_0x5799('0x46')]=[{'all':!![]}];}return db[_0x5799('0x61')][_0x5799('0x47')](_0x3f9329);})[_0x5799('0x15')](function(_0x442f7b){_0x4a093c[_0x5799('0x5c')]=_0x442f7b;return _0x4a093c;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x59e100,_0x3f9329))[_0x5799('0x1f')](handleError(_0x59e100,null));};exports[_0x5799('0x63')]=function(_0x4108fe,_0x2b2d1f){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4108fe[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x2b2d1f,null))[_0x5799('0x15')](function(_0x429cfb){if(_0x429cfb){return _0x429cfb[_0x5799('0x63')](_0x4108fe['query'][_0x5799('0x5e')]);}})[_0x5799('0x15')](respondWithStatusCode(_0x2b2d1f,null))[_0x5799('0x1f')](handleError(_0x2b2d1f,null));};exports[_0x5799('0x64')]=function(_0x3fbc7b,_0x522e39){_0x3fbc7b[_0x5799('0x4f')][_0x5799('0x65')]=_0x3fbc7b['file'][_0x5799('0x66')];return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x3fbc7b[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x522e39,null))[_0x5799('0x15')](saveUpdates(_0x3fbc7b[_0x5799('0x4f')],null))[_0x5799('0x15')](respondWithResult(_0x522e39,null))[_0x5799('0x1f')](handleError(_0x522e39,null));};exports[_0x5799('0x67')]=function(_0x2a21dd,_0x327e0a){_0x2a21dd[_0x5799('0x4f')][_0x5799('0x68')]=_0x2a21dd[_0x5799('0x69')][_0x5799('0x66')];return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x2a21dd['params']['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x327e0a,null))['then'](saveUpdates(_0x2a21dd['body'],null))[_0x5799('0x15')](respondWithResult(_0x327e0a,null))['catch'](handleError(_0x327e0a,null));};exports['addCustomerAvatar']=function(_0x4fd393,_0x287e9e){_0x4fd393['body'][_0x5799('0x6a')]=_0x4fd393['file'][_0x5799('0x66')];return db['ChatWebsite']['find']({'where':{'id':_0x4fd393[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x287e9e,null))[_0x5799('0x15')](saveUpdates(_0x4fd393['body'],null))[_0x5799('0x15')](respondWithResult(_0x287e9e,null))[_0x5799('0x1f')](handleError(_0x287e9e,null));};exports[_0x5799('0x6b')]=function(_0x2b7970,_0x38b227){_0x2b7970[_0x5799('0x4f')][_0x5799('0x6c')]=_0x2b7970[_0x5799('0x69')]['filename'];return db[_0x5799('0x44')]['find']({'where':{'id':_0x2b7970[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x38b227,null))[_0x5799('0x15')](saveUpdates(_0x2b7970[_0x5799('0x4f')],null))['then'](respondWithResult(_0x38b227,null))['catch'](handleError(_0x38b227,null));};exports['getLogo']=function(_0xe6f591,_0x55142f){var _0xce639c=path['join'](config[_0x5799('0x6d')],_0x5799('0x6e'));var _0xf3fa4e={'where':{'id':_0xe6f591[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x65')],'raw':!![]};var _0xcad851=![];return require('../../config/license/util')[_0x5799('0x6f')]()[_0x5799('0x15')](function(_0x192775){if(_0x192775){_0xcad851=_0x192775[_0x5799('0x70')];}})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')](_0xf3fa4e);})[_0x5799('0x15')](handleEntityNotFound(_0x55142f,null))[_0x5799('0x15')](function(_0x5b9127){if(_0x5b9127){if(!_['isNil'](_0x5b9127['sitepic'])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x73'),_0x5b9127[_0x5799('0x65')]))&&_0xcad851){_0xce639c=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x73'),_0x5b9127['sitepic']);}}return _0x55142f[_0x5799('0x74')](_0xce639c);}})[_0x5799('0x1f')](handleError(_0x55142f,null));};exports[_0x5799('0x75')]=function(_0x45263b,_0x1b88a6){var _0x18f852=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x76'));var _0x5c8486={'where':{'id':_0x45263b[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x68')],'raw':!![]};return db['ChatWebsite'][_0x5799('0x4d')](_0x5c8486)[_0x5799('0x15')](handleEntityNotFound(_0x1b88a6,null))[_0x5799('0x15')](function(_0x28645e){if(_0x28645e){if(!_[_0x5799('0x77')](_0x28645e['agentAvatar'])){if(fs['existsSync'](path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x28645e[_0x5799('0x68')]))){_0x18f852=path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x28645e['agentAvatar']);}}return _0x1b88a6[_0x5799('0x74')](_0x18f852);}})['catch'](handleError(_0x1b88a6,null));};exports[_0x5799('0x79')]=function(_0x218409,_0x2b0ab1){var _0x1964eb=path[_0x5799('0x72')](config['root'],_0x5799('0x7a'));var _0x348cc2={'where':{'id':_0x218409[_0x5799('0x49')]['id']},'attributes':['id',_0x5799('0x6a'),_0x5799('0x7b')],'raw':!![]};return db[_0x5799('0x44')][_0x5799('0x4d')](_0x348cc2)[_0x5799('0x15')](handleEntityNotFound(_0x2b0ab1,null))['then'](function(_0x5b727a){if(_0x5b727a){if(!_['isNil'](_0x5b727a['customerAvatar'])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],'server/files/images/avatars/',_0x5b727a[_0x5799('0x6a')]))&&_0x5b727a['showCustomerAvatar']){_0x1964eb=path[_0x5799('0x72')](config['root'],_0x5799('0x78'),_0x5b727a[_0x5799('0x6a')]);}}return _0x2b0ab1[_0x5799('0x74')](_0x1964eb);}})[_0x5799('0x1f')](handleError(_0x2b0ab1,null));};exports[_0x5799('0x7c')]=function(_0x288c87,_0x85e016){var _0x559196=path[_0x5799('0x72')](config['root'],_0x5799('0x7d'));var _0x5c6777={'where':{'id':_0x288c87['params']['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0x5c6777)['then'](handleEntityNotFound(_0x85e016,null))['then'](function(_0x22180c){if(_0x22180c){if(!_['isNil'](_0x22180c[_0x5799('0x6c')])){if(fs[_0x5799('0x71')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x78'),_0x22180c[_0x5799('0x6c')]))){_0x559196=path['join'](config[_0x5799('0x6d')],_0x5799('0x78'),_0x22180c['systemAvatar']);}}return _0x85e016[_0x5799('0x74')](_0x559196);}})[_0x5799('0x1f')](handleError(_0x85e016,null));};exports[_0x5799('0x7e')]=function(_0x4bc9d2,_0xd6082d){var _0x42515c=require('user-agent-parser');var _0x23a813=new _0x42515c();var _0x45e2d4=_0x23a813[_0x5799('0x7f')](_0x4bc9d2['headers'][_0x5799('0x80')])[_0x5799('0x81')]();var _0x503722={'body':_0x4bc9d2[_0x5799('0x4f')],'channel':_0x5799('0x82')};var _0x253765=[];var _0x5adab4=[];var _0x36a051={};var _0x5f2631=![];return db[_0x5799('0x83')]['describe']()['then'](function(_0x27b90b){if(!_0x27b90b){throw new db['Sequelize'][(_0x5799('0x84'))]('no\x20available\x20attributes');}_0x253765=_[_0x5799('0x85')](_[_0x5799('0x35')](_0x27b90b),[_0x5799('0x86'),'updatedAt']);_0x5adab4=_[_0x5799('0x85')](_[_0x5799('0x35')](_0x27b90b),['createdAt',_0x5799('0x87'),_0x5799('0x88'),_0x5799('0x89')]);if(_0x4bc9d2[_0x5799('0x4f')]['id']){delete _0x4bc9d2[_0x5799('0x4f')]['id'];}if(_[_0x5799('0x77')](_0x4bc9d2['body']['from'])){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8b'));}if(_[_0x5799('0x77')](_0x4bc9d2['body']['body'])||_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x4f')]===''){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8c'));}if(_['isNil'](_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')])){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0x8e')+_0x5adab4);}if(!_[_0x5799('0x8f')](_0x5adab4,_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')])){throw new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x90')+_0x5adab4);}_0x36a051[_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')]]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')];})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x4bc9d2['params']['id']},'include':[{'model':db[_0x5799('0x92')],'as':'List','include':[{'model':db[_0x5799('0x83')],'as':_0x5799('0x93'),'where':_0x36a051,'limit':0x1,'order':[[_0x5799('0x87'),_0x5799('0x94')]]}]},{'model':db[_0x5799('0x95')],'as':_0x5799('0x96')}]});})[_0x5799('0x15')](handleEntityNotFound(_0xd6082d,null))['then'](function(_0x19d3a3){if(_0x19d3a3&&_0x19d3a3[_0x5799('0x97')]){_0x503722['account']=_0x19d3a3;_0x503722[_0x5799('0x98')]=_0x19d3a3[_0x5799('0x96')];_0x503722[_0x5799('0x99')]=_0x19d3a3[_0x5799('0x97')];_0x503722[_0x5799('0x98')]=_[_0x5799('0x9a')](_0x503722[_0x5799('0x98')],['priority'],['asc']);if(_0x503722[_0x5799('0x9b')][_0x5799('0x96')]){delete _0x503722['account'][_0x5799('0x96')];}if(_0x503722[_0x5799('0x9b')][_0x5799('0x97')]&&_0x503722['account']['List'][_0x5799('0x93')][_0x5799('0x4c')]){return _0x503722[_0x5799('0x9b')][_0x5799('0x97')][_0x5799('0x93')][0x0];}var _0x9d55d2=_[_0x5799('0xb')](_0x4bc9d2[_0x5799('0x4f')],{'firstName':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')],'ListId':_0x19d3a3[_0x5799('0x89')]});_0x9d55d2[_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x8d')]]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x91')];return db['CmContact'][_0x5799('0x4e')](_0x9d55d2,{'fields':_0x253765,'raw':!![]});}})[_0x5799('0x15')](handleEntityNotFound(_0xd6082d,null))[_0x5799('0x15')](function(_0x26c2cb){_0x503722['contact']=_0x26c2cb;var _0x2e9742=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x9c')];if(_0x4bc9d2['headers']['cf-connecting-ip']){_0x2e9742=_0x4bc9d2[_0x5799('0x9d')][_0x5799('0x9e')];}else if(_0x4bc9d2['headers'][_0x5799('0x9f')]){_0x2e9742=_[_0x5799('0xa0')](_0x4bc9d2['headers'][_0x5799('0x9f')][_0x5799('0xa1')](','));}if(_0x26c2cb){var _0x4bd715={'ContactId':_0x26c2cb['id'],'ChatWebsiteId':_0x4bc9d2[_0x5799('0x49')]['id'],'from':(_0x26c2cb[_0x5799('0xa2')]||'')+'\x20'+(_0x26c2cb[_0x5799('0xa3')]||''),'customerIp':_0x2e9742,'customerPort':_0x4bc9d2[_0x5799('0x9d')][_0x5799('0xa4')]?_0x4bc9d2[_0x5799('0x9d')]['x-real-port']:null,'referer':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xa5')],'browserName':_0x45e2d4[_0x5799('0xa6')][_0x5799('0x42')]&&_0x45e2d4[_0x5799('0xa6')]['version']?util[_0x5799('0xa7')](_0x5799('0xa8'),_0x45e2d4[_0x5799('0xa6')][_0x5799('0x42')],_0x45e2d4['browser']['version']):_0x5799('0xa9'),'browserVersion':_0x45e2d4[_0x5799('0xa6')][_0x5799('0xaa')]||_0x5799('0xa9'),'osName':util[_0x5799('0xa7')](_0x5799('0xa8'),_0x45e2d4['os']['name'],_0x45e2d4['os'][_0x5799('0xaa')]),'osVersion':_0x45e2d4['os'][_0x5799('0xaa')],'deviceModel':_0x45e2d4[_0x5799('0xab')][_0x5799('0x33')]&&_0x45e2d4[_0x5799('0xab')]['vendor']?util[_0x5799('0xa7')](_0x5799('0xac'),_0x45e2d4[_0x5799('0xab')]['model'],_0x45e2d4[_0x5799('0xab')]['vendor'],_0x45e2d4['device'][_0x5799('0x31')]):null,'deviceVendor':_0x45e2d4['device'][_0x5799('0xad')],'deviceType':_0x45e2d4[_0x5799('0xab')][_0x5799('0x31')],'formData':JSON[_0x5799('0x1a')](_0x4bc9d2[_0x5799('0x4f')])};var _0x1f1ad6={'ChatWebsiteId':_0x4bc9d2['params']['id'],'closed':![]};if(_0x4bc9d2['body']['threadId']){_0x1f1ad6[_0x5799('0xae')]=_0x4bc9d2['body'][_0x5799('0xae')];return db['ChatInteraction'][_0x5799('0x4d')]({'where':_0x1f1ad6})[_0x5799('0x15')](function(_0x27a83e){if(_0x27a83e){return[_0x27a83e,![]];}_0x4bd715[_0x5799('0xae')]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xae')];_0x4bd715[_0x5799('0xaf')]=_0x4bc9d2[_0x5799('0x4f')]['externalUrl'];return db[_0x5799('0xb0')][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x5c3702){return[_0x5c3702,!![]];});});}_0x1f1ad6[_0x5799('0xb1')]=_0x26c2cb['id'];if(_0x4bc9d2[_0x5799('0x4f')]['interaction']&&_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb2')]['id']){_0x1f1ad6['id']=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb2')]['id'];return db['ChatInteraction'][_0x5799('0x4d')]({'where':_0x1f1ad6})[_0x5799('0x15')](function(_0x1c629b){if(_0x1c629b){return[_0x1c629b,![]];}return db[_0x5799('0xb0')][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x5468b4){return[_0x5468b4,!![]];});});}return db['ChatInteraction'][_0x5799('0x4e')](_0x4bd715)[_0x5799('0x15')](function(_0x4867cf){return[_0x4867cf,!![]];});}})[_0x5799('0xb3')](function(_0x26cf89,_0x35629b){if(_0x26cf89){_0x5f2631=_0x35629b;if(!_0x35629b){var _0x4647fd={'from':(_0x503722[_0x5799('0xb4')][_0x5799('0xa2')]||'')+'\x20'+(_0x503722[_0x5799('0xb4')][_0x5799('0xa3')]||'')};if(_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xae')]&&_0x4bc9d2['body'][_0x5799('0xb5')]&&_0x4bc9d2[_0x5799('0x4f')]['threadId']!=_0x4bc9d2[_0x5799('0x4f')]['messageId']){_0x4647fd[_0x5799('0xae')]=_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xb5')];}return _0x26cf89[_0x5799('0xb6')](_0x4647fd);}else{return _0x26cf89;}}})['then'](function(_0x9810fe){_0x503722[_0x5799('0xb2')]=_0x9810fe['get']({'plain':!![]});_0x503722['interaction'][_0x5799('0xb7')]=_0x5f2631;if(_0x503722[_0x5799('0xb2')][_0x5799('0xb7')]){if(_0x503722[_0x5799('0x9b')][_0x5799('0xb8')]){_0x503722['applications'][_0x5799('0xb9')]({'id':0x0,'priority':_0x503722[_0x5799('0x98')][_0x5799('0x4c')]+0x1,'app':_0x5799('0xba'),'appdata':'unmanaged','interval':_0x5799('0xbb')});}}return db[_0x5799('0xbc')][_0x5799('0x4e')]({'body':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0x4f')],'ChatWebsiteId':_0x4bc9d2[_0x5799('0x49')]['id'],'ChatInteractionId':_0x9810fe['id'],'direction':'in','ContactId':_0x503722['contact']['id'],'AttachmentId':_0x4bc9d2[_0x5799('0x4f')][_0x5799('0xbd')]});})[_0x5799('0x15')](function(_0x1ceb1a){_0x503722[_0x5799('0x1d')]=_0x1ceb1a;if(_0x503722[_0x5799('0xb2')][_0x5799('0xbe')]){return db[_0x5799('0xbf')][_0x5799('0x4d')]({'attributes':['id',_0x5799('0x42')],'where':{'id':_0x503722[_0x5799('0xb2')][_0x5799('0xbe')]}})[_0x5799('0x15')](function(_0x232921){if(_0x232921){_0x503722[_0x5799('0x98')][_0x5799('0xc0')]({'id':0x0,'priority':0x0,'app':_0x5799('0xc1'),'appdata':_0x232921[_0x5799('0x42')]+','+(_0x503722[_0x5799('0x9b')][_0x5799('0xc2')]||0xa),'interval':_0x5799('0xbb')});_0x503722['forcedOwnership']=!![];}return respondWithRpcPromise(_0x5799('0xc3'),'startRouting',_0x503722);});}return respondWithRpcPromise(_0x5799('0xc3'),_0x5799('0xc4'),_0x503722);})[_0x5799('0x15')](function(_0x2db819){respondWithRpcPromise('EventManager','EventManager',{'event':_0x5799('0x7e'),'message':_0x2db819},client9002);return _0x2db819;})[_0x5799('0x15')](respondWithResult(_0xd6082d,null))[_0x5799('0x1f')](handleError(_0xd6082d,null));};exports[_0x5799('0xc5')]=function(_0x420685,_0x587dd3){var _0xaee532,_0x2f38a2,_0x245efa;var _0x260923=[];var _0x2ae2df={};var _0x3b630e=_0x420685[_0x5799('0xc6')]||[];var _0x38dad4=[];var _0x5cd906;return db[_0x5799('0x83')][_0x5799('0x56')]()[_0x5799('0x15')](function(_0xc3240b){if(!_0xc3240b){throw new db[(_0x5799('0x8a'))][(_0x5799('0x84'))]('no\x20available\x20attributes');}_0x260923=_['difference'](_[_0x5799('0x35')](_0xc3240b),[_0x5799('0x86'),_0x5799('0x87'),_0x5799('0x88'),_0x5799('0x89')]);if(_0x420685[_0x5799('0x4f')]['id']){delete _0x420685[_0x5799('0x4f')]['id'];}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0x91')])){throw _0x587dd3['status'](0x1f4)[_0x5799('0x2e')](new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x8b')));}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0x4f')])||_0x420685[_0x5799('0x4f')][_0x5799('0x4f')]===''){throw _0x587dd3['status'](0x1f4)[_0x5799('0x2e')](new db['Sequelize'][(_0x5799('0x84'))](_0x5799('0x8c')));}if(_[_0x5799('0x77')](_0x420685[_0x5799('0x4f')][_0x5799('0xc7')])){throw _0x587dd3[_0x5799('0x22')](0x1f4)[_0x5799('0x2e')](new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0xc8')+_0x260923));}if(!_['includes'](_0x260923,_0x420685[_0x5799('0x4f')]['mapKeyOffline'])){throw _0x587dd3[_0x5799('0x22')](0x1f4)[_0x5799('0x2e')](new db[(_0x5799('0x8a'))][(_0x5799('0x84'))](_0x5799('0xc9')+_0x260923));}_0x2ae2df[_0x420685[_0x5799('0x4f')][_0x5799('0xc7')]]=_0x420685[_0x5799('0x4f')][_0x5799('0x91')];})[_0x5799('0x15')](function(){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x420685[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x92')],'as':'List'},{'model':db[_0x5799('0xca')],'as':'MailAccount'}]});})[_0x5799('0x15')](handleEntityNotFound(_0x587dd3,null))['then'](function(_0x1507d7){if(_0x1507d7&&_0x1507d7[_0x5799('0x97')]){_0x2f38a2=_0x1507d7;var _0x47a23e=_[_0x5799('0xb')](_0x420685[_0x5799('0x4f')],{'firstName':_0x420685[_0x5799('0x4f')][_0x5799('0x91')],'phone':_0x420685[_0x5799('0x4f')][_0x5799('0x91')],'ListId':_0x1507d7[_0x5799('0x89')]});_0x47a23e[_0x420685[_0x5799('0x4f')][_0x5799('0xc7')]]=_0x420685[_0x5799('0x4f')][_0x5799('0x91')];return db[_0x5799('0x83')][_0x5799('0xcb')]({'where':_0x2ae2df,'defaults':_0x47a23e});}})[_0x5799('0xb3')](function(_0x1aeec2){if(_0x1aeec2){_0x245efa=_0x1aeec2;var _0x3cbc3f=fs[_0x5799('0xcc')](path[_0x5799('0x72')](config[_0x5799('0x6d')],'server/files/templates/chatOfflineMessage.ejs'),_0x5799('0xcd'));var _0x5a9824=ejs[_0x5799('0xce')](_0x3cbc3f,{'body':_[_0x5799('0xcf')](_0x420685[_0x5799('0x4f')]['body']),'bodyTitle':_0x2f38a2[_0x5799('0xd0')]});return db['ChatOfflineMessage'][_0x5799('0x4e')]({'body':_0x5a9824,'plainBody':htmlToText[_0x5799('0xd1')](_0x5a9824),'ContactId':_0x1aeec2['id'],'ChatWebsiteId':_0x2f38a2['id']});}})[_0x5799('0x15')](function(_0x1e665f){_0x5cd906=_0x1e665f;if(_0x3b630e[_0x5799('0x4c')]){var _0x138a7b=_0x3b630e[_0x5799('0x5b')](function(_0x5f5977){return{'name':_0x5f5977[_0x5799('0xd2')],'basename':_0x5f5977[_0x5799('0x66')],'type':_0x5f5977[_0x5799('0xd3')],'ChatOfflineMessageId':_0x1e665f['id']};});_0x38dad4=_0x138a7b['map'](_0x39a4d8=>{var _0xcd9954={'filename':_0x39a4d8[_0x5799('0x42')],'path':path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0xd4'),_0x5799('0xc6'),'attachments',_0x5799('0xd5'),_0x39a4d8[_0x5799('0xd6')])};return _0xcd9954;});if(!_0x2f38a2[_0x5799('0xd7')]){return db[_0x5799('0xd8')][_0x5799('0xd9')](function(_0x43dfd5){return db['Attachment'][_0x5799('0xda')](_0x138a7b,{'transaction':_0x43dfd5});});}}})['then'](function(){if(_0x5cd906){_0xaee532=_0x5cd906;return db[_0x5799('0xca')][_0x5799('0xdb')]({'where':{'service':!![]},'include':[{'model':db[_0x5799('0xdc')],'as':_0x5799('0xdd'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x5799('0xde'),'raw':!![]}]}]});}})[_0x5799('0x15')](function(_0x3da420){if(_0x3da420&&_0x3da420['Smtp']&&_0x2f38a2['forwardOffline']&&_0x2f38a2['forwardOfflineAddress']){var _0x519856=_0x3da420[_0x5799('0xdf')]();return respondWithRpcPromise(_0x5799('0xe0'),_0x5799('0xe1'),{'account':_0x519856,'message':{'from':util[_0x5799('0xa7')]('\x22%s\x22\x20<%s>',_0x3da420[_0x5799('0x42')],_0x3da420['email']||_0x3da420[_0x5799('0xdd')][_0x5799('0x50')]),'to':_0x2f38a2[_0x5799('0xe2')],'subject':_0x2f38a2[_0x5799('0xe3')],'html':_0xaee532[_0x5799('0x4f')],'attachments':_0x38dad4}},client9003)['then'](function(){return _0xaee532;})[_0x5799('0x1f')](function(_0x45a942){logger[_0x5799('0x1b')](_0x45a942);});}})['then'](function(){if(_0x2f38a2&&_0x2f38a2[_0x5799('0xd7')]&&_0x2f38a2[_0x5799('0xe4')]){var _0xbebce6=[];if(_0x3b630e['length']){_0xbebce6=_0x3b630e[_0x5799('0x5b')](function(_0x10bb25){return{'name':_0x10bb25['originalname'],'basename':_0x10bb25[_0x5799('0x66')],'type':_0x10bb25[_0x5799('0xd3')],'ChatOfflineMessageId':_0x5cd906['id']};});}var _0x3f24be;if(!_[_0x5799('0x77')](_0x2f38a2[_0x5799('0xe5')])){var _0x1df191=_[_0x5799('0x5b')](_0x420685['body'],function(_0x226052){return _0x226052;});var _0x4811d7=_[_0x5799('0xe6')](_0x1df191)[0x0];var _0x586f08=_[_0x5799('0xe7')](_0x4811d7,function(_0x52fdd7){return _0x52fdd7;});_0x3f24be=_0x586f08[0x1][_0x2f38a2[_0x5799('0xe5')]];}var _0x4e2966={'from':_0x245efa[_0x5799('0xe8')],'firstName':_0x245efa[_0x5799('0xa2')],'lastName':_0x245efa[_0x5799('0xa3')],'mapKey':_0x5799('0xe8'),'message':{'from':_0x245efa[_0x5799('0xe8')],'to':_0x2f38a2[_0x5799('0xca')][_0x5799('0xe8')],'cc':'','subject':_['isNil'](_0x3f24be)?_0x2f38a2[_0x5799('0xe3')]:_0x3f24be,'messageId':'','sentAt':new Date(),'attach':_0xbebce6[_0x5799('0x4c')],'attachments':_0xbebce6,'originChannel':_0x5799('0xe9'),'ChatWebsiteId':_0x2f38a2['id'],'ChatOfflineMessageId':_0xaee532['id'],'originTo':_0x2f38a2[_0x5799('0xca')][_0x5799('0xe8')]},'body':_0xaee532[_0x5799('0x4f')]};var _0x380c71={'account':{'id':_0x2f38a2[_0x5799('0xe4')]},'body':_0x4e2966,'log':_0x5799('0xea')};return respondWithRpcPromise(_0x5799('0xea'),_0x5799('0xeb'),_0x380c71,client9001)['then'](function(){return _0xaee532;})[_0x5799('0x1f')](function(_0x13472e){logger[_0x5799('0x1b')](_0x13472e);});}return;})['then'](function(){if(_0xaee532){return _0xaee532;}})[_0x5799('0x15')](respondWithResult(_0x587dd3,null))[_0x5799('0x1f')](function(_0x24c151){logger[_0x5799('0x1b')](_0x5799('0x1f'),_0x24c151);for(var _0x3f6f49 of _0x3b630e){var _0x39a290=path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0xd4'),_0x5799('0xc6'),_0x5799('0xec'),_0x5799('0xd5'),_0x3f6f49['filename']);fs_extra['remove'](_0x39a290)['catch'](function(_0x39035a){logger['error'](_0x5799('0xed'),_0x39a290,_0x39035a);});}});};exports[_0x5799('0xee')]=function(_0x20f2e2,_0x2d972a){return db['ChatInteraction'][_0x5799('0x4d')]({'where':{'id':_0x20f2e2[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x2d972a,null))[_0x5799('0x15')](function(_0x48a624){if(_0x48a624){return _0x48a624[_0x5799('0xee')](_0x20f2e2[_0x5799('0x4f')][_0x5799('0x5e')],_['omit'](_0x20f2e2[_0x5799('0x4f')],[_0x5799('0x5e'),'id'])||{});}})[_0x5799('0x15')](respondWithResult(_0x2d972a,null))[_0x5799('0x1f')](handleError(_0x2d972a,null));};exports[_0x5799('0xef')]=function(_0xdab4b7,_0x48e8d8){var _0x352851={'raw':![],'where':{}};var _0x3a7372={};var _0x1dcee3={'count':0x0,'rows':[]};return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0xdab4b7[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x48e8d8,null))['then'](function(_0x62e87){if(_0x62e87){_0x3a7372[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0xb0')]['rawAttributes']);_0x3a7372['query']=_['keys'](_0xdab4b7[_0x5799('0x34')]);_0x3a7372[_0x5799('0x36')]=_[_0x5799('0x37')](_0x3a7372[_0x5799('0x33')],_0x3a7372[_0x5799('0x34')]);_0x352851['attributes']=_[_0x5799('0x37')](_0x3a7372[_0x5799('0x33')],qs['fields'](_0xdab4b7[_0x5799('0x34')][_0x5799('0x39')]));_0x352851[_0x5799('0x38')]=_0x352851[_0x5799('0x38')][_0x5799('0x4c')]?_0x352851[_0x5799('0x38')]:_0x3a7372['model'];if(!_0xdab4b7[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x352851[_0x5799('0x25')]=qs['limit'](_0xdab4b7['query'][_0x5799('0x25')]);_0x352851[_0x5799('0x27')]=qs[_0x5799('0x27')](_0xdab4b7['query'][_0x5799('0x27')]);}_0x352851['order']=qs['sort'](_0xdab4b7[_0x5799('0x34')]['sort']);_0x352851[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0xdab4b7[_0x5799('0x34')],_0x3a7372['filters']));_0x352851[_0x5799('0x3e')]['ChatWebsiteId']=_0x62e87['id'];if(_0xdab4b7[_0x5799('0x34')]['filter']){_0x352851[_0x5799('0x3e')]=_['merge'](_0x352851['where'],{'$or':_[_0x5799('0x5b')](_0x352851[_0x5799('0x38')],function(_0x2f0ec3){var _0x36b350={};_0x36b350[_0x2f0ec3]={'$like':'%'+_0xdab4b7[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x36b350;})});}_0x352851=_[_0x5799('0x40')]({},_0x352851,_0xdab4b7[_0x5799('0x62')]);return db['ChatInteraction'][_0x5799('0x26')]({'where':_0x352851[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x49fc14){_0x1dcee3[_0x5799('0x26')]=_0x49fc14;if(_0xdab4b7['query'][_0x5799('0x45')]){_0x352851['include']=[{'model':db[_0x5799('0x83')],'as':_0x5799('0xf0'),'required':![]},{'model':db['User'],'as':_0x5799('0xf1'),'attributes':[_0x5799('0x42'),'fullname',_0x5799('0xf2')],'required':![]},{'model':db[_0x5799('0xf3')],'as':_0x5799('0xf4'),'attributes':['id','name',_0x5799('0xf5')],'where':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]?{'id':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]}:undefined,'required':_0xdab4b7[_0x5799('0x34')][_0x5799('0xf6')]?!![]:![]}];}return db[_0x5799('0xb0')]['findAll'](_0x352851);})[_0x5799('0x15')](function(_0x35516f){_0x1dcee3[_0x5799('0x5c')]=_0x35516f;return _0x1dcee3;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x48e8d8,_0x352851))['catch'](handleError(_0x48e8d8,null));};function iftimePromise(_0x5c14ab,_0xaf6cf0){return respondWithRpcPromise(_0x5799('0xf7'),_0x5799('0xf8'),{'command':_0xaf6cf0['timezone']?util[_0x5799('0xa7')](_0x5799('0xf9'),_0x5c14ab['interval'],_0xaf6cf0['timezone']):util[_0x5799('0xa7')](_0x5799('0xfa'),_0x5c14ab[_0x5799('0xfb')])},client9002)[_0x5799('0x15')](function(_0x238c56){var _0x1ebad7=_0x238c56&&_0x238c56[_0x5799('0xfc')](_0x5799('0xfd'))>=0x0?!![]:![];logger[_0x5799('0xfe')](_0x5799('0xff'),_0xaf6cf0['id'],_0x5c14ab['id'],_0x5c14ab[_0x5799('0xfb')],_0x1ebad7?_0x5799('0x100'):_0x5799('0x101'),_0xaf6cf0[_0x5799('0x102')]?_0xaf6cf0[_0x5799('0x102')]:'No\x20timezone');return _0x1ebad7;})[_0x5799('0x1f')](function(_0x2394ea){logger[_0x5799('0x1b')](_0x5799('0xff'),_0xaf6cf0['id'],_0x5c14ab['id'],_0x5c14ab[_0x5799('0xfb')],util[_0x5799('0x103')](_0x2394ea,{'showHidden':![],'depth':null}),_0xaf6cf0[_0x5799('0x102')]?_0xaf6cf0['timezone']:'No\x20timezone');return![];});}exports[_0x5799('0xf8')]=function(_0xb82489,_0x5a8f49){var _0x1a2fb7=0x0;var _0x2e42ed=0x0;var _0xb50b91=![];var _0x19c2b1;var _0x2fc90d;return db[_0x5799('0x44')]['find']({'where':{'id':_0xb82489[_0x5799('0x49')]['id']},'include':[{'model':db[_0x5799('0x104')],'as':'Interval','include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0x5799('0xfb')],'raw':!![]}]}]})[_0x5799('0x15')](handleEntityNotFound(_0x5a8f49,null))['then'](function(_0xb2e125){if(_0xb2e125){_0x19c2b1=_0xb2e125;return _0xb2e125[_0x5799('0x105')]({'raw':!![]});}})[_0x5799('0x15')](function(_0x1f3706){if(_0x19c2b1){if(_0x1f3706){_0x2fc90d=_0x1f3706;}}return require(_0x5799('0x106'))[_0x5799('0x6f')]();})['then'](function(_0x1ccdd5){if(_0x1ccdd5){_0x2e42ed=_0x1ccdd5['virtual'];_0xb50b91=_0x1ccdd5[_0x5799('0x70')];}})[_0x5799('0x15')](function(){return db['ChatInteraction'][_0x5799('0x26')]({'where':{'closed':![]}});})[_0x5799('0x15')](function(_0x3b186b){_0x1a2fb7=_0x3b186b;if(_0x2e42ed&&_0x3b186b>_0x2e42ed){return db[_0x5799('0x107')][_0x5799('0xdb')]({'where':{'id':0x1}})[_0x5799('0x15')](function(_0x30b2f2){if(_0x30b2f2){_0x30b2f2[_0x5799('0x108')](_0x5799('0x109'));}});}})['then'](function(){if(_0x19c2b1['Interval']&&_0x19c2b1[_0x5799('0x104')]['Intervals']){var _0x2e62e9=[];for(var _0x12cad9=0x0;_0x12cad9<_0x19c2b1[_0x5799('0x104')][_0x5799('0x10a')][_0x5799('0x4c')];_0x12cad9++){var _0x141182=_0x19c2b1['Interval']['Intervals'][_0x12cad9][_0x5799('0x51')]({'plain':!![]});_0x2e62e9['push'](iftimePromise(_0x141182,_0x19c2b1));}return BPromise['all'](_0x2e62e9)[_0x5799('0x15')](function(_0x7ebd55){return _[_0x5799('0x10b')](_0x7ebd55);});}else{return!![];}})[_0x5799('0x15')](function(_0x2a17ec){var _0x4d874a=fs[_0x5799('0xcc')](path[_0x5799('0x72')](config[_0x5799('0x6d')],_0x5799('0x10c')),_0x5799('0xcd'));var _0x5203e9={'remote':_0x19c2b1[_0x5799('0x10d')],'query':querystring['stringify'](_[_0x5799('0x40')](_0x19c2b1[_0x5799('0x51')]({'plain':!![]}),{'customerIp':_0xb82489['headers'][_0x5799('0x9f')]||_0xb82489[_0x5799('0x9d')][_0x5799('0x10e')]||_0xb82489['connection']['remoteAddress']||_0xb82489['ip'],'referer':_0xb82489['headers']['referer'],'openedInteractions':_0x1a2fb7,'maxInteractions':_0x2e42ed,'virtual':_0xb50b91[_0x5799('0x10f')],'online':_0x2a17ec,'custom':_0xb50b91}))[_0x5799('0x110')](/'/g,'\x5c\x27')};_0x5a8f49['send'](ejs[_0x5799('0xce')](Mustache['render'](_0x4d874a,_0x5203e9),{'proactiveActions':_0x2fc90d,'alignment':_0x19c2b1[_0x5799('0x111')],'verticalAlignment':_0x19c2b1['verticalAlignment'],'div_color':_0x19c2b1[_0x5799('0xf5')],'labelText':_0x19c2b1[_0x5799('0x112')],'text_color':_0x19c2b1[_0x5799('0x113')],'text_button_color':_0x19c2b1[_0x5799('0x114')],'button_color':_0x19c2b1['color_button'],'background_color':_0x19c2b1[_0x5799('0x115')],'hideWhenOffline':_0x19c2b1[_0x5799('0x116')],'interval':_0x19c2b1[_0x5799('0x117')]}));})[_0x5799('0x1f')](handleError(_0x5a8f49,null));};exports[_0x5799('0x118')]=function(_0xfc678e,_0x23f8d9){var _0x451875=_0xfc678e[_0x5799('0x49')]['id'];var _0x6a4379=_0xfc678e[_0x5799('0x4f')];var _0x481101=0xc8;var _0x5aecb7=null;return db[_0x5799('0xd8')][_0x5799('0xd9')]({'isolationLevel':db[_0x5799('0xd8')][_0x5799('0x119')]['ISOLATION_LEVELS'][_0x5799('0x11a')]},function(_0x595d8d){return db[_0x5799('0x44')]['findOne']({'where':{'id':_0x451875},'transaction':_0x595d8d})[_0x5799('0x15')](function(_0x5db6e9){if(_0x5db6e9){return db[_0x5799('0x95')][_0x5799('0x2a')]({'where':{'ChatWebsiteId':_0x451875},'transaction':_0x595d8d})[_0x5799('0x15')](function(){var _0x5e0137=_['map'](_0x6a4379,function(_0x133d2b){_0x133d2b['ChatWebsiteId']=_0x451875;return _0x133d2b;});return db[_0x5799('0x95')][_0x5799('0xda')](_0x5e0137,{'transaction':_0x595d8d});});}else{_0x481101=0x194;_0x5aecb7=[];}});})[_0x5799('0x15')](function(){if(_0x481101!==0x194){return db[_0x5799('0x95')][_0x5799('0x11b')]({'where':{'ChatWebsiteId':_0x451875},'order':'priority'})[_0x5799('0x15')](function(_0x446dad){_0x5aecb7=_0x446dad;});}})[_0x5799('0x1f')](function(_0x22ade9){_0x481101=0x1f4;logger[_0x5799('0x1b')](_0x22ade9[_0x5799('0x2d')]);if(_0x22ade9[_0x5799('0x42')]){delete _0x22ade9[_0x5799('0x42')];}_0x5aecb7=_0x22ade9;})[_0x5799('0x11c')](function(){if(_0x5aecb7===null){_0x23f8d9[_0x5799('0x20')](_0x481101);}else{if(_0x481101===0x1f4){_0x23f8d9[_0x5799('0x22')](_0x481101)[_0x5799('0x2e')](_0x5aecb7);}else{_0x23f8d9[_0x5799('0x22')](_0x481101)[_0x5799('0x23')](_0x5aecb7);}}});};exports[_0x5799('0x11d')]=function(_0x24fd7c,_0x3efd9b){var _0x182430={};var _0x3763da={};var _0x3c96f2;var _0x5e28ef;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x24fd7c[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x3efd9b,null))['then'](function(_0x1d0e21){if(_0x1d0e21){_0x3c96f2=_0x1d0e21;_0x3763da['model']=_[_0x5799('0x35')](db[_0x5799('0x95')][_0x5799('0x30')]);_0x3763da[_0x5799('0x34')]=_[_0x5799('0x35')](_0x24fd7c[_0x5799('0x34')]);_0x3763da[_0x5799('0x36')]=_['intersection'](_0x3763da[_0x5799('0x33')],_0x3763da[_0x5799('0x34')]);_0x182430[_0x5799('0x38')]=_[_0x5799('0x37')](_0x3763da[_0x5799('0x33')],qs[_0x5799('0x39')](_0x24fd7c['query'][_0x5799('0x39')]));_0x182430[_0x5799('0x38')]=_0x182430[_0x5799('0x38')][_0x5799('0x4c')]?_0x182430[_0x5799('0x38')]:_0x3763da[_0x5799('0x33')];_0x182430[_0x5799('0x3c')]=qs[_0x5799('0x3d')](_0x24fd7c[_0x5799('0x34')][_0x5799('0x3d')]);_0x182430[_0x5799('0x3e')]=qs[_0x5799('0x36')](_[_0x5799('0x3f')](_0x24fd7c[_0x5799('0x34')],_0x3763da[_0x5799('0x36')]));if(_0x24fd7c[_0x5799('0x34')][_0x5799('0x43')]){_0x182430[_0x5799('0x3e')]=_['merge'](_0x182430['where'],{'$or':_[_0x5799('0x5b')](_0x182430['attributes'],function(_0x465142){var _0x115c76={};_0x115c76[_0x465142]={'$like':'%'+_0x24fd7c[_0x5799('0x34')][_0x5799('0x43')]+'%'};return _0x115c76;})});}_0x182430=_[_0x5799('0x40')]({},_0x182430,_0x24fd7c[_0x5799('0x62')]);return _0x3c96f2[_0x5799('0x11d')](_0x182430);}})[_0x5799('0x15')](function(_0x15640f){if(_0x15640f){_0x5e28ef=_0x15640f[_0x5799('0x4c')];if(!_0x24fd7c[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x182430[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x24fd7c['query'][_0x5799('0x25')]);_0x182430[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x24fd7c[_0x5799('0x34')]['offset']);}return _0x3c96f2[_0x5799('0x11d')](_0x182430);}})[_0x5799('0x15')](function(_0x1a2380){if(_0x1a2380){return _0x1a2380?{'count':_0x5e28ef,'rows':_0x1a2380}:null;}})[_0x5799('0x15')](respondWithResult(_0x3efd9b,null))['catch'](handleError(_0x3efd9b,null));};exports[_0x5799('0x11e')]=function(_0x58492c,_0x3cbcb6){return db[_0x5799('0x11f')][_0x5799('0x4d')]({'where':{'id':_0x58492c[_0x5799('0x49')]['id']}})['then'](handleEntityNotFound(_0x3cbcb6,null))[_0x5799('0x15')](function(_0x43147c){if(_0x43147c){return _0x43147c['addProactiveActions'](_0x58492c[_0x5799('0x4f')]['ids'],_[_0x5799('0x120')](_0x58492c[_0x5799('0x4f')],[_0x5799('0x5e'),'id'])||{});}})[_0x5799('0x15')](respondWithResult(_0x3cbcb6,null))[_0x5799('0x1f')](handleError(_0x3cbcb6,null));};exports[_0x5799('0x105')]=function(_0x84620f,_0x5435d0){var _0x3b91bd={};var _0x30fe9a={};var _0x5cd74e;var _0x470e42;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x84620f[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x5435d0,null))['then'](function(_0x43aaca){if(_0x43aaca){_0x5cd74e=_0x43aaca;_0x30fe9a[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0x121')]['rawAttributes']);_0x30fe9a[_0x5799('0x34')]=_['keys'](_0x84620f[_0x5799('0x34')]);_0x30fe9a[_0x5799('0x36')]=_[_0x5799('0x37')](_0x30fe9a[_0x5799('0x33')],_0x30fe9a[_0x5799('0x34')]);_0x3b91bd['attributes']=_[_0x5799('0x37')](_0x30fe9a['model'],qs[_0x5799('0x39')](_0x84620f[_0x5799('0x34')][_0x5799('0x39')]));_0x3b91bd[_0x5799('0x38')]=_0x3b91bd[_0x5799('0x38')]['length']?_0x3b91bd['attributes']:_0x30fe9a[_0x5799('0x33')];_0x3b91bd[_0x5799('0x3c')]=qs['sort'](_0x84620f[_0x5799('0x34')][_0x5799('0x3d')]);_0x3b91bd[_0x5799('0x3e')]=qs[_0x5799('0x36')](_['pick'](_0x84620f['query'],_0x30fe9a['filters']));if(_0x84620f['query'][_0x5799('0x43')]){_0x3b91bd[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x3b91bd[_0x5799('0x3e')],{'$or':_[_0x5799('0x5b')](_0x3b91bd[_0x5799('0x38')],function(_0xfd92fc){var _0x1c0757={};_0x1c0757[_0xfd92fc]={'$like':'%'+_0x84620f[_0x5799('0x34')]['filter']+'%'};return _0x1c0757;})});}_0x3b91bd=_[_0x5799('0x40')]({},_0x3b91bd,_0x84620f[_0x5799('0x62')]);return _0x5cd74e[_0x5799('0x105')](_0x3b91bd);}})[_0x5799('0x15')](function(_0x326d96){if(_0x326d96){_0x470e42=_0x326d96[_0x5799('0x4c')];if(!_0x84620f[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x3b91bd[_0x5799('0x25')]=qs['limit'](_0x84620f[_0x5799('0x34')][_0x5799('0x25')]);_0x3b91bd[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x84620f[_0x5799('0x34')][_0x5799('0x27')]);}return _0x5cd74e[_0x5799('0x105')](_0x3b91bd);}})[_0x5799('0x15')](function(_0x4041dc){if(_0x4041dc){return _0x4041dc?{'count':_0x470e42,'rows':_0x4041dc}:null;}})[_0x5799('0x15')](respondWithResult(_0x5435d0,null))[_0x5799('0x1f')](handleError(_0x5435d0,null));};exports['getFields']=function(_0x8846b,_0x58f6a){var _0x306764=_0x8846b[_0x5799('0x34')][_0x5799('0x122')]===_0x5799('0x123')?_0x5799('0x124'):_0x5799('0x125');return db[_0x5799('0x44')]['find']({'attributes':['id',_0x306764],'where':{'id':_0x8846b[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x58f6a,null))[_0x5799('0x15')](function(_0x399523){if(_0x399523){var _0x4f5960=_0x399523[_0x306764];var _0x40def1=_0x4f5960&&_0x4f5960[_0x5799('0x126')]?_0x4f5960[_0x5799('0x126')]:[];_0x58f6a[_0x5799('0x2e')]({'fromKey':_['isNil'](_0x4f5960['fromKey'])?undefined:_0x4f5960[_0x5799('0x127')],'count':_0x40def1[_0x5799('0x4c')],'rows':_0x40def1});}})['catch'](handleError(_0x58f6a,null));};exports[_0x5799('0x128')]=function(_0x5c200e,_0x5bb9e0){var _0x474094={'raw':![],'where':{}};var _0x55fb2c={};var _0x1faa8e={'count':0x0,'rows':[]};return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x5c200e['params']['id']}})['then'](handleEntityNotFound(_0x5bb9e0,null))[_0x5799('0x15')](function(_0x240149){if(_0x240149){_0x55fb2c['model']=_[_0x5799('0x35')](db[_0x5799('0x129')][_0x5799('0x30')]);_0x55fb2c['query']=_['keys'](_0x5c200e['query']);_0x55fb2c[_0x5799('0x36')]=_[_0x5799('0x37')](_0x55fb2c[_0x5799('0x33')],_0x55fb2c[_0x5799('0x34')]);_0x474094[_0x5799('0x38')]=_['intersection'](_0x55fb2c[_0x5799('0x33')],qs[_0x5799('0x39')](_0x5c200e['query'][_0x5799('0x39')]));_0x474094[_0x5799('0x38')]=_0x474094['attributes'][_0x5799('0x4c')]?_0x474094[_0x5799('0x38')]:_0x55fb2c[_0x5799('0x33')];if(!_0x5c200e[_0x5799('0x34')][_0x5799('0x3a')](_0x5799('0x3b'))){_0x474094['limit']=qs['limit'](_0x5c200e[_0x5799('0x34')][_0x5799('0x25')]);_0x474094[_0x5799('0x27')]=qs[_0x5799('0x27')](_0x5c200e['query'][_0x5799('0x27')]);}_0x474094[_0x5799('0x3c')]=qs['sort'](_0x5c200e[_0x5799('0x34')][_0x5799('0x3d')]);_0x474094['where']=qs['filters'](_[_0x5799('0x3f')](_0x5c200e[_0x5799('0x34')],_0x55fb2c[_0x5799('0x36')]));_0x474094['where']['ChatWebsiteId']=_0x240149['id'];if(_0x5c200e['query'][_0x5799('0x43')]){_0x474094[_0x5799('0x3e')]=_[_0x5799('0x40')](_0x474094['where'],{'$or':_[_0x5799('0x5b')](_0x474094[_0x5799('0x38')],function(_0x510fed){var _0x259aed={};_0x259aed[_0x510fed]={'$like':'%'+_0x5c200e['query'][_0x5799('0x43')]+'%'};return _0x259aed;})});}_0x474094=_[_0x5799('0x40')]({},_0x474094,_0x5c200e['options']);return db[_0x5799('0x129')][_0x5799('0x26')]({'where':_0x474094[_0x5799('0x3e')]})[_0x5799('0x15')](function(_0x4f2867){_0x1faa8e[_0x5799('0x26')]=_0x4f2867;if(_0x5c200e[_0x5799('0x34')]['includeAll']){_0x474094[_0x5799('0x46')]=[{'all':!![]}];}else{_0x474094[_0x5799('0x46')]=[{'model':db[_0x5799('0x83')],'as':_0x5799('0xf0'),'required':![]},{'model':db['Attachment'],'as':_0x5799('0x12a'),'required':![]}];}return db[_0x5799('0x129')][_0x5799('0x47')](_0x474094);})[_0x5799('0x15')](function(_0x1e8a43){_0x1faa8e['rows']=_0x1e8a43;return _0x1faa8e;});}})[_0x5799('0x15')](respondWithFilteredResult(_0x5bb9e0,_0x474094))['catch'](handleError(_0x5bb9e0,null));};exports['addAgents']=function(_0x4bdf95,_0x349466){return db['ChatWebsite'][_0x5799('0x4d')]({'where':{'id':_0x4bdf95[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x349466,null))[_0x5799('0x15')](function(_0x458eec){if(_0x458eec){return _0x458eec[_0x5799('0x12b')](_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')],_[_0x5799('0x120')](_0x4bdf95['body'],[_0x5799('0x5e'),'id'])||{})[_0x5799('0xb3')](function(_0x22e2a6){for(var _0x411214=0x0;_0x411214<_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')][_0x5799('0x4c')];_0x411214+=0x1){socket[_0x5799('0x12c')](_0x5799('0x12d'),{'UserId':Number(_0x4bdf95[_0x5799('0x4f')][_0x5799('0x5e')][_0x411214]),'ChatWebsiteId':Number(_0x4bdf95[_0x5799('0x49')]['id'])});}return _0x22e2a6;});}})[_0x5799('0x15')](respondWithResult(_0x349466,null))[_0x5799('0x1f')](handleError(_0x349466,null));};exports[_0x5799('0x12e')]=function(_0x1a4bd0,_0x59671f){return db[_0x5799('0x44')][_0x5799('0x4d')]({'where':{'id':_0x1a4bd0[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x59671f,null))[_0x5799('0x15')](function(_0x3f1fa6){if(_0x3f1fa6){return _0x3f1fa6[_0x5799('0x12e')](_0x1a4bd0['query'][_0x5799('0x5e')])['then'](function(){if(_[_0x5799('0x12f')](_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')])){for(var _0x5cc814=0x0;_0x5cc814<_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')][_0x5799('0x4c')];_0x5cc814+=0x1){socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x1a4bd0['query'][_0x5799('0x5e')][_0x5cc814]),'ChatWebsiteId':Number(_0x1a4bd0[_0x5799('0x49')]['id'])});}}else{socket[_0x5799('0x12c')](_0x5799('0x130'),{'UserId':Number(_0x1a4bd0[_0x5799('0x34')][_0x5799('0x5e')]),'ChatWebsiteId':Number(_0x1a4bd0[_0x5799('0x49')]['id'])});}});}})[_0x5799('0x15')](respondWithStatusCode(_0x59671f,null))[_0x5799('0x1f')](handleError(_0x59671f,null));};exports['getAgents']=function(_0x476203,_0x195019){var _0x49f68e={};var _0xe930d={};var _0x1cc0a2;var _0x22af4f;return db[_0x5799('0x44')][_0x5799('0xdb')]({'where':{'id':_0x476203[_0x5799('0x49')]['id']}})[_0x5799('0x15')](handleEntityNotFound(_0x195019,null))[_0x5799('0x15')](function(_0x18601c){if(_0x18601c){_0x1cc0a2=_0x18601c;_0xe930d[_0x5799('0x33')]=_[_0x5799('0x35')](db[_0x5799('0xbf')]['rawAttributes']);_0xe930d[_0x5799('0x34')]=_[_0x5799('0x35')](_0x476203[_0x5799('0x34')]);_0xe930d[_0x5799('0x36')]=_['intersection'](_0xe930d[_0x5799('0x33')],_0xe930d[_0x5799('0x34')]);_0x49f68e[_0x5799('0x38')]=_[_0x5799('0x37')](_0xe930d[_0x5799('0x33')],qs[_0x5799('0x39')](_0x476203[_0x5799('0x34')][_0x5799('0x39')]));_0x49f68e['attributes']=_0x49f68e[_0x5799('0x38')]['length']?_0x49f68e[_0x5799('0x38')]:_0xe930d[_0x5799('0x33')];_0x49f68e['order']=qs[_0x5799('0x3d')](_0x476203[_0x5799('0x34')]['sort']);_0x49f68e[_0x5799('0x3e')]=qs['filters'](_[_0x5799('0x3f')](_0x476203[_0x5799('0x34')],_0xe930d[_0x5799('0x36')]));if(_0x476203[_0x5799('0x34')][_0x5799('0x43')]){_0x49f68e['where']=_[_0x5799('0x40')](_0x49f68e[_0x5799('0x3e')],{'$or':_['map'](_0x49f68e[_0x5799('0x38')],function(_0x5a37b0){var _0x15f6da={};_0x15f6da[_0x5a37b0]={'$like':'%'+_0x476203[_0x5799('0x34')]['filter']+'%'};return _0x15f6da;})});}_0x49f68e=_['merge']({},_0x49f68e,_0x476203[_0x5799('0x62')]);return _0x1cc0a2[_0x5799('0x131')](_0x49f68e);}})[_0x5799('0x15')](function(_0x38d572){if(_0x38d572){_0x22af4f=_0x38d572['length'];if(!_0x476203['query'][_0x5799('0x3a')](_0x5799('0x3b'))){_0x49f68e[_0x5799('0x25')]=qs[_0x5799('0x25')](_0x476203[_0x5799('0x34')][_0x5799('0x25')]);_0x49f68e['offset']=qs['offset'](_0x476203[_0x5799('0x34')]['offset']);}return _0x1cc0a2['getAgents'](_0x49f68e);}})['then'](function(_0x583e36){if(_0x583e36){return _0x583e36?{'count':_0x22af4f,'rows':_0x583e36}:null;}})[_0x5799('0x15')](respondWithResult(_0x195019,null))[_0x5799('0x1f')](handleError(_0x195019,null));};
\ No newline at end of file
+var _0xfb7c=['account','cf-connecting-ip','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','firstName','messageId','created','autoclose','close','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','EventManager','offline','files','CompanyId','send','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','fromString','mimetype','server','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','originalname','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','interval','true','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','Interval','Intervals','virtual','License','chatLicenseExceeded','push','some','server/files/chat/iframe.ejs','connection','textColor','textButtonColor','color_button','backgroundColor','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','getFields','false','offlineForm','items','fromKey','getOfflineMessages','findOne','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','ejs','fs-extra','lodash','querystring','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','name','mandatoryDispositionPause','ChatWebsite','fieldName','type','key','model','map','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','Pause','keys','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','describe','addDisposition','getDispositions','Disposition','sort','ChatWebsiteId','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','existsSync','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','user-agent-parser','setUA','headers','getResult','chat','CmContact','ValidationError','difference','createdAt','updatedAt','ListId','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','orderBy','asc'];(function(_0xe57328,_0x2b94c3){var _0x528ed5=function(_0x4f0c12){while(--_0x4f0c12){_0xe57328['push'](_0xe57328['shift']());}};_0x528ed5(++_0x2b94c3);}(_0xfb7c,0x1af));var _0xcfb7=function(_0x50c17f,_0x55236e){_0x50c17f=_0x50c17f-0x0;var _0x4a11b3=_0xfb7c[_0x50c17f];return _0x4a11b3;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xcfb7('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xcfb7('0x1'));var fs=require('fs');var fs_extra=require(_0xcfb7('0x2'));var _=require(_0xcfb7('0x3'));var querystring=require(_0xcfb7('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xcfb7('0x5'))(_0xcfb7('0x6'));var config=require(_0xcfb7('0x7'));var db=require(_0xcfb7('0x8'))['db'];config[_0xcfb7('0x9')]=_[_0xcfb7('0xa')](config[_0xcfb7('0x9')],{'host':_0xcfb7('0xb'),'port':0x18eb});var socket=require(_0xcfb7('0xc'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xcfb7('0xd')](socket);var htmlToText=require('html-to-text');var jayson=require('jayson/promise');var client=jayson[_0xcfb7('0xe')][_0xcfb7('0xf')]({'port':0x232c});var client9002=jayson[_0xcfb7('0xe')]['http']({'port':0x232a});var client9003=jayson[_0xcfb7('0xe')][_0xcfb7('0xf')]({'port':0x232b});var client9001=jayson['client'][_0xcfb7('0xf')]({'port':0x2329});function respondWithRpcPromise(_0x1fb9d4,_0x17866a,_0x8e1a2c,_0x17ca94){return new BPromise(function(_0x5afd27,_0xb4ef85){var _0x45f8a1=_0x17ca94||client;return _0x45f8a1['request'](_0x1fb9d4,_0x8e1a2c)[_0xcfb7('0x10')](function(_0xa1ec5e){logger['info'](_0xcfb7('0x11'),_0x17866a,_0xcfb7('0x12'));logger[_0xcfb7('0x13')](_0xcfb7('0x14'),_0x17866a,_0xcfb7('0x12'),JSON[_0xcfb7('0x15')](_0xa1ec5e));if(_0xa1ec5e[_0xcfb7('0x16')]){if(_0xa1ec5e[_0xcfb7('0x16')]['code']===0x1f4){logger[_0xcfb7('0x16')](_0xcfb7('0x11'),_0x17866a,_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);return _0xb4ef85(_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);}logger['error'](_0xcfb7('0x11'),_0x17866a,_0xa1ec5e['error'][_0xcfb7('0x17')]);return _0x5afd27(_0xa1ec5e[_0xcfb7('0x16')][_0xcfb7('0x17')]);}else{logger['info'](_0xcfb7('0x11'),_0x17866a,_0xcfb7('0x12'));_0x5afd27(_0xa1ec5e['result'][_0xcfb7('0x17')]);}})[_0xcfb7('0x18')](function(_0x54afc9){logger[_0xcfb7('0x16')](_0xcfb7('0x11'),_0x17866a,_0x54afc9);_0xb4ef85(_0x54afc9);});});}function respondWithStatusCode(_0x266384,_0x4dac7c){_0x4dac7c=_0x4dac7c||0xcc;return function(_0x587eac){if(_0x587eac){return _0x266384[_0xcfb7('0x19')](_0x4dac7c);}return _0x266384[_0xcfb7('0x1a')](_0x4dac7c)[_0xcfb7('0x1b')]();};}function respondWithResult(_0x3515ea,_0x4afbe0){_0x4afbe0=_0x4afbe0||0xc8;return function(_0x3c2a0e){if(_0x3c2a0e){return _0x3515ea[_0xcfb7('0x1a')](_0x4afbe0)[_0xcfb7('0x1c')](_0x3c2a0e);}};}function respondWithFilteredResult(_0x17f524,_0x1c5e97){return function(_0x2bd1bb){if(_0x2bd1bb){var _0x239c74=typeof _0x1c5e97[_0xcfb7('0x1d')]==='undefined'&&typeof _0x1c5e97[_0xcfb7('0x1e')]===_0xcfb7('0x1f');var _0x259e73=_0x2bd1bb[_0xcfb7('0x20')];var _0x2d1896=_0x239c74?0x0:_0x1c5e97[_0xcfb7('0x1d')];var _0xb8816c=_0x239c74?_0x2bd1bb[_0xcfb7('0x20')]:_0x1c5e97['offset']+_0x1c5e97[_0xcfb7('0x1e')];var _0x1e6bdd;if(_0xb8816c>=_0x259e73){_0xb8816c=_0x259e73;_0x1e6bdd=0xc8;}else{_0x1e6bdd=0xce;}_0x17f524[_0xcfb7('0x1a')](_0x1e6bdd);return _0x17f524[_0xcfb7('0x21')](_0xcfb7('0x22'),_0x2d1896+'-'+_0xb8816c+'/'+_0x259e73)[_0xcfb7('0x1c')](_0x2bd1bb);}return null;};}function saveUpdates(_0x5757fe){return function(_0x27461b){if(_0x27461b){return _0x27461b[_0xcfb7('0x23')](_0x5757fe)[_0xcfb7('0x10')](function(_0x170a05){return _0x170a05;});}return null;};}function removeEntity(_0x37b4c9){return function(_0x1350ef){if(_0x1350ef){return _0x1350ef[_0xcfb7('0x24')]()['then'](function(){var _0x523013=_0x1350ef[_0xcfb7('0x25')]({'plain':!![]});var _0x5d1998=_0xcfb7('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d1998,'resourceId':_0x523013['id']}})['then'](function(){return _0x1350ef;});})[_0xcfb7('0x10')](function(){_0x37b4c9[_0xcfb7('0x1a')](0xcc)[_0xcfb7('0x1b')]();});}};}function handleEntityNotFound(_0x220853){return function(_0x2b9566){if(!_0x2b9566){_0x220853[_0xcfb7('0x19')](0x194);}return _0x2b9566;};}function handleError(_0xc6bb96,_0x2380cb){_0x2380cb=_0x2380cb||0x1f4;return function(_0x130053){logger[_0xcfb7('0x16')](_0x130053['stack']);if(_0x130053['name']){delete _0x130053[_0xcfb7('0x27')];}_0xc6bb96[_0xcfb7('0x1a')](_0x2380cb)['send'](_0x130053);};}exports['index']=function(_0x4e27c5,_0x5052be){var _0x2ef97e={'include':[{'model':db['Pause'],'as':_0xcfb7('0x28')}]},_0x30685d={},_0x3998b7={'count':0x0,'rows':[]};var _0x5513da=_['map'](db[_0xcfb7('0x29')]['rawAttributes'],function(_0x3cdb0d){return{'name':_0x3cdb0d[_0xcfb7('0x2a')],'type':_0x3cdb0d[_0xcfb7('0x2b')][_0xcfb7('0x2c')]};});_0x30685d[_0xcfb7('0x2d')]=_[_0xcfb7('0x2e')](_0x5513da,_0xcfb7('0x27'));_0x30685d['query']=_['keys'](_0x4e27c5['query']);_0x30685d[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x30685d[_0xcfb7('0x2d')],_0x30685d[_0xcfb7('0x31')]);_0x2ef97e['attributes']=_['intersection'](_0x30685d[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4e27c5['query'][_0xcfb7('0x32')]));_0x2ef97e[_0xcfb7('0x33')]=_0x2ef97e[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x2ef97e[_0xcfb7('0x33')]:_0x30685d['model'];if(!_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x2ef97e[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x4e27c5['query'][_0xcfb7('0x1e')]);_0x2ef97e[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x2ef97e[_0xcfb7('0x37')]=qs['sort'](_0x4e27c5[_0xcfb7('0x31')]['sort']);_0x2ef97e[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x4e27c5[_0xcfb7('0x31')],_0x30685d[_0xcfb7('0x2f')]),_0x5513da);if(_0x4e27c5[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x2ef97e['where']=_[_0xcfb7('0x3b')](_0x2ef97e['where'],{'$or':_[_0xcfb7('0x2e')](_0x5513da,function(_0x3d6c96){if(_0x3d6c96[_0xcfb7('0x2b')]!==_0xcfb7('0x3c')){var _0x41f64e={};_0x41f64e[_0x3d6c96[_0xcfb7('0x27')]]={'$like':'%'+_0x4e27c5['query'][_0xcfb7('0x3a')]+'%'};return _0x41f64e;}})});}_0x2ef97e=_['merge']({},_0x2ef97e,_0x4e27c5[_0xcfb7('0x3d')]);var _0x42e854={'where':_0x2ef97e[_0xcfb7('0x38')]};return db[_0xcfb7('0x29')][_0xcfb7('0x20')](_0x42e854)[_0xcfb7('0x10')](function(_0x5ba5be){_0x3998b7[_0xcfb7('0x20')]=_0x5ba5be;if(_0x4e27c5['query'][_0xcfb7('0x3e')]){_0x2ef97e['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xcfb7('0x3f')](_0x2ef97e);})[_0xcfb7('0x10')](function(_0x4de10a){_0x3998b7['rows']=_0x4de10a;return _0x3998b7;})[_0xcfb7('0x10')](respondWithFilteredResult(_0x5052be,_0x2ef97e))['catch'](handleError(_0x5052be,null));};exports[_0xcfb7('0x40')]=function(_0x4c4ff2,_0x26d304){var _0x1f0c70={'raw':![],'where':{'id':_0x4c4ff2[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x42')],'as':_0xcfb7('0x28')}]},_0x4779b3={};_0x4779b3[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatWebsite'][_0xcfb7('0x44')]);_0x4779b3[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x4c4ff2[_0xcfb7('0x31')]);_0x4779b3[_0xcfb7('0x2f')]=_['intersection'](_0x4779b3['model'],_0x4779b3['query']);_0x1f0c70['attributes']=_['intersection'](_0x4779b3[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4c4ff2[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x1f0c70['attributes']=_0x1f0c70[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x1f0c70[_0xcfb7('0x33')]:_0x4779b3[_0xcfb7('0x2d')];if(_0x4c4ff2[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x1f0c70[_0xcfb7('0x45')]=[{'all':!![]}];}_0x1f0c70=_[_0xcfb7('0x3b')]({},_0x1f0c70,_0x4c4ff2[_0xcfb7('0x3d')]);return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x1f0c70)[_0xcfb7('0x10')](handleEntityNotFound(_0x26d304,null))[_0xcfb7('0x10')](respondWithResult(_0x26d304,null))[_0xcfb7('0x18')](handleError(_0x26d304,null));};exports[_0xcfb7('0x47')]=function(_0x2963f3,_0x2297d9){return db[_0xcfb7('0x29')][_0xcfb7('0x47')](_0x2963f3[_0xcfb7('0x48')],{})['then'](function(_0x3641f1){var _0x488aec=_0x2963f3[_0xcfb7('0x49')][_0xcfb7('0x25')]({'plain':!![]});if(!_0x488aec)throw new Error(_0xcfb7('0x4a'));if(_0x488aec[_0xcfb7('0x4b')]==='user'){var _0x4fd99a=_0x3641f1['get']({'plain':!![]});var _0x5caeec=_0xcfb7('0x26');return db[_0xcfb7('0x4c')][_0xcfb7('0x46')]({'where':{'name':_0x5caeec,'userProfileId':_0x488aec[_0xcfb7('0x4d')]},'raw':!![]})['then'](function(_0x530c39){if(_0x530c39&&_0x530c39['autoAssociation']===0x0){return db[_0xcfb7('0x4e')]['create']({'name':_0x4fd99a['name'],'resourceId':_0x4fd99a['id'],'type':_0x530c39[_0xcfb7('0x27')],'sectionId':_0x530c39['id']},{})['then'](function(){return _0x3641f1;});}else{return _0x3641f1;}})['catch'](function(_0x3932a1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3932a1);throw _0x3932a1;});}return _0x3641f1;})[_0xcfb7('0x10')](respondWithResult(_0x2297d9,0xc9))[_0xcfb7('0x18')](handleError(_0x2297d9,null));};exports['update']=function(_0x304b4f,_0x5c4626){if(_0x304b4f[_0xcfb7('0x48')]['id']){delete _0x304b4f[_0xcfb7('0x48')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x304b4f[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x42')],'as':_0xcfb7('0x28')}]})['then'](handleEntityNotFound(_0x5c4626,null))[_0xcfb7('0x10')](saveUpdates(_0x304b4f[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x5c4626,null))['catch'](handleError(_0x5c4626,null));};exports[_0xcfb7('0x24')]=function(_0x414816,_0x363050){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x414816[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x363050,null))['then'](removeEntity(_0x363050,null))['catch'](handleError(_0x363050,null));};exports[_0xcfb7('0x4f')]=function(_0x5eafa7,_0x5bc4a6){return db[_0xcfb7('0x29')][_0xcfb7('0x4f')]()[_0xcfb7('0x10')](respondWithResult(_0x5bc4a6,null))[_0xcfb7('0x18')](handleError(_0x5bc4a6,null));};exports[_0xcfb7('0x50')]=function(_0x33472d,_0x38760){if(_0x33472d[_0xcfb7('0x48')]['id']){delete _0x33472d[_0xcfb7('0x48')]['id'];}return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x33472d[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x38760,null))[_0xcfb7('0x10')](function(_0x1fa1c1){if(_0x1fa1c1){_0x33472d[_0xcfb7('0x48')]['ChatWebsiteId']=_0x1fa1c1['id'];return db['Disposition'][_0xcfb7('0x47')](_0x33472d[_0xcfb7('0x48')]);}})[_0xcfb7('0x10')](respondWithResult(_0x38760,null))[_0xcfb7('0x18')](handleError(_0x38760,null));};exports[_0xcfb7('0x51')]=function(_0x4917b3,_0x51ae83){var _0x34c1fe={'raw':![],'where':{}};var _0x12b38a={};var _0x208313={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x4917b3['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x51ae83,null))[_0xcfb7('0x10')](function(_0x46e485){if(_0x46e485){_0x12b38a['model']=_[_0xcfb7('0x43')](db[_0xcfb7('0x52')][_0xcfb7('0x44')]);_0x12b38a[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x4917b3[_0xcfb7('0x31')]);_0x12b38a[_0xcfb7('0x2f')]=_['intersection'](_0x12b38a[_0xcfb7('0x2d')],_0x12b38a['query']);_0x34c1fe['attributes']=_[_0xcfb7('0x30')](_0x12b38a[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x34c1fe[_0xcfb7('0x33')]=_0x34c1fe[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x34c1fe[_0xcfb7('0x33')]:_0x12b38a[_0xcfb7('0x2d')];if(!_0x4917b3['query']['hasOwnProperty']('nolimit')){_0x34c1fe['limit']=qs['limit'](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x34c1fe[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x34c1fe[_0xcfb7('0x37')]=qs['sort'](_0x4917b3[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x34c1fe[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x4917b3['query'],_0x12b38a[_0xcfb7('0x2f')]));_0x34c1fe[_0xcfb7('0x38')][_0xcfb7('0x54')]=_0x46e485['id'];if(_0x4917b3[_0xcfb7('0x31')]['filter']){_0x34c1fe[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x34c1fe[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x34c1fe[_0xcfb7('0x33')],function(_0xffc865){var _0x4dead3={};_0x4dead3[_0xffc865]={'$like':'%'+_0x4917b3['query'][_0xcfb7('0x3a')]+'%'};return _0x4dead3;})});}_0x34c1fe=_[_0xcfb7('0x3b')]({},_0x34c1fe,_0x4917b3[_0xcfb7('0x3d')]);return db[_0xcfb7('0x52')][_0xcfb7('0x20')]({'where':_0x34c1fe[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x49f772){_0x208313['count']=_0x49f772;if(_0x4917b3['query'][_0xcfb7('0x3e')]){_0x34c1fe[_0xcfb7('0x45')]=[{'all':!![]}];}return db[_0xcfb7('0x52')][_0xcfb7('0x3f')](_0x34c1fe);})[_0xcfb7('0x10')](function(_0x18f466){_0x208313[_0xcfb7('0x55')]=_0x18f466;return _0x208313;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x51ae83,_0x34c1fe))[_0xcfb7('0x18')](handleError(_0x51ae83,null));};exports[_0xcfb7('0x56')]=function(_0x41a97b,_0x385527){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x41a97b[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x385527,null))['then'](function(_0x2676a6){if(_0x2676a6){return _0x2676a6['removeDispositions'](_0x41a97b['query'][_0xcfb7('0x57')]);}})[_0xcfb7('0x10')](respondWithStatusCode(_0x385527,null))[_0xcfb7('0x18')](handleError(_0x385527,null));};exports[_0xcfb7('0x58')]=function(_0x42c21a,_0x5b5b2a){if(_0x42c21a[_0xcfb7('0x48')]['id']){delete _0x42c21a[_0xcfb7('0x48')]['id'];}return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x42c21a[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x5b5b2a,null))[_0xcfb7('0x10')](function(_0x517c8f){if(_0x517c8f){_0x42c21a[_0xcfb7('0x48')][_0xcfb7('0x54')]=_0x517c8f['id'];return db[_0xcfb7('0x59')]['create'](_0x42c21a[_0xcfb7('0x48')]);}})[_0xcfb7('0x10')](respondWithResult(_0x5b5b2a,null))[_0xcfb7('0x18')](handleError(_0x5b5b2a,null));};exports[_0xcfb7('0x5a')]=function(_0x2e2821,_0x292e3f){var _0x4be235={'raw':![],'where':{}};var _0x179945={};var _0x4550d9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2e2821[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x292e3f,null))[_0xcfb7('0x10')](function(_0x54a3b2){if(_0x54a3b2){_0x179945[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0x59')][_0xcfb7('0x44')]);_0x179945[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x2e2821[_0xcfb7('0x31')]);_0x179945['filters']=_['intersection'](_0x179945[_0xcfb7('0x2d')],_0x179945[_0xcfb7('0x31')]);_0x4be235['attributes']=_[_0xcfb7('0x30')](_0x179945[_0xcfb7('0x2d')],qs['fields'](_0x2e2821['query']['fields']));_0x4be235[_0xcfb7('0x33')]=_0x4be235[_0xcfb7('0x33')]['length']?_0x4be235['attributes']:_0x179945[_0xcfb7('0x2d')];if(!_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x4be235[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x2e2821['query'][_0xcfb7('0x1e')]);_0x4be235['offset']=qs[_0xcfb7('0x1d')](_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x4be235[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x4be235[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_['pick'](_0x2e2821[_0xcfb7('0x31')],_0x179945['filters']));_0x4be235[_0xcfb7('0x38')][_0xcfb7('0x54')]=_0x54a3b2['id'];if(_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x4be235[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x4be235['where'],{'$or':_['map'](_0x4be235[_0xcfb7('0x33')],function(_0x457192){var _0x47eacf={};_0x47eacf[_0x457192]={'$like':'%'+_0x2e2821['query'][_0xcfb7('0x3a')]+'%'};return _0x47eacf;})});}_0x4be235=_[_0xcfb7('0x3b')]({},_0x4be235,_0x2e2821[_0xcfb7('0x3d')]);return db[_0xcfb7('0x59')][_0xcfb7('0x20')]({'where':_0x4be235[_0xcfb7('0x38')]})['then'](function(_0x498b76){_0x4550d9['count']=_0x498b76;if(_0x2e2821[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x4be235['include']=[{'all':!![]}];}return db[_0xcfb7('0x59')][_0xcfb7('0x3f')](_0x4be235);})[_0xcfb7('0x10')](function(_0x12686d){_0x4550d9[_0xcfb7('0x55')]=_0x12686d;return _0x4550d9;});}})['then'](respondWithFilteredResult(_0x292e3f,_0x4be235))[_0xcfb7('0x18')](handleError(_0x292e3f,null));};exports[_0xcfb7('0x5b')]=function(_0x5d2c9c,_0x218fad){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5d2c9c[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x218fad,null))['then'](function(_0x3f9d4e){if(_0x3f9d4e){return _0x3f9d4e[_0xcfb7('0x5b')](_0x5d2c9c[_0xcfb7('0x31')]['ids']);}})['then'](respondWithStatusCode(_0x218fad,null))[_0xcfb7('0x18')](handleError(_0x218fad,null));};exports['addLogo']=function(_0xae157f,_0x20ee69){_0xae157f['body'][_0xcfb7('0x5c')]=_0xae157f[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db['ChatWebsite'][_0xcfb7('0x46')]({'where':{'id':_0xae157f['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x20ee69,null))[_0xcfb7('0x10')](saveUpdates(_0xae157f[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x20ee69,null))[_0xcfb7('0x18')](handleError(_0x20ee69,null));};exports['addAvatar']=function(_0x257190,_0x274353){_0x257190[_0xcfb7('0x48')][_0xcfb7('0x5f')]=_0x257190[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x257190[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x274353,null))[_0xcfb7('0x10')](saveUpdates(_0x257190['body'],null))[_0xcfb7('0x10')](respondWithResult(_0x274353,null))[_0xcfb7('0x18')](handleError(_0x274353,null));};exports[_0xcfb7('0x60')]=function(_0x535f6d,_0x44c16f){_0x535f6d[_0xcfb7('0x48')][_0xcfb7('0x61')]=_0x535f6d[_0xcfb7('0x5d')][_0xcfb7('0x5e')];return db['ChatWebsite'][_0xcfb7('0x46')]({'where':{'id':_0x535f6d[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x44c16f,null))[_0xcfb7('0x10')](saveUpdates(_0x535f6d[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x44c16f,null))[_0xcfb7('0x18')](handleError(_0x44c16f,null));};exports[_0xcfb7('0x62')]=function(_0x4243b0,_0x2580ae){_0x4243b0[_0xcfb7('0x48')]['systemAvatar']=_0x4243b0['file']['filename'];return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x4243b0[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2580ae,null))['then'](saveUpdates(_0x4243b0[_0xcfb7('0x48')],null))[_0xcfb7('0x10')](respondWithResult(_0x2580ae,null))['catch'](handleError(_0x2580ae,null));};exports[_0xcfb7('0x63')]=function(_0xb1bbc,_0x3d8bec){var _0x3e595a=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x66'));var _0x2bf518={'where':{'id':_0xb1bbc['params']['id']},'attributes':['id',_0xcfb7('0x5c')],'raw':!![]};var _0x4f1568=![];return require(_0xcfb7('0x67'))['getLicense']()[_0xcfb7('0x10')](function(_0x308bb0){if(_0x308bb0){_0x4f1568=_0x308bb0[_0xcfb7('0x68')];}})['then'](function(){return db['ChatWebsite']['find'](_0x2bf518);})[_0xcfb7('0x10')](handleEntityNotFound(_0x3d8bec,null))[_0xcfb7('0x10')](function(_0x31af09){if(_0x31af09){if(!_[_0xcfb7('0x69')](_0x31af09[_0xcfb7('0x5c')])){if(fs['existsSync'](path['join'](config['root'],'server/files/images/logos/',_0x31af09['sitepic']))&&_0x4f1568){_0x3e595a=path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x6a'),_0x31af09[_0xcfb7('0x5c')]);}}return _0x3d8bec[_0xcfb7('0x6b')](_0x3e595a);}})[_0xcfb7('0x18')](handleError(_0x3d8bec,null));};exports[_0xcfb7('0x6c')]=function(_0xc6c2da,_0xa39b5e){var _0x3fa35e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6d'));var _0x5c6827={'where':{'id':_0xc6c2da[_0xcfb7('0x41')]['id']},'attributes':['id',_0xcfb7('0x5f')],'raw':!![]};return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x5c6827)['then'](handleEntityNotFound(_0xa39b5e,null))[_0xcfb7('0x10')](function(_0x13f498){if(_0x13f498){if(!_['isNil'](_0x13f498[_0xcfb7('0x5f')])){if(fs['existsSync'](path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x6e'),_0x13f498[_0xcfb7('0x5f')]))){_0x3fa35e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x13f498['agentAvatar']);}}return _0xa39b5e['download'](_0x3fa35e);}})[_0xcfb7('0x18')](handleError(_0xa39b5e,null));};exports[_0xcfb7('0x6f')]=function(_0x382e6b,_0xa1dbf6){var _0x5ddb31=path[_0xcfb7('0x64')](config['root'],_0xcfb7('0x70'));var _0x50db96={'where':{'id':_0x382e6b['params']['id']},'attributes':['id',_0xcfb7('0x61'),_0xcfb7('0x71')],'raw':!![]};return db[_0xcfb7('0x29')]['find'](_0x50db96)[_0xcfb7('0x10')](handleEntityNotFound(_0xa1dbf6,null))[_0xcfb7('0x10')](function(_0x54f11f){if(_0x54f11f){if(!_[_0xcfb7('0x69')](_0x54f11f['customerAvatar'])){if(fs[_0xcfb7('0x72')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x54f11f['customerAvatar']))&&_0x54f11f['showCustomerAvatar']){_0x5ddb31=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x6e'),_0x54f11f['customerAvatar']);}}return _0xa1dbf6['download'](_0x5ddb31);}})[_0xcfb7('0x18')](handleError(_0xa1dbf6,null));};exports[_0xcfb7('0x73')]=function(_0x57f262,_0x3471f5){var _0x22fa0a=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0x74'));var _0x32b42e={'where':{'id':_0x57f262[_0xcfb7('0x41')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xcfb7('0x29')][_0xcfb7('0x46')](_0x32b42e)['then'](handleEntityNotFound(_0x3471f5,null))[_0xcfb7('0x10')](function(_0x1a8db7){if(_0x1a8db7){if(!_['isNil'](_0x1a8db7[_0xcfb7('0x75')])){if(fs[_0xcfb7('0x72')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],'server/files/images/avatars/',_0x1a8db7['systemAvatar']))){_0x22fa0a=path[_0xcfb7('0x64')](config['root'],'server/files/images/avatars/',_0x1a8db7[_0xcfb7('0x75')]);}}return _0x3471f5[_0xcfb7('0x6b')](_0x22fa0a);}})[_0xcfb7('0x18')](handleError(_0x3471f5,null));};exports[_0xcfb7('0x76')]=function(_0x4d1ff8,_0x2800f0){var _0x4884d8=require(_0xcfb7('0x77'));var _0x4fbb97=new _0x4884d8();var _0x5ca520=_0x4fbb97[_0xcfb7('0x78')](_0x4d1ff8[_0xcfb7('0x79')]['user-agent'])[_0xcfb7('0x7a')]();var _0x5b2f5a={'body':_0x4d1ff8[_0xcfb7('0x48')],'channel':_0xcfb7('0x7b')};var _0x4c976b=[];var _0x33c229=[];var _0x2b8533={};var _0x29efee=![];return db[_0xcfb7('0x7c')]['describe']()[_0xcfb7('0x10')](function(_0x50c468){if(!_0x50c468){throw new db['Sequelize'][(_0xcfb7('0x7d'))]('no\x20available\x20attributes');}_0x4c976b=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x50c468),[_0xcfb7('0x7f'),_0xcfb7('0x80')]);_0x33c229=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x50c468),['createdAt',_0xcfb7('0x80'),'CompanyId',_0xcfb7('0x81')]);if(_0x4d1ff8[_0xcfb7('0x48')]['id']){delete _0x4d1ff8[_0xcfb7('0x48')]['id'];}if(_[_0xcfb7('0x69')](_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')])){throw new db['Sequelize'][(_0xcfb7('0x7d'))]('from\x20is\x20mandatory');}if(_[_0xcfb7('0x69')](_0x4d1ff8[_0xcfb7('0x48')]['body'])||_0x4d1ff8[_0xcfb7('0x48')]['body']===''){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x84'));}if(_[_0xcfb7('0x69')](_0x4d1ff8['body'][_0xcfb7('0x85')])){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x86')+_0x33c229);}if(!_[_0xcfb7('0x87')](_0x33c229,_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x85')])){throw new db[(_0xcfb7('0x83'))]['ValidationError'](_0xcfb7('0x88')+_0x33c229);}_0x2b8533[_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x85')]]=_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')];})['then'](function(){return db['ChatWebsite']['find']({'where':{'id':_0x4d1ff8[_0xcfb7('0x41')]['id']},'include':[{'model':db[_0xcfb7('0x89')],'as':_0xcfb7('0x8a'),'include':[{'model':db['CmContact'],'as':_0xcfb7('0x8b'),'where':_0x2b8533,'limit':0x1,'order':[[_0xcfb7('0x80'),_0xcfb7('0x8c')]]}]},{'model':db[_0xcfb7('0x8d')],'as':_0xcfb7('0x8e')}]});})[_0xcfb7('0x10')](handleEntityNotFound(_0x2800f0,null))['then'](function(_0x2adae9){if(_0x2adae9&&_0x2adae9['List']){_0x5b2f5a['account']=_0x2adae9;_0x5b2f5a[_0xcfb7('0x8f')]=_0x2adae9[_0xcfb7('0x8e')];_0x5b2f5a[_0xcfb7('0x90')]=_0x2adae9['List'];_0x5b2f5a[_0xcfb7('0x8f')]=_[_0xcfb7('0x91')](_0x5b2f5a[_0xcfb7('0x8f')],['priority'],[_0xcfb7('0x92')]);if(_0x5b2f5a[_0xcfb7('0x93')]['Applications']){delete _0x5b2f5a['account'][_0xcfb7('0x8e')];}if(_0x5b2f5a[_0xcfb7('0x93')]['List']&&_0x5b2f5a['account'][_0xcfb7('0x8a')][_0xcfb7('0x8b')][_0xcfb7('0x34')]){return _0x5b2f5a['account'][_0xcfb7('0x8a')][_0xcfb7('0x8b')][0x0];}var _0x25797c=_[_0xcfb7('0xa')](_0x4d1ff8[_0xcfb7('0x48')],{'firstName':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')],'ListId':_0x2adae9['ListId']});_0x25797c[_0x4d1ff8['body']['mapKey']]=_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x82')];return db['CmContact']['create'](_0x25797c,{'fields':_0x4c976b,'raw':!![]});}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2800f0,null))[_0xcfb7('0x10')](function(_0x57efd4){_0x5b2f5a['contact']=_0x57efd4;var _0x1165be=_0x4d1ff8['body']['customerIp'];if(_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x94')]){_0x1165be=_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x94')];}else if(_0x4d1ff8['headers'][_0xcfb7('0x95')]){_0x1165be=_['first'](_0x4d1ff8['headers']['x-forwarded-for']['split'](','));}if(_0x57efd4){var _0x8f276d={'ContactId':_0x57efd4['id'],'ChatWebsiteId':_0x4d1ff8['params']['id'],'from':(_0x57efd4['firstName']||'')+'\x20'+(_0x57efd4[_0xcfb7('0x96')]||''),'customerIp':_0x1165be,'customerPort':_0x4d1ff8[_0xcfb7('0x79')][_0xcfb7('0x97')]?_0x4d1ff8[_0xcfb7('0x79')]['x-real-port']:null,'referer':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0x98')],'browserName':_0x5ca520['browser'][_0xcfb7('0x27')]&&_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x9a')]?util[_0xcfb7('0x9b')](_0xcfb7('0x9c'),_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x27')],_0x5ca520[_0xcfb7('0x99')]['version']):'unknown','browserVersion':_0x5ca520[_0xcfb7('0x99')][_0xcfb7('0x9a')]||_0xcfb7('0x9d'),'osName':util['format']('%s\x20%s',_0x5ca520['os']['name'],_0x5ca520['os'][_0xcfb7('0x9a')]),'osVersion':_0x5ca520['os'][_0xcfb7('0x9a')],'deviceModel':_0x5ca520[_0xcfb7('0x9e')][_0xcfb7('0x2d')]&&_0x5ca520['device'][_0xcfb7('0x9f')]?util['format'](_0xcfb7('0xa0'),_0x5ca520['device'][_0xcfb7('0x2d')],_0x5ca520[_0xcfb7('0x9e')][_0xcfb7('0x9f')],_0x5ca520['device']['type']):null,'deviceVendor':_0x5ca520[_0xcfb7('0x9e')]['vendor'],'deviceType':_0x5ca520['device'][_0xcfb7('0x2b')],'formData':JSON['stringify'](_0x4d1ff8[_0xcfb7('0x48')])};var _0x5e071a={'ChatWebsiteId':_0x4d1ff8[_0xcfb7('0x41')]['id'],'closed':![]};if(_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa1')]){_0x5e071a[_0xcfb7('0xa1')]=_0x4d1ff8[_0xcfb7('0x48')]['threadId'];return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':_0x5e071a})[_0xcfb7('0x10')](function(_0x44e80b){if(_0x44e80b){return[_0x44e80b,![]];}_0x8f276d[_0xcfb7('0xa1')]=_0x4d1ff8[_0xcfb7('0x48')]['threadId'];_0x8f276d[_0xcfb7('0xa3')]=_0x4d1ff8['body'][_0xcfb7('0xa3')];return db[_0xcfb7('0xa2')][_0xcfb7('0x47')](_0x8f276d)[_0xcfb7('0x10')](function(_0x474d84){return[_0x474d84,!![]];});});}_0x5e071a[_0xcfb7('0xa4')]=_0x57efd4['id'];if(_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa5')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa5')]['id']){_0x5e071a['id']=_0x4d1ff8['body'][_0xcfb7('0xa5')]['id'];return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':_0x5e071a})[_0xcfb7('0x10')](function(_0x516428){if(_0x516428){return[_0x516428,![]];}return db['ChatInteraction'][_0xcfb7('0x47')](_0x8f276d)[_0xcfb7('0x10')](function(_0x41e4f5){return[_0x41e4f5,!![]];});});}return db[_0xcfb7('0xa2')]['create'](_0x8f276d)['then'](function(_0x499128){return[_0x499128,!![]];});}})[_0xcfb7('0xa6')](function(_0xf6eb3f,_0x229ffe){if(_0xf6eb3f){_0x29efee=_0x229ffe;if(!_0x229ffe){var _0x417866={'from':(_0x5b2f5a[_0xcfb7('0xa7')][_0xcfb7('0xa8')]||'')+'\x20'+(_0x5b2f5a['contact'][_0xcfb7('0x96')]||'')};if(_0x4d1ff8['body'][_0xcfb7('0xa1')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa9')]&&_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xa1')]!=_0x4d1ff8['body'][_0xcfb7('0xa9')]){_0x417866['threadId']=_0x4d1ff8['body']['messageId'];}return _0xf6eb3f[_0xcfb7('0x23')](_0x417866);}else{return _0xf6eb3f;}}})['then'](function(_0x1e18ef){_0x5b2f5a[_0xcfb7('0xa5')]=_0x1e18ef['get']({'plain':!![]});_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xaa')]=_0x29efee;if(_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xaa')]){if(_0x5b2f5a[_0xcfb7('0x93')][_0xcfb7('0xab')]){_0x5b2f5a[_0xcfb7('0x8f')]['push']({'id':0x0,'priority':_0x5b2f5a[_0xcfb7('0x8f')][_0xcfb7('0x34')]+0x1,'app':_0xcfb7('0xac'),'appdata':_0xcfb7('0xad'),'interval':'*,*,*,*'});}}return db[_0xcfb7('0xae')][_0xcfb7('0x47')]({'body':_0x4d1ff8['body'][_0xcfb7('0x48')],'ChatWebsiteId':_0x4d1ff8[_0xcfb7('0x41')]['id'],'ChatInteractionId':_0x1e18ef['id'],'direction':'in','ContactId':_0x5b2f5a[_0xcfb7('0xa7')]['id'],'AttachmentId':_0x4d1ff8[_0xcfb7('0x48')][_0xcfb7('0xaf')]});})['then'](function(_0x4f0da2){_0x5b2f5a[_0xcfb7('0x17')]=_0x4f0da2;if(_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xb0')]){return db[_0xcfb7('0xb1')][_0xcfb7('0x46')]({'attributes':['id',_0xcfb7('0x27')],'where':{'id':_0x5b2f5a[_0xcfb7('0xa5')][_0xcfb7('0xb0')]}})[_0xcfb7('0x10')](function(_0xa1f2d6){if(_0xa1f2d6){_0x5b2f5a[_0xcfb7('0x8f')][_0xcfb7('0xb2')]({'id':0x0,'priority':0x0,'app':_0xcfb7('0xb3'),'appdata':_0xa1f2d6['name']+','+(_0x5b2f5a[_0xcfb7('0x93')][_0xcfb7('0xb4')]||0xa),'interval':_0xcfb7('0xb5')});_0x5b2f5a['forcedOwnership']=!![];}return respondWithRpcPromise(_0xcfb7('0xb6'),'startRouting',_0x5b2f5a);});}return respondWithRpcPromise(_0xcfb7('0xb6'),_0xcfb7('0xb7'),_0x5b2f5a);})[_0xcfb7('0x10')](function(_0x12a16c){respondWithRpcPromise('EventManager',_0xcfb7('0xb8'),{'event':_0xcfb7('0x76'),'message':_0x12a16c},client9002);return _0x12a16c;})[_0xcfb7('0x10')](respondWithResult(_0x2800f0,null))[_0xcfb7('0x18')](handleError(_0x2800f0,null));};exports[_0xcfb7('0xb9')]=function(_0x5462fc,_0x3d240a){var _0x20b520,_0x2d13f7,_0x448a42;var _0x1c95f2=[];var _0x30859d={};var _0x12326d=_0x5462fc[_0xcfb7('0xba')]||[];var _0x5d5fdd=[];var _0x24ac7f;return db['CmContact'][_0xcfb7('0x4f')]()[_0xcfb7('0x10')](function(_0x11748d){if(!_0x11748d){throw new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))]('no\x20available\x20attributes');}_0x1c95f2=_[_0xcfb7('0x7e')](_[_0xcfb7('0x43')](_0x11748d),['createdAt','updatedAt',_0xcfb7('0xbb'),_0xcfb7('0x81')]);if(_0x5462fc[_0xcfb7('0x48')]['id']){delete _0x5462fc[_0xcfb7('0x48')]['id'];}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db['Sequelize'][(_0xcfb7('0x7d'))](_0xcfb7('0xbd')));}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')])||_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')]===''){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0x84')));}if(_[_0xcfb7('0x69')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0xbe')])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)[_0xcfb7('0xbc')](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))](_0xcfb7('0xbf')+_0x1c95f2));}if(!_[_0xcfb7('0x87')](_0x1c95f2,_0x5462fc['body']['mapKeyOffline'])){throw _0x3d240a[_0xcfb7('0x1a')](0x1f4)['send'](new db[(_0xcfb7('0x83'))][(_0xcfb7('0x7d'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c95f2));}_0x30859d[_0x5462fc[_0xcfb7('0x48')]['mapKeyOffline']]=_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')];})['then'](function(){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5462fc[_0xcfb7('0x41')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0xcfb7('0xc0')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x3d240a,null))[_0xcfb7('0x10')](function(_0x2e8e8f){if(_0x2e8e8f&&_0x2e8e8f[_0xcfb7('0x8a')]){_0x2d13f7=_0x2e8e8f;var _0x47eaee=_['defaults'](_0x5462fc[_0xcfb7('0x48')],{'firstName':_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')],'phone':_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x82')],'ListId':_0x2e8e8f[_0xcfb7('0x81')]});_0x47eaee[_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0xbe')]]=_0x5462fc[_0xcfb7('0x48')]['from'];return db['CmContact'][_0xcfb7('0xc1')]({'where':_0x30859d,'defaults':_0x47eaee});}})[_0xcfb7('0xa6')](function(_0xbe6ba4){if(_0xbe6ba4){_0x448a42=_0xbe6ba4;var _0x475522=fs[_0xcfb7('0xc2')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xc3')),_0xcfb7('0xc4'));var _0x1371d2=ejs[_0xcfb7('0xc5')](_0x475522,{'body':_[_0xcfb7('0xc6')](_0x5462fc[_0xcfb7('0x48')][_0xcfb7('0x48')]),'bodyTitle':_0x2d13f7['offlineMessageBody']});return db[_0xcfb7('0xc7')][_0xcfb7('0x47')]({'body':_0x1371d2,'plainBody':htmlToText[_0xcfb7('0xc8')](_0x1371d2),'ContactId':_0xbe6ba4['id'],'ChatWebsiteId':_0x2d13f7['id']});}})['then'](function(_0x30d944){_0x24ac7f=_0x30d944;if(_0x12326d[_0xcfb7('0x34')]){var _0x40684c=_0x12326d['map'](function(_0xa8321d){return{'name':_0xa8321d['originalname'],'basename':_0xa8321d[_0xcfb7('0x5e')],'type':_0xa8321d[_0xcfb7('0xc9')],'ChatOfflineMessageId':_0x30d944['id']};});_0x5d5fdd=_0x40684c[_0xcfb7('0x2e')](_0x40e3d5=>{var _0x3b766a={'filename':_0x40e3d5['name'],'path':path['join'](config[_0xcfb7('0x65')],_0xcfb7('0xca'),_0xcfb7('0xba'),'attachments','offline-chat',_0x40e3d5[_0xcfb7('0xcb')])};return _0x3b766a;});if(!_0x2d13f7[_0xcfb7('0xcc')]){return db[_0xcfb7('0xcd')][_0xcfb7('0xce')](function(_0x40f3ac){return db[_0xcfb7('0xcf')]['bulkCreate'](_0x40684c,{'transaction':_0x40f3ac});});}}})[_0xcfb7('0x10')](function(){if(_0x24ac7f){_0x20b520=_0x24ac7f;return db[_0xcfb7('0xc0')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xcfb7('0xd0')],'as':_0xcfb7('0xd1'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcfb7('0xd2'),'raw':!![]}]}]});}})[_0xcfb7('0x10')](function(_0x22a995){if(_0x22a995&&_0x22a995['Smtp']&&_0x2d13f7[_0xcfb7('0xd3')]&&_0x2d13f7['forwardOfflineAddress']){var _0x1cd526=_0x22a995[_0xcfb7('0xd4')]();return respondWithRpcPromise(_0xcfb7('0xd5'),_0xcfb7('0xd6'),{'account':_0x1cd526,'message':{'from':util[_0xcfb7('0x9b')](_0xcfb7('0xd7'),_0x22a995[_0xcfb7('0x27')],_0x22a995[_0xcfb7('0xd8')]||_0x22a995['Smtp']['user']),'to':_0x2d13f7[_0xcfb7('0xd9')],'subject':_0x2d13f7[_0xcfb7('0xda')],'html':_0x20b520[_0xcfb7('0x48')],'attachments':_0x5d5fdd}},client9003)[_0xcfb7('0x10')](function(){return _0x20b520;})[_0xcfb7('0x18')](function(_0x1a3961){logger['error'](_0x1a3961);});}})['then'](function(){if(_0x2d13f7&&_0x2d13f7[_0xcfb7('0xcc')]&&_0x2d13f7[_0xcfb7('0xdb')]){var _0x5a143f=[];if(_0x12326d[_0xcfb7('0x34')]){_0x5a143f=_0x12326d[_0xcfb7('0x2e')](function(_0x30a9bb){return{'name':_0x30a9bb[_0xcfb7('0xdc')],'basename':_0x30a9bb['filename'],'type':_0x30a9bb[_0xcfb7('0xc9')],'ChatOfflineMessageId':_0x24ac7f['id']};});}var _0x186b0a;if(!_[_0xcfb7('0x69')](_0x2d13f7['subjectOffline'])){var _0x3e5199=_[_0xcfb7('0x2e')](_0x5462fc[_0xcfb7('0x48')],function(_0x38e035){return _0x38e035;});var _0x2b37c9=_['toPairsIn'](_0x3e5199)[0x0];var _0x22c2d7=_[_0xcfb7('0xdd')](_0x2b37c9,function(_0x167b73){return _0x167b73;});_0x186b0a=_0x22c2d7[0x1][_0x2d13f7['subjectOffline']];}var _0x2aec6d={'from':_0x448a42[_0xcfb7('0xd8')],'firstName':_0x448a42[_0xcfb7('0xa8')],'lastName':_0x448a42[_0xcfb7('0x96')],'mapKey':_0xcfb7('0xd8'),'message':{'from':_0x448a42[_0xcfb7('0xd8')],'to':_0x2d13f7['MailAccount'][_0xcfb7('0xd8')],'cc':'','subject':_[_0xcfb7('0x69')](_0x186b0a)?_0x2d13f7['offlineMessageSubject']:_0x186b0a,'messageId':'','sentAt':new Date(),'attach':_0x5a143f[_0xcfb7('0x34')],'attachments':_0x5a143f,'originChannel':_0xcfb7('0xde'),'ChatWebsiteId':_0x2d13f7['id'],'ChatOfflineMessageId':_0x20b520['id'],'originTo':_0x2d13f7[_0xcfb7('0xc0')][_0xcfb7('0xd8')]},'body':_0x20b520[_0xcfb7('0x48')]};var _0x22257b={'account':{'id':_0x2d13f7[_0xcfb7('0xdb')]},'body':_0x2aec6d,'log':_0xcfb7('0xdf')};return respondWithRpcPromise(_0xcfb7('0xdf'),_0xcfb7('0xe0'),_0x22257b,client9001)[_0xcfb7('0x10')](function(){return _0x20b520;})[_0xcfb7('0x18')](function(_0x171fb8){logger['error'](_0x171fb8);});}return;})[_0xcfb7('0x10')](function(){if(_0x20b520){return _0x20b520;}})[_0xcfb7('0x10')](respondWithResult(_0x3d240a,null))[_0xcfb7('0x18')](function(_0x490ec2){logger[_0xcfb7('0x16')](_0xcfb7('0x18'),_0x490ec2);for(var _0x13b5f6 of _0x12326d){var _0xc4fe3e=path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xca'),_0xcfb7('0xba'),'attachments','offline-chat',_0x13b5f6[_0xcfb7('0x5e')]);fs_extra[_0xcfb7('0xe1')](_0xc4fe3e)[_0xcfb7('0x18')](function(_0x49c1dc){logger['error'](_0xcfb7('0xe2'),_0xc4fe3e,_0x49c1dc);});}});};exports[_0xcfb7('0xe3')]=function(_0x33b8c6,_0xd88e52){return db[_0xcfb7('0xa2')][_0xcfb7('0x46')]({'where':{'id':_0x33b8c6[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0xd88e52,null))[_0xcfb7('0x10')](function(_0x16263d){if(_0x16263d){return _0x16263d[_0xcfb7('0xe3')](_0x33b8c6['body'][_0xcfb7('0x57')],_['omit'](_0x33b8c6[_0xcfb7('0x48')],[_0xcfb7('0x57'),'id'])||{});}})[_0xcfb7('0x10')](respondWithResult(_0xd88e52,null))[_0xcfb7('0x18')](handleError(_0xd88e52,null));};exports[_0xcfb7('0xe4')]=function(_0x54dadb,_0x489bd2){var _0x2ee4b4={'raw':![],'where':{}};var _0x471cfb={};var _0x45acb6={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x54dadb[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x489bd2,null))[_0xcfb7('0x10')](function(_0xe03bb8){if(_0xe03bb8){_0x471cfb[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatInteraction'][_0xcfb7('0x44')]);_0x471cfb[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x54dadb['query']);_0x471cfb['filters']=_[_0xcfb7('0x30')](_0x471cfb[_0xcfb7('0x2d')],_0x471cfb[_0xcfb7('0x31')]);_0x2ee4b4[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x471cfb[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x32')]));_0x2ee4b4['attributes']=_0x2ee4b4[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x2ee4b4[_0xcfb7('0x33')]:_0x471cfb[_0xcfb7('0x2d')];if(!_0x54dadb['query'][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x2ee4b4[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x54dadb[_0xcfb7('0x31')]['limit']);_0x2ee4b4['offset']=qs[_0xcfb7('0x1d')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x2ee4b4[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x2ee4b4[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x54dadb[_0xcfb7('0x31')],_0x471cfb['filters']));_0x2ee4b4[_0xcfb7('0x38')]['ChatWebsiteId']=_0xe03bb8['id'];if(_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x2ee4b4[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x2ee4b4[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x2ee4b4['attributes'],function(_0x135644){var _0x12d8ce={};_0x12d8ce[_0x135644]={'$like':'%'+_0x54dadb['query']['filter']+'%'};return _0x12d8ce;})});}_0x2ee4b4=_[_0xcfb7('0x3b')]({},_0x2ee4b4,_0x54dadb[_0xcfb7('0x3d')]);return db[_0xcfb7('0xa2')][_0xcfb7('0x20')]({'where':_0x2ee4b4[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x5d1158){_0x45acb6['count']=_0x5d1158;if(_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0x3e')]){_0x2ee4b4[_0xcfb7('0x45')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xcfb7('0xb1')],'as':_0xcfb7('0xe5'),'attributes':['name',_0xcfb7('0xe6'),_0xcfb7('0xe7')],'required':![]},{'model':db[_0xcfb7('0xe8')],'as':_0xcfb7('0xe9'),'attributes':['id',_0xcfb7('0x27'),_0xcfb7('0xea')],'where':_0x54dadb['query'][_0xcfb7('0xeb')]?{'id':_0x54dadb[_0xcfb7('0x31')][_0xcfb7('0xeb')]}:undefined,'required':_0x54dadb['query']['tag']?!![]:![]}];}return db[_0xcfb7('0xa2')]['findAll'](_0x2ee4b4);})[_0xcfb7('0x10')](function(_0x2b5856){_0x45acb6[_0xcfb7('0x55')]=_0x2b5856;return _0x45acb6;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x489bd2,_0x2ee4b4))[_0xcfb7('0x18')](handleError(_0x489bd2,null));};function iftimePromise(_0x493237,_0x340db7){return respondWithRpcPromise(_0xcfb7('0xec'),_0xcfb7('0xed'),{'command':_0x340db7[_0xcfb7('0xee')]?util[_0xcfb7('0x9b')]('iftime\x20%s,%s',_0x493237[_0xcfb7('0xef')],_0x340db7[_0xcfb7('0xee')]):util[_0xcfb7('0x9b')]('iftime\x20%s',_0x493237[_0xcfb7('0xef')])},client9002)[_0xcfb7('0x10')](function(_0xedd922){var _0x3d409e=_0xedd922&&_0xedd922['indexOf'](_0xcfb7('0xf0'))>=0x0?!![]:![];logger[_0xcfb7('0xf1')](_0xcfb7('0xf2'),_0x340db7['id'],_0x493237['id'],_0x493237['interval'],_0x3d409e?'ONLINE':'OFFLINE',_0x340db7[_0xcfb7('0xee')]?_0x340db7[_0xcfb7('0xee')]:_0xcfb7('0xf3'));return _0x3d409e;})[_0xcfb7('0x18')](function(_0x1d4cce){logger['error']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x340db7['id'],_0x493237['id'],_0x493237[_0xcfb7('0xef')],util['inspect'](_0x1d4cce,{'showHidden':![],'depth':null}),_0x340db7[_0xcfb7('0xee')]?_0x340db7[_0xcfb7('0xee')]:_0xcfb7('0xf3'));return![];});}exports['getSnippet']=function(_0x3ddfab,_0x8b3c77){var _0x280155=0x0;var _0x2ef97b=0x0;var _0x3cd15b=![];var _0x518d77;var _0x2725e1;return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x3ddfab[_0xcfb7('0x41')]['id']},'include':[{'model':db['Interval'],'as':_0xcfb7('0xf4'),'include':[{'model':db[_0xcfb7('0xf4')],'as':_0xcfb7('0xf5'),'attributes':['id',_0xcfb7('0xef')],'raw':!![]}]}]})[_0xcfb7('0x10')](handleEntityNotFound(_0x8b3c77,null))['then'](function(_0x4e1fe1){if(_0x4e1fe1){_0x518d77=_0x4e1fe1;return _0x4e1fe1['getProactiveActions']({'raw':!![]});}})['then'](function(_0x37ca38){if(_0x518d77){if(_0x37ca38){_0x2725e1=_0x37ca38;}}return require(_0xcfb7('0x67'))['getLicense']();})[_0xcfb7('0x10')](function(_0x3a035b){if(_0x3a035b){_0x2ef97b=_0x3a035b[_0xcfb7('0xf6')];_0x3cd15b=_0x3a035b['custom'];}})[_0xcfb7('0x10')](function(){return db[_0xcfb7('0xa2')]['count']({'where':{'closed':![]}});})[_0xcfb7('0x10')](function(_0x5428ab){_0x280155=_0x5428ab;if(_0x2ef97b&&_0x5428ab>_0x2ef97b){return db[_0xcfb7('0xf7')]['findOne']({'where':{'id':0x1}})['then'](function(_0x9ce544){if(_0x9ce544){_0x9ce544['increment'](_0xcfb7('0xf8'));}});}})[_0xcfb7('0x10')](function(){if(_0x518d77['Interval']&&_0x518d77[_0xcfb7('0xf4')][_0xcfb7('0xf5')]){var _0x608886=[];for(var _0x5a2c2a=0x0;_0x5a2c2a<_0x518d77[_0xcfb7('0xf4')][_0xcfb7('0xf5')][_0xcfb7('0x34')];_0x5a2c2a++){var _0x4757cf=_0x518d77['Interval']['Intervals'][_0x5a2c2a][_0xcfb7('0x25')]({'plain':!![]});_0x608886[_0xcfb7('0xf9')](iftimePromise(_0x4757cf,_0x518d77));}return BPromise['all'](_0x608886)['then'](function(_0x267ad3){return _[_0xcfb7('0xfa')](_0x267ad3);});}else{return!![];}})[_0xcfb7('0x10')](function(_0x4efb95){var _0x2aa5d1=fs[_0xcfb7('0xc2')](path[_0xcfb7('0x64')](config[_0xcfb7('0x65')],_0xcfb7('0xfb')),_0xcfb7('0xc4'));var _0x515863={'remote':_0x518d77['remote'],'query':querystring['stringify'](_[_0xcfb7('0x3b')](_0x518d77[_0xcfb7('0x25')]({'plain':!![]}),{'customerIp':_0x3ddfab['headers'][_0xcfb7('0x95')]||_0x3ddfab[_0xcfb7('0x79')]['x-real-ip']||_0x3ddfab[_0xcfb7('0xfc')]['remoteAddress']||_0x3ddfab['ip'],'referer':_0x3ddfab['headers'][_0xcfb7('0x98')],'openedInteractions':_0x280155,'maxInteractions':_0x2ef97b,'virtual':_0x3cd15b[_0xcfb7('0xf6')],'online':_0x4efb95,'custom':_0x3cd15b}))['replace'](/'/g,'\x5c\x27')};_0x8b3c77[_0xcfb7('0xbc')](ejs[_0xcfb7('0xc5')](Mustache['render'](_0x2aa5d1,_0x515863),{'proactiveActions':_0x2725e1,'alignment':_0x518d77['alignment'],'verticalAlignment':_0x518d77['verticalAlignment'],'div_color':_0x518d77[_0xcfb7('0xea')],'labelText':_0x518d77['labelText'],'text_color':_0x518d77[_0xcfb7('0xfd')],'text_button_color':_0x518d77[_0xcfb7('0xfe')],'button_color':_0x518d77[_0xcfb7('0xff')],'background_color':_0x518d77[_0xcfb7('0x100')],'hideWhenOffline':_0x518d77['hideWhenOffline'],'interval':_0x518d77[_0xcfb7('0x101')]}));})['catch'](handleError(_0x8b3c77,null));};exports[_0xcfb7('0x102')]=function(_0x119dbd,_0x1de36b){var _0x28d5c9=_0x119dbd[_0xcfb7('0x41')]['id'];var _0x258984=_0x119dbd['body'];var _0x2a301d=0xc8;var _0x4bf8e6=null;return db[_0xcfb7('0xcd')][_0xcfb7('0xce')]({'isolationLevel':db[_0xcfb7('0xcd')][_0xcfb7('0x103')][_0xcfb7('0x104')][_0xcfb7('0x105')]},function(_0x5bf40d){return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x28d5c9},'transaction':_0x5bf40d})['then'](function(_0x35231f){if(_0x35231f){return db['ChatApplication'][_0xcfb7('0x24')]({'where':{'ChatWebsiteId':_0x28d5c9},'transaction':_0x5bf40d})[_0xcfb7('0x10')](function(){var _0x249c12=_[_0xcfb7('0x2e')](_0x258984,function(_0x26bb55){_0x26bb55[_0xcfb7('0x54')]=_0x28d5c9;return _0x26bb55;});return db[_0xcfb7('0x8d')][_0xcfb7('0x106')](_0x249c12,{'transaction':_0x5bf40d});});}else{_0x2a301d=0x194;_0x4bf8e6=[];}});})[_0xcfb7('0x10')](function(){if(_0x2a301d!==0x194){return db[_0xcfb7('0x8d')][_0xcfb7('0x107')]({'where':{'ChatWebsiteId':_0x28d5c9},'order':_0xcfb7('0x108')})['then'](function(_0x3fb265){_0x4bf8e6=_0x3fb265;});}})['catch'](function(_0x49830d){_0x2a301d=0x1f4;logger[_0xcfb7('0x16')](_0x49830d[_0xcfb7('0x109')]);if(_0x49830d[_0xcfb7('0x27')]){delete _0x49830d[_0xcfb7('0x27')];}_0x4bf8e6=_0x49830d;})[_0xcfb7('0x10a')](function(){if(_0x4bf8e6===null){_0x1de36b[_0xcfb7('0x19')](_0x2a301d);}else{if(_0x2a301d===0x1f4){_0x1de36b[_0xcfb7('0x1a')](_0x2a301d)['send'](_0x4bf8e6);}else{_0x1de36b[_0xcfb7('0x1a')](_0x2a301d)[_0xcfb7('0x1c')](_0x4bf8e6);}}});};exports[_0xcfb7('0x10b')]=function(_0x2a4a8b,_0x2edfda){var _0x3ebfe7={};var _0x2d73aa={};var _0x2c88fd;var _0x5676cb;return db['ChatWebsite']['findOne']({'where':{'id':_0x2a4a8b[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x2edfda,null))['then'](function(_0x19c513){if(_0x19c513){_0x2c88fd=_0x19c513;_0x2d73aa[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db['ChatApplication']['rawAttributes']);_0x2d73aa[_0xcfb7('0x31')]=_['keys'](_0x2a4a8b[_0xcfb7('0x31')]);_0x2d73aa[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x2d73aa[_0xcfb7('0x2d')],_0x2d73aa['query']);_0x3ebfe7[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x2d73aa['model'],qs[_0xcfb7('0x32')](_0x2a4a8b['query']['fields']));_0x3ebfe7['attributes']=_0x3ebfe7[_0xcfb7('0x33')]['length']?_0x3ebfe7[_0xcfb7('0x33')]:_0x2d73aa[_0xcfb7('0x2d')];_0x3ebfe7[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x2a4a8b['query'][_0xcfb7('0x53')]);_0x3ebfe7[_0xcfb7('0x38')]=qs['filters'](_['pick'](_0x2a4a8b[_0xcfb7('0x31')],_0x2d73aa[_0xcfb7('0x2f')]));if(_0x2a4a8b['query']['filter']){_0x3ebfe7['where']=_['merge'](_0x3ebfe7[_0xcfb7('0x38')],{'$or':_[_0xcfb7('0x2e')](_0x3ebfe7['attributes'],function(_0x56d25b){var _0x166c9e={};_0x166c9e[_0x56d25b]={'$like':'%'+_0x2a4a8b['query'][_0xcfb7('0x3a')]+'%'};return _0x166c9e;})});}_0x3ebfe7=_[_0xcfb7('0x3b')]({},_0x3ebfe7,_0x2a4a8b[_0xcfb7('0x3d')]);return _0x2c88fd[_0xcfb7('0x10b')](_0x3ebfe7);}})[_0xcfb7('0x10')](function(_0x572b74){if(_0x572b74){_0x5676cb=_0x572b74['length'];if(!_0x2a4a8b[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x3ebfe7[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x2a4a8b[_0xcfb7('0x31')]['limit']);_0x3ebfe7[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x2a4a8b[_0xcfb7('0x31')]['offset']);}return _0x2c88fd['getApplications'](_0x3ebfe7);}})['then'](function(_0xdf8330){if(_0xdf8330){return _0xdf8330?{'count':_0x5676cb,'rows':_0xdf8330}:null;}})[_0xcfb7('0x10')](respondWithResult(_0x2edfda,null))['catch'](handleError(_0x2edfda,null));};exports[_0xcfb7('0x10c')]=function(_0x340f08,_0x33d12f){return db[_0xcfb7('0x10d')][_0xcfb7('0x46')]({'where':{'id':_0x340f08[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x33d12f,null))[_0xcfb7('0x10')](function(_0x1fbdf9){if(_0x1fbdf9){return _0x1fbdf9[_0xcfb7('0x10c')](_0x340f08[_0xcfb7('0x48')][_0xcfb7('0x57')],_[_0xcfb7('0x10e')](_0x340f08['body'],[_0xcfb7('0x57'),'id'])||{});}})['then'](respondWithResult(_0x33d12f,null))[_0xcfb7('0x18')](handleError(_0x33d12f,null));};exports[_0xcfb7('0x10f')]=function(_0x5aa2f7,_0x4f35c9){var _0x4ec857={};var _0x3a0924={};var _0x579c34;var _0x1895ee;return db[_0xcfb7('0x29')]['findOne']({'where':{'id':_0x5aa2f7[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x4f35c9,null))[_0xcfb7('0x10')](function(_0xc6bdbd){if(_0xc6bdbd){_0x579c34=_0xc6bdbd;_0x3a0924[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0x110')][_0xcfb7('0x44')]);_0x3a0924[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x5aa2f7['query']);_0x3a0924['filters']=_[_0xcfb7('0x30')](_0x3a0924[_0xcfb7('0x2d')],_0x3a0924[_0xcfb7('0x31')]);_0x4ec857[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x3a0924[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x5aa2f7['query']['fields']));_0x4ec857[_0xcfb7('0x33')]=_0x4ec857[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x4ec857['attributes']:_0x3a0924[_0xcfb7('0x2d')];_0x4ec857[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x4ec857[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_['pick'](_0x5aa2f7['query'],_0x3a0924[_0xcfb7('0x2f')]));if(_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x4ec857[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x4ec857[_0xcfb7('0x38')],{'$or':_['map'](_0x4ec857[_0xcfb7('0x33')],function(_0x42f47d){var _0x23d09c={};_0x23d09c[_0x42f47d]={'$like':'%'+_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x3a')]+'%'};return _0x23d09c;})});}_0x4ec857=_[_0xcfb7('0x3b')]({},_0x4ec857,_0x5aa2f7[_0xcfb7('0x3d')]);return _0x579c34['getProactiveActions'](_0x4ec857);}})[_0xcfb7('0x10')](function(_0x509288){if(_0x509288){_0x1895ee=_0x509288[_0xcfb7('0x34')];if(!_0x5aa2f7[_0xcfb7('0x31')]['hasOwnProperty'](_0xcfb7('0x36'))){_0x4ec857[_0xcfb7('0x1e')]=qs[_0xcfb7('0x1e')](_0x5aa2f7[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x4ec857[_0xcfb7('0x1d')]=qs['offset'](_0x5aa2f7[_0xcfb7('0x31')]['offset']);}return _0x579c34[_0xcfb7('0x10f')](_0x4ec857);}})[_0xcfb7('0x10')](function(_0x33e672){if(_0x33e672){return _0x33e672?{'count':_0x1895ee,'rows':_0x33e672}:null;}})['then'](respondWithResult(_0x4f35c9,null))[_0xcfb7('0x18')](handleError(_0x4f35c9,null));};exports[_0xcfb7('0x111')]=function(_0x4d3ff0,_0x400d86){var _0x3320b7=_0x4d3ff0[_0xcfb7('0x31')]['online']===_0xcfb7('0x112')?_0xcfb7('0x113'):'onlineForm';return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'attributes':['id',_0x3320b7],'where':{'id':_0x4d3ff0[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x400d86,null))[_0xcfb7('0x10')](function(_0x29a85a){if(_0x29a85a){var _0x3a2a9d=_0x29a85a[_0x3320b7];var _0x49306b=_0x3a2a9d&&_0x3a2a9d[_0xcfb7('0x114')]?_0x3a2a9d[_0xcfb7('0x114')]:[];_0x400d86[_0xcfb7('0xbc')]({'fromKey':_[_0xcfb7('0x69')](_0x3a2a9d[_0xcfb7('0x115')])?undefined:_0x3a2a9d['fromKey'],'count':_0x49306b[_0xcfb7('0x34')],'rows':_0x49306b});}})['catch'](handleError(_0x400d86,null));};exports[_0xcfb7('0x116')]=function(_0x277d96,_0x1e3c65){var _0x5b6502={'raw':![],'where':{}};var _0x13e1d6={};var _0x216dbf={'count':0x0,'rows':[]};return db[_0xcfb7('0x29')][_0xcfb7('0x117')]({'where':{'id':_0x277d96['params']['id']}})['then'](handleEntityNotFound(_0x1e3c65,null))[_0xcfb7('0x10')](function(_0x28b7fe){if(_0x28b7fe){_0x13e1d6[_0xcfb7('0x2d')]=_[_0xcfb7('0x43')](db[_0xcfb7('0xc7')][_0xcfb7('0x44')]);_0x13e1d6[_0xcfb7('0x31')]=_[_0xcfb7('0x43')](_0x277d96[_0xcfb7('0x31')]);_0x13e1d6[_0xcfb7('0x2f')]=_['intersection'](_0x13e1d6[_0xcfb7('0x2d')],_0x13e1d6[_0xcfb7('0x31')]);_0x5b6502[_0xcfb7('0x33')]=_[_0xcfb7('0x30')](_0x13e1d6['model'],qs[_0xcfb7('0x32')](_0x277d96['query'][_0xcfb7('0x32')]));_0x5b6502[_0xcfb7('0x33')]=_0x5b6502[_0xcfb7('0x33')][_0xcfb7('0x34')]?_0x5b6502['attributes']:_0x13e1d6['model'];if(!_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x5b6502[_0xcfb7('0x1e')]=qs['limit'](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x5b6502[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}_0x5b6502[_0xcfb7('0x37')]=qs['sort'](_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x53')]);_0x5b6502[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x277d96[_0xcfb7('0x31')],_0x13e1d6[_0xcfb7('0x2f')]));_0x5b6502['where']['ChatWebsiteId']=_0x28b7fe['id'];if(_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x5b6502[_0xcfb7('0x38')]=_[_0xcfb7('0x3b')](_0x5b6502['where'],{'$or':_[_0xcfb7('0x2e')](_0x5b6502[_0xcfb7('0x33')],function(_0x3b90c0){var _0x9e2165={};_0x9e2165[_0x3b90c0]={'$like':'%'+_0x277d96[_0xcfb7('0x31')][_0xcfb7('0x3a')]+'%'};return _0x9e2165;})});}_0x5b6502=_[_0xcfb7('0x3b')]({},_0x5b6502,_0x277d96[_0xcfb7('0x3d')]);return db[_0xcfb7('0xc7')]['count']({'where':_0x5b6502[_0xcfb7('0x38')]})[_0xcfb7('0x10')](function(_0x89635){_0x216dbf['count']=_0x89635;if(_0x277d96['query']['includeAll']){_0x5b6502[_0xcfb7('0x45')]=[{'all':!![]}];}else{_0x5b6502[_0xcfb7('0x45')]=[{'model':db[_0xcfb7('0x7c')],'as':_0xcfb7('0x118'),'required':![]},{'model':db['Attachment'],'as':_0xcfb7('0x119'),'required':![]}];}return db[_0xcfb7('0xc7')][_0xcfb7('0x3f')](_0x5b6502);})[_0xcfb7('0x10')](function(_0x1d2980){_0x216dbf[_0xcfb7('0x55')]=_0x1d2980;return _0x216dbf;});}})[_0xcfb7('0x10')](respondWithFilteredResult(_0x1e3c65,_0x5b6502))[_0xcfb7('0x18')](handleError(_0x1e3c65,null));};exports['addAgents']=function(_0x40a5ee,_0x350a0a){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x40a5ee[_0xcfb7('0x41')]['id']}})['then'](handleEntityNotFound(_0x350a0a,null))['then'](function(_0x14b985){if(_0x14b985){return _0x14b985[_0xcfb7('0x11a')](_0x40a5ee[_0xcfb7('0x48')]['ids'],_['omit'](_0x40a5ee[_0xcfb7('0x48')],['ids','id'])||{})[_0xcfb7('0xa6')](function(_0x430bc9){for(var _0x30372a=0x0;_0x30372a<_0x40a5ee['body'][_0xcfb7('0x57')]['length'];_0x30372a+=0x1){socket[_0xcfb7('0x11b')](_0xcfb7('0x11c'),{'UserId':Number(_0x40a5ee['body'][_0xcfb7('0x57')][_0x30372a]),'ChatWebsiteId':Number(_0x40a5ee[_0xcfb7('0x41')]['id'])});}return _0x430bc9;});}})[_0xcfb7('0x10')](respondWithResult(_0x350a0a,null))[_0xcfb7('0x18')](handleError(_0x350a0a,null));};exports[_0xcfb7('0x11d')]=function(_0x5c581b,_0x54aefc){return db[_0xcfb7('0x29')][_0xcfb7('0x46')]({'where':{'id':_0x5c581b['params']['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x54aefc,null))[_0xcfb7('0x10')](function(_0x507d17){if(_0x507d17){return _0x507d17[_0xcfb7('0x11d')](_0x5c581b[_0xcfb7('0x31')]['ids'])[_0xcfb7('0x10')](function(){if(_[_0xcfb7('0x11e')](_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')])){for(var _0x332a6b=0x0;_0x332a6b<_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')]['length'];_0x332a6b+=0x1){socket[_0xcfb7('0x11b')](_0xcfb7('0x11f'),{'UserId':Number(_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')][_0x332a6b]),'ChatWebsiteId':Number(_0x5c581b['params']['id'])});}}else{socket['emit'](_0xcfb7('0x11f'),{'UserId':Number(_0x5c581b[_0xcfb7('0x31')][_0xcfb7('0x57')]),'ChatWebsiteId':Number(_0x5c581b['params']['id'])});}});}})[_0xcfb7('0x10')](respondWithStatusCode(_0x54aefc,null))[_0xcfb7('0x18')](handleError(_0x54aefc,null));};exports[_0xcfb7('0x120')]=function(_0x344102,_0x4ba4de){var _0x307ce1={};var _0x777f92={};var _0x4a189d;var _0x262275;return db[_0xcfb7('0x29')][_0xcfb7('0x117')]({'where':{'id':_0x344102[_0xcfb7('0x41')]['id']}})[_0xcfb7('0x10')](handleEntityNotFound(_0x4ba4de,null))[_0xcfb7('0x10')](function(_0xa5f55e){if(_0xa5f55e){_0x4a189d=_0xa5f55e;_0x777f92[_0xcfb7('0x2d')]=_['keys'](db[_0xcfb7('0xb1')]['rawAttributes']);_0x777f92[_0xcfb7('0x31')]=_['keys'](_0x344102[_0xcfb7('0x31')]);_0x777f92[_0xcfb7('0x2f')]=_[_0xcfb7('0x30')](_0x777f92['model'],_0x777f92[_0xcfb7('0x31')]);_0x307ce1['attributes']=_[_0xcfb7('0x30')](_0x777f92[_0xcfb7('0x2d')],qs[_0xcfb7('0x32')](_0x344102['query'][_0xcfb7('0x32')]));_0x307ce1[_0xcfb7('0x33')]=_0x307ce1['attributes']['length']?_0x307ce1[_0xcfb7('0x33')]:_0x777f92[_0xcfb7('0x2d')];_0x307ce1[_0xcfb7('0x37')]=qs[_0xcfb7('0x53')](_0x344102[_0xcfb7('0x31')]['sort']);_0x307ce1[_0xcfb7('0x38')]=qs[_0xcfb7('0x2f')](_[_0xcfb7('0x39')](_0x344102[_0xcfb7('0x31')],_0x777f92[_0xcfb7('0x2f')]));if(_0x344102[_0xcfb7('0x31')][_0xcfb7('0x3a')]){_0x307ce1[_0xcfb7('0x38')]=_['merge'](_0x307ce1['where'],{'$or':_[_0xcfb7('0x2e')](_0x307ce1['attributes'],function(_0x1c23a4){var _0x2d079d={};_0x2d079d[_0x1c23a4]={'$like':'%'+_0x344102[_0xcfb7('0x31')]['filter']+'%'};return _0x2d079d;})});}_0x307ce1=_[_0xcfb7('0x3b')]({},_0x307ce1,_0x344102[_0xcfb7('0x3d')]);return _0x4a189d[_0xcfb7('0x120')](_0x307ce1);}})[_0xcfb7('0x10')](function(_0x512fe8){if(_0x512fe8){_0x262275=_0x512fe8[_0xcfb7('0x34')];if(!_0x344102['query'][_0xcfb7('0x35')](_0xcfb7('0x36'))){_0x307ce1['limit']=qs[_0xcfb7('0x1e')](_0x344102[_0xcfb7('0x31')][_0xcfb7('0x1e')]);_0x307ce1[_0xcfb7('0x1d')]=qs[_0xcfb7('0x1d')](_0x344102[_0xcfb7('0x31')][_0xcfb7('0x1d')]);}return _0x4a189d['getAgents'](_0x307ce1);}})[_0xcfb7('0x10')](function(_0x11ff71){if(_0x11ff71){return _0x11ff71?{'count':_0x262275,'rows':_0x11ff71}:null;}})[_0xcfb7('0x10')](respondWithResult(_0x4ba4de,null))[_0xcfb7('0x18')](handleError(_0x4ba4de,null));};
\ No newline at end of file
index 50c3574..228c1fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x2becba,_0x4ea656){var _0x90b5dd=function(_0x26ae2b){while(--_0x26ae2b){_0x2becba['push'](_0x2becba['shift']());}};_0x90b5dd(++_0x4ea656);}(_0x2d17,0x17e));var _0x72d1=function(_0x543adb,_0x4b4b87){_0x543adb=_0x543adb-0x0;var _0x41c893=_0x2d17[_0x543adb];return _0x41c893;};'use strict';var EventEmitter=require(_0x72d1('0x0'));var ChatWebsite=require(_0x72d1('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x72d1('0x2')](0x0);var events={'afterCreate':_0x72d1('0x3'),'afterUpdate':'update','afterDestroy':_0x72d1('0x4')};function emitEvent(_0x38fec7){return function(_0x55b722,_0x1dd6d8,_0x4dfee1){ChatWebsiteEvents[_0x72d1('0x5')](_0x38fec7+':'+_0x55b722['id'],_0x55b722);ChatWebsiteEvents['emit'](_0x38fec7,_0x55b722);_0x4dfee1(null);};}for(var e in events){if(events[_0x72d1('0x6')](e)){var event=events[e];ChatWebsite[_0x72d1('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0x2830=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2830,0x117));var _0x0283=function(_0x4b196e,_0x1f067f){_0x4b196e=_0x4b196e-0x0;var _0x48049c=_0x2830[_0x4b196e];return _0x48049c;};'use strict';var EventEmitter=require(_0x0283('0x0'));var ChatWebsite=require(_0x0283('0x1'))['db'][_0x0283('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x0283('0x3')](0x0);var events={'afterCreate':_0x0283('0x4'),'afterUpdate':_0x0283('0x5'),'afterDestroy':_0x0283('0x6')};function emitEvent(_0x56984a){return function(_0x414c89,_0x4aa050,_0x1a8998){ChatWebsiteEvents[_0x0283('0x7')](_0x56984a+':'+_0x414c89['id'],_0x414c89);ChatWebsiteEvents[_0x0283('0x7')](_0x56984a,_0x414c89);_0x1a8998(null);};}for(var e in events){if(events[_0x0283('0x8')](e)){var event=events[e];ChatWebsite[_0x0283('0x9')](e,emitEvent(event));}}module[_0x0283('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
index b0abe4f..fdc3210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78a4=['ChatWebsite','chat_websites','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x591a3f,_0x307863){var _0x5b5d3f=function(_0x16cadf){while(--_0x16cadf){_0x591a3f['push'](_0x591a3f['shift']());}};_0x5b5d3f(++_0x307863);}(_0x78a4,0x9e));var _0x478a=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x78a4[_0x28947d];return _0x12d2ee;};'use strict';var _=require('lodash');var util=require(_0x478a('0x0'));var logger=require(_0x478a('0x1'))('api');var moment=require(_0x478a('0x2'));var BPromise=require(_0x478a('0x3'));var rp=require(_0x478a('0x4'));var fs=require('fs');var path=require(_0x478a('0x5'));var rimraf=require(_0x478a('0x6'));var config=require(_0x478a('0x7'));var attributes=require(_0x478a('0x8'));module[_0x478a('0x9')]=function(_0x1eb14c,_0x27724c){return _0x1eb14c[_0x478a('0xa')](_0x478a('0xb'),attributes,{'tableName':_0x478a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc52f=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite'];(function(_0x1805ce,_0x565a64){var _0x344d75=function(_0x1ec743){while(--_0x1ec743){_0x1805ce['push'](_0x1805ce['shift']());}};_0x344d75(++_0x565a64);}(_0xc52f,0xfa));var _0xfc52=function(_0x4daf4b,_0x485ac7){_0x4daf4b=_0x4daf4b-0x0;var _0x5a6635=_0xc52f[_0x4daf4b];return _0x5a6635;};'use strict';var _=require(_0xfc52('0x0'));var util=require('util');var logger=require(_0xfc52('0x1'))('api');var moment=require('moment');var BPromise=require(_0xfc52('0x2'));var rp=require(_0xfc52('0x3'));var fs=require('fs');var path=require(_0xfc52('0x4'));var rimraf=require(_0xfc52('0x5'));var config=require(_0xfc52('0x6'));var attributes=require(_0xfc52('0x7'));module[_0xfc52('0x8')]=function(_0x247723,_0xa3d10b){return _0x247723['define'](_0xfc52('0x9'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c59f939..e57bf24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb793=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x44f88c,_0x2d8439){var _0x43998a=function(_0x4b4389){while(--_0x4b4389){_0x44f88c['push'](_0x44f88c['shift']());}};_0x43998a(++_0x2d8439);}(_0xb793,0x1b8));var _0x3b79=function(_0x4dc263,_0x149f28){_0x4dc263=_0x4dc263-0x0;var _0x3e653b=_0xb793[_0x4dc263];return _0x3e653b;};'use strict';var _=require('lodash');var util=require(_0x3b79('0x0'));var moment=require(_0x3b79('0x1'));var BPromise=require(_0x3b79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b79('0x3'));var db=require(_0x3b79('0x4'))['db'];var utils=require(_0x3b79('0x5'));var logger=require(_0x3b79('0x6'))('rpc');var config=require(_0x3b79('0x7'));var jayson=require(_0x3b79('0x8'));var client=jayson[_0x3b79('0x9')][_0x3b79('0xa')]({'port':0x232a});config[_0x3b79('0xb')]=_[_0x3b79('0xc')](config[_0x3b79('0xb')],{'host':_0x3b79('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x247d9b,_0x3c82e4,_0x12ab58){return new BPromise(function(_0x25e3d3,_0x58c158){return client[_0x3b79('0xe')](_0x247d9b,_0x12ab58)[_0x3b79('0xf')](function(_0xa9598a){logger['info'](_0x3b79('0x10'),_0x3c82e4,_0x3b79('0x11'));logger['debug'](_0x3b79('0x12'),_0x3c82e4,_0x3b79('0x11'),JSON[_0x3b79('0x13')](_0xa9598a));if(_0xa9598a[_0x3b79('0x14')]){if(_0xa9598a[_0x3b79('0x14')][_0x3b79('0x15')]===0x1f4){logger[_0x3b79('0x14')](_0x3b79('0x10'),_0x3c82e4,_0xa9598a['error'][_0x3b79('0x16')]);return _0x58c158(_0xa9598a[_0x3b79('0x14')][_0x3b79('0x16')]);}logger[_0x3b79('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3c82e4,_0xa9598a['error'][_0x3b79('0x16')]);return _0x25e3d3(_0xa9598a['error'][_0x3b79('0x16')]);}else{logger[_0x3b79('0x17')](_0x3b79('0x10'),_0x3c82e4,_0x3b79('0x11'));_0x25e3d3(_0xa9598a[_0x3b79('0x18')][_0x3b79('0x16')]);}})[_0x3b79('0x19')](function(_0x5ebedd){logger[_0x3b79('0x14')](_0x3b79('0x10'),_0x3c82e4,_0x5ebedd);_0x58c158(_0x5ebedd);});});}
\ No newline at end of file
+var _0x2365=['localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x3ce4c1,_0x29fd23){var _0x527c34=function(_0x1759ae){while(--_0x1759ae){_0x3ce4c1['push'](_0x3ce4c1['shift']());}};_0x527c34(++_0x29fd23);}(_0x2365,0x10b));var _0x5236=function(_0x3b09fb,_0x22e654){_0x3b09fb=_0x3b09fb-0x0;var _0x1a0238=_0x2365[_0x3b09fb];return _0x1a0238;};'use strict';var _=require('lodash');var util=require(_0x5236('0x0'));var moment=require(_0x5236('0x1'));var BPromise=require(_0x5236('0x2'));var rs=require(_0x5236('0x3'));var fs=require('fs');var Redis=require(_0x5236('0x4'));var db=require(_0x5236('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5236('0x6'));var config=require(_0x5236('0x7'));var jayson=require(_0x5236('0x8'));var client=jayson[_0x5236('0x9')][_0x5236('0xa')]({'port':0x232a});config[_0x5236('0xb')]=_[_0x5236('0xc')](config['redis'],{'host':_0x5236('0xd'),'port':0x18eb});var socket=require(_0x5236('0xe'))(new Redis(config[_0x5236('0xb')]));require(_0x5236('0xf'))[_0x5236('0x10')](socket);function respondWithRpcPromise(_0x39978b,_0x39123c,_0x4c4bb5){return new BPromise(function(_0x34c46d,_0xf1badc){return client['request'](_0x39978b,_0x4c4bb5)[_0x5236('0x11')](function(_0x140793){logger[_0x5236('0x12')](_0x5236('0x13'),_0x39123c,_0x5236('0x14'));logger['debug'](_0x5236('0x15'),_0x39123c,_0x5236('0x14'),JSON[_0x5236('0x16')](_0x140793));if(_0x140793[_0x5236('0x17')]){if(_0x140793[_0x5236('0x17')][_0x5236('0x18')]===0x1f4){logger[_0x5236('0x17')](_0x5236('0x13'),_0x39123c,_0x140793['error'][_0x5236('0x19')]);return _0xf1badc(_0x140793[_0x5236('0x17')][_0x5236('0x19')]);}logger[_0x5236('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x39123c,_0x140793[_0x5236('0x17')]['message']);return _0x34c46d(_0x140793['error']['message']);}else{logger[_0x5236('0x12')](_0x5236('0x13'),_0x39123c,'request\x20sent');_0x34c46d(_0x140793[_0x5236('0x1a')][_0x5236('0x19')]);}})[_0x5236('0x1b')](function(_0x345377){logger['error'](_0x5236('0x13'),_0x39123c,_0x345377);_0xf1badc(_0x345377);});});}
\ No newline at end of file
index 0ca201b..9f20753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee5=['./chatWebsite.events','save','remove','update','removeListener','register','length','chatWebsite:'];(function(_0x305b12,_0x5ecd09){var _0x4141de=function(_0x3e7044){while(--_0x3e7044){_0x305b12['push'](_0x305b12['shift']());}};_0x4141de(++_0x5ecd09);}(_0xaee5,0x158));var _0x5aee=function(_0x20a33a,_0x3b908b){_0x20a33a=_0x20a33a-0x0;var _0x10a66d=_0xaee5[_0x20a33a];return _0x10a66d;};'use strict';var ChatWebsiteEvents=require(_0x5aee('0x0'));var events=[_0x5aee('0x1'),_0x5aee('0x2'),_0x5aee('0x3')];function createListener(_0x18359e,_0x24ac42){return function(_0x58a893){_0x24ac42['emit'](_0x18359e,_0x58a893);};}function removeListener(_0x12a4e6,_0x27a412){return function(){ChatWebsiteEvents[_0x5aee('0x4')](_0x12a4e6,_0x27a412);};}exports[_0x5aee('0x5')]=function(_0x3e3284){for(var _0x127e5c=0x0,_0x53c8ae=events[_0x5aee('0x6')];_0x127e5c<_0x53c8ae;_0x127e5c++){var _0x33ef72=events[_0x127e5c];var _0x32b224=createListener(_0x5aee('0x7')+_0x33ef72,_0x3e3284);ChatWebsiteEvents['on'](_0x33ef72,_0x32b224);}};
\ No newline at end of file
+var _0x6eef=['update','emit','removeListener','register','length','./chatWebsite.events','save'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x6eef,0x67));var _0xf6ee=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x6eef[_0x131585];return _0x1fcca2;};'use strict';var ChatWebsiteEvents=require(_0xf6ee('0x0'));var events=[_0xf6ee('0x1'),'remove',_0xf6ee('0x2')];function createListener(_0x1eaf58,_0x412715){return function(_0x58f1a2){_0x412715[_0xf6ee('0x3')](_0x1eaf58,_0x58f1a2);};}function removeListener(_0x159d7c,_0x23250f){return function(){ChatWebsiteEvents[_0xf6ee('0x4')](_0x159d7c,_0x23250f);};}exports[_0xf6ee('0x5')]=function(_0x45173d){for(var _0x2cf402=0x0,_0xadb21c=events[_0xf6ee('0x6')];_0x2cf402<_0xadb21c;_0x2cf402++){var _0x51db7b=events[_0x2cf402];var _0x10b442=createListener('chatWebsite:'+_0x51db7b,_0x45173d);ChatWebsiteEvents['on'](_0x51db7b,_0x10b442);}};
\ No newline at end of file
index 6dc797a..a10e704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4161=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addAnswer','join','root','server/files/images/logos/','format','now','originalname','/:id/logo','single','file','diskStorage','server/files/images/avatars/','addAvatar','%s-%s','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer'];(function(_0x477554,_0x5b6518){var _0x5b760e=function(_0x26a59f){while(--_0x26a59f){_0x477554['push'](_0x477554['shift']());}};_0x5b760e(++_0x5b6518);}(_0x4161,0x1c1));var _0x1416=function(_0x3e8bd2,_0x261ed5){_0x3e8bd2=_0x3e8bd2-0x0;var _0x33bdfe=_0x4161[_0x3e8bd2];return _0x33bdfe;};'use strict';var multer=require(_0x1416('0x0'));var util=require(_0x1416('0x1'));var path=require('path');var timeout=require(_0x1416('0x2'));var express=require(_0x1416('0x3'));var router=express[_0x1416('0x4')]();var fs_extra=require(_0x1416('0x5'));var auth=require(_0x1416('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1416('0x7'));router[_0x1416('0x8')]('/',auth[_0x1416('0x9')](),controller[_0x1416('0xa')]);router[_0x1416('0x8')](_0x1416('0xb'),auth['isAuthenticated'](),controller[_0x1416('0xc')]);router[_0x1416('0x8')]('/:id',auth[_0x1416('0x9')](),controller[_0x1416('0xd')]);router['get'](_0x1416('0xe'),auth['isAuthenticated'](),controller[_0x1416('0xf')]);router['get']('/:id/canned_answers',auth[_0x1416('0x9')](),controller[_0x1416('0x10')]);router[_0x1416('0x8')]('/:id/logo',controller[_0x1416('0x11')]);router['get'](_0x1416('0x12'),controller[_0x1416('0x13')]);router['get'](_0x1416('0x14'),controller[_0x1416('0x15')]);router[_0x1416('0x8')]('/:id/system_avatar',controller[_0x1416('0x16')]);router[_0x1416('0x8')](_0x1416('0x17'),auth['isAuthenticated'](),controller[_0x1416('0x18')]);router[_0x1416('0x8')]('/:id/snippet',controller[_0x1416('0x19')]);router[_0x1416('0x8')](_0x1416('0x1a'),auth[_0x1416('0x9')](),controller[_0x1416('0x1b')]);router[_0x1416('0x8')](_0x1416('0x1c'),auth['isAuthenticated'](),controller[_0x1416('0x1d')]);router['get'](_0x1416('0x1e'),controller[_0x1416('0x1f')]);router[_0x1416('0x8')](_0x1416('0x20'),auth[_0x1416('0x9')](),controller[_0x1416('0x21')]);router[_0x1416('0x8')](_0x1416('0x22'),auth[_0x1416('0x9')](),controller['getAgents']);router[_0x1416('0x23')]('/',auth[_0x1416('0x9')](),controller[_0x1416('0x24')]);router['post'](_0x1416('0xe'),auth[_0x1416('0x9')](),controller['addDisposition']);router['post']('/:id/canned_answers',auth[_0x1416('0x9')](),controller[_0x1416('0x25')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x975a31,_0x54790c,_0x14ec3b){_0x14ec3b(null,path[_0x1416('0x26')](config[_0x1416('0x27')],_0x1416('0x28')));},'filename':function(_0x2e7a36,_0x3220ae,_0x54f489){_0x54f489(null,util[_0x1416('0x29')]('%s-%s',Date[_0x1416('0x2a')](),_0x3220ae[_0x1416('0x2b')]));}})});router['post'](_0x1416('0x2c'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller['addLogo']);var upload=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x426ad6,_0x172367,_0x2f739f){_0x2f739f(null,path[_0x1416('0x26')](config['root'],_0x1416('0x30')));},'filename':function(_0x1a4c1d,_0x2881c0,_0x7530cc){_0x7530cc(null,util[_0x1416('0x29')]('%s-%s',Date[_0x1416('0x2a')](),_0x2881c0[_0x1416('0x2b')]));}})});router[_0x1416('0x23')](_0x1416('0x12'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller[_0x1416('0x31')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc5b9ca,_0x3fad03,_0x502845){_0x502845(null,path[_0x1416('0x26')](config['root'],_0x1416('0x30')));},'filename':function(_0x41aa6d,_0x1bb2c5,_0x144942){_0x144942(null,util[_0x1416('0x29')](_0x1416('0x32'),Date[_0x1416('0x2a')](),_0x1bb2c5[_0x1416('0x2b')]));}})});router[_0x1416('0x23')](_0x1416('0x14'),upload[_0x1416('0x2d')](_0x1416('0x2e')),controller[_0x1416('0x33')]);var upload=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x2af446,_0x5b6a0c,_0x3aaf73){_0x3aaf73(null,path['join'](config[_0x1416('0x27')],_0x1416('0x30')));},'filename':function(_0x156b47,_0x59b7fe,_0x2e51f2){_0x2e51f2(null,util[_0x1416('0x29')](_0x1416('0x32'),Date[_0x1416('0x2a')](),_0x59b7fe['originalname']));}})});router[_0x1416('0x23')]('/:id/system_avatar',upload[_0x1416('0x2d')]('file'),controller[_0x1416('0x34')]);router['post'](_0x1416('0x35'),controller[_0x1416('0x36')]);const offlineUploadMulter=multer({'storage':multer[_0x1416('0x2f')]({'destination':function(_0x30f6d6,_0x1879c2,_0x1d065c){const _0x1da811=path['join'](config[_0x1416('0x27')],_0x1416('0x37'),_0x1416('0x38'),_0x1416('0x39'));fs_extra['ensureDir'](_0x1da811,function(){_0x1d065c(null,_0x1da811);});},'filename':function(_0x508a27,_0x49339c,_0x626d42){const _0x513e98=_0x49339c[_0x1416('0x2b')][_0x1416('0x3a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2140dd=path[_0x1416('0x3b')](_0x513e98);const _0x59a0b0=Date[_0x1416('0x2a')]()+'-'+_0x513e98[_0x1416('0x3a')](_0x2140dd,'')+_0x2140dd;_0x626d42(null,_0x59a0b0);}})});router[_0x1416('0x23')](_0x1416('0x3c'),offlineUploadMulter[_0x1416('0x3d')](),controller[_0x1416('0x3e')]);router[_0x1416('0x23')](_0x1416('0x17'),auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0x1416('0x1a'),auth['isAuthenticated'](),controller[_0x1416('0x3f')]);router['post']('/:id/proactive_actions',auth[_0x1416('0x9')](),controller[_0x1416('0x40')]);router[_0x1416('0x23')](_0x1416('0x22'),auth['isAuthenticated'](),controller['addAgents']);router[_0x1416('0x41')](_0x1416('0x42'),auth[_0x1416('0x9')](),controller[_0x1416('0x43')]);router[_0x1416('0x44')](_0x1416('0x42'),auth[_0x1416('0x9')](),controller[_0x1416('0x45')]);router['delete']('/:id/dispositions',auth[_0x1416('0x9')](),controller[_0x1416('0x46')]);router[_0x1416('0x44')](_0x1416('0x47'),auth['isAuthenticated'](),controller[_0x1416('0x48')]);router[_0x1416('0x44')](_0x1416('0x22'),auth[_0x1416('0x9')](),controller[_0x1416('0x49')]);module[_0x1416('0x4a')]=router;
\ No newline at end of file
+var _0xd133=['/:id/users','post','create','/:id/dispositions','/:id/canned_answers','addAnswer','diskStorage','root','server/files/images/logos/','%s-%s','now','originalname','single','file','addLogo','join','server/files/images/avatars/','format','addAvatar','addCustomerAvatar','/:id/notify','notify','offline-chat','ensureDir','replace','extname','any','offline','addInteraction','addApplications','/:id/proactive_actions','addProactiveActions','put','update','delete','destroy','removeAnswers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','/:id/fields','getFields','/:id/offline_messages'];(function(_0x4b7944,_0x426228){var _0x27984e=function(_0x235a16){while(--_0x235a16){_0x4b7944['push'](_0x4b7944['shift']());}};_0x27984e(++_0x426228);}(_0xd133,0x6c));var _0x3d13=function(_0x3ad46a,_0x420179){_0x3ad46a=_0x3ad46a-0x0;var _0x1f6cfc=_0xd133[_0x3ad46a];return _0x1f6cfc;};'use strict';var multer=require(_0x3d13('0x0'));var util=require('util');var path=require(_0x3d13('0x1'));var timeout=require(_0x3d13('0x2'));var express=require(_0x3d13('0x3'));var router=express[_0x3d13('0x4')]();var fs_extra=require(_0x3d13('0x5'));var auth=require(_0x3d13('0x6'));var interaction=require(_0x3d13('0x7'));var config=require(_0x3d13('0x8'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0x3d13('0x9')](),controller[_0x3d13('0xa')]);router['get'](_0x3d13('0xb'),auth['isAuthenticated'](),controller[_0x3d13('0xc')]);router[_0x3d13('0xd')](_0x3d13('0xe'),auth[_0x3d13('0x9')](),controller[_0x3d13('0xf')]);router[_0x3d13('0xd')]('/:id/dispositions',auth[_0x3d13('0x9')](),controller[_0x3d13('0x10')]);router[_0x3d13('0xd')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3d13('0x11')]);router[_0x3d13('0xd')](_0x3d13('0x12'),controller['getLogo']);router['get'](_0x3d13('0x13'),controller[_0x3d13('0x14')]);router[_0x3d13('0xd')](_0x3d13('0x15'),controller[_0x3d13('0x16')]);router[_0x3d13('0xd')](_0x3d13('0x17'),controller[_0x3d13('0x18')]);router[_0x3d13('0xd')](_0x3d13('0x19'),auth[_0x3d13('0x9')](),controller['getInteractions']);router[_0x3d13('0xd')](_0x3d13('0x1a'),controller[_0x3d13('0x1b')]);router['get'](_0x3d13('0x1c'),auth[_0x3d13('0x9')](),controller['getApplications']);router['get']('/:id/proactive_actions',auth[_0x3d13('0x9')](),controller['getProactiveActions']);router[_0x3d13('0xd')](_0x3d13('0x1d'),controller[_0x3d13('0x1e')]);router['get'](_0x3d13('0x1f'),auth[_0x3d13('0x9')](),controller['getOfflineMessages']);router[_0x3d13('0xd')](_0x3d13('0x20'),auth[_0x3d13('0x9')](),controller['getAgents']);router[_0x3d13('0x21')]('/',auth[_0x3d13('0x9')](),controller[_0x3d13('0x22')]);router[_0x3d13('0x21')](_0x3d13('0x23'),auth[_0x3d13('0x9')](),controller['addDisposition']);router[_0x3d13('0x21')](_0x3d13('0x24'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x25')]);var upload=multer({'storage':multer[_0x3d13('0x26')]({'destination':function(_0x3deecf,_0x5bb586,_0x495126){_0x495126(null,path['join'](config[_0x3d13('0x27')],_0x3d13('0x28')));},'filename':function(_0x18e9ee,_0x4008ff,_0x350594){_0x350594(null,util['format'](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x4008ff[_0x3d13('0x2b')]));}})});router['post'](_0x3d13('0x12'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller[_0x3d13('0x2e')]);var upload=multer({'storage':multer[_0x3d13('0x26')]({'destination':function(_0x3bb52b,_0x1b8875,_0xb49b5){_0xb49b5(null,path[_0x3d13('0x2f')](config[_0x3d13('0x27')],_0x3d13('0x30')));},'filename':function(_0x5f3dd2,_0x4fb6bf,_0x569730){_0x569730(null,util[_0x3d13('0x31')](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x4fb6bf[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x13'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller[_0x3d13('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x327f3a,_0x209d6d,_0x4fdf3d){_0x4fdf3d(null,path['join'](config[_0x3d13('0x27')],_0x3d13('0x30')));},'filename':function(_0x3e0a26,_0x336d40,_0x138f1e){_0x138f1e(null,util['format'](_0x3d13('0x29'),Date['now'](),_0x336d40[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x15'),upload['single'](_0x3d13('0x2d')),controller[_0x3d13('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x46b58d,_0x43a0fe,_0x3d7f80){_0x3d7f80(null,path[_0x3d13('0x2f')](config['root'],_0x3d13('0x30')));},'filename':function(_0x521b1f,_0x30ccbd,_0x136da9){_0x136da9(null,util[_0x3d13('0x31')](_0x3d13('0x29'),Date[_0x3d13('0x2a')](),_0x30ccbd[_0x3d13('0x2b')]));}})});router[_0x3d13('0x21')](_0x3d13('0x17'),upload[_0x3d13('0x2c')](_0x3d13('0x2d')),controller['addSystemAvatar']);router['post'](_0x3d13('0x34'),controller[_0x3d13('0x35')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x427093,_0x12bc02,_0x1361d6){const _0x228115=path[_0x3d13('0x2f')](config[_0x3d13('0x27')],'server/files','attachments',_0x3d13('0x36'));fs_extra[_0x3d13('0x37')](_0x228115,function(){_0x1361d6(null,_0x228115);});},'filename':function(_0x262643,_0x5d0466,_0x10fd14){const _0x31407e=_0x5d0466[_0x3d13('0x2b')][_0x3d13('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51a3ef=path[_0x3d13('0x39')](_0x31407e);const _0x2d48ef=Date[_0x3d13('0x2a')]()+'-'+_0x31407e[_0x3d13('0x38')](_0x51a3ef,'')+_0x51a3ef;_0x10fd14(null,_0x2d48ef);}})});router['post']('/:id/offline',offlineUploadMulter[_0x3d13('0x3a')](),controller[_0x3d13('0x3b')]);router[_0x3d13('0x21')](_0x3d13('0x19'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3c')]);router[_0x3d13('0x21')](_0x3d13('0x1c'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3d')]);router['post'](_0x3d13('0x3e'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x3f')]);router[_0x3d13('0x21')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x3d13('0x40')]('/:id',auth[_0x3d13('0x9')](),controller[_0x3d13('0x41')]);router[_0x3d13('0x42')](_0x3d13('0xe'),auth[_0x3d13('0x9')](),controller[_0x3d13('0x43')]);router[_0x3d13('0x42')](_0x3d13('0x23'),auth[_0x3d13('0x9')](),controller['removeDispositions']);router[_0x3d13('0x42')](_0x3d13('0x24'),auth['isAuthenticated'](),controller[_0x3d13('0x44')]);router[_0x3d13('0x42')]('/:id/users',auth[_0x3d13('0x9')](),controller['removeAgents']);module[_0x3d13('0x45')]=router;
\ No newline at end of file
index c2ddb03..2b3a5e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59c1=['client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','isAuthenticated','exports','express','../components/auth/service','../config/environment','production','app','get'];(function(_0x1d43bf,_0x2e68ae){var _0x44f97f=function(_0x2bbbc3){while(--_0x2bbbc3){_0x1d43bf['push'](_0x1d43bf['shift']());}};_0x44f97f(++_0x2e68ae);}(_0x59c1,0x1aa));var _0x159c=function(_0x2d5c91,_0x3d81c9){_0x2d5c91=_0x2d5c91-0x0;var _0x504f63=_0x59c1[_0x2d5c91];return _0x504f63;};var beaverLogger=require('beaver-logger/server');var express=require(_0x159c('0x0'));var auth=require(_0x159c('0x1'));var config=require(_0x159c('0x2'));var router=express['Router']();var isProduction=config['env']===_0x159c('0x3')||![];function clientSideLogs(_0x1ad7c2,_0x2d4fea,_0x3bd2fe){var _0x46d2c6=_0x1ad7c2[_0x159c('0x4')][_0x159c('0x5')](_0x159c('0x6'));if(!_0x46d2c6){throw new Error(_0x159c('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x159c('0x8'),'logger':_0x46d2c6,'enableCors':!isProduction})(_0x1ad7c2,_0x2d4fea,_0x3bd2fe);}router[_0x159c('0x9')](auth[_0x159c('0xa')](),clientSideLogs);module[_0x159c('0xb')]=router;
\ No newline at end of file
+var _0x992e=['app','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','exports','express','../components/auth/service','../config/environment','Router','env','production'];(function(_0x14f6e9,_0x2224ce){var _0x155705=function(_0x14f4fb){while(--_0x14f4fb){_0x14f6e9['push'](_0x14f6e9['shift']());}};_0x155705(++_0x2224ce);}(_0x992e,0xca));var _0xe992=function(_0x3cb6dc,_0x120dd3){_0x3cb6dc=_0x3cb6dc-0x0;var _0x47ec89=_0x992e[_0x3cb6dc];return _0x47ec89;};var beaverLogger=require('beaver-logger/server');var express=require(_0xe992('0x0'));var auth=require(_0xe992('0x1'));var config=require(_0xe992('0x2'));var router=express[_0xe992('0x3')]();var isProduction=config[_0xe992('0x4')]===_0xe992('0x5')||![];function clientSideLogs(_0x322f0c,_0x1d0370,_0xb85ffc){var _0x148777=_0x322f0c[_0xe992('0x6')][_0xe992('0x7')](_0xe992('0x8'));if(!_0x148777){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xe992('0x9')]({'uri':_0xe992('0xa'),'logger':_0x148777,'enableCors':!isProduction})(_0x322f0c,_0x1d0370,_0xb85ffc);}router['use'](auth[_0xe992('0xb')](),clientSideLogs);module[_0xe992('0xc')]=router;
\ No newline at end of file
index cd2ea26..fbe1a41 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe997=['MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token'];(function(_0x4e1cd5,_0x464a24){var _0x13d3c1=function(_0x1fc795){while(--_0x1fc795){_0x4e1cd5['push'](_0x4e1cd5['shift']());}};_0x13d3c1(++_0x464a24);}(_0xe997,0xde));var _0x7e99=function(_0x44c450,_0x294ca7){_0x44c450=_0x44c450-0x0;var _0xd0827d=_0xe997[_0x44c450];return _0xd0827d;};'use strict';var Sequelize=require(_0x7e99('0x0'));module[_0x7e99('0x1')]={'name':{'type':Sequelize[_0x7e99('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7e99('0x3')](_0x7e99('0x4'),_0x7e99('0x5'),_0x7e99('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7e99('0x3')](_0x7e99('0x7'),_0x7e99('0x8'))},'data1':{'type':Sequelize[_0x7e99('0x2')],'comment':_0x7e99('0x9')},'data2':{'type':Sequelize['STRING'],'comment':_0x7e99('0xa')},'data3':{'type':Sequelize['STRING'],'comment':_0x7e99('0xb')},'data4':{'type':Sequelize['STRING'],'comment':_0x7e99('0xc')},'data5':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0xe')},'data6':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0xf')},'data7':{'type':Sequelize[_0x7e99('0xd')],'comment':_0x7e99('0x10')}};
\ No newline at end of file
+var _0xc5e9=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','AmazonAWS','Google','Dynamics365'];(function(_0x3b14b3,_0x3de2af){var _0x42022d=function(_0x282707){while(--_0x282707){_0x3b14b3['push'](_0x3b14b3['shift']());}};_0x42022d(++_0x3de2af);}(_0xc5e9,0x6f));var _0x9c5e=function(_0x15536c,_0x519197){_0x15536c=_0x15536c-0x0;var _0xf3ad27=_0xc5e9[_0x15536c];return _0xf3ad27;};'use strict';var Sequelize=require('sequelize');module[_0x9c5e('0x0')]={'name':{'type':Sequelize[_0x9c5e('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9c5e('0x2')](_0x9c5e('0x3'),_0x9c5e('0x4'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x9c5e('0x2')]('Outlook365',_0x9c5e('0x5'))},'data1':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x6')},'data2':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x7')},'data3':{'type':Sequelize['STRING'],'comment':_0x9c5e('0x8')},'data4':{'type':Sequelize[_0x9c5e('0x1')],'comment':_0x9c5e('0x9')},'data5':{'type':Sequelize[_0x9c5e('0xa')],'comment':_0x9c5e('0xb')},'data6':{'type':Sequelize[_0x9c5e('0xa')],'comment':_0x9c5e('0xc')},'data7':{'type':Sequelize[_0x9c5e('0xa')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
index a0e7fe6..6f88ad9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c8=['include','MicrosoftAzure','create','Service\x20parameter\x20not\x20specified','values','includes','body','update','find','destroy','catch','findOne','generateMicrosoftAuthorizationUrl','user','get','Invalid\x20state\x20parameter','parse','from','state','toString','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','refresh_token','data5','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','Content-Range','then','end','error','stack','name','send','padEnd','slice','index','map','CloudProvider','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','rows','service','decryptString','data3','show','params','rawAttributes'];(function(_0x354835,_0x33ea3e){var _0xa506c1=function(_0x23cc28){while(--_0x23cc28){_0x354835['push'](_0x354835['shift']());}};_0xa506c1(++_0x33ea3e);}(_0xd3c8,0xd5));var _0x8d3c=function(_0x5d77de,_0x2ef420){_0x5d77de=_0x5d77de-0x0;var _0x1233d4=_0xd3c8[_0x5d77de];return _0x1233d4;};'use strict';var _=require('lodash');var Redis=require(_0x8d3c('0x0'));var qs=require(_0x8d3c('0x1'));var encryptor=require(_0x8d3c('0x2'));var config=require(_0x8d3c('0x3'));var logger=require(_0x8d3c('0x4'))(_0x8d3c('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x8d3c('0x6'));config[_0x8d3c('0x7')]=_['defaults'](config[_0x8d3c('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d3c('0x8'))(new Redis(config['redis']));var redis=new Redis(config[_0x8d3c('0x7')]);function respondWithStatusCode(_0x2924cd,_0xc96397){_0xc96397=_0xc96397||0xcc;return function(_0x2e963e){if(_0x2e963e){return _0x2924cd[_0x8d3c('0x9')](_0xc96397);}return _0x2924cd[_0x8d3c('0xa')](_0xc96397)['end']();};}function respondWithResult(_0x168594,_0x1845fe){_0x1845fe=_0x1845fe||0xc8;return function(_0x27c262){if(_0x27c262){return _0x168594[_0x8d3c('0xa')](_0x1845fe)[_0x8d3c('0xb')](_0x27c262);}};}function respondWithFilteredResult(_0x57c7b1,_0x147da2){return function(_0x2cba12){if(_0x2cba12){var _0x594310=typeof _0x147da2['offset']===_0x8d3c('0xc')&&typeof _0x147da2[_0x8d3c('0xd')]===_0x8d3c('0xc');var _0xada9dc=_0x2cba12[_0x8d3c('0xe')];var _0x45877c=_0x594310?0x0:_0x147da2['offset'];var _0x586304=_0x594310?_0x2cba12[_0x8d3c('0xe')]:_0x147da2[_0x8d3c('0xf')]+_0x147da2['limit'];var _0x5a142a;if(_0x586304>=_0xada9dc){_0x586304=_0xada9dc;_0x5a142a=0xc8;}else{_0x5a142a=0xce;}_0x57c7b1['status'](_0x5a142a);return _0x57c7b1['set'](_0x8d3c('0x10'),_0x45877c+'-'+_0x586304+'/'+_0xada9dc)['json'](_0x2cba12);}return null;};}function saveUpdates(_0x1dbacf){return function(_0xe0b1ba){if(_0xe0b1ba){return _0xe0b1ba['update'](_0x1dbacf)['then'](function(_0x16afc2){return _0x16afc2;});}return null;};}function removeEntity(_0xdb7542){return function(_0x57799a){if(_0x57799a){return _0x57799a['destroy']()[_0x8d3c('0x11')](function(){_0xdb7542['status'](0xcc)[_0x8d3c('0x12')]();});}};}function handleEntityNotFound(_0x15b8da){return function(_0x3cf0d5){if(!_0x3cf0d5){_0x15b8da[_0x8d3c('0x9')](0x194);}return _0x3cf0d5;};}function handleError(_0x39849b,_0x4e38ec){_0x4e38ec=_0x4e38ec||0x1f4;return function(_0x586e4a){logger[_0x8d3c('0x13')](_0x586e4a[_0x8d3c('0x14')]);if(_0x586e4a[_0x8d3c('0x15')]){delete _0x586e4a['name'];}_0x39849b[_0x8d3c('0xa')](_0x4e38ec)[_0x8d3c('0x16')](_0x586e4a);};}function maskClientSecret(_0x3a0e4e){return _[_0x8d3c('0x17')](_0x3a0e4e[_0x8d3c('0x18')](0x0,0x3),0x14,'*');}exports[_0x8d3c('0x19')]=function(_0x516001,_0x5022a0){var _0xdcf25f={},_0x3069d5={},_0x4c6020={'count':0x0,'rows':[]};var _0x58424d=_[_0x8d3c('0x1a')](db[_0x8d3c('0x1b')]['rawAttributes'],function(_0x1c5f8e){return{'name':_0x1c5f8e['fieldName'],'type':_0x1c5f8e[_0x8d3c('0x1c')]['key']};});_0x3069d5['model']=_[_0x8d3c('0x1a')](_0x58424d,'name');_0x3069d5[_0x8d3c('0x1d')]=_[_0x8d3c('0x1e')](_0x516001[_0x8d3c('0x1d')]);_0x3069d5[_0x8d3c('0x1f')]=_[_0x8d3c('0x20')](_0x3069d5[_0x8d3c('0x21')],_0x3069d5[_0x8d3c('0x1d')]);_0xdcf25f[_0x8d3c('0x22')]=_[_0x8d3c('0x20')](_0x3069d5['model'],qs[_0x8d3c('0x23')](_0x516001[_0x8d3c('0x1d')]['fields']));_0xdcf25f['attributes']=_0xdcf25f[_0x8d3c('0x22')][_0x8d3c('0x24')]?_0xdcf25f['attributes']:_0x3069d5[_0x8d3c('0x21')];if(!_0x516001[_0x8d3c('0x1d')]['hasOwnProperty'](_0x8d3c('0x25'))){_0xdcf25f[_0x8d3c('0xd')]=qs[_0x8d3c('0xd')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0xd')]);_0xdcf25f[_0x8d3c('0xf')]=qs[_0x8d3c('0xf')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0xf')]);}_0xdcf25f[_0x8d3c('0x26')]=qs[_0x8d3c('0x27')](_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x27')]);_0xdcf25f['where']=qs[_0x8d3c('0x1f')](_[_0x8d3c('0x28')](_0x516001[_0x8d3c('0x1d')],_0x3069d5[_0x8d3c('0x1f')]),_0x58424d);if(_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x29')]){_0xdcf25f['where']=_[_0x8d3c('0x2a')](_0xdcf25f['where'],{'$or':_[_0x8d3c('0x1a')](_0x58424d,function(_0x1bf3e6){if(_0x1bf3e6[_0x8d3c('0x1c')]!==_0x8d3c('0x2b')){var _0x59f79d={};_0x59f79d[_0x1bf3e6['name']]={'$like':'%'+_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x29')]+'%'};return _0x59f79d;}})});}_0xdcf25f=_[_0x8d3c('0x2a')]({},_0xdcf25f,_0x516001[_0x8d3c('0x2c')]);var _0x46667a={'where':_0xdcf25f[_0x8d3c('0x2d')]};return db[_0x8d3c('0x1b')][_0x8d3c('0xe')](_0x46667a)[_0x8d3c('0x11')](function(_0x128d3f){_0x4c6020[_0x8d3c('0xe')]=_0x128d3f;if(_0x516001[_0x8d3c('0x1d')][_0x8d3c('0x2e')]){_0xdcf25f['include']=[{'all':!![]}];}return db[_0x8d3c('0x1b')]['findAll'](_0xdcf25f);})[_0x8d3c('0x11')](function(_0x4ced7f){_0x4c6020[_0x8d3c('0x2f')]=_[_0x8d3c('0x1a')](_0x4ced7f,function(_0x559d2e){if(_0x559d2e[_0x8d3c('0x30')]==='MicrosoftAzure'){var _0x371b33=encryptor[_0x8d3c('0x31')](_0x559d2e[_0x8d3c('0x32')]);_0x559d2e[_0x8d3c('0x32')]=maskClientSecret(_0x371b33);}return _0x559d2e;});return _0x4c6020;})[_0x8d3c('0x11')](respondWithFilteredResult(_0x5022a0,_0xdcf25f))['catch'](handleError(_0x5022a0,null));};exports[_0x8d3c('0x33')]=function(_0x4917ac,_0x281ac6){var _0x5b4992={'raw':!![],'where':{'id':_0x4917ac[_0x8d3c('0x34')]['id']}},_0x229cf3={};_0x229cf3['model']=_['keys'](db[_0x8d3c('0x1b')][_0x8d3c('0x35')]);_0x229cf3['query']=_[_0x8d3c('0x1e')](_0x4917ac['query']);_0x229cf3['filters']=_[_0x8d3c('0x20')](_0x229cf3[_0x8d3c('0x21')],_0x229cf3['query']);_0x5b4992['attributes']=_[_0x8d3c('0x20')](_0x229cf3[_0x8d3c('0x21')],qs['fields'](_0x4917ac[_0x8d3c('0x1d')]['fields']));_0x5b4992[_0x8d3c('0x22')]=_0x5b4992['attributes'][_0x8d3c('0x24')]?_0x5b4992['attributes']:_0x229cf3[_0x8d3c('0x21')];if(_0x4917ac[_0x8d3c('0x1d')][_0x8d3c('0x2e')]){_0x5b4992[_0x8d3c('0x36')]=[{'all':!![]}];}_0x5b4992=_['merge']({},_0x5b4992,_0x4917ac[_0x8d3c('0x2c')]);return db[_0x8d3c('0x1b')]['find'](_0x5b4992)[_0x8d3c('0x11')](handleEntityNotFound(_0x281ac6,null))['then'](function(_0x4b944e){if(_0x4b944e[_0x8d3c('0x30')]===_0x8d3c('0x37')){var _0x50a058=encryptor[_0x8d3c('0x31')](_0x4b944e['data3']);_0x4b944e[_0x8d3c('0x32')]=maskClientSecret(_0x50a058);}return _0x4b944e;})['then'](respondWithResult(_0x281ac6,null))['catch'](handleError(_0x281ac6,null));};exports[_0x8d3c('0x38')]=function(_0x189f5b,_0x214506){if(!_0x189f5b['body'][_0x8d3c('0x15')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x189f5b['body'][_0x8d3c('0x30')])throw new Error(_0x8d3c('0x39'));var _0x2def40=db['CloudProvider'][_0x8d3c('0x35')][_0x8d3c('0x30')][_0x8d3c('0x3a')];if(!_0x2def40[_0x8d3c('0x3b')](_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x30')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x2def40['join'](',\x20'));if(_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x30')]==='MicrosoftAzure'&&_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x32')]){_0x189f5b[_0x8d3c('0x3c')]['data3']=encryptor['encryptString'](_0x189f5b[_0x8d3c('0x3c')][_0x8d3c('0x32')]);}return db[_0x8d3c('0x1b')][_0x8d3c('0x38')](_0x189f5b['body'],{})[_0x8d3c('0x11')](respondWithResult(_0x214506,0xc9))['catch'](handleError(_0x214506,null));};exports[_0x8d3c('0x3d')]=function(_0x491d87,_0xb82271){if(_0x491d87[_0x8d3c('0x3c')]['id']){delete _0x491d87[_0x8d3c('0x3c')]['id'];}return db[_0x8d3c('0x1b')][_0x8d3c('0x3e')]({'where':{'id':_0x491d87[_0x8d3c('0x34')]['id']}})[_0x8d3c('0x11')](handleEntityNotFound(_0xb82271,null))[_0x8d3c('0x11')](function(_0x526f70){if(_0x526f70[_0x8d3c('0x30')]===_0x8d3c('0x37')&&_0x491d87['body'][_0x8d3c('0x32')]){_0x491d87[_0x8d3c('0x3c')][_0x8d3c('0x32')]=encryptor['encryptString'](_0x491d87[_0x8d3c('0x3c')]['data3']);}return _0x526f70;})[_0x8d3c('0x11')](saveUpdates(_0x491d87[_0x8d3c('0x3c')],null))[_0x8d3c('0x11')](respondWithResult(_0xb82271,null))['catch'](handleError(_0xb82271,null));};exports[_0x8d3c('0x3f')]=function(_0x470c02,_0x13f6ee){return db[_0x8d3c('0x1b')]['find']({'where':{'id':_0x470c02[_0x8d3c('0x34')]['id']}})[_0x8d3c('0x11')](handleEntityNotFound(_0x13f6ee,null))['then'](removeEntity(_0x13f6ee,null))[_0x8d3c('0x40')](handleError(_0x13f6ee,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50de46,_0x28fc2f){return db[_0x8d3c('0x1b')][_0x8d3c('0x41')]({'where':{'id':_0x50de46['params']['id']},'raw':!![]})['then'](function(_0x2dd6fd){if(!_0x2dd6fd)return _0x28fc2f[_0x8d3c('0x9')](0x194);return{'url':oauth[_0x8d3c('0x42')](_0x2dd6fd,_0x50de46[_0x8d3c('0x43')]['id'])};})['then'](respondWithResult(_0x28fc2f,null))['catch'](handleError(_0x28fc2f,null));};exports['oauth2MicrosoftCallback']=function(_0xfe6654,_0x5a5ec9){var _0x1ae1e1=_0xfe6654[_0x8d3c('0x3c')];var _0x190d21;var _0x2a9b68;if(_0x1ae1e1[_0x8d3c('0x13')])throw _0x1ae1e1;redis[_0x8d3c('0x44')](_0x1ae1e1['state'])['then'](function(_0x1b51e1){if(!_0x1b51e1)throw new Error(_0x8d3c('0x45'));_0x190d21=JSON[_0x8d3c('0x46')](_0x1b51e1);var _0x304530=Buffer[_0x8d3c('0x47')](_0x1ae1e1[_0x8d3c('0x48')],'base64')[_0x8d3c('0x49')]('ascii');_0x2a9b68=JSON[_0x8d3c('0x46')](_0x304530);if(!oauth[_0x8d3c('0x4a')](_0x1ae1e1[_0x8d3c('0x4b')],_0x190d21[_0x8d3c('0x4c')]))throw new Error(_0x8d3c('0x4d'));redis[_0x8d3c('0x4e')](_0x1ae1e1['state']);return oauth[_0x8d3c('0x4f')](_0x1ae1e1[_0x8d3c('0x50')],_0x190d21);})[_0x8d3c('0x11')](function(_0x46c188){_0x190d21['data5']=_0x46c188[_0x8d3c('0x51')];_0x190d21['data6']=_0x46c188[_0x8d3c('0x52')];return db[_0x8d3c('0x1b')]['update']({'data5':_0x190d21[_0x8d3c('0x53')],'data6':_0x190d21['data6']},{'where':{'id':_0x190d21['id']}});})[_0x8d3c('0x11')](function(){oauth[_0x8d3c('0x54')](_0x190d21);socket['emit'](_0x8d3c('0x55'),{'id':_0x2a9b68['id']});return;})[_0x8d3c('0x11')](respondWithStatusCode(_0x5a5ec9,null))['catch'](function(_0x263dab){if(_0x2a9b68){socket['emit'](_0x8d3c('0x56'),{'id':_0x2a9b68['id']});}if(!_0x190d21){logger[_0x8d3c('0x13')](_0x8d3c('0x57'),_0x263dab);return _0x5a5ec9['status'](0x1f4)[_0x8d3c('0x16')](_0x263dab['message']);}logger[_0x8d3c('0x13')](_0x8d3c('0x58'),_0x190d21['id'],JSON['stringify'](_0x263dab));});};
\ No newline at end of file
+var _0xc1ca=['generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','parse','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','error','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','sendStatus','end','status','offset','limit','undefined','count','set','update','then','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','MicrosoftAzure','decryptString','data3','catch','show','params','options','service','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','create','find','oauth2MicrosoftAuthorize','findOne'];(function(_0x22577d,_0x3b74d2){var _0x1d90e9=function(_0x1003b0){while(--_0x1003b0){_0x22577d['push'](_0x22577d['shift']());}};_0x1d90e9(++_0x3b74d2);}(_0xc1ca,0x79));var _0xac1c=function(_0x195547,_0x2ca0ee){_0x195547=_0x195547-0x0;var _0x5aee85=_0xc1ca[_0x195547];return _0x5aee85;};'use strict';var _=require(_0xac1c('0x0'));var Redis=require(_0xac1c('0x1'));var qs=require(_0xac1c('0x2'));var encryptor=require(_0xac1c('0x3'));var config=require(_0xac1c('0x4'));var logger=require(_0xac1c('0x5'))(_0xac1c('0x6'));var db=require(_0xac1c('0x7'))['db'];var oauth=require(_0xac1c('0x8'));config[_0xac1c('0x9')]=_[_0xac1c('0xa')](config[_0xac1c('0x9')],{'host':_0xac1c('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac1c('0x9')]));var redis=new Redis(config[_0xac1c('0x9')]);function respondWithStatusCode(_0x2ac1d8,_0x32adf4){_0x32adf4=_0x32adf4||0xcc;return function(_0x5c5626){if(_0x5c5626){return _0x2ac1d8[_0xac1c('0xc')](_0x32adf4);}return _0x2ac1d8['status'](_0x32adf4)[_0xac1c('0xd')]();};}function respondWithResult(_0x39a828,_0x55c57f){_0x55c57f=_0x55c57f||0xc8;return function(_0x1e8c79){if(_0x1e8c79){return _0x39a828[_0xac1c('0xe')](_0x55c57f)['json'](_0x1e8c79);}};}function respondWithFilteredResult(_0x2ebeca,_0x3d14cf){return function(_0x1c3813){if(_0x1c3813){var _0x50766e=typeof _0x3d14cf[_0xac1c('0xf')]==='undefined'&&typeof _0x3d14cf[_0xac1c('0x10')]===_0xac1c('0x11');var _0x4b063c=_0x1c3813[_0xac1c('0x12')];var _0x1aa219=_0x50766e?0x0:_0x3d14cf[_0xac1c('0xf')];var _0x3201ad=_0x50766e?_0x1c3813['count']:_0x3d14cf[_0xac1c('0xf')]+_0x3d14cf['limit'];var _0x7590e1;if(_0x3201ad>=_0x4b063c){_0x3201ad=_0x4b063c;_0x7590e1=0xc8;}else{_0x7590e1=0xce;}_0x2ebeca[_0xac1c('0xe')](_0x7590e1);return _0x2ebeca[_0xac1c('0x13')]('Content-Range',_0x1aa219+'-'+_0x3201ad+'/'+_0x4b063c)['json'](_0x1c3813);}return null;};}function saveUpdates(_0x385043){return function(_0x468f10){if(_0x468f10){return _0x468f10[_0xac1c('0x14')](_0x385043)['then'](function(_0x23cfa9){return _0x23cfa9;});}return null;};}function removeEntity(_0x315537){return function(_0x22d2a4){if(_0x22d2a4){return _0x22d2a4['destroy']()[_0xac1c('0x15')](function(){_0x315537[_0xac1c('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353ee2){return function(_0x14653c){if(!_0x14653c){_0x353ee2['sendStatus'](0x194);}return _0x14653c;};}function handleError(_0x4fe35a,_0x32592c){_0x32592c=_0x32592c||0x1f4;return function(_0x5ca6fd){logger['error'](_0x5ca6fd['stack']);if(_0x5ca6fd[_0xac1c('0x16')]){delete _0x5ca6fd[_0xac1c('0x16')];}_0x4fe35a[_0xac1c('0xe')](_0x32592c)[_0xac1c('0x17')](_0x5ca6fd);};}function maskClientSecret(_0x14b4e4){return _[_0xac1c('0x18')](_0x14b4e4[_0xac1c('0x19')](0x0,0x3),0x14,'*');}exports[_0xac1c('0x1a')]=function(_0x2b03b2,_0x4f557e){var _0x5b7b5f={},_0x180604={},_0x42fd88={'count':0x0,'rows':[]};var _0x42a0a9=_[_0xac1c('0x1b')](db[_0xac1c('0x1c')][_0xac1c('0x1d')],function(_0x43fcfc){return{'name':_0x43fcfc['fieldName'],'type':_0x43fcfc[_0xac1c('0x1e')][_0xac1c('0x1f')]};});_0x180604['model']=_[_0xac1c('0x1b')](_0x42a0a9,'name');_0x180604[_0xac1c('0x20')]=_[_0xac1c('0x21')](_0x2b03b2[_0xac1c('0x20')]);_0x180604[_0xac1c('0x22')]=_['intersection'](_0x180604['model'],_0x180604[_0xac1c('0x20')]);_0x5b7b5f[_0xac1c('0x23')]=_[_0xac1c('0x24')](_0x180604[_0xac1c('0x25')],qs[_0xac1c('0x26')](_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x26')]));_0x5b7b5f['attributes']=_0x5b7b5f['attributes'][_0xac1c('0x27')]?_0x5b7b5f[_0xac1c('0x23')]:_0x180604['model'];if(!_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x28')](_0xac1c('0x29'))){_0x5b7b5f[_0xac1c('0x10')]=qs[_0xac1c('0x10')](_0x2b03b2[_0xac1c('0x20')]['limit']);_0x5b7b5f[_0xac1c('0xf')]=qs[_0xac1c('0xf')](_0x2b03b2['query'][_0xac1c('0xf')]);}_0x5b7b5f[_0xac1c('0x2a')]=qs[_0xac1c('0x2b')](_0x2b03b2['query']['sort']);_0x5b7b5f['where']=qs['filters'](_[_0xac1c('0x2c')](_0x2b03b2[_0xac1c('0x20')],_0x180604['filters']),_0x42a0a9);if(_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x2d')]){_0x5b7b5f[_0xac1c('0x2e')]=_[_0xac1c('0x2f')](_0x5b7b5f[_0xac1c('0x2e')],{'$or':_[_0xac1c('0x1b')](_0x42a0a9,function(_0x14c2ad){if(_0x14c2ad[_0xac1c('0x1e')]!==_0xac1c('0x30')){var _0x2042d0={};_0x2042d0[_0x14c2ad['name']]={'$like':'%'+_0x2b03b2['query'][_0xac1c('0x2d')]+'%'};return _0x2042d0;}})});}_0x5b7b5f=_[_0xac1c('0x2f')]({},_0x5b7b5f,_0x2b03b2['options']);var _0x228ed1={'where':_0x5b7b5f['where']};return db['CloudProvider'][_0xac1c('0x12')](_0x228ed1)[_0xac1c('0x15')](function(_0xef2387){_0x42fd88[_0xac1c('0x12')]=_0xef2387;if(_0x2b03b2[_0xac1c('0x20')][_0xac1c('0x31')]){_0x5b7b5f[_0xac1c('0x32')]=[{'all':!![]}];}return db[_0xac1c('0x1c')][_0xac1c('0x33')](_0x5b7b5f);})[_0xac1c('0x15')](function(_0x4b9795){_0x42fd88[_0xac1c('0x34')]=_[_0xac1c('0x1b')](_0x4b9795,function(_0x48c559){if(_0x48c559['service']===_0xac1c('0x35')){var _0x2225a7=encryptor[_0xac1c('0x36')](_0x48c559[_0xac1c('0x37')]);_0x48c559[_0xac1c('0x37')]=maskClientSecret(_0x2225a7);}return _0x48c559;});return _0x42fd88;})[_0xac1c('0x15')](respondWithFilteredResult(_0x4f557e,_0x5b7b5f))[_0xac1c('0x38')](handleError(_0x4f557e,null));};exports[_0xac1c('0x39')]=function(_0x4d624b,_0x3b6577){var _0x4a819f={'raw':!![],'where':{'id':_0x4d624b[_0xac1c('0x3a')]['id']}},_0xa58541={};_0xa58541[_0xac1c('0x25')]=_[_0xac1c('0x21')](db[_0xac1c('0x1c')][_0xac1c('0x1d')]);_0xa58541[_0xac1c('0x20')]=_[_0xac1c('0x21')](_0x4d624b['query']);_0xa58541['filters']=_[_0xac1c('0x24')](_0xa58541['model'],_0xa58541[_0xac1c('0x20')]);_0x4a819f['attributes']=_[_0xac1c('0x24')](_0xa58541['model'],qs[_0xac1c('0x26')](_0x4d624b[_0xac1c('0x20')][_0xac1c('0x26')]));_0x4a819f['attributes']=_0x4a819f[_0xac1c('0x23')][_0xac1c('0x27')]?_0x4a819f['attributes']:_0xa58541[_0xac1c('0x25')];if(_0x4d624b[_0xac1c('0x20')][_0xac1c('0x31')]){_0x4a819f[_0xac1c('0x32')]=[{'all':!![]}];}_0x4a819f=_[_0xac1c('0x2f')]({},_0x4a819f,_0x4d624b[_0xac1c('0x3b')]);return db[_0xac1c('0x1c')]['find'](_0x4a819f)['then'](handleEntityNotFound(_0x3b6577,null))['then'](function(_0x52ac05){if(_0x52ac05[_0xac1c('0x3c')]===_0xac1c('0x35')){var _0x273549=encryptor[_0xac1c('0x36')](_0x52ac05[_0xac1c('0x37')]);_0x52ac05['data3']=maskClientSecret(_0x273549);}return _0x52ac05;})[_0xac1c('0x15')](respondWithResult(_0x3b6577,null))[_0xac1c('0x38')](handleError(_0x3b6577,null));};exports['create']=function(_0xc4ddb3,_0x29333f){if(!_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x16')])throw new Error(_0xac1c('0x3e'));if(!_0xc4ddb3['body'][_0xac1c('0x3c')])throw new Error(_0xac1c('0x3f'));var _0x3423c6=db[_0xac1c('0x1c')][_0xac1c('0x1d')][_0xac1c('0x3c')][_0xac1c('0x40')];if(!_0x3423c6[_0xac1c('0x41')](_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x3c')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3423c6['join'](',\x20'));if(_0xc4ddb3['body'][_0xac1c('0x3c')]===_0xac1c('0x35')&&_0xc4ddb3[_0xac1c('0x3d')][_0xac1c('0x37')]){_0xc4ddb3['body'][_0xac1c('0x37')]=encryptor[_0xac1c('0x42')](_0xc4ddb3['body'][_0xac1c('0x37')]);}return db['CloudProvider'][_0xac1c('0x43')](_0xc4ddb3[_0xac1c('0x3d')],{})[_0xac1c('0x15')](respondWithResult(_0x29333f,0xc9))[_0xac1c('0x38')](handleError(_0x29333f,null));};exports[_0xac1c('0x14')]=function(_0x1d8445,_0x363002){if(_0x1d8445[_0xac1c('0x3d')]['id']){delete _0x1d8445[_0xac1c('0x3d')]['id'];}return db[_0xac1c('0x1c')][_0xac1c('0x44')]({'where':{'id':_0x1d8445['params']['id']}})[_0xac1c('0x15')](handleEntityNotFound(_0x363002,null))['then'](function(_0xa22002){if(_0xa22002[_0xac1c('0x3c')]===_0xac1c('0x35')&&_0x1d8445[_0xac1c('0x3d')][_0xac1c('0x37')]){_0x1d8445[_0xac1c('0x3d')]['data3']=encryptor[_0xac1c('0x42')](_0x1d8445[_0xac1c('0x3d')][_0xac1c('0x37')]);}return _0xa22002;})[_0xac1c('0x15')](saveUpdates(_0x1d8445[_0xac1c('0x3d')],null))['then'](respondWithResult(_0x363002,null))[_0xac1c('0x38')](handleError(_0x363002,null));};exports['destroy']=function(_0x343edc,_0x50e603){return db[_0xac1c('0x1c')]['find']({'where':{'id':_0x343edc['params']['id']}})['then'](handleEntityNotFound(_0x50e603,null))[_0xac1c('0x15')](removeEntity(_0x50e603,null))[_0xac1c('0x38')](handleError(_0x50e603,null));};exports[_0xac1c('0x45')]=function(_0x19f504,_0x430ba9){return db[_0xac1c('0x1c')][_0xac1c('0x46')]({'where':{'id':_0x19f504[_0xac1c('0x3a')]['id']},'raw':!![]})[_0xac1c('0x15')](function(_0x25b4f5){if(!_0x25b4f5)return _0x430ba9[_0xac1c('0xc')](0x194);return{'url':oauth[_0xac1c('0x47')](_0x25b4f5,_0x19f504[_0xac1c('0x48')]['id'])};})['then'](respondWithResult(_0x430ba9,null))[_0xac1c('0x38')](handleError(_0x430ba9,null));};exports[_0xac1c('0x49')]=function(_0x3a76db,_0x3a0dc8){var _0xb6adf5=_0x3a76db[_0xac1c('0x3d')];var _0xe5d0ad;var _0x400d0c;if(_0xb6adf5['error'])throw _0xb6adf5;redis['get'](_0xb6adf5[_0xac1c('0x4a')])[_0xac1c('0x15')](function(_0x3de61e){if(!_0x3de61e)throw new Error('Invalid\x20state\x20parameter');_0xe5d0ad=JSON['parse'](_0x3de61e);var _0x41dbbe=Buffer[_0xac1c('0x4b')](_0xb6adf5[_0xac1c('0x4a')],_0xac1c('0x4c'))[_0xac1c('0x4d')]('ascii');_0x400d0c=JSON[_0xac1c('0x4e')](_0x41dbbe);if(!oauth[_0xac1c('0x4f')](_0xb6adf5[_0xac1c('0x50')],_0xe5d0ad[_0xac1c('0x51')]))throw new Error(_0xac1c('0x52'));redis[_0xac1c('0x53')](_0xb6adf5[_0xac1c('0x4a')]);return oauth[_0xac1c('0x54')](_0xb6adf5[_0xac1c('0x55')],_0xe5d0ad);})[_0xac1c('0x15')](function(_0x5ad32a){_0xe5d0ad[_0xac1c('0x56')]=_0x5ad32a[_0xac1c('0x57')];_0xe5d0ad['data6']=_0x5ad32a[_0xac1c('0x58')];return db[_0xac1c('0x1c')]['update']({'data5':_0xe5d0ad[_0xac1c('0x56')],'data6':_0xe5d0ad[_0xac1c('0x59')]},{'where':{'id':_0xe5d0ad['id']}});})[_0xac1c('0x15')](function(){oauth[_0xac1c('0x5a')](_0xe5d0ad);socket['emit'](_0xac1c('0x5b'),{'id':_0x400d0c['id']});return;})[_0xac1c('0x15')](respondWithStatusCode(_0x3a0dc8,null))['catch'](function(_0x569970){if(_0x400d0c){socket['emit'](_0xac1c('0x5c'),{'id':_0x400d0c['id']});}if(!_0xe5d0ad){logger['error'](_0xac1c('0x5d'),_0x569970);return _0x3a0dc8['status'](0x1f4)[_0xac1c('0x17')](_0x569970['message']);}logger[_0xac1c('0x5e')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0xe5d0ad['id'],JSON[_0xac1c('0x5f')](_0x569970));});};
\ No newline at end of file
index 6055513..27fbaf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d69=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x582fd0,_0x411f85){var _0x3ced46=function(_0x1c7cb9){while(--_0x1c7cb9){_0x582fd0['push'](_0x582fd0['shift']());}};_0x3ced46(++_0x411f85);}(_0x5d69,0xf3));var _0x95d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5d69[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x95d6('0x0'));var util=require(_0x95d6('0x1'));var logger=require(_0x95d6('0x2'))('api');var moment=require(_0x95d6('0x3'));var BPromise=require(_0x95d6('0x4'));var rp=require(_0x95d6('0x5'));var fs=require('fs');var path=require(_0x95d6('0x6'));var rimraf=require(_0x95d6('0x7'));var config=require(_0x95d6('0x8'));var attributes=require(_0x95d6('0x9'));module[_0x95d6('0xa')]=function(_0x17fb34,_0x21182d){return _0x17fb34[_0x95d6('0xb')](_0x95d6('0xc'),attributes,{'tableName':_0x95d6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0da0=['cloud_providers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','CloudProvider'];(function(_0x187718,_0x427383){var _0x29ddf4=function(_0x2ec62a){while(--_0x2ec62a){_0x187718['push'](_0x187718['shift']());}};_0x29ddf4(++_0x427383);}(_0x0da0,0x169));var _0x00da=function(_0x24aed7,_0x427dd8){_0x24aed7=_0x24aed7-0x0;var _0x1dbf69=_0x0da0[_0x24aed7];return _0x1dbf69;};'use strict';var _=require(_0x00da('0x0'));var util=require(_0x00da('0x1'));var logger=require(_0x00da('0x2'))(_0x00da('0x3'));var moment=require(_0x00da('0x4'));var BPromise=require('bluebird');var rp=require(_0x00da('0x5'));var fs=require('fs');var path=require(_0x00da('0x6'));var rimraf=require(_0x00da('0x7'));var config=require(_0x00da('0x8'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x423db5,_0x3ae559){return _0x423db5[_0x00da('0x9')](_0x00da('0xa'),attributes,{'tableName':_0x00da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d409d33..86eea6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fcc=['push','data7','join','Outlook365','Dynamics365','/.default','{TENANT_ID}','data2','code','id_token','from','stringify','toString','randomBytes','hex','client_id','data1','response_type','data4','response_mode','form_post','scope','state','nonce','map','key','value','replace','oauth2/','set','decode','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','data6','decryptString','access_token','CloudProvider','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/token','type'];(function(_0x3d7a9b,_0x2b0780){var _0x309c67=function(_0x1244f4){while(--_0x1244f4){_0x3d7a9b['push'](_0x3d7a9b['shift']());}};_0x309c67(++_0x2b0780);}(_0x4fcc,0xd7));var _0xc4fc=function(_0x17c9c0,_0x3f3d96){_0x17c9c0=_0x17c9c0-0x0;var _0x15e944=_0x4fcc[_0x17c9c0];return _0x15e944;};'use strict';var _=require('lodash');var crypto=require(_0xc4fc('0x0'));var jwt=require(_0xc4fc('0x1'));var moment=require(_0xc4fc('0x2'));var Redis=require(_0xc4fc('0x3'));var rp=require(_0xc4fc('0x4'));var util=require(_0xc4fc('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0xc4fc('0x6'));var logger=require(_0xc4fc('0x7'))('api');var schedule=require(_0xc4fc('0x8'));var db=require(_0xc4fc('0x9'))['db'];config[_0xc4fc('0xa')]=_[_0xc4fc('0xb')](config['redis'],{'host':_0xc4fc('0xc'),'port':0x18eb});var redis=new Redis(config[_0xc4fc('0xa')]);var MICROSOFT_AUTH_URL=_0xc4fc('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xc4fc('0xe'),_0xc4fc('0xf'),_0xc4fc('0x10'),_0xc4fc('0x11'),'https://outlook.office.com/POP.AccessAsUser.All',_0xc4fc('0x12')],'Dynamics365':[_0xc4fc('0x13'),_0xc4fc('0x10')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0xc4fc('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5b4bc3){var _0x4efcde=_['map'](AZURE_AUTH_SCOPES[_0x5b4bc3[_0xc4fc('0x15')]]);if(_0x5b4bc3[_0xc4fc('0x15')]==='Dynamics365')_0x4efcde[_0xc4fc('0x16')](_0x5b4bc3[_0xc4fc('0x17')]+'/.default');return _0x4efcde[_0xc4fc('0x18')]('\x20');}function getAccessTokenScope(_0x398f26){if(_0x398f26[_0xc4fc('0x15')]===_0xc4fc('0x19'))return _0xc4fc('0x11');if(_0x398f26[_0xc4fc('0x15')]===_0xc4fc('0x1a'))return _0x398f26[_0xc4fc('0x17')]+_0xc4fc('0x1b');}function generateMicrosoftAuthorizationUrl(_0x2bc355,_0x1529cf){var _0x205309=MICROSOFT_AUTH_URL['replace'](_0xc4fc('0x1c'),_0x2bc355[_0xc4fc('0x1d')]);var _0x492ee4=[_0xc4fc('0x1e'),_0xc4fc('0x1f')];var _0x32bf25=Buffer[_0xc4fc('0x20')](JSON[_0xc4fc('0x21')]({'id':_0x1529cf}))[_0xc4fc('0x22')]('base64');var _0x51ecc0=crypto[_0xc4fc('0x23')](0x10)[_0xc4fc('0x22')](_0xc4fc('0x24'));var _0x6f54bb=getAuthorizationScopes(_0x2bc355);var _0x4afc76=[{'key':_0xc4fc('0x25'),'value':_0x2bc355[_0xc4fc('0x26')]},{'key':_0xc4fc('0x27'),'value':encodeURIComponent(_0x492ee4['join']('\x20'))},{'key':'redirect_uri','value':_0x2bc355[_0xc4fc('0x28')]},{'key':_0xc4fc('0x29'),'value':_0xc4fc('0x2a')},{'key':_0xc4fc('0x2b'),'value':encodeURIComponent(_0x6f54bb)},{'key':_0xc4fc('0x2c'),'value':_0x32bf25},{'key':_0xc4fc('0x2d'),'value':_0x51ecc0},{'key':'prompt','value':'login'}];var _0x1514dc=_0x205309+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xc4fc('0x2e')](_0x4afc76,function(_0x5c5031){return _0x5c5031[_0xc4fc('0x2f')]+'='+_0x5c5031[_0xc4fc('0x30')];})[_0xc4fc('0x18')]('&');_0x2bc355['oauth2Claims']={'issuer':_0x205309[_0xc4fc('0x31')](_0xc4fc('0x32'),''),'audience':_0x2bc355['data1'],'state':_0x32bf25,'nonce':_0x51ecc0};redis[_0xc4fc('0x33')](_0x32bf25,JSON[_0xc4fc('0x21')](_0x2bc355));return _0x1514dc;}function isValidIdToken(_0x48b2a0,_0x3b77c7){try{var _0xa92e41=jwt[_0xc4fc('0x34')](_0x48b2a0,{'complete':!![]});var _0x45248b=_0xa92e41[_0xc4fc('0x35')];if(_0x45248b[_0xc4fc('0x36')]!==_0x3b77c7['issuer'])return![];if(_0x45248b['aud']!==_0x3b77c7[_0xc4fc('0x37')])return![];if(_0x45248b[_0xc4fc('0x2d')]!==_0x3b77c7[_0xc4fc('0x2d')])return![];if(moment()[_0xc4fc('0x38')](moment[_0xc4fc('0x39')](_0x45248b[_0xc4fc('0x3a')])))return![];return!![];}catch(_0x45849c){throw _0x45849c;}}function refreshOauth2MicrosoftAccessToken(_0x343ad9){return Promise[_0xc4fc('0x3b')]()[_0xc4fc('0x3c')](function(){if(_0x343ad9[_0xc4fc('0x3d')])return _0x343ad9;return db['CloudProvider'][_0xc4fc('0x3e')]({'where':{'id':_0x343ad9['id']},'raw':!![]});})['then'](function(_0x353671){var _0x4fc928={'grant_type':_0xc4fc('0x3f'),'refresh_token':_0x353671[_0xc4fc('0x40')],'scope':getAccessTokenScope(_0x353671),'redirect_uri':_0x353671['data4'],'client_id':_0x353671[_0xc4fc('0x26')],'client_secret':encryptor[_0xc4fc('0x41')](_0x353671[_0xc4fc('0x3d')])};var _0x51374f={'method':'POST','uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x353671['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4fc928,'json':!![]};return rp(_0x51374f);})[_0xc4fc('0x3c')](function(_0xa1be49){_0x343ad9['data5']=_0xa1be49[_0xc4fc('0x42')];_0x343ad9['data6']=_0xa1be49['refresh_token'];return db[_0xc4fc('0x43')][_0xc4fc('0x44')]({'data5':_0x343ad9[_0xc4fc('0x45')],'data6':_0x343ad9[_0xc4fc('0x40')]},{'where':{'id':_0x343ad9['id']}});})[_0xc4fc('0x3c')](function(){return _0x343ad9;})[_0xc4fc('0x46')](function(_0x3454b0){logger[_0xc4fc('0x47')](_0xc4fc('0x48'),_0x343ad9['id'],_0x3454b0);});}function getOauth2MicrosoftAccessToken(_0xc924d3,_0x46267c){var _0x1e9b20={'grant_type':'authorization_code','code':_0xc924d3,'scope':getAccessTokenScope(_0x46267c),'redirect_uri':_0x46267c[_0xc4fc('0x28')],'client_id':_0x46267c['data1'],'client_secret':encryptor[_0xc4fc('0x41')](_0x46267c[_0xc4fc('0x3d')])};var _0x176b04={'method':_0xc4fc('0x49'),'uri':MICROSOFT_AUTH_URL[_0xc4fc('0x31')](_0xc4fc('0x1c'),_0x46267c[_0xc4fc('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1e9b20,'json':!![]};return rp(_0x176b04);}function startRefreshInterval(_0x3ee759){var _0x558fef=schedule[_0xc4fc('0x4a')];if(_0x558fef[_0x3ee759['id']])clearInterval(_0x558fef[_0x3ee759['id']]);_0x558fef[_0x3ee759['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xc4fc('0x4b')](this,{'id':_0x3ee759['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x558fef;}function startAllRefreshIntervals(){return db[_0xc4fc('0x43')][_0xc4fc('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0xf78d1d){var _0x31d616=_0xf78d1d[_0xc4fc('0x2e')](function(_0x5865ab){return refreshOauth2MicrosoftAccessToken(_0x5865ab)[_0xc4fc('0x3c')](function(_0x7f40e6){startRefreshInterval(_0x7f40e6);});});return Promise[_0xc4fc('0x4d')](_0x31d616);})[_0xc4fc('0x46')](function(_0x12d6ef){var _0x59b7e3=_0x12d6ef?util['inspect'](_0x12d6ef,{'showHidden':![],'depth':null}):'';logger[_0xc4fc('0x47')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x59b7e3);});}module[_0xc4fc('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9758=['data7','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','replace','code','from','stringify','base64','randomBytes','toString','client_id','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST','{TENANT_ID}','data2','access_token','data6','update','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','inspect','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map','type','Dynamics365','push'];(function(_0x5071b2,_0x2d10c1){var _0x3d5f6a=function(_0x307748){while(--_0x307748){_0x5071b2['push'](_0x5071b2['shift']());}};_0x3d5f6a(++_0x2d10c1);}(_0x9758,0x130));var _0x8975=function(_0x55a5c0,_0x56da71){_0x55a5c0=_0x55a5c0-0x0;var _0x1432c6=_0x9758[_0x55a5c0];return _0x1432c6;};'use strict';var _=require('lodash');var crypto=require(_0x8975('0x0'));var jwt=require(_0x8975('0x1'));var moment=require(_0x8975('0x2'));var Redis=require(_0x8975('0x3'));var rp=require('request-promise');var util=require(_0x8975('0x4'));var encryptor=require(_0x8975('0x5'));var config=require(_0x8975('0x6'));var logger=require(_0x8975('0x7'))(_0x8975('0x8'));var schedule=require(_0x8975('0x9'));var db=require(_0x8975('0xa'))['db'];config[_0x8975('0xb')]=_[_0x8975('0xc')](config[_0x8975('0xb')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x8975('0xd'),_0x8975('0xe'),_0x8975('0xf'),_0x8975('0x10'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x8975('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0x8975('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x8975('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x8975('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2d7abc){var _0x1d80dc=_[_0x8975('0x14')](AZURE_AUTH_SCOPES[_0x2d7abc[_0x8975('0x15')]]);if(_0x2d7abc['type']===_0x8975('0x16'))_0x1d80dc[_0x8975('0x17')](_0x2d7abc[_0x8975('0x18')]+'/.default');return _0x1d80dc['join']('\x20');}function getAccessTokenScope(_0x10aa69){if(_0x10aa69[_0x8975('0x15')]===_0x8975('0x19'))return _0x8975('0x1a');if(_0x10aa69['type']==='Dynamics365')return _0x10aa69[_0x8975('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x4f1ee1,_0x9c380d){var _0x94048c=MICROSOFT_AUTH_URL[_0x8975('0x1b')]('{TENANT_ID}',_0x4f1ee1['data2']);var _0x368ef8=[_0x8975('0x1c'),'id_token'];var _0x5fe7cf=Buffer[_0x8975('0x1d')](JSON[_0x8975('0x1e')]({'id':_0x9c380d}))['toString'](_0x8975('0x1f'));var _0x412c89=crypto[_0x8975('0x20')](0x10)[_0x8975('0x21')]('hex');var _0x272923=getAuthorizationScopes(_0x4f1ee1);var _0x46b80f=[{'key':_0x8975('0x22'),'value':_0x4f1ee1[_0x8975('0x23')]},{'key':_0x8975('0x24'),'value':encodeURIComponent(_0x368ef8[_0x8975('0x25')]('\x20'))},{'key':_0x8975('0x26'),'value':_0x4f1ee1[_0x8975('0x27')]},{'key':_0x8975('0x28'),'value':_0x8975('0x29')},{'key':_0x8975('0x2a'),'value':encodeURIComponent(_0x272923)},{'key':_0x8975('0x2b'),'value':_0x5fe7cf},{'key':_0x8975('0x2c'),'value':_0x412c89},{'key':_0x8975('0x2d'),'value':'login'}];var _0x1d422d=_0x94048c+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x8975('0x14')](_0x46b80f,function(_0x26f149){return _0x26f149[_0x8975('0x2e')]+'='+_0x26f149[_0x8975('0x2f')];})['join']('&');_0x4f1ee1[_0x8975('0x30')]={'issuer':_0x94048c[_0x8975('0x1b')](_0x8975('0x31'),''),'audience':_0x4f1ee1[_0x8975('0x23')],'state':_0x5fe7cf,'nonce':_0x412c89};redis[_0x8975('0x32')](_0x5fe7cf,JSON['stringify'](_0x4f1ee1));return _0x1d422d;}function isValidIdToken(_0xe524c1,_0x285e22){try{var _0x1f3443=jwt[_0x8975('0x33')](_0xe524c1,{'complete':!![]});var _0x54a603=_0x1f3443[_0x8975('0x34')];if(_0x54a603[_0x8975('0x35')]!==_0x285e22[_0x8975('0x36')])return![];if(_0x54a603[_0x8975('0x37')]!==_0x285e22[_0x8975('0x38')])return![];if(_0x54a603['nonce']!==_0x285e22['nonce'])return![];if(moment()[_0x8975('0x39')](moment[_0x8975('0x3a')](_0x54a603[_0x8975('0x3b')])))return![];return!![];}catch(_0x370239){throw _0x370239;}}function refreshOauth2MicrosoftAccessToken(_0x3b452f){return Promise[_0x8975('0x3c')]()[_0x8975('0x3d')](function(){if(_0x3b452f[_0x8975('0x3e')])return _0x3b452f;return db[_0x8975('0x3f')][_0x8975('0x40')]({'where':{'id':_0x3b452f['id']},'raw':!![]});})['then'](function(_0x2625d0){var _0x31c5d6={'grant_type':_0x8975('0x41'),'refresh_token':_0x2625d0['data6'],'scope':getAccessTokenScope(_0x2625d0),'redirect_uri':_0x2625d0['data4'],'client_id':_0x2625d0[_0x8975('0x23')],'client_secret':encryptor[_0x8975('0x42')](_0x2625d0['data3'])};var _0x30db90={'method':_0x8975('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8975('0x1b')](_0x8975('0x44'),_0x2625d0[_0x8975('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x31c5d6,'json':!![]};return rp(_0x30db90);})[_0x8975('0x3d')](function(_0x1d13a5){_0x3b452f['data5']=_0x1d13a5[_0x8975('0x46')];_0x3b452f[_0x8975('0x47')]=_0x1d13a5[_0x8975('0x41')];return db['CloudProvider'][_0x8975('0x48')]({'data5':_0x3b452f[_0x8975('0x49')],'data6':_0x3b452f[_0x8975('0x47')]},{'where':{'id':_0x3b452f['id']}});})[_0x8975('0x3d')](function(){return _0x3b452f;})[_0x8975('0x4a')](function(_0x542f54){logger[_0x8975('0x4b')](_0x8975('0x4c'),_0x3b452f['id'],_0x542f54);});}function getOauth2MicrosoftAccessToken(_0x56d9f7,_0x3805da){var _0x562bd9={'grant_type':_0x8975('0x4d'),'code':_0x56d9f7,'scope':getAccessTokenScope(_0x3805da),'redirect_uri':_0x3805da['data4'],'client_id':_0x3805da[_0x8975('0x23')],'client_secret':encryptor[_0x8975('0x42')](_0x3805da[_0x8975('0x3e')])};var _0x1cb3c6={'method':_0x8975('0x43'),'uri':MICROSOFT_AUTH_URL[_0x8975('0x1b')]('{TENANT_ID}',_0x3805da[_0x8975('0x45')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x562bd9,'json':!![]};return rp(_0x1cb3c6);}function startRefreshInterval(_0x5b8c15){var _0x439ca4=schedule[_0x8975('0x4e')];if(_0x439ca4[_0x5b8c15['id']])clearInterval(_0x439ca4[_0x5b8c15['id']]);_0x439ca4[_0x5b8c15['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x8975('0x4f')](this,{'id':_0x5b8c15['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x8975('0x4e')]=_0x439ca4;}function startAllRefreshIntervals(){return db[_0x8975('0x3f')][_0x8975('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x8975('0x3d')](function(_0x5c55a4){var _0xefb826=_0x5c55a4[_0x8975('0x14')](function(_0x161a29){return refreshOauth2MicrosoftAccessToken(_0x161a29)[_0x8975('0x3d')](function(_0x527357){startRefreshInterval(_0x527357);});});return Promise['all'](_0xefb826);})[_0x8975('0x4a')](function(_0x2f5014){var _0x2184b9=_0x2f5014?util[_0x8975('0x51')](_0x2f5014,{'showHidden':![],'depth':null}):'';logger[_0x8975('0x4b')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x2184b9);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
index 5277afe..372c71e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd878=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','http','request','then','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x43612d,_0x4bf230){var _0x5434ee=function(_0x134301){while(--_0x134301){_0x43612d['push'](_0x43612d['shift']());}};_0x5434ee(++_0x4bf230);}(_0xd878,0x118));var _0x8d87=function(_0x5d6819,_0x7b07f5){_0x5d6819=_0x5d6819-0x0;var _0x3a467d=_0xd878[_0x5d6819];return _0x3a467d;};'use strict';var _=require(_0x8d87('0x0'));var util=require(_0x8d87('0x1'));var moment=require(_0x8d87('0x2'));var BPromise=require(_0x8d87('0x3'));var rs=require(_0x8d87('0x4'));var fs=require('fs');var Redis=require(_0x8d87('0x5'));var db=require(_0x8d87('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8d87('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8d87('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b504e,_0xcb4dae,_0x1eba92){return new BPromise(function(_0x38fded,_0x2c1bd0){return client[_0x8d87('0x9')](_0x1b504e,_0x1eba92)[_0x8d87('0xa')](function(_0xf6aa49){logger['info'](_0x8d87('0xb'),_0xcb4dae,'request\x20sent');logger['debug'](_0x8d87('0xc'),_0xcb4dae,_0x8d87('0xd'),JSON[_0x8d87('0xe')](_0xf6aa49));if(_0xf6aa49[_0x8d87('0xf')]){if(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x10')]===0x1f4){logger['error'](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x2c1bd0(_0xf6aa49['error'][_0x8d87('0x11')]);}logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0xf6aa49['error'][_0x8d87('0x11')]);return _0x38fded(_0xf6aa49[_0x8d87('0xf')][_0x8d87('0x11')]);}else{logger[_0x8d87('0x12')](_0x8d87('0xb'),_0xcb4dae,_0x8d87('0xd'));_0x38fded(_0xf6aa49[_0x8d87('0x13')][_0x8d87('0x11')]);}})[_0x8d87('0x14')](function(_0x520df5){logger[_0x8d87('0xf')](_0x8d87('0xb'),_0xcb4dae,_0x520df5);_0x2c1bd0(_0x520df5);});});}
\ No newline at end of file
+var _0x896e=['CloudProvider,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x99c991,_0x439ce7){var _0x3e2061=function(_0x15bf1b){while(--_0x15bf1b){_0x99c991['push'](_0x99c991['shift']());}};_0x3e2061(++_0x439ce7);}(_0x896e,0x1e9));var _0xe896=function(_0xafc7cf,_0x14d3ca){_0xafc7cf=_0xafc7cf-0x0;var _0x241a61=_0x896e[_0xafc7cf];return _0x241a61;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('CloudProvider,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});}
\ No newline at end of file
index d59b004..76f1880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x2d1576,_0x489418){var _0x4445be=function(_0x4785d){while(--_0x4785d){_0x2d1576['push'](_0x2d1576['shift']());}};_0x4445be(++_0x489418);}(_0x2ef3,0xba));var _0x32ef=function(_0x3540f3,_0x591573){_0x3540f3=_0x3540f3-0x0;var _0x2bc846=_0x2ef3[_0x3540f3];return _0x2bc846;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
+var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x5d2e56,_0x5dd641){var _0x3087c5=function(_0x296ef7){while(--_0x296ef7){_0x5d2e56['push'](_0x5d2e56['shift']());}};_0x3087c5(++_0x5dd641);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
index 375b48e..930bc99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56c7=['sequelize','STRING'];(function(_0x29fe2e,_0x2cf4da){var _0x42fff4=function(_0x463c4f){while(--_0x463c4f){_0x29fe2e['push'](_0x29fe2e['shift']());}};_0x42fff4(++_0x2cf4da);}(_0x56c7,0x14c));var _0x756c=function(_0x1c1fba,_0xd5872d){_0x1c1fba=_0x1c1fba-0x0;var _0x37e346=_0x56c7[_0x1c1fba];return _0x37e346;};'use strict';var Sequelize=require(_0x756c('0x0'));module['exports']={'name':{'type':Sequelize[_0x756c('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x756c('0x1')]},'website':{'type':Sequelize[_0x756c('0x1')]},'phone':{'type':Sequelize[_0x756c('0x1')]},'fax':{'type':Sequelize[_0x756c('0x1')]},'type':{'type':Sequelize[_0x756c('0x1')]},'street':{'type':Sequelize[_0x756c('0x1')]},'postalCode':{'type':Sequelize[_0x756c('0x1')]},'city':{'type':Sequelize[_0x756c('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x756c('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x756c('0x1')]},'sStreet':{'type':Sequelize[_0x756c('0x1')]},'sPostalCode':{'type':Sequelize[_0x756c('0x1')]},'sCity':{'type':Sequelize[_0x756c('0x1')]},'sCountry':{'type':Sequelize[_0x756c('0x1')]},'description':{'type':Sequelize[_0x756c('0x1')]}};
\ No newline at end of file
+var _0x82f5=['name','sequelize','exports','STRING'];(function(_0x183359,_0x3da03b){var _0x237bbe=function(_0x25511a){while(--_0x25511a){_0x183359['push'](_0x183359['shift']());}};_0x237bbe(++_0x3da03b);}(_0x82f5,0x15d));var _0x582f=function(_0x47da77,_0x19a4ff){_0x47da77=_0x47da77-0x0;var _0x2f3480=_0x82f5[_0x47da77];return _0x2f3480;};'use strict';var Sequelize=require(_0x582f('0x0'));module[_0x582f('0x1')]={'name':{'type':Sequelize[_0x582f('0x2')],'unique':_0x582f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x582f('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x582f('0x2')]},'fax':{'type':Sequelize[_0x582f('0x2')]},'type':{'type':Sequelize[_0x582f('0x2')]},'street':{'type':Sequelize[_0x582f('0x2')]},'postalCode':{'type':Sequelize[_0x582f('0x2')]},'city':{'type':Sequelize[_0x582f('0x2')]},'country':{'type':Sequelize[_0x582f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x582f('0x2')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x582f('0x2')]},'sCity':{'type':Sequelize[_0x582f('0x2')]},'sCountry':{'type':Sequelize[_0x582f('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 0960f9d..22c8aa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb5e=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','omit','ids','getContacts','findOne','rawAttributes','pick','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','reject','save','update','destroy','get','UserProfileResource','then','error','stack','name','index','CmCompany','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','map','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body'];(function(_0x393911,_0x56f98e){var _0x38230c=function(_0x2b9ef2){while(--_0x2b9ef2){_0x393911['push'](_0x393911['shift']());}};_0x38230c(++_0x56f98e);}(_0xcb5e,0x181));var _0xecb5=function(_0x4ec81d,_0x5e031c){_0x4ec81d=_0x4ec81d-0x0;var _0x3a864f=_0xcb5e[_0x4ec81d];return _0x3a864f;};'use strict';var emlformat=require(_0xecb5('0x0'));var rimraf=require(_0xecb5('0x1'));var zipdir=require(_0xecb5('0x2'));var jsonpatch=require(_0xecb5('0x3'));var rp=require(_0xecb5('0x4'));var moment=require(_0xecb5('0x5'));var BPromise=require(_0xecb5('0x6'));var Mustache=require(_0xecb5('0x7'));var util=require(_0xecb5('0x8'));var path=require(_0xecb5('0x9'));var sox=require(_0xecb5('0xa'));var csv=require(_0xecb5('0xb'));var ejs=require(_0xecb5('0xc'));var fs=require('fs');var fs_extra=require(_0xecb5('0xd'));var _=require(_0xecb5('0xe'));var squel=require('squel');var crypto=require(_0xecb5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xecb5('0x10'));var toCsv=require('to-csv');var querystring=require(_0xecb5('0x11'));var Papa=require(_0xecb5('0x12'));var Redis=require(_0xecb5('0x13'));var authService=require(_0xecb5('0x14'));var qs=require(_0xecb5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xecb5('0x16'));var logger=require(_0xecb5('0x17'))('api');var utils=require(_0xecb5('0x18'));var config=require(_0xecb5('0x19'));var licenseUtil=require(_0xecb5('0x1a'));var db=require(_0xecb5('0x1b'))['db'];function respondWithStatusCode(_0x23754e,_0x5b1370){_0x5b1370=_0x5b1370||0xcc;return function(_0x120b78){if(_0x120b78){return _0x23754e[_0xecb5('0x1c')](_0x5b1370);}return _0x23754e[_0xecb5('0x1d')](_0x5b1370)[_0xecb5('0x1e')]();};}function respondWithResult(_0x87d7b6,_0x538695){_0x538695=_0x538695||0xc8;return function(_0x37c9df){if(_0x37c9df){return _0x87d7b6[_0xecb5('0x1d')](_0x538695)[_0xecb5('0x1f')](_0x37c9df);}};}function respondWithFilteredResult(_0x4cd97b,_0x16f2d7){return function(_0x3a5df1){if(_0x3a5df1){var _0x29e360=typeof _0x16f2d7['offset']===_0xecb5('0x20')&&typeof _0x16f2d7[_0xecb5('0x21')]===_0xecb5('0x20');var _0x204033=_0x3a5df1['count'];var _0x13ad6b=_0x29e360?0x0:_0x16f2d7[_0xecb5('0x22')];var _0xc0b57=_0x29e360?_0x3a5df1[_0xecb5('0x23')]:_0x16f2d7[_0xecb5('0x22')]+_0x16f2d7[_0xecb5('0x21')];var _0x1f340b;if(_0xc0b57>=_0x204033){_0xc0b57=_0x204033;_0x1f340b=0xc8;}else{_0x1f340b=0xce;}_0x4cd97b[_0xecb5('0x1d')](_0x1f340b);return _0x4cd97b['set'](_0xecb5('0x24'),_0x13ad6b+'-'+_0xc0b57+'/'+_0x204033)[_0xecb5('0x1f')](_0x3a5df1);}return null;};}function patchUpdates(_0x405fbb){return function(_0x43f33c){try{jsonpatch['apply'](_0x43f33c,_0x405fbb,!![]);}catch(_0x47b222){return BPromise[_0xecb5('0x25')](_0x47b222);}return _0x43f33c[_0xecb5('0x26')]();};}function saveUpdates(_0x988e2a,_0x47caa2){return function(_0x4d00d0){if(_0x4d00d0){return _0x4d00d0[_0xecb5('0x27')](_0x988e2a)['then'](function(_0x46fa60){return _0x46fa60;});}return null;};}function removeEntity(_0x455594,_0x5cf179){return function(_0xa0abf1){if(_0xa0abf1){return _0xa0abf1[_0xecb5('0x28')]()['then'](function(){var _0x237440=_0xa0abf1[_0xecb5('0x29')]({'plain':!![]});var _0xe75add='Companies';return db[_0xecb5('0x2a')][_0xecb5('0x28')]({'where':{'type':_0xe75add,'resourceId':_0x237440['id']}})['then'](function(){return _0xa0abf1;});})[_0xecb5('0x2b')](function(){_0x455594[_0xecb5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x492f64,_0x175cb7){return function(_0x42b63f){if(!_0x42b63f){_0x492f64[_0xecb5('0x1c')](0x194);}return _0x42b63f;};}function handleError(_0x83bdb6,_0x5ef57a){_0x5ef57a=_0x5ef57a||0x1f4;return function(_0x559234){logger[_0xecb5('0x2c')](_0x559234[_0xecb5('0x2d')]);if(_0x559234['name']){delete _0x559234[_0xecb5('0x2e')];}_0x83bdb6[_0xecb5('0x1d')](_0x5ef57a)['send'](_0x559234);};}exports[_0xecb5('0x2f')]=function(_0x3545bc,_0x429b15){var _0x19832d={},_0x320c28={},_0x1e7284={'count':0x0,'rows':[]};return db[_0xecb5('0x30')]['describe']()[_0xecb5('0x2b')](function(_0x55eb18){_0x320c28[_0xecb5('0x31')]=_[_0xecb5('0x32')](_0x55eb18);_0x320c28[_0xecb5('0x33')]=_[_0xecb5('0x32')](_0x3545bc[_0xecb5('0x33')]);_0x320c28['filters']=_[_0xecb5('0x34')](_0x320c28[_0xecb5('0x31')],_0x320c28['query']);_0x19832d[_0xecb5('0x35')]=_[_0xecb5('0x34')](_0x320c28[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x3545bc['query'][_0xecb5('0x36')]));_0x19832d[_0xecb5('0x35')]=_0x19832d[_0xecb5('0x35')][_0xecb5('0x37')]?_0x19832d['attributes']:_0x320c28[_0xecb5('0x31')];if(!_0x3545bc[_0xecb5('0x33')][_0xecb5('0x38')](_0xecb5('0x39'))){_0x19832d[_0xecb5('0x21')]=qs['limit'](_0x3545bc[_0xecb5('0x33')][_0xecb5('0x21')]);_0x19832d[_0xecb5('0x22')]=qs['offset'](_0x3545bc['query'][_0xecb5('0x22')]);}_0x19832d[_0xecb5('0x3a')]=qs[_0xecb5('0x3b')](_0x3545bc[_0xecb5('0x33')][_0xecb5('0x3b')]);_0x19832d[_0xecb5('0x3c')]=qs['filters'](_['pick'](_0x3545bc[_0xecb5('0x33')],_0x320c28[_0xecb5('0x3d')]),_0x55eb18);if(_0x3545bc[_0xecb5('0x33')]['filter']){_0x19832d[_0xecb5('0x3c')]=_['merge'](_0x19832d[_0xecb5('0x3c')],{'$or':_[_0xecb5('0x3e')](_0x19832d[_0xecb5('0x35')],function(_0x11bcf6){var _0x1a3298={};_0x1a3298[_0x11bcf6]={'$like':'%'+_0x3545bc[_0xecb5('0x33')]['filter']+'%'};return _0x1a3298;})});}_0x19832d=_['merge']({},_0x19832d,_0x3545bc[_0xecb5('0x3f')]);var _0x5697bb={'where':_0x19832d[_0xecb5('0x3c')]};return db[_0xecb5('0x30')][_0xecb5('0x23')](_0x5697bb)[_0xecb5('0x2b')](function(_0x1a6e40){_0x1e7284['count']=_0x1a6e40;if(_0x3545bc['query'][_0xecb5('0x40')]){_0x19832d[_0xecb5('0x41')]=[{'all':!![]}];}return db[_0xecb5('0x30')][_0xecb5('0x42')](_0x19832d);})['then'](function(_0x36fff0){_0x1e7284[_0xecb5('0x43')]=_0x36fff0;return _0x1e7284;})['then'](respondWithFilteredResult(_0x429b15,_0x19832d))['catch'](handleError(_0x429b15,null));})[_0xecb5('0x44')](handleError(_0x429b15,null));};exports[_0xecb5('0x45')]=function(_0x1e7297,_0x8c63f){var _0x1b370f={'raw':![],'where':{'id':_0x1e7297[_0xecb5('0x46')]['id']}},_0xd4d141={};_0xd4d141['model']=_[_0xecb5('0x32')](db[_0xecb5('0x30')]['rawAttributes']);_0xd4d141[_0xecb5('0x33')]=_[_0xecb5('0x32')](_0x1e7297[_0xecb5('0x33')]);_0xd4d141[_0xecb5('0x3d')]=_[_0xecb5('0x34')](_0xd4d141[_0xecb5('0x31')],_0xd4d141[_0xecb5('0x33')]);_0x1b370f[_0xecb5('0x35')]=_['intersection'](_0xd4d141[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x1e7297['query'][_0xecb5('0x36')]));_0x1b370f[_0xecb5('0x35')]=_0x1b370f[_0xecb5('0x35')][_0xecb5('0x37')]?_0x1b370f[_0xecb5('0x35')]:_0xd4d141[_0xecb5('0x31')];if(_0x1e7297[_0xecb5('0x33')][_0xecb5('0x40')]){_0x1b370f[_0xecb5('0x41')]=[{'all':!![]}];}_0x1b370f=_[_0xecb5('0x47')]({},_0x1b370f,_0x1e7297[_0xecb5('0x3f')]);return db[_0xecb5('0x30')][_0xecb5('0x48')](_0x1b370f)[_0xecb5('0x2b')](handleEntityNotFound(_0x8c63f,null))[_0xecb5('0x2b')](respondWithResult(_0x8c63f,null))[_0xecb5('0x44')](handleError(_0x8c63f,null));};exports[_0xecb5('0x49')]=function(_0x5c09c2,_0x5ab34a){return db[_0xecb5('0x30')][_0xecb5('0x49')](_0x5c09c2[_0xecb5('0x4a')],{})['then'](function(_0x3269bf){var _0x490378=_0x5c09c2[_0xecb5('0x4b')][_0xecb5('0x29')]({'plain':!![]});if(!_0x490378)throw new Error(_0xecb5('0x4c'));if(_0x490378['role']===_0xecb5('0x4b')){var _0x34c8b5=_0x3269bf[_0xecb5('0x29')]({'plain':!![]});var _0x132cc1=_0xecb5('0x4d');return db[_0xecb5('0x4e')]['find']({'where':{'name':_0x132cc1,'userProfileId':_0x490378[_0xecb5('0x4f')]},'raw':!![]})[_0xecb5('0x2b')](function(_0x2053f3){if(_0x2053f3&&_0x2053f3[_0xecb5('0x50')]===0x0){return db['UserProfileResource'][_0xecb5('0x49')]({'name':_0x34c8b5[_0xecb5('0x2e')],'resourceId':_0x34c8b5['id'],'type':_0x2053f3['name'],'sectionId':_0x2053f3['id']},{})[_0xecb5('0x2b')](function(){return _0x3269bf;});}else{return _0x3269bf;}})[_0xecb5('0x44')](function(_0x54cb90){logger[_0xecb5('0x2c')](_0xecb5('0x51'),_0x54cb90);throw _0x54cb90;});}return _0x3269bf;})['then'](respondWithResult(_0x5ab34a,0xc9))[_0xecb5('0x44')](handleError(_0x5ab34a,null));};exports[_0xecb5('0x27')]=function(_0xa3ca06,_0x20f15a){if(_0xa3ca06[_0xecb5('0x4a')]['id']){delete _0xa3ca06[_0xecb5('0x4a')]['id'];}return db[_0xecb5('0x30')][_0xecb5('0x48')]({'where':{'id':_0xa3ca06['params']['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x20f15a,null))[_0xecb5('0x2b')](saveUpdates(_0xa3ca06[_0xecb5('0x4a')],null))[_0xecb5('0x2b')](respondWithResult(_0x20f15a,null))[_0xecb5('0x44')](handleError(_0x20f15a,null));};exports['destroy']=function(_0xc24442,_0x290d42){return db[_0xecb5('0x30')][_0xecb5('0x48')]({'where':{'id':_0xc24442[_0xecb5('0x46')]['id']}})['then'](handleEntityNotFound(_0x290d42,null))[_0xecb5('0x2b')](removeEntity(_0x290d42,null))['catch'](handleError(_0x290d42,null));};exports[_0xecb5('0x52')]=function(_0x52b6ab,_0x49c7f9){return db['CmCompany'][_0xecb5('0x52')]()[_0xecb5('0x2b')](respondWithResult(_0x49c7f9,null))['catch'](handleError(_0x49c7f9,null));};exports[_0xecb5('0x53')]=function(_0xb4eda8,_0x489831,_0x29d589){return db[_0xecb5('0x54')][_0xecb5('0x48')]({'where':{'id':_0xb4eda8[_0xecb5('0x46')]['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x489831,null))[_0xecb5('0x2b')](function(_0x146802){if(_0x146802){return _0x146802['addContacts'](_0xb4eda8[_0xecb5('0x4a')]['ids'],_[_0xecb5('0x55')](_0xb4eda8['body'],[_0xecb5('0x56'),'id'])||{});}})[_0xecb5('0x2b')](respondWithResult(_0x489831,null))[_0xecb5('0x44')](handleError(_0x489831,null));};exports[_0xecb5('0x57')]=function(_0x2fe44e,_0x286a05,_0x45cd8d){var _0x4180f2={};var _0x3542d6={};var _0x476c53;var _0x1a49c1;return db[_0xecb5('0x30')][_0xecb5('0x58')]({'where':{'id':_0x2fe44e['params']['id']}})[_0xecb5('0x2b')](handleEntityNotFound(_0x286a05,null))[_0xecb5('0x2b')](function(_0x3c738d){if(_0x3c738d){_0x476c53=_0x3c738d;_0x3542d6['model']=_[_0xecb5('0x32')](db[_0xecb5('0x54')][_0xecb5('0x59')]);_0x3542d6['query']=_[_0xecb5('0x32')](_0x2fe44e[_0xecb5('0x33')]);_0x3542d6['filters']=_[_0xecb5('0x34')](_0x3542d6[_0xecb5('0x31')],_0x3542d6[_0xecb5('0x33')]);_0x4180f2[_0xecb5('0x35')]=_['intersection'](_0x3542d6[_0xecb5('0x31')],qs[_0xecb5('0x36')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x36')]));_0x4180f2[_0xecb5('0x35')]=_0x4180f2[_0xecb5('0x35')]['length']?_0x4180f2[_0xecb5('0x35')]:_0x3542d6[_0xecb5('0x31')];_0x4180f2[_0xecb5('0x3a')]=qs[_0xecb5('0x3b')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x3b')]);_0x4180f2[_0xecb5('0x3c')]=qs['filters'](_[_0xecb5('0x5a')](_0x2fe44e[_0xecb5('0x33')],_0x3542d6['filters']));if(_0x2fe44e['query'][_0xecb5('0x5b')]){_0x4180f2[_0xecb5('0x3c')]=_[_0xecb5('0x47')](_0x4180f2['where'],{'$or':_[_0xecb5('0x3e')](_0x4180f2[_0xecb5('0x35')],function(_0x379f94){var _0x4a918b={};_0x4a918b[_0x379f94]={'$like':'%'+_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x5b')]+'%'};return _0x4a918b;})});}_0x4180f2=_[_0xecb5('0x47')]({},_0x4180f2,_0x2fe44e[_0xecb5('0x3f')]);return _0x476c53[_0xecb5('0x57')](_0x4180f2);}})[_0xecb5('0x2b')](function(_0x424afd){if(_0x424afd){_0x1a49c1=_0x424afd[_0xecb5('0x37')];if(!_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x38')]('nolimit')){_0x4180f2[_0xecb5('0x21')]=qs[_0xecb5('0x21')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x21')]);_0x4180f2[_0xecb5('0x22')]=qs[_0xecb5('0x22')](_0x2fe44e[_0xecb5('0x33')][_0xecb5('0x22')]);}return _0x476c53[_0xecb5('0x57')](_0x4180f2);}})[_0xecb5('0x2b')](function(_0x32b552){if(_0x32b552){return _0x32b552?{'count':_0x1a49c1,'rows':_0x32b552}:null;}})['then'](respondWithResult(_0x286a05,null))[_0xecb5('0x44')](handleError(_0x286a05,null));};
\ No newline at end of file
+var _0x3a87=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','update','then','destroy','get','Companies','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','addContacts','omit','getContacts','findOne','CmContact','nolimit','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0xad67c0,_0x420add){var _0x900008=function(_0x37718c){while(--_0x37718c){_0xad67c0['push'](_0xad67c0['shift']());}};_0x900008(++_0x420add);}(_0x3a87,0xe4));var _0x73a8=function(_0x1b9c2a,_0x50582e){_0x1b9c2a=_0x1b9c2a-0x0;var _0x21ab47=_0x3a87[_0x1b9c2a];return _0x21ab47;};'use strict';var emlformat=require(_0x73a8('0x0'));var rimraf=require(_0x73a8('0x1'));var zipdir=require(_0x73a8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73a8('0x3'));var BPromise=require(_0x73a8('0x4'));var Mustache=require(_0x73a8('0x5'));var util=require(_0x73a8('0x6'));var path=require(_0x73a8('0x7'));var sox=require(_0x73a8('0x8'));var csv=require(_0x73a8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73a8('0xa'));var _=require(_0x73a8('0xb'));var squel=require(_0x73a8('0xc'));var crypto=require(_0x73a8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x73a8('0xe'));var toCsv=require(_0x73a8('0x9'));var querystring=require(_0x73a8('0xf'));var Papa=require('papaparse');var Redis=require(_0x73a8('0x10'));var authService=require(_0x73a8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x73a8('0x12'));var logger=require(_0x73a8('0x13'))(_0x73a8('0x14'));var utils=require('../../config/utils');var config=require(_0x73a8('0x15'));var licenseUtil=require(_0x73a8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc1e1fe,_0x2aacdb){_0x2aacdb=_0x2aacdb||0xcc;return function(_0x454ff7){if(_0x454ff7){return _0xc1e1fe[_0x73a8('0x17')](_0x2aacdb);}return _0xc1e1fe[_0x73a8('0x18')](_0x2aacdb)['end']();};}function respondWithResult(_0x68ead5,_0x4d7301){_0x4d7301=_0x4d7301||0xc8;return function(_0x5c7740){if(_0x5c7740){return _0x68ead5[_0x73a8('0x18')](_0x4d7301)['json'](_0x5c7740);}};}function respondWithFilteredResult(_0x185b29,_0x8b73df){return function(_0x8289d1){if(_0x8289d1){var _0x2e61b4=typeof _0x8b73df[_0x73a8('0x19')]===_0x73a8('0x1a')&&typeof _0x8b73df['limit']===_0x73a8('0x1a');var _0x2f15ec=_0x8289d1[_0x73a8('0x1b')];var _0x16bec1=_0x2e61b4?0x0:_0x8b73df[_0x73a8('0x19')];var _0x2b2fc3=_0x2e61b4?_0x8289d1['count']:_0x8b73df[_0x73a8('0x19')]+_0x8b73df[_0x73a8('0x1c')];var _0x37e273;if(_0x2b2fc3>=_0x2f15ec){_0x2b2fc3=_0x2f15ec;_0x37e273=0xc8;}else{_0x37e273=0xce;}_0x185b29[_0x73a8('0x18')](_0x37e273);return _0x185b29[_0x73a8('0x1d')](_0x73a8('0x1e'),_0x16bec1+'-'+_0x2b2fc3+'/'+_0x2f15ec)[_0x73a8('0x1f')](_0x8289d1);}return null;};}function patchUpdates(_0x498d11){return function(_0x470a71){try{jsonpatch['apply'](_0x470a71,_0x498d11,!![]);}catch(_0x31faf3){return BPromise[_0x73a8('0x20')](_0x31faf3);}return _0x470a71['save']();};}function saveUpdates(_0x4343d1,_0x4b7466){return function(_0x4c479e){if(_0x4c479e){return _0x4c479e[_0x73a8('0x21')](_0x4343d1)[_0x73a8('0x22')](function(_0x2b0f79){return _0x2b0f79;});}return null;};}function removeEntity(_0x50c7f1,_0x32d34c){return function(_0x406ced){if(_0x406ced){return _0x406ced[_0x73a8('0x23')]()['then'](function(){var _0x482a17=_0x406ced[_0x73a8('0x24')]({'plain':!![]});var _0x521f89=_0x73a8('0x25');return db[_0x73a8('0x26')][_0x73a8('0x23')]({'where':{'type':_0x521f89,'resourceId':_0x482a17['id']}})['then'](function(){return _0x406ced;});})['then'](function(){_0x50c7f1['status'](0xcc)[_0x73a8('0x27')]();});}};}function handleEntityNotFound(_0x1e698e,_0x5bcdac){return function(_0x4a733e){if(!_0x4a733e){_0x1e698e['sendStatus'](0x194);}return _0x4a733e;};}function handleError(_0x314636,_0x1408b2){_0x1408b2=_0x1408b2||0x1f4;return function(_0x54536b){logger[_0x73a8('0x28')](_0x54536b[_0x73a8('0x29')]);if(_0x54536b[_0x73a8('0x2a')]){delete _0x54536b[_0x73a8('0x2a')];}_0x314636[_0x73a8('0x18')](_0x1408b2)['send'](_0x54536b);};}exports[_0x73a8('0x2b')]=function(_0x52e2ee,_0x1f1019){var _0x56d14b={},_0x3f1c2d={},_0x18ae8d={'count':0x0,'rows':[]};return db[_0x73a8('0x2c')][_0x73a8('0x2d')]()[_0x73a8('0x22')](function(_0x57efe3){_0x3f1c2d[_0x73a8('0x2e')]=_['keys'](_0x57efe3);_0x3f1c2d['query']=_[_0x73a8('0x2f')](_0x52e2ee[_0x73a8('0x30')]);_0x3f1c2d['filters']=_[_0x73a8('0x31')](_0x3f1c2d[_0x73a8('0x2e')],_0x3f1c2d[_0x73a8('0x30')]);_0x56d14b[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x3f1c2d[_0x73a8('0x2e')],qs[_0x73a8('0x33')](_0x52e2ee['query'][_0x73a8('0x33')]));_0x56d14b[_0x73a8('0x32')]=_0x56d14b[_0x73a8('0x32')][_0x73a8('0x34')]?_0x56d14b[_0x73a8('0x32')]:_0x3f1c2d[_0x73a8('0x2e')];if(!_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x35')]('nolimit')){_0x56d14b[_0x73a8('0x1c')]=qs['limit'](_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x1c')]);_0x56d14b['offset']=qs[_0x73a8('0x19')](_0x52e2ee['query'][_0x73a8('0x19')]);}_0x56d14b[_0x73a8('0x36')]=qs[_0x73a8('0x37')](_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x37')]);_0x56d14b[_0x73a8('0x38')]=qs[_0x73a8('0x39')](_[_0x73a8('0x3a')](_0x52e2ee[_0x73a8('0x30')],_0x3f1c2d[_0x73a8('0x39')]),_0x57efe3);if(_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3b')]){_0x56d14b[_0x73a8('0x38')]=_[_0x73a8('0x3c')](_0x56d14b[_0x73a8('0x38')],{'$or':_[_0x73a8('0x3d')](_0x56d14b[_0x73a8('0x32')],function(_0x51250a){var _0x5bcf80={};_0x5bcf80[_0x51250a]={'$like':'%'+_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3b')]+'%'};return _0x5bcf80;})});}_0x56d14b=_[_0x73a8('0x3c')]({},_0x56d14b,_0x52e2ee[_0x73a8('0x3e')]);var _0xd81353={'where':_0x56d14b[_0x73a8('0x38')]};return db['CmCompany'][_0x73a8('0x1b')](_0xd81353)['then'](function(_0x28d380){_0x18ae8d[_0x73a8('0x1b')]=_0x28d380;if(_0x52e2ee[_0x73a8('0x30')][_0x73a8('0x3f')]){_0x56d14b[_0x73a8('0x40')]=[{'all':!![]}];}return db[_0x73a8('0x2c')][_0x73a8('0x41')](_0x56d14b);})[_0x73a8('0x22')](function(_0x260a66){_0x18ae8d['rows']=_0x260a66;return _0x18ae8d;})[_0x73a8('0x22')](respondWithFilteredResult(_0x1f1019,_0x56d14b))[_0x73a8('0x42')](handleError(_0x1f1019,null));})['catch'](handleError(_0x1f1019,null));};exports[_0x73a8('0x43')]=function(_0x41492f,_0x1ec88f){var _0x1a0458={'raw':![],'where':{'id':_0x41492f[_0x73a8('0x44')]['id']}},_0x1ee843={};_0x1ee843[_0x73a8('0x2e')]=_[_0x73a8('0x2f')](db[_0x73a8('0x2c')][_0x73a8('0x45')]);_0x1ee843[_0x73a8('0x30')]=_[_0x73a8('0x2f')](_0x41492f[_0x73a8('0x30')]);_0x1ee843[_0x73a8('0x39')]=_[_0x73a8('0x31')](_0x1ee843[_0x73a8('0x2e')],_0x1ee843[_0x73a8('0x30')]);_0x1a0458[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x1ee843[_0x73a8('0x2e')],qs['fields'](_0x41492f['query'][_0x73a8('0x33')]));_0x1a0458[_0x73a8('0x32')]=_0x1a0458[_0x73a8('0x32')]['length']?_0x1a0458['attributes']:_0x1ee843[_0x73a8('0x2e')];if(_0x41492f[_0x73a8('0x30')][_0x73a8('0x3f')]){_0x1a0458[_0x73a8('0x40')]=[{'all':!![]}];}_0x1a0458=_['merge']({},_0x1a0458,_0x41492f[_0x73a8('0x3e')]);return db[_0x73a8('0x2c')][_0x73a8('0x46')](_0x1a0458)['then'](handleEntityNotFound(_0x1ec88f,null))[_0x73a8('0x22')](respondWithResult(_0x1ec88f,null))['catch'](handleError(_0x1ec88f,null));};exports[_0x73a8('0x47')]=function(_0x5b2672,_0x4d5f28){return db[_0x73a8('0x2c')][_0x73a8('0x47')](_0x5b2672[_0x73a8('0x48')],{})['then'](function(_0x1ce0b3){var _0x3fd0d3=_0x5b2672['user']['get']({'plain':!![]});if(!_0x3fd0d3)throw new Error(_0x73a8('0x49'));if(_0x3fd0d3[_0x73a8('0x4a')]===_0x73a8('0x4b')){var _0x37ed83=_0x1ce0b3[_0x73a8('0x24')]({'plain':!![]});var _0x2656fa=_0x73a8('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x2656fa,'userProfileId':_0x3fd0d3['userProfileId']},'raw':!![]})[_0x73a8('0x22')](function(_0x51c922){if(_0x51c922&&_0x51c922['autoAssociation']===0x0){return db[_0x73a8('0x26')][_0x73a8('0x47')]({'name':_0x37ed83[_0x73a8('0x2a')],'resourceId':_0x37ed83['id'],'type':_0x51c922[_0x73a8('0x2a')],'sectionId':_0x51c922['id']},{})['then'](function(){return _0x1ce0b3;});}else{return _0x1ce0b3;}})[_0x73a8('0x42')](function(_0x58d4da){logger[_0x73a8('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d4da);throw _0x58d4da;});}return _0x1ce0b3;})[_0x73a8('0x22')](respondWithResult(_0x4d5f28,0xc9))[_0x73a8('0x42')](handleError(_0x4d5f28,null));};exports['update']=function(_0x265898,_0x181f30){if(_0x265898['body']['id']){delete _0x265898['body']['id'];}return db['CmCompany'][_0x73a8('0x46')]({'where':{'id':_0x265898[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x181f30,null))[_0x73a8('0x22')](saveUpdates(_0x265898[_0x73a8('0x48')],null))['then'](respondWithResult(_0x181f30,null))[_0x73a8('0x42')](handleError(_0x181f30,null));};exports[_0x73a8('0x23')]=function(_0x2a7bbd,_0x5d9242){return db[_0x73a8('0x2c')][_0x73a8('0x46')]({'where':{'id':_0x2a7bbd[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x5d9242,null))[_0x73a8('0x22')](removeEntity(_0x5d9242,null))[_0x73a8('0x42')](handleError(_0x5d9242,null));};exports[_0x73a8('0x2d')]=function(_0x422d8c,_0x2973fe){return db[_0x73a8('0x2c')]['describe']()[_0x73a8('0x22')](respondWithResult(_0x2973fe,null))['catch'](handleError(_0x2973fe,null));};exports['addContacts']=function(_0x37031f,_0x5d9203,_0x5f5c2d){return db['CmContact'][_0x73a8('0x46')]({'where':{'id':_0x37031f[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x5d9203,null))['then'](function(_0x5130e5){if(_0x5130e5){return _0x5130e5[_0x73a8('0x4c')](_0x37031f[_0x73a8('0x48')]['ids'],_[_0x73a8('0x4d')](_0x37031f[_0x73a8('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x5d9203,null))[_0x73a8('0x42')](handleError(_0x5d9203,null));};exports[_0x73a8('0x4e')]=function(_0x3936b7,_0x8d786e,_0x1b0cc2){var _0x3d3292={};var _0x5eae7a={};var _0x51c9fc;var _0x170151;return db[_0x73a8('0x2c')][_0x73a8('0x4f')]({'where':{'id':_0x3936b7[_0x73a8('0x44')]['id']}})[_0x73a8('0x22')](handleEntityNotFound(_0x8d786e,null))[_0x73a8('0x22')](function(_0x563595){if(_0x563595){_0x51c9fc=_0x563595;_0x5eae7a[_0x73a8('0x2e')]=_[_0x73a8('0x2f')](db[_0x73a8('0x50')][_0x73a8('0x45')]);_0x5eae7a[_0x73a8('0x30')]=_[_0x73a8('0x2f')](_0x3936b7[_0x73a8('0x30')]);_0x5eae7a['filters']=_[_0x73a8('0x31')](_0x5eae7a[_0x73a8('0x2e')],_0x5eae7a[_0x73a8('0x30')]);_0x3d3292[_0x73a8('0x32')]=_[_0x73a8('0x31')](_0x5eae7a[_0x73a8('0x2e')],qs['fields'](_0x3936b7['query'][_0x73a8('0x33')]));_0x3d3292[_0x73a8('0x32')]=_0x3d3292['attributes']['length']?_0x3d3292[_0x73a8('0x32')]:_0x5eae7a[_0x73a8('0x2e')];_0x3d3292['order']=qs['sort'](_0x3936b7[_0x73a8('0x30')]['sort']);_0x3d3292[_0x73a8('0x38')]=qs[_0x73a8('0x39')](_[_0x73a8('0x3a')](_0x3936b7[_0x73a8('0x30')],_0x5eae7a[_0x73a8('0x39')]));if(_0x3936b7[_0x73a8('0x30')]['filter']){_0x3d3292[_0x73a8('0x38')]=_[_0x73a8('0x3c')](_0x3d3292[_0x73a8('0x38')],{'$or':_[_0x73a8('0x3d')](_0x3d3292['attributes'],function(_0x5edc1e){var _0x3d045f={};_0x3d045f[_0x5edc1e]={'$like':'%'+_0x3936b7[_0x73a8('0x30')]['filter']+'%'};return _0x3d045f;})});}_0x3d3292=_['merge']({},_0x3d3292,_0x3936b7[_0x73a8('0x3e')]);return _0x51c9fc[_0x73a8('0x4e')](_0x3d3292);}})[_0x73a8('0x22')](function(_0x3ac4cf){if(_0x3ac4cf){_0x170151=_0x3ac4cf[_0x73a8('0x34')];if(!_0x3936b7['query'][_0x73a8('0x35')](_0x73a8('0x51'))){_0x3d3292[_0x73a8('0x1c')]=qs[_0x73a8('0x1c')](_0x3936b7['query'][_0x73a8('0x1c')]);_0x3d3292[_0x73a8('0x19')]=qs[_0x73a8('0x19')](_0x3936b7[_0x73a8('0x30')][_0x73a8('0x19')]);}return _0x51c9fc[_0x73a8('0x4e')](_0x3d3292);}})[_0x73a8('0x22')](function(_0x5ed8c3){if(_0x5ed8c3){return _0x5ed8c3?{'count':_0x170151,'rows':_0x5ed8c3}:null;}})[_0x73a8('0x22')](respondWithResult(_0x8d786e,null))[_0x73a8('0x42')](handleError(_0x8d786e,null));};
\ No newline at end of file
index e50af64..4fd0d3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf433=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','lodash','api'];(function(_0x1e6015,_0x2af67b){var _0x58a3d9=function(_0x5520d2){while(--_0x5520d2){_0x1e6015['push'](_0x1e6015['shift']());}};_0x58a3d9(++_0x2af67b);}(_0xf433,0x66));var _0x3f43=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf433[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3f43('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3f43('0x1'));var moment=require(_0x3f43('0x2'));var BPromise=require(_0x3f43('0x3'));var rp=require(_0x3f43('0x4'));var fs=require('fs');var path=require(_0x3f43('0x5'));var rimraf=require(_0x3f43('0x6'));var config=require(_0x3f43('0x7'));var attributes=require(_0x3f43('0x8'));module[_0x3f43('0x9')]=function(_0x36dac7,_0x278132){return _0x36dac7[_0x3f43('0xa')](_0x3f43('0xb'),attributes,{'tableName':_0x3f43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8f3=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xb8f3,0x138));var _0x3b8f=function(_0x328cdc,_0xe9775){_0x328cdc=_0x328cdc-0x0;var _0x17eea7=_0xb8f3[_0x328cdc];return _0x17eea7;};'use strict';var _=require('lodash');var util=require(_0x3b8f('0x0'));var logger=require(_0x3b8f('0x1'))(_0x3b8f('0x2'));var moment=require(_0x3b8f('0x3'));var BPromise=require(_0x3b8f('0x4'));var rp=require(_0x3b8f('0x5'));var fs=require('fs');var path=require(_0x3b8f('0x6'));var rimraf=require('rimraf');var config=require(_0x3b8f('0x7'));var attributes=require(_0x3b8f('0x8'));module[_0x3b8f('0x9')]=function(_0x25b49e,_0x7d6bd8){return _0x25b49e[_0x3b8f('0xa')](_0x3b8f('0xb'),attributes,{'tableName':_0x3b8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 289381c..8d07cda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec89=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0xec89,0x123));var _0x9ec8=function(_0x236174,_0x3c8f93){_0x236174=_0x236174-0x0;var _0x3b2486=_0xec89[_0x236174];return _0x3b2486;};'use strict';var _=require(_0x9ec8('0x0'));var util=require('util');var moment=require(_0x9ec8('0x1'));var BPromise=require(_0x9ec8('0x2'));var rs=require(_0x9ec8('0x3'));var fs=require('fs');var Redis=require(_0x9ec8('0x4'));var db=require(_0x9ec8('0x5'))['db'];var utils=require(_0x9ec8('0x6'));var logger=require(_0x9ec8('0x7'))('rpc');var config=require(_0x9ec8('0x8'));var jayson=require(_0x9ec8('0x9'));var client=jayson['client'][_0x9ec8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x167e6b,_0x4070e4,_0x1d0966){return new BPromise(function(_0x23f674,_0xed07d8){return client[_0x9ec8('0xb')](_0x167e6b,_0x1d0966)[_0x9ec8('0xc')](function(_0x4a982e){logger[_0x9ec8('0xd')](_0x9ec8('0xe'),_0x4070e4,_0x9ec8('0xf'));logger[_0x9ec8('0x10')](_0x9ec8('0x11'),_0x4070e4,'request\x20sent',JSON[_0x9ec8('0x12')](_0x4a982e));if(_0x4a982e['error']){if(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x14')]===0x1f4){logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);return _0xed07d8(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);}logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x4a982e[_0x9ec8('0x13')]['message']);return _0x23f674(_0x4a982e[_0x9ec8('0x13')][_0x9ec8('0x15')]);}else{logger[_0x9ec8('0xd')]('CmCompany,\x20%s,\x20%s',_0x4070e4,_0x9ec8('0xf'));_0x23f674(_0x4a982e[_0x9ec8('0x16')][_0x9ec8('0x15')]);}})[_0x9ec8('0x17')](function(_0x352e54){logger[_0x9ec8('0x13')](_0x9ec8('0xe'),_0x4070e4,_0x352e54);_0xed07d8(_0x352e54);});});}
\ No newline at end of file
+var _0xe5fe=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0xa0be1c,_0x152d5d){var _0x546eec=function(_0x371eae){while(--_0x371eae){_0xa0be1c['push'](_0xa0be1c['shift']());}};_0x546eec(++_0x152d5d);}(_0xe5fe,0xcf));var _0xee5f=function(_0x2265c0,_0x24881e){_0x2265c0=_0x2265c0-0x0;var _0x27a246=_0xe5fe[_0x2265c0];return _0x27a246;};'use strict';var _=require(_0xee5f('0x0'));var util=require(_0xee5f('0x1'));var moment=require(_0xee5f('0x2'));var BPromise=require(_0xee5f('0x3'));var rs=require(_0xee5f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee5f('0x5'))['db'];var utils=require(_0xee5f('0x6'));var logger=require(_0xee5f('0x7'))(_0xee5f('0x8'));var config=require('../../config/environment');var jayson=require(_0xee5f('0x9'));var client=jayson[_0xee5f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d795c,_0x2adeee,_0x3a5632){return new BPromise(function(_0x4f8f8e,_0x51864){return client[_0xee5f('0xb')](_0x1d795c,_0x3a5632)['then'](function(_0x54e939){logger[_0xee5f('0xc')](_0xee5f('0xd'),_0x2adeee,_0xee5f('0xe'));logger[_0xee5f('0xf')](_0xee5f('0x10'),_0x2adeee,_0xee5f('0xe'),JSON[_0xee5f('0x11')](_0x54e939));if(_0x54e939[_0xee5f('0x12')]){if(_0x54e939[_0xee5f('0x12')]['code']===0x1f4){logger[_0xee5f('0x12')]('CmCompany,\x20%s,\x20%s',_0x2adeee,_0x54e939['error']['message']);return _0x51864(_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);}logger[_0xee5f('0x12')](_0xee5f('0xd'),_0x2adeee,_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);return _0x4f8f8e(_0x54e939[_0xee5f('0x12')][_0xee5f('0x13')]);}else{logger['info'](_0xee5f('0xd'),_0x2adeee,_0xee5f('0xe'));_0x4f8f8e(_0x54e939[_0xee5f('0x14')][_0xee5f('0x13')]);}})[_0xee5f('0x15')](function(_0x340d2d){logger[_0xee5f('0x12')](_0xee5f('0xd'),_0x2adeee,_0x340d2d);_0x51864(_0x340d2d);});});}
\ No newline at end of file
index ebdc60b..02c9a0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dad=['getContacts','post','create','addContacts','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts'];(function(_0x1e9fa9,_0xaaee57){var _0xcb4baf=function(_0x492425){while(--_0x492425){_0x1e9fa9['push'](_0x1e9fa9['shift']());}};_0xcb4baf(++_0xaaee57);}(_0x2dad,0x1cf));var _0xd2da=function(_0x5e0672,_0xef3b77){_0x5e0672=_0x5e0672-0x0;var _0x3fba57=_0x2dad[_0x5e0672];return _0x3fba57;};'use strict';var multer=require(_0xd2da('0x0'));var util=require(_0xd2da('0x1'));var path=require(_0xd2da('0x2'));var timeout=require(_0xd2da('0x3'));var express=require(_0xd2da('0x4'));var router=express[_0xd2da('0x5')]();var fs_extra=require(_0xd2da('0x6'));var auth=require(_0xd2da('0x7'));var interaction=require(_0xd2da('0x8'));var config=require(_0xd2da('0x9'));var controller=require('./cmCompany.controller');router[_0xd2da('0xa')]('/',auth[_0xd2da('0xb')](),controller[_0xd2da('0xc')]);router['get']('/describe',auth[_0xd2da('0xb')](),controller[_0xd2da('0xd')]);router['get'](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller[_0xd2da('0xf')]);router[_0xd2da('0xa')](_0xd2da('0x10'),auth['isAuthenticated'](),controller[_0xd2da('0x11')]);router[_0xd2da('0x12')]('/',auth[_0xd2da('0xb')](),controller[_0xd2da('0x13')]);router[_0xd2da('0x12')]('/:id/contacts',auth['isAuthenticated'](),controller[_0xd2da('0x14')]);router['put'](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller[_0xd2da('0x15')]);router[_0xd2da('0x16')](_0xd2da('0xe'),auth[_0xd2da('0xb')](),controller['destroy']);module[_0xd2da('0x17')]=router;
\ No newline at end of file
+var _0x8d6f=['path','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','post','create','addContacts','put','update','delete','destroy','exports','multer','util'];(function(_0x30d9c4,_0x40244c){var _0x1c7dfa=function(_0xc3ad49){while(--_0xc3ad49){_0x30d9c4['push'](_0x30d9c4['shift']());}};_0x1c7dfa(++_0x40244c);}(_0x8d6f,0xa9));var _0xf8d6=function(_0x1fd2e5,_0x4ed9ea){_0x1fd2e5=_0x1fd2e5-0x0;var _0x3fe02d=_0x8d6f[_0x1fd2e5];return _0x3fe02d;};'use strict';var multer=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var path=require(_0xf8d6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf8d6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf8d6('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf8d6('0x5'));var controller=require('./cmCompany.controller');router[_0xf8d6('0x6')]('/',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0x8')]);router[_0xf8d6('0x6')](_0xf8d6('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf8d6('0x6')](_0xf8d6('0xa'),auth[_0xf8d6('0x7')](),controller['show']);router['get']('/:id/contacts',auth[_0xf8d6('0x7')](),controller['getContacts']);router[_0xf8d6('0xb')]('/',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xc')]);router[_0xf8d6('0xb')]('/:id/contacts',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xd')]);router[_0xf8d6('0xe')](_0xf8d6('0xa'),auth[_0xf8d6('0x7')](),controller[_0xf8d6('0xf')]);router[_0xf8d6('0x10')]('/:id',auth[_0xf8d6('0x7')](),controller[_0xf8d6('0x11')]);module[_0xf8d6('0x12')]=router;
\ No newline at end of file
index 8349a48..fc50ebd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c4e=['lodash','sequelize','STRING','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6c4e,0xb6));var _0xe6c4=function(_0x42a587,_0x40e417){_0x42a587=_0x42a587-0x0;var _0x33965a=_0x6c4e[_0x42a587];return _0x33965a;};'use strict';var _=require(_0xe6c4('0x0'));var Sequelize=require(_0xe6c4('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xe6c4('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xe6c4('0x2')]},'city':{'type':Sequelize[_0xe6c4('0x2')]},'country':{'type':Sequelize[_0xe6c4('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe6c4('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xe6c4('0x2')]},'fax':{'type':Sequelize[_0xe6c4('0x2')]},'email':{'type':Sequelize[_0xe6c4('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xe6c4('0x2')]},'fb_data':{'type':Sequelize[_0xe6c4('0x2')]},'twitter':{'type':Sequelize[_0xe6c4('0x2')]},'skype':{'type':Sequelize[_0xe6c4('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xe6c4('0x2')]},'line':{'type':Sequelize[_0xe6c4('0x2')]},'wechat':{'type':Sequelize[_0xe6c4('0x2')]},'telegram':{'type':Sequelize[_0xe6c4('0x2')]},'UserId':{'type':Sequelize[_0xe6c4('0x3')]},'AdditionalPhones':{'type':Sequelize[_0xe6c4('0x2')]},'priority':{'type':Sequelize[_0xe6c4('0x3')](0x2)[_0xe6c4('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe6c4('0x5')],'defaultValue':Sequelize[_0xe6c4('0x6')]},'dialTimezone':{'type':Sequelize[_0xe6c4('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc844=['NOW','lodash','exports','STRING','INTEGER','DATE'];(function(_0x406c64,_0x89d983){var _0x3ca465=function(_0x3d1c9c){while(--_0x3d1c9c){_0x406c64['push'](_0x406c64['shift']());}};_0x3ca465(++_0x89d983);}(_0xc844,0xdf));var _0x4c84=function(_0x6da2f,_0x300a55){_0x6da2f=_0x6da2f-0x0;var _0x3adae1=_0xc844[_0x6da2f];return _0x3adae1;};'use strict';var _=require(_0x4c84('0x0'));var Sequelize=require('sequelize');module[_0x4c84('0x1')]={'firstName':{'type':Sequelize[_0x4c84('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x4c84('0x2')]},'postalCode':{'type':Sequelize[_0x4c84('0x2')]},'city':{'type':Sequelize[_0x4c84('0x2')]},'country':{'type':Sequelize[_0x4c84('0x2')]},'dateOfBirth':{'type':Sequelize[_0x4c84('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4c84('0x2')]},'mobile':{'type':Sequelize[_0x4c84('0x2')]},'fax':{'type':Sequelize[_0x4c84('0x2')]},'email':{'type':Sequelize[_0x4c84('0x2')]},'url':{'type':Sequelize[_0x4c84('0x2')]},'facebook':{'type':Sequelize[_0x4c84('0x2')]},'fb_data':{'type':Sequelize[_0x4c84('0x2')]},'twitter':{'type':Sequelize[_0x4c84('0x2')]},'skype':{'type':Sequelize[_0x4c84('0x2')]},'teams':{'type':Sequelize[_0x4c84('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x4c84('0x2')]},'wechat':{'type':Sequelize[_0x4c84('0x2')]},'telegram':{'type':Sequelize[_0x4c84('0x2')]},'UserId':{'type':Sequelize[_0x4c84('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x4c84('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4c84('0x4')],'defaultValue':Sequelize[_0x4c84('0x5')]},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x4c84('0x3')]}};
\ No newline at end of file
index fef9141..b7fdcc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));};
\ No newline at end of file
+var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6<Object[_0x0a9e('0x25')](_0x140511)['length'];_0x11c3b6++){var _0x3652a7=Object[_0x0a9e('0x25')](_0x140511)[_0x11c3b6];if(!_[_0x0a9e('0x26')](_0x3652a7,_0x0a9e('0x27'))){_0x140511[_0x3652a7]['columnName']=_0x3652a7;_0x140511[_0x3652a7][_0x0a9e('0x28')]=_0x3652a7;}}return _0x140511;})[_0x0a9e('0x15')](function(_0x1843b2){var _0x824a4f={'where':Boolean(_0x5bfb33[_0x0a9e('0x1e')][_0x0a9e('0x29')])===!![]?undefined:{'$or':[{'ListId':_0x5bfb33[_0x0a9e('0x1e')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x824a4f)['then'](function(_0x426950){for(var _0x5d1e0e=0x0;_0x5d1e0e<_0x426950[_0x0a9e('0x2b')];_0x5d1e0e++){var _0x3ae878=_0x0a9e('0x27')+_0x426950[_0x5d1e0e]['id'];_0x1843b2[_0x3ae878][_0x0a9e('0x2c')]=_0x3ae878;_0x1843b2[_0x3ae878][_0x0a9e('0x28')]=_0x426950[_0x5d1e0e]['alias'];_0x1843b2[_0x3ae878][_0x0a9e('0x2d')]={'type':_0x426950[_0x5d1e0e][_0x0a9e('0x2e')],'values':_0x426950[_0x5d1e0e][_0x0a9e('0x2f')]};}Object[_0x0a9e('0x25')](_0x1843b2)[_0x0a9e('0x30')](function(_0x409319){if(!_0x1843b2[_0x409319][_0x0a9e('0x31')](_0x0a9e('0x2c'))){delete _0x1843b2[_0x409319];}});return _0x1843b2;});})['then'](respondWithResult(_0x1dc186,null))[_0x0a9e('0x20')](handleError(_0x1dc186,null));};exports['merge']=function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f;var _0x3f3d41;var _0x567193;if(_0x2cc7a0[_0x0a9e('0x32')]['id']){delete _0x2cc7a0[_0x0a9e('0x32')]['id'];}return db[_0x0a9e('0x21')][_0x0a9e('0x1d')]({'where':{'id':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}})['then'](function(_0x24936a){if(_0x24936a){if(_0x24936a[_0x0a9e('0x2b')]!==0x2){return null;}_0x24936a[0x0]=_0x24936a[0x0][_0x0a9e('0x34')]({'plain':!![]});_0x24936a[0x1]=_0x24936a[0x1][_0x0a9e('0x34')]({'plain':!![]});delete _0x24936a[0x0]['id'];delete _0x24936a[0x1]['id'];return _['mergeWith'](_0x24936a[0x0],_0x24936a[0x1],function(_0x31916f,_0x3bfce8){if(Array[_0x0a9e('0x35')](_0x3bfce8)&&!_0x3bfce8['length']){return _0x31916f;}else if(!_0x3bfce8){return _0x31916f;}});}})[_0x0a9e('0x15')](handleEntityNotFound(_0x14b13f,null))[_0x0a9e('0x15')](function(_0x289467){if(_0x289467){if(_0x289467['tags']&&_['isArray'](_0x289467[_0x0a9e('0x24')])){_0x289467[_0x0a9e('0x24')]=_0x289467['tags'][_0x0a9e('0x36')]();}logger[_0x0a9e('0x37')](_0x0a9e('0x38'),_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body']['from']);return db[_0x0a9e('0x39')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x5b4f5e){logger[_0x0a9e('0x37')](_0x0a9e('0x3a'),_0x5b4f5e);return db[_0x0a9e('0x3b')][_0x0a9e('0x16')]({'where':{'ContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}})[_0x0a9e('0x15')](function(_0x23b089){logger[_0x0a9e('0x37')](_0x0a9e('0x3c'),_0x23b089);return db[_0x0a9e('0x21')][_0x0a9e('0x3d')](_0x289467);});});}})[_0x0a9e('0x15')](function(_0x37f6cc){if(_0x37f6cc){_0x2b7e7f=_0x37f6cc;_0x3f3d41={'ContactId':_0x2b7e7f['id']};_0x567193={'where':{'ContactId':[_0x2cc7a0['body']['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}};return db[_0x0a9e('0x3e')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x40')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x41')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x42')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x43')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x44')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x45')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x46')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x47')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x48')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x49')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4a')][_0x0a9e('0x3f')]({'CmContactId':_0x2b7e7f['id']},{'where':{'CmContactId':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0[_0x0a9e('0x32')][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4b')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['CmHopperHistory']['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4c')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4d')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4e')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db['FaxQueueReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x4f')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x50')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x51')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db['JscriptySessionReport'][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x52')]['update'](_0x3f3d41,_0x567193);}})[_0x0a9e('0x15')](function(){if(_0x2b7e7f){return db[_0x0a9e('0x53')]['update'](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x54')][_0x0a9e('0x3f')](_0x3f3d41,_0x567193);}})['then'](function(){if(_0x2b7e7f){return db[_0x0a9e('0x21')]['destroy']({'where':{'id':[_0x2cc7a0[_0x0a9e('0x32')]['to'],_0x2cc7a0['body'][_0x0a9e('0x33')]]}});}})['then'](function(){if(_0x2b7e7f){return _0x2b7e7f;}})['then'](respondWithResult(_0x14b13f,null))['catch'](handleError(_0x14b13f,null));};exports[_0x0a9e('0x3d')]=function(_0x47de4c,_0x2f7092){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x232830){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]&&_[_0x0a9e('0x35')](_0x47de4c['body'][_0x0a9e('0x24')])){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')][_0x0a9e('0x2b')]){_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x24')]=_0x47de4c['body'][_0x0a9e('0x24')][_0x0a9e('0x36')](';')+';';}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}}else{_0x47de4c['body'][_0x0a9e('0x24')]=null;}if(!_['isNil'](_0x47de4c['body']['dialTimezone'])){var _0x273cb5=_0x47de4c['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x273cb5]))_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x273cb5]['utcOffset'];}return db[_0x0a9e('0x21')]['create'](_0x47de4c[_0x0a9e('0x32')],{'fields':_[_0x0a9e('0x25')](_0x232830),'raw':!![]});})[_0x0a9e('0x15')](function(_0x5adf8f){if(_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]){return insertAdditionalPhones(_0x5adf8f,_0x47de4c[_0x0a9e('0x32')][_0x0a9e('0x59')]);}else{return _0x5adf8f;}})['then'](respondWithResult(_0x2f7092,0xc9))[_0x0a9e('0x20')](handleError(_0x2f7092,null));};exports[_0x0a9e('0x5a')]=function(_0x54327c,_0x797b45){var _0x17e88c=0x0;var _0x88dcbf=0x0;var _0x409b29=0x0;var _0x401837=[];return db['CmContact'][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x281c7d){return BPromise['each'](_0x54327c[_0x0a9e('0x32')],function(_0x4f1e60){var _0x5211e3={'where':{'$or':[]},'defaults':_0x4f1e60,'fields':_[_0x0a9e('0x25')](_0x281c7d),'raw':!![]};if(_0x4f1e60[_0x0a9e('0x5b')]){for(var _0x9375fb=0x0;_0x9375fb<_0x4f1e60[_0x0a9e('0x5b')][_0x0a9e('0x2b')];_0x9375fb++){var _0xc8c264={};_0xc8c264[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]]=_0x4f1e60[_0x4f1e60[_0x0a9e('0x5b')][_0x9375fb]];_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5d')][_0x0a9e('0x5e')](_0xc8c264);}_0x5211e3[_0x0a9e('0x5c')][_0x0a9e('0x5f')]=_0x4f1e60[_0x0a9e('0x5f')];}return db[_0x0a9e('0x21')][_0x0a9e('0x60')](_0x5211e3)[_0x0a9e('0x61')](function(_0x4257c9,_0x5150a4){if(_0x5150a4){if(_0x4f1e60[_0x0a9e('0x31')](_0x0a9e('0x59'))){_0x401837[_0x0a9e('0x5e')]({'contact':_0x4257c9,'additionalPhones':_0x4f1e60['additionalPhones']});}_0x17e88c++;}else{_0x409b29++;}})[_0x0a9e('0x20')](function(){_0x88dcbf++;});});})[_0x0a9e('0x15')](function(_0x4b341d){if(_0x4b341d){if(_0x401837[_0x0a9e('0x2b')]>0x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));};
\ No newline at end of file
index f1cf0d5..5146eae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbe5=['CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x5c814d,_0x4d81c7){var _0x89b71=function(_0x1068a4){while(--_0x1068a4){_0x5c814d['push'](_0x5c814d['shift']());}};_0x89b71(++_0x4d81c7);}(_0xdbe5,0x155));var _0x5dbe=function(_0x4852e2,_0x30b070){_0x4852e2=_0x4852e2-0x0;var _0x39e5b4=_0xdbe5[_0x4852e2];return _0x39e5b4;};'use strict';var EventEmitter=require('events');var CmContact=require(_0x5dbe('0x0'))['db'][_0x5dbe('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x5dbe('0x2')](0x0);var events={'afterCreate':_0x5dbe('0x3'),'afterUpdate':_0x5dbe('0x4'),'afterDestroy':_0x5dbe('0x5')};function emitEvent(_0x1a837d){return function(_0xd0985a,_0x4c0074,_0x1a1533){CmContactEvents[_0x5dbe('0x6')](_0x1a837d+':'+_0xd0985a['id'],_0xd0985a);CmContactEvents[_0x5dbe('0x6')](_0x1a837d,_0xd0985a);_0x1a1533(null);};}for(var e in events){if(events[_0x5dbe('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0x5dbe('0x8')]=CmContactEvents;
\ No newline at end of file
+var _0xdb1e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4470c0,_0x5b9cd1){var _0x2c079a=function(_0x1a91c5){while(--_0x1a91c5){_0x4470c0['push'](_0x4470c0['shift']());}};_0x2c079a(++_0x5b9cd1);}(_0xdb1e,0x85));var _0xedb1=function(_0x48a889,_0x450112){_0x48a889=_0x48a889-0x0;var _0x2bf9c6=_0xdb1e[_0x48a889];return _0x2bf9c6;};'use strict';var EventEmitter=require(_0xedb1('0x0'));var CmContact=require(_0xedb1('0x1'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xedb1('0x2')](0x0);var events={'afterCreate':_0xedb1('0x3'),'afterUpdate':_0xedb1('0x4'),'afterDestroy':_0xedb1('0x5')};function emitEvent(_0x244901){return function(_0x369234,_0x25ec4c,_0x5b318b){CmContactEvents['emit'](_0x244901+':'+_0x369234['id'],_0x369234);CmContactEvents[_0xedb1('0x6')](_0x244901,_0x369234);_0x5b318b(null);};}for(var e in events){if(events[_0xedb1('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module[_0xedb1('0x8')]=CmContactEvents;
\ No newline at end of file
index a481b1f..788dcbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee8b=['CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','callbackUniqueid','catch','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','Campaign','add','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','VoiceQueue','dialCheckDuplicateType','CmList','Lists','get','always','onlyIfOpen','findAll','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','List\x20not\x20found','isEmpty','CampaignId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','../../config/logger','moment','request-promise','../../config/environment','../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4_unicode_ci','error','cmContact','afterCreate','inspect','scheduledat','format','dialTimezone','findOne','then','isNil','timezones','utcOffset','minutes','YYYY-MM-DD\x20HH:mm:ss','ret'];(function(_0x3e15f9,_0x2a9eb1){var _0x30b77b=function(_0x6553a8){while(--_0x6553a8){_0x3e15f9['push'](_0x3e15f9['shift']());}};_0x30b77b(++_0x2a9eb1);}(_0xee8b,0x183));var _0xbee8=function(_0x25365c,_0x1dff0d){_0x25365c=_0x25365c-0x0;var _0x3b479d=_0xee8b[_0x25365c];return _0x3b479d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbee8('0x0'))('api');var moment=require(_0xbee8('0x1'));var BPromise=require('bluebird');var rp=require(_0xbee8('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbee8('0x3'));var shared=require(_0xbee8('0x4'));var attributes=require(_0xbee8('0x5'));module[_0xbee8('0x6')]=function(_0x3618c9,_0x44a25f){return _0x3618c9[_0xbee8('0x7')](_0xbee8('0x8'),attributes,{'tableName':_0xbee8('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xbee8('0xa')]},{'name':'fti_cm_contacts','fields':[_0xbee8('0xb'),_0xbee8('0xc'),'phone',_0xbee8('0xd'),_0xbee8('0xe'),_0xbee8('0xf')],'type':_0xbee8('0x10')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xbee8('0x11'),'hooks':{'afterCreate':function(_0x105547,_0xa40d6e,_0x9c042b){var _0x314f91=_0x3618c9['models'];var _0x3c58a9=_0x105547['get']({'plain':!![]});function _0x5090e4(){return function(_0x5e0dd1){logger[_0xbee8('0x12')](_0xbee8('0x13'),_0xbee8('0x14'),util[_0xbee8('0x15')](_0x5e0dd1,{'showHidden':![],'depth':null}));};}function _0x27b518(_0x27f538,_0x335184){var _0x74a77f=_0x335184[_0xbee8('0x16')]?_0x335184[_0xbee8('0x16')]:moment()[_0xbee8('0x17')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x1ed7e6,_0x4b4d6a){if(_['isNil'](_0x335184[_0xbee8('0x18')])){_0x1ed7e6({'ret':_0x74a77f});}else{_0x314f91['VoiceQueue'][_0xbee8('0x19')]({'where':{'id':_0x27f538['id']}})[_0xbee8('0x1a')](function(_0x1e441c){if(!_[_0xbee8('0x1b')](_0x1e441c)){var _0x22eff=_0x1e441c[_0xbee8('0x18')];if(!_[_0xbee8('0x1b')](_0x22eff)){var _0x8581b3=shared[_0xbee8('0x1c')];var _0x5f11b5=_0x8581b3[_0x22eff];var _0x324a49=_0x8581b3[_0x335184[_0xbee8('0x18')]];if(!_[_0xbee8('0x1b')](_0x5f11b5)&&!_['isNil'](_0x324a49)){var _0x33dcf6=_0x5f11b5['utcOffset']-_0x324a49[_0xbee8('0x1d')];_0x74a77f=_0x335184['scheduledat']?_0x335184[_0xbee8('0x16')]:moment();var _0x1c6e55=moment(_0x74a77f)['add'](_0x33dcf6,_0xbee8('0x1e'));_0x1ed7e6({'ret':_0x1c6e55[_0xbee8('0x17')](_0xbee8('0x1f'))});}else _0x1ed7e6({'ret':_0x74a77f});}else _0x1ed7e6({'ret':_0x74a77f});}else{_0x1ed7e6({'ret':_0x74a77f});}});}});return 0xa;}var _0x5b9be6=function(_0x173f68){return new BPromise(function(_0xde7329,_0x2c7e7b){_0x27b518(_0x173f68,_0x3c58a9)['then'](function(_0x50b7a5){_0x3c58a9['scheduledat']=_0x50b7a5[_0xbee8('0x20')];_0x314f91[_0xbee8('0x21')]['findOne']({'where':{'phone':_0x3c58a9[_0xbee8('0xa')],'VoiceQueueId':_0x173f68['id']}})[_0xbee8('0x1a')](function(_0x573fa2){if(!_[_0xbee8('0x1b')](_0x573fa2)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3c58a9[_0xbee8('0xa')]+_0xbee8('0x22')+_0x173f68['id']);}return _0x314f91[_0xbee8('0x21')]['create']({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9['ListId'],'priority':_0x3c58a9['priority']?_0x3c58a9[_0xbee8('0x23')]:0x2,'scheduledat':_0x3c58a9['scheduledat']?_0x3c58a9['scheduledat']:moment()[_0xbee8('0x17')](_0xbee8('0x1f')),'callback':_0x3c58a9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3c58a9[_0xbee8('0x24')]?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9[_0xbee8('0x24')]?moment()['format'](_0xbee8('0x1f')):undefined,'VoiceQueueId':_0x173f68['id']});})[_0xbee8('0x25')](function(_0x22420b){_0x2c7e7b(_0x22420b);});});});};var _0x2eb645=function(_0x40ac88){return new BPromise(function(_0x741cc9,_0x20af99){_0x27b518(_0x40ac88,_0x3c58a9)['then'](function(_0x22e61c){_0x3c58a9[_0xbee8('0x16')]=_0x22e61c[_0xbee8('0x20')];_0x314f91[_0xbee8('0x21')]['findOne']({'where':{'phone':_0x3c58a9[_0xbee8('0xa')],'VoiceQueueId':_0x40ac88['id']}})[_0xbee8('0x1a')](function(_0x261890){if(!_['isNil'](_0x261890)){throw new Error(_0xbee8('0x26')+_0x3c58a9[_0xbee8('0xa')]+_0xbee8('0x27')+_0x40ac88['id']);}return _0x314f91[_0xbee8('0x28')][_0xbee8('0x19')]({'where':{'calleridnum':_0x3c58a9[_0xbee8('0xa')],'VoiceQueueId':_0x40ac88['id']}});})[_0xbee8('0x1a')](function(_0x3617d3){if(!_[_0xbee8('0x1b')](_0x3617d3)){throw new Error(_0xbee8('0x29')+_0x3c58a9[_0xbee8('0xa')]+_0xbee8('0x2a')+_0x40ac88['id']);}return _0x314f91[_0xbee8('0x21')][_0xbee8('0x2b')]({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'priority':_0x3c58a9['priority']?_0x3c58a9[_0xbee8('0x23')]:0x2,'scheduledat':_0x3c58a9[_0xbee8('0x16')]?_0x3c58a9[_0xbee8('0x16')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3c58a9[_0xbee8('0x24')]?!![]:![],'callbackuniqueid':_0x3c58a9[_0xbee8('0x24')]?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9[_0xbee8('0x24')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x40ac88['id']});})[_0xbee8('0x25')](function(_0x525a07){_0x20af99(_0x525a07);});});});};function _0xe6fc8b(){return function(_0x448812){logger[_0xbee8('0x12')]('cmContact',_0xbee8('0x14'),util[_0xbee8('0x15')](_0x448812,{'showHidden':![],'depth':null}));};}function _0x21a43c(_0x2ec5dc,_0x2d76bf){var _0x49459d=_0x2d76bf[_0xbee8('0x16')]?_0x2d76bf[_0xbee8('0x16')]:moment()[_0xbee8('0x17')](_0xbee8('0x1f'));return new BPromise(function(_0x54df4d,_0x4a1c4a){if(_['isNil'](_0x2d76bf[_0xbee8('0x18')])){_0x54df4d({'ret':_0x49459d});}else{_0x314f91[_0xbee8('0x2d')]['findOne']({'where':{'id':_0x2ec5dc['id']}})['then'](function(_0x136d14){if(!_[_0xbee8('0x1b')](_0x136d14)){var _0x3fe470=_0x136d14[_0xbee8('0x18')];if(!_[_0xbee8('0x1b')](_0x3fe470)){var _0x33077e=shared[_0xbee8('0x1c')];var _0x3be655=_0x33077e[_0x3fe470];var _0x5b8f0c=_0x33077e[_0x2d76bf[_0xbee8('0x18')]];if(!_[_0xbee8('0x1b')](_0x3be655)&&!_[_0xbee8('0x1b')](_0x5b8f0c)){var _0x302359=_0x3be655[_0xbee8('0x1d')]-_0x5b8f0c[_0xbee8('0x1d')];_0x49459d=_0x2d76bf[_0xbee8('0x16')]?_0x2d76bf['scheduledat']:moment();var _0x1a5cff=moment(_0x49459d)[_0xbee8('0x2e')](_0x302359,_0xbee8('0x1e'));_0x54df4d({'ret':_0x1a5cff[_0xbee8('0x17')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x54df4d({'ret':_0x49459d});}else _0x54df4d({'ret':_0x49459d});}else{_0x54df4d({'ret':_0x49459d});}});}});return 0xa;}var _0x1b30cd=function(_0x4016aa){return new BPromise(function(_0x235613,_0x215ba1){_0x21a43c(_0x4016aa,_0x3c58a9)[_0xbee8('0x1a')](function(_0x3bad3f){_0x3c58a9[_0xbee8('0x16')]=_0x3bad3f[_0xbee8('0x20')];_0x314f91[_0xbee8('0x21')][_0xbee8('0x19')]({'where':{'phone':_0x3c58a9[_0xbee8('0xa')],'CampaignId':_0x4016aa['id']}})[_0xbee8('0x1a')](function(_0x1ead3b){if(!_[_0xbee8('0x1b')](_0x1ead3b)){throw new Error(_0xbee8('0x26')+_0x3c58a9[_0xbee8('0xa')]+_0xbee8('0x2f')+_0x4016aa['id']);}return _0x314f91[_0xbee8('0x21')][_0xbee8('0x2b')]({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'priority':_0x3c58a9['priority']?_0x3c58a9[_0xbee8('0x23')]:0x2,'scheduledat':_0x3c58a9['scheduledat']?_0x3c58a9['scheduledat']:moment()['format'](_0xbee8('0x1f')),'callback':_0x3c58a9[_0xbee8('0x24')]?!![]:![],'callbackuniqueid':_0x3c58a9[_0xbee8('0x24')]?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9[_0xbee8('0x24')]?moment()[_0xbee8('0x17')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4016aa['id']});})[_0xbee8('0x25')](function(_0x3ad7c7){_0x215ba1(_0x3ad7c7);});});});};var _0x2f5f3a=function(_0xa3b6b9){return new BPromise(function(_0xab6db0,_0x4b409b){_0x21a43c(_0xa3b6b9,_0x3c58a9)[_0xbee8('0x1a')](function(_0x39c96f){_0x3c58a9[_0xbee8('0x16')]=_0x39c96f[_0xbee8('0x20')];_0x314f91[_0xbee8('0x21')][_0xbee8('0x19')]({'where':{'phone':_0x3c58a9[_0xbee8('0xa')],'CampaignId':_0xa3b6b9['id']}})[_0xbee8('0x1a')](function(_0x5886e3){if(!_[_0xbee8('0x1b')](_0x5886e3)){throw new Error(_0xbee8('0x26')+_0x3c58a9[_0xbee8('0xa')]+_0xbee8('0x30')+_0xa3b6b9['id']);}return _0x314f91[_0xbee8('0x28')][_0xbee8('0x19')]({'where':{'calleridnum':_0x3c58a9[_0xbee8('0xa')],'CampaignId':_0xa3b6b9['id']}});})[_0xbee8('0x1a')](function(_0x435915){if(!_['isNil'](_0x435915)){throw new Error(_0xbee8('0x29')+_0x3c58a9[_0xbee8('0xa')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0xa3b6b9['id']);}return _0x314f91[_0xbee8('0x21')]['create']({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'priority':_0x3c58a9['priority']?_0x3c58a9['priority']:0x2,'scheduledat':_0x3c58a9[_0xbee8('0x16')]?_0x3c58a9[_0xbee8('0x16')]:moment()[_0xbee8('0x17')](_0xbee8('0x1f')),'callback':_0x3c58a9[_0xbee8('0x24')]?!![]:![],'callbackuniqueid':_0x3c58a9['callbackUniqueid']?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9[_0xbee8('0x24')]?moment()[_0xbee8('0x17')](_0xbee8('0x1f')):undefined,'CampaignId':_0xa3b6b9['id']});})[_0xbee8('0x25')](function(_0x49ab95){_0x4b409b(_0x49ab95);});});});};if(_0x3c58a9[_0xbee8('0x2c')]){_0x314f91[_0xbee8('0x31')]['findAll']({'where':{'type':'outbound'},'attributes':['id',_0xbee8('0x32'),_0xbee8('0x18')],'include':[{'model':_0x314f91[_0xbee8('0x33')],'as':_0xbee8('0x34'),'where':{'id':_0x3c58a9[_0xbee8('0x2c')]}}]})['then'](function(_0xc7cbda){if(_0xc7cbda){var _0xe68e13=[];for(var _0x2e2002=0x0,_0x5e7725;_0x2e2002<_0xc7cbda['length'];_0x2e2002+=0x1){_0x5e7725=_0xc7cbda[_0x2e2002][_0xbee8('0x35')]({'plain':!![]});switch(_0x5e7725[_0xbee8('0x32')]){case _0xbee8('0x36'):_0x2eb645(_0x5e7725)[_0xbee8('0x25')](_0x5090e4());break;case _0xbee8('0x37'):_0x5b9be6(_0x5e7725)[_0xbee8('0x25')](_0x5090e4());break;default:_0x21a43c(_0x5e7725,_0x3c58a9)[_0xbee8('0x1a')](function(_0x24fffc){_0x3c58a9[_0xbee8('0x16')]=_0x24fffc[_0xbee8('0x20')];_0x314f91[_0xbee8('0x21')][_0xbee8('0x2b')]({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'scheduledat':_0x3c58a9['scheduledat']?_0x3c58a9[_0xbee8('0x16')]:moment()[_0xbee8('0x17')](_0xbee8('0x1f')),'priority':_0x3c58a9[_0xbee8('0x23')]?_0x3c58a9[_0xbee8('0x23')]:0x2,'callback':_0x3c58a9[_0xbee8('0x24')]?!![]:![],'callbackuniqueid':_0x3c58a9['callbackUniqueid']?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9[_0xbee8('0x24')]?moment()[_0xbee8('0x17')](_0xbee8('0x1f')):undefined,'VoiceQueueId':_0x5e7725['id']})[_0xbee8('0x25')](_0x5090e4());});}}}})[_0xbee8('0x1a')](function(){return _0x314f91[_0xbee8('0x31')][_0xbee8('0x38')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x314f91[_0xbee8('0x33')],'as':_0xbee8('0x39'),'where':{'id':_0x3c58a9[_0xbee8('0x2c')]}}]})[_0xbee8('0x1a')](function(_0xbdcff2){if(_0xbdcff2){var _0x3f5590=[];for(var _0x30b1de=0x0,_0x18d913;_0x30b1de<_0xbdcff2[_0xbee8('0x3a')];_0x30b1de+=0x1){_0x18d913=_0xbdcff2[_0x30b1de][_0xbee8('0x35')]({'plain':!![]});_0x314f91[_0xbee8('0x3b')][_0xbee8('0x2b')]({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'VoiceQueueId':_0x18d913['id']})[_0xbee8('0x25')](function(_0x3e3f7d){logger[_0xbee8('0x12')](_0xbee8('0x3c'),_0xbee8('0x14'),_0x3e3f7d[_0xbee8('0x3d')]);});}}});})['then'](function(){return _0x314f91[_0xbee8('0x2d')][_0xbee8('0x38')]({'attributes':['id','dialCheckDuplicateType',_0xbee8('0x18')],'include':[{'model':_0x314f91['CmList'],'as':_0xbee8('0x34'),'where':{'id':_0x3c58a9[_0xbee8('0x2c')]}}]})[_0xbee8('0x1a')](function(_0x22a6ed){if(_0x22a6ed){var _0x422dbe=[];for(var _0x29e2aa=0x0,_0x550cc6;_0x29e2aa<_0x22a6ed[_0xbee8('0x3a')];_0x29e2aa+=0x1){_0x550cc6=_0x22a6ed[_0x29e2aa][_0xbee8('0x35')]({'plain':!![]});switch(_0x550cc6[_0xbee8('0x32')]){case _0xbee8('0x36'):_0x2f5f3a(_0x550cc6)['catch'](_0xe6fc8b());break;case _0xbee8('0x37'):_0x1b30cd(_0x550cc6)['catch'](_0xe6fc8b());break;default:_0x314f91[_0xbee8('0x21')][_0xbee8('0x2b')]({'phone':_0x3c58a9['phone'],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'scheduledat':_0x3c58a9['scheduledat']?_0x3c58a9[_0xbee8('0x16')]:moment()[_0xbee8('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x3c58a9[_0xbee8('0x23')]?_0x3c58a9[_0xbee8('0x23')]:0x2,'callback':_0x3c58a9[_0xbee8('0x24')]?!![]:![],'callbackuniqueid':_0x3c58a9[_0xbee8('0x24')]?_0x3c58a9[_0xbee8('0x24')]:undefined,'callbackat':_0x3c58a9['callbackUniqueid']?moment()[_0xbee8('0x17')](_0xbee8('0x1f')):undefined,'CampaignId':_0x550cc6['id']})['catch'](_0xe6fc8b());}}}});})[_0xbee8('0x1a')](function(){return _0x314f91[_0xbee8('0x2d')][_0xbee8('0x38')]({'attributes':['id'],'include':[{'model':_0x314f91[_0xbee8('0x33')],'as':_0xbee8('0x39'),'where':{'id':_0x3c58a9[_0xbee8('0x2c')]}}]})['then'](function(_0x26c108){if(_0x26c108){var _0x201154=[];for(var _0x2b8a87=0x0,_0x48fad7;_0x2b8a87<_0x26c108[_0xbee8('0x3a')];_0x2b8a87+=0x1){_0x48fad7=_0x26c108[_0x2b8a87][_0xbee8('0x35')]({'plain':!![]});_0x314f91[_0xbee8('0x3b')][_0xbee8('0x2b')]({'phone':_0x3c58a9[_0xbee8('0xa')],'ContactId':_0x3c58a9['id'],'ListId':_0x3c58a9[_0xbee8('0x2c')],'CampaignId':_0x48fad7['id']})['catch'](function(_0x557148){logger[_0xbee8('0x12')](_0xbee8('0x3c'),'afterCreate',_0x557148['message']);});}}});})['then'](function(){_0x9c042b();})[_0xbee8('0x25')](function(_0xfa73d3){logger['error']('cmContact,\x20%s,\x20%s',_0xbee8('0x14'),_0xfa73d3[_0xbee8('0x3d')]);_0x9c042b(_0xfa73d3);});}else{_0x9c042b(new Error(_0xbee8('0x3e')));}},'afterDestroy':function(_0x2e829c,_0x3df640,_0x1be84c){var _0x2fafb8=_0x3618c9['models'];var _0x3ceb40=_0x2e829c[_0xbee8('0x35')]({'plain':!![]});return _0x2fafb8[_0xbee8('0x21')][_0xbee8('0x38')]({'raw':!![],'where':{'ListId':_0x3ceb40['ListId'],'ContactId':_0x3ceb40['id']}})[_0xbee8('0x1a')](function(_0x5f39f0){if(!_[_0xbee8('0x3f')](_0x5f39f0)){var _0x1159b7=[];for(var _0x2b92ae=0x0;_0x2b92ae<_0x5f39f0[_0xbee8('0x3a')];_0x2b92ae+=0x1){var _0x36b548=_0x2fafb8[_0xbee8('0x21')]['destroy']({'where':{'ListId':_0x5f39f0[_0x2b92ae]['ListId'],'ContactId':_0x5f39f0[_0x2b92ae]['ContactId'],'VoiceQueueId':_0x5f39f0[_0x2b92ae]['VoiceQueueId'],'CampaignId':_0x5f39f0[_0x2b92ae][_0xbee8('0x40')]}});_0x1159b7[_0xbee8('0x41')](_0x36b548);}return BPromise[_0xbee8('0x42')](_0x1159b7);}})[_0xbee8('0x1a')](function(_0x19afc2){logger[_0xbee8('0x43')](_0xbee8('0x44'),util[_0xbee8('0x15')](_0x19afc2,{'showHidden':![],'depth':null}));_0x1be84c();})['catch'](function(_0x487545){logger[_0xbee8('0x12')](_0xbee8('0x45'),util[_0xbee8('0x15')](_0x487545,{'showHidden':![],'depth':null}));_0x1be84c(_0x487545);});}}});};
\ No newline at end of file
+var _0x1a2b=['rimraf','../../config/environment','../../config/environment/shared','exports','define','CmContact','phone','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','error','cmContact','afterCreate','inspect','scheduledat','format','isNil','VoiceQueue','dialTimezone','timezones','utcOffset','add','YYYY-MM-DD\x20HH:mm:ss','then','ret','CmHopper','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','Campaign','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','CmList','Lists','get','always','outbound','BlackLists','length','cmContact,\x20%s,\x20%s','onlyIfOpen','message','List\x20not\x20found','destroy','ContactId','VoiceQueueId','all','info','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1a2b,0x89));var _0xb1a2=function(_0x3f4cd0,_0x303070){_0x3f4cd0=_0x3f4cd0-0x0;var _0x3f9f01=_0x1a2b[_0x3f4cd0];return _0x3f9f01;};'use strict';var _=require(_0xb1a2('0x0'));var util=require(_0xb1a2('0x1'));var logger=require(_0xb1a2('0x2'))(_0xb1a2('0x3'));var moment=require('moment');var BPromise=require(_0xb1a2('0x4'));var rp=require(_0xb1a2('0x5'));var fs=require('fs');var path=require(_0xb1a2('0x6'));var rimraf=require(_0xb1a2('0x7'));var config=require(_0xb1a2('0x8'));var shared=require(_0xb1a2('0x9'));var attributes=require('./cmContact.attributes');module[_0xb1a2('0xa')]=function(_0x3f5d64,_0x2a4191){return _0x3f5d64[_0xb1a2('0xb')](_0xb1a2('0xc'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0xb1a2('0xd'),'fields':[_0xb1a2('0xd')]},{'name':_0xb1a2('0xe'),'fields':[_0xb1a2('0xf'),_0xb1a2('0x10'),_0xb1a2('0xd'),_0xb1a2('0x11'),'fax','email'],'type':_0xb1a2('0x12')}],'timestamps':!![],'charset':_0xb1a2('0x13'),'collate':_0xb1a2('0x14'),'hooks':{'afterCreate':function(_0x3caeef,_0x589570,_0x130a3c){var _0x3def2e=_0x3f5d64[_0xb1a2('0x15')];var _0x4ae46c=_0x3caeef['get']({'plain':!![]});function _0x31f0bb(){return function(_0x1fbea7){logger[_0xb1a2('0x16')](_0xb1a2('0x17'),_0xb1a2('0x18'),util[_0xb1a2('0x19')](_0x1fbea7,{'showHidden':![],'depth':null}));};}function _0x4ef6ba(_0x22ad72,_0x5e89b9){var _0x593a6e=_0x5e89b9[_0xb1a2('0x1a')]?_0x5e89b9[_0xb1a2('0x1a')]:moment()[_0xb1a2('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');return new BPromise(function(_0x28df95,_0x37193b){if(_[_0xb1a2('0x1c')](_0x5e89b9['dialTimezone'])){_0x28df95({'ret':_0x593a6e});}else{_0x3def2e[_0xb1a2('0x1d')]['findOne']({'where':{'id':_0x22ad72['id']}})['then'](function(_0x5dcc4a){if(!_[_0xb1a2('0x1c')](_0x5dcc4a)){var _0x11309c=_0x5dcc4a[_0xb1a2('0x1e')];if(!_[_0xb1a2('0x1c')](_0x11309c)){var _0x34331b=shared[_0xb1a2('0x1f')];var _0xb922c7=_0x34331b[_0x11309c];var _0x55a620=_0x34331b[_0x5e89b9[_0xb1a2('0x1e')]];if(!_[_0xb1a2('0x1c')](_0xb922c7)&&!_[_0xb1a2('0x1c')](_0x55a620)){var _0x5c9217=_0xb922c7['utcOffset']-_0x55a620[_0xb1a2('0x20')];_0x593a6e=_0x5e89b9[_0xb1a2('0x1a')]?_0x5e89b9[_0xb1a2('0x1a')]:moment();var _0x47057a=moment(_0x593a6e)[_0xb1a2('0x21')](_0x5c9217,'minutes');_0x28df95({'ret':_0x47057a[_0xb1a2('0x1b')](_0xb1a2('0x22'))});}else _0x28df95({'ret':_0x593a6e});}else _0x28df95({'ret':_0x593a6e});}else{_0x28df95({'ret':_0x593a6e});}});}});return 0xa;}var _0x4cb671=function(_0x599160){return new BPromise(function(_0x4b023a,_0x3d7a8f){_0x4ef6ba(_0x599160,_0x4ae46c)[_0xb1a2('0x23')](function(_0xb410f3){_0x4ae46c[_0xb1a2('0x1a')]=_0xb410f3[_0xb1a2('0x24')];_0x3def2e[_0xb1a2('0x25')]['findOne']({'where':{'phone':_0x4ae46c[_0xb1a2('0xd')],'VoiceQueueId':_0x599160['id']}})['then'](function(_0x109de3){if(!_[_0xb1a2('0x1c')](_0x109de3)){throw new Error(_0xb1a2('0x26')+_0x4ae46c['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x599160['id']);}return _0x3def2e[_0xb1a2('0x25')][_0xb1a2('0x27')]({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'priority':_0x4ae46c[_0xb1a2('0x29')]?_0x4ae46c[_0xb1a2('0x29')]:0x2,'scheduledat':_0x4ae46c[_0xb1a2('0x1a')]?_0x4ae46c[_0xb1a2('0x1a')]:moment()[_0xb1a2('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4ae46c[_0xb1a2('0x2a')]?!![]:![],'callbackuniqueid':_0x4ae46c['callbackUniqueid']?_0x4ae46c[_0xb1a2('0x2a')]:undefined,'callbackat':_0x4ae46c[_0xb1a2('0x2a')]?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'VoiceQueueId':_0x599160['id']});})['catch'](function(_0xa82960){_0x3d7a8f(_0xa82960);});});});};var _0x307f9e=function(_0x4a0fae){return new BPromise(function(_0x2ff00d,_0x4b6364){_0x4ef6ba(_0x4a0fae,_0x4ae46c)[_0xb1a2('0x23')](function(_0x341fde){_0x4ae46c[_0xb1a2('0x1a')]=_0x341fde[_0xb1a2('0x24')];_0x3def2e['CmHopper'][_0xb1a2('0x2b')]({'where':{'phone':_0x4ae46c[_0xb1a2('0xd')],'VoiceQueueId':_0x4a0fae['id']}})[_0xb1a2('0x23')](function(_0x55b62b){if(!_[_0xb1a2('0x1c')](_0x55b62b)){throw new Error(_0xb1a2('0x26')+_0x4ae46c['phone']+_0xb1a2('0x2c')+_0x4a0fae['id']);}return _0x3def2e[_0xb1a2('0x2d')][_0xb1a2('0x2b')]({'where':{'calleridnum':_0x4ae46c[_0xb1a2('0xd')],'VoiceQueueId':_0x4a0fae['id']}});})[_0xb1a2('0x23')](function(_0x12f21e){if(!_['isNil'](_0x12f21e)){throw new Error(_0xb1a2('0x2e')+_0x4ae46c['phone']+_0xb1a2('0x2f')+_0x4a0fae['id']);}return _0x3def2e[_0xb1a2('0x25')][_0xb1a2('0x27')]({'phone':_0x4ae46c['phone'],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'priority':_0x4ae46c['priority']?_0x4ae46c['priority']:0x2,'scheduledat':_0x4ae46c['scheduledat']?_0x4ae46c[_0xb1a2('0x1a')]:moment()['format'](_0xb1a2('0x22')),'callback':_0x4ae46c[_0xb1a2('0x2a')]?!![]:![],'callbackuniqueid':_0x4ae46c[_0xb1a2('0x2a')]?_0x4ae46c['callbackUniqueid']:undefined,'callbackat':_0x4ae46c[_0xb1a2('0x2a')]?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'VoiceQueueId':_0x4a0fae['id']});})['catch'](function(_0x1ecc4c){_0x4b6364(_0x1ecc4c);});});});};function _0x45e12b(){return function(_0x56c7ef){logger[_0xb1a2('0x16')]('cmContact',_0xb1a2('0x18'),util[_0xb1a2('0x19')](_0x56c7ef,{'showHidden':![],'depth':null}));};}function _0x66dd4(_0x305c31,_0x591792){var _0x4bbb13=_0x591792[_0xb1a2('0x1a')]?_0x591792[_0xb1a2('0x1a')]:moment()[_0xb1a2('0x1b')](_0xb1a2('0x22'));return new BPromise(function(_0x2d4a3c,_0x3c8856){if(_[_0xb1a2('0x1c')](_0x591792[_0xb1a2('0x1e')])){_0x2d4a3c({'ret':_0x4bbb13});}else{_0x3def2e[_0xb1a2('0x30')][_0xb1a2('0x2b')]({'where':{'id':_0x305c31['id']}})['then'](function(_0x358c68){if(!_[_0xb1a2('0x1c')](_0x358c68)){var _0x205c45=_0x358c68['dialTimezone'];if(!_[_0xb1a2('0x1c')](_0x205c45)){var _0x2bb5fb=shared[_0xb1a2('0x1f')];var _0x4a165d=_0x2bb5fb[_0x205c45];var _0x14df88=_0x2bb5fb[_0x591792[_0xb1a2('0x1e')]];if(!_['isNil'](_0x4a165d)&&!_[_0xb1a2('0x1c')](_0x14df88)){var _0x3e856e=_0x4a165d[_0xb1a2('0x20')]-_0x14df88['utcOffset'];_0x4bbb13=_0x591792[_0xb1a2('0x1a')]?_0x591792[_0xb1a2('0x1a')]:moment();var _0x5662b4=moment(_0x4bbb13)[_0xb1a2('0x21')](_0x3e856e,_0xb1a2('0x31'));_0x2d4a3c({'ret':_0x5662b4[_0xb1a2('0x1b')](_0xb1a2('0x22'))});}else _0x2d4a3c({'ret':_0x4bbb13});}else _0x2d4a3c({'ret':_0x4bbb13});}else{_0x2d4a3c({'ret':_0x4bbb13});}});}});return 0xa;}var _0x252686=function(_0x54bf38){return new BPromise(function(_0x3a3826,_0x3f4420){_0x66dd4(_0x54bf38,_0x4ae46c)[_0xb1a2('0x23')](function(_0xcd94c4){_0x4ae46c['scheduledat']=_0xcd94c4['ret'];_0x3def2e['CmHopper']['findOne']({'where':{'phone':_0x4ae46c['phone'],'CampaignId':_0x54bf38['id']}})[_0xb1a2('0x23')](function(_0x3d7ae9){if(!_[_0xb1a2('0x1c')](_0x3d7ae9)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4ae46c['phone']+_0xb1a2('0x32')+_0x54bf38['id']);}return _0x3def2e['CmHopper']['create']({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'priority':_0x4ae46c[_0xb1a2('0x29')]?_0x4ae46c[_0xb1a2('0x29')]:0x2,'scheduledat':_0x4ae46c[_0xb1a2('0x1a')]?_0x4ae46c[_0xb1a2('0x1a')]:moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')),'callback':_0x4ae46c[_0xb1a2('0x2a')]?!![]:![],'callbackuniqueid':_0x4ae46c[_0xb1a2('0x2a')]?_0x4ae46c[_0xb1a2('0x2a')]:undefined,'callbackat':_0x4ae46c[_0xb1a2('0x2a')]?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'CampaignId':_0x54bf38['id']});})[_0xb1a2('0x33')](function(_0x10a671){_0x3f4420(_0x10a671);});});});};var _0x33e23d=function(_0x279090){return new BPromise(function(_0x48f304,_0x28c343){_0x66dd4(_0x279090,_0x4ae46c)[_0xb1a2('0x23')](function(_0x5a8124){_0x4ae46c[_0xb1a2('0x1a')]=_0x5a8124[_0xb1a2('0x24')];_0x3def2e['CmHopper'][_0xb1a2('0x2b')]({'where':{'phone':_0x4ae46c[_0xb1a2('0xd')],'CampaignId':_0x279090['id']}})['then'](function(_0x466a0c){if(!_[_0xb1a2('0x1c')](_0x466a0c)){throw new Error(_0xb1a2('0x26')+_0x4ae46c[_0xb1a2('0xd')]+_0xb1a2('0x34')+_0x279090['id']);}return _0x3def2e['CmHopperFinal'][_0xb1a2('0x2b')]({'where':{'calleridnum':_0x4ae46c[_0xb1a2('0xd')],'CampaignId':_0x279090['id']}});})[_0xb1a2('0x23')](function(_0x4117ae){if(!_[_0xb1a2('0x1c')](_0x4117ae)){throw new Error(_0xb1a2('0x2e')+_0x4ae46c['phone']+_0xb1a2('0x35')+_0x279090['id']);}return _0x3def2e['CmHopper']['create']({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'priority':_0x4ae46c['priority']?_0x4ae46c[_0xb1a2('0x29')]:0x2,'scheduledat':_0x4ae46c[_0xb1a2('0x1a')]?_0x4ae46c['scheduledat']:moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')),'callback':_0x4ae46c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ae46c['callbackUniqueid']?_0x4ae46c[_0xb1a2('0x2a')]:undefined,'callbackat':_0x4ae46c['callbackUniqueid']?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'CampaignId':_0x279090['id']});})[_0xb1a2('0x33')](function(_0x465670){_0x28c343(_0x465670);});});});};if(_0x4ae46c[_0xb1a2('0x28')]){_0x3def2e[_0xb1a2('0x1d')][_0xb1a2('0x36')]({'where':{'type':'outbound'},'attributes':['id',_0xb1a2('0x37'),_0xb1a2('0x1e')],'include':[{'model':_0x3def2e[_0xb1a2('0x38')],'as':_0xb1a2('0x39'),'where':{'id':_0x4ae46c[_0xb1a2('0x28')]}}]})[_0xb1a2('0x23')](function(_0x12e8da){if(_0x12e8da){var _0x21cc82=[];for(var _0x23cb27=0x0,_0x276b59;_0x23cb27<_0x12e8da['length'];_0x23cb27+=0x1){_0x276b59=_0x12e8da[_0x23cb27][_0xb1a2('0x3a')]({'plain':!![]});switch(_0x276b59[_0xb1a2('0x37')]){case _0xb1a2('0x3b'):_0x307f9e(_0x276b59)[_0xb1a2('0x33')](_0x31f0bb());break;case'onlyIfOpen':_0x4cb671(_0x276b59)[_0xb1a2('0x33')](_0x31f0bb());break;default:_0x66dd4(_0x276b59,_0x4ae46c)[_0xb1a2('0x23')](function(_0x1325f9){_0x4ae46c[_0xb1a2('0x1a')]=_0x1325f9[_0xb1a2('0x24')];_0x3def2e['CmHopper'][_0xb1a2('0x27')]({'phone':_0x4ae46c['phone'],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c['ListId'],'scheduledat':_0x4ae46c['scheduledat']?_0x4ae46c[_0xb1a2('0x1a')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4ae46c[_0xb1a2('0x29')]?_0x4ae46c['priority']:0x2,'callback':_0x4ae46c['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4ae46c[_0xb1a2('0x2a')]?_0x4ae46c[_0xb1a2('0x2a')]:undefined,'callbackat':_0x4ae46c[_0xb1a2('0x2a')]?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'VoiceQueueId':_0x276b59['id']})[_0xb1a2('0x33')](_0x31f0bb());});}}}})[_0xb1a2('0x23')](function(){return _0x3def2e[_0xb1a2('0x1d')][_0xb1a2('0x36')]({'where':{'type':_0xb1a2('0x3c')},'attributes':['id'],'include':[{'model':_0x3def2e[_0xb1a2('0x38')],'as':_0xb1a2('0x3d'),'where':{'id':_0x4ae46c[_0xb1a2('0x28')]}}]})['then'](function(_0x2c0c90){if(_0x2c0c90){var _0x4fb74b=[];for(var _0x1c7624=0x0,_0x46f5fc;_0x1c7624<_0x2c0c90[_0xb1a2('0x3e')];_0x1c7624+=0x1){_0x46f5fc=_0x2c0c90[_0x1c7624][_0xb1a2('0x3a')]({'plain':!![]});_0x3def2e['CmHopperBlack'][_0xb1a2('0x27')]({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'VoiceQueueId':_0x46f5fc['id']})[_0xb1a2('0x33')](function(_0x459f15){logger['error'](_0xb1a2('0x3f'),_0xb1a2('0x18'),_0x459f15['message']);});}}});})[_0xb1a2('0x23')](function(){return _0x3def2e[_0xb1a2('0x30')][_0xb1a2('0x36')]({'attributes':['id','dialCheckDuplicateType',_0xb1a2('0x1e')],'include':[{'model':_0x3def2e[_0xb1a2('0x38')],'as':_0xb1a2('0x39'),'where':{'id':_0x4ae46c[_0xb1a2('0x28')]}}]})[_0xb1a2('0x23')](function(_0x3f5a89){if(_0x3f5a89){var _0x3b9dc0=[];for(var _0x5ee776=0x0,_0x280321;_0x5ee776<_0x3f5a89[_0xb1a2('0x3e')];_0x5ee776+=0x1){_0x280321=_0x3f5a89[_0x5ee776][_0xb1a2('0x3a')]({'plain':!![]});switch(_0x280321[_0xb1a2('0x37')]){case _0xb1a2('0x3b'):_0x33e23d(_0x280321)[_0xb1a2('0x33')](_0x45e12b());break;case _0xb1a2('0x40'):_0x252686(_0x280321)['catch'](_0x45e12b());break;default:_0x3def2e[_0xb1a2('0x25')][_0xb1a2('0x27')]({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'scheduledat':_0x4ae46c[_0xb1a2('0x1a')]?_0x4ae46c[_0xb1a2('0x1a')]:moment()[_0xb1a2('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4ae46c[_0xb1a2('0x29')]?_0x4ae46c[_0xb1a2('0x29')]:0x2,'callback':_0x4ae46c[_0xb1a2('0x2a')]?!![]:![],'callbackuniqueid':_0x4ae46c[_0xb1a2('0x2a')]?_0x4ae46c[_0xb1a2('0x2a')]:undefined,'callbackat':_0x4ae46c[_0xb1a2('0x2a')]?moment()[_0xb1a2('0x1b')](_0xb1a2('0x22')):undefined,'CampaignId':_0x280321['id']})[_0xb1a2('0x33')](_0x45e12b());}}}});})['then'](function(){return _0x3def2e[_0xb1a2('0x30')][_0xb1a2('0x36')]({'attributes':['id'],'include':[{'model':_0x3def2e['CmList'],'as':_0xb1a2('0x3d'),'where':{'id':_0x4ae46c[_0xb1a2('0x28')]}}]})['then'](function(_0x43377c){if(_0x43377c){var _0x165bdf=[];for(var _0x27eeb3=0x0,_0x314e2f;_0x27eeb3<_0x43377c['length'];_0x27eeb3+=0x1){_0x314e2f=_0x43377c[_0x27eeb3]['get']({'plain':!![]});_0x3def2e['CmHopperBlack'][_0xb1a2('0x27')]({'phone':_0x4ae46c[_0xb1a2('0xd')],'ContactId':_0x4ae46c['id'],'ListId':_0x4ae46c[_0xb1a2('0x28')],'CampaignId':_0x314e2f['id']})[_0xb1a2('0x33')](function(_0x4b992c){logger[_0xb1a2('0x16')](_0xb1a2('0x3f'),_0xb1a2('0x18'),_0x4b992c[_0xb1a2('0x41')]);});}}});})[_0xb1a2('0x23')](function(){_0x130a3c();})[_0xb1a2('0x33')](function(_0xc7fce8){logger[_0xb1a2('0x16')](_0xb1a2('0x3f'),_0xb1a2('0x18'),_0xc7fce8[_0xb1a2('0x41')]);_0x130a3c(_0xc7fce8);});}else{_0x130a3c(new Error(_0xb1a2('0x42')));}},'afterDestroy':function(_0x258ea5,_0x110441,_0x239471){var _0x1a7179=_0x3f5d64[_0xb1a2('0x15')];var _0x391fff=_0x258ea5['get']({'plain':!![]});return _0x1a7179[_0xb1a2('0x25')][_0xb1a2('0x36')]({'raw':!![],'where':{'ListId':_0x391fff[_0xb1a2('0x28')],'ContactId':_0x391fff['id']}})['then'](function(_0x2c7793){if(!_['isEmpty'](_0x2c7793)){var _0x2724e2=[];for(var _0x15f665=0x0;_0x15f665<_0x2c7793[_0xb1a2('0x3e')];_0x15f665+=0x1){var _0x29eafb=_0x1a7179[_0xb1a2('0x25')][_0xb1a2('0x43')]({'where':{'ListId':_0x2c7793[_0x15f665][_0xb1a2('0x28')],'ContactId':_0x2c7793[_0x15f665][_0xb1a2('0x44')],'VoiceQueueId':_0x2c7793[_0x15f665][_0xb1a2('0x45')],'CampaignId':_0x2c7793[_0x15f665]['CampaignId']}});_0x2724e2['push'](_0x29eafb);}return BPromise[_0xb1a2('0x46')](_0x2724e2);}})['then'](function(_0xd036f4){logger[_0xb1a2('0x47')]('[CmContact][afterDestroy][Succesfull]',util[_0xb1a2('0x19')](_0xd036f4,{'showHidden':![],'depth':null}));_0x239471();})[_0xb1a2('0x33')](function(_0x1536e7){logger[_0xb1a2('0x16')]('[CmContact][afterDestroy][Error]',util['inspect'](_0x1536e7,{'showHidden':![],'depth':null}));_0x239471(_0x1536e7);});}}});};
\ No newline at end of file
index 0d7d0fe..e8a58fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['include','model','length','CmContactHasItem','find','ListId','Contact','isNil','CmContactId','CmContact','catch','CreateCmContact','create','body','keys','startsWith','cf_','table','cm_contacts','set','where','id\x20=\x20?','toString','sequelize','query','lodash','util','moment','bluebird','ioredis','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','GetCmContact','findAll','options','raw','attributes','limit','map'];(function(_0x128dd9,_0x564710){var _0x50c00b=function(_0x26aceb){while(--_0x26aceb){_0x128dd9['push'](_0x128dd9['shift']());}};_0x50c00b(++_0x564710);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var squel=require(_0x7995('0x5'));var db=require(_0x7995('0x6'))['db'];var utils=require(_0x7995('0x7'));var logger=require('../../config/logger')(_0x7995('0x8'));var config=require(_0x7995('0x9'));var jayson=require(_0x7995('0xa'));var client=jayson[_0x7995('0xb')][_0x7995('0xc')]({'port':0x232a});config[_0x7995('0xd')]=_['defaults'](config[_0x7995('0xd')],{'host':_0x7995('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7995('0xd')]));require(_0x7995('0xf'))[_0x7995('0x10')](socket);function respondWithRpcPromise(_0x35b5fe,_0x3c1d19,_0x1e400a){return new BPromise(function(_0x341672,_0x524f7b){return client[_0x7995('0x11')](_0x35b5fe,_0x1e400a)[_0x7995('0x12')](function(_0x581f22){logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));logger[_0x7995('0x16')](_0x7995('0x17'),_0x3c1d19,_0x7995('0x15'),JSON[_0x7995('0x18')](_0x581f22));if(_0x581f22['error']){if(_0x581f22['error'][_0x7995('0x19')]===0x1f4){logger[_0x7995('0x1a')](_0x7995('0x14'),_0x3c1d19,_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);return _0x524f7b(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}logger[_0x7995('0x1a')]('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x581f22[_0x7995('0x1a')]['message']);return _0x341672(_0x581f22[_0x7995('0x1a')][_0x7995('0x1b')]);}else{logger[_0x7995('0x13')](_0x7995('0x14'),_0x3c1d19,_0x7995('0x15'));_0x341672(_0x581f22[_0x7995('0x1c')]['message']);}})['catch'](function(_0x2536c8){logger['error']('CmContact,\x20%s,\x20%s',_0x3c1d19,_0x2536c8);_0x524f7b(_0x2536c8);});});}exports[_0x7995('0x1d')]=function(_0x3d463e){var _0x4cbe10=this;return new Promise(function(_0x3a9b54,_0x51f276){return db['CmContact'][_0x7995('0x1e')]({'raw':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![],'where':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['where']||null:null,'attributes':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x21')]||null:null,'limit':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')][_0x7995('0x22')]||null:null,'include':_0x3d463e[_0x7995('0x1f')]?_0x3d463e[_0x7995('0x1f')]['include']?_[_0x7995('0x23')](_0x3d463e[_0x7995('0x1f')][_0x7995('0x24')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x25')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x21')],'include':_0x268ce7['include']?_[_0x7995('0x23')](_0x268ce7['include'],function(_0x229742){return{'model':db[_0x229742[_0x7995('0x25')]],'as':_0x229742['as'],'attributes':_0x229742[_0x7995('0x21')],'include':_0x229742[_0x7995('0x24')]?_[_0x7995('0x23')](_0x229742['include'],function(_0x9b2a15){return{'model':db[_0x9b2a15['model']],'as':_0x9b2a15['as'],'attributes':_0x9b2a15[_0x7995('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7995('0x12')](function(_0x4253e5){logger['info']('GetCmContact',_0x3d463e);logger['debug'](_0x7995('0x1d'),_0x3d463e,JSON[_0x7995('0x18')](_0x4253e5));if(_0x4253e5[_0x7995('0x26')]==0x0){return db[_0x7995('0x27')][_0x7995('0x28')]({'raw':!![],'where':{'item':_0x3d463e[_0x7995('0x1f')]['phone']},'include':[{'model':db['CmContact'],'where':{'ListId':_0x3d463e[_0x7995('0x1f')]['where'][_0x7995('0x29')],'deletedAt':{'$eq':null}},'as':_0x7995('0x2a')}]})[_0x7995('0x12')](function(_0x1e9fa4){if(_[_0x7995('0x2b')](_0x1e9fa4)){_0x3a9b54(_0x4253e5);}else{var _0x510841=_0x1e9fa4[_0x7995('0x2c')];return db[_0x7995('0x2d')]['findAll']({'raw':!![],'where':{'id':_0x510841},'attributes':_0x3d463e['options']?_0x3d463e['options'][_0x7995('0x21')]||null:null})[_0x7995('0x12')](function(_0x4a176f){_0x3a9b54(_0x4a176f);});}});}else{_0x3a9b54(_0x4253e5);}})[_0x7995('0x2e')](function(_0x51b95d){logger[_0x7995('0x1a')](_0x7995('0x1d'),_0x51b95d[_0x7995('0x1b')],_0x3d463e);_0x51f276(_0x4cbe10['error'](0x1f4,_0x51b95d['message']));});});};exports[_0x7995('0x2f')]=function(_0x5e67fe){var _0x5d2428=this;return new Promise(function(_0x3e99cd,_0xe328b1){return db['CmContact'][_0x7995('0x30')](_0x5e67fe[_0x7995('0x31')],{'raw':_0x5e67fe[_0x7995('0x1f')]?_0x5e67fe[_0x7995('0x1f')][_0x7995('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x2d4285){var _0x242713;for(var _0xf612e6=0x0;_0xf612e6<Object[_0x7995('0x32')](_0x5e67fe['body'])[_0x7995('0x26')];_0xf612e6++){var _0x235df7=Object[_0x7995('0x32')](_0x5e67fe[_0x7995('0x31')])[_0xf612e6];if(_0x235df7[_0x7995('0x33')](_0x7995('0x34'))){_0x242713=squel['update']()[_0x7995('0x35')](_0x7995('0x36'))[_0x7995('0x37')](_0x235df7,_0x5e67fe[_0x7995('0x31')][_0x235df7])[_0x7995('0x38')](_0x7995('0x39'),_0x2d4285['id'])[_0x7995('0x3a')]();break;}}if(!_0x242713)return _0x2d4285;return db[_0x7995('0x3b')][_0x7995('0x3c')](_0x242713)[_0x7995('0x12')](function(){return _0x2d4285;});})[_0x7995('0x12')](function(_0x270d52){logger[_0x7995('0x13')]('CreateCmContact',_0x5e67fe);logger['debug'](_0x7995('0x2f'),_0x5e67fe,JSON[_0x7995('0x18')](_0x270d52));_0x3e99cd(_0x270d52);})['catch'](function(_0x4b0855){logger[_0x7995('0x1a')]('CreateCmContact',_0x4b0855['message'],_0x5e67fe);_0xe328b1(_0x5d2428[_0x7995('0x1a')](0x1f4,_0x4b0855[_0x7995('0x1b')]));});});};
\ No newline at end of file
+var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a<Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x0a9e('0x2e')];_0x24936a++){var _0x4f41ae=Object[_0x0a9e('0x2d')](_0x2cc7a0[_0x0a9e('0x2c')])[_0x24936a];if(_0x4f41ae[_0x0a9e('0x2f')]('cf_')){_0x5640eb=squel[_0x0a9e('0x30')]()[_0x0a9e('0x31')](_0x0a9e('0x32'))['set'](_0x4f41ae,_0x2cc7a0['body'][_0x4f41ae])[_0x0a9e('0x1d')](_0x0a9e('0x33'),_0x1e8694['id'])['toString']();break;}}if(!_0x5640eb)return _0x1e8694;return db[_0x0a9e('0x34')][_0x0a9e('0x35')](_0x5640eb)[_0x0a9e('0x23')](function(){return _0x1e8694;});})[_0x0a9e('0x23')](function(_0x4b38d9){logger['info'](_0x0a9e('0x36'),_0x2cc7a0);logger[_0x0a9e('0x12')]('CreateCmContact',_0x2cc7a0,JSON[_0x0a9e('0x24')](_0x4b38d9));_0x2b7e7f(_0x4b38d9);})[_0x0a9e('0x18')](function(_0x1459bb){logger['error'](_0x0a9e('0x36'),_0x1459bb[_0x0a9e('0x16')],_0x2cc7a0);_0x3f3d41(_0x14b13f[_0x0a9e('0x14')](0x1f4,_0x1459bb[_0x0a9e('0x16')]));});});};
\ No newline at end of file
index 1335e8a..d5c5f78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 8407d95..222aa4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1d7588,_0x5f24cd){var _0x150e41=function(_0x2431a4){while(--_0x2431a4){_0x1d7588['push'](_0x1d7588['shift']());}};_0x150e41(++_0x5f24cd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
+var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x1d6b55,_0x381d57){var _0x454160=function(_0x4ad103){while(--_0x4ad103){_0x1d6b55['push'](_0x1d6b55['shift']());}};_0x454160(++_0x381d57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router;
\ No newline at end of file
index 3167ef2..b7b0789 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa20=['PHONE','sequelize','exports','INTEGER','STRING'];(function(_0x521b61,_0x47e2b4){var _0x476cdf=function(_0xbca2ca){while(--_0xbca2ca){_0x521b61['push'](_0x521b61['shift']());}};_0x476cdf(++_0x47e2b4);}(_0xfa20,0x141));var _0x0fa2=function(_0x3d42ba,_0x1b6cf4){_0x3d42ba=_0x3d42ba-0x0;var _0x35a185=_0xfa20[_0x3d42ba];return _0x35a185;};'use strict';var Sequelize=require(_0x0fa2('0x0'));module[_0x0fa2('0x1')]={'CmContactId':{'type':Sequelize[_0x0fa2('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0fa2('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0fa2('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0fa2('0x3')],'defaultValue':_0x0fa2('0x4')},'OrderBy':{'type':Sequelize[_0x0fa2('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0fa2('0x3')],'defaultValue':null}};
\ No newline at end of file
+var _0xfb30=['STRING','sequelize','exports','INTEGER','PHONE'];(function(_0x973e65,_0x3035c6){var _0x5ef138=function(_0x51f1b2){while(--_0x51f1b2){_0x973e65['push'](_0x973e65['shift']());}};_0x5ef138(++_0x3035c6);}(_0xfb30,0x88));var _0x0fb3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfb30[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x0fb3('0x0'));module[_0x0fb3('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0fb3('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize['STRING'],'defaultValue':_0x0fb3('0x3')},'OrderBy':{'type':Sequelize[_0x0fb3('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0fb3('0x4')],'defaultValue':null}};
\ No newline at end of file
index 4b82670..b53426c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ff=['undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','CmContactHasItems','UserProfileResource','error','stack','send','index','map','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','rows','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','eml-format','rimraf','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x77ff,0x84));var _0xf77f=function(_0x34c8ac,_0x5c4bc9){_0x34c8ac=_0x34c8ac-0x0;var _0xdbcc5e=_0x77ff[_0x34c8ac];return _0xdbcc5e;};'use strict';var emlformat=require(_0xf77f('0x0'));var rimraf=require(_0xf77f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf77f('0x2'));var BPromise=require(_0xf77f('0x3'));var Mustache=require(_0xf77f('0x4'));var util=require('util');var path=require(_0xf77f('0x5'));var sox=require(_0xf77f('0x6'));var csv=require('to-csv');var ejs=require(_0xf77f('0x7'));var fs=require('fs');var fs_extra=require(_0xf77f('0x8'));var _=require(_0xf77f('0x9'));var squel=require(_0xf77f('0xa'));var crypto=require('crypto');var jsforce=require(_0xf77f('0xb'));var deskjs=require(_0xf77f('0xc'));var toCsv=require(_0xf77f('0xd'));var querystring=require('querystring');var Papa=require(_0xf77f('0xe'));var Redis=require(_0xf77f('0xf'));var authService=require(_0xf77f('0x10'));var qs=require(_0xf77f('0x11'));var as=require(_0xf77f('0x12'));var hardwareService=require(_0xf77f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf77f('0x14'));var config=require(_0xf77f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf77f('0x16'))['db'];function respondWithStatusCode(_0x5f0844,_0xa8b369){_0xa8b369=_0xa8b369||0xcc;return function(_0x41462d){if(_0x41462d){return _0x5f0844[_0xf77f('0x17')](_0xa8b369);}return _0x5f0844[_0xf77f('0x18')](_0xa8b369)[_0xf77f('0x19')]();};}function respondWithResult(_0x399106,_0x24ef2f){_0x24ef2f=_0x24ef2f||0xc8;return function(_0x31d631){if(_0x31d631){return _0x399106[_0xf77f('0x18')](_0x24ef2f)[_0xf77f('0x1a')](_0x31d631);}};}function respondWithFilteredResult(_0x2ca33c,_0xc72532){return function(_0x233897){if(_0x233897){var _0x1c25eb=typeof _0xc72532[_0xf77f('0x1b')]===_0xf77f('0x1c')&&typeof _0xc72532[_0xf77f('0x1d')]==='undefined';var _0x2536ee=_0x233897[_0xf77f('0x1e')];var _0x1d4715=_0x1c25eb?0x0:_0xc72532[_0xf77f('0x1b')];var _0x586f01=_0x1c25eb?_0x233897[_0xf77f('0x1e')]:_0xc72532[_0xf77f('0x1b')]+_0xc72532[_0xf77f('0x1d')];var _0x143f10;if(_0x586f01>=_0x2536ee){_0x586f01=_0x2536ee;_0x143f10=0xc8;}else{_0x143f10=0xce;}_0x2ca33c[_0xf77f('0x18')](_0x143f10);return _0x2ca33c['set'](_0xf77f('0x1f'),_0x1d4715+'-'+_0x586f01+'/'+_0x2536ee)[_0xf77f('0x1a')](_0x233897);}return null;};}function patchUpdates(_0x313b70){return function(_0x5d2dc0){try{jsonpatch[_0xf77f('0x20')](_0x5d2dc0,_0x313b70,!![]);}catch(_0x2a9fc3){return BPromise[_0xf77f('0x21')](_0x2a9fc3);}return _0x5d2dc0['save']();};}function saveUpdates(_0x53b0d2,_0x1dd3db){return function(_0x2fb69c){if(_0x2fb69c){return _0x2fb69c[_0xf77f('0x22')](_0x53b0d2)[_0xf77f('0x23')](function(_0x536c2d){return _0x536c2d;});}return null;};}function removeEntity(_0x5826c9,_0x310334){return function(_0x276594){if(_0x276594){return _0x276594[_0xf77f('0x24')]()[_0xf77f('0x23')](function(){var _0x518e77=_0x276594[_0xf77f('0x25')]({'plain':!![]});var _0x1c5a6d=_0xf77f('0x26');return db[_0xf77f('0x27')][_0xf77f('0x24')]({'where':{'type':_0x1c5a6d,'resourceId':_0x518e77['id']}})['then'](function(){return _0x276594;});})[_0xf77f('0x23')](function(){_0x5826c9['status'](0xcc)[_0xf77f('0x19')]();});}};}function handleEntityNotFound(_0x5a4876,_0x24bcf1){return function(_0x488d33){if(!_0x488d33){_0x5a4876['sendStatus'](0x194);}return _0x488d33;};}function handleError(_0x2a9faa,_0x23b855){_0x23b855=_0x23b855||0x1f4;return function(_0x514e63){logger[_0xf77f('0x28')](_0x514e63[_0xf77f('0x29')]);if(_0x514e63['name']){delete _0x514e63['name'];}_0x2a9faa[_0xf77f('0x18')](_0x23b855)[_0xf77f('0x2a')](_0x514e63);};}exports[_0xf77f('0x2b')]=function(_0x420e0f,_0x5ab1ba){var _0x57803e={},_0x138be8={},_0xca5fa7={'count':0x0,'rows':[]};var _0x5c88e8=_[_0xf77f('0x2c')](db['CmContactHasItem'][_0xf77f('0x2d')],function(_0x511a49){return{'name':_0x511a49['fieldName'],'type':_0x511a49['type'][_0xf77f('0x2e')]};});_0x138be8[_0xf77f('0x2f')]=_[_0xf77f('0x2c')](_0x5c88e8,_0xf77f('0x30'));_0x138be8[_0xf77f('0x31')]=_[_0xf77f('0x32')](_0x420e0f[_0xf77f('0x31')]);_0x138be8[_0xf77f('0x33')]=_[_0xf77f('0x34')](_0x138be8[_0xf77f('0x2f')],_0x138be8[_0xf77f('0x31')]);_0x57803e[_0xf77f('0x35')]=_['intersection'](_0x138be8['model'],qs[_0xf77f('0x36')](_0x420e0f['query'][_0xf77f('0x36')]));_0x57803e[_0xf77f('0x35')]=_0x57803e[_0xf77f('0x35')]['length']?_0x57803e['attributes']:_0x138be8[_0xf77f('0x2f')];if(!_0x420e0f[_0xf77f('0x31')][_0xf77f('0x37')]('nolimit')){_0x57803e[_0xf77f('0x1d')]=qs[_0xf77f('0x1d')](_0x420e0f[_0xf77f('0x31')]['limit']);_0x57803e[_0xf77f('0x1b')]=qs[_0xf77f('0x1b')](_0x420e0f[_0xf77f('0x31')][_0xf77f('0x1b')]);}_0x57803e['order']=qs[_0xf77f('0x38')](_0x420e0f['query'][_0xf77f('0x38')]);_0x57803e[_0xf77f('0x39')]=qs[_0xf77f('0x33')](_[_0xf77f('0x3a')](_0x420e0f[_0xf77f('0x31')],_0x138be8[_0xf77f('0x33')]),_0x5c88e8);if(_0x420e0f[_0xf77f('0x31')][_0xf77f('0x3b')]){_0x57803e['where']=_[_0xf77f('0x3c')](_0x57803e[_0xf77f('0x39')],{'$or':_[_0xf77f('0x2c')](_0x5c88e8,function(_0x117103){if(_0x117103['type']!==_0xf77f('0x3d')){var _0x27ba80={};_0x27ba80[_0x117103[_0xf77f('0x30')]]={'$like':'%'+_0x420e0f['query'][_0xf77f('0x3b')]+'%'};return _0x27ba80;}})});}_0x57803e=_[_0xf77f('0x3c')]({},_0x57803e,_0x420e0f[_0xf77f('0x3e')]);var _0x177f4f={'where':_0x57803e[_0xf77f('0x39')]};return db[_0xf77f('0x3f')][_0xf77f('0x1e')](_0x177f4f)[_0xf77f('0x23')](function(_0x4ce0f2){_0xca5fa7['count']=_0x4ce0f2;if(_0x420e0f[_0xf77f('0x31')][_0xf77f('0x40')]){_0x57803e['include']=[{'all':!![]}];}return db[_0xf77f('0x3f')]['findAll'](_0x57803e);})[_0xf77f('0x23')](function(_0x339ed5){_0xca5fa7[_0xf77f('0x41')]=_0x339ed5;return _0xca5fa7;})[_0xf77f('0x23')](respondWithFilteredResult(_0x5ab1ba,_0x57803e))['catch'](handleError(_0x5ab1ba,null));};exports[_0xf77f('0x42')]=function(_0x3354ce,_0x5bfe83){var _0x55f41e={'raw':!![],'where':{'id':_0x3354ce[_0xf77f('0x43')]['id']}},_0x310f10={};_0x310f10[_0xf77f('0x2f')]=_[_0xf77f('0x32')](db[_0xf77f('0x3f')]['rawAttributes']);_0x310f10[_0xf77f('0x31')]=_[_0xf77f('0x32')](_0x3354ce[_0xf77f('0x31')]);_0x310f10['filters']=_[_0xf77f('0x34')](_0x310f10[_0xf77f('0x2f')],_0x310f10[_0xf77f('0x31')]);_0x55f41e[_0xf77f('0x35')]=_[_0xf77f('0x34')](_0x310f10[_0xf77f('0x2f')],qs[_0xf77f('0x36')](_0x3354ce[_0xf77f('0x31')]['fields']));_0x55f41e['attributes']=_0x55f41e[_0xf77f('0x35')][_0xf77f('0x44')]?_0x55f41e[_0xf77f('0x35')]:_0x310f10['model'];if(_0x3354ce[_0xf77f('0x31')][_0xf77f('0x40')]){_0x55f41e[_0xf77f('0x45')]=[{'all':!![]}];}_0x55f41e=_[_0xf77f('0x3c')]({},_0x55f41e,_0x3354ce['options']);return db[_0xf77f('0x3f')][_0xf77f('0x46')](_0x55f41e)[_0xf77f('0x23')](handleEntityNotFound(_0x5bfe83,null))[_0xf77f('0x23')](respondWithResult(_0x5bfe83,null))['catch'](handleError(_0x5bfe83,null));};exports[_0xf77f('0x47')]=function(_0x4c126f,_0x4c2cda){return db[_0xf77f('0x3f')]['create'](_0x4c126f[_0xf77f('0x48')],{})[_0xf77f('0x23')](function(_0x373f2e){var _0x9cbcc9=_0x4c126f[_0xf77f('0x49')]['get']({'plain':!![]});if(!_0x9cbcc9)throw new Error(_0xf77f('0x4a'));if(_0x9cbcc9[_0xf77f('0x4b')]===_0xf77f('0x49')){var _0x3a147c=_0x373f2e['get']({'plain':!![]});var _0x22289d=_0xf77f('0x26');return db[_0xf77f('0x4c')][_0xf77f('0x46')]({'where':{'name':_0x22289d,'userProfileId':_0x9cbcc9[_0xf77f('0x4d')]},'raw':!![]})['then'](function(_0xf23bd3){if(_0xf23bd3&&_0xf23bd3[_0xf77f('0x4e')]===0x0){return db[_0xf77f('0x27')]['create']({'name':_0x3a147c['name'],'resourceId':_0x3a147c['id'],'type':_0xf23bd3['name'],'sectionId':_0xf23bd3['id']},{})[_0xf77f('0x23')](function(){return _0x373f2e;});}else{return _0x373f2e;}})[_0xf77f('0x4f')](function(_0x11a28e){logger[_0xf77f('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11a28e);throw _0x11a28e;});}return _0x373f2e;})[_0xf77f('0x23')](respondWithResult(_0x4c2cda,0xc9))[_0xf77f('0x4f')](handleError(_0x4c2cda,null));};exports[_0xf77f('0x22')]=function(_0xa7935b,_0x3e2bb8){if(_0xa7935b[_0xf77f('0x48')]['id']){delete _0xa7935b[_0xf77f('0x48')]['id'];}return db[_0xf77f('0x3f')][_0xf77f('0x46')]({'where':{'id':_0xa7935b[_0xf77f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e2bb8,null))[_0xf77f('0x23')](saveUpdates(_0xa7935b[_0xf77f('0x48')],null))[_0xf77f('0x23')](respondWithResult(_0x3e2bb8,null))[_0xf77f('0x4f')](handleError(_0x3e2bb8,null));};exports[_0xf77f('0x24')]=function(_0x5043d8,_0x4de38a){return db[_0xf77f('0x3f')][_0xf77f('0x46')]({'where':{'id':_0x5043d8['params']['id']}})['then'](handleEntityNotFound(_0x4de38a,null))[_0xf77f('0x23')](removeEntity(_0x4de38a,null))[_0xf77f('0x4f')](handleError(_0x4de38a,null));};
\ No newline at end of file
+var _0x5364=['CmContactHasItems','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','CmContactHasItem','includeAll','include','findAll','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then'];(function(_0xc8023,_0xd1912){var _0x448b50=function(_0x4b8a6f){while(--_0x4b8a6f){_0xc8023['push'](_0xc8023['shift']());}};_0x448b50(++_0xd1912);}(_0x5364,0x136));var _0x4536=function(_0x19a7f6,_0x3abadc){_0x19a7f6=_0x19a7f6-0x0;var _0x5831b8=_0x5364[_0x19a7f6];return _0x5831b8;};'use strict';var emlformat=require(_0x4536('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4536('0x1'));var jsonpatch=require(_0x4536('0x2'));var rp=require(_0x4536('0x3'));var moment=require(_0x4536('0x4'));var BPromise=require(_0x4536('0x5'));var Mustache=require(_0x4536('0x6'));var util=require(_0x4536('0x7'));var path=require(_0x4536('0x8'));var sox=require(_0x4536('0x9'));var csv=require('to-csv');var ejs=require(_0x4536('0xa'));var fs=require('fs');var fs_extra=require(_0x4536('0xb'));var _=require(_0x4536('0xc'));var squel=require(_0x4536('0xd'));var crypto=require(_0x4536('0xe'));var jsforce=require(_0x4536('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4536('0x10'));var Papa=require('papaparse');var Redis=require(_0x4536('0x11'));var authService=require(_0x4536('0x12'));var qs=require(_0x4536('0x13'));var as=require(_0x4536('0x14'));var hardwareService=require(_0x4536('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x4536('0x16'));var config=require(_0x4536('0x17'));var licenseUtil=require(_0x4536('0x18'));var db=require(_0x4536('0x19'))['db'];function respondWithStatusCode(_0x34c94b,_0x56de4c){_0x56de4c=_0x56de4c||0xcc;return function(_0x501674){if(_0x501674){return _0x34c94b[_0x4536('0x1a')](_0x56de4c);}return _0x34c94b['status'](_0x56de4c)[_0x4536('0x1b')]();};}function respondWithResult(_0x3ebaba,_0x2280e0){_0x2280e0=_0x2280e0||0xc8;return function(_0x480f6f){if(_0x480f6f){return _0x3ebaba['status'](_0x2280e0)[_0x4536('0x1c')](_0x480f6f);}};}function respondWithFilteredResult(_0x353ed8,_0x12d954){return function(_0x30e0ec){if(_0x30e0ec){var _0x5f2394=typeof _0x12d954[_0x4536('0x1d')]===_0x4536('0x1e')&&typeof _0x12d954[_0x4536('0x1f')]===_0x4536('0x1e');var _0x269fbb=_0x30e0ec[_0x4536('0x20')];var _0x349066=_0x5f2394?0x0:_0x12d954[_0x4536('0x1d')];var _0x2e7583=_0x5f2394?_0x30e0ec['count']:_0x12d954['offset']+_0x12d954[_0x4536('0x1f')];var _0x147854;if(_0x2e7583>=_0x269fbb){_0x2e7583=_0x269fbb;_0x147854=0xc8;}else{_0x147854=0xce;}_0x353ed8[_0x4536('0x21')](_0x147854);return _0x353ed8[_0x4536('0x22')](_0x4536('0x23'),_0x349066+'-'+_0x2e7583+'/'+_0x269fbb)[_0x4536('0x1c')](_0x30e0ec);}return null;};}function patchUpdates(_0x1e4407){return function(_0x507488){try{jsonpatch[_0x4536('0x24')](_0x507488,_0x1e4407,!![]);}catch(_0x25ad46){return BPromise[_0x4536('0x25')](_0x25ad46);}return _0x507488[_0x4536('0x26')]();};}function saveUpdates(_0x3494a1,_0x4a8f87){return function(_0x2f027c){if(_0x2f027c){return _0x2f027c[_0x4536('0x27')](_0x3494a1)['then'](function(_0x2c797f){return _0x2c797f;});}return null;};}function removeEntity(_0x5537f6,_0xe83bb4){return function(_0x372178){if(_0x372178){return _0x372178[_0x4536('0x28')]()[_0x4536('0x29')](function(){var _0x5bd987=_0x372178['get']({'plain':!![]});var _0x260b49=_0x4536('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x260b49,'resourceId':_0x5bd987['id']}})[_0x4536('0x29')](function(){return _0x372178;});})[_0x4536('0x29')](function(){_0x5537f6['status'](0xcc)[_0x4536('0x1b')]();});}};}function handleEntityNotFound(_0x382956,_0xdb4a76){return function(_0x384cd6){if(!_0x384cd6){_0x382956[_0x4536('0x1a')](0x194);}return _0x384cd6;};}function handleError(_0x492262,_0x120a1f){_0x120a1f=_0x120a1f||0x1f4;return function(_0x449ae5){logger[_0x4536('0x2b')](_0x449ae5[_0x4536('0x2c')]);if(_0x449ae5[_0x4536('0x2d')]){delete _0x449ae5['name'];}_0x492262[_0x4536('0x21')](_0x120a1f)[_0x4536('0x2e')](_0x449ae5);};}exports[_0x4536('0x2f')]=function(_0x143460,_0x2fa90c){var _0x3eb716={},_0x4cf955={},_0x394f10={'count':0x0,'rows':[]};var _0x575846=_[_0x4536('0x30')](db['CmContactHasItem'][_0x4536('0x31')],function(_0x599427){return{'name':_0x599427[_0x4536('0x32')],'type':_0x599427[_0x4536('0x33')]['key']};});_0x4cf955[_0x4536('0x34')]=_['map'](_0x575846,_0x4536('0x2d'));_0x4cf955['query']=_[_0x4536('0x35')](_0x143460['query']);_0x4cf955[_0x4536('0x36')]=_[_0x4536('0x37')](_0x4cf955[_0x4536('0x34')],_0x4cf955[_0x4536('0x38')]);_0x3eb716[_0x4536('0x39')]=_[_0x4536('0x37')](_0x4cf955[_0x4536('0x34')],qs[_0x4536('0x3a')](_0x143460[_0x4536('0x38')]['fields']));_0x3eb716[_0x4536('0x39')]=_0x3eb716['attributes'][_0x4536('0x3b')]?_0x3eb716[_0x4536('0x39')]:_0x4cf955[_0x4536('0x34')];if(!_0x143460['query'][_0x4536('0x3c')](_0x4536('0x3d'))){_0x3eb716[_0x4536('0x1f')]=qs[_0x4536('0x1f')](_0x143460[_0x4536('0x38')]['limit']);_0x3eb716[_0x4536('0x1d')]=qs['offset'](_0x143460[_0x4536('0x38')]['offset']);}_0x3eb716[_0x4536('0x3e')]=qs['sort'](_0x143460[_0x4536('0x38')][_0x4536('0x3f')]);_0x3eb716['where']=qs[_0x4536('0x36')](_[_0x4536('0x40')](_0x143460[_0x4536('0x38')],_0x4cf955[_0x4536('0x36')]),_0x575846);if(_0x143460[_0x4536('0x38')]['filter']){_0x3eb716[_0x4536('0x41')]=_[_0x4536('0x42')](_0x3eb716[_0x4536('0x41')],{'$or':_['map'](_0x575846,function(_0x1a0366){if(_0x1a0366[_0x4536('0x33')]!==_0x4536('0x43')){var _0x2b7666={};_0x2b7666[_0x1a0366['name']]={'$like':'%'+_0x143460[_0x4536('0x38')][_0x4536('0x44')]+'%'};return _0x2b7666;}})});}_0x3eb716=_[_0x4536('0x42')]({},_0x3eb716,_0x143460[_0x4536('0x45')]);var _0x3a7ecf={'where':_0x3eb716[_0x4536('0x41')]};return db[_0x4536('0x46')]['count'](_0x3a7ecf)['then'](function(_0x253c2f){_0x394f10[_0x4536('0x20')]=_0x253c2f;if(_0x143460['query'][_0x4536('0x47')]){_0x3eb716[_0x4536('0x48')]=[{'all':!![]}];}return db[_0x4536('0x46')][_0x4536('0x49')](_0x3eb716);})[_0x4536('0x29')](function(_0x94e693){_0x394f10['rows']=_0x94e693;return _0x394f10;})['then'](respondWithFilteredResult(_0x2fa90c,_0x3eb716))['catch'](handleError(_0x2fa90c,null));};exports[_0x4536('0x4a')]=function(_0x325537,_0x2ec438){var _0x5da463={'raw':!![],'where':{'id':_0x325537['params']['id']}},_0x392da8={};_0x392da8[_0x4536('0x34')]=_[_0x4536('0x35')](db['CmContactHasItem']['rawAttributes']);_0x392da8[_0x4536('0x38')]=_[_0x4536('0x35')](_0x325537['query']);_0x392da8[_0x4536('0x36')]=_[_0x4536('0x37')](_0x392da8[_0x4536('0x34')],_0x392da8[_0x4536('0x38')]);_0x5da463[_0x4536('0x39')]=_['intersection'](_0x392da8[_0x4536('0x34')],qs[_0x4536('0x3a')](_0x325537['query'][_0x4536('0x3a')]));_0x5da463[_0x4536('0x39')]=_0x5da463[_0x4536('0x39')][_0x4536('0x3b')]?_0x5da463['attributes']:_0x392da8[_0x4536('0x34')];if(_0x325537['query'][_0x4536('0x47')]){_0x5da463[_0x4536('0x48')]=[{'all':!![]}];}_0x5da463=_['merge']({},_0x5da463,_0x325537[_0x4536('0x45')]);return db[_0x4536('0x46')]['find'](_0x5da463)[_0x4536('0x29')](handleEntityNotFound(_0x2ec438,null))[_0x4536('0x29')](respondWithResult(_0x2ec438,null))[_0x4536('0x4b')](handleError(_0x2ec438,null));};exports[_0x4536('0x4c')]=function(_0x3d9bbd,_0x38fba2){return db['CmContactHasItem'][_0x4536('0x4c')](_0x3d9bbd[_0x4536('0x4d')],{})['then'](function(_0x975763){var _0x9939e9=_0x3d9bbd[_0x4536('0x4e')]['get']({'plain':!![]});if(!_0x9939e9)throw new Error(_0x4536('0x4f'));if(_0x9939e9[_0x4536('0x50')]==='user'){var _0x158774=_0x975763[_0x4536('0x51')]({'plain':!![]});var _0x743199=_0x4536('0x2a');return db[_0x4536('0x52')][_0x4536('0x53')]({'where':{'name':_0x743199,'userProfileId':_0x9939e9[_0x4536('0x54')]},'raw':!![]})[_0x4536('0x29')](function(_0x425066){if(_0x425066&&_0x425066['autoAssociation']===0x0){return db[_0x4536('0x55')][_0x4536('0x4c')]({'name':_0x158774[_0x4536('0x2d')],'resourceId':_0x158774['id'],'type':_0x425066[_0x4536('0x2d')],'sectionId':_0x425066['id']},{})[_0x4536('0x29')](function(){return _0x975763;});}else{return _0x975763;}})[_0x4536('0x4b')](function(_0x1ff809){logger['error'](_0x4536('0x56'),_0x1ff809);throw _0x1ff809;});}return _0x975763;})[_0x4536('0x29')](respondWithResult(_0x38fba2,0xc9))[_0x4536('0x4b')](handleError(_0x38fba2,null));};exports[_0x4536('0x27')]=function(_0x5a47d8,_0x3ca7fc){if(_0x5a47d8[_0x4536('0x4d')]['id']){delete _0x5a47d8[_0x4536('0x4d')]['id'];}return db[_0x4536('0x46')]['find']({'where':{'id':_0x5a47d8[_0x4536('0x57')]['id']}})[_0x4536('0x29')](handleEntityNotFound(_0x3ca7fc,null))[_0x4536('0x29')](saveUpdates(_0x5a47d8[_0x4536('0x4d')],null))[_0x4536('0x29')](respondWithResult(_0x3ca7fc,null))[_0x4536('0x4b')](handleError(_0x3ca7fc,null));};exports[_0x4536('0x28')]=function(_0x56b8e4,_0xc8ea9f){return db[_0x4536('0x46')][_0x4536('0x53')]({'where':{'id':_0x56b8e4['params']['id']}})[_0x4536('0x29')](handleEntityNotFound(_0xc8ea9f,null))[_0x4536('0x29')](removeEntity(_0xc8ea9f,null))[_0x4536('0x4b')](handleError(_0xc8ea9f,null));};
\ No newline at end of file
index e0165b9..cdfee9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cac=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','define','CmContactHasItem'];(function(_0x122acc,_0x188c27){var _0x285b43=function(_0x14a103){while(--_0x14a103){_0x122acc['push'](_0x122acc['shift']());}};_0x285b43(++_0x188c27);}(_0x9cac,0xc0));var _0xc9ca=function(_0x3b1397,_0x48adf7){_0x3b1397=_0x3b1397-0x0;var _0x22f884=_0x9cac[_0x3b1397];return _0x22f884;};'use strict';var _=require('lodash');var util=require(_0xc9ca('0x0'));var logger=require(_0xc9ca('0x1'))(_0xc9ca('0x2'));var moment=require(_0xc9ca('0x3'));var BPromise=require(_0xc9ca('0x4'));var rp=require(_0xc9ca('0x5'));var fs=require('fs');var path=require(_0xc9ca('0x6'));var rimraf=require(_0xc9ca('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9ca('0x8'));module[_0xc9ca('0x9')]=function(_0x30123d,_0x3b4434){return _0x30123d[_0xc9ca('0xa')](_0xc9ca('0xb'),attributes,{'tableName':'cm_contact_has_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe66c=['moment','bluebird','rimraf','../../config/environment','define','CmContactHasItem','cm_contact_has_items','util','../../config/logger','api'];(function(_0x31290f,_0x2e1614){var _0x548f9b=function(_0x247c6f){while(--_0x247c6f){_0x31290f['push'](_0x31290f['shift']());}};_0x548f9b(++_0x2e1614);}(_0xe66c,0x1f1));var _0xce66=function(_0x4d6dd1,_0x3e4f7f){_0x4d6dd1=_0x4d6dd1-0x0;var _0x2bb647=_0xe66c[_0x4d6dd1];return _0x2bb647;};'use strict';var _=require('lodash');var util=require(_0xce66('0x0'));var logger=require(_0xce66('0x1'))(_0xce66('0x2'));var moment=require(_0xce66('0x3'));var BPromise=require(_0xce66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce66('0x5'));var config=require(_0xce66('0x6'));var attributes=require('./cmContactHasItem.attributes');module['exports']=function(_0x5b6803,_0x1a1f1e){return _0x5b6803[_0xce66('0x7')](_0xce66('0x8'),attributes,{'tableName':_0xce66('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 427fca0..7a17ea7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53db=['../../config/environment','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x53db,0x86));var _0xb53d=function(_0x1f80d0,_0x14c1ac){_0x1f80d0=_0x1f80d0-0x0;var _0x36889e=_0x53db[_0x1f80d0];return _0x36889e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb53d('0x0'));var BPromise=require(_0xb53d('0x1'));var rs=require(_0xb53d('0x2'));var fs=require('fs');var Redis=require(_0xb53d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb53d('0x4'));var logger=require(_0xb53d('0x5'))('rpc');var config=require(_0xb53d('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb53d('0x7')][_0xb53d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4db305,_0x43030b,_0x224915){return new BPromise(function(_0x4b9b0a,_0x3efaf6){return client[_0xb53d('0x9')](_0x4db305,_0x224915)['then'](function(_0x1af28e){logger[_0xb53d('0xa')](_0xb53d('0xb'),_0x43030b,_0xb53d('0xc'));logger[_0xb53d('0xd')](_0xb53d('0xe'),_0x43030b,_0xb53d('0xc'),JSON[_0xb53d('0xf')](_0x1af28e));if(_0x1af28e[_0xb53d('0x10')]){if(_0x1af28e['error'][_0xb53d('0x11')]===0x1f4){logger[_0xb53d('0x10')](_0xb53d('0xb'),_0x43030b,_0x1af28e[_0xb53d('0x10')]['message']);return _0x3efaf6(_0x1af28e[_0xb53d('0x10')][_0xb53d('0x12')]);}logger['error'](_0xb53d('0xb'),_0x43030b,_0x1af28e[_0xb53d('0x10')][_0xb53d('0x12')]);return _0x4b9b0a(_0x1af28e['error'][_0xb53d('0x12')]);}else{logger[_0xb53d('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x43030b,_0xb53d('0xc'));_0x4b9b0a(_0x1af28e[_0xb53d('0x13')]['message']);}})['catch'](function(_0xa417b){logger['error'](_0xb53d('0xb'),_0x43030b,_0xa417b);_0x3efaf6(_0xa417b);});});}
\ No newline at end of file
+var _0x6f86=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f86,0x14c));var _0x66f8=function(_0x5d792b,_0x4a41de){_0x5d792b=_0x5d792b-0x0;var _0x219de9=_0x6f86[_0x5d792b];return _0x219de9;};'use strict';var _=require(_0x66f8('0x0'));var util=require('util');var moment=require(_0x66f8('0x1'));var BPromise=require(_0x66f8('0x2'));var rs=require(_0x66f8('0x3'));var fs=require('fs');var Redis=require(_0x66f8('0x4'));var db=require(_0x66f8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x66f8('0x6'))(_0x66f8('0x7'));var config=require('../../config/environment');var jayson=require(_0x66f8('0x8'));var client=jayson[_0x66f8('0x9')][_0x66f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1327e8,_0x1549f0,_0x12d84a){return new BPromise(function(_0x3dcedc,_0x1527a4){return client[_0x66f8('0xb')](_0x1327e8,_0x12d84a)['then'](function(_0x124353){logger[_0x66f8('0xc')](_0x66f8('0xd'),_0x1549f0,_0x66f8('0xe'));logger[_0x66f8('0xf')](_0x66f8('0x10'),_0x1549f0,'request\x20sent',JSON['stringify'](_0x124353));if(_0x124353['error']){if(_0x124353[_0x66f8('0x11')][_0x66f8('0x12')]===0x1f4){logger[_0x66f8('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x1549f0,_0x124353['error'][_0x66f8('0x13')]);return _0x1527a4(_0x124353[_0x66f8('0x11')][_0x66f8('0x13')]);}logger[_0x66f8('0x11')](_0x66f8('0xd'),_0x1549f0,_0x124353[_0x66f8('0x11')][_0x66f8('0x13')]);return _0x3dcedc(_0x124353['error'][_0x66f8('0x13')]);}else{logger['info'](_0x66f8('0xd'),_0x1549f0,_0x66f8('0xe'));_0x3dcedc(_0x124353[_0x66f8('0x14')][_0x66f8('0x13')]);}})[_0x66f8('0x15')](function(_0x3976e3){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x1549f0,_0x3976e3);_0x1527a4(_0x3976e3);});});}
\ No newline at end of file
index f9c7e42..9cbf7f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a0=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmContactHasItem.controller','get','isAuthenticated','/:id','post','create','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd4a0,0x145));var _0x0d4a=function(_0x2dc59b,_0x39f01c){_0x2dc59b=_0x2dc59b-0x0;var _0x1dd938=_0xd4a0[_0x2dc59b];return _0x1dd938;};'use strict';var multer=require(_0x0d4a('0x0'));var util=require(_0x0d4a('0x1'));var path=require(_0x0d4a('0x2'));var timeout=require(_0x0d4a('0x3'));var express=require(_0x0d4a('0x4'));var router=express[_0x0d4a('0x5')]();var fs_extra=require(_0x0d4a('0x6'));var auth=require(_0x0d4a('0x7'));var interaction=require(_0x0d4a('0x8'));var config=require('../../config/environment');var controller=require(_0x0d4a('0x9'));router[_0x0d4a('0xa')]('/',auth[_0x0d4a('0xb')](),controller['index']);router['get'](_0x0d4a('0xc'),auth[_0x0d4a('0xb')](),controller['show']);router[_0x0d4a('0xd')]('/',auth[_0x0d4a('0xb')](),controller[_0x0d4a('0xe')]);router['put'](_0x0d4a('0xc'),auth[_0x0d4a('0xb')](),controller['update']);router[_0x0d4a('0xf')]('/:id',auth[_0x0d4a('0xb')](),controller[_0x0d4a('0x10')]);module[_0x0d4a('0x11')]=router;
\ No newline at end of file
+var _0x685a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','isAuthenticated','get','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x39f803,_0x6f3f25){var _0x38586a=function(_0x21cd38){while(--_0x21cd38){_0x39f803['push'](_0x39f803['shift']());}};_0x38586a(++_0x6f3f25);}(_0x685a,0x1b2));var _0xa685=function(_0x25eee5,_0x55a6fd){_0x25eee5=_0x25eee5-0x0;var _0x41b04d=_0x685a[_0x25eee5];return _0x41b04d;};'use strict';var multer=require(_0xa685('0x0'));var util=require(_0xa685('0x1'));var path=require(_0xa685('0x2'));var timeout=require(_0xa685('0x3'));var express=require(_0xa685('0x4'));var router=express[_0xa685('0x5')]();var fs_extra=require(_0xa685('0x6'));var auth=require(_0xa685('0x7'));var interaction=require(_0xa685('0x8'));var config=require(_0xa685('0x9'));var controller=require(_0xa685('0xa'));router['get']('/',auth[_0xa685('0xb')](),controller['index']);router[_0xa685('0xc')](_0xa685('0xd'),auth[_0xa685('0xb')](),controller[_0xa685('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa685('0xf')]);router[_0xa685('0x10')](_0xa685('0xd'),auth['isAuthenticated'](),controller[_0xa685('0x11')]);router[_0xa685('0x12')](_0xa685('0xd'),auth[_0xa685('0xb')](),controller['destroy']);module[_0xa685('0x13')]=router;
\ No newline at end of file
index 657118c..66bd387 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x140b=['BOOLEAN','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','name','TEXT','getDataValue','type','select','parse','values','isArray','stringify'];(function(_0x376b5b,_0x424cfb){var _0x46de59=function(_0x5826bc){while(--_0x5826bc){_0x376b5b['push'](_0x376b5b['shift']());}};_0x46de59(++_0x424cfb);}(_0x140b,0x188));var _0xb140=function(_0x5b335a,_0x4ad54d){_0x5b335a=_0x5b335a-0x0;var _0x45939c=_0x140b[_0x5b335a];return _0x45939c;};'use strict';var Sequelize=require(_0xb140('0x0'));var _=require(_0xb140('0x1'));module[_0xb140('0x2')]={'name':{'type':Sequelize[_0xb140('0x3')],'get':function(_0x32f9c0){return this['getDataValue'](_0xb140('0x4'));}},'alias':{'type':Sequelize[_0xb140('0x5')],'allowNull':![],'set':function(_0x3756c6){this[_0xb140('0x6')](_0xb140('0x4'),_0x3756c6?_0x3756c6:this['getDataValue'](_0xb140('0x7')));}},'type':{'type':Sequelize[_0xb140('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xb140('0x8')]('long'),'get':function(){if(this[_0xb140('0x9')](_0xb140('0xa'))===_0xb140('0xb')){return JSON[_0xb140('0xc')](this[_0xb140('0x9')](_0xb140('0xd')));}else{return this[_0xb140('0x9')](_0xb140('0xd'));}},'set':function(_0x11e39b){if(Array[_0xb140('0xe')](_0x11e39b)){this[_0xb140('0x6')](_0xb140('0xd'),JSON[_0xb140('0xf')](_0x11e39b));}else{this[_0xb140('0x6')](_0xb140('0xd'),_0x11e39b);}}},'required':{'type':Sequelize[_0xb140('0x10')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xb140('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}};
\ No newline at end of file
+var _0x2199=['parse','values','setDataValue','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','getDataValue','STRING','alias','name','TEXT','long','type','select'];(function(_0x3778d8,_0x5ce417){var _0x45a1b3=function(_0x28488a){while(--_0x28488a){_0x3778d8['push'](_0x3778d8['shift']());}};_0x45a1b3(++_0x5ce417);}(_0x2199,0x1b6));var _0x9219=function(_0x395c96,_0x3f9701){_0x395c96=_0x395c96-0x0;var _0x413cc5=_0x2199[_0x395c96];return _0x413cc5;};'use strict';var Sequelize=require(_0x9219('0x0'));var _=require(_0x9219('0x1'));module[_0x9219('0x2')]={'name':{'type':Sequelize[_0x9219('0x3')],'get':function(_0x14ee16){return this[_0x9219('0x4')]('alias');}},'alias':{'type':Sequelize[_0x9219('0x5')],'allowNull':![],'set':function(_0x58a609){this['setDataValue'](_0x9219('0x6'),_0x58a609?_0x58a609:this['getDataValue'](_0x9219('0x7')));}},'type':{'type':Sequelize[_0x9219('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x9219('0x8')](_0x9219('0x9')),'get':function(){if(this['getDataValue'](_0x9219('0xa'))===_0x9219('0xb')){return JSON[_0x9219('0xc')](this[_0x9219('0x4')](_0x9219('0xd')));}else{return this[_0x9219('0x4')](_0x9219('0xd'));}},'set':function(_0x4893de){if(Array['isArray'](_0x4893de)){this[_0x9219('0xe')](_0x9219('0xd'),JSON[_0x9219('0xf')](_0x4893de));}else{this[_0x9219('0xe')](_0x9219('0xd'),_0x4893de);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9219('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x9219('0x11'))}};
\ No newline at end of file
index bab54a8..38d778b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb753=['merge','update','body','find','create','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','save','then','error','name','send','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','options','count','includeAll','include','findAll','rows','catch','params','keys','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb753,0xc2));var _0x3b75=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb753[_0xf5d71c];return _0x5af672;};'use strict';var emlformat=require(_0x3b75('0x0'));var rimraf=require(_0x3b75('0x1'));var zipdir=require(_0x3b75('0x2'));var jsonpatch=require(_0x3b75('0x3'));var rp=require(_0x3b75('0x4'));var moment=require(_0x3b75('0x5'));var BPromise=require(_0x3b75('0x6'));var Mustache=require(_0x3b75('0x7'));var util=require(_0x3b75('0x8'));var path=require('path');var sox=require(_0x3b75('0x9'));var csv=require(_0x3b75('0xa'));var ejs=require(_0x3b75('0xb'));var fs=require('fs');var fs_extra=require(_0x3b75('0xc'));var _=require(_0x3b75('0xd'));var squel=require(_0x3b75('0xe'));var crypto=require(_0x3b75('0xf'));var jsforce=require(_0x3b75('0x10'));var deskjs=require(_0x3b75('0x11'));var toCsv=require(_0x3b75('0xa'));var querystring=require(_0x3b75('0x12'));var Papa=require('papaparse');var Redis=require(_0x3b75('0x13'));var authService=require(_0x3b75('0x14'));var qs=require(_0x3b75('0x15'));var as=require(_0x3b75('0x16'));var hardwareService=require(_0x3b75('0x17'));var logger=require(_0x3b75('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b75('0x19'));var db=require(_0x3b75('0x1a'))['db'];function respondWithStatusCode(_0x357600,_0x4ebdf4){_0x4ebdf4=_0x4ebdf4||0xcc;return function(_0x166086){if(_0x166086){return _0x357600[_0x3b75('0x1b')](_0x4ebdf4);}return _0x357600[_0x3b75('0x1c')](_0x4ebdf4)[_0x3b75('0x1d')]();};}function respondWithResult(_0x196bd5,_0x10e439){_0x10e439=_0x10e439||0xc8;return function(_0x19502f){if(_0x19502f){return _0x196bd5[_0x3b75('0x1c')](_0x10e439)[_0x3b75('0x1e')](_0x19502f);}};}function respondWithFilteredResult(_0x209f38,_0x569409){return function(_0x579441){if(_0x579441){var _0x48673c=typeof _0x569409[_0x3b75('0x1f')]==='undefined'&&typeof _0x569409[_0x3b75('0x20')]===_0x3b75('0x21');var _0x4493ff=_0x579441['count'];var _0x455aa0=_0x48673c?0x0:_0x569409[_0x3b75('0x1f')];var _0x444cc1=_0x48673c?_0x579441['count']:_0x569409[_0x3b75('0x1f')]+_0x569409[_0x3b75('0x20')];var _0x4ab05f;if(_0x444cc1>=_0x4493ff){_0x444cc1=_0x4493ff;_0x4ab05f=0xc8;}else{_0x4ab05f=0xce;}_0x209f38['status'](_0x4ab05f);return _0x209f38['set'](_0x3b75('0x22'),_0x455aa0+'-'+_0x444cc1+'/'+_0x4493ff)[_0x3b75('0x1e')](_0x579441);}return null;};}function patchUpdates(_0x3ef848){return function(_0x471695){try{jsonpatch['apply'](_0x471695,_0x3ef848,!![]);}catch(_0x299f0c){return BPromise['reject'](_0x299f0c);}return _0x471695[_0x3b75('0x23')]();};}function saveUpdates(_0x20e3ed,_0x103675){return function(_0x339c3c){if(_0x339c3c){return _0x339c3c['update'](_0x20e3ed)[_0x3b75('0x24')](function(_0x1ffa7d){return _0x1ffa7d;});}return null;};}function removeEntity(_0x18d808,_0x81d288){return function(_0x4da439){if(_0x4da439){return _0x4da439['destroy']()[_0x3b75('0x24')](function(){_0x18d808[_0x3b75('0x1c')](0xcc)[_0x3b75('0x1d')]();});}};}function handleEntityNotFound(_0x30e36a,_0x4fb61b){return function(_0x1c8e2f){if(!_0x1c8e2f){_0x30e36a['sendStatus'](0x194);}return _0x1c8e2f;};}function handleError(_0x7c4e2a,_0x944619){_0x944619=_0x944619||0x1f4;return function(_0x1e50fb){logger[_0x3b75('0x25')](_0x1e50fb['stack']);if(_0x1e50fb[_0x3b75('0x26')]){delete _0x1e50fb['name'];}_0x7c4e2a[_0x3b75('0x1c')](_0x944619)[_0x3b75('0x27')](_0x1e50fb);};}exports[_0x3b75('0x28')]=function(_0x430426,_0x3efac2){var _0x5e9752={},_0xdd4160={},_0x12e612={'count':0x0,'rows':[]};var _0x3ba2ce=_[_0x3b75('0x29')](db[_0x3b75('0x2a')]['rawAttributes'],function(_0x392410){return{'name':_0x392410[_0x3b75('0x2b')],'type':_0x392410[_0x3b75('0x2c')][_0x3b75('0x2d')]};});_0xdd4160[_0x3b75('0x2e')]=_[_0x3b75('0x2f')](_[_0x3b75('0x29')](_0x3ba2ce,_0x3b75('0x26')),['name']);_0xdd4160['query']=_['keys'](_0x430426[_0x3b75('0x30')]);_0xdd4160['filters']=_[_0x3b75('0x31')](_0xdd4160[_0x3b75('0x2e')],_0xdd4160['query']);_0x5e9752[_0x3b75('0x32')]=_['intersection'](_0xdd4160[_0x3b75('0x2e')],qs[_0x3b75('0x33')](_0x430426[_0x3b75('0x30')][_0x3b75('0x33')]));_0x5e9752[_0x3b75('0x32')]=_0x5e9752[_0x3b75('0x32')][_0x3b75('0x34')]?_0x5e9752[_0x3b75('0x32')]:_0xdd4160[_0x3b75('0x2e')];if(!_0x430426[_0x3b75('0x30')][_0x3b75('0x35')](_0x3b75('0x36'))){_0x5e9752['limit']=qs[_0x3b75('0x20')](_0x430426[_0x3b75('0x30')]['limit']);_0x5e9752['offset']=qs[_0x3b75('0x1f')](_0x430426[_0x3b75('0x30')][_0x3b75('0x1f')]);}_0x5e9752[_0x3b75('0x37')]=qs['sort'](_0x430426[_0x3b75('0x30')]['sort']);_0x5e9752[_0x3b75('0x38')]=qs[_0x3b75('0x39')](_[_0x3b75('0x3a')](_0x430426['query'],_0xdd4160[_0x3b75('0x39')]),_0x3ba2ce);if(_0x430426['query']['filter']){_0x5e9752[_0x3b75('0x38')]=_['merge'](_0x5e9752[_0x3b75('0x38')],{'$or':_['map'](_0x3ba2ce,function(_0x303934){if(_0x303934[_0x3b75('0x2c')]!=='VIRTUAL'){var _0x5f2d0f={};_0x5f2d0f[_0x303934[_0x3b75('0x26')]]={'$like':'%'+_0x430426[_0x3b75('0x30')][_0x3b75('0x3b')]+'%'};return _0x5f2d0f;}})});}_0x5e9752=_['merge']({},_0x5e9752,_0x430426[_0x3b75('0x3c')]);var _0x1a0247={'where':_0x5e9752[_0x3b75('0x38')]};return db[_0x3b75('0x2a')]['count'](_0x1a0247)[_0x3b75('0x24')](function(_0x360e14){_0x12e612[_0x3b75('0x3d')]=_0x360e14;if(_0x430426[_0x3b75('0x30')][_0x3b75('0x3e')]){_0x5e9752[_0x3b75('0x3f')]=[{'all':!![]}];}return db['CmCustomField'][_0x3b75('0x40')](_0x5e9752);})[_0x3b75('0x24')](function(_0x1c9d42){_0x12e612[_0x3b75('0x41')]=_0x1c9d42;return _0x12e612;})[_0x3b75('0x24')](respondWithFilteredResult(_0x3efac2,_0x5e9752))[_0x3b75('0x42')](handleError(_0x3efac2,null));};exports['show']=function(_0x119434,_0x26632a){var _0x380d3f={'raw':!![],'where':{'id':_0x119434[_0x3b75('0x43')]['id']}},_0x1495fb={};_0x1495fb[_0x3b75('0x2e')]=_[_0x3b75('0x44')](db[_0x3b75('0x2a')][_0x3b75('0x45')]);_0x1495fb[_0x3b75('0x30')]=_[_0x3b75('0x44')](_0x119434[_0x3b75('0x30')]);_0x1495fb['filters']=_[_0x3b75('0x31')](_0x1495fb[_0x3b75('0x2e')],_0x1495fb[_0x3b75('0x30')]);_0x380d3f[_0x3b75('0x32')]=_[_0x3b75('0x31')](_0x1495fb['model'],qs[_0x3b75('0x33')](_0x119434[_0x3b75('0x30')]['fields']));_0x380d3f['attributes']=_0x380d3f[_0x3b75('0x32')][_0x3b75('0x34')]?_0x380d3f['attributes']:_0x1495fb['model'];if(_0x119434[_0x3b75('0x30')][_0x3b75('0x3e')]){_0x380d3f['include']=[{'all':!![]}];}_0x380d3f=_[_0x3b75('0x46')]({},_0x380d3f,_0x119434[_0x3b75('0x3c')]);return db[_0x3b75('0x2a')]['find'](_0x380d3f)[_0x3b75('0x24')](handleEntityNotFound(_0x26632a,null))['then'](respondWithResult(_0x26632a,null))[_0x3b75('0x42')](handleError(_0x26632a,null));};exports[_0x3b75('0x47')]=function(_0x478c1f,_0x2657a8){if(_0x478c1f[_0x3b75('0x48')]['id']){delete _0x478c1f[_0x3b75('0x48')]['id'];}return db[_0x3b75('0x2a')][_0x3b75('0x49')]({'where':{'id':_0x478c1f[_0x3b75('0x43')]['id']}})['then'](handleEntityNotFound(_0x2657a8,null))[_0x3b75('0x24')](saveUpdates(_0x478c1f[_0x3b75('0x48')],null))['then'](respondWithResult(_0x2657a8,null))[_0x3b75('0x42')](handleError(_0x2657a8,null));};exports['destroy']=function(_0x4c1b1c,_0x2b608d){return db['CmCustomField'][_0x3b75('0x49')]({'where':{'id':_0x4c1b1c[_0x3b75('0x43')]['id']}})[_0x3b75('0x24')](handleEntityNotFound(_0x2b608d,null))[_0x3b75('0x24')](removeEntity(_0x2b608d,null))[_0x3b75('0x42')](handleError(_0x2b608d,null));};exports[_0x3b75('0x4a')]=function(_0xb3bda9,_0x503abc){var _0x50d0fc;return db['sequelize']['transaction'](function(_0x5d57a5){return db[_0x3b75('0x2a')][_0x3b75('0x4a')](_0xb3bda9[_0x3b75('0x48')],{'transaction':_0x5d57a5})[_0x3b75('0x24')](function(_0x3f66f5){_0x50d0fc=_0x3f66f5;var _0x3283e7={'type':db[_0x3b75('0x4b')][_0x3b75('0x4c')],'transaction':_0x5d57a5};switch(_0xb3bda9['body'][_0x3b75('0x2c')]){case _0x3b75('0x4d'):_0x3283e7[_0x3b75('0x2c')]=db[_0x3b75('0x4b')][_0x3b75('0x4c')];break;case _0x3b75('0x4e'):_0x3283e7[_0x3b75('0x2c')]=db[_0x3b75('0x4b')][_0x3b75('0x4f')];break;case _0x3b75('0x50'):_0x3283e7[_0x3b75('0x2c')]=db[_0x3b75('0x4b')][_0x3b75('0x51')];_0x3283e7[_0x3b75('0x52')]=![];break;default:}return db[_0x3b75('0x53')][_0x3b75('0x54')]['addColumn'](_0x3b75('0x55'),util[_0x3b75('0x56')](_0x3b75('0x57'),_0x50d0fc['id']),_0x3283e7);})['then'](function(){return _0x50d0fc;});})[_0x3b75('0x24')](respondWithResult(_0x503abc,0xc9))[_0x3b75('0x42')](handleError(_0x503abc,null));};
\ No newline at end of file
+var _0x6a32=['path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','CmCustomField','fieldName','type','key','differenceBy','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','body','sequelize','create','Sequelize','TEXT','number','INTEGER','BOOLEAN','queryInterface','addColumn','cf_%d','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a32,0x159));var _0x26a3=function(_0x11acf6,_0x864458){_0x11acf6=_0x11acf6-0x0;var _0x4cdacc=_0x6a32[_0x11acf6];return _0x4cdacc;};'use strict';var emlformat=require(_0x26a3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26a3('0x1'));var jsonpatch=require(_0x26a3('0x2'));var rp=require('request-promise');var moment=require(_0x26a3('0x3'));var BPromise=require(_0x26a3('0x4'));var Mustache=require(_0x26a3('0x5'));var util=require(_0x26a3('0x6'));var path=require(_0x26a3('0x7'));var sox=require(_0x26a3('0x8'));var csv=require(_0x26a3('0x9'));var ejs=require(_0x26a3('0xa'));var fs=require('fs');var fs_extra=require(_0x26a3('0xb'));var _=require(_0x26a3('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x26a3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x26a3('0x9'));var querystring=require(_0x26a3('0xe'));var Papa=require('papaparse');var Redis=require(_0x26a3('0xf'));var authService=require(_0x26a3('0x10'));var qs=require(_0x26a3('0x11'));var as=require(_0x26a3('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26a3('0x13'))(_0x26a3('0x14'));var utils=require(_0x26a3('0x15'));var config=require(_0x26a3('0x16'));var licenseUtil=require(_0x26a3('0x17'));var db=require(_0x26a3('0x18'))['db'];function respondWithStatusCode(_0x164cdd,_0x5eebd0){_0x5eebd0=_0x5eebd0||0xcc;return function(_0x559447){if(_0x559447){return _0x164cdd[_0x26a3('0x19')](_0x5eebd0);}return _0x164cdd[_0x26a3('0x1a')](_0x5eebd0)[_0x26a3('0x1b')]();};}function respondWithResult(_0x3078ee,_0x2a2e21){_0x2a2e21=_0x2a2e21||0xc8;return function(_0x5a465e){if(_0x5a465e){return _0x3078ee[_0x26a3('0x1a')](_0x2a2e21)[_0x26a3('0x1c')](_0x5a465e);}};}function respondWithFilteredResult(_0x46b1e6,_0x4a9aa7){return function(_0x2edab3){if(_0x2edab3){var _0x20e13c=typeof _0x4a9aa7['offset']===_0x26a3('0x1d')&&typeof _0x4a9aa7[_0x26a3('0x1e')]===_0x26a3('0x1d');var _0x107291=_0x2edab3[_0x26a3('0x1f')];var _0x4b908c=_0x20e13c?0x0:_0x4a9aa7[_0x26a3('0x20')];var _0x2fb5ed=_0x20e13c?_0x2edab3['count']:_0x4a9aa7['offset']+_0x4a9aa7['limit'];var _0x1605e7;if(_0x2fb5ed>=_0x107291){_0x2fb5ed=_0x107291;_0x1605e7=0xc8;}else{_0x1605e7=0xce;}_0x46b1e6[_0x26a3('0x1a')](_0x1605e7);return _0x46b1e6[_0x26a3('0x21')](_0x26a3('0x22'),_0x4b908c+'-'+_0x2fb5ed+'/'+_0x107291)[_0x26a3('0x1c')](_0x2edab3);}return null;};}function patchUpdates(_0x2b6d12){return function(_0x3f43ee){try{jsonpatch[_0x26a3('0x23')](_0x3f43ee,_0x2b6d12,!![]);}catch(_0x5e1f37){return BPromise[_0x26a3('0x24')](_0x5e1f37);}return _0x3f43ee['save']();};}function saveUpdates(_0x47c1ca,_0xb99c19){return function(_0x39d4bd){if(_0x39d4bd){return _0x39d4bd[_0x26a3('0x25')](_0x47c1ca)[_0x26a3('0x26')](function(_0x8719eb){return _0x8719eb;});}return null;};}function removeEntity(_0x4f7c5c,_0x3aba89){return function(_0x39869f){if(_0x39869f){return _0x39869f[_0x26a3('0x27')]()[_0x26a3('0x26')](function(){_0x4f7c5c[_0x26a3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b429d,_0x49098f){return function(_0x17cc92){if(!_0x17cc92){_0x4b429d['sendStatus'](0x194);}return _0x17cc92;};}function handleError(_0x4a3f04,_0x23cc1f){_0x23cc1f=_0x23cc1f||0x1f4;return function(_0x5272af){logger[_0x26a3('0x28')](_0x5272af[_0x26a3('0x29')]);if(_0x5272af['name']){delete _0x5272af[_0x26a3('0x2a')];}_0x4a3f04[_0x26a3('0x1a')](_0x23cc1f)[_0x26a3('0x2b')](_0x5272af);};}exports['index']=function(_0x2fc137,_0x5f705a){var _0x38f9de={},_0x5b9390={},_0x477ee5={'count':0x0,'rows':[]};var _0x3b24b3=_[_0x26a3('0x2c')](db[_0x26a3('0x2d')]['rawAttributes'],function(_0x40937d){return{'name':_0x40937d[_0x26a3('0x2e')],'type':_0x40937d[_0x26a3('0x2f')][_0x26a3('0x30')]};});_0x5b9390['model']=_[_0x26a3('0x31')](_['map'](_0x3b24b3,_0x26a3('0x2a')),[_0x26a3('0x2a')]);_0x5b9390[_0x26a3('0x32')]=_[_0x26a3('0x33')](_0x2fc137[_0x26a3('0x32')]);_0x5b9390[_0x26a3('0x34')]=_['intersection'](_0x5b9390[_0x26a3('0x35')],_0x5b9390[_0x26a3('0x32')]);_0x38f9de[_0x26a3('0x36')]=_[_0x26a3('0x37')](_0x5b9390[_0x26a3('0x35')],qs[_0x26a3('0x38')](_0x2fc137[_0x26a3('0x32')][_0x26a3('0x38')]));_0x38f9de[_0x26a3('0x36')]=_0x38f9de[_0x26a3('0x36')][_0x26a3('0x39')]?_0x38f9de[_0x26a3('0x36')]:_0x5b9390[_0x26a3('0x35')];if(!_0x2fc137[_0x26a3('0x32')][_0x26a3('0x3a')](_0x26a3('0x3b'))){_0x38f9de[_0x26a3('0x1e')]=qs[_0x26a3('0x1e')](_0x2fc137[_0x26a3('0x32')][_0x26a3('0x1e')]);_0x38f9de['offset']=qs['offset'](_0x2fc137[_0x26a3('0x32')][_0x26a3('0x20')]);}_0x38f9de[_0x26a3('0x3c')]=qs['sort'](_0x2fc137[_0x26a3('0x32')][_0x26a3('0x3d')]);_0x38f9de['where']=qs['filters'](_[_0x26a3('0x3e')](_0x2fc137[_0x26a3('0x32')],_0x5b9390[_0x26a3('0x34')]),_0x3b24b3);if(_0x2fc137[_0x26a3('0x32')][_0x26a3('0x3f')]){_0x38f9de[_0x26a3('0x40')]=_['merge'](_0x38f9de[_0x26a3('0x40')],{'$or':_[_0x26a3('0x2c')](_0x3b24b3,function(_0x3c41ea){if(_0x3c41ea[_0x26a3('0x2f')]!==_0x26a3('0x41')){var _0x40e6cd={};_0x40e6cd[_0x3c41ea['name']]={'$like':'%'+_0x2fc137[_0x26a3('0x32')]['filter']+'%'};return _0x40e6cd;}})});}_0x38f9de=_[_0x26a3('0x42')]({},_0x38f9de,_0x2fc137[_0x26a3('0x43')]);var _0x493df7={'where':_0x38f9de[_0x26a3('0x40')]};return db[_0x26a3('0x2d')]['count'](_0x493df7)['then'](function(_0x6739c0){_0x477ee5[_0x26a3('0x1f')]=_0x6739c0;if(_0x2fc137[_0x26a3('0x32')]['includeAll']){_0x38f9de['include']=[{'all':!![]}];}return db[_0x26a3('0x2d')][_0x26a3('0x44')](_0x38f9de);})[_0x26a3('0x26')](function(_0x4eda90){_0x477ee5[_0x26a3('0x45')]=_0x4eda90;return _0x477ee5;})['then'](respondWithFilteredResult(_0x5f705a,_0x38f9de))[_0x26a3('0x46')](handleError(_0x5f705a,null));};exports[_0x26a3('0x47')]=function(_0x5483d2,_0xc9bf50){var _0x265976={'raw':!![],'where':{'id':_0x5483d2[_0x26a3('0x48')]['id']}},_0xee2f82={};_0xee2f82['model']=_[_0x26a3('0x33')](db[_0x26a3('0x2d')][_0x26a3('0x49')]);_0xee2f82['query']=_[_0x26a3('0x33')](_0x5483d2[_0x26a3('0x32')]);_0xee2f82[_0x26a3('0x34')]=_[_0x26a3('0x37')](_0xee2f82[_0x26a3('0x35')],_0xee2f82[_0x26a3('0x32')]);_0x265976[_0x26a3('0x36')]=_['intersection'](_0xee2f82[_0x26a3('0x35')],qs[_0x26a3('0x38')](_0x5483d2[_0x26a3('0x32')][_0x26a3('0x38')]));_0x265976['attributes']=_0x265976[_0x26a3('0x36')][_0x26a3('0x39')]?_0x265976[_0x26a3('0x36')]:_0xee2f82[_0x26a3('0x35')];if(_0x5483d2[_0x26a3('0x32')][_0x26a3('0x4a')]){_0x265976[_0x26a3('0x4b')]=[{'all':!![]}];}_0x265976=_[_0x26a3('0x42')]({},_0x265976,_0x5483d2[_0x26a3('0x43')]);return db[_0x26a3('0x2d')][_0x26a3('0x4c')](_0x265976)['then'](handleEntityNotFound(_0xc9bf50,null))[_0x26a3('0x26')](respondWithResult(_0xc9bf50,null))['catch'](handleError(_0xc9bf50,null));};exports['update']=function(_0x4a30e4,_0x459fd9){if(_0x4a30e4['body']['id']){delete _0x4a30e4[_0x26a3('0x4d')]['id'];}return db[_0x26a3('0x2d')][_0x26a3('0x4c')]({'where':{'id':_0x4a30e4[_0x26a3('0x48')]['id']}})[_0x26a3('0x26')](handleEntityNotFound(_0x459fd9,null))[_0x26a3('0x26')](saveUpdates(_0x4a30e4['body'],null))[_0x26a3('0x26')](respondWithResult(_0x459fd9,null))[_0x26a3('0x46')](handleError(_0x459fd9,null));};exports[_0x26a3('0x27')]=function(_0x421d1f,_0x2aa9c2){return db[_0x26a3('0x2d')][_0x26a3('0x4c')]({'where':{'id':_0x421d1f[_0x26a3('0x48')]['id']}})[_0x26a3('0x26')](handleEntityNotFound(_0x2aa9c2,null))['then'](removeEntity(_0x2aa9c2,null))[_0x26a3('0x46')](handleError(_0x2aa9c2,null));};exports['create']=function(_0x47b941,_0x32b28b){var _0x31ae96;return db[_0x26a3('0x4e')]['transaction'](function(_0x36eb1d){return db['CmCustomField'][_0x26a3('0x4f')](_0x47b941[_0x26a3('0x4d')],{'transaction':_0x36eb1d})[_0x26a3('0x26')](function(_0x5b1a72){_0x31ae96=_0x5b1a72;var _0xb26e1={'type':db[_0x26a3('0x50')][_0x26a3('0x51')],'transaction':_0x36eb1d};switch(_0x47b941[_0x26a3('0x4d')]['type']){case'text':_0xb26e1['type']=db[_0x26a3('0x50')][_0x26a3('0x51')];break;case _0x26a3('0x52'):_0xb26e1[_0x26a3('0x2f')]=db[_0x26a3('0x50')][_0x26a3('0x53')];break;case'switch':_0xb26e1[_0x26a3('0x2f')]=db[_0x26a3('0x50')][_0x26a3('0x54')];_0xb26e1['defaultValue']=![];break;default:}return db[_0x26a3('0x4e')][_0x26a3('0x55')][_0x26a3('0x56')]('cm_contacts',util['format'](_0x26a3('0x57'),_0x31ae96['id']),_0xb26e1);})[_0x26a3('0x26')](function(){return _0x31ae96;});})[_0x26a3('0x26')](respondWithResult(_0x32b28b,0xc9))[_0x26a3('0x46')](handleError(_0x32b28b,null));};
\ No newline at end of file
index 7c42f76..9c3eeeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76eb=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','lodash','util','../../config/logger','moment'];(function(_0x4dccbe,_0x5a8cb6){var _0x27d26a=function(_0x4a7a2e){while(--_0x4a7a2e){_0x4dccbe['push'](_0x4dccbe['shift']());}};_0x27d26a(++_0x5a8cb6);}(_0x76eb,0x18f));var _0xb76e=function(_0x19ae7a,_0x5d3b51){_0x19ae7a=_0x19ae7a-0x0;var _0x30d82e=_0x76eb[_0x19ae7a];return _0x30d82e;};'use strict';var _=require(_0xb76e('0x0'));var util=require(_0xb76e('0x1'));var logger=require(_0xb76e('0x2'))('api');var moment=require(_0xb76e('0x3'));var BPromise=require(_0xb76e('0x4'));var rp=require(_0xb76e('0x5'));var fs=require('fs');var path=require(_0xb76e('0x6'));var rimraf=require(_0xb76e('0x7'));var config=require(_0xb76e('0x8'));var attributes=require(_0xb76e('0x9'));module[_0xb76e('0xa')]=function(_0x3222a7,_0x3bff13){return _0x3222a7[_0xb76e('0xb')](_0xb76e('0xc'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1cf=['path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','lodash','util','api','moment','bluebird','request-promise'];(function(_0xb01a27,_0x217e16){var _0x2b62ae=function(_0x4e6c3a){while(--_0x4e6c3a){_0xb01a27['push'](_0xb01a27['shift']());}};_0x2b62ae(++_0x217e16);}(_0xb1cf,0xb0));var _0xfb1c=function(_0x1d69d2,_0x2ef689){_0x1d69d2=_0x1d69d2-0x0;var _0x10b3ba=_0xb1cf[_0x1d69d2];return _0x10b3ba;};'use strict';var _=require(_0xfb1c('0x0'));var util=require(_0xfb1c('0x1'));var logger=require('../../config/logger')(_0xfb1c('0x2'));var moment=require(_0xfb1c('0x3'));var BPromise=require(_0xfb1c('0x4'));var rp=require(_0xfb1c('0x5'));var fs=require('fs');var path=require(_0xfb1c('0x6'));var rimraf=require(_0xfb1c('0x7'));var config=require(_0xfb1c('0x8'));var attributes=require(_0xfb1c('0x9'));module[_0xfb1c('0xa')]=function(_0x471001,_0x5181eb){return _0x471001['define'](_0xfb1c('0xb'),attributes,{'tableName':_0xfb1c('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 360473b..46bcdd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c8b=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util'];(function(_0x5d3224,_0x364b62){var _0x411574=function(_0xdc11ab){while(--_0xdc11ab){_0x5d3224['push'](_0x5d3224['shift']());}};_0x411574(++_0x364b62);}(_0x3c8b,0x7c));var _0xb3c8=function(_0x100da9,_0x4c77df){_0x100da9=_0x100da9-0x0;var _0x558792=_0x3c8b[_0x100da9];return _0x558792;};'use strict';var _=require(_0xb3c8('0x0'));var util=require(_0xb3c8('0x1'));var moment=require(_0xb3c8('0x2'));var BPromise=require(_0xb3c8('0x3'));var rs=require(_0xb3c8('0x4'));var fs=require('fs');var Redis=require(_0xb3c8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb3c8('0x6'));var logger=require('../../config/logger')(_0xb3c8('0x7'));var config=require(_0xb3c8('0x8'));var jayson=require(_0xb3c8('0x9'));var client=jayson[_0xb3c8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf7a5e2,_0x3cce80,_0x142a64){return new BPromise(function(_0x4a074b,_0xc782b3){return client[_0xb3c8('0xb')](_0xf7a5e2,_0x142a64)[_0xb3c8('0xc')](function(_0x1dcd57){logger[_0xb3c8('0xd')](_0xb3c8('0xe'),_0x3cce80,_0xb3c8('0xf'));logger[_0xb3c8('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x3cce80,_0xb3c8('0xf'),JSON[_0xb3c8('0x11')](_0x1dcd57));if(_0x1dcd57[_0xb3c8('0x12')]){if(_0x1dcd57[_0xb3c8('0x12')]['code']===0x1f4){logger[_0xb3c8('0x12')](_0xb3c8('0xe'),_0x3cce80,_0x1dcd57[_0xb3c8('0x12')]['message']);return _0xc782b3(_0x1dcd57[_0xb3c8('0x12')][_0xb3c8('0x13')]);}logger[_0xb3c8('0x12')](_0xb3c8('0xe'),_0x3cce80,_0x1dcd57[_0xb3c8('0x12')][_0xb3c8('0x13')]);return _0x4a074b(_0x1dcd57['error']['message']);}else{logger[_0xb3c8('0xd')](_0xb3c8('0xe'),_0x3cce80,_0xb3c8('0xf'));_0x4a074b(_0x1dcd57['result'][_0xb3c8('0x13')]);}})[_0xb3c8('0x14')](function(_0x363cc8){logger['error']('CmCustomField,\x20%s,\x20%s',_0x3cce80,_0x363cc8);_0xc782b3(_0x363cc8);});});}
\ No newline at end of file
+var _0xfc88=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','result','lodash','moment','bluebird','randomstring'];(function(_0x59c497,_0x23f970){var _0x387f6d=function(_0x2437fe){while(--_0x2437fe){_0x59c497['push'](_0x59c497['shift']());}};_0x387f6d(++_0x23f970);}(_0xfc88,0xd8));var _0x8fc8=function(_0x431525,_0x2ba0a5){_0x431525=_0x431525-0x0;var _0x26c2b0=_0xfc88[_0x431525];return _0x26c2b0;};'use strict';var _=require(_0x8fc8('0x0'));var util=require('util');var moment=require(_0x8fc8('0x1'));var BPromise=require(_0x8fc8('0x2'));var rs=require(_0x8fc8('0x3'));var fs=require('fs');var Redis=require(_0x8fc8('0x4'));var db=require(_0x8fc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fc8('0x6'))(_0x8fc8('0x7'));var config=require(_0x8fc8('0x8'));var jayson=require(_0x8fc8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c42a1,_0x50b812,_0x30e4cf){return new BPromise(function(_0x4da044,_0x4fac8f){return client[_0x8fc8('0xa')](_0x2c42a1,_0x30e4cf)[_0x8fc8('0xb')](function(_0x255e99){logger[_0x8fc8('0xc')](_0x8fc8('0xd'),_0x50b812,_0x8fc8('0xe'));logger[_0x8fc8('0xf')](_0x8fc8('0x10'),_0x50b812,'request\x20sent',JSON[_0x8fc8('0x11')](_0x255e99));if(_0x255e99[_0x8fc8('0x12')]){if(_0x255e99[_0x8fc8('0x12')]['code']===0x1f4){logger[_0x8fc8('0x12')](_0x8fc8('0xd'),_0x50b812,_0x255e99[_0x8fc8('0x12')]['message']);return _0x4fac8f(_0x255e99[_0x8fc8('0x12')]['message']);}logger[_0x8fc8('0x12')](_0x8fc8('0xd'),_0x50b812,_0x255e99[_0x8fc8('0x12')]['message']);return _0x4da044(_0x255e99['error']['message']);}else{logger['info'](_0x8fc8('0xd'),_0x50b812,_0x8fc8('0xe'));_0x4da044(_0x255e99[_0x8fc8('0x13')]['message']);}})['catch'](function(_0x5eb26e){logger[_0x8fc8('0x12')]('CmCustomField,\x20%s,\x20%s',_0x50b812,_0x5eb26e);_0x4fac8f(_0x5eb26e);});});}
\ No newline at end of file
index be1ca5f..f886b87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd714=['index','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated'];(function(_0x4bc310,_0x439b00){var _0x441974=function(_0x5ae338){while(--_0x5ae338){_0x4bc310['push'](_0x4bc310['shift']());}};_0x441974(++_0x439b00);}(_0xd714,0x1e4));var _0x4d71=function(_0x4057f9,_0x17c5b5){_0x4057f9=_0x4057f9-0x0;var _0x5552b7=_0xd714[_0x4057f9];return _0x5552b7;};'use strict';var multer=require(_0x4d71('0x0'));var util=require(_0x4d71('0x1'));var path=require('path');var timeout=require(_0x4d71('0x2'));var express=require(_0x4d71('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4d71('0x4'));var interaction=require(_0x4d71('0x5'));var config=require(_0x4d71('0x6'));var controller=require(_0x4d71('0x7'));router[_0x4d71('0x8')]('/',auth[_0x4d71('0x9')](),controller[_0x4d71('0xa')]);router[_0x4d71('0x8')](_0x4d71('0xb'),auth[_0x4d71('0x9')](),controller[_0x4d71('0xc')]);router[_0x4d71('0xd')]('/',auth[_0x4d71('0x9')](),controller[_0x4d71('0xe')]);router[_0x4d71('0xf')](_0x4d71('0xb'),auth['isAuthenticated'](),controller[_0x4d71('0x10')]);router[_0x4d71('0x11')](_0x4d71('0xb'),auth[_0x4d71('0x9')](),controller['destroy']);module[_0x4d71('0x12')]=router;
\ No newline at end of file
+var _0x22ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','isAuthenticated','show','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x461ed8,_0x52fd64){var _0x1621b7=function(_0x4ed2f3){while(--_0x4ed2f3){_0x461ed8['push'](_0x461ed8['shift']());}};_0x1621b7(++_0x52fd64);}(_0x22ed,0x1a9));var _0xd22e=function(_0x1fe8d6,_0x452e8d){_0x1fe8d6=_0x1fe8d6-0x0;var _0x134df5=_0x22ed[_0x1fe8d6];return _0x134df5;};'use strict';var multer=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var path=require(_0xd22e('0x2'));var timeout=require(_0xd22e('0x3'));var express=require(_0xd22e('0x4'));var router=express[_0xd22e('0x5')]();var fs_extra=require(_0xd22e('0x6'));var auth=require(_0xd22e('0x7'));var interaction=require(_0xd22e('0x8'));var config=require(_0xd22e('0x9'));var controller=require(_0xd22e('0xa'));router[_0xd22e('0xb')]('/',auth['isAuthenticated'](),controller[_0xd22e('0xc')]);router[_0xd22e('0xb')]('/:id',auth[_0xd22e('0xd')](),controller[_0xd22e('0xe')]);router['post']('/',auth[_0xd22e('0xd')](),controller['create']);router['put'](_0xd22e('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd22e('0xf'),auth[_0xd22e('0xd')](),controller[_0xd22e('0x10')]);module[_0xd22e('0x11')]=router;
\ No newline at end of file
index 3790c05..1333c96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7439=['BOOLEAN','DATE','format','INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x2e35f4,_0x263383){var _0x2e5ca9=function(_0x193ce9){while(--_0x193ce9){_0x2e35f4['push'](_0x2e35f4['shift']());}};_0x2e5ca9(++_0x263383);}(_0x7439,0x125));var _0x9743=function(_0x33932c,_0x2b064e){_0x33932c=_0x33932c-0x0;var _0x5163c8=_0x7439[_0x33932c];return _0x5163c8;};'use strict';var moment=require(_0x9743('0x0'));var Sequelize=require(_0x9743('0x1'));module[_0x9743('0x2')]={'phone':{'type':Sequelize[_0x9743('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x9743('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x9743('0x5')],'defaultValue':moment()[_0x9743('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9743('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9743('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9743('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x9743('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9743('0x7')],'unique':_0x9743('0x8')},'ListId':{'type':Sequelize[_0x9743('0x7')],'unique':_0x9743('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x9743('0x7')],'unique':_0x9743('0x8')},'CampaignId':{'type':Sequelize[_0x9743('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9743('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9743('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9743('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x9743('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize['STRING']},'recallmeNotifiedDate':{'type':Sequelize[_0x9743('0x5')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
+var _0x580a=['moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','contactListQueue'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x580a,0x104));var _0xa580=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x580a[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0xa580('0x0'));var Sequelize=require(_0xa580('0x1'));module[_0xa580('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xa580('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xa580('0x4')],'defaultValue':moment()[_0xa580('0x5')](_0xa580('0x6'))},'countbusyretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xa580('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xa580('0x4')]},'priority':{'type':Sequelize[_0xa580('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xa580('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xa580('0x7')],'unique':_0xa580('0x9')},'ListId':{'type':Sequelize[_0xa580('0x7')],'unique':_0xa580('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xa580('0x9')},'CampaignId':{'type':Sequelize[_0xa580('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xa580('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xa580('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xa580('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0xa580('0x4')],'allowNull':!![],'defaultValue':null}};
\ No newline at end of file
index e296c86..d64a639 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledat','recallme','LOCK','Company','CmList','Queue','dialActive','getPreviewRecall','UPDATE','Contact','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','push','utcOffset','getTimezone','timezones','lodash','../../mysqldb','status','offset','limit','undefined','count','set','Content-Range','json','update','then','error','stack','name','send','index','map','CmHopper','rawAttributes','key','model','query','keys','filters','concat','$gt','$gte','$lt','$lte','$eq','$not','$between','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$any','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','include','rows','catch','show','params','find','create','body','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','direction','isEmpty','hopperIds','priority','ASC'];(function(_0x2d634f,_0x18dcca){var _0x176d34=function(_0x5401d0){while(--_0x5401d0){_0x2d634f['push'](_0x2d634f['shift']());}};_0x176d34(++_0x18dcca);}(_0x8958,0x93));var _0x8895=function(_0x205d67,_0x19276e){_0x205d67=_0x205d67-0x0;var _0x23d16c=_0x8958[_0x205d67];return _0x23d16c;};'use strict';var moment=require('moment');var _=require(_0x8895('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require('../../config/environment');var db=require(_0x8895('0x1'))['db'];function respondWithResult(_0x56e738,_0x38d5d7){_0x38d5d7=_0x38d5d7||0xc8;return function(_0xce4955){if(_0xce4955){return _0x56e738[_0x8895('0x2')](_0x38d5d7)['json'](_0xce4955);}};}function respondWithFilteredResult(_0x22fa52,_0x2f03ad){return function(_0x124e1e){if(_0x124e1e){var _0x40cec6=typeof _0x2f03ad[_0x8895('0x3')]==='undefined'&&typeof _0x2f03ad[_0x8895('0x4')]===_0x8895('0x5');var _0x408d4b=_0x124e1e[_0x8895('0x6')];var _0x6eab1e=_0x40cec6?0x0:_0x2f03ad[_0x8895('0x3')];var _0x22a12b=_0x40cec6?_0x124e1e[_0x8895('0x6')]:_0x2f03ad[_0x8895('0x3')]+_0x2f03ad[_0x8895('0x4')];var _0x4d1358;if(_0x22a12b>=_0x408d4b){_0x22a12b=_0x408d4b;_0x4d1358=0xc8;}else{_0x4d1358=0xce;}_0x22fa52[_0x8895('0x2')](_0x4d1358);return _0x22fa52[_0x8895('0x7')](_0x8895('0x8'),_0x6eab1e+'-'+_0x22a12b+'/'+_0x408d4b)[_0x8895('0x9')](_0x124e1e);}return null;};}function saveUpdates(_0x446e1a,_0xaf93bc){return function(_0x5af0ef){if(_0x5af0ef){return _0x5af0ef[_0x8895('0xa')](_0x446e1a)[_0x8895('0xb')](function(_0x56c18e){return _0x56c18e;});}return null;};}function handleEntityNotFound(_0x57d40a,_0x47b9fe){return function(_0x9191b8){if(!_0x9191b8){_0x57d40a['sendStatus'](0x194);}return _0x9191b8;};}function handleError(_0x4156f5,_0x337101){_0x337101=_0x337101||0x1f4;return function(_0x195789){logger[_0x8895('0xc')](_0x195789[_0x8895('0xd')]);if(_0x195789['name']){delete _0x195789[_0x8895('0xe')];}_0x4156f5[_0x8895('0x2')](_0x337101)[_0x8895('0xf')](_0x195789);};}exports[_0x8895('0x10')]=function(_0x2848b7,_0x1b5c82){var _0x304be6={},_0x26cee0={},_0x135c11={'count':0x0,'rows':[]};var _0x2da618=_[_0x8895('0x11')](db[_0x8895('0x12')][_0x8895('0x13')],function(_0x54e6d4){return{'name':_0x54e6d4['fieldName'],'type':_0x54e6d4['type'][_0x8895('0x14')]};});_0x26cee0[_0x8895('0x15')]=_[_0x8895('0x11')](_0x2da618,_0x8895('0xe'));_0x26cee0[_0x8895('0x16')]=_[_0x8895('0x17')](_0x2848b7[_0x8895('0x16')]);_0x26cee0[_0x8895('0x18')]=_['intersection'](_0x26cee0[_0x8895('0x15')],_0x26cee0[_0x8895('0x16')]);_0x26cee0[_0x8895('0x18')]=_[_0x8895('0x19')](_0x26cee0[_0x8895('0x18')],['$and','$or',_0x8895('0x1a'),_0x8895('0x1b'),_0x8895('0x1c'),_0x8895('0x1d'),'$ne',_0x8895('0x1e'),_0x8895('0x1f'),_0x8895('0x20'),'$notBetween','$in',_0x8895('0x21'),'$like',_0x8895('0x22'),_0x8895('0x23'),_0x8895('0x24'),_0x8895('0x25'),_0x8895('0x26'),'$contains','$contained',_0x8895('0x27')]);_0x304be6[_0x8895('0x28')]=_[_0x8895('0x29')](_0x26cee0[_0x8895('0x15')],qs[_0x8895('0x2a')](_0x2848b7['query']['fields']));_0x304be6[_0x8895('0x28')]=_0x304be6[_0x8895('0x28')][_0x8895('0x2b')]?_0x304be6[_0x8895('0x28')]:_0x26cee0[_0x8895('0x15')];if(!_0x2848b7['query'][_0x8895('0x2c')]('nolimit')){_0x304be6[_0x8895('0x4')]=qs['limit'](_0x2848b7[_0x8895('0x16')][_0x8895('0x4')]);_0x304be6[_0x8895('0x3')]=qs[_0x8895('0x3')](_0x2848b7[_0x8895('0x16')]['offset']);}_0x304be6[_0x8895('0x2d')]=qs[_0x8895('0x2e')](_0x2848b7[_0x8895('0x16')][_0x8895('0x2e')]);_0x304be6[_0x8895('0x2f')]=qs['filters'](_[_0x8895('0x30')](_0x2848b7['query'],_0x26cee0[_0x8895('0x18')]),_0x2da618);if(_0x2848b7['query'][_0x8895('0x31')]){_0x304be6[_0x8895('0x2f')]=_[_0x8895('0x32')](_0x304be6[_0x8895('0x2f')],{'$or':_[_0x8895('0x11')](_0x2da618,function(_0x4ee352){if(_0x4ee352[_0x8895('0x33')]!=='VIRTUAL'){var _0x57f58a={};_0x57f58a[_0x4ee352[_0x8895('0xe')]]={'$like':'%'+_0x2848b7[_0x8895('0x16')][_0x8895('0x31')]+'%'};return _0x57f58a;}})});}_0x304be6=_[_0x8895('0x32')]({},_0x304be6,_0x2848b7[_0x8895('0x34')]);var _0x4b7fe0={'where':_0x304be6[_0x8895('0x2f')]};return db[_0x8895('0x12')]['count'](_0x4b7fe0)[_0x8895('0xb')](function(_0x54ca09){_0x135c11[_0x8895('0x6')]=_0x54ca09;if(_0x2848b7[_0x8895('0x16')]['includeAll']){_0x304be6[_0x8895('0x35')]=[{'all':!![]}];}return db[_0x8895('0x12')]['findAll'](_0x304be6);})['then'](function(_0x202130){_0x135c11[_0x8895('0x36')]=_0x202130;return _0x135c11;})[_0x8895('0xb')](respondWithFilteredResult(_0x1b5c82,_0x304be6))[_0x8895('0x37')](handleError(_0x1b5c82,null));};exports[_0x8895('0x38')]=function(_0x4917d1,_0x42ed1f){var _0x25c854={'raw':!![],'where':{'id':_0x4917d1[_0x8895('0x39')]['id']}},_0x394d7d={};_0x394d7d[_0x8895('0x15')]=_[_0x8895('0x17')](db['CmHopper'][_0x8895('0x13')]);_0x394d7d['query']=_[_0x8895('0x17')](_0x4917d1[_0x8895('0x16')]);_0x394d7d['filters']=_[_0x8895('0x29')](_0x394d7d['model'],_0x394d7d[_0x8895('0x16')]);_0x25c854['attributes']=_['intersection'](_0x394d7d['model'],qs['fields'](_0x4917d1['query']['fields']));_0x25c854[_0x8895('0x28')]=_0x25c854[_0x8895('0x28')]['length']?_0x25c854['attributes']:_0x394d7d[_0x8895('0x15')];if(_0x4917d1[_0x8895('0x16')]['includeAll']){_0x25c854[_0x8895('0x35')]=[{'all':!![]}];}_0x25c854=_[_0x8895('0x32')]({},_0x25c854,_0x4917d1[_0x8895('0x34')]);return db[_0x8895('0x12')][_0x8895('0x3a')](_0x25c854)['then'](handleEntityNotFound(_0x42ed1f,null))['then'](respondWithResult(_0x42ed1f,null))['catch'](handleError(_0x42ed1f,null));};exports[_0x8895('0x3b')]=function(_0x5ab709,_0x44ab93){return db[_0x8895('0x12')][_0x8895('0x3b')](_0x5ab709[_0x8895('0x3c')],{})['then'](respondWithResult(_0x44ab93,0xc9))[_0x8895('0x37')](handleError(_0x44ab93,null));};exports[_0x8895('0xa')]=function(_0x3413cd,_0x167302){if(_0x3413cd[_0x8895('0x3c')]['id']){delete _0x3413cd[_0x8895('0x3c')]['id'];}return db[_0x8895('0x12')][_0x8895('0x3a')]({'where':{'id':_0x3413cd['params']['id']}})[_0x8895('0xb')](handleEntityNotFound(_0x167302,null))[_0x8895('0xb')](saveUpdates(_0x3413cd['body'],null))[_0x8895('0xb')](respondWithResult(_0x167302,null))['catch'](handleError(_0x167302,null));};exports['describe']=function(_0x13546d,_0x337a9f){return db[_0x8895('0x12')]['describe']()[_0x8895('0xb')](respondWithResult(_0x337a9f,null))['catch'](handleError(_0x337a9f,null));};exports[_0x8895('0x3d')]=function(_0x152197,_0xb3ecd6){var _0x1ca539;var _0x2f3bf1=_0x152197[_0x8895('0x39')]['id'];return db[_0x8895('0x12')]['find']({'where':{'id':_0x152197['params']['id']}})[_0x8895('0xb')](handleEntityNotFound(_0xb3ecd6,null))[_0x8895('0xb')](function(_0x5dfb6f){if(_0x5dfb6f){return _0x5dfb6f[_0x8895('0x3d')]()['then'](function(_0x4e8af3){return _0x4e8af3;});}})[_0x8895('0xb')](function(_0x4d52ac){_0x1ca539=_0x4d52ac;if(_0x4d52ac){if(_0x4d52ac[_0x8895('0x3e')]||_0x4d52ac[_0x8895('0x3f')]){return db[_0x4d52ac[_0x8895('0x3e')]?_0x8895('0x40'):_0x8895('0x41')][_0x8895('0x3a')]({'where':{'id':_0x4d52ac[_0x8895('0x3e')]?_0x4d52ac[_0x8895('0x3e')]:_0x4d52ac['CampaignId']},'attributes':['id',_0x8895('0xe')],'raw':!![]});}}})[_0x8895('0xb')](function(_0x2f81f7){var _0x5a5bc6={};if(_0x2f81f7){_[_0x8895('0x32')](_0x5a5bc6,_[_0x8895('0x42')](_0x1ca539[_0x8895('0x43')],[_0x8895('0x44'),_0x8895('0x45'),'id']));_0x5a5bc6[_0x8895('0x46')]=0x15;_0x5a5bc6[_0x8895('0x47')]=_0x8895('0x48');_0x5a5bc6[_0x8895('0x49')]=_0x2f81f7[_0x8895('0xe')];_0x5a5bc6['membername']=_0x152197[_0x8895('0x4a')][_0x8895('0xe')];_0x5a5bc6[_0x8895('0x4b')]=_0x152197[_0x8895('0x4a')]['id'];_0x5a5bc6[_0x8895('0x48')]=!![];_0x5a5bc6['deletedat']=moment()[_0x8895('0x4c')](_0x8895('0x4d'));_0x5a5bc6[_0x8895('0x4e')]=_0x1ca539[_0x8895('0x4f')];_0x5a5bc6[_0x8895('0x50')]=_0x1ca539['VoiceQueueId']?_0x8895('0x51'):_0x8895('0x52');return db[_0x8895('0x53')]['find']({'where':{'id':_0x5a5bc6[_0x8895('0x54')]},'attributes':[_0x8895('0x55'),_0x8895('0x56')]})['then'](function(_0x11153d){if(!_[_0x8895('0x57')](_0xb3ecd6)&&!_['isNil'](_0x11153d[_0x8895('0x55')])){_0x5a5bc6[_0x8895('0x58')]=_0x11153d['firstName'];if(!_[_0x8895('0x57')](_0x11153d[_0x8895('0x56')])){_0x5a5bc6[_0x8895('0x58')]+='\x20'+_0x11153d[_0x8895('0x56')];}}})['finally'](function(){return db['CmHopperFinal'][_0x8895('0x3b')](_0x5a5bc6);});}})[_0x8895('0xb')](function(_0x49877){return db['CmHopperAdditionalPhone'][_0x8895('0x3d')]({'where':{'CmHopperId':_0x2f3bf1}});})[_0x8895('0xb')](function(){return _0xb3ecd6['status'](0xcc)[_0x8895('0x59')]();})['catch'](handleError(_0xb3ecd6,null));};exports[_0x8895('0x5a')]=function(_0x2bd955,_0x46c521){var _0x14f8a4=[];return db[_0x8895('0x53')]['describe']()['then'](function(_0x239401){_0x14f8a4=_[_0x8895('0x17')](_0x239401);return _0x2bd955['user'][_0x8895('0x5b')]({'where':{'type':_0x8895('0x5c'),'dialActive':!![],'dialMethod':_0x8895('0x5d')},'attributes':['id',_0x8895('0x5e'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x8895('0xb')](function(_0x2d2bf9){if(_0x2d2bf9&&_0x2d2bf9[_0x8895('0x2b')]){return db[_0x8895('0x5f')][_0x8895('0x60')](function(_0x41a2fe){var _0x261d4b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8895('0x4c')](_0x8895('0x4d'))},'VoiceQueueId':{'$in':_[_0x8895('0x11')](_0x2d2bf9,'id')},'$or':[{'UserId':null},{'UserId':_0x2bd955[_0x8895('0x4a')]['id']}]};var _0x30ab15={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x2d2bf9)[_0x8895('0x31')]([_0x8895('0x61'),0x0])[_0x8895('0x11')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2bd955['user']['id']}]};var _0x5b96fe={'$or':[_0x261d4b,_0x30ab15]};var _0x13b143=[];if(_0x2bd955[_0x8895('0x3c')][_0x8895('0x62')]&&_0x2bd955[_0x8895('0x3c')][_0x8895('0x62')]==='prev'){if(!_[_0x8895('0x63')](_0x2bd955[_0x8895('0x3c')]['hopperIds'])){_0x5b96fe['id']={'$in':_0x2bd955[_0x8895('0x3c')][_0x8895('0x64')]};}_0x13b143=[[_0x8895('0x65'),_0x8895('0x66')],[_0x8895('0x67'),_0x2d2bf9[0x0]['dialOrderByScheduledAt']===_0x8895('0x66')?_0x8895('0x68'):_0x8895('0x66')],db[_0x8895('0x5f')][_0x8895('0x69')](_0x8895('0x6a')),['id',_0x8895('0x68')]];}else{if(!_['isEmpty'](_0x2bd955[_0x8895('0x3c')][_0x8895('0x64')])){_0x5b96fe['id']={'$notIn':_0x2bd955['body'][_0x8895('0x64')]};}_0x13b143=[[_0x8895('0x65'),_0x8895('0x68')],[_0x8895('0x67'),_0x2d2bf9[0x0][_0x8895('0x5e')]],db['sequelize'][_0x8895('0x69')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x8895('0x66')]];}return db[_0x8895('0x12')]['findOne']({'attributes':['id',_0x8895('0x6b'),_0x8895('0x4f'),_0x8895('0x6c')],'where':_0x5b96fe,'order':_0x13b143,'transaction':_0x41a2fe,'lock':_0x41a2fe[_0x8895('0x6d')]['UPDATE'],'include':[{'model':db[_0x8895('0x53')],'as':'Contact','attributes':_0x14f8a4,'include':[{'model':db['CmCompany'],'as':_0x8895('0x6e'),'attributes':['id',_0x8895('0xe')]}]},{'model':db[_0x8895('0x6f')],'as':'List','attributes':['id',_0x8895('0xe')]},{'model':db['VoiceQueue'],'as':_0x8895('0x70'),'attributes':['id',_0x8895('0xe'),_0x8895('0x71')]}]})[_0x8895('0xb')](function(_0x2cc5fa){if(_0x2cc5fa){return _0x2cc5fa['update']({'UserId':_0x2bd955['user']['id']},{'transaction':_0x41a2fe});}});});}})[_0x8895('0xb')](handleEntityNotFound(_0x46c521,null))['then'](respondWithResult(_0x46c521,null))[_0x8895('0x37')](handleError(_0x46c521,null));};exports[_0x8895('0x72')]=function(_0x4925c4,_0xd1fd50,_0xd9637a){var _0x3ace6f=[];var _0xc4c8dc=_0x4925c4[_0x8895('0x39')]['id'];var _0x4f80a3=_0x4925c4[_0x8895('0x4a')]['id'];return db['CmContact']['describe']()[_0x8895('0xb')](function(_0x5276f3){_0x3ace6f=_[_0x8895('0x17')](_0x5276f3);return db[_0x8895('0x5f')][_0x8895('0x60')](function(_0x39f5e5){const _0x53591d={'id':_0xc4c8dc};return db['CmHopper']['findOne']({'attributes':['id',_0x8895('0x6b'),_0x8895('0x6c')],'where':_0x53591d,'transaction':_0x39f5e5,'lock':_0x39f5e5[_0x8895('0x6d')][_0x8895('0x73')],'include':[{'model':db[_0x8895('0x53')],'as':_0x8895('0x74'),'attributes':_0x3ace6f,'include':[{'model':db['CmCompany'],'as':_0x8895('0x6e'),'attributes':['id',_0x8895('0xe')]}]},{'model':db[_0x8895('0x6f')],'as':'List','attributes':['id',_0x8895('0xe')]},{'model':db['VoiceQueue'],'as':_0x8895('0x70'),'attributes':['id','name',_0x8895('0x71')]}]})[_0x8895('0xb')](function(_0x553437){if(_0x553437){return _0x553437[_0x8895('0xa')]({'UserId':_0x4f80a3},{'transaction':_0x39f5e5});}});});})[_0x8895('0xb')](handleEntityNotFound(_0xd1fd50,null))['then'](respondWithResult(_0xd1fd50,null))[_0x8895('0x37')](handleError(_0xd1fd50,null));};exports[_0x8895('0x75')]=function(_0x2af98f,_0xef59db){return _0x2af98f[_0x8895('0x4a')][_0x8895('0x5b')]({'where':{'type':_0x8895('0x5c'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x8895('0xb')](function(_0x5ada19){if(_0x5ada19&&_0x5ada19[_0x8895('0x2b')]){return db[_0x8895('0x12')][_0x8895('0x6')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8895('0x4c')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x8895('0x11')](_0x5ada19,'id')},'$or':[{'UserId':null},{'UserId':_0x2af98f[_0x8895('0x4a')]['id']}]}});}return 0x0;})[_0x8895('0xb')](function(_0x3c3df7){if(!_[_0x8895('0x57')](_0x3c3df7)&&_[_0x8895('0x76')](_0x3c3df7)){return _0xef59db[_0x8895('0x2')](0xc8)[_0x8895('0x9')]({'contacts':_0x3c3df7});}else{logger['error'](_0x8895('0x77'),_0x8895('0x75'),0x194,'entity\x20not\x20found');_0xef59db['sendStatus'](0x194);}})[_0x8895('0x37')](handleError(_0xef59db,null));};exports[_0x8895('0x78')]=function(_0x1bbcd3,_0xfbb2){var _0x52cf28=shared['timezones'];var _0x12fa59=[];_[_0x8895('0x11')](_0x52cf28,function(_0x27f372){_0x12fa59[_0x8895('0x79')]({'id':_0x27f372[_0x8895('0xe')],'name':_0x27f372['name'],'utcOffset':_0x27f372[_0x8895('0x7a')]});});return _0xfbb2[_0x8895('0x2')](0xc8)['json']({'tz':_0x12fa59});};exports[_0x8895('0x7b')]=function(_0x440093,_0x2381df){var _0x167dcb=shared[_0x8895('0x7c')];var _0x21bb69={};if(!_['isNil'](_0x167dcb[_0x440093[_0x8895('0x3c')]['id']]))_0x21bb69=_0x167dcb[_0x440093[_0x8895('0x3c')]['id']];return _0x2381df['status'](0xc8)['json'](_0x21bb69);};
\ No newline at end of file
+var _0xc3b5=['model','keys','query','intersection','filters','concat','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$notLike','$overlap','$contains','$any','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','destroy','VoiceQueueId','CampaignId','omit','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','format','direction','prev','isEmpty','priority','ASC','scheduledAt','literal','DESC','hopperIds','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','getPreviewRecall','transaction','recallme','Queue','dialActive','isNumber','status','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','getTimezones','timezones','push','getTimezone','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','json','offset','undefined','count','limit','set','Content-Range','update','then','sendStatus','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key'];(function(_0x534522,_0x532334){var _0x1255bc=function(_0x4ba7b2){while(--_0x4ba7b2){_0x534522['push'](_0x534522['shift']());}};_0x1255bc(++_0x532334);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x51cb0e,_0x41bdc1){_0x51cb0e=_0x51cb0e-0x0;var _0x484627=_0xc3b5[_0x51cb0e];return _0x484627;};'use strict';var moment=require('moment');var _=require('lodash');var qs=require(_0x5c3b('0x0'));var logger=require(_0x5c3b('0x1'))(_0x5c3b('0x2'));var shared=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];function respondWithResult(_0x34be81,_0x237a61){_0x237a61=_0x237a61||0xc8;return function(_0x48f8a1){if(_0x48f8a1){return _0x34be81['status'](_0x237a61)[_0x5c3b('0x5')](_0x48f8a1);}};}function respondWithFilteredResult(_0x6b8a1e,_0x56345e){return function(_0x568a28){if(_0x568a28){var _0x30a08f=typeof _0x56345e[_0x5c3b('0x6')]===_0x5c3b('0x7')&&typeof _0x56345e['limit']===_0x5c3b('0x7');var _0x438255=_0x568a28[_0x5c3b('0x8')];var _0x20e71=_0x30a08f?0x0:_0x56345e['offset'];var _0x20dd86=_0x30a08f?_0x568a28[_0x5c3b('0x8')]:_0x56345e[_0x5c3b('0x6')]+_0x56345e[_0x5c3b('0x9')];var _0x363c3d;if(_0x20dd86>=_0x438255){_0x20dd86=_0x438255;_0x363c3d=0xc8;}else{_0x363c3d=0xce;}_0x6b8a1e['status'](_0x363c3d);return _0x6b8a1e[_0x5c3b('0xa')](_0x5c3b('0xb'),_0x20e71+'-'+_0x20dd86+'/'+_0x438255)['json'](_0x568a28);}return null;};}function saveUpdates(_0x1b2815,_0x3b953d){return function(_0x507c2e){if(_0x507c2e){return _0x507c2e[_0x5c3b('0xc')](_0x1b2815)[_0x5c3b('0xd')](function(_0x3e24bd){return _0x3e24bd;});}return null;};}function handleEntityNotFound(_0x2384b9,_0x315e68){return function(_0x3fef28){if(!_0x3fef28){_0x2384b9[_0x5c3b('0xe')](0x194);}return _0x3fef28;};}function handleError(_0x4f20eb,_0x2f7ab2){_0x2f7ab2=_0x2f7ab2||0x1f4;return function(_0x5b55be){logger['error'](_0x5b55be[_0x5c3b('0xf')]);if(_0x5b55be[_0x5c3b('0x10')]){delete _0x5b55be[_0x5c3b('0x10')];}_0x4f20eb['status'](_0x2f7ab2)[_0x5c3b('0x11')](_0x5b55be);};}exports[_0x5c3b('0x12')]=function(_0x5b5810,_0x59f71b){var _0x385053={},_0x34144d={},_0x48d662={'count':0x0,'rows':[]};var _0x3973bc=_[_0x5c3b('0x13')](db[_0x5c3b('0x14')][_0x5c3b('0x15')],function(_0x103943){return{'name':_0x103943[_0x5c3b('0x16')],'type':_0x103943[_0x5c3b('0x17')][_0x5c3b('0x18')]};});_0x34144d[_0x5c3b('0x19')]=_[_0x5c3b('0x13')](_0x3973bc,'name');_0x34144d['query']=_[_0x5c3b('0x1a')](_0x5b5810[_0x5c3b('0x1b')]);_0x34144d['filters']=_[_0x5c3b('0x1c')](_0x34144d['model'],_0x34144d[_0x5c3b('0x1b')]);_0x34144d[_0x5c3b('0x1d')]=_[_0x5c3b('0x1e')](_0x34144d[_0x5c3b('0x1d')],['$and',_0x5c3b('0x1f'),_0x5c3b('0x20'),'$gte',_0x5c3b('0x21'),_0x5c3b('0x22'),_0x5c3b('0x23'),_0x5c3b('0x24'),'$not',_0x5c3b('0x25'),_0x5c3b('0x26'),_0x5c3b('0x27'),_0x5c3b('0x28'),_0x5c3b('0x29'),_0x5c3b('0x2a'),'$iLike','$notILike','$like',_0x5c3b('0x2b'),_0x5c3b('0x2c'),'$contained',_0x5c3b('0x2d')]);_0x385053[_0x5c3b('0x2e')]=_[_0x5c3b('0x1c')](_0x34144d[_0x5c3b('0x19')],qs[_0x5c3b('0x2f')](_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x2f')]));_0x385053[_0x5c3b('0x2e')]=_0x385053[_0x5c3b('0x2e')][_0x5c3b('0x30')]?_0x385053[_0x5c3b('0x2e')]:_0x34144d[_0x5c3b('0x19')];if(!_0x5b5810['query'][_0x5c3b('0x31')](_0x5c3b('0x32'))){_0x385053[_0x5c3b('0x9')]=qs[_0x5c3b('0x9')](_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x9')]);_0x385053[_0x5c3b('0x6')]=qs[_0x5c3b('0x6')](_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x6')]);}_0x385053[_0x5c3b('0x33')]=qs[_0x5c3b('0x34')](_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x34')]);_0x385053[_0x5c3b('0x35')]=qs[_0x5c3b('0x1d')](_[_0x5c3b('0x36')](_0x5b5810['query'],_0x34144d[_0x5c3b('0x1d')]),_0x3973bc);if(_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x37')]){_0x385053[_0x5c3b('0x35')]=_['merge'](_0x385053[_0x5c3b('0x35')],{'$or':_[_0x5c3b('0x13')](_0x3973bc,function(_0x478aca){if(_0x478aca[_0x5c3b('0x17')]!==_0x5c3b('0x38')){var _0x32581a={};_0x32581a[_0x478aca[_0x5c3b('0x10')]]={'$like':'%'+_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x37')]+'%'};return _0x32581a;}})});}_0x385053=_[_0x5c3b('0x39')]({},_0x385053,_0x5b5810[_0x5c3b('0x3a')]);var _0x1fa1df={'where':_0x385053['where']};return db[_0x5c3b('0x14')][_0x5c3b('0x8')](_0x1fa1df)['then'](function(_0x59e079){_0x48d662[_0x5c3b('0x8')]=_0x59e079;if(_0x5b5810[_0x5c3b('0x1b')][_0x5c3b('0x3b')]){_0x385053[_0x5c3b('0x3c')]=[{'all':!![]}];}return db[_0x5c3b('0x14')][_0x5c3b('0x3d')](_0x385053);})[_0x5c3b('0xd')](function(_0x5e78de){_0x48d662['rows']=_0x5e78de;return _0x48d662;})[_0x5c3b('0xd')](respondWithFilteredResult(_0x59f71b,_0x385053))[_0x5c3b('0x3e')](handleError(_0x59f71b,null));};exports[_0x5c3b('0x3f')]=function(_0x3902d7,_0x526436){var _0x16400b={'raw':!![],'where':{'id':_0x3902d7[_0x5c3b('0x40')]['id']}},_0x4b9a81={};_0x4b9a81[_0x5c3b('0x19')]=_[_0x5c3b('0x1a')](db[_0x5c3b('0x14')][_0x5c3b('0x15')]);_0x4b9a81[_0x5c3b('0x1b')]=_[_0x5c3b('0x1a')](_0x3902d7[_0x5c3b('0x1b')]);_0x4b9a81[_0x5c3b('0x1d')]=_['intersection'](_0x4b9a81['model'],_0x4b9a81[_0x5c3b('0x1b')]);_0x16400b[_0x5c3b('0x2e')]=_[_0x5c3b('0x1c')](_0x4b9a81[_0x5c3b('0x19')],qs[_0x5c3b('0x2f')](_0x3902d7[_0x5c3b('0x1b')][_0x5c3b('0x2f')]));_0x16400b[_0x5c3b('0x2e')]=_0x16400b[_0x5c3b('0x2e')]['length']?_0x16400b[_0x5c3b('0x2e')]:_0x4b9a81[_0x5c3b('0x19')];if(_0x3902d7[_0x5c3b('0x1b')]['includeAll']){_0x16400b[_0x5c3b('0x3c')]=[{'all':!![]}];}_0x16400b=_[_0x5c3b('0x39')]({},_0x16400b,_0x3902d7[_0x5c3b('0x3a')]);return db[_0x5c3b('0x14')][_0x5c3b('0x41')](_0x16400b)[_0x5c3b('0xd')](handleEntityNotFound(_0x526436,null))[_0x5c3b('0xd')](respondWithResult(_0x526436,null))[_0x5c3b('0x3e')](handleError(_0x526436,null));};exports[_0x5c3b('0x42')]=function(_0x28c68a,_0x18e704){return db['CmHopper'][_0x5c3b('0x42')](_0x28c68a['body'],{})[_0x5c3b('0xd')](respondWithResult(_0x18e704,0xc9))[_0x5c3b('0x3e')](handleError(_0x18e704,null));};exports['update']=function(_0x1b24e6,_0x285346){if(_0x1b24e6[_0x5c3b('0x43')]['id']){delete _0x1b24e6['body']['id'];}return db[_0x5c3b('0x14')]['find']({'where':{'id':_0x1b24e6[_0x5c3b('0x40')]['id']}})[_0x5c3b('0xd')](handleEntityNotFound(_0x285346,null))[_0x5c3b('0xd')](saveUpdates(_0x1b24e6[_0x5c3b('0x43')],null))[_0x5c3b('0xd')](respondWithResult(_0x285346,null))[_0x5c3b('0x3e')](handleError(_0x285346,null));};exports[_0x5c3b('0x44')]=function(_0x3d6034,_0x42d34f){return db[_0x5c3b('0x14')][_0x5c3b('0x44')]()['then'](respondWithResult(_0x42d34f,null))[_0x5c3b('0x3e')](handleError(_0x42d34f,null));};exports['destroy']=function(_0x155b22,_0x11bf0a){var _0x2751a2;var _0x4b85c1=_0x155b22[_0x5c3b('0x40')]['id'];return db[_0x5c3b('0x14')]['find']({'where':{'id':_0x155b22[_0x5c3b('0x40')]['id']}})[_0x5c3b('0xd')](handleEntityNotFound(_0x11bf0a,null))[_0x5c3b('0xd')](function(_0x2744cd){if(_0x2744cd){return _0x2744cd[_0x5c3b('0x45')]()[_0x5c3b('0xd')](function(_0x37870f){return _0x37870f;});}})[_0x5c3b('0xd')](function(_0x3f3947){_0x2751a2=_0x3f3947;if(_0x3f3947){if(_0x3f3947[_0x5c3b('0x46')]||_0x3f3947[_0x5c3b('0x47')]){return db[_0x3f3947['VoiceQueueId']?'VoiceQueue':'Campaign'][_0x5c3b('0x41')]({'where':{'id':_0x3f3947[_0x5c3b('0x46')]?_0x3f3947['VoiceQueueId']:_0x3f3947[_0x5c3b('0x47')]},'attributes':['id',_0x5c3b('0x10')],'raw':!![]});}}})[_0x5c3b('0xd')](function(_0x2ff7e2){var _0x53c2c2={};if(_0x2ff7e2){_[_0x5c3b('0x39')](_0x53c2c2,_[_0x5c3b('0x48')](_0x2751a2['dataValues'],[_0x5c3b('0x49'),_0x5c3b('0x4a'),'id']));_0x53c2c2[_0x5c3b('0x4b')]=0x15;_0x53c2c2[_0x5c3b('0x4c')]=_0x5c3b('0x4d');_0x53c2c2[_0x5c3b('0x4e')]=_0x2ff7e2[_0x5c3b('0x10')];_0x53c2c2[_0x5c3b('0x4f')]=_0x155b22[_0x5c3b('0x50')][_0x5c3b('0x10')];_0x53c2c2[_0x5c3b('0x51')]=_0x155b22[_0x5c3b('0x50')]['id'];_0x53c2c2[_0x5c3b('0x4d')]=!![];_0x53c2c2['deletedat']=moment()['format'](_0x5c3b('0x52'));_0x53c2c2[_0x5c3b('0x53')]=_0x2751a2[_0x5c3b('0x54')];_0x53c2c2['campaigntype']=_0x2751a2['VoiceQueueId']?'queue':_0x5c3b('0x55');return db['CmContact'][_0x5c3b('0x41')]({'where':{'id':_0x53c2c2[_0x5c3b('0x56')]},'attributes':[_0x5c3b('0x57'),_0x5c3b('0x58')]})[_0x5c3b('0xd')](function(_0x4d7ecb){if(!_[_0x5c3b('0x59')](_0x11bf0a)&&!_['isNil'](_0x4d7ecb[_0x5c3b('0x57')])){_0x53c2c2['calleridname']=_0x4d7ecb[_0x5c3b('0x57')];if(!_[_0x5c3b('0x59')](_0x4d7ecb[_0x5c3b('0x58')])){_0x53c2c2[_0x5c3b('0x5a')]+='\x20'+_0x4d7ecb[_0x5c3b('0x58')];}}})[_0x5c3b('0x5b')](function(){return db[_0x5c3b('0x5c')][_0x5c3b('0x42')](_0x53c2c2);});}})[_0x5c3b('0xd')](function(_0x41e5e0){return db[_0x5c3b('0x5d')]['destroy']({'where':{'CmHopperId':_0x4b85c1}});})['then'](function(){return _0x11bf0a['status'](0xcc)[_0x5c3b('0x5e')]();})[_0x5c3b('0x3e')](handleError(_0x11bf0a,null));};exports[_0x5c3b('0x5f')]=function(_0x150868,_0x532120){var _0x4edba0=[];return db[_0x5c3b('0x60')]['describe']()['then'](function(_0x137458){_0x4edba0=_[_0x5c3b('0x1a')](_0x137458);return _0x150868[_0x5c3b('0x50')][_0x5c3b('0x61')]({'where':{'type':_0x5c3b('0x62'),'dialActive':!![],'dialMethod':_0x5c3b('0x63')},'attributes':['id',_0x5c3b('0x64'),_0x5c3b('0x65')],'raw':!![]});})[_0x5c3b('0xd')](function(_0x460461){if(_0x460461&&_0x460461[_0x5c3b('0x30')]){return db[_0x5c3b('0x66')]['transaction'](function(_0x3faa19){var _0x5564ad={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5c3b('0x67')](_0x5c3b('0x52'))},'VoiceQueueId':{'$in':_[_0x5c3b('0x13')](_0x460461,'id')},'$or':[{'UserId':null},{'UserId':_0x150868[_0x5c3b('0x50')]['id']}]};var _0x3ac366={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x460461)[_0x5c3b('0x37')]([_0x5c3b('0x65'),0x0])[_0x5c3b('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x150868[_0x5c3b('0x50')]['id']}]};var _0x5acd17={'$or':[_0x5564ad,_0x3ac366]};var _0x56c5bb=[];if(_0x150868[_0x5c3b('0x43')][_0x5c3b('0x68')]&&_0x150868[_0x5c3b('0x43')]['direction']===_0x5c3b('0x69')){if(!_[_0x5c3b('0x6a')](_0x150868[_0x5c3b('0x43')]['hopperIds'])){_0x5acd17['id']={'$in':_0x150868[_0x5c3b('0x43')]['hopperIds']};}_0x56c5bb=[[_0x5c3b('0x6b'),_0x5c3b('0x6c')],[_0x5c3b('0x6d'),_0x460461[0x0]['dialOrderByScheduledAt']===_0x5c3b('0x6c')?'DESC':_0x5c3b('0x6c')],db[_0x5c3b('0x66')][_0x5c3b('0x6e')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x5c3b('0x6f')]];}else{if(!_['isEmpty'](_0x150868[_0x5c3b('0x43')][_0x5c3b('0x70')])){_0x5acd17['id']={'$notIn':_0x150868[_0x5c3b('0x43')][_0x5c3b('0x70')]};}_0x56c5bb=[[_0x5c3b('0x6b'),_0x5c3b('0x6f')],[_0x5c3b('0x6d'),_0x460461[0x0][_0x5c3b('0x64')]],db[_0x5c3b('0x66')][_0x5c3b('0x6e')](_0x5c3b('0x71')),['id',_0x5c3b('0x6c')]];}return db[_0x5c3b('0x14')]['findOne']({'attributes':['id',_0x5c3b('0x72'),_0x5c3b('0x54'),'recallme'],'where':_0x5acd17,'order':_0x56c5bb,'transaction':_0x3faa19,'lock':_0x3faa19[_0x5c3b('0x73')][_0x5c3b('0x74')],'include':[{'model':db[_0x5c3b('0x60')],'as':_0x5c3b('0x75'),'attributes':_0x4edba0,'include':[{'model':db[_0x5c3b('0x76')],'as':_0x5c3b('0x77'),'attributes':['id',_0x5c3b('0x10')]}]},{'model':db[_0x5c3b('0x78')],'as':_0x5c3b('0x79'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name','dialActive']}]})[_0x5c3b('0xd')](function(_0x402717){if(_0x402717){return _0x402717[_0x5c3b('0xc')]({'UserId':_0x150868['user']['id']},{'transaction':_0x3faa19});}});});}})[_0x5c3b('0xd')](handleEntityNotFound(_0x532120,null))['then'](respondWithResult(_0x532120,null))[_0x5c3b('0x3e')](handleError(_0x532120,null));};exports[_0x5c3b('0x7a')]=function(_0x256ccb,_0x36ba41,_0x3419db){var _0xbc0e51=[];var _0x183fa9=_0x256ccb[_0x5c3b('0x40')]['id'];var _0x419955=_0x256ccb[_0x5c3b('0x50')]['id'];return db[_0x5c3b('0x60')][_0x5c3b('0x44')]()['then'](function(_0x2312d1){_0xbc0e51=_[_0x5c3b('0x1a')](_0x2312d1);return db[_0x5c3b('0x66')][_0x5c3b('0x7b')](function(_0x3d2b86){const _0xa84b04={'id':_0x183fa9};return db['CmHopper']['findOne']({'attributes':['id',_0x5c3b('0x72'),_0x5c3b('0x7c')],'where':_0xa84b04,'transaction':_0x3d2b86,'lock':_0x3d2b86['LOCK'][_0x5c3b('0x74')],'include':[{'model':db[_0x5c3b('0x60')],'as':_0x5c3b('0x75'),'attributes':_0xbc0e51,'include':[{'model':db['CmCompany'],'as':_0x5c3b('0x77'),'attributes':['id',_0x5c3b('0x10')]}]},{'model':db[_0x5c3b('0x78')],'as':_0x5c3b('0x79'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0x5c3b('0x7d'),'attributes':['id',_0x5c3b('0x10'),_0x5c3b('0x7e')]}]})[_0x5c3b('0xd')](function(_0x31ab7c){if(_0x31ab7c){return _0x31ab7c[_0x5c3b('0xc')]({'UserId':_0x419955},{'transaction':_0x3d2b86});}});});})[_0x5c3b('0xd')](handleEntityNotFound(_0x36ba41,null))[_0x5c3b('0xd')](respondWithResult(_0x36ba41,null))[_0x5c3b('0x3e')](handleError(_0x36ba41,null));};exports['getOpenContacts']=function(_0xb9e542,_0x2348cb){return _0xb9e542[_0x5c3b('0x50')][_0x5c3b('0x61')]({'where':{'type':_0x5c3b('0x62'),'dialActive':!![],'dialMethod':_0x5c3b('0x63')},'attributes':['id'],'raw':!![]})[_0x5c3b('0xd')](function(_0x36c6cd){if(_0x36c6cd&&_0x36c6cd[_0x5c3b('0x30')]){return db['CmHopper'][_0x5c3b('0x8')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x5c3b('0x67')](_0x5c3b('0x52'))},'VoiceQueueId':{'$in':_[_0x5c3b('0x13')](_0x36c6cd,'id')},'$or':[{'UserId':null},{'UserId':_0xb9e542['user']['id']}]}});}return 0x0;})['then'](function(_0x59ac9e){if(!_[_0x5c3b('0x59')](_0x59ac9e)&&_[_0x5c3b('0x7f')](_0x59ac9e)){return _0x2348cb[_0x5c3b('0x80')](0xc8)['json']({'contacts':_0x59ac9e});}else{logger[_0x5c3b('0x81')](_0x5c3b('0x82'),_0x5c3b('0x83'),0x194,'entity\x20not\x20found');_0x2348cb[_0x5c3b('0xe')](0x194);}})[_0x5c3b('0x3e')](handleError(_0x2348cb,null));};exports[_0x5c3b('0x84')]=function(_0x5e4c11,_0x3b91e6){var _0x3e272a=shared[_0x5c3b('0x85')];var _0x25aef8=[];_[_0x5c3b('0x13')](_0x3e272a,function(_0x4dfd97){_0x25aef8[_0x5c3b('0x86')]({'id':_0x4dfd97[_0x5c3b('0x10')],'name':_0x4dfd97['name'],'utcOffset':_0x4dfd97['utcOffset']});});return _0x3b91e6['status'](0xc8)[_0x5c3b('0x5')]({'tz':_0x25aef8});};exports[_0x5c3b('0x87')]=function(_0x133eaa,_0x3a44c4){var _0x57f7b3=shared[_0x5c3b('0x85')];var _0x309c51={};if(!_[_0x5c3b('0x59')](_0x57f7b3[_0x133eaa[_0x5c3b('0x43')]['id']]))_0x309c51=_0x57f7b3[_0x133eaa[_0x5c3b('0x43')]['id']];return _0x3a44c4[_0x5c3b('0x80')](0xc8)[_0x5c3b('0x5')](_0x309c51);};
\ No newline at end of file
index 09eeed8..93ed4e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','api'];(function(_0x35cdb6,_0x30e025){var _0x3af026=function(_0x428f0f){while(--_0x428f0f){_0x35cdb6['push'](_0x35cdb6['shift']());}};_0x3af026(++_0x30e025);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5c811c,_0x313b25){_0x5c811c=_0x5c811c-0x0;var _0x5df3af=_0xfcf0[_0x5c811c];return _0x5df3af;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xc')]},{'name':_0x0fcf('0xd'),'fields':['phone']},{'name':_0x0fcf('0xe'),'fields':[_0x0fcf('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5fc3=['scheduledat','phone','priority','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','exports','define','cm_hopper'];(function(_0x3352bc,_0x56d886){var _0x498667=function(_0x150a17){while(--_0x150a17){_0x3352bc['push'](_0x3352bc['shift']());}};_0x498667(++_0x56d886);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5e7514,_0x30c2e1){_0x5e7514=_0x5e7514-0x0;var _0x12f472=_0x5fc3[_0x5e7514];return _0x12f472;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('CmHopper',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]},{'name':_0x35fc('0xd'),'fields':[_0x35fc('0xd')]},{'name':_0x35fc('0xe'),'fields':[_0x35fc('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index c66ef84..eb1984b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbddb=['dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetCmHopper','CmHopper','options','raw','where','attributes','limit','include','map','model','stringify','ShowCmHopper','find','CreateCmHopper','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','body','active','catch','DestroyCmHopper','destroy','CmContact','sequelize','transaction','findAll','order','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','describe','LOCK','GetContactByPhone','findOne','phone'];(function(_0x5b41f1,_0x1a72d0){var _0x14cb16=function(_0x1ce02a){while(--_0x1ce02a){_0x5b41f1['push'](_0x5b41f1['shift']());}};_0x14cb16(++_0x1a72d0);}(_0xbddb,0x1bf));var _0xbbdd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbddb[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xbbdd('0x0'));var util=require(_0xbbdd('0x1'));var moment=require(_0xbbdd('0x2'));var BPromise=require(_0xbbdd('0x3'));var db=require(_0xbbdd('0x4'))['db'];var logger=require(_0xbbdd('0x5'))(_0xbbdd('0x6'));var jayson=require(_0xbbdd('0x7'));var client=jayson[_0xbbdd('0x8')][_0xbbdd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb768d,_0x4996a8,_0x2c0320){return new BPromise(function(_0xe88056,_0x40d924){return client[_0xbbdd('0xa')](_0xbb768d,_0x2c0320)[_0xbbdd('0xb')](function(_0x17e717){logger[_0xbbdd('0xc')](_0xbbdd('0xd'),_0x4996a8,_0xbbdd('0xe'));logger[_0xbbdd('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4996a8,'request\x20sent',JSON['stringify'](_0x17e717));if(_0x17e717[_0xbbdd('0x10')]){if(_0x17e717[_0xbbdd('0x10')][_0xbbdd('0x11')]===0x1f4){logger['error'](_0xbbdd('0xd'),_0x4996a8,_0x17e717[_0xbbdd('0x10')]['message']);return _0x40d924(_0x17e717[_0xbbdd('0x10')][_0xbbdd('0x12')]);}logger[_0xbbdd('0x10')](_0xbbdd('0xd'),_0x4996a8,_0x17e717[_0xbbdd('0x10')][_0xbbdd('0x12')]);return _0xe88056(_0x17e717[_0xbbdd('0x10')][_0xbbdd('0x12')]);}else{logger[_0xbbdd('0xc')](_0xbbdd('0xd'),_0x4996a8,'request\x20sent');_0xe88056(_0x17e717[_0xbbdd('0x13')][_0xbbdd('0x12')]);}})['catch'](function(_0x59844f){logger[_0xbbdd('0x10')](_0xbbdd('0xd'),_0x4996a8,_0x59844f);_0x40d924(_0x59844f);});});}exports[_0xbbdd('0x14')]=function(_0x59d231){var _0x1e972a=this;return new Promise(function(_0x3d2a88,_0x5ee2f0){return db[_0xbbdd('0x15')]['findAll']({'raw':_0x59d231[_0xbbdd('0x16')]?_0x59d231['options'][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'where':_0x59d231[_0xbbdd('0x16')]?_0x59d231[_0xbbdd('0x16')][_0xbbdd('0x18')]||null:null,'attributes':_0x59d231[_0xbbdd('0x16')]?_0x59d231[_0xbbdd('0x16')][_0xbbdd('0x19')]||null:null,'limit':_0x59d231[_0xbbdd('0x16')]?_0x59d231[_0xbbdd('0x16')][_0xbbdd('0x1a')]||null:null,'include':_0x59d231[_0xbbdd('0x16')]?_0x59d231['options'][_0xbbdd('0x1b')]?_[_0xbbdd('0x1c')](_0x59d231[_0xbbdd('0x16')]['include'],function(_0x402c0d){return{'model':db[_0x402c0d[_0xbbdd('0x1d')]],'as':_0x402c0d['as'],'attributes':_0x402c0d[_0xbbdd('0x19')],'include':_0x402c0d['include']?_[_0xbbdd('0x1c')](_0x402c0d['include'],function(_0x28e390){return{'model':db[_0x28e390[_0xbbdd('0x1d')]],'as':_0x28e390['as'],'attributes':_0x28e390[_0xbbdd('0x19')],'include':_0x28e390[_0xbbdd('0x1b')]?_['map'](_0x28e390['include'],function(_0x437404){return{'model':db[_0x437404[_0xbbdd('0x1d')]],'as':_0x437404['as'],'attributes':_0x437404['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cc011){logger['info'](_0xbbdd('0x14'),_0x59d231);logger[_0xbbdd('0xf')](_0xbbdd('0x14'),_0x59d231,JSON[_0xbbdd('0x1e')](_0x3cc011));_0x3d2a88(_0x3cc011);})['catch'](function(_0x3b2b9a){logger[_0xbbdd('0x10')](_0xbbdd('0x14'),_0x3b2b9a[_0xbbdd('0x12')],_0x59d231);_0x5ee2f0(_0x1e972a[_0xbbdd('0x10')](0x1f4,_0x3b2b9a[_0xbbdd('0x12')]));});});};exports[_0xbbdd('0x1f')]=function(_0x32276a){var _0x5127cf=this;return new Promise(function(_0x27296f,_0x443491){return db[_0xbbdd('0x15')][_0xbbdd('0x20')]({'raw':_0x32276a[_0xbbdd('0x16')]?_0x32276a[_0xbbdd('0x16')][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'where':_0x32276a['options']?_0x32276a['options'][_0xbbdd('0x18')]||null:null,'attributes':_0x32276a[_0xbbdd('0x16')]?_0x32276a['options'][_0xbbdd('0x19')]||null:null,'include':_0x32276a['options']?_0x32276a[_0xbbdd('0x16')]['include']?_['map'](_0x32276a['options'][_0xbbdd('0x1b')],function(_0x38e5f1){return{'model':db[_0x38e5f1[_0xbbdd('0x1d')]],'as':_0x38e5f1['as'],'attributes':_0x38e5f1[_0xbbdd('0x19')],'include':_0x38e5f1['include']?_[_0xbbdd('0x1c')](_0x38e5f1[_0xbbdd('0x1b')],function(_0x1ea66d){return{'model':db[_0x1ea66d[_0xbbdd('0x1d')]],'as':_0x1ea66d['as'],'attributes':_0x1ea66d[_0xbbdd('0x19')],'include':_0x1ea66d[_0xbbdd('0x1b')]?_[_0xbbdd('0x1c')](_0x1ea66d['include'],function(_0x4fcf94){return{'model':db[_0x4fcf94[_0xbbdd('0x1d')]],'as':_0x4fcf94['as'],'attributes':_0x4fcf94['attributes']};}):[]};}):[]};}):[]:[]})[_0xbbdd('0xb')](function(_0xba3b03){logger[_0xbbdd('0xc')](_0xbbdd('0x1f'),_0x32276a);logger[_0xbbdd('0xf')](_0xbbdd('0x1f'),_0x32276a,JSON[_0xbbdd('0x1e')](_0xba3b03));_0x27296f(_0xba3b03);})['catch'](function(_0x2361c7){logger[_0xbbdd('0x10')](_0xbbdd('0x1f'),_0x2361c7[_0xbbdd('0x12')],_0x32276a);_0x443491(_0x5127cf['error'](0x1f4,_0x2361c7[_0xbbdd('0x12')]));});});};exports['CreateCmHopper']=function(_0x2e6ae6){var _0x4971ad=this;return new Promise(function(_0x4dbc20,_0x75a810){return db[_0xbbdd('0x15')]['create'](_0x2e6ae6['body'],{'raw':_0x2e6ae6[_0xbbdd('0x16')]?_0x2e6ae6[_0xbbdd('0x16')][_0xbbdd('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x50f59f){logger['info'](_0xbbdd('0x21'),_0x2e6ae6);logger[_0xbbdd('0xf')]('CreateCmHopper',_0x2e6ae6,JSON['stringify'](_0x50f59f));_0x4dbc20(_0x50f59f);})['catch'](function(_0x1fafe0){logger[_0xbbdd('0x10')]('CreateCmHopper',_0x1fafe0[_0xbbdd('0x12')],_0x2e6ae6);_0x75a810(_0x4971ad[_0xbbdd('0x10')](0x1f4,_0x1fafe0[_0xbbdd('0x12')]));});});};exports[_0xbbdd('0x22')]=function(_0x56d5fa){var _0x341fe8=this;return new Promise(function(_0x373f2f,_0x5f4c07){return db[_0xbbdd('0x15')][_0xbbdd('0x23')](_0x56d5fa['body'],{'raw':_0x56d5fa[_0xbbdd('0x16')]?_0x56d5fa[_0xbbdd('0x16')][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56d5fa[_0xbbdd('0x16')]?_0x56d5fa[_0xbbdd('0x16')][_0xbbdd('0x18')]||null:null,'attributes':_0x56d5fa[_0xbbdd('0x16')]?_0x56d5fa[_0xbbdd('0x16')][_0xbbdd('0x19')]||null:null,'limit':_0x56d5fa[_0xbbdd('0x16')]?_0x56d5fa[_0xbbdd('0x16')][_0xbbdd('0x1a')]||null:null})[_0xbbdd('0xb')](function(_0x33d4cf){logger[_0xbbdd('0xc')](_0xbbdd('0x22'),_0x56d5fa);logger[_0xbbdd('0xc')](_0xbbdd('0x24'),JSON[_0xbbdd('0x1e')](_0x56d5fa['options'][_0xbbdd('0x18')]),_0x56d5fa[_0xbbdd('0x25')][_0xbbdd('0x26')]);logger['debug'](_0xbbdd('0x22'),_0x56d5fa,JSON[_0xbbdd('0x1e')](_0x33d4cf));_0x373f2f(_0x33d4cf);})[_0xbbdd('0x27')](function(_0x5024e3){logger[_0xbbdd('0x10')](_0xbbdd('0x22'),_0x5024e3[_0xbbdd('0x12')],_0x56d5fa);_0x5f4c07(_0x341fe8[_0xbbdd('0x10')](0x1f4,_0x5024e3[_0xbbdd('0x12')]));});});};exports[_0xbbdd('0x28')]=function(_0x4a8c3b){var _0x179569=this;return new Promise(function(_0x37de8b,_0x5888ab){return db[_0xbbdd('0x15')][_0xbbdd('0x29')]({'where':_0x4a8c3b[_0xbbdd('0x16')]?_0x4a8c3b[_0xbbdd('0x16')][_0xbbdd('0x18')]||null:null})[_0xbbdd('0xb')](function(_0x18d691){logger[_0xbbdd('0xc')](_0xbbdd('0x28'),_0x4a8c3b);logger[_0xbbdd('0xf')](_0xbbdd('0x28'),_0x4a8c3b,JSON[_0xbbdd('0x1e')](_0x18d691));_0x37de8b(_0x18d691);})[_0xbbdd('0x27')](function(_0x6bbabc){logger[_0xbbdd('0x10')]('DestroyCmHopper',_0x6bbabc[_0xbbdd('0x12')],_0x4a8c3b);_0x5888ab(_0x179569[_0xbbdd('0x10')](0x1f4,_0x6bbabc['message']));});});};exports['GetContactDialer']=function(_0x37799d){var _0x5552ff=this;return new Promise(function(_0x4514d5,_0x14106a){return db[_0xbbdd('0x2a')]['describe']()['then'](function(_0x4b8f29){return db[_0xbbdd('0x2b')][_0xbbdd('0x2c')](function(_0x174799){return db[_0xbbdd('0x15')][_0xbbdd('0x2d')]({'where':_0x37799d[_0xbbdd('0x16')]?_0x37799d['options'][_0xbbdd('0x18')]||null:null,'attributes':_0x37799d['options']?_0x37799d['options'][_0xbbdd('0x19')]||null:null,'limit':_0x37799d[_0xbbdd('0x16')]?_0x37799d[_0xbbdd('0x16')][_0xbbdd('0x1a')]||null:null,'order':_0x37799d[_0xbbdd('0x16')]?_0x37799d[_0xbbdd('0x16')][_0xbbdd('0x2e')]||null:null,'transaction':_0x174799,'lock':_0x174799['LOCK'][_0xbbdd('0x2f')],'include':[{'model':db['CmContact'],'as':_0xbbdd('0x30'),'attributes':_[_0xbbdd('0x31')](_0x4b8f29)},{'model':db[_0xbbdd('0x32')],'as':'Agent','attributes':['id',_0xbbdd('0x33'),_0xbbdd('0x34')]}]})[_0xbbdd('0xb')](function(_0x4394ca){var _0x4e2aab=[];var _0x3d5230=[];for(var _0x53fe7b=0x0;_0x53fe7b<_0x4394ca[_0xbbdd('0x35')];_0x53fe7b+=0x1){var _0x26c28c=_0x4394ca[_0x53fe7b][_0xbbdd('0x36')];if(_0x26c28c===null){_0x4e2aab[_0xbbdd('0x37')](_0x4394ca[_0x53fe7b][_0xbbdd('0x23')](_0x37799d[_0xbbdd('0x25')],{'transaction':_0x174799}));}else if(!_0x3d5230[_0xbbdd('0x38')](_0x26c28c)){_0x3d5230[_0xbbdd('0x37')](_0x26c28c);_0x4e2aab['push'](_0x4394ca[_0x53fe7b][_0xbbdd('0x23')](_0x37799d[_0xbbdd('0x25')],{'transaction':_0x174799}));}}return BPromise[_0xbbdd('0x39')](_0x4e2aab);});})[_0xbbdd('0xb')](function(_0x4cf8bd){logger[_0xbbdd('0xc')]('GetContactDialer',_0x37799d);if(_0x4cf8bd[_0xbbdd('0x35')]>0x0){logger[_0xbbdd('0xc')](_0xbbdd('0x3a'),_0x4cf8bd[0x0][_0xbbdd('0x3b')]['id'],_0x4cf8bd[0x0][_0xbbdd('0x3b')][_0xbbdd('0x3c')],_0x4cf8bd[0x0]['dataValues']['active']);}logger[_0xbbdd('0xf')](_0xbbdd('0x3d'),_0x37799d,JSON['stringify'](_0x4cf8bd));_0x4514d5(_0x4cf8bd);})['catch'](function(_0x2911d6){logger[_0xbbdd('0x10')](_0xbbdd('0x3d'),_0x2911d6[_0xbbdd('0x12')],_0x37799d);_0x14106a(_0x5552ff[_0xbbdd('0x10')](0x1f4,_0x2911d6[_0xbbdd('0x12')]));});});});};exports[_0xbbdd('0x3e')]=function(_0x40e5a0){var _0x2a2b07=this;return new Promise(function(_0x21501e,_0x4c08b6){return db['sequelize'][_0xbbdd('0x2c')](function(_0x295751){return db['CmHopperFinal'][_0xbbdd('0x3f')](_0x40e5a0['body'],{'raw':_0x40e5a0[_0xbbdd('0x16')]?_0x40e5a0['options'][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'transaction':_0x295751})['then'](function(){logger['info'](_0xbbdd('0x40'),JSON['stringify'](_0x40e5a0[_0xbbdd('0x16')][_0xbbdd('0x18')]),_0x40e5a0[_0xbbdd('0x16')][_0xbbdd('0x18')][_0xbbdd('0x26')]);return db['CmHopper'][_0xbbdd('0x29')]({'where':_0x40e5a0[_0xbbdd('0x16')]?_0x40e5a0['options'][_0xbbdd('0x18')]||null:null,'transaction':_0x295751});});})[_0xbbdd('0xb')](function(_0x24a567){logger[_0xbbdd('0xc')](_0xbbdd('0x3e'),_0x40e5a0);logger[_0xbbdd('0xf')]('MoveContactManagedDialer',_0x40e5a0,JSON[_0xbbdd('0x1e')](_0x24a567));_0x21501e(_0x24a567);})['catch'](function(_0x4c8e11){logger['error']('MoveContactManagedDialer',_0x4c8e11[_0xbbdd('0x12')],_0x40e5a0);_0x4c08b6(_0x2a2b07[_0xbbdd('0x10')](0x1f4,_0x4c8e11[_0xbbdd('0x12')]));});});};exports['CountReScheduled']=function(_0x4ed792){var _0x446752=this;return new Promise(function(_0x5b0bae,_0x5d4620){return db['CmHopper'][_0xbbdd('0x2d')]({'raw':_0x4ed792[_0xbbdd('0x16')]?_0x4ed792['options'][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'where':_0x4ed792[_0xbbdd('0x16')]?_0x4ed792[_0xbbdd('0x16')][_0xbbdd('0x18')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xbbdd('0x2b')]['fn']('IF',db[_0xbbdd('0x2b')]['literal'](_0xbbdd('0x41')+util[_0xbbdd('0x42')]('\x22%s\x22',moment()[_0xbbdd('0x42')](_0xbbdd('0x43')))+'\x20,\x201,\x20null'))),_0xbbdd('0x44')]]})['then'](function(_0x89233e){logger[_0xbbdd('0xc')]('CountReScheduled',_0x4ed792);logger[_0xbbdd('0xf')]('CountReScheduled',_0x4ed792,JSON['stringify'](_0x89233e));_0x5b0bae(_0x89233e);})[_0xbbdd('0x27')](function(_0x41eb21){logger['error']('CountReScheduled',_0x41eb21[_0xbbdd('0x12')],_0x4ed792);_0x5d4620(_0x446752[_0xbbdd('0x10')](0x1f4,_0x41eb21[_0xbbdd('0x12')]));});});};exports[_0xbbdd('0x45')]=function(_0x27ae56){var _0x27f9fd=this;return new Promise(function(_0x35e36,_0xa336cb){return db['CmContact'][_0xbbdd('0x46')]()[_0xbbdd('0xb')](function(_0xcfed55){return db['sequelize'][_0xbbdd('0x2c')](function(_0x48028e){return db[_0xbbdd('0x15')]['findAll']({'where':_0x27ae56[_0xbbdd('0x16')]?_0x27ae56['options'][_0xbbdd('0x18')]||null:null,'attributes':_0x27ae56['options']?_0x27ae56[_0xbbdd('0x16')]['attributes']||null:null,'limit':0x1,'order':_0x27ae56[_0xbbdd('0x16')]?_0x27ae56[_0xbbdd('0x16')]['order']||null:null,'group':db[_0xbbdd('0x15')][_0xbbdd('0x36')],'transaction':_0x48028e,'lock':_0x48028e[_0xbbdd('0x47')][_0xbbdd('0x2f')],'include':_0x27ae56['options']?_0x27ae56[_0xbbdd('0x16')][_0xbbdd('0x1b')]?_['map'](_0x27ae56[_0xbbdd('0x16')][_0xbbdd('0x1b')],function(_0x3b8330){return{'model':db[_0x3b8330[_0xbbdd('0x1d')]],'as':_0x3b8330['as'],'attributes':_0x3b8330[_0xbbdd('0x19')],'include':_0x3b8330[_0xbbdd('0x1b')]?_['map'](_0x3b8330[_0xbbdd('0x1b')],function(_0x5d7fdb){return{'model':db[_0x5d7fdb[_0xbbdd('0x1d')]],'as':_0x5d7fdb['as'],'attributes':_0x5d7fdb[_0xbbdd('0x19')],'include':_0x5d7fdb['include']?_[_0xbbdd('0x1c')](_0x5d7fdb[_0xbbdd('0x1b')],function(_0x39638d){return{'model':db[_0x39638d['model']],'as':_0x39638d['as'],'attributes':_0x39638d[_0xbbdd('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f62c5){var _0x2262ea=[];for(var _0x144377=0x0;_0x144377<_0x4f62c5[_0xbbdd('0x35')];_0x144377+=0x1){_0x2262ea[_0xbbdd('0x37')](_0x4f62c5[_0x144377][_0xbbdd('0x23')](_0x27ae56['body'],{'transaction':_0x48028e}));}return BPromise[_0xbbdd('0x39')](_0x2262ea);});})['then'](function(_0x30a603){logger[_0xbbdd('0xc')](_0xbbdd('0x45'),_0x27ae56);logger[_0xbbdd('0xf')](_0xbbdd('0x45'),_0x27ae56,JSON[_0xbbdd('0x1e')](_0x30a603));_0x35e36(_0x30a603);})[_0xbbdd('0x27')](function(_0x39cb2a){logger[_0xbbdd('0x10')](_0xbbdd('0x45'),_0x39cb2a[_0xbbdd('0x12')],_0x27ae56);_0xa336cb(_0x27f9fd[_0xbbdd('0x10')](0x1f4,_0x39cb2a['message']));});});});};exports['GetCmHopperPreview']=function(_0x11be27){var _0x274a26=this;return new Promise(function(_0x37c28a,_0x52e307){db[_0xbbdd('0x2a')][_0xbbdd('0x46')]()['then'](function(_0x1fee9a){return db[_0xbbdd('0x15')]['findAll']({'raw':_0x11be27[_0xbbdd('0x16')]?_0x11be27['options'][_0xbbdd('0x17')]===undefined?!![]:![]:!![],'where':_0x11be27[_0xbbdd('0x16')]?_0x11be27[_0xbbdd('0x16')][_0xbbdd('0x18')]||null:null,'attributes':_0x11be27[_0xbbdd('0x16')]?_0x11be27[_0xbbdd('0x16')][_0xbbdd('0x19')]||null:null,'limit':_0x11be27['options']?_0x11be27[_0xbbdd('0x16')]['limit']||null:null,'include':_0x11be27[_0xbbdd('0x16')]?_0x11be27[_0xbbdd('0x16')][_0xbbdd('0x1b')]?_[_0xbbdd('0x1c')](_0x11be27['options'][_0xbbdd('0x1b')],function(_0xa4bc32){return{'model':db[_0xa4bc32[_0xbbdd('0x1d')]],'as':_0xa4bc32['as'],'attributes':_0xa4bc32['as']===_0xbbdd('0x30')?_[_0xbbdd('0x31')](_0x1fee9a):_0xa4bc32['attributes'],'include':_0xa4bc32[_0xbbdd('0x1b')]?_[_0xbbdd('0x1c')](_0xa4bc32['include'],function(_0x49c27b){return{'model':db[_0x49c27b[_0xbbdd('0x1d')]],'as':_0x49c27b['as'],'attributes':_0x49c27b[_0xbbdd('0x19')],'include':_0x49c27b['include']?_[_0xbbdd('0x1c')](_0x49c27b[_0xbbdd('0x1b')],function(_0x56c8dc){return{'model':db[_0x56c8dc[_0xbbdd('0x1d')]],'as':_0x56c8dc['as'],'attributes':_0x56c8dc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59ab4a){logger[_0xbbdd('0xc')](_0xbbdd('0x14'),_0x11be27);logger[_0xbbdd('0xf')]('GetCmHopper',_0x11be27,JSON[_0xbbdd('0x1e')](_0x59ab4a));_0x37c28a(_0x59ab4a);})[_0xbbdd('0x27')](function(_0x3d6992){logger[_0xbbdd('0x10')](_0xbbdd('0x14'),_0x3d6992[_0xbbdd('0x12')],_0x11be27);_0x52e307(_0x274a26['error'](0x1f4,_0x3d6992[_0xbbdd('0x12')]));});});});};exports[_0xbbdd('0x48')]=function(_0x54733f){var _0x32f164=this;return new Promise(function(_0x4d3fcb,_0x59b226){return db['CmContact'][_0xbbdd('0x49')]({'raw':!![],'where':{'phone':_0x54733f['options'][_0xbbdd('0x18')][_0xbbdd('0x4a')]},'attributes':['id',_0xbbdd('0x4b')],'order':[['id',_0xbbdd('0x4c')]]})[_0xbbdd('0xb')](function(_0x28e176){logger[_0xbbdd('0xc')](_0xbbdd('0x4d'),_0x54733f);logger[_0xbbdd('0xf')]('getContactByPhone',_0x54733f,JSON[_0xbbdd('0x1e')](_0x28e176));_0x4d3fcb(_0x28e176);})[_0xbbdd('0x27')](function(_0x44084c){logger[_0xbbdd('0x10')]('getContactByPhone',_0x44084c[_0xbbdd('0x12')],_0x54733f);_0x59b226(_0x32f164[_0xbbdd('0x10')](0x1f4,_0x44084c['message']));});});};exports[_0xbbdd('0x4e')]=function(_0x406d81){var _0x36d7bd=this;return new Promise(function(_0x31c30a,_0x27a140){return db[_0xbbdd('0x2b')][_0xbbdd('0x2c')](function(_0x17dd88){return db[_0xbbdd('0x15')][_0xbbdd('0x23')](_0x406d81[_0xbbdd('0x25')],{'where':{},'transaction':_0x17dd88})[_0xbbdd('0xb')](function(_0x3b723e){logger[_0xbbdd('0xc')](_0xbbdd('0x4e'),_0x406d81);logger[_0xbbdd('0xf')]('ResetActiveCalls',_0x406d81,JSON[_0xbbdd('0x1e')](_0x3b723e));_0x31c30a(_0x3b723e);})['catch'](function(_0x3b2031){logger['error'](_0xbbdd('0x4e'),_0x3b2031['message'],_0x406d81);_0x27a140(_0x36d7bd[_0xbbdd('0x10')](0x1f4,_0x3b2031[_0xbbdd('0x12')]));});});});};exports[_0xbbdd('0x4f')]=function(_0x2c824e){var _0x39b23c=this;var _0x43053d=_0x2c824e['body']['where']['voiceQueueIds'];var _0x4b647d=_0x2c824e[_0xbbdd('0x25')][_0xbbdd('0x18')][_0xbbdd('0x50')];var _0x1e16e3=_0x2c824e[_0xbbdd('0x25')][_0xbbdd('0x18')][_0xbbdd('0x51')];return new Promise(function(_0x1a812c,_0x1fd2cd){return db[_0xbbdd('0x15')][_0xbbdd('0x2d')]({'where':{'voiceQueueId':{'$in':_0x43053d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xbbdd('0x2b')][_0xbbdd('0x52')](_0xbbdd('0x53')+_0x4b647d+_0xbbdd('0x54')),'$gt':db[_0xbbdd('0x2b')][_0xbbdd('0x52')](_0xbbdd('0x55'))}},'UserId':{'$in':_0x1e16e3}},'include':[{'model':db[_0xbbdd('0x2a')],'as':_0xbbdd('0x30')},{'model':db[_0xbbdd('0x32')],'as':'Agent','attributes':['id','name',_0xbbdd('0x34')]},{'model':db['CmList'],'as':_0xbbdd('0x56')}]})[_0xbbdd('0xb')](function(_0x3d33e5){if(_0x3d33e5[_0xbbdd('0x35')]>0x0){return db[_0xbbdd('0x2b')]['transaction'](function(_0x33b37f){return db[_0xbbdd('0x15')]['update']({'recallmeNotifiedDate':db['sequelize'][_0xbbdd('0x52')]('NOW()')},{'where':{'id':{'$in':_[_0xbbdd('0x1c')](_0x3d33e5,'id')}},'transaction':_0x33b37f})[_0xbbdd('0xb')](function(){_0x1a812c(_0x3d33e5);})['catch'](function(_0x4f59d9){logger['error']('CmHopperHandlePreviewRecallNotifications',_0x4f59d9['message'],_0x2c824e);_0x1fd2cd(_0x39b23c[_0xbbdd('0x10')](0x1f4,_0x4f59d9[_0xbbdd('0x12')]));});})[_0xbbdd('0x27')](function(_0x307120){logger[_0xbbdd('0x10')](_0xbbdd('0x4f'),_0x307120[_0xbbdd('0x12')],_0x2c824e);_0x1fd2cd(_0x39b23c[_0xbbdd('0x10')](0x1f4,_0x307120[_0xbbdd('0x12')]));});}else{_0x1a812c(_0x3d33e5);}});});};
\ No newline at end of file
+var _0xa7ee=['GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','DESC','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','voicePause','CmList','List','length','lodash','moment','bluebird','../../mysqldb','../../config/logger','client','request','then','info','CmHopper,\x20%s,\x20%s','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetCmHopper','findAll','options','attributes','limit','include','map','model','debug','ShowCmHopper','CmHopper','where','create','body','raw','CreateCmHopper','UpdateCmHopper','update','active','destroy','DestroyCmHopper','GetContactDialer','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','User','Agent','name','UserId','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','literal','`scheduledat`\x20>=\x20','format','contactsRescheduled','CountReScheduled','CmContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7ee,0x159));var _0xea7e=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0xa7ee[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0xea7e('0x0'));var util=require('util');var moment=require(_0xea7e('0x1'));var BPromise=require(_0xea7e('0x2'));var db=require(_0xea7e('0x3'))['db'];var logger=require(_0xea7e('0x4'))('rpc');var jayson=require('jayson/promise');var client=jayson[_0xea7e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2439f9,_0x40ec63,_0x3e99ef){return new BPromise(function(_0x42f578,_0x511e20){return client[_0xea7e('0x6')](_0x2439f9,_0x3e99ef)[_0xea7e('0x7')](function(_0x303dab){logger[_0xea7e('0x8')](_0xea7e('0x9'),_0x40ec63,'request\x20sent');logger['debug'](_0xea7e('0xa'),_0x40ec63,'request\x20sent',JSON[_0xea7e('0xb')](_0x303dab));if(_0x303dab[_0xea7e('0xc')]){if(_0x303dab[_0xea7e('0xc')][_0xea7e('0xd')]===0x1f4){logger['error'](_0xea7e('0x9'),_0x40ec63,_0x303dab['error'][_0xea7e('0xe')]);return _0x511e20(_0x303dab[_0xea7e('0xc')][_0xea7e('0xe')]);}logger[_0xea7e('0xc')](_0xea7e('0x9'),_0x40ec63,_0x303dab[_0xea7e('0xc')][_0xea7e('0xe')]);return _0x42f578(_0x303dab[_0xea7e('0xc')]['message']);}else{logger[_0xea7e('0x8')](_0xea7e('0x9'),_0x40ec63,_0xea7e('0xf'));_0x42f578(_0x303dab[_0xea7e('0x10')]['message']);}})[_0xea7e('0x11')](function(_0x4d3796){logger['error'](_0xea7e('0x9'),_0x40ec63,_0x4d3796);_0x511e20(_0x4d3796);});});}exports[_0xea7e('0x12')]=function(_0x162c47){var _0x519959=this;return new Promise(function(_0x5c3b15,_0x13281d){return db['CmHopper'][_0xea7e('0x13')]({'raw':_0x162c47[_0xea7e('0x14')]?_0x162c47['options']['raw']===undefined?!![]:![]:!![],'where':_0x162c47[_0xea7e('0x14')]?_0x162c47['options']['where']||null:null,'attributes':_0x162c47[_0xea7e('0x14')]?_0x162c47['options'][_0xea7e('0x15')]||null:null,'limit':_0x162c47[_0xea7e('0x14')]?_0x162c47['options'][_0xea7e('0x16')]||null:null,'include':_0x162c47['options']?_0x162c47[_0xea7e('0x14')][_0xea7e('0x17')]?_[_0xea7e('0x18')](_0x162c47[_0xea7e('0x14')][_0xea7e('0x17')],function(_0x268511){return{'model':db[_0x268511['model']],'as':_0x268511['as'],'attributes':_0x268511[_0xea7e('0x15')],'include':_0x268511[_0xea7e('0x17')]?_['map'](_0x268511[_0xea7e('0x17')],function(_0x344ec6){return{'model':db[_0x344ec6[_0xea7e('0x19')]],'as':_0x344ec6['as'],'attributes':_0x344ec6['attributes'],'include':_0x344ec6[_0xea7e('0x17')]?_[_0xea7e('0x18')](_0x344ec6[_0xea7e('0x17')],function(_0x49ce51){return{'model':db[_0x49ce51[_0xea7e('0x19')]],'as':_0x49ce51['as'],'attributes':_0x49ce51[_0xea7e('0x15')]};}):[]};}):[]};}):[]:[]})[_0xea7e('0x7')](function(_0x7a75a6){logger[_0xea7e('0x8')](_0xea7e('0x12'),_0x162c47);logger[_0xea7e('0x1a')](_0xea7e('0x12'),_0x162c47,JSON[_0xea7e('0xb')](_0x7a75a6));_0x5c3b15(_0x7a75a6);})[_0xea7e('0x11')](function(_0x4a23a9){logger[_0xea7e('0xc')](_0xea7e('0x12'),_0x4a23a9['message'],_0x162c47);_0x13281d(_0x519959[_0xea7e('0xc')](0x1f4,_0x4a23a9[_0xea7e('0xe')]));});});};exports[_0xea7e('0x1b')]=function(_0x4db5a8){var _0x33447e=this;return new Promise(function(_0x56ea98,_0x38d8a7){return db[_0xea7e('0x1c')]['find']({'raw':_0x4db5a8[_0xea7e('0x14')]?_0x4db5a8[_0xea7e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4db5a8[_0xea7e('0x14')]?_0x4db5a8['options'][_0xea7e('0x1d')]||null:null,'attributes':_0x4db5a8[_0xea7e('0x14')]?_0x4db5a8[_0xea7e('0x14')][_0xea7e('0x15')]||null:null,'include':_0x4db5a8[_0xea7e('0x14')]?_0x4db5a8[_0xea7e('0x14')]['include']?_[_0xea7e('0x18')](_0x4db5a8[_0xea7e('0x14')][_0xea7e('0x17')],function(_0x42922a){return{'model':db[_0x42922a[_0xea7e('0x19')]],'as':_0x42922a['as'],'attributes':_0x42922a[_0xea7e('0x15')],'include':_0x42922a['include']?_['map'](_0x42922a[_0xea7e('0x17')],function(_0x2b3744){return{'model':db[_0x2b3744[_0xea7e('0x19')]],'as':_0x2b3744['as'],'attributes':_0x2b3744['attributes'],'include':_0x2b3744[_0xea7e('0x17')]?_[_0xea7e('0x18')](_0x2b3744[_0xea7e('0x17')],function(_0x15a1a6){return{'model':db[_0x15a1a6[_0xea7e('0x19')]],'as':_0x15a1a6['as'],'attributes':_0x15a1a6[_0xea7e('0x15')]};}):[]};}):[]};}):[]:[]})[_0xea7e('0x7')](function(_0x315777){logger[_0xea7e('0x8')](_0xea7e('0x1b'),_0x4db5a8);logger[_0xea7e('0x1a')](_0xea7e('0x1b'),_0x4db5a8,JSON[_0xea7e('0xb')](_0x315777));_0x56ea98(_0x315777);})[_0xea7e('0x11')](function(_0x4dc120){logger['error'](_0xea7e('0x1b'),_0x4dc120[_0xea7e('0xe')],_0x4db5a8);_0x38d8a7(_0x33447e[_0xea7e('0xc')](0x1f4,_0x4dc120[_0xea7e('0xe')]));});});};exports['CreateCmHopper']=function(_0x165024){var _0x4ce7d3=this;return new Promise(function(_0x226fa2,_0x51ceb2){return db[_0xea7e('0x1c')][_0xea7e('0x1e')](_0x165024[_0xea7e('0x1f')],{'raw':_0x165024[_0xea7e('0x14')]?_0x165024[_0xea7e('0x14')][_0xea7e('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x100f9a){logger[_0xea7e('0x8')]('CreateCmHopper',_0x165024);logger[_0xea7e('0x1a')]('CreateCmHopper',_0x165024,JSON[_0xea7e('0xb')](_0x100f9a));_0x226fa2(_0x100f9a);})[_0xea7e('0x11')](function(_0x513c72){logger[_0xea7e('0xc')](_0xea7e('0x21'),_0x513c72[_0xea7e('0xe')],_0x165024);_0x51ceb2(_0x4ce7d3[_0xea7e('0xc')](0x1f4,_0x513c72[_0xea7e('0xe')]));});});};exports[_0xea7e('0x22')]=function(_0x2db099){var _0x673162=this;return new Promise(function(_0x2238b3,_0x115089){return db[_0xea7e('0x1c')][_0xea7e('0x23')](_0x2db099[_0xea7e('0x1f')],{'raw':_0x2db099[_0xea7e('0x14')]?_0x2db099['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2db099['options']?_0x2db099['options']['where']||null:null,'attributes':_0x2db099['options']?_0x2db099[_0xea7e('0x14')]['attributes']||null:null,'limit':_0x2db099[_0xea7e('0x14')]?_0x2db099[_0xea7e('0x14')]['limit']||null:null})['then'](function(_0x1ac12d){logger[_0xea7e('0x8')](_0xea7e('0x22'),_0x2db099);logger[_0xea7e('0x8')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON['stringify'](_0x2db099[_0xea7e('0x14')]['where']),_0x2db099[_0xea7e('0x1f')][_0xea7e('0x24')]);logger['debug'](_0xea7e('0x22'),_0x2db099,JSON[_0xea7e('0xb')](_0x1ac12d));_0x2238b3(_0x1ac12d);})['catch'](function(_0x1370c7){logger[_0xea7e('0xc')]('UpdateCmHopper',_0x1370c7['message'],_0x2db099);_0x115089(_0x673162[_0xea7e('0xc')](0x1f4,_0x1370c7[_0xea7e('0xe')]));});});};exports['DestroyCmHopper']=function(_0x3fbaef){var _0x1bcfcb=this;return new Promise(function(_0x4dd73b,_0x45901a){return db[_0xea7e('0x1c')][_0xea7e('0x25')]({'where':_0x3fbaef[_0xea7e('0x14')]?_0x3fbaef[_0xea7e('0x14')][_0xea7e('0x1d')]||null:null})[_0xea7e('0x7')](function(_0x593d13){logger[_0xea7e('0x8')](_0xea7e('0x26'),_0x3fbaef);logger[_0xea7e('0x1a')](_0xea7e('0x26'),_0x3fbaef,JSON[_0xea7e('0xb')](_0x593d13));_0x4dd73b(_0x593d13);})[_0xea7e('0x11')](function(_0x5d4528){logger[_0xea7e('0xc')](_0xea7e('0x26'),_0x5d4528[_0xea7e('0xe')],_0x3fbaef);_0x45901a(_0x1bcfcb[_0xea7e('0xc')](0x1f4,_0x5d4528[_0xea7e('0xe')]));});});};exports[_0xea7e('0x27')]=function(_0x5318b4){var _0x302f1c=this;return new Promise(function(_0x44beca,_0x3e7264){return db['CmContact'][_0xea7e('0x28')]()[_0xea7e('0x7')](function(_0x597b88){return db[_0xea7e('0x29')][_0xea7e('0x2a')](function(_0xd8908e){return db[_0xea7e('0x1c')][_0xea7e('0x13')]({'where':_0x5318b4[_0xea7e('0x14')]?_0x5318b4[_0xea7e('0x14')][_0xea7e('0x1d')]||null:null,'attributes':_0x5318b4[_0xea7e('0x14')]?_0x5318b4['options']['attributes']||null:null,'limit':_0x5318b4[_0xea7e('0x14')]?_0x5318b4[_0xea7e('0x14')]['limit']||null:null,'order':_0x5318b4[_0xea7e('0x14')]?_0x5318b4['options'][_0xea7e('0x2b')]||null:null,'transaction':_0xd8908e,'lock':_0xd8908e[_0xea7e('0x2c')][_0xea7e('0x2d')],'include':[{'model':db['CmContact'],'as':_0xea7e('0x2e'),'attributes':_[_0xea7e('0x2f')](_0x597b88)},{'model':db[_0xea7e('0x30')],'as':_0xea7e('0x31'),'attributes':['id',_0xea7e('0x32'),'voicePause']}]})['then'](function(_0xf8e601){var _0x349705=[];var _0xeae827=[];for(var _0x1da457=0x0;_0x1da457<_0xf8e601['length'];_0x1da457+=0x1){var _0x2fde0c=_0xf8e601[_0x1da457][_0xea7e('0x33')];if(_0x2fde0c===null){_0x349705[_0xea7e('0x34')](_0xf8e601[_0x1da457][_0xea7e('0x23')](_0x5318b4[_0xea7e('0x1f')],{'transaction':_0xd8908e}));}else if(!_0xeae827['includes'](_0x2fde0c)){_0xeae827['push'](_0x2fde0c);_0x349705[_0xea7e('0x34')](_0xf8e601[_0x1da457][_0xea7e('0x23')](_0x5318b4['body'],{'transaction':_0xd8908e}));}}return BPromise[_0xea7e('0x35')](_0x349705);});})[_0xea7e('0x7')](function(_0x1697b5){logger[_0xea7e('0x8')](_0xea7e('0x27'),_0x5318b4);if(_0x1697b5['length']>0x0){logger['info'](_0xea7e('0x36'),_0x1697b5[0x0][_0xea7e('0x37')]['id'],_0x1697b5[0x0][_0xea7e('0x37')][_0xea7e('0x38')],_0x1697b5[0x0][_0xea7e('0x37')][_0xea7e('0x24')]);}logger[_0xea7e('0x1a')]('GetContactDialer',_0x5318b4,JSON['stringify'](_0x1697b5));_0x44beca(_0x1697b5);})['catch'](function(_0xf79204){logger[_0xea7e('0xc')]('GetContactDialer',_0xf79204[_0xea7e('0xe')],_0x5318b4);_0x3e7264(_0x302f1c[_0xea7e('0xc')](0x1f4,_0xf79204['message']));});});});};exports[_0xea7e('0x39')]=function(_0x7b0c67){var _0x502760=this;return new Promise(function(_0x1073d2,_0x3d1d90){return db[_0xea7e('0x29')][_0xea7e('0x2a')](function(_0x323aab){return db['CmHopperFinal']['create'](_0x7b0c67[_0xea7e('0x1f')],{'raw':_0x7b0c67[_0xea7e('0x14')]?_0x7b0c67[_0xea7e('0x14')]['raw']===undefined?!![]:![]:!![],'transaction':_0x323aab})[_0xea7e('0x7')](function(){logger[_0xea7e('0x8')](_0xea7e('0x3a'),JSON[_0xea7e('0xb')](_0x7b0c67[_0xea7e('0x14')]['where']),_0x7b0c67['options'][_0xea7e('0x1d')][_0xea7e('0x24')]);return db['CmHopper'][_0xea7e('0x25')]({'where':_0x7b0c67[_0xea7e('0x14')]?_0x7b0c67['options'][_0xea7e('0x1d')]||null:null,'transaction':_0x323aab});});})[_0xea7e('0x7')](function(_0x28e16d){logger[_0xea7e('0x8')](_0xea7e('0x39'),_0x7b0c67);logger[_0xea7e('0x1a')]('MoveContactManagedDialer',_0x7b0c67,JSON[_0xea7e('0xb')](_0x28e16d));_0x1073d2(_0x28e16d);})['catch'](function(_0x25566d){logger[_0xea7e('0xc')](_0xea7e('0x39'),_0x25566d[_0xea7e('0xe')],_0x7b0c67);_0x3d1d90(_0x502760['error'](0x1f4,_0x25566d[_0xea7e('0xe')]));});});};exports['CountReScheduled']=function(_0x460f8e){var _0xfb16eb=this;return new Promise(function(_0x567313,_0x1c2bdd){return db[_0xea7e('0x1c')][_0xea7e('0x13')]({'raw':_0x460f8e['options']?_0x460f8e[_0xea7e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x460f8e['options']?_0x460f8e['options'][_0xea7e('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0xea7e('0x29')]['fn']('IF',db[_0xea7e('0x29')][_0xea7e('0x3b')](_0xea7e('0x3c')+util[_0xea7e('0x3d')]('\x22%s\x22',moment()[_0xea7e('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'))+'\x20,\x201,\x20null'))),_0xea7e('0x3e')]]})[_0xea7e('0x7')](function(_0x5a2c2d){logger[_0xea7e('0x8')](_0xea7e('0x3f'),_0x460f8e);logger['debug']('CountReScheduled',_0x460f8e,JSON['stringify'](_0x5a2c2d));_0x567313(_0x5a2c2d);})['catch'](function(_0x30e0e7){logger['error'](_0xea7e('0x3f'),_0x30e0e7[_0xea7e('0xe')],_0x460f8e);_0x1c2bdd(_0xfb16eb[_0xea7e('0xc')](0x1f4,_0x30e0e7['message']));});});};exports['GetContactRecallMe']=function(_0x1b2edc){var _0x2102a5=this;return new Promise(function(_0x585756,_0x43c872){return db[_0xea7e('0x40')][_0xea7e('0x28')]()[_0xea7e('0x7')](function(_0x1314d0){return db[_0xea7e('0x29')][_0xea7e('0x2a')](function(_0x1b13cb){return db[_0xea7e('0x1c')][_0xea7e('0x13')]({'where':_0x1b2edc[_0xea7e('0x14')]?_0x1b2edc['options'][_0xea7e('0x1d')]||null:null,'attributes':_0x1b2edc[_0xea7e('0x14')]?_0x1b2edc[_0xea7e('0x14')]['attributes']||null:null,'limit':0x1,'order':_0x1b2edc[_0xea7e('0x14')]?_0x1b2edc[_0xea7e('0x14')][_0xea7e('0x2b')]||null:null,'group':db[_0xea7e('0x1c')][_0xea7e('0x33')],'transaction':_0x1b13cb,'lock':_0x1b13cb[_0xea7e('0x2c')][_0xea7e('0x2d')],'include':_0x1b2edc[_0xea7e('0x14')]?_0x1b2edc[_0xea7e('0x14')]['include']?_[_0xea7e('0x18')](_0x1b2edc['options'][_0xea7e('0x17')],function(_0x3f2315){return{'model':db[_0x3f2315['model']],'as':_0x3f2315['as'],'attributes':_0x3f2315['attributes'],'include':_0x3f2315[_0xea7e('0x17')]?_['map'](_0x3f2315['include'],function(_0x170b17){return{'model':db[_0x170b17['model']],'as':_0x170b17['as'],'attributes':_0x170b17['attributes'],'include':_0x170b17[_0xea7e('0x17')]?_[_0xea7e('0x18')](_0x170b17[_0xea7e('0x17')],function(_0x4f7da8){return{'model':db[_0x4f7da8[_0xea7e('0x19')]],'as':_0x4f7da8['as'],'attributes':_0x4f7da8[_0xea7e('0x15')]};}):[]};}):[]};}):[]:[]})[_0xea7e('0x7')](function(_0x1e9ffa){var _0x8de69e=[];for(var _0x563e40=0x0;_0x563e40<_0x1e9ffa['length'];_0x563e40+=0x1){_0x8de69e[_0xea7e('0x34')](_0x1e9ffa[_0x563e40][_0xea7e('0x23')](_0x1b2edc[_0xea7e('0x1f')],{'transaction':_0x1b13cb}));}return BPromise[_0xea7e('0x35')](_0x8de69e);});})[_0xea7e('0x7')](function(_0x2cad22){logger[_0xea7e('0x8')](_0xea7e('0x41'),_0x1b2edc);logger[_0xea7e('0x1a')](_0xea7e('0x41'),_0x1b2edc,JSON[_0xea7e('0xb')](_0x2cad22));_0x585756(_0x2cad22);})['catch'](function(_0x44fa3d){logger[_0xea7e('0xc')](_0xea7e('0x41'),_0x44fa3d[_0xea7e('0xe')],_0x1b2edc);_0x43c872(_0x2102a5[_0xea7e('0xc')](0x1f4,_0x44fa3d[_0xea7e('0xe')]));});});});};exports[_0xea7e('0x42')]=function(_0x262ae4){var _0x10f7ba=this;return new Promise(function(_0x5568f0,_0x10413e){db[_0xea7e('0x40')][_0xea7e('0x28')]()[_0xea7e('0x7')](function(_0x243f45){return db[_0xea7e('0x1c')][_0xea7e('0x13')]({'raw':_0x262ae4[_0xea7e('0x14')]?_0x262ae4[_0xea7e('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x262ae4[_0xea7e('0x14')]?_0x262ae4[_0xea7e('0x14')]['where']||null:null,'attributes':_0x262ae4[_0xea7e('0x14')]?_0x262ae4['options'][_0xea7e('0x15')]||null:null,'limit':_0x262ae4['options']?_0x262ae4[_0xea7e('0x14')][_0xea7e('0x16')]||null:null,'include':_0x262ae4[_0xea7e('0x14')]?_0x262ae4[_0xea7e('0x14')]['include']?_['map'](_0x262ae4[_0xea7e('0x14')][_0xea7e('0x17')],function(_0x596308){return{'model':db[_0x596308[_0xea7e('0x19')]],'as':_0x596308['as'],'attributes':_0x596308['as']==='Contact'?_[_0xea7e('0x2f')](_0x243f45):_0x596308[_0xea7e('0x15')],'include':_0x596308['include']?_[_0xea7e('0x18')](_0x596308[_0xea7e('0x17')],function(_0x173a6e){return{'model':db[_0x173a6e[_0xea7e('0x19')]],'as':_0x173a6e['as'],'attributes':_0x173a6e['attributes'],'include':_0x173a6e[_0xea7e('0x17')]?_[_0xea7e('0x18')](_0x173a6e[_0xea7e('0x17')],function(_0x4edccc){return{'model':db[_0x4edccc[_0xea7e('0x19')]],'as':_0x4edccc['as'],'attributes':_0x4edccc[_0xea7e('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x570e39){logger[_0xea7e('0x8')](_0xea7e('0x12'),_0x262ae4);logger['debug']('GetCmHopper',_0x262ae4,JSON['stringify'](_0x570e39));_0x5568f0(_0x570e39);})[_0xea7e('0x11')](function(_0x1fd007){logger[_0xea7e('0xc')]('GetCmHopper',_0x1fd007[_0xea7e('0xe')],_0x262ae4);_0x10413e(_0x10f7ba[_0xea7e('0xc')](0x1f4,_0x1fd007[_0xea7e('0xe')]));});});});};exports['GetContactByPhone']=function(_0x4c5a88){var _0x2b1252=this;return new Promise(function(_0x34af6c,_0x1325e9){return db['CmContact'][_0xea7e('0x43')]({'raw':!![],'where':{'phone':_0x4c5a88[_0xea7e('0x14')][_0xea7e('0x1d')][_0xea7e('0x44')]},'attributes':['id',_0xea7e('0x45')],'order':[['id',_0xea7e('0x46')]]})[_0xea7e('0x7')](function(_0x3b9fb3){logger[_0xea7e('0x8')]('getContactByPhone',_0x4c5a88);logger[_0xea7e('0x1a')]('getContactByPhone',_0x4c5a88,JSON[_0xea7e('0xb')](_0x3b9fb3));_0x34af6c(_0x3b9fb3);})[_0xea7e('0x11')](function(_0x22ef18){logger[_0xea7e('0xc')]('getContactByPhone',_0x22ef18[_0xea7e('0xe')],_0x4c5a88);_0x1325e9(_0x2b1252[_0xea7e('0xc')](0x1f4,_0x22ef18['message']));});});};exports[_0xea7e('0x47')]=function(_0x3d8a2b){var _0x28729e=this;return new Promise(function(_0x5949e7,_0x5f391e){return db[_0xea7e('0x29')][_0xea7e('0x2a')](function(_0x35af58){return db[_0xea7e('0x1c')][_0xea7e('0x23')](_0x3d8a2b['body'],{'where':{},'transaction':_0x35af58})[_0xea7e('0x7')](function(_0xdfe176){logger['info']('ResetActiveCalls',_0x3d8a2b);logger[_0xea7e('0x1a')](_0xea7e('0x47'),_0x3d8a2b,JSON['stringify'](_0xdfe176));_0x5949e7(_0xdfe176);})[_0xea7e('0x11')](function(_0x4c4ea8){logger[_0xea7e('0xc')](_0xea7e('0x47'),_0x4c4ea8[_0xea7e('0xe')],_0x3d8a2b);_0x5f391e(_0x28729e[_0xea7e('0xc')](0x1f4,_0x4c4ea8[_0xea7e('0xe')]));});});});};exports[_0xea7e('0x48')]=function(_0x1bef1f){var _0x271b1a=this;var _0x182d63=_0x1bef1f[_0xea7e('0x1f')]['where']['voiceQueueIds'];var _0x7df05b=_0x1bef1f[_0xea7e('0x1f')][_0xea7e('0x1d')][_0xea7e('0x49')];var _0x170d99=_0x1bef1f[_0xea7e('0x1f')][_0xea7e('0x1d')][_0xea7e('0x4a')];return new Promise(function(_0x5dc9da,_0x505a51){return db[_0xea7e('0x1c')]['findAll']({'where':{'voiceQueueId':{'$in':_0x182d63},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0xea7e('0x29')][_0xea7e('0x3b')](_0xea7e('0x4b')+_0x7df05b+_0xea7e('0x4c')),'$gt':db[_0xea7e('0x29')][_0xea7e('0x3b')](_0xea7e('0x4d'))}},'UserId':{'$in':_0x170d99}},'include':[{'model':db[_0xea7e('0x40')],'as':'Contact'},{'model':db['User'],'as':_0xea7e('0x31'),'attributes':['id',_0xea7e('0x32'),_0xea7e('0x4e')]},{'model':db[_0xea7e('0x4f')],'as':_0xea7e('0x50')}]})[_0xea7e('0x7')](function(_0x197fb9){if(_0x197fb9[_0xea7e('0x51')]>0x0){return db['sequelize']['transaction'](function(_0x47cb74){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0xea7e('0x29')]['literal'](_0xea7e('0x4d'))},{'where':{'id':{'$in':_[_0xea7e('0x18')](_0x197fb9,'id')}},'transaction':_0x47cb74})[_0xea7e('0x7')](function(){_0x5dc9da(_0x197fb9);})['catch'](function(_0x169e0e){logger[_0xea7e('0xc')]('CmHopperHandlePreviewRecallNotifications',_0x169e0e[_0xea7e('0xe')],_0x1bef1f);_0x505a51(_0x271b1a['error'](0x1f4,_0x169e0e[_0xea7e('0xe')]));});})[_0xea7e('0x11')](function(_0xc9debe){logger[_0xea7e('0xc')](_0xea7e('0x48'),_0xc9debe[_0xea7e('0xe')],_0x1bef1f);_0x505a51(_0x271b1a[_0xea7e('0xc')](0x1f4,_0xc9debe[_0xea7e('0xe')]));});}else{_0x5dc9da(_0x197fb9);}});});};
\ No newline at end of file
index 88402a0..43f3d5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x159f=['getPreview','/timezone','put','/:id','delete','exports','express','../../components/auth/service','./cmHopper.controller','get','isAuthenticated','describe','/timezones','show','/:id/previewrecall','getPreviewRecall','post','create','/preview'];(function(_0x4a8ce2,_0x4cd94e){var _0x38c265=function(_0x1fb277){while(--_0x1fb277){_0x4a8ce2['push'](_0x4a8ce2['shift']());}};_0x38c265(++_0x4cd94e);}(_0x159f,0x65));var _0xf159=function(_0x27b12e,_0x29096c){_0x27b12e=_0x27b12e-0x0;var _0x19a2ce=_0x159f[_0x27b12e];return _0x19a2ce;};'use strict';var express=require(_0xf159('0x0'));var router=express['Router']();var auth=require(_0xf159('0x1'));var controller=require(_0xf159('0x2'));router[_0xf159('0x3')]('/',auth[_0xf159('0x4')](),controller['index']);router[_0xf159('0x3')]('/describe',auth[_0xf159('0x4')](),controller[_0xf159('0x5')]);router[_0xf159('0x3')]('/opencontacts',auth[_0xf159('0x4')](),controller['getOpenContacts']);router[_0xf159('0x3')](_0xf159('0x6'),auth[_0xf159('0x4')](),controller['getTimezones']);router['get']('/:id',auth[_0xf159('0x4')](),controller[_0xf159('0x7')]);router['get'](_0xf159('0x8'),auth[_0xf159('0x4')](),controller[_0xf159('0x9')]);router[_0xf159('0xa')]('/',auth['isAuthenticated'](),controller[_0xf159('0xb')]);router[_0xf159('0xa')](_0xf159('0xc'),auth['isAuthenticated'](),controller[_0xf159('0xd')]);router[_0xf159('0xa')](_0xf159('0xe'),auth[_0xf159('0x4')](),controller['getTimezone']);router[_0xf159('0xf')](_0xf159('0x10'),auth[_0xf159('0x4')](),controller['update']);router[_0xf159('0x11')]('/:id',auth[_0xf159('0x4')](),controller['destroy']);module[_0xf159('0x12')]=router;
\ No newline at end of file
+var _0x4246=['../../components/auth/service','./cmHopper.controller','get','index','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','/:id/previewrecall','getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','update','destroy','exports','express'];(function(_0x10675a,_0x5b46a9){var _0x507163=function(_0x59b972){while(--_0x59b972){_0x10675a['push'](_0x10675a['shift']());}};_0x507163(++_0x5b46a9);}(_0x4246,0xa7));var _0x6424=function(_0x436dcb,_0x4b955c){_0x436dcb=_0x436dcb-0x0;var _0x2d231e=_0x4246[_0x436dcb];return _0x2d231e;};'use strict';var express=require(_0x6424('0x0'));var router=express['Router']();var auth=require(_0x6424('0x1'));var controller=require(_0x6424('0x2'));router[_0x6424('0x3')]('/',auth['isAuthenticated'](),controller[_0x6424('0x4')]);router[_0x6424('0x3')]('/describe',auth[_0x6424('0x5')](),controller[_0x6424('0x6')]);router['get'](_0x6424('0x7'),auth[_0x6424('0x5')](),controller[_0x6424('0x8')]);router[_0x6424('0x3')]('/timezones',auth[_0x6424('0x5')](),controller['getTimezones']);router[_0x6424('0x3')](_0x6424('0x9'),auth[_0x6424('0x5')](),controller['show']);router[_0x6424('0x3')](_0x6424('0xa'),auth[_0x6424('0x5')](),controller[_0x6424('0xb')]);router[_0x6424('0xc')]('/',auth['isAuthenticated'](),controller[_0x6424('0xd')]);router['post'](_0x6424('0xe'),auth[_0x6424('0x5')](),controller[_0x6424('0xf')]);router['post'](_0x6424('0x10'),auth['isAuthenticated'](),controller[_0x6424('0x11')]);router['put']('/:id',auth[_0x6424('0x5')](),controller[_0x6424('0x12')]);router['delete'](_0x6424('0x9'),auth['isAuthenticated'](),controller[_0x6424('0x13')]);module[_0x6424('0x14')]=router;
\ No newline at end of file
index 05fe2a9..5f32d50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00a5=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports','INTEGER','STRING','DATE','format'];(function(_0x5d5b69,_0x1111ab){var _0xf82413=function(_0x3a1f48){while(--_0x3a1f48){_0x5d5b69['push'](_0x5d5b69['shift']());}};_0xf82413(++_0x1111ab);}(_0x00a5,0x179));var _0x500a=function(_0x1eebd0,_0xb08d02){_0x1eebd0=_0x1eebd0-0x0;var _0x1ae62e=_0x00a5[_0x1eebd0];return _0x1ae62e;};'use strict';var moment=require(_0x500a('0x0'));var Sequelize=require(_0x500a('0x1'));module[_0x500a('0x2')]={'CmHopperId':{'type':Sequelize[_0x500a('0x3')]},'phone':{'type':Sequelize[_0x500a('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x500a('0x5')],'defaultValue':moment()[_0x500a('0x6')](_0x500a('0x7'))},'countbusyretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x500a('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x881b=['YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','INTEGER','DATE','format'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0x881b,0x157));var _0xb881=function(_0x286d6d,_0x17e40d){_0x286d6d=_0x286d6d-0x0;var _0x563d60=_0x881b[_0x286d6d];return _0x563d60;};'use strict';var moment=require(_0xb881('0x0'));var Sequelize=require(_0xb881('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0xb881('0x2')]},'phone':{'type':Sequelize['STRING'],'allowNull':![]},'OrderBy':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb881('0x3')],'defaultValue':moment()[_0xb881('0x4')](_0xb881('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb881('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index e1e6581..d6cf3ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x59b7=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','body','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api'];(function(_0x24cd93,_0x367b61){var _0x83152f=function(_0x4af6be){while(--_0x4af6be){_0x24cd93['push'](_0x24cd93['shift']());}};_0x83152f(++_0x367b61);}(_0x59b7,0x8b));var _0x759b=function(_0x184829,_0x21a872){_0x184829=_0x184829-0x0;var _0x17e680=_0x59b7[_0x184829];return _0x17e680;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x759b('0x0'));var zipdir=require(_0x759b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x759b('0x2'));var moment=require(_0x759b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x759b('0x4'));var util=require(_0x759b('0x5'));var path=require(_0x759b('0x6'));var sox=require(_0x759b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x759b('0x8'));var deskjs=require(_0x759b('0x9'));var toCsv=require('to-csv');var querystring=require(_0x759b('0xa'));var Papa=require('papaparse');var Redis=require(_0x759b('0xb'));var authService=require(_0x759b('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x759b('0xd'));var logger=require('../../config/logger')(_0x759b('0xe'));var utils=require(_0x759b('0xf'));var config=require(_0x759b('0x10'));var licenseUtil=require(_0x759b('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37f3d4,_0x2ebd8d){_0x2ebd8d=_0x2ebd8d||0xcc;return function(_0x3062bd){if(_0x3062bd){return _0x37f3d4[_0x759b('0x12')](_0x2ebd8d);}return _0x37f3d4[_0x759b('0x13')](_0x2ebd8d)[_0x759b('0x14')]();};}function respondWithResult(_0x143186,_0x4af401){_0x4af401=_0x4af401||0xc8;return function(_0x43958f){if(_0x43958f){return _0x143186[_0x759b('0x13')](_0x4af401)[_0x759b('0x15')](_0x43958f);}};}function respondWithFilteredResult(_0xf53b67,_0x303ec8){return function(_0x5bfeda){if(_0x5bfeda){var _0x1ee743=typeof _0x303ec8[_0x759b('0x16')]===_0x759b('0x17')&&typeof _0x303ec8[_0x759b('0x18')]==='undefined';var _0x165f9e=_0x5bfeda[_0x759b('0x19')];var _0x2395f6=_0x1ee743?0x0:_0x303ec8[_0x759b('0x16')];var _0x5aa252=_0x1ee743?_0x5bfeda[_0x759b('0x19')]:_0x303ec8['offset']+_0x303ec8['limit'];var _0x38a6e2;if(_0x5aa252>=_0x165f9e){_0x5aa252=_0x165f9e;_0x38a6e2=0xc8;}else{_0x38a6e2=0xce;}_0xf53b67['status'](_0x38a6e2);return _0xf53b67[_0x759b('0x1a')](_0x759b('0x1b'),_0x2395f6+'-'+_0x5aa252+'/'+_0x165f9e)[_0x759b('0x15')](_0x5bfeda);}return null;};}function patchUpdates(_0x1c1fd7){return function(_0x4dfa29){try{jsonpatch[_0x759b('0x1c')](_0x4dfa29,_0x1c1fd7,!![]);}catch(_0xe7cbbd){return BPromise[_0x759b('0x1d')](_0xe7cbbd);}return _0x4dfa29[_0x759b('0x1e')]();};}function saveUpdates(_0x579c63,_0x466019){return function(_0x2387ab){if(_0x2387ab){return _0x2387ab[_0x759b('0x1f')](_0x579c63)[_0x759b('0x20')](function(_0x1ac1e3){return _0x1ac1e3;});}return null;};}function removeEntity(_0x52cfc7,_0x3f5d5d){return function(_0x3257fe){if(_0x3257fe){return _0x3257fe[_0x759b('0x21')]()[_0x759b('0x20')](function(){var _0x2bd24e=_0x3257fe[_0x759b('0x22')]({'plain':!![]});var _0x5963f3=_0x759b('0x23');return db[_0x759b('0x24')][_0x759b('0x21')]({'where':{'type':_0x5963f3,'resourceId':_0x2bd24e['id']}})['then'](function(){return _0x3257fe;});})[_0x759b('0x20')](function(){_0x52cfc7[_0x759b('0x13')](0xcc)[_0x759b('0x14')]();});}};}function handleEntityNotFound(_0x2dc21d,_0x4aa352){return function(_0x1ec0be){if(!_0x1ec0be){_0x2dc21d['sendStatus'](0x194);}return _0x1ec0be;};}function handleError(_0x1a6594,_0x5e49b5){_0x5e49b5=_0x5e49b5||0x1f4;return function(_0x36eacd){logger[_0x759b('0x25')](_0x36eacd[_0x759b('0x26')]);if(_0x36eacd[_0x759b('0x27')]){delete _0x36eacd[_0x759b('0x27')];}_0x1a6594[_0x759b('0x13')](_0x5e49b5)['send'](_0x36eacd);};}exports['index']=function(_0x1e024a,_0x1db08f){var _0x4d01e8={},_0x5d6f80={},_0x2c04e4={'count':0x0,'rows':[]};var _0xc90445=_[_0x759b('0x28')](db[_0x759b('0x29')][_0x759b('0x2a')],function(_0x5e8c36){return{'name':_0x5e8c36[_0x759b('0x2b')],'type':_0x5e8c36[_0x759b('0x2c')][_0x759b('0x2d')]};});_0x5d6f80[_0x759b('0x2e')]=_[_0x759b('0x28')](_0xc90445,_0x759b('0x27'));_0x5d6f80[_0x759b('0x2f')]=_[_0x759b('0x30')](_0x1e024a['query']);_0x5d6f80[_0x759b('0x31')]=_[_0x759b('0x32')](_0x5d6f80['model'],_0x5d6f80[_0x759b('0x2f')]);_0x4d01e8[_0x759b('0x33')]=_[_0x759b('0x32')](_0x5d6f80[_0x759b('0x2e')],qs[_0x759b('0x34')](_0x1e024a['query'][_0x759b('0x34')]));_0x4d01e8['attributes']=_0x4d01e8[_0x759b('0x33')]['length']?_0x4d01e8[_0x759b('0x33')]:_0x5d6f80[_0x759b('0x2e')];if(!_0x1e024a[_0x759b('0x2f')][_0x759b('0x35')]('nolimit')){_0x4d01e8['limit']=qs['limit'](_0x1e024a[_0x759b('0x2f')][_0x759b('0x18')]);_0x4d01e8['offset']=qs['offset'](_0x1e024a[_0x759b('0x2f')][_0x759b('0x16')]);}_0x4d01e8[_0x759b('0x36')]=qs[_0x759b('0x37')](_0x1e024a[_0x759b('0x2f')][_0x759b('0x37')]);_0x4d01e8[_0x759b('0x38')]=qs[_0x759b('0x31')](_[_0x759b('0x39')](_0x1e024a[_0x759b('0x2f')],_0x5d6f80[_0x759b('0x31')]),_0xc90445);if(_0x1e024a[_0x759b('0x2f')][_0x759b('0x3a')]){_0x4d01e8['where']=_[_0x759b('0x3b')](_0x4d01e8['where'],{'$or':_['map'](_0xc90445,function(_0x2097d9){if(_0x2097d9[_0x759b('0x2c')]!==_0x759b('0x3c')){var _0x33edcb={};_0x33edcb[_0x2097d9[_0x759b('0x27')]]={'$like':'%'+_0x1e024a[_0x759b('0x2f')][_0x759b('0x3a')]+'%'};return _0x33edcb;}})});}_0x4d01e8=_[_0x759b('0x3b')]({},_0x4d01e8,_0x1e024a[_0x759b('0x3d')]);var _0x3c921d={'where':_0x4d01e8[_0x759b('0x38')]};return db['CmHopperAdditionalPhone'][_0x759b('0x19')](_0x3c921d)[_0x759b('0x20')](function(_0x2e1caa){_0x2c04e4[_0x759b('0x19')]=_0x2e1caa;if(_0x1e024a[_0x759b('0x2f')][_0x759b('0x3e')]){_0x4d01e8[_0x759b('0x3f')]=[{'all':!![]}];}return db[_0x759b('0x29')][_0x759b('0x40')](_0x4d01e8);})[_0x759b('0x20')](function(_0xf2b8c1){_0x2c04e4[_0x759b('0x41')]=_0xf2b8c1;return _0x2c04e4;})[_0x759b('0x20')](respondWithFilteredResult(_0x1db08f,_0x4d01e8))[_0x759b('0x42')](handleError(_0x1db08f,null));};exports[_0x759b('0x43')]=function(_0x15a885,_0x36f442){var _0x236b5c={'raw':!![],'where':{'id':_0x15a885[_0x759b('0x44')]['id']}},_0xbee185={};_0xbee185[_0x759b('0x2e')]=_[_0x759b('0x30')](db['CmHopperAdditionalPhone'][_0x759b('0x2a')]);_0xbee185[_0x759b('0x2f')]=_[_0x759b('0x30')](_0x15a885[_0x759b('0x2f')]);_0xbee185[_0x759b('0x31')]=_[_0x759b('0x32')](_0xbee185[_0x759b('0x2e')],_0xbee185['query']);_0x236b5c['attributes']=_[_0x759b('0x32')](_0xbee185['model'],qs[_0x759b('0x34')](_0x15a885['query'][_0x759b('0x34')]));_0x236b5c[_0x759b('0x33')]=_0x236b5c[_0x759b('0x33')][_0x759b('0x45')]?_0x236b5c[_0x759b('0x33')]:_0xbee185[_0x759b('0x2e')];if(_0x15a885[_0x759b('0x2f')][_0x759b('0x3e')]){_0x236b5c[_0x759b('0x3f')]=[{'all':!![]}];}_0x236b5c=_['merge']({},_0x236b5c,_0x15a885[_0x759b('0x3d')]);return db['CmHopperAdditionalPhone']['find'](_0x236b5c)[_0x759b('0x20')](handleEntityNotFound(_0x36f442,null))[_0x759b('0x20')](respondWithResult(_0x36f442,null))[_0x759b('0x42')](handleError(_0x36f442,null));};exports[_0x759b('0x46')]=function(_0x1d416a,_0x50e4b0){return db[_0x759b('0x29')]['create'](_0x1d416a['body'],{})[_0x759b('0x20')](function(_0x332f8a){var _0x229889=_0x1d416a['user'][_0x759b('0x22')]({'plain':!![]});if(!_0x229889)throw new Error(_0x759b('0x47'));if(_0x229889[_0x759b('0x48')]==='user'){var _0x449e56=_0x332f8a['get']({'plain':!![]});var _0x5dfae3='CmHopperAdditionalPhones';return db[_0x759b('0x49')][_0x759b('0x4a')]({'where':{'name':_0x5dfae3,'userProfileId':_0x229889[_0x759b('0x4b')]},'raw':!![]})['then'](function(_0x4e2f2a){if(_0x4e2f2a&&_0x4e2f2a['autoAssociation']===0x0){return db['UserProfileResource'][_0x759b('0x46')]({'name':_0x449e56[_0x759b('0x27')],'resourceId':_0x449e56['id'],'type':_0x4e2f2a[_0x759b('0x27')],'sectionId':_0x4e2f2a['id']},{})[_0x759b('0x20')](function(){return _0x332f8a;});}else{return _0x332f8a;}})[_0x759b('0x42')](function(_0x3e5415){logger[_0x759b('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e5415);throw _0x3e5415;});}return _0x332f8a;})[_0x759b('0x20')](respondWithResult(_0x50e4b0,0xc9))['catch'](handleError(_0x50e4b0,null));};exports[_0x759b('0x1f')]=function(_0x4b0845,_0x193a3d){if(_0x4b0845[_0x759b('0x4c')]['id']){delete _0x4b0845['body']['id'];}return db[_0x759b('0x29')][_0x759b('0x4a')]({'where':{'id':_0x4b0845[_0x759b('0x44')]['id']}})[_0x759b('0x20')](handleEntityNotFound(_0x193a3d,null))[_0x759b('0x20')](saveUpdates(_0x4b0845[_0x759b('0x4c')],null))['then'](respondWithResult(_0x193a3d,null))[_0x759b('0x42')](handleError(_0x193a3d,null));};exports[_0x759b('0x21')]=function(_0x46bac2,_0x21fd32){return db[_0x759b('0x29')][_0x759b('0x4a')]({'where':{'id':_0x46bac2[_0x759b('0x44')]['id']}})[_0x759b('0x20')](handleEntityNotFound(_0x21fd32,null))['then'](removeEntity(_0x21fd32,null))['catch'](handleError(_0x21fd32,null));};
\ No newline at end of file
+var _0x9a0b=['sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','map','CmHopperAdditionalPhone','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x45fa8c,_0x357b9a){var _0x17d608=function(_0x145ac0){while(--_0x145ac0){_0x45fa8c['push'](_0x45fa8c['shift']());}};_0x17d608(++_0x357b9a);}(_0x9a0b,0x18e));var _0xb9a0=function(_0x1bdedc,_0x41451d){_0x1bdedc=_0x1bdedc-0x0;var _0x514713=_0x9a0b[_0x1bdedc];return _0x514713;};'use strict';var emlformat=require(_0xb9a0('0x0'));var rimraf=require(_0xb9a0('0x1'));var zipdir=require(_0xb9a0('0x2'));var jsonpatch=require(_0xb9a0('0x3'));var rp=require('request-promise');var moment=require(_0xb9a0('0x4'));var BPromise=require(_0xb9a0('0x5'));var Mustache=require(_0xb9a0('0x6'));var util=require('util');var path=require(_0xb9a0('0x7'));var sox=require(_0xb9a0('0x8'));var csv=require('to-csv');var ejs=require(_0xb9a0('0x9'));var fs=require('fs');var fs_extra=require(_0xb9a0('0xa'));var _=require(_0xb9a0('0xb'));var squel=require(_0xb9a0('0xc'));var crypto=require(_0xb9a0('0xd'));var jsforce=require(_0xb9a0('0xe'));var deskjs=require(_0xb9a0('0xf'));var toCsv=require(_0xb9a0('0x10'));var querystring=require(_0xb9a0('0x11'));var Papa=require(_0xb9a0('0x12'));var Redis=require(_0xb9a0('0x13'));var authService=require(_0xb9a0('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb9a0('0x15'));var hardwareService=require(_0xb9a0('0x16'));var logger=require('../../config/logger')(_0xb9a0('0x17'));var utils=require('../../config/utils');var config=require(_0xb9a0('0x18'));var licenseUtil=require(_0xb9a0('0x19'));var db=require(_0xb9a0('0x1a'))['db'];function respondWithStatusCode(_0xb24b88,_0x7f4d1c){_0x7f4d1c=_0x7f4d1c||0xcc;return function(_0x1451c8){if(_0x1451c8){return _0xb24b88[_0xb9a0('0x1b')](_0x7f4d1c);}return _0xb24b88[_0xb9a0('0x1c')](_0x7f4d1c)[_0xb9a0('0x1d')]();};}function respondWithResult(_0x1c2bda,_0x4f4cc5){_0x4f4cc5=_0x4f4cc5||0xc8;return function(_0x43bd99){if(_0x43bd99){return _0x1c2bda[_0xb9a0('0x1c')](_0x4f4cc5)[_0xb9a0('0x1e')](_0x43bd99);}};}function respondWithFilteredResult(_0x5cbdd6,_0x138e81){return function(_0x3d9772){if(_0x3d9772){var _0x56954f=typeof _0x138e81[_0xb9a0('0x1f')]==='undefined'&&typeof _0x138e81[_0xb9a0('0x20')]===_0xb9a0('0x21');var _0x3350a2=_0x3d9772[_0xb9a0('0x22')];var _0x4e7ac0=_0x56954f?0x0:_0x138e81['offset'];var _0x11203e=_0x56954f?_0x3d9772[_0xb9a0('0x22')]:_0x138e81[_0xb9a0('0x1f')]+_0x138e81[_0xb9a0('0x20')];var _0x3c2579;if(_0x11203e>=_0x3350a2){_0x11203e=_0x3350a2;_0x3c2579=0xc8;}else{_0x3c2579=0xce;}_0x5cbdd6[_0xb9a0('0x1c')](_0x3c2579);return _0x5cbdd6[_0xb9a0('0x23')](_0xb9a0('0x24'),_0x4e7ac0+'-'+_0x11203e+'/'+_0x3350a2)[_0xb9a0('0x1e')](_0x3d9772);}return null;};}function patchUpdates(_0x1620a8){return function(_0x2da6e4){try{jsonpatch[_0xb9a0('0x25')](_0x2da6e4,_0x1620a8,!![]);}catch(_0x50ad31){return BPromise[_0xb9a0('0x26')](_0x50ad31);}return _0x2da6e4[_0xb9a0('0x27')]();};}function saveUpdates(_0x44ad4e,_0x12ab2b){return function(_0x13e4fc){if(_0x13e4fc){return _0x13e4fc['update'](_0x44ad4e)[_0xb9a0('0x28')](function(_0x4cb706){return _0x4cb706;});}return null;};}function removeEntity(_0x13cb1c,_0x3a54c4){return function(_0x288f89){if(_0x288f89){return _0x288f89[_0xb9a0('0x29')]()['then'](function(){var _0x2e6aeb=_0x288f89[_0xb9a0('0x2a')]({'plain':!![]});var _0x3d9192=_0xb9a0('0x2b');return db[_0xb9a0('0x2c')]['destroy']({'where':{'type':_0x3d9192,'resourceId':_0x2e6aeb['id']}})[_0xb9a0('0x28')](function(){return _0x288f89;});})[_0xb9a0('0x28')](function(){_0x13cb1c[_0xb9a0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e6481,_0x1a9aa2){return function(_0xc8e3c1){if(!_0xc8e3c1){_0x3e6481[_0xb9a0('0x1b')](0x194);}return _0xc8e3c1;};}function handleError(_0xbf473e,_0x38a972){_0x38a972=_0x38a972||0x1f4;return function(_0x10b96b){logger[_0xb9a0('0x2d')](_0x10b96b[_0xb9a0('0x2e')]);if(_0x10b96b[_0xb9a0('0x2f')]){delete _0x10b96b[_0xb9a0('0x2f')];}_0xbf473e[_0xb9a0('0x1c')](_0x38a972)[_0xb9a0('0x30')](_0x10b96b);};}exports['index']=function(_0x3740ec,_0x251918){var _0x362e04={},_0x26f755={},_0x14fddf={'count':0x0,'rows':[]};var _0x41ac75=_[_0xb9a0('0x31')](db[_0xb9a0('0x32')][_0xb9a0('0x33')],function(_0x4a332c){return{'name':_0x4a332c['fieldName'],'type':_0x4a332c[_0xb9a0('0x34')][_0xb9a0('0x35')]};});_0x26f755[_0xb9a0('0x36')]=_[_0xb9a0('0x31')](_0x41ac75,'name');_0x26f755[_0xb9a0('0x37')]=_['keys'](_0x3740ec[_0xb9a0('0x37')]);_0x26f755[_0xb9a0('0x38')]=_['intersection'](_0x26f755[_0xb9a0('0x36')],_0x26f755[_0xb9a0('0x37')]);_0x362e04[_0xb9a0('0x39')]=_[_0xb9a0('0x3a')](_0x26f755[_0xb9a0('0x36')],qs[_0xb9a0('0x3b')](_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x3b')]));_0x362e04[_0xb9a0('0x39')]=_0x362e04[_0xb9a0('0x39')][_0xb9a0('0x3c')]?_0x362e04['attributes']:_0x26f755[_0xb9a0('0x36')];if(!_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x3d')](_0xb9a0('0x3e'))){_0x362e04[_0xb9a0('0x20')]=qs['limit'](_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x20')]);_0x362e04[_0xb9a0('0x1f')]=qs[_0xb9a0('0x1f')](_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x1f')]);}_0x362e04['order']=qs[_0xb9a0('0x3f')](_0x3740ec['query'][_0xb9a0('0x3f')]);_0x362e04[_0xb9a0('0x40')]=qs[_0xb9a0('0x38')](_[_0xb9a0('0x41')](_0x3740ec[_0xb9a0('0x37')],_0x26f755['filters']),_0x41ac75);if(_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x42')]){_0x362e04[_0xb9a0('0x40')]=_[_0xb9a0('0x43')](_0x362e04['where'],{'$or':_['map'](_0x41ac75,function(_0x338b91){if(_0x338b91[_0xb9a0('0x34')]!=='VIRTUAL'){var _0x50f8df={};_0x50f8df[_0x338b91['name']]={'$like':'%'+_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x42')]+'%'};return _0x50f8df;}})});}_0x362e04=_[_0xb9a0('0x43')]({},_0x362e04,_0x3740ec[_0xb9a0('0x44')]);var _0x113900={'where':_0x362e04[_0xb9a0('0x40')]};return db['CmHopperAdditionalPhone'][_0xb9a0('0x22')](_0x113900)['then'](function(_0x32039c){_0x14fddf['count']=_0x32039c;if(_0x3740ec[_0xb9a0('0x37')][_0xb9a0('0x45')]){_0x362e04[_0xb9a0('0x46')]=[{'all':!![]}];}return db[_0xb9a0('0x32')][_0xb9a0('0x47')](_0x362e04);})[_0xb9a0('0x28')](function(_0x1dc8f3){_0x14fddf['rows']=_0x1dc8f3;return _0x14fddf;})[_0xb9a0('0x28')](respondWithFilteredResult(_0x251918,_0x362e04))[_0xb9a0('0x48')](handleError(_0x251918,null));};exports[_0xb9a0('0x49')]=function(_0xbdf78b,_0x96b3b8){var _0xe5a169={'raw':!![],'where':{'id':_0xbdf78b[_0xb9a0('0x4a')]['id']}},_0x4d91d5={};_0x4d91d5[_0xb9a0('0x36')]=_[_0xb9a0('0x4b')](db['CmHopperAdditionalPhone'][_0xb9a0('0x33')]);_0x4d91d5[_0xb9a0('0x37')]=_['keys'](_0xbdf78b['query']);_0x4d91d5[_0xb9a0('0x38')]=_[_0xb9a0('0x3a')](_0x4d91d5['model'],_0x4d91d5[_0xb9a0('0x37')]);_0xe5a169[_0xb9a0('0x39')]=_['intersection'](_0x4d91d5[_0xb9a0('0x36')],qs[_0xb9a0('0x3b')](_0xbdf78b[_0xb9a0('0x37')][_0xb9a0('0x3b')]));_0xe5a169[_0xb9a0('0x39')]=_0xe5a169[_0xb9a0('0x39')][_0xb9a0('0x3c')]?_0xe5a169[_0xb9a0('0x39')]:_0x4d91d5[_0xb9a0('0x36')];if(_0xbdf78b[_0xb9a0('0x37')][_0xb9a0('0x45')]){_0xe5a169[_0xb9a0('0x46')]=[{'all':!![]}];}_0xe5a169=_[_0xb9a0('0x43')]({},_0xe5a169,_0xbdf78b['options']);return db[_0xb9a0('0x32')][_0xb9a0('0x4c')](_0xe5a169)[_0xb9a0('0x28')](handleEntityNotFound(_0x96b3b8,null))['then'](respondWithResult(_0x96b3b8,null))[_0xb9a0('0x48')](handleError(_0x96b3b8,null));};exports[_0xb9a0('0x4d')]=function(_0x564bab,_0x37c6af){return db[_0xb9a0('0x32')][_0xb9a0('0x4d')](_0x564bab[_0xb9a0('0x4e')],{})[_0xb9a0('0x28')](function(_0x248187){var _0x3296ca=_0x564bab[_0xb9a0('0x4f')][_0xb9a0('0x2a')]({'plain':!![]});if(!_0x3296ca)throw new Error(_0xb9a0('0x50'));if(_0x3296ca['role']===_0xb9a0('0x4f')){var _0x1d2518=_0x248187[_0xb9a0('0x2a')]({'plain':!![]});var _0xe6c5e7='CmHopperAdditionalPhones';return db[_0xb9a0('0x51')][_0xb9a0('0x4c')]({'where':{'name':_0xe6c5e7,'userProfileId':_0x3296ca[_0xb9a0('0x52')]},'raw':!![]})['then'](function(_0x4853a8){if(_0x4853a8&&_0x4853a8['autoAssociation']===0x0){return db['UserProfileResource'][_0xb9a0('0x4d')]({'name':_0x1d2518[_0xb9a0('0x2f')],'resourceId':_0x1d2518['id'],'type':_0x4853a8[_0xb9a0('0x2f')],'sectionId':_0x4853a8['id']},{})['then'](function(){return _0x248187;});}else{return _0x248187;}})['catch'](function(_0x420b0b){logger[_0xb9a0('0x2d')](_0xb9a0('0x53'),_0x420b0b);throw _0x420b0b;});}return _0x248187;})['then'](respondWithResult(_0x37c6af,0xc9))[_0xb9a0('0x48')](handleError(_0x37c6af,null));};exports[_0xb9a0('0x54')]=function(_0x3075d5,_0x430d08){if(_0x3075d5[_0xb9a0('0x4e')]['id']){delete _0x3075d5[_0xb9a0('0x4e')]['id'];}return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x3075d5['params']['id']}})[_0xb9a0('0x28')](handleEntityNotFound(_0x430d08,null))[_0xb9a0('0x28')](saveUpdates(_0x3075d5[_0xb9a0('0x4e')],null))[_0xb9a0('0x28')](respondWithResult(_0x430d08,null))['catch'](handleError(_0x430d08,null));};exports[_0xb9a0('0x29')]=function(_0x3e3a81,_0x585e4a){return db[_0xb9a0('0x32')][_0xb9a0('0x4c')]({'where':{'id':_0x3e3a81[_0xb9a0('0x4a')]['id']}})[_0xb9a0('0x28')](handleEntityNotFound(_0x585e4a,null))[_0xb9a0('0x28')](removeEntity(_0x585e4a,null))[_0xb9a0('0x48')](handleError(_0x585e4a,null));};
\ No newline at end of file
index 471b25a..3ff17a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d37=['bluebird','request-promise','path','rimraf','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','lodash','../../config/logger','api','moment'];(function(_0x546539,_0x44e2b2){var _0x3b2235=function(_0x30f397){while(--_0x30f397){_0x546539['push'](_0x546539['shift']());}};_0x3b2235(++_0x44e2b2);}(_0x8d37,0xbc));var _0x78d3=function(_0xd36b0c,_0x15f5ae){_0xd36b0c=_0xd36b0c-0x0;var _0x55c6d8=_0x8d37[_0xd36b0c];return _0x55c6d8;};'use strict';var _=require(_0x78d3('0x0'));var util=require('util');var logger=require(_0x78d3('0x1'))(_0x78d3('0x2'));var moment=require(_0x78d3('0x3'));var BPromise=require(_0x78d3('0x4'));var rp=require(_0x78d3('0x5'));var fs=require('fs');var path=require(_0x78d3('0x6'));var rimraf=require(_0x78d3('0x7'));var config=require('../../config/environment');var attributes=require(_0x78d3('0x8'));module[_0x78d3('0x9')]=function(_0x5da972,_0x114e2e){return _0x5da972[_0x78d3('0xa')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x78d3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xead8=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','CmHopperAdditionalPhone','cm_hopper_additional_phones','util'];(function(_0x38aeea,_0x57522a){var _0x5e8d2c=function(_0xff08ce){while(--_0xff08ce){_0x38aeea['push'](_0x38aeea['shift']());}};_0x5e8d2c(++_0x57522a);}(_0xead8,0x8f));var _0x8ead=function(_0x47195e,_0x347734){_0x47195e=_0x47195e-0x0;var _0x571abb=_0xead8[_0x47195e];return _0x571abb;};'use strict';var _=require('lodash');var util=require(_0x8ead('0x0'));var logger=require('../../config/logger')(_0x8ead('0x1'));var moment=require(_0x8ead('0x2'));var BPromise=require('bluebird');var rp=require(_0x8ead('0x3'));var fs=require('fs');var path=require(_0x8ead('0x4'));var rimraf=require(_0x8ead('0x5'));var config=require(_0x8ead('0x6'));var attributes=require(_0x8ead('0x7'));module[_0x8ead('0x8')]=function(_0x361717,_0x37c943){return _0x361717[_0x8ead('0x9')](_0x8ead('0xa'),attributes,{'tableName':_0x8ead('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a98eba3..58f82f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781b=['SwapAdditionalPhones','CampaignId','ASC','duration','waitTime','isNil','scheduledat','add','minutes','phone','updatedAt','createdAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CmHopperAdditionalPhone','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','OrderBy','countbusyretry','countmachineretry','entity'];(function(_0x140d2f,_0x2ad576){var _0x1a04c6=function(_0x4f742b){while(--_0x4f742b){_0x140d2f['push'](_0x140d2f['shift']());}};_0x1a04c6(++_0x2ad576);}(_0x781b,0x8e));var _0xb781=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x781b[_0x228a4a];return _0x3d3937;};'use strict';var _=require(_0xb781('0x0'));var util=require(_0xb781('0x1'));var moment=require(_0xb781('0x2'));var BPromise=require(_0xb781('0x3'));var rs=require(_0xb781('0x4'));var fs=require('fs');var Redis=require(_0xb781('0x5'));var db=require(_0xb781('0x6'))['db'];var utils=require(_0xb781('0x7'));var logger=require('../../config/logger')(_0xb781('0x8'));var config=require(_0xb781('0x9'));var jayson=require(_0xb781('0xa'));var client=jayson['client'][_0xb781('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44ff64,_0x4cef7f,_0x583c5b){return new BPromise(function(_0x58ab77,_0x2060a5){return client[_0xb781('0xc')](_0x44ff64,_0x583c5b)[_0xb781('0xd')](function(_0x5746b9){logger['info'](_0xb781('0xe'),_0x4cef7f,'request\x20sent');logger[_0xb781('0xf')](_0xb781('0x10'),_0x4cef7f,_0xb781('0x11'),JSON[_0xb781('0x12')](_0x5746b9));if(_0x5746b9[_0xb781('0x13')]){if(_0x5746b9['error'][_0xb781('0x14')]===0x1f4){logger[_0xb781('0x13')](_0xb781('0xe'),_0x4cef7f,_0x5746b9[_0xb781('0x13')][_0xb781('0x15')]);return _0x2060a5(_0x5746b9[_0xb781('0x13')][_0xb781('0x15')]);}logger[_0xb781('0x13')](_0xb781('0xe'),_0x4cef7f,_0x5746b9['error']['message']);return _0x58ab77(_0x5746b9[_0xb781('0x13')]['message']);}else{logger[_0xb781('0x16')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x4cef7f,_0xb781('0x11'));_0x58ab77(_0x5746b9[_0xb781('0x17')][_0xb781('0x15')]);}})[_0xb781('0x18')](function(_0xd824c9){logger['error'](_0xb781('0xe'),_0x4cef7f,_0xd824c9);_0x2060a5(_0xd824c9);});});}exports[_0xb781('0x19')]=function(_0x1b87a9){var _0x5375f1=this;return new Promise(function(_0xe566d5,_0x33ce9e){return db[_0xb781('0x1a')][_0xb781('0x1b')]({'raw':!![],'where':{'ContactId':_0x1b87a9[_0xb781('0x1c')][_0xb781('0x1d')],'ListId':_0x1b87a9[_0xb781('0x1c')][_0xb781('0x1e')],'VoiceQueueId':_0x1b87a9[_0xb781('0x1c')][_0xb781('0x1f')]===undefined?null:_0x1b87a9['body'][_0xb781('0x1f')],'CampaignId':_0x1b87a9[_0xb781('0x1c')]['CampaignId']===undefined?null:_0x1b87a9[_0xb781('0x1c')]['CampaignId']}})[_0xb781('0xd')](function(_0x2fa3c0){if(_0x2fa3c0!=null){return db[_0xb781('0x20')][_0xb781('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x2fa3c0['id'],'OrderBy':{'$gt':_0x2fa3c0['OrderBy']}},'order':[['OrderBy','ASC']]})[_0xb781('0xd')](function(_0x4ccbf5){var _0x340cb0=0x0;if(_0x4ccbf5){if(_0x4ccbf5['countbusyretry']+_0x4ccbf5[_0xb781('0x21')]+_0x4ccbf5[_0xb781('0x22')]+_0x4ccbf5[_0xb781('0x23')]+_0x4ccbf5[_0xb781('0x24')]+_0x4ccbf5[_0xb781('0x25')]+_0x4ccbf5['countmachineretry']+_0x4ccbf5[_0xb781('0x26')]<_0x1b87a9['entity'][_0xb781('0x27')])_0x340cb0=0x1;_0xe566d5({'additional':_0x340cb0});}else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2fa3c0['id']},'order':[[_0xb781('0x28'),'ASC']]})[_0xb781('0xd')](function(_0x1c3f66){var _0x563707=0x0;if(_0x1c3f66){if(_0x1c3f66[_0xb781('0x29')]+_0x1c3f66['countcongestionretry']+_0x1c3f66[_0xb781('0x22')]+_0x1c3f66['countnosuchnumberretry']+_0x1c3f66[_0xb781('0x24')]+_0x1c3f66[_0xb781('0x25')]+_0x1c3f66[_0xb781('0x2a')]+_0x1c3f66[_0xb781('0x26')]<_0x1b87a9[_0xb781('0x2b')][_0xb781('0x27')])_0x563707=0x1;_0xe566d5({'additional':_0x563707});}else{_0xe566d5({'additional':0x0});}})[_0xb781('0x18')](function(_0x1afe41){logger[_0xb781('0x13')]('VerifyAdditionalPhones',_0x1afe41['message']);_0x33ce9e(_0x5375f1[_0xb781('0x13')](0x1f4,_0x1afe41['message']));});}})['catch'](function(_0x5b25b6){logger[_0xb781('0x13')](_0xb781('0x19'),_0x5b25b6[_0xb781('0x15')]);_0x33ce9e(_0x5375f1[_0xb781('0x13')](0x1f4,_0x5b25b6['message']));});}else _0xe566d5({'additional':0x0});});});};exports[_0xb781('0x2c')]=function(_0x196095){var _0x430f59=this;return new Promise(function(_0x188d61,_0x323940){return db[_0xb781('0x1a')][_0xb781('0x1b')]({'raw':!![],'where':{'ContactId':_0x196095['body'][_0xb781('0x1d')],'ListId':_0x196095['body'][_0xb781('0x1e')],'VoiceQueueId':_0x196095[_0xb781('0x1c')]['VoiceQueueId']===undefined?null:_0x196095[_0xb781('0x1c')][_0xb781('0x1f')],'CampaignId':_0x196095['body'][_0xb781('0x2d')]===undefined?null:_0x196095[_0xb781('0x1c')][_0xb781('0x2d')]}})[_0xb781('0xd')](function(_0x424260){if(_0x424260!=null){return db[_0xb781('0x20')][_0xb781('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x424260['id'],'OrderBy':{'$gte':_0x424260[_0xb781('0x28')]}},'order':[['OrderBy',_0xb781('0x2e')]]})[_0xb781('0xd')](function(_0x26d030){if(_0x26d030)return activateAdditionalPhone(_0x424260,_0x196095[_0xb781('0x1c')],_0x26d030,_0x196095[_0xb781('0x2f')],_0x196095['waitTime'])[_0xb781('0xd')](function(_0x4f3ae5){_0x188d61(_0x4f3ae5);});else{return db[_0xb781('0x20')][_0xb781('0x1b')]({'raw':!![],'where':{'CmHopperId':_0x424260['id']},'order':[[_0xb781('0x28'),_0xb781('0x2e')]]})['then'](function(_0x245ecb){if(_0x245ecb)return activateAdditionalPhone(_0x424260,_0x196095[_0xb781('0x1c')],_0x245ecb,_0x196095['duration'],_0x196095[_0xb781('0x30')])[_0xb781('0xd')](function(_0x78c2ef){_0x188d61(_0x78c2ef);});else{_0x188d61({'id':_0x424260['id'],'phone':''});}})['catch'](function(_0x422f20){logger['error'](_0xb781('0x19'),_0x422f20[_0xb781('0x15')]);_0x323940(_0x430f59['error'](0x1f4,_0x422f20[_0xb781('0x15')]));});}})[_0xb781('0x18')](function(_0x5abd99){logger[_0xb781('0x13')](_0xb781('0x19'),_0x5abd99['message']);_0x323940(_0x430f59[_0xb781('0x13')](0x1f4,_0x5abd99[_0xb781('0x15')]));});}else _0x188d61(0x1);});});};function activateAdditionalPhone(_0x1dee52,_0x5e5138,_0x594d20,_0x2abf9b,_0x181aac){return new Promise(function(_0x1b5ca4,_0x80dfa7){var _0x461596;if(_[_0xb781('0x31')](_0x594d20[_0xb781('0x32')])){_0x594d20['scheduledat']=moment();}if(moment()>moment(_0x594d20[_0xb781('0x32')])){_0x461596=moment()[_0xb781('0x33')](_0x181aac||0x3,_0xb781('0x34'));}else{if(_0x594d20['OrderBy']==0x0){_0x461596=moment(_0x594d20[_0xb781('0x32')]);}else{_0x461596=moment()[_0xb781('0x33')](_0x181aac||0x3,'minutes');}}if(_['isNil'](_0x461596)){_0x461596=moment()[_0xb781('0x33')](_0x181aac||0x3,_0xb781('0x34'));}var _0x3f1b0f={'phone':_0x1dee52[_0xb781('0x35')],'active':0x0,'OrderBy':_[_0xb781('0x31')](_0x1dee52[_0xb781('0x28')])?0x0:_0x1dee52['OrderBy'],'scheduledat':moment()[_0xb781('0x33')](_0x2abf9b||0x1,_0xb781('0x34')),'countbusyretry':_0x5e5138[_0xb781('0x29')],'countcongestionretry':_0x5e5138['countcongestionretry'],'countnoanswerretry':_0x5e5138['countnoanswerretry'],'countnosuchnumberretry':_0x5e5138[_0xb781('0x23')],'countdropretry':_0x5e5138[_0xb781('0x24')],'countabandonedretry':_0x5e5138[_0xb781('0x25')],'countmachineretry':_0x5e5138[_0xb781('0x2a')],'countagentrejectretry':_0x5e5138[_0xb781('0x26')],'createdAt':_0x5e5138['createdAt'],'updatedAt':_0x5e5138[_0xb781('0x36')]};var _0x4b1a49={'CmHopperId':_0x1dee52['id'],'phone':_0x594d20['phone'],'active':0x0,'OrderBy':_['isNil'](_0x594d20['OrderBy'])?0x0:_0x594d20[_0xb781('0x28')],'scheduledat':_0x461596,'countbusyretry':_0x594d20[_0xb781('0x29')],'countcongestionretry':_0x594d20[_0xb781('0x21')],'countnoanswerretry':_0x594d20[_0xb781('0x22')],'countnosuchnumberretry':_0x594d20[_0xb781('0x23')],'countdropretry':_0x594d20[_0xb781('0x24')],'countabandonedretry':_0x594d20[_0xb781('0x25')],'countmachineretry':_0x594d20[_0xb781('0x2a')],'countagentrejectretry':_0x594d20['countagentrejectretry'],'createdAt':_0x594d20[_0xb781('0x37')],'updatedAt':_0x594d20[_0xb781('0x36')]};return db[_0xb781('0x38')][_0xb781('0x39')](function(_0x5aed9c){return db[_0xb781('0x20')][_0xb781('0x3a')](_0x3f1b0f,{'where':{'id':_0x594d20['id']}},{'transaction':_0x5aed9c})[_0xb781('0xd')](function(){return db[_0xb781('0x1a')][_0xb781('0x3a')](_0x4b1a49,{'where':{'id':_0x1dee52['id']}},{'transaction':_0x5aed9c});});})[_0xb781('0xd')](function(_0x556734){_0x1b5ca4({'id':_0x1dee52['id'],'phone':_0x594d20['phone']});})[_0xb781('0x18')](function(_0x65cbd){logger['error'](_0xb781('0x3b'),_0x65cbd['message']);_0x80dfa7({'error':_0x65cbd['message']});});});}exports[_0xb781('0x3c')]=function(_0x525146){var _0x36ce65=this;return new Promise(function(_0x177c9a,_0x4cb3c5){return db[_0xb781('0x1a')][_0xb781('0x3a')](_0x525146['body'][_0xb781('0x3d')],{'where':{'id':_0x525146['body']['id']}})['then'](function(_0x1a2394){_0x177c9a(_0x1a2394);})[_0xb781('0x18')](function(_0x340d96){logger['error'](_0xb781('0x3c'),_0x340d96[_0xb781('0x15')]);_0x4cb3c5(_0x36ce65[_0xb781('0x13')](0x1f4,_0x340d96[_0xb781('0x15')]));});});};
\ No newline at end of file
+var _0x1d7e=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CmHopper','findOne','ContactId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','then','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countnoanswerretry','countdropretry','entity','catch','SwapAdditionalPhones','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','lodash','util','moment','bluebird','randomstring'];(function(_0x545dda,_0x577f99){var _0xef8cba=function(_0x3cf2e8){while(--_0x3cf2e8){_0x545dda['push'](_0x545dda['shift']());}};_0xef8cba(++_0x577f99);}(_0x1d7e,0x1db));var _0xe1d7=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x1d7e[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xe1d7('0x0'));var util=require(_0xe1d7('0x1'));var moment=require(_0xe1d7('0x2'));var BPromise=require(_0xe1d7('0x3'));var rs=require(_0xe1d7('0x4'));var fs=require('fs');var Redis=require(_0xe1d7('0x5'));var db=require(_0xe1d7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe1d7('0x7'))(_0xe1d7('0x8'));var config=require(_0xe1d7('0x9'));var jayson=require(_0xe1d7('0xa'));var client=jayson[_0xe1d7('0xb')][_0xe1d7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e331b,_0x28c58a,_0x17b8e3){return new BPromise(function(_0x1c3450,_0x58b64d){return client[_0xe1d7('0xd')](_0x5e331b,_0x17b8e3)['then'](function(_0x422db5){logger[_0xe1d7('0xe')](_0xe1d7('0xf'),_0x28c58a,'request\x20sent');logger[_0xe1d7('0x10')](_0xe1d7('0x11'),_0x28c58a,_0xe1d7('0x12'),JSON[_0xe1d7('0x13')](_0x422db5));if(_0x422db5[_0xe1d7('0x14')]){if(_0x422db5[_0xe1d7('0x14')][_0xe1d7('0x15')]===0x1f4){logger[_0xe1d7('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x28c58a,_0x422db5['error'][_0xe1d7('0x16')]);return _0x58b64d(_0x422db5['error']['message']);}logger[_0xe1d7('0x14')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x28c58a,_0x422db5[_0xe1d7('0x14')][_0xe1d7('0x16')]);return _0x1c3450(_0x422db5[_0xe1d7('0x14')][_0xe1d7('0x16')]);}else{logger['info'](_0xe1d7('0xf'),_0x28c58a,_0xe1d7('0x12'));_0x1c3450(_0x422db5[_0xe1d7('0x17')][_0xe1d7('0x16')]);}})['catch'](function(_0x1ba593){logger[_0xe1d7('0x14')](_0xe1d7('0xf'),_0x28c58a,_0x1ba593);_0x58b64d(_0x1ba593);});});}exports['VerifyAdditionalPhones']=function(_0x51126a){var _0x353ded=this;return new Promise(function(_0x50c2a9,_0x5f48cb){return db[_0xe1d7('0x18')][_0xe1d7('0x19')]({'raw':!![],'where':{'ContactId':_0x51126a['body'][_0xe1d7('0x1a')],'ListId':_0x51126a[_0xe1d7('0x1b')]['ListId'],'VoiceQueueId':_0x51126a[_0xe1d7('0x1b')][_0xe1d7('0x1c')]===undefined?null:_0x51126a[_0xe1d7('0x1b')][_0xe1d7('0x1c')],'CampaignId':_0x51126a['body']['CampaignId']===undefined?null:_0x51126a[_0xe1d7('0x1b')][_0xe1d7('0x1d')]}})['then'](function(_0x26d31a){if(_0x26d31a!=null){return db[_0xe1d7('0x1e')][_0xe1d7('0x19')]({'raw':!![],'where':{'CmHopperId':_0x26d31a['id'],'OrderBy':{'$gt':_0x26d31a[_0xe1d7('0x1f')]}},'order':[['OrderBy',_0xe1d7('0x20')]]})[_0xe1d7('0x21')](function(_0x7cf0df){var _0x129748=0x0;if(_0x7cf0df){if(_0x7cf0df[_0xe1d7('0x22')]+_0x7cf0df[_0xe1d7('0x23')]+_0x7cf0df['countnoanswerretry']+_0x7cf0df[_0xe1d7('0x24')]+_0x7cf0df['countdropretry']+_0x7cf0df[_0xe1d7('0x25')]+_0x7cf0df[_0xe1d7('0x26')]+_0x7cf0df[_0xe1d7('0x27')]<_0x51126a['entity'][_0xe1d7('0x28')])_0x129748=0x1;_0x50c2a9({'additional':_0x129748});}else{return db[_0xe1d7('0x1e')][_0xe1d7('0x19')]({'raw':!![],'where':{'CmHopperId':_0x26d31a['id']},'order':[['OrderBy',_0xe1d7('0x20')]]})[_0xe1d7('0x21')](function(_0x4da7a4){var _0x41bce1=0x0;if(_0x4da7a4){if(_0x4da7a4['countbusyretry']+_0x4da7a4[_0xe1d7('0x23')]+_0x4da7a4[_0xe1d7('0x29')]+_0x4da7a4[_0xe1d7('0x24')]+_0x4da7a4[_0xe1d7('0x2a')]+_0x4da7a4[_0xe1d7('0x25')]+_0x4da7a4[_0xe1d7('0x26')]+_0x4da7a4[_0xe1d7('0x27')]<_0x51126a[_0xe1d7('0x2b')][_0xe1d7('0x28')])_0x41bce1=0x1;_0x50c2a9({'additional':_0x41bce1});}else{_0x50c2a9({'additional':0x0});}})[_0xe1d7('0x2c')](function(_0x4170b4){logger[_0xe1d7('0x14')]('VerifyAdditionalPhones',_0x4170b4[_0xe1d7('0x16')]);_0x5f48cb(_0x353ded[_0xe1d7('0x14')](0x1f4,_0x4170b4[_0xe1d7('0x16')]));});}})[_0xe1d7('0x2c')](function(_0x30fe09){logger[_0xe1d7('0x14')]('VerifyAdditionalPhones',_0x30fe09[_0xe1d7('0x16')]);_0x5f48cb(_0x353ded[_0xe1d7('0x14')](0x1f4,_0x30fe09[_0xe1d7('0x16')]));});}else _0x50c2a9({'additional':0x0});});});};exports[_0xe1d7('0x2d')]=function(_0x508296){var _0x57d477=this;return new Promise(function(_0x1e191f,_0x23802c){return db['CmHopper'][_0xe1d7('0x19')]({'raw':!![],'where':{'ContactId':_0x508296[_0xe1d7('0x1b')][_0xe1d7('0x1a')],'ListId':_0x508296['body']['ListId'],'VoiceQueueId':_0x508296[_0xe1d7('0x1b')][_0xe1d7('0x1c')]===undefined?null:_0x508296[_0xe1d7('0x1b')][_0xe1d7('0x1c')],'CampaignId':_0x508296[_0xe1d7('0x1b')][_0xe1d7('0x1d')]===undefined?null:_0x508296[_0xe1d7('0x1b')][_0xe1d7('0x1d')]}})[_0xe1d7('0x21')](function(_0x2d59a9){if(_0x2d59a9!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x2d59a9['id'],'OrderBy':{'$gte':_0x2d59a9['OrderBy']}},'order':[[_0xe1d7('0x1f'),_0xe1d7('0x20')]]})['then'](function(_0x58d8ab){if(_0x58d8ab)return activateAdditionalPhone(_0x2d59a9,_0x508296[_0xe1d7('0x1b')],_0x58d8ab,_0x508296[_0xe1d7('0x2e')],_0x508296[_0xe1d7('0x2f')])[_0xe1d7('0x21')](function(_0xec10f3){_0x1e191f(_0xec10f3);});else{return db[_0xe1d7('0x1e')][_0xe1d7('0x19')]({'raw':!![],'where':{'CmHopperId':_0x2d59a9['id']},'order':[['OrderBy',_0xe1d7('0x20')]]})[_0xe1d7('0x21')](function(_0x5cf9cc){if(_0x5cf9cc)return activateAdditionalPhone(_0x2d59a9,_0x508296[_0xe1d7('0x1b')],_0x5cf9cc,_0x508296[_0xe1d7('0x2e')],_0x508296[_0xe1d7('0x2f')])['then'](function(_0x3a261e){_0x1e191f(_0x3a261e);});else{_0x1e191f({'id':_0x2d59a9['id'],'phone':''});}})[_0xe1d7('0x2c')](function(_0x3be608){logger[_0xe1d7('0x14')]('VerifyAdditionalPhones',_0x3be608[_0xe1d7('0x16')]);_0x23802c(_0x57d477['error'](0x1f4,_0x3be608[_0xe1d7('0x16')]));});}})[_0xe1d7('0x2c')](function(_0x5ddde9){logger[_0xe1d7('0x14')]('VerifyAdditionalPhones',_0x5ddde9[_0xe1d7('0x16')]);_0x23802c(_0x57d477[_0xe1d7('0x14')](0x1f4,_0x5ddde9[_0xe1d7('0x16')]));});}else _0x1e191f(0x1);});});};function activateAdditionalPhone(_0x1bea66,_0x523388,_0x1c1b83,_0x10e3a5,_0x34fc61){return new Promise(function(_0x504094,_0x55d720){var _0x13997d;if(_[_0xe1d7('0x30')](_0x1c1b83[_0xe1d7('0x31')])){_0x1c1b83['scheduledat']=moment();}if(moment()>moment(_0x1c1b83[_0xe1d7('0x31')])){_0x13997d=moment()[_0xe1d7('0x32')](_0x34fc61||0x3,_0xe1d7('0x33'));}else{if(_0x1c1b83['OrderBy']==0x0){_0x13997d=moment(_0x1c1b83[_0xe1d7('0x31')]);}else{_0x13997d=moment()[_0xe1d7('0x32')](_0x34fc61||0x3,_0xe1d7('0x33'));}}if(_['isNil'](_0x13997d)){_0x13997d=moment()['add'](_0x34fc61||0x3,_0xe1d7('0x33'));}var _0x4915bc={'phone':_0x1bea66[_0xe1d7('0x34')],'active':0x0,'OrderBy':_[_0xe1d7('0x30')](_0x1bea66[_0xe1d7('0x1f')])?0x0:_0x1bea66['OrderBy'],'scheduledat':moment()[_0xe1d7('0x32')](_0x10e3a5||0x1,_0xe1d7('0x33')),'countbusyretry':_0x523388[_0xe1d7('0x22')],'countcongestionretry':_0x523388[_0xe1d7('0x23')],'countnoanswerretry':_0x523388[_0xe1d7('0x29')],'countnosuchnumberretry':_0x523388[_0xe1d7('0x24')],'countdropretry':_0x523388[_0xe1d7('0x2a')],'countabandonedretry':_0x523388[_0xe1d7('0x25')],'countmachineretry':_0x523388[_0xe1d7('0x26')],'countagentrejectretry':_0x523388[_0xe1d7('0x27')],'createdAt':_0x523388[_0xe1d7('0x35')],'updatedAt':_0x523388[_0xe1d7('0x36')]};var _0x354ecf={'CmHopperId':_0x1bea66['id'],'phone':_0x1c1b83['phone'],'active':0x0,'OrderBy':_[_0xe1d7('0x30')](_0x1c1b83[_0xe1d7('0x1f')])?0x0:_0x1c1b83[_0xe1d7('0x1f')],'scheduledat':_0x13997d,'countbusyretry':_0x1c1b83[_0xe1d7('0x22')],'countcongestionretry':_0x1c1b83['countcongestionretry'],'countnoanswerretry':_0x1c1b83['countnoanswerretry'],'countnosuchnumberretry':_0x1c1b83[_0xe1d7('0x24')],'countdropretry':_0x1c1b83[_0xe1d7('0x2a')],'countabandonedretry':_0x1c1b83['countabandonedretry'],'countmachineretry':_0x1c1b83['countmachineretry'],'countagentrejectretry':_0x1c1b83[_0xe1d7('0x27')],'createdAt':_0x1c1b83[_0xe1d7('0x35')],'updatedAt':_0x1c1b83[_0xe1d7('0x36')]};return db['sequelize'][_0xe1d7('0x37')](function(_0x555c3a){return db['CmHopperAdditionalPhone'][_0xe1d7('0x38')](_0x4915bc,{'where':{'id':_0x1c1b83['id']}},{'transaction':_0x555c3a})[_0xe1d7('0x21')](function(){return db[_0xe1d7('0x18')]['update'](_0x354ecf,{'where':{'id':_0x1bea66['id']}},{'transaction':_0x555c3a});});})[_0xe1d7('0x21')](function(_0x1eceb4){_0x504094({'id':_0x1bea66['id'],'phone':_0x1c1b83[_0xe1d7('0x34')]});})[_0xe1d7('0x2c')](function(_0x4eb85e){logger[_0xe1d7('0x14')](_0xe1d7('0x39'),_0x4eb85e[_0xe1d7('0x16')]);_0x55d720({'error':_0x4eb85e[_0xe1d7('0x16')]});});});}exports['IncrementPreviewCounters']=function(_0x214e2e){var _0x4553e1=this;return new Promise(function(_0x14cedf,_0x5729a8){return db[_0xe1d7('0x18')][_0xe1d7('0x38')](_0x214e2e[_0xe1d7('0x1b')][_0xe1d7('0x3a')],{'where':{'id':_0x214e2e['body']['id']}})[_0xe1d7('0x21')](function(_0x16a7a2){_0x14cedf(_0x16a7a2);})[_0xe1d7('0x2c')](function(_0x9e2271){logger[_0xe1d7('0x14')](_0xe1d7('0x3b'),_0x9e2271[_0xe1d7('0x16')]);_0x5729a8(_0x4553e1[_0xe1d7('0x14')](0x1f4,_0x9e2271[_0xe1d7('0x16')]));});});};
\ No newline at end of file
index 0197c92..7e11374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20fa=['Router','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','put','update','destroy','multer','connect-timeout'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x20fa,0x166));var _0xa20f=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x20fa[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xa20f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa20f('0x1'));var express=require('express');var router=express[_0xa20f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa20f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa20f('0x4'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xa20f('0x5')]('/',auth['isAuthenticated'](),controller[_0xa20f('0x6')]);router[_0xa20f('0x5')](_0xa20f('0x7'),auth[_0xa20f('0x8')](),controller['show']);router['post']('/',auth[_0xa20f('0x8')](),controller['create']);router[_0xa20f('0x9')](_0xa20f('0x7'),auth[_0xa20f('0x8')](),controller[_0xa20f('0xa')]);router['delete'](_0xa20f('0x7'),auth['isAuthenticated'](),controller[_0xa20f('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x085c=['put','update','/:id','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x085c,0xf4));var _0xc085=function(_0x4d584f,_0x385fcd){_0x4d584f=_0x4d584f-0x0;var _0x383793=_0x085c[_0x4d584f];return _0x383793;};'use strict';var multer=require(_0xc085('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc085('0x1'));var express=require(_0xc085('0x2'));var router=express[_0xc085('0x3')]();var fs_extra=require(_0xc085('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc085('0x5'));var config=require(_0xc085('0x6'));var controller=require('./cmHopperAdditionalPhone.controller');router[_0xc085('0x7')]('/',auth[_0xc085('0x8')](),controller[_0xc085('0x9')]);router['get']('/:id',auth[_0xc085('0x8')](),controller[_0xc085('0xa')]);router['post']('/',auth[_0xc085('0x8')](),controller[_0xc085('0xb')]);router[_0xc085('0xc')]('/:id',auth[_0xc085('0x8')](),controller[_0xc085('0xd')]);router['delete'](_0xc085('0xe'),auth[_0xc085('0x8')](),controller['destroy']);module[_0xc085('0xf')]=router;
\ No newline at end of file
index 2159e37..2500f62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ad9=['STRING','INTEGER','contactListQueue','moment','sequelize','exports'];(function(_0x36b22b,_0x589e80){var _0x2ad385=function(_0x414a1c){while(--_0x414a1c){_0x36b22b['push'](_0x36b22b['shift']());}};_0x2ad385(++_0x589e80);}(_0x1ad9,0xdb));var _0x91ad=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0x1ad9[_0x1e4f2f];return _0xccea89;};'use strict';var moment=require(_0x91ad('0x0'));var Sequelize=require(_0x91ad('0x1'));module[_0x91ad('0x2')]={'phone':{'type':Sequelize[_0x91ad('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x91ad('0x4')],'unique':_0x91ad('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x91ad('0x5')},'VoiceQueueId':{'type':Sequelize[_0x91ad('0x4')],'unique':_0x91ad('0x5')}};
\ No newline at end of file
+var _0xb41d=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x5653df,_0x41f1ef){var _0x51f7b4=function(_0x27c4f5){while(--_0x27c4f5){_0x5653df['push'](_0x5653df['shift']());}};_0x51f7b4(++_0x41f1ef);}(_0xb41d,0xb8));var _0xdb41=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xb41d[_0x54d4a8];return _0x3b321b;};'use strict';var moment=require('moment');var Sequelize=require(_0xdb41('0x0'));module[_0xdb41('0x1')]={'phone':{'type':Sequelize[_0xdb41('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xdb41('0x3')],'unique':_0xdb41('0x4')},'ListId':{'type':Sequelize[_0xdb41('0x3')],'unique':_0xdb41('0x4')},'VoiceQueueId':{'type':Sequelize[_0xdb41('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
index ba3f999..ddbf61c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebca=['bluebird','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','merge','options','includeAll','include','CmHopperBlack','rows','show','params','keys','catch','find','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xebca,0x1f4));var _0xaebc=function(_0x38767a,_0x530907){_0x38767a=_0x38767a-0x0;var _0x377de8=_0xebca[_0x38767a];return _0x377de8;};'use strict';var emlformat=require(_0xaebc('0x0'));var rimraf=require(_0xaebc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaebc('0x2'));var rp=require('request-promise');var moment=require(_0xaebc('0x3'));var BPromise=require(_0xaebc('0x4'));var Mustache=require('mustache');var util=require(_0xaebc('0x5'));var path=require('path');var sox=require(_0xaebc('0x6'));var csv=require('to-csv');var ejs=require(_0xaebc('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaebc('0x8'));var squel=require(_0xaebc('0x9'));var crypto=require('crypto');var jsforce=require(_0xaebc('0xa'));var deskjs=require(_0xaebc('0xb'));var toCsv=require(_0xaebc('0xc'));var querystring=require(_0xaebc('0xd'));var Papa=require(_0xaebc('0xe'));var Redis=require(_0xaebc('0xf'));var authService=require(_0xaebc('0x10'));var qs=require(_0xaebc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaebc('0x12'));var logger=require(_0xaebc('0x13'))(_0xaebc('0x14'));var utils=require(_0xaebc('0x15'));var config=require(_0xaebc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xaebc('0x17'))['db'];function respondWithStatusCode(_0x383387,_0x45db64){_0x45db64=_0x45db64||0xcc;return function(_0x13ea27){if(_0x13ea27){return _0x383387['sendStatus'](_0x45db64);}return _0x383387['status'](_0x45db64)[_0xaebc('0x18')]();};}function respondWithResult(_0x4be4c8,_0x182952){_0x182952=_0x182952||0xc8;return function(_0x3fb711){if(_0x3fb711){return _0x4be4c8[_0xaebc('0x19')](_0x182952)[_0xaebc('0x1a')](_0x3fb711);}};}function respondWithFilteredResult(_0x2c7385,_0x25dfa0){return function(_0x55f14e){if(_0x55f14e){var _0x54b363=typeof _0x25dfa0[_0xaebc('0x1b')]===_0xaebc('0x1c')&&typeof _0x25dfa0[_0xaebc('0x1d')]===_0xaebc('0x1c');var _0x7a294=_0x55f14e[_0xaebc('0x1e')];var _0xd85838=_0x54b363?0x0:_0x25dfa0[_0xaebc('0x1b')];var _0x5a5d0b=_0x54b363?_0x55f14e[_0xaebc('0x1e')]:_0x25dfa0[_0xaebc('0x1b')]+_0x25dfa0['limit'];var _0x4af62d;if(_0x5a5d0b>=_0x7a294){_0x5a5d0b=_0x7a294;_0x4af62d=0xc8;}else{_0x4af62d=0xce;}_0x2c7385[_0xaebc('0x19')](_0x4af62d);return _0x2c7385[_0xaebc('0x1f')](_0xaebc('0x20'),_0xd85838+'-'+_0x5a5d0b+'/'+_0x7a294)[_0xaebc('0x1a')](_0x55f14e);}return null;};}function patchUpdates(_0x5a92e0){return function(_0x369cf2){try{jsonpatch[_0xaebc('0x21')](_0x369cf2,_0x5a92e0,!![]);}catch(_0x56358a){return BPromise[_0xaebc('0x22')](_0x56358a);}return _0x369cf2[_0xaebc('0x23')]();};}function saveUpdates(_0x1ac144,_0x597375){return function(_0x29a995){if(_0x29a995){return _0x29a995[_0xaebc('0x24')](_0x1ac144)['then'](function(_0xde3977){return _0xde3977;});}return null;};}function removeEntity(_0x49666a,_0x2b402b){return function(_0x272476){if(_0x272476){return _0x272476['destroy']()[_0xaebc('0x25')](function(){_0x49666a[_0xaebc('0x19')](0xcc)[_0xaebc('0x18')]();});}};}function handleEntityNotFound(_0x4cc6b5,_0x32e748){return function(_0x1a1873){if(!_0x1a1873){_0x4cc6b5[_0xaebc('0x26')](0x194);}return _0x1a1873;};}function handleError(_0x4fe4f5,_0x1f3e97){_0x1f3e97=_0x1f3e97||0x1f4;return function(_0x19467c){logger[_0xaebc('0x27')](_0x19467c[_0xaebc('0x28')]);if(_0x19467c['name']){delete _0x19467c[_0xaebc('0x29')];}_0x4fe4f5[_0xaebc('0x19')](_0x1f3e97)['send'](_0x19467c);};}exports[_0xaebc('0x2a')]=function(_0x6a75bb,_0x5dee5a){var _0x59a50a={},_0x2874f7={},_0x50079c={'count':0x0,'rows':[]};var _0x30e699=_[_0xaebc('0x2b')](db['CmHopperBlack'][_0xaebc('0x2c')],function(_0x8f74d4){return{'name':_0x8f74d4[_0xaebc('0x2d')],'type':_0x8f74d4[_0xaebc('0x2e')]['key']};});_0x2874f7[_0xaebc('0x2f')]=_[_0xaebc('0x2b')](_0x30e699,'name');_0x2874f7[_0xaebc('0x30')]=_['keys'](_0x6a75bb[_0xaebc('0x30')]);_0x2874f7['filters']=_[_0xaebc('0x31')](_0x2874f7[_0xaebc('0x2f')],_0x2874f7[_0xaebc('0x30')]);_0x59a50a[_0xaebc('0x32')]=_[_0xaebc('0x31')](_0x2874f7[_0xaebc('0x2f')],qs['fields'](_0x6a75bb['query'][_0xaebc('0x33')]));_0x59a50a[_0xaebc('0x32')]=_0x59a50a[_0xaebc('0x32')][_0xaebc('0x34')]?_0x59a50a[_0xaebc('0x32')]:_0x2874f7[_0xaebc('0x2f')];if(!_0x6a75bb[_0xaebc('0x30')]['hasOwnProperty'](_0xaebc('0x35'))){_0x59a50a['limit']=qs[_0xaebc('0x1d')](_0x6a75bb['query'][_0xaebc('0x1d')]);_0x59a50a['offset']=qs[_0xaebc('0x1b')](_0x6a75bb['query'][_0xaebc('0x1b')]);}_0x59a50a['order']=qs[_0xaebc('0x36')](_0x6a75bb[_0xaebc('0x30')][_0xaebc('0x36')]);_0x59a50a[_0xaebc('0x37')]=qs[_0xaebc('0x38')](_[_0xaebc('0x39')](_0x6a75bb[_0xaebc('0x30')],_0x2874f7[_0xaebc('0x38')]),_0x30e699);if(_0x6a75bb['query']['filter']){_0x59a50a['where']=_[_0xaebc('0x3a')](_0x59a50a['where'],{'$or':_['map'](_0x30e699,function(_0x55b244){if(_0x55b244[_0xaebc('0x2e')]!=='VIRTUAL'){var _0x3d4686={};_0x3d4686[_0x55b244[_0xaebc('0x29')]]={'$like':'%'+_0x6a75bb['query']['filter']+'%'};return _0x3d4686;}})});}_0x59a50a=_[_0xaebc('0x3a')]({},_0x59a50a,_0x6a75bb[_0xaebc('0x3b')]);var _0x2f2d8f={'where':_0x59a50a[_0xaebc('0x37')]};return db['CmHopperBlack'][_0xaebc('0x1e')](_0x2f2d8f)['then'](function(_0x372bbd){_0x50079c[_0xaebc('0x1e')]=_0x372bbd;if(_0x6a75bb[_0xaebc('0x30')][_0xaebc('0x3c')]){_0x59a50a[_0xaebc('0x3d')]=[{'all':!![]}];}return db[_0xaebc('0x3e')]['findAll'](_0x59a50a);})[_0xaebc('0x25')](function(_0x4c416c){_0x50079c[_0xaebc('0x3f')]=_0x4c416c;return _0x50079c;})[_0xaebc('0x25')](respondWithFilteredResult(_0x5dee5a,_0x59a50a))['catch'](handleError(_0x5dee5a,null));};exports[_0xaebc('0x40')]=function(_0x48fe1b,_0x2b66da){var _0x2bd94f={'raw':!![],'where':{'id':_0x48fe1b[_0xaebc('0x41')]['id']}},_0x56c174={};_0x56c174['model']=_[_0xaebc('0x42')](db[_0xaebc('0x3e')][_0xaebc('0x2c')]);_0x56c174[_0xaebc('0x30')]=_['keys'](_0x48fe1b['query']);_0x56c174[_0xaebc('0x38')]=_[_0xaebc('0x31')](_0x56c174['model'],_0x56c174[_0xaebc('0x30')]);_0x2bd94f[_0xaebc('0x32')]=_[_0xaebc('0x31')](_0x56c174[_0xaebc('0x2f')],qs[_0xaebc('0x33')](_0x48fe1b[_0xaebc('0x30')][_0xaebc('0x33')]));_0x2bd94f[_0xaebc('0x32')]=_0x2bd94f[_0xaebc('0x32')][_0xaebc('0x34')]?_0x2bd94f[_0xaebc('0x32')]:_0x56c174[_0xaebc('0x2f')];if(_0x48fe1b[_0xaebc('0x30')][_0xaebc('0x3c')]){_0x2bd94f[_0xaebc('0x3d')]=[{'all':!![]}];}_0x2bd94f=_[_0xaebc('0x3a')]({},_0x2bd94f,_0x48fe1b['options']);return db[_0xaebc('0x3e')]['find'](_0x2bd94f)['then'](handleEntityNotFound(_0x2b66da,null))[_0xaebc('0x25')](respondWithResult(_0x2b66da,null))[_0xaebc('0x43')](handleError(_0x2b66da,null));};exports[_0xaebc('0x24')]=function(_0x5c45f5,_0x551a18){if(_0x5c45f5['body']['id']){delete _0x5c45f5['body']['id'];}return db['CmHopperBlack'][_0xaebc('0x44')]({'where':{'id':_0x5c45f5[_0xaebc('0x41')]['id']}})[_0xaebc('0x25')](handleEntityNotFound(_0x551a18,null))[_0xaebc('0x25')](saveUpdates(_0x5c45f5[_0xaebc('0x45')],null))[_0xaebc('0x25')](respondWithResult(_0x551a18,null))[_0xaebc('0x43')](handleError(_0x551a18,null));};exports[_0xaebc('0x46')]=function(_0x59427f,_0x448c4e){return db[_0xaebc('0x3e')][_0xaebc('0x44')]({'where':{'id':_0x59427f[_0xaebc('0x41')]['id']}})[_0xaebc('0x25')](handleEntityNotFound(_0x448c4e,null))[_0xaebc('0x25')](removeEntity(_0x448c4e,null))[_0xaebc('0x43')](handleError(_0x448c4e,null));};exports[_0xaebc('0x47')]=function(_0x5a36e8,_0x165959){return db[_0xaebc('0x3e')][_0xaebc('0x47')]()['then'](respondWithResult(_0x165959,null))[_0xaebc('0x43')](handleError(_0x165959,null));};
\ No newline at end of file
+var _0xd509=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','find','body','params','describe','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x8b0ec4,_0xd05d5b){var _0x2f31d6=function(_0x4dd8bb){while(--_0x4dd8bb){_0x8b0ec4['push'](_0x8b0ec4['shift']());}};_0x2f31d6(++_0xd05d5b);}(_0xd509,0xc9));var _0x9d50=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd509[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9d50('0x0'));var jsonpatch=require(_0x9d50('0x1'));var rp=require(_0x9d50('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9d50('0x3'));var util=require(_0x9d50('0x4'));var path=require('path');var sox=require(_0x9d50('0x5'));var csv=require(_0x9d50('0x6'));var ejs=require(_0x9d50('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d50('0x8'));var squel=require('squel');var crypto=require(_0x9d50('0x9'));var jsforce=require(_0x9d50('0xa'));var deskjs=require(_0x9d50('0xb'));var toCsv=require(_0x9d50('0x6'));var querystring=require(_0x9d50('0xc'));var Papa=require('papaparse');var Redis=require(_0x9d50('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9d50('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d50('0xf'))(_0x9d50('0x10'));var utils=require(_0x9d50('0x11'));var config=require(_0x9d50('0x12'));var licenseUtil=require(_0x9d50('0x13'));var db=require(_0x9d50('0x14'))['db'];function respondWithStatusCode(_0x3bc884,_0x5c1d1b){_0x5c1d1b=_0x5c1d1b||0xcc;return function(_0x1eb11e){if(_0x1eb11e){return _0x3bc884['sendStatus'](_0x5c1d1b);}return _0x3bc884[_0x9d50('0x15')](_0x5c1d1b)[_0x9d50('0x16')]();};}function respondWithResult(_0x1fcdd7,_0x2fd96b){_0x2fd96b=_0x2fd96b||0xc8;return function(_0x36a82d){if(_0x36a82d){return _0x1fcdd7[_0x9d50('0x15')](_0x2fd96b)[_0x9d50('0x17')](_0x36a82d);}};}function respondWithFilteredResult(_0x3c115b,_0x25f253){return function(_0x304b42){if(_0x304b42){var _0x38d651=typeof _0x25f253[_0x9d50('0x18')]==='undefined'&&typeof _0x25f253[_0x9d50('0x19')]===_0x9d50('0x1a');var _0xa326fa=_0x304b42[_0x9d50('0x1b')];var _0x9c4cbd=_0x38d651?0x0:_0x25f253[_0x9d50('0x18')];var _0x437462=_0x38d651?_0x304b42[_0x9d50('0x1b')]:_0x25f253[_0x9d50('0x18')]+_0x25f253[_0x9d50('0x19')];var _0x2965a3;if(_0x437462>=_0xa326fa){_0x437462=_0xa326fa;_0x2965a3=0xc8;}else{_0x2965a3=0xce;}_0x3c115b[_0x9d50('0x15')](_0x2965a3);return _0x3c115b[_0x9d50('0x1c')](_0x9d50('0x1d'),_0x9c4cbd+'-'+_0x437462+'/'+_0xa326fa)[_0x9d50('0x17')](_0x304b42);}return null;};}function patchUpdates(_0x8905d3){return function(_0xdedc47){try{jsonpatch[_0x9d50('0x1e')](_0xdedc47,_0x8905d3,!![]);}catch(_0x40026b){return BPromise[_0x9d50('0x1f')](_0x40026b);}return _0xdedc47[_0x9d50('0x20')]();};}function saveUpdates(_0xfcb55e,_0x3febd6){return function(_0x4a2080){if(_0x4a2080){return _0x4a2080[_0x9d50('0x21')](_0xfcb55e)[_0x9d50('0x22')](function(_0x2a50f7){return _0x2a50f7;});}return null;};}function removeEntity(_0x1adf7d,_0x12ae02){return function(_0x257738){if(_0x257738){return _0x257738[_0x9d50('0x23')]()[_0x9d50('0x22')](function(){_0x1adf7d[_0x9d50('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cf61b,_0x4e0517){return function(_0x5c58e0){if(!_0x5c58e0){_0x2cf61b[_0x9d50('0x24')](0x194);}return _0x5c58e0;};}function handleError(_0xe121d2,_0x31420b){_0x31420b=_0x31420b||0x1f4;return function(_0x210a1b){logger['error'](_0x210a1b[_0x9d50('0x25')]);if(_0x210a1b[_0x9d50('0x26')]){delete _0x210a1b['name'];}_0xe121d2[_0x9d50('0x15')](_0x31420b)['send'](_0x210a1b);};}exports[_0x9d50('0x27')]=function(_0x460420,_0x40f8bd){var _0x5b3642={},_0x3bd762={},_0x515252={'count':0x0,'rows':[]};var _0x1d5a64=_[_0x9d50('0x28')](db[_0x9d50('0x29')][_0x9d50('0x2a')],function(_0x282493){return{'name':_0x282493[_0x9d50('0x2b')],'type':_0x282493[_0x9d50('0x2c')][_0x9d50('0x2d')]};});_0x3bd762[_0x9d50('0x2e')]=_['map'](_0x1d5a64,_0x9d50('0x26'));_0x3bd762['query']=_['keys'](_0x460420[_0x9d50('0x2f')]);_0x3bd762[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x3bd762['model'],_0x3bd762[_0x9d50('0x2f')]);_0x5b3642[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x3bd762[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5b3642[_0x9d50('0x32')]=_0x5b3642[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5b3642[_0x9d50('0x32')]:_0x3bd762[_0x9d50('0x2e')];if(!_0x460420[_0x9d50('0x2f')][_0x9d50('0x35')](_0x9d50('0x36'))){_0x5b3642['limit']=qs[_0x9d50('0x19')](_0x460420['query'][_0x9d50('0x19')]);_0x5b3642['offset']=qs[_0x9d50('0x18')](_0x460420[_0x9d50('0x2f')][_0x9d50('0x18')]);}_0x5b3642[_0x9d50('0x37')]=qs[_0x9d50('0x38')](_0x460420['query'][_0x9d50('0x38')]);_0x5b3642[_0x9d50('0x39')]=qs[_0x9d50('0x30')](_[_0x9d50('0x3a')](_0x460420[_0x9d50('0x2f')],_0x3bd762[_0x9d50('0x30')]),_0x1d5a64);if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3b')]){_0x5b3642['where']=_[_0x9d50('0x3c')](_0x5b3642['where'],{'$or':_[_0x9d50('0x28')](_0x1d5a64,function(_0x5c32fb){if(_0x5c32fb[_0x9d50('0x2c')]!==_0x9d50('0x3d')){var _0x2d1b20={};_0x2d1b20[_0x5c32fb[_0x9d50('0x26')]]={'$like':'%'+_0x460420['query']['filter']+'%'};return _0x2d1b20;}})});}_0x5b3642=_[_0x9d50('0x3c')]({},_0x5b3642,_0x460420[_0x9d50('0x3e')]);var _0x365700={'where':_0x5b3642[_0x9d50('0x39')]};return db[_0x9d50('0x29')][_0x9d50('0x1b')](_0x365700)[_0x9d50('0x22')](function(_0x2a7aa6){_0x515252[_0x9d50('0x1b')]=_0x2a7aa6;if(_0x460420[_0x9d50('0x2f')][_0x9d50('0x3f')]){_0x5b3642['include']=[{'all':!![]}];}return db[_0x9d50('0x29')][_0x9d50('0x40')](_0x5b3642);})['then'](function(_0x14e4a7){_0x515252[_0x9d50('0x41')]=_0x14e4a7;return _0x515252;})[_0x9d50('0x22')](respondWithFilteredResult(_0x40f8bd,_0x5b3642))[_0x9d50('0x42')](handleError(_0x40f8bd,null));};exports[_0x9d50('0x43')]=function(_0x1bfaeb,_0x3bea37){var _0x5340b2={'raw':!![],'where':{'id':_0x1bfaeb['params']['id']}},_0x47d09f={};_0x47d09f[_0x9d50('0x2e')]=_[_0x9d50('0x44')](db[_0x9d50('0x29')][_0x9d50('0x2a')]);_0x47d09f[_0x9d50('0x2f')]=_['keys'](_0x1bfaeb['query']);_0x47d09f[_0x9d50('0x30')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],_0x47d09f[_0x9d50('0x2f')]);_0x5340b2[_0x9d50('0x32')]=_[_0x9d50('0x31')](_0x47d09f[_0x9d50('0x2e')],qs[_0x9d50('0x33')](_0x1bfaeb[_0x9d50('0x2f')][_0x9d50('0x33')]));_0x5340b2['attributes']=_0x5340b2[_0x9d50('0x32')][_0x9d50('0x34')]?_0x5340b2[_0x9d50('0x32')]:_0x47d09f[_0x9d50('0x2e')];if(_0x1bfaeb[_0x9d50('0x2f')]['includeAll']){_0x5340b2['include']=[{'all':!![]}];}_0x5340b2=_[_0x9d50('0x3c')]({},_0x5340b2,_0x1bfaeb[_0x9d50('0x3e')]);return db[_0x9d50('0x29')][_0x9d50('0x45')](_0x5340b2)[_0x9d50('0x22')](handleEntityNotFound(_0x3bea37,null))['then'](respondWithResult(_0x3bea37,null))[_0x9d50('0x42')](handleError(_0x3bea37,null));};exports[_0x9d50('0x21')]=function(_0x4ed8dd,_0xe98a58){if(_0x4ed8dd[_0x9d50('0x46')]['id']){delete _0x4ed8dd['body']['id'];}return db['CmHopperBlack'][_0x9d50('0x45')]({'where':{'id':_0x4ed8dd[_0x9d50('0x47')]['id']}})[_0x9d50('0x22')](handleEntityNotFound(_0xe98a58,null))[_0x9d50('0x22')](saveUpdates(_0x4ed8dd['body'],null))['then'](respondWithResult(_0xe98a58,null))[_0x9d50('0x42')](handleError(_0xe98a58,null));};exports['destroy']=function(_0x479c6f,_0x1ce58f){return db[_0x9d50('0x29')]['find']({'where':{'id':_0x479c6f['params']['id']}})[_0x9d50('0x22')](handleEntityNotFound(_0x1ce58f,null))[_0x9d50('0x22')](removeEntity(_0x1ce58f,null))[_0x9d50('0x42')](handleError(_0x1ce58f,null));};exports['describe']=function(_0x15131a,_0xeebdf4){return db['CmHopperBlack'][_0x9d50('0x48')]()['then'](respondWithResult(_0xeebdf4,null))[_0x9d50('0x42')](handleError(_0xeebdf4,null));};
\ No newline at end of file
index b1ccb69..10ca334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1978=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','../../config/logger','api','bluebird','request-promise'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x1978,0x15b));var _0x8197=function(_0xc7e96d,_0x25b488){_0xc7e96d=_0xc7e96d-0x0;var _0x2c5ae6=_0x1978[_0xc7e96d];return _0x2c5ae6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8197('0x0'))(_0x8197('0x1'));var moment=require('moment');var BPromise=require(_0x8197('0x2'));var rp=require(_0x8197('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8197('0x4'));module[_0x8197('0x5')]=function(_0x153d82,_0x1d716b){return _0x153d82[_0x8197('0x6')](_0x8197('0x7'),attributes,{'tableName':_0x8197('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb17d=['request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','bluebird'];(function(_0x2ed919,_0x48314b){var _0x574174=function(_0x271045){while(--_0x271045){_0x2ed919['push'](_0x2ed919['shift']());}};_0x574174(++_0x48314b);}(_0xb17d,0xb1));var _0xdb17=function(_0x28c25d,_0x44ae3c){_0x28c25d=_0x28c25d-0x0;var _0x10bec0=_0xb17d[_0x28c25d];return _0x10bec0;};'use strict';var _=require(_0xdb17('0x0'));var util=require(_0xdb17('0x1'));var logger=require(_0xdb17('0x2'))(_0xdb17('0x3'));var moment=require('moment');var BPromise=require(_0xdb17('0x4'));var rp=require(_0xdb17('0x5'));var fs=require('fs');var path=require(_0xdb17('0x6'));var rimraf=require(_0xdb17('0x7'));var config=require('../../config/environment');var attributes=require(_0xdb17('0x8'));module[_0xdb17('0x9')]=function(_0x43b0a7,_0x5de5ac){return _0x43b0a7[_0xdb17('0xa')](_0xdb17('0xb'),attributes,{'tableName':_0xdb17('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b8c29a4..d0a77a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b13=['info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','findAll','options','where','attributes','include','model','map','then','update','body','raw','limit','UpdateCmHopperBlack','DestroyCmHopperBlack','CmHopperBlack','destroy','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x129da9,_0x2b464a){var _0x43caaf=function(_0x28741a){while(--_0x28741a){_0x129da9['push'](_0x129da9['shift']());}};_0x43caaf(++_0x2b464a);}(_0x5b13,0x8b));var _0x35b1=function(_0x190661,_0x2f9b5e){_0x190661=_0x190661-0x0;var _0x1e0c23=_0x5b13[_0x190661];return _0x1e0c23;};'use strict';var _=require('lodash');var util=require(_0x35b1('0x0'));var moment=require('moment');var BPromise=require(_0x35b1('0x1'));var rs=require(_0x35b1('0x2'));var fs=require('fs');var Redis=require(_0x35b1('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35b1('0x4'))('rpc');var config=require(_0x35b1('0x5'));var jayson=require(_0x35b1('0x6'));var client=jayson[_0x35b1('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa570ba,_0x78e72d,_0x4beb51){return new BPromise(function(_0x6207c9,_0x936000){return client[_0x35b1('0x8')](_0xa570ba,_0x4beb51)['then'](function(_0x17fd44){logger[_0x35b1('0x9')](_0x35b1('0xa'),_0x78e72d,_0x35b1('0xb'));logger[_0x35b1('0xc')](_0x35b1('0xd'),_0x78e72d,'request\x20sent',JSON[_0x35b1('0xe')](_0x17fd44));if(_0x17fd44[_0x35b1('0xf')]){if(_0x17fd44[_0x35b1('0xf')][_0x35b1('0x10')]===0x1f4){logger['error'](_0x35b1('0xa'),_0x78e72d,_0x17fd44['error'][_0x35b1('0x11')]);return _0x936000(_0x17fd44[_0x35b1('0xf')]['message']);}logger['error'](_0x35b1('0xa'),_0x78e72d,_0x17fd44[_0x35b1('0xf')]['message']);return _0x6207c9(_0x17fd44['error'][_0x35b1('0x11')]);}else{logger[_0x35b1('0x9')](_0x35b1('0xa'),_0x78e72d,'request\x20sent');_0x6207c9(_0x17fd44[_0x35b1('0x12')][_0x35b1('0x11')]);}})[_0x35b1('0x13')](function(_0xe7eeee){logger[_0x35b1('0xf')](_0x35b1('0xa'),_0x78e72d,_0xe7eeee);_0x936000(_0xe7eeee);});});}exports[_0x35b1('0x14')]=function(_0x1371cc){var _0x4555e9=this;return new Promise(function(_0x3bb098,_0x23c94f){return db['CmHopperBlack'][_0x35b1('0x15')]({'raw':_0x1371cc[_0x35b1('0x16')]?_0x1371cc['options']['raw']===undefined?!![]:![]:!![],'where':_0x1371cc[_0x35b1('0x16')]?_0x1371cc['options'][_0x35b1('0x17')]||null:null,'attributes':_0x1371cc['options']?_0x1371cc[_0x35b1('0x16')][_0x35b1('0x18')]||null:null,'limit':_0x1371cc['options']?_0x1371cc[_0x35b1('0x16')]['limit']||null:null,'include':_0x1371cc['options']?_0x1371cc[_0x35b1('0x16')][_0x35b1('0x19')]?_['map'](_0x1371cc[_0x35b1('0x16')]['include'],function(_0x17df9f){return{'model':db[_0x17df9f[_0x35b1('0x1a')]],'as':_0x17df9f['as'],'attributes':_0x17df9f['attributes'],'include':_0x17df9f[_0x35b1('0x19')]?_[_0x35b1('0x1b')](_0x17df9f[_0x35b1('0x19')],function(_0x40fc6c){return{'model':db[_0x40fc6c[_0x35b1('0x1a')]],'as':_0x40fc6c['as'],'attributes':_0x40fc6c[_0x35b1('0x18')],'include':_0x40fc6c[_0x35b1('0x19')]?_[_0x35b1('0x1b')](_0x40fc6c['include'],function(_0x13194b){return{'model':db[_0x13194b['model']],'as':_0x13194b['as'],'attributes':_0x13194b[_0x35b1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x35b1('0x1c')](function(_0x34a677){logger[_0x35b1('0x9')](_0x35b1('0x14'),_0x1371cc);logger[_0x35b1('0xc')](_0x35b1('0x14'),_0x1371cc,JSON[_0x35b1('0xe')](_0x34a677));_0x3bb098(_0x34a677);})['catch'](function(_0x237519){logger[_0x35b1('0xf')](_0x35b1('0x14'),_0x237519[_0x35b1('0x11')],_0x1371cc);_0x23c94f(_0x4555e9[_0x35b1('0xf')](0x1f4,_0x237519['message']));});});};exports['UpdateCmHopperBlack']=function(_0x17a945){var _0x36f1c8=this;return new Promise(function(_0x4a9885,_0x4ba785){return db['CmHopperBlack'][_0x35b1('0x1d')](_0x17a945[_0x35b1('0x1e')],{'raw':_0x17a945['options']?_0x17a945['options'][_0x35b1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17a945[_0x35b1('0x16')]?_0x17a945['options'][_0x35b1('0x17')]||null:null,'attributes':_0x17a945['options']?_0x17a945[_0x35b1('0x16')][_0x35b1('0x18')]||null:null,'limit':_0x17a945[_0x35b1('0x16')]?_0x17a945[_0x35b1('0x16')][_0x35b1('0x20')]||null:null})['then'](function(_0x259649){logger['info']('UpdateCmHopperBlack',_0x17a945);logger[_0x35b1('0xc')](_0x35b1('0x21'),_0x17a945,JSON[_0x35b1('0xe')](_0x259649));_0x4a9885(_0x259649);})[_0x35b1('0x13')](function(_0x50a4a5){logger[_0x35b1('0xf')](_0x35b1('0x21'),_0x50a4a5[_0x35b1('0x11')],_0x17a945);_0x4ba785(_0x36f1c8['error'](0x1f4,_0x50a4a5[_0x35b1('0x11')]));});});};exports[_0x35b1('0x22')]=function(_0x276544){var _0x328944=this;return new Promise(function(_0x3143e3,_0x451a37){return db[_0x35b1('0x23')][_0x35b1('0x24')]({'where':_0x276544[_0x35b1('0x16')]?_0x276544[_0x35b1('0x16')][_0x35b1('0x17')]||null:null})[_0x35b1('0x1c')](function(_0x215e88){logger[_0x35b1('0x9')]('DestroyCmHopperBlack',_0x276544);logger[_0x35b1('0xc')]('DestroyCmHopperBlack',_0x276544,JSON['stringify'](_0x215e88));_0x3143e3(_0x215e88);})[_0x35b1('0x13')](function(_0x20f7ff){logger[_0x35b1('0xf')]('DestroyCmHopperBlack',_0x20f7ff[_0x35b1('0x11')],_0x276544);_0x451a37(_0x328944[_0x35b1('0xf')](0x1f4,_0x20f7ff[_0x35b1('0x11')]));});});};
\ No newline at end of file
+var _0xafef=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','map','include','model','then','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','util','moment','bluebird'];(function(_0x518467,_0x383a5f){var _0x5a0ee4=function(_0x1af5c6){while(--_0x1af5c6){_0x518467['push'](_0x518467['shift']());}};_0x5a0ee4(++_0x383a5f);}(_0xafef,0x95));var _0xfafe=function(_0x262663,_0x426f86){_0x262663=_0x262663-0x0;var _0x2553a6=_0xafef[_0x262663];return _0x2553a6;};'use strict';var _=require('lodash');var util=require(_0xfafe('0x0'));var moment=require(_0xfafe('0x1'));var BPromise=require(_0xfafe('0x2'));var rs=require(_0xfafe('0x3'));var fs=require('fs');var Redis=require(_0xfafe('0x4'));var db=require(_0xfafe('0x5'))['db'];var utils=require(_0xfafe('0x6'));var logger=require(_0xfafe('0x7'))('rpc');var config=require(_0xfafe('0x8'));var jayson=require(_0xfafe('0x9'));var client=jayson[_0xfafe('0xa')][_0xfafe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43a4e6,_0x4140db,_0x5223b0){return new BPromise(function(_0x28d878,_0x4b222e){return client[_0xfafe('0xc')](_0x43a4e6,_0x5223b0)['then'](function(_0x1cc50f){logger[_0xfafe('0xd')](_0xfafe('0xe'),_0x4140db,'request\x20sent');logger[_0xfafe('0xf')](_0xfafe('0x10'),_0x4140db,_0xfafe('0x11'),JSON[_0xfafe('0x12')](_0x1cc50f));if(_0x1cc50f[_0xfafe('0x13')]){if(_0x1cc50f['error'][_0xfafe('0x14')]===0x1f4){logger[_0xfafe('0x13')](_0xfafe('0xe'),_0x4140db,_0x1cc50f[_0xfafe('0x13')][_0xfafe('0x15')]);return _0x4b222e(_0x1cc50f[_0xfafe('0x13')]['message']);}logger[_0xfafe('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4140db,_0x1cc50f['error'][_0xfafe('0x15')]);return _0x28d878(_0x1cc50f[_0xfafe('0x13')]['message']);}else{logger[_0xfafe('0xd')](_0xfafe('0xe'),_0x4140db,'request\x20sent');_0x28d878(_0x1cc50f['result'][_0xfafe('0x15')]);}})[_0xfafe('0x16')](function(_0x10555f){logger[_0xfafe('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x4140db,_0x10555f);_0x4b222e(_0x10555f);});});}exports[_0xfafe('0x17')]=function(_0x4c899b){var _0x25414a=this;return new Promise(function(_0x590d85,_0x206bc8){return db[_0xfafe('0x18')]['findAll']({'raw':_0x4c899b[_0xfafe('0x19')]?_0x4c899b['options'][_0xfafe('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c899b['options']?_0x4c899b[_0xfafe('0x19')][_0xfafe('0x1b')]||null:null,'attributes':_0x4c899b[_0xfafe('0x19')]?_0x4c899b[_0xfafe('0x19')][_0xfafe('0x1c')]||null:null,'limit':_0x4c899b[_0xfafe('0x19')]?_0x4c899b['options'][_0xfafe('0x1d')]||null:null,'include':_0x4c899b['options']?_0x4c899b['options']['include']?_[_0xfafe('0x1e')](_0x4c899b['options'][_0xfafe('0x1f')],function(_0x57fdd4){return{'model':db[_0x57fdd4['model']],'as':_0x57fdd4['as'],'attributes':_0x57fdd4[_0xfafe('0x1c')],'include':_0x57fdd4[_0xfafe('0x1f')]?_['map'](_0x57fdd4[_0xfafe('0x1f')],function(_0x5062b6){return{'model':db[_0x5062b6[_0xfafe('0x20')]],'as':_0x5062b6['as'],'attributes':_0x5062b6['attributes'],'include':_0x5062b6[_0xfafe('0x1f')]?_[_0xfafe('0x1e')](_0x5062b6[_0xfafe('0x1f')],function(_0x1dceb5){return{'model':db[_0x1dceb5['model']],'as':_0x1dceb5['as'],'attributes':_0x1dceb5['attributes']};}):[]};}):[]};}):[]:[]})[_0xfafe('0x21')](function(_0x5a4470){logger[_0xfafe('0xd')](_0xfafe('0x17'),_0x4c899b);logger[_0xfafe('0xf')](_0xfafe('0x17'),_0x4c899b,JSON[_0xfafe('0x12')](_0x5a4470));_0x590d85(_0x5a4470);})['catch'](function(_0x36aeb6){logger[_0xfafe('0x13')](_0xfafe('0x17'),_0x36aeb6[_0xfafe('0x15')],_0x4c899b);_0x206bc8(_0x25414a[_0xfafe('0x13')](0x1f4,_0x36aeb6[_0xfafe('0x15')]));});});};exports[_0xfafe('0x22')]=function(_0x212ef5){var _0x87c858=this;return new Promise(function(_0x2cb2da,_0x56963b){return db['CmHopperBlack'][_0xfafe('0x23')](_0x212ef5['body'],{'raw':_0x212ef5[_0xfafe('0x19')]?_0x212ef5['options'][_0xfafe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212ef5[_0xfafe('0x19')]?_0x212ef5['options'][_0xfafe('0x1b')]||null:null,'attributes':_0x212ef5['options']?_0x212ef5[_0xfafe('0x19')][_0xfafe('0x1c')]||null:null,'limit':_0x212ef5[_0xfafe('0x19')]?_0x212ef5[_0xfafe('0x19')]['limit']||null:null})['then'](function(_0x46f54a){logger[_0xfafe('0xd')](_0xfafe('0x22'),_0x212ef5);logger[_0xfafe('0xf')](_0xfafe('0x22'),_0x212ef5,JSON[_0xfafe('0x12')](_0x46f54a));_0x2cb2da(_0x46f54a);})[_0xfafe('0x16')](function(_0x42e902){logger[_0xfafe('0x13')](_0xfafe('0x22'),_0x42e902[_0xfafe('0x15')],_0x212ef5);_0x56963b(_0x87c858[_0xfafe('0x13')](0x1f4,_0x42e902['message']));});});};exports[_0xfafe('0x24')]=function(_0x52ac20){var _0x59c2a6=this;return new Promise(function(_0x18f633,_0x52feff){return db[_0xfafe('0x18')][_0xfafe('0x25')]({'where':_0x52ac20[_0xfafe('0x19')]?_0x52ac20[_0xfafe('0x19')][_0xfafe('0x1b')]||null:null})[_0xfafe('0x21')](function(_0x43307a){logger[_0xfafe('0xd')](_0xfafe('0x24'),_0x52ac20);logger[_0xfafe('0xf')](_0xfafe('0x24'),_0x52ac20,JSON['stringify'](_0x43307a));_0x18f633(_0x43307a);})['catch'](function(_0x22a864){logger[_0xfafe('0x13')](_0xfafe('0x24'),_0x22a864[_0xfafe('0x15')],_0x52ac20);_0x52feff(_0x59c2a6[_0xfafe('0x13')](0x1f4,_0x22a864[_0xfafe('0x15')]));});});};
\ No newline at end of file
index f35257e..0123aa2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd6=['path','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','show','/:id','update','delete','destroy','multer','util'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0xffd6,0x97));var _0x6ffd=function(_0x5e6cb8,_0x16cf56){_0x5e6cb8=_0x5e6cb8-0x0;var _0x3faeb3=_0xffd6[_0x5e6cb8];return _0x3faeb3;};'use strict';var multer=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var path=require(_0x6ffd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6ffd('0x3')]();var fs_extra=require(_0x6ffd('0x4'));var auth=require(_0x6ffd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ffd('0x6'));var controller=require(_0x6ffd('0x7'));router[_0x6ffd('0x8')]('/',auth[_0x6ffd('0x9')](),controller['index']);router[_0x6ffd('0x8')](_0x6ffd('0xa'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xb')]);router[_0x6ffd('0x8')]('/:id',auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xc')]);router['put'](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0xe')]);router[_0x6ffd('0xf')](_0x6ffd('0xd'),auth[_0x6ffd('0x9')](),controller[_0x6ffd('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xc2c7=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','/:id','show','update','delete'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0xc2c7,0x134));var _0x7c2c=function(_0x1a432f,_0xe963dd){_0x1a432f=_0x1a432f-0x0;var _0x5224d7=_0xc2c7[_0x1a432f];return _0x5224d7;};'use strict';var multer=require('multer');var util=require(_0x7c2c('0x0'));var path=require(_0x7c2c('0x1'));var timeout=require(_0x7c2c('0x2'));var express=require(_0x7c2c('0x3'));var router=express[_0x7c2c('0x4')]();var fs_extra=require(_0x7c2c('0x5'));var auth=require(_0x7c2c('0x6'));var interaction=require(_0x7c2c('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x7c2c('0x8')]('/',auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7c2c('0xb')]);router[_0x7c2c('0x8')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xd')]);router['put'](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0xe')]);router[_0x7c2c('0xf')](_0x7c2c('0xc'),auth[_0x7c2c('0x9')](),controller[_0x7c2c('0x10')]);module[_0x7c2c('0x11')]=router;
\ No newline at end of file
index 427a207..522f964 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabf7=['STRING','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','DATE'];(function(_0x27d72e,_0x62366c){var _0x31c16d=function(_0x2f974c){while(--_0x2f974c){_0x27d72e['push'](_0x27d72e['shift']());}};_0x31c16d(++_0x62366c);}(_0xabf7,0x1dc));var _0x7abf=function(_0x24e51a,_0x2db38f){_0x24e51a=_0x24e51a-0x0;var _0x4eb61a=_0xabf7[_0x24e51a];return _0x4eb61a;};'use strict';var Sequelize=require(_0x7abf('0x0'));var moment=require(_0x7abf('0x1'));module[_0x7abf('0x2')]={'state':{'type':Sequelize[_0x7abf('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x7abf('0x4')]},'countbusyretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7abf('0x5')]},'originatecalleridnum':{'type':Sequelize[_0x7abf('0x5')]},'originatecalleridname':{'type':Sequelize[_0x7abf('0x5')]},'calleridnum':{'type':Sequelize[_0x7abf('0x5')]},'calleridname':{'type':Sequelize[_0x7abf('0x5')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x7abf('0x4')]},'answertime':{'type':Sequelize[_0x7abf('0x4')]},'droptime':{'type':Sequelize[_0x7abf('0x4')]},'endtime':{'type':Sequelize[_0x7abf('0x4')]},'ringtime':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x7abf('0x5')]},'campaigntype':{'type':Sequelize[_0x7abf('0x5')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x7abf('0x5')]},'disposition':{'type':Sequelize[_0x7abf('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7abf('0x5')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x2e46a5){var _0x4e0f76=this[_0x7abf('0x6')](_0x7abf('0x7'));if(_0x4e0f76&&_0x2e46a5){this[_0x7abf('0x8')](_0x7abf('0x9'),moment(_0x2e46a5)[_0x7abf('0xa')](moment(_0x4e0f76),_0x7abf('0xb')));}}},'amd':{'type':Sequelize[_0x7abf('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7abf('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x7abf('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x7abf('0x4')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7abf('0x4')]},'deleted':{'type':Sequelize[_0x7abf('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x7abf('0x4')]},'recallme':{'type':Sequelize[_0x7abf('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x7abf('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7abf('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x453e=['DATE','getDataValue','followuptime','diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0x453e,0xb6));var _0xe453=function(_0x5d672b,_0x28f0e4){_0x5d672b=_0x5d672b-0x0;var _0x3268fc=_0x453e[_0x5d672b];return _0x3268fc;};'use strict';var Sequelize=require(_0xe453('0x0'));var moment=require(_0xe453('0x1'));module[_0xe453('0x2')]={'state':{'type':Sequelize[_0xe453('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xe453('0x4')]},'calleridnum':{'type':Sequelize[_0xe453('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe453('0x5')]},'answertime':{'type':Sequelize[_0xe453('0x5')]},'droptime':{'type':Sequelize[_0xe453('0x5')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe453('0x4')]},'campaign':{'type':Sequelize[_0xe453('0x4')]},'campaigntype':{'type':Sequelize[_0xe453('0x4')]},'membername':{'type':Sequelize[_0xe453('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xe453('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0xe453('0x5')],'set':function(_0x84cb15){var _0x2e7559=this[_0xe453('0x6')]('endtime');if(_0x2e7559&&_0x84cb15){this['setDataValue'](_0xe453('0x7'),moment(_0x84cb15)[_0xe453('0x8')](moment(_0x2e7559),_0xe453('0x9')));}}},'amd':{'type':Sequelize[_0xe453('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe453('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe453('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xe453('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe453('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xe453('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe453('0x5')]},'recallme':{'type':Sequelize[_0xe453('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe453('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 7d59e34..4b3ba12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x326f,0xd1));var _0xf326=function(_0x5b6485,_0x4d2a8c){_0x5b6485=_0x5b6485-0x0;var _0x3d5e02=_0x326f[_0x5b6485];return _0x3d5e02;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));};
\ No newline at end of file
+var _0xc4aa=['ContactId','ListId','ANY_VALUE(VoiceQueueId)','NOW()','createdAt','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','cm_hopper','VoiceQueueId\x20=\x20?','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','phone','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','describe','uniqueid','find','body','countContactsQueueCampaignHopperFinal','findAll','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','scheduledAt','VoiceQueueId','updatedAt','field','ANY_VALUE(calleridnum)'];(function(_0x17b94e,_0x1b2f59){var _0x14ab53=function(_0x4cdf1f){while(--_0x4cdf1f){_0x17b94e['push'](_0x17b94e['shift']());}};_0x14ab53(++_0x1b2f59);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0xc4aa[_0x346737];return _0x1ade2e;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];function respondWithStatusCode(_0x24291d,_0x5e16aa){_0x5e16aa=_0x5e16aa||0xcc;return function(_0x21a79){if(_0x21a79){return _0x24291d[_0xac4a('0x17')](_0x5e16aa);}return _0x24291d[_0xac4a('0x18')](_0x5e16aa)[_0xac4a('0x19')]();};}function respondWithResult(_0x1b4313,_0x3b71c0){_0x3b71c0=_0x3b71c0||0xc8;return function(_0x34bc01){if(_0x34bc01){return _0x1b4313[_0xac4a('0x18')](_0x3b71c0)[_0xac4a('0x1a')](_0x34bc01);}};}function respondWithFilteredResult(_0x42c7fc,_0x11e101){return function(_0x26dbb8){if(_0x26dbb8){var _0x4a2119=typeof _0x11e101[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x11e101[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x3e88e3=_0x26dbb8[_0xac4a('0x1e')];var _0x28e304=_0x4a2119?0x0:_0x11e101[_0xac4a('0x1b')];var _0x546c5d=_0x4a2119?_0x26dbb8['count']:_0x11e101[_0xac4a('0x1b')]+_0x11e101[_0xac4a('0x1d')];var _0x39b691;if(_0x546c5d>=_0x3e88e3){_0x546c5d=_0x3e88e3;_0x39b691=0xc8;}else{_0x39b691=0xce;}_0x42c7fc['status'](_0x39b691);return _0x42c7fc[_0xac4a('0x1f')](_0xac4a('0x20'),_0x28e304+'-'+_0x546c5d+'/'+_0x3e88e3)[_0xac4a('0x1a')](_0x26dbb8);}return null;};}function patchUpdates(_0x3a3cdb){return function(_0x123694){try{jsonpatch[_0xac4a('0x21')](_0x123694,_0x3a3cdb,!![]);}catch(_0xe38996){return BPromise[_0xac4a('0x22')](_0xe38996);}return _0x123694['save']();};}function saveUpdates(_0x3d8f0a,_0x3204ad){return function(_0x599787){if(_0x599787){return _0x599787[_0xac4a('0x23')](_0x3d8f0a)[_0xac4a('0x24')](function(_0x3eacd3){return _0x3eacd3;});}return null;};}function removeEntity(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(_0x1b7998){return _0x1b7998[_0xac4a('0x25')]()[_0xac4a('0x24')](function(){_0x947d8e[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x2b0dc2,_0x222507){return function(_0x36054a){if(!_0x36054a){_0x2b0dc2[_0xac4a('0x17')](0x194);}return _0x36054a;};}function handleError(_0x3bc318,_0x1d0539){_0x1d0539=_0x1d0539||0x1f4;return function(_0x215a31){logger[_0xac4a('0x26')](_0x215a31[_0xac4a('0x27')]);if(_0x215a31[_0xac4a('0x28')]){delete _0x215a31[_0xac4a('0x28')];}_0x3bc318['status'](_0x1d0539)[_0xac4a('0x29')](_0x215a31);};}exports[_0xac4a('0x2a')]=function(_0x42a33c,_0x2772fe){var _0x116700={},_0x4a5a9e={},_0x47f49c={'count':0x0,'rows':[]};var _0xdb7e=_[_0xac4a('0x2b')](db[_0xac4a('0x2c')]['rawAttributes'],function(_0x4bda1f){return{'name':_0x4bda1f[_0xac4a('0x2d')],'type':_0x4bda1f[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x4a5a9e[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0xdb7e,'name');_0x4a5a9e[_0xac4a('0x31')]=_['keys'](_0x42a33c[_0xac4a('0x31')]);_0x4a5a9e['filters']=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],_0x4a5a9e[_0xac4a('0x31')]);_0x116700[_0xac4a('0x33')]=_[_0xac4a('0x32')](_0x4a5a9e[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x34')]));_0x116700[_0xac4a('0x33')]=_0x116700[_0xac4a('0x33')][_0xac4a('0x35')]?_0x116700[_0xac4a('0x33')]:_0x4a5a9e[_0xac4a('0x30')];if(!_0x42a33c['query'][_0xac4a('0x36')](_0xac4a('0x37'))){_0x116700['limit']=qs[_0xac4a('0x1d')](_0x42a33c[_0xac4a('0x31')]['limit']);_0x116700['offset']=qs[_0xac4a('0x1b')](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x1b')]);}_0x116700[_0xac4a('0x38')]=qs['sort'](_0x42a33c[_0xac4a('0x31')][_0xac4a('0x39')]);_0x116700['where']=qs[_0xac4a('0x3a')](_[_0xac4a('0x3b')](_0x42a33c[_0xac4a('0x31')],_0x4a5a9e['filters']),_0xdb7e);if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x3c')]){_0x116700[_0xac4a('0x3d')]=_['merge'](_0x116700[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2b')](_0xdb7e,function(_0x4b9faf){if(_0x4b9faf['type']!==_0xac4a('0x3e')){var _0x5e0926={};_0x5e0926[_0x4b9faf['name']]={'$like':'%'+_0x42a33c['query']['filter']+'%'};return _0x5e0926;}})});}_0x116700=_[_0xac4a('0x3f')]({},_0x116700,_0x42a33c[_0xac4a('0x40')]);var _0x37834b={'where':_0x116700[_0xac4a('0x3d')]};return db[_0xac4a('0x2c')][_0xac4a('0x1e')](_0x37834b)[_0xac4a('0x24')](function(_0x2b16f0){_0x47f49c[_0xac4a('0x1e')]=_0x2b16f0;if(_0x42a33c[_0xac4a('0x31')][_0xac4a('0x41')]){_0x116700[_0xac4a('0x42')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x116700);})['then'](function(_0x1e1cc5){_0x47f49c[_0xac4a('0x43')]=_0x1e1cc5;return _0x47f49c;})[_0xac4a('0x24')](respondWithFilteredResult(_0x2772fe,_0x116700))[_0xac4a('0x44')](handleError(_0x2772fe,null));};exports[_0xac4a('0x45')]=function(_0x411543,_0x8febf0){var _0x3441f2={'raw':!![],'where':{'id':_0x411543[_0xac4a('0x46')]['id']}},_0x3e9973={};_0x3e9973['model']=_[_0xac4a('0x47')](db[_0xac4a('0x2c')][_0xac4a('0x48')]);_0x3e9973[_0xac4a('0x31')]=_[_0xac4a('0x47')](_0x411543['query']);_0x3e9973[_0xac4a('0x3a')]=_[_0xac4a('0x32')](_0x3e9973['model'],_0x3e9973[_0xac4a('0x31')]);_0x3441f2['attributes']=_[_0xac4a('0x32')](_0x3e9973[_0xac4a('0x30')],qs[_0xac4a('0x34')](_0x411543[_0xac4a('0x31')][_0xac4a('0x34')]));_0x3441f2[_0xac4a('0x33')]=_0x3441f2[_0xac4a('0x33')][_0xac4a('0x35')]?_0x3441f2[_0xac4a('0x33')]:_0x3e9973[_0xac4a('0x30')];if(_0x411543[_0xac4a('0x31')][_0xac4a('0x41')]){_0x3441f2['include']=[{'all':!![]}];}_0x3441f2=_[_0xac4a('0x3f')]({},_0x3441f2,_0x411543[_0xac4a('0x40')]);return db[_0xac4a('0x2c')]['find'](_0x3441f2)[_0xac4a('0x24')](handleEntityNotFound(_0x8febf0,null))[_0xac4a('0x24')](respondWithResult(_0x8febf0,null))['catch'](handleError(_0x8febf0,null));};exports[_0xac4a('0x49')]=function(_0x5a7f6e,_0x244950){return db[_0xac4a('0x2c')][_0xac4a('0x49')]()['then'](respondWithResult(_0x244950,null))['catch'](handleError(_0x244950,null));};exports[_0xac4a('0x23')]=function(_0x4aaeff,_0x18ae96){if(_0x4aaeff['body'][_0xac4a('0x4a')]){delete _0x4aaeff['body'][_0xac4a('0x4a')];}return db[_0xac4a('0x2c')][_0xac4a('0x4b')]({'where':{'uniqueid':_0x4aaeff[_0xac4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x24')](saveUpdates(_0x4aaeff[_0xac4a('0x4c')],null))[_0xac4a('0x24')](respondWithResult(_0x18ae96,null))[_0xac4a('0x44')](handleError(_0x18ae96,null));};exports[_0xac4a('0x4d')]=function(_0x138876,_0x187306,_0x4e6e19){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'VoiceQueueId':_0x138876['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')]('`state`\x20=\x203,\x201,\x20null'))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')]('`state`\x20=\x205,\x201,\x20null'))),_0xac4a('0x55')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db['sequelize']['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db[_0xac4a('0x4f')]['literal'](_0xac4a('0x5e')))),'answeringMachine']]})[_0xac4a('0x24')](handleEntityNotFound(_0x187306,null))['then'](respondWithResult(_0x187306,null))['catch'](handleError(_0x187306,null));};exports[_0xac4a('0x5f')]=function(_0x568ffb,_0x3bcae2,_0x3c2f84){return db[_0xac4a('0x2c')][_0xac4a('0x4e')]({'raw':![],'where':{'CampaignId':_0x568ffb['params']['id']},'attributes':[[db[_0xac4a('0x4f')]['fn']('COUNT',db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x51')))),_0xac4a('0x52')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x60')))),_0xac4a('0x54')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x61')))),_0xac4a('0x55')],[db['sequelize']['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x56')))),_0xac4a('0x57')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db['sequelize']['fn']('IF',db['sequelize'][_0xac4a('0x53')](_0xac4a('0x58')))),_0xac4a('0x59')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5a')))),_0xac4a('0x5b')],[db[_0xac4a('0x4f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5c')))),_0xac4a('0x5d')],[db[_0xac4a('0x4f')]['fn'](_0xac4a('0x50'),db[_0xac4a('0x4f')]['fn']('IF',db[_0xac4a('0x4f')][_0xac4a('0x53')](_0xac4a('0x5e')))),_0xac4a('0x62')]]})[_0xac4a('0x24')](handleEntityNotFound(_0x3bcae2,null))['then'](respondWithResult(_0x3bcae2,null))[_0xac4a('0x44')](handleError(_0x3bcae2,null));};exports[_0xac4a('0x63')]=function(_0x26bd31,_0x231932,_0x513976){return db[_0xac4a('0x64')]['find']({'where':{'id':_0x26bd31[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x231932,null))['then'](function(_0x5bd95b){var _0x17eac2;if(_0x5bd95b){_0x17eac2=squel[_0xac4a('0x65')]()[_0xac4a('0x66')]('cm_hopper')[_0xac4a('0x67')](['phone',_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x69'),'createdAt',_0xac4a('0x6a')],squel['select']()[_0xac4a('0x6b')](_0xac4a('0x6c'),'phone')[_0xac4a('0x6b')]('NOW()',_0xac4a('0x68'))[_0xac4a('0x6b')]('ANY_VALUE(ContactId)',_0xac4a('0x6d'))['field']('ANY_VALUE(ListId)',_0xac4a('0x6e'))['field'](_0xac4a('0x6f'),'VoiceQueueId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')]('NOW()','updatedAt')[_0xac4a('0x72')](_0xac4a('0x73'))['where']('VoiceQueueId\x20=\x20?',_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x75'),_0x26bd31[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))['where'](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')]('phone')[_0xac4a('0x72')](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id']['toString']()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x7b'),_0x26bd31[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x7d')))[_0xac4a('0x7e')]('ContactId'))[_0xac4a('0x74')]();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x17eac2);}return[];})[_0xac4a('0x24')](respondWithResult(_0x231932,null))['catch'](handleError(_0x231932,null));};exports[_0xac4a('0x7f')]=function(_0x56a934,_0x4447b5,_0x22b718){return db['Campaign']['find']({'where':{'id':_0x56a934[_0xac4a('0x46')]['id']}})[_0xac4a('0x24')](handleEntityNotFound(_0x4447b5,null))[_0xac4a('0x24')](function(_0x4bb03d){var _0x1f3f1c;if(_0x4bb03d){_0x1f3f1c=squel['insert']()[_0xac4a('0x66')](_0xac4a('0x7a'))[_0xac4a('0x67')]([_0xac4a('0x80'),_0xac4a('0x68'),'ContactId','ListId',_0xac4a('0x81'),_0xac4a('0x71'),_0xac4a('0x6a')],squel[_0xac4a('0x79')]()[_0xac4a('0x6b')](_0xac4a('0x6c'),_0xac4a('0x80'))[_0xac4a('0x6b')]('NOW()','scheduledAt')[_0xac4a('0x6b')](_0xac4a('0x82'),_0xac4a('0x6d'))[_0xac4a('0x6b')](_0xac4a('0x83'),_0xac4a('0x6e'))[_0xac4a('0x6b')](_0xac4a('0x84'),'CampaignId')['field'](_0xac4a('0x70'),_0xac4a('0x71'))[_0xac4a('0x6b')](_0xac4a('0x70'),_0xac4a('0x6a'))[_0xac4a('0x72')](_0xac4a('0x73'))['where'](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where'](_0xac4a('0x75'),_0x56a934[_0xac4a('0x4c')][_0xac4a('0x76')][_0xac4a('0x74')]())[_0xac4a('0x3d')](_0xac4a('0x77'))[_0xac4a('0x3d')](_0xac4a('0x78'),squel[_0xac4a('0x79')]()['field'](_0xac4a('0x80'))['from'](_0xac4a('0x7a'))[_0xac4a('0x3d')](_0xac4a('0x85'),_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]()))[_0xac4a('0x3d')](_0xac4a('0x78'),squel['select']()[_0xac4a('0x6b')](_0xac4a('0x7c'))[_0xac4a('0x72')](_0xac4a('0x73'))[_0xac4a('0x3d')]('CampaignId\x20=\x20?',_0x56a934[_0xac4a('0x46')]['id'][_0xac4a('0x74')]())['where']('state\x20=\x204'))[_0xac4a('0x7e')](_0xac4a('0x6d')))['toString']();return db[_0xac4a('0x4f')][_0xac4a('0x31')](_0x1f3f1c);}return[];})[_0xac4a('0x24')](respondWithResult(_0x4447b5,null))[_0xac4a('0x44')](handleError(_0x4447b5,null));};exports[_0xac4a('0x86')]=function(_0x34787c,_0x599775,_0xbdff4b){return db[_0xac4a('0x87')][_0xac4a('0x88')]({'where':{'VoiceQueueId':_0x34787c['body'][_0xac4a('0x69')],'CampaignId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x81')],'ContactId':_0x34787c[_0xac4a('0x4c')][_0xac4a('0x6d')]}})[_0xac4a('0x24')](handleEntityNotFound(_0x599775,null))['then'](function(_0xe84bf7){if(_0xe84bf7){return _0xe84bf7;}return null;})[_0xac4a('0x24')](respondWithResult(_0x599775,null))['catch'](handleError(_0x599775,null));};
\ No newline at end of file
index fdecc0b..c974dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33e8=['request-promise','path','rimraf','../../config/environment','CmHopperFinal','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x33e8,0x118));var _0x833e=function(_0x275e89,_0x447de7){_0x275e89=_0x275e89-0x0;var _0x24899f=_0x33e8[_0x275e89];return _0x24899f;};'use strict';var _=require(_0x833e('0x0'));var util=require(_0x833e('0x1'));var logger=require(_0x833e('0x2'))(_0x833e('0x3'));var moment=require(_0x833e('0x4'));var BPromise=require(_0x833e('0x5'));var rp=require(_0x833e('0x6'));var fs=require('fs');var path=require(_0x833e('0x7'));var rimraf=require(_0x833e('0x8'));var config=require(_0x833e('0x9'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x4abd56,_0x2fd0ef){return _0x4abd56['define'](_0x833e('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x833e('0xb'),'fields':[_0x833e('0xb')]},{'name':_0x833e('0xc'),'fields':[_0x833e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0421=['./cmHopperFinal.attributes','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3f3dc8,_0x460241){var _0x1f5a27=function(_0x5e911e){while(--_0x5e911e){_0x3f3dc8['push'](_0x3f3dc8['shift']());}};_0x1f5a27(++_0x460241);}(_0x0421,0xd7));var _0x1042=function(_0x4c2829,_0x4b87ed){_0x4c2829=_0x4c2829-0x0;var _0x4ac67d=_0x0421[_0x4c2829];return _0x4ac67d;};'use strict';var _=require(_0x1042('0x0'));var util=require(_0x1042('0x1'));var logger=require(_0x1042('0x2'))(_0x1042('0x3'));var moment=require(_0x1042('0x4'));var BPromise=require(_0x1042('0x5'));var rp=require(_0x1042('0x6'));var fs=require('fs');var path=require(_0x1042('0x7'));var rimraf=require(_0x1042('0x8'));var config=require(_0x1042('0x9'));var attributes=require(_0x1042('0xa'));module['exports']=function(_0x5a039b,_0x5ac296){return _0x5a039b['define'](_0x1042('0xb'),attributes,{'tableName':_0x1042('0xc'),'paranoid':![],'indexes':[{'name':_0x1042('0xd'),'fields':[_0x1042('0xd')]},{'name':'uniqueid','fields':[_0x1042('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index eb7dcd8..f067630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x31589d,_0x32100c){var _0x4e8424=function(_0x3092ae){while(--_0x3092ae){_0x31589d['push'](_0x31589d['shift']());}};_0x4e8424(++_0x32100c);}(_0xb10b,0x12a));var _0xbb10=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xb10b[_0x5e8c32];return _0x595f7b;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x32df10,_0x427d52){var _0x16dc9a=function(_0x56f838){while(--_0x56f838){_0x32df10['push'](_0x32df10['shift']());}};_0x16dc9a(++_0x427d52);}(_0x7a54,0x106));var _0x47a5=function(_0x2a8b37,_0x14221c){_0x2a8b37=_0x2a8b37-0x0;var _0x422289=_0x7a54[_0x2a8b37];return _0x422289;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index ec3e994..ad761b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d2=['/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','checkContactHopper','update','multer','util','path','express','fs-extra','../../components/auth/service','isAuthenticated','index','get','/describe','describe'];(function(_0xe2f7a3,_0x1b9cb9){var _0x40e99=function(_0x4b819e){while(--_0x4b819e){_0xe2f7a3['push'](_0xe2f7a3['shift']());}};_0x40e99(++_0x1b9cb9);}(_0xd3d2,0x96));var _0x2d3d=function(_0x4baa81,_0x2f0161){_0x4baa81=_0x4baa81-0x0;var _0x115f16=_0xd3d2[_0x4baa81];return _0x115f16;};'use strict';var multer=require(_0x2d3d('0x0'));var util=require(_0x2d3d('0x1'));var path=require(_0x2d3d('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d3d('0x3'));var router=express['Router']();var fs_extra=require(_0x2d3d('0x4'));var auth=require(_0x2d3d('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x7')]);router[_0x2d3d('0x8')](_0x2d3d('0x9'),auth['isAuthenticated'](),controller[_0x2d3d('0xa')]);router[_0x2d3d('0x8')](_0x2d3d('0xb'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0xc')]);router[_0x2d3d('0x8')](_0x2d3d('0xd'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0xe')]);router[_0x2d3d('0x8')](_0x2d3d('0xf'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x10')]);router['post'](_0x2d3d('0x11'),auth['isAuthenticated'](),controller[_0x2d3d('0x12')]);router[_0x2d3d('0x13')](_0x2d3d('0x14'),auth[_0x2d3d('0x6')](),controller['moveContactsIvrCampaignHopperFinal']);router[_0x2d3d('0x13')]('/checkContactHopper',auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x15')]);router['put'](_0x2d3d('0xb'),auth[_0x2d3d('0x6')](),controller[_0x2d3d('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xcabe=['index','get','/describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x462226,_0x533892){var _0x4f2dfd=function(_0x5a5afd){while(--_0x5a5afd){_0x462226['push'](_0x462226['shift']());}};_0x4f2dfd(++_0x533892);}(_0xcabe,0x1ad));var _0xecab=function(_0x7a10b7,_0x5dad1d){_0x7a10b7=_0x7a10b7-0x0;var _0x201152=_0xcabe[_0x7a10b7];return _0x201152;};'use strict';var multer=require('multer');var util=require(_0xecab('0x0'));var path=require(_0xecab('0x1'));var timeout=require('connect-timeout');var express=require(_0xecab('0x2'));var router=express['Router']();var fs_extra=require(_0xecab('0x3'));var auth=require(_0xecab('0x4'));var interaction=require(_0xecab('0x5'));var config=require(_0xecab('0x6'));var controller=require('./cmHopperFinal.controller');router['get']('/',auth[_0xecab('0x7')](),controller[_0xecab('0x8')]);router[_0xecab('0x9')](_0xecab('0xa'),auth[_0xecab('0x7')](),controller['describe']);router[_0xecab('0x9')](_0xecab('0xb'),auth['isAuthenticated'](),controller[_0xecab('0xc')]);router[_0xecab('0x9')](_0xecab('0xd'),auth['isAuthenticated'](),controller[_0xecab('0xe')]);router[_0xecab('0x9')](_0xecab('0xf'),auth['isAuthenticated'](),controller[_0xecab('0x10')]);router[_0xecab('0x11')](_0xecab('0x12'),auth[_0xecab('0x7')](),controller[_0xecab('0x13')]);router[_0xecab('0x11')](_0xecab('0x14'),auth[_0xecab('0x7')](),controller[_0xecab('0x15')]);router[_0xecab('0x11')]('/checkContactHopper',auth['isAuthenticated'](),controller['checkContactHopper']);router['put'](_0xecab('0xb'),auth['isAuthenticated'](),controller['update']);module[_0xecab('0x16')]=router;
\ No newline at end of file
index 95ae0fc..8ca8888 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9365=['exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x43c3ce,_0x48aab0){var _0x360614=function(_0x5c4061){while(--_0x5c4061){_0x43c3ce['push'](_0x43c3ce['shift']());}};_0x360614(++_0x48aab0);}(_0x9365,0x1e5));var _0x5936=function(_0x3b2194,_0x457abd){_0x3b2194=_0x3b2194-0x0;var _0x31ac0e=_0x9365[_0x3b2194];return _0x31ac0e;};'use strict';var Sequelize=require('sequelize');module[_0x5936('0x0')]={'state':{'type':Sequelize[_0x5936('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x5936('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x5936('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x5936('0x2')]},'originatecalleridname':{'type':Sequelize[_0x5936('0x2')]},'calleridnum':{'type':Sequelize[_0x5936('0x2')]},'calleridname':{'type':Sequelize[_0x5936('0x2')]},'starttime':{'type':Sequelize[_0x5936('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x5936('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x5936('0x3')]},'ringtime':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x5936('0x2')]},'campaigntype':{'type':Sequelize[_0x5936('0x2')]},'membername':{'type':Sequelize[_0x5936('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x5936('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5936('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5936('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x5936('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5936('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5936('0x2')]}};
\ No newline at end of file
+var _0xdc37=['sequelize','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0xdc37,0x181));var _0x7dc3=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0xdc37[_0x1cd47d];return _0x29d52f;};'use strict';var Sequelize=require(_0x7dc3('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7dc3('0x1')]},'scheduledat':{'type':Sequelize[_0x7dc3('0x2')]},'countbusyretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7dc3('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x7dc3('0x1')]},'originatecalleridname':{'type':Sequelize[_0x7dc3('0x1')]},'calleridnum':{'type':Sequelize[_0x7dc3('0x1')]},'calleridname':{'type':Sequelize[_0x7dc3('0x1')]},'starttime':{'type':Sequelize[_0x7dc3('0x2')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x7dc3('0x2')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x7dc3('0x2')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x7dc3('0x1')]},'membername':{'type':Sequelize[_0x7dc3('0x1')]},'reason':{'type':Sequelize[_0x7dc3('0x1')]},'amd':{'type':Sequelize[_0x7dc3('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x7dc3('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7dc3('0x2')]},'recallme':{'type':Sequelize[_0x7dc3('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7dc3('0x2')]},'edited':{'type':Sequelize[_0x7dc3('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7dc3('0x3')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7dc3('0x1')]}};
\ No newline at end of file
index c9d7509..97d1c42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a66=['name','index','map','rawAttributes','fieldName','type','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','CmHopperHistory','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','then','destroy','error','stack'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x1a66,0x6d));var _0x61a6=function(_0x53e510,_0x320287){_0x53e510=_0x53e510-0x0;var _0x1ca624=_0x1a66[_0x53e510];return _0x1ca624;};'use strict';var emlformat=require(_0x61a6('0x0'));var rimraf=require(_0x61a6('0x1'));var zipdir=require(_0x61a6('0x2'));var jsonpatch=require(_0x61a6('0x3'));var rp=require(_0x61a6('0x4'));var moment=require(_0x61a6('0x5'));var BPromise=require(_0x61a6('0x6'));var Mustache=require(_0x61a6('0x7'));var util=require(_0x61a6('0x8'));var path=require('path');var sox=require(_0x61a6('0x9'));var csv=require('to-csv');var ejs=require(_0x61a6('0xa'));var fs=require('fs');var fs_extra=require(_0x61a6('0xb'));var _=require(_0x61a6('0xc'));var squel=require(_0x61a6('0xd'));var crypto=require(_0x61a6('0xe'));var jsforce=require(_0x61a6('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x61a6('0x10'));var querystring=require(_0x61a6('0x11'));var Papa=require(_0x61a6('0x12'));var Redis=require(_0x61a6('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x61a6('0x14'));var hardwareService=require(_0x61a6('0x15'));var logger=require(_0x61a6('0x16'))(_0x61a6('0x17'));var utils=require(_0x61a6('0x18'));var config=require(_0x61a6('0x19'));var licenseUtil=require(_0x61a6('0x1a'));var db=require(_0x61a6('0x1b'))['db'];function respondWithStatusCode(_0x5bf6f3,_0x3aefac){_0x3aefac=_0x3aefac||0xcc;return function(_0x30f226){if(_0x30f226){return _0x5bf6f3[_0x61a6('0x1c')](_0x3aefac);}return _0x5bf6f3[_0x61a6('0x1d')](_0x3aefac)[_0x61a6('0x1e')]();};}function respondWithResult(_0x3a5365,_0x40c461){_0x40c461=_0x40c461||0xc8;return function(_0x3c2c8e){if(_0x3c2c8e){return _0x3a5365[_0x61a6('0x1d')](_0x40c461)[_0x61a6('0x1f')](_0x3c2c8e);}};}function respondWithFilteredResult(_0x26e8f4,_0x450bd6){return function(_0x5d7c1d){if(_0x5d7c1d){var _0x276262=typeof _0x450bd6['offset']===_0x61a6('0x20')&&typeof _0x450bd6[_0x61a6('0x21')]===_0x61a6('0x20');var _0x31691e=_0x5d7c1d[_0x61a6('0x22')];var _0x6ec861=_0x276262?0x0:_0x450bd6[_0x61a6('0x23')];var _0xd5e858=_0x276262?_0x5d7c1d[_0x61a6('0x22')]:_0x450bd6[_0x61a6('0x23')]+_0x450bd6['limit'];var _0x5be983;if(_0xd5e858>=_0x31691e){_0xd5e858=_0x31691e;_0x5be983=0xc8;}else{_0x5be983=0xce;}_0x26e8f4[_0x61a6('0x1d')](_0x5be983);return _0x26e8f4['set']('Content-Range',_0x6ec861+'-'+_0xd5e858+'/'+_0x31691e)[_0x61a6('0x1f')](_0x5d7c1d);}return null;};}function patchUpdates(_0x2ba2cf){return function(_0x5e980b){try{jsonpatch['apply'](_0x5e980b,_0x2ba2cf,!![]);}catch(_0x15e8bb){return BPromise[_0x61a6('0x24')](_0x15e8bb);}return _0x5e980b[_0x61a6('0x25')]();};}function saveUpdates(_0x3b6b0a,_0x5b3871){return function(_0x257ff5){if(_0x257ff5){return _0x257ff5[_0x61a6('0x26')](_0x3b6b0a)[_0x61a6('0x27')](function(_0x161840){return _0x161840;});}return null;};}function removeEntity(_0x41890a,_0x3323d4){return function(_0x3fec61){if(_0x3fec61){return _0x3fec61[_0x61a6('0x28')]()[_0x61a6('0x27')](function(){_0x41890a[_0x61a6('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34352f,_0x4797d2){return function(_0x143f3){if(!_0x143f3){_0x34352f['sendStatus'](0x194);}return _0x143f3;};}function handleError(_0x553457,_0x29e1f5){_0x29e1f5=_0x29e1f5||0x1f4;return function(_0x282740){logger[_0x61a6('0x29')](_0x282740[_0x61a6('0x2a')]);if(_0x282740['name']){delete _0x282740[_0x61a6('0x2b')];}_0x553457[_0x61a6('0x1d')](_0x29e1f5)['send'](_0x282740);};}exports[_0x61a6('0x2c')]=function(_0x1daa22,_0x481c3e){var _0x5874b2={},_0x219965={},_0x1c18fa={'count':0x0,'rows':[]};var _0x5e1019=_[_0x61a6('0x2d')](db['CmHopperHistory'][_0x61a6('0x2e')],function(_0x2bea95){return{'name':_0x2bea95[_0x61a6('0x2f')],'type':_0x2bea95[_0x61a6('0x30')]['key']};});_0x219965['model']=_[_0x61a6('0x2d')](_0x5e1019,_0x61a6('0x2b'));_0x219965['query']=_[_0x61a6('0x31')](_0x1daa22[_0x61a6('0x32')]);_0x219965[_0x61a6('0x33')]=_[_0x61a6('0x34')](_0x219965[_0x61a6('0x35')],_0x219965['query']);_0x5874b2['attributes']=_[_0x61a6('0x34')](_0x219965[_0x61a6('0x35')],qs['fields'](_0x1daa22[_0x61a6('0x32')][_0x61a6('0x36')]));_0x5874b2[_0x61a6('0x37')]=_0x5874b2[_0x61a6('0x37')][_0x61a6('0x38')]?_0x5874b2['attributes']:_0x219965[_0x61a6('0x35')];if(!_0x1daa22[_0x61a6('0x32')][_0x61a6('0x39')]('nolimit')){_0x5874b2[_0x61a6('0x21')]=qs[_0x61a6('0x21')](_0x1daa22['query']['limit']);_0x5874b2[_0x61a6('0x23')]=qs[_0x61a6('0x23')](_0x1daa22[_0x61a6('0x32')][_0x61a6('0x23')]);}_0x5874b2['order']=qs[_0x61a6('0x3a')](_0x1daa22['query']['sort']);_0x5874b2[_0x61a6('0x3b')]=qs['filters'](_['pick'](_0x1daa22['query'],_0x219965[_0x61a6('0x33')]),_0x5e1019);if(_0x1daa22[_0x61a6('0x32')][_0x61a6('0x3c')]){_0x5874b2['where']=_[_0x61a6('0x3d')](_0x5874b2[_0x61a6('0x3b')],{'$or':_[_0x61a6('0x2d')](_0x5e1019,function(_0x2f9820){if(_0x2f9820[_0x61a6('0x30')]!==_0x61a6('0x3e')){var _0x1b53d2={};_0x1b53d2[_0x2f9820[_0x61a6('0x2b')]]={'$like':'%'+_0x1daa22[_0x61a6('0x32')][_0x61a6('0x3c')]+'%'};return _0x1b53d2;}})});}_0x5874b2=_['merge']({},_0x5874b2,_0x1daa22['options']);var _0xf172b7={'where':_0x5874b2[_0x61a6('0x3b')]};return db[_0x61a6('0x3f')][_0x61a6('0x22')](_0xf172b7)[_0x61a6('0x27')](function(_0x4cd864){_0x1c18fa[_0x61a6('0x22')]=_0x4cd864;if(_0x1daa22['query'][_0x61a6('0x40')]){_0x5874b2['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x61a6('0x41')](_0x5874b2);})[_0x61a6('0x27')](function(_0x1eb7af){_0x1c18fa[_0x61a6('0x42')]=_0x1eb7af;return _0x1c18fa;})[_0x61a6('0x27')](respondWithFilteredResult(_0x481c3e,_0x5874b2))[_0x61a6('0x43')](handleError(_0x481c3e,null));};exports[_0x61a6('0x44')]=function(_0x2b15d9,_0x28417c){var _0x4c72d9={'raw':!![],'where':{'id':_0x2b15d9[_0x61a6('0x45')]['id']}},_0x2a46c9={};_0x2a46c9[_0x61a6('0x35')]=_[_0x61a6('0x31')](db[_0x61a6('0x3f')]['rawAttributes']);_0x2a46c9['query']=_[_0x61a6('0x31')](_0x2b15d9['query']);_0x2a46c9[_0x61a6('0x33')]=_[_0x61a6('0x34')](_0x2a46c9[_0x61a6('0x35')],_0x2a46c9[_0x61a6('0x32')]);_0x4c72d9[_0x61a6('0x37')]=_[_0x61a6('0x34')](_0x2a46c9[_0x61a6('0x35')],qs[_0x61a6('0x36')](_0x2b15d9[_0x61a6('0x32')][_0x61a6('0x36')]));_0x4c72d9[_0x61a6('0x37')]=_0x4c72d9[_0x61a6('0x37')][_0x61a6('0x38')]?_0x4c72d9[_0x61a6('0x37')]:_0x2a46c9[_0x61a6('0x35')];if(_0x2b15d9[_0x61a6('0x32')][_0x61a6('0x40')]){_0x4c72d9[_0x61a6('0x46')]=[{'all':!![]}];}_0x4c72d9=_['merge']({},_0x4c72d9,_0x2b15d9['options']);return db[_0x61a6('0x3f')][_0x61a6('0x47')](_0x4c72d9)['then'](handleEntityNotFound(_0x28417c,null))['then'](respondWithResult(_0x28417c,null))[_0x61a6('0x43')](handleError(_0x28417c,null));};exports[_0x61a6('0x48')]=function(_0x2e2a71,_0x25b8fb){return db['CmHopperHistory'][_0x61a6('0x48')](_0x2e2a71[_0x61a6('0x49')],{})['then'](respondWithResult(_0x25b8fb,0xc9))[_0x61a6('0x43')](handleError(_0x25b8fb,null));};exports[_0x61a6('0x4a')]=function(_0x2eb8ab,_0x44db60){return db[_0x61a6('0x3f')][_0x61a6('0x4a')]()[_0x61a6('0x27')](respondWithResult(_0x44db60,null))[_0x61a6('0x43')](handleError(_0x44db60,null));};exports['update']=function(_0x4ac6e0,_0x47932a){if(_0x4ac6e0['body'][_0x61a6('0x4b')]){delete _0x4ac6e0[_0x61a6('0x49')][_0x61a6('0x4b')];}return db[_0x61a6('0x3f')][_0x61a6('0x47')]({'where':{'uniqueid':_0x4ac6e0['params']['id']}})[_0x61a6('0x27')](handleEntityNotFound(_0x47932a,null))[_0x61a6('0x27')](saveUpdates(_0x4ac6e0[_0x61a6('0x49')],null))['then'](respondWithResult(_0x47932a,null))[_0x61a6('0x43')](handleError(_0x47932a,null));};
\ No newline at end of file
+var _0x0fb9=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','CmHopperHistory','rawAttributes','fieldName','type','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','keys','length','options','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4766f2,_0x38b8a1){var _0xe746c2=function(_0x27ad6d){while(--_0x27ad6d){_0x4766f2['push'](_0x4766f2['shift']());}};_0xe746c2(++_0x38b8a1);}(_0x0fb9,0x89));var _0x90fb=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0fb9[_0x46e363];return _0x3fb059;};'use strict';var emlformat=require(_0x90fb('0x0'));var rimraf=require(_0x90fb('0x1'));var zipdir=require(_0x90fb('0x2'));var jsonpatch=require(_0x90fb('0x3'));var rp=require(_0x90fb('0x4'));var moment=require(_0x90fb('0x5'));var BPromise=require(_0x90fb('0x6'));var Mustache=require(_0x90fb('0x7'));var util=require(_0x90fb('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x90fb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x90fb('0xa'));var _=require(_0x90fb('0xb'));var squel=require(_0x90fb('0xc'));var crypto=require(_0x90fb('0xd'));var jsforce=require(_0x90fb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x90fb('0xf'));var Papa=require(_0x90fb('0x10'));var Redis=require(_0x90fb('0x11'));var authService=require(_0x90fb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x90fb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90fb('0x14'));var utils=require(_0x90fb('0x15'));var config=require(_0x90fb('0x16'));var licenseUtil=require(_0x90fb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1befd7,_0x31b184){_0x31b184=_0x31b184||0xcc;return function(_0x397ae7){if(_0x397ae7){return _0x1befd7[_0x90fb('0x18')](_0x31b184);}return _0x1befd7[_0x90fb('0x19')](_0x31b184)[_0x90fb('0x1a')]();};}function respondWithResult(_0xa4bb12,_0x28d72d){_0x28d72d=_0x28d72d||0xc8;return function(_0x30d815){if(_0x30d815){return _0xa4bb12[_0x90fb('0x19')](_0x28d72d)[_0x90fb('0x1b')](_0x30d815);}};}function respondWithFilteredResult(_0x1a1563,_0x2f6647){return function(_0x267e6f){if(_0x267e6f){var _0x3b9592=typeof _0x2f6647[_0x90fb('0x1c')]===_0x90fb('0x1d')&&typeof _0x2f6647[_0x90fb('0x1e')]===_0x90fb('0x1d');var _0x53ba23=_0x267e6f[_0x90fb('0x1f')];var _0x24160d=_0x3b9592?0x0:_0x2f6647['offset'];var _0x29ddca=_0x3b9592?_0x267e6f['count']:_0x2f6647[_0x90fb('0x1c')]+_0x2f6647[_0x90fb('0x1e')];var _0xb45ba0;if(_0x29ddca>=_0x53ba23){_0x29ddca=_0x53ba23;_0xb45ba0=0xc8;}else{_0xb45ba0=0xce;}_0x1a1563['status'](_0xb45ba0);return _0x1a1563[_0x90fb('0x20')]('Content-Range',_0x24160d+'-'+_0x29ddca+'/'+_0x53ba23)[_0x90fb('0x1b')](_0x267e6f);}return null;};}function patchUpdates(_0x273e89){return function(_0x53fb2c){try{jsonpatch[_0x90fb('0x21')](_0x53fb2c,_0x273e89,!![]);}catch(_0x3bc6f5){return BPromise[_0x90fb('0x22')](_0x3bc6f5);}return _0x53fb2c[_0x90fb('0x23')]();};}function saveUpdates(_0x17b376,_0x1c4cea){return function(_0x1a2db1){if(_0x1a2db1){return _0x1a2db1[_0x90fb('0x24')](_0x17b376)[_0x90fb('0x25')](function(_0xa68b7){return _0xa68b7;});}return null;};}function removeEntity(_0x12434b,_0x5a2d60){return function(_0x537457){if(_0x537457){return _0x537457[_0x90fb('0x26')]()[_0x90fb('0x25')](function(){_0x12434b[_0x90fb('0x19')](0xcc)[_0x90fb('0x1a')]();});}};}function handleEntityNotFound(_0x123534,_0x5d7bf3){return function(_0x2bd2f7){if(!_0x2bd2f7){_0x123534[_0x90fb('0x18')](0x194);}return _0x2bd2f7;};}function handleError(_0x3e209b,_0x35af51){_0x35af51=_0x35af51||0x1f4;return function(_0x218ff1){logger[_0x90fb('0x27')](_0x218ff1[_0x90fb('0x28')]);if(_0x218ff1[_0x90fb('0x29')]){delete _0x218ff1[_0x90fb('0x29')];}_0x3e209b[_0x90fb('0x19')](_0x35af51)['send'](_0x218ff1);};}exports[_0x90fb('0x2a')]=function(_0x2f0f41,_0x441811){var _0x27743c={},_0x5a6084={},_0x3e4c37={'count':0x0,'rows':[]};var _0x25cd79=_['map'](db[_0x90fb('0x2b')][_0x90fb('0x2c')],function(_0x317459){return{'name':_0x317459[_0x90fb('0x2d')],'type':_0x317459[_0x90fb('0x2e')]['key']};});_0x5a6084[_0x90fb('0x2f')]=_[_0x90fb('0x30')](_0x25cd79,_0x90fb('0x29'));_0x5a6084[_0x90fb('0x31')]=_['keys'](_0x2f0f41[_0x90fb('0x31')]);_0x5a6084['filters']=_[_0x90fb('0x32')](_0x5a6084[_0x90fb('0x2f')],_0x5a6084[_0x90fb('0x31')]);_0x27743c[_0x90fb('0x33')]=_[_0x90fb('0x32')](_0x5a6084[_0x90fb('0x2f')],qs[_0x90fb('0x34')](_0x2f0f41[_0x90fb('0x31')]['fields']));_0x27743c[_0x90fb('0x33')]=_0x27743c['attributes']['length']?_0x27743c['attributes']:_0x5a6084['model'];if(!_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x35')](_0x90fb('0x36'))){_0x27743c[_0x90fb('0x1e')]=qs[_0x90fb('0x1e')](_0x2f0f41['query'][_0x90fb('0x1e')]);_0x27743c[_0x90fb('0x1c')]=qs['offset'](_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x1c')]);}_0x27743c[_0x90fb('0x37')]=qs[_0x90fb('0x38')](_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x38')]);_0x27743c['where']=qs['filters'](_[_0x90fb('0x39')](_0x2f0f41[_0x90fb('0x31')],_0x5a6084['filters']),_0x25cd79);if(_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x3a')]){_0x27743c['where']=_[_0x90fb('0x3b')](_0x27743c[_0x90fb('0x3c')],{'$or':_[_0x90fb('0x30')](_0x25cd79,function(_0x56527f){if(_0x56527f[_0x90fb('0x2e')]!==_0x90fb('0x3d')){var _0xa39fda={};_0xa39fda[_0x56527f[_0x90fb('0x29')]]={'$like':'%'+_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x3a')]+'%'};return _0xa39fda;}})});}_0x27743c=_['merge']({},_0x27743c,_0x2f0f41['options']);var _0x1c3d73={'where':_0x27743c['where']};return db[_0x90fb('0x2b')][_0x90fb('0x1f')](_0x1c3d73)[_0x90fb('0x25')](function(_0x110c9c){_0x3e4c37[_0x90fb('0x1f')]=_0x110c9c;if(_0x2f0f41[_0x90fb('0x31')][_0x90fb('0x3e')]){_0x27743c[_0x90fb('0x3f')]=[{'all':!![]}];}return db[_0x90fb('0x2b')]['findAll'](_0x27743c);})[_0x90fb('0x25')](function(_0x4f9238){_0x3e4c37[_0x90fb('0x40')]=_0x4f9238;return _0x3e4c37;})[_0x90fb('0x25')](respondWithFilteredResult(_0x441811,_0x27743c))[_0x90fb('0x41')](handleError(_0x441811,null));};exports[_0x90fb('0x42')]=function(_0x44ed5a,_0x1077bc){var _0x351002={'raw':!![],'where':{'id':_0x44ed5a[_0x90fb('0x43')]['id']}},_0x795068={};_0x795068[_0x90fb('0x2f')]=_[_0x90fb('0x44')](db['CmHopperHistory'][_0x90fb('0x2c')]);_0x795068['query']=_[_0x90fb('0x44')](_0x44ed5a[_0x90fb('0x31')]);_0x795068['filters']=_[_0x90fb('0x32')](_0x795068[_0x90fb('0x2f')],_0x795068['query']);_0x351002['attributes']=_[_0x90fb('0x32')](_0x795068[_0x90fb('0x2f')],qs[_0x90fb('0x34')](_0x44ed5a['query']['fields']));_0x351002[_0x90fb('0x33')]=_0x351002[_0x90fb('0x33')][_0x90fb('0x45')]?_0x351002[_0x90fb('0x33')]:_0x795068[_0x90fb('0x2f')];if(_0x44ed5a[_0x90fb('0x31')][_0x90fb('0x3e')]){_0x351002[_0x90fb('0x3f')]=[{'all':!![]}];}_0x351002=_['merge']({},_0x351002,_0x44ed5a[_0x90fb('0x46')]);return db[_0x90fb('0x2b')][_0x90fb('0x47')](_0x351002)[_0x90fb('0x25')](handleEntityNotFound(_0x1077bc,null))[_0x90fb('0x25')](respondWithResult(_0x1077bc,null))[_0x90fb('0x41')](handleError(_0x1077bc,null));};exports[_0x90fb('0x48')]=function(_0x8b30ce,_0x31f10e){return db[_0x90fb('0x2b')][_0x90fb('0x48')](_0x8b30ce[_0x90fb('0x49')],{})[_0x90fb('0x25')](respondWithResult(_0x31f10e,0xc9))[_0x90fb('0x41')](handleError(_0x31f10e,null));};exports[_0x90fb('0x4a')]=function(_0x54a374,_0x24b395){return db['CmHopperHistory'][_0x90fb('0x4a')]()['then'](respondWithResult(_0x24b395,null))['catch'](handleError(_0x24b395,null));};exports['update']=function(_0x594469,_0x2683ba){if(_0x594469[_0x90fb('0x49')][_0x90fb('0x4b')]){delete _0x594469[_0x90fb('0x49')][_0x90fb('0x4b')];}return db[_0x90fb('0x2b')][_0x90fb('0x47')]({'where':{'uniqueid':_0x594469[_0x90fb('0x43')]['id']}})['then'](handleEntityNotFound(_0x2683ba,null))[_0x90fb('0x25')](saveUpdates(_0x594469[_0x90fb('0x49')],null))['then'](respondWithResult(_0x2683ba,null))[_0x90fb('0x41')](handleError(_0x2683ba,null));};
\ No newline at end of file
index d40f165..41eb97d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a8=['util','../../config/logger','moment','path','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid'];(function(_0xad70b2,_0x161029){var _0x218ecd=function(_0x1b4057){while(--_0x1b4057){_0xad70b2['push'](_0xad70b2['shift']());}};_0x218ecd(++_0x161029);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x476458,_0xb38bfc){_0x476458=_0x476458-0x0;var _0x1292ee=_0xf3a8[_0x476458];return _0x1292ee;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var logger=require(_0x8f3a('0x1'))('api');var moment=require(_0x8f3a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f3a('0x3'));var rimraf=require('rimraf');var config=require(_0x8f3a('0x4'));var attributes=require('./cmHopperHistory.attributes');module[_0x8f3a('0x5')]=function(_0x3d6e2d,_0x109997){return _0x3d6e2d[_0x8f3a('0x6')](_0x8f3a('0x7'),attributes,{'tableName':_0x8f3a('0x8'),'paranoid':![],'indexes':[{'name':_0x8f3a('0x9'),'fields':[_0x8f3a('0x9')]},{'name':_0x8f3a('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x27fb=['moment','request-promise','path','rimraf','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger'];(function(_0x65f4e9,_0x46587b){var _0x58151f=function(_0x49f0f4){while(--_0x49f0f4){_0x65f4e9['push'](_0x65f4e9['shift']());}};_0x58151f(++_0x46587b);}(_0x27fb,0x1de));var _0xb27f=function(_0x2c2988,_0x1d0073){_0x2c2988=_0x2c2988-0x0;var _0x5d6527=_0x27fb[_0x2c2988];return _0x5d6527;};'use strict';var _=require(_0xb27f('0x0'));var util=require(_0xb27f('0x1'));var logger=require(_0xb27f('0x2'))('api');var moment=require(_0xb27f('0x3'));var BPromise=require('bluebird');var rp=require(_0xb27f('0x4'));var fs=require('fs');var path=require(_0xb27f('0x5'));var rimraf=require(_0xb27f('0x6'));var config=require('../../config/environment');var attributes=require(_0xb27f('0x7'));module['exports']=function(_0x2a1fa2,_0x3d70f3){return _0x2a1fa2[_0xb27f('0x8')](_0xb27f('0x9'),attributes,{'tableName':_0xb27f('0xa'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xb27f('0xb')]},{'name':_0xb27f('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index db7be58..a93983f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e8e=['code','message','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','COUNT','sequelize','col','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','where','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x506c1c,_0x4bc487){var _0x191143=function(_0x41e0e6){while(--_0x41e0e6){_0x506c1c['push'](_0x506c1c['shift']());}};_0x191143(++_0x4bc487);}(_0x3e8e,0x106));var _0xe3e8=function(_0x3b1660,_0x59a9a7){_0x3b1660=_0x3b1660-0x0;var _0x5d8522=_0x3e8e[_0x3b1660];return _0x5d8522;};'use strict';var _=require('lodash');var util=require(_0xe3e8('0x0'));var moment=require(_0xe3e8('0x1'));var BPromise=require(_0xe3e8('0x2'));var rs=require(_0xe3e8('0x3'));var fs=require('fs');var Redis=require(_0xe3e8('0x4'));var db=require(_0xe3e8('0x5'))['db'];var utils=require(_0xe3e8('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe3e8('0x7'));var jayson=require(_0xe3e8('0x8'));var client=jayson[_0xe3e8('0x9')][_0xe3e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26f5b0,_0x2c8832,_0x4d89a7){return new BPromise(function(_0x441200,_0x4be9bb){return client['request'](_0x26f5b0,_0x4d89a7)[_0xe3e8('0xb')](function(_0x4396aa){logger['info'](_0xe3e8('0xc'),_0x2c8832,_0xe3e8('0xd'));logger[_0xe3e8('0xe')](_0xe3e8('0xf'),_0x2c8832,_0xe3e8('0xd'),JSON[_0xe3e8('0x10')](_0x4396aa));if(_0x4396aa[_0xe3e8('0x11')]){if(_0x4396aa['error'][_0xe3e8('0x12')]===0x1f4){logger['error'](_0xe3e8('0xc'),_0x2c8832,_0x4396aa[_0xe3e8('0x11')]['message']);return _0x4be9bb(_0x4396aa[_0xe3e8('0x11')]['message']);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x2c8832,_0x4396aa[_0xe3e8('0x11')][_0xe3e8('0x13')]);return _0x441200(_0x4396aa[_0xe3e8('0x11')][_0xe3e8('0x13')]);}else{logger[_0xe3e8('0x14')]('CmHopperHistory,\x20%s,\x20%s',_0x2c8832,'request\x20sent');_0x441200(_0x4396aa['result'][_0xe3e8('0x13')]);}})[_0xe3e8('0x15')](function(_0x5455a8){logger[_0xe3e8('0x11')](_0xe3e8('0xc'),_0x2c8832,_0x5455a8);_0x4be9bb(_0x5455a8);});});}exports[_0xe3e8('0x16')]=function(_0x2a1395){var _0x207e3a=this;return new Promise(function(_0x384150,_0x507ba6){return db[_0xe3e8('0x17')][_0xe3e8('0x18')](_0x2a1395[_0xe3e8('0x19')],{'raw':_0x2a1395[_0xe3e8('0x1a')]?_0x2a1395[_0xe3e8('0x1a')][_0xe3e8('0x1b')]===undefined?!![]:![]:!![]})[_0xe3e8('0xb')](function(_0x29d182){logger[_0xe3e8('0x14')](_0xe3e8('0x16'),_0x2a1395);logger['debug'](_0xe3e8('0x16'),_0x2a1395,JSON[_0xe3e8('0x10')](_0x29d182));_0x384150(_0x29d182);})[_0xe3e8('0x15')](function(_0x348412){logger[_0xe3e8('0x11')](_0xe3e8('0x16'),_0x348412['message'],_0x2a1395);_0x507ba6(_0x207e3a[_0xe3e8('0x11')](0x1f4,_0x348412[_0xe3e8('0x13')]));});});};exports[_0xe3e8('0x1c')]=function(_0x58ad4c){var _0x5f402c=this;return new Promise(function(_0x38b23e,_0x383335){return db['CmHopperHistory'][_0xe3e8('0x1d')]({'raw':_0x58ad4c[_0xe3e8('0x1a')]?_0x58ad4c[_0xe3e8('0x1a')][_0xe3e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x58ad4c['options']?_0x58ad4c['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')][_0xe3e8('0x20')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x22')))),_0xe3e8('0x23')],[db['sequelize']['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize'][_0xe3e8('0x21')](_0xe3e8('0x24')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize'][_0xe3e8('0x21')](_0xe3e8('0x25')))),_0xe3e8('0x26')],[db['sequelize']['fn'](_0xe3e8('0x27'),db['sequelize']['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x28')))),_0xe3e8('0x29')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x27'),db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')]['literal'](_0xe3e8('0x2a')))),_0xe3e8('0x2b')]]})['then'](function(_0x50430f){logger[_0xe3e8('0x14')](_0xe3e8('0x1c'),_0x58ad4c);logger[_0xe3e8('0xe')]('AvgHandleTime',_0x58ad4c,JSON['stringify'](_0x50430f));_0x38b23e(_0x50430f);})[_0xe3e8('0x15')](function(_0x17cf57){logger[_0xe3e8('0x11')](_0xe3e8('0x1c'),_0x17cf57['message'],_0x58ad4c);_0x383335(_0x5f402c[_0xe3e8('0x11')](0x1f4,_0x17cf57[_0xe3e8('0x13')]));});});};exports[_0xe3e8('0x2c')]=function(_0x41e466){var _0x566693=this;return new Promise(function(_0x35040f,_0x209507){return db['CmHopperHistory'][_0xe3e8('0x1d')]({'raw':_0x41e466[_0xe3e8('0x1a')]?_0x41e466[_0xe3e8('0x1a')][_0xe3e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x41e466['options']?_0x41e466['options'][_0xe3e8('0x2d')]||null:null,'attributes':[[_0xe3e8('0x2e'),_0xe3e8('0x2f')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x30')))),'outboundNoSuchCallsDay'],[db['sequelize']['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')]['literal'](_0xe3e8('0x31')))),'outboundNoAnswerCallsDay'],[db[_0xe3e8('0x1f')]['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xe3e8('0x22')))),_0xe3e8('0x32')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db['sequelize']['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x33')))),_0xe3e8('0x34')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db['sequelize']['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x35')))),_0xe3e8('0x36')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db['sequelize']['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xe3e8('0x37')],[db['sequelize']['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize'][_0xe3e8('0x21')](_0xe3e8('0x38')))),_0xe3e8('0x39')],[db[_0xe3e8('0x1f')]['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x3a')))),_0xe3e8('0x3b')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db['sequelize']['fn']('IF',db[_0xe3e8('0x1f')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0xe3e8('0x3c')],[db[_0xe3e8('0x1f')]['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x3d')))),_0xe3e8('0x3e')],[db['sequelize']['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')]['literal'](_0xe3e8('0x3f')))),_0xe3e8('0x40')],[db[_0xe3e8('0x1f')]['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize'][_0xe3e8('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0xe3e8('0x3e')],[db['sequelize']['fn']('COUNT',db[_0xe3e8('0x1f')]['fn']('IF',db[_0xe3e8('0x1f')][_0xe3e8('0x21')](_0xe3e8('0x41')))),_0xe3e8('0x42')]],'group':['campaign']})[_0xe3e8('0xb')](function(_0x4bd40c){logger[_0xe3e8('0x14')](_0xe3e8('0x2c'),_0x41e466);logger[_0xe3e8('0xe')]('GetVoiceQueueHopperHistory',_0x41e466,JSON[_0xe3e8('0x10')](_0x4bd40c));_0x35040f(_0x4bd40c);})[_0xe3e8('0x15')](function(_0x330d1c){logger['error']('GetVoiceQueueHopperHistory',_0x330d1c[_0xe3e8('0x13')],_0x41e466);_0x209507(_0x566693['error'](0x1f4,_0x330d1c[_0xe3e8('0x13')]));});});};exports[_0xe3e8('0x43')]=function(_0x2b1c6){var _0x3dd92c=this;return new Promise(function(_0x2da467,_0x41bc4e){return db[_0xe3e8('0x17')][_0xe3e8('0x1d')]({'raw':_0x2b1c6[_0xe3e8('0x1a')]?_0x2b1c6[_0xe3e8('0x1a')][_0xe3e8('0x1b')]===undefined?!![]:![]:!![],'where':_0x2b1c6[_0xe3e8('0x1a')]?_0x2b1c6[_0xe3e8('0x1a')][_0xe3e8('0x2d')]||null:null,'attributes':[[_0xe3e8('0x2e'),_0xe3e8('0x2f')],[db['sequelize']['fn'](_0xe3e8('0x1e'),db['sequelize'][_0xe3e8('0x20')]('id')),_0xe3e8('0x44')],[db[_0xe3e8('0x1f')]['fn'](_0xe3e8('0x1e'),db[_0xe3e8('0x1f')]['fn']('IF',db['sequelize'][_0xe3e8('0x21')](_0xe3e8('0x22')))),_0xe3e8('0x45')]],'group':[_0xe3e8('0x2e')]})[_0xe3e8('0xb')](function(_0x1d489d){logger[_0xe3e8('0x14')]('GetCampaignHopperHistory',_0x2b1c6);logger[_0xe3e8('0xe')]('GetCampaignHopperHistory',_0x2b1c6,JSON[_0xe3e8('0x10')](_0x1d489d));_0x2da467(_0x1d489d);})['catch'](function(_0x40c125){logger[_0xe3e8('0x11')]('GetCampaignHopperHistory',_0x40c125[_0xe3e8('0x13')],_0x2b1c6);_0x41bc4e(_0x3dd92c[_0xe3e8('0x11')](0x1f4,_0x40c125[_0xe3e8('0x13')]));});});};
\ No newline at end of file
+var _0xc820=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','CmHopperHistory','body','options','raw','CreateCmHopperHistory','catch','findAll','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x14830b,_0x48ef80){var _0xd532a6=function(_0x14d94c){while(--_0x14d94c){_0x14830b['push'](_0x14830b['shift']());}};_0xd532a6(++_0x48ef80);}(_0xc820,0x13f));var _0x0c82=function(_0x26a6cd,_0x46449a){_0x26a6cd=_0x26a6cd-0x0;var _0x1c34f3=_0xc820[_0x26a6cd];return _0x1c34f3;};'use strict';var _=require('lodash');var util=require(_0x0c82('0x0'));var moment=require(_0x0c82('0x1'));var BPromise=require(_0x0c82('0x2'));var rs=require(_0x0c82('0x3'));var fs=require('fs');var Redis=require(_0x0c82('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c82('0x5'));var logger=require('../../config/logger')(_0x0c82('0x6'));var config=require(_0x0c82('0x7'));var jayson=require(_0x0c82('0x8'));var client=jayson[_0x0c82('0x9')][_0x0c82('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23f783,_0x2d2567,_0x32e9ee){return new BPromise(function(_0x4689b7,_0x29fc55){return client[_0x0c82('0xb')](_0x23f783,_0x32e9ee)[_0x0c82('0xc')](function(_0x1c13b8){logger[_0x0c82('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x2d2567,_0x0c82('0xe'));logger[_0x0c82('0xf')](_0x0c82('0x10'),_0x2d2567,_0x0c82('0xe'),JSON[_0x0c82('0x11')](_0x1c13b8));if(_0x1c13b8[_0x0c82('0x12')]){if(_0x1c13b8[_0x0c82('0x12')][_0x0c82('0x13')]===0x1f4){logger[_0x0c82('0x12')](_0x0c82('0x14'),_0x2d2567,_0x1c13b8['error'][_0x0c82('0x15')]);return _0x29fc55(_0x1c13b8['error']['message']);}logger[_0x0c82('0x12')](_0x0c82('0x14'),_0x2d2567,_0x1c13b8[_0x0c82('0x12')][_0x0c82('0x15')]);return _0x4689b7(_0x1c13b8[_0x0c82('0x12')]['message']);}else{logger[_0x0c82('0xd')](_0x0c82('0x14'),_0x2d2567,_0x0c82('0xe'));_0x4689b7(_0x1c13b8['result'][_0x0c82('0x15')]);}})['catch'](function(_0x2787ad){logger[_0x0c82('0x12')](_0x0c82('0x14'),_0x2d2567,_0x2787ad);_0x29fc55(_0x2787ad);});});}exports['CreateCmHopperHistory']=function(_0x53d28f){var _0x3e2478=this;return new Promise(function(_0x3dbfd1,_0x49231a){return db[_0x0c82('0x16')]['create'](_0x53d28f[_0x0c82('0x17')],{'raw':_0x53d28f[_0x0c82('0x18')]?_0x53d28f['options'][_0x0c82('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ec9aa){logger['info'](_0x0c82('0x1a'),_0x53d28f);logger[_0x0c82('0xf')]('CreateCmHopperHistory',_0x53d28f,JSON[_0x0c82('0x11')](_0x3ec9aa));_0x3dbfd1(_0x3ec9aa);})[_0x0c82('0x1b')](function(_0x8a6e02){logger['error'](_0x0c82('0x1a'),_0x8a6e02[_0x0c82('0x15')],_0x53d28f);_0x49231a(_0x3e2478[_0x0c82('0x12')](0x1f4,_0x8a6e02[_0x0c82('0x15')]));});});};exports['AvgHandleTime']=function(_0x2bcc7f){var _0x242f79=this;return new Promise(function(_0x838f30,_0x1de4ec){return db[_0x0c82('0x16')][_0x0c82('0x1c')]({'raw':_0x2bcc7f[_0x0c82('0x18')]?_0x2bcc7f['options'][_0x0c82('0x19')]===undefined?!![]:![]:!![],'where':_0x2bcc7f[_0x0c82('0x18')]?_0x2bcc7f['options'][_0x0c82('0x1d')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x0c82('0x1e')][_0x0c82('0x1f')]('id')),_0x0c82('0x20')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db['sequelize'][_0x0c82('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0x0c82('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0c82('0x1e')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0x0c82('0x23')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x24')))),_0x0c82('0x25')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x26'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')]['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x0c82('0x27')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x26'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x28')))),'predictiveIntervalAvgTalktime']]})[_0x0c82('0xc')](function(_0x7685a1){logger['info'](_0x0c82('0x29'),_0x2bcc7f);logger['debug']('AvgHandleTime',_0x2bcc7f,JSON[_0x0c82('0x11')](_0x7685a1));_0x838f30(_0x7685a1);})['catch'](function(_0x4d86c2){logger[_0x0c82('0x12')](_0x0c82('0x29'),_0x4d86c2[_0x0c82('0x15')],_0x2bcc7f);_0x1de4ec(_0x242f79[_0x0c82('0x12')](0x1f4,_0x4d86c2[_0x0c82('0x15')]));});});};exports[_0x0c82('0x2a')]=function(_0x519290){var _0x5a9cd1=this;return new Promise(function(_0x6ae129,_0x32597d){return db[_0x0c82('0x16')]['findAll']({'raw':_0x519290[_0x0c82('0x18')]?_0x519290[_0x0c82('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x519290[_0x0c82('0x18')]?_0x519290[_0x0c82('0x18')]['where']||null:null,'attributes':[[_0x0c82('0x2b'),_0x0c82('0x2c')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db['sequelize']['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x2d')))),_0x0c82('0x2e')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db['sequelize'][_0x0c82('0x22')](_0x0c82('0x2f')))),'outboundNoAnswerCallsDay'],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x0c82('0x30')],[db['sequelize']['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x0c82('0x31')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x0c82('0x32')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0c82('0x33')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x0c82('0x22')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x0c82('0x34')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x35')))),_0x0c82('0x36')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x0c82('0x37')))),_0x0c82('0x38')],[db[_0x0c82('0x1e')]['fn']('COUNT',db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')]('`state`\x20=\x2014,\x201,\x20null'))),'outboundOriginateFailureCallsDay'],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db['sequelize']['fn']('IF',db[_0x0c82('0x1e')]['literal'](_0x0c82('0x39')))),_0x0c82('0x3a')],[db['sequelize']['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x3b')))),_0x0c82('0x3c')],[db['sequelize']['fn']('COUNT',db[_0x0c82('0x1e')]['fn']('IF',db[_0x0c82('0x1e')][_0x0c82('0x22')](_0x0c82('0x3d')))),_0x0c82('0x3a')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x0c82('0x22')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x0c82('0x3e')]],'group':[_0x0c82('0x2b')]})['then'](function(_0x367726){logger[_0x0c82('0xd')](_0x0c82('0x2a'),_0x519290);logger[_0x0c82('0xf')]('GetVoiceQueueHopperHistory',_0x519290,JSON[_0x0c82('0x11')](_0x367726));_0x6ae129(_0x367726);})[_0x0c82('0x1b')](function(_0x401a3c){logger[_0x0c82('0x12')](_0x0c82('0x2a'),_0x401a3c['message'],_0x519290);_0x32597d(_0x5a9cd1[_0x0c82('0x12')](0x1f4,_0x401a3c[_0x0c82('0x15')]));});});};exports[_0x0c82('0x3f')]=function(_0x3032d0){var _0x3a5979=this;return new Promise(function(_0x2efb48,_0x97889){return db[_0x0c82('0x16')]['findAll']({'raw':_0x3032d0[_0x0c82('0x18')]?_0x3032d0[_0x0c82('0x18')][_0x0c82('0x19')]===undefined?!![]:![]:!![],'where':_0x3032d0[_0x0c82('0x18')]?_0x3032d0[_0x0c82('0x18')][_0x0c82('0x1d')]||null:null,'attributes':[[_0x0c82('0x2b'),_0x0c82('0x2c')],[db[_0x0c82('0x1e')]['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')][_0x0c82('0x1f')]('id')),_0x0c82('0x40')],[db['sequelize']['fn'](_0x0c82('0x21'),db[_0x0c82('0x1e')]['fn']('IF',db['sequelize'][_0x0c82('0x22')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x0c82('0xc')](function(_0x425a2d){logger[_0x0c82('0xd')](_0x0c82('0x3f'),_0x3032d0);logger[_0x0c82('0xf')](_0x0c82('0x3f'),_0x3032d0,JSON[_0x0c82('0x11')](_0x425a2d));_0x2efb48(_0x425a2d);})[_0x0c82('0x1b')](function(_0x261d5f){logger['error'](_0x0c82('0x3f'),_0x261d5f['message'],_0x3032d0);_0x97889(_0x3a5979['error'](0x1f4,_0x261d5f['message']));});});};
\ No newline at end of file
index 3645990..d5e8111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c1f=['get','isAuthenticated','index','/describe','describe','/:id','create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmHopperHistory.controller'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x7c1f,0x7f));var _0xf7c1=function(_0x1c6acd,_0x3032f8){_0x1c6acd=_0x1c6acd-0x0;var _0x1ceeeb=_0x7c1f[_0x1c6acd];return _0x1ceeeb;};'use strict';var multer=require(_0xf7c1('0x0'));var util=require(_0xf7c1('0x1'));var path=require(_0xf7c1('0x2'));var timeout=require(_0xf7c1('0x3'));var express=require(_0xf7c1('0x4'));var router=express[_0xf7c1('0x5')]();var fs_extra=require(_0xf7c1('0x6'));var auth=require(_0xf7c1('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf7c1('0x8'));router[_0xf7c1('0x9')]('/',auth[_0xf7c1('0xa')](),controller[_0xf7c1('0xb')]);router[_0xf7c1('0x9')](_0xf7c1('0xc'),auth[_0xf7c1('0xa')](),controller[_0xf7c1('0xd')]);router[_0xf7c1('0x9')](_0xf7c1('0xe'),auth[_0xf7c1('0xa')](),controller['show']);router['post']('/',auth[_0xf7c1('0xa')](),controller[_0xf7c1('0xf')]);router['put'](_0xf7c1('0xe'),auth[_0xf7c1('0xa')](),controller['update']);module[_0xf7c1('0x10')]=router;
\ No newline at end of file
+var _0x9081=['update','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','create','put'];(function(_0x57f5c1,_0x324985){var _0x1f2f4a=function(_0x4fd537){while(--_0x4fd537){_0x57f5c1['push'](_0x57f5c1['shift']());}};_0x1f2f4a(++_0x324985);}(_0x9081,0x1a6));var _0x1908=function(_0x3a9a79,_0x4c1734){_0x3a9a79=_0x3a9a79-0x0;var _0xbaceb2=_0x9081[_0x3a9a79];return _0xbaceb2;};'use strict';var multer=require(_0x1908('0x0'));var util=require('util');var path=require(_0x1908('0x1'));var timeout=require(_0x1908('0x2'));var express=require('express');var router=express[_0x1908('0x3')]();var fs_extra=require(_0x1908('0x4'));var auth=require(_0x1908('0x5'));var interaction=require(_0x1908('0x6'));var config=require(_0x1908('0x7'));var controller=require(_0x1908('0x8'));router[_0x1908('0x9')]('/',auth['isAuthenticated'](),controller[_0x1908('0xa')]);router[_0x1908('0x9')](_0x1908('0xb'),auth[_0x1908('0xc')](),controller[_0x1908('0xd')]);router[_0x1908('0x9')](_0x1908('0xe'),auth['isAuthenticated'](),controller[_0x1908('0xf')]);router['post']('/',auth[_0x1908('0xc')](),controller[_0x1908('0x10')]);router[_0x1908('0x11')]('/:id',auth[_0x1908('0xc')](),controller[_0x1908('0x12')]);module[_0x1908('0x13')]=router;
\ No newline at end of file
index da25b61..1af91e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61a5=['sequelize','STRING','name'];(function(_0x3e3d3a,_0x564979){var _0x1de2eb=function(_0x3594cf){while(--_0x3594cf){_0x3e3d3a['push'](_0x3e3d3a['shift']());}};_0x1de2eb(++_0x564979);}(_0x61a5,0xf0));var _0x561a=function(_0x455bbf,_0x487eb1){_0x455bbf=_0x455bbf-0x0;var _0x31cc6a=_0x61a5[_0x455bbf];return _0x31cc6a;};'use strict';var Sequelize=require(_0x561a('0x0'));module['exports']={'name':{'type':Sequelize[_0x561a('0x1')],'unique':_0x561a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x561a('0x1')]},'dialPrefix':{'type':Sequelize[_0x561a('0x1')]}};
\ No newline at end of file
+var _0xc7b4=['STRING','name','sequelize'];(function(_0x2b5a2f,_0x120e88){var _0x5998bc=function(_0x164cc0){while(--_0x164cc0){_0x2b5a2f['push'](_0x2b5a2f['shift']());}};_0x5998bc(++_0x120e88);}(_0xc7b4,0x15e));var _0x4c7b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc7b4[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x4c7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4c7b('0x1')],'unique':_0x4c7b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x4c7b('0x1')]}};
\ No newline at end of file
index 1fd2f1a..e5250fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5570=['mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','offset','count','limit','set','save','then','destroy','UserProfileResource','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','keys','length','includeAll','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Lists','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','ListId','findOne','nolimit','Disposition','findAll','rows','removeDispositions','CmContact','isArray','tags','join','each','omit','ids','push','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','alias','select','from','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','additionalPhone_','description','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','transaction','TEXT','text','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','cf_%s','getGlobalCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','zip-dir','fast-json-patch','request-promise'];(function(_0x12010d,_0x43e72c){var _0xcc8c1c=function(_0x4c845a){while(--_0x4c845a){_0x12010d['push'](_0x12010d['shift']());}};_0xcc8c1c(++_0x43e72c);}(_0x5570,0x13d));var _0x0557=function(_0x146a97,_0x2d8483){_0x146a97=_0x146a97-0x0;var _0x259d5c=_0x5570[_0x146a97];return _0x259d5c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0557('0x0'));var jsonpatch=require(_0x0557('0x1'));var rp=require(_0x0557('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0557('0x3'));var util=require(_0x0557('0x4'));var path=require(_0x0557('0x5'));var sox=require(_0x0557('0x6'));var csv=require('to-csv');var ejs=require(_0x0557('0x7'));var fs=require('fs');var fs_extra=require(_0x0557('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0557('0x9'));var jsforce=require(_0x0557('0xa'));var deskjs=require(_0x0557('0xb'));var toCsv=require(_0x0557('0xc'));var querystring=require(_0x0557('0xd'));var Papa=require(_0x0557('0xe'));var Redis=require(_0x0557('0xf'));var authService=require(_0x0557('0x10'));var qs=require(_0x0557('0x11'));var as=require(_0x0557('0x12'));var hardwareService=require(_0x0557('0x13'));var logger=require('../../config/logger')(_0x0557('0x14'));var utils=require(_0x0557('0x15'));var config=require(_0x0557('0x16'));var licenseUtil=require(_0x0557('0x17'));var db=require('../../mysqldb')['db'];var csv_results;config['redis']=_[_0x0557('0x18')](config[_0x0557('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0557('0x1a'))(new Redis(config[_0x0557('0x19')]));require(_0x0557('0x1b'))[_0x0557('0x1c')](socket);function respondWithStatusCode(_0x4b9484,_0x26bfcc){_0x26bfcc=_0x26bfcc||0xcc;return function(_0x5953a1){if(_0x5953a1){return _0x4b9484[_0x0557('0x1d')](_0x26bfcc);}return _0x4b9484[_0x0557('0x1e')](_0x26bfcc)[_0x0557('0x1f')]();};}function respondWithResult(_0x155151,_0x32b5fb){_0x32b5fb=_0x32b5fb||0xc8;return function(_0x55ae2e){if(_0x55ae2e){return _0x155151[_0x0557('0x1e')](_0x32b5fb)[_0x0557('0x20')](_0x55ae2e);}};}function respondWithFilteredResult(_0x47083a,_0x562558){return function(_0x8740bf){if(_0x8740bf){var _0x3f4d2c=typeof _0x562558[_0x0557('0x21')]==='undefined'&&typeof _0x562558['limit']==='undefined';var _0x477e61=_0x8740bf[_0x0557('0x22')];var _0x2b038e=_0x3f4d2c?0x0:_0x562558[_0x0557('0x21')];var _0xacd82e=_0x3f4d2c?_0x8740bf[_0x0557('0x22')]:_0x562558[_0x0557('0x21')]+_0x562558[_0x0557('0x23')];var _0x43c99e;if(_0xacd82e>=_0x477e61){_0xacd82e=_0x477e61;_0x43c99e=0xc8;}else{_0x43c99e=0xce;}_0x47083a['status'](_0x43c99e);return _0x47083a[_0x0557('0x24')]('Content-Range',_0x2b038e+'-'+_0xacd82e+'/'+_0x477e61)['json'](_0x8740bf);}return null;};}function patchUpdates(_0x403581){return function(_0x3624dd){try{jsonpatch['apply'](_0x3624dd,_0x403581,!![]);}catch(_0x34c9f3){return BPromise['reject'](_0x34c9f3);}return _0x3624dd[_0x0557('0x25')]();};}function saveUpdates(_0x588b98,_0x1be82f){return function(_0x16002b){if(_0x16002b){return _0x16002b['update'](_0x588b98)[_0x0557('0x26')](function(_0x1810ff){return _0x1810ff;});}return null;};}function removeEntity(_0x13b791,_0x223fbd){return function(_0x5c8af4){if(_0x5c8af4){return _0x5c8af4[_0x0557('0x27')]()['then'](function(){var _0x33dd07=_0x5c8af4['get']({'plain':!![]});var _0x1b426c='Lists';return db[_0x0557('0x28')][_0x0557('0x27')]({'where':{'type':_0x1b426c,'resourceId':_0x33dd07['id']}})['then'](function(){return _0x5c8af4;});})['then'](function(){_0x13b791['status'](0xcc)[_0x0557('0x1f')]();});}};}function handleEntityNotFound(_0x315d6e,_0x41eb96){return function(_0x1f8445){if(!_0x1f8445){_0x315d6e[_0x0557('0x1d')](0x194);}return _0x1f8445;};}function handleError(_0x36e995,_0x5d8b81){_0x5d8b81=_0x5d8b81||0x1f4;return function(_0x1b8a6b){logger['error'](_0x1b8a6b[_0x0557('0x29')]);if(_0x1b8a6b[_0x0557('0x2a')]){delete _0x1b8a6b['name'];}_0x36e995[_0x0557('0x1e')](_0x5d8b81)[_0x0557('0x2b')](_0x1b8a6b);};}exports[_0x0557('0x2c')]=function(_0x40d465,_0x5e0d90){var _0x598674={},_0x23454b={},_0x54079a={'count':0x0,'rows':[]};var _0x57875f=_[_0x0557('0x2d')](db[_0x0557('0x2e')][_0x0557('0x2f')],function(_0x47f6c2){return{'name':_0x47f6c2[_0x0557('0x30')],'type':_0x47f6c2[_0x0557('0x31')][_0x0557('0x32')]};});_0x23454b[_0x0557('0x33')]=_[_0x0557('0x2d')](_0x57875f,_0x0557('0x2a'));_0x23454b[_0x0557('0x34')]=_['keys'](_0x40d465[_0x0557('0x34')]);_0x23454b[_0x0557('0x35')]=_[_0x0557('0x36')](_0x23454b[_0x0557('0x33')],_0x23454b[_0x0557('0x34')]);_0x598674[_0x0557('0x37')]=_[_0x0557('0x36')](_0x23454b[_0x0557('0x33')],qs[_0x0557('0x38')](_0x40d465[_0x0557('0x34')][_0x0557('0x38')]));_0x598674[_0x0557('0x37')]=_0x598674[_0x0557('0x37')]['length']?_0x598674['attributes']:_0x23454b['model'];if(!_0x40d465['query'][_0x0557('0x39')]('nolimit')){_0x598674[_0x0557('0x23')]=qs[_0x0557('0x23')](_0x40d465[_0x0557('0x34')]['limit']);_0x598674[_0x0557('0x21')]=qs['offset'](_0x40d465[_0x0557('0x34')][_0x0557('0x21')]);}_0x598674[_0x0557('0x3a')]=qs['sort'](_0x40d465[_0x0557('0x34')][_0x0557('0x3b')]);_0x598674[_0x0557('0x3c')]=qs['filters'](_[_0x0557('0x3d')](_0x40d465[_0x0557('0x34')],_0x23454b[_0x0557('0x35')]),_0x57875f);if(_0x40d465['query']['filter']){_0x598674[_0x0557('0x3c')]=_[_0x0557('0x3e')](_0x598674[_0x0557('0x3c')],{'$or':_['map'](_0x57875f,function(_0x37f454){if(_0x37f454[_0x0557('0x31')]!==_0x0557('0x3f')){var _0x48901d={};_0x48901d[_0x37f454[_0x0557('0x2a')]]={'$like':'%'+_0x40d465[_0x0557('0x34')][_0x0557('0x40')]+'%'};return _0x48901d;}})});}_0x598674=_[_0x0557('0x3e')]({},_0x598674,_0x40d465[_0x0557('0x41')]);var _0x51cb9d={'where':_0x598674[_0x0557('0x3c')]};return db[_0x0557('0x2e')][_0x0557('0x22')](_0x51cb9d)[_0x0557('0x26')](function(_0x2a4fa2){_0x54079a[_0x0557('0x22')]=_0x2a4fa2;if(_0x40d465[_0x0557('0x34')]['includeAll']){_0x598674[_0x0557('0x42')]=[{'all':!![]}];}return db[_0x0557('0x2e')]['findAll'](_0x598674);})[_0x0557('0x26')](function(_0x4a21aa){_0x54079a['rows']=_0x4a21aa;return _0x54079a;})['then'](respondWithFilteredResult(_0x5e0d90,_0x598674))['catch'](handleError(_0x5e0d90,null));};exports[_0x0557('0x43')]=function(_0x345d45,_0x239828){var _0x564221={'raw':![],'where':{'id':_0x345d45[_0x0557('0x44')]['id']}},_0x511281={};_0x511281[_0x0557('0x33')]=_[_0x0557('0x45')](db[_0x0557('0x2e')]['rawAttributes']);_0x511281['query']=_[_0x0557('0x45')](_0x345d45['query']);_0x511281[_0x0557('0x35')]=_[_0x0557('0x36')](_0x511281[_0x0557('0x33')],_0x511281['query']);_0x564221[_0x0557('0x37')]=_['intersection'](_0x511281[_0x0557('0x33')],qs[_0x0557('0x38')](_0x345d45['query'][_0x0557('0x38')]));_0x564221[_0x0557('0x37')]=_0x564221[_0x0557('0x37')][_0x0557('0x46')]?_0x564221['attributes']:_0x511281[_0x0557('0x33')];if(_0x345d45['query'][_0x0557('0x47')]){_0x564221[_0x0557('0x42')]=[{'all':!![]}];}_0x564221=_[_0x0557('0x3e')]({},_0x564221,_0x345d45[_0x0557('0x41')]);return db[_0x0557('0x2e')][_0x0557('0x48')](_0x564221)[_0x0557('0x26')](handleEntityNotFound(_0x239828,null))['then'](respondWithResult(_0x239828,null))[_0x0557('0x49')](handleError(_0x239828,null));};exports[_0x0557('0x4a')]=function(_0x41d5ef,_0xeba23b){return db['CmList'][_0x0557('0x4a')](_0x41d5ef['body'],{})[_0x0557('0x26')](function(_0x186c4c){var _0x65372d=_0x41d5ef[_0x0557('0x4b')]['get']({'plain':!![]});if(!_0x65372d)throw new Error(_0x0557('0x4c'));if(_0x65372d[_0x0557('0x4d')]===_0x0557('0x4b')){var _0x2cabf7=_0x186c4c[_0x0557('0x4e')]({'plain':!![]});var _0x55fa25=_0x0557('0x4f');return db[_0x0557('0x50')][_0x0557('0x48')]({'where':{'name':_0x55fa25,'userProfileId':_0x65372d[_0x0557('0x51')]},'raw':!![]})[_0x0557('0x26')](function(_0x34e8fa){if(_0x34e8fa&&_0x34e8fa[_0x0557('0x52')]===0x0){return db[_0x0557('0x28')][_0x0557('0x4a')]({'name':_0x2cabf7[_0x0557('0x2a')],'resourceId':_0x2cabf7['id'],'type':_0x34e8fa[_0x0557('0x2a')],'sectionId':_0x34e8fa['id']},{})[_0x0557('0x26')](function(){return _0x186c4c;});}else{return _0x186c4c;}})['catch'](function(_0x1188fc){logger[_0x0557('0x53')](_0x0557('0x54'),_0x1188fc);throw _0x1188fc;});}return _0x186c4c;})[_0x0557('0x26')](respondWithResult(_0xeba23b,0xc9))[_0x0557('0x49')](handleError(_0xeba23b,null));};exports[_0x0557('0x55')]=function(_0x43b2d4,_0x4a36d0){if(_0x43b2d4[_0x0557('0x56')]['id']){delete _0x43b2d4[_0x0557('0x56')]['id'];}return db['CmList'][_0x0557('0x48')]({'where':{'id':_0x43b2d4[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x4a36d0,null))['then'](saveUpdates(_0x43b2d4[_0x0557('0x56')],null))[_0x0557('0x26')](respondWithResult(_0x4a36d0,null))['catch'](handleError(_0x4a36d0,null));};exports[_0x0557('0x27')]=function(_0x2903dc,_0x43a3){return db[_0x0557('0x2e')]['find']({'where':{'id':_0x2903dc[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x43a3,null))[_0x0557('0x26')](removeEntity(_0x43a3,null))['catch'](handleError(_0x43a3,null));};exports[_0x0557('0x57')]=function(_0x5e2302,_0xeb81e1){return db['CmList'][_0x0557('0x57')]()[_0x0557('0x26')](respondWithResult(_0xeb81e1,null))['catch'](handleError(_0xeb81e1,null));};exports['addDisposition']=function(_0x2a95ef,_0x3f67ce,_0x4fc84f){if(_0x2a95ef[_0x0557('0x56')]['id']){delete _0x2a95ef['body']['id'];}return db[_0x0557('0x2e')][_0x0557('0x48')]({'where':{'id':_0x2a95ef[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x3f67ce,null))[_0x0557('0x26')](function(_0x36a645){if(_0x36a645){_0x2a95ef['body'][_0x0557('0x58')]=_0x36a645['id'];return db['Disposition']['create'](_0x2a95ef[_0x0557('0x56')]);}})[_0x0557('0x26')](respondWithResult(_0x3f67ce,null))[_0x0557('0x49')](handleError(_0x3f67ce,null));};exports['getDispositions']=function(_0x29a79e,_0x2b240e,_0x485ffa){var _0x40d907={'raw':![],'where':{}};var _0x5fe238={};var _0x2fdc2d={'count':0x0,'rows':[]};return db['CmList'][_0x0557('0x59')]({'where':{'id':_0x29a79e[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x2b240e,null))['then'](function(_0x60ba55){if(_0x60ba55){_0x5fe238[_0x0557('0x33')]=_['keys'](db['Disposition'][_0x0557('0x2f')]);_0x5fe238[_0x0557('0x34')]=_[_0x0557('0x45')](_0x29a79e[_0x0557('0x34')]);_0x5fe238[_0x0557('0x35')]=_[_0x0557('0x36')](_0x5fe238[_0x0557('0x33')],_0x5fe238[_0x0557('0x34')]);_0x40d907[_0x0557('0x37')]=_[_0x0557('0x36')](_0x5fe238[_0x0557('0x33')],qs[_0x0557('0x38')](_0x29a79e['query'][_0x0557('0x38')]));_0x40d907[_0x0557('0x37')]=_0x40d907['attributes'][_0x0557('0x46')]?_0x40d907[_0x0557('0x37')]:_0x5fe238[_0x0557('0x33')];if(!_0x29a79e[_0x0557('0x34')][_0x0557('0x39')](_0x0557('0x5a'))){_0x40d907[_0x0557('0x23')]=qs[_0x0557('0x23')](_0x29a79e[_0x0557('0x34')][_0x0557('0x23')]);_0x40d907['offset']=qs[_0x0557('0x21')](_0x29a79e[_0x0557('0x34')][_0x0557('0x21')]);}_0x40d907[_0x0557('0x3a')]=qs[_0x0557('0x3b')](_0x29a79e[_0x0557('0x34')][_0x0557('0x3b')]);_0x40d907[_0x0557('0x3c')]=qs[_0x0557('0x35')](_['pick'](_0x29a79e['query'],_0x5fe238[_0x0557('0x35')]));_0x40d907['where'][_0x0557('0x58')]=_0x60ba55['id'];if(_0x29a79e[_0x0557('0x34')]['filter']){_0x40d907['where']=_[_0x0557('0x3e')](_0x40d907[_0x0557('0x3c')],{'$or':_[_0x0557('0x2d')](_0x40d907['attributes'],function(_0x3bfe7f){var _0x555246={};_0x555246[_0x3bfe7f]={'$like':'%'+_0x29a79e[_0x0557('0x34')]['filter']+'%'};return _0x555246;})});}_0x40d907=_[_0x0557('0x3e')]({},_0x40d907,_0x29a79e[_0x0557('0x41')]);return db[_0x0557('0x5b')][_0x0557('0x22')]({'where':_0x40d907[_0x0557('0x3c')]})['then'](function(_0x4e4cf1){_0x2fdc2d[_0x0557('0x22')]=_0x4e4cf1;if(_0x29a79e[_0x0557('0x34')]['includeAll']){_0x40d907[_0x0557('0x42')]=[{'all':!![]}];}return db[_0x0557('0x5b')][_0x0557('0x5c')](_0x40d907);})[_0x0557('0x26')](function(_0x3d5855){_0x2fdc2d[_0x0557('0x5d')]=_0x3d5855;return _0x2fdc2d;});}})[_0x0557('0x26')](respondWithFilteredResult(_0x2b240e,_0x40d907))[_0x0557('0x49')](handleError(_0x2b240e,null));};exports['removeDispositions']=function(_0x575ab0,_0x5c5434,_0x1e1ce0){return db[_0x0557('0x2e')][_0x0557('0x48')]({'where':{'id':_0x575ab0[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x5c5434,null))[_0x0557('0x26')](function(_0x351e98){if(_0x351e98){return _0x351e98[_0x0557('0x5e')](_0x575ab0[_0x0557('0x34')]['ids']);}})[_0x0557('0x26')](respondWithStatusCode(_0x5c5434,null))[_0x0557('0x49')](handleError(_0x5c5434,null));};exports['addContacts']=function(_0x51a47b,_0x22e919,_0x292c80){return db[_0x0557('0x2e')][_0x0557('0x48')]({'where':{'id':_0x51a47b[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x22e919,null))[_0x0557('0x26')](function(_0x40b607){if(_0x40b607){var _0x1bab00=[];var _0x573f4a={'success':[],'errors':[]};return db[_0x0557('0x5f')][_0x0557('0x57')]()[_0x0557('0x26')](function(_0x356141){if(_0x51a47b[_0x0557('0x56')]['tags']&&_[_0x0557('0x60')](_0x51a47b['body']['tags'])){if(_0x51a47b['body'][_0x0557('0x61')][_0x0557('0x46')]){_0x51a47b[_0x0557('0x56')][_0x0557('0x61')]=_0x51a47b[_0x0557('0x56')]['tags'][_0x0557('0x62')](';')+';';}else{_0x51a47b[_0x0557('0x56')][_0x0557('0x61')]=null;}}else{_0x51a47b[_0x0557('0x56')][_0x0557('0x61')]=null;}if(_0x51a47b[_0x0557('0x56')]&&_['isArray'](_0x51a47b['body'])){for(var _0xe7879=0x0;_0xe7879<_0x51a47b[_0x0557('0x56')]['length'];_0xe7879+=0x1){_0x51a47b[_0x0557('0x56')][_0xe7879][_0x0557('0x58')]=_0x51a47b[_0x0557('0x44')]['id'];_0x1bab00['push'](_0x51a47b[_0x0557('0x56')][_0xe7879]);}return BPromise[_0x0557('0x63')](_0x1bab00,function(_0x1e9a24){return db[_0x0557('0x5f')][_0x0557('0x4a')](_[_0x0557('0x64')](_0x1e9a24,[_0x0557('0x65'),'id'])||{},{'fields':_[_0x0557('0x45')](_0x356141),'raw':!![]})[_0x0557('0x26')](function(_0x8fdb44){_0x573f4a['success'][_0x0557('0x66')](_0x8fdb44['dataValues']);})[_0x0557('0x49')](function(_0x2e7fc1){_0x573f4a[_0x0557('0x67')][_0x0557('0x66')]({'data':_0x1e9a24,'error':_0x2e7fc1[_0x0557('0x68')]});});})['then'](function(_0x16c6f1){return _0x573f4a;})[_0x0557('0x49')](function(_0x4d468d){return _0x4d468d;});}else{_0x22e919[_0x0557('0x1e')](0x190)[_0x0557('0x20')]({'message':_0x0557('0x69')});}});}})['then'](respondWithResult(_0x22e919,null))[_0x0557('0x49')](handleError(_0x22e919,null));};exports[_0x0557('0x6a')]=function(_0x1fc13f,_0x4bfdf5,_0x23039a){var _0x227b3a;return db[_0x0557('0x2e')][_0x0557('0x48')]({'where':{'id':_0x1fc13f[_0x0557('0x44')]['id']},'include':[{'model':db[_0x0557('0x6b')],'as':_0x0557('0x6c')}]})['then'](handleEntityNotFound(_0x4bfdf5,null))[_0x0557('0x26')](function(_0x5b9098){if(_0x5b9098){_0x227b3a=_0x5b9098;return db[_0x0557('0x5f')][_0x0557('0x2f')];}})[_0x0557('0x26')](function(_0x10206a){if(_0x10206a){var _0x5cbcda={};var _0x285a3a={};_0x285a3a[_0x0557('0x33')]=_[_0x0557('0x6d')](_[_0x0557('0x45')](_0x10206a),_['map'](_0x227b3a[_0x0557('0x6c')],function(_0x5d154f){return util[_0x0557('0x6e')]('cf_%d',_0x5d154f['id']);}));_0x285a3a[_0x0557('0x34')]=_[_0x0557('0x45')](_0x1fc13f[_0x0557('0x34')]);_0x285a3a[_0x0557('0x35')]=_[_0x0557('0x36')](_0x285a3a[_0x0557('0x33')],_0x285a3a[_0x0557('0x34')]);_0x5cbcda[_0x0557('0x37')]=_[_0x0557('0x36')](_0x285a3a['model'],qs[_0x0557('0x38')](_0x1fc13f[_0x0557('0x34')][_0x0557('0x38')]));_0x5cbcda[_0x0557('0x37')]=_0x5cbcda[_0x0557('0x37')][_0x0557('0x46')]?_0x5cbcda[_0x0557('0x37')]:_0x285a3a[_0x0557('0x33')];if(!_0x1fc13f[_0x0557('0x34')]['hasOwnProperty'](_0x0557('0x5a'))){_0x5cbcda[_0x0557('0x23')]=qs[_0x0557('0x23')](_0x1fc13f['query']['limit']);_0x5cbcda[_0x0557('0x21')]=qs[_0x0557('0x21')](_0x1fc13f[_0x0557('0x34')][_0x0557('0x21')]);}_0x5cbcda[_0x0557('0x3a')]=qs[_0x0557('0x3b')](_0x1fc13f[_0x0557('0x34')][_0x0557('0x3b')]);_0x5cbcda[_0x0557('0x3c')]=qs['filters'](_['pick'](_0x1fc13f[_0x0557('0x34')],_0x285a3a[_0x0557('0x35')]));_0x5cbcda[_0x0557('0x6f')]=!![];if(_0x1fc13f[_0x0557('0x34')]['filter']){_0x5cbcda[_0x0557('0x3c')]=_[_0x0557('0x3e')](_0x5cbcda['where'],{'$or':_[_0x0557('0x2d')](_0x5cbcda[_0x0557('0x37')],function(_0x324cd9){var _0x4b4d31={};_0x4b4d31[_0x324cd9]={'$like':'%'+_0x1fc13f[_0x0557('0x34')]['filter']+'%'};return _0x4b4d31;})});}_0x5cbcda=_[_0x0557('0x3e')]({},_0x5cbcda,_0x1fc13f[_0x0557('0x41')]);return _0x227b3a[_0x0557('0x6a')](_0x5cbcda);}})[_0x0557('0x26')](respondWithResult(_0x4bfdf5,null))[_0x0557('0x49')](handleError(_0x4bfdf5,null));};exports[_0x0557('0x70')]=function(_0x4a4036,_0x424b99,_0x229e9a){var _0x2afe0c;var _0x2d2aaf;var _0x40fe35;var _0x4cd8fc=_0x4a4036['params']['id'];csv_results=[];return db[_0x0557('0x71')][_0x0557('0x5c')]({'attributes':['id',_0x0557('0x2a')],'raw':!![],'order':['OrderBy']})[_0x0557('0x26')](function(_0x11dd40){_0x2afe0c=_0x11dd40;var _0x23d7af=_[_0x0557('0x45')](db[_0x0557('0x5f')][_0x0557('0x2f')]);return db[_0x0557('0x6b')]['findAll']({'raw':!![],'attributes':['id',_0x0557('0x72')]})[_0x0557('0x26')](function(_0x90ff8c){_0x2d2aaf=_0x90ff8c;var _0x3829e8=squel[_0x0557('0x73')]()['fields'](_0x23d7af)[_0x0557('0x74')]('cm_contacts','c')[_0x0557('0x3c')](_0x0557('0x75'),_0x4cd8fc)['where'](_0x0557('0x76'))['distinct']();for(var _0x1d34e7=0x0;_0x1d34e7<_0x2d2aaf['length'];_0x1d34e7++){_0x3829e8[_0x0557('0x77')](_0x0557('0x78')+_0x2d2aaf[_0x1d34e7]['id'],_0x0557('0x79')+_0x2d2aaf[_0x1d34e7]['alias']);}for(var _0x1d34e7=0x0;_0x1d34e7<_0x2afe0c[_0x0557('0x46')];_0x1d34e7++){_0x3829e8[_0x0557('0x77')](squel[_0x0557('0x73')]()['field'](_0x0557('0x7a'))['from'](_0x0557('0x7b'))['where'](_0x0557('0x7c'),_0x2afe0c[_0x1d34e7]['id'])[_0x0557('0x3c')]('CmContactId\x20=\x20c.id'),_0x0557('0x7d')+_0x2afe0c[_0x1d34e7]['name']);_0x3829e8[_0x0557('0x77')](squel[_0x0557('0x73')]()[_0x0557('0x77')](_0x0557('0x7e'))[_0x0557('0x74')](_0x0557('0x7b'))[_0x0557('0x3c')](_0x0557('0x7c'),_0x2afe0c[_0x1d34e7]['id'])[_0x0557('0x3c')](_0x0557('0x7f')),_0x0557('0x80')+_0x2afe0c[_0x1d34e7][_0x0557('0x2a')]);}var _0x3b7156=[];_0x3b7156[_0x0557('0x66')](_0x3829e8[_0x0557('0x81')]());BPromise[_0x0557('0x63')](_0x3b7156,handleQuery)[_0x0557('0x26')](function(_0x5cfea1){handleQuery(_0x3829e8['toString']());var _0x924180=csv_results[0x0];if(!_['isEmpty'](_0x924180)){var _0x393ec6=toCsv(_0x924180);var _0x49ded6=Date[_0x0557('0x82')]();fs[_0x0557('0x83')](util[_0x0557('0x6e')](_0x0557('0x84'),_0x4cd8fc,_0x49ded6),_0x393ec6);_0x424b99[_0x0557('0x85')](_0x0557('0x86'),_0x0557('0x87')+util[_0x0557('0x6e')]('list_%d_%s.csv',_0x4cd8fc,_0x49ded6));_0x424b99[_0x0557('0x85')](_0x0557('0x88'),_0x0557('0x89'));return _0x424b99[_0x0557('0x8a')](util[_0x0557('0x6e')]('/tmp/list_%d_%s.csv',_0x4cd8fc,_0x49ded6));}else{return _0x424b99[_0x0557('0x1d')](0xcc);}});});});};exports['addCustomField']=function(_0x3e9c1e,_0x279d3b,_0x2b7e6d){var _0x590448;delete _0x3e9c1e[_0x0557('0x56')]['id'];return db[_0x0557('0x2e')][_0x0557('0x59')]({'where':{'id':_0x3e9c1e[_0x0557('0x44')]['id']}})['then'](handleEntityNotFound(_0x279d3b,null))['then'](function(_0x21f5f2){if(_0x21f5f2){return db['sequelize'][_0x0557('0x8b')](function(_0x1ae949){return db[_0x0557('0x6b')][_0x0557('0x4a')](_0x3e9c1e['body'],{'transaction':_0x1ae949})[_0x0557('0x26')](function(_0x58ca10){_0x590448=_0x58ca10;return _0x21f5f2['addCustomFields'](_0x58ca10,{'transaction':_0x1ae949});})[_0x0557('0x26')](function(){var _0x685042={'type':db['Sequelize'][_0x0557('0x8c')],'transaction':_0x1ae949};switch(_0x3e9c1e[_0x0557('0x56')][_0x0557('0x31')]){case _0x0557('0x8d'):_0x685042[_0x0557('0x31')]=db[_0x0557('0x8e')][_0x0557('0x8c')];break;case'number':_0x685042[_0x0557('0x31')]=db[_0x0557('0x8e')][_0x0557('0x8f')];break;case _0x0557('0x90'):_0x685042[_0x0557('0x31')]=db[_0x0557('0x8e')][_0x0557('0x91')];_0x685042[_0x0557('0x92')]=![];break;default:}return db[_0x0557('0x93')]['queryInterface'][_0x0557('0x94')](_0x0557('0x95'),util[_0x0557('0x6e')](_0x0557('0x96'),_0x590448['id']),_0x685042);})[_0x0557('0x26')](function(){return _0x590448;});});}})[_0x0557('0x26')](respondWithResult(_0x279d3b,null))[_0x0557('0x49')](handleError(_0x279d3b,null));};exports['getCustomFields']=function(_0xceb20a,_0x55e676,_0x42b6bb){var _0x14e8f4={};var _0xae1c17={};var _0x2a794b;var _0x3e95b6;return db['CmList'][_0x0557('0x59')]({'where':{'id':_0xceb20a['params']['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x55e676,null))[_0x0557('0x26')](function(_0x11fe48){if(_0x11fe48){_0x2a794b=_0x11fe48;_0xae1c17[_0x0557('0x33')]=_[_0x0557('0x45')](db[_0x0557('0x6b')][_0x0557('0x2f')]);_0xae1c17[_0x0557('0x34')]=_[_0x0557('0x45')](_0xceb20a['query']);_0xae1c17['filters']=_[_0x0557('0x36')](_0xae1c17[_0x0557('0x33')],_0xae1c17[_0x0557('0x34')]);_0x14e8f4[_0x0557('0x37')]=_['intersection'](_0xae1c17[_0x0557('0x33')],qs[_0x0557('0x38')](_0xceb20a[_0x0557('0x34')][_0x0557('0x38')]));_0x14e8f4[_0x0557('0x37')]=_0x14e8f4[_0x0557('0x37')][_0x0557('0x46')]?_0x14e8f4[_0x0557('0x37')]:_0xae1c17[_0x0557('0x33')];_0x14e8f4[_0x0557('0x3a')]=qs['sort'](_0xceb20a[_0x0557('0x34')][_0x0557('0x3b')]);_0x14e8f4['where']=qs[_0x0557('0x35')](_[_0x0557('0x3d')](_0xceb20a[_0x0557('0x34')],_0xae1c17['filters']));_0x14e8f4[_0x0557('0x3c')]=_[_0x0557('0x3e')](_0x14e8f4['where'],{'$or':[{'ListId':_0x11fe48['id']},{'ListId':null}]});if(_0xceb20a[_0x0557('0x34')][_0x0557('0x40')]){_0x14e8f4[_0x0557('0x3c')]=_[_0x0557('0x3e')](_0x14e8f4[_0x0557('0x3c')],{'$or':_['map'](_0x14e8f4[_0x0557('0x37')],function(_0x3eae06){var _0x2b9089={};_0x2b9089[_0x3eae06]={'$like':'%'+_0xceb20a[_0x0557('0x34')]['filter']+'%'};return _0x2b9089;})});}_0x14e8f4=_[_0x0557('0x3e')]({},_0x14e8f4,_0xceb20a[_0x0557('0x41')]);return db[_0x0557('0x6b')]['findAndCountAll'](_0x14e8f4);}})[_0x0557('0x26')](respondWithResult(_0x55e676,null))[_0x0557('0x49')](handleError(_0x55e676,null));};exports[_0x0557('0x97')]=function(_0x2c1c8a,_0xed600){return db['CmCustomField'][_0x0557('0x98')]({'where':{'ListId':null}})[_0x0557('0x26')](handleEntityNotFound(_0xed600,null))[_0x0557('0x26')](function(_0x4f2f8b){return _0x4f2f8b;})[_0x0557('0x26')](respondWithResult(_0xed600,null))[_0x0557('0x49')](handleError(_0xed600,null));};exports[_0x0557('0x99')]=function(_0x2af73b,_0xfe348e,_0x665a5e){return db['CmList'][_0x0557('0x48')]({'where':{'id':_0x2af73b[_0x0557('0x44')]['id']}})['then'](handleEntityNotFound(_0xfe348e,null))[_0x0557('0x26')](function(_0x38dd56){if(_0x38dd56){return _0x38dd56[_0x0557('0x99')](_0x2af73b[_0x0557('0x56')][_0x0557('0x65')],_[_0x0557('0x64')](_0x2af73b[_0x0557('0x56')],[_0x0557('0x65'),'id'])||{})[_0x0557('0x9a')](function(_0x3c7b37){for(var _0x1d4ece=0x0;_0x1d4ece<_0x2af73b[_0x0557('0x56')][_0x0557('0x65')][_0x0557('0x46')];_0x1d4ece+=0x1){socket['emit'](_0x0557('0x9b'),{'UserId':Number(_0x2af73b[_0x0557('0x56')][_0x0557('0x65')][_0x1d4ece]),'CmListId':Number(_0x2af73b[_0x0557('0x44')]['id'])});}return _0x3c7b37;});}})[_0x0557('0x26')](respondWithResult(_0xfe348e,null))[_0x0557('0x49')](handleError(_0xfe348e,null));};exports[_0x0557('0x9c')]=function(_0x11733b,_0xf83873,_0x20e538){return db[_0x0557('0x2e')][_0x0557('0x48')]({'where':{'id':_0x11733b[_0x0557('0x44')]['id']}})[_0x0557('0x26')](handleEntityNotFound(_0xf83873,null))['then'](function(_0x18bc09){if(_0x18bc09){return _0x18bc09[_0x0557('0x9c')](_0x11733b[_0x0557('0x34')][_0x0557('0x65')])['then'](function(){if(_['isArray'](_0x11733b[_0x0557('0x34')]['ids'])){for(var _0x169ac2=0x0;_0x169ac2<_0x11733b['query'][_0x0557('0x65')][_0x0557('0x46')];_0x169ac2+=0x1){socket[_0x0557('0x9d')](_0x0557('0x9e'),{'UserId':Number(_0x11733b[_0x0557('0x34')][_0x0557('0x65')][_0x169ac2]),'CmListId':Number(_0x11733b[_0x0557('0x44')]['id'])});}}else{socket[_0x0557('0x9d')](_0x0557('0x9e'),{'UserId':Number(_0x11733b[_0x0557('0x34')]['ids']),'CmListId':Number(_0x11733b['params']['id'])});}});}})[_0x0557('0x26')](respondWithStatusCode(_0xf83873,null))[_0x0557('0x49')](handleError(_0xf83873,null));};exports['getAgents']=function(_0x5ad610,_0x5d7b21,_0x383a91){var _0x37d107={};var _0x134b64={};var _0x5c0f7f;var _0x43ed88;return db[_0x0557('0x2e')][_0x0557('0x59')]({'where':{'id':_0x5ad610['params']['id']}})[_0x0557('0x26')](handleEntityNotFound(_0x5d7b21,null))['then'](function(_0x474af6){if(_0x474af6){_0x5c0f7f=_0x474af6;_0x134b64[_0x0557('0x33')]=_['keys'](db['User']['rawAttributes']);_0x134b64[_0x0557('0x34')]=_[_0x0557('0x45')](_0x5ad610[_0x0557('0x34')]);_0x134b64[_0x0557('0x35')]=_['intersection'](_0x134b64['model'],_0x134b64[_0x0557('0x34')]);_0x37d107[_0x0557('0x37')]=_[_0x0557('0x36')](_0x134b64[_0x0557('0x33')],qs['fields'](_0x5ad610['query'][_0x0557('0x38')]));_0x37d107['attributes']=_0x37d107[_0x0557('0x37')]['length']?_0x37d107[_0x0557('0x37')]:_0x134b64['model'];_0x37d107[_0x0557('0x3a')]=qs[_0x0557('0x3b')](_0x5ad610[_0x0557('0x34')][_0x0557('0x3b')]);_0x37d107[_0x0557('0x3c')]=qs['filters'](_['pick'](_0x5ad610['query'],_0x134b64[_0x0557('0x35')]));if(_0x5ad610[_0x0557('0x34')][_0x0557('0x40')]){_0x37d107[_0x0557('0x3c')]=_[_0x0557('0x3e')](_0x37d107['where'],{'$or':_[_0x0557('0x2d')](_0x37d107[_0x0557('0x37')],function(_0x490251){var _0x3885ca={};_0x3885ca[_0x490251]={'$like':'%'+_0x5ad610['query'][_0x0557('0x40')]+'%'};return _0x3885ca;})});}_0x37d107=_[_0x0557('0x3e')]({},_0x37d107,_0x5ad610[_0x0557('0x41')]);return _0x5c0f7f[_0x0557('0x9f')](_0x37d107);}})[_0x0557('0x26')](function(_0x312c2a){if(_0x312c2a){_0x43ed88=_0x312c2a[_0x0557('0x46')];if(!_0x5ad610[_0x0557('0x34')][_0x0557('0x39')](_0x0557('0x5a'))){_0x37d107[_0x0557('0x23')]=qs['limit'](_0x5ad610[_0x0557('0x34')]['limit']);_0x37d107[_0x0557('0x21')]=qs[_0x0557('0x21')](_0x5ad610[_0x0557('0x34')][_0x0557('0x21')]);}return _0x5c0f7f['getAgents'](_0x37d107);}})[_0x0557('0x26')](function(_0x4a6951){if(_0x4a6951){return _0x4a6951?{'count':_0x43ed88,'rows':_0x4a6951}:null;}})[_0x0557('0x26')](respondWithResult(_0x5d7b21,null))[_0x0557('0x49')](handleError(_0x5d7b21,null));};function handleQuery(_0x163892){logger['info'](_0x163892);return db[_0x0557('0x93')][_0x0557('0x34')](_0x163892)[_0x0557('0x9a')](function(_0x136443){csv_results['push'](_0x136443);})['catch'](function(_0x3aeba5){logger[_0x0557('0x53')](_0x3aeba5[_0x0557('0x68')]);});}
\ No newline at end of file
+var _0xe154=['success','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.ListId\x20=\x20?','distinct','field','c.cf_','customField_','alias','item','from','cm_contact_has_items','CmContactId\x20=\x20c.id','ItemTypeId\x20=\x20?','description_additionalPhone_','writeFileSync','/tmp/list_%d_%s.csv','attachment;\x20filename=','list_%d_%s.csv','setHeader','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cf_%s','getCustomFields','addAgents','spread','emit','isArray','userCmList:remove','getAgents','info','message','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error','stack','name','index','map','CmList','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Lists','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','CmContact','tags','join','push','each','omit'];(function(_0x5825a4,_0x588acc){var _0x46599b=function(_0x559185){while(--_0x559185){_0x5825a4['push'](_0x5825a4['shift']());}};_0x46599b(++_0x588acc);}(_0xe154,0xe2));var _0x4e15=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0xe154[_0x470b0a];return _0x4463f6;};'use strict';var emlformat=require(_0x4e15('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e15('0x1'));var jsonpatch=require(_0x4e15('0x2'));var rp=require(_0x4e15('0x3'));var moment=require(_0x4e15('0x4'));var BPromise=require(_0x4e15('0x5'));var Mustache=require('mustache');var util=require(_0x4e15('0x6'));var path=require(_0x4e15('0x7'));var sox=require(_0x4e15('0x8'));var csv=require(_0x4e15('0x9'));var ejs=require(_0x4e15('0xa'));var fs=require('fs');var fs_extra=require(_0x4e15('0xb'));var _=require(_0x4e15('0xc'));var squel=require(_0x4e15('0xd'));var crypto=require(_0x4e15('0xe'));var jsforce=require(_0x4e15('0xf'));var deskjs=require(_0x4e15('0x10'));var toCsv=require(_0x4e15('0x9'));var querystring=require(_0x4e15('0x11'));var Papa=require(_0x4e15('0x12'));var Redis=require(_0x4e15('0x13'));var authService=require(_0x4e15('0x14'));var qs=require(_0x4e15('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e15('0x16'));var logger=require(_0x4e15('0x17'))(_0x4e15('0x18'));var utils=require(_0x4e15('0x19'));var config=require(_0x4e15('0x1a'));var licenseUtil=require(_0x4e15('0x1b'));var db=require(_0x4e15('0x1c'))['db'];var csv_results;config['redis']=_[_0x4e15('0x1d')](config['redis'],{'host':_0x4e15('0x1e'),'port':0x18eb});var socket=require(_0x4e15('0x1f'))(new Redis(config[_0x4e15('0x20')]));require('./cmList.socket')[_0x4e15('0x21')](socket);function respondWithStatusCode(_0x4047ff,_0x3bcbb5){_0x3bcbb5=_0x3bcbb5||0xcc;return function(_0x501700){if(_0x501700){return _0x4047ff['sendStatus'](_0x3bcbb5);}return _0x4047ff[_0x4e15('0x22')](_0x3bcbb5)['end']();};}function respondWithResult(_0x4e3704,_0x2c35a7){_0x2c35a7=_0x2c35a7||0xc8;return function(_0x5e4f5e){if(_0x5e4f5e){return _0x4e3704[_0x4e15('0x22')](_0x2c35a7)[_0x4e15('0x23')](_0x5e4f5e);}};}function respondWithFilteredResult(_0x3d1c49,_0x159108){return function(_0xf3bc27){if(_0xf3bc27){var _0x10fb03=typeof _0x159108[_0x4e15('0x24')]===_0x4e15('0x25')&&typeof _0x159108[_0x4e15('0x26')]===_0x4e15('0x25');var _0x4bd8f6=_0xf3bc27[_0x4e15('0x27')];var _0x3cfa6a=_0x10fb03?0x0:_0x159108['offset'];var _0x43b2a2=_0x10fb03?_0xf3bc27[_0x4e15('0x27')]:_0x159108[_0x4e15('0x24')]+_0x159108[_0x4e15('0x26')];var _0x4a6384;if(_0x43b2a2>=_0x4bd8f6){_0x43b2a2=_0x4bd8f6;_0x4a6384=0xc8;}else{_0x4a6384=0xce;}_0x3d1c49['status'](_0x4a6384);return _0x3d1c49[_0x4e15('0x28')]('Content-Range',_0x3cfa6a+'-'+_0x43b2a2+'/'+_0x4bd8f6)[_0x4e15('0x23')](_0xf3bc27);}return null;};}function patchUpdates(_0x101b58){return function(_0x2979e0){try{jsonpatch[_0x4e15('0x29')](_0x2979e0,_0x101b58,!![]);}catch(_0x27a573){return BPromise[_0x4e15('0x2a')](_0x27a573);}return _0x2979e0[_0x4e15('0x2b')]();};}function saveUpdates(_0x17b2ba,_0x221293){return function(_0x524dfd){if(_0x524dfd){return _0x524dfd[_0x4e15('0x2c')](_0x17b2ba)[_0x4e15('0x2d')](function(_0x5c1692){return _0x5c1692;});}return null;};}function removeEntity(_0x3c4044,_0x55efbb){return function(_0x4e6d39){if(_0x4e6d39){return _0x4e6d39['destroy']()[_0x4e15('0x2d')](function(){var _0x3a569f=_0x4e6d39[_0x4e15('0x2e')]({'plain':!![]});var _0x3bf6a1='Lists';return db[_0x4e15('0x2f')][_0x4e15('0x30')]({'where':{'type':_0x3bf6a1,'resourceId':_0x3a569f['id']}})['then'](function(){return _0x4e6d39;});})[_0x4e15('0x2d')](function(){_0x3c4044['status'](0xcc)[_0x4e15('0x31')]();});}};}function handleEntityNotFound(_0x5181c6,_0x46f29a){return function(_0x526e26){if(!_0x526e26){_0x5181c6[_0x4e15('0x32')](0x194);}return _0x526e26;};}function handleError(_0xf76309,_0x320746){_0x320746=_0x320746||0x1f4;return function(_0x6a69d){logger[_0x4e15('0x33')](_0x6a69d[_0x4e15('0x34')]);if(_0x6a69d[_0x4e15('0x35')]){delete _0x6a69d['name'];}_0xf76309[_0x4e15('0x22')](_0x320746)['send'](_0x6a69d);};}exports[_0x4e15('0x36')]=function(_0x2eeef6,_0x3082c0){var _0x35ffe7={},_0x358311={},_0x17c06f={'count':0x0,'rows':[]};var _0x91aea8=_[_0x4e15('0x37')](db[_0x4e15('0x38')]['rawAttributes'],function(_0x19fee7){return{'name':_0x19fee7[_0x4e15('0x39')],'type':_0x19fee7[_0x4e15('0x3a')][_0x4e15('0x3b')]};});_0x358311[_0x4e15('0x3c')]=_[_0x4e15('0x37')](_0x91aea8,_0x4e15('0x35'));_0x358311[_0x4e15('0x3d')]=_[_0x4e15('0x3e')](_0x2eeef6['query']);_0x358311['filters']=_[_0x4e15('0x3f')](_0x358311[_0x4e15('0x3c')],_0x358311[_0x4e15('0x3d')]);_0x35ffe7[_0x4e15('0x40')]=_[_0x4e15('0x3f')](_0x358311['model'],qs[_0x4e15('0x41')](_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x41')]));_0x35ffe7[_0x4e15('0x40')]=_0x35ffe7[_0x4e15('0x40')][_0x4e15('0x42')]?_0x35ffe7[_0x4e15('0x40')]:_0x358311['model'];if(!_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x43')](_0x4e15('0x44'))){_0x35ffe7[_0x4e15('0x26')]=qs[_0x4e15('0x26')](_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x26')]);_0x35ffe7[_0x4e15('0x24')]=qs[_0x4e15('0x24')](_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x24')]);}_0x35ffe7[_0x4e15('0x45')]=qs[_0x4e15('0x46')](_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x46')]);_0x35ffe7[_0x4e15('0x47')]=qs[_0x4e15('0x48')](_[_0x4e15('0x49')](_0x2eeef6['query'],_0x358311[_0x4e15('0x48')]),_0x91aea8);if(_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x4a')]){_0x35ffe7['where']=_[_0x4e15('0x4b')](_0x35ffe7[_0x4e15('0x47')],{'$or':_[_0x4e15('0x37')](_0x91aea8,function(_0x433aca){if(_0x433aca[_0x4e15('0x3a')]!==_0x4e15('0x4c')){var _0x187fd6={};_0x187fd6[_0x433aca[_0x4e15('0x35')]]={'$like':'%'+_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x4a')]+'%'};return _0x187fd6;}})});}_0x35ffe7=_[_0x4e15('0x4b')]({},_0x35ffe7,_0x2eeef6[_0x4e15('0x4d')]);var _0x2ae639={'where':_0x35ffe7[_0x4e15('0x47')]};return db['CmList'][_0x4e15('0x27')](_0x2ae639)['then'](function(_0x3f512c){_0x17c06f[_0x4e15('0x27')]=_0x3f512c;if(_0x2eeef6[_0x4e15('0x3d')][_0x4e15('0x4e')]){_0x35ffe7[_0x4e15('0x4f')]=[{'all':!![]}];}return db[_0x4e15('0x38')]['findAll'](_0x35ffe7);})[_0x4e15('0x2d')](function(_0x16010a){_0x17c06f[_0x4e15('0x50')]=_0x16010a;return _0x17c06f;})[_0x4e15('0x2d')](respondWithFilteredResult(_0x3082c0,_0x35ffe7))[_0x4e15('0x51')](handleError(_0x3082c0,null));};exports[_0x4e15('0x52')]=function(_0x2898d4,_0x5e8b18){var _0x562c73={'raw':![],'where':{'id':_0x2898d4[_0x4e15('0x53')]['id']}},_0xa1f4f8={};_0xa1f4f8[_0x4e15('0x3c')]=_[_0x4e15('0x3e')](db[_0x4e15('0x38')][_0x4e15('0x54')]);_0xa1f4f8[_0x4e15('0x3d')]=_['keys'](_0x2898d4[_0x4e15('0x3d')]);_0xa1f4f8[_0x4e15('0x48')]=_[_0x4e15('0x3f')](_0xa1f4f8[_0x4e15('0x3c')],_0xa1f4f8[_0x4e15('0x3d')]);_0x562c73[_0x4e15('0x40')]=_[_0x4e15('0x3f')](_0xa1f4f8['model'],qs[_0x4e15('0x41')](_0x2898d4[_0x4e15('0x3d')][_0x4e15('0x41')]));_0x562c73[_0x4e15('0x40')]=_0x562c73['attributes'][_0x4e15('0x42')]?_0x562c73[_0x4e15('0x40')]:_0xa1f4f8[_0x4e15('0x3c')];if(_0x2898d4[_0x4e15('0x3d')][_0x4e15('0x4e')]){_0x562c73[_0x4e15('0x4f')]=[{'all':!![]}];}_0x562c73=_[_0x4e15('0x4b')]({},_0x562c73,_0x2898d4['options']);return db[_0x4e15('0x38')][_0x4e15('0x55')](_0x562c73)[_0x4e15('0x2d')](handleEntityNotFound(_0x5e8b18,null))[_0x4e15('0x2d')](respondWithResult(_0x5e8b18,null))[_0x4e15('0x51')](handleError(_0x5e8b18,null));};exports[_0x4e15('0x56')]=function(_0x4374da,_0x1f4f64){return db[_0x4e15('0x38')]['create'](_0x4374da[_0x4e15('0x57')],{})[_0x4e15('0x2d')](function(_0x2711ec){var _0x19df38=_0x4374da[_0x4e15('0x58')][_0x4e15('0x2e')]({'plain':!![]});if(!_0x19df38)throw new Error(_0x4e15('0x59'));if(_0x19df38[_0x4e15('0x5a')]==='user'){var _0x4e9504=_0x2711ec[_0x4e15('0x2e')]({'plain':!![]});var _0x1b4c5f=_0x4e15('0x5b');return db[_0x4e15('0x5c')][_0x4e15('0x55')]({'where':{'name':_0x1b4c5f,'userProfileId':_0x19df38[_0x4e15('0x5d')]},'raw':!![]})[_0x4e15('0x2d')](function(_0x34554d){if(_0x34554d&&_0x34554d[_0x4e15('0x5e')]===0x0){return db[_0x4e15('0x2f')][_0x4e15('0x56')]({'name':_0x4e9504[_0x4e15('0x35')],'resourceId':_0x4e9504['id'],'type':_0x34554d[_0x4e15('0x35')],'sectionId':_0x34554d['id']},{})[_0x4e15('0x2d')](function(){return _0x2711ec;});}else{return _0x2711ec;}})[_0x4e15('0x51')](function(_0x463cb8){logger[_0x4e15('0x33')](_0x4e15('0x5f'),_0x463cb8);throw _0x463cb8;});}return _0x2711ec;})[_0x4e15('0x2d')](respondWithResult(_0x1f4f64,0xc9))[_0x4e15('0x51')](handleError(_0x1f4f64,null));};exports['update']=function(_0x34471,_0x22ab74){if(_0x34471[_0x4e15('0x57')]['id']){delete _0x34471[_0x4e15('0x57')]['id'];}return db['CmList'][_0x4e15('0x55')]({'where':{'id':_0x34471[_0x4e15('0x53')]['id']}})['then'](handleEntityNotFound(_0x22ab74,null))['then'](saveUpdates(_0x34471[_0x4e15('0x57')],null))[_0x4e15('0x2d')](respondWithResult(_0x22ab74,null))[_0x4e15('0x51')](handleError(_0x22ab74,null));};exports[_0x4e15('0x30')]=function(_0xabf244,_0x4c7334){return db[_0x4e15('0x38')][_0x4e15('0x55')]({'where':{'id':_0xabf244[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x4c7334,null))['then'](removeEntity(_0x4c7334,null))[_0x4e15('0x51')](handleError(_0x4c7334,null));};exports[_0x4e15('0x60')]=function(_0x28c0bb,_0x21e514){return db['CmList']['describe']()[_0x4e15('0x2d')](respondWithResult(_0x21e514,null))[_0x4e15('0x51')](handleError(_0x21e514,null));};exports[_0x4e15('0x61')]=function(_0x4ab32b,_0x3ea0dc,_0x2f5f92){if(_0x4ab32b[_0x4e15('0x57')]['id']){delete _0x4ab32b[_0x4e15('0x57')]['id'];}return db[_0x4e15('0x38')][_0x4e15('0x55')]({'where':{'id':_0x4ab32b['params']['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x3ea0dc,null))['then'](function(_0x30a5ed){if(_0x30a5ed){_0x4ab32b[_0x4e15('0x57')][_0x4e15('0x62')]=_0x30a5ed['id'];return db[_0x4e15('0x63')][_0x4e15('0x56')](_0x4ab32b[_0x4e15('0x57')]);}})[_0x4e15('0x2d')](respondWithResult(_0x3ea0dc,null))[_0x4e15('0x51')](handleError(_0x3ea0dc,null));};exports[_0x4e15('0x64')]=function(_0x415f72,_0x40597a,_0x377529){var _0x4c4d9b={'raw':![],'where':{}};var _0x35ab55={};var _0x904cec={'count':0x0,'rows':[]};return db[_0x4e15('0x38')][_0x4e15('0x65')]({'where':{'id':_0x415f72[_0x4e15('0x53')]['id']}})['then'](handleEntityNotFound(_0x40597a,null))[_0x4e15('0x2d')](function(_0x3b8164){if(_0x3b8164){_0x35ab55[_0x4e15('0x3c')]=_[_0x4e15('0x3e')](db[_0x4e15('0x63')][_0x4e15('0x54')]);_0x35ab55[_0x4e15('0x3d')]=_['keys'](_0x415f72[_0x4e15('0x3d')]);_0x35ab55[_0x4e15('0x48')]=_[_0x4e15('0x3f')](_0x35ab55['model'],_0x35ab55['query']);_0x4c4d9b[_0x4e15('0x40')]=_[_0x4e15('0x3f')](_0x35ab55['model'],qs['fields'](_0x415f72[_0x4e15('0x3d')]['fields']));_0x4c4d9b[_0x4e15('0x40')]=_0x4c4d9b[_0x4e15('0x40')]['length']?_0x4c4d9b[_0x4e15('0x40')]:_0x35ab55[_0x4e15('0x3c')];if(!_0x415f72[_0x4e15('0x3d')][_0x4e15('0x43')](_0x4e15('0x44'))){_0x4c4d9b[_0x4e15('0x26')]=qs['limit'](_0x415f72['query'][_0x4e15('0x26')]);_0x4c4d9b[_0x4e15('0x24')]=qs['offset'](_0x415f72[_0x4e15('0x3d')][_0x4e15('0x24')]);}_0x4c4d9b[_0x4e15('0x45')]=qs[_0x4e15('0x46')](_0x415f72[_0x4e15('0x3d')]['sort']);_0x4c4d9b['where']=qs['filters'](_[_0x4e15('0x49')](_0x415f72[_0x4e15('0x3d')],_0x35ab55['filters']));_0x4c4d9b[_0x4e15('0x47')][_0x4e15('0x62')]=_0x3b8164['id'];if(_0x415f72[_0x4e15('0x3d')]['filter']){_0x4c4d9b[_0x4e15('0x47')]=_[_0x4e15('0x4b')](_0x4c4d9b['where'],{'$or':_[_0x4e15('0x37')](_0x4c4d9b['attributes'],function(_0x14f11b){var _0x260993={};_0x260993[_0x14f11b]={'$like':'%'+_0x415f72['query'][_0x4e15('0x4a')]+'%'};return _0x260993;})});}_0x4c4d9b=_[_0x4e15('0x4b')]({},_0x4c4d9b,_0x415f72[_0x4e15('0x4d')]);return db[_0x4e15('0x63')]['count']({'where':_0x4c4d9b[_0x4e15('0x47')]})[_0x4e15('0x2d')](function(_0x1d8816){_0x904cec[_0x4e15('0x27')]=_0x1d8816;if(_0x415f72[_0x4e15('0x3d')][_0x4e15('0x4e')]){_0x4c4d9b[_0x4e15('0x4f')]=[{'all':!![]}];}return db['Disposition'][_0x4e15('0x66')](_0x4c4d9b);})[_0x4e15('0x2d')](function(_0x24e364){_0x904cec[_0x4e15('0x50')]=_0x24e364;return _0x904cec;});}})[_0x4e15('0x2d')](respondWithFilteredResult(_0x40597a,_0x4c4d9b))[_0x4e15('0x51')](handleError(_0x40597a,null));};exports['removeDispositions']=function(_0x496b78,_0x43e5a1,_0x3cf2bd){return db[_0x4e15('0x38')][_0x4e15('0x55')]({'where':{'id':_0x496b78[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x43e5a1,null))[_0x4e15('0x2d')](function(_0x3b850e){if(_0x3b850e){return _0x3b850e[_0x4e15('0x67')](_0x496b78[_0x4e15('0x3d')][_0x4e15('0x68')]);}})[_0x4e15('0x2d')](respondWithStatusCode(_0x43e5a1,null))[_0x4e15('0x51')](handleError(_0x43e5a1,null));};exports[_0x4e15('0x69')]=function(_0x58dd09,_0x162ec8,_0x4b801e){return db[_0x4e15('0x38')][_0x4e15('0x55')]({'where':{'id':_0x58dd09[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x162ec8,null))[_0x4e15('0x2d')](function(_0x2243a2){if(_0x2243a2){var _0x8eb342=[];var _0x559669={'success':[],'errors':[]};return db[_0x4e15('0x6a')][_0x4e15('0x60')]()['then'](function(_0x3c515b){if(_0x58dd09['body'][_0x4e15('0x6b')]&&_['isArray'](_0x58dd09[_0x4e15('0x57')][_0x4e15('0x6b')])){if(_0x58dd09[_0x4e15('0x57')]['tags'][_0x4e15('0x42')]){_0x58dd09[_0x4e15('0x57')][_0x4e15('0x6b')]=_0x58dd09[_0x4e15('0x57')][_0x4e15('0x6b')][_0x4e15('0x6c')](';')+';';}else{_0x58dd09[_0x4e15('0x57')]['tags']=null;}}else{_0x58dd09[_0x4e15('0x57')][_0x4e15('0x6b')]=null;}if(_0x58dd09[_0x4e15('0x57')]&&_['isArray'](_0x58dd09[_0x4e15('0x57')])){for(var _0x1c34d3=0x0;_0x1c34d3<_0x58dd09[_0x4e15('0x57')][_0x4e15('0x42')];_0x1c34d3+=0x1){_0x58dd09[_0x4e15('0x57')][_0x1c34d3]['ListId']=_0x58dd09[_0x4e15('0x53')]['id'];_0x8eb342[_0x4e15('0x6d')](_0x58dd09['body'][_0x1c34d3]);}return BPromise[_0x4e15('0x6e')](_0x8eb342,function(_0x225f0f){return db[_0x4e15('0x6a')][_0x4e15('0x56')](_[_0x4e15('0x6f')](_0x225f0f,['ids','id'])||{},{'fields':_['keys'](_0x3c515b),'raw':!![]})[_0x4e15('0x2d')](function(_0x53752a){_0x559669[_0x4e15('0x70')]['push'](_0x53752a['dataValues']);})['catch'](function(_0x4475fb){_0x559669[_0x4e15('0x71')][_0x4e15('0x6d')]({'data':_0x225f0f,'error':_0x4475fb['message']});});})[_0x4e15('0x2d')](function(_0x19b19c){return _0x559669;})[_0x4e15('0x51')](function(_0x5cff17){return _0x5cff17;});}else{_0x162ec8[_0x4e15('0x22')](0x190)['json']({'message':_0x4e15('0x72')});}});}})[_0x4e15('0x2d')](respondWithResult(_0x162ec8,null))[_0x4e15('0x51')](handleError(_0x162ec8,null));};exports[_0x4e15('0x73')]=function(_0x3d05ec,_0x233316,_0x224f47){var _0x16985b;return db['CmList'][_0x4e15('0x55')]({'where':{'id':_0x3d05ec[_0x4e15('0x53')]['id']},'include':[{'model':db[_0x4e15('0x74')],'as':_0x4e15('0x75')}]})[_0x4e15('0x2d')](handleEntityNotFound(_0x233316,null))[_0x4e15('0x2d')](function(_0x35d1ec){if(_0x35d1ec){_0x16985b=_0x35d1ec;return db[_0x4e15('0x6a')][_0x4e15('0x54')];}})[_0x4e15('0x2d')](function(_0x930c9f){if(_0x930c9f){var _0x43a93c={};var _0x5cbccb={};_0x5cbccb[_0x4e15('0x3c')]=_[_0x4e15('0x76')](_['keys'](_0x930c9f),_[_0x4e15('0x37')](_0x16985b['CustomFields'],function(_0xbbb057){return util[_0x4e15('0x77')](_0x4e15('0x78'),_0xbbb057['id']);}));_0x5cbccb[_0x4e15('0x3d')]=_[_0x4e15('0x3e')](_0x3d05ec[_0x4e15('0x3d')]);_0x5cbccb[_0x4e15('0x48')]=_['intersection'](_0x5cbccb[_0x4e15('0x3c')],_0x5cbccb['query']);_0x43a93c[_0x4e15('0x40')]=_['intersection'](_0x5cbccb['model'],qs['fields'](_0x3d05ec['query'][_0x4e15('0x41')]));_0x43a93c[_0x4e15('0x40')]=_0x43a93c[_0x4e15('0x40')][_0x4e15('0x42')]?_0x43a93c['attributes']:_0x5cbccb[_0x4e15('0x3c')];if(!_0x3d05ec[_0x4e15('0x3d')][_0x4e15('0x43')](_0x4e15('0x44'))){_0x43a93c[_0x4e15('0x26')]=qs[_0x4e15('0x26')](_0x3d05ec['query'][_0x4e15('0x26')]);_0x43a93c[_0x4e15('0x24')]=qs[_0x4e15('0x24')](_0x3d05ec[_0x4e15('0x3d')][_0x4e15('0x24')]);}_0x43a93c['order']=qs['sort'](_0x3d05ec[_0x4e15('0x3d')]['sort']);_0x43a93c[_0x4e15('0x47')]=qs[_0x4e15('0x48')](_[_0x4e15('0x49')](_0x3d05ec[_0x4e15('0x3d')],_0x5cbccb[_0x4e15('0x48')]));_0x43a93c[_0x4e15('0x79')]=!![];if(_0x3d05ec['query'][_0x4e15('0x4a')]){_0x43a93c[_0x4e15('0x47')]=_[_0x4e15('0x4b')](_0x43a93c[_0x4e15('0x47')],{'$or':_[_0x4e15('0x37')](_0x43a93c[_0x4e15('0x40')],function(_0x48159d){var _0x5c1471={};_0x5c1471[_0x48159d]={'$like':'%'+_0x3d05ec[_0x4e15('0x3d')]['filter']+'%'};return _0x5c1471;})});}_0x43a93c=_['merge']({},_0x43a93c,_0x3d05ec[_0x4e15('0x4d')]);return _0x16985b['getContacts'](_0x43a93c);}})[_0x4e15('0x2d')](respondWithResult(_0x233316,null))['catch'](handleError(_0x233316,null));};exports[_0x4e15('0x7a')]=function(_0x333ea7,_0x3d758b,_0xe604f1){var _0x28c7ff;var _0x391c2a;var _0x41140d;var _0x693e3e=_0x333ea7['params']['id'];csv_results=[];return db[_0x4e15('0x7b')][_0x4e15('0x66')]({'attributes':['id','name'],'raw':!![],'order':[_0x4e15('0x7c')]})[_0x4e15('0x2d')](function(_0x1719a6){_0x28c7ff=_0x1719a6;var _0x5e1c8a=_['keys'](db['CmContact'][_0x4e15('0x54')]);return db[_0x4e15('0x74')][_0x4e15('0x66')]({'raw':!![],'attributes':['id','alias']})[_0x4e15('0x2d')](function(_0x2eb799){_0x391c2a=_0x2eb799;var _0x44d56a=squel[_0x4e15('0x7d')]()[_0x4e15('0x41')](_0x5e1c8a)['from'](_0x4e15('0x7e'),'c')['where'](_0x4e15('0x7f'),_0x693e3e)[_0x4e15('0x47')]('c.deletedAt\x20is\x20null')[_0x4e15('0x80')]();for(var _0x2641b1=0x0;_0x2641b1<_0x391c2a[_0x4e15('0x42')];_0x2641b1++){_0x44d56a[_0x4e15('0x81')](_0x4e15('0x82')+_0x391c2a[_0x2641b1]['id'],_0x4e15('0x83')+_0x391c2a[_0x2641b1][_0x4e15('0x84')]);}for(var _0x2641b1=0x0;_0x2641b1<_0x28c7ff[_0x4e15('0x42')];_0x2641b1++){_0x44d56a[_0x4e15('0x81')](squel[_0x4e15('0x7d')]()['field'](_0x4e15('0x85'))[_0x4e15('0x86')](_0x4e15('0x87'))[_0x4e15('0x47')]('ItemTypeId\x20=\x20?',_0x28c7ff[_0x2641b1]['id'])[_0x4e15('0x47')](_0x4e15('0x88')),'additionalPhone_'+_0x28c7ff[_0x2641b1]['name']);_0x44d56a[_0x4e15('0x81')](squel[_0x4e15('0x7d')]()[_0x4e15('0x81')]('description')[_0x4e15('0x86')](_0x4e15('0x87'))[_0x4e15('0x47')](_0x4e15('0x89'),_0x28c7ff[_0x2641b1]['id'])[_0x4e15('0x47')](_0x4e15('0x88')),_0x4e15('0x8a')+_0x28c7ff[_0x2641b1][_0x4e15('0x35')]);}var _0x3334c4=[];_0x3334c4[_0x4e15('0x6d')](_0x44d56a['toString']());BPromise[_0x4e15('0x6e')](_0x3334c4,handleQuery)['then'](function(_0x16d6e3){handleQuery(_0x44d56a['toString']());var _0x440bea=csv_results[0x0];if(!_['isEmpty'](_0x440bea)){var _0x3a9e9=toCsv(_0x440bea);var _0x2d932b=Date['now']();fs[_0x4e15('0x8b')](util[_0x4e15('0x77')](_0x4e15('0x8c'),_0x693e3e,_0x2d932b),_0x3a9e9);_0x3d758b['setHeader']('Content-disposition',_0x4e15('0x8d')+util['format'](_0x4e15('0x8e'),_0x693e3e,_0x2d932b));_0x3d758b[_0x4e15('0x8f')]('Content-type',_0x4e15('0x90'));return _0x3d758b[_0x4e15('0x91')](util[_0x4e15('0x77')]('/tmp/list_%d_%s.csv',_0x693e3e,_0x2d932b));}else{return _0x3d758b['sendStatus'](0xcc);}});});});};exports[_0x4e15('0x92')]=function(_0x5256f4,_0xaa666c,_0x273c3d){var _0x4fc940;delete _0x5256f4[_0x4e15('0x57')]['id'];return db[_0x4e15('0x38')][_0x4e15('0x65')]({'where':{'id':_0x5256f4[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0xaa666c,null))[_0x4e15('0x2d')](function(_0x5e9b84){if(_0x5e9b84){return db[_0x4e15('0x93')][_0x4e15('0x94')](function(_0x7709e0){return db[_0x4e15('0x74')][_0x4e15('0x56')](_0x5256f4[_0x4e15('0x57')],{'transaction':_0x7709e0})['then'](function(_0x5f530e){_0x4fc940=_0x5f530e;return _0x5e9b84[_0x4e15('0x95')](_0x5f530e,{'transaction':_0x7709e0});})[_0x4e15('0x2d')](function(){var _0x53f41a={'type':db[_0x4e15('0x96')][_0x4e15('0x97')],'transaction':_0x7709e0};switch(_0x5256f4[_0x4e15('0x57')]['type']){case _0x4e15('0x98'):_0x53f41a[_0x4e15('0x3a')]=db[_0x4e15('0x96')][_0x4e15('0x97')];break;case'number':_0x53f41a[_0x4e15('0x3a')]=db[_0x4e15('0x96')][_0x4e15('0x99')];break;case _0x4e15('0x9a'):_0x53f41a[_0x4e15('0x3a')]=db['Sequelize'][_0x4e15('0x9b')];_0x53f41a[_0x4e15('0x9c')]=![];break;default:}return db[_0x4e15('0x93')][_0x4e15('0x9d')][_0x4e15('0x9e')](_0x4e15('0x7e'),util['format'](_0x4e15('0x9f'),_0x4fc940['id']),_0x53f41a);})[_0x4e15('0x2d')](function(){return _0x4fc940;});});}})[_0x4e15('0x2d')](respondWithResult(_0xaa666c,null))[_0x4e15('0x51')](handleError(_0xaa666c,null));};exports[_0x4e15('0xa0')]=function(_0x58ad9a,_0x468ad5,_0x4e8a4c){var _0x12d5f8={};var _0x362ef6={};var _0x4e27d5;var _0x18b4df;return db[_0x4e15('0x38')][_0x4e15('0x65')]({'where':{'id':_0x58ad9a[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x468ad5,null))[_0x4e15('0x2d')](function(_0x5f1f63){if(_0x5f1f63){_0x4e27d5=_0x5f1f63;_0x362ef6[_0x4e15('0x3c')]=_[_0x4e15('0x3e')](db[_0x4e15('0x74')][_0x4e15('0x54')]);_0x362ef6['query']=_[_0x4e15('0x3e')](_0x58ad9a[_0x4e15('0x3d')]);_0x362ef6[_0x4e15('0x48')]=_[_0x4e15('0x3f')](_0x362ef6[_0x4e15('0x3c')],_0x362ef6[_0x4e15('0x3d')]);_0x12d5f8[_0x4e15('0x40')]=_[_0x4e15('0x3f')](_0x362ef6[_0x4e15('0x3c')],qs[_0x4e15('0x41')](_0x58ad9a['query'][_0x4e15('0x41')]));_0x12d5f8[_0x4e15('0x40')]=_0x12d5f8[_0x4e15('0x40')][_0x4e15('0x42')]?_0x12d5f8['attributes']:_0x362ef6[_0x4e15('0x3c')];_0x12d5f8[_0x4e15('0x45')]=qs[_0x4e15('0x46')](_0x58ad9a['query'][_0x4e15('0x46')]);_0x12d5f8['where']=qs['filters'](_['pick'](_0x58ad9a[_0x4e15('0x3d')],_0x362ef6[_0x4e15('0x48')]));_0x12d5f8[_0x4e15('0x47')]=_['merge'](_0x12d5f8['where'],{'$or':[{'ListId':_0x5f1f63['id']},{'ListId':null}]});if(_0x58ad9a['query'][_0x4e15('0x4a')]){_0x12d5f8[_0x4e15('0x47')]=_['merge'](_0x12d5f8[_0x4e15('0x47')],{'$or':_[_0x4e15('0x37')](_0x12d5f8[_0x4e15('0x40')],function(_0x548f7b){var _0x529915={};_0x529915[_0x548f7b]={'$like':'%'+_0x58ad9a[_0x4e15('0x3d')][_0x4e15('0x4a')]+'%'};return _0x529915;})});}_0x12d5f8=_[_0x4e15('0x4b')]({},_0x12d5f8,_0x58ad9a[_0x4e15('0x4d')]);return db['CmCustomField']['findAndCountAll'](_0x12d5f8);}})[_0x4e15('0x2d')](respondWithResult(_0x468ad5,null))['catch'](handleError(_0x468ad5,null));};exports['getGlobalCustomFields']=function(_0x3dc41a,_0x254107){return db[_0x4e15('0x74')]['findAndCountAll']({'where':{'ListId':null}})[_0x4e15('0x2d')](handleEntityNotFound(_0x254107,null))[_0x4e15('0x2d')](function(_0x372aee){return _0x372aee;})[_0x4e15('0x2d')](respondWithResult(_0x254107,null))['catch'](handleError(_0x254107,null));};exports[_0x4e15('0xa1')]=function(_0x54e7ae,_0x1fc41d,_0x4542d9){return db['CmList']['find']({'where':{'id':_0x54e7ae[_0x4e15('0x53')]['id']}})[_0x4e15('0x2d')](handleEntityNotFound(_0x1fc41d,null))[_0x4e15('0x2d')](function(_0xc65b01){if(_0xc65b01){return _0xc65b01[_0x4e15('0xa1')](_0x54e7ae['body'][_0x4e15('0x68')],_['omit'](_0x54e7ae['body'],['ids','id'])||{})[_0x4e15('0xa2')](function(_0x59b92){for(var _0x366f09=0x0;_0x366f09<_0x54e7ae[_0x4e15('0x57')][_0x4e15('0x68')]['length'];_0x366f09+=0x1){socket[_0x4e15('0xa3')]('userCmList:save',{'UserId':Number(_0x54e7ae['body'][_0x4e15('0x68')][_0x366f09]),'CmListId':Number(_0x54e7ae['params']['id'])});}return _0x59b92;});}})[_0x4e15('0x2d')](respondWithResult(_0x1fc41d,null))['catch'](handleError(_0x1fc41d,null));};exports['removeAgents']=function(_0x212e9c,_0x29a05a,_0x18dbce){return db[_0x4e15('0x38')]['find']({'where':{'id':_0x212e9c['params']['id']}})['then'](handleEntityNotFound(_0x29a05a,null))[_0x4e15('0x2d')](function(_0x3f1a24){if(_0x3f1a24){return _0x3f1a24['removeAgents'](_0x212e9c[_0x4e15('0x3d')][_0x4e15('0x68')])[_0x4e15('0x2d')](function(){if(_[_0x4e15('0xa4')](_0x212e9c['query'][_0x4e15('0x68')])){for(var _0x171f2e=0x0;_0x171f2e<_0x212e9c[_0x4e15('0x3d')][_0x4e15('0x68')]['length'];_0x171f2e+=0x1){socket['emit'](_0x4e15('0xa5'),{'UserId':Number(_0x212e9c['query'][_0x4e15('0x68')][_0x171f2e]),'CmListId':Number(_0x212e9c[_0x4e15('0x53')]['id'])});}}else{socket[_0x4e15('0xa3')](_0x4e15('0xa5'),{'UserId':Number(_0x212e9c[_0x4e15('0x3d')][_0x4e15('0x68')]),'CmListId':Number(_0x212e9c[_0x4e15('0x53')]['id'])});}});}})[_0x4e15('0x2d')](respondWithStatusCode(_0x29a05a,null))['catch'](handleError(_0x29a05a,null));};exports[_0x4e15('0xa6')]=function(_0x4a3b02,_0x5bb763,_0x4d8578){var _0xf9c1b={};var _0x548472={};var _0x2a4221;var _0x549f2b;return db[_0x4e15('0x38')][_0x4e15('0x65')]({'where':{'id':_0x4a3b02[_0x4e15('0x53')]['id']}})['then'](handleEntityNotFound(_0x5bb763,null))[_0x4e15('0x2d')](function(_0x45f6fa){if(_0x45f6fa){_0x2a4221=_0x45f6fa;_0x548472[_0x4e15('0x3c')]=_[_0x4e15('0x3e')](db['User']['rawAttributes']);_0x548472['query']=_[_0x4e15('0x3e')](_0x4a3b02['query']);_0x548472['filters']=_[_0x4e15('0x3f')](_0x548472[_0x4e15('0x3c')],_0x548472['query']);_0xf9c1b[_0x4e15('0x40')]=_[_0x4e15('0x3f')](_0x548472[_0x4e15('0x3c')],qs['fields'](_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x41')]));_0xf9c1b[_0x4e15('0x40')]=_0xf9c1b[_0x4e15('0x40')][_0x4e15('0x42')]?_0xf9c1b[_0x4e15('0x40')]:_0x548472[_0x4e15('0x3c')];_0xf9c1b[_0x4e15('0x45')]=qs['sort'](_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x46')]);_0xf9c1b['where']=qs[_0x4e15('0x48')](_[_0x4e15('0x49')](_0x4a3b02[_0x4e15('0x3d')],_0x548472[_0x4e15('0x48')]));if(_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x4a')]){_0xf9c1b['where']=_[_0x4e15('0x4b')](_0xf9c1b[_0x4e15('0x47')],{'$or':_[_0x4e15('0x37')](_0xf9c1b[_0x4e15('0x40')],function(_0x125a8e){var _0x3d4bf6={};_0x3d4bf6[_0x125a8e]={'$like':'%'+_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x4a')]+'%'};return _0x3d4bf6;})});}_0xf9c1b=_['merge']({},_0xf9c1b,_0x4a3b02[_0x4e15('0x4d')]);return _0x2a4221[_0x4e15('0xa6')](_0xf9c1b);}})[_0x4e15('0x2d')](function(_0x29872f){if(_0x29872f){_0x549f2b=_0x29872f['length'];if(!_0x4a3b02[_0x4e15('0x3d')]['hasOwnProperty'](_0x4e15('0x44'))){_0xf9c1b[_0x4e15('0x26')]=qs['limit'](_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x26')]);_0xf9c1b[_0x4e15('0x24')]=qs['offset'](_0x4a3b02[_0x4e15('0x3d')][_0x4e15('0x24')]);}return _0x2a4221[_0x4e15('0xa6')](_0xf9c1b);}})[_0x4e15('0x2d')](function(_0x5451ae){if(_0x5451ae){return _0x5451ae?{'count':_0x549f2b,'rows':_0x5451ae}:null;}})[_0x4e15('0x2d')](respondWithResult(_0x5bb763,null))['catch'](handleError(_0x5bb763,null));};function handleQuery(_0x3f5910){logger[_0x4e15('0xa7')](_0x3f5910);return db[_0x4e15('0x93')][_0x4e15('0x3d')](_0x3f5910)[_0x4e15('0xa2')](function(_0x4d03ba){csv_results[_0x4e15('0x6d')](_0x4d03ba);})[_0x4e15('0x51')](function(_0x209278){logger['error'](_0x209278[_0x4e15('0xa8')]);});}
\ No newline at end of file
index d700311..6d98a5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xe14b,0x93));var _0xbe14=function(_0x208563,_0x13a4c9){_0x208563=_0x208563-0x0;var _0x27a3d3=_0xe14b[_0x208563];return _0x27a3d3;};'use strict';var EventEmitter=require(_0xbe14('0x0'));var CmList=require(_0xbe14('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe14('0x2'),'afterUpdate':_0xbe14('0x3'),'afterDestroy':'remove'};function emitEvent(_0x7d3665){return function(_0x5ce8fb,_0x496c04,_0x1833e3){CmListEvents[_0xbe14('0x4')](_0x7d3665+':'+_0x5ce8fb['id'],_0x5ce8fb);CmListEvents[_0xbe14('0x4')](_0x7d3665,_0x5ce8fb);_0x1833e3(null);};}for(var e in events){if(events[_0xbe14('0x5')](e)){var event=events[e];CmList[_0xbe14('0x6')](e,emitEvent(event));}}module[_0xbe14('0x7')]=CmListEvents;
\ No newline at end of file
+var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x5310b4,_0x3c021a){var _0x3502a5=function(_0x3a595c){while(--_0x3a595c){_0x5310b4['push'](_0x5310b4['shift']());}};_0x3502a5(++_0x3c021a);}(_0x814b,0x1a2));var _0xb814=function(_0x22093a,_0xa7acf1){_0x22093a=_0x22093a-0x0;var _0x2f4989=_0x814b[_0x22093a];return _0x2f4989;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents;
\ No newline at end of file
index e4d9712..20ac844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CmList','cm_lists','lodash'];(function(_0x238b45,_0x441db4){var _0x478fa4=function(_0x281f5c){while(--_0x281f5c){_0x238b45['push'](_0x238b45['shift']());}};_0x478fa4(++_0x441db4);}(_0xdace,0xc5));var _0xedac=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0xdace[_0x172133];return _0x2460e5;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./cmList.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2547=['rimraf','./cmList.attributes','exports','CmList','cm_lists','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4c67d6,_0x53c14f){var _0x563c77=function(_0x10b0c3){while(--_0x10b0c3){_0x4c67d6['push'](_0x4c67d6['shift']());}};_0x563c77(++_0x53c14f);}(_0x2547,0x1cd));var _0x7254=function(_0x311902,_0x1309a1){_0x311902=_0x311902-0x0;var _0x20da6a=_0x2547[_0x311902];return _0x20da6a;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3397827..7da7eb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef7b=['redis','defaults','localhost','register','request','then','info','CmList,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1161da,_0x501e4f){var _0x5ac792=function(_0xd02cb6){while(--_0xd02cb6){_0x1161da['push'](_0x1161da['shift']());}};_0x5ac792(++_0x501e4f);}(_0xef7b,0x12e));var _0xbef7=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xef7b[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xbef7('0x0'));var util=require(_0xbef7('0x1'));var moment=require(_0xbef7('0x2'));var BPromise=require('bluebird');var rs=require(_0xbef7('0x3'));var fs=require('fs');var Redis=require(_0xbef7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbef7('0x5'));var logger=require(_0xbef7('0x6'))(_0xbef7('0x7'));var config=require('../../config/environment');var jayson=require(_0xbef7('0x8'));var client=jayson[_0xbef7('0x9')]['http']({'port':0x232a});config[_0xbef7('0xa')]=_[_0xbef7('0xb')](config[_0xbef7('0xa')],{'host':_0xbef7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbef7('0xa')]));require('./cmList.socket')[_0xbef7('0xd')](socket);function respondWithRpcPromise(_0x281004,_0x54e071,_0x26af2d){return new BPromise(function(_0x10d423,_0x4db9b3){return client[_0xbef7('0xe')](_0x281004,_0x26af2d)[_0xbef7('0xf')](function(_0x2bc21c){logger[_0xbef7('0x10')](_0xbef7('0x11'),_0x54e071,'request\x20sent');logger[_0xbef7('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x54e071,'request\x20sent',JSON[_0xbef7('0x13')](_0x2bc21c));if(_0x2bc21c[_0xbef7('0x14')]){if(_0x2bc21c[_0xbef7('0x14')][_0xbef7('0x15')]===0x1f4){logger[_0xbef7('0x14')](_0xbef7('0x11'),_0x54e071,_0x2bc21c[_0xbef7('0x14')][_0xbef7('0x16')]);return _0x4db9b3(_0x2bc21c['error'][_0xbef7('0x16')]);}logger[_0xbef7('0x14')](_0xbef7('0x11'),_0x54e071,_0x2bc21c[_0xbef7('0x14')][_0xbef7('0x16')]);return _0x10d423(_0x2bc21c[_0xbef7('0x14')]['message']);}else{logger[_0xbef7('0x10')](_0xbef7('0x11'),_0x54e071,_0xbef7('0x17'));_0x10d423(_0x2bc21c[_0xbef7('0x18')][_0xbef7('0x16')]);}})[_0xbef7('0x19')](function(_0x332994){logger['error'](_0xbef7('0x11'),_0x54e071,_0x332994);_0x4db9b3(_0x332994);});});}
\ No newline at end of file
+var _0x49e1=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error','code','CmList,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x461a2a,_0x3e3188){var _0x5d37c1=function(_0x46b751){while(--_0x46b751){_0x461a2a['push'](_0x461a2a['shift']());}};_0x5d37c1(++_0x3e3188);}(_0x49e1,0xf5));var _0x149e=function(_0x363816,_0xc20c5a){_0x363816=_0x363816-0x0;var _0x368201=_0x49e1[_0x363816];return _0x368201;};'use strict';var _=require(_0x149e('0x0'));var util=require('util');var moment=require(_0x149e('0x1'));var BPromise=require('bluebird');var rs=require(_0x149e('0x2'));var fs=require('fs');var Redis=require(_0x149e('0x3'));var db=require(_0x149e('0x4'))['db'];var utils=require(_0x149e('0x5'));var logger=require(_0x149e('0x6'))(_0x149e('0x7'));var config=require('../../config/environment');var jayson=require(_0x149e('0x8'));var client=jayson[_0x149e('0x9')][_0x149e('0xa')]({'port':0x232a});config[_0x149e('0xb')]=_[_0x149e('0xc')](config[_0x149e('0xb')],{'host':_0x149e('0xd'),'port':0x18eb});var socket=require(_0x149e('0xe'))(new Redis(config['redis']));require(_0x149e('0xf'))['register'](socket);function respondWithRpcPromise(_0x316d4d,_0x574d25,_0x2308be){return new BPromise(function(_0x22cc76,_0x4d8298){return client['request'](_0x316d4d,_0x2308be)['then'](function(_0x57534a){logger[_0x149e('0x10')]('CmList,\x20%s,\x20%s',_0x574d25,_0x149e('0x11'));logger[_0x149e('0x12')](_0x149e('0x13'),_0x574d25,_0x149e('0x11'),JSON['stringify'](_0x57534a));if(_0x57534a[_0x149e('0x14')]){if(_0x57534a[_0x149e('0x14')][_0x149e('0x15')]===0x1f4){logger[_0x149e('0x14')](_0x149e('0x16'),_0x574d25,_0x57534a['error'][_0x149e('0x17')]);return _0x4d8298(_0x57534a[_0x149e('0x14')]['message']);}logger[_0x149e('0x14')](_0x149e('0x16'),_0x574d25,_0x57534a[_0x149e('0x14')]['message']);return _0x22cc76(_0x57534a[_0x149e('0x14')]['message']);}else{logger[_0x149e('0x10')](_0x149e('0x16'),_0x574d25,_0x149e('0x11'));_0x22cc76(_0x57534a[_0x149e('0x18')][_0x149e('0x17')]);}})['catch'](function(_0x245ffc){logger[_0x149e('0x14')](_0x149e('0x16'),_0x574d25,_0x245ffc);_0x4d8298(_0x245ffc);});});}
\ No newline at end of file
index aacd7f6..4a8ac94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8047=['remove','removeListener','register','length','./cmList.events','save'];(function(_0x4bbc3a,_0x3a6945){var _0x579d56=function(_0x5977f6){while(--_0x5977f6){_0x4bbc3a['push'](_0x4bbc3a['shift']());}};_0x579d56(++_0x3a6945);}(_0x8047,0x7c));var _0x7804=function(_0x237836,_0x5c9545){_0x237836=_0x237836-0x0;var _0x57806b=_0x8047[_0x237836];return _0x57806b;};'use strict';var CmListEvents=require(_0x7804('0x0'));var events=[_0x7804('0x1'),_0x7804('0x2'),'update'];function createListener(_0x3f7372,_0x1b26a6){return function(_0x1647f6){_0x1b26a6['emit'](_0x3f7372,_0x1647f6);};}function removeListener(_0x5ee9f6,_0xd609ea){return function(){CmListEvents[_0x7804('0x3')](_0x5ee9f6,_0xd609ea);};}exports[_0x7804('0x4')]=function(_0x53f236){for(var _0x43f8ac=0x0,_0x46653f=events[_0x7804('0x5')];_0x43f8ac<_0x46653f;_0x43f8ac++){var _0x1aaa8b=events[_0x43f8ac];var _0x436b4a=createListener('cmList:'+_0x1aaa8b,_0x53f236);CmListEvents['on'](_0x1aaa8b,_0x436b4a);}};
\ No newline at end of file
+var _0x71b4=['removeListener','register','length','cmList:','./cmList.events','update','emit'];(function(_0x5da353,_0x5705ed){var _0x30b393=function(_0x151b07){while(--_0x151b07){_0x5da353['push'](_0x5da353['shift']());}};_0x30b393(++_0x5705ed);}(_0x71b4,0xd6));var _0x471b=function(_0x5102eb,_0x73cfe5){_0x5102eb=_0x5102eb-0x0;var _0x36bae9=_0x71b4[_0x5102eb];return _0x36bae9;};'use strict';var CmListEvents=require(_0x471b('0x0'));var events=['save','remove',_0x471b('0x1')];function createListener(_0x43ae46,_0x55b15b){return function(_0x141d31){_0x55b15b[_0x471b('0x2')](_0x43ae46,_0x141d31);};}function removeListener(_0x7ece14,_0x160d53){return function(){CmListEvents[_0x471b('0x3')](_0x7ece14,_0x160d53);};}exports[_0x471b('0x4')]=function(_0x255b32){for(var _0x30f93f=0x0,_0x1b7be3=events[_0x471b('0x5')];_0x30f93f<_0x1b7be3;_0x30f93f++){var _0x44e272=events[_0x30f93f];var _0x4ea0f5=createListener(_0x471b('0x6')+_0x44e272,_0x255b32);CmListEvents['on'](_0x44e272,_0x4ea0f5);}};
\ No newline at end of file
index f8bcbb2..d405053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ccf=['/:id/dispositions','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/contacts','/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','create','addDisposition','/:id/fields','addCustomField','addAgents','put','update','destroy','delete'];(function(_0x1e0ea1,_0x1af809){var _0x29a83a=function(_0x4374a3){while(--_0x4374a3){_0x1e0ea1['push'](_0x1e0ea1['shift']());}};_0x29a83a(++_0x1af809);}(_0x5ccf,0xe9));var _0xf5cc=function(_0x5af826,_0x52af90){_0x5af826=_0x5af826-0x0;var _0x573a26=_0x5ccf[_0x5af826];return _0x573a26;};'use strict';var multer=require('multer');var util=require(_0xf5cc('0x0'));var path=require('path');var timeout=require(_0xf5cc('0x1'));var express=require('express');var router=express[_0xf5cc('0x2')]();var fs_extra=require(_0xf5cc('0x3'));var auth=require(_0xf5cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf5cc('0x5'));var controller=require(_0xf5cc('0x6'));router['get']('/',auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x8')]);router[_0xf5cc('0x9')](_0xf5cc('0xa'),auth[_0xf5cc('0x7')](),controller['describe']);router['get'](_0xf5cc('0xb'),auth[_0xf5cc('0x7')](),controller[_0xf5cc('0xc')]);router[_0xf5cc('0x9')](_0xf5cc('0xd'),auth['isAuthenticated'](),controller[_0xf5cc('0xe')]);router[_0xf5cc('0x9')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xf5cc('0x9')](_0xf5cc('0xf'),auth[_0xf5cc('0x7')](),controller['getContacts']);router[_0xf5cc('0x9')](_0xf5cc('0x10'),auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x11')]);router[_0xf5cc('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xf5cc('0x12')]);router[_0xf5cc('0x9')](_0xf5cc('0x13'),auth['isAuthenticated'](),controller[_0xf5cc('0x14')]);router[_0xf5cc('0x15')]('/',auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x16')]);router[_0xf5cc('0x15')]('/:id/dispositions',auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x17')]);router[_0xf5cc('0x15')](_0xf5cc('0xf'),auth[_0xf5cc('0x7')](),controller['addContacts']);router['post'](_0xf5cc('0x18'),auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x19')]);router[_0xf5cc('0x15')](_0xf5cc('0x13'),auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x1a')]);router[_0xf5cc('0x1b')]('/:id',auth[_0xf5cc('0x7')](),controller[_0xf5cc('0x1c')]);router['delete'](_0xf5cc('0xd'),auth['isAuthenticated'](),controller[_0xf5cc('0x1d')]);router[_0xf5cc('0x1e')](_0xf5cc('0x1f'),auth[_0xf5cc('0x7')](),controller['removeDispositions']);router['delete'](_0xf5cc('0x13'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xf5cc('0x20')]=router;
\ No newline at end of file
+var _0xa9ed=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','addCustomField','/:id/users','addAgents','delete','destroy','removeDispositions','removeAgents'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa9ed,0x187));var _0xda9e=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0xa9ed[_0x2a9f4];return _0x3c39e0;};'use strict';var multer=require(_0xda9e('0x0'));var util=require(_0xda9e('0x1'));var path=require(_0xda9e('0x2'));var timeout=require(_0xda9e('0x3'));var express=require(_0xda9e('0x4'));var router=express['Router']();var fs_extra=require(_0xda9e('0x5'));var auth=require(_0xda9e('0x6'));var interaction=require(_0xda9e('0x7'));var config=require(_0xda9e('0x8'));var controller=require(_0xda9e('0x9'));router[_0xda9e('0xa')]('/',auth[_0xda9e('0xb')](),controller[_0xda9e('0xc')]);router[_0xda9e('0xa')](_0xda9e('0xd'),auth[_0xda9e('0xb')](),controller[_0xda9e('0xe')]);router['get'](_0xda9e('0xf'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x10')]);router[_0xda9e('0xa')](_0xda9e('0x11'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x12')]);router['get'](_0xda9e('0x13'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x14')]);router[_0xda9e('0xa')](_0xda9e('0x15'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x16')]);router[_0xda9e('0xa')]('/:id/contacts/csv',auth['isAuthenticated'](),controller[_0xda9e('0x17')]);router[_0xda9e('0xa')](_0xda9e('0x18'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x19')]);router[_0xda9e('0xa')]('/:id/users',auth[_0xda9e('0xb')](),controller[_0xda9e('0x1a')]);router[_0xda9e('0x1b')]('/',auth[_0xda9e('0xb')](),controller[_0xda9e('0x1c')]);router[_0xda9e('0x1b')](_0xda9e('0x13'),auth['isAuthenticated'](),controller[_0xda9e('0x1d')]);router[_0xda9e('0x1b')](_0xda9e('0x15'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x1e')]);router['post'](_0xda9e('0x18'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x1f')]);router[_0xda9e('0x1b')](_0xda9e('0x20'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x21')]);router['put']('/:id',auth[_0xda9e('0xb')](),controller['update']);router[_0xda9e('0x22')](_0xda9e('0x11'),auth[_0xda9e('0xb')](),controller[_0xda9e('0x23')]);router[_0xda9e('0x22')]('/:id/dispositions',auth[_0xda9e('0xb')](),controller[_0xda9e('0x24')]);router[_0xda9e('0x22')]('/:id/users',auth[_0xda9e('0xb')](),controller[_0xda9e('0x25')]);module[_0xda9e('0x26')]=router;
\ No newline at end of file
index 8824658..c38d609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb373=['exports','VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0x360ec,_0x585d47){var _0xf03953=function(_0xf081db){while(--_0xf081db){_0x360ec['push'](_0x360ec['shift']());}};_0xf03953(++_0x585d47);}(_0xb373,0x1a9));var _0x3b37=function(_0x18bc6f,_0x385d0f){_0x18bc6f=_0x18bc6f-0x0;var _0x443e56=_0xb373[_0x18bc6f];return _0x443e56;};'use strict';var Sequelize=require(_0x3b37('0x0'));module[_0x3b37('0x1')]={'name':{'type':Sequelize[_0x3b37('0x2')],'get':function(_0x3addb4){return this[_0x3b37('0x3')](_0x3b37('0x4'));}},'field':{'type':Sequelize[_0x3b37('0x5')],'allowNull':![]},'operator':{'type':Sequelize[_0x3b37('0x5')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x4370=['exports','VIRTUAL','field','STRING','sequelize'];(function(_0x231be4,_0x2954a5){var _0x50ca1f=function(_0x168e06){while(--_0x168e06){_0x231be4['push'](_0x231be4['shift']());}};_0x50ca1f(++_0x2954a5);}(_0x4370,0x16c));var _0x0437=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0x4370[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x0437('0x0'));module[_0x0437('0x1')]={'name':{'type':Sequelize[_0x0437('0x2')],'get':function(_0x1e5372){return this['getDataValue'](_0x0437('0x3'));}},'field':{'type':Sequelize[_0x0437('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x0437('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0437('0x4')],'allowNull':![]}};
\ No newline at end of file
index d61da0b..50ab791 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x4f9192,_0x347a12){var _0x14d3fc=function(_0x25c3a4){while(--_0x25c3a4){_0x4f9192['push'](_0x4f9192['shift']());}};_0x14d3fc(++_0x347a12);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5884b6,_0x5def6c){var _0x38ce0e=function(_0x478e7b){while(--_0x478e7b){_0x5884b6['push'](_0x5884b6['shift']());}};_0x38ce0e(++_0x5def6c);}(_0x7a54,0x106));var _0x47a5=function(_0x4b681a,_0x403e01){_0x4b681a=_0x4b681a-0x0;var _0x5127ec=_0x7a54[_0x4b681a];return _0x5127ec;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index c7b2168..92fdf32 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc23=['path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','api','bluebird','request-promise'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xfc23,0x157));var _0x3fc2=function(_0x32e1c5,_0xd68285){_0x32e1c5=_0x32e1c5-0x0;var _0x49e016=_0xfc23[_0x32e1c5];return _0x49e016;};'use strict';var _=require(_0x3fc2('0x0'));var util=require(_0x3fc2('0x1'));var logger=require('../../config/logger')(_0x3fc2('0x2'));var moment=require('moment');var BPromise=require(_0x3fc2('0x3'));var rp=require(_0x3fc2('0x4'));var fs=require('fs');var path=require(_0x3fc2('0x5'));var rimraf=require(_0x3fc2('0x6'));var config=require('../../config/environment');var attributes=require(_0x3fc2('0x7'));module[_0x3fc2('0x8')]=function(_0x14b887,_0x2a85cb){return _0x14b887[_0x3fc2('0x9')](_0x3fc2('0xa'),attributes,{'tableName':_0x3fc2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9cf6=['define','Condition','tools_conditions','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cf6,0xe3));var _0x69cf=function(_0xda4d85,_0x3d77f3){_0xda4d85=_0xda4d85-0x0;var _0x3e5d9f=_0x9cf6[_0xda4d85];return _0x3e5d9f;};'use strict';var _=require(_0x69cf('0x0'));var util=require('util');var logger=require(_0x69cf('0x1'))(_0x69cf('0x2'));var moment=require(_0x69cf('0x3'));var BPromise=require(_0x69cf('0x4'));var rp=require(_0x69cf('0x5'));var fs=require('fs');var path=require(_0x69cf('0x6'));var rimraf=require(_0x69cf('0x7'));var config=require(_0x69cf('0x8'));var attributes=require(_0x69cf('0x9'));module[_0x69cf('0xa')]=function(_0x1d6491,_0x3bd249){return _0x1d6491[_0x69cf('0xb')](_0x69cf('0xc'),attributes,{'tableName':_0x69cf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 64dfb0e..5f72f33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0347=['bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','debug','request\x20sent','error','code','Condition,\x20%s,\x20%s','message','info','result','util','moment'];(function(_0x2246fe,_0x58bc4e){var _0x130925=function(_0x28b9e1){while(--_0x28b9e1){_0x2246fe['push'](_0x2246fe['shift']());}};_0x130925(++_0x58bc4e);}(_0x0347,0x1d9));var _0x7034=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0347[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0x7034('0x0'));var moment=require(_0x7034('0x1'));var BPromise=require(_0x7034('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7034('0x3'));var logger=require(_0x7034('0x4'))(_0x7034('0x5'));var config=require(_0x7034('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7034('0x7')][_0x7034('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x424669,_0xb58b56,_0x56a3b0){return new BPromise(function(_0x5ad60d,_0x631e60){return client[_0x7034('0x9')](_0x424669,_0x56a3b0)[_0x7034('0xa')](function(_0x4c1993){logger['info']('Condition,\x20%s,\x20%s',_0xb58b56,'request\x20sent');logger[_0x7034('0xb')]('Condition,\x20%s,\x20%s,\x20%s',_0xb58b56,_0x7034('0xc'),JSON['stringify'](_0x4c1993));if(_0x4c1993[_0x7034('0xd')]){if(_0x4c1993[_0x7034('0xd')][_0x7034('0xe')]===0x1f4){logger[_0x7034('0xd')](_0x7034('0xf'),_0xb58b56,_0x4c1993[_0x7034('0xd')][_0x7034('0x10')]);return _0x631e60(_0x4c1993['error'][_0x7034('0x10')]);}logger['error'](_0x7034('0xf'),_0xb58b56,_0x4c1993[_0x7034('0xd')][_0x7034('0x10')]);return _0x5ad60d(_0x4c1993['error'][_0x7034('0x10')]);}else{logger[_0x7034('0x11')](_0x7034('0xf'),_0xb58b56,'request\x20sent');_0x5ad60d(_0x4c1993[_0x7034('0x12')][_0x7034('0x10')]);}})['catch'](function(_0x222e0d){logger['error'](_0x7034('0xf'),_0xb58b56,_0x222e0d);_0x631e60(_0x222e0d);});});}
\ No newline at end of file
+var _0x5df1=['request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Condition,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info'];(function(_0x573d8d,_0x2db3ca){var _0x3c597f=function(_0x5048ee){while(--_0x5048ee){_0x573d8d['push'](_0x573d8d['shift']());}};_0x3c597f(++_0x2db3ca);}(_0x5df1,0x14b));var _0x15df=function(_0x32d155,_0x4535f4){_0x32d155=_0x32d155-0x0;var _0x3e3654=_0x5df1[_0x32d155];return _0x3e3654;};'use strict';var _=require(_0x15df('0x0'));var util=require(_0x15df('0x1'));var moment=require(_0x15df('0x2'));var BPromise=require(_0x15df('0x3'));var rs=require(_0x15df('0x4'));var fs=require('fs');var Redis=require(_0x15df('0x5'));var db=require(_0x15df('0x6'))['db'];var utils=require(_0x15df('0x7'));var logger=require(_0x15df('0x8'))(_0x15df('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x15df('0xa')][_0x15df('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcfe650,_0xf6e1d5,_0x4f4ed9){return new BPromise(function(_0x41313d,_0x10e3e6){return client[_0x15df('0xc')](_0xcfe650,_0x4f4ed9)['then'](function(_0x4b8a87){logger[_0x15df('0xd')]('Condition,\x20%s,\x20%s',_0xf6e1d5,_0x15df('0xe'));logger[_0x15df('0xf')](_0x15df('0x10'),_0xf6e1d5,_0x15df('0xe'),JSON[_0x15df('0x11')](_0x4b8a87));if(_0x4b8a87['error']){if(_0x4b8a87['error'][_0x15df('0x12')]===0x1f4){logger[_0x15df('0x13')]('Condition,\x20%s,\x20%s',_0xf6e1d5,_0x4b8a87[_0x15df('0x13')][_0x15df('0x14')]);return _0x10e3e6(_0x4b8a87[_0x15df('0x13')][_0x15df('0x14')]);}logger['error'](_0x15df('0x15'),_0xf6e1d5,_0x4b8a87[_0x15df('0x13')][_0x15df('0x14')]);return _0x41313d(_0x4b8a87[_0x15df('0x13')][_0x15df('0x14')]);}else{logger[_0x15df('0xd')](_0x15df('0x15'),_0xf6e1d5,'request\x20sent');_0x41313d(_0x4b8a87[_0x15df('0x16')][_0x15df('0x14')]);}})['catch'](function(_0x78f1be){logger[_0x15df('0x13')](_0x15df('0x15'),_0xf6e1d5,_0x78f1be);_0x10e3e6(_0x78f1be);});});}
\ No newline at end of file
index 35bbe05..445f6ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02e0=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','/:id','isAuthenticated','update','destroy','multer'];(function(_0x385467,_0x298239){var _0x5ed67e=function(_0x4b252c){while(--_0x4b252c){_0x385467['push'](_0x385467['shift']());}};_0x5ed67e(++_0x298239);}(_0x02e0,0x15d));var _0x002e=function(_0xcef413,_0x15bab0){_0xcef413=_0xcef413-0x0;var _0x23c5e3=_0x02e0[_0xcef413];return _0x23c5e3;};'use strict';var multer=require(_0x002e('0x0'));var util=require(_0x002e('0x1'));var path=require(_0x002e('0x2'));var timeout=require('connect-timeout');var express=require(_0x002e('0x3'));var router=express[_0x002e('0x4')]();var fs_extra=require(_0x002e('0x5'));var auth=require(_0x002e('0x6'));var interaction=require(_0x002e('0x7'));var config=require(_0x002e('0x8'));var controller=require(_0x002e('0x9'));router['put'](_0x002e('0xa'),auth[_0x002e('0xb')](),controller[_0x002e('0xc')]);router['delete'](_0x002e('0xa'),auth[_0x002e('0xb')](),controller[_0x002e('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x977c=['util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','isAuthenticated','update','delete','/:id','destroy','multer'];(function(_0x59c389,_0x19e789){var _0x2d35c6=function(_0x4deae7){while(--_0x4deae7){_0x59c389['push'](_0x59c389['shift']());}};_0x2d35c6(++_0x19e789);}(_0x977c,0x1b2));var _0xc977=function(_0x14b9f4,_0x107444){_0x14b9f4=_0x14b9f4-0x0;var _0x5265f4=_0x977c[_0x14b9f4];return _0x5265f4;};'use strict';var multer=require(_0xc977('0x0'));var util=require(_0xc977('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc977('0x2'));var router=express[_0xc977('0x3')]();var fs_extra=require(_0xc977('0x4'));var auth=require(_0xc977('0x5'));var interaction=require(_0xc977('0x6'));var config=require(_0xc977('0x7'));var controller=require(_0xc977('0x8'));router[_0xc977('0x9')]('/:id',auth[_0xc977('0xa')](),controller[_0xc977('0xb')]);router[_0xc977('0xc')](_0xc977('0xd'),auth[_0xc977('0xa')](),controller[_0xc977('0xe')]);module['exports']=router;
\ No newline at end of file
index d0a0675..39d2cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['INTEGER','sequelize','exports','STRING','name'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xb458,0x10a));var _0x8b45=function(_0x332a67,_0x40a3ea){_0x332a67=_0x332a67-0x0;var _0x69828a=_0xb458[_0x332a67];return _0x69828a;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'allowNull':![],'unique':_0x8b45('0x3')},'OrderBy':{'type':Sequelize[_0x8b45('0x4')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8b45('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x4fef=['name','sequelize','exports','STRING'];(function(_0x49c2e3,_0x14c255){var _0x4ee106=function(_0x25b432){while(--_0x25b432){_0x49c2e3['push'](_0x49c2e3['shift']());}};_0x4ee106(++_0x14c255);}(_0x4fef,0x1bd));var _0xf4fe=function(_0x3adbcb,_0x461f50){_0x3adbcb=_0x3adbcb-0x0;var _0x1562a2=_0x4fef[_0x3adbcb];return _0x1562a2;};'use strict';var Sequelize=require(_0xf4fe('0x0'));module[_0xf4fe('0x1')]={'name':{'type':Sequelize[_0xf4fe('0x2')],'allowNull':![],'unique':_0xf4fe('0x3')},'OrderBy':{'type':Sequelize['INTEGER'],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xf4fe('0x2')],'allowNull':!![]}};
\ No newline at end of file
index dbe99d6..4ee00d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0xc857ed,_0x485493){var _0x49a0d9=function(_0x2b0929){while(--_0x2b0929){_0xc857ed['push'](_0xc857ed['shift']());}};_0x49a0d9(++_0x485493);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x3a235a,_0x1e593f){_0x3a235a=_0x3a235a-0x0;var _0x1a6e21=_0xbbbc[_0x3a235a];return _0x1a6e21;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));};
\ No newline at end of file
+var _0x1a37=['includeAll','include','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ContactItemTypes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','options'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x1a37,0xb4));var _0x71a3=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x1a37[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){var _0xb9c195=_0x5f33c5[_0x71a3('0x26')]({'plain':!![]});var _0xb0f3aa='ContactItemTypes';return db[_0x71a3('0x27')][_0x71a3('0x25')]({'where':{'type':_0xb0f3aa,'resourceId':_0xb9c195['id']}})['then'](function(){return _0x5f33c5;});})[_0x71a3('0x24')](function(){_0x452bc4['status'](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0x2fd3b6,_0x211ea8){return function(_0x35b5c7){if(!_0x35b5c7){_0x2fd3b6[_0x71a3('0x18')](0x194);}return _0x35b5c7;};}function handleError(_0x314439,_0x2317ec){_0x2317ec=_0x2317ec||0x1f4;return function(_0x242b85){logger[_0x71a3('0x28')](_0x242b85[_0x71a3('0x29')]);if(_0x242b85[_0x71a3('0x2a')]){delete _0x242b85[_0x71a3('0x2a')];}_0x314439['status'](_0x2317ec)[_0x71a3('0x2b')](_0x242b85);};}exports[_0x71a3('0x2c')]=function(_0x334db0,_0x23ae85){var _0x4a750c={},_0x18a8fe={},_0x216d84={'count':0x0,'rows':[]};var _0x45d13d=_[_0x71a3('0x2d')](db[_0x71a3('0x2e')][_0x71a3('0x2f')],function(_0x1d09bd){return{'name':_0x1d09bd['fieldName'],'type':_0x1d09bd[_0x71a3('0x30')][_0x71a3('0x31')]};});_0x18a8fe[_0x71a3('0x32')]=_[_0x71a3('0x2d')](_0x45d13d,_0x71a3('0x2a'));_0x18a8fe[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x334db0[_0x71a3('0x33')]);_0x18a8fe[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x18a8fe[_0x71a3('0x32')],_0x18a8fe[_0x71a3('0x33')]);_0x4a750c[_0x71a3('0x37')]=_['intersection'](_0x18a8fe['model'],qs[_0x71a3('0x38')](_0x334db0[_0x71a3('0x33')]['fields']));_0x4a750c[_0x71a3('0x37')]=_0x4a750c[_0x71a3('0x37')]['length']?_0x4a750c[_0x71a3('0x37')]:_0x18a8fe[_0x71a3('0x32')];if(!_0x334db0[_0x71a3('0x33')][_0x71a3('0x39')](_0x71a3('0x3a'))){_0x4a750c[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x334db0['query'][_0x71a3('0x1d')]);_0x4a750c[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x334db0['query'][_0x71a3('0x1b')]);}_0x4a750c[_0x71a3('0x3b')]=qs[_0x71a3('0x3c')](_0x334db0[_0x71a3('0x33')][_0x71a3('0x3c')]);_0x4a750c['where']=qs['filters'](_[_0x71a3('0x3d')](_0x334db0[_0x71a3('0x33')],_0x18a8fe[_0x71a3('0x35')]),_0x45d13d);if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]){_0x4a750c['where']=_[_0x71a3('0x3f')](_0x4a750c[_0x71a3('0x40')],{'$or':_[_0x71a3('0x2d')](_0x45d13d,function(_0x58b833){if(_0x58b833[_0x71a3('0x30')]!=='VIRTUAL'){var _0x3edeff={};_0x3edeff[_0x58b833[_0x71a3('0x2a')]]={'$like':'%'+_0x334db0[_0x71a3('0x33')][_0x71a3('0x3e')]+'%'};return _0x3edeff;}})});}_0x4a750c=_[_0x71a3('0x3f')]({},_0x4a750c,_0x334db0[_0x71a3('0x41')]);var _0x468ca4={'where':_0x4a750c[_0x71a3('0x40')]};return db[_0x71a3('0x2e')][_0x71a3('0x1e')](_0x468ca4)['then'](function(_0xa49846){_0x216d84['count']=_0xa49846;if(_0x334db0[_0x71a3('0x33')][_0x71a3('0x42')]){_0x4a750c[_0x71a3('0x43')]=[{'all':!![]}];}return db[_0x71a3('0x2e')]['findAll'](_0x4a750c);})[_0x71a3('0x24')](function(_0x4b4fde){_0x216d84['rows']=_0x4b4fde;return _0x216d84;})[_0x71a3('0x24')](respondWithFilteredResult(_0x23ae85,_0x4a750c))[_0x71a3('0x44')](handleError(_0x23ae85,null));};exports[_0x71a3('0x45')]=function(_0x1dc34b,_0x519242){var _0x248a04={'raw':!![],'where':{'id':_0x1dc34b[_0x71a3('0x46')]['id']}},_0x615c6f={};_0x615c6f[_0x71a3('0x32')]=_[_0x71a3('0x34')](db[_0x71a3('0x2e')][_0x71a3('0x2f')]);_0x615c6f[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x1dc34b[_0x71a3('0x33')]);_0x615c6f[_0x71a3('0x35')]=_[_0x71a3('0x36')](_0x615c6f[_0x71a3('0x32')],_0x615c6f[_0x71a3('0x33')]);_0x248a04[_0x71a3('0x37')]=_[_0x71a3('0x36')](_0x615c6f['model'],qs[_0x71a3('0x38')](_0x1dc34b[_0x71a3('0x33')]['fields']));_0x248a04[_0x71a3('0x37')]=_0x248a04[_0x71a3('0x37')][_0x71a3('0x47')]?_0x248a04[_0x71a3('0x37')]:_0x615c6f[_0x71a3('0x32')];if(_0x1dc34b['query']['includeAll']){_0x248a04[_0x71a3('0x43')]=[{'all':!![]}];}_0x248a04=_[_0x71a3('0x3f')]({},_0x248a04,_0x1dc34b['options']);return db[_0x71a3('0x2e')][_0x71a3('0x48')](_0x248a04)[_0x71a3('0x24')](handleEntityNotFound(_0x519242,null))[_0x71a3('0x24')](respondWithResult(_0x519242,null))[_0x71a3('0x44')](handleError(_0x519242,null));};exports[_0x71a3('0x49')]=function(_0x501a62,_0x1c9ba6){return db['ContactItemType'][_0x71a3('0x49')](_0x501a62[_0x71a3('0x4a')],{})[_0x71a3('0x24')](function(_0x2f3f19){var _0x32e313=_0x501a62['user'][_0x71a3('0x26')]({'plain':!![]});if(!_0x32e313)throw new Error(_0x71a3('0x4b'));if(_0x32e313[_0x71a3('0x4c')]==='user'){var _0x6c34=_0x2f3f19['get']({'plain':!![]});var _0x278e11=_0x71a3('0x4d');return db['UserProfileSection'][_0x71a3('0x48')]({'where':{'name':_0x278e11,'userProfileId':_0x32e313[_0x71a3('0x4e')]},'raw':!![]})[_0x71a3('0x24')](function(_0x384f38){if(_0x384f38&&_0x384f38[_0x71a3('0x4f')]===0x0){return db[_0x71a3('0x27')][_0x71a3('0x49')]({'name':_0x6c34['name'],'resourceId':_0x6c34['id'],'type':_0x384f38[_0x71a3('0x2a')],'sectionId':_0x384f38['id']},{})['then'](function(){return _0x2f3f19;});}else{return _0x2f3f19;}})[_0x71a3('0x44')](function(_0x480e90){logger[_0x71a3('0x28')](_0x71a3('0x50'),_0x480e90);throw _0x480e90;});}return _0x2f3f19;})[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,0xc9))[_0x71a3('0x44')](handleError(_0x1c9ba6,null));};exports['update']=function(_0x54b80f,_0x1e13ae){if(_0x54b80f[_0x71a3('0x4a')]['id']){delete _0x54b80f[_0x71a3('0x4a')]['id'];}return db[_0x71a3('0x2e')]['find']({'where':{'id':_0x54b80f['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1e13ae,null))[_0x71a3('0x24')](saveUpdates(_0x54b80f[_0x71a3('0x4a')],null))[_0x71a3('0x24')](respondWithResult(_0x1e13ae,null))[_0x71a3('0x44')](handleError(_0x1e13ae,null));};exports['destroy']=function(_0x421b6a,_0x3379cb){return db[_0x71a3('0x2e')][_0x71a3('0x48')]({'where':{'id':_0x421b6a[_0x71a3('0x46')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x3379cb,null))[_0x71a3('0x24')](db[_0x71a3('0x51')]['update']({'ItemTypeId':null},{'where':{'ItemTypeId':_0x421b6a[_0x71a3('0x46')]['id']}}))[_0x71a3('0x24')](removeEntity(_0x3379cb,null))[_0x71a3('0x44')](handleError(_0x3379cb,null));};
\ No newline at end of file
index 4d0c6a5..043495b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfec7=['lodash','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','tools_contact_item_types'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xfec7,0x1b0));var _0x7fec=function(_0x56254c,_0x266f75){_0x56254c=_0x56254c-0x0;var _0x41a22b=_0xfec7[_0x56254c];return _0x41a22b;};'use strict';var _=require(_0x7fec('0x0'));var util=require('util');var logger=require(_0x7fec('0x1'))(_0x7fec('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7fec('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7fec('0x4'));var config=require(_0x7fec('0x5'));var attributes=require('./contactItemType.attributes');module[_0x7fec('0x6')]=function(_0x4d14c9,_0x70e4f6){return _0x4d14c9[_0x7fec('0x7')]('ContactItemType',attributes,{'tableName':_0x7fec('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa06b=['tools_contact_item_types','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','ContactItemType'];(function(_0x5a452b,_0x24f86a){var _0x22f87c=function(_0xf9b905){while(--_0xf9b905){_0x5a452b['push'](_0x5a452b['shift']());}};_0x22f87c(++_0x24f86a);}(_0xa06b,0xfe));var _0xba06=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa06b[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0xba06('0x0'));var logger=require(_0xba06('0x1'))(_0xba06('0x2'));var moment=require(_0xba06('0x3'));var BPromise=require(_0xba06('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba06('0x5'));var rimraf=require(_0xba06('0x6'));var config=require(_0xba06('0x7'));var attributes=require('./contactItemType.attributes');module['exports']=function(_0x33fc48,_0x49cd49){return _0x33fc48[_0xba06('0x8')](_0xba06('0x9'),attributes,{'tableName':_0xba06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4e77712..4001ab9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c53=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x53019c,_0x438117){var _0x5573a3=function(_0x38131d){while(--_0x38131d){_0x53019c['push'](_0x53019c['shift']());}};_0x5573a3(++_0x438117);}(_0x9c53,0x1f4));var _0x39c5=function(_0x398204,_0x5cb89e){_0x398204=_0x398204-0x0;var _0x1c8cc6=_0x9c53[_0x398204];return _0x1c8cc6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x39c5('0x0'));var BPromise=require('bluebird');var rs=require(_0x39c5('0x1'));var fs=require('fs');var Redis=require(_0x39c5('0x2'));var db=require(_0x39c5('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x39c5('0x4'))(_0x39c5('0x5'));var config=require(_0x39c5('0x6'));var jayson=require(_0x39c5('0x7'));var client=jayson[_0x39c5('0x8')][_0x39c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45a23f,_0x95728e,_0x24205b){return new BPromise(function(_0x51b1fa,_0x474158){return client['request'](_0x45a23f,_0x24205b)[_0x39c5('0xa')](function(_0x126323){logger['info'](_0x39c5('0xb'),_0x95728e,'request\x20sent');logger[_0x39c5('0xc')](_0x39c5('0xd'),_0x95728e,_0x39c5('0xe'),JSON['stringify'](_0x126323));if(_0x126323[_0x39c5('0xf')]){if(_0x126323[_0x39c5('0xf')][_0x39c5('0x10')]===0x1f4){logger[_0x39c5('0xf')]('ContactItemType,\x20%s,\x20%s',_0x95728e,_0x126323[_0x39c5('0xf')][_0x39c5('0x11')]);return _0x474158(_0x126323[_0x39c5('0xf')][_0x39c5('0x11')]);}logger[_0x39c5('0xf')](_0x39c5('0xb'),_0x95728e,_0x126323[_0x39c5('0xf')]['message']);return _0x51b1fa(_0x126323[_0x39c5('0xf')][_0x39c5('0x11')]);}else{logger[_0x39c5('0x12')](_0x39c5('0xb'),_0x95728e,_0x39c5('0xe'));_0x51b1fa(_0x126323[_0x39c5('0x13')][_0x39c5('0x11')]);}})[_0x39c5('0x14')](function(_0x5b73e5){logger['error']('ContactItemType,\x20%s,\x20%s',_0x95728e,_0x5b73e5);_0x474158(_0x5b73e5);});});}
\ No newline at end of file
+var _0x0e89=['info','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','ContactItemType,\x20%s,\x20%s','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','then'];(function(_0x5a24b1,_0x29461d){var _0x1b3526=function(_0x8182e9){while(--_0x8182e9){_0x5a24b1['push'](_0x5a24b1['shift']());}};_0x1b3526(++_0x29461d);}(_0x0e89,0x69));var _0x90e8=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0e89[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x90e8('0x0'));var util=require('util');var moment=require(_0x90e8('0x1'));var BPromise=require('bluebird');var rs=require(_0x90e8('0x2'));var fs=require('fs');var Redis=require(_0x90e8('0x3'));var db=require(_0x90e8('0x4'))['db'];var utils=require(_0x90e8('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x90e8('0x6'));var jayson=require(_0x90e8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0813,_0xe75bc3,_0x47a2e7){return new BPromise(function(_0x165d7e,_0x3357ef){return client['request'](_0x2c0813,_0x47a2e7)[_0x90e8('0x8')](function(_0x2d901a){logger[_0x90e8('0x9')]('ContactItemType,\x20%s,\x20%s',_0xe75bc3,_0x90e8('0xa'));logger[_0x90e8('0xb')](_0x90e8('0xc'),_0xe75bc3,_0x90e8('0xa'),JSON[_0x90e8('0xd')](_0x2d901a));if(_0x2d901a[_0x90e8('0xe')]){if(_0x2d901a['error'][_0x90e8('0xf')]===0x1f4){logger[_0x90e8('0xe')](_0x90e8('0x10'),_0xe75bc3,_0x2d901a[_0x90e8('0xe')][_0x90e8('0x11')]);return _0x3357ef(_0x2d901a[_0x90e8('0xe')][_0x90e8('0x11')]);}logger[_0x90e8('0xe')](_0x90e8('0x10'),_0xe75bc3,_0x2d901a['error'][_0x90e8('0x11')]);return _0x165d7e(_0x2d901a[_0x90e8('0xe')][_0x90e8('0x11')]);}else{logger[_0x90e8('0x9')]('ContactItemType,\x20%s,\x20%s',_0xe75bc3,_0x90e8('0xa'));_0x165d7e(_0x2d901a[_0x90e8('0x12')][_0x90e8('0x11')]);}})['catch'](function(_0x499ff3){logger['error']('ContactItemType,\x20%s,\x20%s',_0xe75bc3,_0x499ff3);_0x3357ef(_0x499ff3);});});}
\ No newline at end of file
index 57d64e6..8965e77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72eb=['create','put','/:id','delete','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post'];(function(_0x55414d,_0x478837){var _0x4461b6=function(_0x14501c){while(--_0x14501c){_0x55414d['push'](_0x55414d['shift']());}};_0x4461b6(++_0x478837);}(_0x72eb,0x1c5));var _0xb72e=function(_0x5c4826,_0x45eab){_0x5c4826=_0x5c4826-0x0;var _0x456fc6=_0x72eb[_0x5c4826];return _0x456fc6;};'use strict';var multer=require('multer');var util=require(_0xb72e('0x0'));var path=require(_0xb72e('0x1'));var timeout=require('connect-timeout');var express=require(_0xb72e('0x2'));var router=express['Router']();var fs_extra=require(_0xb72e('0x3'));var auth=require(_0xb72e('0x4'));var interaction=require(_0xb72e('0x5'));var config=require(_0xb72e('0x6'));var controller=require('./contactItemType.controller');router[_0xb72e('0x7')]('/',auth[_0xb72e('0x8')](),controller[_0xb72e('0x9')]);router[_0xb72e('0x7')]('/:id',auth[_0xb72e('0x8')](),controller['show']);router[_0xb72e('0xa')]('/',auth['isAuthenticated'](),controller[_0xb72e('0xb')]);router[_0xb72e('0xc')](_0xb72e('0xd'),auth[_0xb72e('0x8')](),controller['update']);router[_0xb72e('0xe')](_0xb72e('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xb72e('0xf')]=router;
\ No newline at end of file
+var _0x67a1=['create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1232cd,_0x48b75f){var _0x3f25f7=function(_0x36fdff){while(--_0x36fdff){_0x1232cd['push'](_0x1232cd['shift']());}};_0x3f25f7(++_0x48b75f);}(_0x67a1,0x75));var _0x167a=function(_0x43d19e,_0xa86dbd){_0x43d19e=_0x43d19e-0x0;var _0x3ff151=_0x67a1[_0x43d19e];return _0x3ff151;};'use strict';var multer=require(_0x167a('0x0'));var util=require(_0x167a('0x1'));var path=require(_0x167a('0x2'));var timeout=require(_0x167a('0x3'));var express=require(_0x167a('0x4'));var router=express[_0x167a('0x5')]();var fs_extra=require(_0x167a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x167a('0x7'));var config=require(_0x167a('0x8'));var controller=require(_0x167a('0x9'));router[_0x167a('0xa')]('/',auth[_0x167a('0xb')](),controller[_0x167a('0xc')]);router[_0x167a('0xa')](_0x167a('0xd'),auth[_0x167a('0xb')](),controller[_0x167a('0xe')]);router[_0x167a('0xf')]('/',auth[_0x167a('0xb')](),controller[_0x167a('0x10')]);router['put'](_0x167a('0xd'),auth[_0x167a('0xb')](),controller['update']);router['delete'](_0x167a('0xd'),auth['isAuthenticated'](),controller[_0x167a('0x11')]);module[_0x167a('0x12')]=router;
\ No newline at end of file
index 2356d59..8773010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0xc63efa,_0x10a80e){var _0x984b27=function(_0xa129e3){while(--_0xa129e3){_0xc63efa['push'](_0xc63efa['shift']());}};_0x984b27(++_0x10a80e);}(_0x757a,0xde));var _0xa757=function(_0x2154cc,_0x5d8ee2){_0x2154cc=_0x2154cc-0x0;var _0x234718=_0x757a[_0x2154cc];return _0x234718;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x757a=['exports','STRING'];(function(_0x2a8a41,_0x5bca91){var _0x1139ae=function(_0x4e187f){while(--_0x4e187f){_0x2a8a41['push'](_0x2a8a41['shift']());}};_0x1139ae(++_0x5bca91);}(_0x757a,0xde));var _0xa757=function(_0x40a897,_0x2faa42){_0x40a897=_0x40a897-0x0;var _0x3a1f91=_0x757a[_0x40a897];return _0x3a1f91;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a246943..c08d2bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7117=['keys','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','clone','omit','updatedAt','CustomDashboards','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','attrSerie1','attrSerie2','attrSerie3','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','error','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','model'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x7117,0x12b));var _0x7711=function(_0x5163a7,_0x2896e3){_0x5163a7=_0x5163a7-0x0;var _0x4fdc7e=_0x7117[_0x5163a7];return _0x4fdc7e;};'use strict';var emlformat=require(_0x7711('0x0'));var rimraf=require(_0x7711('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7711('0x2'));var rp=require(_0x7711('0x3'));var moment=require(_0x7711('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7711('0x5'));var util=require('util');var path=require(_0x7711('0x6'));var sox=require('sox');var csv=require(_0x7711('0x7'));var ejs=require(_0x7711('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7711('0x9'));var squel=require(_0x7711('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7711('0xb'));var toCsv=require(_0x7711('0x7'));var querystring=require(_0x7711('0xc'));var Papa=require(_0x7711('0xd'));var Redis=require(_0x7711('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x7711('0xf'));var as=require(_0x7711('0x10'));var hardwareService=require(_0x7711('0x11'));var logger=require(_0x7711('0x12'))(_0x7711('0x13'));var utils=require(_0x7711('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7711('0x15'));var db=require(_0x7711('0x16'))['db'];config[_0x7711('0x17')]=_['defaults'](config['redis'],{'host':_0x7711('0x18'),'port':0x18eb});var socket=require(_0x7711('0x19'))(new Redis(config['redis']));require(_0x7711('0x1a'))['register'](socket);function respondWithStatusCode(_0x5a6412,_0x38706a){_0x38706a=_0x38706a||0xcc;return function(_0x44c7a4){if(_0x44c7a4){return _0x5a6412[_0x7711('0x1b')](_0x38706a);}return _0x5a6412['status'](_0x38706a)[_0x7711('0x1c')]();};}function respondWithResult(_0x4cc0f1,_0x13c7ca){_0x13c7ca=_0x13c7ca||0xc8;return function(_0x1167bf){if(_0x1167bf){return _0x4cc0f1[_0x7711('0x1d')](_0x13c7ca)[_0x7711('0x1e')](_0x1167bf);}};}function respondWithFilteredResult(_0x19a3fb,_0x34af66){return function(_0x43b448){if(_0x43b448){var _0x3349a6=typeof _0x34af66[_0x7711('0x1f')]===_0x7711('0x20')&&typeof _0x34af66[_0x7711('0x21')]===_0x7711('0x20');var _0x1c688e=_0x43b448[_0x7711('0x22')];var _0x447f8b=_0x3349a6?0x0:_0x34af66['offset'];var _0x41c8ca=_0x3349a6?_0x43b448['count']:_0x34af66['offset']+_0x34af66[_0x7711('0x21')];var _0x8ec18d;if(_0x41c8ca>=_0x1c688e){_0x41c8ca=_0x1c688e;_0x8ec18d=0xc8;}else{_0x8ec18d=0xce;}_0x19a3fb[_0x7711('0x1d')](_0x8ec18d);return _0x19a3fb[_0x7711('0x23')](_0x7711('0x24'),_0x447f8b+'-'+_0x41c8ca+'/'+_0x1c688e)[_0x7711('0x1e')](_0x43b448);}return null;};}function patchUpdates(_0x4e9dfa){return function(_0x32c1f3){try{jsonpatch['apply'](_0x32c1f3,_0x4e9dfa,!![]);}catch(_0x59f9ff){return BPromise[_0x7711('0x25')](_0x59f9ff);}return _0x32c1f3['save']();};}function saveUpdates(_0x403e03,_0x45a47d){return function(_0x1c657f){if(_0x1c657f){return _0x1c657f[_0x7711('0x26')](_0x403e03)[_0x7711('0x27')](function(_0x1d5ed4){return _0x1d5ed4;});}return null;};}function removeEntity(_0x4fed02,_0x4736bb){return function(_0x361780){if(_0x361780){return _0x361780[_0x7711('0x28')]()[_0x7711('0x27')](function(){var _0x21c2d0=_0x361780[_0x7711('0x29')]({'plain':!![]});var _0x595d09='CustomDashboards';return db['UserProfileResource'][_0x7711('0x28')]({'where':{'type':_0x595d09,'resourceId':_0x21c2d0['id']}})[_0x7711('0x27')](function(){return _0x361780;});})['then'](function(){_0x4fed02[_0x7711('0x1d')](0xcc)[_0x7711('0x1c')]();});}};}function handleEntityNotFound(_0x3111b7,_0x3df579){return function(_0x13e69e){if(!_0x13e69e){_0x3111b7[_0x7711('0x1b')](0x194);}return _0x13e69e;};}function handleError(_0x4b083c,_0x216fd0){_0x216fd0=_0x216fd0||0x1f4;return function(_0xa09858){logger[_0x7711('0x2a')](_0xa09858['stack']);if(_0xa09858[_0x7711('0x2b')]){delete _0xa09858[_0x7711('0x2b')];}_0x4b083c[_0x7711('0x1d')](_0x216fd0)[_0x7711('0x2c')](_0xa09858);};}exports[_0x7711('0x2d')]=function(_0xe001f4,_0x293bf7){var _0x24888c={},_0x534332={},_0x27146a={'count':0x0,'rows':[]};var _0x2725e4=_[_0x7711('0x2e')](db[_0x7711('0x2f')][_0x7711('0x30')],function(_0x5a9fc3){return{'name':_0x5a9fc3[_0x7711('0x31')],'type':_0x5a9fc3[_0x7711('0x32')][_0x7711('0x33')]};});_0x534332['model']=_[_0x7711('0x2e')](_0x2725e4,_0x7711('0x2b'));_0x534332[_0x7711('0x34')]=_['keys'](_0xe001f4[_0x7711('0x34')]);_0x534332[_0x7711('0x35')]=_[_0x7711('0x36')](_0x534332['model'],_0x534332[_0x7711('0x34')]);_0x24888c['attributes']=_[_0x7711('0x36')](_0x534332['model'],qs[_0x7711('0x37')](_0xe001f4['query'][_0x7711('0x37')]));_0x24888c[_0x7711('0x38')]=_0x24888c[_0x7711('0x38')][_0x7711('0x39')]?_0x24888c['attributes']:_0x534332['model'];if(!_0xe001f4[_0x7711('0x34')][_0x7711('0x3a')]('nolimit')){_0x24888c['limit']=qs['limit'](_0xe001f4['query']['limit']);_0x24888c[_0x7711('0x1f')]=qs[_0x7711('0x1f')](_0xe001f4[_0x7711('0x34')]['offset']);}_0x24888c[_0x7711('0x3b')]=qs['sort'](_0xe001f4[_0x7711('0x34')][_0x7711('0x3c')]);_0x24888c[_0x7711('0x3d')]=qs['filters'](_[_0x7711('0x3e')](_0xe001f4[_0x7711('0x34')],_0x534332['filters']),_0x2725e4);if(_0xe001f4[_0x7711('0x34')]['filter']){_0x24888c[_0x7711('0x3d')]=_[_0x7711('0x3f')](_0x24888c[_0x7711('0x3d')],{'$or':_[_0x7711('0x2e')](_0x2725e4,function(_0xe4105){if(_0xe4105[_0x7711('0x32')]!==_0x7711('0x40')){var _0x5679bc={};_0x5679bc[_0xe4105[_0x7711('0x2b')]]={'$like':'%'+_0xe001f4[_0x7711('0x34')][_0x7711('0x41')]+'%'};return _0x5679bc;}})});}_0x24888c=_[_0x7711('0x3f')]({},_0x24888c,_0xe001f4['options']);var _0x28e2d0={'where':_0x24888c['where']};return db['Dashboard'][_0x7711('0x22')](_0x28e2d0)[_0x7711('0x27')](function(_0x5e9f11){_0x27146a[_0x7711('0x22')]=_0x5e9f11;if(_0xe001f4['query']['includeAll']){_0x24888c[_0x7711('0x42')]=[{'all':!![]}];}return db[_0x7711('0x2f')][_0x7711('0x43')](_0x24888c);})[_0x7711('0x27')](function(_0x3302a3){_0x27146a[_0x7711('0x44')]=_0x3302a3;return _0x27146a;})[_0x7711('0x27')](respondWithFilteredResult(_0x293bf7,_0x24888c))[_0x7711('0x45')](handleError(_0x293bf7,null));};exports[_0x7711('0x46')]=function(_0x2dee24,_0x160390){var _0x1d1d8b={'raw':![],'where':{'id':_0x2dee24[_0x7711('0x47')]['id']}},_0x225dcd={};_0x225dcd[_0x7711('0x48')]=_[_0x7711('0x49')](db[_0x7711('0x2f')][_0x7711('0x30')]);_0x225dcd['query']=_[_0x7711('0x49')](_0x2dee24[_0x7711('0x34')]);_0x225dcd[_0x7711('0x35')]=_[_0x7711('0x36')](_0x225dcd[_0x7711('0x48')],_0x225dcd['query']);_0x1d1d8b[_0x7711('0x38')]=_[_0x7711('0x36')](_0x225dcd[_0x7711('0x48')],qs[_0x7711('0x37')](_0x2dee24[_0x7711('0x34')][_0x7711('0x37')]));_0x1d1d8b[_0x7711('0x38')]=_0x1d1d8b[_0x7711('0x38')][_0x7711('0x39')]?_0x1d1d8b['attributes']:_0x225dcd[_0x7711('0x48')];if(_0x2dee24[_0x7711('0x34')][_0x7711('0x4a')]){_0x1d1d8b[_0x7711('0x42')]=[{'all':!![]}];}_0x1d1d8b=_[_0x7711('0x3f')]({},_0x1d1d8b,_0x2dee24[_0x7711('0x4b')]);return db['Dashboard'][_0x7711('0x4c')](_0x1d1d8b)[_0x7711('0x27')](handleEntityNotFound(_0x160390,null))[_0x7711('0x27')](respondWithResult(_0x160390,null))[_0x7711('0x45')](handleError(_0x160390,null));};exports[_0x7711('0x4d')]=function(_0x38f293,_0x4b20e9){return db[_0x7711('0x2f')][_0x7711('0x4d')](_0x38f293[_0x7711('0x4e')],{})[_0x7711('0x27')](function(_0x2c4c49){var _0x381ad3=_0x38f293[_0x7711('0x4f')][_0x7711('0x29')]({'plain':!![]});if(!_0x381ad3)throw new Error(_0x7711('0x50'));if(_0x381ad3[_0x7711('0x51')]===_0x7711('0x4f')){var _0x5a9602=_0x2c4c49[_0x7711('0x29')]({'plain':!![]});var _0x2f0668='CustomDashboards';return db[_0x7711('0x52')][_0x7711('0x4c')]({'where':{'name':_0x2f0668,'userProfileId':_0x381ad3[_0x7711('0x53')]},'raw':!![]})[_0x7711('0x27')](function(_0x219a94){if(_0x219a94&&_0x219a94[_0x7711('0x54')]===0x0){return db[_0x7711('0x55')][_0x7711('0x4d')]({'name':_0x5a9602['name'],'resourceId':_0x5a9602['id'],'type':_0x219a94[_0x7711('0x2b')],'sectionId':_0x219a94['id']},{})[_0x7711('0x27')](function(){return _0x2c4c49;});}else{return _0x2c4c49;}})[_0x7711('0x45')](function(_0x36597a){logger[_0x7711('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36597a);throw _0x36597a;});}return _0x2c4c49;})['then'](respondWithResult(_0x4b20e9,0xc9))[_0x7711('0x45')](handleError(_0x4b20e9,null));};exports[_0x7711('0x56')]=function(_0x328ed3,_0x5c842b){var _0xba3827={'where':{'id':_0x328ed3['params']['id']}},_0x55bbe4={};_0x55bbe4[_0x7711('0x48')]=_['keys'](db[_0x7711('0x2f')][_0x7711('0x30')]);_0xba3827[_0x7711('0x38')]=_[_0x7711('0x36')](_0x55bbe4[_0x7711('0x48')],qs[_0x7711('0x37')](_0x328ed3[_0x7711('0x34')][_0x7711('0x37')]));_0xba3827[_0x7711('0x38')]=_0xba3827[_0x7711('0x38')][_0x7711('0x39')]?_0xba3827[_0x7711('0x38')]:_0x55bbe4['model'];if(_0x328ed3['query'][_0x7711('0x4a')]){_0xba3827[_0x7711('0x42')]=[{'all':!![]}];}_0xba3827=_[_0x7711('0x3f')]({},_0xba3827,_0x328ed3[_0x7711('0x4b')]);return db[_0x7711('0x2f')][_0x7711('0x4c')](_0xba3827)['then'](handleEntityNotFound(_0x5c842b,null))[_0x7711('0x27')](function(_0x52202f){if(_0x52202f){var _0x3ee11e=_0x52202f['get']({'plain':!![]});_0x3ee11e=qs[_0x7711('0x57')](_0x3ee11e,['id','createdAt',_0x7711('0x58')]);_0x328ed3[_0x7711('0x4e')]=_[_0x7711('0x57')](_0x328ed3[_0x7711('0x4e')],['id','createdAt','updatedAt']);return db[_0x7711('0x2f')][_0x7711('0x4d')](_[_0x7711('0x3f')](_0x3ee11e,_0x328ed3[_0x7711('0x4e')]),{'include':_0x328ed3['query'][_0x7711('0x4a')]?[{'all':!![]}]:undefined})['then'](function(_0x519364){var _0x1fc20e=_0x328ed3[_0x7711('0x4f')][_0x7711('0x29')]({'plain':!![]});if(!_0x1fc20e)throw new Error(_0x7711('0x50'));if(_0x1fc20e[_0x7711('0x51')]==='user'){var _0x1c121d=_0x519364['get']({'plain':!![]});var _0x3d2a70=_0x7711('0x59');return db[_0x7711('0x52')][_0x7711('0x4c')]({'where':{'name':_0x3d2a70,'userProfileId':_0x1fc20e[_0x7711('0x53')]},'raw':!![]})[_0x7711('0x27')](function(_0x52ffa0){if(_0x52ffa0&&_0x52ffa0[_0x7711('0x54')]===0x0){return db['UserProfileResource'][_0x7711('0x4d')]({'name':_0x1c121d[_0x7711('0x2b')],'resourceId':_0x1c121d['id'],'type':_0x52ffa0[_0x7711('0x2b')],'sectionId':_0x52ffa0['id']},{})['then'](function(){return _0x519364;});}else{return _0x519364;}})[_0x7711('0x45')](function(_0x3df4a8){logger[_0x7711('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3df4a8);throw _0x3df4a8;});}return _0x519364;});}})[_0x7711('0x27')](respondWithResult(_0x5c842b,0xc9))[_0x7711('0x45')](handleError(_0x5c842b,null));};exports[_0x7711('0x26')]=function(_0x3cdafe,_0x4b631a){if(_0x3cdafe[_0x7711('0x4e')]['id']){delete _0x3cdafe['body']['id'];}return db[_0x7711('0x2f')][_0x7711('0x4c')]({'where':{'id':_0x3cdafe['params']['id']}})[_0x7711('0x27')](handleEntityNotFound(_0x4b631a,null))[_0x7711('0x27')](saveUpdates(_0x3cdafe[_0x7711('0x4e')],null))[_0x7711('0x27')](respondWithResult(_0x4b631a,null))[_0x7711('0x45')](handleError(_0x4b631a,null));};exports['destroy']=function(_0x48be7d,_0x132eb5){return db['Dashboard'][_0x7711('0x4c')]({'where':{'id':_0x48be7d[_0x7711('0x47')]['id']}})['then'](handleEntityNotFound(_0x132eb5,null))[_0x7711('0x27')](removeEntity(_0x132eb5,null))[_0x7711('0x45')](handleError(_0x132eb5,null));};function widgetAttributes(_0x233874){try{switch(_0x233874['type']){case _0x7711('0x5a'):return[{'name':_0x7711('0x5b'),'value':_0x233874['attrUrl']||(_0x233874['attrs']&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874['attrs'][0x0][_0x7711('0x5d')]:undefined)||_0x7711('0x5e')}];case _0x7711('0x5f'):return[{'name':_0x7711('0x60'),'value':_0x233874[_0x7711('0x60')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874[_0x7711('0x5c')][0x0][_0x7711('0x5d')]:undefined)||''}];case _0x7711('0x61'):return[{'name':_0x7711('0x62'),'value':_0x233874['attrHourFormat']||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874['attrs'][0x0][_0x7711('0x5d')]:undefined)||_0x7711('0x63')},{'name':_0x7711('0x64'),'value':_0x233874[_0x7711('0x64')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x1]?_0x233874['attrs'][0x1]['value']:undefined)||'0.00'},{'name':_0x7711('0x65'),'value':_0x233874[_0x7711('0x65')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x2]?_0x233874[_0x7711('0x5c')][0x2][_0x7711('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0x7711('0x66'),'value':_0x233874[_0x7711('0x66')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874[_0x7711('0x5c')][0x0][_0x7711('0x5d')]:undefined)||_0x7711('0x67')},{'name':_0x7711('0x68'),'value':_0x233874[_0x7711('0x68')]||(_0x233874['attrs']&&_0x233874[_0x7711('0x5c')][0x1]?_0x233874[_0x7711('0x5c')][0x1][_0x7711('0x5d')]:undefined)||[]},{'name':'attrFontSize','value':_0x233874['attrFontSize']||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x2]?_0x233874['attrs'][0x2][_0x7711('0x5d')]:undefined)||0x14},{'name':'attrChannel','value':_0x233874[_0x7711('0x69')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x3]?_0x233874[_0x7711('0x5c')][0x3][_0x7711('0x5d')]:undefined)||_0x7711('0x6a')},{'name':_0x7711('0x6b'),'value':_0x233874[_0x7711('0x6b')]||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x4]?_0x233874[_0x7711('0x5c')][0x4]['value']:undefined)||''},{'name':_0x7711('0x6c'),'value':_0x233874[_0x7711('0x6c')]||(_0x233874['attrs']&&_0x233874[_0x7711('0x5c')][0x5]?_0x233874[_0x7711('0x5c')][0x5][_0x7711('0x5d')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x233874[_0x7711('0x6d')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x6]?_0x233874[_0x7711('0x5c')][0x6][_0x7711('0x5d')]:undefined)||''},{'name':_0x7711('0x6e'),'value':_0x233874[_0x7711('0x6e')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x7]?_0x233874[_0x7711('0x5c')][0x7][_0x7711('0x5d')]:undefined)||''},{'name':_0x7711('0x6f'),'value':_0x233874[_0x7711('0x6f')]||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x8]?_0x233874[_0x7711('0x5c')][0x8][_0x7711('0x5d')]:undefined)||''},{'name':_0x7711('0x70'),'value':_0x233874[_0x7711('0x70')]||(_0x233874['attrs']&&_0x233874[_0x7711('0x5c')][0x9]?_0x233874[_0x7711('0x5c')][0x9][_0x7711('0x5d')]:undefined)||''}];case'multibar-chart':case'pie-chart':return[{'name':_0x7711('0x71'),'value':_0x233874[_0x7711('0x71')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874[_0x7711('0x5c')][0x0][_0x7711('0x5d')]:undefined)||_0x7711('0x67')},{'name':_0x7711('0x72'),'value':_0x233874[_0x7711('0x72')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x1]?_0x233874['attrs'][0x1]['value']:undefined)||null},{'name':_0x7711('0x73'),'value':_0x233874[_0x7711('0x73')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x2]?_0x233874[_0x7711('0x5c')][0x2][_0x7711('0x5d')]:undefined)||null},{'name':_0x7711('0x68'),'value':_0x233874[_0x7711('0x68')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x3]?_0x233874[_0x7711('0x5c')][0x3][_0x7711('0x5d')]:undefined)||[]},{'name':_0x7711('0x69'),'value':_0x233874['attrChannel']||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x4]?_0x233874[_0x7711('0x5c')][0x4][_0x7711('0x5d')]:undefined)||_0x7711('0x6a')},{'name':'attrEmailAccounts','value':_0x233874['attrEmailAccounts']||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x5]?_0x233874[_0x7711('0x5c')][0x5]['value']:undefined)||''},{'name':_0x7711('0x6c'),'value':_0x233874[_0x7711('0x6c')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x6]?_0x233874[_0x7711('0x5c')][0x6]['value']:undefined)||''},{'name':_0x7711('0x6d'),'value':_0x233874[_0x7711('0x6d')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x7]?_0x233874['attrs'][0x7][_0x7711('0x5d')]:undefined)||''},{'name':_0x7711('0x6e'),'value':_0x233874[_0x7711('0x6e')]||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x8]?_0x233874[_0x7711('0x5c')][0x8]['value']:undefined)||''},{'name':_0x7711('0x6f'),'value':_0x233874['attrWhatsappAccounts']||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x9]?_0x233874[_0x7711('0x5c')][0x9][_0x7711('0x5d')]:undefined)||''},{'name':_0x7711('0x70'),'value':_0x233874[_0x7711('0x70')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0xa]?_0x233874['attrs'][0xa][_0x7711('0x5d')]:undefined)||''}];case'web-report':return[{'name':_0x7711('0x74'),'type':_0x233874['reportType']||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x0]?_0x233874[_0x7711('0x5c')][0x0][_0x7711('0x32')]:undefined)||null,'value':_0x233874[_0x7711('0x74')]||(_0x233874[_0x7711('0x5c')]&&_0x233874['attrs'][0x0]?_0x233874[_0x7711('0x5c')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x233874[_0x7711('0x75')]||(_0x233874[_0x7711('0x5c')]&&_0x233874[_0x7711('0x5c')][0x1]?_0x233874[_0x7711('0x5c')][0x1][_0x7711('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x52afe9){logger[_0x7711('0x2a')](_0x7711('0x76'),JSON[_0x7711('0x77')](_0x52afe9));return[];}}exports[_0x7711('0x78')]=function(_0x18023e,_0x3e10f7,_0x4f6bc2){if(_0x18023e[_0x7711('0x4e')]['id']){delete _0x18023e['body']['id'];}return db['Dashboard'][_0x7711('0x4c')]({'where':{'id':_0x18023e[_0x7711('0x47')]['id']}})['then'](handleEntityNotFound(_0x3e10f7,null))[_0x7711('0x27')](function(_0x2362f4){if(_0x2362f4){_0x18023e[_0x7711('0x4e')][_0x7711('0x79')]=_0x2362f4['id'];_0x18023e[_0x7711('0x4e')]['attrs']=widgetAttributes(_0x18023e[_0x7711('0x4e')]);return db[_0x7711('0x7a')][_0x7711('0x4d')](_0x18023e[_0x7711('0x4e')]);}})[_0x7711('0x27')](respondWithResult(_0x3e10f7,null))[_0x7711('0x45')](handleError(_0x3e10f7,null));};exports[_0x7711('0x7b')]=function(_0x4b677e,_0x284084,_0x95e358){var _0x527645={};var _0x153eda={};var _0x25cf0e;var _0x541949;return db[_0x7711('0x2f')]['findOne']({'where':{'id':_0x4b677e['params']['id']}})[_0x7711('0x27')](handleEntityNotFound(_0x284084,null))['then'](function(_0x18b4d5){if(_0x18b4d5){_0x25cf0e=_0x18b4d5;_0x153eda[_0x7711('0x48')]=_[_0x7711('0x49')](db['DashboardItem'][_0x7711('0x30')]);_0x153eda[_0x7711('0x34')]=_[_0x7711('0x49')](_0x4b677e[_0x7711('0x34')]);_0x153eda[_0x7711('0x35')]=_['intersection'](_0x153eda['model'],_0x153eda[_0x7711('0x34')]);_0x527645[_0x7711('0x38')]=_[_0x7711('0x36')](_0x153eda[_0x7711('0x48')],qs['fields'](_0x4b677e[_0x7711('0x34')][_0x7711('0x37')]));_0x527645[_0x7711('0x38')]=_0x527645[_0x7711('0x38')][_0x7711('0x39')]?_0x527645['attributes']:_0x153eda[_0x7711('0x48')];_0x527645['order']=qs[_0x7711('0x3c')](_0x4b677e[_0x7711('0x34')][_0x7711('0x3c')]);_0x527645[_0x7711('0x3d')]=qs['filters'](_[_0x7711('0x3e')](_0x4b677e[_0x7711('0x34')],_0x153eda[_0x7711('0x35')]));if(_0x4b677e[_0x7711('0x34')][_0x7711('0x41')]){_0x527645[_0x7711('0x3d')]=_[_0x7711('0x3f')](_0x527645[_0x7711('0x3d')],{'$or':_[_0x7711('0x2e')](_0x527645[_0x7711('0x38')],function(_0x17c6e3){var _0x5f5d97={};_0x5f5d97[_0x17c6e3]={'$like':'%'+_0x4b677e[_0x7711('0x34')]['filter']+'%'};return _0x5f5d97;})});}_0x527645=_[_0x7711('0x3f')]({},_0x527645,_0x4b677e['options']);return _0x25cf0e[_0x7711('0x7b')](_0x527645);}})[_0x7711('0x27')](function(_0x22ee3e){if(_0x22ee3e){_0x541949=_0x22ee3e[_0x7711('0x39')];if(!_0x4b677e[_0x7711('0x34')][_0x7711('0x3a')]('nolimit')){_0x527645[_0x7711('0x21')]=qs[_0x7711('0x21')](_0x4b677e[_0x7711('0x34')][_0x7711('0x21')]);_0x527645[_0x7711('0x1f')]=qs['offset'](_0x4b677e[_0x7711('0x34')][_0x7711('0x1f')]);}return _0x25cf0e[_0x7711('0x7b')](_0x527645);}})[_0x7711('0x27')](function(_0x2eae00){if(_0x2eae00){return _0x2eae00?{'count':_0x541949,'rows':_0x2eae00}:null;}})['then'](respondWithResult(_0x284084,null))[_0x7711('0x45')](handleError(_0x284084,null));};
\ No newline at end of file
+var _0x709b=['options','includeAll','include','findAll','rows','catch','show','params','fields','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','find','omit','createdAt','updatedAt','create','body','role','CustomDashboards','UserProfileSection','userProfileId','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total','attrSerie3','attrVoiceQueues','voice','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','undefined','limit','count','offset','json','apply','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','Dashboard','rawAttributes','key','model','map','name','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL'];(function(_0x39c7fd,_0x390dd1){var _0x43f1e7=function(_0x3b475b){while(--_0x3b475b){_0x39c7fd['push'](_0x39c7fd['shift']());}};_0x43f1e7(++_0x390dd1);}(_0x709b,0x1c6));var _0xb709=function(_0x3fe735,_0xce2fbb){_0x3fe735=_0x3fe735-0x0;var _0x4e546a=_0x709b[_0x3fe735];return _0x4e546a;};'use strict';var emlformat=require(_0xb709('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb709('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb709('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xb709('0x3'));var util=require('util');var path=require(_0xb709('0x4'));var sox=require(_0xb709('0x5'));var csv=require(_0xb709('0x6'));var ejs=require(_0xb709('0x7'));var fs=require('fs');var fs_extra=require(_0xb709('0x8'));var _=require(_0xb709('0x9'));var squel=require(_0xb709('0xa'));var crypto=require('crypto');var jsforce=require(_0xb709('0xb'));var deskjs=require(_0xb709('0xc'));var toCsv=require(_0xb709('0x6'));var querystring=require(_0xb709('0xd'));var Papa=require(_0xb709('0xe'));var Redis=require(_0xb709('0xf'));var authService=require(_0xb709('0x10'));var qs=require(_0xb709('0x11'));var as=require(_0xb709('0x12'));var hardwareService=require(_0xb709('0x13'));var logger=require(_0xb709('0x14'))(_0xb709('0x15'));var utils=require(_0xb709('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb709('0x17'));var db=require(_0xb709('0x18'))['db'];config['redis']=_[_0xb709('0x19')](config[_0xb709('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xb709('0x1b'))(new Redis(config['redis']));require(_0xb709('0x1c'))[_0xb709('0x1d')](socket);function respondWithStatusCode(_0x2ba260,_0x4083fe){_0x4083fe=_0x4083fe||0xcc;return function(_0x5d3a6d){if(_0x5d3a6d){return _0x2ba260[_0xb709('0x1e')](_0x4083fe);}return _0x2ba260[_0xb709('0x1f')](_0x4083fe)[_0xb709('0x20')]();};}function respondWithResult(_0x1584b8,_0x2db74a){_0x2db74a=_0x2db74a||0xc8;return function(_0x48ac15){if(_0x48ac15){return _0x1584b8[_0xb709('0x1f')](_0x2db74a)['json'](_0x48ac15);}};}function respondWithFilteredResult(_0x350a85,_0xf07e9a){return function(_0x3ec819){if(_0x3ec819){var _0x21fa18=typeof _0xf07e9a['offset']===_0xb709('0x21')&&typeof _0xf07e9a[_0xb709('0x22')]==='undefined';var _0x1e26aa=_0x3ec819[_0xb709('0x23')];var _0x5f18e4=_0x21fa18?0x0:_0xf07e9a[_0xb709('0x24')];var _0x3bd3f9=_0x21fa18?_0x3ec819[_0xb709('0x23')]:_0xf07e9a['offset']+_0xf07e9a[_0xb709('0x22')];var _0x49c13c;if(_0x3bd3f9>=_0x1e26aa){_0x3bd3f9=_0x1e26aa;_0x49c13c=0xc8;}else{_0x49c13c=0xce;}_0x350a85[_0xb709('0x1f')](_0x49c13c);return _0x350a85['set']('Content-Range',_0x5f18e4+'-'+_0x3bd3f9+'/'+_0x1e26aa)[_0xb709('0x25')](_0x3ec819);}return null;};}function patchUpdates(_0x3babdd){return function(_0x2ab432){try{jsonpatch[_0xb709('0x26')](_0x2ab432,_0x3babdd,!![]);}catch(_0x2da008){return BPromise['reject'](_0x2da008);}return _0x2ab432[_0xb709('0x27')]();};}function saveUpdates(_0x1d33cf,_0x10fb5e){return function(_0xf57b23){if(_0xf57b23){return _0xf57b23[_0xb709('0x28')](_0x1d33cf)[_0xb709('0x29')](function(_0x43a7de){return _0x43a7de;});}return null;};}function removeEntity(_0x4a695a,_0x4d10cb){return function(_0x32eb50){if(_0x32eb50){return _0x32eb50[_0xb709('0x2a')]()[_0xb709('0x29')](function(){var _0x27ee38=_0x32eb50[_0xb709('0x2b')]({'plain':!![]});var _0x2eb15d='CustomDashboards';return db[_0xb709('0x2c')]['destroy']({'where':{'type':_0x2eb15d,'resourceId':_0x27ee38['id']}})[_0xb709('0x29')](function(){return _0x32eb50;});})[_0xb709('0x29')](function(){_0x4a695a[_0xb709('0x1f')](0xcc)[_0xb709('0x20')]();});}};}function handleEntityNotFound(_0x300d29,_0x1f51cb){return function(_0x22d75e){if(!_0x22d75e){_0x300d29[_0xb709('0x1e')](0x194);}return _0x22d75e;};}function handleError(_0x165d95,_0x185abf){_0x185abf=_0x185abf||0x1f4;return function(_0x1e8727){logger[_0xb709('0x2d')](_0x1e8727[_0xb709('0x2e')]);if(_0x1e8727['name']){delete _0x1e8727['name'];}_0x165d95[_0xb709('0x1f')](_0x185abf)[_0xb709('0x2f')](_0x1e8727);};}exports[_0xb709('0x30')]=function(_0x4caa4a,_0x511d9b){var _0x562824={},_0xe536d6={},_0x43733e={'count':0x0,'rows':[]};var _0x31b187=_['map'](db[_0xb709('0x31')][_0xb709('0x32')],function(_0x134995){return{'name':_0x134995['fieldName'],'type':_0x134995['type'][_0xb709('0x33')]};});_0xe536d6[_0xb709('0x34')]=_[_0xb709('0x35')](_0x31b187,_0xb709('0x36'));_0xe536d6['query']=_[_0xb709('0x37')](_0x4caa4a[_0xb709('0x38')]);_0xe536d6[_0xb709('0x39')]=_[_0xb709('0x3a')](_0xe536d6[_0xb709('0x34')],_0xe536d6[_0xb709('0x38')]);_0x562824[_0xb709('0x3b')]=_[_0xb709('0x3a')](_0xe536d6[_0xb709('0x34')],qs['fields'](_0x4caa4a[_0xb709('0x38')]['fields']));_0x562824['attributes']=_0x562824['attributes'][_0xb709('0x3c')]?_0x562824['attributes']:_0xe536d6[_0xb709('0x34')];if(!_0x4caa4a[_0xb709('0x38')][_0xb709('0x3d')](_0xb709('0x3e'))){_0x562824[_0xb709('0x22')]=qs[_0xb709('0x22')](_0x4caa4a['query'][_0xb709('0x22')]);_0x562824[_0xb709('0x24')]=qs[_0xb709('0x24')](_0x4caa4a[_0xb709('0x38')][_0xb709('0x24')]);}_0x562824['order']=qs[_0xb709('0x3f')](_0x4caa4a[_0xb709('0x38')][_0xb709('0x3f')]);_0x562824[_0xb709('0x40')]=qs['filters'](_[_0xb709('0x41')](_0x4caa4a[_0xb709('0x38')],_0xe536d6[_0xb709('0x39')]),_0x31b187);if(_0x4caa4a['query'][_0xb709('0x42')]){_0x562824[_0xb709('0x40')]=_[_0xb709('0x43')](_0x562824[_0xb709('0x40')],{'$or':_['map'](_0x31b187,function(_0x130177){if(_0x130177[_0xb709('0x44')]!==_0xb709('0x45')){var _0x3d3002={};_0x3d3002[_0x130177[_0xb709('0x36')]]={'$like':'%'+_0x4caa4a['query'][_0xb709('0x42')]+'%'};return _0x3d3002;}})});}_0x562824=_[_0xb709('0x43')]({},_0x562824,_0x4caa4a[_0xb709('0x46')]);var _0x11d8a2={'where':_0x562824[_0xb709('0x40')]};return db[_0xb709('0x31')][_0xb709('0x23')](_0x11d8a2)[_0xb709('0x29')](function(_0x294585){_0x43733e[_0xb709('0x23')]=_0x294585;if(_0x4caa4a[_0xb709('0x38')][_0xb709('0x47')]){_0x562824[_0xb709('0x48')]=[{'all':!![]}];}return db[_0xb709('0x31')][_0xb709('0x49')](_0x562824);})['then'](function(_0xc94702){_0x43733e[_0xb709('0x4a')]=_0xc94702;return _0x43733e;})['then'](respondWithFilteredResult(_0x511d9b,_0x562824))[_0xb709('0x4b')](handleError(_0x511d9b,null));};exports[_0xb709('0x4c')]=function(_0x2d7ead,_0x36f8be){var _0x32c368={'raw':![],'where':{'id':_0x2d7ead[_0xb709('0x4d')]['id']}},_0x2497a7={};_0x2497a7[_0xb709('0x34')]=_['keys'](db['Dashboard'][_0xb709('0x32')]);_0x2497a7[_0xb709('0x38')]=_[_0xb709('0x37')](_0x2d7ead[_0xb709('0x38')]);_0x2497a7[_0xb709('0x39')]=_['intersection'](_0x2497a7[_0xb709('0x34')],_0x2497a7['query']);_0x32c368[_0xb709('0x3b')]=_[_0xb709('0x3a')](_0x2497a7[_0xb709('0x34')],qs[_0xb709('0x4e')](_0x2d7ead[_0xb709('0x38')][_0xb709('0x4e')]));_0x32c368[_0xb709('0x3b')]=_0x32c368[_0xb709('0x3b')][_0xb709('0x3c')]?_0x32c368[_0xb709('0x3b')]:_0x2497a7[_0xb709('0x34')];if(_0x2d7ead['query'][_0xb709('0x47')]){_0x32c368['include']=[{'all':!![]}];}_0x32c368=_[_0xb709('0x43')]({},_0x32c368,_0x2d7ead[_0xb709('0x46')]);return db[_0xb709('0x31')]['find'](_0x32c368)[_0xb709('0x29')](handleEntityNotFound(_0x36f8be,null))['then'](respondWithResult(_0x36f8be,null))[_0xb709('0x4b')](handleError(_0x36f8be,null));};exports['create']=function(_0x1ffdbc,_0x35cd5e){return db['Dashboard']['create'](_0x1ffdbc['body'],{})['then'](function(_0x21aade){var _0x48c921=_0x1ffdbc[_0xb709('0x4f')][_0xb709('0x2b')]({'plain':!![]});if(!_0x48c921)throw new Error(_0xb709('0x50'));if(_0x48c921['role']===_0xb709('0x4f')){var _0x15fd8c=_0x21aade[_0xb709('0x2b')]({'plain':!![]});var _0x4870b5='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x4870b5,'userProfileId':_0x48c921['userProfileId']},'raw':!![]})[_0xb709('0x29')](function(_0x350c57){if(_0x350c57&&_0x350c57[_0xb709('0x51')]===0x0){return db[_0xb709('0x2c')]['create']({'name':_0x15fd8c['name'],'resourceId':_0x15fd8c['id'],'type':_0x350c57[_0xb709('0x36')],'sectionId':_0x350c57['id']},{})[_0xb709('0x29')](function(){return _0x21aade;});}else{return _0x21aade;}})[_0xb709('0x4b')](function(_0x49c29c){logger[_0xb709('0x2d')](_0xb709('0x52'),_0x49c29c);throw _0x49c29c;});}return _0x21aade;})[_0xb709('0x29')](respondWithResult(_0x35cd5e,0xc9))[_0xb709('0x4b')](handleError(_0x35cd5e,null));};exports[_0xb709('0x53')]=function(_0x23a887,_0x34742c){var _0x169c78={'where':{'id':_0x23a887[_0xb709('0x4d')]['id']}},_0x28a824={};_0x28a824[_0xb709('0x34')]=_['keys'](db['Dashboard'][_0xb709('0x32')]);_0x169c78[_0xb709('0x3b')]=_[_0xb709('0x3a')](_0x28a824[_0xb709('0x34')],qs['fields'](_0x23a887[_0xb709('0x38')][_0xb709('0x4e')]));_0x169c78['attributes']=_0x169c78[_0xb709('0x3b')]['length']?_0x169c78[_0xb709('0x3b')]:_0x28a824[_0xb709('0x34')];if(_0x23a887[_0xb709('0x38')][_0xb709('0x47')]){_0x169c78[_0xb709('0x48')]=[{'all':!![]}];}_0x169c78=_[_0xb709('0x43')]({},_0x169c78,_0x23a887[_0xb709('0x46')]);return db[_0xb709('0x31')][_0xb709('0x54')](_0x169c78)[_0xb709('0x29')](handleEntityNotFound(_0x34742c,null))[_0xb709('0x29')](function(_0x4503fd){if(_0x4503fd){var _0x6efdd4=_0x4503fd['get']({'plain':!![]});_0x6efdd4=qs[_0xb709('0x55')](_0x6efdd4,['id',_0xb709('0x56'),'updatedAt']);_0x23a887['body']=_[_0xb709('0x55')](_0x23a887['body'],['id',_0xb709('0x56'),_0xb709('0x57')]);return db[_0xb709('0x31')][_0xb709('0x58')](_[_0xb709('0x43')](_0x6efdd4,_0x23a887[_0xb709('0x59')]),{'include':_0x23a887[_0xb709('0x38')][_0xb709('0x47')]?[{'all':!![]}]:undefined})[_0xb709('0x29')](function(_0xafa6e){var _0x3566c9=_0x23a887[_0xb709('0x4f')][_0xb709('0x2b')]({'plain':!![]});if(!_0x3566c9)throw new Error(_0xb709('0x50'));if(_0x3566c9[_0xb709('0x5a')]===_0xb709('0x4f')){var _0x134ed5=_0xafa6e[_0xb709('0x2b')]({'plain':!![]});var _0x39d0ed=_0xb709('0x5b');return db[_0xb709('0x5c')][_0xb709('0x54')]({'where':{'name':_0x39d0ed,'userProfileId':_0x3566c9[_0xb709('0x5d')]},'raw':!![]})['then'](function(_0x53abde){if(_0x53abde&&_0x53abde[_0xb709('0x51')]===0x0){return db['UserProfileResource'][_0xb709('0x58')]({'name':_0x134ed5['name'],'resourceId':_0x134ed5['id'],'type':_0x53abde[_0xb709('0x36')],'sectionId':_0x53abde['id']},{})[_0xb709('0x29')](function(){return _0xafa6e;});}else{return _0xafa6e;}})[_0xb709('0x4b')](function(_0xcfefa3){logger[_0xb709('0x2d')](_0xb709('0x52'),_0xcfefa3);throw _0xcfefa3;});}return _0xafa6e;});}})[_0xb709('0x29')](respondWithResult(_0x34742c,0xc9))[_0xb709('0x4b')](handleError(_0x34742c,null));};exports[_0xb709('0x28')]=function(_0x511374,_0x569fb7){if(_0x511374[_0xb709('0x59')]['id']){delete _0x511374[_0xb709('0x59')]['id'];}return db['Dashboard'][_0xb709('0x54')]({'where':{'id':_0x511374[_0xb709('0x4d')]['id']}})[_0xb709('0x29')](handleEntityNotFound(_0x569fb7,null))[_0xb709('0x29')](saveUpdates(_0x511374['body'],null))['then'](respondWithResult(_0x569fb7,null))[_0xb709('0x4b')](handleError(_0x569fb7,null));};exports[_0xb709('0x2a')]=function(_0x1dd0f0,_0x37fff3){return db[_0xb709('0x31')][_0xb709('0x54')]({'where':{'id':_0x1dd0f0[_0xb709('0x4d')]['id']}})[_0xb709('0x29')](handleEntityNotFound(_0x37fff3,null))[_0xb709('0x29')](removeEntity(_0x37fff3,null))[_0xb709('0x4b')](handleError(_0x37fff3,null));};function widgetAttributes(_0xaf0a80){try{switch(_0xaf0a80[_0xb709('0x44')]){case'iframe':return[{'name':_0xb709('0x5e'),'value':_0xaf0a80[_0xb709('0x5e')]||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80['attrs'][0x0][_0xb709('0x60')]:undefined)||_0xb709('0x61')}];case _0xb709('0x62'):return[{'name':_0xb709('0x63'),'value':_0xaf0a80[_0xb709('0x63')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80[_0xb709('0x5f')][0x0][_0xb709('0x60')]:undefined)||''}];case _0xb709('0x64'):return[{'name':'attrHourFormat','value':_0xaf0a80[_0xb709('0x65')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80[_0xb709('0x5f')][0x0][_0xb709('0x60')]:undefined)||_0xb709('0x66')},{'name':_0xb709('0x67'),'value':_0xaf0a80[_0xb709('0x67')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x1]?_0xaf0a80['attrs'][0x1]['value']:undefined)||_0xb709('0x68')},{'name':_0xb709('0x69'),'value':_0xaf0a80[_0xb709('0x69')]||(_0xaf0a80['attrs']&&_0xaf0a80['attrs'][0x2]?_0xaf0a80[_0xb709('0x5f')][0x2]['value']:undefined)||0xc}];case _0xb709('0x6a'):return[{'name':'attrMetric','value':_0xaf0a80[_0xb709('0x6b')]||(_0xaf0a80['attrs']&&_0xaf0a80['attrs'][0x0]?_0xaf0a80[_0xb709('0x5f')][0x0][_0xb709('0x60')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xaf0a80['attrVoiceQueues']||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x1]?_0xaf0a80[_0xb709('0x5f')][0x1][_0xb709('0x60')]:undefined)||[]},{'name':_0xb709('0x69'),'value':_0xaf0a80[_0xb709('0x69')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x2]?_0xaf0a80[_0xb709('0x5f')][0x2][_0xb709('0x60')]:undefined)||0x14},{'name':'attrChannel','value':_0xaf0a80[_0xb709('0x6c')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x3]?_0xaf0a80[_0xb709('0x5f')][0x3]['value']:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0xaf0a80[_0xb709('0x6d')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x4]?_0xaf0a80[_0xb709('0x5f')][0x4][_0xb709('0x60')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xaf0a80[_0xb709('0x6e')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x5]?_0xaf0a80[_0xb709('0x5f')][0x5][_0xb709('0x60')]:undefined)||''},{'name':'attrSmsAccounts','value':_0xaf0a80[_0xb709('0x6f')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x6]?_0xaf0a80[_0xb709('0x5f')][0x6]['value']:undefined)||''},{'name':_0xb709('0x70'),'value':_0xaf0a80['attrOpenchannelAccounts']||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x7]?_0xaf0a80[_0xb709('0x5f')][0x7][_0xb709('0x60')]:undefined)||''},{'name':_0xb709('0x71'),'value':_0xaf0a80[_0xb709('0x71')]||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x8]?_0xaf0a80[_0xb709('0x5f')][0x8]['value']:undefined)||''},{'name':_0xb709('0x72'),'value':_0xaf0a80[_0xb709('0x72')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x9]?_0xaf0a80[_0xb709('0x5f')][0x9][_0xb709('0x60')]:undefined)||''}];case _0xb709('0x73'):case _0xb709('0x74'):return[{'name':_0xb709('0x75'),'value':_0xaf0a80[_0xb709('0x75')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80[_0xb709('0x5f')][0x0][_0xb709('0x60')]:undefined)||_0xb709('0x76')},{'name':'attrSerie2','value':_0xaf0a80['attrSerie2']||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80['attrs'][0x1]?_0xaf0a80['attrs'][0x1][_0xb709('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0xaf0a80[_0xb709('0x77')]||(_0xaf0a80['attrs']&&_0xaf0a80['attrs'][0x2]?_0xaf0a80[_0xb709('0x5f')][0x2][_0xb709('0x60')]:undefined)||null},{'name':_0xb709('0x78'),'value':_0xaf0a80[_0xb709('0x78')]||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x3]?_0xaf0a80[_0xb709('0x5f')][0x3][_0xb709('0x60')]:undefined)||[]},{'name':_0xb709('0x6c'),'value':_0xaf0a80['attrChannel']||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80['attrs'][0x4]?_0xaf0a80[_0xb709('0x5f')][0x4]['value']:undefined)||_0xb709('0x79')},{'name':_0xb709('0x6d'),'value':_0xaf0a80[_0xb709('0x6d')]||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x5]?_0xaf0a80[_0xb709('0x5f')][0x5][_0xb709('0x60')]:undefined)||''},{'name':'attrFaxAccounts','value':_0xaf0a80['attrFaxAccounts']||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80['attrs'][0x6]?_0xaf0a80[_0xb709('0x5f')][0x6][_0xb709('0x60')]:undefined)||''},{'name':_0xb709('0x6f'),'value':_0xaf0a80[_0xb709('0x6f')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80['attrs'][0x7]?_0xaf0a80['attrs'][0x7][_0xb709('0x60')]:undefined)||''},{'name':_0xb709('0x70'),'value':_0xaf0a80[_0xb709('0x70')]||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x8]?_0xaf0a80[_0xb709('0x5f')][0x8]['value']:undefined)||''},{'name':_0xb709('0x71'),'value':_0xaf0a80['attrWhatsappAccounts']||(_0xaf0a80['attrs']&&_0xaf0a80['attrs'][0x9]?_0xaf0a80['attrs'][0x9][_0xb709('0x60')]:undefined)||''},{'name':_0xb709('0x72'),'value':_0xaf0a80[_0xb709('0x72')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80['attrs'][0xa]?_0xaf0a80[_0xb709('0x5f')][0xa][_0xb709('0x60')]:undefined)||''}];case _0xb709('0x7a'):return[{'name':_0xb709('0x7b'),'type':_0xaf0a80['reportType']||(_0xaf0a80['attrs']&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80['attrs'][0x0]['type']:undefined)||null,'value':_0xaf0a80[_0xb709('0x7b')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x0]?_0xaf0a80[_0xb709('0x5f')][0x0]['value']:undefined)||null},{'name':_0xb709('0x7c'),'value':_0xaf0a80[_0xb709('0x7c')]||(_0xaf0a80[_0xb709('0x5f')]&&_0xaf0a80[_0xb709('0x5f')][0x1]?_0xaf0a80[_0xb709('0x5f')][0x1][_0xb709('0x60')]:undefined)||0x0}];default:return[];}}catch(_0x4350b8){logger[_0xb709('0x2d')](_0xb709('0x7d'),JSON[_0xb709('0x7e')](_0x4350b8));return[];}}exports[_0xb709('0x7f')]=function(_0x55fe65,_0x26d7ce,_0x56339a){if(_0x55fe65['body']['id']){delete _0x55fe65['body']['id'];}return db[_0xb709('0x31')][_0xb709('0x54')]({'where':{'id':_0x55fe65[_0xb709('0x4d')]['id']}})['then'](handleEntityNotFound(_0x26d7ce,null))['then'](function(_0x7710fa){if(_0x7710fa){_0x55fe65[_0xb709('0x59')][_0xb709('0x80')]=_0x7710fa['id'];_0x55fe65['body']['attrs']=widgetAttributes(_0x55fe65[_0xb709('0x59')]);return db[_0xb709('0x81')][_0xb709('0x58')](_0x55fe65[_0xb709('0x59')]);}})['then'](respondWithResult(_0x26d7ce,null))['catch'](handleError(_0x26d7ce,null));};exports[_0xb709('0x82')]=function(_0x1cd9ce,_0x3661ee,_0x4fc355){var _0x2cd784={};var _0x3076c6={};var _0x2a6ad3;var _0x2d74c9;return db['Dashboard']['findOne']({'where':{'id':_0x1cd9ce[_0xb709('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3661ee,null))[_0xb709('0x29')](function(_0x18698e){if(_0x18698e){_0x2a6ad3=_0x18698e;_0x3076c6[_0xb709('0x34')]=_['keys'](db[_0xb709('0x81')][_0xb709('0x32')]);_0x3076c6[_0xb709('0x38')]=_['keys'](_0x1cd9ce[_0xb709('0x38')]);_0x3076c6[_0xb709('0x39')]=_['intersection'](_0x3076c6[_0xb709('0x34')],_0x3076c6[_0xb709('0x38')]);_0x2cd784[_0xb709('0x3b')]=_['intersection'](_0x3076c6[_0xb709('0x34')],qs[_0xb709('0x4e')](_0x1cd9ce[_0xb709('0x38')][_0xb709('0x4e')]));_0x2cd784[_0xb709('0x3b')]=_0x2cd784['attributes']['length']?_0x2cd784[_0xb709('0x3b')]:_0x3076c6[_0xb709('0x34')];_0x2cd784['order']=qs[_0xb709('0x3f')](_0x1cd9ce[_0xb709('0x38')][_0xb709('0x3f')]);_0x2cd784[_0xb709('0x40')]=qs['filters'](_[_0xb709('0x41')](_0x1cd9ce[_0xb709('0x38')],_0x3076c6[_0xb709('0x39')]));if(_0x1cd9ce[_0xb709('0x38')][_0xb709('0x42')]){_0x2cd784[_0xb709('0x40')]=_[_0xb709('0x43')](_0x2cd784['where'],{'$or':_[_0xb709('0x35')](_0x2cd784['attributes'],function(_0xa55c81){var _0x32b44c={};_0x32b44c[_0xa55c81]={'$like':'%'+_0x1cd9ce['query'][_0xb709('0x42')]+'%'};return _0x32b44c;})});}_0x2cd784=_[_0xb709('0x43')]({},_0x2cd784,_0x1cd9ce[_0xb709('0x46')]);return _0x2a6ad3[_0xb709('0x82')](_0x2cd784);}})[_0xb709('0x29')](function(_0x1e410d){if(_0x1e410d){_0x2d74c9=_0x1e410d[_0xb709('0x3c')];if(!_0x1cd9ce[_0xb709('0x38')]['hasOwnProperty']('nolimit')){_0x2cd784[_0xb709('0x22')]=qs[_0xb709('0x22')](_0x1cd9ce[_0xb709('0x38')]['limit']);_0x2cd784[_0xb709('0x24')]=qs[_0xb709('0x24')](_0x1cd9ce[_0xb709('0x38')][_0xb709('0x24')]);}return _0x2a6ad3['getItems'](_0x2cd784);}})['then'](function(_0x37c499){if(_0x37c499){return _0x37c499?{'count':_0x2d74c9,'rows':_0x37c499}:null;}})[_0xb709('0x29')](respondWithResult(_0x3661ee,null))[_0xb709('0x4b')](handleError(_0x3661ee,null));};
\ No newline at end of file
index 763e757..27c51b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8bb=['Dashboard','setMaxListeners','save','emit','hook','exports','events','../../mysqldb'];(function(_0x441efd,_0x4b4443){var _0x506da9=function(_0x104b15){while(--_0x104b15){_0x441efd['push'](_0x441efd['shift']());}};_0x506da9(++_0x4b4443);}(_0xe8bb,0xfe));var _0xbe8b=function(_0x18a8a0,_0x3e5290){_0x18a8a0=_0x18a8a0-0x0;var _0x223153=_0xe8bb[_0x18a8a0];return _0x223153;};'use strict';var EventEmitter=require(_0xbe8b('0x0'));var Dashboard=require(_0xbe8b('0x1'))['db'][_0xbe8b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xbe8b('0x3')](0x0);var events={'afterCreate':_0xbe8b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44f6bd){return function(_0x2d5354,_0x1e2c4a,_0x51818c){DashboardEvents[_0xbe8b('0x5')](_0x44f6bd+':'+_0x2d5354['id'],_0x2d5354);DashboardEvents[_0xbe8b('0x5')](_0x44f6bd,_0x2d5354);_0x51818c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xbe8b('0x6')](e,emitEvent(event));}}module[_0xbe8b('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x80d5=['events','../../mysqldb','Dashboard','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x1aa7b1,_0xe9e31d){var _0x5d4ff4=function(_0x1b3036){while(--_0x1b3036){_0x1aa7b1['push'](_0x1aa7b1['shift']());}};_0x5d4ff4(++_0xe9e31d);}(_0x80d5,0x186));var _0x580d=function(_0x32dc1a,_0x2ca1cc){_0x32dc1a=_0x32dc1a-0x0;var _0x5680bb=_0x80d5[_0x32dc1a];return _0x5680bb;};'use strict';var EventEmitter=require(_0x580d('0x0'));var Dashboard=require(_0x580d('0x1'))['db'][_0x580d('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x580d('0x3')](0x0);var events={'afterCreate':_0x580d('0x4'),'afterUpdate':_0x580d('0x5'),'afterDestroy':_0x580d('0x6')};function emitEvent(_0x1c9eb2){return function(_0x3921e9,_0x3c84f9,_0x401c9e){DashboardEvents[_0x580d('0x7')](_0x1c9eb2+':'+_0x3921e9['id'],_0x3921e9);DashboardEvents['emit'](_0x1c9eb2,_0x3921e9);_0x401c9e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x580d('0x8')](e,emitEvent(event));}}module[_0x580d('0x9')]=DashboardEvents;
\ No newline at end of file
index ae0a856..2c427af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8f9=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','dashboards','lodash','../../config/logger','api','moment'];(function(_0x39db51,_0x4f2a22){var _0x11aa03=function(_0x16bde5){while(--_0x16bde5){_0x39db51['push'](_0x39db51['shift']());}};_0x11aa03(++_0x4f2a22);}(_0xb8f9,0xd8));var _0x9b8f=function(_0x15d203,_0x5b93ba){_0x15d203=_0x15d203-0x0;var _0x350cf6=_0xb8f9[_0x15d203];return _0x350cf6;};'use strict';var _=require(_0x9b8f('0x0'));var util=require('util');var logger=require(_0x9b8f('0x1'))(_0x9b8f('0x2'));var moment=require(_0x9b8f('0x3'));var BPromise=require('bluebird');var rp=require(_0x9b8f('0x4'));var fs=require('fs');var path=require(_0x9b8f('0x5'));var rimraf=require(_0x9b8f('0x6'));var config=require(_0x9b8f('0x7'));var attributes=require(_0x9b8f('0x8'));module[_0x9b8f('0x9')]=function(_0xa6e10f,_0x3d8708){return _0xa6e10f['define']('Dashboard',attributes,{'tableName':_0x9b8f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb8b=['request-promise','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','api','moment','bluebird'];(function(_0xb735ee,_0x44777c){var _0x1c5d05=function(_0x1f49d0){while(--_0x1f49d0){_0xb735ee['push'](_0xb735ee['shift']());}};_0x1c5d05(++_0x44777c);}(_0xbb8b,0x1e8));var _0xbbb8=function(_0xe55f04,_0x30a426){_0xe55f04=_0xe55f04-0x0;var _0x4f29df=_0xbb8b[_0xe55f04];return _0x4f29df;};'use strict';var _=require(_0xbbb8('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbbb8('0x1'));var moment=require(_0xbbb8('0x2'));var BPromise=require(_0xbbb8('0x3'));var rp=require(_0xbbb8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbbb8('0x5'));var config=require(_0xbbb8('0x6'));var attributes=require(_0xbbb8('0x7'));module[_0xbbb8('0x8')]=function(_0x556b49,_0xee801b){return _0x556b49[_0xbbb8('0x9')](_0xbbb8('0xa'),attributes,{'tableName':_0xbbb8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 06433fd..085996f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a1b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x3a1b,0x1a0));var _0xb3a1=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x3a1b[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0xb3a1('0x0'));var moment=require(_0xb3a1('0x1'));var BPromise=require(_0xb3a1('0x2'));var rs=require(_0xb3a1('0x3'));var fs=require('fs');var Redis=require(_0xb3a1('0x4'));var db=require(_0xb3a1('0x5'))['db'];var utils=require(_0xb3a1('0x6'));var logger=require(_0xb3a1('0x7'))(_0xb3a1('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb3a1('0x9')][_0xb3a1('0xa')]({'port':0x232a});config[_0xb3a1('0xb')]=_[_0xb3a1('0xc')](config[_0xb3a1('0xb')],{'host':_0xb3a1('0xd'),'port':0x18eb});var socket=require(_0xb3a1('0xe'))(new Redis(config[_0xb3a1('0xb')]));require(_0xb3a1('0xf'))[_0xb3a1('0x10')](socket);function respondWithRpcPromise(_0x4bb361,_0x2ad536,_0x5c8956){return new BPromise(function(_0x2a3140,_0x2eaf3e){return client[_0xb3a1('0x11')](_0x4bb361,_0x5c8956)[_0xb3a1('0x12')](function(_0x4c7f56){logger[_0xb3a1('0x13')](_0xb3a1('0x14'),_0x2ad536,_0xb3a1('0x15'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x2ad536,_0xb3a1('0x15'),JSON[_0xb3a1('0x16')](_0x4c7f56));if(_0x4c7f56['error']){if(_0x4c7f56['error'][_0xb3a1('0x17')]===0x1f4){logger['error'](_0xb3a1('0x14'),_0x2ad536,_0x4c7f56[_0xb3a1('0x18')]['message']);return _0x2eaf3e(_0x4c7f56[_0xb3a1('0x18')]['message']);}logger[_0xb3a1('0x18')]('Dashboard,\x20%s,\x20%s',_0x2ad536,_0x4c7f56[_0xb3a1('0x18')][_0xb3a1('0x19')]);return _0x2a3140(_0x4c7f56[_0xb3a1('0x18')][_0xb3a1('0x19')]);}else{logger[_0xb3a1('0x13')](_0xb3a1('0x14'),_0x2ad536,'request\x20sent');_0x2a3140(_0x4c7f56[_0xb3a1('0x1a')][_0xb3a1('0x19')]);}})[_0xb3a1('0x1b')](function(_0x2f0dd4){logger[_0xb3a1('0x18')]('Dashboard,\x20%s,\x20%s',_0x2ad536,_0x2f0dd4);_0x2eaf3e(_0x2f0dd4);});});}
\ No newline at end of file
+var _0xdc89=['../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xdc89,0x1ab));var _0x9dc8=function(_0x16df8f,_0x3dbe15){_0x16df8f=_0x16df8f-0x0;var _0x56ffee=_0xdc89[_0x16df8f];return _0x56ffee;};'use strict';var _=require(_0x9dc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9dc8('0x1'));var fs=require('fs');var Redis=require(_0x9dc8('0x2'));var db=require(_0x9dc8('0x3'))['db'];var utils=require(_0x9dc8('0x4'));var logger=require(_0x9dc8('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9dc8('0x6'));var client=jayson['client'][_0x9dc8('0x7')]({'port':0x232a});config[_0x9dc8('0x8')]=_[_0x9dc8('0x9')](config[_0x9dc8('0x8')],{'host':_0x9dc8('0xa'),'port':0x18eb});var socket=require(_0x9dc8('0xb'))(new Redis(config[_0x9dc8('0x8')]));require(_0x9dc8('0xc'))['register'](socket);function respondWithRpcPromise(_0x402725,_0x32a0c4,_0x345b07){return new BPromise(function(_0x1585d4,_0x2b7e16){return client['request'](_0x402725,_0x345b07)[_0x9dc8('0xd')](function(_0x278a47){logger[_0x9dc8('0xe')](_0x9dc8('0xf'),_0x32a0c4,_0x9dc8('0x10'));logger[_0x9dc8('0x11')](_0x9dc8('0x12'),_0x32a0c4,'request\x20sent',JSON[_0x9dc8('0x13')](_0x278a47));if(_0x278a47[_0x9dc8('0x14')]){if(_0x278a47[_0x9dc8('0x14')][_0x9dc8('0x15')]===0x1f4){logger[_0x9dc8('0x14')](_0x9dc8('0xf'),_0x32a0c4,_0x278a47[_0x9dc8('0x14')][_0x9dc8('0x16')]);return _0x2b7e16(_0x278a47[_0x9dc8('0x14')][_0x9dc8('0x16')]);}logger['error'](_0x9dc8('0xf'),_0x32a0c4,_0x278a47['error'][_0x9dc8('0x16')]);return _0x1585d4(_0x278a47[_0x9dc8('0x14')][_0x9dc8('0x16')]);}else{logger[_0x9dc8('0xe')](_0x9dc8('0xf'),_0x32a0c4,_0x9dc8('0x10'));_0x1585d4(_0x278a47['result']['message']);}})[_0x9dc8('0x17')](function(_0x1d420e){logger['error'](_0x9dc8('0xf'),_0x32a0c4,_0x1d420e);_0x2b7e16(_0x1d420e);});});}
\ No newline at end of file
index d7e36da..3597a95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee1=['save','update','register','length','dashboard:','./dashboard.events'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xbee1,0x179));var _0x1bee=function(_0x187eb4,_0x20dfaa){_0x187eb4=_0x187eb4-0x0;var _0x199226=_0xbee1[_0x187eb4];return _0x199226;};'use strict';var DashboardEvents=require(_0x1bee('0x0'));var events=[_0x1bee('0x1'),'remove',_0x1bee('0x2')];function createListener(_0x3aedc8,_0x39c28f){return function(_0x398af6){_0x39c28f['emit'](_0x3aedc8,_0x398af6);};}function removeListener(_0x1e6849,_0x4e0f1c){return function(){DashboardEvents['removeListener'](_0x1e6849,_0x4e0f1c);};}exports[_0x1bee('0x3')]=function(_0x1c557c){for(var _0x8c6cbd=0x0,_0x239ef9=events[_0x1bee('0x4')];_0x8c6cbd<_0x239ef9;_0x8c6cbd++){var _0x41286b=events[_0x8c6cbd];var _0x337529=createListener(_0x1bee('0x5')+_0x41286b,_0x1c557c);DashboardEvents['on'](_0x41286b,_0x337529);}};
\ No newline at end of file
+var _0xd445=['removeListener','dashboard:','save','remove','update','emit'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xd445,0x18e));var _0x5d44=function(_0x1ca5d5,_0x9d2cad){_0x1ca5d5=_0x1ca5d5-0x0;var _0x516867=_0xd445[_0x1ca5d5];return _0x516867;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x5d44('0x0'),_0x5d44('0x1'),_0x5d44('0x2')];function createListener(_0x1e48fa,_0x94113c){return function(_0xf00a92){_0x94113c[_0x5d44('0x3')](_0x1e48fa,_0xf00a92);};}function removeListener(_0x208491,_0x20e9b3){return function(){DashboardEvents[_0x5d44('0x4')](_0x208491,_0x20e9b3);};}exports['register']=function(_0x1054b6){for(var _0x349af6=0x0,_0x40af02=events['length'];_0x349af6<_0x40af02;_0x349af6++){var _0x30d565=events[_0x349af6];var _0x4a8c4f=createListener(_0x5d44('0x5')+_0x30d565,_0x1054b6);DashboardEvents['on'](_0x30d565,_0x4a8c4f);}};
\ No newline at end of file
index 9f6b50b..dca55c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x438c=['../../config/environment','get','isAuthenticated','index','/:id','/:id/items','getItems','post','create','addItem','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x49ebbe,_0x5d8222){var _0x219930=function(_0x417981){while(--_0x417981){_0x49ebbe['push'](_0x49ebbe['shift']());}};_0x219930(++_0x5d8222);}(_0x438c,0x93));var _0xc438=function(_0xd4f6c2,_0x21348d){_0xd4f6c2=_0xd4f6c2-0x0;var _0x315df8=_0x438c[_0xd4f6c2];return _0x315df8;};'use strict';var multer=require(_0xc438('0x0'));var util=require(_0xc438('0x1'));var path=require(_0xc438('0x2'));var timeout=require(_0xc438('0x3'));var express=require('express');var router=express[_0xc438('0x4')]();var fs_extra=require(_0xc438('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc438('0x6'));var config=require(_0xc438('0x7'));var controller=require('./dashboard.controller');router[_0xc438('0x8')]('/',auth[_0xc438('0x9')](),controller[_0xc438('0xa')]);router['get'](_0xc438('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc438('0x8')](_0xc438('0xc'),auth['isAuthenticated'](),controller[_0xc438('0xd')]);router[_0xc438('0xe')]('/',auth[_0xc438('0x9')](),controller[_0xc438('0xf')]);router[_0xc438('0xe')]('/:id/clone',auth[_0xc438('0x9')](),controller['clone']);router[_0xc438('0xe')]('/:id/items',auth[_0xc438('0x9')](),controller[_0xc438('0x10')]);router[_0xc438('0x11')](_0xc438('0xb'),auth[_0xc438('0x9')](),controller[_0xc438('0x12')]);router[_0xc438('0x13')](_0xc438('0xb'),auth[_0xc438('0x9')](),controller[_0xc438('0x14')]);module[_0xc438('0x15')]=router;
\ No newline at end of file
+var _0xd81e=['get','show','getItems','create','post','/:id/clone','clone','/:id/items','addItem','put','/:id','update','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated'];(function(_0x36db58,_0x528f82){var _0x3668cb=function(_0x4cd671){while(--_0x4cd671){_0x36db58['push'](_0x36db58['shift']());}};_0x3668cb(++_0x528f82);}(_0xd81e,0x7b));var _0xed81=function(_0x39f09b,_0x4c1f54){_0x39f09b=_0x39f09b-0x0;var _0x46724a=_0xd81e[_0x39f09b];return _0x46724a;};'use strict';var multer=require(_0xed81('0x0'));var util=require('util');var path=require(_0xed81('0x1'));var timeout=require(_0xed81('0x2'));var express=require(_0xed81('0x3'));var router=express[_0xed81('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xed81('0x5'));var config=require(_0xed81('0x6'));var controller=require(_0xed81('0x7'));router['get']('/',auth[_0xed81('0x8')](),controller['index']);router[_0xed81('0x9')]('/:id',auth[_0xed81('0x8')](),controller[_0xed81('0xa')]);router[_0xed81('0x9')]('/:id/items',auth[_0xed81('0x8')](),controller[_0xed81('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xed81('0xc')]);router[_0xed81('0xd')](_0xed81('0xe'),auth[_0xed81('0x8')](),controller[_0xed81('0xf')]);router[_0xed81('0xd')](_0xed81('0x10'),auth[_0xed81('0x8')](),controller[_0xed81('0x11')]);router[_0xed81('0x12')](_0xed81('0x13'),auth[_0xed81('0x8')](),controller[_0xed81('0x14')]);router['delete'](_0xed81('0x13'),auth[_0xed81('0x8')](),controller[_0xed81('0x15')]);module['exports']=router;
\ No newline at end of file
index 66de7cb..effb1d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['TEXT','long','parse','attrs','stringify','setDataValue','INTEGER','sequelize','lodash','exports','STRING'];(function(_0x320644,_0x3f806a){var _0x5392e9=function(_0x4f50d0){while(--_0x4f50d0){_0x320644['push'](_0x320644['shift']());}};_0x5392e9(++_0x3f806a);}(_0x2bd8,0x130));var _0x82bd=function(_0x3bf079,_0x23b32f){_0x3bf079=_0x3bf079-0x0;var _0x27ae54=_0x2bd8[_0x3bf079];return _0x27ae54;};'use strict';var Sequelize=require(_0x82bd('0x0'));var squel=require('squel');var _=require(_0x82bd('0x1'));module[_0x82bd('0x2')]={'title':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x82bd('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x82bd('0x4')](_0x82bd('0x5')),'get':function(){try{return JSON[_0x82bd('0x6')](this['getDataValue'](_0x82bd('0x7')));}catch(_0x2e1a98){return[];}},'set':function(_0x3bf810){try{this['setDataValue'](_0x82bd('0x7'),JSON[_0x82bd('0x8')](_0x3bf810));}catch(_0x226f60){this[_0x82bd('0x9')]('attrs',JSON[_0x82bd('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x82bd('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x82bd('0x3')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x82bd('0xa')],'defaultValue':0xc}};
\ No newline at end of file
+var _0x326f=['#2196f3','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff'];(function(_0xd69eac,_0x1d51e8){var _0x1f8b25=function(_0x56263b){while(--_0x56263b){_0xd69eac['push'](_0xd69eac['shift']());}};_0x1f8b25(++_0x1d51e8);}(_0x326f,0xd1));var _0xf326=function(_0x424e6c,_0x1e54b4){_0x424e6c=_0x424e6c-0x0;var _0x2310da=_0x326f[_0x424e6c];return _0x2310da;};'use strict';var Sequelize=require(_0xf326('0x0'));var squel=require('squel');var _=require('lodash');module[_0xf326('0x1')]={'title':{'type':Sequelize[_0xf326('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf326('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf326('0x3')](_0xf326('0x4')),'get':function(){try{return JSON[_0xf326('0x5')](this[_0xf326('0x6')](_0xf326('0x7')));}catch(_0x1b5a56){return[];}},'set':function(_0x3ace29){try{this['setDataValue'](_0xf326('0x7'),JSON[_0xf326('0x8')](_0x3ace29));}catch(_0x165f95){this[_0xf326('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf326('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf326('0xa')]},'col':{'type':Sequelize[_0xf326('0xa')]},'background':{'type':Sequelize[_0xf326('0x2')],'allowNull':![],'defaultValue':_0xf326('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf326('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0xf326('0xa')],'defaultValue':0xc}};
\ No newline at end of file
index 14b39aa..6ad5dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bb4=['rawAttributes','query','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','type','iframe','attrUrl','attrs','https://','attrPath','clock','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','offset','undefined','limit','count','json','apply','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem'];(function(_0x46c6b7,_0x48f8bb){var _0x561506=function(_0x46450a){while(--_0x46450a){_0x46c6b7['push'](_0x46c6b7['shift']());}};_0x561506(++_0x48f8bb);}(_0x6bb4,0x1a7));var _0x46bb=function(_0xbd5a59,_0x3e019f){_0xbd5a59=_0xbd5a59-0x0;var _0x480192=_0x6bb4[_0xbd5a59];return _0x480192;};'use strict';var emlformat=require(_0x46bb('0x0'));var rimraf=require(_0x46bb('0x1'));var zipdir=require(_0x46bb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x46bb('0x3'));var moment=require(_0x46bb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x46bb('0x5'));var util=require(_0x46bb('0x6'));var path=require(_0x46bb('0x7'));var sox=require(_0x46bb('0x8'));var csv=require(_0x46bb('0x9'));var ejs=require(_0x46bb('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x46bb('0xb'));var crypto=require(_0x46bb('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x46bb('0xd'));var Papa=require(_0x46bb('0xe'));var Redis=require('ioredis');var authService=require(_0x46bb('0xf'));var qs=require(_0x46bb('0x10'));var as=require(_0x46bb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x46bb('0x12'))(_0x46bb('0x13'));var utils=require('../../config/utils');var config=require(_0x46bb('0x14'));var licenseUtil=require(_0x46bb('0x15'));var db=require(_0x46bb('0x16'))['db'];config['redis']=_[_0x46bb('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x46bb('0x18'))(new Redis(config['redis']));require(_0x46bb('0x19'))[_0x46bb('0x1a')](socket);function respondWithStatusCode(_0x50f198,_0x365805){_0x365805=_0x365805||0xcc;return function(_0x5a5468){if(_0x5a5468){return _0x50f198[_0x46bb('0x1b')](_0x365805);}return _0x50f198['status'](_0x365805)[_0x46bb('0x1c')]();};}function respondWithResult(_0x547aff,_0x556efa){_0x556efa=_0x556efa||0xc8;return function(_0x3aedc4){if(_0x3aedc4){return _0x547aff[_0x46bb('0x1d')](_0x556efa)['json'](_0x3aedc4);}};}function respondWithFilteredResult(_0x3f0817,_0x2afac6){return function(_0x5eb0e1){if(_0x5eb0e1){var _0x53ee66=typeof _0x2afac6[_0x46bb('0x1e')]===_0x46bb('0x1f')&&typeof _0x2afac6[_0x46bb('0x20')]===_0x46bb('0x1f');var _0x20e011=_0x5eb0e1[_0x46bb('0x21')];var _0x2d8023=_0x53ee66?0x0:_0x2afac6[_0x46bb('0x1e')];var _0x5b697c=_0x53ee66?_0x5eb0e1['count']:_0x2afac6[_0x46bb('0x1e')]+_0x2afac6[_0x46bb('0x20')];var _0x2ff232;if(_0x5b697c>=_0x20e011){_0x5b697c=_0x20e011;_0x2ff232=0xc8;}else{_0x2ff232=0xce;}_0x3f0817['status'](_0x2ff232);return _0x3f0817['set']('Content-Range',_0x2d8023+'-'+_0x5b697c+'/'+_0x20e011)[_0x46bb('0x22')](_0x5eb0e1);}return null;};}function patchUpdates(_0x2b3443){return function(_0x43fea7){try{jsonpatch[_0x46bb('0x23')](_0x43fea7,_0x2b3443,!![]);}catch(_0x5b8e04){return BPromise['reject'](_0x5b8e04);}return _0x43fea7['save']();};}function saveUpdates(_0x5c2885,_0x5a0659){return function(_0x38699f){if(_0x38699f){return _0x38699f['update'](_0x5c2885)[_0x46bb('0x24')](function(_0x3c0031){return _0x3c0031;});}return null;};}function removeEntity(_0x16413b,_0x1ee93a){return function(_0x44eb24){if(_0x44eb24){return _0x44eb24[_0x46bb('0x25')]()[_0x46bb('0x24')](function(){_0x16413b[_0x46bb('0x1d')](0xcc)[_0x46bb('0x1c')]();});}};}function handleEntityNotFound(_0x4277c4,_0x48db48){return function(_0x104e9b){if(!_0x104e9b){_0x4277c4[_0x46bb('0x1b')](0x194);}return _0x104e9b;};}function handleError(_0x49a84d,_0x34e43a){_0x34e43a=_0x34e43a||0x1f4;return function(_0x3a9927){logger[_0x46bb('0x26')](_0x3a9927[_0x46bb('0x27')]);if(_0x3a9927[_0x46bb('0x28')]){delete _0x3a9927[_0x46bb('0x28')];}_0x49a84d[_0x46bb('0x1d')](_0x34e43a)[_0x46bb('0x29')](_0x3a9927);};}exports[_0x46bb('0x2a')]=function(_0x1762b0,_0x1f669f){var _0x1fb8ea={'raw':![],'where':{'id':_0x1762b0[_0x46bb('0x2b')]['id']}},_0x2d34d6={};_0x2d34d6[_0x46bb('0x2c')]=_[_0x46bb('0x2d')](db[_0x46bb('0x2e')][_0x46bb('0x2f')]);_0x2d34d6[_0x46bb('0x30')]=_[_0x46bb('0x2d')](_0x1762b0[_0x46bb('0x30')]);_0x2d34d6['filters']=_[_0x46bb('0x31')](_0x2d34d6['model'],_0x2d34d6[_0x46bb('0x30')]);_0x1fb8ea['attributes']=_[_0x46bb('0x31')](_0x2d34d6[_0x46bb('0x2c')],qs[_0x46bb('0x32')](_0x1762b0['query'][_0x46bb('0x32')]));_0x1fb8ea[_0x46bb('0x33')]=_0x1fb8ea[_0x46bb('0x33')][_0x46bb('0x34')]?_0x1fb8ea[_0x46bb('0x33')]:_0x2d34d6['model'];if(_0x1762b0[_0x46bb('0x30')][_0x46bb('0x35')]){_0x1fb8ea[_0x46bb('0x36')]=[{'all':!![]}];}_0x1fb8ea=_[_0x46bb('0x37')]({},_0x1fb8ea,_0x1762b0[_0x46bb('0x38')]);return db[_0x46bb('0x2e')][_0x46bb('0x39')](_0x1fb8ea)[_0x46bb('0x24')](handleEntityNotFound(_0x1f669f,null))[_0x46bb('0x24')](respondWithResult(_0x1f669f,null))[_0x46bb('0x3a')](handleError(_0x1f669f,null));};exports[_0x46bb('0x25')]=function(_0x461735,_0x7e9c51){return db[_0x46bb('0x2e')][_0x46bb('0x39')]({'where':{'id':_0x461735[_0x46bb('0x2b')]['id']}})[_0x46bb('0x24')](handleEntityNotFound(_0x7e9c51,null))[_0x46bb('0x24')](removeEntity(_0x7e9c51,null))[_0x46bb('0x3a')](handleError(_0x7e9c51,null));};function widgetAttributes(_0x41fc4d){try{switch(_0x41fc4d[_0x46bb('0x3b')]){case _0x46bb('0x3c'):return[{'name':_0x46bb('0x3d'),'value':_0x41fc4d['attrUrl']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d['attrs'][0x0]['value']:undefined)||_0x46bb('0x3f')}];case'custom':return[{'name':_0x46bb('0x40'),'value':_0x41fc4d['attrPath']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0]['value']:undefined)||''}];case _0x46bb('0x41'):return[{'name':'attrHourFormat','value':_0x41fc4d['attrHourFormat']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||_0x46bb('0x43')},{'name':'attrTimezone','value':_0x41fc4d[_0x46bb('0x44')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d['attrs'][0x1][_0x46bb('0x42')]:undefined)||_0x46bb('0x45')},{'name':_0x46bb('0x46'),'value':_0x41fc4d[_0x46bb('0x46')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d['attrs'][0x2][_0x46bb('0x42')]:undefined)||0xc}];case'counter':return[{'name':_0x46bb('0x47'),'value':_0x41fc4d['attrMetric']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0]['value']:undefined)||_0x46bb('0x48')},{'name':_0x46bb('0x49'),'value':_0x41fc4d[_0x46bb('0x49')]||(_0x41fc4d['attrs']&&_0x41fc4d['attrs'][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||[]},{'name':_0x46bb('0x46'),'value':_0x41fc4d[_0x46bb('0x46')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d[_0x46bb('0x3e')][0x2][_0x46bb('0x42')]:undefined)||0x14},{'name':'attrChannel','value':_0x41fc4d[_0x46bb('0x4a')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x3]?_0x41fc4d[_0x46bb('0x3e')][0x3]['value']:undefined)||_0x46bb('0x4b')},{'name':_0x46bb('0x4c'),'value':_0x41fc4d[_0x46bb('0x4c')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x4]?_0x41fc4d[_0x46bb('0x3e')][0x4][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4d'),'value':_0x41fc4d[_0x46bb('0x4d')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x5]?_0x41fc4d[_0x46bb('0x3e')][0x5][_0x46bb('0x42')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x41fc4d[_0x46bb('0x4e')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x6]?_0x41fc4d['attrs'][0x6][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4f'),'value':_0x41fc4d['attrOpenchannelAccounts']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x7]?_0x41fc4d[_0x46bb('0x3e')][0x7]['value']:undefined)||''},{'name':_0x46bb('0x50'),'value':_0x41fc4d['attrWhatsappAccounts']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x8]?_0x41fc4d[_0x46bb('0x3e')][0x8]['value']:undefined)||''},{'name':_0x46bb('0x51'),'value':_0x41fc4d[_0x46bb('0x51')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x9]?_0x41fc4d['attrs'][0x9]['value']:undefined)||''}];case _0x46bb('0x52'):case'pie-chart':return[{'name':'attrSerie1','value':_0x41fc4d[_0x46bb('0x53')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||'total'},{'name':_0x46bb('0x54'),'value':_0x41fc4d[_0x46bb('0x54')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x55'),'value':_0x41fc4d[_0x46bb('0x55')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x2]?_0x41fc4d[_0x46bb('0x3e')][0x2][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x49'),'value':_0x41fc4d[_0x46bb('0x49')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x3]?_0x41fc4d['attrs'][0x3][_0x46bb('0x42')]:undefined)||[]},{'name':_0x46bb('0x4a'),'value':_0x41fc4d[_0x46bb('0x4a')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x4]?_0x41fc4d[_0x46bb('0x3e')][0x4]['value']:undefined)||_0x46bb('0x4b')},{'name':'attrEmailAccounts','value':_0x41fc4d[_0x46bb('0x4c')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x5]?_0x41fc4d['attrs'][0x5][_0x46bb('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x41fc4d[_0x46bb('0x4d')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x6]?_0x41fc4d[_0x46bb('0x3e')][0x6][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4e'),'value':_0x41fc4d[_0x46bb('0x4e')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x7]?_0x41fc4d['attrs'][0x7][_0x46bb('0x42')]:undefined)||''},{'name':_0x46bb('0x4f'),'value':_0x41fc4d['attrOpenchannelAccounts']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x8]?_0x41fc4d[_0x46bb('0x3e')][0x8][_0x46bb('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x41fc4d['attrWhatsappAccounts']||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0x9]?_0x41fc4d[_0x46bb('0x3e')][0x9]['value']:undefined)||''},{'name':_0x46bb('0x51'),'value':_0x41fc4d[_0x46bb('0x51')]||(_0x41fc4d['attrs']&&_0x41fc4d[_0x46bb('0x3e')][0xa]?_0x41fc4d[_0x46bb('0x3e')][0xa][_0x46bb('0x42')]:undefined)||''}];case _0x46bb('0x56'):return[{'name':_0x46bb('0x57'),'type':_0x41fc4d['reportType']||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d['attrs'][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x3b')]:undefined)||null,'value':_0x41fc4d[_0x46bb('0x57')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x0]?_0x41fc4d[_0x46bb('0x3e')][0x0][_0x46bb('0x42')]:undefined)||null},{'name':_0x46bb('0x58'),'value':_0x41fc4d[_0x46bb('0x58')]||(_0x41fc4d[_0x46bb('0x3e')]&&_0x41fc4d[_0x46bb('0x3e')][0x1]?_0x41fc4d[_0x46bb('0x3e')][0x1][_0x46bb('0x42')]:undefined)||0x0}];default:return[];}}catch(_0x12c40d){logger[_0x46bb('0x26')](_0x46bb('0x59'),JSON[_0x46bb('0x5a')](_0x12c40d));return[];}}exports[_0x46bb('0x5b')]=function(_0x44eeee,_0x1b9889){if(_0x44eeee[_0x46bb('0x5c')]){_0x44eeee[_0x46bb('0x5c')]['attrs']=widgetAttributes(_0x44eeee[_0x46bb('0x5c')]);}return db['DashboardItem']['create'](_0x44eeee['body'],{})[_0x46bb('0x24')](respondWithResult(_0x1b9889,0xc9))[_0x46bb('0x3a')](handleError(_0x1b9889,null));};exports[_0x46bb('0x5d')]=function(_0x277768,_0x297d4a){if(_0x277768[_0x46bb('0x5c')]['id']){delete _0x277768[_0x46bb('0x5c')]['id'];}_0x277768['body'][_0x46bb('0x3e')]=widgetAttributes(_0x277768['body']);return db[_0x46bb('0x2e')]['find']({'where':{'id':_0x277768['params']['id']}})[_0x46bb('0x24')](handleEntityNotFound(_0x297d4a,null))['then'](saveUpdates(_0x277768[_0x46bb('0x5c')],null))[_0x46bb('0x24')](respondWithResult(_0x297d4a,null))['catch'](handleError(_0x297d4a,null));};
\ No newline at end of file
+var _0x3cd8=['params','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','attrChannel','voice','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrEmailAccounts','attrWhatsappAccounts','attrReport','type','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','then','end','error','stack','name','show','DashboardItem','rawAttributes','keys','query','filters','intersection','model','attributes','fields','length','include','find','catch'];(function(_0x48954c,_0x42aa46){var _0x3b0ab3=function(_0x59c82d){while(--_0x59c82d){_0x48954c['push'](_0x48954c['shift']());}};_0x3b0ab3(++_0x42aa46);}(_0x3cd8,0x150));var _0x83cd=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x3cd8[_0xa1e3e3];return _0xc980e9;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];config[_0x83cd('0x1e')]=_[_0x83cd('0x1f')](config[_0x83cd('0x1e')],{'host':_0x83cd('0x20'),'port':0x18eb});var socket=require(_0x83cd('0x21'))(new Redis(config['redis']));require(_0x83cd('0x22'))[_0x83cd('0x23')](socket);function respondWithStatusCode(_0x2d330d,_0x28dccb){_0x28dccb=_0x28dccb||0xcc;return function(_0x2adc87){if(_0x2adc87){return _0x2d330d[_0x83cd('0x24')](_0x28dccb);}return _0x2d330d['status'](_0x28dccb)['end']();};}function respondWithResult(_0x268f58,_0x40ba0f){_0x40ba0f=_0x40ba0f||0xc8;return function(_0x2eafe7){if(_0x2eafe7){return _0x268f58[_0x83cd('0x25')](_0x40ba0f)[_0x83cd('0x26')](_0x2eafe7);}};}function respondWithFilteredResult(_0x3d6303,_0x7343f7){return function(_0x1e136e){if(_0x1e136e){var _0x5e35e3=typeof _0x7343f7[_0x83cd('0x27')]==='undefined'&&typeof _0x7343f7[_0x83cd('0x28')]===_0x83cd('0x29');var _0x23d9e4=_0x1e136e['count'];var _0x4c84d3=_0x5e35e3?0x0:_0x7343f7[_0x83cd('0x27')];var _0x50e044=_0x5e35e3?_0x1e136e[_0x83cd('0x2a')]:_0x7343f7[_0x83cd('0x27')]+_0x7343f7['limit'];var _0x327f7e;if(_0x50e044>=_0x23d9e4){_0x50e044=_0x23d9e4;_0x327f7e=0xc8;}else{_0x327f7e=0xce;}_0x3d6303[_0x83cd('0x25')](_0x327f7e);return _0x3d6303[_0x83cd('0x2b')](_0x83cd('0x2c'),_0x4c84d3+'-'+_0x50e044+'/'+_0x23d9e4)[_0x83cd('0x26')](_0x1e136e);}return null;};}function patchUpdates(_0x3f6c85){return function(_0x10b957){try{jsonpatch[_0x83cd('0x2d')](_0x10b957,_0x3f6c85,!![]);}catch(_0x507f7e){return BPromise['reject'](_0x507f7e);}return _0x10b957[_0x83cd('0x2e')]();};}function saveUpdates(_0x56c424,_0xf338c6){return function(_0x2a99aa){if(_0x2a99aa){return _0x2a99aa[_0x83cd('0x2f')](_0x56c424)['then'](function(_0x30c29e){return _0x30c29e;});}return null;};}function removeEntity(_0x33bb16,_0x3558fa){return function(_0x4029a1){if(_0x4029a1){return _0x4029a1[_0x83cd('0x30')]()[_0x83cd('0x31')](function(){_0x33bb16[_0x83cd('0x25')](0xcc)[_0x83cd('0x32')]();});}};}function handleEntityNotFound(_0x5a9899,_0x21d938){return function(_0x12dac7){if(!_0x12dac7){_0x5a9899[_0x83cd('0x24')](0x194);}return _0x12dac7;};}function handleError(_0x3e468e,_0x78734f){_0x78734f=_0x78734f||0x1f4;return function(_0x9dbb16){logger[_0x83cd('0x33')](_0x9dbb16[_0x83cd('0x34')]);if(_0x9dbb16[_0x83cd('0x35')]){delete _0x9dbb16[_0x83cd('0x35')];}_0x3e468e[_0x83cd('0x25')](_0x78734f)['send'](_0x9dbb16);};}exports[_0x83cd('0x36')]=function(_0x2ace11,_0x51bdf3){var _0x38590e={'raw':![],'where':{'id':_0x2ace11['params']['id']}},_0xbedd59={};_0xbedd59['model']=_['keys'](db[_0x83cd('0x37')][_0x83cd('0x38')]);_0xbedd59['query']=_[_0x83cd('0x39')](_0x2ace11[_0x83cd('0x3a')]);_0xbedd59[_0x83cd('0x3b')]=_[_0x83cd('0x3c')](_0xbedd59[_0x83cd('0x3d')],_0xbedd59[_0x83cd('0x3a')]);_0x38590e[_0x83cd('0x3e')]=_[_0x83cd('0x3c')](_0xbedd59[_0x83cd('0x3d')],qs[_0x83cd('0x3f')](_0x2ace11[_0x83cd('0x3a')]['fields']));_0x38590e[_0x83cd('0x3e')]=_0x38590e[_0x83cd('0x3e')][_0x83cd('0x40')]?_0x38590e[_0x83cd('0x3e')]:_0xbedd59['model'];if(_0x2ace11['query']['includeAll']){_0x38590e[_0x83cd('0x41')]=[{'all':!![]}];}_0x38590e=_['merge']({},_0x38590e,_0x2ace11['options']);return db['DashboardItem'][_0x83cd('0x42')](_0x38590e)[_0x83cd('0x31')](handleEntityNotFound(_0x51bdf3,null))[_0x83cd('0x31')](respondWithResult(_0x51bdf3,null))[_0x83cd('0x43')](handleError(_0x51bdf3,null));};exports[_0x83cd('0x30')]=function(_0x2c87aa,_0x58a782){return db[_0x83cd('0x37')][_0x83cd('0x42')]({'where':{'id':_0x2c87aa[_0x83cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x58a782,null))[_0x83cd('0x31')](removeEntity(_0x58a782,null))[_0x83cd('0x43')](handleError(_0x58a782,null));};function widgetAttributes(_0x40a206){try{switch(_0x40a206['type']){case'iframe':return[{'name':_0x83cd('0x45'),'value':_0x40a206[_0x83cd('0x45')]||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x47')]:undefined)||_0x83cd('0x48')}];case _0x83cd('0x49'):return[{'name':'attrPath','value':_0x40a206[_0x83cd('0x4a')]||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x47')]:undefined)||''}];case _0x83cd('0x4b'):return[{'name':'attrHourFormat','value':_0x40a206[_0x83cd('0x4c')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206['attrs'][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x47')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x40a206[_0x83cd('0x4d')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x1]?_0x40a206['attrs'][0x1][_0x83cd('0x47')]:undefined)||_0x83cd('0x4e')},{'name':_0x83cd('0x4f'),'value':_0x40a206['attrFontSize']||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x2]?_0x40a206[_0x83cd('0x46')][0x2][_0x83cd('0x47')]:undefined)||0xc}];case _0x83cd('0x50'):return[{'name':'attrMetric','value':_0x40a206['attrMetric']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206['attrs'][0x0][_0x83cd('0x47')]:undefined)||_0x83cd('0x51')},{'name':'attrVoiceQueues','value':_0x40a206[_0x83cd('0x52')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x1]?_0x40a206[_0x83cd('0x46')][0x1][_0x83cd('0x47')]:undefined)||[]},{'name':'attrFontSize','value':_0x40a206[_0x83cd('0x4f')]||(_0x40a206['attrs']&&_0x40a206['attrs'][0x2]?_0x40a206['attrs'][0x2]['value']:undefined)||0x14},{'name':_0x83cd('0x53'),'value':_0x40a206['attrChannel']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206['attrs'][0x3]?_0x40a206['attrs'][0x3][_0x83cd('0x47')]:undefined)||_0x83cd('0x54')},{'name':'attrEmailAccounts','value':_0x40a206['attrEmailAccounts']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x4]?_0x40a206['attrs'][0x4]['value']:undefined)||''},{'name':_0x83cd('0x55'),'value':_0x40a206[_0x83cd('0x55')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206['attrs'][0x5]?_0x40a206[_0x83cd('0x46')][0x5][_0x83cd('0x47')]:undefined)||''},{'name':_0x83cd('0x56'),'value':_0x40a206[_0x83cd('0x56')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x6]?_0x40a206[_0x83cd('0x46')][0x6][_0x83cd('0x47')]:undefined)||''},{'name':_0x83cd('0x57'),'value':_0x40a206['attrOpenchannelAccounts']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x7]?_0x40a206['attrs'][0x7][_0x83cd('0x47')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x40a206['attrWhatsappAccounts']||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x8]?_0x40a206[_0x83cd('0x46')][0x8][_0x83cd('0x47')]:undefined)||''},{'name':'attrChatWebsites','value':_0x40a206[_0x83cd('0x58')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206['attrs'][0x9]?_0x40a206[_0x83cd('0x46')][0x9]['value']:undefined)||''}];case'multibar-chart':case _0x83cd('0x59'):return[{'name':_0x83cd('0x5a'),'value':_0x40a206[_0x83cd('0x5a')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x47')]:undefined)||'total'},{'name':_0x83cd('0x5b'),'value':_0x40a206[_0x83cd('0x5b')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x1]?_0x40a206[_0x83cd('0x46')][0x1][_0x83cd('0x47')]:undefined)||null},{'name':'attrSerie3','value':_0x40a206[_0x83cd('0x5c')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x2]?_0x40a206[_0x83cd('0x46')][0x2][_0x83cd('0x47')]:undefined)||null},{'name':_0x83cd('0x52'),'value':_0x40a206['attrVoiceQueues']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x3]?_0x40a206[_0x83cd('0x46')][0x3][_0x83cd('0x47')]:undefined)||[]},{'name':'attrChannel','value':_0x40a206[_0x83cd('0x53')]||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x4]?_0x40a206[_0x83cd('0x46')][0x4][_0x83cd('0x47')]:undefined)||_0x83cd('0x54')},{'name':_0x83cd('0x5d'),'value':_0x40a206['attrEmailAccounts']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x5]?_0x40a206[_0x83cd('0x46')][0x5][_0x83cd('0x47')]:undefined)||''},{'name':_0x83cd('0x55'),'value':_0x40a206[_0x83cd('0x55')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x6]?_0x40a206[_0x83cd('0x46')][0x6][_0x83cd('0x47')]:undefined)||''},{'name':_0x83cd('0x56'),'value':_0x40a206[_0x83cd('0x56')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x7]?_0x40a206[_0x83cd('0x46')][0x7]['value']:undefined)||''},{'name':_0x83cd('0x57'),'value':_0x40a206[_0x83cd('0x57')]||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x8]?_0x40a206['attrs'][0x8][_0x83cd('0x47')]:undefined)||''},{'name':_0x83cd('0x5e'),'value':_0x40a206['attrWhatsappAccounts']||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x9]?_0x40a206[_0x83cd('0x46')][0x9]['value']:undefined)||''},{'name':_0x83cd('0x58'),'value':_0x40a206[_0x83cd('0x58')]||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0xa]?_0x40a206[_0x83cd('0x46')][0xa]['value']:undefined)||''}];case'web-report':return[{'name':_0x83cd('0x5f'),'type':_0x40a206['reportType']||(_0x40a206['attrs']&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x60')]:undefined)||null,'value':_0x40a206[_0x83cd('0x5f')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x0]?_0x40a206[_0x83cd('0x46')][0x0][_0x83cd('0x47')]:undefined)||null},{'name':_0x83cd('0x61'),'value':_0x40a206[_0x83cd('0x61')]||(_0x40a206[_0x83cd('0x46')]&&_0x40a206[_0x83cd('0x46')][0x1]?_0x40a206[_0x83cd('0x46')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x144979){logger[_0x83cd('0x33')](_0x83cd('0x62'),JSON['stringify'](_0x144979));return[];}}exports[_0x83cd('0x63')]=function(_0x3dd814,_0xa03b48){if(_0x3dd814[_0x83cd('0x64')]){_0x3dd814[_0x83cd('0x64')][_0x83cd('0x46')]=widgetAttributes(_0x3dd814[_0x83cd('0x64')]);}return db['DashboardItem'][_0x83cd('0x63')](_0x3dd814['body'],{})[_0x83cd('0x31')](respondWithResult(_0xa03b48,0xc9))[_0x83cd('0x43')](handleError(_0xa03b48,null));};exports[_0x83cd('0x2f')]=function(_0x11417c,_0x243fa0){if(_0x11417c['body']['id']){delete _0x11417c[_0x83cd('0x64')]['id'];}_0x11417c['body'][_0x83cd('0x46')]=widgetAttributes(_0x11417c['body']);return db[_0x83cd('0x37')][_0x83cd('0x42')]({'where':{'id':_0x11417c[_0x83cd('0x44')]['id']}})[_0x83cd('0x31')](handleEntityNotFound(_0x243fa0,null))['then'](saveUpdates(_0x11417c[_0x83cd('0x64')],null))[_0x83cd('0x31')](respondWithResult(_0x243fa0,null))['catch'](handleError(_0x243fa0,null));};
\ No newline at end of file
index b0034ec..e77bf91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','events'];(function(_0x326bd7,_0x474c0a){var _0x2fb4bf=function(_0x46a227){while(--_0x46a227){_0x326bd7['push'](_0x326bd7['shift']());}};_0x2fb4bf(++_0x474c0a);}(_0xd943,0x15d));var _0x3d94=function(_0x7fcc35,_0x3ee17a){_0x7fcc35=_0x7fcc35-0x0;var _0x3d8d62=_0xd943[_0x7fcc35];return _0x3d8d62;};'use strict';var EventEmitter=require(_0x3d94('0x0'));var DashboardItem=require(_0x3d94('0x1'))['db'][_0x3d94('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3d94('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d94('0x4'),'afterDestroy':_0x3d94('0x5')};function emitEvent(_0x38b5ca){return function(_0xc13b61,_0xaf8962,_0x5751f6){DashboardItemEvents['emit'](_0x38b5ca+':'+_0xc13b61['id'],_0xc13b61);DashboardItemEvents[_0x3d94('0x6')](_0x38b5ca,_0xc13b61);_0x5751f6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0x09e0=['emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','update'];(function(_0x31179f,_0x3ba302){var _0x4af3a4=function(_0x27f652){while(--_0x27f652){_0x31179f['push'](_0x31179f['shift']());}};_0x4af3a4(++_0x3ba302);}(_0x09e0,0x1ab));var _0x009e=function(_0x38aa3b,_0x2b1b95){_0x38aa3b=_0x38aa3b-0x0;var _0x2560e3=_0x09e0[_0x38aa3b];return _0x2560e3;};'use strict';var EventEmitter=require(_0x009e('0x0'));var DashboardItem=require(_0x009e('0x1'))['db'][_0x009e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x009e('0x3'),'afterUpdate':_0x009e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1b6358){return function(_0x484992,_0x78b171,_0x10482f){DashboardItemEvents['emit'](_0x1b6358+':'+_0x484992['id'],_0x484992);DashboardItemEvents[_0x009e('0x5')](_0x1b6358,_0x484992);_0x10482f(null);};}for(var e in events){if(events[_0x009e('0x6')](e)){var event=events[e];DashboardItem[_0x009e('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
index d89c142..4576a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc39=['dashboard_items','lodash','util','api','moment','path','rimraf','define'];(function(_0x19b93a,_0x12bce9){var _0x3a3bdc=function(_0xb5b16e){while(--_0xb5b16e){_0x19b93a['push'](_0x19b93a['shift']());}};_0x3a3bdc(++_0x12bce9);}(_0xcc39,0x141));var _0x9cc3=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0xcc39[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x9cc3('0x0'));var util=require(_0x9cc3('0x1'));var logger=require('../../config/logger')(_0x9cc3('0x2'));var moment=require(_0x9cc3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cc3('0x4'));var rimraf=require(_0x9cc3('0x5'));var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x595826,_0x186c96){return _0x595826[_0x9cc3('0x6')]('DashboardItem',attributes,{'tableName':_0x9cc3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28dd=['request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','util','moment','bluebird'];(function(_0x3de850,_0x5b7840){var _0x308146=function(_0xf23f2d){while(--_0xf23f2d){_0x3de850['push'](_0x3de850['shift']());}};_0x308146(++_0x5b7840);}(_0x28dd,0x15c));var _0xd28d=function(_0x5c3432,_0x46c2b2){_0x5c3432=_0x5c3432-0x0;var _0x2985cd=_0x28dd[_0x5c3432];return _0x2985cd;};'use strict';var _=require(_0xd28d('0x0'));var util=require(_0xd28d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd28d('0x2'));var BPromise=require(_0xd28d('0x3'));var rp=require(_0xd28d('0x4'));var fs=require('fs');var path=require(_0xd28d('0x5'));var rimraf=require('rimraf');var config=require(_0xd28d('0x6'));var attributes=require(_0xd28d('0x7'));module[_0xd28d('0x8')]=function(_0x1efa00,_0x51e6c9){return _0x1efa00[_0xd28d('0x9')](_0xd28d('0xa'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index debd39e..3caac60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd5a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','bluebird','randomstring'];(function(_0x4da622,_0x440f17){var _0x3ee4f5=function(_0x116e0a){while(--_0x116e0a){_0x4da622['push'](_0x4da622['shift']());}};_0x3ee4f5(++_0x440f17);}(_0xdd5a,0x14f));var _0xadd5=function(_0x3453a1,_0x41bdea){_0x3453a1=_0x3453a1-0x0;var _0x17710b=_0xdd5a[_0x3453a1];return _0x17710b;};'use strict';var _=require('lodash');var util=require(_0xadd5('0x0'));var moment=require('moment');var BPromise=require(_0xadd5('0x1'));var rs=require(_0xadd5('0x2'));var fs=require('fs');var Redis=require(_0xadd5('0x3'));var db=require(_0xadd5('0x4'))['db'];var utils=require(_0xadd5('0x5'));var logger=require(_0xadd5('0x6'))(_0xadd5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xadd5('0x8')][_0xadd5('0x9')]({'port':0x232a});config[_0xadd5('0xa')]=_[_0xadd5('0xb')](config['redis'],{'host':_0xadd5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xadd5('0xd'))[_0xadd5('0xe')](socket);function respondWithRpcPromise(_0x52ce5a,_0x374e0c,_0x144811){return new BPromise(function(_0x4d63f3,_0x1591b9){return client['request'](_0x52ce5a,_0x144811)[_0xadd5('0xf')](function(_0x36fa10){logger[_0xadd5('0x10')](_0xadd5('0x11'),_0x374e0c,_0xadd5('0x12'));logger[_0xadd5('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x374e0c,_0xadd5('0x12'),JSON[_0xadd5('0x14')](_0x36fa10));if(_0x36fa10[_0xadd5('0x15')]){if(_0x36fa10[_0xadd5('0x15')][_0xadd5('0x16')]===0x1f4){logger[_0xadd5('0x15')](_0xadd5('0x11'),_0x374e0c,_0x36fa10['error'][_0xadd5('0x17')]);return _0x1591b9(_0x36fa10[_0xadd5('0x15')][_0xadd5('0x17')]);}logger['error'](_0xadd5('0x11'),_0x374e0c,_0x36fa10['error'][_0xadd5('0x17')]);return _0x4d63f3(_0x36fa10[_0xadd5('0x15')][_0xadd5('0x17')]);}else{logger[_0xadd5('0x10')](_0xadd5('0x11'),_0x374e0c,_0xadd5('0x12'));_0x4d63f3(_0x36fa10[_0xadd5('0x18')]['message']);}})[_0xadd5('0x19')](function(_0x133891){logger['error'](_0xadd5('0x11'),_0x374e0c,_0x133891);_0x1591b9(_0x133891);});});}
\ No newline at end of file
+var _0xdc25=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','socket.io-emitter','./dashboardItem.socket','then','info','DashboardItem,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring'];(function(_0x512973,_0x564e8b){var _0x32f2e1=function(_0x5d5d3b){while(--_0x5d5d3b){_0x512973['push'](_0x512973['shift']());}};_0x32f2e1(++_0x564e8b);}(_0xdc25,0x11c));var _0x5dc2=function(_0x8f8f58,_0x41a5f5){_0x8f8f58=_0x8f8f58-0x0;var _0x4fb046=_0xdc25[_0x8f8f58];return _0x4fb046;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var moment=require('moment');var BPromise=require(_0x5dc2('0x2'));var rs=require(_0x5dc2('0x3'));var fs=require('fs');var Redis=require(_0x5dc2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dc2('0x5'));var logger=require(_0x5dc2('0x6'))(_0x5dc2('0x7'));var config=require('../../config/environment');var jayson=require(_0x5dc2('0x8'));var client=jayson[_0x5dc2('0x9')]['http']({'port':0x232a});config[_0x5dc2('0xa')]=_['defaults'](config[_0x5dc2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dc2('0xb'))(new Redis(config['redis']));require(_0x5dc2('0xc'))['register'](socket);function respondWithRpcPromise(_0x4dc247,_0x590968,_0x364e72){return new BPromise(function(_0x48b586,_0x23f483){return client['request'](_0x4dc247,_0x364e72)[_0x5dc2('0xd')](function(_0x96d0ef){logger[_0x5dc2('0xe')](_0x5dc2('0xf'),_0x590968,'request\x20sent');logger[_0x5dc2('0x10')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x590968,'request\x20sent',JSON[_0x5dc2('0x11')](_0x96d0ef));if(_0x96d0ef['error']){if(_0x96d0ef[_0x5dc2('0x12')][_0x5dc2('0x13')]===0x1f4){logger[_0x5dc2('0x12')](_0x5dc2('0xf'),_0x590968,_0x96d0ef[_0x5dc2('0x12')]['message']);return _0x23f483(_0x96d0ef['error'][_0x5dc2('0x14')]);}logger[_0x5dc2('0x12')](_0x5dc2('0xf'),_0x590968,_0x96d0ef['error'][_0x5dc2('0x14')]);return _0x48b586(_0x96d0ef[_0x5dc2('0x12')]['message']);}else{logger['info'](_0x5dc2('0xf'),_0x590968,_0x5dc2('0x15'));_0x48b586(_0x96d0ef[_0x5dc2('0x16')][_0x5dc2('0x14')]);}})[_0x5dc2('0x17')](function(_0x4976f9){logger[_0x5dc2('0x12')](_0x5dc2('0xf'),_0x590968,_0x4976f9);_0x23f483(_0x4976f9);});});}
\ No newline at end of file
index ae63522..1ff3df8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x111e=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','register'];(function(_0x7c7363,_0x459c21){var _0x4aba91=function(_0x269a0f){while(--_0x269a0f){_0x7c7363['push'](_0x7c7363['shift']());}};_0x4aba91(++_0x459c21);}(_0x111e,0xb7));var _0xe111=function(_0x4fd16b,_0x2b1a04){_0x4fd16b=_0x4fd16b-0x0;var _0x51b24d=_0x111e[_0x4fd16b];return _0x51b24d;};'use strict';var DashboardItemEvents=require(_0xe111('0x0'));var events=[_0xe111('0x1'),_0xe111('0x2'),_0xe111('0x3')];function createListener(_0x93a2c0,_0x13543c){return function(_0x553b4b){_0x13543c[_0xe111('0x4')](_0x93a2c0,_0x553b4b);};}function removeListener(_0x5a204f,_0x559e9c){return function(){DashboardItemEvents['removeListener'](_0x5a204f,_0x559e9c);};}exports[_0xe111('0x5')]=function(_0x26fff4){for(var _0x31083a=0x0,_0x81b7f8=events['length'];_0x31083a<_0x81b7f8;_0x31083a++){var _0x146c11=events[_0x31083a];var _0x3d9c53=createListener(_0xe111('0x6')+_0x146c11,_0x26fff4);DashboardItemEvents['on'](_0x146c11,_0x3d9c53);}};
\ No newline at end of file
+var _0x83cf=['remove','emit','removeListener','length','dashboardItem:','./dashboardItem.events','save'];(function(_0x43e185,_0x4c8c48){var _0x61d5f7=function(_0x25010c){while(--_0x25010c){_0x43e185['push'](_0x43e185['shift']());}};_0x61d5f7(++_0x4c8c48);}(_0x83cf,0x6e));var _0xf83c=function(_0x129498,_0x3ca6ee){_0x129498=_0x129498-0x0;var _0x25f08b=_0x83cf[_0x129498];return _0x25f08b;};'use strict';var DashboardItemEvents=require(_0xf83c('0x0'));var events=[_0xf83c('0x1'),_0xf83c('0x2'),'update'];function createListener(_0x36c99d,_0xc4b387){return function(_0x37382a){_0xc4b387[_0xf83c('0x3')](_0x36c99d,_0x37382a);};}function removeListener(_0x9c621,_0x52c682){return function(){DashboardItemEvents[_0xf83c('0x4')](_0x9c621,_0x52c682);};}exports['register']=function(_0x564bf9){for(var _0x4d4157=0x0,_0x3382fc=events[_0xf83c('0x5')];_0x4d4157<_0x3382fc;_0x4d4157++){var _0x19d93d=events[_0x4d4157];var _0x5d6be7=createListener(_0xf83c('0x6')+_0x19d93d,_0x564bf9);DashboardItemEvents['on'](_0x19d93d,_0x5d6be7);}};
\ No newline at end of file
index c14234b..28b7e2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81a8=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post'];(function(_0x1e74ac,_0xc5914b){var _0x35684a=function(_0xe9e431){while(--_0xe9e431){_0x1e74ac['push'](_0x1e74ac['shift']());}};_0x35684a(++_0xc5914b);}(_0x81a8,0x182));var _0x881a=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0x81a8[_0x403f5f];return _0x15b1cd;};'use strict';var multer=require(_0x881a('0x0'));var util=require(_0x881a('0x1'));var path=require(_0x881a('0x2'));var timeout=require(_0x881a('0x3'));var express=require(_0x881a('0x4'));var router=express[_0x881a('0x5')]();var fs_extra=require(_0x881a('0x6'));var auth=require(_0x881a('0x7'));var interaction=require(_0x881a('0x8'));var config=require(_0x881a('0x9'));var controller=require('./dashboardItem.controller');router[_0x881a('0xa')](_0x881a('0xb'),auth[_0x881a('0xc')](),controller['show']);router[_0x881a('0xd')]('/',auth[_0x881a('0xc')](),controller[_0x881a('0xe')]);router[_0x881a('0xf')](_0x881a('0xb'),auth[_0x881a('0xc')](),controller[_0x881a('0x10')]);router[_0x881a('0x11')]('/:id',auth[_0x881a('0xc')](),controller[_0x881a('0x12')]);module[_0x881a('0x13')]=router;
\ No newline at end of file
+var _0x9f27=['post','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0x9f27,0xbf));var _0x79f2=function(_0x7d3a29,_0x5c399a){_0x7d3a29=_0x7d3a29-0x0;var _0x85521e=_0x9f27[_0x7d3a29];return _0x85521e;};'use strict';var multer=require('multer');var util=require(_0x79f2('0x0'));var path=require(_0x79f2('0x1'));var timeout=require(_0x79f2('0x2'));var express=require(_0x79f2('0x3'));var router=express[_0x79f2('0x4')]();var fs_extra=require(_0x79f2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x79f2('0x6'));var config=require(_0x79f2('0x7'));var controller=require(_0x79f2('0x8'));router[_0x79f2('0x9')](_0x79f2('0xa'),auth[_0x79f2('0xb')](),controller[_0x79f2('0xc')]);router[_0x79f2('0xd')]('/',auth[_0x79f2('0xb')](),controller['create']);router[_0x79f2('0xe')](_0x79f2('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x79f2('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x79f2('0x10')]=router;
\ No newline at end of file
index 2ac41c9..1c58967 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaff0=['ENUM','first','third','exports','STRING'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0xaff0,0x1e3));var _0x0aff=function(_0x29e95a,_0x459f06){_0x29e95a=_0x29e95a-0x0;var _0x28babb=_0xaff0[_0x29e95a];return _0x28babb;};'use strict';var Sequelize=require('sequelize');module[_0x0aff('0x0')]={'name':{'type':Sequelize[_0x0aff('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x0aff('0x2')](_0x0aff('0x3'),'second',_0x0aff('0x4')),'allowNull':![],'defaultValue':_0x0aff('0x3')},'description':{'type':Sequelize[_0x0aff('0x1')]}};
\ No newline at end of file
+var _0x02e6=['STRING','ENUM','first','third','sequelize','exports'];(function(_0x5878aa,_0x32bf6a){var _0x1243fd=function(_0x403042){while(--_0x403042){_0x5878aa['push'](_0x5878aa['shift']());}};_0x1243fd(++_0x32bf6a);}(_0x02e6,0x1c0));var _0x602e=function(_0x1e85d8,_0x2a82c1){_0x1e85d8=_0x1e85d8-0x0;var _0x1ee53f=_0x02e6[_0x1e85d8];return _0x1ee53f;};'use strict';var Sequelize=require(_0x602e('0x0'));module[_0x602e('0x1')]={'name':{'type':Sequelize[_0x602e('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x602e('0x3')](_0x602e('0x4'),'second',_0x602e('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x602e('0x2')]}};
\ No newline at end of file
index cca7b57..febe209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc1=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Dispositions','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','create','body','user'];(function(_0x4b423a,_0x49113b){var _0x4b7d82=function(_0x22ff33){while(--_0x22ff33){_0x4b423a['push'](_0x4b423a['shift']());}};_0x4b7d82(++_0x49113b);}(_0x8cc1,0x14e));var _0x18cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8cc1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x18cc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x18cc('0x1'));var rp=require(_0x18cc('0x2'));var moment=require(_0x18cc('0x3'));var BPromise=require(_0x18cc('0x4'));var Mustache=require('mustache');var util=require(_0x18cc('0x5'));var path=require('path');var sox=require(_0x18cc('0x6'));var csv=require(_0x18cc('0x7'));var ejs=require(_0x18cc('0x8'));var fs=require('fs');var fs_extra=require(_0x18cc('0x9'));var _=require(_0x18cc('0xa'));var squel=require('squel');var crypto=require(_0x18cc('0xb'));var jsforce=require(_0x18cc('0xc'));var deskjs=require(_0x18cc('0xd'));var toCsv=require(_0x18cc('0x7'));var querystring=require(_0x18cc('0xe'));var Papa=require(_0x18cc('0xf'));var Redis=require('ioredis');var authService=require(_0x18cc('0x10'));var qs=require(_0x18cc('0x11'));var as=require(_0x18cc('0x12'));var hardwareService=require(_0x18cc('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x18cc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x18cc('0x15'))['db'];function respondWithStatusCode(_0x38bedc,_0x1903d6){_0x1903d6=_0x1903d6||0xcc;return function(_0x4b0720){if(_0x4b0720){return _0x38bedc[_0x18cc('0x16')](_0x1903d6);}return _0x38bedc[_0x18cc('0x17')](_0x1903d6)['end']();};}function respondWithResult(_0x5c6d68,_0x27394f){_0x27394f=_0x27394f||0xc8;return function(_0x5ccbd4){if(_0x5ccbd4){return _0x5c6d68[_0x18cc('0x17')](_0x27394f)['json'](_0x5ccbd4);}};}function respondWithFilteredResult(_0x24e72b,_0x5dfd5c){return function(_0x343807){if(_0x343807){var _0x439e57=typeof _0x5dfd5c[_0x18cc('0x18')]==='undefined'&&typeof _0x5dfd5c[_0x18cc('0x19')]==='undefined';var _0x4bda78=_0x343807[_0x18cc('0x1a')];var _0x104fc4=_0x439e57?0x0:_0x5dfd5c[_0x18cc('0x18')];var _0x19884a=_0x439e57?_0x343807['count']:_0x5dfd5c[_0x18cc('0x18')]+_0x5dfd5c[_0x18cc('0x19')];var _0x201b2b;if(_0x19884a>=_0x4bda78){_0x19884a=_0x4bda78;_0x201b2b=0xc8;}else{_0x201b2b=0xce;}_0x24e72b[_0x18cc('0x17')](_0x201b2b);return _0x24e72b[_0x18cc('0x1b')](_0x18cc('0x1c'),_0x104fc4+'-'+_0x19884a+'/'+_0x4bda78)[_0x18cc('0x1d')](_0x343807);}return null;};}function patchUpdates(_0x313277){return function(_0x44adfa){try{jsonpatch[_0x18cc('0x1e')](_0x44adfa,_0x313277,!![]);}catch(_0x1259ca){return BPromise[_0x18cc('0x1f')](_0x1259ca);}return _0x44adfa[_0x18cc('0x20')]();};}function saveUpdates(_0x1f1abf,_0x244f3c){return function(_0x2ce670){if(_0x2ce670){return _0x2ce670[_0x18cc('0x21')](_0x1f1abf)[_0x18cc('0x22')](function(_0x2a19cf){return _0x2a19cf;});}return null;};}function removeEntity(_0x53ae78,_0x4b2358){return function(_0x2729b1){if(_0x2729b1){return _0x2729b1['destroy']()['then'](function(){var _0x273575=_0x2729b1[_0x18cc('0x23')]({'plain':!![]});var _0x8ebbf4=_0x18cc('0x24');return db[_0x18cc('0x25')][_0x18cc('0x26')]({'where':{'type':_0x8ebbf4,'resourceId':_0x273575['id']}})[_0x18cc('0x22')](function(){return _0x2729b1;});})[_0x18cc('0x22')](function(){_0x53ae78[_0x18cc('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e618c,_0x199df2){return function(_0x25c68e){if(!_0x25c68e){_0x5e618c[_0x18cc('0x16')](0x194);}return _0x25c68e;};}function handleError(_0x5ca0df,_0x268228){_0x268228=_0x268228||0x1f4;return function(_0x4e3970){logger[_0x18cc('0x27')](_0x4e3970[_0x18cc('0x28')]);if(_0x4e3970[_0x18cc('0x29')]){delete _0x4e3970[_0x18cc('0x29')];}_0x5ca0df[_0x18cc('0x17')](_0x268228)[_0x18cc('0x2a')](_0x4e3970);};}exports[_0x18cc('0x2b')]=function(_0x15c047,_0x50af21){var _0x29119d={},_0x399d07={},_0x5bb35e={'count':0x0,'rows':[]};var _0xd98c63=_[_0x18cc('0x2c')](db[_0x18cc('0x2d')][_0x18cc('0x2e')],function(_0x3072ad){return{'name':_0x3072ad[_0x18cc('0x2f')],'type':_0x3072ad[_0x18cc('0x30')]['key']};});_0x399d07['model']=_[_0x18cc('0x2c')](_0xd98c63,_0x18cc('0x29'));_0x399d07['query']=_['keys'](_0x15c047[_0x18cc('0x31')]);_0x399d07[_0x18cc('0x32')]=_[_0x18cc('0x33')](_0x399d07[_0x18cc('0x34')],_0x399d07[_0x18cc('0x31')]);_0x29119d[_0x18cc('0x35')]=_['intersection'](_0x399d07[_0x18cc('0x34')],qs[_0x18cc('0x36')](_0x15c047[_0x18cc('0x31')][_0x18cc('0x36')]));_0x29119d[_0x18cc('0x35')]=_0x29119d['attributes'][_0x18cc('0x37')]?_0x29119d[_0x18cc('0x35')]:_0x399d07[_0x18cc('0x34')];if(!_0x15c047[_0x18cc('0x31')][_0x18cc('0x38')](_0x18cc('0x39'))){_0x29119d[_0x18cc('0x19')]=qs['limit'](_0x15c047[_0x18cc('0x31')][_0x18cc('0x19')]);_0x29119d['offset']=qs[_0x18cc('0x18')](_0x15c047[_0x18cc('0x31')][_0x18cc('0x18')]);}_0x29119d[_0x18cc('0x3a')]=qs[_0x18cc('0x3b')](_0x15c047['query'][_0x18cc('0x3b')]);_0x29119d[_0x18cc('0x3c')]=qs[_0x18cc('0x32')](_['pick'](_0x15c047['query'],_0x399d07[_0x18cc('0x32')]),_0xd98c63);if(_0x15c047[_0x18cc('0x31')]['filter']){_0x29119d[_0x18cc('0x3c')]=_[_0x18cc('0x3d')](_0x29119d[_0x18cc('0x3c')],{'$or':_[_0x18cc('0x2c')](_0xd98c63,function(_0x1ff199){if(_0x1ff199['type']!==_0x18cc('0x3e')){var _0xdce109={};_0xdce109[_0x1ff199[_0x18cc('0x29')]]={'$like':'%'+_0x15c047[_0x18cc('0x31')][_0x18cc('0x3f')]+'%'};return _0xdce109;}})});}_0x29119d=_[_0x18cc('0x3d')]({},_0x29119d,_0x15c047['options']);var _0x1a9a4e={'where':_0x29119d[_0x18cc('0x3c')]};return db[_0x18cc('0x2d')]['count'](_0x1a9a4e)[_0x18cc('0x22')](function(_0xb12dee){_0x5bb35e[_0x18cc('0x1a')]=_0xb12dee;if(_0x15c047[_0x18cc('0x31')][_0x18cc('0x40')]){_0x29119d[_0x18cc('0x41')]=[{'all':!![]}];}return db[_0x18cc('0x2d')][_0x18cc('0x42')](_0x29119d);})[_0x18cc('0x22')](function(_0x175062){_0x5bb35e[_0x18cc('0x43')]=_0x175062;return _0x5bb35e;})[_0x18cc('0x22')](respondWithFilteredResult(_0x50af21,_0x29119d))[_0x18cc('0x44')](handleError(_0x50af21,null));};exports[_0x18cc('0x45')]=function(_0x1d4b56,_0xd474e4){var _0x36715d={'raw':!![],'where':{'id':_0x1d4b56[_0x18cc('0x46')]['id']}},_0x4027ec={};_0x4027ec['model']=_[_0x18cc('0x47')](db[_0x18cc('0x2d')][_0x18cc('0x2e')]);_0x4027ec[_0x18cc('0x31')]=_[_0x18cc('0x47')](_0x1d4b56[_0x18cc('0x31')]);_0x4027ec[_0x18cc('0x32')]=_['intersection'](_0x4027ec[_0x18cc('0x34')],_0x4027ec[_0x18cc('0x31')]);_0x36715d['attributes']=_[_0x18cc('0x33')](_0x4027ec[_0x18cc('0x34')],qs['fields'](_0x1d4b56['query'][_0x18cc('0x36')]));_0x36715d[_0x18cc('0x35')]=_0x36715d[_0x18cc('0x35')][_0x18cc('0x37')]?_0x36715d['attributes']:_0x4027ec[_0x18cc('0x34')];if(_0x1d4b56[_0x18cc('0x31')][_0x18cc('0x40')]){_0x36715d[_0x18cc('0x41')]=[{'all':!![]}];}_0x36715d=_[_0x18cc('0x3d')]({},_0x36715d,_0x1d4b56[_0x18cc('0x48')]);return db[_0x18cc('0x2d')]['find'](_0x36715d)[_0x18cc('0x22')](handleEntityNotFound(_0xd474e4,null))['then'](respondWithResult(_0xd474e4,null))[_0x18cc('0x44')](handleError(_0xd474e4,null));};exports[_0x18cc('0x49')]=function(_0x3a498a,_0x470709){return db[_0x18cc('0x2d')][_0x18cc('0x49')](_0x3a498a[_0x18cc('0x4a')],{})[_0x18cc('0x22')](function(_0x2b4e4a){var _0x3b8038=_0x3a498a[_0x18cc('0x4b')][_0x18cc('0x23')]({'plain':!![]});if(!_0x3b8038)throw new Error(_0x18cc('0x4c'));if(_0x3b8038[_0x18cc('0x4d')]==='user'){var _0x392818=_0x2b4e4a['get']({'plain':!![]});var _0x51e017='Dispositions';return db['UserProfileSection'][_0x18cc('0x4e')]({'where':{'name':_0x51e017,'userProfileId':_0x3b8038[_0x18cc('0x4f')]},'raw':!![]})[_0x18cc('0x22')](function(_0x100fbf){if(_0x100fbf&&_0x100fbf[_0x18cc('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x392818[_0x18cc('0x29')],'resourceId':_0x392818['id'],'type':_0x100fbf[_0x18cc('0x29')],'sectionId':_0x100fbf['id']},{})['then'](function(){return _0x2b4e4a;});}else{return _0x2b4e4a;}})['catch'](function(_0x47d98d){logger[_0x18cc('0x27')](_0x18cc('0x51'),_0x47d98d);throw _0x47d98d;});}return _0x2b4e4a;})[_0x18cc('0x22')](respondWithResult(_0x470709,0xc9))[_0x18cc('0x44')](handleError(_0x470709,null));};exports[_0x18cc('0x21')]=function(_0x222953,_0x11c7c9){if(_0x222953[_0x18cc('0x4a')]['id']){delete _0x222953[_0x18cc('0x4a')]['id'];}return db[_0x18cc('0x2d')][_0x18cc('0x4e')]({'where':{'id':_0x222953[_0x18cc('0x46')]['id']}})[_0x18cc('0x22')](handleEntityNotFound(_0x11c7c9,null))[_0x18cc('0x22')](saveUpdates(_0x222953[_0x18cc('0x4a')],null))[_0x18cc('0x22')](respondWithResult(_0x11c7c9,null))[_0x18cc('0x44')](handleError(_0x11c7c9,null));};exports[_0x18cc('0x26')]=function(_0x5aab32,_0x1d4963){return db[_0x18cc('0x2d')][_0x18cc('0x4e')]({'where':{'id':_0x5aab32[_0x18cc('0x46')]['id']}})[_0x18cc('0x22')](handleEntityNotFound(_0x1d4963,null))[_0x18cc('0x22')](removeEntity(_0x1d4963,null))['catch'](handleError(_0x1d4963,null));};
\ No newline at end of file
+var _0xdc03=['sort','where','pick','map','VIRTUAL','filter','options','include','findAll','rows','catch','params','rawAttributes','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','Dispositions','UserProfileResource','name','index','Disposition','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x511ccc,_0x49122b){var _0x984aef=function(_0x7da4ed){while(--_0x7da4ed){_0x511ccc['push'](_0x511ccc['shift']());}};_0x984aef(++_0x49122b);}(_0xdc03,0x65));var _0x3dc0=function(_0x1ca9ee,_0x10616e){_0x1ca9ee=_0x1ca9ee-0x0;var _0x4598ad=_0xdc03[_0x1ca9ee];return _0x4598ad;};'use strict';var emlformat=require(_0x3dc0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dc0('0x1'));var jsonpatch=require(_0x3dc0('0x2'));var rp=require('request-promise');var moment=require(_0x3dc0('0x3'));var BPromise=require(_0x3dc0('0x4'));var Mustache=require(_0x3dc0('0x5'));var util=require(_0x3dc0('0x6'));var path=require(_0x3dc0('0x7'));var sox=require(_0x3dc0('0x8'));var csv=require('to-csv');var ejs=require(_0x3dc0('0x9'));var fs=require('fs');var fs_extra=require(_0x3dc0('0xa'));var _=require(_0x3dc0('0xb'));var squel=require('squel');var crypto=require(_0x3dc0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3dc0('0xd'));var Papa=require(_0x3dc0('0xe'));var Redis=require(_0x3dc0('0xf'));var authService=require(_0x3dc0('0x10'));var qs=require(_0x3dc0('0x11'));var as=require(_0x3dc0('0x12'));var hardwareService=require(_0x3dc0('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x3dc0('0x14'));var config=require(_0x3dc0('0x15'));var licenseUtil=require(_0x3dc0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e9e01,_0x9ddaff){_0x9ddaff=_0x9ddaff||0xcc;return function(_0x4938d1){if(_0x4938d1){return _0x5e9e01[_0x3dc0('0x17')](_0x9ddaff);}return _0x5e9e01['status'](_0x9ddaff)['end']();};}function respondWithResult(_0x297de8,_0x40b361){_0x40b361=_0x40b361||0xc8;return function(_0x1d250c){if(_0x1d250c){return _0x297de8[_0x3dc0('0x18')](_0x40b361)[_0x3dc0('0x19')](_0x1d250c);}};}function respondWithFilteredResult(_0x309423,_0x1c9d01){return function(_0x21d8f7){if(_0x21d8f7){var _0x4e449a=typeof _0x1c9d01[_0x3dc0('0x1a')]===_0x3dc0('0x1b')&&typeof _0x1c9d01['limit']===_0x3dc0('0x1b');var _0xd5b9f1=_0x21d8f7[_0x3dc0('0x1c')];var _0x5d45ee=_0x4e449a?0x0:_0x1c9d01[_0x3dc0('0x1a')];var _0x2e7771=_0x4e449a?_0x21d8f7[_0x3dc0('0x1c')]:_0x1c9d01['offset']+_0x1c9d01[_0x3dc0('0x1d')];var _0x3776f4;if(_0x2e7771>=_0xd5b9f1){_0x2e7771=_0xd5b9f1;_0x3776f4=0xc8;}else{_0x3776f4=0xce;}_0x309423[_0x3dc0('0x18')](_0x3776f4);return _0x309423[_0x3dc0('0x1e')](_0x3dc0('0x1f'),_0x5d45ee+'-'+_0x2e7771+'/'+_0xd5b9f1)[_0x3dc0('0x19')](_0x21d8f7);}return null;};}function patchUpdates(_0x379fff){return function(_0x257696){try{jsonpatch[_0x3dc0('0x20')](_0x257696,_0x379fff,!![]);}catch(_0xbef495){return BPromise['reject'](_0xbef495);}return _0x257696[_0x3dc0('0x21')]();};}function saveUpdates(_0x1927a0,_0x273ea2){return function(_0x5ee6b3){if(_0x5ee6b3){return _0x5ee6b3['update'](_0x1927a0)[_0x3dc0('0x22')](function(_0x3843bb){return _0x3843bb;});}return null;};}function removeEntity(_0x32f3a2,_0x410f96){return function(_0x503332){if(_0x503332){return _0x503332[_0x3dc0('0x23')]()['then'](function(){var _0x58c3db=_0x503332[_0x3dc0('0x24')]({'plain':!![]});var _0x25b492=_0x3dc0('0x25');return db[_0x3dc0('0x26')][_0x3dc0('0x23')]({'where':{'type':_0x25b492,'resourceId':_0x58c3db['id']}})['then'](function(){return _0x503332;});})['then'](function(){_0x32f3a2[_0x3dc0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45a74e,_0x1ec992){return function(_0x4dcc24){if(!_0x4dcc24){_0x45a74e[_0x3dc0('0x17')](0x194);}return _0x4dcc24;};}function handleError(_0x57fb09,_0x3348b6){_0x3348b6=_0x3348b6||0x1f4;return function(_0xf1f3e6){logger['error'](_0xf1f3e6['stack']);if(_0xf1f3e6[_0x3dc0('0x27')]){delete _0xf1f3e6['name'];}_0x57fb09['status'](_0x3348b6)['send'](_0xf1f3e6);};}exports[_0x3dc0('0x28')]=function(_0x1a4905,_0x195560){var _0x528355={},_0xde1690={},_0x1e485d={'count':0x0,'rows':[]};var _0x52b5ac=_['map'](db[_0x3dc0('0x29')]['rawAttributes'],function(_0x3c47b7){return{'name':_0x3c47b7[_0x3dc0('0x2a')],'type':_0x3c47b7[_0x3dc0('0x2b')][_0x3dc0('0x2c')]};});_0xde1690[_0x3dc0('0x2d')]=_['map'](_0x52b5ac,'name');_0xde1690[_0x3dc0('0x2e')]=_[_0x3dc0('0x2f')](_0x1a4905[_0x3dc0('0x2e')]);_0xde1690[_0x3dc0('0x30')]=_[_0x3dc0('0x31')](_0xde1690[_0x3dc0('0x2d')],_0xde1690['query']);_0x528355['attributes']=_['intersection'](_0xde1690[_0x3dc0('0x2d')],qs[_0x3dc0('0x32')](_0x1a4905[_0x3dc0('0x2e')]['fields']));_0x528355['attributes']=_0x528355[_0x3dc0('0x33')][_0x3dc0('0x34')]?_0x528355[_0x3dc0('0x33')]:_0xde1690['model'];if(!_0x1a4905[_0x3dc0('0x2e')][_0x3dc0('0x35')](_0x3dc0('0x36'))){_0x528355['limit']=qs[_0x3dc0('0x1d')](_0x1a4905[_0x3dc0('0x2e')][_0x3dc0('0x1d')]);_0x528355[_0x3dc0('0x1a')]=qs[_0x3dc0('0x1a')](_0x1a4905[_0x3dc0('0x2e')][_0x3dc0('0x1a')]);}_0x528355['order']=qs[_0x3dc0('0x37')](_0x1a4905['query'][_0x3dc0('0x37')]);_0x528355[_0x3dc0('0x38')]=qs[_0x3dc0('0x30')](_[_0x3dc0('0x39')](_0x1a4905[_0x3dc0('0x2e')],_0xde1690[_0x3dc0('0x30')]),_0x52b5ac);if(_0x1a4905[_0x3dc0('0x2e')]['filter']){_0x528355['where']=_['merge'](_0x528355[_0x3dc0('0x38')],{'$or':_[_0x3dc0('0x3a')](_0x52b5ac,function(_0x41f5f9){if(_0x41f5f9['type']!==_0x3dc0('0x3b')){var _0x4c60db={};_0x4c60db[_0x41f5f9[_0x3dc0('0x27')]]={'$like':'%'+_0x1a4905[_0x3dc0('0x2e')][_0x3dc0('0x3c')]+'%'};return _0x4c60db;}})});}_0x528355=_['merge']({},_0x528355,_0x1a4905[_0x3dc0('0x3d')]);var _0x40af27={'where':_0x528355[_0x3dc0('0x38')]};return db[_0x3dc0('0x29')][_0x3dc0('0x1c')](_0x40af27)['then'](function(_0x8c4b14){_0x1e485d[_0x3dc0('0x1c')]=_0x8c4b14;if(_0x1a4905[_0x3dc0('0x2e')]['includeAll']){_0x528355[_0x3dc0('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x3dc0('0x3f')](_0x528355);})[_0x3dc0('0x22')](function(_0x2715f8){_0x1e485d[_0x3dc0('0x40')]=_0x2715f8;return _0x1e485d;})[_0x3dc0('0x22')](respondWithFilteredResult(_0x195560,_0x528355))[_0x3dc0('0x41')](handleError(_0x195560,null));};exports['show']=function(_0x3d360d,_0x557434){var _0x119f08={'raw':!![],'where':{'id':_0x3d360d[_0x3dc0('0x42')]['id']}},_0x26866d={};_0x26866d['model']=_[_0x3dc0('0x2f')](db[_0x3dc0('0x29')][_0x3dc0('0x43')]);_0x26866d[_0x3dc0('0x2e')]=_[_0x3dc0('0x2f')](_0x3d360d[_0x3dc0('0x2e')]);_0x26866d[_0x3dc0('0x30')]=_['intersection'](_0x26866d[_0x3dc0('0x2d')],_0x26866d[_0x3dc0('0x2e')]);_0x119f08[_0x3dc0('0x33')]=_[_0x3dc0('0x31')](_0x26866d[_0x3dc0('0x2d')],qs['fields'](_0x3d360d[_0x3dc0('0x2e')][_0x3dc0('0x32')]));_0x119f08[_0x3dc0('0x33')]=_0x119f08[_0x3dc0('0x33')]['length']?_0x119f08[_0x3dc0('0x33')]:_0x26866d[_0x3dc0('0x2d')];if(_0x3d360d[_0x3dc0('0x2e')][_0x3dc0('0x44')]){_0x119f08[_0x3dc0('0x3e')]=[{'all':!![]}];}_0x119f08=_[_0x3dc0('0x45')]({},_0x119f08,_0x3d360d[_0x3dc0('0x3d')]);return db['Disposition'][_0x3dc0('0x46')](_0x119f08)['then'](handleEntityNotFound(_0x557434,null))[_0x3dc0('0x22')](respondWithResult(_0x557434,null))[_0x3dc0('0x41')](handleError(_0x557434,null));};exports[_0x3dc0('0x47')]=function(_0x3829b1,_0x1b84e6){return db[_0x3dc0('0x29')][_0x3dc0('0x47')](_0x3829b1[_0x3dc0('0x48')],{})[_0x3dc0('0x22')](function(_0x34bf94){var _0x3689e0=_0x3829b1[_0x3dc0('0x49')][_0x3dc0('0x24')]({'plain':!![]});if(!_0x3689e0)throw new Error(_0x3dc0('0x4a'));if(_0x3689e0[_0x3dc0('0x4b')]===_0x3dc0('0x49')){var _0x2897c7=_0x34bf94[_0x3dc0('0x24')]({'plain':!![]});var _0x154a4f='Dispositions';return db['UserProfileSection'][_0x3dc0('0x46')]({'where':{'name':_0x154a4f,'userProfileId':_0x3689e0[_0x3dc0('0x4c')]},'raw':!![]})[_0x3dc0('0x22')](function(_0x3a2f4a){if(_0x3a2f4a&&_0x3a2f4a[_0x3dc0('0x4d')]===0x0){return db['UserProfileResource'][_0x3dc0('0x47')]({'name':_0x2897c7[_0x3dc0('0x27')],'resourceId':_0x2897c7['id'],'type':_0x3a2f4a[_0x3dc0('0x27')],'sectionId':_0x3a2f4a['id']},{})[_0x3dc0('0x22')](function(){return _0x34bf94;});}else{return _0x34bf94;}})['catch'](function(_0x223ee8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x223ee8);throw _0x223ee8;});}return _0x34bf94;})[_0x3dc0('0x22')](respondWithResult(_0x1b84e6,0xc9))['catch'](handleError(_0x1b84e6,null));};exports['update']=function(_0x224c51,_0x46df28){if(_0x224c51[_0x3dc0('0x48')]['id']){delete _0x224c51[_0x3dc0('0x48')]['id'];}return db[_0x3dc0('0x29')]['find']({'where':{'id':_0x224c51['params']['id']}})[_0x3dc0('0x22')](handleEntityNotFound(_0x46df28,null))['then'](saveUpdates(_0x224c51[_0x3dc0('0x48')],null))[_0x3dc0('0x22')](respondWithResult(_0x46df28,null))['catch'](handleError(_0x46df28,null));};exports[_0x3dc0('0x23')]=function(_0x2626c5,_0x2cf469){return db[_0x3dc0('0x29')][_0x3dc0('0x46')]({'where':{'id':_0x2626c5['params']['id']}})['then'](handleEntityNotFound(_0x2cf469,null))[_0x3dc0('0x22')](removeEntity(_0x2cf469,null))['catch'](handleError(_0x2cf469,null));};
\ No newline at end of file
index 7c77fd8..148ec77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74c8=['../../config/environment','./disposition.attributes','Disposition','name_voice','name','ListId','name_chat','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x59f7a7,_0xce39b2){var _0x15da0d=function(_0x1e0e64){while(--_0x1e0e64){_0x59f7a7['push'](_0x59f7a7['shift']());}};_0x15da0d(++_0xce39b2);}(_0x74c8,0xb5));var _0x874c=function(_0x51ba9a,_0x3c5fb7){_0x51ba9a=_0x51ba9a-0x0;var _0x25eed7=_0x74c8[_0x51ba9a];return _0x25eed7;};'use strict';var _=require(_0x874c('0x0'));var util=require(_0x874c('0x1'));var logger=require(_0x874c('0x2'))('api');var moment=require(_0x874c('0x3'));var BPromise=require(_0x874c('0x4'));var rp=require(_0x874c('0x5'));var fs=require('fs');var path=require(_0x874c('0x6'));var rimraf=require(_0x874c('0x7'));var config=require(_0x874c('0x8'));var attributes=require(_0x874c('0x9'));module['exports']=function(_0x20b9eb,_0x392ad0){return _0x20b9eb['define'](_0x874c('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x874c('0xb'),'fields':[_0x874c('0xc'),_0x874c('0xd')]},{'unique':!![],'name':_0x874c('0xe'),'fields':[_0x874c('0xc'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x874c('0xc'),'MailAccountId']},{'unique':!![],'name':_0x874c('0xf'),'fields':[_0x874c('0xc'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x874c('0xc'),_0x874c('0x10')]},{'unique':!![],'name':_0x874c('0x11'),'fields':['name',_0x874c('0x12')]},{'unique':!![],'name':_0x874c('0x13'),'fields':['name',_0x874c('0x14')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb76=['ChatWebsiteId','name_mail','MailAccountId','name_sms','name','SmsAccountId','name_fax','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','name_voice','ListId'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0xbb76,0x1b4));var _0x6bb7=function(_0x5e5c4c,_0x21abba){_0x5e5c4c=_0x5e5c4c-0x0;var _0x176148=_0xbb76[_0x5e5c4c];return _0x176148;};'use strict';var _=require(_0x6bb7('0x0'));var util=require(_0x6bb7('0x1'));var logger=require('../../config/logger')(_0x6bb7('0x2'));var moment=require(_0x6bb7('0x3'));var BPromise=require(_0x6bb7('0x4'));var rp=require(_0x6bb7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bb7('0x6'));var config=require(_0x6bb7('0x7'));var attributes=require(_0x6bb7('0x8'));module[_0x6bb7('0x9')]=function(_0x44d6df,_0x3a1756){return _0x44d6df[_0x6bb7('0xa')](_0x6bb7('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6bb7('0xc'),'fields':['name',_0x6bb7('0xd')]},{'unique':!![],'name':'name_chat','fields':['name',_0x6bb7('0xe')]},{'unique':!![],'name':_0x6bb7('0xf'),'fields':['name',_0x6bb7('0x10')]},{'unique':!![],'name':_0x6bb7('0x11'),'fields':[_0x6bb7('0x12'),_0x6bb7('0x13')]},{'unique':!![],'name':_0x6bb7('0x14'),'fields':['name',_0x6bb7('0x15')]},{'unique':!![],'name':_0x6bb7('0x16'),'fields':[_0x6bb7('0x12'),'OpenchannelAccountId']},{'unique':!![],'name':_0x6bb7('0x17'),'fields':['name',_0x6bb7('0x18')]}],'timestamps':!![]});};
\ No newline at end of file
index 9732d73..fdc7c66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2b9678,_0x18b7bd){var _0x520c11=function(_0xebee7a){while(--_0xebee7a){_0x2b9678['push'](_0x2b9678['shift']());}};_0x520c11(++_0x18b7bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc24e2c,_0x53a797){var _0x17d8c1=function(_0x15f75c){while(--_0x15f75c){_0xc24e2c['push'](_0xc24e2c['shift']());}};_0x17d8c1(++_0x53a797);}(_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 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
index 21e72d9..304c8e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce56=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','multer'];(function(_0x80bea0,_0x4c30f4){var _0x50fb90=function(_0x1484ce){while(--_0x1484ce){_0x80bea0['push'](_0x80bea0['shift']());}};_0x50fb90(++_0x4c30f4);}(_0xce56,0x12f));var _0x6ce5=function(_0x9729d7,_0x1b79a8){_0x9729d7=_0x9729d7-0x0;var _0x3c4ac6=_0xce56[_0x9729d7];return _0x3c4ac6;};'use strict';var multer=require(_0x6ce5('0x0'));var util=require(_0x6ce5('0x1'));var path=require(_0x6ce5('0x2'));var timeout=require(_0x6ce5('0x3'));var express=require('express');var router=express[_0x6ce5('0x4')]();var fs_extra=require(_0x6ce5('0x5'));var auth=require(_0x6ce5('0x6'));var interaction=require(_0x6ce5('0x7'));var config=require(_0x6ce5('0x8'));var controller=require(_0x6ce5('0x9'));router[_0x6ce5('0xa')]('/',auth[_0x6ce5('0xb')](),controller[_0x6ce5('0xc')]);router[_0x6ce5('0xa')](_0x6ce5('0xd'),auth[_0x6ce5('0xb')](),controller[_0x6ce5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6ce5('0xf')](_0x6ce5('0xd'),auth['isAuthenticated'](),controller[_0x6ce5('0x10')]);router[_0x6ce5('0x11')](_0x6ce5('0xd'),auth[_0x6ce5('0xb')](),controller['destroy']);module[_0x6ce5('0x12')]=router;
\ No newline at end of file
+var _0x4959=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','delete','multer','util','path','express','Router','fs-extra'];(function(_0x4a7389,_0x5b0e4e){var _0x56aea0=function(_0x94c6c6){while(--_0x94c6c6){_0x4a7389['push'](_0x4a7389['shift']());}};_0x56aea0(++_0x5b0e4e);}(_0x4959,0x181));var _0x9495=function(_0x4b8b61,_0x3ca11b){_0x4b8b61=_0x4b8b61-0x0;var _0x3ae8d1=_0x4959[_0x4b8b61];return _0x3ae8d1;};'use strict';var multer=require(_0x9495('0x0'));var util=require(_0x9495('0x1'));var path=require(_0x9495('0x2'));var timeout=require('connect-timeout');var express=require(_0x9495('0x3'));var router=express[_0x9495('0x4')]();var fs_extra=require(_0x9495('0x5'));var auth=require(_0x9495('0x6'));var interaction=require(_0x9495('0x7'));var config=require(_0x9495('0x8'));var controller=require('./disposition.controller');router[_0x9495('0x9')]('/',auth[_0x9495('0xa')](),controller[_0x9495('0xb')]);router['get'](_0x9495('0xc'),auth[_0x9495('0xa')](),controller[_0x9495('0xd')]);router[_0x9495('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9495('0xf')](_0x9495('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x9495('0x10')](_0x9495('0xc'),auth[_0x9495('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 236d766..20bd166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9902=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9902,0x10e));var _0x2990=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9902[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x2990('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2990('0x1')]},'ecm':{'type':Sequelize[_0x2990('0x2')](_0x2990('0x3'),'no'),'defaultValue':_0x2990('0x3')},'headerinfo':{'type':Sequelize[_0x2990('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x2990('0x1')],'unique':_0x2990('0x4')},'minrate':{'type':Sequelize[_0x2990('0x2')](_0x2990('0x5'),_0x2990('0x6'),_0x2990('0x7'),_0x2990('0x8'),_0x2990('0x9'),_0x2990('0xa')),'defaultValue':_0x2990('0x6')},'maxrate':{'type':Sequelize[_0x2990('0x2')](_0x2990('0x5'),_0x2990('0x6'),_0x2990('0x7'),_0x2990('0x8'),_0x2990('0x9'),_0x2990('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x2990('0x1')],'defaultValue':_0x2990('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x2990('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x2990('0x2')](_0x2990('0xc'),_0x2990('0xd'),'DADHI',_0x2990('0xe')),'defaultValue':_0x2990('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x2990('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x2990('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2990('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2990('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2990('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2990('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2990('0x11')],'allowNull':!![],'defaultValue':null,'comment':_0x2990('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x2990('0x10')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x166540){if(!_0x166540)this['setDataValue'](_0x2990('0x13'),null);this[_0x2990('0x14')](_0x2990('0x15'),_0x166540);}}};
\ No newline at end of file
+var _0x3515=['12000','14400','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600'];(function(_0x11c090,_0x7d8e4e){var _0x444c13=function(_0x2fd312){while(--_0x2fd312){_0x11c090['push'](_0x11c090['shift']());}};_0x444c13(++_0x7d8e4e);}(_0x3515,0x1d9));var _0x5351=function(_0xf2bd2f,_0x135721){_0xf2bd2f=_0xf2bd2f-0x0;var _0x1efbb1=_0x3515[_0xf2bd2f];return _0x1efbb1;};'use strict';var Sequelize=require(_0x5351('0x0'));module[_0x5351('0x1')]={'name':{'type':Sequelize[_0x5351('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x5351('0x3')](_0x5351('0x4'),'no'),'defaultValue':_0x5351('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0x5351('0x5')},'minrate':{'type':Sequelize[_0x5351('0x3')](_0x5351('0x6'),_0x5351('0x7'),_0x5351('0x8'),_0x5351('0x9'),_0x5351('0xa'),_0x5351('0xb')),'defaultValue':_0x5351('0x7')},'maxrate':{'type':Sequelize[_0x5351('0x3')](_0x5351('0x6'),_0x5351('0x7'),_0x5351('0x8'),'9600',_0x5351('0xa'),_0x5351('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x5351('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0x5351('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x5351('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x5351('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x5351('0x3')](_0x5351('0xd'),_0x5351('0xe'),_0x5351('0xf'),_0x5351('0x10')),'defaultValue':_0x5351('0xd')},'key':{'type':Sequelize[_0x5351('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x5351('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x5351('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x5351('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5351('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5351('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x5351('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x5351('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5351('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x5351('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x5351('0x12')],'defaultValue':![],'comment':_0x5351('0x13'),'set':function(_0x3dc3a8){if(!_0x3dc3a8)this[_0x5351('0x14')](_0x5351('0x15'),null);this[_0x5351('0x14')](_0x5351('0x16'),_0x3dc3a8);}}};
\ No newline at end of file
index 55b9919..8e71bd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4aa=['save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','map','FaxAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','mandatoryDispositionPause','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','FaxAccountId','Disposition','findOne','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','User','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','priority','finally','json','getApplications','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','error','code','message','catch','sendStatus','status','end','undefined','limit','count','offset','reject'];(function(_0x223c77,_0x4a0939){var _0xbc240f=function(_0x1dc102){while(--_0x1dc102){_0x223c77['push'](_0x223c77['shift']());}};_0xbc240f(++_0x4a0939);}(_0xd4aa,0x156));var _0xad4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xd4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0xad4a('0x0'));var rimraf=require(_0xad4a('0x1'));var zipdir=require(_0xad4a('0x2'));var jsonpatch=require(_0xad4a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad4a('0x4'));var Mustache=require(_0xad4a('0x5'));var util=require('util');var path=require(_0xad4a('0x6'));var sox=require(_0xad4a('0x7'));var csv=require(_0xad4a('0x8'));var ejs=require(_0xad4a('0x9'));var fs=require('fs');var fs_extra=require(_0xad4a('0xa'));var _=require(_0xad4a('0xb'));var squel=require(_0xad4a('0xc'));var crypto=require(_0xad4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xad4a('0x8'));var querystring=require('querystring');var Papa=require(_0xad4a('0xe'));var Redis=require(_0xad4a('0xf'));var authService=require(_0xad4a('0x10'));var qs=require(_0xad4a('0x11'));var as=require(_0xad4a('0x12'));var hardwareService=require(_0xad4a('0x13'));var logger=require(_0xad4a('0x14'))(_0xad4a('0x15'));var utils=require(_0xad4a('0x16'));var config=require(_0xad4a('0x17'));var licenseUtil=require(_0xad4a('0x18'));var db=require(_0xad4a('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xad4a('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xad4a('0x1b')]));require(_0xad4a('0x1c'))[_0xad4a('0x1d')](socket);var jayson=require(_0xad4a('0x1e'));var client=jayson[_0xad4a('0x1f')]['http']({'port':0x232c});var client9002=jayson['client'][_0xad4a('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x24bdbc,_0x5b3d5a,_0x5aa36e,_0x49fba1){return new BPromise(function(_0x2a25c9,_0x3b6962){var _0x341989=_0x49fba1||client;return _0x341989[_0xad4a('0x21')](_0x24bdbc,_0x5aa36e)[_0xad4a('0x22')](function(_0x24cb8f){logger[_0xad4a('0x23')](_0xad4a('0x24'),_0x5b3d5a,_0xad4a('0x25'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5b3d5a,'request\x20sent',JSON['stringify'](_0x24cb8f));if(_0x24cb8f[_0xad4a('0x26')]){if(_0x24cb8f[_0xad4a('0x26')][_0xad4a('0x27')]===0x1f4){logger[_0xad4a('0x26')](_0xad4a('0x24'),_0x5b3d5a,_0x24cb8f[_0xad4a('0x26')][_0xad4a('0x28')]);return _0x3b6962(_0x24cb8f[_0xad4a('0x26')]['message']);}logger['error'](_0xad4a('0x24'),_0x5b3d5a,_0x24cb8f[_0xad4a('0x26')][_0xad4a('0x28')]);return _0x2a25c9(_0x24cb8f[_0xad4a('0x26')]['message']);}else{logger[_0xad4a('0x23')](_0xad4a('0x24'),_0x5b3d5a,_0xad4a('0x25'));_0x2a25c9(_0x24cb8f['result'][_0xad4a('0x28')]);}})[_0xad4a('0x29')](function(_0x325090){logger[_0xad4a('0x26')](_0xad4a('0x24'),_0x5b3d5a,_0x325090);_0x3b6962(_0x325090);});});}function respondWithStatusCode(_0x4a83f9,_0x38a7f2){_0x38a7f2=_0x38a7f2||0xcc;return function(_0x343b83){if(_0x343b83){return _0x4a83f9[_0xad4a('0x2a')](_0x38a7f2);}return _0x4a83f9[_0xad4a('0x2b')](_0x38a7f2)[_0xad4a('0x2c')]();};}function respondWithResult(_0x4f3fc0,_0x116f06){_0x116f06=_0x116f06||0xc8;return function(_0x1f15a6){if(_0x1f15a6){return _0x4f3fc0[_0xad4a('0x2b')](_0x116f06)['json'](_0x1f15a6);}};}function respondWithFilteredResult(_0x59a164,_0x4ac152){return function(_0x594b29){if(_0x594b29){var _0x5cad8e=typeof _0x4ac152['offset']===_0xad4a('0x2d')&&typeof _0x4ac152[_0xad4a('0x2e')]==='undefined';var _0x178cb7=_0x594b29['count'];var _0x288ab4=_0x5cad8e?0x0:_0x4ac152['offset'];var _0x185a04=_0x5cad8e?_0x594b29[_0xad4a('0x2f')]:_0x4ac152[_0xad4a('0x30')]+_0x4ac152['limit'];var _0xb51a87;if(_0x185a04>=_0x178cb7){_0x185a04=_0x178cb7;_0xb51a87=0xc8;}else{_0xb51a87=0xce;}_0x59a164[_0xad4a('0x2b')](_0xb51a87);return _0x59a164['set']('Content-Range',_0x288ab4+'-'+_0x185a04+'/'+_0x178cb7)['json'](_0x594b29);}return null;};}function patchUpdates(_0x192410){return function(_0x203ca9){try{jsonpatch['apply'](_0x203ca9,_0x192410,!![]);}catch(_0x161931){return BPromise[_0xad4a('0x31')](_0x161931);}return _0x203ca9[_0xad4a('0x32')]();};}function saveUpdates(_0x42c77e,_0x1151e8){return function(_0x73d358){if(_0x73d358){return _0x73d358[_0xad4a('0x33')](_0x42c77e)[_0xad4a('0x22')](function(_0x372fe8){return _0x372fe8;});}return null;};}function removeEntity(_0x486cf1,_0x563af9){return function(_0x461270){if(_0x461270){return _0x461270[_0xad4a('0x34')]()[_0xad4a('0x22')](function(){var _0x4e6e12=_0x461270[_0xad4a('0x35')]({'plain':!![]});var _0x37e7cb='FaxAccounts';return db[_0xad4a('0x36')][_0xad4a('0x34')]({'where':{'type':_0x37e7cb,'resourceId':_0x4e6e12['id']}})['then'](function(){return _0x461270;});})[_0xad4a('0x22')](function(){_0x486cf1[_0xad4a('0x2b')](0xcc)[_0xad4a('0x2c')]();});}};}function handleEntityNotFound(_0x39f66b,_0x18a458){return function(_0x44f1f5){if(!_0x44f1f5){_0x39f66b['sendStatus'](0x194);}return _0x44f1f5;};}function handleError(_0x580e37,_0x44c2d1){_0x44c2d1=_0x44c2d1||0x1f4;return function(_0x18a3f9){logger['error'](_0x18a3f9[_0xad4a('0x37')]);if(_0x18a3f9[_0xad4a('0x38')]){delete _0x18a3f9[_0xad4a('0x38')];}_0x580e37['status'](_0x44c2d1)[_0xad4a('0x39')](_0x18a3f9);};}exports[_0xad4a('0x3a')]=function(_0x3f7003,_0x33efa7){var _0x169893={'include':[{'model':db[_0xad4a('0x3b')],'as':'mandatoryDispositionPause'}]},_0x14075d={},_0x5b24db={'count':0x0,'rows':[]};var _0x5225a5=_[_0xad4a('0x3c')](db[_0xad4a('0x3d')][_0xad4a('0x3e')],function(_0x42cb36){return{'name':_0x42cb36[_0xad4a('0x3f')],'type':_0x42cb36['type']['key']};});_0x14075d[_0xad4a('0x40')]=_[_0xad4a('0x3c')](_0x5225a5,'name');_0x14075d[_0xad4a('0x41')]=_[_0xad4a('0x42')](_0x3f7003[_0xad4a('0x41')]);_0x14075d[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0x14075d[_0xad4a('0x40')],_0x14075d[_0xad4a('0x41')]);_0x169893[_0xad4a('0x45')]=_[_0xad4a('0x44')](_0x14075d['model'],qs[_0xad4a('0x46')](_0x3f7003[_0xad4a('0x41')][_0xad4a('0x46')]));_0x169893[_0xad4a('0x45')]=_0x169893[_0xad4a('0x45')][_0xad4a('0x47')]?_0x169893[_0xad4a('0x45')]:_0x14075d[_0xad4a('0x40')];if(!_0x3f7003[_0xad4a('0x41')][_0xad4a('0x48')](_0xad4a('0x49'))){_0x169893[_0xad4a('0x2e')]=qs['limit'](_0x3f7003['query'][_0xad4a('0x2e')]);_0x169893[_0xad4a('0x30')]=qs['offset'](_0x3f7003[_0xad4a('0x41')]['offset']);}_0x169893[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0x3f7003[_0xad4a('0x41')][_0xad4a('0x4b')]);_0x169893[_0xad4a('0x4c')]=qs[_0xad4a('0x43')](_[_0xad4a('0x4d')](_0x3f7003[_0xad4a('0x41')],_0x14075d['filters']),_0x5225a5);if(_0x3f7003[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x169893[_0xad4a('0x4c')]=_[_0xad4a('0x4f')](_0x169893[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x5225a5,function(_0x350f58){if(_0x350f58[_0xad4a('0x50')]!==_0xad4a('0x51')){var _0x3d8e36={};_0x3d8e36[_0x350f58[_0xad4a('0x38')]]={'$like':'%'+_0x3f7003[_0xad4a('0x41')]['filter']+'%'};return _0x3d8e36;}})});}_0x169893=_[_0xad4a('0x4f')]({},_0x169893,_0x3f7003[_0xad4a('0x52')]);var _0x139224={'where':_0x169893[_0xad4a('0x4c')]};return db['FaxAccount'][_0xad4a('0x2f')](_0x139224)[_0xad4a('0x22')](function(_0x35d34a){_0x5b24db[_0xad4a('0x2f')]=_0x35d34a;if(_0x3f7003[_0xad4a('0x41')][_0xad4a('0x53')]){_0x169893['include']=[{'all':!![]}];}return db[_0xad4a('0x3d')][_0xad4a('0x54')](_0x169893);})[_0xad4a('0x22')](function(_0x221203){_0x5b24db[_0xad4a('0x55')]=_0x221203;return _0x5b24db;})[_0xad4a('0x22')](respondWithFilteredResult(_0x33efa7,_0x169893))[_0xad4a('0x29')](handleError(_0x33efa7,null));};exports['show']=function(_0x2065f4,_0x261c55){var _0x55f5b6={'raw':![],'where':{'id':_0x2065f4[_0xad4a('0x56')]['id']},'include':[{'model':db[_0xad4a('0x3b')],'as':_0xad4a('0x57')}]},_0x19b3fe={};_0x19b3fe[_0xad4a('0x40')]=_[_0xad4a('0x42')](db[_0xad4a('0x3d')][_0xad4a('0x3e')]);_0x19b3fe['query']=_[_0xad4a('0x42')](_0x2065f4[_0xad4a('0x41')]);_0x19b3fe[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0x19b3fe['model'],_0x19b3fe[_0xad4a('0x41')]);_0x55f5b6['attributes']=_[_0xad4a('0x44')](_0x19b3fe[_0xad4a('0x40')],qs[_0xad4a('0x46')](_0x2065f4['query'][_0xad4a('0x46')]));_0x55f5b6[_0xad4a('0x45')]=_0x55f5b6['attributes'][_0xad4a('0x47')]?_0x55f5b6[_0xad4a('0x45')]:_0x19b3fe[_0xad4a('0x40')];if(_0x2065f4[_0xad4a('0x41')][_0xad4a('0x53')]){_0x55f5b6[_0xad4a('0x58')]=[{'all':!![]}];}_0x55f5b6=_[_0xad4a('0x4f')]({},_0x55f5b6,_0x2065f4[_0xad4a('0x52')]);return db['FaxAccount'][_0xad4a('0x59')](_0x55f5b6)['then'](handleEntityNotFound(_0x261c55,null))[_0xad4a('0x22')](respondWithResult(_0x261c55,null))[_0xad4a('0x29')](handleError(_0x261c55,null));};exports[_0xad4a('0x5a')]=function(_0x412459,_0x458abb){return db[_0xad4a('0x3d')][_0xad4a('0x5a')](_0x412459[_0xad4a('0x5b')],{})['then'](function(_0x4275da){var _0x2f3107=_0x412459['user']['get']({'plain':!![]});if(!_0x2f3107)throw new Error(_0xad4a('0x5c'));if(_0x2f3107[_0xad4a('0x5d')]===_0xad4a('0x5e')){var _0xf3204f=_0x4275da[_0xad4a('0x35')]({'plain':!![]});var _0x4db5d0=_0xad4a('0x5f');return db[_0xad4a('0x60')]['find']({'where':{'name':_0x4db5d0,'userProfileId':_0x2f3107[_0xad4a('0x61')]},'raw':!![]})[_0xad4a('0x22')](function(_0x54b76f){if(_0x54b76f&&_0x54b76f[_0xad4a('0x62')]===0x0){return db[_0xad4a('0x36')][_0xad4a('0x5a')]({'name':_0xf3204f['name'],'resourceId':_0xf3204f['id'],'type':_0x54b76f['name'],'sectionId':_0x54b76f['id']},{})[_0xad4a('0x22')](function(){return _0x4275da;});}else{return _0x4275da;}})[_0xad4a('0x29')](function(_0xca9ae){logger[_0xad4a('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xca9ae);throw _0xca9ae;});}return _0x4275da;})['then'](respondWithResult(_0x458abb,0xc9))[_0xad4a('0x29')](handleError(_0x458abb,null));};exports[_0xad4a('0x33')]=function(_0x1e255c,_0x11e69b){if(_0x1e255c[_0xad4a('0x5b')]['id']){delete _0x1e255c[_0xad4a('0x5b')]['id'];}return db[_0xad4a('0x3d')][_0xad4a('0x59')]({'where':{'id':_0x1e255c[_0xad4a('0x56')]['id']},'include':[{'model':db[_0xad4a('0x3b')],'as':'mandatoryDispositionPause'}]})[_0xad4a('0x22')](handleEntityNotFound(_0x11e69b,null))[_0xad4a('0x22')](saveUpdates(_0x1e255c['body'],null))[_0xad4a('0x22')](respondWithResult(_0x11e69b,null))[_0xad4a('0x29')](handleError(_0x11e69b,null));};exports['destroy']=function(_0x275994,_0x47a9e3){return db[_0xad4a('0x3d')]['find']({'where':{'id':_0x275994['params']['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x47a9e3,null))[_0xad4a('0x22')](removeEntity(_0x47a9e3,null))['catch'](handleError(_0x47a9e3,null));};exports[_0xad4a('0x63')]=function(_0x9c73eb,_0x229c48){return db[_0xad4a('0x3d')]['describe']()['then'](respondWithResult(_0x229c48,null))['catch'](handleError(_0x229c48,null));};exports[_0xad4a('0x64')]=function(_0x3db542,_0x3336e4,_0x1aabc8){if(_0x3db542[_0xad4a('0x5b')]['id']){delete _0x3db542['body']['id'];}return db['FaxAccount']['find']({'where':{'id':_0x3db542[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x3336e4,null))[_0xad4a('0x22')](function(_0x322644){if(_0x322644){_0x3db542[_0xad4a('0x5b')][_0xad4a('0x65')]=_0x322644['id'];return db[_0xad4a('0x66')]['create'](_0x3db542[_0xad4a('0x5b')]);}})[_0xad4a('0x22')](respondWithResult(_0x3336e4,null))[_0xad4a('0x29')](handleError(_0x3336e4,null));};exports['getDispositions']=function(_0xe6307a,_0x489847,_0x1a368e){var _0x5c8617={'raw':![],'where':{}};var _0xc1fd45={};var _0x3c1d89={'count':0x0,'rows':[]};return db[_0xad4a('0x3d')][_0xad4a('0x67')]({'where':{'id':_0xe6307a[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x489847,null))[_0xad4a('0x22')](function(_0x4b7dc7){if(_0x4b7dc7){_0xc1fd45[_0xad4a('0x40')]=_['keys'](db[_0xad4a('0x66')][_0xad4a('0x3e')]);_0xc1fd45[_0xad4a('0x41')]=_[_0xad4a('0x42')](_0xe6307a[_0xad4a('0x41')]);_0xc1fd45['filters']=_['intersection'](_0xc1fd45[_0xad4a('0x40')],_0xc1fd45[_0xad4a('0x41')]);_0x5c8617['attributes']=_[_0xad4a('0x44')](_0xc1fd45['model'],qs[_0xad4a('0x46')](_0xe6307a[_0xad4a('0x41')]['fields']));_0x5c8617[_0xad4a('0x45')]=_0x5c8617[_0xad4a('0x45')][_0xad4a('0x47')]?_0x5c8617[_0xad4a('0x45')]:_0xc1fd45[_0xad4a('0x40')];if(!_0xe6307a['query'][_0xad4a('0x48')](_0xad4a('0x49'))){_0x5c8617[_0xad4a('0x2e')]=qs['limit'](_0xe6307a['query'][_0xad4a('0x2e')]);_0x5c8617['offset']=qs[_0xad4a('0x30')](_0xe6307a[_0xad4a('0x41')][_0xad4a('0x30')]);}_0x5c8617[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0xe6307a[_0xad4a('0x41')][_0xad4a('0x4b')]);_0x5c8617[_0xad4a('0x4c')]=qs[_0xad4a('0x43')](_[_0xad4a('0x4d')](_0xe6307a[_0xad4a('0x41')],_0xc1fd45[_0xad4a('0x43')]));_0x5c8617['where']['FaxAccountId']=_0x4b7dc7['id'];if(_0xe6307a[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x5c8617[_0xad4a('0x4c')]=_['merge'](_0x5c8617[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x5c8617[_0xad4a('0x45')],function(_0x143a5d){var _0x40a212={};_0x40a212[_0x143a5d]={'$like':'%'+_0xe6307a[_0xad4a('0x41')][_0xad4a('0x4e')]+'%'};return _0x40a212;})});}_0x5c8617=_['merge']({},_0x5c8617,_0xe6307a['options']);return db[_0xad4a('0x66')][_0xad4a('0x2f')]({'where':_0x5c8617[_0xad4a('0x4c')]})[_0xad4a('0x22')](function(_0x8d9e0c){_0x3c1d89[_0xad4a('0x2f')]=_0x8d9e0c;if(_0xe6307a[_0xad4a('0x41')]['includeAll']){_0x5c8617['include']=[{'all':!![]}];}return db['Disposition'][_0xad4a('0x54')](_0x5c8617);})[_0xad4a('0x22')](function(_0x453c18){_0x3c1d89[_0xad4a('0x55')]=_0x453c18;return _0x3c1d89;});}})[_0xad4a('0x22')](respondWithFilteredResult(_0x489847,_0x5c8617))[_0xad4a('0x29')](handleError(_0x489847,null));};exports['removeDispositions']=function(_0x1b5021,_0x1a6dd5,_0x32f122){return db[_0xad4a('0x3d')][_0xad4a('0x59')]({'where':{'id':_0x1b5021['params']['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x1a6dd5,null))['then'](function(_0x386abd){if(_0x386abd){return _0x386abd[_0xad4a('0x68')](_0x1b5021[_0xad4a('0x41')][_0xad4a('0x69')]);}})['then'](respondWithStatusCode(_0x1a6dd5,null))['catch'](handleError(_0x1a6dd5,null));};exports['addAnswer']=function(_0xef786d,_0x33eaca,_0x516211){if(_0xef786d[_0xad4a('0x5b')]['id']){delete _0xef786d[_0xad4a('0x5b')]['id'];}return db[_0xad4a('0x3d')]['find']({'where':{'id':_0xef786d[_0xad4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x33eaca,null))['then'](function(_0x3eec15){if(_0x3eec15){_0xef786d[_0xad4a('0x5b')][_0xad4a('0x65')]=_0x3eec15['id'];return db[_0xad4a('0x6a')][_0xad4a('0x5a')](_0xef786d[_0xad4a('0x5b')]);}})[_0xad4a('0x22')](respondWithResult(_0x33eaca,null))[_0xad4a('0x29')](handleError(_0x33eaca,null));};exports[_0xad4a('0x6b')]=function(_0x3e4321,_0x581fa1,_0xe20018){var _0x3c16f2={'raw':![],'where':{}};var _0xce4bf9={};var _0x3fd23c={'count':0x0,'rows':[]};return db[_0xad4a('0x3d')][_0xad4a('0x67')]({'where':{'id':_0x3e4321[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x581fa1,null))[_0xad4a('0x22')](function(_0x248abc){if(_0x248abc){_0xce4bf9['model']=_[_0xad4a('0x42')](db['CannedAnswer'][_0xad4a('0x3e')]);_0xce4bf9[_0xad4a('0x41')]=_[_0xad4a('0x42')](_0x3e4321[_0xad4a('0x41')]);_0xce4bf9[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0xce4bf9[_0xad4a('0x40')],_0xce4bf9[_0xad4a('0x41')]);_0x3c16f2[_0xad4a('0x45')]=_[_0xad4a('0x44')](_0xce4bf9[_0xad4a('0x40')],qs[_0xad4a('0x46')](_0x3e4321[_0xad4a('0x41')][_0xad4a('0x46')]));_0x3c16f2[_0xad4a('0x45')]=_0x3c16f2[_0xad4a('0x45')][_0xad4a('0x47')]?_0x3c16f2[_0xad4a('0x45')]:_0xce4bf9[_0xad4a('0x40')];if(!_0x3e4321[_0xad4a('0x41')]['hasOwnProperty']('nolimit')){_0x3c16f2[_0xad4a('0x2e')]=qs['limit'](_0x3e4321[_0xad4a('0x41')][_0xad4a('0x2e')]);_0x3c16f2['offset']=qs[_0xad4a('0x30')](_0x3e4321[_0xad4a('0x41')][_0xad4a('0x30')]);}_0x3c16f2[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0x3e4321[_0xad4a('0x41')]['sort']);_0x3c16f2['where']=qs[_0xad4a('0x43')](_[_0xad4a('0x4d')](_0x3e4321['query'],_0xce4bf9['filters']));_0x3c16f2[_0xad4a('0x4c')]['FaxAccountId']=_0x248abc['id'];if(_0x3e4321[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x3c16f2['where']=_[_0xad4a('0x4f')](_0x3c16f2[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x3c16f2['attributes'],function(_0x2705c2){var _0x4c335c={};_0x4c335c[_0x2705c2]={'$like':'%'+_0x3e4321[_0xad4a('0x41')][_0xad4a('0x4e')]+'%'};return _0x4c335c;})});}_0x3c16f2=_['merge']({},_0x3c16f2,_0x3e4321[_0xad4a('0x52')]);return db[_0xad4a('0x6a')][_0xad4a('0x2f')]({'where':_0x3c16f2[_0xad4a('0x4c')]})[_0xad4a('0x22')](function(_0x174d04){_0x3fd23c[_0xad4a('0x2f')]=_0x174d04;if(_0x3e4321[_0xad4a('0x41')]['includeAll']){_0x3c16f2[_0xad4a('0x58')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x3c16f2);})[_0xad4a('0x22')](function(_0x5d0ea3){_0x3fd23c[_0xad4a('0x55')]=_0x5d0ea3;return _0x3fd23c;});}})[_0xad4a('0x22')](respondWithFilteredResult(_0x581fa1,_0x3c16f2))[_0xad4a('0x29')](handleError(_0x581fa1,null));};exports[_0xad4a('0x6c')]=function(_0x34a756,_0x319edc,_0x3ebb2a){return db[_0xad4a('0x3d')][_0xad4a('0x59')]({'where':{'id':_0x34a756[_0xad4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x319edc,null))['then'](function(_0x4078b5){if(_0x4078b5){return _0x4078b5[_0xad4a('0x6c')](_0x34a756[_0xad4a('0x41')][_0xad4a('0x69')]);}})[_0xad4a('0x22')](respondWithStatusCode(_0x319edc,null))[_0xad4a('0x29')](handleError(_0x319edc,null));};exports[_0xad4a('0x6d')]=function(_0x54f1b7,_0x83ee42,_0x1e2c49){return db[_0xad4a('0x6e')][_0xad4a('0x59')]({'where':{'id':_0x54f1b7[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x83ee42,null))[_0xad4a('0x22')](function(_0x45347f){if(_0x45347f){return _0x45347f[_0xad4a('0x6d')](_0x54f1b7[_0xad4a('0x5b')][_0xad4a('0x69')],_[_0xad4a('0x6f')](_0x54f1b7['body'],[_0xad4a('0x69'),'id'])||{});}})[_0xad4a('0x22')](respondWithResult(_0x83ee42,null))[_0xad4a('0x29')](handleError(_0x83ee42,null));};exports[_0xad4a('0x70')]=function(_0x5d04ca,_0x5f2fd6,_0x19deb2){var _0x551217={'raw':![],'where':{}};var _0x4a0606={};var _0x1a6224={'count':0x0,'rows':[]};return db['FaxAccount'][_0xad4a('0x67')]({'where':{'id':_0x5d04ca[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x5f2fd6,null))['then'](function(_0x8e511c){if(_0x8e511c){_0x4a0606[_0xad4a('0x40')]=_[_0xad4a('0x42')](db[_0xad4a('0x6e')][_0xad4a('0x3e')]);_0x4a0606['query']=_[_0xad4a('0x42')](_0x5d04ca[_0xad4a('0x41')]);_0x4a0606[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0x4a0606[_0xad4a('0x40')],_0x4a0606[_0xad4a('0x41')]);_0x551217[_0xad4a('0x45')]=_['intersection'](_0x4a0606[_0xad4a('0x40')],qs[_0xad4a('0x46')](_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x46')]));_0x551217[_0xad4a('0x45')]=_0x551217[_0xad4a('0x45')][_0xad4a('0x47')]?_0x551217['attributes']:_0x4a0606[_0xad4a('0x40')];if(!_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x48')](_0xad4a('0x49'))){_0x551217[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x2e')]);_0x551217['offset']=qs[_0xad4a('0x30')](_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x30')]);}_0x551217[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x4b')]);_0x551217[_0xad4a('0x4c')]=qs[_0xad4a('0x43')](_['pick'](_0x5d04ca[_0xad4a('0x41')],_0x4a0606[_0xad4a('0x43')]));_0x551217['where'][_0xad4a('0x65')]=_0x8e511c['id'];if(_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x551217[_0xad4a('0x4c')]=_[_0xad4a('0x4f')](_0x551217[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x551217[_0xad4a('0x45')],function(_0x27dc89){var _0x233225={};_0x233225[_0x27dc89]={'$like':'%'+_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x4e')]+'%'};return _0x233225;})});}_0x551217=_['merge']({},_0x551217,_0x5d04ca[_0xad4a('0x52')]);return db[_0xad4a('0x6e')]['count']({'where':_0x551217[_0xad4a('0x4c')]})[_0xad4a('0x22')](function(_0x32f44b){_0x1a6224[_0xad4a('0x2f')]=_0x32f44b;if(_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x53')]){_0x551217[_0xad4a('0x58')]=[{'model':db[_0xad4a('0x71')],'as':_0xad4a('0x72'),'required':![]},{'model':db[_0xad4a('0x73')],'as':'Owner','attributes':['name','fullname',_0xad4a('0x74')],'required':![]},{'model':db[_0xad4a('0x75')],'as':_0xad4a('0x76'),'attributes':['id',_0xad4a('0x38'),_0xad4a('0x77')],'where':_0x5d04ca[_0xad4a('0x41')][_0xad4a('0x78')]?{'id':_0x5d04ca['query'][_0xad4a('0x78')]}:undefined,'required':_0x5d04ca['query']['tag']?!![]:![]}];}return db[_0xad4a('0x6e')][_0xad4a('0x54')](_0x551217);})[_0xad4a('0x22')](function(_0x348d7c){_0x1a6224['rows']=_0x348d7c;return _0x1a6224;});}})['then'](respondWithFilteredResult(_0x5f2fd6,_0x551217))['catch'](handleError(_0x5f2fd6,null));};exports[_0xad4a('0x79')]=function(_0x3b6905,_0x20099e){var _0x53ca2a=_0x3b6905[_0xad4a('0x56')]['id'];var _0x1e46ae=_0x3b6905[_0xad4a('0x5b')];var _0x45ffbf=0xc8;var _0x1ee87c=null;return db['sequelize'][_0xad4a('0x7a')]({'isolationLevel':db[_0xad4a('0x7b')][_0xad4a('0x7c')][_0xad4a('0x7d')][_0xad4a('0x7e')]},function(_0x4a11f9){return db['FaxAccount']['findOne']({'where':{'id':_0x53ca2a},'transaction':_0x4a11f9})[_0xad4a('0x22')](function(_0x463f21){if(_0x463f21){return db[_0xad4a('0x7f')]['destroy']({'where':{'FaxAccountId':_0x53ca2a},'transaction':_0x4a11f9})[_0xad4a('0x22')](function(){var _0x2cc395=_['map'](_0x1e46ae,function(_0x127ae5){_0x127ae5[_0xad4a('0x65')]=_0x53ca2a;return _0x127ae5;});return db[_0xad4a('0x7f')][_0xad4a('0x80')](_0x2cc395,{'transaction':_0x4a11f9});});}else{_0x45ffbf=0x194;_0x1ee87c=[];}});})[_0xad4a('0x22')](function(){if(_0x45ffbf!==0x194){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x53ca2a},'order':_0xad4a('0x81')})[_0xad4a('0x22')](function(_0x37930e){_0x1ee87c=_0x37930e;});}})[_0xad4a('0x29')](function(_0x1234fd){_0x45ffbf=0x1f4;logger[_0xad4a('0x26')](_0x1234fd[_0xad4a('0x37')]);if(_0x1234fd[_0xad4a('0x38')]){delete _0x1234fd[_0xad4a('0x38')];}_0x1ee87c=_0x1234fd;})[_0xad4a('0x82')](function(){if(_0x1ee87c===null){_0x20099e[_0xad4a('0x2a')](_0x45ffbf);}else{if(_0x45ffbf===0x1f4){_0x20099e['status'](_0x45ffbf)[_0xad4a('0x39')](_0x1ee87c);}else{_0x20099e[_0xad4a('0x2b')](_0x45ffbf)[_0xad4a('0x83')](_0x1ee87c);}}});};exports['getApplications']=function(_0x430190,_0x2be1c6,_0x3c67bf){var _0x38db10={};var _0x5e92fc={};var _0x4590e5;var _0x3160bc;return db[_0xad4a('0x3d')]['findOne']({'where':{'id':_0x430190[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x2be1c6,null))[_0xad4a('0x22')](function(_0x218256){if(_0x218256){_0x4590e5=_0x218256;_0x5e92fc[_0xad4a('0x40')]=_[_0xad4a('0x42')](db[_0xad4a('0x7f')][_0xad4a('0x3e')]);_0x5e92fc[_0xad4a('0x41')]=_[_0xad4a('0x42')](_0x430190[_0xad4a('0x41')]);_0x5e92fc[_0xad4a('0x43')]=_['intersection'](_0x5e92fc[_0xad4a('0x40')],_0x5e92fc[_0xad4a('0x41')]);_0x38db10['attributes']=_[_0xad4a('0x44')](_0x5e92fc['model'],qs[_0xad4a('0x46')](_0x430190['query']['fields']));_0x38db10[_0xad4a('0x45')]=_0x38db10['attributes'][_0xad4a('0x47')]?_0x38db10[_0xad4a('0x45')]:_0x5e92fc['model'];_0x38db10[_0xad4a('0x4a')]=qs['sort'](_0x430190['query'][_0xad4a('0x4b')]);_0x38db10[_0xad4a('0x4c')]=qs['filters'](_[_0xad4a('0x4d')](_0x430190[_0xad4a('0x41')],_0x5e92fc[_0xad4a('0x43')]));if(_0x430190[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x38db10[_0xad4a('0x4c')]=_[_0xad4a('0x4f')](_0x38db10[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x38db10['attributes'],function(_0xcf66de){var _0x5a09d9={};_0x5a09d9[_0xcf66de]={'$like':'%'+_0x430190[_0xad4a('0x41')]['filter']+'%'};return _0x5a09d9;})});}_0x38db10=_['merge']({},_0x38db10,_0x430190['options']);return _0x4590e5['getApplications'](_0x38db10);}})[_0xad4a('0x22')](function(_0x3878df){if(_0x3878df){_0x3160bc=_0x3878df[_0xad4a('0x47')];if(!_0x430190['query'][_0xad4a('0x48')](_0xad4a('0x49'))){_0x38db10[_0xad4a('0x2e')]=qs['limit'](_0x430190[_0xad4a('0x41')]['limit']);_0x38db10[_0xad4a('0x30')]=qs[_0xad4a('0x30')](_0x430190['query']['offset']);}return _0x4590e5[_0xad4a('0x84')](_0x38db10);}})[_0xad4a('0x22')](function(_0x1cb0fb){if(_0x1cb0fb){return _0x1cb0fb?{'count':_0x3160bc,'rows':_0x1cb0fb}:null;}})[_0xad4a('0x22')](respondWithResult(_0x2be1c6,null))[_0xad4a('0x29')](handleError(_0x2be1c6,null));};function Extension(_0x2a46f4,_0x545fef,_0x5994ad,_0x437f12){this['context']=_0xad4a('0x85');this[_0xad4a('0x86')]=_0x2a46f4[_0xad4a('0x87')];this[_0xad4a('0x88')]=_0x437f12;this['type']=_0xad4a('0x89');this[_0xad4a('0x8a')]=_0xad4a('0x8b');this[_0xad4a('0x65')]=_0x2a46f4['id'];this[_0xad4a('0x81')]=_0x545fef;this['appdata']=_0x5994ad;}function createExtensionsReciveFax(_0x520f10){var _0x1dcdf4=0x1;var _0x31b927=[];_0x31b927[_0xad4a('0x8c')](new Extension(_0x520f10,_0x1dcdf4,'',_0xad4a('0x8d')));_0x1dcdf4+=0x1;_0x31b927['push'](new Extension(_0x520f10,_0x1dcdf4,_0xad4a('0x8e'),'Set'));_0x1dcdf4+=0x1;for(var _0x18de91 in _0x520f10){if(_0x520f10[_0xad4a('0x48')](_0x18de91)&&(_0x18de91===_0xad4a('0x8f')||_0x18de91===_0xad4a('0x87')||_0x18de91==='gateway'||_0x18de91===_0xad4a('0x90')||_0x18de91===_0xad4a('0x91')||_0x18de91===_0xad4a('0x92')||_0x18de91===_0xad4a('0x93')||_0x18de91===_0xad4a('0x94')||_0x18de91===_0xad4a('0x95'))){_0x31b927['push'](new Extension(_0x520f10,_0x1dcdf4,'FAXOPT('+_0x18de91+')='+_0x520f10[_0x18de91],'Set'));_0x1dcdf4+=0x1;}}_0x31b927['push'](new Extension(_0x520f10,_0x1dcdf4,'6',_0xad4a('0x96')));_0x1dcdf4+=0x1;_0x31b927[_0xad4a('0x8c')](new Extension(_0x520f10,_0x1dcdf4,_0xad4a('0x97'),'ReceiveFax'));_0x1dcdf4=0x0;return _0x31b927;}exports[_0xad4a('0x98')]=function(_0x38e716,_0x19c3e7,_0x23b588){var _0x13eea3;return db[_0xad4a('0x7b')]['transaction'](function(_0x50d1be){return db[_0xad4a('0x3d')]['create'](_0x38e716[_0xad4a('0x5b')],{'transaction':_0x50d1be})[_0xad4a('0x22')](function(_0x2982ed){_0x13eea3=_0x2982ed['get']({'plain':!![]});return db[_0xad4a('0x99')][_0xad4a('0x80')](createExtensionsReciveFax(_0x13eea3),{'transaction':_0x50d1be});});})[_0xad4a('0x22')](function(){return _0x13eea3;})[_0xad4a('0x22')](respondWithResult(_0x19c3e7,null))['catch'](handleError(_0x19c3e7,null));};exports[_0xad4a('0x9a')]=function(_0x36c359,_0x3c9145,_0x1ca6e2){var _0x3bd6e0;return db['sequelize'][_0xad4a('0x7a')](function(_0x3523ae){return db[_0xad4a('0x3d')][_0xad4a('0x33')](_0x36c359[_0xad4a('0x5b')],{'where':{'id':_0x36c359['body']['id']},'transaction':_0x3523ae})['then'](function(_0x5e836f){return db['VoiceExtension'][_0xad4a('0x34')]({'where':{'FaxAccountId':_0x36c359['body']['id']},'transaction':_0x3523ae})['then'](function(_0x1a2818){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0xad4a('0x6f')](_0x36c359['body'],['tech',_0xad4a('0x9b'),_0xad4a('0x9c'),_0xad4a('0x9d'),_0xad4a('0x9e'),_0xad4a('0x9f')])),{'transaction':_0x3523ae});});});})[_0xad4a('0x22')](function(){return db['FaxAccount'][_0xad4a('0xa0')](_0x36c359[_0xad4a('0x5b')]['id']);})['then'](respondWithResult(_0x3c9145,null))[_0xad4a('0x29')](handleError(_0x3c9145,null));};exports[_0xad4a('0xa1')]=function(_0x329953,_0x4c3952,_0x28fadb){var _0x21984f={'raw':!![],'where':{}};var _0x55aa18={};var _0x648006={'count':0x0,'rows':[]};return db[_0xad4a('0x3d')][_0xad4a('0x67')]({'where':{'id':_0x329953[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x4c3952,null))[_0xad4a('0x22')](function(_0x3f3280){if(_0x3f3280){_0x55aa18[_0xad4a('0x40')]=_[_0xad4a('0x42')](db['FaxMessage'][_0xad4a('0x3e')]);_0x55aa18['query']=_[_0xad4a('0x42')](_0x329953[_0xad4a('0x41')]);_0x55aa18[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0x55aa18[_0xad4a('0x40')],_0x55aa18[_0xad4a('0x41')]);_0x21984f[_0xad4a('0x45')]=_['intersection'](_0x55aa18[_0xad4a('0x40')],qs[_0xad4a('0x46')](_0x329953['query'][_0xad4a('0x46')]));_0x21984f[_0xad4a('0x45')]=_0x21984f['attributes'][_0xad4a('0x47')]?_0x21984f['attributes']:_0x55aa18['model'];if(!_0x329953[_0xad4a('0x41')][_0xad4a('0x48')](_0xad4a('0x49'))){_0x21984f[_0xad4a('0x2e')]=qs['limit'](_0x329953[_0xad4a('0x41')][_0xad4a('0x2e')]);_0x21984f[_0xad4a('0x30')]=qs[_0xad4a('0x30')](_0x329953[_0xad4a('0x41')][_0xad4a('0x30')]);}_0x21984f[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0x329953[_0xad4a('0x41')]['sort']);_0x21984f[_0xad4a('0x4c')]=qs['filters'](_['pick'](_0x329953[_0xad4a('0x41')],_0x55aa18[_0xad4a('0x43')]));_0x21984f[_0xad4a('0x4c')]['FaxAccountId']=_0x3f3280['id'];if(_0x329953[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x21984f['where']=_[_0xad4a('0x4f')](_0x21984f[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x21984f['attributes'],function(_0x1b999d){var _0x1748e7={};_0x1748e7[_0x1b999d]={'$like':'%'+_0x329953[_0xad4a('0x41')]['filter']+'%'};return _0x1748e7;})});}if(_0x329953['query'][_0xad4a('0xa2')]){var _0x147e1e=_0x329953[_0xad4a('0x41')][_0xad4a('0xa2')][_0xad4a('0xa3')](',');var _0x59f975={};_0x59f975[_0x147e1e[0x0]]={'$gte':moment(_0x147e1e[0x1])['format'](_0xad4a('0xa4'))};_0x21984f['where']=_[_0xad4a('0x4f')](_0x21984f[_0xad4a('0x4c')],_0x59f975);}_0x21984f=_[_0xad4a('0x4f')]({},_0x21984f,_0x329953[_0xad4a('0x52')]);return db[_0xad4a('0xa5')]['count']({'where':_0x21984f[_0xad4a('0x4c')]})['then'](function(_0x437f83){_0x648006[_0xad4a('0x2f')]=_0x437f83;if(_0x329953[_0xad4a('0x41')][_0xad4a('0x53')]){_0x21984f['include']=[{'all':!![]}];}return db['FaxMessage'][_0xad4a('0x54')](_0x21984f);})[_0xad4a('0x22')](function(_0x3a75d2){_0x648006[_0xad4a('0x55')]=_0x3a75d2;return _0x648006;});}})[_0xad4a('0x22')](respondWithFilteredResult(_0x4c3952,_0x21984f))[_0xad4a('0x29')](handleError(_0x4c3952,null));};exports[_0xad4a('0x39')]=function(_0x487615,_0x384e8c,_0x25e15f){var _0x564eb4,_0x49b4b0={},_0x2d1aa3;if(_0x487615[_0xad4a('0x5b')]['to']){_0x2d1aa3=_0x487615[_0xad4a('0x5b')]['to'][0x0];}return db[_0xad4a('0x3d')][_0xad4a('0x59')]({'where':{'id':_0x487615['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xad4a('0x71')],'as':_0xad4a('0xa6'),'where':{'fax':_0x2d1aa3},'limit':0x1,'order':[['updatedAt',_0xad4a('0xa7')]]}]}]})[_0xad4a('0x22')](handleEntityNotFound(_0x384e8c,null))['then'](function(_0x2303ba){_0x564eb4=_0x2303ba;if(_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')]&&_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][_0xad4a('0x47')]){for(var _0x5e1045=0x0;_0x5e1045<_0x487615[_0xad4a('0x5b')]['attachments']['length'];_0x5e1045+=0x1){_0x487615['body'][_0xad4a('0xa8')][_0x5e1045]={'filename':_0x487615[_0xad4a('0x5b')]['attachments'][_0x5e1045][_0xad4a('0x38')],'id':_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][_0x5e1045]['id'],'path':path[_0xad4a('0xa9')](config[_0xad4a('0xaa')],'server/files/attachments',_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][_0x5e1045][_0xad4a('0xab')])};}}return respondWithRpcPromise(_0xad4a('0xac'),_0xad4a('0xac'),{'FaxAccountId':_[_0xad4a('0xad')](_0x487615['params']['id'])?undefined:_0x487615['params']['id'],'path':_[_0xad4a('0xad')](_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0]['path'])?undefined:_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0][_0xad4a('0x6')],'fax':_[_0xad4a('0xad')](_0x487615[_0xad4a('0x5b')]['to'][0x0])?undefined:_0x487615[_0xad4a('0x5b')]['to'][0x0]},client9002);})['then'](function(){if(_0x564eb4){if(_[_0xad4a('0xad')](_0x487615['body'][_0xad4a('0xae')])){_0x487615[_0xad4a('0x5b')]['from']=util[_0xad4a('0xaf')](_0xad4a('0xb0'),_0x564eb4[_0xad4a('0x38')],_0x564eb4[_0xad4a('0xb1')]);}if(_0x564eb4['List']){if(_0x564eb4['List'][_0xad4a('0xa6')][_0xad4a('0x47')]){return _0x564eb4[_0xad4a('0xb2')][_0xad4a('0xa6')][0x0];}else{return db['CmContact'][_0xad4a('0x5a')](_[_0xad4a('0xb3')](_0x487615[_0xad4a('0x5b')],{'firstName':_0x487615[_0xad4a('0x5b')]['to'][0x0],'phone':_0x487615['body']['to'][0x0],'fax':_0x487615[_0xad4a('0x5b')]['to'][0x0],'ListId':_0x564eb4[_0xad4a('0x9f')]}));}}else{throw new Error(_0xad4a('0xb4'));}}else{throw new Error(_0xad4a('0xb5'));}})[_0xad4a('0x22')](function(_0x4f82a0){if(_0x4f82a0){return db[_0xad4a('0x6e')][_0xad4a('0x59')]({'where':{'ContactId':_0x4f82a0['id'],'closed':![],'FaxAccountId':_0x564eb4['id']}})[_0xad4a('0x22')](function(_0x397bf1){if(_0x397bf1){return[_0x397bf1,![]];}return db[_0xad4a('0x6e')][_0xad4a('0x5a')]({'UserId':_0x487615[_0xad4a('0x5e')]['id'],'ContactId':_0x4f82a0['id'],'FaxAccountId':_0x564eb4['id'],'fax':_0x487615['body']['to'][0x0],'firstMsgDirection':_0xad4a('0xb6'),'Messages':[_[_0xad4a('0x4f')](_0x487615[_0xad4a('0x5b')],{'read':![],'body':_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0][_0xad4a('0xb7')],'FaxAccountId':_0x564eb4['id'],'UserId':_0x487615['user']['id'],'ContactId':_0x4f82a0['id'],'AttachmentId':_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0xad4a('0xa5')],'as':_0xad4a('0xb8')}]})['then'](function(_0x572589){return[_0x572589,!![]];});});}else{throw new Error(_0xad4a('0xb9'));}})[_0xad4a('0xba')](function(_0x17beca,_0x334f19){if(_0x334f19){return _0x17beca;}return db[_0xad4a('0xa5')]['create']({'direction':_0xad4a('0xb6'),'read':![],'body':_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0][_0xad4a('0xb7')],'FaxAccountId':_0x564eb4['id'],'FaxInteractionId':_0x17beca['id'],'UserId':_0x487615[_0xad4a('0x5e')]['id'],'ContactId':_0x17beca[_0xad4a('0xbb')],'AttachmentId':_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0]['id']})['then'](function(_0x4b3e50){_0x17beca['dataValues'][_0xad4a('0xb8')]=[];_0x17beca[_0xad4a('0xbc')][_0xad4a('0xb8')][_0xad4a('0x8c')](_0x4b3e50[_0xad4a('0xbc')]);return _0x17beca;});})[_0xad4a('0x22')](function(_0x4686df){respondWithRpcPromise(_0xad4a('0xbd'),'SendFax',{'FaxAccountId':_[_0xad4a('0xad')](_0x487615[_0xad4a('0x56')]['id'])?undefined:_0x487615[_0xad4a('0x56')]['id'],'path':_[_0xad4a('0xad')](_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0]['path'])?undefined:_0x487615[_0xad4a('0x5b')][_0xad4a('0xa8')][0x0][_0xad4a('0x6')],'fax':_[_0xad4a('0xad')](_0x487615['body']['to'][0x0])?undefined:_0x487615[_0xad4a('0x5b')]['to'][0x0],'AttachmentId':_0x487615[_0xad4a('0x5b')]['attachments'][0x0]['id']},client9002)['then'](function(_0xd17d1e){logger[_0xad4a('0x23')](_0xad4a('0xbe'),_0xd17d1e);})['catch'](function(_0x2e350d){logger['info'](_0xad4a('0xbe'),_0x2e350d);});return _0x4686df;})['then'](respondWithResult(_0x384e8c,null))[_0xad4a('0x29')](handleError(_0x384e8c,null));};exports[_0xad4a('0xbf')]=function(_0x52d162,_0x49994b,_0x2874ce){return db[_0xad4a('0x3d')][_0xad4a('0x59')]({'where':{'id':_0x52d162[_0xad4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x49994b,null))[_0xad4a('0x22')](function(_0x18fc22){if(_0x18fc22){return _0x18fc22[_0xad4a('0xbf')](_0x52d162[_0xad4a('0x5b')][_0xad4a('0x69')],_['omit'](_0x52d162[_0xad4a('0x5b')],[_0xad4a('0x69'),'id'])||{})[_0xad4a('0xba')](function(_0x417702){for(var _0x520a98=0x0;_0x520a98<_0x52d162['body']['ids'][_0xad4a('0x47')];_0x520a98+=0x1){socket[_0xad4a('0xc0')]('userFaxAccount:save',{'UserId':Number(_0x52d162[_0xad4a('0x5b')][_0xad4a('0x69')][_0x520a98]),'FaxAccountId':Number(_0x52d162[_0xad4a('0x56')]['id'])});}return _0x417702;});}})[_0xad4a('0x22')](respondWithResult(_0x49994b,null))['catch'](handleError(_0x49994b,null));};exports[_0xad4a('0xc1')]=function(_0x5f145d,_0x571d33,_0x1d0abf){return db['FaxAccount']['find']({'where':{'id':_0x5f145d[_0xad4a('0x56')]['id']}})['then'](handleEntityNotFound(_0x571d33,null))[_0xad4a('0x22')](function(_0x863009){if(_0x863009){return _0x863009[_0xad4a('0xc1')](_0x5f145d[_0xad4a('0x41')][_0xad4a('0x69')])[_0xad4a('0x22')](function(){if(_['isArray'](_0x5f145d[_0xad4a('0x41')][_0xad4a('0x69')])){for(var _0x1828e3=0x0;_0x1828e3<_0x5f145d[_0xad4a('0x41')]['ids'][_0xad4a('0x47')];_0x1828e3+=0x1){socket[_0xad4a('0xc0')](_0xad4a('0xc2'),{'UserId':Number(_0x5f145d[_0xad4a('0x41')][_0xad4a('0x69')][_0x1828e3]),'FaxAccountId':Number(_0x5f145d[_0xad4a('0x56')]['id'])});}}else{socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x5f145d[_0xad4a('0x41')][_0xad4a('0x69')]),'FaxAccountId':Number(_0x5f145d[_0xad4a('0x56')]['id'])});}});}})[_0xad4a('0x22')](respondWithStatusCode(_0x571d33,null))['catch'](handleError(_0x571d33,null));};exports['getAgents']=function(_0xa0be3b,_0x116f2c,_0x31a03d){var _0x47fa86={};var _0x388fe2={};var _0x408ea9;var _0x58cb5c;return db[_0xad4a('0x3d')][_0xad4a('0x67')]({'where':{'id':_0xa0be3b[_0xad4a('0x56')]['id']}})[_0xad4a('0x22')](handleEntityNotFound(_0x116f2c,null))[_0xad4a('0x22')](function(_0x49aa5c){if(_0x49aa5c){_0x408ea9=_0x49aa5c;_0x388fe2[_0xad4a('0x40')]=_[_0xad4a('0x42')](db[_0xad4a('0x73')][_0xad4a('0x3e')]);_0x388fe2['query']=_['keys'](_0xa0be3b[_0xad4a('0x41')]);_0x388fe2[_0xad4a('0x43')]=_[_0xad4a('0x44')](_0x388fe2['model'],_0x388fe2[_0xad4a('0x41')]);_0x47fa86['attributes']=_[_0xad4a('0x44')](_0x388fe2['model'],qs[_0xad4a('0x46')](_0xa0be3b[_0xad4a('0x41')][_0xad4a('0x46')]));_0x47fa86['attributes']=_0x47fa86[_0xad4a('0x45')][_0xad4a('0x47')]?_0x47fa86['attributes']:_0x388fe2[_0xad4a('0x40')];_0x47fa86[_0xad4a('0x4a')]=qs[_0xad4a('0x4b')](_0xa0be3b[_0xad4a('0x41')]['sort']);_0x47fa86[_0xad4a('0x4c')]=qs[_0xad4a('0x43')](_['pick'](_0xa0be3b[_0xad4a('0x41')],_0x388fe2[_0xad4a('0x43')]));if(_0xa0be3b[_0xad4a('0x41')][_0xad4a('0x4e')]){_0x47fa86[_0xad4a('0x4c')]=_[_0xad4a('0x4f')](_0x47fa86[_0xad4a('0x4c')],{'$or':_[_0xad4a('0x3c')](_0x47fa86[_0xad4a('0x45')],function(_0x127f67){var _0x4bb5cd={};_0x4bb5cd[_0x127f67]={'$like':'%'+_0xa0be3b['query'][_0xad4a('0x4e')]+'%'};return _0x4bb5cd;})});}_0x47fa86=_[_0xad4a('0x4f')]({},_0x47fa86,_0xa0be3b['options']);return _0x408ea9[_0xad4a('0xc3')](_0x47fa86);}})[_0xad4a('0x22')](function(_0x33bb9f){if(_0x33bb9f){_0x58cb5c=_0x33bb9f['length'];if(!_0xa0be3b['query'][_0xad4a('0x48')]('nolimit')){_0x47fa86[_0xad4a('0x2e')]=qs[_0xad4a('0x2e')](_0xa0be3b[_0xad4a('0x41')][_0xad4a('0x2e')]);_0x47fa86[_0xad4a('0x30')]=qs[_0xad4a('0x30')](_0xa0be3b[_0xad4a('0x41')][_0xad4a('0x30')]);}return _0x408ea9[_0xad4a('0xc3')](_0x47fa86);}})[_0xad4a('0x22')](function(_0x5a24e7){if(_0x5a24e7){return _0x5a24e7?{'count':_0x58cb5c,'rows':_0x5a24e7}:null;}})[_0xad4a('0x22')](respondWithResult(_0x116f2c,null))[_0xad4a('0x29')](handleError(_0x116f2c,null));};
\ No newline at end of file
+var _0x3e55=['internal','Tag','Tags','tag','addApplications','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','exten','app','system','description','appdata','push','Answer','Set','localstationid','gateway','headerinfo','maxrate','minrate','modem','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','VoiceExtension','transaction','omit','tech','TrunkId','ListId','findById','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','updatedAt','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','defaults','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','FaxAccounts','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','include','findAll','show','params','keys','length','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','Disposition','getDispositions','FaxAccountId','filter','includeAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','FaxInteraction','addInteraction','getInteractions','CmContact','Contact','User','Owner'];(function(_0x315add,_0x5e9ace){var _0x40956b=function(_0x5273d2){while(--_0x5273d2){_0x315add['push'](_0x315add['shift']());}};_0x40956b(++_0x5e9ace);}(_0x3e55,0x118));var _0x53e5=function(_0x5923a9,_0x1f6d7c){_0x5923a9=_0x5923a9-0x0;var _0x205c15=_0x3e55[_0x5923a9];return _0x205c15;};'use strict';var emlformat=require(_0x53e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x53e5('0x1'));var jsonpatch=require(_0x53e5('0x2'));var rp=require(_0x53e5('0x3'));var moment=require(_0x53e5('0x4'));var BPromise=require(_0x53e5('0x5'));var Mustache=require(_0x53e5('0x6'));var util=require(_0x53e5('0x7'));var path=require(_0x53e5('0x8'));var sox=require(_0x53e5('0x9'));var csv=require('to-csv');var ejs=require(_0x53e5('0xa'));var fs=require('fs');var fs_extra=require(_0x53e5('0xb'));var _=require(_0x53e5('0xc'));var squel=require(_0x53e5('0xd'));var crypto=require('crypto');var jsforce=require(_0x53e5('0xe'));var deskjs=require(_0x53e5('0xf'));var toCsv=require(_0x53e5('0x10'));var querystring=require(_0x53e5('0x11'));var Papa=require(_0x53e5('0x12'));var Redis=require(_0x53e5('0x13'));var authService=require(_0x53e5('0x14'));var qs=require(_0x53e5('0x15'));var as=require(_0x53e5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53e5('0x17'));var utils=require(_0x53e5('0x18'));var config=require(_0x53e5('0x19'));var licenseUtil=require(_0x53e5('0x1a'));var db=require(_0x53e5('0x1b'))['db'];config[_0x53e5('0x1c')]=_['defaults'](config[_0x53e5('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x53e5('0x1c')]));require(_0x53e5('0x1d'))[_0x53e5('0x1e')](socket);var jayson=require(_0x53e5('0x1f'));var client=jayson[_0x53e5('0x20')][_0x53e5('0x21')]({'port':0x232c});var client9002=jayson[_0x53e5('0x20')][_0x53e5('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x2ec2d7,_0x1a3e83,_0x357785,_0x20fd6a){return new BPromise(function(_0x4031a1,_0x2b0f2d){var _0x2c1adc=_0x20fd6a||client;return _0x2c1adc[_0x53e5('0x22')](_0x2ec2d7,_0x357785)['then'](function(_0x5712b6){logger[_0x53e5('0x23')](_0x53e5('0x24'),_0x1a3e83,'request\x20sent');logger[_0x53e5('0x25')](_0x53e5('0x26'),_0x1a3e83,_0x53e5('0x27'),JSON[_0x53e5('0x28')](_0x5712b6));if(_0x5712b6['error']){if(_0x5712b6[_0x53e5('0x29')][_0x53e5('0x2a')]===0x1f4){logger[_0x53e5('0x29')](_0x53e5('0x24'),_0x1a3e83,_0x5712b6['error'][_0x53e5('0x2b')]);return _0x2b0f2d(_0x5712b6['error'][_0x53e5('0x2b')]);}logger[_0x53e5('0x29')](_0x53e5('0x24'),_0x1a3e83,_0x5712b6[_0x53e5('0x29')][_0x53e5('0x2b')]);return _0x4031a1(_0x5712b6['error'][_0x53e5('0x2b')]);}else{logger[_0x53e5('0x23')]('FaxAccount,\x20%s,\x20%s',_0x1a3e83,_0x53e5('0x27'));_0x4031a1(_0x5712b6['result']['message']);}})[_0x53e5('0x2c')](function(_0x1ffec4){logger['error'](_0x53e5('0x24'),_0x1a3e83,_0x1ffec4);_0x2b0f2d(_0x1ffec4);});});}function respondWithStatusCode(_0x4faf2e,_0x4f8aed){_0x4f8aed=_0x4f8aed||0xcc;return function(_0x267f11){if(_0x267f11){return _0x4faf2e['sendStatus'](_0x4f8aed);}return _0x4faf2e[_0x53e5('0x2d')](_0x4f8aed)[_0x53e5('0x2e')]();};}function respondWithResult(_0x3a3ba6,_0x471ec9){_0x471ec9=_0x471ec9||0xc8;return function(_0x25e1a9){if(_0x25e1a9){return _0x3a3ba6[_0x53e5('0x2d')](_0x471ec9)[_0x53e5('0x2f')](_0x25e1a9);}};}function respondWithFilteredResult(_0x205af6,_0x277af1){return function(_0xcbc04a){if(_0xcbc04a){var _0x1e7bd3=typeof _0x277af1[_0x53e5('0x30')]===_0x53e5('0x31')&&typeof _0x277af1[_0x53e5('0x32')]===_0x53e5('0x31');var _0xc70b8d=_0xcbc04a[_0x53e5('0x33')];var _0x15b764=_0x1e7bd3?0x0:_0x277af1[_0x53e5('0x30')];var _0x2b7bc4=_0x1e7bd3?_0xcbc04a[_0x53e5('0x33')]:_0x277af1['offset']+_0x277af1[_0x53e5('0x32')];var _0x78f76b;if(_0x2b7bc4>=_0xc70b8d){_0x2b7bc4=_0xc70b8d;_0x78f76b=0xc8;}else{_0x78f76b=0xce;}_0x205af6[_0x53e5('0x2d')](_0x78f76b);return _0x205af6[_0x53e5('0x34')](_0x53e5('0x35'),_0x15b764+'-'+_0x2b7bc4+'/'+_0xc70b8d)[_0x53e5('0x2f')](_0xcbc04a);}return null;};}function patchUpdates(_0x45f16b){return function(_0x2e4d07){try{jsonpatch['apply'](_0x2e4d07,_0x45f16b,!![]);}catch(_0x570b21){return BPromise[_0x53e5('0x36')](_0x570b21);}return _0x2e4d07[_0x53e5('0x37')]();};}function saveUpdates(_0x2be6f0,_0x1bc8c1){return function(_0x12b79a){if(_0x12b79a){return _0x12b79a['update'](_0x2be6f0)[_0x53e5('0x38')](function(_0x380998){return _0x380998;});}return null;};}function removeEntity(_0x2ae451,_0x3b9dea){return function(_0x58d5b0){if(_0x58d5b0){return _0x58d5b0['destroy']()[_0x53e5('0x38')](function(){var _0x597c57=_0x58d5b0[_0x53e5('0x39')]({'plain':!![]});var _0x19f7cb=_0x53e5('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x19f7cb,'resourceId':_0x597c57['id']}})[_0x53e5('0x38')](function(){return _0x58d5b0;});})[_0x53e5('0x38')](function(){_0x2ae451[_0x53e5('0x2d')](0xcc)[_0x53e5('0x2e')]();});}};}function handleEntityNotFound(_0x591caf,_0x593861){return function(_0x563d3b){if(!_0x563d3b){_0x591caf[_0x53e5('0x3b')](0x194);}return _0x563d3b;};}function handleError(_0x19ee23,_0x8b1359){_0x8b1359=_0x8b1359||0x1f4;return function(_0x3e36a9){logger[_0x53e5('0x29')](_0x3e36a9[_0x53e5('0x3c')]);if(_0x3e36a9['name']){delete _0x3e36a9[_0x53e5('0x3d')];}_0x19ee23[_0x53e5('0x2d')](_0x8b1359)[_0x53e5('0x3e')](_0x3e36a9);};}exports[_0x53e5('0x3f')]=function(_0x5197df,_0x3f7f01){var _0xa901db={'include':[{'model':db[_0x53e5('0x40')],'as':_0x53e5('0x41')}]},_0x3ce431={},_0x2c0320={'count':0x0,'rows':[]};var _0x52cf5f=_[_0x53e5('0x42')](db[_0x53e5('0x43')][_0x53e5('0x44')],function(_0x455f18){return{'name':_0x455f18['fieldName'],'type':_0x455f18[_0x53e5('0x45')][_0x53e5('0x46')]};});_0x3ce431['model']=_['map'](_0x52cf5f,'name');_0x3ce431[_0x53e5('0x47')]=_['keys'](_0x5197df['query']);_0x3ce431['filters']=_[_0x53e5('0x48')](_0x3ce431[_0x53e5('0x49')],_0x3ce431[_0x53e5('0x47')]);_0xa901db['attributes']=_[_0x53e5('0x48')](_0x3ce431[_0x53e5('0x49')],qs[_0x53e5('0x4a')](_0x5197df[_0x53e5('0x47')]['fields']));_0xa901db[_0x53e5('0x4b')]=_0xa901db[_0x53e5('0x4b')]['length']?_0xa901db[_0x53e5('0x4b')]:_0x3ce431[_0x53e5('0x49')];if(!_0x5197df[_0x53e5('0x47')][_0x53e5('0x4c')](_0x53e5('0x4d'))){_0xa901db[_0x53e5('0x32')]=qs['limit'](_0x5197df[_0x53e5('0x47')]['limit']);_0xa901db[_0x53e5('0x30')]=qs[_0x53e5('0x30')](_0x5197df[_0x53e5('0x47')][_0x53e5('0x30')]);}_0xa901db[_0x53e5('0x4e')]=qs[_0x53e5('0x4f')](_0x5197df[_0x53e5('0x47')][_0x53e5('0x4f')]);_0xa901db['where']=qs[_0x53e5('0x50')](_[_0x53e5('0x51')](_0x5197df['query'],_0x3ce431['filters']),_0x52cf5f);if(_0x5197df[_0x53e5('0x47')]['filter']){_0xa901db[_0x53e5('0x52')]=_[_0x53e5('0x53')](_0xa901db['where'],{'$or':_[_0x53e5('0x42')](_0x52cf5f,function(_0x244672){if(_0x244672[_0x53e5('0x45')]!==_0x53e5('0x54')){var _0x506f16={};_0x506f16[_0x244672[_0x53e5('0x3d')]]={'$like':'%'+_0x5197df['query']['filter']+'%'};return _0x506f16;}})});}_0xa901db=_[_0x53e5('0x53')]({},_0xa901db,_0x5197df[_0x53e5('0x55')]);var _0x30a234={'where':_0xa901db['where']};return db[_0x53e5('0x43')]['count'](_0x30a234)['then'](function(_0x15d323){_0x2c0320[_0x53e5('0x33')]=_0x15d323;if(_0x5197df['query']['includeAll']){_0xa901db[_0x53e5('0x56')]=[{'all':!![]}];}return db['FaxAccount'][_0x53e5('0x57')](_0xa901db);})['then'](function(_0x5a5130){_0x2c0320['rows']=_0x5a5130;return _0x2c0320;})[_0x53e5('0x38')](respondWithFilteredResult(_0x3f7f01,_0xa901db))[_0x53e5('0x2c')](handleError(_0x3f7f01,null));};exports[_0x53e5('0x58')]=function(_0x683a67,_0x5bd0df){var _0x692518={'raw':![],'where':{'id':_0x683a67[_0x53e5('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x53e5('0x41')}]},_0x5eedd8={};_0x5eedd8[_0x53e5('0x49')]=_[_0x53e5('0x5a')](db['FaxAccount'][_0x53e5('0x44')]);_0x5eedd8[_0x53e5('0x47')]=_[_0x53e5('0x5a')](_0x683a67[_0x53e5('0x47')]);_0x5eedd8[_0x53e5('0x50')]=_[_0x53e5('0x48')](_0x5eedd8[_0x53e5('0x49')],_0x5eedd8[_0x53e5('0x47')]);_0x692518[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x5eedd8[_0x53e5('0x49')],qs['fields'](_0x683a67['query'][_0x53e5('0x4a')]));_0x692518[_0x53e5('0x4b')]=_0x692518[_0x53e5('0x4b')][_0x53e5('0x5b')]?_0x692518[_0x53e5('0x4b')]:_0x5eedd8['model'];if(_0x683a67[_0x53e5('0x47')]['includeAll']){_0x692518[_0x53e5('0x56')]=[{'all':!![]}];}_0x692518=_[_0x53e5('0x53')]({},_0x692518,_0x683a67['options']);return db[_0x53e5('0x43')][_0x53e5('0x5c')](_0x692518)[_0x53e5('0x38')](handleEntityNotFound(_0x5bd0df,null))[_0x53e5('0x38')](respondWithResult(_0x5bd0df,null))[_0x53e5('0x2c')](handleError(_0x5bd0df,null));};exports[_0x53e5('0x5d')]=function(_0x121e45,_0x532778){return db[_0x53e5('0x43')]['create'](_0x121e45[_0x53e5('0x5e')],{})['then'](function(_0x4360c4){var _0x2f79ee=_0x121e45['user'][_0x53e5('0x39')]({'plain':!![]});if(!_0x2f79ee)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f79ee[_0x53e5('0x5f')]===_0x53e5('0x60')){var _0x56efbd=_0x4360c4['get']({'plain':!![]});var _0x10b6ca=_0x53e5('0x3a');return db[_0x53e5('0x61')][_0x53e5('0x5c')]({'where':{'name':_0x10b6ca,'userProfileId':_0x2f79ee[_0x53e5('0x62')]},'raw':!![]})[_0x53e5('0x38')](function(_0x27d780){if(_0x27d780&&_0x27d780[_0x53e5('0x63')]===0x0){return db[_0x53e5('0x64')]['create']({'name':_0x56efbd[_0x53e5('0x3d')],'resourceId':_0x56efbd['id'],'type':_0x27d780[_0x53e5('0x3d')],'sectionId':_0x27d780['id']},{})[_0x53e5('0x38')](function(){return _0x4360c4;});}else{return _0x4360c4;}})[_0x53e5('0x2c')](function(_0xf58a41){logger[_0x53e5('0x29')](_0x53e5('0x65'),_0xf58a41);throw _0xf58a41;});}return _0x4360c4;})[_0x53e5('0x38')](respondWithResult(_0x532778,0xc9))['catch'](handleError(_0x532778,null));};exports[_0x53e5('0x66')]=function(_0x1fd28c,_0xe68038){if(_0x1fd28c['body']['id']){delete _0x1fd28c[_0x53e5('0x5e')]['id'];}return db[_0x53e5('0x43')][_0x53e5('0x5c')]({'where':{'id':_0x1fd28c['params']['id']},'include':[{'model':db[_0x53e5('0x40')],'as':_0x53e5('0x41')}]})[_0x53e5('0x38')](handleEntityNotFound(_0xe68038,null))[_0x53e5('0x38')](saveUpdates(_0x1fd28c[_0x53e5('0x5e')],null))['then'](respondWithResult(_0xe68038,null))['catch'](handleError(_0xe68038,null));};exports[_0x53e5('0x67')]=function(_0x37cc2b,_0x521560){return db[_0x53e5('0x43')][_0x53e5('0x5c')]({'where':{'id':_0x37cc2b[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x521560,null))[_0x53e5('0x38')](removeEntity(_0x521560,null))[_0x53e5('0x2c')](handleError(_0x521560,null));};exports[_0x53e5('0x68')]=function(_0x9c2daf,_0x145313){return db[_0x53e5('0x43')]['describe']()['then'](respondWithResult(_0x145313,null))[_0x53e5('0x2c')](handleError(_0x145313,null));};exports[_0x53e5('0x69')]=function(_0x319161,_0x337656,_0xae7630){if(_0x319161[_0x53e5('0x5e')]['id']){delete _0x319161[_0x53e5('0x5e')]['id'];}return db[_0x53e5('0x43')][_0x53e5('0x5c')]({'where':{'id':_0x319161[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x337656,null))['then'](function(_0x173ad2){if(_0x173ad2){_0x319161[_0x53e5('0x5e')]['FaxAccountId']=_0x173ad2['id'];return db[_0x53e5('0x6a')][_0x53e5('0x5d')](_0x319161[_0x53e5('0x5e')]);}})[_0x53e5('0x38')](respondWithResult(_0x337656,null))[_0x53e5('0x2c')](handleError(_0x337656,null));};exports[_0x53e5('0x6b')]=function(_0x4cebe4,_0x273e5a,_0x56282c){var _0x556cdd={'raw':![],'where':{}};var _0x2147bb={};var _0x2cc621={'count':0x0,'rows':[]};return db[_0x53e5('0x43')]['findOne']({'where':{'id':_0x4cebe4['params']['id']}})['then'](handleEntityNotFound(_0x273e5a,null))[_0x53e5('0x38')](function(_0x2725cb){if(_0x2725cb){_0x2147bb[_0x53e5('0x49')]=_['keys'](db[_0x53e5('0x6a')][_0x53e5('0x44')]);_0x2147bb[_0x53e5('0x47')]=_[_0x53e5('0x5a')](_0x4cebe4[_0x53e5('0x47')]);_0x2147bb[_0x53e5('0x50')]=_[_0x53e5('0x48')](_0x2147bb['model'],_0x2147bb[_0x53e5('0x47')]);_0x556cdd[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x2147bb[_0x53e5('0x49')],qs[_0x53e5('0x4a')](_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x4a')]));_0x556cdd[_0x53e5('0x4b')]=_0x556cdd[_0x53e5('0x4b')]['length']?_0x556cdd[_0x53e5('0x4b')]:_0x2147bb[_0x53e5('0x49')];if(!_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x4c')](_0x53e5('0x4d'))){_0x556cdd[_0x53e5('0x32')]=qs[_0x53e5('0x32')](_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x32')]);_0x556cdd['offset']=qs['offset'](_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x30')]);}_0x556cdd[_0x53e5('0x4e')]=qs['sort'](_0x4cebe4['query']['sort']);_0x556cdd[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_[_0x53e5('0x51')](_0x4cebe4['query'],_0x2147bb['filters']));_0x556cdd[_0x53e5('0x52')][_0x53e5('0x6c')]=_0x2725cb['id'];if(_0x4cebe4[_0x53e5('0x47')]['filter']){_0x556cdd[_0x53e5('0x52')]=_[_0x53e5('0x53')](_0x556cdd[_0x53e5('0x52')],{'$or':_['map'](_0x556cdd[_0x53e5('0x4b')],function(_0x5064b9){var _0x9f73fb={};_0x9f73fb[_0x5064b9]={'$like':'%'+_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x6d')]+'%'};return _0x9f73fb;})});}_0x556cdd=_['merge']({},_0x556cdd,_0x4cebe4[_0x53e5('0x55')]);return db[_0x53e5('0x6a')][_0x53e5('0x33')]({'where':_0x556cdd[_0x53e5('0x52')]})['then'](function(_0x16dc49){_0x2cc621[_0x53e5('0x33')]=_0x16dc49;if(_0x4cebe4[_0x53e5('0x47')][_0x53e5('0x6e')]){_0x556cdd[_0x53e5('0x56')]=[{'all':!![]}];}return db[_0x53e5('0x6a')][_0x53e5('0x57')](_0x556cdd);})[_0x53e5('0x38')](function(_0x3628bf){_0x2cc621[_0x53e5('0x6f')]=_0x3628bf;return _0x2cc621;});}})['then'](respondWithFilteredResult(_0x273e5a,_0x556cdd))['catch'](handleError(_0x273e5a,null));};exports[_0x53e5('0x70')]=function(_0x250b79,_0x2ac895,_0x42589a){return db[_0x53e5('0x43')][_0x53e5('0x5c')]({'where':{'id':_0x250b79['params']['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x2ac895,null))['then'](function(_0x2d3a3f){if(_0x2d3a3f){return _0x2d3a3f[_0x53e5('0x70')](_0x250b79['query'][_0x53e5('0x71')]);}})[_0x53e5('0x38')](respondWithStatusCode(_0x2ac895,null))[_0x53e5('0x2c')](handleError(_0x2ac895,null));};exports[_0x53e5('0x72')]=function(_0x37ba68,_0x21c80e,_0x309dd1){if(_0x37ba68[_0x53e5('0x5e')]['id']){delete _0x37ba68[_0x53e5('0x5e')]['id'];}return db[_0x53e5('0x43')]['find']({'where':{'id':_0x37ba68[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x21c80e,null))[_0x53e5('0x38')](function(_0x6e5873){if(_0x6e5873){_0x37ba68[_0x53e5('0x5e')][_0x53e5('0x6c')]=_0x6e5873['id'];return db[_0x53e5('0x73')][_0x53e5('0x5d')](_0x37ba68[_0x53e5('0x5e')]);}})[_0x53e5('0x38')](respondWithResult(_0x21c80e,null))[_0x53e5('0x2c')](handleError(_0x21c80e,null));};exports[_0x53e5('0x74')]=function(_0x468186,_0x2717be,_0x1d69c8){var _0x46bf28={'raw':![],'where':{}};var _0x4de2f8={};var _0x471397={'count':0x0,'rows':[]};return db['FaxAccount'][_0x53e5('0x75')]({'where':{'id':_0x468186['params']['id']}})['then'](handleEntityNotFound(_0x2717be,null))[_0x53e5('0x38')](function(_0x713250){if(_0x713250){_0x4de2f8[_0x53e5('0x49')]=_[_0x53e5('0x5a')](db[_0x53e5('0x73')][_0x53e5('0x44')]);_0x4de2f8['query']=_[_0x53e5('0x5a')](_0x468186[_0x53e5('0x47')]);_0x4de2f8[_0x53e5('0x50')]=_[_0x53e5('0x48')](_0x4de2f8[_0x53e5('0x49')],_0x4de2f8[_0x53e5('0x47')]);_0x46bf28[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x4de2f8['model'],qs[_0x53e5('0x4a')](_0x468186[_0x53e5('0x47')]['fields']));_0x46bf28[_0x53e5('0x4b')]=_0x46bf28['attributes']['length']?_0x46bf28['attributes']:_0x4de2f8[_0x53e5('0x49')];if(!_0x468186['query']['hasOwnProperty'](_0x53e5('0x4d'))){_0x46bf28[_0x53e5('0x32')]=qs[_0x53e5('0x32')](_0x468186[_0x53e5('0x47')][_0x53e5('0x32')]);_0x46bf28[_0x53e5('0x30')]=qs['offset'](_0x468186[_0x53e5('0x47')][_0x53e5('0x30')]);}_0x46bf28['order']=qs[_0x53e5('0x4f')](_0x468186[_0x53e5('0x47')][_0x53e5('0x4f')]);_0x46bf28[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_['pick'](_0x468186[_0x53e5('0x47')],_0x4de2f8[_0x53e5('0x50')]));_0x46bf28['where'][_0x53e5('0x6c')]=_0x713250['id'];if(_0x468186[_0x53e5('0x47')][_0x53e5('0x6d')]){_0x46bf28[_0x53e5('0x52')]=_[_0x53e5('0x53')](_0x46bf28[_0x53e5('0x52')],{'$or':_['map'](_0x46bf28[_0x53e5('0x4b')],function(_0x2c7dae){var _0x1fac55={};_0x1fac55[_0x2c7dae]={'$like':'%'+_0x468186[_0x53e5('0x47')][_0x53e5('0x6d')]+'%'};return _0x1fac55;})});}_0x46bf28=_[_0x53e5('0x53')]({},_0x46bf28,_0x468186[_0x53e5('0x55')]);return db['CannedAnswer'][_0x53e5('0x33')]({'where':_0x46bf28['where']})[_0x53e5('0x38')](function(_0x539269){_0x471397['count']=_0x539269;if(_0x468186[_0x53e5('0x47')][_0x53e5('0x6e')]){_0x46bf28[_0x53e5('0x56')]=[{'all':!![]}];}return db[_0x53e5('0x73')][_0x53e5('0x57')](_0x46bf28);})[_0x53e5('0x38')](function(_0x3eb2fa){_0x471397[_0x53e5('0x6f')]=_0x3eb2fa;return _0x471397;});}})[_0x53e5('0x38')](respondWithFilteredResult(_0x2717be,_0x46bf28))[_0x53e5('0x2c')](handleError(_0x2717be,null));};exports[_0x53e5('0x76')]=function(_0x4097d2,_0x15b029,_0x894ead){return db[_0x53e5('0x43')]['find']({'where':{'id':_0x4097d2[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x15b029,null))['then'](function(_0x39ba94){if(_0x39ba94){return _0x39ba94[_0x53e5('0x76')](_0x4097d2[_0x53e5('0x47')]['ids']);}})[_0x53e5('0x38')](respondWithStatusCode(_0x15b029,null))[_0x53e5('0x2c')](handleError(_0x15b029,null));};exports['addInteraction']=function(_0x2d2d76,_0x3c93fa,_0x577cff){return db[_0x53e5('0x77')][_0x53e5('0x5c')]({'where':{'id':_0x2d2d76[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x3c93fa,null))['then'](function(_0x4aac3d){if(_0x4aac3d){return _0x4aac3d[_0x53e5('0x78')](_0x2d2d76[_0x53e5('0x5e')][_0x53e5('0x71')],_['omit'](_0x2d2d76[_0x53e5('0x5e')],['ids','id'])||{});}})[_0x53e5('0x38')](respondWithResult(_0x3c93fa,null))[_0x53e5('0x2c')](handleError(_0x3c93fa,null));};exports[_0x53e5('0x79')]=function(_0x47a6e8,_0x5a3056,_0x1228f4){var _0x30c5e6={'raw':![],'where':{}};var _0x51c9ad={};var _0x5b0a8f={'count':0x0,'rows':[]};return db[_0x53e5('0x43')][_0x53e5('0x75')]({'where':{'id':_0x47a6e8[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x5a3056,null))[_0x53e5('0x38')](function(_0xcf9ecb){if(_0xcf9ecb){_0x51c9ad[_0x53e5('0x49')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x51c9ad[_0x53e5('0x47')]=_['keys'](_0x47a6e8[_0x53e5('0x47')]);_0x51c9ad['filters']=_[_0x53e5('0x48')](_0x51c9ad[_0x53e5('0x49')],_0x51c9ad['query']);_0x30c5e6[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x51c9ad[_0x53e5('0x49')],qs['fields'](_0x47a6e8['query'][_0x53e5('0x4a')]));_0x30c5e6[_0x53e5('0x4b')]=_0x30c5e6['attributes'][_0x53e5('0x5b')]?_0x30c5e6[_0x53e5('0x4b')]:_0x51c9ad[_0x53e5('0x49')];if(!_0x47a6e8[_0x53e5('0x47')]['hasOwnProperty']('nolimit')){_0x30c5e6[_0x53e5('0x32')]=qs[_0x53e5('0x32')](_0x47a6e8['query'][_0x53e5('0x32')]);_0x30c5e6[_0x53e5('0x30')]=qs[_0x53e5('0x30')](_0x47a6e8[_0x53e5('0x47')]['offset']);}_0x30c5e6[_0x53e5('0x4e')]=qs[_0x53e5('0x4f')](_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x4f')]);_0x30c5e6[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_['pick'](_0x47a6e8[_0x53e5('0x47')],_0x51c9ad['filters']));_0x30c5e6[_0x53e5('0x52')][_0x53e5('0x6c')]=_0xcf9ecb['id'];if(_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x6d')]){_0x30c5e6['where']=_[_0x53e5('0x53')](_0x30c5e6[_0x53e5('0x52')],{'$or':_[_0x53e5('0x42')](_0x30c5e6[_0x53e5('0x4b')],function(_0x7c2f11){var _0xd2f340={};_0xd2f340[_0x7c2f11]={'$like':'%'+_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x6d')]+'%'};return _0xd2f340;})});}_0x30c5e6=_[_0x53e5('0x53')]({},_0x30c5e6,_0x47a6e8[_0x53e5('0x55')]);return db[_0x53e5('0x77')][_0x53e5('0x33')]({'where':_0x30c5e6[_0x53e5('0x52')]})['then'](function(_0x58122a){_0x5b0a8f['count']=_0x58122a;if(_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x6e')]){_0x30c5e6['include']=[{'model':db[_0x53e5('0x7a')],'as':_0x53e5('0x7b'),'required':![]},{'model':db[_0x53e5('0x7c')],'as':_0x53e5('0x7d'),'attributes':[_0x53e5('0x3d'),'fullname',_0x53e5('0x7e')],'required':![]},{'model':db[_0x53e5('0x7f')],'as':_0x53e5('0x80'),'attributes':['id',_0x53e5('0x3d'),'color'],'where':_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x81')]?{'id':_0x47a6e8['query']['tag']}:undefined,'required':_0x47a6e8[_0x53e5('0x47')][_0x53e5('0x81')]?!![]:![]}];}return db[_0x53e5('0x77')][_0x53e5('0x57')](_0x30c5e6);})[_0x53e5('0x38')](function(_0x528af2){_0x5b0a8f[_0x53e5('0x6f')]=_0x528af2;return _0x5b0a8f;});}})[_0x53e5('0x38')](respondWithFilteredResult(_0x5a3056,_0x30c5e6))[_0x53e5('0x2c')](handleError(_0x5a3056,null));};exports[_0x53e5('0x82')]=function(_0x5059ab,_0xdd48e0){var _0x23286e=_0x5059ab['params']['id'];var _0x2c6d32=_0x5059ab[_0x53e5('0x5e')];var _0x7d44bf=0xc8;var _0x1de1b7=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x53e5('0x83')][_0x53e5('0x84')]['READ_COMMITTED']},function(_0x53a557){return db[_0x53e5('0x43')][_0x53e5('0x75')]({'where':{'id':_0x23286e},'transaction':_0x53a557})[_0x53e5('0x38')](function(_0x185c50){if(_0x185c50){return db['FaxApplication'][_0x53e5('0x67')]({'where':{'FaxAccountId':_0x23286e},'transaction':_0x53a557})[_0x53e5('0x38')](function(){var _0x146539=_['map'](_0x2c6d32,function(_0x41ef64){_0x41ef64['FaxAccountId']=_0x23286e;return _0x41ef64;});return db[_0x53e5('0x85')][_0x53e5('0x86')](_0x146539,{'transaction':_0x53a557});});}else{_0x7d44bf=0x194;_0x1de1b7=[];}});})[_0x53e5('0x38')](function(){if(_0x7d44bf!==0x194){return db[_0x53e5('0x85')][_0x53e5('0x87')]({'where':{'FaxAccountId':_0x23286e},'order':_0x53e5('0x88')})[_0x53e5('0x38')](function(_0x1c44d8){_0x1de1b7=_0x1c44d8;});}})[_0x53e5('0x2c')](function(_0x5bb942){_0x7d44bf=0x1f4;logger[_0x53e5('0x29')](_0x5bb942[_0x53e5('0x3c')]);if(_0x5bb942[_0x53e5('0x3d')]){delete _0x5bb942[_0x53e5('0x3d')];}_0x1de1b7=_0x5bb942;})[_0x53e5('0x89')](function(){if(_0x1de1b7===null){_0xdd48e0[_0x53e5('0x3b')](_0x7d44bf);}else{if(_0x7d44bf===0x1f4){_0xdd48e0['status'](_0x7d44bf)[_0x53e5('0x3e')](_0x1de1b7);}else{_0xdd48e0[_0x53e5('0x2d')](_0x7d44bf)[_0x53e5('0x2f')](_0x1de1b7);}}});};exports[_0x53e5('0x8a')]=function(_0x3d5bcf,_0x2723ef,_0x41b77c){var _0x4a7686={};var _0x2a2f45={};var _0x35e37e;var _0x5271e5;return db['FaxAccount'][_0x53e5('0x75')]({'where':{'id':_0x3d5bcf[_0x53e5('0x59')]['id']}})['then'](handleEntityNotFound(_0x2723ef,null))['then'](function(_0x1d8a6a){if(_0x1d8a6a){_0x35e37e=_0x1d8a6a;_0x2a2f45[_0x53e5('0x49')]=_['keys'](db[_0x53e5('0x85')][_0x53e5('0x44')]);_0x2a2f45[_0x53e5('0x47')]=_[_0x53e5('0x5a')](_0x3d5bcf['query']);_0x2a2f45[_0x53e5('0x50')]=_['intersection'](_0x2a2f45[_0x53e5('0x49')],_0x2a2f45[_0x53e5('0x47')]);_0x4a7686[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x2a2f45[_0x53e5('0x49')],qs['fields'](_0x3d5bcf['query'][_0x53e5('0x4a')]));_0x4a7686[_0x53e5('0x4b')]=_0x4a7686[_0x53e5('0x4b')][_0x53e5('0x5b')]?_0x4a7686[_0x53e5('0x4b')]:_0x2a2f45['model'];_0x4a7686[_0x53e5('0x4e')]=qs[_0x53e5('0x4f')](_0x3d5bcf['query'][_0x53e5('0x4f')]);_0x4a7686[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_[_0x53e5('0x51')](_0x3d5bcf[_0x53e5('0x47')],_0x2a2f45[_0x53e5('0x50')]));if(_0x3d5bcf[_0x53e5('0x47')][_0x53e5('0x6d')]){_0x4a7686['where']=_[_0x53e5('0x53')](_0x4a7686[_0x53e5('0x52')],{'$or':_[_0x53e5('0x42')](_0x4a7686['attributes'],function(_0x20b2c1){var _0x10a16b={};_0x10a16b[_0x20b2c1]={'$like':'%'+_0x3d5bcf[_0x53e5('0x47')][_0x53e5('0x6d')]+'%'};return _0x10a16b;})});}_0x4a7686=_[_0x53e5('0x53')]({},_0x4a7686,_0x3d5bcf[_0x53e5('0x55')]);return _0x35e37e['getApplications'](_0x4a7686);}})[_0x53e5('0x38')](function(_0x538a32){if(_0x538a32){_0x5271e5=_0x538a32[_0x53e5('0x5b')];if(!_0x3d5bcf[_0x53e5('0x47')][_0x53e5('0x4c')](_0x53e5('0x4d'))){_0x4a7686[_0x53e5('0x32')]=qs[_0x53e5('0x32')](_0x3d5bcf[_0x53e5('0x47')][_0x53e5('0x32')]);_0x4a7686[_0x53e5('0x30')]=qs[_0x53e5('0x30')](_0x3d5bcf[_0x53e5('0x47')]['offset']);}return _0x35e37e[_0x53e5('0x8a')](_0x4a7686);}})[_0x53e5('0x38')](function(_0x185067){if(_0x185067){return _0x185067?{'count':_0x5271e5,'rows':_0x185067}:null;}})['then'](respondWithResult(_0x2723ef,null))[_0x53e5('0x2c')](handleError(_0x2723ef,null));};function Extension(_0x435876,_0x58533a,_0x5f53b9,_0x28c313){this['context']='from-voip-provider';this[_0x53e5('0x8b')]=_0x435876['localstationid'];this[_0x53e5('0x8c')]=_0x28c313;this[_0x53e5('0x45')]=_0x53e5('0x8d');this[_0x53e5('0x8e')]='Fax\x20Extension';this[_0x53e5('0x6c')]=_0x435876['id'];this[_0x53e5('0x88')]=_0x58533a;this[_0x53e5('0x8f')]=_0x5f53b9;}function createExtensionsReciveFax(_0x5761cb){var _0x48c309=0x1;var _0x5650ef=[];_0x5650ef[_0x53e5('0x90')](new Extension(_0x5761cb,_0x48c309,'',_0x53e5('0x91')));_0x48c309+=0x1;_0x5650ef[_0x53e5('0x90')](new Extension(_0x5761cb,_0x48c309,'CDR(type)=inbound-fax',_0x53e5('0x92')));_0x48c309+=0x1;for(var _0x364238 in _0x5761cb){if(_0x5761cb[_0x53e5('0x4c')](_0x364238)&&(_0x364238==='ecm'||_0x364238===_0x53e5('0x93')||_0x364238===_0x53e5('0x94')||_0x364238==='faxdetect'||_0x364238===_0x53e5('0x95')||_0x364238===_0x53e5('0x96')||_0x364238===_0x53e5('0x97')||_0x364238===_0x53e5('0x98')||_0x364238==='t38timeout')){_0x5650ef[_0x53e5('0x90')](new Extension(_0x5761cb,_0x48c309,_0x53e5('0x99')+_0x364238+')='+_0x5761cb[_0x364238],_0x53e5('0x92')));_0x48c309+=0x1;}}_0x5650ef[_0x53e5('0x90')](new Extension(_0x5761cb,_0x48c309,'6','Wait'));_0x48c309+=0x1;_0x5650ef[_0x53e5('0x90')](new Extension(_0x5761cb,_0x48c309,_0x53e5('0x9a'),_0x53e5('0x9b')));_0x48c309=0x0;return _0x5650ef;}exports[_0x53e5('0x9c')]=function(_0x37cae1,_0x5eea5f,_0x5d4217){var _0x43dd3f;return db[_0x53e5('0x9d')]['transaction'](function(_0x19f5e8){return db[_0x53e5('0x43')][_0x53e5('0x5d')](_0x37cae1[_0x53e5('0x5e')],{'transaction':_0x19f5e8})[_0x53e5('0x38')](function(_0x47c992){_0x43dd3f=_0x47c992[_0x53e5('0x39')]({'plain':!![]});return db[_0x53e5('0x9e')][_0x53e5('0x86')](createExtensionsReciveFax(_0x43dd3f),{'transaction':_0x19f5e8});});})[_0x53e5('0x38')](function(){return _0x43dd3f;})[_0x53e5('0x38')](respondWithResult(_0x5eea5f,null))[_0x53e5('0x2c')](handleError(_0x5eea5f,null));};exports['updateAccountApplications']=function(_0x22ab15,_0x21623d,_0x110a48){var _0x12deed;return db[_0x53e5('0x9d')][_0x53e5('0x9f')](function(_0x489757){return db[_0x53e5('0x43')][_0x53e5('0x66')](_0x22ab15[_0x53e5('0x5e')],{'where':{'id':_0x22ab15[_0x53e5('0x5e')]['id']},'transaction':_0x489757})[_0x53e5('0x38')](function(_0x2b0883){return db[_0x53e5('0x9e')]['destroy']({'where':{'FaxAccountId':_0x22ab15[_0x53e5('0x5e')]['id']},'transaction':_0x489757})[_0x53e5('0x38')](function(_0x4e96c0){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_[_0x53e5('0xa0')](_0x22ab15[_0x53e5('0x5e')],[_0x53e5('0xa1'),_0x53e5('0x46'),'createdAt','updatedAt',_0x53e5('0xa2'),_0x53e5('0xa3')])),{'transaction':_0x489757});});});})['then'](function(){return db['FaxAccount'][_0x53e5('0xa4')](_0x22ab15[_0x53e5('0x5e')]['id']);})['then'](respondWithResult(_0x21623d,null))[_0x53e5('0x2c')](handleError(_0x21623d,null));};exports[_0x53e5('0xa5')]=function(_0x433d9e,_0x510a4d,_0x22dbd9){var _0x519991={'raw':!![],'where':{}};var _0x230339={};var _0x2f312a={'count':0x0,'rows':[]};return db[_0x53e5('0x43')][_0x53e5('0x75')]({'where':{'id':_0x433d9e[_0x53e5('0x59')]['id']}})['then'](handleEntityNotFound(_0x510a4d,null))[_0x53e5('0x38')](function(_0x367d86){if(_0x367d86){_0x230339[_0x53e5('0x49')]=_[_0x53e5('0x5a')](db['FaxMessage'][_0x53e5('0x44')]);_0x230339[_0x53e5('0x47')]=_[_0x53e5('0x5a')](_0x433d9e['query']);_0x230339[_0x53e5('0x50')]=_['intersection'](_0x230339[_0x53e5('0x49')],_0x230339['query']);_0x519991[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x230339[_0x53e5('0x49')],qs[_0x53e5('0x4a')](_0x433d9e[_0x53e5('0x47')][_0x53e5('0x4a')]));_0x519991[_0x53e5('0x4b')]=_0x519991[_0x53e5('0x4b')]['length']?_0x519991['attributes']:_0x230339[_0x53e5('0x49')];if(!_0x433d9e[_0x53e5('0x47')]['hasOwnProperty'](_0x53e5('0x4d'))){_0x519991[_0x53e5('0x32')]=qs[_0x53e5('0x32')](_0x433d9e[_0x53e5('0x47')][_0x53e5('0x32')]);_0x519991['offset']=qs[_0x53e5('0x30')](_0x433d9e[_0x53e5('0x47')][_0x53e5('0x30')]);}_0x519991[_0x53e5('0x4e')]=qs[_0x53e5('0x4f')](_0x433d9e['query'][_0x53e5('0x4f')]);_0x519991[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_[_0x53e5('0x51')](_0x433d9e[_0x53e5('0x47')],_0x230339[_0x53e5('0x50')]));_0x519991[_0x53e5('0x52')][_0x53e5('0x6c')]=_0x367d86['id'];if(_0x433d9e[_0x53e5('0x47')][_0x53e5('0x6d')]){_0x519991[_0x53e5('0x52')]=_[_0x53e5('0x53')](_0x519991[_0x53e5('0x52')],{'$or':_[_0x53e5('0x42')](_0x519991['attributes'],function(_0x4abf15){var _0x2b7b1d={};_0x2b7b1d[_0x4abf15]={'$like':'%'+_0x433d9e[_0x53e5('0x47')][_0x53e5('0x6d')]+'%'};return _0x2b7b1d;})});}if(_0x433d9e['query'][_0x53e5('0xa6')]){var _0x41007a=_0x433d9e[_0x53e5('0x47')][_0x53e5('0xa6')][_0x53e5('0xa7')](',');var _0x3373e8={};_0x3373e8[_0x41007a[0x0]]={'$gte':moment(_0x41007a[0x1])[_0x53e5('0xa8')](_0x53e5('0xa9'))};_0x519991[_0x53e5('0x52')]=_[_0x53e5('0x53')](_0x519991[_0x53e5('0x52')],_0x3373e8);}_0x519991=_[_0x53e5('0x53')]({},_0x519991,_0x433d9e['options']);return db[_0x53e5('0xaa')][_0x53e5('0x33')]({'where':_0x519991['where']})[_0x53e5('0x38')](function(_0x1441aa){_0x2f312a[_0x53e5('0x33')]=_0x1441aa;if(_0x433d9e['query'][_0x53e5('0x6e')]){_0x519991[_0x53e5('0x56')]=[{'all':!![]}];}return db[_0x53e5('0xaa')][_0x53e5('0x57')](_0x519991);})['then'](function(_0x5d203c){_0x2f312a[_0x53e5('0x6f')]=_0x5d203c;return _0x2f312a;});}})[_0x53e5('0x38')](respondWithFilteredResult(_0x510a4d,_0x519991))[_0x53e5('0x2c')](handleError(_0x510a4d,null));};exports['send']=function(_0x592e51,_0x1aa5e0,_0x2db40e){var _0x4b1db4,_0x2aec32={},_0x2eea7f;if(_0x592e51[_0x53e5('0x5e')]['to']){_0x2eea7f=_0x592e51[_0x53e5('0x5e')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0x592e51['params']['id']},'include':[{'model':db[_0x53e5('0xab')],'as':'List','include':[{'model':db[_0x53e5('0x7a')],'as':'Contacts','where':{'fax':_0x2eea7f},'limit':0x1,'order':[[_0x53e5('0xac'),'DESC']]}]}]})[_0x53e5('0x38')](handleEntityNotFound(_0x1aa5e0,null))[_0x53e5('0x38')](function(_0x46cb23){_0x4b1db4=_0x46cb23;if(_0x592e51[_0x53e5('0x5e')]['attachments']&&_0x592e51['body'][_0x53e5('0xad')][_0x53e5('0x5b')]){for(var _0x44666e=0x0;_0x44666e<_0x592e51['body']['attachments'][_0x53e5('0x5b')];_0x44666e+=0x1){_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][_0x44666e]={'filename':_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][_0x44666e]['name'],'id':_0x592e51['body'][_0x53e5('0xad')][_0x44666e]['id'],'path':path[_0x53e5('0xae')](config[_0x53e5('0xaf')],_0x53e5('0xb0'),_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][_0x44666e][_0x53e5('0xb1')])};}}return respondWithRpcPromise(_0x53e5('0xb2'),_0x53e5('0xb2'),{'FaxAccountId':_[_0x53e5('0xb3')](_0x592e51[_0x53e5('0x59')]['id'])?undefined:_0x592e51[_0x53e5('0x59')]['id'],'path':_[_0x53e5('0xb3')](_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0]['path'])?undefined:_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0][_0x53e5('0x8')],'fax':_[_0x53e5('0xb3')](_0x592e51[_0x53e5('0x5e')]['to'][0x0])?undefined:_0x592e51['body']['to'][0x0]},client9002);})[_0x53e5('0x38')](function(){if(_0x4b1db4){if(_[_0x53e5('0xb3')](_0x592e51[_0x53e5('0x5e')][_0x53e5('0xb4')])){_0x592e51['body'][_0x53e5('0xb4')]=util[_0x53e5('0xa8')](_0x53e5('0xb5'),_0x4b1db4['name'],_0x4b1db4[_0x53e5('0xb6')]);}if(_0x4b1db4[_0x53e5('0xb7')]){if(_0x4b1db4[_0x53e5('0xb7')][_0x53e5('0xb8')][_0x53e5('0x5b')]){return _0x4b1db4[_0x53e5('0xb7')][_0x53e5('0xb8')][0x0];}else{return db[_0x53e5('0x7a')][_0x53e5('0x5d')](_[_0x53e5('0xb9')](_0x592e51['body'],{'firstName':_0x592e51[_0x53e5('0x5e')]['to'][0x0],'phone':_0x592e51[_0x53e5('0x5e')]['to'][0x0],'fax':_0x592e51[_0x53e5('0x5e')]['to'][0x0],'ListId':_0x4b1db4['ListId']}));}}else{throw new Error(_0x53e5('0xba'));}}else{throw new Error(_0x53e5('0xbb'));}})['then'](function(_0x195293){if(_0x195293){return db[_0x53e5('0x77')][_0x53e5('0x5c')]({'where':{'ContactId':_0x195293['id'],'closed':![],'FaxAccountId':_0x4b1db4['id']}})[_0x53e5('0x38')](function(_0x207ba7){if(_0x207ba7){return[_0x207ba7,![]];}return db[_0x53e5('0x77')]['create']({'UserId':_0x592e51[_0x53e5('0x60')]['id'],'ContactId':_0x195293['id'],'FaxAccountId':_0x4b1db4['id'],'fax':_0x592e51[_0x53e5('0x5e')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x53e5('0x53')](_0x592e51[_0x53e5('0x5e')],{'read':![],'body':_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0][_0x53e5('0xbc')],'FaxAccountId':_0x4b1db4['id'],'UserId':_0x592e51[_0x53e5('0x60')]['id'],'ContactId':_0x195293['id'],'AttachmentId':_0x592e51[_0x53e5('0x5e')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x53e5('0xbd')}]})[_0x53e5('0x38')](function(_0x57a9ab){return[_0x57a9ab,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x53e5('0xbe')](function(_0x4cf6fe,_0x473a1d){if(_0x473a1d){return _0x4cf6fe;}return db['FaxMessage']['create']({'direction':_0x53e5('0xbf'),'read':![],'body':_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0]['filename'],'FaxAccountId':_0x4b1db4['id'],'FaxInteractionId':_0x4cf6fe['id'],'UserId':_0x592e51[_0x53e5('0x60')]['id'],'ContactId':_0x4cf6fe[_0x53e5('0xc0')],'AttachmentId':_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0]['id']})[_0x53e5('0x38')](function(_0x4c6602){_0x4cf6fe[_0x53e5('0xc1')][_0x53e5('0xbd')]=[];_0x4cf6fe['dataValues'][_0x53e5('0xbd')][_0x53e5('0x90')](_0x4c6602['dataValues']);return _0x4cf6fe;});})[_0x53e5('0x38')](function(_0x1728b6){respondWithRpcPromise(_0x53e5('0xc2'),_0x53e5('0xc2'),{'FaxAccountId':_[_0x53e5('0xb3')](_0x592e51['params']['id'])?undefined:_0x592e51['params']['id'],'path':_['isNil'](_0x592e51[_0x53e5('0x5e')]['attachments'][0x0]['path'])?undefined:_0x592e51[_0x53e5('0x5e')][_0x53e5('0xad')][0x0]['path'],'fax':_[_0x53e5('0xb3')](_0x592e51[_0x53e5('0x5e')]['to'][0x0])?undefined:_0x592e51[_0x53e5('0x5e')]['to'][0x0],'AttachmentId':_0x592e51['body'][_0x53e5('0xad')][0x0]['id']},client9002)[_0x53e5('0x38')](function(_0x248cfe){logger[_0x53e5('0x23')]('SendFaxRpc,\x20%s',_0x248cfe);})[_0x53e5('0x2c')](function(_0x250060){logger[_0x53e5('0x23')](_0x53e5('0xc3'),_0x250060);});return _0x1728b6;})[_0x53e5('0x38')](respondWithResult(_0x1aa5e0,null))[_0x53e5('0x2c')](handleError(_0x1aa5e0,null));};exports['addAgents']=function(_0x101faa,_0x54028d,_0x5c0c8b){return db[_0x53e5('0x43')][_0x53e5('0x5c')]({'where':{'id':_0x101faa['params']['id']}})['then'](handleEntityNotFound(_0x54028d,null))[_0x53e5('0x38')](function(_0x574571){if(_0x574571){return _0x574571[_0x53e5('0xc4')](_0x101faa[_0x53e5('0x5e')]['ids'],_[_0x53e5('0xa0')](_0x101faa[_0x53e5('0x5e')],[_0x53e5('0x71'),'id'])||{})[_0x53e5('0xbe')](function(_0x30f938){for(var _0x1c289c=0x0;_0x1c289c<_0x101faa[_0x53e5('0x5e')]['ids']['length'];_0x1c289c+=0x1){socket[_0x53e5('0xc5')](_0x53e5('0xc6'),{'UserId':Number(_0x101faa[_0x53e5('0x5e')][_0x53e5('0x71')][_0x1c289c]),'FaxAccountId':Number(_0x101faa['params']['id'])});}return _0x30f938;});}})['then'](respondWithResult(_0x54028d,null))[_0x53e5('0x2c')](handleError(_0x54028d,null));};exports['removeAgents']=function(_0xec1921,_0x5f14e5,_0xf5a19){return db[_0x53e5('0x43')]['find']({'where':{'id':_0xec1921[_0x53e5('0x59')]['id']}})[_0x53e5('0x38')](handleEntityNotFound(_0x5f14e5,null))['then'](function(_0x37d492){if(_0x37d492){return _0x37d492[_0x53e5('0xc7')](_0xec1921[_0x53e5('0x47')][_0x53e5('0x71')])[_0x53e5('0x38')](function(){if(_[_0x53e5('0xc8')](_0xec1921[_0x53e5('0x47')]['ids'])){for(var _0x37b43f=0x0;_0x37b43f<_0xec1921[_0x53e5('0x47')][_0x53e5('0x71')]['length'];_0x37b43f+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0xec1921[_0x53e5('0x47')][_0x53e5('0x71')][_0x37b43f]),'FaxAccountId':Number(_0xec1921[_0x53e5('0x59')]['id'])});}}else{socket[_0x53e5('0xc5')](_0x53e5('0xc9'),{'UserId':Number(_0xec1921[_0x53e5('0x47')][_0x53e5('0x71')]),'FaxAccountId':Number(_0xec1921[_0x53e5('0x59')]['id'])});}});}})[_0x53e5('0x38')](respondWithStatusCode(_0x5f14e5,null))[_0x53e5('0x2c')](handleError(_0x5f14e5,null));};exports[_0x53e5('0xca')]=function(_0x314020,_0x5d25f6,_0x158faa){var _0x19308b={};var _0x365b14={};var _0x445b2c;var _0x2e69f0;return db[_0x53e5('0x43')]['findOne']({'where':{'id':_0x314020[_0x53e5('0x59')]['id']}})['then'](handleEntityNotFound(_0x5d25f6,null))[_0x53e5('0x38')](function(_0x24ad6d){if(_0x24ad6d){_0x445b2c=_0x24ad6d;_0x365b14[_0x53e5('0x49')]=_[_0x53e5('0x5a')](db[_0x53e5('0x7c')][_0x53e5('0x44')]);_0x365b14['query']=_['keys'](_0x314020[_0x53e5('0x47')]);_0x365b14['filters']=_[_0x53e5('0x48')](_0x365b14['model'],_0x365b14[_0x53e5('0x47')]);_0x19308b[_0x53e5('0x4b')]=_[_0x53e5('0x48')](_0x365b14[_0x53e5('0x49')],qs[_0x53e5('0x4a')](_0x314020[_0x53e5('0x47')][_0x53e5('0x4a')]));_0x19308b['attributes']=_0x19308b[_0x53e5('0x4b')][_0x53e5('0x5b')]?_0x19308b[_0x53e5('0x4b')]:_0x365b14[_0x53e5('0x49')];_0x19308b[_0x53e5('0x4e')]=qs['sort'](_0x314020[_0x53e5('0x47')][_0x53e5('0x4f')]);_0x19308b[_0x53e5('0x52')]=qs[_0x53e5('0x50')](_[_0x53e5('0x51')](_0x314020[_0x53e5('0x47')],_0x365b14[_0x53e5('0x50')]));if(_0x314020[_0x53e5('0x47')]['filter']){_0x19308b[_0x53e5('0x52')]=_['merge'](_0x19308b[_0x53e5('0x52')],{'$or':_['map'](_0x19308b['attributes'],function(_0x424753){var _0x5cf3ad={};_0x5cf3ad[_0x424753]={'$like':'%'+_0x314020[_0x53e5('0x47')]['filter']+'%'};return _0x5cf3ad;})});}_0x19308b=_[_0x53e5('0x53')]({},_0x19308b,_0x314020[_0x53e5('0x55')]);return _0x445b2c[_0x53e5('0xca')](_0x19308b);}})['then'](function(_0x39f021){if(_0x39f021){_0x2e69f0=_0x39f021[_0x53e5('0x5b')];if(!_0x314020[_0x53e5('0x47')][_0x53e5('0x4c')](_0x53e5('0x4d'))){_0x19308b[_0x53e5('0x32')]=qs['limit'](_0x314020['query'][_0x53e5('0x32')]);_0x19308b['offset']=qs[_0x53e5('0x30')](_0x314020[_0x53e5('0x47')]['offset']);}return _0x445b2c[_0x53e5('0xca')](_0x19308b);}})[_0x53e5('0x38')](function(_0x2c4a2d){if(_0x2c4a2d){return _0x2c4a2d?{'count':_0x2e69f0,'rows':_0x2c4a2d}:null;}})[_0x53e5('0x38')](respondWithResult(_0x5d25f6,null))[_0x53e5('0x2c')](handleError(_0x5d25f6,null));};
\ No newline at end of file
index f0a53f4..b4e5af0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fc4=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x2fc4,0x1c7));var _0x42fc=function(_0x22491d,_0x3bad40){_0x22491d=_0x22491d-0x0;var _0x431173=_0x2fc4[_0x22491d];return _0x431173;};'use strict';var EventEmitter=require(_0x42fc('0x0'));var FaxAccount=require(_0x42fc('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x42fc('0x2')](0x0);var events={'afterCreate':_0x42fc('0x3'),'afterUpdate':_0x42fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4c6626){return function(_0x57462b,_0x4832b4,_0x4c1f4d){FaxAccountEvents[_0x42fc('0x5')](_0x4c6626+':'+_0x57462b['id'],_0x57462b);FaxAccountEvents[_0x42fc('0x5')](_0x4c6626,_0x57462b);_0x4c1f4d(null);};}for(var e in events){if(events[_0x42fc('0x6')](e)){var event=events[e];FaxAccount[_0x42fc('0x7')](e,emitEvent(event));}}module[_0x42fc('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0x94e6=['FaxAccount','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x8efbee,_0x107af1){var _0x1e92c1=function(_0x3695c7){while(--_0x3695c7){_0x8efbee['push'](_0x8efbee['shift']());}};_0x1e92c1(++_0x107af1);}(_0x94e6,0x194));var _0x694e=function(_0x34b970,_0x4bdad2){_0x34b970=_0x34b970-0x0;var _0x39d6da=_0x94e6[_0x34b970];return _0x39d6da;};'use strict';var EventEmitter=require(_0x694e('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x694e('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x694e('0x2')](0x0);var events={'afterCreate':_0x694e('0x3'),'afterUpdate':_0x694e('0x4'),'afterDestroy':_0x694e('0x5')};function emitEvent(_0x3e8631){return function(_0x4f8394,_0x2e17f0,_0x46f07a){FaxAccountEvents['emit'](_0x3e8631+':'+_0x4f8394['id'],_0x4f8394);FaxAccountEvents['emit'](_0x3e8631,_0x4f8394);_0x46f07a(null);};}for(var e in events){if(events[_0x694e('0x6')](e)){var event=events[e];FaxAccount[_0x694e('0x7')](e,emitEvent(event));}}module[_0x694e('0x8')]=FaxAccountEvents;
\ No newline at end of file
index 47ba562..8741247 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62b0=['path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','util','../../config/logger','api','moment','request-promise'];(function(_0x19a142,_0x227247){var _0x121089=function(_0x484afa){while(--_0x484afa){_0x19a142['push'](_0x19a142['shift']());}};_0x121089(++_0x227247);}(_0x62b0,0x1ab));var _0x062b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x062b('0x0'));var logger=require(_0x062b('0x1'))(_0x062b('0x2'));var moment=require(_0x062b('0x3'));var BPromise=require('bluebird');var rp=require(_0x062b('0x4'));var fs=require('fs');var path=require(_0x062b('0x5'));var rimraf=require(_0x062b('0x6'));var config=require(_0x062b('0x7'));var attributes=require(_0x062b('0x8'));module[_0x062b('0x9')]=function(_0x296cc7,_0x5b47ec){return _0x296cc7[_0x062b('0xa')]('FaxAccount',attributes,{'tableName':_0x062b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x46c4=['fax_accounts','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x4dd5be,_0x28a69d){var _0x5d52ef=function(_0x56ba6a){while(--_0x56ba6a){_0x4dd5be['push'](_0x4dd5be['shift']());}};_0x5d52ef(++_0x28a69d);}(_0x46c4,0x1d5));var _0x446c=function(_0xf56aa6,_0x1a9a7f){_0xf56aa6=_0xf56aa6-0x0;var _0x15d6bf=_0x46c4[_0xf56aa6];return _0x15d6bf;};'use strict';var _=require('lodash');var util=require(_0x446c('0x0'));var logger=require(_0x446c('0x1'))(_0x446c('0x2'));var moment=require(_0x446c('0x3'));var BPromise=require('bluebird');var rp=require(_0x446c('0x4'));var fs=require('fs');var path=require(_0x446c('0x5'));var rimraf=require(_0x446c('0x6'));var config=require(_0x446c('0x7'));var attributes=require(_0x446c('0x8'));module[_0x446c('0x9')]=function(_0x5e2e39,_0x24b3d7){return _0x5e2e39[_0x446c('0xa')](_0x446c('0xb'),attributes,{'tableName':_0x446c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5505ec4..d897bd6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dab=['FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','options','raw','where','include','model','attributes','map','then','debug','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','ListId','create','contact','FaxInteraction','Contact\x20not\x20found','spread','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','User','name','UserId','unshift','agent','startRouting','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','redis','defaults','register','FaxAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x37051d,_0x4a70fd){var _0x2d63b5=function(_0x42c6ee){while(--_0x42c6ee){_0x37051d['push'](_0x37051d['shift']());}};_0x2d63b5(++_0x4a70fd);}(_0x7dab,0x146));var _0xb7da=function(_0x1726d7,_0x34f355){_0x1726d7=_0x1726d7-0x0;var _0x874740=_0x7dab[_0x1726d7];return _0x874740;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var moment=require(_0xb7da('0x2'));var BPromise=require(_0xb7da('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7da('0x4'));var db=require(_0xb7da('0x5'))['db'];var utils=require(_0xb7da('0x6'));var logger=require(_0xb7da('0x7'))(_0xb7da('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config[_0xb7da('0x9')]=_[_0xb7da('0xa')](config[_0xb7da('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb7da('0x9')]));require('./faxAccount.socket')[_0xb7da('0xb')](socket);function respondWithRpcPromise(_0x4f15a4,_0x1b7da6,_0x1024a1){return new BPromise(function(_0x17b890,_0x46b57c){return client['request'](_0x4f15a4,_0x1024a1)['then'](function(_0x4395a6){logger['info'](_0xb7da('0xc'),_0x1b7da6,_0xb7da('0xd'));logger['debug'](_0xb7da('0xe'),_0x1b7da6,_0xb7da('0xd'),JSON[_0xb7da('0xf')](_0x4395a6));if(_0x4395a6[_0xb7da('0x10')]){if(_0x4395a6[_0xb7da('0x10')][_0xb7da('0x11')]===0x1f4){logger[_0xb7da('0x10')](_0xb7da('0xc'),_0x1b7da6,_0x4395a6[_0xb7da('0x10')][_0xb7da('0x12')]);return _0x46b57c(_0x4395a6[_0xb7da('0x10')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1b7da6,_0x4395a6[_0xb7da('0x10')]['message']);return _0x17b890(_0x4395a6[_0xb7da('0x10')][_0xb7da('0x12')]);}else{logger[_0xb7da('0x13')]('FaxAccount,\x20%s,\x20%s',_0x1b7da6,'request\x20sent');_0x17b890(_0x4395a6[_0xb7da('0x14')][_0xb7da('0x12')]);}})[_0xb7da('0x15')](function(_0x250ea7){logger[_0xb7da('0x10')](_0xb7da('0xc'),_0x1b7da6,_0x250ea7);_0x46b57c(_0x250ea7);});});}exports[_0xb7da('0x16')]=function(_0x3eee1a){var _0x5dac2d=this;return new Promise(function(_0x35722e,_0x4067b2){return db[_0xb7da('0x17')]['findAll']({'raw':_0x3eee1a['options']?_0x3eee1a[_0xb7da('0x18')][_0xb7da('0x19')]===undefined?!![]:![]:!![],'where':_0x3eee1a['options']?_0x3eee1a[_0xb7da('0x18')][_0xb7da('0x1a')]||null:null,'attributes':_0x3eee1a['options']?_0x3eee1a['options']['attributes']||null:null,'limit':_0x3eee1a[_0xb7da('0x18')]?_0x3eee1a['options']['limit']||null:null,'include':_0x3eee1a[_0xb7da('0x18')]?_0x3eee1a['options']['include']?_['map'](_0x3eee1a[_0xb7da('0x18')][_0xb7da('0x1b')],function(_0x2c08eb){return{'model':db[_0x2c08eb[_0xb7da('0x1c')]],'as':_0x2c08eb['as'],'attributes':_0x2c08eb[_0xb7da('0x1d')],'include':_0x2c08eb[_0xb7da('0x1b')]?_[_0xb7da('0x1e')](_0x2c08eb[_0xb7da('0x1b')],function(_0x5dd026){return{'model':db[_0x5dd026['model']],'as':_0x5dd026['as'],'attributes':_0x5dd026[_0xb7da('0x1d')],'include':_0x5dd026[_0xb7da('0x1b')]?_['map'](_0x5dd026[_0xb7da('0x1b')],function(_0x30cb25){return{'model':db[_0x30cb25[_0xb7da('0x1c')]],'as':_0x30cb25['as'],'attributes':_0x30cb25['attributes']};}):[]};}):[]};}):[]:[]})[_0xb7da('0x1f')](function(_0xb93e37){logger['info'](_0xb7da('0x16'),_0x3eee1a);logger[_0xb7da('0x20')](_0xb7da('0x16'),_0x3eee1a,JSON[_0xb7da('0xf')](_0xb93e37));_0x35722e(_0xb93e37);})[_0xb7da('0x15')](function(_0x21a914){logger[_0xb7da('0x10')](_0xb7da('0x16'),_0x21a914[_0xb7da('0x12')],_0x3eee1a);_0x4067b2(_0x5dac2d[_0xb7da('0x10')](0x1f4,_0x21a914[_0xb7da('0x12')]));});});};exports['NotifyFaxAccount']=function(_0x5b4b19,_0x3d571c,_0x36bfe1){var _0x5284a6=this;return new Promise(function(_0x3ae1dd,_0xf4e26a){var _0x3d3be4={'body':_0x5b4b19[_0xb7da('0x21')],'channel':'fax'};var _0x4cb68a=[];var _0x13a0ec=[];var _0x2b6595={};return db[_0xb7da('0x22')][_0xb7da('0x23')]()[_0xb7da('0x1f')](function(_0x20a88e){if(!_0x20a88e){throw new db[(_0xb7da('0x24'))][(_0xb7da('0x25'))](_0xb7da('0x26'));}_0x4cb68a=_[_0xb7da('0x27')](_[_0xb7da('0x28')](_0x20a88e),[_0xb7da('0x29'),_0xb7da('0x2a')]);_0x13a0ec=_[_0xb7da('0x27')](_[_0xb7da('0x28')](_0x20a88e),['createdAt',_0xb7da('0x2a'),'CompanyId','ListId']);if(_0x5b4b19[_0xb7da('0x21')]['id']){delete _0x5b4b19['body']['id'];}if(_['isNil'](_0x5b4b19['body'][_0xb7da('0x2b')])){throw new db[(_0xb7da('0x24'))][(_0xb7da('0x25'))](_0xb7da('0x2c'));}if(_[_0xb7da('0x2d')](_0x5b4b19[_0xb7da('0x21')]['body'])||_0x5b4b19['body'][_0xb7da('0x21')]===''){throw new db['Sequelize']['ValidationError'](_0xb7da('0x2e'));}if(_[_0xb7da('0x2d')](_0x5b4b19['body'][_0xb7da('0x2f')])){throw new db[(_0xb7da('0x24'))][(_0xb7da('0x25'))](_0xb7da('0x30')+_0x13a0ec);}if(!_[_0xb7da('0x31')](_0x13a0ec,_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x2f')])){throw new db[(_0xb7da('0x24'))][(_0xb7da('0x25'))](_0xb7da('0x32')+_0x13a0ec);}_0x2b6595[_0x5b4b19['body'][_0xb7da('0x2f')]]=_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x2b')];})[_0xb7da('0x1f')](function(){return db[_0xb7da('0x17')][_0xb7da('0x33')]({'where':{'id':_0x5b4b19[_0xb7da('0x34')]['id']},'include':[{'model':db[_0xb7da('0x35')],'as':_0xb7da('0x36'),'include':[{'model':db['CmContact'],'as':_0xb7da('0x37'),'where':_0x2b6595,'limit':0x1,'order':[[_0xb7da('0x2a'),_0xb7da('0x38')]]}]},{'model':db[_0xb7da('0x39')],'as':_0xb7da('0x3a')}]});})[_0xb7da('0x1f')](function(_0x244609){if(_0x244609&&_0x244609['List']){var _0x43fc57=_0x244609['get']({'plain':!![]});_0x3d3be4[_0xb7da('0x34')]=_0x43fc57;_0x3d3be4[_0xb7da('0x3b')]=_0x43fc57[_0xb7da('0x3a')];_0x3d3be4[_0xb7da('0x3c')]=_0x43fc57[_0xb7da('0x36')];_0x3d3be4[_0xb7da('0x3b')]=_[_0xb7da('0x3d')](_0x3d3be4[_0xb7da('0x3b')],[_0xb7da('0x3e')],[_0xb7da('0x3f')]);if(_0x3d3be4[_0xb7da('0x34')][_0xb7da('0x3a')]){delete _0x3d3be4[_0xb7da('0x34')]['Applications'];}if(_0x3d3be4[_0xb7da('0x34')][_0xb7da('0x36')]&&_0x3d3be4[_0xb7da('0x34')]['List']['Contacts'][_0xb7da('0x40')]){return _0x3d3be4['account']['List'][_0xb7da('0x37')][0x0];}var _0x5cac80=_[_0xb7da('0xa')](_0x5b4b19[_0xb7da('0x21')],{'firstName':_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x2b')],'ListId':_0x43fc57[_0xb7da('0x41')]});_0x5cac80[_0x5b4b19['body'][_0xb7da('0x2f')]]=_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x2b')];return db[_0xb7da('0x22')][_0xb7da('0x42')](_0x5cac80,{'fields':_0x4cb68a,'raw':!![]});}})[_0xb7da('0x1f')](function(_0x210ee2){_0x3d3be4[_0xb7da('0x43')]=_0x210ee2;if(_0x210ee2){var _0x51fd9b={'ContactId':_0x210ee2['id'],'FaxAccountId':_0x5b4b19[_0xb7da('0x34')]['id'],'fax':_0x210ee2['fax']};return db['FaxInteraction'][_0xb7da('0x33')]({'where':{'ContactId':_0x210ee2['id'],'closed':![],'FaxAccountId':_0x5b4b19['account']['id']}})['then'](function(_0x913211){if(_0x913211){return[_0x913211,![]];}return db[_0xb7da('0x44')]['create'](_0x51fd9b)[_0xb7da('0x1f')](function(_0x171a3e){return[_0x171a3e,!![]];});});}else{throw new Error(_0xb7da('0x45'));}})[_0xb7da('0x46')](function(_0x595216,_0x14677f){var _0x1c9890=_0x595216['get']({'plain':!![]});if(_0x14677f){if(_0x3d3be4[_0xb7da('0x34')]['autoclose']){_0x3d3be4['applications']['push']({'id':0x0,'priority':_0x3d3be4['applications']['length']+0x1,'app':_0xb7da('0x47'),'appdata':_0xb7da('0x48'),'interval':_0xb7da('0x49')});}_0x1c9890[_0xb7da('0x4a')]=!![];}else{_0x1c9890[_0xb7da('0x4a')]=![];}_0x3d3be4[_0xb7da('0x4b')]=_0x1c9890;return db[_0xb7da('0x4c')][_0xb7da('0x42')]({'body':_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x21')],'FaxAccountId':_0x5b4b19[_0xb7da('0x34')]['id'],'FaxInteractionId':_0x595216['id'],'direction':'in','ContactId':_0x595216[_0xb7da('0x4d')],'AttachmentId':_0x5b4b19[_0xb7da('0x21')][_0xb7da('0x4e')]});})['then'](function(_0x20b64b){_0x3d3be4[_0xb7da('0x12')]=_0x20b64b;if(_0x3d3be4['interaction']['UserId']){return db[_0xb7da('0x4f')][_0xb7da('0x33')]({'attributes':['id',_0xb7da('0x50')],'where':{'id':_0x3d3be4[_0xb7da('0x4b')][_0xb7da('0x51')]}})[_0xb7da('0x1f')](function(_0x325457){if(_0x325457){_0x3d3be4['applications'][_0xb7da('0x52')]({'id':0x0,'priority':0x0,'app':_0xb7da('0x53'),'appdata':_0x325457['name']+','+(_0x3d3be4['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xb7da('0x54'),_0x3d3be4);});}return respondWithRpcPromise('Start',_0xb7da('0x54'),_0x3d3be4);})[_0xb7da('0x1f')](function(_0x5c69ff){_0x3ae1dd(_0x5c69ff);})[_0xb7da('0x15')](function(_0x2424bd){_0xf4e26a(_0x5284a6[_0xb7da('0x10')](0x1f4,_0x2424bd['message']));});});};
\ No newline at end of file
+var _0xd1ff=['error','message','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','include','map','attributes','model','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','get','Applications','applications','orderBy','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','push','length','unmanaged','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x3372eb,_0x580d91){var _0x492bfb=function(_0x108447){while(--_0x108447){_0x3372eb['push'](_0x3372eb['shift']());}};_0x492bfb(++_0x580d91);}(_0xd1ff,0x9d));var _0xfd1f=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xd1ff[_0x872b02];return _0x1a6b24;};'use strict';var _=require(_0xfd1f('0x0'));var util=require(_0xfd1f('0x1'));var moment=require(_0xfd1f('0x2'));var BPromise=require(_0xfd1f('0x3'));var rs=require(_0xfd1f('0x4'));var fs=require('fs');var Redis=require(_0xfd1f('0x5'));var db=require(_0xfd1f('0x6'))['db'];var utils=require(_0xfd1f('0x7'));var logger=require(_0xfd1f('0x8'))(_0xfd1f('0x9'));var config=require('../../config/environment');var jayson=require(_0xfd1f('0xa'));var client=jayson[_0xfd1f('0xb')][_0xfd1f('0xc')]({'port':0x232c});config[_0xfd1f('0xd')]=_[_0xfd1f('0xe')](config[_0xfd1f('0xd')],{'host':_0xfd1f('0xf'),'port':0x18eb});var socket=require(_0xfd1f('0x10'))(new Redis(config['redis']));require(_0xfd1f('0x11'))[_0xfd1f('0x12')](socket);function respondWithRpcPromise(_0x37a242,_0x556779,_0x2fd254){return new BPromise(function(_0x15b1e4,_0x385536){return client[_0xfd1f('0x13')](_0x37a242,_0x2fd254)[_0xfd1f('0x14')](function(_0x22c0a4){logger[_0xfd1f('0x15')](_0xfd1f('0x16'),_0x556779,_0xfd1f('0x17'));logger[_0xfd1f('0x18')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x556779,_0xfd1f('0x17'),JSON[_0xfd1f('0x19')](_0x22c0a4));if(_0x22c0a4['error']){if(_0x22c0a4['error'][_0xfd1f('0x1a')]===0x1f4){logger['error'](_0xfd1f('0x16'),_0x556779,_0x22c0a4[_0xfd1f('0x1b')][_0xfd1f('0x1c')]);return _0x385536(_0x22c0a4[_0xfd1f('0x1b')][_0xfd1f('0x1c')]);}logger[_0xfd1f('0x1b')](_0xfd1f('0x16'),_0x556779,_0x22c0a4[_0xfd1f('0x1b')][_0xfd1f('0x1c')]);return _0x15b1e4(_0x22c0a4[_0xfd1f('0x1b')][_0xfd1f('0x1c')]);}else{logger[_0xfd1f('0x15')]('FaxAccount,\x20%s,\x20%s',_0x556779,_0xfd1f('0x17'));_0x15b1e4(_0x22c0a4['result'][_0xfd1f('0x1c')]);}})[_0xfd1f('0x1d')](function(_0x65c4a){logger['error'](_0xfd1f('0x16'),_0x556779,_0x65c4a);_0x385536(_0x65c4a);});});}exports[_0xfd1f('0x1e')]=function(_0x55e8d2){var _0x379041=this;return new Promise(function(_0x2f9252,_0x2f44e3){return db[_0xfd1f('0x1f')][_0xfd1f('0x20')]({'raw':_0x55e8d2[_0xfd1f('0x21')]?_0x55e8d2[_0xfd1f('0x21')][_0xfd1f('0x22')]===undefined?!![]:![]:!![],'where':_0x55e8d2['options']?_0x55e8d2[_0xfd1f('0x21')][_0xfd1f('0x23')]||null:null,'attributes':_0x55e8d2[_0xfd1f('0x21')]?_0x55e8d2[_0xfd1f('0x21')]['attributes']||null:null,'limit':_0x55e8d2[_0xfd1f('0x21')]?_0x55e8d2['options']['limit']||null:null,'include':_0x55e8d2[_0xfd1f('0x21')]?_0x55e8d2['options'][_0xfd1f('0x24')]?_[_0xfd1f('0x25')](_0x55e8d2[_0xfd1f('0x21')][_0xfd1f('0x24')],function(_0x3318e0){return{'model':db[_0x3318e0['model']],'as':_0x3318e0['as'],'attributes':_0x3318e0[_0xfd1f('0x26')],'include':_0x3318e0[_0xfd1f('0x24')]?_[_0xfd1f('0x25')](_0x3318e0[_0xfd1f('0x24')],function(_0x4591c9){return{'model':db[_0x4591c9[_0xfd1f('0x27')]],'as':_0x4591c9['as'],'attributes':_0x4591c9[_0xfd1f('0x26')],'include':_0x4591c9[_0xfd1f('0x24')]?_[_0xfd1f('0x25')](_0x4591c9[_0xfd1f('0x24')],function(_0x2ae088){return{'model':db[_0x2ae088[_0xfd1f('0x27')]],'as':_0x2ae088['as'],'attributes':_0x2ae088[_0xfd1f('0x26')]};}):[]};}):[]};}):[]:[]})[_0xfd1f('0x14')](function(_0xe2bd7){logger[_0xfd1f('0x15')]('GetFaxAccount',_0x55e8d2);logger[_0xfd1f('0x18')](_0xfd1f('0x1e'),_0x55e8d2,JSON[_0xfd1f('0x19')](_0xe2bd7));_0x2f9252(_0xe2bd7);})[_0xfd1f('0x1d')](function(_0x9bd5ec){logger[_0xfd1f('0x1b')](_0xfd1f('0x1e'),_0x9bd5ec[_0xfd1f('0x1c')],_0x55e8d2);_0x2f44e3(_0x379041[_0xfd1f('0x1b')](0x1f4,_0x9bd5ec['message']));});});};exports[_0xfd1f('0x28')]=function(_0x16e12a,_0x985bb8,_0x353f9d){var _0x5a7a75=this;return new Promise(function(_0x3d5594,_0x32e15d){var _0xdf293e={'body':_0x16e12a[_0xfd1f('0x29')],'channel':_0xfd1f('0x2a')};var _0x298a06=[];var _0x19bb3e=[];var _0x40319d={};return db[_0xfd1f('0x2b')][_0xfd1f('0x2c')]()['then'](function(_0x31e838){if(!_0x31e838){throw new db[(_0xfd1f('0x2d'))][(_0xfd1f('0x2e'))]('no\x20available\x20attributes');}_0x298a06=_[_0xfd1f('0x2f')](_[_0xfd1f('0x30')](_0x31e838),[_0xfd1f('0x31'),_0xfd1f('0x32')]);_0x19bb3e=_[_0xfd1f('0x2f')](_[_0xfd1f('0x30')](_0x31e838),[_0xfd1f('0x31'),_0xfd1f('0x32'),_0xfd1f('0x33'),_0xfd1f('0x34')]);if(_0x16e12a[_0xfd1f('0x29')]['id']){delete _0x16e12a[_0xfd1f('0x29')]['id'];}if(_[_0xfd1f('0x35')](_0x16e12a['body'][_0xfd1f('0x36')])){throw new db[(_0xfd1f('0x2d'))]['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x29')])||_0x16e12a['body'][_0xfd1f('0x29')]===''){throw new db[(_0xfd1f('0x2d'))][(_0xfd1f('0x2e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfd1f('0x35')](_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x37')])){throw new db[(_0xfd1f('0x2d'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19bb3e);}if(!_[_0xfd1f('0x38')](_0x19bb3e,_0x16e12a['body'][_0xfd1f('0x37')])){throw new db['Sequelize']['ValidationError'](_0xfd1f('0x39')+_0x19bb3e);}_0x40319d[_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x37')]]=_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x36')];})[_0xfd1f('0x14')](function(){return db[_0xfd1f('0x1f')][_0xfd1f('0x3a')]({'where':{'id':_0x16e12a[_0xfd1f('0x3b')]['id']},'include':[{'model':db[_0xfd1f('0x3c')],'as':_0xfd1f('0x3d'),'include':[{'model':db[_0xfd1f('0x2b')],'as':_0xfd1f('0x3e'),'where':_0x40319d,'limit':0x1,'order':[[_0xfd1f('0x32'),'DESC']]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xfd1f('0x14')](function(_0x551f81){if(_0x551f81&&_0x551f81[_0xfd1f('0x3d')]){var _0x302dda=_0x551f81[_0xfd1f('0x3f')]({'plain':!![]});_0xdf293e[_0xfd1f('0x3b')]=_0x302dda;_0xdf293e['applications']=_0x302dda[_0xfd1f('0x40')];_0xdf293e['list']=_0x302dda[_0xfd1f('0x3d')];_0xdf293e[_0xfd1f('0x41')]=_[_0xfd1f('0x42')](_0xdf293e[_0xfd1f('0x41')],[_0xfd1f('0x43')],[_0xfd1f('0x44')]);if(_0xdf293e['account'][_0xfd1f('0x40')]){delete _0xdf293e['account'][_0xfd1f('0x40')];}if(_0xdf293e['account'][_0xfd1f('0x3d')]&&_0xdf293e[_0xfd1f('0x3b')][_0xfd1f('0x3d')]['Contacts']['length']){return _0xdf293e['account'][_0xfd1f('0x3d')][_0xfd1f('0x3e')][0x0];}var _0x3d802e=_[_0xfd1f('0xe')](_0x16e12a[_0xfd1f('0x29')],{'firstName':_0x16e12a['body'][_0xfd1f('0x36')],'ListId':_0x302dda[_0xfd1f('0x34')]});_0x3d802e[_0x16e12a['body'][_0xfd1f('0x37')]]=_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x36')];return db['CmContact'][_0xfd1f('0x45')](_0x3d802e,{'fields':_0x298a06,'raw':!![]});}})[_0xfd1f('0x14')](function(_0x3a862a){_0xdf293e[_0xfd1f('0x46')]=_0x3a862a;if(_0x3a862a){var _0x38a97a={'ContactId':_0x3a862a['id'],'FaxAccountId':_0x16e12a[_0xfd1f('0x3b')]['id'],'fax':_0x3a862a[_0xfd1f('0x2a')]};return db[_0xfd1f('0x47')][_0xfd1f('0x3a')]({'where':{'ContactId':_0x3a862a['id'],'closed':![],'FaxAccountId':_0x16e12a[_0xfd1f('0x3b')]['id']}})[_0xfd1f('0x14')](function(_0x3de1aa){if(_0x3de1aa){return[_0x3de1aa,![]];}return db[_0xfd1f('0x47')][_0xfd1f('0x45')](_0x38a97a)['then'](function(_0x2d0a0a){return[_0x2d0a0a,!![]];});});}else{throw new Error(_0xfd1f('0x48'));}})[_0xfd1f('0x49')](function(_0x1ded75,_0x2ab687){var _0x39c126=_0x1ded75['get']({'plain':!![]});if(_0x2ab687){if(_0xdf293e[_0xfd1f('0x3b')][_0xfd1f('0x4a')]){_0xdf293e['applications'][_0xfd1f('0x4b')]({'id':0x0,'priority':_0xdf293e[_0xfd1f('0x41')][_0xfd1f('0x4c')]+0x1,'app':'close','appdata':_0xfd1f('0x4d'),'interval':'*,*,*,*'});}_0x39c126[_0xfd1f('0x4e')]=!![];}else{_0x39c126[_0xfd1f('0x4e')]=![];}_0xdf293e[_0xfd1f('0x4f')]=_0x39c126;return db[_0xfd1f('0x50')][_0xfd1f('0x45')]({'body':_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x29')],'FaxAccountId':_0x16e12a[_0xfd1f('0x3b')]['id'],'FaxInteractionId':_0x1ded75['id'],'direction':'in','ContactId':_0x1ded75[_0xfd1f('0x51')],'AttachmentId':_0x16e12a[_0xfd1f('0x29')][_0xfd1f('0x52')]});})['then'](function(_0x568c7f){_0xdf293e[_0xfd1f('0x1c')]=_0x568c7f;if(_0xdf293e[_0xfd1f('0x4f')][_0xfd1f('0x53')]){return db[_0xfd1f('0x54')][_0xfd1f('0x3a')]({'attributes':['id','name'],'where':{'id':_0xdf293e[_0xfd1f('0x4f')][_0xfd1f('0x53')]}})[_0xfd1f('0x14')](function(_0x27eeeb){if(_0x27eeeb){_0xdf293e[_0xfd1f('0x41')][_0xfd1f('0x55')]({'id':0x0,'priority':0x0,'app':_0xfd1f('0x56'),'appdata':_0x27eeeb[_0xfd1f('0x57')]+','+(_0xdf293e[_0xfd1f('0x3b')][_0xfd1f('0x58')]||0xa),'interval':_0xfd1f('0x59')});}return respondWithRpcPromise(_0xfd1f('0x5a'),_0xfd1f('0x5b'),_0xdf293e);});}return respondWithRpcPromise(_0xfd1f('0x5a'),_0xfd1f('0x5b'),_0xdf293e);})[_0xfd1f('0x14')](function(_0x4525b5){_0x3d5594(_0x4525b5);})['catch'](function(_0x3f69c3){_0x32e15d(_0x5a7a75[_0xfd1f('0x1b')](0x1f4,_0x3f69c3[_0xfd1f('0x1c')]));});});};
\ No newline at end of file
index 28f5641..b251428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f18=['faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x3299d1,_0x545733){var _0x44356e=function(_0x52fd77){while(--_0x52fd77){_0x3299d1['push'](_0x3299d1['shift']());}};_0x44356e(++_0x545733);}(_0x4f18,0x196));var _0x84f1=function(_0x43f4bc,_0x44ac06){_0x43f4bc=_0x43f4bc-0x0;var _0x52a310=_0x4f18[_0x43f4bc];return _0x52a310;};'use strict';var FaxAccountEvents=require(_0x84f1('0x0'));var events=[_0x84f1('0x1'),_0x84f1('0x2'),_0x84f1('0x3')];function createListener(_0x1ca49f,_0x407862){return function(_0x599e73){_0x407862[_0x84f1('0x4')](_0x1ca49f,_0x599e73);};}function removeListener(_0x2c5994,_0x1bf59d){return function(){FaxAccountEvents[_0x84f1('0x5')](_0x2c5994,_0x1bf59d);};}exports[_0x84f1('0x6')]=function(_0x92e694){for(var _0x44fd86=0x0,_0xeae2e0=events[_0x84f1('0x7')];_0x44fd86<_0xeae2e0;_0x44fd86++){var _0x33987a=events[_0x44fd86];var _0x373584=createListener(_0x84f1('0x8')+_0x33987a,_0x92e694);FaxAccountEvents['on'](_0x33987a,_0x373584);}};
\ No newline at end of file
+var _0x5745=['emit','register','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x5745,0xab));var _0x5574=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5745[_0x19e35c];return _0x3e1fe8;};'use strict';var FaxAccountEvents=require(_0x5574('0x0'));var events=[_0x5574('0x1'),_0x5574('0x2'),_0x5574('0x3')];function createListener(_0x4de081,_0x3c64a6){return function(_0x271e5b){_0x3c64a6[_0x5574('0x4')](_0x4de081,_0x271e5b);};}function removeListener(_0x3904a0,_0x5c7ada){return function(){FaxAccountEvents['removeListener'](_0x3904a0,_0x5c7ada);};}exports[_0x5574('0x5')]=function(_0x94225e){for(var _0x337432=0x0,_0xe25e6e=events['length'];_0x337432<_0xe25e6e;_0x337432++){var _0x5b38a5=events[_0x337432];var _0x18ae56=createListener(_0x5574('0x6')+_0x5b38a5,_0x94225e);FaxAccountEvents['on'](_0x5b38a5,_0x18ae56);}};
\ No newline at end of file
index 777a9b4..0ef7643 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x135d59,_0x3f9233){var _0xe7e1ab=function(_0x566312){while(--_0x566312){_0x135d59['push'](_0x135d59['shift']());}};_0xe7e1ab(++_0x3f9233);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5db800,_0x9c38a4){var _0x2195d9=function(_0x14ff60){while(--_0x14ff60){_0x5db800['push'](_0x5db800['shift']());}};_0x2195d9(++_0x9c38a4);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index 5ae3ec4..9b723f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac60=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x24a963,_0x454d12){var _0x3d1990=function(_0x470a35){while(--_0x470a35){_0x24a963['push'](_0x24a963['shift']());}};_0x3d1990(++_0x454d12);}(_0xac60,0x137));var _0x0ac6=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xac60[_0x37bd26];return _0xe83dc4;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x0ac6('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x0ac6('0x1')],'allowNull':![],'defaultValue':_0x0ac6('0x2')},'appdata':{'type':Sequelize[_0x0ac6('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0ac6('0x4')}};
\ No newline at end of file
+var _0x5ad9=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0x385e44,_0x25226c){var _0xe3699a=function(_0x2dcc4e){while(--_0x2dcc4e){_0x385e44['push'](_0x385e44['shift']());}};_0xe3699a(++_0x25226c);}(_0x5ad9,0xb1));var _0x95ad=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x5ad9[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x95ad('0x0'));module['exports']={'priority':{'type':Sequelize[_0x95ad('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x95ad('0x2')],'allowNull':![],'defaultValue':_0x95ad('0x3')},'appdata':{'type':Sequelize[_0x95ad('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x95ad('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index c250580..d9140e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2e2=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','save','update','then','end','stack','name','index','map','FaxApplication','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','length'];(function(_0x164af1,_0x3cf772){var _0x5d81a2=function(_0xa57547){while(--_0xa57547){_0x164af1['push'](_0x164af1['shift']());}};_0x5d81a2(++_0x3cf772);}(_0xa2e2,0xe4));var _0x2a2e=function(_0x4ff239,_0x9da7c9){_0x4ff239=_0x4ff239-0x0;var _0x4cdd91=_0xa2e2[_0x4ff239];return _0x4cdd91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2a2e('0x0'));var zipdir=require(_0x2a2e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2a2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2a2e('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x2a2e('0x4'));var ejs=require(_0x2a2e('0x5'));var fs=require('fs');var fs_extra=require(_0x2a2e('0x6'));var _=require(_0x2a2e('0x7'));var squel=require('squel');var crypto=require(_0x2a2e('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x2a2e('0x9'));var toCsv=require(_0x2a2e('0x4'));var querystring=require(_0x2a2e('0xa'));var Papa=require('papaparse');var Redis=require(_0x2a2e('0xb'));var authService=require(_0x2a2e('0xc'));var qs=require(_0x2a2e('0xd'));var as=require(_0x2a2e('0xe'));var hardwareService=require(_0x2a2e('0xf'));var logger=require(_0x2a2e('0x10'))('api');var utils=require(_0x2a2e('0x11'));var config=require(_0x2a2e('0x12'));var licenseUtil=require(_0x2a2e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23e4dd,_0x229e66){_0x229e66=_0x229e66||0xcc;return function(_0x4fb9b6){if(_0x4fb9b6){return _0x23e4dd[_0x2a2e('0x14')](_0x229e66);}return _0x23e4dd['status'](_0x229e66)['end']();};}function respondWithResult(_0x151d97,_0x3dbf0b){_0x3dbf0b=_0x3dbf0b||0xc8;return function(_0x4fbc30){if(_0x4fbc30){return _0x151d97['status'](_0x3dbf0b)[_0x2a2e('0x15')](_0x4fbc30);}};}function respondWithFilteredResult(_0x357ad5,_0x534179){return function(_0x16dec6){if(_0x16dec6){var _0x5de66f=typeof _0x534179[_0x2a2e('0x16')]===_0x2a2e('0x17')&&typeof _0x534179[_0x2a2e('0x18')]===_0x2a2e('0x17');var _0x25b347=_0x16dec6[_0x2a2e('0x19')];var _0x5e81aa=_0x5de66f?0x0:_0x534179['offset'];var _0x4905c7=_0x5de66f?_0x16dec6[_0x2a2e('0x19')]:_0x534179[_0x2a2e('0x16')]+_0x534179['limit'];var _0x13221f;if(_0x4905c7>=_0x25b347){_0x4905c7=_0x25b347;_0x13221f=0xc8;}else{_0x13221f=0xce;}_0x357ad5[_0x2a2e('0x1a')](_0x13221f);return _0x357ad5['set'](_0x2a2e('0x1b'),_0x5e81aa+'-'+_0x4905c7+'/'+_0x25b347)[_0x2a2e('0x15')](_0x16dec6);}return null;};}function patchUpdates(_0x18dc75){return function(_0x4cc07d){try{jsonpatch[_0x2a2e('0x1c')](_0x4cc07d,_0x18dc75,!![]);}catch(_0x37fbeb){return BPromise['reject'](_0x37fbeb);}return _0x4cc07d[_0x2a2e('0x1d')]();};}function saveUpdates(_0x5ceb24,_0xc17988){return function(_0x543408){if(_0x543408){return _0x543408[_0x2a2e('0x1e')](_0x5ceb24)[_0x2a2e('0x1f')](function(_0x3d5888){return _0x3d5888;});}return null;};}function removeEntity(_0x2089f0,_0x481646){return function(_0x49ef84){if(_0x49ef84){return _0x49ef84['destroy']()[_0x2a2e('0x1f')](function(){_0x2089f0[_0x2a2e('0x1a')](0xcc)[_0x2a2e('0x20')]();});}};}function handleEntityNotFound(_0x33ad4f,_0x60eb77){return function(_0x58ee34){if(!_0x58ee34){_0x33ad4f[_0x2a2e('0x14')](0x194);}return _0x58ee34;};}function handleError(_0x4700a3,_0x59f78e){_0x59f78e=_0x59f78e||0x1f4;return function(_0x2555fa){logger['error'](_0x2555fa[_0x2a2e('0x21')]);if(_0x2555fa[_0x2a2e('0x22')]){delete _0x2555fa[_0x2a2e('0x22')];}_0x4700a3['status'](_0x59f78e)['send'](_0x2555fa);};}exports[_0x2a2e('0x23')]=function(_0x4537ed,_0x2bb565){var _0x58ff05={},_0x3225ce={},_0xd6064={'count':0x0,'rows':[]};var _0x40a9a2=_[_0x2a2e('0x24')](db[_0x2a2e('0x25')][_0x2a2e('0x26')],function(_0x32a756){return{'name':_0x32a756[_0x2a2e('0x27')],'type':_0x32a756['type']['key']};});_0x3225ce['model']=_[_0x2a2e('0x24')](_0x40a9a2,_0x2a2e('0x22'));_0x3225ce[_0x2a2e('0x28')]=_[_0x2a2e('0x29')](_0x4537ed['query']);_0x3225ce[_0x2a2e('0x2a')]=_['intersection'](_0x3225ce[_0x2a2e('0x2b')],_0x3225ce['query']);_0x58ff05[_0x2a2e('0x2c')]=_[_0x2a2e('0x2d')](_0x3225ce[_0x2a2e('0x2b')],qs[_0x2a2e('0x2e')](_0x4537ed[_0x2a2e('0x28')]['fields']));_0x58ff05[_0x2a2e('0x2c')]=_0x58ff05[_0x2a2e('0x2c')][_0x2a2e('0x2f')]?_0x58ff05[_0x2a2e('0x2c')]:_0x3225ce[_0x2a2e('0x2b')];if(!_0x4537ed[_0x2a2e('0x28')][_0x2a2e('0x30')](_0x2a2e('0x31'))){_0x58ff05['limit']=qs['limit'](_0x4537ed['query'][_0x2a2e('0x18')]);_0x58ff05[_0x2a2e('0x16')]=qs[_0x2a2e('0x16')](_0x4537ed[_0x2a2e('0x28')]['offset']);}_0x58ff05[_0x2a2e('0x32')]=qs[_0x2a2e('0x33')](_0x4537ed[_0x2a2e('0x28')][_0x2a2e('0x33')]);_0x58ff05[_0x2a2e('0x34')]=qs['filters'](_[_0x2a2e('0x35')](_0x4537ed['query'],_0x3225ce[_0x2a2e('0x2a')]),_0x40a9a2);if(_0x4537ed[_0x2a2e('0x28')][_0x2a2e('0x36')]){_0x58ff05[_0x2a2e('0x34')]=_[_0x2a2e('0x37')](_0x58ff05['where'],{'$or':_[_0x2a2e('0x24')](_0x40a9a2,function(_0x1ebfd7){if(_0x1ebfd7[_0x2a2e('0x38')]!==_0x2a2e('0x39')){var _0x55c822={};_0x55c822[_0x1ebfd7[_0x2a2e('0x22')]]={'$like':'%'+_0x4537ed[_0x2a2e('0x28')][_0x2a2e('0x36')]+'%'};return _0x55c822;}})});}_0x58ff05=_[_0x2a2e('0x37')]({},_0x58ff05,_0x4537ed[_0x2a2e('0x3a')]);var _0x4ebb3b={'where':_0x58ff05[_0x2a2e('0x34')]};return db['FaxApplication'][_0x2a2e('0x19')](_0x4ebb3b)[_0x2a2e('0x1f')](function(_0x2cc6a5){_0xd6064[_0x2a2e('0x19')]=_0x2cc6a5;if(_0x4537ed[_0x2a2e('0x28')][_0x2a2e('0x3b')]){_0x58ff05[_0x2a2e('0x3c')]=[{'all':!![]}];}return db[_0x2a2e('0x25')][_0x2a2e('0x3d')](_0x58ff05);})['then'](function(_0x2be70d){_0xd6064['rows']=_0x2be70d;return _0xd6064;})[_0x2a2e('0x1f')](respondWithFilteredResult(_0x2bb565,_0x58ff05))[_0x2a2e('0x3e')](handleError(_0x2bb565,null));};exports[_0x2a2e('0x3f')]=function(_0x2543e9,_0x48e2eb){var _0x1a1897={'raw':!![],'where':{'id':_0x2543e9[_0x2a2e('0x40')]['id']}},_0x368990={};_0x368990[_0x2a2e('0x2b')]=_[_0x2a2e('0x29')](db[_0x2a2e('0x25')][_0x2a2e('0x26')]);_0x368990[_0x2a2e('0x28')]=_['keys'](_0x2543e9[_0x2a2e('0x28')]);_0x368990[_0x2a2e('0x2a')]=_[_0x2a2e('0x2d')](_0x368990[_0x2a2e('0x2b')],_0x368990['query']);_0x1a1897[_0x2a2e('0x2c')]=_[_0x2a2e('0x2d')](_0x368990[_0x2a2e('0x2b')],qs['fields'](_0x2543e9[_0x2a2e('0x28')][_0x2a2e('0x2e')]));_0x1a1897[_0x2a2e('0x2c')]=_0x1a1897[_0x2a2e('0x2c')]['length']?_0x1a1897['attributes']:_0x368990['model'];if(_0x2543e9[_0x2a2e('0x28')][_0x2a2e('0x3b')]){_0x1a1897[_0x2a2e('0x3c')]=[{'all':!![]}];}_0x1a1897=_['merge']({},_0x1a1897,_0x2543e9[_0x2a2e('0x3a')]);return db[_0x2a2e('0x25')][_0x2a2e('0x41')](_0x1a1897)[_0x2a2e('0x1f')](handleEntityNotFound(_0x48e2eb,null))[_0x2a2e('0x1f')](respondWithResult(_0x48e2eb,null))[_0x2a2e('0x3e')](handleError(_0x48e2eb,null));};exports[_0x2a2e('0x42')]=function(_0x3196e8,_0x35bf49){return db[_0x2a2e('0x25')][_0x2a2e('0x42')](_0x3196e8[_0x2a2e('0x43')],{})[_0x2a2e('0x1f')](respondWithResult(_0x35bf49,0xc9))[_0x2a2e('0x3e')](handleError(_0x35bf49,null));};exports['update']=function(_0x28f309,_0x311902){if(_0x28f309[_0x2a2e('0x43')]['id']){delete _0x28f309['body']['id'];}return db['FaxApplication'][_0x2a2e('0x41')]({'where':{'id':_0x28f309[_0x2a2e('0x40')]['id']}})[_0x2a2e('0x1f')](handleEntityNotFound(_0x311902,null))[_0x2a2e('0x1f')](saveUpdates(_0x28f309[_0x2a2e('0x43')],null))['then'](respondWithResult(_0x311902,null))[_0x2a2e('0x3e')](handleError(_0x311902,null));};exports[_0x2a2e('0x44')]=function(_0x21d0a3,_0x35c255){return db[_0x2a2e('0x25')][_0x2a2e('0x41')]({'where':{'id':_0x21d0a3[_0x2a2e('0x40')]['id']}})[_0x2a2e('0x1f')](handleEntityNotFound(_0x35c255,null))[_0x2a2e('0x1f')](removeEntity(_0x35c255,null))[_0x2a2e('0x3e')](handleError(_0x35c255,null));};
\ No newline at end of file
+var _0x4725=['stack','name','send','index','FaxApplication','type','key','model','map','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','catch','eml-format','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x125f68,_0x24093e){var _0x2b1a85=function(_0x2db573){while(--_0x2db573){_0x125f68['push'](_0x125f68['shift']());}};_0x2b1a85(++_0x24093e);}(_0x4725,0xb7));var _0x5472=function(_0x33c23d,_0xd2208a){_0x33c23d=_0x33c23d-0x0;var _0x62db8a=_0x4725[_0x33c23d];return _0x62db8a;};'use strict';var emlformat=require(_0x5472('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5472('0x1'));var moment=require(_0x5472('0x2'));var BPromise=require(_0x5472('0x3'));var Mustache=require('mustache');var util=require(_0x5472('0x4'));var path=require(_0x5472('0x5'));var sox=require(_0x5472('0x6'));var csv=require(_0x5472('0x7'));var ejs=require(_0x5472('0x8'));var fs=require('fs');var fs_extra=require(_0x5472('0x9'));var _=require('lodash');var squel=require(_0x5472('0xa'));var crypto=require('crypto');var jsforce=require(_0x5472('0xb'));var deskjs=require(_0x5472('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5472('0xd'));var Papa=require(_0x5472('0xe'));var Redis=require(_0x5472('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5472('0x10'));var as=require(_0x5472('0x11'));var hardwareService=require(_0x5472('0x12'));var logger=require('../../config/logger')(_0x5472('0x13'));var utils=require(_0x5472('0x14'));var config=require(_0x5472('0x15'));var licenseUtil=require(_0x5472('0x16'));var db=require(_0x5472('0x17'))['db'];function respondWithStatusCode(_0x1bf7fc,_0x50f76d){_0x50f76d=_0x50f76d||0xcc;return function(_0x12c172){if(_0x12c172){return _0x1bf7fc[_0x5472('0x18')](_0x50f76d);}return _0x1bf7fc[_0x5472('0x19')](_0x50f76d)[_0x5472('0x1a')]();};}function respondWithResult(_0x359f52,_0x1157ad){_0x1157ad=_0x1157ad||0xc8;return function(_0xc37141){if(_0xc37141){return _0x359f52[_0x5472('0x19')](_0x1157ad)['json'](_0xc37141);}};}function respondWithFilteredResult(_0x158792,_0x523fbe){return function(_0x5d3d6a){if(_0x5d3d6a){var _0x5bb86c=typeof _0x523fbe[_0x5472('0x1b')]==='undefined'&&typeof _0x523fbe[_0x5472('0x1c')]==='undefined';var _0x5d02ed=_0x5d3d6a['count'];var _0x14c834=_0x5bb86c?0x0:_0x523fbe[_0x5472('0x1b')];var _0x5b5c10=_0x5bb86c?_0x5d3d6a[_0x5472('0x1d')]:_0x523fbe[_0x5472('0x1b')]+_0x523fbe['limit'];var _0x5b432c;if(_0x5b5c10>=_0x5d02ed){_0x5b5c10=_0x5d02ed;_0x5b432c=0xc8;}else{_0x5b432c=0xce;}_0x158792[_0x5472('0x19')](_0x5b432c);return _0x158792[_0x5472('0x1e')](_0x5472('0x1f'),_0x14c834+'-'+_0x5b5c10+'/'+_0x5d02ed)[_0x5472('0x20')](_0x5d3d6a);}return null;};}function patchUpdates(_0x5c91dc){return function(_0xd54f9a){try{jsonpatch[_0x5472('0x21')](_0xd54f9a,_0x5c91dc,!![]);}catch(_0x5d5757){return BPromise[_0x5472('0x22')](_0x5d5757);}return _0xd54f9a[_0x5472('0x23')]();};}function saveUpdates(_0x53e1b9,_0x3b6edc){return function(_0x3fc7f5){if(_0x3fc7f5){return _0x3fc7f5[_0x5472('0x24')](_0x53e1b9)[_0x5472('0x25')](function(_0x5d4773){return _0x5d4773;});}return null;};}function removeEntity(_0x12ddd,_0x2133ba){return function(_0x41c036){if(_0x41c036){return _0x41c036[_0x5472('0x26')]()[_0x5472('0x25')](function(){_0x12ddd[_0x5472('0x19')](0xcc)[_0x5472('0x1a')]();});}};}function handleEntityNotFound(_0x479e7f,_0x4274e7){return function(_0x1a6d94){if(!_0x1a6d94){_0x479e7f[_0x5472('0x18')](0x194);}return _0x1a6d94;};}function handleError(_0x131a1f,_0x2fdce3){_0x2fdce3=_0x2fdce3||0x1f4;return function(_0x480d02){logger['error'](_0x480d02[_0x5472('0x27')]);if(_0x480d02[_0x5472('0x28')]){delete _0x480d02[_0x5472('0x28')];}_0x131a1f[_0x5472('0x19')](_0x2fdce3)[_0x5472('0x29')](_0x480d02);};}exports[_0x5472('0x2a')]=function(_0x156167,_0x39cf9){var _0x13fa71={},_0x4f1594={},_0x366d93={'count':0x0,'rows':[]};var _0x1c9f34=_['map'](db[_0x5472('0x2b')]['rawAttributes'],function(_0x4c14da){return{'name':_0x4c14da['fieldName'],'type':_0x4c14da[_0x5472('0x2c')][_0x5472('0x2d')]};});_0x4f1594[_0x5472('0x2e')]=_[_0x5472('0x2f')](_0x1c9f34,_0x5472('0x28'));_0x4f1594[_0x5472('0x30')]=_[_0x5472('0x31')](_0x156167['query']);_0x4f1594['filters']=_['intersection'](_0x4f1594[_0x5472('0x2e')],_0x4f1594[_0x5472('0x30')]);_0x13fa71['attributes']=_[_0x5472('0x32')](_0x4f1594['model'],qs[_0x5472('0x33')](_0x156167[_0x5472('0x30')][_0x5472('0x33')]));_0x13fa71[_0x5472('0x34')]=_0x13fa71[_0x5472('0x34')]['length']?_0x13fa71['attributes']:_0x4f1594[_0x5472('0x2e')];if(!_0x156167[_0x5472('0x30')][_0x5472('0x35')](_0x5472('0x36'))){_0x13fa71[_0x5472('0x1c')]=qs[_0x5472('0x1c')](_0x156167[_0x5472('0x30')][_0x5472('0x1c')]);_0x13fa71[_0x5472('0x1b')]=qs['offset'](_0x156167[_0x5472('0x30')][_0x5472('0x1b')]);}_0x13fa71[_0x5472('0x37')]=qs['sort'](_0x156167[_0x5472('0x30')][_0x5472('0x38')]);_0x13fa71['where']=qs[_0x5472('0x39')](_[_0x5472('0x3a')](_0x156167[_0x5472('0x30')],_0x4f1594[_0x5472('0x39')]),_0x1c9f34);if(_0x156167['query'][_0x5472('0x3b')]){_0x13fa71[_0x5472('0x3c')]=_[_0x5472('0x3d')](_0x13fa71[_0x5472('0x3c')],{'$or':_[_0x5472('0x2f')](_0x1c9f34,function(_0x25da7c){if(_0x25da7c[_0x5472('0x2c')]!=='VIRTUAL'){var _0x37dfce={};_0x37dfce[_0x25da7c[_0x5472('0x28')]]={'$like':'%'+_0x156167['query'][_0x5472('0x3b')]+'%'};return _0x37dfce;}})});}_0x13fa71=_[_0x5472('0x3d')]({},_0x13fa71,_0x156167[_0x5472('0x3e')]);var _0x35c973={'where':_0x13fa71['where']};return db['FaxApplication'][_0x5472('0x1d')](_0x35c973)[_0x5472('0x25')](function(_0x580b03){_0x366d93[_0x5472('0x1d')]=_0x580b03;if(_0x156167[_0x5472('0x30')][_0x5472('0x3f')]){_0x13fa71[_0x5472('0x40')]=[{'all':!![]}];}return db[_0x5472('0x2b')][_0x5472('0x41')](_0x13fa71);})['then'](function(_0x4c20af){_0x366d93[_0x5472('0x42')]=_0x4c20af;return _0x366d93;})[_0x5472('0x25')](respondWithFilteredResult(_0x39cf9,_0x13fa71))['catch'](handleError(_0x39cf9,null));};exports[_0x5472('0x43')]=function(_0x41ad9b,_0x3ee359){var _0xa51cc9={'raw':!![],'where':{'id':_0x41ad9b[_0x5472('0x44')]['id']}},_0x2b3899={};_0x2b3899[_0x5472('0x2e')]=_[_0x5472('0x31')](db[_0x5472('0x2b')][_0x5472('0x45')]);_0x2b3899['query']=_['keys'](_0x41ad9b[_0x5472('0x30')]);_0x2b3899[_0x5472('0x39')]=_[_0x5472('0x32')](_0x2b3899['model'],_0x2b3899['query']);_0xa51cc9[_0x5472('0x34')]=_[_0x5472('0x32')](_0x2b3899[_0x5472('0x2e')],qs['fields'](_0x41ad9b[_0x5472('0x30')][_0x5472('0x33')]));_0xa51cc9[_0x5472('0x34')]=_0xa51cc9['attributes']['length']?_0xa51cc9['attributes']:_0x2b3899[_0x5472('0x2e')];if(_0x41ad9b[_0x5472('0x30')][_0x5472('0x3f')]){_0xa51cc9[_0x5472('0x40')]=[{'all':!![]}];}_0xa51cc9=_[_0x5472('0x3d')]({},_0xa51cc9,_0x41ad9b[_0x5472('0x3e')]);return db[_0x5472('0x2b')][_0x5472('0x46')](_0xa51cc9)[_0x5472('0x25')](handleEntityNotFound(_0x3ee359,null))[_0x5472('0x25')](respondWithResult(_0x3ee359,null))['catch'](handleError(_0x3ee359,null));};exports[_0x5472('0x47')]=function(_0x280652,_0x2fa6d7){return db[_0x5472('0x2b')][_0x5472('0x47')](_0x280652[_0x5472('0x48')],{})[_0x5472('0x25')](respondWithResult(_0x2fa6d7,0xc9))[_0x5472('0x49')](handleError(_0x2fa6d7,null));};exports[_0x5472('0x24')]=function(_0x98a33e,_0x393ec6){if(_0x98a33e[_0x5472('0x48')]['id']){delete _0x98a33e[_0x5472('0x48')]['id'];}return db[_0x5472('0x2b')][_0x5472('0x46')]({'where':{'id':_0x98a33e[_0x5472('0x44')]['id']}})[_0x5472('0x25')](handleEntityNotFound(_0x393ec6,null))[_0x5472('0x25')](saveUpdates(_0x98a33e['body'],null))[_0x5472('0x25')](respondWithResult(_0x393ec6,null))[_0x5472('0x49')](handleError(_0x393ec6,null));};exports[_0x5472('0x26')]=function(_0x33a10e,_0x194590){return db[_0x5472('0x2b')][_0x5472('0x46')]({'where':{'id':_0x33a10e[_0x5472('0x44')]['id']}})[_0x5472('0x25')](handleEntityNotFound(_0x194590,null))[_0x5472('0x25')](removeEntity(_0x194590,null))['catch'](handleError(_0x194590,null));};
\ No newline at end of file
index 3cc45d2..d2a5018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8bd=['api','bluebird','request-promise','exports','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xd86b61,_0x14b8f1){var _0x48c96b=function(_0x7fb805){while(--_0x7fb805){_0xd86b61['push'](_0xd86b61['shift']());}};_0x48c96b(++_0x14b8f1);}(_0xb8bd,0x16e));var _0xdb8b=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xb8bd[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xdb8b('0x0'));var util=require(_0xdb8b('0x1'));var logger=require('../../config/logger')(_0xdb8b('0x2'));var moment=require('moment');var BPromise=require(_0xdb8b('0x3'));var rp=require(_0xdb8b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0xdb8b('0x5')]=function(_0x6eeb40,_0x4fce8c){return _0x6eeb40['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb8b('0x6'),'collate':_0xdb8b('0x7')});};
\ No newline at end of file
+var _0x66b3=['../../config/logger','api','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','utf8mb4_unicode_ci','util'];(function(_0x5d72da,_0xb7ce32){var _0x43ebe7=function(_0x503755){while(--_0x503755){_0x5d72da['push'](_0x5d72da['shift']());}};_0x43ebe7(++_0xb7ce32);}(_0x66b3,0x16a));var _0x366b=function(_0x7cbbf3,_0x3ebfd8){_0x7cbbf3=_0x7cbbf3-0x0;var _0x155763=_0x66b3[_0x7cbbf3];return _0x155763;};'use strict';var _=require('lodash');var util=require(_0x366b('0x0'));var logger=require(_0x366b('0x1'))(_0x366b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x366b('0x3'));var rimraf=require(_0x366b('0x4'));var config=require(_0x366b('0x5'));var attributes=require(_0x366b('0x6'));module[_0x366b('0x7')]=function(_0x3c3df9,_0x4edc4a){return _0x3c3df9[_0x366b('0x8')](_0x366b('0x9'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x366b('0xa')});};
\ No newline at end of file
index 9d7642c..caf9477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a98=['body','options','raw','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxApplication','update'];(function(_0x2ecad3,_0x2a3913){var _0x2fb4db=function(_0x528c60){while(--_0x528c60){_0x2ecad3['push'](_0x2ecad3['shift']());}};_0x2fb4db(++_0x2a3913);}(_0x4a98,0x1a5));var _0x84a9=function(_0x11ad65,_0x352d3c){_0x11ad65=_0x11ad65-0x0;var _0x35590c=_0x4a98[_0x11ad65];return _0x35590c;};'use strict';var _=require('lodash');var util=require(_0x84a9('0x0'));var moment=require(_0x84a9('0x1'));var BPromise=require(_0x84a9('0x2'));var rs=require(_0x84a9('0x3'));var fs=require('fs');var Redis=require(_0x84a9('0x4'));var db=require(_0x84a9('0x5'))['db'];var utils=require(_0x84a9('0x6'));var logger=require(_0x84a9('0x7'))(_0x84a9('0x8'));var config=require(_0x84a9('0x9'));var jayson=require(_0x84a9('0xa'));var client=jayson['client'][_0x84a9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3994fd,_0x179915,_0xa2a4cd){return new BPromise(function(_0x5b8296,_0x380506){return client[_0x84a9('0xc')](_0x3994fd,_0xa2a4cd)[_0x84a9('0xd')](function(_0x58b53f){logger[_0x84a9('0xe')](_0x84a9('0xf'),_0x179915,_0x84a9('0x10'));logger[_0x84a9('0x11')](_0x84a9('0x12'),_0x179915,_0x84a9('0x10'),JSON[_0x84a9('0x13')](_0x58b53f));if(_0x58b53f[_0x84a9('0x14')]){if(_0x58b53f[_0x84a9('0x14')][_0x84a9('0x15')]===0x1f4){logger['error'](_0x84a9('0xf'),_0x179915,_0x58b53f['error']['message']);return _0x380506(_0x58b53f['error'][_0x84a9('0x16')]);}logger[_0x84a9('0x14')](_0x84a9('0xf'),_0x179915,_0x58b53f[_0x84a9('0x14')][_0x84a9('0x16')]);return _0x5b8296(_0x58b53f[_0x84a9('0x14')][_0x84a9('0x16')]);}else{logger['info'](_0x84a9('0xf'),_0x179915,_0x84a9('0x10'));_0x5b8296(_0x58b53f[_0x84a9('0x17')]['message']);}})[_0x84a9('0x18')](function(_0x2b5ae8){logger[_0x84a9('0x14')](_0x84a9('0xf'),_0x179915,_0x2b5ae8);_0x380506(_0x2b5ae8);});});}exports['UpdateFaxApplication']=function(_0x3d63ca){var _0x5c3fd8=this;return new Promise(function(_0x3be0c9,_0x43fcfc){return db[_0x84a9('0x19')][_0x84a9('0x1a')](_0x3d63ca[_0x84a9('0x1b')],{'raw':_0x3d63ca['options']?_0x3d63ca[_0x84a9('0x1c')][_0x84a9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d63ca['options']?_0x3d63ca[_0x84a9('0x1c')]['where']||null:null,'attributes':_0x3d63ca[_0x84a9('0x1c')]?_0x3d63ca[_0x84a9('0x1c')][_0x84a9('0x1e')]||null:null,'limit':_0x3d63ca[_0x84a9('0x1c')]?_0x3d63ca[_0x84a9('0x1c')][_0x84a9('0x1f')]||null:null})['then'](function(_0x4336e3){logger[_0x84a9('0xe')]('UpdateFaxApplication',_0x3d63ca);logger['debug']('UpdateFaxApplication',_0x3d63ca,JSON[_0x84a9('0x13')](_0x4336e3));_0x3be0c9(_0x4336e3);})[_0x84a9('0x18')](function(_0x193700){logger['error']('UpdateFaxApplication',_0x193700[_0x84a9('0x16')],_0x3d63ca);_0x43fcfc(_0x5c3fd8[_0x84a9('0x14')](0x1f4,_0x193700[_0x84a9('0x16')]));});});};
\ No newline at end of file
+var _0x6143=['request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','limit','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53ee38,_0x7ccc5c){var _0xa65ff7=function(_0x44707b){while(--_0x44707b){_0x53ee38['push'](_0x53ee38['shift']());}};_0xa65ff7(++_0x7ccc5c);}(_0x6143,0x135));var _0x3614=function(_0x2e883b,_0xda8baf){_0x2e883b=_0x2e883b-0x0;var _0x2e2257=_0x6143[_0x2e883b];return _0x2e2257;};'use strict';var _=require('lodash');var util=require(_0x3614('0x0'));var moment=require('moment');var BPromise=require(_0x3614('0x1'));var rs=require(_0x3614('0x2'));var fs=require('fs');var Redis=require(_0x3614('0x3'));var db=require(_0x3614('0x4'))['db'];var utils=require(_0x3614('0x5'));var logger=require(_0x3614('0x6'))(_0x3614('0x7'));var config=require(_0x3614('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3614('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50e088,_0x28749a,_0x35e534){return new BPromise(function(_0x435111,_0x436a6a){return client[_0x3614('0xa')](_0x50e088,_0x35e534)[_0x3614('0xb')](function(_0x251c1c){logger[_0x3614('0xc')](_0x3614('0xd'),_0x28749a,_0x3614('0xe'));logger[_0x3614('0xf')](_0x3614('0x10'),_0x28749a,_0x3614('0xe'),JSON[_0x3614('0x11')](_0x251c1c));if(_0x251c1c[_0x3614('0x12')]){if(_0x251c1c['error'][_0x3614('0x13')]===0x1f4){logger['error'](_0x3614('0xd'),_0x28749a,_0x251c1c['error'][_0x3614('0x14')]);return _0x436a6a(_0x251c1c[_0x3614('0x12')]['message']);}logger[_0x3614('0x12')]('FaxApplication,\x20%s,\x20%s',_0x28749a,_0x251c1c[_0x3614('0x12')][_0x3614('0x14')]);return _0x435111(_0x251c1c[_0x3614('0x12')][_0x3614('0x14')]);}else{logger[_0x3614('0xc')](_0x3614('0xd'),_0x28749a,_0x3614('0xe'));_0x435111(_0x251c1c['result'][_0x3614('0x14')]);}})[_0x3614('0x15')](function(_0x4dc9c0){logger[_0x3614('0x12')](_0x3614('0xd'),_0x28749a,_0x4dc9c0);_0x436a6a(_0x4dc9c0);});});}exports[_0x3614('0x16')]=function(_0x2cc5da){var _0x408ceb=this;return new Promise(function(_0x47041c,_0x19ed4f){return db[_0x3614('0x17')][_0x3614('0x18')](_0x2cc5da[_0x3614('0x19')],{'raw':_0x2cc5da['options']?_0x2cc5da[_0x3614('0x1a')][_0x3614('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cc5da[_0x3614('0x1a')]?_0x2cc5da[_0x3614('0x1a')]['where']||null:null,'attributes':_0x2cc5da[_0x3614('0x1a')]?_0x2cc5da[_0x3614('0x1a')]['attributes']||null:null,'limit':_0x2cc5da[_0x3614('0x1a')]?_0x2cc5da[_0x3614('0x1a')][_0x3614('0x1c')]||null:null})['then'](function(_0x202bea){logger['info']('UpdateFaxApplication',_0x2cc5da);logger[_0x3614('0xf')](_0x3614('0x16'),_0x2cc5da,JSON[_0x3614('0x11')](_0x202bea));_0x47041c(_0x202bea);})[_0x3614('0x15')](function(_0x350343){logger[_0x3614('0x12')](_0x3614('0x16'),_0x350343[_0x3614('0x14')],_0x2cc5da);_0x19ed4f(_0x408ceb[_0x3614('0x12')](0x1f4,_0x350343[_0x3614('0x14')]));});});};
\ No newline at end of file
index 584cd66..1405982 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['../../components/auth/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','connect-timeout','Router'];(function(_0x3c8c75,_0x3b563a){var _0x275fb9=function(_0x287409){while(--_0x287409){_0x3c8c75['push'](_0x3c8c75['shift']());}};_0x275fb9(++_0x3b563a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x161655,_0x1054a0){_0x161655=_0x161655-0x0;var _0x44df19=_0xd4a2[_0x161655];return _0x44df19;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0xb')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0xd')](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0xf')](_0x2d4a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x2d4a('0x10')]=router;
\ No newline at end of file
+var _0x0598=['../../components/auth/service','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x0598,0x92));var _0x8059=function(_0x25cf7b,_0xa69ccc){_0x25cf7b=_0x25cf7b-0x0;var _0x2779f5=_0x0598[_0x25cf7b];return _0x2779f5;};'use strict';var multer=require(_0x8059('0x0'));var util=require(_0x8059('0x1'));var path=require('path');var timeout=require(_0x8059('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8059('0x3'));var auth=require(_0x8059('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxApplication.controller');router[_0x8059('0x5')]('/',auth[_0x8059('0x6')](),controller['index']);router['get'](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0x8')]);router[_0x8059('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8059('0xa')](_0x8059('0x7'),auth[_0x8059('0x6')](),controller[_0x8059('0xb')]);router[_0x8059('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x8059('0xd')]);module[_0x8059('0xe')]=router;
\ No newline at end of file
index c37244f..4a09332 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72d3=['sequelize','STRING','DATE','ENUM','out'];(function(_0x1275ca,_0x3bd8a0){var _0x473a9d=function(_0x5b1b56){while(--_0x5b1b56){_0x1275ca['push'](_0x1275ca['shift']());}};_0x473a9d(++_0x3bd8a0);}(_0x72d3,0xaa));var _0x372d=function(_0x1f6437,_0x59ef95){_0x1f6437=_0x1f6437-0x0;var _0x19d158=_0x72d3[_0x1f6437];return _0x19d158;};'use strict';var Sequelize=require(_0x372d('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x372d('0x1')]},'secondDisposition':{'type':Sequelize[_0x372d('0x1')]},'thirdDisposition':{'type':Sequelize[_0x372d('0x1')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x372d('0x2')]},'fax':{'type':Sequelize[_0x372d('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x372d('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x372d('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x372d('0x3')]('in',_0x372d('0x4')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x19ac=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x19ac,0xc9));var _0xc19a=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x19ac[_0x9c2427];return _0x51984f;};'use strict';var Sequelize=require(_0xc19a('0x0'));module[_0xc19a('0x1')]={'closed':{'type':Sequelize[_0xc19a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc19a('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc19a('0x4')]},'note':{'type':Sequelize[_0xc19a('0x4')]},'read1stAt':{'type':Sequelize[_0xc19a('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xc19a('0x5')]('in',_0xc19a('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc19a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xc19a('0x5')]('in',_0xc19a('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index c38b39c..3bda464 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b2=['redis','localhost','./faxInteraction.socket','register','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','getOptions','fax','query','show','params','model','keys','FaxInteraction','filters','attributes','fields','length','include','merge','options','find','catch','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','intersection','nolimit','order','sort','where','pick','FaxInteractionId','$gte','split','format','includeAll','spread','Tag','findAll','color','faxInteractionTags:save','removeTags','unix','root','server','join','files','attachments','push','Attachment','createdAt','Messages','existsSync','createReadStream','pipe','createWriteStream','basename','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','path','lodash','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','defaults'];(function(_0x3ef2d5,_0x423d46){var _0x2fefb2=function(_0x54f82f){while(--_0x54f82f){_0x3ef2d5['push'](_0x3ef2d5['shift']());}};_0x2fefb2(++_0x423d46);}(_0x50b2,0x11a));var _0x250b=function(_0x59ce68,_0x98d1b5){_0x59ce68=_0x59ce68-0x0;var _0x37c816=_0x50b2[_0x59ce68];return _0x37c816;};'use strict';var rimraf=require(_0x250b('0x0'));var zipdir=require(_0x250b('0x1'));var moment=require(_0x250b('0x2'));var BPromise=require(_0x250b('0x3'));var util=require('util');var path=require(_0x250b('0x4'));var fs=require('fs');var _=require(_0x250b('0x5'));var Redis=require('ioredis');var interaction=require(_0x250b('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x250b('0x7'))(_0x250b('0x8'));var config=require(_0x250b('0x9'));var db=require(_0x250b('0xa'))['db'];config['redis']=_[_0x250b('0xb')](config[_0x250b('0xc')],{'host':_0x250b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x250b('0xc')]));require(_0x250b('0xe'))[_0x250b('0xf')](socket);function respondWithStatusCode(_0x5936c1,_0x1d491c){_0x1d491c=_0x1d491c||0xcc;return function(_0x48685f){if(_0x48685f){return _0x5936c1[_0x250b('0x10')](_0x1d491c);}return _0x5936c1['status'](_0x1d491c)[_0x250b('0x11')]();};}function respondWithResult(_0x36ec71,_0x54ca0a){_0x54ca0a=_0x54ca0a||0xc8;return function(_0xc88076){if(_0xc88076){return _0x36ec71[_0x250b('0x12')](_0x54ca0a)[_0x250b('0x13')](_0xc88076);}};}function respondWithFilteredResult(_0x1673ed,_0x1f5aaf){return function(_0x8f561f){if(_0x8f561f){var _0x2061a3=typeof _0x1f5aaf['offset']==='undefined'&&typeof _0x1f5aaf[_0x250b('0x14')]===_0x250b('0x15');var _0x5d2205=_0x8f561f[_0x250b('0x16')];var _0x5e9221=_0x2061a3?0x0:_0x1f5aaf['offset'];var _0x50be11=_0x2061a3?_0x8f561f[_0x250b('0x16')]:_0x1f5aaf[_0x250b('0x17')]+_0x1f5aaf[_0x250b('0x14')];var _0x2995a4;if(_0x50be11>=_0x5d2205){_0x50be11=_0x5d2205;_0x2995a4=0xc8;}else{_0x2995a4=0xce;}_0x1673ed[_0x250b('0x12')](_0x2995a4);return _0x1673ed['set'](_0x250b('0x18'),_0x5e9221+'-'+_0x50be11+'/'+_0x5d2205)[_0x250b('0x13')](_0x8f561f);}return null;};}function saveUpdates(_0x374cf3){return function(_0x1b0bd6){if(_0x1b0bd6){return _0x1b0bd6[_0x250b('0x19')](_0x374cf3)[_0x250b('0x1a')](function(_0x51b268){return _0x51b268;});}return null;};}function removeEntity(_0x2d11f6){return function(_0x19e594){if(_0x19e594){return _0x19e594[_0x250b('0x1b')]()[_0x250b('0x1a')](function(){_0x2d11f6[_0x250b('0x12')](0xcc)[_0x250b('0x11')]();});}};}function handleEntityNotFound(_0x288c43){return function(_0x93a08e){if(!_0x93a08e){_0x288c43[_0x250b('0x10')](0x194);}return _0x93a08e;};}function handleError(_0x36d976,_0x31400a){_0x31400a=_0x31400a||0x1f4;return function(_0x4b8dd4){logger[_0x250b('0x1c')](_0x4b8dd4[_0x250b('0x1d')]);if(_0x4b8dd4[_0x250b('0x1e')]){delete _0x4b8dd4[_0x250b('0x1e')];}_0x36d976[_0x250b('0x12')](_0x31400a)[_0x250b('0x1f')](_0x4b8dd4);};}exports[_0x250b('0x20')]=function(_0x1de92d,_0x5a9603){var _0x117ebb={};var _0x40be42=_[_0x250b('0x21')](db['FaxInteraction'][_0x250b('0x22')],function(_0x359489){return{'name':_0x359489[_0x250b('0x23')],'type':_0x359489[_0x250b('0x24')]['key']};});_0x117ebb=qs[_0x250b('0x25')](_0x40be42,_0x1de92d);return interaction['findAll'](_0x250b('0x26'),_0x1de92d[_0x250b('0x27')],_0x1de92d['user'],_0x117ebb,_0x40be42)[_0x250b('0x1a')](respondWithFilteredResult(_0x5a9603,_0x117ebb))['catch'](handleError(_0x5a9603,null));};exports[_0x250b('0x28')]=function(_0x413762,_0x4d5eed){var _0x4743e7={'raw':![],'where':{'id':_0x413762[_0x250b('0x29')]['id']}},_0x599c88={};_0x599c88[_0x250b('0x2a')]=_[_0x250b('0x2b')](db[_0x250b('0x2c')][_0x250b('0x22')]);_0x599c88['query']=_['keys'](_0x413762[_0x250b('0x27')]);_0x599c88[_0x250b('0x2d')]=_['intersection'](_0x599c88[_0x250b('0x2a')],_0x599c88[_0x250b('0x27')]);_0x4743e7[_0x250b('0x2e')]=_['intersection'](_0x599c88[_0x250b('0x2a')],qs['fields'](_0x413762[_0x250b('0x27')][_0x250b('0x2f')]));_0x4743e7[_0x250b('0x2e')]=_0x4743e7['attributes'][_0x250b('0x30')]?_0x4743e7[_0x250b('0x2e')]:_0x599c88[_0x250b('0x2a')];if(_0x413762[_0x250b('0x27')]['includeAll']){_0x4743e7[_0x250b('0x31')]=[{'all':!![]}];}_0x4743e7=_[_0x250b('0x32')]({},_0x4743e7,_0x413762[_0x250b('0x33')]);return db[_0x250b('0x2c')][_0x250b('0x34')](_0x4743e7)[_0x250b('0x1a')](handleEntityNotFound(_0x4d5eed,null))[_0x250b('0x1a')](respondWithResult(_0x4d5eed,null))[_0x250b('0x35')](handleError(_0x4d5eed,null));};exports[_0x250b('0x36')]=function(_0x75c9b,_0x1e623b){return db[_0x250b('0x2c')]['create'](_0x75c9b[_0x250b('0x37')],{})[_0x250b('0x1a')](respondWithResult(_0x1e623b,0xc9))[_0x250b('0x35')](handleError(_0x1e623b,null));};exports['update']=function(_0xe3a9cf,_0x1944b2){if(_0xe3a9cf[_0x250b('0x37')]['id']){delete _0xe3a9cf['body']['id'];}return db['FaxInteraction'][_0x250b('0x34')]({'where':{'id':_0xe3a9cf[_0x250b('0x29')]['id']}})[_0x250b('0x1a')](handleEntityNotFound(_0x1944b2,null))[_0x250b('0x1a')](saveUpdates(_0xe3a9cf[_0x250b('0x37')],null))['then'](respondWithResult(_0x1944b2,null))[_0x250b('0x35')](handleError(_0x1944b2,null));};exports[_0x250b('0x1b')]=function(_0x505367,_0x4beefa){return db[_0x250b('0x2c')][_0x250b('0x34')]({'where':{'id':_0x505367[_0x250b('0x29')]['id']}})[_0x250b('0x1a')](handleEntityNotFound(_0x4beefa,null))[_0x250b('0x1a')](removeEntity(_0x4beefa,null))['catch'](handleError(_0x4beefa,null));};exports[_0x250b('0x38')]=function(_0x57fad8,_0x585c18){return db['FaxInteraction'][_0x250b('0x38')]()[_0x250b('0x1a')](respondWithResult(_0x585c18,null))[_0x250b('0x35')](handleError(_0x585c18,null));};exports[_0x250b('0x39')]=function(_0x4cb883,_0xfca2ec){return db[_0x250b('0x3a')][_0x250b('0x34')]({'where':{'id':_0x4cb883['params']['id']}})[_0x250b('0x1a')](handleEntityNotFound(_0xfca2ec,null))[_0x250b('0x1a')](function(_0x5c201e){if(_0x5c201e){return _0x5c201e[_0x250b('0x39')](_0x4cb883[_0x250b('0x37')][_0x250b('0x3b')],_[_0x250b('0x3c')](_0x4cb883[_0x250b('0x37')],['ids','id'])||{});}})[_0x250b('0x1a')](respondWithResult(_0xfca2ec,null))['catch'](handleError(_0xfca2ec,null));};exports[_0x250b('0x3d')]=function(_0x3fb21c,_0x34bdb4){var _0x36703a={'raw':![],'where':{}};var _0x3565ef={};var _0x1acfa5={'count':0x0,'rows':[]};return db[_0x250b('0x2c')]['findOne']({'where':{'id':_0x3fb21c[_0x250b('0x29')]['id']}})['then'](handleEntityNotFound(_0x34bdb4,null))[_0x250b('0x1a')](function(_0x585139){if(_0x585139){_0x3565ef['model']=_[_0x250b('0x2b')](db[_0x250b('0x3a')]['rawAttributes']);_0x3565ef[_0x250b('0x27')]=_[_0x250b('0x2b')](_0x3fb21c[_0x250b('0x27')]);_0x3565ef[_0x250b('0x2d')]=_[_0x250b('0x3e')](_0x3565ef[_0x250b('0x2a')],_0x3565ef[_0x250b('0x27')]);_0x36703a['attributes']=_[_0x250b('0x3e')](_0x3565ef['model'],qs[_0x250b('0x2f')](_0x3fb21c[_0x250b('0x27')]['fields']));_0x36703a['attributes']=_0x36703a[_0x250b('0x2e')][_0x250b('0x30')]?_0x36703a[_0x250b('0x2e')]:_0x3565ef['model'];if(!_0x3fb21c[_0x250b('0x27')]['hasOwnProperty'](_0x250b('0x3f'))){_0x36703a['limit']=qs[_0x250b('0x14')](_0x3fb21c['query'][_0x250b('0x14')]);_0x36703a['offset']=qs[_0x250b('0x17')](_0x3fb21c['query']['offset']);}_0x36703a[_0x250b('0x40')]=qs[_0x250b('0x41')](_0x3fb21c[_0x250b('0x27')]['sort']);_0x36703a[_0x250b('0x42')]=qs[_0x250b('0x2d')](_[_0x250b('0x43')](_0x3fb21c['query'],_0x3565ef[_0x250b('0x2d')]));_0x36703a[_0x250b('0x42')][_0x250b('0x44')]=_0x585139['id'];if(_0x3fb21c[_0x250b('0x27')]['filter']){_0x36703a[_0x250b('0x42')]=_['merge'](_0x36703a['where'],{'$or':_['map'](_0x36703a['attributes'],function(_0x25ee68){var _0x19f0b5={};_0x19f0b5[_0x25ee68]={'$like':'%'+_0x3fb21c[_0x250b('0x27')]['filter']+'%'};return _0x19f0b5;})});}if(_0x3fb21c[_0x250b('0x27')][_0x250b('0x45')]){var _0x39cf0b=_0x3fb21c[_0x250b('0x27')][_0x250b('0x45')][_0x250b('0x46')](',');var _0x1bb5c2={};_0x1bb5c2[_0x39cf0b[0x0]]={'$gte':moment(_0x39cf0b[0x1])[_0x250b('0x47')]('YYYY-MM-DD\x20HH:mm:ss')};_0x36703a[_0x250b('0x42')]=_['merge'](_0x36703a[_0x250b('0x42')],_0x1bb5c2);}_0x36703a=_[_0x250b('0x32')]({},_0x36703a,_0x3fb21c[_0x250b('0x33')]);return db[_0x250b('0x3a')][_0x250b('0x16')]({'where':_0x36703a[_0x250b('0x42')]})[_0x250b('0x1a')](function(_0x34807b){_0x1acfa5[_0x250b('0x16')]=_0x34807b;if(_0x3fb21c[_0x250b('0x27')][_0x250b('0x48')]){_0x36703a[_0x250b('0x31')]=[{'all':!![]}];}return db[_0x250b('0x3a')]['findAll'](_0x36703a);})[_0x250b('0x1a')](function(_0x505e63){_0x1acfa5['rows']=_0x505e63;return _0x1acfa5;});}})[_0x250b('0x1a')](respondWithFilteredResult(_0x34bdb4,_0x36703a))[_0x250b('0x35')](handleError(_0x34bdb4,null));};exports['addTags']=function(_0x1c73fb,_0xe373fe){return db['FaxInteraction'][_0x250b('0x34')]({'where':{'id':_0x1c73fb[_0x250b('0x29')]['id']}})[_0x250b('0x1a')](handleEntityNotFound(_0xe373fe,null))['then'](function(_0x5a8e3f){if(_0x5a8e3f){return _0x5a8e3f['setTags'](_0x1c73fb[_0x250b('0x37')][_0x250b('0x3b')],_[_0x250b('0x3c')](_0x1c73fb[_0x250b('0x37')],['ids','id'])||{})[_0x250b('0x49')](function(){return db[_0x250b('0x4a')][_0x250b('0x4b')]({'attributes':['id','name',_0x250b('0x4c')],'where':{'id':_0x1c73fb[_0x250b('0x37')][_0x250b('0x3b')]}});})[_0x250b('0x1a')](function(_0xf26d6a){socket['emit'](_0x250b('0x4d'),{'id':Number(_0x1c73fb[_0x250b('0x29')]['id']),'tags':_0xf26d6a||[]});return{'id':Number(_0x1c73fb[_0x250b('0x29')]['id']),'tags':_0xf26d6a||[]};});}})[_0x250b('0x1a')](respondWithResult(_0xe373fe,null))['catch'](handleError(_0xe373fe,null));};exports[_0x250b('0x4e')]=function(_0x52fa1d,_0x238cf2){return db[_0x250b('0x2c')][_0x250b('0x34')]({'where':{'id':_0x52fa1d[_0x250b('0x29')]['id']}})[_0x250b('0x1a')](handleEntityNotFound(_0x238cf2,null))[_0x250b('0x1a')](function(_0x5e5c3a){if(_0x5e5c3a){return _0x5e5c3a['removeTags'](_0x52fa1d[_0x250b('0x27')][_0x250b('0x3b')]);}})[_0x250b('0x1a')](respondWithStatusCode(_0x238cf2,null))[_0x250b('0x35')](handleError(_0x238cf2,null));};exports['download']=function(_0x517905,_0x2474b2){var _0x1bd48c=moment()[_0x250b('0x4f')]()['toString']();var _0x3c58d0=path['join'](config[_0x250b('0x50')],_0x250b('0x51'),'files','tmp');var _0x549f59=path[_0x250b('0x52')](config['root'],'server',_0x250b('0x53'),_0x250b('0x54'));var _0xfebec5=path['join'](_0x3c58d0,_0x1bd48c);var _0x4110cb=util['format']('transcript-%d-%s.zip',_0x517905['params']['id'],_0x1bd48c);var _0x340724=path[_0x250b('0x52')](_0x3c58d0,_0x4110cb);var _0x33f18f=[];_0x33f18f[_0x250b('0x55')]({'model':db[_0x250b('0x56')],'as':_0x250b('0x56'),'raw':!![]});var _0x11802a=[{'model':db[_0x250b('0x3a')],'as':'Messages','attributes':['id',_0x250b('0x37'),_0x250b('0x57')],'include':_0x33f18f}];return db[_0x250b('0x2c')][_0x250b('0x34')]({'where':{'id':_0x517905[_0x250b('0x29')]['id']},'include':_0x11802a})[_0x250b('0x1a')](handleEntityNotFound(_0x2474b2,null))[_0x250b('0x1a')](function(_0x5c492f){if(_0x5c492f&&_0x5c492f[_0x250b('0x58')]){var _0x26046d=_0x5c492f['get']({'plain':!![]});fs['mkdirSync'](_0xfebec5);for(var _0x10a5bb=0x0;_0x10a5bb<_0x26046d[_0x250b('0x58')][_0x250b('0x30')];_0x10a5bb++){var _0x3905f4=_0x26046d[_0x250b('0x58')][_0x10a5bb][_0x250b('0x56')];if(_0x3905f4){var _0x49eeea=path[_0x250b('0x52')](_0x549f59,_0x3905f4['basename']);if(fs[_0x250b('0x59')](_0x49eeea)){fs[_0x250b('0x5a')](_0x49eeea)[_0x250b('0x5b')](fs[_0x250b('0x5c')](path[_0x250b('0x52')](_0xfebec5,_0x3905f4[_0x250b('0x5d')])));}}}return BPromise['resolve']()[_0x250b('0x1a')](function(){return new BPromise(function(_0x29fb61,_0x1f06dd){zipdir(_0xfebec5,{'saveTo':_0x340724},function(_0x1e1ff6,_0x382a3b){if(_0x1e1ff6)return _0x1f06dd(_0x1e1ff6);return _0x29fb61(_0x382a3b);});})[_0x250b('0x1a')](function(){return new BPromise(function(_0x426a32,_0x3237f5){rimraf(_0xfebec5,function(_0x5902e0){if(_0x5902e0)_0x3237f5(_0x5902e0);return _0x426a32();});});})[_0x250b('0x1a')](function(){return _0x2474b2[_0x250b('0x5e')](_0x340724,_0x4110cb,function(_0x53181a){if(_0x53181a){console[_0x250b('0x5f')](_0x250b('0x60'),_0x53181a);}else{fs[_0x250b('0x61')](_0x340724);}});});});}else{return _0x2474b2[_0x250b('0x10')](0xc8);}})[_0x250b('0x35')](handleError(_0x2474b2,null));};
\ No newline at end of file
+var _0xa573=['body','describe','addMessage','ids','findOne','FaxMessage','hasOwnProperty','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','basename','existsSync','createReadStream','pipe','resolve','log','err','rimraf','zip-dir','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','error','name','send','index','map','FaxInteraction','rawAttributes','fieldName','key','findAll','fax','user','catch','show','params','keys','query','filters','model','attributes','intersection','fields','length','includeAll','include','merge','options','create','find'];(function(_0x51a035,_0x42b981){var _0x5598e3=function(_0x3c792b){while(--_0x3c792b){_0x51a035['push'](_0x51a035['shift']());}};_0x5598e3(++_0x42b981);}(_0xa573,0x15c));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x3a57('0x0'));var zipdir=require(_0x3a57('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x3a57('0x2'));var Redis=require(_0x3a57('0x3'));var interaction=require(_0x3a57('0x4'));var qs=require(_0x3a57('0x5'));var logger=require('../../config/logger')(_0x3a57('0x6'));var config=require(_0x3a57('0x7'));var db=require('../../mysqldb')['db'];config[_0x3a57('0x8')]=_[_0x3a57('0x9')](config[_0x3a57('0x8')],{'host':_0x3a57('0xa'),'port':0x18eb});var socket=require(_0x3a57('0xb'))(new Redis(config[_0x3a57('0x8')]));require(_0x3a57('0xc'))[_0x3a57('0xd')](socket);function respondWithStatusCode(_0x235260,_0x14b1fc){_0x14b1fc=_0x14b1fc||0xcc;return function(_0x36bd40){if(_0x36bd40){return _0x235260['sendStatus'](_0x14b1fc);}return _0x235260[_0x3a57('0xe')](_0x14b1fc)[_0x3a57('0xf')]();};}function respondWithResult(_0x5b8a5c,_0x59cf86){_0x59cf86=_0x59cf86||0xc8;return function(_0x571af7){if(_0x571af7){return _0x5b8a5c[_0x3a57('0xe')](_0x59cf86)['json'](_0x571af7);}};}function respondWithFilteredResult(_0x460471,_0xc770ed){return function(_0x55335b){if(_0x55335b){var _0x3f3fd9=typeof _0xc770ed[_0x3a57('0x10')]===_0x3a57('0x11')&&typeof _0xc770ed[_0x3a57('0x12')]===_0x3a57('0x11');var _0x26c014=_0x55335b[_0x3a57('0x13')];var _0x3717dd=_0x3f3fd9?0x0:_0xc770ed[_0x3a57('0x10')];var _0x286c8b=_0x3f3fd9?_0x55335b[_0x3a57('0x13')]:_0xc770ed[_0x3a57('0x10')]+_0xc770ed[_0x3a57('0x12')];var _0x32994d;if(_0x286c8b>=_0x26c014){_0x286c8b=_0x26c014;_0x32994d=0xc8;}else{_0x32994d=0xce;}_0x460471[_0x3a57('0xe')](_0x32994d);return _0x460471[_0x3a57('0x14')](_0x3a57('0x15'),_0x3717dd+'-'+_0x286c8b+'/'+_0x26c014)[_0x3a57('0x16')](_0x55335b);}return null;};}function saveUpdates(_0x37e7db){return function(_0x2a09e0){if(_0x2a09e0){return _0x2a09e0[_0x3a57('0x17')](_0x37e7db)[_0x3a57('0x18')](function(_0x31373e){return _0x31373e;});}return null;};}function removeEntity(_0x1ff234){return function(_0x599f7d){if(_0x599f7d){return _0x599f7d[_0x3a57('0x19')]()[_0x3a57('0x18')](function(){_0x1ff234['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x449c22){return function(_0x295ffc){if(!_0x295ffc){_0x449c22[_0x3a57('0x1a')](0x194);}return _0x295ffc;};}function handleError(_0x114ee2,_0x16bbb3){_0x16bbb3=_0x16bbb3||0x1f4;return function(_0x3e27ee){logger[_0x3a57('0x1b')](_0x3e27ee['stack']);if(_0x3e27ee[_0x3a57('0x1c')]){delete _0x3e27ee[_0x3a57('0x1c')];}_0x114ee2['status'](_0x16bbb3)[_0x3a57('0x1d')](_0x3e27ee);};}exports[_0x3a57('0x1e')]=function(_0x496888,_0x2cd73c){var _0xb8db4c={};var _0x2d4cc6=_[_0x3a57('0x1f')](db[_0x3a57('0x20')][_0x3a57('0x21')],function(_0x3529dc){return{'name':_0x3529dc[_0x3a57('0x22')],'type':_0x3529dc['type'][_0x3a57('0x23')]};});_0xb8db4c=qs['getOptions'](_0x2d4cc6,_0x496888);return interaction[_0x3a57('0x24')](_0x3a57('0x25'),_0x496888['query'],_0x496888[_0x3a57('0x26')],_0xb8db4c,_0x2d4cc6)[_0x3a57('0x18')](respondWithFilteredResult(_0x2cd73c,_0xb8db4c))[_0x3a57('0x27')](handleError(_0x2cd73c,null));};exports[_0x3a57('0x28')]=function(_0x199d0d,_0x34b0e7){var _0x1d2247={'raw':![],'where':{'id':_0x199d0d[_0x3a57('0x29')]['id']}},_0x5a2835={};_0x5a2835['model']=_[_0x3a57('0x2a')](db[_0x3a57('0x20')][_0x3a57('0x21')]);_0x5a2835[_0x3a57('0x2b')]=_[_0x3a57('0x2a')](_0x199d0d[_0x3a57('0x2b')]);_0x5a2835[_0x3a57('0x2c')]=_['intersection'](_0x5a2835[_0x3a57('0x2d')],_0x5a2835[_0x3a57('0x2b')]);_0x1d2247[_0x3a57('0x2e')]=_[_0x3a57('0x2f')](_0x5a2835[_0x3a57('0x2d')],qs[_0x3a57('0x30')](_0x199d0d[_0x3a57('0x2b')]['fields']));_0x1d2247['attributes']=_0x1d2247['attributes'][_0x3a57('0x31')]?_0x1d2247['attributes']:_0x5a2835[_0x3a57('0x2d')];if(_0x199d0d[_0x3a57('0x2b')][_0x3a57('0x32')]){_0x1d2247[_0x3a57('0x33')]=[{'all':!![]}];}_0x1d2247=_[_0x3a57('0x34')]({},_0x1d2247,_0x199d0d[_0x3a57('0x35')]);return db[_0x3a57('0x20')]['find'](_0x1d2247)[_0x3a57('0x18')](handleEntityNotFound(_0x34b0e7,null))[_0x3a57('0x18')](respondWithResult(_0x34b0e7,null))[_0x3a57('0x27')](handleError(_0x34b0e7,null));};exports['create']=function(_0x1d81a7,_0x2d5a6c){return db[_0x3a57('0x20')][_0x3a57('0x36')](_0x1d81a7['body'],{})['then'](respondWithResult(_0x2d5a6c,0xc9))['catch'](handleError(_0x2d5a6c,null));};exports['update']=function(_0x5b7064,_0x4324da){if(_0x5b7064['body']['id']){delete _0x5b7064['body']['id'];}return db['FaxInteraction'][_0x3a57('0x37')]({'where':{'id':_0x5b7064[_0x3a57('0x29')]['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0x4324da,null))[_0x3a57('0x18')](saveUpdates(_0x5b7064[_0x3a57('0x38')],null))['then'](respondWithResult(_0x4324da,null))[_0x3a57('0x27')](handleError(_0x4324da,null));};exports[_0x3a57('0x19')]=function(_0xf120fd,_0xde7af4){return db['FaxInteraction'][_0x3a57('0x37')]({'where':{'id':_0xf120fd[_0x3a57('0x29')]['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0xde7af4,null))[_0x3a57('0x18')](removeEntity(_0xde7af4,null))[_0x3a57('0x27')](handleError(_0xde7af4,null));};exports[_0x3a57('0x39')]=function(_0x1a7cdd,_0x3b3362){return db[_0x3a57('0x20')][_0x3a57('0x39')]()[_0x3a57('0x18')](respondWithResult(_0x3b3362,null))[_0x3a57('0x27')](handleError(_0x3b3362,null));};exports[_0x3a57('0x3a')]=function(_0x3804d1,_0x424cc4){return db['FaxMessage'][_0x3a57('0x37')]({'where':{'id':_0x3804d1[_0x3a57('0x29')]['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0x424cc4,null))[_0x3a57('0x18')](function(_0xd04bed){if(_0xd04bed){return _0xd04bed[_0x3a57('0x3a')](_0x3804d1[_0x3a57('0x38')]['ids'],_['omit'](_0x3804d1[_0x3a57('0x38')],[_0x3a57('0x3b'),'id'])||{});}})['then'](respondWithResult(_0x424cc4,null))[_0x3a57('0x27')](handleError(_0x424cc4,null));};exports['getMessages']=function(_0x1871ca,_0x5a3d08){var _0x52b336={'raw':![],'where':{}};var _0x51843a={};var _0x163703={'count':0x0,'rows':[]};return db[_0x3a57('0x20')][_0x3a57('0x3c')]({'where':{'id':_0x1871ca['params']['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0x5a3d08,null))[_0x3a57('0x18')](function(_0x1400ca){if(_0x1400ca){_0x51843a[_0x3a57('0x2d')]=_[_0x3a57('0x2a')](db[_0x3a57('0x3d')][_0x3a57('0x21')]);_0x51843a[_0x3a57('0x2b')]=_['keys'](_0x1871ca[_0x3a57('0x2b')]);_0x51843a['filters']=_[_0x3a57('0x2f')](_0x51843a[_0x3a57('0x2d')],_0x51843a['query']);_0x52b336[_0x3a57('0x2e')]=_[_0x3a57('0x2f')](_0x51843a[_0x3a57('0x2d')],qs[_0x3a57('0x30')](_0x1871ca[_0x3a57('0x2b')]['fields']));_0x52b336[_0x3a57('0x2e')]=_0x52b336['attributes'][_0x3a57('0x31')]?_0x52b336['attributes']:_0x51843a[_0x3a57('0x2d')];if(!_0x1871ca[_0x3a57('0x2b')][_0x3a57('0x3e')]('nolimit')){_0x52b336[_0x3a57('0x12')]=qs[_0x3a57('0x12')](_0x1871ca[_0x3a57('0x2b')]['limit']);_0x52b336[_0x3a57('0x10')]=qs[_0x3a57('0x10')](_0x1871ca[_0x3a57('0x2b')][_0x3a57('0x10')]);}_0x52b336[_0x3a57('0x3f')]=qs[_0x3a57('0x40')](_0x1871ca[_0x3a57('0x2b')][_0x3a57('0x40')]);_0x52b336[_0x3a57('0x41')]=qs[_0x3a57('0x2c')](_[_0x3a57('0x42')](_0x1871ca['query'],_0x51843a[_0x3a57('0x2c')]));_0x52b336[_0x3a57('0x41')][_0x3a57('0x43')]=_0x1400ca['id'];if(_0x1871ca[_0x3a57('0x2b')]['filter']){_0x52b336[_0x3a57('0x41')]=_[_0x3a57('0x34')](_0x52b336[_0x3a57('0x41')],{'$or':_[_0x3a57('0x1f')](_0x52b336['attributes'],function(_0x3d1ec5){var _0xf98d68={};_0xf98d68[_0x3d1ec5]={'$like':'%'+_0x1871ca[_0x3a57('0x2b')][_0x3a57('0x44')]+'%'};return _0xf98d68;})});}if(_0x1871ca[_0x3a57('0x2b')]['$gte']){var _0x5a85d2=_0x1871ca['query'][_0x3a57('0x45')][_0x3a57('0x46')](',');var _0x129022={};_0x129022[_0x5a85d2[0x0]]={'$gte':moment(_0x5a85d2[0x1])[_0x3a57('0x47')](_0x3a57('0x48'))};_0x52b336[_0x3a57('0x41')]=_[_0x3a57('0x34')](_0x52b336[_0x3a57('0x41')],_0x129022);}_0x52b336=_[_0x3a57('0x34')]({},_0x52b336,_0x1871ca[_0x3a57('0x35')]);return db[_0x3a57('0x3d')][_0x3a57('0x13')]({'where':_0x52b336[_0x3a57('0x41')]})[_0x3a57('0x18')](function(_0x1f43ac){_0x163703[_0x3a57('0x13')]=_0x1f43ac;if(_0x1871ca[_0x3a57('0x2b')][_0x3a57('0x32')]){_0x52b336[_0x3a57('0x33')]=[{'all':!![]}];}return db[_0x3a57('0x3d')][_0x3a57('0x24')](_0x52b336);})['then'](function(_0xdbf929){_0x163703[_0x3a57('0x49')]=_0xdbf929;return _0x163703;});}})[_0x3a57('0x18')](respondWithFilteredResult(_0x5a3d08,_0x52b336))[_0x3a57('0x27')](handleError(_0x5a3d08,null));};exports[_0x3a57('0x4a')]=function(_0x23aac4,_0x5005ac){return db[_0x3a57('0x20')][_0x3a57('0x37')]({'where':{'id':_0x23aac4[_0x3a57('0x29')]['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0x5005ac,null))[_0x3a57('0x18')](function(_0x421a4f){if(_0x421a4f){return _0x421a4f[_0x3a57('0x4b')](_0x23aac4[_0x3a57('0x38')][_0x3a57('0x3b')],_[_0x3a57('0x4c')](_0x23aac4[_0x3a57('0x38')],[_0x3a57('0x3b'),'id'])||{})[_0x3a57('0x4d')](function(){return db['Tag'][_0x3a57('0x24')]({'attributes':['id','name',_0x3a57('0x4e')],'where':{'id':_0x23aac4[_0x3a57('0x38')]['ids']}});})[_0x3a57('0x18')](function(_0x5483b7){socket[_0x3a57('0x4f')](_0x3a57('0x50'),{'id':Number(_0x23aac4['params']['id']),'tags':_0x5483b7||[]});return{'id':Number(_0x23aac4['params']['id']),'tags':_0x5483b7||[]};});}})[_0x3a57('0x18')](respondWithResult(_0x5005ac,null))['catch'](handleError(_0x5005ac,null));};exports['removeTags']=function(_0x1b4cbf,_0x479e5f){return db[_0x3a57('0x20')][_0x3a57('0x37')]({'where':{'id':_0x1b4cbf[_0x3a57('0x29')]['id']}})[_0x3a57('0x18')](handleEntityNotFound(_0x479e5f,null))[_0x3a57('0x18')](function(_0x2cb20e){if(_0x2cb20e){return _0x2cb20e[_0x3a57('0x51')](_0x1b4cbf[_0x3a57('0x2b')]['ids']);}})['then'](respondWithStatusCode(_0x479e5f,null))[_0x3a57('0x27')](handleError(_0x479e5f,null));};exports[_0x3a57('0x52')]=function(_0x45abf0,_0x5a6ab7){var _0x35aff0=moment()[_0x3a57('0x53')]()['toString']();var _0x310a81=path[_0x3a57('0x54')](config['root'],_0x3a57('0x55'),'files',_0x3a57('0x56'));var _0x149a2e=path['join'](config[_0x3a57('0x57')],'server',_0x3a57('0x58'),_0x3a57('0x59'));var _0x31bfe7=path[_0x3a57('0x54')](_0x310a81,_0x35aff0);var _0x91cef=util['format'](_0x3a57('0x5a'),_0x45abf0[_0x3a57('0x29')]['id'],_0x35aff0);var _0xd2c77=path['join'](_0x310a81,_0x91cef);var _0x4ca5ca=[];_0x4ca5ca[_0x3a57('0x5b')]({'model':db['Attachment'],'as':_0x3a57('0x5c'),'raw':!![]});var _0x3da810=[{'model':db['FaxMessage'],'as':_0x3a57('0x5d'),'attributes':['id','body','createdAt'],'include':_0x4ca5ca}];return db[_0x3a57('0x20')][_0x3a57('0x37')]({'where':{'id':_0x45abf0[_0x3a57('0x29')]['id']},'include':_0x3da810})[_0x3a57('0x18')](handleEntityNotFound(_0x5a6ab7,null))[_0x3a57('0x18')](function(_0xf8ed3d){if(_0xf8ed3d&&_0xf8ed3d['Messages']){var _0x3ed6d5=_0xf8ed3d['get']({'plain':!![]});fs['mkdirSync'](_0x31bfe7);for(var _0x1edb86=0x0;_0x1edb86<_0x3ed6d5[_0x3a57('0x5d')]['length'];_0x1edb86++){var _0x4b33a1=_0x3ed6d5[_0x3a57('0x5d')][_0x1edb86][_0x3a57('0x5c')];if(_0x4b33a1){var _0x3d79e4=path[_0x3a57('0x54')](_0x149a2e,_0x4b33a1[_0x3a57('0x5e')]);if(fs[_0x3a57('0x5f')](_0x3d79e4)){fs[_0x3a57('0x60')](_0x3d79e4)[_0x3a57('0x61')](fs['createWriteStream'](path['join'](_0x31bfe7,_0x4b33a1['basename'])));}}}return BPromise[_0x3a57('0x62')]()['then'](function(){return new BPromise(function(_0x583853,_0x1f9b12){zipdir(_0x31bfe7,{'saveTo':_0xd2c77},function(_0x4e615d,_0x15a3a4){if(_0x4e615d)return _0x1f9b12(_0x4e615d);return _0x583853(_0x15a3a4);});})[_0x3a57('0x18')](function(){return new BPromise(function(_0x4d945b,_0x3b151a){rimraf(_0x31bfe7,function(_0x2d7949){if(_0x2d7949)_0x3b151a(_0x2d7949);return _0x4d945b();});});})[_0x3a57('0x18')](function(){return _0x5a6ab7[_0x3a57('0x52')](_0xd2c77,_0x91cef,function(_0x538c97){if(_0x538c97){console[_0x3a57('0x63')](_0x3a57('0x64'),_0x538c97);}else{fs['unlinkSync'](_0xd2c77);}});});});}else{return _0x5a6ab7[_0x3a57('0x1a')](0xc8);}})[_0x3a57('0x27')](handleError(_0x5a6ab7,null));};
\ No newline at end of file
index 1cf056e..12e4c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde34=['FaxInteraction','FaxMessage','setMaxListeners','save','remove','getUsers','then','Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb'];(function(_0x38a345,_0x3a0f4e){var _0x5107a8=function(_0xe425ab){while(--_0xe425ab){_0x38a345['push'](_0x38a345['shift']());}};_0x5107a8(++_0x3a0f4e);}(_0xde34,0x13a));var _0x4de3=function(_0x3573e8,_0x2a335f){_0x3573e8=_0x3573e8-0x0;var _0x1af3f2=_0xde34[_0x3573e8];return _0x1af3f2;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x4de3('0x0'))['db'][_0x4de3('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0x4de3('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4de3('0x3')](0x0);var events={'afterCreate':_0x4de3('0x4'),'afterUpdate':'update','afterDestroy':_0x4de3('0x5')};function emitEvent(_0x29b759){return function(_0x18882c,_0xe62bc9,_0x44bd9c){_0x18882c[_0x4de3('0x6')]({'attributes':['id'],'raw':!![]})[_0x4de3('0x7')](function(_0x22d1f6){_0x18882c['setDataValue'](_0x4de3('0x8'),_0x22d1f6['map'](function(_0xe424fe){return{'id':_0xe424fe['id']};}));return FaxMessage[_0x4de3('0x9')]({'where':{'FaxInteractionId':_0x18882c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4de3('0x7')](function(_0x1eb1c0){_0x18882c['setDataValue'](_0x4de3('0xa'),_0x1eb1c0['length']);FaxInteractionEvents[_0x4de3('0xb')](_0x29b759+':'+_0x18882c['id'],_0x18882c);FaxInteractionEvents['emit'](_0x29b759,_0x18882c);_0x44bd9c(null);})[_0x4de3('0xc')](_0x44bd9c(null));};}for(var e in events){if(events[_0x4de3('0xd')](e)){var event=events[e];FaxInteraction[_0x4de3('0xe')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0xeed4=['findAll','unreadMessages','length','emit','catch','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map'];(function(_0x122da1,_0x158e84){var _0x273065=function(_0x2b6a8b){while(--_0x2b6a8b){_0x122da1['push'](_0x122da1['shift']());}};_0x273065(++_0x158e84);}(_0xeed4,0x84));var _0x4eed=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xeed4[_0x383dbb];return _0x6e8bde;};'use strict';var EventEmitter=require(_0x4eed('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x4eed('0x1')];var FaxMessage=require(_0x4eed('0x2'))['db'][_0x4eed('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x4eed('0x4')](0x0);var events={'afterCreate':_0x4eed('0x5'),'afterUpdate':_0x4eed('0x6'),'afterDestroy':_0x4eed('0x7')};function emitEvent(_0x107e7d){return function(_0x2e8b45,_0x56808e,_0x69dfa){_0x2e8b45['getUsers']({'attributes':['id'],'raw':!![]})[_0x4eed('0x8')](function(_0x4b5322){_0x2e8b45[_0x4eed('0x9')](_0x4eed('0xa'),_0x4b5322[_0x4eed('0xb')](function(_0x37b131){return{'id':_0x37b131['id']};}));return FaxMessage[_0x4eed('0xc')]({'where':{'FaxInteractionId':_0x2e8b45['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4eed('0x8')](function(_0x2c7240){_0x2e8b45[_0x4eed('0x9')](_0x4eed('0xd'),_0x2c7240[_0x4eed('0xe')]);FaxInteractionEvents[_0x4eed('0xf')](_0x107e7d+':'+_0x2e8b45['id'],_0x2e8b45);FaxInteractionEvents[_0x4eed('0xf')](_0x107e7d,_0x2e8b45);_0x69dfa(null);})[_0x4eed('0x10')](_0x69dfa(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x4eed('0x11')]=FaxInteractionEvents;
\ No newline at end of file
index 4a82fcc..15f1477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40b6=['path','./faxInteraction.attributes','exports','define','fax_interactions','changed','closed','closedAt','format','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a98ca,_0x17f4d0){var _0x34291b=function(_0x4d6e2b){while(--_0x4d6e2b){_0x5a98ca['push'](_0x5a98ca['shift']());}};_0x34291b(++_0x17f4d0);}(_0x40b6,0x14b));var _0x640b=function(_0x264545,_0x214037){_0x264545=_0x264545-0x0;var _0x114d10=_0x40b6[_0x264545];return _0x114d10;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x640b('0x0'))(_0x640b('0x1'));var moment=require(_0x640b('0x2'));var BPromise=require(_0x640b('0x3'));var rp=require(_0x640b('0x4'));var fs=require('fs');var path=require(_0x640b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x640b('0x6'));module[_0x640b('0x7')]=function(_0x2d39ff,_0x4a5975){return _0x2d39ff[_0x640b('0x8')]('FaxInteraction',attributes,{'tableName':_0x640b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ed967,_0xaad49e,_0x2f6944){if(_0x3ed967[_0x640b('0xa')](_0x640b('0xb'))){_0x3ed967[_0x640b('0xc')]=moment()[_0x640b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2f6944(null,_0x3ed967);}}});};
\ No newline at end of file
+var _0xe3bb=['api','moment','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','fax_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x1c236e,_0x111664){var _0x10d3fc=function(_0x4d12fd){while(--_0x4d12fd){_0x1c236e['push'](_0x1c236e['shift']());}};_0x10d3fc(++_0x111664);}(_0xe3bb,0x1c8));var _0xbe3b=function(_0x3e973b,_0x439ae2){_0x3e973b=_0x3e973b-0x0;var _0x5b98f0=_0xe3bb[_0x3e973b];return _0x5b98f0;};'use strict';var _=require(_0xbe3b('0x0'));var util=require(_0xbe3b('0x1'));var logger=require(_0xbe3b('0x2'))(_0xbe3b('0x3'));var moment=require(_0xbe3b('0x4'));var BPromise=require('bluebird');var rp=require(_0xbe3b('0x5'));var fs=require('fs');var path=require(_0xbe3b('0x6'));var rimraf=require(_0xbe3b('0x7'));var config=require(_0xbe3b('0x8'));var attributes=require(_0xbe3b('0x9'));module[_0xbe3b('0xa')]=function(_0x5f0892,_0xe0cafc){return _0x5f0892[_0xbe3b('0xb')]('FaxInteraction',attributes,{'tableName':_0xbe3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d4c37,_0x28651e,_0x199985){if(_0x2d4c37[_0xbe3b('0xd')]('closed')){_0x2d4c37[_0xbe3b('0xe')]=moment()[_0xbe3b('0xf')](_0xbe3b('0x10'));}_0x199985(null,_0x2d4c37);}}});};
\ No newline at end of file
index c0f8d36..6e32bfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd74a=['catch','UpdateFaxInteraction','body','options','raw','FaxInteraction','where','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5a488f,_0x39056a){var _0x2ee930=function(_0x225027){while(--_0x225027){_0x5a488f['push'](_0x5a488f['shift']());}};_0x2ee930(++_0x39056a);}(_0xd74a,0x77));var _0xad74=function(_0x7caeb8,_0x48fcf6){_0x7caeb8=_0x7caeb8-0x0;var _0x48abcb=_0xd74a[_0x7caeb8];return _0x48abcb;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var moment=require(_0xad74('0x2'));var BPromise=require(_0xad74('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad74('0x4'));var db=require(_0xad74('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xad74('0x6'))(_0xad74('0x7'));var config=require('../../config/environment');var jayson=require(_0xad74('0x8'));var client=jayson[_0xad74('0x9')]['http']({'port':0x232a});config[_0xad74('0xa')]=_['defaults'](config['redis'],{'host':_0xad74('0xb'),'port':0x18eb});var socket=require(_0xad74('0xc'))(new Redis(config['redis']));require(_0xad74('0xd'))[_0xad74('0xe')](socket);function respondWithRpcPromise(_0x6c07a,_0x22832d,_0x45c412){return new BPromise(function(_0x137405,_0x3f6860){return client['request'](_0x6c07a,_0x45c412)[_0xad74('0xf')](function(_0x50f300){logger[_0xad74('0x10')](_0xad74('0x11'),_0x22832d,_0xad74('0x12'));logger[_0xad74('0x13')](_0xad74('0x14'),_0x22832d,'request\x20sent',JSON[_0xad74('0x15')](_0x50f300));if(_0x50f300[_0xad74('0x16')]){if(_0x50f300[_0xad74('0x16')][_0xad74('0x17')]===0x1f4){logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x50f300[_0xad74('0x16')][_0xad74('0x18')]);return _0x3f6860(_0x50f300['error'][_0xad74('0x18')]);}logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x50f300[_0xad74('0x16')][_0xad74('0x18')]);return _0x137405(_0x50f300[_0xad74('0x16')]['message']);}else{logger[_0xad74('0x10')]('FaxInteraction,\x20%s,\x20%s',_0x22832d,_0xad74('0x12'));_0x137405(_0x50f300['result'][_0xad74('0x18')]);}})[_0xad74('0x19')](function(_0x3fc881){logger[_0xad74('0x16')](_0xad74('0x11'),_0x22832d,_0x3fc881);_0x3f6860(_0x3fc881);});});}exports[_0xad74('0x1a')]=function(_0x58779c){var _0x1028a7=this;return new Promise(function(_0x2f61ba,_0x28e7aa){return db['FaxInteraction']['update'](_0x58779c[_0xad74('0x1b')],{'raw':_0x58779c[_0xad74('0x1c')]?_0x58779c[_0xad74('0x1c')][_0xad74('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58779c[_0xad74('0x1c')]?_0x58779c[_0xad74('0x1c')]['where']||null:null,'attributes':_0x58779c[_0xad74('0x1c')]?_0x58779c[_0xad74('0x1c')]['attributes']||null:null,'limit':_0x58779c[_0xad74('0x1c')]?_0x58779c['options']['limit']||null:null})['then'](function(_0x34571c){logger[_0xad74('0x10')]('UpdateFaxInteraction',_0x58779c);logger[_0xad74('0x13')]('UpdateFaxInteraction',_0x58779c,JSON[_0xad74('0x15')](_0x34571c));_0x2f61ba(_0x34571c);})[_0xad74('0x19')](function(_0x19fc8e){logger['error'](_0xad74('0x1a'),_0x19fc8e[_0xad74('0x18')],_0x58779c);_0x28e7aa(_0x1028a7[_0xad74('0x16')](0x1f4,_0x19fc8e[_0xad74('0x18')]));});});};exports['AddTagsToFaxInteraction']=function(_0x559173){return new Promise(function(_0x9d9e0b,_0xc2a214){return db[_0xad74('0x1e')]['find']({'where':_0x559173[_0xad74('0x1c')]?_0x559173[_0xad74('0x1c')][_0xad74('0x1f')]||null:null})[_0xad74('0xf')](function(_0x2fb57c){if(_0x2fb57c){return _0x2fb57c[_0xad74('0x20')](_0x559173[_0xad74('0x1b')]['ids'],_[_0xad74('0x21')](_0x559173['body'],[_0xad74('0x22'),'id'])||{});}})['spread'](function(_0x454ba2){logger[_0xad74('0x10')](_0xad74('0x23'),_0x559173);logger[_0xad74('0x13')]('AddTags',_0x559173,JSON[_0xad74('0x15')](_0x454ba2));_0x9d9e0b(_0x454ba2);})['catch'](function(_0x43e0d4){logger['error'](_0xad74('0x23'),_0x43e0d4[_0xad74('0x18')],_0x559173);_0xc2a214(_this['error'](0x1f4,_0x43e0d4['message']));});});};
\ No newline at end of file
+var _0xed6e=['UpdateFaxInteraction','FaxInteraction','update','options','raw','attributes','limit','AddTagsToFaxInteraction','find','where','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','client','http','redis','socket.io-emitter','./faxInteraction.socket','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x389290,_0x39ee1f){var _0x40e15a=function(_0x67a05b){while(--_0x67a05b){_0x389290['push'](_0x389290['shift']());}};_0x40e15a(++_0x39ee1f);}(_0xed6e,0xce));var _0xeed6=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0xed6e[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0xeed6('0x0'));var util=require(_0xeed6('0x1'));var moment=require(_0xeed6('0x2'));var BPromise=require(_0xeed6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeed6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xeed6('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xeed6('0x6')][_0xeed6('0x7')]({'port':0x232a});config[_0xeed6('0x8')]=_['defaults'](config[_0xeed6('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xeed6('0x9'))(new Redis(config[_0xeed6('0x8')]));require(_0xeed6('0xa'))['register'](socket);function respondWithRpcPromise(_0x25ec0f,_0x265cf7,_0x221dea){return new BPromise(function(_0xe25dd9,_0x54b38f){return client[_0xeed6('0xb')](_0x25ec0f,_0x221dea)[_0xeed6('0xc')](function(_0x13910f){logger[_0xeed6('0xd')](_0xeed6('0xe'),_0x265cf7,_0xeed6('0xf'));logger[_0xeed6('0x10')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x265cf7,'request\x20sent',JSON[_0xeed6('0x11')](_0x13910f));if(_0x13910f[_0xeed6('0x12')]){if(_0x13910f[_0xeed6('0x12')]['code']===0x1f4){logger[_0xeed6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x265cf7,_0x13910f[_0xeed6('0x12')][_0xeed6('0x13')]);return _0x54b38f(_0x13910f['error']['message']);}logger[_0xeed6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x265cf7,_0x13910f[_0xeed6('0x12')][_0xeed6('0x13')]);return _0xe25dd9(_0x13910f[_0xeed6('0x12')][_0xeed6('0x13')]);}else{logger[_0xeed6('0xd')](_0xeed6('0xe'),_0x265cf7,_0xeed6('0xf'));_0xe25dd9(_0x13910f[_0xeed6('0x14')][_0xeed6('0x13')]);}})[_0xeed6('0x15')](function(_0x5eeac4){logger[_0xeed6('0x12')]('FaxInteraction,\x20%s,\x20%s',_0x265cf7,_0x5eeac4);_0x54b38f(_0x5eeac4);});});}exports[_0xeed6('0x16')]=function(_0x247175){var _0x47bbed=this;return new Promise(function(_0x3681d3,_0x27c72e){return db[_0xeed6('0x17')][_0xeed6('0x18')](_0x247175['body'],{'raw':_0x247175[_0xeed6('0x19')]?_0x247175[_0xeed6('0x19')][_0xeed6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x247175[_0xeed6('0x19')]?_0x247175[_0xeed6('0x19')]['where']||null:null,'attributes':_0x247175['options']?_0x247175[_0xeed6('0x19')][_0xeed6('0x1b')]||null:null,'limit':_0x247175[_0xeed6('0x19')]?_0x247175['options'][_0xeed6('0x1c')]||null:null})[_0xeed6('0xc')](function(_0x4b4208){logger['info'](_0xeed6('0x16'),_0x247175);logger['debug'](_0xeed6('0x16'),_0x247175,JSON[_0xeed6('0x11')](_0x4b4208));_0x3681d3(_0x4b4208);})[_0xeed6('0x15')](function(_0xbc5056){logger[_0xeed6('0x12')](_0xeed6('0x16'),_0xbc5056['message'],_0x247175);_0x27c72e(_0x47bbed['error'](0x1f4,_0xbc5056[_0xeed6('0x13')]));});});};exports[_0xeed6('0x1d')]=function(_0x52081c){return new Promise(function(_0x5f56f4,_0x254019){return db['FaxInteraction'][_0xeed6('0x1e')]({'where':_0x52081c[_0xeed6('0x19')]?_0x52081c['options'][_0xeed6('0x1f')]||null:null})[_0xeed6('0xc')](function(_0x2ad64c){if(_0x2ad64c){return _0x2ad64c[_0xeed6('0x20')](_0x52081c[_0xeed6('0x21')][_0xeed6('0x22')],_[_0xeed6('0x23')](_0x52081c[_0xeed6('0x21')],['ids','id'])||{});}})[_0xeed6('0x24')](function(_0x1749cb){logger['info']('AddTags',_0x52081c);logger[_0xeed6('0x10')](_0xeed6('0x25'),_0x52081c,JSON[_0xeed6('0x11')](_0x1749cb));_0x5f56f4(_0x1749cb);})[_0xeed6('0x15')](function(_0x1a5f71){logger[_0xeed6('0x12')](_0xeed6('0x25'),_0x1a5f71[_0xeed6('0x13')],_0x52081c);_0x254019(_this[_0xeed6('0x12')](0x1f4,_0x1a5f71['message']));});});};
\ No newline at end of file
index 16f6f3b..b2cd087 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28a6=['removeListener','register','length','faxInteraction:','save','remove','update','emit'];(function(_0x1d7739,_0x511286){var _0x5e64e4=function(_0x4dfbea){while(--_0x4dfbea){_0x1d7739['push'](_0x1d7739['shift']());}};_0x5e64e4(++_0x511286);}(_0x28a6,0x74));var _0x628a=function(_0x58ee19,_0xdf0765){_0x58ee19=_0x58ee19-0x0;var _0x49af25=_0x28a6[_0x58ee19];return _0x49af25;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x628a('0x0'),_0x628a('0x1'),_0x628a('0x2')];function createListener(_0x199fa7,_0x405cc0){return function(_0xa6c91a){_0x405cc0[_0x628a('0x3')](_0x199fa7,_0xa6c91a);};}function removeListener(_0x5373ec,_0x2ffb24){return function(){FaxInteractionEvents[_0x628a('0x4')](_0x5373ec,_0x2ffb24);};}exports[_0x628a('0x5')]=function(_0x480e2e){for(var _0x1f625d=0x0,_0x2e79a1=events[_0x628a('0x6')];_0x1f625d<_0x2e79a1;_0x1f625d++){var _0x4ef64e=events[_0x1f625d];var _0x3b3338=createListener(_0x628a('0x7')+_0x4ef64e,_0x480e2e);FaxInteractionEvents['on'](_0x4ef64e,_0x3b3338);}};
\ No newline at end of file
+var _0xa31c=['removeListener','register','length','update','emit'];(function(_0x340bd6,_0x32b3a7){var _0x3911af=function(_0x42c072){while(--_0x42c072){_0x340bd6['push'](_0x340bd6['shift']());}};_0x3911af(++_0x32b3a7);}(_0xa31c,0x80));var _0xca31=function(_0x314ee0,_0x2c854d){_0x314ee0=_0x314ee0-0x0;var _0x2c618a=_0xa31c[_0x314ee0];return _0x2c618a;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=['save','remove',_0xca31('0x0')];function createListener(_0x118268,_0x353624){return function(_0x5dadb5){_0x353624[_0xca31('0x1')](_0x118268,_0x5dadb5);};}function removeListener(_0x47f684,_0x8260e4){return function(){FaxInteractionEvents[_0xca31('0x2')](_0x47f684,_0x8260e4);};}exports[_0xca31('0x3')]=function(_0x2f066c){for(var _0x7d40d6=0x0,_0x365a0a=events[_0xca31('0x4')];_0x7d40d6<_0x365a0a;_0x7d40d6++){var _0x20f662=events[_0x7d40d6];var _0x5b4e6d=createListener('faxInteraction:'+_0x20f662,_0x2f066c);FaxInteractionEvents['on'](_0x20f662,_0x5b4e6d);}};
\ No newline at end of file
index 8530ff0..a55a71f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f05=['fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe','/:id','show','getMessages','post','create','/:id/messages','/:id/tags','tracked','faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x46eb59,_0x4471e9){var _0x35c2fa=function(_0x5fc783){while(--_0x5fc783){_0x46eb59['push'](_0x46eb59['shift']());}};_0x35c2fa(++_0x4471e9);}(_0x2f05,0xaf));var _0x52f0=function(_0x769cc1,_0x3096b5){_0x769cc1=_0x769cc1-0x0;var _0x44be05=_0x2f05[_0x769cc1];return _0x44be05;};'use strict';var multer=require(_0x52f0('0x0'));var util=require('util');var path=require(_0x52f0('0x1'));var timeout=require(_0x52f0('0x2'));var express=require(_0x52f0('0x3'));var router=express[_0x52f0('0x4')]();var fs_extra=require(_0x52f0('0x5'));var auth=require(_0x52f0('0x6'));var interaction=require(_0x52f0('0x7'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x52f0('0x8')]);router[_0x52f0('0x9')](_0x52f0('0xa'),auth[_0x52f0('0xb')](),controller[_0x52f0('0xc')]);router['get'](_0x52f0('0xd'),auth[_0x52f0('0xb')](),controller[_0x52f0('0xe')]);router[_0x52f0('0x9')]('/:id/messages',auth[_0x52f0('0xb')](),controller[_0x52f0('0xf')]);router[_0x52f0('0x9')]('/:id/download',auth[_0x52f0('0xb')](),controller['download']);router[_0x52f0('0x10')]('/',auth['isAuthenticated'](),controller[_0x52f0('0x11')]);router[_0x52f0('0x10')](_0x52f0('0x12'),auth[_0x52f0('0xb')](),controller['addMessage']);router[_0x52f0('0x10')](_0x52f0('0x13'),auth[_0x52f0('0xb')](),interaction[_0x52f0('0x14')]('fax',_0x52f0('0x15')),controller[_0x52f0('0x16')]);router[_0x52f0('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x52f0('0x14')](_0x52f0('0x18'),_0x52f0('0x19')),controller[_0x52f0('0x1a')]);router[_0x52f0('0x1b')](_0x52f0('0xd'),auth['isAuthenticated'](),interaction[_0x52f0('0x14')](_0x52f0('0x18'),'faxinteraction:destroy'),controller[_0x52f0('0x1c')]);router[_0x52f0('0x1b')](_0x52f0('0x13'),auth[_0x52f0('0xb')](),controller['removeTags']);module[_0x52f0('0x1d')]=router;
\ No newline at end of file
+var _0xb4b7=['./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax','put','update','faxinteraction:destroy','/:id/tags','removeTags','multer','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x44bd3a,_0x2d3b79){var _0x1ed9d6=function(_0x159880){while(--_0x159880){_0x44bd3a['push'](_0x44bd3a['shift']());}};_0x1ed9d6(++_0x2d3b79);}(_0xb4b7,0x6a));var _0x7b4b=function(_0x4581ce,_0x34c4dc){_0x4581ce=_0x4581ce-0x0;var _0x240848=_0xb4b7[_0x4581ce];return _0x240848;};'use strict';var multer=require(_0x7b4b('0x0'));var util=require('util');var path=require(_0x7b4b('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b4b('0x2'));var router=express[_0x7b4b('0x3')]();var fs_extra=require(_0x7b4b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7b4b('0x5'));var config=require('../../config/environment');var controller=require(_0x7b4b('0x6'));router[_0x7b4b('0x7')]('/',auth[_0x7b4b('0x8')](),controller[_0x7b4b('0x9')]);router[_0x7b4b('0x7')](_0x7b4b('0xa'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xb')]);router[_0x7b4b('0x7')](_0x7b4b('0xc'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xd')]);router[_0x7b4b('0x7')](_0x7b4b('0xe'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0xf')]);router['get'](_0x7b4b('0x10'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0x11')]);router[_0x7b4b('0x12')]('/',auth[_0x7b4b('0x8')](),controller[_0x7b4b('0x13')]);router[_0x7b4b('0x12')](_0x7b4b('0xe'),auth[_0x7b4b('0x8')](),controller[_0x7b4b('0x14')]);router[_0x7b4b('0x12')]('/:id/tags',auth[_0x7b4b('0x8')](),interaction[_0x7b4b('0x15')](_0x7b4b('0x16'),'faxinteraction:addtags'),controller['addTags']);router[_0x7b4b('0x17')](_0x7b4b('0xc'),auth['isAuthenticated'](),interaction[_0x7b4b('0x15')](_0x7b4b('0x16'),'faxinteraction:update'),controller[_0x7b4b('0x18')]);router['delete'](_0x7b4b('0xc'),auth[_0x7b4b('0x8')](),interaction[_0x7b4b('0x15')]('fax',_0x7b4b('0x19')),controller['destroy']);router['delete'](_0x7b4b('0x1a'),auth['isAuthenticated'](),controller[_0x7b4b('0x1b')]);module['exports']=router;
\ No newline at end of file
index 7af4a28..0fd25f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31c2=['TEXT','DATE','sequelize','medium','BOOLEAN','out'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x31c2,0x98));var _0x231c=function(_0x32ba68,_0x5541df){_0x32ba68=_0x32ba68-0x0;var _0xb93c46=_0x31c2[_0x32ba68];return _0xb93c46;};'use strict';var Sequelize=require(_0x231c('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x231c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x231c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x231c('0x3')),'defaultValue':_0x231c('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x231c('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0x231c('0x5')]}};
\ No newline at end of file
+var _0xaf93=['DATE','sequelize','exports','BOOLEAN','ENUM','out','TEXT'];(function(_0x66a60e,_0x34b813){var _0x54f2d8=function(_0x44e50e){while(--_0x44e50e){_0x66a60e['push'](_0x66a60e['shift']());}};_0x54f2d8(++_0x34b813);}(_0xaf93,0x151));var _0x3af9=function(_0x456224,_0x2d7be3){_0x456224=_0x456224-0x0;var _0x5eff8b=_0xaf93[_0x456224];return _0x5eff8b;};'use strict';var Sequelize=require(_0x3af9('0x0'));module[_0x3af9('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3af9('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3af9('0x3')]('in','out'),'defaultValue':_0x3af9('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x3af9('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0x3af9('0x6')]}};
\ No newline at end of file
index 2743551..e40c115 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e5c=['/var/opt/motion2/server/files/attachments/%s','basename','AttachmentId','download','join','root','server','attachments','eml-format','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','undefined','limit','offset','count','set','json','apply','reject','save','update','destroy','end','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','filter','where','VIRTUAL','options','includeAll','include','findAll','show','params','merge','find','body','describe','fax-interactions','accept','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','FaxInteractionId','isNil','read1stAt','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','ContactId','sequelize','Sequelize','contact','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','SELECT','email','motionChannel','rejectmessage','create','CmContact','Attachment','findOne','SendFax','FaxAccountId'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0x9e5c,0x96));var _0xc9e5=function(_0x16a632,_0x415222){_0x16a632=_0x16a632-0x0;var _0x8a2161=_0x9e5c[_0x16a632];return _0x8a2161;};'use strict';var emlformat=require(_0xc9e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc9e5('0x1'));var moment=require('moment');var BPromise=require(_0xc9e5('0x2'));var Mustache=require('mustache');var util=require(_0xc9e5('0x3'));var path=require('path');var sox=require(_0xc9e5('0x4'));var csv=require('to-csv');var ejs=require(_0xc9e5('0x5'));var fs=require('fs');var fs_extra=require(_0xc9e5('0x6'));var _=require(_0xc9e5('0x7'));var squel=require(_0xc9e5('0x8'));var crypto=require(_0xc9e5('0x9'));var jsforce=require(_0xc9e5('0xa'));var deskjs=require(_0xc9e5('0xb'));var toCsv=require(_0xc9e5('0xc'));var querystring=require(_0xc9e5('0xd'));var Papa=require(_0xc9e5('0xe'));var Redis=require(_0xc9e5('0xf'));var authService=require(_0xc9e5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc9e5('0x11'));var hardwareService=require(_0xc9e5('0x12'));var logger=require(_0xc9e5('0x13'))(_0xc9e5('0x14'));var utils=require('../../config/utils');var config=require(_0xc9e5('0x15'));var licenseUtil=require(_0xc9e5('0x16'));var db=require('../../mysqldb')['db'];config[_0xc9e5('0x17')]=_[_0xc9e5('0x18')](config[_0xc9e5('0x17')],{'host':_0xc9e5('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9e5('0x1a'))[_0xc9e5('0x1b')](socket);var jayson=require(_0xc9e5('0x1c'));var client=jayson['client'][_0xc9e5('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xc9e5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x1ffa20,_0x452573,_0x59f059,_0x1c36ec){return new BPromise(function(_0x33aa6a,_0x493979){var _0x302303=_0x1c36ec||client;return _0x302303[_0xc9e5('0x1e')](_0x1ffa20,_0x59f059)[_0xc9e5('0x1f')](function(_0x64b6ce){logger[_0xc9e5('0x20')](_0xc9e5('0x21'),_0x452573,_0xc9e5('0x22'));logger[_0xc9e5('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x452573,_0xc9e5('0x22'),JSON[_0xc9e5('0x24')](_0x64b6ce));if(_0x64b6ce[_0xc9e5('0x25')]){if(_0x64b6ce[_0xc9e5('0x25')][_0xc9e5('0x26')]===0x1f4){logger[_0xc9e5('0x25')](_0xc9e5('0x21'),_0x452573,_0x64b6ce['error'][_0xc9e5('0x27')]);return _0x493979(_0x64b6ce[_0xc9e5('0x25')][_0xc9e5('0x27')]);}logger[_0xc9e5('0x25')](_0xc9e5('0x21'),_0x452573,_0x64b6ce['error'][_0xc9e5('0x27')]);return _0x33aa6a(_0x64b6ce[_0xc9e5('0x25')]['message']);}else{logger[_0xc9e5('0x20')](_0xc9e5('0x21'),_0x452573,_0xc9e5('0x22'));_0x33aa6a(_0x64b6ce['result'][_0xc9e5('0x27')]);}})[_0xc9e5('0x28')](function(_0x124e48){logger[_0xc9e5('0x25')](_0xc9e5('0x21'),_0x452573,_0x124e48);_0x493979(_0x124e48);});});}function respondWithStatusCode(_0x4a998f,_0x9852bd){_0x9852bd=_0x9852bd||0xcc;return function(_0xc484ab){if(_0xc484ab){return _0x4a998f[_0xc9e5('0x29')](_0x9852bd);}return _0x4a998f[_0xc9e5('0x2a')](_0x9852bd)['end']();};}function respondWithResult(_0x492899,_0x152c41){_0x152c41=_0x152c41||0xc8;return function(_0x4def13){if(_0x4def13){return _0x492899['status'](_0x152c41)['json'](_0x4def13);}};}function respondWithFilteredResult(_0x49ef27,_0x51d7a5){return function(_0x88d40e){if(_0x88d40e){var _0x429fbc=typeof _0x51d7a5['offset']===_0xc9e5('0x2b')&&typeof _0x51d7a5[_0xc9e5('0x2c')]===_0xc9e5('0x2b');var _0x4cb60e=_0x88d40e['count'];var _0x460a92=_0x429fbc?0x0:_0x51d7a5[_0xc9e5('0x2d')];var _0x26ea40=_0x429fbc?_0x88d40e[_0xc9e5('0x2e')]:_0x51d7a5[_0xc9e5('0x2d')]+_0x51d7a5[_0xc9e5('0x2c')];var _0x2c29fd;if(_0x26ea40>=_0x4cb60e){_0x26ea40=_0x4cb60e;_0x2c29fd=0xc8;}else{_0x2c29fd=0xce;}_0x49ef27[_0xc9e5('0x2a')](_0x2c29fd);return _0x49ef27[_0xc9e5('0x2f')]('Content-Range',_0x460a92+'-'+_0x26ea40+'/'+_0x4cb60e)[_0xc9e5('0x30')](_0x88d40e);}return null;};}function patchUpdates(_0x1d35ad){return function(_0x27b550){try{jsonpatch[_0xc9e5('0x31')](_0x27b550,_0x1d35ad,!![]);}catch(_0x584d44){return BPromise[_0xc9e5('0x32')](_0x584d44);}return _0x27b550[_0xc9e5('0x33')]();};}function saveUpdates(_0x1f024a,_0x1a537d){return function(_0x42a675){if(_0x42a675){return _0x42a675[_0xc9e5('0x34')](_0x1f024a)[_0xc9e5('0x1f')](function(_0x1709c1){return _0x1709c1;});}return null;};}function removeEntity(_0x4158eb,_0x395bc2){return function(_0x4c999c){if(_0x4c999c){return _0x4c999c[_0xc9e5('0x35')]()[_0xc9e5('0x1f')](function(){_0x4158eb[_0xc9e5('0x2a')](0xcc)[_0xc9e5('0x36')]();});}};}function handleEntityNotFound(_0x117c50,_0x304da8){return function(_0x50e0b1){if(!_0x50e0b1){_0x117c50[_0xc9e5('0x29')](0x194);}return _0x50e0b1;};}function handleError(_0x4222d4,_0x43a7d9){_0x43a7d9=_0x43a7d9||0x1f4;return function(_0x501fc5){logger[_0xc9e5('0x25')](_0x501fc5[_0xc9e5('0x37')]);if(_0x501fc5[_0xc9e5('0x38')]){delete _0x501fc5[_0xc9e5('0x38')];}_0x4222d4[_0xc9e5('0x2a')](_0x43a7d9)[_0xc9e5('0x39')](_0x501fc5);};}exports[_0xc9e5('0x3a')]=function(_0x52fe38,_0x4f842a){var _0x59a211={},_0x202276={},_0x35e4c7={'count':0x0,'rows':[]};var _0x287b98=_[_0xc9e5('0x3b')](db[_0xc9e5('0x3c')][_0xc9e5('0x3d')],function(_0x3299d9){return{'name':_0x3299d9[_0xc9e5('0x3e')],'type':_0x3299d9[_0xc9e5('0x3f')]['key']};});_0x202276[_0xc9e5('0x40')]=_[_0xc9e5('0x3b')](_0x287b98,_0xc9e5('0x38'));_0x202276[_0xc9e5('0x41')]=_[_0xc9e5('0x42')](_0x52fe38['query']);_0x202276[_0xc9e5('0x43')]=_[_0xc9e5('0x44')](_0x202276[_0xc9e5('0x40')],_0x202276['query']);_0x59a211[_0xc9e5('0x45')]=_['intersection'](_0x202276[_0xc9e5('0x40')],qs[_0xc9e5('0x46')](_0x52fe38[_0xc9e5('0x41')][_0xc9e5('0x46')]));_0x59a211[_0xc9e5('0x45')]=_0x59a211['attributes'][_0xc9e5('0x47')]?_0x59a211['attributes']:_0x202276[_0xc9e5('0x40')];if(!_0x52fe38[_0xc9e5('0x41')][_0xc9e5('0x48')](_0xc9e5('0x49'))){_0x59a211[_0xc9e5('0x2c')]=qs[_0xc9e5('0x2c')](_0x52fe38[_0xc9e5('0x41')][_0xc9e5('0x2c')]);_0x59a211[_0xc9e5('0x2d')]=qs[_0xc9e5('0x2d')](_0x52fe38['query'][_0xc9e5('0x2d')]);}_0x59a211['order']=qs['sort'](_0x52fe38['query']['sort']);_0x59a211['where']=qs['filters'](_['pick'](_0x52fe38[_0xc9e5('0x41')],_0x202276[_0xc9e5('0x43')]),_0x287b98);if(_0x52fe38[_0xc9e5('0x41')][_0xc9e5('0x4a')]){_0x59a211[_0xc9e5('0x4b')]=_['merge'](_0x59a211[_0xc9e5('0x4b')],{'$or':_[_0xc9e5('0x3b')](_0x287b98,function(_0x2123a9){if(_0x2123a9['type']!==_0xc9e5('0x4c')){var _0xe4f653={};_0xe4f653[_0x2123a9['name']]={'$like':'%'+_0x52fe38[_0xc9e5('0x41')][_0xc9e5('0x4a')]+'%'};return _0xe4f653;}})});}_0x59a211=_['merge']({},_0x59a211,_0x52fe38[_0xc9e5('0x4d')]);var _0x37eec1={'where':_0x59a211[_0xc9e5('0x4b')]};return db['FaxMessage']['count'](_0x37eec1)[_0xc9e5('0x1f')](function(_0x4c24c0){_0x35e4c7[_0xc9e5('0x2e')]=_0x4c24c0;if(_0x52fe38['query'][_0xc9e5('0x4e')]){_0x59a211[_0xc9e5('0x4f')]=[{'all':!![]}];}return db['FaxMessage'][_0xc9e5('0x50')](_0x59a211);})[_0xc9e5('0x1f')](function(_0x4fc9bc){_0x35e4c7['rows']=_0x4fc9bc;return _0x35e4c7;})[_0xc9e5('0x1f')](respondWithFilteredResult(_0x4f842a,_0x59a211))[_0xc9e5('0x28')](handleError(_0x4f842a,null));};exports[_0xc9e5('0x51')]=function(_0x25009f,_0x430cbb){var _0x5dda4b={'raw':!![],'where':{'id':_0x25009f[_0xc9e5('0x52')]['id']}},_0x153c4f={};_0x153c4f[_0xc9e5('0x40')]=_[_0xc9e5('0x42')](db['FaxMessage'][_0xc9e5('0x3d')]);_0x153c4f[_0xc9e5('0x41')]=_[_0xc9e5('0x42')](_0x25009f[_0xc9e5('0x41')]);_0x153c4f[_0xc9e5('0x43')]=_[_0xc9e5('0x44')](_0x153c4f['model'],_0x153c4f[_0xc9e5('0x41')]);_0x5dda4b[_0xc9e5('0x45')]=_['intersection'](_0x153c4f[_0xc9e5('0x40')],qs[_0xc9e5('0x46')](_0x25009f[_0xc9e5('0x41')]['fields']));_0x5dda4b[_0xc9e5('0x45')]=_0x5dda4b['attributes'][_0xc9e5('0x47')]?_0x5dda4b[_0xc9e5('0x45')]:_0x153c4f['model'];if(_0x25009f[_0xc9e5('0x41')]['includeAll']){_0x5dda4b['include']=[{'all':!![]}];}_0x5dda4b=_[_0xc9e5('0x53')]({},_0x5dda4b,_0x25009f[_0xc9e5('0x4d')]);return db[_0xc9e5('0x3c')][_0xc9e5('0x54')](_0x5dda4b)[_0xc9e5('0x1f')](handleEntityNotFound(_0x430cbb,null))[_0xc9e5('0x1f')](respondWithResult(_0x430cbb,null))[_0xc9e5('0x28')](handleError(_0x430cbb,null));};exports[_0xc9e5('0x34')]=function(_0x187a69,_0x238571){if(_0x187a69[_0xc9e5('0x55')]['id']){delete _0x187a69[_0xc9e5('0x55')]['id'];}return db['FaxMessage'][_0xc9e5('0x54')]({'where':{'id':_0x187a69[_0xc9e5('0x52')]['id']}})[_0xc9e5('0x1f')](handleEntityNotFound(_0x238571,null))['then'](saveUpdates(_0x187a69[_0xc9e5('0x55')],null))[_0xc9e5('0x1f')](respondWithResult(_0x238571,null))[_0xc9e5('0x28')](handleError(_0x238571,null));};exports[_0xc9e5('0x35')]=function(_0x12bb95,_0x128ac1){return db[_0xc9e5('0x3c')][_0xc9e5('0x54')]({'where':{'id':_0x12bb95[_0xc9e5('0x52')]['id']}})[_0xc9e5('0x1f')](handleEntityNotFound(_0x128ac1,null))[_0xc9e5('0x1f')](removeEntity(_0x128ac1,null))[_0xc9e5('0x28')](handleError(_0x128ac1,null));};exports[_0xc9e5('0x56')]=function(_0xd2c1de,_0xd8d797){return db[_0xc9e5('0x3c')][_0xc9e5('0x56')]()[_0xc9e5('0x1f')](respondWithResult(_0xd8d797,null))[_0xc9e5('0x28')](handleError(_0xd8d797,null));};var interaction_log=require('../../config/logger')(_0xc9e5('0x57'));exports[_0xc9e5('0x58')]=function(_0x397e4f,_0x508b91,_0x570406){var _0x151bf5={'agent':{},'channel':_0xc9e5('0x59')};if(_0x397e4f[_0xc9e5('0x55')]['id']){delete _0x397e4f[_0xc9e5('0x55')]['id'];}_0x397e4f[_0xc9e5('0x55')][_0xc9e5('0x5a')]=!![];_0x397e4f[_0xc9e5('0x55')]['readAt']=moment()[_0xc9e5('0x5b')](_0xc9e5('0x5c'));_0x397e4f[_0xc9e5('0x55')][_0xc9e5('0x5d')]=_0x397e4f[_0xc9e5('0x55')][_0xc9e5('0x5d')]||_0x397e4f['user']['id'];_0x151bf5['agent']['id']=_0x397e4f[_0xc9e5('0x55')][_0xc9e5('0x5d')];return db['FaxMessage']['find']({'where':{'id':_0x397e4f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x508b91,null))['then'](saveUpdates(_0x397e4f[_0xc9e5('0x55')],null))[_0xc9e5('0x1f')](function(_0x8d8d7e){if(_0x8d8d7e){_0x151bf5['message']=_0x8d8d7e['get']({'plain':!![]});return db['FaxInteraction'][_0xc9e5('0x54')]({'where':{'id':_0x8d8d7e[_0xc9e5('0x5e')]}});}return null;})[_0xc9e5('0x1f')](handleEntityNotFound(_0x508b91,null))[_0xc9e5('0x1f')](function(_0x573373){if(_0x573373){return _0x573373[_0xc9e5('0x34')]({'UserId':_0x397e4f['body']['UserId'],'read1stAt':_[_0xc9e5('0x5f')](_0x573373[_0xc9e5('0x60')])?moment()[_0xc9e5('0x5b')](_0xc9e5('0x5c')):undefined});}return null;})['then'](function(_0x40caa9){if(_0x40caa9){_0x151bf5['interaction']=_0x40caa9[_0xc9e5('0x61')]({'plain':!![]});interaction_log[_0xc9e5('0x20')](_0xc9e5('0x62'),_0x397e4f['user']['id'],_0x397e4f['user']['name'],_0x397e4f[_0xc9e5('0x63')][_0xc9e5('0x64')],_0x151bf5[_0xc9e5('0x65')]['id'],_0x397e4f['body']?JSON[_0xc9e5('0x24')](_0x397e4f[_0xc9e5('0x55')]):_0xc9e5('0x66'));return respondWithRpcPromise(_0xc9e5('0x67'),'acceptMessage',_0x151bf5);}return null;})['then'](function(_0x15d511){var _0xf60f6c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x15d511['message'][_0xc9e5('0x68')];return db[_0xc9e5('0x69')][_0xc9e5('0x41')](_0xf60f6c,{'type':db[_0xc9e5('0x6a')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0xfdf2f){return _0xfdf2f;});})['then'](function(_0x3cae38){if(_0x3cae38){_0x151bf5[_0xc9e5('0x27')][_0xc9e5('0x6b')]=_0x3cae38[0x0];if(!_0x397e4f[_0xc9e5('0x55')]['UserId'])return;return db[_0xc9e5('0x6c')]['find']({'where':{'id':_0x397e4f[_0xc9e5('0x55')]['UserId'],'role':'agent'},'attributes':['id','name',_0xc9e5('0x6d'),'email',_0xc9e5('0x6e')],'raw':!![]});}return null;})[_0xc9e5('0x1f')](function(_0x1e123a){if(!_0x1e123a)return null;_0x151bf5['message']['agent']=_0x1e123a;return _0x151bf5;})[_0xc9e5('0x1f')](function(_0x15f0f9){if(_0x15f0f9){if(_0x397e4f['body'][_0xc9e5('0x6f')]){_0x151bf5[_0xc9e5('0x27')][_0xc9e5('0x70')]=util[_0xc9e5('0x5b')](_0xc9e5('0x71'),_0x397e4f[_0xc9e5('0x63')][_0xc9e5('0x38')]);_0x151bf5[_0xc9e5('0x27')]['channel']=_0x151bf5[_0xc9e5('0x72')];_0x151bf5['message']['motionChannel']=_0x151bf5[_0xc9e5('0x72')];_0x151bf5[_0xc9e5('0x27')][_0xc9e5('0x73')]=_0xc9e5('0x58');return respondWithRpcPromise(_0xc9e5('0x74'),_0xc9e5('0x74'),{'event':_0xc9e5('0x75'),'message':_0x151bf5[_0xc9e5('0x27')]},client9002)['then'](function(){return _0x151bf5;});}return _0x151bf5;}return null;})[_0xc9e5('0x1f')](respondWithResult(_0x508b91,null))[_0xc9e5('0x28')](handleError(_0x508b91,null));};var interaction_log=require(_0xc9e5('0x13'))('fax-interactions');exports['reject']=function(_0x3dffff,_0x29b019,_0x14d72a){var _0x4db2e0={'agent':{},'channel':_0xc9e5('0x59')};if(_0x3dffff['body']['id']){delete _0x3dffff[_0xc9e5('0x55')]['id'];}_0x3dffff['body'][_0xc9e5('0x5d')]=_0x3dffff[_0xc9e5('0x55')]['UserId']||_0x3dffff['user']['id'];_0x4db2e0[_0xc9e5('0x76')]['id']=_0x3dffff[_0xc9e5('0x55')][_0xc9e5('0x5d')];return db[_0xc9e5('0x3c')]['find']({'where':{'id':_0x3dffff[_0xc9e5('0x52')]['id'],'UserId':null}})[_0xc9e5('0x1f')](handleEntityNotFound(_0x29b019,null))[_0xc9e5('0x1f')](function(_0x73d0e9){if(_0x73d0e9){_0x4db2e0['message']=_0x73d0e9[_0xc9e5('0x61')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x73d0e9[_0xc9e5('0x5e')]}});}return null;})['then'](handleEntityNotFound(_0x29b019,null))[_0xc9e5('0x1f')](function(_0x1502df){if(_0x1502df){_0x4db2e0['interaction']=_0x1502df[_0xc9e5('0x61')]({'plain':!![]});interaction_log['info'](_0xc9e5('0x77'),_0x3dffff[_0xc9e5('0x63')]['id'],_0x3dffff[_0xc9e5('0x63')][_0xc9e5('0x38')],_0x3dffff[_0xc9e5('0x63')]['role'],_0x4db2e0[_0xc9e5('0x65')]['id'],_0x3dffff[_0xc9e5('0x55')]?JSON[_0xc9e5('0x24')](_0x3dffff[_0xc9e5('0x55')]):_0xc9e5('0x66'));return respondWithRpcPromise(_0xc9e5('0x78'),_0xc9e5('0x79'),_0x4db2e0);}return null;})[_0xc9e5('0x1f')](function(_0x3ef3a9){var _0xf95adc=_0xc9e5('0x7a')+_0x3ef3a9[_0xc9e5('0x27')]['ContactId'];return db[_0xc9e5('0x69')][_0xc9e5('0x41')](_0xf95adc,{'type':db[_0xc9e5('0x6a')][_0xc9e5('0x7b')][_0xc9e5('0x7c')],'raw':!![]})[_0xc9e5('0x1f')](function(_0x40f156){return _0x40f156;});})[_0xc9e5('0x1f')](function(_0x20004b){if(_0x20004b){_0x4db2e0['message'][_0xc9e5('0x6b')]=_0x20004b[0x0];if(!_0x3dffff[_0xc9e5('0x55')][_0xc9e5('0x5d')])return;return db['User'][_0xc9e5('0x54')]({'where':{'id':_0x3dffff[_0xc9e5('0x55')][_0xc9e5('0x5d')],'role':_0xc9e5('0x76')},'attributes':['id',_0xc9e5('0x38'),_0xc9e5('0x6d'),_0xc9e5('0x7d'),_0xc9e5('0x6e')],'raw':!![]});}return null;})[_0xc9e5('0x1f')](function(_0x1b857e){if(!_0x1b857e)return null;_0x4db2e0['message'][_0xc9e5('0x76')]=_0x1b857e;return _0x4db2e0;})[_0xc9e5('0x1f')](function(_0x470049){if(_0x470049){_0x470049[_0xc9e5('0x27')]['interface']=util['format'](_0xc9e5('0x71'),_0x3dffff[_0xc9e5('0x63')][_0xc9e5('0x38')]);_0x470049[_0xc9e5('0x27')]['channel']=_0x4db2e0[_0xc9e5('0x72')];_0x470049[_0xc9e5('0x27')][_0xc9e5('0x7e')]=_0x4db2e0[_0xc9e5('0x72')];_0x470049[_0xc9e5('0x27')][_0xc9e5('0x73')]=_0xc9e5('0x32');respondWithRpcPromise(_0xc9e5('0x74'),_0xc9e5('0x74'),{'event':_0xc9e5('0x7f'),'message':_0x470049[_0xc9e5('0x27')]},client9002);return _0x4db2e0;}return null;})[_0xc9e5('0x1f')](respondWithResult(_0x29b019,null))['catch'](handleError(_0x29b019,null));};exports[_0xc9e5('0x80')]=function(_0x1e3ab0,_0x1931b4){var _0x56e854;return db['FaxMessage'][_0xc9e5('0x80')](_0x1e3ab0[_0xc9e5('0x55')],{})[_0xc9e5('0x1f')](function(_0x315d1f){_0x56e854=_0x315d1f;return db[_0xc9e5('0x81')]['findOne']({'where':{'id':_0x56e854['ContactId']}});})[_0xc9e5('0x1f')](function(_0x10c7d9){if(_[_0xc9e5('0x5f')](_0x10c7d9)){return;}else{_0x56e854[_0xc9e5('0x59')]=_0x10c7d9['fax'];return db[_0xc9e5('0x82')][_0xc9e5('0x83')]({'where':{'id':_0x56e854['AttachmentId']}});}})[_0xc9e5('0x1f')](function(_0x54ab61){return respondWithRpcPromise(_0xc9e5('0x84'),_0xc9e5('0x84'),{'FaxAccountId':_[_0xc9e5('0x5f')](_0x1e3ab0[_0xc9e5('0x55')])?undefined:_0x1e3ab0[_0xc9e5('0x55')][_0xc9e5('0x85')],'path':_['isNil'](_0x54ab61)?undefined:util['format'](_0xc9e5('0x86'),_0x54ab61[_0xc9e5('0x87')]),'fax':_[_0xc9e5('0x5f')](_0x56e854[_0xc9e5('0x59')])?undefined:_0x56e854[_0xc9e5('0x59')],'AttachmentId':_0x56e854[_0xc9e5('0x88')]},client9002);})[_0xc9e5('0x1f')](respondWithResult(_0x1931b4,0xc9))['catch'](handleError(_0x1931b4,null));};exports[_0xc9e5('0x89')]=function(_0x62ef1c,_0x4e678e){var _0x35be2e=path[_0xc9e5('0x8a')](config[_0xc9e5('0x8b')],_0xc9e5('0x8c'),'files',_0xc9e5('0x8d'));return db[_0xc9e5('0x3c')][_0xc9e5('0x54')]({'where':{'id':_0x62ef1c[_0xc9e5('0x52')]['id']},'include':[{'model':db[_0xc9e5('0x82')],'as':_0xc9e5('0x82')}]})['then'](handleEntityNotFound(_0x4e678e,null))[_0xc9e5('0x1f')](function(_0x4efc31){if(_0x4efc31){return _0x4e678e[_0xc9e5('0x89')](path[_0xc9e5('0x8a')](_0x35be2e,_0x4efc31[_0xc9e5('0x82')][_0xc9e5('0x87')]));}})[_0xc9e5('0x28')](handleError(_0x4e678e,null));};
\ No newline at end of file
+var _0xa014=['offset','limit','count','status','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','FaxMessage','includeAll','include','findAll','show','params','length','find','body','destroy','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','email','interface','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','User','fullname','internal','SIP/%s','motionChannel','CmContact','findOne','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','files','attachments','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxMessage.socket','register','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','end','json'];(function(_0x448869,_0x2b9f06){var _0x5ae011=function(_0x521d2c){while(--_0x521d2c){_0x448869['push'](_0x448869['shift']());}};_0x5ae011(++_0x2b9f06);}(_0xa014,0xf1));var _0x4a01=function(_0x2c516c,_0x16ec1c){_0x2c516c=_0x2c516c-0x0;var _0x43e4c2=_0xa014[_0x2c516c];return _0x43e4c2;};'use strict';var emlformat=require(_0x4a01('0x0'));var rimraf=require(_0x4a01('0x1'));var zipdir=require(_0x4a01('0x2'));var jsonpatch=require(_0x4a01('0x3'));var rp=require(_0x4a01('0x4'));var moment=require(_0x4a01('0x5'));var BPromise=require(_0x4a01('0x6'));var Mustache=require('mustache');var util=require(_0x4a01('0x7'));var path=require(_0x4a01('0x8'));var sox=require(_0x4a01('0x9'));var csv=require('to-csv');var ejs=require(_0x4a01('0xa'));var fs=require('fs');var fs_extra=require(_0x4a01('0xb'));var _=require(_0x4a01('0xc'));var squel=require(_0x4a01('0xd'));var crypto=require('crypto');var jsforce=require(_0x4a01('0xe'));var deskjs=require(_0x4a01('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4a01('0x10'));var Papa=require(_0x4a01('0x11'));var Redis=require('ioredis');var authService=require(_0x4a01('0x12'));var qs=require(_0x4a01('0x13'));var as=require(_0x4a01('0x14'));var hardwareService=require(_0x4a01('0x15'));var logger=require('../../config/logger')(_0x4a01('0x16'));var utils=require(_0x4a01('0x17'));var config=require(_0x4a01('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a01('0x19'))['db'];config[_0x4a01('0x1a')]=_[_0x4a01('0x1b')](config['redis'],{'host':_0x4a01('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a01('0x1a')]));require(_0x4a01('0x1d'))[_0x4a01('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4a01('0x1f')][_0x4a01('0x20')]({'port':0x232c});var client9002=jayson[_0x4a01('0x1f')][_0x4a01('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x33ec04,_0x549d2e,_0x214db7,_0x53899b){return new BPromise(function(_0x295386,_0x1432b0){var _0x55cb9b=_0x53899b||client;return _0x55cb9b[_0x4a01('0x21')](_0x33ec04,_0x214db7)['then'](function(_0x33446f){logger[_0x4a01('0x22')](_0x4a01('0x23'),_0x549d2e,_0x4a01('0x24'));logger[_0x4a01('0x25')](_0x4a01('0x26'),_0x549d2e,_0x4a01('0x24'),JSON['stringify'](_0x33446f));if(_0x33446f[_0x4a01('0x27')]){if(_0x33446f[_0x4a01('0x27')]['code']===0x1f4){logger['error'](_0x4a01('0x23'),_0x549d2e,_0x33446f[_0x4a01('0x27')][_0x4a01('0x28')]);return _0x1432b0(_0x33446f[_0x4a01('0x27')][_0x4a01('0x28')]);}logger[_0x4a01('0x27')](_0x4a01('0x23'),_0x549d2e,_0x33446f[_0x4a01('0x27')][_0x4a01('0x28')]);return _0x295386(_0x33446f[_0x4a01('0x27')][_0x4a01('0x28')]);}else{logger[_0x4a01('0x22')]('FaxMessage,\x20%s,\x20%s',_0x549d2e,_0x4a01('0x24'));_0x295386(_0x33446f['result'][_0x4a01('0x28')]);}})[_0x4a01('0x29')](function(_0x5155bf){logger[_0x4a01('0x27')]('FaxMessage,\x20%s,\x20%s',_0x549d2e,_0x5155bf);_0x1432b0(_0x5155bf);});});}function respondWithStatusCode(_0x17e642,_0x297122){_0x297122=_0x297122||0xcc;return function(_0x57a31b){if(_0x57a31b){return _0x17e642[_0x4a01('0x2a')](_0x297122);}return _0x17e642['status'](_0x297122)[_0x4a01('0x2b')]();};}function respondWithResult(_0x27dc06,_0x4eabf4){_0x4eabf4=_0x4eabf4||0xc8;return function(_0x5e0ae6){if(_0x5e0ae6){return _0x27dc06['status'](_0x4eabf4)[_0x4a01('0x2c')](_0x5e0ae6);}};}function respondWithFilteredResult(_0x796d32,_0x2bd308){return function(_0x167e48){if(_0x167e48){var _0x4ab542=typeof _0x2bd308[_0x4a01('0x2d')]==='undefined'&&typeof _0x2bd308[_0x4a01('0x2e')]==='undefined';var _0x1fdcd7=_0x167e48[_0x4a01('0x2f')];var _0x25f25d=_0x4ab542?0x0:_0x2bd308[_0x4a01('0x2d')];var _0x25fa16=_0x4ab542?_0x167e48[_0x4a01('0x2f')]:_0x2bd308[_0x4a01('0x2d')]+_0x2bd308[_0x4a01('0x2e')];var _0x12cfd5;if(_0x25fa16>=_0x1fdcd7){_0x25fa16=_0x1fdcd7;_0x12cfd5=0xc8;}else{_0x12cfd5=0xce;}_0x796d32[_0x4a01('0x30')](_0x12cfd5);return _0x796d32['set'](_0x4a01('0x31'),_0x25f25d+'-'+_0x25fa16+'/'+_0x1fdcd7)[_0x4a01('0x2c')](_0x167e48);}return null;};}function patchUpdates(_0x27b2c7){return function(_0x4ea492){try{jsonpatch[_0x4a01('0x32')](_0x4ea492,_0x27b2c7,!![]);}catch(_0x520c02){return BPromise[_0x4a01('0x33')](_0x520c02);}return _0x4ea492[_0x4a01('0x34')]();};}function saveUpdates(_0x5ae4c0,_0x27ad9d){return function(_0x453b2c){if(_0x453b2c){return _0x453b2c[_0x4a01('0x35')](_0x5ae4c0)[_0x4a01('0x36')](function(_0x55a9b4){return _0x55a9b4;});}return null;};}function removeEntity(_0x2d01ae,_0x3884ad){return function(_0x1f0db1){if(_0x1f0db1){return _0x1f0db1['destroy']()[_0x4a01('0x36')](function(){_0x2d01ae[_0x4a01('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db1f8,_0x51cd1d){return function(_0x478a8e){if(!_0x478a8e){_0x2db1f8[_0x4a01('0x2a')](0x194);}return _0x478a8e;};}function handleError(_0x2cbfc5,_0x1357b3){_0x1357b3=_0x1357b3||0x1f4;return function(_0x2c9497){logger[_0x4a01('0x27')](_0x2c9497[_0x4a01('0x37')]);if(_0x2c9497['name']){delete _0x2c9497[_0x4a01('0x38')];}_0x2cbfc5[_0x4a01('0x30')](_0x1357b3)[_0x4a01('0x39')](_0x2c9497);};}exports[_0x4a01('0x3a')]=function(_0x5e1fad,_0x2f8fba){var _0x307736={},_0x4f4407={},_0x5b669b={'count':0x0,'rows':[]};var _0xde2a96=_[_0x4a01('0x3b')](db['FaxMessage'][_0x4a01('0x3c')],function(_0x493bfb){return{'name':_0x493bfb[_0x4a01('0x3d')],'type':_0x493bfb[_0x4a01('0x3e')]['key']};});_0x4f4407[_0x4a01('0x3f')]=_[_0x4a01('0x3b')](_0xde2a96,_0x4a01('0x38'));_0x4f4407[_0x4a01('0x40')]=_[_0x4a01('0x41')](_0x5e1fad[_0x4a01('0x40')]);_0x4f4407[_0x4a01('0x42')]=_['intersection'](_0x4f4407['model'],_0x4f4407['query']);_0x307736[_0x4a01('0x43')]=_[_0x4a01('0x44')](_0x4f4407['model'],qs['fields'](_0x5e1fad['query'][_0x4a01('0x45')]));_0x307736[_0x4a01('0x43')]=_0x307736['attributes']['length']?_0x307736['attributes']:_0x4f4407['model'];if(!_0x5e1fad[_0x4a01('0x40')][_0x4a01('0x46')]('nolimit')){_0x307736[_0x4a01('0x2e')]=qs[_0x4a01('0x2e')](_0x5e1fad[_0x4a01('0x40')]['limit']);_0x307736[_0x4a01('0x2d')]=qs['offset'](_0x5e1fad[_0x4a01('0x40')][_0x4a01('0x2d')]);}_0x307736[_0x4a01('0x47')]=qs[_0x4a01('0x48')](_0x5e1fad[_0x4a01('0x40')]['sort']);_0x307736[_0x4a01('0x49')]=qs[_0x4a01('0x42')](_[_0x4a01('0x4a')](_0x5e1fad[_0x4a01('0x40')],_0x4f4407[_0x4a01('0x42')]),_0xde2a96);if(_0x5e1fad[_0x4a01('0x40')]['filter']){_0x307736[_0x4a01('0x49')]=_[_0x4a01('0x4b')](_0x307736[_0x4a01('0x49')],{'$or':_[_0x4a01('0x3b')](_0xde2a96,function(_0x228c87){if(_0x228c87[_0x4a01('0x3e')]!==_0x4a01('0x4c')){var _0x52e09f={};_0x52e09f[_0x228c87[_0x4a01('0x38')]]={'$like':'%'+_0x5e1fad[_0x4a01('0x40')][_0x4a01('0x4d')]+'%'};return _0x52e09f;}})});}_0x307736=_[_0x4a01('0x4b')]({},_0x307736,_0x5e1fad[_0x4a01('0x4e')]);var _0x3deabf={'where':_0x307736[_0x4a01('0x49')]};return db[_0x4a01('0x4f')][_0x4a01('0x2f')](_0x3deabf)['then'](function(_0x1f80f1){_0x5b669b[_0x4a01('0x2f')]=_0x1f80f1;if(_0x5e1fad[_0x4a01('0x40')][_0x4a01('0x50')]){_0x307736[_0x4a01('0x51')]=[{'all':!![]}];}return db[_0x4a01('0x4f')][_0x4a01('0x52')](_0x307736);})['then'](function(_0x36add4){_0x5b669b['rows']=_0x36add4;return _0x5b669b;})[_0x4a01('0x36')](respondWithFilteredResult(_0x2f8fba,_0x307736))[_0x4a01('0x29')](handleError(_0x2f8fba,null));};exports[_0x4a01('0x53')]=function(_0x3b9eef,_0x5c3b7c){var _0xf65492={'raw':!![],'where':{'id':_0x3b9eef[_0x4a01('0x54')]['id']}},_0x36022e={};_0x36022e[_0x4a01('0x3f')]=_['keys'](db[_0x4a01('0x4f')][_0x4a01('0x3c')]);_0x36022e[_0x4a01('0x40')]=_[_0x4a01('0x41')](_0x3b9eef[_0x4a01('0x40')]);_0x36022e['filters']=_['intersection'](_0x36022e['model'],_0x36022e['query']);_0xf65492[_0x4a01('0x43')]=_[_0x4a01('0x44')](_0x36022e[_0x4a01('0x3f')],qs[_0x4a01('0x45')](_0x3b9eef[_0x4a01('0x40')]['fields']));_0xf65492[_0x4a01('0x43')]=_0xf65492['attributes'][_0x4a01('0x55')]?_0xf65492[_0x4a01('0x43')]:_0x36022e[_0x4a01('0x3f')];if(_0x3b9eef['query'][_0x4a01('0x50')]){_0xf65492[_0x4a01('0x51')]=[{'all':!![]}];}_0xf65492=_[_0x4a01('0x4b')]({},_0xf65492,_0x3b9eef['options']);return db['FaxMessage'][_0x4a01('0x56')](_0xf65492)['then'](handleEntityNotFound(_0x5c3b7c,null))[_0x4a01('0x36')](respondWithResult(_0x5c3b7c,null))[_0x4a01('0x29')](handleError(_0x5c3b7c,null));};exports[_0x4a01('0x35')]=function(_0x22e4d4,_0x52365c){if(_0x22e4d4[_0x4a01('0x57')]['id']){delete _0x22e4d4[_0x4a01('0x57')]['id'];}return db[_0x4a01('0x4f')]['find']({'where':{'id':_0x22e4d4['params']['id']}})[_0x4a01('0x36')](handleEntityNotFound(_0x52365c,null))[_0x4a01('0x36')](saveUpdates(_0x22e4d4[_0x4a01('0x57')],null))['then'](respondWithResult(_0x52365c,null))[_0x4a01('0x29')](handleError(_0x52365c,null));};exports[_0x4a01('0x58')]=function(_0x592fe9,_0x56aa98){return db[_0x4a01('0x4f')]['find']({'where':{'id':_0x592fe9[_0x4a01('0x54')]['id']}})['then'](handleEntityNotFound(_0x56aa98,null))['then'](removeEntity(_0x56aa98,null))['catch'](handleError(_0x56aa98,null));};exports['describe']=function(_0x4f0097,_0x3a77b6){return db['FaxMessage'][_0x4a01('0x59')]()[_0x4a01('0x36')](respondWithResult(_0x3a77b6,null))[_0x4a01('0x29')](handleError(_0x3a77b6,null));};var interaction_log=require(_0x4a01('0x5a'))(_0x4a01('0x5b'));exports[_0x4a01('0x5c')]=function(_0x48e829,_0x48a5de,_0x5d3959){var _0x10437a={'agent':{},'channel':_0x4a01('0x5d')};if(_0x48e829['body']['id']){delete _0x48e829[_0x4a01('0x57')]['id'];}_0x48e829['body'][_0x4a01('0x5e')]=!![];_0x48e829[_0x4a01('0x57')][_0x4a01('0x5f')]=moment()[_0x4a01('0x60')](_0x4a01('0x61'));_0x48e829[_0x4a01('0x57')][_0x4a01('0x62')]=_0x48e829['body'][_0x4a01('0x62')]||_0x48e829[_0x4a01('0x63')]['id'];_0x10437a[_0x4a01('0x64')]['id']=_0x48e829['body'][_0x4a01('0x62')];return db[_0x4a01('0x4f')][_0x4a01('0x56')]({'where':{'id':_0x48e829[_0x4a01('0x54')]['id'],'UserId':null}})[_0x4a01('0x36')](handleEntityNotFound(_0x48a5de,null))['then'](saveUpdates(_0x48e829[_0x4a01('0x57')],null))[_0x4a01('0x36')](function(_0x28893){if(_0x28893){_0x10437a[_0x4a01('0x28')]=_0x28893['get']({'plain':!![]});return db[_0x4a01('0x65')][_0x4a01('0x56')]({'where':{'id':_0x28893[_0x4a01('0x66')]}});}return null;})[_0x4a01('0x36')](handleEntityNotFound(_0x48a5de,null))[_0x4a01('0x36')](function(_0x29d68b){if(_0x29d68b){return _0x29d68b[_0x4a01('0x35')]({'UserId':_0x48e829['body'][_0x4a01('0x62')],'read1stAt':_[_0x4a01('0x67')](_0x29d68b[_0x4a01('0x68')])?moment()[_0x4a01('0x60')](_0x4a01('0x61')):undefined});}return null;})[_0x4a01('0x36')](function(_0x1d8d3f){if(_0x1d8d3f){_0x10437a[_0x4a01('0x69')]=_0x1d8d3f[_0x4a01('0x6a')]({'plain':!![]});interaction_log[_0x4a01('0x22')](_0x4a01('0x6b'),_0x48e829[_0x4a01('0x63')]['id'],_0x48e829[_0x4a01('0x63')][_0x4a01('0x38')],_0x48e829[_0x4a01('0x63')][_0x4a01('0x6c')],_0x10437a[_0x4a01('0x69')]['id'],_0x48e829[_0x4a01('0x57')]?JSON[_0x4a01('0x6d')](_0x48e829[_0x4a01('0x57')]):_0x4a01('0x6e'));return respondWithRpcPromise('AcceptMessage',_0x4a01('0x6f'),_0x10437a);}return null;})[_0x4a01('0x36')](function(_0x8ada0d){var _0x43a92c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x8ada0d[_0x4a01('0x28')][_0x4a01('0x70')];return db['sequelize'][_0x4a01('0x40')](_0x43a92c,{'type':db[_0x4a01('0x71')][_0x4a01('0x72')][_0x4a01('0x73')],'raw':!![]})['then'](function(_0x159393){return _0x159393;});})['then'](function(_0x5e1e71){if(_0x5e1e71){_0x10437a[_0x4a01('0x28')][_0x4a01('0x74')]=_0x5e1e71[0x0];if(!_0x48e829[_0x4a01('0x57')][_0x4a01('0x62')])return;return db['User'][_0x4a01('0x56')]({'where':{'id':_0x48e829[_0x4a01('0x57')]['UserId'],'role':'agent'},'attributes':['id','name','fullname',_0x4a01('0x75'),'internal'],'raw':!![]});}return null;})['then'](function(_0x19b572){if(!_0x19b572)return null;_0x10437a[_0x4a01('0x28')][_0x4a01('0x64')]=_0x19b572;return _0x10437a;})['then'](function(_0x1655fa){if(_0x1655fa){if(_0x48e829[_0x4a01('0x57')]['manual']){_0x10437a[_0x4a01('0x28')][_0x4a01('0x76')]=util[_0x4a01('0x60')]('SIP/%s',_0x48e829[_0x4a01('0x63')][_0x4a01('0x38')]);_0x10437a['message'][_0x4a01('0x77')]=_0x10437a[_0x4a01('0x77')];_0x10437a[_0x4a01('0x28')]['motionChannel']=_0x10437a[_0x4a01('0x77')];_0x10437a[_0x4a01('0x28')][_0x4a01('0x78')]=_0x4a01('0x5c');return respondWithRpcPromise(_0x4a01('0x79'),_0x4a01('0x79'),{'event':_0x4a01('0x7a'),'message':_0x10437a[_0x4a01('0x28')]},client9002)['then'](function(){return _0x10437a;});}return _0x10437a;}return null;})['then'](respondWithResult(_0x48a5de,null))[_0x4a01('0x29')](handleError(_0x48a5de,null));};var interaction_log=require(_0x4a01('0x5a'))('fax-interactions');exports['reject']=function(_0x29c3dd,_0xee8f64,_0x279007){var _0x135d5c={'agent':{},'channel':_0x4a01('0x5d')};if(_0x29c3dd[_0x4a01('0x57')]['id']){delete _0x29c3dd[_0x4a01('0x57')]['id'];}_0x29c3dd['body'][_0x4a01('0x62')]=_0x29c3dd[_0x4a01('0x57')][_0x4a01('0x62')]||_0x29c3dd[_0x4a01('0x63')]['id'];_0x135d5c['agent']['id']=_0x29c3dd['body']['UserId'];return db['FaxMessage']['find']({'where':{'id':_0x29c3dd[_0x4a01('0x54')]['id'],'UserId':null}})[_0x4a01('0x36')](handleEntityNotFound(_0xee8f64,null))[_0x4a01('0x36')](function(_0x5a9268){if(_0x5a9268){_0x135d5c['message']=_0x5a9268[_0x4a01('0x6a')]({'plain':!![]});return db[_0x4a01('0x65')][_0x4a01('0x56')]({'where':{'id':_0x5a9268[_0x4a01('0x66')]}});}return null;})[_0x4a01('0x36')](handleEntityNotFound(_0xee8f64,null))[_0x4a01('0x36')](function(_0x8216ac){if(_0x8216ac){_0x135d5c[_0x4a01('0x69')]=_0x8216ac['get']({'plain':!![]});interaction_log[_0x4a01('0x22')](_0x4a01('0x7b'),_0x29c3dd[_0x4a01('0x63')]['id'],_0x29c3dd[_0x4a01('0x63')][_0x4a01('0x38')],_0x29c3dd[_0x4a01('0x63')][_0x4a01('0x6c')],_0x135d5c['interaction']['id'],_0x29c3dd[_0x4a01('0x57')]?JSON[_0x4a01('0x6d')](_0x29c3dd['body']):'null');return respondWithRpcPromise(_0x4a01('0x7c'),_0x4a01('0x7d'),_0x135d5c);}return null;})[_0x4a01('0x36')](function(_0x2292f5){var _0x11b994=_0x4a01('0x7e')+_0x2292f5['message'][_0x4a01('0x70')];return db['sequelize'][_0x4a01('0x40')](_0x11b994,{'type':db[_0x4a01('0x71')][_0x4a01('0x72')][_0x4a01('0x73')],'raw':!![]})[_0x4a01('0x36')](function(_0x12e710){return _0x12e710;});})[_0x4a01('0x36')](function(_0x75b1b){if(_0x75b1b){_0x135d5c[_0x4a01('0x28')][_0x4a01('0x74')]=_0x75b1b[0x0];if(!_0x29c3dd[_0x4a01('0x57')]['UserId'])return;return db[_0x4a01('0x7f')][_0x4a01('0x56')]({'where':{'id':_0x29c3dd['body'][_0x4a01('0x62')],'role':_0x4a01('0x64')},'attributes':['id',_0x4a01('0x38'),_0x4a01('0x80'),_0x4a01('0x75'),_0x4a01('0x81')],'raw':!![]});}return null;})['then'](function(_0x29acad){if(!_0x29acad)return null;_0x135d5c[_0x4a01('0x28')][_0x4a01('0x64')]=_0x29acad;return _0x135d5c;})['then'](function(_0x236c30){if(_0x236c30){_0x236c30[_0x4a01('0x28')][_0x4a01('0x76')]=util[_0x4a01('0x60')](_0x4a01('0x82'),_0x29c3dd[_0x4a01('0x63')][_0x4a01('0x38')]);_0x236c30[_0x4a01('0x28')][_0x4a01('0x77')]=_0x135d5c[_0x4a01('0x77')];_0x236c30[_0x4a01('0x28')][_0x4a01('0x83')]=_0x135d5c[_0x4a01('0x77')];_0x236c30[_0x4a01('0x28')][_0x4a01('0x78')]=_0x4a01('0x33');respondWithRpcPromise(_0x4a01('0x79'),_0x4a01('0x79'),{'event':'rejectmessage','message':_0x236c30['message']},client9002);return _0x135d5c;}return null;})['then'](respondWithResult(_0xee8f64,null))[_0x4a01('0x29')](handleError(_0xee8f64,null));};exports['create']=function(_0x1d0b95,_0x59184c){var _0x4f212a;return db[_0x4a01('0x4f')]['create'](_0x1d0b95[_0x4a01('0x57')],{})['then'](function(_0x27de86){_0x4f212a=_0x27de86;return db[_0x4a01('0x84')][_0x4a01('0x85')]({'where':{'id':_0x4f212a[_0x4a01('0x70')]}});})[_0x4a01('0x36')](function(_0x2ed2f2){if(_[_0x4a01('0x67')](_0x2ed2f2)){return;}else{_0x4f212a[_0x4a01('0x5d')]=_0x2ed2f2[_0x4a01('0x5d')];return db[_0x4a01('0x86')][_0x4a01('0x85')]({'where':{'id':_0x4f212a[_0x4a01('0x87')]}});}})[_0x4a01('0x36')](function(_0xf35c0d){return respondWithRpcPromise(_0x4a01('0x88'),'SendFax',{'FaxAccountId':_[_0x4a01('0x67')](_0x1d0b95['body'])?undefined:_0x1d0b95[_0x4a01('0x57')]['FaxAccountId'],'path':_[_0x4a01('0x67')](_0xf35c0d)?undefined:util[_0x4a01('0x60')](_0x4a01('0x89'),_0xf35c0d[_0x4a01('0x8a')]),'fax':_[_0x4a01('0x67')](_0x4f212a[_0x4a01('0x5d')])?undefined:_0x4f212a[_0x4a01('0x5d')],'AttachmentId':_0x4f212a['AttachmentId']},client9002);})[_0x4a01('0x36')](respondWithResult(_0x59184c,0xc9))['catch'](handleError(_0x59184c,null));};exports['download']=function(_0x20b493,_0x42b001){var _0x41313e=path[_0x4a01('0x8b')](config['root'],'server',_0x4a01('0x8c'),_0x4a01('0x8d'));return db[_0x4a01('0x4f')][_0x4a01('0x56')]({'where':{'id':_0x20b493[_0x4a01('0x54')]['id']},'include':[{'model':db[_0x4a01('0x86')],'as':'Attachment'}]})[_0x4a01('0x36')](handleEntityNotFound(_0x42b001,null))[_0x4a01('0x36')](function(_0x515a55){if(_0x515a55){return _0x42b001[_0x4a01('0x8e')](path[_0x4a01('0x8b')](_0x41313e,_0x515a55[_0x4a01('0x86')][_0x4a01('0x8a')]));}})['catch'](handleError(_0x42b001,null));};
\ No newline at end of file
index c952c64..bf7112b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb145=['exports','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x2c3737,_0x3cae75){var _0x276d04=function(_0x1c6460){while(--_0x1c6460){_0x2c3737['push'](_0x2c3737['shift']());}};_0x276d04(++_0x3cae75);}(_0xb145,0xa3));var _0x5b14=function(_0x5d637c,_0x88cd1c){_0x5d637c=_0x5d637c-0x0;var _0x1bae02=_0xb145[_0x5d637c];return _0x1bae02;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x5b14('0x0'))['db'][_0x5b14('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x5b14('0x2')](0x0);var events={'afterCreate':_0x5b14('0x3'),'afterUpdate':_0x5b14('0x4'),'afterDestroy':_0x5b14('0x5')};function emitEvent(_0x31f6f0){return function(_0x34b4cd,_0x5111cd,_0x1e0b5b){FaxMessageEvents[_0x5b14('0x6')](_0x31f6f0+':'+_0x34b4cd['id'],_0x34b4cd);FaxMessageEvents[_0x5b14('0x6')](_0x31f6f0,_0x34b4cd);_0x1e0b5b(null);};}for(var e in events){if(events[_0x5b14('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x5b14('0x8')]=FaxMessageEvents;
\ No newline at end of file
+var _0x7753=['hook','events','../../mysqldb','FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x300a31,_0x267b5f){var _0x2ded54=function(_0x2e64bf){while(--_0x2e64bf){_0x300a31['push'](_0x300a31['shift']());}};_0x2ded54(++_0x267b5f);}(_0x7753,0xfd));var _0x3775=function(_0x2c1e7a,_0x155f86){_0x2c1e7a=_0x2c1e7a-0x0;var _0xcacb4f=_0x7753[_0x2c1e7a];return _0xcacb4f;};'use strict';var EventEmitter=require(_0x3775('0x0'));var FaxMessage=require(_0x3775('0x1'))['db'][_0x3775('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x3775('0x3')](0x0);var events={'afterCreate':_0x3775('0x4'),'afterUpdate':'update','afterDestroy':_0x3775('0x5')};function emitEvent(_0x1e33d1){return function(_0x9cb153,_0x5afdec,_0x1762a6){FaxMessageEvents[_0x3775('0x6')](_0x1e33d1+':'+_0x9cb153['id'],_0x9cb153);FaxMessageEvents['emit'](_0x1e33d1,_0x9cb153);_0x1762a6(null);};}for(var e in events){if(events[_0x3775('0x7')](e)){var event=events[e];FaxMessage[_0x3775('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
index d20b8cf..8f12a9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd5=['path','rimraf','../../config/environment','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','toLowerCase','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','direction','catch','error','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x7c3c27,_0x16c034){var _0x4a2c4b=function(_0x293b82){while(--_0x293b82){_0x7c3c27['push'](_0x7c3c27['shift']());}};_0x4a2c4b(++_0x16c034);}(_0xbdd5,0x190));var _0x5bdd=function(_0x12c069,_0x2f67d1){_0x12c069=_0x12c069-0x0;var _0x36b299=_0xbdd5[_0x12c069];return _0x36b299;};'use strict';var _=require(_0x5bdd('0x0'));var util=require('util');var logger=require(_0x5bdd('0x1'))(_0x5bdd('0x2'));var moment=require('moment');var BPromise=require(_0x5bdd('0x3'));var rp=require(_0x5bdd('0x4'));var fs=require('fs');var path=require(_0x5bdd('0x5'));var rimraf=require(_0x5bdd('0x6'));var config=require(_0x5bdd('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x38ddd6,_0x3b5a65){return _0x38ddd6['define'](_0x5bdd('0x8'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x5bdd('0x9'),'fields':[_0x5bdd('0xa')],'type':_0x5bdd('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e72bd,_0x4071e2,_0x215a81){var _0x1c2daa=_0x38ddd6[_0x5bdd('0xc')];var _0x36151d=_0x5e72bd[_0x5bdd('0xd')]({'plain':!![]});if(_0x36151d['direction'][_0x5bdd('0xe')]()==='in'||_0x36151d['direction'][_0x5bdd('0xe')]()==='out'&&!_0x36151d[_0x5bdd('0xf')]&&!_[_0x5bdd('0x10')](_0x36151d[_0x5bdd('0x11')])){_0x1c2daa[_0x5bdd('0x12')][_0x5bdd('0x13')]({'where':{'id':_0x36151d[_0x5bdd('0x14')]}})[_0x5bdd('0x15')](function(_0x23a28b){if(_0x23a28b){_0x23a28b['update']({'lastMsgAt':_0x36151d[_0x5bdd('0x16')],'lastMsgDirection':_0x36151d[_0x5bdd('0x17')][_0x5bdd('0xe')]()});}})[_0x5bdd('0x18')](function(_0x240dd5){console[_0x5bdd('0x19')](_0x240dd5);});}_0x215a81();}},'charset':_0x5bdd('0x1a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x78a9=['findOne','FaxInteractionId','then','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','out','secret','isNil','UserId','FaxInteraction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x78a9,0x156));var _0x978a=function(_0x23395b,_0x1dfee6){_0x23395b=_0x23395b-0x0;var _0x3095e6=_0x78a9[_0x23395b];return _0x3095e6;};'use strict';var _=require(_0x978a('0x0'));var util=require(_0x978a('0x1'));var logger=require(_0x978a('0x2'))(_0x978a('0x3'));var moment=require(_0x978a('0x4'));var BPromise=require('bluebird');var rp=require(_0x978a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x978a('0x6'));var config=require(_0x978a('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x28f035,_0x2f6651){return _0x28f035[_0x978a('0x8')](_0x978a('0x9'),attributes,{'tableName':_0x978a('0xa'),'paranoid':![],'indexes':[{'name':_0x978a('0xb'),'fields':[_0x978a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41d0f4,_0x439095,_0x4dcb75){var _0x15a30e=_0x28f035[_0x978a('0xd')];var _0x30889f=_0x41d0f4[_0x978a('0xe')]({'plain':!![]});if(_0x30889f['direction'][_0x978a('0xf')]()==='in'||_0x30889f[_0x978a('0x10')]['toLowerCase']()===_0x978a('0x11')&&!_0x30889f[_0x978a('0x12')]&&!_[_0x978a('0x13')](_0x30889f[_0x978a('0x14')])){_0x15a30e[_0x978a('0x15')][_0x978a('0x16')]({'where':{'id':_0x30889f[_0x978a('0x17')]}})[_0x978a('0x18')](function(_0x5d9404){if(_0x5d9404){_0x5d9404['update']({'lastMsgAt':_0x30889f['createdAt'],'lastMsgDirection':_0x30889f['direction'][_0x978a('0xf')]()});}})[_0x978a('0x19')](function(_0x538ad2){console[_0x978a('0x1a')](_0x538ad2);});}_0x4dcb75();}},'charset':'utf8mb4','collate':_0x978a('0x1b')});};
\ No newline at end of file
index 0d18574..7451a25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x10a7f2,_0x432831){var _0x3d30b7=function(_0x280c8b){while(--_0x280c8b){_0x10a7f2['push'](_0x10a7f2['shift']());}};_0x3d30b7(++_0x432831);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x2389a5,_0x42fc75){_0x2389a5=_0x2389a5-0x0;var _0x3cdf5f=_0xd6d6[_0x2389a5];return _0x3cdf5f;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});};
\ No newline at end of file
+var _0xda55=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateFaxMessage','FaxMessage','body','options','raw','catch','update','where','limit','debug','UpdateFaxMessage','lodash','util'];(function(_0xdc4555,_0x4c2cb8){var _0x2c87dc=function(_0x4b84f6){while(--_0x4b84f6){_0xdc4555['push'](_0xdc4555['shift']());}};_0x2c87dc(++_0x4c2cb8);}(_0xda55,0x6d));var _0x5da5=function(_0x46679c,_0x103fae){_0x46679c=_0x46679c-0x0;var _0x401125=_0xda55[_0x46679c];return _0x401125;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5da5('0x2'));var fs=require('fs');var Redis=require(_0x5da5('0x3'));var db=require(_0x5da5('0x4'))['db'];var utils=require(_0x5da5('0x5'));var logger=require(_0x5da5('0x6'))('rpc');var config=require(_0x5da5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5da5('0x8')]['http']({'port':0x232a});config[_0x5da5('0x9')]=_[_0x5da5('0xa')](config[_0x5da5('0x9')],{'host':_0x5da5('0xb'),'port':0x18eb});var socket=require(_0x5da5('0xc'))(new Redis(config[_0x5da5('0x9')]));require(_0x5da5('0xd'))[_0x5da5('0xe')](socket);function respondWithRpcPromise(_0x5c056f,_0x3ed24c,_0x1f98a7){return new BPromise(function(_0x2731a3,_0x26fbe3){return client[_0x5da5('0xf')](_0x5c056f,_0x1f98a7)[_0x5da5('0x10')](function(_0x33313e){logger['info'](_0x5da5('0x11'),_0x3ed24c,_0x5da5('0x12'));logger['debug'](_0x5da5('0x13'),_0x3ed24c,_0x5da5('0x12'),JSON[_0x5da5('0x14')](_0x33313e));if(_0x33313e[_0x5da5('0x15')]){if(_0x33313e[_0x5da5('0x15')][_0x5da5('0x16')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x3ed24c,_0x33313e['error'][_0x5da5('0x17')]);return _0x26fbe3(_0x33313e[_0x5da5('0x15')][_0x5da5('0x17')]);}logger[_0x5da5('0x15')](_0x5da5('0x11'),_0x3ed24c,_0x33313e[_0x5da5('0x15')][_0x5da5('0x17')]);return _0x2731a3(_0x33313e['error'][_0x5da5('0x17')]);}else{logger[_0x5da5('0x18')](_0x5da5('0x11'),_0x3ed24c,_0x5da5('0x12'));_0x2731a3(_0x33313e[_0x5da5('0x19')][_0x5da5('0x17')]);}})['catch'](function(_0x1920e2){logger[_0x5da5('0x15')](_0x5da5('0x11'),_0x3ed24c,_0x1920e2);_0x26fbe3(_0x1920e2);});});}exports[_0x5da5('0x1a')]=function(_0xf023af){var _0x513a34=this;return new Promise(function(_0x4393d7,_0x3372fc){return db[_0x5da5('0x1b')]['create'](_0xf023af[_0x5da5('0x1c')],{'raw':_0xf023af[_0x5da5('0x1d')]?_0xf023af[_0x5da5('0x1d')][_0x5da5('0x1e')]===undefined?!![]:![]:!![]})[_0x5da5('0x10')](function(_0x436960){logger['info'](_0x5da5('0x1a'),_0xf023af);logger['debug'](_0x5da5('0x1a'),_0xf023af,JSON[_0x5da5('0x14')](_0x436960));_0x4393d7(_0x436960);})[_0x5da5('0x1f')](function(_0x5d983c){logger[_0x5da5('0x15')](_0x5da5('0x1a'),_0x5d983c[_0x5da5('0x17')],_0xf023af);_0x3372fc(_0x513a34[_0x5da5('0x15')](0x1f4,_0x5d983c['message']));});});};exports['UpdateFaxMessage']=function(_0x50aadc){var _0x3526cf=this;return new Promise(function(_0x56d509,_0x4e8890){return db[_0x5da5('0x1b')][_0x5da5('0x20')](_0x50aadc['body'],{'raw':_0x50aadc[_0x5da5('0x1d')]?_0x50aadc[_0x5da5('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50aadc[_0x5da5('0x1d')]?_0x50aadc[_0x5da5('0x1d')][_0x5da5('0x21')]||null:null,'attributes':_0x50aadc[_0x5da5('0x1d')]?_0x50aadc[_0x5da5('0x1d')]['attributes']||null:null,'limit':_0x50aadc[_0x5da5('0x1d')]?_0x50aadc[_0x5da5('0x1d')][_0x5da5('0x22')]||null:null})[_0x5da5('0x10')](function(_0x55e2bf){logger['info']('UpdateFaxMessage',_0x50aadc);logger[_0x5da5('0x23')](_0x5da5('0x24'),_0x50aadc,JSON[_0x5da5('0x14')](_0x55e2bf));_0x56d509(_0x55e2bf);})[_0x5da5('0x1f')](function(_0x51b712){logger['error'](_0x5da5('0x24'),_0x51b712['message'],_0x50aadc);_0x4e8890(_0x3526cf['error'](0x1f4,_0x51b712[_0x5da5('0x17')]));});});};
\ No newline at end of file
index cff0a87..a880565 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ad=['./faxMessage.events','save','remove','update','removeListener','length','faxMessage:'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x57ad,0x149));var _0xd57a=function(_0x276299,_0x451e0d){_0x276299=_0x276299-0x0;var _0x3343b6=_0x57ad[_0x276299];return _0x3343b6;};'use strict';var FaxMessageEvents=require(_0xd57a('0x0'));var events=[_0xd57a('0x1'),_0xd57a('0x2'),_0xd57a('0x3')];function createListener(_0x5abf42,_0x477e6b){return function(_0xd61336){_0x477e6b['emit'](_0x5abf42,_0xd61336);};}function removeListener(_0x51349b,_0x5d0708){return function(){FaxMessageEvents[_0xd57a('0x4')](_0x51349b,_0x5d0708);};}exports['register']=function(_0x50179b){for(var _0x39fdd1=0x0,_0x3c9ae8=events[_0xd57a('0x5')];_0x39fdd1<_0x3c9ae8;_0x39fdd1++){var _0x22eb96=events[_0x39fdd1];var _0x4f6159=createListener(_0xd57a('0x6')+_0x22eb96,_0x50179b);FaxMessageEvents['on'](_0x22eb96,_0x4f6159);}};
\ No newline at end of file
+var _0x6469=['register','length','faxMessage:','save','remove','update','removeListener'];(function(_0x184946,_0x439791){var _0x2ea273=function(_0x2c33fa){while(--_0x2c33fa){_0x184946['push'](_0x184946['shift']());}};_0x2ea273(++_0x439791);}(_0x6469,0xb9));var _0x9646=function(_0x2246ba,_0x448b12){_0x2246ba=_0x2246ba-0x0;var _0x3e4264=_0x6469[_0x2246ba];return _0x3e4264;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x9646('0x0'),_0x9646('0x1'),_0x9646('0x2')];function createListener(_0x59f15f,_0x16fa18){return function(_0x41e61b){_0x16fa18['emit'](_0x59f15f,_0x41e61b);};}function removeListener(_0x4a26b8,_0x562fcc){return function(){FaxMessageEvents[_0x9646('0x3')](_0x4a26b8,_0x562fcc);};}exports[_0x9646('0x4')]=function(_0x230345){for(var _0x3e7c9b=0x0,_0x1b83fd=events[_0x9646('0x5')];_0x3e7c9b<_0x1b83fd;_0x3e7c9b++){var _0x3e9cc1=events[_0x3e7c9b];var _0x12d2b8=createListener(_0x9646('0x6')+_0x3e9cc1,_0x230345);FaxMessageEvents['on'](_0x3e9cc1,_0x12d2b8);}};
\ No newline at end of file
index e863d96..22bc834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x750a=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','/:id','show','download','tracked','faxmessage:create','create','update','/:id/accept','accept','put','/:id/reject','delete','exports','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x2783a8,_0x831f34){var _0x3bc650=function(_0x4b0514){while(--_0x4b0514){_0x2783a8['push'](_0x2783a8['shift']());}};_0x3bc650(++_0x831f34);}(_0x750a,0x140));var _0xa750=function(_0x560690,_0x21631d){_0x560690=_0x560690-0x0;var _0x5d8a56=_0x750a[_0x560690];return _0x5d8a56;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0x8')]('/:id/download',auth[_0xa750('0x9')](),controller[_0xa750('0xe')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xa750('0xf')]('fax',_0xa750('0x10')),controller[_0xa750('0x11')]);router['put'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller[_0xa750('0x12')]);router['put'](_0xa750('0x13'),auth[_0xa750('0x9')](),controller[_0xa750('0x14')]);router[_0xa750('0x15')](_0xa750('0x16'),auth[_0xa750('0x9')](),controller['reject']);router[_0xa750('0x17')](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x18')]=router;
\ No newline at end of file
+var _0x9348=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer'];(function(_0x4ab450,_0x52a5e3){var _0xf4eba3=function(_0x429cc8){while(--_0x429cc8){_0x4ab450['push'](_0x4ab450['shift']());}};_0xf4eba3(++_0x52a5e3);}(_0x9348,0x10d));var _0x8934=function(_0x3a8874,_0x5edae7){_0x3a8874=_0x3a8874-0x0;var _0x3e4b56=_0x9348[_0x3a8874];return _0x3e4b56;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/describe',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0xf')]('/',auth[_0x8934('0xa')](),interaction[_0x8934('0x10')](_0x8934('0x11'),_0x8934('0x12')),controller[_0x8934('0x13')]);router[_0x8934('0x14')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0x15')]);router[_0x8934('0x14')](_0x8934('0x16'),auth[_0x8934('0xa')](),controller[_0x8934('0x17')]);router['put'](_0x8934('0x18'),auth[_0x8934('0xa')](),controller[_0x8934('0x19')]);router[_0x8934('0x1a')](_0x8934('0x1b'),auth[_0x8934('0xa')](),controller[_0x8934('0x1c')]);module[_0x8934('0x1d')]=router;
\ No newline at end of file
index f788e01..74a1b63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fe0=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x0fe0,0x6f));var _0x00fe=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0fe0[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x00fe('0x0'));module[_0x00fe('0x1')]={'name':{'type':Sequelize[_0x00fe('0x2')],'unique':_0x00fe('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x00fe('0x2')]},'timeout':{'type':Sequelize[_0x00fe('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x00fe('0x5')](_0x00fe('0x6'),_0x00fe('0x7'),_0x00fe('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x00fe('0x4')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x984b=['exports','STRING','name','INTEGER','roundrobin','sequelize'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x984b,0x15b));var _0xb984=function(_0x21ffbc,_0x2687d5){_0x21ffbc=_0x21ffbc-0x0;var _0x5f3289=_0x984b[_0x21ffbc];return _0x5f3289;};'use strict';var Sequelize=require(_0xb984('0x0'));module[_0xb984('0x1')]={'name':{'type':Sequelize[_0xb984('0x2')],'unique':_0xb984('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb984('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xb984('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb984('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 2ef32b7..3260911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21fe=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxQueue.socket','register','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','FaxQueues','stack','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','FaxQueue','rawAttributes','find','create','body','get','role','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','FaxQueueId','findAndCountAll','UserId','agent','updatedAt','createdAt','%s/%s','SIP','faxPause','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','removeTeams','field','tq.TeamId','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userFaxQueue:remove','addAgents','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1a89a1,_0x56d889){var _0x3d5b46=function(_0x56debf){while(--_0x56debf){_0x1a89a1['push'](_0x1a89a1['shift']());}};_0x3d5b46(++_0x56d889);}(_0x21fe,0x7f));var _0xe21f=function(_0x3d4d60,_0x559adf){_0x3d4d60=_0x3d4d60-0x0;var _0x52deeb=_0x21fe[_0x3d4d60];return _0x52deeb;};'use strict';var emlformat=require(_0xe21f('0x0'));var rimraf=require(_0xe21f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe21f('0x2'));var rp=require(_0xe21f('0x3'));var moment=require(_0xe21f('0x4'));var BPromise=require(_0xe21f('0x5'));var Mustache=require(_0xe21f('0x6'));var util=require(_0xe21f('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xe21f('0x8'));var ejs=require(_0xe21f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe21f('0xa'));var squel=require(_0xe21f('0xb'));var crypto=require(_0xe21f('0xc'));var jsforce=require(_0xe21f('0xd'));var deskjs=require(_0xe21f('0xe'));var toCsv=require(_0xe21f('0x8'));var querystring=require(_0xe21f('0xf'));var Papa=require(_0xe21f('0x10'));var Redis=require(_0xe21f('0x11'));var authService=require(_0xe21f('0x12'));var qs=require(_0xe21f('0x13'));var as=require(_0xe21f('0x14'));var hardwareService=require(_0xe21f('0x15'));var logger=require(_0xe21f('0x16'))('api');var utils=require(_0xe21f('0x17'));var config=require(_0xe21f('0x18'));var licenseUtil=require(_0xe21f('0x19'));var db=require(_0xe21f('0x1a'))['db'];config[_0xe21f('0x1b')]=_['defaults'](config['redis'],{'host':_0xe21f('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe21f('0x1b')]));require(_0xe21f('0x1d'))[_0xe21f('0x1e')](socket);function respondWithStatusCode(_0x29d64f,_0x23a173){_0x23a173=_0x23a173||0xcc;return function(_0x5d9923){if(_0x5d9923){return _0x29d64f['sendStatus'](_0x23a173);}return _0x29d64f[_0xe21f('0x1f')](_0x23a173)[_0xe21f('0x20')]();};}function respondWithResult(_0x4767f6,_0xae4953){_0xae4953=_0xae4953||0xc8;return function(_0x236103){if(_0x236103){return _0x4767f6[_0xe21f('0x1f')](_0xae4953)[_0xe21f('0x21')](_0x236103);}};}function respondWithFilteredResult(_0xecb75d,_0x83d769){return function(_0x6ef406){if(_0x6ef406){var _0x24ce11=typeof _0x83d769['offset']===_0xe21f('0x22')&&typeof _0x83d769['limit']===_0xe21f('0x22');var _0x4495df=_0x6ef406[_0xe21f('0x23')];var _0x3e3e42=_0x24ce11?0x0:_0x83d769[_0xe21f('0x24')];var _0x5db2e3=_0x24ce11?_0x6ef406[_0xe21f('0x23')]:_0x83d769['offset']+_0x83d769['limit'];var _0x2c12a3;if(_0x5db2e3>=_0x4495df){_0x5db2e3=_0x4495df;_0x2c12a3=0xc8;}else{_0x2c12a3=0xce;}_0xecb75d[_0xe21f('0x1f')](_0x2c12a3);return _0xecb75d[_0xe21f('0x25')]('Content-Range',_0x3e3e42+'-'+_0x5db2e3+'/'+_0x4495df)['json'](_0x6ef406);}return null;};}function patchUpdates(_0x6ee188){return function(_0x4e0860){try{jsonpatch[_0xe21f('0x26')](_0x4e0860,_0x6ee188,!![]);}catch(_0x2c508d){return BPromise[_0xe21f('0x27')](_0x2c508d);}return _0x4e0860[_0xe21f('0x28')]();};}function saveUpdates(_0x445536,_0x221dcd){return function(_0x27c870){if(_0x27c870){return _0x27c870[_0xe21f('0x29')](_0x445536)[_0xe21f('0x2a')](function(_0x680978){return _0x680978;});}return null;};}function removeEntity(_0x18ff9f,_0x3dc1b4){return function(_0x1dd324){if(_0x1dd324){return _0x1dd324[_0xe21f('0x2b')]()[_0xe21f('0x2a')](function(){var _0x593da9=_0x1dd324['get']({'plain':!![]});var _0x146396=_0xe21f('0x2c');return db['UserProfileResource'][_0xe21f('0x2b')]({'where':{'type':_0x146396,'resourceId':_0x593da9['id']}})[_0xe21f('0x2a')](function(){return _0x1dd324;});})['then'](function(){_0x18ff9f[_0xe21f('0x1f')](0xcc)[_0xe21f('0x20')]();});}};}function handleEntityNotFound(_0x1057d4,_0x4ae90d){return function(_0x135590){if(!_0x135590){_0x1057d4['sendStatus'](0x194);}return _0x135590;};}function handleError(_0x40eeba,_0x541f6f){_0x541f6f=_0x541f6f||0x1f4;return function(_0x46dd47){logger['error'](_0x46dd47[_0xe21f('0x2d')]);if(_0x46dd47[_0xe21f('0x2e')]){delete _0x46dd47[_0xe21f('0x2e')];}_0x40eeba['status'](_0x541f6f)[_0xe21f('0x2f')](_0x46dd47);};}exports[_0xe21f('0x30')]=function(_0x5f3db3,_0x4e99d0){var _0x4f9606={},_0xf0c05e={},_0x49e877={'count':0x0,'rows':[]};var _0x5f76e7=_[_0xe21f('0x31')](db['FaxQueue']['rawAttributes'],function(_0x51cc34){return{'name':_0x51cc34[_0xe21f('0x32')],'type':_0x51cc34[_0xe21f('0x33')][_0xe21f('0x34')]};});_0xf0c05e[_0xe21f('0x35')]=_[_0xe21f('0x31')](_0x5f76e7,_0xe21f('0x2e'));_0xf0c05e[_0xe21f('0x36')]=_['keys'](_0x5f3db3['query']);_0xf0c05e['filters']=_[_0xe21f('0x37')](_0xf0c05e[_0xe21f('0x35')],_0xf0c05e['query']);_0x4f9606['attributes']=_['intersection'](_0xf0c05e['model'],qs[_0xe21f('0x38')](_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x38')]));_0x4f9606[_0xe21f('0x39')]=_0x4f9606[_0xe21f('0x39')][_0xe21f('0x3a')]?_0x4f9606[_0xe21f('0x39')]:_0xf0c05e['model'];if(!_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x3b')](_0xe21f('0x3c'))){_0x4f9606[_0xe21f('0x3d')]=qs[_0xe21f('0x3d')](_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x3d')]);_0x4f9606[_0xe21f('0x24')]=qs[_0xe21f('0x24')](_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x24')]);}_0x4f9606[_0xe21f('0x3e')]=qs[_0xe21f('0x3f')](_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x3f')]);_0x4f9606['where']=qs[_0xe21f('0x40')](_[_0xe21f('0x41')](_0x5f3db3['query'],_0xf0c05e[_0xe21f('0x40')]),_0x5f76e7);if(_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x42')]){_0x4f9606[_0xe21f('0x43')]=_[_0xe21f('0x44')](_0x4f9606[_0xe21f('0x43')],{'$or':_[_0xe21f('0x31')](_0x5f76e7,function(_0x429bf4){if(_0x429bf4[_0xe21f('0x33')]!==_0xe21f('0x45')){var _0x2d9944={};_0x2d9944[_0x429bf4['name']]={'$like':'%'+_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x42')]+'%'};return _0x2d9944;}})});}_0x4f9606=_[_0xe21f('0x44')]({},_0x4f9606,_0x5f3db3[_0xe21f('0x46')]);var _0x485671={'where':_0x4f9606[_0xe21f('0x43')]};return db['FaxQueue'][_0xe21f('0x23')](_0x485671)[_0xe21f('0x2a')](function(_0x3ecc49){_0x49e877[_0xe21f('0x23')]=_0x3ecc49;if(_0x5f3db3[_0xe21f('0x36')][_0xe21f('0x47')]){_0x4f9606[_0xe21f('0x48')]=[{'all':!![]}];}return db['FaxQueue'][_0xe21f('0x49')](_0x4f9606);})[_0xe21f('0x2a')](function(_0x469749){_0x49e877['rows']=_0x469749;return _0x49e877;})[_0xe21f('0x2a')](respondWithFilteredResult(_0x4e99d0,_0x4f9606))['catch'](handleError(_0x4e99d0,null));};exports[_0xe21f('0x4a')]=function(_0x32ae9b,_0x1640fa){var _0x25e534={'raw':!![],'where':{'id':_0x32ae9b['params']['id']}},_0x3215c6={};_0x3215c6['model']=_[_0xe21f('0x4b')](db[_0xe21f('0x4c')][_0xe21f('0x4d')]);_0x3215c6[_0xe21f('0x36')]=_['keys'](_0x32ae9b[_0xe21f('0x36')]);_0x3215c6['filters']=_[_0xe21f('0x37')](_0x3215c6[_0xe21f('0x35')],_0x3215c6['query']);_0x25e534['attributes']=_['intersection'](_0x3215c6[_0xe21f('0x35')],qs['fields'](_0x32ae9b[_0xe21f('0x36')][_0xe21f('0x38')]));_0x25e534[_0xe21f('0x39')]=_0x25e534[_0xe21f('0x39')]['length']?_0x25e534[_0xe21f('0x39')]:_0x3215c6[_0xe21f('0x35')];if(_0x32ae9b['query'][_0xe21f('0x47')]){_0x25e534[_0xe21f('0x48')]=[{'all':!![]}];}_0x25e534=_[_0xe21f('0x44')]({},_0x25e534,_0x32ae9b[_0xe21f('0x46')]);return db[_0xe21f('0x4c')][_0xe21f('0x4e')](_0x25e534)[_0xe21f('0x2a')](handleEntityNotFound(_0x1640fa,null))[_0xe21f('0x2a')](respondWithResult(_0x1640fa,null))['catch'](handleError(_0x1640fa,null));};exports['create']=function(_0x51cf53,_0x31f4c9){return db[_0xe21f('0x4c')][_0xe21f('0x4f')](_0x51cf53[_0xe21f('0x50')],{})[_0xe21f('0x2a')](function(_0x2c9f7b){var _0x30768a=_0x51cf53['user'][_0xe21f('0x51')]({'plain':!![]});if(!_0x30768a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30768a[_0xe21f('0x52')]==='user'){var _0x3406e6=_0x2c9f7b[_0xe21f('0x51')]({'plain':!![]});var _0x3534ee=_0xe21f('0x2c');return db['UserProfileSection'][_0xe21f('0x4e')]({'where':{'name':_0x3534ee,'userProfileId':_0x30768a['userProfileId']},'raw':!![]})[_0xe21f('0x2a')](function(_0xd8b36d){if(_0xd8b36d&&_0xd8b36d['autoAssociation']===0x0){return db[_0xe21f('0x53')]['create']({'name':_0x3406e6[_0xe21f('0x2e')],'resourceId':_0x3406e6['id'],'type':_0xd8b36d[_0xe21f('0x2e')],'sectionId':_0xd8b36d['id']},{})['then'](function(){return _0x2c9f7b;});}else{return _0x2c9f7b;}})[_0xe21f('0x54')](function(_0x81ffb){logger[_0xe21f('0x55')](_0xe21f('0x56'),_0x81ffb);throw _0x81ffb;});}return _0x2c9f7b;})[_0xe21f('0x2a')](respondWithResult(_0x31f4c9,0xc9))[_0xe21f('0x54')](handleError(_0x31f4c9,null));};exports[_0xe21f('0x29')]=function(_0x368340,_0x29d30f){if(_0x368340[_0xe21f('0x50')]['id']){delete _0x368340[_0xe21f('0x50')]['id'];}return db[_0xe21f('0x4c')][_0xe21f('0x4e')]({'where':{'id':_0x368340['params']['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x29d30f,null))[_0xe21f('0x2a')](saveUpdates(_0x368340['body'],null))[_0xe21f('0x2a')](respondWithResult(_0x29d30f,null))[_0xe21f('0x54')](handleError(_0x29d30f,null));};exports[_0xe21f('0x2b')]=function(_0x130a11,_0x1546f1){return db[_0xe21f('0x4c')][_0xe21f('0x4e')]({'where':{'id':_0x130a11[_0xe21f('0x57')]['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x1546f1,null))[_0xe21f('0x2a')](removeEntity(_0x1546f1,null))[_0xe21f('0x54')](handleError(_0x1546f1,null));};exports['describe']=function(_0x8366e2,_0x4928be){return db[_0xe21f('0x4c')][_0xe21f('0x58')]()[_0xe21f('0x2a')](respondWithResult(_0x4928be,null))[_0xe21f('0x54')](handleError(_0x4928be,null));};exports[_0xe21f('0x59')]=function(_0x1f0696,_0x581bea,_0x22e483){var _0x51b9e6={'raw':!![],'where':{}},_0x425131={},_0x166993;return db[_0xe21f('0x4c')][_0xe21f('0x5a')]({'where':{'id':_0x1f0696[_0xe21f('0x57')]['id']}})['then'](handleEntityNotFound(_0x581bea,null))[_0xe21f('0x2a')](function(_0x5584d1){if(_0x5584d1){_0x166993=_0x5584d1['get']({'plain':!![]});_0x425131[_0xe21f('0x35')]=_[_0xe21f('0x4b')](db[_0xe21f('0x5b')][_0xe21f('0x4d')]);_0x425131[_0xe21f('0x36')]=_[_0xe21f('0x4b')](_0x1f0696['query']);_0x425131[_0xe21f('0x40')]=_[_0xe21f('0x37')](_0x425131[_0xe21f('0x35')],_0x425131['query']);_0x51b9e6[_0xe21f('0x39')]=_[_0xe21f('0x37')](_0x425131[_0xe21f('0x35')],qs[_0xe21f('0x38')](_0x1f0696[_0xe21f('0x36')][_0xe21f('0x38')]));_0x51b9e6['attributes']=_0x51b9e6[_0xe21f('0x39')][_0xe21f('0x3a')]?_0x51b9e6['attributes']:_0x425131[_0xe21f('0x35')];if(!_0x1f0696['query']['hasOwnProperty'](_0xe21f('0x3c'))){_0x51b9e6[_0xe21f('0x3d')]=qs['limit'](_0x1f0696['query'][_0xe21f('0x3d')]);_0x51b9e6['offset']=qs[_0xe21f('0x24')](_0x1f0696[_0xe21f('0x36')][_0xe21f('0x24')]);}_0x51b9e6[_0xe21f('0x3e')]=qs[_0xe21f('0x3f')](_0x1f0696['query'][_0xe21f('0x3f')]);_0x51b9e6[_0xe21f('0x43')]=qs[_0xe21f('0x40')](_[_0xe21f('0x41')](_0x1f0696[_0xe21f('0x36')],_0x425131[_0xe21f('0x40')]));_0x51b9e6[_0xe21f('0x43')][_0xe21f('0x5c')]=_0x5584d1['id'];if(_0x1f0696['query'][_0xe21f('0x42')]){_0x51b9e6[_0xe21f('0x43')]=_[_0xe21f('0x44')](_0x51b9e6[_0xe21f('0x43')],{'$or':_[_0xe21f('0x31')](_0x51b9e6['attributes'],function(_0x26f6ce){var _0x52106c={};_0x52106c[_0x26f6ce]={'$like':'%'+_0x1f0696[_0xe21f('0x36')][_0xe21f('0x42')]+'%'};return _0x52106c;})});}_0x51b9e6=_[_0xe21f('0x44')]({},_0x51b9e6,_0x1f0696['options']);return db[_0xe21f('0x5b')]['findAll'](_0x51b9e6);}})[_0xe21f('0x2a')](function(_0x28acd9){if(_0x28acd9){return db['User'][_0xe21f('0x5d')]({'where':{'id':_[_0xe21f('0x31')](_0x28acd9,_0xe21f('0x5e')),'role':_0xe21f('0x5f')},'attributes':['id','name','faxPause',_0xe21f('0x60'),_0xe21f('0x61')]});}})['then'](function(_0x16035e){if(_0x16035e){return{'count':_0x16035e[_0xe21f('0x23')],'rows':_[_0xe21f('0x31')](_0x16035e['rows'],function(_0x44629f){return{'membername':_0x44629f[_0xe21f('0x2e')],'UserId':_0x44629f['id'],'queue_name':_0x166993[_0xe21f('0x2e')],'FaxQueueId':_0x166993['id'],'interface':util['format'](_0xe21f('0x62'),_0xe21f('0x63'),_0x44629f['name']),'penalty':0x0,'paused':_0x44629f[_0xe21f('0x64')],'createdAt':_0x44629f[_0xe21f('0x61')],'updatedAt':_0x44629f[_0xe21f('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe21f('0x2a')](respondWithFilteredResult(_0x581bea,_0x51b9e6))[_0xe21f('0x54')](handleError(_0x581bea,null));};exports[_0xe21f('0x65')]=function(_0x367871,_0x4c0de9,_0x4fc024){var _0x8378a5={};var _0x42dd7b={};var _0xa59654;var _0x4fd78e;return db[_0xe21f('0x4c')][_0xe21f('0x5a')]({'where':{'id':_0x367871[_0xe21f('0x57')]['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x4c0de9,null))[_0xe21f('0x2a')](function(_0x394355){if(_0x394355){_0xa59654=_0x394355;_0x42dd7b[_0xe21f('0x35')]=_[_0xe21f('0x4b')](db[_0xe21f('0x66')][_0xe21f('0x4d')]);_0x42dd7b['query']=_[_0xe21f('0x4b')](_0x367871[_0xe21f('0x36')]);_0x42dd7b[_0xe21f('0x40')]=_[_0xe21f('0x37')](_0x42dd7b[_0xe21f('0x35')],_0x42dd7b['query']);_0x8378a5[_0xe21f('0x39')]=_['intersection'](_0x42dd7b['model'],qs[_0xe21f('0x38')](_0x367871[_0xe21f('0x36')][_0xe21f('0x38')]));_0x8378a5[_0xe21f('0x39')]=_0x8378a5[_0xe21f('0x39')][_0xe21f('0x3a')]?_0x8378a5['attributes']:_0x42dd7b[_0xe21f('0x35')];_0x8378a5[_0xe21f('0x3e')]=qs[_0xe21f('0x3f')](_0x367871[_0xe21f('0x36')][_0xe21f('0x3f')]);_0x8378a5[_0xe21f('0x43')]=qs['filters'](_[_0xe21f('0x41')](_0x367871['query'],_0x42dd7b['filters']));if(_0x367871[_0xe21f('0x36')][_0xe21f('0x42')]){_0x8378a5[_0xe21f('0x43')]=_['merge'](_0x8378a5[_0xe21f('0x43')],{'$or':_[_0xe21f('0x31')](_0x8378a5['attributes'],function(_0x2d2298){var _0x1b815f={};_0x1b815f[_0x2d2298]={'$like':'%'+_0x367871['query']['filter']+'%'};return _0x1b815f;})});}_0x8378a5=_[_0xe21f('0x44')]({},_0x8378a5,_0x367871[_0xe21f('0x46')]);return _0xa59654[_0xe21f('0x65')](_0x8378a5);}})[_0xe21f('0x2a')](function(_0x3cb03c){if(_0x3cb03c){_0x4fd78e=_0x3cb03c['length'];if(!_0x367871[_0xe21f('0x36')]['hasOwnProperty'](_0xe21f('0x3c'))){_0x8378a5['limit']=qs[_0xe21f('0x3d')](_0x367871[_0xe21f('0x36')]['limit']);_0x8378a5[_0xe21f('0x24')]=qs[_0xe21f('0x24')](_0x367871['query'][_0xe21f('0x24')]);}return _0xa59654[_0xe21f('0x65')](_0x8378a5);}})[_0xe21f('0x2a')](function(_0x119506){if(_0x119506){return _0x119506?{'count':_0x4fd78e,'rows':_0x119506}:null;}})['then'](respondWithResult(_0x4c0de9,null))[_0xe21f('0x54')](handleError(_0x4c0de9,null));};exports[_0xe21f('0x67')]=function(_0x469a4c,_0x20dbbe,_0x365733){var _0x4fa734=_0x469a4c[_0xe21f('0x50')][_0xe21f('0x68')];return db[_0xe21f('0x66')][_0xe21f('0x49')]({'where':{'id':_0x4fa734},'attributes':['id'],'include':[{'model':db[_0xe21f('0x69')],'as':_0xe21f('0x6a'),'attributes':['id',_0xe21f('0x2e'),_0xe21f('0x6b'),_0xe21f('0x6c'),_0xe21f('0x6d')],'raw':!![]}]})[_0xe21f('0x2a')](function(_0x4016ca){if(_0x4016ca){var _0x349e83=_[_0xe21f('0x6e')](_0x4016ca,function(_0x61adbe){var _0x2b8d7e=_0x61adbe['get']({'plain':!![]});return _0x2b8d7e[_0xe21f('0x6a')];});return db[_0xe21f('0x4c')][_0xe21f('0x4e')]({'where':{'id':_0x469a4c[_0xe21f('0x57')]['id']}})[_0xe21f('0x2a')](function(_0xacd43c){return db[_0xe21f('0x6f')][_0xe21f('0x70')](function(_0x1e9a4b){return _0xacd43c[_0xe21f('0x67')](_0x4fa734,{'transaction':_0x1e9a4b})[_0xe21f('0x2a')](function(){return BPromise['each'](_0x349e83,function(_0x220adf){return db[_0xe21f('0x5b')]['findOrCreate']({'where':{'UserId':_0x220adf['id'],'FaxQueueId':_0x469a4c[_0xe21f('0x57')]['id']},'transaction':_0x1e9a4b});});})['then'](function(){_0x349e83[_0xe21f('0x71')](function(_0x1c6f41){socket[_0xe21f('0x72')]('userFaxQueue:save',{'UserId':_0x1c6f41['id'],'FaxQueueId':_0xacd43c['id']});});});});});}})['then'](respondWithStatusCode(_0x20dbbe,null))[_0xe21f('0x54')](handleError(_0x20dbbe,null));};exports[_0xe21f('0x73')]=function(_0x4065c5,_0x4d868d,_0x5c6b44){return db[_0xe21f('0x66')][_0xe21f('0x49')]({'where':{'id':_0x4065c5[_0xe21f('0x36')][_0xe21f('0x68')]},'attributes':['id'],'include':[{'model':db[_0xe21f('0x69')],'as':_0xe21f('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xe21f('0x2a')](handleEntityNotFound(_0x4d868d,null))[_0xe21f('0x2a')](function(_0x75d2ab){var _0xd6dd0d=_['map'](_0x75d2ab,'id');var _0x52db89=[];var _0x1e0416=[];var _0x378af1=squel['select']();_0x378af1[_0xe21f('0x74')](_0xe21f('0x75'))['from'](_0xe21f('0x76'),'tq')[_0xe21f('0x77')](_0xe21f('0x78'),'ut',_0xe21f('0x79'))[_0xe21f('0x43')](_0xe21f('0x7a'),_0x4065c5['params']['id']);for(var _0x5c1e66=0x0;_0x5c1e66<_0x75d2ab[_0xe21f('0x3a')];_0x5c1e66+=0x1){let _0x2ae0a7=_0x75d2ab[_0x5c1e66];for(var _0x5ca58a=0x0;_0x5ca58a<_0x2ae0a7[_0xe21f('0x6a')]['length'];_0x5ca58a+=0x1){let _0x57de80=_0x2ae0a7[_0xe21f('0x6a')][_0x5ca58a];var _0x24fc99=_0x378af1[_0xe21f('0x7b')]();_0x24fc99[_0xe21f('0x43')](_0xe21f('0x7c'),_0x57de80['id']);_0x1e0416[_0xe21f('0x7d')](db[_0xe21f('0x6f')][_0xe21f('0x36')](_0x24fc99['toString'](),{'type':db[_0xe21f('0x6f')][_0xe21f('0x7e')][_0xe21f('0x7f')]})[_0xe21f('0x2a')](function(_0x189513){if(_0x189513['length']===0x1){return _0x57de80['id'];}else{var _0xc9817e=_[_0xe21f('0x80')](_[_0xe21f('0x31')](_0x189513,_0xe21f('0x81')),function(_0x183d63){return _[_0xe21f('0x82')](_0xd6dd0d,_0x183d63);});if(_0xc9817e){return _0x57de80['id'];}}}));}}return BPromise[_0xe21f('0x83')](_0x1e0416)[_0xe21f('0x2a')](function(_0x22c532){_0x52db89=_(_0x52db89)[_0xe21f('0x84')](_0x22c532)[_0xe21f('0x85')]()['value']();return db[_0xe21f('0x4c')][_0xe21f('0x4e')]({'where':{'id':_0x4065c5[_0xe21f('0x57')]['id']}})['then'](function(_0x166d27){return db[_0xe21f('0x6f')]['transaction'](function(_0x494d08){return _0x166d27[_0xe21f('0x73')](_0x4065c5[_0xe21f('0x36')][_0xe21f('0x68')],{'transaction':_0x494d08})['then'](function(){if(!_[_0xe21f('0x86')](_0x52db89)){return _0x166d27[_0xe21f('0x87')](_0x52db89,{'transaction':_0x494d08});}})[_0xe21f('0x2a')](function(){_0x52db89['forEach'](function(_0xfa6b27){socket[_0xe21f('0x72')](_0xe21f('0x88'),{'UserId':_0xfa6b27,'FaxQueueId':_0x166d27['id']});});});});});});})['then'](respondWithStatusCode(_0x4d868d,null))['catch'](handleError(_0x4d868d,null));};exports[_0xe21f('0x89')]=function(_0x211f58,_0x385df8,_0x3dfa1){return db[_0xe21f('0x4c')]['find']({'where':{'id':_0x211f58[_0xe21f('0x57')]['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x385df8,null))[_0xe21f('0x2a')](function(_0xebdcef){if(_0xebdcef){return _0xebdcef[_0xe21f('0x89')](_0x211f58['body']['ids'],_['omit'](_0x211f58[_0xe21f('0x50')],[_0xe21f('0x68'),'id'])||{})[_0xe21f('0x8a')](function(_0x275b78){for(var _0x4ef3c8=0x0;_0x4ef3c8<_0x211f58['body'][_0xe21f('0x68')][_0xe21f('0x3a')];_0x4ef3c8+=0x1){socket[_0xe21f('0x72')](_0xe21f('0x8b'),{'UserId':Number(_0x211f58[_0xe21f('0x50')][_0xe21f('0x68')][_0x4ef3c8]),'FaxQueueId':Number(_0x211f58[_0xe21f('0x57')]['id'])});}return _0x275b78;});}})['then'](respondWithResult(_0x385df8,null))[_0xe21f('0x54')](handleError(_0x385df8,null));};exports[_0xe21f('0x87')]=function(_0x4d950e,_0x528a70,_0x5c7f0c){return db[_0xe21f('0x4c')][_0xe21f('0x4e')]({'where':{'id':_0x4d950e['params']['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x528a70,null))[_0xe21f('0x2a')](function(_0x32585b){if(_0x32585b){return _0x32585b[_0xe21f('0x87')](_0x4d950e[_0xe21f('0x36')]['ids'])[_0xe21f('0x2a')](function(){if(_[_0xe21f('0x8c')](_0x4d950e[_0xe21f('0x36')]['ids'])){for(var _0x5cde41=0x0;_0x5cde41<_0x4d950e[_0xe21f('0x36')][_0xe21f('0x68')][_0xe21f('0x3a')];_0x5cde41+=0x1){socket['emit'](_0xe21f('0x88'),{'UserId':Number(_0x4d950e[_0xe21f('0x36')][_0xe21f('0x68')][_0x5cde41]),'FaxQueueId':Number(_0x4d950e[_0xe21f('0x57')]['id'])});}}else{socket['emit'](_0xe21f('0x88'),{'UserId':Number(_0x4d950e[_0xe21f('0x36')]['ids']),'FaxQueueId':Number(_0x4d950e[_0xe21f('0x57')]['id'])});}});}})[_0xe21f('0x2a')](respondWithStatusCode(_0x528a70,null))[_0xe21f('0x54')](handleError(_0x528a70,null));};exports[_0xe21f('0x8d')]=function(_0x4e0fd6,_0x1b714b,_0x26b63d){var _0x23c6d1={};var _0x30e0ff={};var _0x18a3b5;var _0x160954;return db[_0xe21f('0x4c')][_0xe21f('0x5a')]({'where':{'id':_0x4e0fd6[_0xe21f('0x57')]['id']}})[_0xe21f('0x2a')](handleEntityNotFound(_0x1b714b,null))[_0xe21f('0x2a')](function(_0x4354c3){if(_0x4354c3){_0x18a3b5=_0x4354c3;_0x30e0ff[_0xe21f('0x35')]=_[_0xe21f('0x4b')](db['User'][_0xe21f('0x4d')]);_0x30e0ff[_0xe21f('0x36')]=_[_0xe21f('0x4b')](_0x4e0fd6['query']);_0x30e0ff[_0xe21f('0x40')]=_[_0xe21f('0x37')](_0x30e0ff[_0xe21f('0x35')],_0x30e0ff['query']);_0x23c6d1[_0xe21f('0x39')]=_[_0xe21f('0x37')](_0x30e0ff[_0xe21f('0x35')],qs[_0xe21f('0x38')](_0x4e0fd6[_0xe21f('0x36')][_0xe21f('0x38')]));_0x23c6d1[_0xe21f('0x39')]=_0x23c6d1[_0xe21f('0x39')][_0xe21f('0x3a')]?_0x23c6d1[_0xe21f('0x39')]:_0x30e0ff[_0xe21f('0x35')];_0x23c6d1[_0xe21f('0x3e')]=qs[_0xe21f('0x3f')](_0x4e0fd6[_0xe21f('0x36')]['sort']);_0x23c6d1[_0xe21f('0x43')]=qs[_0xe21f('0x40')](_[_0xe21f('0x41')](_0x4e0fd6['query'],_0x30e0ff[_0xe21f('0x40')]));if(_0x4e0fd6[_0xe21f('0x36')][_0xe21f('0x42')]){_0x23c6d1[_0xe21f('0x43')]=_[_0xe21f('0x44')](_0x23c6d1[_0xe21f('0x43')],{'$or':_[_0xe21f('0x31')](_0x23c6d1[_0xe21f('0x39')],function(_0x45be78){var _0x3b7de8={};_0x3b7de8[_0x45be78]={'$like':'%'+_0x4e0fd6['query'][_0xe21f('0x42')]+'%'};return _0x3b7de8;})});}_0x23c6d1=_['merge']({},_0x23c6d1,_0x4e0fd6[_0xe21f('0x46')]);return _0x18a3b5['getAgents'](_0x23c6d1);}})[_0xe21f('0x2a')](function(_0x147d96){if(_0x147d96){_0x160954=_0x147d96[_0xe21f('0x3a')];if(!_0x4e0fd6[_0xe21f('0x36')][_0xe21f('0x3b')](_0xe21f('0x3c'))){_0x23c6d1[_0xe21f('0x3d')]=qs['limit'](_0x4e0fd6[_0xe21f('0x36')][_0xe21f('0x3d')]);_0x23c6d1[_0xe21f('0x24')]=qs['offset'](_0x4e0fd6[_0xe21f('0x36')][_0xe21f('0x24')]);}return _0x18a3b5[_0xe21f('0x8d')](_0x23c6d1);}})[_0xe21f('0x2a')](function(_0x48cea4){if(_0x48cea4){return _0x48cea4?{'count':_0x160954,'rows':_0x48cea4}:null;}})[_0xe21f('0x2a')](respondWithResult(_0x1b714b,null))[_0xe21f('0x54')](handleError(_0x1b714b,null));};
\ No newline at end of file
+var _0x74fc=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','name','filter','includeAll','include','rows','params','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','order','pick','User','findAndCountAll','agent','faxPause','updatedAt','format','SIP','createdAt','getTeams','Team','addTeams','ids','findAll','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','union','compact','value','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userFaxQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','./faxQueue.socket','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model'];(function(_0x466af7,_0x2f7551){var _0x348c96=function(_0x2d7477){while(--_0x2d7477){_0x466af7['push'](_0x466af7['shift']());}};_0x348c96(++_0x2f7551);}(_0x74fc,0xdb));var _0xc74f=function(_0x24b9b8,_0x253af9){_0x24b9b8=_0x24b9b8-0x0;var _0x4b2543=_0x74fc[_0x24b9b8];return _0x4b2543;};'use strict';var emlformat=require(_0xc74f('0x0'));var rimraf=require(_0xc74f('0x1'));var zipdir=require(_0xc74f('0x2'));var jsonpatch=require(_0xc74f('0x3'));var rp=require(_0xc74f('0x4'));var moment=require('moment');var BPromise=require(_0xc74f('0x5'));var Mustache=require(_0xc74f('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc74f('0x7'));var csv=require(_0xc74f('0x8'));var ejs=require(_0xc74f('0x9'));var fs=require('fs');var fs_extra=require(_0xc74f('0xa'));var _=require(_0xc74f('0xb'));var squel=require(_0xc74f('0xc'));var crypto=require(_0xc74f('0xd'));var jsforce=require(_0xc74f('0xe'));var deskjs=require(_0xc74f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc74f('0x10'));var Redis=require(_0xc74f('0x11'));var authService=require(_0xc74f('0x12'));var qs=require(_0xc74f('0x13'));var as=require(_0xc74f('0x14'));var hardwareService=require(_0xc74f('0x15'));var logger=require('../../config/logger')(_0xc74f('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc74f('0x17'));var db=require(_0xc74f('0x18'))['db'];config[_0xc74f('0x19')]=_['defaults'](config[_0xc74f('0x19')],{'host':_0xc74f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc74f('0x19')]));require(_0xc74f('0x1b'))['register'](socket);function respondWithStatusCode(_0x2f671c,_0x2edd37){_0x2edd37=_0x2edd37||0xcc;return function(_0x5e5dbf){if(_0x5e5dbf){return _0x2f671c[_0xc74f('0x1c')](_0x2edd37);}return _0x2f671c[_0xc74f('0x1d')](_0x2edd37)[_0xc74f('0x1e')]();};}function respondWithResult(_0x27a55e,_0x3d1ebd){_0x3d1ebd=_0x3d1ebd||0xc8;return function(_0x97d91a){if(_0x97d91a){return _0x27a55e[_0xc74f('0x1d')](_0x3d1ebd)['json'](_0x97d91a);}};}function respondWithFilteredResult(_0x147216,_0x2ce69f){return function(_0x1008b5){if(_0x1008b5){var _0x3ab3cb=typeof _0x2ce69f[_0xc74f('0x1f')]==='undefined'&&typeof _0x2ce69f[_0xc74f('0x20')]===_0xc74f('0x21');var _0x178787=_0x1008b5[_0xc74f('0x22')];var _0x333884=_0x3ab3cb?0x0:_0x2ce69f[_0xc74f('0x1f')];var _0x36a64e=_0x3ab3cb?_0x1008b5[_0xc74f('0x22')]:_0x2ce69f[_0xc74f('0x1f')]+_0x2ce69f['limit'];var _0x139832;if(_0x36a64e>=_0x178787){_0x36a64e=_0x178787;_0x139832=0xc8;}else{_0x139832=0xce;}_0x147216['status'](_0x139832);return _0x147216[_0xc74f('0x23')](_0xc74f('0x24'),_0x333884+'-'+_0x36a64e+'/'+_0x178787)[_0xc74f('0x25')](_0x1008b5);}return null;};}function patchUpdates(_0x37648b){return function(_0x5c385f){try{jsonpatch[_0xc74f('0x26')](_0x5c385f,_0x37648b,!![]);}catch(_0x59f97a){return BPromise[_0xc74f('0x27')](_0x59f97a);}return _0x5c385f['save']();};}function saveUpdates(_0x27209d,_0x28d591){return function(_0x49a02a){if(_0x49a02a){return _0x49a02a[_0xc74f('0x28')](_0x27209d)[_0xc74f('0x29')](function(_0x5b83ff){return _0x5b83ff;});}return null;};}function removeEntity(_0x28b6b7,_0x45376b){return function(_0x5bbba1){if(_0x5bbba1){return _0x5bbba1['destroy']()[_0xc74f('0x29')](function(){var _0x407eb6=_0x5bbba1[_0xc74f('0x2a')]({'plain':!![]});var _0x47b5f8=_0xc74f('0x2b');return db[_0xc74f('0x2c')][_0xc74f('0x2d')]({'where':{'type':_0x47b5f8,'resourceId':_0x407eb6['id']}})[_0xc74f('0x29')](function(){return _0x5bbba1;});})[_0xc74f('0x29')](function(){_0x28b6b7[_0xc74f('0x1d')](0xcc)[_0xc74f('0x1e')]();});}};}function handleEntityNotFound(_0x45518e,_0x1048bf){return function(_0x5db1c4){if(!_0x5db1c4){_0x45518e['sendStatus'](0x194);}return _0x5db1c4;};}function handleError(_0x57669f,_0x1d4ca3){_0x1d4ca3=_0x1d4ca3||0x1f4;return function(_0x5a8c82){logger[_0xc74f('0x2e')](_0x5a8c82[_0xc74f('0x2f')]);if(_0x5a8c82['name']){delete _0x5a8c82['name'];}_0x57669f['status'](_0x1d4ca3)[_0xc74f('0x30')](_0x5a8c82);};}exports[_0xc74f('0x31')]=function(_0x4a325d,_0x2e23a8){var _0x325f4f={},_0x4d17ef={},_0x52a9e0={'count':0x0,'rows':[]};var _0x524eaa=_[_0xc74f('0x32')](db[_0xc74f('0x33')][_0xc74f('0x34')],function(_0x265e4c){return{'name':_0x265e4c[_0xc74f('0x35')],'type':_0x265e4c[_0xc74f('0x36')][_0xc74f('0x37')]};});_0x4d17ef[_0xc74f('0x38')]=_['map'](_0x524eaa,'name');_0x4d17ef[_0xc74f('0x39')]=_[_0xc74f('0x3a')](_0x4a325d[_0xc74f('0x39')]);_0x4d17ef[_0xc74f('0x3b')]=_[_0xc74f('0x3c')](_0x4d17ef[_0xc74f('0x38')],_0x4d17ef[_0xc74f('0x39')]);_0x325f4f[_0xc74f('0x3d')]=_[_0xc74f('0x3c')](_0x4d17ef[_0xc74f('0x38')],qs['fields'](_0x4a325d[_0xc74f('0x39')][_0xc74f('0x3e')]));_0x325f4f[_0xc74f('0x3d')]=_0x325f4f['attributes'][_0xc74f('0x3f')]?_0x325f4f[_0xc74f('0x3d')]:_0x4d17ef[_0xc74f('0x38')];if(!_0x4a325d['query'][_0xc74f('0x40')](_0xc74f('0x41'))){_0x325f4f[_0xc74f('0x20')]=qs[_0xc74f('0x20')](_0x4a325d[_0xc74f('0x39')][_0xc74f('0x20')]);_0x325f4f[_0xc74f('0x1f')]=qs[_0xc74f('0x1f')](_0x4a325d[_0xc74f('0x39')][_0xc74f('0x1f')]);}_0x325f4f['order']=qs['sort'](_0x4a325d[_0xc74f('0x39')][_0xc74f('0x42')]);_0x325f4f[_0xc74f('0x43')]=qs['filters'](_['pick'](_0x4a325d[_0xc74f('0x39')],_0x4d17ef[_0xc74f('0x3b')]),_0x524eaa);if(_0x4a325d[_0xc74f('0x39')]['filter']){_0x325f4f['where']=_[_0xc74f('0x44')](_0x325f4f[_0xc74f('0x43')],{'$or':_[_0xc74f('0x32')](_0x524eaa,function(_0xdd3efb){if(_0xdd3efb['type']!=='VIRTUAL'){var _0x5c2a46={};_0x5c2a46[_0xdd3efb[_0xc74f('0x45')]]={'$like':'%'+_0x4a325d['query'][_0xc74f('0x46')]+'%'};return _0x5c2a46;}})});}_0x325f4f=_[_0xc74f('0x44')]({},_0x325f4f,_0x4a325d['options']);var _0x3b2b2c={'where':_0x325f4f['where']};return db[_0xc74f('0x33')][_0xc74f('0x22')](_0x3b2b2c)['then'](function(_0x49b337){_0x52a9e0['count']=_0x49b337;if(_0x4a325d[_0xc74f('0x39')][_0xc74f('0x47')]){_0x325f4f[_0xc74f('0x48')]=[{'all':!![]}];}return db[_0xc74f('0x33')]['findAll'](_0x325f4f);})['then'](function(_0x2e1722){_0x52a9e0[_0xc74f('0x49')]=_0x2e1722;return _0x52a9e0;})[_0xc74f('0x29')](respondWithFilteredResult(_0x2e23a8,_0x325f4f))['catch'](handleError(_0x2e23a8,null));};exports['show']=function(_0x1f4b6a,_0x201518){var _0x57dc27={'raw':!![],'where':{'id':_0x1f4b6a[_0xc74f('0x4a')]['id']}},_0x143dd2={};_0x143dd2[_0xc74f('0x38')]=_[_0xc74f('0x3a')](db[_0xc74f('0x33')][_0xc74f('0x34')]);_0x143dd2['query']=_[_0xc74f('0x3a')](_0x1f4b6a[_0xc74f('0x39')]);_0x143dd2[_0xc74f('0x3b')]=_[_0xc74f('0x3c')](_0x143dd2[_0xc74f('0x38')],_0x143dd2[_0xc74f('0x39')]);_0x57dc27[_0xc74f('0x3d')]=_['intersection'](_0x143dd2['model'],qs['fields'](_0x1f4b6a[_0xc74f('0x39')]['fields']));_0x57dc27[_0xc74f('0x3d')]=_0x57dc27['attributes']['length']?_0x57dc27[_0xc74f('0x3d')]:_0x143dd2[_0xc74f('0x38')];if(_0x1f4b6a[_0xc74f('0x39')][_0xc74f('0x47')]){_0x57dc27[_0xc74f('0x48')]=[{'all':!![]}];}_0x57dc27=_[_0xc74f('0x44')]({},_0x57dc27,_0x1f4b6a[_0xc74f('0x4b')]);return db[_0xc74f('0x33')]['find'](_0x57dc27)[_0xc74f('0x29')](handleEntityNotFound(_0x201518,null))['then'](respondWithResult(_0x201518,null))[_0xc74f('0x4c')](handleError(_0x201518,null));};exports[_0xc74f('0x4d')]=function(_0x555a0f,_0xa66980){return db[_0xc74f('0x33')][_0xc74f('0x4d')](_0x555a0f[_0xc74f('0x4e')],{})[_0xc74f('0x29')](function(_0x3e9add){var _0x2b44c6=_0x555a0f['user']['get']({'plain':!![]});if(!_0x2b44c6)throw new Error(_0xc74f('0x4f'));if(_0x2b44c6['role']===_0xc74f('0x50')){var _0x502b4d=_0x3e9add[_0xc74f('0x2a')]({'plain':!![]});var _0x268598='FaxQueues';return db['UserProfileSection'][_0xc74f('0x51')]({'where':{'name':_0x268598,'userProfileId':_0x2b44c6['userProfileId']},'raw':!![]})[_0xc74f('0x29')](function(_0x3b7d42){if(_0x3b7d42&&_0x3b7d42['autoAssociation']===0x0){return db[_0xc74f('0x2c')][_0xc74f('0x4d')]({'name':_0x502b4d[_0xc74f('0x45')],'resourceId':_0x502b4d['id'],'type':_0x3b7d42['name'],'sectionId':_0x3b7d42['id']},{})['then'](function(){return _0x3e9add;});}else{return _0x3e9add;}})[_0xc74f('0x4c')](function(_0x1b8acc){logger[_0xc74f('0x2e')](_0xc74f('0x52'),_0x1b8acc);throw _0x1b8acc;});}return _0x3e9add;})[_0xc74f('0x29')](respondWithResult(_0xa66980,0xc9))[_0xc74f('0x4c')](handleError(_0xa66980,null));};exports[_0xc74f('0x28')]=function(_0x2aa96a,_0x58bb88){if(_0x2aa96a['body']['id']){delete _0x2aa96a[_0xc74f('0x4e')]['id'];}return db[_0xc74f('0x33')]['find']({'where':{'id':_0x2aa96a[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0x58bb88,null))[_0xc74f('0x29')](saveUpdates(_0x2aa96a['body'],null))[_0xc74f('0x29')](respondWithResult(_0x58bb88,null))[_0xc74f('0x4c')](handleError(_0x58bb88,null));};exports[_0xc74f('0x2d')]=function(_0x2e68b0,_0x3a9818){return db['FaxQueue'][_0xc74f('0x51')]({'where':{'id':_0x2e68b0[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0x3a9818,null))[_0xc74f('0x29')](removeEntity(_0x3a9818,null))[_0xc74f('0x4c')](handleError(_0x3a9818,null));};exports[_0xc74f('0x53')]=function(_0x3a4bc6,_0x179402){return db[_0xc74f('0x33')][_0xc74f('0x53')]()[_0xc74f('0x29')](respondWithResult(_0x179402,null))[_0xc74f('0x4c')](handleError(_0x179402,null));};exports[_0xc74f('0x54')]=function(_0x41bff4,_0xaec3e7,_0x1cee5e){var _0x27e38f={'raw':!![],'where':{}},_0x2568c2={},_0x3ccfb3;return db[_0xc74f('0x33')][_0xc74f('0x55')]({'where':{'id':_0x41bff4[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0xaec3e7,null))['then'](function(_0x4bf2ae){if(_0x4bf2ae){_0x3ccfb3=_0x4bf2ae[_0xc74f('0x2a')]({'plain':!![]});_0x2568c2[_0xc74f('0x38')]=_[_0xc74f('0x3a')](db[_0xc74f('0x56')][_0xc74f('0x34')]);_0x2568c2[_0xc74f('0x39')]=_[_0xc74f('0x3a')](_0x41bff4[_0xc74f('0x39')]);_0x2568c2[_0xc74f('0x3b')]=_[_0xc74f('0x3c')](_0x2568c2['model'],_0x2568c2['query']);_0x27e38f[_0xc74f('0x3d')]=_[_0xc74f('0x3c')](_0x2568c2[_0xc74f('0x38')],qs[_0xc74f('0x3e')](_0x41bff4[_0xc74f('0x39')][_0xc74f('0x3e')]));_0x27e38f[_0xc74f('0x3d')]=_0x27e38f[_0xc74f('0x3d')][_0xc74f('0x3f')]?_0x27e38f[_0xc74f('0x3d')]:_0x2568c2[_0xc74f('0x38')];if(!_0x41bff4[_0xc74f('0x39')][_0xc74f('0x40')]('nolimit')){_0x27e38f[_0xc74f('0x20')]=qs[_0xc74f('0x20')](_0x41bff4['query'][_0xc74f('0x20')]);_0x27e38f[_0xc74f('0x1f')]=qs[_0xc74f('0x1f')](_0x41bff4[_0xc74f('0x39')][_0xc74f('0x1f')]);}_0x27e38f[_0xc74f('0x57')]=qs[_0xc74f('0x42')](_0x41bff4[_0xc74f('0x39')][_0xc74f('0x42')]);_0x27e38f[_0xc74f('0x43')]=qs['filters'](_[_0xc74f('0x58')](_0x41bff4['query'],_0x2568c2[_0xc74f('0x3b')]));_0x27e38f['where']['FaxQueueId']=_0x4bf2ae['id'];if(_0x41bff4[_0xc74f('0x39')][_0xc74f('0x46')]){_0x27e38f[_0xc74f('0x43')]=_[_0xc74f('0x44')](_0x27e38f[_0xc74f('0x43')],{'$or':_[_0xc74f('0x32')](_0x27e38f[_0xc74f('0x3d')],function(_0x249d1f){var _0x1700ab={};_0x1700ab[_0x249d1f]={'$like':'%'+_0x41bff4[_0xc74f('0x39')][_0xc74f('0x46')]+'%'};return _0x1700ab;})});}_0x27e38f=_[_0xc74f('0x44')]({},_0x27e38f,_0x41bff4['options']);return db[_0xc74f('0x56')]['findAll'](_0x27e38f);}})[_0xc74f('0x29')](function(_0x3eaee6){if(_0x3eaee6){return db[_0xc74f('0x59')][_0xc74f('0x5a')]({'where':{'id':_[_0xc74f('0x32')](_0x3eaee6,'UserId'),'role':_0xc74f('0x5b')},'attributes':['id','name',_0xc74f('0x5c'),_0xc74f('0x5d'),'createdAt']});}})[_0xc74f('0x29')](function(_0x49aa9e){if(_0x49aa9e){return{'count':_0x49aa9e[_0xc74f('0x22')],'rows':_[_0xc74f('0x32')](_0x49aa9e['rows'],function(_0x2489f2){return{'membername':_0x2489f2[_0xc74f('0x45')],'UserId':_0x2489f2['id'],'queue_name':_0x3ccfb3[_0xc74f('0x45')],'FaxQueueId':_0x3ccfb3['id'],'interface':util[_0xc74f('0x5e')]('%s/%s',_0xc74f('0x5f'),_0x2489f2[_0xc74f('0x45')]),'penalty':0x0,'paused':_0x2489f2[_0xc74f('0x5c')],'createdAt':_0x2489f2[_0xc74f('0x60')],'updatedAt':_0x2489f2[_0xc74f('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc74f('0x29')](respondWithFilteredResult(_0xaec3e7,_0x27e38f))[_0xc74f('0x4c')](handleError(_0xaec3e7,null));};exports[_0xc74f('0x61')]=function(_0xc6b751,_0x6e6b10,_0x32d819){var _0x4645c9={};var _0x162609={};var _0x6a03fc;var _0x200e42;return db['FaxQueue']['findOne']({'where':{'id':_0xc6b751[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0x6e6b10,null))[_0xc74f('0x29')](function(_0x337c7e){if(_0x337c7e){_0x6a03fc=_0x337c7e;_0x162609[_0xc74f('0x38')]=_['keys'](db[_0xc74f('0x62')][_0xc74f('0x34')]);_0x162609['query']=_[_0xc74f('0x3a')](_0xc6b751['query']);_0x162609[_0xc74f('0x3b')]=_[_0xc74f('0x3c')](_0x162609[_0xc74f('0x38')],_0x162609[_0xc74f('0x39')]);_0x4645c9[_0xc74f('0x3d')]=_[_0xc74f('0x3c')](_0x162609['model'],qs[_0xc74f('0x3e')](_0xc6b751[_0xc74f('0x39')][_0xc74f('0x3e')]));_0x4645c9['attributes']=_0x4645c9[_0xc74f('0x3d')][_0xc74f('0x3f')]?_0x4645c9[_0xc74f('0x3d')]:_0x162609[_0xc74f('0x38')];_0x4645c9['order']=qs['sort'](_0xc6b751[_0xc74f('0x39')]['sort']);_0x4645c9[_0xc74f('0x43')]=qs[_0xc74f('0x3b')](_[_0xc74f('0x58')](_0xc6b751[_0xc74f('0x39')],_0x162609[_0xc74f('0x3b')]));if(_0xc6b751[_0xc74f('0x39')][_0xc74f('0x46')]){_0x4645c9[_0xc74f('0x43')]=_['merge'](_0x4645c9[_0xc74f('0x43')],{'$or':_['map'](_0x4645c9[_0xc74f('0x3d')],function(_0x5291f8){var _0x5cf4d2={};_0x5cf4d2[_0x5291f8]={'$like':'%'+_0xc6b751[_0xc74f('0x39')][_0xc74f('0x46')]+'%'};return _0x5cf4d2;})});}_0x4645c9=_[_0xc74f('0x44')]({},_0x4645c9,_0xc6b751[_0xc74f('0x4b')]);return _0x6a03fc[_0xc74f('0x61')](_0x4645c9);}})['then'](function(_0x18cf88){if(_0x18cf88){_0x200e42=_0x18cf88[_0xc74f('0x3f')];if(!_0xc6b751['query'][_0xc74f('0x40')](_0xc74f('0x41'))){_0x4645c9[_0xc74f('0x20')]=qs[_0xc74f('0x20')](_0xc6b751[_0xc74f('0x39')][_0xc74f('0x20')]);_0x4645c9[_0xc74f('0x1f')]=qs['offset'](_0xc6b751['query'][_0xc74f('0x1f')]);}return _0x6a03fc[_0xc74f('0x61')](_0x4645c9);}})[_0xc74f('0x29')](function(_0x3790c6){if(_0x3790c6){return _0x3790c6?{'count':_0x200e42,'rows':_0x3790c6}:null;}})[_0xc74f('0x29')](respondWithResult(_0x6e6b10,null))[_0xc74f('0x4c')](handleError(_0x6e6b10,null));};exports[_0xc74f('0x63')]=function(_0x1fcbdd,_0x2588c9,_0x38b64b){var _0x232df0=_0x1fcbdd[_0xc74f('0x4e')][_0xc74f('0x64')];return db['Team'][_0xc74f('0x65')]({'where':{'id':_0x232df0},'attributes':['id'],'include':[{'model':db[_0xc74f('0x59')],'as':_0xc74f('0x66'),'attributes':['id',_0xc74f('0x45'),_0xc74f('0x67'),_0xc74f('0x68'),_0xc74f('0x69')],'raw':!![]}]})[_0xc74f('0x29')](function(_0x4bfd71){if(_0x4bfd71){var _0xcef9a8=_[_0xc74f('0x6a')](_0x4bfd71,function(_0x19e750){var _0x49949e=_0x19e750[_0xc74f('0x2a')]({'plain':!![]});return _0x49949e[_0xc74f('0x66')];});return db[_0xc74f('0x33')][_0xc74f('0x51')]({'where':{'id':_0x1fcbdd['params']['id']}})[_0xc74f('0x29')](function(_0x28718a){return db[_0xc74f('0x6b')][_0xc74f('0x6c')](function(_0x93c38){return _0x28718a[_0xc74f('0x63')](_0x232df0,{'transaction':_0x93c38})[_0xc74f('0x29')](function(){return BPromise[_0xc74f('0x6d')](_0xcef9a8,function(_0x74a7f4){return db[_0xc74f('0x56')][_0xc74f('0x6e')]({'where':{'UserId':_0x74a7f4['id'],'FaxQueueId':_0x1fcbdd[_0xc74f('0x4a')]['id']},'transaction':_0x93c38});});})[_0xc74f('0x29')](function(){_0xcef9a8['forEach'](function(_0x432be9){socket[_0xc74f('0x6f')](_0xc74f('0x70'),{'UserId':_0x432be9['id'],'FaxQueueId':_0x28718a['id']});});});});});}})[_0xc74f('0x29')](respondWithStatusCode(_0x2588c9,null))[_0xc74f('0x4c')](handleError(_0x2588c9,null));};exports[_0xc74f('0x71')]=function(_0x119db3,_0x16dd04,_0x378629){return db[_0xc74f('0x62')]['findAll']({'where':{'id':_0x119db3['query'][_0xc74f('0x64')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x16dd04,null))[_0xc74f('0x29')](function(_0x2a2e84){var _0x316c99=_['map'](_0x2a2e84,'id');var _0x1bbfb3=[];var _0x2d11a3=[];var _0x3a74a0=squel[_0xc74f('0x72')]();_0x3a74a0['field']('tq.TeamId')[_0xc74f('0x73')]('team_has_fax_queues','tq')[_0xc74f('0x74')](_0xc74f('0x75'),'ut',_0xc74f('0x76'))[_0xc74f('0x43')](_0xc74f('0x77'),_0x119db3['params']['id']);for(var _0x1b532d=0x0;_0x1b532d<_0x2a2e84[_0xc74f('0x3f')];_0x1b532d+=0x1){let _0x5428ad=_0x2a2e84[_0x1b532d];for(var _0x30f9fc=0x0;_0x30f9fc<_0x5428ad[_0xc74f('0x66')][_0xc74f('0x3f')];_0x30f9fc+=0x1){let _0x40631d=_0x5428ad[_0xc74f('0x66')][_0x30f9fc];var _0x5394b8=_0x3a74a0[_0xc74f('0x78')]();_0x5394b8[_0xc74f('0x43')]('ut.UserId\x20=\x20?',_0x40631d['id']);_0x2d11a3[_0xc74f('0x79')](db['sequelize'][_0xc74f('0x39')](_0x5394b8['toString'](),{'type':db[_0xc74f('0x6b')][_0xc74f('0x7a')][_0xc74f('0x7b')]})[_0xc74f('0x29')](function(_0x27c974){if(_0x27c974['length']===0x1){return _0x40631d['id'];}else{var _0x3ca8ba=_[_0xc74f('0x7c')](_['map'](_0x27c974,_0xc74f('0x7d')),function(_0x329dd9){return _['includes'](_0x316c99,_0x329dd9);});if(_0x3ca8ba){return _0x40631d['id'];}}}));}}return BPromise['all'](_0x2d11a3)['then'](function(_0x3886e8){_0x1bbfb3=_(_0x1bbfb3)[_0xc74f('0x7e')](_0x3886e8)[_0xc74f('0x7f')]()[_0xc74f('0x80')]();return db['FaxQueue']['find']({'where':{'id':_0x119db3[_0xc74f('0x4a')]['id']}})['then'](function(_0x2cd018){return db[_0xc74f('0x6b')][_0xc74f('0x6c')](function(_0x23c012){return _0x2cd018['removeTeams'](_0x119db3[_0xc74f('0x39')][_0xc74f('0x64')],{'transaction':_0x23c012})[_0xc74f('0x29')](function(){if(!_[_0xc74f('0x81')](_0x1bbfb3)){return _0x2cd018[_0xc74f('0x82')](_0x1bbfb3,{'transaction':_0x23c012});}})[_0xc74f('0x29')](function(){_0x1bbfb3[_0xc74f('0x83')](function(_0x2c5a80){socket['emit']('userFaxQueue:remove',{'UserId':_0x2c5a80,'FaxQueueId':_0x2cd018['id']});});});});});});})['then'](respondWithStatusCode(_0x16dd04,null))[_0xc74f('0x4c')](handleError(_0x16dd04,null));};exports[_0xc74f('0x84')]=function(_0x1560d8,_0x3699c9,_0x3ec3e7){return db[_0xc74f('0x33')][_0xc74f('0x51')]({'where':{'id':_0x1560d8[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0x3699c9,null))[_0xc74f('0x29')](function(_0x593fda){if(_0x593fda){return _0x593fda[_0xc74f('0x84')](_0x1560d8[_0xc74f('0x4e')]['ids'],_[_0xc74f('0x85')](_0x1560d8[_0xc74f('0x4e')],['ids','id'])||{})[_0xc74f('0x86')](function(_0x1249eb){for(var _0x162168=0x0;_0x162168<_0x1560d8[_0xc74f('0x4e')]['ids']['length'];_0x162168+=0x1){socket[_0xc74f('0x6f')](_0xc74f('0x70'),{'UserId':Number(_0x1560d8['body'][_0xc74f('0x64')][_0x162168]),'FaxQueueId':Number(_0x1560d8[_0xc74f('0x4a')]['id'])});}return _0x1249eb;});}})[_0xc74f('0x29')](respondWithResult(_0x3699c9,null))[_0xc74f('0x4c')](handleError(_0x3699c9,null));};exports[_0xc74f('0x82')]=function(_0x173b14,_0x5c9e85,_0x127e09){return db[_0xc74f('0x33')][_0xc74f('0x51')]({'where':{'id':_0x173b14[_0xc74f('0x4a')]['id']}})[_0xc74f('0x29')](handleEntityNotFound(_0x5c9e85,null))[_0xc74f('0x29')](function(_0x4608d7){if(_0x4608d7){return _0x4608d7['removeAgents'](_0x173b14[_0xc74f('0x39')]['ids'])[_0xc74f('0x29')](function(){if(_[_0xc74f('0x87')](_0x173b14['query']['ids'])){for(var _0x34a817=0x0;_0x34a817<_0x173b14[_0xc74f('0x39')][_0xc74f('0x64')][_0xc74f('0x3f')];_0x34a817+=0x1){socket[_0xc74f('0x6f')](_0xc74f('0x88'),{'UserId':Number(_0x173b14[_0xc74f('0x39')][_0xc74f('0x64')][_0x34a817]),'FaxQueueId':Number(_0x173b14[_0xc74f('0x4a')]['id'])});}}else{socket[_0xc74f('0x6f')](_0xc74f('0x88'),{'UserId':Number(_0x173b14[_0xc74f('0x39')][_0xc74f('0x64')]),'FaxQueueId':Number(_0x173b14[_0xc74f('0x4a')]['id'])});}});}})[_0xc74f('0x29')](respondWithStatusCode(_0x5c9e85,null))['catch'](handleError(_0x5c9e85,null));};exports[_0xc74f('0x89')]=function(_0x3c9e47,_0x21d1b1,_0x46994c){var _0x50f554={};var _0x22ad58={};var _0x30179c;var _0xd05ff2;return db['FaxQueue']['findOne']({'where':{'id':_0x3c9e47[_0xc74f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x21d1b1,null))[_0xc74f('0x29')](function(_0x162f27){if(_0x162f27){_0x30179c=_0x162f27;_0x22ad58[_0xc74f('0x38')]=_[_0xc74f('0x3a')](db[_0xc74f('0x59')]['rawAttributes']);_0x22ad58[_0xc74f('0x39')]=_[_0xc74f('0x3a')](_0x3c9e47[_0xc74f('0x39')]);_0x22ad58[_0xc74f('0x3b')]=_['intersection'](_0x22ad58[_0xc74f('0x38')],_0x22ad58[_0xc74f('0x39')]);_0x50f554[_0xc74f('0x3d')]=_[_0xc74f('0x3c')](_0x22ad58[_0xc74f('0x38')],qs[_0xc74f('0x3e')](_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x3e')]));_0x50f554['attributes']=_0x50f554['attributes'][_0xc74f('0x3f')]?_0x50f554['attributes']:_0x22ad58['model'];_0x50f554[_0xc74f('0x57')]=qs['sort'](_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x42')]);_0x50f554['where']=qs[_0xc74f('0x3b')](_[_0xc74f('0x58')](_0x3c9e47[_0xc74f('0x39')],_0x22ad58[_0xc74f('0x3b')]));if(_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x46')]){_0x50f554[_0xc74f('0x43')]=_[_0xc74f('0x44')](_0x50f554[_0xc74f('0x43')],{'$or':_[_0xc74f('0x32')](_0x50f554['attributes'],function(_0x374a74){var _0x2d096f={};_0x2d096f[_0x374a74]={'$like':'%'+_0x3c9e47['query']['filter']+'%'};return _0x2d096f;})});}_0x50f554=_[_0xc74f('0x44')]({},_0x50f554,_0x3c9e47[_0xc74f('0x4b')]);return _0x30179c[_0xc74f('0x89')](_0x50f554);}})[_0xc74f('0x29')](function(_0x430ea0){if(_0x430ea0){_0xd05ff2=_0x430ea0[_0xc74f('0x3f')];if(!_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x40')](_0xc74f('0x41'))){_0x50f554['limit']=qs['limit'](_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x20')]);_0x50f554[_0xc74f('0x1f')]=qs[_0xc74f('0x1f')](_0x3c9e47[_0xc74f('0x39')][_0xc74f('0x1f')]);}return _0x30179c['getAgents'](_0x50f554);}})[_0xc74f('0x29')](function(_0x2bb772){if(_0x2bb772){return _0x2bb772?{'count':_0xd05ff2,'rows':_0x2bb772}:null;}})[_0xc74f('0x29')](respondWithResult(_0x21d1b1,null))['catch'](handleError(_0x21d1b1,null));};
\ No newline at end of file
index d9c27c7..a9ec56b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb6a=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxQueue'];(function(_0x209fa4,_0x4233e2){var _0x3f26bf=function(_0x3ef6ae){while(--_0x3ef6ae){_0x209fa4['push'](_0x209fa4['shift']());}};_0x3f26bf(++_0x4233e2);}(_0xbb6a,0x15d));var _0xabb6=function(_0x159641,_0x292389){_0x159641=_0x159641-0x0;var _0x41c53a=_0xbb6a[_0x159641];return _0x41c53a;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0xabb6('0x0'))['db'][_0xabb6('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xabb6('0x2'),'afterUpdate':_0xabb6('0x3'),'afterDestroy':_0xabb6('0x4')};function emitEvent(_0x268190){return function(_0x8f0fa9,_0x27ae3b,_0x23405f){FaxQueueEvents[_0xabb6('0x5')](_0x268190+':'+_0x8f0fa9['id'],_0x8f0fa9);FaxQueueEvents[_0xabb6('0x5')](_0x268190,_0x8f0fa9);_0x23405f(null);};}for(var e in events){if(events[_0xabb6('0x6')](e)){var event=events[e];FaxQueue[_0xabb6('0x7')](e,emitEvent(event));}}module[_0xabb6('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x9e89=['FaxQueue','setMaxListeners','update','remove','hook','exports','../../mysqldb'];(function(_0x42f849,_0x36dd69){var _0x2320b6=function(_0x2ed9b0){while(--_0x2ed9b0){_0x42f849['push'](_0x42f849['shift']());}};_0x2320b6(++_0x36dd69);}(_0x9e89,0x180));var _0x99e8=function(_0x182fa3,_0x2434d7){_0x182fa3=_0x182fa3-0x0;var _0x12d56e=_0x9e89[_0x182fa3];return _0x12d56e;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x99e8('0x0'))['db'][_0x99e8('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x99e8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x99e8('0x3'),'afterDestroy':_0x99e8('0x4')};function emitEvent(_0x47aae0){return function(_0x297b0a,_0x2c3c5e,_0x194b6e){FaxQueueEvents['emit'](_0x47aae0+':'+_0x297b0a['id'],_0x297b0a);FaxQueueEvents['emit'](_0x47aae0,_0x297b0a);_0x194b6e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x99e8('0x5')](e,emitEvent(event));}}module[_0x99e8('0x6')]=FaxQueueEvents;
\ No newline at end of file
index 54fabf2..09c5845 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c7=['define','FaxQueue','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0xcd505d,_0x464afa){var _0x5251dc=function(_0x2436e4){while(--_0x2436e4){_0xcd505d['push'](_0xcd505d['shift']());}};_0x5251dc(++_0x464afa);}(_0x48c7,0x1bc));var _0x748c=function(_0xfbb2c4,_0x26b45a){_0xfbb2c4=_0xfbb2c4-0x0;var _0x440158=_0x48c7[_0xfbb2c4];return _0x440158;};'use strict';var _=require(_0x748c('0x0'));var util=require(_0x748c('0x1'));var logger=require(_0x748c('0x2'))(_0x748c('0x3'));var moment=require('moment');var BPromise=require(_0x748c('0x4'));var rp=require(_0x748c('0x5'));var fs=require('fs');var path=require(_0x748c('0x6'));var rimraf=require(_0x748c('0x7'));var config=require(_0x748c('0x8'));var attributes=require(_0x748c('0x9'));module[_0x748c('0xa')]=function(_0xe0fe71,_0xb61758){return _0xe0fe71[_0x748c('0xb')](_0x748c('0xc'),attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6c8=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxQueue.attributes'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0xf6c8,0xc8));var _0x8f6c=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xf6c8[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x8f6c('0x0'));var util=require(_0x8f6c('0x1'));var logger=require(_0x8f6c('0x2'))(_0x8f6c('0x3'));var moment=require(_0x8f6c('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f6c('0x5'));var fs=require('fs');var path=require(_0x8f6c('0x6'));var rimraf=require('rimraf');var config=require(_0x8f6c('0x7'));var attributes=require(_0x8f6c('0x8'));module['exports']=function(_0x17bcdf,_0x1aef36){return _0x17bcdf['define'](_0x8f6c('0x9'),attributes,{'tableName':_0x8f6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9bad577..121e866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xecf2=['message','catch','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','model','map','info','ShowFaxQueue','debug','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2b65df,_0x2c029c){var _0xd6c56=function(_0x5652f3){while(--_0x5652f3){_0x2b65df['push'](_0x2b65df['shift']());}};_0xd6c56(++_0x2c029c);}(_0xecf2,0x1f0));var _0x2ecf=function(_0x1b6634,_0x57c18e){_0x1b6634=_0x1b6634-0x0;var _0x6f8902=_0xecf2[_0x1b6634];return _0x6f8902;};'use strict';var _=require(_0x2ecf('0x0'));var util=require(_0x2ecf('0x1'));var moment=require(_0x2ecf('0x2'));var BPromise=require('bluebird');var rs=require(_0x2ecf('0x3'));var fs=require('fs');var Redis=require(_0x2ecf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ecf('0x5'));var logger=require(_0x2ecf('0x6'))(_0x2ecf('0x7'));var config=require(_0x2ecf('0x8'));var jayson=require(_0x2ecf('0x9'));var client=jayson[_0x2ecf('0xa')]['http']({'port':0x232a});config[_0x2ecf('0xb')]=_[_0x2ecf('0xc')](config[_0x2ecf('0xb')],{'host':_0x2ecf('0xd'),'port':0x18eb});var socket=require(_0x2ecf('0xe'))(new Redis(config['redis']));require('./faxQueue.socket')[_0x2ecf('0xf')](socket);function respondWithRpcPromise(_0xeed9e7,_0x501b77,_0x20ccb8){return new BPromise(function(_0x50bf94,_0x5e1a3c){return client[_0x2ecf('0x10')](_0xeed9e7,_0x20ccb8)[_0x2ecf('0x11')](function(_0x1608b5){logger['info'](_0x2ecf('0x12'),_0x501b77,'request\x20sent');logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x501b77,_0x2ecf('0x13'),JSON[_0x2ecf('0x14')](_0x1608b5));if(_0x1608b5[_0x2ecf('0x15')]){if(_0x1608b5['error']['code']===0x1f4){logger['error'](_0x2ecf('0x12'),_0x501b77,_0x1608b5[_0x2ecf('0x15')]['message']);return _0x5e1a3c(_0x1608b5[_0x2ecf('0x15')][_0x2ecf('0x16')]);}logger[_0x2ecf('0x15')](_0x2ecf('0x12'),_0x501b77,_0x1608b5[_0x2ecf('0x15')][_0x2ecf('0x16')]);return _0x50bf94(_0x1608b5['error'][_0x2ecf('0x16')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x501b77,'request\x20sent');_0x50bf94(_0x1608b5['result'][_0x2ecf('0x16')]);}})[_0x2ecf('0x17')](function(_0x23f33d){logger[_0x2ecf('0x15')](_0x2ecf('0x12'),_0x501b77,_0x23f33d);_0x5e1a3c(_0x23f33d);});});}exports[_0x2ecf('0x18')]=function(_0x337b9d){var _0xb31bde=this;return new Promise(function(_0x33c5b6,_0x1c1be2){return db[_0x2ecf('0x19')][_0x2ecf('0x1a')]({'raw':_0x337b9d['options']?_0x337b9d['options']['raw']===undefined?!![]:![]:!![],'where':_0x337b9d[_0x2ecf('0x1b')]?_0x337b9d[_0x2ecf('0x1b')][_0x2ecf('0x1c')]||null:null,'attributes':_0x337b9d[_0x2ecf('0x1b')]?_0x337b9d[_0x2ecf('0x1b')][_0x2ecf('0x1d')]||null:null,'limit':_0x337b9d[_0x2ecf('0x1b')]?_0x337b9d[_0x2ecf('0x1b')][_0x2ecf('0x1e')]||null:null,'include':_0x337b9d[_0x2ecf('0x1b')]?_0x337b9d[_0x2ecf('0x1b')]['include']?_['map'](_0x337b9d[_0x2ecf('0x1b')][_0x2ecf('0x1f')],function(_0x58efed){return{'model':db[_0x58efed['model']],'as':_0x58efed['as'],'attributes':_0x58efed[_0x2ecf('0x1d')],'include':_0x58efed[_0x2ecf('0x1f')]?_['map'](_0x58efed[_0x2ecf('0x1f')],function(_0x5bc88e){return{'model':db[_0x5bc88e[_0x2ecf('0x20')]],'as':_0x5bc88e['as'],'attributes':_0x5bc88e['attributes'],'include':_0x5bc88e[_0x2ecf('0x1f')]?_[_0x2ecf('0x21')](_0x5bc88e['include'],function(_0x4b1a5a){return{'model':db[_0x4b1a5a[_0x2ecf('0x20')]],'as':_0x4b1a5a['as'],'attributes':_0x4b1a5a['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ecf('0x11')](function(_0x289a74){logger[_0x2ecf('0x22')](_0x2ecf('0x18'),_0x337b9d);logger['debug'](_0x2ecf('0x18'),_0x337b9d,JSON['stringify'](_0x289a74));_0x33c5b6(_0x289a74);})[_0x2ecf('0x17')](function(_0x3347f4){logger[_0x2ecf('0x15')](_0x2ecf('0x18'),_0x3347f4[_0x2ecf('0x16')],_0x337b9d);_0x1c1be2(_0xb31bde[_0x2ecf('0x15')](0x1f4,_0x3347f4[_0x2ecf('0x16')]));});});};exports['ShowFaxQueue']=function(_0x52e0eb){var _0x528dec=this;return new Promise(function(_0x392be0,_0x37e7b1){return db['FaxQueue']['find']({'raw':_0x52e0eb[_0x2ecf('0x1b')]?_0x52e0eb['options']['raw']===undefined?!![]:![]:!![],'where':_0x52e0eb[_0x2ecf('0x1b')]?_0x52e0eb['options']['where']||null:null,'attributes':_0x52e0eb[_0x2ecf('0x1b')]?_0x52e0eb['options'][_0x2ecf('0x1d')]||null:null,'include':_0x52e0eb[_0x2ecf('0x1b')]?_0x52e0eb[_0x2ecf('0x1b')][_0x2ecf('0x1f')]?_[_0x2ecf('0x21')](_0x52e0eb[_0x2ecf('0x1b')][_0x2ecf('0x1f')],function(_0x12d75d){return{'model':db[_0x12d75d[_0x2ecf('0x20')]],'as':_0x12d75d['as'],'attributes':_0x12d75d[_0x2ecf('0x1d')],'include':_0x12d75d[_0x2ecf('0x1f')]?_[_0x2ecf('0x21')](_0x12d75d[_0x2ecf('0x1f')],function(_0x5c65e3){return{'model':db[_0x5c65e3['model']],'as':_0x5c65e3['as'],'attributes':_0x5c65e3[_0x2ecf('0x1d')],'include':_0x5c65e3['include']?_[_0x2ecf('0x21')](_0x5c65e3['include'],function(_0x87608b){return{'model':db[_0x87608b[_0x2ecf('0x20')]],'as':_0x87608b['as'],'attributes':_0x87608b[_0x2ecf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c320d){logger['info'](_0x2ecf('0x23'),_0x52e0eb);logger[_0x2ecf('0x24')](_0x2ecf('0x23'),_0x52e0eb,JSON[_0x2ecf('0x14')](_0x3c320d));_0x392be0(_0x3c320d);})[_0x2ecf('0x17')](function(_0x2cc165){logger['error'](_0x2ecf('0x23'),_0x2cc165[_0x2ecf('0x16')],_0x52e0eb);_0x37e7b1(_0x528dec[_0x2ecf('0x15')](0x1f4,_0x2cc165[_0x2ecf('0x16')]));});});};
\ No newline at end of file
+var _0x8904=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','GetFaxQueue','findAll','options','where','limit','include','map','model','attributes','catch','ShowFaxQueue','FaxQueue','find','raw','lodash'];(function(_0x40bc01,_0x22a9a9){var _0x42365b=function(_0x2d3d88){while(--_0x2d3d88){_0x40bc01['push'](_0x40bc01['shift']());}};_0x42365b(++_0x22a9a9);}(_0x8904,0x12f));var _0x4890=function(_0x2edbfb,_0x30554d){_0x2edbfb=_0x2edbfb-0x0;var _0x2047f1=_0x8904[_0x2edbfb];return _0x2047f1;};'use strict';var _=require(_0x4890('0x0'));var util=require(_0x4890('0x1'));var moment=require('moment');var BPromise=require(_0x4890('0x2'));var rs=require(_0x4890('0x3'));var fs=require('fs');var Redis=require(_0x4890('0x4'));var db=require(_0x4890('0x5'))['db'];var utils=require(_0x4890('0x6'));var logger=require(_0x4890('0x7'))(_0x4890('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4890('0x9')]['http']({'port':0x232a});config[_0x4890('0xa')]=_[_0x4890('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4890('0xc'))(new Redis(config[_0x4890('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x510684,_0x2de1fc,_0x139c40){return new BPromise(function(_0x116574,_0x1ea1ad){return client[_0x4890('0xd')](_0x510684,_0x139c40)[_0x4890('0xe')](function(_0x317ee0){logger[_0x4890('0xf')](_0x4890('0x10'),_0x2de1fc,'request\x20sent');logger[_0x4890('0x11')](_0x4890('0x12'),_0x2de1fc,'request\x20sent',JSON[_0x4890('0x13')](_0x317ee0));if(_0x317ee0[_0x4890('0x14')]){if(_0x317ee0[_0x4890('0x14')]['code']===0x1f4){logger[_0x4890('0x14')](_0x4890('0x10'),_0x2de1fc,_0x317ee0[_0x4890('0x14')][_0x4890('0x15')]);return _0x1ea1ad(_0x317ee0[_0x4890('0x14')][_0x4890('0x15')]);}logger[_0x4890('0x14')](_0x4890('0x10'),_0x2de1fc,_0x317ee0['error']['message']);return _0x116574(_0x317ee0[_0x4890('0x14')]['message']);}else{logger[_0x4890('0xf')](_0x4890('0x10'),_0x2de1fc,_0x4890('0x16'));_0x116574(_0x317ee0[_0x4890('0x17')]['message']);}})['catch'](function(_0x27254e){logger[_0x4890('0x14')](_0x4890('0x10'),_0x2de1fc,_0x27254e);_0x1ea1ad(_0x27254e);});});}exports[_0x4890('0x18')]=function(_0x43ced8){var _0x5be238=this;return new Promise(function(_0x51d169,_0x161961){return db['FaxQueue'][_0x4890('0x19')]({'raw':_0x43ced8['options']?_0x43ced8[_0x4890('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x43ced8[_0x4890('0x1a')]?_0x43ced8[_0x4890('0x1a')][_0x4890('0x1b')]||null:null,'attributes':_0x43ced8[_0x4890('0x1a')]?_0x43ced8[_0x4890('0x1a')]['attributes']||null:null,'limit':_0x43ced8[_0x4890('0x1a')]?_0x43ced8['options'][_0x4890('0x1c')]||null:null,'include':_0x43ced8[_0x4890('0x1a')]?_0x43ced8[_0x4890('0x1a')][_0x4890('0x1d')]?_[_0x4890('0x1e')](_0x43ced8[_0x4890('0x1a')][_0x4890('0x1d')],function(_0x49b245){return{'model':db[_0x49b245[_0x4890('0x1f')]],'as':_0x49b245['as'],'attributes':_0x49b245[_0x4890('0x20')],'include':_0x49b245[_0x4890('0x1d')]?_['map'](_0x49b245[_0x4890('0x1d')],function(_0x5eb612){return{'model':db[_0x5eb612['model']],'as':_0x5eb612['as'],'attributes':_0x5eb612[_0x4890('0x20')],'include':_0x5eb612[_0x4890('0x1d')]?_[_0x4890('0x1e')](_0x5eb612['include'],function(_0x19e99d){return{'model':db[_0x19e99d[_0x4890('0x1f')]],'as':_0x19e99d['as'],'attributes':_0x19e99d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ea191){logger['info'](_0x4890('0x18'),_0x43ced8);logger[_0x4890('0x11')](_0x4890('0x18'),_0x43ced8,JSON[_0x4890('0x13')](_0x2ea191));_0x51d169(_0x2ea191);})[_0x4890('0x21')](function(_0x4820d8){logger[_0x4890('0x14')]('GetFaxQueue',_0x4820d8[_0x4890('0x15')],_0x43ced8);_0x161961(_0x5be238['error'](0x1f4,_0x4820d8[_0x4890('0x15')]));});});};exports[_0x4890('0x22')]=function(_0x17e7e1){var _0x972395=this;return new Promise(function(_0x1249f1,_0x23023d){return db[_0x4890('0x23')][_0x4890('0x24')]({'raw':_0x17e7e1[_0x4890('0x1a')]?_0x17e7e1[_0x4890('0x1a')][_0x4890('0x25')]===undefined?!![]:![]:!![],'where':_0x17e7e1[_0x4890('0x1a')]?_0x17e7e1[_0x4890('0x1a')][_0x4890('0x1b')]||null:null,'attributes':_0x17e7e1[_0x4890('0x1a')]?_0x17e7e1[_0x4890('0x1a')]['attributes']||null:null,'include':_0x17e7e1[_0x4890('0x1a')]?_0x17e7e1[_0x4890('0x1a')]['include']?_[_0x4890('0x1e')](_0x17e7e1[_0x4890('0x1a')]['include'],function(_0x1524f9){return{'model':db[_0x1524f9[_0x4890('0x1f')]],'as':_0x1524f9['as'],'attributes':_0x1524f9[_0x4890('0x20')],'include':_0x1524f9[_0x4890('0x1d')]?_[_0x4890('0x1e')](_0x1524f9[_0x4890('0x1d')],function(_0x10552d){return{'model':db[_0x10552d[_0x4890('0x1f')]],'as':_0x10552d['as'],'attributes':_0x10552d['attributes'],'include':_0x10552d[_0x4890('0x1d')]?_[_0x4890('0x1e')](_0x10552d[_0x4890('0x1d')],function(_0x553fe5){return{'model':db[_0x553fe5[_0x4890('0x1f')]],'as':_0x553fe5['as'],'attributes':_0x553fe5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4890('0xe')](function(_0x5370d2){logger[_0x4890('0xf')](_0x4890('0x22'),_0x17e7e1);logger[_0x4890('0x11')](_0x4890('0x22'),_0x17e7e1,JSON['stringify'](_0x5370d2));_0x1249f1(_0x5370d2);})[_0x4890('0x21')](function(_0xfe92c){logger[_0x4890('0x14')]('ShowFaxQueue',_0xfe92c[_0x4890('0x15')],_0x17e7e1);_0x23023d(_0x972395[_0x4890('0x14')](0x1f4,_0xfe92c['message']));});});};
\ No newline at end of file
index b260c6e..7422cb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f2d=['./faxQueue.events','save','update','removeListener','register','length','faxQueue:'];(function(_0x269ee4,_0x2512e){var _0x5b7bc5=function(_0x17ce82){while(--_0x17ce82){_0x269ee4['push'](_0x269ee4['shift']());}};_0x5b7bc5(++_0x2512e);}(_0x7f2d,0x1ea));var _0xd7f2=function(_0x2741c7,_0x2114c7){_0x2741c7=_0x2741c7-0x0;var _0x2f3d31=_0x7f2d[_0x2741c7];return _0x2f3d31;};'use strict';var FaxQueueEvents=require(_0xd7f2('0x0'));var events=[_0xd7f2('0x1'),'remove',_0xd7f2('0x2')];function createListener(_0x154950,_0x20fee7){return function(_0x45fa55){_0x20fee7['emit'](_0x154950,_0x45fa55);};}function removeListener(_0x4dcd8c,_0x5a28b6){return function(){FaxQueueEvents[_0xd7f2('0x3')](_0x4dcd8c,_0x5a28b6);};}exports[_0xd7f2('0x4')]=function(_0x1366ff){for(var _0x212421=0x0,_0x1b5174=events[_0xd7f2('0x5')];_0x212421<_0x1b5174;_0x212421++){var _0x2e736c=events[_0x212421];var _0x107ccd=createListener(_0xd7f2('0x6')+_0x2e736c,_0x1366ff);FaxQueueEvents['on'](_0x2e736c,_0x107ccd);}};
\ No newline at end of file
+var _0xceb3=['length','faxQueue:','./faxQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3b3933,_0x4a5bd2){var _0x41d2c4=function(_0x4f295d){while(--_0x4f295d){_0x3b3933['push'](_0x3b3933['shift']());}};_0x41d2c4(++_0x4a5bd2);}(_0xceb3,0xf5));var _0x3ceb=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0xceb3[_0x9dfc10];return _0x4f938a;};'use strict';var FaxQueueEvents=require(_0x3ceb('0x0'));var events=[_0x3ceb('0x1'),_0x3ceb('0x2'),_0x3ceb('0x3')];function createListener(_0x2de438,_0x59dfd5){return function(_0xa12920){_0x59dfd5[_0x3ceb('0x4')](_0x2de438,_0xa12920);};}function removeListener(_0x299eec,_0x1ed779){return function(){FaxQueueEvents[_0x3ceb('0x5')](_0x299eec,_0x1ed779);};}exports[_0x3ceb('0x6')]=function(_0xd26dff){for(var _0x41a626=0x0,_0x245f31=events[_0x3ceb('0x7')];_0x41a626<_0x245f31;_0x41a626++){var _0xdd8862=events[_0x41a626];var _0x433147=createListener(_0x3ceb('0x8')+_0xdd8862,_0xd26dff);FaxQueueEvents['on'](_0xdd8862,_0x433147);}};
\ No newline at end of file
index ebc34e5..25e3a46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addTeams','addAgents','put','delete','/:id'];(function(_0x3e8e5d,_0x26f118){var _0x4f8f8c=function(_0x1c489b){while(--_0x1c489b){_0x3e8e5d['push'](_0x3e8e5d['shift']());}};_0x4f8f8c(++_0x26f118);}(_0x33af,0xec));var _0xf33a=function(_0x288f73,_0x5d378b){_0x288f73=_0x288f73-0x0;var _0x417fe3=_0x33af[_0x288f73];return _0x417fe3;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x12')]('/',auth[_0xf33a('0xb')](),controller['create']);router['post'](_0xf33a('0x13'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x12')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x16')]('/:id',auth[_0xf33a('0xb')](),controller['update']);router[_0xf33a('0x17')](_0xf33a('0x18'),auth['isAuthenticated'](),controller[_0xf33a('0x19')]);router[_0xf33a('0x17')]('/:id/teams',auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x17')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x1b')]);module[_0xf33a('0x1c')]=router;
\ No newline at end of file
+var _0xaa64=['../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x113208,_0x230f5f){var _0x281484=function(_0x2e7191){while(--_0x2e7191){_0x113208['push'](_0x113208['shift']());}};_0x281484(++_0x230f5f);}(_0xaa64,0xf7));var _0x4aa6=function(_0x2caa59,_0x1f76c3){_0x2caa59=_0x2caa59-0x0;var _0x491b97=_0xaa64[_0x2caa59];return _0x491b97;};'use strict';var multer=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var path=require('path');var timeout=require(_0x4aa6('0x2'));var express=require('express');var router=express[_0x4aa6('0x3')]();var fs_extra=require(_0x4aa6('0x4'));var auth=require(_0x4aa6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa6('0x6'));var controller=require(_0x4aa6('0x7'));router[_0x4aa6('0x8')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xa')]);router[_0x4aa6('0x8')](_0x4aa6('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4aa6('0x8')](_0x4aa6('0xc'),auth['isAuthenticated'](),controller[_0x4aa6('0xd')]);router['get'](_0x4aa6('0xe'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0xf')]);router[_0x4aa6('0x8')]('/:id/teams',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x10')]);router[_0x4aa6('0x8')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x12')]);router[_0x4aa6('0x13')]('/',auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x14')]);router[_0x4aa6('0x13')]('/:id/teams',auth[_0x4aa6('0x9')](),controller['addTeams']);router['post'](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x15')]);router[_0x4aa6('0x16')](_0x4aa6('0xc'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x17')]);router[_0x4aa6('0x18')]('/:id',auth[_0x4aa6('0x9')](),controller['destroy']);router[_0x4aa6('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x4aa6('0x19')]);router[_0x4aa6('0x18')](_0x4aa6('0x11'),auth[_0x4aa6('0x9')](),controller[_0x4aa6('0x1a')]);module[_0x4aa6('0x1b')]=router;
\ No newline at end of file
index 54e7935..54d6ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a2=['DATE','moment','sequelize','exports','STRING'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xd8a2,0x14b));var _0x2d8a=function(_0x6c53f5,_0x556ec2){_0x6c53f5=_0x6c53f5-0x0;var _0x128f0d=_0xd8a2[_0x6c53f5];return _0x128f0d;};'use strict';var moment=require(_0x2d8a('0x0'));var Sequelize=require(_0x2d8a('0x1'));module[_0x2d8a('0x2')]={'uniqueid':{'type':Sequelize[_0x2d8a('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x2d8a('0x3')]},'joinAt':{'type':Sequelize[_0x2d8a('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x2d8a('0x4')]},'exitAt':{'type':Sequelize[_0x2d8a('0x4')]},'reason':{'type':Sequelize[_0x2d8a('0x3')]}};
\ No newline at end of file
+var _0xab9c=['DATE','moment','sequelize','exports','STRING'];(function(_0x557bf4,_0x1f8dad){var _0x2916e2=function(_0x4fef9b){while(--_0x4fef9b){_0x557bf4['push'](_0x557bf4['shift']());}};_0x2916e2(++_0x1f8dad);}(_0xab9c,0x18c));var _0xcab9=function(_0x4553b9,_0x205b80){_0x4553b9=_0x4553b9-0x0;var _0x300af0=_0xab9c[_0x4553b9];return _0x300af0;};'use strict';var moment=require(_0xcab9('0x0'));var Sequelize=require(_0xcab9('0x1'));module[_0xcab9('0x2')]={'uniqueid':{'type':Sequelize[_0xcab9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xcab9('0x3')]},'joinAt':{'type':Sequelize[_0xcab9('0x4')]},'leaveAt':{'type':Sequelize[_0xcab9('0x4')]},'acceptAt':{'type':Sequelize[_0xcab9('0x4')]},'exitAt':{'type':Sequelize[_0xcab9('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index e033b9a..508f03f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x130d=['jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','send','index','FaxQueueReport','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','include','create','body','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x2b7047,_0x12b8a8){var _0x48e851=function(_0xd562d2){while(--_0xd562d2){_0x2b7047['push'](_0x2b7047['shift']());}};_0x48e851(++_0x12b8a8);}(_0x130d,0x125));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd130('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd130('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd130('0x2'));var moment=require(_0xd130('0x3'));var BPromise=require(_0xd130('0x4'));var Mustache=require(_0xd130('0x5'));var util=require(_0xd130('0x6'));var path=require(_0xd130('0x7'));var sox=require(_0xd130('0x8'));var csv=require(_0xd130('0x9'));var ejs=require(_0xd130('0xa'));var fs=require('fs');var fs_extra=require(_0xd130('0xb'));var _=require(_0xd130('0xc'));var squel=require(_0xd130('0xd'));var crypto=require(_0xd130('0xe'));var jsforce=require(_0xd130('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd130('0x9'));var querystring=require('querystring');var Papa=require(_0xd130('0x10'));var Redis=require(_0xd130('0x11'));var authService=require(_0xd130('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd130('0x13'));var hardwareService=require(_0xd130('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd130('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd130('0x16'));var db=require(_0xd130('0x17'))['db'];function respondWithStatusCode(_0x52ac4d,_0x176cbf){_0x176cbf=_0x176cbf||0xcc;return function(_0x3ec517){if(_0x3ec517){return _0x52ac4d[_0xd130('0x18')](_0x176cbf);}return _0x52ac4d['status'](_0x176cbf)['end']();};}function respondWithResult(_0x593a66,_0x1f56b7){_0x1f56b7=_0x1f56b7||0xc8;return function(_0x39a129){if(_0x39a129){return _0x593a66[_0xd130('0x19')](_0x1f56b7)[_0xd130('0x1a')](_0x39a129);}};}function respondWithFilteredResult(_0xd8075,_0x573e6b){return function(_0x1239d7){if(_0x1239d7){var _0x3a59de=typeof _0x573e6b[_0xd130('0x1b')]===_0xd130('0x1c')&&typeof _0x573e6b['limit']===_0xd130('0x1c');var _0x26430b=_0x1239d7[_0xd130('0x1d')];var _0xce6d93=_0x3a59de?0x0:_0x573e6b[_0xd130('0x1b')];var _0xc1c504=_0x3a59de?_0x1239d7[_0xd130('0x1d')]:_0x573e6b[_0xd130('0x1b')]+_0x573e6b['limit'];var _0x543144;if(_0xc1c504>=_0x26430b){_0xc1c504=_0x26430b;_0x543144=0xc8;}else{_0x543144=0xce;}_0xd8075[_0xd130('0x19')](_0x543144);return _0xd8075[_0xd130('0x1e')](_0xd130('0x1f'),_0xce6d93+'-'+_0xc1c504+'/'+_0x26430b)['json'](_0x1239d7);}return null;};}function patchUpdates(_0x2420fd){return function(_0xcf5ce){try{jsonpatch[_0xd130('0x20')](_0xcf5ce,_0x2420fd,!![]);}catch(_0x1d9cc8){return BPromise[_0xd130('0x21')](_0x1d9cc8);}return _0xcf5ce[_0xd130('0x22')]();};}function saveUpdates(_0x4e5860,_0x311c3a){return function(_0x331b1a){if(_0x331b1a){return _0x331b1a[_0xd130('0x23')](_0x4e5860)[_0xd130('0x24')](function(_0x3faa63){return _0x3faa63;});}return null;};}function removeEntity(_0x159a02,_0x15208f){return function(_0x316540){if(_0x316540){return _0x316540[_0xd130('0x25')]()[_0xd130('0x24')](function(){_0x159a02['status'](0xcc)[_0xd130('0x26')]();});}};}function handleEntityNotFound(_0x44c560,_0x44d537){return function(_0x14bef5){if(!_0x14bef5){_0x44c560[_0xd130('0x18')](0x194);}return _0x14bef5;};}function handleError(_0xf79e5c,_0x51c187){_0x51c187=_0x51c187||0x1f4;return function(_0x31efe6){logger['error'](_0x31efe6[_0xd130('0x27')]);if(_0x31efe6['name']){delete _0x31efe6['name'];}_0xf79e5c['status'](_0x51c187)[_0xd130('0x28')](_0x31efe6);};}exports[_0xd130('0x29')]=function(_0x3a8218,_0x16aac6){var _0x5342a2={},_0x1d8d1c={},_0x154eb6={'count':0x0,'rows':[]};var _0x28127d=_['map'](db[_0xd130('0x2a')]['rawAttributes'],function(_0x51d24e){return{'name':_0x51d24e['fieldName'],'type':_0x51d24e[_0xd130('0x2b')][_0xd130('0x2c')]};});_0x1d8d1c[_0xd130('0x2d')]=_['map'](_0x28127d,_0xd130('0x2e'));_0x1d8d1c[_0xd130('0x2f')]=_[_0xd130('0x30')](_0x3a8218[_0xd130('0x2f')]);_0x1d8d1c[_0xd130('0x31')]=_['intersection'](_0x1d8d1c[_0xd130('0x2d')],_0x1d8d1c[_0xd130('0x2f')]);_0x5342a2[_0xd130('0x32')]=_['intersection'](_0x1d8d1c[_0xd130('0x2d')],qs[_0xd130('0x33')](_0x3a8218['query'][_0xd130('0x33')]));_0x5342a2[_0xd130('0x32')]=_0x5342a2['attributes'][_0xd130('0x34')]?_0x5342a2[_0xd130('0x32')]:_0x1d8d1c[_0xd130('0x2d')];if(!_0x3a8218[_0xd130('0x2f')][_0xd130('0x35')](_0xd130('0x36'))){_0x5342a2['limit']=qs[_0xd130('0x37')](_0x3a8218[_0xd130('0x2f')][_0xd130('0x37')]);_0x5342a2[_0xd130('0x1b')]=qs[_0xd130('0x1b')](_0x3a8218[_0xd130('0x2f')][_0xd130('0x1b')]);}_0x5342a2[_0xd130('0x38')]=qs[_0xd130('0x39')](_0x3a8218['query'][_0xd130('0x39')]);_0x5342a2[_0xd130('0x3a')]=qs['filters'](_[_0xd130('0x3b')](_0x3a8218[_0xd130('0x2f')],_0x1d8d1c[_0xd130('0x31')]),_0x28127d);if(_0x3a8218[_0xd130('0x2f')][_0xd130('0x3c')]){_0x5342a2['where']=_[_0xd130('0x3d')](_0x5342a2[_0xd130('0x3a')],{'$or':_[_0xd130('0x3e')](_0x28127d,function(_0x54d0f1){if(_0x54d0f1[_0xd130('0x2b')]!==_0xd130('0x3f')){var _0x52e3b3={};_0x52e3b3[_0x54d0f1[_0xd130('0x2e')]]={'$like':'%'+_0x3a8218[_0xd130('0x2f')][_0xd130('0x3c')]+'%'};return _0x52e3b3;}})});}_0x5342a2=_[_0xd130('0x3d')]({},_0x5342a2,_0x3a8218[_0xd130('0x40')]);var _0x16ed3b={'where':_0x5342a2['where']};return db['FaxQueueReport'][_0xd130('0x1d')](_0x16ed3b)[_0xd130('0x24')](function(_0x3d678d){_0x154eb6['count']=_0x3d678d;if(_0x3a8218['query']['includeAll']){_0x5342a2['include']=[{'all':!![]}];}return db[_0xd130('0x2a')][_0xd130('0x41')](_0x5342a2);})[_0xd130('0x24')](function(_0x13f3b9){_0x154eb6[_0xd130('0x42')]=_0x13f3b9;return _0x154eb6;})['then'](respondWithFilteredResult(_0x16aac6,_0x5342a2))[_0xd130('0x43')](handleError(_0x16aac6,null));};exports[_0xd130('0x44')]=function(_0x67abd3,_0xdfcefe){var _0xb1c3d9={'raw':!![],'where':{'id':_0x67abd3[_0xd130('0x45')]['id']}},_0x10154a={};_0x10154a[_0xd130('0x2d')]=_['keys'](db[_0xd130('0x2a')][_0xd130('0x46')]);_0x10154a['query']=_[_0xd130('0x30')](_0x67abd3['query']);_0x10154a[_0xd130('0x31')]=_[_0xd130('0x47')](_0x10154a['model'],_0x10154a[_0xd130('0x2f')]);_0xb1c3d9['attributes']=_[_0xd130('0x47')](_0x10154a[_0xd130('0x2d')],qs[_0xd130('0x33')](_0x67abd3[_0xd130('0x2f')][_0xd130('0x33')]));_0xb1c3d9[_0xd130('0x32')]=_0xb1c3d9[_0xd130('0x32')][_0xd130('0x34')]?_0xb1c3d9[_0xd130('0x32')]:_0x10154a[_0xd130('0x2d')];if(_0x67abd3[_0xd130('0x2f')][_0xd130('0x48')]){_0xb1c3d9[_0xd130('0x49')]=[{'all':!![]}];}_0xb1c3d9=_[_0xd130('0x3d')]({},_0xb1c3d9,_0x67abd3['options']);return db['FaxQueueReport']['find'](_0xb1c3d9)['then'](handleEntityNotFound(_0xdfcefe,null))['then'](respondWithResult(_0xdfcefe,null))['catch'](handleError(_0xdfcefe,null));};exports['create']=function(_0x239624,_0x5d4d42){return db['FaxQueueReport'][_0xd130('0x4a')](_0x239624['body'],{})['then'](respondWithResult(_0x5d4d42,0xc9))[_0xd130('0x43')](handleError(_0x5d4d42,null));};exports[_0xd130('0x23')]=function(_0x25f07c,_0x4e3bfa){if(_0x25f07c[_0xd130('0x4b')]['id']){delete _0x25f07c[_0xd130('0x4b')]['id'];}return db[_0xd130('0x2a')]['find']({'where':{'id':_0x25f07c[_0xd130('0x45')]['id']}})['then'](handleEntityNotFound(_0x4e3bfa,null))[_0xd130('0x24')](saveUpdates(_0x25f07c[_0xd130('0x4b')],null))['then'](respondWithResult(_0x4e3bfa,null))['catch'](handleError(_0x4e3bfa,null));};exports[_0xd130('0x25')]=function(_0x2bac28,_0x3b69af){return db[_0xd130('0x2a')]['find']({'where':{'id':_0x2bac28[_0xd130('0x45')]['id']}})[_0xd130('0x24')](handleEntityNotFound(_0x3b69af,null))[_0xd130('0x24')](removeEntity(_0x3b69af,null))['catch'](handleError(_0x3b69af,null));};exports[_0xd130('0x4c')]=function(_0x1753e3,_0x3b1221){return db['FaxQueueReport'][_0xd130('0x4c')]()[_0xd130('0x24')](respondWithResult(_0x3b1221,null))[_0xd130('0x43')](handleError(_0x3b1221,null));};
\ No newline at end of file
+var _0x63bb=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','name','send','index','map','FaxQueueReport','rawAttributes','fieldName'];(function(_0x5ee526,_0x41dae6){var _0x37cdce=function(_0x3a447a){while(--_0x3a447a){_0x5ee526['push'](_0x5ee526['shift']());}};_0x37cdce(++_0x41dae6);}(_0x63bb,0xf8));var _0xb63b=function(_0x1964b4,_0x5796f4){_0x1964b4=_0x1964b4-0x0;var _0x509a77=_0x63bb[_0x1964b4];return _0x509a77;};'use strict';var emlformat=require(_0xb63b('0x0'));var rimraf=require(_0xb63b('0x1'));var zipdir=require(_0xb63b('0x2'));var jsonpatch=require(_0xb63b('0x3'));var rp=require(_0xb63b('0x4'));var moment=require(_0xb63b('0x5'));var BPromise=require(_0xb63b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb63b('0x7'));var sox=require(_0xb63b('0x8'));var csv=require(_0xb63b('0x9'));var ejs=require(_0xb63b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb63b('0xb'));var squel=require(_0xb63b('0xc'));var crypto=require(_0xb63b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb63b('0xe'));var toCsv=require(_0xb63b('0x9'));var querystring=require('querystring');var Papa=require(_0xb63b('0xf'));var Redis=require(_0xb63b('0x10'));var authService=require(_0xb63b('0x11'));var qs=require(_0xb63b('0x12'));var as=require(_0xb63b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb63b('0x14'))(_0xb63b('0x15'));var utils=require(_0xb63b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb63b('0x17'))['db'];function respondWithStatusCode(_0x1dca68,_0x286ca9){_0x286ca9=_0x286ca9||0xcc;return function(_0x41ff77){if(_0x41ff77){return _0x1dca68['sendStatus'](_0x286ca9);}return _0x1dca68[_0xb63b('0x18')](_0x286ca9)[_0xb63b('0x19')]();};}function respondWithResult(_0x398ecb,_0x3f1f42){_0x3f1f42=_0x3f1f42||0xc8;return function(_0x2d0e2a){if(_0x2d0e2a){return _0x398ecb[_0xb63b('0x18')](_0x3f1f42)[_0xb63b('0x1a')](_0x2d0e2a);}};}function respondWithFilteredResult(_0x55bfc8,_0x4a0e68){return function(_0x535c8f){if(_0x535c8f){var _0x21ac0e=typeof _0x4a0e68[_0xb63b('0x1b')]===_0xb63b('0x1c')&&typeof _0x4a0e68[_0xb63b('0x1d')]===_0xb63b('0x1c');var _0x59718f=_0x535c8f[_0xb63b('0x1e')];var _0x322426=_0x21ac0e?0x0:_0x4a0e68['offset'];var _0x55f315=_0x21ac0e?_0x535c8f['count']:_0x4a0e68[_0xb63b('0x1b')]+_0x4a0e68[_0xb63b('0x1d')];var _0x39b7b7;if(_0x55f315>=_0x59718f){_0x55f315=_0x59718f;_0x39b7b7=0xc8;}else{_0x39b7b7=0xce;}_0x55bfc8[_0xb63b('0x18')](_0x39b7b7);return _0x55bfc8['set'](_0xb63b('0x1f'),_0x322426+'-'+_0x55f315+'/'+_0x59718f)[_0xb63b('0x1a')](_0x535c8f);}return null;};}function patchUpdates(_0x2743a1){return function(_0x1fe0ad){try{jsonpatch['apply'](_0x1fe0ad,_0x2743a1,!![]);}catch(_0x482cb8){return BPromise[_0xb63b('0x20')](_0x482cb8);}return _0x1fe0ad['save']();};}function saveUpdates(_0x343e1d,_0xb3d331){return function(_0x37a57f){if(_0x37a57f){return _0x37a57f[_0xb63b('0x21')](_0x343e1d)[_0xb63b('0x22')](function(_0x2cc35c){return _0x2cc35c;});}return null;};}function removeEntity(_0x124cac,_0x33ee73){return function(_0x5aedd2){if(_0x5aedd2){return _0x5aedd2[_0xb63b('0x23')]()['then'](function(){_0x124cac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x89c2ed,_0x3e8121){return function(_0x4f8b1d){if(!_0x4f8b1d){_0x89c2ed[_0xb63b('0x24')](0x194);}return _0x4f8b1d;};}function handleError(_0x4b5c70,_0x553e74){_0x553e74=_0x553e74||0x1f4;return function(_0x512053){logger['error'](_0x512053['stack']);if(_0x512053[_0xb63b('0x25')]){delete _0x512053[_0xb63b('0x25')];}_0x4b5c70[_0xb63b('0x18')](_0x553e74)[_0xb63b('0x26')](_0x512053);};}exports[_0xb63b('0x27')]=function(_0x52be4c,_0x50c87e){var _0x1fd64d={},_0x4ddcf0={},_0x239e4c={'count':0x0,'rows':[]};var _0x3eb2eb=_[_0xb63b('0x28')](db[_0xb63b('0x29')][_0xb63b('0x2a')],function(_0x56c828){return{'name':_0x56c828[_0xb63b('0x2b')],'type':_0x56c828['type'][_0xb63b('0x2c')]};});_0x4ddcf0[_0xb63b('0x2d')]=_[_0xb63b('0x28')](_0x3eb2eb,_0xb63b('0x25'));_0x4ddcf0[_0xb63b('0x2e')]=_[_0xb63b('0x2f')](_0x52be4c[_0xb63b('0x2e')]);_0x4ddcf0[_0xb63b('0x30')]=_[_0xb63b('0x31')](_0x4ddcf0[_0xb63b('0x2d')],_0x4ddcf0[_0xb63b('0x2e')]);_0x1fd64d[_0xb63b('0x32')]=_[_0xb63b('0x31')](_0x4ddcf0[_0xb63b('0x2d')],qs[_0xb63b('0x33')](_0x52be4c[_0xb63b('0x2e')][_0xb63b('0x33')]));_0x1fd64d[_0xb63b('0x32')]=_0x1fd64d[_0xb63b('0x32')][_0xb63b('0x34')]?_0x1fd64d[_0xb63b('0x32')]:_0x4ddcf0[_0xb63b('0x2d')];if(!_0x52be4c['query'][_0xb63b('0x35')](_0xb63b('0x36'))){_0x1fd64d['limit']=qs[_0xb63b('0x1d')](_0x52be4c[_0xb63b('0x2e')]['limit']);_0x1fd64d[_0xb63b('0x1b')]=qs[_0xb63b('0x1b')](_0x52be4c[_0xb63b('0x2e')]['offset']);}_0x1fd64d[_0xb63b('0x37')]=qs[_0xb63b('0x38')](_0x52be4c['query']['sort']);_0x1fd64d[_0xb63b('0x39')]=qs[_0xb63b('0x30')](_[_0xb63b('0x3a')](_0x52be4c[_0xb63b('0x2e')],_0x4ddcf0[_0xb63b('0x30')]),_0x3eb2eb);if(_0x52be4c[_0xb63b('0x2e')][_0xb63b('0x3b')]){_0x1fd64d[_0xb63b('0x39')]=_['merge'](_0x1fd64d[_0xb63b('0x39')],{'$or':_['map'](_0x3eb2eb,function(_0x1c20a7){if(_0x1c20a7[_0xb63b('0x3c')]!=='VIRTUAL'){var _0x514036={};_0x514036[_0x1c20a7[_0xb63b('0x25')]]={'$like':'%'+_0x52be4c[_0xb63b('0x2e')][_0xb63b('0x3b')]+'%'};return _0x514036;}})});}_0x1fd64d=_[_0xb63b('0x3d')]({},_0x1fd64d,_0x52be4c[_0xb63b('0x3e')]);var _0x3decf4={'where':_0x1fd64d[_0xb63b('0x39')]};return db[_0xb63b('0x29')][_0xb63b('0x1e')](_0x3decf4)[_0xb63b('0x22')](function(_0x430e2f){_0x239e4c[_0xb63b('0x1e')]=_0x430e2f;if(_0x52be4c[_0xb63b('0x2e')][_0xb63b('0x3f')]){_0x1fd64d[_0xb63b('0x40')]=[{'all':!![]}];}return db[_0xb63b('0x29')][_0xb63b('0x41')](_0x1fd64d);})[_0xb63b('0x22')](function(_0xe00fa2){_0x239e4c[_0xb63b('0x42')]=_0xe00fa2;return _0x239e4c;})[_0xb63b('0x22')](respondWithFilteredResult(_0x50c87e,_0x1fd64d))[_0xb63b('0x43')](handleError(_0x50c87e,null));};exports['show']=function(_0x4da428,_0x523d90){var _0x4ade9f={'raw':!![],'where':{'id':_0x4da428[_0xb63b('0x44')]['id']}},_0x2531d6={};_0x2531d6[_0xb63b('0x2d')]=_[_0xb63b('0x2f')](db[_0xb63b('0x29')][_0xb63b('0x2a')]);_0x2531d6[_0xb63b('0x2e')]=_[_0xb63b('0x2f')](_0x4da428['query']);_0x2531d6[_0xb63b('0x30')]=_[_0xb63b('0x31')](_0x2531d6[_0xb63b('0x2d')],_0x2531d6[_0xb63b('0x2e')]);_0x4ade9f[_0xb63b('0x32')]=_[_0xb63b('0x31')](_0x2531d6[_0xb63b('0x2d')],qs['fields'](_0x4da428['query'][_0xb63b('0x33')]));_0x4ade9f['attributes']=_0x4ade9f[_0xb63b('0x32')][_0xb63b('0x34')]?_0x4ade9f['attributes']:_0x2531d6[_0xb63b('0x2d')];if(_0x4da428[_0xb63b('0x2e')][_0xb63b('0x3f')]){_0x4ade9f[_0xb63b('0x40')]=[{'all':!![]}];}_0x4ade9f=_['merge']({},_0x4ade9f,_0x4da428[_0xb63b('0x3e')]);return db[_0xb63b('0x29')][_0xb63b('0x45')](_0x4ade9f)[_0xb63b('0x22')](handleEntityNotFound(_0x523d90,null))[_0xb63b('0x22')](respondWithResult(_0x523d90,null))[_0xb63b('0x43')](handleError(_0x523d90,null));};exports['create']=function(_0x2164aa,_0x380066){return db[_0xb63b('0x29')][_0xb63b('0x46')](_0x2164aa['body'],{})[_0xb63b('0x22')](respondWithResult(_0x380066,0xc9))[_0xb63b('0x43')](handleError(_0x380066,null));};exports['update']=function(_0x771923,_0x2e785a){if(_0x771923[_0xb63b('0x47')]['id']){delete _0x771923[_0xb63b('0x47')]['id'];}return db[_0xb63b('0x29')][_0xb63b('0x45')]({'where':{'id':_0x771923[_0xb63b('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e785a,null))[_0xb63b('0x22')](saveUpdates(_0x771923['body'],null))['then'](respondWithResult(_0x2e785a,null))[_0xb63b('0x43')](handleError(_0x2e785a,null));};exports['destroy']=function(_0x1efcd0,_0x423ff7){return db[_0xb63b('0x29')]['find']({'where':{'id':_0x1efcd0['params']['id']}})['then'](handleEntityNotFound(_0x423ff7,null))[_0xb63b('0x22')](removeEntity(_0x423ff7,null))[_0xb63b('0x43')](handleError(_0x423ff7,null));};exports['describe']=function(_0x3efe2f,_0x1f57dd){return db['FaxQueueReport'][_0xb63b('0x48')]()[_0xb63b('0x22')](respondWithResult(_0x1f57dd,null))[_0xb63b('0x43')](handleError(_0x1f57dd,null));};
\ No newline at end of file
index b2dc74c..2340358 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0xb07bff,_0xc797b5){var _0x3e5f14=function(_0x43ffd7){while(--_0x43ffd7){_0xb07bff['push'](_0xb07bff['shift']());}};_0x3e5f14(++_0xc797b5);}(_0x326f,0xd1));var _0xf326=function(_0x39ba6f,_0x418f7d){_0x39ba6f=_0x39ba6f-0x0;var _0x135844=_0x326f[_0x39ba6f];return _0x135844;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x21dc78,_0xa27f9b){var _0x37a65a=function(_0x5994e5){while(--_0x5994e5){_0x21dc78['push'](_0x21dc78['shift']());}};_0x37a65a(++_0xa27f9b);}(_0x7a54,0x106));var _0x47a5=function(_0x5e9584,_0x2828ec){_0x5e9584=_0x5e9584-0x0;var _0x119acb=_0x7a54[_0x5e9584];return _0x119acb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 57301f4..22674fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3485=['moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxQueueReport','options','raw','stringify','FaxQueueReport','update','body','attributes','limit','UpdateFaxQueueReport','lodash','util'];(function(_0x2925ce,_0x944469){var _0x3c4445=function(_0x5c131b){while(--_0x5c131b){_0x2925ce['push'](_0x2925ce['shift']());}};_0x3c4445(++_0x944469);}(_0x3485,0x1ab));var _0x5348=function(_0x38b7f1,_0xf0f56c){_0x38b7f1=_0x38b7f1-0x0;var _0x53dfa8=_0x3485[_0x38b7f1];return _0x53dfa8;};'use strict';var _=require(_0x5348('0x0'));var util=require(_0x5348('0x1'));var moment=require(_0x5348('0x2'));var BPromise=require(_0x5348('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5348('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5348('0x5'));var logger=require(_0x5348('0x6'))('rpc');var config=require(_0x5348('0x7'));var jayson=require(_0x5348('0x8'));var client=jayson[_0x5348('0x9')][_0x5348('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8d8213,_0x5bdcf4,_0x3160d0){return new BPromise(function(_0x85b2ad,_0x13c397){return client[_0x5348('0xb')](_0x8d8213,_0x3160d0)[_0x5348('0xc')](function(_0xd01d77){logger[_0x5348('0xd')](_0x5348('0xe'),_0x5bdcf4,_0x5348('0xf'));logger[_0x5348('0x10')](_0x5348('0x11'),_0x5bdcf4,_0x5348('0xf'),JSON['stringify'](_0xd01d77));if(_0xd01d77[_0x5348('0x12')]){if(_0xd01d77[_0x5348('0x12')][_0x5348('0x13')]===0x1f4){logger[_0x5348('0x12')](_0x5348('0xe'),_0x5bdcf4,_0xd01d77[_0x5348('0x12')][_0x5348('0x14')]);return _0x13c397(_0xd01d77[_0x5348('0x12')][_0x5348('0x14')]);}logger[_0x5348('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x5bdcf4,_0xd01d77[_0x5348('0x12')][_0x5348('0x14')]);return _0x85b2ad(_0xd01d77[_0x5348('0x12')][_0x5348('0x14')]);}else{logger[_0x5348('0xd')](_0x5348('0xe'),_0x5bdcf4,_0x5348('0xf'));_0x85b2ad(_0xd01d77[_0x5348('0x15')][_0x5348('0x14')]);}})[_0x5348('0x16')](function(_0x2a4a5c){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5bdcf4,_0x2a4a5c);_0x13c397(_0x2a4a5c);});});}exports[_0x5348('0x17')]=function(_0x21b9e5){var _0x30c9ff=this;return new Promise(function(_0x5940d0,_0x3a7c13){return db['FaxQueueReport']['create'](_0x21b9e5['body'],{'raw':_0x21b9e5[_0x5348('0x18')]?_0x21b9e5[_0x5348('0x18')][_0x5348('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x30a0a3){logger['info'](_0x5348('0x17'),_0x21b9e5);logger[_0x5348('0x10')](_0x5348('0x17'),_0x21b9e5,JSON[_0x5348('0x1a')](_0x30a0a3));_0x5940d0(_0x30a0a3);})['catch'](function(_0x50b30f){logger[_0x5348('0x12')](_0x5348('0x17'),_0x50b30f[_0x5348('0x14')],_0x21b9e5);_0x3a7c13(_0x30c9ff['error'](0x1f4,_0x50b30f[_0x5348('0x14')]));});});};exports['UpdateFaxQueueReport']=function(_0x38cf0d){var _0x319ec8=this;return new Promise(function(_0x480c31,_0x209105){return db[_0x5348('0x1b')][_0x5348('0x1c')](_0x38cf0d[_0x5348('0x1d')],{'raw':_0x38cf0d[_0x5348('0x18')]?_0x38cf0d[_0x5348('0x18')][_0x5348('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38cf0d[_0x5348('0x18')]?_0x38cf0d['options']['where']||null:null,'attributes':_0x38cf0d[_0x5348('0x18')]?_0x38cf0d[_0x5348('0x18')][_0x5348('0x1e')]||null:null,'limit':_0x38cf0d[_0x5348('0x18')]?_0x38cf0d['options'][_0x5348('0x1f')]||null:null})[_0x5348('0xc')](function(_0x4fd961){logger[_0x5348('0xd')](_0x5348('0x20'),_0x38cf0d);logger[_0x5348('0x10')](_0x5348('0x20'),_0x38cf0d,JSON[_0x5348('0x1a')](_0x4fd961));_0x480c31(_0x4fd961);})[_0x5348('0x16')](function(_0x1f30f5){logger[_0x5348('0x12')]('UpdateFaxQueueReport',_0x1f30f5[_0x5348('0x14')],_0x38cf0d);_0x209105(_0x319ec8['error'](0x1f4,_0x1f30f5[_0x5348('0x14')]));});});};
\ No newline at end of file
+var _0xe980=['catch','CreateFaxQueueReport','FaxQueueReport','create','options','info','UpdateFaxQueueReport','update','body','raw','attributes','limit','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x439f6b,_0x5d0e56){var _0x34b277=function(_0x1d144e){while(--_0x1d144e){_0x439f6b['push'](_0x439f6b['shift']());}};_0x34b277(++_0x5d0e56);}(_0xe980,0x19f));var _0x0e98=function(_0x3d63d6,_0x16f4e7){_0x3d63d6=_0x3d63d6-0x0;var _0x2b5c13=_0xe980[_0x3d63d6];return _0x2b5c13;};'use strict';var _=require('lodash');var util=require(_0x0e98('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0e98('0x1'));var fs=require('fs');var Redis=require(_0x0e98('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e98('0x3'));var logger=require('../../config/logger')(_0x0e98('0x4'));var config=require(_0x0e98('0x5'));var jayson=require(_0x0e98('0x6'));var client=jayson[_0x0e98('0x7')][_0x0e98('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17d89c,_0xcf50a8,_0x4b4143){return new BPromise(function(_0xa74033,_0x389b27){return client[_0x0e98('0x9')](_0x17d89c,_0x4b4143)[_0x0e98('0xa')](function(_0xc72e08){logger['info'](_0x0e98('0xb'),_0xcf50a8,_0x0e98('0xc'));logger[_0x0e98('0xd')](_0x0e98('0xe'),_0xcf50a8,_0x0e98('0xc'),JSON[_0x0e98('0xf')](_0xc72e08));if(_0xc72e08[_0x0e98('0x10')]){if(_0xc72e08['error'][_0x0e98('0x11')]===0x1f4){logger['error'](_0x0e98('0xb'),_0xcf50a8,_0xc72e08['error'][_0x0e98('0x12')]);return _0x389b27(_0xc72e08[_0x0e98('0x10')][_0x0e98('0x12')]);}logger['error'](_0x0e98('0xb'),_0xcf50a8,_0xc72e08[_0x0e98('0x10')][_0x0e98('0x12')]);return _0xa74033(_0xc72e08['error'][_0x0e98('0x12')]);}else{logger['info'](_0x0e98('0xb'),_0xcf50a8,'request\x20sent');_0xa74033(_0xc72e08['result'][_0x0e98('0x12')]);}})[_0x0e98('0x13')](function(_0x4ec269){logger[_0x0e98('0x10')](_0x0e98('0xb'),_0xcf50a8,_0x4ec269);_0x389b27(_0x4ec269);});});}exports[_0x0e98('0x14')]=function(_0x2b437b){var _0x238f77=this;return new Promise(function(_0x37de93,_0x58f572){return db[_0x0e98('0x15')][_0x0e98('0x16')](_0x2b437b['body'],{'raw':_0x2b437b[_0x0e98('0x17')]?_0x2b437b[_0x0e98('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x0e98('0xa')](function(_0x1a8a41){logger[_0x0e98('0x18')](_0x0e98('0x14'),_0x2b437b);logger[_0x0e98('0xd')](_0x0e98('0x14'),_0x2b437b,JSON[_0x0e98('0xf')](_0x1a8a41));_0x37de93(_0x1a8a41);})['catch'](function(_0x34c115){logger['error']('CreateFaxQueueReport',_0x34c115[_0x0e98('0x12')],_0x2b437b);_0x58f572(_0x238f77['error'](0x1f4,_0x34c115[_0x0e98('0x12')]));});});};exports[_0x0e98('0x19')]=function(_0x3f0ee9){var _0x2e5268=this;return new Promise(function(_0x20580f,_0x340a61){return db['FaxQueueReport'][_0x0e98('0x1a')](_0x3f0ee9[_0x0e98('0x1b')],{'raw':_0x3f0ee9['options']?_0x3f0ee9[_0x0e98('0x17')][_0x0e98('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f0ee9[_0x0e98('0x17')]?_0x3f0ee9[_0x0e98('0x17')]['where']||null:null,'attributes':_0x3f0ee9[_0x0e98('0x17')]?_0x3f0ee9[_0x0e98('0x17')][_0x0e98('0x1d')]||null:null,'limit':_0x3f0ee9['options']?_0x3f0ee9[_0x0e98('0x17')][_0x0e98('0x1e')]||null:null})[_0x0e98('0xa')](function(_0x3663d1){logger['info'](_0x0e98('0x19'),_0x3f0ee9);logger['debug'](_0x0e98('0x19'),_0x3f0ee9,JSON['stringify'](_0x3663d1));_0x20580f(_0x3663d1);})[_0x0e98('0x13')](function(_0x547247){logger[_0x0e98('0x10')]('UpdateFaxQueueReport',_0x547247[_0x0e98('0x12')],_0x3f0ee9);_0x340a61(_0x2e5268[_0x0e98('0x10')](0x1f4,_0x547247[_0x0e98('0x12')]));});});};
\ No newline at end of file
index c2eb0d1..365d6a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92a0=['index','/describe','isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get'];(function(_0x2a0592,_0x360e8c){var _0x39658d=function(_0x4f9ae3){while(--_0x4f9ae3){_0x2a0592['push'](_0x2a0592['shift']());}};_0x39658d(++_0x360e8c);}(_0x92a0,0x170));var _0x092a=function(_0x1f5873,_0x1497be){_0x1f5873=_0x1f5873-0x0;var _0x2a75d9=_0x92a0[_0x1f5873];return _0x2a75d9;};'use strict';var multer=require(_0x092a('0x0'));var util=require(_0x092a('0x1'));var path=require(_0x092a('0x2'));var timeout=require(_0x092a('0x3'));var express=require(_0x092a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x092a('0x5'));var interaction=require(_0x092a('0x6'));var config=require(_0x092a('0x7'));var controller=require(_0x092a('0x8'));router[_0x092a('0x9')]('/',auth['isAuthenticated'](),controller[_0x092a('0xa')]);router['get'](_0x092a('0xb'),auth[_0x092a('0xc')](),controller[_0x092a('0xd')]);router[_0x092a('0x9')](_0x092a('0xe'),auth[_0x092a('0xc')](),controller[_0x092a('0xf')]);router[_0x092a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x092a('0xe'),auth[_0x092a('0xc')](),controller[_0x092a('0x11')]);router[_0x092a('0x12')]('/:id',auth[_0x092a('0xc')](),controller[_0x092a('0x13')]);module[_0x092a('0x14')]=router;
\ No newline at end of file
+var _0x4fe2=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x20025e,_0x44c8e1){var _0x4a5ac4=function(_0x359a69){while(--_0x359a69){_0x20025e['push'](_0x20025e['shift']());}};_0x4a5ac4(++_0x44c8e1);}(_0x4fe2,0x12f));var _0x24fe=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4fe2[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0x24fe('0x0'));var util=require(_0x24fe('0x1'));var path=require(_0x24fe('0x2'));var timeout=require(_0x24fe('0x3'));var express=require(_0x24fe('0x4'));var router=express[_0x24fe('0x5')]();var fs_extra=require(_0x24fe('0x6'));var auth=require(_0x24fe('0x7'));var interaction=require(_0x24fe('0x8'));var config=require(_0x24fe('0x9'));var controller=require(_0x24fe('0xa'));router[_0x24fe('0xb')]('/',auth[_0x24fe('0xc')](),controller['index']);router['get'](_0x24fe('0xd'),auth['isAuthenticated'](),controller[_0x24fe('0xe')]);router[_0x24fe('0xb')](_0x24fe('0xf'),auth[_0x24fe('0xc')](),controller[_0x24fe('0x10')]);router['post']('/',auth[_0x24fe('0xc')](),controller[_0x24fe('0x11')]);router[_0x24fe('0x12')]('/:id',auth[_0x24fe('0xc')](),controller[_0x24fe('0x13')]);router[_0x24fe('0x14')](_0x24fe('0xf'),auth[_0x24fe('0xc')](),controller['destroy']);module[_0x24fe('0x15')]=router;
\ No newline at end of file
index d9d7b76..723291e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x38ed68,_0x58387a){var _0x2ca3c5=function(_0x39c190){while(--_0x39c190){_0x38ed68['push'](_0x38ed68['shift']());}};_0x2ca3c5(++_0x58387a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1b80f2,_0x3943af){_0x1b80f2=_0x1b80f2-0x0;var _0x162255=_0xf4eb[_0x1b80f2];return _0x162255;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x359e61,_0x1b5adb){var _0x191c3a=function(_0x34427e){while(--_0x34427e){_0x359e61['push'](_0x359e61['shift']());}};_0x191c3a(++_0x1b5adb);}(_0xaa88,0x137));var _0x8aa8=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xaa88[_0x316904];return _0xfa9a21;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
index 69bd20c..9af0724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3468=['set','apply','save','update','destroy','sendStatus','error','stack','name','index','FaxTransferReport','type','model','map','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','rawAttributes','keys','intersection','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count'];(function(_0x5778a3,_0x3a16b2){var _0x727415=function(_0x1c8df8){while(--_0x1c8df8){_0x5778a3['push'](_0x5778a3['shift']());}};_0x727415(++_0x3a16b2);}(_0x3468,0x107));var _0x8346=function(_0x10ab03,_0x2c9d95){_0x10ab03=_0x10ab03-0x0;var _0x4a8307=_0x3468[_0x10ab03];return _0x4a8307;};'use strict';var emlformat=require(_0x8346('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8346('0x1'));var jsonpatch=require(_0x8346('0x2'));var rp=require(_0x8346('0x3'));var moment=require('moment');var BPromise=require(_0x8346('0x4'));var Mustache=require(_0x8346('0x5'));var util=require(_0x8346('0x6'));var path=require(_0x8346('0x7'));var sox=require(_0x8346('0x8'));var csv=require(_0x8346('0x9'));var ejs=require(_0x8346('0xa'));var fs=require('fs');var fs_extra=require(_0x8346('0xb'));var _=require(_0x8346('0xc'));var squel=require(_0x8346('0xd'));var crypto=require(_0x8346('0xe'));var jsforce=require(_0x8346('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8346('0x9'));var querystring=require(_0x8346('0x10'));var Papa=require('papaparse');var Redis=require(_0x8346('0x11'));var authService=require(_0x8346('0x12'));var qs=require(_0x8346('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8346('0x14'));var logger=require(_0x8346('0x15'))(_0x8346('0x16'));var utils=require('../../config/utils');var config=require(_0x8346('0x17'));var licenseUtil=require(_0x8346('0x18'));var db=require(_0x8346('0x19'))['db'];function respondWithStatusCode(_0x560493,_0x456289){_0x456289=_0x456289||0xcc;return function(_0x5d475d){if(_0x5d475d){return _0x560493['sendStatus'](_0x456289);}return _0x560493[_0x8346('0x1a')](_0x456289)[_0x8346('0x1b')]();};}function respondWithResult(_0x4c7faf,_0x5a40cf){_0x5a40cf=_0x5a40cf||0xc8;return function(_0x3bb91f){if(_0x3bb91f){return _0x4c7faf['status'](_0x5a40cf)[_0x8346('0x1c')](_0x3bb91f);}};}function respondWithFilteredResult(_0x2fff03,_0x22ba02){return function(_0x50d640){if(_0x50d640){var _0x1a8143=typeof _0x22ba02[_0x8346('0x1d')]===_0x8346('0x1e')&&typeof _0x22ba02[_0x8346('0x1f')]===_0x8346('0x1e');var _0x3219e5=_0x50d640[_0x8346('0x20')];var _0x377251=_0x1a8143?0x0:_0x22ba02['offset'];var _0x119690=_0x1a8143?_0x50d640[_0x8346('0x20')]:_0x22ba02[_0x8346('0x1d')]+_0x22ba02['limit'];var _0x12b393;if(_0x119690>=_0x3219e5){_0x119690=_0x3219e5;_0x12b393=0xc8;}else{_0x12b393=0xce;}_0x2fff03[_0x8346('0x1a')](_0x12b393);return _0x2fff03[_0x8346('0x21')]('Content-Range',_0x377251+'-'+_0x119690+'/'+_0x3219e5)[_0x8346('0x1c')](_0x50d640);}return null;};}function patchUpdates(_0x313ca6){return function(_0x1c53af){try{jsonpatch[_0x8346('0x22')](_0x1c53af,_0x313ca6,!![]);}catch(_0x1d31a1){return BPromise['reject'](_0x1d31a1);}return _0x1c53af[_0x8346('0x23')]();};}function saveUpdates(_0x1ef5ce,_0x4cab15){return function(_0x15d855){if(_0x15d855){return _0x15d855[_0x8346('0x24')](_0x1ef5ce)['then'](function(_0x16c32f){return _0x16c32f;});}return null;};}function removeEntity(_0x510da2,_0x1b9782){return function(_0x14437e){if(_0x14437e){return _0x14437e[_0x8346('0x25')]()['then'](function(){_0x510da2[_0x8346('0x1a')](0xcc)[_0x8346('0x1b')]();});}};}function handleEntityNotFound(_0x586f11,_0x4f3eaa){return function(_0x24cfae){if(!_0x24cfae){_0x586f11[_0x8346('0x26')](0x194);}return _0x24cfae;};}function handleError(_0x140025,_0x25000b){_0x25000b=_0x25000b||0x1f4;return function(_0x37dc48){logger[_0x8346('0x27')](_0x37dc48[_0x8346('0x28')]);if(_0x37dc48[_0x8346('0x29')]){delete _0x37dc48[_0x8346('0x29')];}_0x140025[_0x8346('0x1a')](_0x25000b)['send'](_0x37dc48);};}exports[_0x8346('0x2a')]=function(_0x26b80,_0x2b9ae2){var _0x3bb0eb={},_0x4a823f={},_0x3baa35={'count':0x0,'rows':[]};var _0x432e38=_['map'](db[_0x8346('0x2b')]['rawAttributes'],function(_0xe734ec){return{'name':_0xe734ec['fieldName'],'type':_0xe734ec[_0x8346('0x2c')]['key']};});_0x4a823f[_0x8346('0x2d')]=_[_0x8346('0x2e')](_0x432e38,'name');_0x4a823f[_0x8346('0x2f')]=_['keys'](_0x26b80['query']);_0x4a823f[_0x8346('0x30')]=_['intersection'](_0x4a823f[_0x8346('0x2d')],_0x4a823f[_0x8346('0x2f')]);_0x3bb0eb['attributes']=_['intersection'](_0x4a823f[_0x8346('0x2d')],qs[_0x8346('0x31')](_0x26b80[_0x8346('0x2f')][_0x8346('0x31')]));_0x3bb0eb[_0x8346('0x32')]=_0x3bb0eb['attributes'][_0x8346('0x33')]?_0x3bb0eb[_0x8346('0x32')]:_0x4a823f[_0x8346('0x2d')];if(!_0x26b80[_0x8346('0x2f')][_0x8346('0x34')](_0x8346('0x35'))){_0x3bb0eb[_0x8346('0x1f')]=qs['limit'](_0x26b80[_0x8346('0x2f')][_0x8346('0x1f')]);_0x3bb0eb[_0x8346('0x1d')]=qs[_0x8346('0x1d')](_0x26b80['query']['offset']);}_0x3bb0eb['order']=qs[_0x8346('0x36')](_0x26b80['query'][_0x8346('0x36')]);_0x3bb0eb[_0x8346('0x37')]=qs['filters'](_['pick'](_0x26b80[_0x8346('0x2f')],_0x4a823f[_0x8346('0x30')]),_0x432e38);if(_0x26b80[_0x8346('0x2f')][_0x8346('0x38')]){_0x3bb0eb[_0x8346('0x37')]=_[_0x8346('0x39')](_0x3bb0eb[_0x8346('0x37')],{'$or':_['map'](_0x432e38,function(_0xd04927){if(_0xd04927[_0x8346('0x2c')]!==_0x8346('0x3a')){var _0x3d5d8e={};_0x3d5d8e[_0xd04927['name']]={'$like':'%'+_0x26b80[_0x8346('0x2f')][_0x8346('0x38')]+'%'};return _0x3d5d8e;}})});}_0x3bb0eb=_[_0x8346('0x39')]({},_0x3bb0eb,_0x26b80[_0x8346('0x3b')]);var _0x5aca7f={'where':_0x3bb0eb[_0x8346('0x37')]};return db[_0x8346('0x2b')][_0x8346('0x20')](_0x5aca7f)[_0x8346('0x3c')](function(_0x1d237b){_0x3baa35['count']=_0x1d237b;if(_0x26b80[_0x8346('0x2f')][_0x8346('0x3d')]){_0x3bb0eb[_0x8346('0x3e')]=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x3bb0eb);})['then'](function(_0x5da1b2){_0x3baa35[_0x8346('0x3f')]=_0x5da1b2;return _0x3baa35;})['then'](respondWithFilteredResult(_0x2b9ae2,_0x3bb0eb))[_0x8346('0x40')](handleError(_0x2b9ae2,null));};exports[_0x8346('0x41')]=function(_0x321a80,_0x3c96c0){var _0x4129d8={'raw':!![],'where':{'id':_0x321a80[_0x8346('0x42')]['id']}},_0xd01d3f={};_0xd01d3f[_0x8346('0x2d')]=_['keys'](db[_0x8346('0x2b')][_0x8346('0x43')]);_0xd01d3f[_0x8346('0x2f')]=_[_0x8346('0x44')](_0x321a80['query']);_0xd01d3f['filters']=_[_0x8346('0x45')](_0xd01d3f[_0x8346('0x2d')],_0xd01d3f[_0x8346('0x2f')]);_0x4129d8[_0x8346('0x32')]=_[_0x8346('0x45')](_0xd01d3f[_0x8346('0x2d')],qs[_0x8346('0x31')](_0x321a80[_0x8346('0x2f')][_0x8346('0x31')]));_0x4129d8[_0x8346('0x32')]=_0x4129d8[_0x8346('0x32')]['length']?_0x4129d8[_0x8346('0x32')]:_0xd01d3f[_0x8346('0x2d')];if(_0x321a80[_0x8346('0x2f')]['includeAll']){_0x4129d8[_0x8346('0x3e')]=[{'all':!![]}];}_0x4129d8=_['merge']({},_0x4129d8,_0x321a80[_0x8346('0x3b')]);return db['FaxTransferReport'][_0x8346('0x46')](_0x4129d8)[_0x8346('0x3c')](handleEntityNotFound(_0x3c96c0,null))[_0x8346('0x3c')](respondWithResult(_0x3c96c0,null))[_0x8346('0x40')](handleError(_0x3c96c0,null));};exports['create']=function(_0x282b12,_0x3fe05c){return db[_0x8346('0x2b')][_0x8346('0x47')](_0x282b12[_0x8346('0x48')],{})[_0x8346('0x3c')](respondWithResult(_0x3fe05c,0xc9))[_0x8346('0x40')](handleError(_0x3fe05c,null));};exports['update']=function(_0x4432c6,_0x1bb64f){if(_0x4432c6[_0x8346('0x48')]['id']){delete _0x4432c6[_0x8346('0x48')]['id'];}return db[_0x8346('0x2b')][_0x8346('0x46')]({'where':{'id':_0x4432c6['params']['id']}})[_0x8346('0x3c')](handleEntityNotFound(_0x1bb64f,null))[_0x8346('0x3c')](saveUpdates(_0x4432c6[_0x8346('0x48')],null))['then'](respondWithResult(_0x1bb64f,null))[_0x8346('0x40')](handleError(_0x1bb64f,null));};exports[_0x8346('0x25')]=function(_0x3bc0d8,_0x4ed5ac){return db[_0x8346('0x2b')][_0x8346('0x46')]({'where':{'id':_0x3bc0d8[_0x8346('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ed5ac,null))[_0x8346('0x3c')](removeEntity(_0x4ed5ac,null))[_0x8346('0x40')](handleError(_0x4ed5ac,null));};exports['describe']=function(_0x20f5a9,_0x2f87a6){return db[_0x8346('0x2b')][_0x8346('0x49')]()['then'](respondWithResult(_0x2f87a6,null))[_0x8346('0x40')](handleError(_0x2f87a6,null));};
\ No newline at end of file
+var _0x5302=['fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','end','status','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','FaxTransferReport','rawAttributes','type','key','query','keys','filters','intersection','model'];(function(_0x4b92a2,_0x2bfc0a){var _0x3aa78d=function(_0x6fa54f){while(--_0x6fa54f){_0x4b92a2['push'](_0x4b92a2['shift']());}};_0x3aa78d(++_0x2bfc0a);}(_0x5302,0xad));var _0x2530=function(_0x3f9f0f,_0x531b30){_0x3f9f0f=_0x3f9f0f-0x0;var _0x2eb31d=_0x5302[_0x3f9f0f];return _0x2eb31d;};'use strict';var emlformat=require(_0x2530('0x0'));var rimraf=require(_0x2530('0x1'));var zipdir=require(_0x2530('0x2'));var jsonpatch=require(_0x2530('0x3'));var rp=require(_0x2530('0x4'));var moment=require(_0x2530('0x5'));var BPromise=require(_0x2530('0x6'));var Mustache=require(_0x2530('0x7'));var util=require(_0x2530('0x8'));var path=require(_0x2530('0x9'));var sox=require(_0x2530('0xa'));var csv=require(_0x2530('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2530('0xc'));var squel=require(_0x2530('0xd'));var crypto=require(_0x2530('0xe'));var jsforce=require(_0x2530('0xf'));var deskjs=require(_0x2530('0x10'));var toCsv=require(_0x2530('0xb'));var querystring=require(_0x2530('0x11'));var Papa=require(_0x2530('0x12'));var Redis=require(_0x2530('0x13'));var authService=require(_0x2530('0x14'));var qs=require(_0x2530('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2530('0x16'));var logger=require('../../config/logger')(_0x2530('0x17'));var utils=require('../../config/utils');var config=require(_0x2530('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21cf1a,_0x31fb58){_0x31fb58=_0x31fb58||0xcc;return function(_0x2152ed){if(_0x2152ed){return _0x21cf1a['sendStatus'](_0x31fb58);}return _0x21cf1a['status'](_0x31fb58)[_0x2530('0x19')]();};}function respondWithResult(_0x4e97c6,_0x4963da){_0x4963da=_0x4963da||0xc8;return function(_0x3c4205){if(_0x3c4205){return _0x4e97c6[_0x2530('0x1a')](_0x4963da)['json'](_0x3c4205);}};}function respondWithFilteredResult(_0x4e19d6,_0x3f8acb){return function(_0x4ab168){if(_0x4ab168){var _0x211ad5=typeof _0x3f8acb[_0x2530('0x1b')]===_0x2530('0x1c')&&typeof _0x3f8acb['limit']==='undefined';var _0x5f1bd5=_0x4ab168[_0x2530('0x1d')];var _0x187bce=_0x211ad5?0x0:_0x3f8acb[_0x2530('0x1b')];var _0x1b3b98=_0x211ad5?_0x4ab168['count']:_0x3f8acb[_0x2530('0x1b')]+_0x3f8acb[_0x2530('0x1e')];var _0x4f5134;if(_0x1b3b98>=_0x5f1bd5){_0x1b3b98=_0x5f1bd5;_0x4f5134=0xc8;}else{_0x4f5134=0xce;}_0x4e19d6[_0x2530('0x1a')](_0x4f5134);return _0x4e19d6[_0x2530('0x1f')](_0x2530('0x20'),_0x187bce+'-'+_0x1b3b98+'/'+_0x5f1bd5)['json'](_0x4ab168);}return null;};}function patchUpdates(_0x4045dd){return function(_0x40aa63){try{jsonpatch[_0x2530('0x21')](_0x40aa63,_0x4045dd,!![]);}catch(_0x5d0237){return BPromise[_0x2530('0x22')](_0x5d0237);}return _0x40aa63['save']();};}function saveUpdates(_0x119db8,_0x46aaab){return function(_0x2e2ca8){if(_0x2e2ca8){return _0x2e2ca8[_0x2530('0x23')](_0x119db8)[_0x2530('0x24')](function(_0xe5607){return _0xe5607;});}return null;};}function removeEntity(_0x7ebeec,_0x2678e9){return function(_0x3f8330){if(_0x3f8330){return _0x3f8330[_0x2530('0x25')]()['then'](function(){_0x7ebeec['status'](0xcc)[_0x2530('0x19')]();});}};}function handleEntityNotFound(_0x444505,_0x4364e2){return function(_0x313e34){if(!_0x313e34){_0x444505[_0x2530('0x26')](0x194);}return _0x313e34;};}function handleError(_0x4e11ea,_0x283f5c){_0x283f5c=_0x283f5c||0x1f4;return function(_0x1c33a0){logger[_0x2530('0x27')](_0x1c33a0[_0x2530('0x28')]);if(_0x1c33a0[_0x2530('0x29')]){delete _0x1c33a0[_0x2530('0x29')];}_0x4e11ea[_0x2530('0x1a')](_0x283f5c)['send'](_0x1c33a0);};}exports['index']=function(_0x379d63,_0x18a3be){var _0x379b16={},_0x52802a={},_0xa70e65={'count':0x0,'rows':[]};var _0x4a2f84=_[_0x2530('0x2a')](db[_0x2530('0x2b')][_0x2530('0x2c')],function(_0x38d1cf){return{'name':_0x38d1cf['fieldName'],'type':_0x38d1cf[_0x2530('0x2d')][_0x2530('0x2e')]};});_0x52802a['model']=_[_0x2530('0x2a')](_0x4a2f84,'name');_0x52802a[_0x2530('0x2f')]=_[_0x2530('0x30')](_0x379d63[_0x2530('0x2f')]);_0x52802a[_0x2530('0x31')]=_['intersection'](_0x52802a['model'],_0x52802a[_0x2530('0x2f')]);_0x379b16['attributes']=_[_0x2530('0x32')](_0x52802a[_0x2530('0x33')],qs['fields'](_0x379d63[_0x2530('0x2f')][_0x2530('0x34')]));_0x379b16[_0x2530('0x35')]=_0x379b16[_0x2530('0x35')][_0x2530('0x36')]?_0x379b16[_0x2530('0x35')]:_0x52802a['model'];if(!_0x379d63[_0x2530('0x2f')]['hasOwnProperty'](_0x2530('0x37'))){_0x379b16['limit']=qs['limit'](_0x379d63['query'][_0x2530('0x1e')]);_0x379b16['offset']=qs[_0x2530('0x1b')](_0x379d63[_0x2530('0x2f')][_0x2530('0x1b')]);}_0x379b16[_0x2530('0x38')]=qs[_0x2530('0x39')](_0x379d63[_0x2530('0x2f')][_0x2530('0x39')]);_0x379b16[_0x2530('0x3a')]=qs['filters'](_[_0x2530('0x3b')](_0x379d63[_0x2530('0x2f')],_0x52802a[_0x2530('0x31')]),_0x4a2f84);if(_0x379d63[_0x2530('0x2f')][_0x2530('0x3c')]){_0x379b16['where']=_['merge'](_0x379b16[_0x2530('0x3a')],{'$or':_[_0x2530('0x2a')](_0x4a2f84,function(_0x30f2c9){if(_0x30f2c9['type']!==_0x2530('0x3d')){var _0x33ad3a={};_0x33ad3a[_0x30f2c9[_0x2530('0x29')]]={'$like':'%'+_0x379d63[_0x2530('0x2f')]['filter']+'%'};return _0x33ad3a;}})});}_0x379b16=_[_0x2530('0x3e')]({},_0x379b16,_0x379d63[_0x2530('0x3f')]);var _0xee6bc6={'where':_0x379b16[_0x2530('0x3a')]};return db[_0x2530('0x2b')][_0x2530('0x1d')](_0xee6bc6)['then'](function(_0x2fdca1){_0xa70e65[_0x2530('0x1d')]=_0x2fdca1;if(_0x379d63[_0x2530('0x2f')][_0x2530('0x40')]){_0x379b16[_0x2530('0x41')]=[{'all':!![]}];}return db[_0x2530('0x2b')][_0x2530('0x42')](_0x379b16);})[_0x2530('0x24')](function(_0x3ed6df){_0xa70e65[_0x2530('0x43')]=_0x3ed6df;return _0xa70e65;})[_0x2530('0x24')](respondWithFilteredResult(_0x18a3be,_0x379b16))[_0x2530('0x44')](handleError(_0x18a3be,null));};exports[_0x2530('0x45')]=function(_0xe5623f,_0xdc964b){var _0x166bc8={'raw':!![],'where':{'id':_0xe5623f[_0x2530('0x46')]['id']}},_0x3ce0da={};_0x3ce0da[_0x2530('0x33')]=_[_0x2530('0x30')](db[_0x2530('0x2b')][_0x2530('0x2c')]);_0x3ce0da['query']=_[_0x2530('0x30')](_0xe5623f[_0x2530('0x2f')]);_0x3ce0da[_0x2530('0x31')]=_[_0x2530('0x32')](_0x3ce0da[_0x2530('0x33')],_0x3ce0da[_0x2530('0x2f')]);_0x166bc8['attributes']=_[_0x2530('0x32')](_0x3ce0da['model'],qs['fields'](_0xe5623f[_0x2530('0x2f')][_0x2530('0x34')]));_0x166bc8['attributes']=_0x166bc8['attributes']['length']?_0x166bc8[_0x2530('0x35')]:_0x3ce0da['model'];if(_0xe5623f[_0x2530('0x2f')][_0x2530('0x40')]){_0x166bc8['include']=[{'all':!![]}];}_0x166bc8=_[_0x2530('0x3e')]({},_0x166bc8,_0xe5623f[_0x2530('0x3f')]);return db[_0x2530('0x2b')][_0x2530('0x47')](_0x166bc8)[_0x2530('0x24')](handleEntityNotFound(_0xdc964b,null))[_0x2530('0x24')](respondWithResult(_0xdc964b,null))[_0x2530('0x44')](handleError(_0xdc964b,null));};exports[_0x2530('0x48')]=function(_0x5e15d1,_0x3d8e0e){return db[_0x2530('0x2b')][_0x2530('0x48')](_0x5e15d1[_0x2530('0x49')],{})[_0x2530('0x24')](respondWithResult(_0x3d8e0e,0xc9))[_0x2530('0x44')](handleError(_0x3d8e0e,null));};exports[_0x2530('0x23')]=function(_0x42c210,_0x302e61){if(_0x42c210[_0x2530('0x49')]['id']){delete _0x42c210['body']['id'];}return db['FaxTransferReport'][_0x2530('0x47')]({'where':{'id':_0x42c210['params']['id']}})['then'](handleEntityNotFound(_0x302e61,null))[_0x2530('0x24')](saveUpdates(_0x42c210['body'],null))[_0x2530('0x24')](respondWithResult(_0x302e61,null))[_0x2530('0x44')](handleError(_0x302e61,null));};exports[_0x2530('0x25')]=function(_0x3f1844,_0x473299){return db[_0x2530('0x2b')][_0x2530('0x47')]({'where':{'id':_0x3f1844[_0x2530('0x46')]['id']}})[_0x2530('0x24')](handleEntityNotFound(_0x473299,null))[_0x2530('0x24')](removeEntity(_0x473299,null))[_0x2530('0x44')](handleError(_0x473299,null));};exports['describe']=function(_0xf8efe7,_0x54bbf5){return db[_0x2530('0x2b')][_0x2530('0x4a')]()[_0x2530('0x24')](respondWithResult(_0x54bbf5,null))['catch'](handleError(_0x54bbf5,null));};
\ No newline at end of file
index 21aec57..0251bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe073=['request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','api','moment','bluebird'];(function(_0x6f6482,_0x2a097a){var _0x21d841=function(_0x41c60f){while(--_0x41c60f){_0x6f6482['push'](_0x6f6482['shift']());}};_0x21d841(++_0x2a097a);}(_0xe073,0x1b6));var _0x3e07=function(_0x231f27,_0x399a68){_0x231f27=_0x231f27-0x0;var _0x528900=_0xe073[_0x231f27];return _0x528900;};'use strict';var _=require(_0x3e07('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3e07('0x1'));var moment=require(_0x3e07('0x2'));var BPromise=require(_0x3e07('0x3'));var rp=require(_0x3e07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e07('0x5'));var config=require(_0x3e07('0x6'));var attributes=require(_0x3e07('0x7'));module[_0x3e07('0x8')]=function(_0x3f8cfa,_0x35bc94){return _0x3f8cfa[_0x3e07('0x9')](_0x3e07('0xa'),attributes,{'tableName':_0x3e07('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3e07('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f6c=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','report_fax_transfer'];(function(_0x14a378,_0x26c4a9){var _0x2df55a=function(_0x558841){while(--_0x558841){_0x14a378['push'](_0x14a378['shift']());}};_0x2df55a(++_0x26c4a9);}(_0x0f6c,0xe1));var _0xc0f6=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0f6c[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xc0f6('0x0'));var util=require('util');var logger=require(_0xc0f6('0x1'))(_0xc0f6('0x2'));var moment=require(_0xc0f6('0x3'));var BPromise=require(_0xc0f6('0x4'));var rp=require(_0xc0f6('0x5'));var fs=require('fs');var path=require(_0xc0f6('0x6'));var rimraf=require(_0xc0f6('0x7'));var config=require(_0xc0f6('0x8'));var attributes=require(_0xc0f6('0x9'));module[_0xc0f6('0xa')]=function(_0x4b886a,_0xb2c122){return _0x4b886a[_0xc0f6('0xb')]('FaxTransferReport',attributes,{'tableName':_0xc0f6('0xc'),'paranoid':![],'indexes':[{'name':_0xc0f6('0xd'),'fields':[_0xc0f6('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 0f030ab..c33327f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff9d=['jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8972d6,_0x1e00b1){var _0x5b2c4b=function(_0x17a062){while(--_0x17a062){_0x8972d6['push'](_0x8972d6['shift']());}};_0x5b2c4b(++_0x1e00b1);}(_0xff9d,0x1a6));var _0xdff9=function(_0x16c6da,_0x3de885){_0x16c6da=_0x16c6da-0x0;var _0x2c1847=_0xff9d[_0x16c6da];return _0x2c1847;};'use strict';var _=require(_0xdff9('0x0'));var util=require(_0xdff9('0x1'));var moment=require(_0xdff9('0x2'));var BPromise=require('bluebird');var rs=require(_0xdff9('0x3'));var fs=require('fs');var Redis=require(_0xdff9('0x4'));var db=require(_0xdff9('0x5'))['db'];var utils=require(_0xdff9('0x6'));var logger=require(_0xdff9('0x7'))(_0xdff9('0x8'));var config=require(_0xdff9('0x9'));var jayson=require(_0xdff9('0xa'));var client=jayson['client'][_0xdff9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57c161,_0x1adabf,_0x4ad6c6){return new BPromise(function(_0x5de7db,_0x44b08c){return client[_0xdff9('0xc')](_0x57c161,_0x4ad6c6)[_0xdff9('0xd')](function(_0x1bddd0){logger['info'](_0xdff9('0xe'),_0x1adabf,_0xdff9('0xf'));logger[_0xdff9('0x10')](_0xdff9('0x11'),_0x1adabf,_0xdff9('0xf'),JSON[_0xdff9('0x12')](_0x1bddd0));if(_0x1bddd0[_0xdff9('0x13')]){if(_0x1bddd0[_0xdff9('0x13')]['code']===0x1f4){logger[_0xdff9('0x13')](_0xdff9('0xe'),_0x1adabf,_0x1bddd0[_0xdff9('0x13')][_0xdff9('0x14')]);return _0x44b08c(_0x1bddd0[_0xdff9('0x13')]['message']);}logger[_0xdff9('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x1adabf,_0x1bddd0[_0xdff9('0x13')][_0xdff9('0x14')]);return _0x5de7db(_0x1bddd0[_0xdff9('0x13')][_0xdff9('0x14')]);}else{logger[_0xdff9('0x15')](_0xdff9('0xe'),_0x1adabf,_0xdff9('0xf'));_0x5de7db(_0x1bddd0[_0xdff9('0x16')][_0xdff9('0x14')]);}})[_0xdff9('0x17')](function(_0x2d9a35){logger[_0xdff9('0x13')](_0xdff9('0xe'),_0x1adabf,_0x2d9a35);_0x44b08c(_0x2d9a35);});});}
\ No newline at end of file
+var _0x2e54=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0xc5544f,_0x183e91){var _0x1bd946=function(_0x45be25){while(--_0x45be25){_0xc5544f['push'](_0xc5544f['shift']());}};_0x1bd946(++_0x183e91);}(_0x2e54,0x8a));var _0x42e5=function(_0xed1edb,_0x43d886){_0xed1edb=_0xed1edb-0x0;var _0x463745=_0x2e54[_0xed1edb];return _0x463745;};'use strict';var _=require(_0x42e5('0x0'));var util=require(_0x42e5('0x1'));var moment=require(_0x42e5('0x2'));var BPromise=require(_0x42e5('0x3'));var rs=require(_0x42e5('0x4'));var fs=require('fs');var Redis=require(_0x42e5('0x5'));var db=require(_0x42e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x42e5('0x7'));var config=require(_0x42e5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a4110,_0x4ec89c,_0x321da1){return new BPromise(function(_0x201725,_0x5e2259){return client[_0x42e5('0xb')](_0x3a4110,_0x321da1)[_0x42e5('0xc')](function(_0x22dc22){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x4ec89c,_0x42e5('0xf'));logger[_0x42e5('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4ec89c,_0x42e5('0xf'),JSON[_0x42e5('0x11')](_0x22dc22));if(_0x22dc22[_0x42e5('0x12')]){if(_0x22dc22['error'][_0x42e5('0x13')]===0x1f4){logger['error'](_0x42e5('0xe'),_0x4ec89c,_0x22dc22['error'][_0x42e5('0x14')]);return _0x5e2259(_0x22dc22[_0x42e5('0x12')][_0x42e5('0x14')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x4ec89c,_0x22dc22[_0x42e5('0x12')][_0x42e5('0x14')]);return _0x201725(_0x22dc22[_0x42e5('0x12')][_0x42e5('0x14')]);}else{logger[_0x42e5('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x4ec89c,'request\x20sent');_0x201725(_0x22dc22[_0x42e5('0x15')]['message']);}})[_0x42e5('0x16')](function(_0x2fa13a){logger[_0x42e5('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x4ec89c,_0x2fa13a);_0x5e2259(_0x2fa13a);});});}
\ No newline at end of file
index b7c05a7..736c419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd9=['multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','/describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xbdd9,0x8c));var _0x9bdd=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0xbdd9[_0x8cb2f9];return _0x164887;};'use strict';var multer=require(_0x9bdd('0x0'));var util=require(_0x9bdd('0x1'));var path=require(_0x9bdd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9bdd('0x3')]();var fs_extra=require(_0x9bdd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9bdd('0x5'));var config=require(_0x9bdd('0x6'));var controller=require(_0x9bdd('0x7'));router[_0x9bdd('0x8')]('/',auth[_0x9bdd('0x9')](),controller['index']);router['get'](_0x9bdd('0xa'),auth[_0x9bdd('0x9')](),controller['describe']);router['get']('/:id',auth[_0x9bdd('0x9')](),controller[_0x9bdd('0xb')]);router[_0x9bdd('0xc')]('/',auth[_0x9bdd('0x9')](),controller[_0x9bdd('0xd')]);router[_0x9bdd('0xe')](_0x9bdd('0xf'),auth[_0x9bdd('0x9')](),controller[_0x9bdd('0x10')]);router[_0x9bdd('0x11')]('/:id',auth[_0x9bdd('0x9')](),controller[_0x9bdd('0x12')]);module[_0x9bdd('0x13')]=router;
\ No newline at end of file
+var _0x3db8=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','util'];(function(_0x2ecc4a,_0x4d6d4f){var _0x28e06a=function(_0x1f8e1c){while(--_0x1f8e1c){_0x2ecc4a['push'](_0x2ecc4a['shift']());}};_0x28e06a(++_0x4d6d4f);}(_0x3db8,0x18f));var _0x83db=function(_0xfd7cb3,_0x7f7744){_0xfd7cb3=_0xfd7cb3-0x0;var _0x4a7f70=_0x3db8[_0xfd7cb3];return _0x4a7f70;};'use strict';var multer=require('multer');var util=require(_0x83db('0x0'));var path=require(_0x83db('0x1'));var timeout=require(_0x83db('0x2'));var express=require(_0x83db('0x3'));var router=express[_0x83db('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x83db('0x5'));var config=require(_0x83db('0x6'));var controller=require(_0x83db('0x7'));router[_0x83db('0x8')]('/',auth[_0x83db('0x9')](),controller[_0x83db('0xa')]);router[_0x83db('0x8')](_0x83db('0xb'),auth[_0x83db('0x9')](),controller[_0x83db('0xc')]);router[_0x83db('0x8')](_0x83db('0xd'),auth['isAuthenticated'](),controller[_0x83db('0xe')]);router['post']('/',auth[_0x83db('0x9')](),controller[_0x83db('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x83db('0x10')]);router[_0x83db('0x11')](_0x83db('0xd'),auth['isAuthenticated'](),controller[_0x83db('0x12')]);module[_0x83db('0x13')]=router;
\ No newline at end of file
index 73843ef..76dfb88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6fa=['/:id','/:id/configurations','getFields','post','create','addConfiguration','put','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0xc569f3,_0x485552){var _0x152849=function(_0x4f619f){while(--_0x4f619f){_0xc569f3['push'](_0xc569f3['shift']());}};_0x152849(++_0x485552);}(_0xb6fa,0x185));var _0xab6f=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0xb6fa[_0x35f7f5];return _0x5567a4;};'use strict';var multer=require(_0xab6f('0x0'));var util=require(_0xab6f('0x1'));var path=require('path');var timeout=require(_0xab6f('0x2'));var express=require('express');var router=express[_0xab6f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xab6f('0x4'));var interaction=require(_0xab6f('0x5'));var config=require('../../config/environment');var controller=require(_0xab6f('0x6'));router[_0xab6f('0x7')]('/',auth[_0xab6f('0x8')](),controller[_0xab6f('0x9')]);router['get'](_0xab6f('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xab6f('0xb'),auth[_0xab6f('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xab6f('0x8')](),controller[_0xab6f('0xc')]);router[_0xab6f('0xd')]('/',auth[_0xab6f('0x8')](),controller[_0xab6f('0xe')]);router[_0xab6f('0xd')](_0xab6f('0xb'),auth[_0xab6f('0x8')](),controller[_0xab6f('0xf')]);router[_0xab6f('0x10')](_0xab6f('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xab6f('0x11')](_0xab6f('0xa'),auth[_0xab6f('0x8')](),controller[_0xab6f('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x950c=['create','/:id/configurations','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950c,0x1c0));var _0xc950=function(_0x4160be,_0x46c122){_0x4160be=_0x4160be-0x0;var _0x33dee0=_0x950c[_0x4160be];return _0x33dee0;};'use strict';var multer=require('multer');var util=require(_0xc950('0x0'));var path=require(_0xc950('0x1'));var timeout=require(_0xc950('0x2'));var express=require('express');var router=express[_0xc950('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc950('0x4'));var interaction=require(_0xc950('0x5'));var config=require(_0xc950('0x6'));var controller=require('./intDeskAccount.controller');router[_0xc950('0x7')]('/',auth[_0xc950('0x8')](),controller[_0xc950('0x9')]);router['get']('/:id',auth[_0xc950('0x8')](),controller['show']);router[_0xc950('0x7')]('/:id/configurations',auth[_0xc950('0x8')](),controller[_0xc950('0xa')]);router[_0xc950('0x7')](_0xc950('0xb'),auth[_0xc950('0x8')](),controller[_0xc950('0xc')]);router[_0xc950('0xd')]('/',auth[_0xc950('0x8')](),controller[_0xc950('0xe')]);router[_0xc950('0xd')](_0xc950('0xf'),auth[_0xc950('0x8')](),controller['addConfiguration']);router[_0xc950('0x10')](_0xc950('0x11'),auth['isAuthenticated'](),controller[_0xc950('0x12')]);router[_0xc950('0x13')](_0xc950('0x11'),auth[_0xc950('0x8')](),controller[_0xc950('0x14')]);module[_0xc950('0x15')]=router;
\ No newline at end of file
index df66a38..88b5246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf90e=['integrationTab','sequelize','exports','STRING','ENUM','basic'];(function(_0x2284d6,_0x45a113){var _0x445d58=function(_0x201771){while(--_0x201771){_0x2284d6['push'](_0x2284d6['shift']());}};_0x445d58(++_0x45a113);}(_0xf90e,0xe5));var _0xef90=function(_0x29d225,_0x150b59){_0x29d225=_0x29d225-0x0;var _0x247d91=_0xf90e[_0x29d225];return _0x247d91;};'use strict';var Sequelize=require(_0xef90('0x0'));module[_0xef90('0x1')]={'name':{'type':Sequelize[_0xef90('0x2')]},'description':{'type':Sequelize[_0xef90('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xef90('0x2')]},'authType':{'type':Sequelize[_0xef90('0x3')](_0xef90('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xef90('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0xef90('0x2')]},'serverUrl':{'type':Sequelize[_0xef90('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xef90('0x3')](_0xef90('0x5'),'newTab'),'defaultValue':_0xef90('0x5')}};
\ No newline at end of file
+var _0xafcd=['newTab','integrationTab','exports','STRING','ENUM','basic'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xafcd,0x1ee));var _0xdafc=function(_0x5bc69d,_0x25137d){_0x5bc69d=_0x5bc69d-0x0;var _0x154d9c=_0xafcd[_0x5bc69d];return _0x154d9c;};'use strict';var Sequelize=require('sequelize');module[_0xdafc('0x0')]={'name':{'type':Sequelize[_0xdafc('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xdafc('0x1')]},'remoteUri':{'type':Sequelize[_0xdafc('0x1')]},'authType':{'type':Sequelize[_0xdafc('0x2')](_0xdafc('0x3')),'defaultValue':_0xdafc('0x3')},'password':{'type':Sequelize[_0xdafc('0x1')]},'consumerKey':{'type':Sequelize[_0xdafc('0x1')]},'consumerSecret':{'type':Sequelize[_0xdafc('0x1')]},'token':{'type':Sequelize[_0xdafc('0x1')]},'tokenSecret':{'type':Sequelize[_0xdafc('0x1')]},'serverUrl':{'type':Sequelize[_0xdafc('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xdafc('0x2')]('integrationTab',_0xdafc('0x4')),'defaultValue':_0xdafc('0x5')}};
\ No newline at end of file
index f8b49ca..fecb905 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5033=['filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','getConfigurations','DeskConfiguration','order','pick','where','addConfiguration','findOne','AccountId','Subjects','channel','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','map','DeskAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x4a82ac,_0x1fb931){var _0x58ee97=function(_0xc7050a){while(--_0xc7050a){_0x4a82ac['push'](_0x4a82ac['shift']());}};_0x58ee97(++_0x1fb931);}(_0x5033,0x191));var _0x3503=function(_0x1fa52a,_0x5ccd34){_0x1fa52a=_0x1fa52a-0x0;var _0x7af339=_0x5033[_0x1fa52a];return _0x7af339;};'use strict';var emlformat=require(_0x3503('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3503('0x1'));var jsonpatch=require(_0x3503('0x2'));var rp=require(_0x3503('0x3'));var moment=require(_0x3503('0x4'));var BPromise=require(_0x3503('0x5'));var Mustache=require('mustache');var util=require(_0x3503('0x6'));var path=require(_0x3503('0x7'));var sox=require('sox');var csv=require(_0x3503('0x8'));var ejs=require(_0x3503('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3503('0xa'));var squel=require(_0x3503('0xb'));var crypto=require(_0x3503('0xc'));var jsforce=require(_0x3503('0xd'));var deskjs=require(_0x3503('0xe'));var toCsv=require(_0x3503('0x8'));var querystring=require('querystring');var Papa=require(_0x3503('0xf'));var Redis=require('ioredis');var authService=require(_0x3503('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3503('0x11'));var logger=require(_0x3503('0x12'))('api');var utils=require(_0x3503('0x13'));var config=require(_0x3503('0x14'));var licenseUtil=require(_0x3503('0x15'));var db=require(_0x3503('0x16'))['db'];var integrations=require(_0x3503('0x17'));function respondWithStatusCode(_0x1f0193,_0x2a81b4){_0x2a81b4=_0x2a81b4||0xcc;return function(_0x3cb333){if(_0x3cb333){return _0x1f0193[_0x3503('0x18')](_0x2a81b4);}return _0x1f0193[_0x3503('0x19')](_0x2a81b4)['end']();};}function respondWithResult(_0x160990,_0x48abc3){_0x48abc3=_0x48abc3||0xc8;return function(_0x4f2a89){if(_0x4f2a89){return _0x160990[_0x3503('0x19')](_0x48abc3)[_0x3503('0x1a')](_0x4f2a89);}};}function respondWithFilteredResult(_0x4e5371,_0x472ded){return function(_0x4370dd){if(_0x4370dd){var _0x407b1a=typeof _0x472ded['offset']===_0x3503('0x1b')&&typeof _0x472ded[_0x3503('0x1c')]==='undefined';var _0x1601c1=_0x4370dd[_0x3503('0x1d')];var _0x5096ca=_0x407b1a?0x0:_0x472ded[_0x3503('0x1e')];var _0x337546=_0x407b1a?_0x4370dd['count']:_0x472ded[_0x3503('0x1e')]+_0x472ded['limit'];var _0x488122;if(_0x337546>=_0x1601c1){_0x337546=_0x1601c1;_0x488122=0xc8;}else{_0x488122=0xce;}_0x4e5371[_0x3503('0x19')](_0x488122);return _0x4e5371[_0x3503('0x1f')](_0x3503('0x20'),_0x5096ca+'-'+_0x337546+'/'+_0x1601c1)[_0x3503('0x1a')](_0x4370dd);}return null;};}function patchUpdates(_0x1575f2){return function(_0x5d7496){try{jsonpatch[_0x3503('0x21')](_0x5d7496,_0x1575f2,!![]);}catch(_0x24b643){return BPromise[_0x3503('0x22')](_0x24b643);}return _0x5d7496[_0x3503('0x23')]();};}function saveUpdates(_0x23934e,_0x5e3ad3){return function(_0x336c0a){if(_0x336c0a){return _0x336c0a[_0x3503('0x24')](_0x23934e)['then'](function(_0x55d26e){return _0x55d26e;});}return null;};}function removeEntity(_0x14f626,_0x2d6c81){return function(_0x4a8ab4){if(_0x4a8ab4){return _0x4a8ab4[_0x3503('0x25')]()[_0x3503('0x26')](function(){_0x14f626[_0x3503('0x19')](0xcc)[_0x3503('0x27')]();});}};}function handleEntityNotFound(_0x1afaaa,_0x19898d){return function(_0x5145b7){if(!_0x5145b7){_0x1afaaa[_0x3503('0x18')](0x194);}return _0x5145b7;};}function handleError(_0x2f1252,_0x2e472a){_0x2e472a=_0x2e472a||0x1f4;return function(_0x47db1b){logger[_0x3503('0x28')](_0x47db1b[_0x3503('0x29')]);if(_0x47db1b['name']){delete _0x47db1b[_0x3503('0x2a')];}_0x2f1252[_0x3503('0x19')](_0x2e472a)['send'](_0x47db1b);};}exports['index']=function(_0x14d470,_0x59abaf){var _0x557c60={},_0x3d741a={},_0x2d89bc={'count':0x0,'rows':[]};var _0x5c54d2=_[_0x3503('0x2b')](db[_0x3503('0x2c')][_0x3503('0x2d')],function(_0x13df9f){return{'name':_0x13df9f[_0x3503('0x2e')],'type':_0x13df9f['type'][_0x3503('0x2f')]};});_0x3d741a[_0x3503('0x30')]=_[_0x3503('0x2b')](_0x5c54d2,_0x3503('0x2a'));_0x3d741a[_0x3503('0x31')]=_[_0x3503('0x32')](_0x14d470[_0x3503('0x31')]);_0x3d741a[_0x3503('0x33')]=_[_0x3503('0x34')](_0x3d741a[_0x3503('0x30')],_0x3d741a[_0x3503('0x31')]);_0x557c60[_0x3503('0x35')]=_['intersection'](_0x3d741a[_0x3503('0x30')],qs[_0x3503('0x36')](_0x14d470[_0x3503('0x31')][_0x3503('0x36')]));_0x557c60[_0x3503('0x35')]=_0x557c60[_0x3503('0x35')][_0x3503('0x37')]?_0x557c60['attributes']:_0x3d741a[_0x3503('0x30')];if(!_0x14d470[_0x3503('0x31')][_0x3503('0x38')](_0x3503('0x39'))){_0x557c60[_0x3503('0x1c')]=qs[_0x3503('0x1c')](_0x14d470[_0x3503('0x31')][_0x3503('0x1c')]);_0x557c60[_0x3503('0x1e')]=qs[_0x3503('0x1e')](_0x14d470[_0x3503('0x31')][_0x3503('0x1e')]);}_0x557c60['order']=qs['sort'](_0x14d470[_0x3503('0x31')][_0x3503('0x3a')]);_0x557c60['where']=qs['filters'](_['pick'](_0x14d470[_0x3503('0x31')],_0x3d741a[_0x3503('0x33')]),_0x5c54d2);if(_0x14d470[_0x3503('0x31')][_0x3503('0x3b')]){_0x557c60['where']=_[_0x3503('0x3c')](_0x557c60['where'],{'$or':_[_0x3503('0x2b')](_0x5c54d2,function(_0x4f3c09){if(_0x4f3c09[_0x3503('0x3d')]!==_0x3503('0x3e')){var _0x4f04dd={};_0x4f04dd[_0x4f3c09[_0x3503('0x2a')]]={'$like':'%'+_0x14d470[_0x3503('0x31')][_0x3503('0x3b')]+'%'};return _0x4f04dd;}})});}_0x557c60=_[_0x3503('0x3c')]({},_0x557c60,_0x14d470[_0x3503('0x3f')]);var _0x4a79b0={'where':_0x557c60['where']};return db['DeskAccount'][_0x3503('0x1d')](_0x4a79b0)[_0x3503('0x26')](function(_0x40c2bc){_0x2d89bc[_0x3503('0x1d')]=_0x40c2bc;if(_0x14d470['query'][_0x3503('0x40')]){_0x557c60[_0x3503('0x41')]=[{'all':!![]}];}return db[_0x3503('0x2c')][_0x3503('0x42')](_0x557c60);})[_0x3503('0x26')](function(_0x5e6d08){_0x2d89bc[_0x3503('0x43')]=_0x5e6d08;return _0x2d89bc;})[_0x3503('0x26')](respondWithFilteredResult(_0x59abaf,_0x557c60))['catch'](handleError(_0x59abaf,null));};exports[_0x3503('0x44')]=function(_0x30e7a7,_0x5b6a0d){var _0x3e681f={'raw':![],'where':{'id':_0x30e7a7[_0x3503('0x45')]['id']}},_0xfbff4c={};_0xfbff4c[_0x3503('0x30')]=_[_0x3503('0x32')](db[_0x3503('0x2c')][_0x3503('0x2d')]);_0xfbff4c[_0x3503('0x31')]=_[_0x3503('0x32')](_0x30e7a7[_0x3503('0x31')]);_0xfbff4c[_0x3503('0x33')]=_[_0x3503('0x34')](_0xfbff4c['model'],_0xfbff4c[_0x3503('0x31')]);_0x3e681f[_0x3503('0x35')]=_['intersection'](_0xfbff4c[_0x3503('0x30')],qs[_0x3503('0x36')](_0x30e7a7['query'][_0x3503('0x36')]));_0x3e681f[_0x3503('0x35')]=_0x3e681f['attributes'][_0x3503('0x37')]?_0x3e681f[_0x3503('0x35')]:_0xfbff4c['model'];if(_0x30e7a7[_0x3503('0x31')][_0x3503('0x40')]){_0x3e681f[_0x3503('0x41')]=[{'all':!![]}];}_0x3e681f=_[_0x3503('0x3c')]({},_0x3e681f,_0x30e7a7[_0x3503('0x3f')]);return db[_0x3503('0x2c')][_0x3503('0x46')](_0x3e681f)[_0x3503('0x26')](handleEntityNotFound(_0x5b6a0d,null))[_0x3503('0x26')](respondWithResult(_0x5b6a0d,null))[_0x3503('0x47')](handleError(_0x5b6a0d,null));};exports[_0x3503('0x48')]=function(_0x3745ad,_0x29a834){return db[_0x3503('0x2c')][_0x3503('0x48')](_0x3745ad[_0x3503('0x49')],{})[_0x3503('0x26')](respondWithResult(_0x29a834,0xc9))[_0x3503('0x47')](handleError(_0x29a834,null));};exports[_0x3503('0x24')]=function(_0x2b410e,_0x6bcffe){if(_0x2b410e[_0x3503('0x49')]['id']){delete _0x2b410e[_0x3503('0x49')]['id'];}return db[_0x3503('0x2c')]['find']({'where':{'id':_0x2b410e['params']['id']}})[_0x3503('0x26')](handleEntityNotFound(_0x6bcffe,null))[_0x3503('0x26')](saveUpdates(_0x2b410e[_0x3503('0x49')],null))[_0x3503('0x26')](respondWithResult(_0x6bcffe,null))[_0x3503('0x47')](handleError(_0x6bcffe,null));};exports['destroy']=function(_0x101168,_0x3427d0){return db[_0x3503('0x2c')][_0x3503('0x46')]({'where':{'id':_0x101168[_0x3503('0x45')]['id']}})[_0x3503('0x26')](handleEntityNotFound(_0x3427d0,null))[_0x3503('0x26')](removeEntity(_0x3427d0,null))['catch'](handleError(_0x3427d0,null));};exports[_0x3503('0x4a')]=function(_0x4c8993,_0x480af4,_0x24686f){var _0x4618ff={};var _0x485845={};var _0x41a65d;var _0x26b409;return db[_0x3503('0x2c')]['findOne']({'where':{'id':_0x4c8993[_0x3503('0x45')]['id']}})[_0x3503('0x26')](handleEntityNotFound(_0x480af4,null))[_0x3503('0x26')](function(_0x1b0cbc){if(_0x1b0cbc){_0x41a65d=_0x1b0cbc;_0x485845[_0x3503('0x30')]=_['keys'](db[_0x3503('0x4b')][_0x3503('0x2d')]);_0x485845[_0x3503('0x31')]=_[_0x3503('0x32')](_0x4c8993[_0x3503('0x31')]);_0x485845[_0x3503('0x33')]=_[_0x3503('0x34')](_0x485845[_0x3503('0x30')],_0x485845[_0x3503('0x31')]);_0x4618ff[_0x3503('0x35')]=_[_0x3503('0x34')](_0x485845[_0x3503('0x30')],qs[_0x3503('0x36')](_0x4c8993[_0x3503('0x31')]['fields']));_0x4618ff[_0x3503('0x35')]=_0x4618ff[_0x3503('0x35')]['length']?_0x4618ff[_0x3503('0x35')]:_0x485845[_0x3503('0x30')];_0x4618ff[_0x3503('0x4c')]=qs[_0x3503('0x3a')](_0x4c8993['query']['sort']);_0x4618ff['where']=qs[_0x3503('0x33')](_[_0x3503('0x4d')](_0x4c8993[_0x3503('0x31')],_0x485845[_0x3503('0x33')]));if(_0x4c8993[_0x3503('0x31')][_0x3503('0x3b')]){_0x4618ff['where']=_['merge'](_0x4618ff[_0x3503('0x4e')],{'$or':_['map'](_0x4618ff[_0x3503('0x35')],function(_0x9b2384){var _0x35218d={};_0x35218d[_0x9b2384]={'$like':'%'+_0x4c8993['query']['filter']+'%'};return _0x35218d;})});}_0x4618ff=_[_0x3503('0x3c')]({},_0x4618ff,_0x4c8993[_0x3503('0x3f')]);return _0x41a65d[_0x3503('0x4a')](_0x4618ff);}})['then'](function(_0x2d5b4b){if(_0x2d5b4b){_0x26b409=_0x2d5b4b[_0x3503('0x37')];if(!_0x4c8993['query'][_0x3503('0x38')](_0x3503('0x39'))){_0x4618ff[_0x3503('0x1c')]=qs[_0x3503('0x1c')](_0x4c8993[_0x3503('0x31')][_0x3503('0x1c')]);_0x4618ff[_0x3503('0x1e')]=qs['offset'](_0x4c8993[_0x3503('0x31')][_0x3503('0x1e')]);}return _0x41a65d['getConfigurations'](_0x4618ff);}})[_0x3503('0x26')](function(_0x158413){if(_0x158413){return _0x158413?{'count':_0x26b409,'rows':_0x158413}:null;}})[_0x3503('0x26')](respondWithResult(_0x480af4,null))[_0x3503('0x47')](handleError(_0x480af4,null));};exports[_0x3503('0x4f')]=function(_0x1c6a30,_0x6d887f,_0x5dc473){if(_0x1c6a30['body']['id']){delete _0x1c6a30['body']['id'];}return db[_0x3503('0x2c')][_0x3503('0x50')]({'where':{'id':_0x1c6a30[_0x3503('0x45')]['id']}})[_0x3503('0x26')](handleEntityNotFound(_0x6d887f,null))[_0x3503('0x26')](function(_0x21ddff){if(_0x21ddff){_0x1c6a30[_0x3503('0x49')][_0x3503('0x51')]=_0x21ddff['id'];_0x1c6a30['body'][_0x3503('0x52')]=integrations['getSubjects'](_0x1c6a30[_0x3503('0x49')][_0x3503('0x53')],_0x1c6a30[_0x3503('0x49')][_0x3503('0x3d')]);_0x1c6a30[_0x3503('0x49')]['Descriptions']=integrations['getDescriptions'](_0x1c6a30[_0x3503('0x49')][_0x3503('0x53')],_0x1c6a30[_0x3503('0x49')][_0x3503('0x3d')]);return db[_0x3503('0x4b')][_0x3503('0x48')](_0x1c6a30[_0x3503('0x49')],{'include':[{'model':db[_0x3503('0x54')],'as':_0x3503('0x52')},{'model':db[_0x3503('0x54')],'as':'Descriptions'}]});}return null;})[_0x3503('0x26')](respondWithResult(_0x6d887f,null))['catch'](handleError(_0x6d887f,null));};exports[_0x3503('0x55')]=function(_0x50ea12,_0x3113bc,_0x210d1d){var _0x61a982=[{'name':'priority','label':_0x3503('0x56'),'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 _0x3f7085='';return db['DeskAccount']['findOne']({'where':{'id':_0x50ea12['params']['id']},'attributes':['id',_0x3503('0x57'),_0x3503('0x58'),_0x3503('0x59'),_0x3503('0x5a'),_0x3503('0x5b'),_0x3503('0x5c'),_0x3503('0x5d'),_0x3503('0x5e')]})['then'](handleEntityNotFound(_0x3113bc,null))['then'](function(_0x496ee5){if(_0x496ee5){_0x3f7085=_0x496ee5[_0x3503('0x57')];var _0x4de196=_0x3f7085[_0x3503('0x5f')](-0x1);if(_0x4de196==='/'){_0x3f7085=_0x3f7085[_0x3503('0x60')](0x0,_0x3f7085['lastIndexOf'](_0x4de196));}var _0x1e8062={'method':_0x3503('0x61'),'uri':util[_0x3503('0x62')](_0x3503('0x63'),_0x3f7085),'headers':{'Content-Type':'application/json','Accept':_0x3503('0x64')},'json':!![]};if(_0x496ee5[_0x3503('0x58')]===_0x3503('0x65')){_0x1e8062['headers'][_0x3503('0x66')]=util['format'](_0x3503('0x67'),new Buffer(util[_0x3503('0x62')](_0x3503('0x68'),_0x496ee5['username'],_0x496ee5[_0x3503('0x5a')]))[_0x3503('0x69')]('base64'));}return rp(_0x1e8062)[_0x3503('0x26')](function(_0x403e65){return _0x61a982['concat'](_[_0x3503('0x2b')](_0x403e65['_embedded'][_0x3503('0x6a')],function(_0x336370){return{'id':_0x336370['name'],'name':_0x336370[_0x3503('0x2a')],'type':_0x336370[_0x3503('0x3d')],'active':_0x336370[_0x3503('0x6b')],'label':_0x336370[_0x3503('0x6c')],'custom':!![]};}));});}})['then'](function(_0x52352a){return{'count':_0x52352a[_0x3503('0x37')],'rows':_0x52352a};})['then'](respondWithResult(_0x3113bc,null))[_0x3503('0x47')](function(_0x2d4be7){var _0x3a3369=_0x50ea12[_0x3503('0x31')][_0x3503('0x6d')]?0x1f4:_0x2d4be7[_0x3503('0x6e')]||0x1f4;logger[_0x3503('0x28')](_0x3503('0x6f'),'getFields',_0x3a3369,JSON[_0x3503('0x70')](_0x2d4be7));delete _0x2d4be7[_0x3503('0x2a')];if(_0x3a3369===0x191){_0x3a3369=0x190;}_0x3113bc['status'](_0x3a3369)[_0x3503('0x71')](_0x50ea12['query'][_0x3503('0x6d')]?{'message':_0x3503('0x72'),'statusCode':_0x2d4be7[_0x3503('0x6e')]}:_0x2d4be7);});};
\ No newline at end of file
+var _0x6ae8=['stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getConfigurations','findOne','nolimit','addConfiguration','channel','Descriptions','getDescriptions','DeskField','Subjects','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','toString','base64','concat','_embedded','entries','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy'];(function(_0x19f5fc,_0x4c658a){var _0x315fa3=function(_0x2198b5){while(--_0x2198b5){_0x19f5fc['push'](_0x19f5fc['shift']());}};_0x315fa3(++_0x4c658a);}(_0x6ae8,0xbf));var _0x86ae=function(_0x53bcfa,_0x20eb6e){_0x53bcfa=_0x53bcfa-0x0;var _0x25e64e=_0x6ae8[_0x53bcfa];return _0x25e64e;};'use strict';var emlformat=require(_0x86ae('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x86ae('0x1'));var jsonpatch=require(_0x86ae('0x2'));var rp=require(_0x86ae('0x3'));var moment=require(_0x86ae('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x86ae('0x5'));var sox=require('sox');var csv=require(_0x86ae('0x6'));var ejs=require(_0x86ae('0x7'));var fs=require('fs');var fs_extra=require(_0x86ae('0x8'));var _=require(_0x86ae('0x9'));var squel=require(_0x86ae('0xa'));var crypto=require(_0x86ae('0xb'));var jsforce=require(_0x86ae('0xc'));var deskjs=require(_0x86ae('0xd'));var toCsv=require(_0x86ae('0x6'));var querystring=require(_0x86ae('0xe'));var Papa=require(_0x86ae('0xf'));var Redis=require(_0x86ae('0x10'));var authService=require(_0x86ae('0x11'));var qs=require(_0x86ae('0x12'));var as=require(_0x86ae('0x13'));var hardwareService=require(_0x86ae('0x14'));var logger=require(_0x86ae('0x15'))(_0x86ae('0x16'));var utils=require(_0x86ae('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x86ae('0x18'));var db=require(_0x86ae('0x19'))['db'];var integrations=require(_0x86ae('0x1a'));function respondWithStatusCode(_0x38a93f,_0x3d5158){_0x3d5158=_0x3d5158||0xcc;return function(_0xfdbfdb){if(_0xfdbfdb){return _0x38a93f[_0x86ae('0x1b')](_0x3d5158);}return _0x38a93f[_0x86ae('0x1c')](_0x3d5158)[_0x86ae('0x1d')]();};}function respondWithResult(_0x5d78d9,_0x529ebc){_0x529ebc=_0x529ebc||0xc8;return function(_0x7bfb85){if(_0x7bfb85){return _0x5d78d9[_0x86ae('0x1c')](_0x529ebc)[_0x86ae('0x1e')](_0x7bfb85);}};}function respondWithFilteredResult(_0x2807b0,_0x23a4e3){return function(_0x938b20){if(_0x938b20){var _0x57b116=typeof _0x23a4e3[_0x86ae('0x1f')]===_0x86ae('0x20')&&typeof _0x23a4e3[_0x86ae('0x21')]==='undefined';var _0x415443=_0x938b20[_0x86ae('0x22')];var _0x2fe843=_0x57b116?0x0:_0x23a4e3[_0x86ae('0x1f')];var _0x504927=_0x57b116?_0x938b20['count']:_0x23a4e3[_0x86ae('0x1f')]+_0x23a4e3[_0x86ae('0x21')];var _0x3e7819;if(_0x504927>=_0x415443){_0x504927=_0x415443;_0x3e7819=0xc8;}else{_0x3e7819=0xce;}_0x2807b0[_0x86ae('0x1c')](_0x3e7819);return _0x2807b0[_0x86ae('0x23')]('Content-Range',_0x2fe843+'-'+_0x504927+'/'+_0x415443)[_0x86ae('0x1e')](_0x938b20);}return null;};}function patchUpdates(_0x4802da){return function(_0x19a5e1){try{jsonpatch['apply'](_0x19a5e1,_0x4802da,!![]);}catch(_0x3fad8d){return BPromise['reject'](_0x3fad8d);}return _0x19a5e1[_0x86ae('0x24')]();};}function saveUpdates(_0x3d1b00,_0x5a3b90){return function(_0x5364e3){if(_0x5364e3){return _0x5364e3['update'](_0x3d1b00)[_0x86ae('0x25')](function(_0x267732){return _0x267732;});}return null;};}function removeEntity(_0x19516d,_0x3deac2){return function(_0x2f72b8){if(_0x2f72b8){return _0x2f72b8[_0x86ae('0x26')]()[_0x86ae('0x25')](function(){_0x19516d[_0x86ae('0x1c')](0xcc)[_0x86ae('0x1d')]();});}};}function handleEntityNotFound(_0x232afe,_0xe1680c){return function(_0x249031){if(!_0x249031){_0x232afe[_0x86ae('0x1b')](0x194);}return _0x249031;};}function handleError(_0x32d1fc,_0x1bd4f7){_0x1bd4f7=_0x1bd4f7||0x1f4;return function(_0x1e8eac){logger['error'](_0x1e8eac[_0x86ae('0x27')]);if(_0x1e8eac[_0x86ae('0x28')]){delete _0x1e8eac[_0x86ae('0x28')];}_0x32d1fc[_0x86ae('0x1c')](_0x1bd4f7)[_0x86ae('0x29')](_0x1e8eac);};}exports[_0x86ae('0x2a')]=function(_0x4dee42,_0x33e649){var _0x1b27b8={},_0x3e53b7={},_0x2b86e2={'count':0x0,'rows':[]};var _0x4e67d7=_[_0x86ae('0x2b')](db[_0x86ae('0x2c')][_0x86ae('0x2d')],function(_0x41ab00){return{'name':_0x41ab00[_0x86ae('0x2e')],'type':_0x41ab00[_0x86ae('0x2f')][_0x86ae('0x30')]};});_0x3e53b7[_0x86ae('0x31')]=_[_0x86ae('0x2b')](_0x4e67d7,_0x86ae('0x28'));_0x3e53b7[_0x86ae('0x32')]=_[_0x86ae('0x33')](_0x4dee42[_0x86ae('0x32')]);_0x3e53b7[_0x86ae('0x34')]=_[_0x86ae('0x35')](_0x3e53b7[_0x86ae('0x31')],_0x3e53b7[_0x86ae('0x32')]);_0x1b27b8[_0x86ae('0x36')]=_[_0x86ae('0x35')](_0x3e53b7['model'],qs[_0x86ae('0x37')](_0x4dee42[_0x86ae('0x32')][_0x86ae('0x37')]));_0x1b27b8[_0x86ae('0x36')]=_0x1b27b8['attributes'][_0x86ae('0x38')]?_0x1b27b8[_0x86ae('0x36')]:_0x3e53b7[_0x86ae('0x31')];if(!_0x4dee42[_0x86ae('0x32')][_0x86ae('0x39')]('nolimit')){_0x1b27b8[_0x86ae('0x21')]=qs[_0x86ae('0x21')](_0x4dee42[_0x86ae('0x32')][_0x86ae('0x21')]);_0x1b27b8['offset']=qs[_0x86ae('0x1f')](_0x4dee42[_0x86ae('0x32')]['offset']);}_0x1b27b8[_0x86ae('0x3a')]=qs[_0x86ae('0x3b')](_0x4dee42[_0x86ae('0x32')]['sort']);_0x1b27b8['where']=qs[_0x86ae('0x34')](_[_0x86ae('0x3c')](_0x4dee42[_0x86ae('0x32')],_0x3e53b7[_0x86ae('0x34')]),_0x4e67d7);if(_0x4dee42[_0x86ae('0x32')][_0x86ae('0x3d')]){_0x1b27b8['where']=_[_0x86ae('0x3e')](_0x1b27b8[_0x86ae('0x3f')],{'$or':_[_0x86ae('0x2b')](_0x4e67d7,function(_0x315f03){if(_0x315f03['type']!==_0x86ae('0x40')){var _0x357a23={};_0x357a23[_0x315f03[_0x86ae('0x28')]]={'$like':'%'+_0x4dee42[_0x86ae('0x32')]['filter']+'%'};return _0x357a23;}})});}_0x1b27b8=_[_0x86ae('0x3e')]({},_0x1b27b8,_0x4dee42[_0x86ae('0x41')]);var _0x54d1cf={'where':_0x1b27b8['where']};return db[_0x86ae('0x2c')][_0x86ae('0x22')](_0x54d1cf)[_0x86ae('0x25')](function(_0x14ae85){_0x2b86e2[_0x86ae('0x22')]=_0x14ae85;if(_0x4dee42[_0x86ae('0x32')][_0x86ae('0x42')]){_0x1b27b8[_0x86ae('0x43')]=[{'all':!![]}];}return db[_0x86ae('0x2c')][_0x86ae('0x44')](_0x1b27b8);})['then'](function(_0x1b98f6){_0x2b86e2[_0x86ae('0x45')]=_0x1b98f6;return _0x2b86e2;})[_0x86ae('0x25')](respondWithFilteredResult(_0x33e649,_0x1b27b8))[_0x86ae('0x46')](handleError(_0x33e649,null));};exports[_0x86ae('0x47')]=function(_0x283cc0,_0x1bf24f){var _0x285392={'raw':![],'where':{'id':_0x283cc0[_0x86ae('0x48')]['id']}},_0x1f7d0b={};_0x1f7d0b[_0x86ae('0x31')]=_[_0x86ae('0x33')](db[_0x86ae('0x2c')][_0x86ae('0x2d')]);_0x1f7d0b[_0x86ae('0x32')]=_[_0x86ae('0x33')](_0x283cc0[_0x86ae('0x32')]);_0x1f7d0b[_0x86ae('0x34')]=_[_0x86ae('0x35')](_0x1f7d0b[_0x86ae('0x31')],_0x1f7d0b['query']);_0x285392[_0x86ae('0x36')]=_['intersection'](_0x1f7d0b[_0x86ae('0x31')],qs[_0x86ae('0x37')](_0x283cc0[_0x86ae('0x32')][_0x86ae('0x37')]));_0x285392[_0x86ae('0x36')]=_0x285392['attributes'][_0x86ae('0x38')]?_0x285392['attributes']:_0x1f7d0b[_0x86ae('0x31')];if(_0x283cc0[_0x86ae('0x32')][_0x86ae('0x42')]){_0x285392[_0x86ae('0x43')]=[{'all':!![]}];}_0x285392=_[_0x86ae('0x3e')]({},_0x285392,_0x283cc0['options']);return db[_0x86ae('0x2c')][_0x86ae('0x49')](_0x285392)[_0x86ae('0x25')](handleEntityNotFound(_0x1bf24f,null))[_0x86ae('0x25')](respondWithResult(_0x1bf24f,null))[_0x86ae('0x46')](handleError(_0x1bf24f,null));};exports[_0x86ae('0x4a')]=function(_0x31ce4a,_0x103902){return db[_0x86ae('0x2c')][_0x86ae('0x4a')](_0x31ce4a[_0x86ae('0x4b')],{})[_0x86ae('0x25')](respondWithResult(_0x103902,0xc9))['catch'](handleError(_0x103902,null));};exports[_0x86ae('0x4c')]=function(_0x5aeec8,_0x6ea65a){if(_0x5aeec8[_0x86ae('0x4b')]['id']){delete _0x5aeec8[_0x86ae('0x4b')]['id'];}return db[_0x86ae('0x2c')][_0x86ae('0x49')]({'where':{'id':_0x5aeec8[_0x86ae('0x48')]['id']}})[_0x86ae('0x25')](handleEntityNotFound(_0x6ea65a,null))[_0x86ae('0x25')](saveUpdates(_0x5aeec8[_0x86ae('0x4b')],null))['then'](respondWithResult(_0x6ea65a,null))[_0x86ae('0x46')](handleError(_0x6ea65a,null));};exports[_0x86ae('0x26')]=function(_0x2ce7ff,_0x1f5791){return db[_0x86ae('0x2c')][_0x86ae('0x49')]({'where':{'id':_0x2ce7ff[_0x86ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x1f5791,null))[_0x86ae('0x25')](removeEntity(_0x1f5791,null))[_0x86ae('0x46')](handleError(_0x1f5791,null));};exports[_0x86ae('0x4d')]=function(_0xb5b125,_0x2114bc,_0xe0ebbe){var _0x446c17={};var _0x4ac55d={};var _0x444d48;var _0x45a05f;return db[_0x86ae('0x2c')][_0x86ae('0x4e')]({'where':{'id':_0xb5b125[_0x86ae('0x48')]['id']}})[_0x86ae('0x25')](handleEntityNotFound(_0x2114bc,null))[_0x86ae('0x25')](function(_0x34bab3){if(_0x34bab3){_0x444d48=_0x34bab3;_0x4ac55d[_0x86ae('0x31')]=_[_0x86ae('0x33')](db['DeskConfiguration']['rawAttributes']);_0x4ac55d[_0x86ae('0x32')]=_[_0x86ae('0x33')](_0xb5b125['query']);_0x4ac55d[_0x86ae('0x34')]=_[_0x86ae('0x35')](_0x4ac55d[_0x86ae('0x31')],_0x4ac55d[_0x86ae('0x32')]);_0x446c17[_0x86ae('0x36')]=_[_0x86ae('0x35')](_0x4ac55d[_0x86ae('0x31')],qs[_0x86ae('0x37')](_0xb5b125[_0x86ae('0x32')][_0x86ae('0x37')]));_0x446c17[_0x86ae('0x36')]=_0x446c17[_0x86ae('0x36')][_0x86ae('0x38')]?_0x446c17['attributes']:_0x4ac55d['model'];_0x446c17['order']=qs[_0x86ae('0x3b')](_0xb5b125['query'][_0x86ae('0x3b')]);_0x446c17[_0x86ae('0x3f')]=qs[_0x86ae('0x34')](_[_0x86ae('0x3c')](_0xb5b125[_0x86ae('0x32')],_0x4ac55d['filters']));if(_0xb5b125['query']['filter']){_0x446c17[_0x86ae('0x3f')]=_[_0x86ae('0x3e')](_0x446c17[_0x86ae('0x3f')],{'$or':_[_0x86ae('0x2b')](_0x446c17['attributes'],function(_0x2e08fa){var _0x55068a={};_0x55068a[_0x2e08fa]={'$like':'%'+_0xb5b125[_0x86ae('0x32')]['filter']+'%'};return _0x55068a;})});}_0x446c17=_[_0x86ae('0x3e')]({},_0x446c17,_0xb5b125[_0x86ae('0x41')]);return _0x444d48[_0x86ae('0x4d')](_0x446c17);}})[_0x86ae('0x25')](function(_0x497aaa){if(_0x497aaa){_0x45a05f=_0x497aaa[_0x86ae('0x38')];if(!_0xb5b125[_0x86ae('0x32')][_0x86ae('0x39')](_0x86ae('0x4f'))){_0x446c17[_0x86ae('0x21')]=qs[_0x86ae('0x21')](_0xb5b125[_0x86ae('0x32')][_0x86ae('0x21')]);_0x446c17[_0x86ae('0x1f')]=qs[_0x86ae('0x1f')](_0xb5b125[_0x86ae('0x32')][_0x86ae('0x1f')]);}return _0x444d48[_0x86ae('0x4d')](_0x446c17);}})[_0x86ae('0x25')](function(_0x553c56){if(_0x553c56){return _0x553c56?{'count':_0x45a05f,'rows':_0x553c56}:null;}})[_0x86ae('0x25')](respondWithResult(_0x2114bc,null))[_0x86ae('0x46')](handleError(_0x2114bc,null));};exports[_0x86ae('0x50')]=function(_0x337bad,_0xf6b1a9,_0x41f5f4){if(_0x337bad[_0x86ae('0x4b')]['id']){delete _0x337bad[_0x86ae('0x4b')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x337bad[_0x86ae('0x48')]['id']}})[_0x86ae('0x25')](handleEntityNotFound(_0xf6b1a9,null))['then'](function(_0x1bfdf1){if(_0x1bfdf1){_0x337bad[_0x86ae('0x4b')]['AccountId']=_0x1bfdf1['id'];_0x337bad[_0x86ae('0x4b')]['Subjects']=integrations['getSubjects'](_0x337bad['body'][_0x86ae('0x51')],_0x337bad[_0x86ae('0x4b')][_0x86ae('0x2f')]);_0x337bad['body'][_0x86ae('0x52')]=integrations[_0x86ae('0x53')](_0x337bad['body'][_0x86ae('0x51')],_0x337bad[_0x86ae('0x4b')]['type']);return db['DeskConfiguration']['create'](_0x337bad[_0x86ae('0x4b')],{'include':[{'model':db[_0x86ae('0x54')],'as':_0x86ae('0x55')},{'model':db[_0x86ae('0x54')],'as':'Descriptions'}]});}return null;})[_0x86ae('0x25')](respondWithResult(_0xf6b1a9,null))['catch'](handleError(_0xf6b1a9,null));};exports['getFields']=function(_0x1c5c4c,_0x535f19,_0x2d2e19){var _0x17a29b=[{'name':_0x86ae('0x56'),'label':_0x86ae('0x56'),'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 _0x2e247c='';return db[_0x86ae('0x2c')][_0x86ae('0x4e')]({'where':{'id':_0x1c5c4c[_0x86ae('0x48')]['id']},'attributes':['id',_0x86ae('0x57'),'authType',_0x86ae('0x58'),'password',_0x86ae('0x59'),_0x86ae('0x5a'),_0x86ae('0x5b'),_0x86ae('0x5c')]})[_0x86ae('0x25')](handleEntityNotFound(_0x535f19,null))[_0x86ae('0x25')](function(_0x253252){if(_0x253252){_0x2e247c=_0x253252['remoteUri'];var _0x2fa760=_0x2e247c['slice'](-0x1);if(_0x2fa760==='/'){_0x2e247c=_0x2e247c[_0x86ae('0x5d')](0x0,_0x2e247c['lastIndexOf'](_0x2fa760));}var _0x1b5eab={'method':_0x86ae('0x5e'),'uri':util[_0x86ae('0x5f')](_0x86ae('0x60'),_0x2e247c),'headers':{'Content-Type':_0x86ae('0x61'),'Accept':_0x86ae('0x61')},'json':!![]};if(_0x253252[_0x86ae('0x62')]===_0x86ae('0x63')){_0x1b5eab[_0x86ae('0x64')][_0x86ae('0x65')]=util[_0x86ae('0x5f')](_0x86ae('0x66'),new Buffer(util[_0x86ae('0x5f')]('%s:%s',_0x253252['username'],_0x253252['password']))[_0x86ae('0x67')](_0x86ae('0x68')));}return rp(_0x1b5eab)[_0x86ae('0x25')](function(_0x2d0a16){return _0x17a29b[_0x86ae('0x69')](_[_0x86ae('0x2b')](_0x2d0a16[_0x86ae('0x6a')][_0x86ae('0x6b')],function(_0xfa40cb){return{'id':_0xfa40cb[_0x86ae('0x28')],'name':_0xfa40cb[_0x86ae('0x28')],'type':_0xfa40cb[_0x86ae('0x2f')],'active':_0xfa40cb['active'],'label':_0xfa40cb[_0x86ae('0x6c')],'custom':!![]};}));});}})[_0x86ae('0x25')](function(_0x1c7328){return{'count':_0x1c7328[_0x86ae('0x38')],'rows':_0x1c7328};})['then'](respondWithResult(_0x535f19,null))[_0x86ae('0x46')](function(_0x1ad62b){var _0x5c15f7=_0x1c5c4c[_0x86ae('0x32')][_0x86ae('0x6d')]?0x1f4:_0x1ad62b[_0x86ae('0x6e')]||0x1f4;logger[_0x86ae('0x6f')](_0x86ae('0x70'),_0x86ae('0x71'),_0x5c15f7,JSON[_0x86ae('0x72')](_0x1ad62b));delete _0x1ad62b[_0x86ae('0x28')];if(_0x5c15f7===0x191){_0x5c15f7=0x190;}_0x535f19['status'](_0x5c15f7)[_0x86ae('0x29')](_0x1c5c4c['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x1ad62b[_0x86ae('0x6e')]}:_0x1ad62b);});};
\ No newline at end of file
index f857c6d..f6052fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3429=['exports','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x1c4409,_0x3b2e8f){var _0x356d8f=function(_0xae43bf){while(--_0xae43bf){_0x1c4409['push'](_0x1c4409['shift']());}};_0x356d8f(++_0x3b2e8f);}(_0x3429,0xa0));var _0x9342=function(_0x5b9215,_0x2a3150){_0x5b9215=_0x5b9215-0x0;var _0xd1c2ce=_0x3429[_0x5b9215];return _0xd1c2ce;};'use strict';var _=require('lodash');var util=require(_0x9342('0x0'));var logger=require(_0x9342('0x1'))(_0x9342('0x2'));var moment=require(_0x9342('0x3'));var BPromise=require(_0x9342('0x4'));var rp=require(_0x9342('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9342('0x6'));var config=require(_0x9342('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x9342('0x8'));module[_0x9342('0x9')]=function(_0x123466,_0x5609b9){return _0x123466[_0x9342('0xa')](_0x9342('0xb'),attributes,{'tableName':_0x9342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2b5b=['../../config/logger','api','bluebird','path','rimraf','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash'];(function(_0x13b58a,_0x4f7f7a){var _0x30ff5d=function(_0xfcfebf){while(--_0xfcfebf){_0x13b58a['push'](_0x13b58a['shift']());}};_0x30ff5d(++_0x4f7f7a);}(_0x2b5b,0x83));var _0xb2b5=function(_0x37a7bc,_0x1220db){_0x37a7bc=_0x37a7bc-0x0;var _0x2e5f63=_0x2b5b[_0x37a7bc];return _0x2e5f63;};'use strict';var _=require(_0xb2b5('0x0'));var util=require('util');var logger=require(_0xb2b5('0x1'))(_0xb2b5('0x2'));var moment=require('moment');var BPromise=require(_0xb2b5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2b5('0x4'));var rimraf=require(_0xb2b5('0x5'));var config=require('../../config/environment');var attributes=require(_0xb2b5('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xb2b5('0x7')]=function(_0x17bb7f,_0x3cf9e9){return _0x17bb7f[_0xb2b5('0x8')](_0xb2b5('0x9'),attributes,{'tableName':_0xb2b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ad8f5b0..c4b0bd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7362=['options','raw','attributes','limit','map','model','include','then','stringify','ShowDeskAccount','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7362,0x7b));var _0x2736=function(_0xb46ad3,_0x377164){_0xb46ad3=_0xb46ad3-0x0;var _0x413627=_0x7362[_0xb46ad3];return _0x413627;};'use strict';var _=require('lodash');var util=require(_0x2736('0x0'));var moment=require(_0x2736('0x1'));var BPromise=require(_0x2736('0x2'));var rs=require(_0x2736('0x3'));var fs=require('fs');var Redis=require(_0x2736('0x4'));var db=require(_0x2736('0x5'))['db'];var utils=require(_0x2736('0x6'));var logger=require(_0x2736('0x7'))(_0x2736('0x8'));var config=require(_0x2736('0x9'));var jayson=require(_0x2736('0xa'));var client=jayson[_0x2736('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1885e9,_0x425b4f,_0x5dd476){return new BPromise(function(_0x3fe0c8,_0x5b83d8){return client['request'](_0x1885e9,_0x5dd476)['then'](function(_0x270dec){logger[_0x2736('0xc')](_0x2736('0xd'),_0x425b4f,'request\x20sent');logger[_0x2736('0xe')](_0x2736('0xf'),_0x425b4f,_0x2736('0x10'),JSON['stringify'](_0x270dec));if(_0x270dec['error']){if(_0x270dec[_0x2736('0x11')][_0x2736('0x12')]===0x1f4){logger['error'](_0x2736('0xd'),_0x425b4f,_0x270dec[_0x2736('0x11')]['message']);return _0x5b83d8(_0x270dec[_0x2736('0x11')][_0x2736('0x13')]);}logger[_0x2736('0x11')](_0x2736('0xd'),_0x425b4f,_0x270dec[_0x2736('0x11')][_0x2736('0x13')]);return _0x3fe0c8(_0x270dec[_0x2736('0x11')]['message']);}else{logger[_0x2736('0xc')](_0x2736('0xd'),_0x425b4f,_0x2736('0x10'));_0x3fe0c8(_0x270dec[_0x2736('0x14')][_0x2736('0x13')]);}})[_0x2736('0x15')](function(_0x29878b){logger[_0x2736('0x11')](_0x2736('0xd'),_0x425b4f,_0x29878b);_0x5b83d8(_0x29878b);});});}exports[_0x2736('0x16')]=function(_0x1f38b1){var _0x4c80d8=this;return new Promise(function(_0x4ab01a,_0x145098){return db[_0x2736('0x17')][_0x2736('0x18')]({'raw':_0x1f38b1[_0x2736('0x19')]?_0x1f38b1[_0x2736('0x19')][_0x2736('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f38b1[_0x2736('0x19')]?_0x1f38b1[_0x2736('0x19')]['where']||null:null,'attributes':_0x1f38b1[_0x2736('0x19')]?_0x1f38b1[_0x2736('0x19')][_0x2736('0x1b')]||null:null,'limit':_0x1f38b1[_0x2736('0x19')]?_0x1f38b1[_0x2736('0x19')][_0x2736('0x1c')]||null:null,'include':_0x1f38b1[_0x2736('0x19')]?_0x1f38b1[_0x2736('0x19')]['include']?_[_0x2736('0x1d')](_0x1f38b1['options']['include'],function(_0x5cf3b1){return{'model':db[_0x5cf3b1[_0x2736('0x1e')]],'as':_0x5cf3b1['as'],'attributes':_0x5cf3b1['attributes'],'include':_0x5cf3b1[_0x2736('0x1f')]?_[_0x2736('0x1d')](_0x5cf3b1[_0x2736('0x1f')],function(_0x114cde){return{'model':db[_0x114cde[_0x2736('0x1e')]],'as':_0x114cde['as'],'attributes':_0x114cde[_0x2736('0x1b')],'include':_0x114cde[_0x2736('0x1f')]?_[_0x2736('0x1d')](_0x114cde[_0x2736('0x1f')],function(_0x5b2e2f){return{'model':db[_0x5b2e2f[_0x2736('0x1e')]],'as':_0x5b2e2f['as'],'attributes':_0x5b2e2f[_0x2736('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2736('0x20')](function(_0x319bfd){logger[_0x2736('0xc')](_0x2736('0x16'),_0x1f38b1);logger[_0x2736('0xe')](_0x2736('0x16'),_0x1f38b1,JSON[_0x2736('0x21')](_0x319bfd));_0x4ab01a(_0x319bfd);})[_0x2736('0x15')](function(_0x4d74f7){logger[_0x2736('0x11')](_0x2736('0x16'),_0x4d74f7['message'],_0x1f38b1);_0x145098(_0x4c80d8[_0x2736('0x11')](0x1f4,_0x4d74f7[_0x2736('0x13')]));});});};exports[_0x2736('0x22')]=function(_0x4dbf3e){var _0x2e6195=this;return new Promise(function(_0x3e4cdc,_0x261a4a){return db[_0x2736('0x17')][_0x2736('0x23')]({'raw':_0x4dbf3e[_0x2736('0x19')]?_0x4dbf3e[_0x2736('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x4dbf3e['options']?_0x4dbf3e[_0x2736('0x19')][_0x2736('0x24')]||null:null,'attributes':_0x4dbf3e['options']?_0x4dbf3e[_0x2736('0x19')][_0x2736('0x1b')]||null:null,'include':_0x4dbf3e[_0x2736('0x19')]?_0x4dbf3e[_0x2736('0x19')][_0x2736('0x1f')]?_[_0x2736('0x1d')](_0x4dbf3e[_0x2736('0x19')]['include'],function(_0x47ffed){return{'model':db[_0x47ffed[_0x2736('0x1e')]],'as':_0x47ffed['as'],'attributes':_0x47ffed[_0x2736('0x1b')],'include':_0x47ffed[_0x2736('0x1f')]?_['map'](_0x47ffed[_0x2736('0x1f')],function(_0x61c944){return{'model':db[_0x61c944[_0x2736('0x1e')]],'as':_0x61c944['as'],'attributes':_0x61c944[_0x2736('0x1b')],'include':_0x61c944[_0x2736('0x1f')]?_[_0x2736('0x1d')](_0x61c944[_0x2736('0x1f')],function(_0x464007){return{'model':db[_0x464007[_0x2736('0x1e')]],'as':_0x464007['as'],'attributes':_0x464007['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2141a9){logger[_0x2736('0xc')](_0x2736('0x22'),_0x4dbf3e);logger[_0x2736('0xe')](_0x2736('0x22'),_0x4dbf3e,JSON[_0x2736('0x21')](_0x2141a9));_0x3e4cdc(_0x2141a9);})[_0x2736('0x15')](function(_0x2a4efd){logger['error']('ShowDeskAccount',_0x2a4efd[_0x2736('0x13')],_0x4dbf3e);_0x261a4a(_0x2e6195[_0x2736('0x11')](0x1f4,_0x2a4efd[_0x2736('0x13')]));});});};
\ No newline at end of file
+var _0xe2ac=['limit','include','model','map','then','catch','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes'];(function(_0xa34215,_0x396a2c){var _0x2b6767=function(_0x42edfe){while(--_0x42edfe){_0xa34215['push'](_0xa34215['shift']());}};_0x2b6767(++_0x396a2c);}(_0xe2ac,0x14b));var _0xce2a=function(_0x19babd,_0x1d4ef7){_0x19babd=_0x19babd-0x0;var _0x314eaf=_0xe2ac[_0x19babd];return _0x314eaf;};'use strict';var _=require(_0xce2a('0x0'));var util=require(_0xce2a('0x1'));var moment=require(_0xce2a('0x2'));var BPromise=require(_0xce2a('0x3'));var rs=require(_0xce2a('0x4'));var fs=require('fs');var Redis=require(_0xce2a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xce2a('0x6'));var logger=require(_0xce2a('0x7'))(_0xce2a('0x8'));var config=require('../../config/environment');var jayson=require(_0xce2a('0x9'));var client=jayson[_0xce2a('0xa')][_0xce2a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dc8d5,_0x15423f,_0x50924a){return new BPromise(function(_0x20f1bc,_0x3401f8){return client['request'](_0x4dc8d5,_0x50924a)['then'](function(_0x1765fc){logger[_0xce2a('0xc')](_0xce2a('0xd'),_0x15423f,_0xce2a('0xe'));logger[_0xce2a('0xf')](_0xce2a('0x10'),_0x15423f,_0xce2a('0xe'),JSON[_0xce2a('0x11')](_0x1765fc));if(_0x1765fc[_0xce2a('0x12')]){if(_0x1765fc['error'][_0xce2a('0x13')]===0x1f4){logger[_0xce2a('0x12')](_0xce2a('0xd'),_0x15423f,_0x1765fc[_0xce2a('0x12')]['message']);return _0x3401f8(_0x1765fc[_0xce2a('0x12')][_0xce2a('0x14')]);}logger[_0xce2a('0x12')]('DeskAccount,\x20%s,\x20%s',_0x15423f,_0x1765fc['error'][_0xce2a('0x14')]);return _0x20f1bc(_0x1765fc[_0xce2a('0x12')][_0xce2a('0x14')]);}else{logger[_0xce2a('0xc')](_0xce2a('0xd'),_0x15423f,_0xce2a('0xe'));_0x20f1bc(_0x1765fc[_0xce2a('0x15')][_0xce2a('0x14')]);}})['catch'](function(_0x4266b5){logger[_0xce2a('0x12')]('DeskAccount,\x20%s,\x20%s',_0x15423f,_0x4266b5);_0x3401f8(_0x4266b5);});});}exports[_0xce2a('0x16')]=function(_0x12e7b8){var _0x438ae8=this;return new Promise(function(_0x18f475,_0x2a5371){return db[_0xce2a('0x17')][_0xce2a('0x18')]({'raw':_0x12e7b8[_0xce2a('0x19')]?_0x12e7b8[_0xce2a('0x19')][_0xce2a('0x1a')]===undefined?!![]:![]:!![],'where':_0x12e7b8['options']?_0x12e7b8[_0xce2a('0x19')][_0xce2a('0x1b')]||null:null,'attributes':_0x12e7b8['options']?_0x12e7b8[_0xce2a('0x19')][_0xce2a('0x1c')]||null:null,'limit':_0x12e7b8[_0xce2a('0x19')]?_0x12e7b8[_0xce2a('0x19')][_0xce2a('0x1d')]||null:null,'include':_0x12e7b8[_0xce2a('0x19')]?_0x12e7b8['options'][_0xce2a('0x1e')]?_['map'](_0x12e7b8[_0xce2a('0x19')][_0xce2a('0x1e')],function(_0x199c20){return{'model':db[_0x199c20[_0xce2a('0x1f')]],'as':_0x199c20['as'],'attributes':_0x199c20[_0xce2a('0x1c')],'include':_0x199c20[_0xce2a('0x1e')]?_['map'](_0x199c20[_0xce2a('0x1e')],function(_0x1a1ac7){return{'model':db[_0x1a1ac7[_0xce2a('0x1f')]],'as':_0x1a1ac7['as'],'attributes':_0x1a1ac7[_0xce2a('0x1c')],'include':_0x1a1ac7[_0xce2a('0x1e')]?_[_0xce2a('0x20')](_0x1a1ac7[_0xce2a('0x1e')],function(_0x28762e){return{'model':db[_0x28762e[_0xce2a('0x1f')]],'as':_0x28762e['as'],'attributes':_0x28762e[_0xce2a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xce2a('0x21')](function(_0x258e1e){logger['info'](_0xce2a('0x16'),_0x12e7b8);logger[_0xce2a('0xf')](_0xce2a('0x16'),_0x12e7b8,JSON[_0xce2a('0x11')](_0x258e1e));_0x18f475(_0x258e1e);})[_0xce2a('0x22')](function(_0x10ef0b){logger['error'](_0xce2a('0x16'),_0x10ef0b['message'],_0x12e7b8);_0x2a5371(_0x438ae8[_0xce2a('0x12')](0x1f4,_0x10ef0b[_0xce2a('0x14')]));});});};exports[_0xce2a('0x23')]=function(_0x2928e1){var _0x3ea150=this;return new Promise(function(_0x52210,_0x33847d){return db[_0xce2a('0x17')]['find']({'raw':_0x2928e1[_0xce2a('0x19')]?_0x2928e1[_0xce2a('0x19')][_0xce2a('0x1a')]===undefined?!![]:![]:!![],'where':_0x2928e1['options']?_0x2928e1['options'][_0xce2a('0x1b')]||null:null,'attributes':_0x2928e1[_0xce2a('0x19')]?_0x2928e1['options']['attributes']||null:null,'include':_0x2928e1[_0xce2a('0x19')]?_0x2928e1[_0xce2a('0x19')][_0xce2a('0x1e')]?_[_0xce2a('0x20')](_0x2928e1[_0xce2a('0x19')][_0xce2a('0x1e')],function(_0x30f1e0){return{'model':db[_0x30f1e0[_0xce2a('0x1f')]],'as':_0x30f1e0['as'],'attributes':_0x30f1e0[_0xce2a('0x1c')],'include':_0x30f1e0[_0xce2a('0x1e')]?_[_0xce2a('0x20')](_0x30f1e0[_0xce2a('0x1e')],function(_0x1939a1){return{'model':db[_0x1939a1[_0xce2a('0x1f')]],'as':_0x1939a1['as'],'attributes':_0x1939a1[_0xce2a('0x1c')],'include':_0x1939a1[_0xce2a('0x1e')]?_[_0xce2a('0x20')](_0x1939a1[_0xce2a('0x1e')],function(_0x18d5bb){return{'model':db[_0x18d5bb[_0xce2a('0x1f')]],'as':_0x18d5bb['as'],'attributes':_0x18d5bb['attributes']};}):[]};}):[]};}):[]:[]})[_0xce2a('0x21')](function(_0x4d8b5c){logger[_0xce2a('0xc')]('ShowDeskAccount',_0x2928e1);logger[_0xce2a('0xf')](_0xce2a('0x23'),_0x2928e1,JSON['stringify'](_0x4d8b5c));_0x52210(_0x4d8b5c);})[_0xce2a('0x22')](function(_0x58eeae){logger[_0xce2a('0x12')](_0xce2a('0x23'),_0x58eeae['message'],_0x2928e1);_0x33847d(_0x3ea150[_0xce2a('0x12')](0x1f4,_0x58eeae['message']));});});};
\ No newline at end of file
index c6d4b7a..3a8fcf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x291103,_0x2cf1cd){var _0x540e84=function(_0x4dd2f3){while(--_0x4dd2f3){_0x291103['push'](_0x291103['shift']());}};_0x540e84(++_0x2cf1cd);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
+var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3067b3,_0x1cb430){var _0x5c4cfb=function(_0x494134){while(--_0x494134){_0x3067b3['push'](_0x3067b3['shift']());}};_0x5c4cfb(++_0x1cb430);}(_0x9c44,0x178));var _0x49c4=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c44[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router;
\ No newline at end of file
index 2e53ac7..25ce3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7026=['STRING','sequelize'];(function(_0x35254c,_0x5a27d7){var _0xef3533=function(_0x41fec7){while(--_0x41fec7){_0x35254c['push'](_0x35254c['shift']());}};_0xef3533(++_0x5a27d7);}(_0x7026,0x105));var _0x6702=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x7026[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require(_0x6702('0x0'));module['exports']={'name':{'type':Sequelize[_0x6702('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x7b66=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b66,0x19d));var _0x67b6=function(_0x54bcf8,_0x2bcfd6){_0x54bcf8=_0x54bcf8-0x0;var _0x3bd467=_0x7b66[_0x54bcf8];return _0x3bd467;};'use strict';var Sequelize=require('sequelize');module[_0x67b6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x67b6('0x1')]}};
\ No newline at end of file
index f49ac76..5f5319a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cc2=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','findOne','DeskField','getFields','getSubjects','pick','getDescriptions','getTags','Tag','setTags','ids','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x1d9016,_0x494e1a){var _0x1dd05d=function(_0x41afa9){while(--_0x41afa9){_0x1d9016['push'](_0x1d9016['shift']());}};_0x1dd05d(++_0x494e1a);}(_0x4cc2,0xec));var _0x24cc=function(_0x35ca16,_0x12ff71){_0x35ca16=_0x35ca16-0x0;var _0x3cad13=_0x4cc2[_0x35ca16];return _0x3cad13;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x24cc('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x24cc('0x1'));var moment=require('moment');var BPromise=require(_0x24cc('0x2'));var Mustache=require(_0x24cc('0x3'));var util=require(_0x24cc('0x4'));var path=require(_0x24cc('0x5'));var sox=require(_0x24cc('0x6'));var csv=require(_0x24cc('0x7'));var ejs=require(_0x24cc('0x8'));var fs=require('fs');var fs_extra=require(_0x24cc('0x9'));var _=require(_0x24cc('0xa'));var squel=require('squel');var crypto=require(_0x24cc('0xb'));var jsforce=require(_0x24cc('0xc'));var deskjs=require(_0x24cc('0xd'));var toCsv=require(_0x24cc('0x7'));var querystring=require(_0x24cc('0xe'));var Papa=require(_0x24cc('0xf'));var Redis=require(_0x24cc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x24cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x24cc('0x12'));var logger=require(_0x24cc('0x13'))(_0x24cc('0x14'));var utils=require('../../config/utils');var config=require(_0x24cc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x24cc('0x16'))['db'];function respondWithStatusCode(_0x40ab4a,_0x4d73cb){_0x4d73cb=_0x4d73cb||0xcc;return function(_0x48abd5){if(_0x48abd5){return _0x40ab4a[_0x24cc('0x17')](_0x4d73cb);}return _0x40ab4a[_0x24cc('0x18')](_0x4d73cb)[_0x24cc('0x19')]();};}function respondWithResult(_0x2536ff,_0x2ec3b9){_0x2ec3b9=_0x2ec3b9||0xc8;return function(_0x240054){if(_0x240054){return _0x2536ff[_0x24cc('0x18')](_0x2ec3b9)['json'](_0x240054);}};}function respondWithFilteredResult(_0x193812,_0x225725){return function(_0x1e8f7e){if(_0x1e8f7e){var _0x3e9dce=typeof _0x225725[_0x24cc('0x1a')]===_0x24cc('0x1b')&&typeof _0x225725['limit']===_0x24cc('0x1b');var _0x15818f=_0x1e8f7e[_0x24cc('0x1c')];var _0x563dd8=_0x3e9dce?0x0:_0x225725['offset'];var _0x10170e=_0x3e9dce?_0x1e8f7e[_0x24cc('0x1c')]:_0x225725[_0x24cc('0x1a')]+_0x225725[_0x24cc('0x1d')];var _0x10c00b;if(_0x10170e>=_0x15818f){_0x10170e=_0x15818f;_0x10c00b=0xc8;}else{_0x10c00b=0xce;}_0x193812[_0x24cc('0x18')](_0x10c00b);return _0x193812[_0x24cc('0x1e')](_0x24cc('0x1f'),_0x563dd8+'-'+_0x10170e+'/'+_0x15818f)[_0x24cc('0x20')](_0x1e8f7e);}return null;};}function patchUpdates(_0x594e44){return function(_0x4ff45a){try{jsonpatch[_0x24cc('0x21')](_0x4ff45a,_0x594e44,!![]);}catch(_0x3bac20){return BPromise[_0x24cc('0x22')](_0x3bac20);}return _0x4ff45a['save']();};}function saveUpdates(_0x57ca33,_0x3c66c7){return function(_0x41b338){if(_0x41b338){return _0x41b338[_0x24cc('0x23')](_0x57ca33)[_0x24cc('0x24')](function(_0x197f9f){return _0x197f9f;});}return null;};}function removeEntity(_0x411f11,_0x5ec0d4){return function(_0x5e70a8){if(_0x5e70a8){return _0x5e70a8[_0x24cc('0x25')]()[_0x24cc('0x24')](function(){_0x411f11['status'](0xcc)[_0x24cc('0x19')]();});}};}function handleEntityNotFound(_0x23cba1,_0x4a1369){return function(_0xde3497){if(!_0xde3497){_0x23cba1[_0x24cc('0x17')](0x194);}return _0xde3497;};}function handleError(_0x4e56e6,_0x52c6ee){_0x52c6ee=_0x52c6ee||0x1f4;return function(_0x673253){logger[_0x24cc('0x26')](_0x673253[_0x24cc('0x27')]);if(_0x673253[_0x24cc('0x28')]){delete _0x673253['name'];}_0x4e56e6['status'](_0x52c6ee)[_0x24cc('0x29')](_0x673253);};}exports[_0x24cc('0x2a')]=function(_0x2f5e02,_0xcaaae8){var _0x224754={},_0x34aeff={},_0x234947={'count':0x0,'rows':[]};var _0x55496=_[_0x24cc('0x2b')](db[_0x24cc('0x2c')][_0x24cc('0x2d')],function(_0x250b65){return{'name':_0x250b65[_0x24cc('0x2e')],'type':_0x250b65[_0x24cc('0x2f')]['key']};});_0x34aeff[_0x24cc('0x30')]=_[_0x24cc('0x2b')](_0x55496,_0x24cc('0x28'));_0x34aeff['query']=_[_0x24cc('0x31')](_0x2f5e02[_0x24cc('0x32')]);_0x34aeff[_0x24cc('0x33')]=_[_0x24cc('0x34')](_0x34aeff['model'],_0x34aeff[_0x24cc('0x32')]);_0x224754[_0x24cc('0x35')]=_[_0x24cc('0x34')](_0x34aeff[_0x24cc('0x30')],qs[_0x24cc('0x36')](_0x2f5e02[_0x24cc('0x32')]['fields']));_0x224754[_0x24cc('0x35')]=_0x224754[_0x24cc('0x35')]['length']?_0x224754[_0x24cc('0x35')]:_0x34aeff[_0x24cc('0x30')];if(!_0x2f5e02['query'][_0x24cc('0x37')](_0x24cc('0x38'))){_0x224754[_0x24cc('0x1d')]=qs[_0x24cc('0x1d')](_0x2f5e02['query'][_0x24cc('0x1d')]);_0x224754[_0x24cc('0x1a')]=qs['offset'](_0x2f5e02[_0x24cc('0x32')][_0x24cc('0x1a')]);}_0x224754[_0x24cc('0x39')]=qs[_0x24cc('0x3a')](_0x2f5e02[_0x24cc('0x32')][_0x24cc('0x3a')]);_0x224754[_0x24cc('0x3b')]=qs[_0x24cc('0x33')](_['pick'](_0x2f5e02[_0x24cc('0x32')],_0x34aeff[_0x24cc('0x33')]),_0x55496);if(_0x2f5e02['query']['filter']){_0x224754[_0x24cc('0x3b')]=_[_0x24cc('0x3c')](_0x224754[_0x24cc('0x3b')],{'$or':_['map'](_0x55496,function(_0x1376a8){if(_0x1376a8[_0x24cc('0x2f')]!==_0x24cc('0x3d')){var _0x3410aa={};_0x3410aa[_0x1376a8[_0x24cc('0x28')]]={'$like':'%'+_0x2f5e02['query'][_0x24cc('0x3e')]+'%'};return _0x3410aa;}})});}_0x224754=_[_0x24cc('0x3c')]({},_0x224754,_0x2f5e02[_0x24cc('0x3f')]);var _0x5dcd02={'where':_0x224754['where']};return db[_0x24cc('0x2c')][_0x24cc('0x1c')](_0x5dcd02)['then'](function(_0x5b6c15){_0x234947['count']=_0x5b6c15;if(_0x2f5e02[_0x24cc('0x32')][_0x24cc('0x40')]){_0x224754[_0x24cc('0x41')]=[{'all':!![]}];}return db[_0x24cc('0x2c')][_0x24cc('0x42')](_0x224754);})['then'](function(_0x58cbd9){_0x234947[_0x24cc('0x43')]=_0x58cbd9;return _0x234947;})[_0x24cc('0x24')](respondWithFilteredResult(_0xcaaae8,_0x224754))[_0x24cc('0x44')](handleError(_0xcaaae8,null));};exports[_0x24cc('0x45')]=function(_0x12621a,_0x622794){var _0x46ff79={'raw':![],'where':{'id':_0x12621a[_0x24cc('0x46')]['id']}},_0x367007={};_0x367007[_0x24cc('0x30')]=_[_0x24cc('0x31')](db[_0x24cc('0x2c')][_0x24cc('0x2d')]);_0x367007['query']=_['keys'](_0x12621a[_0x24cc('0x32')]);_0x367007[_0x24cc('0x33')]=_['intersection'](_0x367007[_0x24cc('0x30')],_0x367007[_0x24cc('0x32')]);_0x46ff79[_0x24cc('0x35')]=_[_0x24cc('0x34')](_0x367007[_0x24cc('0x30')],qs[_0x24cc('0x36')](_0x12621a[_0x24cc('0x32')][_0x24cc('0x36')]));_0x46ff79['attributes']=_0x46ff79[_0x24cc('0x35')][_0x24cc('0x47')]?_0x46ff79[_0x24cc('0x35')]:_0x367007[_0x24cc('0x30')];if(_0x12621a[_0x24cc('0x32')][_0x24cc('0x40')]){_0x46ff79['include']=[{'all':!![]}];}_0x46ff79=_['merge']({},_0x46ff79,_0x12621a[_0x24cc('0x3f')]);return db[_0x24cc('0x2c')]['find'](_0x46ff79)['then'](handleEntityNotFound(_0x622794,null))[_0x24cc('0x24')](respondWithResult(_0x622794,null))['catch'](handleError(_0x622794,null));};exports[_0x24cc('0x48')]=function(_0x2b574e,_0x4c2d6c){return db[_0x24cc('0x2c')][_0x24cc('0x48')](_0x2b574e[_0x24cc('0x49')],{})[_0x24cc('0x24')](respondWithResult(_0x4c2d6c,0xc9))[_0x24cc('0x44')](handleError(_0x4c2d6c,null));};exports[_0x24cc('0x23')]=function(_0x15d78e,_0x3f9eca){if(_0x15d78e[_0x24cc('0x49')]['id']){delete _0x15d78e[_0x24cc('0x49')]['id'];}return db[_0x24cc('0x2c')][_0x24cc('0x4a')]({'where':{'id':_0x15d78e[_0x24cc('0x46')]['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x3f9eca,null))[_0x24cc('0x24')](saveUpdates(_0x15d78e[_0x24cc('0x49')],null))[_0x24cc('0x24')](respondWithResult(_0x3f9eca,null))[_0x24cc('0x44')](handleError(_0x3f9eca,null));};exports[_0x24cc('0x25')]=function(_0x2a578e,_0x578c70){return db[_0x24cc('0x2c')][_0x24cc('0x4a')]({'where':{'id':_0x2a578e[_0x24cc('0x46')]['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x578c70,null))[_0x24cc('0x24')](removeEntity(_0x578c70,null))[_0x24cc('0x44')](handleError(_0x578c70,null));};exports['getFields']=function(_0x18d39e,_0x5a1e52,_0x5bf412){var _0x40130a={};var _0x41e220={};var _0x473df0;var _0x3edbfd;return db['DeskConfiguration'][_0x24cc('0x4b')]({'where':{'id':_0x18d39e[_0x24cc('0x46')]['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x5a1e52,null))[_0x24cc('0x24')](function(_0xd8e67b){if(_0xd8e67b){_0x473df0=_0xd8e67b;_0x41e220[_0x24cc('0x30')]=_[_0x24cc('0x31')](db[_0x24cc('0x4c')][_0x24cc('0x2d')]);_0x41e220[_0x24cc('0x32')]=_[_0x24cc('0x31')](_0x18d39e[_0x24cc('0x32')]);_0x41e220['filters']=_['intersection'](_0x41e220['model'],_0x41e220[_0x24cc('0x32')]);_0x40130a['attributes']=_[_0x24cc('0x34')](_0x41e220['model'],qs[_0x24cc('0x36')](_0x18d39e['query'][_0x24cc('0x36')]));_0x40130a[_0x24cc('0x35')]=_0x40130a[_0x24cc('0x35')][_0x24cc('0x47')]?_0x40130a['attributes']:_0x41e220[_0x24cc('0x30')];_0x40130a[_0x24cc('0x39')]=qs['sort'](_0x18d39e[_0x24cc('0x32')][_0x24cc('0x3a')]);_0x40130a[_0x24cc('0x3b')]=qs[_0x24cc('0x33')](_['pick'](_0x18d39e[_0x24cc('0x32')],_0x41e220[_0x24cc('0x33')]));if(_0x18d39e[_0x24cc('0x32')][_0x24cc('0x3e')]){_0x40130a[_0x24cc('0x3b')]=_[_0x24cc('0x3c')](_0x40130a[_0x24cc('0x3b')],{'$or':_[_0x24cc('0x2b')](_0x40130a[_0x24cc('0x35')],function(_0x35ff4a){var _0x183998={};_0x183998[_0x35ff4a]={'$like':'%'+_0x18d39e[_0x24cc('0x32')][_0x24cc('0x3e')]+'%'};return _0x183998;})});}_0x40130a=_['merge']({},_0x40130a,_0x18d39e[_0x24cc('0x3f')]);return _0x473df0['getFields'](_0x40130a);}})[_0x24cc('0x24')](function(_0x1541dc){if(_0x1541dc){_0x3edbfd=_0x1541dc[_0x24cc('0x47')];if(!_0x18d39e[_0x24cc('0x32')][_0x24cc('0x37')](_0x24cc('0x38'))){_0x40130a[_0x24cc('0x1d')]=qs['limit'](_0x18d39e[_0x24cc('0x32')]['limit']);_0x40130a['offset']=qs[_0x24cc('0x1a')](_0x18d39e[_0x24cc('0x32')]['offset']);}return _0x473df0[_0x24cc('0x4d')](_0x40130a);}})['then'](function(_0x8a1544){if(_0x8a1544){return _0x8a1544?{'count':_0x3edbfd,'rows':_0x8a1544}:null;}})['then'](respondWithResult(_0x5a1e52,null))[_0x24cc('0x44')](handleError(_0x5a1e52,null));};exports[_0x24cc('0x4e')]=function(_0xf92ca1,_0x279c6a,_0x28b8cd){var _0x258440={};var _0x29f2e8={};var _0x47599c;var _0xb61e02;return db['DeskConfiguration'][_0x24cc('0x4b')]({'where':{'id':_0xf92ca1[_0x24cc('0x46')]['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x279c6a,null))[_0x24cc('0x24')](function(_0x3c91ea){if(_0x3c91ea){_0x47599c=_0x3c91ea;_0x29f2e8[_0x24cc('0x30')]=_['keys'](db[_0x24cc('0x4c')][_0x24cc('0x2d')]);_0x29f2e8[_0x24cc('0x32')]=_[_0x24cc('0x31')](_0xf92ca1[_0x24cc('0x32')]);_0x29f2e8[_0x24cc('0x33')]=_[_0x24cc('0x34')](_0x29f2e8[_0x24cc('0x30')],_0x29f2e8[_0x24cc('0x32')]);_0x258440[_0x24cc('0x35')]=_['intersection'](_0x29f2e8[_0x24cc('0x30')],qs[_0x24cc('0x36')](_0xf92ca1[_0x24cc('0x32')][_0x24cc('0x36')]));_0x258440[_0x24cc('0x35')]=_0x258440['attributes'][_0x24cc('0x47')]?_0x258440[_0x24cc('0x35')]:_0x29f2e8[_0x24cc('0x30')];_0x258440[_0x24cc('0x39')]=qs[_0x24cc('0x3a')](_0xf92ca1[_0x24cc('0x32')][_0x24cc('0x3a')]);_0x258440[_0x24cc('0x3b')]=qs[_0x24cc('0x33')](_[_0x24cc('0x4f')](_0xf92ca1[_0x24cc('0x32')],_0x29f2e8[_0x24cc('0x33')]));if(_0xf92ca1['query'][_0x24cc('0x3e')]){_0x258440['where']=_['merge'](_0x258440[_0x24cc('0x3b')],{'$or':_[_0x24cc('0x2b')](_0x258440[_0x24cc('0x35')],function(_0x14adfa){var _0x50844d={};_0x50844d[_0x14adfa]={'$like':'%'+_0xf92ca1[_0x24cc('0x32')][_0x24cc('0x3e')]+'%'};return _0x50844d;})});}_0x258440=_[_0x24cc('0x3c')]({},_0x258440,_0xf92ca1[_0x24cc('0x3f')]);return _0x47599c[_0x24cc('0x4e')](_0x258440);}})[_0x24cc('0x24')](function(_0x249b96){if(_0x249b96){_0xb61e02=_0x249b96[_0x24cc('0x47')];if(!_0xf92ca1[_0x24cc('0x32')][_0x24cc('0x37')](_0x24cc('0x38'))){_0x258440[_0x24cc('0x1d')]=qs[_0x24cc('0x1d')](_0xf92ca1['query'][_0x24cc('0x1d')]);_0x258440[_0x24cc('0x1a')]=qs[_0x24cc('0x1a')](_0xf92ca1[_0x24cc('0x32')][_0x24cc('0x1a')]);}return _0x47599c[_0x24cc('0x4e')](_0x258440);}})[_0x24cc('0x24')](function(_0x14565a){if(_0x14565a){return _0x14565a?{'count':_0xb61e02,'rows':_0x14565a}:null;}})[_0x24cc('0x24')](respondWithResult(_0x279c6a,null))['catch'](handleError(_0x279c6a,null));};exports[_0x24cc('0x50')]=function(_0x5f1609,_0x1e3e06,_0x5f04bc){var _0x45c387={};var _0x523e4a={};var _0x3d3c17;var _0x917cc5;return db[_0x24cc('0x2c')][_0x24cc('0x4b')]({'where':{'id':_0x5f1609[_0x24cc('0x46')]['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x1e3e06,null))[_0x24cc('0x24')](function(_0x4b73f1){if(_0x4b73f1){_0x3d3c17=_0x4b73f1;_0x523e4a[_0x24cc('0x30')]=_[_0x24cc('0x31')](db[_0x24cc('0x4c')][_0x24cc('0x2d')]);_0x523e4a[_0x24cc('0x32')]=_[_0x24cc('0x31')](_0x5f1609[_0x24cc('0x32')]);_0x523e4a[_0x24cc('0x33')]=_['intersection'](_0x523e4a[_0x24cc('0x30')],_0x523e4a[_0x24cc('0x32')]);_0x45c387['attributes']=_[_0x24cc('0x34')](_0x523e4a['model'],qs[_0x24cc('0x36')](_0x5f1609[_0x24cc('0x32')][_0x24cc('0x36')]));_0x45c387['attributes']=_0x45c387[_0x24cc('0x35')][_0x24cc('0x47')]?_0x45c387[_0x24cc('0x35')]:_0x523e4a['model'];_0x45c387[_0x24cc('0x39')]=qs[_0x24cc('0x3a')](_0x5f1609['query'][_0x24cc('0x3a')]);_0x45c387[_0x24cc('0x3b')]=qs[_0x24cc('0x33')](_[_0x24cc('0x4f')](_0x5f1609[_0x24cc('0x32')],_0x523e4a[_0x24cc('0x33')]));if(_0x5f1609[_0x24cc('0x32')][_0x24cc('0x3e')]){_0x45c387[_0x24cc('0x3b')]=_['merge'](_0x45c387[_0x24cc('0x3b')],{'$or':_[_0x24cc('0x2b')](_0x45c387['attributes'],function(_0x2f0ab3){var _0x475634={};_0x475634[_0x2f0ab3]={'$like':'%'+_0x5f1609['query']['filter']+'%'};return _0x475634;})});}_0x45c387=_[_0x24cc('0x3c')]({},_0x45c387,_0x5f1609[_0x24cc('0x3f')]);return _0x3d3c17[_0x24cc('0x50')](_0x45c387);}})['then'](function(_0x3673e9){if(_0x3673e9){_0x917cc5=_0x3673e9[_0x24cc('0x47')];if(!_0x5f1609['query'][_0x24cc('0x37')](_0x24cc('0x38'))){_0x45c387[_0x24cc('0x1d')]=qs[_0x24cc('0x1d')](_0x5f1609[_0x24cc('0x32')][_0x24cc('0x1d')]);_0x45c387[_0x24cc('0x1a')]=qs[_0x24cc('0x1a')](_0x5f1609[_0x24cc('0x32')][_0x24cc('0x1a')]);}return _0x3d3c17[_0x24cc('0x50')](_0x45c387);}})[_0x24cc('0x24')](function(_0x5ed9cd){if(_0x5ed9cd){return _0x5ed9cd?{'count':_0x917cc5,'rows':_0x5ed9cd}:null;}})['then'](respondWithResult(_0x1e3e06,null))[_0x24cc('0x44')](handleError(_0x1e3e06,null));};exports[_0x24cc('0x51')]=function(_0x289265,_0x17297a,_0x1c2c64){var _0xfdcc1d={};var _0x21c4c6={};var _0xffa94;var _0x4766bf;return db[_0x24cc('0x2c')][_0x24cc('0x4b')]({'where':{'id':_0x289265['params']['id']}})[_0x24cc('0x24')](handleEntityNotFound(_0x17297a,null))['then'](function(_0x233f81){if(_0x233f81){_0xffa94=_0x233f81;_0x21c4c6[_0x24cc('0x30')]=_[_0x24cc('0x31')](db[_0x24cc('0x52')][_0x24cc('0x2d')]);_0x21c4c6[_0x24cc('0x32')]=_['keys'](_0x289265['query']);_0x21c4c6[_0x24cc('0x33')]=_['intersection'](_0x21c4c6['model'],_0x21c4c6[_0x24cc('0x32')]);_0xfdcc1d[_0x24cc('0x35')]=_[_0x24cc('0x34')](_0x21c4c6[_0x24cc('0x30')],qs[_0x24cc('0x36')](_0x289265[_0x24cc('0x32')][_0x24cc('0x36')]));_0xfdcc1d[_0x24cc('0x35')]=_0xfdcc1d['attributes']['length']?_0xfdcc1d['attributes']:_0x21c4c6[_0x24cc('0x30')];_0xfdcc1d['order']=qs['sort'](_0x289265[_0x24cc('0x32')]['sort']);_0xfdcc1d['where']=qs[_0x24cc('0x33')](_['pick'](_0x289265['query'],_0x21c4c6[_0x24cc('0x33')]));if(_0x289265['query'][_0x24cc('0x3e')]){_0xfdcc1d['where']=_['merge'](_0xfdcc1d[_0x24cc('0x3b')],{'$or':_[_0x24cc('0x2b')](_0xfdcc1d[_0x24cc('0x35')],function(_0x49c60d){var _0x5c790b={};_0x5c790b[_0x49c60d]={'$like':'%'+_0x289265[_0x24cc('0x32')]['filter']+'%'};return _0x5c790b;})});}_0xfdcc1d=_[_0x24cc('0x3c')]({},_0xfdcc1d,_0x289265['options']);return _0xffa94[_0x24cc('0x51')](_0xfdcc1d);}})['then'](function(_0x53edff){if(_0x53edff){_0x4766bf=_0x53edff[_0x24cc('0x47')];if(!_0x289265[_0x24cc('0x32')][_0x24cc('0x37')]('nolimit')){_0xfdcc1d['limit']=qs[_0x24cc('0x1d')](_0x289265[_0x24cc('0x32')][_0x24cc('0x1d')]);_0xfdcc1d[_0x24cc('0x1a')]=qs[_0x24cc('0x1a')](_0x289265[_0x24cc('0x32')][_0x24cc('0x1a')]);}return _0xffa94[_0x24cc('0x51')](_0xfdcc1d);}})[_0x24cc('0x24')](function(_0x3d2179){if(_0x3d2179){return _0x3d2179?{'count':_0x4766bf,'rows':_0x3d2179}:null;}})[_0x24cc('0x24')](respondWithResult(_0x17297a,null))[_0x24cc('0x44')](handleError(_0x17297a,null));};exports[_0x24cc('0x53')]=function(_0x32954b,_0x512918,_0x46a64d){if(_0x32954b[_0x24cc('0x49')]['id']){delete _0x32954b['body']['id'];}return db['DeskConfiguration'][_0x24cc('0x4b')]({'where':{'id':_0x32954b[_0x24cc('0x46')]['id']}})['then'](handleEntityNotFound(_0x512918,null))[_0x24cc('0x24')](function(_0x4c5a56){if(_0x4c5a56){return _0x4c5a56[_0x24cc('0x53')](_0x32954b[_0x24cc('0x49')][_0x24cc('0x54')]||[]);}return null;})[_0x24cc('0x24')](respondWithResult(_0x512918,null))[_0x24cc('0x44')](handleError(_0x512918,null));};
\ No newline at end of file
+var _0x1213=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','DeskConfiguration','includeAll','include','findAll','rows','catch','params','intersection','fields','options','find','create','body','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5c63f9,_0x8a68df){var _0x4dfe6e=function(_0x1f64bd){while(--_0x1f64bd){_0x5c63f9['push'](_0x5c63f9['shift']());}};_0x4dfe6e(++_0x8a68df);}(_0x1213,0xd8));var _0x3121=function(_0x337571,_0x195458){_0x337571=_0x337571-0x0;var _0x57d5fd=_0x1213[_0x337571];return _0x57d5fd;};'use strict';var emlformat=require(_0x3121('0x0'));var rimraf=require(_0x3121('0x1'));var zipdir=require(_0x3121('0x2'));var jsonpatch=require(_0x3121('0x3'));var rp=require(_0x3121('0x4'));var moment=require(_0x3121('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3121('0x6'));var util=require(_0x3121('0x7'));var path=require(_0x3121('0x8'));var sox=require(_0x3121('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3121('0xa'));var crypto=require(_0x3121('0xb'));var jsforce=require(_0x3121('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3121('0xd'));var Papa=require('papaparse');var Redis=require(_0x3121('0xe'));var authService=require(_0x3121('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3121('0x10'));var hardwareService=require(_0x3121('0x11'));var logger=require('../../config/logger')(_0x3121('0x12'));var utils=require(_0x3121('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3121('0x14'));var db=require(_0x3121('0x15'))['db'];function respondWithStatusCode(_0x5a8b78,_0x27679c){_0x27679c=_0x27679c||0xcc;return function(_0x5f595c){if(_0x5f595c){return _0x5a8b78[_0x3121('0x16')](_0x27679c);}return _0x5a8b78[_0x3121('0x17')](_0x27679c)[_0x3121('0x18')]();};}function respondWithResult(_0x586861,_0x4b6a3c){_0x4b6a3c=_0x4b6a3c||0xc8;return function(_0x545f47){if(_0x545f47){return _0x586861['status'](_0x4b6a3c)['json'](_0x545f47);}};}function respondWithFilteredResult(_0x2d8c9d,_0x54efd6){return function(_0x4bb10b){if(_0x4bb10b){var _0x24e677=typeof _0x54efd6[_0x3121('0x19')]===_0x3121('0x1a')&&typeof _0x54efd6[_0x3121('0x1b')]===_0x3121('0x1a');var _0x1e49e1=_0x4bb10b[_0x3121('0x1c')];var _0x47bc46=_0x24e677?0x0:_0x54efd6[_0x3121('0x19')];var _0x571c24=_0x24e677?_0x4bb10b[_0x3121('0x1c')]:_0x54efd6['offset']+_0x54efd6[_0x3121('0x1b')];var _0x4736b2;if(_0x571c24>=_0x1e49e1){_0x571c24=_0x1e49e1;_0x4736b2=0xc8;}else{_0x4736b2=0xce;}_0x2d8c9d[_0x3121('0x17')](_0x4736b2);return _0x2d8c9d[_0x3121('0x1d')](_0x3121('0x1e'),_0x47bc46+'-'+_0x571c24+'/'+_0x1e49e1)[_0x3121('0x1f')](_0x4bb10b);}return null;};}function patchUpdates(_0x217dcb){return function(_0xbf247d){try{jsonpatch[_0x3121('0x20')](_0xbf247d,_0x217dcb,!![]);}catch(_0x24e791){return BPromise[_0x3121('0x21')](_0x24e791);}return _0xbf247d[_0x3121('0x22')]();};}function saveUpdates(_0x424149,_0x4d614d){return function(_0x2fb442){if(_0x2fb442){return _0x2fb442[_0x3121('0x23')](_0x424149)[_0x3121('0x24')](function(_0x2afc5f){return _0x2afc5f;});}return null;};}function removeEntity(_0x1c98eb,_0x5521d9){return function(_0x4cd27a){if(_0x4cd27a){return _0x4cd27a[_0x3121('0x25')]()[_0x3121('0x24')](function(){_0x1c98eb[_0x3121('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4440cb,_0x472fb9){return function(_0x2e2198){if(!_0x2e2198){_0x4440cb[_0x3121('0x16')](0x194);}return _0x2e2198;};}function handleError(_0x49db87,_0x33e6f4){_0x33e6f4=_0x33e6f4||0x1f4;return function(_0x48a1c1){logger[_0x3121('0x26')](_0x48a1c1['stack']);if(_0x48a1c1[_0x3121('0x27')]){delete _0x48a1c1[_0x3121('0x27')];}_0x49db87[_0x3121('0x17')](_0x33e6f4)['send'](_0x48a1c1);};}exports[_0x3121('0x28')]=function(_0x2d37c6,_0x5d2f1b){var _0x471772={},_0x3a71b4={},_0x2a0084={'count':0x0,'rows':[]};var _0x3fef8f=_[_0x3121('0x29')](db['DeskConfiguration'][_0x3121('0x2a')],function(_0x3e0484){return{'name':_0x3e0484[_0x3121('0x2b')],'type':_0x3e0484['type']['key']};});_0x3a71b4[_0x3121('0x2c')]=_[_0x3121('0x29')](_0x3fef8f,_0x3121('0x27'));_0x3a71b4['query']=_[_0x3121('0x2d')](_0x2d37c6[_0x3121('0x2e')]);_0x3a71b4[_0x3121('0x2f')]=_['intersection'](_0x3a71b4[_0x3121('0x2c')],_0x3a71b4[_0x3121('0x2e')]);_0x471772[_0x3121('0x30')]=_['intersection'](_0x3a71b4['model'],qs['fields'](_0x2d37c6[_0x3121('0x2e')]['fields']));_0x471772[_0x3121('0x30')]=_0x471772['attributes'][_0x3121('0x31')]?_0x471772[_0x3121('0x30')]:_0x3a71b4[_0x3121('0x2c')];if(!_0x2d37c6[_0x3121('0x2e')][_0x3121('0x32')](_0x3121('0x33'))){_0x471772[_0x3121('0x1b')]=qs[_0x3121('0x1b')](_0x2d37c6['query'][_0x3121('0x1b')]);_0x471772['offset']=qs['offset'](_0x2d37c6[_0x3121('0x2e')]['offset']);}_0x471772[_0x3121('0x34')]=qs[_0x3121('0x35')](_0x2d37c6[_0x3121('0x2e')][_0x3121('0x35')]);_0x471772['where']=qs['filters'](_[_0x3121('0x36')](_0x2d37c6[_0x3121('0x2e')],_0x3a71b4[_0x3121('0x2f')]),_0x3fef8f);if(_0x2d37c6[_0x3121('0x2e')][_0x3121('0x37')]){_0x471772[_0x3121('0x38')]=_[_0x3121('0x39')](_0x471772[_0x3121('0x38')],{'$or':_[_0x3121('0x29')](_0x3fef8f,function(_0x2ac161){if(_0x2ac161[_0x3121('0x3a')]!=='VIRTUAL'){var _0x34df1b={};_0x34df1b[_0x2ac161[_0x3121('0x27')]]={'$like':'%'+_0x2d37c6[_0x3121('0x2e')][_0x3121('0x37')]+'%'};return _0x34df1b;}})});}_0x471772=_[_0x3121('0x39')]({},_0x471772,_0x2d37c6['options']);var _0x2c9e4e={'where':_0x471772['where']};return db[_0x3121('0x3b')][_0x3121('0x1c')](_0x2c9e4e)['then'](function(_0x838e28){_0x2a0084[_0x3121('0x1c')]=_0x838e28;if(_0x2d37c6[_0x3121('0x2e')][_0x3121('0x3c')]){_0x471772[_0x3121('0x3d')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x3121('0x3e')](_0x471772);})[_0x3121('0x24')](function(_0x15f996){_0x2a0084[_0x3121('0x3f')]=_0x15f996;return _0x2a0084;})[_0x3121('0x24')](respondWithFilteredResult(_0x5d2f1b,_0x471772))[_0x3121('0x40')](handleError(_0x5d2f1b,null));};exports['show']=function(_0x4075fb,_0x2aa693){var _0x3b68f3={'raw':![],'where':{'id':_0x4075fb[_0x3121('0x41')]['id']}},_0x4ff5be={};_0x4ff5be['model']=_[_0x3121('0x2d')](db[_0x3121('0x3b')][_0x3121('0x2a')]);_0x4ff5be['query']=_[_0x3121('0x2d')](_0x4075fb[_0x3121('0x2e')]);_0x4ff5be[_0x3121('0x2f')]=_['intersection'](_0x4ff5be[_0x3121('0x2c')],_0x4ff5be[_0x3121('0x2e')]);_0x3b68f3[_0x3121('0x30')]=_[_0x3121('0x42')](_0x4ff5be[_0x3121('0x2c')],qs[_0x3121('0x43')](_0x4075fb[_0x3121('0x2e')]['fields']));_0x3b68f3['attributes']=_0x3b68f3['attributes']['length']?_0x3b68f3[_0x3121('0x30')]:_0x4ff5be[_0x3121('0x2c')];if(_0x4075fb[_0x3121('0x2e')][_0x3121('0x3c')]){_0x3b68f3[_0x3121('0x3d')]=[{'all':!![]}];}_0x3b68f3=_['merge']({},_0x3b68f3,_0x4075fb[_0x3121('0x44')]);return db[_0x3121('0x3b')][_0x3121('0x45')](_0x3b68f3)[_0x3121('0x24')](handleEntityNotFound(_0x2aa693,null))[_0x3121('0x24')](respondWithResult(_0x2aa693,null))[_0x3121('0x40')](handleError(_0x2aa693,null));};exports[_0x3121('0x46')]=function(_0x1088f3,_0x59d2e8){return db['DeskConfiguration'][_0x3121('0x46')](_0x1088f3[_0x3121('0x47')],{})[_0x3121('0x24')](respondWithResult(_0x59d2e8,0xc9))[_0x3121('0x40')](handleError(_0x59d2e8,null));};exports[_0x3121('0x23')]=function(_0x18042b,_0xe4a4aa){if(_0x18042b['body']['id']){delete _0x18042b[_0x3121('0x47')]['id'];}return db[_0x3121('0x3b')][_0x3121('0x45')]({'where':{'id':_0x18042b[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0xe4a4aa,null))[_0x3121('0x24')](saveUpdates(_0x18042b[_0x3121('0x47')],null))[_0x3121('0x24')](respondWithResult(_0xe4a4aa,null))['catch'](handleError(_0xe4a4aa,null));};exports[_0x3121('0x25')]=function(_0x105b0d,_0x183670){return db[_0x3121('0x3b')][_0x3121('0x45')]({'where':{'id':_0x105b0d[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0x183670,null))[_0x3121('0x24')](removeEntity(_0x183670,null))['catch'](handleError(_0x183670,null));};exports[_0x3121('0x48')]=function(_0x5a9b31,_0x347a05,_0x3bbcf3){var _0x449c2c={};var _0x544d68={};var _0x1e2b08;var _0x18874f;return db['DeskConfiguration'][_0x3121('0x49')]({'where':{'id':_0x5a9b31[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0x347a05,null))[_0x3121('0x24')](function(_0x4a7d5f){if(_0x4a7d5f){_0x1e2b08=_0x4a7d5f;_0x544d68[_0x3121('0x2c')]=_['keys'](db[_0x3121('0x4a')][_0x3121('0x2a')]);_0x544d68[_0x3121('0x2e')]=_[_0x3121('0x2d')](_0x5a9b31[_0x3121('0x2e')]);_0x544d68[_0x3121('0x2f')]=_[_0x3121('0x42')](_0x544d68[_0x3121('0x2c')],_0x544d68['query']);_0x449c2c['attributes']=_[_0x3121('0x42')](_0x544d68[_0x3121('0x2c')],qs[_0x3121('0x43')](_0x5a9b31[_0x3121('0x2e')][_0x3121('0x43')]));_0x449c2c['attributes']=_0x449c2c[_0x3121('0x30')][_0x3121('0x31')]?_0x449c2c[_0x3121('0x30')]:_0x544d68[_0x3121('0x2c')];_0x449c2c[_0x3121('0x34')]=qs[_0x3121('0x35')](_0x5a9b31[_0x3121('0x2e')][_0x3121('0x35')]);_0x449c2c[_0x3121('0x38')]=qs[_0x3121('0x2f')](_[_0x3121('0x36')](_0x5a9b31[_0x3121('0x2e')],_0x544d68['filters']));if(_0x5a9b31[_0x3121('0x2e')][_0x3121('0x37')]){_0x449c2c[_0x3121('0x38')]=_['merge'](_0x449c2c[_0x3121('0x38')],{'$or':_[_0x3121('0x29')](_0x449c2c[_0x3121('0x30')],function(_0x141b9d){var _0x5aa60a={};_0x5aa60a[_0x141b9d]={'$like':'%'+_0x5a9b31[_0x3121('0x2e')]['filter']+'%'};return _0x5aa60a;})});}_0x449c2c=_[_0x3121('0x39')]({},_0x449c2c,_0x5a9b31[_0x3121('0x44')]);return _0x1e2b08[_0x3121('0x48')](_0x449c2c);}})[_0x3121('0x24')](function(_0x27ed6c){if(_0x27ed6c){_0x18874f=_0x27ed6c[_0x3121('0x31')];if(!_0x5a9b31['query'][_0x3121('0x32')](_0x3121('0x33'))){_0x449c2c[_0x3121('0x1b')]=qs['limit'](_0x5a9b31[_0x3121('0x2e')]['limit']);_0x449c2c[_0x3121('0x19')]=qs[_0x3121('0x19')](_0x5a9b31[_0x3121('0x2e')][_0x3121('0x19')]);}return _0x1e2b08['getFields'](_0x449c2c);}})['then'](function(_0xabf88b){if(_0xabf88b){return _0xabf88b?{'count':_0x18874f,'rows':_0xabf88b}:null;}})[_0x3121('0x24')](respondWithResult(_0x347a05,null))['catch'](handleError(_0x347a05,null));};exports['getSubjects']=function(_0x5bef27,_0x57eefb,_0x2d8118){var _0x5a18ad={};var _0x326168={};var _0xc8c326;var _0x397376;return db[_0x3121('0x3b')]['findOne']({'where':{'id':_0x5bef27[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0x57eefb,null))[_0x3121('0x24')](function(_0x2a7ad9){if(_0x2a7ad9){_0xc8c326=_0x2a7ad9;_0x326168['model']=_[_0x3121('0x2d')](db[_0x3121('0x4a')][_0x3121('0x2a')]);_0x326168[_0x3121('0x2e')]=_[_0x3121('0x2d')](_0x5bef27[_0x3121('0x2e')]);_0x326168[_0x3121('0x2f')]=_[_0x3121('0x42')](_0x326168[_0x3121('0x2c')],_0x326168['query']);_0x5a18ad[_0x3121('0x30')]=_[_0x3121('0x42')](_0x326168[_0x3121('0x2c')],qs['fields'](_0x5bef27['query'][_0x3121('0x43')]));_0x5a18ad[_0x3121('0x30')]=_0x5a18ad[_0x3121('0x30')][_0x3121('0x31')]?_0x5a18ad[_0x3121('0x30')]:_0x326168[_0x3121('0x2c')];_0x5a18ad[_0x3121('0x34')]=qs[_0x3121('0x35')](_0x5bef27['query'][_0x3121('0x35')]);_0x5a18ad[_0x3121('0x38')]=qs[_0x3121('0x2f')](_[_0x3121('0x36')](_0x5bef27['query'],_0x326168[_0x3121('0x2f')]));if(_0x5bef27[_0x3121('0x2e')][_0x3121('0x37')]){_0x5a18ad[_0x3121('0x38')]=_[_0x3121('0x39')](_0x5a18ad[_0x3121('0x38')],{'$or':_[_0x3121('0x29')](_0x5a18ad[_0x3121('0x30')],function(_0x5ea449){var _0x112e3e={};_0x112e3e[_0x5ea449]={'$like':'%'+_0x5bef27['query'][_0x3121('0x37')]+'%'};return _0x112e3e;})});}_0x5a18ad=_[_0x3121('0x39')]({},_0x5a18ad,_0x5bef27[_0x3121('0x44')]);return _0xc8c326[_0x3121('0x4b')](_0x5a18ad);}})['then'](function(_0x21c5d3){if(_0x21c5d3){_0x397376=_0x21c5d3['length'];if(!_0x5bef27[_0x3121('0x2e')][_0x3121('0x32')](_0x3121('0x33'))){_0x5a18ad[_0x3121('0x1b')]=qs['limit'](_0x5bef27[_0x3121('0x2e')]['limit']);_0x5a18ad[_0x3121('0x19')]=qs[_0x3121('0x19')](_0x5bef27[_0x3121('0x2e')][_0x3121('0x19')]);}return _0xc8c326[_0x3121('0x4b')](_0x5a18ad);}})['then'](function(_0xdfc71a){if(_0xdfc71a){return _0xdfc71a?{'count':_0x397376,'rows':_0xdfc71a}:null;}})[_0x3121('0x24')](respondWithResult(_0x57eefb,null))[_0x3121('0x40')](handleError(_0x57eefb,null));};exports[_0x3121('0x4c')]=function(_0x708a3,_0x58e2de,_0x5a36c7){var _0x53931b={};var _0x5c6902={};var _0x43f115;var _0x3578bb;return db[_0x3121('0x3b')]['findOne']({'where':{'id':_0x708a3[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0x58e2de,null))[_0x3121('0x24')](function(_0x332e1b){if(_0x332e1b){_0x43f115=_0x332e1b;_0x5c6902[_0x3121('0x2c')]=_[_0x3121('0x2d')](db[_0x3121('0x4a')][_0x3121('0x2a')]);_0x5c6902[_0x3121('0x2e')]=_[_0x3121('0x2d')](_0x708a3[_0x3121('0x2e')]);_0x5c6902['filters']=_[_0x3121('0x42')](_0x5c6902[_0x3121('0x2c')],_0x5c6902[_0x3121('0x2e')]);_0x53931b['attributes']=_[_0x3121('0x42')](_0x5c6902[_0x3121('0x2c')],qs[_0x3121('0x43')](_0x708a3[_0x3121('0x2e')][_0x3121('0x43')]));_0x53931b[_0x3121('0x30')]=_0x53931b[_0x3121('0x30')]['length']?_0x53931b[_0x3121('0x30')]:_0x5c6902[_0x3121('0x2c')];_0x53931b[_0x3121('0x34')]=qs['sort'](_0x708a3[_0x3121('0x2e')][_0x3121('0x35')]);_0x53931b[_0x3121('0x38')]=qs['filters'](_[_0x3121('0x36')](_0x708a3[_0x3121('0x2e')],_0x5c6902[_0x3121('0x2f')]));if(_0x708a3[_0x3121('0x2e')][_0x3121('0x37')]){_0x53931b[_0x3121('0x38')]=_[_0x3121('0x39')](_0x53931b[_0x3121('0x38')],{'$or':_[_0x3121('0x29')](_0x53931b['attributes'],function(_0x2f9753){var _0x1553dd={};_0x1553dd[_0x2f9753]={'$like':'%'+_0x708a3[_0x3121('0x2e')][_0x3121('0x37')]+'%'};return _0x1553dd;})});}_0x53931b=_[_0x3121('0x39')]({},_0x53931b,_0x708a3[_0x3121('0x44')]);return _0x43f115[_0x3121('0x4c')](_0x53931b);}})[_0x3121('0x24')](function(_0x3ea94b){if(_0x3ea94b){_0x3578bb=_0x3ea94b[_0x3121('0x31')];if(!_0x708a3['query'][_0x3121('0x32')](_0x3121('0x33'))){_0x53931b[_0x3121('0x1b')]=qs[_0x3121('0x1b')](_0x708a3[_0x3121('0x2e')]['limit']);_0x53931b[_0x3121('0x19')]=qs[_0x3121('0x19')](_0x708a3[_0x3121('0x2e')]['offset']);}return _0x43f115['getDescriptions'](_0x53931b);}})['then'](function(_0x34c39b){if(_0x34c39b){return _0x34c39b?{'count':_0x3578bb,'rows':_0x34c39b}:null;}})[_0x3121('0x24')](respondWithResult(_0x58e2de,null))['catch'](handleError(_0x58e2de,null));};exports[_0x3121('0x4d')]=function(_0xaf2445,_0x2ace29,_0x542be1){var _0x26609f={};var _0x176147={};var _0x49c75b;var _0x2a603d;return db[_0x3121('0x3b')][_0x3121('0x49')]({'where':{'id':_0xaf2445['params']['id']}})['then'](handleEntityNotFound(_0x2ace29,null))[_0x3121('0x24')](function(_0x12bda2){if(_0x12bda2){_0x49c75b=_0x12bda2;_0x176147[_0x3121('0x2c')]=_[_0x3121('0x2d')](db[_0x3121('0x4e')][_0x3121('0x2a')]);_0x176147[_0x3121('0x2e')]=_[_0x3121('0x2d')](_0xaf2445[_0x3121('0x2e')]);_0x176147['filters']=_[_0x3121('0x42')](_0x176147['model'],_0x176147[_0x3121('0x2e')]);_0x26609f['attributes']=_[_0x3121('0x42')](_0x176147[_0x3121('0x2c')],qs['fields'](_0xaf2445[_0x3121('0x2e')]['fields']));_0x26609f[_0x3121('0x30')]=_0x26609f[_0x3121('0x30')][_0x3121('0x31')]?_0x26609f[_0x3121('0x30')]:_0x176147[_0x3121('0x2c')];_0x26609f[_0x3121('0x34')]=qs[_0x3121('0x35')](_0xaf2445['query'][_0x3121('0x35')]);_0x26609f[_0x3121('0x38')]=qs[_0x3121('0x2f')](_[_0x3121('0x36')](_0xaf2445[_0x3121('0x2e')],_0x176147[_0x3121('0x2f')]));if(_0xaf2445[_0x3121('0x2e')][_0x3121('0x37')]){_0x26609f[_0x3121('0x38')]=_[_0x3121('0x39')](_0x26609f[_0x3121('0x38')],{'$or':_[_0x3121('0x29')](_0x26609f[_0x3121('0x30')],function(_0x34b86a){var _0x44fd60={};_0x44fd60[_0x34b86a]={'$like':'%'+_0xaf2445[_0x3121('0x2e')][_0x3121('0x37')]+'%'};return _0x44fd60;})});}_0x26609f=_[_0x3121('0x39')]({},_0x26609f,_0xaf2445[_0x3121('0x44')]);return _0x49c75b[_0x3121('0x4d')](_0x26609f);}})[_0x3121('0x24')](function(_0x226e45){if(_0x226e45){_0x2a603d=_0x226e45[_0x3121('0x31')];if(!_0xaf2445[_0x3121('0x2e')][_0x3121('0x32')](_0x3121('0x33'))){_0x26609f[_0x3121('0x1b')]=qs[_0x3121('0x1b')](_0xaf2445[_0x3121('0x2e')][_0x3121('0x1b')]);_0x26609f[_0x3121('0x19')]=qs[_0x3121('0x19')](_0xaf2445[_0x3121('0x2e')][_0x3121('0x19')]);}return _0x49c75b[_0x3121('0x4d')](_0x26609f);}})[_0x3121('0x24')](function(_0x4e705a){if(_0x4e705a){return _0x4e705a?{'count':_0x2a603d,'rows':_0x4e705a}:null;}})[_0x3121('0x24')](respondWithResult(_0x2ace29,null))[_0x3121('0x40')](handleError(_0x2ace29,null));};exports[_0x3121('0x4f')]=function(_0x3bd3e9,_0x1df6c8,_0x48ff76){if(_0x3bd3e9[_0x3121('0x47')]['id']){delete _0x3bd3e9[_0x3121('0x47')]['id'];}return db[_0x3121('0x3b')][_0x3121('0x49')]({'where':{'id':_0x3bd3e9[_0x3121('0x41')]['id']}})[_0x3121('0x24')](handleEntityNotFound(_0x1df6c8,null))[_0x3121('0x24')](function(_0x24acb8){if(_0x24acb8){return _0x24acb8[_0x3121('0x4f')](_0x3bd3e9['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x1df6c8,null))['catch'](handleError(_0x1df6c8,null));};
\ No newline at end of file
index 3381142..6729ea6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aba=['moment','bluebird','path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','api'];(function(_0x4c7149,_0x335342){var _0x200122=function(_0x358259){while(--_0x358259){_0x4c7149['push'](_0x4c7149['shift']());}};_0x200122(++_0x335342);}(_0x4aba,0x15c));var _0xa4ab=function(_0x29edcd,_0x344af1){_0x29edcd=_0x29edcd-0x0;var _0x26b042=_0x4aba[_0x29edcd];return _0x26b042;};'use strict';var _=require(_0xa4ab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa4ab('0x1'));var moment=require(_0xa4ab('0x2'));var BPromise=require(_0xa4ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa4ab('0x4'));var rimraf=require(_0xa4ab('0x5'));var config=require('../../config/environment');var attributes=require(_0xa4ab('0x6'));module['exports']=function(_0x5e534e,_0x521956){return _0x5e534e[_0xa4ab('0x7')](_0xa4ab('0x8'),attributes,{'tableName':_0xa4ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x404b=['../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x404b,0x68));var _0xb404=function(_0x53883d,_0x4ceeb8){_0x53883d=_0x53883d-0x0;var _0x2200b0=_0x404b[_0x53883d];return _0x2200b0;};'use strict';var _=require(_0xb404('0x0'));var util=require(_0xb404('0x1'));var logger=require(_0xb404('0x2'))(_0xb404('0x3'));var moment=require(_0xb404('0x4'));var BPromise=require(_0xb404('0x5'));var rp=require(_0xb404('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb404('0x7'));var config=require(_0xb404('0x8'));var attributes=require(_0xb404('0x9'));module[_0xb404('0xa')]=function(_0x2f473d,_0x159381){return _0x2f473d[_0xb404('0xb')](_0xb404('0xc'),attributes,{'tableName':_0xb404('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 025eff7..866431f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['stringify','error','code','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x196028,_0x3444a8){var _0x32a5b4=function(_0x85a947){while(--_0x85a947){_0x196028['push'](_0x196028['shift']());}};_0x32a5b4(++_0x3444a8);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}
\ No newline at end of file
+var _0x5323=['../../config/environment','jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33f54b,_0x41df7d){var _0x191255=function(_0x1c4faf){while(--_0x1c4faf){_0x33f54b['push'](_0x33f54b['shift']());}};_0x191255(++_0x41df7d);}(_0x5323,0x88));var _0x3532=function(_0x207665,_0x282dd7){_0x207665=_0x207665-0x0;var _0x1313eb=_0x5323[_0x207665];return _0x1313eb;};'use strict';var _=require(_0x3532('0x0'));var util=require(_0x3532('0x1'));var moment=require(_0x3532('0x2'));var BPromise=require(_0x3532('0x3'));var rs=require(_0x3532('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3532('0x5'))['db'];var utils=require(_0x3532('0x6'));var logger=require(_0x3532('0x7'))('rpc');var config=require(_0x3532('0x8'));var jayson=require(_0x3532('0x9'));var client=jayson[_0x3532('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f7668,_0x5deeac,_0x2f5cb8){return new BPromise(function(_0x5ea44f,_0x313f83){return client[_0x3532('0xb')](_0x3f7668,_0x2f5cb8)['then'](function(_0x1cb1d4){logger[_0x3532('0xc')](_0x3532('0xd'),_0x5deeac,_0x3532('0xe'));logger['debug']('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5deeac,'request\x20sent',JSON['stringify'](_0x1cb1d4));if(_0x1cb1d4[_0x3532('0xf')]){if(_0x1cb1d4['error']['code']===0x1f4){logger[_0x3532('0xf')](_0x3532('0xd'),_0x5deeac,_0x1cb1d4[_0x3532('0xf')]['message']);return _0x313f83(_0x1cb1d4[_0x3532('0xf')][_0x3532('0x10')]);}logger['error'](_0x3532('0xd'),_0x5deeac,_0x1cb1d4[_0x3532('0xf')][_0x3532('0x10')]);return _0x5ea44f(_0x1cb1d4[_0x3532('0xf')]['message']);}else{logger[_0x3532('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x5deeac,'request\x20sent');_0x5ea44f(_0x1cb1d4[_0x3532('0x11')][_0x3532('0x10')]);}})['catch'](function(_0xf1cfb4){logger[_0x3532('0xf')](_0x3532('0xd'),_0x5deeac,_0xf1cfb4);_0x313f83(_0xf1cfb4);});});}
\ No newline at end of file
index bc3fb41..6a96013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e39=['../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2eed5a,_0x4cbf4a){var _0x51d67d=function(_0x55c85a){while(--_0x55c85a){_0x2eed5a['push'](_0x2eed5a['shift']());}};_0x51d67d(++_0x4cbf4a);}(_0x1e39,0xc2));var _0x91e3=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0x1e39[_0xea8947];return _0x2455e9;};'use strict';var multer=require('multer');var util=require(_0x91e3('0x0'));var path=require(_0x91e3('0x1'));var timeout=require(_0x91e3('0x2'));var express=require(_0x91e3('0x3'));var router=express['Router']();var fs_extra=require(_0x91e3('0x4'));var auth=require(_0x91e3('0x5'));var interaction=require(_0x91e3('0x6'));var config=require('../../config/environment');var controller=require(_0x91e3('0x7'));router[_0x91e3('0x8')]('/',auth[_0x91e3('0x9')](),controller[_0x91e3('0xa')]);router[_0x91e3('0x8')](_0x91e3('0xb'),auth[_0x91e3('0x9')](),controller[_0x91e3('0xc')]);router[_0x91e3('0xd')]('/',auth[_0x91e3('0x9')](),controller[_0x91e3('0xe')]);router[_0x91e3('0xf')](_0x91e3('0xb'),auth[_0x91e3('0x9')](),controller[_0x91e3('0x10')]);router[_0x91e3('0x11')](_0x91e3('0xb'),auth[_0x91e3('0x9')](),controller[_0x91e3('0x12')]);module[_0x91e3('0x13')]=router;
\ No newline at end of file
+var _0x6ce4=['isAuthenticated','index','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get'];(function(_0x5b8f75,_0x30ee13){var _0x3643b7=function(_0x4835f7){while(--_0x4835f7){_0x5b8f75['push'](_0x5b8f75['shift']());}};_0x3643b7(++_0x30ee13);}(_0x6ce4,0x87));var _0x46ce=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6ce4[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x46ce('0x0'));var util=require(_0x46ce('0x1'));var path=require(_0x46ce('0x2'));var timeout=require(_0x46ce('0x3'));var express=require(_0x46ce('0x4'));var router=express[_0x46ce('0x5')]();var fs_extra=require(_0x46ce('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x46ce('0x7'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x46ce('0x8')]('/',auth[_0x46ce('0x9')](),controller[_0x46ce('0xa')]);router[_0x46ce('0x8')](_0x46ce('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x46ce('0x9')](),controller[_0x46ce('0xc')]);router[_0x46ce('0xd')]('/:id',auth[_0x46ce('0x9')](),controller[_0x46ce('0xe')]);router[_0x46ce('0xf')](_0x46ce('0xb'),auth[_0x46ce('0x9')](),controller[_0x46ce('0x10')]);module[_0x46ce('0x11')]=router;
\ No newline at end of file
index 5fc1ad2..11a8a97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41ef=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','exports'];(function(_0x40a30e,_0x38eb63){var _0x475bb3=function(_0x161e0a){while(--_0x161e0a){_0x40a30e['push'](_0x40a30e['shift']());}};_0x475bb3(++_0x38eb63);}(_0x41ef,0x16f));var _0xf41e=function(_0x5457c7,_0xd61d20){_0x5457c7=_0x5457c7-0x0;var _0x5a7840=_0x41ef[_0x5457c7];return _0x5a7840;};'use strict';var Sequelize=require('sequelize');module[_0xf41e('0x0')]={'type':{'type':Sequelize[_0xf41e('0x1')](_0xf41e('0x2'),_0xf41e('0x3'),_0xf41e('0x4'),_0xf41e('0x5'),'picklist'),'defaultValue':_0xf41e('0x2')},'content':{'type':Sequelize[_0xf41e('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf41e('0x1')]('string',_0xf41e('0x3'),_0xf41e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf41e('0x6')]},'nameField':{'type':Sequelize[_0xf41e('0x6')]},'customField':{'type':Sequelize[_0xf41e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd1aa=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x38711e,_0x4c5d5d){var _0x30c5e9=function(_0x3337f4){while(--_0x3337f4){_0x38711e['push'](_0x38711e['shift']());}};_0x30c5e9(++_0x4c5d5d);}(_0xd1aa,0xaf));var _0xad1a=function(_0xabbd2f,_0x44d05a){_0xabbd2f=_0xabbd2f-0x0;var _0x34a040=_0xd1aa[_0xabbd2f];return _0x34a040;};'use strict';var Sequelize=require(_0xad1a('0x0'));module[_0xad1a('0x1')]={'type':{'type':Sequelize[_0xad1a('0x2')](_0xad1a('0x3'),_0xad1a('0x4'),'customVariable',_0xad1a('0x5'),_0xad1a('0x6')),'defaultValue':_0xad1a('0x3')},'content':{'type':Sequelize[_0xad1a('0x7')]},'key':{'type':Sequelize[_0xad1a('0x7')]},'keyType':{'type':Sequelize[_0xad1a('0x2')](_0xad1a('0x3'),_0xad1a('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xad1a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a33188f..408e0a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a0e=['order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','end','sendStatus','error','stack','name','index','map','DeskField','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit'];(function(_0x3987a1,_0x447793){var _0xe2596e=function(_0x546925){while(--_0x546925){_0x3987a1['push'](_0x3987a1['shift']());}};_0xe2596e(++_0x447793);}(_0x1a0e,0x1c6));var _0xe1a0=function(_0x3dd23c,_0x18c32f){_0x3dd23c=_0x3dd23c-0x0;var _0x520bf8=_0x1a0e[_0x3dd23c];return _0x520bf8;};'use strict';var emlformat=require(_0xe1a0('0x0'));var rimraf=require(_0xe1a0('0x1'));var zipdir=require(_0xe1a0('0x2'));var jsonpatch=require(_0xe1a0('0x3'));var rp=require(_0xe1a0('0x4'));var moment=require(_0xe1a0('0x5'));var BPromise=require(_0xe1a0('0x6'));var Mustache=require('mustache');var util=require(_0xe1a0('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe1a0('0x8'));var fs=require('fs');var fs_extra=require(_0xe1a0('0x9'));var _=require(_0xe1a0('0xa'));var squel=require(_0xe1a0('0xb'));var crypto=require(_0xe1a0('0xc'));var jsforce=require(_0xe1a0('0xd'));var deskjs=require(_0xe1a0('0xe'));var toCsv=require(_0xe1a0('0xf'));var querystring=require(_0xe1a0('0x10'));var Papa=require(_0xe1a0('0x11'));var Redis=require(_0xe1a0('0x12'));var authService=require(_0xe1a0('0x13'));var qs=require(_0xe1a0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1a0('0x15'));var logger=require('../../config/logger')(_0xe1a0('0x16'));var utils=require(_0xe1a0('0x17'));var config=require(_0xe1a0('0x18'));var licenseUtil=require(_0xe1a0('0x19'));var db=require(_0xe1a0('0x1a'))['db'];function respondWithStatusCode(_0x3550bc,_0x2ea844){_0x2ea844=_0x2ea844||0xcc;return function(_0x46c37d){if(_0x46c37d){return _0x3550bc['sendStatus'](_0x2ea844);}return _0x3550bc[_0xe1a0('0x1b')](_0x2ea844)['end']();};}function respondWithResult(_0xc6abc0,_0x451523){_0x451523=_0x451523||0xc8;return function(_0x4afad5){if(_0x4afad5){return _0xc6abc0[_0xe1a0('0x1b')](_0x451523)[_0xe1a0('0x1c')](_0x4afad5);}};}function respondWithFilteredResult(_0x1803ee,_0x4080fd){return function(_0x2255ae){if(_0x2255ae){var _0x485798=typeof _0x4080fd[_0xe1a0('0x1d')]===_0xe1a0('0x1e')&&typeof _0x4080fd[_0xe1a0('0x1f')]===_0xe1a0('0x1e');var _0x25d695=_0x2255ae[_0xe1a0('0x20')];var _0x40856a=_0x485798?0x0:_0x4080fd[_0xe1a0('0x1d')];var _0x3148ad=_0x485798?_0x2255ae[_0xe1a0('0x20')]:_0x4080fd[_0xe1a0('0x1d')]+_0x4080fd[_0xe1a0('0x1f')];var _0x47ebf1;if(_0x3148ad>=_0x25d695){_0x3148ad=_0x25d695;_0x47ebf1=0xc8;}else{_0x47ebf1=0xce;}_0x1803ee['status'](_0x47ebf1);return _0x1803ee['set'](_0xe1a0('0x21'),_0x40856a+'-'+_0x3148ad+'/'+_0x25d695)[_0xe1a0('0x1c')](_0x2255ae);}return null;};}function patchUpdates(_0x2e107f){return function(_0x185a44){try{jsonpatch['apply'](_0x185a44,_0x2e107f,!![]);}catch(_0xbcc33d){return BPromise[_0xe1a0('0x22')](_0xbcc33d);}return _0x185a44['save']();};}function saveUpdates(_0x167244,_0x404f43){return function(_0x52483b){if(_0x52483b){return _0x52483b[_0xe1a0('0x23')](_0x167244)[_0xe1a0('0x24')](function(_0x8cd788){return _0x8cd788;});}return null;};}function removeEntity(_0x15615f,_0x180b77){return function(_0x54b7b6){if(_0x54b7b6){return _0x54b7b6[_0xe1a0('0x25')]()[_0xe1a0('0x24')](function(){_0x15615f['status'](0xcc)[_0xe1a0('0x26')]();});}};}function handleEntityNotFound(_0x249f15,_0xbc575b){return function(_0x2b5100){if(!_0x2b5100){_0x249f15[_0xe1a0('0x27')](0x194);}return _0x2b5100;};}function handleError(_0x476bef,_0x30b763){_0x30b763=_0x30b763||0x1f4;return function(_0x1351a4){logger[_0xe1a0('0x28')](_0x1351a4[_0xe1a0('0x29')]);if(_0x1351a4[_0xe1a0('0x2a')]){delete _0x1351a4[_0xe1a0('0x2a')];}_0x476bef['status'](_0x30b763)['send'](_0x1351a4);};}exports[_0xe1a0('0x2b')]=function(_0x45fd73,_0x47edf4){var _0x300101={},_0x177337={},_0x3e8149={'count':0x0,'rows':[]};var _0x5050d4=_[_0xe1a0('0x2c')](db[_0xe1a0('0x2d')][_0xe1a0('0x2e')],function(_0x312c96){return{'name':_0x312c96['fieldName'],'type':_0x312c96[_0xe1a0('0x2f')]['key']};});_0x177337[_0xe1a0('0x30')]=_['map'](_0x5050d4,_0xe1a0('0x2a'));_0x177337[_0xe1a0('0x31')]=_[_0xe1a0('0x32')](_0x45fd73[_0xe1a0('0x31')]);_0x177337['filters']=_['intersection'](_0x177337[_0xe1a0('0x30')],_0x177337[_0xe1a0('0x31')]);_0x300101[_0xe1a0('0x33')]=_[_0xe1a0('0x34')](_0x177337[_0xe1a0('0x30')],qs[_0xe1a0('0x35')](_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x35')]));_0x300101['attributes']=_0x300101['attributes'][_0xe1a0('0x36')]?_0x300101[_0xe1a0('0x33')]:_0x177337[_0xe1a0('0x30')];if(!_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x37')](_0xe1a0('0x38'))){_0x300101[_0xe1a0('0x1f')]=qs[_0xe1a0('0x1f')](_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x1f')]);_0x300101[_0xe1a0('0x1d')]=qs[_0xe1a0('0x1d')](_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x1d')]);}_0x300101[_0xe1a0('0x39')]=qs[_0xe1a0('0x3a')](_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x3a')]);_0x300101['where']=qs[_0xe1a0('0x3b')](_[_0xe1a0('0x3c')](_0x45fd73[_0xe1a0('0x31')],_0x177337[_0xe1a0('0x3b')]),_0x5050d4);if(_0x45fd73[_0xe1a0('0x31')][_0xe1a0('0x3d')]){_0x300101[_0xe1a0('0x3e')]=_[_0xe1a0('0x3f')](_0x300101[_0xe1a0('0x3e')],{'$or':_[_0xe1a0('0x2c')](_0x5050d4,function(_0x4a1c22){if(_0x4a1c22[_0xe1a0('0x2f')]!=='VIRTUAL'){var _0x545d2a={};_0x545d2a[_0x4a1c22[_0xe1a0('0x2a')]]={'$like':'%'+_0x45fd73['query'][_0xe1a0('0x3d')]+'%'};return _0x545d2a;}})});}_0x300101=_['merge']({},_0x300101,_0x45fd73[_0xe1a0('0x40')]);var _0x591266={'where':_0x300101[_0xe1a0('0x3e')]};return db[_0xe1a0('0x2d')][_0xe1a0('0x20')](_0x591266)[_0xe1a0('0x24')](function(_0x4720d4){_0x3e8149['count']=_0x4720d4;if(_0x45fd73['query'][_0xe1a0('0x41')]){_0x300101[_0xe1a0('0x42')]=[{'all':!![]}];}return db[_0xe1a0('0x2d')][_0xe1a0('0x43')](_0x300101);})[_0xe1a0('0x24')](function(_0x39d07c){_0x3e8149[_0xe1a0('0x44')]=_0x39d07c;return _0x3e8149;})[_0xe1a0('0x24')](respondWithFilteredResult(_0x47edf4,_0x300101))[_0xe1a0('0x45')](handleError(_0x47edf4,null));};exports['show']=function(_0x4a462f,_0x560dd0){var _0xe1b09b={'raw':!![],'where':{'id':_0x4a462f[_0xe1a0('0x46')]['id']}},_0x13ce83={};_0x13ce83[_0xe1a0('0x30')]=_['keys'](db[_0xe1a0('0x2d')][_0xe1a0('0x2e')]);_0x13ce83[_0xe1a0('0x31')]=_['keys'](_0x4a462f[_0xe1a0('0x31')]);_0x13ce83[_0xe1a0('0x3b')]=_['intersection'](_0x13ce83['model'],_0x13ce83[_0xe1a0('0x31')]);_0xe1b09b['attributes']=_['intersection'](_0x13ce83[_0xe1a0('0x30')],qs[_0xe1a0('0x35')](_0x4a462f['query'][_0xe1a0('0x35')]));_0xe1b09b['attributes']=_0xe1b09b['attributes'][_0xe1a0('0x36')]?_0xe1b09b[_0xe1a0('0x33')]:_0x13ce83[_0xe1a0('0x30')];if(_0x4a462f[_0xe1a0('0x31')][_0xe1a0('0x41')]){_0xe1b09b[_0xe1a0('0x42')]=[{'all':!![]}];}_0xe1b09b=_[_0xe1a0('0x3f')]({},_0xe1b09b,_0x4a462f[_0xe1a0('0x40')]);return db[_0xe1a0('0x2d')]['find'](_0xe1b09b)[_0xe1a0('0x24')](handleEntityNotFound(_0x560dd0,null))[_0xe1a0('0x24')](respondWithResult(_0x560dd0,null))['catch'](handleError(_0x560dd0,null));};exports[_0xe1a0('0x47')]=function(_0x14d46b,_0x4e0579){return db['DeskField'][_0xe1a0('0x47')](_0x14d46b[_0xe1a0('0x48')],{})['then'](respondWithResult(_0x4e0579,0xc9))[_0xe1a0('0x45')](handleError(_0x4e0579,null));};exports[_0xe1a0('0x23')]=function(_0x665047,_0x4ed149){if(_0x665047[_0xe1a0('0x48')]['id']){delete _0x665047[_0xe1a0('0x48')]['id'];}return db[_0xe1a0('0x2d')]['find']({'where':{'id':_0x665047[_0xe1a0('0x46')]['id']}})[_0xe1a0('0x24')](handleEntityNotFound(_0x4ed149,null))[_0xe1a0('0x24')](saveUpdates(_0x665047[_0xe1a0('0x48')],null))['then'](respondWithResult(_0x4ed149,null))[_0xe1a0('0x45')](handleError(_0x4ed149,null));};exports['destroy']=function(_0x3395b2,_0x393da2){return db[_0xe1a0('0x2d')]['find']({'where':{'id':_0x3395b2[_0xe1a0('0x46')]['id']}})[_0xe1a0('0x24')](handleEntityNotFound(_0x393da2,null))[_0xe1a0('0x24')](removeEntity(_0x393da2,null))['catch'](handleError(_0x393da2,null));};
\ No newline at end of file
+var _0xaf11=['create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','send','index','DeskField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','find','catch'];(function(_0x4667b2,_0x135b67){var _0x1070f2=function(_0xa72ca5){while(--_0xa72ca5){_0x4667b2['push'](_0x4667b2['shift']());}};_0x1070f2(++_0x135b67);}(_0xaf11,0x12f));var _0x1af1=function(_0x23b91a,_0x35506c){_0x23b91a=_0x23b91a-0x0;var _0x56b8cf=_0xaf11[_0x23b91a];return _0x56b8cf;};'use strict';var emlformat=require(_0x1af1('0x0'));var rimraf=require(_0x1af1('0x1'));var zipdir=require(_0x1af1('0x2'));var jsonpatch=require(_0x1af1('0x3'));var rp=require('request-promise');var moment=require(_0x1af1('0x4'));var BPromise=require(_0x1af1('0x5'));var Mustache=require(_0x1af1('0x6'));var util=require('util');var path=require(_0x1af1('0x7'));var sox=require(_0x1af1('0x8'));var csv=require(_0x1af1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1af1('0xa'));var _=require('lodash');var squel=require(_0x1af1('0xb'));var crypto=require(_0x1af1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1af1('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x1af1('0xe'));var Redis=require(_0x1af1('0xf'));var authService=require(_0x1af1('0x10'));var qs=require(_0x1af1('0x11'));var as=require(_0x1af1('0x12'));var hardwareService=require(_0x1af1('0x13'));var logger=require('../../config/logger')(_0x1af1('0x14'));var utils=require(_0x1af1('0x15'));var config=require(_0x1af1('0x16'));var licenseUtil=require(_0x1af1('0x17'));var db=require(_0x1af1('0x18'))['db'];function respondWithStatusCode(_0x20141a,_0x339763){_0x339763=_0x339763||0xcc;return function(_0x5e4634){if(_0x5e4634){return _0x20141a[_0x1af1('0x19')](_0x339763);}return _0x20141a[_0x1af1('0x1a')](_0x339763)[_0x1af1('0x1b')]();};}function respondWithResult(_0x2fe8d4,_0x4e92d5){_0x4e92d5=_0x4e92d5||0xc8;return function(_0x19f4e3){if(_0x19f4e3){return _0x2fe8d4[_0x1af1('0x1a')](_0x4e92d5)[_0x1af1('0x1c')](_0x19f4e3);}};}function respondWithFilteredResult(_0x5d842d,_0x1e756b){return function(_0x41b905){if(_0x41b905){var _0x38df6f=typeof _0x1e756b[_0x1af1('0x1d')]===_0x1af1('0x1e')&&typeof _0x1e756b[_0x1af1('0x1f')]===_0x1af1('0x1e');var _0x45dd76=_0x41b905[_0x1af1('0x20')];var _0x20c17b=_0x38df6f?0x0:_0x1e756b['offset'];var _0x4da591=_0x38df6f?_0x41b905['count']:_0x1e756b[_0x1af1('0x1d')]+_0x1e756b['limit'];var _0xf1c8ae;if(_0x4da591>=_0x45dd76){_0x4da591=_0x45dd76;_0xf1c8ae=0xc8;}else{_0xf1c8ae=0xce;}_0x5d842d[_0x1af1('0x1a')](_0xf1c8ae);return _0x5d842d[_0x1af1('0x21')](_0x1af1('0x22'),_0x20c17b+'-'+_0x4da591+'/'+_0x45dd76)[_0x1af1('0x1c')](_0x41b905);}return null;};}function patchUpdates(_0x5d336){return function(_0x4af71a){try{jsonpatch[_0x1af1('0x23')](_0x4af71a,_0x5d336,!![]);}catch(_0x2ef81a){return BPromise[_0x1af1('0x24')](_0x2ef81a);}return _0x4af71a['save']();};}function saveUpdates(_0x3d1ed1,_0xca2e20){return function(_0x535a8e){if(_0x535a8e){return _0x535a8e[_0x1af1('0x25')](_0x3d1ed1)[_0x1af1('0x26')](function(_0x187dd4){return _0x187dd4;});}return null;};}function removeEntity(_0x51c213,_0x8952cf){return function(_0x4003db){if(_0x4003db){return _0x4003db['destroy']()['then'](function(){_0x51c213['status'](0xcc)[_0x1af1('0x1b')]();});}};}function handleEntityNotFound(_0x5df091,_0x50c0e0){return function(_0x21c60c){if(!_0x21c60c){_0x5df091[_0x1af1('0x19')](0x194);}return _0x21c60c;};}function handleError(_0x3d19e7,_0xbd139d){_0xbd139d=_0xbd139d||0x1f4;return function(_0x6222f1){logger['error'](_0x6222f1[_0x1af1('0x27')]);if(_0x6222f1[_0x1af1('0x28')]){delete _0x6222f1[_0x1af1('0x28')];}_0x3d19e7[_0x1af1('0x1a')](_0xbd139d)[_0x1af1('0x29')](_0x6222f1);};}exports[_0x1af1('0x2a')]=function(_0x4b655b,_0x40e32f){var _0x50438e={},_0x40630d={},_0x440da4={'count':0x0,'rows':[]};var _0x526aba=_['map'](db[_0x1af1('0x2b')][_0x1af1('0x2c')],function(_0x2c1494){return{'name':_0x2c1494[_0x1af1('0x2d')],'type':_0x2c1494['type'][_0x1af1('0x2e')]};});_0x40630d[_0x1af1('0x2f')]=_['map'](_0x526aba,_0x1af1('0x28'));_0x40630d['query']=_[_0x1af1('0x30')](_0x4b655b[_0x1af1('0x31')]);_0x40630d[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x40630d['model'],_0x40630d[_0x1af1('0x31')]);_0x50438e[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x40630d['model'],qs['fields'](_0x4b655b[_0x1af1('0x31')]['fields']));_0x50438e[_0x1af1('0x34')]=_0x50438e[_0x1af1('0x34')]['length']?_0x50438e['attributes']:_0x40630d[_0x1af1('0x2f')];if(!_0x4b655b['query'][_0x1af1('0x35')](_0x1af1('0x36'))){_0x50438e[_0x1af1('0x1f')]=qs[_0x1af1('0x1f')](_0x4b655b['query'][_0x1af1('0x1f')]);_0x50438e['offset']=qs[_0x1af1('0x1d')](_0x4b655b['query'][_0x1af1('0x1d')]);}_0x50438e[_0x1af1('0x37')]=qs[_0x1af1('0x38')](_0x4b655b[_0x1af1('0x31')]['sort']);_0x50438e[_0x1af1('0x39')]=qs[_0x1af1('0x32')](_[_0x1af1('0x3a')](_0x4b655b[_0x1af1('0x31')],_0x40630d[_0x1af1('0x32')]),_0x526aba);if(_0x4b655b[_0x1af1('0x31')]['filter']){_0x50438e[_0x1af1('0x39')]=_[_0x1af1('0x3b')](_0x50438e['where'],{'$or':_[_0x1af1('0x3c')](_0x526aba,function(_0x53ef03){if(_0x53ef03[_0x1af1('0x3d')]!==_0x1af1('0x3e')){var _0x4569f5={};_0x4569f5[_0x53ef03[_0x1af1('0x28')]]={'$like':'%'+_0x4b655b[_0x1af1('0x31')]['filter']+'%'};return _0x4569f5;}})});}_0x50438e=_['merge']({},_0x50438e,_0x4b655b[_0x1af1('0x3f')]);var _0x36ab51={'where':_0x50438e[_0x1af1('0x39')]};return db[_0x1af1('0x2b')][_0x1af1('0x20')](_0x36ab51)['then'](function(_0x4683d5){_0x440da4['count']=_0x4683d5;if(_0x4b655b[_0x1af1('0x31')][_0x1af1('0x40')]){_0x50438e[_0x1af1('0x41')]=[{'all':!![]}];}return db['DeskField'][_0x1af1('0x42')](_0x50438e);})[_0x1af1('0x26')](function(_0x13331d){_0x440da4[_0x1af1('0x43')]=_0x13331d;return _0x440da4;})[_0x1af1('0x26')](respondWithFilteredResult(_0x40e32f,_0x50438e))['catch'](handleError(_0x40e32f,null));};exports[_0x1af1('0x44')]=function(_0x115e96,_0x501056){var _0x4ca014={'raw':!![],'where':{'id':_0x115e96['params']['id']}},_0x4c6d0b={};_0x4c6d0b[_0x1af1('0x2f')]=_[_0x1af1('0x30')](db[_0x1af1('0x2b')]['rawAttributes']);_0x4c6d0b[_0x1af1('0x31')]=_[_0x1af1('0x30')](_0x115e96[_0x1af1('0x31')]);_0x4c6d0b[_0x1af1('0x32')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],_0x4c6d0b['query']);_0x4ca014[_0x1af1('0x34')]=_[_0x1af1('0x33')](_0x4c6d0b[_0x1af1('0x2f')],qs[_0x1af1('0x45')](_0x115e96['query'][_0x1af1('0x45')]));_0x4ca014[_0x1af1('0x34')]=_0x4ca014['attributes']['length']?_0x4ca014[_0x1af1('0x34')]:_0x4c6d0b[_0x1af1('0x2f')];if(_0x115e96['query'][_0x1af1('0x40')]){_0x4ca014[_0x1af1('0x41')]=[{'all':!![]}];}_0x4ca014=_['merge']({},_0x4ca014,_0x115e96[_0x1af1('0x3f')]);return db['DeskField'][_0x1af1('0x46')](_0x4ca014)['then'](handleEntityNotFound(_0x501056,null))[_0x1af1('0x26')](respondWithResult(_0x501056,null))[_0x1af1('0x47')](handleError(_0x501056,null));};exports['create']=function(_0xabb1c6,_0x1587da){return db[_0x1af1('0x2b')][_0x1af1('0x48')](_0xabb1c6[_0x1af1('0x49')],{})['then'](respondWithResult(_0x1587da,0xc9))[_0x1af1('0x47')](handleError(_0x1587da,null));};exports['update']=function(_0x46e41d,_0x3856be){if(_0x46e41d['body']['id']){delete _0x46e41d[_0x1af1('0x49')]['id'];}return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x46e41d['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x3856be,null))[_0x1af1('0x26')](saveUpdates(_0x46e41d[_0x1af1('0x49')],null))['then'](respondWithResult(_0x3856be,null))[_0x1af1('0x47')](handleError(_0x3856be,null));};exports[_0x1af1('0x4a')]=function(_0x59b710,_0x27a5d8){return db[_0x1af1('0x2b')][_0x1af1('0x46')]({'where':{'id':_0x59b710['params']['id']}})[_0x1af1('0x26')](handleEntityNotFound(_0x27a5d8,null))[_0x1af1('0x26')](removeEntity(_0x27a5d8,null))[_0x1af1('0x47')](handleError(_0x27a5d8,null));};
\ No newline at end of file
index 7a24f14..9fe4a3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fe=['lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0xa7c05d,_0x312374){var _0x47b002=function(_0x44aa2f){while(--_0x44aa2f){_0xa7c05d['push'](_0xa7c05d['shift']());}};_0x47b002(++_0x312374);}(_0xd8fe,0xa5));var _0xed8f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xd8fe[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0xed8f('0x0'));var util=require(_0xed8f('0x1'));var logger=require(_0xed8f('0x2'))('api');var moment=require('moment');var BPromise=require(_0xed8f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xed8f('0x4'));var rimraf=require(_0xed8f('0x5'));var config=require(_0xed8f('0x6'));var attributes=require(_0xed8f('0x7'));module[_0xed8f('0x8')]=function(_0x524fd0,_0x49a7d7){return _0x524fd0[_0xed8f('0x9')](_0xed8f('0xa'),attributes,{'tableName':_0xed8f('0xb'),'paranoid':![],'indexes':[{'name':_0xed8f('0xc'),'fields':[_0xed8f('0xd'),_0xed8f('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d7e=['idField','lodash','util','moment','request-promise','rimraf','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','desk_unique_index'];(function(_0x5e89df,_0x5d7835){var _0xa34df6=function(_0x26460d){while(--_0x26460d){_0x5e89df['push'](_0x5e89df['shift']());}};_0xa34df6(++_0x5d7835);}(_0x9d7e,0x151));var _0xe9d7=function(_0x2bbdfb,_0x4aeb7d){_0x2bbdfb=_0x2bbdfb-0x0;var _0x218682=_0x9d7e[_0x2bbdfb];return _0x218682;};'use strict';var _=require(_0xe9d7('0x0'));var util=require(_0xe9d7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe9d7('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9d7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9d7('0x4'));var config=require('../../config/environment');var attributes=require(_0xe9d7('0x5'));module[_0xe9d7('0x6')]=function(_0x200fcf,_0x1739c6){return _0x200fcf[_0xe9d7('0x7')](_0xe9d7('0x8'),attributes,{'tableName':_0xe9d7('0x9'),'paranoid':![],'indexes':[{'name':_0xe9d7('0xa'),'fields':[_0xe9d7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 87ab629..b97659f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa11c=['request\x20sent','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s'];(function(_0x5cda68,_0x2de9a2){var _0x165134=function(_0x556912){while(--_0x556912){_0x5cda68['push'](_0x5cda68['shift']());}};_0x165134(++_0x2de9a2);}(_0xa11c,0x12d));var _0xca11=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa11c[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca11('0x0'));var BPromise=require(_0xca11('0x1'));var rs=require(_0xca11('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xca11('0x3'));var logger=require(_0xca11('0x4'))('rpc');var config=require(_0xca11('0x5'));var jayson=require(_0xca11('0x6'));var client=jayson[_0xca11('0x7')][_0xca11('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53addd,_0x2b1b5e,_0x127bf8){return new BPromise(function(_0x4bfa44,_0x2d1a56){return client[_0xca11('0x9')](_0x53addd,_0x127bf8)['then'](function(_0x23798e){logger[_0xca11('0xa')](_0xca11('0xb'),_0x2b1b5e,'request\x20sent');logger[_0xca11('0xc')](_0xca11('0xd'),_0x2b1b5e,_0xca11('0xe'),JSON[_0xca11('0xf')](_0x23798e));if(_0x23798e[_0xca11('0x10')]){if(_0x23798e[_0xca11('0x10')][_0xca11('0x11')]===0x1f4){logger['error']('DeskField,\x20%s,\x20%s',_0x2b1b5e,_0x23798e['error'][_0xca11('0x12')]);return _0x2d1a56(_0x23798e[_0xca11('0x10')]['message']);}logger[_0xca11('0x10')](_0xca11('0xb'),_0x2b1b5e,_0x23798e[_0xca11('0x10')]['message']);return _0x4bfa44(_0x23798e[_0xca11('0x10')][_0xca11('0x12')]);}else{logger[_0xca11('0xa')](_0xca11('0xb'),_0x2b1b5e,'request\x20sent');_0x4bfa44(_0x23798e[_0xca11('0x13')][_0xca11('0x12')]);}})[_0xca11('0x14')](function(_0x60bc7e){logger[_0xca11('0x10')](_0xca11('0xb'),_0x2b1b5e,_0x60bc7e);_0x2d1a56(_0x60bc7e);});});}
\ No newline at end of file
+var _0xde1d=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error'];(function(_0x3f081e,_0xee1bbc){var _0x189826=function(_0x2eacdc){while(--_0x2eacdc){_0x3f081e['push'](_0x3f081e['shift']());}};_0x189826(++_0xee1bbc);}(_0xde1d,0x86));var _0xdde1=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0xde1d[_0x3db122];return _0x325b67;};'use strict';var _=require(_0xdde1('0x0'));var util=require(_0xdde1('0x1'));var moment=require(_0xdde1('0x2'));var BPromise=require(_0xdde1('0x3'));var rs=require(_0xdde1('0x4'));var fs=require('fs');var Redis=require(_0xdde1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdde1('0x6'));var logger=require(_0xdde1('0x7'))('rpc');var config=require(_0xdde1('0x8'));var jayson=require(_0xdde1('0x9'));var client=jayson[_0xdde1('0xa')][_0xdde1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x257567,_0x35a24e,_0x104cdb){return new BPromise(function(_0x2a69f3,_0x77eaef){return client[_0xdde1('0xc')](_0x257567,_0x104cdb)[_0xdde1('0xd')](function(_0x5db9ae){logger[_0xdde1('0xe')](_0xdde1('0xf'),_0x35a24e,_0xdde1('0x10'));logger[_0xdde1('0x11')](_0xdde1('0x12'),_0x35a24e,_0xdde1('0x10'),JSON['stringify'](_0x5db9ae));if(_0x5db9ae[_0xdde1('0x13')]){if(_0x5db9ae['error']['code']===0x1f4){logger['error'](_0xdde1('0xf'),_0x35a24e,_0x5db9ae['error'][_0xdde1('0x14')]);return _0x77eaef(_0x5db9ae[_0xdde1('0x13')]['message']);}logger[_0xdde1('0x13')](_0xdde1('0xf'),_0x35a24e,_0x5db9ae[_0xdde1('0x13')][_0xdde1('0x14')]);return _0x2a69f3(_0x5db9ae['error'][_0xdde1('0x14')]);}else{logger[_0xdde1('0xe')](_0xdde1('0xf'),_0x35a24e,_0xdde1('0x10'));_0x2a69f3(_0x5db9ae['result'][_0xdde1('0x14')]);}})[_0xdde1('0x15')](function(_0x34f173){logger['error']('DeskField,\x20%s,\x20%s',_0x35a24e,_0x34f173);_0x77eaef(_0x34f173);});});}
\ No newline at end of file
index f7427b9..0265447 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1fa=['/:id/fields','getFields','post','create','addConfiguration','/:id','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','show','get','/:id/configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd1fa,0x105));var _0xad1f=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xd1fa[_0x288f5e];return _0x476cc9;};'use strict';var multer=require('multer');var util=require(_0xad1f('0x0'));var path=require(_0xad1f('0x1'));var timeout=require(_0xad1f('0x2'));var express=require(_0xad1f('0x3'));var router=express['Router']();var fs_extra=require(_0xad1f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xad1f('0x5'));var config=require(_0xad1f('0x6'));var controller=require(_0xad1f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xad1f('0x8')](),controller[_0xad1f('0x9')]);router[_0xad1f('0xa')](_0xad1f('0xb'),auth[_0xad1f('0x8')](),controller['getConfigurations']);router[_0xad1f('0xa')](_0xad1f('0xc'),auth[_0xad1f('0x8')](),controller[_0xad1f('0xd')]);router[_0xad1f('0xe')]('/',auth[_0xad1f('0x8')](),controller[_0xad1f('0xf')]);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0xad1f('0x10')]);router['put'](_0xad1f('0x11'),auth[_0xad1f('0x8')](),controller[_0xad1f('0x12')]);router[_0xad1f('0x13')](_0xad1f('0x11'),auth[_0xad1f('0x8')](),controller[_0xad1f('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xd5dc=['/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd5dc,0x114));var _0xcd5d=function(_0x59171e,_0x280e49){_0x59171e=_0x59171e-0x0;var _0x4ef068=_0xd5dc[_0x59171e];return _0x4ef068;};'use strict';var multer=require(_0xcd5d('0x0'));var util=require(_0xcd5d('0x1'));var path=require('path');var timeout=require(_0xcd5d('0x2'));var express=require('express');var router=express[_0xcd5d('0x3')]();var fs_extra=require(_0xcd5d('0x4'));var auth=require(_0xcd5d('0x5'));var interaction=require(_0xcd5d('0x6'));var config=require(_0xcd5d('0x7'));var controller=require(_0xcd5d('0x8'));router[_0xcd5d('0x9')]('/',auth[_0xcd5d('0xa')](),controller[_0xcd5d('0xb')]);router[_0xcd5d('0x9')](_0xcd5d('0xc'),auth[_0xcd5d('0xa')](),controller['show']);router[_0xcd5d('0x9')](_0xcd5d('0xd'),auth[_0xcd5d('0xa')](),controller[_0xcd5d('0xe')]);router['get'](_0xcd5d('0xf'),auth[_0xcd5d('0xa')](),controller[_0xcd5d('0x10')]);router[_0xcd5d('0x11')]('/',auth[_0xcd5d('0xa')](),controller[_0xcd5d('0x12')]);router['post'](_0xcd5d('0xd'),auth['isAuthenticated'](),controller[_0xcd5d('0x13')]);router[_0xcd5d('0x14')](_0xcd5d('0xc'),auth[_0xcd5d('0xa')](),controller[_0xcd5d('0x15')]);router['delete'](_0xcd5d('0xc'),auth[_0xcd5d('0xa')](),controller[_0xcd5d('0x16')]);module[_0xcd5d('0x17')]=router;
\ No newline at end of file
index 502068b..5306ff6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb94=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb94,0xe5));var _0x4db9=function(_0x32c414,_0x4273d9){_0x32c414=_0x32c414-0x0;var _0x52bad3=_0xdb94[_0x32c414];return _0x52bad3;};'use strict';var Sequelize=require('sequelize');module[_0x4db9('0x0')]={'name':{'type':Sequelize[_0x4db9('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x4db9('0x1')]},'remoteUri':{'type':Sequelize[_0x4db9('0x1')]},'tenantId':{'type':Sequelize[_0x4db9('0x1')]},'clientId':{'type':Sequelize[_0x4db9('0x1')]},'clientSecret':{'type':Sequelize[_0x4db9('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x4db9('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2caf=['STRING','BOOLEAN'];(function(_0x13cd20,_0x1d9211){var _0x22b6de=function(_0x4b574f){while(--_0x4b574f){_0x13cd20['push'](_0x13cd20['shift']());}};_0x22b6de(++_0x1d9211);}(_0x2caf,0x6a));var _0xf2ca=function(_0x3ff51e,_0x39fccd){_0x3ff51e=_0x3ff51e-0x0;var _0x25f76e=_0x2caf[_0x3ff51e];return _0x25f76e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf2ca('0x0')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xf2ca('0x0')]},'tenantId':{'type':Sequelize[_0xf2ca('0x0')]},'clientId':{'type':Sequelize[_0xf2ca('0x0')]},'clientSecret':{'type':Sequelize[_0xf2ca('0x0')]},'serverUrl':{'type':Sequelize[_0xf2ca('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xf2ca('0x0')]},'modernAuthentication':{'type':Sequelize[_0xf2ca('0x1')],'defaultValue':!![]}};
\ No newline at end of file
index 67d8eee..f75a3fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['clientSecret','GET','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','substring','isNil','BooleanAttributeMetadata','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','DisplayName',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../config/logger','../../mysqldb','../../components/integrations/configuration','json','offset','undefined','limit','count','status','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','order','sort','where','pick','VIRTUAL','filter','options','findAll','rows','catch','params','includeAll','include','merge','find','create','body','getConfigurations','findOne','Dynamics365Configuration','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','slice','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data5','data7','access_token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c00,0xea));var _0x05c0=function(_0x4caf4f,_0x1f9d37){_0x4caf4f=_0x4caf4f-0x0;var _0xf64dd9=_0x5c00[_0x4caf4f];return _0xf64dd9;};'use strict';var rp=require('request-promise');var util=require(_0x05c0('0x0'));var _=require(_0x05c0('0x1'));var qs=require('../../components/parsers/qs');var logger=require(_0x05c0('0x2'))('api');var db=require(_0x05c0('0x3'))['db'];var integrations=require(_0x05c0('0x4'));function respondWithResult(_0x4eb440,_0x3884d4){_0x3884d4=_0x3884d4||0xc8;return function(_0x2a6125){if(_0x2a6125){return _0x4eb440['status'](_0x3884d4)[_0x05c0('0x5')](_0x2a6125);}};}function respondWithFilteredResult(_0x3751a4,_0x11d811){return function(_0x2179a4){if(_0x2179a4){var _0x126ed7=typeof _0x11d811[_0x05c0('0x6')]===_0x05c0('0x7')&&typeof _0x11d811[_0x05c0('0x8')]===_0x05c0('0x7');var _0x30dcdc=_0x2179a4[_0x05c0('0x9')];var _0x482dcf=_0x126ed7?0x0:_0x11d811[_0x05c0('0x6')];var _0x2c4574=_0x126ed7?_0x2179a4[_0x05c0('0x9')]:_0x11d811[_0x05c0('0x6')]+_0x11d811[_0x05c0('0x8')];var _0x1061a7;if(_0x2c4574>=_0x30dcdc){_0x2c4574=_0x30dcdc;_0x1061a7=0xc8;}else{_0x1061a7=0xce;}_0x3751a4[_0x05c0('0xa')](_0x1061a7);return _0x3751a4[_0x05c0('0xb')](_0x05c0('0xc'),_0x482dcf+'-'+_0x2c4574+'/'+_0x30dcdc)['json'](_0x2179a4);}return null;};}function saveUpdates(_0x273e72){return function(_0x3756bc){if(_0x3756bc){return _0x3756bc[_0x05c0('0xd')](_0x273e72)[_0x05c0('0xe')](function(_0x4024be){return _0x4024be;});}return null;};}function removeEntity(_0xe02742){return function(_0x1d9300){if(_0x1d9300){return _0x1d9300[_0x05c0('0xf')]()[_0x05c0('0xe')](function(){_0xe02742[_0x05c0('0xa')](0xcc)[_0x05c0('0x10')]();});}};}function handleEntityNotFound(_0x3f3f7b){return function(_0x3517ea){if(!_0x3517ea){_0x3f3f7b[_0x05c0('0x11')](0x194);}return _0x3517ea;};}function handleError(_0x13c540,_0x52a84f){_0x52a84f=_0x52a84f||0x1f4;return function(_0xc35d6b){logger[_0x05c0('0x12')](_0xc35d6b[_0x05c0('0x13')]);if(_0xc35d6b['name']){delete _0xc35d6b[_0x05c0('0x14')];}_0x13c540['status'](_0x52a84f)[_0x05c0('0x15')](_0xc35d6b);};}exports[_0x05c0('0x16')]=function(_0x3df26e,_0x3cb4c1){var _0x4eec77={},_0x255fb1={},_0xcc2786={'count':0x0,'rows':[]};var _0x54ef88=_[_0x05c0('0x17')](db[_0x05c0('0x18')][_0x05c0('0x19')],function(_0x2630f5){return{'name':_0x2630f5[_0x05c0('0x1a')],'type':_0x2630f5[_0x05c0('0x1b')]['key']};});_0x255fb1[_0x05c0('0x1c')]=_[_0x05c0('0x17')](_0x54ef88,_0x05c0('0x14'));_0x255fb1['query']=_[_0x05c0('0x1d')](_0x3df26e['query']);_0x255fb1[_0x05c0('0x1e')]=_[_0x05c0('0x1f')](_0x255fb1[_0x05c0('0x1c')],_0x255fb1[_0x05c0('0x20')]);_0x4eec77[_0x05c0('0x21')]=_['intersection'](_0x255fb1['model'],qs[_0x05c0('0x22')](_0x3df26e[_0x05c0('0x20')]['fields']));_0x4eec77[_0x05c0('0x21')]=_0x4eec77[_0x05c0('0x21')][_0x05c0('0x23')]?_0x4eec77['attributes']:_0x255fb1['model'];if(!_0x3df26e[_0x05c0('0x20')]['hasOwnProperty']('nolimit')){_0x4eec77[_0x05c0('0x8')]=qs[_0x05c0('0x8')](_0x3df26e[_0x05c0('0x20')][_0x05c0('0x8')]);_0x4eec77[_0x05c0('0x6')]=qs[_0x05c0('0x6')](_0x3df26e[_0x05c0('0x20')]['offset']);}_0x4eec77[_0x05c0('0x24')]=qs[_0x05c0('0x25')](_0x3df26e['query'][_0x05c0('0x25')]);_0x4eec77[_0x05c0('0x26')]=qs['filters'](_[_0x05c0('0x27')](_0x3df26e[_0x05c0('0x20')],_0x255fb1[_0x05c0('0x1e')]),_0x54ef88);if(_0x3df26e[_0x05c0('0x20')]['filter']){_0x4eec77[_0x05c0('0x26')]=_['merge'](_0x4eec77[_0x05c0('0x26')],{'$or':_[_0x05c0('0x17')](_0x54ef88,function(_0x5485fa){if(_0x5485fa[_0x05c0('0x1b')]!==_0x05c0('0x28')){var _0x8d11d4={};_0x8d11d4[_0x5485fa['name']]={'$like':'%'+_0x3df26e[_0x05c0('0x20')][_0x05c0('0x29')]+'%'};return _0x8d11d4;}})});}_0x4eec77=_['merge']({},_0x4eec77,_0x3df26e[_0x05c0('0x2a')]);var _0x3efc57={'where':_0x4eec77[_0x05c0('0x26')]};return db[_0x05c0('0x18')][_0x05c0('0x9')](_0x3efc57)['then'](function(_0x37f7fa){_0xcc2786['count']=_0x37f7fa;if(_0x3df26e['query']['includeAll']){_0x4eec77['include']=[{'all':!![]}];}return db[_0x05c0('0x18')][_0x05c0('0x2b')](_0x4eec77);})[_0x05c0('0xe')](function(_0x5b634e){_0xcc2786[_0x05c0('0x2c')]=_0x5b634e;return _0xcc2786;})[_0x05c0('0xe')](respondWithFilteredResult(_0x3cb4c1,_0x4eec77))[_0x05c0('0x2d')](handleError(_0x3cb4c1,null));};exports['show']=function(_0x134258,_0x26ad2c){var _0xeef528={'raw':![],'where':{'id':_0x134258[_0x05c0('0x2e')]['id']}},_0xbff1d6={};_0xbff1d6[_0x05c0('0x1c')]=_['keys'](db['Dynamics365Account']['rawAttributes']);_0xbff1d6[_0x05c0('0x20')]=_['keys'](_0x134258[_0x05c0('0x20')]);_0xbff1d6['filters']=_[_0x05c0('0x1f')](_0xbff1d6['model'],_0xbff1d6['query']);_0xeef528[_0x05c0('0x21')]=_[_0x05c0('0x1f')](_0xbff1d6[_0x05c0('0x1c')],qs['fields'](_0x134258[_0x05c0('0x20')][_0x05c0('0x22')]));_0xeef528[_0x05c0('0x21')]=_0xeef528['attributes'][_0x05c0('0x23')]?_0xeef528[_0x05c0('0x21')]:_0xbff1d6[_0x05c0('0x1c')];if(_0x134258[_0x05c0('0x20')][_0x05c0('0x2f')]){_0xeef528[_0x05c0('0x30')]=[{'all':!![]}];}_0xeef528=_[_0x05c0('0x31')]({},_0xeef528,_0x134258['options']);return db[_0x05c0('0x18')][_0x05c0('0x32')](_0xeef528)[_0x05c0('0xe')](handleEntityNotFound(_0x26ad2c,null))['then'](respondWithResult(_0x26ad2c,null))[_0x05c0('0x2d')](handleError(_0x26ad2c,null));};exports[_0x05c0('0x33')]=function(_0x28a477,_0x5b291e){return db[_0x05c0('0x18')][_0x05c0('0x33')](_0x28a477[_0x05c0('0x34')],{})[_0x05c0('0xe')](respondWithResult(_0x5b291e,0xc9))['catch'](handleError(_0x5b291e,null));};exports['update']=function(_0x5912f3,_0x3ef89c){if(_0x5912f3[_0x05c0('0x34')]['id']){delete _0x5912f3['body']['id'];}return db[_0x05c0('0x18')][_0x05c0('0x32')]({'where':{'id':_0x5912f3[_0x05c0('0x2e')]['id']}})[_0x05c0('0xe')](handleEntityNotFound(_0x3ef89c,null))[_0x05c0('0xe')](saveUpdates(_0x5912f3[_0x05c0('0x34')],null))[_0x05c0('0xe')](respondWithResult(_0x3ef89c,null))['catch'](handleError(_0x3ef89c,null));};exports[_0x05c0('0xf')]=function(_0x105c40,_0x3f0bfa){return db[_0x05c0('0x18')]['find']({'where':{'id':_0x105c40[_0x05c0('0x2e')]['id']}})[_0x05c0('0xe')](handleEntityNotFound(_0x3f0bfa,null))[_0x05c0('0xe')](removeEntity(_0x3f0bfa,null))['catch'](handleError(_0x3f0bfa,null));};exports[_0x05c0('0x35')]=function(_0x19796c,_0x17374a){var _0x15e176={};var _0xf818ad={};var _0x1a1c91;var _0x22cea6;return db[_0x05c0('0x18')][_0x05c0('0x36')]({'where':{'id':_0x19796c['params']['id']}})[_0x05c0('0xe')](handleEntityNotFound(_0x17374a,null))[_0x05c0('0xe')](function(_0x5bb541){if(_0x5bb541){_0x1a1c91=_0x5bb541;_0xf818ad[_0x05c0('0x1c')]=_[_0x05c0('0x1d')](db[_0x05c0('0x37')]['rawAttributes']);_0xf818ad[_0x05c0('0x20')]=_['keys'](_0x19796c[_0x05c0('0x20')]);_0xf818ad['filters']=_['intersection'](_0xf818ad[_0x05c0('0x1c')],_0xf818ad['query']);_0x15e176[_0x05c0('0x21')]=_[_0x05c0('0x1f')](_0xf818ad[_0x05c0('0x1c')],qs['fields'](_0x19796c['query'][_0x05c0('0x22')]));_0x15e176['attributes']=_0x15e176[_0x05c0('0x21')]['length']?_0x15e176[_0x05c0('0x21')]:_0xf818ad['model'];_0x15e176[_0x05c0('0x24')]=qs[_0x05c0('0x25')](_0x19796c[_0x05c0('0x20')][_0x05c0('0x25')]);_0x15e176['where']=qs[_0x05c0('0x1e')](_[_0x05c0('0x27')](_0x19796c[_0x05c0('0x20')],_0xf818ad['filters']));if(_0x19796c[_0x05c0('0x20')][_0x05c0('0x29')]){_0x15e176[_0x05c0('0x26')]=_['merge'](_0x15e176[_0x05c0('0x26')],{'$or':_[_0x05c0('0x17')](_0x15e176[_0x05c0('0x21')],function(_0x322b30){var _0x33e7aa={};_0x33e7aa[_0x322b30]={'$like':'%'+_0x19796c['query'][_0x05c0('0x29')]+'%'};return _0x33e7aa;})});}_0x15e176=_[_0x05c0('0x31')]({},_0x15e176,_0x19796c[_0x05c0('0x2a')]);return _0x1a1c91['getConfigurations'](_0x15e176);}})[_0x05c0('0xe')](function(_0x197e90){if(_0x197e90){_0x22cea6=_0x197e90[_0x05c0('0x23')];if(!_0x19796c[_0x05c0('0x20')]['hasOwnProperty'](_0x05c0('0x38'))){_0x15e176[_0x05c0('0x8')]=qs[_0x05c0('0x8')](_0x19796c[_0x05c0('0x20')][_0x05c0('0x8')]);_0x15e176[_0x05c0('0x6')]=qs[_0x05c0('0x6')](_0x19796c['query'][_0x05c0('0x6')]);}return _0x1a1c91[_0x05c0('0x35')](_0x15e176);}})[_0x05c0('0xe')](function(_0x37b2d2){if(_0x37b2d2){return _0x37b2d2?{'count':_0x22cea6,'rows':_0x37b2d2}:null;}})['then'](respondWithResult(_0x17374a,null))[_0x05c0('0x2d')](handleError(_0x17374a,null));};exports[_0x05c0('0x39')]=function(_0x48bddc,_0x678c87){if(_0x48bddc[_0x05c0('0x34')]['id']){delete _0x48bddc[_0x05c0('0x34')]['id'];}return db[_0x05c0('0x18')][_0x05c0('0x36')]({'where':{'id':_0x48bddc[_0x05c0('0x2e')]['id']}})[_0x05c0('0xe')](handleEntityNotFound(_0x678c87,null))['then'](function(_0x3532a6){if(_0x3532a6){_0x48bddc[_0x05c0('0x34')]['AccountId']=_0x3532a6['id'];_0x48bddc[_0x05c0('0x34')][_0x05c0('0x3a')]=integrations[_0x05c0('0x3b')](_0x48bddc[_0x05c0('0x34')][_0x05c0('0x3c')],_0x48bddc['body'][_0x05c0('0x1b')]);_0x48bddc[_0x05c0('0x34')][_0x05c0('0x3d')]=integrations[_0x05c0('0x3e')](_0x48bddc[_0x05c0('0x34')][_0x05c0('0x3c')],_0x48bddc[_0x05c0('0x34')][_0x05c0('0x1b')]);return db['Dynamics365Configuration'][_0x05c0('0x33')](_0x48bddc['body'],{'include':[{'model':db[_0x05c0('0x3f')],'as':_0x05c0('0x3a')},{'model':db[_0x05c0('0x3f')],'as':_0x05c0('0x3d')}]});}return null;})['then'](respondWithResult(_0x678c87,null))['catch'](handleError(_0x678c87,null));};function sanitizeRemoteUri(_0xe304ee){var _0xb2d82b=_0xe304ee[_0x05c0('0x40')](-0x1);if(_0xb2d82b==='/')return _0xe304ee['substring'](0x0,_0xe304ee[_0x05c0('0x41')](_0xb2d82b));return _0xe304ee;}function getWebApiUrl(_0x5a0d57){return util['format'](_0x05c0('0x42'),_0x5a0d57);}exports[_0x05c0('0x43')]=function(_0x4195ab,_0x5b1a1d){var _0x2a6a8a=_0x4195ab[_0x05c0('0x20')][_0x05c0('0x44')];var _0x269998=_0x2a6a8a===_0x05c0('0x45')?'Incident':_0x05c0('0x46');var _0x2dbe3b='';var _0x14dc39='';var _0x4b2d33='';var _0x279855='';var _0x3c8736='';var _0x649027='';var _0xe0616d='';var _0x63228f='';var _0x4d676b=[_0x05c0('0x47'),_0x05c0('0x48'),_0x05c0('0x49'),_0x05c0('0x4a'),_0x05c0('0x4b'),'subject','phonenumber',_0x05c0('0x4c'),_0x05c0('0x4d'),_0x05c0('0x4e')];var _0x4eba66=[_0x05c0('0x4f'),_0x05c0('0x50'),_0x05c0('0x51'),_0x05c0('0x52'),_0x05c0('0x53'),_0x05c0('0x54'),_0x05c0('0x55'),_0x05c0('0x56'),_0x05c0('0x57'),'createdbyexternalpartyyominame','createdbyname','createdbyyominame',_0x05c0('0x58'),_0x05c0('0x59'),_0x05c0('0x5a'),_0x05c0('0x5b'),'customeridtype',_0x05c0('0x5c'),'emailaddress','entitlementidname',_0x05c0('0x5d'),_0x05c0('0x5e'),_0x05c0('0x5f'),_0x05c0('0x60'),_0x05c0('0x61'),_0x05c0('0x62'),_0x05c0('0x63'),_0x05c0('0x64'),'kbarticleidname',_0x05c0('0x65'),_0x05c0('0x66'),_0x05c0('0x67'),_0x05c0('0x68'),_0x05c0('0x69'),'modifiedbyyominame',_0x05c0('0x6a'),_0x05c0('0x6b'),_0x05c0('0x6c'),_0x05c0('0x6d'),'msdyn_iotalertname',_0x05c0('0x6e'),_0x05c0('0x6f'),_0x05c0('0x70'),_0x05c0('0x71'),'owneridtype',_0x05c0('0x72'),_0x05c0('0x73'),'primarycontactidname',_0x05c0('0x74'),_0x05c0('0x75'),_0x05c0('0x76'),_0x05c0('0x77'),_0x05c0('0x78'),'resolvebykpiidname','responseby',_0x05c0('0x79'),_0x05c0('0x7a'),_0x05c0('0x7b'),'slainvokedidname',_0x05c0('0x7c'),_0x05c0('0x7d'),'statecode',_0x05c0('0x7e'),_0x05c0('0x7f'),_0x05c0('0x80'),_0x05c0('0x81'),'transactioncurrencyidname',_0x05c0('0x82'),_0x05c0('0x83'),_0x05c0('0x84')];var _0x5e4cb9=_0x4d676b[_0x05c0('0x85')](_0x4eba66);return db['Dynamics365Account'][_0x05c0('0x36')]({'where':{'id':_0x4195ab[_0x05c0('0x2e')]['id']},'attributes':['id',_0x05c0('0x86'),_0x05c0('0x87'),_0x05c0('0x88'),_0x05c0('0x89'),_0x05c0('0x8a'),'clientSecret',_0x05c0('0x8b')],'include':[{'model':db[_0x05c0('0x8c')],'as':_0x05c0('0x8c'),'attributes':['id',_0x05c0('0x8d'),_0x05c0('0x8e')]}]})[_0x05c0('0xe')](handleEntityNotFound(_0x5b1a1d,null))[_0x05c0('0xe')](function(_0x21936e){if(_0x21936e){if(_0x21936e[_0x05c0('0x8b')]){_0x21936e[_0x05c0('0x8f')]=_0x21936e[_0x05c0('0x8c')][_0x05c0('0x8d')];_0x63228f=sanitizeRemoteUri(_0x21936e[_0x05c0('0x8c')][_0x05c0('0x8e')]);_0xe0616d=getWebApiUrl(_0x63228f);return _0x21936e;}_0x63228f=sanitizeRemoteUri(_0x21936e[_0x05c0('0x88')]);_0xe0616d=getWebApiUrl(_0x63228f);var _0x3e2d91={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x21936e[_0x05c0('0x89')]+'/oauth2/token','form':{'client_id':_0x21936e[_0x05c0('0x8a')],'resource':_0x63228f,'username':_0x21936e[_0x05c0('0x86')],'password':_0x21936e['password'],'grant_type':_0x05c0('0x87'),'client_secret':_0x21936e[_0x05c0('0x90')]},'json':!![]};return rp(_0x3e2d91);}})[_0x05c0('0xe')](function(_0x63a0b7){_0x649027=_0x63a0b7[_0x05c0('0x8f')];var _0x319d6c={'method':_0x05c0('0x91'),'uri':encodeURI(_0xe0616d+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x269998+'\x27'),'headers':{'Authorization':_0x05c0('0x92')+_0x649027,'If-None-Match':null,'OData-Version':_0x05c0('0x93')},'json':!![]};return rp(_0x319d6c);})[_0x05c0('0xe')](function(_0x494668){var _0x39a755=_0x494668[_0x05c0('0x94')][0x0];var _0x1633b2=_0x39a755[_0x05c0('0x95')];var _0x5500ab={'method':_0x05c0('0x91'),'uri':_0xe0616d+'EntityDefinitions('+_0x1633b2+_0x05c0('0x96'),'headers':{'Authorization':_0x05c0('0x92')+_0x649027,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5500ab);})[_0x05c0('0xe')](function(_0x1f15fb){_0x2dbe3b=_0x1f15fb;_0x14dc39=_0x2dbe3b[_0x05c0('0x97')];_0x14dc39=_[_0x05c0('0x98')](_0x14dc39,function(_0x15ecd2){return!_0x5e4cb9[_0x05c0('0x99')](_0x15ecd2[_0x05c0('0x9a')]);});var _0x61d78d=[];var _0x231187=[];_0x14dc39[_0x05c0('0x9b')](function(_0x158150){if(_0x158150[_0x05c0('0x9c')]){var _0x57834d=_0x158150['@odata.type'][_0x05c0('0x9d')](_0x158150[_0x05c0('0x9c')]['lastIndexOf']('.')+0x1);if(_0x57834d==='PicklistAttributeMetadata'){_0x61d78d['push'](getSelectList(_0xe0616d,_0x2a6a8a,_0x231187,_0x2dbe3b[_0x05c0('0x95')],_0x158150[_0x05c0('0x95')],_0x649027));}}});return Promise['all'](_0x61d78d);})[_0x05c0('0xe')](function(_0x8aa2e6){_0x4b2d33=_0x8aa2e6[0x0];var _0x4dae81=[];var _0xc391ae=[];_0x14dc39[_0x05c0('0x9b')](function(_0x54e927){if(!_[_0x05c0('0x9e')](_0x54e927['@odata.type'])){var _0x33d05b=_0x54e927[_0x05c0('0x9c')]['substring'](_0x54e927[_0x05c0('0x9c')]['lastIndexOf']('.')+0x1);if(_0x33d05b===_0x05c0('0x9f')){_0x4dae81[_0x05c0('0xa0')](getBooleanList(_0xe0616d,_0x2a6a8a,_0xc391ae,_0x2dbe3b[_0x05c0('0x95')],_0x54e927['MetadataId'],_0x649027));}}});return Promise['all'](_0x4dae81);})['then'](function(_0x4ba859){_0x279855=_0x4ba859[0x0];var _0x1d211c=[];var _0x57cc15=[];_0x14dc39[_0x05c0('0x9b')](function(_0x5509e1){if(_0x5509e1['@odata.type']){var _0x365271=_0x5509e1[_0x05c0('0x9c')][_0x05c0('0x9d')](_0x5509e1['@odata.type']['lastIndexOf']('.')+0x1);if(_0x365271===_0x05c0('0xa1')||_0x365271===_0x05c0('0xa2')||_0x365271===_0x05c0('0xa3')||_0x365271===_0x05c0('0xa4')||_0x365271==='MemoAttributeMetadata'||_0x365271===_0x05c0('0xa5')||_0x365271==='StatusAttributeMetadata'||_0x365271===_0x05c0('0xa6')||_0x365271===_0x05c0('0xa7')||_0x365271===_0x05c0('0xa8')){_0x1d211c[_0x05c0('0xa0')](getInputList(_0xe0616d,_0x2a6a8a,_0x365271,_0x57cc15,_0x2dbe3b[_0x05c0('0x95')],_0x5509e1['MetadataId'],_0x649027));}}});return Promise[_0x05c0('0xa9')](_0x1d211c);})[_0x05c0('0xe')](function(_0x50f2b9){_0x3c8736=_0x50f2b9[0x0];var _0x138270=_0x4b2d33[_0x05c0('0x85')](_0x279855)['concat'](_0x3c8736);var _0x20f021={'count':_0x138270[_0x05c0('0x23')],'rows':_0x138270};return _0x20f021;})['then'](respondWithResult(_0x5b1a1d,null))[_0x05c0('0x2d')](function(_0xcc0322){var _0x342152=_0x4195ab['query'][_0x05c0('0xaa')]?0x1f4:_0xcc0322[_0x05c0('0xab')]||0x1f4;logger[_0x05c0('0x12')](_0xcc0322['stack']);delete _0xcc0322[_0x05c0('0x14')];if(_0x342152===0x191){_0x342152=0x190;}_0x5b1a1d[_0x05c0('0xa')](_0x342152)['send'](_0x4195ab[_0x05c0('0x20')]['test']?{'message':_0x05c0('0xac'),'statusCode':_0xcc0322[_0x05c0('0xab')]}:_0xcc0322);});};function getSelectList(_0xa88af6,_0x78a7f6,_0x3ef6c5,_0x32a547,_0x4cb14c,_0x256c70){var _0x8365be={'method':'GET','uri':_0xa88af6+_0x05c0('0xad')+_0x32a547+_0x05c0('0xae')+_0x4cb14c+_0x05c0('0xaf')+_0x05c0('0xb0'),'headers':{'Authorization':_0x05c0('0x92')+_0x256c70,'If-None-Match':null,'OData-Version':_0x05c0('0x93')},'json':!![]};return rp(_0x8365be)[_0x05c0('0xe')](function(_0x28794e){var _0x33e745=[];var _0x254af3=_0x28794e['OptionSet'][_0x05c0('0xb1')];_0x254af3[_0x05c0('0x9b')](function(_0x2c9e13){_0x33e745[_0x05c0('0xa0')]({'name':_0x2c9e13[_0x05c0('0xb2')][_0x05c0('0xb3')]['Label'],'value':String(_0x2c9e13[_0x05c0('0xb4')])});});var _0x4bbe11={'id':_0x78a7f6+'_'+_0x28794e[_0x05c0('0x9a')],'name':_0x28794e['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x33e745};_0x3ef6c5[_0x05c0('0xa0')](_0x4bbe11);return _0x3ef6c5;});}function getBooleanList(_0x14e382,_0x358ccd,_0x1adb44,_0x38dc39,_0x2f4fcc,_0x54a0c2){var _0x23fccf={'method':'GET','uri':_0x14e382+_0x05c0('0xad')+_0x38dc39+_0x05c0('0xae')+_0x2f4fcc+_0x05c0('0xb5'),'headers':{'Authorization':_0x05c0('0x92')+_0x54a0c2,'If-None-Match':null,'OData-Version':_0x05c0('0x93')},'json':!![]};return rp(_0x23fccf)['then'](function(_0x5104b){var _0x475fcc=[];_0x475fcc[_0x05c0('0xa0')]({'name':_0x5104b[_0x05c0('0xb6')][_0x05c0('0xb7')][_0x05c0('0xb2')][_0x05c0('0xb3')][_0x05c0('0xb2')],'value':_0x05c0('0xb8')},{'name':_0x5104b[_0x05c0('0xb6')][_0x05c0('0xb9')][_0x05c0('0xb2')][_0x05c0('0xb3')][_0x05c0('0xb2')],'value':'false'});var _0x5ed81b={'id':_0x358ccd+'_'+_0x5104b['LogicalName'],'name':_0x5104b[_0x05c0('0xba')][_0x05c0('0xb3')][_0x05c0('0xb2')],'custom':![],'options':_0x475fcc};_0x1adb44[_0x05c0('0xa0')](_0x5ed81b);return _0x1adb44;});}function getInputList(_0x562e8a,_0x59f514,_0x1a8d78,_0x3407d0,_0x4f943e,_0xa64b18,_0x25aaaa){var _0x12c10e={'method':_0x05c0('0x91'),'uri':_0x562e8a+_0x05c0('0xad')+_0x4f943e+_0x05c0('0xae')+_0xa64b18+_0x05c0('0xbb')+_0x1a8d78+_0x05c0('0xbc'),'headers':{'Authorization':_0x05c0('0x92')+_0x25aaaa,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x12c10e)['then'](function(_0x2bdd17){var _0x180ac8={'id':_0x59f514+'_'+_0x2bdd17['LogicalName'],'name':_0x2bdd17[_0x05c0('0xba')][_0x05c0('0xb3')]?_0x2bdd17[_0x05c0('0xba')]['UserLocalizedLabel'][_0x05c0('0xb2')]:_0x2bdd17[_0x05c0('0x9a')],'custom':![],'options':[]};_0x3407d0['push'](_0x180ac8);return _0x3407d0;});}
\ No newline at end of file
+var _0xe73f=['rows','catch','params','include','find','create','body','findOne','Dynamics365Configuration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','%s/api/data/v9.0/','getFields','ticketType','incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientSecret','CloudProvider','data5','modernAuthentication','data7','POST','/oauth2/token','clientId','access_token','GET','4.0','value','MetadataId','EntityDefinitions(','Attributes','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','all','concat','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Attributes(','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','offset','undefined','count','limit','Content-Range','json','update','destroy','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','then','includeAll','findAll'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe73f,0x8f));var _0xfe73=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe73f[_0x15bc81];return _0x59440e;};'use strict';var rp=require(_0xfe73('0x0'));var util=require(_0xfe73('0x1'));var _=require('lodash');var qs=require(_0xfe73('0x2'));var logger=require(_0xfe73('0x3'))(_0xfe73('0x4'));var db=require(_0xfe73('0x5'))['db'];var integrations=require(_0xfe73('0x6'));function respondWithResult(_0x4ca17d,_0x4a716f){_0x4a716f=_0x4a716f||0xc8;return function(_0x17fe43){if(_0x17fe43){return _0x4ca17d[_0xfe73('0x7')](_0x4a716f)['json'](_0x17fe43);}};}function respondWithFilteredResult(_0x5bc542,_0x33a13b){return function(_0x2acd09){if(_0x2acd09){var _0x55cd2b=typeof _0x33a13b[_0xfe73('0x8')]===_0xfe73('0x9')&&typeof _0x33a13b['limit']===_0xfe73('0x9');var _0x536b67=_0x2acd09[_0xfe73('0xa')];var _0x54a071=_0x55cd2b?0x0:_0x33a13b[_0xfe73('0x8')];var _0x16e67e=_0x55cd2b?_0x2acd09[_0xfe73('0xa')]:_0x33a13b['offset']+_0x33a13b[_0xfe73('0xb')];var _0x53452d;if(_0x16e67e>=_0x536b67){_0x16e67e=_0x536b67;_0x53452d=0xc8;}else{_0x53452d=0xce;}_0x5bc542[_0xfe73('0x7')](_0x53452d);return _0x5bc542['set'](_0xfe73('0xc'),_0x54a071+'-'+_0x16e67e+'/'+_0x536b67)[_0xfe73('0xd')](_0x2acd09);}return null;};}function saveUpdates(_0x569651){return function(_0x4f8daf){if(_0x4f8daf){return _0x4f8daf[_0xfe73('0xe')](_0x569651)['then'](function(_0x448b7d){return _0x448b7d;});}return null;};}function removeEntity(_0x4a0cf3){return function(_0x4fc053){if(_0x4fc053){return _0x4fc053[_0xfe73('0xf')]()['then'](function(){_0x4a0cf3[_0xfe73('0x7')](0xcc)[_0xfe73('0x10')]();});}};}function handleEntityNotFound(_0x4e6131){return function(_0xf21d21){if(!_0xf21d21){_0x4e6131[_0xfe73('0x11')](0x194);}return _0xf21d21;};}function handleError(_0x50aee4,_0x13a08a){_0x13a08a=_0x13a08a||0x1f4;return function(_0x258a67){logger[_0xfe73('0x12')](_0x258a67[_0xfe73('0x13')]);if(_0x258a67[_0xfe73('0x14')]){delete _0x258a67[_0xfe73('0x14')];}_0x50aee4[_0xfe73('0x7')](_0x13a08a)[_0xfe73('0x15')](_0x258a67);};}exports[_0xfe73('0x16')]=function(_0x55fcc1,_0xd8c5ac){var _0x8fe800={},_0x2e6feb={},_0x906739={'count':0x0,'rows':[]};var _0x2ca13c=_[_0xfe73('0x17')](db[_0xfe73('0x18')][_0xfe73('0x19')],function(_0x308029){return{'name':_0x308029['fieldName'],'type':_0x308029['type'][_0xfe73('0x1a')]};});_0x2e6feb[_0xfe73('0x1b')]=_[_0xfe73('0x17')](_0x2ca13c,_0xfe73('0x14'));_0x2e6feb[_0xfe73('0x1c')]=_[_0xfe73('0x1d')](_0x55fcc1[_0xfe73('0x1c')]);_0x2e6feb['filters']=_[_0xfe73('0x1e')](_0x2e6feb['model'],_0x2e6feb[_0xfe73('0x1c')]);_0x8fe800['attributes']=_[_0xfe73('0x1e')](_0x2e6feb[_0xfe73('0x1b')],qs[_0xfe73('0x1f')](_0x55fcc1['query'][_0xfe73('0x1f')]));_0x8fe800[_0xfe73('0x20')]=_0x8fe800[_0xfe73('0x20')][_0xfe73('0x21')]?_0x8fe800[_0xfe73('0x20')]:_0x2e6feb[_0xfe73('0x1b')];if(!_0x55fcc1[_0xfe73('0x1c')][_0xfe73('0x22')](_0xfe73('0x23'))){_0x8fe800[_0xfe73('0xb')]=qs['limit'](_0x55fcc1[_0xfe73('0x1c')][_0xfe73('0xb')]);_0x8fe800['offset']=qs['offset'](_0x55fcc1['query'][_0xfe73('0x8')]);}_0x8fe800[_0xfe73('0x24')]=qs[_0xfe73('0x25')](_0x55fcc1[_0xfe73('0x1c')][_0xfe73('0x25')]);_0x8fe800[_0xfe73('0x26')]=qs['filters'](_[_0xfe73('0x27')](_0x55fcc1[_0xfe73('0x1c')],_0x2e6feb[_0xfe73('0x28')]),_0x2ca13c);if(_0x55fcc1[_0xfe73('0x1c')][_0xfe73('0x29')]){_0x8fe800[_0xfe73('0x26')]=_[_0xfe73('0x2a')](_0x8fe800['where'],{'$or':_['map'](_0x2ca13c,function(_0x9ff048){if(_0x9ff048['type']!=='VIRTUAL'){var _0x88850e={};_0x88850e[_0x9ff048[_0xfe73('0x14')]]={'$like':'%'+_0x55fcc1[_0xfe73('0x1c')]['filter']+'%'};return _0x88850e;}})});}_0x8fe800=_[_0xfe73('0x2a')]({},_0x8fe800,_0x55fcc1[_0xfe73('0x2b')]);var _0x9c1c76={'where':_0x8fe800[_0xfe73('0x26')]};return db['Dynamics365Account'][_0xfe73('0xa')](_0x9c1c76)[_0xfe73('0x2c')](function(_0x45daf2){_0x906739[_0xfe73('0xa')]=_0x45daf2;if(_0x55fcc1[_0xfe73('0x1c')][_0xfe73('0x2d')]){_0x8fe800['include']=[{'all':!![]}];}return db[_0xfe73('0x18')][_0xfe73('0x2e')](_0x8fe800);})[_0xfe73('0x2c')](function(_0x4f101f){_0x906739[_0xfe73('0x2f')]=_0x4f101f;return _0x906739;})['then'](respondWithFilteredResult(_0xd8c5ac,_0x8fe800))[_0xfe73('0x30')](handleError(_0xd8c5ac,null));};exports['show']=function(_0x1e63e3,_0x4cd0b2){var _0x36f15a={'raw':![],'where':{'id':_0x1e63e3[_0xfe73('0x31')]['id']}},_0x13eaf2={};_0x13eaf2[_0xfe73('0x1b')]=_[_0xfe73('0x1d')](db[_0xfe73('0x18')][_0xfe73('0x19')]);_0x13eaf2[_0xfe73('0x1c')]=_['keys'](_0x1e63e3[_0xfe73('0x1c')]);_0x13eaf2[_0xfe73('0x28')]=_[_0xfe73('0x1e')](_0x13eaf2[_0xfe73('0x1b')],_0x13eaf2[_0xfe73('0x1c')]);_0x36f15a[_0xfe73('0x20')]=_[_0xfe73('0x1e')](_0x13eaf2['model'],qs['fields'](_0x1e63e3[_0xfe73('0x1c')]['fields']));_0x36f15a[_0xfe73('0x20')]=_0x36f15a[_0xfe73('0x20')][_0xfe73('0x21')]?_0x36f15a[_0xfe73('0x20')]:_0x13eaf2[_0xfe73('0x1b')];if(_0x1e63e3[_0xfe73('0x1c')][_0xfe73('0x2d')]){_0x36f15a[_0xfe73('0x32')]=[{'all':!![]}];}_0x36f15a=_[_0xfe73('0x2a')]({},_0x36f15a,_0x1e63e3[_0xfe73('0x2b')]);return db[_0xfe73('0x18')][_0xfe73('0x33')](_0x36f15a)[_0xfe73('0x2c')](handleEntityNotFound(_0x4cd0b2,null))[_0xfe73('0x2c')](respondWithResult(_0x4cd0b2,null))[_0xfe73('0x30')](handleError(_0x4cd0b2,null));};exports[_0xfe73('0x34')]=function(_0x1e69c4,_0x320887){return db['Dynamics365Account'][_0xfe73('0x34')](_0x1e69c4[_0xfe73('0x35')],{})[_0xfe73('0x2c')](respondWithResult(_0x320887,0xc9))['catch'](handleError(_0x320887,null));};exports['update']=function(_0x18a0f5,_0x5612cd){if(_0x18a0f5[_0xfe73('0x35')]['id']){delete _0x18a0f5[_0xfe73('0x35')]['id'];}return db[_0xfe73('0x18')][_0xfe73('0x33')]({'where':{'id':_0x18a0f5[_0xfe73('0x31')]['id']}})[_0xfe73('0x2c')](handleEntityNotFound(_0x5612cd,null))[_0xfe73('0x2c')](saveUpdates(_0x18a0f5[_0xfe73('0x35')],null))[_0xfe73('0x2c')](respondWithResult(_0x5612cd,null))[_0xfe73('0x30')](handleError(_0x5612cd,null));};exports[_0xfe73('0xf')]=function(_0x353c7a,_0x59b915){return db[_0xfe73('0x18')][_0xfe73('0x33')]({'where':{'id':_0x353c7a[_0xfe73('0x31')]['id']}})['then'](handleEntityNotFound(_0x59b915,null))[_0xfe73('0x2c')](removeEntity(_0x59b915,null))[_0xfe73('0x30')](handleError(_0x59b915,null));};exports['getConfigurations']=function(_0x35b17f,_0x43734c){var _0x3fdfc8={};var _0x102a21={};var _0x23016f;var _0x23fe92;return db[_0xfe73('0x18')][_0xfe73('0x36')]({'where':{'id':_0x35b17f[_0xfe73('0x31')]['id']}})['then'](handleEntityNotFound(_0x43734c,null))[_0xfe73('0x2c')](function(_0x180b62){if(_0x180b62){_0x23016f=_0x180b62;_0x102a21[_0xfe73('0x1b')]=_[_0xfe73('0x1d')](db[_0xfe73('0x37')]['rawAttributes']);_0x102a21['query']=_[_0xfe73('0x1d')](_0x35b17f[_0xfe73('0x1c')]);_0x102a21[_0xfe73('0x28')]=_[_0xfe73('0x1e')](_0x102a21[_0xfe73('0x1b')],_0x102a21[_0xfe73('0x1c')]);_0x3fdfc8[_0xfe73('0x20')]=_['intersection'](_0x102a21[_0xfe73('0x1b')],qs[_0xfe73('0x1f')](_0x35b17f[_0xfe73('0x1c')]['fields']));_0x3fdfc8[_0xfe73('0x20')]=_0x3fdfc8[_0xfe73('0x20')]['length']?_0x3fdfc8[_0xfe73('0x20')]:_0x102a21[_0xfe73('0x1b')];_0x3fdfc8['order']=qs[_0xfe73('0x25')](_0x35b17f[_0xfe73('0x1c')][_0xfe73('0x25')]);_0x3fdfc8[_0xfe73('0x26')]=qs['filters'](_[_0xfe73('0x27')](_0x35b17f[_0xfe73('0x1c')],_0x102a21[_0xfe73('0x28')]));if(_0x35b17f[_0xfe73('0x1c')][_0xfe73('0x29')]){_0x3fdfc8[_0xfe73('0x26')]=_['merge'](_0x3fdfc8['where'],{'$or':_[_0xfe73('0x17')](_0x3fdfc8[_0xfe73('0x20')],function(_0x2e2a63){var _0x3764d5={};_0x3764d5[_0x2e2a63]={'$like':'%'+_0x35b17f[_0xfe73('0x1c')][_0xfe73('0x29')]+'%'};return _0x3764d5;})});}_0x3fdfc8=_[_0xfe73('0x2a')]({},_0x3fdfc8,_0x35b17f[_0xfe73('0x2b')]);return _0x23016f[_0xfe73('0x38')](_0x3fdfc8);}})[_0xfe73('0x2c')](function(_0x4fcbf6){if(_0x4fcbf6){_0x23fe92=_0x4fcbf6[_0xfe73('0x21')];if(!_0x35b17f[_0xfe73('0x1c')][_0xfe73('0x22')](_0xfe73('0x23'))){_0x3fdfc8[_0xfe73('0xb')]=qs[_0xfe73('0xb')](_0x35b17f[_0xfe73('0x1c')]['limit']);_0x3fdfc8[_0xfe73('0x8')]=qs['offset'](_0x35b17f['query'][_0xfe73('0x8')]);}return _0x23016f[_0xfe73('0x38')](_0x3fdfc8);}})[_0xfe73('0x2c')](function(_0x4846e8){if(_0x4846e8){return _0x4846e8?{'count':_0x23fe92,'rows':_0x4846e8}:null;}})[_0xfe73('0x2c')](respondWithResult(_0x43734c,null))[_0xfe73('0x30')](handleError(_0x43734c,null));};exports[_0xfe73('0x39')]=function(_0x23f1d7,_0x312df7){if(_0x23f1d7[_0xfe73('0x35')]['id']){delete _0x23f1d7[_0xfe73('0x35')]['id'];}return db[_0xfe73('0x18')][_0xfe73('0x36')]({'where':{'id':_0x23f1d7[_0xfe73('0x31')]['id']}})['then'](handleEntityNotFound(_0x312df7,null))[_0xfe73('0x2c')](function(_0x5dc2b6){if(_0x5dc2b6){_0x23f1d7[_0xfe73('0x35')][_0xfe73('0x3a')]=_0x5dc2b6['id'];_0x23f1d7[_0xfe73('0x35')][_0xfe73('0x3b')]=integrations[_0xfe73('0x3c')](_0x23f1d7['body'][_0xfe73('0x3d')],_0x23f1d7[_0xfe73('0x35')][_0xfe73('0x3e')]);_0x23f1d7['body'][_0xfe73('0x3f')]=integrations[_0xfe73('0x40')](_0x23f1d7[_0xfe73('0x35')]['channel'],_0x23f1d7[_0xfe73('0x35')]['type']);return db[_0xfe73('0x37')][_0xfe73('0x34')](_0x23f1d7[_0xfe73('0x35')],{'include':[{'model':db[_0xfe73('0x41')],'as':_0xfe73('0x3b')},{'model':db[_0xfe73('0x41')],'as':'Descriptions'}]});}return null;})[_0xfe73('0x2c')](respondWithResult(_0x312df7,null))[_0xfe73('0x30')](handleError(_0x312df7,null));};function sanitizeRemoteUri(_0x24961f){var _0x96d1b1=_0x24961f['slice'](-0x1);if(_0x96d1b1==='/')return _0x24961f[_0xfe73('0x42')](0x0,_0x24961f[_0xfe73('0x43')](_0x96d1b1));return _0x24961f;}function getWebApiUrl(_0x3d8bf7){return util[_0xfe73('0x44')](_0xfe73('0x45'),_0x3d8bf7);}exports[_0xfe73('0x46')]=function(_0x32043c,_0x4c9074){var _0x180f00=_0x32043c[_0xfe73('0x1c')][_0xfe73('0x47')];var _0x45b447=_0x180f00===_0xfe73('0x48')?'Incident':_0xfe73('0x49');var _0x4fbb59='';var _0x1332be='';var _0x297d98='';var _0x398764='';var _0x35f446='';var _0x4e634e='';var _0x112dc4='';var _0x4b0877='';var _0x285ef5=[_0xfe73('0x4a'),_0xfe73('0x4b'),_0xfe73('0x4c'),_0xfe73('0x4d'),_0xfe73('0x4e'),_0xfe73('0x4f'),_0xfe73('0x50'),_0xfe73('0x51'),'directioncode',_0xfe73('0x52')];var _0x5305a7=['accountidname',_0xfe73('0x53'),_0xfe73('0x54'),'billedserviceunits',_0xfe73('0x55'),_0xfe73('0x56'),_0xfe73('0x57'),_0xfe73('0x58'),_0xfe73('0x59'),_0xfe73('0x5a'),_0xfe73('0x5b'),_0xfe73('0x5c'),'createdon',_0xfe73('0x5d'),_0xfe73('0x5e'),'customeridname',_0xfe73('0x5f'),_0xfe73('0x60'),'emailaddress',_0xfe73('0x61'),'entityimage_timestamp','entityimage_url',_0xfe73('0x62'),_0xfe73('0x63'),'firstresponsebykpiidname',_0xfe73('0x64'),_0xfe73('0x65'),_0xfe73('0x66'),_0xfe73('0x67'),_0xfe73('0x68'),_0xfe73('0x69'),'modifiedbyexternalpartyname','modifiedbyexternalpartyyominame',_0xfe73('0x6a'),_0xfe73('0x6b'),_0xfe73('0x6c'),_0xfe73('0x6d'),_0xfe73('0x6e'),_0xfe73('0x6f'),_0xfe73('0x70'),_0xfe73('0x71'),'onholdtime',_0xfe73('0x72'),_0xfe73('0x73'),_0xfe73('0x74'),_0xfe73('0x75'),_0xfe73('0x76'),_0xfe73('0x77'),_0xfe73('0x78'),_0xfe73('0x79'),_0xfe73('0x7a'),_0xfe73('0x7b'),_0xfe73('0x7c'),_0xfe73('0x7d'),'responseby','responsiblecontactidname',_0xfe73('0x7e'),'sentimentvalue',_0xfe73('0x7f'),_0xfe73('0x80'),_0xfe73('0x81'),_0xfe73('0x82'),_0xfe73('0x83'),_0xfe73('0x84'),'ticketnumber',_0xfe73('0x85'),_0xfe73('0x86'),_0xfe73('0x87'),_0xfe73('0x88'),_0xfe73('0x89')];var _0x31d368=_0x285ef5['concat'](_0x5305a7);return db[_0xfe73('0x18')][_0xfe73('0x36')]({'where':{'id':_0x32043c[_0xfe73('0x31')]['id']},'attributes':['id',_0xfe73('0x8a'),_0xfe73('0x8b'),_0xfe73('0x8c'),_0xfe73('0x8d'),'clientId',_0xfe73('0x8e'),'modernAuthentication'],'include':[{'model':db[_0xfe73('0x8f')],'as':_0xfe73('0x8f'),'attributes':['id',_0xfe73('0x90'),'data7']}]})['then'](handleEntityNotFound(_0x4c9074,null))[_0xfe73('0x2c')](function(_0x41db01){if(_0x41db01){if(_0x41db01[_0xfe73('0x91')]){_0x41db01['access_token']=_0x41db01[_0xfe73('0x8f')][_0xfe73('0x90')];_0x4b0877=sanitizeRemoteUri(_0x41db01[_0xfe73('0x8f')][_0xfe73('0x92')]);_0x112dc4=getWebApiUrl(_0x4b0877);return _0x41db01;}_0x4b0877=sanitizeRemoteUri(_0x41db01[_0xfe73('0x8c')]);_0x112dc4=getWebApiUrl(_0x4b0877);var _0x33ffed={'method':_0xfe73('0x93'),'uri':'https://login.microsoftonline.com/'+_0x41db01['tenantId']+_0xfe73('0x94'),'form':{'client_id':_0x41db01[_0xfe73('0x95')],'resource':_0x4b0877,'username':_0x41db01[_0xfe73('0x8a')],'password':_0x41db01[_0xfe73('0x8b')],'grant_type':_0xfe73('0x8b'),'client_secret':_0x41db01[_0xfe73('0x8e')]},'json':!![]};return rp(_0x33ffed);}})['then'](function(_0x38fdaa){_0x4e634e=_0x38fdaa[_0xfe73('0x96')];var _0x132590={'method':_0xfe73('0x97'),'uri':encodeURI(_0x112dc4+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x45b447+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x4e634e,'If-None-Match':null,'OData-Version':_0xfe73('0x98')},'json':!![]};return rp(_0x132590);})[_0xfe73('0x2c')](function(_0x3abb12){var _0x5a507e=_0x3abb12[_0xfe73('0x99')][0x0];var _0x5ef797=_0x5a507e[_0xfe73('0x9a')];var _0x4c9c48={'method':'GET','uri':_0x112dc4+_0xfe73('0x9b')+_0x5ef797+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x4e634e,'If-None-Match':null,'OData-Version':_0xfe73('0x98')},'json':!![]};return rp(_0x4c9c48);})['then'](function(_0x4b42cf){_0x4fbb59=_0x4b42cf;_0x1332be=_0x4fbb59[_0xfe73('0x9c')];_0x1332be=_['remove'](_0x1332be,function(_0x50c66b){return!_0x31d368[_0xfe73('0x9d')](_0x50c66b[_0xfe73('0x9e')]);});var _0x1b1a3=[];var _0x4c0fd6=[];_0x1332be[_0xfe73('0x9f')](function(_0x467cd5){if(_0x467cd5[_0xfe73('0xa0')]){var _0x15b89b=_0x467cd5[_0xfe73('0xa0')][_0xfe73('0x42')](_0x467cd5['@odata.type'][_0xfe73('0x43')]('.')+0x1);if(_0x15b89b===_0xfe73('0xa1')){_0x1b1a3[_0xfe73('0xa2')](getSelectList(_0x112dc4,_0x180f00,_0x4c0fd6,_0x4fbb59[_0xfe73('0x9a')],_0x467cd5[_0xfe73('0x9a')],_0x4e634e));}}});return Promise['all'](_0x1b1a3);})['then'](function(_0x45616f){_0x297d98=_0x45616f[0x0];var _0x2434ae=[];var _0x2cb776=[];_0x1332be[_0xfe73('0x9f')](function(_0x354110){if(!_[_0xfe73('0xa3')](_0x354110[_0xfe73('0xa0')])){var _0x31c814=_0x354110[_0xfe73('0xa0')][_0xfe73('0x42')](_0x354110['@odata.type'][_0xfe73('0x43')]('.')+0x1);if(_0x31c814===_0xfe73('0xa4')){_0x2434ae[_0xfe73('0xa2')](getBooleanList(_0x112dc4,_0x180f00,_0x2cb776,_0x4fbb59[_0xfe73('0x9a')],_0x354110[_0xfe73('0x9a')],_0x4e634e));}}});return Promise['all'](_0x2434ae);})[_0xfe73('0x2c')](function(_0x2287cd){_0x398764=_0x2287cd[0x0];var _0x46d20a=[];var _0x52fc75=[];_0x1332be[_0xfe73('0x9f')](function(_0x5bf3a7){if(_0x5bf3a7['@odata.type']){var _0x473854=_0x5bf3a7[_0xfe73('0xa0')][_0xfe73('0x42')](_0x5bf3a7['@odata.type'][_0xfe73('0x43')]('.')+0x1);if(_0x473854===_0xfe73('0xa5')||_0x473854===_0xfe73('0xa6')||_0x473854===_0xfe73('0xa7')||_0x473854==='IntegerAttributeMetadata'||_0x473854===_0xfe73('0xa8')||_0x473854==='DateTimeAttributeMetadata'||_0x473854===_0xfe73('0xa9')||_0x473854===_0xfe73('0xaa')||_0x473854==='StateAttributeMetadata'||_0x473854===_0xfe73('0xab')){_0x46d20a[_0xfe73('0xa2')](getInputList(_0x112dc4,_0x180f00,_0x473854,_0x52fc75,_0x4fbb59[_0xfe73('0x9a')],_0x5bf3a7[_0xfe73('0x9a')],_0x4e634e));}}});return Promise[_0xfe73('0xac')](_0x46d20a);})[_0xfe73('0x2c')](function(_0x3f6299){_0x35f446=_0x3f6299[0x0];var _0x3198e4=_0x297d98[_0xfe73('0xad')](_0x398764)[_0xfe73('0xad')](_0x35f446);var _0x502409={'count':_0x3198e4[_0xfe73('0x21')],'rows':_0x3198e4};return _0x502409;})[_0xfe73('0x2c')](respondWithResult(_0x4c9074,null))[_0xfe73('0x30')](function(_0x5425cd){var _0x130d49=_0x32043c['query'][_0xfe73('0xae')]?0x1f4:_0x5425cd['statusCode']||0x1f4;logger[_0xfe73('0x12')](_0x5425cd['stack']);delete _0x5425cd[_0xfe73('0x14')];if(_0x130d49===0x191){_0x130d49=0x190;}_0x4c9074['status'](_0x130d49)[_0xfe73('0x15')](_0x32043c[_0xfe73('0x1c')][_0xfe73('0xae')]?{'message':_0xfe73('0xaf'),'statusCode':_0x5425cd['statusCode']}:_0x5425cd);});};function getSelectList(_0x3b6625,_0x1dcff4,_0x2da90b,_0x5eb492,_0x235dc8,_0x2bc45f){var _0x4ecc2b={'method':_0xfe73('0x97'),'uri':_0x3b6625+_0xfe73('0x9b')+_0x5eb492+')/Attributes('+_0x235dc8+_0xfe73('0xb0')+_0xfe73('0xb1'),'headers':{'Authorization':_0xfe73('0xb2')+_0x2bc45f,'If-None-Match':null,'OData-Version':_0xfe73('0x98')},'json':!![]};return rp(_0x4ecc2b)[_0xfe73('0x2c')](function(_0x2a8349){var _0xa5905=[];var _0x4b18b8=_0x2a8349[_0xfe73('0xb3')][_0xfe73('0xb4')];_0x4b18b8[_0xfe73('0x9f')](function(_0x545990){_0xa5905['push']({'name':_0x545990[_0xfe73('0xb5')][_0xfe73('0xb6')][_0xfe73('0xb5')],'value':String(_0x545990['Value'])});});var _0x551fa7={'id':_0x1dcff4+'_'+_0x2a8349[_0xfe73('0x9e')],'name':_0x2a8349[_0xfe73('0xb7')][_0xfe73('0xb6')][_0xfe73('0xb5')],'custom':![],'options':_0xa5905};_0x2da90b[_0xfe73('0xa2')](_0x551fa7);return _0x2da90b;});}function getBooleanList(_0x454d38,_0x1732a3,_0x3a7d08,_0x35789a,_0x1bf1d4,_0x33f4d9){var _0xa11a2b={'method':_0xfe73('0x97'),'uri':_0x454d38+_0xfe73('0x9b')+_0x35789a+_0xfe73('0xb8')+_0x1bf1d4+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':'Bearer\x20'+_0x33f4d9,'If-None-Match':null,'OData-Version':_0xfe73('0x98')},'json':!![]};return rp(_0xa11a2b)['then'](function(_0x49191a){var _0x500696=[];_0x500696[_0xfe73('0xa2')]({'name':_0x49191a[_0xfe73('0xb3')][_0xfe73('0xb9')][_0xfe73('0xb5')]['UserLocalizedLabel'][_0xfe73('0xb5')],'value':_0xfe73('0xba')},{'name':_0x49191a[_0xfe73('0xb3')]['FalseOption'][_0xfe73('0xb5')][_0xfe73('0xb6')][_0xfe73('0xb5')],'value':_0xfe73('0xbb')});var _0xb519d4={'id':_0x1732a3+'_'+_0x49191a[_0xfe73('0x9e')],'name':_0x49191a[_0xfe73('0xb7')][_0xfe73('0xb6')]['Label'],'custom':![],'options':_0x500696};_0x3a7d08[_0xfe73('0xa2')](_0xb519d4);return _0x3a7d08;});}function getInputList(_0x2492c7,_0xfba39c,_0x5728c2,_0x48e425,_0x20509b,_0x133f98,_0x46b24c){var _0x567751={'method':_0xfe73('0x97'),'uri':_0x2492c7+_0xfe73('0x9b')+_0x20509b+')/Attributes('+_0x133f98+_0xfe73('0xbc')+_0x5728c2+_0xfe73('0xbd'),'headers':{'Authorization':_0xfe73('0xb2')+_0x46b24c,'If-None-Match':null,'OData-Version':_0xfe73('0x98')},'json':!![]};return rp(_0x567751)['then'](function(_0x2b1b82){var _0x599801={'id':_0xfba39c+'_'+_0x2b1b82[_0xfe73('0x9e')],'name':_0x2b1b82[_0xfe73('0xb7')]['UserLocalizedLabel']?_0x2b1b82[_0xfe73('0xb7')][_0xfe73('0xb6')][_0xfe73('0xb5')]:_0x2b1b82[_0xfe73('0x9e')],'custom':![],'options':[]};_0x48e425[_0xfe73('0xa2')](_0x599801);return _0x48e425;});}
\ No newline at end of file
index 7da8760..2998053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x4bb830,_0x2c7dd8){var _0x48e5c2=function(_0x12799a){while(--_0x12799a){_0x4bb830['push'](_0x4bb830['shift']());}};_0x48e5c2(++_0x2c7dd8);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0xd818ad,_0x3de8c0){var _0x27e020=function(_0x24a29d){while(--_0x24a29d){_0xd818ad['push'](_0xd818ad['shift']());}};_0x27e020(++_0x3de8c0);}(_0xe706,0xa3));var _0x6e70=function(_0x5b142f,_0x10815a){_0x5b142f=_0x5b142f-0x0;var _0x327bbd=_0xe706[_0x5b142f];return _0x327bbd;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));var integrations=require(_0x6e70('0xa'));module[_0x6e70('0xb')]=function(_0x4381d1,_0x36357b){return _0x4381d1[_0x6e70('0xc')](_0x6e70('0xd'),attributes,{'tableName':_0x6e70('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3b06ad3..5c4a460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5d0=['rpc','../../config/environment','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetDynamics365Account','findAll','raw','options','attributes','limit','map','include','model','ShowDynamics365Account','Dynamics365Account','where','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x18369a,_0x4e8835){var _0xa6e2b8=function(_0x27fe31){while(--_0x27fe31){_0x18369a['push'](_0x18369a['shift']());}};_0xa6e2b8(++_0x4e8835);}(_0xf5d0,0x1c0));var _0x0f5d=function(_0x45f488,_0x25f180){_0x45f488=_0x45f488-0x0;var _0x52f5eb=_0xf5d0[_0x45f488];return _0x52f5eb;};'use strict';var _=require(_0x0f5d('0x0'));var util=require(_0x0f5d('0x1'));var moment=require('moment');var BPromise=require(_0x0f5d('0x2'));var rs=require(_0x0f5d('0x3'));var fs=require('fs');var Redis=require(_0x0f5d('0x4'));var db=require(_0x0f5d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f5d('0x6'))(_0x0f5d('0x7'));var config=require(_0x0f5d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0f5d('0x9')][_0x0f5d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e882f,_0xcf329c,_0x1f308d){return new BPromise(function(_0x1acd5,_0x2ef8d7){return client[_0x0f5d('0xb')](_0x7e882f,_0x1f308d)[_0x0f5d('0xc')](function(_0x1800bd){logger['info'](_0x0f5d('0xd'),_0xcf329c,_0x0f5d('0xe'));logger[_0x0f5d('0xf')](_0x0f5d('0x10'),_0xcf329c,_0x0f5d('0xe'),JSON[_0x0f5d('0x11')](_0x1800bd));if(_0x1800bd[_0x0f5d('0x12')]){if(_0x1800bd[_0x0f5d('0x12')]['code']===0x1f4){logger[_0x0f5d('0x12')](_0x0f5d('0xd'),_0xcf329c,_0x1800bd[_0x0f5d('0x12')]['message']);return _0x2ef8d7(_0x1800bd[_0x0f5d('0x12')][_0x0f5d('0x13')]);}logger[_0x0f5d('0x12')](_0x0f5d('0xd'),_0xcf329c,_0x1800bd[_0x0f5d('0x12')][_0x0f5d('0x13')]);return _0x1acd5(_0x1800bd[_0x0f5d('0x12')][_0x0f5d('0x13')]);}else{logger[_0x0f5d('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0xcf329c,_0x0f5d('0xe'));_0x1acd5(_0x1800bd[_0x0f5d('0x15')][_0x0f5d('0x13')]);}})['catch'](function(_0x27aaae){logger['error'](_0x0f5d('0xd'),_0xcf329c,_0x27aaae);_0x2ef8d7(_0x27aaae);});});}exports[_0x0f5d('0x16')]=function(_0x4f7ba5){var _0x54f230=this;return new Promise(function(_0x5c0f75,_0x1cf168){return db['Dynamics365Account'][_0x0f5d('0x17')]({'raw':_0x4f7ba5['options']?_0x4f7ba5['options'][_0x0f5d('0x18')]===undefined?!![]:![]:!![],'where':_0x4f7ba5[_0x0f5d('0x19')]?_0x4f7ba5['options']['where']||null:null,'attributes':_0x4f7ba5[_0x0f5d('0x19')]?_0x4f7ba5['options'][_0x0f5d('0x1a')]||null:null,'limit':_0x4f7ba5[_0x0f5d('0x19')]?_0x4f7ba5['options'][_0x0f5d('0x1b')]||null:null,'include':_0x4f7ba5['options']?_0x4f7ba5[_0x0f5d('0x19')]['include']?_[_0x0f5d('0x1c')](_0x4f7ba5[_0x0f5d('0x19')][_0x0f5d('0x1d')],function(_0x1a7203){return{'model':db[_0x1a7203[_0x0f5d('0x1e')]],'as':_0x1a7203['as'],'attributes':_0x1a7203[_0x0f5d('0x1a')],'include':_0x1a7203['include']?_[_0x0f5d('0x1c')](_0x1a7203[_0x0f5d('0x1d')],function(_0x547272){return{'model':db[_0x547272['model']],'as':_0x547272['as'],'attributes':_0x547272[_0x0f5d('0x1a')],'include':_0x547272[_0x0f5d('0x1d')]?_[_0x0f5d('0x1c')](_0x547272['include'],function(_0x57ff92){return{'model':db[_0x57ff92['model']],'as':_0x57ff92['as'],'attributes':_0x57ff92[_0x0f5d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fb9e6){logger[_0x0f5d('0x14')](_0x0f5d('0x16'),_0x4f7ba5);logger['debug'](_0x0f5d('0x16'),_0x4f7ba5,JSON[_0x0f5d('0x11')](_0x3fb9e6));_0x5c0f75(_0x3fb9e6);})['catch'](function(_0x5ddeb1){logger[_0x0f5d('0x12')](_0x0f5d('0x16'),_0x5ddeb1['message'],_0x4f7ba5);_0x1cf168(_0x54f230[_0x0f5d('0x12')](0x1f4,_0x5ddeb1[_0x0f5d('0x13')]));});});};exports[_0x0f5d('0x1f')]=function(_0x1b66d7){var _0x152df8=this;return new Promise(function(_0x28ec45,_0x4f68da){return db[_0x0f5d('0x20')]['find']({'raw':_0x1b66d7['options']?_0x1b66d7[_0x0f5d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1b66d7[_0x0f5d('0x19')]?_0x1b66d7[_0x0f5d('0x19')][_0x0f5d('0x21')]||null:null,'attributes':_0x1b66d7[_0x0f5d('0x19')]?_0x1b66d7['options'][_0x0f5d('0x1a')]||null:null,'include':_0x1b66d7['options']?_0x1b66d7[_0x0f5d('0x19')][_0x0f5d('0x1d')]?_['map'](_0x1b66d7['options'][_0x0f5d('0x1d')],function(_0x23e8c2){return{'model':db[_0x23e8c2[_0x0f5d('0x1e')]],'as':_0x23e8c2['as'],'attributes':_0x23e8c2[_0x0f5d('0x1a')],'include':_0x23e8c2[_0x0f5d('0x1d')]?_[_0x0f5d('0x1c')](_0x23e8c2['include'],function(_0xf8df64){return{'model':db[_0xf8df64[_0x0f5d('0x1e')]],'as':_0xf8df64['as'],'attributes':_0xf8df64[_0x0f5d('0x1a')],'include':_0xf8df64[_0x0f5d('0x1d')]?_[_0x0f5d('0x1c')](_0xf8df64[_0x0f5d('0x1d')],function(_0x2816a4){return{'model':db[_0x2816a4[_0x0f5d('0x1e')]],'as':_0x2816a4['as'],'attributes':_0x2816a4[_0x0f5d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0f5d('0xc')](function(_0x356cb0){logger[_0x0f5d('0x14')](_0x0f5d('0x1f'),_0x1b66d7);logger[_0x0f5d('0xf')](_0x0f5d('0x1f'),_0x1b66d7,JSON[_0x0f5d('0x11')](_0x356cb0));_0x28ec45(_0x356cb0);})[_0x0f5d('0x22')](function(_0xb9aab1){logger[_0x0f5d('0x12')](_0x0f5d('0x1f'),_0xb9aab1[_0x0f5d('0x13')],_0x1b66d7);_0x4f68da(_0x152df8[_0x0f5d('0x12')](0x1f4,_0xb9aab1[_0x0f5d('0x13')]));});});};
\ No newline at end of file
+var _0xffa9=['attributes','limit','map','model','include','GetDynamics365Account','ShowDynamics365Account','Dynamics365Account','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','findAll','options','raw','where'];(function(_0x18e3ba,_0xaf7f3b){var _0x129589=function(_0x3c2009){while(--_0x3c2009){_0x18e3ba['push'](_0x18e3ba['shift']());}};_0x129589(++_0xaf7f3b);}(_0xffa9,0x1cf));var _0x9ffa=function(_0x414901,_0x20ee6a){_0x414901=_0x414901-0x0;var _0x2cae72=_0xffa9[_0x414901];return _0x2cae72;};'use strict';var _=require(_0x9ffa('0x0'));var util=require('util');var moment=require(_0x9ffa('0x1'));var BPromise=require(_0x9ffa('0x2'));var rs=require(_0x9ffa('0x3'));var fs=require('fs');var Redis=require(_0x9ffa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ffa('0x5'));var logger=require(_0x9ffa('0x6'))(_0x9ffa('0x7'));var config=require(_0x9ffa('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ffa('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x429aec,_0x4ec8ae,_0x20f217){return new BPromise(function(_0x5c5773,_0x8c48ff){return client[_0x9ffa('0xa')](_0x429aec,_0x20f217)[_0x9ffa('0xb')](function(_0x3e5e86){logger['info'](_0x9ffa('0xc'),_0x4ec8ae,_0x9ffa('0xd'));logger[_0x9ffa('0xe')](_0x9ffa('0xf'),_0x4ec8ae,_0x9ffa('0xd'),JSON[_0x9ffa('0x10')](_0x3e5e86));if(_0x3e5e86[_0x9ffa('0x11')]){if(_0x3e5e86[_0x9ffa('0x11')][_0x9ffa('0x12')]===0x1f4){logger[_0x9ffa('0x11')](_0x9ffa('0xc'),_0x4ec8ae,_0x3e5e86['error'][_0x9ffa('0x13')]);return _0x8c48ff(_0x3e5e86['error'][_0x9ffa('0x13')]);}logger[_0x9ffa('0x11')](_0x9ffa('0xc'),_0x4ec8ae,_0x3e5e86[_0x9ffa('0x11')]['message']);return _0x5c5773(_0x3e5e86[_0x9ffa('0x11')][_0x9ffa('0x13')]);}else{logger[_0x9ffa('0x14')](_0x9ffa('0xc'),_0x4ec8ae,_0x9ffa('0xd'));_0x5c5773(_0x3e5e86[_0x9ffa('0x15')][_0x9ffa('0x13')]);}})[_0x9ffa('0x16')](function(_0x1ce5a8){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x4ec8ae,_0x1ce5a8);_0x8c48ff(_0x1ce5a8);});});}exports['GetDynamics365Account']=function(_0x46edcb){var _0x5b1dc0=this;return new Promise(function(_0x4fc3d3,_0x3bbbfc){return db['Dynamics365Account'][_0x9ffa('0x17')]({'raw':_0x46edcb[_0x9ffa('0x18')]?_0x46edcb[_0x9ffa('0x18')][_0x9ffa('0x19')]===undefined?!![]:![]:!![],'where':_0x46edcb[_0x9ffa('0x18')]?_0x46edcb[_0x9ffa('0x18')][_0x9ffa('0x1a')]||null:null,'attributes':_0x46edcb['options']?_0x46edcb['options'][_0x9ffa('0x1b')]||null:null,'limit':_0x46edcb[_0x9ffa('0x18')]?_0x46edcb[_0x9ffa('0x18')][_0x9ffa('0x1c')]||null:null,'include':_0x46edcb[_0x9ffa('0x18')]?_0x46edcb[_0x9ffa('0x18')]['include']?_[_0x9ffa('0x1d')](_0x46edcb[_0x9ffa('0x18')]['include'],function(_0x57df78){return{'model':db[_0x57df78[_0x9ffa('0x1e')]],'as':_0x57df78['as'],'attributes':_0x57df78[_0x9ffa('0x1b')],'include':_0x57df78[_0x9ffa('0x1f')]?_[_0x9ffa('0x1d')](_0x57df78[_0x9ffa('0x1f')],function(_0x3a6d7a){return{'model':db[_0x3a6d7a[_0x9ffa('0x1e')]],'as':_0x3a6d7a['as'],'attributes':_0x3a6d7a[_0x9ffa('0x1b')],'include':_0x3a6d7a[_0x9ffa('0x1f')]?_[_0x9ffa('0x1d')](_0x3a6d7a[_0x9ffa('0x1f')],function(_0x5cde5f){return{'model':db[_0x5cde5f['model']],'as':_0x5cde5f['as'],'attributes':_0x5cde5f[_0x9ffa('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e6290){logger['info'](_0x9ffa('0x20'),_0x46edcb);logger[_0x9ffa('0xe')]('GetDynamics365Account',_0x46edcb,JSON[_0x9ffa('0x10')](_0x5e6290));_0x4fc3d3(_0x5e6290);})[_0x9ffa('0x16')](function(_0x4468ed){logger['error'](_0x9ffa('0x20'),_0x4468ed[_0x9ffa('0x13')],_0x46edcb);_0x3bbbfc(_0x5b1dc0[_0x9ffa('0x11')](0x1f4,_0x4468ed[_0x9ffa('0x13')]));});});};exports[_0x9ffa('0x21')]=function(_0x5868ea){var _0x45584d=this;return new Promise(function(_0x5a44c7,_0x448077){return db[_0x9ffa('0x22')]['find']({'raw':_0x5868ea[_0x9ffa('0x18')]?_0x5868ea[_0x9ffa('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5868ea['options']?_0x5868ea['options'][_0x9ffa('0x1a')]||null:null,'attributes':_0x5868ea[_0x9ffa('0x18')]?_0x5868ea[_0x9ffa('0x18')][_0x9ffa('0x1b')]||null:null,'include':_0x5868ea['options']?_0x5868ea['options'][_0x9ffa('0x1f')]?_['map'](_0x5868ea[_0x9ffa('0x18')][_0x9ffa('0x1f')],function(_0x29338a){return{'model':db[_0x29338a[_0x9ffa('0x1e')]],'as':_0x29338a['as'],'attributes':_0x29338a[_0x9ffa('0x1b')],'include':_0x29338a[_0x9ffa('0x1f')]?_['map'](_0x29338a[_0x9ffa('0x1f')],function(_0x39bc19){return{'model':db[_0x39bc19['model']],'as':_0x39bc19['as'],'attributes':_0x39bc19[_0x9ffa('0x1b')],'include':_0x39bc19['include']?_[_0x9ffa('0x1d')](_0x39bc19[_0x9ffa('0x1f')],function(_0x25e187){return{'model':db[_0x25e187[_0x9ffa('0x1e')]],'as':_0x25e187['as'],'attributes':_0x25e187[_0x9ffa('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ffa('0xb')](function(_0x5d8a46){logger[_0x9ffa('0x14')](_0x9ffa('0x21'),_0x5868ea);logger[_0x9ffa('0xe')]('ShowDynamics365Account',_0x5868ea,JSON['stringify'](_0x5d8a46));_0x5a44c7(_0x5d8a46);})[_0x9ffa('0x16')](function(_0x8ada66){logger[_0x9ffa('0x11')](_0x9ffa('0x21'),_0x8ada66[_0x9ffa('0x13')],_0x5868ea);_0x448077(_0x45584d[_0x9ffa('0x11')](0x1f4,_0x8ada66[_0x9ffa('0x13')]));});});};
\ No newline at end of file
index af0e74b..03fa553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa56=['show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','index'];(function(_0x4df6f9,_0x44bd65){var _0x4b1a73=function(_0xf5adb7){while(--_0xf5adb7){_0x4df6f9['push'](_0x4df6f9['shift']());}};_0x4b1a73(++_0x44bd65);}(_0xaa56,0x1ac));var _0x6aa5=function(_0x43353f,_0x1e5f6b){_0x43353f=_0x43353f-0x0;var _0x54652a=_0xaa56[_0x43353f];return _0x54652a;};'use strict';var multer=require('multer');var util=require(_0x6aa5('0x0'));var path=require(_0x6aa5('0x1'));var timeout=require('connect-timeout');var express=require(_0x6aa5('0x2'));var router=express[_0x6aa5('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6aa5('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6aa5('0x5'));router[_0x6aa5('0x6')]('/',auth[_0x6aa5('0x7')](),controller[_0x6aa5('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6aa5('0x9')]);router[_0x6aa5('0x6')]('/:id/fields',auth[_0x6aa5('0x7')](),controller[_0x6aa5('0xa')]);router[_0x6aa5('0x6')](_0x6aa5('0xb'),auth[_0x6aa5('0x7')](),controller[_0x6aa5('0xc')]);router[_0x6aa5('0x6')](_0x6aa5('0xd'),auth[_0x6aa5('0x7')](),controller[_0x6aa5('0xe')]);router[_0x6aa5('0xf')]('/',auth['isAuthenticated'](),controller[_0x6aa5('0x10')]);router[_0x6aa5('0x11')](_0x6aa5('0x12'),auth['isAuthenticated'](),controller[_0x6aa5('0x13')]);router[_0x6aa5('0x14')](_0x6aa5('0x12'),auth[_0x6aa5('0x7')](),controller[_0x6aa5('0x15')]);module[_0x6aa5('0x16')]=router;
\ No newline at end of file
+var _0x1baf=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x34e142,_0x129489){var _0x36db86=function(_0x34ac6a){while(--_0x34ac6a){_0x34e142['push'](_0x34e142['shift']());}};_0x36db86(++_0x129489);}(_0x1baf,0x14e));var _0xf1ba=function(_0x4ce0b0,_0x3caafc){_0x4ce0b0=_0x4ce0b0-0x0;var _0x535603=_0x1baf[_0x4ce0b0];return _0x535603;};'use strict';var multer=require(_0xf1ba('0x0'));var util=require(_0xf1ba('0x1'));var path=require(_0xf1ba('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1ba('0x3'));var router=express[_0xf1ba('0x4')]();var fs_extra=require(_0xf1ba('0x5'));var auth=require(_0xf1ba('0x6'));var interaction=require(_0xf1ba('0x7'));var config=require(_0xf1ba('0x8'));var controller=require('./intDynamics365Configuration.controller');router[_0xf1ba('0x9')]('/',auth[_0xf1ba('0xa')](),controller['index']);router['get'](_0xf1ba('0xb'),auth[_0xf1ba('0xa')](),controller[_0xf1ba('0xc')]);router[_0xf1ba('0x9')](_0xf1ba('0xd'),auth[_0xf1ba('0xa')](),controller[_0xf1ba('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xf1ba('0xf')]);router[_0xf1ba('0x9')]('/:id/descriptions',auth[_0xf1ba('0xa')](),controller[_0xf1ba('0x10')]);router[_0xf1ba('0x11')]('/',auth[_0xf1ba('0xa')](),controller[_0xf1ba('0x12')]);router[_0xf1ba('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xf1ba('0x14')]);router[_0xf1ba('0x15')](_0xf1ba('0xb'),auth['isAuthenticated'](),controller[_0xf1ba('0x16')]);module[_0xf1ba('0x17')]=router;
\ No newline at end of file
index 94cdb0e..4a4c824 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c07=['exports','STRING','ENUM','phonecall','incident','contact','BOOLEAN','sequelize'];(function(_0x3a218d,_0x340ffa){var _0x23580d=function(_0x2c4dbb){while(--_0x2c4dbb){_0x3a218d['push'](_0x3a218d['shift']());}};_0x23580d(++_0x340ffa);}(_0x7c07,0x77));var _0x77c0=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x7c07[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require(_0x77c0('0x0'));module[_0x77c0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x77c0('0x2')]},'ticketType':{'type':Sequelize[_0x77c0('0x3')]('incident',_0x77c0('0x4')),'defaultValue':_0x77c0('0x5')},'moduleCreate':{'type':Sequelize[_0x77c0('0x3')]('contact','nothing'),'defaultValue':_0x77c0('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x77c0('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x77c0('0x7')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa24b=['phonecall','contact','nothing','BOOLEAN','sequelize','exports','STRING','ENUM','incident'];(function(_0x3755a0,_0x4c7171){var _0x3655d8=function(_0x2ee617){while(--_0x2ee617){_0x3755a0['push'](_0x3755a0['shift']());}};_0x3655d8(++_0x4c7171);}(_0xa24b,0x1ab));var _0xba24=function(_0x678b67,_0x949dab){_0x678b67=_0x678b67-0x0;var _0x648a38=_0xa24b[_0x678b67];return _0x648a38;};'use strict';var Sequelize=require(_0xba24('0x0'));module[_0xba24('0x1')]={'name':{'type':Sequelize[_0xba24('0x2')]},'description':{'type':Sequelize[_0xba24('0x2')]},'ticketType':{'type':Sequelize[_0xba24('0x3')](_0xba24('0x4'),_0xba24('0x5')),'defaultValue':_0xba24('0x4')},'moduleCreate':{'type':Sequelize[_0xba24('0x3')](_0xba24('0x6'),_0xba24('0x7')),'defaultValue':'contact','allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xba24('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xba24('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 1587eb7..7142ea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8621=['set','apply','reject','save','update','destroy','then','error','stack','name','send','index','Dynamics365Configuration','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','getFields','findOne','rawAttributes','order','getSubjects','getDescriptions','Dynamics365Field','pick','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x492fd8,_0x5e3f96){var _0x198ada=function(_0x41e060){while(--_0x41e060){_0x492fd8['push'](_0x492fd8['shift']());}};_0x198ada(++_0x5e3f96);}(_0x8621,0x18f));var _0x1862=function(_0x7bbf82,_0x3a6d55){_0x7bbf82=_0x7bbf82-0x0;var _0x4482c0=_0x8621[_0x7bbf82];return _0x4482c0;};'use strict';var emlformat=require(_0x1862('0x0'));var rimraf=require(_0x1862('0x1'));var zipdir=require(_0x1862('0x2'));var jsonpatch=require(_0x1862('0x3'));var rp=require(_0x1862('0x4'));var moment=require(_0x1862('0x5'));var BPromise=require(_0x1862('0x6'));var Mustache=require(_0x1862('0x7'));var util=require(_0x1862('0x8'));var path=require(_0x1862('0x9'));var sox=require(_0x1862('0xa'));var csv=require(_0x1862('0xb'));var ejs=require(_0x1862('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1862('0xd'));var squel=require(_0x1862('0xe'));var crypto=require(_0x1862('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1862('0x10'));var toCsv=require(_0x1862('0xb'));var querystring=require(_0x1862('0x11'));var Papa=require('papaparse');var Redis=require(_0x1862('0x12'));var authService=require(_0x1862('0x13'));var qs=require(_0x1862('0x14'));var as=require(_0x1862('0x15'));var hardwareService=require(_0x1862('0x16'));var logger=require(_0x1862('0x17'))(_0x1862('0x18'));var utils=require('../../config/utils');var config=require(_0x1862('0x19'));var licenseUtil=require(_0x1862('0x1a'));var db=require(_0x1862('0x1b'))['db'];function respondWithStatusCode(_0xa5a655,_0x271333){_0x271333=_0x271333||0xcc;return function(_0x3b60fd){if(_0x3b60fd){return _0xa5a655[_0x1862('0x1c')](_0x271333);}return _0xa5a655[_0x1862('0x1d')](_0x271333)[_0x1862('0x1e')]();};}function respondWithResult(_0x4bf67a,_0x2c0e29){_0x2c0e29=_0x2c0e29||0xc8;return function(_0xb4253b){if(_0xb4253b){return _0x4bf67a[_0x1862('0x1d')](_0x2c0e29)[_0x1862('0x1f')](_0xb4253b);}};}function respondWithFilteredResult(_0x53fbe1,_0x338857){return function(_0x40e897){if(_0x40e897){var _0x5e3ce0=typeof _0x338857[_0x1862('0x20')]===_0x1862('0x21')&&typeof _0x338857[_0x1862('0x22')]==='undefined';var _0x27191f=_0x40e897[_0x1862('0x23')];var _0x3b17db=_0x5e3ce0?0x0:_0x338857['offset'];var _0x45625a=_0x5e3ce0?_0x40e897[_0x1862('0x23')]:_0x338857[_0x1862('0x20')]+_0x338857[_0x1862('0x22')];var _0x326db5;if(_0x45625a>=_0x27191f){_0x45625a=_0x27191f;_0x326db5=0xc8;}else{_0x326db5=0xce;}_0x53fbe1[_0x1862('0x1d')](_0x326db5);return _0x53fbe1[_0x1862('0x24')]('Content-Range',_0x3b17db+'-'+_0x45625a+'/'+_0x27191f)[_0x1862('0x1f')](_0x40e897);}return null;};}function patchUpdates(_0x212d8d){return function(_0x161930){try{jsonpatch[_0x1862('0x25')](_0x161930,_0x212d8d,!![]);}catch(_0x4264a8){return BPromise[_0x1862('0x26')](_0x4264a8);}return _0x161930[_0x1862('0x27')]();};}function saveUpdates(_0x18190a,_0x58d9ac){return function(_0x46cb83){if(_0x46cb83){return _0x46cb83[_0x1862('0x28')](_0x18190a)['then'](function(_0x566172){return _0x566172;});}return null;};}function removeEntity(_0x55dfc8,_0x13977f){return function(_0x2e4549){if(_0x2e4549){return _0x2e4549[_0x1862('0x29')]()[_0x1862('0x2a')](function(){_0x55dfc8[_0x1862('0x1d')](0xcc)[_0x1862('0x1e')]();});}};}function handleEntityNotFound(_0x35270d,_0xd35d23){return function(_0x436fe1){if(!_0x436fe1){_0x35270d[_0x1862('0x1c')](0x194);}return _0x436fe1;};}function handleError(_0x4f5474,_0x22c62d){_0x22c62d=_0x22c62d||0x1f4;return function(_0x39f62b){logger[_0x1862('0x2b')](_0x39f62b[_0x1862('0x2c')]);if(_0x39f62b[_0x1862('0x2d')]){delete _0x39f62b[_0x1862('0x2d')];}_0x4f5474['status'](_0x22c62d)[_0x1862('0x2e')](_0x39f62b);};}exports[_0x1862('0x2f')]=function(_0x2077b9,_0x27f58a){var _0x2ceb01={},_0x44756e={},_0x5334e1={'count':0x0,'rows':[]};var _0x4cb9cd=_['map'](db[_0x1862('0x30')]['rawAttributes'],function(_0x2e4443){return{'name':_0x2e4443[_0x1862('0x31')],'type':_0x2e4443[_0x1862('0x32')][_0x1862('0x33')]};});_0x44756e['model']=_[_0x1862('0x34')](_0x4cb9cd,_0x1862('0x2d'));_0x44756e[_0x1862('0x35')]=_[_0x1862('0x36')](_0x2077b9[_0x1862('0x35')]);_0x44756e[_0x1862('0x37')]=_['intersection'](_0x44756e[_0x1862('0x38')],_0x44756e[_0x1862('0x35')]);_0x2ceb01[_0x1862('0x39')]=_[_0x1862('0x3a')](_0x44756e[_0x1862('0x38')],qs[_0x1862('0x3b')](_0x2077b9[_0x1862('0x35')][_0x1862('0x3b')]));_0x2ceb01['attributes']=_0x2ceb01[_0x1862('0x39')][_0x1862('0x3c')]?_0x2ceb01['attributes']:_0x44756e['model'];if(!_0x2077b9[_0x1862('0x35')][_0x1862('0x3d')](_0x1862('0x3e'))){_0x2ceb01[_0x1862('0x22')]=qs[_0x1862('0x22')](_0x2077b9[_0x1862('0x35')][_0x1862('0x22')]);_0x2ceb01['offset']=qs[_0x1862('0x20')](_0x2077b9['query']['offset']);}_0x2ceb01['order']=qs['sort'](_0x2077b9[_0x1862('0x35')][_0x1862('0x3f')]);_0x2ceb01[_0x1862('0x40')]=qs[_0x1862('0x37')](_['pick'](_0x2077b9[_0x1862('0x35')],_0x44756e['filters']),_0x4cb9cd);if(_0x2077b9[_0x1862('0x35')][_0x1862('0x41')]){_0x2ceb01[_0x1862('0x40')]=_[_0x1862('0x42')](_0x2ceb01[_0x1862('0x40')],{'$or':_[_0x1862('0x34')](_0x4cb9cd,function(_0xe11052){if(_0xe11052[_0x1862('0x32')]!==_0x1862('0x43')){var _0x545226={};_0x545226[_0xe11052[_0x1862('0x2d')]]={'$like':'%'+_0x2077b9['query'][_0x1862('0x41')]+'%'};return _0x545226;}})});}_0x2ceb01=_[_0x1862('0x42')]({},_0x2ceb01,_0x2077b9['options']);var _0x5e1885={'where':_0x2ceb01[_0x1862('0x40')]};return db[_0x1862('0x30')]['count'](_0x5e1885)[_0x1862('0x2a')](function(_0x3b6a3e){_0x5334e1[_0x1862('0x23')]=_0x3b6a3e;if(_0x2077b9[_0x1862('0x35')][_0x1862('0x44')]){_0x2ceb01[_0x1862('0x45')]=[{'all':!![]}];}return db[_0x1862('0x30')][_0x1862('0x46')](_0x2ceb01);})[_0x1862('0x2a')](function(_0x933383){_0x5334e1[_0x1862('0x47')]=_0x933383;return _0x5334e1;})['then'](respondWithFilteredResult(_0x27f58a,_0x2ceb01))[_0x1862('0x48')](handleError(_0x27f58a,null));};exports[_0x1862('0x49')]=function(_0xedca92,_0x5db3fa){var _0x8d2852={'raw':![],'where':{'id':_0xedca92[_0x1862('0x4a')]['id']}},_0x111e23={};_0x111e23[_0x1862('0x38')]=_[_0x1862('0x36')](db[_0x1862('0x30')]['rawAttributes']);_0x111e23['query']=_[_0x1862('0x36')](_0xedca92[_0x1862('0x35')]);_0x111e23[_0x1862('0x37')]=_[_0x1862('0x3a')](_0x111e23['model'],_0x111e23[_0x1862('0x35')]);_0x8d2852[_0x1862('0x39')]=_[_0x1862('0x3a')](_0x111e23['model'],qs['fields'](_0xedca92['query'][_0x1862('0x3b')]));_0x8d2852[_0x1862('0x39')]=_0x8d2852[_0x1862('0x39')][_0x1862('0x3c')]?_0x8d2852[_0x1862('0x39')]:_0x111e23[_0x1862('0x38')];if(_0xedca92[_0x1862('0x35')][_0x1862('0x44')]){_0x8d2852[_0x1862('0x45')]=[{'all':!![]}];}_0x8d2852=_[_0x1862('0x42')]({},_0x8d2852,_0xedca92[_0x1862('0x4b')]);return db[_0x1862('0x30')][_0x1862('0x4c')](_0x8d2852)[_0x1862('0x2a')](handleEntityNotFound(_0x5db3fa,null))[_0x1862('0x2a')](respondWithResult(_0x5db3fa,null))['catch'](handleError(_0x5db3fa,null));};exports[_0x1862('0x4d')]=function(_0xd8b7cf,_0x5acef8){return db[_0x1862('0x30')][_0x1862('0x4d')](_0xd8b7cf[_0x1862('0x4e')],{})[_0x1862('0x2a')](respondWithResult(_0x5acef8,0xc9))[_0x1862('0x48')](handleError(_0x5acef8,null));};exports['update']=function(_0xaf14fd,_0x236963){if(_0xaf14fd['body']['id']){delete _0xaf14fd[_0x1862('0x4e')]['id'];}return db[_0x1862('0x30')][_0x1862('0x4c')]({'where':{'id':_0xaf14fd['params']['id']}})[_0x1862('0x2a')](handleEntityNotFound(_0x236963,null))[_0x1862('0x2a')](saveUpdates(_0xaf14fd[_0x1862('0x4e')],null))[_0x1862('0x2a')](respondWithResult(_0x236963,null))[_0x1862('0x48')](handleError(_0x236963,null));};exports[_0x1862('0x29')]=function(_0x9108c,_0xfa1512){return db[_0x1862('0x30')]['find']({'where':{'id':_0x9108c['params']['id']}})['then'](handleEntityNotFound(_0xfa1512,null))['then'](removeEntity(_0xfa1512,null))['catch'](handleError(_0xfa1512,null));};exports[_0x1862('0x4f')]=function(_0x2378c6,_0x2706f8,_0x453352){var _0x26eb27={};var _0x4e9076={};var _0x32c69b;var _0x110794;return db['Dynamics365Configuration'][_0x1862('0x50')]({'where':{'id':_0x2378c6['params']['id']}})[_0x1862('0x2a')](handleEntityNotFound(_0x2706f8,null))[_0x1862('0x2a')](function(_0x235940){if(_0x235940){_0x32c69b=_0x235940;_0x4e9076[_0x1862('0x38')]=_[_0x1862('0x36')](db['Dynamics365Field'][_0x1862('0x51')]);_0x4e9076[_0x1862('0x35')]=_['keys'](_0x2378c6['query']);_0x4e9076[_0x1862('0x37')]=_['intersection'](_0x4e9076[_0x1862('0x38')],_0x4e9076['query']);_0x26eb27['attributes']=_[_0x1862('0x3a')](_0x4e9076[_0x1862('0x38')],qs['fields'](_0x2378c6[_0x1862('0x35')][_0x1862('0x3b')]));_0x26eb27[_0x1862('0x39')]=_0x26eb27[_0x1862('0x39')][_0x1862('0x3c')]?_0x26eb27[_0x1862('0x39')]:_0x4e9076['model'];_0x26eb27[_0x1862('0x52')]=qs['sort'](_0x2378c6[_0x1862('0x35')][_0x1862('0x3f')]);_0x26eb27[_0x1862('0x40')]=qs['filters'](_['pick'](_0x2378c6[_0x1862('0x35')],_0x4e9076[_0x1862('0x37')]));if(_0x2378c6[_0x1862('0x35')][_0x1862('0x41')]){_0x26eb27[_0x1862('0x40')]=_['merge'](_0x26eb27[_0x1862('0x40')],{'$or':_[_0x1862('0x34')](_0x26eb27[_0x1862('0x39')],function(_0x760b76){var _0x41cec6={};_0x41cec6[_0x760b76]={'$like':'%'+_0x2378c6[_0x1862('0x35')][_0x1862('0x41')]+'%'};return _0x41cec6;})});}_0x26eb27=_['merge']({},_0x26eb27,_0x2378c6[_0x1862('0x4b')]);return _0x32c69b[_0x1862('0x4f')](_0x26eb27);}})[_0x1862('0x2a')](function(_0x3f841a){if(_0x3f841a){_0x110794=_0x3f841a[_0x1862('0x3c')];if(!_0x2378c6[_0x1862('0x35')]['hasOwnProperty']('nolimit')){_0x26eb27[_0x1862('0x22')]=qs['limit'](_0x2378c6[_0x1862('0x35')]['limit']);_0x26eb27[_0x1862('0x20')]=qs[_0x1862('0x20')](_0x2378c6['query']['offset']);}return _0x32c69b[_0x1862('0x4f')](_0x26eb27);}})[_0x1862('0x2a')](function(_0x596d03){if(_0x596d03){return _0x596d03?{'count':_0x110794,'rows':_0x596d03}:null;}})['then'](respondWithResult(_0x2706f8,null))[_0x1862('0x48')](handleError(_0x2706f8,null));};exports['getSubjects']=function(_0x530992,_0x5af83f,_0x2eaeea){var _0x4b104a={};var _0x25fb18={};var _0x42c71b;var _0x1a1514;return db[_0x1862('0x30')][_0x1862('0x50')]({'where':{'id':_0x530992[_0x1862('0x4a')]['id']}})[_0x1862('0x2a')](handleEntityNotFound(_0x5af83f,null))[_0x1862('0x2a')](function(_0x307cab){if(_0x307cab){_0x42c71b=_0x307cab;_0x25fb18[_0x1862('0x38')]=_[_0x1862('0x36')](db['Dynamics365Field']['rawAttributes']);_0x25fb18[_0x1862('0x35')]=_[_0x1862('0x36')](_0x530992['query']);_0x25fb18[_0x1862('0x37')]=_['intersection'](_0x25fb18['model'],_0x25fb18[_0x1862('0x35')]);_0x4b104a[_0x1862('0x39')]=_[_0x1862('0x3a')](_0x25fb18[_0x1862('0x38')],qs['fields'](_0x530992[_0x1862('0x35')]['fields']));_0x4b104a[_0x1862('0x39')]=_0x4b104a[_0x1862('0x39')]['length']?_0x4b104a[_0x1862('0x39')]:_0x25fb18[_0x1862('0x38')];_0x4b104a[_0x1862('0x52')]=qs['sort'](_0x530992[_0x1862('0x35')]['sort']);_0x4b104a['where']=qs['filters'](_['pick'](_0x530992['query'],_0x25fb18['filters']));if(_0x530992[_0x1862('0x35')]['filter']){_0x4b104a[_0x1862('0x40')]=_[_0x1862('0x42')](_0x4b104a[_0x1862('0x40')],{'$or':_['map'](_0x4b104a[_0x1862('0x39')],function(_0x3ffb8d){var _0xe97847={};_0xe97847[_0x3ffb8d]={'$like':'%'+_0x530992[_0x1862('0x35')][_0x1862('0x41')]+'%'};return _0xe97847;})});}_0x4b104a=_[_0x1862('0x42')]({},_0x4b104a,_0x530992[_0x1862('0x4b')]);return _0x42c71b[_0x1862('0x53')](_0x4b104a);}})['then'](function(_0x5c9263){if(_0x5c9263){_0x1a1514=_0x5c9263['length'];if(!_0x530992[_0x1862('0x35')]['hasOwnProperty'](_0x1862('0x3e'))){_0x4b104a[_0x1862('0x22')]=qs[_0x1862('0x22')](_0x530992[_0x1862('0x35')]['limit']);_0x4b104a['offset']=qs[_0x1862('0x20')](_0x530992[_0x1862('0x35')][_0x1862('0x20')]);}return _0x42c71b[_0x1862('0x53')](_0x4b104a);}})[_0x1862('0x2a')](function(_0x5ac134){if(_0x5ac134){return _0x5ac134?{'count':_0x1a1514,'rows':_0x5ac134}:null;}})[_0x1862('0x2a')](respondWithResult(_0x5af83f,null))[_0x1862('0x48')](handleError(_0x5af83f,null));};exports[_0x1862('0x54')]=function(_0x5e472d,_0x573997,_0xc1e347){var _0x1cfe23={};var _0x245173={};var _0x32b82f;var _0x46f0a3;return db[_0x1862('0x30')]['findOne']({'where':{'id':_0x5e472d['params']['id']}})['then'](handleEntityNotFound(_0x573997,null))[_0x1862('0x2a')](function(_0x4d0cf0){if(_0x4d0cf0){_0x32b82f=_0x4d0cf0;_0x245173['model']=_[_0x1862('0x36')](db[_0x1862('0x55')][_0x1862('0x51')]);_0x245173[_0x1862('0x35')]=_['keys'](_0x5e472d[_0x1862('0x35')]);_0x245173['filters']=_['intersection'](_0x245173[_0x1862('0x38')],_0x245173[_0x1862('0x35')]);_0x1cfe23['attributes']=_['intersection'](_0x245173[_0x1862('0x38')],qs[_0x1862('0x3b')](_0x5e472d[_0x1862('0x35')][_0x1862('0x3b')]));_0x1cfe23[_0x1862('0x39')]=_0x1cfe23[_0x1862('0x39')][_0x1862('0x3c')]?_0x1cfe23['attributes']:_0x245173['model'];_0x1cfe23['order']=qs[_0x1862('0x3f')](_0x5e472d[_0x1862('0x35')][_0x1862('0x3f')]);_0x1cfe23['where']=qs[_0x1862('0x37')](_[_0x1862('0x56')](_0x5e472d[_0x1862('0x35')],_0x245173[_0x1862('0x37')]));if(_0x5e472d[_0x1862('0x35')]['filter']){_0x1cfe23[_0x1862('0x40')]=_[_0x1862('0x42')](_0x1cfe23[_0x1862('0x40')],{'$or':_[_0x1862('0x34')](_0x1cfe23[_0x1862('0x39')],function(_0x16d318){var _0x501d2b={};_0x501d2b[_0x16d318]={'$like':'%'+_0x5e472d[_0x1862('0x35')][_0x1862('0x41')]+'%'};return _0x501d2b;})});}_0x1cfe23=_[_0x1862('0x42')]({},_0x1cfe23,_0x5e472d['options']);return _0x32b82f[_0x1862('0x54')](_0x1cfe23);}})[_0x1862('0x2a')](function(_0x94a3de){if(_0x94a3de){_0x46f0a3=_0x94a3de[_0x1862('0x3c')];if(!_0x5e472d['query'][_0x1862('0x3d')](_0x1862('0x3e'))){_0x1cfe23[_0x1862('0x22')]=qs[_0x1862('0x22')](_0x5e472d[_0x1862('0x35')][_0x1862('0x22')]);_0x1cfe23[_0x1862('0x20')]=qs[_0x1862('0x20')](_0x5e472d['query'][_0x1862('0x20')]);}return _0x32b82f[_0x1862('0x54')](_0x1cfe23);}})[_0x1862('0x2a')](function(_0x2a1e16){if(_0x2a1e16){return _0x2a1e16?{'count':_0x46f0a3,'rows':_0x2a1e16}:null;}})[_0x1862('0x2a')](respondWithResult(_0x573997,null))[_0x1862('0x48')](handleError(_0x573997,null));};
\ No newline at end of file
+var _0xe056=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','sendStatus','status','end','undefined','offset','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','filter','where','merge','VIRTUAL','Dynamics365Configuration','includeAll','include','findAll','params','options','find','catch','create','body','destroy','getFields','findOne','order','pick','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x27e5c8,_0xa92cf7){var _0x20d666=function(_0xf65318){while(--_0xf65318){_0x27e5c8['push'](_0x27e5c8['shift']());}};_0x20d666(++_0xa92cf7);}(_0xe056,0x11e));var _0x6e05=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0xe056[_0x34d275];return _0x1379cc;};'use strict';var emlformat=require(_0x6e05('0x0'));var rimraf=require(_0x6e05('0x1'));var zipdir=require(_0x6e05('0x2'));var jsonpatch=require(_0x6e05('0x3'));var rp=require(_0x6e05('0x4'));var moment=require(_0x6e05('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6e05('0x6'));var path=require('path');var sox=require(_0x6e05('0x7'));var csv=require('to-csv');var ejs=require(_0x6e05('0x8'));var fs=require('fs');var fs_extra=require(_0x6e05('0x9'));var _=require(_0x6e05('0xa'));var squel=require('squel');var crypto=require(_0x6e05('0xb'));var jsforce=require(_0x6e05('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6e05('0xd'));var querystring=require(_0x6e05('0xe'));var Papa=require(_0x6e05('0xf'));var Redis=require(_0x6e05('0x10'));var authService=require(_0x6e05('0x11'));var qs=require(_0x6e05('0x12'));var as=require(_0x6e05('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6e05('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49d6c2,_0x216eec){_0x216eec=_0x216eec||0xcc;return function(_0x5b768b){if(_0x5b768b){return _0x49d6c2[_0x6e05('0x15')](_0x216eec);}return _0x49d6c2[_0x6e05('0x16')](_0x216eec)[_0x6e05('0x17')]();};}function respondWithResult(_0x49a634,_0x70ac58){_0x70ac58=_0x70ac58||0xc8;return function(_0x85d414){if(_0x85d414){return _0x49a634['status'](_0x70ac58)['json'](_0x85d414);}};}function respondWithFilteredResult(_0x32403c,_0x1b275b){return function(_0x1131db){if(_0x1131db){var _0x5649b8=typeof _0x1b275b['offset']===_0x6e05('0x18')&&typeof _0x1b275b['limit']==='undefined';var _0x1a1d68=_0x1131db['count'];var _0x4aac31=_0x5649b8?0x0:_0x1b275b[_0x6e05('0x19')];var _0x45ce16=_0x5649b8?_0x1131db[_0x6e05('0x1a')]:_0x1b275b[_0x6e05('0x19')]+_0x1b275b['limit'];var _0x383718;if(_0x45ce16>=_0x1a1d68){_0x45ce16=_0x1a1d68;_0x383718=0xc8;}else{_0x383718=0xce;}_0x32403c[_0x6e05('0x16')](_0x383718);return _0x32403c['set'](_0x6e05('0x1b'),_0x4aac31+'-'+_0x45ce16+'/'+_0x1a1d68)['json'](_0x1131db);}return null;};}function patchUpdates(_0x52ce39){return function(_0x440987){try{jsonpatch[_0x6e05('0x1c')](_0x440987,_0x52ce39,!![]);}catch(_0x3bba29){return BPromise['reject'](_0x3bba29);}return _0x440987[_0x6e05('0x1d')]();};}function saveUpdates(_0x4900fe,_0x42e213){return function(_0x340fd2){if(_0x340fd2){return _0x340fd2[_0x6e05('0x1e')](_0x4900fe)[_0x6e05('0x1f')](function(_0xf9fcc2){return _0xf9fcc2;});}return null;};}function removeEntity(_0x408243,_0x38bf19){return function(_0x56d25f){if(_0x56d25f){return _0x56d25f['destroy']()[_0x6e05('0x1f')](function(){_0x408243[_0x6e05('0x16')](0xcc)[_0x6e05('0x17')]();});}};}function handleEntityNotFound(_0x1c75f0,_0x155055){return function(_0x160498){if(!_0x160498){_0x1c75f0[_0x6e05('0x15')](0x194);}return _0x160498;};}function handleError(_0x516482,_0x5f13aa){_0x5f13aa=_0x5f13aa||0x1f4;return function(_0x1ff911){logger[_0x6e05('0x20')](_0x1ff911[_0x6e05('0x21')]);if(_0x1ff911[_0x6e05('0x22')]){delete _0x1ff911[_0x6e05('0x22')];}_0x516482[_0x6e05('0x16')](_0x5f13aa)[_0x6e05('0x23')](_0x1ff911);};}exports[_0x6e05('0x24')]=function(_0x432db5,_0x5a5bec){var _0x12036d={},_0x382a10={},_0x2ec18f={'count':0x0,'rows':[]};var _0x382997=_[_0x6e05('0x25')](db['Dynamics365Configuration'][_0x6e05('0x26')],function(_0x474f99){return{'name':_0x474f99[_0x6e05('0x27')],'type':_0x474f99[_0x6e05('0x28')][_0x6e05('0x29')]};});_0x382a10[_0x6e05('0x2a')]=_[_0x6e05('0x25')](_0x382997,'name');_0x382a10[_0x6e05('0x2b')]=_[_0x6e05('0x2c')](_0x432db5[_0x6e05('0x2b')]);_0x382a10[_0x6e05('0x2d')]=_[_0x6e05('0x2e')](_0x382a10[_0x6e05('0x2a')],_0x382a10[_0x6e05('0x2b')]);_0x12036d[_0x6e05('0x2f')]=_['intersection'](_0x382a10[_0x6e05('0x2a')],qs[_0x6e05('0x30')](_0x432db5['query'][_0x6e05('0x30')]));_0x12036d[_0x6e05('0x2f')]=_0x12036d[_0x6e05('0x2f')][_0x6e05('0x31')]?_0x12036d['attributes']:_0x382a10[_0x6e05('0x2a')];if(!_0x432db5[_0x6e05('0x2b')][_0x6e05('0x32')](_0x6e05('0x33'))){_0x12036d[_0x6e05('0x34')]=qs['limit'](_0x432db5[_0x6e05('0x2b')][_0x6e05('0x34')]);_0x12036d[_0x6e05('0x19')]=qs[_0x6e05('0x19')](_0x432db5[_0x6e05('0x2b')][_0x6e05('0x19')]);}_0x12036d['order']=qs[_0x6e05('0x35')](_0x432db5[_0x6e05('0x2b')][_0x6e05('0x35')]);_0x12036d['where']=qs[_0x6e05('0x2d')](_['pick'](_0x432db5['query'],_0x382a10[_0x6e05('0x2d')]),_0x382997);if(_0x432db5[_0x6e05('0x2b')][_0x6e05('0x36')]){_0x12036d[_0x6e05('0x37')]=_[_0x6e05('0x38')](_0x12036d[_0x6e05('0x37')],{'$or':_[_0x6e05('0x25')](_0x382997,function(_0x38b258){if(_0x38b258[_0x6e05('0x28')]!==_0x6e05('0x39')){var _0x5f0674={};_0x5f0674[_0x38b258[_0x6e05('0x22')]]={'$like':'%'+_0x432db5[_0x6e05('0x2b')]['filter']+'%'};return _0x5f0674;}})});}_0x12036d=_[_0x6e05('0x38')]({},_0x12036d,_0x432db5['options']);var _0x346627={'where':_0x12036d[_0x6e05('0x37')]};return db[_0x6e05('0x3a')]['count'](_0x346627)[_0x6e05('0x1f')](function(_0x45844b){_0x2ec18f[_0x6e05('0x1a')]=_0x45844b;if(_0x432db5[_0x6e05('0x2b')][_0x6e05('0x3b')]){_0x12036d[_0x6e05('0x3c')]=[{'all':!![]}];}return db[_0x6e05('0x3a')][_0x6e05('0x3d')](_0x12036d);})[_0x6e05('0x1f')](function(_0x6b6922){_0x2ec18f['rows']=_0x6b6922;return _0x2ec18f;})['then'](respondWithFilteredResult(_0x5a5bec,_0x12036d))['catch'](handleError(_0x5a5bec,null));};exports['show']=function(_0x43cf22,_0x45bb56){var _0x56d585={'raw':![],'where':{'id':_0x43cf22[_0x6e05('0x3e')]['id']}},_0xfc775={};_0xfc775['model']=_[_0x6e05('0x2c')](db[_0x6e05('0x3a')][_0x6e05('0x26')]);_0xfc775['query']=_[_0x6e05('0x2c')](_0x43cf22[_0x6e05('0x2b')]);_0xfc775[_0x6e05('0x2d')]=_['intersection'](_0xfc775[_0x6e05('0x2a')],_0xfc775['query']);_0x56d585[_0x6e05('0x2f')]=_['intersection'](_0xfc775[_0x6e05('0x2a')],qs['fields'](_0x43cf22[_0x6e05('0x2b')][_0x6e05('0x30')]));_0x56d585[_0x6e05('0x2f')]=_0x56d585[_0x6e05('0x2f')][_0x6e05('0x31')]?_0x56d585[_0x6e05('0x2f')]:_0xfc775[_0x6e05('0x2a')];if(_0x43cf22[_0x6e05('0x2b')][_0x6e05('0x3b')]){_0x56d585['include']=[{'all':!![]}];}_0x56d585=_[_0x6e05('0x38')]({},_0x56d585,_0x43cf22[_0x6e05('0x3f')]);return db[_0x6e05('0x3a')][_0x6e05('0x40')](_0x56d585)[_0x6e05('0x1f')](handleEntityNotFound(_0x45bb56,null))['then'](respondWithResult(_0x45bb56,null))[_0x6e05('0x41')](handleError(_0x45bb56,null));};exports['create']=function(_0x439c43,_0x4e6e53){return db[_0x6e05('0x3a')][_0x6e05('0x42')](_0x439c43[_0x6e05('0x43')],{})['then'](respondWithResult(_0x4e6e53,0xc9))[_0x6e05('0x41')](handleError(_0x4e6e53,null));};exports[_0x6e05('0x1e')]=function(_0x37e237,_0x5adac9){if(_0x37e237['body']['id']){delete _0x37e237[_0x6e05('0x43')]['id'];}return db[_0x6e05('0x3a')][_0x6e05('0x40')]({'where':{'id':_0x37e237[_0x6e05('0x3e')]['id']}})[_0x6e05('0x1f')](handleEntityNotFound(_0x5adac9,null))['then'](saveUpdates(_0x37e237['body'],null))[_0x6e05('0x1f')](respondWithResult(_0x5adac9,null))['catch'](handleError(_0x5adac9,null));};exports[_0x6e05('0x44')]=function(_0x177eb7,_0x54879f){return db[_0x6e05('0x3a')][_0x6e05('0x40')]({'where':{'id':_0x177eb7[_0x6e05('0x3e')]['id']}})['then'](handleEntityNotFound(_0x54879f,null))[_0x6e05('0x1f')](removeEntity(_0x54879f,null))[_0x6e05('0x41')](handleError(_0x54879f,null));};exports[_0x6e05('0x45')]=function(_0x27fcf0,_0x1cc479,_0x202d3b){var _0x7a3f10={};var _0xe257b2={};var _0x2bcb2a;var _0x2fd7e8;return db[_0x6e05('0x3a')][_0x6e05('0x46')]({'where':{'id':_0x27fcf0[_0x6e05('0x3e')]['id']}})[_0x6e05('0x1f')](handleEntityNotFound(_0x1cc479,null))[_0x6e05('0x1f')](function(_0x436602){if(_0x436602){_0x2bcb2a=_0x436602;_0xe257b2[_0x6e05('0x2a')]=_[_0x6e05('0x2c')](db['Dynamics365Field']['rawAttributes']);_0xe257b2[_0x6e05('0x2b')]=_[_0x6e05('0x2c')](_0x27fcf0[_0x6e05('0x2b')]);_0xe257b2[_0x6e05('0x2d')]=_[_0x6e05('0x2e')](_0xe257b2[_0x6e05('0x2a')],_0xe257b2[_0x6e05('0x2b')]);_0x7a3f10[_0x6e05('0x2f')]=_['intersection'](_0xe257b2[_0x6e05('0x2a')],qs[_0x6e05('0x30')](_0x27fcf0[_0x6e05('0x2b')][_0x6e05('0x30')]));_0x7a3f10[_0x6e05('0x2f')]=_0x7a3f10[_0x6e05('0x2f')][_0x6e05('0x31')]?_0x7a3f10[_0x6e05('0x2f')]:_0xe257b2[_0x6e05('0x2a')];_0x7a3f10[_0x6e05('0x47')]=qs[_0x6e05('0x35')](_0x27fcf0['query'][_0x6e05('0x35')]);_0x7a3f10['where']=qs['filters'](_[_0x6e05('0x48')](_0x27fcf0[_0x6e05('0x2b')],_0xe257b2[_0x6e05('0x2d')]));if(_0x27fcf0['query']['filter']){_0x7a3f10['where']=_[_0x6e05('0x38')](_0x7a3f10[_0x6e05('0x37')],{'$or':_[_0x6e05('0x25')](_0x7a3f10[_0x6e05('0x2f')],function(_0x4d5516){var _0x263dcd={};_0x263dcd[_0x4d5516]={'$like':'%'+_0x27fcf0[_0x6e05('0x2b')][_0x6e05('0x36')]+'%'};return _0x263dcd;})});}_0x7a3f10=_[_0x6e05('0x38')]({},_0x7a3f10,_0x27fcf0[_0x6e05('0x3f')]);return _0x2bcb2a[_0x6e05('0x45')](_0x7a3f10);}})['then'](function(_0x177148){if(_0x177148){_0x2fd7e8=_0x177148[_0x6e05('0x31')];if(!_0x27fcf0[_0x6e05('0x2b')]['hasOwnProperty'](_0x6e05('0x33'))){_0x7a3f10[_0x6e05('0x34')]=qs[_0x6e05('0x34')](_0x27fcf0['query'][_0x6e05('0x34')]);_0x7a3f10[_0x6e05('0x19')]=qs[_0x6e05('0x19')](_0x27fcf0[_0x6e05('0x2b')][_0x6e05('0x19')]);}return _0x2bcb2a[_0x6e05('0x45')](_0x7a3f10);}})[_0x6e05('0x1f')](function(_0x5eeaf3){if(_0x5eeaf3){return _0x5eeaf3?{'count':_0x2fd7e8,'rows':_0x5eeaf3}:null;}})[_0x6e05('0x1f')](respondWithResult(_0x1cc479,null))['catch'](handleError(_0x1cc479,null));};exports['getSubjects']=function(_0x3a723a,_0x25edc3,_0x4c1db6){var _0x3cd7e3={};var _0x37100c={};var _0x1019b9;var _0x4a1e37;return db[_0x6e05('0x3a')][_0x6e05('0x46')]({'where':{'id':_0x3a723a['params']['id']}})[_0x6e05('0x1f')](handleEntityNotFound(_0x25edc3,null))[_0x6e05('0x1f')](function(_0x12c2e3){if(_0x12c2e3){_0x1019b9=_0x12c2e3;_0x37100c[_0x6e05('0x2a')]=_[_0x6e05('0x2c')](db[_0x6e05('0x49')][_0x6e05('0x26')]);_0x37100c['query']=_['keys'](_0x3a723a['query']);_0x37100c[_0x6e05('0x2d')]=_[_0x6e05('0x2e')](_0x37100c[_0x6e05('0x2a')],_0x37100c[_0x6e05('0x2b')]);_0x3cd7e3['attributes']=_[_0x6e05('0x2e')](_0x37100c[_0x6e05('0x2a')],qs[_0x6e05('0x30')](_0x3a723a[_0x6e05('0x2b')][_0x6e05('0x30')]));_0x3cd7e3[_0x6e05('0x2f')]=_0x3cd7e3['attributes'][_0x6e05('0x31')]?_0x3cd7e3['attributes']:_0x37100c[_0x6e05('0x2a')];_0x3cd7e3['order']=qs[_0x6e05('0x35')](_0x3a723a[_0x6e05('0x2b')][_0x6e05('0x35')]);_0x3cd7e3['where']=qs['filters'](_[_0x6e05('0x48')](_0x3a723a[_0x6e05('0x2b')],_0x37100c['filters']));if(_0x3a723a[_0x6e05('0x2b')][_0x6e05('0x36')]){_0x3cd7e3['where']=_[_0x6e05('0x38')](_0x3cd7e3[_0x6e05('0x37')],{'$or':_['map'](_0x3cd7e3[_0x6e05('0x2f')],function(_0x527194){var _0x32d150={};_0x32d150[_0x527194]={'$like':'%'+_0x3a723a[_0x6e05('0x2b')]['filter']+'%'};return _0x32d150;})});}_0x3cd7e3=_[_0x6e05('0x38')]({},_0x3cd7e3,_0x3a723a[_0x6e05('0x3f')]);return _0x1019b9[_0x6e05('0x4a')](_0x3cd7e3);}})['then'](function(_0x4431f1){if(_0x4431f1){_0x4a1e37=_0x4431f1[_0x6e05('0x31')];if(!_0x3a723a['query'][_0x6e05('0x32')](_0x6e05('0x33'))){_0x3cd7e3[_0x6e05('0x34')]=qs['limit'](_0x3a723a['query'][_0x6e05('0x34')]);_0x3cd7e3[_0x6e05('0x19')]=qs[_0x6e05('0x19')](_0x3a723a[_0x6e05('0x2b')]['offset']);}return _0x1019b9[_0x6e05('0x4a')](_0x3cd7e3);}})[_0x6e05('0x1f')](function(_0x402e6a){if(_0x402e6a){return _0x402e6a?{'count':_0x4a1e37,'rows':_0x402e6a}:null;}})['then'](respondWithResult(_0x25edc3,null))[_0x6e05('0x41')](handleError(_0x25edc3,null));};exports[_0x6e05('0x4b')]=function(_0x33e7a0,_0x1362d2,_0x521d49){var _0x124b4b={};var _0xc80770={};var _0x1ba9cc;var _0x288392;return db[_0x6e05('0x3a')][_0x6e05('0x46')]({'where':{'id':_0x33e7a0['params']['id']}})[_0x6e05('0x1f')](handleEntityNotFound(_0x1362d2,null))['then'](function(_0x363ddf){if(_0x363ddf){_0x1ba9cc=_0x363ddf;_0xc80770[_0x6e05('0x2a')]=_['keys'](db[_0x6e05('0x49')]['rawAttributes']);_0xc80770['query']=_['keys'](_0x33e7a0[_0x6e05('0x2b')]);_0xc80770[_0x6e05('0x2d')]=_[_0x6e05('0x2e')](_0xc80770[_0x6e05('0x2a')],_0xc80770[_0x6e05('0x2b')]);_0x124b4b[_0x6e05('0x2f')]=_[_0x6e05('0x2e')](_0xc80770[_0x6e05('0x2a')],qs['fields'](_0x33e7a0[_0x6e05('0x2b')][_0x6e05('0x30')]));_0x124b4b[_0x6e05('0x2f')]=_0x124b4b[_0x6e05('0x2f')][_0x6e05('0x31')]?_0x124b4b[_0x6e05('0x2f')]:_0xc80770['model'];_0x124b4b[_0x6e05('0x47')]=qs['sort'](_0x33e7a0[_0x6e05('0x2b')][_0x6e05('0x35')]);_0x124b4b[_0x6e05('0x37')]=qs[_0x6e05('0x2d')](_[_0x6e05('0x48')](_0x33e7a0[_0x6e05('0x2b')],_0xc80770[_0x6e05('0x2d')]));if(_0x33e7a0[_0x6e05('0x2b')][_0x6e05('0x36')]){_0x124b4b['where']=_[_0x6e05('0x38')](_0x124b4b[_0x6e05('0x37')],{'$or':_[_0x6e05('0x25')](_0x124b4b[_0x6e05('0x2f')],function(_0x1eee30){var _0x16f7f2={};_0x16f7f2[_0x1eee30]={'$like':'%'+_0x33e7a0[_0x6e05('0x2b')]['filter']+'%'};return _0x16f7f2;})});}_0x124b4b=_[_0x6e05('0x38')]({},_0x124b4b,_0x33e7a0[_0x6e05('0x3f')]);return _0x1ba9cc[_0x6e05('0x4b')](_0x124b4b);}})[_0x6e05('0x1f')](function(_0xe28ef2){if(_0xe28ef2){_0x288392=_0xe28ef2['length'];if(!_0x33e7a0[_0x6e05('0x2b')][_0x6e05('0x32')](_0x6e05('0x33'))){_0x124b4b[_0x6e05('0x34')]=qs[_0x6e05('0x34')](_0x33e7a0[_0x6e05('0x2b')]['limit']);_0x124b4b[_0x6e05('0x19')]=qs[_0x6e05('0x19')](_0x33e7a0[_0x6e05('0x2b')][_0x6e05('0x19')]);}return _0x1ba9cc[_0x6e05('0x4b')](_0x124b4b);}})['then'](function(_0x3421aa){if(_0x3421aa){return _0x3421aa?{'count':_0x288392,'rows':_0x3421aa}:null;}})[_0x6e05('0x1f')](respondWithResult(_0x1362d2,null))['catch'](handleError(_0x1362d2,null));};
\ No newline at end of file
index d88abb0..3ef8bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0e=['define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0x27f825,_0x463497){var _0x1a40fd=function(_0x849c25){while(--_0x849c25){_0x27f825['push'](_0x27f825['shift']());}};_0x1a40fd(++_0x463497);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x4c7334,_0x301f47){_0x4c7334=_0x4c7334-0x0;var _0x2a5553=_0x8d0e[_0x4c7334];return _0x2a5553;};'use strict';var _=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var logger=require(_0xe8d0('0x2'))(_0xe8d0('0x3'));var moment=require(_0xe8d0('0x4'));var BPromise=require(_0xe8d0('0x5'));var rp=require(_0xe8d0('0x6'));var fs=require('fs');var path=require(_0xe8d0('0x7'));var rimraf=require(_0xe8d0('0x8'));var config=require('../../config/environment');var attributes=require(_0xe8d0('0x9'));module['exports']=function(_0x560dab,_0x2e2985){return _0x560dab[_0xe8d0('0xa')](_0xe8d0('0xb'),attributes,{'tableName':_0xe8d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x51dad2,_0x336eb7){var _0x5a0e11=function(_0x3cbc6a){while(--_0x3cbc6a){_0x51dad2['push'](_0x51dad2['shift']());}};_0x5a0e11(++_0x336eb7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1d3a5d,_0x17fc32){_0x1d3a5d=_0x1d3a5d-0x0;var _0x257078=_0xf3cd[_0x1d3a5d];return _0x257078;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e105b9c..644d6f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc9=['../../config/logger','rpc','../../config/environment','http','request','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0x596480,_0xb6d7f8){var _0xb62361=function(_0x5e87d8){while(--_0x5e87d8){_0x596480['push'](_0x596480['shift']());}};_0xb62361(++_0xb6d7f8);}(_0x1cc9,0x19f));var _0x91cc=function(_0x2f0098,_0xc60904){_0x2f0098=_0x2f0098-0x0;var _0x364ea7=_0x1cc9[_0x2f0098];return _0x364ea7;};'use strict';var _=require(_0x91cc('0x0'));var util=require('util');var moment=require(_0x91cc('0x1'));var BPromise=require('bluebird');var rs=require(_0x91cc('0x2'));var fs=require('fs');var Redis=require(_0x91cc('0x3'));var db=require(_0x91cc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x91cc('0x5'))(_0x91cc('0x6'));var config=require(_0x91cc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x91cc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2692ae,_0x2fce50,_0x43d383){return new BPromise(function(_0x31ee42,_0x4f4042){return client[_0x91cc('0x9')](_0x2692ae,_0x43d383)['then'](function(_0x2d5f7e){logger['info'](_0x91cc('0xa'),_0x2fce50,'request\x20sent');logger[_0x91cc('0xb')](_0x91cc('0xc'),_0x2fce50,_0x91cc('0xd'),JSON[_0x91cc('0xe')](_0x2d5f7e));if(_0x2d5f7e[_0x91cc('0xf')]){if(_0x2d5f7e[_0x91cc('0xf')]['code']===0x1f4){logger[_0x91cc('0xf')](_0x91cc('0xa'),_0x2fce50,_0x2d5f7e[_0x91cc('0xf')][_0x91cc('0x10')]);return _0x4f4042(_0x2d5f7e[_0x91cc('0xf')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2fce50,_0x2d5f7e[_0x91cc('0xf')][_0x91cc('0x10')]);return _0x31ee42(_0x2d5f7e[_0x91cc('0xf')][_0x91cc('0x10')]);}else{logger[_0x91cc('0x11')](_0x91cc('0xa'),_0x2fce50,_0x91cc('0xd'));_0x31ee42(_0x2d5f7e[_0x91cc('0x12')]['message']);}})[_0x91cc('0x13')](function(_0x23acb8){logger[_0x91cc('0xf')](_0x91cc('0xa'),_0x2fce50,_0x23acb8);_0x4f4042(_0x23acb8);});});}
\ No newline at end of file
+var _0x67ed=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0x67ed,0x147));var _0xd67e=function(_0x575dff,_0x41c312){_0x575dff=_0x575dff-0x0;var _0x48b60e=_0x67ed[_0x575dff];return _0x48b60e;};'use strict';var _=require(_0xd67e('0x0'));var util=require(_0xd67e('0x1'));var moment=require(_0xd67e('0x2'));var BPromise=require(_0xd67e('0x3'));var rs=require(_0xd67e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd67e('0x5'));var logger=require(_0xd67e('0x6'))(_0xd67e('0x7'));var config=require(_0xd67e('0x8'));var jayson=require(_0xd67e('0x9'));var client=jayson[_0xd67e('0xa')][_0xd67e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17840b,_0x10f94e,_0x48c677){return new BPromise(function(_0x22b6a4,_0x1196a0){return client['request'](_0x17840b,_0x48c677)[_0xd67e('0xc')](function(_0x2b0275){logger['info'](_0xd67e('0xd'),_0x10f94e,_0xd67e('0xe'));logger[_0xd67e('0xf')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x10f94e,_0xd67e('0xe'),JSON[_0xd67e('0x10')](_0x2b0275));if(_0x2b0275[_0xd67e('0x11')]){if(_0x2b0275[_0xd67e('0x11')][_0xd67e('0x12')]===0x1f4){logger[_0xd67e('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x10f94e,_0x2b0275[_0xd67e('0x11')]['message']);return _0x1196a0(_0x2b0275['error'][_0xd67e('0x13')]);}logger[_0xd67e('0x11')](_0xd67e('0xd'),_0x10f94e,_0x2b0275[_0xd67e('0x11')][_0xd67e('0x13')]);return _0x22b6a4(_0x2b0275[_0xd67e('0x11')][_0xd67e('0x13')]);}else{logger[_0xd67e('0x14')](_0xd67e('0xd'),_0x10f94e,_0xd67e('0xe'));_0x22b6a4(_0x2b0275[_0xd67e('0x15')][_0xd67e('0x13')]);}})[_0xd67e('0x16')](function(_0x4ccc3e){logger['error'](_0xd67e('0xd'),_0x10f94e,_0x4ccc3e);_0x1196a0(_0x4ccc3e);});});}
\ No newline at end of file
index 821afc6..0df1cee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf23a=['isAuthenticated','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','/:id','show'];(function(_0x131a6b,_0x559d21){var _0x3095c8=function(_0xedba8f){while(--_0xedba8f){_0x131a6b['push'](_0x131a6b['shift']());}};_0x3095c8(++_0x559d21);}(_0xf23a,0x1db));var _0xaf23=function(_0x4dce26,_0x4cd21e){_0x4dce26=_0x4dce26-0x0;var _0x36465a=_0xf23a[_0x4dce26];return _0x36465a;};'use strict';var multer=require(_0xaf23('0x0'));var util=require('util');var path=require(_0xaf23('0x1'));var timeout=require(_0xaf23('0x2'));var express=require(_0xaf23('0x3'));var router=express[_0xaf23('0x4')]();var fs_extra=require(_0xaf23('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xaf23('0x6'));var config=require(_0xaf23('0x7'));var controller=require(_0xaf23('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xaf23('0x9'),auth['isAuthenticated'](),controller[_0xaf23('0xa')]);router['post']('/',auth[_0xaf23('0xb')](),controller[_0xaf23('0xc')]);router[_0xaf23('0xd')](_0xaf23('0x9'),auth[_0xaf23('0xb')](),controller[_0xaf23('0xe')]);router[_0xaf23('0xf')](_0xaf23('0x9'),auth[_0xaf23('0xb')](),controller[_0xaf23('0x10')]);module[_0xaf23('0x11')]=router;
\ No newline at end of file
+var _0x6eaa=['destroy','exports','multer','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','index','get','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6eaa,0x1ca));var _0xa6ea=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0x6eaa[_0x2ed8f3];return _0x525a55;};'use strict';var multer=require(_0xa6ea('0x0'));var util=require('util');var path=require(_0xa6ea('0x1'));var timeout=require(_0xa6ea('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa6ea('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa6ea('0x4'));var config=require(_0xa6ea('0x5'));var controller=require(_0xa6ea('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa6ea('0x7')]);router[_0xa6ea('0x8')]('/:id',auth[_0xa6ea('0x9')](),controller[_0xa6ea('0xa')]);router[_0xa6ea('0xb')]('/',auth[_0xa6ea('0x9')](),controller[_0xa6ea('0xc')]);router[_0xa6ea('0xd')](_0xa6ea('0xe'),auth['isAuthenticated'](),controller[_0xa6ea('0xf')]);router[_0xa6ea('0x10')](_0xa6ea('0xe'),auth[_0xa6ea('0x9')](),controller[_0xa6ea('0x11')]);module[_0xa6ea('0x12')]=router;
\ No newline at end of file
index f3128b9..6961614 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77df=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x77df,0x1d2));var _0xf77d=function(_0x117969,_0x43a3be){_0x117969=_0x117969-0x0;var _0x5bf3da=_0x77df[_0x117969];return _0x5bf3da;};'use strict';var Sequelize=require(_0xf77d('0x0'));module[_0xf77d('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf77d('0x2'),_0xf77d('0x3'),_0xf77d('0x4'),_0xf77d('0x5'),_0xf77d('0x6')),'defaultValue':_0xf77d('0x2')},'content':{'type':Sequelize[_0xf77d('0x7')]},'key':{'type':Sequelize[_0xf77d('0x7')]},'keyType':{'type':Sequelize[_0xf77d('0x8')](_0xf77d('0x2'),_0xf77d('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xf77d('0x7')]},'idField':{'type':Sequelize[_0xf77d('0x7')]},'nameField':{'type':Sequelize[_0xf77d('0x7')]},'customField':{'type':Sequelize[_0xf77d('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf77d('0x7')]}};
\ No newline at end of file
+var _0xbc39=['STRING','string','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist'];(function(_0x26e10d,_0x58f9b3){var _0x38f502=function(_0x49dbba){while(--_0x49dbba){_0x26e10d['push'](_0x26e10d['shift']());}};_0x38f502(++_0x58f9b3);}(_0xbc39,0x1bc));var _0x9bc3=function(_0xb11639,_0x9c8aa8){_0xb11639=_0xb11639-0x0;var _0x2f87de=_0xbc39[_0xb11639];return _0x2f87de;};'use strict';var Sequelize=require(_0x9bc3('0x0'));module[_0x9bc3('0x1')]={'type':{'type':Sequelize[_0x9bc3('0x2')]('string',_0x9bc3('0x3'),_0x9bc3('0x4'),'keyValue',_0x9bc3('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9bc3('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9bc3('0x2')](_0x9bc3('0x7'),'variable',_0x9bc3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9bc3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9bc3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9bc3('0x6')]}};
\ No newline at end of file
index 154b962..20ab7fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc56=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','destroy','error','name','send','index','map','Dynamics365Field','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','intersection','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x54fde2,_0x5574c5){var _0x18d6f5=function(_0x3bea35){while(--_0x3bea35){_0x54fde2['push'](_0x54fde2['shift']());}};_0x18d6f5(++_0x5574c5);}(_0xfc56,0x116));var _0x6fc5=function(_0x12ac90,_0x706170){_0x12ac90=_0x12ac90-0x0;var _0x331851=_0xfc56[_0x12ac90];return _0x331851;};'use strict';var emlformat=require(_0x6fc5('0x0'));var rimraf=require(_0x6fc5('0x1'));var zipdir=require(_0x6fc5('0x2'));var jsonpatch=require(_0x6fc5('0x3'));var rp=require(_0x6fc5('0x4'));var moment=require('moment');var BPromise=require(_0x6fc5('0x5'));var Mustache=require(_0x6fc5('0x6'));var util=require(_0x6fc5('0x7'));var path=require(_0x6fc5('0x8'));var sox=require(_0x6fc5('0x9'));var csv=require(_0x6fc5('0xa'));var ejs=require(_0x6fc5('0xb'));var fs=require('fs');var fs_extra=require(_0x6fc5('0xc'));var _=require(_0x6fc5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6fc5('0xa'));var querystring=require('querystring');var Papa=require(_0x6fc5('0xe'));var Redis=require(_0x6fc5('0xf'));var authService=require(_0x6fc5('0x10'));var qs=require(_0x6fc5('0x11'));var as=require(_0x6fc5('0x12'));var hardwareService=require(_0x6fc5('0x13'));var logger=require(_0x6fc5('0x14'))('api');var utils=require(_0x6fc5('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6fc5('0x16'));var db=require(_0x6fc5('0x17'))['db'];function respondWithStatusCode(_0x5e5f41,_0x5400c1){_0x5400c1=_0x5400c1||0xcc;return function(_0x37241b){if(_0x37241b){return _0x5e5f41[_0x6fc5('0x18')](_0x5400c1);}return _0x5e5f41[_0x6fc5('0x19')](_0x5400c1)[_0x6fc5('0x1a')]();};}function respondWithResult(_0x1c4e27,_0x58c4b0){_0x58c4b0=_0x58c4b0||0xc8;return function(_0x9a26fe){if(_0x9a26fe){return _0x1c4e27[_0x6fc5('0x19')](_0x58c4b0)['json'](_0x9a26fe);}};}function respondWithFilteredResult(_0x4ca46b,_0x1f76aa){return function(_0x2a5d38){if(_0x2a5d38){var _0x3d2b29=typeof _0x1f76aa[_0x6fc5('0x1b')]==='undefined'&&typeof _0x1f76aa[_0x6fc5('0x1c')]===_0x6fc5('0x1d');var _0x2aeaf3=_0x2a5d38[_0x6fc5('0x1e')];var _0x59dde9=_0x3d2b29?0x0:_0x1f76aa[_0x6fc5('0x1b')];var _0x250eea=_0x3d2b29?_0x2a5d38['count']:_0x1f76aa[_0x6fc5('0x1b')]+_0x1f76aa[_0x6fc5('0x1c')];var _0x1a3c11;if(_0x250eea>=_0x2aeaf3){_0x250eea=_0x2aeaf3;_0x1a3c11=0xc8;}else{_0x1a3c11=0xce;}_0x4ca46b[_0x6fc5('0x19')](_0x1a3c11);return _0x4ca46b[_0x6fc5('0x1f')]('Content-Range',_0x59dde9+'-'+_0x250eea+'/'+_0x2aeaf3)[_0x6fc5('0x20')](_0x2a5d38);}return null;};}function patchUpdates(_0x3f45c2){return function(_0x4c911e){try{jsonpatch[_0x6fc5('0x21')](_0x4c911e,_0x3f45c2,!![]);}catch(_0x57eb3){return BPromise[_0x6fc5('0x22')](_0x57eb3);}return _0x4c911e[_0x6fc5('0x23')]();};}function saveUpdates(_0x1c33ac,_0x351761){return function(_0x57cad6){if(_0x57cad6){return _0x57cad6[_0x6fc5('0x24')](_0x1c33ac)[_0x6fc5('0x25')](function(_0x2c4561){return _0x2c4561;});}return null;};}function removeEntity(_0x56e0b6,_0x4825a9){return function(_0xadb3b6){if(_0xadb3b6){return _0xadb3b6[_0x6fc5('0x26')]()[_0x6fc5('0x25')](function(){_0x56e0b6[_0x6fc5('0x19')](0xcc)[_0x6fc5('0x1a')]();});}};}function handleEntityNotFound(_0x51f429,_0x51ead0){return function(_0x3f4c34){if(!_0x3f4c34){_0x51f429[_0x6fc5('0x18')](0x194);}return _0x3f4c34;};}function handleError(_0xe94a2b,_0x442600){_0x442600=_0x442600||0x1f4;return function(_0x294c03){logger[_0x6fc5('0x27')](_0x294c03['stack']);if(_0x294c03['name']){delete _0x294c03[_0x6fc5('0x28')];}_0xe94a2b['status'](_0x442600)[_0x6fc5('0x29')](_0x294c03);};}exports[_0x6fc5('0x2a')]=function(_0x4f358b,_0x4736fa){var _0x49179f={},_0x54c4ce={},_0x2368e9={'count':0x0,'rows':[]};var _0x150dde=_[_0x6fc5('0x2b')](db[_0x6fc5('0x2c')][_0x6fc5('0x2d')],function(_0x197636){return{'name':_0x197636[_0x6fc5('0x2e')],'type':_0x197636[_0x6fc5('0x2f')]['key']};});_0x54c4ce['model']=_[_0x6fc5('0x2b')](_0x150dde,'name');_0x54c4ce[_0x6fc5('0x30')]=_[_0x6fc5('0x31')](_0x4f358b[_0x6fc5('0x30')]);_0x54c4ce[_0x6fc5('0x32')]=_['intersection'](_0x54c4ce[_0x6fc5('0x33')],_0x54c4ce[_0x6fc5('0x30')]);_0x49179f[_0x6fc5('0x34')]=_['intersection'](_0x54c4ce[_0x6fc5('0x33')],qs[_0x6fc5('0x35')](_0x4f358b[_0x6fc5('0x30')]['fields']));_0x49179f[_0x6fc5('0x34')]=_0x49179f[_0x6fc5('0x34')][_0x6fc5('0x36')]?_0x49179f['attributes']:_0x54c4ce[_0x6fc5('0x33')];if(!_0x4f358b[_0x6fc5('0x30')]['hasOwnProperty'](_0x6fc5('0x37'))){_0x49179f[_0x6fc5('0x1c')]=qs[_0x6fc5('0x1c')](_0x4f358b[_0x6fc5('0x30')][_0x6fc5('0x1c')]);_0x49179f['offset']=qs[_0x6fc5('0x1b')](_0x4f358b[_0x6fc5('0x30')]['offset']);}_0x49179f[_0x6fc5('0x38')]=qs[_0x6fc5('0x39')](_0x4f358b[_0x6fc5('0x30')]['sort']);_0x49179f[_0x6fc5('0x3a')]=qs[_0x6fc5('0x32')](_[_0x6fc5('0x3b')](_0x4f358b[_0x6fc5('0x30')],_0x54c4ce['filters']),_0x150dde);if(_0x4f358b[_0x6fc5('0x30')][_0x6fc5('0x3c')]){_0x49179f[_0x6fc5('0x3a')]=_[_0x6fc5('0x3d')](_0x49179f[_0x6fc5('0x3a')],{'$or':_['map'](_0x150dde,function(_0x1143e8){if(_0x1143e8[_0x6fc5('0x2f')]!==_0x6fc5('0x3e')){var _0x571c60={};_0x571c60[_0x1143e8[_0x6fc5('0x28')]]={'$like':'%'+_0x4f358b[_0x6fc5('0x30')][_0x6fc5('0x3c')]+'%'};return _0x571c60;}})});}_0x49179f=_[_0x6fc5('0x3d')]({},_0x49179f,_0x4f358b[_0x6fc5('0x3f')]);var _0x29402c={'where':_0x49179f[_0x6fc5('0x3a')]};return db[_0x6fc5('0x2c')][_0x6fc5('0x1e')](_0x29402c)[_0x6fc5('0x25')](function(_0x3311a2){_0x2368e9[_0x6fc5('0x1e')]=_0x3311a2;if(_0x4f358b['query'][_0x6fc5('0x40')]){_0x49179f[_0x6fc5('0x41')]=[{'all':!![]}];}return db[_0x6fc5('0x2c')]['findAll'](_0x49179f);})[_0x6fc5('0x25')](function(_0x456f73){_0x2368e9[_0x6fc5('0x42')]=_0x456f73;return _0x2368e9;})[_0x6fc5('0x25')](respondWithFilteredResult(_0x4736fa,_0x49179f))['catch'](handleError(_0x4736fa,null));};exports[_0x6fc5('0x43')]=function(_0x2ead4c,_0x8ec08e){var _0x291fa5={'raw':!![],'where':{'id':_0x2ead4c[_0x6fc5('0x44')]['id']}},_0x188835={};_0x188835['model']=_[_0x6fc5('0x31')](db['Dynamics365Field'][_0x6fc5('0x2d')]);_0x188835[_0x6fc5('0x30')]=_[_0x6fc5('0x31')](_0x2ead4c[_0x6fc5('0x30')]);_0x188835[_0x6fc5('0x32')]=_[_0x6fc5('0x45')](_0x188835[_0x6fc5('0x33')],_0x188835['query']);_0x291fa5[_0x6fc5('0x34')]=_[_0x6fc5('0x45')](_0x188835[_0x6fc5('0x33')],qs['fields'](_0x2ead4c[_0x6fc5('0x30')][_0x6fc5('0x35')]));_0x291fa5[_0x6fc5('0x34')]=_0x291fa5[_0x6fc5('0x34')][_0x6fc5('0x36')]?_0x291fa5[_0x6fc5('0x34')]:_0x188835['model'];if(_0x2ead4c[_0x6fc5('0x30')][_0x6fc5('0x40')]){_0x291fa5[_0x6fc5('0x41')]=[{'all':!![]}];}_0x291fa5=_[_0x6fc5('0x3d')]({},_0x291fa5,_0x2ead4c[_0x6fc5('0x3f')]);return db[_0x6fc5('0x2c')][_0x6fc5('0x46')](_0x291fa5)[_0x6fc5('0x25')](handleEntityNotFound(_0x8ec08e,null))['then'](respondWithResult(_0x8ec08e,null))[_0x6fc5('0x47')](handleError(_0x8ec08e,null));};exports[_0x6fc5('0x48')]=function(_0x1207c3,_0x190492){return db['Dynamics365Field'][_0x6fc5('0x48')](_0x1207c3[_0x6fc5('0x49')],{})[_0x6fc5('0x25')](respondWithResult(_0x190492,0xc9))[_0x6fc5('0x47')](handleError(_0x190492,null));};exports['update']=function(_0x3222a1,_0x13bc04){if(_0x3222a1[_0x6fc5('0x49')]['id']){delete _0x3222a1[_0x6fc5('0x49')]['id'];}return db[_0x6fc5('0x2c')]['find']({'where':{'id':_0x3222a1[_0x6fc5('0x44')]['id']}})[_0x6fc5('0x25')](handleEntityNotFound(_0x13bc04,null))[_0x6fc5('0x25')](saveUpdates(_0x3222a1[_0x6fc5('0x49')],null))['then'](respondWithResult(_0x13bc04,null))[_0x6fc5('0x47')](handleError(_0x13bc04,null));};exports[_0x6fc5('0x26')]=function(_0x2ed7c8,_0x36e0d8){return db[_0x6fc5('0x2c')][_0x6fc5('0x46')]({'where':{'id':_0x2ed7c8[_0x6fc5('0x44')]['id']}})[_0x6fc5('0x25')](handleEntityNotFound(_0x36e0d8,null))[_0x6fc5('0x25')](removeEntity(_0x36e0d8,null))[_0x6fc5('0x47')](handleError(_0x36e0d8,null));};
\ No newline at end of file
+var _0x3c5a=['pick','filter','merge','then','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','bluebird','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x3c5a,0x1f2));var _0xa3c5=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0x3c5a[_0x368bba];return _0x409f8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3c5('0x0'));var zipdir=require(_0xa3c5('0x1'));var jsonpatch=require(_0xa3c5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa3c5('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa3c5('0x4'));var sox=require('sox');var csv=require(_0xa3c5('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa3c5('0x6'));var crypto=require(_0xa3c5('0x7'));var jsforce=require(_0xa3c5('0x8'));var deskjs=require(_0xa3c5('0x9'));var toCsv=require(_0xa3c5('0x5'));var querystring=require(_0xa3c5('0xa'));var Papa=require(_0xa3c5('0xb'));var Redis=require('ioredis');var authService=require(_0xa3c5('0xc'));var qs=require(_0xa3c5('0xd'));var as=require(_0xa3c5('0xe'));var hardwareService=require(_0xa3c5('0xf'));var logger=require('../../config/logger')(_0xa3c5('0x10'));var utils=require(_0xa3c5('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x264fb9,_0x1f8f9b){_0x1f8f9b=_0x1f8f9b||0xcc;return function(_0x295528){if(_0x295528){return _0x264fb9[_0xa3c5('0x12')](_0x1f8f9b);}return _0x264fb9[_0xa3c5('0x13')](_0x1f8f9b)[_0xa3c5('0x14')]();};}function respondWithResult(_0x219950,_0x22a087){_0x22a087=_0x22a087||0xc8;return function(_0x3c7d75){if(_0x3c7d75){return _0x219950[_0xa3c5('0x13')](_0x22a087)[_0xa3c5('0x15')](_0x3c7d75);}};}function respondWithFilteredResult(_0x4d42ea,_0x1ba709){return function(_0x2f39b6){if(_0x2f39b6){var _0xf8780a=typeof _0x1ba709[_0xa3c5('0x16')]===_0xa3c5('0x17')&&typeof _0x1ba709['limit']===_0xa3c5('0x17');var _0x2407ce=_0x2f39b6[_0xa3c5('0x18')];var _0x4bf3d2=_0xf8780a?0x0:_0x1ba709['offset'];var _0x74be12=_0xf8780a?_0x2f39b6['count']:_0x1ba709[_0xa3c5('0x16')]+_0x1ba709[_0xa3c5('0x19')];var _0x8fb1a5;if(_0x74be12>=_0x2407ce){_0x74be12=_0x2407ce;_0x8fb1a5=0xc8;}else{_0x8fb1a5=0xce;}_0x4d42ea[_0xa3c5('0x13')](_0x8fb1a5);return _0x4d42ea[_0xa3c5('0x1a')](_0xa3c5('0x1b'),_0x4bf3d2+'-'+_0x74be12+'/'+_0x2407ce)['json'](_0x2f39b6);}return null;};}function patchUpdates(_0x3fbd21){return function(_0x427e5a){try{jsonpatch[_0xa3c5('0x1c')](_0x427e5a,_0x3fbd21,!![]);}catch(_0x2d2219){return BPromise[_0xa3c5('0x1d')](_0x2d2219);}return _0x427e5a['save']();};}function saveUpdates(_0x40b19f,_0x136574){return function(_0x5b56f1){if(_0x5b56f1){return _0x5b56f1[_0xa3c5('0x1e')](_0x40b19f)['then'](function(_0x2568d7){return _0x2568d7;});}return null;};}function removeEntity(_0x2e3066,_0x375c4f){return function(_0x574384){if(_0x574384){return _0x574384[_0xa3c5('0x1f')]()['then'](function(){_0x2e3066[_0xa3c5('0x13')](0xcc)[_0xa3c5('0x14')]();});}};}function handleEntityNotFound(_0x4ac9f9,_0xe4aca5){return function(_0x56d18e){if(!_0x56d18e){_0x4ac9f9[_0xa3c5('0x12')](0x194);}return _0x56d18e;};}function handleError(_0x7d6fa3,_0x40675e){_0x40675e=_0x40675e||0x1f4;return function(_0x5b0fe1){logger['error'](_0x5b0fe1[_0xa3c5('0x20')]);if(_0x5b0fe1[_0xa3c5('0x21')]){delete _0x5b0fe1['name'];}_0x7d6fa3['status'](_0x40675e)[_0xa3c5('0x22')](_0x5b0fe1);};}exports[_0xa3c5('0x23')]=function(_0x299fce,_0x427637){var _0x5a2aac={},_0x1c07fb={},_0x3c4296={'count':0x0,'rows':[]};var _0x3027b9=_['map'](db[_0xa3c5('0x24')][_0xa3c5('0x25')],function(_0x38ba19){return{'name':_0x38ba19[_0xa3c5('0x26')],'type':_0x38ba19[_0xa3c5('0x27')][_0xa3c5('0x28')]};});_0x1c07fb[_0xa3c5('0x29')]=_[_0xa3c5('0x2a')](_0x3027b9,_0xa3c5('0x21'));_0x1c07fb[_0xa3c5('0x2b')]=_[_0xa3c5('0x2c')](_0x299fce['query']);_0x1c07fb[_0xa3c5('0x2d')]=_[_0xa3c5('0x2e')](_0x1c07fb[_0xa3c5('0x29')],_0x1c07fb[_0xa3c5('0x2b')]);_0x5a2aac[_0xa3c5('0x2f')]=_[_0xa3c5('0x2e')](_0x1c07fb[_0xa3c5('0x29')],qs[_0xa3c5('0x30')](_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x30')]));_0x5a2aac['attributes']=_0x5a2aac[_0xa3c5('0x2f')][_0xa3c5('0x31')]?_0x5a2aac[_0xa3c5('0x2f')]:_0x1c07fb[_0xa3c5('0x29')];if(!_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x32')]('nolimit')){_0x5a2aac[_0xa3c5('0x19')]=qs[_0xa3c5('0x19')](_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x19')]);_0x5a2aac[_0xa3c5('0x16')]=qs[_0xa3c5('0x16')](_0x299fce['query'][_0xa3c5('0x16')]);}_0x5a2aac[_0xa3c5('0x33')]=qs[_0xa3c5('0x34')](_0x299fce['query'][_0xa3c5('0x34')]);_0x5a2aac[_0xa3c5('0x35')]=qs[_0xa3c5('0x2d')](_[_0xa3c5('0x36')](_0x299fce[_0xa3c5('0x2b')],_0x1c07fb['filters']),_0x3027b9);if(_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x37')]){_0x5a2aac[_0xa3c5('0x35')]=_[_0xa3c5('0x38')](_0x5a2aac[_0xa3c5('0x35')],{'$or':_['map'](_0x3027b9,function(_0x491e78){if(_0x491e78[_0xa3c5('0x27')]!=='VIRTUAL'){var _0x34762f={};_0x34762f[_0x491e78[_0xa3c5('0x21')]]={'$like':'%'+_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x37')]+'%'};return _0x34762f;}})});}_0x5a2aac=_[_0xa3c5('0x38')]({},_0x5a2aac,_0x299fce['options']);var _0x570545={'where':_0x5a2aac[_0xa3c5('0x35')]};return db[_0xa3c5('0x24')][_0xa3c5('0x18')](_0x570545)[_0xa3c5('0x39')](function(_0x246117){_0x3c4296['count']=_0x246117;if(_0x299fce[_0xa3c5('0x2b')][_0xa3c5('0x3a')]){_0x5a2aac[_0xa3c5('0x3b')]=[{'all':!![]}];}return db[_0xa3c5('0x24')][_0xa3c5('0x3c')](_0x5a2aac);})[_0xa3c5('0x39')](function(_0x232329){_0x3c4296[_0xa3c5('0x3d')]=_0x232329;return _0x3c4296;})['then'](respondWithFilteredResult(_0x427637,_0x5a2aac))[_0xa3c5('0x3e')](handleError(_0x427637,null));};exports[_0xa3c5('0x3f')]=function(_0x2f0d9c,_0x5929fd){var _0x2272e9={'raw':!![],'where':{'id':_0x2f0d9c['params']['id']}},_0x1b6760={};_0x1b6760[_0xa3c5('0x29')]=_['keys'](db[_0xa3c5('0x24')]['rawAttributes']);_0x1b6760[_0xa3c5('0x2b')]=_['keys'](_0x2f0d9c['query']);_0x1b6760[_0xa3c5('0x2d')]=_[_0xa3c5('0x2e')](_0x1b6760[_0xa3c5('0x29')],_0x1b6760[_0xa3c5('0x2b')]);_0x2272e9['attributes']=_[_0xa3c5('0x2e')](_0x1b6760['model'],qs[_0xa3c5('0x30')](_0x2f0d9c[_0xa3c5('0x2b')][_0xa3c5('0x30')]));_0x2272e9[_0xa3c5('0x2f')]=_0x2272e9[_0xa3c5('0x2f')]['length']?_0x2272e9[_0xa3c5('0x2f')]:_0x1b6760[_0xa3c5('0x29')];if(_0x2f0d9c[_0xa3c5('0x2b')][_0xa3c5('0x3a')]){_0x2272e9[_0xa3c5('0x3b')]=[{'all':!![]}];}_0x2272e9=_[_0xa3c5('0x38')]({},_0x2272e9,_0x2f0d9c[_0xa3c5('0x40')]);return db[_0xa3c5('0x24')][_0xa3c5('0x41')](_0x2272e9)[_0xa3c5('0x39')](handleEntityNotFound(_0x5929fd,null))[_0xa3c5('0x39')](respondWithResult(_0x5929fd,null))[_0xa3c5('0x3e')](handleError(_0x5929fd,null));};exports[_0xa3c5('0x42')]=function(_0x531c31,_0x1dec5b){return db[_0xa3c5('0x24')][_0xa3c5('0x42')](_0x531c31[_0xa3c5('0x43')],{})[_0xa3c5('0x39')](respondWithResult(_0x1dec5b,0xc9))['catch'](handleError(_0x1dec5b,null));};exports[_0xa3c5('0x1e')]=function(_0x49ac52,_0x5b8e19){if(_0x49ac52[_0xa3c5('0x43')]['id']){delete _0x49ac52['body']['id'];}return db[_0xa3c5('0x24')][_0xa3c5('0x41')]({'where':{'id':_0x49ac52[_0xa3c5('0x44')]['id']}})[_0xa3c5('0x39')](handleEntityNotFound(_0x5b8e19,null))[_0xa3c5('0x39')](saveUpdates(_0x49ac52[_0xa3c5('0x43')],null))[_0xa3c5('0x39')](respondWithResult(_0x5b8e19,null))[_0xa3c5('0x3e')](handleError(_0x5b8e19,null));};exports[_0xa3c5('0x1f')]=function(_0x58cf35,_0x2cb834){return db['Dynamics365Field']['find']({'where':{'id':_0x58cf35[_0xa3c5('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cb834,null))[_0xa3c5('0x39')](removeEntity(_0x2cb834,null))[_0xa3c5('0x3e')](handleError(_0x2cb834,null));};
\ No newline at end of file
index 7461247..a5e6aef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a31=['dynamics365_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields'];(function(_0xa80064,_0x55b9ce){var _0x1ad1da=function(_0x39ddb9){while(--_0x39ddb9){_0xa80064['push'](_0xa80064['shift']());}};_0x1ad1da(++_0x55b9ce);}(_0x7a31,0x73));var _0x17a3=function(_0x3aa338,_0x47cc8c){_0x3aa338=_0x3aa338-0x0;var _0x5ca12b=_0x7a31[_0x3aa338];return _0x5ca12b;};'use strict';var _=require('lodash');var util=require(_0x17a3('0x0'));var logger=require(_0x17a3('0x1'))('api');var moment=require(_0x17a3('0x2'));var BPromise=require(_0x17a3('0x3'));var rp=require(_0x17a3('0x4'));var fs=require('fs');var path=require(_0x17a3('0x5'));var rimraf=require(_0x17a3('0x6'));var config=require('../../config/environment');var attributes=require(_0x17a3('0x7'));module['exports']=function(_0x296b94,_0x526371){return _0x296b94[_0x17a3('0x8')](_0x17a3('0x9'),attributes,{'tableName':_0x17a3('0xa'),'paranoid':![],'indexes':[{'name':_0x17a3('0xb'),'fields':[_0x17a3('0xc'),_0x17a3('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8db7=['./intDynamics365Field.attributes','define','int_dynamics365_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36bcb5,_0x13f5ff){var _0x46d0e6=function(_0x5e79ef){while(--_0x5e79ef){_0x36bcb5['push'](_0x36bcb5['shift']());}};_0x46d0e6(++_0x13f5ff);}(_0x8db7,0x1d6));var _0x78db=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x8db7[_0x40220a];return _0x3903cc;};'use strict';var _=require(_0x78db('0x0'));var util=require(_0x78db('0x1'));var logger=require(_0x78db('0x2'))(_0x78db('0x3'));var moment=require(_0x78db('0x4'));var BPromise=require(_0x78db('0x5'));var rp=require(_0x78db('0x6'));var fs=require('fs');var path=require(_0x78db('0x7'));var rimraf=require(_0x78db('0x8'));var config=require(_0x78db('0x9'));var attributes=require(_0x78db('0xa'));module['exports']=function(_0x557bd6,_0x119557){return _0x557bd6[_0x78db('0xb')]('Dynamics365Field',attributes,{'tableName':_0x78db('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x78db('0xd'),_0x78db('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 72a7679..cbdda48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95b1=['../../config/environment','jayson/promise','http','then','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x95b1,0x189));var _0x195b=function(_0x158295,_0x4073fb){_0x158295=_0x158295-0x0;var _0x5f39aa=_0x95b1[_0x158295];return _0x5f39aa;};'use strict';var _=require(_0x195b('0x0'));var util=require('util');var moment=require(_0x195b('0x1'));var BPromise=require('bluebird');var rs=require(_0x195b('0x2'));var fs=require('fs');var Redis=require(_0x195b('0x3'));var db=require(_0x195b('0x4'))['db'];var utils=require(_0x195b('0x5'));var logger=require(_0x195b('0x6'))('rpc');var config=require(_0x195b('0x7'));var jayson=require(_0x195b('0x8'));var client=jayson['client'][_0x195b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x38ea40,_0x248811,_0x1c9516){return new BPromise(function(_0xc15e33,_0x269362){return client['request'](_0x38ea40,_0x1c9516)[_0x195b('0xa')](function(_0x255a66){logger[_0x195b('0xb')](_0x195b('0xc'),_0x248811,'request\x20sent');logger[_0x195b('0xd')](_0x195b('0xe'),_0x248811,'request\x20sent',JSON[_0x195b('0xf')](_0x255a66));if(_0x255a66[_0x195b('0x10')]){if(_0x255a66[_0x195b('0x10')][_0x195b('0x11')]===0x1f4){logger[_0x195b('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x248811,_0x255a66['error']['message']);return _0x269362(_0x255a66[_0x195b('0x10')][_0x195b('0x12')]);}logger[_0x195b('0x10')](_0x195b('0xc'),_0x248811,_0x255a66[_0x195b('0x10')]['message']);return _0xc15e33(_0x255a66[_0x195b('0x10')][_0x195b('0x12')]);}else{logger['info'](_0x195b('0xc'),_0x248811,_0x195b('0x13'));_0xc15e33(_0x255a66['result'][_0x195b('0x12')]);}})['catch'](function(_0x20e5b6){logger[_0x195b('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x248811,_0x20e5b6);_0x269362(_0x20e5b6);});});}
\ No newline at end of file
+var _0x3816=['code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x3816,0x118));var _0x6381=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0x3816[_0x31abee];return _0x3c1761;};'use strict';var _=require(_0x6381('0x0'));var util=require('util');var moment=require(_0x6381('0x1'));var BPromise=require('bluebird');var rs=require(_0x6381('0x2'));var fs=require('fs');var Redis=require(_0x6381('0x3'));var db=require(_0x6381('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6381('0x5'))(_0x6381('0x6'));var config=require(_0x6381('0x7'));var jayson=require(_0x6381('0x8'));var client=jayson[_0x6381('0x9')][_0x6381('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14c61d,_0x215294,_0x1822b3){return new BPromise(function(_0x1c8b0e,_0x59352e){return client[_0x6381('0xb')](_0x14c61d,_0x1822b3)[_0x6381('0xc')](function(_0xfb90f4){logger[_0x6381('0xd')](_0x6381('0xe'),_0x215294,_0x6381('0xf'));logger[_0x6381('0x10')](_0x6381('0x11'),_0x215294,_0x6381('0xf'),JSON['stringify'](_0xfb90f4));if(_0xfb90f4[_0x6381('0x12')]){if(_0xfb90f4[_0x6381('0x12')][_0x6381('0x13')]===0x1f4){logger[_0x6381('0x12')](_0x6381('0xe'),_0x215294,_0xfb90f4['error'][_0x6381('0x14')]);return _0x59352e(_0xfb90f4['error'][_0x6381('0x14')]);}logger[_0x6381('0x12')]('Dynamics365Field,\x20%s,\x20%s',_0x215294,_0xfb90f4['error'][_0x6381('0x14')]);return _0x1c8b0e(_0xfb90f4[_0x6381('0x12')][_0x6381('0x14')]);}else{logger[_0x6381('0xd')](_0x6381('0xe'),_0x215294,_0x6381('0xf'));_0x1c8b0e(_0xfb90f4[_0x6381('0x15')][_0x6381('0x14')]);}})[_0x6381('0x16')](function(_0x3b5283){logger[_0x6381('0x12')](_0x6381('0xe'),_0x215294,_0x3b5283);_0x59352e(_0x3b5283);});});}
\ No newline at end of file
index 6a29a05..0c6d158 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4290=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x2bed0b,_0x43cdcf){var _0x3cf928=function(_0x5ebe0c){while(--_0x5ebe0c){_0x2bed0b['push'](_0x2bed0b['shift']());}};_0x3cf928(++_0x43cdcf);}(_0x4290,0x1d7));var _0x0429=function(_0x5d5d37,_0x2ae286){_0x5d5d37=_0x5d5d37-0x0;var _0x2fd5c0=_0x4290[_0x5d5d37];return _0x2fd5c0;};'use strict';var multer=require('multer');var util=require(_0x0429('0x0'));var path=require(_0x0429('0x1'));var timeout=require(_0x0429('0x2'));var express=require(_0x0429('0x3'));var router=express['Router']();var fs_extra=require(_0x0429('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0429('0x5'));var config=require(_0x0429('0x6'));var controller=require(_0x0429('0x7'));router[_0x0429('0x8')]('/',auth[_0x0429('0x9')](),controller[_0x0429('0xa')]);router[_0x0429('0x8')](_0x0429('0xb'),auth[_0x0429('0x9')](),controller[_0x0429('0xc')]);router[_0x0429('0x8')](_0x0429('0xd'),auth['isAuthenticated'](),controller[_0x0429('0xe')]);router[_0x0429('0x8')](_0x0429('0xf'),auth[_0x0429('0x9')](),controller[_0x0429('0x10')]);router[_0x0429('0x11')]('/',auth[_0x0429('0x9')](),controller[_0x0429('0x12')]);router[_0x0429('0x11')](_0x0429('0xd'),auth[_0x0429('0x9')](),controller[_0x0429('0x13')]);router[_0x0429('0x14')](_0x0429('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0429('0x15')]('/:id',auth[_0x0429('0x9')](),controller[_0x0429('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xde64=['destroy','exports','multer','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','put'];(function(_0x1a4ecf,_0x4a2c29){var _0x3f73bc=function(_0x54ef48){while(--_0x54ef48){_0x1a4ecf['push'](_0x1a4ecf['shift']());}};_0x3f73bc(++_0x4a2c29);}(_0xde64,0x6e));var _0x4de6=function(_0x177840,_0x401179){_0x177840=_0x177840-0x0;var _0x28ed7c=_0xde64[_0x177840];return _0x28ed7c;};'use strict';var multer=require(_0x4de6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4de6('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4de6('0x2'));var interaction=require(_0x4de6('0x3'));var config=require('../../config/environment');var controller=require(_0x4de6('0x4'));router['get']('/',auth[_0x4de6('0x5')](),controller[_0x4de6('0x6')]);router[_0x4de6('0x7')](_0x4de6('0x8'),auth[_0x4de6('0x5')](),controller[_0x4de6('0x9')]);router[_0x4de6('0x7')](_0x4de6('0xa'),auth[_0x4de6('0x5')](),controller[_0x4de6('0xb')]);router[_0x4de6('0x7')](_0x4de6('0xc'),auth[_0x4de6('0x5')](),controller[_0x4de6('0xd')]);router[_0x4de6('0xe')]('/',auth[_0x4de6('0x5')](),controller['create']);router[_0x4de6('0xe')](_0x4de6('0xa'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4de6('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x4de6('0x8'),auth[_0x4de6('0x5')](),controller[_0x4de6('0x10')]);module[_0x4de6('0x11')]=router;
\ No newline at end of file
index 8a92c36..dc7106b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x2542,0x169));var _0x2254=function(_0x5239ca,_0x53b5c7){_0x5239ca=_0x5239ca-0x0;var _0x74132=_0x2542[_0x5239ca];return _0x74132;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xc2c7=['exports','STRING','username','remoteUri'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0xc2c7,0x134));var _0x7c2c=function(_0x39e971,_0x392547){_0x39e971=_0x39e971-0x0;var _0x361f19=_0xc2c7[_0x39e971];return _0x361f19;};'use strict';var Sequelize=require('sequelize');module[_0x7c2c('0x0')]={'name':{'type':Sequelize[_0x7c2c('0x1')]},'description':{'type':Sequelize[_0x7c2c('0x1')]},'username':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x2')},'apiKey':{'type':Sequelize[_0x7c2c('0x1')]},'remoteUri':{'type':Sequelize[_0x7c2c('0x1')],'unique':_0x7c2c('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 3920636..ad375f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x453b=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','FreshdeskAccount','fieldName','type','key','model','keys','intersection','query','attributes','fields','nolimit','order','sort','filters','filter','where','merge','include','findAll','rows','show','params','rawAttributes','length','includeAll','options','find','catch','create','body','getConfigurations','FreshdeskConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','findOne','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','description','priority','source','group','company','remove','includes','default','custom_dropdown','label','choices','capitalize','test','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x47fd17,_0x4f7037){var _0x353a4b=function(_0x16badc){while(--_0x16badc){_0x47fd17['push'](_0x47fd17['shift']());}};_0x353a4b(++_0x4f7037);}(_0x453b,0x164));var _0xb453=function(_0x44606e,_0x2bf244){_0x44606e=_0x44606e-0x0;var _0xe68388=_0x453b[_0x44606e];return _0xe68388;};'use strict';var emlformat=require(_0xb453('0x0'));var rimraf=require(_0xb453('0x1'));var zipdir=require(_0xb453('0x2'));var jsonpatch=require(_0xb453('0x3'));var rp=require(_0xb453('0x4'));var moment=require(_0xb453('0x5'));var BPromise=require(_0xb453('0x6'));var Mustache=require(_0xb453('0x7'));var util=require(_0xb453('0x8'));var path=require(_0xb453('0x9'));var sox=require(_0xb453('0xa'));var csv=require(_0xb453('0xb'));var ejs=require(_0xb453('0xc'));var fs=require('fs');var fs_extra=require(_0xb453('0xd'));var _=require(_0xb453('0xe'));var squel=require(_0xb453('0xf'));var crypto=require('crypto');var jsforce=require(_0xb453('0x10'));var deskjs=require(_0xb453('0x11'));var toCsv=require('to-csv');var querystring=require(_0xb453('0x12'));var Papa=require('papaparse');var Redis=require(_0xb453('0x13'));var authService=require(_0xb453('0x14'));var qs=require(_0xb453('0x15'));var as=require(_0xb453('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb453('0x17'))(_0xb453('0x18'));var utils=require(_0xb453('0x19'));var config=require(_0xb453('0x1a'));var licenseUtil=require(_0xb453('0x1b'));var db=require(_0xb453('0x1c'))['db'];var integrations=require(_0xb453('0x1d'));function respondWithStatusCode(_0x22e39b,_0x2d24b9){_0x2d24b9=_0x2d24b9||0xcc;return function(_0x5deeab){if(_0x5deeab){return _0x22e39b['sendStatus'](_0x2d24b9);}return _0x22e39b['status'](_0x2d24b9)[_0xb453('0x1e')]();};}function respondWithResult(_0x50d908,_0x3853fb){_0x3853fb=_0x3853fb||0xc8;return function(_0x3cd12d){if(_0x3cd12d){return _0x50d908[_0xb453('0x1f')](_0x3853fb)['json'](_0x3cd12d);}};}function respondWithFilteredResult(_0x5ee747,_0x30550b){return function(_0x376b8e){if(_0x376b8e){var _0x1f8b95=typeof _0x30550b[_0xb453('0x20')]===_0xb453('0x21')&&typeof _0x30550b[_0xb453('0x22')]===_0xb453('0x21');var _0x1f8604=_0x376b8e[_0xb453('0x23')];var _0x55d4d8=_0x1f8b95?0x0:_0x30550b['offset'];var _0x521542=_0x1f8b95?_0x376b8e['count']:_0x30550b[_0xb453('0x20')]+_0x30550b[_0xb453('0x22')];var _0x25403e;if(_0x521542>=_0x1f8604){_0x521542=_0x1f8604;_0x25403e=0xc8;}else{_0x25403e=0xce;}_0x5ee747[_0xb453('0x1f')](_0x25403e);return _0x5ee747[_0xb453('0x24')](_0xb453('0x25'),_0x55d4d8+'-'+_0x521542+'/'+_0x1f8604)['json'](_0x376b8e);}return null;};}function patchUpdates(_0x4d1cd7){return function(_0x57293a){try{jsonpatch[_0xb453('0x26')](_0x57293a,_0x4d1cd7,!![]);}catch(_0x50cab2){return BPromise[_0xb453('0x27')](_0x50cab2);}return _0x57293a[_0xb453('0x28')]();};}function saveUpdates(_0x1f87bf,_0x22f284){return function(_0xfffaf){if(_0xfffaf){return _0xfffaf[_0xb453('0x29')](_0x1f87bf)[_0xb453('0x2a')](function(_0x5f8a52){return _0x5f8a52;});}return null;};}function removeEntity(_0x1ab2b6,_0x587862){return function(_0x19e591){if(_0x19e591){return _0x19e591[_0xb453('0x2b')]()[_0xb453('0x2a')](function(){_0x1ab2b6[_0xb453('0x1f')](0xcc)[_0xb453('0x1e')]();});}};}function handleEntityNotFound(_0x45a745,_0x31592f){return function(_0x35293f){if(!_0x35293f){_0x45a745[_0xb453('0x2c')](0x194);}return _0x35293f;};}function handleError(_0x1e65cc,_0x3ecdf6){_0x3ecdf6=_0x3ecdf6||0x1f4;return function(_0x1b2585){logger[_0xb453('0x2d')](_0x1b2585['stack']);if(_0x1b2585[_0xb453('0x2e')]){delete _0x1b2585[_0xb453('0x2e')];}_0x1e65cc[_0xb453('0x1f')](_0x3ecdf6)[_0xb453('0x2f')](_0x1b2585);};}exports[_0xb453('0x30')]=function(_0x3587f9,_0x1a78d0){var _0x2ab342={},_0x1a6c72={},_0x479cc7={'count':0x0,'rows':[]};var _0x3e7418=_[_0xb453('0x31')](db[_0xb453('0x32')]['rawAttributes'],function(_0x4ae042){return{'name':_0x4ae042[_0xb453('0x33')],'type':_0x4ae042[_0xb453('0x34')][_0xb453('0x35')]};});_0x1a6c72[_0xb453('0x36')]=_['map'](_0x3e7418,'name');_0x1a6c72['query']=_[_0xb453('0x37')](_0x3587f9['query']);_0x1a6c72['filters']=_[_0xb453('0x38')](_0x1a6c72[_0xb453('0x36')],_0x1a6c72[_0xb453('0x39')]);_0x2ab342[_0xb453('0x3a')]=_[_0xb453('0x38')](_0x1a6c72[_0xb453('0x36')],qs[_0xb453('0x3b')](_0x3587f9[_0xb453('0x39')]['fields']));_0x2ab342['attributes']=_0x2ab342[_0xb453('0x3a')]['length']?_0x2ab342['attributes']:_0x1a6c72[_0xb453('0x36')];if(!_0x3587f9[_0xb453('0x39')]['hasOwnProperty'](_0xb453('0x3c'))){_0x2ab342[_0xb453('0x22')]=qs[_0xb453('0x22')](_0x3587f9[_0xb453('0x39')][_0xb453('0x22')]);_0x2ab342['offset']=qs['offset'](_0x3587f9['query'][_0xb453('0x20')]);}_0x2ab342[_0xb453('0x3d')]=qs[_0xb453('0x3e')](_0x3587f9['query'][_0xb453('0x3e')]);_0x2ab342['where']=qs[_0xb453('0x3f')](_['pick'](_0x3587f9[_0xb453('0x39')],_0x1a6c72[_0xb453('0x3f')]),_0x3e7418);if(_0x3587f9[_0xb453('0x39')][_0xb453('0x40')]){_0x2ab342[_0xb453('0x41')]=_[_0xb453('0x42')](_0x2ab342[_0xb453('0x41')],{'$or':_[_0xb453('0x31')](_0x3e7418,function(_0x17f851){if(_0x17f851[_0xb453('0x34')]!=='VIRTUAL'){var _0x5461e8={};_0x5461e8[_0x17f851[_0xb453('0x2e')]]={'$like':'%'+_0x3587f9[_0xb453('0x39')][_0xb453('0x40')]+'%'};return _0x5461e8;}})});}_0x2ab342=_[_0xb453('0x42')]({},_0x2ab342,_0x3587f9['options']);var _0x49a4f2={'where':_0x2ab342['where']};return db[_0xb453('0x32')][_0xb453('0x23')](_0x49a4f2)['then'](function(_0x562120){_0x479cc7[_0xb453('0x23')]=_0x562120;if(_0x3587f9[_0xb453('0x39')]['includeAll']){_0x2ab342[_0xb453('0x43')]=[{'all':!![]}];}return db[_0xb453('0x32')][_0xb453('0x44')](_0x2ab342);})[_0xb453('0x2a')](function(_0x45bba2){_0x479cc7[_0xb453('0x45')]=_0x45bba2;return _0x479cc7;})['then'](respondWithFilteredResult(_0x1a78d0,_0x2ab342))['catch'](handleError(_0x1a78d0,null));};exports[_0xb453('0x46')]=function(_0x19fb6e,_0x427408){var _0x3bab40={'raw':![],'where':{'id':_0x19fb6e[_0xb453('0x47')]['id']}},_0x12cd2c={};_0x12cd2c[_0xb453('0x36')]=_[_0xb453('0x37')](db[_0xb453('0x32')][_0xb453('0x48')]);_0x12cd2c[_0xb453('0x39')]=_[_0xb453('0x37')](_0x19fb6e[_0xb453('0x39')]);_0x12cd2c['filters']=_[_0xb453('0x38')](_0x12cd2c['model'],_0x12cd2c[_0xb453('0x39')]);_0x3bab40[_0xb453('0x3a')]=_[_0xb453('0x38')](_0x12cd2c[_0xb453('0x36')],qs[_0xb453('0x3b')](_0x19fb6e[_0xb453('0x39')][_0xb453('0x3b')]));_0x3bab40[_0xb453('0x3a')]=_0x3bab40['attributes'][_0xb453('0x49')]?_0x3bab40[_0xb453('0x3a')]:_0x12cd2c[_0xb453('0x36')];if(_0x19fb6e[_0xb453('0x39')][_0xb453('0x4a')]){_0x3bab40[_0xb453('0x43')]=[{'all':!![]}];}_0x3bab40=_[_0xb453('0x42')]({},_0x3bab40,_0x19fb6e[_0xb453('0x4b')]);return db[_0xb453('0x32')][_0xb453('0x4c')](_0x3bab40)['then'](handleEntityNotFound(_0x427408,null))[_0xb453('0x2a')](respondWithResult(_0x427408,null))[_0xb453('0x4d')](handleError(_0x427408,null));};exports['create']=function(_0x3351df,_0x9b93c6){return db[_0xb453('0x32')][_0xb453('0x4e')](_0x3351df[_0xb453('0x4f')],{})['then'](respondWithResult(_0x9b93c6,0xc9))[_0xb453('0x4d')](handleError(_0x9b93c6,null));};exports[_0xb453('0x29')]=function(_0x4c2a74,_0x24ba2c){if(_0x4c2a74['body']['id']){delete _0x4c2a74[_0xb453('0x4f')]['id'];}return db[_0xb453('0x32')]['find']({'where':{'id':_0x4c2a74[_0xb453('0x47')]['id']}})[_0xb453('0x2a')](handleEntityNotFound(_0x24ba2c,null))[_0xb453('0x2a')](saveUpdates(_0x4c2a74[_0xb453('0x4f')],null))['then'](respondWithResult(_0x24ba2c,null))['catch'](handleError(_0x24ba2c,null));};exports[_0xb453('0x2b')]=function(_0x5bc228,_0x54f917){return db[_0xb453('0x32')][_0xb453('0x4c')]({'where':{'id':_0x5bc228['params']['id']}})[_0xb453('0x2a')](handleEntityNotFound(_0x54f917,null))[_0xb453('0x2a')](removeEntity(_0x54f917,null))['catch'](handleError(_0x54f917,null));};exports[_0xb453('0x50')]=function(_0x5ae3ac,_0x5bbfb2,_0x4c8d84){var _0x40d172={};var _0x1bef48={};var _0x3abe00;var _0x5a534c;return db[_0xb453('0x32')]['findOne']({'where':{'id':_0x5ae3ac[_0xb453('0x47')]['id']}})[_0xb453('0x2a')](handleEntityNotFound(_0x5bbfb2,null))['then'](function(_0x255682){if(_0x255682){_0x3abe00=_0x255682;_0x1bef48['model']=_[_0xb453('0x37')](db[_0xb453('0x51')]['rawAttributes']);_0x1bef48[_0xb453('0x39')]=_[_0xb453('0x37')](_0x5ae3ac[_0xb453('0x39')]);_0x1bef48['filters']=_[_0xb453('0x38')](_0x1bef48['model'],_0x1bef48['query']);_0x40d172[_0xb453('0x3a')]=_[_0xb453('0x38')](_0x1bef48['model'],qs[_0xb453('0x3b')](_0x5ae3ac['query'][_0xb453('0x3b')]));_0x40d172[_0xb453('0x3a')]=_0x40d172[_0xb453('0x3a')][_0xb453('0x49')]?_0x40d172[_0xb453('0x3a')]:_0x1bef48[_0xb453('0x36')];_0x40d172['order']=qs['sort'](_0x5ae3ac[_0xb453('0x39')]['sort']);_0x40d172[_0xb453('0x41')]=qs['filters'](_[_0xb453('0x52')](_0x5ae3ac[_0xb453('0x39')],_0x1bef48['filters']));if(_0x5ae3ac['query'][_0xb453('0x40')]){_0x40d172[_0xb453('0x41')]=_[_0xb453('0x42')](_0x40d172[_0xb453('0x41')],{'$or':_[_0xb453('0x31')](_0x40d172[_0xb453('0x3a')],function(_0x4c1c66){var _0x54afbd={};_0x54afbd[_0x4c1c66]={'$like':'%'+_0x5ae3ac['query'][_0xb453('0x40')]+'%'};return _0x54afbd;})});}_0x40d172=_[_0xb453('0x42')]({},_0x40d172,_0x5ae3ac[_0xb453('0x4b')]);return _0x3abe00[_0xb453('0x50')](_0x40d172);}})[_0xb453('0x2a')](function(_0x56c1a7){if(_0x56c1a7){_0x5a534c=_0x56c1a7[_0xb453('0x49')];if(!_0x5ae3ac['query'][_0xb453('0x53')](_0xb453('0x3c'))){_0x40d172[_0xb453('0x22')]=qs[_0xb453('0x22')](_0x5ae3ac[_0xb453('0x39')][_0xb453('0x22')]);_0x40d172[_0xb453('0x20')]=qs['offset'](_0x5ae3ac['query'][_0xb453('0x20')]);}return _0x3abe00[_0xb453('0x50')](_0x40d172);}})[_0xb453('0x2a')](function(_0x186162){if(_0x186162){return _0x186162?{'count':_0x5a534c,'rows':_0x186162}:null;}})[_0xb453('0x2a')](respondWithResult(_0x5bbfb2,null))[_0xb453('0x4d')](handleError(_0x5bbfb2,null));};exports[_0xb453('0x54')]=function(_0x3c949d,_0x16736a,_0x1b31f5){if(_0x3c949d[_0xb453('0x4f')]['id']){delete _0x3c949d[_0xb453('0x4f')]['id'];}return db[_0xb453('0x32')]['findOne']({'where':{'id':_0x3c949d[_0xb453('0x47')]['id']}})[_0xb453('0x2a')](handleEntityNotFound(_0x16736a,null))[_0xb453('0x2a')](function(_0x189f97){if(_0x189f97){_0x3c949d[_0xb453('0x4f')][_0xb453('0x55')]=_0x189f97['id'];_0x3c949d['body'][_0xb453('0x56')]=integrations['getSubjects'](_0x3c949d[_0xb453('0x4f')][_0xb453('0x57')],_0x3c949d[_0xb453('0x4f')][_0xb453('0x34')]);_0x3c949d['body'][_0xb453('0x58')]=integrations[_0xb453('0x59')](_0x3c949d[_0xb453('0x4f')][_0xb453('0x57')],_0x3c949d[_0xb453('0x4f')][_0xb453('0x34')]);return db[_0xb453('0x51')][_0xb453('0x4e')](_0x3c949d[_0xb453('0x4f')],{'include':[{'model':db[_0xb453('0x5a')],'as':'Subjects'},{'model':db[_0xb453('0x5a')],'as':_0xb453('0x58')}]});}return null;})[_0xb453('0x2a')](respondWithResult(_0x16736a,null))[_0xb453('0x4d')](handleError(_0x16736a,null));};exports[_0xb453('0x5b')]=function(_0x32b057,_0x51d528,_0x895e4e){var _0x3e466a='';return db[_0xb453('0x32')][_0xb453('0x5c')]({'where':{'id':_0x32b057[_0xb453('0x47')]['id']},'attributes':['id',_0xb453('0x5d'),_0xb453('0x5e')]})[_0xb453('0x2a')](handleEntityNotFound(_0x51d528,null))[_0xb453('0x2a')](function(_0x343692){if(_0x343692){_0x3e466a=_0x343692['remoteUri'];var _0x432385=_0x3e466a[_0xb453('0x5f')](-0x1);if(_0x432385==='/'){_0x3e466a=_0x3e466a[_0xb453('0x60')](0x0,_0x3e466a[_0xb453('0x61')](_0x432385));}return rp({'method':_0xb453('0x62'),'uri':util[_0xb453('0x63')](_0xb453('0x64'),_0x3e466a,_0xb453('0x65')),'headers':{'Authorization':util[_0xb453('0x63')](_0xb453('0x66'),new Buffer(util[_0xb453('0x63')](_0xb453('0x67'),_0x343692[_0xb453('0x5e')]))[_0xb453('0x68')](_0xb453('0x69')))},'json':!![]});}})[_0xb453('0x2a')](function(_0x4f32ff){if(_0x4f32ff){var _0x296325=[_0xb453('0x6a'),_0xb453('0x6b'),'agent',_0xb453('0x6c'),_0xb453('0x1f'),_0xb453('0x6d'),'group',_0xb453('0x6e'),'ticket_type',_0xb453('0x6f'),_0xb453('0x70')];_[_0xb453('0x71')](_0x4f32ff,function(_0x1fe938){return _0x296325[_0xb453('0x72')](_0x1fe938['name'])||!_0x1fe938[_0xb453('0x73')]&&_0x1fe938[_0xb453('0x34')]!=='custom_text'&&_0x1fe938[_0xb453('0x34')]!==_0xb453('0x74');});return{'count':_0x4f32ff['length'],'rows':_[_0xb453('0x31')](_0x4f32ff,function(_0x5681ed){return{'id':_0x5681ed['name'],'name':_0x5681ed[_0xb453('0x75')],'custom':!_0x5681ed[_0xb453('0x73')],'options':_0x5681ed[_0xb453('0x76')]?_['map'](_0x5681ed[_0xb453('0x76')],function(_0x59d753){return{'name':_[_0xb453('0x77')](_0x59d753),'value':_0x59d753};}):[]};})};}})[_0xb453('0x2a')](respondWithResult(_0x51d528,null))[_0xb453('0x4d')](function(_0x5f3244){var _0x143ccf=_0x32b057[_0xb453('0x39')][_0xb453('0x78')]?0x1f4:_0x5f3244['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xb453('0x5b'),_0x143ccf,JSON[_0xb453('0x79')](_0x5f3244));delete _0x5f3244[_0xb453('0x2e')];if(_0x143ccf===0x191){_0x143ccf=0x190;}_0x51d528[_0xb453('0x1f')](_0x143ccf)['send'](_0x32b057[_0xb453('0x39')][_0xb453('0x78')]?{'message':_0xb453('0x7a'),'statusCode':_0x5f3244[_0xb453('0x7b')]}:_0x5f3244);});};
\ No newline at end of file
+var _0x89e8=['test','stringify','send','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','index','rawAttributes','fieldName','type','map','name','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','FreshdeskAccount','include','findAll','show','params','catch','create','body','find','destroy','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','slice','substring','lastIndexOf','GET','api/v2/ticket_fields','format','Basic\x20%s','apiKey','agent','priority','source','ticket_type','group','company','remove','includes','custom_text','label','default','choices','capitalize'];(function(_0x31461b,_0x13123a){var _0x18fbd7=function(_0x337fd6){while(--_0x337fd6){_0x31461b['push'](_0x31461b['shift']());}};_0x18fbd7(++_0x13123a);}(_0x89e8,0x74));var _0x889e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x89e8[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x889e('0x0'));var rimraf=require(_0x889e('0x1'));var zipdir=require(_0x889e('0x2'));var jsonpatch=require(_0x889e('0x3'));var rp=require(_0x889e('0x4'));var moment=require(_0x889e('0x5'));var BPromise=require(_0x889e('0x6'));var Mustache=require(_0x889e('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x889e('0x8'));var ejs=require(_0x889e('0x9'));var fs=require('fs');var fs_extra=require(_0x889e('0xa'));var _=require('lodash');var squel=require(_0x889e('0xb'));var crypto=require('crypto');var jsforce=require(_0x889e('0xc'));var deskjs=require(_0x889e('0xd'));var toCsv=require(_0x889e('0x8'));var querystring=require('querystring');var Papa=require(_0x889e('0xe'));var Redis=require(_0x889e('0xf'));var authService=require(_0x889e('0x10'));var qs=require(_0x889e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x889e('0x12'));var logger=require(_0x889e('0x13'))('api');var utils=require(_0x889e('0x14'));var config=require(_0x889e('0x15'));var licenseUtil=require(_0x889e('0x16'));var db=require(_0x889e('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e20e3,_0x399161){_0x399161=_0x399161||0xcc;return function(_0x121e9e){if(_0x121e9e){return _0x3e20e3['sendStatus'](_0x399161);}return _0x3e20e3[_0x889e('0x18')](_0x399161)[_0x889e('0x19')]();};}function respondWithResult(_0x2b69db,_0xe9a1b9){_0xe9a1b9=_0xe9a1b9||0xc8;return function(_0x35e849){if(_0x35e849){return _0x2b69db['status'](_0xe9a1b9)['json'](_0x35e849);}};}function respondWithFilteredResult(_0x300ce7,_0x15cf93){return function(_0x335f98){if(_0x335f98){var _0x2de143=typeof _0x15cf93['offset']===_0x889e('0x1a')&&typeof _0x15cf93[_0x889e('0x1b')]==='undefined';var _0xf45988=_0x335f98['count'];var _0x75e219=_0x2de143?0x0:_0x15cf93[_0x889e('0x1c')];var _0x232452=_0x2de143?_0x335f98[_0x889e('0x1d')]:_0x15cf93[_0x889e('0x1c')]+_0x15cf93['limit'];var _0xa1b610;if(_0x232452>=_0xf45988){_0x232452=_0xf45988;_0xa1b610=0xc8;}else{_0xa1b610=0xce;}_0x300ce7[_0x889e('0x18')](_0xa1b610);return _0x300ce7['set'](_0x889e('0x1e'),_0x75e219+'-'+_0x232452+'/'+_0xf45988)[_0x889e('0x1f')](_0x335f98);}return null;};}function patchUpdates(_0x1db0db){return function(_0x552a11){try{jsonpatch[_0x889e('0x20')](_0x552a11,_0x1db0db,!![]);}catch(_0x2ff8ae){return BPromise[_0x889e('0x21')](_0x2ff8ae);}return _0x552a11[_0x889e('0x22')]();};}function saveUpdates(_0x590b6f,_0x539ed4){return function(_0x352256){if(_0x352256){return _0x352256[_0x889e('0x23')](_0x590b6f)[_0x889e('0x24')](function(_0x4bb8e1){return _0x4bb8e1;});}return null;};}function removeEntity(_0x956dae,_0x309e91){return function(_0x3cfb58){if(_0x3cfb58){return _0x3cfb58['destroy']()[_0x889e('0x24')](function(){_0x956dae['status'](0xcc)[_0x889e('0x19')]();});}};}function handleEntityNotFound(_0x331665,_0x2fc97a){return function(_0x4d0492){if(!_0x4d0492){_0x331665[_0x889e('0x25')](0x194);}return _0x4d0492;};}function handleError(_0x5aa515,_0x34db77){_0x34db77=_0x34db77||0x1f4;return function(_0x2fb8d9){logger[_0x889e('0x26')](_0x2fb8d9[_0x889e('0x27')]);if(_0x2fb8d9['name']){delete _0x2fb8d9['name'];}_0x5aa515[_0x889e('0x18')](_0x34db77)['send'](_0x2fb8d9);};}exports[_0x889e('0x28')]=function(_0x343c01,_0x3b3aad){var _0x9e8192={},_0x2553ff={},_0x484629={'count':0x0,'rows':[]};var _0x5c3da2=_['map'](db['FreshdeskAccount'][_0x889e('0x29')],function(_0x1cb4ed){return{'name':_0x1cb4ed[_0x889e('0x2a')],'type':_0x1cb4ed[_0x889e('0x2b')]['key']};});_0x2553ff['model']=_[_0x889e('0x2c')](_0x5c3da2,_0x889e('0x2d'));_0x2553ff[_0x889e('0x2e')]=_[_0x889e('0x2f')](_0x343c01[_0x889e('0x2e')]);_0x2553ff[_0x889e('0x30')]=_[_0x889e('0x31')](_0x2553ff['model'],_0x2553ff[_0x889e('0x2e')]);_0x9e8192['attributes']=_['intersection'](_0x2553ff[_0x889e('0x32')],qs[_0x889e('0x33')](_0x343c01[_0x889e('0x2e')]['fields']));_0x9e8192[_0x889e('0x34')]=_0x9e8192['attributes'][_0x889e('0x35')]?_0x9e8192[_0x889e('0x34')]:_0x2553ff[_0x889e('0x32')];if(!_0x343c01[_0x889e('0x2e')][_0x889e('0x36')](_0x889e('0x37'))){_0x9e8192[_0x889e('0x1b')]=qs['limit'](_0x343c01[_0x889e('0x2e')]['limit']);_0x9e8192[_0x889e('0x1c')]=qs['offset'](_0x343c01[_0x889e('0x2e')][_0x889e('0x1c')]);}_0x9e8192[_0x889e('0x38')]=qs[_0x889e('0x39')](_0x343c01[_0x889e('0x2e')][_0x889e('0x39')]);_0x9e8192['where']=qs[_0x889e('0x30')](_[_0x889e('0x3a')](_0x343c01[_0x889e('0x2e')],_0x2553ff[_0x889e('0x30')]),_0x5c3da2);if(_0x343c01[_0x889e('0x2e')][_0x889e('0x3b')]){_0x9e8192[_0x889e('0x3c')]=_[_0x889e('0x3d')](_0x9e8192[_0x889e('0x3c')],{'$or':_[_0x889e('0x2c')](_0x5c3da2,function(_0x27e2b9){if(_0x27e2b9[_0x889e('0x2b')]!=='VIRTUAL'){var _0x51f3a8={};_0x51f3a8[_0x27e2b9[_0x889e('0x2d')]]={'$like':'%'+_0x343c01[_0x889e('0x2e')][_0x889e('0x3b')]+'%'};return _0x51f3a8;}})});}_0x9e8192=_['merge']({},_0x9e8192,_0x343c01[_0x889e('0x3e')]);var _0x27757d={'where':_0x9e8192[_0x889e('0x3c')]};return db[_0x889e('0x3f')][_0x889e('0x1d')](_0x27757d)[_0x889e('0x24')](function(_0x5ee0e8){_0x484629[_0x889e('0x1d')]=_0x5ee0e8;if(_0x343c01['query']['includeAll']){_0x9e8192[_0x889e('0x40')]=[{'all':!![]}];}return db[_0x889e('0x3f')][_0x889e('0x41')](_0x9e8192);})[_0x889e('0x24')](function(_0x4d35d0){_0x484629['rows']=_0x4d35d0;return _0x484629;})[_0x889e('0x24')](respondWithFilteredResult(_0x3b3aad,_0x9e8192))['catch'](handleError(_0x3b3aad,null));};exports[_0x889e('0x42')]=function(_0x330ecd,_0x5c7205){var _0x4b89dc={'raw':![],'where':{'id':_0x330ecd[_0x889e('0x43')]['id']}},_0x18b45b={};_0x18b45b['model']=_[_0x889e('0x2f')](db['FreshdeskAccount'][_0x889e('0x29')]);_0x18b45b[_0x889e('0x2e')]=_[_0x889e('0x2f')](_0x330ecd[_0x889e('0x2e')]);_0x18b45b[_0x889e('0x30')]=_[_0x889e('0x31')](_0x18b45b[_0x889e('0x32')],_0x18b45b[_0x889e('0x2e')]);_0x4b89dc[_0x889e('0x34')]=_[_0x889e('0x31')](_0x18b45b[_0x889e('0x32')],qs[_0x889e('0x33')](_0x330ecd['query'][_0x889e('0x33')]));_0x4b89dc[_0x889e('0x34')]=_0x4b89dc[_0x889e('0x34')][_0x889e('0x35')]?_0x4b89dc['attributes']:_0x18b45b[_0x889e('0x32')];if(_0x330ecd[_0x889e('0x2e')]['includeAll']){_0x4b89dc[_0x889e('0x40')]=[{'all':!![]}];}_0x4b89dc=_[_0x889e('0x3d')]({},_0x4b89dc,_0x330ecd['options']);return db['FreshdeskAccount']['find'](_0x4b89dc)[_0x889e('0x24')](handleEntityNotFound(_0x5c7205,null))['then'](respondWithResult(_0x5c7205,null))[_0x889e('0x44')](handleError(_0x5c7205,null));};exports[_0x889e('0x45')]=function(_0x7bd28c,_0x630b2b){return db[_0x889e('0x3f')]['create'](_0x7bd28c[_0x889e('0x46')],{})[_0x889e('0x24')](respondWithResult(_0x630b2b,0xc9))[_0x889e('0x44')](handleError(_0x630b2b,null));};exports[_0x889e('0x23')]=function(_0x29f072,_0x28b3ce){if(_0x29f072['body']['id']){delete _0x29f072['body']['id'];}return db[_0x889e('0x3f')][_0x889e('0x47')]({'where':{'id':_0x29f072[_0x889e('0x43')]['id']}})['then'](handleEntityNotFound(_0x28b3ce,null))[_0x889e('0x24')](saveUpdates(_0x29f072[_0x889e('0x46')],null))[_0x889e('0x24')](respondWithResult(_0x28b3ce,null))[_0x889e('0x44')](handleError(_0x28b3ce,null));};exports[_0x889e('0x48')]=function(_0x25337b,_0x1f54e9){return db[_0x889e('0x3f')][_0x889e('0x47')]({'where':{'id':_0x25337b[_0x889e('0x43')]['id']}})[_0x889e('0x24')](handleEntityNotFound(_0x1f54e9,null))[_0x889e('0x24')](removeEntity(_0x1f54e9,null))[_0x889e('0x44')](handleError(_0x1f54e9,null));};exports[_0x889e('0x49')]=function(_0x2ecf81,_0x32ad34,_0x255840){var _0x48eb4a={};var _0x5de5f7={};var _0x4d41ac;var _0x419cac;return db['FreshdeskAccount'][_0x889e('0x4a')]({'where':{'id':_0x2ecf81[_0x889e('0x43')]['id']}})[_0x889e('0x24')](handleEntityNotFound(_0x32ad34,null))[_0x889e('0x24')](function(_0x5edd19){if(_0x5edd19){_0x4d41ac=_0x5edd19;_0x5de5f7[_0x889e('0x32')]=_['keys'](db[_0x889e('0x4b')][_0x889e('0x29')]);_0x5de5f7[_0x889e('0x2e')]=_[_0x889e('0x2f')](_0x2ecf81['query']);_0x5de5f7[_0x889e('0x30')]=_['intersection'](_0x5de5f7[_0x889e('0x32')],_0x5de5f7[_0x889e('0x2e')]);_0x48eb4a[_0x889e('0x34')]=_['intersection'](_0x5de5f7['model'],qs[_0x889e('0x33')](_0x2ecf81[_0x889e('0x2e')][_0x889e('0x33')]));_0x48eb4a['attributes']=_0x48eb4a[_0x889e('0x34')][_0x889e('0x35')]?_0x48eb4a['attributes']:_0x5de5f7['model'];_0x48eb4a[_0x889e('0x38')]=qs[_0x889e('0x39')](_0x2ecf81[_0x889e('0x2e')]['sort']);_0x48eb4a[_0x889e('0x3c')]=qs[_0x889e('0x30')](_['pick'](_0x2ecf81['query'],_0x5de5f7[_0x889e('0x30')]));if(_0x2ecf81[_0x889e('0x2e')][_0x889e('0x3b')]){_0x48eb4a[_0x889e('0x3c')]=_[_0x889e('0x3d')](_0x48eb4a[_0x889e('0x3c')],{'$or':_[_0x889e('0x2c')](_0x48eb4a[_0x889e('0x34')],function(_0x197de){var _0x298556={};_0x298556[_0x197de]={'$like':'%'+_0x2ecf81[_0x889e('0x2e')][_0x889e('0x3b')]+'%'};return _0x298556;})});}_0x48eb4a=_[_0x889e('0x3d')]({},_0x48eb4a,_0x2ecf81[_0x889e('0x3e')]);return _0x4d41ac['getConfigurations'](_0x48eb4a);}})['then'](function(_0xc93d27){if(_0xc93d27){_0x419cac=_0xc93d27['length'];if(!_0x2ecf81[_0x889e('0x2e')][_0x889e('0x36')](_0x889e('0x37'))){_0x48eb4a['limit']=qs['limit'](_0x2ecf81[_0x889e('0x2e')][_0x889e('0x1b')]);_0x48eb4a[_0x889e('0x1c')]=qs[_0x889e('0x1c')](_0x2ecf81[_0x889e('0x2e')][_0x889e('0x1c')]);}return _0x4d41ac[_0x889e('0x49')](_0x48eb4a);}})[_0x889e('0x24')](function(_0x51ddc2){if(_0x51ddc2){return _0x51ddc2?{'count':_0x419cac,'rows':_0x51ddc2}:null;}})[_0x889e('0x24')](respondWithResult(_0x32ad34,null))['catch'](handleError(_0x32ad34,null));};exports[_0x889e('0x4c')]=function(_0x143cae,_0x21fb4a,_0x94c01f){if(_0x143cae[_0x889e('0x46')]['id']){delete _0x143cae['body']['id'];}return db[_0x889e('0x3f')]['findOne']({'where':{'id':_0x143cae[_0x889e('0x43')]['id']}})[_0x889e('0x24')](handleEntityNotFound(_0x21fb4a,null))['then'](function(_0x181639){if(_0x181639){_0x143cae[_0x889e('0x46')][_0x889e('0x4d')]=_0x181639['id'];_0x143cae[_0x889e('0x46')][_0x889e('0x4e')]=integrations['getSubjects'](_0x143cae[_0x889e('0x46')][_0x889e('0x4f')],_0x143cae['body'][_0x889e('0x2b')]);_0x143cae[_0x889e('0x46')]['Descriptions']=integrations[_0x889e('0x50')](_0x143cae[_0x889e('0x46')]['channel'],_0x143cae[_0x889e('0x46')]['type']);return db['FreshdeskConfiguration'][_0x889e('0x45')](_0x143cae['body'],{'include':[{'model':db[_0x889e('0x51')],'as':_0x889e('0x4e')},{'model':db[_0x889e('0x51')],'as':_0x889e('0x52')}]});}return null;})[_0x889e('0x24')](respondWithResult(_0x21fb4a,null))['catch'](handleError(_0x21fb4a,null));};exports[_0x889e('0x53')]=function(_0x48b8f8,_0xb80bd2,_0x22fddf){var _0x3295ee='';return db[_0x889e('0x3f')][_0x889e('0x4a')]({'where':{'id':_0x48b8f8[_0x889e('0x43')]['id']},'attributes':['id',_0x889e('0x54'),'apiKey']})[_0x889e('0x24')](handleEntityNotFound(_0xb80bd2,null))[_0x889e('0x24')](function(_0x3f6507){if(_0x3f6507){_0x3295ee=_0x3f6507[_0x889e('0x54')];var _0x438067=_0x3295ee[_0x889e('0x55')](-0x1);if(_0x438067==='/'){_0x3295ee=_0x3295ee[_0x889e('0x56')](0x0,_0x3295ee[_0x889e('0x57')](_0x438067));}return rp({'method':_0x889e('0x58'),'uri':util['format']('%s/%s',_0x3295ee,_0x889e('0x59')),'headers':{'Authorization':util[_0x889e('0x5a')](_0x889e('0x5b'),new Buffer(util[_0x889e('0x5a')]('%s:X',_0x3f6507[_0x889e('0x5c')]))['toString']('base64'))},'json':!![]});}})[_0x889e('0x24')](function(_0xbb094f){if(_0xbb094f){var _0x5b095e=['requester','subject',_0x889e('0x5d'),'description',_0x889e('0x18'),_0x889e('0x5e'),'group',_0x889e('0x5f'),_0x889e('0x60'),_0x889e('0x61'),_0x889e('0x62')];_[_0x889e('0x63')](_0xbb094f,function(_0x53cf2e){return _0x5b095e[_0x889e('0x64')](_0x53cf2e[_0x889e('0x2d')])||!_0x53cf2e['default']&&_0x53cf2e['type']!==_0x889e('0x65')&&_0x53cf2e['type']!=='custom_dropdown';});return{'count':_0xbb094f[_0x889e('0x35')],'rows':_[_0x889e('0x2c')](_0xbb094f,function(_0x4f43fb){return{'id':_0x4f43fb[_0x889e('0x2d')],'name':_0x4f43fb[_0x889e('0x66')],'custom':!_0x4f43fb[_0x889e('0x67')],'options':_0x4f43fb[_0x889e('0x68')]?_[_0x889e('0x2c')](_0x4f43fb[_0x889e('0x68')],function(_0x44e18a){return{'name':_[_0x889e('0x69')](_0x44e18a),'value':_0x44e18a};}):[]};})};}})[_0x889e('0x24')](respondWithResult(_0xb80bd2,null))[_0x889e('0x44')](function(_0x5c8864){var _0x948512=_0x48b8f8['query'][_0x889e('0x6a')]?0x1f4:_0x5c8864['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x889e('0x53'),_0x948512,JSON[_0x889e('0x6b')](_0x5c8864));delete _0x5c8864[_0x889e('0x2d')];if(_0x948512===0x191){_0x948512=0x190;}_0xb80bd2[_0x889e('0x18')](_0x948512)[_0x889e('0x6c')](_0x48b8f8[_0x889e('0x2e')]['test']?{'message':_0x889e('0x6d'),'statusCode':_0x5c8864[_0x889e('0x6e')]}:_0x5c8864);});};
\ No newline at end of file
index 6feb7af..ab59cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x011f=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x2187db,_0x13e02a){var _0x5787d1=function(_0x6cf144){while(--_0x6cf144){_0x2187db['push'](_0x2187db['shift']());}};_0x5787d1(++_0x13e02a);}(_0x011f,0x1bd));var _0xf011=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x011f[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xf011('0x0'));var util=require(_0xf011('0x1'));var logger=require('../../config/logger')(_0xf011('0x2'));var moment=require(_0xf011('0x3'));var BPromise=require('bluebird');var rp=require(_0xf011('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf011('0x5'));var config=require(_0xf011('0x6'));var attributes=require(_0xf011('0x7'));var integrations=require(_0xf011('0x8'));module[_0xf011('0x9')]=function(_0x5f2170,_0xadbc6b){return _0x5f2170[_0xf011('0xa')](_0xf011('0xb'),attributes,{'tableName':_0xf011('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa18=['../../components/integrations/configuration','exports','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xaa18,0x84));var _0x8aa1=function(_0xb2fb62,_0x7dbaeb){_0xb2fb62=_0xb2fb62-0x0;var _0x11e829=_0xaa18[_0xb2fb62];return _0x11e829;};'use strict';var _=require('lodash');var util=require(_0x8aa1('0x0'));var logger=require(_0x8aa1('0x1'))(_0x8aa1('0x2'));var moment=require(_0x8aa1('0x3'));var BPromise=require(_0x8aa1('0x4'));var rp=require(_0x8aa1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8aa1('0x6'));var attributes=require(_0x8aa1('0x7'));var integrations=require(_0x8aa1('0x8'));module[_0x8aa1('0x9')]=function(_0x3d3d33,_0x236b7a){return _0x3d3d33['define']('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 445eb4b..6cf839b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0ab=['jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1a82e1,_0x122206){var _0xee2299=function(_0x1e1ffd){while(--_0x1e1ffd){_0x1a82e1['push'](_0x1a82e1['shift']());}};_0xee2299(++_0x122206);}(_0xc0ab,0x179));var _0xbc0a=function(_0x470651,_0x2774a5){_0x470651=_0x470651-0x0;var _0x4c3597=_0xc0ab[_0x470651];return _0x4c3597;};'use strict';var _=require(_0xbc0a('0x0'));var util=require(_0xbc0a('0x1'));var moment=require(_0xbc0a('0x2'));var BPromise=require(_0xbc0a('0x3'));var rs=require(_0xbc0a('0x4'));var fs=require('fs');var Redis=require(_0xbc0a('0x5'));var db=require(_0xbc0a('0x6'))['db'];var utils=require(_0xbc0a('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbc0a('0x8'));var client=jayson['client'][_0xbc0a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d8704,_0x119fd1,_0x78f50){return new BPromise(function(_0x2d49ae,_0x18d80b){return client[_0xbc0a('0xa')](_0x2d8704,_0x78f50)[_0xbc0a('0xb')](function(_0x4cc90f){logger[_0xbc0a('0xc')](_0xbc0a('0xd'),_0x119fd1,_0xbc0a('0xe'));logger[_0xbc0a('0xf')](_0xbc0a('0x10'),_0x119fd1,_0xbc0a('0xe'),JSON[_0xbc0a('0x11')](_0x4cc90f));if(_0x4cc90f['error']){if(_0x4cc90f[_0xbc0a('0x12')][_0xbc0a('0x13')]===0x1f4){logger['error'](_0xbc0a('0xd'),_0x119fd1,_0x4cc90f[_0xbc0a('0x12')][_0xbc0a('0x14')]);return _0x18d80b(_0x4cc90f[_0xbc0a('0x12')][_0xbc0a('0x14')]);}logger[_0xbc0a('0x12')](_0xbc0a('0xd'),_0x119fd1,_0x4cc90f[_0xbc0a('0x12')]['message']);return _0x2d49ae(_0x4cc90f['error']['message']);}else{logger[_0xbc0a('0xc')](_0xbc0a('0xd'),_0x119fd1,'request\x20sent');_0x2d49ae(_0x4cc90f['result'][_0xbc0a('0x14')]);}})[_0xbc0a('0x15')](function(_0x50020d){logger[_0xbc0a('0x12')](_0xbc0a('0xd'),_0x119fd1,_0x50020d);_0x18d80b(_0x50020d);});});}exports[_0xbc0a('0x16')]=function(_0x145084){var _0x35f7c5=this;return new Promise(function(_0x13bbcd,_0x446d37){return db[_0xbc0a('0x17')][_0xbc0a('0x18')]({'raw':_0x145084[_0xbc0a('0x19')]?_0x145084[_0xbc0a('0x19')][_0xbc0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x145084[_0xbc0a('0x19')]?_0x145084[_0xbc0a('0x19')][_0xbc0a('0x1b')]||null:null,'attributes':_0x145084['options']?_0x145084['options'][_0xbc0a('0x1c')]||null:null,'limit':_0x145084[_0xbc0a('0x19')]?_0x145084[_0xbc0a('0x19')][_0xbc0a('0x1d')]||null:null,'include':_0x145084[_0xbc0a('0x19')]?_0x145084[_0xbc0a('0x19')][_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x145084[_0xbc0a('0x19')][_0xbc0a('0x1e')],function(_0x439f99){return{'model':db[_0x439f99[_0xbc0a('0x20')]],'as':_0x439f99['as'],'attributes':_0x439f99[_0xbc0a('0x1c')],'include':_0x439f99[_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x439f99['include'],function(_0x12cdb4){return{'model':db[_0x12cdb4[_0xbc0a('0x20')]],'as':_0x12cdb4['as'],'attributes':_0x12cdb4[_0xbc0a('0x1c')],'include':_0x12cdb4[_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x12cdb4[_0xbc0a('0x1e')],function(_0x4b8018){return{'model':db[_0x4b8018[_0xbc0a('0x20')]],'as':_0x4b8018['as'],'attributes':_0x4b8018[_0xbc0a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbc0a('0xb')](function(_0xdabfc5){logger['info']('GetFreshdeskAccount',_0x145084);logger[_0xbc0a('0xf')](_0xbc0a('0x16'),_0x145084,JSON[_0xbc0a('0x11')](_0xdabfc5));_0x13bbcd(_0xdabfc5);})[_0xbc0a('0x15')](function(_0x13e4cf){logger[_0xbc0a('0x12')](_0xbc0a('0x16'),_0x13e4cf[_0xbc0a('0x14')],_0x145084);_0x446d37(_0x35f7c5['error'](0x1f4,_0x13e4cf[_0xbc0a('0x14')]));});});};exports[_0xbc0a('0x21')]=function(_0x46823b){var _0x5e64a1=this;return new Promise(function(_0x3246ea,_0x2a4b24){return db[_0xbc0a('0x17')][_0xbc0a('0x22')]({'raw':_0x46823b[_0xbc0a('0x19')]?_0x46823b[_0xbc0a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x46823b['options']?_0x46823b[_0xbc0a('0x19')]['where']||null:null,'attributes':_0x46823b[_0xbc0a('0x19')]?_0x46823b[_0xbc0a('0x19')][_0xbc0a('0x1c')]||null:null,'include':_0x46823b[_0xbc0a('0x19')]?_0x46823b[_0xbc0a('0x19')][_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x46823b['options']['include'],function(_0x1db67f){return{'model':db[_0x1db67f[_0xbc0a('0x20')]],'as':_0x1db67f['as'],'attributes':_0x1db67f[_0xbc0a('0x1c')],'include':_0x1db67f[_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x1db67f[_0xbc0a('0x1e')],function(_0x504708){return{'model':db[_0x504708[_0xbc0a('0x20')]],'as':_0x504708['as'],'attributes':_0x504708['attributes'],'include':_0x504708[_0xbc0a('0x1e')]?_[_0xbc0a('0x1f')](_0x504708[_0xbc0a('0x1e')],function(_0x26373c){return{'model':db[_0x26373c['model']],'as':_0x26373c['as'],'attributes':_0x26373c[_0xbc0a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbc0a('0xb')](function(_0x4f57fe){logger[_0xbc0a('0xc')](_0xbc0a('0x21'),_0x46823b);logger['debug']('ShowFreshdeskAccount',_0x46823b,JSON['stringify'](_0x4f57fe));_0x3246ea(_0x4f57fe);})[_0xbc0a('0x15')](function(_0x234844){logger[_0xbc0a('0x12')](_0xbc0a('0x21'),_0x234844[_0xbc0a('0x14')],_0x46823b);_0x2a4b24(_0x5e64a1[_0xbc0a('0x12')](0x1f4,_0x234844[_0xbc0a('0x14')]));});});};
\ No newline at end of file
+var _0xa562=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','FreshdeskAccount','findAll','options','raw','where','limit','include','model','map','attributes','GetFreshdeskAccount','debug','ShowFreshdeskAccount','lodash','util','moment','bluebird'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa562,0x1a9));var _0x2a56=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0xa562[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0x2a56('0x0'));var util=require(_0x2a56('0x1'));var moment=require(_0x2a56('0x2'));var BPromise=require(_0x2a56('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2a56('0x4'));var logger=require(_0x2a56('0x5'))(_0x2a56('0x6'));var config=require(_0x2a56('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2a56('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13e48c,_0x4acec1,_0x690063){return new BPromise(function(_0x34f1ee,_0x36c1e7){return client[_0x2a56('0x9')](_0x13e48c,_0x690063)[_0x2a56('0xa')](function(_0x392ab4){logger['info'](_0x2a56('0xb'),_0x4acec1,_0x2a56('0xc'));logger['debug'](_0x2a56('0xd'),_0x4acec1,_0x2a56('0xc'),JSON[_0x2a56('0xe')](_0x392ab4));if(_0x392ab4[_0x2a56('0xf')]){if(_0x392ab4[_0x2a56('0xf')]['code']===0x1f4){logger[_0x2a56('0xf')](_0x2a56('0xb'),_0x4acec1,_0x392ab4[_0x2a56('0xf')][_0x2a56('0x10')]);return _0x36c1e7(_0x392ab4[_0x2a56('0xf')][_0x2a56('0x10')]);}logger[_0x2a56('0xf')](_0x2a56('0xb'),_0x4acec1,_0x392ab4[_0x2a56('0xf')]['message']);return _0x34f1ee(_0x392ab4['error']['message']);}else{logger[_0x2a56('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x4acec1,_0x2a56('0xc'));_0x34f1ee(_0x392ab4[_0x2a56('0x12')][_0x2a56('0x10')]);}})[_0x2a56('0x13')](function(_0x2cd42b){logger[_0x2a56('0xf')](_0x2a56('0xb'),_0x4acec1,_0x2cd42b);_0x36c1e7(_0x2cd42b);});});}exports['GetFreshdeskAccount']=function(_0x5fadee){var _0x37854e=this;return new Promise(function(_0x37cf22,_0x172294){return db[_0x2a56('0x14')][_0x2a56('0x15')]({'raw':_0x5fadee[_0x2a56('0x16')]?_0x5fadee[_0x2a56('0x16')][_0x2a56('0x17')]===undefined?!![]:![]:!![],'where':_0x5fadee['options']?_0x5fadee[_0x2a56('0x16')][_0x2a56('0x18')]||null:null,'attributes':_0x5fadee[_0x2a56('0x16')]?_0x5fadee['options']['attributes']||null:null,'limit':_0x5fadee['options']?_0x5fadee[_0x2a56('0x16')][_0x2a56('0x19')]||null:null,'include':_0x5fadee[_0x2a56('0x16')]?_0x5fadee['options'][_0x2a56('0x1a')]?_['map'](_0x5fadee['options'][_0x2a56('0x1a')],function(_0x33e253){return{'model':db[_0x33e253[_0x2a56('0x1b')]],'as':_0x33e253['as'],'attributes':_0x33e253['attributes'],'include':_0x33e253[_0x2a56('0x1a')]?_[_0x2a56('0x1c')](_0x33e253[_0x2a56('0x1a')],function(_0x408746){return{'model':db[_0x408746[_0x2a56('0x1b')]],'as':_0x408746['as'],'attributes':_0x408746[_0x2a56('0x1d')],'include':_0x408746['include']?_[_0x2a56('0x1c')](_0x408746[_0x2a56('0x1a')],function(_0x1720de){return{'model':db[_0x1720de[_0x2a56('0x1b')]],'as':_0x1720de['as'],'attributes':_0x1720de[_0x2a56('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ed24d){logger['info'](_0x2a56('0x1e'),_0x5fadee);logger['debug'](_0x2a56('0x1e'),_0x5fadee,JSON['stringify'](_0x1ed24d));_0x37cf22(_0x1ed24d);})['catch'](function(_0x1d2d26){logger['error'](_0x2a56('0x1e'),_0x1d2d26['message'],_0x5fadee);_0x172294(_0x37854e[_0x2a56('0xf')](0x1f4,_0x1d2d26[_0x2a56('0x10')]));});});};exports['ShowFreshdeskAccount']=function(_0x56dd59){var _0x55a6e4=this;return new Promise(function(_0x57823b,_0x2ae1cc){return db[_0x2a56('0x14')]['find']({'raw':_0x56dd59[_0x2a56('0x16')]?_0x56dd59[_0x2a56('0x16')][_0x2a56('0x17')]===undefined?!![]:![]:!![],'where':_0x56dd59['options']?_0x56dd59[_0x2a56('0x16')][_0x2a56('0x18')]||null:null,'attributes':_0x56dd59[_0x2a56('0x16')]?_0x56dd59[_0x2a56('0x16')][_0x2a56('0x1d')]||null:null,'include':_0x56dd59[_0x2a56('0x16')]?_0x56dd59[_0x2a56('0x16')]['include']?_[_0x2a56('0x1c')](_0x56dd59[_0x2a56('0x16')]['include'],function(_0xaae1e6){return{'model':db[_0xaae1e6[_0x2a56('0x1b')]],'as':_0xaae1e6['as'],'attributes':_0xaae1e6['attributes'],'include':_0xaae1e6[_0x2a56('0x1a')]?_[_0x2a56('0x1c')](_0xaae1e6[_0x2a56('0x1a')],function(_0x2e8fb5){return{'model':db[_0x2e8fb5[_0x2a56('0x1b')]],'as':_0x2e8fb5['as'],'attributes':_0x2e8fb5[_0x2a56('0x1d')],'include':_0x2e8fb5[_0x2a56('0x1a')]?_[_0x2a56('0x1c')](_0x2e8fb5[_0x2a56('0x1a')],function(_0x31bea5){return{'model':db[_0x31bea5[_0x2a56('0x1b')]],'as':_0x31bea5['as'],'attributes':_0x31bea5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f2c30){logger[_0x2a56('0x11')]('ShowFreshdeskAccount',_0x56dd59);logger[_0x2a56('0x1f')]('ShowFreshdeskAccount',_0x56dd59,JSON[_0x2a56('0xe')](_0x1f2c30));_0x57823b(_0x1f2c30);})[_0x2a56('0x13')](function(_0x9e427d){logger['error'](_0x2a56('0x20'),_0x9e427d[_0x2a56('0x10')],_0x56dd59);_0x2ae1cc(_0x55a6e4[_0x2a56('0xf')](0x1f4,_0x9e427d[_0x2a56('0x10')]));});});};
\ No newline at end of file
index a5cdd4c..7292ba6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb52b=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','/:id/tags','getTags'];(function(_0x465351,_0x115a2c){var _0x19f941=function(_0x4584d7){while(--_0x4584d7){_0x465351['push'](_0x465351['shift']());}};_0x19f941(++_0x115a2c);}(_0xb52b,0xaf));var _0xbb52=function(_0x55028e,_0x1dbae3){_0x55028e=_0x55028e-0x0;var _0x2168ee=_0xb52b[_0x55028e];return _0x2168ee;};'use strict';var multer=require(_0xbb52('0x0'));var util=require(_0xbb52('0x1'));var path=require(_0xbb52('0x2'));var timeout=require(_0xbb52('0x3'));var express=require(_0xbb52('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbb52('0x5'));var interaction=require(_0xbb52('0x6'));var config=require(_0xbb52('0x7'));var controller=require(_0xbb52('0x8'));router[_0xbb52('0x9')]('/',auth[_0xbb52('0xa')](),controller[_0xbb52('0xb')]);router[_0xbb52('0x9')](_0xbb52('0xc'),auth[_0xbb52('0xa')](),controller[_0xbb52('0xd')]);router[_0xbb52('0x9')](_0xbb52('0xe'),auth['isAuthenticated'](),controller[_0xbb52('0xf')]);router[_0xbb52('0x9')](_0xbb52('0x10'),auth[_0xbb52('0xa')](),controller[_0xbb52('0x11')]);router[_0xbb52('0x9')](_0xbb52('0x12'),auth[_0xbb52('0xa')](),controller['getDescriptions']);router['get'](_0xbb52('0x13'),auth[_0xbb52('0xa')](),controller[_0xbb52('0x14')]);router[_0xbb52('0x15')]('/',auth[_0xbb52('0xa')](),controller[_0xbb52('0x16')]);router[_0xbb52('0x15')](_0xbb52('0x13'),auth['isAuthenticated'](),controller['setTags']);router[_0xbb52('0x17')](_0xbb52('0xc'),auth['isAuthenticated'](),controller[_0xbb52('0x18')]);router[_0xbb52('0x19')]('/:id',auth[_0xbb52('0xa')](),controller[_0xbb52('0x1a')]);module[_0xbb52('0x1b')]=router;
\ No newline at end of file
+var _0xce28=['create','/:id/tags','setTags','put','update','delete','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getTags','post'];(function(_0x2eea6a,_0x47b635){var _0x13976b=function(_0x415d6a){while(--_0x415d6a){_0x2eea6a['push'](_0x2eea6a['shift']());}};_0x13976b(++_0x47b635);}(_0xce28,0xae));var _0x8ce2=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xce28[_0x26f702];return _0x11417d;};'use strict';var multer=require(_0x8ce2('0x0'));var util=require(_0x8ce2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8ce2('0x2'));var router=express[_0x8ce2('0x3')]();var fs_extra=require(_0x8ce2('0x4'));var auth=require(_0x8ce2('0x5'));var interaction=require(_0x8ce2('0x6'));var config=require(_0x8ce2('0x7'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x8ce2('0x8')]('/',auth[_0x8ce2('0x9')](),controller[_0x8ce2('0xa')]);router[_0x8ce2('0x8')](_0x8ce2('0xb'),auth[_0x8ce2('0x9')](),controller[_0x8ce2('0xc')]);router[_0x8ce2('0x8')](_0x8ce2('0xd'),auth[_0x8ce2('0x9')](),controller[_0x8ce2('0xe')]);router[_0x8ce2('0x8')]('/:id/subjects',auth[_0x8ce2('0x9')](),controller[_0x8ce2('0xf')]);router[_0x8ce2('0x8')]('/:id/descriptions',auth[_0x8ce2('0x9')](),controller['getDescriptions']);router[_0x8ce2('0x8')]('/:id/tags',auth['isAuthenticated'](),controller[_0x8ce2('0x10')]);router[_0x8ce2('0x11')]('/',auth[_0x8ce2('0x9')](),controller[_0x8ce2('0x12')]);router['post'](_0x8ce2('0x13'),auth[_0x8ce2('0x9')](),controller[_0x8ce2('0x14')]);router[_0x8ce2('0x15')](_0x8ce2('0xb'),auth[_0x8ce2('0x9')](),controller[_0x8ce2('0x16')]);router[_0x8ce2('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5619017..8f05007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x917a=['STRING','sequelize','exports'];(function(_0xda90a2,_0x15de4c){var _0x120d44=function(_0x2584ed){while(--_0x2584ed){_0xda90a2['push'](_0xda90a2['shift']());}};_0x120d44(++_0x15de4c);}(_0x917a,0xb5));var _0xa917=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x917a[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xa917('0x0'));module[_0xa917('0x1')]={'name':{'type':Sequelize[_0xa917('0x2')]},'description':{'type':Sequelize[_0xa917('0x2')]}};
\ No newline at end of file
+var _0xe7ba=['sequelize','exports','STRING'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xe7ba,0x93));var _0xae7b=function(_0x5dd5d9,_0x1e4895){_0x5dd5d9=_0x5dd5d9-0x0;var _0xbbeaa7=_0xe7ba[_0x5dd5d9];return _0xbbeaa7;};'use strict';var Sequelize=require(_0xae7b('0x0'));module[_0xae7b('0x1')]={'name':{'type':Sequelize[_0xae7b('0x2')]},'description':{'type':Sequelize[_0xae7b('0x2')]}};
\ No newline at end of file
index 3bda287..cf2ff8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6146=['pick','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','merge','VIRTUAL','filter','include','catch','show','params','length','options','create','body','find','getFields','findOne','FreshdeskField','sort'];(function(_0xa69592,_0x571583){var _0x4c5ec5=function(_0x4c7050){while(--_0x4c7050){_0xa69592['push'](_0xa69592['shift']());}};_0x4c5ec5(++_0x571583);}(_0x6146,0x157));var _0x6614=function(_0x5c8b12,_0x1fa98c){_0x5c8b12=_0x5c8b12-0x0;var _0xad80df=_0x6146[_0x5c8b12];return _0xad80df;};'use strict';var emlformat=require(_0x6614('0x0'));var rimraf=require(_0x6614('0x1'));var zipdir=require(_0x6614('0x2'));var jsonpatch=require(_0x6614('0x3'));var rp=require(_0x6614('0x4'));var moment=require('moment');var BPromise=require(_0x6614('0x5'));var Mustache=require(_0x6614('0x6'));var util=require(_0x6614('0x7'));var path=require(_0x6614('0x8'));var sox=require(_0x6614('0x9'));var csv=require(_0x6614('0xa'));var ejs=require(_0x6614('0xb'));var fs=require('fs');var fs_extra=require(_0x6614('0xc'));var _=require('lodash');var squel=require(_0x6614('0xd'));var crypto=require(_0x6614('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6614('0xf'));var toCsv=require(_0x6614('0xa'));var querystring=require(_0x6614('0x10'));var Papa=require(_0x6614('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6614('0x12'));var as=require(_0x6614('0x13'));var hardwareService=require(_0x6614('0x14'));var logger=require(_0x6614('0x15'))(_0x6614('0x16'));var utils=require('../../config/utils');var config=require(_0x6614('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6614('0x18'))['db'];function respondWithStatusCode(_0x49f9f7,_0x1a8176){_0x1a8176=_0x1a8176||0xcc;return function(_0x23844d){if(_0x23844d){return _0x49f9f7[_0x6614('0x19')](_0x1a8176);}return _0x49f9f7[_0x6614('0x1a')](_0x1a8176)[_0x6614('0x1b')]();};}function respondWithResult(_0x4aa64f,_0x47e3f1){_0x47e3f1=_0x47e3f1||0xc8;return function(_0x2358a3){if(_0x2358a3){return _0x4aa64f[_0x6614('0x1a')](_0x47e3f1)['json'](_0x2358a3);}};}function respondWithFilteredResult(_0x271d0f,_0x5db2c2){return function(_0x4a36c9){if(_0x4a36c9){var _0x580eae=typeof _0x5db2c2[_0x6614('0x1c')]==='undefined'&&typeof _0x5db2c2[_0x6614('0x1d')]===_0x6614('0x1e');var _0x52aa93=_0x4a36c9[_0x6614('0x1f')];var _0x24d857=_0x580eae?0x0:_0x5db2c2[_0x6614('0x1c')];var _0x4da997=_0x580eae?_0x4a36c9['count']:_0x5db2c2['offset']+_0x5db2c2[_0x6614('0x1d')];var _0x246b6e;if(_0x4da997>=_0x52aa93){_0x4da997=_0x52aa93;_0x246b6e=0xc8;}else{_0x246b6e=0xce;}_0x271d0f[_0x6614('0x1a')](_0x246b6e);return _0x271d0f['set'](_0x6614('0x20'),_0x24d857+'-'+_0x4da997+'/'+_0x52aa93)[_0x6614('0x21')](_0x4a36c9);}return null;};}function patchUpdates(_0x7b5398){return function(_0x31a289){try{jsonpatch[_0x6614('0x22')](_0x31a289,_0x7b5398,!![]);}catch(_0x1803f0){return BPromise[_0x6614('0x23')](_0x1803f0);}return _0x31a289[_0x6614('0x24')]();};}function saveUpdates(_0x31da0d,_0x9a5fee){return function(_0x4762bb){if(_0x4762bb){return _0x4762bb[_0x6614('0x25')](_0x31da0d)[_0x6614('0x26')](function(_0x50c367){return _0x50c367;});}return null;};}function removeEntity(_0x360bfd,_0x341e65){return function(_0x547bbf){if(_0x547bbf){return _0x547bbf[_0x6614('0x27')]()[_0x6614('0x26')](function(){_0x360bfd[_0x6614('0x1a')](0xcc)[_0x6614('0x1b')]();});}};}function handleEntityNotFound(_0x11a19f,_0xe3f749){return function(_0x670deb){if(!_0x670deb){_0x11a19f[_0x6614('0x19')](0x194);}return _0x670deb;};}function handleError(_0x38786a,_0x51bc10){_0x51bc10=_0x51bc10||0x1f4;return function(_0x485834){logger[_0x6614('0x28')](_0x485834[_0x6614('0x29')]);if(_0x485834[_0x6614('0x2a')]){delete _0x485834[_0x6614('0x2a')];}_0x38786a['status'](_0x51bc10)[_0x6614('0x2b')](_0x485834);};}exports[_0x6614('0x2c')]=function(_0x4ecb59,_0x17a6c4){var _0x5704cc={},_0x4179ae={},_0x48199d={'count':0x0,'rows':[]};var _0x5e79d4=_['map'](db[_0x6614('0x2d')][_0x6614('0x2e')],function(_0x167f11){return{'name':_0x167f11[_0x6614('0x2f')],'type':_0x167f11['type'][_0x6614('0x30')]};});_0x4179ae[_0x6614('0x31')]=_[_0x6614('0x32')](_0x5e79d4,_0x6614('0x2a'));_0x4179ae[_0x6614('0x33')]=_[_0x6614('0x34')](_0x4ecb59['query']);_0x4179ae['filters']=_['intersection'](_0x4179ae[_0x6614('0x31')],_0x4179ae['query']);_0x5704cc[_0x6614('0x35')]=_[_0x6614('0x36')](_0x4179ae[_0x6614('0x31')],qs[_0x6614('0x37')](_0x4ecb59[_0x6614('0x33')][_0x6614('0x37')]));_0x5704cc[_0x6614('0x35')]=_0x5704cc['attributes']['length']?_0x5704cc[_0x6614('0x35')]:_0x4179ae['model'];if(!_0x4ecb59[_0x6614('0x33')][_0x6614('0x38')](_0x6614('0x39'))){_0x5704cc[_0x6614('0x1d')]=qs[_0x6614('0x1d')](_0x4ecb59[_0x6614('0x33')][_0x6614('0x1d')]);_0x5704cc['offset']=qs['offset'](_0x4ecb59['query'][_0x6614('0x1c')]);}_0x5704cc[_0x6614('0x3a')]=qs['sort'](_0x4ecb59[_0x6614('0x33')]['sort']);_0x5704cc[_0x6614('0x3b')]=qs[_0x6614('0x3c')](_['pick'](_0x4ecb59[_0x6614('0x33')],_0x4179ae[_0x6614('0x3c')]),_0x5e79d4);if(_0x4ecb59['query']['filter']){_0x5704cc['where']=_[_0x6614('0x3d')](_0x5704cc[_0x6614('0x3b')],{'$or':_['map'](_0x5e79d4,function(_0x48b697){if(_0x48b697['type']!==_0x6614('0x3e')){var _0x24b99d={};_0x24b99d[_0x48b697[_0x6614('0x2a')]]={'$like':'%'+_0x4ecb59[_0x6614('0x33')][_0x6614('0x3f')]+'%'};return _0x24b99d;}})});}_0x5704cc=_[_0x6614('0x3d')]({},_0x5704cc,_0x4ecb59['options']);var _0x2eedb5={'where':_0x5704cc['where']};return db[_0x6614('0x2d')][_0x6614('0x1f')](_0x2eedb5)[_0x6614('0x26')](function(_0x6be031){_0x48199d['count']=_0x6be031;if(_0x4ecb59[_0x6614('0x33')]['includeAll']){_0x5704cc[_0x6614('0x40')]=[{'all':!![]}];}return db[_0x6614('0x2d')]['findAll'](_0x5704cc);})[_0x6614('0x26')](function(_0x550dc1){_0x48199d['rows']=_0x550dc1;return _0x48199d;})[_0x6614('0x26')](respondWithFilteredResult(_0x17a6c4,_0x5704cc))[_0x6614('0x41')](handleError(_0x17a6c4,null));};exports[_0x6614('0x42')]=function(_0x10281a,_0xca6dec){var _0x100aca={'raw':![],'where':{'id':_0x10281a[_0x6614('0x43')]['id']}},_0x553538={};_0x553538[_0x6614('0x31')]=_['keys'](db['FreshdeskConfiguration'][_0x6614('0x2e')]);_0x553538[_0x6614('0x33')]=_[_0x6614('0x34')](_0x10281a[_0x6614('0x33')]);_0x553538['filters']=_['intersection'](_0x553538[_0x6614('0x31')],_0x553538[_0x6614('0x33')]);_0x100aca['attributes']=_[_0x6614('0x36')](_0x553538[_0x6614('0x31')],qs[_0x6614('0x37')](_0x10281a['query'][_0x6614('0x37')]));_0x100aca[_0x6614('0x35')]=_0x100aca[_0x6614('0x35')][_0x6614('0x44')]?_0x100aca[_0x6614('0x35')]:_0x553538[_0x6614('0x31')];if(_0x10281a[_0x6614('0x33')]['includeAll']){_0x100aca[_0x6614('0x40')]=[{'all':!![]}];}_0x100aca=_[_0x6614('0x3d')]({},_0x100aca,_0x10281a[_0x6614('0x45')]);return db[_0x6614('0x2d')]['find'](_0x100aca)[_0x6614('0x26')](handleEntityNotFound(_0xca6dec,null))[_0x6614('0x26')](respondWithResult(_0xca6dec,null))[_0x6614('0x41')](handleError(_0xca6dec,null));};exports[_0x6614('0x46')]=function(_0x37bcd5,_0x46e108){return db['FreshdeskConfiguration'][_0x6614('0x46')](_0x37bcd5[_0x6614('0x47')],{})[_0x6614('0x26')](respondWithResult(_0x46e108,0xc9))['catch'](handleError(_0x46e108,null));};exports['update']=function(_0x15c9e9,_0x55b436){if(_0x15c9e9[_0x6614('0x47')]['id']){delete _0x15c9e9[_0x6614('0x47')]['id'];}return db[_0x6614('0x2d')]['find']({'where':{'id':_0x15c9e9[_0x6614('0x43')]['id']}})[_0x6614('0x26')](handleEntityNotFound(_0x55b436,null))[_0x6614('0x26')](saveUpdates(_0x15c9e9[_0x6614('0x47')],null))[_0x6614('0x26')](respondWithResult(_0x55b436,null))[_0x6614('0x41')](handleError(_0x55b436,null));};exports['destroy']=function(_0x5428c3,_0x21c980){return db[_0x6614('0x2d')][_0x6614('0x48')]({'where':{'id':_0x5428c3[_0x6614('0x43')]['id']}})['then'](handleEntityNotFound(_0x21c980,null))['then'](removeEntity(_0x21c980,null))[_0x6614('0x41')](handleError(_0x21c980,null));};exports[_0x6614('0x49')]=function(_0x3dfaf5,_0x8433b0,_0x4c5005){var _0xe0337b={};var _0x274592={};var _0x5a97a0;var _0x3aef85;return db[_0x6614('0x2d')][_0x6614('0x4a')]({'where':{'id':_0x3dfaf5[_0x6614('0x43')]['id']}})[_0x6614('0x26')](handleEntityNotFound(_0x8433b0,null))[_0x6614('0x26')](function(_0x14569b){if(_0x14569b){_0x5a97a0=_0x14569b;_0x274592[_0x6614('0x31')]=_[_0x6614('0x34')](db[_0x6614('0x4b')][_0x6614('0x2e')]);_0x274592[_0x6614('0x33')]=_[_0x6614('0x34')](_0x3dfaf5[_0x6614('0x33')]);_0x274592[_0x6614('0x3c')]=_['intersection'](_0x274592[_0x6614('0x31')],_0x274592['query']);_0xe0337b[_0x6614('0x35')]=_[_0x6614('0x36')](_0x274592['model'],qs[_0x6614('0x37')](_0x3dfaf5[_0x6614('0x33')][_0x6614('0x37')]));_0xe0337b[_0x6614('0x35')]=_0xe0337b[_0x6614('0x35')]['length']?_0xe0337b[_0x6614('0x35')]:_0x274592[_0x6614('0x31')];_0xe0337b[_0x6614('0x3a')]=qs[_0x6614('0x4c')](_0x3dfaf5['query'][_0x6614('0x4c')]);_0xe0337b[_0x6614('0x3b')]=qs[_0x6614('0x3c')](_[_0x6614('0x4d')](_0x3dfaf5['query'],_0x274592[_0x6614('0x3c')]));if(_0x3dfaf5['query'][_0x6614('0x3f')]){_0xe0337b['where']=_[_0x6614('0x3d')](_0xe0337b[_0x6614('0x3b')],{'$or':_[_0x6614('0x32')](_0xe0337b[_0x6614('0x35')],function(_0x3d6a2a){var _0x53962c={};_0x53962c[_0x3d6a2a]={'$like':'%'+_0x3dfaf5[_0x6614('0x33')][_0x6614('0x3f')]+'%'};return _0x53962c;})});}_0xe0337b=_['merge']({},_0xe0337b,_0x3dfaf5[_0x6614('0x45')]);return _0x5a97a0[_0x6614('0x49')](_0xe0337b);}})[_0x6614('0x26')](function(_0x5dd6a4){if(_0x5dd6a4){_0x3aef85=_0x5dd6a4[_0x6614('0x44')];if(!_0x3dfaf5[_0x6614('0x33')][_0x6614('0x38')](_0x6614('0x39'))){_0xe0337b[_0x6614('0x1d')]=qs['limit'](_0x3dfaf5[_0x6614('0x33')][_0x6614('0x1d')]);_0xe0337b['offset']=qs[_0x6614('0x1c')](_0x3dfaf5[_0x6614('0x33')][_0x6614('0x1c')]);}return _0x5a97a0[_0x6614('0x49')](_0xe0337b);}})[_0x6614('0x26')](function(_0x30ae90){if(_0x30ae90){return _0x30ae90?{'count':_0x3aef85,'rows':_0x30ae90}:null;}})[_0x6614('0x26')](respondWithResult(_0x8433b0,null))['catch'](handleError(_0x8433b0,null));};exports['getSubjects']=function(_0x16cc94,_0x5a2a93,_0x3f0815){var _0x3e86={};var _0x19d972={};var _0x38b037;var _0x126315;return db[_0x6614('0x2d')][_0x6614('0x4a')]({'where':{'id':_0x16cc94[_0x6614('0x43')]['id']}})[_0x6614('0x26')](handleEntityNotFound(_0x5a2a93,null))['then'](function(_0x4c97f5){if(_0x4c97f5){_0x38b037=_0x4c97f5;_0x19d972[_0x6614('0x31')]=_['keys'](db[_0x6614('0x4b')][_0x6614('0x2e')]);_0x19d972[_0x6614('0x33')]=_['keys'](_0x16cc94[_0x6614('0x33')]);_0x19d972[_0x6614('0x3c')]=_[_0x6614('0x36')](_0x19d972[_0x6614('0x31')],_0x19d972[_0x6614('0x33')]);_0x3e86[_0x6614('0x35')]=_[_0x6614('0x36')](_0x19d972[_0x6614('0x31')],qs[_0x6614('0x37')](_0x16cc94[_0x6614('0x33')]['fields']));_0x3e86[_0x6614('0x35')]=_0x3e86[_0x6614('0x35')]['length']?_0x3e86[_0x6614('0x35')]:_0x19d972['model'];_0x3e86[_0x6614('0x3a')]=qs['sort'](_0x16cc94[_0x6614('0x33')][_0x6614('0x4c')]);_0x3e86[_0x6614('0x3b')]=qs[_0x6614('0x3c')](_[_0x6614('0x4d')](_0x16cc94[_0x6614('0x33')],_0x19d972[_0x6614('0x3c')]));if(_0x16cc94[_0x6614('0x33')][_0x6614('0x3f')]){_0x3e86['where']=_[_0x6614('0x3d')](_0x3e86[_0x6614('0x3b')],{'$or':_[_0x6614('0x32')](_0x3e86[_0x6614('0x35')],function(_0xc3e8dc){var _0x2a9f29={};_0x2a9f29[_0xc3e8dc]={'$like':'%'+_0x16cc94[_0x6614('0x33')][_0x6614('0x3f')]+'%'};return _0x2a9f29;})});}_0x3e86=_[_0x6614('0x3d')]({},_0x3e86,_0x16cc94[_0x6614('0x45')]);return _0x38b037[_0x6614('0x4e')](_0x3e86);}})[_0x6614('0x26')](function(_0x11312e){if(_0x11312e){_0x126315=_0x11312e[_0x6614('0x44')];if(!_0x16cc94[_0x6614('0x33')]['hasOwnProperty'](_0x6614('0x39'))){_0x3e86['limit']=qs['limit'](_0x16cc94[_0x6614('0x33')][_0x6614('0x1d')]);_0x3e86[_0x6614('0x1c')]=qs[_0x6614('0x1c')](_0x16cc94[_0x6614('0x33')][_0x6614('0x1c')]);}return _0x38b037[_0x6614('0x4e')](_0x3e86);}})['then'](function(_0xb4e35a){if(_0xb4e35a){return _0xb4e35a?{'count':_0x126315,'rows':_0xb4e35a}:null;}})[_0x6614('0x26')](respondWithResult(_0x5a2a93,null))[_0x6614('0x41')](handleError(_0x5a2a93,null));};exports[_0x6614('0x4f')]=function(_0x3a7149,_0x2c72d7,_0x41bfb1){var _0x148edd={};var _0x56d7c5={};var _0x5ec64d;var _0x38c9d1;return db[_0x6614('0x2d')][_0x6614('0x4a')]({'where':{'id':_0x3a7149[_0x6614('0x43')]['id']}})[_0x6614('0x26')](handleEntityNotFound(_0x2c72d7,null))[_0x6614('0x26')](function(_0x59e03e){if(_0x59e03e){_0x5ec64d=_0x59e03e;_0x56d7c5['model']=_[_0x6614('0x34')](db['FreshdeskField'][_0x6614('0x2e')]);_0x56d7c5[_0x6614('0x33')]=_[_0x6614('0x34')](_0x3a7149[_0x6614('0x33')]);_0x56d7c5[_0x6614('0x3c')]=_[_0x6614('0x36')](_0x56d7c5[_0x6614('0x31')],_0x56d7c5[_0x6614('0x33')]);_0x148edd['attributes']=_[_0x6614('0x36')](_0x56d7c5['model'],qs['fields'](_0x3a7149[_0x6614('0x33')][_0x6614('0x37')]));_0x148edd[_0x6614('0x35')]=_0x148edd[_0x6614('0x35')][_0x6614('0x44')]?_0x148edd[_0x6614('0x35')]:_0x56d7c5[_0x6614('0x31')];_0x148edd['order']=qs[_0x6614('0x4c')](_0x3a7149['query'][_0x6614('0x4c')]);_0x148edd[_0x6614('0x3b')]=qs[_0x6614('0x3c')](_['pick'](_0x3a7149[_0x6614('0x33')],_0x56d7c5[_0x6614('0x3c')]));if(_0x3a7149[_0x6614('0x33')][_0x6614('0x3f')]){_0x148edd['where']=_[_0x6614('0x3d')](_0x148edd[_0x6614('0x3b')],{'$or':_['map'](_0x148edd[_0x6614('0x35')],function(_0x4d921e){var _0x4f901f={};_0x4f901f[_0x4d921e]={'$like':'%'+_0x3a7149[_0x6614('0x33')][_0x6614('0x3f')]+'%'};return _0x4f901f;})});}_0x148edd=_[_0x6614('0x3d')]({},_0x148edd,_0x3a7149['options']);return _0x5ec64d[_0x6614('0x4f')](_0x148edd);}})[_0x6614('0x26')](function(_0x4fc1e8){if(_0x4fc1e8){_0x38c9d1=_0x4fc1e8['length'];if(!_0x3a7149[_0x6614('0x33')][_0x6614('0x38')]('nolimit')){_0x148edd[_0x6614('0x1d')]=qs[_0x6614('0x1d')](_0x3a7149[_0x6614('0x33')][_0x6614('0x1d')]);_0x148edd[_0x6614('0x1c')]=qs[_0x6614('0x1c')](_0x3a7149[_0x6614('0x33')][_0x6614('0x1c')]);}return _0x5ec64d[_0x6614('0x4f')](_0x148edd);}})['then'](function(_0x50477f){if(_0x50477f){return _0x50477f?{'count':_0x38c9d1,'rows':_0x50477f}:null;}})[_0x6614('0x26')](respondWithResult(_0x2c72d7,null))[_0x6614('0x41')](handleError(_0x2c72d7,null));};exports[_0x6614('0x50')]=function(_0x12dff9,_0x1bed7d,_0x2cd663){var _0x482d6c={};var _0x3c078e={};var _0x3d8b0f;var _0x22640b;return db[_0x6614('0x2d')]['findOne']({'where':{'id':_0x12dff9['params']['id']}})['then'](handleEntityNotFound(_0x1bed7d,null))['then'](function(_0x106c30){if(_0x106c30){_0x3d8b0f=_0x106c30;_0x3c078e[_0x6614('0x31')]=_[_0x6614('0x34')](db[_0x6614('0x51')][_0x6614('0x2e')]);_0x3c078e['query']=_[_0x6614('0x34')](_0x12dff9[_0x6614('0x33')]);_0x3c078e[_0x6614('0x3c')]=_['intersection'](_0x3c078e[_0x6614('0x31')],_0x3c078e[_0x6614('0x33')]);_0x482d6c[_0x6614('0x35')]=_[_0x6614('0x36')](_0x3c078e[_0x6614('0x31')],qs[_0x6614('0x37')](_0x12dff9[_0x6614('0x33')][_0x6614('0x37')]));_0x482d6c[_0x6614('0x35')]=_0x482d6c['attributes'][_0x6614('0x44')]?_0x482d6c[_0x6614('0x35')]:_0x3c078e[_0x6614('0x31')];_0x482d6c[_0x6614('0x3a')]=qs['sort'](_0x12dff9[_0x6614('0x33')]['sort']);_0x482d6c['where']=qs[_0x6614('0x3c')](_[_0x6614('0x4d')](_0x12dff9['query'],_0x3c078e[_0x6614('0x3c')]));if(_0x12dff9[_0x6614('0x33')][_0x6614('0x3f')]){_0x482d6c['where']=_[_0x6614('0x3d')](_0x482d6c[_0x6614('0x3b')],{'$or':_[_0x6614('0x32')](_0x482d6c['attributes'],function(_0x51461f){var _0x5ec199={};_0x5ec199[_0x51461f]={'$like':'%'+_0x12dff9[_0x6614('0x33')][_0x6614('0x3f')]+'%'};return _0x5ec199;})});}_0x482d6c=_[_0x6614('0x3d')]({},_0x482d6c,_0x12dff9[_0x6614('0x45')]);return _0x3d8b0f[_0x6614('0x50')](_0x482d6c);}})['then'](function(_0x1b2a61){if(_0x1b2a61){_0x22640b=_0x1b2a61[_0x6614('0x44')];if(!_0x12dff9[_0x6614('0x33')][_0x6614('0x38')]('nolimit')){_0x482d6c['limit']=qs[_0x6614('0x1d')](_0x12dff9['query']['limit']);_0x482d6c[_0x6614('0x1c')]=qs[_0x6614('0x1c')](_0x12dff9[_0x6614('0x33')][_0x6614('0x1c')]);}return _0x3d8b0f['getTags'](_0x482d6c);}})['then'](function(_0x81d738){if(_0x81d738){return _0x81d738?{'count':_0x22640b,'rows':_0x81d738}:null;}})[_0x6614('0x26')](respondWithResult(_0x1bed7d,null))[_0x6614('0x41')](handleError(_0x1bed7d,null));};exports['setTags']=function(_0x279e5a,_0x2a2f44,_0x1af6de){if(_0x279e5a[_0x6614('0x47')]['id']){delete _0x279e5a[_0x6614('0x47')]['id'];}return db[_0x6614('0x2d')][_0x6614('0x4a')]({'where':{'id':_0x279e5a[_0x6614('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a2f44,null))['then'](function(_0x4d0e9e){if(_0x4d0e9e){return _0x4d0e9e[_0x6614('0x52')](_0x279e5a[_0x6614('0x47')][_0x6614('0x53')]||[]);}return null;})['then'](respondWithResult(_0x2a2f44,null))[_0x6614('0x41')](handleError(_0x2a2f44,null));};
\ No newline at end of file
+var _0x11b2=['FreshdeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','includeAll','include','rows','catch','show','options','find','create','update','body','params','getFields','findOne'];(function(_0x1fa997,_0x175d73){var _0x4a47b5=function(_0x3bfb27){while(--_0x3bfb27){_0x1fa997['push'](_0x1fa997['shift']());}};_0x4a47b5(++_0x175d73);}(_0x11b2,0xfe));var _0x211b=function(_0x26b3ab,_0x32f244){_0x26b3ab=_0x26b3ab-0x0;var _0x1a70bf=_0x11b2[_0x26b3ab];return _0x1a70bf;};'use strict';var emlformat=require(_0x211b('0x0'));var rimraf=require(_0x211b('0x1'));var zipdir=require(_0x211b('0x2'));var jsonpatch=require(_0x211b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x211b('0x4'));var Mustache=require(_0x211b('0x5'));var util=require(_0x211b('0x6'));var path=require('path');var sox=require(_0x211b('0x7'));var csv=require(_0x211b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x211b('0x9'));var _=require(_0x211b('0xa'));var squel=require(_0x211b('0xb'));var crypto=require(_0x211b('0xc'));var jsforce=require(_0x211b('0xd'));var deskjs=require(_0x211b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x211b('0xf'));var Papa=require(_0x211b('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x211b('0x11'));var logger=require(_0x211b('0x12'))(_0x211b('0x13'));var utils=require(_0x211b('0x14'));var config=require(_0x211b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x211b('0x16'))['db'];function respondWithStatusCode(_0x576051,_0x591ad9){_0x591ad9=_0x591ad9||0xcc;return function(_0x4b66e3){if(_0x4b66e3){return _0x576051[_0x211b('0x17')](_0x591ad9);}return _0x576051['status'](_0x591ad9)[_0x211b('0x18')]();};}function respondWithResult(_0x6d5b10,_0x4303ff){_0x4303ff=_0x4303ff||0xc8;return function(_0x4a75c3){if(_0x4a75c3){return _0x6d5b10[_0x211b('0x19')](_0x4303ff)[_0x211b('0x1a')](_0x4a75c3);}};}function respondWithFilteredResult(_0x45a274,_0x7ebfc4){return function(_0x10dab0){if(_0x10dab0){var _0x49a2bf=typeof _0x7ebfc4['offset']===_0x211b('0x1b')&&typeof _0x7ebfc4[_0x211b('0x1c')]===_0x211b('0x1b');var _0x3cd7a2=_0x10dab0['count'];var _0x491c3a=_0x49a2bf?0x0:_0x7ebfc4['offset'];var _0x3eeb9e=_0x49a2bf?_0x10dab0[_0x211b('0x1d')]:_0x7ebfc4[_0x211b('0x1e')]+_0x7ebfc4[_0x211b('0x1c')];var _0x420cb5;if(_0x3eeb9e>=_0x3cd7a2){_0x3eeb9e=_0x3cd7a2;_0x420cb5=0xc8;}else{_0x420cb5=0xce;}_0x45a274[_0x211b('0x19')](_0x420cb5);return _0x45a274[_0x211b('0x1f')]('Content-Range',_0x491c3a+'-'+_0x3eeb9e+'/'+_0x3cd7a2)[_0x211b('0x1a')](_0x10dab0);}return null;};}function patchUpdates(_0x30cac7){return function(_0x1c2640){try{jsonpatch[_0x211b('0x20')](_0x1c2640,_0x30cac7,!![]);}catch(_0xa9278c){return BPromise[_0x211b('0x21')](_0xa9278c);}return _0x1c2640[_0x211b('0x22')]();};}function saveUpdates(_0x5ad779,_0x9477eb){return function(_0x3a7c6e){if(_0x3a7c6e){return _0x3a7c6e['update'](_0x5ad779)[_0x211b('0x23')](function(_0x53e00d){return _0x53e00d;});}return null;};}function removeEntity(_0x4df67d,_0x58379c){return function(_0x26c194){if(_0x26c194){return _0x26c194[_0x211b('0x24')]()[_0x211b('0x23')](function(){_0x4df67d[_0x211b('0x19')](0xcc)[_0x211b('0x18')]();});}};}function handleEntityNotFound(_0x5a0a1f,_0x136300){return function(_0x15928c){if(!_0x15928c){_0x5a0a1f[_0x211b('0x17')](0x194);}return _0x15928c;};}function handleError(_0x3efcbd,_0x16e83b){_0x16e83b=_0x16e83b||0x1f4;return function(_0x397ec9){logger[_0x211b('0x25')](_0x397ec9[_0x211b('0x26')]);if(_0x397ec9[_0x211b('0x27')]){delete _0x397ec9[_0x211b('0x27')];}_0x3efcbd[_0x211b('0x19')](_0x16e83b)[_0x211b('0x28')](_0x397ec9);};}exports[_0x211b('0x29')]=function(_0x507cdb,_0x5d7cb1){var _0x43a06f={},_0x1465a5={},_0x107e48={'count':0x0,'rows':[]};var _0x5e932e=_[_0x211b('0x2a')](db[_0x211b('0x2b')][_0x211b('0x2c')],function(_0x29d4c5){return{'name':_0x29d4c5[_0x211b('0x2d')],'type':_0x29d4c5['type']['key']};});_0x1465a5[_0x211b('0x2e')]=_['map'](_0x5e932e,'name');_0x1465a5['query']=_[_0x211b('0x2f')](_0x507cdb[_0x211b('0x30')]);_0x1465a5['filters']=_[_0x211b('0x31')](_0x1465a5[_0x211b('0x2e')],_0x1465a5[_0x211b('0x30')]);_0x43a06f[_0x211b('0x32')]=_[_0x211b('0x31')](_0x1465a5['model'],qs[_0x211b('0x33')](_0x507cdb[_0x211b('0x30')][_0x211b('0x33')]));_0x43a06f['attributes']=_0x43a06f[_0x211b('0x32')][_0x211b('0x34')]?_0x43a06f[_0x211b('0x32')]:_0x1465a5[_0x211b('0x2e')];if(!_0x507cdb[_0x211b('0x30')][_0x211b('0x35')](_0x211b('0x36'))){_0x43a06f[_0x211b('0x1c')]=qs[_0x211b('0x1c')](_0x507cdb[_0x211b('0x30')][_0x211b('0x1c')]);_0x43a06f[_0x211b('0x1e')]=qs[_0x211b('0x1e')](_0x507cdb[_0x211b('0x30')][_0x211b('0x1e')]);}_0x43a06f['order']=qs[_0x211b('0x37')](_0x507cdb[_0x211b('0x30')][_0x211b('0x37')]);_0x43a06f[_0x211b('0x38')]=qs[_0x211b('0x39')](_[_0x211b('0x3a')](_0x507cdb[_0x211b('0x30')],_0x1465a5[_0x211b('0x39')]),_0x5e932e);if(_0x507cdb[_0x211b('0x30')]['filter']){_0x43a06f[_0x211b('0x38')]=_[_0x211b('0x3b')](_0x43a06f[_0x211b('0x38')],{'$or':_[_0x211b('0x2a')](_0x5e932e,function(_0x102a7d){if(_0x102a7d['type']!=='VIRTUAL'){var _0x4cab97={};_0x4cab97[_0x102a7d['name']]={'$like':'%'+_0x507cdb[_0x211b('0x30')][_0x211b('0x3c')]+'%'};return _0x4cab97;}})});}_0x43a06f=_[_0x211b('0x3b')]({},_0x43a06f,_0x507cdb['options']);var _0x2c2708={'where':_0x43a06f[_0x211b('0x38')]};return db['FreshdeskConfiguration'][_0x211b('0x1d')](_0x2c2708)[_0x211b('0x23')](function(_0x49068e){_0x107e48[_0x211b('0x1d')]=_0x49068e;if(_0x507cdb['query'][_0x211b('0x3d')]){_0x43a06f[_0x211b('0x3e')]=[{'all':!![]}];}return db[_0x211b('0x2b')]['findAll'](_0x43a06f);})[_0x211b('0x23')](function(_0x3e84e8){_0x107e48[_0x211b('0x3f')]=_0x3e84e8;return _0x107e48;})[_0x211b('0x23')](respondWithFilteredResult(_0x5d7cb1,_0x43a06f))[_0x211b('0x40')](handleError(_0x5d7cb1,null));};exports[_0x211b('0x41')]=function(_0x4eedba,_0x2fd9a2){var _0x1e8ad2={'raw':![],'where':{'id':_0x4eedba['params']['id']}},_0x30b841={};_0x30b841['model']=_['keys'](db[_0x211b('0x2b')]['rawAttributes']);_0x30b841[_0x211b('0x30')]=_['keys'](_0x4eedba['query']);_0x30b841[_0x211b('0x39')]=_[_0x211b('0x31')](_0x30b841['model'],_0x30b841[_0x211b('0x30')]);_0x1e8ad2[_0x211b('0x32')]=_[_0x211b('0x31')](_0x30b841[_0x211b('0x2e')],qs[_0x211b('0x33')](_0x4eedba['query'][_0x211b('0x33')]));_0x1e8ad2[_0x211b('0x32')]=_0x1e8ad2[_0x211b('0x32')]['length']?_0x1e8ad2[_0x211b('0x32')]:_0x30b841['model'];if(_0x4eedba['query'][_0x211b('0x3d')]){_0x1e8ad2['include']=[{'all':!![]}];}_0x1e8ad2=_['merge']({},_0x1e8ad2,_0x4eedba[_0x211b('0x42')]);return db[_0x211b('0x2b')][_0x211b('0x43')](_0x1e8ad2)[_0x211b('0x23')](handleEntityNotFound(_0x2fd9a2,null))[_0x211b('0x23')](respondWithResult(_0x2fd9a2,null))[_0x211b('0x40')](handleError(_0x2fd9a2,null));};exports['create']=function(_0x5e56ab,_0x1c3217){return db[_0x211b('0x2b')][_0x211b('0x44')](_0x5e56ab['body'],{})[_0x211b('0x23')](respondWithResult(_0x1c3217,0xc9))[_0x211b('0x40')](handleError(_0x1c3217,null));};exports[_0x211b('0x45')]=function(_0xe0b1f2,_0x18c087){if(_0xe0b1f2[_0x211b('0x46')]['id']){delete _0xe0b1f2[_0x211b('0x46')]['id'];}return db[_0x211b('0x2b')][_0x211b('0x43')]({'where':{'id':_0xe0b1f2[_0x211b('0x47')]['id']}})['then'](handleEntityNotFound(_0x18c087,null))[_0x211b('0x23')](saveUpdates(_0xe0b1f2['body'],null))[_0x211b('0x23')](respondWithResult(_0x18c087,null))[_0x211b('0x40')](handleError(_0x18c087,null));};exports['destroy']=function(_0x2dd734,_0x2236cb){return db[_0x211b('0x2b')]['find']({'where':{'id':_0x2dd734[_0x211b('0x47')]['id']}})['then'](handleEntityNotFound(_0x2236cb,null))[_0x211b('0x23')](removeEntity(_0x2236cb,null))[_0x211b('0x40')](handleError(_0x2236cb,null));};exports[_0x211b('0x48')]=function(_0x43a72c,_0x1db3d4,_0x54758d){var _0x9b2af8={};var _0x5bba86={};var _0x111ba9;var _0x323c7c;return db[_0x211b('0x2b')][_0x211b('0x49')]({'where':{'id':_0x43a72c[_0x211b('0x47')]['id']}})['then'](handleEntityNotFound(_0x1db3d4,null))['then'](function(_0xed4eb0){if(_0xed4eb0){_0x111ba9=_0xed4eb0;_0x5bba86[_0x211b('0x2e')]=_[_0x211b('0x2f')](db[_0x211b('0x4a')]['rawAttributes']);_0x5bba86[_0x211b('0x30')]=_[_0x211b('0x2f')](_0x43a72c[_0x211b('0x30')]);_0x5bba86['filters']=_[_0x211b('0x31')](_0x5bba86[_0x211b('0x2e')],_0x5bba86[_0x211b('0x30')]);_0x9b2af8['attributes']=_['intersection'](_0x5bba86[_0x211b('0x2e')],qs[_0x211b('0x33')](_0x43a72c[_0x211b('0x30')][_0x211b('0x33')]));_0x9b2af8[_0x211b('0x32')]=_0x9b2af8[_0x211b('0x32')][_0x211b('0x34')]?_0x9b2af8['attributes']:_0x5bba86[_0x211b('0x2e')];_0x9b2af8[_0x211b('0x4b')]=qs['sort'](_0x43a72c['query'][_0x211b('0x37')]);_0x9b2af8[_0x211b('0x38')]=qs[_0x211b('0x39')](_[_0x211b('0x3a')](_0x43a72c['query'],_0x5bba86[_0x211b('0x39')]));if(_0x43a72c[_0x211b('0x30')][_0x211b('0x3c')]){_0x9b2af8['where']=_[_0x211b('0x3b')](_0x9b2af8[_0x211b('0x38')],{'$or':_[_0x211b('0x2a')](_0x9b2af8[_0x211b('0x32')],function(_0x1fc32f){var _0x4c30ff={};_0x4c30ff[_0x1fc32f]={'$like':'%'+_0x43a72c[_0x211b('0x30')][_0x211b('0x3c')]+'%'};return _0x4c30ff;})});}_0x9b2af8=_[_0x211b('0x3b')]({},_0x9b2af8,_0x43a72c[_0x211b('0x42')]);return _0x111ba9[_0x211b('0x48')](_0x9b2af8);}})[_0x211b('0x23')](function(_0x3b12cf){if(_0x3b12cf){_0x323c7c=_0x3b12cf[_0x211b('0x34')];if(!_0x43a72c[_0x211b('0x30')][_0x211b('0x35')](_0x211b('0x36'))){_0x9b2af8[_0x211b('0x1c')]=qs[_0x211b('0x1c')](_0x43a72c['query'][_0x211b('0x1c')]);_0x9b2af8[_0x211b('0x1e')]=qs[_0x211b('0x1e')](_0x43a72c[_0x211b('0x30')][_0x211b('0x1e')]);}return _0x111ba9[_0x211b('0x48')](_0x9b2af8);}})[_0x211b('0x23')](function(_0x33ae36){if(_0x33ae36){return _0x33ae36?{'count':_0x323c7c,'rows':_0x33ae36}:null;}})['then'](respondWithResult(_0x1db3d4,null))[_0x211b('0x40')](handleError(_0x1db3d4,null));};exports[_0x211b('0x4c')]=function(_0x3883a5,_0x1e122a,_0x1b5f1e){var _0x261093={};var _0x5d7aaf={};var _0x3675ed;var _0x428833;return db['FreshdeskConfiguration'][_0x211b('0x49')]({'where':{'id':_0x3883a5[_0x211b('0x47')]['id']}})[_0x211b('0x23')](handleEntityNotFound(_0x1e122a,null))['then'](function(_0xe97e65){if(_0xe97e65){_0x3675ed=_0xe97e65;_0x5d7aaf[_0x211b('0x2e')]=_['keys'](db[_0x211b('0x4a')][_0x211b('0x2c')]);_0x5d7aaf[_0x211b('0x30')]=_[_0x211b('0x2f')](_0x3883a5[_0x211b('0x30')]);_0x5d7aaf[_0x211b('0x39')]=_['intersection'](_0x5d7aaf[_0x211b('0x2e')],_0x5d7aaf['query']);_0x261093[_0x211b('0x32')]=_[_0x211b('0x31')](_0x5d7aaf[_0x211b('0x2e')],qs['fields'](_0x3883a5[_0x211b('0x30')][_0x211b('0x33')]));_0x261093['attributes']=_0x261093['attributes']['length']?_0x261093[_0x211b('0x32')]:_0x5d7aaf['model'];_0x261093['order']=qs[_0x211b('0x37')](_0x3883a5[_0x211b('0x30')][_0x211b('0x37')]);_0x261093[_0x211b('0x38')]=qs[_0x211b('0x39')](_[_0x211b('0x3a')](_0x3883a5['query'],_0x5d7aaf[_0x211b('0x39')]));if(_0x3883a5[_0x211b('0x30')][_0x211b('0x3c')]){_0x261093['where']=_[_0x211b('0x3b')](_0x261093[_0x211b('0x38')],{'$or':_[_0x211b('0x2a')](_0x261093['attributes'],function(_0x2e066b){var _0x12e908={};_0x12e908[_0x2e066b]={'$like':'%'+_0x3883a5[_0x211b('0x30')]['filter']+'%'};return _0x12e908;})});}_0x261093=_[_0x211b('0x3b')]({},_0x261093,_0x3883a5[_0x211b('0x42')]);return _0x3675ed[_0x211b('0x4c')](_0x261093);}})[_0x211b('0x23')](function(_0x4a3118){if(_0x4a3118){_0x428833=_0x4a3118['length'];if(!_0x3883a5[_0x211b('0x30')][_0x211b('0x35')](_0x211b('0x36'))){_0x261093['limit']=qs[_0x211b('0x1c')](_0x3883a5['query'][_0x211b('0x1c')]);_0x261093[_0x211b('0x1e')]=qs[_0x211b('0x1e')](_0x3883a5[_0x211b('0x30')][_0x211b('0x1e')]);}return _0x3675ed[_0x211b('0x4c')](_0x261093);}})[_0x211b('0x23')](function(_0x10c9f0){if(_0x10c9f0){return _0x10c9f0?{'count':_0x428833,'rows':_0x10c9f0}:null;}})[_0x211b('0x23')](respondWithResult(_0x1e122a,null))[_0x211b('0x40')](handleError(_0x1e122a,null));};exports[_0x211b('0x4d')]=function(_0x22cb03,_0x13ea3a,_0x40a545){var _0x5ea7b8={};var _0x53933a={};var _0x481e1f;var _0x37d99d;return db[_0x211b('0x2b')][_0x211b('0x49')]({'where':{'id':_0x22cb03['params']['id']}})[_0x211b('0x23')](handleEntityNotFound(_0x13ea3a,null))['then'](function(_0x3cae19){if(_0x3cae19){_0x481e1f=_0x3cae19;_0x53933a[_0x211b('0x2e')]=_[_0x211b('0x2f')](db[_0x211b('0x4a')]['rawAttributes']);_0x53933a[_0x211b('0x30')]=_[_0x211b('0x2f')](_0x22cb03[_0x211b('0x30')]);_0x53933a[_0x211b('0x39')]=_[_0x211b('0x31')](_0x53933a['model'],_0x53933a[_0x211b('0x30')]);_0x5ea7b8[_0x211b('0x32')]=_[_0x211b('0x31')](_0x53933a[_0x211b('0x2e')],qs['fields'](_0x22cb03[_0x211b('0x30')]['fields']));_0x5ea7b8[_0x211b('0x32')]=_0x5ea7b8[_0x211b('0x32')]['length']?_0x5ea7b8[_0x211b('0x32')]:_0x53933a[_0x211b('0x2e')];_0x5ea7b8[_0x211b('0x4b')]=qs[_0x211b('0x37')](_0x22cb03[_0x211b('0x30')][_0x211b('0x37')]);_0x5ea7b8[_0x211b('0x38')]=qs[_0x211b('0x39')](_[_0x211b('0x3a')](_0x22cb03['query'],_0x53933a['filters']));if(_0x22cb03[_0x211b('0x30')][_0x211b('0x3c')]){_0x5ea7b8[_0x211b('0x38')]=_['merge'](_0x5ea7b8[_0x211b('0x38')],{'$or':_[_0x211b('0x2a')](_0x5ea7b8[_0x211b('0x32')],function(_0x588f19){var _0x4f8c45={};_0x4f8c45[_0x588f19]={'$like':'%'+_0x22cb03[_0x211b('0x30')][_0x211b('0x3c')]+'%'};return _0x4f8c45;})});}_0x5ea7b8=_[_0x211b('0x3b')]({},_0x5ea7b8,_0x22cb03[_0x211b('0x42')]);return _0x481e1f['getDescriptions'](_0x5ea7b8);}})[_0x211b('0x23')](function(_0x3972f6){if(_0x3972f6){_0x37d99d=_0x3972f6[_0x211b('0x34')];if(!_0x22cb03[_0x211b('0x30')]['hasOwnProperty'](_0x211b('0x36'))){_0x5ea7b8[_0x211b('0x1c')]=qs['limit'](_0x22cb03[_0x211b('0x30')][_0x211b('0x1c')]);_0x5ea7b8[_0x211b('0x1e')]=qs['offset'](_0x22cb03[_0x211b('0x30')][_0x211b('0x1e')]);}return _0x481e1f[_0x211b('0x4d')](_0x5ea7b8);}})[_0x211b('0x23')](function(_0x19842b){if(_0x19842b){return _0x19842b?{'count':_0x37d99d,'rows':_0x19842b}:null;}})[_0x211b('0x23')](respondWithResult(_0x13ea3a,null))[_0x211b('0x40')](handleError(_0x13ea3a,null));};exports['getTags']=function(_0x4c22cd,_0x48c4c1,_0x19d9b0){var _0x3d7207={};var _0x1e055a={};var _0x19172e;var _0x39a5f5;return db[_0x211b('0x2b')][_0x211b('0x49')]({'where':{'id':_0x4c22cd[_0x211b('0x47')]['id']}})['then'](handleEntityNotFound(_0x48c4c1,null))[_0x211b('0x23')](function(_0x7c7252){if(_0x7c7252){_0x19172e=_0x7c7252;_0x1e055a[_0x211b('0x2e')]=_['keys'](db[_0x211b('0x4e')][_0x211b('0x2c')]);_0x1e055a[_0x211b('0x30')]=_['keys'](_0x4c22cd[_0x211b('0x30')]);_0x1e055a[_0x211b('0x39')]=_[_0x211b('0x31')](_0x1e055a[_0x211b('0x2e')],_0x1e055a[_0x211b('0x30')]);_0x3d7207[_0x211b('0x32')]=_[_0x211b('0x31')](_0x1e055a['model'],qs[_0x211b('0x33')](_0x4c22cd[_0x211b('0x30')][_0x211b('0x33')]));_0x3d7207[_0x211b('0x32')]=_0x3d7207['attributes'][_0x211b('0x34')]?_0x3d7207[_0x211b('0x32')]:_0x1e055a[_0x211b('0x2e')];_0x3d7207[_0x211b('0x4b')]=qs['sort'](_0x4c22cd[_0x211b('0x30')]['sort']);_0x3d7207[_0x211b('0x38')]=qs[_0x211b('0x39')](_[_0x211b('0x3a')](_0x4c22cd['query'],_0x1e055a[_0x211b('0x39')]));if(_0x4c22cd[_0x211b('0x30')]['filter']){_0x3d7207[_0x211b('0x38')]=_[_0x211b('0x3b')](_0x3d7207[_0x211b('0x38')],{'$or':_['map'](_0x3d7207['attributes'],function(_0x2220a5){var _0x3cfb95={};_0x3cfb95[_0x2220a5]={'$like':'%'+_0x4c22cd[_0x211b('0x30')][_0x211b('0x3c')]+'%'};return _0x3cfb95;})});}_0x3d7207=_[_0x211b('0x3b')]({},_0x3d7207,_0x4c22cd[_0x211b('0x42')]);return _0x19172e['getTags'](_0x3d7207);}})[_0x211b('0x23')](function(_0x46e719){if(_0x46e719){_0x39a5f5=_0x46e719[_0x211b('0x34')];if(!_0x4c22cd[_0x211b('0x30')]['hasOwnProperty'](_0x211b('0x36'))){_0x3d7207[_0x211b('0x1c')]=qs[_0x211b('0x1c')](_0x4c22cd[_0x211b('0x30')][_0x211b('0x1c')]);_0x3d7207[_0x211b('0x1e')]=qs[_0x211b('0x1e')](_0x4c22cd[_0x211b('0x30')][_0x211b('0x1e')]);}return _0x19172e[_0x211b('0x4f')](_0x3d7207);}})['then'](function(_0x329d1e){if(_0x329d1e){return _0x329d1e?{'count':_0x39a5f5,'rows':_0x329d1e}:null;}})['then'](respondWithResult(_0x48c4c1,null))[_0x211b('0x40')](handleError(_0x48c4c1,null));};exports[_0x211b('0x50')]=function(_0xb53551,_0x5bdb33,_0xb56ced){if(_0xb53551[_0x211b('0x46')]['id']){delete _0xb53551['body']['id'];}return db['FreshdeskConfiguration'][_0x211b('0x49')]({'where':{'id':_0xb53551[_0x211b('0x47')]['id']}})['then'](handleEntityNotFound(_0x5bdb33,null))[_0x211b('0x23')](function(_0x4758d5){if(_0x4758d5){return _0x4758d5[_0x211b('0x50')](_0xb53551[_0x211b('0x46')][_0x211b('0x51')]||[]);}return null;})[_0x211b('0x23')](respondWithResult(_0x5bdb33,null))[_0x211b('0x40')](handleError(_0x5bdb33,null));};
\ No newline at end of file
index 315fcfb..8b41be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d8a=['moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api'];(function(_0x3be25d,_0x15a3a6){var _0x3cda4f=function(_0x3d7da7){while(--_0x3d7da7){_0x3be25d['push'](_0x3be25d['shift']());}};_0x3cda4f(++_0x15a3a6);}(_0x7d8a,0xb1));var _0xa7d8=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x7d8a[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xa7d8('0x0'));var util=require('util');var logger=require(_0xa7d8('0x1'))(_0xa7d8('0x2'));var moment=require(_0xa7d8('0x3'));var BPromise=require('bluebird');var rp=require(_0xa7d8('0x4'));var fs=require('fs');var path=require(_0xa7d8('0x5'));var rimraf=require(_0xa7d8('0x6'));var config=require(_0xa7d8('0x7'));var attributes=require(_0xa7d8('0x8'));module[_0xa7d8('0x9')]=function(_0x24f893,_0x51cce5){return _0x24f893['define'](_0xa7d8('0xa'),attributes,{'tableName':_0xa7d8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbab0=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','request-promise','rimraf','../../config/environment'];(function(_0x183482,_0x146db8){var _0x4816e6=function(_0x4e3378){while(--_0x4e3378){_0x183482['push'](_0x183482['shift']());}};_0x4816e6(++_0x146db8);}(_0xbab0,0x177));var _0x0bab=function(_0x2982a6,_0x209100){_0x2982a6=_0x2982a6-0x0;var _0x3379d4=_0xbab0[_0x2982a6];return _0x3379d4;};'use strict';var _=require(_0x0bab('0x0'));var util=require('util');var logger=require(_0x0bab('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0bab('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0bab('0x3'));var config=require(_0x0bab('0x4'));var attributes=require(_0x0bab('0x5'));module[_0x0bab('0x6')]=function(_0x4bc682,_0x14f877){return _0x4bc682[_0x0bab('0x7')](_0x0bab('0x8'),attributes,{'tableName':_0x0bab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f7fbe45..893a0c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x316d=['message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request\x20sent','debug','stringify','error','code'];(function(_0x22be4b,_0x12f93e){var _0x594cc7=function(_0xdeeb61){while(--_0xdeeb61){_0x22be4b['push'](_0x22be4b['shift']());}};_0x594cc7(++_0x12f93e);}(_0x316d,0x10c));var _0xd316=function(_0xbff5e,_0x32e6ce){_0xbff5e=_0xbff5e-0x0;var _0x369aba=_0x316d[_0xbff5e];return _0x369aba;};'use strict';var _=require(_0xd316('0x0'));var util=require(_0xd316('0x1'));var moment=require(_0xd316('0x2'));var BPromise=require(_0xd316('0x3'));var rs=require(_0xd316('0x4'));var fs=require('fs');var Redis=require(_0xd316('0x5'));var db=require(_0xd316('0x6'))['db'];var utils=require(_0xd316('0x7'));var logger=require(_0xd316('0x8'))('rpc');var config=require(_0xd316('0x9'));var jayson=require(_0xd316('0xa'));var client=jayson[_0xd316('0xb')][_0xd316('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e8ef,_0x277388,_0x5654d8){return new BPromise(function(_0x25cfb1,_0x35b77e){return client['request'](_0x53e8ef,_0x5654d8)['then'](function(_0x121d25){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x277388,_0xd316('0xd'));logger[_0xd316('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x277388,_0xd316('0xd'),JSON[_0xd316('0xf')](_0x121d25));if(_0x121d25[_0xd316('0x10')]){if(_0x121d25[_0xd316('0x10')][_0xd316('0x11')]===0x1f4){logger[_0xd316('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x277388,_0x121d25[_0xd316('0x10')][_0xd316('0x12')]);return _0x35b77e(_0x121d25[_0xd316('0x10')][_0xd316('0x12')]);}logger[_0xd316('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x277388,_0x121d25[_0xd316('0x10')]['message']);return _0x25cfb1(_0x121d25['error'][_0xd316('0x12')]);}else{logger['info'](_0xd316('0x13'),_0x277388,_0xd316('0xd'));_0x25cfb1(_0x121d25[_0xd316('0x14')][_0xd316('0x12')]);}})[_0xd316('0x15')](function(_0x453ef9){logger['error'](_0xd316('0x13'),_0x277388,_0x453ef9);_0x35b77e(_0x453ef9);});});}
\ No newline at end of file
+var _0x87d1=['error','message','result','catch','lodash','moment','../../config/utils','../../config/environment','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x443050,_0x2dffd0){var _0x1ec7e7=function(_0x48ccdd){while(--_0x48ccdd){_0x443050['push'](_0x443050['shift']());}};_0x1ec7e7(++_0x2dffd0);}(_0x87d1,0x1f2));var _0x187d=function(_0x2f8960,_0x12182e){_0x2f8960=_0x2f8960-0x0;var _0x4612c5=_0x87d1[_0x2f8960];return _0x4612c5;};'use strict';var _=require(_0x187d('0x0'));var util=require('util');var moment=require(_0x187d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x187d('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x187d('0x3'));var jayson=require('jayson/promise');var client=jayson['client'][_0x187d('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x21a3a4,_0x1628f5,_0xe8fb8c){return new BPromise(function(_0x22a600,_0x379702){return client[_0x187d('0x5')](_0x21a3a4,_0xe8fb8c)['then'](function(_0x37f337){logger[_0x187d('0x6')](_0x187d('0x7'),_0x1628f5,_0x187d('0x8'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1628f5,_0x187d('0x8'),JSON['stringify'](_0x37f337));if(_0x37f337[_0x187d('0x9')]){if(_0x37f337[_0x187d('0x9')]['code']===0x1f4){logger[_0x187d('0x9')](_0x187d('0x7'),_0x1628f5,_0x37f337[_0x187d('0x9')][_0x187d('0xa')]);return _0x379702(_0x37f337[_0x187d('0x9')][_0x187d('0xa')]);}logger[_0x187d('0x9')](_0x187d('0x7'),_0x1628f5,_0x37f337['error'][_0x187d('0xa')]);return _0x22a600(_0x37f337[_0x187d('0x9')]['message']);}else{logger['info'](_0x187d('0x7'),_0x1628f5,_0x187d('0x8'));_0x22a600(_0x37f337[_0x187d('0xb')]['message']);}})[_0x187d('0xc')](function(_0x496b68){logger[_0x187d('0x9')](_0x187d('0x7'),_0x1628f5,_0x496b68);_0x379702(_0x496b68);});});}
\ No newline at end of file
index 43ebf9d..7df64c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ff=['delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x279e91,_0x5c8f98){var _0x23f66c=function(_0x53e27){while(--_0x53e27){_0x279e91['push'](_0x279e91['shift']());}};_0x23f66c(++_0x5c8f98);}(_0x02ff,0x6c));var _0xf02f=function(_0x564b1d,_0x57806d){_0x564b1d=_0x564b1d-0x0;var _0x8a5d8=_0x02ff[_0x564b1d];return _0x8a5d8;};'use strict';var multer=require(_0xf02f('0x0'));var util=require(_0xf02f('0x1'));var path=require('path');var timeout=require(_0xf02f('0x2'));var express=require(_0xf02f('0x3'));var router=express[_0xf02f('0x4')]();var fs_extra=require(_0xf02f('0x5'));var auth=require(_0xf02f('0x6'));var interaction=require(_0xf02f('0x7'));var config=require(_0xf02f('0x8'));var controller=require(_0xf02f('0x9'));router['get']('/',auth[_0xf02f('0xa')](),controller[_0xf02f('0xb')]);router[_0xf02f('0xc')](_0xf02f('0xd'),auth[_0xf02f('0xa')](),controller['show']);router[_0xf02f('0xe')]('/',auth[_0xf02f('0xa')](),controller[_0xf02f('0xf')]);router[_0xf02f('0x10')](_0xf02f('0xd'),auth[_0xf02f('0xa')](),controller[_0xf02f('0x11')]);router[_0xf02f('0x12')](_0xf02f('0xd'),auth[_0xf02f('0xa')](),controller[_0xf02f('0x13')]);module[_0xf02f('0x14')]=router;
\ No newline at end of file
+var _0x301e=['show','post','create','put','update','delete','/:id','exports','multer','path','express','Router','fs-extra','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get'];(function(_0x101d4e,_0x523610){var _0x185468=function(_0x595091){while(--_0x595091){_0x101d4e['push'](_0x101d4e['shift']());}};_0x185468(++_0x523610);}(_0x301e,0xce));var _0xe301=function(_0x220fa3,_0x4c718c){_0x220fa3=_0x220fa3-0x0;var _0x37449c=_0x301e[_0x220fa3];return _0x37449c;};'use strict';var multer=require(_0xe301('0x0'));var util=require('util');var path=require(_0xe301('0x1'));var timeout=require('connect-timeout');var express=require(_0xe301('0x2'));var router=express[_0xe301('0x3')]();var fs_extra=require(_0xe301('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe301('0x5'));var controller=require(_0xe301('0x6'));router['get']('/',auth[_0xe301('0x7')](),controller[_0xe301('0x8')]);router[_0xe301('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe301('0xa')]);router[_0xe301('0xb')]('/',auth[_0xe301('0x7')](),controller[_0xe301('0xc')]);router[_0xe301('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xe301('0xe')]);router[_0xe301('0xf')](_0xe301('0x10'),auth[_0xe301('0x7')](),controller['destroy']);module[_0xe301('0x11')]=router;
\ No newline at end of file
index 95b0e79..0a34747 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30f9=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','exports'];(function(_0x5af7a9,_0x18517e){var _0x417b17=function(_0x52fd8f){while(--_0x52fd8f){_0x5af7a9['push'](_0x5af7a9['shift']());}};_0x417b17(++_0x18517e);}(_0x30f9,0x18b));var _0x930f=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0x30f9[_0x5df25b];return _0x19f252;};'use strict';var Sequelize=require('sequelize');module[_0x930f('0x0')]={'type':{'type':Sequelize['ENUM'](_0x930f('0x1'),_0x930f('0x2'),_0x930f('0x3'),_0x930f('0x4'),_0x930f('0x5')),'defaultValue':_0x930f('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x930f('0x6')]},'keyType':{'type':Sequelize[_0x930f('0x7')](_0x930f('0x1'),'variable',_0x930f('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x930f('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x930f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x930f('0x6')]}};
\ No newline at end of file
+var _0x34be=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x33c4d8,_0x475412){var _0x3bbfe4=function(_0xb85a87){while(--_0xb85a87){_0x33c4d8['push'](_0x33c4d8['shift']());}};_0x3bbfe4(++_0x475412);}(_0x34be,0xd3));var _0xe34b=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0x34be[_0x1b8f5a];return _0x594189;};'use strict';var Sequelize=require(_0xe34b('0x0'));module[_0xe34b('0x1')]={'type':{'type':Sequelize[_0xe34b('0x2')](_0xe34b('0x3'),_0xe34b('0x4'),_0xe34b('0x5'),_0xe34b('0x6'),_0xe34b('0x7')),'defaultValue':_0xe34b('0x3')},'content':{'type':Sequelize[_0xe34b('0x8')]},'key':{'type':Sequelize[_0xe34b('0x8')]},'keyType':{'type':Sequelize[_0xe34b('0x2')]('string','variable',_0xe34b('0x5'))},'keyContent':{'type':Sequelize[_0xe34b('0x8')]},'idField':{'type':Sequelize[_0xe34b('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xe34b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe34b('0x8')]}};
\ No newline at end of file
index c6d6d09..37ba78d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1339=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','FreshdeskField','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xbec8e6,_0x2841b5){var _0x4aa6f2=function(_0x583a0a){while(--_0x583a0a){_0xbec8e6['push'](_0xbec8e6['shift']());}};_0x4aa6f2(++_0x2841b5);}(_0x1339,0x1ed));var _0x9133=function(_0x306ab0,_0x30092a){_0x306ab0=_0x306ab0-0x0;var _0x474c68=_0x1339[_0x306ab0];return _0x474c68;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};
\ No newline at end of file
+var _0x76dc=['body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','FreshdeskField','includeAll','include','rows','params','options','find','catch','create'];(function(_0x2c9278,_0x558321){var _0x12bd28=function(_0xc63eb8){while(--_0xc63eb8){_0x2c9278['push'](_0x2c9278['shift']());}};_0x12bd28(++_0x558321);}(_0x76dc,0x1f2));var _0xc76d=function(_0x5f4952,_0x1a31f4){_0x5f4952=_0x5f4952-0x0;var _0x2e54a1=_0x76dc[_0x5f4952];return _0x2e54a1;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require('request-promise');var moment=require(_0xc76d('0x4'));var BPromise=require(_0xc76d('0x5'));var Mustache=require('mustache');var util=require(_0xc76d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc76d('0x7'));var ejs=require(_0xc76d('0x8'));var fs=require('fs');var fs_extra=require(_0xc76d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc76d('0xa'));var jsforce=require(_0xc76d('0xb'));var deskjs=require(_0xc76d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc76d('0xd'));var Redis=require(_0xc76d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc76d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc76d('0x10'));var logger=require(_0xc76d('0x11'))(_0xc76d('0x12'));var utils=require(_0xc76d('0x13'));var config=require(_0xc76d('0x14'));var licenseUtil=require(_0xc76d('0x15'));var db=require(_0xc76d('0x16'))['db'];function respondWithStatusCode(_0x2e02e9,_0x1722b3){_0x1722b3=_0x1722b3||0xcc;return function(_0x311814){if(_0x311814){return _0x2e02e9[_0xc76d('0x17')](_0x1722b3);}return _0x2e02e9[_0xc76d('0x18')](_0x1722b3)[_0xc76d('0x19')]();};}function respondWithResult(_0x3ed1bd,_0x5cda20){_0x5cda20=_0x5cda20||0xc8;return function(_0x8696db){if(_0x8696db){return _0x3ed1bd[_0xc76d('0x18')](_0x5cda20)['json'](_0x8696db);}};}function respondWithFilteredResult(_0x4741a4,_0x2d23d2){return function(_0x47a4ee){if(_0x47a4ee){var _0x6f94e=typeof _0x2d23d2['offset']===_0xc76d('0x1a')&&typeof _0x2d23d2['limit']==='undefined';var _0x45a83e=_0x47a4ee[_0xc76d('0x1b')];var _0x339623=_0x6f94e?0x0:_0x2d23d2[_0xc76d('0x1c')];var _0xd1d16f=_0x6f94e?_0x47a4ee['count']:_0x2d23d2[_0xc76d('0x1c')]+_0x2d23d2[_0xc76d('0x1d')];var _0xa0c5b6;if(_0xd1d16f>=_0x45a83e){_0xd1d16f=_0x45a83e;_0xa0c5b6=0xc8;}else{_0xa0c5b6=0xce;}_0x4741a4[_0xc76d('0x18')](_0xa0c5b6);return _0x4741a4[_0xc76d('0x1e')]('Content-Range',_0x339623+'-'+_0xd1d16f+'/'+_0x45a83e)[_0xc76d('0x1f')](_0x47a4ee);}return null;};}function patchUpdates(_0x324db7){return function(_0x5dffde){try{jsonpatch[_0xc76d('0x20')](_0x5dffde,_0x324db7,!![]);}catch(_0x777f22){return BPromise[_0xc76d('0x21')](_0x777f22);}return _0x5dffde[_0xc76d('0x22')]();};}function saveUpdates(_0x18f546,_0x3d357b){return function(_0x42b89c){if(_0x42b89c){return _0x42b89c[_0xc76d('0x23')](_0x18f546)[_0xc76d('0x24')](function(_0x20e09c){return _0x20e09c;});}return null;};}function removeEntity(_0x15328d,_0x5de11f){return function(_0x11b42f){if(_0x11b42f){return _0x11b42f[_0xc76d('0x25')]()['then'](function(){_0x15328d[_0xc76d('0x18')](0xcc)[_0xc76d('0x19')]();});}};}function handleEntityNotFound(_0x55ca79,_0x374b9e){return function(_0x476aee){if(!_0x476aee){_0x55ca79[_0xc76d('0x17')](0x194);}return _0x476aee;};}function handleError(_0xd1dda0,_0xfc4aea){_0xfc4aea=_0xfc4aea||0x1f4;return function(_0x1949c4){logger[_0xc76d('0x26')](_0x1949c4['stack']);if(_0x1949c4['name']){delete _0x1949c4[_0xc76d('0x27')];}_0xd1dda0[_0xc76d('0x18')](_0xfc4aea)['send'](_0x1949c4);};}exports[_0xc76d('0x28')]=function(_0x52a79a,_0x64899f){var _0x49fa89={},_0x2039f4={},_0x5cf2e4={'count':0x0,'rows':[]};var _0x13b468=_[_0xc76d('0x29')](db['FreshdeskField'][_0xc76d('0x2a')],function(_0x1c68f3){return{'name':_0x1c68f3[_0xc76d('0x2b')],'type':_0x1c68f3[_0xc76d('0x2c')]['key']};});_0x2039f4[_0xc76d('0x2d')]=_['map'](_0x13b468,_0xc76d('0x27'));_0x2039f4['query']=_[_0xc76d('0x2e')](_0x52a79a[_0xc76d('0x2f')]);_0x2039f4['filters']=_['intersection'](_0x2039f4['model'],_0x2039f4['query']);_0x49fa89[_0xc76d('0x30')]=_[_0xc76d('0x31')](_0x2039f4[_0xc76d('0x2d')],qs[_0xc76d('0x32')](_0x52a79a[_0xc76d('0x2f')]['fields']));_0x49fa89[_0xc76d('0x30')]=_0x49fa89['attributes'][_0xc76d('0x33')]?_0x49fa89['attributes']:_0x2039f4[_0xc76d('0x2d')];if(!_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x34')](_0xc76d('0x35'))){_0x49fa89[_0xc76d('0x1d')]=qs['limit'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1d')]);_0x49fa89[_0xc76d('0x1c')]=qs['offset'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x1c')]);}_0x49fa89[_0xc76d('0x36')]=qs['sort'](_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x37')]);_0x49fa89[_0xc76d('0x38')]=qs[_0xc76d('0x39')](_[_0xc76d('0x3a')](_0x52a79a[_0xc76d('0x2f')],_0x2039f4['filters']),_0x13b468);if(_0x52a79a['query'][_0xc76d('0x3b')]){_0x49fa89['where']=_[_0xc76d('0x3c')](_0x49fa89[_0xc76d('0x38')],{'$or':_[_0xc76d('0x29')](_0x13b468,function(_0x1925a1){if(_0x1925a1['type']!=='VIRTUAL'){var _0xc907eb={};_0xc907eb[_0x1925a1[_0xc76d('0x27')]]={'$like':'%'+_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3b')]+'%'};return _0xc907eb;}})});}_0x49fa89=_[_0xc76d('0x3c')]({},_0x49fa89,_0x52a79a['options']);var _0x42404c={'where':_0x49fa89[_0xc76d('0x38')]};return db[_0xc76d('0x3d')][_0xc76d('0x1b')](_0x42404c)[_0xc76d('0x24')](function(_0x78e14a){_0x5cf2e4[_0xc76d('0x1b')]=_0x78e14a;if(_0x52a79a[_0xc76d('0x2f')][_0xc76d('0x3e')]){_0x49fa89[_0xc76d('0x3f')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x49fa89);})[_0xc76d('0x24')](function(_0x2a0759){_0x5cf2e4[_0xc76d('0x40')]=_0x2a0759;return _0x5cf2e4;})[_0xc76d('0x24')](respondWithFilteredResult(_0x64899f,_0x49fa89))['catch'](handleError(_0x64899f,null));};exports['show']=function(_0x45be72,_0x13a895){var _0x3e471e={'raw':!![],'where':{'id':_0x45be72[_0xc76d('0x41')]['id']}},_0x15eb42={};_0x15eb42[_0xc76d('0x2d')]=_[_0xc76d('0x2e')](db[_0xc76d('0x3d')]['rawAttributes']);_0x15eb42[_0xc76d('0x2f')]=_[_0xc76d('0x2e')](_0x45be72[_0xc76d('0x2f')]);_0x15eb42[_0xc76d('0x39')]=_['intersection'](_0x15eb42['model'],_0x15eb42['query']);_0x3e471e['attributes']=_['intersection'](_0x15eb42['model'],qs['fields'](_0x45be72[_0xc76d('0x2f')][_0xc76d('0x32')]));_0x3e471e[_0xc76d('0x30')]=_0x3e471e[_0xc76d('0x30')][_0xc76d('0x33')]?_0x3e471e[_0xc76d('0x30')]:_0x15eb42[_0xc76d('0x2d')];if(_0x45be72[_0xc76d('0x2f')]['includeAll']){_0x3e471e[_0xc76d('0x3f')]=[{'all':!![]}];}_0x3e471e=_[_0xc76d('0x3c')]({},_0x3e471e,_0x45be72[_0xc76d('0x42')]);return db[_0xc76d('0x3d')][_0xc76d('0x43')](_0x3e471e)[_0xc76d('0x24')](handleEntityNotFound(_0x13a895,null))[_0xc76d('0x24')](respondWithResult(_0x13a895,null))[_0xc76d('0x44')](handleError(_0x13a895,null));};exports[_0xc76d('0x45')]=function(_0x4fb26e,_0x5b41d3){return db[_0xc76d('0x3d')][_0xc76d('0x45')](_0x4fb26e[_0xc76d('0x46')],{})[_0xc76d('0x24')](respondWithResult(_0x5b41d3,0xc9))[_0xc76d('0x44')](handleError(_0x5b41d3,null));};exports['update']=function(_0x25fc9d,_0x1ede13){if(_0x25fc9d['body']['id']){delete _0x25fc9d['body']['id'];}return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25fc9d['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x1ede13,null))[_0xc76d('0x24')](saveUpdates(_0x25fc9d[_0xc76d('0x46')],null))[_0xc76d('0x24')](respondWithResult(_0x1ede13,null))[_0xc76d('0x44')](handleError(_0x1ede13,null));};exports[_0xc76d('0x25')]=function(_0x25a549,_0x10b1b0){return db[_0xc76d('0x3d')][_0xc76d('0x43')]({'where':{'id':_0x25a549['params']['id']}})[_0xc76d('0x24')](handleEntityNotFound(_0x10b1b0,null))[_0xc76d('0x24')](removeEntity(_0x10b1b0,null))[_0xc76d('0x44')](handleError(_0x10b1b0,null));};
\ No newline at end of file
index d188e49..8f71a57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe284=['../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b7edf,_0x2ad98b){var _0x237aac=function(_0xdfdff1){while(--_0xdfdff1){_0x5b7edf['push'](_0x5b7edf['shift']());}};_0x237aac(++_0x2ad98b);}(_0xe284,0x1c8));var _0x4e28=function(_0xf73390,_0x14c109){_0xf73390=_0xf73390-0x0;var _0x4b212f=_0xe284[_0xf73390];return _0x4b212f;};'use strict';var _=require(_0x4e28('0x0'));var util=require(_0x4e28('0x1'));var logger=require(_0x4e28('0x2'))(_0x4e28('0x3'));var moment=require(_0x4e28('0x4'));var BPromise=require(_0x4e28('0x5'));var rp=require(_0x4e28('0x6'));var fs=require('fs');var path=require(_0x4e28('0x7'));var rimraf=require('rimraf');var config=require(_0x4e28('0x8'));var attributes=require(_0x4e28('0x9'));module[_0x4e28('0xa')]=function(_0x41e387,_0x1dbe29){return _0x41e387[_0x4e28('0xb')](_0x4e28('0xc'),attributes,{'tableName':_0x4e28('0xd'),'paranoid':![],'indexes':[{'name':_0x4e28('0xe'),'fields':[_0x4e28('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd6cb=['../../config/logger','api','bluebird','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash'];(function(_0x5b3a7f,_0x45d636){var _0x54b970=function(_0x1c010e){while(--_0x1c010e){_0x5b3a7f['push'](_0x5b3a7f['shift']());}};_0x54b970(++_0x45d636);}(_0xd6cb,0x16b));var _0xbd6c=function(_0x52074a,_0x286c9e){_0x52074a=_0x52074a-0x0;var _0x2f49ae=_0xd6cb[_0x52074a];return _0x2f49ae;};'use strict';var _=require(_0xbd6c('0x0'));var util=require('util');var logger=require(_0xbd6c('0x1'))(_0xbd6c('0x2'));var moment=require('moment');var BPromise=require(_0xbd6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbd6c('0x4'));var config=require(_0xbd6c('0x5'));var attributes=require(_0xbd6c('0x6'));module[_0xbd6c('0x7')]=function(_0x314ee0,_0x2d0f9a){return _0x314ee0[_0xbd6c('0x8')](_0xbd6c('0x9'),attributes,{'tableName':_0xbd6c('0xa'),'paranoid':![],'indexes':[{'name':_0xbd6c('0xb'),'fields':['idField',_0xbd6c('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index aedcdaf..a34b510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bbf=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x4bbf,0x14f));var _0xf4bb=function(_0x5d71f3,_0x2f4622){_0x5d71f3=_0x5d71f3-0x0;var _0x92fd85=_0x4bbf[_0x5d71f3];return _0x92fd85;};'use strict';var _=require(_0xf4bb('0x0'));var util=require(_0xf4bb('0x1'));var moment=require(_0xf4bb('0x2'));var BPromise=require(_0xf4bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4bb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4bb('0x5'));var logger=require(_0xf4bb('0x6'))(_0xf4bb('0x7'));var config=require(_0xf4bb('0x8'));var jayson=require(_0xf4bb('0x9'));var client=jayson['client'][_0xf4bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2aded2,_0x39b3cc,_0x2ac236){return new BPromise(function(_0xd59a57,_0x5b58b7){return client['request'](_0x2aded2,_0x2ac236)['then'](function(_0x2fb31d){logger[_0xf4bb('0xb')](_0xf4bb('0xc'),_0x39b3cc,_0xf4bb('0xd'));logger[_0xf4bb('0xe')](_0xf4bb('0xf'),_0x39b3cc,_0xf4bb('0xd'),JSON[_0xf4bb('0x10')](_0x2fb31d));if(_0x2fb31d[_0xf4bb('0x11')]){if(_0x2fb31d[_0xf4bb('0x11')][_0xf4bb('0x12')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x39b3cc,_0x2fb31d[_0xf4bb('0x11')]['message']);return _0x5b58b7(_0x2fb31d['error'][_0xf4bb('0x13')]);}logger[_0xf4bb('0x11')](_0xf4bb('0xc'),_0x39b3cc,_0x2fb31d[_0xf4bb('0x11')][_0xf4bb('0x13')]);return _0xd59a57(_0x2fb31d[_0xf4bb('0x11')]['message']);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x39b3cc,_0xf4bb('0xd'));_0xd59a57(_0x2fb31d[_0xf4bb('0x14')][_0xf4bb('0x13')]);}})['catch'](function(_0x1416b0){logger[_0xf4bb('0x11')](_0xf4bb('0xc'),_0x39b3cc,_0x1416b0);_0x5b58b7(_0x1416b0);});});}
\ No newline at end of file
+var _0xae90=['http','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xae90,0x116));var _0x0ae9=function(_0xed27f6,_0x281caa){_0xed27f6=_0xed27f6-0x0;var _0x42c91e=_0xae90[_0xed27f6];return _0x42c91e;};'use strict';var _=require(_0x0ae9('0x0'));var util=require(_0x0ae9('0x1'));var moment=require(_0x0ae9('0x2'));var BPromise=require(_0x0ae9('0x3'));var rs=require(_0x0ae9('0x4'));var fs=require('fs');var Redis=require(_0x0ae9('0x5'));var db=require(_0x0ae9('0x6'))['db'];var utils=require(_0x0ae9('0x7'));var logger=require(_0x0ae9('0x8'))(_0x0ae9('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0ae9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf249,_0x593432,_0x3e89ee){return new BPromise(function(_0x5ea3bd,_0x23622b){return client[_0x0ae9('0xb')](_0x2bf249,_0x3e89ee)[_0x0ae9('0xc')](function(_0x3dac0d){logger[_0x0ae9('0xd')](_0x0ae9('0xe'),_0x593432,_0x0ae9('0xf'));logger[_0x0ae9('0x10')](_0x0ae9('0x11'),_0x593432,'request\x20sent',JSON[_0x0ae9('0x12')](_0x3dac0d));if(_0x3dac0d['error']){if(_0x3dac0d['error'][_0x0ae9('0x13')]===0x1f4){logger[_0x0ae9('0x14')](_0x0ae9('0xe'),_0x593432,_0x3dac0d[_0x0ae9('0x14')][_0x0ae9('0x15')]);return _0x23622b(_0x3dac0d[_0x0ae9('0x14')][_0x0ae9('0x15')]);}logger[_0x0ae9('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x593432,_0x3dac0d[_0x0ae9('0x14')][_0x0ae9('0x15')]);return _0x5ea3bd(_0x3dac0d['error']['message']);}else{logger['info'](_0x0ae9('0xe'),_0x593432,'request\x20sent');_0x5ea3bd(_0x3dac0d[_0x0ae9('0x16')][_0x0ae9('0x15')]);}})[_0x0ae9('0x17')](function(_0x417ea2){logger[_0x0ae9('0x14')]('FreshdeskField,\x20%s,\x20%s',_0x593432,_0x417ea2);_0x23622b(_0x417ea2);});});}
\ No newline at end of file
index b346de4..46eb0c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb58b=['Router','fs-extra','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x8e927b,_0x480499){var _0xb50692=function(_0x1371ff){while(--_0x1371ff){_0x8e927b['push'](_0x8e927b['shift']());}};_0xb50692(++_0x480499);}(_0xb58b,0x1f1));var _0xbb58=function(_0xf85836,_0x4a89f2){_0xf85836=_0xf85836-0x0;var _0x163b3e=_0xb58b[_0xf85836];return _0x163b3e;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var fs_extra=require(_0xbb58('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbb58('0x5'));var config=require('../../config/environment');var controller=require(_0xbb58('0x6'));router[_0xbb58('0x7')]('/',auth[_0xbb58('0x8')](),controller['index']);router[_0xbb58('0x7')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0x7')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);router[_0xbb58('0x7')](_0xbb58('0xd'),auth[_0xbb58('0x8')](),controller['getFields']);router[_0xbb58('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb58('0xf')]);router[_0xbb58('0xe')](_0xbb58('0xb'),auth[_0xbb58('0x8')](),controller['addConfiguration']);router[_0xbb58('0x10')](_0xbb58('0x9'),auth['isAuthenticated'](),controller[_0xbb58('0x11')]);router[_0xbb58('0x12')](_0xbb58('0x9'),auth[_0xbb58('0x8')](),controller[_0xbb58('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x6f7a=['../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x243f79,_0x429e45){var _0x460321=function(_0x4feefc){while(--_0x4feefc){_0x243f79['push'](_0x243f79['shift']());}};_0x460321(++_0x429e45);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x5a050e,_0x5edf01){_0x5a050e=_0x5a050e-0x0;var _0x200714=_0x6f7a[_0x5a050e];return _0x200714;};'use strict';var multer=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var path=require(_0xa6f7('0x2'));var timeout=require(_0xa6f7('0x3'));var express=require('express');var router=express[_0xa6f7('0x4')]();var fs_extra=require(_0xa6f7('0x5'));var auth=require(_0xa6f7('0x6'));var interaction=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var controller=require(_0xa6f7('0x9'));router[_0xa6f7('0xa')]('/',auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xc')]);router[_0xa6f7('0xa')](_0xa6f7('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xa6f7('0xa')](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0xf')]);router[_0xa6f7('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa6f7('0x10')]);router[_0xa6f7('0x11')]('/',auth['isAuthenticated'](),controller[_0xa6f7('0x12')]);router['post'](_0xa6f7('0xe'),auth[_0xa6f7('0xb')](),controller[_0xa6f7('0x13')]);router[_0xa6f7('0x14')]('/:id',auth[_0xa6f7('0xb')](),controller['update']);router[_0xa6f7('0x15')](_0xa6f7('0xd'),auth[_0xa6f7('0xb')](),controller['destroy']);module[_0xa6f7('0x16')]=router;
\ No newline at end of file
index 36c547a..45b2f64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2e27c6,_0x349f2f){var _0x307f7c=function(_0x11f49a){while(--_0x11f49a){_0x2e27c6['push'](_0x2e27c6['shift']());}};_0x307f7c(++_0x349f2f);}(_0xd117,0x182));var _0x7d11=function(_0x597c16,_0x2292fe){_0x597c16=_0x597c16-0x0;var _0x30cc2c=_0xd117[_0x597c16];return _0x30cc2c;};'use strict';var Sequelize=require(_0x7d11('0x0'));module[_0x7d11('0x1')]={'name':{'type':Sequelize[_0x7d11('0x2')]},'description':{'type':Sequelize[_0x7d11('0x2')]},'username':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x3')},'apiKey':{'type':Sequelize[_0x7d11('0x2')]},'remoteUri':{'type':Sequelize[_0x7d11('0x2')],'unique':_0x7d11('0x4')},'serverUrl':{'type':Sequelize[_0x7d11('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x5f2f=['exports','STRING','username','sequelize'];(function(_0x1bc7f0,_0x324b0f){var _0x42f3d6=function(_0x2a2cb7){while(--_0x2a2cb7){_0x1bc7f0['push'](_0x1bc7f0['shift']());}};_0x42f3d6(++_0x324b0f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3599c0,_0x4265f4){_0x3599c0=_0x3599c0-0x0;var _0x2a8c9c=_0x5f2f[_0x3599c0];return _0x2a8c9c;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'apiKey':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize[_0xf5f2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index d09e5c8..d64e8ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b5d=['name','send','index','map','FreshsalesAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','includeAll','options','create','find','params','body','getConfigurations','findOne','FreshsalesConfiguration','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields','username','remoteUri','apiKey','slice','lastIndexOf','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x18ebcb,_0x4e6397){var _0x28f014=function(_0x422ff3){while(--_0x422ff3){_0x18ebcb['push'](_0x18ebcb['shift']());}};_0x28f014(++_0x4e6397);}(_0x0b5d,0x1e2));var _0xd0b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b5d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd0b5('0x0'));var rimraf=require(_0xd0b5('0x1'));var zipdir=require(_0xd0b5('0x2'));var jsonpatch=require(_0xd0b5('0x3'));var rp=require(_0xd0b5('0x4'));var moment=require(_0xd0b5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd0b5('0x6'));var util=require(_0xd0b5('0x7'));var path=require(_0xd0b5('0x8'));var sox=require(_0xd0b5('0x9'));var csv=require(_0xd0b5('0xa'));var ejs=require(_0xd0b5('0xb'));var fs=require('fs');var fs_extra=require(_0xd0b5('0xc'));var _=require(_0xd0b5('0xd'));var squel=require(_0xd0b5('0xe'));var crypto=require('crypto');var jsforce=require(_0xd0b5('0xf'));var deskjs=require(_0xd0b5('0x10'));var toCsv=require(_0xd0b5('0xa'));var querystring=require(_0xd0b5('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd0b5('0x12'));var qs=require(_0xd0b5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0b5('0x14'));var logger=require(_0xd0b5('0x15'))(_0xd0b5('0x16'));var utils=require(_0xd0b5('0x17'));var config=require(_0xd0b5('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0b5('0x19'))['db'];var integrations=require(_0xd0b5('0x1a'));function respondWithStatusCode(_0x5ed3b3,_0x29b26f){_0x29b26f=_0x29b26f||0xcc;return function(_0x3ba307){if(_0x3ba307){return _0x5ed3b3[_0xd0b5('0x1b')](_0x29b26f);}return _0x5ed3b3['status'](_0x29b26f)[_0xd0b5('0x1c')]();};}function respondWithResult(_0x2c6963,_0x512c1a){_0x512c1a=_0x512c1a||0xc8;return function(_0x3ac8a0){if(_0x3ac8a0){return _0x2c6963['status'](_0x512c1a)['json'](_0x3ac8a0);}};}function respondWithFilteredResult(_0x540344,_0x1d236c){return function(_0xfcb59e){if(_0xfcb59e){var _0x3c959f=typeof _0x1d236c[_0xd0b5('0x1d')]===_0xd0b5('0x1e')&&typeof _0x1d236c[_0xd0b5('0x1f')]===_0xd0b5('0x1e');var _0x4a8f21=_0xfcb59e[_0xd0b5('0x20')];var _0x21aa7d=_0x3c959f?0x0:_0x1d236c[_0xd0b5('0x1d')];var _0x3ff667=_0x3c959f?_0xfcb59e[_0xd0b5('0x20')]:_0x1d236c[_0xd0b5('0x1d')]+_0x1d236c['limit'];var _0x3fbef9;if(_0x3ff667>=_0x4a8f21){_0x3ff667=_0x4a8f21;_0x3fbef9=0xc8;}else{_0x3fbef9=0xce;}_0x540344[_0xd0b5('0x21')](_0x3fbef9);return _0x540344[_0xd0b5('0x22')](_0xd0b5('0x23'),_0x21aa7d+'-'+_0x3ff667+'/'+_0x4a8f21)[_0xd0b5('0x24')](_0xfcb59e);}return null;};}function patchUpdates(_0x2ea1cf){return function(_0x2d6a68){try{jsonpatch[_0xd0b5('0x25')](_0x2d6a68,_0x2ea1cf,!![]);}catch(_0x4abc75){return BPromise[_0xd0b5('0x26')](_0x4abc75);}return _0x2d6a68[_0xd0b5('0x27')]();};}function saveUpdates(_0x124bf3,_0x4bdf7b){return function(_0x13ca14){if(_0x13ca14){return _0x13ca14[_0xd0b5('0x28')](_0x124bf3)[_0xd0b5('0x29')](function(_0x33960a){return _0x33960a;});}return null;};}function removeEntity(_0x3b0440,_0x82cb81){return function(_0xe00686){if(_0xe00686){return _0xe00686[_0xd0b5('0x2a')]()[_0xd0b5('0x29')](function(){_0x3b0440['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d3f51,_0x55c307){return function(_0x2c3525){if(!_0x2c3525){_0x4d3f51[_0xd0b5('0x1b')](0x194);}return _0x2c3525;};}function handleError(_0x2ec081,_0xac6aaa){_0xac6aaa=_0xac6aaa||0x1f4;return function(_0x3c6055){logger['error'](_0x3c6055['stack']);if(_0x3c6055['name']){delete _0x3c6055[_0xd0b5('0x2b')];}_0x2ec081[_0xd0b5('0x21')](_0xac6aaa)[_0xd0b5('0x2c')](_0x3c6055);};}exports[_0xd0b5('0x2d')]=function(_0x234b97,_0x234179){var _0x574db9={},_0x55b028={},_0x21f95a={'count':0x0,'rows':[]};var _0x547a56=_[_0xd0b5('0x2e')](db[_0xd0b5('0x2f')][_0xd0b5('0x30')],function(_0x33dbbf){return{'name':_0x33dbbf['fieldName'],'type':_0x33dbbf[_0xd0b5('0x31')][_0xd0b5('0x32')]};});_0x55b028[_0xd0b5('0x33')]=_[_0xd0b5('0x2e')](_0x547a56,_0xd0b5('0x2b'));_0x55b028[_0xd0b5('0x34')]=_[_0xd0b5('0x35')](_0x234b97[_0xd0b5('0x34')]);_0x55b028[_0xd0b5('0x36')]=_[_0xd0b5('0x37')](_0x55b028['model'],_0x55b028[_0xd0b5('0x34')]);_0x574db9[_0xd0b5('0x38')]=_[_0xd0b5('0x37')](_0x55b028[_0xd0b5('0x33')],qs[_0xd0b5('0x39')](_0x234b97[_0xd0b5('0x34')][_0xd0b5('0x39')]));_0x574db9['attributes']=_0x574db9['attributes'][_0xd0b5('0x3a')]?_0x574db9[_0xd0b5('0x38')]:_0x55b028[_0xd0b5('0x33')];if(!_0x234b97['query'][_0xd0b5('0x3b')]('nolimit')){_0x574db9[_0xd0b5('0x1f')]=qs[_0xd0b5('0x1f')](_0x234b97[_0xd0b5('0x34')]['limit']);_0x574db9[_0xd0b5('0x1d')]=qs[_0xd0b5('0x1d')](_0x234b97[_0xd0b5('0x34')][_0xd0b5('0x1d')]);}_0x574db9['order']=qs[_0xd0b5('0x3c')](_0x234b97[_0xd0b5('0x34')][_0xd0b5('0x3c')]);_0x574db9[_0xd0b5('0x3d')]=qs['filters'](_[_0xd0b5('0x3e')](_0x234b97['query'],_0x55b028['filters']),_0x547a56);if(_0x234b97[_0xd0b5('0x34')][_0xd0b5('0x3f')]){_0x574db9[_0xd0b5('0x3d')]=_[_0xd0b5('0x40')](_0x574db9[_0xd0b5('0x3d')],{'$or':_[_0xd0b5('0x2e')](_0x547a56,function(_0x15dcc7){if(_0x15dcc7[_0xd0b5('0x31')]!==_0xd0b5('0x41')){var _0x412c46={};_0x412c46[_0x15dcc7['name']]={'$like':'%'+_0x234b97[_0xd0b5('0x34')]['filter']+'%'};return _0x412c46;}})});}_0x574db9=_[_0xd0b5('0x40')]({},_0x574db9,_0x234b97['options']);var _0x11bb09={'where':_0x574db9[_0xd0b5('0x3d')]};return db['FreshsalesAccount'][_0xd0b5('0x20')](_0x11bb09)[_0xd0b5('0x29')](function(_0x27e41c){_0x21f95a[_0xd0b5('0x20')]=_0x27e41c;if(_0x234b97['query']['includeAll']){_0x574db9[_0xd0b5('0x42')]=[{'all':!![]}];}return db[_0xd0b5('0x2f')][_0xd0b5('0x43')](_0x574db9);})[_0xd0b5('0x29')](function(_0x558904){_0x21f95a[_0xd0b5('0x44')]=_0x558904;return _0x21f95a;})[_0xd0b5('0x29')](respondWithFilteredResult(_0x234179,_0x574db9))[_0xd0b5('0x45')](handleError(_0x234179,null));};exports[_0xd0b5('0x46')]=function(_0x5a509e,_0x10d1ea){var _0x289d4e={'raw':![],'where':{'id':_0x5a509e['params']['id']}},_0x14cfb9={};_0x14cfb9[_0xd0b5('0x33')]=_[_0xd0b5('0x35')](db[_0xd0b5('0x2f')][_0xd0b5('0x30')]);_0x14cfb9[_0xd0b5('0x34')]=_['keys'](_0x5a509e[_0xd0b5('0x34')]);_0x14cfb9[_0xd0b5('0x36')]=_[_0xd0b5('0x37')](_0x14cfb9[_0xd0b5('0x33')],_0x14cfb9[_0xd0b5('0x34')]);_0x289d4e[_0xd0b5('0x38')]=_[_0xd0b5('0x37')](_0x14cfb9[_0xd0b5('0x33')],qs['fields'](_0x5a509e['query'][_0xd0b5('0x39')]));_0x289d4e['attributes']=_0x289d4e[_0xd0b5('0x38')][_0xd0b5('0x3a')]?_0x289d4e[_0xd0b5('0x38')]:_0x14cfb9[_0xd0b5('0x33')];if(_0x5a509e[_0xd0b5('0x34')][_0xd0b5('0x47')]){_0x289d4e[_0xd0b5('0x42')]=[{'all':!![]}];}_0x289d4e=_[_0xd0b5('0x40')]({},_0x289d4e,_0x5a509e[_0xd0b5('0x48')]);return db[_0xd0b5('0x2f')]['find'](_0x289d4e)[_0xd0b5('0x29')](handleEntityNotFound(_0x10d1ea,null))[_0xd0b5('0x29')](respondWithResult(_0x10d1ea,null))['catch'](handleError(_0x10d1ea,null));};exports[_0xd0b5('0x49')]=function(_0x545106,_0xd207de){return db[_0xd0b5('0x2f')][_0xd0b5('0x49')](_0x545106['body'],{})[_0xd0b5('0x29')](respondWithResult(_0xd207de,0xc9))[_0xd0b5('0x45')](handleError(_0xd207de,null));};exports[_0xd0b5('0x28')]=function(_0x18578b,_0x20d1bf){if(_0x18578b['body']['id']){delete _0x18578b['body']['id'];}return db[_0xd0b5('0x2f')][_0xd0b5('0x4a')]({'where':{'id':_0x18578b[_0xd0b5('0x4b')]['id']}})[_0xd0b5('0x29')](handleEntityNotFound(_0x20d1bf,null))[_0xd0b5('0x29')](saveUpdates(_0x18578b[_0xd0b5('0x4c')],null))[_0xd0b5('0x29')](respondWithResult(_0x20d1bf,null))[_0xd0b5('0x45')](handleError(_0x20d1bf,null));};exports[_0xd0b5('0x2a')]=function(_0x30f3cc,_0x36ced3){return db[_0xd0b5('0x2f')][_0xd0b5('0x4a')]({'where':{'id':_0x30f3cc['params']['id']}})[_0xd0b5('0x29')](handleEntityNotFound(_0x36ced3,null))['then'](removeEntity(_0x36ced3,null))[_0xd0b5('0x45')](handleError(_0x36ced3,null));};exports[_0xd0b5('0x4d')]=function(_0x5bc9d0,_0x271c68,_0x48d13c){var _0x45f63b={};var _0x4546d9={};var _0x3f595c;var _0x2a4f1b;return db['FreshsalesAccount'][_0xd0b5('0x4e')]({'where':{'id':_0x5bc9d0[_0xd0b5('0x4b')]['id']}})[_0xd0b5('0x29')](handleEntityNotFound(_0x271c68,null))[_0xd0b5('0x29')](function(_0x95dfa6){if(_0x95dfa6){_0x3f595c=_0x95dfa6;_0x4546d9[_0xd0b5('0x33')]=_[_0xd0b5('0x35')](db[_0xd0b5('0x4f')][_0xd0b5('0x30')]);_0x4546d9[_0xd0b5('0x34')]=_['keys'](_0x5bc9d0['query']);_0x4546d9[_0xd0b5('0x36')]=_[_0xd0b5('0x37')](_0x4546d9[_0xd0b5('0x33')],_0x4546d9['query']);_0x45f63b[_0xd0b5('0x38')]=_['intersection'](_0x4546d9[_0xd0b5('0x33')],qs[_0xd0b5('0x39')](_0x5bc9d0[_0xd0b5('0x34')][_0xd0b5('0x39')]));_0x45f63b[_0xd0b5('0x38')]=_0x45f63b['attributes'][_0xd0b5('0x3a')]?_0x45f63b['attributes']:_0x4546d9[_0xd0b5('0x33')];_0x45f63b['order']=qs['sort'](_0x5bc9d0[_0xd0b5('0x34')][_0xd0b5('0x3c')]);_0x45f63b[_0xd0b5('0x3d')]=qs[_0xd0b5('0x36')](_['pick'](_0x5bc9d0[_0xd0b5('0x34')],_0x4546d9[_0xd0b5('0x36')]));if(_0x5bc9d0[_0xd0b5('0x34')][_0xd0b5('0x3f')]){_0x45f63b['where']=_['merge'](_0x45f63b['where'],{'$or':_[_0xd0b5('0x2e')](_0x45f63b['attributes'],function(_0x5d4aed){var _0x25e438={};_0x25e438[_0x5d4aed]={'$like':'%'+_0x5bc9d0['query'][_0xd0b5('0x3f')]+'%'};return _0x25e438;})});}_0x45f63b=_[_0xd0b5('0x40')]({},_0x45f63b,_0x5bc9d0['options']);return _0x3f595c[_0xd0b5('0x4d')](_0x45f63b);}})[_0xd0b5('0x29')](function(_0x28b021){if(_0x28b021){_0x2a4f1b=_0x28b021[_0xd0b5('0x3a')];if(!_0x5bc9d0[_0xd0b5('0x34')][_0xd0b5('0x3b')](_0xd0b5('0x50'))){_0x45f63b[_0xd0b5('0x1f')]=qs[_0xd0b5('0x1f')](_0x5bc9d0[_0xd0b5('0x34')][_0xd0b5('0x1f')]);_0x45f63b[_0xd0b5('0x1d')]=qs[_0xd0b5('0x1d')](_0x5bc9d0['query'][_0xd0b5('0x1d')]);}return _0x3f595c[_0xd0b5('0x4d')](_0x45f63b);}})[_0xd0b5('0x29')](function(_0x403adf){if(_0x403adf){return _0x403adf?{'count':_0x2a4f1b,'rows':_0x403adf}:null;}})['then'](respondWithResult(_0x271c68,null))['catch'](handleError(_0x271c68,null));};exports['addConfiguration']=function(_0x2bd95c,_0x848363,_0x5bb5c6){if(_0x2bd95c[_0xd0b5('0x4c')]['id']){delete _0x2bd95c['body']['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x2bd95c['params']['id']}})[_0xd0b5('0x29')](handleEntityNotFound(_0x848363,null))[_0xd0b5('0x29')](function(_0x1d321c){if(_0x1d321c){_0x2bd95c[_0xd0b5('0x4c')][_0xd0b5('0x51')]=_0x1d321c['id'];_0x2bd95c['body'][_0xd0b5('0x52')]=integrations[_0xd0b5('0x53')](_0x2bd95c['body'][_0xd0b5('0x54')],_0x2bd95c[_0xd0b5('0x4c')][_0xd0b5('0x31')]);_0x2bd95c[_0xd0b5('0x4c')]['Descriptions']=integrations[_0xd0b5('0x55')](_0x2bd95c['body'][_0xd0b5('0x54')],_0x2bd95c['body'][_0xd0b5('0x31')]);return db[_0xd0b5('0x4f')][_0xd0b5('0x49')](_0x2bd95c[_0xd0b5('0x4c')],{'include':[{'model':db[_0xd0b5('0x56')],'as':_0xd0b5('0x52')},{'model':db[_0xd0b5('0x56')],'as':_0xd0b5('0x57')}]});}return null;})[_0xd0b5('0x29')](respondWithResult(_0x848363,null))[_0xd0b5('0x45')](handleError(_0x848363,null));};exports[_0xd0b5('0x58')]=function(_0x36b549,_0x53c8a8,_0x500ddf){var _0x1d1f16='';var _0x3f4d37='';return db['FreshsalesAccount'][_0xd0b5('0x4e')]({'where':{'id':_0x36b549['params']['id']},'attributes':['id',_0xd0b5('0x59'),_0xd0b5('0x5a'),_0xd0b5('0x5b')]})[_0xd0b5('0x29')](handleEntityNotFound(_0x53c8a8,null))[_0xd0b5('0x29')](function(_0x1bf76a){if(_0x1bf76a){_0x3f4d37=_0x1bf76a['username'];_0x1d1f16=_0x1bf76a['remoteUri'];var _0x56e5c8=_0x1bf76a[_0xd0b5('0x5a')][_0xd0b5('0x5c')](-0x1);if(_0x56e5c8==='/'){_0x1d1f16=_0x1d1f16['substring'](0x0,_0x1d1f16[_0xd0b5('0x5d')](_0x56e5c8));}return rp({'method':'GET','uri':util[_0xd0b5('0x5e')](_0xd0b5('0x5f'),_0x1d1f16,_0xd0b5('0x60')),'headers':{'Authorization':'Token\x20token='+_0x1bf76a[_0xd0b5('0x5b')]},'json':!![]});}})[_0xd0b5('0x29')](function(_0x574951){if(_0x574951){var _0x5daa4b=_0x574951[_0xd0b5('0x61')];var _0x768a80=![];var _0x49aed9=null;for(_0x49aed9=0x0;_0x49aed9<_0x5daa4b[_0xd0b5('0x3a')];_0x49aed9++){if(_0x5daa4b[_0x49aed9][_0xd0b5('0x62')]===_0x3f4d37){_0x768a80=!![];}}if(_0x768a80){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd0b5('0x63')});}}})[_0xd0b5('0x29')](respondWithResult(_0x53c8a8,null))['catch'](function(_0x3594ea){var _0x1c5796=_0x36b549[_0xd0b5('0x34')][_0xd0b5('0x64')]?0x1f4:_0x3594ea[_0xd0b5('0x65')]||0x1f4;logger['error'](_0xd0b5('0x66'),_0xd0b5('0x58'),_0x1c5796,JSON[_0xd0b5('0x67')](_0x3594ea));delete _0x3594ea[_0xd0b5('0x2b')];if(_0x1c5796===0x191){_0x1c5796=0x190;}_0x53c8a8[_0xd0b5('0x21')](_0x1c5796)[_0xd0b5('0x2c')](_0x36b549[_0xd0b5('0x34')][_0xd0b5('0x64')]?{'message':_0xd0b5('0x68'),'statusCode':_0x3594ea[_0xd0b5('0x65')]}:_0x3594ea);});};
\ No newline at end of file
+var _0x2acf=['request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','keys','query','model','intersection','fields','attributes','length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','show','params','include','find','create','body','catch','update','findOne','FreshsalesConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x576f72,_0x3779e7){var _0x29878d=function(_0x36d076){while(--_0x36d076){_0x576f72['push'](_0x576f72['shift']());}};_0x29878d(++_0x3779e7);}(_0x2acf,0x12f));var _0xf2ac=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x2acf[_0x320b8e];return _0x55a10a;};'use strict';var emlformat=require(_0xf2ac('0x0'));var rimraf=require(_0xf2ac('0x1'));var zipdir=require(_0xf2ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf2ac('0x3'));var moment=require('moment');var BPromise=require(_0xf2ac('0x4'));var Mustache=require(_0xf2ac('0x5'));var util=require(_0xf2ac('0x6'));var path=require('path');var sox=require(_0xf2ac('0x7'));var csv=require(_0xf2ac('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf2ac('0x9'));var crypto=require(_0xf2ac('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf2ac('0xb'));var Papa=require(_0xf2ac('0xc'));var Redis=require(_0xf2ac('0xd'));var authService=require(_0xf2ac('0xe'));var qs=require(_0xf2ac('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2ac('0x10'));var logger=require('../../config/logger')(_0xf2ac('0x11'));var utils=require(_0xf2ac('0x12'));var config=require(_0xf2ac('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x55c5bf,_0x21ffbb){_0x21ffbb=_0x21ffbb||0xcc;return function(_0x7121a8){if(_0x7121a8){return _0x55c5bf[_0xf2ac('0x14')](_0x21ffbb);}return _0x55c5bf[_0xf2ac('0x15')](_0x21ffbb)[_0xf2ac('0x16')]();};}function respondWithResult(_0x9a90d0,_0xf0e858){_0xf0e858=_0xf0e858||0xc8;return function(_0x36d1c2){if(_0x36d1c2){return _0x9a90d0[_0xf2ac('0x15')](_0xf0e858)[_0xf2ac('0x17')](_0x36d1c2);}};}function respondWithFilteredResult(_0x3aa515,_0x3a6664){return function(_0x17be2d){if(_0x17be2d){var _0x399bea=typeof _0x3a6664[_0xf2ac('0x18')]===_0xf2ac('0x19')&&typeof _0x3a6664[_0xf2ac('0x1a')]===_0xf2ac('0x19');var _0x54ca47=_0x17be2d['count'];var _0x263cc6=_0x399bea?0x0:_0x3a6664[_0xf2ac('0x18')];var _0x3be5ee=_0x399bea?_0x17be2d['count']:_0x3a6664[_0xf2ac('0x18')]+_0x3a6664[_0xf2ac('0x1a')];var _0x5e5bad;if(_0x3be5ee>=_0x54ca47){_0x3be5ee=_0x54ca47;_0x5e5bad=0xc8;}else{_0x5e5bad=0xce;}_0x3aa515[_0xf2ac('0x15')](_0x5e5bad);return _0x3aa515[_0xf2ac('0x1b')](_0xf2ac('0x1c'),_0x263cc6+'-'+_0x3be5ee+'/'+_0x54ca47)[_0xf2ac('0x17')](_0x17be2d);}return null;};}function patchUpdates(_0x4386b2){return function(_0x2ccfa3){try{jsonpatch[_0xf2ac('0x1d')](_0x2ccfa3,_0x4386b2,!![]);}catch(_0x1c95f8){return BPromise[_0xf2ac('0x1e')](_0x1c95f8);}return _0x2ccfa3[_0xf2ac('0x1f')]();};}function saveUpdates(_0x1a34be,_0x55411b){return function(_0x365070){if(_0x365070){return _0x365070['update'](_0x1a34be)[_0xf2ac('0x20')](function(_0x504bce){return _0x504bce;});}return null;};}function removeEntity(_0xd9d91a,_0x61b99f){return function(_0x22de71){if(_0x22de71){return _0x22de71[_0xf2ac('0x21')]()[_0xf2ac('0x20')](function(){_0xd9d91a[_0xf2ac('0x15')](0xcc)[_0xf2ac('0x16')]();});}};}function handleEntityNotFound(_0x4e8b45,_0x565c17){return function(_0x1ef361){if(!_0x1ef361){_0x4e8b45[_0xf2ac('0x14')](0x194);}return _0x1ef361;};}function handleError(_0x81c258,_0x2f8241){_0x2f8241=_0x2f8241||0x1f4;return function(_0xfc66bc){logger[_0xf2ac('0x22')](_0xfc66bc[_0xf2ac('0x23')]);if(_0xfc66bc[_0xf2ac('0x24')]){delete _0xfc66bc['name'];}_0x81c258[_0xf2ac('0x15')](_0x2f8241)[_0xf2ac('0x25')](_0xfc66bc);};}exports[_0xf2ac('0x26')]=function(_0xb67bce,_0x3e09e9){var _0x5cf3af={},_0x37375c={},_0x2cb812={'count':0x0,'rows':[]};var _0x5c963a=_[_0xf2ac('0x27')](db[_0xf2ac('0x28')][_0xf2ac('0x29')],function(_0x145a2b){return{'name':_0x145a2b[_0xf2ac('0x2a')],'type':_0x145a2b[_0xf2ac('0x2b')][_0xf2ac('0x2c')]};});_0x37375c['model']=_['map'](_0x5c963a,_0xf2ac('0x24'));_0x37375c['query']=_[_0xf2ac('0x2d')](_0xb67bce[_0xf2ac('0x2e')]);_0x37375c['filters']=_['intersection'](_0x37375c[_0xf2ac('0x2f')],_0x37375c[_0xf2ac('0x2e')]);_0x5cf3af['attributes']=_[_0xf2ac('0x30')](_0x37375c[_0xf2ac('0x2f')],qs[_0xf2ac('0x31')](_0xb67bce[_0xf2ac('0x2e')][_0xf2ac('0x31')]));_0x5cf3af[_0xf2ac('0x32')]=_0x5cf3af[_0xf2ac('0x32')][_0xf2ac('0x33')]?_0x5cf3af[_0xf2ac('0x32')]:_0x37375c[_0xf2ac('0x2f')];if(!_0xb67bce[_0xf2ac('0x2e')]['hasOwnProperty'](_0xf2ac('0x34'))){_0x5cf3af[_0xf2ac('0x1a')]=qs[_0xf2ac('0x1a')](_0xb67bce[_0xf2ac('0x2e')][_0xf2ac('0x1a')]);_0x5cf3af[_0xf2ac('0x18')]=qs[_0xf2ac('0x18')](_0xb67bce[_0xf2ac('0x2e')]['offset']);}_0x5cf3af['order']=qs[_0xf2ac('0x35')](_0xb67bce[_0xf2ac('0x2e')]['sort']);_0x5cf3af[_0xf2ac('0x36')]=qs['filters'](_[_0xf2ac('0x37')](_0xb67bce['query'],_0x37375c[_0xf2ac('0x38')]),_0x5c963a);if(_0xb67bce['query'][_0xf2ac('0x39')]){_0x5cf3af[_0xf2ac('0x36')]=_[_0xf2ac('0x3a')](_0x5cf3af[_0xf2ac('0x36')],{'$or':_['map'](_0x5c963a,function(_0x5952ff){if(_0x5952ff[_0xf2ac('0x2b')]!==_0xf2ac('0x3b')){var _0x23dd65={};_0x23dd65[_0x5952ff[_0xf2ac('0x24')]]={'$like':'%'+_0xb67bce[_0xf2ac('0x2e')][_0xf2ac('0x39')]+'%'};return _0x23dd65;}})});}_0x5cf3af=_[_0xf2ac('0x3a')]({},_0x5cf3af,_0xb67bce[_0xf2ac('0x3c')]);var _0x1a55bf={'where':_0x5cf3af[_0xf2ac('0x36')]};return db['FreshsalesAccount'][_0xf2ac('0x3d')](_0x1a55bf)[_0xf2ac('0x20')](function(_0x468756){_0x2cb812[_0xf2ac('0x3d')]=_0x468756;if(_0xb67bce[_0xf2ac('0x2e')][_0xf2ac('0x3e')]){_0x5cf3af['include']=[{'all':!![]}];}return db[_0xf2ac('0x28')][_0xf2ac('0x3f')](_0x5cf3af);})[_0xf2ac('0x20')](function(_0xc3808){_0x2cb812[_0xf2ac('0x40')]=_0xc3808;return _0x2cb812;})[_0xf2ac('0x20')](respondWithFilteredResult(_0x3e09e9,_0x5cf3af))['catch'](handleError(_0x3e09e9,null));};exports[_0xf2ac('0x41')]=function(_0x58343b,_0x48e687){var _0x16537b={'raw':![],'where':{'id':_0x58343b[_0xf2ac('0x42')]['id']}},_0x2606c8={};_0x2606c8[_0xf2ac('0x2f')]=_[_0xf2ac('0x2d')](db[_0xf2ac('0x28')][_0xf2ac('0x29')]);_0x2606c8[_0xf2ac('0x2e')]=_[_0xf2ac('0x2d')](_0x58343b['query']);_0x2606c8[_0xf2ac('0x38')]=_['intersection'](_0x2606c8[_0xf2ac('0x2f')],_0x2606c8['query']);_0x16537b[_0xf2ac('0x32')]=_[_0xf2ac('0x30')](_0x2606c8[_0xf2ac('0x2f')],qs[_0xf2ac('0x31')](_0x58343b[_0xf2ac('0x2e')][_0xf2ac('0x31')]));_0x16537b['attributes']=_0x16537b['attributes'][_0xf2ac('0x33')]?_0x16537b[_0xf2ac('0x32')]:_0x2606c8[_0xf2ac('0x2f')];if(_0x58343b[_0xf2ac('0x2e')][_0xf2ac('0x3e')]){_0x16537b[_0xf2ac('0x43')]=[{'all':!![]}];}_0x16537b=_[_0xf2ac('0x3a')]({},_0x16537b,_0x58343b[_0xf2ac('0x3c')]);return db[_0xf2ac('0x28')][_0xf2ac('0x44')](_0x16537b)['then'](handleEntityNotFound(_0x48e687,null))['then'](respondWithResult(_0x48e687,null))['catch'](handleError(_0x48e687,null));};exports['create']=function(_0x215fe6,_0x4532d5){return db[_0xf2ac('0x28')][_0xf2ac('0x45')](_0x215fe6[_0xf2ac('0x46')],{})['then'](respondWithResult(_0x4532d5,0xc9))[_0xf2ac('0x47')](handleError(_0x4532d5,null));};exports[_0xf2ac('0x48')]=function(_0xafd013,_0x1c4123){if(_0xafd013[_0xf2ac('0x46')]['id']){delete _0xafd013[_0xf2ac('0x46')]['id'];}return db[_0xf2ac('0x28')]['find']({'where':{'id':_0xafd013[_0xf2ac('0x42')]['id']}})[_0xf2ac('0x20')](handleEntityNotFound(_0x1c4123,null))[_0xf2ac('0x20')](saveUpdates(_0xafd013['body'],null))[_0xf2ac('0x20')](respondWithResult(_0x1c4123,null))['catch'](handleError(_0x1c4123,null));};exports['destroy']=function(_0x58eb7f,_0x109669){return db[_0xf2ac('0x28')][_0xf2ac('0x44')]({'where':{'id':_0x58eb7f['params']['id']}})[_0xf2ac('0x20')](handleEntityNotFound(_0x109669,null))['then'](removeEntity(_0x109669,null))[_0xf2ac('0x47')](handleError(_0x109669,null));};exports['getConfigurations']=function(_0x2772c7,_0x3b8aa1,_0x13539f){var _0x357a87={};var _0x5613dc={};var _0xf9acd0;var _0x4c4fd5;return db[_0xf2ac('0x28')][_0xf2ac('0x49')]({'where':{'id':_0x2772c7[_0xf2ac('0x42')]['id']}})['then'](handleEntityNotFound(_0x3b8aa1,null))[_0xf2ac('0x20')](function(_0x3601d2){if(_0x3601d2){_0xf9acd0=_0x3601d2;_0x5613dc[_0xf2ac('0x2f')]=_[_0xf2ac('0x2d')](db[_0xf2ac('0x4a')][_0xf2ac('0x29')]);_0x5613dc[_0xf2ac('0x2e')]=_[_0xf2ac('0x2d')](_0x2772c7[_0xf2ac('0x2e')]);_0x5613dc[_0xf2ac('0x38')]=_[_0xf2ac('0x30')](_0x5613dc[_0xf2ac('0x2f')],_0x5613dc[_0xf2ac('0x2e')]);_0x357a87[_0xf2ac('0x32')]=_['intersection'](_0x5613dc[_0xf2ac('0x2f')],qs[_0xf2ac('0x31')](_0x2772c7[_0xf2ac('0x2e')][_0xf2ac('0x31')]));_0x357a87['attributes']=_0x357a87[_0xf2ac('0x32')][_0xf2ac('0x33')]?_0x357a87[_0xf2ac('0x32')]:_0x5613dc[_0xf2ac('0x2f')];_0x357a87['order']=qs[_0xf2ac('0x35')](_0x2772c7['query']['sort']);_0x357a87[_0xf2ac('0x36')]=qs[_0xf2ac('0x38')](_[_0xf2ac('0x37')](_0x2772c7[_0xf2ac('0x2e')],_0x5613dc['filters']));if(_0x2772c7[_0xf2ac('0x2e')]['filter']){_0x357a87[_0xf2ac('0x36')]=_[_0xf2ac('0x3a')](_0x357a87[_0xf2ac('0x36')],{'$or':_[_0xf2ac('0x27')](_0x357a87[_0xf2ac('0x32')],function(_0x12bc76){var _0x565ffe={};_0x565ffe[_0x12bc76]={'$like':'%'+_0x2772c7['query'][_0xf2ac('0x39')]+'%'};return _0x565ffe;})});}_0x357a87=_[_0xf2ac('0x3a')]({},_0x357a87,_0x2772c7['options']);return _0xf9acd0[_0xf2ac('0x4b')](_0x357a87);}})[_0xf2ac('0x20')](function(_0x4800b6){if(_0x4800b6){_0x4c4fd5=_0x4800b6[_0xf2ac('0x33')];if(!_0x2772c7[_0xf2ac('0x2e')][_0xf2ac('0x4c')]('nolimit')){_0x357a87['limit']=qs[_0xf2ac('0x1a')](_0x2772c7[_0xf2ac('0x2e')][_0xf2ac('0x1a')]);_0x357a87[_0xf2ac('0x18')]=qs['offset'](_0x2772c7['query'][_0xf2ac('0x18')]);}return _0xf9acd0[_0xf2ac('0x4b')](_0x357a87);}})[_0xf2ac('0x20')](function(_0x1dc154){if(_0x1dc154){return _0x1dc154?{'count':_0x4c4fd5,'rows':_0x1dc154}:null;}})[_0xf2ac('0x20')](respondWithResult(_0x3b8aa1,null))[_0xf2ac('0x47')](handleError(_0x3b8aa1,null));};exports[_0xf2ac('0x4d')]=function(_0x4e80d6,_0x9284,_0x20eb55){if(_0x4e80d6[_0xf2ac('0x46')]['id']){delete _0x4e80d6[_0xf2ac('0x46')]['id'];}return db[_0xf2ac('0x28')][_0xf2ac('0x49')]({'where':{'id':_0x4e80d6['params']['id']}})[_0xf2ac('0x20')](handleEntityNotFound(_0x9284,null))['then'](function(_0x25dc60){if(_0x25dc60){_0x4e80d6[_0xf2ac('0x46')][_0xf2ac('0x4e')]=_0x25dc60['id'];_0x4e80d6[_0xf2ac('0x46')][_0xf2ac('0x4f')]=integrations[_0xf2ac('0x50')](_0x4e80d6[_0xf2ac('0x46')]['channel'],_0x4e80d6[_0xf2ac('0x46')]['type']);_0x4e80d6[_0xf2ac('0x46')][_0xf2ac('0x51')]=integrations[_0xf2ac('0x52')](_0x4e80d6['body'][_0xf2ac('0x53')],_0x4e80d6[_0xf2ac('0x46')][_0xf2ac('0x2b')]);return db[_0xf2ac('0x4a')][_0xf2ac('0x45')](_0x4e80d6[_0xf2ac('0x46')],{'include':[{'model':db[_0xf2ac('0x54')],'as':'Subjects'},{'model':db[_0xf2ac('0x54')],'as':_0xf2ac('0x51')}]});}return null;})[_0xf2ac('0x20')](respondWithResult(_0x9284,null))[_0xf2ac('0x47')](handleError(_0x9284,null));};exports[_0xf2ac('0x55')]=function(_0x2ab576,_0x1ca7a3,_0x2b05df){var _0x13c9fb='';var _0x31b40c='';return db[_0xf2ac('0x28')][_0xf2ac('0x49')]({'where':{'id':_0x2ab576['params']['id']},'attributes':['id',_0xf2ac('0x56'),'remoteUri','apiKey']})[_0xf2ac('0x20')](handleEntityNotFound(_0x1ca7a3,null))['then'](function(_0x4f891a){if(_0x4f891a){_0x31b40c=_0x4f891a['username'];_0x13c9fb=_0x4f891a['remoteUri'];var _0x434427=_0x4f891a[_0xf2ac('0x57')][_0xf2ac('0x58')](-0x1);if(_0x434427==='/'){_0x13c9fb=_0x13c9fb[_0xf2ac('0x59')](0x0,_0x13c9fb[_0xf2ac('0x5a')](_0x434427));}return rp({'method':_0xf2ac('0x5b'),'uri':util[_0xf2ac('0x5c')]('%s%s',_0x13c9fb,_0xf2ac('0x5d')),'headers':{'Authorization':_0xf2ac('0x5e')+_0x4f891a['apiKey']},'json':!![]});}})[_0xf2ac('0x20')](function(_0x1f8218){if(_0x1f8218){var _0x1ecfc6=_0x1f8218['users'];var _0x2eca91=![];var _0x1a466e=null;for(_0x1a466e=0x0;_0x1a466e<_0x1ecfc6[_0xf2ac('0x33')];_0x1a466e++){if(_0x1ecfc6[_0x1a466e][_0xf2ac('0x5f')]===_0x31b40c){_0x2eca91=!![];}}if(_0x2eca91){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf2ac('0x60')});}}})[_0xf2ac('0x20')](respondWithResult(_0x1ca7a3,null))[_0xf2ac('0x47')](function(_0x25f012){var _0x5c4665=_0x2ab576[_0xf2ac('0x2e')][_0xf2ac('0x61')]?0x1f4:_0x25f012[_0xf2ac('0x62')]||0x1f4;logger[_0xf2ac('0x22')](_0xf2ac('0x63'),_0xf2ac('0x55'),_0x5c4665,JSON[_0xf2ac('0x64')](_0x25f012));delete _0x25f012[_0xf2ac('0x24')];if(_0x5c4665===0x191){_0x5c4665=0x190;}_0x1ca7a3[_0xf2ac('0x15')](_0x5c4665)[_0xf2ac('0x25')](_0x2ab576[_0xf2ac('0x2e')][_0xf2ac('0x61')]?{'message':_0xf2ac('0x65'),'statusCode':_0x25f012[_0xf2ac('0x62')]}:_0x25f012);});};
\ No newline at end of file
index cb62da8..7faef9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1893=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ba1f4,_0x3f2019){var _0x18dd3d=function(_0x8b0de){while(--_0x8b0de){_0x1ba1f4['push'](_0x1ba1f4['shift']());}};_0x18dd3d(++_0x3f2019);}(_0x1893,0xa2));var _0x3189=function(_0x1c5f32,_0x1ac260){_0x1c5f32=_0x1c5f32-0x0;var _0x3bd1e8=_0x1893[_0x1c5f32];return _0x3bd1e8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3189('0x0'))(_0x3189('0x1'));var moment=require(_0x3189('0x2'));var BPromise=require(_0x3189('0x3'));var rp=require(_0x3189('0x4'));var fs=require('fs');var path=require(_0x3189('0x5'));var rimraf=require(_0x3189('0x6'));var config=require('../../config/environment');var attributes=require(_0x3189('0x7'));var integrations=require(_0x3189('0x8'));module[_0x3189('0x9')]=function(_0x4080a9,_0x77c566){return _0x4080a9[_0x3189('0xa')](_0x3189('0xb'),attributes,{'tableName':_0x3189('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6050=['moment','bluebird','path','rimraf','../../config/environment','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x5f2fc1,_0xa1db67){var _0xf36ab2=function(_0x3dd868){while(--_0x3dd868){_0x5f2fc1['push'](_0x5f2fc1['shift']());}};_0xf36ab2(++_0xa1db67);}(_0x6050,0x196));var _0x0605=function(_0x42e32e,_0x128bd3){_0x42e32e=_0x42e32e-0x0;var _0x558daf=_0x6050[_0x42e32e];return _0x558daf;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xd78d96,_0x578623){return _0xd78d96['define']('FreshsalesAccount',attributes,{'tableName':_0x0605('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 614d0bf..925310c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['map','include','model','attributes','then','ShowFreshsalesAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','limit'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x5f2f,0x73));var _0xf5f2=function(_0x35a349,_0x46886f){_0x35a349=_0x35a349-0x0;var _0x52bc95=_0x5f2f[_0x35a349];return _0x52bc95;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetFreshsalesAccount',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetFreshsalesAccount',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowFreshsalesAccount',_0x153924);logger[_0xf5f2('0xf')]('ShowFreshsalesAccount',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowFreshsalesAccount',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});};
\ No newline at end of file
+var _0x2ef3=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','where','include','model','map','attributes','ShowFreshsalesAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x2a669c,_0x49ce2d){var _0x1f1f58=function(_0x273097){while(--_0x273097){_0x2a669c['push'](_0x2a669c['shift']());}};_0x1f1f58(++_0x49ce2d);}(_0x2ef3,0xba));var _0x32ef=function(_0x4fcfd1,_0x9f2e87){_0x4fcfd1=_0x4fcfd1-0x0;var _0x2a6d04=_0x2ef3[_0x4fcfd1];return _0x2a6d04;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['findAll']({'raw':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x19')]||null:null,'attributes':_0x1a9476['options']?_0x1a9476[_0x32ef('0x17')]['attributes']||null:null,'limit':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')]['limit']||null:null,'include':_0x1a9476[_0x32ef('0x17')]?_0x1a9476[_0x32ef('0x17')][_0x32ef('0x1a')]?_['map'](_0x1a9476['options'][_0x32ef('0x1a')],function(_0xb30fab){return{'model':db[_0xb30fab[_0x32ef('0x1b')]],'as':_0xb30fab['as'],'attributes':_0xb30fab['attributes'],'include':_0xb30fab['include']?_[_0x32ef('0x1c')](_0xb30fab['include'],function(_0x51a412){return{'model':db[_0x51a412[_0x32ef('0x1b')]],'as':_0x51a412['as'],'attributes':_0x51a412[_0x32ef('0x1d')],'include':_0x51a412[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x51a412[_0x32ef('0x1a')],function(_0x234175){return{'model':db[_0x234175[_0x32ef('0x1b')]],'as':_0x234175['as'],'attributes':_0x234175[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x2f52d7){logger[_0x32ef('0xc')](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x2f52d7));_0x57863c(_0x2f52d7);})['catch'](function(_0x12de1a){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x12de1a[_0x32ef('0x13')],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x12de1a[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1e')]=function(_0x31dbc3){var _0x2ac686=this;return new Promise(function(_0x1b668a,_0x1a6ed2){return db[_0x32ef('0x16')]['find']({'raw':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x18')]===undefined?!![]:![]:!![],'where':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options'][_0x32ef('0x19')]||null:null,'attributes':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3[_0x32ef('0x17')][_0x32ef('0x1d')]||null:null,'include':_0x31dbc3[_0x32ef('0x17')]?_0x31dbc3['options']['include']?_[_0x32ef('0x1c')](_0x31dbc3['options'][_0x32ef('0x1a')],function(_0x15b873){return{'model':db[_0x15b873[_0x32ef('0x1b')]],'as':_0x15b873['as'],'attributes':_0x15b873[_0x32ef('0x1d')],'include':_0x15b873[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x15b873['include'],function(_0x482d3a){return{'model':db[_0x482d3a['model']],'as':_0x482d3a['as'],'attributes':_0x482d3a[_0x32ef('0x1d')],'include':_0x482d3a[_0x32ef('0x1a')]?_[_0x32ef('0x1c')](_0x482d3a['include'],function(_0x4fb402){return{'model':db[_0x4fb402[_0x32ef('0x1b')]],'as':_0x4fb402['as'],'attributes':_0x4fb402[_0x32ef('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x32ef('0xb')](function(_0x480348){logger['info'](_0x32ef('0x1e'),_0x31dbc3);logger[_0x32ef('0x1f')](_0x32ef('0x1e'),_0x31dbc3,JSON[_0x32ef('0x10')](_0x480348));_0x1b668a(_0x480348);})[_0x32ef('0x14')](function(_0x211c79){logger[_0x32ef('0x11')](_0x32ef('0x1e'),_0x211c79[_0x32ef('0x13')],_0x31dbc3);_0x1a6ed2(_0x2ac686['error'](0x1f4,_0x211c79[_0x32ef('0x13')]));});});};
\ No newline at end of file
index 8c8289b..a423cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d22=['/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated'];(function(_0x188a14,_0xb55ceb){var _0x170363=function(_0x252a3d){while(--_0x252a3d){_0x188a14['push'](_0x188a14['shift']());}};_0x170363(++_0xb55ceb);}(_0x5d22,0x1e9));var _0x25d2=function(_0x23c607,_0x2e4938){_0x23c607=_0x23c607-0x0;var _0x54c81f=_0x5d22[_0x23c607];return _0x54c81f;};'use strict';var multer=require(_0x25d2('0x0'));var util=require(_0x25d2('0x1'));var path=require('path');var timeout=require(_0x25d2('0x2'));var express=require(_0x25d2('0x3'));var router=express[_0x25d2('0x4')]();var fs_extra=require(_0x25d2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x25d2('0x6'));var config=require(_0x25d2('0x7'));var controller=require(_0x25d2('0x8'));router[_0x25d2('0x9')]('/',auth[_0x25d2('0xa')](),controller['index']);router[_0x25d2('0x9')](_0x25d2('0xb'),auth[_0x25d2('0xa')](),controller[_0x25d2('0xc')]);router['get'](_0x25d2('0xd'),auth['isAuthenticated'](),controller[_0x25d2('0xe')]);router['get'](_0x25d2('0xf'),auth[_0x25d2('0xa')](),controller[_0x25d2('0x10')]);router[_0x25d2('0x9')](_0x25d2('0x11'),auth[_0x25d2('0xa')](),controller[_0x25d2('0x12')]);router['post']('/',auth[_0x25d2('0xa')](),controller[_0x25d2('0x13')]);router[_0x25d2('0x14')](_0x25d2('0xb'),auth[_0x25d2('0xa')](),controller[_0x25d2('0x15')]);router[_0x25d2('0x16')](_0x25d2('0xb'),auth[_0x25d2('0xa')](),controller[_0x25d2('0x17')]);module[_0x25d2('0x18')]=router;
\ No newline at end of file
+var _0x998a=['exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/subjects','getFields','post','create','put','update'];(function(_0x3fbdc4,_0x55de95){var _0x5903fb=function(_0x4cbb06){while(--_0x4cbb06){_0x3fbdc4['push'](_0x3fbdc4['shift']());}};_0x5903fb(++_0x55de95);}(_0x998a,0xab));var _0xa998=function(_0x2ad143,_0xe6c291){_0x2ad143=_0x2ad143-0x0;var _0x19296a=_0x998a[_0x2ad143];return _0x19296a;};'use strict';var multer=require(_0xa998('0x0'));var util=require(_0xa998('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa998('0x2'));var router=express[_0xa998('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa998('0x4'));var interaction=require(_0xa998('0x5'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0xa998('0x6')]('/',auth[_0xa998('0x7')](),controller[_0xa998('0x8')]);router[_0xa998('0x6')](_0xa998('0x9'),auth[_0xa998('0x7')](),controller['show']);router[_0xa998('0x6')](_0xa998('0xa'),auth[_0xa998('0x7')](),controller['getSubjects']);router[_0xa998('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router[_0xa998('0x6')]('/:id/fields',auth[_0xa998('0x7')](),controller[_0xa998('0xb')]);router[_0xa998('0xc')]('/',auth['isAuthenticated'](),controller[_0xa998('0xd')]);router[_0xa998('0xe')](_0xa998('0x9'),auth[_0xa998('0x7')](),controller[_0xa998('0xf')]);router['delete'](_0xa998('0x9'),auth[_0xa998('0x7')](),controller['destroy']);module[_0xa998('0x10')]=router;
\ No newline at end of file
index 311305e..d693ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4666=['STRING','exports'];(function(_0x443f0b,_0x33641f){var _0x141bba=function(_0x4d2421){while(--_0x4d2421){_0x443f0b['push'](_0x443f0b['shift']());}};_0x141bba(++_0x33641f);}(_0x4666,0x193));var _0x6466=function(_0x152298,_0x46719a){_0x152298=_0x152298-0x0;var _0x295bbd=_0x4666[_0x152298];return _0x295bbd;};'use strict';var Sequelize=require('sequelize');module[_0x6466('0x0')]={'name':{'type':Sequelize[_0x6466('0x1')]},'description':{'type':Sequelize[_0x6466('0x1')]}};
\ No newline at end of file
+var _0xa41e=['sequelize','STRING'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0xa41e,0x90));var _0xea41=function(_0x1ea38c,_0x17294c){_0x1ea38c=_0x1ea38c-0x0;var _0x13e229=_0xa41e[_0x1ea38c];return _0x13e229;};'use strict';var Sequelize=require(_0xea41('0x0'));module['exports']={'name':{'type':Sequelize[_0xea41('0x1')]},'description':{'type':Sequelize[_0xea41('0x1')]}};
\ No newline at end of file
index 910385e..28f1d5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x511a=['FreshsalesConfiguration','findAll','rows','catch','show','params','includeAll','options','find','create','body','getSubjects','findOne','FreshsalesField','getDescriptions','order','getFields','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','end','error','send','index','map','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','include'];(function(_0x28335a,_0xa51de0){var _0x317203=function(_0xbda627){while(--_0xbda627){_0x28335a['push'](_0x28335a['shift']());}};_0x317203(++_0xa51de0);}(_0x511a,0x101));var _0xa511=function(_0x30be6e,_0x2d4fcd){_0x30be6e=_0x30be6e-0x0;var _0x2250ad=_0x511a[_0x30be6e];return _0x2250ad;};'use strict';var emlformat=require(_0xa511('0x0'));var rimraf=require(_0xa511('0x1'));var zipdir=require(_0xa511('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa511('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa511('0x4'));var util=require(_0xa511('0x5'));var path=require(_0xa511('0x6'));var sox=require(_0xa511('0x7'));var csv=require(_0xa511('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa511('0x9'));var crypto=require('crypto');var jsforce=require(_0xa511('0xa'));var deskjs=require(_0xa511('0xb'));var toCsv=require(_0xa511('0x8'));var querystring=require(_0xa511('0xc'));var Papa=require('papaparse');var Redis=require(_0xa511('0xd'));var authService=require(_0xa511('0xe'));var qs=require(_0xa511('0xf'));var as=require(_0xa511('0x10'));var hardwareService=require(_0xa511('0x11'));var logger=require(_0xa511('0x12'))(_0xa511('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa511('0x14'));var db=require(_0xa511('0x15'))['db'];function respondWithStatusCode(_0x181636,_0x3a6887){_0x3a6887=_0x3a6887||0xcc;return function(_0x32d1c0){if(_0x32d1c0){return _0x181636[_0xa511('0x16')](_0x3a6887);}return _0x181636[_0xa511('0x17')](_0x3a6887)['end']();};}function respondWithResult(_0x318137,_0x13e4f3){_0x13e4f3=_0x13e4f3||0xc8;return function(_0x7cd2bd){if(_0x7cd2bd){return _0x318137['status'](_0x13e4f3)[_0xa511('0x18')](_0x7cd2bd);}};}function respondWithFilteredResult(_0x54c7eb,_0x597f7a){return function(_0x6ef566){if(_0x6ef566){var _0x55c47f=typeof _0x597f7a['offset']===_0xa511('0x19')&&typeof _0x597f7a['limit']===_0xa511('0x19');var _0x43bfc2=_0x6ef566[_0xa511('0x1a')];var _0x3ae7b5=_0x55c47f?0x0:_0x597f7a[_0xa511('0x1b')];var _0x20e701=_0x55c47f?_0x6ef566[_0xa511('0x1a')]:_0x597f7a[_0xa511('0x1b')]+_0x597f7a['limit'];var _0x2e91de;if(_0x20e701>=_0x43bfc2){_0x20e701=_0x43bfc2;_0x2e91de=0xc8;}else{_0x2e91de=0xce;}_0x54c7eb[_0xa511('0x17')](_0x2e91de);return _0x54c7eb[_0xa511('0x1c')](_0xa511('0x1d'),_0x3ae7b5+'-'+_0x20e701+'/'+_0x43bfc2)['json'](_0x6ef566);}return null;};}function patchUpdates(_0x550e00){return function(_0x380f33){try{jsonpatch[_0xa511('0x1e')](_0x380f33,_0x550e00,!![]);}catch(_0x5aa7a0){return BPromise[_0xa511('0x1f')](_0x5aa7a0);}return _0x380f33[_0xa511('0x20')]();};}function saveUpdates(_0xca4887,_0x103deb){return function(_0x1599e7){if(_0x1599e7){return _0x1599e7[_0xa511('0x21')](_0xca4887)['then'](function(_0x46c9ee){return _0x46c9ee;});}return null;};}function removeEntity(_0x43fc9d,_0x44351a){return function(_0xf06f4f){if(_0xf06f4f){return _0xf06f4f[_0xa511('0x22')]()[_0xa511('0x23')](function(){_0x43fc9d[_0xa511('0x17')](0xcc)[_0xa511('0x24')]();});}};}function handleEntityNotFound(_0x3c090b,_0x175a18){return function(_0x352838){if(!_0x352838){_0x3c090b['sendStatus'](0x194);}return _0x352838;};}function handleError(_0x22ec69,_0x2cd28a){_0x2cd28a=_0x2cd28a||0x1f4;return function(_0x9e6186){logger[_0xa511('0x25')](_0x9e6186['stack']);if(_0x9e6186['name']){delete _0x9e6186['name'];}_0x22ec69[_0xa511('0x17')](_0x2cd28a)[_0xa511('0x26')](_0x9e6186);};}exports[_0xa511('0x27')]=function(_0x7c2a3c,_0x5b9377){var _0x50f574={},_0x141930={},_0x346950={'count':0x0,'rows':[]};var _0x59a851=_[_0xa511('0x28')](db['FreshsalesConfiguration'][_0xa511('0x29')],function(_0x372c94){return{'name':_0x372c94['fieldName'],'type':_0x372c94[_0xa511('0x2a')][_0xa511('0x2b')]};});_0x141930[_0xa511('0x2c')]=_[_0xa511('0x28')](_0x59a851,_0xa511('0x2d'));_0x141930[_0xa511('0x2e')]=_[_0xa511('0x2f')](_0x7c2a3c[_0xa511('0x2e')]);_0x141930[_0xa511('0x30')]=_['intersection'](_0x141930[_0xa511('0x2c')],_0x141930['query']);_0x50f574[_0xa511('0x31')]=_[_0xa511('0x32')](_0x141930[_0xa511('0x2c')],qs[_0xa511('0x33')](_0x7c2a3c[_0xa511('0x2e')]['fields']));_0x50f574[_0xa511('0x31')]=_0x50f574[_0xa511('0x31')][_0xa511('0x34')]?_0x50f574[_0xa511('0x31')]:_0x141930[_0xa511('0x2c')];if(!_0x7c2a3c[_0xa511('0x2e')][_0xa511('0x35')](_0xa511('0x36'))){_0x50f574['limit']=qs[_0xa511('0x37')](_0x7c2a3c[_0xa511('0x2e')]['limit']);_0x50f574[_0xa511('0x1b')]=qs[_0xa511('0x1b')](_0x7c2a3c[_0xa511('0x2e')][_0xa511('0x1b')]);}_0x50f574['order']=qs[_0xa511('0x38')](_0x7c2a3c[_0xa511('0x2e')][_0xa511('0x38')]);_0x50f574[_0xa511('0x39')]=qs['filters'](_[_0xa511('0x3a')](_0x7c2a3c['query'],_0x141930[_0xa511('0x30')]),_0x59a851);if(_0x7c2a3c[_0xa511('0x2e')][_0xa511('0x3b')]){_0x50f574[_0xa511('0x39')]=_['merge'](_0x50f574[_0xa511('0x39')],{'$or':_['map'](_0x59a851,function(_0x296daa){if(_0x296daa[_0xa511('0x2a')]!==_0xa511('0x3c')){var _0x4ba840={};_0x4ba840[_0x296daa['name']]={'$like':'%'+_0x7c2a3c['query'][_0xa511('0x3b')]+'%'};return _0x4ba840;}})});}_0x50f574=_[_0xa511('0x3d')]({},_0x50f574,_0x7c2a3c['options']);var _0x1a6bfc={'where':_0x50f574[_0xa511('0x39')]};return db['FreshsalesConfiguration'][_0xa511('0x1a')](_0x1a6bfc)[_0xa511('0x23')](function(_0x3f693b){_0x346950[_0xa511('0x1a')]=_0x3f693b;if(_0x7c2a3c[_0xa511('0x2e')]['includeAll']){_0x50f574[_0xa511('0x3e')]=[{'all':!![]}];}return db[_0xa511('0x3f')][_0xa511('0x40')](_0x50f574);})[_0xa511('0x23')](function(_0x174f15){_0x346950[_0xa511('0x41')]=_0x174f15;return _0x346950;})[_0xa511('0x23')](respondWithFilteredResult(_0x5b9377,_0x50f574))[_0xa511('0x42')](handleError(_0x5b9377,null));};exports[_0xa511('0x43')]=function(_0x271d97,_0x49d4e8){var _0x48c549={'raw':![],'where':{'id':_0x271d97[_0xa511('0x44')]['id']}},_0x2e931c={};_0x2e931c[_0xa511('0x2c')]=_['keys'](db[_0xa511('0x3f')][_0xa511('0x29')]);_0x2e931c[_0xa511('0x2e')]=_[_0xa511('0x2f')](_0x271d97[_0xa511('0x2e')]);_0x2e931c[_0xa511('0x30')]=_[_0xa511('0x32')](_0x2e931c['model'],_0x2e931c['query']);_0x48c549[_0xa511('0x31')]=_['intersection'](_0x2e931c[_0xa511('0x2c')],qs[_0xa511('0x33')](_0x271d97[_0xa511('0x2e')][_0xa511('0x33')]));_0x48c549[_0xa511('0x31')]=_0x48c549[_0xa511('0x31')][_0xa511('0x34')]?_0x48c549[_0xa511('0x31')]:_0x2e931c['model'];if(_0x271d97[_0xa511('0x2e')][_0xa511('0x45')]){_0x48c549[_0xa511('0x3e')]=[{'all':!![]}];}_0x48c549=_['merge']({},_0x48c549,_0x271d97[_0xa511('0x46')]);return db[_0xa511('0x3f')][_0xa511('0x47')](_0x48c549)[_0xa511('0x23')](handleEntityNotFound(_0x49d4e8,null))[_0xa511('0x23')](respondWithResult(_0x49d4e8,null))[_0xa511('0x42')](handleError(_0x49d4e8,null));};exports[_0xa511('0x48')]=function(_0x28c06f,_0x598a85){return db['FreshsalesConfiguration'][_0xa511('0x48')](_0x28c06f[_0xa511('0x49')],{})['then'](respondWithResult(_0x598a85,0xc9))['catch'](handleError(_0x598a85,null));};exports['update']=function(_0x15f1ab,_0x43f856){if(_0x15f1ab[_0xa511('0x49')]['id']){delete _0x15f1ab[_0xa511('0x49')]['id'];}return db[_0xa511('0x3f')]['find']({'where':{'id':_0x15f1ab['params']['id']}})[_0xa511('0x23')](handleEntityNotFound(_0x43f856,null))[_0xa511('0x23')](saveUpdates(_0x15f1ab['body'],null))[_0xa511('0x23')](respondWithResult(_0x43f856,null))[_0xa511('0x42')](handleError(_0x43f856,null));};exports[_0xa511('0x22')]=function(_0x526fa2,_0x38337c){return db[_0xa511('0x3f')][_0xa511('0x47')]({'where':{'id':_0x526fa2['params']['id']}})[_0xa511('0x23')](handleEntityNotFound(_0x38337c,null))[_0xa511('0x23')](removeEntity(_0x38337c,null))[_0xa511('0x42')](handleError(_0x38337c,null));};exports[_0xa511('0x4a')]=function(_0x1b3477,_0x3f9bba,_0x29b36e){var _0x3b0b82={};var _0x86f36c={};var _0x9a1e39;var _0x567d98;return db['FreshsalesConfiguration'][_0xa511('0x4b')]({'where':{'id':_0x1b3477['params']['id']}})[_0xa511('0x23')](handleEntityNotFound(_0x3f9bba,null))[_0xa511('0x23')](function(_0x5bc52d){if(_0x5bc52d){_0x9a1e39=_0x5bc52d;_0x86f36c['model']=_[_0xa511('0x2f')](db[_0xa511('0x4c')][_0xa511('0x29')]);_0x86f36c[_0xa511('0x2e')]=_[_0xa511('0x2f')](_0x1b3477[_0xa511('0x2e')]);_0x86f36c[_0xa511('0x30')]=_[_0xa511('0x32')](_0x86f36c[_0xa511('0x2c')],_0x86f36c[_0xa511('0x2e')]);_0x3b0b82[_0xa511('0x31')]=_[_0xa511('0x32')](_0x86f36c[_0xa511('0x2c')],qs[_0xa511('0x33')](_0x1b3477['query']['fields']));_0x3b0b82[_0xa511('0x31')]=_0x3b0b82['attributes']['length']?_0x3b0b82[_0xa511('0x31')]:_0x86f36c[_0xa511('0x2c')];_0x3b0b82['order']=qs[_0xa511('0x38')](_0x1b3477[_0xa511('0x2e')][_0xa511('0x38')]);_0x3b0b82[_0xa511('0x39')]=qs[_0xa511('0x30')](_[_0xa511('0x3a')](_0x1b3477[_0xa511('0x2e')],_0x86f36c['filters']));if(_0x1b3477[_0xa511('0x2e')][_0xa511('0x3b')]){_0x3b0b82[_0xa511('0x39')]=_[_0xa511('0x3d')](_0x3b0b82[_0xa511('0x39')],{'$or':_['map'](_0x3b0b82[_0xa511('0x31')],function(_0x185aa8){var _0x5bdee4={};_0x5bdee4[_0x185aa8]={'$like':'%'+_0x1b3477[_0xa511('0x2e')][_0xa511('0x3b')]+'%'};return _0x5bdee4;})});}_0x3b0b82=_[_0xa511('0x3d')]({},_0x3b0b82,_0x1b3477['options']);return _0x9a1e39[_0xa511('0x4a')](_0x3b0b82);}})['then'](function(_0x2458b7){if(_0x2458b7){_0x567d98=_0x2458b7['length'];if(!_0x1b3477[_0xa511('0x2e')][_0xa511('0x35')](_0xa511('0x36'))){_0x3b0b82['limit']=qs[_0xa511('0x37')](_0x1b3477['query'][_0xa511('0x37')]);_0x3b0b82[_0xa511('0x1b')]=qs['offset'](_0x1b3477[_0xa511('0x2e')]['offset']);}return _0x9a1e39[_0xa511('0x4a')](_0x3b0b82);}})[_0xa511('0x23')](function(_0x496126){if(_0x496126){return _0x496126?{'count':_0x567d98,'rows':_0x496126}:null;}})[_0xa511('0x23')](respondWithResult(_0x3f9bba,null))['catch'](handleError(_0x3f9bba,null));};exports[_0xa511('0x4d')]=function(_0x547902,_0x56d1a5,_0x224ecd){var _0x967604={};var _0x3451c0={};var _0x1d0c49;var _0x5660bb;return db[_0xa511('0x3f')]['findOne']({'where':{'id':_0x547902[_0xa511('0x44')]['id']}})[_0xa511('0x23')](handleEntityNotFound(_0x56d1a5,null))['then'](function(_0x2bdaca){if(_0x2bdaca){_0x1d0c49=_0x2bdaca;_0x3451c0['model']=_[_0xa511('0x2f')](db[_0xa511('0x4c')][_0xa511('0x29')]);_0x3451c0['query']=_['keys'](_0x547902[_0xa511('0x2e')]);_0x3451c0[_0xa511('0x30')]=_[_0xa511('0x32')](_0x3451c0[_0xa511('0x2c')],_0x3451c0[_0xa511('0x2e')]);_0x967604[_0xa511('0x31')]=_['intersection'](_0x3451c0[_0xa511('0x2c')],qs[_0xa511('0x33')](_0x547902[_0xa511('0x2e')][_0xa511('0x33')]));_0x967604['attributes']=_0x967604[_0xa511('0x31')]['length']?_0x967604[_0xa511('0x31')]:_0x3451c0[_0xa511('0x2c')];_0x967604[_0xa511('0x4e')]=qs[_0xa511('0x38')](_0x547902['query']['sort']);_0x967604['where']=qs['filters'](_['pick'](_0x547902[_0xa511('0x2e')],_0x3451c0[_0xa511('0x30')]));if(_0x547902[_0xa511('0x2e')][_0xa511('0x3b')]){_0x967604[_0xa511('0x39')]=_['merge'](_0x967604[_0xa511('0x39')],{'$or':_[_0xa511('0x28')](_0x967604[_0xa511('0x31')],function(_0x4b2f74){var _0x5cc5bf={};_0x5cc5bf[_0x4b2f74]={'$like':'%'+_0x547902[_0xa511('0x2e')][_0xa511('0x3b')]+'%'};return _0x5cc5bf;})});}_0x967604=_[_0xa511('0x3d')]({},_0x967604,_0x547902[_0xa511('0x46')]);return _0x1d0c49[_0xa511('0x4d')](_0x967604);}})[_0xa511('0x23')](function(_0x15d701){if(_0x15d701){_0x5660bb=_0x15d701[_0xa511('0x34')];if(!_0x547902[_0xa511('0x2e')][_0xa511('0x35')](_0xa511('0x36'))){_0x967604[_0xa511('0x37')]=qs[_0xa511('0x37')](_0x547902['query'][_0xa511('0x37')]);_0x967604['offset']=qs[_0xa511('0x1b')](_0x547902['query'][_0xa511('0x1b')]);}return _0x1d0c49[_0xa511('0x4d')](_0x967604);}})[_0xa511('0x23')](function(_0x457bba){if(_0x457bba){return _0x457bba?{'count':_0x5660bb,'rows':_0x457bba}:null;}})[_0xa511('0x23')](respondWithResult(_0x56d1a5,null))['catch'](handleError(_0x56d1a5,null));};exports[_0xa511('0x4f')]=function(_0x53fcd2,_0x5ec773,_0x5a7b7a){var _0x270911={};var _0x4b9743={};var _0x5a5c1d;var _0x78a3f0;return db[_0xa511('0x3f')][_0xa511('0x4b')]({'where':{'id':_0x53fcd2[_0xa511('0x44')]['id']}})[_0xa511('0x23')](handleEntityNotFound(_0x5ec773,null))[_0xa511('0x23')](function(_0x5c911b){if(_0x5c911b){_0x5a5c1d=_0x5c911b;_0x4b9743[_0xa511('0x2c')]=_[_0xa511('0x2f')](db['FreshsalesField'][_0xa511('0x29')]);_0x4b9743[_0xa511('0x2e')]=_[_0xa511('0x2f')](_0x53fcd2[_0xa511('0x2e')]);_0x4b9743[_0xa511('0x30')]=_[_0xa511('0x32')](_0x4b9743['model'],_0x4b9743[_0xa511('0x2e')]);_0x270911[_0xa511('0x31')]=_['intersection'](_0x4b9743['model'],qs['fields'](_0x53fcd2[_0xa511('0x2e')][_0xa511('0x33')]));_0x270911[_0xa511('0x31')]=_0x270911[_0xa511('0x31')][_0xa511('0x34')]?_0x270911['attributes']:_0x4b9743['model'];_0x270911[_0xa511('0x4e')]=qs[_0xa511('0x38')](_0x53fcd2[_0xa511('0x2e')][_0xa511('0x38')]);_0x270911[_0xa511('0x39')]=qs['filters'](_[_0xa511('0x3a')](_0x53fcd2['query'],_0x4b9743[_0xa511('0x30')]));if(_0x53fcd2['query'][_0xa511('0x3b')]){_0x270911[_0xa511('0x39')]=_['merge'](_0x270911[_0xa511('0x39')],{'$or':_['map'](_0x270911['attributes'],function(_0x51b7ba){var _0x2563b6={};_0x2563b6[_0x51b7ba]={'$like':'%'+_0x53fcd2[_0xa511('0x2e')]['filter']+'%'};return _0x2563b6;})});}_0x270911=_[_0xa511('0x3d')]({},_0x270911,_0x53fcd2[_0xa511('0x46')]);return _0x5a5c1d[_0xa511('0x4f')](_0x270911);}})[_0xa511('0x23')](function(_0x1124cc){if(_0x1124cc){_0x78a3f0=_0x1124cc[_0xa511('0x34')];if(!_0x53fcd2[_0xa511('0x2e')][_0xa511('0x35')](_0xa511('0x36'))){_0x270911[_0xa511('0x37')]=qs[_0xa511('0x37')](_0x53fcd2[_0xa511('0x2e')][_0xa511('0x37')]);_0x270911[_0xa511('0x1b')]=qs[_0xa511('0x1b')](_0x53fcd2[_0xa511('0x2e')]['offset']);}return _0x5a5c1d[_0xa511('0x4f')](_0x270911);}})['then'](function(_0x1d32e3){if(_0x1d32e3){return _0x1d32e3?{'count':_0x78a3f0,'rows':_0x1d32e3}:null;}})[_0xa511('0x23')](respondWithResult(_0x5ec773,null))[_0xa511('0x42')](handleError(_0x5ec773,null));};
\ No newline at end of file
+var _0xb662=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','fields','include','find','create','body','FreshsalesField','order','getSubjects','findOne','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x29b6be,_0x24c384){var _0x256de8=function(_0x3d1770){while(--_0x3d1770){_0x29b6be['push'](_0x29b6be['shift']());}};_0x256de8(++_0x24c384);}(_0xb662,0x13e));var _0x2b66=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0xb662[_0x19f9e6];return _0x45c862;};'use strict';var emlformat=require(_0x2b66('0x0'));var rimraf=require(_0x2b66('0x1'));var zipdir=require(_0x2b66('0x2'));var jsonpatch=require(_0x2b66('0x3'));var rp=require(_0x2b66('0x4'));var moment=require(_0x2b66('0x5'));var BPromise=require(_0x2b66('0x6'));var Mustache=require(_0x2b66('0x7'));var util=require(_0x2b66('0x8'));var path=require(_0x2b66('0x9'));var sox=require(_0x2b66('0xa'));var csv=require(_0x2b66('0xb'));var ejs=require(_0x2b66('0xc'));var fs=require('fs');var fs_extra=require(_0x2b66('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2b66('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2b66('0xb'));var querystring=require(_0x2b66('0xf'));var Papa=require(_0x2b66('0x10'));var Redis=require(_0x2b66('0x11'));var authService=require(_0x2b66('0x12'));var qs=require(_0x2b66('0x13'));var as=require(_0x2b66('0x14'));var hardwareService=require(_0x2b66('0x15'));var logger=require(_0x2b66('0x16'))(_0x2b66('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2b66('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450298,_0x485e62){_0x485e62=_0x485e62||0xcc;return function(_0x35cb1e){if(_0x35cb1e){return _0x450298[_0x2b66('0x19')](_0x485e62);}return _0x450298[_0x2b66('0x1a')](_0x485e62)[_0x2b66('0x1b')]();};}function respondWithResult(_0x5c9b1,_0x2fa795){_0x2fa795=_0x2fa795||0xc8;return function(_0x517130){if(_0x517130){return _0x5c9b1[_0x2b66('0x1a')](_0x2fa795)[_0x2b66('0x1c')](_0x517130);}};}function respondWithFilteredResult(_0x308462,_0x473c44){return function(_0x48f2c5){if(_0x48f2c5){var _0x4056c3=typeof _0x473c44[_0x2b66('0x1d')]===_0x2b66('0x1e')&&typeof _0x473c44[_0x2b66('0x1f')]===_0x2b66('0x1e');var _0xec26df=_0x48f2c5[_0x2b66('0x20')];var _0x442f2f=_0x4056c3?0x0:_0x473c44[_0x2b66('0x1d')];var _0x1d15ca=_0x4056c3?_0x48f2c5[_0x2b66('0x20')]:_0x473c44[_0x2b66('0x1d')]+_0x473c44['limit'];var _0x2db4f1;if(_0x1d15ca>=_0xec26df){_0x1d15ca=_0xec26df;_0x2db4f1=0xc8;}else{_0x2db4f1=0xce;}_0x308462[_0x2b66('0x1a')](_0x2db4f1);return _0x308462[_0x2b66('0x21')]('Content-Range',_0x442f2f+'-'+_0x1d15ca+'/'+_0xec26df)[_0x2b66('0x1c')](_0x48f2c5);}return null;};}function patchUpdates(_0x484427){return function(_0x359698){try{jsonpatch[_0x2b66('0x22')](_0x359698,_0x484427,!![]);}catch(_0x1b26aa){return BPromise['reject'](_0x1b26aa);}return _0x359698[_0x2b66('0x23')]();};}function saveUpdates(_0x1d3a06,_0x3bfc62){return function(_0x579af9){if(_0x579af9){return _0x579af9[_0x2b66('0x24')](_0x1d3a06)['then'](function(_0x136885){return _0x136885;});}return null;};}function removeEntity(_0x2d22d7,_0x21c633){return function(_0x21a127){if(_0x21a127){return _0x21a127[_0x2b66('0x25')]()[_0x2b66('0x26')](function(){_0x2d22d7[_0x2b66('0x1a')](0xcc)[_0x2b66('0x1b')]();});}};}function handleEntityNotFound(_0x3e314b,_0x27f8e8){return function(_0x183109){if(!_0x183109){_0x3e314b['sendStatus'](0x194);}return _0x183109;};}function handleError(_0x4caf35,_0x33f750){_0x33f750=_0x33f750||0x1f4;return function(_0x51b5b3){logger[_0x2b66('0x27')](_0x51b5b3[_0x2b66('0x28')]);if(_0x51b5b3['name']){delete _0x51b5b3[_0x2b66('0x29')];}_0x4caf35[_0x2b66('0x1a')](_0x33f750)[_0x2b66('0x2a')](_0x51b5b3);};}exports[_0x2b66('0x2b')]=function(_0x174176,_0x49a763){var _0x9c677b={},_0x3ce222={},_0x39bdbd={'count':0x0,'rows':[]};var _0x49424a=_[_0x2b66('0x2c')](db['FreshsalesConfiguration'][_0x2b66('0x2d')],function(_0x28a151){return{'name':_0x28a151[_0x2b66('0x2e')],'type':_0x28a151[_0x2b66('0x2f')][_0x2b66('0x30')]};});_0x3ce222[_0x2b66('0x31')]=_['map'](_0x49424a,_0x2b66('0x29'));_0x3ce222[_0x2b66('0x32')]=_[_0x2b66('0x33')](_0x174176['query']);_0x3ce222[_0x2b66('0x34')]=_[_0x2b66('0x35')](_0x3ce222[_0x2b66('0x31')],_0x3ce222[_0x2b66('0x32')]);_0x9c677b[_0x2b66('0x36')]=_[_0x2b66('0x35')](_0x3ce222[_0x2b66('0x31')],qs['fields'](_0x174176[_0x2b66('0x32')]['fields']));_0x9c677b[_0x2b66('0x36')]=_0x9c677b[_0x2b66('0x36')][_0x2b66('0x37')]?_0x9c677b['attributes']:_0x3ce222[_0x2b66('0x31')];if(!_0x174176[_0x2b66('0x32')][_0x2b66('0x38')](_0x2b66('0x39'))){_0x9c677b[_0x2b66('0x1f')]=qs[_0x2b66('0x1f')](_0x174176[_0x2b66('0x32')]['limit']);_0x9c677b[_0x2b66('0x1d')]=qs[_0x2b66('0x1d')](_0x174176[_0x2b66('0x32')][_0x2b66('0x1d')]);}_0x9c677b['order']=qs[_0x2b66('0x3a')](_0x174176['query']['sort']);_0x9c677b['where']=qs[_0x2b66('0x34')](_[_0x2b66('0x3b')](_0x174176['query'],_0x3ce222[_0x2b66('0x34')]),_0x49424a);if(_0x174176['query'][_0x2b66('0x3c')]){_0x9c677b[_0x2b66('0x3d')]=_['merge'](_0x9c677b[_0x2b66('0x3d')],{'$or':_[_0x2b66('0x2c')](_0x49424a,function(_0x4c2feb){if(_0x4c2feb[_0x2b66('0x2f')]!==_0x2b66('0x3e')){var _0x48494c={};_0x48494c[_0x4c2feb[_0x2b66('0x29')]]={'$like':'%'+_0x174176[_0x2b66('0x32')][_0x2b66('0x3c')]+'%'};return _0x48494c;}})});}_0x9c677b=_[_0x2b66('0x3f')]({},_0x9c677b,_0x174176[_0x2b66('0x40')]);var _0x1eea32={'where':_0x9c677b[_0x2b66('0x3d')]};return db[_0x2b66('0x41')]['count'](_0x1eea32)['then'](function(_0x297320){_0x39bdbd[_0x2b66('0x20')]=_0x297320;if(_0x174176['query'][_0x2b66('0x42')]){_0x9c677b['include']=[{'all':!![]}];}return db[_0x2b66('0x41')][_0x2b66('0x43')](_0x9c677b);})['then'](function(_0x485f3b){_0x39bdbd[_0x2b66('0x44')]=_0x485f3b;return _0x39bdbd;})[_0x2b66('0x26')](respondWithFilteredResult(_0x49a763,_0x9c677b))[_0x2b66('0x45')](handleError(_0x49a763,null));};exports[_0x2b66('0x46')]=function(_0x24f7ed,_0x5c93ac){var _0x39811c={'raw':![],'where':{'id':_0x24f7ed[_0x2b66('0x47')]['id']}},_0x22c0c7={};_0x22c0c7['model']=_[_0x2b66('0x33')](db[_0x2b66('0x41')][_0x2b66('0x2d')]);_0x22c0c7[_0x2b66('0x32')]=_[_0x2b66('0x33')](_0x24f7ed['query']);_0x22c0c7[_0x2b66('0x34')]=_['intersection'](_0x22c0c7[_0x2b66('0x31')],_0x22c0c7[_0x2b66('0x32')]);_0x39811c[_0x2b66('0x36')]=_['intersection'](_0x22c0c7[_0x2b66('0x31')],qs[_0x2b66('0x48')](_0x24f7ed[_0x2b66('0x32')]['fields']));_0x39811c['attributes']=_0x39811c['attributes'][_0x2b66('0x37')]?_0x39811c[_0x2b66('0x36')]:_0x22c0c7['model'];if(_0x24f7ed[_0x2b66('0x32')][_0x2b66('0x42')]){_0x39811c[_0x2b66('0x49')]=[{'all':!![]}];}_0x39811c=_[_0x2b66('0x3f')]({},_0x39811c,_0x24f7ed[_0x2b66('0x40')]);return db[_0x2b66('0x41')][_0x2b66('0x4a')](_0x39811c)['then'](handleEntityNotFound(_0x5c93ac,null))[_0x2b66('0x26')](respondWithResult(_0x5c93ac,null))[_0x2b66('0x45')](handleError(_0x5c93ac,null));};exports[_0x2b66('0x4b')]=function(_0x31294b,_0x55c5ac){return db[_0x2b66('0x41')][_0x2b66('0x4b')](_0x31294b[_0x2b66('0x4c')],{})[_0x2b66('0x26')](respondWithResult(_0x55c5ac,0xc9))[_0x2b66('0x45')](handleError(_0x55c5ac,null));};exports['update']=function(_0x13a9ad,_0x20e380){if(_0x13a9ad[_0x2b66('0x4c')]['id']){delete _0x13a9ad[_0x2b66('0x4c')]['id'];}return db['FreshsalesConfiguration'][_0x2b66('0x4a')]({'where':{'id':_0x13a9ad[_0x2b66('0x47')]['id']}})[_0x2b66('0x26')](handleEntityNotFound(_0x20e380,null))[_0x2b66('0x26')](saveUpdates(_0x13a9ad[_0x2b66('0x4c')],null))[_0x2b66('0x26')](respondWithResult(_0x20e380,null))['catch'](handleError(_0x20e380,null));};exports[_0x2b66('0x25')]=function(_0x3d3010,_0x31e9c4){return db[_0x2b66('0x41')][_0x2b66('0x4a')]({'where':{'id':_0x3d3010[_0x2b66('0x47')]['id']}})[_0x2b66('0x26')](handleEntityNotFound(_0x31e9c4,null))[_0x2b66('0x26')](removeEntity(_0x31e9c4,null))[_0x2b66('0x45')](handleError(_0x31e9c4,null));};exports['getSubjects']=function(_0x121658,_0x2623f6,_0x1abe05){var _0x5b9639={};var _0x5939f7={};var _0x57366d;var _0x2e1505;return db[_0x2b66('0x41')]['findOne']({'where':{'id':_0x121658[_0x2b66('0x47')]['id']}})[_0x2b66('0x26')](handleEntityNotFound(_0x2623f6,null))[_0x2b66('0x26')](function(_0x91d908){if(_0x91d908){_0x57366d=_0x91d908;_0x5939f7['model']=_[_0x2b66('0x33')](db[_0x2b66('0x4d')][_0x2b66('0x2d')]);_0x5939f7[_0x2b66('0x32')]=_[_0x2b66('0x33')](_0x121658[_0x2b66('0x32')]);_0x5939f7[_0x2b66('0x34')]=_[_0x2b66('0x35')](_0x5939f7['model'],_0x5939f7[_0x2b66('0x32')]);_0x5b9639[_0x2b66('0x36')]=_[_0x2b66('0x35')](_0x5939f7[_0x2b66('0x31')],qs['fields'](_0x121658[_0x2b66('0x32')][_0x2b66('0x48')]));_0x5b9639['attributes']=_0x5b9639[_0x2b66('0x36')]['length']?_0x5b9639[_0x2b66('0x36')]:_0x5939f7['model'];_0x5b9639[_0x2b66('0x4e')]=qs['sort'](_0x121658[_0x2b66('0x32')]['sort']);_0x5b9639[_0x2b66('0x3d')]=qs[_0x2b66('0x34')](_[_0x2b66('0x3b')](_0x121658[_0x2b66('0x32')],_0x5939f7[_0x2b66('0x34')]));if(_0x121658[_0x2b66('0x32')][_0x2b66('0x3c')]){_0x5b9639[_0x2b66('0x3d')]=_[_0x2b66('0x3f')](_0x5b9639[_0x2b66('0x3d')],{'$or':_[_0x2b66('0x2c')](_0x5b9639[_0x2b66('0x36')],function(_0x1875a1){var _0x521220={};_0x521220[_0x1875a1]={'$like':'%'+_0x121658['query'][_0x2b66('0x3c')]+'%'};return _0x521220;})});}_0x5b9639=_[_0x2b66('0x3f')]({},_0x5b9639,_0x121658[_0x2b66('0x40')]);return _0x57366d[_0x2b66('0x4f')](_0x5b9639);}})[_0x2b66('0x26')](function(_0x283a46){if(_0x283a46){_0x2e1505=_0x283a46[_0x2b66('0x37')];if(!_0x121658[_0x2b66('0x32')][_0x2b66('0x38')](_0x2b66('0x39'))){_0x5b9639['limit']=qs['limit'](_0x121658[_0x2b66('0x32')][_0x2b66('0x1f')]);_0x5b9639[_0x2b66('0x1d')]=qs['offset'](_0x121658[_0x2b66('0x32')][_0x2b66('0x1d')]);}return _0x57366d[_0x2b66('0x4f')](_0x5b9639);}})['then'](function(_0x3c5214){if(_0x3c5214){return _0x3c5214?{'count':_0x2e1505,'rows':_0x3c5214}:null;}})[_0x2b66('0x26')](respondWithResult(_0x2623f6,null))[_0x2b66('0x45')](handleError(_0x2623f6,null));};exports['getDescriptions']=function(_0x13f55d,_0x2f0ecb,_0x151fa8){var _0x4a2d87={};var _0x41bdb0={};var _0x500c06;var _0x19b871;return db[_0x2b66('0x41')][_0x2b66('0x50')]({'where':{'id':_0x13f55d[_0x2b66('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f0ecb,null))[_0x2b66('0x26')](function(_0x26973c){if(_0x26973c){_0x500c06=_0x26973c;_0x41bdb0['model']=_[_0x2b66('0x33')](db[_0x2b66('0x4d')]['rawAttributes']);_0x41bdb0['query']=_[_0x2b66('0x33')](_0x13f55d[_0x2b66('0x32')]);_0x41bdb0[_0x2b66('0x34')]=_[_0x2b66('0x35')](_0x41bdb0[_0x2b66('0x31')],_0x41bdb0[_0x2b66('0x32')]);_0x4a2d87[_0x2b66('0x36')]=_[_0x2b66('0x35')](_0x41bdb0[_0x2b66('0x31')],qs[_0x2b66('0x48')](_0x13f55d[_0x2b66('0x32')][_0x2b66('0x48')]));_0x4a2d87[_0x2b66('0x36')]=_0x4a2d87['attributes'][_0x2b66('0x37')]?_0x4a2d87[_0x2b66('0x36')]:_0x41bdb0['model'];_0x4a2d87['order']=qs['sort'](_0x13f55d[_0x2b66('0x32')][_0x2b66('0x3a')]);_0x4a2d87[_0x2b66('0x3d')]=qs[_0x2b66('0x34')](_[_0x2b66('0x3b')](_0x13f55d[_0x2b66('0x32')],_0x41bdb0[_0x2b66('0x34')]));if(_0x13f55d[_0x2b66('0x32')][_0x2b66('0x3c')]){_0x4a2d87[_0x2b66('0x3d')]=_[_0x2b66('0x3f')](_0x4a2d87[_0x2b66('0x3d')],{'$or':_[_0x2b66('0x2c')](_0x4a2d87['attributes'],function(_0x193bed){var _0x132203={};_0x132203[_0x193bed]={'$like':'%'+_0x13f55d[_0x2b66('0x32')]['filter']+'%'};return _0x132203;})});}_0x4a2d87=_[_0x2b66('0x3f')]({},_0x4a2d87,_0x13f55d[_0x2b66('0x40')]);return _0x500c06[_0x2b66('0x51')](_0x4a2d87);}})[_0x2b66('0x26')](function(_0x4b3f0e){if(_0x4b3f0e){_0x19b871=_0x4b3f0e['length'];if(!_0x13f55d['query'][_0x2b66('0x38')](_0x2b66('0x39'))){_0x4a2d87[_0x2b66('0x1f')]=qs['limit'](_0x13f55d[_0x2b66('0x32')]['limit']);_0x4a2d87[_0x2b66('0x1d')]=qs[_0x2b66('0x1d')](_0x13f55d[_0x2b66('0x32')][_0x2b66('0x1d')]);}return _0x500c06[_0x2b66('0x51')](_0x4a2d87);}})[_0x2b66('0x26')](function(_0x1f4d8a){if(_0x1f4d8a){return _0x1f4d8a?{'count':_0x19b871,'rows':_0x1f4d8a}:null;}})[_0x2b66('0x26')](respondWithResult(_0x2f0ecb,null))[_0x2b66('0x45')](handleError(_0x2f0ecb,null));};exports[_0x2b66('0x52')]=function(_0x13649f,_0x3bec2e,_0xc8c79e){var _0x2f70df={};var _0x2d79bf={};var _0x4b4c23;var _0x299f9b;return db['FreshsalesConfiguration'][_0x2b66('0x50')]({'where':{'id':_0x13649f[_0x2b66('0x47')]['id']}})[_0x2b66('0x26')](handleEntityNotFound(_0x3bec2e,null))[_0x2b66('0x26')](function(_0x3834fb){if(_0x3834fb){_0x4b4c23=_0x3834fb;_0x2d79bf[_0x2b66('0x31')]=_[_0x2b66('0x33')](db['FreshsalesField'][_0x2b66('0x2d')]);_0x2d79bf[_0x2b66('0x32')]=_[_0x2b66('0x33')](_0x13649f[_0x2b66('0x32')]);_0x2d79bf[_0x2b66('0x34')]=_[_0x2b66('0x35')](_0x2d79bf['model'],_0x2d79bf['query']);_0x2f70df[_0x2b66('0x36')]=_['intersection'](_0x2d79bf[_0x2b66('0x31')],qs['fields'](_0x13649f[_0x2b66('0x32')][_0x2b66('0x48')]));_0x2f70df[_0x2b66('0x36')]=_0x2f70df[_0x2b66('0x36')][_0x2b66('0x37')]?_0x2f70df['attributes']:_0x2d79bf['model'];_0x2f70df[_0x2b66('0x4e')]=qs[_0x2b66('0x3a')](_0x13649f[_0x2b66('0x32')]['sort']);_0x2f70df[_0x2b66('0x3d')]=qs['filters'](_[_0x2b66('0x3b')](_0x13649f['query'],_0x2d79bf[_0x2b66('0x34')]));if(_0x13649f[_0x2b66('0x32')][_0x2b66('0x3c')]){_0x2f70df[_0x2b66('0x3d')]=_['merge'](_0x2f70df[_0x2b66('0x3d')],{'$or':_[_0x2b66('0x2c')](_0x2f70df[_0x2b66('0x36')],function(_0x3d61ad){var _0x2bec27={};_0x2bec27[_0x3d61ad]={'$like':'%'+_0x13649f[_0x2b66('0x32')][_0x2b66('0x3c')]+'%'};return _0x2bec27;})});}_0x2f70df=_[_0x2b66('0x3f')]({},_0x2f70df,_0x13649f[_0x2b66('0x40')]);return _0x4b4c23[_0x2b66('0x52')](_0x2f70df);}})[_0x2b66('0x26')](function(_0x3b7a4e){if(_0x3b7a4e){_0x299f9b=_0x3b7a4e[_0x2b66('0x37')];if(!_0x13649f[_0x2b66('0x32')][_0x2b66('0x38')]('nolimit')){_0x2f70df['limit']=qs[_0x2b66('0x1f')](_0x13649f[_0x2b66('0x32')][_0x2b66('0x1f')]);_0x2f70df[_0x2b66('0x1d')]=qs[_0x2b66('0x1d')](_0x13649f[_0x2b66('0x32')][_0x2b66('0x1d')]);}return _0x4b4c23[_0x2b66('0x52')](_0x2f70df);}})[_0x2b66('0x26')](function(_0x2161c2){if(_0x2161c2){return _0x2161c2?{'count':_0x299f9b,'rows':_0x2161c2}:null;}})['then'](respondWithResult(_0x3bec2e,null))['catch'](handleError(_0x3bec2e,null));};
\ No newline at end of file
index cfa8959..8e470f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd904=['FreshsalesConfiguration','int_freshsales_configurations','lodash','api','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports'];(function(_0x3a2b0e,_0x10811c){var _0x29e201=function(_0x23df38){while(--_0x23df38){_0x3a2b0e['push'](_0x3a2b0e['shift']());}};_0x29e201(++_0x10811c);}(_0xd904,0x66));var _0x4d90=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xd904[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x4d90('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4d90('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d90('0x2'));var fs=require('fs');var path=require(_0x4d90('0x3'));var rimraf=require(_0x4d90('0x4'));var config=require(_0x4d90('0x5'));var attributes=require(_0x4d90('0x6'));module[_0x4d90('0x7')]=function(_0x406c62,_0x1f4baa){return _0x406c62['define'](_0x4d90('0x8'),attributes,{'tableName':_0x4d90('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b61=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','int_freshsales_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x50006f,_0x59cc88){var _0x5c5b28=function(_0x106810){while(--_0x106810){_0x50006f['push'](_0x50006f['shift']());}};_0x5c5b28(++_0x59cc88);}(_0x6b61,0xad));var _0x16b6=function(_0xa9a245,_0x2a0387){_0xa9a245=_0xa9a245-0x0;var _0x2d0eaa=_0x6b61[_0xa9a245];return _0x2d0eaa;};'use strict';var _=require('lodash');var util=require(_0x16b6('0x0'));var logger=require(_0x16b6('0x1'))(_0x16b6('0x2'));var moment=require(_0x16b6('0x3'));var BPromise=require(_0x16b6('0x4'));var rp=require(_0x16b6('0x5'));var fs=require('fs');var path=require(_0x16b6('0x6'));var rimraf=require(_0x16b6('0x7'));var config=require(_0x16b6('0x8'));var attributes=require(_0x16b6('0x9'));module['exports']=function(_0x26ebe6,_0x341812){return _0x26ebe6[_0x16b6('0xa')]('FreshsalesConfiguration',attributes,{'tableName':_0x16b6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a6fa50..688db44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75d0=['util','moment','ioredis','../../mysqldb','../../config/environment','jayson/promise','then','request\x20sent','debug','stringify','error','FreshsalesConfiguration,\x20%s,\x20%s','result','message','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x75d0,0x11d));var _0x075d=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x75d0[_0x46428c];return _0x16a677;};'use strict';var _=require('lodash');var util=require(_0x075d('0x0'));var moment=require(_0x075d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x075d('0x2'));var db=require(_0x075d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x075d('0x4'));var jayson=require(_0x075d('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b3010,_0x892fd7,_0x558ea1){return new BPromise(function(_0x3cd63e,_0xac6b1b){return client['request'](_0x5b3010,_0x558ea1)[_0x075d('0x6')](function(_0x2526e0){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x892fd7,_0x075d('0x7'));logger[_0x075d('0x8')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x892fd7,_0x075d('0x7'),JSON[_0x075d('0x9')](_0x2526e0));if(_0x2526e0[_0x075d('0xa')]){if(_0x2526e0['error']['code']===0x1f4){logger[_0x075d('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x892fd7,_0x2526e0[_0x075d('0xa')]['message']);return _0xac6b1b(_0x2526e0[_0x075d('0xa')]['message']);}logger[_0x075d('0xa')](_0x075d('0xb'),_0x892fd7,_0x2526e0[_0x075d('0xa')]['message']);return _0x3cd63e(_0x2526e0[_0x075d('0xa')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x892fd7,_0x075d('0x7'));_0x3cd63e(_0x2526e0[_0x075d('0xc')][_0x075d('0xd')]);}})[_0x075d('0xe')](function(_0x29ffa6){logger['error'](_0x075d('0xb'),_0x892fd7,_0x29ffa6);_0xac6b1b(_0x29ffa6);});});}
\ No newline at end of file
+var _0xfded=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','debug','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','result','lodash','moment','randomstring','ioredis'];(function(_0x3a27df,_0x5e1fb5){var _0x21267d=function(_0x5ab73a){while(--_0x5ab73a){_0x3a27df['push'](_0x3a27df['shift']());}};_0x21267d(++_0x5e1fb5);}(_0xfded,0x1f4));var _0xdfde=function(_0x222472,_0x33ea87){_0x222472=_0x222472-0x0;var _0x5d601f=_0xfded[_0x222472];return _0x5d601f;};'use strict';var _=require(_0xdfde('0x0'));var util=require('util');var moment=require(_0xdfde('0x1'));var BPromise=require('bluebird');var rs=require(_0xdfde('0x2'));var fs=require('fs');var Redis=require(_0xdfde('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfde('0x4'));var logger=require(_0xdfde('0x5'))(_0xdfde('0x6'));var config=require(_0xdfde('0x7'));var jayson=require(_0xdfde('0x8'));var client=jayson[_0xdfde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c933a,_0x27cffa,_0x395f0a){return new BPromise(function(_0x54b799,_0xf82fb2){return client[_0xdfde('0xa')](_0x5c933a,_0x395f0a)[_0xdfde('0xb')](function(_0xe21f3f){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x27cffa,'request\x20sent');logger[_0xdfde('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x27cffa,_0xdfde('0xd'),JSON[_0xdfde('0xe')](_0xe21f3f));if(_0xe21f3f[_0xdfde('0xf')]){if(_0xe21f3f[_0xdfde('0xf')][_0xdfde('0x10')]===0x1f4){logger['error'](_0xdfde('0x11'),_0x27cffa,_0xe21f3f['error'][_0xdfde('0x12')]);return _0xf82fb2(_0xe21f3f[_0xdfde('0xf')][_0xdfde('0x12')]);}logger[_0xdfde('0xf')](_0xdfde('0x11'),_0x27cffa,_0xe21f3f['error'][_0xdfde('0x12')]);return _0x54b799(_0xe21f3f[_0xdfde('0xf')][_0xdfde('0x12')]);}else{logger[_0xdfde('0x13')](_0xdfde('0x11'),_0x27cffa,_0xdfde('0xd'));_0x54b799(_0xe21f3f[_0xdfde('0x14')][_0xdfde('0x12')]);}})['catch'](function(_0xe021b9){logger[_0xdfde('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x27cffa,_0xe021b9);_0xf82fb2(_0xe021b9);});});}
\ No newline at end of file
index 6813474..9c4a714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7eb9=['get','show','create','put','/:id','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesField.controller','isAuthenticated'];(function(_0x865ca5,_0x24daae){var _0x1bc1ba=function(_0x370b77){while(--_0x370b77){_0x865ca5['push'](_0x865ca5['shift']());}};_0x1bc1ba(++_0x24daae);}(_0x7eb9,0xd9));var _0x97eb=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x7eb9[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x97eb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97eb('0x1'));var express=require('express');var router=express[_0x97eb('0x2')]();var fs_extra=require(_0x97eb('0x3'));var auth=require(_0x97eb('0x4'));var interaction=require(_0x97eb('0x5'));var config=require('../../config/environment');var controller=require(_0x97eb('0x6'));router['get']('/',auth[_0x97eb('0x7')](),controller['index']);router[_0x97eb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x97eb('0x9')]);router['post']('/',auth[_0x97eb('0x7')](),controller[_0x97eb('0xa')]);router[_0x97eb('0xb')](_0x97eb('0xc'),auth[_0x97eb('0x7')](),controller['update']);router['delete'](_0x97eb('0xc'),auth[_0x97eb('0x7')](),controller[_0x97eb('0xd')]);module[_0x97eb('0xe')]=router;
\ No newline at end of file
+var _0x26c2=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','connect-timeout','express'];(function(_0xac9931,_0x31ddd6){var _0x268b85=function(_0x54777d){while(--_0x54777d){_0xac9931['push'](_0xac9931['shift']());}};_0x268b85(++_0x31ddd6);}(_0x26c2,0x130));var _0x226c=function(_0xedfe8d,_0x4d585a){_0xedfe8d=_0xedfe8d-0x0;var _0x43d5d7=_0x26c2[_0xedfe8d];return _0x43d5d7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./intFreshsalesField.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0xb')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router[_0x226c('0xd')]('/:id',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router['delete']('/:id',auth[_0x226c('0x7')](),controller[_0x226c('0xf')]);module[_0x226c('0x10')]=router;
\ No newline at end of file
index 4369071..bf4162a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce7a=['STRING','customVariable','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x55eb74,_0xae5f0b){var _0x3dbd92=function(_0x4499c4){while(--_0x4499c4){_0x55eb74['push'](_0x55eb74['shift']());}};_0x3dbd92(++_0xae5f0b);}(_0xce7a,0x1bc));var _0xace7=function(_0x2339f6,_0x220416){_0x2339f6=_0x2339f6-0x0;var _0x4c31dd=_0xce7a[_0x2339f6];return _0x4c31dd;};'use strict';var Sequelize=require(_0xace7('0x0'));module['exports']={'type':{'type':Sequelize[_0xace7('0x1')](_0xace7('0x2'),_0xace7('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xace7('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xace7('0x2'),_0xace7('0x3'),_0xace7('0x5'))},'keyContent':{'type':Sequelize[_0xace7('0x4')]},'idField':{'type':Sequelize[_0xace7('0x4')]},'nameField':{'type':Sequelize[_0xace7('0x4')]},'customField':{'type':Sequelize[_0xace7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xace7('0x4')]}};
\ No newline at end of file
+var _0xd476=['ENUM','variable','customVariable','picklist','string','STRING','sequelize','exports'];(function(_0x60b4aa,_0x51d5ab){var _0x4dc3a3=function(_0x104af5){while(--_0x104af5){_0x60b4aa['push'](_0x60b4aa['shift']());}};_0x4dc3a3(++_0x51d5ab);}(_0xd476,0x7e));var _0x6d47=function(_0x1eaaeb,_0x24de06){_0x1eaaeb=_0x1eaaeb-0x0;var _0x1ef2d4=_0xd476[_0x1eaaeb];return _0x1ef2d4;};'use strict';var Sequelize=require(_0x6d47('0x0'));module[_0x6d47('0x1')]={'type':{'type':Sequelize[_0x6d47('0x2')]('string',_0x6d47('0x3'),_0x6d47('0x4'),'keyValue',_0x6d47('0x5')),'defaultValue':_0x6d47('0x6')},'content':{'type':Sequelize[_0x6d47('0x7')]},'key':{'type':Sequelize[_0x6d47('0x7')]},'keyType':{'type':Sequelize[_0x6d47('0x2')](_0x6d47('0x6'),'variable',_0x6d47('0x4'))},'keyContent':{'type':Sequelize[_0x6d47('0x7')]},'idField':{'type':Sequelize[_0x6d47('0x7')]},'nameField':{'type':Sequelize[_0x6d47('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6d47('0x7')]}};
\ No newline at end of file
index 14feb19..57dc1d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8102=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','name','send','index','rawAttributes','fieldName','map','query','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FreshsalesField','include','findAll','rows','catch','show','params','keys','intersection','length','includeAll','find','create','body','update'];(function(_0x44e6e3,_0x31f4db){var _0x435652=function(_0x45306e){while(--_0x45306e){_0x44e6e3['push'](_0x44e6e3['shift']());}};_0x435652(++_0x31f4db);}(_0x8102,0x130));var _0x2810=function(_0x498dd8,_0x363519){_0x498dd8=_0x498dd8-0x0;var _0x20b73f=_0x8102[_0x498dd8];return _0x20b73f;};'use strict';var emlformat=require(_0x2810('0x0'));var rimraf=require(_0x2810('0x1'));var zipdir=require(_0x2810('0x2'));var jsonpatch=require(_0x2810('0x3'));var rp=require(_0x2810('0x4'));var moment=require('moment');var BPromise=require(_0x2810('0x5'));var Mustache=require('mustache');var util=require(_0x2810('0x6'));var path=require(_0x2810('0x7'));var sox=require('sox');var csv=require(_0x2810('0x8'));var ejs=require(_0x2810('0x9'));var fs=require('fs');var fs_extra=require(_0x2810('0xa'));var _=require(_0x2810('0xb'));var squel=require(_0x2810('0xc'));var crypto=require(_0x2810('0xd'));var jsforce=require(_0x2810('0xe'));var deskjs=require(_0x2810('0xf'));var toCsv=require(_0x2810('0x8'));var querystring=require(_0x2810('0x10'));var Papa=require(_0x2810('0x11'));var Redis=require('ioredis');var authService=require(_0x2810('0x12'));var qs=require(_0x2810('0x13'));var as=require(_0x2810('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x2810('0x15'));var config=require(_0x2810('0x16'));var licenseUtil=require(_0x2810('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5afb8b,_0x470817){_0x470817=_0x470817||0xcc;return function(_0x23bda0){if(_0x23bda0){return _0x5afb8b[_0x2810('0x18')](_0x470817);}return _0x5afb8b[_0x2810('0x19')](_0x470817)[_0x2810('0x1a')]();};}function respondWithResult(_0xa891e8,_0x5570f1){_0x5570f1=_0x5570f1||0xc8;return function(_0x4ecb29){if(_0x4ecb29){return _0xa891e8[_0x2810('0x19')](_0x5570f1)[_0x2810('0x1b')](_0x4ecb29);}};}function respondWithFilteredResult(_0x32ca41,_0x45208e){return function(_0x1cfa06){if(_0x1cfa06){var _0x1eb85e=typeof _0x45208e[_0x2810('0x1c')]===_0x2810('0x1d')&&typeof _0x45208e[_0x2810('0x1e')]==='undefined';var _0x27271b=_0x1cfa06[_0x2810('0x1f')];var _0x48c2bc=_0x1eb85e?0x0:_0x45208e['offset'];var _0x58a693=_0x1eb85e?_0x1cfa06[_0x2810('0x1f')]:_0x45208e[_0x2810('0x1c')]+_0x45208e['limit'];var _0x1d10e9;if(_0x58a693>=_0x27271b){_0x58a693=_0x27271b;_0x1d10e9=0xc8;}else{_0x1d10e9=0xce;}_0x32ca41[_0x2810('0x19')](_0x1d10e9);return _0x32ca41[_0x2810('0x20')](_0x2810('0x21'),_0x48c2bc+'-'+_0x58a693+'/'+_0x27271b)[_0x2810('0x1b')](_0x1cfa06);}return null;};}function patchUpdates(_0x9a96bc){return function(_0x3a6c2b){try{jsonpatch[_0x2810('0x22')](_0x3a6c2b,_0x9a96bc,!![]);}catch(_0x569907){return BPromise[_0x2810('0x23')](_0x569907);}return _0x3a6c2b[_0x2810('0x24')]();};}function saveUpdates(_0x3955a2,_0x3dade3){return function(_0x2acb56){if(_0x2acb56){return _0x2acb56['update'](_0x3955a2)['then'](function(_0xc45e75){return _0xc45e75;});}return null;};}function removeEntity(_0x20ddbb,_0x4b51a0){return function(_0x569a9c){if(_0x569a9c){return _0x569a9c['destroy']()[_0x2810('0x25')](function(){_0x20ddbb[_0x2810('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220b8b,_0x72b17e){return function(_0x4a2317){if(!_0x4a2317){_0x220b8b[_0x2810('0x18')](0x194);}return _0x4a2317;};}function handleError(_0x1d8782,_0x416cb7){_0x416cb7=_0x416cb7||0x1f4;return function(_0x3a4fef){logger[_0x2810('0x26')](_0x3a4fef['stack']);if(_0x3a4fef[_0x2810('0x27')]){delete _0x3a4fef['name'];}_0x1d8782[_0x2810('0x19')](_0x416cb7)[_0x2810('0x28')](_0x3a4fef);};}exports[_0x2810('0x29')]=function(_0xbb5ed0,_0x5885d5){var _0x4576b6={},_0x8c29e3={},_0x20cb67={'count':0x0,'rows':[]};var _0x165fb0=_['map'](db['FreshsalesField'][_0x2810('0x2a')],function(_0x16f31e){return{'name':_0x16f31e[_0x2810('0x2b')],'type':_0x16f31e['type']['key']};});_0x8c29e3['model']=_[_0x2810('0x2c')](_0x165fb0,_0x2810('0x27'));_0x8c29e3[_0x2810('0x2d')]=_['keys'](_0xbb5ed0['query']);_0x8c29e3['filters']=_['intersection'](_0x8c29e3[_0x2810('0x2e')],_0x8c29e3[_0x2810('0x2d')]);_0x4576b6[_0x2810('0x2f')]=_['intersection'](_0x8c29e3[_0x2810('0x2e')],qs[_0x2810('0x30')](_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x30')]));_0x4576b6[_0x2810('0x2f')]=_0x4576b6[_0x2810('0x2f')]['length']?_0x4576b6['attributes']:_0x8c29e3[_0x2810('0x2e')];if(!_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x31')](_0x2810('0x32'))){_0x4576b6[_0x2810('0x1e')]=qs['limit'](_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x1e')]);_0x4576b6[_0x2810('0x1c')]=qs[_0x2810('0x1c')](_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x1c')]);}_0x4576b6[_0x2810('0x33')]=qs['sort'](_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x34')]);_0x4576b6[_0x2810('0x35')]=qs[_0x2810('0x36')](_[_0x2810('0x37')](_0xbb5ed0[_0x2810('0x2d')],_0x8c29e3[_0x2810('0x36')]),_0x165fb0);if(_0xbb5ed0[_0x2810('0x2d')][_0x2810('0x38')]){_0x4576b6[_0x2810('0x35')]=_[_0x2810('0x39')](_0x4576b6[_0x2810('0x35')],{'$or':_['map'](_0x165fb0,function(_0x34917c){if(_0x34917c[_0x2810('0x3a')]!==_0x2810('0x3b')){var _0x129317={};_0x129317[_0x34917c[_0x2810('0x27')]]={'$like':'%'+_0xbb5ed0['query'][_0x2810('0x38')]+'%'};return _0x129317;}})});}_0x4576b6=_[_0x2810('0x39')]({},_0x4576b6,_0xbb5ed0[_0x2810('0x3c')]);var _0x2f804c={'where':_0x4576b6[_0x2810('0x35')]};return db[_0x2810('0x3d')]['count'](_0x2f804c)['then'](function(_0x16e3b6){_0x20cb67[_0x2810('0x1f')]=_0x16e3b6;if(_0xbb5ed0[_0x2810('0x2d')]['includeAll']){_0x4576b6[_0x2810('0x3e')]=[{'all':!![]}];}return db[_0x2810('0x3d')][_0x2810('0x3f')](_0x4576b6);})['then'](function(_0x1637d7){_0x20cb67[_0x2810('0x40')]=_0x1637d7;return _0x20cb67;})[_0x2810('0x25')](respondWithFilteredResult(_0x5885d5,_0x4576b6))[_0x2810('0x41')](handleError(_0x5885d5,null));};exports[_0x2810('0x42')]=function(_0x24d434,_0x981276){var _0x7a6a4f={'raw':!![],'where':{'id':_0x24d434[_0x2810('0x43')]['id']}},_0x507f92={};_0x507f92['model']=_[_0x2810('0x44')](db['FreshsalesField'][_0x2810('0x2a')]);_0x507f92[_0x2810('0x2d')]=_[_0x2810('0x44')](_0x24d434['query']);_0x507f92[_0x2810('0x36')]=_['intersection'](_0x507f92[_0x2810('0x2e')],_0x507f92[_0x2810('0x2d')]);_0x7a6a4f['attributes']=_[_0x2810('0x45')](_0x507f92[_0x2810('0x2e')],qs[_0x2810('0x30')](_0x24d434['query'][_0x2810('0x30')]));_0x7a6a4f['attributes']=_0x7a6a4f[_0x2810('0x2f')][_0x2810('0x46')]?_0x7a6a4f[_0x2810('0x2f')]:_0x507f92[_0x2810('0x2e')];if(_0x24d434['query'][_0x2810('0x47')]){_0x7a6a4f[_0x2810('0x3e')]=[{'all':!![]}];}_0x7a6a4f=_[_0x2810('0x39')]({},_0x7a6a4f,_0x24d434[_0x2810('0x3c')]);return db[_0x2810('0x3d')][_0x2810('0x48')](_0x7a6a4f)[_0x2810('0x25')](handleEntityNotFound(_0x981276,null))[_0x2810('0x25')](respondWithResult(_0x981276,null))[_0x2810('0x41')](handleError(_0x981276,null));};exports[_0x2810('0x49')]=function(_0x12c6fb,_0x26019e){return db[_0x2810('0x3d')][_0x2810('0x49')](_0x12c6fb[_0x2810('0x4a')],{})[_0x2810('0x25')](respondWithResult(_0x26019e,0xc9))[_0x2810('0x41')](handleError(_0x26019e,null));};exports[_0x2810('0x4b')]=function(_0x59a54b,_0x2466c1){if(_0x59a54b[_0x2810('0x4a')]['id']){delete _0x59a54b[_0x2810('0x4a')]['id'];}return db['FreshsalesField'][_0x2810('0x48')]({'where':{'id':_0x59a54b[_0x2810('0x43')]['id']}})[_0x2810('0x25')](handleEntityNotFound(_0x2466c1,null))[_0x2810('0x25')](saveUpdates(_0x59a54b['body'],null))[_0x2810('0x25')](respondWithResult(_0x2466c1,null))[_0x2810('0x41')](handleError(_0x2466c1,null));};exports['destroy']=function(_0x32bf29,_0x1a82f1){return db['FreshsalesField'][_0x2810('0x48')]({'where':{'id':_0x32bf29['params']['id']}})[_0x2810('0x25')](handleEntityNotFound(_0x1a82f1,null))[_0x2810('0x25')](removeEntity(_0x1a82f1,null))[_0x2810('0x41')](handleError(_0x1a82f1,null));};
\ No newline at end of file
+var _0x7573=['../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','catch','show','find','create','body','params','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x25effe,_0x3236ab){var _0xf10366=function(_0x257f13){while(--_0x257f13){_0x25effe['push'](_0x25effe['shift']());}};_0xf10366(++_0x3236ab);}(_0x7573,0x10b));var _0x3757=function(_0x4f44c2,_0xa54835){_0x4f44c2=_0x4f44c2-0x0;var _0x82682b=_0x7573[_0x4f44c2];return _0x82682b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3757('0x0'));var zipdir=require(_0x3757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3757('0x2'));var BPromise=require(_0x3757('0x3'));var Mustache=require(_0x3757('0x4'));var util=require('util');var path=require(_0x3757('0x5'));var sox=require(_0x3757('0x6'));var csv=require(_0x3757('0x7'));var ejs=require(_0x3757('0x8'));var fs=require('fs');var fs_extra=require(_0x3757('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3757('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3757('0xb'));var toCsv=require(_0x3757('0x7'));var querystring=require(_0x3757('0xc'));var Papa=require('papaparse');var Redis=require(_0x3757('0xd'));var authService=require(_0x3757('0xe'));var qs=require(_0x3757('0xf'));var as=require(_0x3757('0x10'));var hardwareService=require(_0x3757('0x11'));var logger=require(_0x3757('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3757('0x13'));var licenseUtil=require(_0x3757('0x14'));var db=require(_0x3757('0x15'))['db'];function respondWithStatusCode(_0x8d29fb,_0x20cbf){_0x20cbf=_0x20cbf||0xcc;return function(_0x314141){if(_0x314141){return _0x8d29fb['sendStatus'](_0x20cbf);}return _0x8d29fb['status'](_0x20cbf)[_0x3757('0x16')]();};}function respondWithResult(_0x3d41bd,_0x47c4f2){_0x47c4f2=_0x47c4f2||0xc8;return function(_0xa2c703){if(_0xa2c703){return _0x3d41bd[_0x3757('0x17')](_0x47c4f2)[_0x3757('0x18')](_0xa2c703);}};}function respondWithFilteredResult(_0xfa75d6,_0x258812){return function(_0x27af5e){if(_0x27af5e){var _0xdbabe5=typeof _0x258812[_0x3757('0x19')]===_0x3757('0x1a')&&typeof _0x258812['limit']==='undefined';var _0xeea14d=_0x27af5e[_0x3757('0x1b')];var _0x71cef8=_0xdbabe5?0x0:_0x258812['offset'];var _0x34f2aa=_0xdbabe5?_0x27af5e[_0x3757('0x1b')]:_0x258812['offset']+_0x258812[_0x3757('0x1c')];var _0x1f66de;if(_0x34f2aa>=_0xeea14d){_0x34f2aa=_0xeea14d;_0x1f66de=0xc8;}else{_0x1f66de=0xce;}_0xfa75d6[_0x3757('0x17')](_0x1f66de);return _0xfa75d6['set'](_0x3757('0x1d'),_0x71cef8+'-'+_0x34f2aa+'/'+_0xeea14d)['json'](_0x27af5e);}return null;};}function patchUpdates(_0x2d652f){return function(_0x278867){try{jsonpatch[_0x3757('0x1e')](_0x278867,_0x2d652f,!![]);}catch(_0x4453a9){return BPromise['reject'](_0x4453a9);}return _0x278867['save']();};}function saveUpdates(_0xc30131,_0x13ef54){return function(_0x2fc5a7){if(_0x2fc5a7){return _0x2fc5a7[_0x3757('0x1f')](_0xc30131)[_0x3757('0x20')](function(_0x3d7d66){return _0x3d7d66;});}return null;};}function removeEntity(_0x38a90b,_0x1ce3b9){return function(_0x40503d){if(_0x40503d){return _0x40503d[_0x3757('0x21')]()['then'](function(){_0x38a90b[_0x3757('0x17')](0xcc)[_0x3757('0x16')]();});}};}function handleEntityNotFound(_0x5d75c8,_0x21d09f){return function(_0x526e74){if(!_0x526e74){_0x5d75c8[_0x3757('0x22')](0x194);}return _0x526e74;};}function handleError(_0xf2d6b2,_0x20a422){_0x20a422=_0x20a422||0x1f4;return function(_0x3de7a3){logger[_0x3757('0x23')](_0x3de7a3[_0x3757('0x24')]);if(_0x3de7a3[_0x3757('0x25')]){delete _0x3de7a3[_0x3757('0x25')];}_0xf2d6b2[_0x3757('0x17')](_0x20a422)[_0x3757('0x26')](_0x3de7a3);};}exports[_0x3757('0x27')]=function(_0xb715ab,_0x440e21){var _0x2d8948={},_0x21680d={},_0x35052d={'count':0x0,'rows':[]};var _0x3b8f57=_[_0x3757('0x28')](db[_0x3757('0x29')][_0x3757('0x2a')],function(_0x6ed933){return{'name':_0x6ed933[_0x3757('0x2b')],'type':_0x6ed933[_0x3757('0x2c')][_0x3757('0x2d')]};});_0x21680d[_0x3757('0x2e')]=_[_0x3757('0x28')](_0x3b8f57,'name');_0x21680d['query']=_[_0x3757('0x2f')](_0xb715ab[_0x3757('0x30')]);_0x21680d[_0x3757('0x31')]=_['intersection'](_0x21680d[_0x3757('0x2e')],_0x21680d['query']);_0x2d8948[_0x3757('0x32')]=_[_0x3757('0x33')](_0x21680d['model'],qs[_0x3757('0x34')](_0xb715ab[_0x3757('0x30')][_0x3757('0x34')]));_0x2d8948[_0x3757('0x32')]=_0x2d8948[_0x3757('0x32')][_0x3757('0x35')]?_0x2d8948[_0x3757('0x32')]:_0x21680d[_0x3757('0x2e')];if(!_0xb715ab['query'][_0x3757('0x36')](_0x3757('0x37'))){_0x2d8948[_0x3757('0x1c')]=qs['limit'](_0xb715ab['query']['limit']);_0x2d8948['offset']=qs[_0x3757('0x19')](_0xb715ab['query']['offset']);}_0x2d8948[_0x3757('0x38')]=qs[_0x3757('0x39')](_0xb715ab[_0x3757('0x30')][_0x3757('0x39')]);_0x2d8948[_0x3757('0x3a')]=qs[_0x3757('0x31')](_['pick'](_0xb715ab['query'],_0x21680d[_0x3757('0x31')]),_0x3b8f57);if(_0xb715ab['query'][_0x3757('0x3b')]){_0x2d8948[_0x3757('0x3a')]=_['merge'](_0x2d8948['where'],{'$or':_[_0x3757('0x28')](_0x3b8f57,function(_0xf9f891){if(_0xf9f891[_0x3757('0x2c')]!==_0x3757('0x3c')){var _0x114cb2={};_0x114cb2[_0xf9f891[_0x3757('0x25')]]={'$like':'%'+_0xb715ab['query'][_0x3757('0x3b')]+'%'};return _0x114cb2;}})});}_0x2d8948=_[_0x3757('0x3d')]({},_0x2d8948,_0xb715ab[_0x3757('0x3e')]);var _0x4df6b3={'where':_0x2d8948[_0x3757('0x3a')]};return db[_0x3757('0x29')][_0x3757('0x1b')](_0x4df6b3)[_0x3757('0x20')](function(_0x2fd754){_0x35052d[_0x3757('0x1b')]=_0x2fd754;if(_0xb715ab[_0x3757('0x30')][_0x3757('0x3f')]){_0x2d8948[_0x3757('0x40')]=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x2d8948);})[_0x3757('0x20')](function(_0x84e834){_0x35052d['rows']=_0x84e834;return _0x35052d;})['then'](respondWithFilteredResult(_0x440e21,_0x2d8948))[_0x3757('0x41')](handleError(_0x440e21,null));};exports[_0x3757('0x42')]=function(_0xcd7d44,_0x442e37){var _0x4e516f={'raw':!![],'where':{'id':_0xcd7d44['params']['id']}},_0x44551a={};_0x44551a['model']=_[_0x3757('0x2f')](db[_0x3757('0x29')][_0x3757('0x2a')]);_0x44551a[_0x3757('0x30')]=_[_0x3757('0x2f')](_0xcd7d44['query']);_0x44551a[_0x3757('0x31')]=_['intersection'](_0x44551a[_0x3757('0x2e')],_0x44551a[_0x3757('0x30')]);_0x4e516f[_0x3757('0x32')]=_[_0x3757('0x33')](_0x44551a[_0x3757('0x2e')],qs['fields'](_0xcd7d44['query']['fields']));_0x4e516f[_0x3757('0x32')]=_0x4e516f[_0x3757('0x32')]['length']?_0x4e516f['attributes']:_0x44551a['model'];if(_0xcd7d44['query'][_0x3757('0x3f')]){_0x4e516f[_0x3757('0x40')]=[{'all':!![]}];}_0x4e516f=_['merge']({},_0x4e516f,_0xcd7d44[_0x3757('0x3e')]);return db['FreshsalesField'][_0x3757('0x43')](_0x4e516f)['then'](handleEntityNotFound(_0x442e37,null))['then'](respondWithResult(_0x442e37,null))[_0x3757('0x41')](handleError(_0x442e37,null));};exports[_0x3757('0x44')]=function(_0x33907d,_0x238c90){return db['FreshsalesField'][_0x3757('0x44')](_0x33907d[_0x3757('0x45')],{})[_0x3757('0x20')](respondWithResult(_0x238c90,0xc9))[_0x3757('0x41')](handleError(_0x238c90,null));};exports[_0x3757('0x1f')]=function(_0x20bdc5,_0xea7c14){if(_0x20bdc5[_0x3757('0x45')]['id']){delete _0x20bdc5[_0x3757('0x45')]['id'];}return db[_0x3757('0x29')][_0x3757('0x43')]({'where':{'id':_0x20bdc5[_0x3757('0x46')]['id']}})[_0x3757('0x20')](handleEntityNotFound(_0xea7c14,null))[_0x3757('0x20')](saveUpdates(_0x20bdc5[_0x3757('0x45')],null))[_0x3757('0x20')](respondWithResult(_0xea7c14,null))[_0x3757('0x41')](handleError(_0xea7c14,null));};exports[_0x3757('0x21')]=function(_0x4e91b6,_0x24231c){return db[_0x3757('0x29')]['find']({'where':{'id':_0x4e91b6[_0x3757('0x46')]['id']}})[_0x3757('0x20')](handleEntityNotFound(_0x24231c,null))[_0x3757('0x20')](removeEntity(_0x24231c,null))['catch'](handleError(_0x24231c,null));};
\ No newline at end of file
index 637fffd..f591651 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa32b=['path','../../config/environment','./intFreshsalesField.attributes','exports','FreshsalesField','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','bluebird','request-promise'];(function(_0x3c3154,_0x136961){var _0x44f697=function(_0x5f33d4){while(--_0x5f33d4){_0x3c3154['push'](_0x3c3154['shift']());}};_0x44f697(++_0x136961);}(_0xa32b,0x68));var _0xba32=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xa32b[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0xba32('0x0'));var util=require('util');var logger=require(_0xba32('0x1'))('api');var moment=require('moment');var BPromise=require(_0xba32('0x2'));var rp=require(_0xba32('0x3'));var fs=require('fs');var path=require(_0xba32('0x4'));var rimraf=require('rimraf');var config=require(_0xba32('0x5'));var attributes=require(_0xba32('0x6'));module[_0xba32('0x7')]=function(_0x312fe7,_0x31dc74){return _0x312fe7['define'](_0xba32('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xba32('0x9'),'fields':[_0xba32('0xa'),_0xba32('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e6b=['../../config/environment','exports','FreshsalesField','FieldId','lodash','util','api','request-promise','path','rimraf'];(function(_0x533e7f,_0x500156){var _0x5b7a50=function(_0x5f51f7){while(--_0x5f51f7){_0x533e7f['push'](_0x533e7f['shift']());}};_0x5b7a50(++_0x500156);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x9e6b[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var logger=require('../../config/logger')(_0xb9e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb9e6('0x3'));var fs=require('fs');var path=require(_0xb9e6('0x4'));var rimraf=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xb9e6('0x7')]=function(_0x1a6a4f,_0x1b9eed){return _0x1a6a4f['define'](_0xb9e6('0x8'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0xb9e6('0x9')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4f49bb5..3f33077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['request\x20sent','debug','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x452968,_0x31e391){var _0xb6f9ae=function(_0x263987){while(--_0x263987){_0x452968['push'](_0x452968['shift']());}};_0xb6f9ae(++_0x31e391);}(_0x6f47,0xc7));var _0x76f4=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x6f47[_0x5c9307];return _0x373e29;};'use strict';var _=require('lodash');var util=require(_0x76f4('0x0'));var moment=require(_0x76f4('0x1'));var BPromise=require('bluebird');var rs=require(_0x76f4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x76f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x76f4('0x4'))(_0x76f4('0x5'));var config=require(_0x76f4('0x6'));var jayson=require(_0x76f4('0x7'));var client=jayson['client'][_0x76f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){return client[_0x76f4('0x9')](_0xfc2405,_0x497f99)[_0x76f4('0xa')](function(_0x101f55){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x2176a7,_0x76f4('0xb'));logger[_0x76f4('0xc')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x2176a7,'request\x20sent',JSON[_0x76f4('0xd')](_0x101f55));if(_0x101f55[_0x76f4('0xe')]){if(_0x101f55[_0x76f4('0xe')][_0x76f4('0xf')]===0x1f4){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55[_0x76f4('0xe')][_0x76f4('0x11')]);return _0x25656d(_0x101f55[_0x76f4('0xe')]['message']);}logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x101f55['error']['message']);return _0x1a3172(_0x101f55['error'][_0x76f4('0x11')]);}else{logger[_0x76f4('0x12')](_0x76f4('0x10'),_0x2176a7,_0x76f4('0xb'));_0x1a3172(_0x101f55[_0x76f4('0x13')][_0x76f4('0x11')]);}})[_0x76f4('0x14')](function(_0x981a87){logger[_0x76f4('0xe')](_0x76f4('0x10'),_0x2176a7,_0x981a87);_0x25656d(_0x981a87);});});}
\ No newline at end of file
+var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x4a725e,_0x2c29f3){var _0x3d6117=function(_0x152af1){while(--_0x152af1){_0x4a725e['push'](_0x4a725e['shift']());}};_0x3d6117(++_0x2c29f3);}(_0x2675,0x75));var _0x5267=function(_0x1edb30,_0x2acd57){_0x1edb30=_0x1edb30-0x0;var _0x254384=_0x2675[_0x1edb30];return _0x254384;};'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
index dbd2f46..647a444 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0xf92e33,_0x2e3958){var _0x499649=function(_0xe023ca){while(--_0xe023ca){_0xf92e33['push'](_0xf92e33['shift']());}};_0x499649(++_0x2e3958);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3441c0,_0x44f6e4){var _0x43abc9=function(_0x2c00f2){while(--_0x2c00f2){_0x3441c0['push'](_0x3441c0['shift']());}};_0x43abc9(++_0x44f6e4);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 39ad4e0..a68ec97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['integrationTab','exports','STRING','username','ENUM'];(function(_0x12e0c6,_0x18fc00){var _0x78c0a2=function(_0x577930){while(--_0x577930){_0x12e0c6['push'](_0x12e0c6['shift']());}};_0x78c0a2(++_0x18fc00);}(_0xe5af,0x9c));var _0xfe5a=function(_0x2331af,_0xa80e25){_0x2331af=_0x2331af-0x0;var _0x478d81=_0xe5af[_0x2331af];return _0x478d81;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'remoteUri':{'type':Sequelize[_0xfe5a('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xfe5a('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfe5a('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xfe5a('0x3')]('integrationTab','newTab'),'defaultValue':_0xfe5a('0x4')}};
\ No newline at end of file
+var _0x1cdb=['ENUM','integrationTab','newTab','exports','STRING','username'];(function(_0x13db83,_0x20da9d){var _0x176a24=function(_0x519f22){while(--_0x519f22){_0x13db83['push'](_0x13db83['shift']());}};_0x176a24(++_0x20da9d);}(_0x1cdb,0x117));var _0xb1cd=function(_0x2c0734,_0x33db15){_0x2c0734=_0x2c0734-0x0;var _0x287c72=_0x1cdb[_0x2c0734];return _0x287c72;};'use strict';var Sequelize=require('sequelize');module[_0xb1cd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb1cd('0x1')],'unique':_0xb1cd('0x2')},'remoteUri':{'type':Sequelize[_0xb1cd('0x1')]},'password':{'type':Sequelize[_0xb1cd('0x1')]},'clientId':{'type':Sequelize[_0xb1cd('0x1')]},'clientSecret':{'type':Sequelize[_0xb1cd('0x1')]},'securityToken':{'type':Sequelize[_0xb1cd('0x1')]},'serverUrl':{'type':Sequelize[_0xb1cd('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xb1cd('0x3')](_0xb1cd('0x4'),_0xb1cd('0x5')),'defaultValue':_0xb1cd('0x4')}};
\ No newline at end of file
index 068a194..313ebd4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bea=['path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','destroy','stack','name','send','index','SalesforceAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','params','keys','length','include','options','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','fields','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientId','username','password','securityToken','slice','lastIndexOf','Connection','clientSecret','login','concat','isNil','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','boolean','textarea','phone','remove','includes','label','custom','picklistValues','true','false','test','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x3d34fc,_0x19448a){var _0x35a98c=function(_0x34b179){while(--_0x34b179){_0x3d34fc['push'](_0x3d34fc['shift']());}};_0x35a98c(++_0x19448a);}(_0x0bea,0x16d));var _0xa0be=function(_0x54a14f,_0x59c124){_0x54a14f=_0x54a14f-0x0;var _0x47d334=_0x0bea[_0x54a14f];return _0x47d334;};'use strict';var emlformat=require(_0xa0be('0x0'));var rimraf=require(_0xa0be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa0be('0x2'));var rp=require(_0xa0be('0x3'));var moment=require('moment');var BPromise=require(_0xa0be('0x4'));var Mustache=require(_0xa0be('0x5'));var util=require(_0xa0be('0x6'));var path=require(_0xa0be('0x7'));var sox=require(_0xa0be('0x8'));var csv=require(_0xa0be('0x9'));var ejs=require(_0xa0be('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0be('0xb'));var squel=require(_0xa0be('0xc'));var crypto=require('crypto');var jsforce=require(_0xa0be('0xd'));var deskjs=require(_0xa0be('0xe'));var toCsv=require(_0xa0be('0x9'));var querystring=require(_0xa0be('0xf'));var Papa=require(_0xa0be('0x10'));var Redis=require(_0xa0be('0x11'));var authService=require(_0xa0be('0x12'));var qs=require(_0xa0be('0x13'));var as=require(_0xa0be('0x14'));var hardwareService=require(_0xa0be('0x15'));var logger=require(_0xa0be('0x16'))(_0xa0be('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa0be('0x18'));var db=require(_0xa0be('0x19'))['db'];var integrations=require(_0xa0be('0x1a'));function respondWithStatusCode(_0x5aec88,_0x360fe6){_0x360fe6=_0x360fe6||0xcc;return function(_0x5000c5){if(_0x5000c5){return _0x5aec88[_0xa0be('0x1b')](_0x360fe6);}return _0x5aec88[_0xa0be('0x1c')](_0x360fe6)[_0xa0be('0x1d')]();};}function respondWithResult(_0x27d8b4,_0x391d25){_0x391d25=_0x391d25||0xc8;return function(_0x8e030c){if(_0x8e030c){return _0x27d8b4[_0xa0be('0x1c')](_0x391d25)[_0xa0be('0x1e')](_0x8e030c);}};}function respondWithFilteredResult(_0x867cb2,_0x152dd2){return function(_0x30d21d){if(_0x30d21d){var _0x1025b7=typeof _0x152dd2[_0xa0be('0x1f')]==='undefined'&&typeof _0x152dd2['limit']===_0xa0be('0x20');var _0x53850b=_0x30d21d[_0xa0be('0x21')];var _0x70f3fd=_0x1025b7?0x0:_0x152dd2[_0xa0be('0x1f')];var _0x441e4=_0x1025b7?_0x30d21d[_0xa0be('0x21')]:_0x152dd2[_0xa0be('0x1f')]+_0x152dd2['limit'];var _0x404a0c;if(_0x441e4>=_0x53850b){_0x441e4=_0x53850b;_0x404a0c=0xc8;}else{_0x404a0c=0xce;}_0x867cb2[_0xa0be('0x1c')](_0x404a0c);return _0x867cb2[_0xa0be('0x22')](_0xa0be('0x23'),_0x70f3fd+'-'+_0x441e4+'/'+_0x53850b)[_0xa0be('0x1e')](_0x30d21d);}return null;};}function patchUpdates(_0x2ddf33){return function(_0x12556b){try{jsonpatch[_0xa0be('0x24')](_0x12556b,_0x2ddf33,!![]);}catch(_0x4edd5d){return BPromise['reject'](_0x4edd5d);}return _0x12556b[_0xa0be('0x25')]();};}function saveUpdates(_0xc1c173,_0x469f86){return function(_0x14f2d7){if(_0x14f2d7){return _0x14f2d7['update'](_0xc1c173)[_0xa0be('0x26')](function(_0x62fb33){return _0x62fb33;});}return null;};}function removeEntity(_0x4b1026,_0x12a0c0){return function(_0x12365c){if(_0x12365c){return _0x12365c[_0xa0be('0x27')]()[_0xa0be('0x26')](function(){_0x4b1026['status'](0xcc)[_0xa0be('0x1d')]();});}};}function handleEntityNotFound(_0x5999bc,_0x388880){return function(_0x2246d7){if(!_0x2246d7){_0x5999bc['sendStatus'](0x194);}return _0x2246d7;};}function handleError(_0x1db518,_0x5666c4){_0x5666c4=_0x5666c4||0x1f4;return function(_0x3b4e23){logger['error'](_0x3b4e23[_0xa0be('0x28')]);if(_0x3b4e23[_0xa0be('0x29')]){delete _0x3b4e23[_0xa0be('0x29')];}_0x1db518[_0xa0be('0x1c')](_0x5666c4)[_0xa0be('0x2a')](_0x3b4e23);};}exports[_0xa0be('0x2b')]=function(_0x48a032,_0x261c6b){var _0x3dde26={},_0x3fe115={},_0x1aaff7={'count':0x0,'rows':[]};var _0x369c5e=_['map'](db[_0xa0be('0x2c')][_0xa0be('0x2d')],function(_0x1cb155){return{'name':_0x1cb155['fieldName'],'type':_0x1cb155[_0xa0be('0x2e')][_0xa0be('0x2f')]};});_0x3fe115[_0xa0be('0x30')]=_[_0xa0be('0x31')](_0x369c5e,_0xa0be('0x29'));_0x3fe115[_0xa0be('0x32')]=_['keys'](_0x48a032['query']);_0x3fe115[_0xa0be('0x33')]=_[_0xa0be('0x34')](_0x3fe115['model'],_0x3fe115[_0xa0be('0x32')]);_0x3dde26['attributes']=_[_0xa0be('0x34')](_0x3fe115[_0xa0be('0x30')],qs['fields'](_0x48a032['query']['fields']));_0x3dde26['attributes']=_0x3dde26[_0xa0be('0x35')]['length']?_0x3dde26[_0xa0be('0x35')]:_0x3fe115[_0xa0be('0x30')];if(!_0x48a032['query'][_0xa0be('0x36')]('nolimit')){_0x3dde26['limit']=qs[_0xa0be('0x37')](_0x48a032[_0xa0be('0x32')]['limit']);_0x3dde26[_0xa0be('0x1f')]=qs[_0xa0be('0x1f')](_0x48a032[_0xa0be('0x32')][_0xa0be('0x1f')]);}_0x3dde26[_0xa0be('0x38')]=qs[_0xa0be('0x39')](_0x48a032[_0xa0be('0x32')][_0xa0be('0x39')]);_0x3dde26[_0xa0be('0x3a')]=qs[_0xa0be('0x33')](_[_0xa0be('0x3b')](_0x48a032['query'],_0x3fe115[_0xa0be('0x33')]),_0x369c5e);if(_0x48a032[_0xa0be('0x32')][_0xa0be('0x3c')]){_0x3dde26['where']=_[_0xa0be('0x3d')](_0x3dde26[_0xa0be('0x3a')],{'$or':_[_0xa0be('0x31')](_0x369c5e,function(_0x1ae522){if(_0x1ae522[_0xa0be('0x2e')]!==_0xa0be('0x3e')){var _0x1c749b={};_0x1c749b[_0x1ae522[_0xa0be('0x29')]]={'$like':'%'+_0x48a032[_0xa0be('0x32')][_0xa0be('0x3c')]+'%'};return _0x1c749b;}})});}_0x3dde26=_[_0xa0be('0x3d')]({},_0x3dde26,_0x48a032['options']);var _0x2380d3={'where':_0x3dde26[_0xa0be('0x3a')]};return db[_0xa0be('0x2c')]['count'](_0x2380d3)['then'](function(_0x17f510){_0x1aaff7['count']=_0x17f510;if(_0x48a032[_0xa0be('0x32')][_0xa0be('0x3f')]){_0x3dde26['include']=[{'all':!![]}];}return db[_0xa0be('0x2c')]['findAll'](_0x3dde26);})[_0xa0be('0x26')](function(_0x19b1bb){_0x1aaff7[_0xa0be('0x40')]=_0x19b1bb;return _0x1aaff7;})['then'](respondWithFilteredResult(_0x261c6b,_0x3dde26))[_0xa0be('0x41')](handleError(_0x261c6b,null));};exports['show']=function(_0x2cc26c,_0x5a887a){var _0x5302eb={'raw':![],'where':{'id':_0x2cc26c[_0xa0be('0x42')]['id']}},_0x515fbe={};_0x515fbe[_0xa0be('0x30')]=_[_0xa0be('0x43')](db[_0xa0be('0x2c')][_0xa0be('0x2d')]);_0x515fbe['query']=_[_0xa0be('0x43')](_0x2cc26c[_0xa0be('0x32')]);_0x515fbe[_0xa0be('0x33')]=_[_0xa0be('0x34')](_0x515fbe[_0xa0be('0x30')],_0x515fbe[_0xa0be('0x32')]);_0x5302eb['attributes']=_[_0xa0be('0x34')](_0x515fbe['model'],qs['fields'](_0x2cc26c[_0xa0be('0x32')]['fields']));_0x5302eb[_0xa0be('0x35')]=_0x5302eb[_0xa0be('0x35')][_0xa0be('0x44')]?_0x5302eb[_0xa0be('0x35')]:_0x515fbe[_0xa0be('0x30')];if(_0x2cc26c[_0xa0be('0x32')][_0xa0be('0x3f')]){_0x5302eb[_0xa0be('0x45')]=[{'all':!![]}];}_0x5302eb=_[_0xa0be('0x3d')]({},_0x5302eb,_0x2cc26c[_0xa0be('0x46')]);return db[_0xa0be('0x2c')][_0xa0be('0x47')](_0x5302eb)[_0xa0be('0x26')](handleEntityNotFound(_0x5a887a,null))[_0xa0be('0x26')](respondWithResult(_0x5a887a,null))['catch'](handleError(_0x5a887a,null));};exports[_0xa0be('0x48')]=function(_0x4a68dd,_0x5884a2){return db['SalesforceAccount'][_0xa0be('0x48')](_0x4a68dd[_0xa0be('0x49')],{})['then'](respondWithResult(_0x5884a2,0xc9))[_0xa0be('0x41')](handleError(_0x5884a2,null));};exports[_0xa0be('0x4a')]=function(_0x34fc5f,_0xaaccc0){if(_0x34fc5f[_0xa0be('0x49')]['id']){delete _0x34fc5f[_0xa0be('0x49')]['id'];}return db[_0xa0be('0x2c')][_0xa0be('0x47')]({'where':{'id':_0x34fc5f['params']['id']}})[_0xa0be('0x26')](handleEntityNotFound(_0xaaccc0,null))['then'](saveUpdates(_0x34fc5f['body'],null))[_0xa0be('0x26')](respondWithResult(_0xaaccc0,null))['catch'](handleError(_0xaaccc0,null));};exports[_0xa0be('0x27')]=function(_0x47a8fa,_0xad2b30){return db['SalesforceAccount'][_0xa0be('0x47')]({'where':{'id':_0x47a8fa[_0xa0be('0x42')]['id']}})[_0xa0be('0x26')](handleEntityNotFound(_0xad2b30,null))['then'](removeEntity(_0xad2b30,null))[_0xa0be('0x41')](handleError(_0xad2b30,null));};exports[_0xa0be('0x4b')]=function(_0x4f209e,_0x2d93b7,_0x1d33b4){var _0xd4ccc3={};var _0x18ed8f={};var _0x36de40;var _0x46512c;return db['SalesforceAccount'][_0xa0be('0x4c')]({'where':{'id':_0x4f209e[_0xa0be('0x42')]['id']}})['then'](handleEntityNotFound(_0x2d93b7,null))[_0xa0be('0x26')](function(_0x1ec3e2){if(_0x1ec3e2){_0x36de40=_0x1ec3e2;_0x18ed8f['model']=_[_0xa0be('0x43')](db[_0xa0be('0x4d')][_0xa0be('0x2d')]);_0x18ed8f[_0xa0be('0x32')]=_[_0xa0be('0x43')](_0x4f209e[_0xa0be('0x32')]);_0x18ed8f[_0xa0be('0x33')]=_[_0xa0be('0x34')](_0x18ed8f[_0xa0be('0x30')],_0x18ed8f[_0xa0be('0x32')]);_0xd4ccc3[_0xa0be('0x35')]=_['intersection'](_0x18ed8f['model'],qs[_0xa0be('0x4e')](_0x4f209e['query'][_0xa0be('0x4e')]));_0xd4ccc3[_0xa0be('0x35')]=_0xd4ccc3[_0xa0be('0x35')][_0xa0be('0x44')]?_0xd4ccc3[_0xa0be('0x35')]:_0x18ed8f[_0xa0be('0x30')];_0xd4ccc3[_0xa0be('0x38')]=qs[_0xa0be('0x39')](_0x4f209e[_0xa0be('0x32')]['sort']);_0xd4ccc3['where']=qs[_0xa0be('0x33')](_[_0xa0be('0x3b')](_0x4f209e['query'],_0x18ed8f[_0xa0be('0x33')]));if(_0x4f209e[_0xa0be('0x32')]['filter']){_0xd4ccc3[_0xa0be('0x3a')]=_[_0xa0be('0x3d')](_0xd4ccc3[_0xa0be('0x3a')],{'$or':_['map'](_0xd4ccc3['attributes'],function(_0x193b5d){var _0x1ac4de={};_0x1ac4de[_0x193b5d]={'$like':'%'+_0x4f209e[_0xa0be('0x32')][_0xa0be('0x3c')]+'%'};return _0x1ac4de;})});}_0xd4ccc3=_[_0xa0be('0x3d')]({},_0xd4ccc3,_0x4f209e[_0xa0be('0x46')]);return _0x36de40[_0xa0be('0x4b')](_0xd4ccc3);}})[_0xa0be('0x26')](function(_0x134600){if(_0x134600){_0x46512c=_0x134600[_0xa0be('0x44')];if(!_0x4f209e[_0xa0be('0x32')]['hasOwnProperty']('nolimit')){_0xd4ccc3[_0xa0be('0x37')]=qs[_0xa0be('0x37')](_0x4f209e['query']['limit']);_0xd4ccc3[_0xa0be('0x1f')]=qs[_0xa0be('0x1f')](_0x4f209e[_0xa0be('0x32')][_0xa0be('0x1f')]);}return _0x36de40['getConfigurations'](_0xd4ccc3);}})[_0xa0be('0x26')](function(_0x52540b){if(_0x52540b){return _0x52540b?{'count':_0x46512c,'rows':_0x52540b}:null;}})['then'](respondWithResult(_0x2d93b7,null))[_0xa0be('0x41')](handleError(_0x2d93b7,null));};exports[_0xa0be('0x4f')]=function(_0x58b98a,_0x439231,_0x1575da){if(_0x58b98a[_0xa0be('0x49')]['id']){delete _0x58b98a[_0xa0be('0x49')]['id'];}return db[_0xa0be('0x2c')][_0xa0be('0x4c')]({'where':{'id':_0x58b98a['params']['id']}})['then'](handleEntityNotFound(_0x439231,null))[_0xa0be('0x26')](function(_0x277b19){if(_0x277b19){_0x58b98a[_0xa0be('0x49')][_0xa0be('0x50')]=_0x277b19['id'];_0x58b98a['body']['Subjects']=integrations[_0xa0be('0x51')](_0x58b98a[_0xa0be('0x49')][_0xa0be('0x52')],_0x58b98a[_0xa0be('0x49')]['type']);_0x58b98a['body'][_0xa0be('0x53')]=integrations[_0xa0be('0x54')](_0x58b98a[_0xa0be('0x49')]['channel'],_0x58b98a[_0xa0be('0x49')][_0xa0be('0x2e')]);return db[_0xa0be('0x4d')][_0xa0be('0x48')](_0x58b98a[_0xa0be('0x49')],{'include':[{'model':db[_0xa0be('0x55')],'as':_0xa0be('0x56')},{'model':db['SalesforceField'],'as':_0xa0be('0x53')}]});}return null;})[_0xa0be('0x26')](respondWithResult(_0x439231,null))[_0xa0be('0x41')](handleError(_0x439231,null));};exports[_0xa0be('0x57')]=function(_0x50a7a6,_0xc2558b,_0x410f28){var _0x5e90dc;var _0x200b65='';var _0x2fa62d=_0xa0be('0x58');return db[_0xa0be('0x2c')][_0xa0be('0x4c')]({'where':{'id':_0x50a7a6['params']['id']},'attributes':['id',_0xa0be('0x59'),_0xa0be('0x5a'),'clientSecret',_0xa0be('0x5b'),_0xa0be('0x5c'),_0xa0be('0x5d')]})[_0xa0be('0x26')](handleEntityNotFound(_0xc2558b,null))[_0xa0be('0x26')](function(_0x4f3f4a){if(_0x4f3f4a){_0x200b65=_0x4f3f4a[_0xa0be('0x59')];var _0x310933=_0x200b65[_0xa0be('0x5e')](-0x1);if(_0x310933==='/'){_0x200b65=_0x200b65['substring'](0x0,_0x200b65[_0xa0be('0x5f')](_0x310933));}_0x5e90dc=new jsforce[(_0xa0be('0x60'))]({'oauth2':{'loginUrl':_0x200b65,'clientId':_0x4f3f4a['clientId'],'clientSecret':_0x4f3f4a[_0xa0be('0x61')]}});return _0x5e90dc[_0xa0be('0x62')](_0x4f3f4a[_0xa0be('0x5b')],_0x4f3f4a[_0xa0be('0x5c')][_0xa0be('0x63')](_0x4f3f4a[_0xa0be('0x5d')]));}})[_0xa0be('0x26')](function(_0x5cf4fd){if(_0x5cf4fd){if(!_[_0xa0be('0x64')](_0x50a7a6[_0xa0be('0x32')][_0xa0be('0x65')])){_0x2fa62d=_0x50a7a6['query']['ticketType'];}return _0x5e90dc[_0xa0be('0x66')](_0x2fa62d)['describe']();}})[_0xa0be('0x26')](function(_0x425e2f){var _0xae397c=[_0xa0be('0x67'),_0xa0be('0x68'),_0xa0be('0x69'),_0xa0be('0x6a'),_0xa0be('0x6b'),_0xa0be('0x6c')];var _0x149d1e=['string',_0xa0be('0x6d'),'picklist',_0xa0be('0x6e'),'email',_0xa0be('0x6f'),_0xa0be('0x70')];if(_0x425e2f){_[_0xa0be('0x71')](_0x425e2f['fields'],function(_0x184ed9){return _0xae397c['includes'](_0x184ed9[_0xa0be('0x29')])||!_0x149d1e[_0xa0be('0x72')](_0x184ed9['type']);});return{'count':_0x425e2f[_0xa0be('0x4e')]['length'],'rows':_[_0xa0be('0x31')](_0x425e2f[_0xa0be('0x4e')],function(_0x16b375){return{'id':_0x16b375[_0xa0be('0x29')],'name':_0x16b375[_0xa0be('0x73')],'custom':_0x16b375[_0xa0be('0x74')],'options':_0x16b375[_0xa0be('0x75')][_0xa0be('0x44')]>0x0?_['map'](_0x16b375[_0xa0be('0x75')],function(_0x2cec99){return{'name':_0x2cec99['label'],'value':_0x2cec99['value']};}):_0x16b375[_0xa0be('0x2e')]==_0xa0be('0x6e')?[{'name':'True','value':_0xa0be('0x76')},{'name':'False','value':_0xa0be('0x77')}]:[]};})};}})[_0xa0be('0x26')](respondWithResult(_0xc2558b,null))['catch'](function(_0xd8c180){var _0x2baa64=_0x50a7a6['query'][_0xa0be('0x78')]?0x1f4:_0xd8c180['statusCode']||0x1f4;logger[_0xa0be('0x79')](_0xa0be('0x7a'),_0xa0be('0x57'),_0x2baa64,JSON['stringify'](_0xd8c180));delete _0xd8c180[_0xa0be('0x29')];if(_0x2baa64===0x191){_0x2baa64=0x190;}_0xc2558b[_0xa0be('0x1c')](_0x2baa64)[_0xa0be('0x2a')](_0x50a7a6[_0xa0be('0x32')][_0xa0be('0x78')]?{'message':_0xa0be('0x7b'),'statusCode':_0xd8c180['statusCode']}:_0xd8c180);});};
\ No newline at end of file
+var _0x8dff=['int','boolean','email','textarea','phone','remove','includes','picklistValues','label','value','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','set','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','SalesforceAccount','rawAttributes','fieldName','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','where','merge','filter','options','count','includeAll','include','rows','catch','show','params','length','find','create','body','getConfigurations','findOne','SalesforceConfiguration','sort','AccountId','getSubjects','channel','type','SalesforceField','Descriptions','getFields','Task','clientSecret','username','password','securityToken','remoteUri','slice','lastIndexOf','Connection','clientId','concat','ticketType','sobject','describe','OwnerId','Subject','Description','string'];(function(_0x235184,_0x5847cd){var _0x3ae4e5=function(_0x30abba){while(--_0x30abba){_0x235184['push'](_0x235184['shift']());}};_0x3ae4e5(++_0x5847cd);}(_0x8dff,0x109));var _0xf8df=function(_0xe52d37,_0x407061){_0xe52d37=_0xe52d37-0x0;var _0x53e2cc=_0x8dff[_0xe52d37];return _0x53e2cc;};'use strict';var emlformat=require(_0xf8df('0x0'));var rimraf=require(_0xf8df('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8df('0x2'));var rp=require(_0xf8df('0x3'));var moment=require('moment');var BPromise=require(_0xf8df('0x4'));var Mustache=require(_0xf8df('0x5'));var util=require(_0xf8df('0x6'));var path=require(_0xf8df('0x7'));var sox=require(_0xf8df('0x8'));var csv=require('to-csv');var ejs=require(_0xf8df('0x9'));var fs=require('fs');var fs_extra=require(_0xf8df('0xa'));var _=require(_0xf8df('0xb'));var squel=require('squel');var crypto=require(_0xf8df('0xc'));var jsforce=require(_0xf8df('0xd'));var deskjs=require(_0xf8df('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf8df('0xf'));var Papa=require(_0xf8df('0x10'));var Redis=require(_0xf8df('0x11'));var authService=require(_0xf8df('0x12'));var qs=require(_0xf8df('0x13'));var as=require(_0xf8df('0x14'));var hardwareService=require(_0xf8df('0x15'));var logger=require(_0xf8df('0x16'))(_0xf8df('0x17'));var utils=require(_0xf8df('0x18'));var config=require(_0xf8df('0x19'));var licenseUtil=require(_0xf8df('0x1a'));var db=require(_0xf8df('0x1b'))['db'];var integrations=require(_0xf8df('0x1c'));function respondWithStatusCode(_0x28330f,_0x5d2a72){_0x5d2a72=_0x5d2a72||0xcc;return function(_0x162a0d){if(_0x162a0d){return _0x28330f['sendStatus'](_0x5d2a72);}return _0x28330f[_0xf8df('0x1d')](_0x5d2a72)[_0xf8df('0x1e')]();};}function respondWithResult(_0x12ef22,_0x5d504b){_0x5d504b=_0x5d504b||0xc8;return function(_0x4756e7){if(_0x4756e7){return _0x12ef22['status'](_0x5d504b)[_0xf8df('0x1f')](_0x4756e7);}};}function respondWithFilteredResult(_0x10181b,_0x57b989){return function(_0x259302){if(_0x259302){var _0x55fc98=typeof _0x57b989['offset']===_0xf8df('0x20')&&typeof _0x57b989[_0xf8df('0x21')]==='undefined';var _0x125af8=_0x259302['count'];var _0x1dad86=_0x55fc98?0x0:_0x57b989['offset'];var _0x3c9da0=_0x55fc98?_0x259302['count']:_0x57b989['offset']+_0x57b989[_0xf8df('0x21')];var _0x1951a0;if(_0x3c9da0>=_0x125af8){_0x3c9da0=_0x125af8;_0x1951a0=0xc8;}else{_0x1951a0=0xce;}_0x10181b['status'](_0x1951a0);return _0x10181b[_0xf8df('0x22')]('Content-Range',_0x1dad86+'-'+_0x3c9da0+'/'+_0x125af8)['json'](_0x259302);}return null;};}function patchUpdates(_0x1d3099){return function(_0xde93f){try{jsonpatch[_0xf8df('0x23')](_0xde93f,_0x1d3099,!![]);}catch(_0x268b79){return BPromise[_0xf8df('0x24')](_0x268b79);}return _0xde93f[_0xf8df('0x25')]();};}function saveUpdates(_0x218b57,_0x1b5bae){return function(_0x197929){if(_0x197929){return _0x197929[_0xf8df('0x26')](_0x218b57)['then'](function(_0x154ce){return _0x154ce;});}return null;};}function removeEntity(_0x2080a7,_0x2bca68){return function(_0x37cf63){if(_0x37cf63){return _0x37cf63[_0xf8df('0x27')]()[_0xf8df('0x28')](function(){_0x2080a7[_0xf8df('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x82e3db,_0x29d258){return function(_0x23b15e){if(!_0x23b15e){_0x82e3db[_0xf8df('0x29')](0x194);}return _0x23b15e;};}function handleError(_0x1c5f02,_0x39a744){_0x39a744=_0x39a744||0x1f4;return function(_0x33ceed){logger[_0xf8df('0x2a')](_0x33ceed[_0xf8df('0x2b')]);if(_0x33ceed['name']){delete _0x33ceed[_0xf8df('0x2c')];}_0x1c5f02['status'](_0x39a744)[_0xf8df('0x2d')](_0x33ceed);};}exports[_0xf8df('0x2e')]=function(_0x20c033,_0x5c87b2){var _0x791631={},_0x58b284={},_0x322272={'count':0x0,'rows':[]};var _0x1e7018=_['map'](db[_0xf8df('0x2f')][_0xf8df('0x30')],function(_0x1afc78){return{'name':_0x1afc78[_0xf8df('0x31')],'type':_0x1afc78['type'][_0xf8df('0x32')]};});_0x58b284['model']=_[_0xf8df('0x33')](_0x1e7018,'name');_0x58b284[_0xf8df('0x34')]=_[_0xf8df('0x35')](_0x20c033['query']);_0x58b284[_0xf8df('0x36')]=_['intersection'](_0x58b284[_0xf8df('0x37')],_0x58b284[_0xf8df('0x34')]);_0x791631[_0xf8df('0x38')]=_[_0xf8df('0x39')](_0x58b284[_0xf8df('0x37')],qs[_0xf8df('0x3a')](_0x20c033[_0xf8df('0x34')][_0xf8df('0x3a')]));_0x791631[_0xf8df('0x38')]=_0x791631[_0xf8df('0x38')]['length']?_0x791631['attributes']:_0x58b284[_0xf8df('0x37')];if(!_0x20c033[_0xf8df('0x34')][_0xf8df('0x3b')](_0xf8df('0x3c'))){_0x791631[_0xf8df('0x21')]=qs[_0xf8df('0x21')](_0x20c033[_0xf8df('0x34')][_0xf8df('0x21')]);_0x791631[_0xf8df('0x3d')]=qs[_0xf8df('0x3d')](_0x20c033[_0xf8df('0x34')][_0xf8df('0x3d')]);}_0x791631[_0xf8df('0x3e')]=qs['sort'](_0x20c033[_0xf8df('0x34')]['sort']);_0x791631[_0xf8df('0x3f')]=qs[_0xf8df('0x36')](_['pick'](_0x20c033[_0xf8df('0x34')],_0x58b284[_0xf8df('0x36')]),_0x1e7018);if(_0x20c033['query']['filter']){_0x791631[_0xf8df('0x3f')]=_[_0xf8df('0x40')](_0x791631[_0xf8df('0x3f')],{'$or':_[_0xf8df('0x33')](_0x1e7018,function(_0x498fa6){if(_0x498fa6['type']!=='VIRTUAL'){var _0x3ab1e5={};_0x3ab1e5[_0x498fa6[_0xf8df('0x2c')]]={'$like':'%'+_0x20c033[_0xf8df('0x34')][_0xf8df('0x41')]+'%'};return _0x3ab1e5;}})});}_0x791631=_['merge']({},_0x791631,_0x20c033[_0xf8df('0x42')]);var _0x34428f={'where':_0x791631[_0xf8df('0x3f')]};return db['SalesforceAccount'][_0xf8df('0x43')](_0x34428f)[_0xf8df('0x28')](function(_0x28de1a){_0x322272[_0xf8df('0x43')]=_0x28de1a;if(_0x20c033[_0xf8df('0x34')][_0xf8df('0x44')]){_0x791631[_0xf8df('0x45')]=[{'all':!![]}];}return db[_0xf8df('0x2f')]['findAll'](_0x791631);})[_0xf8df('0x28')](function(_0x4ff2e9){_0x322272[_0xf8df('0x46')]=_0x4ff2e9;return _0x322272;})['then'](respondWithFilteredResult(_0x5c87b2,_0x791631))[_0xf8df('0x47')](handleError(_0x5c87b2,null));};exports[_0xf8df('0x48')]=function(_0x5e69c0,_0xce3725){var _0x4d685a={'raw':![],'where':{'id':_0x5e69c0[_0xf8df('0x49')]['id']}},_0x2bdcc0={};_0x2bdcc0['model']=_[_0xf8df('0x35')](db[_0xf8df('0x2f')][_0xf8df('0x30')]);_0x2bdcc0[_0xf8df('0x34')]=_[_0xf8df('0x35')](_0x5e69c0['query']);_0x2bdcc0['filters']=_[_0xf8df('0x39')](_0x2bdcc0['model'],_0x2bdcc0['query']);_0x4d685a['attributes']=_[_0xf8df('0x39')](_0x2bdcc0[_0xf8df('0x37')],qs[_0xf8df('0x3a')](_0x5e69c0[_0xf8df('0x34')]['fields']));_0x4d685a[_0xf8df('0x38')]=_0x4d685a[_0xf8df('0x38')][_0xf8df('0x4a')]?_0x4d685a[_0xf8df('0x38')]:_0x2bdcc0[_0xf8df('0x37')];if(_0x5e69c0[_0xf8df('0x34')][_0xf8df('0x44')]){_0x4d685a[_0xf8df('0x45')]=[{'all':!![]}];}_0x4d685a=_[_0xf8df('0x40')]({},_0x4d685a,_0x5e69c0[_0xf8df('0x42')]);return db['SalesforceAccount'][_0xf8df('0x4b')](_0x4d685a)[_0xf8df('0x28')](handleEntityNotFound(_0xce3725,null))[_0xf8df('0x28')](respondWithResult(_0xce3725,null))[_0xf8df('0x47')](handleError(_0xce3725,null));};exports[_0xf8df('0x4c')]=function(_0x21f692,_0x3fc8f3){return db[_0xf8df('0x2f')][_0xf8df('0x4c')](_0x21f692['body'],{})[_0xf8df('0x28')](respondWithResult(_0x3fc8f3,0xc9))[_0xf8df('0x47')](handleError(_0x3fc8f3,null));};exports[_0xf8df('0x26')]=function(_0x514ace,_0x400326){if(_0x514ace[_0xf8df('0x4d')]['id']){delete _0x514ace[_0xf8df('0x4d')]['id'];}return db[_0xf8df('0x2f')][_0xf8df('0x4b')]({'where':{'id':_0x514ace[_0xf8df('0x49')]['id']}})[_0xf8df('0x28')](handleEntityNotFound(_0x400326,null))[_0xf8df('0x28')](saveUpdates(_0x514ace['body'],null))[_0xf8df('0x28')](respondWithResult(_0x400326,null))[_0xf8df('0x47')](handleError(_0x400326,null));};exports['destroy']=function(_0x19fd2f,_0x4ac4c0){return db[_0xf8df('0x2f')]['find']({'where':{'id':_0x19fd2f['params']['id']}})[_0xf8df('0x28')](handleEntityNotFound(_0x4ac4c0,null))[_0xf8df('0x28')](removeEntity(_0x4ac4c0,null))[_0xf8df('0x47')](handleError(_0x4ac4c0,null));};exports[_0xf8df('0x4e')]=function(_0xb9b9b9,_0x2763f3,_0x579601){var _0x45414a={};var _0x25f279={};var _0x45999f;var _0x31837b;return db[_0xf8df('0x2f')][_0xf8df('0x4f')]({'where':{'id':_0xb9b9b9['params']['id']}})['then'](handleEntityNotFound(_0x2763f3,null))[_0xf8df('0x28')](function(_0x68707f){if(_0x68707f){_0x45999f=_0x68707f;_0x25f279[_0xf8df('0x37')]=_[_0xf8df('0x35')](db[_0xf8df('0x50')][_0xf8df('0x30')]);_0x25f279[_0xf8df('0x34')]=_[_0xf8df('0x35')](_0xb9b9b9[_0xf8df('0x34')]);_0x25f279[_0xf8df('0x36')]=_[_0xf8df('0x39')](_0x25f279[_0xf8df('0x37')],_0x25f279[_0xf8df('0x34')]);_0x45414a['attributes']=_[_0xf8df('0x39')](_0x25f279[_0xf8df('0x37')],qs[_0xf8df('0x3a')](_0xb9b9b9[_0xf8df('0x34')]['fields']));_0x45414a['attributes']=_0x45414a['attributes']['length']?_0x45414a['attributes']:_0x25f279[_0xf8df('0x37')];_0x45414a[_0xf8df('0x3e')]=qs[_0xf8df('0x51')](_0xb9b9b9['query'][_0xf8df('0x51')]);_0x45414a['where']=qs[_0xf8df('0x36')](_['pick'](_0xb9b9b9[_0xf8df('0x34')],_0x25f279[_0xf8df('0x36')]));if(_0xb9b9b9[_0xf8df('0x34')][_0xf8df('0x41')]){_0x45414a[_0xf8df('0x3f')]=_[_0xf8df('0x40')](_0x45414a[_0xf8df('0x3f')],{'$or':_[_0xf8df('0x33')](_0x45414a[_0xf8df('0x38')],function(_0x46a9e0){var _0x130de6={};_0x130de6[_0x46a9e0]={'$like':'%'+_0xb9b9b9[_0xf8df('0x34')][_0xf8df('0x41')]+'%'};return _0x130de6;})});}_0x45414a=_[_0xf8df('0x40')]({},_0x45414a,_0xb9b9b9[_0xf8df('0x42')]);return _0x45999f[_0xf8df('0x4e')](_0x45414a);}})['then'](function(_0x42ba78){if(_0x42ba78){_0x31837b=_0x42ba78[_0xf8df('0x4a')];if(!_0xb9b9b9[_0xf8df('0x34')][_0xf8df('0x3b')](_0xf8df('0x3c'))){_0x45414a['limit']=qs[_0xf8df('0x21')](_0xb9b9b9[_0xf8df('0x34')]['limit']);_0x45414a[_0xf8df('0x3d')]=qs['offset'](_0xb9b9b9['query'][_0xf8df('0x3d')]);}return _0x45999f['getConfigurations'](_0x45414a);}})[_0xf8df('0x28')](function(_0x4a05d2){if(_0x4a05d2){return _0x4a05d2?{'count':_0x31837b,'rows':_0x4a05d2}:null;}})[_0xf8df('0x28')](respondWithResult(_0x2763f3,null))[_0xf8df('0x47')](handleError(_0x2763f3,null));};exports['addConfiguration']=function(_0x2fc08c,_0x9bd19f,_0x18d288){if(_0x2fc08c[_0xf8df('0x4d')]['id']){delete _0x2fc08c[_0xf8df('0x4d')]['id'];}return db[_0xf8df('0x2f')][_0xf8df('0x4f')]({'where':{'id':_0x2fc08c[_0xf8df('0x49')]['id']}})[_0xf8df('0x28')](handleEntityNotFound(_0x9bd19f,null))['then'](function(_0x1d9120){if(_0x1d9120){_0x2fc08c['body'][_0xf8df('0x52')]=_0x1d9120['id'];_0x2fc08c['body']['Subjects']=integrations[_0xf8df('0x53')](_0x2fc08c['body'][_0xf8df('0x54')],_0x2fc08c[_0xf8df('0x4d')][_0xf8df('0x55')]);_0x2fc08c[_0xf8df('0x4d')]['Descriptions']=integrations['getDescriptions'](_0x2fc08c[_0xf8df('0x4d')][_0xf8df('0x54')],_0x2fc08c[_0xf8df('0x4d')][_0xf8df('0x55')]);return db[_0xf8df('0x50')]['create'](_0x2fc08c['body'],{'include':[{'model':db[_0xf8df('0x56')],'as':'Subjects'},{'model':db[_0xf8df('0x56')],'as':_0xf8df('0x57')}]});}return null;})[_0xf8df('0x28')](respondWithResult(_0x9bd19f,null))['catch'](handleError(_0x9bd19f,null));};exports[_0xf8df('0x58')]=function(_0x23b1e1,_0x263807,_0x30f782){var _0x17a199;var _0x2ea2f4='';var _0x2c20ec=_0xf8df('0x59');return db['SalesforceAccount'][_0xf8df('0x4f')]({'where':{'id':_0x23b1e1[_0xf8df('0x49')]['id']},'attributes':['id','remoteUri','clientId',_0xf8df('0x5a'),_0xf8df('0x5b'),_0xf8df('0x5c'),_0xf8df('0x5d')]})['then'](handleEntityNotFound(_0x263807,null))[_0xf8df('0x28')](function(_0x418df6){if(_0x418df6){_0x2ea2f4=_0x418df6[_0xf8df('0x5e')];var _0x46eb2c=_0x2ea2f4[_0xf8df('0x5f')](-0x1);if(_0x46eb2c==='/'){_0x2ea2f4=_0x2ea2f4['substring'](0x0,_0x2ea2f4[_0xf8df('0x60')](_0x46eb2c));}_0x17a199=new jsforce[(_0xf8df('0x61'))]({'oauth2':{'loginUrl':_0x2ea2f4,'clientId':_0x418df6[_0xf8df('0x62')],'clientSecret':_0x418df6[_0xf8df('0x5a')]}});return _0x17a199['login'](_0x418df6[_0xf8df('0x5b')],_0x418df6[_0xf8df('0x5c')][_0xf8df('0x63')](_0x418df6['securityToken']));}})[_0xf8df('0x28')](function(_0x3c4db4){if(_0x3c4db4){if(!_['isNil'](_0x23b1e1[_0xf8df('0x34')][_0xf8df('0x64')])){_0x2c20ec=_0x23b1e1['query'][_0xf8df('0x64')];}return _0x17a199[_0xf8df('0x65')](_0x2c20ec)[_0xf8df('0x66')]();}})[_0xf8df('0x28')](function(_0x5d9c19){var _0x5a3835=[_0xf8df('0x67'),'ActivityDate','IsReminderSet','IsRecurrence',_0xf8df('0x68'),_0xf8df('0x69')];var _0x97659f=[_0xf8df('0x6a'),_0xf8df('0x6b'),'picklist',_0xf8df('0x6c'),_0xf8df('0x6d'),_0xf8df('0x6e'),_0xf8df('0x6f')];if(_0x5d9c19){_[_0xf8df('0x70')](_0x5d9c19['fields'],function(_0x4e6f86){return _0x5a3835[_0xf8df('0x71')](_0x4e6f86['name'])||!_0x97659f[_0xf8df('0x71')](_0x4e6f86[_0xf8df('0x55')]);});return{'count':_0x5d9c19[_0xf8df('0x3a')]['length'],'rows':_[_0xf8df('0x33')](_0x5d9c19['fields'],function(_0x3c0fa2){return{'id':_0x3c0fa2[_0xf8df('0x2c')],'name':_0x3c0fa2['label'],'custom':_0x3c0fa2['custom'],'options':_0x3c0fa2[_0xf8df('0x72')][_0xf8df('0x4a')]>0x0?_[_0xf8df('0x33')](_0x3c0fa2['picklistValues'],function(_0x22b716){return{'name':_0x22b716[_0xf8df('0x73')],'value':_0x22b716[_0xf8df('0x74')]};}):_0x3c0fa2[_0xf8df('0x55')]==_0xf8df('0x6c')?[{'name':'True','value':_0xf8df('0x75')},{'name':_0xf8df('0x76'),'value':_0xf8df('0x77')}]:[]};})};}})[_0xf8df('0x28')](respondWithResult(_0x263807,null))[_0xf8df('0x47')](function(_0x5646fa){var _0x3c0a77=_0x23b1e1[_0xf8df('0x34')][_0xf8df('0x78')]?0x1f4:_0x5646fa[_0xf8df('0x79')]||0x1f4;logger[_0xf8df('0x2a')](_0xf8df('0x7a'),'getFields',_0x3c0a77,JSON['stringify'](_0x5646fa));delete _0x5646fa[_0xf8df('0x2c')];if(_0x3c0a77===0x191){_0x3c0a77=0x190;}_0x263807['status'](_0x3c0a77)[_0xf8df('0x2d')](_0x23b1e1[_0xf8df('0x34')]['test']?{'message':_0xf8df('0x7b'),'statusCode':_0x5646fa['statusCode']}:_0x5646fa);});};
\ No newline at end of file
index 8e8920a..8c351a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209f=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x209f,0x199));var _0xf209=function(_0x3f873a,_0x3f8833){_0x3f873a=_0x3f873a-0x0;var _0x2bb0f8=_0x209f[_0x3f873a];return _0x2bb0f8;};'use strict';var _=require(_0xf209('0x0'));var util=require('util');var logger=require(_0xf209('0x1'))(_0xf209('0x2'));var moment=require('moment');var BPromise=require(_0xf209('0x3'));var rp=require(_0xf209('0x4'));var fs=require('fs');var path=require(_0xf209('0x5'));var rimraf=require('rimraf');var config=require(_0xf209('0x6'));var attributes=require(_0xf209('0x7'));var integrations=require(_0xf209('0x8'));module[_0xf209('0x9')]=function(_0x46c481,_0x5ba6df){return _0x46c481[_0xf209('0xa')](_0xf209('0xb'),attributes,{'tableName':_0xf209('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5f8=['./intSalesforceAccount.attributes','exports','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x34cc28,_0x3855b8){var _0x517a63=function(_0x57d617){while(--_0x57d617){_0x34cc28['push'](_0x34cc28['shift']());}};_0x517a63(++_0x3855b8);}(_0xb5f8,0x88));var _0x8b5f=function(_0x26e0ff,_0x135b66){_0x26e0ff=_0x26e0ff-0x0;var _0x54a315=_0xb5f8[_0x26e0ff];return _0x54a315;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var logger=require(_0x8b5f('0x2'))(_0x8b5f('0x3'));var moment=require(_0x8b5f('0x4'));var BPromise=require('bluebird');var rp=require(_0x8b5f('0x5'));var fs=require('fs');var path=require(_0x8b5f('0x6'));var rimraf=require('rimraf');var config=require(_0x8b5f('0x7'));var attributes=require(_0x8b5f('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8b5f('0x9')]=function(_0x3f6cc9,_0x4d3b72){return _0x3f6cc9['define'](_0x8b5f('0xa'),attributes,{'tableName':_0x8b5f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f6a063..6733b26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c02=['debug','request\x20sent','error','code','message','info','catch','GetSalesforceAccount','SalesforceAccount','options','raw','attributes','limit','include','map','model','stringify','ShowSalesforceAccount','find','where','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c02,0x146));var _0x23c0=function(_0x5ea294,_0x1a9325){_0x5ea294=_0x5ea294-0x0;var _0x499737=_0x3c02[_0x5ea294];return _0x499737;};'use strict';var _=require(_0x23c0('0x0'));var util=require(_0x23c0('0x1'));var moment=require(_0x23c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c0('0x3'));var fs=require('fs');var Redis=require(_0x23c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x23c0('0x5'));var logger=require('../../config/logger')(_0x23c0('0x6'));var config=require(_0x23c0('0x7'));var jayson=require(_0x23c0('0x8'));var client=jayson[_0x23c0('0x9')][_0x23c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf6acb8,_0x428bf1,_0x1891ed){return new BPromise(function(_0x10eee2,_0x33e628){return client[_0x23c0('0xb')](_0xf6acb8,_0x1891ed)[_0x23c0('0xc')](function(_0x113ce4){logger['info'](_0x23c0('0xd'),_0x428bf1,'request\x20sent');logger[_0x23c0('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x428bf1,_0x23c0('0xf'),JSON['stringify'](_0x113ce4));if(_0x113ce4[_0x23c0('0x10')]){if(_0x113ce4[_0x23c0('0x10')][_0x23c0('0x11')]===0x1f4){logger[_0x23c0('0x10')](_0x23c0('0xd'),_0x428bf1,_0x113ce4['error']['message']);return _0x33e628(_0x113ce4[_0x23c0('0x10')]['message']);}logger[_0x23c0('0x10')](_0x23c0('0xd'),_0x428bf1,_0x113ce4['error'][_0x23c0('0x12')]);return _0x10eee2(_0x113ce4['error'][_0x23c0('0x12')]);}else{logger[_0x23c0('0x13')](_0x23c0('0xd'),_0x428bf1,_0x23c0('0xf'));_0x10eee2(_0x113ce4['result']['message']);}})[_0x23c0('0x14')](function(_0x380d91){logger['error'](_0x23c0('0xd'),_0x428bf1,_0x380d91);_0x33e628(_0x380d91);});});}exports[_0x23c0('0x15')]=function(_0xe4145f){var _0x10d907=this;return new Promise(function(_0x709e74,_0x38ff71){return db[_0x23c0('0x16')]['findAll']({'raw':_0xe4145f['options']?_0xe4145f[_0x23c0('0x17')][_0x23c0('0x18')]===undefined?!![]:![]:!![],'where':_0xe4145f[_0x23c0('0x17')]?_0xe4145f[_0x23c0('0x17')]['where']||null:null,'attributes':_0xe4145f['options']?_0xe4145f[_0x23c0('0x17')][_0x23c0('0x19')]||null:null,'limit':_0xe4145f['options']?_0xe4145f[_0x23c0('0x17')][_0x23c0('0x1a')]||null:null,'include':_0xe4145f[_0x23c0('0x17')]?_0xe4145f[_0x23c0('0x17')][_0x23c0('0x1b')]?_[_0x23c0('0x1c')](_0xe4145f[_0x23c0('0x17')][_0x23c0('0x1b')],function(_0x77ee02){return{'model':db[_0x77ee02[_0x23c0('0x1d')]],'as':_0x77ee02['as'],'attributes':_0x77ee02['attributes'],'include':_0x77ee02[_0x23c0('0x1b')]?_[_0x23c0('0x1c')](_0x77ee02[_0x23c0('0x1b')],function(_0x32fb6f){return{'model':db[_0x32fb6f[_0x23c0('0x1d')]],'as':_0x32fb6f['as'],'attributes':_0x32fb6f[_0x23c0('0x19')],'include':_0x32fb6f[_0x23c0('0x1b')]?_[_0x23c0('0x1c')](_0x32fb6f[_0x23c0('0x1b')],function(_0x41e783){return{'model':db[_0x41e783[_0x23c0('0x1d')]],'as':_0x41e783['as'],'attributes':_0x41e783[_0x23c0('0x19')]};}):[]};}):[]};}):[]:[]})[_0x23c0('0xc')](function(_0x46b330){logger[_0x23c0('0x13')](_0x23c0('0x15'),_0xe4145f);logger[_0x23c0('0xe')]('GetSalesforceAccount',_0xe4145f,JSON[_0x23c0('0x1e')](_0x46b330));_0x709e74(_0x46b330);})[_0x23c0('0x14')](function(_0x4b14bd){logger[_0x23c0('0x10')](_0x23c0('0x15'),_0x4b14bd[_0x23c0('0x12')],_0xe4145f);_0x38ff71(_0x10d907['error'](0x1f4,_0x4b14bd['message']));});});};exports[_0x23c0('0x1f')]=function(_0x28385c){var _0x3a3e64=this;return new Promise(function(_0x4b6118,_0x5b2ee0){return db[_0x23c0('0x16')][_0x23c0('0x20')]({'raw':_0x28385c['options']?_0x28385c[_0x23c0('0x17')][_0x23c0('0x18')]===undefined?!![]:![]:!![],'where':_0x28385c[_0x23c0('0x17')]?_0x28385c[_0x23c0('0x17')][_0x23c0('0x21')]||null:null,'attributes':_0x28385c[_0x23c0('0x17')]?_0x28385c[_0x23c0('0x17')][_0x23c0('0x19')]||null:null,'include':_0x28385c[_0x23c0('0x17')]?_0x28385c[_0x23c0('0x17')][_0x23c0('0x1b')]?_[_0x23c0('0x1c')](_0x28385c[_0x23c0('0x17')][_0x23c0('0x1b')],function(_0x4a7ac6){return{'model':db[_0x4a7ac6['model']],'as':_0x4a7ac6['as'],'attributes':_0x4a7ac6[_0x23c0('0x19')],'include':_0x4a7ac6[_0x23c0('0x1b')]?_[_0x23c0('0x1c')](_0x4a7ac6[_0x23c0('0x1b')],function(_0x2fe298){return{'model':db[_0x2fe298['model']],'as':_0x2fe298['as'],'attributes':_0x2fe298[_0x23c0('0x19')],'include':_0x2fe298['include']?_[_0x23c0('0x1c')](_0x2fe298['include'],function(_0x333883){return{'model':db[_0x333883['model']],'as':_0x333883['as'],'attributes':_0x333883[_0x23c0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c61bf){logger['info'](_0x23c0('0x1f'),_0x28385c);logger['debug']('ShowSalesforceAccount',_0x28385c,JSON[_0x23c0('0x1e')](_0x4c61bf));_0x4b6118(_0x4c61bf);})[_0x23c0('0x14')](function(_0x5d8f2c){logger[_0x23c0('0x10')](_0x23c0('0x1f'),_0x5d8f2c[_0x23c0('0x12')],_0x28385c);_0x5b2ee0(_0x3a3e64[_0x23c0('0x10')](0x1f4,_0x5d8f2c[_0x23c0('0x12')]));});});};
\ No newline at end of file
+var _0x0c99=['raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetSalesforceAccount','SalesforceAccount','options','where','attributes','limit','include','map','model','ShowSalesforceAccount','find'];(function(_0x437925,_0x1fcfdc){var _0x2ad813=function(_0x15cfc4){while(--_0x15cfc4){_0x437925['push'](_0x437925['shift']());}};_0x2ad813(++_0x1fcfdc);}(_0x0c99,0xac));var _0x90c9=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x0c99[_0x2d4421];return _0x2d3b01;};'use strict';var _=require(_0x90c9('0x0'));var util=require(_0x90c9('0x1'));var moment=require('moment');var BPromise=require(_0x90c9('0x2'));var rs=require(_0x90c9('0x3'));var fs=require('fs');var Redis=require(_0x90c9('0x4'));var db=require(_0x90c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x90c9('0x6'))('rpc');var config=require(_0x90c9('0x7'));var jayson=require(_0x90c9('0x8'));var client=jayson['client'][_0x90c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc8b759,_0x373696,_0x240566){return new BPromise(function(_0x3012b0,_0x5e14ae){return client[_0x90c9('0xa')](_0xc8b759,_0x240566)[_0x90c9('0xb')](function(_0x48b6b8){logger[_0x90c9('0xc')](_0x90c9('0xd'),_0x373696,'request\x20sent');logger[_0x90c9('0xe')](_0x90c9('0xf'),_0x373696,_0x90c9('0x10'),JSON[_0x90c9('0x11')](_0x48b6b8));if(_0x48b6b8[_0x90c9('0x12')]){if(_0x48b6b8[_0x90c9('0x12')][_0x90c9('0x13')]===0x1f4){logger[_0x90c9('0x12')](_0x90c9('0xd'),_0x373696,_0x48b6b8[_0x90c9('0x12')][_0x90c9('0x14')]);return _0x5e14ae(_0x48b6b8[_0x90c9('0x12')][_0x90c9('0x14')]);}logger[_0x90c9('0x12')](_0x90c9('0xd'),_0x373696,_0x48b6b8['error'][_0x90c9('0x14')]);return _0x3012b0(_0x48b6b8[_0x90c9('0x12')][_0x90c9('0x14')]);}else{logger[_0x90c9('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x373696,'request\x20sent');_0x3012b0(_0x48b6b8['result'][_0x90c9('0x14')]);}})['catch'](function(_0x298e3c){logger[_0x90c9('0x12')](_0x90c9('0xd'),_0x373696,_0x298e3c);_0x5e14ae(_0x298e3c);});});}exports[_0x90c9('0x15')]=function(_0x6ecf4d){var _0x4fc70c=this;return new Promise(function(_0x3c47ee,_0x3e6c0c){return db[_0x90c9('0x16')]['findAll']({'raw':_0x6ecf4d['options']?_0x6ecf4d[_0x90c9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x6ecf4d[_0x90c9('0x17')]?_0x6ecf4d[_0x90c9('0x17')][_0x90c9('0x18')]||null:null,'attributes':_0x6ecf4d[_0x90c9('0x17')]?_0x6ecf4d[_0x90c9('0x17')][_0x90c9('0x19')]||null:null,'limit':_0x6ecf4d['options']?_0x6ecf4d[_0x90c9('0x17')][_0x90c9('0x1a')]||null:null,'include':_0x6ecf4d[_0x90c9('0x17')]?_0x6ecf4d[_0x90c9('0x17')][_0x90c9('0x1b')]?_[_0x90c9('0x1c')](_0x6ecf4d[_0x90c9('0x17')]['include'],function(_0x214b58){return{'model':db[_0x214b58[_0x90c9('0x1d')]],'as':_0x214b58['as'],'attributes':_0x214b58[_0x90c9('0x19')],'include':_0x214b58[_0x90c9('0x1b')]?_['map'](_0x214b58[_0x90c9('0x1b')],function(_0x402d50){return{'model':db[_0x402d50[_0x90c9('0x1d')]],'as':_0x402d50['as'],'attributes':_0x402d50['attributes'],'include':_0x402d50['include']?_[_0x90c9('0x1c')](_0x402d50['include'],function(_0x45f508){return{'model':db[_0x45f508[_0x90c9('0x1d')]],'as':_0x45f508['as'],'attributes':_0x45f508[_0x90c9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x90c9('0xb')](function(_0x154721){logger[_0x90c9('0xc')](_0x90c9('0x15'),_0x6ecf4d);logger[_0x90c9('0xe')](_0x90c9('0x15'),_0x6ecf4d,JSON[_0x90c9('0x11')](_0x154721));_0x3c47ee(_0x154721);})['catch'](function(_0x53dbee){logger['error'](_0x90c9('0x15'),_0x53dbee['message'],_0x6ecf4d);_0x3e6c0c(_0x4fc70c['error'](0x1f4,_0x53dbee[_0x90c9('0x14')]));});});};exports[_0x90c9('0x1e')]=function(_0x333019){var _0x15e897=this;return new Promise(function(_0x5e6619,_0x4213d5){return db[_0x90c9('0x16')][_0x90c9('0x1f')]({'raw':_0x333019[_0x90c9('0x17')]?_0x333019[_0x90c9('0x17')][_0x90c9('0x20')]===undefined?!![]:![]:!![],'where':_0x333019['options']?_0x333019[_0x90c9('0x17')][_0x90c9('0x18')]||null:null,'attributes':_0x333019['options']?_0x333019[_0x90c9('0x17')][_0x90c9('0x19')]||null:null,'include':_0x333019[_0x90c9('0x17')]?_0x333019[_0x90c9('0x17')][_0x90c9('0x1b')]?_[_0x90c9('0x1c')](_0x333019[_0x90c9('0x17')][_0x90c9('0x1b')],function(_0x1013c1){return{'model':db[_0x1013c1[_0x90c9('0x1d')]],'as':_0x1013c1['as'],'attributes':_0x1013c1[_0x90c9('0x19')],'include':_0x1013c1[_0x90c9('0x1b')]?_[_0x90c9('0x1c')](_0x1013c1[_0x90c9('0x1b')],function(_0x4a6042){return{'model':db[_0x4a6042[_0x90c9('0x1d')]],'as':_0x4a6042['as'],'attributes':_0x4a6042[_0x90c9('0x19')],'include':_0x4a6042['include']?_[_0x90c9('0x1c')](_0x4a6042[_0x90c9('0x1b')],function(_0x5d1de0){return{'model':db[_0x5d1de0['model']],'as':_0x5d1de0['as'],'attributes':_0x5d1de0[_0x90c9('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d1811){logger['info'](_0x90c9('0x1e'),_0x333019);logger[_0x90c9('0xe')](_0x90c9('0x1e'),_0x333019,JSON[_0x90c9('0x11')](_0x3d1811));_0x5e6619(_0x3d1811);})[_0x90c9('0x21')](function(_0x22ae52){logger[_0x90c9('0x12')](_0x90c9('0x1e'),_0x22ae52[_0x90c9('0x14')],_0x333019);_0x4213d5(_0x15e897[_0x90c9('0x12')](0x1f4,_0x22ae52[_0x90c9('0x14')]));});});};
\ No newline at end of file
index 86900b5..4d8c837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['Router','fs-extra','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x392963,_0xbd6531){var _0x3158a4=function(_0x1c5952){while(--_0x1c5952){_0x392963['push'](_0x392963['shift']());}};_0x3158a4(++_0xbd6531);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2cd040,_0x38960e){_0x2cd040=_0x2cd040-0x0;var _0x3b65a7=_0x5f2f[_0x2cd040];return _0x3b65a7;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x9')](_0xf5f2('0x10'),auth['isAuthenticated'](),controller[_0xf5f2('0x11')]);router['get']('/:id/descriptions',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x12')]);router['post']('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x13')]);router[_0xf5f2('0x14')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x15')]);router['delete'](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x16')]);module[_0xf5f2('0x17')]=router;
\ No newline at end of file
+var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x504b51,_0x372e87){var _0x22ab1f=function(_0x27cd89){while(--_0x27cd89){_0x504b51['push'](_0x504b51['shift']());}};_0x22ab1f(++_0x372e87);}(_0x2ef3,0xba));var _0x32ef=function(_0x433a2d,_0x518cfa){_0x433a2d=_0x433a2d-0x0;var _0x4ad690=_0x2ef3[_0x433a2d];return _0x4ad690;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router;
\ No newline at end of file
index 5bfdda9..39a5667 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x409b=['sequelize','exports','STRING','ENUM','Task','account_contact_lead','account','contact_lead','nothing','contact','lead'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x409b,0x14a));var _0xb409=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x409b[_0x17b6e3];return _0x3906f3;};'use strict';var Sequelize=require(_0xb409('0x0'));module[_0xb409('0x1')]={'name':{'type':Sequelize[_0xb409('0x2')]},'description':{'type':Sequelize[_0xb409('0x2')]},'ticketType':{'type':Sequelize[_0xb409('0x3')](_0xb409('0x4'),'Case'),'defaultValue':_0xb409('0x4')},'moduleSearch':{'type':Sequelize[_0xb409('0x3')]('contact_lead','contact','lead',_0xb409('0x5'),_0xb409('0x6')),'defaultValue':_0xb409('0x7')},'moduleCreate':{'type':Sequelize[_0xb409('0x3')](_0xb409('0x8'),_0xb409('0x9'),'lead',_0xb409('0x6')),'defaultValue':_0xb409('0xa')},'leadId':{'type':Sequelize[_0xb409('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xb409('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa22b=['Task','Case','contact_lead','contact','account_contact_lead','account','nothing','lead','sequelize','exports','STRING','ENUM'];(function(_0x3fd31e,_0xc1e8a3){var _0x35d214=function(_0x18d699){while(--_0x18d699){_0x3fd31e['push'](_0x3fd31e['shift']());}};_0x35d214(++_0xc1e8a3);}(_0xa22b,0x128));var _0xba22=function(_0x2dd22f,_0x274cc1){_0x2dd22f=_0x2dd22f-0x0;var _0x1d881a=_0xa22b[_0x2dd22f];return _0x1d881a;};'use strict';var Sequelize=require(_0xba22('0x0'));module[_0xba22('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xba22('0x2')]},'ticketType':{'type':Sequelize[_0xba22('0x3')](_0xba22('0x4'),_0xba22('0x5')),'defaultValue':_0xba22('0x4')},'moduleSearch':{'type':Sequelize[_0xba22('0x3')](_0xba22('0x6'),_0xba22('0x7'),'lead',_0xba22('0x8'),_0xba22('0x9')),'defaultValue':_0xba22('0x6')},'moduleCreate':{'type':Sequelize[_0xba22('0x3')](_0xba22('0xa'),'contact',_0xba22('0xb'),'account'),'defaultValue':_0xba22('0xb')},'leadId':{'type':Sequelize[_0xba22('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xba22('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
index de82fab..75143fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d6d=['merge','catch','body','destroy','find','getFields','findOne','getSubjects','SalesforceField','getDescriptions','filter','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','error','stack','name','SalesforceConfiguration','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params'];(function(_0x382f14,_0x463f43){var _0x346768=function(_0x304b0f){while(--_0x304b0f){_0x382f14['push'](_0x382f14['shift']());}};_0x346768(++_0x463f43);}(_0x1d6d,0xf8));var _0xd1d6=function(_0x57486f,_0x344543){_0x57486f=_0x57486f-0x0;var _0x3375b2=_0x1d6d[_0x57486f];return _0x3375b2;};'use strict';var emlformat=require(_0xd1d6('0x0'));var rimraf=require(_0xd1d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd1d6('0x2'));var rp=require(_0xd1d6('0x3'));var moment=require('moment');var BPromise=require(_0xd1d6('0x4'));var Mustache=require(_0xd1d6('0x5'));var util=require(_0xd1d6('0x6'));var path=require(_0xd1d6('0x7'));var sox=require(_0xd1d6('0x8'));var csv=require(_0xd1d6('0x9'));var ejs=require(_0xd1d6('0xa'));var fs=require('fs');var fs_extra=require(_0xd1d6('0xb'));var _=require(_0xd1d6('0xc'));var squel=require(_0xd1d6('0xd'));var crypto=require('crypto');var jsforce=require(_0xd1d6('0xe'));var deskjs=require(_0xd1d6('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd1d6('0x10'));var Papa=require('papaparse');var Redis=require(_0xd1d6('0x11'));var authService=require(_0xd1d6('0x12'));var qs=require(_0xd1d6('0x13'));var as=require(_0xd1d6('0x14'));var hardwareService=require(_0xd1d6('0x15'));var logger=require(_0xd1d6('0x16'))(_0xd1d6('0x17'));var utils=require(_0xd1d6('0x18'));var config=require(_0xd1d6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1d6('0x1a'))['db'];function respondWithStatusCode(_0x9049b,_0x55740){_0x55740=_0x55740||0xcc;return function(_0x1587ce){if(_0x1587ce){return _0x9049b['sendStatus'](_0x55740);}return _0x9049b['status'](_0x55740)[_0xd1d6('0x1b')]();};}function respondWithResult(_0x2f6d6b,_0x1e6425){_0x1e6425=_0x1e6425||0xc8;return function(_0x1b8dc9){if(_0x1b8dc9){return _0x2f6d6b[_0xd1d6('0x1c')](_0x1e6425)[_0xd1d6('0x1d')](_0x1b8dc9);}};}function respondWithFilteredResult(_0x46a3b5,_0x3ec84b){return function(_0x1c95ff){if(_0x1c95ff){var _0x8ee034=typeof _0x3ec84b[_0xd1d6('0x1e')]===_0xd1d6('0x1f')&&typeof _0x3ec84b[_0xd1d6('0x20')]===_0xd1d6('0x1f');var _0x3e215b=_0x1c95ff[_0xd1d6('0x21')];var _0x14e397=_0x8ee034?0x0:_0x3ec84b[_0xd1d6('0x1e')];var _0x495d55=_0x8ee034?_0x1c95ff['count']:_0x3ec84b[_0xd1d6('0x1e')]+_0x3ec84b[_0xd1d6('0x20')];var _0xfe13f2;if(_0x495d55>=_0x3e215b){_0x495d55=_0x3e215b;_0xfe13f2=0xc8;}else{_0xfe13f2=0xce;}_0x46a3b5[_0xd1d6('0x1c')](_0xfe13f2);return _0x46a3b5[_0xd1d6('0x22')]('Content-Range',_0x14e397+'-'+_0x495d55+'/'+_0x3e215b)[_0xd1d6('0x1d')](_0x1c95ff);}return null;};}function patchUpdates(_0x110512){return function(_0x4a7fe5){try{jsonpatch[_0xd1d6('0x23')](_0x4a7fe5,_0x110512,!![]);}catch(_0x4d4bac){return BPromise['reject'](_0x4d4bac);}return _0x4a7fe5[_0xd1d6('0x24')]();};}function saveUpdates(_0x3ca115,_0x592de1){return function(_0x4a50a4){if(_0x4a50a4){return _0x4a50a4[_0xd1d6('0x25')](_0x3ca115)[_0xd1d6('0x26')](function(_0x51c0d4){return _0x51c0d4;});}return null;};}function removeEntity(_0x424b62,_0x499c6f){return function(_0x2a2d47){if(_0x2a2d47){return _0x2a2d47['destroy']()[_0xd1d6('0x26')](function(){_0x424b62[_0xd1d6('0x1c')](0xcc)[_0xd1d6('0x1b')]();});}};}function handleEntityNotFound(_0x2e5320,_0x558f40){return function(_0x417fb8){if(!_0x417fb8){_0x2e5320[_0xd1d6('0x27')](0x194);}return _0x417fb8;};}function handleError(_0x120806,_0x1d9545){_0x1d9545=_0x1d9545||0x1f4;return function(_0x8888bd){logger[_0xd1d6('0x28')](_0x8888bd[_0xd1d6('0x29')]);if(_0x8888bd[_0xd1d6('0x2a')]){delete _0x8888bd[_0xd1d6('0x2a')];}_0x120806[_0xd1d6('0x1c')](_0x1d9545)['send'](_0x8888bd);};}exports['index']=function(_0x25e989,_0x165f65){var _0x14146a={},_0x4a81e5={},_0x40bea9={'count':0x0,'rows':[]};var _0x29253d=_['map'](db[_0xd1d6('0x2b')][_0xd1d6('0x2c')],function(_0x23f67){return{'name':_0x23f67['fieldName'],'type':_0x23f67[_0xd1d6('0x2d')]['key']};});_0x4a81e5[_0xd1d6('0x2e')]=_[_0xd1d6('0x2f')](_0x29253d,_0xd1d6('0x2a'));_0x4a81e5[_0xd1d6('0x30')]=_[_0xd1d6('0x31')](_0x25e989[_0xd1d6('0x30')]);_0x4a81e5[_0xd1d6('0x32')]=_[_0xd1d6('0x33')](_0x4a81e5[_0xd1d6('0x2e')],_0x4a81e5[_0xd1d6('0x30')]);_0x14146a[_0xd1d6('0x34')]=_[_0xd1d6('0x33')](_0x4a81e5[_0xd1d6('0x2e')],qs[_0xd1d6('0x35')](_0x25e989[_0xd1d6('0x30')][_0xd1d6('0x35')]));_0x14146a[_0xd1d6('0x34')]=_0x14146a['attributes'][_0xd1d6('0x36')]?_0x14146a[_0xd1d6('0x34')]:_0x4a81e5[_0xd1d6('0x2e')];if(!_0x25e989['query'][_0xd1d6('0x37')](_0xd1d6('0x38'))){_0x14146a[_0xd1d6('0x20')]=qs[_0xd1d6('0x20')](_0x25e989[_0xd1d6('0x30')][_0xd1d6('0x20')]);_0x14146a['offset']=qs[_0xd1d6('0x1e')](_0x25e989[_0xd1d6('0x30')][_0xd1d6('0x1e')]);}_0x14146a[_0xd1d6('0x39')]=qs['sort'](_0x25e989['query'][_0xd1d6('0x3a')]);_0x14146a[_0xd1d6('0x3b')]=qs[_0xd1d6('0x32')](_['pick'](_0x25e989[_0xd1d6('0x30')],_0x4a81e5[_0xd1d6('0x32')]),_0x29253d);if(_0x25e989['query']['filter']){_0x14146a[_0xd1d6('0x3b')]=_['merge'](_0x14146a[_0xd1d6('0x3b')],{'$or':_['map'](_0x29253d,function(_0x877f6d){if(_0x877f6d['type']!==_0xd1d6('0x3c')){var _0x231e70={};_0x231e70[_0x877f6d[_0xd1d6('0x2a')]]={'$like':'%'+_0x25e989[_0xd1d6('0x30')]['filter']+'%'};return _0x231e70;}})});}_0x14146a=_['merge']({},_0x14146a,_0x25e989[_0xd1d6('0x3d')]);var _0x9164ba={'where':_0x14146a[_0xd1d6('0x3b')]};return db[_0xd1d6('0x2b')]['count'](_0x9164ba)['then'](function(_0x2c748b){_0x40bea9[_0xd1d6('0x21')]=_0x2c748b;if(_0x25e989[_0xd1d6('0x30')][_0xd1d6('0x3e')]){_0x14146a[_0xd1d6('0x3f')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xd1d6('0x40')](_0x14146a);})[_0xd1d6('0x26')](function(_0x63a37d){_0x40bea9[_0xd1d6('0x41')]=_0x63a37d;return _0x40bea9;})[_0xd1d6('0x26')](respondWithFilteredResult(_0x165f65,_0x14146a))['catch'](handleError(_0x165f65,null));};exports[_0xd1d6('0x42')]=function(_0x20ec18,_0xaadb8){var _0x4d9430={'raw':![],'where':{'id':_0x20ec18[_0xd1d6('0x43')]['id']}},_0x5cbb66={};_0x5cbb66[_0xd1d6('0x2e')]=_['keys'](db[_0xd1d6('0x2b')]['rawAttributes']);_0x5cbb66[_0xd1d6('0x30')]=_['keys'](_0x20ec18['query']);_0x5cbb66[_0xd1d6('0x32')]=_[_0xd1d6('0x33')](_0x5cbb66[_0xd1d6('0x2e')],_0x5cbb66[_0xd1d6('0x30')]);_0x4d9430[_0xd1d6('0x34')]=_['intersection'](_0x5cbb66['model'],qs[_0xd1d6('0x35')](_0x20ec18[_0xd1d6('0x30')][_0xd1d6('0x35')]));_0x4d9430['attributes']=_0x4d9430[_0xd1d6('0x34')][_0xd1d6('0x36')]?_0x4d9430[_0xd1d6('0x34')]:_0x5cbb66[_0xd1d6('0x2e')];if(_0x20ec18[_0xd1d6('0x30')]['includeAll']){_0x4d9430[_0xd1d6('0x3f')]=[{'all':!![]}];}_0x4d9430=_[_0xd1d6('0x44')]({},_0x4d9430,_0x20ec18['options']);return db[_0xd1d6('0x2b')]['find'](_0x4d9430)[_0xd1d6('0x26')](handleEntityNotFound(_0xaadb8,null))[_0xd1d6('0x26')](respondWithResult(_0xaadb8,null))[_0xd1d6('0x45')](handleError(_0xaadb8,null));};exports['create']=function(_0x506ae7,_0x9dabc5){return db[_0xd1d6('0x2b')]['create'](_0x506ae7[_0xd1d6('0x46')],{})[_0xd1d6('0x26')](respondWithResult(_0x9dabc5,0xc9))[_0xd1d6('0x45')](handleError(_0x9dabc5,null));};exports[_0xd1d6('0x25')]=function(_0x379614,_0x2ddd02){if(_0x379614[_0xd1d6('0x46')]['id']){delete _0x379614[_0xd1d6('0x46')]['id'];}return db[_0xd1d6('0x2b')]['find']({'where':{'id':_0x379614['params']['id']}})[_0xd1d6('0x26')](handleEntityNotFound(_0x2ddd02,null))['then'](saveUpdates(_0x379614[_0xd1d6('0x46')],null))[_0xd1d6('0x26')](respondWithResult(_0x2ddd02,null))['catch'](handleError(_0x2ddd02,null));};exports[_0xd1d6('0x47')]=function(_0x63a722,_0x1f64b7){return db[_0xd1d6('0x2b')][_0xd1d6('0x48')]({'where':{'id':_0x63a722[_0xd1d6('0x43')]['id']}})[_0xd1d6('0x26')](handleEntityNotFound(_0x1f64b7,null))[_0xd1d6('0x26')](removeEntity(_0x1f64b7,null))['catch'](handleError(_0x1f64b7,null));};exports[_0xd1d6('0x49')]=function(_0x100112,_0x5a6096,_0x40509c){var _0x11cd41={};var _0x43edd1={};var _0x5e71b2;var _0x456f6f;return db[_0xd1d6('0x2b')][_0xd1d6('0x4a')]({'where':{'id':_0x100112[_0xd1d6('0x43')]['id']}})[_0xd1d6('0x26')](handleEntityNotFound(_0x5a6096,null))[_0xd1d6('0x26')](function(_0x215851){if(_0x215851){_0x5e71b2=_0x215851;_0x43edd1['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x43edd1[_0xd1d6('0x30')]=_[_0xd1d6('0x31')](_0x100112[_0xd1d6('0x30')]);_0x43edd1[_0xd1d6('0x32')]=_[_0xd1d6('0x33')](_0x43edd1[_0xd1d6('0x2e')],_0x43edd1['query']);_0x11cd41[_0xd1d6('0x34')]=_[_0xd1d6('0x33')](_0x43edd1[_0xd1d6('0x2e')],qs[_0xd1d6('0x35')](_0x100112[_0xd1d6('0x30')]['fields']));_0x11cd41[_0xd1d6('0x34')]=_0x11cd41[_0xd1d6('0x34')][_0xd1d6('0x36')]?_0x11cd41[_0xd1d6('0x34')]:_0x43edd1[_0xd1d6('0x2e')];_0x11cd41['order']=qs[_0xd1d6('0x3a')](_0x100112[_0xd1d6('0x30')][_0xd1d6('0x3a')]);_0x11cd41[_0xd1d6('0x3b')]=qs[_0xd1d6('0x32')](_['pick'](_0x100112[_0xd1d6('0x30')],_0x43edd1['filters']));if(_0x100112[_0xd1d6('0x30')]['filter']){_0x11cd41['where']=_[_0xd1d6('0x44')](_0x11cd41[_0xd1d6('0x3b')],{'$or':_[_0xd1d6('0x2f')](_0x11cd41['attributes'],function(_0xdef89f){var _0x25c67b={};_0x25c67b[_0xdef89f]={'$like':'%'+_0x100112[_0xd1d6('0x30')]['filter']+'%'};return _0x25c67b;})});}_0x11cd41=_[_0xd1d6('0x44')]({},_0x11cd41,_0x100112['options']);return _0x5e71b2['getFields'](_0x11cd41);}})[_0xd1d6('0x26')](function(_0x5b8e24){if(_0x5b8e24){_0x456f6f=_0x5b8e24[_0xd1d6('0x36')];if(!_0x100112['query'][_0xd1d6('0x37')](_0xd1d6('0x38'))){_0x11cd41[_0xd1d6('0x20')]=qs[_0xd1d6('0x20')](_0x100112[_0xd1d6('0x30')][_0xd1d6('0x20')]);_0x11cd41[_0xd1d6('0x1e')]=qs[_0xd1d6('0x1e')](_0x100112[_0xd1d6('0x30')][_0xd1d6('0x1e')]);}return _0x5e71b2[_0xd1d6('0x49')](_0x11cd41);}})[_0xd1d6('0x26')](function(_0x1c855a){if(_0x1c855a){return _0x1c855a?{'count':_0x456f6f,'rows':_0x1c855a}:null;}})[_0xd1d6('0x26')](respondWithResult(_0x5a6096,null))[_0xd1d6('0x45')](handleError(_0x5a6096,null));};exports[_0xd1d6('0x4b')]=function(_0x30e702,_0x2a975f,_0x2d477d){var _0x365880={};var _0x6f724b={};var _0x2918bf;var _0x32099a;return db[_0xd1d6('0x2b')]['findOne']({'where':{'id':_0x30e702[_0xd1d6('0x43')]['id']}})[_0xd1d6('0x26')](handleEntityNotFound(_0x2a975f,null))['then'](function(_0x48dfc5){if(_0x48dfc5){_0x2918bf=_0x48dfc5;_0x6f724b[_0xd1d6('0x2e')]=_[_0xd1d6('0x31')](db[_0xd1d6('0x4c')][_0xd1d6('0x2c')]);_0x6f724b[_0xd1d6('0x30')]=_[_0xd1d6('0x31')](_0x30e702[_0xd1d6('0x30')]);_0x6f724b[_0xd1d6('0x32')]=_[_0xd1d6('0x33')](_0x6f724b['model'],_0x6f724b['query']);_0x365880[_0xd1d6('0x34')]=_[_0xd1d6('0x33')](_0x6f724b[_0xd1d6('0x2e')],qs['fields'](_0x30e702[_0xd1d6('0x30')]['fields']));_0x365880[_0xd1d6('0x34')]=_0x365880[_0xd1d6('0x34')]['length']?_0x365880['attributes']:_0x6f724b[_0xd1d6('0x2e')];_0x365880[_0xd1d6('0x39')]=qs['sort'](_0x30e702['query'][_0xd1d6('0x3a')]);_0x365880[_0xd1d6('0x3b')]=qs['filters'](_['pick'](_0x30e702['query'],_0x6f724b[_0xd1d6('0x32')]));if(_0x30e702[_0xd1d6('0x30')]['filter']){_0x365880[_0xd1d6('0x3b')]=_[_0xd1d6('0x44')](_0x365880['where'],{'$or':_[_0xd1d6('0x2f')](_0x365880['attributes'],function(_0x1b6ba2){var _0x26d454={};_0x26d454[_0x1b6ba2]={'$like':'%'+_0x30e702['query']['filter']+'%'};return _0x26d454;})});}_0x365880=_[_0xd1d6('0x44')]({},_0x365880,_0x30e702[_0xd1d6('0x3d')]);return _0x2918bf['getSubjects'](_0x365880);}})[_0xd1d6('0x26')](function(_0x4c665c){if(_0x4c665c){_0x32099a=_0x4c665c[_0xd1d6('0x36')];if(!_0x30e702[_0xd1d6('0x30')][_0xd1d6('0x37')]('nolimit')){_0x365880[_0xd1d6('0x20')]=qs[_0xd1d6('0x20')](_0x30e702[_0xd1d6('0x30')][_0xd1d6('0x20')]);_0x365880[_0xd1d6('0x1e')]=qs[_0xd1d6('0x1e')](_0x30e702[_0xd1d6('0x30')]['offset']);}return _0x2918bf[_0xd1d6('0x4b')](_0x365880);}})[_0xd1d6('0x26')](function(_0xda8bae){if(_0xda8bae){return _0xda8bae?{'count':_0x32099a,'rows':_0xda8bae}:null;}})['then'](respondWithResult(_0x2a975f,null))[_0xd1d6('0x45')](handleError(_0x2a975f,null));};exports[_0xd1d6('0x4d')]=function(_0x3cb380,_0x437377,_0x580322){var _0x1ad256={};var _0x4240bb={};var _0x2283c4;var _0x3dccfb;return db[_0xd1d6('0x2b')]['findOne']({'where':{'id':_0x3cb380[_0xd1d6('0x43')]['id']}})['then'](handleEntityNotFound(_0x437377,null))[_0xd1d6('0x26')](function(_0x4921bb){if(_0x4921bb){_0x2283c4=_0x4921bb;_0x4240bb['model']=_[_0xd1d6('0x31')](db[_0xd1d6('0x4c')][_0xd1d6('0x2c')]);_0x4240bb['query']=_['keys'](_0x3cb380[_0xd1d6('0x30')]);_0x4240bb[_0xd1d6('0x32')]=_[_0xd1d6('0x33')](_0x4240bb[_0xd1d6('0x2e')],_0x4240bb[_0xd1d6('0x30')]);_0x1ad256['attributes']=_['intersection'](_0x4240bb[_0xd1d6('0x2e')],qs[_0xd1d6('0x35')](_0x3cb380[_0xd1d6('0x30')]['fields']));_0x1ad256[_0xd1d6('0x34')]=_0x1ad256[_0xd1d6('0x34')]['length']?_0x1ad256[_0xd1d6('0x34')]:_0x4240bb['model'];_0x1ad256[_0xd1d6('0x39')]=qs[_0xd1d6('0x3a')](_0x3cb380[_0xd1d6('0x30')][_0xd1d6('0x3a')]);_0x1ad256[_0xd1d6('0x3b')]=qs['filters'](_['pick'](_0x3cb380['query'],_0x4240bb[_0xd1d6('0x32')]));if(_0x3cb380[_0xd1d6('0x30')]['filter']){_0x1ad256[_0xd1d6('0x3b')]=_[_0xd1d6('0x44')](_0x1ad256['where'],{'$or':_['map'](_0x1ad256['attributes'],function(_0x48d35b){var _0x69b314={};_0x69b314[_0x48d35b]={'$like':'%'+_0x3cb380[_0xd1d6('0x30')][_0xd1d6('0x4e')]+'%'};return _0x69b314;})});}_0x1ad256=_[_0xd1d6('0x44')]({},_0x1ad256,_0x3cb380[_0xd1d6('0x3d')]);return _0x2283c4[_0xd1d6('0x4d')](_0x1ad256);}})['then'](function(_0x113bd6){if(_0x113bd6){_0x3dccfb=_0x113bd6[_0xd1d6('0x36')];if(!_0x3cb380[_0xd1d6('0x30')]['hasOwnProperty']('nolimit')){_0x1ad256[_0xd1d6('0x20')]=qs['limit'](_0x3cb380['query'][_0xd1d6('0x20')]);_0x1ad256[_0xd1d6('0x1e')]=qs['offset'](_0x3cb380[_0xd1d6('0x30')]['offset']);}return _0x2283c4[_0xd1d6('0x4d')](_0x1ad256);}})[_0xd1d6('0x26')](function(_0xefac75){if(_0xefac75){return _0xefac75?{'count':_0x3dccfb,'rows':_0xefac75}:null;}})[_0xd1d6('0x26')](respondWithResult(_0x437377,null))[_0xd1d6('0x45')](handleError(_0x437377,null));};
\ No newline at end of file
+var _0xb239=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','limit','undefined','count','offset','json','apply','save','update','then','error','stack','name','send','index','SalesforceConfiguration','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','options','include','catch','params','includeAll','merge','find','create','body','destroy','getFields','findOne','SalesforceField','rawAttributes','pick','hasOwnProperty','nolimit','getSubjects','getDescriptions'];(function(_0x30bd4d,_0x50eb60){var _0x306915=function(_0x5ae782){while(--_0x5ae782){_0x30bd4d['push'](_0x30bd4d['shift']());}};_0x306915(++_0x50eb60);}(_0xb239,0x96));var _0x9b23=function(_0xb585cf,_0x27f995){_0xb585cf=_0xb585cf-0x0;var _0x3c845b=_0xb239[_0xb585cf];return _0x3c845b;};'use strict';var emlformat=require(_0x9b23('0x0'));var rimraf=require(_0x9b23('0x1'));var zipdir=require(_0x9b23('0x2'));var jsonpatch=require(_0x9b23('0x3'));var rp=require(_0x9b23('0x4'));var moment=require(_0x9b23('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9b23('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9b23('0x7'));var csv=require(_0x9b23('0x8'));var ejs=require(_0x9b23('0x9'));var fs=require('fs');var fs_extra=require(_0x9b23('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9b23('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9b23('0x8'));var querystring=require(_0x9b23('0xc'));var Papa=require(_0x9b23('0xd'));var Redis=require(_0x9b23('0xe'));var authService=require(_0x9b23('0xf'));var qs=require(_0x9b23('0x10'));var as=require(_0x9b23('0x11'));var hardwareService=require(_0x9b23('0x12'));var logger=require('../../config/logger')(_0x9b23('0x13'));var utils=require('../../config/utils');var config=require(_0x9b23('0x14'));var licenseUtil=require(_0x9b23('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9a0bd4,_0x19773f){_0x19773f=_0x19773f||0xcc;return function(_0xc2bea3){if(_0xc2bea3){return _0x9a0bd4[_0x9b23('0x16')](_0x19773f);}return _0x9a0bd4[_0x9b23('0x17')](_0x19773f)[_0x9b23('0x18')]();};}function respondWithResult(_0x2038a2,_0x3b0b87){_0x3b0b87=_0x3b0b87||0xc8;return function(_0x58b4c4){if(_0x58b4c4){return _0x2038a2[_0x9b23('0x17')](_0x3b0b87)['json'](_0x58b4c4);}};}function respondWithFilteredResult(_0x55e54d,_0x586244){return function(_0x1aeae4){if(_0x1aeae4){var _0x43ec25=typeof _0x586244['offset']==='undefined'&&typeof _0x586244[_0x9b23('0x19')]===_0x9b23('0x1a');var _0x23f718=_0x1aeae4[_0x9b23('0x1b')];var _0x205d5d=_0x43ec25?0x0:_0x586244['offset'];var _0x2e02bf=_0x43ec25?_0x1aeae4['count']:_0x586244[_0x9b23('0x1c')]+_0x586244[_0x9b23('0x19')];var _0x536aa;if(_0x2e02bf>=_0x23f718){_0x2e02bf=_0x23f718;_0x536aa=0xc8;}else{_0x536aa=0xce;}_0x55e54d[_0x9b23('0x17')](_0x536aa);return _0x55e54d['set']('Content-Range',_0x205d5d+'-'+_0x2e02bf+'/'+_0x23f718)[_0x9b23('0x1d')](_0x1aeae4);}return null;};}function patchUpdates(_0x1175e4){return function(_0x22e3a2){try{jsonpatch[_0x9b23('0x1e')](_0x22e3a2,_0x1175e4,!![]);}catch(_0x3314ac){return BPromise['reject'](_0x3314ac);}return _0x22e3a2[_0x9b23('0x1f')]();};}function saveUpdates(_0x52154e,_0xf5ef33){return function(_0x555f72){if(_0x555f72){return _0x555f72[_0x9b23('0x20')](_0x52154e)[_0x9b23('0x21')](function(_0x211b33){return _0x211b33;});}return null;};}function removeEntity(_0x1ebfa0,_0x4faa24){return function(_0x19c421){if(_0x19c421){return _0x19c421['destroy']()[_0x9b23('0x21')](function(){_0x1ebfa0['status'](0xcc)[_0x9b23('0x18')]();});}};}function handleEntityNotFound(_0x4b82a2,_0x190e5f){return function(_0x16fe14){if(!_0x16fe14){_0x4b82a2[_0x9b23('0x16')](0x194);}return _0x16fe14;};}function handleError(_0xed6f50,_0x1c5522){_0x1c5522=_0x1c5522||0x1f4;return function(_0x583be2){logger[_0x9b23('0x22')](_0x583be2[_0x9b23('0x23')]);if(_0x583be2['name']){delete _0x583be2[_0x9b23('0x24')];}_0xed6f50['status'](_0x1c5522)[_0x9b23('0x25')](_0x583be2);};}exports[_0x9b23('0x26')]=function(_0x5836a0,_0x22af72){var _0x11b219={},_0x53ee5e={},_0x3894ba={'count':0x0,'rows':[]};var _0x4d715a=_['map'](db[_0x9b23('0x27')]['rawAttributes'],function(_0x2f4b26){return{'name':_0x2f4b26['fieldName'],'type':_0x2f4b26[_0x9b23('0x28')][_0x9b23('0x29')]};});_0x53ee5e[_0x9b23('0x2a')]=_[_0x9b23('0x2b')](_0x4d715a,'name');_0x53ee5e[_0x9b23('0x2c')]=_[_0x9b23('0x2d')](_0x5836a0[_0x9b23('0x2c')]);_0x53ee5e[_0x9b23('0x2e')]=_[_0x9b23('0x2f')](_0x53ee5e[_0x9b23('0x2a')],_0x53ee5e[_0x9b23('0x2c')]);_0x11b219[_0x9b23('0x30')]=_[_0x9b23('0x2f')](_0x53ee5e[_0x9b23('0x2a')],qs['fields'](_0x5836a0[_0x9b23('0x2c')][_0x9b23('0x31')]));_0x11b219[_0x9b23('0x30')]=_0x11b219[_0x9b23('0x30')][_0x9b23('0x32')]?_0x11b219[_0x9b23('0x30')]:_0x53ee5e['model'];if(!_0x5836a0['query']['hasOwnProperty']('nolimit')){_0x11b219[_0x9b23('0x19')]=qs[_0x9b23('0x19')](_0x5836a0[_0x9b23('0x2c')][_0x9b23('0x19')]);_0x11b219['offset']=qs[_0x9b23('0x1c')](_0x5836a0[_0x9b23('0x2c')][_0x9b23('0x1c')]);}_0x11b219[_0x9b23('0x33')]=qs[_0x9b23('0x34')](_0x5836a0['query'][_0x9b23('0x34')]);_0x11b219[_0x9b23('0x35')]=qs[_0x9b23('0x2e')](_['pick'](_0x5836a0[_0x9b23('0x2c')],_0x53ee5e[_0x9b23('0x2e')]),_0x4d715a);if(_0x5836a0[_0x9b23('0x2c')][_0x9b23('0x36')]){_0x11b219['where']=_['merge'](_0x11b219[_0x9b23('0x35')],{'$or':_[_0x9b23('0x2b')](_0x4d715a,function(_0x3ddad8){if(_0x3ddad8[_0x9b23('0x28')]!==_0x9b23('0x37')){var _0x2b1ad8={};_0x2b1ad8[_0x3ddad8[_0x9b23('0x24')]]={'$like':'%'+_0x5836a0[_0x9b23('0x2c')][_0x9b23('0x36')]+'%'};return _0x2b1ad8;}})});}_0x11b219=_['merge']({},_0x11b219,_0x5836a0[_0x9b23('0x38')]);var _0x31397={'where':_0x11b219[_0x9b23('0x35')]};return db['SalesforceConfiguration']['count'](_0x31397)[_0x9b23('0x21')](function(_0x38607e){_0x3894ba['count']=_0x38607e;if(_0x5836a0['query']['includeAll']){_0x11b219[_0x9b23('0x39')]=[{'all':!![]}];}return db[_0x9b23('0x27')]['findAll'](_0x11b219);})[_0x9b23('0x21')](function(_0x45a180){_0x3894ba['rows']=_0x45a180;return _0x3894ba;})['then'](respondWithFilteredResult(_0x22af72,_0x11b219))[_0x9b23('0x3a')](handleError(_0x22af72,null));};exports['show']=function(_0x268012,_0x32c47e){var _0x54e458={'raw':![],'where':{'id':_0x268012[_0x9b23('0x3b')]['id']}},_0x5accab={};_0x5accab[_0x9b23('0x2a')]=_[_0x9b23('0x2d')](db[_0x9b23('0x27')]['rawAttributes']);_0x5accab[_0x9b23('0x2c')]=_['keys'](_0x268012[_0x9b23('0x2c')]);_0x5accab[_0x9b23('0x2e')]=_[_0x9b23('0x2f')](_0x5accab['model'],_0x5accab[_0x9b23('0x2c')]);_0x54e458[_0x9b23('0x30')]=_[_0x9b23('0x2f')](_0x5accab[_0x9b23('0x2a')],qs['fields'](_0x268012['query'][_0x9b23('0x31')]));_0x54e458[_0x9b23('0x30')]=_0x54e458['attributes'][_0x9b23('0x32')]?_0x54e458['attributes']:_0x5accab['model'];if(_0x268012['query'][_0x9b23('0x3c')]){_0x54e458['include']=[{'all':!![]}];}_0x54e458=_[_0x9b23('0x3d')]({},_0x54e458,_0x268012[_0x9b23('0x38')]);return db[_0x9b23('0x27')][_0x9b23('0x3e')](_0x54e458)[_0x9b23('0x21')](handleEntityNotFound(_0x32c47e,null))['then'](respondWithResult(_0x32c47e,null))['catch'](handleError(_0x32c47e,null));};exports[_0x9b23('0x3f')]=function(_0x78c72,_0x40661c){return db[_0x9b23('0x27')]['create'](_0x78c72[_0x9b23('0x40')],{})[_0x9b23('0x21')](respondWithResult(_0x40661c,0xc9))[_0x9b23('0x3a')](handleError(_0x40661c,null));};exports[_0x9b23('0x20')]=function(_0x35addd,_0x20f99a){if(_0x35addd[_0x9b23('0x40')]['id']){delete _0x35addd[_0x9b23('0x40')]['id'];}return db[_0x9b23('0x27')][_0x9b23('0x3e')]({'where':{'id':_0x35addd[_0x9b23('0x3b')]['id']}})['then'](handleEntityNotFound(_0x20f99a,null))['then'](saveUpdates(_0x35addd['body'],null))[_0x9b23('0x21')](respondWithResult(_0x20f99a,null))[_0x9b23('0x3a')](handleError(_0x20f99a,null));};exports[_0x9b23('0x41')]=function(_0x1aa96f,_0x5d4064){return db['SalesforceConfiguration'][_0x9b23('0x3e')]({'where':{'id':_0x1aa96f[_0x9b23('0x3b')]['id']}})[_0x9b23('0x21')](handleEntityNotFound(_0x5d4064,null))[_0x9b23('0x21')](removeEntity(_0x5d4064,null))[_0x9b23('0x3a')](handleError(_0x5d4064,null));};exports[_0x9b23('0x42')]=function(_0xb2267a,_0x4c62e8,_0x4368c1){var _0x5b44da={};var _0x1ad8aa={};var _0x2841ae;var _0x574062;return db[_0x9b23('0x27')][_0x9b23('0x43')]({'where':{'id':_0xb2267a[_0x9b23('0x3b')]['id']}})[_0x9b23('0x21')](handleEntityNotFound(_0x4c62e8,null))[_0x9b23('0x21')](function(_0x26d2e9){if(_0x26d2e9){_0x2841ae=_0x26d2e9;_0x1ad8aa[_0x9b23('0x2a')]=_[_0x9b23('0x2d')](db[_0x9b23('0x44')][_0x9b23('0x45')]);_0x1ad8aa[_0x9b23('0x2c')]=_['keys'](_0xb2267a[_0x9b23('0x2c')]);_0x1ad8aa['filters']=_[_0x9b23('0x2f')](_0x1ad8aa[_0x9b23('0x2a')],_0x1ad8aa[_0x9b23('0x2c')]);_0x5b44da[_0x9b23('0x30')]=_['intersection'](_0x1ad8aa[_0x9b23('0x2a')],qs['fields'](_0xb2267a[_0x9b23('0x2c')][_0x9b23('0x31')]));_0x5b44da['attributes']=_0x5b44da[_0x9b23('0x30')]['length']?_0x5b44da[_0x9b23('0x30')]:_0x1ad8aa[_0x9b23('0x2a')];_0x5b44da[_0x9b23('0x33')]=qs['sort'](_0xb2267a[_0x9b23('0x2c')][_0x9b23('0x34')]);_0x5b44da[_0x9b23('0x35')]=qs[_0x9b23('0x2e')](_[_0x9b23('0x46')](_0xb2267a[_0x9b23('0x2c')],_0x1ad8aa[_0x9b23('0x2e')]));if(_0xb2267a[_0x9b23('0x2c')][_0x9b23('0x36')]){_0x5b44da[_0x9b23('0x35')]=_[_0x9b23('0x3d')](_0x5b44da[_0x9b23('0x35')],{'$or':_[_0x9b23('0x2b')](_0x5b44da[_0x9b23('0x30')],function(_0x370552){var _0x29279f={};_0x29279f[_0x370552]={'$like':'%'+_0xb2267a[_0x9b23('0x2c')]['filter']+'%'};return _0x29279f;})});}_0x5b44da=_[_0x9b23('0x3d')]({},_0x5b44da,_0xb2267a['options']);return _0x2841ae['getFields'](_0x5b44da);}})[_0x9b23('0x21')](function(_0x424f8e){if(_0x424f8e){_0x574062=_0x424f8e['length'];if(!_0xb2267a[_0x9b23('0x2c')][_0x9b23('0x47')](_0x9b23('0x48'))){_0x5b44da[_0x9b23('0x19')]=qs[_0x9b23('0x19')](_0xb2267a[_0x9b23('0x2c')][_0x9b23('0x19')]);_0x5b44da['offset']=qs[_0x9b23('0x1c')](_0xb2267a['query'][_0x9b23('0x1c')]);}return _0x2841ae[_0x9b23('0x42')](_0x5b44da);}})['then'](function(_0x1aaf4a){if(_0x1aaf4a){return _0x1aaf4a?{'count':_0x574062,'rows':_0x1aaf4a}:null;}})[_0x9b23('0x21')](respondWithResult(_0x4c62e8,null))[_0x9b23('0x3a')](handleError(_0x4c62e8,null));};exports[_0x9b23('0x49')]=function(_0x50c491,_0x5edf05,_0x468906){var _0x7d1950={};var _0x180c02={};var _0x2a3b2c;var _0x447701;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x50c491[_0x9b23('0x3b')]['id']}})[_0x9b23('0x21')](handleEntityNotFound(_0x5edf05,null))[_0x9b23('0x21')](function(_0x3027ef){if(_0x3027ef){_0x2a3b2c=_0x3027ef;_0x180c02['model']=_['keys'](db['SalesforceField'][_0x9b23('0x45')]);_0x180c02['query']=_[_0x9b23('0x2d')](_0x50c491['query']);_0x180c02['filters']=_['intersection'](_0x180c02[_0x9b23('0x2a')],_0x180c02[_0x9b23('0x2c')]);_0x7d1950[_0x9b23('0x30')]=_[_0x9b23('0x2f')](_0x180c02[_0x9b23('0x2a')],qs['fields'](_0x50c491[_0x9b23('0x2c')][_0x9b23('0x31')]));_0x7d1950[_0x9b23('0x30')]=_0x7d1950[_0x9b23('0x30')][_0x9b23('0x32')]?_0x7d1950[_0x9b23('0x30')]:_0x180c02[_0x9b23('0x2a')];_0x7d1950['order']=qs[_0x9b23('0x34')](_0x50c491[_0x9b23('0x2c')][_0x9b23('0x34')]);_0x7d1950[_0x9b23('0x35')]=qs[_0x9b23('0x2e')](_[_0x9b23('0x46')](_0x50c491[_0x9b23('0x2c')],_0x180c02[_0x9b23('0x2e')]));if(_0x50c491[_0x9b23('0x2c')][_0x9b23('0x36')]){_0x7d1950[_0x9b23('0x35')]=_['merge'](_0x7d1950[_0x9b23('0x35')],{'$or':_[_0x9b23('0x2b')](_0x7d1950[_0x9b23('0x30')],function(_0xd8c9bc){var _0x6eda83={};_0x6eda83[_0xd8c9bc]={'$like':'%'+_0x50c491[_0x9b23('0x2c')]['filter']+'%'};return _0x6eda83;})});}_0x7d1950=_[_0x9b23('0x3d')]({},_0x7d1950,_0x50c491[_0x9b23('0x38')]);return _0x2a3b2c[_0x9b23('0x49')](_0x7d1950);}})[_0x9b23('0x21')](function(_0x3e4287){if(_0x3e4287){_0x447701=_0x3e4287[_0x9b23('0x32')];if(!_0x50c491[_0x9b23('0x2c')]['hasOwnProperty'](_0x9b23('0x48'))){_0x7d1950[_0x9b23('0x19')]=qs[_0x9b23('0x19')](_0x50c491['query'][_0x9b23('0x19')]);_0x7d1950[_0x9b23('0x1c')]=qs[_0x9b23('0x1c')](_0x50c491[_0x9b23('0x2c')]['offset']);}return _0x2a3b2c[_0x9b23('0x49')](_0x7d1950);}})[_0x9b23('0x21')](function(_0x36ed41){if(_0x36ed41){return _0x36ed41?{'count':_0x447701,'rows':_0x36ed41}:null;}})['then'](respondWithResult(_0x5edf05,null))[_0x9b23('0x3a')](handleError(_0x5edf05,null));};exports['getDescriptions']=function(_0x374b67,_0x2f77ed,_0x191260){var _0x438505={};var _0x1f6a68={};var _0x12ef5c;var _0x54cce4;return db[_0x9b23('0x27')]['findOne']({'where':{'id':_0x374b67[_0x9b23('0x3b')]['id']}})[_0x9b23('0x21')](handleEntityNotFound(_0x2f77ed,null))[_0x9b23('0x21')](function(_0x17c35b){if(_0x17c35b){_0x12ef5c=_0x17c35b;_0x1f6a68[_0x9b23('0x2a')]=_[_0x9b23('0x2d')](db[_0x9b23('0x44')][_0x9b23('0x45')]);_0x1f6a68['query']=_[_0x9b23('0x2d')](_0x374b67[_0x9b23('0x2c')]);_0x1f6a68[_0x9b23('0x2e')]=_[_0x9b23('0x2f')](_0x1f6a68[_0x9b23('0x2a')],_0x1f6a68[_0x9b23('0x2c')]);_0x438505['attributes']=_[_0x9b23('0x2f')](_0x1f6a68[_0x9b23('0x2a')],qs[_0x9b23('0x31')](_0x374b67[_0x9b23('0x2c')][_0x9b23('0x31')]));_0x438505[_0x9b23('0x30')]=_0x438505['attributes'][_0x9b23('0x32')]?_0x438505['attributes']:_0x1f6a68[_0x9b23('0x2a')];_0x438505[_0x9b23('0x33')]=qs[_0x9b23('0x34')](_0x374b67['query'][_0x9b23('0x34')]);_0x438505[_0x9b23('0x35')]=qs[_0x9b23('0x2e')](_['pick'](_0x374b67['query'],_0x1f6a68['filters']));if(_0x374b67['query'][_0x9b23('0x36')]){_0x438505['where']=_[_0x9b23('0x3d')](_0x438505[_0x9b23('0x35')],{'$or':_['map'](_0x438505[_0x9b23('0x30')],function(_0x25fbd4){var _0x575599={};_0x575599[_0x25fbd4]={'$like':'%'+_0x374b67[_0x9b23('0x2c')][_0x9b23('0x36')]+'%'};return _0x575599;})});}_0x438505=_['merge']({},_0x438505,_0x374b67[_0x9b23('0x38')]);return _0x12ef5c[_0x9b23('0x4a')](_0x438505);}})['then'](function(_0x4daec4){if(_0x4daec4){_0x54cce4=_0x4daec4['length'];if(!_0x374b67[_0x9b23('0x2c')][_0x9b23('0x47')](_0x9b23('0x48'))){_0x438505[_0x9b23('0x19')]=qs['limit'](_0x374b67[_0x9b23('0x2c')][_0x9b23('0x19')]);_0x438505[_0x9b23('0x1c')]=qs[_0x9b23('0x1c')](_0x374b67[_0x9b23('0x2c')][_0x9b23('0x1c')]);}return _0x12ef5c[_0x9b23('0x4a')](_0x438505);}})[_0x9b23('0x21')](function(_0x28ecc4){if(_0x28ecc4){return _0x28ecc4?{'count':_0x54cce4,'rows':_0x28ecc4}:null;}})[_0x9b23('0x21')](respondWithResult(_0x2f77ed,null))[_0x9b23('0x3a')](handleError(_0x2f77ed,null));};
\ No newline at end of file
index 02bba16..c5fe4b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe49=['define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes'];(function(_0x1a6b90,_0x433411){var _0x2d55da=function(_0x4de408){while(--_0x4de408){_0x1a6b90['push'](_0x1a6b90['shift']());}};_0x2d55da(++_0x433411);}(_0xbe49,0x16b));var _0x9be4=function(_0x43446d,_0x446ec0){_0x43446d=_0x43446d-0x0;var _0x3f583d=_0xbe49[_0x43446d];return _0x3f583d;};'use strict';var _=require('lodash');var util=require(_0x9be4('0x0'));var logger=require(_0x9be4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9be4('0x2'));var rp=require(_0x9be4('0x3'));var fs=require('fs');var path=require(_0x9be4('0x4'));var rimraf=require('rimraf');var config=require(_0x9be4('0x5'));var attributes=require(_0x9be4('0x6'));module['exports']=function(_0x7ff932,_0x440b5a){return _0x7ff932[_0x9be4('0x7')](_0x9be4('0x8'),attributes,{'tableName':_0x9be4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e98=['moment','request-promise','rimraf','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api'];(function(_0x372e7c,_0x242933){var _0x11d542=function(_0x5aa22f){while(--_0x5aa22f){_0x372e7c['push'](_0x372e7c['shift']());}};_0x11d542(++_0x242933);}(_0x8e98,0x183));var _0x88e9=function(_0x5057ad,_0x498847){_0x5057ad=_0x5057ad-0x0;var _0x42a65b=_0x8e98[_0x5057ad];return _0x42a65b;};'use strict';var _=require('lodash');var util=require(_0x88e9('0x0'));var logger=require(_0x88e9('0x1'))(_0x88e9('0x2'));var moment=require(_0x88e9('0x3'));var BPromise=require('bluebird');var rp=require(_0x88e9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x88e9('0x5'));var config=require('../../config/environment');var attributes=require(_0x88e9('0x6'));module[_0x88e9('0x7')]=function(_0x4bff72,_0x4de06c){return _0x4bff72['define'](_0x88e9('0x8'),attributes,{'tableName':_0x88e9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 68d30cd..c0d52df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fcf=['client','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x366482,_0x16989e){var _0x188cf5=function(_0x3ee862){while(--_0x3ee862){_0x366482['push'](_0x366482['shift']());}};_0x188cf5(++_0x16989e);}(_0x0fcf,0x1c6));var _0xf0fc=function(_0x12d880,_0x207828){_0x12d880=_0x12d880-0x0;var _0x49ffb9=_0x0fcf[_0x12d880];return _0x49ffb9;};'use strict';var _=require('lodash');var util=require(_0xf0fc('0x0'));var moment=require(_0xf0fc('0x1'));var BPromise=require('bluebird');var rs=require(_0xf0fc('0x2'));var fs=require('fs');var Redis=require(_0xf0fc('0x3'));var db=require(_0xf0fc('0x4'))['db'];var utils=require(_0xf0fc('0x5'));var logger=require(_0xf0fc('0x6'))('rpc');var config=require(_0xf0fc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf0fc('0x8')][_0xf0fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e1e04,_0x4beceb,_0xeeff0){return new BPromise(function(_0x50ffb0,_0x580ada){return client[_0xf0fc('0xa')](_0x2e1e04,_0xeeff0)[_0xf0fc('0xb')](function(_0x1a0480){logger['info'](_0xf0fc('0xc'),_0x4beceb,_0xf0fc('0xd'));logger[_0xf0fc('0xe')](_0xf0fc('0xf'),_0x4beceb,_0xf0fc('0xd'),JSON[_0xf0fc('0x10')](_0x1a0480));if(_0x1a0480[_0xf0fc('0x11')]){if(_0x1a0480[_0xf0fc('0x11')][_0xf0fc('0x12')]===0x1f4){logger['error'](_0xf0fc('0xc'),_0x4beceb,_0x1a0480['error'][_0xf0fc('0x13')]);return _0x580ada(_0x1a0480[_0xf0fc('0x11')][_0xf0fc('0x13')]);}logger[_0xf0fc('0x11')](_0xf0fc('0xc'),_0x4beceb,_0x1a0480[_0xf0fc('0x11')][_0xf0fc('0x13')]);return _0x50ffb0(_0x1a0480[_0xf0fc('0x11')][_0xf0fc('0x13')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4beceb,_0xf0fc('0xd'));_0x50ffb0(_0x1a0480[_0xf0fc('0x14')]['message']);}})[_0xf0fc('0x15')](function(_0xd82173){logger[_0xf0fc('0x11')](_0xf0fc('0xc'),_0x4beceb,_0xd82173);_0x580ada(_0xd82173);});});}
\ No newline at end of file
+var _0xf832=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3af099,_0x322d37){var _0x6b8943=function(_0x515f92){while(--_0x515f92){_0x3af099['push'](_0x3af099['shift']());}};_0x6b8943(++_0x322d37);}(_0xf832,0x1c8));var _0x2f83=function(_0xb46ba,_0x2e2cc1){_0xb46ba=_0xb46ba-0x0;var _0x3b76a8=_0xf832[_0xb46ba];return _0x3b76a8;};'use strict';var _=require(_0x2f83('0x0'));var util=require(_0x2f83('0x1'));var moment=require(_0x2f83('0x2'));var BPromise=require(_0x2f83('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2f83('0x4'));var logger=require(_0x2f83('0x5'))(_0x2f83('0x6'));var config=require(_0x2f83('0x7'));var jayson=require(_0x2f83('0x8'));var client=jayson[_0x2f83('0x9')][_0x2f83('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x343014,_0x2c1d99,_0x28f454){return new BPromise(function(_0x88282,_0x369d5d){return client[_0x2f83('0xb')](_0x343014,_0x28f454)[_0x2f83('0xc')](function(_0x4710c9){logger[_0x2f83('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c1d99,_0x2f83('0xe'));logger[_0x2f83('0xf')](_0x2f83('0x10'),_0x2c1d99,_0x2f83('0xe'),JSON[_0x2f83('0x11')](_0x4710c9));if(_0x4710c9[_0x2f83('0x12')]){if(_0x4710c9['error']['code']===0x1f4){logger['error'](_0x2f83('0x13'),_0x2c1d99,_0x4710c9['error'][_0x2f83('0x14')]);return _0x369d5d(_0x4710c9['error'][_0x2f83('0x14')]);}logger[_0x2f83('0x12')](_0x2f83('0x13'),_0x2c1d99,_0x4710c9[_0x2f83('0x12')][_0x2f83('0x14')]);return _0x88282(_0x4710c9[_0x2f83('0x12')][_0x2f83('0x14')]);}else{logger[_0x2f83('0xd')](_0x2f83('0x13'),_0x2c1d99,_0x2f83('0xe'));_0x88282(_0x4710c9[_0x2f83('0x15')][_0x2f83('0x14')]);}})[_0x2f83('0x16')](function(_0x5d2de1){logger[_0x2f83('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2c1d99,_0x5d2de1);_0x369d5d(_0x5d2de1);});});}
\ No newline at end of file
index 41ce379..42e3ddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde9a=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','post','create','put','delete','destroy','exports','multer'];(function(_0xe22e69,_0x779b){var _0x2eb7d=function(_0x57c9ad){while(--_0x57c9ad){_0xe22e69['push'](_0xe22e69['shift']());}};_0x2eb7d(++_0x779b);}(_0xde9a,0x84));var _0xade9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xde9a[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0xade9('0x0'));var util=require(_0xade9('0x1'));var path=require(_0xade9('0x2'));var timeout=require(_0xade9('0x3'));var express=require(_0xade9('0x4'));var router=express[_0xade9('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xade9('0x6'));var config=require(_0xade9('0x7'));var controller=require(_0xade9('0x8'));router[_0xade9('0x9')]('/',auth['isAuthenticated'](),controller[_0xade9('0xa')]);router['get'](_0xade9('0xb'),auth[_0xade9('0xc')](),controller['show']);router[_0xade9('0xd')]('/',auth['isAuthenticated'](),controller[_0xade9('0xe')]);router[_0xade9('0xf')](_0xade9('0xb'),auth[_0xade9('0xc')](),controller['update']);router[_0xade9('0x10')](_0xade9('0xb'),auth[_0xade9('0xc')](),controller[_0xade9('0x11')]);module[_0xade9('0x12')]=router;
\ No newline at end of file
+var _0xcb2f=['./intSalesforceField.controller','get','/:id','isAuthenticated','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3f5ca0,_0x37df67){var _0x5cf570=function(_0x3d1b3b){while(--_0x3d1b3b){_0x3f5ca0['push'](_0x3f5ca0['shift']());}};_0x5cf570(++_0x37df67);}(_0xcb2f,0xe1));var _0xfcb2=function(_0x3d2e24,_0x185873){_0x3d2e24=_0x3d2e24-0x0;var _0x278386=_0xcb2f[_0x3d2e24];return _0x278386;};'use strict';var multer=require(_0xfcb2('0x0'));var util=require(_0xfcb2('0x1'));var path=require(_0xfcb2('0x2'));var timeout=require(_0xfcb2('0x3'));var express=require(_0xfcb2('0x4'));var router=express[_0xfcb2('0x5')]();var fs_extra=require(_0xfcb2('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfcb2('0x7'));var config=require(_0xfcb2('0x8'));var controller=require(_0xfcb2('0x9'));router[_0xfcb2('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xfcb2('0xa')](_0xfcb2('0xb'),auth[_0xfcb2('0xc')](),controller['show']);router[_0xfcb2('0xd')]('/',auth[_0xfcb2('0xc')](),controller['create']);router[_0xfcb2('0xe')](_0xfcb2('0xb'),auth['isAuthenticated'](),controller[_0xfcb2('0xf')]);router[_0xfcb2('0x10')]('/:id',auth[_0xfcb2('0xc')](),controller['destroy']);module[_0xfcb2('0x11')]=router;
\ No newline at end of file
index 3ff4cd5..da1facf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd9f=['STRING','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xfd9f,0x174));var _0xffd9=function(_0x7f045d,_0x2c81f0){_0x7f045d=_0x7f045d-0x0;var _0xf8e4cb=_0xfd9f[_0x7f045d];return _0xf8e4cb;};'use strict';var Sequelize=require('sequelize');module[_0xffd9('0x0')]={'type':{'type':Sequelize[_0xffd9('0x1')](_0xffd9('0x2'),_0xffd9('0x3'),_0xffd9('0x4'),'keyValue',_0xffd9('0x5')),'defaultValue':_0xffd9('0x2')},'content':{'type':Sequelize[_0xffd9('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xffd9('0x1')](_0xffd9('0x2'),_0xffd9('0x3'),_0xffd9('0x4'))},'keyContent':{'type':Sequelize[_0xffd9('0x6')]},'idField':{'type':Sequelize[_0xffd9('0x6')]},'variableName':{'type':Sequelize[_0xffd9('0x6')]}};
\ No newline at end of file
+var _0x6efb=['keyValue','picklist','STRING','customVariable','exports','ENUM','string','variable'];(function(_0x4be277,_0x1d5d6c){var _0x35c8d8=function(_0x5d2685){while(--_0x5d2685){_0x4be277['push'](_0x4be277['shift']());}};_0x35c8d8(++_0x1d5d6c);}(_0x6efb,0x164));var _0xb6ef=function(_0x5bd001,_0x246e43){_0x5bd001=_0x5bd001-0x0;var _0x57e05c=_0x6efb[_0x5bd001];return _0x57e05c;};'use strict';var Sequelize=require('sequelize');module[_0xb6ef('0x0')]={'type':{'type':Sequelize[_0xb6ef('0x1')](_0xb6ef('0x2'),_0xb6ef('0x3'),'customVariable',_0xb6ef('0x4'),_0xb6ef('0x5')),'defaultValue':_0xb6ef('0x2')},'content':{'type':Sequelize[_0xb6ef('0x6')]},'key':{'type':Sequelize[_0xb6ef('0x6')]},'keyType':{'type':Sequelize[_0xb6ef('0x1')](_0xb6ef('0x2'),'variable',_0xb6ef('0x7'))},'keyContent':{'type':Sequelize[_0xb6ef('0x6')]},'idField':{'type':Sequelize[_0xb6ef('0x6')]},'variableName':{'type':Sequelize[_0xb6ef('0x6')]}};
\ No newline at end of file
index bf78089..deb665a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef09=['destroy','sendStatus','error','stack','name','send','map','SalesforceField','rawAttributes','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','offset','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','keys','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','end','status','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x56542d,_0x3a30d6){var _0x122181=function(_0x3d3950){while(--_0x3d3950){_0x56542d['push'](_0x56542d['shift']());}};_0x122181(++_0x3a30d6);}(_0xef09,0xb5));var _0x9ef0=function(_0x26687a,_0xacba0){_0x26687a=_0x26687a-0x0;var _0x2ddd05=_0xef09[_0x26687a];return _0x2ddd05;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9ef0('0x0'));var zipdir=require(_0x9ef0('0x1'));var jsonpatch=require(_0x9ef0('0x2'));var rp=require(_0x9ef0('0x3'));var moment=require(_0x9ef0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9ef0('0x5'));var util=require(_0x9ef0('0x6'));var path=require(_0x9ef0('0x7'));var sox=require(_0x9ef0('0x8'));var csv=require(_0x9ef0('0x9'));var ejs=require(_0x9ef0('0xa'));var fs=require('fs');var fs_extra=require(_0x9ef0('0xb'));var _=require(_0x9ef0('0xc'));var squel=require(_0x9ef0('0xd'));var crypto=require(_0x9ef0('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9ef0('0xf'));var toCsv=require(_0x9ef0('0x9'));var querystring=require(_0x9ef0('0x10'));var Papa=require(_0x9ef0('0x11'));var Redis=require(_0x9ef0('0x12'));var authService=require(_0x9ef0('0x13'));var qs=require(_0x9ef0('0x14'));var as=require(_0x9ef0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9ef0('0x16'));var config=require(_0x9ef0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9ef0('0x18'))['db'];function respondWithStatusCode(_0xf46cdc,_0x2805a1){_0x2805a1=_0x2805a1||0xcc;return function(_0x36147b){if(_0x36147b){return _0xf46cdc['sendStatus'](_0x2805a1);}return _0xf46cdc['status'](_0x2805a1)[_0x9ef0('0x19')]();};}function respondWithResult(_0x41a5b7,_0x1be765){_0x1be765=_0x1be765||0xc8;return function(_0xa7ed9a){if(_0xa7ed9a){return _0x41a5b7[_0x9ef0('0x1a')](_0x1be765)[_0x9ef0('0x1b')](_0xa7ed9a);}};}function respondWithFilteredResult(_0x2ceee3,_0x5a74da){return function(_0x1f6694){if(_0x1f6694){var _0x227f2e=typeof _0x5a74da['offset']===_0x9ef0('0x1c')&&typeof _0x5a74da['limit']===_0x9ef0('0x1c');var _0x4198a8=_0x1f6694[_0x9ef0('0x1d')];var _0x338e4d=_0x227f2e?0x0:_0x5a74da['offset'];var _0x333fa4=_0x227f2e?_0x1f6694[_0x9ef0('0x1d')]:_0x5a74da['offset']+_0x5a74da[_0x9ef0('0x1e')];var _0x524912;if(_0x333fa4>=_0x4198a8){_0x333fa4=_0x4198a8;_0x524912=0xc8;}else{_0x524912=0xce;}_0x2ceee3[_0x9ef0('0x1a')](_0x524912);return _0x2ceee3[_0x9ef0('0x1f')](_0x9ef0('0x20'),_0x338e4d+'-'+_0x333fa4+'/'+_0x4198a8)[_0x9ef0('0x1b')](_0x1f6694);}return null;};}function patchUpdates(_0x3dda4d){return function(_0x2aef6a){try{jsonpatch[_0x9ef0('0x21')](_0x2aef6a,_0x3dda4d,!![]);}catch(_0x3bb46c){return BPromise[_0x9ef0('0x22')](_0x3bb46c);}return _0x2aef6a[_0x9ef0('0x23')]();};}function saveUpdates(_0x29f5cf,_0xb54c7c){return function(_0x22637c){if(_0x22637c){return _0x22637c[_0x9ef0('0x24')](_0x29f5cf)[_0x9ef0('0x25')](function(_0x245361){return _0x245361;});}return null;};}function removeEntity(_0x530f78,_0x1b8ffb){return function(_0x57dcab){if(_0x57dcab){return _0x57dcab[_0x9ef0('0x26')]()[_0x9ef0('0x25')](function(){_0x530f78[_0x9ef0('0x1a')](0xcc)[_0x9ef0('0x19')]();});}};}function handleEntityNotFound(_0x3897e5,_0x1d5da4){return function(_0x11244c){if(!_0x11244c){_0x3897e5[_0x9ef0('0x27')](0x194);}return _0x11244c;};}function handleError(_0x2c9f55,_0x5c63f6){_0x5c63f6=_0x5c63f6||0x1f4;return function(_0x2d7f78){logger[_0x9ef0('0x28')](_0x2d7f78[_0x9ef0('0x29')]);if(_0x2d7f78[_0x9ef0('0x2a')]){delete _0x2d7f78[_0x9ef0('0x2a')];}_0x2c9f55['status'](_0x5c63f6)[_0x9ef0('0x2b')](_0x2d7f78);};}exports['index']=function(_0x4f7363,_0x244d09){var _0x217f5f={},_0x4a7f65={},_0xdb4806={'count':0x0,'rows':[]};var _0x33fbfa=_[_0x9ef0('0x2c')](db[_0x9ef0('0x2d')][_0x9ef0('0x2e')],function(_0x46bb08){return{'name':_0x46bb08['fieldName'],'type':_0x46bb08[_0x9ef0('0x2f')][_0x9ef0('0x30')]};});_0x4a7f65['model']=_[_0x9ef0('0x2c')](_0x33fbfa,'name');_0x4a7f65['query']=_['keys'](_0x4f7363[_0x9ef0('0x31')]);_0x4a7f65['filters']=_[_0x9ef0('0x32')](_0x4a7f65[_0x9ef0('0x33')],_0x4a7f65[_0x9ef0('0x31')]);_0x217f5f[_0x9ef0('0x34')]=_[_0x9ef0('0x32')](_0x4a7f65[_0x9ef0('0x33')],qs[_0x9ef0('0x35')](_0x4f7363[_0x9ef0('0x31')]['fields']));_0x217f5f[_0x9ef0('0x34')]=_0x217f5f[_0x9ef0('0x34')][_0x9ef0('0x36')]?_0x217f5f[_0x9ef0('0x34')]:_0x4a7f65[_0x9ef0('0x33')];if(!_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x37')]('nolimit')){_0x217f5f[_0x9ef0('0x1e')]=qs[_0x9ef0('0x1e')](_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x1e')]);_0x217f5f[_0x9ef0('0x38')]=qs['offset'](_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x38')]);}_0x217f5f['order']=qs[_0x9ef0('0x39')](_0x4f7363['query'][_0x9ef0('0x39')]);_0x217f5f[_0x9ef0('0x3a')]=qs[_0x9ef0('0x3b')](_[_0x9ef0('0x3c')](_0x4f7363[_0x9ef0('0x31')],_0x4a7f65[_0x9ef0('0x3b')]),_0x33fbfa);if(_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x3d')]){_0x217f5f[_0x9ef0('0x3a')]=_[_0x9ef0('0x3e')](_0x217f5f[_0x9ef0('0x3a')],{'$or':_['map'](_0x33fbfa,function(_0x516aa1){if(_0x516aa1[_0x9ef0('0x2f')]!==_0x9ef0('0x3f')){var _0x4135ee={};_0x4135ee[_0x516aa1[_0x9ef0('0x2a')]]={'$like':'%'+_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x3d')]+'%'};return _0x4135ee;}})});}_0x217f5f=_[_0x9ef0('0x3e')]({},_0x217f5f,_0x4f7363[_0x9ef0('0x40')]);var _0x46d3b8={'where':_0x217f5f[_0x9ef0('0x3a')]};return db[_0x9ef0('0x2d')][_0x9ef0('0x1d')](_0x46d3b8)[_0x9ef0('0x25')](function(_0x12fac4){_0xdb4806[_0x9ef0('0x1d')]=_0x12fac4;if(_0x4f7363[_0x9ef0('0x31')][_0x9ef0('0x41')]){_0x217f5f['include']=[{'all':!![]}];}return db[_0x9ef0('0x2d')]['findAll'](_0x217f5f);})[_0x9ef0('0x25')](function(_0x375321){_0xdb4806['rows']=_0x375321;return _0xdb4806;})[_0x9ef0('0x25')](respondWithFilteredResult(_0x244d09,_0x217f5f))[_0x9ef0('0x42')](handleError(_0x244d09,null));};exports['show']=function(_0x1025b0,_0x45c73b){var _0x3d7b6e={'raw':!![],'where':{'id':_0x1025b0['params']['id']}},_0x33ccd1={};_0x33ccd1['model']=_[_0x9ef0('0x43')](db[_0x9ef0('0x2d')][_0x9ef0('0x2e')]);_0x33ccd1[_0x9ef0('0x31')]=_[_0x9ef0('0x43')](_0x1025b0[_0x9ef0('0x31')]);_0x33ccd1[_0x9ef0('0x3b')]=_['intersection'](_0x33ccd1['model'],_0x33ccd1['query']);_0x3d7b6e['attributes']=_[_0x9ef0('0x32')](_0x33ccd1[_0x9ef0('0x33')],qs['fields'](_0x1025b0[_0x9ef0('0x31')][_0x9ef0('0x35')]));_0x3d7b6e[_0x9ef0('0x34')]=_0x3d7b6e['attributes'][_0x9ef0('0x36')]?_0x3d7b6e[_0x9ef0('0x34')]:_0x33ccd1['model'];if(_0x1025b0[_0x9ef0('0x31')]['includeAll']){_0x3d7b6e[_0x9ef0('0x44')]=[{'all':!![]}];}_0x3d7b6e=_['merge']({},_0x3d7b6e,_0x1025b0[_0x9ef0('0x40')]);return db['SalesforceField'][_0x9ef0('0x45')](_0x3d7b6e)['then'](handleEntityNotFound(_0x45c73b,null))[_0x9ef0('0x25')](respondWithResult(_0x45c73b,null))[_0x9ef0('0x42')](handleError(_0x45c73b,null));};exports[_0x9ef0('0x46')]=function(_0x4a78ea,_0x22e2d3){return db[_0x9ef0('0x2d')]['create'](_0x4a78ea['body'],{})[_0x9ef0('0x25')](respondWithResult(_0x22e2d3,0xc9))[_0x9ef0('0x42')](handleError(_0x22e2d3,null));};exports[_0x9ef0('0x24')]=function(_0x33b649,_0x58f73b){if(_0x33b649[_0x9ef0('0x47')]['id']){delete _0x33b649[_0x9ef0('0x47')]['id'];}return db[_0x9ef0('0x2d')]['find']({'where':{'id':_0x33b649[_0x9ef0('0x48')]['id']}})[_0x9ef0('0x25')](handleEntityNotFound(_0x58f73b,null))['then'](saveUpdates(_0x33b649[_0x9ef0('0x47')],null))[_0x9ef0('0x25')](respondWithResult(_0x58f73b,null))[_0x9ef0('0x42')](handleError(_0x58f73b,null));};exports['destroy']=function(_0x3017a2,_0xe14204){return db[_0x9ef0('0x2d')]['find']({'where':{'id':_0x3017a2[_0x9ef0('0x48')]['id']}})[_0x9ef0('0x25')](handleEntityNotFound(_0xe14204,null))[_0x9ef0('0x25')](removeEntity(_0xe14204,null))['catch'](handleError(_0xe14204,null));};
\ No newline at end of file
+var _0x56f1=['end','json','undefined','count','offset','limit','status','set','apply','save','update','then','destroy','stack','name','send','index','SalesforceField','rawAttributes','fieldName','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x56f1,0x7a));var _0x156f=function(_0x3ca721,_0x12ff95){_0x3ca721=_0x3ca721-0x0;var _0x2cbea2=_0x56f1[_0x3ca721];return _0x2cbea2;};'use strict';var emlformat=require(_0x156f('0x0'));var rimraf=require(_0x156f('0x1'));var zipdir=require(_0x156f('0x2'));var jsonpatch=require(_0x156f('0x3'));var rp=require(_0x156f('0x4'));var moment=require(_0x156f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x156f('0x6'));var util=require('util');var path=require('path');var sox=require(_0x156f('0x7'));var csv=require('to-csv');var ejs=require(_0x156f('0x8'));var fs=require('fs');var fs_extra=require(_0x156f('0x9'));var _=require(_0x156f('0xa'));var squel=require(_0x156f('0xb'));var crypto=require(_0x156f('0xc'));var jsforce=require(_0x156f('0xd'));var deskjs=require(_0x156f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x156f('0xf'));var Papa=require(_0x156f('0x10'));var Redis=require(_0x156f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x156f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x156f('0x13'))(_0x156f('0x14'));var utils=require('../../config/utils');var config=require(_0x156f('0x15'));var licenseUtil=require(_0x156f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4f7f4a,_0x19d692){_0x19d692=_0x19d692||0xcc;return function(_0x33b445){if(_0x33b445){return _0x4f7f4a[_0x156f('0x17')](_0x19d692);}return _0x4f7f4a['status'](_0x19d692)[_0x156f('0x18')]();};}function respondWithResult(_0x209a47,_0x523a75){_0x523a75=_0x523a75||0xc8;return function(_0x37b716){if(_0x37b716){return _0x209a47['status'](_0x523a75)[_0x156f('0x19')](_0x37b716);}};}function respondWithFilteredResult(_0x397423,_0x266c76){return function(_0x465c65){if(_0x465c65){var _0x54a5db=typeof _0x266c76['offset']===_0x156f('0x1a')&&typeof _0x266c76['limit']==='undefined';var _0x40f2d4=_0x465c65[_0x156f('0x1b')];var _0x53c632=_0x54a5db?0x0:_0x266c76[_0x156f('0x1c')];var _0x2e711c=_0x54a5db?_0x465c65[_0x156f('0x1b')]:_0x266c76[_0x156f('0x1c')]+_0x266c76[_0x156f('0x1d')];var _0x5944aa;if(_0x2e711c>=_0x40f2d4){_0x2e711c=_0x40f2d4;_0x5944aa=0xc8;}else{_0x5944aa=0xce;}_0x397423[_0x156f('0x1e')](_0x5944aa);return _0x397423[_0x156f('0x1f')]('Content-Range',_0x53c632+'-'+_0x2e711c+'/'+_0x40f2d4)[_0x156f('0x19')](_0x465c65);}return null;};}function patchUpdates(_0x3bb0cc){return function(_0x571ba8){try{jsonpatch[_0x156f('0x20')](_0x571ba8,_0x3bb0cc,!![]);}catch(_0x5e7b90){return BPromise['reject'](_0x5e7b90);}return _0x571ba8[_0x156f('0x21')]();};}function saveUpdates(_0xad568f,_0x466cad){return function(_0xe9a2ed){if(_0xe9a2ed){return _0xe9a2ed[_0x156f('0x22')](_0xad568f)[_0x156f('0x23')](function(_0xbd3a67){return _0xbd3a67;});}return null;};}function removeEntity(_0x1a52d2,_0x136a0e){return function(_0x34d3e0){if(_0x34d3e0){return _0x34d3e0[_0x156f('0x24')]()[_0x156f('0x23')](function(){_0x1a52d2[_0x156f('0x1e')](0xcc)[_0x156f('0x18')]();});}};}function handleEntityNotFound(_0x5a6242,_0x15c753){return function(_0x5dd04f){if(!_0x5dd04f){_0x5a6242[_0x156f('0x17')](0x194);}return _0x5dd04f;};}function handleError(_0x45ed81,_0x4c01e9){_0x4c01e9=_0x4c01e9||0x1f4;return function(_0x5263d){logger['error'](_0x5263d[_0x156f('0x25')]);if(_0x5263d[_0x156f('0x26')]){delete _0x5263d['name'];}_0x45ed81[_0x156f('0x1e')](_0x4c01e9)[_0x156f('0x27')](_0x5263d);};}exports[_0x156f('0x28')]=function(_0x58177e,_0x4af089){var _0x2fbe59={},_0xad895a={},_0xc15d14={'count':0x0,'rows':[]};var _0x250b8b=_['map'](db[_0x156f('0x29')][_0x156f('0x2a')],function(_0x20a7a6){return{'name':_0x20a7a6[_0x156f('0x2b')],'type':_0x20a7a6['type']['key']};});_0xad895a[_0x156f('0x2c')]=_[_0x156f('0x2d')](_0x250b8b,_0x156f('0x26'));_0xad895a[_0x156f('0x2e')]=_[_0x156f('0x2f')](_0x58177e[_0x156f('0x2e')]);_0xad895a[_0x156f('0x30')]=_[_0x156f('0x31')](_0xad895a[_0x156f('0x2c')],_0xad895a[_0x156f('0x2e')]);_0x2fbe59['attributes']=_[_0x156f('0x31')](_0xad895a['model'],qs[_0x156f('0x32')](_0x58177e[_0x156f('0x2e')][_0x156f('0x32')]));_0x2fbe59[_0x156f('0x33')]=_0x2fbe59[_0x156f('0x33')]['length']?_0x2fbe59['attributes']:_0xad895a['model'];if(!_0x58177e[_0x156f('0x2e')][_0x156f('0x34')](_0x156f('0x35'))){_0x2fbe59[_0x156f('0x1d')]=qs[_0x156f('0x1d')](_0x58177e[_0x156f('0x2e')][_0x156f('0x1d')]);_0x2fbe59['offset']=qs[_0x156f('0x1c')](_0x58177e[_0x156f('0x2e')]['offset']);}_0x2fbe59[_0x156f('0x36')]=qs[_0x156f('0x37')](_0x58177e['query'][_0x156f('0x37')]);_0x2fbe59['where']=qs[_0x156f('0x30')](_['pick'](_0x58177e[_0x156f('0x2e')],_0xad895a[_0x156f('0x30')]),_0x250b8b);if(_0x58177e[_0x156f('0x2e')]['filter']){_0x2fbe59[_0x156f('0x38')]=_[_0x156f('0x39')](_0x2fbe59[_0x156f('0x38')],{'$or':_[_0x156f('0x2d')](_0x250b8b,function(_0x5d4357){if(_0x5d4357[_0x156f('0x3a')]!==_0x156f('0x3b')){var _0x52a918={};_0x52a918[_0x5d4357[_0x156f('0x26')]]={'$like':'%'+_0x58177e['query'][_0x156f('0x3c')]+'%'};return _0x52a918;}})});}_0x2fbe59=_['merge']({},_0x2fbe59,_0x58177e[_0x156f('0x3d')]);var _0x227884={'where':_0x2fbe59['where']};return db[_0x156f('0x29')]['count'](_0x227884)[_0x156f('0x23')](function(_0x3382bb){_0xc15d14[_0x156f('0x1b')]=_0x3382bb;if(_0x58177e['query'][_0x156f('0x3e')]){_0x2fbe59['include']=[{'all':!![]}];}return db[_0x156f('0x29')][_0x156f('0x3f')](_0x2fbe59);})[_0x156f('0x23')](function(_0x294fd7){_0xc15d14[_0x156f('0x40')]=_0x294fd7;return _0xc15d14;})[_0x156f('0x23')](respondWithFilteredResult(_0x4af089,_0x2fbe59))[_0x156f('0x41')](handleError(_0x4af089,null));};exports[_0x156f('0x42')]=function(_0x5f08a7,_0x337c74){var _0x7fc233={'raw':!![],'where':{'id':_0x5f08a7[_0x156f('0x43')]['id']}},_0x367b7d={};_0x367b7d[_0x156f('0x2c')]=_[_0x156f('0x2f')](db['SalesforceField'][_0x156f('0x2a')]);_0x367b7d[_0x156f('0x2e')]=_[_0x156f('0x2f')](_0x5f08a7[_0x156f('0x2e')]);_0x367b7d['filters']=_[_0x156f('0x31')](_0x367b7d[_0x156f('0x2c')],_0x367b7d[_0x156f('0x2e')]);_0x7fc233[_0x156f('0x33')]=_[_0x156f('0x31')](_0x367b7d[_0x156f('0x2c')],qs[_0x156f('0x32')](_0x5f08a7[_0x156f('0x2e')][_0x156f('0x32')]));_0x7fc233[_0x156f('0x33')]=_0x7fc233['attributes'][_0x156f('0x44')]?_0x7fc233[_0x156f('0x33')]:_0x367b7d['model'];if(_0x5f08a7['query']['includeAll']){_0x7fc233[_0x156f('0x45')]=[{'all':!![]}];}_0x7fc233=_[_0x156f('0x39')]({},_0x7fc233,_0x5f08a7[_0x156f('0x3d')]);return db[_0x156f('0x29')][_0x156f('0x46')](_0x7fc233)[_0x156f('0x23')](handleEntityNotFound(_0x337c74,null))[_0x156f('0x23')](respondWithResult(_0x337c74,null))['catch'](handleError(_0x337c74,null));};exports[_0x156f('0x47')]=function(_0x1c89b5,_0x516c7c){return db[_0x156f('0x29')][_0x156f('0x47')](_0x1c89b5[_0x156f('0x48')],{})['then'](respondWithResult(_0x516c7c,0xc9))[_0x156f('0x41')](handleError(_0x516c7c,null));};exports['update']=function(_0xc2cee0,_0x11e107){if(_0xc2cee0['body']['id']){delete _0xc2cee0[_0x156f('0x48')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0xc2cee0['params']['id']}})['then'](handleEntityNotFound(_0x11e107,null))[_0x156f('0x23')](saveUpdates(_0xc2cee0[_0x156f('0x48')],null))[_0x156f('0x23')](respondWithResult(_0x11e107,null))[_0x156f('0x41')](handleError(_0x11e107,null));};exports[_0x156f('0x24')]=function(_0x39477b,_0x1ec0e1){return db[_0x156f('0x29')]['find']({'where':{'id':_0x39477b[_0x156f('0x43')]['id']}})[_0x156f('0x23')](handleEntityNotFound(_0x1ec0e1,null))[_0x156f('0x23')](removeEntity(_0x1ec0e1,null))['catch'](handleError(_0x1ec0e1,null));};
\ No newline at end of file
index 6238abe..dc79b34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc528=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports'];(function(_0x4d7dfe,_0x4722c9){var _0x5cf94e=function(_0x172354){while(--_0x172354){_0x4d7dfe['push'](_0x4d7dfe['shift']());}};_0x5cf94e(++_0x4722c9);}(_0xc528,0x176));var _0x8c52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc528[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x8c52('0x0'));var util=require(_0x8c52('0x1'));var logger=require('../../config/logger')(_0x8c52('0x2'));var moment=require(_0x8c52('0x3'));var BPromise=require(_0x8c52('0x4'));var rp=require(_0x8c52('0x5'));var fs=require('fs');var path=require(_0x8c52('0x6'));var rimraf=require(_0x8c52('0x7'));var config=require('../../config/environment');var attributes=require(_0x8c52('0x8'));module[_0x8c52('0x9')]=function(_0x4b9146,_0x2377a9){return _0x4b9146[_0x8c52('0xa')](_0x8c52('0xb'),attributes,{'tableName':_0x8c52('0xc'),'paranoid':![],'indexes':[{'name':_0x8c52('0xd'),'fields':[_0x8c52('0xe'),_0x8c52('0xf')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7806=['rimraf','./intSalesforceField.attributes','SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','lodash','util','../../config/logger','api','path'];(function(_0x30c393,_0x223021){var _0x4e703=function(_0x5a350c){while(--_0x5a350c){_0x30c393['push'](_0x30c393['shift']());}};_0x4e703(++_0x223021);}(_0x7806,0x1a8));var _0x6780=function(_0x3e910e,_0x2ef178){_0x3e910e=_0x3e910e-0x0;var _0x17dbcb=_0x7806[_0x3e910e];return _0x17dbcb;};'use strict';var _=require(_0x6780('0x0'));var util=require(_0x6780('0x1'));var logger=require(_0x6780('0x2'))(_0x6780('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6780('0x4'));var rimraf=require(_0x6780('0x5'));var config=require('../../config/environment');var attributes=require(_0x6780('0x6'));module['exports']=function(_0x341a26,_0x8857f8){return _0x341a26['define'](_0x6780('0x7'),attributes,{'tableName':_0x6780('0x8'),'paranoid':![],'indexes':[{'name':_0x6780('0x9'),'fields':['idField',_0x6780('0xa')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4ec1e94..2e7f153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31a9=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x22d9af,_0x4af8d8){var _0x5ad792=function(_0x5adf49){while(--_0x5adf49){_0x22d9af['push'](_0x22d9af['shift']());}};_0x5ad792(++_0x4af8d8);}(_0x31a9,0x1b3));var _0x931a=function(_0x35cfc7,_0x4452c4){_0x35cfc7=_0x35cfc7-0x0;var _0x163381=_0x31a9[_0x35cfc7];return _0x163381;};'use strict';var _=require(_0x931a('0x0'));var util=require('util');var moment=require(_0x931a('0x1'));var BPromise=require(_0x931a('0x2'));var rs=require(_0x931a('0x3'));var fs=require('fs');var Redis=require(_0x931a('0x4'));var db=require(_0x931a('0x5'))['db'];var utils=require(_0x931a('0x6'));var logger=require(_0x931a('0x7'))(_0x931a('0x8'));var config=require(_0x931a('0x9'));var jayson=require(_0x931a('0xa'));var client=jayson[_0x931a('0xb')][_0x931a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x182ab1,_0x396d45,_0xf77e5e){return new BPromise(function(_0x8a6170,_0x50473f){return client[_0x931a('0xd')](_0x182ab1,_0xf77e5e)[_0x931a('0xe')](function(_0x13e07f){logger['info'](_0x931a('0xf'),_0x396d45,_0x931a('0x10'));logger[_0x931a('0x11')](_0x931a('0x12'),_0x396d45,'request\x20sent',JSON[_0x931a('0x13')](_0x13e07f));if(_0x13e07f['error']){if(_0x13e07f[_0x931a('0x14')][_0x931a('0x15')]===0x1f4){logger[_0x931a('0x14')](_0x931a('0xf'),_0x396d45,_0x13e07f['error'][_0x931a('0x16')]);return _0x50473f(_0x13e07f['error']['message']);}logger['error'](_0x931a('0xf'),_0x396d45,_0x13e07f[_0x931a('0x14')][_0x931a('0x16')]);return _0x8a6170(_0x13e07f[_0x931a('0x14')][_0x931a('0x16')]);}else{logger['info'](_0x931a('0xf'),_0x396d45,_0x931a('0x10'));_0x8a6170(_0x13e07f[_0x931a('0x17')]['message']);}})['catch'](function(_0x1484d7){logger[_0x931a('0x14')]('SalesforceField,\x20%s,\x20%s',_0x396d45,_0x1484d7);_0x50473f(_0x1484d7);});});}
\ No newline at end of file
+var _0xd742=['message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s'];(function(_0x43dc6e,_0x2fd022){var _0xf90de=function(_0xb9ed9f){while(--_0xb9ed9f){_0x43dc6e['push'](_0x43dc6e['shift']());}};_0xf90de(++_0x2fd022);}(_0xd742,0x1b8));var _0x2d74=function(_0x402567,_0x17b634){_0x402567=_0x402567-0x0;var _0x5e0aac=_0xd742[_0x402567];return _0x5e0aac;};'use strict';var _=require('lodash');var util=require(_0x2d74('0x0'));var moment=require(_0x2d74('0x1'));var BPromise=require(_0x2d74('0x2'));var rs=require(_0x2d74('0x3'));var fs=require('fs');var Redis=require(_0x2d74('0x4'));var db=require(_0x2d74('0x5'))['db'];var utils=require(_0x2d74('0x6'));var logger=require(_0x2d74('0x7'))(_0x2d74('0x8'));var config=require(_0x2d74('0x9'));var jayson=require(_0x2d74('0xa'));var client=jayson[_0x2d74('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x573174,_0x563e3a,_0x4f6c75){return new BPromise(function(_0x1e1c9c,_0x4cf84f){return client['request'](_0x573174,_0x4f6c75)[_0x2d74('0xc')](function(_0x1be387){logger[_0x2d74('0xd')]('SalesforceField,\x20%s,\x20%s',_0x563e3a,_0x2d74('0xe'));logger[_0x2d74('0xf')](_0x2d74('0x10'),_0x563e3a,_0x2d74('0xe'),JSON['stringify'](_0x1be387));if(_0x1be387[_0x2d74('0x11')]){if(_0x1be387['error'][_0x2d74('0x12')]===0x1f4){logger['error'](_0x2d74('0x13'),_0x563e3a,_0x1be387[_0x2d74('0x11')][_0x2d74('0x14')]);return _0x4cf84f(_0x1be387[_0x2d74('0x11')][_0x2d74('0x14')]);}logger[_0x2d74('0x11')](_0x2d74('0x13'),_0x563e3a,_0x1be387[_0x2d74('0x11')][_0x2d74('0x14')]);return _0x1e1c9c(_0x1be387[_0x2d74('0x11')][_0x2d74('0x14')]);}else{logger[_0x2d74('0xd')](_0x2d74('0x13'),_0x563e3a,_0x2d74('0xe'));_0x1e1c9c(_0x1be387[_0x2d74('0x15')]['message']);}})[_0x2d74('0x16')](function(_0x4a0fdf){logger['error'](_0x2d74('0x13'),_0x563e3a,_0x4a0fdf);_0x4cf84f(_0x4a0fdf);});});}
\ No newline at end of file
index ff8df33..0d49e8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e5b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','post','create','/:id','update','destroy','multer','connect-timeout','express','Router','fs-extra'];(function(_0x11cc54,_0x2b01b8){var _0x7f093c=function(_0x5dc337){while(--_0x5dc337){_0x11cc54['push'](_0x11cc54['shift']());}};_0x7f093c(++_0x2b01b8);}(_0x5e5b,0x113));var _0xb5e5=function(_0x2e192f,_0x6349d7){_0x2e192f=_0x2e192f-0x0;var _0x467d41=_0x5e5b[_0x2e192f];return _0x467d41;};'use strict';var multer=require(_0xb5e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb5e5('0x1'));var express=require(_0xb5e5('0x2'));var router=express[_0xb5e5('0x3')]();var fs_extra=require(_0xb5e5('0x4'));var auth=require(_0xb5e5('0x5'));var interaction=require(_0xb5e5('0x6'));var config=require(_0xb5e5('0x7'));var controller=require(_0xb5e5('0x8'));router[_0xb5e5('0x9')]('/',auth[_0xb5e5('0xa')](),controller[_0xb5e5('0xb')]);router[_0xb5e5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb5e5('0xc')]);router[_0xb5e5('0x9')](_0xb5e5('0xd'),auth[_0xb5e5('0xa')](),controller['getConfigurations']);router[_0xb5e5('0x9')](_0xb5e5('0xe'),auth['isAuthenticated'](),controller['getFields']);router[_0xb5e5('0xf')]('/',auth[_0xb5e5('0xa')](),controller[_0xb5e5('0x10')]);router[_0xb5e5('0xf')](_0xb5e5('0xd'),auth[_0xb5e5('0xa')](),controller['addConfiguration']);router['put'](_0xb5e5('0x11'),auth[_0xb5e5('0xa')](),controller[_0xb5e5('0x12')]);router['delete'](_0xb5e5('0x11'),auth[_0xb5e5('0xa')](),controller[_0xb5e5('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa74d=['fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0xbbfe59,_0x46067f){var _0x28a2a4=function(_0xfe230){while(--_0xfe230){_0xbbfe59['push'](_0xbbfe59['shift']());}};_0x28a2a4(++_0x46067f);}(_0xa74d,0x1cf));var _0xda74=function(_0x54f98f,_0x48913d){_0x54f98f=_0x54f98f-0x0;var _0x405c24=_0xa74d[_0x54f98f];return _0x405c24;};'use strict';var multer=require('multer');var util=require(_0xda74('0x0'));var path=require(_0xda74('0x1'));var timeout=require(_0xda74('0x2'));var express=require(_0xda74('0x3'));var router=express[_0xda74('0x4')]();var fs_extra=require(_0xda74('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xda74('0x6'));var config=require(_0xda74('0x7'));var controller=require(_0xda74('0x8'));router[_0xda74('0x9')]('/',auth[_0xda74('0xa')](),controller[_0xda74('0xb')]);router[_0xda74('0x9')](_0xda74('0xc'),auth['isAuthenticated'](),controller[_0xda74('0xd')]);router['get']('/:id/configurations',auth[_0xda74('0xa')](),controller[_0xda74('0xe')]);router['get'](_0xda74('0xf'),auth[_0xda74('0xa')](),controller[_0xda74('0x10')]);router[_0xda74('0x11')]('/',auth[_0xda74('0xa')](),controller[_0xda74('0x12')]);router[_0xda74('0x11')](_0xda74('0x13'),auth['isAuthenticated'](),controller[_0xda74('0x14')]);router[_0xda74('0x15')](_0xda74('0xc'),auth['isAuthenticated'](),controller[_0xda74('0x16')]);router[_0xda74('0x17')](_0xda74('0xc'),auth[_0xda74('0xa')](),controller[_0xda74('0x18')]);module[_0xda74('0x19')]=router;
\ No newline at end of file
index 63c1ae0..2c013ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x085c=['remoteUri','STRING','username'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x085c,0x9a));var _0xc085=function(_0x34217a,_0x1f545a){_0x34217a=_0x34217a-0x0;var _0x23c2be=_0x085c[_0x34217a];return _0x23c2be;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc085('0x0')]},'description':{'type':Sequelize[_0xc085('0x0')]},'username':{'type':Sequelize[_0xc085('0x0')],'unique':_0xc085('0x1')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc085('0x0')],'unique':_0xc085('0x2')},'serverUrl':{'type':Sequelize[_0xc085('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x4b73=['sequelize','STRING','remoteUri'];(function(_0x4743d4,_0x431c7a){var _0x429a63=function(_0x1997ab){while(--_0x1997ab){_0x4743d4['push'](_0x4743d4['shift']());}};_0x429a63(++_0x431c7a);}(_0x4b73,0x1dd));var _0x34b7=function(_0x3da9b1,_0x7db7b8){_0x3da9b1=_0x3da9b1-0x0;var _0x4c7061=_0x4b73[_0x3da9b1];return _0x4c7061;};'use strict';var Sequelize=require(_0x34b7('0x0'));module['exports']={'name':{'type':Sequelize[_0x34b7('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x34b7('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x34b7('0x1')],'unique':_0x34b7('0x2')},'serverUrl':{'type':Sequelize[_0x34b7('0x1')],'allowNull':![]}};
\ No newline at end of file
index f808d2a..58273ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cad=['findOne','ServicenowConfiguration','order','Subjects','getSubjects','Descriptions','channel','ServicenowField','getFields','made_sla','knowledge','subcategory','severity','parent','caused_by','child_incidents','hold_reason','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','delivery_plan','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','delivery_task','work_start','assignment_group','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','incident_state','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','correlation_id','location','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','username','GET','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','Wrong\x20credentials','boolean','True','true','False','false','inactive','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','error','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','rows','catch','show','params','length','merge','find','create','body','getConfigurations'];(function(_0x246a47,_0x5f3355){var _0x1fbc6f=function(_0x2ed278){while(--_0x2ed278){_0x246a47['push'](_0x246a47['shift']());}};_0x1fbc6f(++_0x5f3355);}(_0x6cad,0x1de));var _0xd6ca=function(_0x19fa18,_0x2ceeb8){_0x19fa18=_0x19fa18-0x0;var _0x234fb3=_0x6cad[_0x19fa18];return _0x234fb3;};'use strict';var emlformat=require(_0xd6ca('0x0'));var rimraf=require(_0xd6ca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd6ca('0x2'));var rp=require(_0xd6ca('0x3'));var moment=require(_0xd6ca('0x4'));var BPromise=require(_0xd6ca('0x5'));var Mustache=require(_0xd6ca('0x6'));var util=require(_0xd6ca('0x7'));var path=require(_0xd6ca('0x8'));var sox=require('sox');var csv=require(_0xd6ca('0x9'));var ejs=require(_0xd6ca('0xa'));var fs=require('fs');var fs_extra=require(_0xd6ca('0xb'));var _=require(_0xd6ca('0xc'));var squel=require(_0xd6ca('0xd'));var crypto=require(_0xd6ca('0xe'));var jsforce=require(_0xd6ca('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6ca('0x10'));var Papa=require(_0xd6ca('0x11'));var Redis=require(_0xd6ca('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xd6ca('0x13'));var as=require(_0xd6ca('0x14'));var hardwareService=require(_0xd6ca('0x15'));var logger=require(_0xd6ca('0x16'))(_0xd6ca('0x17'));var utils=require(_0xd6ca('0x18'));var config=require(_0xd6ca('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd6ca('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xea9669,_0x315616){_0x315616=_0x315616||0xcc;return function(_0x4059b8){if(_0x4059b8){return _0xea9669['sendStatus'](_0x315616);}return _0xea9669[_0xd6ca('0x1b')](_0x315616)['end']();};}function respondWithResult(_0x1b7b2f,_0x16f40e){_0x16f40e=_0x16f40e||0xc8;return function(_0x1af113){if(_0x1af113){return _0x1b7b2f[_0xd6ca('0x1b')](_0x16f40e)[_0xd6ca('0x1c')](_0x1af113);}};}function respondWithFilteredResult(_0x4fdfdc,_0x214415){return function(_0x1203ed){if(_0x1203ed){var _0x2edbf7=typeof _0x214415[_0xd6ca('0x1d')]===_0xd6ca('0x1e')&&typeof _0x214415[_0xd6ca('0x1f')]==='undefined';var _0x5427d8=_0x1203ed[_0xd6ca('0x20')];var _0x728d22=_0x2edbf7?0x0:_0x214415[_0xd6ca('0x1d')];var _0x21adad=_0x2edbf7?_0x1203ed[_0xd6ca('0x20')]:_0x214415[_0xd6ca('0x1d')]+_0x214415[_0xd6ca('0x1f')];var _0x529e55;if(_0x21adad>=_0x5427d8){_0x21adad=_0x5427d8;_0x529e55=0xc8;}else{_0x529e55=0xce;}_0x4fdfdc[_0xd6ca('0x1b')](_0x529e55);return _0x4fdfdc[_0xd6ca('0x21')](_0xd6ca('0x22'),_0x728d22+'-'+_0x21adad+'/'+_0x5427d8)[_0xd6ca('0x1c')](_0x1203ed);}return null;};}function patchUpdates(_0x3895bf){return function(_0x5589ce){try{jsonpatch[_0xd6ca('0x23')](_0x5589ce,_0x3895bf,!![]);}catch(_0x5401b9){return BPromise[_0xd6ca('0x24')](_0x5401b9);}return _0x5589ce[_0xd6ca('0x25')]();};}function saveUpdates(_0x8403fa,_0x1a63d2){return function(_0x19458c){if(_0x19458c){return _0x19458c[_0xd6ca('0x26')](_0x8403fa)['then'](function(_0x9d15a9){return _0x9d15a9;});}return null;};}function removeEntity(_0x48bec5,_0x1e540d){return function(_0x172f5c){if(_0x172f5c){return _0x172f5c[_0xd6ca('0x27')]()['then'](function(){_0x48bec5['status'](0xcc)[_0xd6ca('0x28')]();});}};}function handleEntityNotFound(_0x1fbc15,_0x2facc0){return function(_0x11ca62){if(!_0x11ca62){_0x1fbc15[_0xd6ca('0x29')](0x194);}return _0x11ca62;};}function handleError(_0x3c9daf,_0x10ca1e){_0x10ca1e=_0x10ca1e||0x1f4;return function(_0x80c9d2){logger[_0xd6ca('0x2a')](_0x80c9d2[_0xd6ca('0x2b')]);if(_0x80c9d2[_0xd6ca('0x2c')]){delete _0x80c9d2[_0xd6ca('0x2c')];}_0x3c9daf[_0xd6ca('0x1b')](_0x10ca1e)[_0xd6ca('0x2d')](_0x80c9d2);};}exports['index']=function(_0x1ccbcf,_0x40cf46){var _0x39cf2e={},_0x43c0b1={},_0x5e1f49={'count':0x0,'rows':[]};var _0x34218c=_[_0xd6ca('0x2e')](db[_0xd6ca('0x2f')][_0xd6ca('0x30')],function(_0x1c6c2f){return{'name':_0x1c6c2f[_0xd6ca('0x31')],'type':_0x1c6c2f[_0xd6ca('0x32')][_0xd6ca('0x33')]};});_0x43c0b1[_0xd6ca('0x34')]=_['map'](_0x34218c,_0xd6ca('0x2c'));_0x43c0b1['query']=_[_0xd6ca('0x35')](_0x1ccbcf[_0xd6ca('0x36')]);_0x43c0b1[_0xd6ca('0x37')]=_[_0xd6ca('0x38')](_0x43c0b1[_0xd6ca('0x34')],_0x43c0b1[_0xd6ca('0x36')]);_0x39cf2e[_0xd6ca('0x39')]=_[_0xd6ca('0x38')](_0x43c0b1[_0xd6ca('0x34')],qs['fields'](_0x1ccbcf[_0xd6ca('0x36')][_0xd6ca('0x3a')]));_0x39cf2e['attributes']=_0x39cf2e['attributes']['length']?_0x39cf2e[_0xd6ca('0x39')]:_0x43c0b1[_0xd6ca('0x34')];if(!_0x1ccbcf['query'][_0xd6ca('0x3b')](_0xd6ca('0x3c'))){_0x39cf2e[_0xd6ca('0x1f')]=qs[_0xd6ca('0x1f')](_0x1ccbcf[_0xd6ca('0x36')]['limit']);_0x39cf2e[_0xd6ca('0x1d')]=qs['offset'](_0x1ccbcf['query']['offset']);}_0x39cf2e['order']=qs['sort'](_0x1ccbcf[_0xd6ca('0x36')][_0xd6ca('0x3d')]);_0x39cf2e[_0xd6ca('0x3e')]=qs[_0xd6ca('0x37')](_[_0xd6ca('0x3f')](_0x1ccbcf['query'],_0x43c0b1[_0xd6ca('0x37')]),_0x34218c);if(_0x1ccbcf[_0xd6ca('0x36')][_0xd6ca('0x40')]){_0x39cf2e[_0xd6ca('0x3e')]=_['merge'](_0x39cf2e[_0xd6ca('0x3e')],{'$or':_['map'](_0x34218c,function(_0x37f50d){if(_0x37f50d[_0xd6ca('0x32')]!==_0xd6ca('0x41')){var _0x276d58={};_0x276d58[_0x37f50d[_0xd6ca('0x2c')]]={'$like':'%'+_0x1ccbcf[_0xd6ca('0x36')][_0xd6ca('0x40')]+'%'};return _0x276d58;}})});}_0x39cf2e=_['merge']({},_0x39cf2e,_0x1ccbcf[_0xd6ca('0x42')]);var _0x406cfb={'where':_0x39cf2e[_0xd6ca('0x3e')]};return db[_0xd6ca('0x2f')][_0xd6ca('0x20')](_0x406cfb)[_0xd6ca('0x43')](function(_0x5205c3){_0x5e1f49['count']=_0x5205c3;if(_0x1ccbcf['query'][_0xd6ca('0x44')]){_0x39cf2e[_0xd6ca('0x45')]=[{'all':!![]}];}return db[_0xd6ca('0x2f')]['findAll'](_0x39cf2e);})[_0xd6ca('0x43')](function(_0x2c2576){_0x5e1f49[_0xd6ca('0x46')]=_0x2c2576;return _0x5e1f49;})[_0xd6ca('0x43')](respondWithFilteredResult(_0x40cf46,_0x39cf2e))[_0xd6ca('0x47')](handleError(_0x40cf46,null));};exports[_0xd6ca('0x48')]=function(_0x370e29,_0xd472a2){var _0x2016e4={'raw':![],'where':{'id':_0x370e29[_0xd6ca('0x49')]['id']}},_0x329041={};_0x329041[_0xd6ca('0x34')]=_[_0xd6ca('0x35')](db[_0xd6ca('0x2f')]['rawAttributes']);_0x329041[_0xd6ca('0x36')]=_[_0xd6ca('0x35')](_0x370e29[_0xd6ca('0x36')]);_0x329041[_0xd6ca('0x37')]=_[_0xd6ca('0x38')](_0x329041[_0xd6ca('0x34')],_0x329041[_0xd6ca('0x36')]);_0x2016e4[_0xd6ca('0x39')]=_[_0xd6ca('0x38')](_0x329041[_0xd6ca('0x34')],qs[_0xd6ca('0x3a')](_0x370e29['query']['fields']));_0x2016e4[_0xd6ca('0x39')]=_0x2016e4[_0xd6ca('0x39')][_0xd6ca('0x4a')]?_0x2016e4[_0xd6ca('0x39')]:_0x329041[_0xd6ca('0x34')];if(_0x370e29[_0xd6ca('0x36')]['includeAll']){_0x2016e4[_0xd6ca('0x45')]=[{'all':!![]}];}_0x2016e4=_[_0xd6ca('0x4b')]({},_0x2016e4,_0x370e29['options']);return db[_0xd6ca('0x2f')][_0xd6ca('0x4c')](_0x2016e4)[_0xd6ca('0x43')](handleEntityNotFound(_0xd472a2,null))['then'](respondWithResult(_0xd472a2,null))[_0xd6ca('0x47')](handleError(_0xd472a2,null));};exports[_0xd6ca('0x4d')]=function(_0x1738ba,_0x83bfb2){return db[_0xd6ca('0x2f')][_0xd6ca('0x4d')](_0x1738ba[_0xd6ca('0x4e')],{})['then'](respondWithResult(_0x83bfb2,0xc9))[_0xd6ca('0x47')](handleError(_0x83bfb2,null));};exports['update']=function(_0x278016,_0x5e7042){if(_0x278016[_0xd6ca('0x4e')]['id']){delete _0x278016[_0xd6ca('0x4e')]['id'];}return db[_0xd6ca('0x2f')][_0xd6ca('0x4c')]({'where':{'id':_0x278016[_0xd6ca('0x49')]['id']}})[_0xd6ca('0x43')](handleEntityNotFound(_0x5e7042,null))[_0xd6ca('0x43')](saveUpdates(_0x278016[_0xd6ca('0x4e')],null))[_0xd6ca('0x43')](respondWithResult(_0x5e7042,null))[_0xd6ca('0x47')](handleError(_0x5e7042,null));};exports[_0xd6ca('0x27')]=function(_0x3afe89,_0x2f76e1){return db['ServicenowAccount'][_0xd6ca('0x4c')]({'where':{'id':_0x3afe89['params']['id']}})['then'](handleEntityNotFound(_0x2f76e1,null))[_0xd6ca('0x43')](removeEntity(_0x2f76e1,null))[_0xd6ca('0x47')](handleError(_0x2f76e1,null));};exports[_0xd6ca('0x4f')]=function(_0x2c981d,_0x280878,_0x2f2d73){var _0x5ea32a={};var _0x4a3e63={};var _0xb3789d;var _0x19505a;return db[_0xd6ca('0x2f')][_0xd6ca('0x50')]({'where':{'id':_0x2c981d[_0xd6ca('0x49')]['id']}})[_0xd6ca('0x43')](handleEntityNotFound(_0x280878,null))['then'](function(_0x9a724d){if(_0x9a724d){_0xb3789d=_0x9a724d;_0x4a3e63[_0xd6ca('0x34')]=_[_0xd6ca('0x35')](db[_0xd6ca('0x51')]['rawAttributes']);_0x4a3e63['query']=_[_0xd6ca('0x35')](_0x2c981d[_0xd6ca('0x36')]);_0x4a3e63[_0xd6ca('0x37')]=_['intersection'](_0x4a3e63['model'],_0x4a3e63[_0xd6ca('0x36')]);_0x5ea32a[_0xd6ca('0x39')]=_[_0xd6ca('0x38')](_0x4a3e63[_0xd6ca('0x34')],qs['fields'](_0x2c981d[_0xd6ca('0x36')][_0xd6ca('0x3a')]));_0x5ea32a[_0xd6ca('0x39')]=_0x5ea32a['attributes']['length']?_0x5ea32a[_0xd6ca('0x39')]:_0x4a3e63['model'];_0x5ea32a[_0xd6ca('0x52')]=qs[_0xd6ca('0x3d')](_0x2c981d[_0xd6ca('0x36')][_0xd6ca('0x3d')]);_0x5ea32a[_0xd6ca('0x3e')]=qs[_0xd6ca('0x37')](_[_0xd6ca('0x3f')](_0x2c981d[_0xd6ca('0x36')],_0x4a3e63['filters']));if(_0x2c981d['query'][_0xd6ca('0x40')]){_0x5ea32a[_0xd6ca('0x3e')]=_[_0xd6ca('0x4b')](_0x5ea32a[_0xd6ca('0x3e')],{'$or':_[_0xd6ca('0x2e')](_0x5ea32a['attributes'],function(_0x317752){var _0x597fab={};_0x597fab[_0x317752]={'$like':'%'+_0x2c981d['query']['filter']+'%'};return _0x597fab;})});}_0x5ea32a=_[_0xd6ca('0x4b')]({},_0x5ea32a,_0x2c981d['options']);return _0xb3789d[_0xd6ca('0x4f')](_0x5ea32a);}})['then'](function(_0x2df1dc){if(_0x2df1dc){_0x19505a=_0x2df1dc[_0xd6ca('0x4a')];if(!_0x2c981d['query'][_0xd6ca('0x3b')]('nolimit')){_0x5ea32a[_0xd6ca('0x1f')]=qs['limit'](_0x2c981d[_0xd6ca('0x36')][_0xd6ca('0x1f')]);_0x5ea32a['offset']=qs[_0xd6ca('0x1d')](_0x2c981d['query']['offset']);}return _0xb3789d['getConfigurations'](_0x5ea32a);}})['then'](function(_0xf1a926){if(_0xf1a926){return _0xf1a926?{'count':_0x19505a,'rows':_0xf1a926}:null;}})['then'](respondWithResult(_0x280878,null))[_0xd6ca('0x47')](handleError(_0x280878,null));};exports['addConfiguration']=function(_0x472b92,_0x3399b8,_0x44dfa2){if(_0x472b92[_0xd6ca('0x4e')]['id']){delete _0x472b92[_0xd6ca('0x4e')]['id'];}return db[_0xd6ca('0x2f')][_0xd6ca('0x50')]({'where':{'id':_0x472b92['params']['id']}})[_0xd6ca('0x43')](handleEntityNotFound(_0x3399b8,null))[_0xd6ca('0x43')](function(_0x4f11f6){if(_0x4f11f6){_0x472b92[_0xd6ca('0x4e')]['AccountId']=_0x4f11f6['id'];_0x472b92[_0xd6ca('0x4e')][_0xd6ca('0x53')]=integrations[_0xd6ca('0x54')](_0x472b92[_0xd6ca('0x4e')]['channel'],_0x472b92[_0xd6ca('0x4e')][_0xd6ca('0x32')]);_0x472b92[_0xd6ca('0x4e')][_0xd6ca('0x55')]=integrations['getDescriptions'](_0x472b92[_0xd6ca('0x4e')][_0xd6ca('0x56')],_0x472b92[_0xd6ca('0x4e')]['type']);return db['ServicenowConfiguration'][_0xd6ca('0x4d')](_0x472b92[_0xd6ca('0x4e')],{'include':[{'model':db['ServicenowField'],'as':_0xd6ca('0x53')},{'model':db[_0xd6ca('0x57')],'as':'Descriptions'}]});}return null;})[_0xd6ca('0x43')](respondWithResult(_0x3399b8,null))['catch'](handleError(_0x3399b8,null));};exports[_0xd6ca('0x58')]=function(_0x2e323d,_0xf0e1d8,_0x57e7bb){var _0x4e01ab=[_0xd6ca('0x59'),'hold_reason',_0xd6ca('0x5a'),_0xd6ca('0x5b'),'close_code','notify','incident_state',_0xd6ca('0x5c'),'category'];var _0x2c1b6d=[_0xd6ca('0x5d'),_0xd6ca('0x59'),_0xd6ca('0x5e'),'watch_list','upon_reject','sys_updated_on',_0xd6ca('0x5f'),_0xd6ca('0x60'),'approval_history',_0xd6ca('0x61'),_0xd6ca('0x62'),_0xd6ca('0x63'),_0xd6ca('0x64'),_0xd6ca('0x65'),_0xd6ca('0x66'),_0xd6ca('0x67'),_0xd6ca('0x68'),_0xd6ca('0x69'),_0xd6ca('0x5a'),_0xd6ca('0x52'),_0xd6ca('0x6a'),'closed_at','cmdb_ci',_0xd6ca('0x6b'),'impact',_0xd6ca('0x6c'),_0xd6ca('0x6d'),'business_service',_0xd6ca('0x6e'),_0xd6ca('0x6f'),_0xd6ca('0x70'),_0xd6ca('0x71'),_0xd6ca('0x72'),'opened_at',_0xd6ca('0x73'),_0xd6ca('0x74'),_0xd6ca('0x75'),_0xd6ca('0x76'),_0xd6ca('0x77'),_0xd6ca('0x78'),_0xd6ca('0x79'),_0xd6ca('0x5b'),_0xd6ca('0x7a'),'short_description','close_code','correlation_display',_0xd6ca('0x7b'),_0xd6ca('0x7c'),_0xd6ca('0x7d'),'business_stc','additional_assignee_list',_0xd6ca('0x7e'),_0xd6ca('0x7f'),_0xd6ca('0x80'),_0xd6ca('0x81'),_0xd6ca('0x82'),_0xd6ca('0x83'),_0xd6ca('0x84'),_0xd6ca('0x85'),_0xd6ca('0x86'),_0xd6ca('0x87'),_0xd6ca('0x88'),_0xd6ca('0x89'),_0xd6ca('0x8a'),_0xd6ca('0x8b'),_0xd6ca('0x8c'),_0xd6ca('0x8d'),_0xd6ca('0x8e'),'assigned_to',_0xd6ca('0x5c'),_0xd6ca('0x8f'),_0xd6ca('0x90'),_0xd6ca('0x91'),_0xd6ca('0x92'),_0xd6ca('0x93'),_0xd6ca('0x94'),'reopen_count',_0xd6ca('0x95'),'escalation','upon_approval',_0xd6ca('0x96'),_0xd6ca('0x97'),'category'];var _0x25ef61='';var _0x375996='';var _0xc01fca=[];var _0x3d394f='';var _0x531b2b='';var _0x4cd8dd=[];var _0x27eb97='';var _0x5a43d8='';var _0x213b86={};var _0x38f196='';return db[_0xd6ca('0x2f')]['findOne']({'where':{'id':_0x2e323d[_0xd6ca('0x49')]['id']},'attributes':['id','username',_0xd6ca('0x98'),_0xd6ca('0x99'),_0xd6ca('0x9a'),_0xd6ca('0x9b')]})[_0xd6ca('0x43')](handleEntityNotFound(_0xf0e1d8,null))[_0xd6ca('0x43')](function(_0xbf9fff){if(_0xbf9fff){_0x38f196=_0xbf9fff[_0xd6ca('0x9a')];var _0x4c7cf9=_0x38f196[_0xd6ca('0x9c')](-0x1);if(_0x4c7cf9==='/'){_0x38f196=_0x38f196[_0xd6ca('0x9d')](0x0,_0x38f196[_0xd6ca('0x9e')](_0x4c7cf9));}_0x5a43d8=util['format'](_0xd6ca('0x9f'),_0x38f196);_0x27eb97=util[_0xd6ca('0xa0')]('%s/api/now/table/',_0x38f196);_0x213b86={'user':_0xbf9fff[_0xd6ca('0xa1')],'pass':_0xbf9fff[_0xd6ca('0x98')]};var _0x5f1b63={'method':_0xd6ca('0xa2'),'uri':_0x5a43d8+'incident?sysparm_display_value=all','auth':_0x213b86,'json':!![]};return rp(_0x5f1b63);}})[_0xd6ca('0x43')](function(_0x5f4493){if(_0x5f4493[_0xd6ca('0xa3')][_0xd6ca('0x4a')]>0x0){_0x25ef61=_0x5f4493['result'];}console[_0xd6ca('0xa4')](_0xd6ca('0xa5'),_0x25ef61);_0x4cd8dd=[];_0x375996=Object[_0xd6ca('0xa6')]([],_0x25ef61);_[_0xd6ca('0xa7')](_0x375996,function(_0x236af6){return!_0x4e01ab['includes'](_0x236af6['name']);});_0x375996[_0xd6ca('0xa8')](function(_0x5753bb){var _0x998245=createFieldObject(_0x27eb97,_0x213b86,_0x5753bb[_0xd6ca('0xa9')],_0x5753bb['name'],_0x5753bb[_0xd6ca('0xaa')],![]);_0x4cd8dd[_0xd6ca('0xab')](_0x998245);});return Promise[_0xd6ca('0xac')](_0x4cd8dd);})['then'](function(_0x2d82ad){_0xc01fca=_0x2d82ad;_0x3d394f=Object[_0xd6ca('0xa6')]([],_0x25ef61);console[_0xd6ca('0xa4')](_0xd6ca('0xad'),_0x25ef61);_['remove'](_0x3d394f,function(_0x571601){return _0x2c1b6d[_0xd6ca('0xae')](_0x571601[_0xd6ca('0x2c')]);});console['log'](_0xd6ca('0xaf'),_0x3d394f);_0x4cd8dd=[];_0x3d394f[_0xd6ca('0xa8')](function(_0x3803a0){var _0x4798a=createFieldObject(_0x27eb97,_0x213b86,_0x3803a0[_0xd6ca('0xa9')],_0x3803a0[_0xd6ca('0x2c')],_0x3803a0[_0xd6ca('0xaa')],!![]);_0x4cd8dd[_0xd6ca('0xab')](_0x4798a);});return Promise[_0xd6ca('0xac')](_0x4cd8dd);})[_0xd6ca('0x43')](function(_0x376120){_0x531b2b=_0x376120;var _0x15eb2e=_0xc01fca[_0xd6ca('0xb0')](_0x531b2b);return{'count':_0x15eb2e['length'],'rows':_0x15eb2e};})[_0xd6ca('0x43')](respondWithResult(_0xf0e1d8,null))[_0xd6ca('0x47')](function(_0xa1f2fd){console[_0xd6ca('0xa4')]('ServiceNow\x20error:\x20'+_0xa1f2fd);var _0x176721=_0x2e323d[_0xd6ca('0x36')][_0xd6ca('0xb1')]?0x1f4:_0xa1f2fd[_0xd6ca('0xb2')]||0x1f4;logger[_0xd6ca('0x2a')](_0xa1f2fd[_0xd6ca('0x2b')]);delete _0xa1f2fd[_0xd6ca('0x2c')];if(_0x176721===0x191){_0x176721=0x190;}_0xf0e1d8['status'](_0x176721)[_0xd6ca('0x2d')](_0x2e323d[_0xd6ca('0x36')][_0xd6ca('0xb1')]?{'message':_0xd6ca('0xb3'),'statusCode':_0xa1f2fd[_0xd6ca('0xb2')]}:_0xa1f2fd);});};function createFieldObject(_0xc5b6e2,_0x54bd23,_0x540e11,_0x368325,_0x456186,_0x166898){return new Promise(function(_0x2303bd,_0x32c8c9){var _0x5345ad={'id':_0x368325,'name':_0x456186,'custom':_0x166898};if(_0x540e11===_0xd6ca('0xb4')){_0x5345ad[_0xd6ca('0x42')]=[{'name':_0xd6ca('0xb5'),'value':_0xd6ca('0xb6')},{'name':_0xd6ca('0xb7'),'value':_0xd6ca('0xb8')}];_0x2303bd(_0x5345ad);}else{var _0x15dff8={'method':_0xd6ca('0xa2'),'uri':_0xc5b6e2+'sys_choice?sysparm_query=name=incident^element='+_0x368325,'auth':_0x54bd23,'json':!![]};return rp(_0x15dff8)['then'](function(_0x24be25){var _0x28afba=[];if(_0x24be25[_0xd6ca('0xa3')][_0xd6ca('0x4a')]>0x0){_0x24be25[_0xd6ca('0xa3')][_0xd6ca('0xa8')](function(_0x1e2265){if(_0x1e2265[_0xd6ca('0xb9')]===_0xd6ca('0xb8')){var _0x3cf63d={'name':_0x1e2265[_0xd6ca('0xaa')],'value':_0x1e2265['value']};_0x28afba['push'](_0x3cf63d);}});}_0x5345ad[_0xd6ca('0x42')]=_0x28afba;if(_0x5345ad[_0xd6ca('0x42')][_0xd6ca('0x4a')]>0x0){_0x2303bd(_0x5345ad);}else{if(_0x166898==![]){_0x2303bd();}else{_0x2303bd(_0x5345ad);}}});}});}
\ No newline at end of file
+var _0xe8ed=['comments_and_work_notes','sys_mod_count','sys_tags','upon_approval','location','password','remoteUri','lastIndexOf','format','%s/api/now/table/','username','result','log','incident\x20table\x20objects','assign','forEach','internalType','label','push','all','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','statusCode','send','Wrong\x20credentials','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','value','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','then','destroy','end','sendStatus','error','stack','name','index','ServicenowAccount','rawAttributes','fieldName','type','map','keys','filters','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','include','findAll','options','find','catch','create','body','update','params','getConfigurations','findOne','ServicenowConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','business_service','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','closed_by','parent_incident','sys_id','contact_type','urgency','activity_due','assigned_to','comments','sla_due'];(function(_0x33ffaa,_0x1fc19d){var _0x5741ed=function(_0x401210){while(--_0x401210){_0x33ffaa['push'](_0x33ffaa['shift']());}};_0x5741ed(++_0x1fc19d);}(_0xe8ed,0xc8));var _0xde8e=function(_0x383b87,_0x1c365c){_0x383b87=_0x383b87-0x0;var _0x39aeab=_0xe8ed[_0x383b87];return _0x39aeab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xde8e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde8e('0x1'));var rp=require(_0xde8e('0x2'));var moment=require('moment');var BPromise=require(_0xde8e('0x3'));var Mustache=require(_0xde8e('0x4'));var util=require(_0xde8e('0x5'));var path=require(_0xde8e('0x6'));var sox=require(_0xde8e('0x7'));var csv=require(_0xde8e('0x8'));var ejs=require(_0xde8e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xde8e('0xa'));var squel=require('squel');var crypto=require(_0xde8e('0xb'));var jsforce=require(_0xde8e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xde8e('0x8'));var querystring=require('querystring');var Papa=require(_0xde8e('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde8e('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde8e('0xf'));var logger=require(_0xde8e('0x10'))(_0xde8e('0x11'));var utils=require(_0xde8e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xde8e('0x13'))['db'];var integrations=require(_0xde8e('0x14'));function respondWithStatusCode(_0x2f6920,_0x46a750){_0x46a750=_0x46a750||0xcc;return function(_0x138ea9){if(_0x138ea9){return _0x2f6920['sendStatus'](_0x46a750);}return _0x2f6920[_0xde8e('0x15')](_0x46a750)['end']();};}function respondWithResult(_0x5cf4c5,_0x5dafeb){_0x5dafeb=_0x5dafeb||0xc8;return function(_0x359bfd){if(_0x359bfd){return _0x5cf4c5[_0xde8e('0x15')](_0x5dafeb)[_0xde8e('0x16')](_0x359bfd);}};}function respondWithFilteredResult(_0x2a1930,_0xc6b394){return function(_0x290db3){if(_0x290db3){var _0x4bdc27=typeof _0xc6b394[_0xde8e('0x17')]===_0xde8e('0x18')&&typeof _0xc6b394[_0xde8e('0x19')]==='undefined';var _0x4ee38e=_0x290db3[_0xde8e('0x1a')];var _0x3d31a8=_0x4bdc27?0x0:_0xc6b394[_0xde8e('0x17')];var _0x5ed20c=_0x4bdc27?_0x290db3[_0xde8e('0x1a')]:_0xc6b394[_0xde8e('0x17')]+_0xc6b394[_0xde8e('0x19')];var _0x1dd3b6;if(_0x5ed20c>=_0x4ee38e){_0x5ed20c=_0x4ee38e;_0x1dd3b6=0xc8;}else{_0x1dd3b6=0xce;}_0x2a1930[_0xde8e('0x15')](_0x1dd3b6);return _0x2a1930[_0xde8e('0x1b')]('Content-Range',_0x3d31a8+'-'+_0x5ed20c+'/'+_0x4ee38e)['json'](_0x290db3);}return null;};}function patchUpdates(_0x57645d){return function(_0x42b0d2){try{jsonpatch[_0xde8e('0x1c')](_0x42b0d2,_0x57645d,!![]);}catch(_0x4c13fe){return BPromise['reject'](_0x4c13fe);}return _0x42b0d2['save']();};}function saveUpdates(_0xd34b3,_0x3c44fc){return function(_0x502930){if(_0x502930){return _0x502930['update'](_0xd34b3)[_0xde8e('0x1d')](function(_0x1b9135){return _0x1b9135;});}return null;};}function removeEntity(_0x1e1a60,_0x2cde6d){return function(_0x3029ff){if(_0x3029ff){return _0x3029ff[_0xde8e('0x1e')]()['then'](function(){_0x1e1a60['status'](0xcc)[_0xde8e('0x1f')]();});}};}function handleEntityNotFound(_0x1fd16d,_0x8b4047){return function(_0x3fc1e5){if(!_0x3fc1e5){_0x1fd16d[_0xde8e('0x20')](0x194);}return _0x3fc1e5;};}function handleError(_0x37bff0,_0x1b1588){_0x1b1588=_0x1b1588||0x1f4;return function(_0x36f585){logger[_0xde8e('0x21')](_0x36f585[_0xde8e('0x22')]);if(_0x36f585[_0xde8e('0x23')]){delete _0x36f585[_0xde8e('0x23')];}_0x37bff0['status'](_0x1b1588)['send'](_0x36f585);};}exports[_0xde8e('0x24')]=function(_0x56968b,_0x343dad){var _0x2b42ce={},_0x244aa0={},_0x52807c={'count':0x0,'rows':[]};var _0x336c3a=_['map'](db[_0xde8e('0x25')][_0xde8e('0x26')],function(_0x4abe9b){return{'name':_0x4abe9b[_0xde8e('0x27')],'type':_0x4abe9b[_0xde8e('0x28')]['key']};});_0x244aa0['model']=_[_0xde8e('0x29')](_0x336c3a,_0xde8e('0x23'));_0x244aa0['query']=_[_0xde8e('0x2a')](_0x56968b['query']);_0x244aa0[_0xde8e('0x2b')]=_['intersection'](_0x244aa0[_0xde8e('0x2c')],_0x244aa0[_0xde8e('0x2d')]);_0x2b42ce['attributes']=_[_0xde8e('0x2e')](_0x244aa0[_0xde8e('0x2c')],qs[_0xde8e('0x2f')](_0x56968b['query']['fields']));_0x2b42ce[_0xde8e('0x30')]=_0x2b42ce[_0xde8e('0x30')][_0xde8e('0x31')]?_0x2b42ce[_0xde8e('0x30')]:_0x244aa0[_0xde8e('0x2c')];if(!_0x56968b['query'][_0xde8e('0x32')]('nolimit')){_0x2b42ce['limit']=qs['limit'](_0x56968b[_0xde8e('0x2d')]['limit']);_0x2b42ce[_0xde8e('0x17')]=qs[_0xde8e('0x17')](_0x56968b[_0xde8e('0x2d')][_0xde8e('0x17')]);}_0x2b42ce[_0xde8e('0x33')]=qs[_0xde8e('0x34')](_0x56968b['query'][_0xde8e('0x34')]);_0x2b42ce[_0xde8e('0x35')]=qs[_0xde8e('0x2b')](_['pick'](_0x56968b[_0xde8e('0x2d')],_0x244aa0[_0xde8e('0x2b')]),_0x336c3a);if(_0x56968b['query'][_0xde8e('0x36')]){_0x2b42ce[_0xde8e('0x35')]=_['merge'](_0x2b42ce[_0xde8e('0x35')],{'$or':_['map'](_0x336c3a,function(_0x57a9a2){if(_0x57a9a2[_0xde8e('0x28')]!==_0xde8e('0x37')){var _0x44227d={};_0x44227d[_0x57a9a2[_0xde8e('0x23')]]={'$like':'%'+_0x56968b[_0xde8e('0x2d')][_0xde8e('0x36')]+'%'};return _0x44227d;}})});}_0x2b42ce=_[_0xde8e('0x38')]({},_0x2b42ce,_0x56968b['options']);var _0x440c8a={'where':_0x2b42ce['where']};return db[_0xde8e('0x25')][_0xde8e('0x1a')](_0x440c8a)[_0xde8e('0x1d')](function(_0x2900f7){_0x52807c['count']=_0x2900f7;if(_0x56968b[_0xde8e('0x2d')]['includeAll']){_0x2b42ce[_0xde8e('0x39')]=[{'all':!![]}];}return db[_0xde8e('0x25')][_0xde8e('0x3a')](_0x2b42ce);})[_0xde8e('0x1d')](function(_0x5f0266){_0x52807c['rows']=_0x5f0266;return _0x52807c;})[_0xde8e('0x1d')](respondWithFilteredResult(_0x343dad,_0x2b42ce))['catch'](handleError(_0x343dad,null));};exports['show']=function(_0x1c6a44,_0x5de0e5){var _0x37dc5d={'raw':![],'where':{'id':_0x1c6a44['params']['id']}},_0x121d68={};_0x121d68[_0xde8e('0x2c')]=_[_0xde8e('0x2a')](db[_0xde8e('0x25')][_0xde8e('0x26')]);_0x121d68[_0xde8e('0x2d')]=_['keys'](_0x1c6a44[_0xde8e('0x2d')]);_0x121d68[_0xde8e('0x2b')]=_[_0xde8e('0x2e')](_0x121d68[_0xde8e('0x2c')],_0x121d68[_0xde8e('0x2d')]);_0x37dc5d[_0xde8e('0x30')]=_[_0xde8e('0x2e')](_0x121d68[_0xde8e('0x2c')],qs[_0xde8e('0x2f')](_0x1c6a44[_0xde8e('0x2d')]['fields']));_0x37dc5d['attributes']=_0x37dc5d[_0xde8e('0x30')][_0xde8e('0x31')]?_0x37dc5d['attributes']:_0x121d68[_0xde8e('0x2c')];if(_0x1c6a44['query']['includeAll']){_0x37dc5d[_0xde8e('0x39')]=[{'all':!![]}];}_0x37dc5d=_[_0xde8e('0x38')]({},_0x37dc5d,_0x1c6a44[_0xde8e('0x3b')]);return db['ServicenowAccount'][_0xde8e('0x3c')](_0x37dc5d)[_0xde8e('0x1d')](handleEntityNotFound(_0x5de0e5,null))['then'](respondWithResult(_0x5de0e5,null))[_0xde8e('0x3d')](handleError(_0x5de0e5,null));};exports['create']=function(_0x2e6f39,_0x2623e2){return db[_0xde8e('0x25')][_0xde8e('0x3e')](_0x2e6f39[_0xde8e('0x3f')],{})[_0xde8e('0x1d')](respondWithResult(_0x2623e2,0xc9))[_0xde8e('0x3d')](handleError(_0x2623e2,null));};exports[_0xde8e('0x40')]=function(_0x333dcb,_0x22370c){if(_0x333dcb[_0xde8e('0x3f')]['id']){delete _0x333dcb['body']['id'];}return db[_0xde8e('0x25')][_0xde8e('0x3c')]({'where':{'id':_0x333dcb[_0xde8e('0x41')]['id']}})['then'](handleEntityNotFound(_0x22370c,null))['then'](saveUpdates(_0x333dcb[_0xde8e('0x3f')],null))[_0xde8e('0x1d')](respondWithResult(_0x22370c,null))[_0xde8e('0x3d')](handleError(_0x22370c,null));};exports[_0xde8e('0x1e')]=function(_0x2da1ca,_0x304ecc){return db[_0xde8e('0x25')][_0xde8e('0x3c')]({'where':{'id':_0x2da1ca[_0xde8e('0x41')]['id']}})[_0xde8e('0x1d')](handleEntityNotFound(_0x304ecc,null))[_0xde8e('0x1d')](removeEntity(_0x304ecc,null))[_0xde8e('0x3d')](handleError(_0x304ecc,null));};exports[_0xde8e('0x42')]=function(_0x4f4f56,_0x3af8f2,_0x43c3e2){var _0x489c53={};var _0x5f21a8={};var _0xd3f6b3;var _0x2cb8b8;return db[_0xde8e('0x25')][_0xde8e('0x43')]({'where':{'id':_0x4f4f56[_0xde8e('0x41')]['id']}})[_0xde8e('0x1d')](handleEntityNotFound(_0x3af8f2,null))['then'](function(_0x1b8160){if(_0x1b8160){_0xd3f6b3=_0x1b8160;_0x5f21a8[_0xde8e('0x2c')]=_[_0xde8e('0x2a')](db[_0xde8e('0x44')]['rawAttributes']);_0x5f21a8[_0xde8e('0x2d')]=_[_0xde8e('0x2a')](_0x4f4f56['query']);_0x5f21a8[_0xde8e('0x2b')]=_[_0xde8e('0x2e')](_0x5f21a8[_0xde8e('0x2c')],_0x5f21a8['query']);_0x489c53[_0xde8e('0x30')]=_[_0xde8e('0x2e')](_0x5f21a8['model'],qs[_0xde8e('0x2f')](_0x4f4f56[_0xde8e('0x2d')][_0xde8e('0x2f')]));_0x489c53[_0xde8e('0x30')]=_0x489c53['attributes']['length']?_0x489c53[_0xde8e('0x30')]:_0x5f21a8[_0xde8e('0x2c')];_0x489c53['order']=qs[_0xde8e('0x34')](_0x4f4f56[_0xde8e('0x2d')][_0xde8e('0x34')]);_0x489c53[_0xde8e('0x35')]=qs[_0xde8e('0x2b')](_[_0xde8e('0x45')](_0x4f4f56[_0xde8e('0x2d')],_0x5f21a8[_0xde8e('0x2b')]));if(_0x4f4f56['query']['filter']){_0x489c53[_0xde8e('0x35')]=_[_0xde8e('0x38')](_0x489c53['where'],{'$or':_[_0xde8e('0x29')](_0x489c53[_0xde8e('0x30')],function(_0x4b5800){var _0x510d32={};_0x510d32[_0x4b5800]={'$like':'%'+_0x4f4f56[_0xde8e('0x2d')][_0xde8e('0x36')]+'%'};return _0x510d32;})});}_0x489c53=_[_0xde8e('0x38')]({},_0x489c53,_0x4f4f56[_0xde8e('0x3b')]);return _0xd3f6b3[_0xde8e('0x42')](_0x489c53);}})[_0xde8e('0x1d')](function(_0x1df313){if(_0x1df313){_0x2cb8b8=_0x1df313['length'];if(!_0x4f4f56[_0xde8e('0x2d')][_0xde8e('0x32')]('nolimit')){_0x489c53[_0xde8e('0x19')]=qs[_0xde8e('0x19')](_0x4f4f56['query'][_0xde8e('0x19')]);_0x489c53[_0xde8e('0x17')]=qs[_0xde8e('0x17')](_0x4f4f56[_0xde8e('0x2d')][_0xde8e('0x17')]);}return _0xd3f6b3[_0xde8e('0x42')](_0x489c53);}})[_0xde8e('0x1d')](function(_0xc1c7fc){if(_0xc1c7fc){return _0xc1c7fc?{'count':_0x2cb8b8,'rows':_0xc1c7fc}:null;}})['then'](respondWithResult(_0x3af8f2,null))[_0xde8e('0x3d')](handleError(_0x3af8f2,null));};exports[_0xde8e('0x46')]=function(_0x36d2c4,_0x582594,_0x448403){if(_0x36d2c4[_0xde8e('0x3f')]['id']){delete _0x36d2c4['body']['id'];}return db[_0xde8e('0x25')][_0xde8e('0x43')]({'where':{'id':_0x36d2c4[_0xde8e('0x41')]['id']}})[_0xde8e('0x1d')](handleEntityNotFound(_0x582594,null))[_0xde8e('0x1d')](function(_0x505ebd){if(_0x505ebd){_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x47')]=_0x505ebd['id'];_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x48')]=integrations[_0xde8e('0x49')](_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x4a')],_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x28')]);_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x4b')]=integrations['getDescriptions'](_0x36d2c4['body']['channel'],_0x36d2c4[_0xde8e('0x3f')][_0xde8e('0x28')]);return db['ServicenowConfiguration'][_0xde8e('0x3e')](_0x36d2c4['body'],{'include':[{'model':db[_0xde8e('0x4c')],'as':_0xde8e('0x48')},{'model':db[_0xde8e('0x4c')],'as':_0xde8e('0x4b')}]});}return null;})[_0xde8e('0x1d')](respondWithResult(_0x582594,null))[_0xde8e('0x3d')](handleError(_0x582594,null));};exports['getFields']=function(_0x2fcf4f,_0x83af34,_0x2e0ce4){var _0x73a44e=[_0xde8e('0x4d'),_0xde8e('0x4e'),_0xde8e('0x4f'),_0xde8e('0x50'),_0xde8e('0x51'),_0xde8e('0x52'),_0xde8e('0x53'),_0xde8e('0x54'),_0xde8e('0x55')];var _0x14ec54=[_0xde8e('0x56'),_0xde8e('0x4d'),_0xde8e('0x57'),_0xde8e('0x58'),_0xde8e('0x59'),_0xde8e('0x5a'),_0xde8e('0x5b'),_0xde8e('0x4e'),_0xde8e('0x5c'),'number','resolved_by','sys_updated_by','opened_by','user_input',_0xde8e('0x5d'),_0xde8e('0x5e'),_0xde8e('0x5f'),_0xde8e('0x60'),_0xde8e('0x4f'),_0xde8e('0x33'),_0xde8e('0x61'),_0xde8e('0x62'),_0xde8e('0x63'),'delivery_plan','impact',_0xde8e('0x64'),'work_notes_list',_0xde8e('0x65'),_0xde8e('0x66'),_0xde8e('0x67'),'rfc',_0xde8e('0x68'),'expected_start',_0xde8e('0x69'),_0xde8e('0x6a'),_0xde8e('0x6b'),_0xde8e('0x6c'),'reopened_time',_0xde8e('0x6d'),_0xde8e('0x6e'),'approval_set',_0xde8e('0x50'),'work_notes',_0xde8e('0x6f'),_0xde8e('0x51'),_0xde8e('0x70'),_0xde8e('0x71'),_0xde8e('0x72'),_0xde8e('0x73'),_0xde8e('0x74'),_0xde8e('0x75'),_0xde8e('0x76'),_0xde8e('0x77'),'notify',_0xde8e('0x78'),'close_notes',_0xde8e('0x79'),'follow_up',_0xde8e('0x7a'),_0xde8e('0x7b'),_0xde8e('0x7c'),'reopened_by',_0xde8e('0x53'),_0xde8e('0x7d'),'problem_id','company','reassignment_count',_0xde8e('0x7e'),_0xde8e('0x7f'),_0xde8e('0x54'),_0xde8e('0x80'),_0xde8e('0x81'),'approval',_0xde8e('0x82'),'due_date',_0xde8e('0x83'),'reopen_count',_0xde8e('0x84'),'escalation',_0xde8e('0x85'),'correlation_id',_0xde8e('0x86'),_0xde8e('0x55')];var _0x404cfe='';var _0x1cb4d4='';var _0x6c1454=[];var _0x1b8e19='';var _0x95f33f='';var _0x563750=[];var _0x899cf8='';var _0x3c1340='';var _0x2b7f07={};var _0x48aee5='';return db[_0xde8e('0x25')][_0xde8e('0x43')]({'where':{'id':_0x2fcf4f[_0xde8e('0x41')]['id']},'attributes':['id','username',_0xde8e('0x87'),'email','remoteUri','serverUrl']})[_0xde8e('0x1d')](handleEntityNotFound(_0x83af34,null))[_0xde8e('0x1d')](function(_0x128386){if(_0x128386){_0x48aee5=_0x128386[_0xde8e('0x88')];var _0x32d439=_0x48aee5['slice'](-0x1);if(_0x32d439==='/'){_0x48aee5=_0x48aee5['substring'](0x0,_0x48aee5[_0xde8e('0x89')](_0x32d439));}_0x3c1340=util['format']('%s/api/now/doc/table/schema/',_0x48aee5);_0x899cf8=util[_0xde8e('0x8a')](_0xde8e('0x8b'),_0x48aee5);_0x2b7f07={'user':_0x128386[_0xde8e('0x8c')],'pass':_0x128386[_0xde8e('0x87')]};var _0x5bb834={'method':'GET','uri':_0x3c1340+'incident?sysparm_display_value=all','auth':_0x2b7f07,'json':!![]};return rp(_0x5bb834);}})[_0xde8e('0x1d')](function(_0x426286){if(_0x426286['result'][_0xde8e('0x31')]>0x0){_0x404cfe=_0x426286[_0xde8e('0x8d')];}console[_0xde8e('0x8e')](_0xde8e('0x8f'),_0x404cfe);_0x563750=[];_0x1cb4d4=Object[_0xde8e('0x90')]([],_0x404cfe);_['remove'](_0x1cb4d4,function(_0x523c78){return!_0x73a44e['includes'](_0x523c78[_0xde8e('0x23')]);});_0x1cb4d4[_0xde8e('0x91')](function(_0x2d1bc7){var _0x1bd9a0=createFieldObject(_0x899cf8,_0x2b7f07,_0x2d1bc7[_0xde8e('0x92')],_0x2d1bc7[_0xde8e('0x23')],_0x2d1bc7[_0xde8e('0x93')],![]);_0x563750[_0xde8e('0x94')](_0x1bd9a0);});return Promise[_0xde8e('0x95')](_0x563750);})[_0xde8e('0x1d')](function(_0x2f4a09){_0x6c1454=_0x2f4a09;_0x1b8e19=Object[_0xde8e('0x90')]([],_0x404cfe);console['log'](_0xde8e('0x96'),_0x404cfe);_['remove'](_0x1b8e19,function(_0x5dffd7){return _0x14ec54[_0xde8e('0x97')](_0x5dffd7[_0xde8e('0x23')]);});console[_0xde8e('0x8e')](_0xde8e('0x98'),_0x1b8e19);_0x563750=[];_0x1b8e19['forEach'](function(_0x175a23){var _0x133b8a=createFieldObject(_0x899cf8,_0x2b7f07,_0x175a23[_0xde8e('0x92')],_0x175a23['name'],_0x175a23[_0xde8e('0x93')],!![]);_0x563750['push'](_0x133b8a);});return Promise[_0xde8e('0x95')](_0x563750);})[_0xde8e('0x1d')](function(_0x229be8){_0x95f33f=_0x229be8;var _0x10ae82=_0x6c1454[_0xde8e('0x99')](_0x95f33f);return{'count':_0x10ae82[_0xde8e('0x31')],'rows':_0x10ae82};})[_0xde8e('0x1d')](respondWithResult(_0x83af34,null))[_0xde8e('0x3d')](function(_0x1eb610){console[_0xde8e('0x8e')](_0xde8e('0x9a')+_0x1eb610);var _0x106410=_0x2fcf4f[_0xde8e('0x2d')]['test']?0x1f4:_0x1eb610[_0xde8e('0x9b')]||0x1f4;logger[_0xde8e('0x21')](_0x1eb610['stack']);delete _0x1eb610[_0xde8e('0x23')];if(_0x106410===0x191){_0x106410=0x190;}_0x83af34[_0xde8e('0x15')](_0x106410)[_0xde8e('0x9c')](_0x2fcf4f['query']['test']?{'message':_0xde8e('0x9d'),'statusCode':_0x1eb610['statusCode']}:_0x1eb610);});};function createFieldObject(_0x4b14bc,_0x1cfba1,_0x1b810a,_0x3765e,_0x2d461d,_0x1f4f38){return new Promise(function(_0x566f3c,_0xbeb556){var _0x2f0e3a={'id':_0x3765e,'name':_0x2d461d,'custom':_0x1f4f38};if(_0x1b810a==='boolean'){_0x2f0e3a[_0xde8e('0x3b')]=[{'name':_0xde8e('0x9e'),'value':_0xde8e('0x9f')},{'name':_0xde8e('0xa0'),'value':_0xde8e('0xa1')}];_0x566f3c(_0x2f0e3a);}else{var _0x4cc0ae={'method':_0xde8e('0xa2'),'uri':_0x4b14bc+_0xde8e('0xa3')+_0x3765e,'auth':_0x1cfba1,'json':!![]};return rp(_0x4cc0ae)[_0xde8e('0x1d')](function(_0x32c332){var _0x3329c9=[];if(_0x32c332[_0xde8e('0x8d')][_0xde8e('0x31')]>0x0){_0x32c332[_0xde8e('0x8d')][_0xde8e('0x91')](function(_0xd34f8c){if(_0xd34f8c['inactive']===_0xde8e('0xa1')){var _0x157ab9={'name':_0xd34f8c[_0xde8e('0x93')],'value':_0xd34f8c[_0xde8e('0xa4')]};_0x3329c9[_0xde8e('0x94')](_0x157ab9);}});}_0x2f0e3a[_0xde8e('0x3b')]=_0x3329c9;if(_0x2f0e3a['options'][_0xde8e('0x31')]>0x0){_0x566f3c(_0x2f0e3a);}else{if(_0x1f4f38==![]){_0x566f3c();}else{_0x566f3c(_0x2f0e3a);}}});}});}
\ No newline at end of file
index 45b2716..04d6176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x32eb74,_0x4a6109){var _0x517310=function(_0x175375){while(--_0x175375){_0x32eb74['push'](_0x32eb74['shift']());}};_0x517310(++_0x4a6109);}(_0x5075,0x73));var _0x5507=function(_0x413f2a,_0x1006e4){_0x413f2a=_0x413f2a-0x0;var _0x1932ec=_0x5075[_0x413f2a];return _0x1932ec;};'use strict';var _=require(_0x5507('0x0'));var util=require(_0x5507('0x1'));var logger=require(_0x5507('0x2'))(_0x5507('0x3'));var moment=require(_0x5507('0x4'));var BPromise=require(_0x5507('0x5'));var rp=require(_0x5507('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5507('0x7'));var config=require(_0x5507('0x8'));var attributes=require(_0x5507('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2cd9ee,_0x773559){return _0x2cd9ee['define'](_0x5507('0xa'),attributes,{'tableName':_0x5507('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2eb2=['request-promise','rimraf','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','api','moment','bluebird'];(function(_0x2c34a6,_0x160b42){var _0x1a2f9c=function(_0x36b62c){while(--_0x36b62c){_0x2c34a6['push'](_0x2c34a6['shift']());}};_0x1a2f9c(++_0x160b42);}(_0x2eb2,0x19f));var _0x22eb=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x2eb2[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x22eb('0x7'));module[_0x22eb('0x8')]=function(_0x35dd5b,_0x2a9850){return _0x35dd5b[_0x22eb('0x9')](_0x22eb('0xa'),attributes,{'tableName':_0x22eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa6c485..f5012c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6ea=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','debug','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetServicenowAccount','ServicenowAccount','options','where','attributes','limit','include','model','map','then','info','find','raw','ShowServicenowAccount','lodash','util','bluebird'];(function(_0x27eda0,_0x42a3cf){var _0x2b63a5=function(_0x431084){while(--_0x431084){_0x27eda0['push'](_0x27eda0['shift']());}};_0x2b63a5(++_0x42a3cf);}(_0xf6ea,0x115));var _0xaf6e=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xf6ea[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xaf6e('0x0'));var util=require(_0xaf6e('0x1'));var moment=require('moment');var BPromise=require(_0xaf6e('0x2'));var rs=require(_0xaf6e('0x3'));var fs=require('fs');var Redis=require(_0xaf6e('0x4'));var db=require(_0xaf6e('0x5'))['db'];var utils=require(_0xaf6e('0x6'));var logger=require('../../config/logger')(_0xaf6e('0x7'));var config=require('../../config/environment');var jayson=require(_0xaf6e('0x8'));var client=jayson[_0xaf6e('0x9')][_0xaf6e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41107b,_0x446c1e,_0x527b66){return new BPromise(function(_0x2c9163,_0x448849){return client[_0xaf6e('0xb')](_0x41107b,_0x527b66)['then'](function(_0x1d80af){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x446c1e,'request\x20sent');logger[_0xaf6e('0xc')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x446c1e,'request\x20sent',JSON[_0xaf6e('0xd')](_0x1d80af));if(_0x1d80af[_0xaf6e('0xe')]){if(_0x1d80af[_0xaf6e('0xe')][_0xaf6e('0xf')]===0x1f4){logger['error'](_0xaf6e('0x10'),_0x446c1e,_0x1d80af[_0xaf6e('0xe')][_0xaf6e('0x11')]);return _0x448849(_0x1d80af[_0xaf6e('0xe')]['message']);}logger[_0xaf6e('0xe')](_0xaf6e('0x10'),_0x446c1e,_0x1d80af[_0xaf6e('0xe')][_0xaf6e('0x11')]);return _0x2c9163(_0x1d80af[_0xaf6e('0xe')][_0xaf6e('0x11')]);}else{logger['info'](_0xaf6e('0x10'),_0x446c1e,_0xaf6e('0x12'));_0x2c9163(_0x1d80af[_0xaf6e('0x13')][_0xaf6e('0x11')]);}})[_0xaf6e('0x14')](function(_0x433de7){logger[_0xaf6e('0xe')](_0xaf6e('0x10'),_0x446c1e,_0x433de7);_0x448849(_0x433de7);});});}exports[_0xaf6e('0x15')]=function(_0x294215){var _0x2bf7df=this;return new Promise(function(_0x433e12,_0x13017f){return db[_0xaf6e('0x16')]['findAll']({'raw':_0x294215[_0xaf6e('0x17')]?_0x294215[_0xaf6e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x294215[_0xaf6e('0x17')]?_0x294215[_0xaf6e('0x17')][_0xaf6e('0x18')]||null:null,'attributes':_0x294215[_0xaf6e('0x17')]?_0x294215[_0xaf6e('0x17')][_0xaf6e('0x19')]||null:null,'limit':_0x294215[_0xaf6e('0x17')]?_0x294215[_0xaf6e('0x17')][_0xaf6e('0x1a')]||null:null,'include':_0x294215[_0xaf6e('0x17')]?_0x294215[_0xaf6e('0x17')][_0xaf6e('0x1b')]?_['map'](_0x294215[_0xaf6e('0x17')][_0xaf6e('0x1b')],function(_0x136951){return{'model':db[_0x136951[_0xaf6e('0x1c')]],'as':_0x136951['as'],'attributes':_0x136951[_0xaf6e('0x19')],'include':_0x136951['include']?_['map'](_0x136951['include'],function(_0x4936ce){return{'model':db[_0x4936ce[_0xaf6e('0x1c')]],'as':_0x4936ce['as'],'attributes':_0x4936ce[_0xaf6e('0x19')],'include':_0x4936ce[_0xaf6e('0x1b')]?_[_0xaf6e('0x1d')](_0x4936ce[_0xaf6e('0x1b')],function(_0x1355aa){return{'model':db[_0x1355aa[_0xaf6e('0x1c')]],'as':_0x1355aa['as'],'attributes':_0x1355aa[_0xaf6e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf6e('0x1e')](function(_0x2717a6){logger[_0xaf6e('0x1f')](_0xaf6e('0x15'),_0x294215);logger['debug'](_0xaf6e('0x15'),_0x294215,JSON[_0xaf6e('0xd')](_0x2717a6));_0x433e12(_0x2717a6);})[_0xaf6e('0x14')](function(_0x4beb02){logger[_0xaf6e('0xe')](_0xaf6e('0x15'),_0x4beb02[_0xaf6e('0x11')],_0x294215);_0x13017f(_0x2bf7df[_0xaf6e('0xe')](0x1f4,_0x4beb02[_0xaf6e('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x360fdf){var _0x1a2cea=this;return new Promise(function(_0x203817,_0x982d1){return db[_0xaf6e('0x16')][_0xaf6e('0x20')]({'raw':_0x360fdf[_0xaf6e('0x17')]?_0x360fdf['options'][_0xaf6e('0x21')]===undefined?!![]:![]:!![],'where':_0x360fdf['options']?_0x360fdf[_0xaf6e('0x17')][_0xaf6e('0x18')]||null:null,'attributes':_0x360fdf[_0xaf6e('0x17')]?_0x360fdf[_0xaf6e('0x17')][_0xaf6e('0x19')]||null:null,'include':_0x360fdf[_0xaf6e('0x17')]?_0x360fdf['options'][_0xaf6e('0x1b')]?_['map'](_0x360fdf['options']['include'],function(_0x16c39f){return{'model':db[_0x16c39f['model']],'as':_0x16c39f['as'],'attributes':_0x16c39f['attributes'],'include':_0x16c39f[_0xaf6e('0x1b')]?_['map'](_0x16c39f['include'],function(_0x46a91e){return{'model':db[_0x46a91e[_0xaf6e('0x1c')]],'as':_0x46a91e['as'],'attributes':_0x46a91e[_0xaf6e('0x19')],'include':_0x46a91e[_0xaf6e('0x1b')]?_[_0xaf6e('0x1d')](_0x46a91e[_0xaf6e('0x1b')],function(_0x557346){return{'model':db[_0x557346['model']],'as':_0x557346['as'],'attributes':_0x557346[_0xaf6e('0x19')]};}):[]};}):[]};}):[]:[]})[_0xaf6e('0x1e')](function(_0x3dbf10){logger[_0xaf6e('0x1f')]('ShowServicenowAccount',_0x360fdf);logger[_0xaf6e('0xc')](_0xaf6e('0x22'),_0x360fdf,JSON[_0xaf6e('0xd')](_0x3dbf10));_0x203817(_0x3dbf10);})['catch'](function(_0x41fe82){logger[_0xaf6e('0xe')]('ShowServicenowAccount',_0x41fe82[_0xaf6e('0x11')],_0x360fdf);_0x982d1(_0x1a2cea[_0xaf6e('0xe')](0x1f4,_0x41fe82['message']));});});};
\ No newline at end of file
+var _0x91bd=['model','stringify','ShowServicenowAccount','find','raw','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include','map'];(function(_0x1114a5,_0x560829){var _0x3031c4=function(_0x188e55){while(--_0x188e55){_0x1114a5['push'](_0x1114a5['shift']());}};_0x3031c4(++_0x560829);}(_0x91bd,0x1a5));var _0xd91b=function(_0x54f3e8,_0x3ed493){_0x54f3e8=_0x54f3e8-0x0;var _0x267b37=_0x91bd[_0x54f3e8];return _0x267b37;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd91b('0x0'));var rs=require(_0xd91b('0x1'));var fs=require('fs');var Redis=require(_0xd91b('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd91b('0x3'));var logger=require(_0xd91b('0x4'))('rpc');var config=require(_0xd91b('0x5'));var jayson=require(_0xd91b('0x6'));var client=jayson[_0xd91b('0x7')][_0xd91b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x494352,_0x4f73ab,_0x366078){return new BPromise(function(_0x312a4e,_0x2a67c3){return client['request'](_0x494352,_0x366078)[_0xd91b('0x9')](function(_0x503df6){logger[_0xd91b('0xa')](_0xd91b('0xb'),_0x4f73ab,_0xd91b('0xc'));logger[_0xd91b('0xd')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x4f73ab,_0xd91b('0xc'),JSON['stringify'](_0x503df6));if(_0x503df6[_0xd91b('0xe')]){if(_0x503df6['error']['code']===0x1f4){logger[_0xd91b('0xe')](_0xd91b('0xb'),_0x4f73ab,_0x503df6[_0xd91b('0xe')][_0xd91b('0xf')]);return _0x2a67c3(_0x503df6[_0xd91b('0xe')]['message']);}logger[_0xd91b('0xe')](_0xd91b('0xb'),_0x4f73ab,_0x503df6[_0xd91b('0xe')][_0xd91b('0xf')]);return _0x312a4e(_0x503df6[_0xd91b('0xe')][_0xd91b('0xf')]);}else{logger[_0xd91b('0xa')](_0xd91b('0xb'),_0x4f73ab,_0xd91b('0xc'));_0x312a4e(_0x503df6[_0xd91b('0x10')][_0xd91b('0xf')]);}})[_0xd91b('0x11')](function(_0x50cb8c){logger[_0xd91b('0xe')](_0xd91b('0xb'),_0x4f73ab,_0x50cb8c);_0x2a67c3(_0x50cb8c);});});}exports[_0xd91b('0x12')]=function(_0x31fed8){var _0x5da514=this;return new Promise(function(_0x547e83,_0x5741c2){return db[_0xd91b('0x13')][_0xd91b('0x14')]({'raw':_0x31fed8[_0xd91b('0x15')]?_0x31fed8['options']['raw']===undefined?!![]:![]:!![],'where':_0x31fed8[_0xd91b('0x15')]?_0x31fed8['options'][_0xd91b('0x16')]||null:null,'attributes':_0x31fed8[_0xd91b('0x15')]?_0x31fed8[_0xd91b('0x15')][_0xd91b('0x17')]||null:null,'limit':_0x31fed8[_0xd91b('0x15')]?_0x31fed8[_0xd91b('0x15')][_0xd91b('0x18')]||null:null,'include':_0x31fed8['options']?_0x31fed8[_0xd91b('0x15')][_0xd91b('0x19')]?_[_0xd91b('0x1a')](_0x31fed8[_0xd91b('0x15')][_0xd91b('0x19')],function(_0x457c47){return{'model':db[_0x457c47['model']],'as':_0x457c47['as'],'attributes':_0x457c47[_0xd91b('0x17')],'include':_0x457c47['include']?_[_0xd91b('0x1a')](_0x457c47['include'],function(_0x29552e){return{'model':db[_0x29552e[_0xd91b('0x1b')]],'as':_0x29552e['as'],'attributes':_0x29552e['attributes'],'include':_0x29552e[_0xd91b('0x19')]?_[_0xd91b('0x1a')](_0x29552e[_0xd91b('0x19')],function(_0x48c0){return{'model':db[_0x48c0[_0xd91b('0x1b')]],'as':_0x48c0['as'],'attributes':_0x48c0[_0xd91b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a68a1){logger[_0xd91b('0xa')](_0xd91b('0x12'),_0x31fed8);logger[_0xd91b('0xd')](_0xd91b('0x12'),_0x31fed8,JSON[_0xd91b('0x1c')](_0x5a68a1));_0x547e83(_0x5a68a1);})[_0xd91b('0x11')](function(_0x211f51){logger[_0xd91b('0xe')]('GetServicenowAccount',_0x211f51[_0xd91b('0xf')],_0x31fed8);_0x5741c2(_0x5da514[_0xd91b('0xe')](0x1f4,_0x211f51[_0xd91b('0xf')]));});});};exports[_0xd91b('0x1d')]=function(_0x474640){var _0x933de4=this;return new Promise(function(_0x4e2f96,_0x135182){return db[_0xd91b('0x13')][_0xd91b('0x1e')]({'raw':_0x474640['options']?_0x474640[_0xd91b('0x15')][_0xd91b('0x1f')]===undefined?!![]:![]:!![],'where':_0x474640[_0xd91b('0x15')]?_0x474640[_0xd91b('0x15')][_0xd91b('0x16')]||null:null,'attributes':_0x474640[_0xd91b('0x15')]?_0x474640[_0xd91b('0x15')][_0xd91b('0x17')]||null:null,'include':_0x474640[_0xd91b('0x15')]?_0x474640[_0xd91b('0x15')][_0xd91b('0x19')]?_[_0xd91b('0x1a')](_0x474640[_0xd91b('0x15')][_0xd91b('0x19')],function(_0x549acb){return{'model':db[_0x549acb['model']],'as':_0x549acb['as'],'attributes':_0x549acb[_0xd91b('0x17')],'include':_0x549acb[_0xd91b('0x19')]?_[_0xd91b('0x1a')](_0x549acb[_0xd91b('0x19')],function(_0x4d6c21){return{'model':db[_0x4d6c21['model']],'as':_0x4d6c21['as'],'attributes':_0x4d6c21[_0xd91b('0x17')],'include':_0x4d6c21[_0xd91b('0x19')]?_[_0xd91b('0x1a')](_0x4d6c21[_0xd91b('0x19')],function(_0xb8eb96){return{'model':db[_0xb8eb96[_0xd91b('0x1b')]],'as':_0xb8eb96['as'],'attributes':_0xb8eb96[_0xd91b('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d40e1){logger[_0xd91b('0xa')]('ShowServicenowAccount',_0x474640);logger[_0xd91b('0xd')](_0xd91b('0x1d'),_0x474640,JSON['stringify'](_0x4d40e1));_0x4e2f96(_0x4d40e1);})['catch'](function(_0x4a5390){logger['error'](_0xd91b('0x1d'),_0x4a5390['message'],_0x474640);_0x135182(_0x933de4['error'](0x1f4,_0x4a5390[_0xd91b('0xf')]));});});};
\ No newline at end of file
index db91f4b..6f780a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da0=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x60cd3c,_0x5d5257){var _0x21f85e=function(_0x367ab1){while(--_0x367ab1){_0x60cd3c['push'](_0x60cd3c['shift']());}};_0x21f85e(++_0x5d5257);}(_0x2da0,0x1e7));var _0x02da=function(_0x17074d,_0x5d516c){_0x17074d=_0x17074d-0x0;var _0x19a666=_0x2da0[_0x17074d];return _0x19a666;};'use strict';var multer=require(_0x02da('0x0'));var util=require(_0x02da('0x1'));var path=require(_0x02da('0x2'));var timeout=require(_0x02da('0x3'));var express=require(_0x02da('0x4'));var router=express[_0x02da('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x02da('0x6'));var interaction=require(_0x02da('0x7'));var config=require(_0x02da('0x8'));var controller=require(_0x02da('0x9'));router[_0x02da('0xa')]('/',auth[_0x02da('0xb')](),controller['index']);router['get']('/:id',auth[_0x02da('0xb')](),controller[_0x02da('0xc')]);router[_0x02da('0xa')](_0x02da('0xd'),auth[_0x02da('0xb')](),controller[_0x02da('0xe')]);router[_0x02da('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x02da('0xf')]);router[_0x02da('0xa')](_0x02da('0x10'),auth[_0x02da('0xb')](),controller[_0x02da('0x11')]);router[_0x02da('0x12')]('/',auth[_0x02da('0xb')](),controller['create']);router['put'](_0x02da('0x13'),auth[_0x02da('0xb')](),controller['update']);router[_0x02da('0x14')](_0x02da('0x13'),auth[_0x02da('0xb')](),controller[_0x02da('0x15')]);module[_0x02da('0x16')]=router;
\ No newline at end of file
+var _0xebd4=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','multer'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0xebd4,0x158));var _0x4ebd=function(_0x1a9374,_0x5955a1){_0x1a9374=_0x1a9374-0x0;var _0x5a4de2=_0xebd4[_0x1a9374];return _0x5a4de2;};'use strict';var multer=require(_0x4ebd('0x0'));var util=require(_0x4ebd('0x1'));var path=require(_0x4ebd('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ebd('0x3'));var router=express[_0x4ebd('0x4')]();var fs_extra=require(_0x4ebd('0x5'));var auth=require(_0x4ebd('0x6'));var interaction=require(_0x4ebd('0x7'));var config=require(_0x4ebd('0x8'));var controller=require(_0x4ebd('0x9'));router['get']('/',auth[_0x4ebd('0xa')](),controller[_0x4ebd('0xb')]);router[_0x4ebd('0xc')](_0x4ebd('0xd'),auth[_0x4ebd('0xa')](),controller['show']);router[_0x4ebd('0xc')](_0x4ebd('0xe'),auth[_0x4ebd('0xa')](),controller[_0x4ebd('0xf')]);router['get']('/:id/subjects',auth[_0x4ebd('0xa')](),controller[_0x4ebd('0x10')]);router['get'](_0x4ebd('0x11'),auth[_0x4ebd('0xa')](),controller[_0x4ebd('0x12')]);router[_0x4ebd('0x13')]('/',auth['isAuthenticated'](),controller[_0x4ebd('0x14')]);router[_0x4ebd('0x15')]('/:id',auth[_0x4ebd('0xa')](),controller['update']);router[_0x4ebd('0x16')](_0x4ebd('0xd'),auth[_0x4ebd('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index d8c371a..4f46cd5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5690=['sequelize','STRING'];(function(_0x31b350,_0x5be290){var _0x1870dc=function(_0xbae48d){while(--_0xbae48d){_0x31b350['push'](_0x31b350['shift']());}};_0x1870dc(++_0x5be290);}(_0x5690,0x19c));var _0x0569=function(_0x932e4c,_0x140353){_0x932e4c=_0x932e4c-0x0;var _0x5184d4=_0x5690[_0x932e4c];return _0x5184d4;};'use strict';var Sequelize=require(_0x0569('0x0'));module['exports']={'name':{'type':Sequelize[_0x0569('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xf050=['exports','STRING'];(function(_0x3f02e0,_0x3c2e29){var _0x4d193b=function(_0x5ef3a9){while(--_0x5ef3a9){_0x3f02e0['push'](_0x3f02e0['shift']());}};_0x4d193b(++_0x3c2e29);}(_0xf050,0x1a2));var _0x0f05=function(_0x220f3b,_0x34332d){_0x220f3b=_0x220f3b-0x0;var _0x752fb7=_0xf050[_0x220f3b];return _0x752fb7;};'use strict';var Sequelize=require('sequelize');module[_0x0f05('0x0')]={'name':{'type':Sequelize[_0x0f05('0x1')]},'description':{'type':Sequelize[_0x0f05('0x1')]}};
\ No newline at end of file
index 91b7ee6..658ed14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb776=['where','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','rows','show','params','merge','find','catch','create','body','getFields','findOne','sort','nolimit','getSubjects','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','pick','filter'];(function(_0x154b3b,_0x460227){var _0x59df89=function(_0x13dd8b){while(--_0x13dd8b){_0x154b3b['push'](_0x154b3b['shift']());}};_0x59df89(++_0x460227);}(_0xb776,0x67));var _0x6b77=function(_0x452906,_0x4617c9){_0x452906=_0x452906-0x0;var _0x2b1834=_0xb776[_0x452906];return _0x2b1834;};'use strict';var emlformat=require(_0x6b77('0x0'));var rimraf=require(_0x6b77('0x1'));var zipdir=require(_0x6b77('0x2'));var jsonpatch=require(_0x6b77('0x3'));var rp=require(_0x6b77('0x4'));var moment=require(_0x6b77('0x5'));var BPromise=require(_0x6b77('0x6'));var Mustache=require(_0x6b77('0x7'));var util=require('util');var path=require(_0x6b77('0x8'));var sox=require(_0x6b77('0x9'));var csv=require(_0x6b77('0xa'));var ejs=require(_0x6b77('0xb'));var fs=require('fs');var fs_extra=require(_0x6b77('0xc'));var _=require(_0x6b77('0xd'));var squel=require(_0x6b77('0xe'));var crypto=require(_0x6b77('0xf'));var jsforce=require(_0x6b77('0x10'));var deskjs=require(_0x6b77('0x11'));var toCsv=require(_0x6b77('0xa'));var querystring=require(_0x6b77('0x12'));var Papa=require(_0x6b77('0x13'));var Redis=require(_0x6b77('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x6b77('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b77('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6b77('0x17'));var db=require(_0x6b77('0x18'))['db'];function respondWithStatusCode(_0x28e323,_0x440cf1){_0x440cf1=_0x440cf1||0xcc;return function(_0x3a62e8){if(_0x3a62e8){return _0x28e323[_0x6b77('0x19')](_0x440cf1);}return _0x28e323[_0x6b77('0x1a')](_0x440cf1)[_0x6b77('0x1b')]();};}function respondWithResult(_0x2ec36f,_0x19cfda){_0x19cfda=_0x19cfda||0xc8;return function(_0x2b63c3){if(_0x2b63c3){return _0x2ec36f[_0x6b77('0x1a')](_0x19cfda)[_0x6b77('0x1c')](_0x2b63c3);}};}function respondWithFilteredResult(_0x2383d8,_0xb214d8){return function(_0x5d84a6){if(_0x5d84a6){var _0x3b7abe=typeof _0xb214d8[_0x6b77('0x1d')]==='undefined'&&typeof _0xb214d8[_0x6b77('0x1e')]===_0x6b77('0x1f');var _0x435b74=_0x5d84a6[_0x6b77('0x20')];var _0x435bd4=_0x3b7abe?0x0:_0xb214d8[_0x6b77('0x1d')];var _0x15e329=_0x3b7abe?_0x5d84a6[_0x6b77('0x20')]:_0xb214d8[_0x6b77('0x1d')]+_0xb214d8[_0x6b77('0x1e')];var _0x1098fa;if(_0x15e329>=_0x435b74){_0x15e329=_0x435b74;_0x1098fa=0xc8;}else{_0x1098fa=0xce;}_0x2383d8[_0x6b77('0x1a')](_0x1098fa);return _0x2383d8['set']('Content-Range',_0x435bd4+'-'+_0x15e329+'/'+_0x435b74)['json'](_0x5d84a6);}return null;};}function patchUpdates(_0x176091){return function(_0x10ae3f){try{jsonpatch[_0x6b77('0x21')](_0x10ae3f,_0x176091,!![]);}catch(_0x231863){return BPromise[_0x6b77('0x22')](_0x231863);}return _0x10ae3f[_0x6b77('0x23')]();};}function saveUpdates(_0x48b2c0,_0x2ed9b4){return function(_0xe60aaa){if(_0xe60aaa){return _0xe60aaa[_0x6b77('0x24')](_0x48b2c0)[_0x6b77('0x25')](function(_0x4cba16){return _0x4cba16;});}return null;};}function removeEntity(_0x25ddfd,_0x1f3bfe){return function(_0x369d22){if(_0x369d22){return _0x369d22[_0x6b77('0x26')]()[_0x6b77('0x25')](function(){_0x25ddfd['status'](0xcc)[_0x6b77('0x1b')]();});}};}function handleEntityNotFound(_0x49d50c,_0x3ab6fd){return function(_0x59d337){if(!_0x59d337){_0x49d50c[_0x6b77('0x19')](0x194);}return _0x59d337;};}function handleError(_0x31df30,_0x1b15bc){_0x1b15bc=_0x1b15bc||0x1f4;return function(_0xf4b744){logger['error'](_0xf4b744[_0x6b77('0x27')]);if(_0xf4b744[_0x6b77('0x28')]){delete _0xf4b744[_0x6b77('0x28')];}_0x31df30[_0x6b77('0x1a')](_0x1b15bc)[_0x6b77('0x29')](_0xf4b744);};}exports[_0x6b77('0x2a')]=function(_0x1c2708,_0x3e3f0f){var _0x3c8fd1={},_0x1dbba9={},_0x5a64b7={'count':0x0,'rows':[]};var _0x19c777=_[_0x6b77('0x2b')](db['ServicenowConfiguration'][_0x6b77('0x2c')],function(_0x444713){return{'name':_0x444713[_0x6b77('0x2d')],'type':_0x444713[_0x6b77('0x2e')]['key']};});_0x1dbba9[_0x6b77('0x2f')]=_['map'](_0x19c777,'name');_0x1dbba9['query']=_[_0x6b77('0x30')](_0x1c2708[_0x6b77('0x31')]);_0x1dbba9[_0x6b77('0x32')]=_[_0x6b77('0x33')](_0x1dbba9['model'],_0x1dbba9['query']);_0x3c8fd1['attributes']=_['intersection'](_0x1dbba9[_0x6b77('0x2f')],qs[_0x6b77('0x34')](_0x1c2708[_0x6b77('0x31')][_0x6b77('0x34')]));_0x3c8fd1[_0x6b77('0x35')]=_0x3c8fd1['attributes'][_0x6b77('0x36')]?_0x3c8fd1['attributes']:_0x1dbba9['model'];if(!_0x1c2708[_0x6b77('0x31')][_0x6b77('0x37')]('nolimit')){_0x3c8fd1['limit']=qs[_0x6b77('0x1e')](_0x1c2708[_0x6b77('0x31')][_0x6b77('0x1e')]);_0x3c8fd1[_0x6b77('0x1d')]=qs['offset'](_0x1c2708[_0x6b77('0x31')][_0x6b77('0x1d')]);}_0x3c8fd1[_0x6b77('0x38')]=qs['sort'](_0x1c2708[_0x6b77('0x31')]['sort']);_0x3c8fd1['where']=qs[_0x6b77('0x32')](_[_0x6b77('0x39')](_0x1c2708[_0x6b77('0x31')],_0x1dbba9[_0x6b77('0x32')]),_0x19c777);if(_0x1c2708['query'][_0x6b77('0x3a')]){_0x3c8fd1[_0x6b77('0x3b')]=_['merge'](_0x3c8fd1['where'],{'$or':_[_0x6b77('0x2b')](_0x19c777,function(_0x3a710a){if(_0x3a710a['type']!==_0x6b77('0x3c')){var _0x2f67d6={};_0x2f67d6[_0x3a710a[_0x6b77('0x28')]]={'$like':'%'+_0x1c2708['query'][_0x6b77('0x3a')]+'%'};return _0x2f67d6;}})});}_0x3c8fd1=_['merge']({},_0x3c8fd1,_0x1c2708[_0x6b77('0x3d')]);var _0xb615b2={'where':_0x3c8fd1[_0x6b77('0x3b')]};return db[_0x6b77('0x3e')][_0x6b77('0x20')](_0xb615b2)['then'](function(_0x570716){_0x5a64b7[_0x6b77('0x20')]=_0x570716;if(_0x1c2708[_0x6b77('0x31')][_0x6b77('0x3f')]){_0x3c8fd1[_0x6b77('0x40')]=[{'all':!![]}];}return db[_0x6b77('0x3e')][_0x6b77('0x41')](_0x3c8fd1);})[_0x6b77('0x25')](function(_0x46cac1){_0x5a64b7[_0x6b77('0x42')]=_0x46cac1;return _0x5a64b7;})[_0x6b77('0x25')](respondWithFilteredResult(_0x3e3f0f,_0x3c8fd1))['catch'](handleError(_0x3e3f0f,null));};exports[_0x6b77('0x43')]=function(_0x2ddcef,_0x511c8c){var _0x44d88a={'raw':![],'where':{'id':_0x2ddcef[_0x6b77('0x44')]['id']}},_0x51022b={};_0x51022b[_0x6b77('0x2f')]=_['keys'](db[_0x6b77('0x3e')][_0x6b77('0x2c')]);_0x51022b[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x2ddcef['query']);_0x51022b['filters']=_['intersection'](_0x51022b[_0x6b77('0x2f')],_0x51022b[_0x6b77('0x31')]);_0x44d88a[_0x6b77('0x35')]=_[_0x6b77('0x33')](_0x51022b[_0x6b77('0x2f')],qs[_0x6b77('0x34')](_0x2ddcef['query']['fields']));_0x44d88a['attributes']=_0x44d88a[_0x6b77('0x35')][_0x6b77('0x36')]?_0x44d88a['attributes']:_0x51022b[_0x6b77('0x2f')];if(_0x2ddcef[_0x6b77('0x31')]['includeAll']){_0x44d88a[_0x6b77('0x40')]=[{'all':!![]}];}_0x44d88a=_[_0x6b77('0x45')]({},_0x44d88a,_0x2ddcef[_0x6b77('0x3d')]);return db[_0x6b77('0x3e')][_0x6b77('0x46')](_0x44d88a)[_0x6b77('0x25')](handleEntityNotFound(_0x511c8c,null))[_0x6b77('0x25')](respondWithResult(_0x511c8c,null))[_0x6b77('0x47')](handleError(_0x511c8c,null));};exports[_0x6b77('0x48')]=function(_0x10bb71,_0x2ce695){return db['ServicenowConfiguration'][_0x6b77('0x48')](_0x10bb71[_0x6b77('0x49')],{})[_0x6b77('0x25')](respondWithResult(_0x2ce695,0xc9))[_0x6b77('0x47')](handleError(_0x2ce695,null));};exports['update']=function(_0x1ec307,_0x326c9a){if(_0x1ec307[_0x6b77('0x49')]['id']){delete _0x1ec307['body']['id'];}return db[_0x6b77('0x3e')][_0x6b77('0x46')]({'where':{'id':_0x1ec307[_0x6b77('0x44')]['id']}})[_0x6b77('0x25')](handleEntityNotFound(_0x326c9a,null))[_0x6b77('0x25')](saveUpdates(_0x1ec307[_0x6b77('0x49')],null))['then'](respondWithResult(_0x326c9a,null))[_0x6b77('0x47')](handleError(_0x326c9a,null));};exports[_0x6b77('0x26')]=function(_0x36bd12,_0x533f82){return db[_0x6b77('0x3e')][_0x6b77('0x46')]({'where':{'id':_0x36bd12[_0x6b77('0x44')]['id']}})[_0x6b77('0x25')](handleEntityNotFound(_0x533f82,null))[_0x6b77('0x25')](removeEntity(_0x533f82,null))[_0x6b77('0x47')](handleError(_0x533f82,null));};exports[_0x6b77('0x4a')]=function(_0x21e705,_0x29f225,_0x541e10){var _0x4091c6={};var _0x22b60b={};var _0x566d9c;var _0x37c198;return db['ServicenowConfiguration'][_0x6b77('0x4b')]({'where':{'id':_0x21e705[_0x6b77('0x44')]['id']}})[_0x6b77('0x25')](handleEntityNotFound(_0x29f225,null))['then'](function(_0x11116b){if(_0x11116b){_0x566d9c=_0x11116b;_0x22b60b[_0x6b77('0x2f')]=_[_0x6b77('0x30')](db['ServicenowField'][_0x6b77('0x2c')]);_0x22b60b['query']=_[_0x6b77('0x30')](_0x21e705[_0x6b77('0x31')]);_0x22b60b['filters']=_[_0x6b77('0x33')](_0x22b60b['model'],_0x22b60b[_0x6b77('0x31')]);_0x4091c6['attributes']=_[_0x6b77('0x33')](_0x22b60b[_0x6b77('0x2f')],qs['fields'](_0x21e705['query'][_0x6b77('0x34')]));_0x4091c6[_0x6b77('0x35')]=_0x4091c6['attributes'][_0x6b77('0x36')]?_0x4091c6[_0x6b77('0x35')]:_0x22b60b[_0x6b77('0x2f')];_0x4091c6[_0x6b77('0x38')]=qs[_0x6b77('0x4c')](_0x21e705[_0x6b77('0x31')][_0x6b77('0x4c')]);_0x4091c6[_0x6b77('0x3b')]=qs[_0x6b77('0x32')](_[_0x6b77('0x39')](_0x21e705[_0x6b77('0x31')],_0x22b60b['filters']));if(_0x21e705[_0x6b77('0x31')][_0x6b77('0x3a')]){_0x4091c6['where']=_[_0x6b77('0x45')](_0x4091c6[_0x6b77('0x3b')],{'$or':_[_0x6b77('0x2b')](_0x4091c6[_0x6b77('0x35')],function(_0x570411){var _0x2b3367={};_0x2b3367[_0x570411]={'$like':'%'+_0x21e705[_0x6b77('0x31')][_0x6b77('0x3a')]+'%'};return _0x2b3367;})});}_0x4091c6=_[_0x6b77('0x45')]({},_0x4091c6,_0x21e705[_0x6b77('0x3d')]);return _0x566d9c[_0x6b77('0x4a')](_0x4091c6);}})[_0x6b77('0x25')](function(_0x495fb7){if(_0x495fb7){_0x37c198=_0x495fb7[_0x6b77('0x36')];if(!_0x21e705[_0x6b77('0x31')][_0x6b77('0x37')]('nolimit')){_0x4091c6[_0x6b77('0x1e')]=qs[_0x6b77('0x1e')](_0x21e705[_0x6b77('0x31')]['limit']);_0x4091c6[_0x6b77('0x1d')]=qs[_0x6b77('0x1d')](_0x21e705[_0x6b77('0x31')][_0x6b77('0x1d')]);}return _0x566d9c[_0x6b77('0x4a')](_0x4091c6);}})[_0x6b77('0x25')](function(_0x37a669){if(_0x37a669){return _0x37a669?{'count':_0x37c198,'rows':_0x37a669}:null;}})[_0x6b77('0x25')](respondWithResult(_0x29f225,null))[_0x6b77('0x47')](handleError(_0x29f225,null));};exports['getSubjects']=function(_0x45a27a,_0x362bcb,_0x18b14a){var _0x3002c7={};var _0x2d2eb0={};var _0x33142d;var _0x24f4b0;return db['ServicenowConfiguration'][_0x6b77('0x4b')]({'where':{'id':_0x45a27a[_0x6b77('0x44')]['id']}})[_0x6b77('0x25')](handleEntityNotFound(_0x362bcb,null))['then'](function(_0x2d5403){if(_0x2d5403){_0x33142d=_0x2d5403;_0x2d2eb0[_0x6b77('0x2f')]=_[_0x6b77('0x30')](db['ServicenowField'][_0x6b77('0x2c')]);_0x2d2eb0[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x45a27a[_0x6b77('0x31')]);_0x2d2eb0[_0x6b77('0x32')]=_[_0x6b77('0x33')](_0x2d2eb0[_0x6b77('0x2f')],_0x2d2eb0[_0x6b77('0x31')]);_0x3002c7[_0x6b77('0x35')]=_[_0x6b77('0x33')](_0x2d2eb0[_0x6b77('0x2f')],qs[_0x6b77('0x34')](_0x45a27a[_0x6b77('0x31')][_0x6b77('0x34')]));_0x3002c7[_0x6b77('0x35')]=_0x3002c7[_0x6b77('0x35')]['length']?_0x3002c7[_0x6b77('0x35')]:_0x2d2eb0[_0x6b77('0x2f')];_0x3002c7[_0x6b77('0x38')]=qs['sort'](_0x45a27a[_0x6b77('0x31')]['sort']);_0x3002c7[_0x6b77('0x3b')]=qs[_0x6b77('0x32')](_[_0x6b77('0x39')](_0x45a27a['query'],_0x2d2eb0[_0x6b77('0x32')]));if(_0x45a27a['query'][_0x6b77('0x3a')]){_0x3002c7[_0x6b77('0x3b')]=_[_0x6b77('0x45')](_0x3002c7[_0x6b77('0x3b')],{'$or':_['map'](_0x3002c7[_0x6b77('0x35')],function(_0x5b456d){var _0x5944cb={};_0x5944cb[_0x5b456d]={'$like':'%'+_0x45a27a[_0x6b77('0x31')][_0x6b77('0x3a')]+'%'};return _0x5944cb;})});}_0x3002c7=_[_0x6b77('0x45')]({},_0x3002c7,_0x45a27a[_0x6b77('0x3d')]);return _0x33142d['getSubjects'](_0x3002c7);}})[_0x6b77('0x25')](function(_0x574f98){if(_0x574f98){_0x24f4b0=_0x574f98['length'];if(!_0x45a27a[_0x6b77('0x31')][_0x6b77('0x37')](_0x6b77('0x4d'))){_0x3002c7[_0x6b77('0x1e')]=qs[_0x6b77('0x1e')](_0x45a27a[_0x6b77('0x31')][_0x6b77('0x1e')]);_0x3002c7[_0x6b77('0x1d')]=qs[_0x6b77('0x1d')](_0x45a27a[_0x6b77('0x31')][_0x6b77('0x1d')]);}return _0x33142d[_0x6b77('0x4e')](_0x3002c7);}})[_0x6b77('0x25')](function(_0x56ba7d){if(_0x56ba7d){return _0x56ba7d?{'count':_0x24f4b0,'rows':_0x56ba7d}:null;}})[_0x6b77('0x25')](respondWithResult(_0x362bcb,null))[_0x6b77('0x47')](handleError(_0x362bcb,null));};exports['getDescriptions']=function(_0x5c2783,_0x5002c6,_0x5d36e6){var _0x3b93a1={};var _0x555390={};var _0x3f26e2;var _0x1b98ff;return db['ServicenowConfiguration'][_0x6b77('0x4b')]({'where':{'id':_0x5c2783[_0x6b77('0x44')]['id']}})[_0x6b77('0x25')](handleEntityNotFound(_0x5002c6,null))[_0x6b77('0x25')](function(_0xf9367d){if(_0xf9367d){_0x3f26e2=_0xf9367d;_0x555390[_0x6b77('0x2f')]=_[_0x6b77('0x30')](db[_0x6b77('0x4f')][_0x6b77('0x2c')]);_0x555390[_0x6b77('0x31')]=_[_0x6b77('0x30')](_0x5c2783[_0x6b77('0x31')]);_0x555390[_0x6b77('0x32')]=_[_0x6b77('0x33')](_0x555390[_0x6b77('0x2f')],_0x555390[_0x6b77('0x31')]);_0x3b93a1[_0x6b77('0x35')]=_['intersection'](_0x555390[_0x6b77('0x2f')],qs[_0x6b77('0x34')](_0x5c2783['query'][_0x6b77('0x34')]));_0x3b93a1[_0x6b77('0x35')]=_0x3b93a1['attributes'][_0x6b77('0x36')]?_0x3b93a1[_0x6b77('0x35')]:_0x555390[_0x6b77('0x2f')];_0x3b93a1['order']=qs['sort'](_0x5c2783['query'][_0x6b77('0x4c')]);_0x3b93a1[_0x6b77('0x3b')]=qs[_0x6b77('0x32')](_[_0x6b77('0x39')](_0x5c2783[_0x6b77('0x31')],_0x555390[_0x6b77('0x32')]));if(_0x5c2783['query'][_0x6b77('0x3a')]){_0x3b93a1[_0x6b77('0x3b')]=_[_0x6b77('0x45')](_0x3b93a1[_0x6b77('0x3b')],{'$or':_[_0x6b77('0x2b')](_0x3b93a1['attributes'],function(_0x4866c9){var _0x749e7b={};_0x749e7b[_0x4866c9]={'$like':'%'+_0x5c2783[_0x6b77('0x31')]['filter']+'%'};return _0x749e7b;})});}_0x3b93a1=_[_0x6b77('0x45')]({},_0x3b93a1,_0x5c2783[_0x6b77('0x3d')]);return _0x3f26e2['getDescriptions'](_0x3b93a1);}})[_0x6b77('0x25')](function(_0xb6f261){if(_0xb6f261){_0x1b98ff=_0xb6f261[_0x6b77('0x36')];if(!_0x5c2783['query'][_0x6b77('0x37')](_0x6b77('0x4d'))){_0x3b93a1[_0x6b77('0x1e')]=qs[_0x6b77('0x1e')](_0x5c2783[_0x6b77('0x31')][_0x6b77('0x1e')]);_0x3b93a1['offset']=qs[_0x6b77('0x1d')](_0x5c2783[_0x6b77('0x31')]['offset']);}return _0x3f26e2[_0x6b77('0x50')](_0x3b93a1);}})[_0x6b77('0x25')](function(_0xe2c148){if(_0xe2c148){return _0xe2c148?{'count':_0x1b98ff,'rows':_0xe2c148}:null;}})[_0x6b77('0x25')](respondWithResult(_0x5002c6,null))['catch'](handleError(_0x5002c6,null));};
\ No newline at end of file
+var _0x506d=['filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','getFields','findOne','hasOwnProperty','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','reject','save','destroy','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','nolimit','sort','where'];(function(_0x4336dd,_0x3d8bf5){var _0x17f3b3=function(_0x41ca64){while(--_0x41ca64){_0x4336dd['push'](_0x4336dd['shift']());}};_0x17f3b3(++_0x3d8bf5);}(_0x506d,0x69));var _0xd506=function(_0x4e6b73,_0x42aba8){_0x4e6b73=_0x4e6b73-0x0;var _0x5d6d84=_0x506d[_0x4e6b73];return _0x5d6d84;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd506('0x0'));var zipdir=require(_0xd506('0x1'));var jsonpatch=require(_0xd506('0x2'));var rp=require(_0xd506('0x3'));var moment=require(_0xd506('0x4'));var BPromise=require(_0xd506('0x5'));var Mustache=require(_0xd506('0x6'));var util=require(_0xd506('0x7'));var path=require('path');var sox=require(_0xd506('0x8'));var csv=require(_0xd506('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd506('0xa'));var _=require(_0xd506('0xb'));var squel=require(_0xd506('0xc'));var crypto=require(_0xd506('0xd'));var jsforce=require(_0xd506('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd506('0x9'));var querystring=require(_0xd506('0xf'));var Papa=require(_0xd506('0x10'));var Redis=require(_0xd506('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd506('0x12'));var as=require(_0xd506('0x13'));var hardwareService=require(_0xd506('0x14'));var logger=require(_0xd506('0x15'))(_0xd506('0x16'));var utils=require(_0xd506('0x17'));var config=require(_0xd506('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd506('0x19'))['db'];function respondWithStatusCode(_0x3dfd58,_0x475f43){_0x475f43=_0x475f43||0xcc;return function(_0x2796f7){if(_0x2796f7){return _0x3dfd58[_0xd506('0x1a')](_0x475f43);}return _0x3dfd58[_0xd506('0x1b')](_0x475f43)[_0xd506('0x1c')]();};}function respondWithResult(_0x4a0f8b,_0xb97f93){_0xb97f93=_0xb97f93||0xc8;return function(_0x100d05){if(_0x100d05){return _0x4a0f8b[_0xd506('0x1b')](_0xb97f93)['json'](_0x100d05);}};}function respondWithFilteredResult(_0x118637,_0x40f903){return function(_0x32049b){if(_0x32049b){var _0x4e4692=typeof _0x40f903['offset']===_0xd506('0x1d')&&typeof _0x40f903[_0xd506('0x1e')]==='undefined';var _0x590afe=_0x32049b[_0xd506('0x1f')];var _0x18e7a8=_0x4e4692?0x0:_0x40f903['offset'];var _0x31e9df=_0x4e4692?_0x32049b[_0xd506('0x1f')]:_0x40f903[_0xd506('0x20')]+_0x40f903['limit'];var _0x218622;if(_0x31e9df>=_0x590afe){_0x31e9df=_0x590afe;_0x218622=0xc8;}else{_0x218622=0xce;}_0x118637['status'](_0x218622);return _0x118637[_0xd506('0x21')](_0xd506('0x22'),_0x18e7a8+'-'+_0x31e9df+'/'+_0x590afe)[_0xd506('0x23')](_0x32049b);}return null;};}function patchUpdates(_0x1c39f9){return function(_0x48a92b){try{jsonpatch['apply'](_0x48a92b,_0x1c39f9,!![]);}catch(_0x2a7a56){return BPromise[_0xd506('0x24')](_0x2a7a56);}return _0x48a92b[_0xd506('0x25')]();};}function saveUpdates(_0xd7d1ba,_0x3b32b7){return function(_0x37be6c){if(_0x37be6c){return _0x37be6c['update'](_0xd7d1ba)['then'](function(_0x44013d){return _0x44013d;});}return null;};}function removeEntity(_0x37f628,_0x210f9e){return function(_0x2677e6){if(_0x2677e6){return _0x2677e6[_0xd506('0x26')]()['then'](function(){_0x37f628[_0xd506('0x1b')](0xcc)[_0xd506('0x1c')]();});}};}function handleEntityNotFound(_0x5184d7,_0x54927d){return function(_0x69e8ea){if(!_0x69e8ea){_0x5184d7[_0xd506('0x1a')](0x194);}return _0x69e8ea;};}function handleError(_0x18e725,_0x34e0df){_0x34e0df=_0x34e0df||0x1f4;return function(_0x5244e6){logger[_0xd506('0x27')](_0x5244e6[_0xd506('0x28')]);if(_0x5244e6['name']){delete _0x5244e6[_0xd506('0x29')];}_0x18e725[_0xd506('0x1b')](_0x34e0df)[_0xd506('0x2a')](_0x5244e6);};}exports['index']=function(_0x43ae8e,_0x1f0c3f){var _0x275a06={},_0x582817={},_0x26d62d={'count':0x0,'rows':[]};var _0x328d75=_[_0xd506('0x2b')](db[_0xd506('0x2c')][_0xd506('0x2d')],function(_0x516047){return{'name':_0x516047[_0xd506('0x2e')],'type':_0x516047['type'][_0xd506('0x2f')]};});_0x582817[_0xd506('0x30')]=_['map'](_0x328d75,_0xd506('0x29'));_0x582817[_0xd506('0x31')]=_[_0xd506('0x32')](_0x43ae8e[_0xd506('0x31')]);_0x582817['filters']=_[_0xd506('0x33')](_0x582817[_0xd506('0x30')],_0x582817[_0xd506('0x31')]);_0x275a06['attributes']=_['intersection'](_0x582817[_0xd506('0x30')],qs[_0xd506('0x34')](_0x43ae8e[_0xd506('0x31')]['fields']));_0x275a06['attributes']=_0x275a06[_0xd506('0x35')]['length']?_0x275a06[_0xd506('0x35')]:_0x582817[_0xd506('0x30')];if(!_0x43ae8e[_0xd506('0x31')]['hasOwnProperty'](_0xd506('0x36'))){_0x275a06[_0xd506('0x1e')]=qs['limit'](_0x43ae8e[_0xd506('0x31')][_0xd506('0x1e')]);_0x275a06[_0xd506('0x20')]=qs[_0xd506('0x20')](_0x43ae8e['query']['offset']);}_0x275a06['order']=qs[_0xd506('0x37')](_0x43ae8e['query'][_0xd506('0x37')]);_0x275a06[_0xd506('0x38')]=qs[_0xd506('0x39')](_[_0xd506('0x3a')](_0x43ae8e[_0xd506('0x31')],_0x582817['filters']),_0x328d75);if(_0x43ae8e[_0xd506('0x31')][_0xd506('0x3b')]){_0x275a06[_0xd506('0x38')]=_[_0xd506('0x3c')](_0x275a06[_0xd506('0x38')],{'$or':_[_0xd506('0x2b')](_0x328d75,function(_0x2c196d){if(_0x2c196d['type']!==_0xd506('0x3d')){var _0x1d58fb={};_0x1d58fb[_0x2c196d[_0xd506('0x29')]]={'$like':'%'+_0x43ae8e[_0xd506('0x31')][_0xd506('0x3b')]+'%'};return _0x1d58fb;}})});}_0x275a06=_[_0xd506('0x3c')]({},_0x275a06,_0x43ae8e[_0xd506('0x3e')]);var _0x2772dd={'where':_0x275a06[_0xd506('0x38')]};return db['ServicenowConfiguration'][_0xd506('0x1f')](_0x2772dd)[_0xd506('0x3f')](function(_0x5dd85f){_0x26d62d[_0xd506('0x1f')]=_0x5dd85f;if(_0x43ae8e[_0xd506('0x31')][_0xd506('0x40')]){_0x275a06[_0xd506('0x41')]=[{'all':!![]}];}return db[_0xd506('0x2c')][_0xd506('0x42')](_0x275a06);})[_0xd506('0x3f')](function(_0x31b1ca){_0x26d62d[_0xd506('0x43')]=_0x31b1ca;return _0x26d62d;})[_0xd506('0x3f')](respondWithFilteredResult(_0x1f0c3f,_0x275a06))[_0xd506('0x44')](handleError(_0x1f0c3f,null));};exports['show']=function(_0x4e7d6f,_0xf0b3b5){var _0x4f129b={'raw':![],'where':{'id':_0x4e7d6f[_0xd506('0x45')]['id']}},_0x59c725={};_0x59c725[_0xd506('0x30')]=_[_0xd506('0x32')](db[_0xd506('0x2c')][_0xd506('0x2d')]);_0x59c725['query']=_[_0xd506('0x32')](_0x4e7d6f[_0xd506('0x31')]);_0x59c725['filters']=_[_0xd506('0x33')](_0x59c725[_0xd506('0x30')],_0x59c725[_0xd506('0x31')]);_0x4f129b[_0xd506('0x35')]=_[_0xd506('0x33')](_0x59c725['model'],qs[_0xd506('0x34')](_0x4e7d6f[_0xd506('0x31')][_0xd506('0x34')]));_0x4f129b[_0xd506('0x35')]=_0x4f129b[_0xd506('0x35')][_0xd506('0x46')]?_0x4f129b[_0xd506('0x35')]:_0x59c725[_0xd506('0x30')];if(_0x4e7d6f['query'][_0xd506('0x40')]){_0x4f129b[_0xd506('0x41')]=[{'all':!![]}];}_0x4f129b=_[_0xd506('0x3c')]({},_0x4f129b,_0x4e7d6f['options']);return db['ServicenowConfiguration'][_0xd506('0x47')](_0x4f129b)[_0xd506('0x3f')](handleEntityNotFound(_0xf0b3b5,null))['then'](respondWithResult(_0xf0b3b5,null))['catch'](handleError(_0xf0b3b5,null));};exports['create']=function(_0x987ffa,_0x20a76f){return db[_0xd506('0x2c')][_0xd506('0x48')](_0x987ffa['body'],{})[_0xd506('0x3f')](respondWithResult(_0x20a76f,0xc9))[_0xd506('0x44')](handleError(_0x20a76f,null));};exports[_0xd506('0x49')]=function(_0x20dba2,_0x110ceb){if(_0x20dba2['body']['id']){delete _0x20dba2['body']['id'];}return db[_0xd506('0x2c')][_0xd506('0x47')]({'where':{'id':_0x20dba2['params']['id']}})[_0xd506('0x3f')](handleEntityNotFound(_0x110ceb,null))[_0xd506('0x3f')](saveUpdates(_0x20dba2[_0xd506('0x4a')],null))[_0xd506('0x3f')](respondWithResult(_0x110ceb,null))[_0xd506('0x44')](handleError(_0x110ceb,null));};exports['destroy']=function(_0x18e059,_0x1f5b75){return db[_0xd506('0x2c')][_0xd506('0x47')]({'where':{'id':_0x18e059[_0xd506('0x45')]['id']}})[_0xd506('0x3f')](handleEntityNotFound(_0x1f5b75,null))[_0xd506('0x3f')](removeEntity(_0x1f5b75,null))[_0xd506('0x44')](handleError(_0x1f5b75,null));};exports[_0xd506('0x4b')]=function(_0x2c881f,_0x474a14,_0xd0a03f){var _0x56d975={};var _0x270740={};var _0x46acc8;var _0xe2b586;return db[_0xd506('0x2c')][_0xd506('0x4c')]({'where':{'id':_0x2c881f[_0xd506('0x45')]['id']}})[_0xd506('0x3f')](handleEntityNotFound(_0x474a14,null))[_0xd506('0x3f')](function(_0x1531e1){if(_0x1531e1){_0x46acc8=_0x1531e1;_0x270740[_0xd506('0x30')]=_['keys'](db['ServicenowField'][_0xd506('0x2d')]);_0x270740[_0xd506('0x31')]=_[_0xd506('0x32')](_0x2c881f[_0xd506('0x31')]);_0x270740[_0xd506('0x39')]=_[_0xd506('0x33')](_0x270740['model'],_0x270740[_0xd506('0x31')]);_0x56d975['attributes']=_['intersection'](_0x270740[_0xd506('0x30')],qs[_0xd506('0x34')](_0x2c881f[_0xd506('0x31')][_0xd506('0x34')]));_0x56d975[_0xd506('0x35')]=_0x56d975[_0xd506('0x35')][_0xd506('0x46')]?_0x56d975[_0xd506('0x35')]:_0x270740[_0xd506('0x30')];_0x56d975['order']=qs[_0xd506('0x37')](_0x2c881f[_0xd506('0x31')][_0xd506('0x37')]);_0x56d975[_0xd506('0x38')]=qs['filters'](_['pick'](_0x2c881f[_0xd506('0x31')],_0x270740['filters']));if(_0x2c881f[_0xd506('0x31')]['filter']){_0x56d975['where']=_[_0xd506('0x3c')](_0x56d975[_0xd506('0x38')],{'$or':_[_0xd506('0x2b')](_0x56d975[_0xd506('0x35')],function(_0x5f0761){var _0x3c1c27={};_0x3c1c27[_0x5f0761]={'$like':'%'+_0x2c881f[_0xd506('0x31')][_0xd506('0x3b')]+'%'};return _0x3c1c27;})});}_0x56d975=_[_0xd506('0x3c')]({},_0x56d975,_0x2c881f[_0xd506('0x3e')]);return _0x46acc8[_0xd506('0x4b')](_0x56d975);}})[_0xd506('0x3f')](function(_0x5062cb){if(_0x5062cb){_0xe2b586=_0x5062cb[_0xd506('0x46')];if(!_0x2c881f[_0xd506('0x31')][_0xd506('0x4d')]('nolimit')){_0x56d975['limit']=qs[_0xd506('0x1e')](_0x2c881f[_0xd506('0x31')]['limit']);_0x56d975[_0xd506('0x20')]=qs[_0xd506('0x20')](_0x2c881f['query']['offset']);}return _0x46acc8[_0xd506('0x4b')](_0x56d975);}})[_0xd506('0x3f')](function(_0x1aea22){if(_0x1aea22){return _0x1aea22?{'count':_0xe2b586,'rows':_0x1aea22}:null;}})[_0xd506('0x3f')](respondWithResult(_0x474a14,null))[_0xd506('0x44')](handleError(_0x474a14,null));};exports[_0xd506('0x4e')]=function(_0x1b06d6,_0x1f4a14,_0x1dc725){var _0x4e9e9c={};var _0x2f5911={};var _0x33e1a6;var _0x1067ef;return db['ServicenowConfiguration'][_0xd506('0x4c')]({'where':{'id':_0x1b06d6['params']['id']}})['then'](handleEntityNotFound(_0x1f4a14,null))[_0xd506('0x3f')](function(_0x1a52f4){if(_0x1a52f4){_0x33e1a6=_0x1a52f4;_0x2f5911['model']=_[_0xd506('0x32')](db['ServicenowField'][_0xd506('0x2d')]);_0x2f5911[_0xd506('0x31')]=_[_0xd506('0x32')](_0x1b06d6[_0xd506('0x31')]);_0x2f5911[_0xd506('0x39')]=_[_0xd506('0x33')](_0x2f5911[_0xd506('0x30')],_0x2f5911['query']);_0x4e9e9c[_0xd506('0x35')]=_[_0xd506('0x33')](_0x2f5911['model'],qs[_0xd506('0x34')](_0x1b06d6[_0xd506('0x31')][_0xd506('0x34')]));_0x4e9e9c[_0xd506('0x35')]=_0x4e9e9c['attributes'][_0xd506('0x46')]?_0x4e9e9c[_0xd506('0x35')]:_0x2f5911['model'];_0x4e9e9c[_0xd506('0x4f')]=qs[_0xd506('0x37')](_0x1b06d6[_0xd506('0x31')]['sort']);_0x4e9e9c['where']=qs['filters'](_[_0xd506('0x3a')](_0x1b06d6[_0xd506('0x31')],_0x2f5911[_0xd506('0x39')]));if(_0x1b06d6[_0xd506('0x31')][_0xd506('0x3b')]){_0x4e9e9c['where']=_[_0xd506('0x3c')](_0x4e9e9c[_0xd506('0x38')],{'$or':_[_0xd506('0x2b')](_0x4e9e9c[_0xd506('0x35')],function(_0x5c931b){var _0xd8909={};_0xd8909[_0x5c931b]={'$like':'%'+_0x1b06d6[_0xd506('0x31')][_0xd506('0x3b')]+'%'};return _0xd8909;})});}_0x4e9e9c=_[_0xd506('0x3c')]({},_0x4e9e9c,_0x1b06d6[_0xd506('0x3e')]);return _0x33e1a6[_0xd506('0x4e')](_0x4e9e9c);}})[_0xd506('0x3f')](function(_0xf7311){if(_0xf7311){_0x1067ef=_0xf7311[_0xd506('0x46')];if(!_0x1b06d6[_0xd506('0x31')][_0xd506('0x4d')](_0xd506('0x36'))){_0x4e9e9c['limit']=qs[_0xd506('0x1e')](_0x1b06d6[_0xd506('0x31')][_0xd506('0x1e')]);_0x4e9e9c[_0xd506('0x20')]=qs[_0xd506('0x20')](_0x1b06d6[_0xd506('0x31')][_0xd506('0x20')]);}return _0x33e1a6[_0xd506('0x4e')](_0x4e9e9c);}})[_0xd506('0x3f')](function(_0x3cb86d){if(_0x3cb86d){return _0x3cb86d?{'count':_0x1067ef,'rows':_0x3cb86d}:null;}})[_0xd506('0x3f')](respondWithResult(_0x1f4a14,null))[_0xd506('0x44')](handleError(_0x1f4a14,null));};exports[_0xd506('0x50')]=function(_0x2f19c2,_0x3840b6,_0x57bfb3){var _0x18db94={};var _0x41245b={};var _0x44c486;var _0x2a7220;return db[_0xd506('0x2c')]['findOne']({'where':{'id':_0x2f19c2['params']['id']}})[_0xd506('0x3f')](handleEntityNotFound(_0x3840b6,null))[_0xd506('0x3f')](function(_0x3c61a7){if(_0x3c61a7){_0x44c486=_0x3c61a7;_0x41245b[_0xd506('0x30')]=_['keys'](db['ServicenowField']['rawAttributes']);_0x41245b['query']=_[_0xd506('0x32')](_0x2f19c2[_0xd506('0x31')]);_0x41245b[_0xd506('0x39')]=_[_0xd506('0x33')](_0x41245b[_0xd506('0x30')],_0x41245b['query']);_0x18db94[_0xd506('0x35')]=_[_0xd506('0x33')](_0x41245b[_0xd506('0x30')],qs[_0xd506('0x34')](_0x2f19c2[_0xd506('0x31')]['fields']));_0x18db94[_0xd506('0x35')]=_0x18db94[_0xd506('0x35')][_0xd506('0x46')]?_0x18db94[_0xd506('0x35')]:_0x41245b[_0xd506('0x30')];_0x18db94[_0xd506('0x4f')]=qs[_0xd506('0x37')](_0x2f19c2[_0xd506('0x31')][_0xd506('0x37')]);_0x18db94[_0xd506('0x38')]=qs[_0xd506('0x39')](_[_0xd506('0x3a')](_0x2f19c2[_0xd506('0x31')],_0x41245b[_0xd506('0x39')]));if(_0x2f19c2['query']['filter']){_0x18db94['where']=_[_0xd506('0x3c')](_0x18db94['where'],{'$or':_[_0xd506('0x2b')](_0x18db94[_0xd506('0x35')],function(_0x3f8feb){var _0x33dfe8={};_0x33dfe8[_0x3f8feb]={'$like':'%'+_0x2f19c2[_0xd506('0x31')]['filter']+'%'};return _0x33dfe8;})});}_0x18db94=_[_0xd506('0x3c')]({},_0x18db94,_0x2f19c2['options']);return _0x44c486[_0xd506('0x50')](_0x18db94);}})['then'](function(_0x2b6b48){if(_0x2b6b48){_0x2a7220=_0x2b6b48[_0xd506('0x46')];if(!_0x2f19c2['query'][_0xd506('0x4d')](_0xd506('0x36'))){_0x18db94[_0xd506('0x1e')]=qs[_0xd506('0x1e')](_0x2f19c2[_0xd506('0x31')]['limit']);_0x18db94['offset']=qs[_0xd506('0x20')](_0x2f19c2[_0xd506('0x31')][_0xd506('0x20')]);}return _0x44c486[_0xd506('0x50')](_0x18db94);}})[_0xd506('0x3f')](function(_0x18384d){if(_0x18384d){return _0x18384d?{'count':_0x2a7220,'rows':_0x18384d}:null;}})[_0xd506('0x3f')](respondWithResult(_0x3840b6,null))[_0xd506('0x44')](handleError(_0x3840b6,null));};
\ No newline at end of file
index 53fbe71..e07a3f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160f=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','int_servicenow_configurations'];(function(_0x5779a5,_0x16fec3){var _0x239c18=function(_0x331cb9){while(--_0x331cb9){_0x5779a5['push'](_0x5779a5['shift']());}};_0x239c18(++_0x16fec3);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var logger=require(_0xf160('0x2'))(_0xf160('0x3'));var moment=require('moment');var BPromise=require(_0xf160('0x4'));var rp=require(_0xf160('0x5'));var fs=require('fs');var path=require(_0xf160('0x6'));var rimraf=require(_0xf160('0x7'));var config=require(_0xf160('0x8'));var attributes=require(_0xf160('0x9'));module['exports']=function(_0x311d63,_0x11902f){return _0x311d63['define']('ServicenowConfiguration',attributes,{'tableName':_0xf160('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3423=['ServicenowConfiguration','int_servicenow_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define'];(function(_0x2f6974,_0x38953d){var _0x2e3620=function(_0x256aa9){while(--_0x256aa9){_0x2f6974['push'](_0x2f6974['shift']());}};_0x2e3620(++_0x38953d);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3342('0x0'))(_0x3342('0x1'));var moment=require(_0x3342('0x2'));var BPromise=require(_0x3342('0x3'));var rp=require(_0x3342('0x4'));var fs=require('fs');var path=require(_0x3342('0x5'));var rimraf=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var attributes=require(_0x3342('0x8'));module[_0x3342('0x9')]=function(_0x467453,_0x2ccbe0){return _0x467453[_0x3342('0xa')](_0x3342('0xb'),attributes,{'tableName':_0x3342('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 053386f..842fa9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf12f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','catch'];(function(_0x5cbcdf,_0x2224a4){var _0x4be16f=function(_0x12665c){while(--_0x12665c){_0x5cbcdf['push'](_0x5cbcdf['shift']());}};_0x4be16f(++_0x2224a4);}(_0xf12f,0x78));var _0xff12=function(_0x452750,_0x26d412){_0x452750=_0x452750-0x0;var _0xd484b7=_0xf12f[_0x452750];return _0xd484b7;};'use strict';var _=require('lodash');var util=require(_0xff12('0x0'));var moment=require(_0xff12('0x1'));var BPromise=require(_0xff12('0x2'));var rs=require(_0xff12('0x3'));var fs=require('fs');var Redis=require(_0xff12('0x4'));var db=require(_0xff12('0x5'))['db'];var utils=require(_0xff12('0x6'));var logger=require(_0xff12('0x7'))(_0xff12('0x8'));var config=require('../../config/environment');var jayson=require(_0xff12('0x9'));var client=jayson[_0xff12('0xa')][_0xff12('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53d02f,_0x85537c,_0xad3920){return new BPromise(function(_0x38c663,_0x3dfdab){return client[_0xff12('0xc')](_0x53d02f,_0xad3920)[_0xff12('0xd')](function(_0x39a9cc){logger[_0xff12('0xe')]('ServicenowConfiguration,\x20%s,\x20%s',_0x85537c,_0xff12('0xf'));logger[_0xff12('0x10')](_0xff12('0x11'),_0x85537c,_0xff12('0xf'),JSON['stringify'](_0x39a9cc));if(_0x39a9cc[_0xff12('0x12')]){if(_0x39a9cc[_0xff12('0x12')][_0xff12('0x13')]===0x1f4){logger[_0xff12('0x12')](_0xff12('0x14'),_0x85537c,_0x39a9cc[_0xff12('0x12')][_0xff12('0x15')]);return _0x3dfdab(_0x39a9cc['error'][_0xff12('0x15')]);}logger[_0xff12('0x12')](_0xff12('0x14'),_0x85537c,_0x39a9cc[_0xff12('0x12')][_0xff12('0x15')]);return _0x38c663(_0x39a9cc[_0xff12('0x12')][_0xff12('0x15')]);}else{logger[_0xff12('0xe')](_0xff12('0x14'),_0x85537c,'request\x20sent');_0x38c663(_0x39a9cc[_0xff12('0x16')][_0xff12('0x15')]);}})[_0xff12('0x17')](function(_0x21162b){logger[_0xff12('0x12')](_0xff12('0x14'),_0x85537c,_0x21162b);_0x3dfdab(_0x21162b);});});}
\ No newline at end of file
+var _0xfb8f=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x2583e2,_0x42cbc8){var _0x1aa53d=function(_0x2379a2){while(--_0x2379a2){_0x2583e2['push'](_0x2583e2['shift']());}};_0x1aa53d(++_0x42cbc8);}(_0xfb8f,0x18c));var _0xffb8=function(_0xd95413,_0x6677e5){_0xd95413=_0xd95413-0x0;var _0x3bf173=_0xfb8f[_0xd95413];return _0x3bf173;};'use strict';var _=require('lodash');var util=require(_0xffb8('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xffb8('0x1'));var fs=require('fs');var Redis=require(_0xffb8('0x2'));var db=require(_0xffb8('0x3'))['db'];var utils=require(_0xffb8('0x4'));var logger=require(_0xffb8('0x5'))('rpc');var config=require(_0xffb8('0x6'));var jayson=require(_0xffb8('0x7'));var client=jayson[_0xffb8('0x8')][_0xffb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5a70ab,_0x57a38f,_0x33495b){return new BPromise(function(_0xb71c21,_0x2b892a){return client[_0xffb8('0xa')](_0x5a70ab,_0x33495b)[_0xffb8('0xb')](function(_0x487759){logger['info'](_0xffb8('0xc'),_0x57a38f,_0xffb8('0xd'));logger[_0xffb8('0xe')](_0xffb8('0xf'),_0x57a38f,_0xffb8('0xd'),JSON['stringify'](_0x487759));if(_0x487759[_0xffb8('0x10')]){if(_0x487759[_0xffb8('0x10')][_0xffb8('0x11')]===0x1f4){logger[_0xffb8('0x10')](_0xffb8('0xc'),_0x57a38f,_0x487759['error'][_0xffb8('0x12')]);return _0x2b892a(_0x487759[_0xffb8('0x10')][_0xffb8('0x12')]);}logger['error'](_0xffb8('0xc'),_0x57a38f,_0x487759['error']['message']);return _0xb71c21(_0x487759[_0xffb8('0x10')][_0xffb8('0x12')]);}else{logger[_0xffb8('0x13')](_0xffb8('0xc'),_0x57a38f,_0xffb8('0xd'));_0xb71c21(_0x487759[_0xffb8('0x14')][_0xffb8('0x12')]);}})[_0xffb8('0x15')](function(_0x1a310e){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x57a38f,_0x1a310e);_0x2b892a(_0x1a310e);});});}
\ No newline at end of file
index 5552800..e8c5c84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb7d=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intServicenowField.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy'];(function(_0x13e20e,_0x11988d){var _0x24d6d7=function(_0x3e34e0){while(--_0x3e34e0){_0x13e20e['push'](_0x13e20e['shift']());}};_0x24d6d7(++_0x11988d);}(_0xeb7d,0x91));var _0xdeb7=function(_0xc6e68,_0x102de0){_0xc6e68=_0xc6e68-0x0;var _0x30dd69=_0xeb7d[_0xc6e68];return _0x30dd69;};'use strict';var multer=require(_0xdeb7('0x0'));var util=require(_0xdeb7('0x1'));var path=require(_0xdeb7('0x2'));var timeout=require(_0xdeb7('0x3'));var express=require('express');var router=express[_0xdeb7('0x4')]();var fs_extra=require(_0xdeb7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdeb7('0x6'));var config=require('../../config/environment');var controller=require(_0xdeb7('0x7'));router[_0xdeb7('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdeb7('0x8')](_0xdeb7('0x9'),auth[_0xdeb7('0xa')](),controller['show']);router[_0xdeb7('0xb')]('/',auth['isAuthenticated'](),controller[_0xdeb7('0xc')]);router[_0xdeb7('0xd')]('/:id',auth[_0xdeb7('0xa')](),controller[_0xdeb7('0xe')]);router[_0xdeb7('0xf')]('/:id',auth[_0xdeb7('0xa')](),controller[_0xdeb7('0x10')]);module[_0xdeb7('0x11')]=router;
\ No newline at end of file
+var _0x8dce=['../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','/:id','isAuthenticated','show','post','put','delete','exports','multer','util','connect-timeout','express','../../components/auth/service'];(function(_0x2c8afe,_0x100f80){var _0x982977=function(_0x5b3a44){while(--_0x5b3a44){_0x2c8afe['push'](_0x2c8afe['shift']());}};_0x982977(++_0x100f80);}(_0x8dce,0x1b5));var _0xe8dc=function(_0xaeab2d,_0xa8cb87){_0xaeab2d=_0xaeab2d-0x0;var _0x5ea13a=_0x8dce[_0xaeab2d];return _0x5ea13a;};'use strict';var multer=require(_0xe8dc('0x0'));var util=require(_0xe8dc('0x1'));var path=require('path');var timeout=require(_0xe8dc('0x2'));var express=require(_0xe8dc('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8dc('0x4'));var interaction=require(_0xe8dc('0x5'));var config=require(_0xe8dc('0x6'));var controller=require(_0xe8dc('0x7'));router[_0xe8dc('0x8')]('/',auth['isAuthenticated'](),controller[_0xe8dc('0x9')]);router[_0xe8dc('0x8')](_0xe8dc('0xa'),auth[_0xe8dc('0xb')](),controller[_0xe8dc('0xc')]);router[_0xe8dc('0xd')]('/',auth[_0xe8dc('0xb')](),controller['create']);router[_0xe8dc('0xe')](_0xe8dc('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe8dc('0xf')](_0xe8dc('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe8dc('0x10')]=router;
\ No newline at end of file
index 26669c0..b61f838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b18=['STRING','sequelize','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x54c0d3,_0x33ce44){var _0xab27ea=function(_0x31fe71){while(--_0x31fe71){_0x54c0d3['push'](_0x54c0d3['shift']());}};_0xab27ea(++_0x33ce44);}(_0x2b18,0x121));var _0x82b1=function(_0xd3368f,_0x52397d){_0xd3368f=_0xd3368f-0x0;var _0x4cc1fb=_0x2b18[_0xd3368f];return _0x4cc1fb;};'use strict';var Sequelize=require(_0x82b1('0x0'));module['exports']={'type':{'type':Sequelize[_0x82b1('0x1')](_0x82b1('0x2'),_0x82b1('0x3'),_0x82b1('0x4'),_0x82b1('0x5'),_0x82b1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x82b1('0x7')]},'key':{'type':Sequelize[_0x82b1('0x7')]},'keyType':{'type':Sequelize[_0x82b1('0x1')](_0x82b1('0x2'),'variable',_0x82b1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x82b1('0x7')]},'nameField':{'type':Sequelize[_0x82b1('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x82b1('0x7')]}};
\ No newline at end of file
+var _0x56e2=['BOOLEAN','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x2a1ef4,_0x346fae){var _0x712d92=function(_0x765c1f){while(--_0x765c1f){_0x2a1ef4['push'](_0x2a1ef4['shift']());}};_0x712d92(++_0x346fae);}(_0x56e2,0xb1));var _0x256e=function(_0x870074,_0x7fa144){_0x870074=_0x870074-0x0;var _0x4b038d=_0x56e2[_0x870074];return _0x4b038d;};'use strict';var Sequelize=require('sequelize');module[_0x256e('0x0')]={'type':{'type':Sequelize[_0x256e('0x1')](_0x256e('0x2'),_0x256e('0x3'),_0x256e('0x4'),'keyValue',_0x256e('0x5')),'defaultValue':_0x256e('0x2')},'content':{'type':Sequelize[_0x256e('0x6')]},'key':{'type':Sequelize[_0x256e('0x6')]},'keyType':{'type':Sequelize[_0x256e('0x1')](_0x256e('0x2'),_0x256e('0x3'),_0x256e('0x4'))},'keyContent':{'type':Sequelize[_0x256e('0x6')]},'idField':{'type':Sequelize[_0x256e('0x6')]},'nameField':{'type':Sequelize[_0x256e('0x6')]},'customField':{'type':Sequelize[_0x256e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x256e('0x6')]}};
\ No newline at end of file
index a267d95..c29317a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x515f=['fields','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','attributes','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','query','filters','intersection'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0x515f,0x132));var _0xf515=function(_0x5069d9,_0x438a44){_0x5069d9=_0x5069d9-0x0;var _0x3009c9=_0x515f[_0x5069d9];return _0x3009c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf515('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf515('0x1'));var rp=require(_0xf515('0x2'));var moment=require(_0xf515('0x3'));var BPromise=require(_0xf515('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf515('0x5'));var sox=require('sox');var csv=require(_0xf515('0x6'));var ejs=require(_0xf515('0x7'));var fs=require('fs');var fs_extra=require(_0xf515('0x8'));var _=require(_0xf515('0x9'));var squel=require(_0xf515('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf515('0xb'));var toCsv=require(_0xf515('0x6'));var querystring=require(_0xf515('0xc'));var Papa=require(_0xf515('0xd'));var Redis=require(_0xf515('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf515('0xf'));var as=require(_0xf515('0x10'));var hardwareService=require(_0xf515('0x11'));var logger=require(_0xf515('0x12'))('api');var utils=require(_0xf515('0x13'));var config=require(_0xf515('0x14'));var licenseUtil=require(_0xf515('0x15'));var db=require(_0xf515('0x16'))['db'];function respondWithStatusCode(_0x5dd39c,_0xb26960){_0xb26960=_0xb26960||0xcc;return function(_0x1626e7){if(_0x1626e7){return _0x5dd39c['sendStatus'](_0xb26960);}return _0x5dd39c['status'](_0xb26960)[_0xf515('0x17')]();};}function respondWithResult(_0x65cc0f,_0x113445){_0x113445=_0x113445||0xc8;return function(_0x3a0037){if(_0x3a0037){return _0x65cc0f[_0xf515('0x18')](_0x113445)[_0xf515('0x19')](_0x3a0037);}};}function respondWithFilteredResult(_0x22ff3f,_0x2b9ae9){return function(_0x3e9326){if(_0x3e9326){var _0x295192=typeof _0x2b9ae9[_0xf515('0x1a')]===_0xf515('0x1b')&&typeof _0x2b9ae9['limit']==='undefined';var _0x21d4bc=_0x3e9326['count'];var _0x5c6eff=_0x295192?0x0:_0x2b9ae9[_0xf515('0x1a')];var _0x44ec7b=_0x295192?_0x3e9326[_0xf515('0x1c')]:_0x2b9ae9[_0xf515('0x1a')]+_0x2b9ae9[_0xf515('0x1d')];var _0x5cb428;if(_0x44ec7b>=_0x21d4bc){_0x44ec7b=_0x21d4bc;_0x5cb428=0xc8;}else{_0x5cb428=0xce;}_0x22ff3f[_0xf515('0x18')](_0x5cb428);return _0x22ff3f['set']('Content-Range',_0x5c6eff+'-'+_0x44ec7b+'/'+_0x21d4bc)['json'](_0x3e9326);}return null;};}function patchUpdates(_0x454a0a){return function(_0x4d6b27){try{jsonpatch[_0xf515('0x1e')](_0x4d6b27,_0x454a0a,!![]);}catch(_0x3fe119){return BPromise[_0xf515('0x1f')](_0x3fe119);}return _0x4d6b27[_0xf515('0x20')]();};}function saveUpdates(_0x2c5b55,_0xaac524){return function(_0x21f702){if(_0x21f702){return _0x21f702[_0xf515('0x21')](_0x2c5b55)[_0xf515('0x22')](function(_0x251862){return _0x251862;});}return null;};}function removeEntity(_0x32ebc6,_0x4980c2){return function(_0x4050ad){if(_0x4050ad){return _0x4050ad[_0xf515('0x23')]()['then'](function(){_0x32ebc6['status'](0xcc)[_0xf515('0x17')]();});}};}function handleEntityNotFound(_0x52ffe6,_0x47796a){return function(_0x2f77ae){if(!_0x2f77ae){_0x52ffe6[_0xf515('0x24')](0x194);}return _0x2f77ae;};}function handleError(_0x18586a,_0x2ecb47){_0x2ecb47=_0x2ecb47||0x1f4;return function(_0x5766c1){logger['error'](_0x5766c1[_0xf515('0x25')]);if(_0x5766c1[_0xf515('0x26')]){delete _0x5766c1[_0xf515('0x26')];}_0x18586a['status'](_0x2ecb47)[_0xf515('0x27')](_0x5766c1);};}exports[_0xf515('0x28')]=function(_0x81c9de,_0x2c3458){var _0x5228eb={},_0x2b2dbd={},_0x382cb6={'count':0x0,'rows':[]};var _0xd1c50a=_[_0xf515('0x29')](db[_0xf515('0x2a')][_0xf515('0x2b')],function(_0x5e889e){return{'name':_0x5e889e['fieldName'],'type':_0x5e889e[_0xf515('0x2c')][_0xf515('0x2d')]};});_0x2b2dbd['model']=_[_0xf515('0x29')](_0xd1c50a,_0xf515('0x26'));_0x2b2dbd[_0xf515('0x2e')]=_['keys'](_0x81c9de[_0xf515('0x2e')]);_0x2b2dbd[_0xf515('0x2f')]=_['intersection'](_0x2b2dbd['model'],_0x2b2dbd[_0xf515('0x2e')]);_0x5228eb['attributes']=_[_0xf515('0x30')](_0x2b2dbd['model'],qs['fields'](_0x81c9de[_0xf515('0x2e')][_0xf515('0x31')]));_0x5228eb['attributes']=_0x5228eb['attributes'][_0xf515('0x32')]?_0x5228eb['attributes']:_0x2b2dbd[_0xf515('0x33')];if(!_0x81c9de['query'][_0xf515('0x34')](_0xf515('0x35'))){_0x5228eb['limit']=qs[_0xf515('0x1d')](_0x81c9de['query'][_0xf515('0x1d')]);_0x5228eb['offset']=qs[_0xf515('0x1a')](_0x81c9de[_0xf515('0x2e')]['offset']);}_0x5228eb[_0xf515('0x36')]=qs['sort'](_0x81c9de[_0xf515('0x2e')][_0xf515('0x37')]);_0x5228eb[_0xf515('0x38')]=qs[_0xf515('0x2f')](_['pick'](_0x81c9de[_0xf515('0x2e')],_0x2b2dbd[_0xf515('0x2f')]),_0xd1c50a);if(_0x81c9de['query'][_0xf515('0x39')]){_0x5228eb[_0xf515('0x38')]=_[_0xf515('0x3a')](_0x5228eb[_0xf515('0x38')],{'$or':_[_0xf515('0x29')](_0xd1c50a,function(_0x1f0a86){if(_0x1f0a86[_0xf515('0x2c')]!==_0xf515('0x3b')){var _0x4c68a0={};_0x4c68a0[_0x1f0a86['name']]={'$like':'%'+_0x81c9de[_0xf515('0x2e')][_0xf515('0x39')]+'%'};return _0x4c68a0;}})});}_0x5228eb=_[_0xf515('0x3a')]({},_0x5228eb,_0x81c9de[_0xf515('0x3c')]);var _0x33d76c={'where':_0x5228eb['where']};return db['ServicenowField']['count'](_0x33d76c)['then'](function(_0x45ca7c){_0x382cb6['count']=_0x45ca7c;if(_0x81c9de['query'][_0xf515('0x3d')]){_0x5228eb[_0xf515('0x3e')]=[{'all':!![]}];}return db[_0xf515('0x2a')]['findAll'](_0x5228eb);})[_0xf515('0x22')](function(_0x2ac915){_0x382cb6[_0xf515('0x3f')]=_0x2ac915;return _0x382cb6;})[_0xf515('0x22')](respondWithFilteredResult(_0x2c3458,_0x5228eb))[_0xf515('0x40')](handleError(_0x2c3458,null));};exports['show']=function(_0x1aea0a,_0x395225){var _0x40ed66={'raw':!![],'where':{'id':_0x1aea0a[_0xf515('0x41')]['id']}},_0x2f76cb={};_0x2f76cb[_0xf515('0x33')]=_[_0xf515('0x42')](db['ServicenowField'][_0xf515('0x2b')]);_0x2f76cb[_0xf515('0x2e')]=_[_0xf515('0x42')](_0x1aea0a[_0xf515('0x2e')]);_0x2f76cb[_0xf515('0x2f')]=_['intersection'](_0x2f76cb[_0xf515('0x33')],_0x2f76cb[_0xf515('0x2e')]);_0x40ed66[_0xf515('0x43')]=_['intersection'](_0x2f76cb['model'],qs[_0xf515('0x31')](_0x1aea0a[_0xf515('0x2e')][_0xf515('0x31')]));_0x40ed66['attributes']=_0x40ed66[_0xf515('0x43')]['length']?_0x40ed66[_0xf515('0x43')]:_0x2f76cb['model'];if(_0x1aea0a[_0xf515('0x2e')]['includeAll']){_0x40ed66[_0xf515('0x3e')]=[{'all':!![]}];}_0x40ed66=_[_0xf515('0x3a')]({},_0x40ed66,_0x1aea0a['options']);return db[_0xf515('0x2a')][_0xf515('0x44')](_0x40ed66)['then'](handleEntityNotFound(_0x395225,null))['then'](respondWithResult(_0x395225,null))[_0xf515('0x40')](handleError(_0x395225,null));};exports[_0xf515('0x45')]=function(_0xb1dd5e,_0x3e51e1){return db[_0xf515('0x2a')]['create'](_0xb1dd5e[_0xf515('0x46')],{})['then'](respondWithResult(_0x3e51e1,0xc9))[_0xf515('0x40')](handleError(_0x3e51e1,null));};exports[_0xf515('0x21')]=function(_0x31b133,_0x4566a8){if(_0x31b133[_0xf515('0x46')]['id']){delete _0x31b133[_0xf515('0x46')]['id'];}return db[_0xf515('0x2a')]['find']({'where':{'id':_0x31b133[_0xf515('0x41')]['id']}})['then'](handleEntityNotFound(_0x4566a8,null))['then'](saveUpdates(_0x31b133[_0xf515('0x46')],null))[_0xf515('0x22')](respondWithResult(_0x4566a8,null))['catch'](handleError(_0x4566a8,null));};exports[_0xf515('0x23')]=function(_0x55033c,_0x2d8ba3){return db['ServicenowField'][_0xf515('0x44')]({'where':{'id':_0x55033c[_0xf515('0x41')]['id']}})[_0xf515('0x22')](handleEntityNotFound(_0x2d8ba3,null))['then'](removeEntity(_0x2d8ba3,null))['catch'](handleError(_0x2d8ba3,null));};
\ No newline at end of file
+var _0xe16c=['util','path','sox','to-csv','fs-extra','squel','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','apply','reject','save','destroy','then','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','keys','filters','query','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','intersection','includeAll','include','find','create','body','eml-format','rimraf','fast-json-patch','moment','mustache'];(function(_0x1c620a,_0x13eff2){var _0x328a7b=function(_0x4dabde){while(--_0x4dabde){_0x1c620a['push'](_0x1c620a['shift']());}};_0x328a7b(++_0x13eff2);}(_0xe16c,0x1d0));var _0xce16=function(_0x45ef92,_0x1ab97a){_0x45ef92=_0x45ef92-0x0;var _0x382c80=_0xe16c[_0x45ef92];return _0x382c80;};'use strict';var emlformat=require(_0xce16('0x0'));var rimraf=require(_0xce16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce16('0x2'));var rp=require('request-promise');var moment=require(_0xce16('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xce16('0x4'));var util=require(_0xce16('0x5'));var path=require(_0xce16('0x6'));var sox=require(_0xce16('0x7'));var csv=require(_0xce16('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce16('0x9'));var _=require('lodash');var squel=require(_0xce16('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xce16('0x8'));var querystring=require(_0xce16('0xb'));var Papa=require('papaparse');var Redis=require(_0xce16('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xce16('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xce16('0xe'))(_0xce16('0xf'));var utils=require(_0xce16('0x10'));var config=require(_0xce16('0x11'));var licenseUtil=require(_0xce16('0x12'));var db=require(_0xce16('0x13'))['db'];function respondWithStatusCode(_0x56db5c,_0x2139d5){_0x2139d5=_0x2139d5||0xcc;return function(_0x371425){if(_0x371425){return _0x56db5c[_0xce16('0x14')](_0x2139d5);}return _0x56db5c['status'](_0x2139d5)[_0xce16('0x15')]();};}function respondWithResult(_0x2ef6ca,_0xbfc861){_0xbfc861=_0xbfc861||0xc8;return function(_0x1c844d){if(_0x1c844d){return _0x2ef6ca[_0xce16('0x16')](_0xbfc861)['json'](_0x1c844d);}};}function respondWithFilteredResult(_0x122bfa,_0x1cb108){return function(_0x1062fd){if(_0x1062fd){var _0x181faf=typeof _0x1cb108[_0xce16('0x17')]===_0xce16('0x18')&&typeof _0x1cb108[_0xce16('0x19')]===_0xce16('0x18');var _0x18cd2c=_0x1062fd[_0xce16('0x1a')];var _0x49a0ef=_0x181faf?0x0:_0x1cb108[_0xce16('0x17')];var _0x220d52=_0x181faf?_0x1062fd[_0xce16('0x1a')]:_0x1cb108[_0xce16('0x17')]+_0x1cb108[_0xce16('0x19')];var _0x1899e;if(_0x220d52>=_0x18cd2c){_0x220d52=_0x18cd2c;_0x1899e=0xc8;}else{_0x1899e=0xce;}_0x122bfa[_0xce16('0x16')](_0x1899e);return _0x122bfa['set']('Content-Range',_0x49a0ef+'-'+_0x220d52+'/'+_0x18cd2c)['json'](_0x1062fd);}return null;};}function patchUpdates(_0x48d950){return function(_0x1aeaca){try{jsonpatch[_0xce16('0x1b')](_0x1aeaca,_0x48d950,!![]);}catch(_0x52309e){return BPromise[_0xce16('0x1c')](_0x52309e);}return _0x1aeaca[_0xce16('0x1d')]();};}function saveUpdates(_0x3aad6e,_0x1018d3){return function(_0x26fc4c){if(_0x26fc4c){return _0x26fc4c['update'](_0x3aad6e)['then'](function(_0x2eacc2){return _0x2eacc2;});}return null;};}function removeEntity(_0x22b644,_0x1fd65b){return function(_0x56167b){if(_0x56167b){return _0x56167b[_0xce16('0x1e')]()[_0xce16('0x1f')](function(){_0x22b644['status'](0xcc)[_0xce16('0x15')]();});}};}function handleEntityNotFound(_0x50c16c,_0x47e561){return function(_0x5a7bf6){if(!_0x5a7bf6){_0x50c16c['sendStatus'](0x194);}return _0x5a7bf6;};}function handleError(_0x332d16,_0x723b3a){_0x723b3a=_0x723b3a||0x1f4;return function(_0x519c73){logger[_0xce16('0x20')](_0x519c73[_0xce16('0x21')]);if(_0x519c73[_0xce16('0x22')]){delete _0x519c73['name'];}_0x332d16[_0xce16('0x16')](_0x723b3a)[_0xce16('0x23')](_0x519c73);};}exports[_0xce16('0x24')]=function(_0x5606cf,_0x4097f0){var _0x1374fe={},_0x44dc45={},_0x21e50e={'count':0x0,'rows':[]};var _0x277015=_[_0xce16('0x25')](db[_0xce16('0x26')][_0xce16('0x27')],function(_0x3d3230){return{'name':_0x3d3230[_0xce16('0x28')],'type':_0x3d3230[_0xce16('0x29')]['key']};});_0x44dc45[_0xce16('0x2a')]=_[_0xce16('0x25')](_0x277015,'name');_0x44dc45['query']=_[_0xce16('0x2b')](_0x5606cf['query']);_0x44dc45[_0xce16('0x2c')]=_['intersection'](_0x44dc45[_0xce16('0x2a')],_0x44dc45[_0xce16('0x2d')]);_0x1374fe['attributes']=_['intersection'](_0x44dc45[_0xce16('0x2a')],qs[_0xce16('0x2e')](_0x5606cf[_0xce16('0x2d')][_0xce16('0x2e')]));_0x1374fe[_0xce16('0x2f')]=_0x1374fe[_0xce16('0x2f')]['length']?_0x1374fe[_0xce16('0x2f')]:_0x44dc45[_0xce16('0x2a')];if(!_0x5606cf['query']['hasOwnProperty'](_0xce16('0x30'))){_0x1374fe[_0xce16('0x19')]=qs[_0xce16('0x19')](_0x5606cf[_0xce16('0x2d')]['limit']);_0x1374fe['offset']=qs[_0xce16('0x17')](_0x5606cf[_0xce16('0x2d')][_0xce16('0x17')]);}_0x1374fe[_0xce16('0x31')]=qs[_0xce16('0x32')](_0x5606cf[_0xce16('0x2d')]['sort']);_0x1374fe[_0xce16('0x33')]=qs[_0xce16('0x2c')](_[_0xce16('0x34')](_0x5606cf[_0xce16('0x2d')],_0x44dc45[_0xce16('0x2c')]),_0x277015);if(_0x5606cf[_0xce16('0x2d')][_0xce16('0x35')]){_0x1374fe[_0xce16('0x33')]=_[_0xce16('0x36')](_0x1374fe[_0xce16('0x33')],{'$or':_[_0xce16('0x25')](_0x277015,function(_0x5cc858){if(_0x5cc858['type']!==_0xce16('0x37')){var _0x214e71={};_0x214e71[_0x5cc858[_0xce16('0x22')]]={'$like':'%'+_0x5606cf[_0xce16('0x2d')][_0xce16('0x35')]+'%'};return _0x214e71;}})});}_0x1374fe=_[_0xce16('0x36')]({},_0x1374fe,_0x5606cf[_0xce16('0x38')]);var _0x173cf8={'where':_0x1374fe[_0xce16('0x33')]};return db['ServicenowField'][_0xce16('0x1a')](_0x173cf8)[_0xce16('0x1f')](function(_0x1665ba){_0x21e50e[_0xce16('0x1a')]=_0x1665ba;if(_0x5606cf[_0xce16('0x2d')]['includeAll']){_0x1374fe['include']=[{'all':!![]}];}return db[_0xce16('0x26')][_0xce16('0x39')](_0x1374fe);})['then'](function(_0xe3559){_0x21e50e[_0xce16('0x3a')]=_0xe3559;return _0x21e50e;})[_0xce16('0x1f')](respondWithFilteredResult(_0x4097f0,_0x1374fe))[_0xce16('0x3b')](handleError(_0x4097f0,null));};exports['show']=function(_0x24ce3a,_0x443f24){var _0x4c9b41={'raw':!![],'where':{'id':_0x24ce3a[_0xce16('0x3c')]['id']}},_0xd0c67b={};_0xd0c67b[_0xce16('0x2a')]=_[_0xce16('0x2b')](db[_0xce16('0x26')][_0xce16('0x27')]);_0xd0c67b[_0xce16('0x2d')]=_[_0xce16('0x2b')](_0x24ce3a[_0xce16('0x2d')]);_0xd0c67b['filters']=_[_0xce16('0x3d')](_0xd0c67b[_0xce16('0x2a')],_0xd0c67b[_0xce16('0x2d')]);_0x4c9b41[_0xce16('0x2f')]=_['intersection'](_0xd0c67b[_0xce16('0x2a')],qs['fields'](_0x24ce3a['query'][_0xce16('0x2e')]));_0x4c9b41[_0xce16('0x2f')]=_0x4c9b41[_0xce16('0x2f')]['length']?_0x4c9b41[_0xce16('0x2f')]:_0xd0c67b[_0xce16('0x2a')];if(_0x24ce3a[_0xce16('0x2d')][_0xce16('0x3e')]){_0x4c9b41[_0xce16('0x3f')]=[{'all':!![]}];}_0x4c9b41=_[_0xce16('0x36')]({},_0x4c9b41,_0x24ce3a['options']);return db['ServicenowField'][_0xce16('0x40')](_0x4c9b41)[_0xce16('0x1f')](handleEntityNotFound(_0x443f24,null))[_0xce16('0x1f')](respondWithResult(_0x443f24,null))[_0xce16('0x3b')](handleError(_0x443f24,null));};exports[_0xce16('0x41')]=function(_0x7dbcaf,_0xff950e){return db[_0xce16('0x26')]['create'](_0x7dbcaf[_0xce16('0x42')],{})[_0xce16('0x1f')](respondWithResult(_0xff950e,0xc9))[_0xce16('0x3b')](handleError(_0xff950e,null));};exports['update']=function(_0x52d059,_0x369d1b){if(_0x52d059['body']['id']){delete _0x52d059[_0xce16('0x42')]['id'];}return db['ServicenowField'][_0xce16('0x40')]({'where':{'id':_0x52d059[_0xce16('0x3c')]['id']}})['then'](handleEntityNotFound(_0x369d1b,null))[_0xce16('0x1f')](saveUpdates(_0x52d059[_0xce16('0x42')],null))[_0xce16('0x1f')](respondWithResult(_0x369d1b,null))[_0xce16('0x3b')](handleError(_0x369d1b,null));};exports[_0xce16('0x1e')]=function(_0x22c766,_0x338f96){return db[_0xce16('0x26')][_0xce16('0x40')]({'where':{'id':_0x22c766[_0xce16('0x3c')]['id']}})[_0xce16('0x1f')](handleEntityNotFound(_0x338f96,null))[_0xce16('0x1f')](removeEntity(_0x338f96,null))[_0xce16('0x3b')](handleError(_0x338f96,null));};
\ No newline at end of file
index 28911c0..e3daba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f28=['request-promise','rimraf','./intServicenowField.attributes','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','../../config/logger','api','bluebird'];(function(_0x3a8299,_0x2c3792){var _0x5293dd=function(_0x263d42){while(--_0x263d42){_0x3a8299['push'](_0x3a8299['shift']());}};_0x5293dd(++_0x2c3792);}(_0x4f28,0xf3));var _0x84f2=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x4f28[_0x1780f8];return _0x33a410;};'use strict';var _=require('lodash');var util=require(_0x84f2('0x0'));var logger=require(_0x84f2('0x1'))(_0x84f2('0x2'));var moment=require('moment');var BPromise=require(_0x84f2('0x3'));var rp=require(_0x84f2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84f2('0x5'));var config=require('../../config/environment');var attributes=require(_0x84f2('0x6'));module['exports']=function(_0x16f9bc,_0x21714e){return _0x16f9bc[_0x84f2('0x7')](_0x84f2('0x8'),attributes,{'tableName':_0x84f2('0x9'),'paranoid':![],'indexes':[{'name':_0x84f2('0xa'),'fields':[_0x84f2('0xb'),_0x84f2('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b28=['bluebird','path','rimraf','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','lodash','util','../../config/logger','api','moment'];(function(_0x49a72f,_0x3ac7d0){var _0x1514f5=function(_0x322373){while(--_0x322373){_0x49a72f['push'](_0x49a72f['shift']());}};_0x1514f5(++_0x3ac7d0);}(_0x1b28,0x14d));var _0x81b2=function(_0x197fc3,_0xdd2300){_0x197fc3=_0x197fc3-0x0;var _0x4e3d80=_0x1b28[_0x197fc3];return _0x4e3d80;};'use strict';var _=require(_0x81b2('0x0'));var util=require(_0x81b2('0x1'));var logger=require(_0x81b2('0x2'))(_0x81b2('0x3'));var moment=require(_0x81b2('0x4'));var BPromise=require(_0x81b2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x81b2('0x6'));var rimraf=require(_0x81b2('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x81b2('0x8')]=function(_0x3c4a6f,_0x2d67ae){return _0x3c4a6f[_0x81b2('0x9')](_0x81b2('0xa'),attributes,{'tableName':_0x81b2('0xb'),'paranoid':![],'indexes':[{'name':_0x81b2('0xc'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bb91677..e6312e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1cbd5f,_0xe017e1){var _0x4fa3c9=function(_0x2b4976){while(--_0x2b4976){_0x1cbd5f['push'](_0x1cbd5f['shift']());}};_0x4fa3c9(++_0xe017e1);}(_0xb7e7,0x121));var _0x7b7e=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xb7e7[_0xa6cc5c];return _0x44803d;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('ServicenowField,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});}
\ No newline at end of file
+var _0xda3f=['rpc','jayson/promise','client','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x4d2993,_0x1c9473){var _0x427374=function(_0x149dfd){while(--_0x149dfd){_0x4d2993['push'](_0x4d2993['shift']());}};_0x427374(++_0x1c9473);}(_0xda3f,0xec));var _0xfda3=function(_0x1062fb,_0x5c963a){_0x1062fb=_0x1062fb-0x0;var _0x1fa55f=_0xda3f[_0x1062fb];return _0x1fa55f;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});}
\ No newline at end of file
index dcd18b4..97b2e15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x57919a,_0x3c24df){var _0x4d8cf3=function(_0x375ee0){while(--_0x375ee0){_0x57919a['push'](_0x57919a['shift']());}};_0x4d8cf3(++_0x3c24df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xa9e0[_0x2d8fc2];return _0x3a9e53;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x26b0fe,_0x3e1fe7){var _0x27de32=function(_0x35ba11){while(--_0x35ba11){_0x26b0fe['push'](_0x26b0fe['shift']());}};_0x27de32(++_0x3e1fe7);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 80a531e..19c534f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x37ca04,_0x558c2f){var _0x4fcc8e=function(_0x2993b7){while(--_0x2993b7){_0x37ca04['push'](_0x37ca04['shift']());}};_0x4fcc8e(++_0x558c2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x2c8d56,_0x3ab730){var _0x3fced6=function(_0x30cd4d){while(--_0x30cd4d){_0x2c8d56['push'](_0x2c8d56['shift']());}};_0x3fced6(++_0x3ab730);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 9a41682..c648e4d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13d9=['password','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','/service/v4_1/rest.php','Calls','values','remove','includes','endsWith','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','stack','send','index','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','params','length','options','find','catch','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','nolimit','AccountId','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','created_by','description','date_start','duration_hours','duration_minutes','parent_type','username'];(function(_0x2441b7,_0x2f26f6){var _0x142f65=function(_0x5351da){while(--_0x5351da){_0x2441b7['push'](_0x2441b7['shift']());}};_0x142f65(++_0x2f26f6);}(_0x13d9,0x181));var _0x913d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13d9[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x913d('0x0'));var rimraf=require(_0x913d('0x1'));var zipdir=require(_0x913d('0x2'));var jsonpatch=require(_0x913d('0x3'));var rp=require(_0x913d('0x4'));var moment=require(_0x913d('0x5'));var BPromise=require(_0x913d('0x6'));var Mustache=require('mustache');var util=require(_0x913d('0x7'));var path=require(_0x913d('0x8'));var sox=require(_0x913d('0x9'));var csv=require(_0x913d('0xa'));var ejs=require(_0x913d('0xb'));var fs=require('fs');var fs_extra=require(_0x913d('0xc'));var _=require(_0x913d('0xd'));var squel=require(_0x913d('0xe'));var crypto=require(_0x913d('0xf'));var jsforce=require(_0x913d('0x10'));var deskjs=require(_0x913d('0x11'));var toCsv=require(_0x913d('0xa'));var querystring=require(_0x913d('0x12'));var Papa=require(_0x913d('0x13'));var Redis=require('ioredis');var authService=require(_0x913d('0x14'));var qs=require(_0x913d('0x15'));var as=require(_0x913d('0x16'));var hardwareService=require(_0x913d('0x17'));var logger=require(_0x913d('0x18'))('api');var utils=require(_0x913d('0x19'));var config=require(_0x913d('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x913d('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5d8a6a,_0x539ca9){_0x539ca9=_0x539ca9||0xcc;return function(_0x3c1aca){if(_0x3c1aca){return _0x5d8a6a['sendStatus'](_0x539ca9);}return _0x5d8a6a[_0x913d('0x1c')](_0x539ca9)['end']();};}function respondWithResult(_0x23be54,_0x2f0535){_0x2f0535=_0x2f0535||0xc8;return function(_0x42d1a){if(_0x42d1a){return _0x23be54[_0x913d('0x1c')](_0x2f0535)[_0x913d('0x1d')](_0x42d1a);}};}function respondWithFilteredResult(_0xc9d465,_0x8ff4c2){return function(_0x45200f){if(_0x45200f){var _0x5e4156=typeof _0x8ff4c2['offset']===_0x913d('0x1e')&&typeof _0x8ff4c2[_0x913d('0x1f')]===_0x913d('0x1e');var _0x5c5510=_0x45200f['count'];var _0x52d984=_0x5e4156?0x0:_0x8ff4c2['offset'];var _0x27a69a=_0x5e4156?_0x45200f[_0x913d('0x20')]:_0x8ff4c2[_0x913d('0x21')]+_0x8ff4c2['limit'];var _0x46d091;if(_0x27a69a>=_0x5c5510){_0x27a69a=_0x5c5510;_0x46d091=0xc8;}else{_0x46d091=0xce;}_0xc9d465[_0x913d('0x1c')](_0x46d091);return _0xc9d465['set'](_0x913d('0x22'),_0x52d984+'-'+_0x27a69a+'/'+_0x5c5510)[_0x913d('0x1d')](_0x45200f);}return null;};}function patchUpdates(_0x3e1e97){return function(_0x2192f8){try{jsonpatch[_0x913d('0x23')](_0x2192f8,_0x3e1e97,!![]);}catch(_0x303fe1){return BPromise[_0x913d('0x24')](_0x303fe1);}return _0x2192f8[_0x913d('0x25')]();};}function saveUpdates(_0x52d4cb,_0x500510){return function(_0x35a24c){if(_0x35a24c){return _0x35a24c[_0x913d('0x26')](_0x52d4cb)['then'](function(_0x34c903){return _0x34c903;});}return null;};}function removeEntity(_0x5e5db3,_0x2960b6){return function(_0x385a9b){if(_0x385a9b){return _0x385a9b[_0x913d('0x27')]()['then'](function(){_0x5e5db3[_0x913d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532ad4,_0x508757){return function(_0x43dc5d){if(!_0x43dc5d){_0x532ad4['sendStatus'](0x194);}return _0x43dc5d;};}function handleError(_0x3e7b25,_0x1e3759){_0x1e3759=_0x1e3759||0x1f4;return function(_0x2c552a){logger['error'](_0x2c552a[_0x913d('0x28')]);if(_0x2c552a['name']){delete _0x2c552a['name'];}_0x3e7b25[_0x913d('0x1c')](_0x1e3759)[_0x913d('0x29')](_0x2c552a);};}exports[_0x913d('0x2a')]=function(_0x50cf2e,_0x49e6c6){var _0x5e13df={},_0x1f9f85={},_0x3a1f1={'count':0x0,'rows':[]};var _0x22221e=_[_0x913d('0x2b')](db[_0x913d('0x2c')][_0x913d('0x2d')],function(_0xf69267){return{'name':_0xf69267[_0x913d('0x2e')],'type':_0xf69267[_0x913d('0x2f')][_0x913d('0x30')]};});_0x1f9f85[_0x913d('0x31')]=_[_0x913d('0x2b')](_0x22221e,_0x913d('0x32'));_0x1f9f85[_0x913d('0x33')]=_[_0x913d('0x34')](_0x50cf2e[_0x913d('0x33')]);_0x1f9f85[_0x913d('0x35')]=_[_0x913d('0x36')](_0x1f9f85['model'],_0x1f9f85[_0x913d('0x33')]);_0x5e13df[_0x913d('0x37')]=_[_0x913d('0x36')](_0x1f9f85[_0x913d('0x31')],qs['fields'](_0x50cf2e[_0x913d('0x33')][_0x913d('0x38')]));_0x5e13df[_0x913d('0x37')]=_0x5e13df[_0x913d('0x37')]['length']?_0x5e13df['attributes']:_0x1f9f85[_0x913d('0x31')];if(!_0x50cf2e[_0x913d('0x33')][_0x913d('0x39')]('nolimit')){_0x5e13df[_0x913d('0x1f')]=qs[_0x913d('0x1f')](_0x50cf2e[_0x913d('0x33')]['limit']);_0x5e13df[_0x913d('0x21')]=qs[_0x913d('0x21')](_0x50cf2e[_0x913d('0x33')]['offset']);}_0x5e13df['order']=qs[_0x913d('0x3a')](_0x50cf2e[_0x913d('0x33')][_0x913d('0x3a')]);_0x5e13df[_0x913d('0x3b')]=qs['filters'](_[_0x913d('0x3c')](_0x50cf2e[_0x913d('0x33')],_0x1f9f85[_0x913d('0x35')]),_0x22221e);if(_0x50cf2e[_0x913d('0x33')][_0x913d('0x3d')]){_0x5e13df['where']=_[_0x913d('0x3e')](_0x5e13df[_0x913d('0x3b')],{'$or':_[_0x913d('0x2b')](_0x22221e,function(_0x3f26fd){if(_0x3f26fd[_0x913d('0x2f')]!==_0x913d('0x3f')){var _0x2a4089={};_0x2a4089[_0x3f26fd[_0x913d('0x32')]]={'$like':'%'+_0x50cf2e[_0x913d('0x33')]['filter']+'%'};return _0x2a4089;}})});}_0x5e13df=_[_0x913d('0x3e')]({},_0x5e13df,_0x50cf2e['options']);var _0x3e1cbc={'where':_0x5e13df[_0x913d('0x3b')]};return db[_0x913d('0x2c')]['count'](_0x3e1cbc)[_0x913d('0x40')](function(_0x58383b){_0x3a1f1['count']=_0x58383b;if(_0x50cf2e['query'][_0x913d('0x41')]){_0x5e13df[_0x913d('0x42')]=[{'all':!![]}];}return db[_0x913d('0x2c')][_0x913d('0x43')](_0x5e13df);})[_0x913d('0x40')](function(_0x216480){_0x3a1f1[_0x913d('0x44')]=_0x216480;return _0x3a1f1;})[_0x913d('0x40')](respondWithFilteredResult(_0x49e6c6,_0x5e13df))['catch'](handleError(_0x49e6c6,null));};exports['show']=function(_0x41a58f,_0x1efd3a){var _0x4ed010={'raw':![],'where':{'id':_0x41a58f[_0x913d('0x45')]['id']}},_0x1b3ede={};_0x1b3ede[_0x913d('0x31')]=_[_0x913d('0x34')](db[_0x913d('0x2c')]['rawAttributes']);_0x1b3ede[_0x913d('0x33')]=_[_0x913d('0x34')](_0x41a58f['query']);_0x1b3ede['filters']=_[_0x913d('0x36')](_0x1b3ede['model'],_0x1b3ede[_0x913d('0x33')]);_0x4ed010[_0x913d('0x37')]=_['intersection'](_0x1b3ede[_0x913d('0x31')],qs['fields'](_0x41a58f[_0x913d('0x33')]['fields']));_0x4ed010[_0x913d('0x37')]=_0x4ed010[_0x913d('0x37')][_0x913d('0x46')]?_0x4ed010[_0x913d('0x37')]:_0x1b3ede['model'];if(_0x41a58f[_0x913d('0x33')][_0x913d('0x41')]){_0x4ed010[_0x913d('0x42')]=[{'all':!![]}];}_0x4ed010=_[_0x913d('0x3e')]({},_0x4ed010,_0x41a58f[_0x913d('0x47')]);return db[_0x913d('0x2c')][_0x913d('0x48')](_0x4ed010)[_0x913d('0x40')](handleEntityNotFound(_0x1efd3a,null))[_0x913d('0x40')](respondWithResult(_0x1efd3a,null))[_0x913d('0x49')](handleError(_0x1efd3a,null));};exports['create']=function(_0x25db5c,_0xd2c842){return db[_0x913d('0x2c')][_0x913d('0x4a')](_0x25db5c[_0x913d('0x4b')],{})[_0x913d('0x40')](respondWithResult(_0xd2c842,0xc9))[_0x913d('0x49')](handleError(_0xd2c842,null));};exports[_0x913d('0x26')]=function(_0x293795,_0x6b266e){if(_0x293795[_0x913d('0x4b')]['id']){delete _0x293795[_0x913d('0x4b')]['id'];}return db[_0x913d('0x2c')][_0x913d('0x48')]({'where':{'id':_0x293795[_0x913d('0x45')]['id']}})[_0x913d('0x40')](handleEntityNotFound(_0x6b266e,null))[_0x913d('0x40')](saveUpdates(_0x293795[_0x913d('0x4b')],null))[_0x913d('0x40')](respondWithResult(_0x6b266e,null))[_0x913d('0x49')](handleError(_0x6b266e,null));};exports['destroy']=function(_0x1dfc40,_0x5593d2){return db[_0x913d('0x2c')][_0x913d('0x48')]({'where':{'id':_0x1dfc40[_0x913d('0x45')]['id']}})[_0x913d('0x40')](handleEntityNotFound(_0x5593d2,null))[_0x913d('0x40')](removeEntity(_0x5593d2,null))[_0x913d('0x49')](handleError(_0x5593d2,null));};exports[_0x913d('0x4c')]=function(_0x98b5a3,_0x12b69b,_0x47b3f0){var _0x975c6a={};var _0x4a7208={};var _0x26c10;var _0x430611;return db[_0x913d('0x2c')][_0x913d('0x4d')]({'where':{'id':_0x98b5a3['params']['id']}})[_0x913d('0x40')](handleEntityNotFound(_0x12b69b,null))['then'](function(_0x207535){if(_0x207535){_0x26c10=_0x207535;_0x4a7208[_0x913d('0x31')]=_[_0x913d('0x34')](db[_0x913d('0x4e')]['rawAttributes']);_0x4a7208[_0x913d('0x33')]=_[_0x913d('0x34')](_0x98b5a3[_0x913d('0x33')]);_0x4a7208[_0x913d('0x35')]=_['intersection'](_0x4a7208[_0x913d('0x31')],_0x4a7208[_0x913d('0x33')]);_0x975c6a[_0x913d('0x37')]=_[_0x913d('0x36')](_0x4a7208[_0x913d('0x31')],qs['fields'](_0x98b5a3['query']['fields']));_0x975c6a[_0x913d('0x37')]=_0x975c6a[_0x913d('0x37')][_0x913d('0x46')]?_0x975c6a[_0x913d('0x37')]:_0x4a7208[_0x913d('0x31')];_0x975c6a[_0x913d('0x4f')]=qs[_0x913d('0x3a')](_0x98b5a3[_0x913d('0x33')][_0x913d('0x3a')]);_0x975c6a[_0x913d('0x3b')]=qs[_0x913d('0x35')](_[_0x913d('0x3c')](_0x98b5a3[_0x913d('0x33')],_0x4a7208[_0x913d('0x35')]));if(_0x98b5a3[_0x913d('0x33')][_0x913d('0x3d')]){_0x975c6a['where']=_['merge'](_0x975c6a[_0x913d('0x3b')],{'$or':_[_0x913d('0x2b')](_0x975c6a[_0x913d('0x37')],function(_0x409cfd){var _0x21704a={};_0x21704a[_0x409cfd]={'$like':'%'+_0x98b5a3[_0x913d('0x33')][_0x913d('0x3d')]+'%'};return _0x21704a;})});}_0x975c6a=_['merge']({},_0x975c6a,_0x98b5a3[_0x913d('0x47')]);return _0x26c10[_0x913d('0x4c')](_0x975c6a);}})['then'](function(_0x3d86fc){if(_0x3d86fc){_0x430611=_0x3d86fc[_0x913d('0x46')];if(!_0x98b5a3['query'][_0x913d('0x39')](_0x913d('0x50'))){_0x975c6a[_0x913d('0x1f')]=qs[_0x913d('0x1f')](_0x98b5a3[_0x913d('0x33')][_0x913d('0x1f')]);_0x975c6a[_0x913d('0x21')]=qs[_0x913d('0x21')](_0x98b5a3[_0x913d('0x33')][_0x913d('0x21')]);}return _0x26c10['getConfigurations'](_0x975c6a);}})[_0x913d('0x40')](function(_0x4a4538){if(_0x4a4538){return _0x4a4538?{'count':_0x430611,'rows':_0x4a4538}:null;}})['then'](respondWithResult(_0x12b69b,null))[_0x913d('0x49')](handleError(_0x12b69b,null));};exports['addConfiguration']=function(_0x29f263,_0x5733ca,_0x33acd1){if(_0x29f263[_0x913d('0x4b')]['id']){delete _0x29f263['body']['id'];}return db[_0x913d('0x2c')][_0x913d('0x4d')]({'where':{'id':_0x29f263['params']['id']}})[_0x913d('0x40')](handleEntityNotFound(_0x5733ca,null))[_0x913d('0x40')](function(_0x20b4ab){if(_0x20b4ab){_0x29f263[_0x913d('0x4b')][_0x913d('0x51')]=_0x20b4ab['id'];_0x29f263['body']['Subjects']=integrations[_0x913d('0x52')](_0x29f263['body'][_0x913d('0x53')],_0x29f263[_0x913d('0x4b')]['type']);_0x29f263[_0x913d('0x4b')][_0x913d('0x54')]=integrations[_0x913d('0x55')](_0x29f263[_0x913d('0x4b')][_0x913d('0x53')],_0x29f263[_0x913d('0x4b')]['type']);return db['SugarcrmConfiguration'][_0x913d('0x4a')](_0x29f263[_0x913d('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x913d('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5733ca,null))['catch'](handleError(_0x5733ca,null));};exports[_0x913d('0x57')]=function(_0x58479f,_0x5c247e,_0x27d0e1){var _0x19e83e='';var _0x223728=['id','name','assigned_user_id',_0x913d('0x58'),_0x913d('0x59'),_0x913d('0x5a'),_0x913d('0x5b'),_0x913d('0x5c'),'parent_id',_0x913d('0x5d'),'parent_name','direction'];return db['SugarcrmAccount'][_0x913d('0x4d')]({'where':{'id':_0x58479f['params']['id']},'attributes':['id',_0x913d('0x5e'),_0x913d('0x5f'),_0x913d('0x60')]})[_0x913d('0x40')](handleEntityNotFound(_0x5c247e,null))[_0x913d('0x40')](function(_0x31d93b){if(_0x31d93b){_0x19e83e=_0x31d93b[_0x913d('0x60')];var _0x26e2e1=_0x19e83e[_0x913d('0x61')](-0x1);if(_0x26e2e1==='/'){_0x19e83e=_0x19e83e[_0x913d('0x62')](0x0,_0x19e83e[_0x913d('0x63')](_0x26e2e1));}return rp({'method':_0x913d('0x64'),'uri':util[_0x913d('0x65')](_0x913d('0x66'),_0x19e83e,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x913d('0x67'),'input_type':'JSON','response_type':_0x913d('0x68'),'rest_data':JSON[_0x913d('0x69')]({'user_auth':{'user_name':_0x31d93b[_0x913d('0x5e')],'password':_0x31d93b[_0x913d('0x5f')],'encryption':_0x913d('0x6a')},'application':_0x913d('0x6b')})}});}})[_0x913d('0x40')](function(_0x356f64){if(_0x356f64&&_0x356f64[_0x913d('0x32')]!==_0x913d('0x6c')&&_0x356f64[_0x913d('0x32')]!==_0x913d('0x6d')){return rp({'method':'POST','uri':util['format']('%s%s',_0x19e83e,_0x913d('0x6e')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x913d('0x68'),'response_type':_0x913d('0x68'),'rest_data':JSON[_0x913d('0x69')]({'session':_0x356f64['id'],'module_name':_0x913d('0x6f')})}})[_0x913d('0x40')](function(_0x43596c){if(_0x43596c){var _0x47c66b=_[_0x913d('0x70')](_0x43596c['module_fields']);_[_0x913d('0x71')](_0x47c66b,function(_0x338afa){return _0x223728[_0x913d('0x72')](_0x338afa['name']);});return{'count':_0x47c66b['length'],'rows':_[_0x913d('0x2b')](_0x47c66b,function(_0x16d87d){return{'id':_0x16d87d[_0x913d('0x32')],'name':_0x16d87d['label'],'custom':_[_0x913d('0x73')](_0x16d87d[_0x913d('0x32')],'_c')?!![]:![],'options':_0x16d87d[_0x913d('0x47')]?_[_0x913d('0x2b')](_['values'](_0x16d87d[_0x913d('0x47')]),function(_0x25f1df){return{'name':_0x25f1df['value'],'value':_0x25f1df['name']};}):[]};})};}})['then'](respondWithResult(_0x5c247e,null))[_0x913d('0x49')](function(_0x34fe24){var _0x47152d=_0x58479f[_0x913d('0x33')]['test']?0x1f4:_0x34fe24['statusCode']||0x1f4;logger[_0x913d('0x74')](_0x913d('0x75'),_0x913d('0x57'),_0x47152d,JSON[_0x913d('0x69')](_0x34fe24));delete _0x34fe24[_0x913d('0x32')];if(_0x47152d===0x191){_0x47152d=0x190;}_0x5c247e['status'](_0x47152d)[_0x913d('0x29')](_0x58479f['query']['test']?{'message':_0x913d('0x76'),'statusCode':_0x34fe24[_0x913d('0x77')]}:_0x34fe24);});}else{var _0x5843ed=0x1f4;_0x5c247e[_0x913d('0x1c')](_0x5843ed)['send']({'message':_0x913d('0x76'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0x820d=['values','module_fields','includes','value','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','catch','show','params','keys','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','xCALLY\x20Motion\x20Integration','Calls'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0x820d,0x159));var _0xd820=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x820d[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0xd820('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd820('0x1'));var jsonpatch=require(_0xd820('0x2'));var rp=require(_0xd820('0x3'));var moment=require('moment');var BPromise=require(_0xd820('0x4'));var Mustache=require('mustache');var util=require(_0xd820('0x5'));var path=require(_0xd820('0x6'));var sox=require(_0xd820('0x7'));var csv=require(_0xd820('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd820('0x9'));var _=require('lodash');var squel=require(_0xd820('0xa'));var crypto=require(_0xd820('0xb'));var jsforce=require(_0xd820('0xc'));var deskjs=require(_0xd820('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd820('0xe'));var Papa=require(_0xd820('0xf'));var Redis=require('ioredis');var authService=require(_0xd820('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd820('0x11'));var hardwareService=require(_0xd820('0x12'));var logger=require('../../config/logger')(_0xd820('0x13'));var utils=require(_0xd820('0x14'));var config=require(_0xd820('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd820('0x16'));function respondWithStatusCode(_0x4b7d1f,_0x57ac37){_0x57ac37=_0x57ac37||0xcc;return function(_0x2df38e){if(_0x2df38e){return _0x4b7d1f[_0xd820('0x17')](_0x57ac37);}return _0x4b7d1f['status'](_0x57ac37)[_0xd820('0x18')]();};}function respondWithResult(_0x48dd08,_0xb75f6f){_0xb75f6f=_0xb75f6f||0xc8;return function(_0xad8179){if(_0xad8179){return _0x48dd08[_0xd820('0x19')](_0xb75f6f)['json'](_0xad8179);}};}function respondWithFilteredResult(_0x2b075e,_0x5a88cd){return function(_0x708e82){if(_0x708e82){var _0x236808=typeof _0x5a88cd[_0xd820('0x1a')]==='undefined'&&typeof _0x5a88cd[_0xd820('0x1b')]===_0xd820('0x1c');var _0x13b7be=_0x708e82[_0xd820('0x1d')];var _0x2a5ae1=_0x236808?0x0:_0x5a88cd[_0xd820('0x1a')];var _0x3147dd=_0x236808?_0x708e82[_0xd820('0x1d')]:_0x5a88cd['offset']+_0x5a88cd[_0xd820('0x1b')];var _0x3f19e5;if(_0x3147dd>=_0x13b7be){_0x3147dd=_0x13b7be;_0x3f19e5=0xc8;}else{_0x3f19e5=0xce;}_0x2b075e['status'](_0x3f19e5);return _0x2b075e['set'](_0xd820('0x1e'),_0x2a5ae1+'-'+_0x3147dd+'/'+_0x13b7be)['json'](_0x708e82);}return null;};}function patchUpdates(_0x15f487){return function(_0xfdd899){try{jsonpatch['apply'](_0xfdd899,_0x15f487,!![]);}catch(_0x108b7a){return BPromise[_0xd820('0x1f')](_0x108b7a);}return _0xfdd899['save']();};}function saveUpdates(_0x17b97e,_0xa8fbf0){return function(_0x5234b4){if(_0x5234b4){return _0x5234b4[_0xd820('0x20')](_0x17b97e)[_0xd820('0x21')](function(_0x28e5a4){return _0x28e5a4;});}return null;};}function removeEntity(_0x2b4dda,_0x4f5d22){return function(_0x300de4){if(_0x300de4){return _0x300de4[_0xd820('0x22')]()[_0xd820('0x21')](function(){_0x2b4dda[_0xd820('0x19')](0xcc)[_0xd820('0x18')]();});}};}function handleEntityNotFound(_0x1f2fa4,_0x53fc9a){return function(_0x1a6dad){if(!_0x1a6dad){_0x1f2fa4[_0xd820('0x17')](0x194);}return _0x1a6dad;};}function handleError(_0x29ab49,_0x132d42){_0x132d42=_0x132d42||0x1f4;return function(_0x13f79f){logger['error'](_0x13f79f[_0xd820('0x23')]);if(_0x13f79f['name']){delete _0x13f79f[_0xd820('0x24')];}_0x29ab49['status'](_0x132d42)[_0xd820('0x25')](_0x13f79f);};}exports[_0xd820('0x26')]=function(_0x135217,_0x411276){var _0x43196a={},_0x39304c={},_0x3e8c9c={'count':0x0,'rows':[]};var _0x25ed74=_[_0xd820('0x27')](db[_0xd820('0x28')][_0xd820('0x29')],function(_0x38dee3){return{'name':_0x38dee3['fieldName'],'type':_0x38dee3[_0xd820('0x2a')][_0xd820('0x2b')]};});_0x39304c[_0xd820('0x2c')]=_[_0xd820('0x27')](_0x25ed74,_0xd820('0x24'));_0x39304c['query']=_['keys'](_0x135217[_0xd820('0x2d')]);_0x39304c[_0xd820('0x2e')]=_[_0xd820('0x2f')](_0x39304c[_0xd820('0x2c')],_0x39304c['query']);_0x43196a[_0xd820('0x30')]=_['intersection'](_0x39304c[_0xd820('0x2c')],qs['fields'](_0x135217['query'][_0xd820('0x31')]));_0x43196a['attributes']=_0x43196a['attributes'][_0xd820('0x32')]?_0x43196a['attributes']:_0x39304c[_0xd820('0x2c')];if(!_0x135217[_0xd820('0x2d')][_0xd820('0x33')](_0xd820('0x34'))){_0x43196a[_0xd820('0x1b')]=qs[_0xd820('0x1b')](_0x135217['query'][_0xd820('0x1b')]);_0x43196a[_0xd820('0x1a')]=qs[_0xd820('0x1a')](_0x135217[_0xd820('0x2d')]['offset']);}_0x43196a[_0xd820('0x35')]=qs[_0xd820('0x36')](_0x135217[_0xd820('0x2d')][_0xd820('0x36')]);_0x43196a['where']=qs[_0xd820('0x2e')](_[_0xd820('0x37')](_0x135217[_0xd820('0x2d')],_0x39304c[_0xd820('0x2e')]),_0x25ed74);if(_0x135217['query'][_0xd820('0x38')]){_0x43196a[_0xd820('0x39')]=_['merge'](_0x43196a[_0xd820('0x39')],{'$or':_[_0xd820('0x27')](_0x25ed74,function(_0x33c046){if(_0x33c046['type']!==_0xd820('0x3a')){var _0x4c95d5={};_0x4c95d5[_0x33c046[_0xd820('0x24')]]={'$like':'%'+_0x135217[_0xd820('0x2d')][_0xd820('0x38')]+'%'};return _0x4c95d5;}})});}_0x43196a=_[_0xd820('0x3b')]({},_0x43196a,_0x135217[_0xd820('0x3c')]);var _0x3bd109={'where':_0x43196a[_0xd820('0x39')]};return db[_0xd820('0x28')][_0xd820('0x1d')](_0x3bd109)[_0xd820('0x21')](function(_0x2a5674){_0x3e8c9c[_0xd820('0x1d')]=_0x2a5674;if(_0x135217[_0xd820('0x2d')]['includeAll']){_0x43196a[_0xd820('0x3d')]=[{'all':!![]}];}return db[_0xd820('0x28')]['findAll'](_0x43196a);})[_0xd820('0x21')](function(_0x31735d){_0x3e8c9c['rows']=_0x31735d;return _0x3e8c9c;})[_0xd820('0x21')](respondWithFilteredResult(_0x411276,_0x43196a))[_0xd820('0x3e')](handleError(_0x411276,null));};exports[_0xd820('0x3f')]=function(_0x22d406,_0x1a625a){var _0x52dbf8={'raw':![],'where':{'id':_0x22d406[_0xd820('0x40')]['id']}},_0x386564={};_0x386564[_0xd820('0x2c')]=_['keys'](db['SugarcrmAccount'][_0xd820('0x29')]);_0x386564[_0xd820('0x2d')]=_[_0xd820('0x41')](_0x22d406[_0xd820('0x2d')]);_0x386564[_0xd820('0x2e')]=_[_0xd820('0x2f')](_0x386564[_0xd820('0x2c')],_0x386564[_0xd820('0x2d')]);_0x52dbf8[_0xd820('0x30')]=_['intersection'](_0x386564[_0xd820('0x2c')],qs[_0xd820('0x31')](_0x22d406['query'][_0xd820('0x31')]));_0x52dbf8['attributes']=_0x52dbf8['attributes'][_0xd820('0x32')]?_0x52dbf8[_0xd820('0x30')]:_0x386564[_0xd820('0x2c')];if(_0x22d406['query'][_0xd820('0x42')]){_0x52dbf8[_0xd820('0x3d')]=[{'all':!![]}];}_0x52dbf8=_[_0xd820('0x3b')]({},_0x52dbf8,_0x22d406[_0xd820('0x3c')]);return db[_0xd820('0x28')][_0xd820('0x43')](_0x52dbf8)['then'](handleEntityNotFound(_0x1a625a,null))[_0xd820('0x21')](respondWithResult(_0x1a625a,null))['catch'](handleError(_0x1a625a,null));};exports[_0xd820('0x44')]=function(_0xdf86b,_0x2631ca){return db['SugarcrmAccount'][_0xd820('0x44')](_0xdf86b['body'],{})['then'](respondWithResult(_0x2631ca,0xc9))[_0xd820('0x3e')](handleError(_0x2631ca,null));};exports[_0xd820('0x20')]=function(_0x5ade6c,_0x1795ed){if(_0x5ade6c[_0xd820('0x45')]['id']){delete _0x5ade6c[_0xd820('0x45')]['id'];}return db['SugarcrmAccount'][_0xd820('0x43')]({'where':{'id':_0x5ade6c[_0xd820('0x40')]['id']}})[_0xd820('0x21')](handleEntityNotFound(_0x1795ed,null))['then'](saveUpdates(_0x5ade6c[_0xd820('0x45')],null))[_0xd820('0x21')](respondWithResult(_0x1795ed,null))[_0xd820('0x3e')](handleError(_0x1795ed,null));};exports['destroy']=function(_0x1fecac,_0x423bd2){return db[_0xd820('0x28')][_0xd820('0x43')]({'where':{'id':_0x1fecac['params']['id']}})[_0xd820('0x21')](handleEntityNotFound(_0x423bd2,null))['then'](removeEntity(_0x423bd2,null))[_0xd820('0x3e')](handleError(_0x423bd2,null));};exports[_0xd820('0x46')]=function(_0x4b9a2e,_0xe44ed2,_0x155ff2){var _0x126d1d={};var _0x5829c6={};var _0x1d897a;var _0x1dd10c;return db[_0xd820('0x28')][_0xd820('0x47')]({'where':{'id':_0x4b9a2e[_0xd820('0x40')]['id']}})[_0xd820('0x21')](handleEntityNotFound(_0xe44ed2,null))[_0xd820('0x21')](function(_0x40edec){if(_0x40edec){_0x1d897a=_0x40edec;_0x5829c6[_0xd820('0x2c')]=_[_0xd820('0x41')](db['SugarcrmConfiguration'][_0xd820('0x29')]);_0x5829c6[_0xd820('0x2d')]=_[_0xd820('0x41')](_0x4b9a2e[_0xd820('0x2d')]);_0x5829c6[_0xd820('0x2e')]=_[_0xd820('0x2f')](_0x5829c6[_0xd820('0x2c')],_0x5829c6[_0xd820('0x2d')]);_0x126d1d[_0xd820('0x30')]=_[_0xd820('0x2f')](_0x5829c6[_0xd820('0x2c')],qs['fields'](_0x4b9a2e[_0xd820('0x2d')][_0xd820('0x31')]));_0x126d1d[_0xd820('0x30')]=_0x126d1d[_0xd820('0x30')][_0xd820('0x32')]?_0x126d1d[_0xd820('0x30')]:_0x5829c6[_0xd820('0x2c')];_0x126d1d[_0xd820('0x35')]=qs[_0xd820('0x36')](_0x4b9a2e[_0xd820('0x2d')]['sort']);_0x126d1d[_0xd820('0x39')]=qs[_0xd820('0x2e')](_['pick'](_0x4b9a2e[_0xd820('0x2d')],_0x5829c6[_0xd820('0x2e')]));if(_0x4b9a2e[_0xd820('0x2d')]['filter']){_0x126d1d['where']=_[_0xd820('0x3b')](_0x126d1d[_0xd820('0x39')],{'$or':_[_0xd820('0x27')](_0x126d1d[_0xd820('0x30')],function(_0x504944){var _0x2233f6={};_0x2233f6[_0x504944]={'$like':'%'+_0x4b9a2e[_0xd820('0x2d')][_0xd820('0x38')]+'%'};return _0x2233f6;})});}_0x126d1d=_[_0xd820('0x3b')]({},_0x126d1d,_0x4b9a2e['options']);return _0x1d897a[_0xd820('0x46')](_0x126d1d);}})[_0xd820('0x21')](function(_0x489647){if(_0x489647){_0x1dd10c=_0x489647['length'];if(!_0x4b9a2e[_0xd820('0x2d')][_0xd820('0x33')]('nolimit')){_0x126d1d['limit']=qs['limit'](_0x4b9a2e[_0xd820('0x2d')][_0xd820('0x1b')]);_0x126d1d['offset']=qs[_0xd820('0x1a')](_0x4b9a2e[_0xd820('0x2d')][_0xd820('0x1a')]);}return _0x1d897a[_0xd820('0x46')](_0x126d1d);}})[_0xd820('0x21')](function(_0x5ece16){if(_0x5ece16){return _0x5ece16?{'count':_0x1dd10c,'rows':_0x5ece16}:null;}})[_0xd820('0x21')](respondWithResult(_0xe44ed2,null))[_0xd820('0x3e')](handleError(_0xe44ed2,null));};exports[_0xd820('0x48')]=function(_0x7fed59,_0xee47f2,_0x2c23aa){if(_0x7fed59[_0xd820('0x45')]['id']){delete _0x7fed59[_0xd820('0x45')]['id'];}return db[_0xd820('0x28')][_0xd820('0x47')]({'where':{'id':_0x7fed59[_0xd820('0x40')]['id']}})['then'](handleEntityNotFound(_0xee47f2,null))[_0xd820('0x21')](function(_0x46b886){if(_0x46b886){_0x7fed59[_0xd820('0x45')][_0xd820('0x49')]=_0x46b886['id'];_0x7fed59[_0xd820('0x45')][_0xd820('0x4a')]=integrations[_0xd820('0x4b')](_0x7fed59[_0xd820('0x45')][_0xd820('0x4c')],_0x7fed59['body']['type']);_0x7fed59[_0xd820('0x45')][_0xd820('0x4d')]=integrations['getDescriptions'](_0x7fed59['body'][_0xd820('0x4c')],_0x7fed59[_0xd820('0x45')][_0xd820('0x2a')]);return db[_0xd820('0x4e')][_0xd820('0x44')](_0x7fed59['body'],{'include':[{'model':db[_0xd820('0x4f')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xd820('0x21')](respondWithResult(_0xee47f2,null))[_0xd820('0x3e')](handleError(_0xee47f2,null));};exports[_0xd820('0x50')]=function(_0x21f79b,_0x3fa697,_0x3277fe){var _0x2e851d='';var _0x696d54=['id',_0xd820('0x24'),_0xd820('0x51'),_0xd820('0x52'),_0xd820('0x53'),_0xd820('0x54'),_0xd820('0x55'),_0xd820('0x56'),_0xd820('0x57'),_0xd820('0x58'),'parent_name',_0xd820('0x59')];return db[_0xd820('0x28')][_0xd820('0x47')]({'where':{'id':_0x21f79b[_0xd820('0x40')]['id']},'attributes':['id',_0xd820('0x5a'),_0xd820('0x5b'),_0xd820('0x5c')]})[_0xd820('0x21')](handleEntityNotFound(_0x3fa697,null))[_0xd820('0x21')](function(_0x556976){if(_0x556976){_0x2e851d=_0x556976['remoteUri'];var _0x2a8946=_0x2e851d['slice'](-0x1);if(_0x2a8946==='/'){_0x2e851d=_0x2e851d[_0xd820('0x5d')](0x0,_0x2e851d[_0xd820('0x5e')](_0x2a8946));}return rp({'method':_0xd820('0x5f'),'uri':util[_0xd820('0x60')](_0xd820('0x61'),_0x2e851d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd820('0x62'),'input_type':_0xd820('0x63'),'response_type':'JSON','rest_data':JSON[_0xd820('0x64')]({'user_auth':{'user_name':_0x556976[_0xd820('0x5a')],'password':_0x556976[_0xd820('0x5b')],'encryption':'PLAIN'},'application':_0xd820('0x65')})}});}})[_0xd820('0x21')](function(_0x42dc42){if(_0x42dc42&&_0x42dc42['name']!=='Invalid\x20Login'&&_0x42dc42[_0xd820('0x24')]!=='Password\x20Expired'){return rp({'method':_0xd820('0x5f'),'uri':util[_0xd820('0x60')]('%s%s',_0x2e851d,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0xd820('0x63'),'response_type':_0xd820('0x63'),'rest_data':JSON[_0xd820('0x64')]({'session':_0x42dc42['id'],'module_name':_0xd820('0x66')})}})[_0xd820('0x21')](function(_0x11f91f){if(_0x11f91f){var _0x3a4c98=_[_0xd820('0x67')](_0x11f91f[_0xd820('0x68')]);_['remove'](_0x3a4c98,function(_0x5e4f5a){return _0x696d54[_0xd820('0x69')](_0x5e4f5a[_0xd820('0x24')]);});return{'count':_0x3a4c98[_0xd820('0x32')],'rows':_[_0xd820('0x27')](_0x3a4c98,function(_0x48f500){return{'id':_0x48f500['name'],'name':_0x48f500['label'],'custom':_['endsWith'](_0x48f500['name'],'_c')?!![]:![],'options':_0x48f500[_0xd820('0x3c')]?_['map'](_[_0xd820('0x67')](_0x48f500[_0xd820('0x3c')]),function(_0x33bc5b){return{'name':_0x33bc5b[_0xd820('0x6a')],'value':_0x33bc5b[_0xd820('0x24')]};}):[]};})};}})['then'](respondWithResult(_0x3fa697,null))[_0xd820('0x3e')](function(_0x48e8c1){var _0x3dc2ae=_0x21f79b[_0xd820('0x2d')]['test']?0x1f4:_0x48e8c1[_0xd820('0x6b')]||0x1f4;logger[_0xd820('0x6c')](_0xd820('0x6d'),'getFields',_0x3dc2ae,JSON[_0xd820('0x64')](_0x48e8c1));delete _0x48e8c1[_0xd820('0x24')];if(_0x3dc2ae===0x191){_0x3dc2ae=0x190;}_0x3fa697['status'](_0x3dc2ae)[_0xd820('0x25')](_0x21f79b[_0xd820('0x2d')][_0xd820('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x48e8c1[_0xd820('0x6b')]}:_0x48e8c1);});}else{var _0x182a16=0x1f4;_0x3fa697[_0xd820('0x19')](_0x182a16)[_0xd820('0x25')]({'message':_0xd820('0x6f'),'statusCode':0x190});}});};
\ No newline at end of file
index 6d01ec4..6c7b18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51d7=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0xfbe234,_0x7d4de9){var _0x3cec2c=function(_0x92d638){while(--_0x92d638){_0xfbe234['push'](_0xfbe234['shift']());}};_0x3cec2c(++_0x7d4de9);}(_0x51d7,0xcf));var _0x751d=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x51d7[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x751d('0x0'));var util=require(_0x751d('0x1'));var logger=require(_0x751d('0x2'))(_0x751d('0x3'));var moment=require(_0x751d('0x4'));var BPromise=require(_0x751d('0x5'));var rp=require(_0x751d('0x6'));var fs=require('fs');var path=require(_0x751d('0x7'));var rimraf=require(_0x751d('0x8'));var config=require(_0x751d('0x9'));var attributes=require(_0x751d('0xa'));var integrations=require(_0x751d('0xb'));module[_0x751d('0xc')]=function(_0x2a4462,_0x3d579){return _0x2a4462[_0x751d('0xd')](_0x751d('0xe'),attributes,{'tableName':_0x751d('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb94c=['moment','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api'];(function(_0x22f8a2,_0x2c6908){var _0x586c6e=function(_0xb3358b){while(--_0xb3358b){_0x22f8a2['push'](_0x22f8a2['shift']());}};_0x586c6e(++_0x2c6908);}(_0xb94c,0x176));var _0xcb94=function(_0x3ceb7e,_0x284397){_0x3ceb7e=_0x3ceb7e-0x0;var _0x5e69d0=_0xb94c[_0x3ceb7e];return _0x5e69d0;};'use strict';var _=require(_0xcb94('0x0'));var util=require(_0xcb94('0x1'));var logger=require('../../config/logger')(_0xcb94('0x2'));var moment=require(_0xcb94('0x3'));var BPromise=require('bluebird');var rp=require(_0xcb94('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb94('0x5'));var config=require(_0xcb94('0x6'));var attributes=require(_0xcb94('0x7'));var integrations=require(_0xcb94('0x8'));module[_0xcb94('0x9')]=function(_0x5b8081,_0x3ab328){return _0x5b8081[_0xcb94('0xa')](_0xcb94('0xb'),attributes,{'tableName':_0xcb94('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c972ddc..1981cdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8feb=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowSugarcrmAccount','lodash','randomstring','ioredis'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x8feb,0xc9));var _0xb8fe=function(_0x4f5abc,_0x335343){_0x4f5abc=_0x4f5abc-0x0;var _0x4b04e9=_0x8feb[_0x4f5abc];return _0x4b04e9;};'use strict';var _=require(_0xb8fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8fe('0x1'));var fs=require('fs');var Redis=require(_0xb8fe('0x2'));var db=require(_0xb8fe('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8fe('0x4'))('rpc');var config=require(_0xb8fe('0x5'));var jayson=require(_0xb8fe('0x6'));var client=jayson[_0xb8fe('0x7')][_0xb8fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x319380,_0xc5b095,_0x30b4dd){return new BPromise(function(_0xe116a3,_0x1af7b1){return client[_0xb8fe('0x9')](_0x319380,_0x30b4dd)[_0xb8fe('0xa')](function(_0x1b7c3c){logger[_0xb8fe('0xb')](_0xb8fe('0xc'),_0xc5b095,_0xb8fe('0xd'));logger[_0xb8fe('0xe')](_0xb8fe('0xf'),_0xc5b095,_0xb8fe('0xd'),JSON[_0xb8fe('0x10')](_0x1b7c3c));if(_0x1b7c3c[_0xb8fe('0x11')]){if(_0x1b7c3c['error'][_0xb8fe('0x12')]===0x1f4){logger['error'](_0xb8fe('0xc'),_0xc5b095,_0x1b7c3c[_0xb8fe('0x11')][_0xb8fe('0x13')]);return _0x1af7b1(_0x1b7c3c['error']['message']);}logger[_0xb8fe('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0xc5b095,_0x1b7c3c[_0xb8fe('0x11')]['message']);return _0xe116a3(_0x1b7c3c[_0xb8fe('0x11')][_0xb8fe('0x13')]);}else{logger['info'](_0xb8fe('0xc'),_0xc5b095,'request\x20sent');_0xe116a3(_0x1b7c3c[_0xb8fe('0x14')][_0xb8fe('0x13')]);}})[_0xb8fe('0x15')](function(_0x13bb67){logger[_0xb8fe('0x11')](_0xb8fe('0xc'),_0xc5b095,_0x13bb67);_0x1af7b1(_0x13bb67);});});}exports[_0xb8fe('0x16')]=function(_0x2ff73e){var _0x173ec2=this;return new Promise(function(_0x270b44,_0x1bfc07){return db[_0xb8fe('0x17')][_0xb8fe('0x18')]({'raw':_0x2ff73e[_0xb8fe('0x19')]?_0x2ff73e[_0xb8fe('0x19')][_0xb8fe('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ff73e[_0xb8fe('0x19')]?_0x2ff73e[_0xb8fe('0x19')][_0xb8fe('0x1b')]||null:null,'attributes':_0x2ff73e[_0xb8fe('0x19')]?_0x2ff73e[_0xb8fe('0x19')][_0xb8fe('0x1c')]||null:null,'limit':_0x2ff73e[_0xb8fe('0x19')]?_0x2ff73e[_0xb8fe('0x19')][_0xb8fe('0x1d')]||null:null,'include':_0x2ff73e[_0xb8fe('0x19')]?_0x2ff73e['options'][_0xb8fe('0x1e')]?_[_0xb8fe('0x1f')](_0x2ff73e[_0xb8fe('0x19')][_0xb8fe('0x1e')],function(_0x8de22f){return{'model':db[_0x8de22f[_0xb8fe('0x20')]],'as':_0x8de22f['as'],'attributes':_0x8de22f[_0xb8fe('0x1c')],'include':_0x8de22f[_0xb8fe('0x1e')]?_[_0xb8fe('0x1f')](_0x8de22f['include'],function(_0x1bcd85){return{'model':db[_0x1bcd85['model']],'as':_0x1bcd85['as'],'attributes':_0x1bcd85[_0xb8fe('0x1c')],'include':_0x1bcd85[_0xb8fe('0x1e')]?_[_0xb8fe('0x1f')](_0x1bcd85[_0xb8fe('0x1e')],function(_0x4ff9ff){return{'model':db[_0x4ff9ff[_0xb8fe('0x20')]],'as':_0x4ff9ff['as'],'attributes':_0x4ff9ff[_0xb8fe('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb8fe('0xa')](function(_0x540894){logger[_0xb8fe('0xb')](_0xb8fe('0x16'),_0x2ff73e);logger[_0xb8fe('0xe')](_0xb8fe('0x16'),_0x2ff73e,JSON[_0xb8fe('0x10')](_0x540894));_0x270b44(_0x540894);})[_0xb8fe('0x15')](function(_0x38e815){logger[_0xb8fe('0x11')](_0xb8fe('0x16'),_0x38e815[_0xb8fe('0x13')],_0x2ff73e);_0x1bfc07(_0x173ec2[_0xb8fe('0x11')](0x1f4,_0x38e815[_0xb8fe('0x13')]));});});};exports[_0xb8fe('0x21')]=function(_0x5eba61){var _0x4399db=this;return new Promise(function(_0x256d38,_0x4889c5){return db[_0xb8fe('0x17')]['find']({'raw':_0x5eba61[_0xb8fe('0x19')]?_0x5eba61[_0xb8fe('0x19')][_0xb8fe('0x1a')]===undefined?!![]:![]:!![],'where':_0x5eba61['options']?_0x5eba61[_0xb8fe('0x19')][_0xb8fe('0x1b')]||null:null,'attributes':_0x5eba61[_0xb8fe('0x19')]?_0x5eba61[_0xb8fe('0x19')][_0xb8fe('0x1c')]||null:null,'include':_0x5eba61[_0xb8fe('0x19')]?_0x5eba61[_0xb8fe('0x19')][_0xb8fe('0x1e')]?_[_0xb8fe('0x1f')](_0x5eba61[_0xb8fe('0x19')]['include'],function(_0x11ad58){return{'model':db[_0x11ad58[_0xb8fe('0x20')]],'as':_0x11ad58['as'],'attributes':_0x11ad58['attributes'],'include':_0x11ad58['include']?_['map'](_0x11ad58['include'],function(_0x2a0df4){return{'model':db[_0x2a0df4[_0xb8fe('0x20')]],'as':_0x2a0df4['as'],'attributes':_0x2a0df4[_0xb8fe('0x1c')],'include':_0x2a0df4[_0xb8fe('0x1e')]?_[_0xb8fe('0x1f')](_0x2a0df4[_0xb8fe('0x1e')],function(_0x15f977){return{'model':db[_0x15f977[_0xb8fe('0x20')]],'as':_0x15f977['as'],'attributes':_0x15f977[_0xb8fe('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e6d10){logger['info'](_0xb8fe('0x21'),_0x5eba61);logger[_0xb8fe('0xe')]('ShowSugarcrmAccount',_0x5eba61,JSON[_0xb8fe('0x10')](_0x2e6d10));_0x256d38(_0x2e6d10);})['catch'](function(_0x4da2a8){logger['error'](_0xb8fe('0x21'),_0x4da2a8[_0xb8fe('0x13')],_0x5eba61);_0x4889c5(_0x4399db['error'](0x1f4,_0x4da2a8[_0xb8fe('0x13')]));});});};
\ No newline at end of file
+var _0xa6e4=['info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','include','map','model','attributes','debug','ShowSugarcrmAccount','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0xe455e7,_0x29fb65){var _0xfc683e=function(_0x10ee38){while(--_0x10ee38){_0xe455e7['push'](_0xe455e7['shift']());}};_0xfc683e(++_0x29fb65);}(_0xa6e4,0x16a));var _0x4a6e=function(_0x2135f8,_0x44a807){_0x2135f8=_0x2135f8-0x0;var _0x2f1a26=_0xa6e4[_0x2135f8];return _0x2f1a26;};'use strict';var _=require(_0x4a6e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4a6e('0x1'));var rs=require(_0x4a6e('0x2'));var fs=require('fs');var Redis=require(_0x4a6e('0x3'));var db=require(_0x4a6e('0x4'))['db'];var utils=require(_0x4a6e('0x5'));var logger=require(_0x4a6e('0x6'))(_0x4a6e('0x7'));var config=require(_0x4a6e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4a6e('0x9')][_0x4a6e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f309a,_0xf62297,_0x73724e){return new BPromise(function(_0x3e9a5d,_0x46d3d1){return client['request'](_0x4f309a,_0x73724e)[_0x4a6e('0xb')](function(_0x4ef917){logger[_0x4a6e('0xc')]('SugarcrmAccount,\x20%s,\x20%s',_0xf62297,_0x4a6e('0xd'));logger['debug'](_0x4a6e('0xe'),_0xf62297,'request\x20sent',JSON[_0x4a6e('0xf')](_0x4ef917));if(_0x4ef917['error']){if(_0x4ef917[_0x4a6e('0x10')][_0x4a6e('0x11')]===0x1f4){logger[_0x4a6e('0x10')](_0x4a6e('0x12'),_0xf62297,_0x4ef917['error'][_0x4a6e('0x13')]);return _0x46d3d1(_0x4ef917[_0x4a6e('0x10')]['message']);}logger[_0x4a6e('0x10')](_0x4a6e('0x12'),_0xf62297,_0x4ef917[_0x4a6e('0x10')][_0x4a6e('0x13')]);return _0x3e9a5d(_0x4ef917['error'][_0x4a6e('0x13')]);}else{logger['info'](_0x4a6e('0x12'),_0xf62297,_0x4a6e('0xd'));_0x3e9a5d(_0x4ef917[_0x4a6e('0x14')][_0x4a6e('0x13')]);}})[_0x4a6e('0x15')](function(_0x3d98ad){logger[_0x4a6e('0x10')](_0x4a6e('0x12'),_0xf62297,_0x3d98ad);_0x46d3d1(_0x3d98ad);});});}exports[_0x4a6e('0x16')]=function(_0x2cf219){var _0x5f32e7=this;return new Promise(function(_0x30123a,_0x5db5cd){return db[_0x4a6e('0x17')][_0x4a6e('0x18')]({'raw':_0x2cf219[_0x4a6e('0x19')]?_0x2cf219[_0x4a6e('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2cf219[_0x4a6e('0x19')]?_0x2cf219[_0x4a6e('0x19')][_0x4a6e('0x1a')]||null:null,'attributes':_0x2cf219[_0x4a6e('0x19')]?_0x2cf219[_0x4a6e('0x19')]['attributes']||null:null,'limit':_0x2cf219[_0x4a6e('0x19')]?_0x2cf219['options']['limit']||null:null,'include':_0x2cf219[_0x4a6e('0x19')]?_0x2cf219[_0x4a6e('0x19')][_0x4a6e('0x1b')]?_[_0x4a6e('0x1c')](_0x2cf219['options']['include'],function(_0x4b730d){return{'model':db[_0x4b730d[_0x4a6e('0x1d')]],'as':_0x4b730d['as'],'attributes':_0x4b730d[_0x4a6e('0x1e')],'include':_0x4b730d[_0x4a6e('0x1b')]?_[_0x4a6e('0x1c')](_0x4b730d['include'],function(_0x889a7c){return{'model':db[_0x889a7c[_0x4a6e('0x1d')]],'as':_0x889a7c['as'],'attributes':_0x889a7c[_0x4a6e('0x1e')],'include':_0x889a7c[_0x4a6e('0x1b')]?_[_0x4a6e('0x1c')](_0x889a7c['include'],function(_0xafe2d0){return{'model':db[_0xafe2d0[_0x4a6e('0x1d')]],'as':_0xafe2d0['as'],'attributes':_0xafe2d0[_0x4a6e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a6e('0xb')](function(_0x4fede1){logger[_0x4a6e('0xc')]('GetSugarcrmAccount',_0x2cf219);logger[_0x4a6e('0x1f')](_0x4a6e('0x16'),_0x2cf219,JSON['stringify'](_0x4fede1));_0x30123a(_0x4fede1);})['catch'](function(_0x4a8b00){logger[_0x4a6e('0x10')](_0x4a6e('0x16'),_0x4a8b00[_0x4a6e('0x13')],_0x2cf219);_0x5db5cd(_0x5f32e7[_0x4a6e('0x10')](0x1f4,_0x4a8b00[_0x4a6e('0x13')]));});});};exports[_0x4a6e('0x20')]=function(_0x24abf9){var _0x58e3a0=this;return new Promise(function(_0x10de64,_0x449101){return db[_0x4a6e('0x17')]['find']({'raw':_0x24abf9[_0x4a6e('0x19')]?_0x24abf9['options'][_0x4a6e('0x21')]===undefined?!![]:![]:!![],'where':_0x24abf9[_0x4a6e('0x19')]?_0x24abf9['options'][_0x4a6e('0x1a')]||null:null,'attributes':_0x24abf9[_0x4a6e('0x19')]?_0x24abf9[_0x4a6e('0x19')]['attributes']||null:null,'include':_0x24abf9[_0x4a6e('0x19')]?_0x24abf9[_0x4a6e('0x19')]['include']?_[_0x4a6e('0x1c')](_0x24abf9[_0x4a6e('0x19')][_0x4a6e('0x1b')],function(_0x414894){return{'model':db[_0x414894[_0x4a6e('0x1d')]],'as':_0x414894['as'],'attributes':_0x414894[_0x4a6e('0x1e')],'include':_0x414894['include']?_[_0x4a6e('0x1c')](_0x414894[_0x4a6e('0x1b')],function(_0xab6c32){return{'model':db[_0xab6c32[_0x4a6e('0x1d')]],'as':_0xab6c32['as'],'attributes':_0xab6c32['attributes'],'include':_0xab6c32[_0x4a6e('0x1b')]?_['map'](_0xab6c32[_0x4a6e('0x1b')],function(_0x4ed913){return{'model':db[_0x4ed913[_0x4a6e('0x1d')]],'as':_0x4ed913['as'],'attributes':_0x4ed913[_0x4a6e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4a6e('0xb')](function(_0x2ff9cc){logger[_0x4a6e('0xc')]('ShowSugarcrmAccount',_0x24abf9);logger[_0x4a6e('0x1f')](_0x4a6e('0x20'),_0x24abf9,JSON[_0x4a6e('0xf')](_0x2ff9cc));_0x10de64(_0x2ff9cc);})[_0x4a6e('0x15')](function(_0x2b7279){logger[_0x4a6e('0x10')](_0x4a6e('0x20'),_0x2b7279[_0x4a6e('0x13')],_0x24abf9);_0x449101(_0x58e3a0[_0x4a6e('0x10')](0x1f4,_0x2b7279['message']));});});};
\ No newline at end of file
index 741a06d..c34ea01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf211=['/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','/:id','show'];(function(_0x1f1ae5,_0x4a2852){var _0x547db8=function(_0xaa7b39){while(--_0xaa7b39){_0x1f1ae5['push'](_0x1f1ae5['shift']());}};_0x547db8(++_0x4a2852);}(_0xf211,0x198));var _0x1f21=function(_0x274f92,_0x2a349b){_0x274f92=_0x274f92-0x0;var _0x1fb917=_0xf211[_0x274f92];return _0x1fb917;};'use strict';var multer=require(_0x1f21('0x0'));var util=require(_0x1f21('0x1'));var path=require('path');var timeout=require(_0x1f21('0x2'));var express=require(_0x1f21('0x3'));var router=express['Router']();var fs_extra=require(_0x1f21('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1f21('0x5'));var config=require(_0x1f21('0x6'));var controller=require(_0x1f21('0x7'));router[_0x1f21('0x8')]('/',auth[_0x1f21('0x9')](),controller['index']);router['get'](_0x1f21('0xa'),auth[_0x1f21('0x9')](),controller[_0x1f21('0xb')]);router[_0x1f21('0x8')](_0x1f21('0xc'),auth[_0x1f21('0x9')](),controller[_0x1f21('0xd')]);router[_0x1f21('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x1f21('0x8')](_0x1f21('0xe'),auth[_0x1f21('0x9')](),controller[_0x1f21('0xf')]);router[_0x1f21('0x10')]('/',auth[_0x1f21('0x9')](),controller['create']);router[_0x1f21('0x11')](_0x1f21('0xa'),auth[_0x1f21('0x9')](),controller[_0x1f21('0x12')]);router[_0x1f21('0x13')](_0x1f21('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1f21('0x14')]=router;
\ No newline at end of file
+var _0xf7be=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','exports','multer','util','path'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xf7be,0x9e));var _0xef7b=function(_0x303a4f,_0x861058){_0x303a4f=_0x303a4f-0x0;var _0x4adfe0=_0xf7be[_0x303a4f];return _0x4adfe0;};'use strict';var multer=require(_0xef7b('0x0'));var util=require(_0xef7b('0x1'));var path=require(_0xef7b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xef7b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xef7b('0x4'));var interaction=require(_0xef7b('0x5'));var config=require(_0xef7b('0x6'));var controller=require(_0xef7b('0x7'));router[_0xef7b('0x8')]('/',auth[_0xef7b('0x9')](),controller[_0xef7b('0xa')]);router['get'](_0xef7b('0xb'),auth[_0xef7b('0x9')](),controller[_0xef7b('0xc')]);router[_0xef7b('0x8')](_0xef7b('0xd'),auth[_0xef7b('0x9')](),controller[_0xef7b('0xe')]);router[_0xef7b('0x8')](_0xef7b('0xf'),auth[_0xef7b('0x9')](),controller[_0xef7b('0x10')]);router[_0xef7b('0x8')](_0xef7b('0x11'),auth[_0xef7b('0x9')](),controller[_0xef7b('0x12')]);router[_0xef7b('0x13')]('/',auth[_0xef7b('0x9')](),controller[_0xef7b('0x14')]);router['put'](_0xef7b('0xb'),auth[_0xef7b('0x9')](),controller[_0xef7b('0x15')]);router['delete']('/:id',auth[_0xef7b('0x9')](),controller['destroy']);module[_0xef7b('0x16')]=router;
\ No newline at end of file
index f346fbf..d999524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x849b=['STRING'];(function(_0x7e2f76,_0xe593e5){var _0x535471=function(_0x3c1a0b){while(--_0x3c1a0b){_0x7e2f76['push'](_0x7e2f76['shift']());}};_0x535471(++_0xe593e5);}(_0x849b,0xfb));var _0xb849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb849('0x0')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8448=['exports','STRING'];(function(_0x420513,_0x30eae3){var _0x1b44ec=function(_0x644f88){while(--_0x644f88){_0x420513['push'](_0x420513['shift']());}};_0x1b44ec(++_0x30eae3);}(_0x8448,0xc6));var _0x8844=function(_0x35d59c,_0x341ef9){_0x35d59c=_0x35d59c-0x0;var _0x18cd27=_0x8448[_0x35d59c];return _0x18cd27;};'use strict';var Sequelize=require('sequelize');module[_0x8844('0x0')]={'name':{'type':Sequelize[_0x8844('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 3f7a5a8..fad0081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39fe=['save','then','destroy','error','stack','name','send','index','map','SugarcrmConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','options','create','body','find','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','reject'];(function(_0x231d34,_0x58e1f7){var _0x59d329=function(_0x4b37c5){while(--_0x4b37c5){_0x231d34['push'](_0x231d34['shift']());}};_0x59d329(++_0x58e1f7);}(_0x39fe,0x120));var _0xe39f=function(_0x2942f3,_0x5dc71d){_0x2942f3=_0x2942f3-0x0;var _0x5b917e=_0x39fe[_0x2942f3];return _0x5b917e;};'use strict';var emlformat=require(_0xe39f('0x0'));var rimraf=require(_0xe39f('0x1'));var zipdir=require(_0xe39f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe39f('0x3'));var moment=require(_0xe39f('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe39f('0x5'));var path=require(_0xe39f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe39f('0x7'));var fs=require('fs');var fs_extra=require(_0xe39f('0x8'));var _=require(_0xe39f('0x9'));var squel=require(_0xe39f('0xa'));var crypto=require(_0xe39f('0xb'));var jsforce=require(_0xe39f('0xc'));var deskjs=require(_0xe39f('0xd'));var toCsv=require(_0xe39f('0xe'));var querystring=require(_0xe39f('0xf'));var Papa=require(_0xe39f('0x10'));var Redis=require('ioredis');var authService=require(_0xe39f('0x11'));var qs=require(_0xe39f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe39f('0x13'));var logger=require(_0xe39f('0x14'))(_0xe39f('0x15'));var utils=require('../../config/utils');var config=require(_0xe39f('0x16'));var licenseUtil=require(_0xe39f('0x17'));var db=require(_0xe39f('0x18'))['db'];function respondWithStatusCode(_0x1745ab,_0x2fb74a){_0x2fb74a=_0x2fb74a||0xcc;return function(_0x26b9b3){if(_0x26b9b3){return _0x1745ab[_0xe39f('0x19')](_0x2fb74a);}return _0x1745ab['status'](_0x2fb74a)[_0xe39f('0x1a')]();};}function respondWithResult(_0x10886e,_0x21de05){_0x21de05=_0x21de05||0xc8;return function(_0x2a79ff){if(_0x2a79ff){return _0x10886e[_0xe39f('0x1b')](_0x21de05)[_0xe39f('0x1c')](_0x2a79ff);}};}function respondWithFilteredResult(_0x185b77,_0x2716cc){return function(_0x412357){if(_0x412357){var _0x2603e6=typeof _0x2716cc['offset']===_0xe39f('0x1d')&&typeof _0x2716cc[_0xe39f('0x1e')]===_0xe39f('0x1d');var _0x48b528=_0x412357[_0xe39f('0x1f')];var _0x4bd43e=_0x2603e6?0x0:_0x2716cc[_0xe39f('0x20')];var _0x2f4e06=_0x2603e6?_0x412357['count']:_0x2716cc[_0xe39f('0x20')]+_0x2716cc['limit'];var _0x4caa2c;if(_0x2f4e06>=_0x48b528){_0x2f4e06=_0x48b528;_0x4caa2c=0xc8;}else{_0x4caa2c=0xce;}_0x185b77[_0xe39f('0x1b')](_0x4caa2c);return _0x185b77[_0xe39f('0x21')]('Content-Range',_0x4bd43e+'-'+_0x2f4e06+'/'+_0x48b528)['json'](_0x412357);}return null;};}function patchUpdates(_0x5a3c20){return function(_0x465487){try{jsonpatch[_0xe39f('0x22')](_0x465487,_0x5a3c20,!![]);}catch(_0x40e5a7){return BPromise[_0xe39f('0x23')](_0x40e5a7);}return _0x465487[_0xe39f('0x24')]();};}function saveUpdates(_0x4b102f,_0x1ab028){return function(_0x5458c6){if(_0x5458c6){return _0x5458c6['update'](_0x4b102f)[_0xe39f('0x25')](function(_0x98a0e){return _0x98a0e;});}return null;};}function removeEntity(_0x5394b,_0x4f37a4){return function(_0x22b36e){if(_0x22b36e){return _0x22b36e[_0xe39f('0x26')]()[_0xe39f('0x25')](function(){_0x5394b[_0xe39f('0x1b')](0xcc)[_0xe39f('0x1a')]();});}};}function handleEntityNotFound(_0x3197c0,_0x1721ce){return function(_0x523be2){if(!_0x523be2){_0x3197c0[_0xe39f('0x19')](0x194);}return _0x523be2;};}function handleError(_0x5c977d,_0x4afbd1){_0x4afbd1=_0x4afbd1||0x1f4;return function(_0x1791e2){logger[_0xe39f('0x27')](_0x1791e2[_0xe39f('0x28')]);if(_0x1791e2[_0xe39f('0x29')]){delete _0x1791e2[_0xe39f('0x29')];}_0x5c977d['status'](_0x4afbd1)[_0xe39f('0x2a')](_0x1791e2);};}exports[_0xe39f('0x2b')]=function(_0xc8b602,_0x2ac6fd){var _0x4a6a30={},_0x1c0c45={},_0x4f497e={'count':0x0,'rows':[]};var _0x1c12e8=_[_0xe39f('0x2c')](db[_0xe39f('0x2d')][_0xe39f('0x2e')],function(_0x4dedc2){return{'name':_0x4dedc2['fieldName'],'type':_0x4dedc2[_0xe39f('0x2f')][_0xe39f('0x30')]};});_0x1c0c45[_0xe39f('0x31')]=_[_0xe39f('0x2c')](_0x1c12e8,_0xe39f('0x29'));_0x1c0c45[_0xe39f('0x32')]=_[_0xe39f('0x33')](_0xc8b602[_0xe39f('0x32')]);_0x1c0c45[_0xe39f('0x34')]=_[_0xe39f('0x35')](_0x1c0c45['model'],_0x1c0c45['query']);_0x4a6a30['attributes']=_[_0xe39f('0x35')](_0x1c0c45['model'],qs[_0xe39f('0x36')](_0xc8b602[_0xe39f('0x32')][_0xe39f('0x36')]));_0x4a6a30[_0xe39f('0x37')]=_0x4a6a30[_0xe39f('0x37')][_0xe39f('0x38')]?_0x4a6a30[_0xe39f('0x37')]:_0x1c0c45[_0xe39f('0x31')];if(!_0xc8b602[_0xe39f('0x32')][_0xe39f('0x39')](_0xe39f('0x3a'))){_0x4a6a30['limit']=qs[_0xe39f('0x1e')](_0xc8b602[_0xe39f('0x32')][_0xe39f('0x1e')]);_0x4a6a30[_0xe39f('0x20')]=qs[_0xe39f('0x20')](_0xc8b602['query'][_0xe39f('0x20')]);}_0x4a6a30[_0xe39f('0x3b')]=qs[_0xe39f('0x3c')](_0xc8b602[_0xe39f('0x32')][_0xe39f('0x3c')]);_0x4a6a30['where']=qs['filters'](_[_0xe39f('0x3d')](_0xc8b602['query'],_0x1c0c45[_0xe39f('0x34')]),_0x1c12e8);if(_0xc8b602['query'][_0xe39f('0x3e')]){_0x4a6a30[_0xe39f('0x3f')]=_[_0xe39f('0x40')](_0x4a6a30['where'],{'$or':_[_0xe39f('0x2c')](_0x1c12e8,function(_0x43fd60){if(_0x43fd60[_0xe39f('0x2f')]!==_0xe39f('0x41')){var _0x541af6={};_0x541af6[_0x43fd60['name']]={'$like':'%'+_0xc8b602[_0xe39f('0x32')][_0xe39f('0x3e')]+'%'};return _0x541af6;}})});}_0x4a6a30=_['merge']({},_0x4a6a30,_0xc8b602['options']);var _0x43b18a={'where':_0x4a6a30[_0xe39f('0x3f')]};return db['SugarcrmConfiguration'][_0xe39f('0x1f')](_0x43b18a)['then'](function(_0x148342){_0x4f497e['count']=_0x148342;if(_0xc8b602[_0xe39f('0x32')]['includeAll']){_0x4a6a30[_0xe39f('0x42')]=[{'all':!![]}];}return db[_0xe39f('0x2d')][_0xe39f('0x43')](_0x4a6a30);})[_0xe39f('0x25')](function(_0x578105){_0x4f497e[_0xe39f('0x44')]=_0x578105;return _0x4f497e;})[_0xe39f('0x25')](respondWithFilteredResult(_0x2ac6fd,_0x4a6a30))[_0xe39f('0x45')](handleError(_0x2ac6fd,null));};exports[_0xe39f('0x46')]=function(_0x2c0630,_0x2fa493){var _0x1eb76a={'raw':![],'where':{'id':_0x2c0630[_0xe39f('0x47')]['id']}},_0x492e7f={};_0x492e7f[_0xe39f('0x31')]=_[_0xe39f('0x33')](db[_0xe39f('0x2d')][_0xe39f('0x2e')]);_0x492e7f['query']=_[_0xe39f('0x33')](_0x2c0630[_0xe39f('0x32')]);_0x492e7f['filters']=_['intersection'](_0x492e7f[_0xe39f('0x31')],_0x492e7f[_0xe39f('0x32')]);_0x1eb76a[_0xe39f('0x37')]=_[_0xe39f('0x35')](_0x492e7f['model'],qs[_0xe39f('0x36')](_0x2c0630[_0xe39f('0x32')][_0xe39f('0x36')]));_0x1eb76a['attributes']=_0x1eb76a[_0xe39f('0x37')][_0xe39f('0x38')]?_0x1eb76a[_0xe39f('0x37')]:_0x492e7f[_0xe39f('0x31')];if(_0x2c0630[_0xe39f('0x32')]['includeAll']){_0x1eb76a[_0xe39f('0x42')]=[{'all':!![]}];}_0x1eb76a=_[_0xe39f('0x40')]({},_0x1eb76a,_0x2c0630[_0xe39f('0x48')]);return db['SugarcrmConfiguration']['find'](_0x1eb76a)[_0xe39f('0x25')](handleEntityNotFound(_0x2fa493,null))['then'](respondWithResult(_0x2fa493,null))['catch'](handleError(_0x2fa493,null));};exports[_0xe39f('0x49')]=function(_0x538406,_0x295bf1){return db[_0xe39f('0x2d')][_0xe39f('0x49')](_0x538406[_0xe39f('0x4a')],{})[_0xe39f('0x25')](respondWithResult(_0x295bf1,0xc9))[_0xe39f('0x45')](handleError(_0x295bf1,null));};exports['update']=function(_0x2b13df,_0x146373){if(_0x2b13df[_0xe39f('0x4a')]['id']){delete _0x2b13df['body']['id'];}return db[_0xe39f('0x2d')][_0xe39f('0x4b')]({'where':{'id':_0x2b13df[_0xe39f('0x47')]['id']}})['then'](handleEntityNotFound(_0x146373,null))[_0xe39f('0x25')](saveUpdates(_0x2b13df[_0xe39f('0x4a')],null))[_0xe39f('0x25')](respondWithResult(_0x146373,null))[_0xe39f('0x45')](handleError(_0x146373,null));};exports['destroy']=function(_0x2519c5,_0x18713f){return db[_0xe39f('0x2d')][_0xe39f('0x4b')]({'where':{'id':_0x2519c5['params']['id']}})[_0xe39f('0x25')](handleEntityNotFound(_0x18713f,null))[_0xe39f('0x25')](removeEntity(_0x18713f,null))[_0xe39f('0x45')](handleError(_0x18713f,null));};exports[_0xe39f('0x4c')]=function(_0x485d2f,_0x1ab7ed,_0x5be53f){var _0xac579b={};var _0x571924={};var _0x2abaad;var _0x1433ee;return db[_0xe39f('0x2d')][_0xe39f('0x4d')]({'where':{'id':_0x485d2f[_0xe39f('0x47')]['id']}})[_0xe39f('0x25')](handleEntityNotFound(_0x1ab7ed,null))[_0xe39f('0x25')](function(_0x3add75){if(_0x3add75){_0x2abaad=_0x3add75;_0x571924[_0xe39f('0x31')]=_[_0xe39f('0x33')](db[_0xe39f('0x4e')][_0xe39f('0x2e')]);_0x571924[_0xe39f('0x32')]=_[_0xe39f('0x33')](_0x485d2f[_0xe39f('0x32')]);_0x571924[_0xe39f('0x34')]=_[_0xe39f('0x35')](_0x571924[_0xe39f('0x31')],_0x571924[_0xe39f('0x32')]);_0xac579b[_0xe39f('0x37')]=_[_0xe39f('0x35')](_0x571924[_0xe39f('0x31')],qs[_0xe39f('0x36')](_0x485d2f[_0xe39f('0x32')][_0xe39f('0x36')]));_0xac579b[_0xe39f('0x37')]=_0xac579b[_0xe39f('0x37')][_0xe39f('0x38')]?_0xac579b['attributes']:_0x571924[_0xe39f('0x31')];_0xac579b[_0xe39f('0x3b')]=qs[_0xe39f('0x3c')](_0x485d2f[_0xe39f('0x32')][_0xe39f('0x3c')]);_0xac579b['where']=qs[_0xe39f('0x34')](_[_0xe39f('0x3d')](_0x485d2f[_0xe39f('0x32')],_0x571924['filters']));if(_0x485d2f[_0xe39f('0x32')][_0xe39f('0x3e')]){_0xac579b[_0xe39f('0x3f')]=_[_0xe39f('0x40')](_0xac579b[_0xe39f('0x3f')],{'$or':_[_0xe39f('0x2c')](_0xac579b[_0xe39f('0x37')],function(_0x558d67){var _0x1d056f={};_0x1d056f[_0x558d67]={'$like':'%'+_0x485d2f[_0xe39f('0x32')][_0xe39f('0x3e')]+'%'};return _0x1d056f;})});}_0xac579b=_[_0xe39f('0x40')]({},_0xac579b,_0x485d2f[_0xe39f('0x48')]);return _0x2abaad[_0xe39f('0x4c')](_0xac579b);}})[_0xe39f('0x25')](function(_0x5846c9){if(_0x5846c9){_0x1433ee=_0x5846c9[_0xe39f('0x38')];if(!_0x485d2f[_0xe39f('0x32')]['hasOwnProperty'](_0xe39f('0x3a'))){_0xac579b[_0xe39f('0x1e')]=qs[_0xe39f('0x1e')](_0x485d2f[_0xe39f('0x32')]['limit']);_0xac579b[_0xe39f('0x20')]=qs[_0xe39f('0x20')](_0x485d2f[_0xe39f('0x32')][_0xe39f('0x20')]);}return _0x2abaad['getFields'](_0xac579b);}})[_0xe39f('0x25')](function(_0x1ed9f1){if(_0x1ed9f1){return _0x1ed9f1?{'count':_0x1433ee,'rows':_0x1ed9f1}:null;}})[_0xe39f('0x25')](respondWithResult(_0x1ab7ed,null))[_0xe39f('0x45')](handleError(_0x1ab7ed,null));};exports[_0xe39f('0x4f')]=function(_0x15fc68,_0x55f688,_0x558b20){var _0x215ab1={};var _0xa08333={};var _0x14b008;var _0x1256d0;return db[_0xe39f('0x2d')][_0xe39f('0x4d')]({'where':{'id':_0x15fc68[_0xe39f('0x47')]['id']}})[_0xe39f('0x25')](handleEntityNotFound(_0x55f688,null))[_0xe39f('0x25')](function(_0x234d54){if(_0x234d54){_0x14b008=_0x234d54;_0xa08333[_0xe39f('0x31')]=_[_0xe39f('0x33')](db[_0xe39f('0x4e')][_0xe39f('0x2e')]);_0xa08333['query']=_[_0xe39f('0x33')](_0x15fc68['query']);_0xa08333[_0xe39f('0x34')]=_[_0xe39f('0x35')](_0xa08333[_0xe39f('0x31')],_0xa08333['query']);_0x215ab1['attributes']=_[_0xe39f('0x35')](_0xa08333['model'],qs['fields'](_0x15fc68[_0xe39f('0x32')][_0xe39f('0x36')]));_0x215ab1[_0xe39f('0x37')]=_0x215ab1[_0xe39f('0x37')]['length']?_0x215ab1[_0xe39f('0x37')]:_0xa08333[_0xe39f('0x31')];_0x215ab1[_0xe39f('0x3b')]=qs[_0xe39f('0x3c')](_0x15fc68[_0xe39f('0x32')][_0xe39f('0x3c')]);_0x215ab1[_0xe39f('0x3f')]=qs[_0xe39f('0x34')](_[_0xe39f('0x3d')](_0x15fc68['query'],_0xa08333[_0xe39f('0x34')]));if(_0x15fc68[_0xe39f('0x32')]['filter']){_0x215ab1[_0xe39f('0x3f')]=_[_0xe39f('0x40')](_0x215ab1[_0xe39f('0x3f')],{'$or':_[_0xe39f('0x2c')](_0x215ab1[_0xe39f('0x37')],function(_0x35db96){var _0x28ea42={};_0x28ea42[_0x35db96]={'$like':'%'+_0x15fc68['query'][_0xe39f('0x3e')]+'%'};return _0x28ea42;})});}_0x215ab1=_['merge']({},_0x215ab1,_0x15fc68[_0xe39f('0x48')]);return _0x14b008[_0xe39f('0x4f')](_0x215ab1);}})[_0xe39f('0x25')](function(_0x5eee0e){if(_0x5eee0e){_0x1256d0=_0x5eee0e['length'];if(!_0x15fc68['query'][_0xe39f('0x39')](_0xe39f('0x3a'))){_0x215ab1[_0xe39f('0x1e')]=qs[_0xe39f('0x1e')](_0x15fc68[_0xe39f('0x32')]['limit']);_0x215ab1[_0xe39f('0x20')]=qs[_0xe39f('0x20')](_0x15fc68[_0xe39f('0x32')]['offset']);}return _0x14b008['getSubjects'](_0x215ab1);}})[_0xe39f('0x25')](function(_0x48ff53){if(_0x48ff53){return _0x48ff53?{'count':_0x1256d0,'rows':_0x48ff53}:null;}})[_0xe39f('0x25')](respondWithResult(_0x55f688,null))['catch'](handleError(_0x55f688,null));};exports[_0xe39f('0x50')]=function(_0x1b56b7,_0xd187d9,_0xe21d01){var _0x4af2f5={};var _0x17e881={};var _0x4d3653;var _0x4f21b6;return db[_0xe39f('0x2d')][_0xe39f('0x4d')]({'where':{'id':_0x1b56b7[_0xe39f('0x47')]['id']}})[_0xe39f('0x25')](handleEntityNotFound(_0xd187d9,null))['then'](function(_0x376d40){if(_0x376d40){_0x4d3653=_0x376d40;_0x17e881['model']=_[_0xe39f('0x33')](db[_0xe39f('0x4e')][_0xe39f('0x2e')]);_0x17e881[_0xe39f('0x32')]=_[_0xe39f('0x33')](_0x1b56b7['query']);_0x17e881[_0xe39f('0x34')]=_[_0xe39f('0x35')](_0x17e881[_0xe39f('0x31')],_0x17e881['query']);_0x4af2f5[_0xe39f('0x37')]=_[_0xe39f('0x35')](_0x17e881['model'],qs[_0xe39f('0x36')](_0x1b56b7[_0xe39f('0x32')][_0xe39f('0x36')]));_0x4af2f5[_0xe39f('0x37')]=_0x4af2f5['attributes'][_0xe39f('0x38')]?_0x4af2f5[_0xe39f('0x37')]:_0x17e881[_0xe39f('0x31')];_0x4af2f5[_0xe39f('0x3b')]=qs[_0xe39f('0x3c')](_0x1b56b7[_0xe39f('0x32')]['sort']);_0x4af2f5[_0xe39f('0x3f')]=qs[_0xe39f('0x34')](_[_0xe39f('0x3d')](_0x1b56b7[_0xe39f('0x32')],_0x17e881[_0xe39f('0x34')]));if(_0x1b56b7['query'][_0xe39f('0x3e')]){_0x4af2f5[_0xe39f('0x3f')]=_[_0xe39f('0x40')](_0x4af2f5[_0xe39f('0x3f')],{'$or':_[_0xe39f('0x2c')](_0x4af2f5[_0xe39f('0x37')],function(_0x3a6604){var _0x4dad41={};_0x4dad41[_0x3a6604]={'$like':'%'+_0x1b56b7[_0xe39f('0x32')][_0xe39f('0x3e')]+'%'};return _0x4dad41;})});}_0x4af2f5=_[_0xe39f('0x40')]({},_0x4af2f5,_0x1b56b7[_0xe39f('0x48')]);return _0x4d3653['getDescriptions'](_0x4af2f5);}})[_0xe39f('0x25')](function(_0x339b93){if(_0x339b93){_0x4f21b6=_0x339b93['length'];if(!_0x1b56b7[_0xe39f('0x32')][_0xe39f('0x39')](_0xe39f('0x3a'))){_0x4af2f5[_0xe39f('0x1e')]=qs['limit'](_0x1b56b7[_0xe39f('0x32')][_0xe39f('0x1e')]);_0x4af2f5[_0xe39f('0x20')]=qs[_0xe39f('0x20')](_0x1b56b7[_0xe39f('0x32')][_0xe39f('0x20')]);}return _0x4d3653['getDescriptions'](_0x4af2f5);}})[_0xe39f('0x25')](function(_0x26bcf3){if(_0x26bcf3){return _0x26bcf3?{'count':_0x4f21b6,'rows':_0x26bcf3}:null;}})[_0xe39f('0x25')](respondWithResult(_0xd187d9,null))[_0xe39f('0x45')](handleError(_0xd187d9,null));};
\ No newline at end of file
+var _0xa88a=['../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','SugarcrmConfiguration','includeAll','findAll','rows','catch','show','rawAttributes','fields','create','body','find','params','getFields','findOne','options','SugarcrmField','order','getSubjects','getDescriptions','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0xa88a,0x179));var _0xaa88=function(_0x5bd078,_0x4456bc){_0x5bd078=_0x5bd078-0x0;var _0x3aa034=_0xa88a[_0x5bd078];return _0x3aa034;};'use strict';var emlformat=require(_0xaa88('0x0'));var rimraf=require(_0xaa88('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa88('0x2'));var BPromise=require(_0xaa88('0x3'));var Mustache=require('mustache');var util=require(_0xaa88('0x4'));var path=require(_0xaa88('0x5'));var sox=require(_0xaa88('0x6'));var csv=require(_0xaa88('0x7'));var ejs=require(_0xaa88('0x8'));var fs=require('fs');var fs_extra=require(_0xaa88('0x9'));var _=require('lodash');var squel=require(_0xaa88('0xa'));var crypto=require(_0xaa88('0xb'));var jsforce=require(_0xaa88('0xc'));var deskjs=require(_0xaa88('0xd'));var toCsv=require(_0xaa88('0x7'));var querystring=require(_0xaa88('0xe'));var Papa=require(_0xaa88('0xf'));var Redis=require(_0xaa88('0x10'));var authService=require(_0xaa88('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xaa88('0x12'));var hardwareService=require(_0xaa88('0x13'));var logger=require(_0xaa88('0x14'))(_0xaa88('0x15'));var utils=require(_0xaa88('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaa88('0x17'));var db=require(_0xaa88('0x18'))['db'];function respondWithStatusCode(_0x5955af,_0x29e7aa){_0x29e7aa=_0x29e7aa||0xcc;return function(_0x40bd24){if(_0x40bd24){return _0x5955af[_0xaa88('0x19')](_0x29e7aa);}return _0x5955af['status'](_0x29e7aa)[_0xaa88('0x1a')]();};}function respondWithResult(_0x107ba8,_0x38a6f2){_0x38a6f2=_0x38a6f2||0xc8;return function(_0x541cd5){if(_0x541cd5){return _0x107ba8['status'](_0x38a6f2)[_0xaa88('0x1b')](_0x541cd5);}};}function respondWithFilteredResult(_0x59ba70,_0x45d1b5){return function(_0x4bda19){if(_0x4bda19){var _0x4166a8=typeof _0x45d1b5[_0xaa88('0x1c')]===_0xaa88('0x1d')&&typeof _0x45d1b5[_0xaa88('0x1e')]==='undefined';var _0x26a94d=_0x4bda19[_0xaa88('0x1f')];var _0x5a49a8=_0x4166a8?0x0:_0x45d1b5[_0xaa88('0x1c')];var _0x5e479d=_0x4166a8?_0x4bda19[_0xaa88('0x1f')]:_0x45d1b5['offset']+_0x45d1b5['limit'];var _0x228881;if(_0x5e479d>=_0x26a94d){_0x5e479d=_0x26a94d;_0x228881=0xc8;}else{_0x228881=0xce;}_0x59ba70[_0xaa88('0x20')](_0x228881);return _0x59ba70[_0xaa88('0x21')](_0xaa88('0x22'),_0x5a49a8+'-'+_0x5e479d+'/'+_0x26a94d)['json'](_0x4bda19);}return null;};}function patchUpdates(_0x3cace6){return function(_0x350fd8){try{jsonpatch[_0xaa88('0x23')](_0x350fd8,_0x3cace6,!![]);}catch(_0x15be0d){return BPromise[_0xaa88('0x24')](_0x15be0d);}return _0x350fd8['save']();};}function saveUpdates(_0x15b480,_0x2fdb41){return function(_0x182728){if(_0x182728){return _0x182728[_0xaa88('0x25')](_0x15b480)[_0xaa88('0x26')](function(_0x24ee59){return _0x24ee59;});}return null;};}function removeEntity(_0x5a110f,_0xaa75b1){return function(_0x441ae4){if(_0x441ae4){return _0x441ae4[_0xaa88('0x27')]()[_0xaa88('0x26')](function(){_0x5a110f[_0xaa88('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe464c,_0x33bc69){return function(_0x44804a){if(!_0x44804a){_0xfe464c[_0xaa88('0x19')](0x194);}return _0x44804a;};}function handleError(_0x587781,_0x5e4daf){_0x5e4daf=_0x5e4daf||0x1f4;return function(_0x3177c8){logger[_0xaa88('0x28')](_0x3177c8[_0xaa88('0x29')]);if(_0x3177c8[_0xaa88('0x2a')]){delete _0x3177c8[_0xaa88('0x2a')];}_0x587781[_0xaa88('0x20')](_0x5e4daf)['send'](_0x3177c8);};}exports['index']=function(_0x5461b4,_0x27ebb7){var _0x32e359={},_0x437ef8={},_0x1878b9={'count':0x0,'rows':[]};var _0x1b9d61=_[_0xaa88('0x2b')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x573628){return{'name':_0x573628[_0xaa88('0x2c')],'type':_0x573628[_0xaa88('0x2d')][_0xaa88('0x2e')]};});_0x437ef8[_0xaa88('0x2f')]=_[_0xaa88('0x2b')](_0x1b9d61,_0xaa88('0x2a'));_0x437ef8[_0xaa88('0x30')]=_[_0xaa88('0x31')](_0x5461b4[_0xaa88('0x30')]);_0x437ef8[_0xaa88('0x32')]=_['intersection'](_0x437ef8[_0xaa88('0x2f')],_0x437ef8[_0xaa88('0x30')]);_0x32e359['attributes']=_[_0xaa88('0x33')](_0x437ef8['model'],qs['fields'](_0x5461b4[_0xaa88('0x30')]['fields']));_0x32e359[_0xaa88('0x34')]=_0x32e359[_0xaa88('0x34')][_0xaa88('0x35')]?_0x32e359['attributes']:_0x437ef8[_0xaa88('0x2f')];if(!_0x5461b4[_0xaa88('0x30')][_0xaa88('0x36')](_0xaa88('0x37'))){_0x32e359[_0xaa88('0x1e')]=qs['limit'](_0x5461b4['query'][_0xaa88('0x1e')]);_0x32e359[_0xaa88('0x1c')]=qs[_0xaa88('0x1c')](_0x5461b4['query']['offset']);}_0x32e359['order']=qs[_0xaa88('0x38')](_0x5461b4[_0xaa88('0x30')][_0xaa88('0x38')]);_0x32e359[_0xaa88('0x39')]=qs[_0xaa88('0x32')](_[_0xaa88('0x3a')](_0x5461b4[_0xaa88('0x30')],_0x437ef8[_0xaa88('0x32')]),_0x1b9d61);if(_0x5461b4[_0xaa88('0x30')]['filter']){_0x32e359[_0xaa88('0x39')]=_[_0xaa88('0x3b')](_0x32e359[_0xaa88('0x39')],{'$or':_[_0xaa88('0x2b')](_0x1b9d61,function(_0x3e5ddd){if(_0x3e5ddd[_0xaa88('0x2d')]!=='VIRTUAL'){var _0x4dcfbf={};_0x4dcfbf[_0x3e5ddd['name']]={'$like':'%'+_0x5461b4['query'][_0xaa88('0x3c')]+'%'};return _0x4dcfbf;}})});}_0x32e359=_[_0xaa88('0x3b')]({},_0x32e359,_0x5461b4['options']);var _0x189b71={'where':_0x32e359[_0xaa88('0x39')]};return db[_0xaa88('0x3d')]['count'](_0x189b71)['then'](function(_0x3b1e08){_0x1878b9[_0xaa88('0x1f')]=_0x3b1e08;if(_0x5461b4[_0xaa88('0x30')][_0xaa88('0x3e')]){_0x32e359['include']=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xaa88('0x3f')](_0x32e359);})[_0xaa88('0x26')](function(_0x15637b){_0x1878b9[_0xaa88('0x40')]=_0x15637b;return _0x1878b9;})[_0xaa88('0x26')](respondWithFilteredResult(_0x27ebb7,_0x32e359))[_0xaa88('0x41')](handleError(_0x27ebb7,null));};exports[_0xaa88('0x42')]=function(_0x2886e9,_0x2a5040){var _0x433598={'raw':![],'where':{'id':_0x2886e9['params']['id']}},_0x3ba7f0={};_0x3ba7f0[_0xaa88('0x2f')]=_[_0xaa88('0x31')](db[_0xaa88('0x3d')][_0xaa88('0x43')]);_0x3ba7f0[_0xaa88('0x30')]=_[_0xaa88('0x31')](_0x2886e9[_0xaa88('0x30')]);_0x3ba7f0[_0xaa88('0x32')]=_[_0xaa88('0x33')](_0x3ba7f0[_0xaa88('0x2f')],_0x3ba7f0[_0xaa88('0x30')]);_0x433598[_0xaa88('0x34')]=_[_0xaa88('0x33')](_0x3ba7f0['model'],qs[_0xaa88('0x44')](_0x2886e9['query']['fields']));_0x433598[_0xaa88('0x34')]=_0x433598[_0xaa88('0x34')][_0xaa88('0x35')]?_0x433598[_0xaa88('0x34')]:_0x3ba7f0[_0xaa88('0x2f')];if(_0x2886e9[_0xaa88('0x30')][_0xaa88('0x3e')]){_0x433598['include']=[{'all':!![]}];}_0x433598=_[_0xaa88('0x3b')]({},_0x433598,_0x2886e9['options']);return db['SugarcrmConfiguration']['find'](_0x433598)[_0xaa88('0x26')](handleEntityNotFound(_0x2a5040,null))[_0xaa88('0x26')](respondWithResult(_0x2a5040,null))['catch'](handleError(_0x2a5040,null));};exports[_0xaa88('0x45')]=function(_0x1f410d,_0x20d2a2){return db[_0xaa88('0x3d')][_0xaa88('0x45')](_0x1f410d['body'],{})[_0xaa88('0x26')](respondWithResult(_0x20d2a2,0xc9))[_0xaa88('0x41')](handleError(_0x20d2a2,null));};exports[_0xaa88('0x25')]=function(_0x17942d,_0x4f8e4d){if(_0x17942d[_0xaa88('0x46')]['id']){delete _0x17942d['body']['id'];}return db[_0xaa88('0x3d')][_0xaa88('0x47')]({'where':{'id':_0x17942d[_0xaa88('0x48')]['id']}})[_0xaa88('0x26')](handleEntityNotFound(_0x4f8e4d,null))[_0xaa88('0x26')](saveUpdates(_0x17942d[_0xaa88('0x46')],null))[_0xaa88('0x26')](respondWithResult(_0x4f8e4d,null))[_0xaa88('0x41')](handleError(_0x4f8e4d,null));};exports[_0xaa88('0x27')]=function(_0x31e5d1,_0x230f96){return db['SugarcrmConfiguration'][_0xaa88('0x47')]({'where':{'id':_0x31e5d1['params']['id']}})[_0xaa88('0x26')](handleEntityNotFound(_0x230f96,null))[_0xaa88('0x26')](removeEntity(_0x230f96,null))[_0xaa88('0x41')](handleError(_0x230f96,null));};exports[_0xaa88('0x49')]=function(_0x55538c,_0x5b2c1b,_0x1ef8c3){var _0x5ed81a={};var _0x3bc674={};var _0x5669a4;var _0x10fbbe;return db[_0xaa88('0x3d')][_0xaa88('0x4a')]({'where':{'id':_0x55538c[_0xaa88('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b2c1b,null))[_0xaa88('0x26')](function(_0x1bd334){if(_0x1bd334){_0x5669a4=_0x1bd334;_0x3bc674[_0xaa88('0x2f')]=_[_0xaa88('0x31')](db['SugarcrmField'][_0xaa88('0x43')]);_0x3bc674[_0xaa88('0x30')]=_[_0xaa88('0x31')](_0x55538c['query']);_0x3bc674[_0xaa88('0x32')]=_[_0xaa88('0x33')](_0x3bc674['model'],_0x3bc674[_0xaa88('0x30')]);_0x5ed81a[_0xaa88('0x34')]=_[_0xaa88('0x33')](_0x3bc674[_0xaa88('0x2f')],qs[_0xaa88('0x44')](_0x55538c[_0xaa88('0x30')][_0xaa88('0x44')]));_0x5ed81a[_0xaa88('0x34')]=_0x5ed81a[_0xaa88('0x34')][_0xaa88('0x35')]?_0x5ed81a[_0xaa88('0x34')]:_0x3bc674[_0xaa88('0x2f')];_0x5ed81a['order']=qs[_0xaa88('0x38')](_0x55538c[_0xaa88('0x30')][_0xaa88('0x38')]);_0x5ed81a['where']=qs[_0xaa88('0x32')](_[_0xaa88('0x3a')](_0x55538c['query'],_0x3bc674[_0xaa88('0x32')]));if(_0x55538c['query']['filter']){_0x5ed81a[_0xaa88('0x39')]=_[_0xaa88('0x3b')](_0x5ed81a[_0xaa88('0x39')],{'$or':_['map'](_0x5ed81a[_0xaa88('0x34')],function(_0x161523){var _0x2c6e79={};_0x2c6e79[_0x161523]={'$like':'%'+_0x55538c[_0xaa88('0x30')][_0xaa88('0x3c')]+'%'};return _0x2c6e79;})});}_0x5ed81a=_[_0xaa88('0x3b')]({},_0x5ed81a,_0x55538c[_0xaa88('0x4b')]);return _0x5669a4['getFields'](_0x5ed81a);}})[_0xaa88('0x26')](function(_0x4920da){if(_0x4920da){_0x10fbbe=_0x4920da[_0xaa88('0x35')];if(!_0x55538c[_0xaa88('0x30')][_0xaa88('0x36')](_0xaa88('0x37'))){_0x5ed81a[_0xaa88('0x1e')]=qs[_0xaa88('0x1e')](_0x55538c[_0xaa88('0x30')][_0xaa88('0x1e')]);_0x5ed81a[_0xaa88('0x1c')]=qs[_0xaa88('0x1c')](_0x55538c[_0xaa88('0x30')][_0xaa88('0x1c')]);}return _0x5669a4['getFields'](_0x5ed81a);}})[_0xaa88('0x26')](function(_0x164451){if(_0x164451){return _0x164451?{'count':_0x10fbbe,'rows':_0x164451}:null;}})[_0xaa88('0x26')](respondWithResult(_0x5b2c1b,null))[_0xaa88('0x41')](handleError(_0x5b2c1b,null));};exports['getSubjects']=function(_0x29078b,_0x4066ff,_0x5ec9ef){var _0x467691={};var _0x29b625={};var _0x187a6a;var _0x2da86c;return db[_0xaa88('0x3d')][_0xaa88('0x4a')]({'where':{'id':_0x29078b[_0xaa88('0x48')]['id']}})['then'](handleEntityNotFound(_0x4066ff,null))[_0xaa88('0x26')](function(_0x431db3){if(_0x431db3){_0x187a6a=_0x431db3;_0x29b625['model']=_['keys'](db[_0xaa88('0x4c')][_0xaa88('0x43')]);_0x29b625[_0xaa88('0x30')]=_[_0xaa88('0x31')](_0x29078b[_0xaa88('0x30')]);_0x29b625[_0xaa88('0x32')]=_[_0xaa88('0x33')](_0x29b625['model'],_0x29b625[_0xaa88('0x30')]);_0x467691['attributes']=_[_0xaa88('0x33')](_0x29b625['model'],qs[_0xaa88('0x44')](_0x29078b[_0xaa88('0x30')]['fields']));_0x467691[_0xaa88('0x34')]=_0x467691[_0xaa88('0x34')][_0xaa88('0x35')]?_0x467691[_0xaa88('0x34')]:_0x29b625['model'];_0x467691[_0xaa88('0x4d')]=qs[_0xaa88('0x38')](_0x29078b[_0xaa88('0x30')][_0xaa88('0x38')]);_0x467691['where']=qs['filters'](_[_0xaa88('0x3a')](_0x29078b['query'],_0x29b625[_0xaa88('0x32')]));if(_0x29078b[_0xaa88('0x30')][_0xaa88('0x3c')]){_0x467691[_0xaa88('0x39')]=_['merge'](_0x467691[_0xaa88('0x39')],{'$or':_[_0xaa88('0x2b')](_0x467691['attributes'],function(_0x8f3dd){var _0x5330b9={};_0x5330b9[_0x8f3dd]={'$like':'%'+_0x29078b[_0xaa88('0x30')][_0xaa88('0x3c')]+'%'};return _0x5330b9;})});}_0x467691=_[_0xaa88('0x3b')]({},_0x467691,_0x29078b[_0xaa88('0x4b')]);return _0x187a6a[_0xaa88('0x4e')](_0x467691);}})[_0xaa88('0x26')](function(_0x29eab9){if(_0x29eab9){_0x2da86c=_0x29eab9[_0xaa88('0x35')];if(!_0x29078b[_0xaa88('0x30')]['hasOwnProperty'](_0xaa88('0x37'))){_0x467691[_0xaa88('0x1e')]=qs[_0xaa88('0x1e')](_0x29078b[_0xaa88('0x30')][_0xaa88('0x1e')]);_0x467691[_0xaa88('0x1c')]=qs[_0xaa88('0x1c')](_0x29078b['query'][_0xaa88('0x1c')]);}return _0x187a6a[_0xaa88('0x4e')](_0x467691);}})[_0xaa88('0x26')](function(_0x4b738d){if(_0x4b738d){return _0x4b738d?{'count':_0x2da86c,'rows':_0x4b738d}:null;}})['then'](respondWithResult(_0x4066ff,null))[_0xaa88('0x41')](handleError(_0x4066ff,null));};exports[_0xaa88('0x4f')]=function(_0x48fd45,_0x45df13,_0xae85f){var _0x5021d7={};var _0x28da7b={};var _0x318ad0;var _0x20374f;return db[_0xaa88('0x3d')]['findOne']({'where':{'id':_0x48fd45[_0xaa88('0x48')]['id']}})[_0xaa88('0x26')](handleEntityNotFound(_0x45df13,null))[_0xaa88('0x26')](function(_0x3618e9){if(_0x3618e9){_0x318ad0=_0x3618e9;_0x28da7b[_0xaa88('0x2f')]=_[_0xaa88('0x31')](db[_0xaa88('0x4c')][_0xaa88('0x43')]);_0x28da7b[_0xaa88('0x30')]=_[_0xaa88('0x31')](_0x48fd45['query']);_0x28da7b[_0xaa88('0x32')]=_[_0xaa88('0x33')](_0x28da7b[_0xaa88('0x2f')],_0x28da7b[_0xaa88('0x30')]);_0x5021d7[_0xaa88('0x34')]=_[_0xaa88('0x33')](_0x28da7b[_0xaa88('0x2f')],qs['fields'](_0x48fd45[_0xaa88('0x30')]['fields']));_0x5021d7[_0xaa88('0x34')]=_0x5021d7['attributes'][_0xaa88('0x35')]?_0x5021d7[_0xaa88('0x34')]:_0x28da7b[_0xaa88('0x2f')];_0x5021d7[_0xaa88('0x4d')]=qs[_0xaa88('0x38')](_0x48fd45[_0xaa88('0x30')][_0xaa88('0x38')]);_0x5021d7['where']=qs[_0xaa88('0x32')](_[_0xaa88('0x3a')](_0x48fd45[_0xaa88('0x30')],_0x28da7b[_0xaa88('0x32')]));if(_0x48fd45[_0xaa88('0x30')][_0xaa88('0x3c')]){_0x5021d7[_0xaa88('0x39')]=_['merge'](_0x5021d7[_0xaa88('0x39')],{'$or':_['map'](_0x5021d7[_0xaa88('0x34')],function(_0x4a09cd){var _0xd8d7a8={};_0xd8d7a8[_0x4a09cd]={'$like':'%'+_0x48fd45[_0xaa88('0x30')][_0xaa88('0x3c')]+'%'};return _0xd8d7a8;})});}_0x5021d7=_[_0xaa88('0x3b')]({},_0x5021d7,_0x48fd45['options']);return _0x318ad0[_0xaa88('0x4f')](_0x5021d7);}})['then'](function(_0x385982){if(_0x385982){_0x20374f=_0x385982[_0xaa88('0x35')];if(!_0x48fd45[_0xaa88('0x30')][_0xaa88('0x36')]('nolimit')){_0x5021d7[_0xaa88('0x1e')]=qs[_0xaa88('0x1e')](_0x48fd45['query'][_0xaa88('0x1e')]);_0x5021d7['offset']=qs['offset'](_0x48fd45[_0xaa88('0x30')][_0xaa88('0x1c')]);}return _0x318ad0[_0xaa88('0x4f')](_0x5021d7);}})[_0xaa88('0x26')](function(_0x1822d4){if(_0x1822d4){return _0x1822d4?{'count':_0x20374f,'rows':_0x1822d4}:null;}})['then'](respondWithResult(_0x45df13,null))[_0xaa88('0x41')](handleError(_0x45df13,null));};
\ No newline at end of file
index b716833..8988d73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7437=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x7437,0x143));var _0x7743=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x7437[_0x22b39b];return _0x280e1d;};'use strict';var _=require(_0x7743('0x0'));var util=require(_0x7743('0x1'));var logger=require(_0x7743('0x2'))(_0x7743('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7743('0x4'));var fs=require('fs');var path=require(_0x7743('0x5'));var rimraf=require(_0x7743('0x6'));var config=require(_0x7743('0x7'));var attributes=require(_0x7743('0x8'));module[_0x7743('0x9')]=function(_0x5bcec9,_0x58e873){return _0x5bcec9[_0x7743('0xa')](_0x7743('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda89=['SugarcrmConfiguration','util','../../config/logger','bluebird','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define'];(function(_0x361a0d,_0x161c0f){var _0x2bdbb8=function(_0x1a8419){while(--_0x1a8419){_0x361a0d['push'](_0x361a0d['shift']());}};_0x2bdbb8(++_0x161c0f);}(_0xda89,0x69));var _0x9da8=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0xda89[_0xe73080];return _0x12cbc4;};'use strict';var _=require('lodash');var util=require(_0x9da8('0x0'));var logger=require(_0x9da8('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9da8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9da8('0x3'));var config=require(_0x9da8('0x4'));var attributes=require(_0x9da8('0x5'));module['exports']=function(_0x550b06,_0x363b15){return _0x550b06[_0x9da8('0x6')](_0x9da8('0x7'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7b8ba49..0af1d77 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68bd=['message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x38a92c,_0x246ddb){var _0x4e2c03=function(_0x3a1830){while(--_0x3a1830){_0x38a92c['push'](_0x38a92c['shift']());}};_0x4e2c03(++_0x246ddb);}(_0x68bd,0x19b));var _0xd68b=function(_0x909398,_0x2e6d0b){_0x909398=_0x909398-0x0;var _0x16e1f3=_0x68bd[_0x909398];return _0x16e1f3;};'use strict';var _=require(_0xd68b('0x0'));var util=require(_0xd68b('0x1'));var moment=require('moment');var BPromise=require(_0xd68b('0x2'));var rs=require(_0xd68b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd68b('0x4'))['db'];var utils=require(_0xd68b('0x5'));var logger=require(_0xd68b('0x6'))(_0xd68b('0x7'));var config=require(_0xd68b('0x8'));var jayson=require(_0xd68b('0x9'));var client=jayson[_0xd68b('0xa')][_0xd68b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ebf27,_0x225fba,_0x482466){return new BPromise(function(_0x48bffc,_0x245069){return client[_0xd68b('0xc')](_0x2ebf27,_0x482466)[_0xd68b('0xd')](function(_0x4b84cd){logger[_0xd68b('0xe')](_0xd68b('0xf'),_0x225fba,_0xd68b('0x10'));logger['debug'](_0xd68b('0x11'),_0x225fba,'request\x20sent',JSON[_0xd68b('0x12')](_0x4b84cd));if(_0x4b84cd['error']){if(_0x4b84cd[_0xd68b('0x13')][_0xd68b('0x14')]===0x1f4){logger[_0xd68b('0x13')](_0xd68b('0xf'),_0x225fba,_0x4b84cd[_0xd68b('0x13')][_0xd68b('0x15')]);return _0x245069(_0x4b84cd['error'][_0xd68b('0x15')]);}logger[_0xd68b('0x13')](_0xd68b('0xf'),_0x225fba,_0x4b84cd[_0xd68b('0x13')]['message']);return _0x48bffc(_0x4b84cd['error']['message']);}else{logger[_0xd68b('0xe')](_0xd68b('0xf'),_0x225fba,'request\x20sent');_0x48bffc(_0x4b84cd[_0xd68b('0x16')][_0xd68b('0x15')]);}})[_0xd68b('0x17')](function(_0x3af90d){logger[_0xd68b('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x225fba,_0x3af90d);_0x245069(_0x3af90d);});});}
\ No newline at end of file
+var _0xa67c=['http','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xde935a,_0x112734){var _0x9858f5=function(_0x35918e){while(--_0x35918e){_0xde935a['push'](_0xde935a['shift']());}};_0x9858f5(++_0x112734);}(_0xa67c,0xf3));var _0xca67=function(_0x19b52c,_0x4de8f7){_0x19b52c=_0x19b52c-0x0;var _0x1fecc8=_0xa67c[_0x19b52c];return _0x1fecc8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca67('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xca67('0x1'));var db=require(_0xca67('0x2'))['db'];var utils=require(_0xca67('0x3'));var logger=require(_0xca67('0x4'))(_0xca67('0x5'));var config=require(_0xca67('0x6'));var jayson=require(_0xca67('0x7'));var client=jayson[_0xca67('0x8')][_0xca67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ad337,_0x1c269e,_0x279c58){return new BPromise(function(_0x20526a,_0x30c1d8){return client['request'](_0x2ad337,_0x279c58)[_0xca67('0xa')](function(_0x5e86ed){logger[_0xca67('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c269e,_0xca67('0xc'));logger[_0xca67('0xd')](_0xca67('0xe'),_0x1c269e,_0xca67('0xc'),JSON['stringify'](_0x5e86ed));if(_0x5e86ed[_0xca67('0xf')]){if(_0x5e86ed[_0xca67('0xf')][_0xca67('0x10')]===0x1f4){logger['error'](_0xca67('0x11'),_0x1c269e,_0x5e86ed['error']['message']);return _0x30c1d8(_0x5e86ed[_0xca67('0xf')][_0xca67('0x12')]);}logger[_0xca67('0xf')](_0xca67('0x11'),_0x1c269e,_0x5e86ed[_0xca67('0xf')][_0xca67('0x12')]);return _0x20526a(_0x5e86ed['error'][_0xca67('0x12')]);}else{logger[_0xca67('0xb')](_0xca67('0x11'),_0x1c269e,_0xca67('0xc'));_0x20526a(_0x5e86ed[_0xca67('0x13')][_0xca67('0x12')]);}})[_0xca67('0x14')](function(_0x4b97cc){logger[_0xca67('0xf')](_0xca67('0x11'),_0x1c269e,_0x4b97cc);_0x30c1d8(_0x4b97cc);});});}
\ No newline at end of file
index 566a65d..f5b0399 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bb4=['index','/:id','show','post','isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x108902,_0x7b318c){var _0x28271e=function(_0x4540bf){while(--_0x4540bf){_0x108902['push'](_0x108902['shift']());}};_0x28271e(++_0x7b318c);}(_0x2bb4,0x1d3));var _0x42bb=function(_0x2d6d42,_0x4992d4){_0x2d6d42=_0x2d6d42-0x0;var _0x572d2e=_0x2bb4[_0x2d6d42];return _0x572d2e;};'use strict';var multer=require(_0x42bb('0x0'));var util=require(_0x42bb('0x1'));var path=require('path');var timeout=require(_0x42bb('0x2'));var express=require(_0x42bb('0x3'));var router=express[_0x42bb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42bb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x42bb('0x6'));var controller=require(_0x42bb('0x7'));router[_0x42bb('0x8')]('/',auth['isAuthenticated'](),controller[_0x42bb('0x9')]);router[_0x42bb('0x8')](_0x42bb('0xa'),auth['isAuthenticated'](),controller[_0x42bb('0xb')]);router[_0x42bb('0xc')]('/',auth[_0x42bb('0xd')](),controller['create']);router['put']('/:id',auth[_0x42bb('0xd')](),controller[_0x42bb('0xe')]);router[_0x42bb('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x42bb('0x10')]=router;
\ No newline at end of file
+var _0x9496=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','create'];(function(_0x46ba59,_0x4ec8b9){var _0x55cc0e=function(_0x596996){while(--_0x596996){_0x46ba59['push'](_0x46ba59['shift']());}};_0x55cc0e(++_0x4ec8b9);}(_0x9496,0x145));var _0x6949=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x9496[_0xc8a931];return _0x28bd27;};'use strict';var multer=require(_0x6949('0x0'));var util=require(_0x6949('0x1'));var path=require(_0x6949('0x2'));var timeout=require(_0x6949('0x3'));var express=require(_0x6949('0x4'));var router=express[_0x6949('0x5')]();var fs_extra=require(_0x6949('0x6'));var auth=require(_0x6949('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x6949('0x8'));var controller=require(_0x6949('0x9'));router['get']('/',auth[_0x6949('0xa')](),controller[_0x6949('0xb')]);router[_0x6949('0xc')](_0x6949('0xd'),auth[_0x6949('0xa')](),controller['show']);router['post']('/',auth[_0x6949('0xa')](),controller[_0x6949('0xe')]);router[_0x6949('0xf')](_0x6949('0xd'),auth['isAuthenticated'](),controller[_0x6949('0x10')]);router[_0x6949('0x11')](_0x6949('0xd'),auth[_0x6949('0xa')](),controller[_0x6949('0x12')]);module[_0x6949('0x13')]=router;
\ No newline at end of file
index 0a1881d..b91f63a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a72=['ENUM','string','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0x6a72,0x115));var _0x26a7=function(_0x294975,_0xba7309){_0x294975=_0x294975-0x0;var _0x523628=_0x6a72[_0x294975];return _0x523628;};'use strict';var Sequelize=require(_0x26a7('0x0'));module[_0x26a7('0x1')]={'type':{'type':Sequelize[_0x26a7('0x2')](_0x26a7('0x3'),'variable',_0x26a7('0x4'),_0x26a7('0x5'),_0x26a7('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x26a7('0x7')]},'key':{'type':Sequelize[_0x26a7('0x7')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x26a7('0x7')]},'idField':{'type':Sequelize[_0x26a7('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x26a7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x26a7('0x7')]}};
\ No newline at end of file
+var _0x3ba6=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','variable'];(function(_0x4c21ff,_0x384b66){var _0x5185ec=function(_0x245b5c){while(--_0x245b5c){_0x4c21ff['push'](_0x4c21ff['shift']());}};_0x5185ec(++_0x384b66);}(_0x3ba6,0xf2));var _0x63ba=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x3ba6[_0x5a26f5];return _0x2e9ef7;};'use strict';var Sequelize=require(_0x63ba('0x0'));module[_0x63ba('0x1')]={'type':{'type':Sequelize[_0x63ba('0x2')](_0x63ba('0x3'),'variable',_0x63ba('0x4'),_0x63ba('0x5'),_0x63ba('0x6')),'defaultValue':_0x63ba('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x63ba('0x3'),_0x63ba('0x7'),_0x63ba('0x4'))},'keyContent':{'type':Sequelize[_0x63ba('0x8')]},'idField':{'type':Sequelize[_0x63ba('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x63ba('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index fac34df..5975229 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfafe=['pick','filter','merge','type','options','includeAll','findAll','rows','show','params','include','find','create','body','catch','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','limit','count','offset','status','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfafe,0xf3));var _0xefaf=function(_0x2898ee,_0x28fb35){_0x2898ee=_0x2898ee-0x0;var _0xaf68fc=_0xfafe[_0x2898ee];return _0xaf68fc;};'use strict';var emlformat=require(_0xefaf('0x0'));var rimraf=require(_0xefaf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xefaf('0x2'));var moment=require(_0xefaf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xefaf('0x4'));var util=require(_0xefaf('0x5'));var path=require(_0xefaf('0x6'));var sox=require(_0xefaf('0x7'));var csv=require('to-csv');var ejs=require(_0xefaf('0x8'));var fs=require('fs');var fs_extra=require(_0xefaf('0x9'));var _=require(_0xefaf('0xa'));var squel=require(_0xefaf('0xb'));var crypto=require(_0xefaf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xefaf('0xd'));var toCsv=require(_0xefaf('0xe'));var querystring=require(_0xefaf('0xf'));var Papa=require(_0xefaf('0x10'));var Redis=require(_0xefaf('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xefaf('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefaf('0x13'));var logger=require('../../config/logger')(_0xefaf('0x14'));var utils=require(_0xefaf('0x15'));var config=require(_0xefaf('0x16'));var licenseUtil=require(_0xefaf('0x17'));var db=require(_0xefaf('0x18'))['db'];function respondWithStatusCode(_0x511dd4,_0x4c380e){_0x4c380e=_0x4c380e||0xcc;return function(_0x26739a){if(_0x26739a){return _0x511dd4[_0xefaf('0x19')](_0x4c380e);}return _0x511dd4['status'](_0x4c380e)['end']();};}function respondWithResult(_0x4dbba8,_0x17389a){_0x17389a=_0x17389a||0xc8;return function(_0x23f77e){if(_0x23f77e){return _0x4dbba8['status'](_0x17389a)[_0xefaf('0x1a')](_0x23f77e);}};}function respondWithFilteredResult(_0x4e9b11,_0x4682c7){return function(_0x41a01a){if(_0x41a01a){var _0xc0dc9b=typeof _0x4682c7['offset']===_0xefaf('0x1b')&&typeof _0x4682c7[_0xefaf('0x1c')]===_0xefaf('0x1b');var _0x47a748=_0x41a01a[_0xefaf('0x1d')];var _0x258202=_0xc0dc9b?0x0:_0x4682c7[_0xefaf('0x1e')];var _0x3882e0=_0xc0dc9b?_0x41a01a['count']:_0x4682c7[_0xefaf('0x1e')]+_0x4682c7['limit'];var _0x2b8d9c;if(_0x3882e0>=_0x47a748){_0x3882e0=_0x47a748;_0x2b8d9c=0xc8;}else{_0x2b8d9c=0xce;}_0x4e9b11[_0xefaf('0x1f')](_0x2b8d9c);return _0x4e9b11[_0xefaf('0x20')](_0xefaf('0x21'),_0x258202+'-'+_0x3882e0+'/'+_0x47a748)['json'](_0x41a01a);}return null;};}function patchUpdates(_0x2a11a8){return function(_0x5b2d2c){try{jsonpatch[_0xefaf('0x22')](_0x5b2d2c,_0x2a11a8,!![]);}catch(_0x470896){return BPromise['reject'](_0x470896);}return _0x5b2d2c[_0xefaf('0x23')]();};}function saveUpdates(_0x533ae1,_0x18693b){return function(_0x287aab){if(_0x287aab){return _0x287aab[_0xefaf('0x24')](_0x533ae1)[_0xefaf('0x25')](function(_0x8da274){return _0x8da274;});}return null;};}function removeEntity(_0x347db7,_0x212ef0){return function(_0x90690e){if(_0x90690e){return _0x90690e[_0xefaf('0x26')]()[_0xefaf('0x25')](function(){_0x347db7[_0xefaf('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x464eb4,_0x5ed6c6){return function(_0x2329d3){if(!_0x2329d3){_0x464eb4[_0xefaf('0x19')](0x194);}return _0x2329d3;};}function handleError(_0x2d929a,_0x2dac82){_0x2dac82=_0x2dac82||0x1f4;return function(_0x1ef50c){logger[_0xefaf('0x27')](_0x1ef50c[_0xefaf('0x28')]);if(_0x1ef50c[_0xefaf('0x29')]){delete _0x1ef50c[_0xefaf('0x29')];}_0x2d929a[_0xefaf('0x1f')](_0x2dac82)['send'](_0x1ef50c);};}exports[_0xefaf('0x2a')]=function(_0x537335,_0x16ae3e){var _0x581373={},_0x40e623={},_0x1943dc={'count':0x0,'rows':[]};var _0x2444cf=_[_0xefaf('0x2b')](db[_0xefaf('0x2c')][_0xefaf('0x2d')],function(_0x1f7bb5){return{'name':_0x1f7bb5[_0xefaf('0x2e')],'type':_0x1f7bb5['type'][_0xefaf('0x2f')]};});_0x40e623[_0xefaf('0x30')]=_[_0xefaf('0x2b')](_0x2444cf,_0xefaf('0x29'));_0x40e623[_0xefaf('0x31')]=_[_0xefaf('0x32')](_0x537335[_0xefaf('0x31')]);_0x40e623[_0xefaf('0x33')]=_[_0xefaf('0x34')](_0x40e623[_0xefaf('0x30')],_0x40e623[_0xefaf('0x31')]);_0x581373['attributes']=_[_0xefaf('0x34')](_0x40e623['model'],qs[_0xefaf('0x35')](_0x537335['query'][_0xefaf('0x35')]));_0x581373[_0xefaf('0x36')]=_0x581373[_0xefaf('0x36')][_0xefaf('0x37')]?_0x581373[_0xefaf('0x36')]:_0x40e623[_0xefaf('0x30')];if(!_0x537335['query'][_0xefaf('0x38')](_0xefaf('0x39'))){_0x581373[_0xefaf('0x1c')]=qs[_0xefaf('0x1c')](_0x537335[_0xefaf('0x31')][_0xefaf('0x1c')]);_0x581373[_0xefaf('0x1e')]=qs[_0xefaf('0x1e')](_0x537335[_0xefaf('0x31')][_0xefaf('0x1e')]);}_0x581373[_0xefaf('0x3a')]=qs[_0xefaf('0x3b')](_0x537335[_0xefaf('0x31')][_0xefaf('0x3b')]);_0x581373[_0xefaf('0x3c')]=qs[_0xefaf('0x33')](_[_0xefaf('0x3d')](_0x537335['query'],_0x40e623[_0xefaf('0x33')]),_0x2444cf);if(_0x537335[_0xefaf('0x31')][_0xefaf('0x3e')]){_0x581373[_0xefaf('0x3c')]=_[_0xefaf('0x3f')](_0x581373[_0xefaf('0x3c')],{'$or':_[_0xefaf('0x2b')](_0x2444cf,function(_0x3d9c95){if(_0x3d9c95[_0xefaf('0x40')]!=='VIRTUAL'){var _0xd9dba1={};_0xd9dba1[_0x3d9c95['name']]={'$like':'%'+_0x537335[_0xefaf('0x31')][_0xefaf('0x3e')]+'%'};return _0xd9dba1;}})});}_0x581373=_[_0xefaf('0x3f')]({},_0x581373,_0x537335[_0xefaf('0x41')]);var _0x328f62={'where':_0x581373[_0xefaf('0x3c')]};return db['SugarcrmField']['count'](_0x328f62)[_0xefaf('0x25')](function(_0xb92ff4){_0x1943dc[_0xefaf('0x1d')]=_0xb92ff4;if(_0x537335[_0xefaf('0x31')][_0xefaf('0x42')]){_0x581373['include']=[{'all':!![]}];}return db[_0xefaf('0x2c')][_0xefaf('0x43')](_0x581373);})['then'](function(_0x105806){_0x1943dc[_0xefaf('0x44')]=_0x105806;return _0x1943dc;})[_0xefaf('0x25')](respondWithFilteredResult(_0x16ae3e,_0x581373))['catch'](handleError(_0x16ae3e,null));};exports[_0xefaf('0x45')]=function(_0x1f6692,_0x179304){var _0x33c272={'raw':!![],'where':{'id':_0x1f6692[_0xefaf('0x46')]['id']}},_0x4c12ff={};_0x4c12ff[_0xefaf('0x30')]=_[_0xefaf('0x32')](db[_0xefaf('0x2c')]['rawAttributes']);_0x4c12ff[_0xefaf('0x31')]=_[_0xefaf('0x32')](_0x1f6692[_0xefaf('0x31')]);_0x4c12ff['filters']=_[_0xefaf('0x34')](_0x4c12ff[_0xefaf('0x30')],_0x4c12ff[_0xefaf('0x31')]);_0x33c272[_0xefaf('0x36')]=_[_0xefaf('0x34')](_0x4c12ff[_0xefaf('0x30')],qs[_0xefaf('0x35')](_0x1f6692[_0xefaf('0x31')][_0xefaf('0x35')]));_0x33c272['attributes']=_0x33c272[_0xefaf('0x36')][_0xefaf('0x37')]?_0x33c272[_0xefaf('0x36')]:_0x4c12ff[_0xefaf('0x30')];if(_0x1f6692['query'][_0xefaf('0x42')]){_0x33c272[_0xefaf('0x47')]=[{'all':!![]}];}_0x33c272=_[_0xefaf('0x3f')]({},_0x33c272,_0x1f6692[_0xefaf('0x41')]);return db[_0xefaf('0x2c')][_0xefaf('0x48')](_0x33c272)['then'](handleEntityNotFound(_0x179304,null))['then'](respondWithResult(_0x179304,null))['catch'](handleError(_0x179304,null));};exports[_0xefaf('0x49')]=function(_0x40030b,_0x519ac8){return db[_0xefaf('0x2c')]['create'](_0x40030b[_0xefaf('0x4a')],{})[_0xefaf('0x25')](respondWithResult(_0x519ac8,0xc9))['catch'](handleError(_0x519ac8,null));};exports[_0xefaf('0x24')]=function(_0xa0152,_0xb71f20){if(_0xa0152['body']['id']){delete _0xa0152[_0xefaf('0x4a')]['id'];}return db[_0xefaf('0x2c')][_0xefaf('0x48')]({'where':{'id':_0xa0152[_0xefaf('0x46')]['id']}})[_0xefaf('0x25')](handleEntityNotFound(_0xb71f20,null))['then'](saveUpdates(_0xa0152[_0xefaf('0x4a')],null))[_0xefaf('0x25')](respondWithResult(_0xb71f20,null))[_0xefaf('0x4b')](handleError(_0xb71f20,null));};exports[_0xefaf('0x26')]=function(_0x56a27d,_0x24aa1c){return db[_0xefaf('0x2c')]['find']({'where':{'id':_0x56a27d[_0xefaf('0x46')]['id']}})[_0xefaf('0x25')](handleEntityNotFound(_0x24aa1c,null))[_0xefaf('0x25')](removeEntity(_0x24aa1c,null))[_0xefaf('0x4b')](handleError(_0x24aa1c,null));};
\ No newline at end of file
+var _0x1181=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','map','SugarcrmField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','options','then','include','findAll','catch','show','params','length','includeAll','create','body','find','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x5b6830,_0x50de7f){var _0x509a64=function(_0x45106a){while(--_0x45106a){_0x5b6830['push'](_0x5b6830['shift']());}};_0x509a64(++_0x50de7f);}(_0x1181,0xd0));var _0x1118=function(_0x51fe5f,_0x1d8632){_0x51fe5f=_0x51fe5f-0x0;var _0x4abce9=_0x1181[_0x51fe5f];return _0x4abce9;};'use strict';var emlformat=require(_0x1118('0x0'));var rimraf=require(_0x1118('0x1'));var zipdir=require(_0x1118('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1118('0x3'));var BPromise=require(_0x1118('0x4'));var Mustache=require(_0x1118('0x5'));var util=require(_0x1118('0x6'));var path=require('path');var sox=require(_0x1118('0x7'));var csv=require(_0x1118('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1118('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1118('0xa'));var jsforce=require(_0x1118('0xb'));var deskjs=require(_0x1118('0xc'));var toCsv=require(_0x1118('0x8'));var querystring=require(_0x1118('0xd'));var Papa=require(_0x1118('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1118('0xf'));var as=require(_0x1118('0x10'));var hardwareService=require(_0x1118('0x11'));var logger=require(_0x1118('0x12'))(_0x1118('0x13'));var utils=require(_0x1118('0x14'));var config=require(_0x1118('0x15'));var licenseUtil=require(_0x1118('0x16'));var db=require(_0x1118('0x17'))['db'];function respondWithStatusCode(_0xf75f29,_0x55eb3a){_0x55eb3a=_0x55eb3a||0xcc;return function(_0x12e4eb){if(_0x12e4eb){return _0xf75f29[_0x1118('0x18')](_0x55eb3a);}return _0xf75f29[_0x1118('0x19')](_0x55eb3a)[_0x1118('0x1a')]();};}function respondWithResult(_0x5003e2,_0x48771d){_0x48771d=_0x48771d||0xc8;return function(_0x48fbb3){if(_0x48fbb3){return _0x5003e2[_0x1118('0x19')](_0x48771d)[_0x1118('0x1b')](_0x48fbb3);}};}function respondWithFilteredResult(_0x4ff9ec,_0x4a7444){return function(_0x349128){if(_0x349128){var _0x36c095=typeof _0x4a7444[_0x1118('0x1c')]===_0x1118('0x1d')&&typeof _0x4a7444['limit']===_0x1118('0x1d');var _0x31c706=_0x349128[_0x1118('0x1e')];var _0x96421b=_0x36c095?0x0:_0x4a7444['offset'];var _0x3b2e89=_0x36c095?_0x349128[_0x1118('0x1e')]:_0x4a7444[_0x1118('0x1c')]+_0x4a7444['limit'];var _0x10bf5a;if(_0x3b2e89>=_0x31c706){_0x3b2e89=_0x31c706;_0x10bf5a=0xc8;}else{_0x10bf5a=0xce;}_0x4ff9ec[_0x1118('0x19')](_0x10bf5a);return _0x4ff9ec[_0x1118('0x1f')](_0x1118('0x20'),_0x96421b+'-'+_0x3b2e89+'/'+_0x31c706)[_0x1118('0x1b')](_0x349128);}return null;};}function patchUpdates(_0x329469){return function(_0x27e8ea){try{jsonpatch[_0x1118('0x21')](_0x27e8ea,_0x329469,!![]);}catch(_0x1ea115){return BPromise[_0x1118('0x22')](_0x1ea115);}return _0x27e8ea['save']();};}function saveUpdates(_0x4e89b5,_0x1bad00){return function(_0x489be6){if(_0x489be6){return _0x489be6[_0x1118('0x23')](_0x4e89b5)['then'](function(_0x2bbd67){return _0x2bbd67;});}return null;};}function removeEntity(_0x3405d3,_0x53b2b1){return function(_0x6b6304){if(_0x6b6304){return _0x6b6304[_0x1118('0x24')]()['then'](function(){_0x3405d3[_0x1118('0x19')](0xcc)[_0x1118('0x1a')]();});}};}function handleEntityNotFound(_0x224249,_0x851619){return function(_0x5021e0){if(!_0x5021e0){_0x224249[_0x1118('0x18')](0x194);}return _0x5021e0;};}function handleError(_0x107add,_0x462a17){_0x462a17=_0x462a17||0x1f4;return function(_0x5ab460){logger[_0x1118('0x25')](_0x5ab460[_0x1118('0x26')]);if(_0x5ab460[_0x1118('0x27')]){delete _0x5ab460[_0x1118('0x27')];}_0x107add[_0x1118('0x19')](_0x462a17)[_0x1118('0x28')](_0x5ab460);};}exports[_0x1118('0x29')]=function(_0x1a9c3b,_0x43a5d7){var _0x2a6cc4={},_0x4148a3={},_0x4cb0aa={'count':0x0,'rows':[]};var _0x582960=_[_0x1118('0x2a')](db[_0x1118('0x2b')][_0x1118('0x2c')],function(_0x4ba212){return{'name':_0x4ba212[_0x1118('0x2d')],'type':_0x4ba212[_0x1118('0x2e')][_0x1118('0x2f')]};});_0x4148a3[_0x1118('0x30')]=_[_0x1118('0x2a')](_0x582960,_0x1118('0x27'));_0x4148a3['query']=_[_0x1118('0x31')](_0x1a9c3b[_0x1118('0x32')]);_0x4148a3[_0x1118('0x33')]=_[_0x1118('0x34')](_0x4148a3['model'],_0x4148a3['query']);_0x2a6cc4[_0x1118('0x35')]=_[_0x1118('0x34')](_0x4148a3['model'],qs[_0x1118('0x36')](_0x1a9c3b[_0x1118('0x32')][_0x1118('0x36')]));_0x2a6cc4[_0x1118('0x35')]=_0x2a6cc4['attributes']['length']?_0x2a6cc4['attributes']:_0x4148a3[_0x1118('0x30')];if(!_0x1a9c3b[_0x1118('0x32')][_0x1118('0x37')](_0x1118('0x38'))){_0x2a6cc4['limit']=qs[_0x1118('0x39')](_0x1a9c3b['query'][_0x1118('0x39')]);_0x2a6cc4['offset']=qs[_0x1118('0x1c')](_0x1a9c3b[_0x1118('0x32')]['offset']);}_0x2a6cc4[_0x1118('0x3a')]=qs[_0x1118('0x3b')](_0x1a9c3b[_0x1118('0x32')][_0x1118('0x3b')]);_0x2a6cc4['where']=qs[_0x1118('0x33')](_[_0x1118('0x3c')](_0x1a9c3b['query'],_0x4148a3[_0x1118('0x33')]),_0x582960);if(_0x1a9c3b['query']['filter']){_0x2a6cc4[_0x1118('0x3d')]=_[_0x1118('0x3e')](_0x2a6cc4[_0x1118('0x3d')],{'$or':_['map'](_0x582960,function(_0x26cf70){if(_0x26cf70['type']!==_0x1118('0x3f')){var _0x41ed5e={};_0x41ed5e[_0x26cf70[_0x1118('0x27')]]={'$like':'%'+_0x1a9c3b[_0x1118('0x32')][_0x1118('0x40')]+'%'};return _0x41ed5e;}})});}_0x2a6cc4=_[_0x1118('0x3e')]({},_0x2a6cc4,_0x1a9c3b[_0x1118('0x41')]);var _0x35b394={'where':_0x2a6cc4['where']};return db[_0x1118('0x2b')]['count'](_0x35b394)[_0x1118('0x42')](function(_0x31a577){_0x4cb0aa[_0x1118('0x1e')]=_0x31a577;if(_0x1a9c3b[_0x1118('0x32')]['includeAll']){_0x2a6cc4[_0x1118('0x43')]=[{'all':!![]}];}return db[_0x1118('0x2b')][_0x1118('0x44')](_0x2a6cc4);})[_0x1118('0x42')](function(_0x88dbed){_0x4cb0aa['rows']=_0x88dbed;return _0x4cb0aa;})[_0x1118('0x42')](respondWithFilteredResult(_0x43a5d7,_0x2a6cc4))[_0x1118('0x45')](handleError(_0x43a5d7,null));};exports[_0x1118('0x46')]=function(_0x4e4420,_0x3db6b5){var _0x2b36dd={'raw':!![],'where':{'id':_0x4e4420[_0x1118('0x47')]['id']}},_0x2ae55f={};_0x2ae55f['model']=_['keys'](db[_0x1118('0x2b')]['rawAttributes']);_0x2ae55f[_0x1118('0x32')]=_[_0x1118('0x31')](_0x4e4420['query']);_0x2ae55f[_0x1118('0x33')]=_['intersection'](_0x2ae55f['model'],_0x2ae55f[_0x1118('0x32')]);_0x2b36dd[_0x1118('0x35')]=_['intersection'](_0x2ae55f[_0x1118('0x30')],qs['fields'](_0x4e4420[_0x1118('0x32')][_0x1118('0x36')]));_0x2b36dd['attributes']=_0x2b36dd[_0x1118('0x35')][_0x1118('0x48')]?_0x2b36dd[_0x1118('0x35')]:_0x2ae55f[_0x1118('0x30')];if(_0x4e4420[_0x1118('0x32')][_0x1118('0x49')]){_0x2b36dd['include']=[{'all':!![]}];}_0x2b36dd=_[_0x1118('0x3e')]({},_0x2b36dd,_0x4e4420['options']);return db['SugarcrmField']['find'](_0x2b36dd)[_0x1118('0x42')](handleEntityNotFound(_0x3db6b5,null))[_0x1118('0x42')](respondWithResult(_0x3db6b5,null))[_0x1118('0x45')](handleError(_0x3db6b5,null));};exports[_0x1118('0x4a')]=function(_0x132f2e,_0x18068c){return db['SugarcrmField'][_0x1118('0x4a')](_0x132f2e[_0x1118('0x4b')],{})[_0x1118('0x42')](respondWithResult(_0x18068c,0xc9))[_0x1118('0x45')](handleError(_0x18068c,null));};exports['update']=function(_0x2354cd,_0x275862){if(_0x2354cd[_0x1118('0x4b')]['id']){delete _0x2354cd['body']['id'];}return db[_0x1118('0x2b')]['find']({'where':{'id':_0x2354cd[_0x1118('0x47')]['id']}})[_0x1118('0x42')](handleEntityNotFound(_0x275862,null))['then'](saveUpdates(_0x2354cd['body'],null))[_0x1118('0x42')](respondWithResult(_0x275862,null))[_0x1118('0x45')](handleError(_0x275862,null));};exports['destroy']=function(_0xb15a57,_0x7707b3){return db[_0x1118('0x2b')][_0x1118('0x4c')]({'where':{'id':_0xb15a57[_0x1118('0x47')]['id']}})[_0x1118('0x42')](handleEntityNotFound(_0x7707b3,null))[_0x1118('0x42')](removeEntity(_0x7707b3,null))[_0x1118('0x45')](handleError(_0x7707b3,null));};
\ No newline at end of file
index 36a85d7..5dda836 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9388=['bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','FieldId','util','api','moment'];(function(_0x41e283,_0x4fee6f){var _0xdb09f7=function(_0x43f9fb){while(--_0x43f9fb){_0x41e283['push'](_0x41e283['shift']());}};_0xdb09f7(++_0x4fee6f);}(_0x9388,0x1a1));var _0x8938=function(_0x238c96,_0xd54036){_0x238c96=_0x238c96-0x0;var _0x1319ce=_0x9388[_0x238c96];return _0x1319ce;};'use strict';var _=require('lodash');var util=require(_0x8938('0x0'));var logger=require('../../config/logger')(_0x8938('0x1'));var moment=require(_0x8938('0x2'));var BPromise=require(_0x8938('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8938('0x4'));var rimraf=require(_0x8938('0x5'));var config=require(_0x8938('0x6'));var attributes=require(_0x8938('0x7'));module[_0x8938('0x8')]=function(_0x1cc2ca,_0x262e2b){return _0x1cc2ca[_0x8938('0x9')](_0x8938('0xa'),attributes,{'tableName':_0x8938('0xb'),'paranoid':![],'indexes':[{'name':_0x8938('0xc'),'fields':['idField',_0x8938('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x702b=['lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','SugarcrmField','sugarcrm_unique_index','idField','FieldId'];(function(_0x422522,_0x3a0277){var _0x19739d=function(_0xf9ffc9){while(--_0xf9ffc9){_0x422522['push'](_0x422522['shift']());}};_0x19739d(++_0x3a0277);}(_0x702b,0xb6));var _0xb702=function(_0x8f28d7,_0x4eb659){_0x8f28d7=_0x8f28d7-0x0;var _0x25f74e=_0x702b[_0x8f28d7];return _0x25f74e;};'use strict';var _=require(_0xb702('0x0'));var util=require(_0xb702('0x1'));var logger=require(_0xb702('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb702('0x3'));var rp=require(_0xb702('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb702('0x5'));var config=require(_0xb702('0x6'));var attributes=require(_0xb702('0x7'));module[_0xb702('0x8')]=function(_0x4400a9,_0x5b8230){return _0x4400a9['define'](_0xb702('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0xb702('0xa'),'fields':[_0xb702('0xb'),_0xb702('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 5b167ff..1473a38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c6c=['SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info'];(function(_0x156ab9,_0x27509a){var _0x1feb8b=function(_0x4bf1e6){while(--_0x4bf1e6){_0x156ab9['push'](_0x156ab9['shift']());}};_0x1feb8b(++_0x27509a);}(_0x2c6c,0x85));var _0xc2c6=function(_0x36b824,_0x36b64b){_0x36b824=_0x36b824-0x0;var _0x232377=_0x2c6c[_0x36b824];return _0x232377;};'use strict';var _=require(_0xc2c6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc2c6('0x1'));var rs=require(_0xc2c6('0x2'));var fs=require('fs');var Redis=require(_0xc2c6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2c6('0x4'));var logger=require(_0xc2c6('0x5'))(_0xc2c6('0x6'));var config=require(_0xc2c6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc2c6('0x8')][_0xc2c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b4fee,_0x25a957,_0x4ffe44){return new BPromise(function(_0x41769c,_0x5122cc){return client['request'](_0x5b4fee,_0x4ffe44)['then'](function(_0x4e52d8){logger[_0xc2c6('0xa')](_0xc2c6('0xb'),_0x25a957,'request\x20sent');logger['debug'](_0xc2c6('0xc'),_0x25a957,_0xc2c6('0xd'),JSON['stringify'](_0x4e52d8));if(_0x4e52d8[_0xc2c6('0xe')]){if(_0x4e52d8[_0xc2c6('0xe')][_0xc2c6('0xf')]===0x1f4){logger[_0xc2c6('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x25a957,_0x4e52d8[_0xc2c6('0xe')][_0xc2c6('0x10')]);return _0x5122cc(_0x4e52d8[_0xc2c6('0xe')][_0xc2c6('0x10')]);}logger['error'](_0xc2c6('0xb'),_0x25a957,_0x4e52d8['error']['message']);return _0x41769c(_0x4e52d8[_0xc2c6('0xe')][_0xc2c6('0x10')]);}else{logger[_0xc2c6('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x25a957,_0xc2c6('0xd'));_0x41769c(_0x4e52d8['result'][_0xc2c6('0x10')]);}})[_0xc2c6('0x11')](function(_0x408363){logger[_0xc2c6('0xe')](_0xc2c6('0xb'),_0x25a957,_0x408363);_0x5122cc(_0x408363);});});}
\ No newline at end of file
+var _0x967a=['SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa8fbaa,_0x3dca17){var _0x44f12b=function(_0x35e801){while(--_0x35e801){_0xa8fbaa['push'](_0xa8fbaa['shift']());}};_0x44f12b(++_0x3dca17);}(_0x967a,0x17b));var _0xa967=function(_0xc6c9e5,_0x1c794f){_0xc6c9e5=_0xc6c9e5-0x0;var _0x331159=_0x967a[_0xc6c9e5];return _0x331159;};'use strict';var _=require(_0xa967('0x0'));var util=require(_0xa967('0x1'));var moment=require(_0xa967('0x2'));var BPromise=require('bluebird');var rs=require(_0xa967('0x3'));var fs=require('fs');var Redis=require(_0xa967('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa967('0x5'));var logger=require(_0xa967('0x6'))(_0xa967('0x7'));var config=require(_0xa967('0x8'));var jayson=require(_0xa967('0x9'));var client=jayson[_0xa967('0xa')][_0xa967('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xddef12,_0x3a85ea,_0x15d0c9){return new BPromise(function(_0x2627ee,_0x1e900c){return client['request'](_0xddef12,_0x15d0c9)['then'](function(_0x413880){logger['info'](_0xa967('0xc'),_0x3a85ea,_0xa967('0xd'));logger[_0xa967('0xe')](_0xa967('0xf'),_0x3a85ea,_0xa967('0xd'),JSON[_0xa967('0x10')](_0x413880));if(_0x413880['error']){if(_0x413880[_0xa967('0x11')][_0xa967('0x12')]===0x1f4){logger[_0xa967('0x11')](_0xa967('0xc'),_0x3a85ea,_0x413880['error'][_0xa967('0x13')]);return _0x1e900c(_0x413880[_0xa967('0x11')][_0xa967('0x13')]);}logger[_0xa967('0x11')](_0xa967('0xc'),_0x3a85ea,_0x413880[_0xa967('0x11')][_0xa967('0x13')]);return _0x2627ee(_0x413880['error'][_0xa967('0x13')]);}else{logger[_0xa967('0x14')]('SugarcrmField,\x20%s,\x20%s',_0x3a85ea,_0xa967('0xd'));_0x2627ee(_0x413880[_0xa967('0x15')]['message']);}})[_0xa967('0x16')](function(_0x1464c9){logger[_0xa967('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x3a85ea,_0x1464c9);_0x1e900c(_0x1464c9);});});}
\ No newline at end of file
index a7c2aeb..0d948d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea03=['destroy','multer','path','connect-timeout','express','Router','fs-extra','./intVtigerAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','put','/:id','update','delete'];(function(_0x137cea,_0x20e60d){var _0x480882=function(_0x280975){while(--_0x280975){_0x137cea['push'](_0x137cea['shift']());}};_0x480882(++_0x20e60d);}(_0xea03,0x1ba));var _0x3ea0=function(_0x1416fc,_0x72e155){_0x1416fc=_0x1416fc-0x0;var _0x3a4b34=_0xea03[_0x1416fc];return _0x3a4b34;};'use strict';var multer=require(_0x3ea0('0x0'));var util=require('util');var path=require(_0x3ea0('0x1'));var timeout=require(_0x3ea0('0x2'));var express=require(_0x3ea0('0x3'));var router=express[_0x3ea0('0x4')]();var fs_extra=require(_0x3ea0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ea0('0x6'));router[_0x3ea0('0x7')]('/',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0x9')]);router[_0x3ea0('0x7')]('/:id',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0xa')]);router[_0x3ea0('0x7')](_0x3ea0('0xb'),auth[_0x3ea0('0x8')](),controller[_0x3ea0('0xc')]);router[_0x3ea0('0x7')]('/:id/fields',auth[_0x3ea0('0x8')](),controller[_0x3ea0('0xd')]);router[_0x3ea0('0xe')]('/',auth['isAuthenticated'](),controller[_0x3ea0('0xf')]);router[_0x3ea0('0xe')](_0x3ea0('0xb'),auth[_0x3ea0('0x8')](),controller['addConfiguration']);router[_0x3ea0('0x10')](_0x3ea0('0x11'),auth[_0x3ea0('0x8')](),controller[_0x3ea0('0x12')]);router[_0x3ea0('0x13')](_0x3ea0('0x11'),auth['isAuthenticated'](),controller[_0x3ea0('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x6c5e=['/:id/fields','getFields','create','post','addConfiguration','put','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','index','/:id','isAuthenticated','show','getConfigurations'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0x6c5e,0x1d6));var _0xe6c5=function(_0xafb8e6,_0x4b3a6b){_0xafb8e6=_0xafb8e6-0x0;var _0x36eec3=_0x6c5e[_0xafb8e6];return _0x36eec3;};'use strict';var multer=require(_0xe6c5('0x0'));var util=require(_0xe6c5('0x1'));var path=require(_0xe6c5('0x2'));var timeout=require(_0xe6c5('0x3'));var express=require('express');var router=express[_0xe6c5('0x4')]();var fs_extra=require(_0xe6c5('0x5'));var auth=require(_0xe6c5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0xe6c5('0x7')]('/',auth['isAuthenticated'](),controller[_0xe6c5('0x8')]);router['get'](_0xe6c5('0x9'),auth[_0xe6c5('0xa')](),controller[_0xe6c5('0xb')]);router[_0xe6c5('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe6c5('0xc')]);router['get'](_0xe6c5('0xd'),auth[_0xe6c5('0xa')](),controller[_0xe6c5('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe6c5('0xf')]);router[_0xe6c5('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe6c5('0x11')]);router[_0xe6c5('0x12')](_0xe6c5('0x9'),auth[_0xe6c5('0xa')](),controller['update']);router['delete'](_0xe6c5('0x9'),auth[_0xe6c5('0xa')](),controller[_0xe6c5('0x13')]);module[_0xe6c5('0x14')]=router;
\ No newline at end of file
index 1e705d3..f6ba120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd488=['STRING','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd488,0x107));var _0x8d48=function(_0x276167,_0x21086e){_0x276167=_0x276167-0x0;var _0x27a866=_0xd488[_0x276167];return _0x27a866;};'use strict';var Sequelize=require('sequelize');module[_0x8d48('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8d48('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x8d48('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x8d48('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x8d48('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x8d48('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xfae3=['HelpDesk','sequelize','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfae3,0xe8));var _0x3fae=function(_0x2cbfcc,_0x41c929){_0x2cbfcc=_0x2cbfcc-0x0;var _0x46dd12=_0xfae3[_0x2cbfcc];return _0x46dd12;};'use strict';var Sequelize=require(_0x3fae('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3fae('0x1')]},'username':{'type':Sequelize[_0x3fae('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3fae('0x1')],'allowNull':![],'defaultValue':_0x3fae('0x2')},'remoteUri':{'type':Sequelize[_0x3fae('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3fae('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 66df4bc..f13878a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7e9=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','name','send','index','map','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','include','findAll','rows','catch','rawAttributes','includeAll','create','body','find','params','destroy','findOne','getConfigurations','nolimit','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Subjects','Descriptions','md5','getFields','username','description','moduleName','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','success','login','result','token','GET','sessionName','autogenerated','reference','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','label','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc7e9,0x1cc));var _0x9c7e=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0xc7e9[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x9c7e('0x0'));var rimraf=require(_0x9c7e('0x1'));var zipdir=require(_0x9c7e('0x2'));var jsonpatch=require(_0x9c7e('0x3'));var rp=require(_0x9c7e('0x4'));var moment=require(_0x9c7e('0x5'));var BPromise=require(_0x9c7e('0x6'));var Mustache=require(_0x9c7e('0x7'));var util=require(_0x9c7e('0x8'));var path=require(_0x9c7e('0x9'));var sox=require(_0x9c7e('0xa'));var csv=require(_0x9c7e('0xb'));var ejs=require(_0x9c7e('0xc'));var fs=require('fs');var fs_extra=require(_0x9c7e('0xd'));var _=require(_0x9c7e('0xe'));var squel=require(_0x9c7e('0xf'));var crypto=require(_0x9c7e('0x10'));var jsforce=require(_0x9c7e('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x9c7e('0xb'));var querystring=require(_0x9c7e('0x12'));var Papa=require('papaparse');var Redis=require(_0x9c7e('0x13'));var authService=require(_0x9c7e('0x14'));var qs=require(_0x9c7e('0x15'));var as=require(_0x9c7e('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9c7e('0x17'));var licenseUtil=require(_0x9c7e('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9c7e('0x19'));function respondWithStatusCode(_0xd8c82c,_0x2e4502){_0x2e4502=_0x2e4502||0xcc;return function(_0x19eeeb){if(_0x19eeeb){return _0xd8c82c[_0x9c7e('0x1a')](_0x2e4502);}return _0xd8c82c[_0x9c7e('0x1b')](_0x2e4502)['end']();};}function respondWithResult(_0x4d4133,_0x56cea3){_0x56cea3=_0x56cea3||0xc8;return function(_0xbf8676){if(_0xbf8676){return _0x4d4133[_0x9c7e('0x1b')](_0x56cea3)[_0x9c7e('0x1c')](_0xbf8676);}};}function respondWithFilteredResult(_0x3f2450,_0x3bff5b){return function(_0x4d8ce5){if(_0x4d8ce5){var _0xe4dcfb=typeof _0x3bff5b[_0x9c7e('0x1d')]===_0x9c7e('0x1e')&&typeof _0x3bff5b['limit']==='undefined';var _0x5002ed=_0x4d8ce5[_0x9c7e('0x1f')];var _0x2823e4=_0xe4dcfb?0x0:_0x3bff5b[_0x9c7e('0x1d')];var _0xfd9b96=_0xe4dcfb?_0x4d8ce5[_0x9c7e('0x1f')]:_0x3bff5b[_0x9c7e('0x1d')]+_0x3bff5b[_0x9c7e('0x20')];var _0x183b87;if(_0xfd9b96>=_0x5002ed){_0xfd9b96=_0x5002ed;_0x183b87=0xc8;}else{_0x183b87=0xce;}_0x3f2450['status'](_0x183b87);return _0x3f2450[_0x9c7e('0x21')]('Content-Range',_0x2823e4+'-'+_0xfd9b96+'/'+_0x5002ed)[_0x9c7e('0x1c')](_0x4d8ce5);}return null;};}function patchUpdates(_0x5e39b6){return function(_0x28cad1){try{jsonpatch[_0x9c7e('0x22')](_0x28cad1,_0x5e39b6,!![]);}catch(_0x395eda){return BPromise['reject'](_0x395eda);}return _0x28cad1[_0x9c7e('0x23')]();};}function saveUpdates(_0x392457,_0x210701){return function(_0x4cc63e){if(_0x4cc63e){return _0x4cc63e[_0x9c7e('0x24')](_0x392457)['then'](function(_0x5c530a){return _0x5c530a;});}return null;};}function removeEntity(_0x3983d2,_0x34046d){return function(_0x1b740){if(_0x1b740){return _0x1b740['destroy']()[_0x9c7e('0x25')](function(){_0x3983d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f413,_0x68d386){return function(_0x304f99){if(!_0x304f99){_0x22f413[_0x9c7e('0x1a')](0x194);}return _0x304f99;};}function handleError(_0x1edf75,_0x314aff){_0x314aff=_0x314aff||0x1f4;return function(_0x3d196c){logger[_0x9c7e('0x26')](_0x3d196c['stack']);if(_0x3d196c[_0x9c7e('0x27')]){delete _0x3d196c['name'];}_0x1edf75[_0x9c7e('0x1b')](_0x314aff)[_0x9c7e('0x28')](_0x3d196c);};}exports[_0x9c7e('0x29')]=function(_0x45b44e,_0x39d0d2){var _0xea1cc3={},_0x3b1ab9={},_0x33945f={'count':0x0,'rows':[]};var _0x5aae51=_[_0x9c7e('0x2a')](db['VtigerAccount']['rawAttributes'],function(_0x1668fb){return{'name':_0x1668fb['fieldName'],'type':_0x1668fb[_0x9c7e('0x2b')]['key']};});_0x3b1ab9['model']=_['map'](_0x5aae51,_0x9c7e('0x27'));_0x3b1ab9[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x45b44e[_0x9c7e('0x2c')]);_0x3b1ab9[_0x9c7e('0x2e')]=_[_0x9c7e('0x2f')](_0x3b1ab9[_0x9c7e('0x30')],_0x3b1ab9['query']);_0xea1cc3[_0x9c7e('0x31')]=_[_0x9c7e('0x2f')](_0x3b1ab9[_0x9c7e('0x30')],qs[_0x9c7e('0x32')](_0x45b44e[_0x9c7e('0x2c')][_0x9c7e('0x32')]));_0xea1cc3[_0x9c7e('0x31')]=_0xea1cc3[_0x9c7e('0x31')][_0x9c7e('0x33')]?_0xea1cc3[_0x9c7e('0x31')]:_0x3b1ab9['model'];if(!_0x45b44e['query'][_0x9c7e('0x34')]('nolimit')){_0xea1cc3[_0x9c7e('0x20')]=qs['limit'](_0x45b44e[_0x9c7e('0x2c')][_0x9c7e('0x20')]);_0xea1cc3[_0x9c7e('0x1d')]=qs['offset'](_0x45b44e[_0x9c7e('0x2c')]['offset']);}_0xea1cc3['order']=qs[_0x9c7e('0x35')](_0x45b44e['query'][_0x9c7e('0x35')]);_0xea1cc3[_0x9c7e('0x36')]=qs[_0x9c7e('0x2e')](_[_0x9c7e('0x37')](_0x45b44e[_0x9c7e('0x2c')],_0x3b1ab9['filters']),_0x5aae51);if(_0x45b44e['query'][_0x9c7e('0x38')]){_0xea1cc3[_0x9c7e('0x36')]=_[_0x9c7e('0x39')](_0xea1cc3[_0x9c7e('0x36')],{'$or':_[_0x9c7e('0x2a')](_0x5aae51,function(_0x3631fe){if(_0x3631fe[_0x9c7e('0x2b')]!==_0x9c7e('0x3a')){var _0x4fa413={};_0x4fa413[_0x3631fe[_0x9c7e('0x27')]]={'$like':'%'+_0x45b44e[_0x9c7e('0x2c')][_0x9c7e('0x38')]+'%'};return _0x4fa413;}})});}_0xea1cc3=_[_0x9c7e('0x39')]({},_0xea1cc3,_0x45b44e[_0x9c7e('0x3b')]);var _0x1cb89e={'where':_0xea1cc3['where']};return db[_0x9c7e('0x3c')]['count'](_0x1cb89e)[_0x9c7e('0x25')](function(_0x150465){_0x33945f[_0x9c7e('0x1f')]=_0x150465;if(_0x45b44e[_0x9c7e('0x2c')]['includeAll']){_0xea1cc3[_0x9c7e('0x3d')]=[{'all':!![]}];}return db[_0x9c7e('0x3c')][_0x9c7e('0x3e')](_0xea1cc3);})[_0x9c7e('0x25')](function(_0x5eb1a4){_0x33945f[_0x9c7e('0x3f')]=_0x5eb1a4;return _0x33945f;})['then'](respondWithFilteredResult(_0x39d0d2,_0xea1cc3))[_0x9c7e('0x40')](handleError(_0x39d0d2,null));};exports['show']=function(_0x4939c8,_0x40c278){var _0x1ab219={'raw':![],'where':{'id':_0x4939c8['params']['id']}},_0x53ba54={};_0x53ba54[_0x9c7e('0x30')]=_[_0x9c7e('0x2d')](db['VtigerAccount'][_0x9c7e('0x41')]);_0x53ba54[_0x9c7e('0x2c')]=_['keys'](_0x4939c8['query']);_0x53ba54[_0x9c7e('0x2e')]=_[_0x9c7e('0x2f')](_0x53ba54[_0x9c7e('0x30')],_0x53ba54[_0x9c7e('0x2c')]);_0x1ab219['attributes']=_[_0x9c7e('0x2f')](_0x53ba54[_0x9c7e('0x30')],qs[_0x9c7e('0x32')](_0x4939c8[_0x9c7e('0x2c')]['fields']));_0x1ab219['attributes']=_0x1ab219['attributes'][_0x9c7e('0x33')]?_0x1ab219[_0x9c7e('0x31')]:_0x53ba54['model'];if(_0x4939c8[_0x9c7e('0x2c')][_0x9c7e('0x42')]){_0x1ab219[_0x9c7e('0x3d')]=[{'all':!![]}];}_0x1ab219=_['merge']({},_0x1ab219,_0x4939c8[_0x9c7e('0x3b')]);return db[_0x9c7e('0x3c')]['find'](_0x1ab219)[_0x9c7e('0x25')](handleEntityNotFound(_0x40c278,null))['then'](respondWithResult(_0x40c278,null))[_0x9c7e('0x40')](handleError(_0x40c278,null));};exports['create']=function(_0x5eec4a,_0x3ecf21){return db['VtigerAccount'][_0x9c7e('0x43')](_0x5eec4a[_0x9c7e('0x44')],{})[_0x9c7e('0x25')](respondWithResult(_0x3ecf21,0xc9))[_0x9c7e('0x40')](handleError(_0x3ecf21,null));};exports['update']=function(_0x3a90c7,_0xb1baff){if(_0x3a90c7['body']['id']){delete _0x3a90c7['body']['id'];}return db[_0x9c7e('0x3c')][_0x9c7e('0x45')]({'where':{'id':_0x3a90c7[_0x9c7e('0x46')]['id']}})['then'](handleEntityNotFound(_0xb1baff,null))[_0x9c7e('0x25')](saveUpdates(_0x3a90c7[_0x9c7e('0x44')],null))['then'](respondWithResult(_0xb1baff,null))[_0x9c7e('0x40')](handleError(_0xb1baff,null));};exports[_0x9c7e('0x47')]=function(_0x4e9b29,_0x264766){return db[_0x9c7e('0x3c')][_0x9c7e('0x45')]({'where':{'id':_0x4e9b29['params']['id']}})[_0x9c7e('0x25')](handleEntityNotFound(_0x264766,null))[_0x9c7e('0x25')](removeEntity(_0x264766,null))[_0x9c7e('0x40')](handleError(_0x264766,null));};exports['getConfigurations']=function(_0x5ddb1c,_0x1d80c5,_0x442725){var _0x5b279d={};var _0x174e88={};var _0x1ab149;var _0x24c0f8;return db['VtigerAccount'][_0x9c7e('0x48')]({'where':{'id':_0x5ddb1c['params']['id']}})[_0x9c7e('0x25')](handleEntityNotFound(_0x1d80c5,null))[_0x9c7e('0x25')](function(_0x3c5066){if(_0x3c5066){_0x1ab149=_0x3c5066;_0x174e88[_0x9c7e('0x30')]=_[_0x9c7e('0x2d')](db['VtigerConfiguration']['rawAttributes']);_0x174e88[_0x9c7e('0x2c')]=_[_0x9c7e('0x2d')](_0x5ddb1c['query']);_0x174e88['filters']=_[_0x9c7e('0x2f')](_0x174e88[_0x9c7e('0x30')],_0x174e88[_0x9c7e('0x2c')]);_0x5b279d['attributes']=_[_0x9c7e('0x2f')](_0x174e88[_0x9c7e('0x30')],qs[_0x9c7e('0x32')](_0x5ddb1c[_0x9c7e('0x2c')][_0x9c7e('0x32')]));_0x5b279d['attributes']=_0x5b279d[_0x9c7e('0x31')][_0x9c7e('0x33')]?_0x5b279d[_0x9c7e('0x31')]:_0x174e88[_0x9c7e('0x30')];_0x5b279d['order']=qs[_0x9c7e('0x35')](_0x5ddb1c[_0x9c7e('0x2c')][_0x9c7e('0x35')]);_0x5b279d['where']=qs[_0x9c7e('0x2e')](_[_0x9c7e('0x37')](_0x5ddb1c[_0x9c7e('0x2c')],_0x174e88['filters']));if(_0x5ddb1c['query']['filter']){_0x5b279d['where']=_[_0x9c7e('0x39')](_0x5b279d['where'],{'$or':_[_0x9c7e('0x2a')](_0x5b279d[_0x9c7e('0x31')],function(_0x2118f6){var _0x25f9e6={};_0x25f9e6[_0x2118f6]={'$like':'%'+_0x5ddb1c['query'][_0x9c7e('0x38')]+'%'};return _0x25f9e6;})});}_0x5b279d=_[_0x9c7e('0x39')]({},_0x5b279d,_0x5ddb1c[_0x9c7e('0x3b')]);return _0x1ab149[_0x9c7e('0x49')](_0x5b279d);}})[_0x9c7e('0x25')](function(_0x520df7){if(_0x520df7){_0x24c0f8=_0x520df7[_0x9c7e('0x33')];if(!_0x5ddb1c[_0x9c7e('0x2c')][_0x9c7e('0x34')](_0x9c7e('0x4a'))){_0x5b279d['limit']=qs[_0x9c7e('0x20')](_0x5ddb1c[_0x9c7e('0x2c')]['limit']);_0x5b279d[_0x9c7e('0x1d')]=qs[_0x9c7e('0x1d')](_0x5ddb1c[_0x9c7e('0x2c')][_0x9c7e('0x1d')]);}return _0x1ab149[_0x9c7e('0x49')](_0x5b279d);}})[_0x9c7e('0x25')](function(_0x891b17){if(_0x891b17){return _0x891b17?{'count':_0x24c0f8,'rows':_0x891b17}:null;}})[_0x9c7e('0x25')](respondWithResult(_0x1d80c5,null))[_0x9c7e('0x40')](handleError(_0x1d80c5,null));};exports['addConfiguration']=function(_0x313b7c,_0x231c3c,_0x1edbca){if(_0x313b7c[_0x9c7e('0x44')]['id']){delete _0x313b7c[_0x9c7e('0x44')]['id'];}return db['VtigerAccount'][_0x9c7e('0x48')]({'where':{'id':_0x313b7c[_0x9c7e('0x46')]['id']}})[_0x9c7e('0x25')](handleEntityNotFound(_0x231c3c,null))[_0x9c7e('0x25')](function(_0x5a5825){if(_0x5a5825){_0x313b7c[_0x9c7e('0x44')]['AccountId']=_0x5a5825['id'];_0x313b7c[_0x9c7e('0x44')]['Subjects']=integrations[_0x9c7e('0x4b')](_0x313b7c[_0x9c7e('0x44')][_0x9c7e('0x4c')],_0x313b7c[_0x9c7e('0x44')][_0x9c7e('0x2b')]);_0x313b7c[_0x9c7e('0x44')]['Descriptions']=integrations[_0x9c7e('0x4d')](_0x313b7c[_0x9c7e('0x44')][_0x9c7e('0x4c')],_0x313b7c[_0x9c7e('0x44')][_0x9c7e('0x2b')]);return db[_0x9c7e('0x4e')]['create'](_0x313b7c[_0x9c7e('0x44')],{'include':[{'model':db[_0x9c7e('0x4f')],'as':_0x9c7e('0x50')},{'model':db['VtigerField'],'as':_0x9c7e('0x51')}]});}return null;})[_0x9c7e('0x25')](respondWithResult(_0x231c3c,null))[_0x9c7e('0x40')](handleError(_0x231c3c,null));};var md5=require(_0x9c7e('0x52'));exports[_0x9c7e('0x53')]=function(_0x8d227e,_0x5466ef,_0x5e9612){var _0x284eb2=null;var _0x59a609=null;var _0x299ad6=null;var _0x99b924=null;var _0x27451c='';return db[_0x9c7e('0x3c')][_0x9c7e('0x48')]({'where':{'id':_0x8d227e[_0x9c7e('0x46')]['id']},'attributes':['id','name',_0x9c7e('0x54'),_0x9c7e('0x55'),_0x9c7e('0x56'),'remoteUri','serverUrl',_0x9c7e('0x57')]})[_0x9c7e('0x25')](handleEntityNotFound(_0x5466ef,null))[_0x9c7e('0x25')](function(_0x4fe1f6){if(_0x4fe1f6){_0x284eb2=_0x4fe1f6[_0x9c7e('0x54')];_0x59a609=_0x4fe1f6[_0x9c7e('0x57')];_0x299ad6=_0x4fe1f6[_0x9c7e('0x56')];_0x27451c=_0x4fe1f6['remoteUri'];var _0x20ca1a=_0x27451c[_0x9c7e('0x58')](-0x1);if(_0x20ca1a==='/'){_0x27451c=_0x27451c[_0x9c7e('0x59')](0x0,_0x27451c[_0x9c7e('0x5a')](_0x20ca1a));}_0x99b924=util[_0x9c7e('0x5b')](_0x9c7e('0x5c'),_0x27451c);var _0x5e4a45={'method':'GET','uri':_0x99b924,'qs':{'operation':_0x9c7e('0x5d'),'username':_0x4fe1f6[_0x9c7e('0x54')]},'json':!![]};return rp(_0x5e4a45);}})[_0x9c7e('0x25')](function(_0x4b585c){if(_0x4b585c[_0x9c7e('0x5e')]){var _0x2e7ee0={'method':'POST','uri':_0x99b924,'form':{'operation':_0x9c7e('0x5f'),'username':_0x284eb2,'accessKey':md5(_0x4b585c[_0x9c7e('0x60')][_0x9c7e('0x61')]+_0x59a609)},'json':!![]};return rp(_0x2e7ee0);}})[_0x9c7e('0x25')](function(_0x217c98){if(_0x217c98[_0x9c7e('0x5e')]){var _0x5ce910={'method':_0x9c7e('0x62'),'uri':_0x99b924,'qs':{'operation':'describe','username':_0x284eb2,'sessionName':_0x217c98[_0x9c7e('0x60')][_0x9c7e('0x63')],'elementType':_0x299ad6},'json':!![]};return rp(_0x5ce910);}})[_0x9c7e('0x25')](function(_0x57a70d){if(_0x57a70d[_0x9c7e('0x5e')]){var _0x196ec8=[_0x9c7e('0x64'),_0x9c7e('0x65'),'owner'];_[_0x9c7e('0x66')](_0x57a70d[_0x9c7e('0x60')][_0x9c7e('0x32')],function(_0x57e58c){return _0x196ec8[_0x9c7e('0x67')](_0x57e58c[_0x9c7e('0x2b')]['name']);});_[_0x9c7e('0x66')](_0x57a70d[_0x9c7e('0x60')][_0x9c7e('0x32')],function(_0x2b22e3){return _0x2b22e3[_0x9c7e('0x68')]===_0x9c7e('0x69');});return{'count':_0x57a70d[_0x9c7e('0x60')][_0x9c7e('0x32')][_0x9c7e('0x33')],'rows':_[_0x9c7e('0x2a')](_0x57a70d[_0x9c7e('0x60')][_0x9c7e('0x32')],function(_0x4f7df9){return{'id':_0x4f7df9[_0x9c7e('0x27')],'name':_0x4f7df9['label'],'custom':_[_0x9c7e('0x6a')](_0x4f7df9[_0x9c7e('0x27')],_0x9c7e('0x6b'))?!![]:![],'options':_0x4f7df9['type'][_0x9c7e('0x27')]===_0x9c7e('0x6c')&&_0x4f7df9[_0x9c7e('0x2b')][_0x9c7e('0x6d')][_0x9c7e('0x33')]>0x0?_['map'](_0x4f7df9[_0x9c7e('0x2b')][_0x9c7e('0x6d')],function(_0xef1490){return{'name':_0xef1490[_0x9c7e('0x6e')],'value':_0xef1490[_0x9c7e('0x6f')]};}):[]};})};}})[_0x9c7e('0x25')](respondWithResult(_0x5466ef,null))[_0x9c7e('0x40')](function(_0x6f3cc8){console[_0x9c7e('0x70')]('vTiger\x20error:\x20'+_0x6f3cc8);var _0x214ef7=_0x8d227e[_0x9c7e('0x2c')][_0x9c7e('0x71')]?0x1f4:_0x6f3cc8[_0x9c7e('0x72')]||0x1f4;logger['error'](_0x9c7e('0x73'),_0x9c7e('0x53'),_0x214ef7,JSON[_0x9c7e('0x74')](_0x6f3cc8));delete _0x6f3cc8[_0x9c7e('0x27')];if(_0x214ef7===0x191){_0x214ef7=0x190;}_0x5466ef[_0x9c7e('0x1b')](_0x214ef7)['send'](_0x8d227e[_0x9c7e('0x2c')][_0x9c7e('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x6f3cc8[_0x9c7e('0x72')]}:_0x6f3cc8);});};
\ No newline at end of file
+var _0x38d1=['rawAttributes','type','key','map','keys','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','VtigerConfiguration','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerField','md5','findOne','description','moduleName','serverUrl','accessKey','username','remoteUri','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','result','token','describe','autogenerated','reference','owner','remove','editable','false','label','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','end','stack','name','VtigerAccount'];(function(_0x2711f0,_0x1174e1){var _0x124d19=function(_0xd1ed1b){while(--_0xd1ed1b){_0x2711f0['push'](_0x2711f0['shift']());}};_0x124d19(++_0x1174e1);}(_0x38d1,0x1c5));var _0x138d=function(_0x45d0ad,_0x2e4a94){_0x45d0ad=_0x45d0ad-0x0;var _0x360f9d=_0x38d1[_0x45d0ad];return _0x360f9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x138d('0x0'));var zipdir=require(_0x138d('0x1'));var jsonpatch=require(_0x138d('0x2'));var rp=require(_0x138d('0x3'));var moment=require(_0x138d('0x4'));var BPromise=require(_0x138d('0x5'));var Mustache=require(_0x138d('0x6'));var util=require(_0x138d('0x7'));var path=require(_0x138d('0x8'));var sox=require(_0x138d('0x9'));var csv=require(_0x138d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x138d('0xb'));var _=require(_0x138d('0xc'));var squel=require(_0x138d('0xd'));var crypto=require(_0x138d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x138d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x138d('0x10'));var Papa=require(_0x138d('0x11'));var Redis=require(_0x138d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x138d('0x13'));var as=require(_0x138d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x138d('0x15'))(_0x138d('0x16'));var utils=require(_0x138d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x138d('0x18'))['db'];var integrations=require(_0x138d('0x19'));function respondWithStatusCode(_0x2034e1,_0x47515c){_0x47515c=_0x47515c||0xcc;return function(_0xb9ffc){if(_0xb9ffc){return _0x2034e1[_0x138d('0x1a')](_0x47515c);}return _0x2034e1[_0x138d('0x1b')](_0x47515c)['end']();};}function respondWithResult(_0x5463f0,_0x149c2a){_0x149c2a=_0x149c2a||0xc8;return function(_0x1622f7){if(_0x1622f7){return _0x5463f0[_0x138d('0x1b')](_0x149c2a)[_0x138d('0x1c')](_0x1622f7);}};}function respondWithFilteredResult(_0x50a1e7,_0x2467cc){return function(_0x4410b3){if(_0x4410b3){var _0x230f95=typeof _0x2467cc[_0x138d('0x1d')]===_0x138d('0x1e')&&typeof _0x2467cc[_0x138d('0x1f')]===_0x138d('0x1e');var _0x36139f=_0x4410b3['count'];var _0xcac56b=_0x230f95?0x0:_0x2467cc[_0x138d('0x1d')];var _0x5e9260=_0x230f95?_0x4410b3[_0x138d('0x20')]:_0x2467cc[_0x138d('0x1d')]+_0x2467cc[_0x138d('0x1f')];var _0x5303eb;if(_0x5e9260>=_0x36139f){_0x5e9260=_0x36139f;_0x5303eb=0xc8;}else{_0x5303eb=0xce;}_0x50a1e7[_0x138d('0x1b')](_0x5303eb);return _0x50a1e7[_0x138d('0x21')](_0x138d('0x22'),_0xcac56b+'-'+_0x5e9260+'/'+_0x36139f)[_0x138d('0x1c')](_0x4410b3);}return null;};}function patchUpdates(_0x216d32){return function(_0x65a5cd){try{jsonpatch[_0x138d('0x23')](_0x65a5cd,_0x216d32,!![]);}catch(_0x19fe1a){return BPromise['reject'](_0x19fe1a);}return _0x65a5cd[_0x138d('0x24')]();};}function saveUpdates(_0x493d00,_0x90f80b){return function(_0x26ce8a){if(_0x26ce8a){return _0x26ce8a['update'](_0x493d00)['then'](function(_0x2cd096){return _0x2cd096;});}return null;};}function removeEntity(_0x13f9e4,_0x40b371){return function(_0x4a75d9){if(_0x4a75d9){return _0x4a75d9[_0x138d('0x25')]()[_0x138d('0x26')](function(){_0x13f9e4[_0x138d('0x1b')](0xcc)[_0x138d('0x27')]();});}};}function handleEntityNotFound(_0x23a554,_0x74f3eb){return function(_0x5a0e34){if(!_0x5a0e34){_0x23a554[_0x138d('0x1a')](0x194);}return _0x5a0e34;};}function handleError(_0x384771,_0x45c78c){_0x45c78c=_0x45c78c||0x1f4;return function(_0x5756ac){logger['error'](_0x5756ac[_0x138d('0x28')]);if(_0x5756ac[_0x138d('0x29')]){delete _0x5756ac[_0x138d('0x29')];}_0x384771[_0x138d('0x1b')](_0x45c78c)['send'](_0x5756ac);};}exports['index']=function(_0x1f24de,_0x3634fb){var _0x44743a={},_0x1e8dca={},_0x767217={'count':0x0,'rows':[]};var _0x1de6ca=_['map'](db[_0x138d('0x2a')][_0x138d('0x2b')],function(_0x2856e6){return{'name':_0x2856e6['fieldName'],'type':_0x2856e6[_0x138d('0x2c')][_0x138d('0x2d')]};});_0x1e8dca['model']=_[_0x138d('0x2e')](_0x1de6ca,'name');_0x1e8dca['query']=_[_0x138d('0x2f')](_0x1f24de[_0x138d('0x30')]);_0x1e8dca[_0x138d('0x31')]=_['intersection'](_0x1e8dca['model'],_0x1e8dca[_0x138d('0x30')]);_0x44743a['attributes']=_[_0x138d('0x32')](_0x1e8dca['model'],qs[_0x138d('0x33')](_0x1f24de[_0x138d('0x30')][_0x138d('0x33')]));_0x44743a[_0x138d('0x34')]=_0x44743a[_0x138d('0x34')][_0x138d('0x35')]?_0x44743a[_0x138d('0x34')]:_0x1e8dca[_0x138d('0x36')];if(!_0x1f24de[_0x138d('0x30')][_0x138d('0x37')](_0x138d('0x38'))){_0x44743a['limit']=qs[_0x138d('0x1f')](_0x1f24de[_0x138d('0x30')][_0x138d('0x1f')]);_0x44743a[_0x138d('0x1d')]=qs[_0x138d('0x1d')](_0x1f24de['query'][_0x138d('0x1d')]);}_0x44743a[_0x138d('0x39')]=qs['sort'](_0x1f24de['query'][_0x138d('0x3a')]);_0x44743a[_0x138d('0x3b')]=qs[_0x138d('0x31')](_[_0x138d('0x3c')](_0x1f24de[_0x138d('0x30')],_0x1e8dca[_0x138d('0x31')]),_0x1de6ca);if(_0x1f24de[_0x138d('0x30')][_0x138d('0x3d')]){_0x44743a[_0x138d('0x3b')]=_[_0x138d('0x3e')](_0x44743a[_0x138d('0x3b')],{'$or':_['map'](_0x1de6ca,function(_0x3f955d){if(_0x3f955d[_0x138d('0x2c')]!==_0x138d('0x3f')){var _0x761346={};_0x761346[_0x3f955d['name']]={'$like':'%'+_0x1f24de[_0x138d('0x30')][_0x138d('0x3d')]+'%'};return _0x761346;}})});}_0x44743a=_[_0x138d('0x3e')]({},_0x44743a,_0x1f24de[_0x138d('0x40')]);var _0x10dfa2={'where':_0x44743a['where']};return db['VtigerAccount'][_0x138d('0x20')](_0x10dfa2)['then'](function(_0x57bb92){_0x767217[_0x138d('0x20')]=_0x57bb92;if(_0x1f24de[_0x138d('0x30')][_0x138d('0x41')]){_0x44743a[_0x138d('0x42')]=[{'all':!![]}];}return db[_0x138d('0x2a')][_0x138d('0x43')](_0x44743a);})['then'](function(_0x302620){_0x767217[_0x138d('0x44')]=_0x302620;return _0x767217;})[_0x138d('0x26')](respondWithFilteredResult(_0x3634fb,_0x44743a))[_0x138d('0x45')](handleError(_0x3634fb,null));};exports[_0x138d('0x46')]=function(_0x4247a6,_0x32c54d){var _0x4f5228={'raw':![],'where':{'id':_0x4247a6['params']['id']}},_0x40489b={};_0x40489b[_0x138d('0x36')]=_[_0x138d('0x2f')](db[_0x138d('0x2a')][_0x138d('0x2b')]);_0x40489b[_0x138d('0x30')]=_['keys'](_0x4247a6[_0x138d('0x30')]);_0x40489b[_0x138d('0x31')]=_[_0x138d('0x32')](_0x40489b['model'],_0x40489b[_0x138d('0x30')]);_0x4f5228[_0x138d('0x34')]=_[_0x138d('0x32')](_0x40489b[_0x138d('0x36')],qs[_0x138d('0x33')](_0x4247a6['query']['fields']));_0x4f5228[_0x138d('0x34')]=_0x4f5228[_0x138d('0x34')][_0x138d('0x35')]?_0x4f5228[_0x138d('0x34')]:_0x40489b[_0x138d('0x36')];if(_0x4247a6[_0x138d('0x30')][_0x138d('0x41')]){_0x4f5228[_0x138d('0x42')]=[{'all':!![]}];}_0x4f5228=_['merge']({},_0x4f5228,_0x4247a6['options']);return db['VtigerAccount'][_0x138d('0x47')](_0x4f5228)[_0x138d('0x26')](handleEntityNotFound(_0x32c54d,null))[_0x138d('0x26')](respondWithResult(_0x32c54d,null))['catch'](handleError(_0x32c54d,null));};exports[_0x138d('0x48')]=function(_0x36c94a,_0x108e38){return db[_0x138d('0x2a')][_0x138d('0x48')](_0x36c94a['body'],{})[_0x138d('0x26')](respondWithResult(_0x108e38,0xc9))[_0x138d('0x45')](handleError(_0x108e38,null));};exports[_0x138d('0x49')]=function(_0x2eb7d7,_0x2417a5){if(_0x2eb7d7['body']['id']){delete _0x2eb7d7[_0x138d('0x4a')]['id'];}return db[_0x138d('0x2a')][_0x138d('0x47')]({'where':{'id':_0x2eb7d7[_0x138d('0x4b')]['id']}})[_0x138d('0x26')](handleEntityNotFound(_0x2417a5,null))[_0x138d('0x26')](saveUpdates(_0x2eb7d7[_0x138d('0x4a')],null))[_0x138d('0x26')](respondWithResult(_0x2417a5,null))[_0x138d('0x45')](handleError(_0x2417a5,null));};exports[_0x138d('0x25')]=function(_0x2b2bf6,_0x3c72c8){return db['VtigerAccount'][_0x138d('0x47')]({'where':{'id':_0x2b2bf6['params']['id']}})[_0x138d('0x26')](handleEntityNotFound(_0x3c72c8,null))['then'](removeEntity(_0x3c72c8,null))[_0x138d('0x45')](handleError(_0x3c72c8,null));};exports['getConfigurations']=function(_0x8d4073,_0x5536af,_0x525c4d){var _0x1a9b41={};var _0xff385a={};var _0x6dbf7f;var _0x31c32f;return db[_0x138d('0x2a')]['findOne']({'where':{'id':_0x8d4073[_0x138d('0x4b')]['id']}})[_0x138d('0x26')](handleEntityNotFound(_0x5536af,null))['then'](function(_0xc3b49){if(_0xc3b49){_0x6dbf7f=_0xc3b49;_0xff385a[_0x138d('0x36')]=_[_0x138d('0x2f')](db[_0x138d('0x4c')][_0x138d('0x2b')]);_0xff385a['query']=_['keys'](_0x8d4073[_0x138d('0x30')]);_0xff385a['filters']=_[_0x138d('0x32')](_0xff385a[_0x138d('0x36')],_0xff385a[_0x138d('0x30')]);_0x1a9b41['attributes']=_[_0x138d('0x32')](_0xff385a[_0x138d('0x36')],qs[_0x138d('0x33')](_0x8d4073[_0x138d('0x30')]['fields']));_0x1a9b41['attributes']=_0x1a9b41['attributes'][_0x138d('0x35')]?_0x1a9b41[_0x138d('0x34')]:_0xff385a[_0x138d('0x36')];_0x1a9b41[_0x138d('0x39')]=qs[_0x138d('0x3a')](_0x8d4073['query'][_0x138d('0x3a')]);_0x1a9b41['where']=qs['filters'](_[_0x138d('0x3c')](_0x8d4073[_0x138d('0x30')],_0xff385a[_0x138d('0x31')]));if(_0x8d4073['query'][_0x138d('0x3d')]){_0x1a9b41['where']=_['merge'](_0x1a9b41[_0x138d('0x3b')],{'$or':_[_0x138d('0x2e')](_0x1a9b41['attributes'],function(_0xf75ee0){var _0x2f5e34={};_0x2f5e34[_0xf75ee0]={'$like':'%'+_0x8d4073[_0x138d('0x30')][_0x138d('0x3d')]+'%'};return _0x2f5e34;})});}_0x1a9b41=_[_0x138d('0x3e')]({},_0x1a9b41,_0x8d4073[_0x138d('0x40')]);return _0x6dbf7f['getConfigurations'](_0x1a9b41);}})[_0x138d('0x26')](function(_0x46e07a){if(_0x46e07a){_0x31c32f=_0x46e07a[_0x138d('0x35')];if(!_0x8d4073[_0x138d('0x30')][_0x138d('0x37')]('nolimit')){_0x1a9b41[_0x138d('0x1f')]=qs[_0x138d('0x1f')](_0x8d4073[_0x138d('0x30')]['limit']);_0x1a9b41['offset']=qs[_0x138d('0x1d')](_0x8d4073[_0x138d('0x30')]['offset']);}return _0x6dbf7f['getConfigurations'](_0x1a9b41);}})[_0x138d('0x26')](function(_0x5f177b){if(_0x5f177b){return _0x5f177b?{'count':_0x31c32f,'rows':_0x5f177b}:null;}})[_0x138d('0x26')](respondWithResult(_0x5536af,null))[_0x138d('0x45')](handleError(_0x5536af,null));};exports[_0x138d('0x4d')]=function(_0x5803cf,_0x26e752,_0x4dbd4a){if(_0x5803cf[_0x138d('0x4a')]['id']){delete _0x5803cf[_0x138d('0x4a')]['id'];}return db[_0x138d('0x2a')]['findOne']({'where':{'id':_0x5803cf['params']['id']}})[_0x138d('0x26')](handleEntityNotFound(_0x26e752,null))[_0x138d('0x26')](function(_0x5e6780){if(_0x5e6780){_0x5803cf['body'][_0x138d('0x4e')]=_0x5e6780['id'];_0x5803cf[_0x138d('0x4a')][_0x138d('0x4f')]=integrations['getSubjects'](_0x5803cf[_0x138d('0x4a')][_0x138d('0x50')],_0x5803cf[_0x138d('0x4a')][_0x138d('0x2c')]);_0x5803cf[_0x138d('0x4a')][_0x138d('0x51')]=integrations[_0x138d('0x52')](_0x5803cf[_0x138d('0x4a')]['channel'],_0x5803cf[_0x138d('0x4a')][_0x138d('0x2c')]);return db[_0x138d('0x4c')][_0x138d('0x48')](_0x5803cf[_0x138d('0x4a')],{'include':[{'model':db[_0x138d('0x53')],'as':_0x138d('0x4f')},{'model':db['VtigerField'],'as':_0x138d('0x51')}]});}return null;})[_0x138d('0x26')](respondWithResult(_0x26e752,null))['catch'](handleError(_0x26e752,null));};var md5=require(_0x138d('0x54'));exports['getFields']=function(_0x552685,_0x166d58,_0x56aa7){var _0x1c1325=null;var _0x1beaf3=null;var _0x9ce6ea=null;var _0x43c574=null;var _0x2e16b5='';return db[_0x138d('0x2a')][_0x138d('0x55')]({'where':{'id':_0x552685['params']['id']},'attributes':['id','name','username',_0x138d('0x56'),_0x138d('0x57'),'remoteUri',_0x138d('0x58'),_0x138d('0x59')]})[_0x138d('0x26')](handleEntityNotFound(_0x166d58,null))[_0x138d('0x26')](function(_0x184c6c){if(_0x184c6c){_0x1c1325=_0x184c6c[_0x138d('0x5a')];_0x1beaf3=_0x184c6c['accessKey'];_0x9ce6ea=_0x184c6c[_0x138d('0x57')];_0x2e16b5=_0x184c6c[_0x138d('0x5b')];var _0x4ac4f9=_0x2e16b5[_0x138d('0x5c')](-0x1);if(_0x4ac4f9==='/'){_0x2e16b5=_0x2e16b5['substring'](0x0,_0x2e16b5[_0x138d('0x5d')](_0x4ac4f9));}_0x43c574=util[_0x138d('0x5e')](_0x138d('0x5f'),_0x2e16b5);var _0x5b088a={'method':_0x138d('0x60'),'uri':_0x43c574,'qs':{'operation':_0x138d('0x61'),'username':_0x184c6c[_0x138d('0x5a')]},'json':!![]};return rp(_0x5b088a);}})['then'](function(_0x132da3){if(_0x132da3[_0x138d('0x62')]){var _0x808877={'method':_0x138d('0x63'),'uri':_0x43c574,'form':{'operation':'login','username':_0x1c1325,'accessKey':md5(_0x132da3[_0x138d('0x64')][_0x138d('0x65')]+_0x1beaf3)},'json':!![]};return rp(_0x808877);}})['then'](function(_0x564127){if(_0x564127[_0x138d('0x62')]){var _0x39b1d7={'method':_0x138d('0x60'),'uri':_0x43c574,'qs':{'operation':_0x138d('0x66'),'username':_0x1c1325,'sessionName':_0x564127[_0x138d('0x64')]['sessionName'],'elementType':_0x9ce6ea},'json':!![]};return rp(_0x39b1d7);}})[_0x138d('0x26')](function(_0xeda83e){if(_0xeda83e[_0x138d('0x62')]){var _0x328141=[_0x138d('0x67'),_0x138d('0x68'),_0x138d('0x69')];_[_0x138d('0x6a')](_0xeda83e[_0x138d('0x64')][_0x138d('0x33')],function(_0x3c9314){return _0x328141['includes'](_0x3c9314[_0x138d('0x2c')]['name']);});_[_0x138d('0x6a')](_0xeda83e[_0x138d('0x64')][_0x138d('0x33')],function(_0x270014){return _0x270014[_0x138d('0x6b')]===_0x138d('0x6c');});return{'count':_0xeda83e[_0x138d('0x64')]['fields'][_0x138d('0x35')],'rows':_[_0x138d('0x2e')](_0xeda83e[_0x138d('0x64')]['fields'],function(_0x18d976){return{'id':_0x18d976[_0x138d('0x29')],'name':_0x18d976[_0x138d('0x6d')],'custom':_['startsWith'](_0x18d976[_0x138d('0x29')],_0x138d('0x6e'))?!![]:![],'options':_0x18d976[_0x138d('0x2c')]['name']===_0x138d('0x6f')&&_0x18d976['type']['picklistValues']['length']>0x0?_[_0x138d('0x2e')](_0x18d976[_0x138d('0x2c')][_0x138d('0x70')],function(_0x525271){return{'name':_0x525271['label'],'value':_0x525271[_0x138d('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x166d58,null))[_0x138d('0x45')](function(_0x442f79){console[_0x138d('0x72')](_0x138d('0x73')+_0x442f79);var _0x190aad=_0x552685['query']['test']?0x1f4:_0x442f79[_0x138d('0x74')]||0x1f4;logger[_0x138d('0x75')](_0x138d('0x76'),_0x138d('0x77'),_0x190aad,JSON[_0x138d('0x78')](_0x442f79));delete _0x442f79[_0x138d('0x29')];if(_0x190aad===0x191){_0x190aad=0x190;}_0x166d58['status'](_0x190aad)[_0x138d('0x79')](_0x552685[_0x138d('0x30')][_0x138d('0x7a')]?{'message':_0x138d('0x7b'),'statusCode':_0x442f79['statusCode']}:_0x442f79);});};
\ No newline at end of file
index 80fd208..c879d24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ac7=['exports','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x346392,_0x32b724){var _0xd76262=function(_0x9d1a6d){while(--_0x9d1a6d){_0x346392['push'](_0x346392['shift']());}};_0xd76262(++_0x32b724);}(_0x1ac7,0xd3));var _0x71ac=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x1ac7[_0x32b542];return _0x554d54;};'use strict';var _=require('lodash');var util=require(_0x71ac('0x0'));var logger=require(_0x71ac('0x1'))(_0x71ac('0x2'));var moment=require(_0x71ac('0x3'));var BPromise=require(_0x71ac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71ac('0x5'));var rimraf=require(_0x71ac('0x6'));var config=require(_0x71ac('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x71ac('0x8'));module[_0x71ac('0x9')]=function(_0x500b3d,_0x3b481c){return _0x500b3d['define']('VtigerAccount',attributes,{'tableName':_0x71ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8461=['../../config/environment','../../components/integrations/configuration','define','VtigerAccount','int_vtiger_accounts','util','api','request-promise','path','rimraf'];(function(_0xbd6d54,_0x1b8e7a){var _0xa7e355=function(_0x135111){while(--_0x135111){_0xbd6d54['push'](_0xbd6d54['shift']());}};_0xa7e355(++_0x1b8e7a);}(_0x8461,0x13b));var _0x1846=function(_0x4de2de,_0x2171db){_0x4de2de=_0x4de2de-0x0;var _0x2e3372=_0x8461[_0x4de2de];return _0x2e3372;};'use strict';var _=require('lodash');var util=require(_0x1846('0x0'));var logger=require('../../config/logger')(_0x1846('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1846('0x2'));var fs=require('fs');var path=require(_0x1846('0x3'));var rimraf=require(_0x1846('0x4'));var config=require(_0x1846('0x5'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1846('0x6'));module['exports']=function(_0x2f4442,_0x2bbb52){return _0x2f4442[_0x1846('0x7')](_0x1846('0x8'),attributes,{'tableName':_0x1846('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc2c54f..d2989ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','raw','attributes','include','map','model','then','ShowVtigerAccount','find','where','moment','bluebird','randomstring','ioredis'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x257a28,_0x2cd00d){_0x257a28=_0x257a28-0x0;var _0x13bccc=_0xcb91[_0x257a28];return _0x13bccc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}exports[_0x1cb9('0x14')]=function(_0x23d3a9){var _0x4e1340=this;return new Promise(function(_0x479d43,_0x1b2fa6){return db[_0x1cb9('0x15')][_0x1cb9('0x16')]({'raw':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x18')]===undefined?!![]:![]:!![],'where':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['where']||null:null,'attributes':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options'][_0x1cb9('0x19')]||null:null,'limit':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9['options']['limit']||null:null,'include':_0x23d3a9[_0x1cb9('0x17')]?_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x23d3a9[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x59ebea){return{'model':db[_0x59ebea['model']],'as':_0x59ebea['as'],'attributes':_0x59ebea[_0x1cb9('0x19')],'include':_0x59ebea['include']?_[_0x1cb9('0x1b')](_0x59ebea[_0x1cb9('0x1a')],function(_0x69b4c8){return{'model':db[_0x69b4c8[_0x1cb9('0x1c')]],'as':_0x69b4c8['as'],'attributes':_0x69b4c8[_0x1cb9('0x19')],'include':_0x69b4c8['include']?_[_0x1cb9('0x1b')](_0x69b4c8[_0x1cb9('0x1a')],function(_0x4c8d76){return{'model':db[_0x4c8d76[_0x1cb9('0x1c')]],'as':_0x4c8d76['as'],'attributes':_0x4c8d76[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x1804fd){logger[_0x1cb9('0xa')](_0x1cb9('0x14'),_0x23d3a9);logger[_0x1cb9('0xd')](_0x1cb9('0x14'),_0x23d3a9,JSON[_0x1cb9('0xf')](_0x1804fd));_0x479d43(_0x1804fd);})[_0x1cb9('0x13')](function(_0x48888d){logger[_0x1cb9('0x10')]('GetVtigerAccount',_0x48888d[_0x1cb9('0x12')],_0x23d3a9);_0x1b2fa6(_0x4e1340['error'](0x1f4,_0x48888d[_0x1cb9('0x12')]));});});};exports[_0x1cb9('0x1e')]=function(_0x3cd7f5){var _0x2038aa=this;return new Promise(function(_0x561d89,_0x1c701f){return db['VtigerAccount'][_0x1cb9('0x1f')]({'raw':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5['options'][_0x1cb9('0x20')]||null:null,'attributes':_0x3cd7f5['options']?_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x19')]||null:null,'include':_0x3cd7f5[_0x1cb9('0x17')]?_0x3cd7f5[_0x1cb9('0x17')]['include']?_[_0x1cb9('0x1b')](_0x3cd7f5[_0x1cb9('0x17')][_0x1cb9('0x1a')],function(_0x91a1db){return{'model':db[_0x91a1db[_0x1cb9('0x1c')]],'as':_0x91a1db['as'],'attributes':_0x91a1db[_0x1cb9('0x19')],'include':_0x91a1db[_0x1cb9('0x1a')]?_[_0x1cb9('0x1b')](_0x91a1db[_0x1cb9('0x1a')],function(_0x1de287){return{'model':db[_0x1de287[_0x1cb9('0x1c')]],'as':_0x1de287['as'],'attributes':_0x1de287[_0x1cb9('0x19')],'include':_0x1de287[_0x1cb9('0x1a')]?_['map'](_0x1de287['include'],function(_0x299ff8){return{'model':db[_0x299ff8[_0x1cb9('0x1c')]],'as':_0x299ff8['as'],'attributes':_0x299ff8[_0x1cb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x1cb9('0x1d')](function(_0x385daa){logger[_0x1cb9('0xa')](_0x1cb9('0x1e'),_0x3cd7f5);logger[_0x1cb9('0xd')]('ShowVtigerAccount',_0x3cd7f5,JSON[_0x1cb9('0xf')](_0x385daa));_0x561d89(_0x385daa);})[_0x1cb9('0x13')](function(_0xefe136){logger['error'](_0x1cb9('0x1e'),_0xefe136['message'],_0x3cd7f5);_0x1c701f(_0x2038aa[_0x1cb9('0x10')](0x1f4,_0xefe136['message']));});});};
\ No newline at end of file
+var _0x4e81=['find','raw','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','map','include','model','attributes','ShowVtigerAccount'];(function(_0x1cc098,_0x3b1209){var _0x1e51a9=function(_0x389fa8){while(--_0x389fa8){_0x1cc098['push'](_0x1cc098['shift']());}};_0x1e51a9(++_0x3b1209);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x4e81[_0x2ac71a];return _0x3ee904;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var moment=require(_0x14e8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x14e8('0x3'))['db'];var utils=require(_0x14e8('0x4'));var logger=require(_0x14e8('0x5'))(_0x14e8('0x6'));var config=require(_0x14e8('0x7'));var jayson=require(_0x14e8('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e73d2,_0x449fa3,_0x21f860){return new BPromise(function(_0x3c1b93,_0x11ec3b){return client[_0x14e8('0x9')](_0x3e73d2,_0x21f860)[_0x14e8('0xa')](function(_0x1d8402){logger[_0x14e8('0xb')]('VtigerAccount,\x20%s,\x20%s',_0x449fa3,_0x14e8('0xc'));logger[_0x14e8('0xd')](_0x14e8('0xe'),_0x449fa3,_0x14e8('0xc'),JSON[_0x14e8('0xf')](_0x1d8402));if(_0x1d8402[_0x14e8('0x10')]){if(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x11')]===0x1f4){logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x11ec3b(_0x1d8402[_0x14e8('0x10')][_0x14e8('0x13')]);}logger['error'](_0x14e8('0x12'),_0x449fa3,_0x1d8402['error'][_0x14e8('0x13')]);return _0x3c1b93(_0x1d8402['error'][_0x14e8('0x13')]);}else{logger[_0x14e8('0xb')](_0x14e8('0x12'),_0x449fa3,_0x14e8('0xc'));_0x3c1b93(_0x1d8402['result'][_0x14e8('0x13')]);}})[_0x14e8('0x14')](function(_0x30581){logger[_0x14e8('0x10')](_0x14e8('0x12'),_0x449fa3,_0x30581);_0x11ec3b(_0x30581);});});}exports[_0x14e8('0x15')]=function(_0x10dc8b){var _0x462259=this;return new Promise(function(_0x5a38c1,_0x328c5a){return db[_0x14e8('0x16')][_0x14e8('0x17')]({'raw':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0x10dc8b['options']?_0x10dc8b[_0x14e8('0x18')]['attributes']||null:null,'limit':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')][_0x14e8('0x1a')]||null:null,'include':_0x10dc8b[_0x14e8('0x18')]?_0x10dc8b[_0x14e8('0x18')]['include']?_[_0x14e8('0x1b')](_0x10dc8b['options'][_0x14e8('0x1c')],function(_0x185a0e){return{'model':db[_0x185a0e['model']],'as':_0x185a0e['as'],'attributes':_0x185a0e['attributes'],'include':_0x185a0e['include']?_[_0x14e8('0x1b')](_0x185a0e[_0x14e8('0x1c')],function(_0x3eae0b){return{'model':db[_0x3eae0b[_0x14e8('0x1d')]],'as':_0x3eae0b['as'],'attributes':_0x3eae0b[_0x14e8('0x1e')],'include':_0x3eae0b['include']?_[_0x14e8('0x1b')](_0x3eae0b[_0x14e8('0x1c')],function(_0x3c09cb){return{'model':db[_0x3c09cb[_0x14e8('0x1d')]],'as':_0x3c09cb['as'],'attributes':_0x3c09cb[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2813ae){logger['info'](_0x14e8('0x15'),_0x10dc8b);logger[_0x14e8('0xd')](_0x14e8('0x15'),_0x10dc8b,JSON['stringify'](_0x2813ae));_0x5a38c1(_0x2813ae);})['catch'](function(_0x5cacd7){logger[_0x14e8('0x10')](_0x14e8('0x15'),_0x5cacd7['message'],_0x10dc8b);_0x328c5a(_0x462259[_0x14e8('0x10')](0x1f4,_0x5cacd7[_0x14e8('0x13')]));});});};exports[_0x14e8('0x1f')]=function(_0xa83433){var _0x5c2635=this;return new Promise(function(_0x1f1259,_0x260d51){return db[_0x14e8('0x16')][_0x14e8('0x20')]({'raw':_0xa83433[_0x14e8('0x18')]?_0xa83433['options'][_0x14e8('0x21')]===undefined?!![]:![]:!![],'where':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x19')]||null:null,'attributes':_0xa83433['options']?_0xa83433[_0x14e8('0x18')]['attributes']||null:null,'include':_0xa83433[_0x14e8('0x18')]?_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xa83433[_0x14e8('0x18')][_0x14e8('0x1c')],function(_0xbe9eab){return{'model':db[_0xbe9eab[_0x14e8('0x1d')]],'as':_0xbe9eab['as'],'attributes':_0xbe9eab[_0x14e8('0x1e')],'include':_0xbe9eab[_0x14e8('0x1c')]?_[_0x14e8('0x1b')](_0xbe9eab[_0x14e8('0x1c')],function(_0x54e624){return{'model':db[_0x54e624['model']],'as':_0x54e624['as'],'attributes':_0x54e624['attributes'],'include':_0x54e624[_0x14e8('0x1c')]?_['map'](_0x54e624[_0x14e8('0x1c')],function(_0x5bdf42){return{'model':db[_0x5bdf42[_0x14e8('0x1d')]],'as':_0x5bdf42['as'],'attributes':_0x5bdf42[_0x14e8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x14e8('0xa')](function(_0x2fc030){logger['info'](_0x14e8('0x1f'),_0xa83433);logger['debug'](_0x14e8('0x1f'),_0xa83433,JSON[_0x14e8('0xf')](_0x2fc030));_0x1f1259(_0x2fc030);})[_0x14e8('0x14')](function(_0x1fda35){logger[_0x14e8('0x10')](_0x14e8('0x1f'),_0x1fda35['message'],_0xa83433);_0x260d51(_0x5c2635[_0x14e8('0x10')](0x1f4,_0x1fda35['message']));});});};
\ No newline at end of file
index 5da7698..9bfca8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19a8=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x19a8,0xef));var _0x819a=function(_0x401838,_0x5e81aa){_0x401838=_0x401838-0x0;var _0x4c0d90=_0x19a8[_0x401838];return _0x4c0d90;};'use strict';var multer=require(_0x819a('0x0'));var util=require('util');var path=require(_0x819a('0x1'));var timeout=require(_0x819a('0x2'));var express=require(_0x819a('0x3'));var router=express[_0x819a('0x4')]();var fs_extra=require(_0x819a('0x5'));var auth=require(_0x819a('0x6'));var interaction=require(_0x819a('0x7'));var config=require('../../config/environment');var controller=require(_0x819a('0x8'));router['get']('/',auth[_0x819a('0x9')](),controller['index']);router[_0x819a('0xa')](_0x819a('0xb'),auth[_0x819a('0x9')](),controller[_0x819a('0xc')]);router['get'](_0x819a('0xd'),auth['isAuthenticated'](),controller[_0x819a('0xe')]);router[_0x819a('0xa')]('/:id/subjects',auth[_0x819a('0x9')](),controller[_0x819a('0xf')]);router[_0x819a('0xa')]('/:id/descriptions',auth[_0x819a('0x9')](),controller[_0x819a('0x10')]);router[_0x819a('0x11')]('/',auth[_0x819a('0x9')](),controller['create']);router[_0x819a('0x12')](_0x819a('0xb'),auth[_0x819a('0x9')](),controller[_0x819a('0x13')]);router[_0x819a('0x14')](_0x819a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x819a('0x15')]=router;
\ No newline at end of file
+var _0x6625=['./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x6625,0x170));var _0x5662=function(_0x1db9a8,_0x35266e){_0x1db9a8=_0x1db9a8-0x0;var _0x2a4d6d=_0x6625[_0x1db9a8];return _0x2a4d6d;};'use strict';var multer=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var path=require(_0x5662('0x2'));var timeout=require(_0x5662('0x3'));var express=require(_0x5662('0x4'));var router=express[_0x5662('0x5')]();var fs_extra=require(_0x5662('0x6'));var auth=require(_0x5662('0x7'));var interaction=require(_0x5662('0x8'));var config=require(_0x5662('0x9'));var controller=require(_0x5662('0xa'));router['get']('/',auth[_0x5662('0xb')](),controller[_0x5662('0xc')]);router[_0x5662('0xd')](_0x5662('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5662('0xd')](_0x5662('0xf'),auth[_0x5662('0xb')](),controller[_0x5662('0x10')]);router[_0x5662('0xd')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x5662('0x11')]);router['get'](_0x5662('0x12'),auth['isAuthenticated'](),controller['getDescriptions']);router['post']('/',auth[_0x5662('0xb')](),controller[_0x5662('0x13')]);router['put'](_0x5662('0xe'),auth[_0x5662('0xb')](),controller['update']);router['delete'](_0x5662('0xe'),auth[_0x5662('0xb')](),controller['destroy']);module[_0x5662('0x14')]=router;
\ No newline at end of file
index d2337f8..6609a8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28d2=['exports','STRING','sequelize'];(function(_0x30a971,_0xb4773e){var _0x23a78b=function(_0xf068ec){while(--_0xf068ec){_0x30a971['push'](_0x30a971['shift']());}};_0x23a78b(++_0xb4773e);}(_0x28d2,0xf2));var _0x228d=function(_0x53dd2f,_0x51d4a2){_0x53dd2f=_0x53dd2f-0x0;var _0x40a320=_0x28d2[_0x53dd2f];return _0x40a320;};'use strict';var Sequelize=require(_0x228d('0x0'));module[_0x228d('0x1')]={'name':{'type':Sequelize[_0x228d('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8a84=['exports','sequelize'];(function(_0x4915ad,_0x1ce15e){var _0x34b9ff=function(_0xf89050){while(--_0xf89050){_0x4915ad['push'](_0x4915ad['shift']());}};_0x34b9ff(++_0x1ce15e);}(_0x8a84,0x191));var _0x48a8=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x8a84[_0x5a7d41];return _0x98d8fa;};'use strict';var Sequelize=require(_0x48a8('0x0'));module[_0x48a8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 18bdcfe..aa15833 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2765=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x2765,0x156));var _0x5276=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2765[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x5276('0x0'));var rimraf=require(_0x5276('0x1'));var zipdir=require(_0x5276('0x2'));var jsonpatch=require(_0x5276('0x3'));var rp=require(_0x5276('0x4'));var moment=require(_0x5276('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5276('0x6'));var util=require('util');var path=require(_0x5276('0x7'));var sox=require(_0x5276('0x8'));var csv=require('to-csv');var ejs=require(_0x5276('0x9'));var fs=require('fs');var fs_extra=require(_0x5276('0xa'));var _=require('lodash');var squel=require(_0x5276('0xb'));var crypto=require('crypto');var jsforce=require(_0x5276('0xc'));var deskjs=require(_0x5276('0xd'));var toCsv=require(_0x5276('0xe'));var querystring=require(_0x5276('0xf'));var Papa=require(_0x5276('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5276('0x11'));var as=require(_0x5276('0x12'));var hardwareService=require(_0x5276('0x13'));var logger=require(_0x5276('0x14'))('api');var utils=require(_0x5276('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5276('0x16'));var db=require(_0x5276('0x17'))['db'];function respondWithStatusCode(_0x193567,_0x1eee1f){_0x1eee1f=_0x1eee1f||0xcc;return function(_0x200ff8){if(_0x200ff8){return _0x193567[_0x5276('0x18')](_0x1eee1f);}return _0x193567[_0x5276('0x19')](_0x1eee1f)[_0x5276('0x1a')]();};}function respondWithResult(_0x1a44c3,_0x48d88e){_0x48d88e=_0x48d88e||0xc8;return function(_0x55025d){if(_0x55025d){return _0x1a44c3[_0x5276('0x19')](_0x48d88e)[_0x5276('0x1b')](_0x55025d);}};}function respondWithFilteredResult(_0x19ec79,_0x4a883f){return function(_0x16c8ea){if(_0x16c8ea){var _0x3ead62=typeof _0x4a883f[_0x5276('0x1c')]===_0x5276('0x1d')&&typeof _0x4a883f[_0x5276('0x1e')]==='undefined';var _0x3ab4e2=_0x16c8ea['count'];var _0x4f6dec=_0x3ead62?0x0:_0x4a883f[_0x5276('0x1c')];var _0x13e887=_0x3ead62?_0x16c8ea[_0x5276('0x1f')]:_0x4a883f[_0x5276('0x1c')]+_0x4a883f[_0x5276('0x1e')];var _0xdfafcc;if(_0x13e887>=_0x3ab4e2){_0x13e887=_0x3ab4e2;_0xdfafcc=0xc8;}else{_0xdfafcc=0xce;}_0x19ec79[_0x5276('0x19')](_0xdfafcc);return _0x19ec79[_0x5276('0x20')]('Content-Range',_0x4f6dec+'-'+_0x13e887+'/'+_0x3ab4e2)['json'](_0x16c8ea);}return null;};}function patchUpdates(_0xda7ae9){return function(_0x5f474b){try{jsonpatch[_0x5276('0x21')](_0x5f474b,_0xda7ae9,!![]);}catch(_0x4256aa){return BPromise[_0x5276('0x22')](_0x4256aa);}return _0x5f474b['save']();};}function saveUpdates(_0xcf63a4,_0x50555e){return function(_0x24d995){if(_0x24d995){return _0x24d995[_0x5276('0x23')](_0xcf63a4)[_0x5276('0x24')](function(_0x4f2127){return _0x4f2127;});}return null;};}function removeEntity(_0x2c6cb3,_0x247d75){return function(_0x5a22a3){if(_0x5a22a3){return _0x5a22a3['destroy']()[_0x5276('0x24')](function(){_0x2c6cb3[_0x5276('0x19')](0xcc)[_0x5276('0x1a')]();});}};}function handleEntityNotFound(_0x48f399,_0x4e7401){return function(_0x24446d){if(!_0x24446d){_0x48f399[_0x5276('0x18')](0x194);}return _0x24446d;};}function handleError(_0x2923b9,_0x2a2970){_0x2a2970=_0x2a2970||0x1f4;return function(_0x333e76){logger[_0x5276('0x25')](_0x333e76[_0x5276('0x26')]);if(_0x333e76['name']){delete _0x333e76['name'];}_0x2923b9[_0x5276('0x19')](_0x2a2970)['send'](_0x333e76);};}exports[_0x5276('0x27')]=function(_0x2aaf90,_0x3f5b0c){var _0xcfa70d={},_0x13ecd0={},_0x2dfe35={'count':0x0,'rows':[]};var _0xa265b8=_[_0x5276('0x28')](db[_0x5276('0x29')][_0x5276('0x2a')],function(_0x48ee43){return{'name':_0x48ee43[_0x5276('0x2b')],'type':_0x48ee43[_0x5276('0x2c')][_0x5276('0x2d')]};});_0x13ecd0[_0x5276('0x2e')]=_['map'](_0xa265b8,_0x5276('0x2f'));_0x13ecd0[_0x5276('0x30')]=_[_0x5276('0x31')](_0x2aaf90[_0x5276('0x30')]);_0x13ecd0['filters']=_['intersection'](_0x13ecd0[_0x5276('0x2e')],_0x13ecd0['query']);_0xcfa70d['attributes']=_[_0x5276('0x32')](_0x13ecd0[_0x5276('0x2e')],qs[_0x5276('0x33')](_0x2aaf90['query'][_0x5276('0x33')]));_0xcfa70d['attributes']=_0xcfa70d[_0x5276('0x34')][_0x5276('0x35')]?_0xcfa70d[_0x5276('0x34')]:_0x13ecd0[_0x5276('0x2e')];if(!_0x2aaf90[_0x5276('0x30')][_0x5276('0x36')](_0x5276('0x37'))){_0xcfa70d[_0x5276('0x1e')]=qs[_0x5276('0x1e')](_0x2aaf90[_0x5276('0x30')][_0x5276('0x1e')]);_0xcfa70d[_0x5276('0x1c')]=qs['offset'](_0x2aaf90[_0x5276('0x30')][_0x5276('0x1c')]);}_0xcfa70d[_0x5276('0x38')]=qs[_0x5276('0x39')](_0x2aaf90[_0x5276('0x30')]['sort']);_0xcfa70d[_0x5276('0x3a')]=qs[_0x5276('0x3b')](_[_0x5276('0x3c')](_0x2aaf90['query'],_0x13ecd0[_0x5276('0x3b')]),_0xa265b8);if(_0x2aaf90[_0x5276('0x30')][_0x5276('0x3d')]){_0xcfa70d['where']=_[_0x5276('0x3e')](_0xcfa70d[_0x5276('0x3a')],{'$or':_[_0x5276('0x28')](_0xa265b8,function(_0x473e73){if(_0x473e73[_0x5276('0x2c')]!==_0x5276('0x3f')){var _0x51043d={};_0x51043d[_0x473e73['name']]={'$like':'%'+_0x2aaf90[_0x5276('0x30')][_0x5276('0x3d')]+'%'};return _0x51043d;}})});}_0xcfa70d=_[_0x5276('0x3e')]({},_0xcfa70d,_0x2aaf90[_0x5276('0x40')]);var _0x3d06df={'where':_0xcfa70d[_0x5276('0x3a')]};return db['VtigerConfiguration'][_0x5276('0x1f')](_0x3d06df)[_0x5276('0x24')](function(_0x2c03b2){_0x2dfe35['count']=_0x2c03b2;if(_0x2aaf90[_0x5276('0x30')][_0x5276('0x41')]){_0xcfa70d[_0x5276('0x42')]=[{'all':!![]}];}return db[_0x5276('0x29')][_0x5276('0x43')](_0xcfa70d);})['then'](function(_0x53535a){_0x2dfe35[_0x5276('0x44')]=_0x53535a;return _0x2dfe35;})[_0x5276('0x24')](respondWithFilteredResult(_0x3f5b0c,_0xcfa70d))[_0x5276('0x45')](handleError(_0x3f5b0c,null));};exports[_0x5276('0x46')]=function(_0x122a9d,_0x3ffca8){var _0x3cda75={'raw':![],'where':{'id':_0x122a9d[_0x5276('0x47')]['id']}},_0x4cb8e9={};_0x4cb8e9[_0x5276('0x2e')]=_[_0x5276('0x31')](db['VtigerConfiguration'][_0x5276('0x2a')]);_0x4cb8e9[_0x5276('0x30')]=_[_0x5276('0x31')](_0x122a9d[_0x5276('0x30')]);_0x4cb8e9[_0x5276('0x3b')]=_[_0x5276('0x32')](_0x4cb8e9[_0x5276('0x2e')],_0x4cb8e9['query']);_0x3cda75[_0x5276('0x34')]=_[_0x5276('0x32')](_0x4cb8e9[_0x5276('0x2e')],qs[_0x5276('0x33')](_0x122a9d[_0x5276('0x30')][_0x5276('0x33')]));_0x3cda75['attributes']=_0x3cda75[_0x5276('0x34')][_0x5276('0x35')]?_0x3cda75[_0x5276('0x34')]:_0x4cb8e9['model'];if(_0x122a9d[_0x5276('0x30')][_0x5276('0x41')]){_0x3cda75[_0x5276('0x42')]=[{'all':!![]}];}_0x3cda75=_[_0x5276('0x3e')]({},_0x3cda75,_0x122a9d[_0x5276('0x40')]);return db[_0x5276('0x29')][_0x5276('0x48')](_0x3cda75)[_0x5276('0x24')](handleEntityNotFound(_0x3ffca8,null))[_0x5276('0x24')](respondWithResult(_0x3ffca8,null))[_0x5276('0x45')](handleError(_0x3ffca8,null));};exports[_0x5276('0x49')]=function(_0x84ad,_0xc579f6){return db[_0x5276('0x29')][_0x5276('0x49')](_0x84ad['body'],{})['then'](respondWithResult(_0xc579f6,0xc9))['catch'](handleError(_0xc579f6,null));};exports[_0x5276('0x23')]=function(_0xd45a9d,_0x53ec55){if(_0xd45a9d[_0x5276('0x4a')]['id']){delete _0xd45a9d[_0x5276('0x4a')]['id'];}return db[_0x5276('0x29')][_0x5276('0x48')]({'where':{'id':_0xd45a9d[_0x5276('0x47')]['id']}})[_0x5276('0x24')](handleEntityNotFound(_0x53ec55,null))[_0x5276('0x24')](saveUpdates(_0xd45a9d['body'],null))[_0x5276('0x24')](respondWithResult(_0x53ec55,null))[_0x5276('0x45')](handleError(_0x53ec55,null));};exports['destroy']=function(_0x59170d,_0x44cc44){return db[_0x5276('0x29')][_0x5276('0x48')]({'where':{'id':_0x59170d[_0x5276('0x47')]['id']}})[_0x5276('0x24')](handleEntityNotFound(_0x44cc44,null))[_0x5276('0x24')](removeEntity(_0x44cc44,null))[_0x5276('0x45')](handleError(_0x44cc44,null));};exports[_0x5276('0x4b')]=function(_0x514bde,_0x683f77,_0x6c8d93){var _0x47e3c0={};var _0x41c1dd={};var _0xe18a55;var _0x35ef3a;return db[_0x5276('0x29')][_0x5276('0x4c')]({'where':{'id':_0x514bde['params']['id']}})[_0x5276('0x24')](handleEntityNotFound(_0x683f77,null))[_0x5276('0x24')](function(_0x141080){if(_0x141080){_0xe18a55=_0x141080;_0x41c1dd['model']=_[_0x5276('0x31')](db[_0x5276('0x4d')][_0x5276('0x2a')]);_0x41c1dd[_0x5276('0x30')]=_[_0x5276('0x31')](_0x514bde[_0x5276('0x30')]);_0x41c1dd[_0x5276('0x3b')]=_[_0x5276('0x32')](_0x41c1dd[_0x5276('0x2e')],_0x41c1dd[_0x5276('0x30')]);_0x47e3c0[_0x5276('0x34')]=_[_0x5276('0x32')](_0x41c1dd[_0x5276('0x2e')],qs[_0x5276('0x33')](_0x514bde['query'][_0x5276('0x33')]));_0x47e3c0[_0x5276('0x34')]=_0x47e3c0[_0x5276('0x34')][_0x5276('0x35')]?_0x47e3c0['attributes']:_0x41c1dd[_0x5276('0x2e')];_0x47e3c0[_0x5276('0x38')]=qs[_0x5276('0x39')](_0x514bde['query']['sort']);_0x47e3c0[_0x5276('0x3a')]=qs['filters'](_[_0x5276('0x3c')](_0x514bde['query'],_0x41c1dd[_0x5276('0x3b')]));if(_0x514bde[_0x5276('0x30')][_0x5276('0x3d')]){_0x47e3c0[_0x5276('0x3a')]=_[_0x5276('0x3e')](_0x47e3c0[_0x5276('0x3a')],{'$or':_[_0x5276('0x28')](_0x47e3c0[_0x5276('0x34')],function(_0x28c311){var _0x22aa77={};_0x22aa77[_0x28c311]={'$like':'%'+_0x514bde[_0x5276('0x30')]['filter']+'%'};return _0x22aa77;})});}_0x47e3c0=_[_0x5276('0x3e')]({},_0x47e3c0,_0x514bde[_0x5276('0x40')]);return _0xe18a55[_0x5276('0x4b')](_0x47e3c0);}})[_0x5276('0x24')](function(_0x47f7b2){if(_0x47f7b2){_0x35ef3a=_0x47f7b2[_0x5276('0x35')];if(!_0x514bde[_0x5276('0x30')]['hasOwnProperty'](_0x5276('0x37'))){_0x47e3c0[_0x5276('0x1e')]=qs[_0x5276('0x1e')](_0x514bde[_0x5276('0x30')][_0x5276('0x1e')]);_0x47e3c0['offset']=qs[_0x5276('0x1c')](_0x514bde['query']['offset']);}return _0xe18a55[_0x5276('0x4b')](_0x47e3c0);}})['then'](function(_0x388f88){if(_0x388f88){return _0x388f88?{'count':_0x35ef3a,'rows':_0x388f88}:null;}})[_0x5276('0x24')](respondWithResult(_0x683f77,null))[_0x5276('0x45')](handleError(_0x683f77,null));};exports[_0x5276('0x4e')]=function(_0x325212,_0x4da9f3,_0x1ca52c){var _0x214b75={};var _0xa83a7c={};var _0x9b5c3b;var _0x305c51;return db[_0x5276('0x29')]['findOne']({'where':{'id':_0x325212[_0x5276('0x47')]['id']}})['then'](handleEntityNotFound(_0x4da9f3,null))['then'](function(_0x4bbd6d){if(_0x4bbd6d){_0x9b5c3b=_0x4bbd6d;_0xa83a7c[_0x5276('0x2e')]=_[_0x5276('0x31')](db['VtigerField']['rawAttributes']);_0xa83a7c[_0x5276('0x30')]=_[_0x5276('0x31')](_0x325212[_0x5276('0x30')]);_0xa83a7c[_0x5276('0x3b')]=_['intersection'](_0xa83a7c['model'],_0xa83a7c['query']);_0x214b75[_0x5276('0x34')]=_[_0x5276('0x32')](_0xa83a7c[_0x5276('0x2e')],qs['fields'](_0x325212['query'][_0x5276('0x33')]));_0x214b75[_0x5276('0x34')]=_0x214b75[_0x5276('0x34')]['length']?_0x214b75[_0x5276('0x34')]:_0xa83a7c['model'];_0x214b75[_0x5276('0x38')]=qs[_0x5276('0x39')](_0x325212[_0x5276('0x30')]['sort']);_0x214b75['where']=qs['filters'](_[_0x5276('0x3c')](_0x325212['query'],_0xa83a7c[_0x5276('0x3b')]));if(_0x325212['query'][_0x5276('0x3d')]){_0x214b75[_0x5276('0x3a')]=_[_0x5276('0x3e')](_0x214b75[_0x5276('0x3a')],{'$or':_[_0x5276('0x28')](_0x214b75[_0x5276('0x34')],function(_0x5969bd){var _0x4d9607={};_0x4d9607[_0x5969bd]={'$like':'%'+_0x325212[_0x5276('0x30')]['filter']+'%'};return _0x4d9607;})});}_0x214b75=_['merge']({},_0x214b75,_0x325212[_0x5276('0x40')]);return _0x9b5c3b['getSubjects'](_0x214b75);}})[_0x5276('0x24')](function(_0x387d5c){if(_0x387d5c){_0x305c51=_0x387d5c[_0x5276('0x35')];if(!_0x325212[_0x5276('0x30')]['hasOwnProperty'](_0x5276('0x37'))){_0x214b75[_0x5276('0x1e')]=qs[_0x5276('0x1e')](_0x325212[_0x5276('0x30')][_0x5276('0x1e')]);_0x214b75[_0x5276('0x1c')]=qs[_0x5276('0x1c')](_0x325212[_0x5276('0x30')][_0x5276('0x1c')]);}return _0x9b5c3b['getSubjects'](_0x214b75);}})[_0x5276('0x24')](function(_0x522828){if(_0x522828){return _0x522828?{'count':_0x305c51,'rows':_0x522828}:null;}})[_0x5276('0x24')](respondWithResult(_0x4da9f3,null))['catch'](handleError(_0x4da9f3,null));};exports[_0x5276('0x4f')]=function(_0x57f9c9,_0xbd8c76,_0x22c82c){var _0xb615bb={};var _0x1dd336={};var _0xba1918;var _0x29dce4;return db['VtigerConfiguration'][_0x5276('0x4c')]({'where':{'id':_0x57f9c9[_0x5276('0x47')]['id']}})[_0x5276('0x24')](handleEntityNotFound(_0xbd8c76,null))[_0x5276('0x24')](function(_0x57f533){if(_0x57f533){_0xba1918=_0x57f533;_0x1dd336[_0x5276('0x2e')]=_[_0x5276('0x31')](db[_0x5276('0x4d')][_0x5276('0x2a')]);_0x1dd336['query']=_[_0x5276('0x31')](_0x57f9c9[_0x5276('0x30')]);_0x1dd336['filters']=_['intersection'](_0x1dd336[_0x5276('0x2e')],_0x1dd336['query']);_0xb615bb['attributes']=_[_0x5276('0x32')](_0x1dd336[_0x5276('0x2e')],qs[_0x5276('0x33')](_0x57f9c9[_0x5276('0x30')][_0x5276('0x33')]));_0xb615bb[_0x5276('0x34')]=_0xb615bb[_0x5276('0x34')][_0x5276('0x35')]?_0xb615bb[_0x5276('0x34')]:_0x1dd336[_0x5276('0x2e')];_0xb615bb[_0x5276('0x38')]=qs['sort'](_0x57f9c9['query'][_0x5276('0x39')]);_0xb615bb[_0x5276('0x3a')]=qs['filters'](_['pick'](_0x57f9c9[_0x5276('0x30')],_0x1dd336['filters']));if(_0x57f9c9['query'][_0x5276('0x3d')]){_0xb615bb['where']=_[_0x5276('0x3e')](_0xb615bb[_0x5276('0x3a')],{'$or':_[_0x5276('0x28')](_0xb615bb['attributes'],function(_0x2c4615){var _0x29c323={};_0x29c323[_0x2c4615]={'$like':'%'+_0x57f9c9[_0x5276('0x30')][_0x5276('0x3d')]+'%'};return _0x29c323;})});}_0xb615bb=_['merge']({},_0xb615bb,_0x57f9c9[_0x5276('0x40')]);return _0xba1918[_0x5276('0x4f')](_0xb615bb);}})['then'](function(_0x3f6936){if(_0x3f6936){_0x29dce4=_0x3f6936['length'];if(!_0x57f9c9[_0x5276('0x30')][_0x5276('0x36')](_0x5276('0x37'))){_0xb615bb[_0x5276('0x1e')]=qs[_0x5276('0x1e')](_0x57f9c9[_0x5276('0x30')]['limit']);_0xb615bb['offset']=qs['offset'](_0x57f9c9[_0x5276('0x30')][_0x5276('0x1c')]);}return _0xba1918[_0x5276('0x4f')](_0xb615bb);}})[_0x5276('0x24')](function(_0x1a0781){if(_0x1a0781){return _0x1a0781?{'count':_0x29dce4,'rows':_0x1a0781}:null;}})['then'](respondWithResult(_0xbd8c76,null))[_0x5276('0x45')](handleError(_0xbd8c76,null));};
\ No newline at end of file
+var _0xf9b6=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','destroy','getFields','findOne','getSubjects','VtigerField','nolimit','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','VtigerConfiguration','fieldName','type','key'];(function(_0x360739,_0x2ec1b2){var _0x3e23a1=function(_0x105b37){while(--_0x105b37){_0x360739['push'](_0x360739['shift']());}};_0x3e23a1(++_0x2ec1b2);}(_0xf9b6,0x114));var _0x6f9b=function(_0x2d55a1,_0x30cb10){_0x2d55a1=_0x2d55a1-0x0;var _0x39ed86=_0xf9b6[_0x2d55a1];return _0x39ed86;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6f9b('0x0'));var zipdir=require(_0x6f9b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f9b('0x2'));var moment=require('moment');var BPromise=require(_0x6f9b('0x3'));var Mustache=require(_0x6f9b('0x4'));var util=require(_0x6f9b('0x5'));var path=require(_0x6f9b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6f9b('0x7'));var crypto=require('crypto');var jsforce=require(_0x6f9b('0x8'));var deskjs=require(_0x6f9b('0x9'));var toCsv=require(_0x6f9b('0xa'));var querystring=require(_0x6f9b('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6f9b('0xc'));var qs=require(_0x6f9b('0xd'));var as=require(_0x6f9b('0xe'));var hardwareService=require(_0x6f9b('0xf'));var logger=require('../../config/logger')(_0x6f9b('0x10'));var utils=require(_0x6f9b('0x11'));var config=require(_0x6f9b('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x6f9b('0x13'))['db'];function respondWithStatusCode(_0xcd6c08,_0x2966cd){_0x2966cd=_0x2966cd||0xcc;return function(_0x15274c){if(_0x15274c){return _0xcd6c08[_0x6f9b('0x14')](_0x2966cd);}return _0xcd6c08['status'](_0x2966cd)[_0x6f9b('0x15')]();};}function respondWithResult(_0x1abaa2,_0x37848d){_0x37848d=_0x37848d||0xc8;return function(_0x22318d){if(_0x22318d){return _0x1abaa2['status'](_0x37848d)[_0x6f9b('0x16')](_0x22318d);}};}function respondWithFilteredResult(_0x2db6b9,_0x3c5889){return function(_0x3ee1dd){if(_0x3ee1dd){var _0x2692cd=typeof _0x3c5889[_0x6f9b('0x17')]===_0x6f9b('0x18')&&typeof _0x3c5889[_0x6f9b('0x19')]==='undefined';var _0x208fa0=_0x3ee1dd['count'];var _0x1f5369=_0x2692cd?0x0:_0x3c5889[_0x6f9b('0x17')];var _0x26bf2d=_0x2692cd?_0x3ee1dd[_0x6f9b('0x1a')]:_0x3c5889[_0x6f9b('0x17')]+_0x3c5889['limit'];var _0x564a89;if(_0x26bf2d>=_0x208fa0){_0x26bf2d=_0x208fa0;_0x564a89=0xc8;}else{_0x564a89=0xce;}_0x2db6b9[_0x6f9b('0x1b')](_0x564a89);return _0x2db6b9[_0x6f9b('0x1c')](_0x6f9b('0x1d'),_0x1f5369+'-'+_0x26bf2d+'/'+_0x208fa0)[_0x6f9b('0x16')](_0x3ee1dd);}return null;};}function patchUpdates(_0x323807){return function(_0x2d39b9){try{jsonpatch[_0x6f9b('0x1e')](_0x2d39b9,_0x323807,!![]);}catch(_0x55e80c){return BPromise[_0x6f9b('0x1f')](_0x55e80c);}return _0x2d39b9[_0x6f9b('0x20')]();};}function saveUpdates(_0x5cf08c,_0x14dd07){return function(_0x5829f3){if(_0x5829f3){return _0x5829f3['update'](_0x5cf08c)[_0x6f9b('0x21')](function(_0x1020cb){return _0x1020cb;});}return null;};}function removeEntity(_0x5cd2e9,_0x38f31d){return function(_0x53c051){if(_0x53c051){return _0x53c051['destroy']()[_0x6f9b('0x21')](function(){_0x5cd2e9['status'](0xcc)[_0x6f9b('0x15')]();});}};}function handleEntityNotFound(_0x1ca142,_0x406bca){return function(_0x308a35){if(!_0x308a35){_0x1ca142[_0x6f9b('0x14')](0x194);}return _0x308a35;};}function handleError(_0x42862b,_0x162cb7){_0x162cb7=_0x162cb7||0x1f4;return function(_0xaa7aeb){logger[_0x6f9b('0x22')](_0xaa7aeb[_0x6f9b('0x23')]);if(_0xaa7aeb[_0x6f9b('0x24')]){delete _0xaa7aeb['name'];}_0x42862b[_0x6f9b('0x1b')](_0x162cb7)[_0x6f9b('0x25')](_0xaa7aeb);};}exports[_0x6f9b('0x26')]=function(_0x51b667,_0x49e49b){var _0x12dc51={},_0x335985={},_0x22ddfc={'count':0x0,'rows':[]};var _0x49c1fb=_[_0x6f9b('0x27')](db[_0x6f9b('0x28')]['rawAttributes'],function(_0x49655e){return{'name':_0x49655e[_0x6f9b('0x29')],'type':_0x49655e[_0x6f9b('0x2a')][_0x6f9b('0x2b')]};});_0x335985['model']=_[_0x6f9b('0x27')](_0x49c1fb,_0x6f9b('0x24'));_0x335985[_0x6f9b('0x2c')]=_[_0x6f9b('0x2d')](_0x51b667[_0x6f9b('0x2c')]);_0x335985[_0x6f9b('0x2e')]=_[_0x6f9b('0x2f')](_0x335985[_0x6f9b('0x30')],_0x335985[_0x6f9b('0x2c')]);_0x12dc51[_0x6f9b('0x31')]=_['intersection'](_0x335985[_0x6f9b('0x30')],qs[_0x6f9b('0x32')](_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x32')]));_0x12dc51['attributes']=_0x12dc51[_0x6f9b('0x31')][_0x6f9b('0x33')]?_0x12dc51['attributes']:_0x335985['model'];if(!_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x34')]('nolimit')){_0x12dc51[_0x6f9b('0x19')]=qs[_0x6f9b('0x19')](_0x51b667[_0x6f9b('0x2c')]['limit']);_0x12dc51[_0x6f9b('0x17')]=qs['offset'](_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x17')]);}_0x12dc51[_0x6f9b('0x35')]=qs[_0x6f9b('0x36')](_0x51b667['query'][_0x6f9b('0x36')]);_0x12dc51[_0x6f9b('0x37')]=qs['filters'](_[_0x6f9b('0x38')](_0x51b667[_0x6f9b('0x2c')],_0x335985[_0x6f9b('0x2e')]),_0x49c1fb);if(_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x39')]){_0x12dc51['where']=_['merge'](_0x12dc51['where'],{'$or':_['map'](_0x49c1fb,function(_0x129843){if(_0x129843[_0x6f9b('0x2a')]!==_0x6f9b('0x3a')){var _0x67a793={};_0x67a793[_0x129843[_0x6f9b('0x24')]]={'$like':'%'+_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x39')]+'%'};return _0x67a793;}})});}_0x12dc51=_[_0x6f9b('0x3b')]({},_0x12dc51,_0x51b667[_0x6f9b('0x3c')]);var _0x9fad01={'where':_0x12dc51[_0x6f9b('0x37')]};return db[_0x6f9b('0x28')][_0x6f9b('0x1a')](_0x9fad01)[_0x6f9b('0x21')](function(_0x413d66){_0x22ddfc[_0x6f9b('0x1a')]=_0x413d66;if(_0x51b667[_0x6f9b('0x2c')][_0x6f9b('0x3d')]){_0x12dc51[_0x6f9b('0x3e')]=[{'all':!![]}];}return db[_0x6f9b('0x28')][_0x6f9b('0x3f')](_0x12dc51);})['then'](function(_0x5d448f){_0x22ddfc[_0x6f9b('0x40')]=_0x5d448f;return _0x22ddfc;})['then'](respondWithFilteredResult(_0x49e49b,_0x12dc51))[_0x6f9b('0x41')](handleError(_0x49e49b,null));};exports[_0x6f9b('0x42')]=function(_0x49cda3,_0x54da53){var _0x39ec9a={'raw':![],'where':{'id':_0x49cda3[_0x6f9b('0x43')]['id']}},_0x29c739={};_0x29c739[_0x6f9b('0x30')]=_['keys'](db['VtigerConfiguration'][_0x6f9b('0x44')]);_0x29c739[_0x6f9b('0x2c')]=_[_0x6f9b('0x2d')](_0x49cda3[_0x6f9b('0x2c')]);_0x29c739[_0x6f9b('0x2e')]=_['intersection'](_0x29c739[_0x6f9b('0x30')],_0x29c739[_0x6f9b('0x2c')]);_0x39ec9a[_0x6f9b('0x31')]=_[_0x6f9b('0x2f')](_0x29c739['model'],qs['fields'](_0x49cda3[_0x6f9b('0x2c')][_0x6f9b('0x32')]));_0x39ec9a[_0x6f9b('0x31')]=_0x39ec9a[_0x6f9b('0x31')][_0x6f9b('0x33')]?_0x39ec9a[_0x6f9b('0x31')]:_0x29c739[_0x6f9b('0x30')];if(_0x49cda3[_0x6f9b('0x2c')]['includeAll']){_0x39ec9a[_0x6f9b('0x3e')]=[{'all':!![]}];}_0x39ec9a=_[_0x6f9b('0x3b')]({},_0x39ec9a,_0x49cda3[_0x6f9b('0x3c')]);return db[_0x6f9b('0x28')][_0x6f9b('0x45')](_0x39ec9a)[_0x6f9b('0x21')](handleEntityNotFound(_0x54da53,null))['then'](respondWithResult(_0x54da53,null))['catch'](handleError(_0x54da53,null));};exports[_0x6f9b('0x46')]=function(_0x25b4b2,_0x3efef8){return db['VtigerConfiguration'][_0x6f9b('0x46')](_0x25b4b2[_0x6f9b('0x47')],{})[_0x6f9b('0x21')](respondWithResult(_0x3efef8,0xc9))[_0x6f9b('0x41')](handleError(_0x3efef8,null));};exports[_0x6f9b('0x48')]=function(_0x5a6cf2,_0xa66ed3){if(_0x5a6cf2[_0x6f9b('0x47')]['id']){delete _0x5a6cf2[_0x6f9b('0x47')]['id'];}return db[_0x6f9b('0x28')]['find']({'where':{'id':_0x5a6cf2[_0x6f9b('0x43')]['id']}})[_0x6f9b('0x21')](handleEntityNotFound(_0xa66ed3,null))['then'](saveUpdates(_0x5a6cf2['body'],null))[_0x6f9b('0x21')](respondWithResult(_0xa66ed3,null))[_0x6f9b('0x41')](handleError(_0xa66ed3,null));};exports[_0x6f9b('0x49')]=function(_0x355500,_0x1f3c2b){return db[_0x6f9b('0x28')]['find']({'where':{'id':_0x355500[_0x6f9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f3c2b,null))[_0x6f9b('0x21')](removeEntity(_0x1f3c2b,null))[_0x6f9b('0x41')](handleError(_0x1f3c2b,null));};exports[_0x6f9b('0x4a')]=function(_0x38deb3,_0x488adb,_0xd2c945){var _0x5bcc42={};var _0xa6ee39={};var _0xcbf11b;var _0x3520be;return db['VtigerConfiguration'][_0x6f9b('0x4b')]({'where':{'id':_0x38deb3[_0x6f9b('0x43')]['id']}})[_0x6f9b('0x21')](handleEntityNotFound(_0x488adb,null))[_0x6f9b('0x21')](function(_0x2737b3){if(_0x2737b3){_0xcbf11b=_0x2737b3;_0xa6ee39['model']=_[_0x6f9b('0x2d')](db['VtigerField']['rawAttributes']);_0xa6ee39['query']=_[_0x6f9b('0x2d')](_0x38deb3[_0x6f9b('0x2c')]);_0xa6ee39[_0x6f9b('0x2e')]=_[_0x6f9b('0x2f')](_0xa6ee39[_0x6f9b('0x30')],_0xa6ee39[_0x6f9b('0x2c')]);_0x5bcc42[_0x6f9b('0x31')]=_['intersection'](_0xa6ee39[_0x6f9b('0x30')],qs[_0x6f9b('0x32')](_0x38deb3[_0x6f9b('0x2c')][_0x6f9b('0x32')]));_0x5bcc42['attributes']=_0x5bcc42[_0x6f9b('0x31')][_0x6f9b('0x33')]?_0x5bcc42[_0x6f9b('0x31')]:_0xa6ee39[_0x6f9b('0x30')];_0x5bcc42[_0x6f9b('0x35')]=qs[_0x6f9b('0x36')](_0x38deb3['query'][_0x6f9b('0x36')]);_0x5bcc42[_0x6f9b('0x37')]=qs[_0x6f9b('0x2e')](_[_0x6f9b('0x38')](_0x38deb3[_0x6f9b('0x2c')],_0xa6ee39[_0x6f9b('0x2e')]));if(_0x38deb3[_0x6f9b('0x2c')]['filter']){_0x5bcc42[_0x6f9b('0x37')]=_['merge'](_0x5bcc42['where'],{'$or':_[_0x6f9b('0x27')](_0x5bcc42[_0x6f9b('0x31')],function(_0x4621b8){var _0x17c5a7={};_0x17c5a7[_0x4621b8]={'$like':'%'+_0x38deb3[_0x6f9b('0x2c')][_0x6f9b('0x39')]+'%'};return _0x17c5a7;})});}_0x5bcc42=_[_0x6f9b('0x3b')]({},_0x5bcc42,_0x38deb3[_0x6f9b('0x3c')]);return _0xcbf11b['getFields'](_0x5bcc42);}})[_0x6f9b('0x21')](function(_0x17a715){if(_0x17a715){_0x3520be=_0x17a715[_0x6f9b('0x33')];if(!_0x38deb3[_0x6f9b('0x2c')]['hasOwnProperty']('nolimit')){_0x5bcc42[_0x6f9b('0x19')]=qs[_0x6f9b('0x19')](_0x38deb3[_0x6f9b('0x2c')][_0x6f9b('0x19')]);_0x5bcc42[_0x6f9b('0x17')]=qs[_0x6f9b('0x17')](_0x38deb3[_0x6f9b('0x2c')][_0x6f9b('0x17')]);}return _0xcbf11b[_0x6f9b('0x4a')](_0x5bcc42);}})[_0x6f9b('0x21')](function(_0x1e452f){if(_0x1e452f){return _0x1e452f?{'count':_0x3520be,'rows':_0x1e452f}:null;}})[_0x6f9b('0x21')](respondWithResult(_0x488adb,null))[_0x6f9b('0x41')](handleError(_0x488adb,null));};exports[_0x6f9b('0x4c')]=function(_0x2375c3,_0x507169,_0xb504ac){var _0xb5bff4={};var _0x1e674d={};var _0x574983;var _0x4c98fa;return db[_0x6f9b('0x28')]['findOne']({'where':{'id':_0x2375c3[_0x6f9b('0x43')]['id']}})['then'](handleEntityNotFound(_0x507169,null))[_0x6f9b('0x21')](function(_0x5374b6){if(_0x5374b6){_0x574983=_0x5374b6;_0x1e674d[_0x6f9b('0x30')]=_[_0x6f9b('0x2d')](db[_0x6f9b('0x4d')][_0x6f9b('0x44')]);_0x1e674d['query']=_[_0x6f9b('0x2d')](_0x2375c3[_0x6f9b('0x2c')]);_0x1e674d[_0x6f9b('0x2e')]=_[_0x6f9b('0x2f')](_0x1e674d['model'],_0x1e674d[_0x6f9b('0x2c')]);_0xb5bff4['attributes']=_['intersection'](_0x1e674d[_0x6f9b('0x30')],qs['fields'](_0x2375c3[_0x6f9b('0x2c')][_0x6f9b('0x32')]));_0xb5bff4[_0x6f9b('0x31')]=_0xb5bff4[_0x6f9b('0x31')][_0x6f9b('0x33')]?_0xb5bff4[_0x6f9b('0x31')]:_0x1e674d[_0x6f9b('0x30')];_0xb5bff4[_0x6f9b('0x35')]=qs[_0x6f9b('0x36')](_0x2375c3[_0x6f9b('0x2c')][_0x6f9b('0x36')]);_0xb5bff4[_0x6f9b('0x37')]=qs[_0x6f9b('0x2e')](_[_0x6f9b('0x38')](_0x2375c3['query'],_0x1e674d[_0x6f9b('0x2e')]));if(_0x2375c3[_0x6f9b('0x2c')][_0x6f9b('0x39')]){_0xb5bff4[_0x6f9b('0x37')]=_['merge'](_0xb5bff4[_0x6f9b('0x37')],{'$or':_[_0x6f9b('0x27')](_0xb5bff4[_0x6f9b('0x31')],function(_0x11f002){var _0x4576ad={};_0x4576ad[_0x11f002]={'$like':'%'+_0x2375c3[_0x6f9b('0x2c')]['filter']+'%'};return _0x4576ad;})});}_0xb5bff4=_[_0x6f9b('0x3b')]({},_0xb5bff4,_0x2375c3['options']);return _0x574983[_0x6f9b('0x4c')](_0xb5bff4);}})[_0x6f9b('0x21')](function(_0xddf836){if(_0xddf836){_0x4c98fa=_0xddf836[_0x6f9b('0x33')];if(!_0x2375c3[_0x6f9b('0x2c')][_0x6f9b('0x34')](_0x6f9b('0x4e'))){_0xb5bff4['limit']=qs[_0x6f9b('0x19')](_0x2375c3[_0x6f9b('0x2c')]['limit']);_0xb5bff4[_0x6f9b('0x17')]=qs[_0x6f9b('0x17')](_0x2375c3['query']['offset']);}return _0x574983[_0x6f9b('0x4c')](_0xb5bff4);}})['then'](function(_0x2d5afb){if(_0x2d5afb){return _0x2d5afb?{'count':_0x4c98fa,'rows':_0x2d5afb}:null;}})['then'](respondWithResult(_0x507169,null))['catch'](handleError(_0x507169,null));};exports[_0x6f9b('0x4f')]=function(_0x4ad4b0,_0x3a36fd,_0x1a0610){var _0x141847={};var _0x418d10={};var _0xafcc83;var _0x2baa46;return db[_0x6f9b('0x28')]['findOne']({'where':{'id':_0x4ad4b0['params']['id']}})['then'](handleEntityNotFound(_0x3a36fd,null))[_0x6f9b('0x21')](function(_0x28e14a){if(_0x28e14a){_0xafcc83=_0x28e14a;_0x418d10['model']=_[_0x6f9b('0x2d')](db[_0x6f9b('0x4d')][_0x6f9b('0x44')]);_0x418d10[_0x6f9b('0x2c')]=_[_0x6f9b('0x2d')](_0x4ad4b0[_0x6f9b('0x2c')]);_0x418d10[_0x6f9b('0x2e')]=_[_0x6f9b('0x2f')](_0x418d10['model'],_0x418d10[_0x6f9b('0x2c')]);_0x141847[_0x6f9b('0x31')]=_[_0x6f9b('0x2f')](_0x418d10[_0x6f9b('0x30')],qs['fields'](_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x32')]));_0x141847[_0x6f9b('0x31')]=_0x141847[_0x6f9b('0x31')][_0x6f9b('0x33')]?_0x141847[_0x6f9b('0x31')]:_0x418d10[_0x6f9b('0x30')];_0x141847[_0x6f9b('0x35')]=qs['sort'](_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x36')]);_0x141847[_0x6f9b('0x37')]=qs[_0x6f9b('0x2e')](_[_0x6f9b('0x38')](_0x4ad4b0['query'],_0x418d10['filters']));if(_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x39')]){_0x141847[_0x6f9b('0x37')]=_[_0x6f9b('0x3b')](_0x141847[_0x6f9b('0x37')],{'$or':_['map'](_0x141847['attributes'],function(_0x55b1ac){var _0x2a136c={};_0x2a136c[_0x55b1ac]={'$like':'%'+_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x39')]+'%'};return _0x2a136c;})});}_0x141847=_[_0x6f9b('0x3b')]({},_0x141847,_0x4ad4b0[_0x6f9b('0x3c')]);return _0xafcc83['getDescriptions'](_0x141847);}})[_0x6f9b('0x21')](function(_0xe1ef38){if(_0xe1ef38){_0x2baa46=_0xe1ef38[_0x6f9b('0x33')];if(!_0x4ad4b0[_0x6f9b('0x2c')]['hasOwnProperty'](_0x6f9b('0x4e'))){_0x141847['limit']=qs[_0x6f9b('0x19')](_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x19')]);_0x141847[_0x6f9b('0x17')]=qs[_0x6f9b('0x17')](_0x4ad4b0[_0x6f9b('0x2c')][_0x6f9b('0x17')]);}return _0xafcc83[_0x6f9b('0x4f')](_0x141847);}})[_0x6f9b('0x21')](function(_0x49be85){if(_0x49be85){return _0x49be85?{'count':_0x2baa46,'rows':_0x49be85}:null;}})[_0x6f9b('0x21')](respondWithResult(_0x3a36fd,null))['catch'](handleError(_0x3a36fd,null));};
\ No newline at end of file
index 24689a5..7eb0e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9f1=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf9f1,0x162));var _0x1f9f=function(_0x3cfcb9,_0x5037dc){_0x3cfcb9=_0x3cfcb9-0x0;var _0x47a4da=_0xf9f1[_0x3cfcb9];return _0x47a4da;};'use strict';var _=require(_0x1f9f('0x0'));var util=require(_0x1f9f('0x1'));var logger=require(_0x1f9f('0x2'))(_0x1f9f('0x3'));var moment=require(_0x1f9f('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f9f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f9f('0x6'));var config=require(_0x1f9f('0x7'));var attributes=require(_0x1f9f('0x8'));module[_0x1f9f('0x9')]=function(_0x1b845e,_0x47df2c){return _0x1b845e['define'](_0x1f9f('0xa'),attributes,{'tableName':_0x1f9f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf470=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x415e21,_0x24e3ec){var _0x4ceb6e=function(_0x297312){while(--_0x297312){_0x415e21['push'](_0x415e21['shift']());}};_0x4ceb6e(++_0x24e3ec);}(_0xf470,0xdb));var _0x0f47=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xf470[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0x0f47('0x0'));var util=require(_0x0f47('0x1'));var logger=require(_0x0f47('0x2'))(_0x0f47('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0f47('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f47('0x5'));var config=require(_0x0f47('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0x0f47('0x7')]=function(_0x33f27c,_0x5ddd0c){return _0x33f27c[_0x0f47('0x8')](_0x0f47('0x9'),attributes,{'tableName':_0x0f47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc6e783..9d692eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68eb=['request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x68eb,0x167));var _0xb68e=function(_0x2ca616,_0x384ec8){_0x2ca616=_0x2ca616-0x0;var _0x53155f=_0x68eb[_0x2ca616];return _0x53155f;};'use strict';var _=require(_0xb68e('0x0'));var util=require(_0xb68e('0x1'));var moment=require(_0xb68e('0x2'));var BPromise=require(_0xb68e('0x3'));var rs=require(_0xb68e('0x4'));var fs=require('fs');var Redis=require(_0xb68e('0x5'));var db=require(_0xb68e('0x6'))['db'];var utils=require(_0xb68e('0x7'));var logger=require('../../config/logger')(_0xb68e('0x8'));var config=require(_0xb68e('0x9'));var jayson=require(_0xb68e('0xa'));var client=jayson[_0xb68e('0xb')][_0xb68e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2fe24a,_0x5969c2,_0x510e7c){return new BPromise(function(_0x38ab91,_0x16eaa7){return client['request'](_0x2fe24a,_0x510e7c)['then'](function(_0x3fa90f){logger[_0xb68e('0xd')](_0xb68e('0xe'),_0x5969c2,_0xb68e('0xf'));logger['debug'](_0xb68e('0x10'),_0x5969c2,_0xb68e('0xf'),JSON[_0xb68e('0x11')](_0x3fa90f));if(_0x3fa90f[_0xb68e('0x12')]){if(_0x3fa90f[_0xb68e('0x12')]['code']===0x1f4){logger[_0xb68e('0x12')](_0xb68e('0xe'),_0x5969c2,_0x3fa90f[_0xb68e('0x12')][_0xb68e('0x13')]);return _0x16eaa7(_0x3fa90f[_0xb68e('0x12')]['message']);}logger[_0xb68e('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x5969c2,_0x3fa90f['error']['message']);return _0x38ab91(_0x3fa90f[_0xb68e('0x12')][_0xb68e('0x13')]);}else{logger['info'](_0xb68e('0xe'),_0x5969c2,'request\x20sent');_0x38ab91(_0x3fa90f[_0xb68e('0x14')][_0xb68e('0x13')]);}})[_0xb68e('0x15')](function(_0x4ded4c){logger['error'](_0xb68e('0xe'),_0x5969c2,_0x4ded4c);_0x16eaa7(_0x4ded4c);});});}
\ No newline at end of file
+var _0x1317=['VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1317,0x1ec));var _0x7131=function(_0x13e06e,_0x121850){_0x13e06e=_0x13e06e-0x0;var _0x5a2326=_0x1317[_0x13e06e];return _0x5a2326;};'use strict';var _=require(_0x7131('0x0'));var util=require('util');var moment=require(_0x7131('0x1'));var BPromise=require(_0x7131('0x2'));var rs=require(_0x7131('0x3'));var fs=require('fs');var Redis=require(_0x7131('0x4'));var db=require(_0x7131('0x5'))['db'];var utils=require(_0x7131('0x6'));var logger=require(_0x7131('0x7'))(_0x7131('0x8'));var config=require(_0x7131('0x9'));var jayson=require(_0x7131('0xa'));var client=jayson['client'][_0x7131('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5f5bf5,_0x4ef497,_0x261fb9){return new BPromise(function(_0x1de231,_0x450a8f){return client[_0x7131('0xc')](_0x5f5bf5,_0x261fb9)[_0x7131('0xd')](function(_0x3ce314){logger['info'](_0x7131('0xe'),_0x4ef497,'request\x20sent');logger[_0x7131('0xf')](_0x7131('0x10'),_0x4ef497,'request\x20sent',JSON[_0x7131('0x11')](_0x3ce314));if(_0x3ce314['error']){if(_0x3ce314[_0x7131('0x12')]['code']===0x1f4){logger[_0x7131('0x12')](_0x7131('0xe'),_0x4ef497,_0x3ce314['error'][_0x7131('0x13')]);return _0x450a8f(_0x3ce314[_0x7131('0x12')][_0x7131('0x13')]);}logger[_0x7131('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ef497,_0x3ce314[_0x7131('0x12')][_0x7131('0x13')]);return _0x1de231(_0x3ce314[_0x7131('0x12')][_0x7131('0x13')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4ef497,_0x7131('0x14'));_0x1de231(_0x3ce314['result'][_0x7131('0x13')]);}})[_0x7131('0x15')](function(_0x77cbd4){logger[_0x7131('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x4ef497,_0x77cbd4);_0x450a8f(_0x77cbd4);});});}
\ No newline at end of file
index d2628e0..e67f3f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c4=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x12c4,0x8d));var _0x412c=function(_0x57a07d,_0x1285e8){_0x57a07d=_0x57a07d-0x0;var _0x182dbe=_0x12c4[_0x57a07d];return _0x182dbe;};'use strict';var multer=require(_0x412c('0x0'));var util=require(_0x412c('0x1'));var path=require(_0x412c('0x2'));var timeout=require(_0x412c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x412c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x412c('0x5'));var config=require(_0x412c('0x6'));var controller=require(_0x412c('0x7'));router[_0x412c('0x8')]('/',auth[_0x412c('0x9')](),controller[_0x412c('0xa')]);router['get'](_0x412c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x412c('0xc')]('/',auth['isAuthenticated'](),controller[_0x412c('0xd')]);router[_0x412c('0xe')](_0x412c('0xb'),auth[_0x412c('0x9')](),controller[_0x412c('0xf')]);router['delete'](_0x412c('0xb'),auth[_0x412c('0x9')](),controller[_0x412c('0x10')]);module[_0x412c('0x11')]=router;
\ No newline at end of file
+var _0x28dc=['exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','post','create','put','/:id','delete','destroy'];(function(_0xb5e37f,_0xc624f1){var _0x23f431=function(_0x3ec670){while(--_0x3ec670){_0xb5e37f['push'](_0xb5e37f['shift']());}};_0x23f431(++_0xc624f1);}(_0x28dc,0x169));var _0xc28d=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x28dc[_0x74895e];return _0x40bc2a;};'use strict';var multer=require(_0xc28d('0x0'));var util=require(_0xc28d('0x1'));var path=require(_0xc28d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc28d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc28d('0x4'));var config=require(_0xc28d('0x5'));var controller=require('./intVtigerField.controller');router[_0xc28d('0x6')]('/',auth[_0xc28d('0x7')](),controller['index']);router[_0xc28d('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc28d('0x8')]('/',auth[_0xc28d('0x7')](),controller[_0xc28d('0x9')]);router[_0xc28d('0xa')](_0xc28d('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc28d('0xc')](_0xc28d('0xb'),auth[_0xc28d('0x7')](),controller[_0xc28d('0xd')]);module[_0xc28d('0xe')]=router;
\ No newline at end of file
index f100f48..0c9fd1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e39=['ENUM','sequelize','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x49d03c,_0x25abc1){var _0x31dbd8=function(_0x41fcb5){while(--_0x41fcb5){_0x49d03c['push'](_0x49d03c['shift']());}};_0x31dbd8(++_0x25abc1);}(_0x0e39,0x111));var _0x90e3=function(_0x122633,_0x22057b){_0x122633=_0x122633-0x0;var _0x2d02e5=_0x0e39[_0x122633];return _0x2d02e5;};'use strict';var Sequelize=require(_0x90e3('0x0'));module[_0x90e3('0x1')]={'type':{'type':Sequelize['ENUM'](_0x90e3('0x2'),_0x90e3('0x3'),_0x90e3('0x4'),_0x90e3('0x5'),'picklist'),'defaultValue':_0x90e3('0x2')},'content':{'type':Sequelize[_0x90e3('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x90e3('0x7')](_0x90e3('0x2'),_0x90e3('0x3'),_0x90e3('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x90e3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x90e3('0x6')]}};
\ No newline at end of file
+var _0x98e2=['BOOLEAN','sequelize','exports','string','variable','keyValue','STRING','ENUM'];(function(_0x229fe6,_0x501f59){var _0x12e845=function(_0xab0c59){while(--_0xab0c59){_0x229fe6['push'](_0x229fe6['shift']());}};_0x12e845(++_0x501f59);}(_0x98e2,0x99));var _0x298e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x98e2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x298e('0x0'));module[_0x298e('0x1')]={'type':{'type':Sequelize['ENUM'](_0x298e('0x2'),_0x298e('0x3'),'customVariable',_0x298e('0x4'),'picklist'),'defaultValue':_0x298e('0x2')},'content':{'type':Sequelize[_0x298e('0x5')]},'key':{'type':Sequelize[_0x298e('0x5')]},'keyType':{'type':Sequelize[_0x298e('0x6')](_0x298e('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x298e('0x5')]},'idField':{'type':Sequelize[_0x298e('0x5')]},'nameField':{'type':Sequelize[_0x298e('0x5')]},'customField':{'type':Sequelize[_0x298e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 5ce7e1d..e43fb96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x000c=['index','VtigerField','rawAttributes','fieldName','type','key','map','query','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','rows','catch','show','params','keys','includeAll','create','body','find','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','error','stack','name','send'];(function(_0x15ea7f,_0x27c93e){var _0x1cc439=function(_0x518ee7){while(--_0x518ee7){_0x15ea7f['push'](_0x15ea7f['shift']());}};_0x1cc439(++_0x27c93e);}(_0x000c,0x140));var _0xc000=function(_0x9e98a6,_0x12cf62){_0x9e98a6=_0x9e98a6-0x0;var _0x39a38e=_0x000c[_0x9e98a6];return _0x39a38e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc000('0x0'));var zipdir=require(_0xc000('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc000('0x2'));var moment=require(_0xc000('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc000('0x4'));var util=require(_0xc000('0x5'));var path=require(_0xc000('0x6'));var sox=require(_0xc000('0x7'));var csv=require(_0xc000('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc000('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc000('0xa'));var jsforce=require(_0xc000('0xb'));var deskjs=require(_0xc000('0xc'));var toCsv=require(_0xc000('0x8'));var querystring=require(_0xc000('0xd'));var Papa=require(_0xc000('0xe'));var Redis=require(_0xc000('0xf'));var authService=require(_0xc000('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xc000('0x11'));var hardwareService=require(_0xc000('0x12'));var logger=require(_0xc000('0x13'))('api');var utils=require(_0xc000('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc000('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x847104,_0x1af056){_0x1af056=_0x1af056||0xcc;return function(_0x4ae424){if(_0x4ae424){return _0x847104[_0xc000('0x16')](_0x1af056);}return _0x847104[_0xc000('0x17')](_0x1af056)[_0xc000('0x18')]();};}function respondWithResult(_0x1499ed,_0x28bcd6){_0x28bcd6=_0x28bcd6||0xc8;return function(_0x1b358f){if(_0x1b358f){return _0x1499ed[_0xc000('0x17')](_0x28bcd6)[_0xc000('0x19')](_0x1b358f);}};}function respondWithFilteredResult(_0x4b0f05,_0x54560f){return function(_0x1f39ed){if(_0x1f39ed){var _0xa3f931=typeof _0x54560f[_0xc000('0x1a')]===_0xc000('0x1b')&&typeof _0x54560f['limit']===_0xc000('0x1b');var _0x3318d0=_0x1f39ed[_0xc000('0x1c')];var _0x595973=_0xa3f931?0x0:_0x54560f[_0xc000('0x1a')];var _0x409af1=_0xa3f931?_0x1f39ed[_0xc000('0x1c')]:_0x54560f[_0xc000('0x1a')]+_0x54560f[_0xc000('0x1d')];var _0x444136;if(_0x409af1>=_0x3318d0){_0x409af1=_0x3318d0;_0x444136=0xc8;}else{_0x444136=0xce;}_0x4b0f05[_0xc000('0x17')](_0x444136);return _0x4b0f05[_0xc000('0x1e')](_0xc000('0x1f'),_0x595973+'-'+_0x409af1+'/'+_0x3318d0)[_0xc000('0x19')](_0x1f39ed);}return null;};}function patchUpdates(_0x5201be){return function(_0x500348){try{jsonpatch['apply'](_0x500348,_0x5201be,!![]);}catch(_0x42232f){return BPromise[_0xc000('0x20')](_0x42232f);}return _0x500348['save']();};}function saveUpdates(_0x7f7cfd,_0x1e7d9e){return function(_0x8f6987){if(_0x8f6987){return _0x8f6987[_0xc000('0x21')](_0x7f7cfd)['then'](function(_0x2917c4){return _0x2917c4;});}return null;};}function removeEntity(_0x33ad9a,_0x4cd748){return function(_0x5299c9){if(_0x5299c9){return _0x5299c9[_0xc000('0x22')]()[_0xc000('0x23')](function(){_0x33ad9a[_0xc000('0x17')](0xcc)[_0xc000('0x18')]();});}};}function handleEntityNotFound(_0x1e016b,_0x32bb65){return function(_0x35829c){if(!_0x35829c){_0x1e016b[_0xc000('0x16')](0x194);}return _0x35829c;};}function handleError(_0x21026b,_0x410b10){_0x410b10=_0x410b10||0x1f4;return function(_0x21b761){logger[_0xc000('0x24')](_0x21b761[_0xc000('0x25')]);if(_0x21b761['name']){delete _0x21b761[_0xc000('0x26')];}_0x21026b[_0xc000('0x17')](_0x410b10)[_0xc000('0x27')](_0x21b761);};}exports[_0xc000('0x28')]=function(_0x3d9d5e,_0xd0181f){var _0x2bc0a1={},_0x2aaf2c={},_0x4df2d8={'count':0x0,'rows':[]};var _0x1747ed=_['map'](db[_0xc000('0x29')][_0xc000('0x2a')],function(_0x397a6f){return{'name':_0x397a6f[_0xc000('0x2b')],'type':_0x397a6f[_0xc000('0x2c')][_0xc000('0x2d')]};});_0x2aaf2c['model']=_[_0xc000('0x2e')](_0x1747ed,'name');_0x2aaf2c[_0xc000('0x2f')]=_['keys'](_0x3d9d5e['query']);_0x2aaf2c['filters']=_['intersection'](_0x2aaf2c[_0xc000('0x30')],_0x2aaf2c[_0xc000('0x2f')]);_0x2bc0a1[_0xc000('0x31')]=_['intersection'](_0x2aaf2c[_0xc000('0x30')],qs[_0xc000('0x32')](_0x3d9d5e[_0xc000('0x2f')]['fields']));_0x2bc0a1['attributes']=_0x2bc0a1[_0xc000('0x31')][_0xc000('0x33')]?_0x2bc0a1[_0xc000('0x31')]:_0x2aaf2c[_0xc000('0x30')];if(!_0x3d9d5e[_0xc000('0x2f')]['hasOwnProperty'](_0xc000('0x34'))){_0x2bc0a1[_0xc000('0x1d')]=qs[_0xc000('0x1d')](_0x3d9d5e['query'][_0xc000('0x1d')]);_0x2bc0a1[_0xc000('0x1a')]=qs['offset'](_0x3d9d5e['query'][_0xc000('0x1a')]);}_0x2bc0a1[_0xc000('0x35')]=qs[_0xc000('0x36')](_0x3d9d5e[_0xc000('0x2f')]['sort']);_0x2bc0a1[_0xc000('0x37')]=qs[_0xc000('0x38')](_[_0xc000('0x39')](_0x3d9d5e['query'],_0x2aaf2c[_0xc000('0x38')]),_0x1747ed);if(_0x3d9d5e[_0xc000('0x2f')]['filter']){_0x2bc0a1['where']=_['merge'](_0x2bc0a1[_0xc000('0x37')],{'$or':_[_0xc000('0x2e')](_0x1747ed,function(_0x314137){if(_0x314137[_0xc000('0x2c')]!==_0xc000('0x3a')){var _0x2a3c05={};_0x2a3c05[_0x314137[_0xc000('0x26')]]={'$like':'%'+_0x3d9d5e[_0xc000('0x2f')][_0xc000('0x3b')]+'%'};return _0x2a3c05;}})});}_0x2bc0a1=_[_0xc000('0x3c')]({},_0x2bc0a1,_0x3d9d5e[_0xc000('0x3d')]);var _0x25a305={'where':_0x2bc0a1[_0xc000('0x37')]};return db[_0xc000('0x29')]['count'](_0x25a305)[_0xc000('0x23')](function(_0x5291cd){_0x4df2d8['count']=_0x5291cd;if(_0x3d9d5e['query']['includeAll']){_0x2bc0a1[_0xc000('0x3e')]=[{'all':!![]}];}return db[_0xc000('0x29')]['findAll'](_0x2bc0a1);})[_0xc000('0x23')](function(_0x2cd4dd){_0x4df2d8[_0xc000('0x3f')]=_0x2cd4dd;return _0x4df2d8;})[_0xc000('0x23')](respondWithFilteredResult(_0xd0181f,_0x2bc0a1))[_0xc000('0x40')](handleError(_0xd0181f,null));};exports[_0xc000('0x41')]=function(_0x2053b9,_0x296276){var _0x31d309={'raw':!![],'where':{'id':_0x2053b9[_0xc000('0x42')]['id']}},_0x5b7a53={};_0x5b7a53['model']=_[_0xc000('0x43')](db[_0xc000('0x29')][_0xc000('0x2a')]);_0x5b7a53[_0xc000('0x2f')]=_[_0xc000('0x43')](_0x2053b9[_0xc000('0x2f')]);_0x5b7a53[_0xc000('0x38')]=_['intersection'](_0x5b7a53[_0xc000('0x30')],_0x5b7a53[_0xc000('0x2f')]);_0x31d309[_0xc000('0x31')]=_['intersection'](_0x5b7a53[_0xc000('0x30')],qs['fields'](_0x2053b9[_0xc000('0x2f')]['fields']));_0x31d309['attributes']=_0x31d309[_0xc000('0x31')][_0xc000('0x33')]?_0x31d309[_0xc000('0x31')]:_0x5b7a53[_0xc000('0x30')];if(_0x2053b9[_0xc000('0x2f')][_0xc000('0x44')]){_0x31d309[_0xc000('0x3e')]=[{'all':!![]}];}_0x31d309=_[_0xc000('0x3c')]({},_0x31d309,_0x2053b9[_0xc000('0x3d')]);return db[_0xc000('0x29')]['find'](_0x31d309)[_0xc000('0x23')](handleEntityNotFound(_0x296276,null))[_0xc000('0x23')](respondWithResult(_0x296276,null))['catch'](handleError(_0x296276,null));};exports[_0xc000('0x45')]=function(_0x1561ae,_0x375c68){return db[_0xc000('0x29')][_0xc000('0x45')](_0x1561ae['body'],{})[_0xc000('0x23')](respondWithResult(_0x375c68,0xc9))[_0xc000('0x40')](handleError(_0x375c68,null));};exports[_0xc000('0x21')]=function(_0x265c58,_0x29e568){if(_0x265c58[_0xc000('0x46')]['id']){delete _0x265c58[_0xc000('0x46')]['id'];}return db[_0xc000('0x29')][_0xc000('0x47')]({'where':{'id':_0x265c58[_0xc000('0x42')]['id']}})[_0xc000('0x23')](handleEntityNotFound(_0x29e568,null))[_0xc000('0x23')](saveUpdates(_0x265c58[_0xc000('0x46')],null))['then'](respondWithResult(_0x29e568,null))['catch'](handleError(_0x29e568,null));};exports[_0xc000('0x22')]=function(_0x40c318,_0x25371b){return db[_0xc000('0x29')][_0xc000('0x47')]({'where':{'id':_0x40c318[_0xc000('0x42')]['id']}})['then'](handleEntityNotFound(_0x25371b,null))[_0xc000('0x23')](removeEntity(_0x25371b,null))[_0xc000('0x40')](handleError(_0x25371b,null));};
\ No newline at end of file
+var _0xff97=['body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','error','stack','send','index','map','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','VtigerField','rawAttributes','filters','find','catch','create'];(function(_0x2e5baf,_0x4b77a1){var _0x4c0797=function(_0x32f4fc){while(--_0x32f4fc){_0x2e5baf['push'](_0x2e5baf['shift']());}};_0x4c0797(++_0x4b77a1);}(_0xff97,0x19f));var _0x7ff9=function(_0x1bb198,_0x163853){_0x1bb198=_0x1bb198-0x0;var _0x532e2c=_0xff97[_0x1bb198];return _0x532e2c;};'use strict';var emlformat=require(_0x7ff9('0x0'));var rimraf=require(_0x7ff9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7ff9('0x2'));var rp=require('request-promise');var moment=require(_0x7ff9('0x3'));var BPromise=require(_0x7ff9('0x4'));var Mustache=require(_0x7ff9('0x5'));var util=require(_0x7ff9('0x6'));var path=require('path');var sox=require(_0x7ff9('0x7'));var csv=require(_0x7ff9('0x8'));var ejs=require(_0x7ff9('0x9'));var fs=require('fs');var fs_extra=require(_0x7ff9('0xa'));var _=require(_0x7ff9('0xb'));var squel=require('squel');var crypto=require(_0x7ff9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7ff9('0x8'));var querystring=require('querystring');var Papa=require(_0x7ff9('0xd'));var Redis=require(_0x7ff9('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7ff9('0xf'));var hardwareService=require(_0x7ff9('0x10'));var logger=require('../../config/logger')(_0x7ff9('0x11'));var utils=require(_0x7ff9('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7ff9('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42c5f8,_0x19ffd3){_0x19ffd3=_0x19ffd3||0xcc;return function(_0x370c37){if(_0x370c37){return _0x42c5f8['sendStatus'](_0x19ffd3);}return _0x42c5f8[_0x7ff9('0x14')](_0x19ffd3)[_0x7ff9('0x15')]();};}function respondWithResult(_0x356f16,_0x1a5036){_0x1a5036=_0x1a5036||0xc8;return function(_0x2214cf){if(_0x2214cf){return _0x356f16[_0x7ff9('0x14')](_0x1a5036)['json'](_0x2214cf);}};}function respondWithFilteredResult(_0x5a7685,_0x167dbb){return function(_0x44e0ce){if(_0x44e0ce){var _0x5ad47b=typeof _0x167dbb[_0x7ff9('0x16')]===_0x7ff9('0x17')&&typeof _0x167dbb[_0x7ff9('0x18')]===_0x7ff9('0x17');var _0x2ac5cc=_0x44e0ce[_0x7ff9('0x19')];var _0x408b07=_0x5ad47b?0x0:_0x167dbb[_0x7ff9('0x16')];var _0x23e1a9=_0x5ad47b?_0x44e0ce[_0x7ff9('0x19')]:_0x167dbb['offset']+_0x167dbb[_0x7ff9('0x18')];var _0x16cef9;if(_0x23e1a9>=_0x2ac5cc){_0x23e1a9=_0x2ac5cc;_0x16cef9=0xc8;}else{_0x16cef9=0xce;}_0x5a7685[_0x7ff9('0x14')](_0x16cef9);return _0x5a7685[_0x7ff9('0x1a')]('Content-Range',_0x408b07+'-'+_0x23e1a9+'/'+_0x2ac5cc)[_0x7ff9('0x1b')](_0x44e0ce);}return null;};}function patchUpdates(_0x126a5c){return function(_0x5d9972){try{jsonpatch[_0x7ff9('0x1c')](_0x5d9972,_0x126a5c,!![]);}catch(_0x14d9b2){return BPromise[_0x7ff9('0x1d')](_0x14d9b2);}return _0x5d9972['save']();};}function saveUpdates(_0x1535c3,_0x53b075){return function(_0x8fc0b0){if(_0x8fc0b0){return _0x8fc0b0[_0x7ff9('0x1e')](_0x1535c3)[_0x7ff9('0x1f')](function(_0x2221ce){return _0x2221ce;});}return null;};}function removeEntity(_0x24da10,_0x1e61c9){return function(_0xb60a67){if(_0xb60a67){return _0xb60a67[_0x7ff9('0x20')]()[_0x7ff9('0x1f')](function(){_0x24da10[_0x7ff9('0x14')](0xcc)[_0x7ff9('0x15')]();});}};}function handleEntityNotFound(_0x33d795,_0x4172bb){return function(_0x2e0e58){if(!_0x2e0e58){_0x33d795['sendStatus'](0x194);}return _0x2e0e58;};}function handleError(_0x2b642d,_0x456605){_0x456605=_0x456605||0x1f4;return function(_0x4ffd6a){logger[_0x7ff9('0x21')](_0x4ffd6a[_0x7ff9('0x22')]);if(_0x4ffd6a['name']){delete _0x4ffd6a['name'];}_0x2b642d[_0x7ff9('0x14')](_0x456605)[_0x7ff9('0x23')](_0x4ffd6a);};}exports[_0x7ff9('0x24')]=function(_0x375612,_0x1a0a32){var _0x1bb383={},_0x135aaa={},_0x2fd668={'count':0x0,'rows':[]};var _0x1f158c=_[_0x7ff9('0x25')](db['VtigerField']['rawAttributes'],function(_0x4b0e33){return{'name':_0x4b0e33[_0x7ff9('0x26')],'type':_0x4b0e33[_0x7ff9('0x27')]['key']};});_0x135aaa[_0x7ff9('0x28')]=_[_0x7ff9('0x25')](_0x1f158c,'name');_0x135aaa['query']=_['keys'](_0x375612[_0x7ff9('0x29')]);_0x135aaa['filters']=_[_0x7ff9('0x2a')](_0x135aaa[_0x7ff9('0x28')],_0x135aaa[_0x7ff9('0x29')]);_0x1bb383[_0x7ff9('0x2b')]=_[_0x7ff9('0x2a')](_0x135aaa['model'],qs['fields'](_0x375612[_0x7ff9('0x29')][_0x7ff9('0x2c')]));_0x1bb383[_0x7ff9('0x2b')]=_0x1bb383['attributes'][_0x7ff9('0x2d')]?_0x1bb383[_0x7ff9('0x2b')]:_0x135aaa['model'];if(!_0x375612[_0x7ff9('0x29')][_0x7ff9('0x2e')](_0x7ff9('0x2f'))){_0x1bb383[_0x7ff9('0x18')]=qs[_0x7ff9('0x18')](_0x375612[_0x7ff9('0x29')][_0x7ff9('0x18')]);_0x1bb383[_0x7ff9('0x16')]=qs[_0x7ff9('0x16')](_0x375612[_0x7ff9('0x29')][_0x7ff9('0x16')]);}_0x1bb383[_0x7ff9('0x30')]=qs[_0x7ff9('0x31')](_0x375612[_0x7ff9('0x29')]['sort']);_0x1bb383[_0x7ff9('0x32')]=qs['filters'](_[_0x7ff9('0x33')](_0x375612[_0x7ff9('0x29')],_0x135aaa['filters']),_0x1f158c);if(_0x375612[_0x7ff9('0x29')][_0x7ff9('0x34')]){_0x1bb383[_0x7ff9('0x32')]=_[_0x7ff9('0x35')](_0x1bb383[_0x7ff9('0x32')],{'$or':_[_0x7ff9('0x25')](_0x1f158c,function(_0x1f756f){if(_0x1f756f[_0x7ff9('0x27')]!==_0x7ff9('0x36')){var _0x6c72f5={};_0x6c72f5[_0x1f756f['name']]={'$like':'%'+_0x375612[_0x7ff9('0x29')][_0x7ff9('0x34')]+'%'};return _0x6c72f5;}})});}_0x1bb383=_[_0x7ff9('0x35')]({},_0x1bb383,_0x375612[_0x7ff9('0x37')]);var _0x23ac93={'where':_0x1bb383[_0x7ff9('0x32')]};return db['VtigerField']['count'](_0x23ac93)[_0x7ff9('0x1f')](function(_0x1b4602){_0x2fd668[_0x7ff9('0x19')]=_0x1b4602;if(_0x375612['query'][_0x7ff9('0x38')]){_0x1bb383[_0x7ff9('0x39')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x1bb383);})[_0x7ff9('0x1f')](function(_0x63d5fd){_0x2fd668[_0x7ff9('0x3a')]=_0x63d5fd;return _0x2fd668;})[_0x7ff9('0x1f')](respondWithFilteredResult(_0x1a0a32,_0x1bb383))['catch'](handleError(_0x1a0a32,null));};exports[_0x7ff9('0x3b')]=function(_0x8373e4,_0x178941){var _0x4adaa9={'raw':!![],'where':{'id':_0x8373e4[_0x7ff9('0x3c')]['id']}},_0x33fccc={};_0x33fccc[_0x7ff9('0x28')]=_[_0x7ff9('0x3d')](db[_0x7ff9('0x3e')][_0x7ff9('0x3f')]);_0x33fccc[_0x7ff9('0x29')]=_[_0x7ff9('0x3d')](_0x8373e4[_0x7ff9('0x29')]);_0x33fccc[_0x7ff9('0x40')]=_[_0x7ff9('0x2a')](_0x33fccc[_0x7ff9('0x28')],_0x33fccc[_0x7ff9('0x29')]);_0x4adaa9[_0x7ff9('0x2b')]=_[_0x7ff9('0x2a')](_0x33fccc[_0x7ff9('0x28')],qs[_0x7ff9('0x2c')](_0x8373e4[_0x7ff9('0x29')][_0x7ff9('0x2c')]));_0x4adaa9[_0x7ff9('0x2b')]=_0x4adaa9[_0x7ff9('0x2b')][_0x7ff9('0x2d')]?_0x4adaa9[_0x7ff9('0x2b')]:_0x33fccc[_0x7ff9('0x28')];if(_0x8373e4[_0x7ff9('0x29')][_0x7ff9('0x38')]){_0x4adaa9[_0x7ff9('0x39')]=[{'all':!![]}];}_0x4adaa9=_['merge']({},_0x4adaa9,_0x8373e4[_0x7ff9('0x37')]);return db[_0x7ff9('0x3e')][_0x7ff9('0x41')](_0x4adaa9)[_0x7ff9('0x1f')](handleEntityNotFound(_0x178941,null))[_0x7ff9('0x1f')](respondWithResult(_0x178941,null))[_0x7ff9('0x42')](handleError(_0x178941,null));};exports['create']=function(_0x487c6f,_0x3b5492){return db[_0x7ff9('0x3e')][_0x7ff9('0x43')](_0x487c6f[_0x7ff9('0x44')],{})[_0x7ff9('0x1f')](respondWithResult(_0x3b5492,0xc9))[_0x7ff9('0x42')](handleError(_0x3b5492,null));};exports[_0x7ff9('0x1e')]=function(_0x76576c,_0x299cb9){if(_0x76576c[_0x7ff9('0x44')]['id']){delete _0x76576c[_0x7ff9('0x44')]['id'];}return db['VtigerField']['find']({'where':{'id':_0x76576c[_0x7ff9('0x3c')]['id']}})['then'](handleEntityNotFound(_0x299cb9,null))[_0x7ff9('0x1f')](saveUpdates(_0x76576c[_0x7ff9('0x44')],null))[_0x7ff9('0x1f')](respondWithResult(_0x299cb9,null))[_0x7ff9('0x42')](handleError(_0x299cb9,null));};exports[_0x7ff9('0x20')]=function(_0x1e69bd,_0x3b7031){return db[_0x7ff9('0x3e')]['find']({'where':{'id':_0x1e69bd[_0x7ff9('0x3c')]['id']}})[_0x7ff9('0x1f')](handleEntityNotFound(_0x3b7031,null))['then'](removeEntity(_0x3b7031,null))[_0x7ff9('0x42')](handleError(_0x3b7031,null));};
\ No newline at end of file
index f90a0fd..e6a77ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e15=['./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0e15,0x6e));var _0x50e1=function(_0x58b607,_0x146014){_0x58b607=_0x58b607-0x0;var _0x471edc=_0x0e15[_0x58b607];return _0x471edc;};'use strict';var _=require(_0x50e1('0x0'));var util=require('util');var logger=require(_0x50e1('0x1'))(_0x50e1('0x2'));var moment=require(_0x50e1('0x3'));var BPromise=require(_0x50e1('0x4'));var rp=require(_0x50e1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x50e1('0x6'));var config=require('../../config/environment');var attributes=require(_0x50e1('0x7'));module[_0x50e1('0x8')]=function(_0x488482,_0x34cff5){return _0x488482[_0x50e1('0x9')]('VtigerField',attributes,{'tableName':_0x50e1('0xa'),'paranoid':![],'indexes':[{'name':_0x50e1('0xb'),'fields':[_0x50e1('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4aff=['bluebird','request-promise','path','rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','api'];(function(_0x227b67,_0x5c4075){var _0x16f616=function(_0x46e857){while(--_0x46e857){_0x227b67['push'](_0x227b67['shift']());}};_0x16f616(++_0x5c4075);}(_0x4aff,0x150));var _0xf4af=function(_0x185832,_0x53aeea){_0x185832=_0x185832-0x0;var _0x253dda=_0x4aff[_0x185832];return _0x253dda;};'use strict';var _=require(_0xf4af('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf4af('0x1'));var moment=require('moment');var BPromise=require(_0xf4af('0x2'));var rp=require(_0xf4af('0x3'));var fs=require('fs');var path=require(_0xf4af('0x4'));var rimraf=require(_0xf4af('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0xf4af('0x6')]=function(_0xe42315,_0x9cc155){return _0xe42315[_0xf4af('0x7')](_0xf4af('0x8'),attributes,{'tableName':_0xf4af('0x9'),'paranoid':![],'indexes':[{'name':_0xf4af('0xa'),'fields':[_0xf4af('0xb'),_0xf4af('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4ed1ca0..9d75b45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481b=['http','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x481b,0xbe));var _0xb481=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x481b[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0xb481('0x0'));var moment=require(_0xb481('0x1'));var BPromise=require(_0xb481('0x2'));var rs=require(_0xb481('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb481('0x4'))['db'];var utils=require(_0xb481('0x5'));var logger=require(_0xb481('0x6'))(_0xb481('0x7'));var config=require('../../config/environment');var jayson=require(_0xb481('0x8'));var client=jayson[_0xb481('0x9')][_0xb481('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x488df9,_0x4b3d70,_0x1bfd94){return new BPromise(function(_0x3c7392,_0x3f3939){return client['request'](_0x488df9,_0x1bfd94)['then'](function(_0x411a49){logger[_0xb481('0xb')](_0xb481('0xc'),_0x4b3d70,'request\x20sent');logger[_0xb481('0xd')](_0xb481('0xe'),_0x4b3d70,'request\x20sent',JSON[_0xb481('0xf')](_0x411a49));if(_0x411a49[_0xb481('0x10')]){if(_0x411a49[_0xb481('0x10')][_0xb481('0x11')]===0x1f4){logger[_0xb481('0x10')](_0xb481('0xc'),_0x4b3d70,_0x411a49[_0xb481('0x10')]['message']);return _0x3f3939(_0x411a49[_0xb481('0x10')][_0xb481('0x12')]);}logger[_0xb481('0x10')](_0xb481('0xc'),_0x4b3d70,_0x411a49[_0xb481('0x10')][_0xb481('0x12')]);return _0x3c7392(_0x411a49['error'][_0xb481('0x12')]);}else{logger[_0xb481('0xb')](_0xb481('0xc'),_0x4b3d70,'request\x20sent');_0x3c7392(_0x411a49['result'][_0xb481('0x12')]);}})[_0xb481('0x13')](function(_0x7e073a){logger[_0xb481('0x10')](_0xb481('0xc'),_0x4b3d70,_0x7e073a);_0x3f3939(_0x7e073a);});});}
\ No newline at end of file
+var _0x5bab=['VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x4fa721,_0x1d61a3){var _0x168469=function(_0x2639a1){while(--_0x2639a1){_0x4fa721['push'](_0x4fa721['shift']());}};_0x168469(++_0x1d61a3);}(_0x5bab,0x15a));var _0xb5ba=function(_0x24e930,_0x473308){_0x24e930=_0x24e930-0x0;var _0x2c6621=_0x5bab[_0x24e930];return _0x2c6621;};'use strict';var _=require(_0xb5ba('0x0'));var util=require('util');var moment=require(_0xb5ba('0x1'));var BPromise=require(_0xb5ba('0x2'));var rs=require(_0xb5ba('0x3'));var fs=require('fs');var Redis=require(_0xb5ba('0x4'));var db=require(_0xb5ba('0x5'))['db'];var utils=require(_0xb5ba('0x6'));var logger=require(_0xb5ba('0x7'))(_0xb5ba('0x8'));var config=require(_0xb5ba('0x9'));var jayson=require(_0xb5ba('0xa'));var client=jayson[_0xb5ba('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cf991,_0x38a70b,_0x27017d){return new BPromise(function(_0x3fb24f,_0x55bee1){return client[_0xb5ba('0xc')](_0x4cf991,_0x27017d)[_0xb5ba('0xd')](function(_0x230867){logger['info'](_0xb5ba('0xe'),_0x38a70b,_0xb5ba('0xf'));logger[_0xb5ba('0x10')](_0xb5ba('0x11'),_0x38a70b,_0xb5ba('0xf'),JSON[_0xb5ba('0x12')](_0x230867));if(_0x230867[_0xb5ba('0x13')]){if(_0x230867[_0xb5ba('0x13')]['code']===0x1f4){logger['error'](_0xb5ba('0xe'),_0x38a70b,_0x230867['error'][_0xb5ba('0x14')]);return _0x55bee1(_0x230867[_0xb5ba('0x13')][_0xb5ba('0x14')]);}logger[_0xb5ba('0x13')](_0xb5ba('0xe'),_0x38a70b,_0x230867[_0xb5ba('0x13')][_0xb5ba('0x14')]);return _0x3fb24f(_0x230867[_0xb5ba('0x13')][_0xb5ba('0x14')]);}else{logger[_0xb5ba('0x15')](_0xb5ba('0xe'),_0x38a70b,_0xb5ba('0xf'));_0x3fb24f(_0x230867[_0xb5ba('0x16')][_0xb5ba('0x14')]);}})[_0xb5ba('0x17')](function(_0x1c8e64){logger[_0xb5ba('0x13')](_0xb5ba('0xe'),_0x38a70b,_0x1c8e64);_0x55bee1(_0x1c8e64);});});}
\ No newline at end of file
index 5a3d062..6e2a39e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6075=['post','addConfiguration','put','update','delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','create'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0x6075,0x126));var _0x5607=function(_0x6d4fd9,_0x179574){_0x6d4fd9=_0x6d4fd9-0x0;var _0x1fbc38=_0x6075[_0x6d4fd9];return _0x1fbc38;};'use strict';var multer=require(_0x5607('0x0'));var util=require('util');var path=require(_0x5607('0x1'));var timeout=require(_0x5607('0x2'));var express=require('express');var router=express[_0x5607('0x3')]();var fs_extra=require(_0x5607('0x4'));var auth=require(_0x5607('0x5'));var interaction=require(_0x5607('0x6'));var config=require(_0x5607('0x7'));var controller=require(_0x5607('0x8'));router['get']('/',auth[_0x5607('0x9')](),controller[_0x5607('0xa')]);router[_0x5607('0xb')](_0x5607('0xc'),auth[_0x5607('0x9')](),controller[_0x5607('0xd')]);router[_0x5607('0xb')](_0x5607('0xe'),auth['isAuthenticated'](),controller[_0x5607('0xf')]);router[_0x5607('0xb')]('/:id/fields',auth[_0x5607('0x9')](),controller[_0x5607('0x10')]);router['post']('/',auth[_0x5607('0x9')](),controller[_0x5607('0x11')]);router[_0x5607('0x12')](_0x5607('0xe'),auth[_0x5607('0x9')](),controller[_0x5607('0x13')]);router[_0x5607('0x14')](_0x5607('0xc'),auth[_0x5607('0x9')](),controller[_0x5607('0x15')]);router[_0x5607('0x16')](_0x5607('0xc'),auth[_0x5607('0x9')](),controller['destroy']);module[_0x5607('0x17')]=router;
\ No newline at end of file
+var _0x7ee1=['post','create','put','/:id','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','index','isAuthenticated','/:id/configurations'];(function(_0x233cb1,_0x8ca9a2){var _0x29ee7e=function(_0x20e277){while(--_0x20e277){_0x233cb1['push'](_0x233cb1['shift']());}};_0x29ee7e(++_0x8ca9a2);}(_0x7ee1,0x8d));var _0x17ee=function(_0x5c98a9,_0x41d448){_0x5c98a9=_0x5c98a9-0x0;var _0x34f6a9=_0x7ee1[_0x5c98a9];return _0x34f6a9;};'use strict';var multer=require(_0x17ee('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x17ee('0x1'));var router=express[_0x17ee('0x2')]();var fs_extra=require(_0x17ee('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x17ee('0x4'));var config=require(_0x17ee('0x5'));var controller=require(_0x17ee('0x6'));router[_0x17ee('0x7')]('/',auth['isAuthenticated'](),controller[_0x17ee('0x8')]);router[_0x17ee('0x7')]('/:id',auth[_0x17ee('0x9')](),controller['show']);router[_0x17ee('0x7')](_0x17ee('0xa'),auth[_0x17ee('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x17ee('0x9')](),controller['getFields']);router[_0x17ee('0xb')]('/',auth[_0x17ee('0x9')](),controller[_0x17ee('0xc')]);router[_0x17ee('0xb')]('/:id/configurations',auth[_0x17ee('0x9')](),controller['addConfiguration']);router[_0x17ee('0xd')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0xf')]);router[_0x17ee('0x10')](_0x17ee('0xe'),auth[_0x17ee('0x9')](),controller[_0x17ee('0x11')]);module[_0x17ee('0x12')]=router;
\ No newline at end of file
index 3d37723..18f3e27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5496=['remoteUri','ENUM','password','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x37f86e,_0x19dac9){var _0x48e3fa=function(_0x317b14){while(--_0x317b14){_0x37f86e['push'](_0x37f86e['shift']());}};_0x48e3fa(++_0x19dac9);}(_0x5496,0x175));var _0x6549=function(_0x394ecd,_0xdc3727){_0x394ecd=_0x394ecd-0x0;var _0x4814ad=_0x5496[_0x394ecd];return _0x4814ad;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')]},'description':{'type':Sequelize[_0x6549('0x2')]},'username':{'type':Sequelize[_0x6549('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x6549('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6549('0x2')],'unique':_0x6549('0x3')},'authType':{'type':Sequelize[_0x6549('0x4')]('password','token'),'defaultValue':_0x6549('0x5')},'serverUrl':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x6549('0x6'),_0x6549('0x7')),'defaultValue':_0x6549('0x6')}};
\ No newline at end of file
+var _0x3d3d=['exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xd3d3('0x0')]={'name':{'type':Sequelize[_0xd3d3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xd3d3('0x1')],'unique':_0xd3d3('0x2')},'password':{'type':Sequelize[_0xd3d3('0x1')]},'token':{'type':Sequelize[_0xd3d3('0x1')]},'remoteUri':{'type':Sequelize[_0xd3d3('0x1')],'unique':_0xd3d3('0x3')},'authType':{'type':Sequelize[_0xd3d3('0x4')](_0xd3d3('0x5'),_0xd3d3('0x6')),'defaultValue':_0xd3d3('0x5')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xd3d3('0x4')](_0xd3d3('0x7'),_0xd3d3('0x8')),'defaultValue':_0xd3d3('0x7')}};
\ No newline at end of file
index ad34743..bb096c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5423=['Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','then','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','model','map','query','keys','filters','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','ZendeskConfiguration','nolimit','findOne','AccountId','getSubjects','channel','type','Descriptions','ZendeskField','getFields','username','password','token','remoteUri','slice','lastIndexOf','ticket_fields','headers','Basic\x20%s','format','%s:%s','base64','%s/token:%s','toString','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x45c262,_0x2e3ce5){var _0x4f2ba6=function(_0x4912d1){while(--_0x4912d1){_0x45c262['push'](_0x45c262['shift']());}};_0x4f2ba6(++_0x2e3ce5);}(_0x5423,0xe3));var _0x3542=function(_0x3203b4,_0x268dc7){_0x3203b4=_0x3203b4-0x0;var _0x4271ff=_0x5423[_0x3203b4];return _0x4271ff;};'use strict';var emlformat=require(_0x3542('0x0'));var rimraf=require(_0x3542('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3542('0x2'));var rp=require(_0x3542('0x3'));var moment=require('moment');var BPromise=require(_0x3542('0x4'));var Mustache=require(_0x3542('0x5'));var util=require(_0x3542('0x6'));var path=require(_0x3542('0x7'));var sox=require('sox');var csv=require(_0x3542('0x8'));var ejs=require(_0x3542('0x9'));var fs=require('fs');var fs_extra=require(_0x3542('0xa'));var _=require(_0x3542('0xb'));var squel=require(_0x3542('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3542('0xd'));var toCsv=require(_0x3542('0x8'));var querystring=require('querystring');var Papa=require(_0x3542('0xe'));var Redis=require(_0x3542('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3542('0x10'));var as=require(_0x3542('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3542('0x12'))(_0x3542('0x13'));var utils=require(_0x3542('0x14'));var config=require(_0x3542('0x15'));var licenseUtil=require(_0x3542('0x16'));var db=require(_0x3542('0x17'))['db'];var integrations=require(_0x3542('0x18'));function respondWithStatusCode(_0x43e977,_0x4ee86){_0x4ee86=_0x4ee86||0xcc;return function(_0x1a9062){if(_0x1a9062){return _0x43e977[_0x3542('0x19')](_0x4ee86);}return _0x43e977[_0x3542('0x1a')](_0x4ee86)[_0x3542('0x1b')]();};}function respondWithResult(_0x4bac5b,_0x14fe57){_0x14fe57=_0x14fe57||0xc8;return function(_0x4fb366){if(_0x4fb366){return _0x4bac5b[_0x3542('0x1a')](_0x14fe57)[_0x3542('0x1c')](_0x4fb366);}};}function respondWithFilteredResult(_0xc33d42,_0x546fbd){return function(_0x270312){if(_0x270312){var _0x177fb9=typeof _0x546fbd[_0x3542('0x1d')]==='undefined'&&typeof _0x546fbd[_0x3542('0x1e')]===_0x3542('0x1f');var _0x116859=_0x270312[_0x3542('0x20')];var _0x493d95=_0x177fb9?0x0:_0x546fbd[_0x3542('0x1d')];var _0x53d4aa=_0x177fb9?_0x270312[_0x3542('0x20')]:_0x546fbd[_0x3542('0x1d')]+_0x546fbd['limit'];var _0x1c6403;if(_0x53d4aa>=_0x116859){_0x53d4aa=_0x116859;_0x1c6403=0xc8;}else{_0x1c6403=0xce;}_0xc33d42[_0x3542('0x1a')](_0x1c6403);return _0xc33d42[_0x3542('0x21')](_0x3542('0x22'),_0x493d95+'-'+_0x53d4aa+'/'+_0x116859)[_0x3542('0x1c')](_0x270312);}return null;};}function patchUpdates(_0x4a7695){return function(_0x4a74b0){try{jsonpatch['apply'](_0x4a74b0,_0x4a7695,!![]);}catch(_0x17e3cf){return BPromise['reject'](_0x17e3cf);}return _0x4a74b0[_0x3542('0x23')]();};}function saveUpdates(_0x551645,_0x1d5f1e){return function(_0x55774d){if(_0x55774d){return _0x55774d['update'](_0x551645)[_0x3542('0x24')](function(_0xe3f983){return _0xe3f983;});}return null;};}function removeEntity(_0x5ae097,_0x5d05b2){return function(_0x3fc964){if(_0x3fc964){return _0x3fc964['destroy']()[_0x3542('0x24')](function(){_0x5ae097[_0x3542('0x1a')](0xcc)[_0x3542('0x1b')]();});}};}function handleEntityNotFound(_0x2f2e63,_0x298763){return function(_0xf1f7d0){if(!_0xf1f7d0){_0x2f2e63[_0x3542('0x19')](0x194);}return _0xf1f7d0;};}function handleError(_0x1e156e,_0x18dc6c){_0x18dc6c=_0x18dc6c||0x1f4;return function(_0x2841a1){logger[_0x3542('0x25')](_0x2841a1[_0x3542('0x26')]);if(_0x2841a1[_0x3542('0x27')]){delete _0x2841a1[_0x3542('0x27')];}_0x1e156e[_0x3542('0x1a')](_0x18dc6c)[_0x3542('0x28')](_0x2841a1);};}exports[_0x3542('0x29')]=function(_0x20eda1,_0x3bd666){var _0x5590a2={},_0x31ad47={},_0x35bbc9={'count':0x0,'rows':[]};var _0x2aec76=_['map'](db[_0x3542('0x2a')][_0x3542('0x2b')],function(_0x2e883a){return{'name':_0x2e883a[_0x3542('0x2c')],'type':_0x2e883a['type']['key']};});_0x31ad47[_0x3542('0x2d')]=_[_0x3542('0x2e')](_0x2aec76,_0x3542('0x27'));_0x31ad47[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x20eda1[_0x3542('0x2f')]);_0x31ad47[_0x3542('0x31')]=_['intersection'](_0x31ad47['model'],_0x31ad47[_0x3542('0x2f')]);_0x5590a2['attributes']=_['intersection'](_0x31ad47[_0x3542('0x2d')],qs['fields'](_0x20eda1['query'][_0x3542('0x32')]));_0x5590a2[_0x3542('0x33')]=_0x5590a2[_0x3542('0x33')]['length']?_0x5590a2[_0x3542('0x33')]:_0x31ad47['model'];if(!_0x20eda1[_0x3542('0x2f')][_0x3542('0x34')]('nolimit')){_0x5590a2[_0x3542('0x1e')]=qs['limit'](_0x20eda1[_0x3542('0x2f')][_0x3542('0x1e')]);_0x5590a2[_0x3542('0x1d')]=qs['offset'](_0x20eda1[_0x3542('0x2f')]['offset']);}_0x5590a2[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x20eda1[_0x3542('0x2f')][_0x3542('0x36')]);_0x5590a2[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x20eda1[_0x3542('0x2f')],_0x31ad47[_0x3542('0x31')]),_0x2aec76);if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]){_0x5590a2[_0x3542('0x37')]=_[_0x3542('0x3a')](_0x5590a2['where'],{'$or':_[_0x3542('0x2e')](_0x2aec76,function(_0x4a80ea){if(_0x4a80ea['type']!==_0x3542('0x3b')){var _0x3ffccc={};_0x3ffccc[_0x4a80ea[_0x3542('0x27')]]={'$like':'%'+_0x20eda1[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x3ffccc;}})});}_0x5590a2=_[_0x3542('0x3a')]({},_0x5590a2,_0x20eda1[_0x3542('0x3c')]);var _0x42e87a={'where':_0x5590a2['where']};return db[_0x3542('0x2a')]['count'](_0x42e87a)[_0x3542('0x24')](function(_0x2baa01){_0x35bbc9['count']=_0x2baa01;if(_0x20eda1[_0x3542('0x2f')][_0x3542('0x3d')]){_0x5590a2['include']=[{'all':!![]}];}return db[_0x3542('0x2a')][_0x3542('0x3e')](_0x5590a2);})['then'](function(_0x2682d0){_0x35bbc9[_0x3542('0x3f')]=_0x2682d0;return _0x35bbc9;})[_0x3542('0x24')](respondWithFilteredResult(_0x3bd666,_0x5590a2))[_0x3542('0x40')](handleError(_0x3bd666,null));};exports[_0x3542('0x41')]=function(_0xb12441,_0x2b54b9){var _0x4bf45a={'raw':![],'where':{'id':_0xb12441[_0x3542('0x42')]['id']}},_0x542e0c={};_0x542e0c[_0x3542('0x2d')]=_[_0x3542('0x30')](db[_0x3542('0x2a')][_0x3542('0x2b')]);_0x542e0c['query']=_[_0x3542('0x30')](_0xb12441['query']);_0x542e0c[_0x3542('0x31')]=_[_0x3542('0x43')](_0x542e0c[_0x3542('0x2d')],_0x542e0c['query']);_0x4bf45a[_0x3542('0x33')]=_[_0x3542('0x43')](_0x542e0c['model'],qs[_0x3542('0x32')](_0xb12441[_0x3542('0x2f')][_0x3542('0x32')]));_0x4bf45a[_0x3542('0x33')]=_0x4bf45a[_0x3542('0x33')][_0x3542('0x44')]?_0x4bf45a[_0x3542('0x33')]:_0x542e0c[_0x3542('0x2d')];if(_0xb12441['query']['includeAll']){_0x4bf45a['include']=[{'all':!![]}];}_0x4bf45a=_[_0x3542('0x3a')]({},_0x4bf45a,_0xb12441[_0x3542('0x3c')]);return db[_0x3542('0x2a')][_0x3542('0x45')](_0x4bf45a)[_0x3542('0x24')](handleEntityNotFound(_0x2b54b9,null))[_0x3542('0x24')](respondWithResult(_0x2b54b9,null))[_0x3542('0x40')](handleError(_0x2b54b9,null));};exports['create']=function(_0x157683,_0x14b960){return db[_0x3542('0x2a')][_0x3542('0x46')](_0x157683['body'],{})[_0x3542('0x24')](respondWithResult(_0x14b960,0xc9))[_0x3542('0x40')](handleError(_0x14b960,null));};exports['update']=function(_0x528f8c,_0x1fb253){if(_0x528f8c[_0x3542('0x47')]['id']){delete _0x528f8c[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x528f8c[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x1fb253,null))['then'](saveUpdates(_0x528f8c[_0x3542('0x47')],null))[_0x3542('0x24')](respondWithResult(_0x1fb253,null))[_0x3542('0x40')](handleError(_0x1fb253,null));};exports[_0x3542('0x48')]=function(_0x1ebc82,_0x28be34){return db[_0x3542('0x2a')][_0x3542('0x45')]({'where':{'id':_0x1ebc82[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x28be34,null))['then'](removeEntity(_0x28be34,null))[_0x3542('0x40')](handleError(_0x28be34,null));};exports['getConfigurations']=function(_0x5a798a,_0x572e7a,_0x286222){var _0xd5c5c3={};var _0x381885={};var _0x48cfc4;var _0x2db495;return db[_0x3542('0x2a')]['findOne']({'where':{'id':_0x5a798a[_0x3542('0x42')]['id']}})[_0x3542('0x24')](handleEntityNotFound(_0x572e7a,null))[_0x3542('0x24')](function(_0x196c59){if(_0x196c59){_0x48cfc4=_0x196c59;_0x381885[_0x3542('0x2d')]=_['keys'](db[_0x3542('0x49')][_0x3542('0x2b')]);_0x381885[_0x3542('0x2f')]=_[_0x3542('0x30')](_0x5a798a[_0x3542('0x2f')]);_0x381885['filters']=_['intersection'](_0x381885[_0x3542('0x2d')],_0x381885[_0x3542('0x2f')]);_0xd5c5c3[_0x3542('0x33')]=_['intersection'](_0x381885[_0x3542('0x2d')],qs[_0x3542('0x32')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x32')]));_0xd5c5c3[_0x3542('0x33')]=_0xd5c5c3['attributes']['length']?_0xd5c5c3[_0x3542('0x33')]:_0x381885['model'];_0xd5c5c3[_0x3542('0x35')]=qs[_0x3542('0x36')](_0x5a798a['query'][_0x3542('0x36')]);_0xd5c5c3[_0x3542('0x37')]=qs[_0x3542('0x31')](_[_0x3542('0x38')](_0x5a798a[_0x3542('0x2f')],_0x381885['filters']));if(_0x5a798a['query'][_0x3542('0x39')]){_0xd5c5c3['where']=_[_0x3542('0x3a')](_0xd5c5c3[_0x3542('0x37')],{'$or':_[_0x3542('0x2e')](_0xd5c5c3['attributes'],function(_0xd9c90c){var _0x1f8ddb={};_0x1f8ddb[_0xd9c90c]={'$like':'%'+_0x5a798a[_0x3542('0x2f')][_0x3542('0x39')]+'%'};return _0x1f8ddb;})});}_0xd5c5c3=_[_0x3542('0x3a')]({},_0xd5c5c3,_0x5a798a[_0x3542('0x3c')]);return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})[_0x3542('0x24')](function(_0x3ee446){if(_0x3ee446){_0x2db495=_0x3ee446[_0x3542('0x44')];if(!_0x5a798a[_0x3542('0x2f')][_0x3542('0x34')](_0x3542('0x4a'))){_0xd5c5c3['limit']=qs[_0x3542('0x1e')](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1e')]);_0xd5c5c3[_0x3542('0x1d')]=qs['offset'](_0x5a798a[_0x3542('0x2f')][_0x3542('0x1d')]);}return _0x48cfc4['getConfigurations'](_0xd5c5c3);}})['then'](function(_0x2908e5){if(_0x2908e5){return _0x2908e5?{'count':_0x2db495,'rows':_0x2908e5}:null;}})['then'](respondWithResult(_0x572e7a,null))[_0x3542('0x40')](handleError(_0x572e7a,null));};exports['addConfiguration']=function(_0x484204,_0x42a34a,_0x471408){if(_0x484204[_0x3542('0x47')]['id']){delete _0x484204[_0x3542('0x47')]['id'];}return db[_0x3542('0x2a')][_0x3542('0x4b')]({'where':{'id':_0x484204[_0x3542('0x42')]['id']}})['then'](handleEntityNotFound(_0x42a34a,null))[_0x3542('0x24')](function(_0xf1cf57){if(_0xf1cf57){_0x484204[_0x3542('0x47')][_0x3542('0x4c')]=_0xf1cf57['id'];_0x484204[_0x3542('0x47')]['Subjects']=integrations[_0x3542('0x4d')](_0x484204[_0x3542('0x47')][_0x3542('0x4e')],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);_0x484204[_0x3542('0x47')][_0x3542('0x50')]=integrations['getDescriptions'](_0x484204[_0x3542('0x47')]['channel'],_0x484204[_0x3542('0x47')][_0x3542('0x4f')]);return db[_0x3542('0x49')][_0x3542('0x46')](_0x484204['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db[_0x3542('0x51')],'as':_0x3542('0x50')}]});}return null;})[_0x3542('0x24')](respondWithResult(_0x42a34a,null))[_0x3542('0x40')](handleError(_0x42a34a,null));};exports[_0x3542('0x52')]=function(_0x2afc71,_0x3c84fa,_0x77f0af){var _0x2b0de0='';return db['ZendeskAccount'][_0x3542('0x4b')]({'where':{'id':_0x2afc71[_0x3542('0x42')]['id']},'attributes':['id',_0x3542('0x53'),_0x3542('0x54'),_0x3542('0x55'),'authType','remoteUri']})[_0x3542('0x24')](handleEntityNotFound(_0x3c84fa,null))[_0x3542('0x24')](function(_0x52c26d){if(_0x52c26d){_0x2b0de0=_0x52c26d[_0x3542('0x56')];var _0x4b5327=_0x2b0de0[_0x3542('0x57')](-0x1);if(_0x4b5327==='/'){_0x2b0de0=_0x2b0de0['substring'](0x0,_0x2b0de0[_0x3542('0x58')](_0x4b5327));}var _0x153e1b={'method':'GET','uri':util['format']('%s/%s',_0x2b0de0,_0x3542('0x59')),'json':!![]};switch(_0x52c26d['authType']){case _0x3542('0x54'):_0x153e1b[_0x3542('0x5a')]={'Authorization':util['format'](_0x3542('0x5b'),new Buffer(util[_0x3542('0x5c')](_0x3542('0x5d'),_0x52c26d['username'],_0x52c26d[_0x3542('0x54')]))['toString'](_0x3542('0x5e')))};break;case'token':_0x153e1b[_0x3542('0x5a')]={'Authorization':util[_0x3542('0x5c')](_0x3542('0x5b'),new Buffer(util['format'](_0x3542('0x5f'),_0x52c26d[_0x3542('0x53')],_0x52c26d[_0x3542('0x55')]))[_0x3542('0x60')]('base64'))};break;default:throw new db['Sequelize'][(_0x3542('0x61'))](_0x3542('0x62'));}return rp(_0x153e1b);}})[_0x3542('0x24')](function(_0xaa97d5){if(_0xaa97d5){var _0x191fdd=[_0x3542('0x63'),_0x3542('0x64'),_0x3542('0x65'),_0x3542('0x66')];_[_0x3542('0x67')](_0xaa97d5[_0x3542('0x59')],function(_0x1c318c){return _0x191fdd[_0x3542('0x68')](_0x1c318c[_0x3542('0x4f')]);});return{'count':_0xaa97d5[_0x3542('0x59')][_0x3542('0x44')],'rows':_[_0x3542('0x2e')](_0xaa97d5[_0x3542('0x59')],function(_0x4e04b6){return{'id':_0x4e04b6['id'],'name':_0x4e04b6[_0x3542('0x69')]>0x7?_0x4e04b6[_0x3542('0x6a')]:_0x4e04b6['type'],'custom':_0x4e04b6['position']>0x7?!![]:![],'options':_0x4e04b6[_0x3542('0x6b')]?_0x4e04b6[_0x3542('0x6b')]:_0x4e04b6[_0x3542('0x6c')]?_0x4e04b6[_0x3542('0x6c')]:[]};})};}})['then'](respondWithResult(_0x3c84fa,null))[_0x3542('0x40')](function(_0x2d17ce){var _0x54e723=_0x2afc71[_0x3542('0x2f')]['test']?0x1f4:_0x2d17ce[_0x3542('0x6d')]||0x1f4;logger['error'](_0x3542('0x6e'),_0x3542('0x52'),_0x54e723,JSON[_0x3542('0x6f')](_0x2d17ce));delete _0x2d17ce[_0x3542('0x27')];if(_0x54e723===0x191){_0x54e723=0x190;}_0x3c84fa[_0x3542('0x1a')](_0x54e723)[_0x3542('0x28')](_0x2afc71[_0x3542('0x2f')]['test']?{'message':_0x3542('0x70'),'statusCode':_0x2d17ce['statusCode']}:_0x2d17ce);});};
\ No newline at end of file
+var _0xee5b=['model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','getSubjects','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','ticket_fields','%s:%s','toString','base64','headers','Basic\x20%s','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','includes','position','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','error','name','send','index','map','ZendeskAccount','rawAttributes','type'];(function(_0x66f9f9,_0x4e5148){var _0x83efea=function(_0x170509){while(--_0x170509){_0x66f9f9['push'](_0x66f9f9['shift']());}};_0x83efea(++_0x4e5148);}(_0xee5b,0x1f4));var _0xbee5=function(_0x431e38,_0x13f82c){_0x431e38=_0x431e38-0x0;var _0x43ee69=_0xee5b[_0x431e38];return _0x43ee69;};'use strict';var emlformat=require(_0xbee5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbee5('0x1'));var jsonpatch=require(_0xbee5('0x2'));var rp=require('request-promise');var moment=require(_0xbee5('0x3'));var BPromise=require(_0xbee5('0x4'));var Mustache=require(_0xbee5('0x5'));var util=require(_0xbee5('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xbee5('0x7'));var ejs=require(_0xbee5('0x8'));var fs=require('fs');var fs_extra=require(_0xbee5('0x9'));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 Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var licenseUtil=require(_0xbee5('0x15'));var db=require(_0xbee5('0x16'))['db'];var integrations=require(_0xbee5('0x17'));function respondWithStatusCode(_0x48f771,_0x14e032){_0x14e032=_0x14e032||0xcc;return function(_0x532a78){if(_0x532a78){return _0x48f771[_0xbee5('0x18')](_0x14e032);}return _0x48f771[_0xbee5('0x19')](_0x14e032)[_0xbee5('0x1a')]();};}function respondWithResult(_0x593ecb,_0x5092f2){_0x5092f2=_0x5092f2||0xc8;return function(_0x3c6e56){if(_0x3c6e56){return _0x593ecb['status'](_0x5092f2)[_0xbee5('0x1b')](_0x3c6e56);}};}function respondWithFilteredResult(_0x5426c9,_0x1a24bd){return function(_0x141878){if(_0x141878){var _0xf676b1=typeof _0x1a24bd['offset']===_0xbee5('0x1c')&&typeof _0x1a24bd[_0xbee5('0x1d')]==='undefined';var _0x254dd3=_0x141878[_0xbee5('0x1e')];var _0x11b4a3=_0xf676b1?0x0:_0x1a24bd[_0xbee5('0x1f')];var _0x35eb5c=_0xf676b1?_0x141878[_0xbee5('0x1e')]:_0x1a24bd[_0xbee5('0x1f')]+_0x1a24bd[_0xbee5('0x1d')];var _0x20cf52;if(_0x35eb5c>=_0x254dd3){_0x35eb5c=_0x254dd3;_0x20cf52=0xc8;}else{_0x20cf52=0xce;}_0x5426c9[_0xbee5('0x19')](_0x20cf52);return _0x5426c9[_0xbee5('0x20')](_0xbee5('0x21'),_0x11b4a3+'-'+_0x35eb5c+'/'+_0x254dd3)[_0xbee5('0x1b')](_0x141878);}return null;};}function patchUpdates(_0x40a06){return function(_0x450824){try{jsonpatch['apply'](_0x450824,_0x40a06,!![]);}catch(_0x550325){return BPromise[_0xbee5('0x22')](_0x550325);}return _0x450824['save']();};}function saveUpdates(_0x205491,_0x117cb3){return function(_0x3cee7f){if(_0x3cee7f){return _0x3cee7f[_0xbee5('0x23')](_0x205491)[_0xbee5('0x24')](function(_0xb665df){return _0xb665df;});}return null;};}function removeEntity(_0x359ccf,_0x3cfa8d){return function(_0xc79035){if(_0xc79035){return _0xc79035['destroy']()['then'](function(){_0x359ccf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d774,_0x1af3de){return function(_0x18d7f4){if(!_0x18d7f4){_0x50d774[_0xbee5('0x18')](0x194);}return _0x18d7f4;};}function handleError(_0x28c74d,_0x169042){_0x169042=_0x169042||0x1f4;return function(_0x20e7e8){logger[_0xbee5('0x25')](_0x20e7e8['stack']);if(_0x20e7e8[_0xbee5('0x26')]){delete _0x20e7e8[_0xbee5('0x26')];}_0x28c74d[_0xbee5('0x19')](_0x169042)[_0xbee5('0x27')](_0x20e7e8);};}exports[_0xbee5('0x28')]=function(_0x5f0419,_0x21b993){var _0x15ffb1={},_0xb7a077={},_0x136a00={'count':0x0,'rows':[]};var _0xa57f85=_[_0xbee5('0x29')](db[_0xbee5('0x2a')][_0xbee5('0x2b')],function(_0x2ccb91){return{'name':_0x2ccb91['fieldName'],'type':_0x2ccb91[_0xbee5('0x2c')]['key']};});_0xb7a077[_0xbee5('0x2d')]=_['map'](_0xa57f85,_0xbee5('0x26'));_0xb7a077['query']=_[_0xbee5('0x2e')](_0x5f0419['query']);_0xb7a077[_0xbee5('0x2f')]=_[_0xbee5('0x30')](_0xb7a077[_0xbee5('0x2d')],_0xb7a077[_0xbee5('0x31')]);_0x15ffb1['attributes']=_[_0xbee5('0x30')](_0xb7a077[_0xbee5('0x2d')],qs[_0xbee5('0x32')](_0x5f0419[_0xbee5('0x31')]['fields']));_0x15ffb1[_0xbee5('0x33')]=_0x15ffb1[_0xbee5('0x33')][_0xbee5('0x34')]?_0x15ffb1[_0xbee5('0x33')]:_0xb7a077['model'];if(!_0x5f0419[_0xbee5('0x31')][_0xbee5('0x35')](_0xbee5('0x36'))){_0x15ffb1[_0xbee5('0x1d')]=qs['limit'](_0x5f0419[_0xbee5('0x31')]['limit']);_0x15ffb1[_0xbee5('0x1f')]=qs['offset'](_0x5f0419['query']['offset']);}_0x15ffb1[_0xbee5('0x37')]=qs[_0xbee5('0x38')](_0x5f0419[_0xbee5('0x31')][_0xbee5('0x38')]);_0x15ffb1[_0xbee5('0x39')]=qs[_0xbee5('0x2f')](_[_0xbee5('0x3a')](_0x5f0419[_0xbee5('0x31')],_0xb7a077['filters']),_0xa57f85);if(_0x5f0419[_0xbee5('0x31')]['filter']){_0x15ffb1[_0xbee5('0x39')]=_[_0xbee5('0x3b')](_0x15ffb1[_0xbee5('0x39')],{'$or':_[_0xbee5('0x29')](_0xa57f85,function(_0x4a89ac){if(_0x4a89ac[_0xbee5('0x2c')]!=='VIRTUAL'){var _0x565e9f={};_0x565e9f[_0x4a89ac[_0xbee5('0x26')]]={'$like':'%'+_0x5f0419[_0xbee5('0x31')][_0xbee5('0x3c')]+'%'};return _0x565e9f;}})});}_0x15ffb1=_[_0xbee5('0x3b')]({},_0x15ffb1,_0x5f0419['options']);var _0xf3dd5={'where':_0x15ffb1[_0xbee5('0x39')]};return db[_0xbee5('0x2a')][_0xbee5('0x1e')](_0xf3dd5)[_0xbee5('0x24')](function(_0x25cf17){_0x136a00[_0xbee5('0x1e')]=_0x25cf17;if(_0x5f0419[_0xbee5('0x31')][_0xbee5('0x3d')]){_0x15ffb1[_0xbee5('0x3e')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xbee5('0x3f')](_0x15ffb1);})[_0xbee5('0x24')](function(_0x5637e0){_0x136a00[_0xbee5('0x40')]=_0x5637e0;return _0x136a00;})[_0xbee5('0x24')](respondWithFilteredResult(_0x21b993,_0x15ffb1))[_0xbee5('0x41')](handleError(_0x21b993,null));};exports[_0xbee5('0x42')]=function(_0x4dad75,_0x4cfe54){var _0x4b4641={'raw':![],'where':{'id':_0x4dad75[_0xbee5('0x43')]['id']}},_0x138a40={};_0x138a40[_0xbee5('0x2d')]=_[_0xbee5('0x2e')](db[_0xbee5('0x2a')][_0xbee5('0x2b')]);_0x138a40[_0xbee5('0x31')]=_[_0xbee5('0x2e')](_0x4dad75[_0xbee5('0x31')]);_0x138a40['filters']=_['intersection'](_0x138a40[_0xbee5('0x2d')],_0x138a40['query']);_0x4b4641[_0xbee5('0x33')]=_[_0xbee5('0x30')](_0x138a40['model'],qs[_0xbee5('0x32')](_0x4dad75[_0xbee5('0x31')]['fields']));_0x4b4641['attributes']=_0x4b4641[_0xbee5('0x33')][_0xbee5('0x34')]?_0x4b4641['attributes']:_0x138a40[_0xbee5('0x2d')];if(_0x4dad75[_0xbee5('0x31')]['includeAll']){_0x4b4641[_0xbee5('0x3e')]=[{'all':!![]}];}_0x4b4641=_[_0xbee5('0x3b')]({},_0x4b4641,_0x4dad75[_0xbee5('0x44')]);return db[_0xbee5('0x2a')][_0xbee5('0x45')](_0x4b4641)[_0xbee5('0x24')](handleEntityNotFound(_0x4cfe54,null))[_0xbee5('0x24')](respondWithResult(_0x4cfe54,null))['catch'](handleError(_0x4cfe54,null));};exports[_0xbee5('0x46')]=function(_0x34f01d,_0x27ea7b){return db[_0xbee5('0x2a')]['create'](_0x34f01d[_0xbee5('0x47')],{})[_0xbee5('0x24')](respondWithResult(_0x27ea7b,0xc9))[_0xbee5('0x41')](handleError(_0x27ea7b,null));};exports['update']=function(_0x44d4b1,_0xf637bf){if(_0x44d4b1['body']['id']){delete _0x44d4b1['body']['id'];}return db['ZendeskAccount'][_0xbee5('0x45')]({'where':{'id':_0x44d4b1['params']['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0xf637bf,null))[_0xbee5('0x24')](saveUpdates(_0x44d4b1[_0xbee5('0x47')],null))[_0xbee5('0x24')](respondWithResult(_0xf637bf,null))[_0xbee5('0x41')](handleError(_0xf637bf,null));};exports[_0xbee5('0x48')]=function(_0x55e654,_0x24274d){return db[_0xbee5('0x2a')][_0xbee5('0x45')]({'where':{'id':_0x55e654[_0xbee5('0x43')]['id']}})['then'](handleEntityNotFound(_0x24274d,null))[_0xbee5('0x24')](removeEntity(_0x24274d,null))['catch'](handleError(_0x24274d,null));};exports[_0xbee5('0x49')]=function(_0x45d114,_0xf48059,_0x22c51){var _0x2484c7={};var _0x1b02eb={};var _0xe8902;var _0x35f1d1;return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x45d114[_0xbee5('0x43')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0xf48059,null))[_0xbee5('0x24')](function(_0x359738){if(_0x359738){_0xe8902=_0x359738;_0x1b02eb[_0xbee5('0x2d')]=_['keys'](db[_0xbee5('0x4b')][_0xbee5('0x2b')]);_0x1b02eb[_0xbee5('0x31')]=_['keys'](_0x45d114[_0xbee5('0x31')]);_0x1b02eb[_0xbee5('0x2f')]=_[_0xbee5('0x30')](_0x1b02eb['model'],_0x1b02eb[_0xbee5('0x31')]);_0x2484c7['attributes']=_[_0xbee5('0x30')](_0x1b02eb['model'],qs[_0xbee5('0x32')](_0x45d114[_0xbee5('0x31')][_0xbee5('0x32')]));_0x2484c7['attributes']=_0x2484c7['attributes']['length']?_0x2484c7[_0xbee5('0x33')]:_0x1b02eb[_0xbee5('0x2d')];_0x2484c7[_0xbee5('0x37')]=qs['sort'](_0x45d114[_0xbee5('0x31')]['sort']);_0x2484c7[_0xbee5('0x39')]=qs[_0xbee5('0x2f')](_[_0xbee5('0x3a')](_0x45d114['query'],_0x1b02eb[_0xbee5('0x2f')]));if(_0x45d114[_0xbee5('0x31')][_0xbee5('0x3c')]){_0x2484c7[_0xbee5('0x39')]=_[_0xbee5('0x3b')](_0x2484c7[_0xbee5('0x39')],{'$or':_[_0xbee5('0x29')](_0x2484c7[_0xbee5('0x33')],function(_0x22fc1a){var _0x111027={};_0x111027[_0x22fc1a]={'$like':'%'+_0x45d114[_0xbee5('0x31')][_0xbee5('0x3c')]+'%'};return _0x111027;})});}_0x2484c7=_[_0xbee5('0x3b')]({},_0x2484c7,_0x45d114[_0xbee5('0x44')]);return _0xe8902[_0xbee5('0x49')](_0x2484c7);}})[_0xbee5('0x24')](function(_0x32a8d2){if(_0x32a8d2){_0x35f1d1=_0x32a8d2['length'];if(!_0x45d114[_0xbee5('0x31')]['hasOwnProperty']('nolimit')){_0x2484c7[_0xbee5('0x1d')]=qs[_0xbee5('0x1d')](_0x45d114['query']['limit']);_0x2484c7[_0xbee5('0x1f')]=qs['offset'](_0x45d114[_0xbee5('0x31')][_0xbee5('0x1f')]);}return _0xe8902['getConfigurations'](_0x2484c7);}})[_0xbee5('0x24')](function(_0x1a98c9){if(_0x1a98c9){return _0x1a98c9?{'count':_0x35f1d1,'rows':_0x1a98c9}:null;}})[_0xbee5('0x24')](respondWithResult(_0xf48059,null))[_0xbee5('0x41')](handleError(_0xf48059,null));};exports['addConfiguration']=function(_0x205784,_0x4ad4b5,_0x3294f1){if(_0x205784[_0xbee5('0x47')]['id']){delete _0x205784['body']['id'];}return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x205784['params']['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x4ad4b5,null))[_0xbee5('0x24')](function(_0x4f431e){if(_0x4f431e){_0x205784[_0xbee5('0x47')]['AccountId']=_0x4f431e['id'];_0x205784[_0xbee5('0x47')]['Subjects']=integrations[_0xbee5('0x4c')](_0x205784['body']['channel'],_0x205784[_0xbee5('0x47')][_0xbee5('0x2c')]);_0x205784[_0xbee5('0x47')][_0xbee5('0x4d')]=integrations[_0xbee5('0x4e')](_0x205784[_0xbee5('0x47')]['channel'],_0x205784[_0xbee5('0x47')][_0xbee5('0x2c')]);return db[_0xbee5('0x4b')][_0xbee5('0x46')](_0x205784[_0xbee5('0x47')],{'include':[{'model':db[_0xbee5('0x4f')],'as':_0xbee5('0x50')},{'model':db[_0xbee5('0x4f')],'as':_0xbee5('0x4d')}]});}return null;})['then'](respondWithResult(_0x4ad4b5,null))[_0xbee5('0x41')](handleError(_0x4ad4b5,null));};exports[_0xbee5('0x51')]=function(_0x43452f,_0x274a2c,_0x59fe10){var _0x13e84a='';return db[_0xbee5('0x2a')][_0xbee5('0x4a')]({'where':{'id':_0x43452f[_0xbee5('0x43')]['id']},'attributes':['id',_0xbee5('0x52'),_0xbee5('0x53'),_0xbee5('0x54'),_0xbee5('0x55'),_0xbee5('0x56')]})[_0xbee5('0x24')](handleEntityNotFound(_0x274a2c,null))[_0xbee5('0x24')](function(_0x24cd85){if(_0x24cd85){_0x13e84a=_0x24cd85['remoteUri'];var _0x20a9d2=_0x13e84a[_0xbee5('0x57')](-0x1);if(_0x20a9d2==='/'){_0x13e84a=_0x13e84a['substring'](0x0,_0x13e84a[_0xbee5('0x58')](_0x20a9d2));}var _0x56ceeb={'method':_0xbee5('0x59'),'uri':util[_0xbee5('0x5a')]('%s/%s',_0x13e84a,_0xbee5('0x5b')),'json':!![]};switch(_0x24cd85['authType']){case'password':_0x56ceeb['headers']={'Authorization':util['format']('Basic\x20%s',new Buffer(util['format'](_0xbee5('0x5c'),_0x24cd85[_0xbee5('0x52')],_0x24cd85[_0xbee5('0x53')]))[_0xbee5('0x5d')](_0xbee5('0x5e')))};break;case _0xbee5('0x54'):_0x56ceeb[_0xbee5('0x5f')]={'Authorization':util[_0xbee5('0x5a')](_0xbee5('0x60'),new Buffer(util[_0xbee5('0x5a')](_0xbee5('0x61'),_0x24cd85[_0xbee5('0x52')],_0x24cd85['token']))[_0xbee5('0x5d')](_0xbee5('0x5e')))};break;default:throw new db['Sequelize']['ValidationError'](_0xbee5('0x62'));}return rp(_0x56ceeb);}})[_0xbee5('0x24')](function(_0x39cc65){if(_0x39cc65){var _0x5e5cba=[_0xbee5('0x63'),_0xbee5('0x64'),_0xbee5('0x65'),'assignee'];_['remove'](_0x39cc65['ticket_fields'],function(_0x3b0d82){return _0x5e5cba[_0xbee5('0x66')](_0x3b0d82[_0xbee5('0x2c')]);});return{'count':_0x39cc65[_0xbee5('0x5b')][_0xbee5('0x34')],'rows':_[_0xbee5('0x29')](_0x39cc65[_0xbee5('0x5b')],function(_0x435b75){return{'id':_0x435b75['id'],'name':_0x435b75['position']>0x7?_0x435b75['title']:_0x435b75[_0xbee5('0x2c')],'custom':_0x435b75[_0xbee5('0x67')]>0x7?!![]:![],'options':_0x435b75['system_field_options']?_0x435b75['system_field_options']:_0x435b75[_0xbee5('0x68')]?_0x435b75['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x274a2c,null))[_0xbee5('0x41')](function(_0x525472){var _0x2b4ac9=_0x43452f[_0xbee5('0x31')]['test']?0x1f4:_0x525472[_0xbee5('0x69')]||0x1f4;logger[_0xbee5('0x25')](_0xbee5('0x6a'),_0xbee5('0x51'),_0x2b4ac9,JSON[_0xbee5('0x6b')](_0x525472));delete _0x525472['name'];if(_0x2b4ac9===0x191){_0x2b4ac9=0x190;}_0x274a2c['status'](_0x2b4ac9)[_0xbee5('0x27')](_0x43452f['query'][_0xbee5('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x525472[_0xbee5('0x69')]}:_0x525472);});};
\ No newline at end of file
index 2e19990..25b44e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69a9=['../../config/environment','./intZendeskAccount.attributes','int_zendesk_accounts','lodash','util','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69a9,0x10b));var _0x969a=function(_0x1719a7,_0x1bb043){_0x1719a7=_0x1719a7-0x0;var _0x1f3d99=_0x69a9[_0x1719a7];return _0x1f3d99;};'use strict';var _=require(_0x969a('0x0'));var util=require(_0x969a('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x969a('0x2'));var fs=require('fs');var path=require(_0x969a('0x3'));var rimraf=require(_0x969a('0x4'));var config=require(_0x969a('0x5'));var attributes=require(_0x969a('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e08b1,_0x3dfa98){return _0x4e08b1['define']('ZendeskAccount',attributes,{'tableName':_0x969a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xac73=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts'];(function(_0x3c9be8,_0x2badf4){var _0x23a29b=function(_0x4f17af){while(--_0x4f17af){_0x3c9be8['push'](_0x3c9be8['shift']());}};_0x23a29b(++_0x2badf4);}(_0xac73,0x12b));var _0x3ac7=function(_0x24bfae,_0x1ffa10){_0x24bfae=_0x24bfae-0x0;var _0x515bdc=_0xac73[_0x24bfae];return _0x515bdc;};'use strict';var _=require('lodash');var util=require(_0x3ac7('0x0'));var logger=require(_0x3ac7('0x1'))('api');var moment=require(_0x3ac7('0x2'));var BPromise=require(_0x3ac7('0x3'));var rp=require(_0x3ac7('0x4'));var fs=require('fs');var path=require(_0x3ac7('0x5'));var rimraf=require(_0x3ac7('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ac7('0x7'));var integrations=require(_0x3ac7('0x8'));module[_0x3ac7('0x9')]=function(_0x328e29,_0xb42c41){return _0x328e29[_0x3ac7('0xa')](_0x3ac7('0xb'),attributes,{'tableName':_0x3ac7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a2ec618..3caaef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c22=['message','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','model','map','GetZendeskAccount','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x4222bc,_0x1446a9){var _0x4cdf21=function(_0x34df8d){while(--_0x34df8d){_0x4222bc['push'](_0x4222bc['shift']());}};_0x4cdf21(++_0x1446a9);}(_0x3c22,0x184));var _0x23c2=function(_0x447ee8,_0x5d795e){_0x447ee8=_0x447ee8-0x0;var _0x21b967=_0x3c22[_0x447ee8];return _0x21b967;};'use strict';var _=require(_0x23c2('0x0'));var util=require(_0x23c2('0x1'));var moment=require('moment');var BPromise=require(_0x23c2('0x2'));var rs=require(_0x23c2('0x3'));var fs=require('fs');var Redis=require(_0x23c2('0x4'));var db=require(_0x23c2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c2('0x6'))('rpc');var config=require(_0x23c2('0x7'));var jayson=require(_0x23c2('0x8'));var client=jayson[_0x23c2('0x9')][_0x23c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa8f188,_0x49824d,_0x50c667){return new BPromise(function(_0x1f3739,_0x4ff16d){return client[_0x23c2('0xb')](_0xa8f188,_0x50c667)[_0x23c2('0xc')](function(_0x4bd481){logger[_0x23c2('0xd')](_0x23c2('0xe'),_0x49824d,_0x23c2('0xf'));logger[_0x23c2('0x10')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x49824d,_0x23c2('0xf'),JSON[_0x23c2('0x11')](_0x4bd481));if(_0x4bd481[_0x23c2('0x12')]){if(_0x4bd481[_0x23c2('0x12')][_0x23c2('0x13')]===0x1f4){logger['error'](_0x23c2('0xe'),_0x49824d,_0x4bd481[_0x23c2('0x12')]['message']);return _0x4ff16d(_0x4bd481[_0x23c2('0x12')][_0x23c2('0x14')]);}logger['error'](_0x23c2('0xe'),_0x49824d,_0x4bd481[_0x23c2('0x12')][_0x23c2('0x14')]);return _0x1f3739(_0x4bd481[_0x23c2('0x12')][_0x23c2('0x14')]);}else{logger[_0x23c2('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x49824d,'request\x20sent');_0x1f3739(_0x4bd481['result'][_0x23c2('0x14')]);}})[_0x23c2('0x15')](function(_0x4866eb){logger[_0x23c2('0x12')](_0x23c2('0xe'),_0x49824d,_0x4866eb);_0x4ff16d(_0x4866eb);});});}exports['GetZendeskAccount']=function(_0x24337a){var _0x535f3e=this;return new Promise(function(_0x4b0ecf,_0x646253){return db[_0x23c2('0x16')][_0x23c2('0x17')]({'raw':_0x24337a['options']?_0x24337a[_0x23c2('0x18')][_0x23c2('0x19')]===undefined?!![]:![]:!![],'where':_0x24337a[_0x23c2('0x18')]?_0x24337a['options'][_0x23c2('0x1a')]||null:null,'attributes':_0x24337a[_0x23c2('0x18')]?_0x24337a[_0x23c2('0x18')][_0x23c2('0x1b')]||null:null,'limit':_0x24337a[_0x23c2('0x18')]?_0x24337a[_0x23c2('0x18')]['limit']||null:null,'include':_0x24337a[_0x23c2('0x18')]?_0x24337a[_0x23c2('0x18')][_0x23c2('0x1c')]?_['map'](_0x24337a['options'][_0x23c2('0x1c')],function(_0x2b89a2){return{'model':db[_0x2b89a2[_0x23c2('0x1d')]],'as':_0x2b89a2['as'],'attributes':_0x2b89a2['attributes'],'include':_0x2b89a2[_0x23c2('0x1c')]?_[_0x23c2('0x1e')](_0x2b89a2[_0x23c2('0x1c')],function(_0x3e0905){return{'model':db[_0x3e0905[_0x23c2('0x1d')]],'as':_0x3e0905['as'],'attributes':_0x3e0905[_0x23c2('0x1b')],'include':_0x3e0905[_0x23c2('0x1c')]?_[_0x23c2('0x1e')](_0x3e0905[_0x23c2('0x1c')],function(_0x3324b1){return{'model':db[_0x3324b1['model']],'as':_0x3324b1['as'],'attributes':_0x3324b1[_0x23c2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x23c2('0xc')](function(_0x411e75){logger[_0x23c2('0xd')](_0x23c2('0x1f'),_0x24337a);logger[_0x23c2('0x10')](_0x23c2('0x1f'),_0x24337a,JSON[_0x23c2('0x11')](_0x411e75));_0x4b0ecf(_0x411e75);})[_0x23c2('0x15')](function(_0x4c2b17){logger[_0x23c2('0x12')]('GetZendeskAccount',_0x4c2b17[_0x23c2('0x14')],_0x24337a);_0x646253(_0x535f3e[_0x23c2('0x12')](0x1f4,_0x4c2b17['message']));});});};exports[_0x23c2('0x20')]=function(_0x21f0b5){var _0xe3589=this;return new Promise(function(_0x32df7f,_0x5a189f){return db[_0x23c2('0x16')][_0x23c2('0x21')]({'raw':_0x21f0b5[_0x23c2('0x18')]?_0x21f0b5[_0x23c2('0x18')][_0x23c2('0x19')]===undefined?!![]:![]:!![],'where':_0x21f0b5[_0x23c2('0x18')]?_0x21f0b5[_0x23c2('0x18')]['where']||null:null,'attributes':_0x21f0b5[_0x23c2('0x18')]?_0x21f0b5[_0x23c2('0x18')][_0x23c2('0x1b')]||null:null,'include':_0x21f0b5['options']?_0x21f0b5['options']['include']?_[_0x23c2('0x1e')](_0x21f0b5['options']['include'],function(_0x38b701){return{'model':db[_0x38b701[_0x23c2('0x1d')]],'as':_0x38b701['as'],'attributes':_0x38b701[_0x23c2('0x1b')],'include':_0x38b701['include']?_[_0x23c2('0x1e')](_0x38b701['include'],function(_0xa186d6){return{'model':db[_0xa186d6[_0x23c2('0x1d')]],'as':_0xa186d6['as'],'attributes':_0xa186d6[_0x23c2('0x1b')],'include':_0xa186d6[_0x23c2('0x1c')]?_[_0x23c2('0x1e')](_0xa186d6[_0x23c2('0x1c')],function(_0xd4b38){return{'model':db[_0xd4b38[_0x23c2('0x1d')]],'as':_0xd4b38['as'],'attributes':_0xd4b38['attributes']};}):[]};}):[]};}):[]:[]})[_0x23c2('0xc')](function(_0x344772){logger[_0x23c2('0xd')](_0x23c2('0x20'),_0x21f0b5);logger['debug'](_0x23c2('0x20'),_0x21f0b5,JSON[_0x23c2('0x11')](_0x344772));_0x32df7f(_0x344772);})[_0x23c2('0x15')](function(_0x43ea89){logger[_0x23c2('0x12')](_0x23c2('0x20'),_0x43ea89[_0x23c2('0x14')],_0x21f0b5);_0x5a189f(_0xe3589[_0x23c2('0x12')](0x1f4,_0x43ea89[_0x23c2('0x14')]));});});};
\ No newline at end of file
+var _0x2de0=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','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','raw','where','attributes','include','map','model','then','GetZendeskAccount','ShowZendeskAccount','find'];(function(_0x3214d3,_0x5068ad){var _0x1099fb=function(_0x419373){while(--_0x419373){_0x3214d3['push'](_0x3214d3['shift']());}};_0x1099fb(++_0x5068ad);}(_0x2de0,0x1ea));var _0x02de=function(_0x24941e,_0x688f91){_0x24941e=_0x24941e-0x0;var _0x3767ec=_0x2de0[_0x24941e];return _0x3767ec;};'use strict';var _=require('lodash');var util=require(_0x02de('0x0'));var moment=require(_0x02de('0x1'));var BPromise=require(_0x02de('0x2'));var rs=require(_0x02de('0x3'));var fs=require('fs');var Redis=require(_0x02de('0x4'));var db=require(_0x02de('0x5'))['db'];var utils=require(_0x02de('0x6'));var logger=require('../../config/logger')(_0x02de('0x7'));var config=require(_0x02de('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x02de('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x393c14,_0x8f67ca,_0x3799b9){return new BPromise(function(_0x18ead4,_0x136874){return client[_0x02de('0xa')](_0x393c14,_0x3799b9)['then'](function(_0x54a00a){logger[_0x02de('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x8f67ca,_0x02de('0xc'));logger[_0x02de('0xd')](_0x02de('0xe'),_0x8f67ca,_0x02de('0xc'),JSON[_0x02de('0xf')](_0x54a00a));if(_0x54a00a[_0x02de('0x10')]){if(_0x54a00a['error'][_0x02de('0x11')]===0x1f4){logger[_0x02de('0x10')](_0x02de('0x12'),_0x8f67ca,_0x54a00a[_0x02de('0x10')]['message']);return _0x136874(_0x54a00a[_0x02de('0x10')][_0x02de('0x13')]);}logger['error'](_0x02de('0x12'),_0x8f67ca,_0x54a00a[_0x02de('0x10')][_0x02de('0x13')]);return _0x18ead4(_0x54a00a[_0x02de('0x10')]['message']);}else{logger[_0x02de('0xb')](_0x02de('0x12'),_0x8f67ca,_0x02de('0xc'));_0x18ead4(_0x54a00a[_0x02de('0x14')][_0x02de('0x13')]);}})[_0x02de('0x15')](function(_0x23984c){logger[_0x02de('0x10')](_0x02de('0x12'),_0x8f67ca,_0x23984c);_0x136874(_0x23984c);});});}exports['GetZendeskAccount']=function(_0x4d9ed2){var _0xaf6750=this;return new Promise(function(_0x2af996,_0x194e5b){return db[_0x02de('0x16')][_0x02de('0x17')]({'raw':_0x4d9ed2[_0x02de('0x18')]?_0x4d9ed2[_0x02de('0x18')][_0x02de('0x19')]===undefined?!![]:![]:!![],'where':_0x4d9ed2[_0x02de('0x18')]?_0x4d9ed2['options'][_0x02de('0x1a')]||null:null,'attributes':_0x4d9ed2[_0x02de('0x18')]?_0x4d9ed2[_0x02de('0x18')][_0x02de('0x1b')]||null:null,'limit':_0x4d9ed2[_0x02de('0x18')]?_0x4d9ed2['options']['limit']||null:null,'include':_0x4d9ed2[_0x02de('0x18')]?_0x4d9ed2[_0x02de('0x18')][_0x02de('0x1c')]?_[_0x02de('0x1d')](_0x4d9ed2['options'][_0x02de('0x1c')],function(_0x37b0c6){return{'model':db[_0x37b0c6[_0x02de('0x1e')]],'as':_0x37b0c6['as'],'attributes':_0x37b0c6[_0x02de('0x1b')],'include':_0x37b0c6[_0x02de('0x1c')]?_[_0x02de('0x1d')](_0x37b0c6[_0x02de('0x1c')],function(_0x201ed5){return{'model':db[_0x201ed5[_0x02de('0x1e')]],'as':_0x201ed5['as'],'attributes':_0x201ed5[_0x02de('0x1b')],'include':_0x201ed5[_0x02de('0x1c')]?_[_0x02de('0x1d')](_0x201ed5[_0x02de('0x1c')],function(_0x28d104){return{'model':db[_0x28d104[_0x02de('0x1e')]],'as':_0x28d104['as'],'attributes':_0x28d104[_0x02de('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x02de('0x1f')](function(_0x1f8aa9){logger['info'](_0x02de('0x20'),_0x4d9ed2);logger[_0x02de('0xd')]('GetZendeskAccount',_0x4d9ed2,JSON[_0x02de('0xf')](_0x1f8aa9));_0x2af996(_0x1f8aa9);})['catch'](function(_0x5ddf12){logger[_0x02de('0x10')](_0x02de('0x20'),_0x5ddf12[_0x02de('0x13')],_0x4d9ed2);_0x194e5b(_0xaf6750[_0x02de('0x10')](0x1f4,_0x5ddf12[_0x02de('0x13')]));});});};exports[_0x02de('0x21')]=function(_0x1c746c){var _0x2a8cff=this;return new Promise(function(_0x4cdd6e,_0x22d4d0){return db[_0x02de('0x16')][_0x02de('0x22')]({'raw':_0x1c746c[_0x02de('0x18')]?_0x1c746c['options'][_0x02de('0x19')]===undefined?!![]:![]:!![],'where':_0x1c746c[_0x02de('0x18')]?_0x1c746c[_0x02de('0x18')]['where']||null:null,'attributes':_0x1c746c['options']?_0x1c746c[_0x02de('0x18')][_0x02de('0x1b')]||null:null,'include':_0x1c746c[_0x02de('0x18')]?_0x1c746c[_0x02de('0x18')]['include']?_['map'](_0x1c746c[_0x02de('0x18')][_0x02de('0x1c')],function(_0x1d0a0b){return{'model':db[_0x1d0a0b[_0x02de('0x1e')]],'as':_0x1d0a0b['as'],'attributes':_0x1d0a0b[_0x02de('0x1b')],'include':_0x1d0a0b[_0x02de('0x1c')]?_['map'](_0x1d0a0b[_0x02de('0x1c')],function(_0x51aae6){return{'model':db[_0x51aae6[_0x02de('0x1e')]],'as':_0x51aae6['as'],'attributes':_0x51aae6[_0x02de('0x1b')],'include':_0x51aae6['include']?_[_0x02de('0x1d')](_0x51aae6[_0x02de('0x1c')],function(_0x3a1ae0){return{'model':db[_0x3a1ae0[_0x02de('0x1e')]],'as':_0x3a1ae0['as'],'attributes':_0x3a1ae0['attributes']};}):[]};}):[]};}):[]:[]})[_0x02de('0x1f')](function(_0x31941b){logger[_0x02de('0xb')](_0x02de('0x21'),_0x1c746c);logger[_0x02de('0xd')](_0x02de('0x21'),_0x1c746c,JSON[_0x02de('0xf')](_0x31941b));_0x4cdd6e(_0x31941b);})['catch'](function(_0x390d57){logger['error'](_0x02de('0x21'),_0x390d57[_0x02de('0x13')],_0x1c746c);_0x22d4d0(_0x2a8cff['error'](0x1f4,_0x390d57[_0x02de('0x13')]));});});};
\ No newline at end of file
index 2d2c674..9b559dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x304730,_0x483b78){var _0xe27bbf=function(_0xec4003){while(--_0xec4003){_0x304730['push'](_0x304730['shift']());}};_0xe27bbf(++_0x483b78);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x107f10,_0x5529f2){_0x107f10=_0x107f10-0x0;var _0x811cab=_0xcb91[_0x107f10];return _0x811cab;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router;
\ No newline at end of file
+var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x9709ce,_0x5765af){var _0x414c87=function(_0x51149b){while(--_0x51149b){_0x9709ce['push'](_0x9709ce['shift']());}};_0x414c87(++_0x5765af);}(_0x4483,0x1a3));var _0x3448=function(_0x5c1d80,_0x2d0390){_0x5c1d80=_0x5c1d80-0x0;var _0x860512=_0x4483[_0x5c1d80];return _0x860512;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router;
\ No newline at end of file
index c240797..6ebcad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb631=['STRING','sequelize','exports'];(function(_0x19a6cb,_0x791ec6){var _0x247064=function(_0x2aa5e9){while(--_0x2aa5e9){_0x19a6cb['push'](_0x19a6cb['shift']());}};_0x247064(++_0x791ec6);}(_0xb631,0x1b4));var _0x1b63=function(_0x2dbd81,_0x350d36){_0x2dbd81=_0x2dbd81-0x0;var _0x2be0fa=_0xb631[_0x2dbd81];return _0x2be0fa;};'use strict';var Sequelize=require(_0x1b63('0x0'));module[_0x1b63('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1b63('0x2')]}};
\ No newline at end of file
+var _0x6e93=['STRING','sequelize','exports'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x6e93,0xb8));var _0x36e9=function(_0x4f8296,_0x2a9e02){_0x4f8296=_0x4f8296-0x0;var _0x1c276a=_0x6e93[_0x4f8296];return _0x1c276a;};'use strict';var Sequelize=require(_0x36e9('0x0'));module[_0x36e9('0x1')]={'name':{'type':Sequelize[_0x36e9('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 43d9424..5235cff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4495=['ZendeskField','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','model','keys','query','filters','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','intersection','includeAll','include','find','create','body','getFields','findOne','nolimit','getSubjects'];(function(_0x12104a,_0x4f1445){var _0x408ef7=function(_0xed833f){while(--_0xed833f){_0x12104a['push'](_0x12104a['shift']());}};_0x408ef7(++_0x4f1445);}(_0x4495,0x106));var _0x5449=function(_0x3871d9,_0x270f85){_0x3871d9=_0x3871d9-0x0;var _0x491888=_0x4495[_0x3871d9];return _0x491888;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5449('0x0'));var jsonpatch=require(_0x5449('0x1'));var rp=require(_0x5449('0x2'));var moment=require(_0x5449('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5449('0x4'));var path=require(_0x5449('0x5'));var sox=require(_0x5449('0x6'));var csv=require(_0x5449('0x7'));var ejs=require(_0x5449('0x8'));var fs=require('fs');var fs_extra=require(_0x5449('0x9'));var _=require(_0x5449('0xa'));var squel=require('squel');var crypto=require(_0x5449('0xb'));var jsforce=require(_0x5449('0xc'));var deskjs=require(_0x5449('0xd'));var toCsv=require(_0x5449('0x7'));var querystring=require(_0x5449('0xe'));var Papa=require(_0x5449('0xf'));var Redis=require(_0x5449('0x10'));var authService=require(_0x5449('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5449('0x12'));var hardwareService=require(_0x5449('0x13'));var logger=require(_0x5449('0x14'))(_0x5449('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5449('0x16'));var db=require(_0x5449('0x17'))['db'];function respondWithStatusCode(_0x2a055f,_0x4932a5){_0x4932a5=_0x4932a5||0xcc;return function(_0x16a0ae){if(_0x16a0ae){return _0x2a055f[_0x5449('0x18')](_0x4932a5);}return _0x2a055f['status'](_0x4932a5)[_0x5449('0x19')]();};}function respondWithResult(_0x9ac136,_0x5ee288){_0x5ee288=_0x5ee288||0xc8;return function(_0x446b9c){if(_0x446b9c){return _0x9ac136[_0x5449('0x1a')](_0x5ee288)[_0x5449('0x1b')](_0x446b9c);}};}function respondWithFilteredResult(_0x29d1ab,_0x4d11cb){return function(_0x192e1a){if(_0x192e1a){var _0x12de21=typeof _0x4d11cb[_0x5449('0x1c')]==='undefined'&&typeof _0x4d11cb[_0x5449('0x1d')]===_0x5449('0x1e');var _0x349018=_0x192e1a[_0x5449('0x1f')];var _0x57df03=_0x12de21?0x0:_0x4d11cb['offset'];var _0x3c4357=_0x12de21?_0x192e1a[_0x5449('0x1f')]:_0x4d11cb[_0x5449('0x1c')]+_0x4d11cb[_0x5449('0x1d')];var _0x4ee75b;if(_0x3c4357>=_0x349018){_0x3c4357=_0x349018;_0x4ee75b=0xc8;}else{_0x4ee75b=0xce;}_0x29d1ab['status'](_0x4ee75b);return _0x29d1ab[_0x5449('0x20')](_0x5449('0x21'),_0x57df03+'-'+_0x3c4357+'/'+_0x349018)[_0x5449('0x1b')](_0x192e1a);}return null;};}function patchUpdates(_0x396adf){return function(_0x252a54){try{jsonpatch[_0x5449('0x22')](_0x252a54,_0x396adf,!![]);}catch(_0x52c5ad){return BPromise[_0x5449('0x23')](_0x52c5ad);}return _0x252a54[_0x5449('0x24')]();};}function saveUpdates(_0x5d88da,_0x426db0){return function(_0x422823){if(_0x422823){return _0x422823[_0x5449('0x25')](_0x5d88da)[_0x5449('0x26')](function(_0x37fcfd){return _0x37fcfd;});}return null;};}function removeEntity(_0x1e7a91,_0x4d1d36){return function(_0xed6c9f){if(_0xed6c9f){return _0xed6c9f[_0x5449('0x27')]()[_0x5449('0x26')](function(){_0x1e7a91[_0x5449('0x1a')](0xcc)[_0x5449('0x19')]();});}};}function handleEntityNotFound(_0xc828ef,_0x37abd1){return function(_0x31adb4){if(!_0x31adb4){_0xc828ef[_0x5449('0x18')](0x194);}return _0x31adb4;};}function handleError(_0x9b0ee7,_0x36a384){_0x36a384=_0x36a384||0x1f4;return function(_0x4620a9){logger[_0x5449('0x28')](_0x4620a9[_0x5449('0x29')]);if(_0x4620a9[_0x5449('0x2a')]){delete _0x4620a9['name'];}_0x9b0ee7['status'](_0x36a384)[_0x5449('0x2b')](_0x4620a9);};}exports[_0x5449('0x2c')]=function(_0xbce113,_0x5601e5){var _0x39baf3={},_0xfbfbfd={},_0x5bc21e={'count':0x0,'rows':[]};var _0x4791b8=_[_0x5449('0x2d')](db[_0x5449('0x2e')][_0x5449('0x2f')],function(_0x40d5a7){return{'name':_0x40d5a7[_0x5449('0x30')],'type':_0x40d5a7['type']['key']};});_0xfbfbfd[_0x5449('0x31')]=_['map'](_0x4791b8,'name');_0xfbfbfd['query']=_[_0x5449('0x32')](_0xbce113[_0x5449('0x33')]);_0xfbfbfd[_0x5449('0x34')]=_['intersection'](_0xfbfbfd[_0x5449('0x31')],_0xfbfbfd[_0x5449('0x33')]);_0x39baf3['attributes']=_['intersection'](_0xfbfbfd[_0x5449('0x31')],qs[_0x5449('0x35')](_0xbce113['query'][_0x5449('0x35')]));_0x39baf3['attributes']=_0x39baf3[_0x5449('0x36')][_0x5449('0x37')]?_0x39baf3[_0x5449('0x36')]:_0xfbfbfd[_0x5449('0x31')];if(!_0xbce113[_0x5449('0x33')]['hasOwnProperty']('nolimit')){_0x39baf3[_0x5449('0x1d')]=qs[_0x5449('0x1d')](_0xbce113[_0x5449('0x33')][_0x5449('0x1d')]);_0x39baf3['offset']=qs[_0x5449('0x1c')](_0xbce113[_0x5449('0x33')][_0x5449('0x1c')]);}_0x39baf3[_0x5449('0x38')]=qs[_0x5449('0x39')](_0xbce113['query'][_0x5449('0x39')]);_0x39baf3[_0x5449('0x3a')]=qs[_0x5449('0x34')](_[_0x5449('0x3b')](_0xbce113[_0x5449('0x33')],_0xfbfbfd['filters']),_0x4791b8);if(_0xbce113[_0x5449('0x33')][_0x5449('0x3c')]){_0x39baf3[_0x5449('0x3a')]=_[_0x5449('0x3d')](_0x39baf3[_0x5449('0x3a')],{'$or':_[_0x5449('0x2d')](_0x4791b8,function(_0x4b4206){if(_0x4b4206['type']!==_0x5449('0x3e')){var _0x1ee550={};_0x1ee550[_0x4b4206[_0x5449('0x2a')]]={'$like':'%'+_0xbce113['query']['filter']+'%'};return _0x1ee550;}})});}_0x39baf3=_['merge']({},_0x39baf3,_0xbce113[_0x5449('0x3f')]);var _0x5c2f5e={'where':_0x39baf3[_0x5449('0x3a')]};return db['ZendeskConfiguration']['count'](_0x5c2f5e)[_0x5449('0x26')](function(_0x1debc1){_0x5bc21e[_0x5449('0x1f')]=_0x1debc1;if(_0xbce113[_0x5449('0x33')]['includeAll']){_0x39baf3['include']=[{'all':!![]}];}return db[_0x5449('0x2e')]['findAll'](_0x39baf3);})['then'](function(_0x45b76f){_0x5bc21e[_0x5449('0x40')]=_0x45b76f;return _0x5bc21e;})[_0x5449('0x26')](respondWithFilteredResult(_0x5601e5,_0x39baf3))[_0x5449('0x41')](handleError(_0x5601e5,null));};exports[_0x5449('0x42')]=function(_0x5c1ce7,_0x441b69){var _0xa2befa={'raw':![],'where':{'id':_0x5c1ce7[_0x5449('0x43')]['id']}},_0x52eeaa={};_0x52eeaa[_0x5449('0x31')]=_[_0x5449('0x32')](db[_0x5449('0x2e')][_0x5449('0x2f')]);_0x52eeaa[_0x5449('0x33')]=_['keys'](_0x5c1ce7[_0x5449('0x33')]);_0x52eeaa[_0x5449('0x34')]=_[_0x5449('0x44')](_0x52eeaa[_0x5449('0x31')],_0x52eeaa[_0x5449('0x33')]);_0xa2befa[_0x5449('0x36')]=_[_0x5449('0x44')](_0x52eeaa[_0x5449('0x31')],qs['fields'](_0x5c1ce7[_0x5449('0x33')][_0x5449('0x35')]));_0xa2befa[_0x5449('0x36')]=_0xa2befa['attributes']['length']?_0xa2befa['attributes']:_0x52eeaa[_0x5449('0x31')];if(_0x5c1ce7[_0x5449('0x33')][_0x5449('0x45')]){_0xa2befa[_0x5449('0x46')]=[{'all':!![]}];}_0xa2befa=_[_0x5449('0x3d')]({},_0xa2befa,_0x5c1ce7[_0x5449('0x3f')]);return db[_0x5449('0x2e')][_0x5449('0x47')](_0xa2befa)[_0x5449('0x26')](handleEntityNotFound(_0x441b69,null))['then'](respondWithResult(_0x441b69,null))[_0x5449('0x41')](handleError(_0x441b69,null));};exports[_0x5449('0x48')]=function(_0x43aa6c,_0x490ad0){return db['ZendeskConfiguration'][_0x5449('0x48')](_0x43aa6c[_0x5449('0x49')],{})[_0x5449('0x26')](respondWithResult(_0x490ad0,0xc9))[_0x5449('0x41')](handleError(_0x490ad0,null));};exports['update']=function(_0x551415,_0x1a3cd6){if(_0x551415[_0x5449('0x49')]['id']){delete _0x551415[_0x5449('0x49')]['id'];}return db[_0x5449('0x2e')][_0x5449('0x47')]({'where':{'id':_0x551415['params']['id']}})[_0x5449('0x26')](handleEntityNotFound(_0x1a3cd6,null))[_0x5449('0x26')](saveUpdates(_0x551415['body'],null))[_0x5449('0x26')](respondWithResult(_0x1a3cd6,null))['catch'](handleError(_0x1a3cd6,null));};exports[_0x5449('0x27')]=function(_0xd46568,_0x1158ba){return db[_0x5449('0x2e')][_0x5449('0x47')]({'where':{'id':_0xd46568['params']['id']}})[_0x5449('0x26')](handleEntityNotFound(_0x1158ba,null))['then'](removeEntity(_0x1158ba,null))[_0x5449('0x41')](handleError(_0x1158ba,null));};exports[_0x5449('0x4a')]=function(_0x57e54a,_0xd4fce9,_0x41b188){var _0x2eec8b={};var _0x45bb21={};var _0x533c18;var _0x469a0b;return db[_0x5449('0x2e')][_0x5449('0x4b')]({'where':{'id':_0x57e54a['params']['id']}})['then'](handleEntityNotFound(_0xd4fce9,null))['then'](function(_0x297c78){if(_0x297c78){_0x533c18=_0x297c78;_0x45bb21[_0x5449('0x31')]=_[_0x5449('0x32')](db['ZendeskField'][_0x5449('0x2f')]);_0x45bb21[_0x5449('0x33')]=_[_0x5449('0x32')](_0x57e54a[_0x5449('0x33')]);_0x45bb21[_0x5449('0x34')]=_[_0x5449('0x44')](_0x45bb21['model'],_0x45bb21[_0x5449('0x33')]);_0x2eec8b[_0x5449('0x36')]=_[_0x5449('0x44')](_0x45bb21['model'],qs[_0x5449('0x35')](_0x57e54a[_0x5449('0x33')][_0x5449('0x35')]));_0x2eec8b[_0x5449('0x36')]=_0x2eec8b[_0x5449('0x36')][_0x5449('0x37')]?_0x2eec8b[_0x5449('0x36')]:_0x45bb21[_0x5449('0x31')];_0x2eec8b[_0x5449('0x38')]=qs[_0x5449('0x39')](_0x57e54a['query'][_0x5449('0x39')]);_0x2eec8b[_0x5449('0x3a')]=qs[_0x5449('0x34')](_['pick'](_0x57e54a['query'],_0x45bb21['filters']));if(_0x57e54a['query'][_0x5449('0x3c')]){_0x2eec8b[_0x5449('0x3a')]=_[_0x5449('0x3d')](_0x2eec8b['where'],{'$or':_['map'](_0x2eec8b['attributes'],function(_0x2a566c){var _0x328786={};_0x328786[_0x2a566c]={'$like':'%'+_0x57e54a[_0x5449('0x33')]['filter']+'%'};return _0x328786;})});}_0x2eec8b=_[_0x5449('0x3d')]({},_0x2eec8b,_0x57e54a[_0x5449('0x3f')]);return _0x533c18[_0x5449('0x4a')](_0x2eec8b);}})[_0x5449('0x26')](function(_0x6b0690){if(_0x6b0690){_0x469a0b=_0x6b0690[_0x5449('0x37')];if(!_0x57e54a[_0x5449('0x33')]['hasOwnProperty'](_0x5449('0x4c'))){_0x2eec8b[_0x5449('0x1d')]=qs[_0x5449('0x1d')](_0x57e54a[_0x5449('0x33')]['limit']);_0x2eec8b['offset']=qs[_0x5449('0x1c')](_0x57e54a[_0x5449('0x33')][_0x5449('0x1c')]);}return _0x533c18[_0x5449('0x4a')](_0x2eec8b);}})[_0x5449('0x26')](function(_0x682065){if(_0x682065){return _0x682065?{'count':_0x469a0b,'rows':_0x682065}:null;}})['then'](respondWithResult(_0xd4fce9,null))[_0x5449('0x41')](handleError(_0xd4fce9,null));};exports[_0x5449('0x4d')]=function(_0x24b6ef,_0x429f67,_0x2b22c1){var _0x496496={};var _0xe083c7={};var _0x110bc1;var _0x337ace;return db[_0x5449('0x2e')][_0x5449('0x4b')]({'where':{'id':_0x24b6ef[_0x5449('0x43')]['id']}})['then'](handleEntityNotFound(_0x429f67,null))[_0x5449('0x26')](function(_0x282bad){if(_0x282bad){_0x110bc1=_0x282bad;_0xe083c7[_0x5449('0x31')]=_['keys'](db[_0x5449('0x4e')]['rawAttributes']);_0xe083c7[_0x5449('0x33')]=_[_0x5449('0x32')](_0x24b6ef[_0x5449('0x33')]);_0xe083c7[_0x5449('0x34')]=_[_0x5449('0x44')](_0xe083c7[_0x5449('0x31')],_0xe083c7[_0x5449('0x33')]);_0x496496[_0x5449('0x36')]=_[_0x5449('0x44')](_0xe083c7['model'],qs[_0x5449('0x35')](_0x24b6ef['query'][_0x5449('0x35')]));_0x496496[_0x5449('0x36')]=_0x496496[_0x5449('0x36')][_0x5449('0x37')]?_0x496496[_0x5449('0x36')]:_0xe083c7[_0x5449('0x31')];_0x496496[_0x5449('0x38')]=qs[_0x5449('0x39')](_0x24b6ef[_0x5449('0x33')][_0x5449('0x39')]);_0x496496[_0x5449('0x3a')]=qs[_0x5449('0x34')](_[_0x5449('0x3b')](_0x24b6ef[_0x5449('0x33')],_0xe083c7[_0x5449('0x34')]));if(_0x24b6ef[_0x5449('0x33')]['filter']){_0x496496[_0x5449('0x3a')]=_[_0x5449('0x3d')](_0x496496[_0x5449('0x3a')],{'$or':_['map'](_0x496496[_0x5449('0x36')],function(_0xa9d864){var _0xe2750f={};_0xe2750f[_0xa9d864]={'$like':'%'+_0x24b6ef[_0x5449('0x33')][_0x5449('0x3c')]+'%'};return _0xe2750f;})});}_0x496496=_[_0x5449('0x3d')]({},_0x496496,_0x24b6ef[_0x5449('0x3f')]);return _0x110bc1[_0x5449('0x4d')](_0x496496);}})[_0x5449('0x26')](function(_0xda2caf){if(_0xda2caf){_0x337ace=_0xda2caf['length'];if(!_0x24b6ef['query'][_0x5449('0x4f')](_0x5449('0x4c'))){_0x496496['limit']=qs[_0x5449('0x1d')](_0x24b6ef['query'][_0x5449('0x1d')]);_0x496496[_0x5449('0x1c')]=qs[_0x5449('0x1c')](_0x24b6ef[_0x5449('0x33')][_0x5449('0x1c')]);}return _0x110bc1[_0x5449('0x4d')](_0x496496);}})['then'](function(_0x68408){if(_0x68408){return _0x68408?{'count':_0x337ace,'rows':_0x68408}:null;}})['then'](respondWithResult(_0x429f67,null))[_0x5449('0x41')](handleError(_0x429f67,null));};exports['getDescriptions']=function(_0x42911f,_0x416d11,_0x11be66){var _0x42c0d1={};var _0x11cded={};var _0xa4bea6;var _0x431ded;return db[_0x5449('0x2e')][_0x5449('0x4b')]({'where':{'id':_0x42911f['params']['id']}})[_0x5449('0x26')](handleEntityNotFound(_0x416d11,null))[_0x5449('0x26')](function(_0x2bf500){if(_0x2bf500){_0xa4bea6=_0x2bf500;_0x11cded[_0x5449('0x31')]=_['keys'](db[_0x5449('0x4e')]['rawAttributes']);_0x11cded['query']=_[_0x5449('0x32')](_0x42911f[_0x5449('0x33')]);_0x11cded[_0x5449('0x34')]=_[_0x5449('0x44')](_0x11cded[_0x5449('0x31')],_0x11cded[_0x5449('0x33')]);_0x42c0d1[_0x5449('0x36')]=_[_0x5449('0x44')](_0x11cded[_0x5449('0x31')],qs[_0x5449('0x35')](_0x42911f[_0x5449('0x33')][_0x5449('0x35')]));_0x42c0d1[_0x5449('0x36')]=_0x42c0d1[_0x5449('0x36')]['length']?_0x42c0d1['attributes']:_0x11cded[_0x5449('0x31')];_0x42c0d1[_0x5449('0x38')]=qs[_0x5449('0x39')](_0x42911f['query'][_0x5449('0x39')]);_0x42c0d1[_0x5449('0x3a')]=qs['filters'](_['pick'](_0x42911f[_0x5449('0x33')],_0x11cded[_0x5449('0x34')]));if(_0x42911f['query'][_0x5449('0x3c')]){_0x42c0d1[_0x5449('0x3a')]=_[_0x5449('0x3d')](_0x42c0d1[_0x5449('0x3a')],{'$or':_['map'](_0x42c0d1[_0x5449('0x36')],function(_0x1abe3f){var _0xaff97f={};_0xaff97f[_0x1abe3f]={'$like':'%'+_0x42911f[_0x5449('0x33')][_0x5449('0x3c')]+'%'};return _0xaff97f;})});}_0x42c0d1=_['merge']({},_0x42c0d1,_0x42911f[_0x5449('0x3f')]);return _0xa4bea6[_0x5449('0x50')](_0x42c0d1);}})[_0x5449('0x26')](function(_0x44748d){if(_0x44748d){_0x431ded=_0x44748d['length'];if(!_0x42911f[_0x5449('0x33')]['hasOwnProperty'](_0x5449('0x4c'))){_0x42c0d1['limit']=qs[_0x5449('0x1d')](_0x42911f[_0x5449('0x33')][_0x5449('0x1d')]);_0x42c0d1[_0x5449('0x1c')]=qs['offset'](_0x42911f[_0x5449('0x33')][_0x5449('0x1c')]);}return _0xa4bea6[_0x5449('0x50')](_0x42c0d1);}})['then'](function(_0x4064d4){if(_0x4064d4){return _0x4064d4?{'count':_0x431ded,'rows':_0x4064d4}:null;}})['then'](respondWithResult(_0x416d11,null))[_0x5449('0x41')](handleError(_0x416d11,null));};exports['getTags']=function(_0x46d483,_0x572a95,_0x3bb2b9){var _0x480512={};var _0x380ed0={};var _0x4139be;var _0x35d9f8;return db[_0x5449('0x2e')][_0x5449('0x4b')]({'where':{'id':_0x46d483['params']['id']}})['then'](handleEntityNotFound(_0x572a95,null))['then'](function(_0x160228){if(_0x160228){_0x4139be=_0x160228;_0x380ed0[_0x5449('0x31')]=_[_0x5449('0x32')](db[_0x5449('0x51')][_0x5449('0x2f')]);_0x380ed0[_0x5449('0x33')]=_['keys'](_0x46d483[_0x5449('0x33')]);_0x380ed0['filters']=_['intersection'](_0x380ed0[_0x5449('0x31')],_0x380ed0[_0x5449('0x33')]);_0x480512[_0x5449('0x36')]=_['intersection'](_0x380ed0[_0x5449('0x31')],qs[_0x5449('0x35')](_0x46d483[_0x5449('0x33')][_0x5449('0x35')]));_0x480512[_0x5449('0x36')]=_0x480512[_0x5449('0x36')][_0x5449('0x37')]?_0x480512[_0x5449('0x36')]:_0x380ed0[_0x5449('0x31')];_0x480512['order']=qs[_0x5449('0x39')](_0x46d483[_0x5449('0x33')][_0x5449('0x39')]);_0x480512[_0x5449('0x3a')]=qs[_0x5449('0x34')](_[_0x5449('0x3b')](_0x46d483['query'],_0x380ed0[_0x5449('0x34')]));if(_0x46d483['query']['filter']){_0x480512[_0x5449('0x3a')]=_[_0x5449('0x3d')](_0x480512[_0x5449('0x3a')],{'$or':_[_0x5449('0x2d')](_0x480512['attributes'],function(_0x3f5574){var _0x2b8027={};_0x2b8027[_0x3f5574]={'$like':'%'+_0x46d483[_0x5449('0x33')][_0x5449('0x3c')]+'%'};return _0x2b8027;})});}_0x480512=_[_0x5449('0x3d')]({},_0x480512,_0x46d483[_0x5449('0x3f')]);return _0x4139be[_0x5449('0x52')](_0x480512);}})['then'](function(_0x4939dd){if(_0x4939dd){_0x35d9f8=_0x4939dd[_0x5449('0x37')];if(!_0x46d483['query'][_0x5449('0x4f')]('nolimit')){_0x480512[_0x5449('0x1d')]=qs[_0x5449('0x1d')](_0x46d483[_0x5449('0x33')][_0x5449('0x1d')]);_0x480512[_0x5449('0x1c')]=qs[_0x5449('0x1c')](_0x46d483[_0x5449('0x33')][_0x5449('0x1c')]);}return _0x4139be[_0x5449('0x52')](_0x480512);}})[_0x5449('0x26')](function(_0x16342d){if(_0x16342d){return _0x16342d?{'count':_0x35d9f8,'rows':_0x16342d}:null;}})['then'](respondWithResult(_0x572a95,null))[_0x5449('0x41')](handleError(_0x572a95,null));};exports[_0x5449('0x53')]=function(_0x629047,_0x181a1a,_0x4b3084){if(_0x629047[_0x5449('0x49')]['id']){delete _0x629047[_0x5449('0x49')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x629047[_0x5449('0x43')]['id']}})[_0x5449('0x26')](handleEntityNotFound(_0x181a1a,null))[_0x5449('0x26')](function(_0x14227c){if(_0x14227c){return _0x14227c[_0x5449('0x53')](_0x629047['body'][_0x5449('0x54')]||[]);}return null;})['then'](respondWithResult(_0x181a1a,null))[_0x5449('0x41')](handleError(_0x181a1a,null));};
\ No newline at end of file
+var _0x1d80=['path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','update','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util'];(function(_0x91f539,_0x442a0c){var _0x2e3bdd=function(_0x4f5ebd){while(--_0x4f5ebd){_0x91f539['push'](_0x91f539['shift']());}};_0x2e3bdd(++_0x442a0c);}(_0x1d80,0x145));var _0x01d8=function(_0x23f5ba,_0x4e2f4f){_0x23f5ba=_0x23f5ba-0x0;var _0x217c12=_0x1d80[_0x23f5ba];return _0x217c12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01d8('0x0'));var zipdir=require(_0x01d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01d8('0x2'));var moment=require(_0x01d8('0x3'));var BPromise=require(_0x01d8('0x4'));var Mustache=require(_0x01d8('0x5'));var util=require(_0x01d8('0x6'));var path=require(_0x01d8('0x7'));var sox=require(_0x01d8('0x8'));var csv=require(_0x01d8('0x9'));var ejs=require(_0x01d8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01d8('0xb'));var squel=require('squel');var crypto=require(_0x01d8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01d8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x01d8('0xe'));var Papa=require(_0x01d8('0xf'));var Redis=require(_0x01d8('0x10'));var authService=require(_0x01d8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x01d8('0x12'));var hardwareService=require(_0x01d8('0x13'));var logger=require(_0x01d8('0x14'))(_0x01d8('0x15'));var utils=require(_0x01d8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x01d8('0x17'))['db'];function respondWithStatusCode(_0xb8221e,_0x2e7a2d){_0x2e7a2d=_0x2e7a2d||0xcc;return function(_0x77f613){if(_0x77f613){return _0xb8221e[_0x01d8('0x18')](_0x2e7a2d);}return _0xb8221e[_0x01d8('0x19')](_0x2e7a2d)[_0x01d8('0x1a')]();};}function respondWithResult(_0x5cfe96,_0x42af65){_0x42af65=_0x42af65||0xc8;return function(_0x42b971){if(_0x42b971){return _0x5cfe96[_0x01d8('0x19')](_0x42af65)[_0x01d8('0x1b')](_0x42b971);}};}function respondWithFilteredResult(_0xa30f96,_0x36d396){return function(_0x1ffc0f){if(_0x1ffc0f){var _0x46e88f=typeof _0x36d396[_0x01d8('0x1c')]==='undefined'&&typeof _0x36d396[_0x01d8('0x1d')]==='undefined';var _0x435f36=_0x1ffc0f[_0x01d8('0x1e')];var _0x480d76=_0x46e88f?0x0:_0x36d396[_0x01d8('0x1c')];var _0x47151a=_0x46e88f?_0x1ffc0f[_0x01d8('0x1e')]:_0x36d396[_0x01d8('0x1c')]+_0x36d396[_0x01d8('0x1d')];var _0x32ad6b;if(_0x47151a>=_0x435f36){_0x47151a=_0x435f36;_0x32ad6b=0xc8;}else{_0x32ad6b=0xce;}_0xa30f96[_0x01d8('0x19')](_0x32ad6b);return _0xa30f96[_0x01d8('0x1f')]('Content-Range',_0x480d76+'-'+_0x47151a+'/'+_0x435f36)[_0x01d8('0x1b')](_0x1ffc0f);}return null;};}function patchUpdates(_0x875cf5){return function(_0x4e8e55){try{jsonpatch['apply'](_0x4e8e55,_0x875cf5,!![]);}catch(_0x13d9cc){return BPromise[_0x01d8('0x20')](_0x13d9cc);}return _0x4e8e55[_0x01d8('0x21')]();};}function saveUpdates(_0x23cd7b,_0xf121b4){return function(_0x252b54){if(_0x252b54){return _0x252b54['update'](_0x23cd7b)[_0x01d8('0x22')](function(_0x42bf86){return _0x42bf86;});}return null;};}function removeEntity(_0x55b27f,_0x4e6c04){return function(_0x2ac178){if(_0x2ac178){return _0x2ac178[_0x01d8('0x23')]()[_0x01d8('0x22')](function(){_0x55b27f['status'](0xcc)[_0x01d8('0x1a')]();});}};}function handleEntityNotFound(_0x3339c4,_0x3904c0){return function(_0xc54fdf){if(!_0xc54fdf){_0x3339c4[_0x01d8('0x18')](0x194);}return _0xc54fdf;};}function handleError(_0x38bfae,_0x3fa0eb){_0x3fa0eb=_0x3fa0eb||0x1f4;return function(_0x2fdbeb){logger[_0x01d8('0x24')](_0x2fdbeb[_0x01d8('0x25')]);if(_0x2fdbeb[_0x01d8('0x26')]){delete _0x2fdbeb[_0x01d8('0x26')];}_0x38bfae['status'](_0x3fa0eb)[_0x01d8('0x27')](_0x2fdbeb);};}exports[_0x01d8('0x28')]=function(_0xe81ed2,_0xcc5c86){var _0x11f37c={},_0x2ccc51={},_0x269303={'count':0x0,'rows':[]};var _0x39ff30=_[_0x01d8('0x29')](db[_0x01d8('0x2a')][_0x01d8('0x2b')],function(_0x1f68c7){return{'name':_0x1f68c7[_0x01d8('0x2c')],'type':_0x1f68c7['type'][_0x01d8('0x2d')]};});_0x2ccc51[_0x01d8('0x2e')]=_[_0x01d8('0x29')](_0x39ff30,'name');_0x2ccc51[_0x01d8('0x2f')]=_[_0x01d8('0x30')](_0xe81ed2[_0x01d8('0x2f')]);_0x2ccc51[_0x01d8('0x31')]=_[_0x01d8('0x32')](_0x2ccc51[_0x01d8('0x2e')],_0x2ccc51['query']);_0x11f37c[_0x01d8('0x33')]=_[_0x01d8('0x32')](_0x2ccc51['model'],qs['fields'](_0xe81ed2['query'][_0x01d8('0x34')]));_0x11f37c[_0x01d8('0x33')]=_0x11f37c[_0x01d8('0x33')][_0x01d8('0x35')]?_0x11f37c[_0x01d8('0x33')]:_0x2ccc51[_0x01d8('0x2e')];if(!_0xe81ed2[_0x01d8('0x2f')][_0x01d8('0x36')](_0x01d8('0x37'))){_0x11f37c['limit']=qs[_0x01d8('0x1d')](_0xe81ed2[_0x01d8('0x2f')][_0x01d8('0x1d')]);_0x11f37c[_0x01d8('0x1c')]=qs['offset'](_0xe81ed2['query'][_0x01d8('0x1c')]);}_0x11f37c[_0x01d8('0x38')]=qs[_0x01d8('0x39')](_0xe81ed2[_0x01d8('0x2f')][_0x01d8('0x39')]);_0x11f37c[_0x01d8('0x3a')]=qs[_0x01d8('0x31')](_[_0x01d8('0x3b')](_0xe81ed2[_0x01d8('0x2f')],_0x2ccc51[_0x01d8('0x31')]),_0x39ff30);if(_0xe81ed2['query'][_0x01d8('0x3c')]){_0x11f37c[_0x01d8('0x3a')]=_[_0x01d8('0x3d')](_0x11f37c[_0x01d8('0x3a')],{'$or':_['map'](_0x39ff30,function(_0x13cecb){if(_0x13cecb[_0x01d8('0x3e')]!==_0x01d8('0x3f')){var _0x5d5a78={};_0x5d5a78[_0x13cecb[_0x01d8('0x26')]]={'$like':'%'+_0xe81ed2[_0x01d8('0x2f')][_0x01d8('0x3c')]+'%'};return _0x5d5a78;}})});}_0x11f37c=_['merge']({},_0x11f37c,_0xe81ed2[_0x01d8('0x40')]);var _0x139d3c={'where':_0x11f37c[_0x01d8('0x3a')]};return db[_0x01d8('0x2a')][_0x01d8('0x1e')](_0x139d3c)[_0x01d8('0x22')](function(_0x564b2d){_0x269303['count']=_0x564b2d;if(_0xe81ed2[_0x01d8('0x2f')][_0x01d8('0x41')]){_0x11f37c['include']=[{'all':!![]}];}return db[_0x01d8('0x2a')][_0x01d8('0x42')](_0x11f37c);})[_0x01d8('0x22')](function(_0x550489){_0x269303[_0x01d8('0x43')]=_0x550489;return _0x269303;})[_0x01d8('0x22')](respondWithFilteredResult(_0xcc5c86,_0x11f37c))[_0x01d8('0x44')](handleError(_0xcc5c86,null));};exports[_0x01d8('0x45')]=function(_0x1316a2,_0x2a0619){var _0x1f8256={'raw':![],'where':{'id':_0x1316a2[_0x01d8('0x46')]['id']}},_0x57e50b={};_0x57e50b[_0x01d8('0x2e')]=_['keys'](db[_0x01d8('0x2a')][_0x01d8('0x2b')]);_0x57e50b[_0x01d8('0x2f')]=_['keys'](_0x1316a2[_0x01d8('0x2f')]);_0x57e50b[_0x01d8('0x31')]=_[_0x01d8('0x32')](_0x57e50b[_0x01d8('0x2e')],_0x57e50b[_0x01d8('0x2f')]);_0x1f8256[_0x01d8('0x33')]=_[_0x01d8('0x32')](_0x57e50b['model'],qs[_0x01d8('0x34')](_0x1316a2[_0x01d8('0x2f')]['fields']));_0x1f8256[_0x01d8('0x33')]=_0x1f8256['attributes'][_0x01d8('0x35')]?_0x1f8256[_0x01d8('0x33')]:_0x57e50b[_0x01d8('0x2e')];if(_0x1316a2[_0x01d8('0x2f')][_0x01d8('0x41')]){_0x1f8256['include']=[{'all':!![]}];}_0x1f8256=_[_0x01d8('0x3d')]({},_0x1f8256,_0x1316a2[_0x01d8('0x40')]);return db[_0x01d8('0x2a')][_0x01d8('0x47')](_0x1f8256)['then'](handleEntityNotFound(_0x2a0619,null))[_0x01d8('0x22')](respondWithResult(_0x2a0619,null))[_0x01d8('0x44')](handleError(_0x2a0619,null));};exports['create']=function(_0x53e328,_0x24bf14){return db[_0x01d8('0x2a')]['create'](_0x53e328['body'],{})[_0x01d8('0x22')](respondWithResult(_0x24bf14,0xc9))[_0x01d8('0x44')](handleError(_0x24bf14,null));};exports[_0x01d8('0x48')]=function(_0xbca96f,_0x48ab8c){if(_0xbca96f['body']['id']){delete _0xbca96f[_0x01d8('0x49')]['id'];}return db[_0x01d8('0x2a')][_0x01d8('0x47')]({'where':{'id':_0xbca96f[_0x01d8('0x46')]['id']}})['then'](handleEntityNotFound(_0x48ab8c,null))['then'](saveUpdates(_0xbca96f[_0x01d8('0x49')],null))[_0x01d8('0x22')](respondWithResult(_0x48ab8c,null))['catch'](handleError(_0x48ab8c,null));};exports[_0x01d8('0x23')]=function(_0x1b14cd,_0x468a1d){return db[_0x01d8('0x2a')][_0x01d8('0x47')]({'where':{'id':_0x1b14cd[_0x01d8('0x46')]['id']}})[_0x01d8('0x22')](handleEntityNotFound(_0x468a1d,null))[_0x01d8('0x22')](removeEntity(_0x468a1d,null))[_0x01d8('0x44')](handleError(_0x468a1d,null));};exports[_0x01d8('0x4a')]=function(_0x435921,_0x2e9601,_0x277bb6){var _0x414e69={};var _0x170cd8={};var _0x40c0f8;var _0x480c91;return db[_0x01d8('0x2a')][_0x01d8('0x4b')]({'where':{'id':_0x435921[_0x01d8('0x46')]['id']}})[_0x01d8('0x22')](handleEntityNotFound(_0x2e9601,null))[_0x01d8('0x22')](function(_0x3a7141){if(_0x3a7141){_0x40c0f8=_0x3a7141;_0x170cd8[_0x01d8('0x2e')]=_[_0x01d8('0x30')](db[_0x01d8('0x4c')][_0x01d8('0x2b')]);_0x170cd8[_0x01d8('0x2f')]=_['keys'](_0x435921[_0x01d8('0x2f')]);_0x170cd8[_0x01d8('0x31')]=_['intersection'](_0x170cd8['model'],_0x170cd8[_0x01d8('0x2f')]);_0x414e69[_0x01d8('0x33')]=_['intersection'](_0x170cd8[_0x01d8('0x2e')],qs['fields'](_0x435921[_0x01d8('0x2f')][_0x01d8('0x34')]));_0x414e69[_0x01d8('0x33')]=_0x414e69[_0x01d8('0x33')][_0x01d8('0x35')]?_0x414e69[_0x01d8('0x33')]:_0x170cd8[_0x01d8('0x2e')];_0x414e69[_0x01d8('0x38')]=qs[_0x01d8('0x39')](_0x435921[_0x01d8('0x2f')]['sort']);_0x414e69[_0x01d8('0x3a')]=qs[_0x01d8('0x31')](_[_0x01d8('0x3b')](_0x435921[_0x01d8('0x2f')],_0x170cd8[_0x01d8('0x31')]));if(_0x435921[_0x01d8('0x2f')][_0x01d8('0x3c')]){_0x414e69[_0x01d8('0x3a')]=_['merge'](_0x414e69[_0x01d8('0x3a')],{'$or':_['map'](_0x414e69['attributes'],function(_0x4c0587){var _0x45aa1b={};_0x45aa1b[_0x4c0587]={'$like':'%'+_0x435921[_0x01d8('0x2f')][_0x01d8('0x3c')]+'%'};return _0x45aa1b;})});}_0x414e69=_['merge']({},_0x414e69,_0x435921[_0x01d8('0x40')]);return _0x40c0f8[_0x01d8('0x4a')](_0x414e69);}})[_0x01d8('0x22')](function(_0x199aae){if(_0x199aae){_0x480c91=_0x199aae['length'];if(!_0x435921['query'][_0x01d8('0x36')]('nolimit')){_0x414e69[_0x01d8('0x1d')]=qs[_0x01d8('0x1d')](_0x435921[_0x01d8('0x2f')]['limit']);_0x414e69[_0x01d8('0x1c')]=qs[_0x01d8('0x1c')](_0x435921[_0x01d8('0x2f')][_0x01d8('0x1c')]);}return _0x40c0f8[_0x01d8('0x4a')](_0x414e69);}})[_0x01d8('0x22')](function(_0x374761){if(_0x374761){return _0x374761?{'count':_0x480c91,'rows':_0x374761}:null;}})['then'](respondWithResult(_0x2e9601,null))['catch'](handleError(_0x2e9601,null));};exports['getSubjects']=function(_0x449083,_0x2b7612,_0x18b4cc){var _0x415151={};var _0x2eeb70={};var _0xd5472f;var _0x10c590;return db['ZendeskConfiguration'][_0x01d8('0x4b')]({'where':{'id':_0x449083[_0x01d8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2b7612,null))[_0x01d8('0x22')](function(_0xd8cecd){if(_0xd8cecd){_0xd5472f=_0xd8cecd;_0x2eeb70[_0x01d8('0x2e')]=_[_0x01d8('0x30')](db[_0x01d8('0x4c')]['rawAttributes']);_0x2eeb70[_0x01d8('0x2f')]=_[_0x01d8('0x30')](_0x449083['query']);_0x2eeb70[_0x01d8('0x31')]=_[_0x01d8('0x32')](_0x2eeb70['model'],_0x2eeb70['query']);_0x415151[_0x01d8('0x33')]=_[_0x01d8('0x32')](_0x2eeb70[_0x01d8('0x2e')],qs[_0x01d8('0x34')](_0x449083[_0x01d8('0x2f')]['fields']));_0x415151[_0x01d8('0x33')]=_0x415151[_0x01d8('0x33')][_0x01d8('0x35')]?_0x415151[_0x01d8('0x33')]:_0x2eeb70[_0x01d8('0x2e')];_0x415151['order']=qs[_0x01d8('0x39')](_0x449083[_0x01d8('0x2f')]['sort']);_0x415151[_0x01d8('0x3a')]=qs[_0x01d8('0x31')](_['pick'](_0x449083[_0x01d8('0x2f')],_0x2eeb70[_0x01d8('0x31')]));if(_0x449083['query'][_0x01d8('0x3c')]){_0x415151[_0x01d8('0x3a')]=_[_0x01d8('0x3d')](_0x415151['where'],{'$or':_[_0x01d8('0x29')](_0x415151['attributes'],function(_0x5b3a88){var _0x1e7f0d={};_0x1e7f0d[_0x5b3a88]={'$like':'%'+_0x449083['query'][_0x01d8('0x3c')]+'%'};return _0x1e7f0d;})});}_0x415151=_[_0x01d8('0x3d')]({},_0x415151,_0x449083[_0x01d8('0x40')]);return _0xd5472f[_0x01d8('0x4d')](_0x415151);}})['then'](function(_0x129034){if(_0x129034){_0x10c590=_0x129034[_0x01d8('0x35')];if(!_0x449083[_0x01d8('0x2f')][_0x01d8('0x36')]('nolimit')){_0x415151[_0x01d8('0x1d')]=qs[_0x01d8('0x1d')](_0x449083[_0x01d8('0x2f')][_0x01d8('0x1d')]);_0x415151['offset']=qs[_0x01d8('0x1c')](_0x449083[_0x01d8('0x2f')][_0x01d8('0x1c')]);}return _0xd5472f[_0x01d8('0x4d')](_0x415151);}})['then'](function(_0x556842){if(_0x556842){return _0x556842?{'count':_0x10c590,'rows':_0x556842}:null;}})[_0x01d8('0x22')](respondWithResult(_0x2b7612,null))[_0x01d8('0x44')](handleError(_0x2b7612,null));};exports[_0x01d8('0x4e')]=function(_0x59c511,_0x1393ae,_0x457052){var _0x1c361b={};var _0x377569={};var _0x413c8c;var _0x4b28d2;return db[_0x01d8('0x2a')][_0x01d8('0x4b')]({'where':{'id':_0x59c511['params']['id']}})[_0x01d8('0x22')](handleEntityNotFound(_0x1393ae,null))[_0x01d8('0x22')](function(_0x4b000f){if(_0x4b000f){_0x413c8c=_0x4b000f;_0x377569['model']=_[_0x01d8('0x30')](db[_0x01d8('0x4c')][_0x01d8('0x2b')]);_0x377569[_0x01d8('0x2f')]=_[_0x01d8('0x30')](_0x59c511[_0x01d8('0x2f')]);_0x377569[_0x01d8('0x31')]=_[_0x01d8('0x32')](_0x377569[_0x01d8('0x2e')],_0x377569[_0x01d8('0x2f')]);_0x1c361b['attributes']=_['intersection'](_0x377569[_0x01d8('0x2e')],qs[_0x01d8('0x34')](_0x59c511[_0x01d8('0x2f')][_0x01d8('0x34')]));_0x1c361b[_0x01d8('0x33')]=_0x1c361b['attributes'][_0x01d8('0x35')]?_0x1c361b[_0x01d8('0x33')]:_0x377569[_0x01d8('0x2e')];_0x1c361b[_0x01d8('0x38')]=qs['sort'](_0x59c511['query'][_0x01d8('0x39')]);_0x1c361b[_0x01d8('0x3a')]=qs[_0x01d8('0x31')](_[_0x01d8('0x3b')](_0x59c511[_0x01d8('0x2f')],_0x377569[_0x01d8('0x31')]));if(_0x59c511[_0x01d8('0x2f')]['filter']){_0x1c361b[_0x01d8('0x3a')]=_[_0x01d8('0x3d')](_0x1c361b[_0x01d8('0x3a')],{'$or':_[_0x01d8('0x29')](_0x1c361b[_0x01d8('0x33')],function(_0x3df9d0){var _0x3589e6={};_0x3589e6[_0x3df9d0]={'$like':'%'+_0x59c511[_0x01d8('0x2f')][_0x01d8('0x3c')]+'%'};return _0x3589e6;})});}_0x1c361b=_[_0x01d8('0x3d')]({},_0x1c361b,_0x59c511[_0x01d8('0x40')]);return _0x413c8c['getDescriptions'](_0x1c361b);}})[_0x01d8('0x22')](function(_0x34190e){if(_0x34190e){_0x4b28d2=_0x34190e['length'];if(!_0x59c511[_0x01d8('0x2f')][_0x01d8('0x36')](_0x01d8('0x37'))){_0x1c361b['limit']=qs[_0x01d8('0x1d')](_0x59c511['query'][_0x01d8('0x1d')]);_0x1c361b[_0x01d8('0x1c')]=qs[_0x01d8('0x1c')](_0x59c511[_0x01d8('0x2f')]['offset']);}return _0x413c8c[_0x01d8('0x4e')](_0x1c361b);}})[_0x01d8('0x22')](function(_0x51d4fa){if(_0x51d4fa){return _0x51d4fa?{'count':_0x4b28d2,'rows':_0x51d4fa}:null;}})[_0x01d8('0x22')](respondWithResult(_0x1393ae,null))[_0x01d8('0x44')](handleError(_0x1393ae,null));};exports['getTags']=function(_0x3c92c7,_0x409f1c,_0x23c594){var _0x59869d={};var _0x53b065={};var _0x183130;var _0x567ed4;return db[_0x01d8('0x2a')][_0x01d8('0x4b')]({'where':{'id':_0x3c92c7['params']['id']}})['then'](handleEntityNotFound(_0x409f1c,null))[_0x01d8('0x22')](function(_0x18d3d6){if(_0x18d3d6){_0x183130=_0x18d3d6;_0x53b065[_0x01d8('0x2e')]=_[_0x01d8('0x30')](db[_0x01d8('0x4f')][_0x01d8('0x2b')]);_0x53b065[_0x01d8('0x2f')]=_[_0x01d8('0x30')](_0x3c92c7[_0x01d8('0x2f')]);_0x53b065['filters']=_['intersection'](_0x53b065[_0x01d8('0x2e')],_0x53b065[_0x01d8('0x2f')]);_0x59869d['attributes']=_[_0x01d8('0x32')](_0x53b065[_0x01d8('0x2e')],qs[_0x01d8('0x34')](_0x3c92c7[_0x01d8('0x2f')][_0x01d8('0x34')]));_0x59869d['attributes']=_0x59869d[_0x01d8('0x33')][_0x01d8('0x35')]?_0x59869d[_0x01d8('0x33')]:_0x53b065[_0x01d8('0x2e')];_0x59869d[_0x01d8('0x38')]=qs[_0x01d8('0x39')](_0x3c92c7[_0x01d8('0x2f')][_0x01d8('0x39')]);_0x59869d[_0x01d8('0x3a')]=qs[_0x01d8('0x31')](_[_0x01d8('0x3b')](_0x3c92c7['query'],_0x53b065[_0x01d8('0x31')]));if(_0x3c92c7[_0x01d8('0x2f')][_0x01d8('0x3c')]){_0x59869d['where']=_[_0x01d8('0x3d')](_0x59869d[_0x01d8('0x3a')],{'$or':_[_0x01d8('0x29')](_0x59869d['attributes'],function(_0x5d872c){var _0x5d3347={};_0x5d3347[_0x5d872c]={'$like':'%'+_0x3c92c7[_0x01d8('0x2f')]['filter']+'%'};return _0x5d3347;})});}_0x59869d=_[_0x01d8('0x3d')]({},_0x59869d,_0x3c92c7[_0x01d8('0x40')]);return _0x183130[_0x01d8('0x50')](_0x59869d);}})[_0x01d8('0x22')](function(_0x384d8b){if(_0x384d8b){_0x567ed4=_0x384d8b[_0x01d8('0x35')];if(!_0x3c92c7[_0x01d8('0x2f')][_0x01d8('0x36')]('nolimit')){_0x59869d[_0x01d8('0x1d')]=qs['limit'](_0x3c92c7['query']['limit']);_0x59869d[_0x01d8('0x1c')]=qs['offset'](_0x3c92c7[_0x01d8('0x2f')][_0x01d8('0x1c')]);}return _0x183130[_0x01d8('0x50')](_0x59869d);}})[_0x01d8('0x22')](function(_0x5192eb){if(_0x5192eb){return _0x5192eb?{'count':_0x567ed4,'rows':_0x5192eb}:null;}})[_0x01d8('0x22')](respondWithResult(_0x409f1c,null))[_0x01d8('0x44')](handleError(_0x409f1c,null));};exports[_0x01d8('0x51')]=function(_0xf5cf33,_0x1244d3,_0x3f9d13){if(_0xf5cf33[_0x01d8('0x49')]['id']){delete _0xf5cf33[_0x01d8('0x49')]['id'];}return db[_0x01d8('0x2a')]['findOne']({'where':{'id':_0xf5cf33[_0x01d8('0x46')]['id']}})[_0x01d8('0x22')](handleEntityNotFound(_0x1244d3,null))['then'](function(_0xeea002){if(_0xeea002){return _0xeea002[_0x01d8('0x51')](_0xf5cf33[_0x01d8('0x49')][_0x01d8('0x52')]||[]);}return null;})[_0x01d8('0x22')](respondWithResult(_0x1244d3,null))['catch'](handleError(_0x1244d3,null));};
\ No newline at end of file
index 7614fa0..6a7b3c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x252d1c,_0x2aaba1){var _0x49cedc=function(_0x30965d){while(--_0x30965d){_0x252d1c['push'](_0x252d1c['shift']());}};_0x49cedc(++_0x2aaba1);}(_0x58a4,0xbf));var _0x458a=function(_0x272202,_0x569e70){_0x272202=_0x272202-0x0;var _0xcad2a7=_0x58a4[_0x272202];return _0xcad2a7;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var logger=require(_0x458a('0x2'))(_0x458a('0x3'));var moment=require(_0x458a('0x4'));var BPromise=require(_0x458a('0x5'));var rp=require(_0x458a('0x6'));var fs=require('fs');var path=require(_0x458a('0x7'));var rimraf=require(_0x458a('0x8'));var config=require(_0x458a('0x9'));var attributes=require(_0x458a('0xa'));module[_0x458a('0xb')]=function(_0x2f5d44,_0x57de3c){return _0x2f5d44['define'](_0x458a('0xc'),attributes,{'tableName':_0x458a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4d97fd,_0x3351c4){_0x4d97fd=_0x4d97fd-0x0;var _0x1a646f=_0xd4f4[_0x4d97fd];return _0x1a646f;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09bbd19..ebdc94f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3d2=['request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0xc3d2,0x14c));var _0x2c3d=function(_0x2740d9,_0xfcea46){_0x2740d9=_0x2740d9-0x0;var _0x1c5f67=_0xc3d2[_0x2740d9];return _0x1c5f67;};'use strict';var _=require('lodash');var util=require(_0x2c3d('0x0'));var moment=require(_0x2c3d('0x1'));var BPromise=require('bluebird');var rs=require(_0x2c3d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2c3d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2c3d('0x4'));var config=require(_0x2c3d('0x5'));var jayson=require(_0x2c3d('0x6'));var client=jayson['client'][_0x2c3d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x55a1e5,_0x179e99,_0x2f7c65){return new BPromise(function(_0x2359b3,_0x6e9d92){return client[_0x2c3d('0x8')](_0x55a1e5,_0x2f7c65)[_0x2c3d('0x9')](function(_0x490972){logger[_0x2c3d('0xa')](_0x2c3d('0xb'),_0x179e99,_0x2c3d('0xc'));logger[_0x2c3d('0xd')](_0x2c3d('0xe'),_0x179e99,_0x2c3d('0xc'),JSON['stringify'](_0x490972));if(_0x490972[_0x2c3d('0xf')]){if(_0x490972[_0x2c3d('0xf')][_0x2c3d('0x10')]===0x1f4){logger[_0x2c3d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x179e99,_0x490972[_0x2c3d('0xf')][_0x2c3d('0x11')]);return _0x6e9d92(_0x490972[_0x2c3d('0xf')][_0x2c3d('0x11')]);}logger['error'](_0x2c3d('0xb'),_0x179e99,_0x490972['error'][_0x2c3d('0x11')]);return _0x2359b3(_0x490972['error'][_0x2c3d('0x11')]);}else{logger[_0x2c3d('0xa')]('ZendeskConfiguration,\x20%s,\x20%s',_0x179e99,_0x2c3d('0xc'));_0x2359b3(_0x490972[_0x2c3d('0x12')]['message']);}})[_0x2c3d('0x13')](function(_0x1b10e3){logger[_0x2c3d('0xf')](_0x2c3d('0xb'),_0x179e99,_0x1b10e3);_0x6e9d92(_0x1b10e3);});});}
\ No newline at end of file
+var _0x1f41=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0xa0d0f0,_0x2621f9){var _0x3e26f4=function(_0x38d725){while(--_0x38d725){_0xa0d0f0['push'](_0xa0d0f0['shift']());}};_0x3e26f4(++_0x2621f9);}(_0x1f41,0x1b1));var _0x11f4=function(_0x4695b9,_0x23cccf){_0x4695b9=_0x4695b9-0x0;var _0x50f346=_0x1f41[_0x4695b9];return _0x50f346;};'use strict';var _=require(_0x11f4('0x0'));var util=require(_0x11f4('0x1'));var moment=require(_0x11f4('0x2'));var BPromise=require(_0x11f4('0x3'));var rs=require(_0x11f4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x11f4('0x5'))['db'];var utils=require(_0x11f4('0x6'));var logger=require(_0x11f4('0x7'))(_0x11f4('0x8'));var config=require(_0x11f4('0x9'));var jayson=require(_0x11f4('0xa'));var client=jayson[_0x11f4('0xb')][_0x11f4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x280eb1,_0x1927e8,_0x54d976){return new BPromise(function(_0x471965,_0xd128fd){return client[_0x11f4('0xd')](_0x280eb1,_0x54d976)[_0x11f4('0xe')](function(_0x5536fb){logger[_0x11f4('0xf')](_0x11f4('0x10'),_0x1927e8,_0x11f4('0x11'));logger[_0x11f4('0x12')](_0x11f4('0x13'),_0x1927e8,'request\x20sent',JSON[_0x11f4('0x14')](_0x5536fb));if(_0x5536fb[_0x11f4('0x15')]){if(_0x5536fb[_0x11f4('0x15')][_0x11f4('0x16')]===0x1f4){logger[_0x11f4('0x15')](_0x11f4('0x10'),_0x1927e8,_0x5536fb['error']['message']);return _0xd128fd(_0x5536fb[_0x11f4('0x15')]['message']);}logger[_0x11f4('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x1927e8,_0x5536fb[_0x11f4('0x15')][_0x11f4('0x17')]);return _0x471965(_0x5536fb[_0x11f4('0x15')][_0x11f4('0x17')]);}else{logger[_0x11f4('0xf')](_0x11f4('0x10'),_0x1927e8,_0x11f4('0x11'));_0x471965(_0x5536fb['result'][_0x11f4('0x17')]);}})[_0x11f4('0x18')](function(_0x497953){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1927e8,_0x497953);_0xd128fd(_0x497953);});});}
\ No newline at end of file
index 7d78268..28964a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3580=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','create','put','delete','exports','multer','util'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x3580,0x1cf));var _0x0358=function(_0xb36ce,_0x35635a){_0xb36ce=_0xb36ce-0x0;var _0x247283=_0x3580[_0xb36ce];return _0x247283;};'use strict';var multer=require(_0x0358('0x0'));var util=require(_0x0358('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0358('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0358('0x3'));var interaction=require(_0x0358('0x4'));var config=require(_0x0358('0x5'));var controller=require('./intZendeskField.controller');router[_0x0358('0x6')]('/',auth[_0x0358('0x7')](),controller[_0x0358('0x8')]);router[_0x0358('0x6')](_0x0358('0x9'),auth['isAuthenticated'](),controller[_0x0358('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0358('0xb')]);router[_0x0358('0xc')](_0x0358('0x9'),auth[_0x0358('0x7')](),controller['update']);router[_0x0358('0xd')](_0x0358('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0358('0xe')]=router;
\ No newline at end of file
+var _0xe3b4=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer'];(function(_0xbf09ab,_0x251a19){var _0x2a9aef=function(_0x22d793){while(--_0x22d793){_0xbf09ab['push'](_0xbf09ab['shift']());}};_0x2a9aef(++_0x251a19);}(_0xe3b4,0x71));var _0x4e3b=function(_0x2ddab0,_0x46c407){_0x2ddab0=_0x2ddab0-0x0;var _0x462d0e=_0xe3b4[_0x2ddab0];return _0x462d0e;};'use strict';var multer=require(_0x4e3b('0x0'));var util=require(_0x4e3b('0x1'));var path=require(_0x4e3b('0x2'));var timeout=require('connect-timeout');var express=require(_0x4e3b('0x3'));var router=express[_0x4e3b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4e3b('0x5'));var interaction=require(_0x4e3b('0x6'));var config=require(_0x4e3b('0x7'));var controller=require(_0x4e3b('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x4e3b('0x9')]);router['get'](_0x4e3b('0xa'),auth[_0x4e3b('0xb')](),controller[_0x4e3b('0xc')]);router[_0x4e3b('0xd')]('/',auth[_0x4e3b('0xb')](),controller[_0x4e3b('0xe')]);router[_0x4e3b('0xf')]('/:id',auth[_0x4e3b('0xb')](),controller[_0x4e3b('0x10')]);router['delete'](_0x4e3b('0xa'),auth[_0x4e3b('0xb')](),controller[_0x4e3b('0x11')]);module[_0x4e3b('0x12')]=router;
\ No newline at end of file
index da7b642..026137c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cef=['variable','keyValue','picklist','STRING','customVariable','BOOLEAN','exports','ENUM','string'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x2cef,0x1da));var _0xf2ce=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x2cef[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require('sequelize');module[_0xf2ce('0x0')]={'type':{'type':Sequelize[_0xf2ce('0x1')](_0xf2ce('0x2'),_0xf2ce('0x3'),'customVariable',_0xf2ce('0x4'),_0xf2ce('0x5')),'defaultValue':_0xf2ce('0x2')},'content':{'type':Sequelize[_0xf2ce('0x6')]},'key':{'type':Sequelize[_0xf2ce('0x6')]},'keyType':{'type':Sequelize[_0xf2ce('0x1')](_0xf2ce('0x2'),_0xf2ce('0x3'),_0xf2ce('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xf2ce('0x6')]},'nameField':{'type':Sequelize[_0xf2ce('0x6')]},'customField':{'type':Sequelize[_0xf2ce('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x760e=['string','STRING','BOOLEAN','exports','ENUM','variable','customVariable','keyValue'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x760e,0xdb));var _0xe760=function(_0x11e09b,_0x35457f){_0x11e09b=_0x11e09b-0x0;var _0x3f2a5d=_0x760e[_0x11e09b];return _0x3f2a5d;};'use strict';var Sequelize=require('sequelize');module[_0xe760('0x0')]={'type':{'type':Sequelize[_0xe760('0x1')]('string',_0xe760('0x2'),_0xe760('0x3'),_0xe760('0x4'),'picklist'),'defaultValue':_0xe760('0x5')},'content':{'type':Sequelize[_0xe760('0x6')]},'key':{'type':Sequelize[_0xe760('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xe760('0x2'),_0xe760('0x3'))},'keyContent':{'type':Sequelize[_0xe760('0x6')]},'idField':{'type':Sequelize[_0xe760('0x6')]},'nameField':{'type':Sequelize[_0xe760('0x6')]},'customField':{'type':Sequelize[_0xe760('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe760('0x6')]}};
\ No newline at end of file
index 80fc1ac..5ed0468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa3f=['body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ZendeskField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0xaa3f,0x95));var _0xfaa3=function(_0x1bcf95,_0x27aa7f){_0x1bcf95=_0x1bcf95-0x0;var _0x22eefa=_0xaa3f[_0x1bcf95];return _0x22eefa;};'use strict';var emlformat=require(_0xfaa3('0x0'));var rimraf=require(_0xfaa3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfaa3('0x2'));var rp=require(_0xfaa3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaa3('0x4'));var util=require(_0xfaa3('0x5'));var path=require('path');var sox=require(_0xfaa3('0x6'));var csv=require('to-csv');var ejs=require(_0xfaa3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaa3('0x8'));var squel=require(_0xfaa3('0x9'));var crypto=require(_0xfaa3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfaa3('0xb'));var querystring=require(_0xfaa3('0xc'));var Papa=require(_0xfaa3('0xd'));var Redis=require('ioredis');var authService=require(_0xfaa3('0xe'));var qs=require(_0xfaa3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaa3('0x10'));var logger=require(_0xfaa3('0x11'))(_0xfaa3('0x12'));var utils=require('../../config/utils');var config=require(_0xfaa3('0x13'));var licenseUtil=require(_0xfaa3('0x14'));var db=require(_0xfaa3('0x15'))['db'];function respondWithStatusCode(_0x18ee95,_0x51b7ab){_0x51b7ab=_0x51b7ab||0xcc;return function(_0x19b23b){if(_0x19b23b){return _0x18ee95[_0xfaa3('0x16')](_0x51b7ab);}return _0x18ee95[_0xfaa3('0x17')](_0x51b7ab)[_0xfaa3('0x18')]();};}function respondWithResult(_0x1720bb,_0x408854){_0x408854=_0x408854||0xc8;return function(_0x5731a9){if(_0x5731a9){return _0x1720bb[_0xfaa3('0x17')](_0x408854)[_0xfaa3('0x19')](_0x5731a9);}};}function respondWithFilteredResult(_0x39812b,_0x4a1149){return function(_0x3c2d4e){if(_0x3c2d4e){var _0xdcb52=typeof _0x4a1149['offset']===_0xfaa3('0x1a')&&typeof _0x4a1149['limit']==='undefined';var _0x549302=_0x3c2d4e[_0xfaa3('0x1b')];var _0x2a0ec5=_0xdcb52?0x0:_0x4a1149[_0xfaa3('0x1c')];var _0x5f0973=_0xdcb52?_0x3c2d4e['count']:_0x4a1149['offset']+_0x4a1149['limit'];var _0x5f17ff;if(_0x5f0973>=_0x549302){_0x5f0973=_0x549302;_0x5f17ff=0xc8;}else{_0x5f17ff=0xce;}_0x39812b['status'](_0x5f17ff);return _0x39812b[_0xfaa3('0x1d')]('Content-Range',_0x2a0ec5+'-'+_0x5f0973+'/'+_0x549302)['json'](_0x3c2d4e);}return null;};}function patchUpdates(_0x5409f6){return function(_0x13305e){try{jsonpatch[_0xfaa3('0x1e')](_0x13305e,_0x5409f6,!![]);}catch(_0x112533){return BPromise[_0xfaa3('0x1f')](_0x112533);}return _0x13305e[_0xfaa3('0x20')]();};}function saveUpdates(_0x40760a,_0x4e264f){return function(_0x1daa2d){if(_0x1daa2d){return _0x1daa2d[_0xfaa3('0x21')](_0x40760a)[_0xfaa3('0x22')](function(_0x42ab1a){return _0x42ab1a;});}return null;};}function removeEntity(_0x602eab,_0x36193f){return function(_0x3a300b){if(_0x3a300b){return _0x3a300b[_0xfaa3('0x23')]()['then'](function(){_0x602eab[_0xfaa3('0x17')](0xcc)[_0xfaa3('0x18')]();});}};}function handleEntityNotFound(_0x5000ec,_0x5ca302){return function(_0x27b7fe){if(!_0x27b7fe){_0x5000ec['sendStatus'](0x194);}return _0x27b7fe;};}function handleError(_0xdba825,_0x500126){_0x500126=_0x500126||0x1f4;return function(_0x1c3e7a){logger[_0xfaa3('0x24')](_0x1c3e7a[_0xfaa3('0x25')]);if(_0x1c3e7a[_0xfaa3('0x26')]){delete _0x1c3e7a[_0xfaa3('0x26')];}_0xdba825[_0xfaa3('0x17')](_0x500126)[_0xfaa3('0x27')](_0x1c3e7a);};}exports['index']=function(_0x3f9cf2,_0x3cf2be){var _0xf65fe0={},_0x315783={},_0x54e070={'count':0x0,'rows':[]};var _0x581895=_[_0xfaa3('0x28')](db[_0xfaa3('0x29')][_0xfaa3('0x2a')],function(_0x26d0da){return{'name':_0x26d0da['fieldName'],'type':_0x26d0da[_0xfaa3('0x2b')][_0xfaa3('0x2c')]};});_0x315783[_0xfaa3('0x2d')]=_['map'](_0x581895,_0xfaa3('0x26'));_0x315783[_0xfaa3('0x2e')]=_[_0xfaa3('0x2f')](_0x3f9cf2[_0xfaa3('0x2e')]);_0x315783['filters']=_[_0xfaa3('0x30')](_0x315783[_0xfaa3('0x2d')],_0x315783['query']);_0xf65fe0[_0xfaa3('0x31')]=_[_0xfaa3('0x30')](_0x315783[_0xfaa3('0x2d')],qs[_0xfaa3('0x32')](_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x32')]));_0xf65fe0[_0xfaa3('0x31')]=_0xf65fe0['attributes'][_0xfaa3('0x33')]?_0xf65fe0[_0xfaa3('0x31')]:_0x315783['model'];if(!_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x34')](_0xfaa3('0x35'))){_0xf65fe0['limit']=qs[_0xfaa3('0x36')](_0x3f9cf2[_0xfaa3('0x2e')]['limit']);_0xf65fe0['offset']=qs[_0xfaa3('0x1c')](_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x1c')]);}_0xf65fe0[_0xfaa3('0x37')]=qs[_0xfaa3('0x38')](_0x3f9cf2[_0xfaa3('0x2e')]['sort']);_0xf65fe0['where']=qs['filters'](_[_0xfaa3('0x39')](_0x3f9cf2[_0xfaa3('0x2e')],_0x315783['filters']),_0x581895);if(_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3a')]){_0xf65fe0[_0xfaa3('0x3b')]=_[_0xfaa3('0x3c')](_0xf65fe0[_0xfaa3('0x3b')],{'$or':_[_0xfaa3('0x28')](_0x581895,function(_0x2a7b80){if(_0x2a7b80[_0xfaa3('0x2b')]!==_0xfaa3('0x3d')){var _0x1ebd0e={};_0x1ebd0e[_0x2a7b80[_0xfaa3('0x26')]]={'$like':'%'+_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3a')]+'%'};return _0x1ebd0e;}})});}_0xf65fe0=_[_0xfaa3('0x3c')]({},_0xf65fe0,_0x3f9cf2[_0xfaa3('0x3e')]);var _0x5126b3={'where':_0xf65fe0['where']};return db[_0xfaa3('0x29')][_0xfaa3('0x1b')](_0x5126b3)[_0xfaa3('0x22')](function(_0x2b3e9f){_0x54e070['count']=_0x2b3e9f;if(_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3f')]){_0xf65fe0[_0xfaa3('0x40')]=[{'all':!![]}];}return db[_0xfaa3('0x29')][_0xfaa3('0x41')](_0xf65fe0);})[_0xfaa3('0x22')](function(_0x3c1dff){_0x54e070[_0xfaa3('0x42')]=_0x3c1dff;return _0x54e070;})[_0xfaa3('0x22')](respondWithFilteredResult(_0x3cf2be,_0xf65fe0))[_0xfaa3('0x43')](handleError(_0x3cf2be,null));};exports[_0xfaa3('0x44')]=function(_0x27410e,_0x150b49){var _0x1d9b9e={'raw':!![],'where':{'id':_0x27410e[_0xfaa3('0x45')]['id']}},_0x56374c={};_0x56374c[_0xfaa3('0x2d')]=_[_0xfaa3('0x2f')](db[_0xfaa3('0x29')][_0xfaa3('0x2a')]);_0x56374c[_0xfaa3('0x2e')]=_[_0xfaa3('0x2f')](_0x27410e[_0xfaa3('0x2e')]);_0x56374c[_0xfaa3('0x46')]=_[_0xfaa3('0x30')](_0x56374c['model'],_0x56374c['query']);_0x1d9b9e['attributes']=_[_0xfaa3('0x30')](_0x56374c['model'],qs[_0xfaa3('0x32')](_0x27410e[_0xfaa3('0x2e')][_0xfaa3('0x32')]));_0x1d9b9e[_0xfaa3('0x31')]=_0x1d9b9e[_0xfaa3('0x31')][_0xfaa3('0x33')]?_0x1d9b9e[_0xfaa3('0x31')]:_0x56374c['model'];if(_0x27410e[_0xfaa3('0x2e')][_0xfaa3('0x3f')]){_0x1d9b9e['include']=[{'all':!![]}];}_0x1d9b9e=_[_0xfaa3('0x3c')]({},_0x1d9b9e,_0x27410e['options']);return db[_0xfaa3('0x29')][_0xfaa3('0x47')](_0x1d9b9e)[_0xfaa3('0x22')](handleEntityNotFound(_0x150b49,null))[_0xfaa3('0x22')](respondWithResult(_0x150b49,null))[_0xfaa3('0x43')](handleError(_0x150b49,null));};exports['create']=function(_0x40268b,_0x5aba0e){return db[_0xfaa3('0x29')][_0xfaa3('0x48')](_0x40268b[_0xfaa3('0x49')],{})[_0xfaa3('0x22')](respondWithResult(_0x5aba0e,0xc9))['catch'](handleError(_0x5aba0e,null));};exports['update']=function(_0x5e5d89,_0x17c9b4){if(_0x5e5d89[_0xfaa3('0x49')]['id']){delete _0x5e5d89[_0xfaa3('0x49')]['id'];}return db[_0xfaa3('0x29')][_0xfaa3('0x47')]({'where':{'id':_0x5e5d89[_0xfaa3('0x45')]['id']}})[_0xfaa3('0x22')](handleEntityNotFound(_0x17c9b4,null))[_0xfaa3('0x22')](saveUpdates(_0x5e5d89[_0xfaa3('0x49')],null))[_0xfaa3('0x22')](respondWithResult(_0x17c9b4,null))[_0xfaa3('0x43')](handleError(_0x17c9b4,null));};exports[_0xfaa3('0x23')]=function(_0x17c686,_0x3e92fa){return db['ZendeskField']['find']({'where':{'id':_0x17c686[_0xfaa3('0x45')]['id']}})[_0xfaa3('0x22')](handleEntityNotFound(_0x3e92fa,null))[_0xfaa3('0x22')](removeEntity(_0x3e92fa,null))[_0xfaa3('0x43')](handleError(_0x3e92fa,null));};
\ No newline at end of file
+var _0xaa3f=['body','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','ZendeskField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xaa3f,0x95));var _0xfaa3=function(_0x560b93,_0x1ef1e5){_0x560b93=_0x560b93-0x0;var _0x19604a=_0xaa3f[_0x560b93];return _0x19604a;};'use strict';var emlformat=require(_0xfaa3('0x0'));var rimraf=require(_0xfaa3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfaa3('0x2'));var rp=require(_0xfaa3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfaa3('0x4'));var util=require(_0xfaa3('0x5'));var path=require('path');var sox=require(_0xfaa3('0x6'));var csv=require('to-csv');var ejs=require(_0xfaa3('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfaa3('0x8'));var squel=require(_0xfaa3('0x9'));var crypto=require(_0xfaa3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfaa3('0xb'));var querystring=require(_0xfaa3('0xc'));var Papa=require(_0xfaa3('0xd'));var Redis=require('ioredis');var authService=require(_0xfaa3('0xe'));var qs=require(_0xfaa3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaa3('0x10'));var logger=require(_0xfaa3('0x11'))(_0xfaa3('0x12'));var utils=require('../../config/utils');var config=require(_0xfaa3('0x13'));var licenseUtil=require(_0xfaa3('0x14'));var db=require(_0xfaa3('0x15'))['db'];function respondWithStatusCode(_0x18ee95,_0x51b7ab){_0x51b7ab=_0x51b7ab||0xcc;return function(_0x19b23b){if(_0x19b23b){return _0x18ee95[_0xfaa3('0x16')](_0x51b7ab);}return _0x18ee95[_0xfaa3('0x17')](_0x51b7ab)[_0xfaa3('0x18')]();};}function respondWithResult(_0x1720bb,_0x408854){_0x408854=_0x408854||0xc8;return function(_0x5731a9){if(_0x5731a9){return _0x1720bb[_0xfaa3('0x17')](_0x408854)[_0xfaa3('0x19')](_0x5731a9);}};}function respondWithFilteredResult(_0x39812b,_0x4a1149){return function(_0x3c2d4e){if(_0x3c2d4e){var _0xdcb52=typeof _0x4a1149['offset']===_0xfaa3('0x1a')&&typeof _0x4a1149['limit']==='undefined';var _0x549302=_0x3c2d4e[_0xfaa3('0x1b')];var _0x2a0ec5=_0xdcb52?0x0:_0x4a1149[_0xfaa3('0x1c')];var _0x5f0973=_0xdcb52?_0x3c2d4e['count']:_0x4a1149['offset']+_0x4a1149['limit'];var _0x5f17ff;if(_0x5f0973>=_0x549302){_0x5f0973=_0x549302;_0x5f17ff=0xc8;}else{_0x5f17ff=0xce;}_0x39812b['status'](_0x5f17ff);return _0x39812b[_0xfaa3('0x1d')]('Content-Range',_0x2a0ec5+'-'+_0x5f0973+'/'+_0x549302)['json'](_0x3c2d4e);}return null;};}function patchUpdates(_0x5409f6){return function(_0x13305e){try{jsonpatch[_0xfaa3('0x1e')](_0x13305e,_0x5409f6,!![]);}catch(_0x112533){return BPromise[_0xfaa3('0x1f')](_0x112533);}return _0x13305e[_0xfaa3('0x20')]();};}function saveUpdates(_0x40760a,_0x4e264f){return function(_0x1daa2d){if(_0x1daa2d){return _0x1daa2d[_0xfaa3('0x21')](_0x40760a)[_0xfaa3('0x22')](function(_0x42ab1a){return _0x42ab1a;});}return null;};}function removeEntity(_0x602eab,_0x36193f){return function(_0x3a300b){if(_0x3a300b){return _0x3a300b[_0xfaa3('0x23')]()['then'](function(){_0x602eab[_0xfaa3('0x17')](0xcc)[_0xfaa3('0x18')]();});}};}function handleEntityNotFound(_0x5000ec,_0x5ca302){return function(_0x27b7fe){if(!_0x27b7fe){_0x5000ec['sendStatus'](0x194);}return _0x27b7fe;};}function handleError(_0xdba825,_0x500126){_0x500126=_0x500126||0x1f4;return function(_0x1c3e7a){logger[_0xfaa3('0x24')](_0x1c3e7a[_0xfaa3('0x25')]);if(_0x1c3e7a[_0xfaa3('0x26')]){delete _0x1c3e7a[_0xfaa3('0x26')];}_0xdba825[_0xfaa3('0x17')](_0x500126)[_0xfaa3('0x27')](_0x1c3e7a);};}exports['index']=function(_0x3f9cf2,_0x3cf2be){var _0xf65fe0={},_0x315783={},_0x54e070={'count':0x0,'rows':[]};var _0x581895=_[_0xfaa3('0x28')](db[_0xfaa3('0x29')][_0xfaa3('0x2a')],function(_0x26d0da){return{'name':_0x26d0da['fieldName'],'type':_0x26d0da[_0xfaa3('0x2b')][_0xfaa3('0x2c')]};});_0x315783[_0xfaa3('0x2d')]=_['map'](_0x581895,_0xfaa3('0x26'));_0x315783[_0xfaa3('0x2e')]=_[_0xfaa3('0x2f')](_0x3f9cf2[_0xfaa3('0x2e')]);_0x315783['filters']=_[_0xfaa3('0x30')](_0x315783[_0xfaa3('0x2d')],_0x315783['query']);_0xf65fe0[_0xfaa3('0x31')]=_[_0xfaa3('0x30')](_0x315783[_0xfaa3('0x2d')],qs[_0xfaa3('0x32')](_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x32')]));_0xf65fe0[_0xfaa3('0x31')]=_0xf65fe0['attributes'][_0xfaa3('0x33')]?_0xf65fe0[_0xfaa3('0x31')]:_0x315783['model'];if(!_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x34')](_0xfaa3('0x35'))){_0xf65fe0['limit']=qs[_0xfaa3('0x36')](_0x3f9cf2[_0xfaa3('0x2e')]['limit']);_0xf65fe0['offset']=qs[_0xfaa3('0x1c')](_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x1c')]);}_0xf65fe0[_0xfaa3('0x37')]=qs[_0xfaa3('0x38')](_0x3f9cf2[_0xfaa3('0x2e')]['sort']);_0xf65fe0['where']=qs['filters'](_[_0xfaa3('0x39')](_0x3f9cf2[_0xfaa3('0x2e')],_0x315783['filters']),_0x581895);if(_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3a')]){_0xf65fe0[_0xfaa3('0x3b')]=_[_0xfaa3('0x3c')](_0xf65fe0[_0xfaa3('0x3b')],{'$or':_[_0xfaa3('0x28')](_0x581895,function(_0x2a7b80){if(_0x2a7b80[_0xfaa3('0x2b')]!==_0xfaa3('0x3d')){var _0x1ebd0e={};_0x1ebd0e[_0x2a7b80[_0xfaa3('0x26')]]={'$like':'%'+_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3a')]+'%'};return _0x1ebd0e;}})});}_0xf65fe0=_[_0xfaa3('0x3c')]({},_0xf65fe0,_0x3f9cf2[_0xfaa3('0x3e')]);var _0x5126b3={'where':_0xf65fe0['where']};return db[_0xfaa3('0x29')][_0xfaa3('0x1b')](_0x5126b3)[_0xfaa3('0x22')](function(_0x2b3e9f){_0x54e070['count']=_0x2b3e9f;if(_0x3f9cf2[_0xfaa3('0x2e')][_0xfaa3('0x3f')]){_0xf65fe0[_0xfaa3('0x40')]=[{'all':!![]}];}return db[_0xfaa3('0x29')][_0xfaa3('0x41')](_0xf65fe0);})[_0xfaa3('0x22')](function(_0x3c1dff){_0x54e070[_0xfaa3('0x42')]=_0x3c1dff;return _0x54e070;})[_0xfaa3('0x22')](respondWithFilteredResult(_0x3cf2be,_0xf65fe0))[_0xfaa3('0x43')](handleError(_0x3cf2be,null));};exports[_0xfaa3('0x44')]=function(_0x27410e,_0x150b49){var _0x1d9b9e={'raw':!![],'where':{'id':_0x27410e[_0xfaa3('0x45')]['id']}},_0x56374c={};_0x56374c[_0xfaa3('0x2d')]=_[_0xfaa3('0x2f')](db[_0xfaa3('0x29')][_0xfaa3('0x2a')]);_0x56374c[_0xfaa3('0x2e')]=_[_0xfaa3('0x2f')](_0x27410e[_0xfaa3('0x2e')]);_0x56374c[_0xfaa3('0x46')]=_[_0xfaa3('0x30')](_0x56374c['model'],_0x56374c['query']);_0x1d9b9e['attributes']=_[_0xfaa3('0x30')](_0x56374c['model'],qs[_0xfaa3('0x32')](_0x27410e[_0xfaa3('0x2e')][_0xfaa3('0x32')]));_0x1d9b9e[_0xfaa3('0x31')]=_0x1d9b9e[_0xfaa3('0x31')][_0xfaa3('0x33')]?_0x1d9b9e[_0xfaa3('0x31')]:_0x56374c['model'];if(_0x27410e[_0xfaa3('0x2e')][_0xfaa3('0x3f')]){_0x1d9b9e['include']=[{'all':!![]}];}_0x1d9b9e=_[_0xfaa3('0x3c')]({},_0x1d9b9e,_0x27410e['options']);return db[_0xfaa3('0x29')][_0xfaa3('0x47')](_0x1d9b9e)[_0xfaa3('0x22')](handleEntityNotFound(_0x150b49,null))[_0xfaa3('0x22')](respondWithResult(_0x150b49,null))[_0xfaa3('0x43')](handleError(_0x150b49,null));};exports['create']=function(_0x40268b,_0x5aba0e){return db[_0xfaa3('0x29')][_0xfaa3('0x48')](_0x40268b[_0xfaa3('0x49')],{})[_0xfaa3('0x22')](respondWithResult(_0x5aba0e,0xc9))['catch'](handleError(_0x5aba0e,null));};exports['update']=function(_0x5e5d89,_0x17c9b4){if(_0x5e5d89[_0xfaa3('0x49')]['id']){delete _0x5e5d89[_0xfaa3('0x49')]['id'];}return db[_0xfaa3('0x29')][_0xfaa3('0x47')]({'where':{'id':_0x5e5d89[_0xfaa3('0x45')]['id']}})[_0xfaa3('0x22')](handleEntityNotFound(_0x17c9b4,null))[_0xfaa3('0x22')](saveUpdates(_0x5e5d89[_0xfaa3('0x49')],null))[_0xfaa3('0x22')](respondWithResult(_0x17c9b4,null))[_0xfaa3('0x43')](handleError(_0x17c9b4,null));};exports[_0xfaa3('0x23')]=function(_0x17c686,_0x3e92fa){return db['ZendeskField']['find']({'where':{'id':_0x17c686[_0xfaa3('0x45')]['id']}})[_0xfaa3('0x22')](handleEntityNotFound(_0x3e92fa,null))[_0xfaa3('0x22')](removeEntity(_0x3e92fa,null))[_0xfaa3('0x43')](handleError(_0x3e92fa,null));};
\ No newline at end of file
index 39c2aab..ff76bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d4b=['./intZendeskField.attributes','exports','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3c01c1,_0x2968f9){var _0xcd7fe2=function(_0x55f0af){while(--_0x55f0af){_0x3c01c1['push'](_0x3c01c1['shift']());}};_0xcd7fe2(++_0x2968f9);}(_0x3d4b,0x1c1));var _0xb3d4=function(_0x31d849,_0x3db9bc){_0x31d849=_0x31d849-0x0;var _0x1c55b3=_0x3d4b[_0x31d849];return _0x1c55b3;};'use strict';var _=require(_0xb3d4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb3d4('0x1'));var BPromise=require(_0xb3d4('0x2'));var rp=require(_0xb3d4('0x3'));var fs=require('fs');var path=require(_0xb3d4('0x4'));var rimraf=require(_0xb3d4('0x5'));var config=require(_0xb3d4('0x6'));var attributes=require(_0xb3d4('0x7'));module[_0xb3d4('0x8')]=function(_0x262995,_0x3b3900){return _0x262995['define']('ZendeskField',attributes,{'tableName':_0xb3d4('0x9'),'paranoid':![],'indexes':[{'name':_0xb3d4('0xa'),'fields':['idField',_0xb3d4('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc5f7=['../../config/environment','define','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x2dbb88,_0x33ba0a){var _0x1c34b4=function(_0x531a17){while(--_0x531a17){_0x2dbb88['push'](_0x2dbb88['shift']());}};_0x1c34b4(++_0x33ba0a);}(_0xc5f7,0xb9));var _0x7c5f=function(_0x2a98ea,_0x543662){_0x2a98ea=_0x2a98ea-0x0;var _0x2e7e66=_0xc5f7[_0x2a98ea];return _0x2e7e66;};'use strict';var _=require(_0x7c5f('0x0'));var util=require(_0x7c5f('0x1'));var logger=require('../../config/logger')(_0x7c5f('0x2'));var moment=require(_0x7c5f('0x3'));var BPromise=require('bluebird');var rp=require(_0x7c5f('0x4'));var fs=require('fs');var path=require(_0x7c5f('0x5'));var rimraf=require(_0x7c5f('0x6'));var config=require(_0x7c5f('0x7'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x157bf4,_0x65ffa8){return _0x157bf4[_0x7c5f('0x8')]('ZendeskField',attributes,{'tableName':_0x7c5f('0x9'),'paranoid':![],'indexes':[{'name':_0x7c5f('0xa'),'fields':['idField',_0x7c5f('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 83d38dd..7f3a196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab5=['error','code','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3d3434,_0x248949){var _0x445f8f=function(_0x330a95){while(--_0x330a95){_0x3d3434['push'](_0x3d3434['shift']());}};_0x445f8f(++_0x248949);}(_0xaab5,0xbd));var _0x5aab=function(_0x58988f,_0x1b8b19){_0x58988f=_0x58988f-0x0;var _0x3577f2=_0xaab5[_0x58988f];return _0x3577f2;};'use strict';var _=require(_0x5aab('0x0'));var util=require(_0x5aab('0x1'));var moment=require('moment');var BPromise=require(_0x5aab('0x2'));var rs=require(_0x5aab('0x3'));var fs=require('fs');var Redis=require(_0x5aab('0x4'));var db=require(_0x5aab('0x5'))['db'];var utils=require(_0x5aab('0x6'));var logger=require(_0x5aab('0x7'))(_0x5aab('0x8'));var config=require(_0x5aab('0x9'));var jayson=require(_0x5aab('0xa'));var client=jayson[_0x5aab('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x534550,_0x5827c3,_0x9c2c27){return new BPromise(function(_0x12d748,_0x41cb82){return client[_0x5aab('0xc')](_0x534550,_0x9c2c27)['then'](function(_0x12abce){logger['info'](_0x5aab('0xd'),_0x5827c3,'request\x20sent');logger[_0x5aab('0xe')](_0x5aab('0xf'),_0x5827c3,_0x5aab('0x10'),JSON[_0x5aab('0x11')](_0x12abce));if(_0x12abce['error']){if(_0x12abce[_0x5aab('0x12')][_0x5aab('0x13')]===0x1f4){logger[_0x5aab('0x12')](_0x5aab('0xd'),_0x5827c3,_0x12abce[_0x5aab('0x12')][_0x5aab('0x14')]);return _0x41cb82(_0x12abce[_0x5aab('0x12')][_0x5aab('0x14')]);}logger[_0x5aab('0x12')](_0x5aab('0xd'),_0x5827c3,_0x12abce[_0x5aab('0x12')][_0x5aab('0x14')]);return _0x12d748(_0x12abce[_0x5aab('0x12')][_0x5aab('0x14')]);}else{logger[_0x5aab('0x15')](_0x5aab('0xd'),_0x5827c3,_0x5aab('0x10'));_0x12d748(_0x12abce['result']['message']);}})[_0x5aab('0x16')](function(_0x4e9fa0){logger[_0x5aab('0x12')](_0x5aab('0xd'),_0x5827c3,_0x4e9fa0);_0x41cb82(_0x4e9fa0);});});}
\ No newline at end of file
+var _0x41db=['request','then','info','request\x20sent','debug','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x4365b8,_0x13ccdc){var _0x2ecde7=function(_0x3cfe81){while(--_0x3cfe81){_0x4365b8['push'](_0x4365b8['shift']());}};_0x2ecde7(++_0x13ccdc);}(_0x41db,0x9e));var _0xb41d=function(_0x1cd5b6,_0x381b04){_0x1cd5b6=_0x1cd5b6-0x0;var _0x32ed77=_0x41db[_0x1cd5b6];return _0x32ed77;};'use strict';var _=require(_0xb41d('0x0'));var util=require(_0xb41d('0x1'));var moment=require(_0xb41d('0x2'));var BPromise=require(_0xb41d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41d('0x4'));var db=require(_0xb41d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb41d('0x6'))(_0xb41d('0x7'));var config=require(_0xb41d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb41d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa8a0aa,_0x29352c,_0x5263a8){return new BPromise(function(_0x2c1eab,_0xe340a1){return client[_0xb41d('0xa')](_0xa8a0aa,_0x5263a8)[_0xb41d('0xb')](function(_0x490b76){logger[_0xb41d('0xc')]('ZendeskField,\x20%s,\x20%s',_0x29352c,_0xb41d('0xd'));logger[_0xb41d('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x29352c,'request\x20sent',JSON['stringify'](_0x490b76));if(_0x490b76[_0xb41d('0xf')]){if(_0x490b76['error'][_0xb41d('0x10')]===0x1f4){logger['error'](_0xb41d('0x11'),_0x29352c,_0x490b76['error'][_0xb41d('0x12')]);return _0xe340a1(_0x490b76[_0xb41d('0xf')][_0xb41d('0x12')]);}logger[_0xb41d('0xf')](_0xb41d('0x11'),_0x29352c,_0x490b76[_0xb41d('0xf')][_0xb41d('0x12')]);return _0x2c1eab(_0x490b76[_0xb41d('0xf')][_0xb41d('0x12')]);}else{logger['info'](_0xb41d('0x11'),_0x29352c,_0xb41d('0xd'));_0x2c1eab(_0x490b76[_0xb41d('0x13')][_0xb41d('0x12')]);}})[_0xb41d('0x14')](function(_0x266944){logger[_0xb41d('0xf')]('ZendeskField,\x20%s,\x20%s',_0x29352c,_0x266944);_0xe340a1(_0x266944);});});}
\ No newline at end of file
index 4f9fd90..e7a90fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a7=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x35d7f7,_0x4fdbb3){var _0x23fe5b=function(_0x3b0201){while(--_0x3b0201){_0x35d7f7['push'](_0x35d7f7['shift']());}};_0x23fe5b(++_0x4fdbb3);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x2e75c3,_0x8e5c0a){_0x2e75c3=_0x2e75c3-0x0;var _0x1e5314=_0xb7a7[_0x2e75c3];return _0x1e5314;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require(_0x7b7a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b7a('0x5'));var interaction=require(_0x7b7a('0x6'));var config=require(_0x7b7a('0x7'));var controller=require('./intZohoAccount.controller');router[_0x7b7a('0x8')]('/',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xa')]);router[_0x7b7a('0x8')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0x8')](_0x7b7a('0xd'),auth['isAuthenticated'](),controller[_0x7b7a('0xe')]);router['get'](_0x7b7a('0xf'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0x10')]);router[_0x7b7a('0x11')]('/',auth[_0x7b7a('0x9')](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x7b7a('0x12')]);router[_0x7b7a('0x13')]('/:id',auth[_0x7b7a('0x9')](),controller[_0x7b7a('0x14')]);router[_0x7b7a('0x15')](_0x7b7a('0xb'),auth[_0x7b7a('0x9')](),controller[_0x7b7a('0x16')]);module[_0x7b7a('0x17')]=router;
\ No newline at end of file
+var _0x325a=['isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x325a,0x158));var _0xa325=function(_0x570cac,_0x33673f){_0x570cac=_0x570cac-0x0;var _0x16c320=_0x325a[_0x570cac];return _0x16c320;};'use strict';var multer=require(_0xa325('0x0'));var util=require(_0xa325('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa325('0x2')]();var fs_extra=require(_0xa325('0x3'));var auth=require(_0xa325('0x4'));var interaction=require(_0xa325('0x5'));var config=require('../../config/environment');var controller=require(_0xa325('0x6'));router[_0xa325('0x7')]('/',auth[_0xa325('0x8')](),controller[_0xa325('0x9')]);router['get'](_0xa325('0xa'),auth['isAuthenticated'](),controller[_0xa325('0xb')]);router[_0xa325('0x7')](_0xa325('0xc'),auth[_0xa325('0x8')](),controller[_0xa325('0xd')]);router[_0xa325('0x7')]('/:id/fields',auth[_0xa325('0x8')](),controller[_0xa325('0xe')]);router[_0xa325('0xf')]('/',auth[_0xa325('0x8')](),controller[_0xa325('0x10')]);router[_0xa325('0xf')](_0xa325('0xc'),auth['isAuthenticated'](),controller[_0xa325('0x11')]);router['put'](_0xa325('0xa'),auth['isAuthenticated'](),controller[_0xa325('0x12')]);router[_0xa325('0x13')](_0xa325('0xa'),auth[_0xa325('0x8')](),controller[_0xa325('0x14')]);module[_0xa325('0x15')]=router;
\ No newline at end of file
index 574bbdc..0254468 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['STRING','exports'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x9bde,0xe1));var _0xe9bd=function(_0x293b47,_0x19c2d1){_0x293b47=_0x293b47-0x0;var _0x5064dd=_0x9bde[_0x293b47];return _0x5064dd;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}};
\ No newline at end of file
+var _0x70e0=['STRING','sequelize','exports'];(function(_0x42d194,_0x22f9ab){var _0x436f0b=function(_0x8b4c0){while(--_0x8b4c0){_0x42d194['push'](_0x42d194['shift']());}};_0x436f0b(++_0x22f9ab);}(_0x70e0,0x17b));var _0x070e=function(_0x122b4c,_0x28b91b){_0x122b4c=_0x122b4c-0x0;var _0xe267eb=_0x70e0[_0x122b4c];return _0xe267eb;};'use strict';var Sequelize=require(_0x070e('0x0'));module[_0x070e('0x1')]={'name':{'type':Sequelize[_0x070e('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x070e('0x2')]},'clientId':{'type':Sequelize[_0x070e('0x2')]},'clientSecret':{'type':Sequelize[_0x070e('0x2')]},'serverUrl':{'type':Sequelize[_0x070e('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x070e('0x2')]}};
\ No newline at end of file
index ba9d3ca..98a6aeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4cb=['order','sort','where','filter','merge','options','ZohoAccount','include','findAll','rows','params','keys','includeAll','find','catch','create','update','body','getConfigurations','findOne','ZohoConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','includes','api_name','push','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x459ef5,_0x60061e){var _0x168c41=function(_0x1b7c44){while(--_0x1b7c44){_0x459ef5['push'](_0x459ef5['shift']());}};_0x168c41(++_0x60061e);}(_0xc4cb,0xc8));var _0xbc4c=function(_0x557f5f,_0x31d8e7){_0x557f5f=_0x557f5f-0x0;var _0x196eba=_0xc4cb[_0x557f5f];return _0x196eba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc4c('0x0'));var zipdir=require(_0xbc4c('0x1'));var jsonpatch=require(_0xbc4c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc4c('0x3'));var Mustache=require(_0xbc4c('0x4'));var util=require(_0xbc4c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbc4c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc4c('0x7'));var squel=require(_0xbc4c('0x8'));var crypto=require(_0xbc4c('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbc4c('0xa'));var querystring=require(_0xbc4c('0xb'));var Papa=require(_0xbc4c('0xc'));var Redis=require(_0xbc4c('0xd'));var authService=require(_0xbc4c('0xe'));var qs=require(_0xbc4c('0xf'));var as=require(_0xbc4c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbc4c('0x11'))(_0xbc4c('0x12'));var utils=require(_0xbc4c('0x13'));var config=require(_0xbc4c('0x14'));var licenseUtil=require(_0xbc4c('0x15'));var db=require(_0xbc4c('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x223b10,_0xba3778){_0xba3778=_0xba3778||0xcc;return function(_0x2b252a){if(_0x2b252a){return _0x223b10[_0xbc4c('0x17')](_0xba3778);}return _0x223b10[_0xbc4c('0x18')](_0xba3778)['end']();};}function respondWithResult(_0x2d6c0f,_0xfb980d){_0xfb980d=_0xfb980d||0xc8;return function(_0x86957d){if(_0x86957d){return _0x2d6c0f[_0xbc4c('0x18')](_0xfb980d)['json'](_0x86957d);}};}function respondWithFilteredResult(_0x11e2f0,_0x245c7d){return function(_0x2110ca){if(_0x2110ca){var _0x23890=typeof _0x245c7d[_0xbc4c('0x19')]===_0xbc4c('0x1a')&&typeof _0x245c7d[_0xbc4c('0x1b')]==='undefined';var _0x959313=_0x2110ca[_0xbc4c('0x1c')];var _0x58aea7=_0x23890?0x0:_0x245c7d[_0xbc4c('0x19')];var _0x4640a7=_0x23890?_0x2110ca['count']:_0x245c7d[_0xbc4c('0x19')]+_0x245c7d[_0xbc4c('0x1b')];var _0x864513;if(_0x4640a7>=_0x959313){_0x4640a7=_0x959313;_0x864513=0xc8;}else{_0x864513=0xce;}_0x11e2f0[_0xbc4c('0x18')](_0x864513);return _0x11e2f0[_0xbc4c('0x1d')](_0xbc4c('0x1e'),_0x58aea7+'-'+_0x4640a7+'/'+_0x959313)[_0xbc4c('0x1f')](_0x2110ca);}return null;};}function patchUpdates(_0x2264c0){return function(_0x5347c7){try{jsonpatch[_0xbc4c('0x20')](_0x5347c7,_0x2264c0,!![]);}catch(_0x165e73){return BPromise[_0xbc4c('0x21')](_0x165e73);}return _0x5347c7[_0xbc4c('0x22')]();};}function saveUpdates(_0x35922c,_0xf299e9){return function(_0x21fcd6){if(_0x21fcd6){return _0x21fcd6['update'](_0x35922c)[_0xbc4c('0x23')](function(_0x473660){return _0x473660;});}return null;};}function removeEntity(_0x35acea,_0x1110d1){return function(_0x223015){if(_0x223015){return _0x223015[_0xbc4c('0x24')]()[_0xbc4c('0x23')](function(){_0x35acea[_0xbc4c('0x18')](0xcc)[_0xbc4c('0x25')]();});}};}function handleEntityNotFound(_0x9130b2,_0x5b6aab){return function(_0x2faff4){if(!_0x2faff4){_0x9130b2[_0xbc4c('0x17')](0x194);}return _0x2faff4;};}function handleError(_0x42b935,_0x177bdd){_0x177bdd=_0x177bdd||0x1f4;return function(_0x287a55){logger[_0xbc4c('0x26')](_0x287a55[_0xbc4c('0x27')]);if(_0x287a55[_0xbc4c('0x28')]){delete _0x287a55['name'];}_0x42b935['status'](_0x177bdd)['send'](_0x287a55);};}exports[_0xbc4c('0x29')]=function(_0x2ac3c8,_0x229855){var _0x56574e={},_0x15d728={},_0xea36a={'count':0x0,'rows':[]};var _0x300ccf=_[_0xbc4c('0x2a')](db['ZohoAccount'][_0xbc4c('0x2b')],function(_0x1ff6c5){return{'name':_0x1ff6c5[_0xbc4c('0x2c')],'type':_0x1ff6c5[_0xbc4c('0x2d')][_0xbc4c('0x2e')]};});_0x15d728[_0xbc4c('0x2f')]=_['map'](_0x300ccf,_0xbc4c('0x28'));_0x15d728[_0xbc4c('0x30')]=_['keys'](_0x2ac3c8['query']);_0x15d728[_0xbc4c('0x31')]=_[_0xbc4c('0x32')](_0x15d728['model'],_0x15d728[_0xbc4c('0x30')]);_0x56574e['attributes']=_['intersection'](_0x15d728['model'],qs['fields'](_0x2ac3c8[_0xbc4c('0x30')][_0xbc4c('0x33')]));_0x56574e[_0xbc4c('0x34')]=_0x56574e[_0xbc4c('0x34')][_0xbc4c('0x35')]?_0x56574e[_0xbc4c('0x34')]:_0x15d728[_0xbc4c('0x2f')];if(!_0x2ac3c8[_0xbc4c('0x30')][_0xbc4c('0x36')](_0xbc4c('0x37'))){_0x56574e['limit']=qs[_0xbc4c('0x1b')](_0x2ac3c8[_0xbc4c('0x30')][_0xbc4c('0x1b')]);_0x56574e[_0xbc4c('0x19')]=qs['offset'](_0x2ac3c8['query']['offset']);}_0x56574e[_0xbc4c('0x38')]=qs[_0xbc4c('0x39')](_0x2ac3c8[_0xbc4c('0x30')]['sort']);_0x56574e[_0xbc4c('0x3a')]=qs[_0xbc4c('0x31')](_['pick'](_0x2ac3c8[_0xbc4c('0x30')],_0x15d728[_0xbc4c('0x31')]),_0x300ccf);if(_0x2ac3c8[_0xbc4c('0x30')][_0xbc4c('0x3b')]){_0x56574e[_0xbc4c('0x3a')]=_[_0xbc4c('0x3c')](_0x56574e[_0xbc4c('0x3a')],{'$or':_[_0xbc4c('0x2a')](_0x300ccf,function(_0xa574ba){if(_0xa574ba['type']!=='VIRTUAL'){var _0x1d9c64={};_0x1d9c64[_0xa574ba['name']]={'$like':'%'+_0x2ac3c8[_0xbc4c('0x30')][_0xbc4c('0x3b')]+'%'};return _0x1d9c64;}})});}_0x56574e=_[_0xbc4c('0x3c')]({},_0x56574e,_0x2ac3c8[_0xbc4c('0x3d')]);var _0x21558c={'where':_0x56574e[_0xbc4c('0x3a')]};return db[_0xbc4c('0x3e')][_0xbc4c('0x1c')](_0x21558c)[_0xbc4c('0x23')](function(_0x5ba0b1){_0xea36a[_0xbc4c('0x1c')]=_0x5ba0b1;if(_0x2ac3c8[_0xbc4c('0x30')]['includeAll']){_0x56574e[_0xbc4c('0x3f')]=[{'all':!![]}];}return db[_0xbc4c('0x3e')][_0xbc4c('0x40')](_0x56574e);})[_0xbc4c('0x23')](function(_0x3a840f){_0xea36a[_0xbc4c('0x41')]=_0x3a840f;return _0xea36a;})[_0xbc4c('0x23')](respondWithFilteredResult(_0x229855,_0x56574e))['catch'](handleError(_0x229855,null));};exports['show']=function(_0x4da6e1,_0x139165){var _0x666804={'raw':![],'where':{'id':_0x4da6e1[_0xbc4c('0x42')]['id']}},_0x3eae59={};_0x3eae59[_0xbc4c('0x2f')]=_[_0xbc4c('0x43')](db[_0xbc4c('0x3e')]['rawAttributes']);_0x3eae59[_0xbc4c('0x30')]=_[_0xbc4c('0x43')](_0x4da6e1[_0xbc4c('0x30')]);_0x3eae59[_0xbc4c('0x31')]=_[_0xbc4c('0x32')](_0x3eae59[_0xbc4c('0x2f')],_0x3eae59['query']);_0x666804['attributes']=_['intersection'](_0x3eae59[_0xbc4c('0x2f')],qs['fields'](_0x4da6e1[_0xbc4c('0x30')]['fields']));_0x666804[_0xbc4c('0x34')]=_0x666804[_0xbc4c('0x34')][_0xbc4c('0x35')]?_0x666804['attributes']:_0x3eae59['model'];if(_0x4da6e1[_0xbc4c('0x30')][_0xbc4c('0x44')]){_0x666804['include']=[{'all':!![]}];}_0x666804=_['merge']({},_0x666804,_0x4da6e1[_0xbc4c('0x3d')]);return db[_0xbc4c('0x3e')][_0xbc4c('0x45')](_0x666804)[_0xbc4c('0x23')](handleEntityNotFound(_0x139165,null))['then'](respondWithResult(_0x139165,null))[_0xbc4c('0x46')](handleError(_0x139165,null));};exports['create']=function(_0xe3504c,_0x29db29){return db[_0xbc4c('0x3e')][_0xbc4c('0x47')](_0xe3504c['body'],{})['then'](respondWithResult(_0x29db29,0xc9))[_0xbc4c('0x46')](handleError(_0x29db29,null));};exports[_0xbc4c('0x48')]=function(_0x7780bf,_0x1d6e0f){if(_0x7780bf[_0xbc4c('0x49')]['id']){delete _0x7780bf['body']['id'];}return db[_0xbc4c('0x3e')]['find']({'where':{'id':_0x7780bf[_0xbc4c('0x42')]['id']}})[_0xbc4c('0x23')](handleEntityNotFound(_0x1d6e0f,null))[_0xbc4c('0x23')](saveUpdates(_0x7780bf[_0xbc4c('0x49')],null))[_0xbc4c('0x23')](respondWithResult(_0x1d6e0f,null))[_0xbc4c('0x46')](handleError(_0x1d6e0f,null));};exports[_0xbc4c('0x24')]=function(_0x337259,_0x58c812){return db[_0xbc4c('0x3e')][_0xbc4c('0x45')]({'where':{'id':_0x337259[_0xbc4c('0x42')]['id']}})[_0xbc4c('0x23')](handleEntityNotFound(_0x58c812,null))[_0xbc4c('0x23')](removeEntity(_0x58c812,null))[_0xbc4c('0x46')](handleError(_0x58c812,null));};exports[_0xbc4c('0x4a')]=function(_0x47690e,_0x40ca6f,_0x16eb93){var _0x1f6b66={};var _0x3018b0={};var _0x205f16;var _0x1fa853;return db[_0xbc4c('0x3e')][_0xbc4c('0x4b')]({'where':{'id':_0x47690e['params']['id']}})['then'](handleEntityNotFound(_0x40ca6f,null))['then'](function(_0x1576c8){if(_0x1576c8){_0x205f16=_0x1576c8;_0x3018b0['model']=_[_0xbc4c('0x43')](db[_0xbc4c('0x4c')]['rawAttributes']);_0x3018b0[_0xbc4c('0x30')]=_['keys'](_0x47690e[_0xbc4c('0x30')]);_0x3018b0[_0xbc4c('0x31')]=_['intersection'](_0x3018b0[_0xbc4c('0x2f')],_0x3018b0[_0xbc4c('0x30')]);_0x1f6b66[_0xbc4c('0x34')]=_['intersection'](_0x3018b0[_0xbc4c('0x2f')],qs[_0xbc4c('0x33')](_0x47690e['query'][_0xbc4c('0x33')]));_0x1f6b66[_0xbc4c('0x34')]=_0x1f6b66[_0xbc4c('0x34')][_0xbc4c('0x35')]?_0x1f6b66[_0xbc4c('0x34')]:_0x3018b0[_0xbc4c('0x2f')];_0x1f6b66['order']=qs[_0xbc4c('0x39')](_0x47690e[_0xbc4c('0x30')][_0xbc4c('0x39')]);_0x1f6b66[_0xbc4c('0x3a')]=qs[_0xbc4c('0x31')](_[_0xbc4c('0x4d')](_0x47690e[_0xbc4c('0x30')],_0x3018b0[_0xbc4c('0x31')]));if(_0x47690e[_0xbc4c('0x30')][_0xbc4c('0x3b')]){_0x1f6b66[_0xbc4c('0x3a')]=_[_0xbc4c('0x3c')](_0x1f6b66['where'],{'$or':_[_0xbc4c('0x2a')](_0x1f6b66[_0xbc4c('0x34')],function(_0x38432e){var _0x201956={};_0x201956[_0x38432e]={'$like':'%'+_0x47690e[_0xbc4c('0x30')][_0xbc4c('0x3b')]+'%'};return _0x201956;})});}_0x1f6b66=_[_0xbc4c('0x3c')]({},_0x1f6b66,_0x47690e[_0xbc4c('0x3d')]);return _0x205f16['getConfigurations'](_0x1f6b66);}})[_0xbc4c('0x23')](function(_0x186357){if(_0x186357){_0x1fa853=_0x186357[_0xbc4c('0x35')];if(!_0x47690e[_0xbc4c('0x30')][_0xbc4c('0x36')](_0xbc4c('0x37'))){_0x1f6b66[_0xbc4c('0x1b')]=qs[_0xbc4c('0x1b')](_0x47690e[_0xbc4c('0x30')]['limit']);_0x1f6b66[_0xbc4c('0x19')]=qs[_0xbc4c('0x19')](_0x47690e[_0xbc4c('0x30')][_0xbc4c('0x19')]);}return _0x205f16[_0xbc4c('0x4a')](_0x1f6b66);}})[_0xbc4c('0x23')](function(_0xdf5279){if(_0xdf5279){return _0xdf5279?{'count':_0x1fa853,'rows':_0xdf5279}:null;}})[_0xbc4c('0x23')](respondWithResult(_0x40ca6f,null))[_0xbc4c('0x46')](handleError(_0x40ca6f,null));};exports[_0xbc4c('0x4e')]=function(_0x5c2f4e,_0x310f43,_0x18354d){if(_0x5c2f4e[_0xbc4c('0x49')]['id']){delete _0x5c2f4e['body']['id'];}return db[_0xbc4c('0x3e')][_0xbc4c('0x4b')]({'where':{'id':_0x5c2f4e[_0xbc4c('0x42')]['id']}})[_0xbc4c('0x23')](handleEntityNotFound(_0x310f43,null))[_0xbc4c('0x23')](function(_0x5b7638){if(_0x5b7638){_0x5c2f4e[_0xbc4c('0x49')][_0xbc4c('0x4f')]=_0x5b7638['id'];_0x5c2f4e[_0xbc4c('0x49')][_0xbc4c('0x50')]=integrations[_0xbc4c('0x51')](_0x5c2f4e['body'][_0xbc4c('0x52')],_0x5c2f4e[_0xbc4c('0x49')][_0xbc4c('0x2d')]);_0x5c2f4e[_0xbc4c('0x49')][_0xbc4c('0x53')]=integrations[_0xbc4c('0x54')](_0x5c2f4e[_0xbc4c('0x49')]['channel'],_0x5c2f4e[_0xbc4c('0x49')][_0xbc4c('0x2d')]);return db['ZohoConfiguration'][_0xbc4c('0x47')](_0x5c2f4e['body'],{'include':[{'model':db[_0xbc4c('0x55')],'as':_0xbc4c('0x50')},{'model':db['ZohoField'],'as':_0xbc4c('0x53')}]});}return null;})[_0xbc4c('0x23')](respondWithResult(_0x310f43,null))[_0xbc4c('0x46')](handleError(_0x310f43,null));};function getAccessToken(_0x166c94){return new Promise(function(_0x235055,_0xb598e1){var _0x1494a9;switch(_0x166c94[_0xbc4c('0x56')]){case'US':_0x1494a9='https://accounts.zoho.com';break;case'AU':_0x1494a9='https://accounts.zoho.com.au';break;case'EU':_0x1494a9=_0xbc4c('0x57');break;case'IN':_0x1494a9=_0xbc4c('0x58');break;case'CN':_0x1494a9=_0xbc4c('0x59');break;default:_0x1494a9='https://accounts.zoho.eu';break;}var _0x35dd35={'method':_0xbc4c('0x5a'),'uri':_0x1494a9+_0xbc4c('0x5b'),'qs':{'refresh_token':_0x166c94[_0xbc4c('0x5c')],'client_id':_0x166c94[_0xbc4c('0x5d')],'client_secret':_0x166c94[_0xbc4c('0x5e')],'grant_type':_0xbc4c('0x5f')},'json':!![]};return rp(_0x35dd35)[_0xbc4c('0x23')](function(_0x534ef9){if(_0x534ef9[_0xbc4c('0x60')]){_0x235055(_0x534ef9[_0xbc4c('0x60')]);}else{_0xb598e1(_0xbc4c('0x61'));}})['catch'](function(_0x48fce2){_0xb598e1(_0x48fce2);});});}exports[_0xbc4c('0x62')]=function(_0x5068c8,_0x202d65,_0x12dc36){var _0x48db69,_0x40113c,_0x2bfc4e,_0x317089,_0x3bf87b;return db[_0xbc4c('0x3e')][_0xbc4c('0x4b')]({'where':{'id':_0x5068c8[_0xbc4c('0x42')]['id']},'attributes':['id',_0xbc4c('0x63'),_0xbc4c('0x56'),_0xbc4c('0x5d'),_0xbc4c('0x5e'),_0xbc4c('0x64'),'code',_0xbc4c('0x5c')]})['then'](handleEntityNotFound(_0x202d65,null))[_0xbc4c('0x23')](function(_0x44ecff){_0x3bf87b=_0x44ecff;_0x48db69=_0x3bf87b[_0xbc4c('0x63')];_0x40113c=_0x48db69==='zoho.eu'?'eu':'com';_0x2bfc4e=_0x3bf87b[_0xbc4c('0x64')];var _0x5ddc93=_0x2bfc4e[_0xbc4c('0x65')](-0x1);if(_0x5ddc93==='/'||_0x5ddc93==='\x5c'||_0x5ddc93===':'){_0x2bfc4e=_0x2bfc4e[_0xbc4c('0x66')](0x0,_0x2bfc4e[_0xbc4c('0x67')](_0x5ddc93));}if(!_0x3bf87b[_0xbc4c('0x5c')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3bf87b);})[_0xbc4c('0x23')](function(_0x1c602b){if(_0x1c602b){return rp({'method':_0xbc4c('0x68'),'uri':util[_0xbc4c('0x69')](_0xbc4c('0x6a'),_0x40113c),'qs':{'module':'Calls'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1c602b},'json':!![]});}})[_0xbc4c('0x23')](function(_0x218251){if(_0x218251){if(_0x218251[_0xbc4c('0x6b')]&&_0x218251[_0xbc4c('0x6b')][_0xbc4c('0x26')]){throw new Error(_0x218251[_0xbc4c('0x6b')]['error'][_0xbc4c('0x6c')]);}var _0x38f3a1=[];var _0x152616=[];var _0x5b9236=[_0xbc4c('0x6d'),_0xbc4c('0x6e'),_0xbc4c('0x6f'),_0xbc4c('0x70'),_0xbc4c('0x71'),_0xbc4c('0x72'),_0xbc4c('0x73'),_0xbc4c('0x74')];_0x152616=_['remove'](_0x218251[_0xbc4c('0x33')],function(_0x488c0f){return _0x5b9236[_0xbc4c('0x75')](_0x488c0f[_0xbc4c('0x76')]);});for(var _0x83ee82=0x0;_0x83ee82<_0x152616[_0xbc4c('0x35')];_0x83ee82++){if(_0x152616[_0x83ee82]['system_mandatory']===![]){_0x38f3a1[_0xbc4c('0x77')]({'id':_0x152616[_0x83ee82]['id'],'name':_0x152616[_0x83ee82]['display_label'],'custom':_0x152616[_0x83ee82]['custom_field'],'options':_0x152616[_0x83ee82][_0xbc4c('0x78')]===_0xbc4c('0x79')&&_0x152616[_0x83ee82][_0xbc4c('0x7a')][_0xbc4c('0x35')]>-0x1?_[_0xbc4c('0x2a')](_0x152616[_0x83ee82][_0xbc4c('0x7a')],function(_0x73154){return{'name':_0x73154,'value':_0x73154};}):[]});}}return{'count':_0x38f3a1[_0xbc4c('0x35')],'rows':_0x38f3a1};}else{return{'count':0x0,'rows':[]};}})[_0xbc4c('0x23')](respondWithResult(_0x202d65,null))[_0xbc4c('0x46')](function(_0x18a5bc){var _0x4c7467=_0x5068c8[_0xbc4c('0x30')]['test']?0x1f4:_0x18a5bc[_0xbc4c('0x7b')]||0x1f4;logger[_0xbc4c('0x26')](_0xbc4c('0x7c'),'getFields',_0x4c7467,JSON[_0xbc4c('0x7d')](_0x18a5bc));delete _0x18a5bc[_0xbc4c('0x28')];if(_0x4c7467===0x191){_0x4c7467=0x190;}_0x202d65[_0xbc4c('0x18')](_0x4c7467)[_0xbc4c('0x7e')](_0x5068c8['query']['test']?{'message':_0xbc4c('0x7f'),'statusCode':_0x18a5bc['statusCode']}:_0x18a5bc);});};
\ No newline at end of file
+var _0x8409=['addConfiguration','findOne','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','remove','includes','system_mandatory','custom_field','data_type','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','limit','undefined','count','set','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','ZohoAccount','includeAll','findAll','catch','show','include','create','body','find','params','getConfigurations','filter'];(function(_0x30d249,_0xe500b9){var _0xa668f7=function(_0x3ddd61){while(--_0x3ddd61){_0x30d249['push'](_0x30d249['shift']());}};_0xa668f7(++_0xe500b9);}(_0x8409,0xaf));var _0x9840=function(_0x482d73,_0x58f50c){_0x482d73=_0x482d73-0x0;var _0x5725bd=_0x8409[_0x482d73];return _0x5725bd;};'use strict';var emlformat=require(_0x9840('0x0'));var rimraf=require(_0x9840('0x1'));var zipdir=require(_0x9840('0x2'));var jsonpatch=require(_0x9840('0x3'));var rp=require(_0x9840('0x4'));var moment=require(_0x9840('0x5'));var BPromise=require(_0x9840('0x6'));var Mustache=require(_0x9840('0x7'));var util=require(_0x9840('0x8'));var path=require(_0x9840('0x9'));var sox=require(_0x9840('0xa'));var csv=require(_0x9840('0xb'));var ejs=require(_0x9840('0xc'));var fs=require('fs');var fs_extra=require(_0x9840('0xd'));var _=require('lodash');var squel=require(_0x9840('0xe'));var crypto=require(_0x9840('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9840('0x10'));var Papa=require('papaparse');var Redis=require(_0x9840('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9840('0x12'));var as=require(_0x9840('0x13'));var hardwareService=require(_0x9840('0x14'));var logger=require(_0x9840('0x15'))(_0x9840('0x16'));var utils=require(_0x9840('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9840('0x18'));var db=require(_0x9840('0x19'))['db'];var integrations=require(_0x9840('0x1a'));function respondWithStatusCode(_0x3e27f4,_0x47ac55){_0x47ac55=_0x47ac55||0xcc;return function(_0x3decc3){if(_0x3decc3){return _0x3e27f4['sendStatus'](_0x47ac55);}return _0x3e27f4[_0x9840('0x1b')](_0x47ac55)[_0x9840('0x1c')]();};}function respondWithResult(_0x52f38e,_0xf9b21f){_0xf9b21f=_0xf9b21f||0xc8;return function(_0x34d23e){if(_0x34d23e){return _0x52f38e[_0x9840('0x1b')](_0xf9b21f)['json'](_0x34d23e);}};}function respondWithFilteredResult(_0x5dfeb2,_0x27ea07){return function(_0x2fb910){if(_0x2fb910){var _0x110888=typeof _0x27ea07[_0x9840('0x1d')]==='undefined'&&typeof _0x27ea07[_0x9840('0x1e')]===_0x9840('0x1f');var _0x147e89=_0x2fb910[_0x9840('0x20')];var _0x5226a5=_0x110888?0x0:_0x27ea07[_0x9840('0x1d')];var _0x22d35c=_0x110888?_0x2fb910[_0x9840('0x20')]:_0x27ea07[_0x9840('0x1d')]+_0x27ea07[_0x9840('0x1e')];var _0x444d44;if(_0x22d35c>=_0x147e89){_0x22d35c=_0x147e89;_0x444d44=0xc8;}else{_0x444d44=0xce;}_0x5dfeb2['status'](_0x444d44);return _0x5dfeb2[_0x9840('0x21')]('Content-Range',_0x5226a5+'-'+_0x22d35c+'/'+_0x147e89)[_0x9840('0x22')](_0x2fb910);}return null;};}function patchUpdates(_0x119f29){return function(_0x546e22){try{jsonpatch['apply'](_0x546e22,_0x119f29,!![]);}catch(_0x591185){return BPromise[_0x9840('0x23')](_0x591185);}return _0x546e22[_0x9840('0x24')]();};}function saveUpdates(_0x3cadd5,_0x4682be){return function(_0xafadba){if(_0xafadba){return _0xafadba[_0x9840('0x25')](_0x3cadd5)['then'](function(_0x37e321){return _0x37e321;});}return null;};}function removeEntity(_0x4ed861,_0x52c1a2){return function(_0x32d3c1){if(_0x32d3c1){return _0x32d3c1[_0x9840('0x26')]()[_0x9840('0x27')](function(){_0x4ed861[_0x9840('0x1b')](0xcc)[_0x9840('0x1c')]();});}};}function handleEntityNotFound(_0xe61c7b,_0x2736bd){return function(_0x299852){if(!_0x299852){_0xe61c7b[_0x9840('0x28')](0x194);}return _0x299852;};}function handleError(_0x18e3d4,_0x438957){_0x438957=_0x438957||0x1f4;return function(_0x4bdeea){logger[_0x9840('0x29')](_0x4bdeea[_0x9840('0x2a')]);if(_0x4bdeea[_0x9840('0x2b')]){delete _0x4bdeea[_0x9840('0x2b')];}_0x18e3d4[_0x9840('0x1b')](_0x438957)[_0x9840('0x2c')](_0x4bdeea);};}exports[_0x9840('0x2d')]=function(_0x2e1d60,_0x38fccc){var _0x112161={},_0x459067={},_0x518c2d={'count':0x0,'rows':[]};var _0x2b8092=_[_0x9840('0x2e')](db['ZohoAccount'][_0x9840('0x2f')],function(_0x21dafb){return{'name':_0x21dafb[_0x9840('0x30')],'type':_0x21dafb[_0x9840('0x31')][_0x9840('0x32')]};});_0x459067[_0x9840('0x33')]=_[_0x9840('0x2e')](_0x2b8092,'name');_0x459067[_0x9840('0x34')]=_[_0x9840('0x35')](_0x2e1d60[_0x9840('0x34')]);_0x459067[_0x9840('0x36')]=_[_0x9840('0x37')](_0x459067['model'],_0x459067['query']);_0x112161[_0x9840('0x38')]=_[_0x9840('0x37')](_0x459067[_0x9840('0x33')],qs['fields'](_0x2e1d60[_0x9840('0x34')][_0x9840('0x39')]));_0x112161[_0x9840('0x38')]=_0x112161[_0x9840('0x38')][_0x9840('0x3a')]?_0x112161[_0x9840('0x38')]:_0x459067[_0x9840('0x33')];if(!_0x2e1d60[_0x9840('0x34')][_0x9840('0x3b')](_0x9840('0x3c'))){_0x112161['limit']=qs[_0x9840('0x1e')](_0x2e1d60['query'][_0x9840('0x1e')]);_0x112161[_0x9840('0x1d')]=qs[_0x9840('0x1d')](_0x2e1d60[_0x9840('0x34')][_0x9840('0x1d')]);}_0x112161[_0x9840('0x3d')]=qs[_0x9840('0x3e')](_0x2e1d60[_0x9840('0x34')]['sort']);_0x112161[_0x9840('0x3f')]=qs[_0x9840('0x36')](_[_0x9840('0x40')](_0x2e1d60['query'],_0x459067[_0x9840('0x36')]),_0x2b8092);if(_0x2e1d60[_0x9840('0x34')]['filter']){_0x112161[_0x9840('0x3f')]=_[_0x9840('0x41')](_0x112161[_0x9840('0x3f')],{'$or':_['map'](_0x2b8092,function(_0x217b90){if(_0x217b90[_0x9840('0x31')]!=='VIRTUAL'){var _0x481a37={};_0x481a37[_0x217b90[_0x9840('0x2b')]]={'$like':'%'+_0x2e1d60['query']['filter']+'%'};return _0x481a37;}})});}_0x112161=_['merge']({},_0x112161,_0x2e1d60[_0x9840('0x42')]);var _0x3b134a={'where':_0x112161[_0x9840('0x3f')]};return db[_0x9840('0x43')][_0x9840('0x20')](_0x3b134a)['then'](function(_0x5e13e2){_0x518c2d[_0x9840('0x20')]=_0x5e13e2;if(_0x2e1d60[_0x9840('0x34')][_0x9840('0x44')]){_0x112161['include']=[{'all':!![]}];}return db[_0x9840('0x43')][_0x9840('0x45')](_0x112161);})[_0x9840('0x27')](function(_0x23d27e){_0x518c2d['rows']=_0x23d27e;return _0x518c2d;})[_0x9840('0x27')](respondWithFilteredResult(_0x38fccc,_0x112161))[_0x9840('0x46')](handleError(_0x38fccc,null));};exports[_0x9840('0x47')]=function(_0x69968b,_0x2923fb){var _0x596263={'raw':![],'where':{'id':_0x69968b['params']['id']}},_0x4853b7={};_0x4853b7[_0x9840('0x33')]=_[_0x9840('0x35')](db['ZohoAccount']['rawAttributes']);_0x4853b7[_0x9840('0x34')]=_[_0x9840('0x35')](_0x69968b[_0x9840('0x34')]);_0x4853b7['filters']=_[_0x9840('0x37')](_0x4853b7['model'],_0x4853b7[_0x9840('0x34')]);_0x596263['attributes']=_[_0x9840('0x37')](_0x4853b7[_0x9840('0x33')],qs[_0x9840('0x39')](_0x69968b['query'][_0x9840('0x39')]));_0x596263['attributes']=_0x596263[_0x9840('0x38')][_0x9840('0x3a')]?_0x596263[_0x9840('0x38')]:_0x4853b7['model'];if(_0x69968b[_0x9840('0x34')]['includeAll']){_0x596263[_0x9840('0x48')]=[{'all':!![]}];}_0x596263=_['merge']({},_0x596263,_0x69968b[_0x9840('0x42')]);return db[_0x9840('0x43')]['find'](_0x596263)[_0x9840('0x27')](handleEntityNotFound(_0x2923fb,null))[_0x9840('0x27')](respondWithResult(_0x2923fb,null))['catch'](handleError(_0x2923fb,null));};exports[_0x9840('0x49')]=function(_0x5300f4,_0x4afd7f){return db[_0x9840('0x43')][_0x9840('0x49')](_0x5300f4[_0x9840('0x4a')],{})[_0x9840('0x27')](respondWithResult(_0x4afd7f,0xc9))[_0x9840('0x46')](handleError(_0x4afd7f,null));};exports[_0x9840('0x25')]=function(_0x293bf6,_0x44ab34){if(_0x293bf6[_0x9840('0x4a')]['id']){delete _0x293bf6[_0x9840('0x4a')]['id'];}return db['ZohoAccount'][_0x9840('0x4b')]({'where':{'id':_0x293bf6[_0x9840('0x4c')]['id']}})[_0x9840('0x27')](handleEntityNotFound(_0x44ab34,null))[_0x9840('0x27')](saveUpdates(_0x293bf6[_0x9840('0x4a')],null))[_0x9840('0x27')](respondWithResult(_0x44ab34,null))[_0x9840('0x46')](handleError(_0x44ab34,null));};exports[_0x9840('0x26')]=function(_0x2552d2,_0x35d92e){return db[_0x9840('0x43')]['find']({'where':{'id':_0x2552d2[_0x9840('0x4c')]['id']}})[_0x9840('0x27')](handleEntityNotFound(_0x35d92e,null))['then'](removeEntity(_0x35d92e,null))[_0x9840('0x46')](handleError(_0x35d92e,null));};exports[_0x9840('0x4d')]=function(_0x1df038,_0x226821,_0x34cca0){var _0x334755={};var _0x31cebc={};var _0x46b0eb;var _0x343ea2;return db[_0x9840('0x43')]['findOne']({'where':{'id':_0x1df038[_0x9840('0x4c')]['id']}})[_0x9840('0x27')](handleEntityNotFound(_0x226821,null))[_0x9840('0x27')](function(_0x4e4dd7){if(_0x4e4dd7){_0x46b0eb=_0x4e4dd7;_0x31cebc['model']=_[_0x9840('0x35')](db['ZohoConfiguration']['rawAttributes']);_0x31cebc['query']=_[_0x9840('0x35')](_0x1df038[_0x9840('0x34')]);_0x31cebc[_0x9840('0x36')]=_['intersection'](_0x31cebc['model'],_0x31cebc[_0x9840('0x34')]);_0x334755['attributes']=_[_0x9840('0x37')](_0x31cebc[_0x9840('0x33')],qs[_0x9840('0x39')](_0x1df038[_0x9840('0x34')][_0x9840('0x39')]));_0x334755[_0x9840('0x38')]=_0x334755[_0x9840('0x38')][_0x9840('0x3a')]?_0x334755['attributes']:_0x31cebc[_0x9840('0x33')];_0x334755[_0x9840('0x3d')]=qs[_0x9840('0x3e')](_0x1df038['query'][_0x9840('0x3e')]);_0x334755[_0x9840('0x3f')]=qs[_0x9840('0x36')](_[_0x9840('0x40')](_0x1df038[_0x9840('0x34')],_0x31cebc[_0x9840('0x36')]));if(_0x1df038['query'][_0x9840('0x4e')]){_0x334755[_0x9840('0x3f')]=_[_0x9840('0x41')](_0x334755[_0x9840('0x3f')],{'$or':_['map'](_0x334755[_0x9840('0x38')],function(_0x507ff4){var _0x523a22={};_0x523a22[_0x507ff4]={'$like':'%'+_0x1df038['query'][_0x9840('0x4e')]+'%'};return _0x523a22;})});}_0x334755=_[_0x9840('0x41')]({},_0x334755,_0x1df038[_0x9840('0x42')]);return _0x46b0eb[_0x9840('0x4d')](_0x334755);}})[_0x9840('0x27')](function(_0x238723){if(_0x238723){_0x343ea2=_0x238723[_0x9840('0x3a')];if(!_0x1df038[_0x9840('0x34')][_0x9840('0x3b')](_0x9840('0x3c'))){_0x334755[_0x9840('0x1e')]=qs['limit'](_0x1df038[_0x9840('0x34')][_0x9840('0x1e')]);_0x334755['offset']=qs[_0x9840('0x1d')](_0x1df038['query'][_0x9840('0x1d')]);}return _0x46b0eb[_0x9840('0x4d')](_0x334755);}})[_0x9840('0x27')](function(_0x2182d9){if(_0x2182d9){return _0x2182d9?{'count':_0x343ea2,'rows':_0x2182d9}:null;}})[_0x9840('0x27')](respondWithResult(_0x226821,null))[_0x9840('0x46')](handleError(_0x226821,null));};exports[_0x9840('0x4f')]=function(_0x29348e,_0xa59cd8,_0xe89cf6){if(_0x29348e[_0x9840('0x4a')]['id']){delete _0x29348e[_0x9840('0x4a')]['id'];}return db[_0x9840('0x43')][_0x9840('0x50')]({'where':{'id':_0x29348e[_0x9840('0x4c')]['id']}})['then'](handleEntityNotFound(_0xa59cd8,null))[_0x9840('0x27')](function(_0x5ee05f){if(_0x5ee05f){_0x29348e[_0x9840('0x4a')]['AccountId']=_0x5ee05f['id'];_0x29348e['body']['Subjects']=integrations['getSubjects'](_0x29348e['body'][_0x9840('0x51')],_0x29348e['body'][_0x9840('0x31')]);_0x29348e['body'][_0x9840('0x52')]=integrations[_0x9840('0x53')](_0x29348e['body']['channel'],_0x29348e[_0x9840('0x4a')][_0x9840('0x31')]);return db[_0x9840('0x54')]['create'](_0x29348e['body'],{'include':[{'model':db[_0x9840('0x55')],'as':_0x9840('0x56')},{'model':db[_0x9840('0x55')],'as':_0x9840('0x52')}]});}return null;})['then'](respondWithResult(_0xa59cd8,null))[_0x9840('0x46')](handleError(_0xa59cd8,null));};function getAccessToken(_0x372f60){return new Promise(function(_0x5a8558,_0x54a301){var _0x478265;switch(_0x372f60[_0x9840('0x57')]){case'US':_0x478265=_0x9840('0x58');break;case'AU':_0x478265='https://accounts.zoho.com.au';break;case'EU':_0x478265=_0x9840('0x59');break;case'IN':_0x478265=_0x9840('0x5a');break;case'CN':_0x478265=_0x9840('0x5b');break;default:_0x478265=_0x9840('0x59');break;}var _0x35d75f={'method':'POST','uri':_0x478265+_0x9840('0x5c'),'qs':{'refresh_token':_0x372f60[_0x9840('0x5d')],'client_id':_0x372f60[_0x9840('0x5e')],'client_secret':_0x372f60[_0x9840('0x5f')],'grant_type':_0x9840('0x60')},'json':!![]};return rp(_0x35d75f)[_0x9840('0x27')](function(_0xec2b20){if(_0xec2b20[_0x9840('0x61')]){_0x5a8558(_0xec2b20[_0x9840('0x61')]);}else{_0x54a301(_0x9840('0x62'));}})[_0x9840('0x46')](function(_0x4cd358){_0x54a301(_0x4cd358);});});}exports[_0x9840('0x63')]=function(_0x1bb75a,_0x4c1bfb,_0x1a54dc){var _0x909a4b,_0x5bc7ec,_0x2b0df7,_0x25d333,_0x4a87bb;return db[_0x9840('0x43')][_0x9840('0x50')]({'where':{'id':_0x1bb75a[_0x9840('0x4c')]['id']},'attributes':['id',_0x9840('0x64'),_0x9840('0x57'),_0x9840('0x5e'),_0x9840('0x5f'),_0x9840('0x65'),'code',_0x9840('0x5d')]})[_0x9840('0x27')](handleEntityNotFound(_0x4c1bfb,null))['then'](function(_0x5b3f67){_0x4a87bb=_0x5b3f67;_0x909a4b=_0x4a87bb['host'];_0x5bc7ec=_0x909a4b==='zoho.eu'?'eu':'com';_0x2b0df7=_0x4a87bb[_0x9840('0x65')];var _0x430072=_0x2b0df7[_0x9840('0x66')](-0x1);if(_0x430072==='/'||_0x430072==='\x5c'||_0x430072===':'){_0x2b0df7=_0x2b0df7['substring'](0x0,_0x2b0df7['lastIndexOf'](_0x430072));}if(!_0x4a87bb[_0x9840('0x5d')]){throw new Error(_0x9840('0x67'));}return getAccessToken(_0x4a87bb);})[_0x9840('0x27')](function(_0x2a46c5){if(_0x2a46c5){return rp({'method':_0x9840('0x68'),'uri':util[_0x9840('0x69')](_0x9840('0x6a'),_0x5bc7ec),'qs':{'module':'Calls'},'headers':{'Authorization':_0x9840('0x6b')+_0x2a46c5},'json':!![]});}})['then'](function(_0x5172f5){if(_0x5172f5){if(_0x5172f5[_0x9840('0x6c')]&&_0x5172f5['response'][_0x9840('0x29')]){throw new Error(_0x5172f5[_0x9840('0x6c')]['error'][_0x9840('0x6d')]);}var _0xb24fc1=[];var _0x289652=[];var _0x2869df=[_0x9840('0x6e'),_0x9840('0x6f'),_0x9840('0x70'),_0x9840('0x71'),'Call_Duration',_0x9840('0x72'),_0x9840('0x73'),'Call_Type'];_0x289652=_[_0x9840('0x74')](_0x5172f5[_0x9840('0x39')],function(_0x1a629d){return _0x2869df[_0x9840('0x75')](_0x1a629d['api_name']);});for(var _0x52a7d7=0x0;_0x52a7d7<_0x289652[_0x9840('0x3a')];_0x52a7d7++){if(_0x289652[_0x52a7d7][_0x9840('0x76')]===![]){_0xb24fc1['push']({'id':_0x289652[_0x52a7d7]['id'],'name':_0x289652[_0x52a7d7]['display_label'],'custom':_0x289652[_0x52a7d7][_0x9840('0x77')],'options':_0x289652[_0x52a7d7][_0x9840('0x78')]===_0x9840('0x79')&&_0x289652[_0x52a7d7][_0x9840('0x7a')]['length']>-0x1?_['map'](_0x289652[_0x52a7d7][_0x9840('0x7a')],function(_0x3a6dd1){return{'name':_0x3a6dd1,'value':_0x3a6dd1};}):[]});}}return{'count':_0xb24fc1[_0x9840('0x3a')],'rows':_0xb24fc1};}else{return{'count':0x0,'rows':[]};}})[_0x9840('0x27')](respondWithResult(_0x4c1bfb,null))[_0x9840('0x46')](function(_0x4321ab){var _0x20dd1c=_0x1bb75a[_0x9840('0x34')][_0x9840('0x7b')]?0x1f4:_0x4321ab['statusCode']||0x1f4;logger[_0x9840('0x29')](_0x9840('0x7c'),'getFields',_0x20dd1c,JSON[_0x9840('0x7d')](_0x4321ab));delete _0x4321ab[_0x9840('0x2b')];if(_0x20dd1c===0x191){_0x20dd1c=0x190;}_0x4c1bfb[_0x9840('0x1b')](_0x20dd1c)[_0x9840('0x2c')](_0x1bb75a['query'][_0x9840('0x7b')]?{'message':_0x9840('0x7e'),'statusCode':_0x4321ab['statusCode']}:_0x4321ab);});};
\ No newline at end of file
index f2f17d8..6f46e3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90bf=['inspect','host','https://accounts.zoho.com','https://accounts.zoho.in','application/x-www-form-urlencoded','info','lodash','../../config/logger','api','moment','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','changed','zone','clientId','clientSecret','serverUrl','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','parse','refresh_token','refreshToken','name','error','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','catch'];(function(_0x3d7ee0,_0x16b1c5){var _0x57f8da=function(_0x2ac33b){while(--_0x2ac33b){_0x3d7ee0['push'](_0x3d7ee0['shift']());}};_0x57f8da(++_0x16b1c5);}(_0x90bf,0x7b));var _0xf90b=function(_0x5b66fd,_0x43f9ec){_0x5b66fd=_0x5b66fd-0x0;var _0x12b52e=_0x90bf[_0x5b66fd];return _0x12b52e;};'use strict';var _=require(_0xf90b('0x0'));var util=require('util');var logger=require(_0xf90b('0x1'))(_0xf90b('0x2'));var moment=require(_0xf90b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf90b('0x4'));var rimraf=require(_0xf90b('0x5'));var config=require('../../config/environment');var attributes=require(_0xf90b('0x6'));var integrations=require(_0xf90b('0x7'));module['exports']=function(_0xf43f99,_0x13cbb1){return _0xf43f99[_0xf90b('0x8')](_0xf90b('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xa5a173,_0xb1724,_0x4d9b0){if(_0xa5a173[_0xf90b('0xa')](_0xf90b('0xb'))||_0xa5a173['changed']('serverUrl')||_0xa5a173[_0xf90b('0xa')](_0xf90b('0xc'))||_0xa5a173['changed'](_0xf90b('0xd'))||_0xa5a173[_0xf90b('0xa')]('code')||_0xa5a173[_0xf90b('0xa')]('host')){var _0x1fd3f6,_0x4e8cfc;_0x1fd3f6=_0xa5a173[_0xf90b('0xe')];var _0x330747=_0x1fd3f6[_0xf90b('0xf')](-0x1);if(_0x330747==='/'||_0x330747==='\x5c'||_0x330747===':'){_0x1fd3f6=_0x1fd3f6[_0xf90b('0x10')](0x0,_0x1fd3f6[_0xf90b('0x11')](_0x330747));}switch(_0xa5a173['zone']){case'US':_0x4e8cfc='https://accounts.zoho.com';break;case'AU':_0x4e8cfc=_0xf90b('0x12');break;case'IN':_0x4e8cfc='https://accounts.zoho.in';break;case'CN':_0x4e8cfc=_0xf90b('0x13');break;default:_0x4e8cfc=_0xf90b('0x14');break;}var _0x10d022={'method':_0xf90b('0x15'),'uri':_0x4e8cfc+_0xf90b('0x16'),'form':{'grant_type':_0xf90b('0x17'),'client_id':_0xa5a173[_0xf90b('0xc')],'client_secret':_0xa5a173['clientSecret'],'redirect_uri':_0xa5a173[_0xf90b('0xe')],'code':_0xa5a173[_0xf90b('0x18')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x10d022)['then'](function(_0x5ece9d){var _0xe8f027=JSON[_0xf90b('0x19')](_0x5ece9d);if(_0xe8f027[_0xf90b('0x1a')]){_0xa5a173[_0xf90b('0x1b')]=_0xe8f027[_0xf90b('0x1a')];logger['info'](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xa5a173[_0xf90b('0x1c')],_0xa5a173['id']));}else{logger[_0xf90b('0x1d')](util[_0xf90b('0x1e')](_0xf90b('0x1f'),_0xa5a173[_0xf90b('0x1c')],_0xa5a173['id']),util['inspect'](_0xe8f027,{'showHidden':![],'depth':null}));}return _0x4d9b0(null,_0xb1724);})[_0xf90b('0x20')](function(_0x37d81d){logger[_0xf90b('0x1d')](util[_0xf90b('0x1e')](_0xf90b('0x1f'),_0xa5a173[_0xf90b('0x1c')],_0xa5a173['id']),util[_0xf90b('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x4d9b0(_0x37d81d);});}else{return _0x4d9b0(null,_0xb1724);}},'beforeUpdate':function(_0x1f9623,_0x4d5eea,_0x5df8cf){if(_0x1f9623[_0xf90b('0xa')]('zone')||_0x1f9623['changed'](_0xf90b('0xe'))||_0x1f9623[_0xf90b('0xa')](_0xf90b('0xc'))||_0x1f9623[_0xf90b('0xa')](_0xf90b('0xd'))||_0x1f9623[_0xf90b('0xa')](_0xf90b('0x18'))||_0x1f9623[_0xf90b('0xa')](_0xf90b('0x22'))){var _0xd3e131,_0x3ba486;_0xd3e131=_0x1f9623['serverUrl'];var _0x29eca2=_0xd3e131[_0xf90b('0xf')](-0x1);if(_0x29eca2==='/'||_0x29eca2==='\x5c'||_0x29eca2===':'){_0xd3e131=_0xd3e131['substring'](0x0,_0xd3e131[_0xf90b('0x11')](_0x29eca2));}switch(_0x1f9623[_0xf90b('0xb')]){case'US':_0x3ba486=_0xf90b('0x23');break;case'AU':_0x3ba486=_0xf90b('0x12');break;case'IN':_0x3ba486=_0xf90b('0x24');break;case'CN':_0x3ba486='https://accounts.zoho.com.cn';break;default:_0x3ba486=_0xf90b('0x14');break;}var _0x27b7b2={'method':'POST','uri':_0x3ba486+_0xf90b('0x16'),'form':{'grant_type':_0xf90b('0x17'),'client_id':_0x1f9623[_0xf90b('0xc')],'client_secret':_0x1f9623[_0xf90b('0xd')],'redirect_uri':_0x1f9623[_0xf90b('0xe')],'code':_0x1f9623[_0xf90b('0x18')]},'headers':{'Content-Type':_0xf90b('0x25')}};return rp(_0x27b7b2)['then'](function(_0xdb0995){var _0x1e7e27=JSON[_0xf90b('0x19')](_0xdb0995);if(_0x1e7e27[_0xf90b('0x1a')]){_0x1f9623[_0xf90b('0x1b')]=_0x1e7e27[_0xf90b('0x1a')];logger[_0xf90b('0x26')](util[_0xf90b('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x1f9623[_0xf90b('0x1c')],_0x1f9623['id']));}else{logger[_0xf90b('0x1d')](util[_0xf90b('0x1e')](_0xf90b('0x1f'),_0x1f9623[_0xf90b('0x1c')],_0x1f9623['id']),util[_0xf90b('0x21')](_0x1e7e27,{'showHidden':![],'depth':null}));}return _0x5df8cf(null,_0x4d5eea);})[_0xf90b('0x20')](function(_0x5b18f2){logger['error'](util[_0xf90b('0x1e')](_0xf90b('0x1f'),_0x1f9623['name'],_0x1f9623['id']),util[_0xf90b('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x5df8cf(_0x5b18f2);});}else{return _0x5df8cf(null,_0x4d5eea);}}}});};
\ No newline at end of file
+var _0x65dd=['define','ZohoAccount','int_zoho_accounts','zone','changed','clientId','clientSecret','code','host','serverUrl','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','application/x-www-form-urlencoded','refreshToken','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x368e0b,_0x2279ab){var _0x16c5a7=function(_0x279d68){while(--_0x279d68){_0x368e0b['push'](_0x368e0b['shift']());}};_0x16c5a7(++_0x2279ab);}(_0x65dd,0x71));var _0xd65d=function(_0x2cd9cb,_0x517de7){_0x2cd9cb=_0x2cd9cb-0x0;var _0x5b3777=_0x65dd[_0x2cd9cb];return _0x5b3777;};'use strict';var _=require(_0xd65d('0x0'));var util=require('util');var logger=require(_0xd65d('0x1'))('api');var moment=require(_0xd65d('0x2'));var BPromise=require(_0xd65d('0x3'));var rp=require(_0xd65d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd65d('0x5'));var config=require(_0xd65d('0x6'));var attributes=require(_0xd65d('0x7'));var integrations=require(_0xd65d('0x8'));module[_0xd65d('0x9')]=function(_0x1647ed,_0x18a6b9){return _0x1647ed[_0xd65d('0xa')](_0xd65d('0xb'),attributes,{'tableName':_0xd65d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x669ea1,_0x482390,_0xabe3d){if(_0x669ea1['changed'](_0xd65d('0xd'))||_0x669ea1[_0xd65d('0xe')]('serverUrl')||_0x669ea1[_0xd65d('0xe')](_0xd65d('0xf'))||_0x669ea1[_0xd65d('0xe')](_0xd65d('0x10'))||_0x669ea1[_0xd65d('0xe')](_0xd65d('0x11'))||_0x669ea1[_0xd65d('0xe')](_0xd65d('0x12'))){var _0x498a7e,_0x493209;_0x498a7e=_0x669ea1[_0xd65d('0x13')];var _0x567c93=_0x498a7e['slice'](-0x1);if(_0x567c93==='/'||_0x567c93==='\x5c'||_0x567c93===':'){_0x498a7e=_0x498a7e['substring'](0x0,_0x498a7e['lastIndexOf'](_0x567c93));}switch(_0x669ea1['zone']){case'US':_0x493209=_0xd65d('0x14');break;case'AU':_0x493209='https://accounts.zoho.com.au';break;case'IN':_0x493209='https://accounts.zoho.in';break;case'CN':_0x493209=_0xd65d('0x15');break;default:_0x493209=_0xd65d('0x16');break;}var _0x2bc416={'method':_0xd65d('0x17'),'uri':_0x493209+_0xd65d('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x669ea1[_0xd65d('0xf')],'client_secret':_0x669ea1[_0xd65d('0x10')],'redirect_uri':_0x669ea1[_0xd65d('0x13')],'code':_0x669ea1[_0xd65d('0x11')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x2bc416)[_0xd65d('0x19')](function(_0x4136e6){var _0x240ce8=JSON[_0xd65d('0x1a')](_0x4136e6);if(_0x240ce8[_0xd65d('0x1b')]){_0x669ea1['refreshToken']=_0x240ce8['refresh_token'];logger[_0xd65d('0x1c')](util[_0xd65d('0x1d')](_0xd65d('0x1e'),_0x669ea1[_0xd65d('0x1f')],_0x669ea1['id']));}else{logger[_0xd65d('0x20')](util[_0xd65d('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x669ea1[_0xd65d('0x1f')],_0x669ea1['id']),util['inspect'](_0x240ce8,{'showHidden':![],'depth':null}));}return _0xabe3d(null,_0x482390);})[_0xd65d('0x21')](function(_0x1f525e){logger[_0xd65d('0x20')](util[_0xd65d('0x1d')](_0xd65d('0x22'),_0x669ea1[_0xd65d('0x1f')],_0x669ea1['id']),util[_0xd65d('0x23')](parsedResult,{'showHidden':![],'depth':null}));return _0xabe3d(_0x1f525e);});}else{return _0xabe3d(null,_0x482390);}},'beforeUpdate':function(_0x186746,_0x56d691,_0x48f38a){if(_0x186746['changed'](_0xd65d('0xd'))||_0x186746[_0xd65d('0xe')](_0xd65d('0x13'))||_0x186746['changed'](_0xd65d('0xf'))||_0x186746[_0xd65d('0xe')](_0xd65d('0x10'))||_0x186746[_0xd65d('0xe')]('code')||_0x186746[_0xd65d('0xe')](_0xd65d('0x12'))){var _0x829db7,_0x10c8d1;_0x829db7=_0x186746['serverUrl'];var _0x1df8c0=_0x829db7['slice'](-0x1);if(_0x1df8c0==='/'||_0x1df8c0==='\x5c'||_0x1df8c0===':'){_0x829db7=_0x829db7['substring'](0x0,_0x829db7[_0xd65d('0x24')](_0x1df8c0));}switch(_0x186746[_0xd65d('0xd')]){case'US':_0x10c8d1='https://accounts.zoho.com';break;case'AU':_0x10c8d1=_0xd65d('0x25');break;case'IN':_0x10c8d1=_0xd65d('0x26');break;case'CN':_0x10c8d1=_0xd65d('0x15');break;default:_0x10c8d1=_0xd65d('0x16');break;}var _0x5efdb8={'method':_0xd65d('0x17'),'uri':_0x10c8d1+_0xd65d('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x186746[_0xd65d('0xf')],'client_secret':_0x186746['clientSecret'],'redirect_uri':_0x186746[_0xd65d('0x13')],'code':_0x186746['code']},'headers':{'Content-Type':_0xd65d('0x27')}};return rp(_0x5efdb8)['then'](function(_0x3160fe){var _0x54414c=JSON[_0xd65d('0x1a')](_0x3160fe);if(_0x54414c['refresh_token']){_0x186746[_0xd65d('0x28')]=_0x54414c[_0xd65d('0x1b')];logger[_0xd65d('0x1c')](util[_0xd65d('0x1d')](_0xd65d('0x1e'),_0x186746[_0xd65d('0x1f')],_0x186746['id']));}else{logger[_0xd65d('0x20')](util[_0xd65d('0x1d')](_0xd65d('0x22'),_0x186746['name'],_0x186746['id']),util['inspect'](_0x54414c,{'showHidden':![],'depth':null}));}return _0x48f38a(null,_0x56d691);})[_0xd65d('0x21')](function(_0x23c13f){logger[_0xd65d('0x20')](util[_0xd65d('0x1d')](_0xd65d('0x22'),_0x186746[_0xd65d('0x1f')],_0x186746['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x48f38a(_0x23c13f);});}else{return _0x48f38a(null,_0x56d691);}}}});};
\ No newline at end of file
index f6b1a7b..1fc739a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fce=['http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ZohoAccount','options','raw','where','attributes','limit','include','model','map','GetZohoAccount','debug','ShowZohoAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client'];(function(_0x1648f5,_0x305515){var _0x1dfc9a=function(_0x56bbd1){while(--_0x56bbd1){_0x1648f5['push'](_0x1648f5['shift']());}};_0x1dfc9a(++_0x305515);}(_0x3fce,0x121));var _0xe3fc=function(_0x4ded50,_0x4a6af3){_0x4ded50=_0x4ded50-0x0;var _0xa92135=_0x3fce[_0x4ded50];return _0xa92135;};'use strict';var _=require('lodash');var util=require(_0xe3fc('0x0'));var moment=require(_0xe3fc('0x1'));var BPromise=require(_0xe3fc('0x2'));var rs=require(_0xe3fc('0x3'));var fs=require('fs');var Redis=require(_0xe3fc('0x4'));var db=require(_0xe3fc('0x5'))['db'];var utils=require(_0xe3fc('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe3fc('0x7')][_0xe3fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x523982,_0x200715,_0x49c611){return new BPromise(function(_0x40660f,_0x4a192d){return client[_0xe3fc('0x9')](_0x523982,_0x49c611)[_0xe3fc('0xa')](function(_0x1bb7be){logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');logger['debug'](_0xe3fc('0xd'),_0x200715,_0xe3fc('0xe'),JSON[_0xe3fc('0xf')](_0x1bb7be));if(_0x1bb7be['error']){if(_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x11')]===0x1f4){logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be[_0xe3fc('0x10')][_0xe3fc('0x12')]);return _0x4a192d(_0x1bb7be[_0xe3fc('0x10')]['message']);}logger[_0xe3fc('0x10')](_0xe3fc('0xc'),_0x200715,_0x1bb7be['error'][_0xe3fc('0x12')]);return _0x40660f(_0x1bb7be[_0xe3fc('0x10')]['message']);}else{logger[_0xe3fc('0xb')](_0xe3fc('0xc'),_0x200715,'request\x20sent');_0x40660f(_0x1bb7be['result']['message']);}})[_0xe3fc('0x13')](function(_0x4283be){logger[_0xe3fc('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x200715,_0x4283be);_0x4a192d(_0x4283be);});});}exports['GetZohoAccount']=function(_0x354695){var _0x5a4d98=this;return new Promise(function(_0x404e04,_0xca0203){return db[_0xe3fc('0x14')]['findAll']({'raw':_0x354695['options']?_0x354695[_0xe3fc('0x15')][_0xe3fc('0x16')]===undefined?!![]:![]:!![],'where':_0x354695[_0xe3fc('0x15')]?_0x354695['options'][_0xe3fc('0x17')]||null:null,'attributes':_0x354695[_0xe3fc('0x15')]?_0x354695['options'][_0xe3fc('0x18')]||null:null,'limit':_0x354695[_0xe3fc('0x15')]?_0x354695['options'][_0xe3fc('0x19')]||null:null,'include':_0x354695[_0xe3fc('0x15')]?_0x354695[_0xe3fc('0x15')]['include']?_['map'](_0x354695[_0xe3fc('0x15')][_0xe3fc('0x1a')],function(_0x55ea5e){return{'model':db[_0x55ea5e[_0xe3fc('0x1b')]],'as':_0x55ea5e['as'],'attributes':_0x55ea5e[_0xe3fc('0x18')],'include':_0x55ea5e[_0xe3fc('0x1a')]?_[_0xe3fc('0x1c')](_0x55ea5e['include'],function(_0x24043a){return{'model':db[_0x24043a['model']],'as':_0x24043a['as'],'attributes':_0x24043a['attributes'],'include':_0x24043a['include']?_['map'](_0x24043a['include'],function(_0x16045e){return{'model':db[_0x16045e[_0xe3fc('0x1b')]],'as':_0x16045e['as'],'attributes':_0x16045e['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3fc('0xa')](function(_0x188ca2){logger['info'](_0xe3fc('0x1d'),_0x354695);logger[_0xe3fc('0x1e')](_0xe3fc('0x1d'),_0x354695,JSON[_0xe3fc('0xf')](_0x188ca2));_0x404e04(_0x188ca2);})[_0xe3fc('0x13')](function(_0x21ccdd){logger[_0xe3fc('0x10')](_0xe3fc('0x1d'),_0x21ccdd[_0xe3fc('0x12')],_0x354695);_0xca0203(_0x5a4d98[_0xe3fc('0x10')](0x1f4,_0x21ccdd[_0xe3fc('0x12')]));});});};exports[_0xe3fc('0x1f')]=function(_0x25a0af){var _0x43714d=this;return new Promise(function(_0x38ab54,_0x1f9ba9){return db['ZohoAccount'][_0xe3fc('0x20')]({'raw':_0x25a0af[_0xe3fc('0x15')]?_0x25a0af[_0xe3fc('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x25a0af[_0xe3fc('0x15')]?_0x25a0af[_0xe3fc('0x15')][_0xe3fc('0x17')]||null:null,'attributes':_0x25a0af['options']?_0x25a0af[_0xe3fc('0x15')][_0xe3fc('0x18')]||null:null,'include':_0x25a0af[_0xe3fc('0x15')]?_0x25a0af[_0xe3fc('0x15')][_0xe3fc('0x1a')]?_[_0xe3fc('0x1c')](_0x25a0af['options'][_0xe3fc('0x1a')],function(_0x3bb70d){return{'model':db[_0x3bb70d[_0xe3fc('0x1b')]],'as':_0x3bb70d['as'],'attributes':_0x3bb70d[_0xe3fc('0x18')],'include':_0x3bb70d[_0xe3fc('0x1a')]?_[_0xe3fc('0x1c')](_0x3bb70d[_0xe3fc('0x1a')],function(_0x888634){return{'model':db[_0x888634[_0xe3fc('0x1b')]],'as':_0x888634['as'],'attributes':_0x888634[_0xe3fc('0x18')],'include':_0x888634[_0xe3fc('0x1a')]?_[_0xe3fc('0x1c')](_0x888634[_0xe3fc('0x1a')],function(_0x4bba26){return{'model':db[_0x4bba26['model']],'as':_0x4bba26['as'],'attributes':_0x4bba26['attributes']};}):[]};}):[]};}):[]:[]})[_0xe3fc('0xa')](function(_0x45a531){logger[_0xe3fc('0xb')](_0xe3fc('0x1f'),_0x25a0af);logger[_0xe3fc('0x1e')](_0xe3fc('0x1f'),_0x25a0af,JSON[_0xe3fc('0xf')](_0x45a531));_0x38ab54(_0x45a531);})[_0xe3fc('0x13')](function(_0x4a5ba9){logger[_0xe3fc('0x10')](_0xe3fc('0x1f'),_0x4a5ba9['message'],_0x25a0af);_0x1f9ba9(_0x43714d[_0xe3fc('0x10')](0x1f4,_0x4a5ba9[_0xe3fc('0x12')]));});});};
\ No newline at end of file
+var _0xf811=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch','findAll','options','where','attributes','limit','map','include','model','GetZohoAccount','ShowZohoAccount','ZohoAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x526d57,_0x306ed6){var _0x42d5e2=function(_0x394016){while(--_0x394016){_0x526d57['push'](_0x526d57['shift']());}};_0x42d5e2(++_0x306ed6);}(_0xf811,0x6f));var _0x1f81=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xf811[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require(_0x1f81('0x4'));var fs=require('fs');var Redis=require(_0x1f81('0x5'));var db=require(_0x1f81('0x6'))['db'];var utils=require(_0x1f81('0x7'));var logger=require(_0x1f81('0x8'))(_0x1f81('0x9'));var config=require(_0x1f81('0xa'));var jayson=require(_0x1f81('0xb'));var client=jayson[_0x1f81('0xc')][_0x1f81('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x57c512,_0x2238b2,_0x42b31b){return new BPromise(function(_0x3635bf,_0x5e6256){return client[_0x1f81('0xe')](_0x57c512,_0x42b31b)[_0x1f81('0xf')](function(_0x4af394){logger[_0x1f81('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x2238b2,_0x1f81('0x11'));logger[_0x1f81('0x12')](_0x1f81('0x13'),_0x2238b2,_0x1f81('0x11'),JSON[_0x1f81('0x14')](_0x4af394));if(_0x4af394[_0x1f81('0x15')]){if(_0x4af394[_0x1f81('0x15')][_0x1f81('0x16')]===0x1f4){logger[_0x1f81('0x15')](_0x1f81('0x17'),_0x2238b2,_0x4af394[_0x1f81('0x15')][_0x1f81('0x18')]);return _0x5e6256(_0x4af394[_0x1f81('0x15')][_0x1f81('0x18')]);}logger[_0x1f81('0x15')](_0x1f81('0x17'),_0x2238b2,_0x4af394['error'][_0x1f81('0x18')]);return _0x3635bf(_0x4af394[_0x1f81('0x15')]['message']);}else{logger['info'](_0x1f81('0x17'),_0x2238b2,_0x1f81('0x11'));_0x3635bf(_0x4af394['result'][_0x1f81('0x18')]);}})[_0x1f81('0x19')](function(_0x37434a){logger[_0x1f81('0x15')]('ZohoAccount,\x20%s,\x20%s',_0x2238b2,_0x37434a);_0x5e6256(_0x37434a);});});}exports['GetZohoAccount']=function(_0x13bf61){var _0x1b399e=this;return new Promise(function(_0x579638,_0x2f01ac){return db['ZohoAccount'][_0x1f81('0x1a')]({'raw':_0x13bf61[_0x1f81('0x1b')]?_0x13bf61[_0x1f81('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x13bf61[_0x1f81('0x1b')]?_0x13bf61[_0x1f81('0x1b')][_0x1f81('0x1c')]||null:null,'attributes':_0x13bf61[_0x1f81('0x1b')]?_0x13bf61[_0x1f81('0x1b')][_0x1f81('0x1d')]||null:null,'limit':_0x13bf61['options']?_0x13bf61[_0x1f81('0x1b')][_0x1f81('0x1e')]||null:null,'include':_0x13bf61[_0x1f81('0x1b')]?_0x13bf61['options']['include']?_[_0x1f81('0x1f')](_0x13bf61['options'][_0x1f81('0x20')],function(_0x4f714a){return{'model':db[_0x4f714a['model']],'as':_0x4f714a['as'],'attributes':_0x4f714a[_0x1f81('0x1d')],'include':_0x4f714a['include']?_[_0x1f81('0x1f')](_0x4f714a['include'],function(_0x21caa5){return{'model':db[_0x21caa5[_0x1f81('0x21')]],'as':_0x21caa5['as'],'attributes':_0x21caa5[_0x1f81('0x1d')],'include':_0x21caa5[_0x1f81('0x20')]?_[_0x1f81('0x1f')](_0x21caa5[_0x1f81('0x20')],function(_0x2ff623){return{'model':db[_0x2ff623[_0x1f81('0x21')]],'as':_0x2ff623['as'],'attributes':_0x2ff623[_0x1f81('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1f81('0xf')](function(_0x587636){logger[_0x1f81('0x10')]('GetZohoAccount',_0x13bf61);logger[_0x1f81('0x12')](_0x1f81('0x22'),_0x13bf61,JSON['stringify'](_0x587636));_0x579638(_0x587636);})[_0x1f81('0x19')](function(_0x186e42){logger[_0x1f81('0x15')](_0x1f81('0x22'),_0x186e42[_0x1f81('0x18')],_0x13bf61);_0x2f01ac(_0x1b399e[_0x1f81('0x15')](0x1f4,_0x186e42[_0x1f81('0x18')]));});});};exports[_0x1f81('0x23')]=function(_0x5c70ac){var _0x3aa430=this;return new Promise(function(_0x21666b,_0x2e8701){return db[_0x1f81('0x24')][_0x1f81('0x25')]({'raw':_0x5c70ac[_0x1f81('0x1b')]?_0x5c70ac[_0x1f81('0x1b')][_0x1f81('0x26')]===undefined?!![]:![]:!![],'where':_0x5c70ac[_0x1f81('0x1b')]?_0x5c70ac[_0x1f81('0x1b')][_0x1f81('0x1c')]||null:null,'attributes':_0x5c70ac['options']?_0x5c70ac[_0x1f81('0x1b')][_0x1f81('0x1d')]||null:null,'include':_0x5c70ac[_0x1f81('0x1b')]?_0x5c70ac[_0x1f81('0x1b')]['include']?_[_0x1f81('0x1f')](_0x5c70ac[_0x1f81('0x1b')][_0x1f81('0x20')],function(_0x59fb61){return{'model':db[_0x59fb61['model']],'as':_0x59fb61['as'],'attributes':_0x59fb61[_0x1f81('0x1d')],'include':_0x59fb61['include']?_[_0x1f81('0x1f')](_0x59fb61['include'],function(_0x41b27a){return{'model':db[_0x41b27a[_0x1f81('0x21')]],'as':_0x41b27a['as'],'attributes':_0x41b27a[_0x1f81('0x1d')],'include':_0x41b27a[_0x1f81('0x20')]?_[_0x1f81('0x1f')](_0x41b27a[_0x1f81('0x20')],function(_0x38fecd){return{'model':db[_0x38fecd['model']],'as':_0x38fecd['as'],'attributes':_0x38fecd[_0x1f81('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa5ea5e){logger[_0x1f81('0x10')]('ShowZohoAccount',_0x5c70ac);logger[_0x1f81('0x12')](_0x1f81('0x23'),_0x5c70ac,JSON[_0x1f81('0x14')](_0xa5ea5e));_0x21666b(_0xa5ea5e);})['catch'](function(_0x37bcc2){logger[_0x1f81('0x15')](_0x1f81('0x23'),_0x37bcc2[_0x1f81('0x18')],_0x5c70ac);_0x2e8701(_0x3aa430[_0x1f81('0x15')](0x1f4,_0x37bcc2['message']));});});};
\ No newline at end of file
index edaa5b7..28ab7f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7051=['./intZohoConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','delete','multer','util','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2cba09,_0x23ee85){var _0x10d084=function(_0x11d2e4){while(--_0x11d2e4){_0x2cba09['push'](_0x2cba09['shift']());}};_0x10d084(++_0x23ee85);}(_0x7051,0x14e));var _0x1705=function(_0x2642cb,_0x4b917f){_0x2642cb=_0x2642cb-0x0;var _0xe6e41=_0x7051[_0x2642cb];return _0xe6e41;};'use strict';var multer=require(_0x1705('0x0'));var util=require(_0x1705('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1705('0x2')]();var fs_extra=require(_0x1705('0x3'));var auth=require(_0x1705('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1705('0x5'));var controller=require(_0x1705('0x6'));router['get']('/',auth[_0x1705('0x7')](),controller['index']);router[_0x1705('0x8')](_0x1705('0x9'),auth[_0x1705('0x7')](),controller[_0x1705('0xa')]);router['get'](_0x1705('0xb'),auth[_0x1705('0x7')](),controller[_0x1705('0xc')]);router[_0x1705('0x8')](_0x1705('0xd'),auth[_0x1705('0x7')](),controller[_0x1705('0xe')]);router['get'](_0x1705('0xf'),auth[_0x1705('0x7')](),controller[_0x1705('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1705('0x11')]);router[_0x1705('0x12')](_0x1705('0x9'),auth[_0x1705('0x7')](),controller['update']);router[_0x1705('0x13')](_0x1705('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x7f7a=['/:id/subjects','/:id/descriptions','create','put','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields'];(function(_0xede398,_0x3d0815){var _0xcbb16b=function(_0x186e66){while(--_0x186e66){_0xede398['push'](_0xede398['shift']());}};_0xcbb16b(++_0x3d0815);}(_0x7f7a,0x1ab));var _0xa7f7=function(_0x8d6403,_0x21e76f){_0x8d6403=_0x8d6403-0x0;var _0x9445b0=_0x7f7a[_0x8d6403];return _0x9445b0;};'use strict';var multer=require(_0xa7f7('0x0'));var util=require(_0xa7f7('0x1'));var path=require(_0xa7f7('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7f7('0x3'));var router=express['Router']();var fs_extra=require(_0xa7f7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa7f7('0x5'));var config=require('../../config/environment');var controller=require(_0xa7f7('0x6'));router[_0xa7f7('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa7f7('0x7')](_0xa7f7('0x8'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xa')]);router[_0xa7f7('0x7')](_0xa7f7('0xb'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0xc')]);router[_0xa7f7('0x7')](_0xa7f7('0xd'),auth[_0xa7f7('0x9')](),controller['getSubjects']);router[_0xa7f7('0x7')](_0xa7f7('0xe'),auth[_0xa7f7('0x9')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller[_0xa7f7('0xf')]);router[_0xa7f7('0x10')](_0xa7f7('0x8'),auth[_0xa7f7('0x9')](),controller['update']);router[_0xa7f7('0x11')](_0xa7f7('0x8'),auth[_0xa7f7('0x9')](),controller[_0xa7f7('0x12')]);module[_0xa7f7('0x13')]=router;
\ No newline at end of file
index 5d80f5e..3cec75c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x180e=['nothing','contact_lead','STRING','sequelize','exports','ENUM','lead'];(function(_0x13b59f,_0x5a0582){var _0x1d2f68=function(_0x44a108){while(--_0x44a108){_0x13b59f['push'](_0x13b59f['shift']());}};_0x1d2f68(++_0x5a0582);}(_0x180e,0x65));var _0xe180=function(_0x3526a5,_0x56825d){_0x3526a5=_0x3526a5-0x0;var _0x44f869=_0x180e[_0x3526a5];return _0x44f869;};'use strict';var Sequelize=require(_0xe180('0x0'));module[_0xe180('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xe180('0x2')](_0xe180('0x3'),'contact',_0xe180('0x4')),'defaultValue':_0xe180('0x3')},'moduleSearch':{'type':Sequelize[_0xe180('0x2')](_0xe180('0x5'),'contact','lead'),'defaultValue':_0xe180('0x5')},'description':{'type':Sequelize[_0xe180('0x6')]}};
\ No newline at end of file
+var _0x2b95=['contact_lead','sequelize','exports','STRING','ENUM','lead','contact','nothing'];(function(_0x2bd701,_0x436750){var _0x4778d2=function(_0x2203a9){while(--_0x2203a9){_0x2bd701['push'](_0x2bd701['shift']());}};_0x4778d2(++_0x436750);}(_0x2b95,0x1f1));var _0x52b9=function(_0x2a7b50,_0x545d55){_0x2a7b50=_0x2a7b50-0x0;var _0x4224c9=_0x2b95[_0x2a7b50];return _0x4224c9;};'use strict';var Sequelize=require(_0x52b9('0x0'));module[_0x52b9('0x1')]={'name':{'type':Sequelize[_0x52b9('0x2')]},'moduleCreate':{'type':Sequelize[_0x52b9('0x3')](_0x52b9('0x4'),_0x52b9('0x5'),_0x52b9('0x6')),'defaultValue':_0x52b9('0x4')},'moduleSearch':{'type':Sequelize[_0x52b9('0x3')](_0x52b9('0x7'),'contact',_0x52b9('0x4')),'defaultValue':_0x52b9('0x7')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4f9d9b8..c3d9ec6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a90=['bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','ZohoConfiguration','fieldName','type','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','fields','length','find','create','body','params','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x4030b1,_0x38244c){var _0x58367b=function(_0x237d4d){while(--_0x237d4d){_0x4030b1['push'](_0x4030b1['shift']());}};_0x58367b(++_0x38244c);}(_0x1a90,0x91));var _0x01a9=function(_0x42e4a2,_0x4972c1){_0x42e4a2=_0x42e4a2-0x0;var _0xc3f53c=_0x1a90[_0x42e4a2];return _0xc3f53c;};'use strict';var emlformat=require(_0x01a9('0x0'));var rimraf=require(_0x01a9('0x1'));var zipdir=require(_0x01a9('0x2'));var jsonpatch=require(_0x01a9('0x3'));var rp=require(_0x01a9('0x4'));var moment=require('moment');var BPromise=require(_0x01a9('0x5'));var Mustache=require(_0x01a9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x01a9('0x7'));var ejs=require(_0x01a9('0x8'));var fs=require('fs');var fs_extra=require(_0x01a9('0x9'));var _=require('lodash');var squel=require(_0x01a9('0xa'));var crypto=require(_0x01a9('0xb'));var jsforce=require(_0x01a9('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x01a9('0xd'));var authService=require(_0x01a9('0xe'));var qs=require(_0x01a9('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01a9('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x01a9('0x11'));var config=require(_0x01a9('0x12'));var licenseUtil=require(_0x01a9('0x13'));var db=require(_0x01a9('0x14'))['db'];function respondWithStatusCode(_0x10217b,_0x7da945){_0x7da945=_0x7da945||0xcc;return function(_0x204229){if(_0x204229){return _0x10217b[_0x01a9('0x15')](_0x7da945);}return _0x10217b['status'](_0x7da945)['end']();};}function respondWithResult(_0x55708a,_0x3d3180){_0x3d3180=_0x3d3180||0xc8;return function(_0x1bfecd){if(_0x1bfecd){return _0x55708a[_0x01a9('0x16')](_0x3d3180)[_0x01a9('0x17')](_0x1bfecd);}};}function respondWithFilteredResult(_0x174666,_0x5ab8bd){return function(_0x56ed0d){if(_0x56ed0d){var _0x323544=typeof _0x5ab8bd[_0x01a9('0x18')]===_0x01a9('0x19')&&typeof _0x5ab8bd[_0x01a9('0x1a')]===_0x01a9('0x19');var _0x58e754=_0x56ed0d[_0x01a9('0x1b')];var _0x295b49=_0x323544?0x0:_0x5ab8bd['offset'];var _0x36d4fe=_0x323544?_0x56ed0d[_0x01a9('0x1b')]:_0x5ab8bd[_0x01a9('0x18')]+_0x5ab8bd[_0x01a9('0x1a')];var _0x4dc022;if(_0x36d4fe>=_0x58e754){_0x36d4fe=_0x58e754;_0x4dc022=0xc8;}else{_0x4dc022=0xce;}_0x174666[_0x01a9('0x16')](_0x4dc022);return _0x174666['set'](_0x01a9('0x1c'),_0x295b49+'-'+_0x36d4fe+'/'+_0x58e754)[_0x01a9('0x17')](_0x56ed0d);}return null;};}function patchUpdates(_0x28b753){return function(_0x316222){try{jsonpatch[_0x01a9('0x1d')](_0x316222,_0x28b753,!![]);}catch(_0x51a59d){return BPromise['reject'](_0x51a59d);}return _0x316222[_0x01a9('0x1e')]();};}function saveUpdates(_0x58a4c4,_0x2d79b0){return function(_0xb0e4cc){if(_0xb0e4cc){return _0xb0e4cc[_0x01a9('0x1f')](_0x58a4c4)[_0x01a9('0x20')](function(_0x23c062){return _0x23c062;});}return null;};}function removeEntity(_0x217ce8,_0x1457fc){return function(_0x259f9a){if(_0x259f9a){return _0x259f9a[_0x01a9('0x21')]()[_0x01a9('0x20')](function(){_0x217ce8[_0x01a9('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18de51,_0xda5a37){return function(_0x55736c){if(!_0x55736c){_0x18de51[_0x01a9('0x15')](0x194);}return _0x55736c;};}function handleError(_0x26ebbf,_0x45566b){_0x45566b=_0x45566b||0x1f4;return function(_0x43c4a3){logger['error'](_0x43c4a3[_0x01a9('0x22')]);if(_0x43c4a3[_0x01a9('0x23')]){delete _0x43c4a3[_0x01a9('0x23')];}_0x26ebbf[_0x01a9('0x16')](_0x45566b)[_0x01a9('0x24')](_0x43c4a3);};}exports[_0x01a9('0x25')]=function(_0xedf5d7,_0x35b4a1){var _0xcc629c={},_0x5c3b84={},_0x10d3d2={'count':0x0,'rows':[]};var _0x1ccd72=_[_0x01a9('0x26')](db[_0x01a9('0x27')]['rawAttributes'],function(_0x39a624){return{'name':_0x39a624[_0x01a9('0x28')],'type':_0x39a624[_0x01a9('0x29')]['key']};});_0x5c3b84[_0x01a9('0x2a')]=_[_0x01a9('0x26')](_0x1ccd72,_0x01a9('0x23'));_0x5c3b84[_0x01a9('0x2b')]=_[_0x01a9('0x2c')](_0xedf5d7[_0x01a9('0x2b')]);_0x5c3b84['filters']=_[_0x01a9('0x2d')](_0x5c3b84[_0x01a9('0x2a')],_0x5c3b84[_0x01a9('0x2b')]);_0xcc629c[_0x01a9('0x2e')]=_[_0x01a9('0x2d')](_0x5c3b84[_0x01a9('0x2a')],qs['fields'](_0xedf5d7[_0x01a9('0x2b')]['fields']));_0xcc629c[_0x01a9('0x2e')]=_0xcc629c['attributes']['length']?_0xcc629c[_0x01a9('0x2e')]:_0x5c3b84[_0x01a9('0x2a')];if(!_0xedf5d7['query'][_0x01a9('0x2f')](_0x01a9('0x30'))){_0xcc629c[_0x01a9('0x1a')]=qs['limit'](_0xedf5d7[_0x01a9('0x2b')]['limit']);_0xcc629c[_0x01a9('0x18')]=qs[_0x01a9('0x18')](_0xedf5d7[_0x01a9('0x2b')][_0x01a9('0x18')]);}_0xcc629c[_0x01a9('0x31')]=qs[_0x01a9('0x32')](_0xedf5d7[_0x01a9('0x2b')][_0x01a9('0x32')]);_0xcc629c[_0x01a9('0x33')]=qs[_0x01a9('0x34')](_['pick'](_0xedf5d7[_0x01a9('0x2b')],_0x5c3b84[_0x01a9('0x34')]),_0x1ccd72);if(_0xedf5d7[_0x01a9('0x2b')][_0x01a9('0x35')]){_0xcc629c['where']=_[_0x01a9('0x36')](_0xcc629c[_0x01a9('0x33')],{'$or':_[_0x01a9('0x26')](_0x1ccd72,function(_0x365ca0){if(_0x365ca0[_0x01a9('0x29')]!==_0x01a9('0x37')){var _0x269c3={};_0x269c3[_0x365ca0[_0x01a9('0x23')]]={'$like':'%'+_0xedf5d7[_0x01a9('0x2b')][_0x01a9('0x35')]+'%'};return _0x269c3;}})});}_0xcc629c=_[_0x01a9('0x36')]({},_0xcc629c,_0xedf5d7[_0x01a9('0x38')]);var _0x59f9bf={'where':_0xcc629c[_0x01a9('0x33')]};return db['ZohoConfiguration'][_0x01a9('0x1b')](_0x59f9bf)[_0x01a9('0x20')](function(_0x46c24d){_0x10d3d2[_0x01a9('0x1b')]=_0x46c24d;if(_0xedf5d7[_0x01a9('0x2b')][_0x01a9('0x39')]){_0xcc629c[_0x01a9('0x3a')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0xcc629c);})[_0x01a9('0x20')](function(_0x181faf){_0x10d3d2[_0x01a9('0x3b')]=_0x181faf;return _0x10d3d2;})[_0x01a9('0x20')](respondWithFilteredResult(_0x35b4a1,_0xcc629c))[_0x01a9('0x3c')](handleError(_0x35b4a1,null));};exports[_0x01a9('0x3d')]=function(_0x541be9,_0x142db1){var _0x52596f={'raw':![],'where':{'id':_0x541be9['params']['id']}},_0x1f395b={};_0x1f395b[_0x01a9('0x2a')]=_['keys'](db[_0x01a9('0x27')][_0x01a9('0x3e')]);_0x1f395b[_0x01a9('0x2b')]=_[_0x01a9('0x2c')](_0x541be9[_0x01a9('0x2b')]);_0x1f395b[_0x01a9('0x34')]=_[_0x01a9('0x2d')](_0x1f395b['model'],_0x1f395b['query']);_0x52596f[_0x01a9('0x2e')]=_['intersection'](_0x1f395b[_0x01a9('0x2a')],qs[_0x01a9('0x3f')](_0x541be9['query'][_0x01a9('0x3f')]));_0x52596f[_0x01a9('0x2e')]=_0x52596f[_0x01a9('0x2e')][_0x01a9('0x40')]?_0x52596f[_0x01a9('0x2e')]:_0x1f395b[_0x01a9('0x2a')];if(_0x541be9[_0x01a9('0x2b')][_0x01a9('0x39')]){_0x52596f[_0x01a9('0x3a')]=[{'all':!![]}];}_0x52596f=_[_0x01a9('0x36')]({},_0x52596f,_0x541be9[_0x01a9('0x38')]);return db[_0x01a9('0x27')][_0x01a9('0x41')](_0x52596f)[_0x01a9('0x20')](handleEntityNotFound(_0x142db1,null))[_0x01a9('0x20')](respondWithResult(_0x142db1,null))[_0x01a9('0x3c')](handleError(_0x142db1,null));};exports[_0x01a9('0x42')]=function(_0x13630a,_0x468c5a){return db[_0x01a9('0x27')][_0x01a9('0x42')](_0x13630a[_0x01a9('0x43')],{})['then'](respondWithResult(_0x468c5a,0xc9))['catch'](handleError(_0x468c5a,null));};exports[_0x01a9('0x1f')]=function(_0x1f41b4,_0x384448){if(_0x1f41b4[_0x01a9('0x43')]['id']){delete _0x1f41b4[_0x01a9('0x43')]['id'];}return db['ZohoConfiguration'][_0x01a9('0x41')]({'where':{'id':_0x1f41b4[_0x01a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x384448,null))['then'](saveUpdates(_0x1f41b4[_0x01a9('0x43')],null))[_0x01a9('0x20')](respondWithResult(_0x384448,null))['catch'](handleError(_0x384448,null));};exports['destroy']=function(_0x395c98,_0x3f4ce9){return db[_0x01a9('0x27')][_0x01a9('0x41')]({'where':{'id':_0x395c98[_0x01a9('0x44')]['id']}})[_0x01a9('0x20')](handleEntityNotFound(_0x3f4ce9,null))[_0x01a9('0x20')](removeEntity(_0x3f4ce9,null))[_0x01a9('0x3c')](handleError(_0x3f4ce9,null));};exports[_0x01a9('0x45')]=function(_0x4bfb90,_0x264864,_0x19e59b){var _0x5602ef={};var _0x528d71={};var _0x4d0e0d;var _0x410a14;return db[_0x01a9('0x27')][_0x01a9('0x46')]({'where':{'id':_0x4bfb90['params']['id']}})[_0x01a9('0x20')](handleEntityNotFound(_0x264864,null))['then'](function(_0x33a6fc){if(_0x33a6fc){_0x4d0e0d=_0x33a6fc;_0x528d71[_0x01a9('0x2a')]=_[_0x01a9('0x2c')](db[_0x01a9('0x47')][_0x01a9('0x3e')]);_0x528d71['query']=_[_0x01a9('0x2c')](_0x4bfb90['query']);_0x528d71[_0x01a9('0x34')]=_[_0x01a9('0x2d')](_0x528d71['model'],_0x528d71[_0x01a9('0x2b')]);_0x5602ef[_0x01a9('0x2e')]=_['intersection'](_0x528d71[_0x01a9('0x2a')],qs[_0x01a9('0x3f')](_0x4bfb90[_0x01a9('0x2b')][_0x01a9('0x3f')]));_0x5602ef[_0x01a9('0x2e')]=_0x5602ef['attributes'][_0x01a9('0x40')]?_0x5602ef[_0x01a9('0x2e')]:_0x528d71['model'];_0x5602ef[_0x01a9('0x31')]=qs[_0x01a9('0x32')](_0x4bfb90[_0x01a9('0x2b')][_0x01a9('0x32')]);_0x5602ef[_0x01a9('0x33')]=qs[_0x01a9('0x34')](_[_0x01a9('0x48')](_0x4bfb90[_0x01a9('0x2b')],_0x528d71['filters']));if(_0x4bfb90['query'][_0x01a9('0x35')]){_0x5602ef[_0x01a9('0x33')]=_[_0x01a9('0x36')](_0x5602ef[_0x01a9('0x33')],{'$or':_[_0x01a9('0x26')](_0x5602ef['attributes'],function(_0x700e33){var _0x543d9c={};_0x543d9c[_0x700e33]={'$like':'%'+_0x4bfb90[_0x01a9('0x2b')][_0x01a9('0x35')]+'%'};return _0x543d9c;})});}_0x5602ef=_[_0x01a9('0x36')]({},_0x5602ef,_0x4bfb90[_0x01a9('0x38')]);return _0x4d0e0d['getFields'](_0x5602ef);}})['then'](function(_0x1bbde1){if(_0x1bbde1){_0x410a14=_0x1bbde1[_0x01a9('0x40')];if(!_0x4bfb90[_0x01a9('0x2b')][_0x01a9('0x2f')]('nolimit')){_0x5602ef[_0x01a9('0x1a')]=qs[_0x01a9('0x1a')](_0x4bfb90['query'][_0x01a9('0x1a')]);_0x5602ef[_0x01a9('0x18')]=qs[_0x01a9('0x18')](_0x4bfb90['query'][_0x01a9('0x18')]);}return _0x4d0e0d[_0x01a9('0x45')](_0x5602ef);}})[_0x01a9('0x20')](function(_0x138aec){if(_0x138aec){return _0x138aec?{'count':_0x410a14,'rows':_0x138aec}:null;}})[_0x01a9('0x20')](respondWithResult(_0x264864,null))[_0x01a9('0x3c')](handleError(_0x264864,null));};exports[_0x01a9('0x49')]=function(_0x240c47,_0x58bb1b,_0x22f838){var _0x4d093d={};var _0x2dc1ff={};var _0x308dbf;var _0x3c8757;return db[_0x01a9('0x27')][_0x01a9('0x46')]({'where':{'id':_0x240c47[_0x01a9('0x44')]['id']}})[_0x01a9('0x20')](handleEntityNotFound(_0x58bb1b,null))['then'](function(_0x4c9693){if(_0x4c9693){_0x308dbf=_0x4c9693;_0x2dc1ff[_0x01a9('0x2a')]=_['keys'](db[_0x01a9('0x47')][_0x01a9('0x3e')]);_0x2dc1ff[_0x01a9('0x2b')]=_[_0x01a9('0x2c')](_0x240c47[_0x01a9('0x2b')]);_0x2dc1ff[_0x01a9('0x34')]=_[_0x01a9('0x2d')](_0x2dc1ff['model'],_0x2dc1ff[_0x01a9('0x2b')]);_0x4d093d['attributes']=_[_0x01a9('0x2d')](_0x2dc1ff[_0x01a9('0x2a')],qs[_0x01a9('0x3f')](_0x240c47[_0x01a9('0x2b')][_0x01a9('0x3f')]));_0x4d093d['attributes']=_0x4d093d[_0x01a9('0x2e')][_0x01a9('0x40')]?_0x4d093d[_0x01a9('0x2e')]:_0x2dc1ff[_0x01a9('0x2a')];_0x4d093d[_0x01a9('0x31')]=qs[_0x01a9('0x32')](_0x240c47[_0x01a9('0x2b')][_0x01a9('0x32')]);_0x4d093d[_0x01a9('0x33')]=qs[_0x01a9('0x34')](_[_0x01a9('0x48')](_0x240c47['query'],_0x2dc1ff[_0x01a9('0x34')]));if(_0x240c47[_0x01a9('0x2b')][_0x01a9('0x35')]){_0x4d093d['where']=_[_0x01a9('0x36')](_0x4d093d[_0x01a9('0x33')],{'$or':_[_0x01a9('0x26')](_0x4d093d[_0x01a9('0x2e')],function(_0x9255d0){var _0x5c55e2={};_0x5c55e2[_0x9255d0]={'$like':'%'+_0x240c47[_0x01a9('0x2b')]['filter']+'%'};return _0x5c55e2;})});}_0x4d093d=_[_0x01a9('0x36')]({},_0x4d093d,_0x240c47['options']);return _0x308dbf['getSubjects'](_0x4d093d);}})[_0x01a9('0x20')](function(_0x8a66c3){if(_0x8a66c3){_0x3c8757=_0x8a66c3[_0x01a9('0x40')];if(!_0x240c47[_0x01a9('0x2b')][_0x01a9('0x2f')]('nolimit')){_0x4d093d[_0x01a9('0x1a')]=qs[_0x01a9('0x1a')](_0x240c47[_0x01a9('0x2b')][_0x01a9('0x1a')]);_0x4d093d[_0x01a9('0x18')]=qs[_0x01a9('0x18')](_0x240c47[_0x01a9('0x2b')][_0x01a9('0x18')]);}return _0x308dbf['getSubjects'](_0x4d093d);}})[_0x01a9('0x20')](function(_0xf3a054){if(_0xf3a054){return _0xf3a054?{'count':_0x3c8757,'rows':_0xf3a054}:null;}})['then'](respondWithResult(_0x58bb1b,null))[_0x01a9('0x3c')](handleError(_0x58bb1b,null));};exports['getDescriptions']=function(_0x54fd5a,_0x3f79be,_0x5c6663){var _0x25c4d8={};var _0x39a477={};var _0x2ed2e2;var _0x583850;return db[_0x01a9('0x27')][_0x01a9('0x46')]({'where':{'id':_0x54fd5a[_0x01a9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f79be,null))[_0x01a9('0x20')](function(_0x5d50fb){if(_0x5d50fb){_0x2ed2e2=_0x5d50fb;_0x39a477[_0x01a9('0x2a')]=_[_0x01a9('0x2c')](db[_0x01a9('0x47')][_0x01a9('0x3e')]);_0x39a477['query']=_[_0x01a9('0x2c')](_0x54fd5a[_0x01a9('0x2b')]);_0x39a477[_0x01a9('0x34')]=_[_0x01a9('0x2d')](_0x39a477['model'],_0x39a477[_0x01a9('0x2b')]);_0x25c4d8[_0x01a9('0x2e')]=_[_0x01a9('0x2d')](_0x39a477[_0x01a9('0x2a')],qs[_0x01a9('0x3f')](_0x54fd5a[_0x01a9('0x2b')]['fields']));_0x25c4d8['attributes']=_0x25c4d8[_0x01a9('0x2e')]['length']?_0x25c4d8['attributes']:_0x39a477[_0x01a9('0x2a')];_0x25c4d8[_0x01a9('0x31')]=qs['sort'](_0x54fd5a[_0x01a9('0x2b')]['sort']);_0x25c4d8['where']=qs[_0x01a9('0x34')](_[_0x01a9('0x48')](_0x54fd5a['query'],_0x39a477[_0x01a9('0x34')]));if(_0x54fd5a[_0x01a9('0x2b')]['filter']){_0x25c4d8[_0x01a9('0x33')]=_['merge'](_0x25c4d8['where'],{'$or':_[_0x01a9('0x26')](_0x25c4d8['attributes'],function(_0x16709c){var _0x434a53={};_0x434a53[_0x16709c]={'$like':'%'+_0x54fd5a[_0x01a9('0x2b')][_0x01a9('0x35')]+'%'};return _0x434a53;})});}_0x25c4d8=_[_0x01a9('0x36')]({},_0x25c4d8,_0x54fd5a['options']);return _0x2ed2e2[_0x01a9('0x4a')](_0x25c4d8);}})[_0x01a9('0x20')](function(_0x17d130){if(_0x17d130){_0x583850=_0x17d130[_0x01a9('0x40')];if(!_0x54fd5a[_0x01a9('0x2b')]['hasOwnProperty']('nolimit')){_0x25c4d8[_0x01a9('0x1a')]=qs['limit'](_0x54fd5a['query'][_0x01a9('0x1a')]);_0x25c4d8[_0x01a9('0x18')]=qs[_0x01a9('0x18')](_0x54fd5a['query']['offset']);}return _0x2ed2e2[_0x01a9('0x4a')](_0x25c4d8);}})[_0x01a9('0x20')](function(_0x487c78){if(_0x487c78){return _0x487c78?{'count':_0x583850,'rows':_0x487c78}:null;}})['then'](respondWithResult(_0x3f79be,null))[_0x01a9('0x3c')](handleError(_0x3f79be,null));};
\ No newline at end of file
+var _0x4fba=['limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','ZohoConfiguration','fieldName','type','map','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','where','filter','merge','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','options','create','body','find','getFields','ZohoField','sort','nolimit','findOne','pick','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','end','status','json','count','offset'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x4fba,0x7d));var _0xa4fb=function(_0x5ea887,_0x5bb376){_0x5ea887=_0x5ea887-0x0;var _0x45c71b=_0x4fba[_0x5ea887];return _0x45c71b;};'use strict';var emlformat=require(_0xa4fb('0x0'));var rimraf=require(_0xa4fb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa4fb('0x2'));var rp=require(_0xa4fb('0x3'));var moment=require('moment');var BPromise=require(_0xa4fb('0x4'));var Mustache=require(_0xa4fb('0x5'));var util=require(_0xa4fb('0x6'));var path=require(_0xa4fb('0x7'));var sox=require(_0xa4fb('0x8'));var csv=require(_0xa4fb('0x9'));var ejs=require(_0xa4fb('0xa'));var fs=require('fs');var fs_extra=require(_0xa4fb('0xb'));var _=require('lodash');var squel=require(_0xa4fb('0xc'));var crypto=require(_0xa4fb('0xd'));var jsforce=require(_0xa4fb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa4fb('0x9'));var querystring=require(_0xa4fb('0xf'));var Papa=require(_0xa4fb('0x10'));var Redis=require(_0xa4fb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xa4fb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4fb('0x13'));var logger=require(_0xa4fb('0x14'))('api');var utils=require(_0xa4fb('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa4fb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50ee99,_0x5eb9fb){_0x5eb9fb=_0x5eb9fb||0xcc;return function(_0x76421){if(_0x76421){return _0x50ee99[_0xa4fb('0x17')](_0x5eb9fb);}return _0x50ee99['status'](_0x5eb9fb)[_0xa4fb('0x18')]();};}function respondWithResult(_0x33c82f,_0x3b82b0){_0x3b82b0=_0x3b82b0||0xc8;return function(_0x120b23){if(_0x120b23){return _0x33c82f[_0xa4fb('0x19')](_0x3b82b0)[_0xa4fb('0x1a')](_0x120b23);}};}function respondWithFilteredResult(_0x4c2d22,_0x370cb7){return function(_0x478cbe){if(_0x478cbe){var _0x5d114c=typeof _0x370cb7['offset']==='undefined'&&typeof _0x370cb7['limit']==='undefined';var _0x2fac61=_0x478cbe[_0xa4fb('0x1b')];var _0x404fb6=_0x5d114c?0x0:_0x370cb7['offset'];var _0x50d6ab=_0x5d114c?_0x478cbe[_0xa4fb('0x1b')]:_0x370cb7[_0xa4fb('0x1c')]+_0x370cb7[_0xa4fb('0x1d')];var _0x228427;if(_0x50d6ab>=_0x2fac61){_0x50d6ab=_0x2fac61;_0x228427=0xc8;}else{_0x228427=0xce;}_0x4c2d22[_0xa4fb('0x19')](_0x228427);return _0x4c2d22[_0xa4fb('0x1e')](_0xa4fb('0x1f'),_0x404fb6+'-'+_0x50d6ab+'/'+_0x2fac61)['json'](_0x478cbe);}return null;};}function patchUpdates(_0x5b0fba){return function(_0x508eb7){try{jsonpatch[_0xa4fb('0x20')](_0x508eb7,_0x5b0fba,!![]);}catch(_0x2d533b){return BPromise['reject'](_0x2d533b);}return _0x508eb7[_0xa4fb('0x21')]();};}function saveUpdates(_0x261ef5,_0x1e35ae){return function(_0xfc53ea){if(_0xfc53ea){return _0xfc53ea[_0xa4fb('0x22')](_0x261ef5)[_0xa4fb('0x23')](function(_0x2e1bfe){return _0x2e1bfe;});}return null;};}function removeEntity(_0x249ad2,_0x179c38){return function(_0x4307e8){if(_0x4307e8){return _0x4307e8[_0xa4fb('0x24')]()['then'](function(){_0x249ad2[_0xa4fb('0x19')](0xcc)[_0xa4fb('0x18')]();});}};}function handleEntityNotFound(_0x1d28c3,_0x5be919){return function(_0x10902c){if(!_0x10902c){_0x1d28c3[_0xa4fb('0x17')](0x194);}return _0x10902c;};}function handleError(_0x3e2c50,_0x10fe36){_0x10fe36=_0x10fe36||0x1f4;return function(_0x61e784){logger['error'](_0x61e784[_0xa4fb('0x25')]);if(_0x61e784[_0xa4fb('0x26')]){delete _0x61e784[_0xa4fb('0x26')];}_0x3e2c50[_0xa4fb('0x19')](_0x10fe36)[_0xa4fb('0x27')](_0x61e784);};}exports[_0xa4fb('0x28')]=function(_0x39a661,_0x46effc){var _0x2f9931={},_0x3f9fe2={},_0x3fbfaa={'count':0x0,'rows':[]};var _0x5d2a10=_['map'](db[_0xa4fb('0x29')]['rawAttributes'],function(_0x1160ce){return{'name':_0x1160ce[_0xa4fb('0x2a')],'type':_0x1160ce[_0xa4fb('0x2b')]['key']};});_0x3f9fe2['model']=_[_0xa4fb('0x2c')](_0x5d2a10,'name');_0x3f9fe2['query']=_['keys'](_0x39a661[_0xa4fb('0x2d')]);_0x3f9fe2[_0xa4fb('0x2e')]=_['intersection'](_0x3f9fe2[_0xa4fb('0x2f')],_0x3f9fe2['query']);_0x2f9931['attributes']=_[_0xa4fb('0x30')](_0x3f9fe2[_0xa4fb('0x2f')],qs[_0xa4fb('0x31')](_0x39a661[_0xa4fb('0x2d')][_0xa4fb('0x31')]));_0x2f9931['attributes']=_0x2f9931[_0xa4fb('0x32')][_0xa4fb('0x33')]?_0x2f9931[_0xa4fb('0x32')]:_0x3f9fe2[_0xa4fb('0x2f')];if(!_0x39a661[_0xa4fb('0x2d')][_0xa4fb('0x34')]('nolimit')){_0x2f9931[_0xa4fb('0x1d')]=qs[_0xa4fb('0x1d')](_0x39a661['query'][_0xa4fb('0x1d')]);_0x2f9931[_0xa4fb('0x1c')]=qs[_0xa4fb('0x1c')](_0x39a661['query'][_0xa4fb('0x1c')]);}_0x2f9931[_0xa4fb('0x35')]=qs['sort'](_0x39a661['query']['sort']);_0x2f9931[_0xa4fb('0x36')]=qs[_0xa4fb('0x2e')](_['pick'](_0x39a661['query'],_0x3f9fe2[_0xa4fb('0x2e')]),_0x5d2a10);if(_0x39a661['query'][_0xa4fb('0x37')]){_0x2f9931[_0xa4fb('0x36')]=_[_0xa4fb('0x38')](_0x2f9931['where'],{'$or':_[_0xa4fb('0x2c')](_0x5d2a10,function(_0x5c4bb3){if(_0x5c4bb3['type']!=='VIRTUAL'){var _0x18629f={};_0x18629f[_0x5c4bb3[_0xa4fb('0x26')]]={'$like':'%'+_0x39a661[_0xa4fb('0x2d')][_0xa4fb('0x37')]+'%'};return _0x18629f;}})});}_0x2f9931=_[_0xa4fb('0x38')]({},_0x2f9931,_0x39a661['options']);var _0xbfb5f8={'where':_0x2f9931[_0xa4fb('0x36')]};return db['ZohoConfiguration']['count'](_0xbfb5f8)[_0xa4fb('0x23')](function(_0x1afe9c){_0x3fbfaa['count']=_0x1afe9c;if(_0x39a661[_0xa4fb('0x2d')][_0xa4fb('0x39')]){_0x2f9931['include']=[{'all':!![]}];}return db[_0xa4fb('0x29')][_0xa4fb('0x3a')](_0x2f9931);})[_0xa4fb('0x23')](function(_0x1f41bc){_0x3fbfaa[_0xa4fb('0x3b')]=_0x1f41bc;return _0x3fbfaa;})[_0xa4fb('0x23')](respondWithFilteredResult(_0x46effc,_0x2f9931))[_0xa4fb('0x3c')](handleError(_0x46effc,null));};exports[_0xa4fb('0x3d')]=function(_0x1c41fe,_0x22ba9a){var _0x2168e3={'raw':![],'where':{'id':_0x1c41fe[_0xa4fb('0x3e')]['id']}},_0x81ddd={};_0x81ddd[_0xa4fb('0x2f')]=_[_0xa4fb('0x3f')](db[_0xa4fb('0x29')][_0xa4fb('0x40')]);_0x81ddd[_0xa4fb('0x2d')]=_[_0xa4fb('0x3f')](_0x1c41fe[_0xa4fb('0x2d')]);_0x81ddd[_0xa4fb('0x2e')]=_[_0xa4fb('0x30')](_0x81ddd[_0xa4fb('0x2f')],_0x81ddd[_0xa4fb('0x2d')]);_0x2168e3['attributes']=_[_0xa4fb('0x30')](_0x81ddd[_0xa4fb('0x2f')],qs[_0xa4fb('0x31')](_0x1c41fe[_0xa4fb('0x2d')][_0xa4fb('0x31')]));_0x2168e3[_0xa4fb('0x32')]=_0x2168e3[_0xa4fb('0x32')][_0xa4fb('0x33')]?_0x2168e3[_0xa4fb('0x32')]:_0x81ddd[_0xa4fb('0x2f')];if(_0x1c41fe['query'][_0xa4fb('0x39')]){_0x2168e3['include']=[{'all':!![]}];}_0x2168e3=_[_0xa4fb('0x38')]({},_0x2168e3,_0x1c41fe[_0xa4fb('0x41')]);return db[_0xa4fb('0x29')]['find'](_0x2168e3)['then'](handleEntityNotFound(_0x22ba9a,null))[_0xa4fb('0x23')](respondWithResult(_0x22ba9a,null))[_0xa4fb('0x3c')](handleError(_0x22ba9a,null));};exports[_0xa4fb('0x42')]=function(_0x1e9e0a,_0x3e0594){return db['ZohoConfiguration'][_0xa4fb('0x42')](_0x1e9e0a[_0xa4fb('0x43')],{})[_0xa4fb('0x23')](respondWithResult(_0x3e0594,0xc9))[_0xa4fb('0x3c')](handleError(_0x3e0594,null));};exports[_0xa4fb('0x22')]=function(_0x4ffea1,_0xdd539a){if(_0x4ffea1[_0xa4fb('0x43')]['id']){delete _0x4ffea1[_0xa4fb('0x43')]['id'];}return db[_0xa4fb('0x29')][_0xa4fb('0x44')]({'where':{'id':_0x4ffea1[_0xa4fb('0x3e')]['id']}})[_0xa4fb('0x23')](handleEntityNotFound(_0xdd539a,null))[_0xa4fb('0x23')](saveUpdates(_0x4ffea1[_0xa4fb('0x43')],null))['then'](respondWithResult(_0xdd539a,null))[_0xa4fb('0x3c')](handleError(_0xdd539a,null));};exports['destroy']=function(_0x38d63a,_0x429b11){return db['ZohoConfiguration'][_0xa4fb('0x44')]({'where':{'id':_0x38d63a[_0xa4fb('0x3e')]['id']}})['then'](handleEntityNotFound(_0x429b11,null))[_0xa4fb('0x23')](removeEntity(_0x429b11,null))[_0xa4fb('0x3c')](handleError(_0x429b11,null));};exports[_0xa4fb('0x45')]=function(_0x4e8cf9,_0xeb8148,_0x2e0259){var _0x509c50={};var _0x3b489e={};var _0x5cbeff;var _0x57c14f;return db[_0xa4fb('0x29')]['findOne']({'where':{'id':_0x4e8cf9['params']['id']}})[_0xa4fb('0x23')](handleEntityNotFound(_0xeb8148,null))[_0xa4fb('0x23')](function(_0x558cde){if(_0x558cde){_0x5cbeff=_0x558cde;_0x3b489e[_0xa4fb('0x2f')]=_[_0xa4fb('0x3f')](db[_0xa4fb('0x46')]['rawAttributes']);_0x3b489e[_0xa4fb('0x2d')]=_[_0xa4fb('0x3f')](_0x4e8cf9[_0xa4fb('0x2d')]);_0x3b489e[_0xa4fb('0x2e')]=_[_0xa4fb('0x30')](_0x3b489e[_0xa4fb('0x2f')],_0x3b489e[_0xa4fb('0x2d')]);_0x509c50['attributes']=_[_0xa4fb('0x30')](_0x3b489e[_0xa4fb('0x2f')],qs[_0xa4fb('0x31')](_0x4e8cf9['query'][_0xa4fb('0x31')]));_0x509c50['attributes']=_0x509c50['attributes'][_0xa4fb('0x33')]?_0x509c50[_0xa4fb('0x32')]:_0x3b489e['model'];_0x509c50[_0xa4fb('0x35')]=qs[_0xa4fb('0x47')](_0x4e8cf9[_0xa4fb('0x2d')]['sort']);_0x509c50['where']=qs[_0xa4fb('0x2e')](_['pick'](_0x4e8cf9['query'],_0x3b489e['filters']));if(_0x4e8cf9[_0xa4fb('0x2d')][_0xa4fb('0x37')]){_0x509c50[_0xa4fb('0x36')]=_[_0xa4fb('0x38')](_0x509c50[_0xa4fb('0x36')],{'$or':_[_0xa4fb('0x2c')](_0x509c50[_0xa4fb('0x32')],function(_0x50347a){var _0x2630ce={};_0x2630ce[_0x50347a]={'$like':'%'+_0x4e8cf9[_0xa4fb('0x2d')]['filter']+'%'};return _0x2630ce;})});}_0x509c50=_[_0xa4fb('0x38')]({},_0x509c50,_0x4e8cf9['options']);return _0x5cbeff[_0xa4fb('0x45')](_0x509c50);}})['then'](function(_0x4a9226){if(_0x4a9226){_0x57c14f=_0x4a9226[_0xa4fb('0x33')];if(!_0x4e8cf9[_0xa4fb('0x2d')]['hasOwnProperty'](_0xa4fb('0x48'))){_0x509c50['limit']=qs['limit'](_0x4e8cf9[_0xa4fb('0x2d')][_0xa4fb('0x1d')]);_0x509c50[_0xa4fb('0x1c')]=qs[_0xa4fb('0x1c')](_0x4e8cf9['query'][_0xa4fb('0x1c')]);}return _0x5cbeff[_0xa4fb('0x45')](_0x509c50);}})[_0xa4fb('0x23')](function(_0x1c0f35){if(_0x1c0f35){return _0x1c0f35?{'count':_0x57c14f,'rows':_0x1c0f35}:null;}})[_0xa4fb('0x23')](respondWithResult(_0xeb8148,null))[_0xa4fb('0x3c')](handleError(_0xeb8148,null));};exports['getSubjects']=function(_0x27c3cd,_0x2b8c6c,_0x1f41ed){var _0x162e64={};var _0x13ccca={};var _0x16fb7d;var _0x41715c;return db['ZohoConfiguration'][_0xa4fb('0x49')]({'where':{'id':_0x27c3cd[_0xa4fb('0x3e')]['id']}})[_0xa4fb('0x23')](handleEntityNotFound(_0x2b8c6c,null))[_0xa4fb('0x23')](function(_0x12a962){if(_0x12a962){_0x16fb7d=_0x12a962;_0x13ccca['model']=_[_0xa4fb('0x3f')](db['ZohoField'][_0xa4fb('0x40')]);_0x13ccca[_0xa4fb('0x2d')]=_[_0xa4fb('0x3f')](_0x27c3cd[_0xa4fb('0x2d')]);_0x13ccca['filters']=_[_0xa4fb('0x30')](_0x13ccca[_0xa4fb('0x2f')],_0x13ccca[_0xa4fb('0x2d')]);_0x162e64['attributes']=_[_0xa4fb('0x30')](_0x13ccca['model'],qs[_0xa4fb('0x31')](_0x27c3cd[_0xa4fb('0x2d')][_0xa4fb('0x31')]));_0x162e64[_0xa4fb('0x32')]=_0x162e64[_0xa4fb('0x32')]['length']?_0x162e64['attributes']:_0x13ccca[_0xa4fb('0x2f')];_0x162e64[_0xa4fb('0x35')]=qs[_0xa4fb('0x47')](_0x27c3cd[_0xa4fb('0x2d')][_0xa4fb('0x47')]);_0x162e64['where']=qs['filters'](_[_0xa4fb('0x4a')](_0x27c3cd[_0xa4fb('0x2d')],_0x13ccca[_0xa4fb('0x2e')]));if(_0x27c3cd[_0xa4fb('0x2d')][_0xa4fb('0x37')]){_0x162e64[_0xa4fb('0x36')]=_['merge'](_0x162e64[_0xa4fb('0x36')],{'$or':_[_0xa4fb('0x2c')](_0x162e64['attributes'],function(_0x22eace){var _0xc136d7={};_0xc136d7[_0x22eace]={'$like':'%'+_0x27c3cd['query'][_0xa4fb('0x37')]+'%'};return _0xc136d7;})});}_0x162e64=_[_0xa4fb('0x38')]({},_0x162e64,_0x27c3cd[_0xa4fb('0x41')]);return _0x16fb7d[_0xa4fb('0x4b')](_0x162e64);}})[_0xa4fb('0x23')](function(_0x54c619){if(_0x54c619){_0x41715c=_0x54c619[_0xa4fb('0x33')];if(!_0x27c3cd['query']['hasOwnProperty'](_0xa4fb('0x48'))){_0x162e64[_0xa4fb('0x1d')]=qs[_0xa4fb('0x1d')](_0x27c3cd[_0xa4fb('0x2d')][_0xa4fb('0x1d')]);_0x162e64[_0xa4fb('0x1c')]=qs[_0xa4fb('0x1c')](_0x27c3cd[_0xa4fb('0x2d')][_0xa4fb('0x1c')]);}return _0x16fb7d[_0xa4fb('0x4b')](_0x162e64);}})['then'](function(_0x4242fc){if(_0x4242fc){return _0x4242fc?{'count':_0x41715c,'rows':_0x4242fc}:null;}})[_0xa4fb('0x23')](respondWithResult(_0x2b8c6c,null))['catch'](handleError(_0x2b8c6c,null));};exports[_0xa4fb('0x4c')]=function(_0x1d85bd,_0x441384,_0x45ba2f){var _0x486842={};var _0x544f93={};var _0x2372fc;var _0x2986ca;return db[_0xa4fb('0x29')][_0xa4fb('0x49')]({'where':{'id':_0x1d85bd['params']['id']}})[_0xa4fb('0x23')](handleEntityNotFound(_0x441384,null))[_0xa4fb('0x23')](function(_0x2add78){if(_0x2add78){_0x2372fc=_0x2add78;_0x544f93[_0xa4fb('0x2f')]=_[_0xa4fb('0x3f')](db[_0xa4fb('0x46')][_0xa4fb('0x40')]);_0x544f93[_0xa4fb('0x2d')]=_[_0xa4fb('0x3f')](_0x1d85bd[_0xa4fb('0x2d')]);_0x544f93[_0xa4fb('0x2e')]=_[_0xa4fb('0x30')](_0x544f93[_0xa4fb('0x2f')],_0x544f93[_0xa4fb('0x2d')]);_0x486842[_0xa4fb('0x32')]=_[_0xa4fb('0x30')](_0x544f93['model'],qs['fields'](_0x1d85bd[_0xa4fb('0x2d')]['fields']));_0x486842['attributes']=_0x486842[_0xa4fb('0x32')]['length']?_0x486842['attributes']:_0x544f93['model'];_0x486842[_0xa4fb('0x35')]=qs[_0xa4fb('0x47')](_0x1d85bd[_0xa4fb('0x2d')][_0xa4fb('0x47')]);_0x486842[_0xa4fb('0x36')]=qs['filters'](_['pick'](_0x1d85bd[_0xa4fb('0x2d')],_0x544f93['filters']));if(_0x1d85bd[_0xa4fb('0x2d')]['filter']){_0x486842[_0xa4fb('0x36')]=_[_0xa4fb('0x38')](_0x486842[_0xa4fb('0x36')],{'$or':_['map'](_0x486842[_0xa4fb('0x32')],function(_0x158a61){var _0xe087df={};_0xe087df[_0x158a61]={'$like':'%'+_0x1d85bd[_0xa4fb('0x2d')][_0xa4fb('0x37')]+'%'};return _0xe087df;})});}_0x486842=_[_0xa4fb('0x38')]({},_0x486842,_0x1d85bd[_0xa4fb('0x41')]);return _0x2372fc['getDescriptions'](_0x486842);}})[_0xa4fb('0x23')](function(_0x3c6115){if(_0x3c6115){_0x2986ca=_0x3c6115[_0xa4fb('0x33')];if(!_0x1d85bd[_0xa4fb('0x2d')][_0xa4fb('0x34')](_0xa4fb('0x48'))){_0x486842['limit']=qs[_0xa4fb('0x1d')](_0x1d85bd[_0xa4fb('0x2d')]['limit']);_0x486842[_0xa4fb('0x1c')]=qs[_0xa4fb('0x1c')](_0x1d85bd[_0xa4fb('0x2d')][_0xa4fb('0x1c')]);}return _0x2372fc['getDescriptions'](_0x486842);}})[_0xa4fb('0x23')](function(_0x32ee35){if(_0x32ee35){return _0x32ee35?{'count':_0x2986ca,'rows':_0x32ee35}:null;}})[_0xa4fb('0x23')](respondWithResult(_0x441384,null))['catch'](handleError(_0x441384,null));};
\ No newline at end of file
index a150fb7..a570dde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfad=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','util'];(function(_0x2cd162,_0x4667ec){var _0x48e957=function(_0x5bb525){while(--_0x5bb525){_0x2cd162['push'](_0x2cd162['shift']());}};_0x48e957(++_0x4667ec);}(_0xdfad,0x95));var _0xddfa=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0xdfad[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require('lodash');var util=require(_0xddfa('0x0'));var logger=require(_0xddfa('0x1'))(_0xddfa('0x2'));var moment=require('moment');var BPromise=require(_0xddfa('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xddfa('0x4'));var rimraf=require(_0xddfa('0x5'));var config=require(_0xddfa('0x6'));var attributes=require(_0xddfa('0x7'));module[_0xddfa('0x8')]=function(_0x36d0ec,_0x57d8d4){return _0x36d0ec[_0xddfa('0x9')]('ZohoConfiguration',attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbbcb=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ZohoConfiguration','lodash','util','api','moment'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xbbcb,0x11a));var _0xbbbc=function(_0x134d16,_0x288ce8){_0x134d16=_0x134d16-0x0;var _0x39b1e1=_0xbbcb[_0x134d16];return _0x39b1e1;};'use strict';var _=require(_0xbbbc('0x0'));var util=require(_0xbbbc('0x1'));var logger=require('../../config/logger')(_0xbbbc('0x2'));var moment=require(_0xbbbc('0x3'));var BPromise=require(_0xbbbc('0x4'));var rp=require(_0xbbbc('0x5'));var fs=require('fs');var path=require(_0xbbbc('0x6'));var rimraf=require(_0xbbbc('0x7'));var config=require(_0xbbbc('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0xbbbc('0x9')]=function(_0x3043e1,_0x3122bf){return _0x3043e1['define'](_0xbbbc('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c77915..9125250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1751=['request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s'];(function(_0x54d52,_0x2473ba){var _0x968345=function(_0x3fcd06){while(--_0x3fcd06){_0x54d52['push'](_0x54d52['shift']());}};_0x968345(++_0x2473ba);}(_0x1751,0x152));var _0x1175=function(_0x5eb709,_0x16e6c0){_0x5eb709=_0x5eb709-0x0;var _0x5385e7=_0x1751[_0x5eb709];return _0x5385e7;};'use strict';var _=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var moment=require('moment');var BPromise=require(_0x1175('0x2'));var rs=require(_0x1175('0x3'));var fs=require('fs');var Redis=require(_0x1175('0x4'));var db=require(_0x1175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1175('0x6'))(_0x1175('0x7'));var config=require(_0x1175('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1175('0x9')][_0x1175('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29d343,_0x8136bc,_0x5e3cf2){return new BPromise(function(_0x31e58c,_0x3822d4){return client[_0x1175('0xb')](_0x29d343,_0x5e3cf2)[_0x1175('0xc')](function(_0x28e53c){logger['info'](_0x1175('0xd'),_0x8136bc,_0x1175('0xe'));logger['debug'](_0x1175('0xf'),_0x8136bc,_0x1175('0xe'),JSON[_0x1175('0x10')](_0x28e53c));if(_0x28e53c['error']){if(_0x28e53c[_0x1175('0x11')][_0x1175('0x12')]===0x1f4){logger[_0x1175('0x11')](_0x1175('0xd'),_0x8136bc,_0x28e53c[_0x1175('0x11')][_0x1175('0x13')]);return _0x3822d4(_0x28e53c['error'][_0x1175('0x13')]);}logger[_0x1175('0x11')](_0x1175('0xd'),_0x8136bc,_0x28e53c[_0x1175('0x11')]['message']);return _0x31e58c(_0x28e53c['error'][_0x1175('0x13')]);}else{logger['info'](_0x1175('0xd'),_0x8136bc,_0x1175('0xe'));_0x31e58c(_0x28e53c[_0x1175('0x14')][_0x1175('0x13')]);}})[_0x1175('0x15')](function(_0x3c2bae){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x8136bc,_0x3c2bae);_0x3822d4(_0x3c2bae);});});}
\ No newline at end of file
+var _0xde52=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x3f9637,_0x1064d2){var _0x51d900=function(_0x2177a0){while(--_0x2177a0){_0x3f9637['push'](_0x3f9637['shift']());}};_0x51d900(++_0x1064d2);}(_0xde52,0x89));var _0x2de5=function(_0x57961a,_0x5c91dd){_0x57961a=_0x57961a-0x0;var _0x52fccf=_0xde52[_0x57961a];return _0x52fccf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2de5('0x0'));var BPromise=require(_0x2de5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2de5('0x2'));var db=require(_0x2de5('0x3'))['db'];var utils=require(_0x2de5('0x4'));var logger=require(_0x2de5('0x5'))(_0x2de5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2de5('0x7')][_0x2de5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1b3220,_0x2a9a1c,_0x160814){return new BPromise(function(_0x3a17ca,_0x32dcc0){return client['request'](_0x1b3220,_0x160814)[_0x2de5('0x9')](function(_0x4570cf){logger[_0x2de5('0xa')](_0x2de5('0xb'),_0x2a9a1c,_0x2de5('0xc'));logger[_0x2de5('0xd')](_0x2de5('0xe'),_0x2a9a1c,_0x2de5('0xc'),JSON[_0x2de5('0xf')](_0x4570cf));if(_0x4570cf['error']){if(_0x4570cf[_0x2de5('0x10')][_0x2de5('0x11')]===0x1f4){logger[_0x2de5('0x10')](_0x2de5('0xb'),_0x2a9a1c,_0x4570cf[_0x2de5('0x10')]['message']);return _0x32dcc0(_0x4570cf['error'][_0x2de5('0x12')]);}logger[_0x2de5('0x10')](_0x2de5('0xb'),_0x2a9a1c,_0x4570cf[_0x2de5('0x10')][_0x2de5('0x12')]);return _0x3a17ca(_0x4570cf['error']['message']);}else{logger['info'](_0x2de5('0xb'),_0x2a9a1c,_0x2de5('0xc'));_0x3a17ca(_0x4570cf[_0x2de5('0x13')][_0x2de5('0x12')]);}})[_0x2de5('0x14')](function(_0x91e412){logger[_0x2de5('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2a9a1c,_0x91e412);_0x32dcc0(_0x91e412);});});}
\ No newline at end of file
index 34721aa..cd50361 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ac=['fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer','express','Router'];(function(_0xeb17da,_0x241b00){var _0x439ef5=function(_0x3325a1){while(--_0x3325a1){_0xeb17da['push'](_0xeb17da['shift']());}};_0x439ef5(++_0x241b00);}(_0xc2ac,0x1ad));var _0xcc2a=function(_0x347972,_0x292200){_0x347972=_0x347972-0x0;var _0x3d4f2c=_0xc2ac[_0x347972];return _0x3d4f2c;};'use strict';var multer=require(_0xcc2a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc2a('0x1'));var router=express[_0xcc2a('0x2')]();var fs_extra=require(_0xcc2a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xcc2a('0x4'));var config=require(_0xcc2a('0x5'));var controller=require(_0xcc2a('0x6'));router['get']('/',auth[_0xcc2a('0x7')](),controller[_0xcc2a('0x8')]);router[_0xcc2a('0x9')](_0xcc2a('0xa'),auth['isAuthenticated'](),controller[_0xcc2a('0xb')]);router[_0xcc2a('0xc')]('/',auth[_0xcc2a('0x7')](),controller[_0xcc2a('0xd')]);router[_0xcc2a('0xe')](_0xcc2a('0xa'),auth[_0xcc2a('0x7')](),controller['update']);router[_0xcc2a('0xf')](_0xcc2a('0xa'),auth['isAuthenticated'](),controller[_0xcc2a('0x10')]);module[_0xcc2a('0x11')]=router;
\ No newline at end of file
+var _0x4398=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4398,0x121));var _0x8439=function(_0x45bc5e,_0xd4ef31){_0x45bc5e=_0x45bc5e-0x0;var _0x62305b=_0x4398[_0x45bc5e];return _0x62305b;};'use strict';var multer=require(_0x8439('0x0'));var util=require(_0x8439('0x1'));var path=require(_0x8439('0x2'));var timeout=require(_0x8439('0x3'));var express=require(_0x8439('0x4'));var router=express[_0x8439('0x5')]();var fs_extra=require(_0x8439('0x6'));var auth=require(_0x8439('0x7'));var interaction=require(_0x8439('0x8'));var config=require(_0x8439('0x9'));var controller=require(_0x8439('0xa'));router[_0x8439('0xb')]('/',auth['isAuthenticated'](),controller[_0x8439('0xc')]);router[_0x8439('0xb')](_0x8439('0xd'),auth[_0x8439('0xe')](),controller['show']);router[_0x8439('0xf')]('/',auth['isAuthenticated'](),controller[_0x8439('0x10')]);router['put'](_0x8439('0xd'),auth[_0x8439('0xe')](),controller[_0x8439('0x11')]);router[_0x8439('0x12')](_0x8439('0xd'),auth['isAuthenticated'](),controller[_0x8439('0x13')]);module[_0x8439('0x14')]=router;
\ No newline at end of file
index 469752f..ce41298 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x592d=['ENUM','string','variable','keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x19c452,_0x4dbaab){var _0x99698c=function(_0x5aef73){while(--_0x5aef73){_0x19c452['push'](_0x19c452['shift']());}};_0x99698c(++_0x4dbaab);}(_0x592d,0xd7));var _0xd592=function(_0x476bcd,_0x445f85){_0x476bcd=_0x476bcd-0x0;var _0x2e72fb=_0x592d[_0x476bcd];return _0x2e72fb;};'use strict';var Sequelize=require(_0xd592('0x0'));module['exports']={'type':{'type':Sequelize[_0xd592('0x1')](_0xd592('0x2'),_0xd592('0x3'),'customVariable',_0xd592('0x4'),_0xd592('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xd592('0x6')]},'key':{'type':Sequelize[_0xd592('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd592('0x2'),_0xd592('0x3'),_0xd592('0x7'))},'keyContent':{'type':Sequelize[_0xd592('0x6')]},'idField':{'type':Sequelize[_0xd592('0x6')]},'nameField':{'type':Sequelize[_0xd592('0x6')]},'customField':{'type':Sequelize[_0xd592('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd592('0x6')]}};
\ No newline at end of file
+var _0x7b24=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b24,0x16f));var _0x47b2=function(_0x3cc8c0,_0x112bad){_0x3cc8c0=_0x3cc8c0-0x0;var _0x46a2b9=_0x7b24[_0x3cc8c0];return _0x46a2b9;};'use strict';var Sequelize=require(_0x47b2('0x0'));module[_0x47b2('0x1')]={'type':{'type':Sequelize[_0x47b2('0x2')](_0x47b2('0x3'),_0x47b2('0x4'),_0x47b2('0x5'),_0x47b2('0x6'),_0x47b2('0x7')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x47b2('0x3'),_0x47b2('0x4'),_0x47b2('0x5'))},'keyContent':{'type':Sequelize[_0x47b2('0x8')]},'idField':{'type':Sequelize[_0x47b2('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x47b2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x47b2('0x8')]}};
\ No newline at end of file
index 4bce93d..70c3213 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e3b=['request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir'];(function(_0x171a8a,_0x2c6407){var _0x178cbc=function(_0x17cec0){while(--_0x17cec0){_0x171a8a['push'](_0x171a8a['shift']());}};_0x178cbc(++_0x2c6407);}(_0x0e3b,0x125));var _0xb0e3=function(_0x4200ff,_0x25558d){_0x4200ff=_0x4200ff-0x0;var _0x50d61f=_0x0e3b[_0x4200ff];return _0x50d61f;};'use strict';var emlformat=require(_0xb0e3('0x0'));var rimraf=require(_0xb0e3('0x1'));var zipdir=require(_0xb0e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0e3('0x3'));var moment=require(_0xb0e3('0x4'));var BPromise=require(_0xb0e3('0x5'));var Mustache=require('mustache');var util=require(_0xb0e3('0x6'));var path=require(_0xb0e3('0x7'));var sox=require('sox');var csv=require(_0xb0e3('0x8'));var ejs=require(_0xb0e3('0x9'));var fs=require('fs');var fs_extra=require(_0xb0e3('0xa'));var _=require(_0xb0e3('0xb'));var squel=require('squel');var crypto=require(_0xb0e3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb0e3('0xd'));var toCsv=require(_0xb0e3('0x8'));var querystring=require(_0xb0e3('0xe'));var Papa=require(_0xb0e3('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb0e3('0x10'));var as=require(_0xb0e3('0x11'));var hardwareService=require(_0xb0e3('0x12'));var logger=require(_0xb0e3('0x13'))(_0xb0e3('0x14'));var utils=require(_0xb0e3('0x15'));var config=require(_0xb0e3('0x16'));var licenseUtil=require(_0xb0e3('0x17'));var db=require(_0xb0e3('0x18'))['db'];function respondWithStatusCode(_0x46f71e,_0x20e2bc){_0x20e2bc=_0x20e2bc||0xcc;return function(_0x59d7c3){if(_0x59d7c3){return _0x46f71e['sendStatus'](_0x20e2bc);}return _0x46f71e[_0xb0e3('0x19')](_0x20e2bc)[_0xb0e3('0x1a')]();};}function respondWithResult(_0x5e05b8,_0x3ba2d8){_0x3ba2d8=_0x3ba2d8||0xc8;return function(_0x19b30f){if(_0x19b30f){return _0x5e05b8['status'](_0x3ba2d8)[_0xb0e3('0x1b')](_0x19b30f);}};}function respondWithFilteredResult(_0x5410b7,_0x2b2457){return function(_0x5a19ce){if(_0x5a19ce){var _0x3d20bb=typeof _0x2b2457['offset']===_0xb0e3('0x1c')&&typeof _0x2b2457['limit']==='undefined';var _0x3d68cc=_0x5a19ce[_0xb0e3('0x1d')];var _0x3d0866=_0x3d20bb?0x0:_0x2b2457[_0xb0e3('0x1e')];var _0x144222=_0x3d20bb?_0x5a19ce[_0xb0e3('0x1d')]:_0x2b2457['offset']+_0x2b2457['limit'];var _0x2b6154;if(_0x144222>=_0x3d68cc){_0x144222=_0x3d68cc;_0x2b6154=0xc8;}else{_0x2b6154=0xce;}_0x5410b7['status'](_0x2b6154);return _0x5410b7[_0xb0e3('0x1f')]('Content-Range',_0x3d0866+'-'+_0x144222+'/'+_0x3d68cc)['json'](_0x5a19ce);}return null;};}function patchUpdates(_0x37be78){return function(_0x19883f){try{jsonpatch['apply'](_0x19883f,_0x37be78,!![]);}catch(_0x22de6f){return BPromise[_0xb0e3('0x20')](_0x22de6f);}return _0x19883f[_0xb0e3('0x21')]();};}function saveUpdates(_0x4a1f27,_0x47730e){return function(_0x3201d6){if(_0x3201d6){return _0x3201d6[_0xb0e3('0x22')](_0x4a1f27)[_0xb0e3('0x23')](function(_0x54f636){return _0x54f636;});}return null;};}function removeEntity(_0x5c8e5b,_0x1b4385){return function(_0x486666){if(_0x486666){return _0x486666[_0xb0e3('0x24')]()[_0xb0e3('0x23')](function(){_0x5c8e5b[_0xb0e3('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11ce90,_0x536828){return function(_0xc5286){if(!_0xc5286){_0x11ce90['sendStatus'](0x194);}return _0xc5286;};}function handleError(_0x508166,_0x524f8a){_0x524f8a=_0x524f8a||0x1f4;return function(_0x44e9ce){logger[_0xb0e3('0x25')](_0x44e9ce[_0xb0e3('0x26')]);if(_0x44e9ce['name']){delete _0x44e9ce[_0xb0e3('0x27')];}_0x508166[_0xb0e3('0x19')](_0x524f8a)[_0xb0e3('0x28')](_0x44e9ce);};}exports[_0xb0e3('0x29')]=function(_0x246da2,_0x370305){var _0x1e53f0={},_0x8c728f={},_0x20dd68={'count':0x0,'rows':[]};var _0x456464=_[_0xb0e3('0x2a')](db[_0xb0e3('0x2b')][_0xb0e3('0x2c')],function(_0x34d4b1){return{'name':_0x34d4b1[_0xb0e3('0x2d')],'type':_0x34d4b1[_0xb0e3('0x2e')]['key']};});_0x8c728f[_0xb0e3('0x2f')]=_[_0xb0e3('0x2a')](_0x456464,_0xb0e3('0x27'));_0x8c728f[_0xb0e3('0x30')]=_[_0xb0e3('0x31')](_0x246da2[_0xb0e3('0x30')]);_0x8c728f[_0xb0e3('0x32')]=_[_0xb0e3('0x33')](_0x8c728f['model'],_0x8c728f[_0xb0e3('0x30')]);_0x1e53f0[_0xb0e3('0x34')]=_['intersection'](_0x8c728f['model'],qs['fields'](_0x246da2[_0xb0e3('0x30')][_0xb0e3('0x35')]));_0x1e53f0['attributes']=_0x1e53f0[_0xb0e3('0x34')][_0xb0e3('0x36')]?_0x1e53f0[_0xb0e3('0x34')]:_0x8c728f['model'];if(!_0x246da2['query'][_0xb0e3('0x37')]('nolimit')){_0x1e53f0[_0xb0e3('0x38')]=qs[_0xb0e3('0x38')](_0x246da2[_0xb0e3('0x30')][_0xb0e3('0x38')]);_0x1e53f0[_0xb0e3('0x1e')]=qs['offset'](_0x246da2[_0xb0e3('0x30')]['offset']);}_0x1e53f0['order']=qs[_0xb0e3('0x39')](_0x246da2[_0xb0e3('0x30')]['sort']);_0x1e53f0[_0xb0e3('0x3a')]=qs[_0xb0e3('0x32')](_[_0xb0e3('0x3b')](_0x246da2[_0xb0e3('0x30')],_0x8c728f[_0xb0e3('0x32')]),_0x456464);if(_0x246da2[_0xb0e3('0x30')][_0xb0e3('0x3c')]){_0x1e53f0[_0xb0e3('0x3a')]=_[_0xb0e3('0x3d')](_0x1e53f0[_0xb0e3('0x3a')],{'$or':_[_0xb0e3('0x2a')](_0x456464,function(_0x1b60db){if(_0x1b60db[_0xb0e3('0x2e')]!==_0xb0e3('0x3e')){var _0x5c764e={};_0x5c764e[_0x1b60db['name']]={'$like':'%'+_0x246da2[_0xb0e3('0x30')]['filter']+'%'};return _0x5c764e;}})});}_0x1e53f0=_[_0xb0e3('0x3d')]({},_0x1e53f0,_0x246da2['options']);var _0x3d1865={'where':_0x1e53f0[_0xb0e3('0x3a')]};return db[_0xb0e3('0x2b')][_0xb0e3('0x1d')](_0x3d1865)[_0xb0e3('0x23')](function(_0x1c5e29){_0x20dd68['count']=_0x1c5e29;if(_0x246da2[_0xb0e3('0x30')][_0xb0e3('0x3f')]){_0x1e53f0[_0xb0e3('0x40')]=[{'all':!![]}];}return db[_0xb0e3('0x2b')][_0xb0e3('0x41')](_0x1e53f0);})[_0xb0e3('0x23')](function(_0x238ab2){_0x20dd68[_0xb0e3('0x42')]=_0x238ab2;return _0x20dd68;})[_0xb0e3('0x23')](respondWithFilteredResult(_0x370305,_0x1e53f0))[_0xb0e3('0x43')](handleError(_0x370305,null));};exports[_0xb0e3('0x44')]=function(_0xc1a712,_0x458570){var _0x4b5327={'raw':!![],'where':{'id':_0xc1a712[_0xb0e3('0x45')]['id']}},_0x261be9={};_0x261be9[_0xb0e3('0x2f')]=_[_0xb0e3('0x31')](db[_0xb0e3('0x2b')][_0xb0e3('0x2c')]);_0x261be9['query']=_[_0xb0e3('0x31')](_0xc1a712[_0xb0e3('0x30')]);_0x261be9[_0xb0e3('0x32')]=_['intersection'](_0x261be9[_0xb0e3('0x2f')],_0x261be9[_0xb0e3('0x30')]);_0x4b5327[_0xb0e3('0x34')]=_['intersection'](_0x261be9['model'],qs[_0xb0e3('0x35')](_0xc1a712[_0xb0e3('0x30')][_0xb0e3('0x35')]));_0x4b5327[_0xb0e3('0x34')]=_0x4b5327[_0xb0e3('0x34')]['length']?_0x4b5327['attributes']:_0x261be9[_0xb0e3('0x2f')];if(_0xc1a712[_0xb0e3('0x30')][_0xb0e3('0x3f')]){_0x4b5327[_0xb0e3('0x40')]=[{'all':!![]}];}_0x4b5327=_[_0xb0e3('0x3d')]({},_0x4b5327,_0xc1a712[_0xb0e3('0x46')]);return db['ZohoField'][_0xb0e3('0x47')](_0x4b5327)[_0xb0e3('0x23')](handleEntityNotFound(_0x458570,null))['then'](respondWithResult(_0x458570,null))[_0xb0e3('0x43')](handleError(_0x458570,null));};exports[_0xb0e3('0x48')]=function(_0x128acb,_0xba4804){return db[_0xb0e3('0x2b')][_0xb0e3('0x48')](_0x128acb[_0xb0e3('0x49')],{})['then'](respondWithResult(_0xba4804,0xc9))['catch'](handleError(_0xba4804,null));};exports['update']=function(_0x20cee3,_0x3f51a8){if(_0x20cee3[_0xb0e3('0x49')]['id']){delete _0x20cee3[_0xb0e3('0x49')]['id'];}return db[_0xb0e3('0x2b')][_0xb0e3('0x47')]({'where':{'id':_0x20cee3[_0xb0e3('0x45')]['id']}})['then'](handleEntityNotFound(_0x3f51a8,null))['then'](saveUpdates(_0x20cee3['body'],null))[_0xb0e3('0x23')](respondWithResult(_0x3f51a8,null))['catch'](handleError(_0x3f51a8,null));};exports[_0xb0e3('0x24')]=function(_0x13ddc2,_0x5c03d3){return db[_0xb0e3('0x2b')][_0xb0e3('0x47')]({'where':{'id':_0x13ddc2['params']['id']}})[_0xb0e3('0x23')](handleEntityNotFound(_0x5c03d3,null))[_0xb0e3('0x23')](removeEntity(_0x5c03d3,null))[_0xb0e3('0x43')](handleError(_0x5c03d3,null));};
\ No newline at end of file
+var _0x7bf2=['json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','ZohoField','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x80fca1,_0x40bfe8){var _0x3a37a4=function(_0x5a8bcc){while(--_0x5a8bcc){_0x80fca1['push'](_0x80fca1['shift']());}};_0x3a37a4(++_0x40bfe8);}(_0x7bf2,0xc8));var _0x27bf=function(_0xca3e25,_0x843793){_0xca3e25=_0xca3e25-0x0;var _0x46be0c=_0x7bf2[_0xca3e25];return _0x46be0c;};'use strict';var emlformat=require(_0x27bf('0x0'));var rimraf=require(_0x27bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x27bf('0x2'));var rp=require(_0x27bf('0x3'));var moment=require(_0x27bf('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x27bf('0x5'));var util=require('util');var path=require(_0x27bf('0x6'));var sox=require(_0x27bf('0x7'));var csv=require(_0x27bf('0x8'));var ejs=require(_0x27bf('0x9'));var fs=require('fs');var fs_extra=require(_0x27bf('0xa'));var _=require(_0x27bf('0xb'));var squel=require(_0x27bf('0xc'));var crypto=require(_0x27bf('0xd'));var jsforce=require(_0x27bf('0xe'));var deskjs=require(_0x27bf('0xf'));var toCsv=require(_0x27bf('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x27bf('0x10'));var authService=require(_0x27bf('0x11'));var qs=require(_0x27bf('0x12'));var as=require(_0x27bf('0x13'));var hardwareService=require(_0x27bf('0x14'));var logger=require('../../config/logger')(_0x27bf('0x15'));var utils=require(_0x27bf('0x16'));var config=require(_0x27bf('0x17'));var licenseUtil=require(_0x27bf('0x18'));var db=require(_0x27bf('0x19'))['db'];function respondWithStatusCode(_0x2347eb,_0x4e205a){_0x4e205a=_0x4e205a||0xcc;return function(_0x118b81){if(_0x118b81){return _0x2347eb[_0x27bf('0x1a')](_0x4e205a);}return _0x2347eb[_0x27bf('0x1b')](_0x4e205a)['end']();};}function respondWithResult(_0x2fa636,_0x42ed48){_0x42ed48=_0x42ed48||0xc8;return function(_0x41908a){if(_0x41908a){return _0x2fa636[_0x27bf('0x1b')](_0x42ed48)[_0x27bf('0x1c')](_0x41908a);}};}function respondWithFilteredResult(_0x51e1c5,_0x40b380){return function(_0x4d0d43){if(_0x4d0d43){var _0xc92957=typeof _0x40b380[_0x27bf('0x1d')]===_0x27bf('0x1e')&&typeof _0x40b380[_0x27bf('0x1f')]===_0x27bf('0x1e');var _0xfff594=_0x4d0d43[_0x27bf('0x20')];var _0x3b8e5e=_0xc92957?0x0:_0x40b380[_0x27bf('0x1d')];var _0x9f9646=_0xc92957?_0x4d0d43[_0x27bf('0x20')]:_0x40b380[_0x27bf('0x1d')]+_0x40b380[_0x27bf('0x1f')];var _0x4316e3;if(_0x9f9646>=_0xfff594){_0x9f9646=_0xfff594;_0x4316e3=0xc8;}else{_0x4316e3=0xce;}_0x51e1c5['status'](_0x4316e3);return _0x51e1c5['set'](_0x27bf('0x21'),_0x3b8e5e+'-'+_0x9f9646+'/'+_0xfff594)[_0x27bf('0x1c')](_0x4d0d43);}return null;};}function patchUpdates(_0x23fbce){return function(_0x265bb0){try{jsonpatch['apply'](_0x265bb0,_0x23fbce,!![]);}catch(_0x336e7a){return BPromise[_0x27bf('0x22')](_0x336e7a);}return _0x265bb0[_0x27bf('0x23')]();};}function saveUpdates(_0x1ff83a,_0x265b7a){return function(_0x14e049){if(_0x14e049){return _0x14e049[_0x27bf('0x24')](_0x1ff83a)[_0x27bf('0x25')](function(_0x13749b){return _0x13749b;});}return null;};}function removeEntity(_0x377715,_0x127372){return function(_0x2c2a45){if(_0x2c2a45){return _0x2c2a45[_0x27bf('0x26')]()[_0x27bf('0x25')](function(){_0x377715[_0x27bf('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28ea54,_0x2b92b9){return function(_0x1ea48c){if(!_0x1ea48c){_0x28ea54[_0x27bf('0x1a')](0x194);}return _0x1ea48c;};}function handleError(_0x21b095,_0xcdce31){_0xcdce31=_0xcdce31||0x1f4;return function(_0x7cce92){logger[_0x27bf('0x27')](_0x7cce92['stack']);if(_0x7cce92[_0x27bf('0x28')]){delete _0x7cce92['name'];}_0x21b095[_0x27bf('0x1b')](_0xcdce31)[_0x27bf('0x29')](_0x7cce92);};}exports[_0x27bf('0x2a')]=function(_0x29d9b2,_0x2afda6){var _0x1d1142={},_0x418b4b={},_0x16b71e={'count':0x0,'rows':[]};var _0x457119=_[_0x27bf('0x2b')](db[_0x27bf('0x2c')][_0x27bf('0x2d')],function(_0x15dc37){return{'name':_0x15dc37['fieldName'],'type':_0x15dc37[_0x27bf('0x2e')][_0x27bf('0x2f')]};});_0x418b4b[_0x27bf('0x30')]=_['map'](_0x457119,_0x27bf('0x28'));_0x418b4b['query']=_[_0x27bf('0x31')](_0x29d9b2[_0x27bf('0x32')]);_0x418b4b['filters']=_[_0x27bf('0x33')](_0x418b4b[_0x27bf('0x30')],_0x418b4b['query']);_0x1d1142[_0x27bf('0x34')]=_['intersection'](_0x418b4b['model'],qs['fields'](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x35')]));_0x1d1142[_0x27bf('0x34')]=_0x1d1142[_0x27bf('0x34')]['length']?_0x1d1142[_0x27bf('0x34')]:_0x418b4b['model'];if(!_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x36')](_0x27bf('0x37'))){_0x1d1142['limit']=qs[_0x27bf('0x1f')](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x1f')]);_0x1d1142[_0x27bf('0x1d')]=qs[_0x27bf('0x1d')](_0x29d9b2['query'][_0x27bf('0x1d')]);}_0x1d1142[_0x27bf('0x38')]=qs[_0x27bf('0x39')](_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x39')]);_0x1d1142[_0x27bf('0x3a')]=qs[_0x27bf('0x3b')](_[_0x27bf('0x3c')](_0x29d9b2['query'],_0x418b4b[_0x27bf('0x3b')]),_0x457119);if(_0x29d9b2['query'][_0x27bf('0x3d')]){_0x1d1142['where']=_[_0x27bf('0x3e')](_0x1d1142[_0x27bf('0x3a')],{'$or':_[_0x27bf('0x2b')](_0x457119,function(_0x48c54a){if(_0x48c54a[_0x27bf('0x2e')]!==_0x27bf('0x3f')){var _0x435bdd={};_0x435bdd[_0x48c54a['name']]={'$like':'%'+_0x29d9b2[_0x27bf('0x32')][_0x27bf('0x3d')]+'%'};return _0x435bdd;}})});}_0x1d1142=_[_0x27bf('0x3e')]({},_0x1d1142,_0x29d9b2['options']);var _0x18da2b={'where':_0x1d1142[_0x27bf('0x3a')]};return db[_0x27bf('0x2c')][_0x27bf('0x20')](_0x18da2b)[_0x27bf('0x25')](function(_0x87ebd0){_0x16b71e[_0x27bf('0x20')]=_0x87ebd0;if(_0x29d9b2['query'][_0x27bf('0x40')]){_0x1d1142[_0x27bf('0x41')]=[{'all':!![]}];}return db['ZohoField'][_0x27bf('0x42')](_0x1d1142);})[_0x27bf('0x25')](function(_0x377e3d){_0x16b71e[_0x27bf('0x43')]=_0x377e3d;return _0x16b71e;})[_0x27bf('0x25')](respondWithFilteredResult(_0x2afda6,_0x1d1142))['catch'](handleError(_0x2afda6,null));};exports[_0x27bf('0x44')]=function(_0x255008,_0x2807eb){var _0x2b7f55={'raw':!![],'where':{'id':_0x255008[_0x27bf('0x45')]['id']}},_0x332366={};_0x332366[_0x27bf('0x30')]=_[_0x27bf('0x31')](db[_0x27bf('0x2c')][_0x27bf('0x2d')]);_0x332366[_0x27bf('0x32')]=_[_0x27bf('0x31')](_0x255008[_0x27bf('0x32')]);_0x332366[_0x27bf('0x3b')]=_[_0x27bf('0x33')](_0x332366[_0x27bf('0x30')],_0x332366[_0x27bf('0x32')]);_0x2b7f55['attributes']=_[_0x27bf('0x33')](_0x332366['model'],qs[_0x27bf('0x35')](_0x255008['query'][_0x27bf('0x35')]));_0x2b7f55[_0x27bf('0x34')]=_0x2b7f55['attributes'][_0x27bf('0x46')]?_0x2b7f55['attributes']:_0x332366[_0x27bf('0x30')];if(_0x255008[_0x27bf('0x32')][_0x27bf('0x40')]){_0x2b7f55['include']=[{'all':!![]}];}_0x2b7f55=_['merge']({},_0x2b7f55,_0x255008[_0x27bf('0x47')]);return db['ZohoField']['find'](_0x2b7f55)[_0x27bf('0x25')](handleEntityNotFound(_0x2807eb,null))[_0x27bf('0x25')](respondWithResult(_0x2807eb,null))[_0x27bf('0x48')](handleError(_0x2807eb,null));};exports[_0x27bf('0x49')]=function(_0x391f70,_0x135c53){return db[_0x27bf('0x2c')][_0x27bf('0x49')](_0x391f70['body'],{})[_0x27bf('0x25')](respondWithResult(_0x135c53,0xc9))[_0x27bf('0x48')](handleError(_0x135c53,null));};exports[_0x27bf('0x24')]=function(_0x6177e2,_0x518417){if(_0x6177e2[_0x27bf('0x4a')]['id']){delete _0x6177e2[_0x27bf('0x4a')]['id'];}return db[_0x27bf('0x2c')][_0x27bf('0x4b')]({'where':{'id':_0x6177e2['params']['id']}})['then'](handleEntityNotFound(_0x518417,null))[_0x27bf('0x25')](saveUpdates(_0x6177e2[_0x27bf('0x4a')],null))['then'](respondWithResult(_0x518417,null))[_0x27bf('0x48')](handleError(_0x518417,null));};exports[_0x27bf('0x26')]=function(_0xf996fe,_0x2c50d9){return db[_0x27bf('0x2c')][_0x27bf('0x4b')]({'where':{'id':_0xf996fe[_0x27bf('0x45')]['id']}})[_0x27bf('0x25')](handleEntityNotFound(_0x2c50d9,null))['then'](removeEntity(_0x2c50d9,null))[_0x27bf('0x48')](handleError(_0x2c50d9,null));};
\ No newline at end of file
index 96d4aaf..0328d53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','bluebird','request-promise','path'];(function(_0x382c0f,_0x3ec282){var _0x42ec77=function(_0x2993d8){while(--_0x2993d8){_0x382c0f['push'](_0x382c0f['shift']());}};_0x42ec77(++_0x3ec282);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));module[_0xb71a('0x8')]=function(_0x38d931,_0x22c072){return _0x38d931[_0xb71a('0x9')](_0xb71a('0xa'),attributes,{'tableName':_0xb71a('0xb'),'paranoid':![],'indexes':[{'name':_0xb71a('0xc'),'fields':[_0xb71a('0xd'),_0xb71a('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2272=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','exports'];(function(_0x1080c7,_0x555363){var _0x4c3e6d=function(_0xfaaa23){while(--_0xfaaa23){_0x1080c7['push'](_0x1080c7['shift']());}};_0x4c3e6d(++_0x555363);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intZohoField.attributes');module[_0x2227('0x8')]=function(_0x3b8661,_0xb33647){return _0x3b8661[_0x2227('0x9')](_0x2227('0xa'),attributes,{'tableName':_0x2227('0xb'),'paranoid':![],'indexes':[{'name':_0x2227('0xc'),'fields':[_0x2227('0xd'),_0x2227('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 58a3c4c..f513bf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9609=['info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x651909,_0x15c6b4){var _0x572299=function(_0x5e8a48){while(--_0x5e8a48){_0x651909['push'](_0x651909['shift']());}};_0x572299(++_0x15c6b4);}(_0x9609,0xb9));var _0x9960=function(_0x80132,_0xa11042){_0x80132=_0x80132-0x0;var _0x26db18=_0x9609[_0x80132];return _0x26db18;};'use strict';var _=require(_0x9960('0x0'));var util=require(_0x9960('0x1'));var moment=require(_0x9960('0x2'));var BPromise=require(_0x9960('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9960('0x4'));var db=require(_0x9960('0x5'))['db'];var utils=require(_0x9960('0x6'));var logger=require(_0x9960('0x7'))(_0x9960('0x8'));var config=require(_0x9960('0x9'));var jayson=require(_0x9960('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6637,_0x40ac8c,_0x211142){return new BPromise(function(_0x145016,_0x14d6e6){return client[_0x9960('0xb')](_0x2e6637,_0x211142)[_0x9960('0xc')](function(_0x21312c){logger[_0x9960('0xd')]('ZohoField,\x20%s,\x20%s',_0x40ac8c,_0x9960('0xe'));logger[_0x9960('0xf')](_0x9960('0x10'),_0x40ac8c,_0x9960('0xe'),JSON['stringify'](_0x21312c));if(_0x21312c[_0x9960('0x11')]){if(_0x21312c[_0x9960('0x11')][_0x9960('0x12')]===0x1f4){logger[_0x9960('0x11')](_0x9960('0x13'),_0x40ac8c,_0x21312c['error']['message']);return _0x14d6e6(_0x21312c[_0x9960('0x11')]['message']);}logger[_0x9960('0x11')]('ZohoField,\x20%s,\x20%s',_0x40ac8c,_0x21312c[_0x9960('0x11')][_0x9960('0x14')]);return _0x145016(_0x21312c[_0x9960('0x11')][_0x9960('0x14')]);}else{logger['info'](_0x9960('0x13'),_0x40ac8c,_0x9960('0xe'));_0x145016(_0x21312c['result'][_0x9960('0x14')]);}})[_0x9960('0x15')](function(_0x39e2cf){logger[_0x9960('0x11')](_0x9960('0x13'),_0x40ac8c,_0x39e2cf);_0x14d6e6(_0x39e2cf);});});}
\ No newline at end of file
+var _0x71b0=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x1a76a6,_0x4064f9){var _0x57e502=function(_0x577623){while(--_0x577623){_0x1a76a6['push'](_0x1a76a6['shift']());}};_0x57e502(++_0x4064f9);}(_0x71b0,0x1a5));var _0x071b=function(_0x376884,_0x386e04){_0x376884=_0x376884-0x0;var _0x32e0a2=_0x71b0[_0x376884];return _0x32e0a2;};'use strict';var _=require(_0x071b('0x0'));var util=require(_0x071b('0x1'));var moment=require(_0x071b('0x2'));var BPromise=require(_0x071b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x071b('0x4'));var db=require(_0x071b('0x5'))['db'];var utils=require(_0x071b('0x6'));var logger=require(_0x071b('0x7'))(_0x071b('0x8'));var config=require(_0x071b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x071b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1270ec,_0x5ee7a4,_0x1b2f01){return new BPromise(function(_0x142678,_0x5b7ae4){return client[_0x071b('0xb')](_0x1270ec,_0x1b2f01)[_0x071b('0xc')](function(_0x17b6bc){logger[_0x071b('0xd')](_0x071b('0xe'),_0x5ee7a4,_0x071b('0xf'));logger[_0x071b('0x10')](_0x071b('0x11'),_0x5ee7a4,_0x071b('0xf'),JSON[_0x071b('0x12')](_0x17b6bc));if(_0x17b6bc[_0x071b('0x13')]){if(_0x17b6bc[_0x071b('0x13')][_0x071b('0x14')]===0x1f4){logger[_0x071b('0x13')](_0x071b('0xe'),_0x5ee7a4,_0x17b6bc['error'][_0x071b('0x15')]);return _0x5b7ae4(_0x17b6bc['error'][_0x071b('0x15')]);}logger[_0x071b('0x13')]('ZohoField,\x20%s,\x20%s',_0x5ee7a4,_0x17b6bc[_0x071b('0x13')][_0x071b('0x15')]);return _0x142678(_0x17b6bc['error'][_0x071b('0x15')]);}else{logger['info'](_0x071b('0xe'),_0x5ee7a4,'request\x20sent');_0x142678(_0x17b6bc[_0x071b('0x16')][_0x071b('0x15')]);}})['catch'](function(_0x4819d4){logger[_0x071b('0x13')]('ZohoField,\x20%s,\x20%s',_0x5ee7a4,_0x4819d4);_0x5b7ae4(_0x4819d4);});});}
\ No newline at end of file
index a0c7479..8c50638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x3df9dd,_0x26f5cd){var _0x4f11e4=function(_0x1993fe){while(--_0x1993fe){_0x3df9dd['push'](_0x3df9dd['shift']());}};_0x4f11e4(++_0x26f5cd);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x598ba5,_0x5045f2){var _0x8c4df5=function(_0x548183){while(--_0x548183){_0x598ba5['push'](_0x598ba5['shift']());}};_0x8c4df5(++_0x5045f2);}(_0xe706,0xa3));var _0x6e70=function(_0x4b26b5,_0x4f71fd){_0x4b26b5=_0x4b26b5-0x0;var _0x4dec71=_0xe706[_0x4b26b5];return _0x4dec71;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index a563930..f09a28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ba0=['BOOLEAN','state','sequelize','STRING','unique_name_and_version','app.js'];(function(_0x264f4b,_0x18f249){var _0x577866=function(_0x260b33){while(--_0x260b33){_0x264f4b['push'](_0x264f4b['shift']());}};_0x577866(++_0x18f249);}(_0x4ba0,0xe0));var _0x04ba=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x4ba0[_0x17928f];return _0x500b63;};'use strict';var Sequelize=require(_0x04ba('0x0'));module['exports']={'name':{'type':Sequelize[_0x04ba('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x04ba('0x1')],'allowNull':![],'unique':_0x04ba('0x2')},'main':{'type':Sequelize[_0x04ba('0x1')],'defaultValue':_0x04ba('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x04ba('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x04ba('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x04ba('0x1')]},'state':{'type':Sequelize[_0x04ba('0x1')],'unique':_0x04ba('0x5')},'description':{'type':Sequelize[_0x04ba('0x1')]},'title':{'type':Sequelize[_0x04ba('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0x95e6=['BOOLEAN','STRING','unique_name_and_version','app.js'];(function(_0x1b7d93,_0x3b19a1){var _0x4f0f54=function(_0x37add4){while(--_0x37add4){_0x1b7d93['push'](_0x1b7d93['shift']());}};_0x4f0f54(++_0x3b19a1);}(_0x95e6,0x6d));var _0x695e=function(_0x349f3e,_0x3b4ff2){_0x349f3e=_0x349f3e-0x0;var _0x41a299=_0x95e6[_0x349f3e];return _0x41a299;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0x695e('0x0')],'allowNull':![],'unique':_0x695e('0x1')},'main':{'type':Sequelize[_0x695e('0x0')],'defaultValue':_0x695e('0x2')},'filename':{'type':Sequelize[_0x695e('0x0')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x695e('0x0')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x695e('0x3')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x695e('0x0')]},'state':{'type':Sequelize[_0x695e('0x0')],'unique':'state'},'description':{'type':Sequelize[_0x695e('0x0')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x695e('0x0')]},'link':{'type':Sequelize[_0x695e('0x0')],'defaultValue':'#'}};
\ No newline at end of file
index abcb16c..489624c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c3c=['VIRTUAL','options','Integration','includeAll','include','findAll','rows','params','merge','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type'];(function(_0x1d06a8,_0xb555ab){var _0x2db796=function(_0x5677a9){while(--_0x5677a9){_0x1d06a8['push'](_0x1d06a8['shift']());}};_0x2db796(++_0xb555ab);}(_0x5c3c,0x132));var _0xc5c3=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0x5c3c[_0x1a36a5];return _0x746243;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));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 Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['Integration'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['Integration'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['Integration'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['Integration'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};
\ No newline at end of file
+var _0x524e=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','destroy','name','send','index','map','rawAttributes','key','model','keys','filters','intersection','attributes','fields','query','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','Integration','then','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x524e,0x15e));var _0xe524=function(_0x53aac1,_0x22155f){_0x53aac1=_0x53aac1-0x0;var _0x578d2d=_0x524e[_0x53aac1];return _0x578d2d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe524('0x0'));var jsonpatch=require(_0xe524('0x1'));var rp=require(_0xe524('0x2'));var moment=require(_0xe524('0x3'));var BPromise=require(_0xe524('0x4'));var Mustache=require(_0xe524('0x5'));var util=require(_0xe524('0x6'));var path=require(_0xe524('0x7'));var sox=require(_0xe524('0x8'));var csv=require(_0xe524('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe524('0xa'));var _=require(_0xe524('0xb'));var squel=require(_0xe524('0xc'));var crypto=require('crypto');var jsforce=require(_0xe524('0xd'));var deskjs=require(_0xe524('0xe'));var toCsv=require(_0xe524('0x9'));var querystring=require(_0xe524('0xf'));var Papa=require(_0xe524('0x10'));var Redis=require(_0xe524('0x11'));var authService=require(_0xe524('0x12'));var qs=require(_0xe524('0x13'));var as=require(_0xe524('0x14'));var hardwareService=require(_0xe524('0x15'));var logger=require(_0xe524('0x16'))(_0xe524('0x17'));var utils=require(_0xe524('0x18'));var config=require(_0xe524('0x19'));var licenseUtil=require(_0xe524('0x1a'));var db=require(_0xe524('0x1b'))['db'];function respondWithStatusCode(_0x5077c1,_0x4b0f51){_0x4b0f51=_0x4b0f51||0xcc;return function(_0xfdc2a5){if(_0xfdc2a5){return _0x5077c1[_0xe524('0x1c')](_0x4b0f51);}return _0x5077c1[_0xe524('0x1d')](_0x4b0f51)[_0xe524('0x1e')]();};}function respondWithResult(_0x20a852,_0x57c1b6){_0x57c1b6=_0x57c1b6||0xc8;return function(_0x12ff75){if(_0x12ff75){return _0x20a852['status'](_0x57c1b6)[_0xe524('0x1f')](_0x12ff75);}};}function respondWithFilteredResult(_0x1b0af6,_0x48165e){return function(_0x569660){if(_0x569660){var _0x488fce=typeof _0x48165e[_0xe524('0x20')]==='undefined'&&typeof _0x48165e[_0xe524('0x21')]==='undefined';var _0x5c8736=_0x569660['count'];var _0x3a4027=_0x488fce?0x0:_0x48165e['offset'];var _0x11b2a1=_0x488fce?_0x569660[_0xe524('0x22')]:_0x48165e[_0xe524('0x20')]+_0x48165e[_0xe524('0x21')];var _0x5d7b17;if(_0x11b2a1>=_0x5c8736){_0x11b2a1=_0x5c8736;_0x5d7b17=0xc8;}else{_0x5d7b17=0xce;}_0x1b0af6[_0xe524('0x1d')](_0x5d7b17);return _0x1b0af6[_0xe524('0x23')]('Content-Range',_0x3a4027+'-'+_0x11b2a1+'/'+_0x5c8736)[_0xe524('0x1f')](_0x569660);}return null;};}function patchUpdates(_0x309f85){return function(_0x43a4f9){try{jsonpatch[_0xe524('0x24')](_0x43a4f9,_0x309f85,!![]);}catch(_0x1c4194){return BPromise[_0xe524('0x25')](_0x1c4194);}return _0x43a4f9[_0xe524('0x26')]();};}function saveUpdates(_0x375219,_0x7dfe97){return function(_0x5c4d21){if(_0x5c4d21){return _0x5c4d21[_0xe524('0x27')](_0x375219)['then'](function(_0x577d1f){return _0x577d1f;});}return null;};}function removeEntity(_0x2d2f83,_0x23df5e){return function(_0x1ad106){if(_0x1ad106){return _0x1ad106[_0xe524('0x28')]()['then'](function(){_0x2d2f83[_0xe524('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17e245,_0xcf5db){return function(_0xd62772){if(!_0xd62772){_0x17e245[_0xe524('0x1c')](0x194);}return _0xd62772;};}function handleError(_0x4102d9,_0xfd5965){_0xfd5965=_0xfd5965||0x1f4;return function(_0x2141db){logger['error'](_0x2141db['stack']);if(_0x2141db[_0xe524('0x29')]){delete _0x2141db[_0xe524('0x29')];}_0x4102d9[_0xe524('0x1d')](_0xfd5965)[_0xe524('0x2a')](_0x2141db);};}exports[_0xe524('0x2b')]=function(_0x5405e4,_0x52f140){var _0x4b1ff={},_0x25e7a7={},_0x3aedd9={'count':0x0,'rows':[]};var _0x8070e4=_[_0xe524('0x2c')](db['Integration'][_0xe524('0x2d')],function(_0x9a7e98){return{'name':_0x9a7e98['fieldName'],'type':_0x9a7e98['type'][_0xe524('0x2e')]};});_0x25e7a7[_0xe524('0x2f')]=_['map'](_0x8070e4,_0xe524('0x29'));_0x25e7a7['query']=_[_0xe524('0x30')](_0x5405e4['query']);_0x25e7a7[_0xe524('0x31')]=_[_0xe524('0x32')](_0x25e7a7[_0xe524('0x2f')],_0x25e7a7['query']);_0x4b1ff[_0xe524('0x33')]=_['intersection'](_0x25e7a7[_0xe524('0x2f')],qs[_0xe524('0x34')](_0x5405e4[_0xe524('0x35')]['fields']));_0x4b1ff[_0xe524('0x33')]=_0x4b1ff[_0xe524('0x33')]['length']?_0x4b1ff[_0xe524('0x33')]:_0x25e7a7[_0xe524('0x2f')];if(!_0x5405e4[_0xe524('0x35')][_0xe524('0x36')]('nolimit')){_0x4b1ff[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x5405e4[_0xe524('0x35')][_0xe524('0x21')]);_0x4b1ff[_0xe524('0x20')]=qs[_0xe524('0x20')](_0x5405e4[_0xe524('0x35')][_0xe524('0x20')]);}_0x4b1ff['order']=qs[_0xe524('0x37')](_0x5405e4['query'][_0xe524('0x37')]);_0x4b1ff[_0xe524('0x38')]=qs['filters'](_[_0xe524('0x39')](_0x5405e4['query'],_0x25e7a7[_0xe524('0x31')]),_0x8070e4);if(_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]){_0x4b1ff[_0xe524('0x38')]=_[_0xe524('0x3b')](_0x4b1ff[_0xe524('0x38')],{'$or':_[_0xe524('0x2c')](_0x8070e4,function(_0x13762c){if(_0x13762c['type']!==_0xe524('0x3c')){var _0x940c05={};_0x940c05[_0x13762c[_0xe524('0x29')]]={'$like':'%'+_0x5405e4[_0xe524('0x35')][_0xe524('0x3a')]+'%'};return _0x940c05;}})});}_0x4b1ff=_[_0xe524('0x3b')]({},_0x4b1ff,_0x5405e4[_0xe524('0x3d')]);var _0x158d45={'where':_0x4b1ff['where']};return db[_0xe524('0x3e')][_0xe524('0x22')](_0x158d45)[_0xe524('0x3f')](function(_0x59781b){_0x3aedd9[_0xe524('0x22')]=_0x59781b;if(_0x5405e4['query'][_0xe524('0x40')]){_0x4b1ff[_0xe524('0x41')]=[{'all':!![]}];}return db[_0xe524('0x3e')][_0xe524('0x42')](_0x4b1ff);})[_0xe524('0x3f')](function(_0x4746cd){_0x3aedd9[_0xe524('0x43')]=_0x4746cd;return _0x3aedd9;})['then'](respondWithFilteredResult(_0x52f140,_0x4b1ff))[_0xe524('0x44')](handleError(_0x52f140,null));};exports[_0xe524('0x45')]=function(_0x13c54c,_0x376505){var _0x438962={'raw':![],'where':{'id':_0x13c54c['params']['id']}},_0x1ae283={};_0x1ae283[_0xe524('0x2f')]=_[_0xe524('0x30')](db[_0xe524('0x3e')]['rawAttributes']);_0x1ae283[_0xe524('0x35')]=_['keys'](_0x13c54c['query']);_0x1ae283[_0xe524('0x31')]=_[_0xe524('0x32')](_0x1ae283['model'],_0x1ae283[_0xe524('0x35')]);_0x438962[_0xe524('0x33')]=_[_0xe524('0x32')](_0x1ae283[_0xe524('0x2f')],qs['fields'](_0x13c54c['query'][_0xe524('0x34')]));_0x438962[_0xe524('0x33')]=_0x438962['attributes'][_0xe524('0x46')]?_0x438962['attributes']:_0x1ae283[_0xe524('0x2f')];if(_0x13c54c[_0xe524('0x35')][_0xe524('0x40')]){_0x438962[_0xe524('0x41')]=[{'all':!![]}];}_0x438962=_[_0xe524('0x3b')]({},_0x438962,_0x13c54c[_0xe524('0x3d')]);return db[_0xe524('0x3e')][_0xe524('0x47')](_0x438962)[_0xe524('0x3f')](handleEntityNotFound(_0x376505,null))[_0xe524('0x3f')](respondWithResult(_0x376505,null))[_0xe524('0x44')](handleError(_0x376505,null));};exports[_0xe524('0x48')]=function(_0x3d7ab7,_0x33b1c8){return db[_0xe524('0x3e')]['create'](_0x3d7ab7[_0xe524('0x49')],{})['then'](respondWithResult(_0x33b1c8,0xc9))['catch'](handleError(_0x33b1c8,null));};exports[_0xe524('0x27')]=function(_0x59fe6b,_0x232cf0){if(_0x59fe6b[_0xe524('0x49')]['id']){delete _0x59fe6b['body']['id'];}return db[_0xe524('0x3e')]['find']({'where':{'id':_0x59fe6b['params']['id']}})[_0xe524('0x3f')](handleEntityNotFound(_0x232cf0,null))[_0xe524('0x3f')](saveUpdates(_0x59fe6b[_0xe524('0x49')],null))['then'](respondWithResult(_0x232cf0,null))['catch'](handleError(_0x232cf0,null));};exports['destroy']=function(_0x4e9c3b,_0x4f7a64){return db['Integration'][_0xe524('0x47')]({'where':{'id':_0x4e9c3b[_0xe524('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f7a64,null))[_0xe524('0x3f')](removeEntity(_0x4f7a64,null))[_0xe524('0x44')](handleError(_0x4f7a64,null));};
\ No newline at end of file
index 313303a..31aceae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x209e=['bluebird','request-promise','path','rimraf','../../config/environment','define','util','api','moment'];(function(_0x151553,_0x295f9c){var _0x1a0ad6=function(_0x3d2fc5){while(--_0x3d2fc5){_0x151553['push'](_0x151553['shift']());}};_0x1a0ad6(++_0x295f9c);}(_0x209e,0x1e3));var _0xe209=function(_0x235f5a,_0x5d9707){_0x235f5a=_0x235f5a-0x0;var _0x5c9c3a=_0x209e[_0x235f5a];return _0x5c9c3a;};'use strict';var _=require('lodash');var util=require(_0xe209('0x0'));var logger=require('../../config/logger')(_0xe209('0x1'));var moment=require(_0xe209('0x2'));var BPromise=require(_0xe209('0x3'));var rp=require(_0xe209('0x4'));var fs=require('fs');var path=require(_0xe209('0x5'));var rimraf=require(_0xe209('0x6'));var config=require(_0xe209('0x7'));var attributes=require('./integration.attributes');module['exports']=function(_0x421665,_0x2f3346){return _0x421665[_0xe209('0x8')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe7a8=['../../config/environment','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x4dadd0,_0xd02549){var _0x3daaac=function(_0x58347d){while(--_0x58347d){_0x4dadd0['push'](_0x4dadd0['shift']());}};_0x3daaac(++_0xd02549);}(_0xe7a8,0x1bd));var _0x8e7a=function(_0x24516c,_0x59fcd8){_0x24516c=_0x24516c-0x0;var _0xaf2987=_0xe7a8[_0x24516c];return _0xaf2987;};'use strict';var _=require(_0x8e7a('0x0'));var util=require(_0x8e7a('0x1'));var logger=require(_0x8e7a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8e7a('0x3'));var rp=require(_0x8e7a('0x4'));var fs=require('fs');var path=require(_0x8e7a('0x5'));var rimraf=require('rimraf');var config=require(_0x8e7a('0x6'));var attributes=require(_0x8e7a('0x7'));module[_0x8e7a('0x8')]=function(_0x2cffb9,_0x512bfa){return _0x2cffb9[_0x8e7a('0x9')](_0x8e7a('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0fc9c66..689f923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x56db1c,_0xd0c13c){var _0x23aa12=function(_0x53086e){while(--_0x53086e){_0x56db1c['push'](_0x56db1c['shift']());}};_0x23aa12(++_0xd0c13c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x822dbc,_0x4577a8){_0x822dbc=_0x822dbc-0x0;var _0x36316a=_0xc6ac[_0x822dbc];return _0x36316a;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});}
\ No newline at end of file
+var _0xc2c7=['../../config/logger','jayson/promise','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xc2c7,0x134));var _0x7c2c=function(_0x158e2b,_0x4e9ff1){_0x158e2b=_0x158e2b-0x0;var _0x59ed66=_0xc2c7[_0x158e2b];return _0x59ed66;};'use strict';var _=require('lodash');var util=require(_0x7c2c('0x0'));var moment=require(_0x7c2c('0x1'));var BPromise=require(_0x7c2c('0x2'));var rs=require(_0x7c2c('0x3'));var fs=require('fs');var Redis=require(_0x7c2c('0x4'));var db=require(_0x7c2c('0x5'))['db'];var utils=require(_0x7c2c('0x6'));var logger=require(_0x7c2c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c2c('0x8'));var client=jayson[_0x7c2c('0x9')][_0x7c2c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f027,_0x4abe93,_0x5a1027){return new BPromise(function(_0x2274cd,_0x29638d){return client[_0x7c2c('0xb')](_0x54f027,_0x5a1027)[_0x7c2c('0xc')](function(_0x279cff){logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));logger[_0x7c2c('0xf')](_0x7c2c('0x10'),_0x4abe93,_0x7c2c('0xe'),JSON[_0x7c2c('0x11')](_0x279cff));if(_0x279cff[_0x7c2c('0x12')]){if(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x13')]===0x1f4){logger[_0x7c2c('0x12')](_0x7c2c('0xd'),_0x4abe93,_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);return _0x29638d(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}logger[_0x7c2c('0x12')]('Integration,\x20%s,\x20%s',_0x4abe93,_0x279cff['error'][_0x7c2c('0x14')]);return _0x2274cd(_0x279cff[_0x7c2c('0x12')][_0x7c2c('0x14')]);}else{logger['info'](_0x7c2c('0xd'),_0x4abe93,_0x7c2c('0xe'));_0x2274cd(_0x279cff['result'][_0x7c2c('0x14')]);}})['catch'](function(_0x1aa355){logger['error'](_0x7c2c('0xd'),_0x4abe93,_0x1aa355);_0x29638d(_0x1aa355);});});}
\ No newline at end of file
index 41b3736..e3af3ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x896e=['show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x896e,0x1e9));var _0xe896=function(_0x59845d,_0x35a17c){_0x59845d=_0x59845d-0x0;var _0x1f71ba=_0x896e[_0x59845d];return _0x1f71ba;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['post']('/',auth[_0xe896('0xe')](),controller['create']);router[_0xe896('0x12')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x13')]);router[_0xe896('0x14')]('/:id',auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);module[_0xe896('0x16')]=router;
\ No newline at end of file
+var _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x164572,_0x20844c){var _0x510932=function(_0x442ce0){while(--_0x442ce0){_0x164572['push'](_0x164572['shift']());}};_0x510932(++_0x20844c);}(_0x955f,0x1eb));var _0xf955=function(_0x483c35,_0x566f28){_0x483c35=_0x483c35-0x0;var _0x14eb15=_0x955f[_0x483c35];return _0x14eb15;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router;
\ No newline at end of file
index 2cbad6d..6f981ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e01=['TEXT','ENUM','SENT','RECEIVED','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x179b68,_0x339d82){var _0x5e6d69=function(_0x69ff9){while(--_0x69ff9){_0x179b68['push'](_0x179b68['shift']());}};_0x5e6d69(++_0x339d82);}(_0x0e01,0x1bd));var _0x10e0=function(_0x31756f,_0x4356c6){_0x31756f=_0x31756f-0x0;var _0x5b1331=_0x0e01[_0x31756f];return _0x5b1331;};'use strict';var Sequelize=require('sequelize');module[_0x10e0('0x0')]={'integration':{'type':Sequelize[_0x10e0('0x1')]},'eventChannel':{'type':Sequelize[_0x10e0('0x1')]},'exitStatus':{'type':Sequelize[_0x10e0('0x1')]},'ticketId':{'type':Sequelize[_0x10e0('0x1')]},'integrationId':{'type':Sequelize[_0x10e0('0x2')]},'contacts':{'type':Sequelize[_0x10e0('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x10e0('0x1')]},'calleridname':{'type':Sequelize[_0x10e0('0x1')]},'queue':{'type':Sequelize[_0x10e0('0x1')]},'interface':{'type':Sequelize[_0x10e0('0x1')]},'membername':{'type':Sequelize[_0x10e0('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x10e0('0x3')]},'holdtime':{'type':Sequelize[_0x10e0('0x2')]},'agentcomplete':{'type':Sequelize[_0x10e0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x10e0('0x3')]},'talktime':{'type':Sequelize[_0x10e0('0x2')]},'agentacw':{'type':Sequelize[_0x10e0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x10e0('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0x10e0('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x10e0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x10e0('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x10e0('0x2')]},'channelstatedesc':{'type':Sequelize[_0x10e0('0x1')]},'connectedlinenum':{'type':Sequelize[_0x10e0('0x1')]},'connectedlinename':{'type':Sequelize[_0x10e0('0x1')]},'language':{'type':Sequelize[_0x10e0('0x1')]},'accountcode':{'type':Sequelize[_0x10e0('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x10e0('0x1')]},'priority':{'type':Sequelize[_0x10e0('0x1')]},'destchannel':{'type':Sequelize[_0x10e0('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x10e0('0x1')]},'destcalleridnum':{'type':Sequelize[_0x10e0('0x1')]},'destcalleridname':{'type':Sequelize[_0x10e0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x10e0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x10e0('0x1')]},'destlanguage':{'type':Sequelize[_0x10e0('0x1')]},'destaccountcode':{'type':Sequelize[_0x10e0('0x1')]},'destcontext':{'type':Sequelize[_0x10e0('0x1')]},'destexten':{'type':Sequelize[_0x10e0('0x1')]},'destpriority':{'type':Sequelize[_0x10e0('0x1')]},'destuniqueid':{'type':Sequelize[_0x10e0('0x1')]},'messageId':{'type':Sequelize[_0x10e0('0x1')]},'inReplyTo':{'type':Sequelize[_0x10e0('0x1')]},'subject':{'type':Sequelize[_0x10e0('0x1')]},'from':{'type':Sequelize[_0x10e0('0x1')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x10e0('0x1')]},'attachment':{'type':Sequelize[_0x10e0('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x10e0('0x5')]},'status':{'type':Sequelize[_0x10e0('0x6')](_0x10e0('0x7'),'SENDING',_0x10e0('0x8'),_0x10e0('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x10e0('0x1')]},'appdata':{'type':Sequelize[_0x10e0('0x1')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xadf8=['STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize','exports'];(function(_0x4555c2,_0x138d83){var _0x492d1d=function(_0x55a0c5){while(--_0x55a0c5){_0x4555c2['push'](_0x4555c2['shift']());}};_0x492d1d(++_0x138d83);}(_0xadf8,0x172));var _0x8adf=function(_0x272d8a,_0x45184b){_0x272d8a=_0x272d8a-0x0;var _0x26286e=_0xadf8[_0x272d8a];return _0x26286e;};'use strict';var Sequelize=require(_0x8adf('0x0'));module[_0x8adf('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8adf('0x2')]},'exitStatus':{'type':Sequelize[_0x8adf('0x2')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8adf('0x3')]},'contacts':{'type':Sequelize[_0x8adf('0x2')]},'uniqueid':{'type':Sequelize[_0x8adf('0x2')]},'calleridnum':{'type':Sequelize[_0x8adf('0x2')]},'calleridname':{'type':Sequelize[_0x8adf('0x2')]},'queue':{'type':Sequelize[_0x8adf('0x2')]},'interface':{'type':Sequelize[_0x8adf('0x2')]},'membername':{'type':Sequelize[_0x8adf('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x8adf('0x3')]},'agentcomplete':{'type':Sequelize[_0x8adf('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8adf('0x5')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8adf('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8adf('0x3')]},'reason':{'type':Sequelize[_0x8adf('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x8adf('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x8adf('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8adf('0x5')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8adf('0x2')]},'channelstate':{'type':Sequelize[_0x8adf('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8adf('0x2')]},'connectedlinename':{'type':Sequelize[_0x8adf('0x2')]},'language':{'type':Sequelize[_0x8adf('0x2')]},'accountcode':{'type':Sequelize[_0x8adf('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x8adf('0x2')]},'priority':{'type':Sequelize[_0x8adf('0x2')]},'destchannel':{'type':Sequelize[_0x8adf('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x8adf('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x8adf('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x8adf('0x2')]},'destlanguage':{'type':Sequelize[_0x8adf('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x8adf('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x8adf('0x2')]},'destuniqueid':{'type':Sequelize[_0x8adf('0x2')]},'messageId':{'type':Sequelize[_0x8adf('0x2')]},'inReplyTo':{'type':Sequelize[_0x8adf('0x2')]},'subject':{'type':Sequelize[_0x8adf('0x2')]},'from':{'type':Sequelize[_0x8adf('0x2')]},'to':{'type':Sequelize[_0x8adf('0x2')]},'cc':{'type':Sequelize[_0x8adf('0x2')]},'attachment':{'type':Sequelize[_0x8adf('0x6')]},'html':{'type':Sequelize[_0x8adf('0x6')]},'text':{'type':Sequelize[_0x8adf('0x6')]},'status':{'type':Sequelize[_0x8adf('0x7')](_0x8adf('0x8'),_0x8adf('0x9'),_0x8adf('0xa'),_0x8adf('0xb'))},'url':{'type':Sequelize[_0x8adf('0x2')]},'app':{'type':Sequelize[_0x8adf('0x2')]},'appdata':{'type':Sequelize[_0x8adf('0x2')]},'projectId':{'type':Sequelize[_0x8adf('0x3')]}};
\ No newline at end of file
index c0d8e37..4dc1e70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc99d=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter'];(function(_0x222fe1,_0x376a82){var _0x16cb89=function(_0x1fab95){while(--_0x1fab95){_0x222fe1['push'](_0x222fe1['shift']());}};_0x16cb89(++_0x376a82);}(_0xc99d,0xaa));var _0xdc99=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xc99d[_0x187ee1];return _0x388160;};'use strict';var emlformat=require(_0xdc99('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdc99('0x1'));var jsonpatch=require(_0xdc99('0x2'));var rp=require('request-promise');var moment=require(_0xdc99('0x3'));var BPromise=require(_0xdc99('0x4'));var Mustache=require(_0xdc99('0x5'));var util=require(_0xdc99('0x6'));var path=require(_0xdc99('0x7'));var sox=require(_0xdc99('0x8'));var csv=require(_0xdc99('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdc99('0xa'));var _=require(_0xdc99('0xb'));var squel=require(_0xdc99('0xc'));var crypto=require(_0xdc99('0xd'));var jsforce=require(_0xdc99('0xe'));var deskjs=require(_0xdc99('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdc99('0x10'));var Papa=require(_0xdc99('0x11'));var Redis=require(_0xdc99('0x12'));var authService=require(_0xdc99('0x13'));var qs=require(_0xdc99('0x14'));var as=require(_0xdc99('0x15'));var hardwareService=require(_0xdc99('0x16'));var logger=require(_0xdc99('0x17'))('api');var utils=require(_0xdc99('0x18'));var config=require(_0xdc99('0x19'));var licenseUtil=require(_0xdc99('0x1a'));var db=require(_0xdc99('0x1b'))['db'];function respondWithStatusCode(_0x516c2c,_0x3c9431){_0x3c9431=_0x3c9431||0xcc;return function(_0x12893b){if(_0x12893b){return _0x516c2c[_0xdc99('0x1c')](_0x3c9431);}return _0x516c2c[_0xdc99('0x1d')](_0x3c9431)[_0xdc99('0x1e')]();};}function respondWithResult(_0x2c34bd,_0x171ee7){_0x171ee7=_0x171ee7||0xc8;return function(_0x5bbc48){if(_0x5bbc48){return _0x2c34bd[_0xdc99('0x1d')](_0x171ee7)[_0xdc99('0x1f')](_0x5bbc48);}};}function respondWithFilteredResult(_0x485af6,_0x2e26eb){return function(_0x180844){if(_0x180844){var _0x24e0a0=typeof _0x2e26eb['offset']===_0xdc99('0x20')&&typeof _0x2e26eb[_0xdc99('0x21')]==='undefined';var _0x3d02b7=_0x180844[_0xdc99('0x22')];var _0xc0a5d6=_0x24e0a0?0x0:_0x2e26eb[_0xdc99('0x23')];var _0x1fccd0=_0x24e0a0?_0x180844['count']:_0x2e26eb[_0xdc99('0x23')]+_0x2e26eb[_0xdc99('0x21')];var _0xa1d817;if(_0x1fccd0>=_0x3d02b7){_0x1fccd0=_0x3d02b7;_0xa1d817=0xc8;}else{_0xa1d817=0xce;}_0x485af6['status'](_0xa1d817);return _0x485af6[_0xdc99('0x24')](_0xdc99('0x25'),_0xc0a5d6+'-'+_0x1fccd0+'/'+_0x3d02b7)['json'](_0x180844);}return null;};}function patchUpdates(_0xcce6c5){return function(_0x2acb1d){try{jsonpatch['apply'](_0x2acb1d,_0xcce6c5,!![]);}catch(_0x2b991e){return BPromise['reject'](_0x2b991e);}return _0x2acb1d['save']();};}function saveUpdates(_0x60d918,_0x3e7440){return function(_0x454a83){if(_0x454a83){return _0x454a83[_0xdc99('0x26')](_0x60d918)[_0xdc99('0x27')](function(_0x3f4db1){return _0x3f4db1;});}return null;};}function removeEntity(_0xc3b8c0,_0x54abba){return function(_0x36783d){if(_0x36783d){return _0x36783d[_0xdc99('0x28')]()['then'](function(){_0xc3b8c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x61df0f,_0x4422a3){return function(_0x445a69){if(!_0x445a69){_0x61df0f[_0xdc99('0x1c')](0x194);}return _0x445a69;};}function handleError(_0x3378ba,_0x4f1202){_0x4f1202=_0x4f1202||0x1f4;return function(_0x23048a){logger['error'](_0x23048a[_0xdc99('0x29')]);if(_0x23048a[_0xdc99('0x2a')]){delete _0x23048a[_0xdc99('0x2a')];}_0x3378ba[_0xdc99('0x1d')](_0x4f1202)['send'](_0x23048a);};}exports[_0xdc99('0x2b')]=function(_0x4a186e,_0x3d557d){var _0x5e4518={},_0x811643={},_0x4d1f3a={'count':0x0,'rows':[]};var _0x252625=_[_0xdc99('0x2c')](db[_0xdc99('0x2d')][_0xdc99('0x2e')],function(_0x57e1df){return{'name':_0x57e1df[_0xdc99('0x2f')],'type':_0x57e1df[_0xdc99('0x30')][_0xdc99('0x31')]};});_0x811643['model']=_[_0xdc99('0x2c')](_0x252625,_0xdc99('0x2a'));_0x811643['query']=_[_0xdc99('0x32')](_0x4a186e[_0xdc99('0x33')]);_0x811643[_0xdc99('0x34')]=_[_0xdc99('0x35')](_0x811643[_0xdc99('0x36')],_0x811643['query']);_0x5e4518[_0xdc99('0x37')]=_[_0xdc99('0x35')](_0x811643[_0xdc99('0x36')],qs[_0xdc99('0x38')](_0x4a186e[_0xdc99('0x33')][_0xdc99('0x38')]));_0x5e4518[_0xdc99('0x37')]=_0x5e4518[_0xdc99('0x37')][_0xdc99('0x39')]?_0x5e4518[_0xdc99('0x37')]:_0x811643[_0xdc99('0x36')];if(!_0x4a186e['query'][_0xdc99('0x3a')](_0xdc99('0x3b'))){_0x5e4518[_0xdc99('0x21')]=qs[_0xdc99('0x21')](_0x4a186e[_0xdc99('0x33')][_0xdc99('0x21')]);_0x5e4518[_0xdc99('0x23')]=qs[_0xdc99('0x23')](_0x4a186e['query'][_0xdc99('0x23')]);}_0x5e4518[_0xdc99('0x3c')]=qs[_0xdc99('0x3d')](_0x4a186e[_0xdc99('0x33')]['sort']);_0x5e4518[_0xdc99('0x3e')]=qs[_0xdc99('0x34')](_['pick'](_0x4a186e[_0xdc99('0x33')],_0x811643[_0xdc99('0x34')]),_0x252625);if(_0x4a186e[_0xdc99('0x33')][_0xdc99('0x3f')]){_0x5e4518[_0xdc99('0x3e')]=_[_0xdc99('0x40')](_0x5e4518[_0xdc99('0x3e')],{'$or':_[_0xdc99('0x2c')](_0x252625,function(_0x2977c8){if(_0x2977c8[_0xdc99('0x30')]!==_0xdc99('0x41')){var _0x2919db={};_0x2919db[_0x2977c8[_0xdc99('0x2a')]]={'$like':'%'+_0x4a186e[_0xdc99('0x33')][_0xdc99('0x3f')]+'%'};return _0x2919db;}})});}_0x5e4518=_[_0xdc99('0x40')]({},_0x5e4518,_0x4a186e[_0xdc99('0x42')]);var _0x51dfea={'where':_0x5e4518[_0xdc99('0x3e')]};return db[_0xdc99('0x2d')][_0xdc99('0x22')](_0x51dfea)[_0xdc99('0x27')](function(_0x1ff8e8){_0x4d1f3a[_0xdc99('0x22')]=_0x1ff8e8;if(_0x4a186e[_0xdc99('0x33')][_0xdc99('0x43')]){_0x5e4518[_0xdc99('0x44')]=[{'all':!![]}];}return db[_0xdc99('0x2d')][_0xdc99('0x45')](_0x5e4518);})[_0xdc99('0x27')](function(_0x2b7cec){_0x4d1f3a[_0xdc99('0x46')]=_0x2b7cec;return _0x4d1f3a;})['then'](respondWithFilteredResult(_0x3d557d,_0x5e4518))[_0xdc99('0x47')](handleError(_0x3d557d,null));};exports[_0xdc99('0x48')]=function(_0x19daf3,_0x199974){var _0x1d9c28={'raw':![],'where':{'id':_0x19daf3[_0xdc99('0x49')]['id']}},_0x71033e={};_0x71033e[_0xdc99('0x36')]=_[_0xdc99('0x32')](db[_0xdc99('0x2d')][_0xdc99('0x2e')]);_0x71033e[_0xdc99('0x33')]=_[_0xdc99('0x32')](_0x19daf3[_0xdc99('0x33')]);_0x71033e[_0xdc99('0x34')]=_[_0xdc99('0x35')](_0x71033e[_0xdc99('0x36')],_0x71033e[_0xdc99('0x33')]);_0x1d9c28['attributes']=_[_0xdc99('0x35')](_0x71033e[_0xdc99('0x36')],qs[_0xdc99('0x38')](_0x19daf3['query'][_0xdc99('0x38')]));_0x1d9c28[_0xdc99('0x37')]=_0x1d9c28[_0xdc99('0x37')][_0xdc99('0x39')]?_0x1d9c28['attributes']:_0x71033e[_0xdc99('0x36')];if(_0x19daf3[_0xdc99('0x33')]['includeAll']){_0x1d9c28['include']=[{'all':!![]}];}_0x1d9c28=_['merge']({},_0x1d9c28,_0x19daf3[_0xdc99('0x42')]);return db[_0xdc99('0x2d')][_0xdc99('0x4a')](_0x1d9c28)[_0xdc99('0x27')](handleEntityNotFound(_0x199974,null))['then'](respondWithResult(_0x199974,null))[_0xdc99('0x47')](handleError(_0x199974,null));};exports[_0xdc99('0x4b')]=function(_0x1c36fd,_0x20788a){return db[_0xdc99('0x2d')][_0xdc99('0x4b')](_0x1c36fd[_0xdc99('0x4c')],{})[_0xdc99('0x27')](respondWithResult(_0x20788a,0xc9))[_0xdc99('0x47')](handleError(_0x20788a,null));};exports[_0xdc99('0x26')]=function(_0xb05ce9,_0x514422){if(_0xb05ce9['body']['id']){delete _0xb05ce9[_0xdc99('0x4c')]['id'];}return db[_0xdc99('0x2d')]['find']({'where':{'id':_0xb05ce9[_0xdc99('0x49')]['id']}})[_0xdc99('0x27')](handleEntityNotFound(_0x514422,null))[_0xdc99('0x27')](saveUpdates(_0xb05ce9[_0xdc99('0x4c')],null))[_0xdc99('0x27')](respondWithResult(_0x514422,null))[_0xdc99('0x47')](handleError(_0x514422,null));};exports[_0xdc99('0x28')]=function(_0x10c673,_0x1845fd){return db[_0xdc99('0x2d')][_0xdc99('0x4a')]({'where':{'id':_0x10c673[_0xdc99('0x49')]['id']}})[_0xdc99('0x27')](handleEntityNotFound(_0x1845fd,null))[_0xdc99('0x27')](removeEntity(_0x1845fd,null))[_0xdc99('0x47')](handleError(_0x1845fd,null));};exports[_0xdc99('0x4d')]=function(_0x2295d8,_0x1bc962){return db[_0xdc99('0x2d')]['describe']()['then'](respondWithResult(_0x1bc962,null))[_0xdc99('0x47')](handleError(_0x1bc962,null));};
\ No newline at end of file
+var _0xa673=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','IntegrationReport','rawAttributes','fieldName','model','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','params','intersection','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x231244,_0x2e9b6a){var _0x48484c=function(_0x174790){while(--_0x174790){_0x231244['push'](_0x231244['shift']());}};_0x48484c(++_0x2e9b6a);}(_0xa673,0x1b7));var _0x3a67=function(_0x280a93,_0x31cc75){_0x280a93=_0x280a93-0x0;var _0x26f7ad=_0xa673[_0x280a93];return _0x26f7ad;};'use strict';var emlformat=require(_0x3a67('0x0'));var rimraf=require(_0x3a67('0x1'));var zipdir=require(_0x3a67('0x2'));var jsonpatch=require(_0x3a67('0x3'));var rp=require('request-promise');var moment=require(_0x3a67('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3a67('0x5'));var util=require('util');var path=require(_0x3a67('0x6'));var sox=require(_0x3a67('0x7'));var csv=require(_0x3a67('0x8'));var ejs=require(_0x3a67('0x9'));var fs=require('fs');var fs_extra=require(_0x3a67('0xa'));var _=require(_0x3a67('0xb'));var squel=require(_0x3a67('0xc'));var crypto=require(_0x3a67('0xd'));var jsforce=require(_0x3a67('0xe'));var deskjs=require(_0x3a67('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3a67('0x10'));var Papa=require(_0x3a67('0x11'));var Redis=require(_0x3a67('0x12'));var authService=require(_0x3a67('0x13'));var qs=require(_0x3a67('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a67('0x15'));var logger=require(_0x3a67('0x16'))(_0x3a67('0x17'));var utils=require(_0x3a67('0x18'));var config=require(_0x3a67('0x19'));var licenseUtil=require(_0x3a67('0x1a'));var db=require(_0x3a67('0x1b'))['db'];function respondWithStatusCode(_0x318b44,_0x1b6046){_0x1b6046=_0x1b6046||0xcc;return function(_0x25052d){if(_0x25052d){return _0x318b44[_0x3a67('0x1c')](_0x1b6046);}return _0x318b44[_0x3a67('0x1d')](_0x1b6046)[_0x3a67('0x1e')]();};}function respondWithResult(_0x55d002,_0x5c0cae){_0x5c0cae=_0x5c0cae||0xc8;return function(_0x42200f){if(_0x42200f){return _0x55d002[_0x3a67('0x1d')](_0x5c0cae)[_0x3a67('0x1f')](_0x42200f);}};}function respondWithFilteredResult(_0x3a52d3,_0x19945d){return function(_0x166036){if(_0x166036){var _0x1c18f8=typeof _0x19945d[_0x3a67('0x20')]===_0x3a67('0x21')&&typeof _0x19945d[_0x3a67('0x22')]===_0x3a67('0x21');var _0x121321=_0x166036[_0x3a67('0x23')];var _0x24c41a=_0x1c18f8?0x0:_0x19945d[_0x3a67('0x20')];var _0x1b3807=_0x1c18f8?_0x166036[_0x3a67('0x23')]:_0x19945d['offset']+_0x19945d[_0x3a67('0x22')];var _0x2e9232;if(_0x1b3807>=_0x121321){_0x1b3807=_0x121321;_0x2e9232=0xc8;}else{_0x2e9232=0xce;}_0x3a52d3['status'](_0x2e9232);return _0x3a52d3[_0x3a67('0x24')](_0x3a67('0x25'),_0x24c41a+'-'+_0x1b3807+'/'+_0x121321)['json'](_0x166036);}return null;};}function patchUpdates(_0x51b306){return function(_0x29ab4f){try{jsonpatch[_0x3a67('0x26')](_0x29ab4f,_0x51b306,!![]);}catch(_0x4a5190){return BPromise['reject'](_0x4a5190);}return _0x29ab4f['save']();};}function saveUpdates(_0x4c1a6d,_0x59753a){return function(_0x106555){if(_0x106555){return _0x106555[_0x3a67('0x27')](_0x4c1a6d)[_0x3a67('0x28')](function(_0x5abe6b){return _0x5abe6b;});}return null;};}function removeEntity(_0xd6ebb2,_0x3aa167){return function(_0x301b58){if(_0x301b58){return _0x301b58[_0x3a67('0x29')]()[_0x3a67('0x28')](function(){_0xd6ebb2[_0x3a67('0x1d')](0xcc)[_0x3a67('0x1e')]();});}};}function handleEntityNotFound(_0x2a90fb,_0xc6f5be){return function(_0x1ed465){if(!_0x1ed465){_0x2a90fb[_0x3a67('0x1c')](0x194);}return _0x1ed465;};}function handleError(_0x35f61c,_0x45076e){_0x45076e=_0x45076e||0x1f4;return function(_0xb5e168){logger[_0x3a67('0x2a')](_0xb5e168[_0x3a67('0x2b')]);if(_0xb5e168[_0x3a67('0x2c')]){delete _0xb5e168[_0x3a67('0x2c')];}_0x35f61c[_0x3a67('0x1d')](_0x45076e)[_0x3a67('0x2d')](_0xb5e168);};}exports[_0x3a67('0x2e')]=function(_0x4b2c68,_0x55c0c2){var _0x737c1d={},_0x150fba={},_0x2e4112={'count':0x0,'rows':[]};var _0x3b2e94=_[_0x3a67('0x2f')](db[_0x3a67('0x30')][_0x3a67('0x31')],function(_0x310dad){return{'name':_0x310dad[_0x3a67('0x32')],'type':_0x310dad['type']['key']};});_0x150fba[_0x3a67('0x33')]=_[_0x3a67('0x2f')](_0x3b2e94,_0x3a67('0x2c'));_0x150fba[_0x3a67('0x34')]=_[_0x3a67('0x35')](_0x4b2c68[_0x3a67('0x34')]);_0x150fba[_0x3a67('0x36')]=_['intersection'](_0x150fba[_0x3a67('0x33')],_0x150fba[_0x3a67('0x34')]);_0x737c1d['attributes']=_['intersection'](_0x150fba[_0x3a67('0x33')],qs[_0x3a67('0x37')](_0x4b2c68['query'][_0x3a67('0x37')]));_0x737c1d[_0x3a67('0x38')]=_0x737c1d['attributes'][_0x3a67('0x39')]?_0x737c1d[_0x3a67('0x38')]:_0x150fba['model'];if(!_0x4b2c68[_0x3a67('0x34')]['hasOwnProperty'](_0x3a67('0x3a'))){_0x737c1d['limit']=qs[_0x3a67('0x22')](_0x4b2c68[_0x3a67('0x34')][_0x3a67('0x22')]);_0x737c1d['offset']=qs[_0x3a67('0x20')](_0x4b2c68[_0x3a67('0x34')][_0x3a67('0x20')]);}_0x737c1d[_0x3a67('0x3b')]=qs[_0x3a67('0x3c')](_0x4b2c68['query']['sort']);_0x737c1d[_0x3a67('0x3d')]=qs['filters'](_[_0x3a67('0x3e')](_0x4b2c68[_0x3a67('0x34')],_0x150fba['filters']),_0x3b2e94);if(_0x4b2c68['query'][_0x3a67('0x3f')]){_0x737c1d[_0x3a67('0x3d')]=_[_0x3a67('0x40')](_0x737c1d[_0x3a67('0x3d')],{'$or':_[_0x3a67('0x2f')](_0x3b2e94,function(_0x14b960){if(_0x14b960['type']!=='VIRTUAL'){var _0x50cf73={};_0x50cf73[_0x14b960['name']]={'$like':'%'+_0x4b2c68[_0x3a67('0x34')][_0x3a67('0x3f')]+'%'};return _0x50cf73;}})});}_0x737c1d=_[_0x3a67('0x40')]({},_0x737c1d,_0x4b2c68[_0x3a67('0x41')]);var _0x46a369={'where':_0x737c1d['where']};return db[_0x3a67('0x30')][_0x3a67('0x23')](_0x46a369)['then'](function(_0x543aea){_0x2e4112[_0x3a67('0x23')]=_0x543aea;if(_0x4b2c68[_0x3a67('0x34')][_0x3a67('0x42')]){_0x737c1d[_0x3a67('0x43')]=[{'all':!![]}];}return db[_0x3a67('0x30')]['findAll'](_0x737c1d);})['then'](function(_0x4258e8){_0x2e4112[_0x3a67('0x44')]=_0x4258e8;return _0x2e4112;})[_0x3a67('0x28')](respondWithFilteredResult(_0x55c0c2,_0x737c1d))[_0x3a67('0x45')](handleError(_0x55c0c2,null));};exports['show']=function(_0x464f20,_0x4c051c){var _0x5174a5={'raw':![],'where':{'id':_0x464f20[_0x3a67('0x46')]['id']}},_0x4f9b82={};_0x4f9b82[_0x3a67('0x33')]=_[_0x3a67('0x35')](db[_0x3a67('0x30')][_0x3a67('0x31')]);_0x4f9b82[_0x3a67('0x34')]=_[_0x3a67('0x35')](_0x464f20[_0x3a67('0x34')]);_0x4f9b82[_0x3a67('0x36')]=_['intersection'](_0x4f9b82[_0x3a67('0x33')],_0x4f9b82[_0x3a67('0x34')]);_0x5174a5['attributes']=_[_0x3a67('0x47')](_0x4f9b82[_0x3a67('0x33')],qs[_0x3a67('0x37')](_0x464f20[_0x3a67('0x34')][_0x3a67('0x37')]));_0x5174a5[_0x3a67('0x38')]=_0x5174a5[_0x3a67('0x38')][_0x3a67('0x39')]?_0x5174a5[_0x3a67('0x38')]:_0x4f9b82['model'];if(_0x464f20[_0x3a67('0x34')][_0x3a67('0x42')]){_0x5174a5[_0x3a67('0x43')]=[{'all':!![]}];}_0x5174a5=_[_0x3a67('0x40')]({},_0x5174a5,_0x464f20['options']);return db[_0x3a67('0x30')]['find'](_0x5174a5)['then'](handleEntityNotFound(_0x4c051c,null))[_0x3a67('0x28')](respondWithResult(_0x4c051c,null))[_0x3a67('0x45')](handleError(_0x4c051c,null));};exports[_0x3a67('0x48')]=function(_0x13677d,_0x539055){return db[_0x3a67('0x30')][_0x3a67('0x48')](_0x13677d[_0x3a67('0x49')],{})[_0x3a67('0x28')](respondWithResult(_0x539055,0xc9))['catch'](handleError(_0x539055,null));};exports['update']=function(_0x301f1c,_0x1f5f2c){if(_0x301f1c[_0x3a67('0x49')]['id']){delete _0x301f1c[_0x3a67('0x49')]['id'];}return db[_0x3a67('0x30')][_0x3a67('0x4a')]({'where':{'id':_0x301f1c[_0x3a67('0x46')]['id']}})[_0x3a67('0x28')](handleEntityNotFound(_0x1f5f2c,null))[_0x3a67('0x28')](saveUpdates(_0x301f1c[_0x3a67('0x49')],null))['then'](respondWithResult(_0x1f5f2c,null))[_0x3a67('0x45')](handleError(_0x1f5f2c,null));};exports[_0x3a67('0x29')]=function(_0x19ad53,_0x104d2c){return db[_0x3a67('0x30')]['find']({'where':{'id':_0x19ad53[_0x3a67('0x46')]['id']}})[_0x3a67('0x28')](handleEntityNotFound(_0x104d2c,null))[_0x3a67('0x28')](removeEntity(_0x104d2c,null))[_0x3a67('0x45')](handleError(_0x104d2c,null));};exports[_0x3a67('0x4b')]=function(_0x287a36,_0x526ca9){return db['IntegrationReport'][_0x3a67('0x4b')]()[_0x3a67('0x28')](respondWithResult(_0x526ca9,null))[_0x3a67('0x45')](handleError(_0x526ca9,null));};
\ No newline at end of file
index 205806c..c180a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64f5=['rimraf','./integrationReport.attributes','exports','define','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x64f5,0x125));var _0x564f=function(_0x4643ba,_0x228f04){_0x4643ba=_0x4643ba-0x0;var _0x53c0d0=_0x64f5[_0x4643ba];return _0x53c0d0;};'use strict';var _=require(_0x564f('0x0'));var util=require(_0x564f('0x1'));var logger=require(_0x564f('0x2'))(_0x564f('0x3'));var moment=require(_0x564f('0x4'));var BPromise=require(_0x564f('0x5'));var rp=require(_0x564f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x564f('0x7'));var config=require('../../config/environment');var attributes=require(_0x564f('0x8'));module[_0x564f('0x9')]=function(_0x2c3711,_0x57d20d){return _0x2c3711[_0x564f('0xa')]('IntegrationReport',attributes,{'tableName':_0x564f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa652=['api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','IntegrationReport','report_integration','lodash','util','../../config/logger'];(function(_0x55b6a2,_0x5938a0){var _0x36b47d=function(_0x345150){while(--_0x345150){_0x55b6a2['push'](_0x55b6a2['shift']());}};_0x36b47d(++_0x5938a0);}(_0xa652,0xed));var _0x2a65=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xa652[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x2a65('0x0'));var util=require(_0x2a65('0x1'));var logger=require(_0x2a65('0x2'))(_0x2a65('0x3'));var moment=require(_0x2a65('0x4'));var BPromise=require(_0x2a65('0x5'));var rp=require(_0x2a65('0x6'));var fs=require('fs');var path=require(_0x2a65('0x7'));var rimraf=require(_0x2a65('0x8'));var config=require('../../config/environment');var attributes=require(_0x2a65('0x9'));module['exports']=function(_0x5f1277,_0x949c25){return _0x5f1277['define'](_0x2a65('0xa'),attributes,{'tableName':_0x2a65('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d947c68..f31a4b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4137=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','IntegrationReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x4137,0xf8));var _0x7413=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x4137[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7413('0x0'));var util=require(_0x7413('0x1'));var moment=require(_0x7413('0x2'));var BPromise=require(_0x7413('0x3'));var rs=require(_0x7413('0x4'));var fs=require('fs');var Redis=require(_0x7413('0x5'));var db=require(_0x7413('0x6'))['db'];var utils=require(_0x7413('0x7'));var logger=require(_0x7413('0x8'))(_0x7413('0x9'));var config=require(_0x7413('0xa'));var jayson=require(_0x7413('0xb'));var client=jayson['client'][_0x7413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x188d89,_0x5b39ac,_0x15af0d){return new BPromise(function(_0x5f4cd0,_0x3236ec){return client[_0x7413('0xd')](_0x188d89,_0x15af0d)['then'](function(_0x422bf5){logger[_0x7413('0xe')]('IntegrationReport,\x20%s,\x20%s',_0x5b39ac,_0x7413('0xf'));logger[_0x7413('0x10')](_0x7413('0x11'),_0x5b39ac,_0x7413('0xf'),JSON[_0x7413('0x12')](_0x422bf5));if(_0x422bf5['error']){if(_0x422bf5[_0x7413('0x13')][_0x7413('0x14')]===0x1f4){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);return _0x3236ec(_0x422bf5['error']['message']);}logger['error'](_0x7413('0x15'),_0x5b39ac,_0x422bf5[_0x7413('0x13')]['message']);return _0x5f4cd0(_0x422bf5[_0x7413('0x13')][_0x7413('0x16')]);}else{logger['info'](_0x7413('0x15'),_0x5b39ac,'request\x20sent');_0x5f4cd0(_0x422bf5['result'][_0x7413('0x16')]);}})['catch'](function(_0x195c72){logger['error'](_0x7413('0x15'),_0x5b39ac,_0x195c72);_0x3236ec(_0x195c72);});});}
\ No newline at end of file
+var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x53ec,0x192));var _0xc53e=function(_0x1839fa,_0x2d18ba){_0x1839fa=_0x1839fa-0x0;var _0x599af0=_0x53ec[_0x1839fa];return _0x599af0;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});}
\ No newline at end of file
index 9c71b3f..d450884 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x872f=['show','/:id/sub_intervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','put','delete','/:id','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated'];(function(_0x56aab0,_0x4afd25){var _0xa15bf4=function(_0x499049){while(--_0x499049){_0x56aab0['push'](_0x56aab0['shift']());}};_0xa15bf4(++_0x4afd25);}(_0x872f,0x143));var _0xf872=function(_0x29b35c,_0x2001c5){_0x29b35c=_0x29b35c-0x0;var _0x5ab131=_0x872f[_0x29b35c];return _0x5ab131;};'use strict';var multer=require(_0xf872('0x0'));var util=require(_0xf872('0x1'));var path=require(_0xf872('0x2'));var timeout=require(_0xf872('0x3'));var express=require(_0xf872('0x4'));var router=express[_0xf872('0x5')]();var fs_extra=require(_0xf872('0x6'));var auth=require(_0xf872('0x7'));var interaction=require(_0xf872('0x8'));var config=require(_0xf872('0x9'));var controller=require('./interval.controller');router[_0xf872('0xa')]('/',auth['isAuthenticated'](),controller[_0xf872('0xb')]);router['get']('/:id',auth[_0xf872('0xc')](),controller[_0xf872('0xd')]);router[_0xf872('0xa')](_0xf872('0xe'),auth[_0xf872('0xc')](),controller['getIntervals']);router[_0xf872('0xf')]('/',auth[_0xf872('0xc')](),controller[_0xf872('0x10')]);router[_0xf872('0xf')](_0xf872('0xe'),auth[_0xf872('0xc')](),controller[_0xf872('0x11')]);router[_0xf872('0xf')](_0xf872('0x12'),auth[_0xf872('0xc')](),controller[_0xf872('0x13')]);router[_0xf872('0x14')]('/:id',auth[_0xf872('0xc')](),controller['update']);router[_0xf872('0x15')](_0xf872('0x16'),auth[_0xf872('0xc')](),controller[_0xf872('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x35e2=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','delete','destroy','exports','multer'];(function(_0x2d1814,_0x29ff2d){var _0x56c4a0=function(_0x3194ce){while(--_0x3194ce){_0x2d1814['push'](_0x2d1814['shift']());}};_0x56c4a0(++_0x29ff2d);}(_0x35e2,0x1ed));var _0x235e=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x35e2[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require(_0x235e('0x0'));var util=require('util');var path=require(_0x235e('0x1'));var timeout=require(_0x235e('0x2'));var express=require(_0x235e('0x3'));var router=express['Router']();var fs_extra=require(_0x235e('0x4'));var auth=require(_0x235e('0x5'));var interaction=require(_0x235e('0x6'));var config=require(_0x235e('0x7'));var controller=require(_0x235e('0x8'));router[_0x235e('0x9')]('/',auth[_0x235e('0xa')](),controller[_0x235e('0xb')]);router[_0x235e('0x9')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0xd')]);router[_0x235e('0x9')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x235e('0xe')]);router[_0x235e('0xf')]('/',auth['isAuthenticated'](),controller[_0x235e('0x10')]);router[_0x235e('0xf')](_0x235e('0x11'),auth[_0x235e('0xa')](),controller[_0x235e('0x12')]);router[_0x235e('0xf')](_0x235e('0x13'),auth[_0x235e('0xa')](),controller[_0x235e('0x14')]);router[_0x235e('0x15')](_0x235e('0xc'),auth[_0x235e('0xa')](),controller[_0x235e('0x16')]);router[_0x235e('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x235e('0x18')]);module[_0x235e('0x19')]=router;
\ No newline at end of file
index 0090ac8..e45e0c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71cd=['STRING'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x71cd,0x81));var _0xd71c=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0x71cd[_0x12c280];return _0x3638d3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd71c('0x0')]},'description':{'type':Sequelize[_0xd71c('0x0')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x6441=['exports','STRING','sequelize'];(function(_0x28db62,_0xfe11c1){var _0xbc95be=function(_0x4292d4){while(--_0x4292d4){_0x28db62['push'](_0x28db62['shift']());}};_0xbc95be(++_0xfe11c1);}(_0x6441,0x1e5));var _0x1644=function(_0x511121,_0x1c58b2){_0x511121=_0x511121-0x0;var _0xce2c01=_0x6441[_0x511121];return _0xce2c01;};'use strict';var Sequelize=require(_0x1644('0x0'));module[_0x1644('0x1')]={'name':{'type':Sequelize[_0x1644('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1644('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 8fe8457..2fbf8f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a38=['role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','sendStatus','error','name','map','Interval','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','length','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x40af93,_0x1e20ff){var _0x2ffe5c=function(_0xc29cb0){while(--_0xc29cb0){_0x40af93['push'](_0x40af93['shift']());}};_0x2ffe5c(++_0x1e20ff);}(_0x6a38,0x68));var _0x86a3=function(_0x3f8068,_0x3ab674){_0x3f8068=_0x3f8068-0x0;var _0x5eb6ab=_0x6a38[_0x3f8068];return _0x5eb6ab;};'use strict';var emlformat=require(_0x86a3('0x0'));var rimraf=require(_0x86a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86a3('0x2'));var rp=require(_0x86a3('0x3'));var moment=require(_0x86a3('0x4'));var BPromise=require(_0x86a3('0x5'));var Mustache=require(_0x86a3('0x6'));var util=require(_0x86a3('0x7'));var path=require(_0x86a3('0x8'));var sox=require(_0x86a3('0x9'));var csv=require('to-csv');var ejs=require(_0x86a3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x86a3('0xb'));var squel=require('squel');var crypto=require(_0x86a3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x86a3('0xd'));var toCsv=require(_0x86a3('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x86a3('0xf'));var as=require(_0x86a3('0x10'));var hardwareService=require(_0x86a3('0x11'));var logger=require('../../config/logger')(_0x86a3('0x12'));var utils=require(_0x86a3('0x13'));var config=require(_0x86a3('0x14'));var licenseUtil=require(_0x86a3('0x15'));var db=require(_0x86a3('0x16'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x2407d2,_0x312398){_0x312398=_0x312398||0xcc;return function(_0x2d036f){if(_0x2d036f){return _0x2407d2['sendStatus'](_0x312398);}return _0x2407d2[_0x86a3('0x17')](_0x312398)[_0x86a3('0x18')]();};}function respondWithResult(_0x2ebbb2,_0xad6e54){_0xad6e54=_0xad6e54||0xc8;return function(_0x3f5ed7){if(_0x3f5ed7){return _0x2ebbb2['status'](_0xad6e54)[_0x86a3('0x19')](_0x3f5ed7);}};}function respondWithFilteredResult(_0x4847f9,_0xde8408){return function(_0x3afb6b){if(_0x3afb6b){var _0x4a6225=typeof _0xde8408[_0x86a3('0x1a')]===_0x86a3('0x1b')&&typeof _0xde8408[_0x86a3('0x1c')]===_0x86a3('0x1b');var _0x3a26d5=_0x3afb6b[_0x86a3('0x1d')];var _0x2b394a=_0x4a6225?0x0:_0xde8408[_0x86a3('0x1a')];var _0x5895db=_0x4a6225?_0x3afb6b[_0x86a3('0x1d')]:_0xde8408['offset']+_0xde8408[_0x86a3('0x1c')];var _0x2ccecf;if(_0x5895db>=_0x3a26d5){_0x5895db=_0x3a26d5;_0x2ccecf=0xc8;}else{_0x2ccecf=0xce;}_0x4847f9[_0x86a3('0x17')](_0x2ccecf);return _0x4847f9[_0x86a3('0x1e')](_0x86a3('0x1f'),_0x2b394a+'-'+_0x5895db+'/'+_0x3a26d5)['json'](_0x3afb6b);}return null;};}function patchUpdates(_0x4d00c6){return function(_0x14f705){try{jsonpatch[_0x86a3('0x20')](_0x14f705,_0x4d00c6,!![]);}catch(_0x5235e3){return BPromise['reject'](_0x5235e3);}return _0x14f705[_0x86a3('0x21')]();};}function saveUpdates(_0x185e7b,_0x3d3df0){return function(_0xf3375){if(_0xf3375){return _0xf3375[_0x86a3('0x22')](_0x185e7b)[_0x86a3('0x23')](function(_0x2f9c00){return _0x2f9c00;});}return null;};}function removeEntity(_0x2c8f79,_0x247aed){return function(_0x210b08){if(_0x210b08){return _0x210b08[_0x86a3('0x24')]()[_0x86a3('0x23')](function(){var _0x374122=_0x210b08[_0x86a3('0x25')]({'plain':!![]});var _0x21efdb=_0x86a3('0x26');return db['UserProfileResource'][_0x86a3('0x24')]({'where':{'type':_0x21efdb,'resourceId':_0x374122['id']}})[_0x86a3('0x23')](function(){return _0x210b08;});})['then'](function(){_0x2c8f79[_0x86a3('0x17')](0xcc)[_0x86a3('0x18')]();});}};}function handleEntityNotFound(_0x446f2d,_0x3ed542){return function(_0x51efee){if(!_0x51efee){_0x446f2d[_0x86a3('0x27')](0x194);}return _0x51efee;};}function handleError(_0x5171d6,_0x5cf6e5){_0x5cf6e5=_0x5cf6e5||0x1f4;return function(_0x38d763){logger[_0x86a3('0x28')](_0x38d763['stack']);if(_0x38d763[_0x86a3('0x29')]){delete _0x38d763[_0x86a3('0x29')];}_0x5171d6['status'](_0x5cf6e5)['send'](_0x38d763);};}exports['index']=function(_0x1bb00d,_0x11a13c){var _0x5c8516={},_0x3c95da={},_0x490c00={'count':0x0,'rows':[]};var _0x19c544=_[_0x86a3('0x2a')](db[_0x86a3('0x2b')][_0x86a3('0x2c')],function(_0x13721a){return{'name':_0x13721a[_0x86a3('0x2d')],'type':_0x13721a[_0x86a3('0x2e')]['key']};});_0x3c95da[_0x86a3('0x2f')]=_['map'](_0x19c544,_0x86a3('0x29'));_0x3c95da[_0x86a3('0x30')]=_[_0x86a3('0x31')](_0x1bb00d[_0x86a3('0x30')]);_0x3c95da['filters']=_[_0x86a3('0x32')](_0x3c95da[_0x86a3('0x2f')],_0x3c95da[_0x86a3('0x30')]);_0x5c8516['attributes']=_[_0x86a3('0x32')](_0x3c95da[_0x86a3('0x2f')],qs[_0x86a3('0x33')](_0x1bb00d[_0x86a3('0x30')]['fields']));_0x5c8516[_0x86a3('0x34')]=_0x5c8516[_0x86a3('0x34')]['length']?_0x5c8516['attributes']:_0x3c95da['model'];if(!_0x1bb00d[_0x86a3('0x30')]['hasOwnProperty'](_0x86a3('0x35'))){_0x5c8516[_0x86a3('0x1c')]=qs[_0x86a3('0x1c')](_0x1bb00d[_0x86a3('0x30')][_0x86a3('0x1c')]);_0x5c8516['offset']=qs[_0x86a3('0x1a')](_0x1bb00d[_0x86a3('0x30')][_0x86a3('0x1a')]);}_0x5c8516[_0x86a3('0x36')]=qs['sort'](_0x1bb00d[_0x86a3('0x30')][_0x86a3('0x37')]);_0x5c8516[_0x86a3('0x38')]=qs[_0x86a3('0x39')](_[_0x86a3('0x3a')](_0x1bb00d[_0x86a3('0x30')],_0x3c95da['filters']),_0x19c544);if(_0x1bb00d[_0x86a3('0x30')]['filter']){_0x5c8516[_0x86a3('0x38')]=_['merge'](_0x5c8516[_0x86a3('0x38')],{'$or':_[_0x86a3('0x2a')](_0x19c544,function(_0x4a4cff){if(_0x4a4cff[_0x86a3('0x2e')]!==_0x86a3('0x3b')){var _0x5d118c={};_0x5d118c[_0x4a4cff[_0x86a3('0x29')]]={'$like':'%'+_0x1bb00d[_0x86a3('0x30')][_0x86a3('0x3c')]+'%'};return _0x5d118c;}})});}_0x5c8516=_['merge']({},_0x5c8516,_0x1bb00d[_0x86a3('0x3d')]);var _0x5df9aa={'where':_0x5c8516[_0x86a3('0x38')]};return db[_0x86a3('0x2b')][_0x86a3('0x1d')](_0x5df9aa)[_0x86a3('0x23')](function(_0x3c292f){_0x490c00[_0x86a3('0x1d')]=_0x3c292f;if(_0x1bb00d[_0x86a3('0x30')][_0x86a3('0x3e')]){_0x5c8516['include']=[{'all':!![]}];}return db['Interval'][_0x86a3('0x3f')](_0x5c8516);})[_0x86a3('0x23')](function(_0x47e0af){_0x490c00[_0x86a3('0x40')]=_0x47e0af;return _0x490c00;})['then'](respondWithFilteredResult(_0x11a13c,_0x5c8516))[_0x86a3('0x41')](handleError(_0x11a13c,null));};exports[_0x86a3('0x42')]=function(_0x46e15f,_0x459a4a){var _0x119693={'raw':!![],'where':{'id':_0x46e15f[_0x86a3('0x43')]['id']}},_0xff2fb1={};_0xff2fb1[_0x86a3('0x2f')]=_['keys'](db[_0x86a3('0x2b')][_0x86a3('0x2c')]);_0xff2fb1[_0x86a3('0x30')]=_[_0x86a3('0x31')](_0x46e15f[_0x86a3('0x30')]);_0xff2fb1[_0x86a3('0x39')]=_['intersection'](_0xff2fb1[_0x86a3('0x2f')],_0xff2fb1[_0x86a3('0x30')]);_0x119693[_0x86a3('0x34')]=_[_0x86a3('0x32')](_0xff2fb1[_0x86a3('0x2f')],qs['fields'](_0x46e15f['query']['fields']));_0x119693['attributes']=_0x119693[_0x86a3('0x34')][_0x86a3('0x44')]?_0x119693[_0x86a3('0x34')]:_0xff2fb1['model'];if(_0x46e15f[_0x86a3('0x30')][_0x86a3('0x3e')]){_0x119693[_0x86a3('0x45')]=[{'all':!![]}];}_0x119693=_[_0x86a3('0x46')]({},_0x119693,_0x46e15f[_0x86a3('0x3d')]);return db[_0x86a3('0x2b')][_0x86a3('0x47')](_0x119693)[_0x86a3('0x23')](handleEntityNotFound(_0x459a4a,null))[_0x86a3('0x23')](respondWithResult(_0x459a4a,null))[_0x86a3('0x41')](handleError(_0x459a4a,null));};exports[_0x86a3('0x48')]=function(_0x235853,_0x2cf0bd){return db[_0x86a3('0x2b')][_0x86a3('0x48')](_0x235853[_0x86a3('0x49')],{})[_0x86a3('0x23')](function(_0x5e28bc){var _0x1e9e6a=_0x235853[_0x86a3('0x4a')]['get']({'plain':!![]});if(!_0x1e9e6a)throw new Error(_0x86a3('0x4b'));if(_0x1e9e6a[_0x86a3('0x4c')]===_0x86a3('0x4a')){var _0xbc63e0=_0x5e28bc[_0x86a3('0x25')]({'plain':!![]});var _0x265106=_0x86a3('0x26');return db[_0x86a3('0x4d')][_0x86a3('0x47')]({'where':{'name':_0x265106,'userProfileId':_0x1e9e6a[_0x86a3('0x4e')]},'raw':!![]})[_0x86a3('0x23')](function(_0x4eb608){if(_0x4eb608&&_0x4eb608[_0x86a3('0x4f')]===0x0){return db[_0x86a3('0x50')][_0x86a3('0x48')]({'name':_0xbc63e0['name'],'resourceId':_0xbc63e0['id'],'type':_0x4eb608[_0x86a3('0x29')],'sectionId':_0x4eb608['id']},{})[_0x86a3('0x23')](function(){return _0x5e28bc;});}else{return _0x5e28bc;}})[_0x86a3('0x41')](function(_0x30b01d){logger[_0x86a3('0x28')](_0x86a3('0x51'),_0x30b01d);throw _0x30b01d;});}return _0x5e28bc;})[_0x86a3('0x23')](respondWithResult(_0x2cf0bd,0xc9))[_0x86a3('0x41')](handleError(_0x2cf0bd,null));};exports['update']=function(_0x3aada9,_0x44dbd9){if(_0x3aada9[_0x86a3('0x49')]['id']){delete _0x3aada9[_0x86a3('0x49')]['id'];}return db[_0x86a3('0x2b')][_0x86a3('0x47')]({'where':{'id':_0x3aada9[_0x86a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x44dbd9,null))[_0x86a3('0x23')](saveUpdates(_0x3aada9[_0x86a3('0x49')],null))[_0x86a3('0x23')](respondWithResult(_0x44dbd9,null))[_0x86a3('0x41')](handleError(_0x44dbd9,null));};exports['destroy']=function(_0x41e672,_0x559603){return db[_0x86a3('0x2b')]['find']({'where':{'id':_0x41e672[_0x86a3('0x43')]['id']}})[_0x86a3('0x23')](handleEntityNotFound(_0x559603,null))['then'](removeEntity(_0x559603,null))[_0x86a3('0x41')](handleError(_0x559603,null));};exports[_0x86a3('0x52')]=function(_0x6d108c,_0x5255ad,_0x50b7ba){if(_0x6d108c[_0x86a3('0x49')]['id']){delete _0x6d108c['body']['id'];}return db[_0x86a3('0x2b')]['find']({'where':{'id':_0x6d108c[_0x86a3('0x43')]['id']}})['then'](handleEntityNotFound(_0x5255ad,null))[_0x86a3('0x23')](function(_0x4897bd){if(_0x4897bd){_0x6d108c['body'][_0x86a3('0x53')]=_0x4897bd['id'];return db[_0x86a3('0x2b')][_0x86a3('0x48')](_0x6d108c[_0x86a3('0x49')]);}})[_0x86a3('0x23')](respondWithResult(_0x5255ad,null))[_0x86a3('0x41')](handleError(_0x5255ad,null));};exports[_0x86a3('0x54')]=function(_0x5c1aaf,_0x43e899,_0x5c9434){var _0x7f499c={};var _0x5812da={};var _0x111b73;var _0x3c28f1;return db[_0x86a3('0x2b')][_0x86a3('0x55')]({'where':{'id':_0x5c1aaf['params']['id']}})[_0x86a3('0x23')](handleEntityNotFound(_0x43e899,null))[_0x86a3('0x23')](function(_0x5b8321){if(_0x5b8321){_0x111b73=_0x5b8321;_0x5812da[_0x86a3('0x2f')]=_['keys'](db[_0x86a3('0x2b')]['rawAttributes']);_0x5812da[_0x86a3('0x30')]=_[_0x86a3('0x31')](_0x5c1aaf[_0x86a3('0x30')]);_0x5812da[_0x86a3('0x39')]=_[_0x86a3('0x32')](_0x5812da[_0x86a3('0x2f')],_0x5812da[_0x86a3('0x30')]);_0x7f499c['attributes']=_['intersection'](_0x5812da[_0x86a3('0x2f')],qs[_0x86a3('0x33')](_0x5c1aaf['query'][_0x86a3('0x33')]));_0x7f499c[_0x86a3('0x34')]=_0x7f499c[_0x86a3('0x34')][_0x86a3('0x44')]?_0x7f499c[_0x86a3('0x34')]:_0x5812da['model'];_0x7f499c[_0x86a3('0x36')]=qs['sort'](_0x5c1aaf['query']['sort']);_0x7f499c[_0x86a3('0x38')]=qs['filters'](_[_0x86a3('0x3a')](_0x5c1aaf[_0x86a3('0x30')],_0x5812da[_0x86a3('0x39')]));if(_0x5c1aaf['query']['filter']){_0x7f499c['where']=_[_0x86a3('0x46')](_0x7f499c[_0x86a3('0x38')],{'$or':_[_0x86a3('0x2a')](_0x7f499c[_0x86a3('0x34')],function(_0x2fafe8){var _0x5801cb={};_0x5801cb[_0x2fafe8]={'$like':'%'+_0x5c1aaf[_0x86a3('0x30')][_0x86a3('0x3c')]+'%'};return _0x5801cb;})});}_0x7f499c=_['merge']({},_0x7f499c,_0x5c1aaf[_0x86a3('0x3d')]);return _0x111b73[_0x86a3('0x54')](_0x7f499c);}})[_0x86a3('0x23')](function(_0x342217){if(_0x342217){_0x3c28f1=_0x342217['length'];if(!_0x5c1aaf['query']['hasOwnProperty'](_0x86a3('0x35'))){_0x7f499c[_0x86a3('0x1c')]=qs['limit'](_0x5c1aaf[_0x86a3('0x30')][_0x86a3('0x1c')]);_0x7f499c[_0x86a3('0x1a')]=qs['offset'](_0x5c1aaf[_0x86a3('0x30')]['offset']);}return _0x111b73[_0x86a3('0x54')](_0x7f499c);}})[_0x86a3('0x23')](function(_0x10afe5){if(_0x10afe5){return _0x10afe5?{'count':_0x3c28f1,'rows':_0x10afe5}:null;}})[_0x86a3('0x23')](respondWithResult(_0x43e899,null))[_0x86a3('0x41')](handleError(_0x43e899,null));};exports[_0x86a3('0x56')]=function(_0x29c680,_0xe0b5c8,_0x163a40){return db['Interval'][_0x86a3('0x55')]({'where':{'id':_0x29c680[_0x86a3('0x43')]['id']}})['then'](handleEntityNotFound(_0xe0b5c8,null))[_0x86a3('0x23')](function(_0x2553f0){if(_0x2553f0){return db[_0x86a3('0x57')][_0x86a3('0x58')](function(_0x401deb){return db[_0x86a3('0x2b')][_0x86a3('0x24')]({'where':{'IntervalId':_0x29c680[_0x86a3('0x43')]['id']},'transaction':_0x401deb})[_0x86a3('0x23')](function(_0x4565a5){var _0x58556f=_[_0x86a3('0x2a')](_0x29c680[_0x86a3('0x49')],function(_0x39e689){delete _0x39e689['id'];_0x39e689['IntervalId']=_0x29c680[_0x86a3('0x43')]['id'];return _0x39e689;});return db[_0x86a3('0x2b')][_0x86a3('0x59')](_0x58556f,{'transaction':_0x401deb});});})[_0x86a3('0x23')](function(){return db[_0x86a3('0x2b')][_0x86a3('0x3f')]({'where':{'IntervalId':_0x29c680[_0x86a3('0x43')]['id']}});});}})['then'](respondWithResult(_0xe0b5c8,null))[_0x86a3('0x41')](handleError(_0xe0b5c8,null));};
\ No newline at end of file
+var _0x2d23=['rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addInterval','IntervalId','getIntervals','pick','hasOwnProperty','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','then','destroy','get','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','type','key','map','query','intersection','model','attributes','fields','nolimit','order','sort','filters','filter','where','merge','options','includeAll','include','findAll'];(function(_0x1adac1,_0x2fa342){var _0xe8129d=function(_0x1aaa8a){while(--_0x1aaa8a){_0x1adac1['push'](_0x1adac1['shift']());}};_0xe8129d(++_0x2fa342);}(_0x2d23,0x132));var _0x32d2=function(_0x517930,_0x5113ce){_0x517930=_0x517930-0x0;var _0x40b258=_0x2d23[_0x517930];return _0x40b258;};'use strict';var emlformat=require(_0x32d2('0x0'));var rimraf=require(_0x32d2('0x1'));var zipdir=require(_0x32d2('0x2'));var jsonpatch=require(_0x32d2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32d2('0x4'));var path=require(_0x32d2('0x5'));var sox=require(_0x32d2('0x6'));var csv=require(_0x32d2('0x7'));var ejs=require(_0x32d2('0x8'));var fs=require('fs');var fs_extra=require(_0x32d2('0x9'));var _=require(_0x32d2('0xa'));var squel=require(_0x32d2('0xb'));var crypto=require(_0x32d2('0xc'));var jsforce=require(_0x32d2('0xd'));var deskjs=require(_0x32d2('0xe'));var toCsv=require(_0x32d2('0x7'));var querystring=require(_0x32d2('0xf'));var Papa=require(_0x32d2('0x10'));var Redis=require('ioredis');var authService=require(_0x32d2('0x11'));var qs=require(_0x32d2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32d2('0x13'));var logger=require('../../config/logger')(_0x32d2('0x14'));var utils=require(_0x32d2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x32d2('0x16'));var db=require(_0x32d2('0x17'))['db'];var extensions=require(_0x32d2('0x18'));function respondWithStatusCode(_0x56708f,_0x5b8a03){_0x5b8a03=_0x5b8a03||0xcc;return function(_0x5796d4){if(_0x5796d4){return _0x56708f[_0x32d2('0x19')](_0x5b8a03);}return _0x56708f[_0x32d2('0x1a')](_0x5b8a03)[_0x32d2('0x1b')]();};}function respondWithResult(_0x790baa,_0x11eabe){_0x11eabe=_0x11eabe||0xc8;return function(_0x46d7ee){if(_0x46d7ee){return _0x790baa[_0x32d2('0x1a')](_0x11eabe)[_0x32d2('0x1c')](_0x46d7ee);}};}function respondWithFilteredResult(_0x3fe2f2,_0x2033b9){return function(_0x3404ef){if(_0x3404ef){var _0x4be197=typeof _0x2033b9[_0x32d2('0x1d')]===_0x32d2('0x1e')&&typeof _0x2033b9['limit']==='undefined';var _0xd8fbbb=_0x3404ef[_0x32d2('0x1f')];var _0x2932b0=_0x4be197?0x0:_0x2033b9[_0x32d2('0x1d')];var _0x3b6b04=_0x4be197?_0x3404ef['count']:_0x2033b9[_0x32d2('0x1d')]+_0x2033b9[_0x32d2('0x20')];var _0x3a8f20;if(_0x3b6b04>=_0xd8fbbb){_0x3b6b04=_0xd8fbbb;_0x3a8f20=0xc8;}else{_0x3a8f20=0xce;}_0x3fe2f2['status'](_0x3a8f20);return _0x3fe2f2[_0x32d2('0x21')]('Content-Range',_0x2932b0+'-'+_0x3b6b04+'/'+_0xd8fbbb)[_0x32d2('0x1c')](_0x3404ef);}return null;};}function patchUpdates(_0xd31a1f){return function(_0x493f45){try{jsonpatch[_0x32d2('0x22')](_0x493f45,_0xd31a1f,!![]);}catch(_0x102c7e){return BPromise[_0x32d2('0x23')](_0x102c7e);}return _0x493f45['save']();};}function saveUpdates(_0x4cb264,_0x49c764){return function(_0x158916){if(_0x158916){return _0x158916['update'](_0x4cb264)[_0x32d2('0x24')](function(_0x51b474){return _0x51b474;});}return null;};}function removeEntity(_0x4a9f80,_0x18c25f){return function(_0x4f592f){if(_0x4f592f){return _0x4f592f[_0x32d2('0x25')]()[_0x32d2('0x24')](function(){var _0x2af488=_0x4f592f[_0x32d2('0x26')]({'plain':!![]});var _0x44e9d1='Intervals';return db[_0x32d2('0x27')][_0x32d2('0x25')]({'where':{'type':_0x44e9d1,'resourceId':_0x2af488['id']}})[_0x32d2('0x24')](function(){return _0x4f592f;});})['then'](function(){_0x4a9f80[_0x32d2('0x1a')](0xcc)[_0x32d2('0x1b')]();});}};}function handleEntityNotFound(_0x2dea70,_0x5bc37e){return function(_0x48cff2){if(!_0x48cff2){_0x2dea70[_0x32d2('0x19')](0x194);}return _0x48cff2;};}function handleError(_0x361fc2,_0x10ba4e){_0x10ba4e=_0x10ba4e||0x1f4;return function(_0x11b7e4){logger[_0x32d2('0x28')](_0x11b7e4[_0x32d2('0x29')]);if(_0x11b7e4['name']){delete _0x11b7e4[_0x32d2('0x2a')];}_0x361fc2[_0x32d2('0x1a')](_0x10ba4e)[_0x32d2('0x2b')](_0x11b7e4);};}exports[_0x32d2('0x2c')]=function(_0x104b37,_0x1297cf){var _0x4f3b90={},_0x12e7a4={},_0x32ab1={'count':0x0,'rows':[]};var _0x332ab9=_['map'](db[_0x32d2('0x2d')][_0x32d2('0x2e')],function(_0x2e6ae8){return{'name':_0x2e6ae8['fieldName'],'type':_0x2e6ae8[_0x32d2('0x2f')][_0x32d2('0x30')]};});_0x12e7a4['model']=_[_0x32d2('0x31')](_0x332ab9,_0x32d2('0x2a'));_0x12e7a4[_0x32d2('0x32')]=_['keys'](_0x104b37[_0x32d2('0x32')]);_0x12e7a4['filters']=_[_0x32d2('0x33')](_0x12e7a4[_0x32d2('0x34')],_0x12e7a4['query']);_0x4f3b90[_0x32d2('0x35')]=_[_0x32d2('0x33')](_0x12e7a4[_0x32d2('0x34')],qs['fields'](_0x104b37[_0x32d2('0x32')][_0x32d2('0x36')]));_0x4f3b90[_0x32d2('0x35')]=_0x4f3b90['attributes']['length']?_0x4f3b90[_0x32d2('0x35')]:_0x12e7a4['model'];if(!_0x104b37['query']['hasOwnProperty'](_0x32d2('0x37'))){_0x4f3b90['limit']=qs[_0x32d2('0x20')](_0x104b37['query'][_0x32d2('0x20')]);_0x4f3b90[_0x32d2('0x1d')]=qs[_0x32d2('0x1d')](_0x104b37['query'][_0x32d2('0x1d')]);}_0x4f3b90[_0x32d2('0x38')]=qs['sort'](_0x104b37['query'][_0x32d2('0x39')]);_0x4f3b90['where']=qs['filters'](_['pick'](_0x104b37[_0x32d2('0x32')],_0x12e7a4[_0x32d2('0x3a')]),_0x332ab9);if(_0x104b37[_0x32d2('0x32')][_0x32d2('0x3b')]){_0x4f3b90[_0x32d2('0x3c')]=_['merge'](_0x4f3b90[_0x32d2('0x3c')],{'$or':_[_0x32d2('0x31')](_0x332ab9,function(_0xad6c80){if(_0xad6c80[_0x32d2('0x2f')]!=='VIRTUAL'){var _0x380a6b={};_0x380a6b[_0xad6c80['name']]={'$like':'%'+_0x104b37[_0x32d2('0x32')][_0x32d2('0x3b')]+'%'};return _0x380a6b;}})});}_0x4f3b90=_[_0x32d2('0x3d')]({},_0x4f3b90,_0x104b37[_0x32d2('0x3e')]);var _0x14bf07={'where':_0x4f3b90[_0x32d2('0x3c')]};return db[_0x32d2('0x2d')]['count'](_0x14bf07)[_0x32d2('0x24')](function(_0x2de0a5){_0x32ab1['count']=_0x2de0a5;if(_0x104b37['query'][_0x32d2('0x3f')]){_0x4f3b90[_0x32d2('0x40')]=[{'all':!![]}];}return db['Interval'][_0x32d2('0x41')](_0x4f3b90);})[_0x32d2('0x24')](function(_0x4ce62f){_0x32ab1[_0x32d2('0x42')]=_0x4ce62f;return _0x32ab1;})[_0x32d2('0x24')](respondWithFilteredResult(_0x1297cf,_0x4f3b90))[_0x32d2('0x43')](handleError(_0x1297cf,null));};exports[_0x32d2('0x44')]=function(_0x326fcb,_0x45f728){var _0x55d1bd={'raw':!![],'where':{'id':_0x326fcb[_0x32d2('0x45')]['id']}},_0x3799c5={};_0x3799c5['model']=_[_0x32d2('0x46')](db[_0x32d2('0x2d')]['rawAttributes']);_0x3799c5[_0x32d2('0x32')]=_[_0x32d2('0x46')](_0x326fcb['query']);_0x3799c5[_0x32d2('0x3a')]=_['intersection'](_0x3799c5[_0x32d2('0x34')],_0x3799c5[_0x32d2('0x32')]);_0x55d1bd[_0x32d2('0x35')]=_[_0x32d2('0x33')](_0x3799c5[_0x32d2('0x34')],qs[_0x32d2('0x36')](_0x326fcb[_0x32d2('0x32')][_0x32d2('0x36')]));_0x55d1bd[_0x32d2('0x35')]=_0x55d1bd['attributes'][_0x32d2('0x47')]?_0x55d1bd[_0x32d2('0x35')]:_0x3799c5[_0x32d2('0x34')];if(_0x326fcb['query'][_0x32d2('0x3f')]){_0x55d1bd[_0x32d2('0x40')]=[{'all':!![]}];}_0x55d1bd=_[_0x32d2('0x3d')]({},_0x55d1bd,_0x326fcb[_0x32d2('0x3e')]);return db[_0x32d2('0x2d')][_0x32d2('0x48')](_0x55d1bd)[_0x32d2('0x24')](handleEntityNotFound(_0x45f728,null))['then'](respondWithResult(_0x45f728,null))[_0x32d2('0x43')](handleError(_0x45f728,null));};exports[_0x32d2('0x49')]=function(_0x225ba2,_0x414d49){return db[_0x32d2('0x2d')][_0x32d2('0x49')](_0x225ba2[_0x32d2('0x4a')],{})['then'](function(_0x6927e0){var _0x46b4ad=_0x225ba2[_0x32d2('0x4b')][_0x32d2('0x26')]({'plain':!![]});if(!_0x46b4ad)throw new Error(_0x32d2('0x4c'));if(_0x46b4ad[_0x32d2('0x4d')]===_0x32d2('0x4b')){var _0x12d075=_0x6927e0[_0x32d2('0x26')]({'plain':!![]});var _0x2554a4=_0x32d2('0x4e');return db[_0x32d2('0x4f')]['find']({'where':{'name':_0x2554a4,'userProfileId':_0x46b4ad['userProfileId']},'raw':!![]})[_0x32d2('0x24')](function(_0x478e06){if(_0x478e06&&_0x478e06[_0x32d2('0x50')]===0x0){return db[_0x32d2('0x27')]['create']({'name':_0x12d075[_0x32d2('0x2a')],'resourceId':_0x12d075['id'],'type':_0x478e06[_0x32d2('0x2a')],'sectionId':_0x478e06['id']},{})[_0x32d2('0x24')](function(){return _0x6927e0;});}else{return _0x6927e0;}})[_0x32d2('0x43')](function(_0x52ae78){logger['error'](_0x32d2('0x51'),_0x52ae78);throw _0x52ae78;});}return _0x6927e0;})['then'](respondWithResult(_0x414d49,0xc9))[_0x32d2('0x43')](handleError(_0x414d49,null));};exports[_0x32d2('0x52')]=function(_0x36952c,_0x25e0da){if(_0x36952c[_0x32d2('0x4a')]['id']){delete _0x36952c[_0x32d2('0x4a')]['id'];}return db[_0x32d2('0x2d')]['find']({'where':{'id':_0x36952c[_0x32d2('0x45')]['id']}})['then'](handleEntityNotFound(_0x25e0da,null))[_0x32d2('0x24')](saveUpdates(_0x36952c[_0x32d2('0x4a')],null))[_0x32d2('0x24')](respondWithResult(_0x25e0da,null))['catch'](handleError(_0x25e0da,null));};exports[_0x32d2('0x25')]=function(_0x50dca1,_0x5e6716){return db['Interval']['find']({'where':{'id':_0x50dca1[_0x32d2('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e6716,null))['then'](removeEntity(_0x5e6716,null))[_0x32d2('0x43')](handleError(_0x5e6716,null));};exports[_0x32d2('0x53')]=function(_0xa5861e,_0x552336,_0x5b5b41){if(_0xa5861e['body']['id']){delete _0xa5861e[_0x32d2('0x4a')]['id'];}return db[_0x32d2('0x2d')][_0x32d2('0x48')]({'where':{'id':_0xa5861e[_0x32d2('0x45')]['id']}})['then'](handleEntityNotFound(_0x552336,null))[_0x32d2('0x24')](function(_0x290bf7){if(_0x290bf7){_0xa5861e['body'][_0x32d2('0x54')]=_0x290bf7['id'];return db['Interval'][_0x32d2('0x49')](_0xa5861e[_0x32d2('0x4a')]);}})['then'](respondWithResult(_0x552336,null))[_0x32d2('0x43')](handleError(_0x552336,null));};exports[_0x32d2('0x55')]=function(_0xb23bd3,_0x1d38a1,_0x370f04){var _0x2bd76a={};var _0x94f2a4={};var _0x558317;var _0x52303f;return db[_0x32d2('0x2d')]['findOne']({'where':{'id':_0xb23bd3['params']['id']}})[_0x32d2('0x24')](handleEntityNotFound(_0x1d38a1,null))['then'](function(_0x3645b7){if(_0x3645b7){_0x558317=_0x3645b7;_0x94f2a4[_0x32d2('0x34')]=_['keys'](db['Interval']['rawAttributes']);_0x94f2a4[_0x32d2('0x32')]=_[_0x32d2('0x46')](_0xb23bd3['query']);_0x94f2a4['filters']=_[_0x32d2('0x33')](_0x94f2a4[_0x32d2('0x34')],_0x94f2a4[_0x32d2('0x32')]);_0x2bd76a[_0x32d2('0x35')]=_[_0x32d2('0x33')](_0x94f2a4['model'],qs[_0x32d2('0x36')](_0xb23bd3['query'][_0x32d2('0x36')]));_0x2bd76a[_0x32d2('0x35')]=_0x2bd76a[_0x32d2('0x35')][_0x32d2('0x47')]?_0x2bd76a[_0x32d2('0x35')]:_0x94f2a4[_0x32d2('0x34')];_0x2bd76a[_0x32d2('0x38')]=qs[_0x32d2('0x39')](_0xb23bd3['query']['sort']);_0x2bd76a[_0x32d2('0x3c')]=qs[_0x32d2('0x3a')](_[_0x32d2('0x56')](_0xb23bd3[_0x32d2('0x32')],_0x94f2a4['filters']));if(_0xb23bd3[_0x32d2('0x32')]['filter']){_0x2bd76a[_0x32d2('0x3c')]=_['merge'](_0x2bd76a[_0x32d2('0x3c')],{'$or':_['map'](_0x2bd76a[_0x32d2('0x35')],function(_0x23f4c1){var _0x3b45a9={};_0x3b45a9[_0x23f4c1]={'$like':'%'+_0xb23bd3['query'][_0x32d2('0x3b')]+'%'};return _0x3b45a9;})});}_0x2bd76a=_[_0x32d2('0x3d')]({},_0x2bd76a,_0xb23bd3[_0x32d2('0x3e')]);return _0x558317[_0x32d2('0x55')](_0x2bd76a);}})[_0x32d2('0x24')](function(_0x3c1c95){if(_0x3c1c95){_0x52303f=_0x3c1c95[_0x32d2('0x47')];if(!_0xb23bd3['query'][_0x32d2('0x57')](_0x32d2('0x37'))){_0x2bd76a[_0x32d2('0x20')]=qs[_0x32d2('0x20')](_0xb23bd3[_0x32d2('0x32')][_0x32d2('0x20')]);_0x2bd76a[_0x32d2('0x1d')]=qs[_0x32d2('0x1d')](_0xb23bd3[_0x32d2('0x32')]['offset']);}return _0x558317['getIntervals'](_0x2bd76a);}})[_0x32d2('0x24')](function(_0x3e2568){if(_0x3e2568){return _0x3e2568?{'count':_0x52303f,'rows':_0x3e2568}:null;}})[_0x32d2('0x24')](respondWithResult(_0x1d38a1,null))['catch'](handleError(_0x1d38a1,null));};exports[_0x32d2('0x58')]=function(_0x45c749,_0x388f6c,_0x40f90f){return db[_0x32d2('0x2d')][_0x32d2('0x59')]({'where':{'id':_0x45c749[_0x32d2('0x45')]['id']}})[_0x32d2('0x24')](handleEntityNotFound(_0x388f6c,null))[_0x32d2('0x24')](function(_0x46320f){if(_0x46320f){return db[_0x32d2('0x5a')][_0x32d2('0x5b')](function(_0x26f3bf){return db[_0x32d2('0x2d')][_0x32d2('0x25')]({'where':{'IntervalId':_0x45c749[_0x32d2('0x45')]['id']},'transaction':_0x26f3bf})[_0x32d2('0x24')](function(_0x20c3ec){var _0x408ad6=_[_0x32d2('0x31')](_0x45c749[_0x32d2('0x4a')],function(_0x232146){delete _0x232146['id'];_0x232146[_0x32d2('0x54')]=_0x45c749[_0x32d2('0x45')]['id'];return _0x232146;});return db[_0x32d2('0x2d')][_0x32d2('0x5c')](_0x408ad6,{'transaction':_0x26f3bf});});})['then'](function(){return db[_0x32d2('0x2d')][_0x32d2('0x41')]({'where':{'IntervalId':_0x45c749['params']['id']}});});}})[_0x32d2('0x24')](respondWithResult(_0x388f6c,null))['catch'](handleError(_0x388f6c,null));};
\ No newline at end of file
index 9c3072c..fe3714b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd41f=['./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x16e29e,_0x3e002f){var _0x9f003f=function(_0x1d2b04){while(--_0x1d2b04){_0x16e29e['push'](_0x16e29e['shift']());}};_0x9f003f(++_0x3e002f);}(_0xd41f,0x7b));var _0xfd41=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd41f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xfd41('0x0'));var logger=require(_0xfd41('0x1'))('api');var moment=require(_0xfd41('0x2'));var BPromise=require('bluebird');var rp=require(_0xfd41('0x3'));var fs=require('fs');var path=require(_0xfd41('0x4'));var rimraf=require(_0xfd41('0x5'));var config=require(_0xfd41('0x6'));var attributes=require(_0xfd41('0x7'));var extensions=require(_0xfd41('0x8'));module[_0xfd41('0x9')]=function(_0x438107,_0x1da21c){return _0x438107[_0xfd41('0xa')]('Interval',attributes,{'tableName':_0xfd41('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27e753,_0x205b37){extensions[_0xfd41('0xc')](_0x438107,_0x27e753);},'afterBulkCreate':function(_0x1d667f,_0x15650b,_0x5a97c3){_0x5a97c3();extensions[_0xfd41('0xc')](_0x438107,_0x1d667f[0x0]);},'afterUpdate':function(_0x3b5dc9,_0x560be9){extensions[_0xfd41('0xc')](_0x438107,_0x3b5dc9);},'afterDestroy':function(_0x5a3a03,_0x181371){extensions[_0xfd41('0xc')](_0x438107,_0x5a3a03);}}});};
\ No newline at end of file
+var _0x110f=['../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','bluebird','path','rimraf','../../config/environment'];(function(_0x27239f,_0x42d9ed){var _0x2d79dd=function(_0x1c6e34){while(--_0x1c6e34){_0x27239f['push'](_0x27239f['shift']());}};_0x2d79dd(++_0x42d9ed);}(_0x110f,0x1e6));var _0xf110=function(_0x3150fb,_0x5128c4){_0x3150fb=_0x3150fb-0x0;var _0x1bb2a2=_0x110f[_0x3150fb];return _0x1bb2a2;};'use strict';var _=require(_0xf110('0x0'));var util=require(_0xf110('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf110('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf110('0x3'));var rimraf=require(_0xf110('0x4'));var config=require(_0xf110('0x5'));var attributes=require('./interval.attributes');var extensions=require(_0xf110('0x6'));module[_0xf110('0x7')]=function(_0xc27675,_0x4dcb19){return _0xc27675[_0xf110('0x8')](_0xf110('0x9'),attributes,{'tableName':_0xf110('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x57593b,_0x307bce){extensions[_0xf110('0xb')](_0xc27675,_0x57593b);},'afterBulkCreate':function(_0x11c28f,_0x536185,_0x13e06b){_0x13e06b();extensions[_0xf110('0xb')](_0xc27675,_0x11c28f[0x0]);},'afterUpdate':function(_0x17a94a,_0x24ada7){extensions['rewrite'](_0xc27675,_0x17a94a);},'afterDestroy':function(_0x35e191,_0x13ced0){extensions['rewrite'](_0xc27675,_0x35e191);}}});};
\ No newline at end of file
index bf02a8d..9725ecc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x506d2f,_0x5ab76e){var _0x101255=function(_0x1596b1){while(--_0x1596b1){_0x506d2f['push'](_0x506d2f['shift']());}};_0x101255(++_0x5ab76e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index ddd09f7..8e14a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x112a51,_0x4d8d8f){var _0x4d5d03=function(_0x123231){while(--_0x123231){_0x112a51['push'](_0x112a51['shift']());}};_0x4d5d03(++_0x4d8d8f);}(_0xadb5,0xad));var _0x5adb=function(_0x259680,_0xf5681a){_0x259680=_0x259680-0x0;var _0x4aaf84=_0xadb5[_0x259680];return _0x4aaf84;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
+var _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x0b0e,0x187));var _0xe0b0=function(_0xa3400,_0x3a980a){_0xa3400=_0xa3400-0x0;var _0x33dba2=_0x0b0e[_0xa3400];return _0x33dba2;};'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
index 7655038..0fa3140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdff=['setEncoding','utf8','data','end','status','statusCode','json','parse','write','openIssue','send','body','headers','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','base64','request'];(function(_0x1c82c1,_0x360384){var _0x509ae7=function(_0x33d98b){while(--_0x33d98b){_0x1c82c1['push'](_0x1c82c1['shift']());}};_0x509ae7(++_0x360384);}(_0xcdff,0xf6));var _0xfcdf=function(_0x2b71e8,_0x2c7d25){_0x2b71e8=_0x2b71e8-0x0;var _0x54e0fb=_0xcdff[_0x2b71e8];return _0x54e0fb;};'use strict';var BPromise=require(_0xfcdf('0x0'));var https=require(_0xfcdf('0x1'));var logger=require(_0xfcdf('0x2'))(_0xfcdf('0x3'));var USERNAME=_0xfcdf('0x4');var PASSWORD=_0xfcdf('0x5');function openIssue(_0x455cfe,_0x5bbafd){var _0x17c0d7={'fields':{'project':{'key':_0x455cfe[_0xfcdf('0x6')]||_0xfcdf('0x7')},'summary':(_0x455cfe[_0xfcdf('0x8')]||_0xfcdf('0x9'))+_0xfcdf('0xa')+_0x455cfe['ip'],'description':_0x455cfe[_0xfcdf('0xb')]||JSON[_0xfcdf('0xc')](_0x455cfe),'issuetype':{'name':_0x455cfe[_0xfcdf('0xd')]||_0xfcdf('0xe')}}};_0x17c0d7[_0xfcdf('0xf')][_0xfcdf('0x10')]=_0x455cfe[_0xfcdf('0x11')];_0x17c0d7[_0xfcdf('0xf')]['customfield_11501']=_0x455cfe[_0xfcdf('0x12')];_0x17c0d7[_0xfcdf('0xf')][_0xfcdf('0x13')]=_0x455cfe['newToken'];_0x17c0d7[_0xfcdf('0xf')][_0xfcdf('0x14')]=_0x455cfe[_0xfcdf('0x15')];_0x17c0d7['fields'][_0xfcdf('0x16')]=_0x455cfe['reason'];_0x17c0d7[_0xfcdf('0xf')][_0xfcdf('0x17')]=_0x455cfe['ip'];var _0x5693fe={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xfcdf('0x18'),'method':_0xfcdf('0x19'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0xfcdf('0x1a')+new Buffer(USERNAME+':'+PASSWORD)[_0xfcdf('0x1b')](_0xfcdf('0x1c'))}};var _0xcf851e=JSON[_0xfcdf('0xc')](_0x17c0d7);var _0x358ee6=https[_0xfcdf('0x1d')](_0x5693fe,function(_0x4c010d){_0x4c010d[_0xfcdf('0x1e')](_0xfcdf('0x1f'));var _0x1c406d='';_0x4c010d['on'](_0xfcdf('0x20'),function(_0x1545c1){_0x1c406d+=_0x1545c1;});_0x4c010d['on'](_0xfcdf('0x21'),function(){if(_0x5bbafd){return _0x5bbafd[_0xfcdf('0x22')](_0x4c010d[_0xfcdf('0x23')])[_0xfcdf('0x24')](JSON[_0xfcdf('0x25')](_0x1c406d));}});});_0x358ee6['on']('error',function(_0x3828c1){if(_0x5bbafd){return _0x5bbafd['status'](0x1f4)[_0xfcdf('0x24')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x358ee6[_0xfcdf('0x26')](_0xcf851e);_0x358ee6[_0xfcdf('0x21')]();}exports[_0xfcdf('0x27')]=openIssue;exports[_0xfcdf('0x28')]=function(_0x51ba8d,_0x4750ef){_0x51ba8d[_0xfcdf('0x29')]['ip']=_0x51ba8d[_0xfcdf('0x2a')]['x-forwarded-for']||_0x51ba8d['connection'][_0xfcdf('0x2b')]||_0x51ba8d[_0xfcdf('0x2c')][_0xfcdf('0x2b')]||_0x51ba8d[_0xfcdf('0x2d')][_0xfcdf('0x2c')][_0xfcdf('0x2b')];return openIssue(_0x51ba8d[_0xfcdf('0x29')],_0x4750ef);};
\ No newline at end of file
+var _0xaab4=['oldToken','newToken','customfield_11503','reason','customfield_10102','POST','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','Report','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501'];(function(_0x2cfe75,_0x19c4db){var _0x2255c1=function(_0x231a9d){while(--_0x231a9d){_0x2cfe75['push'](_0x2cfe75['shift']());}};_0x2255c1(++_0x19c4db);}(_0xaab4,0xba));var _0x4aab=function(_0x3c06a5,_0x39306e){_0x3c06a5=_0x3c06a5-0x0;var _0x41b778=_0xaab4[_0x3c06a5];return _0x41b778;};'use strict';var BPromise=require(_0x4aab('0x0'));var https=require('https');var logger=require(_0x4aab('0x1'))('api');var USERNAME=_0x4aab('0x2');var PASSWORD=_0x4aab('0x3');function openIssue(_0xc7da9b,_0x247a1e){var _0x26268a={'fields':{'project':{'key':_0xc7da9b['key']||_0x4aab('0x4')},'summary':(_0xc7da9b[_0x4aab('0x5')]||_0x4aab('0x6'))+'\x20from\x20'+_0xc7da9b['ip'],'description':_0xc7da9b[_0x4aab('0x7')]||JSON[_0x4aab('0x8')](_0xc7da9b),'issuetype':{'name':_0xc7da9b[_0x4aab('0x9')]||'Bug'}}};_0x26268a[_0x4aab('0xa')][_0x4aab('0xb')]=_0xc7da9b[_0x4aab('0xc')];_0x26268a[_0x4aab('0xa')][_0x4aab('0xd')]=_0xc7da9b[_0x4aab('0xe')];_0x26268a[_0x4aab('0xa')]['customfield_11502']=_0xc7da9b[_0x4aab('0xf')];_0x26268a['fields'][_0x4aab('0x10')]=_0xc7da9b['name'];_0x26268a[_0x4aab('0xa')]['customfield_11504']=_0xc7da9b[_0x4aab('0x11')];_0x26268a[_0x4aab('0xa')][_0x4aab('0x12')]=_0xc7da9b['ip'];var _0x183d5e={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x4aab('0x13'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x4aab('0x14')+new Buffer(USERNAME+':'+PASSWORD)[_0x4aab('0x15')](_0x4aab('0x16'))}};var _0x4fd968=JSON[_0x4aab('0x8')](_0x26268a);var _0x18344d=https[_0x4aab('0x17')](_0x183d5e,function(_0x569521){_0x569521['setEncoding'](_0x4aab('0x18'));var _0xc90f90='';_0x569521['on'](_0x4aab('0x19'),function(_0x1b90cf){_0xc90f90+=_0x1b90cf;});_0x569521['on'](_0x4aab('0x1a'),function(){if(_0x247a1e){return _0x247a1e[_0x4aab('0x1b')](_0x569521[_0x4aab('0x1c')])[_0x4aab('0x1d')](JSON[_0x4aab('0x1e')](_0xc90f90));}});});_0x18344d['on']('error',function(_0xd68bba){if(_0x247a1e){return _0x247a1e[_0x4aab('0x1b')](0x1f4)[_0x4aab('0x1d')]({'errors':[{'message':_0x4aab('0x1f'),'type':_0x4aab('0x20')}]});}});_0x18344d['write'](_0x4fd968);_0x18344d[_0x4aab('0x1a')]();}exports[_0x4aab('0x21')]=openIssue;exports['send']=function(_0x57e3f8,_0x3ead54){_0x57e3f8[_0x4aab('0x22')]['ip']=_0x57e3f8[_0x4aab('0x23')][_0x4aab('0x24')]||_0x57e3f8[_0x4aab('0x25')][_0x4aab('0x26')]||_0x57e3f8[_0x4aab('0x27')][_0x4aab('0x26')]||_0x57e3f8[_0x4aab('0x25')][_0x4aab('0x27')]['remoteAddress'];return openIssue(_0x57e3f8[_0x4aab('0x22')],_0x3ead54);};
\ No newline at end of file
index 3596cd1..9d0369a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a7=['Router','../../components/auth/service','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0x91a7,0xe7));var _0x791a=function(_0x5ce1c6,_0x59ef3e){_0x5ce1c6=_0x5ce1c6-0x0;var _0x4f8cbc=_0x91a7[_0x5ce1c6];return _0x4f8cbc;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['describe']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0xc')]('/',auth['isAuthenticated'](),controller[_0x791a('0xd')]);router[_0x791a('0xe')]('/:id',auth[_0x791a('0x9')](),controller[_0x791a('0xf')]);router[_0x791a('0x10')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_0x42f78a,_0x210841){var _0x26cb8f=function(_0x5c596a){while(--_0x5c596a){_0x42f78a['push'](_0x42f78a['shift']());}};_0x26cb8f(++_0x210841);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['delete']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x10')]);module['exports']=router;
\ No newline at end of file
index 47d4fae..5dd787e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0xc0f26b,_0x4c529d){_0xc0f26b=_0xc0f26b-0x0;var _0x69aba9=_0x7a54[_0xc0f26b];return _0x69aba9;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7a54,0x106));var _0x47a5=function(_0xa46174,_0x43853f){_0xa46174=_0xa46174-0x0;var _0x4890c2=_0x7a54[_0xa46174];return _0x4890c2;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 298bc64..6596bec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['options','include','findAll','rows','show','length','includeAll','merge','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x687b,0x14a));var _0xb687=function(_0x20834a,_0x471f90){_0x20834a=_0x20834a-0x0;var _0x33da2d=_0x687b[_0x20834a];return _0x33da2d;};'use strict';var emlformat=require(_0xb687('0x0'));var rimraf=require(_0xb687('0x1'));var zipdir=require(_0xb687('0x2'));var jsonpatch=require(_0xb687('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb687('0x4'));var Mustache=require(_0xb687('0x5'));var util=require(_0xb687('0x6'));var path=require(_0xb687('0x7'));var sox=require(_0xb687('0x8'));var csv=require(_0xb687('0x9'));var ejs=require(_0xb687('0xa'));var fs=require('fs');var fs_extra=require(_0xb687('0xb'));var _=require(_0xb687('0xc'));var squel=require(_0xb687('0xd'));var crypto=require('crypto');var jsforce=require(_0xb687('0xe'));var deskjs=require(_0xb687('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb687('0x10'));var Papa=require(_0xb687('0x11'));var Redis=require(_0xb687('0x12'));var authService=require(_0xb687('0x13'));var qs=require(_0xb687('0x14'));var as=require(_0xb687('0x15'));var hardwareService=require(_0xb687('0x16'));var logger=require(_0xb687('0x17'))(_0xb687('0x18'));var utils=require('../../config/utils');var config=require(_0xb687('0x19'));var licenseUtil=require(_0xb687('0x1a'));var db=require(_0xb687('0x1b'))['db'];function respondWithStatusCode(_0x12a0be,_0x4f9c19){_0x4f9c19=_0x4f9c19||0xcc;return function(_0x4c97ed){if(_0x4c97ed){return _0x12a0be[_0xb687('0x1c')](_0x4f9c19);}return _0x12a0be[_0xb687('0x1d')](_0x4f9c19)['end']();};}function respondWithResult(_0x108fd0,_0x2f1ac0){_0x2f1ac0=_0x2f1ac0||0xc8;return function(_0x1f1f35){if(_0x1f1f35){return _0x108fd0[_0xb687('0x1d')](_0x2f1ac0)[_0xb687('0x1e')](_0x1f1f35);}};}function respondWithFilteredResult(_0x3ab914,_0x30622f){return function(_0x141375){if(_0x141375){var _0x263085=typeof _0x30622f[_0xb687('0x1f')]===_0xb687('0x20')&&typeof _0x30622f[_0xb687('0x21')]==='undefined';var _0x214b06=_0x141375[_0xb687('0x22')];var _0x30d370=_0x263085?0x0:_0x30622f['offset'];var _0x48958d=_0x263085?_0x141375[_0xb687('0x22')]:_0x30622f[_0xb687('0x1f')]+_0x30622f[_0xb687('0x21')];var _0x4b593b;if(_0x48958d>=_0x214b06){_0x48958d=_0x214b06;_0x4b593b=0xc8;}else{_0x4b593b=0xce;}_0x3ab914[_0xb687('0x1d')](_0x4b593b);return _0x3ab914['set'](_0xb687('0x23'),_0x30d370+'-'+_0x48958d+'/'+_0x214b06)[_0xb687('0x1e')](_0x141375);}return null;};}function patchUpdates(_0x170dc0){return function(_0x44bd0b){try{jsonpatch['apply'](_0x44bd0b,_0x170dc0,!![]);}catch(_0x3a73d5){return BPromise['reject'](_0x3a73d5);}return _0x44bd0b[_0xb687('0x24')]();};}function saveUpdates(_0x90e892,_0x274241){return function(_0x546fde){if(_0x546fde){return _0x546fde[_0xb687('0x25')](_0x90e892)[_0xb687('0x26')](function(_0xa95e91){return _0xa95e91;});}return null;};}function removeEntity(_0x16cdcb,_0xbf6c58){return function(_0x38866c){if(_0x38866c){return _0x38866c[_0xb687('0x27')]()[_0xb687('0x26')](function(){_0x16cdcb['status'](0xcc)[_0xb687('0x28')]();});}};}function handleEntityNotFound(_0x129347,_0x1c1585){return function(_0x1a0261){if(!_0x1a0261){_0x129347[_0xb687('0x1c')](0x194);}return _0x1a0261;};}function handleError(_0x4136c9,_0x17ff2b){_0x17ff2b=_0x17ff2b||0x1f4;return function(_0x3cb2f2){logger[_0xb687('0x29')](_0x3cb2f2[_0xb687('0x2a')]);if(_0x3cb2f2['name']){delete _0x3cb2f2[_0xb687('0x2b')];}_0x4136c9[_0xb687('0x1d')](_0x17ff2b)[_0xb687('0x2c')](_0x3cb2f2);};}exports[_0xb687('0x2d')]=function(_0x2e5c8d,_0x173c58){var _0x4e9a06={},_0x28b69a={},_0x5143af={'count':0x0,'rows':[]};var _0x360429=_[_0xb687('0x2e')](db[_0xb687('0x2f')][_0xb687('0x30')],function(_0x1ad3ef){return{'name':_0x1ad3ef[_0xb687('0x31')],'type':_0x1ad3ef[_0xb687('0x32')]['key']};});_0x28b69a[_0xb687('0x33')]=_[_0xb687('0x2e')](_0x360429,_0xb687('0x2b'));_0x28b69a[_0xb687('0x34')]=_[_0xb687('0x35')](_0x2e5c8d[_0xb687('0x34')]);_0x28b69a[_0xb687('0x36')]=_[_0xb687('0x37')](_0x28b69a[_0xb687('0x33')],_0x28b69a[_0xb687('0x34')]);_0x4e9a06[_0xb687('0x38')]=_['intersection'](_0x28b69a['model'],qs[_0xb687('0x39')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x39')]));_0x4e9a06[_0xb687('0x38')]=_0x4e9a06['attributes']['length']?_0x4e9a06[_0xb687('0x38')]:_0x28b69a[_0xb687('0x33')];if(!_0x2e5c8d['query'][_0xb687('0x3a')](_0xb687('0x3b'))){_0x4e9a06['limit']=qs[_0xb687('0x21')](_0x2e5c8d['query'][_0xb687('0x21')]);_0x4e9a06[_0xb687('0x1f')]=qs[_0xb687('0x1f')](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x1f')]);}_0x4e9a06[_0xb687('0x3c')]=qs['sort'](_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3d')]);_0x4e9a06[_0xb687('0x3e')]=qs[_0xb687('0x36')](_['pick'](_0x2e5c8d[_0xb687('0x34')],_0x28b69a[_0xb687('0x36')]),_0x360429);if(_0x2e5c8d[_0xb687('0x34')][_0xb687('0x3f')]){_0x4e9a06[_0xb687('0x3e')]=_['merge'](_0x4e9a06[_0xb687('0x3e')],{'$or':_[_0xb687('0x2e')](_0x360429,function(_0x24c013){if(_0x24c013[_0xb687('0x32')]!==_0xb687('0x40')){var _0x29cf09={};_0x29cf09[_0x24c013['name']]={'$like':'%'+_0x2e5c8d['query'][_0xb687('0x3f')]+'%'};return _0x29cf09;}})});}_0x4e9a06=_['merge']({},_0x4e9a06,_0x2e5c8d[_0xb687('0x41')]);var _0x2f4550={'where':_0x4e9a06['where']};return db[_0xb687('0x2f')][_0xb687('0x22')](_0x2f4550)['then'](function(_0x394b56){_0x5143af[_0xb687('0x22')]=_0x394b56;if(_0x2e5c8d[_0xb687('0x34')]['includeAll']){_0x4e9a06[_0xb687('0x42')]=[{'all':!![]}];}return db[_0xb687('0x2f')][_0xb687('0x43')](_0x4e9a06);})[_0xb687('0x26')](function(_0x140388){_0x5143af[_0xb687('0x44')]=_0x140388;return _0x5143af;})[_0xb687('0x26')](respondWithFilteredResult(_0x173c58,_0x4e9a06))['catch'](handleError(_0x173c58,null));};exports[_0xb687('0x45')]=function(_0x4cf6ad,_0x50fdb7){var _0xa3a9e0={'raw':!![],'where':{'id':_0x4cf6ad['params']['id']}},_0x430364={};_0x430364[_0xb687('0x33')]=_['keys'](db[_0xb687('0x2f')][_0xb687('0x30')]);_0x430364['query']=_[_0xb687('0x35')](_0x4cf6ad[_0xb687('0x34')]);_0x430364['filters']=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],_0x430364[_0xb687('0x34')]);_0xa3a9e0[_0xb687('0x38')]=_[_0xb687('0x37')](_0x430364[_0xb687('0x33')],qs[_0xb687('0x39')](_0x4cf6ad[_0xb687('0x34')][_0xb687('0x39')]));_0xa3a9e0[_0xb687('0x38')]=_0xa3a9e0[_0xb687('0x38')][_0xb687('0x46')]?_0xa3a9e0['attributes']:_0x430364[_0xb687('0x33')];if(_0x4cf6ad['query'][_0xb687('0x47')]){_0xa3a9e0[_0xb687('0x42')]=[{'all':!![]}];}_0xa3a9e0=_[_0xb687('0x48')]({},_0xa3a9e0,_0x4cf6ad[_0xb687('0x41')]);return db[_0xb687('0x2f')][_0xb687('0x49')](_0xa3a9e0)['then'](handleEntityNotFound(_0x50fdb7,null))['then'](respondWithResult(_0x50fdb7,null))[_0xb687('0x4a')](handleError(_0x50fdb7,null));};exports[_0xb687('0x4b')]=function(_0x40558a,_0x4f3069){return db['JscriptyAnswerReport'][_0xb687('0x4b')](_0x40558a[_0xb687('0x4c')],{})[_0xb687('0x26')](respondWithResult(_0x4f3069,0xc9))[_0xb687('0x4a')](handleError(_0x4f3069,null));};exports['update']=function(_0x33a0b0,_0xfc4c5f){if(_0x33a0b0[_0xb687('0x4c')]['id']){delete _0x33a0b0[_0xb687('0x4c')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x33a0b0[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0xfc4c5f,null))[_0xb687('0x26')](saveUpdates(_0x33a0b0['body'],null))['then'](respondWithResult(_0xfc4c5f,null))[_0xb687('0x4a')](handleError(_0xfc4c5f,null));};exports[_0xb687('0x27')]=function(_0xd5bdb7,_0x22e618){return db[_0xb687('0x2f')][_0xb687('0x49')]({'where':{'id':_0xd5bdb7[_0xb687('0x4d')]['id']}})[_0xb687('0x26')](handleEntityNotFound(_0x22e618,null))['then'](removeEntity(_0x22e618,null))[_0xb687('0x4a')](handleError(_0x22e618,null));};exports[_0xb687('0x4e')]=function(_0x2342f6,_0x4f5784){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x4f5784,null))[_0xb687('0x4a')](handleError(_0x4f5784,null));};
\ No newline at end of file
+var _0x44e8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','end','error','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','find','catch','create','body','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x3fc254,_0x27ac8b){var _0x5c5e19=function(_0x52721e){while(--_0x52721e){_0x3fc254['push'](_0x3fc254['shift']());}};_0x5c5e19(++_0x27ac8b);}(_0x44e8,0xd7));var _0x844e=function(_0x3f80d4,_0x4789d4){_0x3f80d4=_0x3f80d4-0x0;var _0xba5463=_0x44e8[_0x3f80d4];return _0xba5463;};'use strict';var emlformat=require(_0x844e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x844e('0x1'));var rp=require(_0x844e('0x2'));var moment=require(_0x844e('0x3'));var BPromise=require(_0x844e('0x4'));var Mustache=require('mustache');var util=require(_0x844e('0x5'));var path=require(_0x844e('0x6'));var sox=require(_0x844e('0x7'));var csv=require(_0x844e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x844e('0x9'));var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0x8'));var querystring=require(_0x844e('0xe'));var Papa=require(_0x844e('0xf'));var Redis=require(_0x844e('0x10'));var authService=require(_0x844e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x12'));var hardwareService=require(_0x844e('0x13'));var logger=require(_0x844e('0x14'))(_0x844e('0x15'));var utils=require(_0x844e('0x16'));var config=require(_0x844e('0x17'));var licenseUtil=require(_0x844e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8d3bea,_0x23df3f){_0x23df3f=_0x23df3f||0xcc;return function(_0x52ac76){if(_0x52ac76){return _0x8d3bea[_0x844e('0x19')](_0x23df3f);}return _0x8d3bea[_0x844e('0x1a')](_0x23df3f)['end']();};}function respondWithResult(_0x1f48e2,_0x6b542d){_0x6b542d=_0x6b542d||0xc8;return function(_0x1c1689){if(_0x1c1689){return _0x1f48e2['status'](_0x6b542d)[_0x844e('0x1b')](_0x1c1689);}};}function respondWithFilteredResult(_0x465e49,_0x380eb4){return function(_0x935134){if(_0x935134){var _0x2588a3=typeof _0x380eb4[_0x844e('0x1c')]===_0x844e('0x1d')&&typeof _0x380eb4[_0x844e('0x1e')]==='undefined';var _0x36286c=_0x935134['count'];var _0x3c307f=_0x2588a3?0x0:_0x380eb4['offset'];var _0x315c50=_0x2588a3?_0x935134['count']:_0x380eb4[_0x844e('0x1c')]+_0x380eb4[_0x844e('0x1e')];var _0x2d6ba8;if(_0x315c50>=_0x36286c){_0x315c50=_0x36286c;_0x2d6ba8=0xc8;}else{_0x2d6ba8=0xce;}_0x465e49[_0x844e('0x1a')](_0x2d6ba8);return _0x465e49[_0x844e('0x1f')](_0x844e('0x20'),_0x3c307f+'-'+_0x315c50+'/'+_0x36286c)[_0x844e('0x1b')](_0x935134);}return null;};}function patchUpdates(_0x243aeb){return function(_0x4ffb86){try{jsonpatch[_0x844e('0x21')](_0x4ffb86,_0x243aeb,!![]);}catch(_0x50aeec){return BPromise['reject'](_0x50aeec);}return _0x4ffb86[_0x844e('0x22')]();};}function saveUpdates(_0x345dcc,_0x439b26){return function(_0x286fdd){if(_0x286fdd){return _0x286fdd['update'](_0x345dcc)[_0x844e('0x23')](function(_0x3dde07){return _0x3dde07;});}return null;};}function removeEntity(_0x571498,_0x2520f8){return function(_0x13489b){if(_0x13489b){return _0x13489b[_0x844e('0x24')]()[_0x844e('0x23')](function(){_0x571498[_0x844e('0x1a')](0xcc)[_0x844e('0x25')]();});}};}function handleEntityNotFound(_0x498ae0,_0x399a81){return function(_0xadf0d8){if(!_0xadf0d8){_0x498ae0[_0x844e('0x19')](0x194);}return _0xadf0d8;};}function handleError(_0x263702,_0x2c915f){_0x2c915f=_0x2c915f||0x1f4;return function(_0x5d6856){logger[_0x844e('0x26')](_0x5d6856['stack']);if(_0x5d6856['name']){delete _0x5d6856[_0x844e('0x27')];}_0x263702[_0x844e('0x1a')](_0x2c915f)[_0x844e('0x28')](_0x5d6856);};}exports['index']=function(_0x489349,_0x2d4acd){var _0xc3ec93={},_0x54fd73={},_0x228cc1={'count':0x0,'rows':[]};var _0x81d4de=_[_0x844e('0x29')](db[_0x844e('0x2a')][_0x844e('0x2b')],function(_0x799cde){return{'name':_0x799cde[_0x844e('0x2c')],'type':_0x799cde[_0x844e('0x2d')][_0x844e('0x2e')]};});_0x54fd73[_0x844e('0x2f')]=_['map'](_0x81d4de,_0x844e('0x27'));_0x54fd73[_0x844e('0x30')]=_[_0x844e('0x31')](_0x489349[_0x844e('0x30')]);_0x54fd73[_0x844e('0x32')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],_0x54fd73['query']);_0xc3ec93[_0x844e('0x34')]=_[_0x844e('0x33')](_0x54fd73[_0x844e('0x2f')],qs['fields'](_0x489349[_0x844e('0x30')][_0x844e('0x35')]));_0xc3ec93['attributes']=_0xc3ec93[_0x844e('0x34')][_0x844e('0x36')]?_0xc3ec93['attributes']:_0x54fd73[_0x844e('0x2f')];if(!_0x489349[_0x844e('0x30')][_0x844e('0x37')](_0x844e('0x38'))){_0xc3ec93[_0x844e('0x1e')]=qs[_0x844e('0x1e')](_0x489349[_0x844e('0x30')]['limit']);_0xc3ec93[_0x844e('0x1c')]=qs[_0x844e('0x1c')](_0x489349[_0x844e('0x30')][_0x844e('0x1c')]);}_0xc3ec93[_0x844e('0x39')]=qs[_0x844e('0x3a')](_0x489349[_0x844e('0x30')][_0x844e('0x3a')]);_0xc3ec93[_0x844e('0x3b')]=qs[_0x844e('0x32')](_[_0x844e('0x3c')](_0x489349['query'],_0x54fd73['filters']),_0x81d4de);if(_0x489349[_0x844e('0x30')][_0x844e('0x3d')]){_0xc3ec93[_0x844e('0x3b')]=_[_0x844e('0x3e')](_0xc3ec93[_0x844e('0x3b')],{'$or':_[_0x844e('0x29')](_0x81d4de,function(_0x6f902e){if(_0x6f902e[_0x844e('0x2d')]!==_0x844e('0x3f')){var _0x539077={};_0x539077[_0x6f902e[_0x844e('0x27')]]={'$like':'%'+_0x489349['query'][_0x844e('0x3d')]+'%'};return _0x539077;}})});}_0xc3ec93=_['merge']({},_0xc3ec93,_0x489349[_0x844e('0x40')]);var _0x5dc530={'where':_0xc3ec93[_0x844e('0x3b')]};return db[_0x844e('0x2a')][_0x844e('0x41')](_0x5dc530)[_0x844e('0x23')](function(_0x2eb412){_0x228cc1[_0x844e('0x41')]=_0x2eb412;if(_0x489349[_0x844e('0x30')][_0x844e('0x42')]){_0xc3ec93[_0x844e('0x43')]=[{'all':!![]}];}return db[_0x844e('0x2a')][_0x844e('0x44')](_0xc3ec93);})['then'](function(_0x3ecb60){_0x228cc1[_0x844e('0x45')]=_0x3ecb60;return _0x228cc1;})[_0x844e('0x23')](respondWithFilteredResult(_0x2d4acd,_0xc3ec93))['catch'](handleError(_0x2d4acd,null));};exports['show']=function(_0x213a9f,_0x3e24ca){var _0x1a7817={'raw':!![],'where':{'id':_0x213a9f['params']['id']}},_0x5d8cd9={};_0x5d8cd9['model']=_['keys'](db[_0x844e('0x2a')][_0x844e('0x2b')]);_0x5d8cd9[_0x844e('0x30')]=_[_0x844e('0x31')](_0x213a9f[_0x844e('0x30')]);_0x5d8cd9['filters']=_[_0x844e('0x33')](_0x5d8cd9['model'],_0x5d8cd9['query']);_0x1a7817[_0x844e('0x34')]=_[_0x844e('0x33')](_0x5d8cd9[_0x844e('0x2f')],qs[_0x844e('0x35')](_0x213a9f['query'][_0x844e('0x35')]));_0x1a7817[_0x844e('0x34')]=_0x1a7817[_0x844e('0x34')]['length']?_0x1a7817[_0x844e('0x34')]:_0x5d8cd9[_0x844e('0x2f')];if(_0x213a9f['query'][_0x844e('0x42')]){_0x1a7817[_0x844e('0x43')]=[{'all':!![]}];}_0x1a7817=_[_0x844e('0x3e')]({},_0x1a7817,_0x213a9f[_0x844e('0x40')]);return db[_0x844e('0x2a')][_0x844e('0x46')](_0x1a7817)['then'](handleEntityNotFound(_0x3e24ca,null))[_0x844e('0x23')](respondWithResult(_0x3e24ca,null))[_0x844e('0x47')](handleError(_0x3e24ca,null));};exports[_0x844e('0x48')]=function(_0x29dd8b,_0x1dcfcb){return db[_0x844e('0x2a')][_0x844e('0x48')](_0x29dd8b[_0x844e('0x49')],{})[_0x844e('0x23')](respondWithResult(_0x1dcfcb,0xc9))[_0x844e('0x47')](handleError(_0x1dcfcb,null));};exports['update']=function(_0x32e097,_0x694791){if(_0x32e097[_0x844e('0x49')]['id']){delete _0x32e097['body']['id'];}return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x32e097[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x694791,null))[_0x844e('0x23')](saveUpdates(_0x32e097[_0x844e('0x49')],null))[_0x844e('0x23')](respondWithResult(_0x694791,null))['catch'](handleError(_0x694791,null));};exports[_0x844e('0x24')]=function(_0x3c680c,_0x43e1f5){return db[_0x844e('0x2a')][_0x844e('0x46')]({'where':{'id':_0x3c680c[_0x844e('0x4a')]['id']}})[_0x844e('0x23')](handleEntityNotFound(_0x43e1f5,null))[_0x844e('0x23')](removeEntity(_0x43e1f5,null))[_0x844e('0x47')](handleError(_0x43e1f5,null));};exports[_0x844e('0x4b')]=function(_0x3af2fe,_0x1dda1d){return db[_0x844e('0x2a')]['describe']()[_0x844e('0x23')](respondWithResult(_0x1dda1d,null))[_0x844e('0x47')](handleError(_0x1dda1d,null));};
\ No newline at end of file
index 4f896da..b257cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf261=['lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','define','JscriptyAnswerReport','report_jscripty_answers'];(function(_0x3738d8,_0x190462){var _0x5849ae=function(_0x4f7b95){while(--_0x4f7b95){_0x3738d8['push'](_0x3738d8['shift']());}};_0x5849ae(++_0x190462);}(_0xf261,0x132));var _0x1f26=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf261[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x1f26('0x0'));var util=require('util');var logger=require(_0x1f26('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1f26('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f26('0x3'));var rimraf=require(_0x1f26('0x4'));var config=require(_0x1f26('0x5'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x473afd,_0x53310a){return _0x473afd[_0x1f26('0x6')](_0x1f26('0x7'),attributes,{'tableName':_0x1f26('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x934d=['./jscriptyAnswerReport.attributes','JscriptyAnswerReport','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x934d,0xc8));var _0xd934=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x934d[_0x126558];return _0x1f6d14;};'use strict';var _=require('lodash');var util=require(_0xd934('0x0'));var logger=require('../../config/logger')(_0xd934('0x1'));var moment=require(_0xd934('0x2'));var BPromise=require(_0xd934('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd934('0x4'));var rimraf=require(_0xd934('0x5'));var config=require(_0xd934('0x6'));var attributes=require(_0xd934('0x7'));module['exports']=function(_0x1c0131,_0x17d11d){return _0x1c0131['define'](_0xd934('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 094f249..fd4323f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a30=['jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x43b584,_0x20a6bd){var _0x48f27b=function(_0x1eeb77){while(--_0x1eeb77){_0x43b584['push'](_0x43b584['shift']());}};_0x48f27b(++_0x20a6bd);}(_0x3a30,0xd2));var _0x03a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3a30[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x03a3('0x0'));var util=require(_0x03a3('0x1'));var moment=require('moment');var BPromise=require(_0x03a3('0x2'));var rs=require(_0x03a3('0x3'));var fs=require('fs');var Redis=require(_0x03a3('0x4'));var db=require(_0x03a3('0x5'))['db'];var utils=require(_0x03a3('0x6'));var logger=require(_0x03a3('0x7'))(_0x03a3('0x8'));var config=require(_0x03a3('0x9'));var jayson=require(_0x03a3('0xa'));var client=jayson['client'][_0x03a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x339f0c,_0x489c53,_0x5c1b42){return new BPromise(function(_0x4d8601,_0x630ee9){return client[_0x03a3('0xc')](_0x339f0c,_0x5c1b42)[_0x03a3('0xd')](function(_0x2acb0c){logger[_0x03a3('0xe')](_0x03a3('0xf'),_0x489c53,_0x03a3('0x10'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x489c53,_0x03a3('0x10'),JSON['stringify'](_0x2acb0c));if(_0x2acb0c['error']){if(_0x2acb0c[_0x03a3('0x11')][_0x03a3('0x12')]===0x1f4){logger['error'](_0x03a3('0xf'),_0x489c53,_0x2acb0c[_0x03a3('0x11')][_0x03a3('0x13')]);return _0x630ee9(_0x2acb0c['error']['message']);}logger[_0x03a3('0x11')](_0x03a3('0xf'),_0x489c53,_0x2acb0c[_0x03a3('0x11')][_0x03a3('0x13')]);return _0x4d8601(_0x2acb0c[_0x03a3('0x11')][_0x03a3('0x13')]);}else{logger[_0x03a3('0xe')](_0x03a3('0xf'),_0x489c53,_0x03a3('0x10'));_0x4d8601(_0x2acb0c[_0x03a3('0x14')][_0x03a3('0x13')]);}})[_0x03a3('0x15')](function(_0x2a8481){logger[_0x03a3('0x11')](_0x03a3('0xf'),_0x489c53,_0x2a8481);_0x630ee9(_0x2a8481);});});}
\ No newline at end of file
+var _0x112c=['stringify','code','error','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x3f68c2,_0x39ce2a){var _0x3f614f=function(_0x132c96){while(--_0x132c96){_0x3f68c2['push'](_0x3f68c2['shift']());}};_0x3f614f(++_0x39ce2a);}(_0x112c,0x13f));var _0xc112=function(_0x5c600a,_0x26b0b2){_0x5c600a=_0x5c600a-0x0;var _0x3f3af7=_0x112c[_0x5c600a];return _0x3f3af7;};'use strict';var _=require(_0xc112('0x0'));var util=require(_0xc112('0x1'));var moment=require(_0xc112('0x2'));var BPromise=require('bluebird');var rs=require(_0xc112('0x3'));var fs=require('fs');var Redis=require(_0xc112('0x4'));var db=require(_0xc112('0x5'))['db'];var utils=require(_0xc112('0x6'));var logger=require('../../config/logger')(_0xc112('0x7'));var config=require(_0xc112('0x8'));var jayson=require(_0xc112('0x9'));var client=jayson[_0xc112('0xa')][_0xc112('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x301931,_0x4a431e,_0x2d41bd){return new BPromise(function(_0x246a92,_0x1628cc){return client[_0xc112('0xc')](_0x301931,_0x2d41bd)[_0xc112('0xd')](function(_0x21a36b){logger[_0xc112('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4a431e,_0xc112('0xf'));logger[_0xc112('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x4a431e,_0xc112('0xf'),JSON[_0xc112('0x11')](_0x21a36b));if(_0x21a36b['error']){if(_0x21a36b['error'][_0xc112('0x12')]===0x1f4){logger[_0xc112('0x13')](_0xc112('0x14'),_0x4a431e,_0x21a36b[_0xc112('0x13')][_0xc112('0x15')]);return _0x1628cc(_0x21a36b[_0xc112('0x13')]['message']);}logger[_0xc112('0x13')](_0xc112('0x14'),_0x4a431e,_0x21a36b['error']['message']);return _0x246a92(_0x21a36b[_0xc112('0x13')][_0xc112('0x15')]);}else{logger[_0xc112('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x4a431e,_0xc112('0xf'));_0x246a92(_0x21a36b[_0xc112('0x16')][_0xc112('0x15')]);}})[_0xc112('0x17')](function(_0x141b4b){logger[_0xc112('0x13')](_0xc112('0x14'),_0x4a431e,_0x141b4b);_0x1628cc(_0x141b4b);});});}
\ No newline at end of file
index 6411420..345b5f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce1e=['get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','getAnswers','/:id/summary','getSummary','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3e2bd6,_0x46e4cf){var _0x596bc9=function(_0x2ee274){while(--_0x2ee274){_0x3e2bd6['push'](_0x3e2bd6['shift']());}};_0x596bc9(++_0x46e4cf);}(_0xce1e,0x13c));var _0xece1=function(_0x187b1a,_0x36f902){_0x187b1a=_0x187b1a-0x0;var _0x5ef318=_0xce1e[_0x187b1a];return _0x5ef318;};'use strict';var multer=require(_0xece1('0x0'));var util=require(_0xece1('0x1'));var path=require(_0xece1('0x2'));var timeout=require(_0xece1('0x3'));var express=require(_0xece1('0x4'));var router=express[_0xece1('0x5')]();var fs_extra=require(_0xece1('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xece1('0x7'));var config=require(_0xece1('0x8'));var controller=require('./jscriptyProject.controller');router[_0xece1('0x9')]('/',auth[_0xece1('0xa')](),controller[_0xece1('0xb')]);router[_0xece1('0x9')](_0xece1('0xc'),auth[_0xece1('0xa')](),controller[_0xece1('0xd')]);router['get'](_0xece1('0xe'),auth[_0xece1('0xa')](),controller[_0xece1('0xf')]);router[_0xece1('0x9')](_0xece1('0x10'),auth[_0xece1('0xa')](),controller[_0xece1('0x11')]);router[_0xece1('0x9')](_0xece1('0x12'),auth[_0xece1('0xa')](),timeout('30s'),controller[_0xece1('0x13')]);router[_0xece1('0x14')]('/',auth['isAuthenticated'](),controller[_0xece1('0x15')]);router[_0xece1('0x14')]('/:id/clone',auth[_0xece1('0xa')](),controller['clone']);router['put'](_0xece1('0xc'),auth['isAuthenticated'](),controller[_0xece1('0x16')]);router[_0xece1('0x17')](_0xece1('0xc'),auth[_0xece1('0xa')](),controller['destroy']);module[_0xece1('0x18')]=router;
\ No newline at end of file
+var _0x6708=['getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','get','show','/:id/sessions'];(function(_0x5c3e3a,_0x327010){var _0x1efc41=function(_0x4322ae){while(--_0x4322ae){_0x5c3e3a['push'](_0x5c3e3a['shift']());}};_0x1efc41(++_0x327010);}(_0x6708,0x1cd));var _0x8670=function(_0x9ea001,_0x2ae945){_0x9ea001=_0x9ea001-0x0;var _0x2c2a8e=_0x6708[_0x9ea001];return _0x2c2a8e;};'use strict';var multer=require('multer');var util=require(_0x8670('0x0'));var path=require(_0x8670('0x1'));var timeout=require(_0x8670('0x2'));var express=require(_0x8670('0x3'));var router=express[_0x8670('0x4')]();var fs_extra=require(_0x8670('0x5'));var auth=require(_0x8670('0x6'));var interaction=require(_0x8670('0x7'));var config=require(_0x8670('0x8'));var controller=require(_0x8670('0x9'));router['get']('/',auth[_0x8670('0xa')](),controller[_0x8670('0xb')]);router[_0x8670('0xc')]('/:id',auth[_0x8670('0xa')](),controller[_0x8670('0xd')]);router[_0x8670('0xc')](_0x8670('0xe'),auth[_0x8670('0xa')](),controller[_0x8670('0xf')]);router[_0x8670('0xc')]('/:id/answers',auth[_0x8670('0xa')](),controller[_0x8670('0x10')]);router[_0x8670('0xc')](_0x8670('0x11'),auth[_0x8670('0xa')](),timeout(_0x8670('0x12')),controller[_0x8670('0x13')]);router[_0x8670('0x14')]('/',auth['isAuthenticated'](),controller[_0x8670('0x15')]);router[_0x8670('0x14')](_0x8670('0x16'),auth[_0x8670('0xa')](),controller[_0x8670('0x17')]);router['put'](_0x8670('0x18'),auth[_0x8670('0xa')](),controller[_0x8670('0x19')]);router[_0x8670('0x1a')]('/:id',auth[_0x8670('0xa')](),controller[_0x8670('0x1b')]);module['exports']=router;
\ No newline at end of file
index ca55e88..7019d80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad92=['isObjectLike','stringify','isString','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','sequelize','util','STRING','TEXT','long'];(function(_0x41a457,_0x4a8e30){var _0x84b15f=function(_0x11868b){while(--_0x11868b){_0x41a457['push'](_0x41a457['shift']());}};_0x84b15f(++_0x4a8e30);}(_0xad92,0x79));var _0x2ad9=function(_0x2dfb31,_0x48f35b){_0x2dfb31=_0x2dfb31-0x0;var _0x1e951=_0xad92[_0x2dfb31];return _0x1e951;};'use strict';var Sequelize=require(_0x2ad9('0x0'));var _=require('lodash');var util=require(_0x2ad9('0x1'));module['exports']={'name':{'type':Sequelize[_0x2ad9('0x2')],'unique':'name'},'description':{'type':Sequelize[_0x2ad9('0x2')]},'formData':{'type':Sequelize[_0x2ad9('0x3')](_0x2ad9('0x4')),'set':function(_0x2950f1){if(_[_0x2ad9('0x5')](_0x2950f1)){this['setDataValue']('formData',JSON[_0x2ad9('0x6')](_0x2950f1));}else if(_[_0x2ad9('0x7')](_0x2950f1)){this['setDataValue']('formData',_0x2950f1);}else{this[_0x2ad9('0x8')](_0x2ad9('0x9'),util[_0x2ad9('0xa')](_0x2ad9('0xb'),this[_0x2ad9('0xc')]('name')||'',this[_0x2ad9('0xc')](_0x2ad9('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x220a=['getDataValue','sequelize','lodash','util','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','format'];(function(_0xf719b5,_0x146cba){var _0x2387d9=function(_0x5de20e){while(--_0x5de20e){_0xf719b5['push'](_0xf719b5['shift']());}};_0x2387d9(++_0x146cba);}(_0x220a,0x175));var _0xa220=function(_0xd1dda6,_0x17a5f2){_0xd1dda6=_0xd1dda6-0x0;var _0x588837=_0x220a[_0xd1dda6];return _0x588837;};'use strict';var Sequelize=require(_0xa220('0x0'));var _=require(_0xa220('0x1'));var util=require(_0xa220('0x2'));module['exports']={'name':{'type':Sequelize[_0xa220('0x3')],'unique':_0xa220('0x4')},'description':{'type':Sequelize[_0xa220('0x3')]},'formData':{'type':Sequelize[_0xa220('0x5')](_0xa220('0x6')),'set':function(_0x334cc4){if(_[_0xa220('0x7')](_0x334cc4)){this[_0xa220('0x8')]('formData',JSON['stringify'](_0x334cc4));}else if(_['isString'](_0x334cc4)){this[_0xa220('0x8')](_0xa220('0x9'),_0x334cc4);}else{this['setDataValue'](_0xa220('0x9'),util[_0xa220('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xa220('0xb')](_0xa220('0x4'))||'',this[_0xa220('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index 6d13c21..1c96e35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eae=['pick','where','VIRTUAL','filter','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','userProfileId','autoAssociation','getSessions','findOne','JscriptySessionReport','order','JscriptyAnswerReport','ProjectId','toString','indexOf','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','Projects','end','error','stack','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x10d1d3,_0x39210d){var _0x37c172=function(_0x46a102){while(--_0x46a102){_0x10d1d3['push'](_0x10d1d3['shift']());}};_0x37c172(++_0x39210d);}(_0x3eae,0x126));var _0xe3ea=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x3eae[_0x2cfb48];return _0xc4594f;};'use strict';var emlformat=require(_0xe3ea('0x0'));var rimraf=require(_0xe3ea('0x1'));var zipdir=require(_0xe3ea('0x2'));var jsonpatch=require(_0xe3ea('0x3'));var rp=require('request-promise');var moment=require(_0xe3ea('0x4'));var BPromise=require(_0xe3ea('0x5'));var Mustache=require('mustache');var util=require(_0xe3ea('0x6'));var path=require(_0xe3ea('0x7'));var sox=require(_0xe3ea('0x8'));var csv=require('to-csv');var ejs=require(_0xe3ea('0x9'));var fs=require('fs');var fs_extra=require(_0xe3ea('0xa'));var _=require(_0xe3ea('0xb'));var squel=require(_0xe3ea('0xc'));var crypto=require(_0xe3ea('0xd'));var jsforce=require(_0xe3ea('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe3ea('0xf'));var querystring=require(_0xe3ea('0x10'));var Papa=require('papaparse');var Redis=require(_0xe3ea('0x11'));var authService=require(_0xe3ea('0x12'));var qs=require(_0xe3ea('0x13'));var as=require(_0xe3ea('0x14'));var hardwareService=require(_0xe3ea('0x15'));var logger=require('../../config/logger')(_0xe3ea('0x16'));var utils=require(_0xe3ea('0x17'));var config=require(_0xe3ea('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe3ea('0x19'))['db'];function respondWithStatusCode(_0x3fa991,_0x470912){_0x470912=_0x470912||0xcc;return function(_0x1312e0){if(_0x1312e0){return _0x3fa991[_0xe3ea('0x1a')](_0x470912);}return _0x3fa991[_0xe3ea('0x1b')](_0x470912)['end']();};}function respondWithResult(_0x544dfe,_0x1701d3){_0x1701d3=_0x1701d3||0xc8;return function(_0x335689){if(_0x335689){return _0x544dfe[_0xe3ea('0x1b')](_0x1701d3)[_0xe3ea('0x1c')](_0x335689);}};}function respondWithFilteredResult(_0x45ba02,_0x4ac0ea){return function(_0x4c92b2){if(_0x4c92b2){var _0x27885e=typeof _0x4ac0ea[_0xe3ea('0x1d')]==='undefined'&&typeof _0x4ac0ea[_0xe3ea('0x1e')]===_0xe3ea('0x1f');var _0x4af35e=_0x4c92b2['count'];var _0x2af916=_0x27885e?0x0:_0x4ac0ea[_0xe3ea('0x1d')];var _0x417b88=_0x27885e?_0x4c92b2[_0xe3ea('0x20')]:_0x4ac0ea[_0xe3ea('0x1d')]+_0x4ac0ea[_0xe3ea('0x1e')];var _0x4d611a;if(_0x417b88>=_0x4af35e){_0x417b88=_0x4af35e;_0x4d611a=0xc8;}else{_0x4d611a=0xce;}_0x45ba02['status'](_0x4d611a);return _0x45ba02[_0xe3ea('0x21')]('Content-Range',_0x2af916+'-'+_0x417b88+'/'+_0x4af35e)['json'](_0x4c92b2);}return null;};}function patchUpdates(_0xcbb4db){return function(_0xe8e88){try{jsonpatch[_0xe3ea('0x22')](_0xe8e88,_0xcbb4db,!![]);}catch(_0x181720){return BPromise[_0xe3ea('0x23')](_0x181720);}return _0xe8e88[_0xe3ea('0x24')]();};}function saveUpdates(_0x161c0e,_0x2f763b){return function(_0x342192){if(_0x342192){return _0x342192[_0xe3ea('0x25')](_0x161c0e)[_0xe3ea('0x26')](function(_0x37be78){return _0x37be78;});}return null;};}function removeEntity(_0x196fac,_0x580da3){return function(_0x3f728c){if(_0x3f728c){return _0x3f728c[_0xe3ea('0x27')]()[_0xe3ea('0x26')](function(){var _0x21082d=_0x3f728c[_0xe3ea('0x28')]({'plain':!![]});var _0x3c7131=_0xe3ea('0x29');return db['UserProfileResource'][_0xe3ea('0x27')]({'where':{'type':_0x3c7131,'resourceId':_0x21082d['id']}})[_0xe3ea('0x26')](function(){return _0x3f728c;});})['then'](function(){_0x196fac[_0xe3ea('0x1b')](0xcc)[_0xe3ea('0x2a')]();});}};}function handleEntityNotFound(_0x218dcb,_0x30c2be){return function(_0x54bc71){if(!_0x54bc71){_0x218dcb['sendStatus'](0x194);}return _0x54bc71;};}function handleError(_0x3e9c65,_0x4df0aa){_0x4df0aa=_0x4df0aa||0x1f4;return function(_0x3032b1){logger[_0xe3ea('0x2b')](_0x3032b1[_0xe3ea('0x2c')]);if(_0x3032b1['name']){delete _0x3032b1[_0xe3ea('0x2d')];}_0x3e9c65['status'](_0x4df0aa)[_0xe3ea('0x2e')](_0x3032b1);};}exports[_0xe3ea('0x2f')]=function(_0x45a01b,_0x530948){var _0x451cfe={},_0x56be4a={},_0x264e44={'count':0x0,'rows':[]};var _0x1f4685=_[_0xe3ea('0x30')](db[_0xe3ea('0x31')]['rawAttributes'],function(_0x4bf1fa){return{'name':_0x4bf1fa[_0xe3ea('0x32')],'type':_0x4bf1fa[_0xe3ea('0x33')][_0xe3ea('0x34')]};});_0x56be4a[_0xe3ea('0x35')]=_[_0xe3ea('0x30')](_0x1f4685,'name');_0x56be4a[_0xe3ea('0x36')]=_['keys'](_0x45a01b['query']);_0x56be4a[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x56be4a['model'],_0x56be4a['query']);_0x451cfe[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x56be4a[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x451cfe['attributes']=_0x451cfe[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x451cfe[_0xe3ea('0x39')]:_0x56be4a[_0xe3ea('0x35')];if(!_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x451cfe[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0x451cfe[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x45a01b[_0xe3ea('0x36')]['offset']);}_0x451cfe['order']=qs[_0xe3ea('0x3e')](_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x451cfe['where']=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x45a01b[_0xe3ea('0x36')],_0x56be4a[_0xe3ea('0x37')]),_0x1f4685);if(_0x45a01b[_0xe3ea('0x36')]['filter']){_0x451cfe[_0xe3ea('0x40')]=_['merge'](_0x451cfe['where'],{'$or':_[_0xe3ea('0x30')](_0x1f4685,function(_0xc675ce){if(_0xc675ce[_0xe3ea('0x33')]!==_0xe3ea('0x41')){var _0x235a64={};_0x235a64[_0xc675ce[_0xe3ea('0x2d')]]={'$like':'%'+_0x45a01b[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0x235a64;}})});}_0x451cfe=_['merge']({},_0x451cfe,_0x45a01b['options']);var _0x2f5533={'where':_0x451cfe[_0xe3ea('0x40')]};return db[_0xe3ea('0x31')]['count'](_0x2f5533)[_0xe3ea('0x26')](function(_0x58df4e){_0x264e44[_0xe3ea('0x20')]=_0x58df4e;if(_0x45a01b[_0xe3ea('0x36')]['includeAll']){_0x451cfe['include']=[{'all':!![]}];}return db[_0xe3ea('0x31')][_0xe3ea('0x43')](_0x451cfe);})[_0xe3ea('0x26')](function(_0x5d18ec){_0x264e44[_0xe3ea('0x44')]=_0x5d18ec;return _0x264e44;})['then'](respondWithFilteredResult(_0x530948,_0x451cfe))[_0xe3ea('0x45')](handleError(_0x530948,null));};exports[_0xe3ea('0x46')]=function(_0x4c3f20,_0x34fd9c){var _0x536d73={'raw':![],'where':{'id':_0x4c3f20[_0xe3ea('0x47')]['id']}},_0x4fa668={};_0x4fa668[_0xe3ea('0x35')]=_[_0xe3ea('0x48')](db[_0xe3ea('0x31')][_0xe3ea('0x49')]);_0x4fa668[_0xe3ea('0x36')]=_[_0xe3ea('0x48')](_0x4c3f20['query']);_0x4fa668[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x4fa668['model'],_0x4fa668[_0xe3ea('0x36')]);_0x536d73[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x4fa668[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x4c3f20['query'][_0xe3ea('0x3a')]));_0x536d73[_0xe3ea('0x39')]=_0x536d73[_0xe3ea('0x39')]['length']?_0x536d73['attributes']:_0x4fa668['model'];if(_0x4c3f20[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x536d73['include']=[{'all':!![]}];}_0x536d73=_[_0xe3ea('0x4b')]({},_0x536d73,_0x4c3f20[_0xe3ea('0x4c')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4d')](_0x536d73)[_0xe3ea('0x26')](handleEntityNotFound(_0x34fd9c,null))[_0xe3ea('0x26')](respondWithResult(_0x34fd9c,null))['catch'](handleError(_0x34fd9c,null));};exports[_0xe3ea('0x4e')]=function(_0x4d71a9,_0x3b9e62){return db['JscriptyProject'][_0xe3ea('0x4e')](_0x4d71a9[_0xe3ea('0x4f')],{})['then'](function(_0xb69b73){var _0x3263ea=_0x4d71a9[_0xe3ea('0x50')][_0xe3ea('0x28')]({'plain':!![]});if(!_0x3263ea)throw new Error(_0xe3ea('0x51'));if(_0x3263ea[_0xe3ea('0x52')]===_0xe3ea('0x50')){var _0x41c1a7=_0xb69b73[_0xe3ea('0x28')]({'plain':!![]});var _0x4008e6=_0xe3ea('0x29');return db[_0xe3ea('0x53')][_0xe3ea('0x4d')]({'where':{'name':_0x4008e6,'userProfileId':_0x3263ea['userProfileId']},'raw':!![]})[_0xe3ea('0x26')](function(_0x348939){if(_0x348939&&_0x348939['autoAssociation']===0x0){return db[_0xe3ea('0x54')][_0xe3ea('0x4e')]({'name':_0x41c1a7[_0xe3ea('0x2d')],'resourceId':_0x41c1a7['id'],'type':_0x348939[_0xe3ea('0x2d')],'sectionId':_0x348939['id']},{})[_0xe3ea('0x26')](function(){return _0xb69b73;});}else{return _0xb69b73;}})[_0xe3ea('0x45')](function(_0x2a39fa){logger['error'](_0xe3ea('0x55'),_0x2a39fa);throw _0x2a39fa;});}return _0xb69b73;})[_0xe3ea('0x26')](respondWithResult(_0x3b9e62,0xc9))[_0xe3ea('0x45')](handleError(_0x3b9e62,null));};exports[_0xe3ea('0x56')]=function(_0x3ff403,_0x11cef2){var _0x29b170={'where':{'id':_0x3ff403[_0xe3ea('0x47')]['id']}},_0x3742ab={};_0x3742ab['model']=_['keys'](db[_0xe3ea('0x31')][_0xe3ea('0x49')]);_0x29b170[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x3742ab[_0xe3ea('0x35')],qs[_0xe3ea('0x3a')](_0x3ff403[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x29b170[_0xe3ea('0x39')]=_0x29b170['attributes'][_0xe3ea('0x3b')]?_0x29b170[_0xe3ea('0x39')]:_0x3742ab[_0xe3ea('0x35')];if(_0x3ff403['query'][_0xe3ea('0x4a')]){_0x29b170[_0xe3ea('0x57')]=[{'all':!![]}];}_0x29b170=_['merge']({},_0x29b170,_0x3ff403[_0xe3ea('0x4c')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4d')](_0x29b170)[_0xe3ea('0x26')](handleEntityNotFound(_0x11cef2,null))['then'](function(_0xf41294){if(_0xf41294){var _0x21240c=_0xf41294[_0xe3ea('0x28')]({'plain':!![]});_0x21240c=qs[_0xe3ea('0x58')](_0x21240c,['id','createdAt','updatedAt']);_0x3ff403[_0xe3ea('0x4f')]=_[_0xe3ea('0x58')](_0x3ff403[_0xe3ea('0x4f')],['id',_0xe3ea('0x59'),_0xe3ea('0x5a')]);return db[_0xe3ea('0x31')][_0xe3ea('0x4e')](_['merge'](_0x21240c,_0x3ff403['body']),{'include':_0x3ff403[_0xe3ea('0x36')][_0xe3ea('0x4a')]?[{'all':!![]}]:undefined})[_0xe3ea('0x26')](function(_0x28121f){var _0x5abbd9=_0x3ff403[_0xe3ea('0x50')][_0xe3ea('0x28')]({'plain':!![]});if(!_0x5abbd9)throw new Error(_0xe3ea('0x51'));if(_0x5abbd9['role']===_0xe3ea('0x50')){var _0x1e9f1e=_0x28121f['get']({'plain':!![]});var _0x4df5ac='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x4df5ac,'userProfileId':_0x5abbd9[_0xe3ea('0x5b')]},'raw':!![]})[_0xe3ea('0x26')](function(_0x3d14be){if(_0x3d14be&&_0x3d14be[_0xe3ea('0x5c')]===0x0){return db[_0xe3ea('0x54')]['create']({'name':_0x1e9f1e[_0xe3ea('0x2d')],'resourceId':_0x1e9f1e['id'],'type':_0x3d14be['name'],'sectionId':_0x3d14be['id']},{})[_0xe3ea('0x26')](function(){return _0x28121f;});}else{return _0x28121f;}})[_0xe3ea('0x45')](function(_0x53dd48){logger[_0xe3ea('0x2b')](_0xe3ea('0x55'),_0x53dd48);throw _0x53dd48;});}return _0x28121f;});}})['then'](respondWithResult(_0x11cef2,0xc9))[_0xe3ea('0x45')](handleError(_0x11cef2,null));};exports[_0xe3ea('0x25')]=function(_0x3179e4,_0x5a7222){if(_0x3179e4[_0xe3ea('0x4f')]['id']){delete _0x3179e4[_0xe3ea('0x4f')]['id'];}return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0x3179e4[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x5a7222,null))[_0xe3ea('0x26')](saveUpdates(_0x3179e4[_0xe3ea('0x4f')],null))[_0xe3ea('0x26')](respondWithResult(_0x5a7222,null))[_0xe3ea('0x45')](handleError(_0x5a7222,null));};exports['destroy']=function(_0x33d7f8,_0x137ade){return db[_0xe3ea('0x31')][_0xe3ea('0x4d')]({'where':{'id':_0x33d7f8[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x137ade,null))[_0xe3ea('0x26')](removeEntity(_0x137ade,null))[_0xe3ea('0x45')](handleError(_0x137ade,null));};exports[_0xe3ea('0x5d')]=function(_0x30d733,_0x4a7882,_0x372ff5){var _0x3007a5={'raw':!![],'where':{}};var _0x4cb1c3={};var _0x4b9b1a={'count':0x0,'rows':[]};return db[_0xe3ea('0x31')][_0xe3ea('0x5e')]({'where':{'id':_0x30d733[_0xe3ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x4a7882,null))[_0xe3ea('0x26')](function(_0x460cd3){if(_0x460cd3){_0x4cb1c3[_0xe3ea('0x35')]=_['keys'](db[_0xe3ea('0x5f')][_0xe3ea('0x49')]);_0x4cb1c3['query']=_['keys'](_0x30d733[_0xe3ea('0x36')]);_0x4cb1c3[_0xe3ea('0x37')]=_[_0xe3ea('0x38')](_0x4cb1c3[_0xe3ea('0x35')],_0x4cb1c3[_0xe3ea('0x36')]);_0x3007a5[_0xe3ea('0x39')]=_['intersection'](_0x4cb1c3['model'],qs[_0xe3ea('0x3a')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3a')]));_0x3007a5[_0xe3ea('0x39')]=_0x3007a5[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x3007a5[_0xe3ea('0x39')]:_0x4cb1c3[_0xe3ea('0x35')];if(!_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x3007a5[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x1e')]);_0x3007a5[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x30d733['query'][_0xe3ea('0x1d')]);}_0x3007a5[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x3007a5[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_['pick'](_0x30d733['query'],_0x4cb1c3[_0xe3ea('0x37')]));_0x3007a5[_0xe3ea('0x40')]['ProjectId']=_0x460cd3['id'];if(_0x30d733['query'][_0xe3ea('0x42')]){_0x3007a5[_0xe3ea('0x40')]=_['merge'](_0x3007a5['where'],{'$or':_['map'](_0x3007a5[_0xe3ea('0x39')],function(_0x3cabcb){var _0x4ccee8={};_0x4ccee8[_0x3cabcb]={'$like':'%'+_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x42')]+'%'};return _0x4ccee8;})});}_0x3007a5=_[_0xe3ea('0x4b')]({},_0x3007a5,_0x30d733['options']);return db[_0xe3ea('0x5f')][_0xe3ea('0x20')]({'where':_0x3007a5[_0xe3ea('0x40')]})['then'](function(_0x506491){_0x4b9b1a[_0xe3ea('0x20')]=_0x506491;if(_0x30d733[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x3007a5['include']=[{'all':!![]}];}return db[_0xe3ea('0x5f')][_0xe3ea('0x43')](_0x3007a5);})[_0xe3ea('0x26')](function(_0x49143d){_0x4b9b1a['rows']=_0x49143d;return _0x4b9b1a;});}})[_0xe3ea('0x26')](respondWithFilteredResult(_0x4a7882,_0x3007a5))[_0xe3ea('0x45')](handleError(_0x4a7882,null));};exports['getAnswers']=function(_0x35f1fe,_0x1c2c03,_0x30ab5b){var _0x1967c3={'raw':!![],'where':{}};var _0x39280c={};var _0x38117c={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe3ea('0x5e')]({'where':{'id':_0x35f1fe[_0xe3ea('0x47')]['id']}})[_0xe3ea('0x26')](handleEntityNotFound(_0x1c2c03,null))[_0xe3ea('0x26')](function(_0x4db7ae){if(_0x4db7ae){_0x39280c['model']=_['keys'](db[_0xe3ea('0x61')][_0xe3ea('0x49')]);_0x39280c['query']=_[_0xe3ea('0x48')](_0x35f1fe[_0xe3ea('0x36')]);_0x39280c['filters']=_[_0xe3ea('0x38')](_0x39280c[_0xe3ea('0x35')],_0x39280c[_0xe3ea('0x36')]);_0x1967c3[_0xe3ea('0x39')]=_[_0xe3ea('0x38')](_0x39280c['model'],qs[_0xe3ea('0x3a')](_0x35f1fe['query'][_0xe3ea('0x3a')]));_0x1967c3[_0xe3ea('0x39')]=_0x1967c3[_0xe3ea('0x39')][_0xe3ea('0x3b')]?_0x1967c3[_0xe3ea('0x39')]:_0x39280c[_0xe3ea('0x35')];if(!_0x35f1fe['query'][_0xe3ea('0x3c')](_0xe3ea('0x3d'))){_0x1967c3[_0xe3ea('0x1e')]=qs[_0xe3ea('0x1e')](_0x35f1fe[_0xe3ea('0x36')]['limit']);_0x1967c3[_0xe3ea('0x1d')]=qs[_0xe3ea('0x1d')](_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x1d')]);}_0x1967c3[_0xe3ea('0x60')]=qs[_0xe3ea('0x3e')](_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x3e')]);_0x1967c3[_0xe3ea('0x40')]=qs[_0xe3ea('0x37')](_[_0xe3ea('0x3f')](_0x35f1fe[_0xe3ea('0x36')],_0x39280c['filters']));_0x1967c3['where'][_0xe3ea('0x62')]=_0x4db7ae['id'];if(_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x42')]){_0x1967c3[_0xe3ea('0x40')]=_[_0xe3ea('0x4b')](_0x1967c3[_0xe3ea('0x40')],{'$or':_['map'](_0x1967c3[_0xe3ea('0x39')],function(_0x436b03){var _0x9c714e={};_0x9c714e[_0x436b03]={'$like':'%'+_0x35f1fe['query']['filter']+'%'};return _0x9c714e;})});}_0x1967c3=_['merge']({},_0x1967c3,_0x35f1fe[_0xe3ea('0x4c')]);return db[_0xe3ea('0x61')][_0xe3ea('0x20')]({'where':_0x1967c3[_0xe3ea('0x40')]})[_0xe3ea('0x26')](function(_0x543de9){_0x38117c['count']=_0x543de9;if(_0x35f1fe[_0xe3ea('0x36')][_0xe3ea('0x4a')]){_0x1967c3[_0xe3ea('0x57')]=[{'all':!![]}];}return db[_0xe3ea('0x61')][_0xe3ea('0x43')](_0x1967c3);})[_0xe3ea('0x26')](function(_0x321baf){_0x38117c['rows']=_0x321baf;return _0x38117c;});}})[_0xe3ea('0x26')](respondWithFilteredResult(_0x1c2c03,_0x1967c3))[_0xe3ea('0x45')](handleError(_0x1c2c03,null));};function char(_0x1c2bc2){return'number'===typeof _0x1c2bc2?String['fromCharCode'][_0xe3ea('0x22')](null,arguments):_0x1c2bc2;}function needsEncapsulation(_0x2cd60d){return!!_0x2cd60d&&(_0x2cd60d[_0xe3ea('0x63')]()[_0xe3ea('0x64')](char(0xd))>=0x0||_0x2cd60d['toString']()[_0xe3ea('0x64')](char(0xa))>=0x0||_0x2cd60d['toString']()[_0xe3ea('0x64')](char(0x2c))>=0x0||_0x2cd60d[_0xe3ea('0x63')]()[_0xe3ea('0x64')](char(0x22))>=0x0);}function encapsulate(_0x32cf10){var _0x1594d6=char(0x22),_0x483bb3='\x5c'+char(0x22),_0x10afe6=_0x32cf10[_0xe3ea('0x63')]()['replace'](new RegExp(_0x1594d6,'g'),_0x483bb3);return _0x1594d6+_0x10afe6+_0x1594d6;}exports['getSummary']=function(_0x10a75a,_0x18f244,_0xcafc5f){var _0x3b0d3a,_0x23fc3e;var _0x509e5d={'where':{'ProjectId':_0x10a75a[_0xe3ea('0x47')]['id']}};if(_0x10a75a[_0xe3ea('0x36')][_0xe3ea('0x65')]){_0x509e5d['where'][_0xe3ea('0x66')]=JSON[_0xe3ea('0x67')](_0x10a75a[_0xe3ea('0x36')]['startTime']);}return db[_0xe3ea('0x5f')][_0xe3ea('0x43')](_0x509e5d)[_0xe3ea('0x26')](handleEntityNotFound(_0x18f244,null))[_0xe3ea('0x26')](function(_0x9b529f){if(_0x9b529f){_0x3b0d3a=_0x9b529f;return db[_0xe3ea('0x68')][_0xe3ea('0x43')]({'where':{'SessionId':{'$in':_[_0xe3ea('0x30')](_0x3b0d3a,'id')},'ProjectId':_0x10a75a['params']['id']},'order':'-createdAt'});}})[_0xe3ea('0x26')](handleEntityNotFound(_0x18f244,null))[_0xe3ea('0x26')](function(_0x1c3d22){if(_0x1c3d22){_0x23fc3e=_0x1c3d22;var _0xf423a5={};for(var _0x31dcef=0x0,_0x933189=_0x23fc3e['length'];_0x31dcef<_0x933189;_0x31dcef++){if(!_0xf423a5[_0xe3ea('0x3c')](_0x23fc3e[_0x31dcef][_0xe3ea('0x69')])){_0xf423a5[_0x23fc3e[_0x31dcef][_0xe3ea('0x69')]]=needsEncapsulation(_0x23fc3e[_0x31dcef][_0xe3ea('0x6a')])?encapsulate(_0x23fc3e[_0x31dcef][_0xe3ea('0x6a')]):_0x23fc3e[_0x31dcef][_0xe3ea('0x6a')];}}var _0x275d60=[],_0x493d58={};for(var _0x358e2e=0x0,_0x59c705=_0x3b0d3a[_0xe3ea('0x3b')];_0x358e2e<_0x59c705;_0x358e2e++){_0x493d58={'ProjectId':_0x10a75a[_0xe3ea('0x47')]['id'],'SessionId':_0x3b0d3a[_0x358e2e]['id'],'StartTime':moment(_0x3b0d3a[_0x358e2e][_0xe3ea('0x66')])[_0xe3ea('0x6b')](_0xe3ea('0x6c'))};for(var _0xc5f686=0x0,_0x34243b=_0x23fc3e[_0xe3ea('0x3b')];_0xc5f686<_0x34243b;_0xc5f686++){if(_0x23fc3e[_0xc5f686]['SessionId']==_0x3b0d3a[_0x358e2e]['id']&&_0xf423a5[_0xe3ea('0x3c')](_0x23fc3e[_0xc5f686][_0xe3ea('0x69')])){_0x493d58[_0xf423a5[_0x23fc3e[_0xc5f686][_0xe3ea('0x69')]]]=_0x23fc3e[_0xc5f686][_0xe3ea('0x6d')];}}for(var _0x558bc6 in _0xf423a5){if(!_0x493d58[_0xe3ea('0x3c')](_0xf423a5[_0x558bc6])){_0x493d58[_0xf423a5[_0x558bc6]]=null;}}_0x275d60['push'](_0x493d58);}return _0x275d60;}})['then'](function(_0x5a60d7){if(!_[_0xe3ea('0x6e')](_0x5a60d7)){var _0x4d453f=toCsv(_0x5a60d7);var _0x34128e=Date[_0xe3ea('0x6f')]();fs[_0xe3ea('0x70')](util[_0xe3ea('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x10a75a['params']['id'],_0x34128e),_0x4d453f);_0x18f244[_0xe3ea('0x71')](_0xe3ea('0x72'),_0xe3ea('0x73')+util[_0xe3ea('0x6b')](_0xe3ea('0x74'),_0x10a75a['params']['id'],_0x34128e));_0x18f244[_0xe3ea('0x71')](_0xe3ea('0x75'),'text/csv');return _0x18f244[_0xe3ea('0x76')](util[_0xe3ea('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x10a75a[_0xe3ea('0x47')]['id'],_0x34128e));}else{return _0x18f244[_0xe3ea('0x1a')](0xcc);}})[_0xe3ea('0x45')](handleError(_0x18f244,null));};
\ No newline at end of file
+var _0xc273=['stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','JscriptyProject','findAll','catch','show','params','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','merge','updatedAt','createdAt','Projects','autoAssociation','getSessions','findOne','pick','ProjectId','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','apply','update','then','destroy','get','UserProfileResource','end','error'];(function(_0x4454e7,_0x2e916a){var _0x4c2a56=function(_0x103efc){while(--_0x103efc){_0x4454e7['push'](_0x4454e7['shift']());}};_0x4c2a56(++_0x2e916a);}(_0xc273,0x137));var _0x3c27=function(_0x3b6648,_0x2d723a){_0x3b6648=_0x3b6648-0x0;var _0x5a0a0d=_0xc273[_0x3b6648];return _0x5a0a0d;};'use strict';var emlformat=require(_0x3c27('0x0'));var rimraf=require(_0x3c27('0x1'));var zipdir=require(_0x3c27('0x2'));var jsonpatch=require(_0x3c27('0x3'));var rp=require(_0x3c27('0x4'));var moment=require(_0x3c27('0x5'));var BPromise=require(_0x3c27('0x6'));var Mustache=require(_0x3c27('0x7'));var util=require(_0x3c27('0x8'));var path=require(_0x3c27('0x9'));var sox=require('sox');var csv=require(_0x3c27('0xa'));var ejs=require(_0x3c27('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c27('0xc'));var squel=require(_0x3c27('0xd'));var crypto=require(_0x3c27('0xe'));var jsforce=require(_0x3c27('0xf'));var deskjs=require(_0x3c27('0x10'));var toCsv=require(_0x3c27('0xa'));var querystring=require(_0x3c27('0x11'));var Papa=require(_0x3c27('0x12'));var Redis=require(_0x3c27('0x13'));var authService=require(_0x3c27('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x3c27('0x15'));var hardwareService=require(_0x3c27('0x16'));var logger=require(_0x3c27('0x17'))(_0x3c27('0x18'));var utils=require('../../config/utils');var config=require(_0x3c27('0x19'));var licenseUtil=require(_0x3c27('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24fe22,_0x529147){_0x529147=_0x529147||0xcc;return function(_0x5da394){if(_0x5da394){return _0x24fe22[_0x3c27('0x1b')](_0x529147);}return _0x24fe22['status'](_0x529147)['end']();};}function respondWithResult(_0x463db0,_0x169a85){_0x169a85=_0x169a85||0xc8;return function(_0x1359d5){if(_0x1359d5){return _0x463db0[_0x3c27('0x1c')](_0x169a85)['json'](_0x1359d5);}};}function respondWithFilteredResult(_0x326314,_0x44c9d1){return function(_0x15d97e){if(_0x15d97e){var _0x5db456=typeof _0x44c9d1[_0x3c27('0x1d')]===_0x3c27('0x1e')&&typeof _0x44c9d1[_0x3c27('0x1f')]==='undefined';var _0x5f4b4f=_0x15d97e[_0x3c27('0x20')];var _0x21a214=_0x5db456?0x0:_0x44c9d1[_0x3c27('0x1d')];var _0x4526eb=_0x5db456?_0x15d97e[_0x3c27('0x20')]:_0x44c9d1[_0x3c27('0x1d')]+_0x44c9d1[_0x3c27('0x1f')];var _0x5d8f36;if(_0x4526eb>=_0x5f4b4f){_0x4526eb=_0x5f4b4f;_0x5d8f36=0xc8;}else{_0x5d8f36=0xce;}_0x326314[_0x3c27('0x1c')](_0x5d8f36);return _0x326314[_0x3c27('0x21')]('Content-Range',_0x21a214+'-'+_0x4526eb+'/'+_0x5f4b4f)[_0x3c27('0x22')](_0x15d97e);}return null;};}function patchUpdates(_0x2d0d9a){return function(_0x1e2b8f){try{jsonpatch[_0x3c27('0x23')](_0x1e2b8f,_0x2d0d9a,!![]);}catch(_0x1d9c90){return BPromise['reject'](_0x1d9c90);}return _0x1e2b8f['save']();};}function saveUpdates(_0x5826ea,_0x4130d4){return function(_0x27a218){if(_0x27a218){return _0x27a218[_0x3c27('0x24')](_0x5826ea)[_0x3c27('0x25')](function(_0x367c61){return _0x367c61;});}return null;};}function removeEntity(_0x4cfd76,_0x254084){return function(_0x1a3dd7){if(_0x1a3dd7){return _0x1a3dd7[_0x3c27('0x26')]()['then'](function(){var _0x53de8d=_0x1a3dd7[_0x3c27('0x27')]({'plain':!![]});var _0x534917='Projects';return db[_0x3c27('0x28')][_0x3c27('0x26')]({'where':{'type':_0x534917,'resourceId':_0x53de8d['id']}})[_0x3c27('0x25')](function(){return _0x1a3dd7;});})[_0x3c27('0x25')](function(){_0x4cfd76[_0x3c27('0x1c')](0xcc)[_0x3c27('0x29')]();});}};}function handleEntityNotFound(_0x581093,_0x49946e){return function(_0x1eb103){if(!_0x1eb103){_0x581093[_0x3c27('0x1b')](0x194);}return _0x1eb103;};}function handleError(_0x305f96,_0x1436e4){_0x1436e4=_0x1436e4||0x1f4;return function(_0x3376b6){logger[_0x3c27('0x2a')](_0x3376b6[_0x3c27('0x2b')]);if(_0x3376b6[_0x3c27('0x2c')]){delete _0x3376b6[_0x3c27('0x2c')];}_0x305f96[_0x3c27('0x1c')](_0x1436e4)[_0x3c27('0x2d')](_0x3376b6);};}exports[_0x3c27('0x2e')]=function(_0x2f04e9,_0x5c709a){var _0x3b458c={},_0x23444b={},_0x301473={'count':0x0,'rows':[]};var _0x2261e9=_[_0x3c27('0x2f')](db['JscriptyProject'][_0x3c27('0x30')],function(_0x16cdfc){return{'name':_0x16cdfc['fieldName'],'type':_0x16cdfc[_0x3c27('0x31')][_0x3c27('0x32')]};});_0x23444b[_0x3c27('0x33')]=_[_0x3c27('0x2f')](_0x2261e9,_0x3c27('0x2c'));_0x23444b['query']=_[_0x3c27('0x34')](_0x2f04e9['query']);_0x23444b[_0x3c27('0x35')]=_[_0x3c27('0x36')](_0x23444b[_0x3c27('0x33')],_0x23444b[_0x3c27('0x37')]);_0x3b458c['attributes']=_[_0x3c27('0x36')](_0x23444b[_0x3c27('0x33')],qs['fields'](_0x2f04e9[_0x3c27('0x37')][_0x3c27('0x38')]));_0x3b458c[_0x3c27('0x39')]=_0x3b458c[_0x3c27('0x39')][_0x3c27('0x3a')]?_0x3b458c[_0x3c27('0x39')]:_0x23444b[_0x3c27('0x33')];if(!_0x2f04e9[_0x3c27('0x37')][_0x3c27('0x3b')](_0x3c27('0x3c'))){_0x3b458c[_0x3c27('0x1f')]=qs[_0x3c27('0x1f')](_0x2f04e9[_0x3c27('0x37')][_0x3c27('0x1f')]);_0x3b458c[_0x3c27('0x1d')]=qs['offset'](_0x2f04e9[_0x3c27('0x37')]['offset']);}_0x3b458c[_0x3c27('0x3d')]=qs['sort'](_0x2f04e9['query'][_0x3c27('0x3e')]);_0x3b458c['where']=qs['filters'](_['pick'](_0x2f04e9[_0x3c27('0x37')],_0x23444b[_0x3c27('0x35')]),_0x2261e9);if(_0x2f04e9[_0x3c27('0x37')][_0x3c27('0x3f')]){_0x3b458c[_0x3c27('0x40')]=_['merge'](_0x3b458c[_0x3c27('0x40')],{'$or':_[_0x3c27('0x2f')](_0x2261e9,function(_0x2ed7af){if(_0x2ed7af[_0x3c27('0x31')]!==_0x3c27('0x41')){var _0x5a882f={};_0x5a882f[_0x2ed7af[_0x3c27('0x2c')]]={'$like':'%'+_0x2f04e9[_0x3c27('0x37')][_0x3c27('0x3f')]+'%'};return _0x5a882f;}})});}_0x3b458c=_['merge']({},_0x3b458c,_0x2f04e9['options']);var _0x1285c8={'where':_0x3b458c[_0x3c27('0x40')]};return db['JscriptyProject'][_0x3c27('0x20')](_0x1285c8)[_0x3c27('0x25')](function(_0x12f756){_0x301473[_0x3c27('0x20')]=_0x12f756;if(_0x2f04e9[_0x3c27('0x37')]['includeAll']){_0x3b458c['include']=[{'all':!![]}];}return db[_0x3c27('0x42')][_0x3c27('0x43')](_0x3b458c);})[_0x3c27('0x25')](function(_0x1b4e2a){_0x301473['rows']=_0x1b4e2a;return _0x301473;})[_0x3c27('0x25')](respondWithFilteredResult(_0x5c709a,_0x3b458c))[_0x3c27('0x44')](handleError(_0x5c709a,null));};exports[_0x3c27('0x45')]=function(_0x4ed145,_0xdc70cd){var _0x2e05c4={'raw':![],'where':{'id':_0x4ed145[_0x3c27('0x46')]['id']}},_0x280bf9={};_0x280bf9['model']=_[_0x3c27('0x34')](db[_0x3c27('0x42')][_0x3c27('0x30')]);_0x280bf9['query']=_[_0x3c27('0x34')](_0x4ed145[_0x3c27('0x37')]);_0x280bf9[_0x3c27('0x35')]=_['intersection'](_0x280bf9[_0x3c27('0x33')],_0x280bf9[_0x3c27('0x37')]);_0x2e05c4['attributes']=_[_0x3c27('0x36')](_0x280bf9[_0x3c27('0x33')],qs[_0x3c27('0x38')](_0x4ed145['query'][_0x3c27('0x38')]));_0x2e05c4[_0x3c27('0x39')]=_0x2e05c4[_0x3c27('0x39')]['length']?_0x2e05c4[_0x3c27('0x39')]:_0x280bf9[_0x3c27('0x33')];if(_0x4ed145['query']['includeAll']){_0x2e05c4[_0x3c27('0x47')]=[{'all':!![]}];}_0x2e05c4=_['merge']({},_0x2e05c4,_0x4ed145[_0x3c27('0x48')]);return db[_0x3c27('0x42')][_0x3c27('0x49')](_0x2e05c4)[_0x3c27('0x25')](handleEntityNotFound(_0xdc70cd,null))['then'](respondWithResult(_0xdc70cd,null))[_0x3c27('0x44')](handleError(_0xdc70cd,null));};exports[_0x3c27('0x4a')]=function(_0x5d5038,_0xb824c7){return db[_0x3c27('0x42')][_0x3c27('0x4a')](_0x5d5038[_0x3c27('0x4b')],{})[_0x3c27('0x25')](function(_0x973f06){var _0x548bed=_0x5d5038[_0x3c27('0x4c')][_0x3c27('0x27')]({'plain':!![]});if(!_0x548bed)throw new Error(_0x3c27('0x4d'));if(_0x548bed['role']===_0x3c27('0x4c')){var _0x251d88=_0x973f06['get']({'plain':!![]});var _0x19d5a0='Projects';return db[_0x3c27('0x4e')]['find']({'where':{'name':_0x19d5a0,'userProfileId':_0x548bed[_0x3c27('0x4f')]},'raw':!![]})['then'](function(_0x35ade2){if(_0x35ade2&&_0x35ade2['autoAssociation']===0x0){return db[_0x3c27('0x28')][_0x3c27('0x4a')]({'name':_0x251d88[_0x3c27('0x2c')],'resourceId':_0x251d88['id'],'type':_0x35ade2['name'],'sectionId':_0x35ade2['id']},{})['then'](function(){return _0x973f06;});}else{return _0x973f06;}})[_0x3c27('0x44')](function(_0x1b9ac4){logger[_0x3c27('0x2a')](_0x3c27('0x50'),_0x1b9ac4);throw _0x1b9ac4;});}return _0x973f06;})[_0x3c27('0x25')](respondWithResult(_0xb824c7,0xc9))['catch'](handleError(_0xb824c7,null));};exports[_0x3c27('0x51')]=function(_0x4336a4,_0x93f3af){var _0x4b2640={'where':{'id':_0x4336a4[_0x3c27('0x46')]['id']}},_0x3e8f55={};_0x3e8f55[_0x3c27('0x33')]=_[_0x3c27('0x34')](db[_0x3c27('0x42')]['rawAttributes']);_0x4b2640[_0x3c27('0x39')]=_[_0x3c27('0x36')](_0x3e8f55[_0x3c27('0x33')],qs['fields'](_0x4336a4[_0x3c27('0x37')][_0x3c27('0x38')]));_0x4b2640[_0x3c27('0x39')]=_0x4b2640[_0x3c27('0x39')][_0x3c27('0x3a')]?_0x4b2640['attributes']:_0x3e8f55['model'];if(_0x4336a4[_0x3c27('0x37')][_0x3c27('0x52')]){_0x4b2640[_0x3c27('0x47')]=[{'all':!![]}];}_0x4b2640=_[_0x3c27('0x53')]({},_0x4b2640,_0x4336a4[_0x3c27('0x48')]);return db[_0x3c27('0x42')]['find'](_0x4b2640)[_0x3c27('0x25')](handleEntityNotFound(_0x93f3af,null))[_0x3c27('0x25')](function(_0x58a67e){if(_0x58a67e){var _0x15cb98=_0x58a67e[_0x3c27('0x27')]({'plain':!![]});_0x15cb98=qs['omit'](_0x15cb98,['id','createdAt',_0x3c27('0x54')]);_0x4336a4['body']=_['omit'](_0x4336a4[_0x3c27('0x4b')],['id',_0x3c27('0x55'),_0x3c27('0x54')]);return db[_0x3c27('0x42')][_0x3c27('0x4a')](_[_0x3c27('0x53')](_0x15cb98,_0x4336a4[_0x3c27('0x4b')]),{'include':_0x4336a4[_0x3c27('0x37')][_0x3c27('0x52')]?[{'all':!![]}]:undefined})[_0x3c27('0x25')](function(_0x3048f8){var _0x366dc9=_0x4336a4['user'][_0x3c27('0x27')]({'plain':!![]});if(!_0x366dc9)throw new Error(_0x3c27('0x4d'));if(_0x366dc9['role']==='user'){var _0x360c13=_0x3048f8[_0x3c27('0x27')]({'plain':!![]});var _0x31e396=_0x3c27('0x56');return db[_0x3c27('0x4e')][_0x3c27('0x49')]({'where':{'name':_0x31e396,'userProfileId':_0x366dc9[_0x3c27('0x4f')]},'raw':!![]})[_0x3c27('0x25')](function(_0x42c9a6){if(_0x42c9a6&&_0x42c9a6[_0x3c27('0x57')]===0x0){return db[_0x3c27('0x28')][_0x3c27('0x4a')]({'name':_0x360c13['name'],'resourceId':_0x360c13['id'],'type':_0x42c9a6[_0x3c27('0x2c')],'sectionId':_0x42c9a6['id']},{})[_0x3c27('0x25')](function(){return _0x3048f8;});}else{return _0x3048f8;}})[_0x3c27('0x44')](function(_0x1314d7){logger[_0x3c27('0x2a')](_0x3c27('0x50'),_0x1314d7);throw _0x1314d7;});}return _0x3048f8;});}})[_0x3c27('0x25')](respondWithResult(_0x93f3af,0xc9))['catch'](handleError(_0x93f3af,null));};exports['update']=function(_0x41ebd2,_0x192bf9){if(_0x41ebd2[_0x3c27('0x4b')]['id']){delete _0x41ebd2['body']['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x41ebd2[_0x3c27('0x46')]['id']}})[_0x3c27('0x25')](handleEntityNotFound(_0x192bf9,null))[_0x3c27('0x25')](saveUpdates(_0x41ebd2[_0x3c27('0x4b')],null))[_0x3c27('0x25')](respondWithResult(_0x192bf9,null))[_0x3c27('0x44')](handleError(_0x192bf9,null));};exports[_0x3c27('0x26')]=function(_0x5ca67c,_0x544526){return db['JscriptyProject']['find']({'where':{'id':_0x5ca67c['params']['id']}})[_0x3c27('0x25')](handleEntityNotFound(_0x544526,null))[_0x3c27('0x25')](removeEntity(_0x544526,null))['catch'](handleError(_0x544526,null));};exports[_0x3c27('0x58')]=function(_0x25a0b2,_0x4ac98c,_0x2adc75){var _0x5a56f4={'raw':!![],'where':{}};var _0x373a29={};var _0x1ef887={'count':0x0,'rows':[]};return db[_0x3c27('0x42')][_0x3c27('0x59')]({'where':{'id':_0x25a0b2[_0x3c27('0x46')]['id']}})[_0x3c27('0x25')](handleEntityNotFound(_0x4ac98c,null))['then'](function(_0x59e82){if(_0x59e82){_0x373a29['model']=_['keys'](db['JscriptySessionReport'][_0x3c27('0x30')]);_0x373a29['query']=_[_0x3c27('0x34')](_0x25a0b2[_0x3c27('0x37')]);_0x373a29[_0x3c27('0x35')]=_[_0x3c27('0x36')](_0x373a29['model'],_0x373a29[_0x3c27('0x37')]);_0x5a56f4[_0x3c27('0x39')]=_['intersection'](_0x373a29['model'],qs[_0x3c27('0x38')](_0x25a0b2['query']['fields']));_0x5a56f4[_0x3c27('0x39')]=_0x5a56f4[_0x3c27('0x39')][_0x3c27('0x3a')]?_0x5a56f4['attributes']:_0x373a29[_0x3c27('0x33')];if(!_0x25a0b2[_0x3c27('0x37')]['hasOwnProperty']('nolimit')){_0x5a56f4['limit']=qs[_0x3c27('0x1f')](_0x25a0b2['query'][_0x3c27('0x1f')]);_0x5a56f4[_0x3c27('0x1d')]=qs['offset'](_0x25a0b2[_0x3c27('0x37')][_0x3c27('0x1d')]);}_0x5a56f4[_0x3c27('0x3d')]=qs[_0x3c27('0x3e')](_0x25a0b2[_0x3c27('0x37')][_0x3c27('0x3e')]);_0x5a56f4[_0x3c27('0x40')]=qs[_0x3c27('0x35')](_[_0x3c27('0x5a')](_0x25a0b2[_0x3c27('0x37')],_0x373a29[_0x3c27('0x35')]));_0x5a56f4['where'][_0x3c27('0x5b')]=_0x59e82['id'];if(_0x25a0b2[_0x3c27('0x37')][_0x3c27('0x3f')]){_0x5a56f4[_0x3c27('0x40')]=_['merge'](_0x5a56f4[_0x3c27('0x40')],{'$or':_['map'](_0x5a56f4['attributes'],function(_0x1129cf){var _0x4b0f22={};_0x4b0f22[_0x1129cf]={'$like':'%'+_0x25a0b2[_0x3c27('0x37')][_0x3c27('0x3f')]+'%'};return _0x4b0f22;})});}_0x5a56f4=_[_0x3c27('0x53')]({},_0x5a56f4,_0x25a0b2[_0x3c27('0x48')]);return db[_0x3c27('0x5c')][_0x3c27('0x20')]({'where':_0x5a56f4['where']})[_0x3c27('0x25')](function(_0x3cd10a){_0x1ef887['count']=_0x3cd10a;if(_0x25a0b2[_0x3c27('0x37')]['includeAll']){_0x5a56f4[_0x3c27('0x47')]=[{'all':!![]}];}return db[_0x3c27('0x5c')][_0x3c27('0x43')](_0x5a56f4);})[_0x3c27('0x25')](function(_0x25005f){_0x1ef887[_0x3c27('0x5d')]=_0x25005f;return _0x1ef887;});}})[_0x3c27('0x25')](respondWithFilteredResult(_0x4ac98c,_0x5a56f4))[_0x3c27('0x44')](handleError(_0x4ac98c,null));};exports[_0x3c27('0x5e')]=function(_0xec7612,_0x26f176,_0x5f507e){var _0x263359={'raw':!![],'where':{}};var _0xbcef1b={};var _0x1da3eb={'count':0x0,'rows':[]};return db[_0x3c27('0x42')][_0x3c27('0x59')]({'where':{'id':_0xec7612[_0x3c27('0x46')]['id']}})['then'](handleEntityNotFound(_0x26f176,null))[_0x3c27('0x25')](function(_0x1fe494){if(_0x1fe494){_0xbcef1b[_0x3c27('0x33')]=_['keys'](db[_0x3c27('0x5f')][_0x3c27('0x30')]);_0xbcef1b[_0x3c27('0x37')]=_[_0x3c27('0x34')](_0xec7612[_0x3c27('0x37')]);_0xbcef1b[_0x3c27('0x35')]=_[_0x3c27('0x36')](_0xbcef1b[_0x3c27('0x33')],_0xbcef1b[_0x3c27('0x37')]);_0x263359[_0x3c27('0x39')]=_[_0x3c27('0x36')](_0xbcef1b['model'],qs[_0x3c27('0x38')](_0xec7612[_0x3c27('0x37')][_0x3c27('0x38')]));_0x263359[_0x3c27('0x39')]=_0x263359[_0x3c27('0x39')][_0x3c27('0x3a')]?_0x263359[_0x3c27('0x39')]:_0xbcef1b['model'];if(!_0xec7612[_0x3c27('0x37')][_0x3c27('0x3b')]('nolimit')){_0x263359[_0x3c27('0x1f')]=qs[_0x3c27('0x1f')](_0xec7612[_0x3c27('0x37')][_0x3c27('0x1f')]);_0x263359[_0x3c27('0x1d')]=qs['offset'](_0xec7612[_0x3c27('0x37')][_0x3c27('0x1d')]);}_0x263359[_0x3c27('0x3d')]=qs[_0x3c27('0x3e')](_0xec7612[_0x3c27('0x37')]['sort']);_0x263359[_0x3c27('0x40')]=qs['filters'](_[_0x3c27('0x5a')](_0xec7612[_0x3c27('0x37')],_0xbcef1b[_0x3c27('0x35')]));_0x263359[_0x3c27('0x40')]['ProjectId']=_0x1fe494['id'];if(_0xec7612[_0x3c27('0x37')][_0x3c27('0x3f')]){_0x263359[_0x3c27('0x40')]=_['merge'](_0x263359[_0x3c27('0x40')],{'$or':_[_0x3c27('0x2f')](_0x263359[_0x3c27('0x39')],function(_0x25c368){var _0x1218f7={};_0x1218f7[_0x25c368]={'$like':'%'+_0xec7612[_0x3c27('0x37')]['filter']+'%'};return _0x1218f7;})});}_0x263359=_['merge']({},_0x263359,_0xec7612[_0x3c27('0x48')]);return db[_0x3c27('0x5f')][_0x3c27('0x20')]({'where':_0x263359[_0x3c27('0x40')]})['then'](function(_0x853fbe){_0x1da3eb['count']=_0x853fbe;if(_0xec7612[_0x3c27('0x37')]['includeAll']){_0x263359[_0x3c27('0x47')]=[{'all':!![]}];}return db[_0x3c27('0x5f')][_0x3c27('0x43')](_0x263359);})[_0x3c27('0x25')](function(_0x563aaf){_0x1da3eb['rows']=_0x563aaf;return _0x1da3eb;});}})[_0x3c27('0x25')](respondWithFilteredResult(_0x26f176,_0x263359))[_0x3c27('0x44')](handleError(_0x26f176,null));};function char(_0xc7f0b8){return _0x3c27('0x60')===typeof _0xc7f0b8?String[_0x3c27('0x61')][_0x3c27('0x23')](null,arguments):_0xc7f0b8;}function needsEncapsulation(_0x3b3cf5){return!!_0x3b3cf5&&(_0x3b3cf5[_0x3c27('0x62')]()[_0x3c27('0x63')](char(0xd))>=0x0||_0x3b3cf5[_0x3c27('0x62')]()['indexOf'](char(0xa))>=0x0||_0x3b3cf5[_0x3c27('0x62')]()[_0x3c27('0x63')](char(0x2c))>=0x0||_0x3b3cf5[_0x3c27('0x62')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x25664b){var _0x4bcc74=char(0x22),_0x206062='\x5c'+char(0x22),_0x520d5b=_0x25664b[_0x3c27('0x62')]()[_0x3c27('0x64')](new RegExp(_0x4bcc74,'g'),_0x206062);return _0x4bcc74+_0x520d5b+_0x4bcc74;}exports['getSummary']=function(_0x5e2111,_0x2983aa,_0x3ec3c3){var _0x325d9c,_0x54d3b0;var _0x46be13={'where':{'ProjectId':_0x5e2111[_0x3c27('0x46')]['id']}};if(_0x5e2111['query'][_0x3c27('0x65')]){_0x46be13[_0x3c27('0x40')][_0x3c27('0x66')]=JSON[_0x3c27('0x67')](_0x5e2111[_0x3c27('0x37')][_0x3c27('0x65')]);}return db['JscriptySessionReport'][_0x3c27('0x43')](_0x46be13)[_0x3c27('0x25')](handleEntityNotFound(_0x2983aa,null))['then'](function(_0x17dfed){if(_0x17dfed){_0x325d9c=_0x17dfed;return db['JscriptyQuestionReport']['findAll']({'where':{'SessionId':{'$in':_[_0x3c27('0x2f')](_0x325d9c,'id')},'ProjectId':_0x5e2111['params']['id']},'order':_0x3c27('0x68')});}})[_0x3c27('0x25')](handleEntityNotFound(_0x2983aa,null))['then'](function(_0x473ef4){if(_0x473ef4){_0x54d3b0=_0x473ef4;var _0x805344={};for(var _0x1ed1ad=0x0,_0x1866a6=_0x54d3b0['length'];_0x1ed1ad<_0x1866a6;_0x1ed1ad++){if(!_0x805344[_0x3c27('0x3b')](_0x54d3b0[_0x1ed1ad][_0x3c27('0x69')])){_0x805344[_0x54d3b0[_0x1ed1ad][_0x3c27('0x69')]]=needsEncapsulation(_0x54d3b0[_0x1ed1ad]['question'])?encapsulate(_0x54d3b0[_0x1ed1ad][_0x3c27('0x6a')]):_0x54d3b0[_0x1ed1ad][_0x3c27('0x6a')];}}var _0x59fae8=[],_0x2f26bf={};for(var _0x35555c=0x0,_0x3e96c5=_0x325d9c[_0x3c27('0x3a')];_0x35555c<_0x3e96c5;_0x35555c++){_0x2f26bf={'ProjectId':_0x5e2111['params']['id'],'SessionId':_0x325d9c[_0x35555c]['id'],'StartTime':moment(_0x325d9c[_0x35555c][_0x3c27('0x66')])[_0x3c27('0x6b')](_0x3c27('0x6c'))};for(var _0x97f45=0x0,_0x30410d=_0x54d3b0['length'];_0x97f45<_0x30410d;_0x97f45++){if(_0x54d3b0[_0x97f45][_0x3c27('0x6d')]==_0x325d9c[_0x35555c]['id']&&_0x805344[_0x3c27('0x3b')](_0x54d3b0[_0x97f45][_0x3c27('0x69')])){_0x2f26bf[_0x805344[_0x54d3b0[_0x97f45][_0x3c27('0x69')]]]=_0x54d3b0[_0x97f45]['answer'];}}for(var _0x5d2a99 in _0x805344){if(!_0x2f26bf[_0x3c27('0x3b')](_0x805344[_0x5d2a99])){_0x2f26bf[_0x805344[_0x5d2a99]]=null;}}_0x59fae8['push'](_0x2f26bf);}return _0x59fae8;}})[_0x3c27('0x25')](function(_0x5d3fbb){if(!_[_0x3c27('0x6e')](_0x5d3fbb)){var _0x58d23e=toCsv(_0x5d3fbb);var _0x36858b=Date[_0x3c27('0x6f')]();fs['writeFileSync'](util[_0x3c27('0x6b')](_0x3c27('0x70'),_0x5e2111[_0x3c27('0x46')]['id'],_0x36858b),_0x58d23e);_0x2983aa[_0x3c27('0x71')]('Content-disposition',_0x3c27('0x72')+util[_0x3c27('0x6b')](_0x3c27('0x73'),_0x5e2111[_0x3c27('0x46')]['id'],_0x36858b));_0x2983aa[_0x3c27('0x71')](_0x3c27('0x74'),_0x3c27('0x75'));return _0x2983aa['download'](util[_0x3c27('0x6b')](_0x3c27('0x70'),_0x5e2111[_0x3c27('0x46')]['id'],_0x36858b));}else{return _0x2983aa['sendStatus'](0xcc);}})['catch'](handleError(_0x2983aa,null));};
\ No newline at end of file
index dc5ac44..bbf23e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55a5=['request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird'];(function(_0x40bd50,_0x311edc){var _0x2d5425=function(_0x1d3d07){while(--_0x1d3d07){_0x40bd50['push'](_0x40bd50['shift']());}};_0x2d5425(++_0x311edc);}(_0x55a5,0xf7));var _0x555a=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0x55a5[_0x575a38];return _0x5a7bdd;};'use strict';var _=require(_0x555a('0x0'));var util=require('util');var logger=require(_0x555a('0x1'))(_0x555a('0x2'));var moment=require(_0x555a('0x3'));var BPromise=require(_0x555a('0x4'));var rp=require(_0x555a('0x5'));var fs=require('fs');var path=require(_0x555a('0x6'));var rimraf=require(_0x555a('0x7'));var config=require(_0x555a('0x8'));var attributes=require(_0x555a('0x9'));module[_0x555a('0xa')]=function(_0x2b0126,_0x32f440){return _0x2b0126[_0x555a('0xb')](_0x555a('0xc'),attributes,{'tableName':_0x555a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3248=['exports','define','JscriptyProject','jscripty_projects','util','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4d233d,_0x5e699a){var _0x35a1d9=function(_0x4e66b7){while(--_0x4e66b7){_0x4d233d['push'](_0x4d233d['shift']());}};_0x35a1d9(++_0x5e699a);}(_0x3248,0x1bc));var _0x8324=function(_0x4ea99c,_0x3a6936){_0x4ea99c=_0x4ea99c-0x0;var _0x4664cf=_0x3248[_0x4ea99c];return _0x4664cf;};'use strict';var _=require('lodash');var util=require(_0x8324('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8324('0x1'));var BPromise=require(_0x8324('0x2'));var rp=require(_0x8324('0x3'));var fs=require('fs');var path=require(_0x8324('0x4'));var rimraf=require(_0x8324('0x5'));var config=require(_0x8324('0x6'));var attributes=require('./jscriptyProject.attributes');module[_0x8324('0x7')]=function(_0x1c5c2a,_0x5157f4){return _0x1c5c2a[_0x8324('0x8')](_0x8324('0x9'),attributes,{'tableName':_0x8324('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dc6813c..6ea1f24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2ad4e,_0x282c50){var _0x31bbb1=function(_0x3e7f63){while(--_0x3e7f63){_0x2ad4e['push'](_0x2ad4e['shift']());}};_0x31bbb1(++_0x282c50);}(_0xb43b,0x1b2));var _0xbb43=function(_0x4eb7d8,_0x2860df){_0x4eb7d8=_0x4eb7d8-0x0;var _0xcd040d=_0xb43b[_0x4eb7d8];return _0xcd040d;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
+var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13f146,_0x44bb07){var _0x47d013=function(_0x416126){while(--_0x416126){_0x13f146['push'](_0x13f146['shift']());}};_0x47d013(++_0x44bb07);}(_0xb43b,0x1b2));var _0xbb43=function(_0x402bf6,_0x3d710c){_0x402bf6=_0x402bf6-0x0;var _0x216cdb=_0xb43b[_0x402bf6];return _0x216cdb;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
index 0d90fca..b247bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97d5=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','isAuthenticated','describe','/:id','show','create','put','delete','exports','multer'];(function(_0x8f8cc3,_0x1408e2){var _0x5e0834=function(_0x56d140){while(--_0x56d140){_0x8f8cc3['push'](_0x8f8cc3['shift']());}};_0x5e0834(++_0x1408e2);}(_0x97d5,0x84));var _0x597d=function(_0x257e5f,_0x3f95ba){_0x257e5f=_0x257e5f-0x0;var _0x34e09e=_0x97d5[_0x257e5f];return _0x34e09e;};'use strict';var multer=require(_0x597d('0x0'));var util=require(_0x597d('0x1'));var path=require(_0x597d('0x2'));var timeout=require(_0x597d('0x3'));var express=require(_0x597d('0x4'));var router=express[_0x597d('0x5')]();var fs_extra=require(_0x597d('0x6'));var auth=require(_0x597d('0x7'));var interaction=require(_0x597d('0x8'));var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x597d('0x9')]('/',auth['isAuthenticated'](),controller[_0x597d('0xa')]);router['get']('/describe',auth[_0x597d('0xb')](),controller[_0x597d('0xc')]);router[_0x597d('0x9')](_0x597d('0xd'),auth[_0x597d('0xb')](),controller[_0x597d('0xe')]);router['post']('/',auth[_0x597d('0xb')](),controller[_0x597d('0xf')]);router[_0x597d('0x10')](_0x597d('0xd'),auth[_0x597d('0xb')](),controller['update']);router[_0x597d('0x11')](_0x597d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x597d('0x12')]=router;
\ No newline at end of file
+var _0xca7a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x960ab7,_0x294520){var _0x5c07b2=function(_0x315410){while(--_0x315410){_0x960ab7['push'](_0x960ab7['shift']());}};_0x5c07b2(++_0x294520);}(_0xca7a,0xe1));var _0xaca7=function(_0x2df3c1,_0x35b259){_0x2df3c1=_0x2df3c1-0x0;var _0xbfaae3=_0xca7a[_0x2df3c1];return _0xbfaae3;};'use strict';var multer=require(_0xaca7('0x0'));var util=require(_0xaca7('0x1'));var path=require(_0xaca7('0x2'));var timeout=require(_0xaca7('0x3'));var express=require(_0xaca7('0x4'));var router=express['Router']();var fs_extra=require(_0xaca7('0x5'));var auth=require(_0xaca7('0x6'));var interaction=require(_0xaca7('0x7'));var config=require(_0xaca7('0x8'));var controller=require('./jscriptyQuestionReport.controller');router[_0xaca7('0x9')]('/',auth['isAuthenticated'](),controller[_0xaca7('0xa')]);router['get'](_0xaca7('0xb'),auth[_0xaca7('0xc')](),controller[_0xaca7('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xaca7('0xe')]);router[_0xaca7('0xf')]('/',auth['isAuthenticated'](),controller[_0xaca7('0x10')]);router[_0xaca7('0x11')](_0xaca7('0x12'),auth[_0xaca7('0xc')](),controller[_0xaca7('0x13')]);router[_0xaca7('0x14')]('/:id',auth[_0xaca7('0xc')](),controller[_0xaca7('0x15')]);module[_0xaca7('0x16')]=router;
\ No newline at end of file
index 2dcf6f3..5b20547 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7a54,0x106));var _0x47a5=function(_0xa96ad3,_0x2613e7){_0xa96ad3=_0xa96ad3-0x0;var _0x49fe94=_0x7a54[_0xa96ad3];return _0x49fe94;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x7a54,0x106));var _0x47a5=function(_0x1f9f69,_0x3557ad){_0x1f9f69=_0x1f9f69-0x0;var _0x46e992=_0x7a54[_0x1f9f69];return _0x46e992;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index ae2009e..268da5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf84=['params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','then','stack','send','index','map','JscriptyQuestionReport','fieldName','type','key','model','name','query','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','keys','fields','length','include','find','create','body','update'];(function(_0x3422bf,_0x21b1da){var _0x4de668=function(_0x271cce){while(--_0x271cce){_0x3422bf['push'](_0x3422bf['shift']());}};_0x4de668(++_0x21b1da);}(_0xdf84,0x132));var _0x4df8=function(_0x30f5bb,_0x4db4bd){_0x30f5bb=_0x30f5bb-0x0;var _0x1cfc00=_0xdf84[_0x30f5bb];return _0x1cfc00;};'use strict';var emlformat=require(_0x4df8('0x0'));var rimraf=require(_0x4df8('0x1'));var zipdir=require(_0x4df8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4df8('0x3'));var moment=require(_0x4df8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4df8('0x5'));var util=require(_0x4df8('0x6'));var path=require(_0x4df8('0x7'));var sox=require(_0x4df8('0x8'));var csv=require(_0x4df8('0x9'));var ejs=require(_0x4df8('0xa'));var fs=require('fs');var fs_extra=require(_0x4df8('0xb'));var _=require(_0x4df8('0xc'));var squel=require(_0x4df8('0xd'));var crypto=require(_0x4df8('0xe'));var jsforce=require(_0x4df8('0xf'));var deskjs=require(_0x4df8('0x10'));var toCsv=require(_0x4df8('0x9'));var querystring=require('querystring');var Papa=require(_0x4df8('0x11'));var Redis=require(_0x4df8('0x12'));var authService=require(_0x4df8('0x13'));var qs=require(_0x4df8('0x14'));var as=require(_0x4df8('0x15'));var hardwareService=require(_0x4df8('0x16'));var logger=require(_0x4df8('0x17'))('api');var utils=require(_0x4df8('0x18'));var config=require(_0x4df8('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x45e909,_0x12e1ca){_0x12e1ca=_0x12e1ca||0xcc;return function(_0xf1eae1){if(_0xf1eae1){return _0x45e909[_0x4df8('0x1a')](_0x12e1ca);}return _0x45e909[_0x4df8('0x1b')](_0x12e1ca)[_0x4df8('0x1c')]();};}function respondWithResult(_0x26d51b,_0x54c44b){_0x54c44b=_0x54c44b||0xc8;return function(_0x5dff55){if(_0x5dff55){return _0x26d51b[_0x4df8('0x1b')](_0x54c44b)[_0x4df8('0x1d')](_0x5dff55);}};}function respondWithFilteredResult(_0x13004e,_0xb79e30){return function(_0xce8597){if(_0xce8597){var _0x4a0347=typeof _0xb79e30[_0x4df8('0x1e')]===_0x4df8('0x1f')&&typeof _0xb79e30[_0x4df8('0x20')]===_0x4df8('0x1f');var _0x5c73d5=_0xce8597[_0x4df8('0x21')];var _0x1de9d8=_0x4a0347?0x0:_0xb79e30[_0x4df8('0x1e')];var _0xbfcd55=_0x4a0347?_0xce8597[_0x4df8('0x21')]:_0xb79e30['offset']+_0xb79e30['limit'];var _0x282383;if(_0xbfcd55>=_0x5c73d5){_0xbfcd55=_0x5c73d5;_0x282383=0xc8;}else{_0x282383=0xce;}_0x13004e['status'](_0x282383);return _0x13004e[_0x4df8('0x22')](_0x4df8('0x23'),_0x1de9d8+'-'+_0xbfcd55+'/'+_0x5c73d5)[_0x4df8('0x1d')](_0xce8597);}return null;};}function patchUpdates(_0xe2315a){return function(_0x4613a4){try{jsonpatch[_0x4df8('0x24')](_0x4613a4,_0xe2315a,!![]);}catch(_0x47681a){return BPromise['reject'](_0x47681a);}return _0x4613a4['save']();};}function saveUpdates(_0x16e5d5,_0x5b12e3){return function(_0x4b1c5d){if(_0x4b1c5d){return _0x4b1c5d['update'](_0x16e5d5)['then'](function(_0x1a5458){return _0x1a5458;});}return null;};}function removeEntity(_0x517678,_0xd80756){return function(_0x27d763){if(_0x27d763){return _0x27d763[_0x4df8('0x25')]()[_0x4df8('0x26')](function(){_0x517678[_0x4df8('0x1b')](0xcc)[_0x4df8('0x1c')]();});}};}function handleEntityNotFound(_0x3681cd,_0x1e9c45){return function(_0xb0eb40){if(!_0xb0eb40){_0x3681cd[_0x4df8('0x1a')](0x194);}return _0xb0eb40;};}function handleError(_0x383b2e,_0x1980c9){_0x1980c9=_0x1980c9||0x1f4;return function(_0x486afe){logger['error'](_0x486afe[_0x4df8('0x27')]);if(_0x486afe['name']){delete _0x486afe['name'];}_0x383b2e[_0x4df8('0x1b')](_0x1980c9)[_0x4df8('0x28')](_0x486afe);};}exports[_0x4df8('0x29')]=function(_0x2c92ec,_0x322f79){var _0x1c509b={},_0x157b7={},_0x3a1fec={'count':0x0,'rows':[]};var _0xb97a88=_[_0x4df8('0x2a')](db[_0x4df8('0x2b')]['rawAttributes'],function(_0x41bd0b){return{'name':_0x41bd0b[_0x4df8('0x2c')],'type':_0x41bd0b[_0x4df8('0x2d')][_0x4df8('0x2e')]};});_0x157b7[_0x4df8('0x2f')]=_[_0x4df8('0x2a')](_0xb97a88,_0x4df8('0x30'));_0x157b7[_0x4df8('0x31')]=_['keys'](_0x2c92ec[_0x4df8('0x31')]);_0x157b7['filters']=_['intersection'](_0x157b7[_0x4df8('0x2f')],_0x157b7[_0x4df8('0x31')]);_0x1c509b['attributes']=_[_0x4df8('0x32')](_0x157b7[_0x4df8('0x2f')],qs['fields'](_0x2c92ec['query']['fields']));_0x1c509b[_0x4df8('0x33')]=_0x1c509b['attributes']['length']?_0x1c509b[_0x4df8('0x33')]:_0x157b7[_0x4df8('0x2f')];if(!_0x2c92ec[_0x4df8('0x31')][_0x4df8('0x34')](_0x4df8('0x35'))){_0x1c509b[_0x4df8('0x20')]=qs[_0x4df8('0x20')](_0x2c92ec[_0x4df8('0x31')][_0x4df8('0x20')]);_0x1c509b[_0x4df8('0x1e')]=qs['offset'](_0x2c92ec['query'][_0x4df8('0x1e')]);}_0x1c509b['order']=qs[_0x4df8('0x36')](_0x2c92ec[_0x4df8('0x31')]['sort']);_0x1c509b[_0x4df8('0x37')]=qs['filters'](_[_0x4df8('0x38')](_0x2c92ec[_0x4df8('0x31')],_0x157b7[_0x4df8('0x39')]),_0xb97a88);if(_0x2c92ec[_0x4df8('0x31')][_0x4df8('0x3a')]){_0x1c509b[_0x4df8('0x37')]=_['merge'](_0x1c509b['where'],{'$or':_[_0x4df8('0x2a')](_0xb97a88,function(_0x2ddc48){if(_0x2ddc48[_0x4df8('0x2d')]!==_0x4df8('0x3b')){var _0x8ef2f0={};_0x8ef2f0[_0x2ddc48[_0x4df8('0x30')]]={'$like':'%'+_0x2c92ec[_0x4df8('0x31')]['filter']+'%'};return _0x8ef2f0;}})});}_0x1c509b=_[_0x4df8('0x3c')]({},_0x1c509b,_0x2c92ec[_0x4df8('0x3d')]);var _0x112ca0={'where':_0x1c509b[_0x4df8('0x37')]};return db[_0x4df8('0x2b')]['count'](_0x112ca0)[_0x4df8('0x26')](function(_0x14ceb5){_0x3a1fec[_0x4df8('0x21')]=_0x14ceb5;if(_0x2c92ec[_0x4df8('0x31')][_0x4df8('0x3e')]){_0x1c509b['include']=[{'all':!![]}];}return db[_0x4df8('0x2b')][_0x4df8('0x3f')](_0x1c509b);})[_0x4df8('0x26')](function(_0x7335a3){_0x3a1fec[_0x4df8('0x40')]=_0x7335a3;return _0x3a1fec;})[_0x4df8('0x26')](respondWithFilteredResult(_0x322f79,_0x1c509b))[_0x4df8('0x41')](handleError(_0x322f79,null));};exports['show']=function(_0x16cbaa,_0x40eacb){var _0x24267b={'raw':!![],'where':{'id':_0x16cbaa['params']['id']}},_0x5e693c={};_0x5e693c[_0x4df8('0x2f')]=_[_0x4df8('0x42')](db[_0x4df8('0x2b')]['rawAttributes']);_0x5e693c[_0x4df8('0x31')]=_['keys'](_0x16cbaa[_0x4df8('0x31')]);_0x5e693c['filters']=_[_0x4df8('0x32')](_0x5e693c[_0x4df8('0x2f')],_0x5e693c[_0x4df8('0x31')]);_0x24267b['attributes']=_['intersection'](_0x5e693c['model'],qs['fields'](_0x16cbaa[_0x4df8('0x31')][_0x4df8('0x43')]));_0x24267b[_0x4df8('0x33')]=_0x24267b[_0x4df8('0x33')][_0x4df8('0x44')]?_0x24267b[_0x4df8('0x33')]:_0x5e693c[_0x4df8('0x2f')];if(_0x16cbaa[_0x4df8('0x31')][_0x4df8('0x3e')]){_0x24267b[_0x4df8('0x45')]=[{'all':!![]}];}_0x24267b=_['merge']({},_0x24267b,_0x16cbaa[_0x4df8('0x3d')]);return db[_0x4df8('0x2b')][_0x4df8('0x46')](_0x24267b)[_0x4df8('0x26')](handleEntityNotFound(_0x40eacb,null))[_0x4df8('0x26')](respondWithResult(_0x40eacb,null))[_0x4df8('0x41')](handleError(_0x40eacb,null));};exports['create']=function(_0x56c024,_0x28a692){return db[_0x4df8('0x2b')][_0x4df8('0x47')](_0x56c024[_0x4df8('0x48')],{})[_0x4df8('0x26')](respondWithResult(_0x28a692,0xc9))[_0x4df8('0x41')](handleError(_0x28a692,null));};exports[_0x4df8('0x49')]=function(_0xb6050e,_0x9c9747){if(_0xb6050e['body']['id']){delete _0xb6050e[_0x4df8('0x48')]['id'];}return db[_0x4df8('0x2b')][_0x4df8('0x46')]({'where':{'id':_0xb6050e[_0x4df8('0x4a')]['id']}})[_0x4df8('0x26')](handleEntityNotFound(_0x9c9747,null))[_0x4df8('0x26')](saveUpdates(_0xb6050e[_0x4df8('0x48')],null))['then'](respondWithResult(_0x9c9747,null))['catch'](handleError(_0x9c9747,null));};exports['destroy']=function(_0x1c7031,_0x5a60f9){return db[_0x4df8('0x2b')][_0x4df8('0x46')]({'where':{'id':_0x1c7031[_0x4df8('0x4a')]['id']}})[_0x4df8('0x26')](handleEntityNotFound(_0x5a60f9,null))[_0x4df8('0x26')](removeEntity(_0x5a60f9,null))[_0x4df8('0x41')](handleError(_0x5a60f9,null));};exports[_0x4df8('0x4b')]=function(_0x4b4d25,_0x52d246){return db[_0x4df8('0x2b')]['describe']()[_0x4df8('0x26')](respondWithResult(_0x52d246,null))[_0x4df8('0x41')](handleError(_0x52d246,null));};
\ No newline at end of file
+var _0x662e=['path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','show','params','keys','options','find','create','body','catch','update','describe','rimraf','zip-dir','request-promise','moment','mustache'];(function(_0x8f6fa5,_0x320980){var _0x2e1201=function(_0x92e939){while(--_0x92e939){_0x8f6fa5['push'](_0x8f6fa5['shift']());}};_0x2e1201(++_0x320980);}(_0x662e,0xdc));var _0xe662=function(_0x2f6fd0,_0x1dfcf9){_0x2f6fd0=_0x2f6fd0-0x0;var _0x2531f9=_0x662e[_0x2f6fd0];return _0x2531f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe662('0x0'));var zipdir=require(_0xe662('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe662('0x2'));var moment=require(_0xe662('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe662('0x4'));var util=require('util');var path=require(_0xe662('0x5'));var sox=require(_0xe662('0x6'));var csv=require(_0xe662('0x7'));var ejs=require(_0xe662('0x8'));var fs=require('fs');var fs_extra=require(_0xe662('0x9'));var _=require('lodash');var squel=require(_0xe662('0xa'));var crypto=require('crypto');var jsforce=require(_0xe662('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe662('0x7'));var querystring=require(_0xe662('0xc'));var Papa=require(_0xe662('0xd'));var Redis=require(_0xe662('0xe'));var authService=require(_0xe662('0xf'));var qs=require(_0xe662('0x10'));var as=require(_0xe662('0x11'));var hardwareService=require(_0xe662('0x12'));var logger=require(_0xe662('0x13'))(_0xe662('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe662('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bab97,_0x1e46c6){_0x1e46c6=_0x1e46c6||0xcc;return function(_0x352ed1){if(_0x352ed1){return _0x5bab97[_0xe662('0x16')](_0x1e46c6);}return _0x5bab97[_0xe662('0x17')](_0x1e46c6)[_0xe662('0x18')]();};}function respondWithResult(_0x43dd8e,_0x4b575b){_0x4b575b=_0x4b575b||0xc8;return function(_0x4763d0){if(_0x4763d0){return _0x43dd8e[_0xe662('0x17')](_0x4b575b)[_0xe662('0x19')](_0x4763d0);}};}function respondWithFilteredResult(_0x408876,_0x413870){return function(_0x215405){if(_0x215405){var _0x50ca2d=typeof _0x413870[_0xe662('0x1a')]==='undefined'&&typeof _0x413870[_0xe662('0x1b')]===_0xe662('0x1c');var _0x50a00f=_0x215405[_0xe662('0x1d')];var _0x597680=_0x50ca2d?0x0:_0x413870['offset'];var _0x41651c=_0x50ca2d?_0x215405[_0xe662('0x1d')]:_0x413870[_0xe662('0x1a')]+_0x413870[_0xe662('0x1b')];var _0x40944e;if(_0x41651c>=_0x50a00f){_0x41651c=_0x50a00f;_0x40944e=0xc8;}else{_0x40944e=0xce;}_0x408876[_0xe662('0x17')](_0x40944e);return _0x408876['set'](_0xe662('0x1e'),_0x597680+'-'+_0x41651c+'/'+_0x50a00f)[_0xe662('0x19')](_0x215405);}return null;};}function patchUpdates(_0x5e92a2){return function(_0x45d1d4){try{jsonpatch[_0xe662('0x1f')](_0x45d1d4,_0x5e92a2,!![]);}catch(_0x19c15b){return BPromise[_0xe662('0x20')](_0x19c15b);}return _0x45d1d4[_0xe662('0x21')]();};}function saveUpdates(_0x41cd3d,_0x39d667){return function(_0x229059){if(_0x229059){return _0x229059['update'](_0x41cd3d)[_0xe662('0x22')](function(_0x43b087){return _0x43b087;});}return null;};}function removeEntity(_0x4b573f,_0x5ef305){return function(_0x4a6531){if(_0x4a6531){return _0x4a6531[_0xe662('0x23')]()[_0xe662('0x22')](function(){_0x4b573f[_0xe662('0x17')](0xcc)[_0xe662('0x18')]();});}};}function handleEntityNotFound(_0x58d011,_0x122408){return function(_0x1a9ff1){if(!_0x1a9ff1){_0x58d011[_0xe662('0x16')](0x194);}return _0x1a9ff1;};}function handleError(_0x16800b,_0x2b2f2c){_0x2b2f2c=_0x2b2f2c||0x1f4;return function(_0x4c5c39){logger[_0xe662('0x24')](_0x4c5c39[_0xe662('0x25')]);if(_0x4c5c39[_0xe662('0x26')]){delete _0x4c5c39[_0xe662('0x26')];}_0x16800b['status'](_0x2b2f2c)[_0xe662('0x27')](_0x4c5c39);};}exports['index']=function(_0x127a86,_0x4182bc){var _0x25a433={},_0x21325f={},_0x32b4fc={'count':0x0,'rows':[]};var _0x5bf5ff=_[_0xe662('0x28')](db[_0xe662('0x29')][_0xe662('0x2a')],function(_0x166109){return{'name':_0x166109[_0xe662('0x2b')],'type':_0x166109[_0xe662('0x2c')][_0xe662('0x2d')]};});_0x21325f['model']=_[_0xe662('0x28')](_0x5bf5ff,_0xe662('0x26'));_0x21325f[_0xe662('0x2e')]=_['keys'](_0x127a86[_0xe662('0x2e')]);_0x21325f[_0xe662('0x2f')]=_[_0xe662('0x30')](_0x21325f[_0xe662('0x31')],_0x21325f[_0xe662('0x2e')]);_0x25a433[_0xe662('0x32')]=_['intersection'](_0x21325f['model'],qs[_0xe662('0x33')](_0x127a86[_0xe662('0x2e')][_0xe662('0x33')]));_0x25a433[_0xe662('0x32')]=_0x25a433[_0xe662('0x32')][_0xe662('0x34')]?_0x25a433[_0xe662('0x32')]:_0x21325f[_0xe662('0x31')];if(!_0x127a86[_0xe662('0x2e')][_0xe662('0x35')](_0xe662('0x36'))){_0x25a433[_0xe662('0x1b')]=qs[_0xe662('0x1b')](_0x127a86['query'][_0xe662('0x1b')]);_0x25a433['offset']=qs[_0xe662('0x1a')](_0x127a86[_0xe662('0x2e')][_0xe662('0x1a')]);}_0x25a433[_0xe662('0x37')]=qs['sort'](_0x127a86['query'][_0xe662('0x38')]);_0x25a433[_0xe662('0x39')]=qs[_0xe662('0x2f')](_[_0xe662('0x3a')](_0x127a86[_0xe662('0x2e')],_0x21325f['filters']),_0x5bf5ff);if(_0x127a86[_0xe662('0x2e')]['filter']){_0x25a433[_0xe662('0x39')]=_[_0xe662('0x3b')](_0x25a433[_0xe662('0x39')],{'$or':_['map'](_0x5bf5ff,function(_0x1eb79d){if(_0x1eb79d[_0xe662('0x2c')]!==_0xe662('0x3c')){var _0x21de0b={};_0x21de0b[_0x1eb79d[_0xe662('0x26')]]={'$like':'%'+_0x127a86['query'][_0xe662('0x3d')]+'%'};return _0x21de0b;}})});}_0x25a433=_[_0xe662('0x3b')]({},_0x25a433,_0x127a86['options']);var _0x406efc={'where':_0x25a433[_0xe662('0x39')]};return db[_0xe662('0x29')][_0xe662('0x1d')](_0x406efc)[_0xe662('0x22')](function(_0x3d6f12){_0x32b4fc[_0xe662('0x1d')]=_0x3d6f12;if(_0x127a86['query'][_0xe662('0x3e')]){_0x25a433[_0xe662('0x3f')]=[{'all':!![]}];}return db[_0xe662('0x29')][_0xe662('0x40')](_0x25a433);})[_0xe662('0x22')](function(_0x2c639e){_0x32b4fc['rows']=_0x2c639e;return _0x32b4fc;})['then'](respondWithFilteredResult(_0x4182bc,_0x25a433))['catch'](handleError(_0x4182bc,null));};exports[_0xe662('0x41')]=function(_0x2cc784,_0x2a0651){var _0x214e43={'raw':!![],'where':{'id':_0x2cc784[_0xe662('0x42')]['id']}},_0x8fd7b5={};_0x8fd7b5[_0xe662('0x31')]=_[_0xe662('0x43')](db[_0xe662('0x29')][_0xe662('0x2a')]);_0x8fd7b5[_0xe662('0x2e')]=_[_0xe662('0x43')](_0x2cc784[_0xe662('0x2e')]);_0x8fd7b5[_0xe662('0x2f')]=_['intersection'](_0x8fd7b5['model'],_0x8fd7b5[_0xe662('0x2e')]);_0x214e43[_0xe662('0x32')]=_['intersection'](_0x8fd7b5[_0xe662('0x31')],qs[_0xe662('0x33')](_0x2cc784[_0xe662('0x2e')]['fields']));_0x214e43[_0xe662('0x32')]=_0x214e43[_0xe662('0x32')][_0xe662('0x34')]?_0x214e43[_0xe662('0x32')]:_0x8fd7b5[_0xe662('0x31')];if(_0x2cc784[_0xe662('0x2e')][_0xe662('0x3e')]){_0x214e43[_0xe662('0x3f')]=[{'all':!![]}];}_0x214e43=_[_0xe662('0x3b')]({},_0x214e43,_0x2cc784[_0xe662('0x44')]);return db[_0xe662('0x29')][_0xe662('0x45')](_0x214e43)['then'](handleEntityNotFound(_0x2a0651,null))[_0xe662('0x22')](respondWithResult(_0x2a0651,null))['catch'](handleError(_0x2a0651,null));};exports[_0xe662('0x46')]=function(_0x3e5a01,_0x2a1c18){return db[_0xe662('0x29')][_0xe662('0x46')](_0x3e5a01[_0xe662('0x47')],{})['then'](respondWithResult(_0x2a1c18,0xc9))[_0xe662('0x48')](handleError(_0x2a1c18,null));};exports[_0xe662('0x49')]=function(_0x2ef361,_0x59c5f8){if(_0x2ef361['body']['id']){delete _0x2ef361[_0xe662('0x47')]['id'];}return db[_0xe662('0x29')][_0xe662('0x45')]({'where':{'id':_0x2ef361['params']['id']}})['then'](handleEntityNotFound(_0x59c5f8,null))[_0xe662('0x22')](saveUpdates(_0x2ef361[_0xe662('0x47')],null))[_0xe662('0x22')](respondWithResult(_0x59c5f8,null))[_0xe662('0x48')](handleError(_0x59c5f8,null));};exports['destroy']=function(_0x6c0ae9,_0x4c1abd){return db[_0xe662('0x29')]['find']({'where':{'id':_0x6c0ae9[_0xe662('0x42')]['id']}})[_0xe662('0x22')](handleEntityNotFound(_0x4c1abd,null))[_0xe662('0x22')](removeEntity(_0x4c1abd,null))[_0xe662('0x48')](handleError(_0x4c1abd,null));};exports[_0xe662('0x4a')]=function(_0x269a14,_0x17a96e){return db['JscriptyQuestionReport'][_0xe662('0x4a')]()[_0xe662('0x22')](respondWithResult(_0x17a96e,null))[_0xe662('0x48')](handleError(_0x17a96e,null));};
\ No newline at end of file
index 70645be..1ec5032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed90=['bluebird','path','rimraf','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','api','moment'];(function(_0x2dc747,_0x3bb2eb){var _0x5795fb=function(_0x1f770d){while(--_0x1f770d){_0x2dc747['push'](_0x2dc747['shift']());}};_0x5795fb(++_0x3bb2eb);}(_0xed90,0x17d));var _0x0ed9=function(_0x56908c,_0x156788){_0x56908c=_0x56908c-0x0;var _0x1f3af0=_0xed90[_0x56908c];return _0x1f3af0;};'use strict';var _=require(_0x0ed9('0x0'));var util=require(_0x0ed9('0x1'));var logger=require('../../config/logger')(_0x0ed9('0x2'));var moment=require(_0x0ed9('0x3'));var BPromise=require(_0x0ed9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0ed9('0x5'));var rimraf=require(_0x0ed9('0x6'));var config=require('../../config/environment');var attributes=require(_0x0ed9('0x7'));module[_0x0ed9('0x8')]=function(_0x21b14f,_0x44bf69){return _0x21b14f['define'](_0x0ed9('0x9'),attributes,{'tableName':_0x0ed9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6322=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport'];(function(_0x123ff8,_0x2b9a42){var _0x2d8b5e=function(_0x970b6f){while(--_0x970b6f){_0x123ff8['push'](_0x123ff8['shift']());}};_0x2d8b5e(++_0x2b9a42);}(_0x6322,0x111));var _0x2632=function(_0x525f40,_0x60a2c8){_0x525f40=_0x525f40-0x0;var _0x4f8dae=_0x6322[_0x525f40];return _0x4f8dae;};'use strict';var _=require(_0x2632('0x0'));var util=require(_0x2632('0x1'));var logger=require(_0x2632('0x2'))(_0x2632('0x3'));var moment=require(_0x2632('0x4'));var BPromise=require(_0x2632('0x5'));var rp=require(_0x2632('0x6'));var fs=require('fs');var path=require(_0x2632('0x7'));var rimraf=require(_0x2632('0x8'));var config=require(_0x2632('0x9'));var attributes=require(_0x2632('0xa'));module['exports']=function(_0x307f5f,_0x27f4f0){return _0x307f5f[_0x2632('0xb')](_0x2632('0xc'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed70b1e..083a26f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde3c=['ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','lodash','util','moment','bluebird','randomstring'];(function(_0x3595bf,_0x5b0a83){var _0x19c9fc=function(_0x1fff61){while(--_0x1fff61){_0x3595bf['push'](_0x3595bf['shift']());}};_0x19c9fc(++_0x5b0a83);}(_0xde3c,0x119));var _0xcde3=function(_0xdaebd6,_0x17a7ed){_0xdaebd6=_0xdaebd6-0x0;var _0x4b80b3=_0xde3c[_0xdaebd6];return _0x4b80b3;};'use strict';var _=require(_0xcde3('0x0'));var util=require(_0xcde3('0x1'));var moment=require(_0xcde3('0x2'));var BPromise=require(_0xcde3('0x3'));var rs=require(_0xcde3('0x4'));var fs=require('fs');var Redis=require(_0xcde3('0x5'));var db=require(_0xcde3('0x6'))['db'];var utils=require(_0xcde3('0x7'));var logger=require('../../config/logger')(_0xcde3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcde3('0x9')][_0xcde3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc6536c,_0x5e7f1e,_0x559cd2){return new BPromise(function(_0x42478d,_0x2daccc){return client[_0xcde3('0xb')](_0xc6536c,_0x559cd2)[_0xcde3('0xc')](function(_0x48e102){logger['info'](_0xcde3('0xd'),_0x5e7f1e,_0xcde3('0xe'));logger[_0xcde3('0xf')](_0xcde3('0x10'),_0x5e7f1e,_0xcde3('0xe'),JSON[_0xcde3('0x11')](_0x48e102));if(_0x48e102['error']){if(_0x48e102['error'][_0xcde3('0x12')]===0x1f4){logger[_0xcde3('0x13')](_0xcde3('0xd'),_0x5e7f1e,_0x48e102['error'][_0xcde3('0x14')]);return _0x2daccc(_0x48e102['error'][_0xcde3('0x14')]);}logger[_0xcde3('0x13')](_0xcde3('0xd'),_0x5e7f1e,_0x48e102[_0xcde3('0x13')][_0xcde3('0x14')]);return _0x42478d(_0x48e102[_0xcde3('0x13')][_0xcde3('0x14')]);}else{logger[_0xcde3('0x15')](_0xcde3('0xd'),_0x5e7f1e,'request\x20sent');_0x42478d(_0x48e102['result'][_0xcde3('0x14')]);}})['catch'](function(_0x55fc02){logger['error'](_0xcde3('0xd'),_0x5e7f1e,_0x55fc02);_0x2daccc(_0x55fc02);});});}
\ No newline at end of file
+var _0x0c02=['client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x61a4ef,_0x22a561){var _0x30e005=function(_0x5a93fb){while(--_0x5a93fb){_0x61a4ef['push'](_0x61a4ef['shift']());}};_0x30e005(++_0x22a561);}(_0x0c02,0xa8));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x20c0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x20c0('0x1'));var fs=require('fs');var Redis=require(_0x20c0('0x2'));var db=require(_0x20c0('0x3'))['db'];var utils=require(_0x20c0('0x4'));var logger=require('../../config/logger')(_0x20c0('0x5'));var config=require(_0x20c0('0x6'));var jayson=require(_0x20c0('0x7'));var client=jayson[_0x20c0('0x8')][_0x20c0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3a07,_0x192baf,_0xdbf86e){return new BPromise(function(_0x4275a0,_0x550bcf){return client[_0x20c0('0xa')](_0x1a3a07,_0xdbf86e)[_0x20c0('0xb')](function(_0x2aba74){logger[_0x20c0('0xc')](_0x20c0('0xd'),_0x192baf,'request\x20sent');logger['debug'](_0x20c0('0xe'),_0x192baf,_0x20c0('0xf'),JSON[_0x20c0('0x10')](_0x2aba74));if(_0x2aba74[_0x20c0('0x11')]){if(_0x2aba74[_0x20c0('0x11')][_0x20c0('0x12')]===0x1f4){logger[_0x20c0('0x11')](_0x20c0('0xd'),_0x192baf,_0x2aba74[_0x20c0('0x11')][_0x20c0('0x13')]);return _0x550bcf(_0x2aba74['error'][_0x20c0('0x13')]);}logger[_0x20c0('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x192baf,_0x2aba74['error'][_0x20c0('0x13')]);return _0x4275a0(_0x2aba74[_0x20c0('0x11')][_0x20c0('0x13')]);}else{logger[_0x20c0('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x192baf,_0x20c0('0xf'));_0x4275a0(_0x2aba74[_0x20c0('0x14')][_0x20c0('0x13')]);}})[_0x20c0('0x15')](function(_0x56c28c){logger[_0x20c0('0x11')](_0x20c0('0xd'),_0x192baf,_0x56c28c);_0x550bcf(_0x56c28c);});});}
\ No newline at end of file
index 67edf95..e426e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe1e=['getQuestions','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/questions'];(function(_0x1e1fe9,_0x216dd9){var _0x4eeb06=function(_0x3c69c2){while(--_0x3c69c2){_0x1e1fe9['push'](_0x1e1fe9['shift']());}};_0x4eeb06(++_0x216dd9);}(_0xbe1e,0x15b));var _0xebe1=function(_0x395e74,_0x33c903){_0x395e74=_0x395e74-0x0;var _0x3a9dda=_0xbe1e[_0x395e74];return _0x3a9dda;};'use strict';var multer=require(_0xebe1('0x0'));var util=require(_0xebe1('0x1'));var path=require('path');var timeout=require(_0xebe1('0x2'));var express=require(_0xebe1('0x3'));var router=express[_0xebe1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xebe1('0x5'));var controller=require(_0xebe1('0x6'));router['get']('/',auth[_0xebe1('0x7')](),controller[_0xebe1('0x8')]);router[_0xebe1('0x9')](_0xebe1('0xa'),auth[_0xebe1('0x7')](),controller[_0xebe1('0xb')]);router[_0xebe1('0x9')](_0xebe1('0xc'),auth[_0xebe1('0x7')](),controller['show']);router[_0xebe1('0x9')](_0xebe1('0xd'),auth['isAuthenticated'](),controller[_0xebe1('0xe')]);router['post']('/',auth[_0xebe1('0x7')](),controller[_0xebe1('0xf')]);router['put']('/:id',auth[_0xebe1('0x7')](),controller[_0xebe1('0x10')]);router[_0xebe1('0x11')](_0xebe1('0xc'),auth[_0xebe1('0x7')](),controller['destroy']);module[_0xebe1('0x12')]=router;
\ No newline at end of file
+var _0xd37f=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','destroy'];(function(_0x4466fa,_0x3ff3bc){var _0x2ebb45=function(_0x52b6b8){while(--_0x52b6b8){_0x4466fa['push'](_0x4466fa['shift']());}};_0x2ebb45(++_0x3ff3bc);}(_0xd37f,0xd2));var _0xfd37=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd37f[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require('multer');var util=require(_0xfd37('0x0'));var path=require('path');var timeout=require(_0xfd37('0x1'));var express=require(_0xfd37('0x2'));var router=express[_0xfd37('0x3')]();var fs_extra=require(_0xfd37('0x4'));var auth=require(_0xfd37('0x5'));var interaction=require(_0xfd37('0x6'));var config=require(_0xfd37('0x7'));var controller=require('./jscriptySessionReport.controller');router[_0xfd37('0x8')]('/',auth[_0xfd37('0x9')](),controller['index']);router[_0xfd37('0x8')](_0xfd37('0xa'),auth[_0xfd37('0x9')](),controller[_0xfd37('0xb')]);router['get'](_0xfd37('0xc'),auth['isAuthenticated'](),controller[_0xfd37('0xd')]);router[_0xfd37('0x8')]('/:id/questions',auth[_0xfd37('0x9')](),controller['getQuestions']);router['post']('/',auth['isAuthenticated'](),controller[_0xfd37('0xe')]);router['put'](_0xfd37('0xc'),auth[_0xfd37('0x9')](),controller[_0xfd37('0xf')]);router[_0xfd37('0x10')](_0xfd37('0xc'),auth[_0xfd37('0x9')](),controller[_0xfd37('0x11')]);module[_0xfd37('0x12')]=router;
\ No newline at end of file
index ec122e5..6626e4a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac0f=['STRING','BOOLEAN','moment','exports','DATE','starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x331c6a,_0x3a2f0a){var _0x3b4eff=function(_0x294eba){while(--_0x294eba){_0x331c6a['push'](_0x331c6a['shift']());}};_0x3b4eff(++_0x3a2f0a);}(_0xac0f,0xd1));var _0xfac0=function(_0x45b23f,_0x521417){_0x45b23f=_0x45b23f-0x0;var _0x5d6255=_0xac0f[_0x45b23f];return _0x5d6255;};'use strict';var moment=require(_0xfac0('0x0'));var Sequelize=require('sequelize');module[_0xfac0('0x1')]={'starttime':{'type':Sequelize[_0xfac0('0x2')],'set':function(_0x3e8e73){this['setDataValue'](_0xfac0('0x3'),_0x3e8e73);this[_0xfac0('0x4')]('endtime',moment()[_0xfac0('0x5')](_0xfac0('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xfac0('0x7')]},'projectname':{'type':Sequelize[_0xfac0('0x7')]},'queue':{'type':Sequelize[_0xfac0('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfac0('0x7')]},'calleridnum':{'type':Sequelize[_0xfac0('0x7')]},'completed':{'type':Sequelize[_0xfac0('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2e2c=['starttime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','exports','DATE','setDataValue'];(function(_0x104947,_0x47f991){var _0x371773=function(_0x4239cb){while(--_0x4239cb){_0x104947['push'](_0x104947['shift']());}};_0x371773(++_0x47f991);}(_0x2e2c,0xa4));var _0xc2e2=function(_0x3c5aa6,_0x4c4f86){_0x3c5aa6=_0x3c5aa6-0x0;var _0x49e397=_0x2e2c[_0x3c5aa6];return _0x49e397;};'use strict';var moment=require(_0xc2e2('0x0'));var Sequelize=require('sequelize');module[_0xc2e2('0x1')]={'starttime':{'type':Sequelize[_0xc2e2('0x2')],'set':function(_0x588b53){this[_0xc2e2('0x3')](_0xc2e2('0x4'),_0x588b53);this[_0xc2e2('0x3')]('endtime',moment()['format'](_0xc2e2('0x5')));}},'endtime':{'type':Sequelize[_0xc2e2('0x2')]},'membername':{'type':Sequelize[_0xc2e2('0x6')]},'projectname':{'type':Sequelize[_0xc2e2('0x6')]},'queue':{'type':Sequelize[_0xc2e2('0x6')]},'uniqueid':{'type':Sequelize[_0xc2e2('0x6')]},'calleridname':{'type':Sequelize[_0xc2e2('0x6')]},'calleridnum':{'type':Sequelize[_0xc2e2('0x6')]},'completed':{'type':Sequelize[_0xc2e2('0x7')],'defaultValue':![]}};
\ No newline at end of file
index a3e7455..d1d3275 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x529c=['findAll','rows','catch','params','find','create','body','update','destroy','describe','getQuestions','pick','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','count','set','Content-Range','apply','reject','save','sendStatus','error','name','send','index','JscriptySessionReport','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','fields','length','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0x529c,0xa9));var _0xc529=function(_0x1406ff,_0x39a38a){_0x1406ff=_0x1406ff-0x0;var _0x3d543c=_0x529c[_0x1406ff];return _0x3d543c;};'use strict';var emlformat=require(_0xc529('0x0'));var rimraf=require(_0xc529('0x1'));var zipdir=require(_0xc529('0x2'));var jsonpatch=require(_0xc529('0x3'));var rp=require(_0xc529('0x4'));var moment=require(_0xc529('0x5'));var BPromise=require(_0xc529('0x6'));var Mustache=require(_0xc529('0x7'));var util=require(_0xc529('0x8'));var path=require('path');var sox=require(_0xc529('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc529('0xa'));var _=require(_0xc529('0xb'));var squel=require(_0xc529('0xc'));var crypto=require(_0xc529('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc529('0xe'));var Papa=require(_0xc529('0xf'));var Redis=require(_0xc529('0x10'));var authService=require(_0xc529('0x11'));var qs=require(_0xc529('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc529('0x13'))('api');var utils=require(_0xc529('0x14'));var config=require(_0xc529('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc529('0x16'))['db'];function respondWithStatusCode(_0xc01ba8,_0x5cedf5){_0x5cedf5=_0x5cedf5||0xcc;return function(_0x4e691c){if(_0x4e691c){return _0xc01ba8['sendStatus'](_0x5cedf5);}return _0xc01ba8[_0xc529('0x17')](_0x5cedf5)[_0xc529('0x18')]();};}function respondWithResult(_0x1234dc,_0x2670cf){_0x2670cf=_0x2670cf||0xc8;return function(_0xdd3fee){if(_0xdd3fee){return _0x1234dc[_0xc529('0x17')](_0x2670cf)[_0xc529('0x19')](_0xdd3fee);}};}function respondWithFilteredResult(_0x96490b,_0x406675){return function(_0x4aec47){if(_0x4aec47){var _0x276eb9=typeof _0x406675[_0xc529('0x1a')]==='undefined'&&typeof _0x406675['limit']==='undefined';var _0x3165c6=_0x4aec47['count'];var _0x31f170=_0x276eb9?0x0:_0x406675['offset'];var _0x3d7315=_0x276eb9?_0x4aec47[_0xc529('0x1b')]:_0x406675['offset']+_0x406675['limit'];var _0x3d712e;if(_0x3d7315>=_0x3165c6){_0x3d7315=_0x3165c6;_0x3d712e=0xc8;}else{_0x3d712e=0xce;}_0x96490b[_0xc529('0x17')](_0x3d712e);return _0x96490b[_0xc529('0x1c')](_0xc529('0x1d'),_0x31f170+'-'+_0x3d7315+'/'+_0x3165c6)[_0xc529('0x19')](_0x4aec47);}return null;};}function patchUpdates(_0x44e36c){return function(_0x250700){try{jsonpatch[_0xc529('0x1e')](_0x250700,_0x44e36c,!![]);}catch(_0x26a2e0){return BPromise[_0xc529('0x1f')](_0x26a2e0);}return _0x250700[_0xc529('0x20')]();};}function saveUpdates(_0x11f33d,_0x34cf57){return function(_0x6e3025){if(_0x6e3025){return _0x6e3025['update'](_0x11f33d)['then'](function(_0x30dd65){return _0x30dd65;});}return null;};}function removeEntity(_0x3c43f3,_0xd6d09c){return function(_0x2909d5){if(_0x2909d5){return _0x2909d5['destroy']()['then'](function(){_0x3c43f3[_0xc529('0x17')](0xcc)[_0xc529('0x18')]();});}};}function handleEntityNotFound(_0x38221e,_0x453da3){return function(_0x1e5717){if(!_0x1e5717){_0x38221e[_0xc529('0x21')](0x194);}return _0x1e5717;};}function handleError(_0x359808,_0x10cf00){_0x10cf00=_0x10cf00||0x1f4;return function(_0x7cc958){logger[_0xc529('0x22')](_0x7cc958['stack']);if(_0x7cc958[_0xc529('0x23')]){delete _0x7cc958['name'];}_0x359808['status'](_0x10cf00)[_0xc529('0x24')](_0x7cc958);};}exports[_0xc529('0x25')]=function(_0x3a88c7,_0x400fec){var _0x3f7135={},_0x3d6caf={},_0x56a944={'count':0x0,'rows':[]};var _0x3dfe24=_['map'](db[_0xc529('0x26')][_0xc529('0x27')],function(_0x577312){return{'name':_0x577312[_0xc529('0x28')],'type':_0x577312['type'][_0xc529('0x29')]};});_0x3d6caf[_0xc529('0x2a')]=_[_0xc529('0x2b')](_0x3dfe24,_0xc529('0x23'));_0x3d6caf['query']=_[_0xc529('0x2c')](_0x3a88c7['query']);_0x3d6caf[_0xc529('0x2d')]=_[_0xc529('0x2e')](_0x3d6caf[_0xc529('0x2a')],_0x3d6caf[_0xc529('0x2f')]);_0x3f7135['attributes']=_[_0xc529('0x2e')](_0x3d6caf['model'],qs[_0xc529('0x30')](_0x3a88c7[_0xc529('0x2f')]['fields']));_0x3f7135['attributes']=_0x3f7135['attributes'][_0xc529('0x31')]?_0x3f7135[_0xc529('0x32')]:_0x3d6caf[_0xc529('0x2a')];if(!_0x3a88c7[_0xc529('0x2f')][_0xc529('0x33')](_0xc529('0x34'))){_0x3f7135['limit']=qs[_0xc529('0x35')](_0x3a88c7[_0xc529('0x2f')][_0xc529('0x35')]);_0x3f7135[_0xc529('0x1a')]=qs[_0xc529('0x1a')](_0x3a88c7['query'][_0xc529('0x1a')]);}_0x3f7135[_0xc529('0x36')]=qs['sort'](_0x3a88c7[_0xc529('0x2f')][_0xc529('0x37')]);_0x3f7135[_0xc529('0x38')]=qs[_0xc529('0x2d')](_['pick'](_0x3a88c7['query'],_0x3d6caf['filters']),_0x3dfe24);if(_0x3a88c7['query'][_0xc529('0x39')]){_0x3f7135[_0xc529('0x38')]=_[_0xc529('0x3a')](_0x3f7135[_0xc529('0x38')],{'$or':_[_0xc529('0x2b')](_0x3dfe24,function(_0x3e1efc){if(_0x3e1efc[_0xc529('0x3b')]!==_0xc529('0x3c')){var _0x1e58dc={};_0x1e58dc[_0x3e1efc['name']]={'$like':'%'+_0x3a88c7['query'][_0xc529('0x39')]+'%'};return _0x1e58dc;}})});}_0x3f7135=_[_0xc529('0x3a')]({},_0x3f7135,_0x3a88c7[_0xc529('0x3d')]);var _0x2614c0={'where':_0x3f7135[_0xc529('0x38')]};return db[_0xc529('0x26')]['count'](_0x2614c0)[_0xc529('0x3e')](function(_0x2e7831){_0x56a944[_0xc529('0x1b')]=_0x2e7831;if(_0x3a88c7[_0xc529('0x2f')][_0xc529('0x3f')]){_0x3f7135[_0xc529('0x40')]=[{'all':!![]}];}return db[_0xc529('0x26')][_0xc529('0x41')](_0x3f7135);})[_0xc529('0x3e')](function(_0x4917cd){_0x56a944[_0xc529('0x42')]=_0x4917cd;return _0x56a944;})[_0xc529('0x3e')](respondWithFilteredResult(_0x400fec,_0x3f7135))[_0xc529('0x43')](handleError(_0x400fec,null));};exports['show']=function(_0x55ef2c,_0x4e8137){var _0x409642={'raw':!![],'where':{'id':_0x55ef2c[_0xc529('0x44')]['id']}},_0x2cbbc8={};_0x2cbbc8['model']=_[_0xc529('0x2c')](db[_0xc529('0x26')][_0xc529('0x27')]);_0x2cbbc8[_0xc529('0x2f')]=_['keys'](_0x55ef2c['query']);_0x2cbbc8[_0xc529('0x2d')]=_['intersection'](_0x2cbbc8[_0xc529('0x2a')],_0x2cbbc8['query']);_0x409642['attributes']=_['intersection'](_0x2cbbc8[_0xc529('0x2a')],qs['fields'](_0x55ef2c['query']['fields']));_0x409642[_0xc529('0x32')]=_0x409642[_0xc529('0x32')][_0xc529('0x31')]?_0x409642[_0xc529('0x32')]:_0x2cbbc8['model'];if(_0x55ef2c[_0xc529('0x2f')][_0xc529('0x3f')]){_0x409642['include']=[{'all':!![]}];}_0x409642=_['merge']({},_0x409642,_0x55ef2c[_0xc529('0x3d')]);return db[_0xc529('0x26')][_0xc529('0x45')](_0x409642)[_0xc529('0x3e')](handleEntityNotFound(_0x4e8137,null))[_0xc529('0x3e')](respondWithResult(_0x4e8137,null))[_0xc529('0x43')](handleError(_0x4e8137,null));};exports[_0xc529('0x46')]=function(_0x53dfd1,_0x2c29e9){return db[_0xc529('0x26')][_0xc529('0x46')](_0x53dfd1[_0xc529('0x47')],{})[_0xc529('0x3e')](respondWithResult(_0x2c29e9,0xc9))[_0xc529('0x43')](handleError(_0x2c29e9,null));};exports[_0xc529('0x48')]=function(_0x501e8e,_0x549d6a){if(_0x501e8e[_0xc529('0x47')]['id']){delete _0x501e8e[_0xc529('0x47')]['id'];}return db['JscriptySessionReport'][_0xc529('0x45')]({'where':{'id':_0x501e8e[_0xc529('0x44')]['id']}})[_0xc529('0x3e')](handleEntityNotFound(_0x549d6a,null))[_0xc529('0x3e')](saveUpdates(_0x501e8e[_0xc529('0x47')],null))[_0xc529('0x3e')](respondWithResult(_0x549d6a,null))[_0xc529('0x43')](handleError(_0x549d6a,null));};exports[_0xc529('0x49')]=function(_0x281640,_0x20f879){return db['JscriptySessionReport'][_0xc529('0x45')]({'where':{'id':_0x281640[_0xc529('0x44')]['id']}})[_0xc529('0x3e')](handleEntityNotFound(_0x20f879,null))[_0xc529('0x3e')](removeEntity(_0x20f879,null))[_0xc529('0x43')](handleError(_0x20f879,null));};exports[_0xc529('0x4a')]=function(_0xbce5b0,_0x280fb4){return db['JscriptySessionReport'][_0xc529('0x4a')]()['then'](respondWithResult(_0x280fb4,null))[_0xc529('0x43')](handleError(_0x280fb4,null));};exports[_0xc529('0x4b')]=function(_0x397b94,_0x4df8b1,_0x565d0f){var _0xa38282={'raw':!![],'where':{}};var _0x51218f={};var _0x5bf078={'count':0x0,'rows':[]};return db[_0xc529('0x26')]['findOne']({'where':{'id':_0x397b94[_0xc529('0x44')]['id']}})[_0xc529('0x3e')](handleEntityNotFound(_0x4df8b1,null))[_0xc529('0x3e')](function(_0x35c334){if(_0x35c334){_0x51218f[_0xc529('0x2a')]=_[_0xc529('0x2c')](db['JscriptyQuestionReport'][_0xc529('0x27')]);_0x51218f[_0xc529('0x2f')]=_[_0xc529('0x2c')](_0x397b94[_0xc529('0x2f')]);_0x51218f[_0xc529('0x2d')]=_['intersection'](_0x51218f[_0xc529('0x2a')],_0x51218f['query']);_0xa38282[_0xc529('0x32')]=_['intersection'](_0x51218f[_0xc529('0x2a')],qs['fields'](_0x397b94[_0xc529('0x2f')]['fields']));_0xa38282[_0xc529('0x32')]=_0xa38282[_0xc529('0x32')]['length']?_0xa38282[_0xc529('0x32')]:_0x51218f['model'];if(!_0x397b94[_0xc529('0x2f')][_0xc529('0x33')](_0xc529('0x34'))){_0xa38282[_0xc529('0x35')]=qs[_0xc529('0x35')](_0x397b94[_0xc529('0x2f')][_0xc529('0x35')]);_0xa38282[_0xc529('0x1a')]=qs[_0xc529('0x1a')](_0x397b94[_0xc529('0x2f')][_0xc529('0x1a')]);}_0xa38282[_0xc529('0x36')]=qs[_0xc529('0x37')](_0x397b94[_0xc529('0x2f')][_0xc529('0x37')]);_0xa38282[_0xc529('0x38')]=qs[_0xc529('0x2d')](_[_0xc529('0x4c')](_0x397b94[_0xc529('0x2f')],_0x51218f['filters']));_0xa38282['where']['SessionId']=_0x35c334['id'];if(_0x397b94[_0xc529('0x2f')][_0xc529('0x39')]){_0xa38282[_0xc529('0x38')]=_[_0xc529('0x3a')](_0xa38282[_0xc529('0x38')],{'$or':_[_0xc529('0x2b')](_0xa38282['attributes'],function(_0x411f5a){var _0x28e1ba={};_0x28e1ba[_0x411f5a]={'$like':'%'+_0x397b94['query'][_0xc529('0x39')]+'%'};return _0x28e1ba;})});}_0xa38282=_[_0xc529('0x3a')]({},_0xa38282,_0x397b94['options']);return db['JscriptyQuestionReport'][_0xc529('0x1b')]({'where':_0xa38282[_0xc529('0x38')]})[_0xc529('0x3e')](function(_0xaf7aa6){_0x5bf078[_0xc529('0x1b')]=_0xaf7aa6;if(_0x397b94[_0xc529('0x2f')][_0xc529('0x3f')]){_0xa38282['include']=[{'all':!![]}];}return db[_0xc529('0x4d')][_0xc529('0x41')](_0xa38282);})[_0xc529('0x3e')](function(_0x497ab9){_0x5bf078['rows']=_0x497ab9;return _0x5bf078;});}})[_0xc529('0x3e')](respondWithFilteredResult(_0x4df8b1,_0xa38282))[_0xc529('0x43')](handleError(_0x4df8b1,null));};
\ No newline at end of file
+var _0x67ac=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','send','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','nolimit','order','SessionId','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x67ac,0xed));var _0xc67a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x67ac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc67a('0x0'));var rimraf=require(_0xc67a('0x1'));var zipdir=require(_0xc67a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc67a('0x3'));var BPromise=require(_0xc67a('0x4'));var Mustache=require(_0xc67a('0x5'));var util=require(_0xc67a('0x6'));var path=require(_0xc67a('0x7'));var sox=require(_0xc67a('0x8'));var csv=require(_0xc67a('0x9'));var ejs=require(_0xc67a('0xa'));var fs=require('fs');var fs_extra=require(_0xc67a('0xb'));var _=require(_0xc67a('0xc'));var squel=require(_0xc67a('0xd'));var crypto=require(_0xc67a('0xe'));var jsforce=require(_0xc67a('0xf'));var deskjs=require(_0xc67a('0x10'));var toCsv=require(_0xc67a('0x9'));var querystring=require(_0xc67a('0x11'));var Papa=require('papaparse');var Redis=require(_0xc67a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc67a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc67a('0x14'));var logger=require(_0xc67a('0x15'))('api');var utils=require(_0xc67a('0x16'));var config=require(_0xc67a('0x17'));var licenseUtil=require(_0xc67a('0x18'));var db=require(_0xc67a('0x19'))['db'];function respondWithStatusCode(_0xcb584c,_0x5d6573){_0x5d6573=_0x5d6573||0xcc;return function(_0x3819ad){if(_0x3819ad){return _0xcb584c['sendStatus'](_0x5d6573);}return _0xcb584c[_0xc67a('0x1a')](_0x5d6573)[_0xc67a('0x1b')]();};}function respondWithResult(_0x4ffcd6,_0x4b8a50){_0x4b8a50=_0x4b8a50||0xc8;return function(_0x2c87ca){if(_0x2c87ca){return _0x4ffcd6[_0xc67a('0x1a')](_0x4b8a50)['json'](_0x2c87ca);}};}function respondWithFilteredResult(_0x85fe3a,_0x3b94ec){return function(_0x520f2b){if(_0x520f2b){var _0x1c845d=typeof _0x3b94ec[_0xc67a('0x1c')]===_0xc67a('0x1d')&&typeof _0x3b94ec['limit']==='undefined';var _0x3a9810=_0x520f2b['count'];var _0x3b754b=_0x1c845d?0x0:_0x3b94ec[_0xc67a('0x1c')];var _0x4a7651=_0x1c845d?_0x520f2b['count']:_0x3b94ec[_0xc67a('0x1c')]+_0x3b94ec[_0xc67a('0x1e')];var _0x22b1b3;if(_0x4a7651>=_0x3a9810){_0x4a7651=_0x3a9810;_0x22b1b3=0xc8;}else{_0x22b1b3=0xce;}_0x85fe3a[_0xc67a('0x1a')](_0x22b1b3);return _0x85fe3a[_0xc67a('0x1f')](_0xc67a('0x20'),_0x3b754b+'-'+_0x4a7651+'/'+_0x3a9810)[_0xc67a('0x21')](_0x520f2b);}return null;};}function patchUpdates(_0x36ac70){return function(_0x1cb6f2){try{jsonpatch[_0xc67a('0x22')](_0x1cb6f2,_0x36ac70,!![]);}catch(_0x17aff4){return BPromise[_0xc67a('0x23')](_0x17aff4);}return _0x1cb6f2['save']();};}function saveUpdates(_0x5d9993,_0xb6cff8){return function(_0x8b82b7){if(_0x8b82b7){return _0x8b82b7[_0xc67a('0x24')](_0x5d9993)[_0xc67a('0x25')](function(_0x322574){return _0x322574;});}return null;};}function removeEntity(_0x4a6b5f,_0x112ca8){return function(_0x453698){if(_0x453698){return _0x453698[_0xc67a('0x26')]()[_0xc67a('0x25')](function(){_0x4a6b5f[_0xc67a('0x1a')](0xcc)[_0xc67a('0x1b')]();});}};}function handleEntityNotFound(_0x501f48,_0x3434a1){return function(_0x265180){if(!_0x265180){_0x501f48[_0xc67a('0x27')](0x194);}return _0x265180;};}function handleError(_0x5e8aba,_0x97f874){_0x97f874=_0x97f874||0x1f4;return function(_0x3091b8){logger[_0xc67a('0x28')](_0x3091b8[_0xc67a('0x29')]);if(_0x3091b8['name']){delete _0x3091b8['name'];}_0x5e8aba[_0xc67a('0x1a')](_0x97f874)[_0xc67a('0x2a')](_0x3091b8);};}exports['index']=function(_0x3237f0,_0xcea62){var _0x21329a={},_0x584720={},_0x21c89e={'count':0x0,'rows':[]};var _0x2fff2a=_['map'](db[_0xc67a('0x2b')][_0xc67a('0x2c')],function(_0x335dd6){return{'name':_0x335dd6[_0xc67a('0x2d')],'type':_0x335dd6[_0xc67a('0x2e')][_0xc67a('0x2f')]};});_0x584720[_0xc67a('0x30')]=_[_0xc67a('0x31')](_0x2fff2a,_0xc67a('0x32'));_0x584720['query']=_[_0xc67a('0x33')](_0x3237f0[_0xc67a('0x34')]);_0x584720[_0xc67a('0x35')]=_[_0xc67a('0x36')](_0x584720[_0xc67a('0x30')],_0x584720[_0xc67a('0x34')]);_0x21329a[_0xc67a('0x37')]=_['intersection'](_0x584720[_0xc67a('0x30')],qs[_0xc67a('0x38')](_0x3237f0[_0xc67a('0x34')][_0xc67a('0x38')]));_0x21329a[_0xc67a('0x37')]=_0x21329a[_0xc67a('0x37')][_0xc67a('0x39')]?_0x21329a[_0xc67a('0x37')]:_0x584720[_0xc67a('0x30')];if(!_0x3237f0[_0xc67a('0x34')]['hasOwnProperty']('nolimit')){_0x21329a['limit']=qs['limit'](_0x3237f0[_0xc67a('0x34')]['limit']);_0x21329a[_0xc67a('0x1c')]=qs[_0xc67a('0x1c')](_0x3237f0['query'][_0xc67a('0x1c')]);}_0x21329a['order']=qs[_0xc67a('0x3a')](_0x3237f0[_0xc67a('0x34')][_0xc67a('0x3a')]);_0x21329a[_0xc67a('0x3b')]=qs[_0xc67a('0x35')](_[_0xc67a('0x3c')](_0x3237f0['query'],_0x584720['filters']),_0x2fff2a);if(_0x3237f0[_0xc67a('0x34')][_0xc67a('0x3d')]){_0x21329a['where']=_['merge'](_0x21329a['where'],{'$or':_[_0xc67a('0x31')](_0x2fff2a,function(_0x52ef71){if(_0x52ef71['type']!==_0xc67a('0x3e')){var _0x48c301={};_0x48c301[_0x52ef71[_0xc67a('0x32')]]={'$like':'%'+_0x3237f0['query']['filter']+'%'};return _0x48c301;}})});}_0x21329a=_[_0xc67a('0x3f')]({},_0x21329a,_0x3237f0['options']);var _0x5df0b8={'where':_0x21329a[_0xc67a('0x3b')]};return db['JscriptySessionReport'][_0xc67a('0x40')](_0x5df0b8)[_0xc67a('0x25')](function(_0x3e7665){_0x21c89e[_0xc67a('0x40')]=_0x3e7665;if(_0x3237f0[_0xc67a('0x34')][_0xc67a('0x41')]){_0x21329a[_0xc67a('0x42')]=[{'all':!![]}];}return db[_0xc67a('0x2b')][_0xc67a('0x43')](_0x21329a);})['then'](function(_0x1369eb){_0x21c89e[_0xc67a('0x44')]=_0x1369eb;return _0x21c89e;})[_0xc67a('0x25')](respondWithFilteredResult(_0xcea62,_0x21329a))['catch'](handleError(_0xcea62,null));};exports[_0xc67a('0x45')]=function(_0x2d043a,_0x1ea037){var _0x985676={'raw':!![],'where':{'id':_0x2d043a[_0xc67a('0x46')]['id']}},_0x278385={};_0x278385['model']=_[_0xc67a('0x33')](db['JscriptySessionReport'][_0xc67a('0x2c')]);_0x278385[_0xc67a('0x34')]=_[_0xc67a('0x33')](_0x2d043a['query']);_0x278385['filters']=_['intersection'](_0x278385[_0xc67a('0x30')],_0x278385[_0xc67a('0x34')]);_0x985676[_0xc67a('0x37')]=_['intersection'](_0x278385[_0xc67a('0x30')],qs['fields'](_0x2d043a['query']['fields']));_0x985676[_0xc67a('0x37')]=_0x985676[_0xc67a('0x37')][_0xc67a('0x39')]?_0x985676[_0xc67a('0x37')]:_0x278385['model'];if(_0x2d043a[_0xc67a('0x34')][_0xc67a('0x41')]){_0x985676['include']=[{'all':!![]}];}_0x985676=_['merge']({},_0x985676,_0x2d043a[_0xc67a('0x47')]);return db['JscriptySessionReport']['find'](_0x985676)[_0xc67a('0x25')](handleEntityNotFound(_0x1ea037,null))['then'](respondWithResult(_0x1ea037,null))[_0xc67a('0x48')](handleError(_0x1ea037,null));};exports[_0xc67a('0x49')]=function(_0x387ca2,_0xc72334){return db[_0xc67a('0x2b')][_0xc67a('0x49')](_0x387ca2['body'],{})[_0xc67a('0x25')](respondWithResult(_0xc72334,0xc9))[_0xc67a('0x48')](handleError(_0xc72334,null));};exports[_0xc67a('0x24')]=function(_0x3aa8b9,_0x5a6b43){if(_0x3aa8b9['body']['id']){delete _0x3aa8b9[_0xc67a('0x4a')]['id'];}return db[_0xc67a('0x2b')][_0xc67a('0x4b')]({'where':{'id':_0x3aa8b9[_0xc67a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a6b43,null))[_0xc67a('0x25')](saveUpdates(_0x3aa8b9[_0xc67a('0x4a')],null))[_0xc67a('0x25')](respondWithResult(_0x5a6b43,null))[_0xc67a('0x48')](handleError(_0x5a6b43,null));};exports[_0xc67a('0x26')]=function(_0x4009ca,_0x438703){return db[_0xc67a('0x2b')]['find']({'where':{'id':_0x4009ca[_0xc67a('0x46')]['id']}})[_0xc67a('0x25')](handleEntityNotFound(_0x438703,null))[_0xc67a('0x25')](removeEntity(_0x438703,null))[_0xc67a('0x48')](handleError(_0x438703,null));};exports[_0xc67a('0x4c')]=function(_0xe4166a,_0xc18f0f){return db[_0xc67a('0x2b')][_0xc67a('0x4c')]()['then'](respondWithResult(_0xc18f0f,null))[_0xc67a('0x48')](handleError(_0xc18f0f,null));};exports[_0xc67a('0x4d')]=function(_0x106bed,_0x5d79a9,_0x460d5e){var _0x576791={'raw':!![],'where':{}};var _0x55c718={};var _0x321e1a={'count':0x0,'rows':[]};return db[_0xc67a('0x2b')][_0xc67a('0x4e')]({'where':{'id':_0x106bed[_0xc67a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5d79a9,null))[_0xc67a('0x25')](function(_0x131f26){if(_0x131f26){_0x55c718[_0xc67a('0x30')]=_['keys'](db[_0xc67a('0x4f')][_0xc67a('0x2c')]);_0x55c718[_0xc67a('0x34')]=_[_0xc67a('0x33')](_0x106bed[_0xc67a('0x34')]);_0x55c718[_0xc67a('0x35')]=_[_0xc67a('0x36')](_0x55c718[_0xc67a('0x30')],_0x55c718[_0xc67a('0x34')]);_0x576791[_0xc67a('0x37')]=_[_0xc67a('0x36')](_0x55c718[_0xc67a('0x30')],qs[_0xc67a('0x38')](_0x106bed[_0xc67a('0x34')][_0xc67a('0x38')]));_0x576791[_0xc67a('0x37')]=_0x576791[_0xc67a('0x37')][_0xc67a('0x39')]?_0x576791[_0xc67a('0x37')]:_0x55c718['model'];if(!_0x106bed[_0xc67a('0x34')][_0xc67a('0x50')](_0xc67a('0x51'))){_0x576791[_0xc67a('0x1e')]=qs['limit'](_0x106bed[_0xc67a('0x34')][_0xc67a('0x1e')]);_0x576791[_0xc67a('0x1c')]=qs[_0xc67a('0x1c')](_0x106bed[_0xc67a('0x34')][_0xc67a('0x1c')]);}_0x576791[_0xc67a('0x52')]=qs[_0xc67a('0x3a')](_0x106bed[_0xc67a('0x34')][_0xc67a('0x3a')]);_0x576791['where']=qs[_0xc67a('0x35')](_[_0xc67a('0x3c')](_0x106bed['query'],_0x55c718[_0xc67a('0x35')]));_0x576791[_0xc67a('0x3b')][_0xc67a('0x53')]=_0x131f26['id'];if(_0x106bed[_0xc67a('0x34')][_0xc67a('0x3d')]){_0x576791[_0xc67a('0x3b')]=_[_0xc67a('0x3f')](_0x576791[_0xc67a('0x3b')],{'$or':_[_0xc67a('0x31')](_0x576791[_0xc67a('0x37')],function(_0x330499){var _0x3f0d6c={};_0x3f0d6c[_0x330499]={'$like':'%'+_0x106bed[_0xc67a('0x34')][_0xc67a('0x3d')]+'%'};return _0x3f0d6c;})});}_0x576791=_['merge']({},_0x576791,_0x106bed[_0xc67a('0x47')]);return db[_0xc67a('0x4f')][_0xc67a('0x40')]({'where':_0x576791[_0xc67a('0x3b')]})[_0xc67a('0x25')](function(_0x21fb0b){_0x321e1a[_0xc67a('0x40')]=_0x21fb0b;if(_0x106bed[_0xc67a('0x34')]['includeAll']){_0x576791[_0xc67a('0x42')]=[{'all':!![]}];}return db[_0xc67a('0x4f')][_0xc67a('0x43')](_0x576791);})[_0xc67a('0x25')](function(_0x1ffccf){_0x321e1a['rows']=_0x1ffccf;return _0x321e1a;});}})[_0xc67a('0x25')](respondWithFilteredResult(_0x5d79a9,_0x576791))[_0xc67a('0x48')](handleError(_0x5d79a9,null));};
\ No newline at end of file
index 7653a53..cd92021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash','../../config/logger'];(function(_0x241695,_0x1a8e19){var _0x5792f0=function(_0x35b8f7){while(--_0x35b8f7){_0x241695['push'](_0x241695['shift']());}};_0x5792f0(++_0x1a8e19);}(_0x277c,0x153));var _0xc277=function(_0x22e968,_0x28b31c){_0x22e968=_0x22e968-0x0;var _0x3c399c=_0x277c[_0x22e968];return _0x3c399c;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('JscriptySessionReport',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4745=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions','lodash','util','../../config/logger'];(function(_0x2fedcc,_0x5f2cee){var _0x565db0=function(_0x50cd83){while(--_0x50cd83){_0x2fedcc['push'](_0x2fedcc['shift']());}};_0x565db0(++_0x5f2cee);}(_0x4745,0x1e7));var _0x5474=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x4745[_0x934425];return _0x31d596;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('JscriptySessionReport',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f06cf49..c8bf48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x347609,_0xc16572){var _0x2b8c97=function(_0x36bbf8){while(--_0x36bbf8){_0x347609['push'](_0x347609['shift']());}};_0x2b8c97(++_0xc16572);}(_0x90b1,0x1bb));var _0x190b=function(_0x190e03,_0x2b861a){_0x190e03=_0x190e03-0x0;var _0x3cca82=_0x90b1[_0x190e03];return _0x3cca82;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}
\ No newline at end of file
+var _0x5fdc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptySessionReport,\x20%s,\x20%s','info','lodash','util','moment','bluebird','randomstring'];(function(_0x5a3b5f,_0x1033e0){var _0x16a28c=function(_0x467d6c){while(--_0x467d6c){_0x5a3b5f['push'](_0x5a3b5f['shift']());}};_0x16a28c(++_0x1033e0);}(_0x5fdc,0x127));var _0xc5fd=function(_0x2c8b03,_0x57644f){_0x2c8b03=_0x2c8b03-0x0;var _0x58d1cf=_0x5fdc[_0x2c8b03];return _0x58d1cf;};'use strict';var _=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));var BPromise=require(_0xc5fd('0x3'));var rs=require(_0xc5fd('0x4'));var fs=require('fs');var Redis=require(_0xc5fd('0x5'));var db=require(_0xc5fd('0x6'))['db'];var utils=require(_0xc5fd('0x7'));var logger=require(_0xc5fd('0x8'))(_0xc5fd('0x9'));var config=require(_0xc5fd('0xa'));var jayson=require(_0xc5fd('0xb'));var client=jayson[_0xc5fd('0xc')][_0xc5fd('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x15ffe7,_0x5a2eb4,_0x5d86e5){return new BPromise(function(_0x493389,_0x224801){return client[_0xc5fd('0xe')](_0x15ffe7,_0x5d86e5)[_0xc5fd('0xf')](function(_0x45c91f){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x5a2eb4,_0xc5fd('0x10'));logger[_0xc5fd('0x11')](_0xc5fd('0x12'),_0x5a2eb4,_0xc5fd('0x10'),JSON[_0xc5fd('0x13')](_0x45c91f));if(_0x45c91f[_0xc5fd('0x14')]){if(_0x45c91f['error'][_0xc5fd('0x15')]===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x224801(_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);}logger[_0xc5fd('0x14')](_0xc5fd('0x17'),_0x5a2eb4,_0x45c91f[_0xc5fd('0x14')][_0xc5fd('0x16')]);return _0x493389(_0x45c91f['error'][_0xc5fd('0x16')]);}else{logger[_0xc5fd('0x18')](_0xc5fd('0x17'),_0x5a2eb4,_0xc5fd('0x10'));_0x493389(_0x45c91f['result']['message']);}})['catch'](function(_0x5529b3){logger['error'](_0xc5fd('0x17'),_0x5a2eb4,_0x5529b3);_0x224801(_0x5529b3);});});}
\ No newline at end of file
index cc2ac5f..3cdfee9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb209=['./license.controller','get','index','put','/:id','isAuthenticated','update','/download_log_file','downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4aab0b,_0x357078){var _0x28c3e9=function(_0x1fb822){while(--_0x1fb822){_0x4aab0b['push'](_0x4aab0b['shift']());}};_0x28c3e9(++_0x357078);}(_0xb209,0x76));var _0x9b20=function(_0x3da2d4,_0x4f2fbe){_0x3da2d4=_0x3da2d4-0x0;var _0x4a99f5=_0xb209[_0x3da2d4];return _0x4a99f5;};'use strict';var multer=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var path=require(_0x9b20('0x2'));var timeout=require(_0x9b20('0x3'));var express=require(_0x9b20('0x4'));var router=express[_0x9b20('0x5')]();var fs_extra=require(_0x9b20('0x6'));var auth=require(_0x9b20('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b20('0x8'));router[_0x9b20('0x9')]('/',controller[_0x9b20('0xa')]);router[_0x9b20('0xb')](_0x9b20('0xc'),auth[_0x9b20('0xd')](),controller[_0x9b20('0xe')]);router[_0x9b20('0x9')](_0x9b20('0xf'),auth['isAuthenticated'](),controller[_0x9b20('0x10')]);module[_0x9b20('0x11')]=router;
\ No newline at end of file
+var _0x0fd5=['../../config/environment','./license.controller','index','put','/:id','update','get','/download_log_file','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4c35e5,_0x19e791){var _0x2ffcd1=function(_0x20c5cc){while(--_0x20c5cc){_0x4c35e5['push'](_0x4c35e5['shift']());}};_0x2ffcd1(++_0x19e791);}(_0x0fd5,0x158));var _0x50fd=function(_0x3785b8,_0x12fdd7){_0x3785b8=_0x3785b8-0x0;var _0x19b07a=_0x0fd5[_0x3785b8];return _0x19b07a;};'use strict';var multer=require(_0x50fd('0x0'));var util=require(_0x50fd('0x1'));var path=require(_0x50fd('0x2'));var timeout=require(_0x50fd('0x3'));var express=require(_0x50fd('0x4'));var router=express[_0x50fd('0x5')]();var fs_extra=require(_0x50fd('0x6'));var auth=require(_0x50fd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x50fd('0x8'));var controller=require(_0x50fd('0x9'));router['get']('/',controller[_0x50fd('0xa')]);router[_0x50fd('0xb')](_0x50fd('0xc'),auth['isAuthenticated'](),controller[_0x50fd('0xd')]);router[_0x50fd('0xe')](_0x50fd('0xf'),auth['isAuthenticated'](),controller['downloadLogFile']);module['exports']=router;
\ No newline at end of file
index c8eb9de..1e25a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa412=['STRING','sequelize','TEXT'];(function(_0x2410cb,_0x54d657){var _0x4088d6=function(_0x93a636){while(--_0x93a636){_0x2410cb['push'](_0x2410cb['shift']());}};_0x4088d6(++_0x54d657);}(_0xa412,0x1f3));var _0x2a41=function(_0x1b1456,_0x1a7ab3){_0x1b1456=_0x1b1456-0x0;var _0x234a36=_0xa412[_0x1b1456];return _0x234a36;};'use strict';var Sequelize=require(_0x2a41('0x0'));module['exports']={'license':{'type':Sequelize[_0x2a41('0x1')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x2a41('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc02b=['sequelize','exports','STRING','INTEGER'];(function(_0x23693b,_0x8d5428){var _0x545e9a=function(_0x3a4024){while(--_0x3a4024){_0x23693b['push'](_0x23693b['shift']());}};_0x545e9a(++_0x8d5428);}(_0xc02b,0x68));var _0xbc02=function(_0x4965d1,_0xb546d4){_0x4965d1=_0x4965d1-0x0;var _0x59e849=_0xc02b[_0x4965d1];return _0x59e849;};'use strict';var Sequelize=require(_0xbc02('0x0'));module[_0xbc02('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xbc02('0x2')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xbc02('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 578c2e6..ccd7254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdebc=['/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','end','error','stack','name','send','../../config/license/util','index','model','keys','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','body','License','find','params','get','checkLicense','key','downloadLogFile','license-info.log'];(function(_0x1a6fdd,_0xebbd98){var _0x2b49bd=function(_0x4cfc1a){while(--_0x4cfc1a){_0x1a6fdd['push'](_0x1a6fdd['shift']());}};_0x2b49bd(++_0xebbd98);}(_0xdebc,0x9c));var _0xcdeb=function(_0x33f880,_0x163f79){_0x33f880=_0x33f880-0x0;var _0x47affb=_0xdebc[_0x33f880];return _0x47affb;};'use strict';var emlformat=require(_0xcdeb('0x0'));var rimraf=require(_0xcdeb('0x1'));var zipdir=require(_0xcdeb('0x2'));var jsonpatch=require(_0xcdeb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xcdeb('0x4'));var util=require(_0xcdeb('0x5'));var path=require(_0xcdeb('0x6'));var sox=require(_0xcdeb('0x7'));var csv=require(_0xcdeb('0x8'));var ejs=require(_0xcdeb('0x9'));var fs=require('fs');var fs_extra=require(_0xcdeb('0xa'));var _=require(_0xcdeb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xcdeb('0xc'));var deskjs=require(_0xcdeb('0xd'));var toCsv=require(_0xcdeb('0x8'));var querystring=require(_0xcdeb('0xe'));var Papa=require(_0xcdeb('0xf'));var Redis=require(_0xcdeb('0x10'));var authService=require(_0xcdeb('0x11'));var qs=require(_0xcdeb('0x12'));var as=require(_0xcdeb('0x13'));var hardwareService=require(_0xcdeb('0x14'));var logger=require(_0xcdeb('0x15'))(_0xcdeb('0x16'));var utils=require(_0xcdeb('0x17'));var config=require(_0xcdeb('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe9dffb,_0x133e3d){_0x133e3d=_0x133e3d||0xcc;return function(_0x14e942){if(_0x14e942){return _0xe9dffb[_0xcdeb('0x19')](_0x133e3d);}return _0xe9dffb[_0xcdeb('0x1a')](_0x133e3d)['end']();};}function respondWithResult(_0xc5f3e2,_0x32393f){_0x32393f=_0x32393f||0xc8;return function(_0x475fad){if(_0x475fad){return _0xc5f3e2['status'](_0x32393f)[_0xcdeb('0x1b')](_0x475fad);}};}function respondWithFilteredResult(_0x589973,_0x4be37c){return function(_0xaacc91){if(_0xaacc91){var _0x3dde9b=typeof _0x4be37c[_0xcdeb('0x1c')]===_0xcdeb('0x1d')&&typeof _0x4be37c[_0xcdeb('0x1e')]===_0xcdeb('0x1d');var _0x301ef5=_0xaacc91[_0xcdeb('0x1f')];var _0x49127c=_0x3dde9b?0x0:_0x4be37c[_0xcdeb('0x1c')];var _0x5d5e08=_0x3dde9b?_0xaacc91[_0xcdeb('0x1f')]:_0x4be37c[_0xcdeb('0x1c')]+_0x4be37c[_0xcdeb('0x1e')];var _0x483f5f;if(_0x5d5e08>=_0x301ef5){_0x5d5e08=_0x301ef5;_0x483f5f=0xc8;}else{_0x483f5f=0xce;}_0x589973[_0xcdeb('0x1a')](_0x483f5f);return _0x589973[_0xcdeb('0x20')]('Content-Range',_0x49127c+'-'+_0x5d5e08+'/'+_0x301ef5)[_0xcdeb('0x1b')](_0xaacc91);}return null;};}function patchUpdates(_0x350921){return function(_0x29b5f3){try{jsonpatch[_0xcdeb('0x21')](_0x29b5f3,_0x350921,!![]);}catch(_0x2dd305){return BPromise[_0xcdeb('0x22')](_0x2dd305);}return _0x29b5f3[_0xcdeb('0x23')]();};}function saveUpdates(_0x16e1a5,_0x46a1db){return function(_0x5bc614){if(_0x5bc614){return _0x5bc614['update'](_0x16e1a5)[_0xcdeb('0x24')](function(_0x1d75b6){return _0x1d75b6;});}return null;};}function removeEntity(_0x368dc5,_0x27d908){return function(_0x51eb11){if(_0x51eb11){return _0x51eb11[_0xcdeb('0x25')]()[_0xcdeb('0x24')](function(){_0x368dc5[_0xcdeb('0x1a')](0xcc)[_0xcdeb('0x26')]();});}};}function handleEntityNotFound(_0x46ce2b,_0x1d8c2b){return function(_0x3eb0db){if(!_0x3eb0db){_0x46ce2b['sendStatus'](0x194);}return _0x3eb0db;};}function handleError(_0x10ed02,_0x19ea4c){_0x19ea4c=_0x19ea4c||0x1f4;return function(_0x241e91){logger[_0xcdeb('0x27')](_0x241e91[_0xcdeb('0x28')]);if(_0x241e91[_0xcdeb('0x29')]){delete _0x241e91[_0xcdeb('0x29')];}_0x10ed02['status'](_0x19ea4c)[_0xcdeb('0x2a')](_0x241e91);};}var utilLicense=require(_0xcdeb('0x2b'));exports[_0xcdeb('0x2c')]=function(_0xf433c4,_0x6549d5){var _0x2e2be6={'raw':!![],'where':{'id':0x1}},_0x30586e={};_0x30586e[_0xcdeb('0x2d')]=_[_0xcdeb('0x2e')](db['License']['rawAttributes']);_0x30586e[_0xcdeb('0x2f')]=_[_0xcdeb('0x2e')](_0xf433c4[_0xcdeb('0x2f')]);_0x30586e[_0xcdeb('0x30')]=_[_0xcdeb('0x31')](_0x30586e[_0xcdeb('0x2d')],_0x30586e[_0xcdeb('0x2f')]);_0x2e2be6[_0xcdeb('0x32')]=_[_0xcdeb('0x31')](_0x30586e['model'],qs[_0xcdeb('0x33')](_0xf433c4[_0xcdeb('0x2f')][_0xcdeb('0x33')]));_0x2e2be6[_0xcdeb('0x32')]=_0x2e2be6['attributes'][_0xcdeb('0x34')]?_0x2e2be6[_0xcdeb('0x32')]:_0x30586e[_0xcdeb('0x2d')];_0x2e2be6=_[_0xcdeb('0x35')]({},_0x2e2be6,_0xf433c4[_0xcdeb('0x36')]);return utilLicense[_0xcdeb('0x37')](_0x2e2be6)[_0xcdeb('0x24')](respondWithResult(_0x6549d5,null))[_0xcdeb('0x38')](handleError(_0x6549d5,null));};exports['update']=function(_0x429683,_0x2b1b2d){if(_0x429683[_0xcdeb('0x39')]['id']){delete _0x429683[_0xcdeb('0x39')]['id'];}return db[_0xcdeb('0x3a')][_0xcdeb('0x3b')]({'where':{'id':_0x429683[_0xcdeb('0x3c')]['id']}})[_0xcdeb('0x24')](handleEntityNotFound(_0x2b1b2d,null))[_0xcdeb('0x24')](function(_0x13b34e){var _0x33b975=_0x13b34e[_0xcdeb('0x3d')]({'plain':!![]});return utilLicense[_0xcdeb('0x3e')](_0x33b975,_0x429683[_0xcdeb('0x39')][_0xcdeb('0x3f')]);})[_0xcdeb('0x24')](function(_0x1282f1){if(!_0x1282f1['demo']){return saveUpdates(_0x429683[_0xcdeb('0x39')],null);}return _0x1282f1;})['then'](respondWithResult(_0x2b1b2d,null))[_0xcdeb('0x38')](handleError(_0x2b1b2d,null));};exports[_0xcdeb('0x40')]=function(_0x5e96a6,_0x2e5472){var _0x1e2b86=_0xcdeb('0x41');var _0x3d3422=path['join'](_0xcdeb('0x42'),'log',_0xcdeb('0x43'),_0x1e2b86);_0x2e5472[_0xcdeb('0x44')](_0xcdeb('0x45'),_0xcdeb('0x46')+_0x1e2b86);_0x2e5472['set'](_0xcdeb('0x47'),_0xcdeb('0x48'));_0x2e5472[_0xcdeb('0x49')](_0x3d3422);};
\ No newline at end of file
+var _0x4e13=['key','demo','license-info.log','join','log','xcally','setHeader','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','model','keys','License','rawAttributes','query','intersection','attributes','fields','length','merge','options','catch','update','body','find','get','checkLicense'];(function(_0x4466ce,_0x3fe925){var _0x38f881=function(_0x5041ce){while(--_0x5041ce){_0x4466ce['push'](_0x4466ce['shift']());}};_0x38f881(++_0x3fe925);}(_0x4e13,0x1ae));var _0x34e1=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0x4e13[_0x388914];return _0x1f9111;};'use strict';var emlformat=require(_0x34e1('0x0'));var rimraf=require(_0x34e1('0x1'));var zipdir=require(_0x34e1('0x2'));var jsonpatch=require(_0x34e1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34e1('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x34e1('0x5'));var sox=require(_0x34e1('0x6'));var csv=require('to-csv');var ejs=require(_0x34e1('0x7'));var fs=require('fs');var fs_extra=require(_0x34e1('0x8'));var _=require('lodash');var squel=require(_0x34e1('0x9'));var crypto=require(_0x34e1('0xa'));var jsforce=require(_0x34e1('0xb'));var deskjs=require(_0x34e1('0xc'));var toCsv=require(_0x34e1('0xd'));var querystring=require(_0x34e1('0xe'));var Papa=require(_0x34e1('0xf'));var Redis=require(_0x34e1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x34e1('0x11'));var as=require(_0x34e1('0x12'));var hardwareService=require(_0x34e1('0x13'));var logger=require('../../config/logger')(_0x34e1('0x14'));var utils=require(_0x34e1('0x15'));var config=require(_0x34e1('0x16'));var licenseUtil=require(_0x34e1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f984f,_0x4c491f){_0x4c491f=_0x4c491f||0xcc;return function(_0x2d6a89){if(_0x2d6a89){return _0x1f984f[_0x34e1('0x18')](_0x4c491f);}return _0x1f984f[_0x34e1('0x19')](_0x4c491f)[_0x34e1('0x1a')]();};}function respondWithResult(_0x2ce176,_0x113464){_0x113464=_0x113464||0xc8;return function(_0x48d813){if(_0x48d813){return _0x2ce176[_0x34e1('0x19')](_0x113464)[_0x34e1('0x1b')](_0x48d813);}};}function respondWithFilteredResult(_0x45d1db,_0x515b09){return function(_0x5568f8){if(_0x5568f8){var _0x34e466=typeof _0x515b09[_0x34e1('0x1c')]===_0x34e1('0x1d')&&typeof _0x515b09[_0x34e1('0x1e')]===_0x34e1('0x1d');var _0x38b05c=_0x5568f8[_0x34e1('0x1f')];var _0x59c6b4=_0x34e466?0x0:_0x515b09[_0x34e1('0x1c')];var _0x6e508f=_0x34e466?_0x5568f8[_0x34e1('0x1f')]:_0x515b09[_0x34e1('0x1c')]+_0x515b09[_0x34e1('0x1e')];var _0x2e8f2c;if(_0x6e508f>=_0x38b05c){_0x6e508f=_0x38b05c;_0x2e8f2c=0xc8;}else{_0x2e8f2c=0xce;}_0x45d1db[_0x34e1('0x19')](_0x2e8f2c);return _0x45d1db[_0x34e1('0x20')](_0x34e1('0x21'),_0x59c6b4+'-'+_0x6e508f+'/'+_0x38b05c)[_0x34e1('0x1b')](_0x5568f8);}return null;};}function patchUpdates(_0x250bae){return function(_0x2bd30d){try{jsonpatch[_0x34e1('0x22')](_0x2bd30d,_0x250bae,!![]);}catch(_0x10b2d4){return BPromise[_0x34e1('0x23')](_0x10b2d4);}return _0x2bd30d[_0x34e1('0x24')]();};}function saveUpdates(_0x503eb8,_0x5835a5){return function(_0x37c83c){if(_0x37c83c){return _0x37c83c['update'](_0x503eb8)[_0x34e1('0x25')](function(_0x17ff89){return _0x17ff89;});}return null;};}function removeEntity(_0x4487c7,_0x1a1502){return function(_0x2fa086){if(_0x2fa086){return _0x2fa086[_0x34e1('0x26')]()['then'](function(){_0x4487c7['status'](0xcc)[_0x34e1('0x1a')]();});}};}function handleEntityNotFound(_0x413040,_0x421311){return function(_0x24a364){if(!_0x24a364){_0x413040[_0x34e1('0x18')](0x194);}return _0x24a364;};}function handleError(_0x5a60ed,_0x1096e3){_0x1096e3=_0x1096e3||0x1f4;return function(_0x14d9b5){logger[_0x34e1('0x27')](_0x14d9b5[_0x34e1('0x28')]);if(_0x14d9b5[_0x34e1('0x29')]){delete _0x14d9b5[_0x34e1('0x29')];}_0x5a60ed['status'](_0x1096e3)['send'](_0x14d9b5);};}var utilLicense=require(_0x34e1('0x17'));exports[_0x34e1('0x2a')]=function(_0xe66ac3,_0x513736){var _0x4050fb={'raw':!![],'where':{'id':0x1}},_0x13607c={};_0x13607c[_0x34e1('0x2b')]=_[_0x34e1('0x2c')](db[_0x34e1('0x2d')][_0x34e1('0x2e')]);_0x13607c['query']=_['keys'](_0xe66ac3[_0x34e1('0x2f')]);_0x13607c['filters']=_[_0x34e1('0x30')](_0x13607c['model'],_0x13607c['query']);_0x4050fb[_0x34e1('0x31')]=_['intersection'](_0x13607c[_0x34e1('0x2b')],qs[_0x34e1('0x32')](_0xe66ac3['query'][_0x34e1('0x32')]));_0x4050fb[_0x34e1('0x31')]=_0x4050fb[_0x34e1('0x31')][_0x34e1('0x33')]?_0x4050fb['attributes']:_0x13607c[_0x34e1('0x2b')];_0x4050fb=_[_0x34e1('0x34')]({},_0x4050fb,_0xe66ac3[_0x34e1('0x35')]);return utilLicense['getLicense'](_0x4050fb)['then'](respondWithResult(_0x513736,null))[_0x34e1('0x36')](handleError(_0x513736,null));};exports[_0x34e1('0x37')]=function(_0x28dd08,_0x4eb144){if(_0x28dd08['body']['id']){delete _0x28dd08[_0x34e1('0x38')]['id'];}return db['License'][_0x34e1('0x39')]({'where':{'id':_0x28dd08['params']['id']}})[_0x34e1('0x25')](handleEntityNotFound(_0x4eb144,null))[_0x34e1('0x25')](function(_0x3895b1){var _0x3e2fd8=_0x3895b1[_0x34e1('0x3a')]({'plain':!![]});return utilLicense[_0x34e1('0x3b')](_0x3e2fd8,_0x28dd08['body'][_0x34e1('0x3c')]);})[_0x34e1('0x25')](function(_0x236a08){if(!_0x236a08[_0x34e1('0x3d')]){return saveUpdates(_0x28dd08[_0x34e1('0x38')],null);}return _0x236a08;})[_0x34e1('0x25')](respondWithResult(_0x4eb144,null))['catch'](handleError(_0x4eb144,null));};exports['downloadLogFile']=function(_0x257914,_0x176260){var _0x8dc889=_0x34e1('0x3e');var _0x2cbd44=path[_0x34e1('0x3f')]('/var',_0x34e1('0x40'),_0x34e1('0x41'),_0x8dc889);_0x176260[_0x34e1('0x42')]('Content-disposition','attachment;\x20filename='+_0x8dc889);_0x176260[_0x34e1('0x20')](_0x34e1('0x43'),_0x34e1('0x44'));_0x176260[_0x34e1('0x45')](_0x2cbd44);};
\ No newline at end of file
index b23a2e1..8237c04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87f1=['rimraf','../../config/environment','./license.attributes','exports','define','lodash','util','moment','bluebird','request-promise','path'];(function(_0x5be97d,_0x4670e3){var _0x121cad=function(_0x538342){while(--_0x538342){_0x5be97d['push'](_0x5be97d['shift']());}};_0x121cad(++_0x4670e3);}(_0x87f1,0xf7));var _0x187f=function(_0x4bcc73,_0x282e20){_0x4bcc73=_0x4bcc73-0x0;var _0x2571c1=_0x87f1[_0x4bcc73];return _0x2571c1;};'use strict';var _=require(_0x187f('0x0'));var util=require(_0x187f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x187f('0x2'));var BPromise=require(_0x187f('0x3'));var rp=require(_0x187f('0x4'));var fs=require('fs');var path=require(_0x187f('0x5'));var rimraf=require(_0x187f('0x6'));var config=require(_0x187f('0x7'));var attributes=require(_0x187f('0x8'));module[_0x187f('0x9')]=function(_0x563e4b,_0x84ac83){return _0x563e4b[_0x187f('0xa')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4936=['rimraf','../../config/environment','./license.attributes','define','license','lodash','util','../../config/logger','api','request-promise'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x4936,0xeb));var _0x6493=function(_0x5f2d69,_0x17d4dd){_0x5f2d69=_0x5f2d69-0x0;var _0x364bd3=_0x4936[_0x5f2d69];return _0x364bd3;};'use strict';var _=require(_0x6493('0x0'));var util=require(_0x6493('0x1'));var logger=require(_0x6493('0x2'))(_0x6493('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6493('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6493('0x5'));var config=require(_0x6493('0x6'));var attributes=require(_0x6493('0x7'));module['exports']=function(_0x5e0ed8,_0x1b5901){return _0x5e0ed8[_0x6493('0x8')]('License',attributes,{'tableName':_0x6493('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5f5b6b1..1a29eb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fba=['../../config/logger','rpc','jayson/promise','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x4fba,0x1c6));var _0xa4fb=function(_0x23eaa0,_0x55217b){_0x23eaa0=_0x23eaa0-0x0;var _0x1c11b3=_0x4fba[_0x23eaa0];return _0x1c11b3;};'use strict';var _=require('lodash');var util=require(_0xa4fb('0x0'));var moment=require(_0xa4fb('0x1'));var BPromise=require(_0xa4fb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4fb('0x3'));var db=require(_0xa4fb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4fb('0x5'))(_0xa4fb('0x6'));var config=require('../../config/environment');var jayson=require(_0xa4fb('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38083b,_0x4098a6,_0x1f225f){return new BPromise(function(_0x357a40,_0x4b13b8){return client['request'](_0x38083b,_0x1f225f)[_0xa4fb('0x8')](function(_0x1b15fe){logger[_0xa4fb('0x9')](_0xa4fb('0xa'),_0x4098a6,_0xa4fb('0xb'));logger[_0xa4fb('0xc')](_0xa4fb('0xd'),_0x4098a6,_0xa4fb('0xb'),JSON['stringify'](_0x1b15fe));if(_0x1b15fe[_0xa4fb('0xe')]){if(_0x1b15fe[_0xa4fb('0xe')]['code']===0x1f4){logger[_0xa4fb('0xe')]('License,\x20%s,\x20%s',_0x4098a6,_0x1b15fe[_0xa4fb('0xe')][_0xa4fb('0xf')]);return _0x4b13b8(_0x1b15fe[_0xa4fb('0xe')][_0xa4fb('0xf')]);}logger[_0xa4fb('0xe')](_0xa4fb('0xa'),_0x4098a6,_0x1b15fe[_0xa4fb('0xe')][_0xa4fb('0xf')]);return _0x357a40(_0x1b15fe['error'][_0xa4fb('0xf')]);}else{logger['info']('License,\x20%s,\x20%s',_0x4098a6,'request\x20sent');_0x357a40(_0x1b15fe['result'][_0xa4fb('0xf')]);}})[_0xa4fb('0x10')](function(_0x7bf2e9){logger[_0xa4fb('0xe')]('License,\x20%s,\x20%s',_0x4098a6,_0x7bf2e9);_0x4b13b8(_0x7bf2e9);});});}
\ No newline at end of file
+var _0x0cfe=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x5c01fb,_0xb1519c){var _0x3ecad2=function(_0x55dfbc){while(--_0x55dfbc){_0x5c01fb['push'](_0x5c01fb['shift']());}};_0x3ecad2(++_0xb1519c);}(_0x0cfe,0x157));var _0xe0cf=function(_0x3056ee,_0x4863e0){_0x3056ee=_0x3056ee-0x0;var _0x13fd56=_0x0cfe[_0x3056ee];return _0x13fd56;};'use strict';var _=require(_0xe0cf('0x0'));var util=require('util');var moment=require(_0xe0cf('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0cf('0x2'));var fs=require('fs');var Redis=require(_0xe0cf('0x3'));var db=require(_0xe0cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe0cf('0x5'))(_0xe0cf('0x6'));var config=require(_0xe0cf('0x7'));var jayson=require(_0xe0cf('0x8'));var client=jayson['client'][_0xe0cf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd7f0a,_0x5138ef,_0x54e0c8){return new BPromise(function(_0x252862,_0x10a786){return client[_0xe0cf('0xa')](_0xd7f0a,_0x54e0c8)['then'](function(_0x50b2d6){logger[_0xe0cf('0xb')](_0xe0cf('0xc'),_0x5138ef,_0xe0cf('0xd'));logger[_0xe0cf('0xe')](_0xe0cf('0xf'),_0x5138ef,_0xe0cf('0xd'),JSON[_0xe0cf('0x10')](_0x50b2d6));if(_0x50b2d6['error']){if(_0x50b2d6[_0xe0cf('0x11')][_0xe0cf('0x12')]===0x1f4){logger[_0xe0cf('0x11')](_0xe0cf('0xc'),_0x5138ef,_0x50b2d6[_0xe0cf('0x11')][_0xe0cf('0x13')]);return _0x10a786(_0x50b2d6[_0xe0cf('0x11')]['message']);}logger[_0xe0cf('0x11')](_0xe0cf('0xc'),_0x5138ef,_0x50b2d6[_0xe0cf('0x11')][_0xe0cf('0x13')]);return _0x252862(_0x50b2d6[_0xe0cf('0x11')][_0xe0cf('0x13')]);}else{logger[_0xe0cf('0xb')](_0xe0cf('0xc'),_0x5138ef,_0xe0cf('0xd'));_0x252862(_0x50b2d6['result'][_0xe0cf('0x13')]);}})[_0xe0cf('0x14')](function(_0x2fa780){logger[_0xe0cf('0x11')](_0xe0cf('0xc'),_0x5138ef,_0x2fa780);_0x10a786(_0x2fa780);});});}
\ No newline at end of file
index 05c4abd..cb6b3df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a91=['/:id/messages','/:id/verify','/:id/users','getAgents','/:id/dispositions','addDisposition','addAnswer','post','/:id/in_servers','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications','/:id/send','send','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getApplications'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5a91,0x74));var _0x15a9=function(_0x248be4,_0x1f87f3){_0x248be4=_0x248be4-0x0;var _0x530c58=_0x5a91[_0x248be4];return _0x530c58;};'use strict';var multer=require('multer');var util=require(_0x15a9('0x0'));var path=require(_0x15a9('0x1'));var timeout=require('connect-timeout');var express=require(_0x15a9('0x2'));var router=express[_0x15a9('0x3')]();var fs_extra=require(_0x15a9('0x4'));var auth=require(_0x15a9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x15a9('0x6'));var controller=require(_0x15a9('0x7'));router[_0x15a9('0x8')]('/',auth[_0x15a9('0x9')](),controller[_0x15a9('0xa')]);router['get'](_0x15a9('0xb'),auth[_0x15a9('0x9')](),controller[_0x15a9('0xc')]);router[_0x15a9('0x8')](_0x15a9('0xd'),auth['isAuthenticated'](),controller[_0x15a9('0xe')]);router[_0x15a9('0x8')]('/:id/dispositions',auth[_0x15a9('0x9')](),controller[_0x15a9('0xf')]);router[_0x15a9('0x8')](_0x15a9('0x10'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x11')]);router[_0x15a9('0x8')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0x15a9('0x12')]);router[_0x15a9('0x8')](_0x15a9('0x13'),auth['isAuthenticated'](),controller[_0x15a9('0x14')]);router[_0x15a9('0x8')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router[_0x15a9('0x8')]('/:id/applications',auth[_0x15a9('0x9')](),controller[_0x15a9('0x15')]);router['get'](_0x15a9('0x16'),auth['isAuthenticated'](),controller['getMessages']);router[_0x15a9('0x8')](_0x15a9('0x17'),auth[_0x15a9('0x9')](),controller['verifySmtp']);router[_0x15a9('0x8')](_0x15a9('0x18'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x19')]);router['post'](_0x15a9('0x1a'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x1b')]);router['post']('/:id/canned_answers',auth[_0x15a9('0x9')](),controller[_0x15a9('0x1c')]);router[_0x15a9('0x1d')]('/',auth[_0x15a9('0x9')](),controller['create']);router['post'](_0x15a9('0x1e'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x1f')]);router[_0x15a9('0x1d')](_0x15a9('0x13'),auth['isAuthenticated'](),controller[_0x15a9('0x20')]);router[_0x15a9('0x1d')](_0x15a9('0x21'),auth[_0x15a9('0x9')](),controller['addInteraction']);router[_0x15a9('0x1d')](_0x15a9('0x22'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x23')]);router['post'](_0x15a9('0x24'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x25')]);router[_0x15a9('0x1d')](_0x15a9('0x18'),auth[_0x15a9('0x9')](),controller['addAgents']);router['put'](_0x15a9('0xd'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x26')]);router[_0x15a9('0x27')](_0x15a9('0x1a'),auth['isAuthenticated'](),controller[_0x15a9('0x28')]);router['delete']('/:id/canned_answers',auth[_0x15a9('0x9')](),controller['removeAnswers']);router['delete'](_0x15a9('0x1e'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x29')]);router['delete'](_0x15a9('0x13'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x2a')]);router[_0x15a9('0x27')](_0x15a9('0xd'),auth['isAuthenticated'](),controller[_0x15a9('0x2b')]);router[_0x15a9('0x27')](_0x15a9('0x18'),auth[_0x15a9('0x9')](),controller[_0x15a9('0x2c')]);module[_0x15a9('0x2d')]=router;
\ No newline at end of file
+var _0xee9e=['/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','/:id/verify','verifySmtp','/:id/users','post','create','addImap','/:id/out_servers','addSmtp','addInteraction','/:id/send','send','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeImap','removeAgents','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','getSmtp'];(function(_0x1bfa51,_0x1206b3){var _0x3d34a0=function(_0x41a2f2){while(--_0x41a2f2){_0x1bfa51['push'](_0x1bfa51['shift']());}};_0x3d34a0(++_0x1206b3);}(_0xee9e,0x1e6));var _0xeee9=function(_0x35a743,_0x434304){_0x35a743=_0x35a743-0x0;var _0x4b497a=_0xee9e[_0x35a743];return _0x4b497a;};'use strict';var multer=require('multer');var util=require(_0xeee9('0x0'));var path=require(_0xeee9('0x1'));var timeout=require('connect-timeout');var express=require(_0xeee9('0x2'));var router=express['Router']();var fs_extra=require(_0xeee9('0x3'));var auth=require(_0xeee9('0x4'));var interaction=require(_0xeee9('0x5'));var config=require(_0xeee9('0x6'));var controller=require(_0xeee9('0x7'));router[_0xeee9('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeee9('0x8')](_0xeee9('0x9'),auth[_0xeee9('0xa')](),controller[_0xeee9('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xeee9('0xc')]);router[_0xeee9('0x8')](_0xeee9('0xd'),auth[_0xeee9('0xa')](),controller[_0xeee9('0xe')]);router[_0xeee9('0x8')](_0xeee9('0xf'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x10')]);router[_0xeee9('0x8')](_0xeee9('0x11'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x12')]);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0xeee9('0x13')]);router[_0xeee9('0x8')](_0xeee9('0x14'),auth['isAuthenticated'](),controller[_0xeee9('0x15')]);router['get'](_0xeee9('0x16'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x17')]);router[_0xeee9('0x8')](_0xeee9('0x18'),auth[_0xeee9('0xa')](),controller['getMessages']);router['get'](_0xeee9('0x19'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x1a')]);router[_0xeee9('0x8')](_0xeee9('0x1b'),auth[_0xeee9('0xa')](),controller['getAgents']);router['post']('/:id/dispositions',auth[_0xeee9('0xa')](),controller['addDisposition']);router[_0xeee9('0x1c')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);router[_0xeee9('0x1c')]('/',auth[_0xeee9('0xa')](),controller[_0xeee9('0x1d')]);router[_0xeee9('0x1c')](_0xeee9('0x11'),auth['isAuthenticated'](),controller[_0xeee9('0x1e')]);router['post'](_0xeee9('0x1f'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x20')]);router['post'](_0xeee9('0x14'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x21')]);router['post'](_0xeee9('0x16'),auth[_0xeee9('0xa')](),controller['addApplications']);router[_0xeee9('0x1c')](_0xeee9('0x22'),auth['isAuthenticated'](),controller[_0xeee9('0x23')]);router[_0xeee9('0x1c')](_0xeee9('0x1b'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x24')]);router[_0xeee9('0x25')](_0xeee9('0x26'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x27')]);router[_0xeee9('0x28')](_0xeee9('0xd'),auth['isAuthenticated'](),controller[_0xeee9('0x29')]);router['delete'](_0xeee9('0xf'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x2a')]);router[_0xeee9('0x28')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xeee9('0x2b')]);router[_0xeee9('0x28')](_0xeee9('0x1f'),auth[_0xeee9('0xa')](),controller['removeSmtp']);router[_0xeee9('0x28')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0xeee9('0x28')](_0xeee9('0x1b'),auth[_0xeee9('0xa')](),controller[_0xeee9('0x2c')]);module[_0xeee9('0x2d')]=router;
\ No newline at end of file
index 137b4c8..aea0dc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1248=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','ENUM','hotmail','yahoo','getDataValue','provider','custom','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x59f893,_0x3b71dd){var _0x36bde3=function(_0x266745){while(--_0x266745){_0x59f893['push'](_0x59f893['shift']());}};_0x36bde3(++_0x3b71dd);}(_0x1248,0x9c));var _0x8124=function(_0xab6762,_0x55b8b9){_0xab6762=_0xab6762-0x0;var _0x253e7d=_0x1248[_0xab6762];return _0x253e7d;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x8124('0x0')]},'name':{'type':Sequelize[_0x8124('0x0')],'allowNull':![]},'service':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x8124('0x1')],'defaultValue':!![]},'key':{'type':Sequelize[_0x8124('0x0')],'allowNull':![]},'template':{'type':Sequelize[_0x8124('0x2')]},'markAsUnread':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x8124('0x0')],'allowNull':![],'defaultValue':_0x8124('0x3')},'fontSize':{'type':Sequelize[_0x8124('0x4')](0x2)[_0x8124('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8124('0x6');}},'notificationSound':{'type':Sequelize[_0x8124('0x1')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8124('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8124('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8124('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x8124('0x1')],'defaultValue':![],'comment':_0x8124('0x8'),'set':function(_0x5ba5d3){if(!_0x5ba5d3)this[_0x8124('0x9')](_0x8124('0xa'),null);this[_0x8124('0x9')](_0x8124('0xb'),_0x5ba5d3);}},'provider':{'type':Sequelize[_0x8124('0xc')]('gmail',_0x8124('0xd'),_0x8124('0xe'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x8124('0xf')](_0x8124('0x10')))return'custom';return this[_0x8124('0xf')](_0x8124('0x10'));},'set':function(_0x5efc34){if(_0x5efc34===_0x8124('0x11'))_0x5efc34=null;return this['setDataValue']('provider',_0x5efc34);}}};
\ No newline at end of file
+var _0x55ee=['Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','yahoo','getDataValue','provider','custom','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x10ba78,_0x2b7a40){var _0x2e3b5c=function(_0x467385){while(--_0x467385){_0x10ba78['push'](_0x10ba78['shift']());}};_0x2e3b5c(++_0x2b7a40);}(_0x55ee,0xfa));var _0xe55e=function(_0x3d7595,_0x23bf60){_0x3d7595=_0x3d7595-0x0;var _0x163d06=_0x55ee[_0x3d7595];return _0x163d06;};'use strict';var Sequelize=require('sequelize');module[_0xe55e('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xe55e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xe55e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xe55e('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xe55e('0x3')]},'markAsUnread':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xe55e('0x1')],'allowNull':![],'defaultValue':_0xe55e('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xe55e('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe55e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe55e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe55e('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xe55e('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xe55e('0x2')],'defaultValue':![],'comment':_0xe55e('0x8'),'set':function(_0x24674b){if(!_0x24674b)this[_0xe55e('0x9')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0xe55e('0xa'),_0x24674b);}},'provider':{'type':Sequelize['ENUM']('gmail','hotmail',_0xe55e('0xb'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0xe55e('0xc')](_0xe55e('0xd')))return'custom';return this[_0xe55e('0xc')](_0xe55e('0xd'));},'set':function(_0x1a8cdd){if(_0x1a8cdd===_0xe55e('0xe'))_0x1a8cdd=null;return this[_0xe55e('0x9')](_0xe55e('0xd'),_0x1a8cdd);}}};
\ No newline at end of file
index 9b50e7f..5ab922d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','ListId','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','hasOwnProperty','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','isNil','from','%s\x20<%s>','attachments','root','server/files/attachments','basename','SendMail','sendMail','List\x20not\x20found','messageId','subject','attach','out','Messages','getSmtpOptions','Sequelize','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','then','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','yahoo','smtp.mail.yahoo.com','user','username','pass','password','modernAuthentication','CloudProviderId','host','port','service','authentication','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','where','pick','merge','VIRTUAL','filter','findAll','rows','catch','show','params','MailServerIn','rawAttributes','include','options','account','interaction','match','forEach','split','includes','replace','push','provider','custom','secure','body','resolve','template','Invalid\x20variables\x20in\x20template:\x20','join','notificationTemplate','Invalid\x20variables\x20in\x20notification\x20template:\x20','Mail\x20account\x20with\x20id\x20%s\x20not\x20found','update','describe','find','MailAccountId','Disposition','create','getDispositions','findOne','nolimit','sort','includeAll'];(function(_0x30b667,_0x5d6987){var _0x3066c1=function(_0x4e26d8){while(--_0x4e26d8){_0x30b667['push'](_0x30b667['shift']());}};_0x3066c1(++_0x5d6987);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0x0a9e('0x3'));var Redis=require('ioredis');var qs=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var APIBadRequestError=require(_0x0a9e('0x8'))['APIBadRequestError'];var APINotFoundError=require(_0x0a9e('0x8'))[_0x0a9e('0x9')];var APIHandleError=require(_0x0a9e('0x8'))['handleError'];var db=require('../../mysqldb')['db'];config[_0x0a9e('0xa')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xb'),'port':0x18eb});var socket=require(_0x0a9e('0xc'))(new Redis(config[_0x0a9e('0xa')]));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);var jayson=require(_0x0a9e('0xf'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x527cdd,_0x4cfe67,_0x273d4d,_0x36471c){return new BPromise(function(_0xd5b662,_0x26d672){var _0x32d742=_0x36471c||client;return _0x32d742[_0x0a9e('0x10')](_0x527cdd,_0x273d4d)['then'](function(_0x4283ce){logger[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x4cfe67,_0x0a9e('0x13'));logger[_0x0a9e('0x14')](_0x0a9e('0x15'),_0x4cfe67,'request\x20sent',JSON[_0x0a9e('0x16')](_0x4283ce));if(_0x4283ce['error']){if(_0x4283ce[_0x0a9e('0x17')]['code']===0x1f4){logger[_0x0a9e('0x17')](_0x0a9e('0x12'),_0x4cfe67,_0x4283ce['error'][_0x0a9e('0x18')]);return _0x26d672(_0x4283ce['error'][_0x0a9e('0x18')]);}logger[_0x0a9e('0x17')](_0x0a9e('0x12'),_0x4cfe67,_0x4283ce[_0x0a9e('0x17')][_0x0a9e('0x18')]);return _0xd5b662(_0x4283ce[_0x0a9e('0x17')][_0x0a9e('0x18')]);}else{logger[_0x0a9e('0x11')](_0x0a9e('0x12'),_0x4cfe67,_0x0a9e('0x13'));_0xd5b662(_0x4283ce[_0x0a9e('0x19')][_0x0a9e('0x18')]);}})['catch'](function(_0x2c3407){logger[_0x0a9e('0x17')]('MailAccount,\x20%s,\x20%s',_0x4cfe67,_0x2c3407);_0x26d672(_0x2c3407);});});}function respondWithStatusCode(_0x20f109,_0x5a09ef){_0x5a09ef=_0x5a09ef||0xcc;return function(_0x588269){if(_0x588269){return _0x20f109[_0x0a9e('0x1a')](_0x5a09ef);}return _0x20f109[_0x0a9e('0x1b')](_0x5a09ef)[_0x0a9e('0x1c')]();};}function respondWithResult(_0x30bae6,_0x4abc77){_0x4abc77=_0x4abc77||0xc8;return function(_0xfb6e48){if(_0xfb6e48){return _0x30bae6[_0x0a9e('0x1b')](_0x4abc77)[_0x0a9e('0x1d')](_0xfb6e48);}};}function respondWithFilteredResult(_0x4d00e6,_0x370d86){return function(_0x42ac8f){if(_0x42ac8f){var _0x16b1ca=typeof _0x370d86['offset']==='undefined'&&typeof _0x370d86[_0x0a9e('0x1e')]===_0x0a9e('0x1f');var _0x40c424=_0x42ac8f[_0x0a9e('0x20')];var _0x526cf3=_0x16b1ca?0x0:_0x370d86[_0x0a9e('0x21')];var _0x479bc4=_0x16b1ca?_0x42ac8f[_0x0a9e('0x20')]:_0x370d86['offset']+_0x370d86[_0x0a9e('0x1e')];var _0x34dc65;if(_0x479bc4>=_0x40c424){_0x479bc4=_0x40c424;_0x34dc65=0xc8;}else{_0x34dc65=0xce;}_0x4d00e6[_0x0a9e('0x1b')](_0x34dc65);return _0x4d00e6[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x526cf3+'-'+_0x479bc4+'/'+_0x40c424)[_0x0a9e('0x1d')](_0x42ac8f);}return null;};}function saveUpdates(_0x11c3b6){return function(_0x14de77){if(_0x14de77){return _0x14de77['update'](_0x11c3b6)[_0x0a9e('0x24')](function(_0x468813){return _0x468813;});}return null;};}function removeEntity(_0x2b1f27){return function(_0x2ec755){if(_0x2ec755){return _0x2ec755['destroy']()[_0x0a9e('0x24')](function(){var _0x40e7a3=_0x2ec755[_0x0a9e('0x25')]({'plain':!![]});var _0x824a4f=_0x0a9e('0x26');return db[_0x0a9e('0x27')][_0x0a9e('0x28')]({'where':{'type':_0x824a4f,'resourceId':_0x40e7a3['id']}})[_0x0a9e('0x24')](function(){return _0x2ec755;});})[_0x0a9e('0x24')](function(){_0x2b1f27['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x5d1e0e){return function(_0x2407f9){if(!_0x2407f9){_0x5d1e0e[_0x0a9e('0x1a')](0x194);}return _0x2407f9;};}function handleError(_0x1122db,_0x33bdb7){_0x33bdb7=_0x33bdb7||0x1f4;return function(_0x25ce3a){logger['error'](_0x25ce3a[_0x0a9e('0x29')]);if(_0x25ce3a[_0x0a9e('0x2a')]){delete _0x25ce3a[_0x0a9e('0x2a')];}_0x1122db[_0x0a9e('0x1b')](_0x33bdb7)[_0x0a9e('0x2b')](_0x25ce3a);};}function getImapHost(_0x409319){switch(_0x409319){case _0x0a9e('0x2c'):return _0x0a9e('0x2d');case'yahoo':return _0x0a9e('0x2e');case'hotmail':return _0x0a9e('0x2f');case _0x0a9e('0x30'):return _0x0a9e('0x31');}throw new Error(_0x0a9e('0x32'),_0x409319);}function getSmtpHost(_0x567193){switch(_0x567193){case _0x0a9e('0x2c'):return _0x0a9e('0x33');case _0x0a9e('0x34'):return _0x0a9e('0x35');case'hotmail':return'smtp-mail.outlook.com';case _0x0a9e('0x30'):return'smtp.office365.com';}throw new Error(_0x0a9e('0x32'),_0x567193);}function getAuthenticationOptions(_0x3d9717,_0x381c37){var _0x1ef87a={};var _0x4f41ae={};if(_0x3d9717){_0x1ef87a[_0x0a9e('0x36')]=_0x4f41ae[_0x0a9e('0x36')]=_0x381c37[_0x0a9e('0x37')];_0x1ef87a['password']=_0x4f41ae[_0x0a9e('0x38')]=_0x381c37[_0x0a9e('0x39')];if(_0x381c37[_0x0a9e('0x3a')]){_0x1ef87a['modernAuthentication']=_0x4f41ae['modernAuthentication']=!![];_0x1ef87a[_0x0a9e('0x3b')]=_0x4f41ae[_0x0a9e('0x3b')]=_0x381c37['CloudProviderId'];_0x1ef87a[_0x0a9e('0x39')]=_0x4f41ae[_0x0a9e('0x38')]=null;}else{_0x1ef87a[_0x0a9e('0x3b')]=_0x4f41ae[_0x0a9e('0x3b')]=null;}_0x1ef87a['host']=getImapHost(_0x3d9717);_0x1ef87a['port']=0x3e1;_0x4f41ae[_0x0a9e('0x3c')]=getSmtpHost(_0x3d9717);_0x4f41ae[_0x0a9e('0x3d')]=0x24b;_0x4f41ae['secure']=![];_0x1ef87a[_0x0a9e('0x3e')]=_0x4f41ae[_0x0a9e('0x3e')]=null;}else{if(_0x381c37[_0x0a9e('0x3f')]){_0x1ef87a['user']=_0x4f41ae[_0x0a9e('0x36')]=_0x381c37[_0x0a9e('0x37')];_0x1ef87a[_0x0a9e('0x39')]=_0x4f41ae[_0x0a9e('0x38')]=_0x381c37[_0x0a9e('0x39')];}else{_0x1ef87a[_0x0a9e('0x3f')]=_0x4f41ae[_0x0a9e('0x3f')]=![];_0x1ef87a[_0x0a9e('0x36')]=_0x4f41ae[_0x0a9e('0x36')]=null;_0x1ef87a[_0x0a9e('0x39')]=_0x4f41ae[_0x0a9e('0x38')]=null;}_0x1ef87a[_0x0a9e('0x3c')]=_0x381c37[_0x0a9e('0x40')][_0x0a9e('0x3c')];_0x1ef87a[_0x0a9e('0x3d')]=_0x381c37['Imap']['port'];_0x4f41ae[_0x0a9e('0x3c')]=_0x381c37[_0x0a9e('0x41')][_0x0a9e('0x3c')];_0x4f41ae[_0x0a9e('0x3d')]=_0x381c37[_0x0a9e('0x41')][_0x0a9e('0x3d')];}return{'Imap':_0x1ef87a,'Smtp':_0x4f41ae};}exports[_0x0a9e('0x42')]=function(_0x445e25,_0x432fcc){var _0x25c6e6={'include':[{'model':db['MailServerIn'],'as':_0x0a9e('0x40')},{'model':db[_0x0a9e('0x43')],'as':_0x0a9e('0x41')},{'model':db[_0x0a9e('0x44')],'as':_0x0a9e('0x45')}]},_0x2c2cb0={},_0x35ed4a={'count':0x0,'rows':[]};var _0xbe9d19=_[_0x0a9e('0x46')](db[_0x0a9e('0x47')]['rawAttributes'],function(_0x2e9d90){return{'name':_0x2e9d90['fieldName'],'type':_0x2e9d90[_0x0a9e('0x48')][_0x0a9e('0x49')]};});_0x2c2cb0[_0x0a9e('0x4a')]=_['map'](_0xbe9d19,_0x0a9e('0x2a'));_0x2c2cb0[_0x0a9e('0x4b')]=_[_0x0a9e('0x4c')](_0x445e25[_0x0a9e('0x4b')]);_0x2c2cb0[_0x0a9e('0x4d')]=_[_0x0a9e('0x4e')](_0x2c2cb0[_0x0a9e('0x4a')],_0x2c2cb0['query']);_0x25c6e6[_0x0a9e('0x4f')]=_[_0x0a9e('0x4e')](_0x2c2cb0[_0x0a9e('0x4a')],qs[_0x0a9e('0x50')](_0x445e25[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x25c6e6[_0x0a9e('0x4f')]=_0x25c6e6[_0x0a9e('0x4f')][_0x0a9e('0x51')]?_0x25c6e6['attributes']:_0x2c2cb0[_0x0a9e('0x4a')];if(!_0x445e25[_0x0a9e('0x4b')]['hasOwnProperty']('nolimit')){_0x25c6e6['limit']=qs[_0x0a9e('0x1e')](_0x445e25[_0x0a9e('0x4b')][_0x0a9e('0x1e')]);_0x25c6e6[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x445e25[_0x0a9e('0x4b')][_0x0a9e('0x21')]);}_0x25c6e6[_0x0a9e('0x52')]=qs['sort'](_0x445e25['query']['sort']);_0x25c6e6[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x54')](_0x445e25['query'],_0x2c2cb0[_0x0a9e('0x4d')]),_0xbe9d19);if(_0x445e25[_0x0a9e('0x4b')]['filter']){_0x25c6e6['where']=_[_0x0a9e('0x55')](_0x25c6e6['where'],{'$or':_[_0x0a9e('0x46')](_0xbe9d19,function(_0x4c3845){if(_0x4c3845[_0x0a9e('0x48')]!==_0x0a9e('0x56')){var _0x439340={};_0x439340[_0x4c3845['name']]={'$like':'%'+_0x445e25[_0x0a9e('0x4b')][_0x0a9e('0x57')]+'%'};return _0x439340;}})});}_0x25c6e6=_['merge']({},_0x25c6e6,_0x445e25['options']);var _0x128aa6={'where':_0x25c6e6[_0x0a9e('0x53')]};return db['MailAccount'][_0x0a9e('0x20')](_0x128aa6)['then'](function(_0x211ef9){_0x35ed4a['count']=_0x211ef9;if(_0x445e25[_0x0a9e('0x4b')]['includeAll']){_0x25c6e6['include']=[{'all':!![]}];}return db['MailAccount'][_0x0a9e('0x58')](_0x25c6e6);})['then'](function(_0x2f7092){_0x35ed4a[_0x0a9e('0x59')]=_0x2f7092;return _0x35ed4a;})[_0x0a9e('0x24')](respondWithFilteredResult(_0x432fcc,_0x25c6e6))[_0x0a9e('0x5a')](handleError(_0x432fcc,null));};exports[_0x0a9e('0x5b')]=function(_0x272738,_0xd10662){var _0x28d814={'raw':![],'where':{'id':_0x272738[_0x0a9e('0x5c')]['id']},'include':[{'model':db[_0x0a9e('0x5d')],'as':_0x0a9e('0x40')},{'model':db[_0x0a9e('0x43')],'as':_0x0a9e('0x41')},{'model':db[_0x0a9e('0x44')],'as':'mandatoryDispositionPause'}]},_0x4e67ab={};_0x4e67ab[_0x0a9e('0x4a')]=_[_0x0a9e('0x4c')](db['MailAccount'][_0x0a9e('0x5e')]);_0x4e67ab['query']=_[_0x0a9e('0x4c')](_0x272738['query']);_0x4e67ab['filters']=_['intersection'](_0x4e67ab[_0x0a9e('0x4a')],_0x4e67ab['query']);_0x28d814[_0x0a9e('0x4f')]=_[_0x0a9e('0x4e')](_0x4e67ab[_0x0a9e('0x4a')],qs[_0x0a9e('0x50')](_0x272738[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x28d814['attributes']=_0x28d814[_0x0a9e('0x4f')]['length']?_0x28d814[_0x0a9e('0x4f')]:_0x4e67ab[_0x0a9e('0x4a')];if(_0x272738[_0x0a9e('0x4b')]['includeAll']){_0x28d814[_0x0a9e('0x5f')]=[{'all':!![]}];}_0x28d814=_[_0x0a9e('0x55')]({},_0x28d814,_0x272738[_0x0a9e('0x60')]);return db[_0x0a9e('0x47')]['find'](_0x28d814)[_0x0a9e('0x24')](handleEntityNotFound(_0xd10662,null))[_0x0a9e('0x24')](respondWithResult(_0xd10662,null))['catch'](handleError(_0xd10662,null));};function checkTemplate(_0x797b45){var _0x17e88c=[_0x0a9e('0x36'),_0x0a9e('0x61'),_0x0a9e('0x62'),'contact'];var _0x176840=/[^{\{]+(?=}\})/g;var _0x2937e0=_0x797b45[_0x0a9e('0x63')](_0x176840);var _0x47bb43=[];if(_0x2937e0!==null){_0x2937e0[_0x0a9e('0x64')](function(_0x4f1e60){var _0x5211e3=_0x4f1e60[_0x0a9e('0x65')]('.')[0x0];if(!_0x17e88c[_0x0a9e('0x66')](_0x5211e3)){_0x797b45=_0x797b45[_0x0a9e('0x67')]('{{'+_0x4f1e60+'}}',_0x4f1e60);_0x47bb43[_0x0a9e('0x68')](_0x4f1e60);}});}return _0x47bb43;}function parseUpdatePayload(_0x186f39){var _0xc8c264=_0x186f39[_0x0a9e('0x69')]===_0x0a9e('0x6a')?null:_0x186f39[_0x0a9e('0x69')];var _0x1cc4f3=_0x186f39[_0x0a9e('0x40')]||{};var _0x19012b=_0x186f39[_0x0a9e('0x41')]||{};if(_0xc8c264){_0x1cc4f3[_0x0a9e('0x3c')]=getImapHost(_0xc8c264);_0x1cc4f3[_0x0a9e('0x3d')]=0x3e1;_0x19012b[_0x0a9e('0x3c')]=getSmtpHost(_0xc8c264);_0x19012b[_0x0a9e('0x3d')]=0x24b;_0x19012b[_0x0a9e('0x6b')]=![];}if(_0x19012b['modernAuthentication']){_0x19012b[_0x0a9e('0x6b')]=![];}else{_0x19012b[_0x0a9e('0x3b')]=null;}if(!_0x1cc4f3[_0x0a9e('0x3a')])_0x1cc4f3['CloudProviderId']=null;_0x186f39[_0x0a9e('0x40')]=_0x1cc4f3;_0x186f39[_0x0a9e('0x41')]=_0x19012b;}exports['update']=function(_0x83f0b2,_0x56e31e){if(_0x83f0b2[_0x0a9e('0x6c')]['id']){delete _0x83f0b2[_0x0a9e('0x6c')]['id'];}Promise[_0x0a9e('0x6d')]()['then'](function(){var _0x50cdce=checkTemplate(_0x83f0b2['body'][_0x0a9e('0x6e')]);if(_0x50cdce[_0x0a9e('0x51')]>0x0){throw new APIBadRequestError(_0x0a9e('0x6f')+_0x50cdce[_0x0a9e('0x70')](','));}_0x50cdce=checkTemplate(_0x83f0b2[_0x0a9e('0x6c')][_0x0a9e('0x71')]);if(_0x50cdce[_0x0a9e('0x51')]>0x0){throw new APIBadRequestError(_0x0a9e('0x72')+_0x50cdce['join'](','));}return parseUpdatePayload(_0x83f0b2[_0x0a9e('0x6c')]);})[_0x0a9e('0x24')](function(){return db[_0x0a9e('0x47')]['find']({'where':{'id':_0x83f0b2[_0x0a9e('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x0a9e('0x40')},{'model':db[_0x0a9e('0x43')],'as':'Smtp'},{'model':db[_0x0a9e('0x44')],'as':_0x0a9e('0x45')}]});})[_0x0a9e('0x24')](function(_0x317c0c){if(!_0x317c0c){throw new APINotFoundError(util['format'](_0x0a9e('0x73'),_0x83f0b2[_0x0a9e('0x5c')]['id']));}if(_0x317c0c[_0x0a9e('0x3e')])delete _0x83f0b2[_0x0a9e('0x6c')]['Imap'];return _0x317c0c;})[_0x0a9e('0x24')](saveUpdates(_0x83f0b2[_0x0a9e('0x6c')],null))[_0x0a9e('0x24')](function(_0x361b21){if(!_0x83f0b2['body'][_0x0a9e('0x40')])return _0x361b21;return db[_0x0a9e('0x5d')][_0x0a9e('0x74')](_0x83f0b2[_0x0a9e('0x6c')][_0x0a9e('0x40')],{'where':{'MailAccountId':_0x361b21['id']}})[_0x0a9e('0x24')](function(){return _0x361b21;});})[_0x0a9e('0x24')](function(_0x3df0e3){if(!_0x83f0b2[_0x0a9e('0x6c')][_0x0a9e('0x41')])return _0x3df0e3;return db[_0x0a9e('0x43')][_0x0a9e('0x74')](_0x83f0b2[_0x0a9e('0x6c')][_0x0a9e('0x41')],{'where':{'MailAccountId':_0x3df0e3['id']}})['then'](function(){return _0x3df0e3;});})[_0x0a9e('0x24')](respondWithResult(_0x56e31e,null))[_0x0a9e('0x5a')](APIHandleError(_0x56e31e));};exports[_0x0a9e('0x75')]=function(_0x563627,_0x3736e0){return db[_0x0a9e('0x47')][_0x0a9e('0x75')]()[_0x0a9e('0x24')](respondWithResult(_0x3736e0,null))['catch'](handleError(_0x3736e0,null));};exports['addDisposition']=function(_0x7ebea8,_0x2bbdb5){if(_0x7ebea8['body']['id']){delete _0x7ebea8[_0x0a9e('0x6c')]['id'];}return db['MailAccount'][_0x0a9e('0x76')]({'where':{'id':_0x7ebea8[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2bbdb5,null))[_0x0a9e('0x24')](function(_0x41cf12){if(_0x41cf12){_0x7ebea8[_0x0a9e('0x6c')][_0x0a9e('0x77')]=_0x41cf12['id'];return db[_0x0a9e('0x78')][_0x0a9e('0x79')](_0x7ebea8[_0x0a9e('0x6c')]);}})['then'](respondWithResult(_0x2bbdb5,null))[_0x0a9e('0x5a')](handleError(_0x2bbdb5,null));};exports[_0x0a9e('0x7a')]=function(_0x45c109,_0x16e5b9){var _0x492543={'raw':![],'where':{}};var _0xf51744={};var _0xf0db1={'count':0x0,'rows':[]};return db['MailAccount'][_0x0a9e('0x7b')]({'where':{'id':_0x45c109['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x16e5b9,null))[_0x0a9e('0x24')](function(_0x3003eb){if(_0x3003eb){_0xf51744[_0x0a9e('0x4a')]=_['keys'](db['Disposition'][_0x0a9e('0x5e')]);_0xf51744[_0x0a9e('0x4b')]=_[_0x0a9e('0x4c')](_0x45c109['query']);_0xf51744[_0x0a9e('0x4d')]=_[_0x0a9e('0x4e')](_0xf51744['model'],_0xf51744['query']);_0x492543[_0x0a9e('0x4f')]=_['intersection'](_0xf51744['model'],qs['fields'](_0x45c109[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x492543[_0x0a9e('0x4f')]=_0x492543[_0x0a9e('0x4f')][_0x0a9e('0x51')]?_0x492543[_0x0a9e('0x4f')]:_0xf51744['model'];if(!_0x45c109[_0x0a9e('0x4b')]['hasOwnProperty'](_0x0a9e('0x7c'))){_0x492543[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x45c109[_0x0a9e('0x4b')]['limit']);_0x492543[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x45c109[_0x0a9e('0x4b')]['offset']);}_0x492543[_0x0a9e('0x52')]=qs[_0x0a9e('0x7d')](_0x45c109[_0x0a9e('0x4b')][_0x0a9e('0x7d')]);_0x492543[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x54')](_0x45c109[_0x0a9e('0x4b')],_0xf51744['filters']));_0x492543[_0x0a9e('0x53')][_0x0a9e('0x77')]=_0x3003eb['id'];if(_0x45c109['query'][_0x0a9e('0x57')]){_0x492543[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x492543['where'],{'$or':_[_0x0a9e('0x46')](_0x492543['attributes'],function(_0x8c8fbe){var _0x2b5148={};_0x2b5148[_0x8c8fbe]={'$like':'%'+_0x45c109[_0x0a9e('0x4b')][_0x0a9e('0x57')]+'%'};return _0x2b5148;})});}_0x492543=_[_0x0a9e('0x55')]({},_0x492543,_0x45c109[_0x0a9e('0x60')]);return db[_0x0a9e('0x78')][_0x0a9e('0x20')]({'where':_0x492543['where']})[_0x0a9e('0x24')](function(_0x31d25a){_0xf0db1[_0x0a9e('0x20')]=_0x31d25a;if(_0x45c109[_0x0a9e('0x4b')][_0x0a9e('0x7e')]){_0x492543[_0x0a9e('0x5f')]=[{'all':!![]}];}return db[_0x0a9e('0x78')][_0x0a9e('0x58')](_0x492543);})[_0x0a9e('0x24')](function(_0x31af8c){_0xf0db1[_0x0a9e('0x59')]=_0x31af8c;return _0xf0db1;});}})[_0x0a9e('0x24')](respondWithFilteredResult(_0x16e5b9,_0x492543))[_0x0a9e('0x5a')](handleError(_0x16e5b9,null));};exports['removeDispositions']=function(_0xc81b64,_0x23e2bd){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0xc81b64[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x23e2bd,null))[_0x0a9e('0x24')](function(_0x1756c7){if(_0x1756c7){return _0x1756c7['removeDispositions'](_0xc81b64[_0x0a9e('0x4b')]['ids']);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x23e2bd,null))[_0x0a9e('0x5a')](handleError(_0x23e2bd,null));};exports[_0x0a9e('0x7f')]=function(_0xf8c6c4,_0x4f4d2d){if(_0xf8c6c4[_0x0a9e('0x6c')]['id']){delete _0xf8c6c4['body']['id'];}return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0xf8c6c4['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x4f4d2d,null))[_0x0a9e('0x24')](function(_0x1dd541){if(_0x1dd541){_0xf8c6c4['body']['MailAccountId']=_0x1dd541['id'];return db[_0x0a9e('0x80')][_0x0a9e('0x79')](_0xf8c6c4[_0x0a9e('0x6c')]);}})[_0x0a9e('0x24')](respondWithResult(_0x4f4d2d,null))[_0x0a9e('0x5a')](handleError(_0x4f4d2d,null));};exports[_0x0a9e('0x81')]=function(_0x17793e,_0x3c75b9){var _0x3f8124={'raw':![],'where':{}};var _0x586510={};var _0x3156c7={'count':0x0,'rows':[]};return db['MailAccount'][_0x0a9e('0x7b')]({'where':{'id':_0x17793e[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x3c75b9,null))[_0x0a9e('0x24')](function(_0x1b61d5){if(_0x1b61d5){_0x586510['model']=_[_0x0a9e('0x4c')](db[_0x0a9e('0x80')][_0x0a9e('0x5e')]);_0x586510[_0x0a9e('0x4b')]=_[_0x0a9e('0x4c')](_0x17793e['query']);_0x586510['filters']=_[_0x0a9e('0x4e')](_0x586510['model'],_0x586510[_0x0a9e('0x4b')]);_0x3f8124[_0x0a9e('0x4f')]=_[_0x0a9e('0x4e')](_0x586510[_0x0a9e('0x4a')],qs[_0x0a9e('0x50')](_0x17793e[_0x0a9e('0x4b')]['fields']));_0x3f8124['attributes']=_0x3f8124[_0x0a9e('0x4f')]['length']?_0x3f8124[_0x0a9e('0x4f')]:_0x586510['model'];if(!_0x17793e[_0x0a9e('0x4b')]['hasOwnProperty']('nolimit')){_0x3f8124[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x17793e['query'][_0x0a9e('0x1e')]);_0x3f8124[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x17793e[_0x0a9e('0x4b')][_0x0a9e('0x21')]);}_0x3f8124['order']=qs['sort'](_0x17793e[_0x0a9e('0x4b')][_0x0a9e('0x7d')]);_0x3f8124[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x54')](_0x17793e['query'],_0x586510[_0x0a9e('0x4d')]));_0x3f8124[_0x0a9e('0x53')]['MailAccountId']=_0x1b61d5['id'];if(_0x17793e[_0x0a9e('0x4b')][_0x0a9e('0x57')]){_0x3f8124[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x3f8124[_0x0a9e('0x53')],{'$or':_[_0x0a9e('0x46')](_0x3f8124[_0x0a9e('0x4f')],function(_0x476993){var _0x40dd2a={};_0x40dd2a[_0x476993]={'$like':'%'+_0x17793e[_0x0a9e('0x4b')]['filter']+'%'};return _0x40dd2a;})});}_0x3f8124=_[_0x0a9e('0x55')]({},_0x3f8124,_0x17793e[_0x0a9e('0x60')]);return db[_0x0a9e('0x80')][_0x0a9e('0x20')]({'where':_0x3f8124[_0x0a9e('0x53')]})['then'](function(_0x500868){_0x3156c7[_0x0a9e('0x20')]=_0x500868;if(_0x17793e[_0x0a9e('0x4b')][_0x0a9e('0x7e')]){_0x3f8124[_0x0a9e('0x5f')]=[{'all':!![]}];}return db[_0x0a9e('0x80')]['findAll'](_0x3f8124);})[_0x0a9e('0x24')](function(_0x3c775a){_0x3156c7[_0x0a9e('0x59')]=_0x3c775a;return _0x3156c7;});}})['then'](respondWithFilteredResult(_0x3c75b9,_0x3f8124))[_0x0a9e('0x5a')](handleError(_0x3c75b9,null));};exports['removeAnswers']=function(_0x2144ca,_0x4799d4){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x2144ca[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4799d4,null))[_0x0a9e('0x24')](function(_0x5ed560){if(_0x5ed560){return _0x5ed560[_0x0a9e('0x82')](_0x2144ca[_0x0a9e('0x4b')][_0x0a9e('0x83')]);}})[_0x0a9e('0x24')](respondWithStatusCode(_0x4799d4,null))[_0x0a9e('0x5a')](handleError(_0x4799d4,null));};exports[_0x0a9e('0x79')]=function(_0x4014c7,_0xe89aaa){var _0x2aaf07={'name':_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x2a')],'key':_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x49')],'provider':_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x69')]===_0x0a9e('0x6a')?null:_0x4014c7['body']['provider'],'email':_0x4014c7[_0x0a9e('0x6c')]['email'],'ListId':_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x84')],'active':!_['isNil'](_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x85')])?_0x4014c7[_0x0a9e('0x6c')][_0x0a9e('0x85')]:!![],'description':_0x4014c7['body'][_0x0a9e('0x86')]||null};var _0x26cb76=getAuthenticationOptions(_0x2aaf07[_0x0a9e('0x69')],_0x4014c7[_0x0a9e('0x6c')]);_0x2aaf07['Imap']=_0x26cb76[_0x0a9e('0x40')];_0x2aaf07[_0x0a9e('0x41')]=_0x26cb76[_0x0a9e('0x41')];return db['MailAccount'][_0x0a9e('0x79')](_0x2aaf07,{'include':[{'model':db[_0x0a9e('0x43')],'as':_0x0a9e('0x41')},{'model':db['MailServerIn'],'as':_0x0a9e('0x40')}]})[_0x0a9e('0x24')](function(_0x1d9b57){var _0x1a7f58=_0x4014c7[_0x0a9e('0x36')]['get']({'plain':!![]});if(!_0x1a7f58)throw new Error(_0x0a9e('0x87'));if(_0x1a7f58[_0x0a9e('0x88')]==='user'){var _0x3bab3e=_0x1d9b57[_0x0a9e('0x25')]({'plain':!![]});return db[_0x0a9e('0x89')]['find']({'where':{'name':'MailAccounts','userProfileId':_0x1a7f58['userProfileId']},'raw':!![]})[_0x0a9e('0x24')](function(_0x4a70ce){if(_0x4a70ce&&_0x4a70ce['autoAssociation']===0x0){return db[_0x0a9e('0x27')][_0x0a9e('0x79')]({'name':_0x3bab3e[_0x0a9e('0x2a')],'resourceId':_0x3bab3e['id'],'type':_0x4a70ce['name'],'sectionId':_0x4a70ce['id']},{})[_0x0a9e('0x24')](function(){return _0x1d9b57;});}else{return _0x1d9b57;}})[_0x0a9e('0x5a')](function(_0x213d4e){logger[_0x0a9e('0x17')](_0x0a9e('0x8a'),_0x213d4e);throw _0x213d4e;});}return _0x1d9b57;})[_0x0a9e('0x24')](respondWithResult(_0xe89aaa,0xc9))[_0x0a9e('0x5a')](handleError(_0xe89aaa,null));};exports[_0x0a9e('0x8b')]=function(_0x3b5bda,_0x5a1848){return db[_0x0a9e('0x47')]['findOne']({'where':{'id':_0x3b5bda[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x5a1848,null))[_0x0a9e('0x24')](function(_0x3cf222){if(_0x3cf222){return _0x3cf222[_0x0a9e('0x8b')]();}return null;})[_0x0a9e('0x24')](respondWithResult(_0x5a1848,null))['catch'](handleError(_0x5a1848,null));};exports[_0x0a9e('0x8c')]=function(_0x33da81,_0xe25eb5){if(_0x33da81[_0x0a9e('0x6c')]['id']){delete _0x33da81['body']['id'];}return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x33da81[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0xe25eb5,null))[_0x0a9e('0x24')](function(_0x2be526){if(_0x2be526){_0x33da81[_0x0a9e('0x6c')][_0x0a9e('0x77')]=_0x2be526['id'];return db[_0x0a9e('0x5d')][_0x0a9e('0x79')](_0x33da81['body']);}})[_0x0a9e('0x24')](respondWithResult(_0xe25eb5,null))[_0x0a9e('0x5a')](handleError(_0xe25eb5,null));};exports[_0x0a9e('0x8d')]=function(_0x26b826,_0xea8bd1){return db[_0x0a9e('0x47')][_0x0a9e('0x7b')]({'where':{'id':_0x26b826[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xea8bd1,null))[_0x0a9e('0x24')](function(_0xd2391){if(_0xd2391){return _0xd2391[_0x0a9e('0x8e')](null);}return null;})['then'](respondWithStatusCode(_0xea8bd1,null))[_0x0a9e('0x5a')](handleError(_0xea8bd1,null));};exports[_0x0a9e('0x8f')]=function(_0xb0af1e,_0x97d5b5){return db[_0x0a9e('0x47')][_0x0a9e('0x7b')]({'where':{'id':_0xb0af1e[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x97d5b5,null))[_0x0a9e('0x24')](function(_0x451010){if(_0x451010){return _0x451010['getSmtp']();}return null;})[_0x0a9e('0x24')](respondWithResult(_0x97d5b5,null))[_0x0a9e('0x5a')](handleError(_0x97d5b5,null));};exports[_0x0a9e('0x90')]=function(_0x3db98f,_0x2b624e){if(_0x3db98f[_0x0a9e('0x6c')]['id']){delete _0x3db98f['body']['id'];}return db[_0x0a9e('0x47')]['find']({'where':{'id':_0x3db98f['params']['id']}})['then'](handleEntityNotFound(_0x2b624e,null))[_0x0a9e('0x24')](function(_0x3fa3f2){if(_0x3fa3f2){_0x3db98f[_0x0a9e('0x6c')][_0x0a9e('0x77')]=_0x3fa3f2['id'];return db['MailServerOut'][_0x0a9e('0x79')](_0x3db98f[_0x0a9e('0x6c')]);}})[_0x0a9e('0x24')](respondWithResult(_0x2b624e,null))[_0x0a9e('0x5a')](handleError(_0x2b624e,null));};exports[_0x0a9e('0x91')]=function(_0x4b6c21,_0x57b1b1){return db[_0x0a9e('0x47')][_0x0a9e('0x7b')]({'where':{'id':_0x4b6c21[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57b1b1,null))[_0x0a9e('0x24')](function(_0x248a9a){if(_0x248a9a){return _0x248a9a[_0x0a9e('0x92')](null);}return null;})['then'](respondWithStatusCode(_0x57b1b1,null))[_0x0a9e('0x5a')](handleError(_0x57b1b1,null));};exports[_0x0a9e('0x93')]=function(_0x15ba6b,_0x4eda8f){return db[_0x0a9e('0x94')][_0x0a9e('0x76')]({'where':{'id':_0x15ba6b[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4eda8f,null))['then'](function(_0x53ef46){if(_0x53ef46){return _0x53ef46[_0x0a9e('0x93')](_0x15ba6b[_0x0a9e('0x6c')][_0x0a9e('0x83')],_[_0x0a9e('0x95')](_0x15ba6b['body'],[_0x0a9e('0x83'),'id'])||{});}})['then'](respondWithResult(_0x4eda8f,null))[_0x0a9e('0x5a')](handleError(_0x4eda8f,null));};exports[_0x0a9e('0x96')]=function(_0x242f23,_0x57f673){var _0x33b4b3={'raw':![],'where':{}};var _0x33a26c={};var _0xb8a476={'count':0x0,'rows':[]};return db['MailAccount'][_0x0a9e('0x7b')]({'where':{'id':_0x242f23['params']['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x57f673,null))['then'](function(_0x41b90a){if(_0x41b90a){_0x33a26c['model']=_[_0x0a9e('0x4c')](db[_0x0a9e('0x94')][_0x0a9e('0x5e')]);_0x33a26c[_0x0a9e('0x4b')]=_[_0x0a9e('0x4c')](_0x242f23[_0x0a9e('0x4b')]);_0x33a26c[_0x0a9e('0x4d')]=_['intersection'](_0x33a26c[_0x0a9e('0x4a')],_0x33a26c[_0x0a9e('0x4b')]);_0x33b4b3['attributes']=_[_0x0a9e('0x4e')](_0x33a26c[_0x0a9e('0x4a')],qs['fields'](_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x33b4b3[_0x0a9e('0x4f')]=_0x33b4b3['attributes'][_0x0a9e('0x51')]?_0x33b4b3[_0x0a9e('0x4f')]:_0x33a26c[_0x0a9e('0x4a')];if(!_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x97')](_0x0a9e('0x7c'))){_0x33b4b3[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x1e')]);_0x33b4b3['offset']=qs[_0x0a9e('0x21')](_0x242f23['query'][_0x0a9e('0x21')]);}_0x33b4b3[_0x0a9e('0x52')]=qs[_0x0a9e('0x7d')](_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x7d')]);_0x33b4b3[_0x0a9e('0x53')]=qs['filters'](_[_0x0a9e('0x54')](_0x242f23[_0x0a9e('0x4b')],_0x33a26c[_0x0a9e('0x4d')]));_0x33b4b3['where'][_0x0a9e('0x77')]=_0x41b90a['id'];if(_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x57')]){_0x33b4b3[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x33b4b3[_0x0a9e('0x53')],{'$or':_[_0x0a9e('0x46')](_0x33b4b3['attributes'],function(_0x4e1b3){var _0x228c10={};_0x228c10[_0x4e1b3]={'$like':'%'+_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x57')]+'%'};return _0x228c10;})});}_0x33b4b3=_[_0x0a9e('0x55')]({},_0x33b4b3,_0x242f23[_0x0a9e('0x60')]);return db[_0x0a9e('0x94')]['count']({'where':_0x33b4b3['where']})[_0x0a9e('0x24')](function(_0x3f507c){_0xb8a476[_0x0a9e('0x20')]=_0x3f507c;if(_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0x7e')]){_0x33b4b3[_0x0a9e('0x5f')]=[{'model':db[_0x0a9e('0x98')],'as':'Contact','required':![]},{'model':db[_0x0a9e('0x99')],'as':_0x0a9e('0x9a'),'attributes':[_0x0a9e('0x2a'),_0x0a9e('0x9b'),_0x0a9e('0x9c')],'required':![]},{'model':db[_0x0a9e('0x9d')],'as':_0x0a9e('0x9e'),'attributes':['id','name',_0x0a9e('0x9f')],'where':_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0xa0')]?{'id':_0x242f23['query'][_0x0a9e('0xa0')]}:undefined,'required':_0x242f23[_0x0a9e('0x4b')][_0x0a9e('0xa0')]?!![]:![]}];}return db[_0x0a9e('0x94')]['findAll'](_0x33b4b3);})[_0x0a9e('0x24')](function(_0xcbbea0){_0xb8a476[_0x0a9e('0x59')]=_0xcbbea0;return _0xb8a476;});}})[_0x0a9e('0x24')](respondWithFilteredResult(_0x57f673,_0x33b4b3))[_0x0a9e('0x5a')](handleError(_0x57f673,null));};exports[_0x0a9e('0xa1')]=function addApplications(_0x3e365c,_0x385e5d){var _0x4e5dec=_0x3e365c[_0x0a9e('0x5c')]['id'];var _0x266aa1=_0x3e365c[_0x0a9e('0x6c')];var _0x397771=0xc8;var _0x5f4c6f=null;return db['sequelize'][_0x0a9e('0xa2')]({'isolationLevel':db[_0x0a9e('0xa3')][_0x0a9e('0xa4')]['ISOLATION_LEVELS'][_0x0a9e('0xa5')]},function(_0x40180d){return db['MailAccount'][_0x0a9e('0x7b')]({'where':{'id':_0x4e5dec},'transaction':_0x40180d})['then'](function(_0x35cc2a){if(_0x35cc2a){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x4e5dec},'transaction':_0x40180d})['then'](function(){var _0xad4d10=_[_0x0a9e('0x46')](_0x266aa1,function(_0x19f800){_0x19f800[_0x0a9e('0x77')]=_0x4e5dec;return _0x19f800;});return db[_0x0a9e('0xa6')][_0x0a9e('0xa7')](_0xad4d10,{'transaction':_0x40180d});});}else{_0x397771=0x194;_0x5f4c6f=[];}});})['then'](function(){if(_0x397771!==0x194){return db[_0x0a9e('0xa6')][_0x0a9e('0xa8')]({'where':{'MailAccountId':_0x4e5dec},'order':_0x0a9e('0xa9')})[_0x0a9e('0x24')](function(_0x293b22){_0x5f4c6f=_0x293b22;});}})[_0x0a9e('0x5a')](function(_0x31c937){_0x397771=0x1f4;logger['error'](_0x31c937['stack']);if(_0x31c937[_0x0a9e('0x2a')]){delete _0x31c937['name'];}_0x5f4c6f=_0x31c937;})[_0x0a9e('0xaa')](function(){if(_0x5f4c6f===null){_0x385e5d[_0x0a9e('0x1a')](_0x397771);}else{if(_0x397771===0x1f4){_0x385e5d[_0x0a9e('0x1b')](_0x397771)[_0x0a9e('0x2b')](_0x5f4c6f);}else{_0x385e5d[_0x0a9e('0x1b')](_0x397771)[_0x0a9e('0x1d')](_0x5f4c6f);}}});};exports['getApplications']=function(_0x4716d1,_0x59b872){var _0x50e32a={};var _0x504403={};var _0x593f9e;var _0x38dceb;return db['MailAccount']['findOne']({'where':{'id':_0x4716d1[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x59b872,null))[_0x0a9e('0x24')](function(_0x142e53){if(_0x142e53){_0x593f9e=_0x142e53;_0x504403[_0x0a9e('0x4a')]=_['keys'](db[_0x0a9e('0xa6')][_0x0a9e('0x5e')]);_0x504403[_0x0a9e('0x4b')]=_['keys'](_0x4716d1['query']);_0x504403[_0x0a9e('0x4d')]=_[_0x0a9e('0x4e')](_0x504403[_0x0a9e('0x4a')],_0x504403[_0x0a9e('0x4b')]);_0x50e32a[_0x0a9e('0x4f')]=_[_0x0a9e('0x4e')](_0x504403[_0x0a9e('0x4a')],qs[_0x0a9e('0x50')](_0x4716d1[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x50e32a['attributes']=_0x50e32a['attributes']['length']?_0x50e32a[_0x0a9e('0x4f')]:_0x504403[_0x0a9e('0x4a')];_0x50e32a[_0x0a9e('0x52')]=qs[_0x0a9e('0x7d')](_0x4716d1[_0x0a9e('0x4b')][_0x0a9e('0x7d')]);_0x50e32a[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_['pick'](_0x4716d1['query'],_0x504403[_0x0a9e('0x4d')]));if(_0x4716d1[_0x0a9e('0x4b')]['filter']){_0x50e32a[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x50e32a[_0x0a9e('0x53')],{'$or':_[_0x0a9e('0x46')](_0x50e32a[_0x0a9e('0x4f')],function(_0x2683ad){var _0x167196={};_0x167196[_0x2683ad]={'$like':'%'+_0x4716d1[_0x0a9e('0x4b')][_0x0a9e('0x57')]+'%'};return _0x167196;})});}_0x50e32a=_[_0x0a9e('0x55')]({},_0x50e32a,_0x4716d1[_0x0a9e('0x60')]);return _0x593f9e[_0x0a9e('0xab')](_0x50e32a);}})['then'](function(_0x4412a5){if(_0x4412a5){_0x38dceb=_0x4412a5[_0x0a9e('0x51')];if(!_0x4716d1[_0x0a9e('0x4b')][_0x0a9e('0x97')](_0x0a9e('0x7c'))){_0x50e32a[_0x0a9e('0x1e')]=qs[_0x0a9e('0x1e')](_0x4716d1[_0x0a9e('0x4b')][_0x0a9e('0x1e')]);_0x50e32a[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x4716d1[_0x0a9e('0x4b')]['offset']);}return _0x593f9e['getApplications'](_0x50e32a);}})[_0x0a9e('0x24')](function(_0x401207){if(_0x401207){return _0x401207?{'count':_0x38dceb,'rows':_0x401207}:null;}})[_0x0a9e('0x24')](respondWithResult(_0x59b872,null))[_0x0a9e('0x5a')](handleError(_0x59b872,null));};exports[_0x0a9e('0xac')]=function(_0x1e29e2,_0xa8b5de){var _0x4f7907={'raw':!![],'where':{}};var _0x26a204={};var _0x49fd0e={'count':0x0,'rows':[]};return db[_0x0a9e('0x47')][_0x0a9e('0x7b')]({'where':{'id':_0x1e29e2[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0xa8b5de,null))[_0x0a9e('0x24')](function(_0x358f74){if(_0x358f74){_0x26a204[_0x0a9e('0x4a')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0xad')][_0x0a9e('0x5e')]);_0x26a204[_0x0a9e('0x4b')]=_[_0x0a9e('0x4c')](_0x1e29e2[_0x0a9e('0x4b')]);_0x26a204[_0x0a9e('0x4d')]=_[_0x0a9e('0x4e')](_0x26a204[_0x0a9e('0x4a')],_0x26a204['query']);_0x4f7907['attributes']=_[_0x0a9e('0x4e')](_0x26a204[_0x0a9e('0x4a')],qs['fields'](_0x1e29e2['query'][_0x0a9e('0x50')]));_0x4f7907[_0x0a9e('0x4f')]=_0x4f7907[_0x0a9e('0x4f')]['length']?_0x4f7907[_0x0a9e('0x4f')]:_0x26a204['model'];if(!_0x1e29e2[_0x0a9e('0x4b')]['hasOwnProperty'](_0x0a9e('0x7c'))){_0x4f7907['limit']=qs[_0x0a9e('0x1e')](_0x1e29e2[_0x0a9e('0x4b')][_0x0a9e('0x1e')]);_0x4f7907['offset']=qs[_0x0a9e('0x21')](_0x1e29e2['query']['offset']);}_0x4f7907[_0x0a9e('0x52')]=qs[_0x0a9e('0x7d')](_0x1e29e2[_0x0a9e('0x4b')][_0x0a9e('0x7d')]);_0x4f7907[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x54')](_0x1e29e2[_0x0a9e('0x4b')],_0x26a204[_0x0a9e('0x4d')]));_0x4f7907[_0x0a9e('0x53')][_0x0a9e('0x77')]=_0x358f74['id'];if(_0x1e29e2[_0x0a9e('0x4b')][_0x0a9e('0x57')]){_0x4f7907[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x4f7907[_0x0a9e('0x53')],{'$or':_[_0x0a9e('0x46')](_0x4f7907[_0x0a9e('0x4f')],function(_0x153de1){var _0x51a987={};_0x51a987[_0x153de1]={'$like':'%'+_0x1e29e2[_0x0a9e('0x4b')][_0x0a9e('0x57')]+'%'};return _0x51a987;})});}if(_0x1e29e2[_0x0a9e('0x4b')][_0x0a9e('0xae')]){var _0x56e63d=_0x1e29e2['query']['$gte'][_0x0a9e('0x65')](',');var _0x55926d={};_0x55926d[_0x56e63d[0x0]]={'$gte':moment(_0x56e63d[0x1])[_0x0a9e('0xaf')](_0x0a9e('0xb0'))};_0x4f7907[_0x0a9e('0x53')]=_[_0x0a9e('0x55')](_0x4f7907[_0x0a9e('0x53')],_0x55926d);}_0x4f7907=_[_0x0a9e('0x55')]({},_0x4f7907,_0x1e29e2[_0x0a9e('0x60')]);return db[_0x0a9e('0xad')][_0x0a9e('0x20')]({'where':_0x4f7907[_0x0a9e('0x53')]})['then'](function(_0x283c59){_0x49fd0e['count']=_0x283c59;if(_0x1e29e2[_0x0a9e('0x4b')]['includeAll']){_0x4f7907[_0x0a9e('0x5f')]=[{'all':!![]}];}return db[_0x0a9e('0xad')][_0x0a9e('0x58')](_0x4f7907);})['then'](function(_0x920ad8){if(_0x1e29e2[_0x0a9e('0x4b')]['inlineCss']==='true'){for(var _0x3fab79=0x0;_0x3fab79<_0x920ad8[_0x0a9e('0x51')];_0x3fab79++){_0x920ad8[_0x3fab79][_0x0a9e('0x6c')]=juice(_0x920ad8[_0x3fab79]['body']);}}_0x49fd0e['rows']=_0x920ad8;return _0x49fd0e;});}})['then'](respondWithFilteredResult(_0xa8b5de,_0x4f7907))[_0x0a9e('0x5a')](handleError(_0xa8b5de,null));};exports[_0x0a9e('0x2b')]=function(_0x2b7ba9,_0x2fca34){var _0x3d4349,_0x23e6b5={},_0x183b9b;if(_0x2b7ba9[_0x0a9e('0x6c')]['to']){_0x183b9b=_0x2b7ba9[_0x0a9e('0x6c')]['to'][_0x0a9e('0x65')](',')[0x0];}return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x2b7ba9[_0x0a9e('0x5c')]['id']},'include':[{'model':db[_0x0a9e('0xb1')],'as':_0x0a9e('0xb2'),'include':[{'model':db[_0x0a9e('0x98')],'as':_0x0a9e('0xb3'),'where':{'email':_0x183b9b},'limit':0x1,'order':[[_0x0a9e('0xb4'),'DESC']]}]},{'model':db[_0x0a9e('0x43')],'as':_0x0a9e('0x41'),'raw':!![],'include':[{'model':db[_0x0a9e('0xb5')],'as':_0x0a9e('0xb5'),'raw':!![]}]}]})[_0x0a9e('0x24')](handleEntityNotFound(_0x2fca34,null))[_0x0a9e('0x24')](function(_0x5c9391){if(!_0x5c9391)return;_0x3d4349=_0x5c9391;if(!_0x5c9391[_0x0a9e('0x41')])throw new Error(_0x0a9e('0xb6'));if(_[_0x0a9e('0xb7')](_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xb8')])){_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xb8')]=util[_0x0a9e('0xaf')](_0x0a9e('0xb9'),_0x5c9391['name'],_0x5c9391['email']||_0x5c9391[_0x0a9e('0x41')][_0x0a9e('0x36')]);}if(_0x2b7ba9['body'][_0x0a9e('0xba')]&&_0x2b7ba9[_0x0a9e('0x6c')]['attachments'][_0x0a9e('0x51')]){for(var _0x4fc371=0x0;_0x4fc371<_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xba')]['length'];_0x4fc371+=0x1){_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xba')][_0x4fc371]={'filename':_0x2b7ba9['body'][_0x0a9e('0xba')][_0x4fc371][_0x0a9e('0x2a')],'path':path['join'](config[_0x0a9e('0xbb')],_0x0a9e('0xbc'),_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xba')][_0x4fc371][_0x0a9e('0xbd')])};}}var _0x17a0d5=_0x5c9391['getSmtpOptions']();return respondWithRpcPromise(_0x0a9e('0xbe'),_0x0a9e('0xbf'),{'account':_0x17a0d5,'message':_0x2b7ba9['body']});})[_0x0a9e('0x24')](function(_0x2bbb3f){if(!_0x2bbb3f)return;_0x23e6b5=_0x2bbb3f;if(!_0x3d4349[_0x0a9e('0xb2')])throw new Error(_0x0a9e('0xc0'));if(_0x3d4349[_0x0a9e('0xb2')][_0x0a9e('0xb3')][_0x0a9e('0x51')])return _0x3d4349['List']['Contacts'][0x0];return db['CmContact']['create'](_['defaults'](_0x2b7ba9[_0x0a9e('0x6c')],{'firstName':_0x2b7ba9[_0x0a9e('0x6c')]['to'],'email':_0x2b7ba9['body']['to'],'phone':_0x2b7ba9['body']['to'],'ListId':_0x3d4349[_0x0a9e('0x84')]}));})['then'](function(_0x41600e){if(!_0x41600e)return;var _0x40711b={'UserId':_0x2b7ba9[_0x0a9e('0x36')]['id'],'ContactId':_0x41600e['id'],'MailAccountId':_0x3d4349['id'],'inReplyTo':_0x23e6b5[_0x0a9e('0xc1')],'to':_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xb8')],'cc':_0x2b7ba9['body']['cc'],'subject':_0x2b7ba9[_0x0a9e('0x6c')][_0x0a9e('0xc2')],'attach':_0x2b7ba9['body'][_0x0a9e('0xc3')],'firstMsgDirection':_0x0a9e('0xc4'),'lastMsgAt':moment()[_0x0a9e('0xaf')](_0x0a9e('0xb0')),'lastMsgDirection':_0x0a9e('0xc4'),'Messages':[_[_0x0a9e('0x55')](_0x2b7ba9[_0x0a9e('0x6c')],{'messageId':_0x23e6b5['messageId'],'sentAt':moment()[_0x0a9e('0xaf')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x3d4349['id'],'UserId':_0x2b7ba9[_0x0a9e('0x36')]['id'],'ContactId':_0x41600e['id']})]};if(_0x2b7ba9[_0x0a9e('0x6c')]['Interaction']){_0x40711b=_[_0x0a9e('0x55')](_0x40711b,_0x2b7ba9[_0x0a9e('0x6c')]['Interaction']);}return db[_0x0a9e('0x94')]['create'](_0x40711b,{'include':[{'model':db[_0x0a9e('0xad')],'as':_0x0a9e('0xc5')}]});})['then'](respondWithResult(_0x2fca34,null))[_0x0a9e('0x5a')](handleError(_0x2fca34,null));};exports['verifySmtp']=function(_0x1d046c,_0x179137){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x1d046c[_0x0a9e('0x5c')]['id']},'include':[{'model':db[_0x0a9e('0x43')],'as':_0x0a9e('0x41'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x0a9e('0xb5'),'raw':!![]}]}]})[_0x0a9e('0x24')](handleEntityNotFound(_0x179137,null))[_0x0a9e('0x24')](function(_0x1b1971){if(!_0x1b1971[_0x0a9e('0x41')])return;var _0x5932ad=_0x1b1971[_0x0a9e('0xc6')]();return respondWithRpcPromise('VerifySmtp','verifySmtp',{'account':_0x5932ad});})[_0x0a9e('0x24')](respondWithResult(_0x179137,null))['catch'](handleError(_0x179137,null));};exports[_0x0a9e('0x28')]=function(_0x255ed6,_0x58d5fd){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x255ed6[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x58d5fd,null))[_0x0a9e('0x24')](function(_0x25eb44){if(_0x25eb44&&_0x25eb44[_0x0a9e('0x3e')]){throw new db[(_0x0a9e('0xc7'))][(_0x0a9e('0xc8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x25eb44;})[_0x0a9e('0x24')](removeEntity(_0x58d5fd,null))[_0x0a9e('0x5a')](handleError(_0x58d5fd,null));};exports[_0x0a9e('0xc9')]=function(_0x43403c,_0x4d305a){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x43403c[_0x0a9e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4d305a,null))[_0x0a9e('0x24')](function(_0x2191c6){if(_0x2191c6){return _0x2191c6[_0x0a9e('0xc9')](_0x43403c['body'][_0x0a9e('0x83')],_['omit'](_0x43403c[_0x0a9e('0x6c')],[_0x0a9e('0x83'),'id'])||{})[_0x0a9e('0xca')](function(_0x3b4a4d){for(var _0x2b93bc=0x0;_0x2b93bc<_0x43403c[_0x0a9e('0x6c')][_0x0a9e('0x83')]['length'];_0x2b93bc+=0x1){socket[_0x0a9e('0xcb')](_0x0a9e('0xcc'),{'UserId':Number(_0x43403c[_0x0a9e('0x6c')][_0x0a9e('0x83')][_0x2b93bc]),'MailAccountId':Number(_0x43403c[_0x0a9e('0x5c')]['id'])});}return _0x3b4a4d;});}})[_0x0a9e('0x24')](respondWithResult(_0x4d305a,null))[_0x0a9e('0x5a')](handleError(_0x4d305a,null));};exports[_0x0a9e('0xcd')]=function(_0x2310ca,_0x4712c9){return db[_0x0a9e('0x47')][_0x0a9e('0x76')]({'where':{'id':_0x2310ca[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x4712c9,null))[_0x0a9e('0x24')](function(_0xfc4f){if(_0xfc4f){return _0xfc4f[_0x0a9e('0xcd')](_0x2310ca[_0x0a9e('0x4b')][_0x0a9e('0x83')])[_0x0a9e('0x24')](function(){if(_[_0x0a9e('0xce')](_0x2310ca[_0x0a9e('0x4b')][_0x0a9e('0x83')])){for(var _0x58ebb0=0x0;_0x58ebb0<_0x2310ca[_0x0a9e('0x4b')][_0x0a9e('0x83')][_0x0a9e('0x51')];_0x58ebb0+=0x1){socket['emit'](_0x0a9e('0xcf'),{'UserId':Number(_0x2310ca['query'][_0x0a9e('0x83')][_0x58ebb0]),'MailAccountId':Number(_0x2310ca[_0x0a9e('0x5c')]['id'])});}}else{socket[_0x0a9e('0xcb')](_0x0a9e('0xcf'),{'UserId':Number(_0x2310ca[_0x0a9e('0x4b')][_0x0a9e('0x83')]),'MailAccountId':Number(_0x2310ca[_0x0a9e('0x5c')]['id'])});}});}})[_0x0a9e('0x24')](respondWithStatusCode(_0x4712c9,null))['catch'](handleError(_0x4712c9,null));};exports[_0x0a9e('0xd0')]=function(_0x34e535,_0x4d6f2d){var _0x27732c={};var _0x2db8fe={};var _0x579bb0;var _0x573fbb;return db[_0x0a9e('0x47')][_0x0a9e('0x7b')]({'where':{'id':_0x34e535[_0x0a9e('0x5c')]['id']}})[_0x0a9e('0x24')](handleEntityNotFound(_0x4d6f2d,null))['then'](function(_0x443208){if(_0x443208){_0x579bb0=_0x443208;_0x2db8fe[_0x0a9e('0x4a')]=_[_0x0a9e('0x4c')](db[_0x0a9e('0x99')][_0x0a9e('0x5e')]);_0x2db8fe['query']=_[_0x0a9e('0x4c')](_0x34e535[_0x0a9e('0x4b')]);_0x2db8fe['filters']=_[_0x0a9e('0x4e')](_0x2db8fe[_0x0a9e('0x4a')],_0x2db8fe[_0x0a9e('0x4b')]);_0x27732c['attributes']=_['intersection'](_0x2db8fe[_0x0a9e('0x4a')],qs[_0x0a9e('0x50')](_0x34e535[_0x0a9e('0x4b')][_0x0a9e('0x50')]));_0x27732c[_0x0a9e('0x4f')]=_0x27732c[_0x0a9e('0x4f')][_0x0a9e('0x51')]?_0x27732c[_0x0a9e('0x4f')]:_0x2db8fe['model'];_0x27732c['order']=qs[_0x0a9e('0x7d')](_0x34e535['query'][_0x0a9e('0x7d')]);_0x27732c[_0x0a9e('0x53')]=qs[_0x0a9e('0x4d')](_[_0x0a9e('0x54')](_0x34e535['query'],_0x2db8fe[_0x0a9e('0x4d')]));if(_0x34e535[_0x0a9e('0x4b')]['filter']){_0x27732c[_0x0a9e('0x53')]=_['merge'](_0x27732c[_0x0a9e('0x53')],{'$or':_[_0x0a9e('0x46')](_0x27732c[_0x0a9e('0x4f')],function(_0xc2f873){var _0x223e19={};_0x223e19[_0xc2f873]={'$like':'%'+_0x34e535[_0x0a9e('0x4b')]['filter']+'%'};return _0x223e19;})});}_0x27732c=_[_0x0a9e('0x55')]({},_0x27732c,_0x34e535['options']);return _0x579bb0[_0x0a9e('0xd0')](_0x27732c);}})[_0x0a9e('0x24')](function(_0x4229e6){if(_0x4229e6){_0x573fbb=_0x4229e6[_0x0a9e('0x51')];if(!_0x34e535[_0x0a9e('0x4b')][_0x0a9e('0x97')](_0x0a9e('0x7c'))){_0x27732c['limit']=qs[_0x0a9e('0x1e')](_0x34e535[_0x0a9e('0x4b')][_0x0a9e('0x1e')]);_0x27732c[_0x0a9e('0x21')]=qs[_0x0a9e('0x21')](_0x34e535['query'][_0x0a9e('0x21')]);}return _0x579bb0[_0x0a9e('0xd0')](_0x27732c);}})['then'](function(_0x55bb89){if(_0x55bb89){return _0x55bb89?{'count':_0x573fbb,'rows':_0x55bb89}:null;}})[_0x0a9e('0x24')](respondWithResult(_0x4d6f2d,null))[_0x0a9e('0x5a')](handleError(_0x4d6f2d,null));};
\ No newline at end of file
+var _0x7334=['request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','update','then','destroy','get','MailAccounts','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','authentication','username','Imap','Smtp','index','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','length','include','account','interaction','contact','queue','match','forEach','split','includes','push','provider','body','template','Invalid\x20variables\x20in\x20template:\x20','join','Invalid\x20variables\x20in\x20notification\x20template:\x20','find','MailServerIn','describe','addDisposition','create','getDispositions','order','Disposition','findAll','removeDispositions','MailAccountId','CannedAnswer','getAnswers','findOne','removeAnswers','ids','key','custom','ListId','isNil','active','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','User','Owner','fullname','Tag','tag','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','priority','stack','getApplications','getMessages','MailMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','CmContact','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','%s\x20<%s>','email','attachments','root','server/files/attachments','basename','getSmtpOptions','SendMail','List\x20not\x20found','Contacts','messageId','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','juice','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','handleError','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','request','MailAccount,\x20%s,\x20%s'];(function(_0xeca62c,_0x595633){var _0xfc2cb6=function(_0x1eec1f){while(--_0x1eec1f){_0xeca62c['push'](_0xeca62c['shift']());}};_0xfc2cb6(++_0x595633);}(_0x7334,0x184));var _0x4733=function(_0xa0d1da,_0x4ce8f2){_0xa0d1da=_0xa0d1da-0x0;var _0x2d489e=_0x7334[_0xa0d1da];return _0x2d489e;};'use strict';var moment=require(_0x4733('0x0'));var BPromise=require(_0x4733('0x1'));var util=require(_0x4733('0x2'));var path=require('path');var _=require('lodash');var juice=require(_0x4733('0x3'));var Redis=require('ioredis');var qs=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var APIBadRequestError=require(_0x4733('0x8'))[_0x4733('0x9')];var APINotFoundError=require(_0x4733('0x8'))[_0x4733('0xa')];var APIHandleError=require(_0x4733('0x8'))[_0x4733('0xb')];var db=require(_0x4733('0xc'))['db'];config[_0x4733('0xd')]=_[_0x4733('0xe')](config[_0x4733('0xd')],{'host':_0x4733('0xf'),'port':0x18eb});var socket=require(_0x4733('0x10'))(new Redis(config[_0x4733('0xd')]));require('./mailAccount.socket')[_0x4733('0x11')](socket);var jayson=require(_0x4733('0x12'));var client=jayson['client'][_0x4733('0x13')]({'port':0x232b});function respondWithRpcPromise(_0x5240a4,_0xa8e91b,_0x380b2e,_0x44cb92){return new BPromise(function(_0x461f74,_0x100ecd){var _0x1c146c=_0x44cb92||client;return _0x1c146c[_0x4733('0x14')](_0x5240a4,_0x380b2e)['then'](function(_0x57e554){logger['info'](_0x4733('0x15'),_0xa8e91b,_0x4733('0x16'));logger[_0x4733('0x17')](_0x4733('0x18'),_0xa8e91b,_0x4733('0x16'),JSON[_0x4733('0x19')](_0x57e554));if(_0x57e554[_0x4733('0x1a')]){if(_0x57e554[_0x4733('0x1a')][_0x4733('0x1b')]===0x1f4){logger['error'](_0x4733('0x15'),_0xa8e91b,_0x57e554[_0x4733('0x1a')]['message']);return _0x100ecd(_0x57e554[_0x4733('0x1a')][_0x4733('0x1c')]);}logger[_0x4733('0x1a')](_0x4733('0x15'),_0xa8e91b,_0x57e554['error']['message']);return _0x461f74(_0x57e554[_0x4733('0x1a')][_0x4733('0x1c')]);}else{logger['info'](_0x4733('0x15'),_0xa8e91b,_0x4733('0x16'));_0x461f74(_0x57e554[_0x4733('0x1d')][_0x4733('0x1c')]);}})['catch'](function(_0x1232e5){logger[_0x4733('0x1a')]('MailAccount,\x20%s,\x20%s',_0xa8e91b,_0x1232e5);_0x100ecd(_0x1232e5);});});}function respondWithStatusCode(_0x2aa2f4,_0x18da47){_0x18da47=_0x18da47||0xcc;return function(_0x478e34){if(_0x478e34){return _0x2aa2f4[_0x4733('0x1e')](_0x18da47);}return _0x2aa2f4[_0x4733('0x1f')](_0x18da47)[_0x4733('0x20')]();};}function respondWithResult(_0x1a0643,_0x3a2542){_0x3a2542=_0x3a2542||0xc8;return function(_0x24db74){if(_0x24db74){return _0x1a0643[_0x4733('0x1f')](_0x3a2542)[_0x4733('0x21')](_0x24db74);}};}function respondWithFilteredResult(_0x523697,_0x3e6976){return function(_0x2e8545){if(_0x2e8545){var _0x7884e5=typeof _0x3e6976[_0x4733('0x22')]===_0x4733('0x23')&&typeof _0x3e6976[_0x4733('0x24')]===_0x4733('0x23');var _0xc3ab0a=_0x2e8545[_0x4733('0x25')];var _0x23fe6c=_0x7884e5?0x0:_0x3e6976['offset'];var _0x3aeb57=_0x7884e5?_0x2e8545['count']:_0x3e6976['offset']+_0x3e6976[_0x4733('0x24')];var _0x49c516;if(_0x3aeb57>=_0xc3ab0a){_0x3aeb57=_0xc3ab0a;_0x49c516=0xc8;}else{_0x49c516=0xce;}_0x523697[_0x4733('0x1f')](_0x49c516);return _0x523697['set']('Content-Range',_0x23fe6c+'-'+_0x3aeb57+'/'+_0xc3ab0a)['json'](_0x2e8545);}return null;};}function saveUpdates(_0x2976b0){return function(_0x3bfe53){if(_0x3bfe53){return _0x3bfe53[_0x4733('0x26')](_0x2976b0)[_0x4733('0x27')](function(_0x4fee4a){return _0x4fee4a;});}return null;};}function removeEntity(_0x538a7c){return function(_0x50f67e){if(_0x50f67e){return _0x50f67e[_0x4733('0x28')]()['then'](function(){var _0x5a4814=_0x50f67e[_0x4733('0x29')]({'plain':!![]});var _0x39cf44=_0x4733('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x39cf44,'resourceId':_0x5a4814['id']}})[_0x4733('0x27')](function(){return _0x50f67e;});})[_0x4733('0x27')](function(){_0x538a7c[_0x4733('0x1f')](0xcc)[_0x4733('0x20')]();});}};}function handleEntityNotFound(_0x41d5d8){return function(_0x4b382d){if(!_0x4b382d){_0x41d5d8[_0x4733('0x1e')](0x194);}return _0x4b382d;};}function handleError(_0x1f6739,_0x3a02ff){_0x3a02ff=_0x3a02ff||0x1f4;return function(_0x3f0ac8){logger[_0x4733('0x1a')](_0x3f0ac8['stack']);if(_0x3f0ac8['name']){delete _0x3f0ac8[_0x4733('0x2b')];}_0x1f6739[_0x4733('0x1f')](_0x3a02ff)[_0x4733('0x2c')](_0x3f0ac8);};}function getImapHost(_0xdec1fd){switch(_0xdec1fd){case _0x4733('0x2d'):return'imap.gmail.com';case _0x4733('0x2e'):return _0x4733('0x2f');case _0x4733('0x30'):return'imap-mail.outlook.com';case _0x4733('0x31'):return _0x4733('0x32');}throw new Error(_0x4733('0x33'),_0xdec1fd);}function getSmtpHost(_0x2ec052){switch(_0x2ec052){case _0x4733('0x2d'):return _0x4733('0x34');case _0x4733('0x2e'):return _0x4733('0x35');case'hotmail':return _0x4733('0x36');case'outlook365':return _0x4733('0x37');}throw new Error(_0x4733('0x33'),_0x2ec052);}function getAuthenticationOptions(_0x381fa8,_0x1654d4){var _0x269112={};var _0x1a8b50={};if(_0x381fa8){_0x269112[_0x4733('0x38')]=_0x1a8b50[_0x4733('0x38')]=_0x1654d4['username'];_0x269112[_0x4733('0x39')]=_0x1a8b50[_0x4733('0x3a')]=_0x1654d4['password'];if(_0x1654d4[_0x4733('0x3b')]){_0x269112[_0x4733('0x3b')]=_0x1a8b50['modernAuthentication']=!![];_0x269112[_0x4733('0x3c')]=_0x1a8b50['CloudProviderId']=_0x1654d4[_0x4733('0x3c')];_0x269112['password']=_0x1a8b50[_0x4733('0x3a')]=null;}else{_0x269112[_0x4733('0x3c')]=_0x1a8b50['CloudProviderId']=null;}_0x269112['host']=getImapHost(_0x381fa8);_0x269112[_0x4733('0x3d')]=0x3e1;_0x1a8b50[_0x4733('0x3e')]=getSmtpHost(_0x381fa8);_0x1a8b50['port']=0x24b;_0x1a8b50[_0x4733('0x3f')]=![];_0x269112[_0x4733('0x40')]=_0x1a8b50[_0x4733('0x40')]=null;}else{if(_0x1654d4[_0x4733('0x41')]){_0x269112[_0x4733('0x38')]=_0x1a8b50[_0x4733('0x38')]=_0x1654d4[_0x4733('0x42')];_0x269112[_0x4733('0x39')]=_0x1a8b50[_0x4733('0x3a')]=_0x1654d4[_0x4733('0x39')];}else{_0x269112[_0x4733('0x41')]=_0x1a8b50[_0x4733('0x41')]=![];_0x269112[_0x4733('0x38')]=_0x1a8b50[_0x4733('0x38')]=null;_0x269112[_0x4733('0x39')]=_0x1a8b50[_0x4733('0x3a')]=null;}_0x269112[_0x4733('0x3e')]=_0x1654d4[_0x4733('0x43')]['host'];_0x269112[_0x4733('0x3d')]=_0x1654d4[_0x4733('0x43')][_0x4733('0x3d')];_0x1a8b50[_0x4733('0x3e')]=_0x1654d4[_0x4733('0x44')][_0x4733('0x3e')];_0x1a8b50[_0x4733('0x3d')]=_0x1654d4[_0x4733('0x44')][_0x4733('0x3d')];}return{'Imap':_0x269112,'Smtp':_0x1a8b50};}exports[_0x4733('0x45')]=function(_0x2e674a,_0x1a50f5){var _0x7976e={'include':[{'model':db['MailServerIn'],'as':_0x4733('0x43')},{'model':db[_0x4733('0x46')],'as':_0x4733('0x44')},{'model':db[_0x4733('0x47')],'as':_0x4733('0x48')}]},_0x117ce9={},_0x561377={'count':0x0,'rows':[]};var _0x2f80a4=_[_0x4733('0x49')](db[_0x4733('0x4a')][_0x4733('0x4b')],function(_0x9da1a8){return{'name':_0x9da1a8['fieldName'],'type':_0x9da1a8['type']['key']};});_0x117ce9['model']=_[_0x4733('0x49')](_0x2f80a4,_0x4733('0x2b'));_0x117ce9[_0x4733('0x4c')]=_[_0x4733('0x4d')](_0x2e674a[_0x4733('0x4c')]);_0x117ce9[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x117ce9[_0x4733('0x50')],_0x117ce9[_0x4733('0x4c')]);_0x7976e[_0x4733('0x51')]=_['intersection'](_0x117ce9['model'],qs[_0x4733('0x52')](_0x2e674a['query'][_0x4733('0x52')]));_0x7976e[_0x4733('0x51')]=_0x7976e[_0x4733('0x51')]['length']?_0x7976e[_0x4733('0x51')]:_0x117ce9[_0x4733('0x50')];if(!_0x2e674a[_0x4733('0x4c')][_0x4733('0x53')](_0x4733('0x54'))){_0x7976e[_0x4733('0x24')]=qs[_0x4733('0x24')](_0x2e674a[_0x4733('0x4c')][_0x4733('0x24')]);_0x7976e['offset']=qs[_0x4733('0x22')](_0x2e674a[_0x4733('0x4c')][_0x4733('0x22')]);}_0x7976e['order']=qs[_0x4733('0x55')](_0x2e674a[_0x4733('0x4c')][_0x4733('0x55')]);_0x7976e[_0x4733('0x56')]=qs['filters'](_[_0x4733('0x57')](_0x2e674a['query'],_0x117ce9[_0x4733('0x4e')]),_0x2f80a4);if(_0x2e674a[_0x4733('0x4c')][_0x4733('0x58')]){_0x7976e[_0x4733('0x56')]=_[_0x4733('0x59')](_0x7976e['where'],{'$or':_[_0x4733('0x49')](_0x2f80a4,function(_0x40c817){if(_0x40c817['type']!=='VIRTUAL'){var _0x46a31c={};_0x46a31c[_0x40c817[_0x4733('0x2b')]]={'$like':'%'+_0x2e674a[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x46a31c;}})});}_0x7976e=_[_0x4733('0x59')]({},_0x7976e,_0x2e674a[_0x4733('0x5a')]);var _0x37bdab={'where':_0x7976e[_0x4733('0x56')]};return db['MailAccount']['count'](_0x37bdab)[_0x4733('0x27')](function(_0x5d45c5){_0x561377[_0x4733('0x25')]=_0x5d45c5;if(_0x2e674a[_0x4733('0x4c')][_0x4733('0x5b')]){_0x7976e['include']=[{'all':!![]}];}return db['MailAccount']['findAll'](_0x7976e);})[_0x4733('0x27')](function(_0x827b87){_0x561377[_0x4733('0x5c')]=_0x827b87;return _0x561377;})['then'](respondWithFilteredResult(_0x1a50f5,_0x7976e))[_0x4733('0x5d')](handleError(_0x1a50f5,null));};exports[_0x4733('0x5e')]=function(_0x15a32e,_0xd9974c){var _0x87398f={'raw':![],'where':{'id':_0x15a32e[_0x4733('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x4733('0x43')},{'model':db[_0x4733('0x46')],'as':'Smtp'},{'model':db['Pause'],'as':_0x4733('0x48')}]},_0x18f26b={};_0x18f26b[_0x4733('0x50')]=_[_0x4733('0x4d')](db[_0x4733('0x4a')][_0x4733('0x4b')]);_0x18f26b[_0x4733('0x4c')]=_[_0x4733('0x4d')](_0x15a32e[_0x4733('0x4c')]);_0x18f26b[_0x4733('0x4e')]=_['intersection'](_0x18f26b[_0x4733('0x50')],_0x18f26b[_0x4733('0x4c')]);_0x87398f[_0x4733('0x51')]=_['intersection'](_0x18f26b[_0x4733('0x50')],qs['fields'](_0x15a32e[_0x4733('0x4c')][_0x4733('0x52')]));_0x87398f[_0x4733('0x51')]=_0x87398f[_0x4733('0x51')][_0x4733('0x60')]?_0x87398f[_0x4733('0x51')]:_0x18f26b['model'];if(_0x15a32e[_0x4733('0x4c')]['includeAll']){_0x87398f[_0x4733('0x61')]=[{'all':!![]}];}_0x87398f=_[_0x4733('0x59')]({},_0x87398f,_0x15a32e['options']);return db[_0x4733('0x4a')]['find'](_0x87398f)['then'](handleEntityNotFound(_0xd9974c,null))[_0x4733('0x27')](respondWithResult(_0xd9974c,null))[_0x4733('0x5d')](handleError(_0xd9974c,null));};function checkTemplate(_0x1a0ebf){var _0x3166c5=[_0x4733('0x38'),_0x4733('0x62'),_0x4733('0x63'),_0x4733('0x64'),_0x4733('0x65'),'list','message'];var _0x576351=/[^{\{]+(?=}\})/g;var _0x2c6c46=_0x1a0ebf[_0x4733('0x66')](_0x576351);var _0x24f51d=[];if(_0x2c6c46!==null){_0x2c6c46[_0x4733('0x67')](function(_0x520936){var _0x2c224d=_0x520936[_0x4733('0x68')]('.')[0x0];if(!_0x3166c5[_0x4733('0x69')](_0x2c224d)){_0x1a0ebf=_0x1a0ebf['replace']('{{'+_0x520936+'}}',_0x520936);_0x24f51d[_0x4733('0x6a')](_0x520936);}});}return _0x24f51d;}function parseUpdatePayload(_0x5a6ef2){var _0x7436b7=_0x5a6ef2['provider']==='custom'?null:_0x5a6ef2[_0x4733('0x6b')];var _0x4fa436=_0x5a6ef2[_0x4733('0x43')]||{};var _0x523498=_0x5a6ef2['Smtp']||{};if(_0x7436b7){_0x4fa436[_0x4733('0x3e')]=getImapHost(_0x7436b7);_0x4fa436['port']=0x3e1;_0x523498['host']=getSmtpHost(_0x7436b7);_0x523498[_0x4733('0x3d')]=0x24b;_0x523498[_0x4733('0x3f')]=![];}if(_0x523498[_0x4733('0x3b')]){_0x523498['secure']=![];}else{_0x523498[_0x4733('0x3c')]=null;}if(!_0x4fa436[_0x4733('0x3b')])_0x4fa436[_0x4733('0x3c')]=null;_0x5a6ef2[_0x4733('0x43')]=_0x4fa436;_0x5a6ef2[_0x4733('0x44')]=_0x523498;}exports[_0x4733('0x26')]=function(_0x5197cf,_0x3c9e3b){if(_0x5197cf[_0x4733('0x6c')]['id']){delete _0x5197cf[_0x4733('0x6c')]['id'];}Promise['resolve']()[_0x4733('0x27')](function(){var _0x359996=checkTemplate(_0x5197cf[_0x4733('0x6c')][_0x4733('0x6d')]);if(_0x359996[_0x4733('0x60')]>0x0){throw new APIBadRequestError(_0x4733('0x6e')+_0x359996[_0x4733('0x6f')](','));}_0x359996=checkTemplate(_0x5197cf[_0x4733('0x6c')]['notificationTemplate']);if(_0x359996['length']>0x0){throw new APIBadRequestError(_0x4733('0x70')+_0x359996['join'](','));}return parseUpdatePayload(_0x5197cf['body']);})[_0x4733('0x27')](function(){return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x5197cf[_0x4733('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x4733('0x43')},{'model':db['MailServerOut'],'as':_0x4733('0x44')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]});})[_0x4733('0x27')](function(_0x567faa){if(!_0x567faa){throw new APINotFoundError(util['format']('Mail\x20account\x20with\x20id\x20%s\x20not\x20found',_0x5197cf[_0x4733('0x5f')]['id']));}if(_0x567faa['service'])delete _0x5197cf[_0x4733('0x6c')][_0x4733('0x43')];return _0x567faa;})['then'](saveUpdates(_0x5197cf[_0x4733('0x6c')],null))['then'](function(_0x5b8ade){if(!_0x5197cf[_0x4733('0x6c')][_0x4733('0x43')])return _0x5b8ade;return db[_0x4733('0x72')]['update'](_0x5197cf['body'][_0x4733('0x43')],{'where':{'MailAccountId':_0x5b8ade['id']}})['then'](function(){return _0x5b8ade;});})[_0x4733('0x27')](function(_0x6b6d5d){if(!_0x5197cf[_0x4733('0x6c')][_0x4733('0x44')])return _0x6b6d5d;return db[_0x4733('0x46')][_0x4733('0x26')](_0x5197cf['body'][_0x4733('0x44')],{'where':{'MailAccountId':_0x6b6d5d['id']}})[_0x4733('0x27')](function(){return _0x6b6d5d;});})[_0x4733('0x27')](respondWithResult(_0x3c9e3b,null))[_0x4733('0x5d')](APIHandleError(_0x3c9e3b));};exports['describe']=function(_0x5331d9,_0x4119d9){return db['MailAccount'][_0x4733('0x73')]()[_0x4733('0x27')](respondWithResult(_0x4119d9,null))[_0x4733('0x5d')](handleError(_0x4119d9,null));};exports[_0x4733('0x74')]=function(_0x19217d,_0x2a14df){if(_0x19217d[_0x4733('0x6c')]['id']){delete _0x19217d['body']['id'];}return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x19217d['params']['id']}})['then'](handleEntityNotFound(_0x2a14df,null))[_0x4733('0x27')](function(_0x5ab4a0){if(_0x5ab4a0){_0x19217d[_0x4733('0x6c')]['MailAccountId']=_0x5ab4a0['id'];return db['Disposition'][_0x4733('0x75')](_0x19217d[_0x4733('0x6c')]);}})[_0x4733('0x27')](respondWithResult(_0x2a14df,null))[_0x4733('0x5d')](handleError(_0x2a14df,null));};exports[_0x4733('0x76')]=function(_0x56729d,_0x3a68d7){var _0x1dbc8c={'raw':![],'where':{}};var _0xfc8971={};var _0x513264={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x56729d[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x3a68d7,null))[_0x4733('0x27')](function(_0x3a62ba){if(_0x3a62ba){_0xfc8971[_0x4733('0x50')]=_[_0x4733('0x4d')](db['Disposition'][_0x4733('0x4b')]);_0xfc8971[_0x4733('0x4c')]=_[_0x4733('0x4d')](_0x56729d['query']);_0xfc8971['filters']=_['intersection'](_0xfc8971[_0x4733('0x50')],_0xfc8971['query']);_0x1dbc8c[_0x4733('0x51')]=_[_0x4733('0x4f')](_0xfc8971[_0x4733('0x50')],qs[_0x4733('0x52')](_0x56729d['query'][_0x4733('0x52')]));_0x1dbc8c[_0x4733('0x51')]=_0x1dbc8c[_0x4733('0x51')][_0x4733('0x60')]?_0x1dbc8c[_0x4733('0x51')]:_0xfc8971[_0x4733('0x50')];if(!_0x56729d[_0x4733('0x4c')][_0x4733('0x53')]('nolimit')){_0x1dbc8c[_0x4733('0x24')]=qs['limit'](_0x56729d[_0x4733('0x4c')][_0x4733('0x24')]);_0x1dbc8c[_0x4733('0x22')]=qs['offset'](_0x56729d[_0x4733('0x4c')]['offset']);}_0x1dbc8c[_0x4733('0x77')]=qs['sort'](_0x56729d[_0x4733('0x4c')]['sort']);_0x1dbc8c[_0x4733('0x56')]=qs[_0x4733('0x4e')](_[_0x4733('0x57')](_0x56729d[_0x4733('0x4c')],_0xfc8971[_0x4733('0x4e')]));_0x1dbc8c[_0x4733('0x56')]['MailAccountId']=_0x3a62ba['id'];if(_0x56729d['query'][_0x4733('0x58')]){_0x1dbc8c[_0x4733('0x56')]=_[_0x4733('0x59')](_0x1dbc8c[_0x4733('0x56')],{'$or':_[_0x4733('0x49')](_0x1dbc8c['attributes'],function(_0xbadce4){var _0x5b82ba={};_0x5b82ba[_0xbadce4]={'$like':'%'+_0x56729d['query']['filter']+'%'};return _0x5b82ba;})});}_0x1dbc8c=_[_0x4733('0x59')]({},_0x1dbc8c,_0x56729d[_0x4733('0x5a')]);return db[_0x4733('0x78')][_0x4733('0x25')]({'where':_0x1dbc8c[_0x4733('0x56')]})[_0x4733('0x27')](function(_0x49094c){_0x513264[_0x4733('0x25')]=_0x49094c;if(_0x56729d['query'][_0x4733('0x5b')]){_0x1dbc8c['include']=[{'all':!![]}];}return db[_0x4733('0x78')][_0x4733('0x79')](_0x1dbc8c);})[_0x4733('0x27')](function(_0x5cd185){_0x513264['rows']=_0x5cd185;return _0x513264;});}})[_0x4733('0x27')](respondWithFilteredResult(_0x3a68d7,_0x1dbc8c))[_0x4733('0x5d')](handleError(_0x3a68d7,null));};exports[_0x4733('0x7a')]=function(_0x16a853,_0x593daa){return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x16a853['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x593daa,null))[_0x4733('0x27')](function(_0x28148e){if(_0x28148e){return _0x28148e['removeDispositions'](_0x16a853['query']['ids']);}})[_0x4733('0x27')](respondWithStatusCode(_0x593daa,null))[_0x4733('0x5d')](handleError(_0x593daa,null));};exports['addAnswer']=function(_0x5cb95c,_0x4d1213){if(_0x5cb95c['body']['id']){delete _0x5cb95c['body']['id'];}return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x5cb95c[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4d1213,null))[_0x4733('0x27')](function(_0x281a3f){if(_0x281a3f){_0x5cb95c[_0x4733('0x6c')][_0x4733('0x7b')]=_0x281a3f['id'];return db[_0x4733('0x7c')][_0x4733('0x75')](_0x5cb95c[_0x4733('0x6c')]);}})[_0x4733('0x27')](respondWithResult(_0x4d1213,null))[_0x4733('0x5d')](handleError(_0x4d1213,null));};exports[_0x4733('0x7d')]=function(_0x3d4ffe,_0x546617){var _0xce59a0={'raw':![],'where':{}};var _0x377ee3={};var _0x4de60b={'count':0x0,'rows':[]};return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x3d4ffe[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x546617,null))[_0x4733('0x27')](function(_0x3c6464){if(_0x3c6464){_0x377ee3[_0x4733('0x50')]=_[_0x4733('0x4d')](db['CannedAnswer'][_0x4733('0x4b')]);_0x377ee3[_0x4733('0x4c')]=_[_0x4733('0x4d')](_0x3d4ffe[_0x4733('0x4c')]);_0x377ee3[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x377ee3['model'],_0x377ee3[_0x4733('0x4c')]);_0xce59a0[_0x4733('0x51')]=_[_0x4733('0x4f')](_0x377ee3['model'],qs[_0x4733('0x52')](_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x52')]));_0xce59a0[_0x4733('0x51')]=_0xce59a0[_0x4733('0x51')]['length']?_0xce59a0[_0x4733('0x51')]:_0x377ee3[_0x4733('0x50')];if(!_0x3d4ffe['query'][_0x4733('0x53')](_0x4733('0x54'))){_0xce59a0['limit']=qs[_0x4733('0x24')](_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x24')]);_0xce59a0[_0x4733('0x22')]=qs[_0x4733('0x22')](_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x22')]);}_0xce59a0['order']=qs['sort'](_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x55')]);_0xce59a0['where']=qs[_0x4733('0x4e')](_['pick'](_0x3d4ffe['query'],_0x377ee3[_0x4733('0x4e')]));_0xce59a0[_0x4733('0x56')][_0x4733('0x7b')]=_0x3c6464['id'];if(_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x58')]){_0xce59a0['where']=_[_0x4733('0x59')](_0xce59a0[_0x4733('0x56')],{'$or':_[_0x4733('0x49')](_0xce59a0[_0x4733('0x51')],function(_0x398650){var _0x305692={};_0x305692[_0x398650]={'$like':'%'+_0x3d4ffe[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x305692;})});}_0xce59a0=_[_0x4733('0x59')]({},_0xce59a0,_0x3d4ffe[_0x4733('0x5a')]);return db[_0x4733('0x7c')][_0x4733('0x25')]({'where':_0xce59a0[_0x4733('0x56')]})['then'](function(_0x2ce46b){_0x4de60b[_0x4733('0x25')]=_0x2ce46b;if(_0x3d4ffe[_0x4733('0x4c')]['includeAll']){_0xce59a0['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x4733('0x79')](_0xce59a0);})['then'](function(_0x44e357){_0x4de60b[_0x4733('0x5c')]=_0x44e357;return _0x4de60b;});}})['then'](respondWithFilteredResult(_0x546617,_0xce59a0))[_0x4733('0x5d')](handleError(_0x546617,null));};exports['removeAnswers']=function(_0x225ed7,_0x3008dd){return db[_0x4733('0x4a')]['find']({'where':{'id':_0x225ed7['params']['id']}})['then'](handleEntityNotFound(_0x3008dd,null))[_0x4733('0x27')](function(_0xcff69d){if(_0xcff69d){return _0xcff69d[_0x4733('0x7f')](_0x225ed7[_0x4733('0x4c')][_0x4733('0x80')]);}})[_0x4733('0x27')](respondWithStatusCode(_0x3008dd,null))['catch'](handleError(_0x3008dd,null));};exports[_0x4733('0x75')]=function(_0x32aa25,_0x4c1543){var _0x20ab99={'name':_0x32aa25[_0x4733('0x6c')][_0x4733('0x2b')],'key':_0x32aa25[_0x4733('0x6c')][_0x4733('0x81')],'provider':_0x32aa25[_0x4733('0x6c')][_0x4733('0x6b')]===_0x4733('0x82')?null:_0x32aa25['body'][_0x4733('0x6b')],'email':_0x32aa25[_0x4733('0x6c')]['email'],'ListId':_0x32aa25[_0x4733('0x6c')][_0x4733('0x83')],'active':!_[_0x4733('0x84')](_0x32aa25['body'][_0x4733('0x85')])?_0x32aa25[_0x4733('0x6c')]['active']:!![],'description':_0x32aa25['body']['description']||null};var _0x5b8e16=getAuthenticationOptions(_0x20ab99[_0x4733('0x6b')],_0x32aa25['body']);_0x20ab99['Imap']=_0x5b8e16[_0x4733('0x43')];_0x20ab99[_0x4733('0x44')]=_0x5b8e16[_0x4733('0x44')];return db[_0x4733('0x4a')][_0x4733('0x75')](_0x20ab99,{'include':[{'model':db[_0x4733('0x46')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x4733('0x43')}]})[_0x4733('0x27')](function(_0x525319){var _0x1e5532=_0x32aa25[_0x4733('0x38')]['get']({'plain':!![]});if(!_0x1e5532)throw new Error(_0x4733('0x86'));if(_0x1e5532[_0x4733('0x87')]===_0x4733('0x38')){var _0x4dab66=_0x525319[_0x4733('0x29')]({'plain':!![]});return db[_0x4733('0x88')][_0x4733('0x71')]({'where':{'name':_0x4733('0x2a'),'userProfileId':_0x1e5532[_0x4733('0x89')]},'raw':!![]})[_0x4733('0x27')](function(_0x26c366){if(_0x26c366&&_0x26c366[_0x4733('0x8a')]===0x0){return db['UserProfileResource']['create']({'name':_0x4dab66[_0x4733('0x2b')],'resourceId':_0x4dab66['id'],'type':_0x26c366[_0x4733('0x2b')],'sectionId':_0x26c366['id']},{})[_0x4733('0x27')](function(){return _0x525319;});}else{return _0x525319;}})[_0x4733('0x5d')](function(_0x2bff1d){logger[_0x4733('0x1a')](_0x4733('0x8b'),_0x2bff1d);throw _0x2bff1d;});}return _0x525319;})['then'](respondWithResult(_0x4c1543,0xc9))[_0x4733('0x5d')](handleError(_0x4c1543,null));};exports[_0x4733('0x8c')]=function(_0x2e1729,_0x305a25){return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x2e1729[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x305a25,null))[_0x4733('0x27')](function(_0x38db6b){if(_0x38db6b){return _0x38db6b['getImap']();}return null;})[_0x4733('0x27')](respondWithResult(_0x305a25,null))[_0x4733('0x5d')](handleError(_0x305a25,null));};exports['addImap']=function(_0x98cc7b,_0x4494dd){if(_0x98cc7b[_0x4733('0x6c')]['id']){delete _0x98cc7b['body']['id'];}return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x98cc7b[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x4494dd,null))['then'](function(_0x1de33b){if(_0x1de33b){_0x98cc7b[_0x4733('0x6c')][_0x4733('0x7b')]=_0x1de33b['id'];return db['MailServerIn'][_0x4733('0x75')](_0x98cc7b[_0x4733('0x6c')]);}})['then'](respondWithResult(_0x4494dd,null))[_0x4733('0x5d')](handleError(_0x4494dd,null));};exports[_0x4733('0x8d')]=function(_0xadab00,_0x46876e){return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0xadab00['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x46876e,null))[_0x4733('0x27')](function(_0x5a431e){if(_0x5a431e){return _0x5a431e[_0x4733('0x8e')](null);}return null;})[_0x4733('0x27')](respondWithStatusCode(_0x46876e,null))[_0x4733('0x5d')](handleError(_0x46876e,null));};exports[_0x4733('0x8f')]=function(_0x1d6bcf,_0x2646f9){return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x1d6bcf[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x2646f9,null))[_0x4733('0x27')](function(_0x504e35){if(_0x504e35){return _0x504e35['getSmtp']();}return null;})[_0x4733('0x27')](respondWithResult(_0x2646f9,null))[_0x4733('0x5d')](handleError(_0x2646f9,null));};exports[_0x4733('0x90')]=function(_0x1a068e,_0x6e048){if(_0x1a068e[_0x4733('0x6c')]['id']){delete _0x1a068e[_0x4733('0x6c')]['id'];}return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x1a068e[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x6e048,null))[_0x4733('0x27')](function(_0x31fcbe){if(_0x31fcbe){_0x1a068e[_0x4733('0x6c')][_0x4733('0x7b')]=_0x31fcbe['id'];return db[_0x4733('0x46')][_0x4733('0x75')](_0x1a068e[_0x4733('0x6c')]);}})[_0x4733('0x27')](respondWithResult(_0x6e048,null))[_0x4733('0x5d')](handleError(_0x6e048,null));};exports[_0x4733('0x91')]=function(_0x377c6d,_0x8250d9){return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x377c6d[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x8250d9,null))['then'](function(_0x4fc963){if(_0x4fc963){return _0x4fc963['setSmtp'](null);}return null;})[_0x4733('0x27')](respondWithStatusCode(_0x8250d9,null))[_0x4733('0x5d')](handleError(_0x8250d9,null));};exports[_0x4733('0x92')]=function(_0x3abd2c,_0x3164ab){return db[_0x4733('0x93')]['find']({'where':{'id':_0x3abd2c[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3164ab,null))[_0x4733('0x27')](function(_0x243b07){if(_0x243b07){return _0x243b07['addInteraction'](_0x3abd2c[_0x4733('0x6c')]['ids'],_['omit'](_0x3abd2c[_0x4733('0x6c')],['ids','id'])||{});}})[_0x4733('0x27')](respondWithResult(_0x3164ab,null))['catch'](handleError(_0x3164ab,null));};exports['getInteractions']=function(_0x4843b2,_0x4c16be){var _0x85669e={'raw':![],'where':{}};var _0x4f5a33={};var _0x2cf3d7={'count':0x0,'rows':[]};return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x4843b2[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x4c16be,null))['then'](function(_0x5e9839){if(_0x5e9839){_0x4f5a33[_0x4733('0x50')]=_['keys'](db[_0x4733('0x93')]['rawAttributes']);_0x4f5a33[_0x4733('0x4c')]=_['keys'](_0x4843b2[_0x4733('0x4c')]);_0x4f5a33[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x4f5a33[_0x4733('0x50')],_0x4f5a33[_0x4733('0x4c')]);_0x85669e['attributes']=_[_0x4733('0x4f')](_0x4f5a33[_0x4733('0x50')],qs['fields'](_0x4843b2[_0x4733('0x4c')][_0x4733('0x52')]));_0x85669e[_0x4733('0x51')]=_0x85669e['attributes'][_0x4733('0x60')]?_0x85669e[_0x4733('0x51')]:_0x4f5a33[_0x4733('0x50')];if(!_0x4843b2['query']['hasOwnProperty']('nolimit')){_0x85669e[_0x4733('0x24')]=qs[_0x4733('0x24')](_0x4843b2['query'][_0x4733('0x24')]);_0x85669e[_0x4733('0x22')]=qs[_0x4733('0x22')](_0x4843b2[_0x4733('0x4c')]['offset']);}_0x85669e[_0x4733('0x77')]=qs[_0x4733('0x55')](_0x4843b2[_0x4733('0x4c')][_0x4733('0x55')]);_0x85669e[_0x4733('0x56')]=qs[_0x4733('0x4e')](_[_0x4733('0x57')](_0x4843b2[_0x4733('0x4c')],_0x4f5a33[_0x4733('0x4e')]));_0x85669e[_0x4733('0x56')][_0x4733('0x7b')]=_0x5e9839['id'];if(_0x4843b2[_0x4733('0x4c')]['filter']){_0x85669e[_0x4733('0x56')]=_[_0x4733('0x59')](_0x85669e[_0x4733('0x56')],{'$or':_[_0x4733('0x49')](_0x85669e['attributes'],function(_0x2b29ec){var _0x3ed3d7={};_0x3ed3d7[_0x2b29ec]={'$like':'%'+_0x4843b2[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x3ed3d7;})});}_0x85669e=_['merge']({},_0x85669e,_0x4843b2['options']);return db['MailInteraction'][_0x4733('0x25')]({'where':_0x85669e['where']})[_0x4733('0x27')](function(_0x23c7e1){_0x2cf3d7['count']=_0x23c7e1;if(_0x4843b2[_0x4733('0x4c')]['includeAll']){_0x85669e[_0x4733('0x61')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x4733('0x94')],'as':_0x4733('0x95'),'attributes':['name',_0x4733('0x96'),'internal'],'required':![]},{'model':db[_0x4733('0x97')],'as':'Tags','attributes':['id',_0x4733('0x2b'),'color'],'where':_0x4843b2[_0x4733('0x4c')][_0x4733('0x98')]?{'id':_0x4843b2[_0x4733('0x4c')][_0x4733('0x98')]}:undefined,'required':_0x4843b2[_0x4733('0x4c')][_0x4733('0x98')]?!![]:![]}];}return db[_0x4733('0x93')][_0x4733('0x79')](_0x85669e);})['then'](function(_0x34fac4){_0x2cf3d7[_0x4733('0x5c')]=_0x34fac4;return _0x2cf3d7;});}})[_0x4733('0x27')](respondWithFilteredResult(_0x4c16be,_0x85669e))[_0x4733('0x5d')](handleError(_0x4c16be,null));};exports[_0x4733('0x99')]=function addApplications(_0x479236,_0x46455f){var _0x1abda1=_0x479236[_0x4733('0x5f')]['id'];var _0x83d355=_0x479236[_0x4733('0x6c')];var _0x59bd31=0xc8;var _0x380f6d=null;return db[_0x4733('0x9a')][_0x4733('0x9b')]({'isolationLevel':db[_0x4733('0x9a')]['Transaction'][_0x4733('0x9c')][_0x4733('0x9d')]},function(_0xbc5fff){return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x1abda1},'transaction':_0xbc5fff})[_0x4733('0x27')](function(_0x5d5fd6){if(_0x5d5fd6){return db[_0x4733('0x9e')]['destroy']({'where':{'MailAccountId':_0x1abda1},'transaction':_0xbc5fff})[_0x4733('0x27')](function(){var _0x5d8d46=_[_0x4733('0x49')](_0x83d355,function(_0x521f18){_0x521f18[_0x4733('0x7b')]=_0x1abda1;return _0x521f18;});return db[_0x4733('0x9e')][_0x4733('0x9f')](_0x5d8d46,{'transaction':_0xbc5fff});});}else{_0x59bd31=0x194;_0x380f6d=[];}});})['then'](function(){if(_0x59bd31!==0x194){return db[_0x4733('0x9e')]['findAndCountAll']({'where':{'MailAccountId':_0x1abda1},'order':_0x4733('0xa0')})[_0x4733('0x27')](function(_0x2307ef){_0x380f6d=_0x2307ef;});}})['catch'](function(_0x3b42d2){_0x59bd31=0x1f4;logger['error'](_0x3b42d2[_0x4733('0xa1')]);if(_0x3b42d2[_0x4733('0x2b')]){delete _0x3b42d2[_0x4733('0x2b')];}_0x380f6d=_0x3b42d2;})['finally'](function(){if(_0x380f6d===null){_0x46455f['sendStatus'](_0x59bd31);}else{if(_0x59bd31===0x1f4){_0x46455f[_0x4733('0x1f')](_0x59bd31)[_0x4733('0x2c')](_0x380f6d);}else{_0x46455f[_0x4733('0x1f')](_0x59bd31)['json'](_0x380f6d);}}});};exports[_0x4733('0xa2')]=function(_0x57409f,_0x59da35){var _0x3255a7={};var _0x29b4b1={};var _0x3df911;var _0x27b8d6;return db['MailAccount']['findOne']({'where':{'id':_0x57409f['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x59da35,null))[_0x4733('0x27')](function(_0x95cb76){if(_0x95cb76){_0x3df911=_0x95cb76;_0x29b4b1[_0x4733('0x50')]=_['keys'](db[_0x4733('0x9e')][_0x4733('0x4b')]);_0x29b4b1[_0x4733('0x4c')]=_[_0x4733('0x4d')](_0x57409f['query']);_0x29b4b1[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x29b4b1[_0x4733('0x50')],_0x29b4b1['query']);_0x3255a7[_0x4733('0x51')]=_[_0x4733('0x4f')](_0x29b4b1[_0x4733('0x50')],qs[_0x4733('0x52')](_0x57409f[_0x4733('0x4c')]['fields']));_0x3255a7[_0x4733('0x51')]=_0x3255a7[_0x4733('0x51')][_0x4733('0x60')]?_0x3255a7[_0x4733('0x51')]:_0x29b4b1[_0x4733('0x50')];_0x3255a7[_0x4733('0x77')]=qs[_0x4733('0x55')](_0x57409f['query'][_0x4733('0x55')]);_0x3255a7['where']=qs[_0x4733('0x4e')](_[_0x4733('0x57')](_0x57409f[_0x4733('0x4c')],_0x29b4b1[_0x4733('0x4e')]));if(_0x57409f['query'][_0x4733('0x58')]){_0x3255a7[_0x4733('0x56')]=_[_0x4733('0x59')](_0x3255a7[_0x4733('0x56')],{'$or':_[_0x4733('0x49')](_0x3255a7[_0x4733('0x51')],function(_0x242b8a){var _0x42bfc3={};_0x42bfc3[_0x242b8a]={'$like':'%'+_0x57409f[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x42bfc3;})});}_0x3255a7=_['merge']({},_0x3255a7,_0x57409f[_0x4733('0x5a')]);return _0x3df911[_0x4733('0xa2')](_0x3255a7);}})[_0x4733('0x27')](function(_0x1ea295){if(_0x1ea295){_0x27b8d6=_0x1ea295[_0x4733('0x60')];if(!_0x57409f[_0x4733('0x4c')][_0x4733('0x53')](_0x4733('0x54'))){_0x3255a7[_0x4733('0x24')]=qs['limit'](_0x57409f[_0x4733('0x4c')]['limit']);_0x3255a7[_0x4733('0x22')]=qs[_0x4733('0x22')](_0x57409f[_0x4733('0x4c')][_0x4733('0x22')]);}return _0x3df911[_0x4733('0xa2')](_0x3255a7);}})['then'](function(_0x54b16e){if(_0x54b16e){return _0x54b16e?{'count':_0x27b8d6,'rows':_0x54b16e}:null;}})[_0x4733('0x27')](respondWithResult(_0x59da35,null))['catch'](handleError(_0x59da35,null));};exports[_0x4733('0xa3')]=function(_0x776d42,_0x24c81f){var _0x247c15={'raw':!![],'where':{}};var _0x35a39c={};var _0x3df28a={'count':0x0,'rows':[]};return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x776d42['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x24c81f,null))[_0x4733('0x27')](function(_0x1d6787){if(_0x1d6787){_0x35a39c[_0x4733('0x50')]=_[_0x4733('0x4d')](db[_0x4733('0xa4')][_0x4733('0x4b')]);_0x35a39c[_0x4733('0x4c')]=_['keys'](_0x776d42[_0x4733('0x4c')]);_0x35a39c[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x35a39c[_0x4733('0x50')],_0x35a39c['query']);_0x247c15[_0x4733('0x51')]=_[_0x4733('0x4f')](_0x35a39c[_0x4733('0x50')],qs[_0x4733('0x52')](_0x776d42[_0x4733('0x4c')]['fields']));_0x247c15[_0x4733('0x51')]=_0x247c15[_0x4733('0x51')][_0x4733('0x60')]?_0x247c15[_0x4733('0x51')]:_0x35a39c[_0x4733('0x50')];if(!_0x776d42[_0x4733('0x4c')][_0x4733('0x53')](_0x4733('0x54'))){_0x247c15[_0x4733('0x24')]=qs[_0x4733('0x24')](_0x776d42[_0x4733('0x4c')][_0x4733('0x24')]);_0x247c15[_0x4733('0x22')]=qs['offset'](_0x776d42[_0x4733('0x4c')]['offset']);}_0x247c15['order']=qs['sort'](_0x776d42[_0x4733('0x4c')][_0x4733('0x55')]);_0x247c15[_0x4733('0x56')]=qs[_0x4733('0x4e')](_[_0x4733('0x57')](_0x776d42[_0x4733('0x4c')],_0x35a39c[_0x4733('0x4e')]));_0x247c15[_0x4733('0x56')][_0x4733('0x7b')]=_0x1d6787['id'];if(_0x776d42['query']['filter']){_0x247c15[_0x4733('0x56')]=_[_0x4733('0x59')](_0x247c15[_0x4733('0x56')],{'$or':_['map'](_0x247c15[_0x4733('0x51')],function(_0x572cb5){var _0x45602a={};_0x45602a[_0x572cb5]={'$like':'%'+_0x776d42[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x45602a;})});}if(_0x776d42[_0x4733('0x4c')][_0x4733('0xa5')]){var _0x3c9e73=_0x776d42[_0x4733('0x4c')]['$gte'][_0x4733('0x68')](',');var _0x6534c={};_0x6534c[_0x3c9e73[0x0]]={'$gte':moment(_0x3c9e73[0x1])['format'](_0x4733('0xa6'))};_0x247c15[_0x4733('0x56')]=_['merge'](_0x247c15['where'],_0x6534c);}_0x247c15=_[_0x4733('0x59')]({},_0x247c15,_0x776d42[_0x4733('0x5a')]);return db[_0x4733('0xa4')][_0x4733('0x25')]({'where':_0x247c15[_0x4733('0x56')]})[_0x4733('0x27')](function(_0x2c4596){_0x3df28a[_0x4733('0x25')]=_0x2c4596;if(_0x776d42[_0x4733('0x4c')]['includeAll']){_0x247c15[_0x4733('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0x4733('0x79')](_0x247c15);})[_0x4733('0x27')](function(_0x4ce0f9){if(_0x776d42[_0x4733('0x4c')]['inlineCss']===_0x4733('0xa7')){for(var _0x38fdec=0x0;_0x38fdec<_0x4ce0f9[_0x4733('0x60')];_0x38fdec++){_0x4ce0f9[_0x38fdec][_0x4733('0x6c')]=juice(_0x4ce0f9[_0x38fdec][_0x4733('0x6c')]);}}_0x3df28a['rows']=_0x4ce0f9;return _0x3df28a;});}})[_0x4733('0x27')](respondWithFilteredResult(_0x24c81f,_0x247c15))[_0x4733('0x5d')](handleError(_0x24c81f,null));};exports[_0x4733('0x2c')]=function(_0x4309f1,_0x5b1024){var _0x439720,_0x246a7f={},_0xbdb96;if(_0x4309f1[_0x4733('0x6c')]['to']){_0xbdb96=_0x4309f1[_0x4733('0x6c')]['to'][_0x4733('0x68')](',')[0x0];}return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x4309f1['params']['id']},'include':[{'model':db[_0x4733('0xa8')],'as':_0x4733('0xa9'),'include':[{'model':db[_0x4733('0xaa')],'as':'Contacts','where':{'email':_0xbdb96},'limit':0x1,'order':[[_0x4733('0xab'),_0x4733('0xac')]]}]},{'model':db[_0x4733('0x46')],'as':_0x4733('0x44'),'raw':!![],'include':[{'model':db[_0x4733('0xad')],'as':_0x4733('0xad'),'raw':!![]}]}]})[_0x4733('0x27')](handleEntityNotFound(_0x5b1024,null))[_0x4733('0x27')](function(_0x26ab0c){if(!_0x26ab0c)return;_0x439720=_0x26ab0c;if(!_0x26ab0c[_0x4733('0x44')])throw new Error(_0x4733('0xae'));if(_[_0x4733('0x84')](_0x4309f1[_0x4733('0x6c')]['from'])){_0x4309f1[_0x4733('0x6c')][_0x4733('0xaf')]=util[_0x4733('0xb0')](_0x4733('0xb1'),_0x26ab0c[_0x4733('0x2b')],_0x26ab0c[_0x4733('0xb2')]||_0x26ab0c['Smtp'][_0x4733('0x38')]);}if(_0x4309f1['body']['attachments']&&_0x4309f1[_0x4733('0x6c')][_0x4733('0xb3')][_0x4733('0x60')]){for(var _0x19a167=0x0;_0x19a167<_0x4309f1[_0x4733('0x6c')][_0x4733('0xb3')]['length'];_0x19a167+=0x1){_0x4309f1[_0x4733('0x6c')][_0x4733('0xb3')][_0x19a167]={'filename':_0x4309f1[_0x4733('0x6c')][_0x4733('0xb3')][_0x19a167][_0x4733('0x2b')],'path':path[_0x4733('0x6f')](config[_0x4733('0xb4')],_0x4733('0xb5'),_0x4309f1[_0x4733('0x6c')][_0x4733('0xb3')][_0x19a167][_0x4733('0xb6')])};}}var _0x40a7ae=_0x26ab0c[_0x4733('0xb7')]();return respondWithRpcPromise(_0x4733('0xb8'),'sendMail',{'account':_0x40a7ae,'message':_0x4309f1[_0x4733('0x6c')]});})[_0x4733('0x27')](function(_0x288315){if(!_0x288315)return;_0x246a7f=_0x288315;if(!_0x439720[_0x4733('0xa9')])throw new Error(_0x4733('0xb9'));if(_0x439720[_0x4733('0xa9')][_0x4733('0xba')][_0x4733('0x60')])return _0x439720[_0x4733('0xa9')][_0x4733('0xba')][0x0];return db[_0x4733('0xaa')]['create'](_[_0x4733('0xe')](_0x4309f1[_0x4733('0x6c')],{'firstName':_0x4309f1['body']['to'],'email':_0x4309f1[_0x4733('0x6c')]['to'],'phone':_0x4309f1[_0x4733('0x6c')]['to'],'ListId':_0x439720[_0x4733('0x83')]}));})[_0x4733('0x27')](function(_0x532680){if(!_0x532680)return;var _0x562c4d={'UserId':_0x4309f1['user']['id'],'ContactId':_0x532680['id'],'MailAccountId':_0x439720['id'],'inReplyTo':_0x246a7f[_0x4733('0xbb')],'to':_0x4309f1[_0x4733('0x6c')][_0x4733('0xaf')],'cc':_0x4309f1[_0x4733('0x6c')]['cc'],'subject':_0x4309f1[_0x4733('0x6c')]['subject'],'attach':_0x4309f1[_0x4733('0x6c')][_0x4733('0xbc')],'firstMsgDirection':_0x4733('0xbd'),'lastMsgAt':moment()[_0x4733('0xb0')](_0x4733('0xa6')),'lastMsgDirection':_0x4733('0xbd'),'Messages':[_['merge'](_0x4309f1[_0x4733('0x6c')],{'messageId':_0x246a7f[_0x4733('0xbb')],'sentAt':moment()[_0x4733('0xb0')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x439720['id'],'UserId':_0x4309f1[_0x4733('0x38')]['id'],'ContactId':_0x532680['id']})]};if(_0x4309f1[_0x4733('0x6c')][_0x4733('0xbe')]){_0x562c4d=_[_0x4733('0x59')](_0x562c4d,_0x4309f1[_0x4733('0x6c')]['Interaction']);}return db['MailInteraction']['create'](_0x562c4d,{'include':[{'model':db[_0x4733('0xa4')],'as':'Messages'}]});})[_0x4733('0x27')](respondWithResult(_0x5b1024,null))[_0x4733('0x5d')](handleError(_0x5b1024,null));};exports[_0x4733('0xbf')]=function(_0x1614f3,_0x4059ba){return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x1614f3[_0x4733('0x5f')]['id']},'include':[{'model':db[_0x4733('0x46')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x4733('0xad')],'as':_0x4733('0xad'),'raw':!![]}]}]})[_0x4733('0x27')](handleEntityNotFound(_0x4059ba,null))[_0x4733('0x27')](function(_0x13d2cd){if(!_0x13d2cd[_0x4733('0x44')])return;var _0x11c38a=_0x13d2cd[_0x4733('0xb7')]();return respondWithRpcPromise(_0x4733('0xc0'),'verifySmtp',{'account':_0x11c38a});})[_0x4733('0x27')](respondWithResult(_0x4059ba,null))[_0x4733('0x5d')](handleError(_0x4059ba,null));};exports[_0x4733('0x28')]=function(_0x648cd,_0x848687){return db[_0x4733('0x4a')]['find']({'where':{'id':_0x648cd[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x848687,null))[_0x4733('0x27')](function(_0x44e08b){if(_0x44e08b&&_0x44e08b['service']){throw new db[(_0x4733('0xc1'))][(_0x4733('0xc2'))](_0x4733('0xc3'));}return _0x44e08b;})[_0x4733('0x27')](removeEntity(_0x848687,null))['catch'](handleError(_0x848687,null));};exports[_0x4733('0xc4')]=function(_0x1c0a29,_0x55df6b){return db['MailAccount']['find']({'where':{'id':_0x1c0a29[_0x4733('0x5f')]['id']}})['then'](handleEntityNotFound(_0x55df6b,null))['then'](function(_0x151f80){if(_0x151f80){return _0x151f80[_0x4733('0xc4')](_0x1c0a29[_0x4733('0x6c')][_0x4733('0x80')],_[_0x4733('0xc5')](_0x1c0a29[_0x4733('0x6c')],[_0x4733('0x80'),'id'])||{})[_0x4733('0xc6')](function(_0x246ec4){for(var _0x4a0917=0x0;_0x4a0917<_0x1c0a29[_0x4733('0x6c')][_0x4733('0x80')][_0x4733('0x60')];_0x4a0917+=0x1){socket[_0x4733('0xc7')](_0x4733('0xc8'),{'UserId':Number(_0x1c0a29[_0x4733('0x6c')]['ids'][_0x4a0917]),'MailAccountId':Number(_0x1c0a29[_0x4733('0x5f')]['id'])});}return _0x246ec4;});}})['then'](respondWithResult(_0x55df6b,null))[_0x4733('0x5d')](handleError(_0x55df6b,null));};exports[_0x4733('0xc9')]=function(_0x444994,_0x1c1b3e){return db[_0x4733('0x4a')][_0x4733('0x71')]({'where':{'id':_0x444994[_0x4733('0x5f')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x1c1b3e,null))[_0x4733('0x27')](function(_0x4883ec){if(_0x4883ec){return _0x4883ec['removeAgents'](_0x444994['query'][_0x4733('0x80')])['then'](function(){if(_[_0x4733('0xca')](_0x444994[_0x4733('0x4c')][_0x4733('0x80')])){for(var _0xbb11b3=0x0;_0xbb11b3<_0x444994[_0x4733('0x4c')][_0x4733('0x80')][_0x4733('0x60')];_0xbb11b3+=0x1){socket[_0x4733('0xc7')](_0x4733('0xcb'),{'UserId':Number(_0x444994['query']['ids'][_0xbb11b3]),'MailAccountId':Number(_0x444994[_0x4733('0x5f')]['id'])});}}else{socket[_0x4733('0xc7')](_0x4733('0xcb'),{'UserId':Number(_0x444994['query']['ids']),'MailAccountId':Number(_0x444994[_0x4733('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x1c1b3e,null))[_0x4733('0x5d')](handleError(_0x1c1b3e,null));};exports[_0x4733('0xcc')]=function(_0x207abf,_0x408cf3){var _0x429735={};var _0x41a0e2={};var _0x1bd092;var _0x249c2d;return db[_0x4733('0x4a')][_0x4733('0x7e')]({'where':{'id':_0x207abf['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x408cf3,null))[_0x4733('0x27')](function(_0x11f3ae){if(_0x11f3ae){_0x1bd092=_0x11f3ae;_0x41a0e2[_0x4733('0x50')]=_[_0x4733('0x4d')](db[_0x4733('0x94')][_0x4733('0x4b')]);_0x41a0e2['query']=_[_0x4733('0x4d')](_0x207abf[_0x4733('0x4c')]);_0x41a0e2[_0x4733('0x4e')]=_[_0x4733('0x4f')](_0x41a0e2[_0x4733('0x50')],_0x41a0e2['query']);_0x429735[_0x4733('0x51')]=_[_0x4733('0x4f')](_0x41a0e2[_0x4733('0x50')],qs[_0x4733('0x52')](_0x207abf['query'][_0x4733('0x52')]));_0x429735[_0x4733('0x51')]=_0x429735['attributes']['length']?_0x429735[_0x4733('0x51')]:_0x41a0e2[_0x4733('0x50')];_0x429735[_0x4733('0x77')]=qs[_0x4733('0x55')](_0x207abf[_0x4733('0x4c')][_0x4733('0x55')]);_0x429735[_0x4733('0x56')]=qs['filters'](_[_0x4733('0x57')](_0x207abf['query'],_0x41a0e2[_0x4733('0x4e')]));if(_0x207abf[_0x4733('0x4c')][_0x4733('0x58')]){_0x429735[_0x4733('0x56')]=_[_0x4733('0x59')](_0x429735['where'],{'$or':_['map'](_0x429735[_0x4733('0x51')],function(_0x212c45){var _0x5170ad={};_0x5170ad[_0x212c45]={'$like':'%'+_0x207abf[_0x4733('0x4c')][_0x4733('0x58')]+'%'};return _0x5170ad;})});}_0x429735=_[_0x4733('0x59')]({},_0x429735,_0x207abf['options']);return _0x1bd092[_0x4733('0xcc')](_0x429735);}})[_0x4733('0x27')](function(_0x7cf063){if(_0x7cf063){_0x249c2d=_0x7cf063['length'];if(!_0x207abf[_0x4733('0x4c')][_0x4733('0x53')]('nolimit')){_0x429735[_0x4733('0x24')]=qs['limit'](_0x207abf[_0x4733('0x4c')]['limit']);_0x429735['offset']=qs[_0x4733('0x22')](_0x207abf[_0x4733('0x4c')][_0x4733('0x22')]);}return _0x1bd092[_0x4733('0xcc')](_0x429735);}})['then'](function(_0x191b09){if(_0x191b09){return _0x191b09?{'count':_0x249c2d,'rows':_0x191b09}:null;}})[_0x4733('0x27')](respondWithResult(_0x408cf3,null))[_0x4733('0x5d')](handleError(_0x408cf3,null));};
\ No newline at end of file
index ef16aeb..9569af8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0007=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update','remove'];(function(_0x18cb50,_0xaf4b35){var _0x48c563=function(_0x1a2099){while(--_0x1a2099){_0x18cb50['push'](_0x18cb50['shift']());}};_0x48c563(++_0xaf4b35);}(_0x0007,0x1ee));var _0x7000=function(_0x33ccaf,_0x192235){_0x33ccaf=_0x33ccaf-0x0;var _0x30abf6=_0x0007[_0x33ccaf];return _0x30abf6;};'use strict';var EventEmitter=require(_0x7000('0x0'));var MailAccount=require(_0x7000('0x1'))['db'][_0x7000('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7000('0x3'),'afterUpdate':_0x7000('0x4'),'afterDestroy':_0x7000('0x5')};function emitEvent(_0x3e6fbc){return function(_0x4e5711,_0x21fa8e,_0x3fda6d){MailAccountEvents[_0x7000('0x6')](_0x3e6fbc+':'+_0x4e5711['id'],_0x4e5711);MailAccountEvents[_0x7000('0x6')](_0x3e6fbc,_0x4e5711);_0x3fda6d(null);};}for(var e in events){if(events[_0x7000('0x7')](e)){var event=events[e];MailAccount[_0x7000('0x8')](e,emitEvent(event));}}module[_0x7000('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0xfa94=['exports','events','MailAccount','save','update','emit','hasOwnProperty'];(function(_0x140cb2,_0x292f49){var _0x202358=function(_0xda3038){while(--_0xda3038){_0x140cb2['push'](_0x140cb2['shift']());}};_0x202358(++_0x292f49);}(_0xfa94,0xef));var _0x4fa9=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xfa94[_0x3ce2c4];return _0x4047c1;};'use strict';var EventEmitter=require(_0x4fa9('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x4fa9('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4fa9('0x2'),'afterUpdate':_0x4fa9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x40e2f6){return function(_0xa08385,_0xe1adab,_0x22e87d){MailAccountEvents[_0x4fa9('0x4')](_0x40e2f6+':'+_0xa08385['id'],_0xa08385);MailAccountEvents[_0x4fa9('0x4')](_0x40e2f6,_0xa08385);_0x22e87d(null);};}for(var e in events){if(events[_0x4fa9('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x4fa9('0x6')]=MailAccountEvents;
\ No newline at end of file
index c4c46b5..e6724e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97fe=['service','provider','host','Smtp','port','secure','authentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','auth','user','data5','pass','./mailAccount.attributes','exports','define','custom'];(function(_0x56901d,_0x29aa64){var _0x426785=function(_0x24b415){while(--_0x24b415){_0x56901d['push'](_0x56901d['shift']());}};_0x426785(++_0x29aa64);}(_0x97fe,0x1d8));var _0xe97f=function(_0x138b5c,_0x28acb1){_0x138b5c=_0x138b5c-0x0;var _0x441f98=_0x97fe[_0x138b5c];return _0x441f98;};'use strict';var attributes=require(_0xe97f('0x0'));module[_0xe97f('0x1')]=function(_0xe97e3f){return _0xe97e3f[_0xe97f('0x2')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x17b613=this;var _0x225847={'id':_0x17b613['id'],'tls':{'rejectUnauthorized':![]}};if(_0x17b613['provider']!==_0xe97f('0x3')){_0x225847[_0xe97f('0x4')]=_0x17b613[_0xe97f('0x5')];}else{_0x225847[_0xe97f('0x6')]=_0x17b613[_0xe97f('0x7')][_0xe97f('0x6')];_0x225847['port']=_0x17b613[_0xe97f('0x7')][_0xe97f('0x8')];_0x225847['secure']=_0x17b613[_0xe97f('0x7')][_0xe97f('0x9')];}if(_0x17b613['Smtp'][_0xe97f('0xa')]){if(_0x17b613[_0xe97f('0x7')]['modernAuthentication']){if(!_0x17b613[_0xe97f('0x7')][_0xe97f('0xb')])throw new Error(_0xe97f('0xc'));_0x225847[_0xe97f('0xd')]={'type':'OAuth2','user':_0x17b613['Smtp'][_0xe97f('0xe')],'accessToken':_0x17b613[_0xe97f('0x7')][_0xe97f('0xb')][_0xe97f('0xf')]};}else{_0x225847[_0xe97f('0xd')]={'user':_0x17b613[_0xe97f('0x7')]['user'],'pass':_0x17b613[_0xe97f('0x7')][_0xe97f('0x10')]};}}return _0x225847;}}});};
\ No newline at end of file
+var _0x7fae=['MailAccount','mail_accounts','provider','custom','service','Smtp','host','port','secure','authentication','modernAuthentication','auth','OAuth2','user','CloudProvider','data5','pass','./mailAccount.attributes','exports','define'];(function(_0xa4989a,_0x5bb069){var _0x34f5fc=function(_0x16a3a2){while(--_0x16a3a2){_0xa4989a['push'](_0xa4989a['shift']());}};_0x34f5fc(++_0x5bb069);}(_0x7fae,0x1dd));var _0xe7fa=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x7fae[_0x565c49];return _0x20ca34;};'use strict';var attributes=require(_0xe7fa('0x0'));module[_0xe7fa('0x1')]=function(_0x1903cc){return _0x1903cc[_0xe7fa('0x2')](_0xe7fa('0x3'),attributes,{'tableName':_0xe7fa('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x2e3e85=this;var _0x3a4467={'id':_0x2e3e85['id'],'tls':{'rejectUnauthorized':![]}};if(_0x2e3e85[_0xe7fa('0x5')]!==_0xe7fa('0x6')){_0x3a4467[_0xe7fa('0x7')]=_0x2e3e85[_0xe7fa('0x5')];}else{_0x3a4467['host']=_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0x9')];_0x3a4467[_0xe7fa('0xa')]=_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0xa')];_0x3a4467[_0xe7fa('0xb')]=_0x2e3e85[_0xe7fa('0x8')]['secure'];}if(_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0xc')]){if(_0x2e3e85['Smtp'][_0xe7fa('0xd')]){if(!_0x2e3e85['Smtp']['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x3a4467[_0xe7fa('0xe')]={'type':_0xe7fa('0xf'),'user':_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0x10')],'accessToken':_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0x11')][_0xe7fa('0x12')]};}else{_0x3a4467['auth']={'user':_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0x10')],'pass':_0x2e3e85[_0xe7fa('0x8')][_0xe7fa('0x13')]};}}return _0x3a4467;}}});};
\ No newline at end of file
index f085929..e8cf71b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1967=['getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmContact','updatedAt','Applications','CloudProvider','List','get','applications','list','priority','asc','autoclose','push','close','*,*,*,*','Contacts','length','create','messageId','generate','subject','attach','format','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','YYYY-MM-DD\x20HH:mm:ss','interaction','created','contact','attachments','originTo','originCc','bcc','ChatOfflineMessageId','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailAccount','findAll','options','where','attributes','limit','map','include','model','ShowMailAccount','MailAccount','find','smtp','setDataValue','smtpOptions'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0x1967,0x173));var _0x7196=function(_0x4ec67a,_0x533367){_0x4ec67a=_0x4ec67a-0x0;var _0xd26d06=_0x1967[_0x4ec67a];return _0xd26d06;};'use strict';var _=require('lodash');var moment=require(_0x7196('0x0'));var BPromise=require(_0x7196('0x1'));var rs=require(_0x7196('0x2'));var Redis=require(_0x7196('0x3'));var db=require(_0x7196('0x4'))['db'];var logger=require(_0x7196('0x5'))(_0x7196('0x6'));var config=require(_0x7196('0x7'));var jayson=require(_0x7196('0x8'));var client=jayson[_0x7196('0x9')]['http']({'port':0x232c});config[_0x7196('0xa')]=_[_0x7196('0xb')](config[_0x7196('0xa')],{'host':_0x7196('0xc'),'port':0x18eb});var socket=require(_0x7196('0xd'))(new Redis(config[_0x7196('0xa')]));require('./mailAccount.socket')[_0x7196('0xe')](socket);function respondWithRpcPromise(_0xc6366f,_0x3f846e,_0x259b18){return new BPromise(function(_0x1e862d,_0x503070){return client['request'](_0xc6366f,_0x259b18)[_0x7196('0xf')](function(_0x10459b){logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));logger[_0x7196('0x13')](_0x7196('0x14'),_0x3f846e,_0x7196('0x12'),JSON[_0x7196('0x15')](_0x10459b));if(_0x10459b[_0x7196('0x16')]){if(_0x10459b[_0x7196('0x16')]['code']===0x1f4){logger[_0x7196('0x16')](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x503070(_0x10459b['error'][_0x7196('0x17')]);}logger['error'](_0x7196('0x11'),_0x3f846e,_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);return _0x1e862d(_0x10459b[_0x7196('0x16')][_0x7196('0x17')]);}else{logger[_0x7196('0x10')](_0x7196('0x11'),_0x3f846e,_0x7196('0x12'));_0x1e862d(_0x10459b[_0x7196('0x18')][_0x7196('0x17')]);}})[_0x7196('0x19')](function(_0x5b716a){logger['error'](_0x7196('0x11'),_0x3f846e,_0x5b716a);_0x503070(_0x5b716a);});});}exports[_0x7196('0x1a')]=function(_0x40418d){var _0x517a3e=this;return new Promise(function(_0x39b944,_0x539d8b){return db['MailAccount'][_0x7196('0x1b')]({'raw':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1d')]||null:null,'attributes':_0x40418d['options']?_0x40418d[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'limit':_0x40418d[_0x7196('0x1c')]?_0x40418d[_0x7196('0x1c')][_0x7196('0x1f')]||null:null,'include':_0x40418d['options']?_0x40418d[_0x7196('0x1c')]['include']?_[_0x7196('0x20')](_0x40418d[_0x7196('0x1c')][_0x7196('0x21')],function(_0xa69810){return{'model':db[_0xa69810[_0x7196('0x22')]],'as':_0xa69810['as'],'attributes':_0xa69810[_0x7196('0x1e')],'include':_0xa69810['include']?_['map'](_0xa69810[_0x7196('0x21')],function(_0x2d284f){return{'model':db[_0x2d284f[_0x7196('0x22')]],'as':_0x2d284f['as'],'attributes':_0x2d284f['attributes'],'include':_0x2d284f['include']?_[_0x7196('0x20')](_0x2d284f[_0x7196('0x21')],function(_0x675e64){return{'model':db[_0x675e64['model']],'as':_0x675e64['as'],'attributes':_0x675e64[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd339){logger['info'](_0x7196('0x1a'),_0x40418d);logger[_0x7196('0x13')](_0x7196('0x1a'),_0x40418d,JSON['stringify'](_0x4fd339));_0x39b944(_0x4fd339);})[_0x7196('0x19')](function(_0x45d567){logger[_0x7196('0x16')](_0x7196('0x1a'),_0x45d567['message'],_0x40418d);_0x539d8b(_0x517a3e[_0x7196('0x16')](0x1f4,_0x45d567[_0x7196('0x17')]));});});};exports[_0x7196('0x23')]=function(_0x651d7e){var _0x4780e1=this;return new Promise(function(_0x2786f3,_0x15c5f0){return db[_0x7196('0x24')][_0x7196('0x25')]({'raw':_0x651d7e[_0x7196('0x1c')]?_0x651d7e[_0x7196('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x651d7e[_0x7196('0x1c')]?_0x651d7e['options'][_0x7196('0x1d')]||null:null,'attributes':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x1e')]||null:null,'include':_0x651d7e['options']?_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')]?_[_0x7196('0x20')](_0x651d7e[_0x7196('0x1c')][_0x7196('0x21')],function(_0x4a8580){return{'model':db[_0x4a8580[_0x7196('0x22')]],'as':_0x4a8580['as'],'attributes':_0x4a8580[_0x7196('0x1e')],'include':_0x4a8580[_0x7196('0x21')]?_[_0x7196('0x20')](_0x4a8580[_0x7196('0x21')],function(_0x123cad){return{'model':db[_0x123cad['model']],'as':_0x123cad['as'],'attributes':_0x123cad[_0x7196('0x1e')],'include':_0x123cad[_0x7196('0x21')]?_[_0x7196('0x20')](_0x123cad['include'],function(_0x33831a){return{'model':db[_0x33831a[_0x7196('0x22')]],'as':_0x33831a['as'],'attributes':_0x33831a[_0x7196('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7196('0xf')](function(_0x11d4ec){if(_0x651d7e[_0x7196('0x1c')][_0x7196('0x26')]===!![])_0x11d4ec[_0x7196('0x27')](_0x7196('0x28'),_0x11d4ec[_0x7196('0x29')]());logger['info'](_0x7196('0x23'),_0x651d7e);logger[_0x7196('0x13')]('ShowMailAccount',_0x651d7e,JSON[_0x7196('0x15')](_0x11d4ec));_0x2786f3(_0x11d4ec);})['catch'](function(_0x5bd701){logger[_0x7196('0x16')](_0x7196('0x23'),_0x5bd701['message'],_0x651d7e);_0x15c5f0(_0x4780e1['error'](0x1f4,_0x5bd701[_0x7196('0x17')]));});});};exports[_0x7196('0x2a')]=function(_0xed32cd){var _0x4c2341=this;return new Promise(function(_0x36a990,_0x2d13a5){var _0x29ba1c={'body':_0xed32cd[_0x7196('0x2b')],'channel':_0x7196('0x2c')};var _0x428d76=_[_0x7196('0x2d')](_[_0x7196('0x2e')](db['CmContact'][_0x7196('0x2f')]),[_0x7196('0x30'),'updatedAt',_0x7196('0x31'),_0x7196('0x32')]);var _0x48178f=![];if(_0xed32cd[_0x7196('0x2b')]['id']){delete _0xed32cd[_0x7196('0x2b')]['id'];}if(_[_0x7196('0x33')](_0xed32cd['body'][_0x7196('0x34')])){return _0x2d13a5(_0x4c2341[_0x7196('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x7196('0x33')](_0xed32cd[_0x7196('0x2b')]['body'])||_0xed32cd[_0x7196('0x2b')]['body']===''){return _0x2d13a5(_0x4c2341['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0xed32cd['body'][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x36')+_0x428d76));}if(!_[_0x7196('0x37')](_0x428d76,_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')])){return _0x2d13a5(_0x4c2341['error'](0x1f4,_0x7196('0x38')+_0x428d76));}var _0x56ffdd={};_0x56ffdd[_0xed32cd[_0x7196('0x2b')][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')]['from'];return db[_0x7196('0x24')][_0x7196('0x25')]({'where':{'id':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x7196('0x3a')],'as':'Contacts','where':_0x56ffdd,'limit':0x1,'order':[[_0x7196('0x3b'),'DESC']]}]},{'model':db['MailApplication'],'as':_0x7196('0x3c')},{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x7196('0x3d')}]}]})['then'](function(_0x48e3b5){if(_0x48e3b5&&_0x48e3b5[_0x7196('0x3e')]){var _0x182c8b=_0x48e3b5[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x39')]=_['omit'](_0x182c8b,[_0x7196('0x3c'),'List']);_0x29ba1c[_0x7196('0x39')][_0x7196('0x28')]=_0x48e3b5['getSmtpOptions']();_0x29ba1c[_0x7196('0x40')]=_0x182c8b[_0x7196('0x3c')];_0x29ba1c[_0x7196('0x41')]=_0x182c8b['List'];_0x29ba1c[_0x7196('0x40')]=_['orderBy'](_0x29ba1c[_0x7196('0x40')],[_0x7196('0x42')],[_0x7196('0x43')]);if(_0x29ba1c[_0x7196('0x39')]&&_0x29ba1c[_0x7196('0x39')][_0x7196('0x44')]){_0x29ba1c[_0x7196('0x40')][_0x7196('0x45')]({'id':0x0,'priority':_0x29ba1c['applications']['length']+0x1,'app':_0x7196('0x46'),'appdata':_0x7196('0x44'),'interval':_0x7196('0x47')});}if(_0x29ba1c[_0x7196('0x39')]['Applications']){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3c')];}if(_0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')]){delete _0x29ba1c[_0x7196('0x39')][_0x7196('0x3e')];}if(_0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][_0x7196('0x49')]){return _0x182c8b[_0x7196('0x3e')][_0x7196('0x48')][0x0];}var _0x4940a2=_[_0x7196('0xb')](_0xed32cd[_0x7196('0x2b')],{'firstName':_0xed32cd[_0x7196('0x2b')]['from'],'ListId':_0x182c8b[_0x7196('0x32')]});_0x4940a2[_0xed32cd['body'][_0x7196('0x35')]]=_0xed32cd[_0x7196('0x2b')][_0x7196('0x34')];return db[_0x7196('0x3a')][_0x7196('0x4a')](_0x4940a2);}else{throw new Error('List\x20not\x20found');}})[_0x7196('0xf')](function(_0x5b77fc){_0x29ba1c['contact']=_0x5b77fc;if(_0x5b77fc){if(!_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4b')]){_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')]=rs[_0x7196('0x4c')]()+'\x20'+_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x34')];}var _0x14dc43={'ContactId':_0x5b77fc['id'],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id'],'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['messageId'],'to':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x34')],'cc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['cc'],'subject':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x7196('0x50')][_0x7196('0x25')]({'where':{'closed':![],'MailAccountId':_0xed32cd[_0x7196('0x39')]['id']},'include':[{'model':db[_0x7196('0x51')],'as':'Messages','attributes':[_0x7196('0x4b')],'where':{'messageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x52')]}}]})[_0x7196('0xf')](function(_0x3c3d64){if(_0x3c3d64){return[_0x3c3d64,![]];}return db[_0x7196('0x50')]['create'](_0x14dc43)[_0x7196('0xf')](function(_0x2c5cba){return[_0x2c5cba,!![]];});});}else{throw new Error(_0x7196('0x53'));}})[_0x7196('0x54')](function(_0x52827f,_0x418a7a){if(_0x52827f){_0x48178f=_0x418a7a;if(!_0x418a7a){return _0x52827f[_0x7196('0x55')]({'inReplyTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4b')],'to':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['from'],'cc':_0xed32cd['body']['message']['cc'],'subject':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x4d')],'attach':_0x52827f[_0x7196('0x4e')]?_0x52827f[_0x7196('0x4e')]:_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'substatus':null,'substatusAt':moment()[_0x7196('0x4f')](_0x7196('0x56')),'lastMsgAt':moment()[_0x7196('0x4f')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x52827f;}}})['then'](function(_0x4542c1){_0x29ba1c[_0x7196('0x57')]=_0x4542c1[_0x7196('0x3f')]({'plain':!![]});_0x29ba1c[_0x7196('0x57')][_0x7196('0x58')]=_0x48178f;return db[_0x7196('0x51')][_0x7196('0x4a')]({'body':_0xed32cd[_0x7196('0x2b')]['body'],'MailAccountId':_0xed32cd['account']['id'],'MailInteractionId':_0x4542c1['id'],'direction':'in','ContactId':_0x29ba1c[_0x7196('0x59')]['id'],'messageId':_0xed32cd['body'][_0x7196('0x17')]['messageId'],'from':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x34')],'to':_0xed32cd[_0x7196('0x2b')]['message']['to'],'cc':_0xed32cd['body'][_0x7196('0x17')]['cc'],'subject':_0xed32cd['body'][_0x7196('0x17')][_0x7196('0x4d')],'attach':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x4e')],'Attachments':_0xed32cd[_0x7196('0x2b')]['message'][_0x7196('0x5a')],'originTo':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5b')],'originCc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5c')],'bcc':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5d')],'ChatWebsiteId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['ChatWebsiteId']||null,'originChannel':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')]['originChannel']||'Email','ChatOfflineMessageId':_0xed32cd[_0x7196('0x2b')][_0x7196('0x17')][_0x7196('0x5e')]||null},{'include':[{'model':db['Attachment'],'as':_0x7196('0x5f')}]});})['then'](function(_0x218396){_0x29ba1c[_0x7196('0x17')]=_0x218396;if(_0x29ba1c['interaction'][_0x7196('0x60')]){return db['User']['find']({'attributes':['id',_0x7196('0x61')],'where':{'id':_0x29ba1c[_0x7196('0x57')][_0x7196('0x60')]}})['then'](function(_0x423b83){if(_0x423b83){_0x29ba1c['applications'][_0x7196('0x62')]({'id':0x0,'priority':0x0,'app':_0x7196('0x63'),'appdata':_0x423b83[_0x7196('0x61')]+','+(_0x29ba1c[_0x7196('0x39')][_0x7196('0x64')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);});}return respondWithRpcPromise(_0x7196('0x65'),_0x7196('0x66'),_0x29ba1c);})[_0x7196('0xf')](function(_0x29bafd){_0x36a990(_0x29bafd);})[_0x7196('0x19')](function(_0x34633a){_0x2d13a5(_0x4c2341['error'](0x1f4,_0x34633a[_0x7196('0x17')]));});});};
\ No newline at end of file
+var _0x4137=['Smtp','CloudProvider','get','omit','Applications','applications','priority','asc','push','length','Contacts','create','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Contact\x20not\x20found','spread','update','interaction','created','MailMessage','originTo','originCc','bcc','originChannel','ChatOfflineMessageId','Attachment','Attachments','User','name','UserId','*,*,*,*','Start','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','mail','difference','keys','CmContact','createdAt','CompanyId','ListId','body','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','DESC','MailServerOut'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x4137,0xf8));var _0x7413=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x4137[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var BPromise=require(_0x7413('0x2'));var rs=require(_0x7413('0x3'));var Redis=require(_0x7413('0x4'));var db=require(_0x7413('0x5'))['db'];var logger=require(_0x7413('0x6'))(_0x7413('0x7'));var config=require(_0x7413('0x8'));var jayson=require(_0x7413('0x9'));var client=jayson[_0x7413('0xa')][_0x7413('0xb')]({'port':0x232c});config['redis']=_[_0x7413('0xc')](config[_0x7413('0xd')],{'host':_0x7413('0xe'),'port':0x18eb});var socket=require(_0x7413('0xf'))(new Redis(config['redis']));require(_0x7413('0x10'))[_0x7413('0x11')](socket);function respondWithRpcPromise(_0x4e320b,_0x422bf5,_0x2f4b54){return new BPromise(function(_0x50fde0,_0x29f124){return client[_0x7413('0x12')](_0x4e320b,_0x2f4b54)[_0x7413('0x13')](function(_0x3e026b){logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));logger[_0x7413('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'),JSON[_0x7413('0x17')](_0x3e026b));if(_0x3e026b[_0x7413('0x18')]){if(_0x3e026b['error']['code']===0x1f4){logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b[_0x7413('0x18')]['message']);return _0x29f124(_0x3e026b[_0x7413('0x18')][_0x7413('0x1a')]);}logger['error'](_0x7413('0x19'),_0x422bf5,_0x3e026b['error']['message']);return _0x50fde0(_0x3e026b[_0x7413('0x18')]['message']);}else{logger[_0x7413('0x14')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x7413('0x15'));_0x50fde0(_0x3e026b[_0x7413('0x1b')][_0x7413('0x1a')]);}})[_0x7413('0x1c')](function(_0x2a3417){logger[_0x7413('0x18')]('MailAccount,\x20%s,\x20%s',_0x422bf5,_0x2a3417);_0x29f124(_0x2a3417);});});}exports[_0x7413('0x1d')]=function(_0x17c062){var _0x11f8a1=this;return new Promise(function(_0xfe5b8c,_0x5bee15){return db[_0x7413('0x1e')][_0x7413('0x1f')]({'raw':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x21')]===undefined?!![]:![]:!![],'where':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x22')]||null:null,'attributes':_0x17c062['options']?_0x17c062['options'][_0x7413('0x23')]||null:null,'limit':_0x17c062['options']?_0x17c062[_0x7413('0x20')][_0x7413('0x24')]||null:null,'include':_0x17c062[_0x7413('0x20')]?_0x17c062[_0x7413('0x20')][_0x7413('0x25')]?_[_0x7413('0x26')](_0x17c062[_0x7413('0x20')][_0x7413('0x25')],function(_0x1d455b){return{'model':db[_0x1d455b['model']],'as':_0x1d455b['as'],'attributes':_0x1d455b['attributes'],'include':_0x1d455b[_0x7413('0x25')]?_['map'](_0x1d455b[_0x7413('0x25')],function(_0x71cbb4){return{'model':db[_0x71cbb4[_0x7413('0x27')]],'as':_0x71cbb4['as'],'attributes':_0x71cbb4['attributes'],'include':_0x71cbb4[_0x7413('0x25')]?_[_0x7413('0x26')](_0x71cbb4[_0x7413('0x25')],function(_0x4843fd){return{'model':db[_0x4843fd[_0x7413('0x27')]],'as':_0x4843fd['as'],'attributes':_0x4843fd[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24dce7){logger['info'](_0x7413('0x1d'),_0x17c062);logger[_0x7413('0x16')](_0x7413('0x1d'),_0x17c062,JSON[_0x7413('0x17')](_0x24dce7));_0xfe5b8c(_0x24dce7);})[_0x7413('0x1c')](function(_0x2004ea){logger['error'](_0x7413('0x1d'),_0x2004ea[_0x7413('0x1a')],_0x17c062);_0x5bee15(_0x11f8a1[_0x7413('0x18')](0x1f4,_0x2004ea[_0x7413('0x1a')]));});});};exports[_0x7413('0x28')]=function(_0x256395){var _0x185cfe=this;return new Promise(function(_0x5b4426,_0xd763f9){return db[_0x7413('0x1e')][_0x7413('0x29')]({'raw':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x22')]||null:null,'attributes':_0x256395[_0x7413('0x20')]?_0x256395[_0x7413('0x20')]['attributes']||null:null,'include':_0x256395[_0x7413('0x20')]?_0x256395['options'][_0x7413('0x25')]?_[_0x7413('0x26')](_0x256395['options']['include'],function(_0x440bfe){return{'model':db[_0x440bfe[_0x7413('0x27')]],'as':_0x440bfe['as'],'attributes':_0x440bfe[_0x7413('0x23')],'include':_0x440bfe['include']?_['map'](_0x440bfe[_0x7413('0x25')],function(_0x5a92ab){return{'model':db[_0x5a92ab['model']],'as':_0x5a92ab['as'],'attributes':_0x5a92ab[_0x7413('0x23')],'include':_0x5a92ab['include']?_[_0x7413('0x26')](_0x5a92ab[_0x7413('0x25')],function(_0xf34b21){return{'model':db[_0xf34b21[_0x7413('0x27')]],'as':_0xf34b21['as'],'attributes':_0xf34b21[_0x7413('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa58bd2){if(_0x256395[_0x7413('0x20')][_0x7413('0x2a')]===!![])_0xa58bd2[_0x7413('0x2b')](_0x7413('0x2c'),_0xa58bd2[_0x7413('0x2d')]());logger[_0x7413('0x14')](_0x7413('0x28'),_0x256395);logger[_0x7413('0x16')](_0x7413('0x28'),_0x256395,JSON[_0x7413('0x17')](_0xa58bd2));_0x5b4426(_0xa58bd2);})[_0x7413('0x1c')](function(_0x5a9791){logger[_0x7413('0x18')]('ShowMailAccount',_0x5a9791['message'],_0x256395);_0xd763f9(_0x185cfe['error'](0x1f4,_0x5a9791['message']));});});};exports['NotifyMailAccount']=function(_0x44af7d){var _0x4c1770=this;return new Promise(function(_0x535e49,_0x5dc077){var _0x4d0008={'body':_0x44af7d['body'],'channel':_0x7413('0x2e')};var _0x32f1e8=_[_0x7413('0x2f')](_[_0x7413('0x30')](db[_0x7413('0x31')]['rawAttributes']),[_0x7413('0x32'),'updatedAt',_0x7413('0x33'),_0x7413('0x34')]);var _0xa063d1=![];if(_0x44af7d[_0x7413('0x35')]['id']){delete _0x44af7d[_0x7413('0x35')]['id'];}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x37')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x38')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x35')])||_0x44af7d['body'][_0x7413('0x35')]===''){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x39')));}if(_[_0x7413('0x36')](_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x7413('0x3b')+_0x32f1e8));}if(!_[_0x7413('0x3c')](_0x32f1e8,_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')])){return _0x5dc077(_0x4c1770['error'](0x1f4,_0x7413('0x3d')+_0x32f1e8));}var _0x52a088={};_0x52a088[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d[_0x7413('0x35')][_0x7413('0x37')];return db[_0x7413('0x1e')][_0x7413('0x29')]({'where':{'id':_0x44af7d[_0x7413('0x3e')]['id']},'include':[{'model':db[_0x7413('0x3f')],'as':_0x7413('0x40'),'include':[{'model':db[_0x7413('0x31')],'as':'Contacts','where':_0x52a088,'limit':0x1,'order':[['updatedAt',_0x7413('0x41')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db[_0x7413('0x42')],'as':_0x7413('0x43'),'include':[{'model':db['CloudProvider'],'as':_0x7413('0x44')}]}]})['then'](function(_0x562bae){if(_0x562bae&&_0x562bae[_0x7413('0x40')]){var _0x5f263e=_0x562bae[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x3e')]=_[_0x7413('0x46')](_0x5f263e,[_0x7413('0x47'),_0x7413('0x40')]);_0x4d0008[_0x7413('0x3e')][_0x7413('0x2c')]=_0x562bae[_0x7413('0x2d')]();_0x4d0008[_0x7413('0x48')]=_0x5f263e[_0x7413('0x47')];_0x4d0008['list']=_0x5f263e[_0x7413('0x40')];_0x4d0008['applications']=_['orderBy'](_0x4d0008['applications'],[_0x7413('0x49')],[_0x7413('0x4a')]);if(_0x4d0008[_0x7413('0x3e')]&&_0x4d0008[_0x7413('0x3e')]['autoclose']){_0x4d0008['applications'][_0x7413('0x4b')]({'id':0x0,'priority':_0x4d0008['applications'][_0x7413('0x4c')]+0x1,'app':'close','appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4d0008['account']['Applications']){delete _0x4d0008[_0x7413('0x3e')][_0x7413('0x47')];}if(_0x4d0008[_0x7413('0x3e')][_0x7413('0x40')]){delete _0x4d0008[_0x7413('0x3e')]['List'];}if(_0x5f263e[_0x7413('0x40')][_0x7413('0x4d')][_0x7413('0x4c')]){return _0x5f263e['List'][_0x7413('0x4d')][0x0];}var _0x5c3324=_['defaults'](_0x44af7d[_0x7413('0x35')],{'firstName':_0x44af7d[_0x7413('0x35')][_0x7413('0x37')],'ListId':_0x5f263e[_0x7413('0x34')]});_0x5c3324[_0x44af7d[_0x7413('0x35')][_0x7413('0x3a')]]=_0x44af7d['body'][_0x7413('0x37')];return db['CmContact'][_0x7413('0x4e')](_0x5c3324);}else{throw new Error('List\x20not\x20found');}})[_0x7413('0x13')](function(_0x4d4faa){_0x4d0008[_0x7413('0x4f')]=_0x4d4faa;if(_0x4d4faa){if(!_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x50')]){_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')]=rs['generate']()+'\x20'+_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'];}var _0x3ce34c={'ContactId':_0x4d4faa['id'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'inReplyTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x50')],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x52')],'lastMsgAt':moment()[_0x7413('0x53')](_0x7413('0x54')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x44af7d['account']['id']},'include':[{'model':db['MailMessage'],'as':'Messages','attributes':[_0x7413('0x50')],'where':{'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['inReplyTo']}}]})[_0x7413('0x13')](function(_0xb7dd83){if(_0xb7dd83){return[_0xb7dd83,![]];}return db[_0x7413('0x55')][_0x7413('0x4e')](_0x3ce34c)[_0x7413('0x13')](function(_0x3db284){return[_0x3db284,!![]];});});}else{throw new Error(_0x7413('0x56'));}})[_0x7413('0x57')](function(_0x1ec131,_0x47512d){if(_0x1ec131){_0xa063d1=_0x47512d;if(!_0x47512d){return _0x1ec131[_0x7413('0x58')]({'inReplyTo':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['messageId'],'to':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['from'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x1ec131[_0x7413('0x52')]?_0x1ec131['attach']:_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x7413('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format'](_0x7413('0x54')),'lastMsgDirection':'in'});}else{return _0x1ec131;}}})[_0x7413('0x13')](function(_0x167c6b){_0x4d0008[_0x7413('0x59')]=_0x167c6b[_0x7413('0x45')]({'plain':!![]});_0x4d0008[_0x7413('0x59')][_0x7413('0x5a')]=_0xa063d1;return db[_0x7413('0x5b')]['create']({'body':_0x44af7d[_0x7413('0x35')]['body'],'MailAccountId':_0x44af7d[_0x7413('0x3e')]['id'],'MailInteractionId':_0x167c6b['id'],'direction':'in','ContactId':_0x4d0008[_0x7413('0x4f')]['id'],'messageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x50')],'from':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x37')],'to':_0x44af7d[_0x7413('0x35')]['message']['to'],'cc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['cc'],'subject':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x51')],'attach':_0x44af7d['body'][_0x7413('0x1a')]['attach'],'Attachments':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['attachments'],'originTo':_0x44af7d['body'][_0x7413('0x1a')][_0x7413('0x5c')],'originCc':_0x44af7d[_0x7413('0x35')]['message'][_0x7413('0x5d')],'bcc':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5e')],'ChatWebsiteId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')]['ChatWebsiteId']||null,'originChannel':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x5f')]||'Email','ChatOfflineMessageId':_0x44af7d[_0x7413('0x35')][_0x7413('0x1a')][_0x7413('0x60')]||null},{'include':[{'model':db[_0x7413('0x61')],'as':_0x7413('0x62')}]});})[_0x7413('0x13')](function(_0x46e9f8){_0x4d0008[_0x7413('0x1a')]=_0x46e9f8;if(_0x4d0008[_0x7413('0x59')]['UserId']){return db[_0x7413('0x63')][_0x7413('0x29')]({'attributes':['id',_0x7413('0x64')],'where':{'id':_0x4d0008[_0x7413('0x59')][_0x7413('0x65')]}})[_0x7413('0x13')](function(_0x4c9d1b){if(_0x4c9d1b){_0x4d0008[_0x7413('0x48')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4c9d1b[_0x7413('0x64')]+','+(_0x4d0008[_0x7413('0x3e')]['waitForTheAssignedAgent']||0xa),'interval':_0x7413('0x66')});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);});}return respondWithRpcPromise(_0x7413('0x67'),_0x7413('0x68'),_0x4d0008);})[_0x7413('0x13')](function(_0x2d361c){_0x535e49(_0x2d361c);})[_0x7413('0x1c')](function(_0x5f4765){_0x5dc077(_0x4c1770[_0x7413('0x18')](0x1f4,_0x5f4765['message']));});});};
\ No newline at end of file
index c135778..ca43109 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedc7=['removeListener','length','mailAccount:','./mailAccount.events','save','remove','update'];(function(_0x43e7a3,_0x3754ad){var _0x23938c=function(_0x47163c){while(--_0x47163c){_0x43e7a3['push'](_0x43e7a3['shift']());}};_0x23938c(++_0x3754ad);}(_0xedc7,0x1f4));var _0x7edc=function(_0x584350,_0x2066ba){_0x584350=_0x584350-0x0;var _0x27693d=_0xedc7[_0x584350];return _0x27693d;};'use strict';var MailAccountEvents=require(_0x7edc('0x0'));var events=[_0x7edc('0x1'),_0x7edc('0x2'),_0x7edc('0x3')];function createListener(_0x317892,_0x54761e){return function(_0x4eda26){_0x54761e['emit'](_0x317892,_0x4eda26);};}function removeListener(_0x629890,_0x22f890){return function(){MailAccountEvents[_0x7edc('0x4')](_0x629890,_0x22f890);};}exports['register']=function(_0x428c20){for(var _0x101bff=0x0,_0x2ca1c5=events[_0x7edc('0x5')];_0x101bff<_0x2ca1c5;_0x101bff++){var _0x1572b8=events[_0x101bff];var _0x47217e=createListener(_0x7edc('0x6')+_0x1572b8,_0x428c20);MailAccountEvents['on'](_0x1572b8,_0x47217e);}};
\ No newline at end of file
+var _0x268c=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','emit'];(function(_0x34ae30,_0x18ad5b){var _0x5acef9=function(_0x3029db){while(--_0x3029db){_0x34ae30['push'](_0x34ae30['shift']());}};_0x5acef9(++_0x18ad5b);}(_0x268c,0xb3));var _0xc268=function(_0x2637ac,_0x377857){_0x2637ac=_0x2637ac-0x0;var _0x4a5758=_0x268c[_0x2637ac];return _0x4a5758;};'use strict';var MailAccountEvents=require(_0xc268('0x0'));var events=['save',_0xc268('0x1'),'update'];function createListener(_0x12d634,_0x498234){return function(_0x4f78a7){_0x498234[_0xc268('0x2')](_0x12d634,_0x4f78a7);};}function removeListener(_0x55edc9,_0x19f84f){return function(){MailAccountEvents[_0xc268('0x3')](_0x55edc9,_0x19f84f);};}exports[_0xc268('0x4')]=function(_0x3d0ecf){for(var _0x4e2a03=0x0,_0x4b843c=events[_0xc268('0x5')];_0x4e2a03<_0x4b843c;_0x4e2a03++){var _0x2f7f1b=events[_0x4e2a03];var _0x596f88=createListener(_0xc268('0x6')+_0x2f7f1b,_0x3d0ecf);MailAccountEvents['on'](_0x2f7f1b,_0x596f88);}};
\ No newline at end of file
index 15fadbe..541691d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x023e=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated','put','update','delete','destroy','exports','multer','util'];(function(_0x783b92,_0x1365dd){var _0x25207b=function(_0x5f1154){while(--_0x5f1154){_0x783b92['push'](_0x783b92['shift']());}};_0x25207b(++_0x1365dd);}(_0x023e,0xde));var _0xe023=function(_0x4b9859,_0x264713){_0x4b9859=_0x4b9859-0x0;var _0x504fdb=_0x023e[_0x4b9859];return _0x504fdb;};'use strict';var multer=require(_0xe023('0x0'));var util=require(_0xe023('0x1'));var path=require(_0xe023('0x2'));var timeout=require(_0xe023('0x3'));var express=require(_0xe023('0x4'));var router=express['Router']();var fs_extra=require(_0xe023('0x5'));var auth=require(_0xe023('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe023('0x7'));var controller=require('./mailApplication.controller');router[_0xe023('0x8')](_0xe023('0x9'),auth[_0xe023('0xa')](),controller['show']);router[_0xe023('0xb')](_0xe023('0x9'),auth[_0xe023('0xa')](),controller[_0xe023('0xc')]);router[_0xe023('0xd')]('/:id',auth[_0xe023('0xa')](),controller[_0xe023('0xe')]);module[_0xe023('0xf')]=router;
\ No newline at end of file
+var _0x4dad=['destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','update'];(function(_0x32980e,_0x37b8bb){var _0x5b6678=function(_0x398419){while(--_0x398419){_0x32980e['push'](_0x32980e['shift']());}};_0x5b6678(++_0x37b8bb);}(_0x4dad,0x6a));var _0xd4da=function(_0x4379cc,_0x429396){_0x4379cc=_0x4379cc-0x0;var _0xa2ef35=_0x4dad[_0x4379cc];return _0xa2ef35;};'use strict';var multer=require(_0xd4da('0x0'));var util=require(_0xd4da('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd4da('0x2'));var router=express['Router']();var fs_extra=require(_0xd4da('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xd4da('0x4'));var config=require(_0xd4da('0x5'));var controller=require('./mailApplication.controller');router[_0xd4da('0x6')](_0xd4da('0x7'),auth[_0xd4da('0x8')](),controller[_0xd4da('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xd4da('0xa')]);router['delete'](_0xd4da('0x7'),auth[_0xd4da('0x8')](),controller[_0xd4da('0xb')]);module[_0xd4da('0xc')]=router;
\ No newline at end of file
index a5189ee..9abb725 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd44=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x499f17,_0x47c90a){var _0x584624=function(_0x572b42){while(--_0x572b42){_0x499f17['push'](_0x499f17['shift']());}};_0x584624(++_0x47c90a);}(_0xfd44,0x116));var _0x4fd4=function(_0x31e6dc,_0x59921e){_0x31e6dc=_0x31e6dc-0x0;var _0x4582a8=_0xfd44[_0x31e6dc];return _0x4582a8;};'use strict';var Sequelize=require(_0x4fd4('0x0'));module[_0x4fd4('0x1')]={'priority':{'type':Sequelize[_0x4fd4('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4fd4('0x3')],'allowNull':![],'defaultValue':_0x4fd4('0x4')},'appdata':{'type':Sequelize[_0x4fd4('0x5')]()},'description':{'type':Sequelize[_0x4fd4('0x3')]},'interval':{'type':Sequelize[_0x4fd4('0x3')],'defaultValue':_0x4fd4('0x6')}};
\ No newline at end of file
+var _0xf859=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x10a262,_0x5eade2){var _0xaa5949=function(_0x256407){while(--_0x256407){_0x10a262['push'](_0x10a262['shift']());}};_0xaa5949(++_0x5eade2);}(_0xf859,0x72));var _0x9f85=function(_0x91b71c,_0x395ebb){_0x91b71c=_0x91b71c-0x0;var _0x43ed6b=_0xf859[_0x91b71c];return _0x43ed6b;};'use strict';var Sequelize=require('sequelize');module[_0x9f85('0x0')]={'priority':{'type':Sequelize[_0x9f85('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9f85('0x2')},'appdata':{'type':Sequelize[_0x9f85('0x3')]()},'description':{'type':Sequelize[_0x9f85('0x4')]},'interval':{'type':Sequelize[_0x9f85('0x4')],'defaultValue':_0x9f85('0x5')}};
\ No newline at end of file
index 08a48dc..f3af425 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x4653f7,_0x3d3ae3){_0x4653f7=_0x4653f7-0x0;var _0x5454da=_0xaa88[_0x4653f7];return _0x5454da;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));};
\ No newline at end of file
+var _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x307f23,_0x5df953){var _0x33ffe7=function(_0x4a39bb){while(--_0x4a39bb){_0x307f23['push'](_0x307f23['shift']());}};_0x33ffe7(++_0x5df953);}(_0xda3f,0xec));var _0xfda3=function(_0x2b2bc7,_0x2c3d5c){_0x2b2bc7=_0x2b2bc7-0x0;var _0x94b57d=_0xda3f[_0x2b2bc7];return _0x94b57d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');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('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));};
\ No newline at end of file
index 1bb311f..fda0ed5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd11=['utf8mb4_unicode_ci','api','moment','bluebird','request-promise','path','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x6150cf,_0x36589e){var _0xdb8546=function(_0x9ca9c4){while(--_0x9ca9c4){_0x6150cf['push'](_0x6150cf['shift']());}};_0xdb8546(++_0x36589e);}(_0xdd11,0x1e5));var _0x1dd1=function(_0x261bbf,_0x1f67a9){_0x261bbf=_0x261bbf-0x0;var _0x1b5c66=_0xdd11[_0x261bbf];return _0x1b5c66;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1dd1('0x0'));var moment=require(_0x1dd1('0x1'));var BPromise=require(_0x1dd1('0x2'));var rp=require(_0x1dd1('0x3'));var fs=require('fs');var path=require(_0x1dd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailApplication.attributes');module[_0x1dd1('0x5')]=function(_0x47da75,_0x175416){return _0x47da75[_0x1dd1('0x6')](_0x1dd1('0x7'),attributes,{'tableName':_0x1dd1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1dd1('0x9'),'collate':_0x1dd1('0xa')});};
\ No newline at end of file
+var _0x9dd7=['../../config/environment','./mailApplication.attributes','define','MailApplication','lodash','util','bluebird','request-promise','path','rimraf'];(function(_0x16f368,_0x29228e){var _0x23851f=function(_0x98a727){while(--_0x98a727){_0x16f368['push'](_0x16f368['shift']());}};_0x23851f(++_0x29228e);}(_0x9dd7,0xf4));var _0x79dd=function(_0x42e513,_0x2e5568){_0x42e513=_0x42e513-0x0;var _0x2e985b=_0x9dd7[_0x42e513];return _0x2e985b;};'use strict';var _=require(_0x79dd('0x0'));var util=require(_0x79dd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x79dd('0x2'));var rp=require(_0x79dd('0x3'));var fs=require('fs');var path=require(_0x79dd('0x4'));var rimraf=require(_0x79dd('0x5'));var config=require(_0x79dd('0x6'));var attributes=require(_0x79dd('0x7'));module['exports']=function(_0x420457,_0x137626){return _0x420457[_0x79dd('0x8')](_0x79dd('0x9'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index e153dbc..f4639a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5320=['raw','where','attributes','limit','debug','lodash','util','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','update','options'];(function(_0x377fa2,_0x56e9ca){var _0x3af96b=function(_0x2eda83){while(--_0x2eda83){_0x377fa2['push'](_0x377fa2['shift']());}};_0x3af96b(++_0x56e9ca);}(_0x5320,0x18d));var _0x0532=function(_0x335277,_0xd09de1){_0x335277=_0x335277-0x0;var _0x3460ea=_0x5320[_0x335277];return _0x3460ea;};'use strict';var _=require(_0x0532('0x0'));var util=require(_0x0532('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0532('0x2'));var fs=require('fs');var Redis=require(_0x0532('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0532('0x4'))(_0x0532('0x5'));var config=require('../../config/environment');var jayson=require(_0x0532('0x6'));var client=jayson[_0x0532('0x7')][_0x0532('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cafbe,_0x40b0a7,_0x409480){return new BPromise(function(_0x2123eb,_0x6e97dd){return client['request'](_0x5cafbe,_0x409480)[_0x0532('0x9')](function(_0x4a1c38){logger[_0x0532('0xa')](_0x0532('0xb'),_0x40b0a7,_0x0532('0xc'));logger['debug'](_0x0532('0xd'),_0x40b0a7,'request\x20sent',JSON[_0x0532('0xe')](_0x4a1c38));if(_0x4a1c38[_0x0532('0xf')]){if(_0x4a1c38[_0x0532('0xf')][_0x0532('0x10')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x40b0a7,_0x4a1c38[_0x0532('0xf')][_0x0532('0x11')]);return _0x6e97dd(_0x4a1c38[_0x0532('0xf')][_0x0532('0x11')]);}logger[_0x0532('0xf')](_0x0532('0xb'),_0x40b0a7,_0x4a1c38[_0x0532('0xf')][_0x0532('0x11')]);return _0x2123eb(_0x4a1c38[_0x0532('0xf')][_0x0532('0x11')]);}else{logger['info'](_0x0532('0xb'),_0x40b0a7,_0x0532('0xc'));_0x2123eb(_0x4a1c38[_0x0532('0x12')]['message']);}})[_0x0532('0x13')](function(_0x412dc6){logger[_0x0532('0xf')](_0x0532('0xb'),_0x40b0a7,_0x412dc6);_0x6e97dd(_0x412dc6);});});}exports[_0x0532('0x14')]=function(_0x20cf3e){var _0x1887ef=this;return new Promise(function(_0x41bd46,_0x2a1052){return db['MailApplication'][_0x0532('0x15')](_0x20cf3e['body'],{'raw':_0x20cf3e['options']?_0x20cf3e[_0x0532('0x16')][_0x0532('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20cf3e[_0x0532('0x16')]?_0x20cf3e[_0x0532('0x16')][_0x0532('0x18')]||null:null,'attributes':_0x20cf3e[_0x0532('0x16')]?_0x20cf3e['options'][_0x0532('0x19')]||null:null,'limit':_0x20cf3e[_0x0532('0x16')]?_0x20cf3e[_0x0532('0x16')][_0x0532('0x1a')]||null:null})[_0x0532('0x9')](function(_0x39bcdf){logger[_0x0532('0xa')](_0x0532('0x14'),_0x20cf3e);logger[_0x0532('0x1b')](_0x0532('0x14'),_0x20cf3e,JSON['stringify'](_0x39bcdf));_0x41bd46(_0x39bcdf);})[_0x0532('0x13')](function(_0x2860b2){logger[_0x0532('0xf')](_0x0532('0x14'),_0x2860b2['message'],_0x20cf3e);_0x2a1052(_0x1887ef[_0x0532('0xf')](0x1f4,_0x2860b2[_0x0532('0x11')]));});});};
\ No newline at end of file
+var _0xe33a=['code','message','result','update','options','raw','where','attributes','limit','UpdateMailApplication','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','MailApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x53181d,_0x46d5b5){var _0x3722e=function(_0x1ec604){while(--_0x1ec604){_0x53181d['push'](_0x53181d['shift']());}};_0x3722e(++_0x46d5b5);}(_0xe33a,0x1e6));var _0xae33=function(_0x5ab038,_0x189eec){_0x5ab038=_0x5ab038-0x0;var _0x4f42a3=_0xe33a[_0x5ab038];return _0x4f42a3;};'use strict';var _=require(_0xae33('0x0'));var util=require(_0xae33('0x1'));var moment=require(_0xae33('0x2'));var BPromise=require(_0xae33('0x3'));var rs=require(_0xae33('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae33('0x5'))['db'];var utils=require(_0xae33('0x6'));var logger=require('../../config/logger')(_0xae33('0x7'));var config=require('../../config/environment');var jayson=require(_0xae33('0x8'));var client=jayson[_0xae33('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41417c,_0x2a73b7,_0x31e931){return new BPromise(function(_0x21da3e,_0x1ff21a){return client[_0xae33('0xa')](_0x41417c,_0x31e931)[_0xae33('0xb')](function(_0x26b407){logger[_0xae33('0xc')](_0xae33('0xd'),_0x2a73b7,'request\x20sent');logger[_0xae33('0xe')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x2a73b7,_0xae33('0xf'),JSON[_0xae33('0x10')](_0x26b407));if(_0x26b407[_0xae33('0x11')]){if(_0x26b407[_0xae33('0x11')][_0xae33('0x12')]===0x1f4){logger[_0xae33('0x11')](_0xae33('0xd'),_0x2a73b7,_0x26b407[_0xae33('0x11')]['message']);return _0x1ff21a(_0x26b407['error'][_0xae33('0x13')]);}logger[_0xae33('0x11')](_0xae33('0xd'),_0x2a73b7,_0x26b407[_0xae33('0x11')][_0xae33('0x13')]);return _0x21da3e(_0x26b407[_0xae33('0x11')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x2a73b7,_0xae33('0xf'));_0x21da3e(_0x26b407[_0xae33('0x14')][_0xae33('0x13')]);}})['catch'](function(_0x43e5c0){logger[_0xae33('0x11')](_0xae33('0xd'),_0x2a73b7,_0x43e5c0);_0x1ff21a(_0x43e5c0);});});}exports['UpdateMailApplication']=function(_0x24aaa2){var _0x5c57b1=this;return new Promise(function(_0x123dd4,_0xaf82d7){return db['MailApplication'][_0xae33('0x15')](_0x24aaa2['body'],{'raw':_0x24aaa2[_0xae33('0x16')]?_0x24aaa2[_0xae33('0x16')][_0xae33('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24aaa2[_0xae33('0x16')]?_0x24aaa2[_0xae33('0x16')][_0xae33('0x18')]||null:null,'attributes':_0x24aaa2[_0xae33('0x16')]?_0x24aaa2[_0xae33('0x16')][_0xae33('0x19')]||null:null,'limit':_0x24aaa2['options']?_0x24aaa2[_0xae33('0x16')][_0xae33('0x1a')]||null:null})[_0xae33('0xb')](function(_0x194410){logger[_0xae33('0xc')]('UpdateMailApplication',_0x24aaa2);logger[_0xae33('0xe')]('UpdateMailApplication',_0x24aaa2,JSON[_0xae33('0x10')](_0x194410));_0x123dd4(_0x194410);})['catch'](function(_0x340b00){logger[_0xae33('0x11')](_0xae33('0x1b'),_0x340b00[_0xae33('0x13')],_0x24aaa2);_0xaf82d7(_0x5c57b1[_0xae33('0x11')](0x1f4,_0x340b00['message']));});});};
\ No newline at end of file
index 51d2443..f6302f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b96=['download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','tracked','mailinteraction:update','mailinteraction:destroy','destroy','delete','exports','express','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download'];(function(_0x58c9d4,_0x48dcfe){var _0x2113b7=function(_0x445ae8){while(--_0x445ae8){_0x58c9d4['push'](_0x58c9d4['shift']());}};_0x2113b7(++_0x48dcfe);}(_0x1b96,0x1e8));var _0x61b9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1b96[_0x3b380d];return _0x54502b;};'use strict';var express=require(_0x61b9('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x61b9('0x1'));var controller=require(_0x61b9('0x2'));router[_0x61b9('0x3')]('/',auth[_0x61b9('0x4')](),controller['index']);router[_0x61b9('0x3')](_0x61b9('0x5'),auth['isAuthenticated'](),controller[_0x61b9('0x6')]);router[_0x61b9('0x3')](_0x61b9('0x7'),auth[_0x61b9('0x4')](),controller[_0x61b9('0x8')]);router[_0x61b9('0x3')](_0x61b9('0x9'),auth[_0x61b9('0x4')](),controller[_0x61b9('0xa')]);router[_0x61b9('0x3')](_0x61b9('0xb'),auth[_0x61b9('0x4')](),controller[_0x61b9('0xc')]);router[_0x61b9('0xd')]('/',auth[_0x61b9('0x4')](),controller[_0x61b9('0xe')]);router[_0x61b9('0xd')]('/:id/messages',auth[_0x61b9('0x4')](),controller[_0x61b9('0xf')]);router[_0x61b9('0xd')](_0x61b9('0x10'),auth[_0x61b9('0x4')](),interaction['tracked'](_0x61b9('0x11'),_0x61b9('0x12')),controller['addTags']);router['put'](_0x61b9('0x7'),auth['isAuthenticated'](),interaction[_0x61b9('0x13')]('mail',_0x61b9('0x14')),controller['update']);router['delete']('/:id',auth[_0x61b9('0x4')](),interaction['tracked'](_0x61b9('0x11'),_0x61b9('0x15')),controller[_0x61b9('0x16')]);router[_0x61b9('0x17')](_0x61b9('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0x61b9('0x18')]=router;
\ No newline at end of file
+var _0xcc0e=['/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x55b569,_0x2dc805){var _0x5da38d=function(_0x244cfe){while(--_0x244cfe){_0x55b569['push'](_0x55b569['shift']());}};_0x5da38d(++_0x2dc805);}(_0xcc0e,0x149));var _0xecc0=function(_0x25ee0e,_0x5b8c73){_0x25ee0e=_0x25ee0e-0x0;var _0x40730a=_0xcc0e[_0x25ee0e];return _0x40730a;};'use strict';var express=require(_0xecc0('0x0'));var router=express[_0xecc0('0x1')]();var auth=require(_0xecc0('0x2'));var interaction=require(_0xecc0('0x3'));var controller=require('./mailInteraction.controller');router[_0xecc0('0x4')]('/',auth[_0xecc0('0x5')](),controller[_0xecc0('0x6')]);router[_0xecc0('0x4')](_0xecc0('0x7'),auth[_0xecc0('0x5')](),controller[_0xecc0('0x8')]);router[_0xecc0('0x4')](_0xecc0('0x9'),auth[_0xecc0('0x5')](),controller[_0xecc0('0xa')]);router[_0xecc0('0x4')](_0xecc0('0xb'),auth['isAuthenticated'](),controller[_0xecc0('0xc')]);router[_0xecc0('0x4')](_0xecc0('0xd'),auth[_0xecc0('0x5')](),controller[_0xecc0('0xe')]);router[_0xecc0('0xf')]('/',auth[_0xecc0('0x5')](),controller[_0xecc0('0x10')]);router[_0xecc0('0xf')](_0xecc0('0xb'),auth[_0xecc0('0x5')](),controller[_0xecc0('0x11')]);router[_0xecc0('0xf')](_0xecc0('0x12'),auth['isAuthenticated'](),interaction[_0xecc0('0x13')](_0xecc0('0x14'),_0xecc0('0x15')),controller[_0xecc0('0x16')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0xecc0('0x14'),'mailinteraction:update'),controller['update']);router[_0xecc0('0x17')](_0xecc0('0x9'),auth[_0xecc0('0x5')](),interaction[_0xecc0('0x13')](_0xecc0('0x14'),_0xecc0('0x18')),controller[_0xecc0('0x19')]);router[_0xecc0('0x17')]('/:id/tags',auth[_0xecc0('0x5')](),controller[_0xecc0('0x1a')]);module[_0xecc0('0x1b')]=router;
\ No newline at end of file
index 6c4ca0a..c36ce76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2760=['STRING','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0xf61586,_0x56b0c4){var _0x2b6eb3=function(_0x47e12b){while(--_0x47e12b){_0xf61586['push'](_0xf61586['shift']());}};_0x2b6eb3(++_0x56b0c4);}(_0x2760,0xa3));var _0x0276=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x2760[_0x1f27df];return _0x286ee2;};'use strict';var Sequelize=require(_0x0276('0x0'));var iconv=require(_0x0276('0x1'));module[_0x0276('0x2')]={'closed':{'type':Sequelize[_0x0276('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0276('0x4')]},'disposition':{'type':Sequelize[_0x0276('0x5')]},'secondDisposition':{'type':Sequelize[_0x0276('0x5')]},'thirdDisposition':{'type':Sequelize[_0x0276('0x5')]},'note':{'type':Sequelize[_0x0276('0x5')]},'inReplyTo':{'type':Sequelize[_0x0276('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x0276('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0276('0x4')]},'substatus':{'type':Sequelize[_0x0276('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x0276('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0276('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x0276('0x6')]('in',_0x0276('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x0238=['TEXT','DATE','ENUM','out','sequelize','iconv','exports','BOOLEAN','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x0238,0x1cf));var _0x8023=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x0238[_0x486f4a];return _0x135d99;};'use strict';var Sequelize=require(_0x8023('0x0'));var iconv=require(_0x8023('0x1'));module[_0x8023('0x2')]={'closed':{'type':Sequelize[_0x8023('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8023('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x8023('0x4')](0x1fe)},'to':{'type':Sequelize[_0x8023('0x4')]},'cc':{'type':Sequelize[_0x8023('0x5')]('long')},'subject':{'type':Sequelize[_0x8023('0x5')]()},'attach':{'type':Sequelize[_0x8023('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8023('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x8023('0x6')]},'firstMsgDirection':{'type':Sequelize[_0x8023('0x7')]('in',_0x8023('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8023('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8023('0x3')],'defaultValue':![]}};
\ No newline at end of file
index e1db5cd..836783b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0385=['path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','getOptions','mail','query','show','model','keys','MailInteraction','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','create','body','update','params','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','$gte','format','findAll','inlineCss','true','rows','addTags','setTags','spread','Tag','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','push','Attachment','bcc','subject','createdAt','Messages','mkdirSync','each','from','decode','headers','Attachments','basename','type','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','moment','bluebird'];(function(_0x1ff6c0,_0x1ee884){var _0x306e02=function(_0x382dd3){while(--_0x382dd3){_0x1ff6c0['push'](_0x1ff6c0['shift']());}};_0x306e02(++_0x1ee884);}(_0x0385,0x1c1));var _0x5038=function(_0x333aae,_0x440da3){_0x333aae=_0x333aae-0x0;var _0x256ac7=_0x0385[_0x333aae];return _0x256ac7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5038('0x0'));var zipdir=require('zip-dir');var moment=require(_0x5038('0x1'));var BPromise=require(_0x5038('0x2'));var util=require('util');var path=require(_0x5038('0x3'));var fs=require('fs');var _=require(_0x5038('0x4'));var juice=require('juice');var Redis=require(_0x5038('0x5'));var interaction=require(_0x5038('0x6'));var qs=require(_0x5038('0x7'));var logger=require(_0x5038('0x8'))(_0x5038('0x9'));var config=require(_0x5038('0xa'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x5038('0xb'));config[_0x5038('0xc')]=_['defaults'](config[_0x5038('0xc')],{'host':_0x5038('0xd'),'port':0x18eb});var socket=require(_0x5038('0xe'))(new Redis(config[_0x5038('0xc')]));require(_0x5038('0xf'))[_0x5038('0x10')](socket);function respondWithStatusCode(_0x1dcfba,_0xf429d4){_0xf429d4=_0xf429d4||0xcc;return function(_0x4bd0ca){if(_0x4bd0ca){return _0x1dcfba[_0x5038('0x11')](_0xf429d4);}return _0x1dcfba[_0x5038('0x12')](_0xf429d4)[_0x5038('0x13')]();};}function respondWithResult(_0x250f9e,_0x7da28b){_0x7da28b=_0x7da28b||0xc8;return function(_0x40f2e2){if(_0x40f2e2){return _0x250f9e[_0x5038('0x12')](_0x7da28b)[_0x5038('0x14')](_0x40f2e2);}};}function respondWithFilteredResult(_0x3260c8,_0xb0bed6){return function(_0x384d39){if(_0x384d39){var _0x304d55=typeof _0xb0bed6[_0x5038('0x15')]===_0x5038('0x16')&&typeof _0xb0bed6[_0x5038('0x17')]==='undefined';var _0x20f3eb=_0x384d39['count'];var _0x22cc0f=_0x304d55?0x0:_0xb0bed6[_0x5038('0x15')];var _0x7348e2=_0x304d55?_0x384d39[_0x5038('0x18')]:_0xb0bed6[_0x5038('0x15')]+_0xb0bed6['limit'];var _0x1c6bb0;if(_0x7348e2>=_0x20f3eb){_0x7348e2=_0x20f3eb;_0x1c6bb0=0xc8;}else{_0x1c6bb0=0xce;}_0x3260c8[_0x5038('0x12')](_0x1c6bb0);return _0x3260c8[_0x5038('0x19')](_0x5038('0x1a'),_0x22cc0f+'-'+_0x7348e2+'/'+_0x20f3eb)[_0x5038('0x14')](_0x384d39);}return null;};}function saveUpdates(_0x5129a6){return function(_0x21bc02){if(_0x21bc02){return _0x21bc02['update'](_0x5129a6)[_0x5038('0x1b')](function(_0xaebc6f){return _0xaebc6f;});}return null;};}function removeEntity(_0xca06d5){return function(_0x32bddd){if(_0x32bddd){return _0x32bddd[_0x5038('0x1c')]()[_0x5038('0x1b')](function(){_0xca06d5[_0x5038('0x12')](0xcc)[_0x5038('0x13')]();});}};}function handleEntityNotFound(_0x7f76b4){return function(_0x4b58da){if(!_0x4b58da){_0x7f76b4[_0x5038('0x11')](0x194);}return _0x4b58da;};}function handleError(_0x27cc9e,_0x5e270f){_0x5e270f=_0x5e270f||0x1f4;return function(_0x54f83c){logger[_0x5038('0x1d')](_0x54f83c[_0x5038('0x1e')]);if(_0x54f83c[_0x5038('0x1f')]){delete _0x54f83c[_0x5038('0x1f')];}_0x27cc9e[_0x5038('0x12')](_0x5e270f)[_0x5038('0x20')](_0x54f83c);};}exports['index']=function(_0x3f950d,_0x4de90e){var _0x14a97c={};var _0x2c45ea=_[_0x5038('0x21')](db['MailInteraction'][_0x5038('0x22')],function(_0x18d551){return{'name':_0x18d551[_0x5038('0x23')],'type':_0x18d551['type'][_0x5038('0x24')]};});_0x14a97c=qs[_0x5038('0x25')](_0x2c45ea,_0x3f950d);return interaction['findAll'](_0x5038('0x26'),_0x3f950d[_0x5038('0x27')],_0x3f950d['user'],_0x14a97c,_0x2c45ea)[_0x5038('0x1b')](respondWithFilteredResult(_0x4de90e,_0x14a97c))['catch'](handleError(_0x4de90e,null));};exports[_0x5038('0x28')]=function(_0x8d42bc,_0x30a70a){var _0x4e92bf={'raw':![],'where':{'id':_0x8d42bc['params']['id']}},_0x5d8b4d={};_0x5d8b4d[_0x5038('0x29')]=_[_0x5038('0x2a')](db[_0x5038('0x2b')][_0x5038('0x22')]);_0x5d8b4d[_0x5038('0x27')]=_['keys'](_0x8d42bc[_0x5038('0x27')]);_0x5d8b4d[_0x5038('0x2c')]=_[_0x5038('0x2d')](_0x5d8b4d[_0x5038('0x29')],_0x5d8b4d['query']);_0x4e92bf[_0x5038('0x2e')]=_[_0x5038('0x2d')](_0x5d8b4d[_0x5038('0x29')],qs['fields'](_0x8d42bc[_0x5038('0x27')]['fields']));_0x4e92bf[_0x5038('0x2e')]=_0x4e92bf[_0x5038('0x2e')][_0x5038('0x2f')]?_0x4e92bf[_0x5038('0x2e')]:_0x5d8b4d['model'];if(_0x8d42bc[_0x5038('0x27')][_0x5038('0x30')]){_0x4e92bf[_0x5038('0x31')]=[{'all':!![]}];}_0x4e92bf=_[_0x5038('0x32')]({},_0x4e92bf,_0x8d42bc[_0x5038('0x33')]);return db[_0x5038('0x2b')][_0x5038('0x34')](_0x4e92bf)[_0x5038('0x1b')](handleEntityNotFound(_0x30a70a,null))[_0x5038('0x1b')](respondWithResult(_0x30a70a,null))[_0x5038('0x35')](handleError(_0x30a70a,null));};exports['create']=function(_0x5c5f46,_0x1cf5ee){return db[_0x5038('0x2b')][_0x5038('0x36')](_0x5c5f46[_0x5038('0x37')],{})[_0x5038('0x1b')](respondWithResult(_0x1cf5ee,0xc9))[_0x5038('0x35')](handleError(_0x1cf5ee,null));};exports[_0x5038('0x38')]=function(_0x3efb0a,_0x30adc0){if(_0x3efb0a[_0x5038('0x37')]['id']){delete _0x3efb0a['body']['id'];}return db[_0x5038('0x2b')][_0x5038('0x34')]({'where':{'id':_0x3efb0a[_0x5038('0x39')]['id']}})['then'](handleEntityNotFound(_0x30adc0,null))[_0x5038('0x1b')](saveUpdates(_0x3efb0a[_0x5038('0x37')],null))['then'](respondWithResult(_0x30adc0,null))[_0x5038('0x35')](handleError(_0x30adc0,null));};exports[_0x5038('0x1c')]=function(_0x25f604,_0x58bc6f){return db[_0x5038('0x2b')]['find']({'where':{'id':_0x25f604[_0x5038('0x39')]['id']}})[_0x5038('0x1b')](handleEntityNotFound(_0x58bc6f,null))[_0x5038('0x1b')](removeEntity(_0x58bc6f,null))[_0x5038('0x35')](handleError(_0x58bc6f,null));};exports[_0x5038('0x3a')]=function(_0x4b16d1,_0x5c25b4){return db[_0x5038('0x2b')]['describe']()[_0x5038('0x1b')](respondWithResult(_0x5c25b4,null))[_0x5038('0x35')](handleError(_0x5c25b4,null));};exports[_0x5038('0x3b')]=function(_0x59a73e,_0x5ceb15){return db[_0x5038('0x3c')][_0x5038('0x34')]({'where':{'id':_0x59a73e['params']['id']}})[_0x5038('0x1b')](handleEntityNotFound(_0x5ceb15,null))[_0x5038('0x1b')](function(_0x100e6e){if(_0x100e6e){return _0x100e6e['addMessage'](_0x59a73e[_0x5038('0x37')][_0x5038('0x3d')],_[_0x5038('0x3e')](_0x59a73e['body'],[_0x5038('0x3d'),'id'])||{});}})[_0x5038('0x1b')](respondWithResult(_0x5ceb15,null))[_0x5038('0x35')](handleError(_0x5ceb15,null));};exports[_0x5038('0x3f')]=function(_0x1151f4,_0x3b4273){var _0x22d559={'raw':![],'where':{}};var _0x190e3e={};var _0x46a8d5={'count':0x0,'rows':[]};return db[_0x5038('0x2b')][_0x5038('0x40')]({'where':{'id':_0x1151f4['params']['id']}})[_0x5038('0x1b')](handleEntityNotFound(_0x3b4273,null))[_0x5038('0x1b')](function(_0x59859d){if(_0x59859d){_0x190e3e[_0x5038('0x29')]=_[_0x5038('0x2a')](db[_0x5038('0x3c')][_0x5038('0x22')]);_0x190e3e[_0x5038('0x27')]=_[_0x5038('0x2a')](_0x1151f4[_0x5038('0x27')]);_0x190e3e[_0x5038('0x2c')]=_[_0x5038('0x2d')](_0x190e3e[_0x5038('0x29')],_0x190e3e['query']);_0x22d559[_0x5038('0x2e')]=_['intersection'](_0x190e3e[_0x5038('0x29')],qs[_0x5038('0x41')](_0x1151f4[_0x5038('0x27')][_0x5038('0x41')]));_0x22d559[_0x5038('0x2e')]=_0x22d559[_0x5038('0x2e')][_0x5038('0x2f')]?_0x22d559[_0x5038('0x2e')]:_0x190e3e[_0x5038('0x29')];if(!_0x1151f4[_0x5038('0x27')][_0x5038('0x42')](_0x5038('0x43'))){_0x22d559['limit']=qs[_0x5038('0x17')](_0x1151f4[_0x5038('0x27')]['limit']);_0x22d559[_0x5038('0x15')]=qs['offset'](_0x1151f4[_0x5038('0x27')][_0x5038('0x15')]);}_0x22d559[_0x5038('0x44')]=qs[_0x5038('0x45')](_0x1151f4[_0x5038('0x27')][_0x5038('0x45')]);_0x22d559[_0x5038('0x46')]=qs['filters'](_[_0x5038('0x47')](_0x1151f4[_0x5038('0x27')],_0x190e3e[_0x5038('0x2c')]));_0x22d559[_0x5038('0x46')]['MailInteractionId']=_0x59859d['id'];if(_0x1151f4[_0x5038('0x27')][_0x5038('0x48')]){_0x22d559[_0x5038('0x46')]=_[_0x5038('0x32')](_0x22d559[_0x5038('0x46')],{'$or':_['map'](_0x22d559[_0x5038('0x2e')],function(_0x170686){var _0x6e0978={};_0x6e0978[_0x170686]={'$like':'%'+_0x1151f4[_0x5038('0x27')][_0x5038('0x48')]+'%'};return _0x6e0978;})});}if(_0x1151f4[_0x5038('0x27')][_0x5038('0x49')]){var _0x3ab7f9=_0x1151f4['query']['$gte']['split'](',');var _0x173ae5={};_0x173ae5[_0x3ab7f9[0x0]]={'$gte':moment(_0x3ab7f9[0x1])[_0x5038('0x4a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x22d559['where']=_['merge'](_0x22d559['where'],_0x173ae5);}_0x22d559=_[_0x5038('0x32')]({},_0x22d559,_0x1151f4[_0x5038('0x33')]);return db[_0x5038('0x3c')][_0x5038('0x18')]({'where':_0x22d559[_0x5038('0x46')]})[_0x5038('0x1b')](function(_0x44656c){_0x46a8d5[_0x5038('0x18')]=_0x44656c;if(_0x1151f4['query'][_0x5038('0x30')]){_0x22d559[_0x5038('0x31')]=[{'all':!![]}];}return db[_0x5038('0x3c')][_0x5038('0x4b')](_0x22d559);})['then'](function(_0x33f1a7){if(_0x1151f4[_0x5038('0x27')][_0x5038('0x4c')]===_0x5038('0x4d')){for(var _0x3c6830=0x0;_0x3c6830<_0x33f1a7['length'];_0x3c6830++){_0x33f1a7[_0x3c6830][_0x5038('0x37')]=juice(_0x33f1a7[_0x3c6830][_0x5038('0x37')]);}}_0x46a8d5[_0x5038('0x4e')]=_0x33f1a7;return _0x46a8d5;});}})[_0x5038('0x1b')](respondWithFilteredResult(_0x3b4273,_0x22d559))['catch'](handleError(_0x3b4273,null));};exports[_0x5038('0x4f')]=function(_0x2b931d,_0x435853){return db['MailInteraction'][_0x5038('0x34')]({'where':{'id':_0x2b931d[_0x5038('0x39')]['id']}})['then'](handleEntityNotFound(_0x435853,null))[_0x5038('0x1b')](function(_0x4c9123){if(_0x4c9123){return _0x4c9123[_0x5038('0x50')](_0x2b931d[_0x5038('0x37')][_0x5038('0x3d')],_['omit'](_0x2b931d[_0x5038('0x37')],[_0x5038('0x3d'),'id'])||{})[_0x5038('0x51')](function(){return db[_0x5038('0x52')][_0x5038('0x4b')]({'attributes':['id',_0x5038('0x1f'),'color'],'where':{'id':_0x2b931d[_0x5038('0x37')][_0x5038('0x3d')]}});})['then'](function(_0x53c2ef){socket['emit'](_0x5038('0x53'),{'id':Number(_0x2b931d[_0x5038('0x39')]['id']),'tags':_0x53c2ef||[]});return{'id':Number(_0x2b931d[_0x5038('0x39')]['id']),'tags':_0x53c2ef||[]};});}})[_0x5038('0x1b')](respondWithResult(_0x435853,null))['catch'](handleError(_0x435853,null));};exports[_0x5038('0x54')]=function(_0x547547,_0xe5c639){return db[_0x5038('0x2b')][_0x5038('0x34')]({'where':{'id':_0x547547['params']['id']}})[_0x5038('0x1b')](handleEntityNotFound(_0xe5c639,null))['then'](function(_0x10d877){if(_0x10d877){return _0x10d877['removeTags'](_0x547547['query'][_0x5038('0x3d')]);}})[_0x5038('0x1b')](respondWithStatusCode(_0xe5c639,null))['catch'](handleError(_0xe5c639,null));};exports[_0x5038('0x55')]=function(_0x2b542d,_0x539a57){var _0x355098=moment()[_0x5038('0x56')]()['toString']();var _0x517e4a=path[_0x5038('0x57')](config[_0x5038('0x58')],'server',_0x5038('0x59'),_0x5038('0x5a'));var _0x4cc2e5=path[_0x5038('0x57')](config['root'],_0x5038('0x5b'),_0x5038('0x59'),_0x5038('0x5c'));var _0x35ec34=path['join'](_0x517e4a,_0x355098);var _0x4d6df6=util['format'](_0x5038('0x5d'),_0x2b542d[_0x5038('0x39')]['id'],_0x355098);var _0x313041=path[_0x5038('0x57')](_0x517e4a,_0x4d6df6);var _0x4e22cd=[];if(_0x2b542d['query'][_0x5038('0x5c')]){_0x4e22cd[_0x5038('0x5e')]({'model':db[_0x5038('0x5f')],'as':'Attachments','raw':!![]});}var _0x3473e1=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x5038('0x37'),'from','to','cc',_0x5038('0x60'),_0x5038('0x61'),_0x5038('0x62')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x4e22cd}];return db[_0x5038('0x2b')][_0x5038('0x34')]({'where':{'id':_0x2b542d[_0x5038('0x39')]['id']},'include':_0x3473e1})[_0x5038('0x1b')](handleEntityNotFound(_0x539a57,null))[_0x5038('0x1b')](function(_0x56b49e){if(_0x56b49e&&_0x56b49e[_0x5038('0x63')]){var _0x322f01=_0x56b49e['get']({'plain':!![]});fs[_0x5038('0x64')](_0x35ec34);return BPromise[_0x5038('0x65')](_0x322f01['Messages'],function(_0x293a61,_0x5b0b09){var _0x273981={'from':_0x293a61[_0x5038('0x66')],'to':_0x293a61['to']||'missing.recipient@your.company.com','subject':_0x293a61[_0x5038('0x61')],'html':htmlEntities[_0x5038('0x67')](_0x293a61['body']),'headers':{'Date':moment(_0x293a61['createdAt'])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x293a61['cc']){_0x273981[_0x5038('0x68')]['Cc']=_0x293a61['cc'];}if(_0x293a61[_0x5038('0x60')]){_0x273981[_0x5038('0x68')]['Bcc']=_0x293a61[_0x5038('0x60')];}return new BPromise(function(_0x2d0fe6,_0x32c7be){if(_0x293a61[_0x5038('0x69')]){for(var _0x4ce71b=0x0;_0x4ce71b<_0x293a61[_0x5038('0x69')][_0x5038('0x2f')];_0x4ce71b++){var _0x2d218f=_0x293a61[_0x5038('0x69')][_0x4ce71b];var _0x43ac63=path[_0x5038('0x57')](_0x4cc2e5,_0x2d218f[_0x5038('0x6a')]);if(fs['existsSync'](_0x43ac63)){_0x273981[_0x5038('0x5c')][_0x5038('0x5e')]({'name':_0x2d218f[_0x5038('0x1f')],'contentType':_0x2d218f[_0x5038('0x6b')],'data':fs[_0x5038('0x6c')](_0x43ac63)});}}}emlformat[_0x5038('0x6d')](_0x273981,function(_0x3da665,_0x57c37f){if(_0x3da665)return _0x32c7be(_0x3da665);fs[_0x5038('0x6e')](path[_0x5038('0x57')](_0x35ec34,util[_0x5038('0x4a')](_0x5038('0x6f'),_0x5b0b09)),_0x57c37f);return _0x2d0fe6(_0x57c37f);});});})[_0x5038('0x1b')](function(){return new BPromise(function(_0x40bc2f,_0x253ecb){zipdir(_0x35ec34,{'saveTo':_0x313041},function(_0xbf7c0,_0x554fed){if(_0xbf7c0)return _0x253ecb(_0xbf7c0);return _0x40bc2f(_0x554fed);});})[_0x5038('0x1b')](function(){return new BPromise(function(_0x124939,_0x4951c3){rimraf(_0x35ec34,function(_0x54d53a){if(_0x54d53a)_0x4951c3(_0x54d53a);return _0x124939();});});})[_0x5038('0x1b')](function(){return _0x539a57[_0x5038('0x55')](_0x313041,_0x4d6df6,function(_0xbe1f55){if(!_0xbe1f55)fs[_0x5038('0x70')](_0x313041);});});});}else{return _0x539a57['sendStatus'](0xc8);}})[_0x5038('0x35')](handleError(_0x539a57,null));};
\ No newline at end of file
+var _0x02de=['mkdirSync','each','from','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','basename','existsSync','push','type','readFileSync','build','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','html-entities','redis','localhost','socket.io-emitter','./mailInteraction.socket','end','status','json','offset','undefined','limit','count','Content-Range','update','then','sendStatus','error','send','index','map','MailInteraction','rawAttributes','key','getOptions','findAll','mail','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','destroy','describe','addMessage','MailMessage','ids','omit','findOne','order','sort','where','pick','filter','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','rows','addTags','spread','Tag','name','removeTags','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x02de,0xe9));var _0xe02d=function(_0x398998,_0x3af078){_0x398998=_0x398998-0x0;var _0x3c6bc2=_0x02de[_0x398998];return _0x3c6bc2;};'use strict';var emlformat=require(_0xe02d('0x0'));var rimraf=require(_0xe02d('0x1'));var zipdir=require(_0xe02d('0x2'));var moment=require('moment');var BPromise=require(_0xe02d('0x3'));var util=require(_0xe02d('0x4'));var path=require(_0xe02d('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0xe02d('0x6'));var Redis=require(_0xe02d('0x7'));var interaction=require(_0xe02d('0x8'));var qs=require(_0xe02d('0x9'));var logger=require(_0xe02d('0xa'))(_0xe02d('0xb'));var config=require('../../config/environment');var db=require(_0xe02d('0xc'))['db'];var htmlEntities=require(_0xe02d('0xd'));config[_0xe02d('0xe')]=_['defaults'](config[_0xe02d('0xe')],{'host':_0xe02d('0xf'),'port':0x18eb});var socket=require(_0xe02d('0x10'))(new Redis(config['redis']));require(_0xe02d('0x11'))['register'](socket);function respondWithStatusCode(_0x2aa32d,_0x14ecd2){_0x14ecd2=_0x14ecd2||0xcc;return function(_0x526467){if(_0x526467){return _0x2aa32d['sendStatus'](_0x14ecd2);}return _0x2aa32d['status'](_0x14ecd2)[_0xe02d('0x12')]();};}function respondWithResult(_0x1eb503,_0x26722f){_0x26722f=_0x26722f||0xc8;return function(_0x3605fc){if(_0x3605fc){return _0x1eb503[_0xe02d('0x13')](_0x26722f)[_0xe02d('0x14')](_0x3605fc);}};}function respondWithFilteredResult(_0x271060,_0x4b5c57){return function(_0x15c1e3){if(_0x15c1e3){var _0x447d3a=typeof _0x4b5c57[_0xe02d('0x15')]===_0xe02d('0x16')&&typeof _0x4b5c57[_0xe02d('0x17')]===_0xe02d('0x16');var _0x8cfd2=_0x15c1e3[_0xe02d('0x18')];var _0x36034e=_0x447d3a?0x0:_0x4b5c57[_0xe02d('0x15')];var _0x44a33a=_0x447d3a?_0x15c1e3['count']:_0x4b5c57['offset']+_0x4b5c57[_0xe02d('0x17')];var _0x417672;if(_0x44a33a>=_0x8cfd2){_0x44a33a=_0x8cfd2;_0x417672=0xc8;}else{_0x417672=0xce;}_0x271060[_0xe02d('0x13')](_0x417672);return _0x271060['set'](_0xe02d('0x19'),_0x36034e+'-'+_0x44a33a+'/'+_0x8cfd2)[_0xe02d('0x14')](_0x15c1e3);}return null;};}function saveUpdates(_0xf4c273){return function(_0x3c439f){if(_0x3c439f){return _0x3c439f[_0xe02d('0x1a')](_0xf4c273)[_0xe02d('0x1b')](function(_0x4ee580){return _0x4ee580;});}return null;};}function removeEntity(_0x553100){return function(_0x2c5889){if(_0x2c5889){return _0x2c5889['destroy']()[_0xe02d('0x1b')](function(){_0x553100['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f16e5){return function(_0x46a9e7){if(!_0x46a9e7){_0x4f16e5[_0xe02d('0x1c')](0x194);}return _0x46a9e7;};}function handleError(_0x348004,_0x535a7b){_0x535a7b=_0x535a7b||0x1f4;return function(_0x3ff9cd){logger[_0xe02d('0x1d')](_0x3ff9cd['stack']);if(_0x3ff9cd['name']){delete _0x3ff9cd['name'];}_0x348004[_0xe02d('0x13')](_0x535a7b)[_0xe02d('0x1e')](_0x3ff9cd);};}exports[_0xe02d('0x1f')]=function(_0x4f31ad,_0x297458){var _0x1a8ff7={};var _0x459c56=_[_0xe02d('0x20')](db[_0xe02d('0x21')][_0xe02d('0x22')],function(_0xbbc8c7){return{'name':_0xbbc8c7['fieldName'],'type':_0xbbc8c7['type'][_0xe02d('0x23')]};});_0x1a8ff7=qs[_0xe02d('0x24')](_0x459c56,_0x4f31ad);return interaction[_0xe02d('0x25')](_0xe02d('0x26'),_0x4f31ad[_0xe02d('0x27')],_0x4f31ad[_0xe02d('0x28')],_0x1a8ff7,_0x459c56)[_0xe02d('0x1b')](respondWithFilteredResult(_0x297458,_0x1a8ff7))[_0xe02d('0x29')](handleError(_0x297458,null));};exports['show']=function(_0x263c25,_0x2e4688){var _0x90dab8={'raw':![],'where':{'id':_0x263c25[_0xe02d('0x2a')]['id']}},_0x4a2221={};_0x4a2221[_0xe02d('0x2b')]=_[_0xe02d('0x2c')](db[_0xe02d('0x21')]['rawAttributes']);_0x4a2221[_0xe02d('0x27')]=_[_0xe02d('0x2c')](_0x263c25[_0xe02d('0x27')]);_0x4a2221[_0xe02d('0x2d')]=_[_0xe02d('0x2e')](_0x4a2221[_0xe02d('0x2b')],_0x4a2221[_0xe02d('0x27')]);_0x90dab8[_0xe02d('0x2f')]=_[_0xe02d('0x2e')](_0x4a2221[_0xe02d('0x2b')],qs['fields'](_0x263c25[_0xe02d('0x27')][_0xe02d('0x30')]));_0x90dab8['attributes']=_0x90dab8[_0xe02d('0x2f')][_0xe02d('0x31')]?_0x90dab8[_0xe02d('0x2f')]:_0x4a2221[_0xe02d('0x2b')];if(_0x263c25['query']['includeAll']){_0x90dab8[_0xe02d('0x32')]=[{'all':!![]}];}_0x90dab8=_[_0xe02d('0x33')]({},_0x90dab8,_0x263c25[_0xe02d('0x34')]);return db[_0xe02d('0x21')][_0xe02d('0x35')](_0x90dab8)[_0xe02d('0x1b')](handleEntityNotFound(_0x2e4688,null))['then'](respondWithResult(_0x2e4688,null))['catch'](handleError(_0x2e4688,null));};exports['create']=function(_0x56ffcd,_0x404e11){return db[_0xe02d('0x21')][_0xe02d('0x36')](_0x56ffcd[_0xe02d('0x37')],{})[_0xe02d('0x1b')](respondWithResult(_0x404e11,0xc9))['catch'](handleError(_0x404e11,null));};exports[_0xe02d('0x1a')]=function(_0x1b14a9,_0x4f536f){if(_0x1b14a9[_0xe02d('0x37')]['id']){delete _0x1b14a9[_0xe02d('0x37')]['id'];}return db[_0xe02d('0x21')][_0xe02d('0x35')]({'where':{'id':_0x1b14a9['params']['id']}})['then'](handleEntityNotFound(_0x4f536f,null))[_0xe02d('0x1b')](saveUpdates(_0x1b14a9[_0xe02d('0x37')],null))['then'](respondWithResult(_0x4f536f,null))['catch'](handleError(_0x4f536f,null));};exports[_0xe02d('0x38')]=function(_0x53dc46,_0x250d68){return db[_0xe02d('0x21')][_0xe02d('0x35')]({'where':{'id':_0x53dc46[_0xe02d('0x2a')]['id']}})[_0xe02d('0x1b')](handleEntityNotFound(_0x250d68,null))[_0xe02d('0x1b')](removeEntity(_0x250d68,null))[_0xe02d('0x29')](handleError(_0x250d68,null));};exports[_0xe02d('0x39')]=function(_0x3d186d,_0x3252be){return db[_0xe02d('0x21')]['describe']()['then'](respondWithResult(_0x3252be,null))[_0xe02d('0x29')](handleError(_0x3252be,null));};exports[_0xe02d('0x3a')]=function(_0x4ae8d0,_0x360353){return db[_0xe02d('0x3b')]['find']({'where':{'id':_0x4ae8d0[_0xe02d('0x2a')]['id']}})['then'](handleEntityNotFound(_0x360353,null))[_0xe02d('0x1b')](function(_0x123f48){if(_0x123f48){return _0x123f48[_0xe02d('0x3a')](_0x4ae8d0['body'][_0xe02d('0x3c')],_[_0xe02d('0x3d')](_0x4ae8d0[_0xe02d('0x37')],[_0xe02d('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x360353,null))[_0xe02d('0x29')](handleError(_0x360353,null));};exports['getMessages']=function(_0x37e491,_0x25e02d){var _0x3881f6={'raw':![],'where':{}};var _0x281e09={};var _0x12a18b={'count':0x0,'rows':[]};return db['MailInteraction'][_0xe02d('0x3e')]({'where':{'id':_0x37e491[_0xe02d('0x2a')]['id']}})[_0xe02d('0x1b')](handleEntityNotFound(_0x25e02d,null))[_0xe02d('0x1b')](function(_0x361b13){if(_0x361b13){_0x281e09[_0xe02d('0x2b')]=_[_0xe02d('0x2c')](db[_0xe02d('0x3b')][_0xe02d('0x22')]);_0x281e09[_0xe02d('0x27')]=_['keys'](_0x37e491[_0xe02d('0x27')]);_0x281e09[_0xe02d('0x2d')]=_[_0xe02d('0x2e')](_0x281e09[_0xe02d('0x2b')],_0x281e09[_0xe02d('0x27')]);_0x3881f6[_0xe02d('0x2f')]=_[_0xe02d('0x2e')](_0x281e09[_0xe02d('0x2b')],qs[_0xe02d('0x30')](_0x37e491[_0xe02d('0x27')][_0xe02d('0x30')]));_0x3881f6['attributes']=_0x3881f6['attributes'][_0xe02d('0x31')]?_0x3881f6[_0xe02d('0x2f')]:_0x281e09['model'];if(!_0x37e491[_0xe02d('0x27')]['hasOwnProperty']('nolimit')){_0x3881f6['limit']=qs[_0xe02d('0x17')](_0x37e491['query'][_0xe02d('0x17')]);_0x3881f6['offset']=qs[_0xe02d('0x15')](_0x37e491['query'][_0xe02d('0x15')]);}_0x3881f6[_0xe02d('0x3f')]=qs['sort'](_0x37e491['query'][_0xe02d('0x40')]);_0x3881f6[_0xe02d('0x41')]=qs[_0xe02d('0x2d')](_[_0xe02d('0x42')](_0x37e491[_0xe02d('0x27')],_0x281e09['filters']));_0x3881f6[_0xe02d('0x41')]['MailInteractionId']=_0x361b13['id'];if(_0x37e491['query'][_0xe02d('0x43')]){_0x3881f6[_0xe02d('0x41')]=_[_0xe02d('0x33')](_0x3881f6[_0xe02d('0x41')],{'$or':_['map'](_0x3881f6[_0xe02d('0x2f')],function(_0x4c8137){var _0x36eeb4={};_0x36eeb4[_0x4c8137]={'$like':'%'+_0x37e491[_0xe02d('0x27')]['filter']+'%'};return _0x36eeb4;})});}if(_0x37e491[_0xe02d('0x27')]['$gte']){var _0x147797=_0x37e491[_0xe02d('0x27')]['$gte'][_0xe02d('0x44')](',');var _0x156e59={};_0x156e59[_0x147797[0x0]]={'$gte':moment(_0x147797[0x1])[_0xe02d('0x45')](_0xe02d('0x46'))};_0x3881f6[_0xe02d('0x41')]=_['merge'](_0x3881f6[_0xe02d('0x41')],_0x156e59);}_0x3881f6=_['merge']({},_0x3881f6,_0x37e491[_0xe02d('0x34')]);return db[_0xe02d('0x3b')][_0xe02d('0x18')]({'where':_0x3881f6['where']})[_0xe02d('0x1b')](function(_0x29bfc4){_0x12a18b[_0xe02d('0x18')]=_0x29bfc4;if(_0x37e491[_0xe02d('0x27')][_0xe02d('0x47')]){_0x3881f6[_0xe02d('0x32')]=[{'all':!![]}];}return db[_0xe02d('0x3b')][_0xe02d('0x25')](_0x3881f6);})[_0xe02d('0x1b')](function(_0x1016ef){if(_0x37e491[_0xe02d('0x27')][_0xe02d('0x48')]==='true'){for(var _0x1023d2=0x0;_0x1023d2<_0x1016ef[_0xe02d('0x31')];_0x1023d2++){_0x1016ef[_0x1023d2][_0xe02d('0x37')]=juice(_0x1016ef[_0x1023d2][_0xe02d('0x37')]);}}_0x12a18b[_0xe02d('0x49')]=_0x1016ef;return _0x12a18b;});}})[_0xe02d('0x1b')](respondWithFilteredResult(_0x25e02d,_0x3881f6))[_0xe02d('0x29')](handleError(_0x25e02d,null));};exports[_0xe02d('0x4a')]=function(_0x4826de,_0xcde98d){return db[_0xe02d('0x21')]['find']({'where':{'id':_0x4826de[_0xe02d('0x2a')]['id']}})[_0xe02d('0x1b')](handleEntityNotFound(_0xcde98d,null))[_0xe02d('0x1b')](function(_0x2525bc){if(_0x2525bc){return _0x2525bc['setTags'](_0x4826de[_0xe02d('0x37')][_0xe02d('0x3c')],_[_0xe02d('0x3d')](_0x4826de['body'],[_0xe02d('0x3c'),'id'])||{})[_0xe02d('0x4b')](function(){return db[_0xe02d('0x4c')][_0xe02d('0x25')]({'attributes':['id',_0xe02d('0x4d'),'color'],'where':{'id':_0x4826de[_0xe02d('0x37')][_0xe02d('0x3c')]}});})[_0xe02d('0x1b')](function(_0x4cf8cb){socket['emit']('mailInteractionTags:save',{'id':Number(_0x4826de[_0xe02d('0x2a')]['id']),'tags':_0x4cf8cb||[]});return{'id':Number(_0x4826de[_0xe02d('0x2a')]['id']),'tags':_0x4cf8cb||[]};});}})[_0xe02d('0x1b')](respondWithResult(_0xcde98d,null))[_0xe02d('0x29')](handleError(_0xcde98d,null));};exports[_0xe02d('0x4e')]=function(_0x47c573,_0x15d628){return db[_0xe02d('0x21')]['find']({'where':{'id':_0x47c573[_0xe02d('0x2a')]['id']}})[_0xe02d('0x1b')](handleEntityNotFound(_0x15d628,null))['then'](function(_0x3e9e5a){if(_0x3e9e5a){return _0x3e9e5a[_0xe02d('0x4e')](_0x47c573['query'][_0xe02d('0x3c')]);}})[_0xe02d('0x1b')](respondWithStatusCode(_0x15d628,null))[_0xe02d('0x29')](handleError(_0x15d628,null));};exports['download']=function(_0x2c7152,_0x31c414){var _0x363f81=moment()[_0xe02d('0x4f')]()['toString']();var _0x210579=path[_0xe02d('0x50')](config[_0xe02d('0x51')],_0xe02d('0x52'),_0xe02d('0x53'),_0xe02d('0x54'));var _0x498ba4=path[_0xe02d('0x50')](config[_0xe02d('0x51')],_0xe02d('0x52'),'files',_0xe02d('0x55'));var _0x14ae7c=path[_0xe02d('0x50')](_0x210579,_0x363f81);var _0x3a6af7=util[_0xe02d('0x45')](_0xe02d('0x56'),_0x2c7152[_0xe02d('0x2a')]['id'],_0x363f81);var _0xcaefaa=path[_0xe02d('0x50')](_0x210579,_0x3a6af7);var _0x4a25db=[];if(_0x2c7152[_0xe02d('0x27')]['attachments']){_0x4a25db['push']({'model':db[_0xe02d('0x57')],'as':_0xe02d('0x58'),'raw':!![]});}var _0x1a829f=[{'model':db[_0xe02d('0x3b')],'as':_0xe02d('0x59'),'attributes':['id',_0xe02d('0x37'),'from','to','cc',_0xe02d('0x5a'),_0xe02d('0x5b'),_0xe02d('0x5c')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x4a25db}];return db[_0xe02d('0x21')][_0xe02d('0x35')]({'where':{'id':_0x2c7152[_0xe02d('0x2a')]['id']},'include':_0x1a829f})[_0xe02d('0x1b')](handleEntityNotFound(_0x31c414,null))[_0xe02d('0x1b')](function(_0x47c63e){if(_0x47c63e&&_0x47c63e['Messages']){var _0x26838e=_0x47c63e[_0xe02d('0x5d')]({'plain':!![]});fs[_0xe02d('0x5e')](_0x14ae7c);return BPromise[_0xe02d('0x5f')](_0x26838e[_0xe02d('0x59')],function(_0x33d836,_0x5e1d55){var _0x48c6b2={'from':_0x33d836[_0xe02d('0x60')],'to':_0x33d836['to']||_0xe02d('0x61'),'subject':_0x33d836[_0xe02d('0x5b')],'html':htmlEntities[_0xe02d('0x62')](_0x33d836[_0xe02d('0x37')]),'headers':{'Date':moment(_0x33d836[_0xe02d('0x5c')])[_0xe02d('0x45')](_0xe02d('0x63'))},'attachments':[]};if(_0x33d836['cc']){_0x48c6b2['headers']['Cc']=_0x33d836['cc'];}if(_0x33d836[_0xe02d('0x5a')]){_0x48c6b2['headers'][_0xe02d('0x64')]=_0x33d836[_0xe02d('0x5a')];}return new BPromise(function(_0x3f0d12,_0x162e35){if(_0x33d836[_0xe02d('0x58')]){for(var _0x37c102=0x0;_0x37c102<_0x33d836[_0xe02d('0x58')][_0xe02d('0x31')];_0x37c102++){var _0x56c63b=_0x33d836['Attachments'][_0x37c102];var _0x3c46f5=path[_0xe02d('0x50')](_0x498ba4,_0x56c63b[_0xe02d('0x65')]);if(fs[_0xe02d('0x66')](_0x3c46f5)){_0x48c6b2[_0xe02d('0x55')][_0xe02d('0x67')]({'name':_0x56c63b['name'],'contentType':_0x56c63b[_0xe02d('0x68')],'data':fs[_0xe02d('0x69')](_0x3c46f5)});}}}emlformat[_0xe02d('0x6a')](_0x48c6b2,function(_0x133fff,_0x22c3bb){if(_0x133fff)return _0x162e35(_0x133fff);fs[_0xe02d('0x6b')](path['join'](_0x14ae7c,util['format'](_0xe02d('0x6c'),_0x5e1d55)),_0x22c3bb);return _0x3f0d12(_0x22c3bb);});});})[_0xe02d('0x1b')](function(){return new BPromise(function(_0x2bbc59,_0x3b37db){zipdir(_0x14ae7c,{'saveTo':_0xcaefaa},function(_0x2cc8d5,_0x192635){if(_0x2cc8d5)return _0x3b37db(_0x2cc8d5);return _0x2bbc59(_0x192635);});})[_0xe02d('0x1b')](function(){return new BPromise(function(_0x4199de,_0x1bc8ba){rimraf(_0x14ae7c,function(_0x1b3341){if(_0x1b3341)_0x1bc8ba(_0x1b3341);return _0x4199de();});});})[_0xe02d('0x1b')](function(){return _0x31c414['download'](_0xcaefaa,_0x3a6af7,function(_0x16215a){if(!_0x16215a)fs['unlinkSync'](_0xcaefaa);});});});}else{return _0x31c414[_0xe02d('0x1c')](0xc8);}})['catch'](handleError(_0x31c414,null));};
\ No newline at end of file
index cd51a75..c55dbe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb8=['findAll','unreadMessages','length','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users'];(function(_0x5a8413,_0x3db6ad){var _0x1e2ecd=function(_0x2acb9c){while(--_0x2acb9c){_0x5a8413['push'](_0x5a8413['shift']());}};_0x1e2ecd(++_0x3db6ad);}(_0x3cb8,0x186));var _0x83cb=function(_0x552e3d,_0xe546b3){_0x552e3d=_0x552e3d-0x0;var _0x52667f=_0x3cb8[_0x552e3d];return _0x52667f;};'use strict';var EventEmitter=require(_0x83cb('0x0'));var MailInteraction=require(_0x83cb('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x83cb('0x1'))['db'][_0x83cb('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x83cb('0x3')](0x0);var events={'afterCreate':_0x83cb('0x4'),'afterUpdate':_0x83cb('0x5'),'afterDestroy':_0x83cb('0x6')};function emitEvent(_0x58367a){return function(_0x534778,_0x1e523e,_0xfed774){_0x534778[_0x83cb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xb664b6){_0x534778[_0x83cb('0x8')](_0x83cb('0x9'),_0xb664b6['map'](function(_0x1f0838){return{'id':_0x1f0838['id']};}));return MailMessage[_0x83cb('0xa')]({'where':{'MailInteractionId':_0x534778['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4937c2){_0x534778['setDataValue'](_0x83cb('0xb'),_0x4937c2[_0x83cb('0xc')]);MailInteractionEvents['emit'](_0x58367a+':'+_0x534778['id'],_0x534778);MailInteractionEvents[_0x83cb('0xd')](_0x58367a,_0x534778);_0xfed774(null);})['catch'](_0xfed774(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x83cb('0xe')](e,emitEvent(event));}}module[_0x83cb('0xf')]=MailInteractionEvents;
\ No newline at end of file
+var _0x2006=['setDataValue','Users','findAll','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','then'];(function(_0x4c1b76,_0x2cdc2d){var _0x3ace6b=function(_0x40fac1){while(--_0x40fac1){_0x4c1b76['push'](_0x4c1b76['shift']());}};_0x3ace6b(++_0x2cdc2d);}(_0x2006,0x15f));var _0x6200=function(_0x406fa7,_0x5c9314){_0x406fa7=_0x406fa7-0x0;var _0x9fff93=_0x2006[_0x406fa7];return _0x9fff93;};'use strict';var EventEmitter=require(_0x6200('0x0'));var MailInteraction=require(_0x6200('0x1'))['db'][_0x6200('0x2')];var MailMessage=require(_0x6200('0x1'))['db'][_0x6200('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6200('0x4')](0x0);var events={'afterCreate':_0x6200('0x5'),'afterUpdate':'update','afterDestroy':_0x6200('0x6')};function emitEvent(_0x50b056){return function(_0x589d5b,_0x578e00,_0x58b5cc){_0x589d5b[_0x6200('0x7')]({'attributes':['id'],'raw':!![]})[_0x6200('0x8')](function(_0x430c02){_0x589d5b[_0x6200('0x9')](_0x6200('0xa'),_0x430c02['map'](function(_0x2a4f56){return{'id':_0x2a4f56['id']};}));return MailMessage[_0x6200('0xb')]({'where':{'MailInteractionId':_0x589d5b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6200('0x8')](function(_0x204a36){_0x589d5b[_0x6200('0x9')]('unreadMessages',_0x204a36[_0x6200('0xc')]);MailInteractionEvents[_0x6200('0xd')](_0x50b056+':'+_0x589d5b['id'],_0x589d5b);MailInteractionEvents[_0x6200('0xd')](_0x50b056,_0x589d5b);_0x58b5cc(null);})[_0x6200('0xe')](_0x58b5cc(null));};}for(var e in events){if(events[_0x6200('0xf')](e)){var event=events[e];MailInteraction[_0x6200('0x10')](e,emitEvent(event));}}module[_0x6200('0x11')]=MailInteractionEvents;
\ No newline at end of file
index de29704..cf81eee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2b3=['update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','request-promise','path','rimraf','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatusAt','closed','get'];(function(_0xc80967,_0x456ee7){var _0xf57ab6=function(_0x4a4c5b){while(--_0x4a4c5b){_0xc80967['push'](_0xc80967['shift']());}};_0xf57ab6(++_0x456ee7);}(_0xb2b3,0x154));var _0x3b2b=function(_0x373643,_0x25eb1f){_0x373643=_0x373643-0x0;var _0x2e26a2=_0xb2b3[_0x373643];return _0x2e26a2;};'use strict';var _=require('lodash');var util=require(_0x3b2b('0x0'));var logger=require(_0x3b2b('0x1'))(_0x3b2b('0x2'));var moment=require('moment');var BPromise=require(_0x3b2b('0x3'));var rp=require(_0x3b2b('0x4'));var fs=require('fs');var path=require(_0x3b2b('0x5'));var rimraf=require(_0x3b2b('0x6'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x3b2b('0x7')]=function(_0x414968,_0x5c1e07){return _0x414968[_0x3b2b('0x8')]('MailInteraction',attributes,{'tableName':_0x3b2b('0x9'),'paranoid':![],'indexes':[{'name':_0x3b2b('0xa'),'fields':['subject','to'],'type':_0x3b2b('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x50b364,_0x24bc10,_0xe173b6){if(_0x50b364[_0x3b2b('0xc')]){_0x50b364['substatusAt']=moment()[_0x3b2b('0xd')](_0x3b2b('0xe'));}if(_0x50b364['closed']){_0x50b364[_0x3b2b('0xf')]=moment()[_0x3b2b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xe173b6(null,_0x24bc10);},'beforeUpdate':function(_0x8508e,_0x45711e,_0x50c7c0){if(_0x8508e[_0x3b2b('0x10')](_0x3b2b('0xc'))){_0x8508e[_0x3b2b('0x11')]=_0x8508e['substatus']?moment()['format'](_0x3b2b('0xe')):null;}if(_0x8508e[_0x3b2b('0x10')](_0x3b2b('0x12'))){_0x8508e['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x8508e[_0x3b2b('0xc')]=null;_0x8508e[_0x3b2b('0x11')]=null;}_0x50c7c0(null,_0x8508e);},'afterUpdate':function(_0x33ceb5,_0x51d9ce,_0x122402){var _0x6182d8=_0x414968['models'];var _0x460a60=_0x33ceb5[_0x3b2b('0x13')]({'plain':!![]});if(_0x460a60[_0x3b2b('0x12')]){return _0x6182d8['MailMessage'][_0x3b2b('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x460a60['id']}})[_0x3b2b('0x15')](function(){_0x122402();})['catch'](function(_0x50dd9a){_0x122402(_0x50dd9a);});}else{_0x122402();}}},'charset':_0x3b2b('0x16'),'collate':_0x3b2b('0x17')});};
\ No newline at end of file
+var _0x43ec=['moment','path','rimraf','./mailInteraction.attributes','exports','mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatusAt','models','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x53b852,_0x45874f){var _0x59070c=function(_0x21d2ef){while(--_0x21d2ef){_0x53b852['push'](_0x53b852['shift']());}};_0x59070c(++_0x45874f);}(_0x43ec,0x129));var _0xc43e=function(_0x349815,_0x26525a){_0x349815=_0x349815-0x0;var _0x594f2c=_0x43ec[_0x349815];return _0x594f2c;};'use strict';var _=require(_0xc43e('0x0'));var util=require(_0xc43e('0x1'));var logger=require('../../config/logger')(_0xc43e('0x2'));var moment=require(_0xc43e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc43e('0x4'));var rimraf=require(_0xc43e('0x5'));var config=require('../../config/environment');var attributes=require(_0xc43e('0x6'));module[_0xc43e('0x7')]=function(_0x236a3b,_0x552aeb){return _0x236a3b['define']('MailInteraction',attributes,{'tableName':_0xc43e('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xc43e('0x9'),'to'],'type':_0xc43e('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ae142,_0x45109c,_0x58ceb1){if(_0x3ae142[_0xc43e('0xb')]){_0x3ae142['substatusAt']=moment()[_0xc43e('0xc')](_0xc43e('0xd'));}if(_0x3ae142[_0xc43e('0xe')]){_0x3ae142[_0xc43e('0xf')]=moment()[_0xc43e('0xc')](_0xc43e('0xd'));}_0x58ceb1(null,_0x45109c);},'beforeUpdate':function(_0x5ad5a5,_0x2d693e,_0x3fa089){if(_0x5ad5a5['changed'](_0xc43e('0xb'))){_0x5ad5a5['substatusAt']=_0x5ad5a5[_0xc43e('0xb')]?moment()[_0xc43e('0xc')](_0xc43e('0xd')):null;}if(_0x5ad5a5[_0xc43e('0x10')](_0xc43e('0xe'))){_0x5ad5a5[_0xc43e('0xf')]=moment()['format'](_0xc43e('0xd'));_0x5ad5a5[_0xc43e('0xb')]=null;_0x5ad5a5[_0xc43e('0x11')]=null;}_0x3fa089(null,_0x5ad5a5);},'afterUpdate':function(_0x26a723,_0x4ed746,_0x1332ee){var _0x5d0c8c=_0x236a3b[_0xc43e('0x12')];var _0x16205c=_0x26a723[_0xc43e('0x13')]({'plain':!![]});if(_0x16205c['closed']){return _0x5d0c8c[_0xc43e('0x14')][_0xc43e('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x16205c['id']}})['then'](function(){_0x1332ee();})[_0xc43e('0x16')](function(_0x582921){_0x1332ee(_0x582921);});}else{_0x1332ee();}}},'charset':_0xc43e('0x17'),'collate':_0xc43e('0x18')});};
\ No newline at end of file
index 39baf2a..962f8d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9cb=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','options','attributes','limit','AddTagsToMailInteraction','MailInteraction','find','body','ids','omit','spread','AddTags','util','randomstring','../../mysqldb'];(function(_0x3f6c2c,_0x36015d){var _0x143519=function(_0x557b09){while(--_0x557b09){_0x3f6c2c['push'](_0x3f6c2c['shift']());}};_0x143519(++_0x36015d);}(_0xc9cb,0x91));var _0xbc9c=function(_0x4f4c44,_0x160c7c){_0x4f4c44=_0x4f4c44-0x0;var _0x3152f2=_0xc9cb[_0x4f4c44];return _0x3152f2;};'use strict';var _=require('lodash');var util=require(_0xbc9c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbc9c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbc9c('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xbc9c('0x3'))(_0xbc9c('0x4'));var config=require(_0xbc9c('0x5'));var jayson=require(_0xbc9c('0x6'));var client=jayson['client'][_0xbc9c('0x7')]({'port':0x232a});config[_0xbc9c('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbc9c('0x9'))(new Redis(config['redis']));require(_0xbc9c('0xa'))[_0xbc9c('0xb')](socket);function respondWithRpcPromise(_0x2f5ef7,_0x20dca8,_0x4f9106){return new BPromise(function(_0x1eb48b,_0x147a31){return client[_0xbc9c('0xc')](_0x2f5ef7,_0x4f9106)[_0xbc9c('0xd')](function(_0x3552e3){logger[_0xbc9c('0xe')](_0xbc9c('0xf'),_0x20dca8,_0xbc9c('0x10'));logger[_0xbc9c('0x11')](_0xbc9c('0x12'),_0x20dca8,'request\x20sent',JSON[_0xbc9c('0x13')](_0x3552e3));if(_0x3552e3[_0xbc9c('0x14')]){if(_0x3552e3[_0xbc9c('0x14')][_0xbc9c('0x15')]===0x1f4){logger[_0xbc9c('0x14')]('MailInteraction,\x20%s,\x20%s',_0x20dca8,_0x3552e3[_0xbc9c('0x14')][_0xbc9c('0x16')]);return _0x147a31(_0x3552e3[_0xbc9c('0x14')][_0xbc9c('0x16')]);}logger[_0xbc9c('0x14')]('MailInteraction,\x20%s,\x20%s',_0x20dca8,_0x3552e3[_0xbc9c('0x14')][_0xbc9c('0x16')]);return _0x1eb48b(_0x3552e3['error'][_0xbc9c('0x16')]);}else{logger['info'](_0xbc9c('0xf'),_0x20dca8,'request\x20sent');_0x1eb48b(_0x3552e3['result'][_0xbc9c('0x16')]);}})[_0xbc9c('0x17')](function(_0x3b618b){logger[_0xbc9c('0x14')]('MailInteraction,\x20%s,\x20%s',_0x20dca8,_0x3b618b);_0x147a31(_0x3b618b);});});}exports[_0xbc9c('0x18')]=function(_0x38e251){var _0x10f988=this;return new Promise(function(_0x3f8b8d,_0x1d5146){return db['MailInteraction'][_0xbc9c('0x19')](_0x38e251['body'],{'raw':_0x38e251[_0xbc9c('0x1a')]?_0x38e251['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38e251[_0xbc9c('0x1a')]?_0x38e251[_0xbc9c('0x1a')]['where']||null:null,'attributes':_0x38e251['options']?_0x38e251['options'][_0xbc9c('0x1b')]||null:null,'limit':_0x38e251[_0xbc9c('0x1a')]?_0x38e251[_0xbc9c('0x1a')][_0xbc9c('0x1c')]||null:null})[_0xbc9c('0xd')](function(_0x2fe6c3){logger['info'](_0xbc9c('0x18'),_0x38e251);logger[_0xbc9c('0x11')](_0xbc9c('0x18'),_0x38e251,JSON[_0xbc9c('0x13')](_0x2fe6c3));_0x3f8b8d(_0x2fe6c3);})[_0xbc9c('0x17')](function(_0xf51dee){logger['error'](_0xbc9c('0x18'),_0xf51dee[_0xbc9c('0x16')],_0x38e251);_0x1d5146(_0x10f988[_0xbc9c('0x14')](0x1f4,_0xf51dee[_0xbc9c('0x16')]));});});};exports[_0xbc9c('0x1d')]=function(_0x5a77fe){return new Promise(function(_0x37317d,_0x4a99fe){return db[_0xbc9c('0x1e')][_0xbc9c('0x1f')]({'where':_0x5a77fe[_0xbc9c('0x1a')]?_0x5a77fe[_0xbc9c('0x1a')]['where']||null:null})[_0xbc9c('0xd')](function(_0x41d071){if(_0x41d071){return _0x41d071['addTags'](_0x5a77fe[_0xbc9c('0x20')][_0xbc9c('0x21')],_[_0xbc9c('0x22')](_0x5a77fe[_0xbc9c('0x20')],[_0xbc9c('0x21'),'id'])||{});}})[_0xbc9c('0x23')](function(_0x394fa4){logger[_0xbc9c('0xe')]('AddTags',_0x5a77fe);logger[_0xbc9c('0x11')](_0xbc9c('0x24'),_0x5a77fe,JSON[_0xbc9c('0x13')](_0x394fa4));_0x37317d(_0x394fa4);})['catch'](function(_0x5057b2){logger['error'](_0xbc9c('0x24'),_0x5057b2[_0xbc9c('0x16')],_0x5a77fe);_0x4a99fe(_this['error'](0x1f4,_0x5057b2[_0xbc9c('0x16')]));});});};
\ No newline at end of file
+var _0x37a2=['raw','attributes','AddTagsToMailInteraction','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s','message','info','result','catch','UpdateMailInteraction','MailInteraction','update','body','options'];(function(_0x438d99,_0x23b454){var _0x2b9904=function(_0x367225){while(--_0x367225){_0x438d99['push'](_0x438d99['shift']());}};_0x2b9904(++_0x23b454);}(_0x37a2,0x178));var _0x237a=function(_0x3d3002,_0x1741e0){_0x3d3002=_0x3d3002-0x0;var _0x153888=_0x37a2[_0x3d3002];return _0x153888;};'use strict';var _=require(_0x237a('0x0'));var util=require(_0x237a('0x1'));var moment=require('moment');var BPromise=require(_0x237a('0x2'));var rs=require(_0x237a('0x3'));var fs=require('fs');var Redis=require(_0x237a('0x4'));var db=require(_0x237a('0x5'))['db'];var utils=require(_0x237a('0x6'));var logger=require(_0x237a('0x7'))(_0x237a('0x8'));var config=require('../../config/environment');var jayson=require(_0x237a('0x9'));var client=jayson[_0x237a('0xa')][_0x237a('0xb')]({'port':0x232a});config[_0x237a('0xc')]=_[_0x237a('0xd')](config[_0x237a('0xc')],{'host':_0x237a('0xe'),'port':0x18eb});var socket=require(_0x237a('0xf'))(new Redis(config[_0x237a('0xc')]));require(_0x237a('0x10'))[_0x237a('0x11')](socket);function respondWithRpcPromise(_0x469459,_0x5dbf4d,_0x42c81a){return new BPromise(function(_0x3fe9b3,_0xe032ce){return client[_0x237a('0x12')](_0x469459,_0x42c81a)[_0x237a('0x13')](function(_0x4d7415){logger['info']('MailInteraction,\x20%s,\x20%s',_0x5dbf4d,'request\x20sent');logger[_0x237a('0x14')](_0x237a('0x15'),_0x5dbf4d,'request\x20sent',JSON[_0x237a('0x16')](_0x4d7415));if(_0x4d7415['error']){if(_0x4d7415[_0x237a('0x17')]['code']===0x1f4){logger[_0x237a('0x17')](_0x237a('0x18'),_0x5dbf4d,_0x4d7415[_0x237a('0x17')][_0x237a('0x19')]);return _0xe032ce(_0x4d7415['error'][_0x237a('0x19')]);}logger[_0x237a('0x17')](_0x237a('0x18'),_0x5dbf4d,_0x4d7415[_0x237a('0x17')][_0x237a('0x19')]);return _0x3fe9b3(_0x4d7415[_0x237a('0x17')][_0x237a('0x19')]);}else{logger[_0x237a('0x1a')]('MailInteraction,\x20%s,\x20%s',_0x5dbf4d,'request\x20sent');_0x3fe9b3(_0x4d7415[_0x237a('0x1b')][_0x237a('0x19')]);}})[_0x237a('0x1c')](function(_0x5d9958){logger['error'](_0x237a('0x18'),_0x5dbf4d,_0x5d9958);_0xe032ce(_0x5d9958);});});}exports[_0x237a('0x1d')]=function(_0x3d0487){var _0x3d7d82=this;return new Promise(function(_0x51b293,_0x1a289e){return db[_0x237a('0x1e')][_0x237a('0x1f')](_0x3d0487[_0x237a('0x20')],{'raw':_0x3d0487[_0x237a('0x21')]?_0x3d0487[_0x237a('0x21')][_0x237a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d0487['options']?_0x3d0487[_0x237a('0x21')]['where']||null:null,'attributes':_0x3d0487['options']?_0x3d0487['options'][_0x237a('0x23')]||null:null,'limit':_0x3d0487[_0x237a('0x21')]?_0x3d0487[_0x237a('0x21')]['limit']||null:null})['then'](function(_0xc773da){logger[_0x237a('0x1a')]('UpdateMailInteraction',_0x3d0487);logger[_0x237a('0x14')](_0x237a('0x1d'),_0x3d0487,JSON['stringify'](_0xc773da));_0x51b293(_0xc773da);})['catch'](function(_0x21f024){logger[_0x237a('0x17')]('UpdateMailInteraction',_0x21f024['message'],_0x3d0487);_0x1a289e(_0x3d7d82[_0x237a('0x17')](0x1f4,_0x21f024[_0x237a('0x19')]));});});};exports[_0x237a('0x24')]=function(_0x1877a4){return new Promise(function(_0x4a8277,_0x2aca50){return db[_0x237a('0x1e')]['find']({'where':_0x1877a4[_0x237a('0x21')]?_0x1877a4[_0x237a('0x21')]['where']||null:null})[_0x237a('0x13')](function(_0x2ebcc7){if(_0x2ebcc7){return _0x2ebcc7[_0x237a('0x25')](_0x1877a4[_0x237a('0x20')][_0x237a('0x26')],_['omit'](_0x1877a4['body'],[_0x237a('0x26'),'id'])||{});}})[_0x237a('0x27')](function(_0x5d7799){logger[_0x237a('0x1a')]('AddTags',_0x1877a4);logger[_0x237a('0x14')](_0x237a('0x28'),_0x1877a4,JSON['stringify'](_0x5d7799));_0x4a8277(_0x5d7799);})[_0x237a('0x1c')](function(_0x20c251){logger[_0x237a('0x17')]('AddTags',_0x20c251[_0x237a('0x19')],_0x1877a4);_0x2aca50(_this[_0x237a('0x17')](0x1f4,_0x20c251[_0x237a('0x19')]));});});};
\ No newline at end of file
index e3f6137..4497bb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x012f=['removeListener','register','length','./mailInteraction.events','remove','emit'];(function(_0xde3dbe,_0x194556){var _0x284aa4=function(_0x3fc180){while(--_0x3fc180){_0xde3dbe['push'](_0xde3dbe['shift']());}};_0x284aa4(++_0x194556);}(_0x012f,0x16b));var _0xf012=function(_0x2deaee,_0x3de6c9){_0x2deaee=_0x2deaee-0x0;var _0x306c4b=_0x012f[_0x2deaee];return _0x306c4b;};'use strict';var MailInteractionEvents=require(_0xf012('0x0'));var events=['save',_0xf012('0x1'),'update'];function createListener(_0x2dfc24,_0x59500a){return function(_0x558eea){_0x59500a[_0xf012('0x2')](_0x2dfc24,_0x558eea);};}function removeListener(_0x9913a5,_0x4c3c0b){return function(){MailInteractionEvents[_0xf012('0x3')](_0x9913a5,_0x4c3c0b);};}exports[_0xf012('0x4')]=function(_0x1b3154){for(var _0x5bc8ab=0x0,_0x6e5031=events[_0xf012('0x5')];_0x5bc8ab<_0x6e5031;_0x5bc8ab++){var _0x58882d=events[_0x5bc8ab];var _0x2982b3=createListener('mailInteraction:'+_0x58882d,_0x1b3154);MailInteractionEvents['on'](_0x58882d,_0x2982b3);}};
\ No newline at end of file
+var _0x0b9a=['length','mailInteraction:','./mailInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x616290,_0x280b7f){var _0x453879=function(_0x27bda7){while(--_0x27bda7){_0x616290['push'](_0x616290['shift']());}};_0x453879(++_0x280b7f);}(_0x0b9a,0x9b));var _0xa0b9=function(_0x222472,_0x33ea87){_0x222472=_0x222472-0x0;var _0x5d601f=_0x0b9a[_0x222472];return _0x5d601f;};'use strict';var MailInteractionEvents=require(_0xa0b9('0x0'));var events=[_0xa0b9('0x1'),_0xa0b9('0x2'),_0xa0b9('0x3')];function createListener(_0x5816c1,_0x1e498d){return function(_0x16e282){_0x1e498d[_0xa0b9('0x4')](_0x5816c1,_0x16e282);};}function removeListener(_0x24b728,_0x4b48e4){return function(){MailInteractionEvents[_0xa0b9('0x5')](_0x24b728,_0x4b48e4);};}exports[_0xa0b9('0x6')]=function(_0x2c1440){for(var _0x15eb5a=0x0,_0x4ee8f9=events[_0xa0b9('0x7')];_0x15eb5a<_0x4ee8f9;_0x15eb5a++){var _0x280e38=events[_0x15eb5a];var _0x212a72=createListener(_0xa0b9('0x8')+_0x280e38,_0x2c1440);MailInteractionEvents['on'](_0x280e38,_0x212a72);}};
\ No newline at end of file
index a1ad1d6..7a103fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc900=['/:id/reject','reject','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','show','/:id/download','download','post','tracked','mailmessage:create','put','update','/:id/accept'];(function(_0x33686c,_0x1a3f14){var _0x5f12fd=function(_0x27ea78){while(--_0x27ea78){_0x33686c['push'](_0x33686c['shift']());}};_0x5f12fd(++_0x1a3f14);}(_0xc900,0xb3));var _0x0c90=function(_0x4f1142,_0x28be99){_0x4f1142=_0x4f1142-0x0;var _0x1bc4a0=_0xc900[_0x4f1142];return _0x1bc4a0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0c90('0x0'));var timeout=require(_0x0c90('0x1'));var express=require(_0x0c90('0x2'));var router=express['Router']();var fs_extra=require(_0x0c90('0x3'));var auth=require(_0x0c90('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0c90('0x5'));var controller=require(_0x0c90('0x6'));router[_0x0c90('0x7')]('/',auth[_0x0c90('0x8')](),controller[_0x0c90('0x9')]);router[_0x0c90('0x7')]('/describe',auth[_0x0c90('0x8')](),controller[_0x0c90('0xa')]);router[_0x0c90('0x7')](_0x0c90('0xb'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xc')]);router[_0x0c90('0x7')](_0x0c90('0xd'),auth[_0x0c90('0x8')](),controller[_0x0c90('0xe')]);router[_0x0c90('0xf')]('/',auth[_0x0c90('0x8')](),interaction[_0x0c90('0x10')]('mail',_0x0c90('0x11')),controller['create']);router[_0x0c90('0x12')]('/:id',auth[_0x0c90('0x8')](),controller[_0x0c90('0x13')]);router[_0x0c90('0x12')](_0x0c90('0x14'),auth[_0x0c90('0x8')](),controller['accept']);router[_0x0c90('0x12')](_0x0c90('0x15'),auth['isAuthenticated'](),controller[_0x0c90('0x16')]);router[_0x0c90('0x17')](_0x0c90('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0c90('0x18')]=router;
\ No newline at end of file
+var _0xa737=['./mailMessage.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa737,0x154));var _0x7a73=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xa737[_0x342700];return _0x53406f;};'use strict';var multer=require(_0x7a73('0x0'));var util=require(_0x7a73('0x1'));var path=require(_0x7a73('0x2'));var timeout=require(_0x7a73('0x3'));var express=require(_0x7a73('0x4'));var router=express[_0x7a73('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7a73('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a73('0x7'));var controller=require(_0x7a73('0x8'));router[_0x7a73('0x9')]('/',auth[_0x7a73('0xa')](),controller[_0x7a73('0xb')]);router[_0x7a73('0x9')](_0x7a73('0xc'),auth[_0x7a73('0xa')](),controller['describe']);router[_0x7a73('0x9')](_0x7a73('0xd'),auth[_0x7a73('0xa')](),controller[_0x7a73('0xe')]);router['get'](_0x7a73('0xf'),auth[_0x7a73('0xa')](),controller[_0x7a73('0x10')]);router[_0x7a73('0x11')]('/',auth[_0x7a73('0xa')](),interaction[_0x7a73('0x12')](_0x7a73('0x13'),_0x7a73('0x14')),controller[_0x7a73('0x15')]);router[_0x7a73('0x16')]('/:id',auth[_0x7a73('0xa')](),controller['update']);router[_0x7a73('0x16')](_0x7a73('0x17'),auth[_0x7a73('0xa')](),controller[_0x7a73('0x18')]);router['put'](_0x7a73('0x19'),auth[_0x7a73('0xa')](),controller[_0x7a73('0x1a')]);router[_0x7a73('0x1b')](_0x7a73('0xd'),auth[_0x7a73('0xa')](),controller[_0x7a73('0x1c')]);module['exports']=router;
\ No newline at end of file
index 75a5685..85017c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c75=['DATE','INTEGER','Email','sequelize','lodash','exports','long','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x53935f,_0xab8c3d){var _0xd4774e=function(_0x3bbcad){while(--_0x3bbcad){_0x53935f['push'](_0x53935f['shift']());}};_0xd4774e(++_0xab8c3d);}(_0x2c75,0x1cb));var _0x52c7=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x2c75[_0x68ee8b];return _0x5148f7;};'use strict';var Sequelize=require(_0x52c7('0x0'));var _=require(_0x52c7('0x1'));module[_0x52c7('0x2')]={'body':{'type':Sequelize['TEXT'](_0x52c7('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x52c7('0x4')]('medium')},'read':{'type':Sequelize[_0x52c7('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x52c7('0x6')]('in','out'),'defaultValue':_0x52c7('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x52c7('0x8')]},'to':{'type':Sequelize['TEXT'](_0x52c7('0x3'))},'cc':{'type':Sequelize['TEXT']('long')},'bcc':{'type':Sequelize[_0x52c7('0x4')](_0x52c7('0x3'))},'subject':{'type':Sequelize[_0x52c7('0x4')]},'sentAt':{'type':Sequelize[_0x52c7('0x9')]},'attach':{'type':Sequelize[_0x52c7('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x52c7('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x52c7('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x52c7('0x3'))},'originCc':{'type':Sequelize[_0x52c7('0x4')]('long')},'originChannel':{'type':Sequelize['ENUM'](_0x52c7('0xb'),'Chat'),'defaultValue':_0x52c7('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0x7f22=['STRING','DATE','INTEGER','Chat','Email','sequelize','exports','long','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7f22,0xc8));var _0x27f2=function(_0x1c4fab,_0x547184){_0x1c4fab=_0x1c4fab-0x0;var _0x4bb84b=_0x7f22[_0x1c4fab];return _0x4bb84b;};'use strict';var Sequelize=require(_0x27f2('0x0'));var _=require('lodash');module[_0x27f2('0x1')]={'body':{'type':Sequelize['TEXT'](_0x27f2('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x27f2('0x3')](_0x27f2('0x4'))},'read':{'type':Sequelize[_0x27f2('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x27f2('0x6')]('in',_0x27f2('0x7')),'defaultValue':_0x27f2('0x7'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x27f2('0x8')]},'to':{'type':Sequelize[_0x27f2('0x3')](_0x27f2('0x2'))},'cc':{'type':Sequelize[_0x27f2('0x3')](_0x27f2('0x2'))},'bcc':{'type':Sequelize[_0x27f2('0x3')](_0x27f2('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x27f2('0x9')]},'attach':{'type':Sequelize[_0x27f2('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x27f2('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x27f2('0x9')]},'originTo':{'type':Sequelize[_0x27f2('0x3')](_0x27f2('0x2'))},'originCc':{'type':Sequelize[_0x27f2('0x3')]('long')},'originChannel':{'type':Sequelize[_0x27f2('0x6')]('Email',_0x27f2('0xb')),'defaultValue':_0x27f2('0xc'),'allowNull':![]}};
\ No newline at end of file
index d2a27e8..60c4d10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdda6=['sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','find','body','params','describe','create','secret','split','MailAccount','findOne','CmList','List','CmContact','Contacts','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','basename','ListId','List\x20not\x20found','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','reject','MailInteractionId','role','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','server','files','root','message-%s.eml','from','bcc','subject','Attachment','createdAt','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','end'];(function(_0x2f5b74,_0x45adb8){var _0xe20c03=function(_0x25d126){while(--_0x25d126){_0x2f5b74['push'](_0x2f5b74['shift']());}};_0xe20c03(++_0x45adb8);}(_0xdda6,0x112));var _0x6dda=function(_0x593467,_0x14e615){_0x593467=_0x593467-0x0;var _0x67a71b=_0xdda6[_0x593467];return _0x67a71b;};'use strict';var emlformat=require(_0x6dda('0x0'));var moment=require(_0x6dda('0x1'));var BPromise=require(_0x6dda('0x2'));var util=require('util');var path=require(_0x6dda('0x3'));var fs=require('fs');var _=require(_0x6dda('0x4'));var Redis=require(_0x6dda('0x5'));var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6dda('0x6'));var interaction_log=require('../../config/logger')(_0x6dda('0x7'));var config=require(_0x6dda('0x8'));var db=require(_0x6dda('0x9'))['db'];config[_0x6dda('0xa')]=_[_0x6dda('0xb')](config[_0x6dda('0xa')],{'host':_0x6dda('0xc'),'port':0x18eb});var socket=require(_0x6dda('0xd'))(new Redis(config[_0x6dda('0xa')]));var htmlEntities=require(_0x6dda('0xe'));require(_0x6dda('0xf'))[_0x6dda('0x10')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x6dda('0x11')]['http']({'port':0x232b});var client9002=jayson[_0x6dda('0x11')][_0x6dda('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x2dc62c,_0xda473b,_0x4929f7,_0x319991){return new BPromise(function(_0x4a2a00,_0x2fe515){var _0x4649e8=_0x319991||client;return _0x4649e8['request'](_0x2dc62c,_0x4929f7)[_0x6dda('0x13')](function(_0xe47e87){logger[_0x6dda('0x14')](_0x6dda('0x15'),_0xda473b,_0x6dda('0x16'));logger[_0x6dda('0x17')](_0x6dda('0x18'),_0xda473b,'request\x20sent',JSON[_0x6dda('0x19')](_0xe47e87));if(_0xe47e87[_0x6dda('0x1a')]){if(_0xe47e87[_0x6dda('0x1a')]['code']===0x1f4){logger[_0x6dda('0x1a')](_0x6dda('0x15'),_0xda473b,_0xe47e87[_0x6dda('0x1a')][_0x6dda('0x1b')]);return _0x2fe515(_0xe47e87[_0x6dda('0x1a')][_0x6dda('0x1b')]);}logger['error'](_0x6dda('0x15'),_0xda473b,_0xe47e87[_0x6dda('0x1a')][_0x6dda('0x1b')]);return _0x4a2a00(_0xe47e87['error'][_0x6dda('0x1b')]);}else{logger[_0x6dda('0x14')](_0x6dda('0x15'),_0xda473b,'request\x20sent');_0x4a2a00(_0xe47e87[_0x6dda('0x1c')][_0x6dda('0x1b')]);}})[_0x6dda('0x1d')](function(_0x1b80be){logger[_0x6dda('0x1a')](_0x6dda('0x15'),_0xda473b,_0x1b80be);_0x2fe515(_0x1b80be);});});}function respondWithResult(_0x1eb4ff,_0x38980e){_0x38980e=_0x38980e||0xc8;return function(_0x38d352){if(_0x38d352){return _0x1eb4ff[_0x6dda('0x1e')](_0x38980e)[_0x6dda('0x1f')](_0x38d352);}};}function respondWithFilteredResult(_0x13389a,_0x49e9a6){return function(_0x2a852e){if(_0x2a852e){var _0x48f171=typeof _0x49e9a6[_0x6dda('0x20')]===_0x6dda('0x21')&&typeof _0x49e9a6[_0x6dda('0x22')]===_0x6dda('0x21');var _0x5d60ae=_0x2a852e['count'];var _0x1e934f=_0x48f171?0x0:_0x49e9a6[_0x6dda('0x20')];var _0x174509=_0x48f171?_0x2a852e[_0x6dda('0x23')]:_0x49e9a6[_0x6dda('0x20')]+_0x49e9a6[_0x6dda('0x22')];var _0x58944f;if(_0x174509>=_0x5d60ae){_0x174509=_0x5d60ae;_0x58944f=0xc8;}else{_0x58944f=0xce;}_0x13389a['status'](_0x58944f);return _0x13389a[_0x6dda('0x24')]('Content-Range',_0x1e934f+'-'+_0x174509+'/'+_0x5d60ae)[_0x6dda('0x1f')](_0x2a852e);}return null;};}function saveUpdates(_0x48dda6){return function(_0x2309ec){if(_0x2309ec){return _0x2309ec[_0x6dda('0x25')](_0x48dda6)[_0x6dda('0x13')](function(_0x4c01a2){return _0x4c01a2;});}return null;};}function removeEntity(_0x352b64){return function(_0x4e7c31){if(_0x4e7c31){return _0x4e7c31[_0x6dda('0x26')]()[_0x6dda('0x13')](function(){_0x352b64[_0x6dda('0x1e')](0xcc)[_0x6dda('0x27')]();});}};}function handleEntityNotFound(_0x18fdd8){return function(_0x5e66d6){if(!_0x5e66d6){_0x18fdd8[_0x6dda('0x28')](0x194);}return _0x5e66d6;};}function handleError(_0x5a3b56,_0x1213a5){_0x1213a5=_0x1213a5||0x1f4;return function(_0x3424c1){logger[_0x6dda('0x1a')](_0x3424c1[_0x6dda('0x29')]);if(_0x3424c1[_0x6dda('0x2a')]){delete _0x3424c1[_0x6dda('0x2a')];}_0x5a3b56['status'](_0x1213a5)[_0x6dda('0x2b')](_0x3424c1);};}exports[_0x6dda('0x2c')]=function(_0x3d5043,_0x233349){var _0x303cad={},_0x504a52={},_0x1451a9={'count':0x0,'rows':[]};var _0x358f0a=_[_0x6dda('0x2d')](db[_0x6dda('0x2e')][_0x6dda('0x2f')],function(_0x3ce31c){return{'name':_0x3ce31c['fieldName'],'type':_0x3ce31c[_0x6dda('0x30')][_0x6dda('0x31')]};});_0x504a52['model']=_[_0x6dda('0x2d')](_0x358f0a,_0x6dda('0x2a'));_0x504a52[_0x6dda('0x32')]=_[_0x6dda('0x33')](_0x3d5043[_0x6dda('0x32')]);_0x504a52[_0x6dda('0x34')]=_[_0x6dda('0x35')](_0x504a52[_0x6dda('0x36')],_0x504a52[_0x6dda('0x32')]);_0x303cad[_0x6dda('0x37')]=_['intersection'](_0x504a52[_0x6dda('0x36')],qs['fields'](_0x3d5043[_0x6dda('0x32')][_0x6dda('0x38')]));_0x303cad[_0x6dda('0x37')]=_0x303cad['attributes'][_0x6dda('0x39')]?_0x303cad['attributes']:_0x504a52[_0x6dda('0x36')];if(!_0x3d5043[_0x6dda('0x32')][_0x6dda('0x3a')](_0x6dda('0x3b'))){_0x303cad[_0x6dda('0x22')]=qs['limit'](_0x3d5043[_0x6dda('0x32')][_0x6dda('0x22')]);_0x303cad[_0x6dda('0x20')]=qs[_0x6dda('0x20')](_0x3d5043['query'][_0x6dda('0x20')]);}_0x303cad[_0x6dda('0x3c')]=qs[_0x6dda('0x3d')](_0x3d5043[_0x6dda('0x32')][_0x6dda('0x3d')]);_0x303cad['where']=qs[_0x6dda('0x34')](_['pick'](_0x3d5043[_0x6dda('0x32')],_0x504a52[_0x6dda('0x34')]),_0x358f0a);if(_0x3d5043[_0x6dda('0x32')][_0x6dda('0x3e')]){_0x303cad['where']=_[_0x6dda('0x3f')](_0x303cad[_0x6dda('0x40')],{'$or':_[_0x6dda('0x2d')](_0x358f0a,function(_0x1595c1){if(_0x1595c1[_0x6dda('0x30')]!==_0x6dda('0x41')){var _0x4e28fb={};_0x4e28fb[_0x1595c1[_0x6dda('0x2a')]]={'$like':'%'+_0x3d5043[_0x6dda('0x32')][_0x6dda('0x3e')]+'%'};return _0x4e28fb;}})});}_0x303cad=_['merge']({},_0x303cad,_0x3d5043[_0x6dda('0x42')]);var _0x3bafe2={'where':_0x303cad[_0x6dda('0x40')]};return db[_0x6dda('0x2e')]['count'](_0x3bafe2)[_0x6dda('0x13')](function(_0x31b03e){_0x1451a9[_0x6dda('0x23')]=_0x31b03e;if(_0x3d5043[_0x6dda('0x32')][_0x6dda('0x43')]){_0x303cad[_0x6dda('0x44')]=[{'all':!![]}];}return db[_0x6dda('0x2e')][_0x6dda('0x45')](_0x303cad);})[_0x6dda('0x13')](function(_0x9c261e){_0x1451a9[_0x6dda('0x46')]=_0x9c261e;return _0x1451a9;})[_0x6dda('0x13')](respondWithFilteredResult(_0x233349,_0x303cad))['catch'](handleError(_0x233349,null));};exports[_0x6dda('0x47')]=function(_0x5623d7,_0x38285e){var _0x21b2b4={'raw':!![],'where':{'id':_0x5623d7['params']['id']}},_0x363faf={};_0x363faf[_0x6dda('0x36')]=_[_0x6dda('0x33')](db[_0x6dda('0x2e')]['rawAttributes']);_0x363faf[_0x6dda('0x32')]=_['keys'](_0x5623d7[_0x6dda('0x32')]);_0x363faf[_0x6dda('0x34')]=_[_0x6dda('0x35')](_0x363faf[_0x6dda('0x36')],_0x363faf['query']);_0x21b2b4[_0x6dda('0x37')]=_[_0x6dda('0x35')](_0x363faf[_0x6dda('0x36')],qs['fields'](_0x5623d7[_0x6dda('0x32')][_0x6dda('0x38')]));_0x21b2b4[_0x6dda('0x37')]=_0x21b2b4[_0x6dda('0x37')]['length']?_0x21b2b4['attributes']:_0x363faf[_0x6dda('0x36')];if(_0x5623d7[_0x6dda('0x32')][_0x6dda('0x43')]){_0x21b2b4[_0x6dda('0x44')]=[{'all':!![]}];}_0x21b2b4=_[_0x6dda('0x3f')]({},_0x21b2b4,_0x5623d7['options']);return db[_0x6dda('0x2e')][_0x6dda('0x48')](_0x21b2b4)['then'](handleEntityNotFound(_0x38285e,null))[_0x6dda('0x13')](respondWithResult(_0x38285e,null))[_0x6dda('0x1d')](handleError(_0x38285e,null));};exports['update']=function(_0x338ce5,_0x82b369){if(_0x338ce5[_0x6dda('0x49')]['id']){delete _0x338ce5['body']['id'];}return db[_0x6dda('0x2e')]['find']({'where':{'id':_0x338ce5[_0x6dda('0x4a')]['id']}})[_0x6dda('0x13')](handleEntityNotFound(_0x82b369,null))[_0x6dda('0x13')](saveUpdates(_0x338ce5['body'],null))[_0x6dda('0x13')](respondWithResult(_0x82b369,null))[_0x6dda('0x1d')](handleError(_0x82b369,null));};exports['destroy']=function(_0x2aff0c,_0x495920){return db['MailMessage']['find']({'where':{'id':_0x2aff0c['params']['id']}})[_0x6dda('0x13')](handleEntityNotFound(_0x495920,null))[_0x6dda('0x13')](removeEntity(_0x495920,null))[_0x6dda('0x1d')](handleError(_0x495920,null));};exports[_0x6dda('0x4b')]=function(_0x43e9a3,_0x55cce8){return db[_0x6dda('0x2e')]['describe']()[_0x6dda('0x13')](respondWithResult(_0x55cce8,null))[_0x6dda('0x1d')](handleError(_0x55cce8,null));};exports[_0x6dda('0x4c')]=function(_0x2dc851,_0x50c2b8){return db[_0x6dda('0x2e')]['create'](_0x2dc851[_0x6dda('0x49')])[_0x6dda('0x13')](function(_0x20857f){if(_0x20857f){if(_0x20857f['direction']==='out'&&!_0x20857f[_0x6dda('0x4d')]){var _0x4e9bee,_0x21fd17,_0x401c66;if(_0x2dc851[_0x6dda('0x49')]['to']){_0x21fd17=_0x2dc851[_0x6dda('0x49')]['to'][_0x6dda('0x4e')](',')[0x0];}return db[_0x6dda('0x4f')][_0x6dda('0x50')]({'where':{'id':_0x20857f['MailAccountId']},'include':[{'model':db[_0x6dda('0x51')],'as':_0x6dda('0x52'),'include':[{'model':db[_0x6dda('0x53')],'as':_0x6dda('0x54'),'where':{'email':_0x21fd17},'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x6dda('0x55')],'as':_0x6dda('0x56'),'raw':!![],'include':[{'model':db[_0x6dda('0x57')],'as':_0x6dda('0x57'),'raw':!![]}]}]})[_0x6dda('0x13')](function(_0x54f91b){_0x4e9bee=_0x54f91b;if(!_0x4e9bee||!_0x4e9bee[_0x6dda('0x56')])return;var _0x32adef=_0x4e9bee[_0x6dda('0x58')]();if(_0x2dc851[_0x6dda('0x49')]['attachments']&&_0x2dc851[_0x6dda('0x49')][_0x6dda('0x59')]['length']){for(var _0x5c5dd1=0x0;_0x5c5dd1<_0x2dc851[_0x6dda('0x49')][_0x6dda('0x59')][_0x6dda('0x39')];_0x5c5dd1+=0x1){_0x2dc851[_0x6dda('0x49')][_0x6dda('0x59')][_0x5c5dd1]={'filename':_0x2dc851[_0x6dda('0x49')][_0x6dda('0x59')][_0x5c5dd1][_0x6dda('0x2a')],'path':path[_0x6dda('0x5a')](config['root'],'server/files/attachments',_0x2dc851[_0x6dda('0x49')][_0x6dda('0x59')][_0x5c5dd1][_0x6dda('0x5b')])};}}_0x401c66={'account':_0x32adef,'message':_0x2dc851[_0x6dda('0x49')]};return;})[_0x6dda('0x13')](function(){if(_0x4e9bee['List']){if(_0x4e9bee[_0x6dda('0x52')][_0x6dda('0x54')][_0x6dda('0x39')]){return _0x4e9bee[_0x6dda('0x52')][_0x6dda('0x54')][0x0];}else{return db[_0x6dda('0x53')][_0x6dda('0x4c')](_[_0x6dda('0xb')](_0x2dc851[_0x6dda('0x49')],{'firstName':_0x2dc851[_0x6dda('0x49')]['to'],'email':_0x2dc851[_0x6dda('0x49')]['to'],'phone':_0x2dc851[_0x6dda('0x49')]['to'],'ListId':_0x4e9bee[_0x6dda('0x5c')]}));}}else{throw new Error(_0x6dda('0x5d'));}})[_0x6dda('0x13')](function(){if(_0x401c66){return respondWithRpcPromise('SendMail','sendMail',_0x401c66,client9003)[_0x6dda('0x13')](function(_0x598d27){return _0x20857f[_0x6dda('0x25')]({'read':!![],'messageId':_0x598d27[_0x6dda('0x5e')],'sentAt':moment()[_0x6dda('0x5f')](_0x6dda('0x60'))});})[_0x6dda('0x1d')](function(_0x507729){logger[_0x6dda('0x1a')]('%s',JSON['stringify'](_0x507729));return _0x20857f;});}return _0x20857f;});}return _0x20857f;}})[_0x6dda('0x13')](respondWithResult(_0x50c2b8,0xc9))['catch'](handleError(_0x50c2b8,null));};exports[_0x6dda('0x61')]=function(_0x46a1e3,_0x299327){var _0x36aded={'agent':{},'channel':_0x6dda('0x62')};if(_0x46a1e3[_0x6dda('0x49')]['id']){delete _0x46a1e3[_0x6dda('0x49')]['id'];}_0x46a1e3[_0x6dda('0x49')][_0x6dda('0x63')]=!![];_0x46a1e3['body']['readAt']=moment()['format'](_0x6dda('0x60'));_0x46a1e3['body'][_0x6dda('0x64')]=_0x46a1e3['body'][_0x6dda('0x64')]||_0x46a1e3[_0x6dda('0x65')]['id'];_0x36aded[_0x6dda('0x66')]['id']=_0x46a1e3[_0x6dda('0x49')][_0x6dda('0x64')];return db[_0x6dda('0x2e')]['find']({'where':{'id':_0x46a1e3['params']['id'],'UserId':null}})[_0x6dda('0x13')](handleEntityNotFound(_0x299327,null))[_0x6dda('0x13')](saveUpdates(_0x46a1e3['body'],null))[_0x6dda('0x13')](function(_0x577d97){if(_0x577d97){_0x36aded[_0x6dda('0x1b')]=_0x577d97[_0x6dda('0x67')]({'plain':!![]});return db[_0x6dda('0x68')][_0x6dda('0x48')]({'where':{'id':_0x577d97['MailInteractionId']}});}return null;})[_0x6dda('0x13')](handleEntityNotFound(_0x299327,null))[_0x6dda('0x13')](function(_0x10baa2){if(_0x10baa2){return _0x10baa2[_0x6dda('0x25')]({'UserId':_0x46a1e3[_0x6dda('0x49')][_0x6dda('0x64')],'read1stAt':_[_0x6dda('0x69')](_0x10baa2[_0x6dda('0x6a')])?moment()[_0x6dda('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6dda('0x13')](function(_0x59b935){if(_0x59b935){_0x36aded['interaction']=_0x59b935[_0x6dda('0x67')]({'plain':!![]});interaction_log[_0x6dda('0x14')](_0x6dda('0x6b'),_0x46a1e3[_0x6dda('0x65')]['id'],_0x46a1e3[_0x6dda('0x65')][_0x6dda('0x2a')],_0x46a1e3['user']['role'],_0x36aded[_0x6dda('0x6c')]['id'],_0x46a1e3['body']?JSON[_0x6dda('0x19')](_0x46a1e3[_0x6dda('0x49')]):_0x6dda('0x6d'));return respondWithRpcPromise(_0x6dda('0x6e'),_0x6dda('0x6f'),_0x36aded);}return null;})[_0x6dda('0x13')](function(_0x2797d0){var _0x49065d=_0x6dda('0x70')+_0x2797d0[_0x6dda('0x1b')][_0x6dda('0x71')];return db[_0x6dda('0x72')][_0x6dda('0x32')](_0x49065d,{'type':db[_0x6dda('0x73')][_0x6dda('0x74')][_0x6dda('0x75')],'raw':!![]})[_0x6dda('0x13')](function(_0x24cff8){return _0x24cff8;});})[_0x6dda('0x13')](function(_0x3760b0){if(_0x3760b0){_0x36aded[_0x6dda('0x1b')][_0x6dda('0x76')]=_0x3760b0[0x0];if(!_0x46a1e3['body'][_0x6dda('0x64')])return;return db[_0x6dda('0x77')][_0x6dda('0x48')]({'where':{'id':_0x46a1e3[_0x6dda('0x49')][_0x6dda('0x64')],'role':'agent'},'attributes':['id',_0x6dda('0x2a'),_0x6dda('0x78'),_0x6dda('0x79'),_0x6dda('0x7a')],'raw':!![]});}return null;})['then'](function(_0x45c96a){if(!_0x45c96a)return null;_0x36aded[_0x6dda('0x1b')]['agent']=_0x45c96a;return _0x36aded;})[_0x6dda('0x13')](function(_0x1b41fa){if(_0x1b41fa){if(_0x46a1e3[_0x6dda('0x49')][_0x6dda('0x7b')]){_0x36aded[_0x6dda('0x1b')][_0x6dda('0x7c')]=util[_0x6dda('0x5f')](_0x6dda('0x7d'),_0x46a1e3[_0x6dda('0x65')][_0x6dda('0x2a')]);_0x36aded['message'][_0x6dda('0x7e')]=_0x36aded['channel'];_0x36aded[_0x6dda('0x1b')][_0x6dda('0x7f')]=_0x36aded[_0x6dda('0x7e')];_0x36aded[_0x6dda('0x1b')][_0x6dda('0x80')]='accept';_0x36aded['message'][_0x6dda('0x49')]=htmlToText['fromString'](_0x36aded[_0x6dda('0x1b')][_0x6dda('0x49')]);return respondWithRpcPromise(_0x6dda('0x81'),_0x6dda('0x81'),{'event':'acceptmessage','message':_0x36aded[_0x6dda('0x1b')]},client9002)['then'](function(){return _0x36aded;});}return _0x36aded;}return null;})[_0x6dda('0x13')](respondWithResult(_0x299327,null))[_0x6dda('0x1d')](handleError(_0x299327,null));};exports[_0x6dda('0x82')]=function(_0x1292a1,_0x3f833a){var _0x1d45e4={'agent':{},'channel':_0x6dda('0x62')};if(_0x1292a1['body']['id']){delete _0x1292a1[_0x6dda('0x49')]['id'];}_0x1292a1[_0x6dda('0x49')]['UserId']=_0x1292a1['body']['UserId']||_0x1292a1[_0x6dda('0x65')]['id'];_0x1d45e4[_0x6dda('0x66')]['id']=_0x1292a1[_0x6dda('0x49')][_0x6dda('0x64')];return db[_0x6dda('0x2e')][_0x6dda('0x48')]({'where':{'id':_0x1292a1['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3f833a,null))['then'](function(_0x57ff65){if(_0x57ff65){_0x1d45e4[_0x6dda('0x1b')]=_0x57ff65[_0x6dda('0x67')]({'plain':!![]});return db[_0x6dda('0x68')][_0x6dda('0x48')]({'where':{'id':_0x57ff65[_0x6dda('0x83')]}});}return null;})[_0x6dda('0x13')](handleEntityNotFound(_0x3f833a,null))['then'](function(_0x9dd847){if(_0x9dd847){_0x1d45e4[_0x6dda('0x6c')]=_0x9dd847['get']({'plain':!![]});interaction_log[_0x6dda('0x14')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1292a1[_0x6dda('0x65')]['id'],_0x1292a1['user'][_0x6dda('0x2a')],_0x1292a1[_0x6dda('0x65')][_0x6dda('0x84')],_0x1d45e4[_0x6dda('0x6c')]['id'],_0x1292a1[_0x6dda('0x49')]?JSON[_0x6dda('0x19')](_0x1292a1[_0x6dda('0x49')]):_0x6dda('0x6d'));return respondWithRpcPromise(_0x6dda('0x85'),_0x6dda('0x86'),_0x1d45e4);}return null;})[_0x6dda('0x13')](function(_0x4b3252){var _0x55cab3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4b3252[_0x6dda('0x1b')][_0x6dda('0x71')];return db[_0x6dda('0x72')]['query'](_0x55cab3,{'type':db[_0x6dda('0x73')][_0x6dda('0x74')]['SELECT'],'raw':!![]})[_0x6dda('0x13')](function(_0x3af536){return _0x3af536;});})[_0x6dda('0x13')](function(_0x21f3c4){if(_0x21f3c4){_0x1d45e4['message'][_0x6dda('0x76')]=_0x21f3c4[0x0];if(!_0x1292a1['body'][_0x6dda('0x64')])return;return db[_0x6dda('0x77')][_0x6dda('0x48')]({'where':{'id':_0x1292a1[_0x6dda('0x49')][_0x6dda('0x64')],'role':'agent'},'attributes':['id',_0x6dda('0x2a'),_0x6dda('0x78'),_0x6dda('0x79'),_0x6dda('0x7a')],'raw':!![]});}return null;})[_0x6dda('0x13')](function(_0x1602bd){if(!_0x1602bd)return null;_0x1d45e4[_0x6dda('0x1b')]['agent']=_0x1602bd;return _0x1d45e4;})[_0x6dda('0x13')](function(_0x326c3e){if(_0x326c3e){_0x326c3e[_0x6dda('0x1b')][_0x6dda('0x7c')]=util[_0x6dda('0x5f')](_0x6dda('0x7d'),_0x1292a1[_0x6dda('0x65')][_0x6dda('0x2a')]);_0x326c3e[_0x6dda('0x1b')]['channel']=_0x1d45e4['channel'];_0x326c3e[_0x6dda('0x1b')][_0x6dda('0x7f')]=_0x1d45e4['channel'];_0x326c3e[_0x6dda('0x1b')][_0x6dda('0x80')]='reject';_0x326c3e[_0x6dda('0x1b')][_0x6dda('0x49')]=htmlToText['fromString'](_0x1d45e4[_0x6dda('0x1b')]['body']);respondWithRpcPromise(_0x6dda('0x81'),_0x6dda('0x81'),{'event':_0x6dda('0x87'),'message':_0x326c3e[_0x6dda('0x1b')]},client9002);return _0x1d45e4;}return null;})['then'](respondWithResult(_0x3f833a,null))[_0x6dda('0x1d')](handleError(_0x3f833a,null));};exports[_0x6dda('0x88')]=function(_0x5e6ddc,_0x53a87e){var _0x21dee3=moment()[_0x6dda('0x89')]()[_0x6dda('0x8a')]();var _0x4fbc23=path[_0x6dda('0x5a')](config['root'],_0x6dda('0x8b'),_0x6dda('0x8c'),'tmp');var _0x32159d=path[_0x6dda('0x5a')](config[_0x6dda('0x8d')],_0x6dda('0x8b'),_0x6dda('0x8c'),'attachments');var _0xbc5eb1=util[_0x6dda('0x5f')](_0x6dda('0x8e'),_0x21dee3);return db[_0x6dda('0x2e')]['find']({'where':{'id':_0x5e6ddc[_0x6dda('0x4a')]['id']},'attributes':['id',_0x6dda('0x49'),_0x6dda('0x8f'),'to','cc',_0x6dda('0x90'),_0x6dda('0x91'),'createdAt'],'include':_0x5e6ddc['query'][_0x6dda('0x59')]?[{'model':db[_0x6dda('0x92')],'as':'Attachments'}]:undefined})[_0x6dda('0x13')](handleEntityNotFound(_0x53a87e,null))[_0x6dda('0x13')](function(_0x1692a9){if(_0x1692a9){var _0x2ad5d3=_0x1692a9;var _0x585f11={'from':_0x2ad5d3[_0x6dda('0x8f')],'to':_0x2ad5d3['to'],'subject':_0x2ad5d3[_0x6dda('0x91')],'html':htmlEntities['decode'](_0x2ad5d3['body']),'headers':{'Date':moment(_0x2ad5d3[_0x6dda('0x93')])[_0x6dda('0x5f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1692a9['cc']){_0x585f11[_0x6dda('0x94')]['Cc']=_0x1692a9['cc'];}if(_0x1692a9['bcc']){_0x585f11[_0x6dda('0x94')][_0x6dda('0x95')]=_0x1692a9['bcc'];}return new BPromise(function(_0xbc4c0,_0x2db24a){if(_0x1692a9[_0x6dda('0x96')]){for(var _0x13f152=0x0;_0x13f152<_0x1692a9[_0x6dda('0x96')]['length'];_0x13f152++){var _0xf6d976=_0x1692a9[_0x6dda('0x96')][_0x13f152];var _0x511ebc=path[_0x6dda('0x5a')](_0x32159d,_0xf6d976[_0x6dda('0x5b')]);if(fs[_0x6dda('0x97')](_0x511ebc)){_0x585f11[_0x6dda('0x59')][_0x6dda('0x98')]({'name':_0xf6d976[_0x6dda('0x2a')],'contentType':_0xf6d976[_0x6dda('0x30')],'data':fs[_0x6dda('0x99')](_0x511ebc)});}}}emlformat[_0x6dda('0x9a')](_0x585f11,function(_0x24ac1c,_0x26e8c5){if(_0x24ac1c)return _0x2db24a(_0x24ac1c);fs[_0x6dda('0x9b')](path['join'](_0x4fbc23,_0xbc5eb1),_0x26e8c5);return _0xbc4c0(_0x26e8c5);});});}})[_0x6dda('0x13')](function(_0x264b37){if(_0x264b37){return _0x53a87e[_0x6dda('0x88')](path[_0x6dda('0x5a')](_0x4fbc23,_0xbc5eb1),_0xbc5eb1,function(_0x291512){if(!_0x291512)fs[_0x6dda('0x9c')](path[_0x6dda('0x5a')](_0x4fbc23,_0xbc5eb1));});}})[_0x6dda('0x1d')](handleError(_0x53a87e,null));};
\ No newline at end of file
+var _0xc0b1=['code','message','info','result','status','json','offset','undefined','count','limit','Content-Range','update','destroy','end','sendStatus','stack','name','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','create','direction','out','secret','split','findOne','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','CmContact','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','readAt','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','fromString','EventManager','reject','mail','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SIP/%s','rejectmessage','download','join','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','./mailMessage.socket','jayson/promise','http','client','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xc0b1,0x88));var _0x1c0b=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0xc0b1[_0x256e32];return _0x464070;};'use strict';var emlformat=require(_0x1c0b('0x0'));var moment=require(_0x1c0b('0x1'));var BPromise=require(_0x1c0b('0x2'));var util=require('util');var path=require(_0x1c0b('0x3'));var fs=require('fs');var _=require(_0x1c0b('0x4'));var Redis=require(_0x1c0b('0x5'));var htmlToText=require('html-to-text');var qs=require(_0x1c0b('0x6'));var logger=require(_0x1c0b('0x7'))(_0x1c0b('0x8'));var interaction_log=require(_0x1c0b('0x7'))(_0x1c0b('0x9'));var config=require(_0x1c0b('0xa'));var db=require(_0x1c0b('0xb'))['db'];config[_0x1c0b('0xc')]=_[_0x1c0b('0xd')](config[_0x1c0b('0xc')],{'host':_0x1c0b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1c0b('0xc')]));var htmlEntities=require('html-entities');require(_0x1c0b('0xf'))['register'](socket);var jayson=require(_0x1c0b('0x10'));var client=jayson['client'][_0x1c0b('0x11')]({'port':0x232c});var client9003=jayson[_0x1c0b('0x12')][_0x1c0b('0x11')]({'port':0x232b});var client9002=jayson['client'][_0x1c0b('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x9b492d,_0x57ca19,_0x237c56,_0x14bd39){return new BPromise(function(_0x58ccdb,_0x1ca828){var _0x3bad1e=_0x14bd39||client;return _0x3bad1e[_0x1c0b('0x13')](_0x9b492d,_0x237c56)[_0x1c0b('0x14')](function(_0x459de5){logger['info'](_0x1c0b('0x15'),_0x57ca19,_0x1c0b('0x16'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x57ca19,_0x1c0b('0x16'),JSON[_0x1c0b('0x17')](_0x459de5));if(_0x459de5[_0x1c0b('0x18')]){if(_0x459de5[_0x1c0b('0x18')][_0x1c0b('0x19')]===0x1f4){logger[_0x1c0b('0x18')](_0x1c0b('0x15'),_0x57ca19,_0x459de5[_0x1c0b('0x18')]['message']);return _0x1ca828(_0x459de5[_0x1c0b('0x18')]['message']);}logger[_0x1c0b('0x18')](_0x1c0b('0x15'),_0x57ca19,_0x459de5['error'][_0x1c0b('0x1a')]);return _0x58ccdb(_0x459de5['error'][_0x1c0b('0x1a')]);}else{logger[_0x1c0b('0x1b')](_0x1c0b('0x15'),_0x57ca19,_0x1c0b('0x16'));_0x58ccdb(_0x459de5[_0x1c0b('0x1c')]['message']);}})['catch'](function(_0x565393){logger[_0x1c0b('0x18')](_0x1c0b('0x15'),_0x57ca19,_0x565393);_0x1ca828(_0x565393);});});}function respondWithResult(_0x3e08e5,_0x40d09e){_0x40d09e=_0x40d09e||0xc8;return function(_0x2cbe48){if(_0x2cbe48){return _0x3e08e5[_0x1c0b('0x1d')](_0x40d09e)[_0x1c0b('0x1e')](_0x2cbe48);}};}function respondWithFilteredResult(_0x3dcc24,_0x3f197f){return function(_0x398e4a){if(_0x398e4a){var _0x11c328=typeof _0x3f197f[_0x1c0b('0x1f')]==='undefined'&&typeof _0x3f197f['limit']===_0x1c0b('0x20');var _0x37ada0=_0x398e4a[_0x1c0b('0x21')];var _0x31b463=_0x11c328?0x0:_0x3f197f[_0x1c0b('0x1f')];var _0x11894b=_0x11c328?_0x398e4a[_0x1c0b('0x21')]:_0x3f197f[_0x1c0b('0x1f')]+_0x3f197f[_0x1c0b('0x22')];var _0x33aeb8;if(_0x11894b>=_0x37ada0){_0x11894b=_0x37ada0;_0x33aeb8=0xc8;}else{_0x33aeb8=0xce;}_0x3dcc24[_0x1c0b('0x1d')](_0x33aeb8);return _0x3dcc24['set'](_0x1c0b('0x23'),_0x31b463+'-'+_0x11894b+'/'+_0x37ada0)[_0x1c0b('0x1e')](_0x398e4a);}return null;};}function saveUpdates(_0x109645){return function(_0x539ddc){if(_0x539ddc){return _0x539ddc[_0x1c0b('0x24')](_0x109645)[_0x1c0b('0x14')](function(_0x34ac7d){return _0x34ac7d;});}return null;};}function removeEntity(_0x5a7cc7){return function(_0x5a899b){if(_0x5a899b){return _0x5a899b[_0x1c0b('0x25')]()[_0x1c0b('0x14')](function(){_0x5a7cc7[_0x1c0b('0x1d')](0xcc)[_0x1c0b('0x26')]();});}};}function handleEntityNotFound(_0x53c90a){return function(_0x448230){if(!_0x448230){_0x53c90a[_0x1c0b('0x27')](0x194);}return _0x448230;};}function handleError(_0x11b76b,_0x26d7b2){_0x26d7b2=_0x26d7b2||0x1f4;return function(_0x1f7d88){logger[_0x1c0b('0x18')](_0x1f7d88[_0x1c0b('0x28')]);if(_0x1f7d88[_0x1c0b('0x29')]){delete _0x1f7d88[_0x1c0b('0x29')];}_0x11b76b['status'](_0x26d7b2)['send'](_0x1f7d88);};}exports['index']=function(_0xadf6b9,_0x36a867){var _0x2882ca={},_0x1e8bf7={},_0x500b64={'count':0x0,'rows':[]};var _0x5943d1=_[_0x1c0b('0x2a')](db[_0x1c0b('0x2b')][_0x1c0b('0x2c')],function(_0xcace2){return{'name':_0xcace2[_0x1c0b('0x2d')],'type':_0xcace2[_0x1c0b('0x2e')][_0x1c0b('0x2f')]};});_0x1e8bf7[_0x1c0b('0x30')]=_['map'](_0x5943d1,'name');_0x1e8bf7[_0x1c0b('0x31')]=_[_0x1c0b('0x32')](_0xadf6b9[_0x1c0b('0x31')]);_0x1e8bf7['filters']=_[_0x1c0b('0x33')](_0x1e8bf7[_0x1c0b('0x30')],_0x1e8bf7[_0x1c0b('0x31')]);_0x2882ca[_0x1c0b('0x34')]=_[_0x1c0b('0x33')](_0x1e8bf7[_0x1c0b('0x30')],qs[_0x1c0b('0x35')](_0xadf6b9['query'][_0x1c0b('0x35')]));_0x2882ca['attributes']=_0x2882ca['attributes'][_0x1c0b('0x36')]?_0x2882ca[_0x1c0b('0x34')]:_0x1e8bf7[_0x1c0b('0x30')];if(!_0xadf6b9[_0x1c0b('0x31')]['hasOwnProperty'](_0x1c0b('0x37'))){_0x2882ca[_0x1c0b('0x22')]=qs[_0x1c0b('0x22')](_0xadf6b9[_0x1c0b('0x31')][_0x1c0b('0x22')]);_0x2882ca[_0x1c0b('0x1f')]=qs[_0x1c0b('0x1f')](_0xadf6b9[_0x1c0b('0x31')]['offset']);}_0x2882ca['order']=qs[_0x1c0b('0x38')](_0xadf6b9['query'][_0x1c0b('0x38')]);_0x2882ca[_0x1c0b('0x39')]=qs[_0x1c0b('0x3a')](_[_0x1c0b('0x3b')](_0xadf6b9[_0x1c0b('0x31')],_0x1e8bf7[_0x1c0b('0x3a')]),_0x5943d1);if(_0xadf6b9['query'][_0x1c0b('0x3c')]){_0x2882ca[_0x1c0b('0x39')]=_[_0x1c0b('0x3d')](_0x2882ca['where'],{'$or':_[_0x1c0b('0x2a')](_0x5943d1,function(_0x3444ba){if(_0x3444ba[_0x1c0b('0x2e')]!==_0x1c0b('0x3e')){var _0x13a3cb={};_0x13a3cb[_0x3444ba['name']]={'$like':'%'+_0xadf6b9['query'][_0x1c0b('0x3c')]+'%'};return _0x13a3cb;}})});}_0x2882ca=_['merge']({},_0x2882ca,_0xadf6b9[_0x1c0b('0x3f')]);var _0x51a608={'where':_0x2882ca[_0x1c0b('0x39')]};return db[_0x1c0b('0x2b')][_0x1c0b('0x21')](_0x51a608)[_0x1c0b('0x14')](function(_0x3408e0){_0x500b64[_0x1c0b('0x21')]=_0x3408e0;if(_0xadf6b9[_0x1c0b('0x31')][_0x1c0b('0x40')]){_0x2882ca[_0x1c0b('0x41')]=[{'all':!![]}];}return db['MailMessage'][_0x1c0b('0x42')](_0x2882ca);})[_0x1c0b('0x14')](function(_0x1f0151){_0x500b64[_0x1c0b('0x43')]=_0x1f0151;return _0x500b64;})[_0x1c0b('0x14')](respondWithFilteredResult(_0x36a867,_0x2882ca))['catch'](handleError(_0x36a867,null));};exports[_0x1c0b('0x44')]=function(_0x546041,_0x3e6663){var _0x309f6f={'raw':!![],'where':{'id':_0x546041[_0x1c0b('0x45')]['id']}},_0x57586f={};_0x57586f[_0x1c0b('0x30')]=_[_0x1c0b('0x32')](db[_0x1c0b('0x2b')][_0x1c0b('0x2c')]);_0x57586f[_0x1c0b('0x31')]=_[_0x1c0b('0x32')](_0x546041['query']);_0x57586f[_0x1c0b('0x3a')]=_['intersection'](_0x57586f[_0x1c0b('0x30')],_0x57586f[_0x1c0b('0x31')]);_0x309f6f[_0x1c0b('0x34')]=_[_0x1c0b('0x33')](_0x57586f[_0x1c0b('0x30')],qs['fields'](_0x546041[_0x1c0b('0x31')][_0x1c0b('0x35')]));_0x309f6f[_0x1c0b('0x34')]=_0x309f6f[_0x1c0b('0x34')][_0x1c0b('0x36')]?_0x309f6f[_0x1c0b('0x34')]:_0x57586f[_0x1c0b('0x30')];if(_0x546041[_0x1c0b('0x31')][_0x1c0b('0x40')]){_0x309f6f[_0x1c0b('0x41')]=[{'all':!![]}];}_0x309f6f=_['merge']({},_0x309f6f,_0x546041[_0x1c0b('0x3f')]);return db[_0x1c0b('0x2b')][_0x1c0b('0x46')](_0x309f6f)['then'](handleEntityNotFound(_0x3e6663,null))[_0x1c0b('0x14')](respondWithResult(_0x3e6663,null))[_0x1c0b('0x47')](handleError(_0x3e6663,null));};exports['update']=function(_0x594c13,_0x18ba8c){if(_0x594c13[_0x1c0b('0x48')]['id']){delete _0x594c13[_0x1c0b('0x48')]['id'];}return db[_0x1c0b('0x2b')]['find']({'where':{'id':_0x594c13[_0x1c0b('0x45')]['id']}})['then'](handleEntityNotFound(_0x18ba8c,null))['then'](saveUpdates(_0x594c13['body'],null))[_0x1c0b('0x14')](respondWithResult(_0x18ba8c,null))[_0x1c0b('0x47')](handleError(_0x18ba8c,null));};exports['destroy']=function(_0x3e4702,_0x5210fd){return db[_0x1c0b('0x2b')][_0x1c0b('0x46')]({'where':{'id':_0x3e4702[_0x1c0b('0x45')]['id']}})[_0x1c0b('0x14')](handleEntityNotFound(_0x5210fd,null))[_0x1c0b('0x14')](removeEntity(_0x5210fd,null))[_0x1c0b('0x47')](handleError(_0x5210fd,null));};exports[_0x1c0b('0x49')]=function(_0x393936,_0x1c3d71){return db[_0x1c0b('0x2b')][_0x1c0b('0x49')]()[_0x1c0b('0x14')](respondWithResult(_0x1c3d71,null))['catch'](handleError(_0x1c3d71,null));};exports['create']=function(_0x37a85c,_0x1f43b3){return db[_0x1c0b('0x2b')][_0x1c0b('0x4a')](_0x37a85c[_0x1c0b('0x48')])['then'](function(_0xc4f248){if(_0xc4f248){if(_0xc4f248[_0x1c0b('0x4b')]===_0x1c0b('0x4c')&&!_0xc4f248[_0x1c0b('0x4d')]){var _0x20e49a,_0x4285be,_0x2d2122;if(_0x37a85c['body']['to']){_0x4285be=_0x37a85c[_0x1c0b('0x48')]['to'][_0x1c0b('0x4e')](',')[0x0];}return db['MailAccount'][_0x1c0b('0x4f')]({'where':{'id':_0xc4f248['MailAccountId']},'include':[{'model':db[_0x1c0b('0x50')],'as':_0x1c0b('0x51'),'include':[{'model':db['CmContact'],'as':_0x1c0b('0x52'),'where':{'email':_0x4285be},'limit':0x1,'order':[[_0x1c0b('0x53'),_0x1c0b('0x54')]]}]},{'model':db[_0x1c0b('0x55')],'as':_0x1c0b('0x56'),'raw':!![],'include':[{'model':db[_0x1c0b('0x57')],'as':_0x1c0b('0x57'),'raw':!![]}]}]})[_0x1c0b('0x14')](function(_0xa7bde6){_0x20e49a=_0xa7bde6;if(!_0x20e49a||!_0x20e49a[_0x1c0b('0x56')])return;var _0x267573=_0x20e49a[_0x1c0b('0x58')]();if(_0x37a85c[_0x1c0b('0x48')][_0x1c0b('0x59')]&&_0x37a85c[_0x1c0b('0x48')][_0x1c0b('0x59')][_0x1c0b('0x36')]){for(var _0x15e940=0x0;_0x15e940<_0x37a85c['body'][_0x1c0b('0x59')][_0x1c0b('0x36')];_0x15e940+=0x1){_0x37a85c[_0x1c0b('0x48')][_0x1c0b('0x59')][_0x15e940]={'filename':_0x37a85c[_0x1c0b('0x48')]['attachments'][_0x15e940][_0x1c0b('0x29')],'path':path['join'](config[_0x1c0b('0x5a')],_0x1c0b('0x5b'),_0x37a85c['body']['attachments'][_0x15e940][_0x1c0b('0x5c')])};}}_0x2d2122={'account':_0x267573,'message':_0x37a85c[_0x1c0b('0x48')]};return;})[_0x1c0b('0x14')](function(){if(_0x20e49a[_0x1c0b('0x51')]){if(_0x20e49a[_0x1c0b('0x51')][_0x1c0b('0x52')][_0x1c0b('0x36')]){return _0x20e49a[_0x1c0b('0x51')][_0x1c0b('0x52')][0x0];}else{return db[_0x1c0b('0x5d')][_0x1c0b('0x4a')](_[_0x1c0b('0xd')](_0x37a85c['body'],{'firstName':_0x37a85c['body']['to'],'email':_0x37a85c['body']['to'],'phone':_0x37a85c[_0x1c0b('0x48')]['to'],'ListId':_0x20e49a[_0x1c0b('0x5e')]}));}}else{throw new Error(_0x1c0b('0x5f'));}})['then'](function(){if(_0x2d2122){return respondWithRpcPromise(_0x1c0b('0x60'),'sendMail',_0x2d2122,client9003)[_0x1c0b('0x14')](function(_0x3b25c0){return _0xc4f248[_0x1c0b('0x24')]({'read':!![],'messageId':_0x3b25c0[_0x1c0b('0x61')],'sentAt':moment()[_0x1c0b('0x62')](_0x1c0b('0x63'))});})[_0x1c0b('0x47')](function(_0x57b475){logger[_0x1c0b('0x18')]('%s',JSON[_0x1c0b('0x17')](_0x57b475));return _0xc4f248;});}return _0xc4f248;});}return _0xc4f248;}})[_0x1c0b('0x14')](respondWithResult(_0x1f43b3,0xc9))[_0x1c0b('0x47')](handleError(_0x1f43b3,null));};exports[_0x1c0b('0x64')]=function(_0x1115dc,_0x317e8f){var _0x1bb5e7={'agent':{},'channel':'mail'};if(_0x1115dc['body']['id']){delete _0x1115dc[_0x1c0b('0x48')]['id'];}_0x1115dc[_0x1c0b('0x48')]['read']=!![];_0x1115dc['body'][_0x1c0b('0x65')]=moment()[_0x1c0b('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x1115dc['body'][_0x1c0b('0x66')]=_0x1115dc['body'][_0x1c0b('0x66')]||_0x1115dc[_0x1c0b('0x67')]['id'];_0x1bb5e7[_0x1c0b('0x68')]['id']=_0x1115dc['body'][_0x1c0b('0x66')];return db[_0x1c0b('0x2b')][_0x1c0b('0x46')]({'where':{'id':_0x1115dc[_0x1c0b('0x45')]['id'],'UserId':null}})[_0x1c0b('0x14')](handleEntityNotFound(_0x317e8f,null))[_0x1c0b('0x14')](saveUpdates(_0x1115dc[_0x1c0b('0x48')],null))['then'](function(_0x28dad6){if(_0x28dad6){_0x1bb5e7[_0x1c0b('0x1a')]=_0x28dad6[_0x1c0b('0x69')]({'plain':!![]});return db[_0x1c0b('0x6a')][_0x1c0b('0x46')]({'where':{'id':_0x28dad6[_0x1c0b('0x6b')]}});}return null;})[_0x1c0b('0x14')](handleEntityNotFound(_0x317e8f,null))[_0x1c0b('0x14')](function(_0x53887e){if(_0x53887e){return _0x53887e[_0x1c0b('0x24')]({'UserId':_0x1115dc[_0x1c0b('0x48')]['UserId'],'read1stAt':_[_0x1c0b('0x6c')](_0x53887e[_0x1c0b('0x6d')])?moment()[_0x1c0b('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5cd1c3){if(_0x5cd1c3){_0x1bb5e7[_0x1c0b('0x6e')]=_0x5cd1c3[_0x1c0b('0x69')]({'plain':!![]});interaction_log[_0x1c0b('0x1b')](_0x1c0b('0x6f'),_0x1115dc[_0x1c0b('0x67')]['id'],_0x1115dc[_0x1c0b('0x67')][_0x1c0b('0x29')],_0x1115dc['user'][_0x1c0b('0x70')],_0x1bb5e7[_0x1c0b('0x6e')]['id'],_0x1115dc['body']?JSON[_0x1c0b('0x17')](_0x1115dc[_0x1c0b('0x48')]):_0x1c0b('0x71'));return respondWithRpcPromise(_0x1c0b('0x72'),_0x1c0b('0x73'),_0x1bb5e7);}return null;})['then'](function(_0xfe891f){var _0x12009d='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xfe891f[_0x1c0b('0x1a')][_0x1c0b('0x74')];return db['sequelize'][_0x1c0b('0x31')](_0x12009d,{'type':db[_0x1c0b('0x75')][_0x1c0b('0x76')][_0x1c0b('0x77')],'raw':!![]})[_0x1c0b('0x14')](function(_0x1b8753){return _0x1b8753;});})[_0x1c0b('0x14')](function(_0x403ad5){if(_0x403ad5){_0x1bb5e7[_0x1c0b('0x1a')][_0x1c0b('0x78')]=_0x403ad5[0x0];if(!_0x1115dc[_0x1c0b('0x48')]['UserId'])return;return db[_0x1c0b('0x79')][_0x1c0b('0x46')]({'where':{'id':_0x1115dc[_0x1c0b('0x48')][_0x1c0b('0x66')],'role':_0x1c0b('0x68')},'attributes':['id','name',_0x1c0b('0x7a'),_0x1c0b('0x7b'),_0x1c0b('0x7c')],'raw':!![]});}return null;})[_0x1c0b('0x14')](function(_0x1f48d6){if(!_0x1f48d6)return null;_0x1bb5e7[_0x1c0b('0x1a')]['agent']=_0x1f48d6;return _0x1bb5e7;})[_0x1c0b('0x14')](function(_0x485d27){if(_0x485d27){if(_0x1115dc[_0x1c0b('0x48')][_0x1c0b('0x7d')]){_0x1bb5e7[_0x1c0b('0x1a')][_0x1c0b('0x7e')]=util[_0x1c0b('0x62')]('SIP/%s',_0x1115dc[_0x1c0b('0x67')][_0x1c0b('0x29')]);_0x1bb5e7['message'][_0x1c0b('0x7f')]=_0x1bb5e7[_0x1c0b('0x7f')];_0x1bb5e7[_0x1c0b('0x1a')][_0x1c0b('0x80')]=_0x1bb5e7[_0x1c0b('0x7f')];_0x1bb5e7[_0x1c0b('0x1a')][_0x1c0b('0x81')]=_0x1c0b('0x64');_0x1bb5e7['message'][_0x1c0b('0x48')]=htmlToText[_0x1c0b('0x82')](_0x1bb5e7[_0x1c0b('0x1a')][_0x1c0b('0x48')]);return respondWithRpcPromise(_0x1c0b('0x83'),_0x1c0b('0x83'),{'event':'acceptmessage','message':_0x1bb5e7[_0x1c0b('0x1a')]},client9002)[_0x1c0b('0x14')](function(){return _0x1bb5e7;});}return _0x1bb5e7;}return null;})['then'](respondWithResult(_0x317e8f,null))[_0x1c0b('0x47')](handleError(_0x317e8f,null));};exports[_0x1c0b('0x84')]=function(_0x35ec72,_0x5d33a7){var _0x5eef45={'agent':{},'channel':_0x1c0b('0x85')};if(_0x35ec72[_0x1c0b('0x48')]['id']){delete _0x35ec72[_0x1c0b('0x48')]['id'];}_0x35ec72[_0x1c0b('0x48')][_0x1c0b('0x66')]=_0x35ec72['body'][_0x1c0b('0x66')]||_0x35ec72['user']['id'];_0x5eef45[_0x1c0b('0x68')]['id']=_0x35ec72['body']['UserId'];return db[_0x1c0b('0x2b')]['find']({'where':{'id':_0x35ec72['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5d33a7,null))[_0x1c0b('0x14')](function(_0x1c3250){if(_0x1c3250){_0x5eef45['message']=_0x1c3250[_0x1c0b('0x69')]({'plain':!![]});return db[_0x1c0b('0x6a')][_0x1c0b('0x46')]({'where':{'id':_0x1c3250[_0x1c0b('0x6b')]}});}return null;})[_0x1c0b('0x14')](handleEntityNotFound(_0x5d33a7,null))[_0x1c0b('0x14')](function(_0x542452){if(_0x542452){_0x5eef45[_0x1c0b('0x6e')]=_0x542452[_0x1c0b('0x69')]({'plain':!![]});interaction_log[_0x1c0b('0x1b')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x35ec72[_0x1c0b('0x67')]['id'],_0x35ec72[_0x1c0b('0x67')][_0x1c0b('0x29')],_0x35ec72['user']['role'],_0x5eef45[_0x1c0b('0x6e')]['id'],_0x35ec72['body']?JSON['stringify'](_0x35ec72[_0x1c0b('0x48')]):_0x1c0b('0x71'));return respondWithRpcPromise(_0x1c0b('0x86'),_0x1c0b('0x87'),_0x5eef45);}return null;})[_0x1c0b('0x14')](function(_0x3a5050){var _0x51bfcc=_0x1c0b('0x88')+_0x3a5050[_0x1c0b('0x1a')][_0x1c0b('0x74')];return db[_0x1c0b('0x89')]['query'](_0x51bfcc,{'type':db['Sequelize']['QueryTypes'][_0x1c0b('0x77')],'raw':!![]})[_0x1c0b('0x14')](function(_0x5dca1f){return _0x5dca1f;});})[_0x1c0b('0x14')](function(_0x4fca10){if(_0x4fca10){_0x5eef45[_0x1c0b('0x1a')][_0x1c0b('0x78')]=_0x4fca10[0x0];if(!_0x35ec72[_0x1c0b('0x48')][_0x1c0b('0x66')])return;return db['User'][_0x1c0b('0x46')]({'where':{'id':_0x35ec72[_0x1c0b('0x48')][_0x1c0b('0x66')],'role':_0x1c0b('0x68')},'attributes':['id','name',_0x1c0b('0x7a'),'email',_0x1c0b('0x7c')],'raw':!![]});}return null;})['then'](function(_0x4093b5){if(!_0x4093b5)return null;_0x5eef45[_0x1c0b('0x1a')][_0x1c0b('0x68')]=_0x4093b5;return _0x5eef45;})[_0x1c0b('0x14')](function(_0x24020c){if(_0x24020c){_0x24020c[_0x1c0b('0x1a')][_0x1c0b('0x7e')]=util[_0x1c0b('0x62')](_0x1c0b('0x8a'),_0x35ec72[_0x1c0b('0x67')]['name']);_0x24020c[_0x1c0b('0x1a')][_0x1c0b('0x7f')]=_0x5eef45[_0x1c0b('0x7f')];_0x24020c['message'][_0x1c0b('0x80')]=_0x5eef45[_0x1c0b('0x7f')];_0x24020c['message'][_0x1c0b('0x81')]='reject';_0x24020c[_0x1c0b('0x1a')][_0x1c0b('0x48')]=htmlToText['fromString'](_0x5eef45[_0x1c0b('0x1a')][_0x1c0b('0x48')]);respondWithRpcPromise(_0x1c0b('0x83'),_0x1c0b('0x83'),{'event':_0x1c0b('0x8b'),'message':_0x24020c[_0x1c0b('0x1a')]},client9002);return _0x5eef45;}return null;})[_0x1c0b('0x14')](respondWithResult(_0x5d33a7,null))[_0x1c0b('0x47')](handleError(_0x5d33a7,null));};exports[_0x1c0b('0x8c')]=function(_0x23b973,_0xb58ec7){var _0x14b33f=moment()['unix']()['toString']();var _0x411a32=path[_0x1c0b('0x8d')](config[_0x1c0b('0x5a')],_0x1c0b('0x8e'),_0x1c0b('0x8f'),_0x1c0b('0x90'));var _0x31c271=path[_0x1c0b('0x8d')](config[_0x1c0b('0x5a')],_0x1c0b('0x8e'),_0x1c0b('0x8f'),_0x1c0b('0x59'));var _0x24fdb4=util[_0x1c0b('0x62')](_0x1c0b('0x91'),_0x14b33f);return db['MailMessage'][_0x1c0b('0x46')]({'where':{'id':_0x23b973[_0x1c0b('0x45')]['id']},'attributes':['id',_0x1c0b('0x48'),_0x1c0b('0x92'),'to','cc',_0x1c0b('0x93'),_0x1c0b('0x94'),_0x1c0b('0x95')],'include':_0x23b973[_0x1c0b('0x31')][_0x1c0b('0x59')]?[{'model':db['Attachment'],'as':_0x1c0b('0x96')}]:undefined})['then'](handleEntityNotFound(_0xb58ec7,null))[_0x1c0b('0x14')](function(_0x9e0cc1){if(_0x9e0cc1){var _0x2941d7=_0x9e0cc1;var _0x414950={'from':_0x2941d7[_0x1c0b('0x92')],'to':_0x2941d7['to'],'subject':_0x2941d7['subject'],'html':htmlEntities[_0x1c0b('0x97')](_0x2941d7[_0x1c0b('0x48')]),'headers':{'Date':moment(_0x2941d7[_0x1c0b('0x95')])[_0x1c0b('0x62')](_0x1c0b('0x98'))},'attachments':[]};if(_0x9e0cc1['cc']){_0x414950[_0x1c0b('0x99')]['Cc']=_0x9e0cc1['cc'];}if(_0x9e0cc1['bcc']){_0x414950['headers'][_0x1c0b('0x9a')]=_0x9e0cc1[_0x1c0b('0x93')];}return new BPromise(function(_0x438798,_0xec49d2){if(_0x9e0cc1['Attachments']){for(var _0x3b38dc=0x0;_0x3b38dc<_0x9e0cc1[_0x1c0b('0x96')][_0x1c0b('0x36')];_0x3b38dc++){var _0x5af022=_0x9e0cc1[_0x1c0b('0x96')][_0x3b38dc];var _0x182e1d=path[_0x1c0b('0x8d')](_0x31c271,_0x5af022[_0x1c0b('0x5c')]);if(fs[_0x1c0b('0x9b')](_0x182e1d)){_0x414950[_0x1c0b('0x59')][_0x1c0b('0x9c')]({'name':_0x5af022[_0x1c0b('0x29')],'contentType':_0x5af022[_0x1c0b('0x2e')],'data':fs[_0x1c0b('0x9d')](_0x182e1d)});}}}emlformat[_0x1c0b('0x9e')](_0x414950,function(_0x5891ad,_0x143686){if(_0x5891ad)return _0xec49d2(_0x5891ad);fs[_0x1c0b('0x9f')](path[_0x1c0b('0x8d')](_0x411a32,_0x24fdb4),_0x143686);return _0x438798(_0x143686);});});}})[_0x1c0b('0x14')](function(_0x2da27b){if(_0x2da27b){return _0xb58ec7[_0x1c0b('0x8c')](path[_0x1c0b('0x8d')](_0x411a32,_0x24fdb4),_0x24fdb4,function(_0x45832b){if(!_0x45832b)fs[_0x1c0b('0xa0')](path['join'](_0x411a32,_0x24fdb4));});}})[_0x1c0b('0x47')](handleError(_0xb58ec7,null));};
\ No newline at end of file
index 0c40898..133d59a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cee=['hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','emit'];(function(_0x1aa4f2,_0xccd8e){var _0x4172bb=function(_0x19c5ff){while(--_0x19c5ff){_0x1aa4f2['push'](_0x1aa4f2['shift']());}};_0x4172bb(++_0xccd8e);}(_0x2cee,0x7a));var _0xe2ce=function(_0x11058a,_0x4bfa7a){_0x11058a=_0x11058a-0x0;var _0x236e83=_0x2cee[_0x11058a];return _0x236e83;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0xe2ce('0x0'))['db'][_0xe2ce('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xe2ce('0x2')](0x0);var events={'afterCreate':_0xe2ce('0x3'),'afterUpdate':_0xe2ce('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35e359){return function(_0x463a5d,_0x486267,_0x40a5b6){MailMessageEvents[_0xe2ce('0x5')](_0x35e359+':'+_0x463a5d['id'],_0x463a5d);MailMessageEvents[_0xe2ce('0x5')](_0x35e359,_0x463a5d);_0x40a5b6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xe2ce('0x6')](e,emitEvent(event));}}module[_0xe2ce('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0x1edd=['remove','emit','hasOwnProperty','hook','exports','events','save','update'];(function(_0x2a3c2e,_0x26255b){var _0x1f6c6c=function(_0x224740){while(--_0x224740){_0x2a3c2e['push'](_0x2a3c2e['shift']());}};_0x1f6c6c(++_0x26255b);}(_0x1edd,0xd5));var _0xd1ed=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0x1edd[_0xea343d];return _0x2c6e9c;};'use strict';var EventEmitter=require(_0xd1ed('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd1ed('0x1'),'afterUpdate':_0xd1ed('0x2'),'afterDestroy':_0xd1ed('0x3')};function emitEvent(_0x2701c5){return function(_0x5a2038,_0x49a3c7,_0x5a4b57){MailMessageEvents[_0xd1ed('0x4')](_0x2701c5+':'+_0x5a2038['id'],_0x5a2038);MailMessageEvents[_0xd1ed('0x4')](_0x2701c5,_0x5a2038);_0x5a4b57(null);};}for(var e in events){if(events[_0xd1ed('0x5')](e)){var event=events[e];MailMessage[_0xd1ed('0x6')](e,emitEvent(event));}}module[_0xd1ed('0x7')]=MailMessageEvents;
\ No newline at end of file
index 137dd3d..2ee348b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bc0=['mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','models','get','direction','toLowerCase','out','UserId','MailInteraction','findOne','MailInteractionId','then','update','error','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','MailMessage'];(function(_0x388caa,_0x7bc7b8){var _0x5ecbe6=function(_0x4b96e5){while(--_0x4b96e5){_0x388caa['push'](_0x388caa['shift']());}};_0x5ecbe6(++_0x7bc7b8);}(_0x9bc0,0x119));var _0x09bc=function(_0x400583,_0x2e4697){_0x400583=_0x400583-0x0;var _0xf3d9c9=_0x9bc0[_0x400583];return _0xf3d9c9;};'use strict';var _=require('lodash');var util=require(_0x09bc('0x0'));var logger=require(_0x09bc('0x1'))(_0x09bc('0x2'));var moment=require(_0x09bc('0x3'));var BPromise=require(_0x09bc('0x4'));var rp=require(_0x09bc('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x09bc('0x6'));var config=require(_0x09bc('0x7'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0xb40f17,_0x156789){return _0xb40f17['define'](_0x09bc('0x8'),attributes,{'tableName':_0x09bc('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x09bc('0xa')]},{'name':_0x09bc('0xb'),'fields':['plainBody',_0x09bc('0xc')],'type':_0x09bc('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x128f86,_0x435d27,_0x518b10){if(_0x128f86[_0x09bc('0xe')]){_0x128f86[_0x09bc('0xf')]=htmlToText['fromString'](_0x128f86[_0x09bc('0xe')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x518b10(null,_0x435d27);},'afterCreate':function(_0x29b072,_0x5933a2,_0x11f80f){var _0x3df739=_0xb40f17[_0x09bc('0x10')];var _0x33cd72=_0x29b072[_0x09bc('0x11')]({'plain':!![]});if(_0x33cd72[_0x09bc('0x12')][_0x09bc('0x13')]()==='in'||_0x33cd72['direction']['toLowerCase']()===_0x09bc('0x14')&&!_0x33cd72['secret']&&!_['isNil'](_0x33cd72[_0x09bc('0x15')])){_0x3df739[_0x09bc('0x16')][_0x09bc('0x17')]({'where':{'id':_0x33cd72[_0x09bc('0x18')]}})[_0x09bc('0x19')](function(_0x5bce52){if(_0x5bce52){_0x5bce52[_0x09bc('0x1a')]({'lastMsgAt':_0x33cd72['createdAt'],'lastMsgDirection':_0x33cd72[_0x09bc('0x12')][_0x09bc('0x13')]()});}})['catch'](function(_0x2a5750){console[_0x09bc('0x1b')](_0x2a5750);});}_0x11f80f();}},'charset':_0x09bc('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5f5e=['out','secret','isNil','UserId','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','bluebird','request-promise','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','models','get','toLowerCase','direction'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5f5e,0xd9));var _0xe5f5=function(_0x4e8c93,_0x225ccb){_0x4e8c93=_0x4e8c93-0x0;var _0x4f14c2=_0x5f5e[_0x4e8c93];return _0x4f14c2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe5f5('0x0'))('api');var moment=require(_0xe5f5('0x1'));var BPromise=require(_0xe5f5('0x2'));var rp=require(_0xe5f5('0x3'));var htmlToText=require(_0xe5f5('0x4'));var fs=require('fs');var path=require(_0xe5f5('0x5'));var rimraf=require(_0xe5f5('0x6'));var config=require('../../config/environment');var attributes=require(_0xe5f5('0x7'));module['exports']=function(_0x5966ce,_0x4369c0){return _0x5966ce[_0xe5f5('0x8')](_0xe5f5('0x9'),attributes,{'tableName':_0xe5f5('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xe5f5('0xb')]},{'name':_0xe5f5('0xc'),'fields':[_0xe5f5('0xd'),_0xe5f5('0xe')],'type':_0xe5f5('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3d8e1e,_0x3ad8a0,_0xf15cff){if(_0x3d8e1e[_0xe5f5('0x10')]){_0x3d8e1e[_0xe5f5('0xd')]=htmlToText['fromString'](_0x3d8e1e[_0xe5f5('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xf15cff(null,_0x3ad8a0);},'afterCreate':function(_0x38d6a6,_0x40aaa8,_0x107e14){var _0x111453=_0x5966ce[_0xe5f5('0x11')];var _0x5304f5=_0x38d6a6[_0xe5f5('0x12')]({'plain':!![]});if(_0x5304f5['direction'][_0xe5f5('0x13')]()==='in'||_0x5304f5[_0xe5f5('0x14')][_0xe5f5('0x13')]()===_0xe5f5('0x15')&&!_0x5304f5[_0xe5f5('0x16')]&&!_[_0xe5f5('0x17')](_0x5304f5[_0xe5f5('0x18')])){_0x111453[_0xe5f5('0x19')][_0xe5f5('0x1a')]({'where':{'id':_0x5304f5['MailInteractionId']}})[_0xe5f5('0x1b')](function(_0x259f30){if(_0x259f30){_0x259f30[_0xe5f5('0x1c')]({'lastMsgAt':_0x5304f5[_0xe5f5('0x1d')],'lastMsgDirection':_0x5304f5[_0xe5f5('0x14')][_0xe5f5('0x13')]()});}})[_0xe5f5('0x1e')](function(_0x1c6d8b){console[_0xe5f5('0x1f')](_0x1c6d8b);});}_0x107e14();}},'charset':_0xe5f5('0x20'),'collate':_0xe5f5('0x21')});};
\ No newline at end of file
index b359c27..5633661 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2da6=['defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','MailMessage','create','body','options','info','CreateMailMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis'];(function(_0x29df83,_0x5dab00){var _0x3869eb=function(_0x531baf){while(--_0x531baf){_0x29df83['push'](_0x29df83['shift']());}};_0x3869eb(++_0x5dab00);}(_0x2da6,0x1dd));var _0x62da=function(_0xe94b17,_0xf7bfc9){_0xe94b17=_0xe94b17-0x0;var _0x3e95b1=_0x2da6[_0xe94b17];return _0x3e95b1;};'use strict';var _=require(_0x62da('0x0'));var util=require(_0x62da('0x1'));var moment=require(_0x62da('0x2'));var BPromise=require(_0x62da('0x3'));var rs=require(_0x62da('0x4'));var fs=require('fs');var Redis=require(_0x62da('0x5'));var db=require(_0x62da('0x6'))['db'];var utils=require(_0x62da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x62da('0x8'));var jayson=require(_0x62da('0x9'));var client=jayson[_0x62da('0xa')][_0x62da('0xb')]({'port':0x232a});config[_0x62da('0xc')]=_[_0x62da('0xd')](config[_0x62da('0xc')],{'host':_0x62da('0xe'),'port':0x18eb});var socket=require(_0x62da('0xf'))(new Redis(config['redis']));require(_0x62da('0x10'))[_0x62da('0x11')](socket);function respondWithRpcPromise(_0x2a3d7c,_0x1b68f8,_0x4cd5a2){return new BPromise(function(_0x241090,_0x3afe3b){return client[_0x62da('0x12')](_0x2a3d7c,_0x4cd5a2)[_0x62da('0x13')](function(_0x23be32){logger['info'](_0x62da('0x14'),_0x1b68f8,_0x62da('0x15'));logger[_0x62da('0x16')](_0x62da('0x17'),_0x1b68f8,_0x62da('0x15'),JSON['stringify'](_0x23be32));if(_0x23be32['error']){if(_0x23be32[_0x62da('0x18')][_0x62da('0x19')]===0x1f4){logger[_0x62da('0x18')](_0x62da('0x14'),_0x1b68f8,_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);return _0x3afe3b(_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);}logger[_0x62da('0x18')](_0x62da('0x14'),_0x1b68f8,_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);return _0x241090(_0x23be32[_0x62da('0x18')][_0x62da('0x1a')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x1b68f8,_0x62da('0x15'));_0x241090(_0x23be32['result'][_0x62da('0x1a')]);}})[_0x62da('0x1b')](function(_0x15b8d0){logger['error'](_0x62da('0x14'),_0x1b68f8,_0x15b8d0);_0x3afe3b(_0x15b8d0);});});}exports['CreateMailMessage']=function(_0x2e6b7e){var _0x37c15d=this;return new Promise(function(_0x3b90c8,_0x2f7b01){return db[_0x62da('0x1c')][_0x62da('0x1d')](_0x2e6b7e[_0x62da('0x1e')],{'raw':_0x2e6b7e[_0x62da('0x1f')]?_0x2e6b7e[_0x62da('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x62da('0x13')](function(_0x866a76){logger[_0x62da('0x20')](_0x62da('0x21'),_0x2e6b7e);logger[_0x62da('0x16')](_0x62da('0x21'),_0x2e6b7e,JSON[_0x62da('0x22')](_0x866a76));_0x3b90c8(_0x866a76);})['catch'](function(_0x55fd3b){logger['error'](_0x62da('0x21'),_0x55fd3b[_0x62da('0x1a')],_0x2e6b7e);_0x2f7b01(_0x37c15d[_0x62da('0x18')](0x1f4,_0x55fd3b[_0x62da('0x1a')]));});});};
\ No newline at end of file
+var _0x4e2e=['socket.io-emitter','./mailMessage.socket','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','MailMessage,\x20%s,\x20%s','message','catch','CreateMailMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x544bdb,_0x54ddd2){_0x544bdb=_0x544bdb-0x0;var _0x5ce26d=_0x4e2e[_0x544bdb];return _0x5ce26d;};'use strict';var _=require('lodash');var util=require(_0xe4e2('0x0'));var moment=require(_0xe4e2('0x1'));var BPromise=require(_0xe4e2('0x2'));var rs=require(_0xe4e2('0x3'));var fs=require('fs');var Redis=require(_0xe4e2('0x4'));var db=require(_0xe4e2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe4e2('0x6'))(_0xe4e2('0x7'));var config=require(_0xe4e2('0x8'));var jayson=require(_0xe4e2('0x9'));var client=jayson['client'][_0xe4e2('0xa')]({'port':0x232a});config[_0xe4e2('0xb')]=_[_0xe4e2('0xc')](config[_0xe4e2('0xb')],{'host':_0xe4e2('0xd'),'port':0x18eb});var socket=require(_0xe4e2('0xe'))(new Redis(config[_0xe4e2('0xb')]));require(_0xe4e2('0xf'))['register'](socket);function respondWithRpcPromise(_0xd81011,_0x14fe0d,_0xa4df88){return new BPromise(function(_0x5b7889,_0x1954f8){return client[_0xe4e2('0x10')](_0xd81011,_0xa4df88)[_0xe4e2('0x11')](function(_0x107816){logger[_0xe4e2('0x12')]('MailMessage,\x20%s,\x20%s',_0x14fe0d,_0xe4e2('0x13'));logger[_0xe4e2('0x14')](_0xe4e2('0x15'),_0x14fe0d,_0xe4e2('0x13'),JSON['stringify'](_0x107816));if(_0x107816[_0xe4e2('0x16')]){if(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x17')]===0x1f4){logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x107816['error']['message']);return _0x1954f8(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x19')]);}logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x107816[_0xe4e2('0x16')]['message']);return _0x5b7889(_0x107816[_0xe4e2('0x16')][_0xe4e2('0x19')]);}else{logger[_0xe4e2('0x12')]('MailMessage,\x20%s,\x20%s',_0x14fe0d,_0xe4e2('0x13'));_0x5b7889(_0x107816['result'][_0xe4e2('0x19')]);}})[_0xe4e2('0x1a')](function(_0x7a47c3){logger[_0xe4e2('0x16')](_0xe4e2('0x18'),_0x14fe0d,_0x7a47c3);_0x1954f8(_0x7a47c3);});});}exports[_0xe4e2('0x1b')]=function(_0x339d00){var _0x3c4e90=this;return new Promise(function(_0x4769dd,_0x362741){return db['MailMessage'][_0xe4e2('0x1c')](_0x339d00[_0xe4e2('0x1d')],{'raw':_0x339d00[_0xe4e2('0x1e')]?_0x339d00[_0xe4e2('0x1e')][_0xe4e2('0x1f')]===undefined?!![]:![]:!![]})[_0xe4e2('0x11')](function(_0x16f14b){logger['info'](_0xe4e2('0x1b'),_0x339d00);logger[_0xe4e2('0x14')](_0xe4e2('0x1b'),_0x339d00,JSON['stringify'](_0x16f14b));_0x4769dd(_0x16f14b);})[_0xe4e2('0x1a')](function(_0x12ad33){logger['error'](_0xe4e2('0x1b'),_0x12ad33[_0xe4e2('0x19')],_0x339d00);_0x362741(_0x3c4e90[_0xe4e2('0x16')](0x1f4,_0x12ad33[_0xe4e2('0x19')]));});});};
\ No newline at end of file
index b3848b2..e1c640e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8003=['register','length','mailMessage:','remove'];(function(_0x503f28,_0x5af040){var _0x1db2d6=function(_0x13b75e){while(--_0x13b75e){_0x503f28['push'](_0x503f28['shift']());}};_0x1db2d6(++_0x5af040);}(_0x8003,0xcb));var _0x3800=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8003[_0x24061a];return _0x82054e;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save',_0x3800('0x0'),'update'];function createListener(_0x31de27,_0xb70333){return function(_0x37a516){_0xb70333['emit'](_0x31de27,_0x37a516);};}function removeListener(_0x24aa54,_0x40d6f2){return function(){MailMessageEvents['removeListener'](_0x24aa54,_0x40d6f2);};}exports[_0x3800('0x1')]=function(_0x40fdc3){for(var _0x218bb6=0x0,_0x4fb320=events[_0x3800('0x2')];_0x218bb6<_0x4fb320;_0x218bb6++){var _0x424423=events[_0x218bb6];var _0x20dff8=createListener(_0x3800('0x3')+_0x424423,_0x40fdc3);MailMessageEvents['on'](_0x424423,_0x20dff8);}};
\ No newline at end of file
+var _0x19ea=['length','mailMessage:','./mailMessage.events','update','emit','removeListener','register'];(function(_0x4ba783,_0x53a7a7){var _0x56592f=function(_0x553230){while(--_0x553230){_0x4ba783['push'](_0x4ba783['shift']());}};_0x56592f(++_0x53a7a7);}(_0x19ea,0xfe));var _0xa19e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x19ea[_0x521929];return _0x632436;};'use strict';var MailMessageEvents=require(_0xa19e('0x0'));var events=['save','remove',_0xa19e('0x1')];function createListener(_0x481228,_0x208e73){return function(_0x12aefc){_0x208e73[_0xa19e('0x2')](_0x481228,_0x12aefc);};}function removeListener(_0x4d323a,_0x4a6556){return function(){MailMessageEvents[_0xa19e('0x3')](_0x4d323a,_0x4a6556);};}exports[_0xa19e('0x4')]=function(_0x29fe52){for(var _0x2713e9=0x0,_0x1087e7=events[_0xa19e('0x5')];_0x2713e9<_0x1087e7;_0x2713e9++){var _0x336e23=events[_0x2713e9];var _0x1867cb=createListener(_0xa19e('0x6')+_0x336e23,_0x29fe52);MailMessageEvents['on'](_0x336e23,_0x1867cb);}};
\ No newline at end of file
index fdac105..276ee89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c67=['get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x2c67,0x12a));var _0x72c6=function(_0x1a6156,_0x85c3c){_0x1a6156=_0x1a6156-0x0;var _0x480dda=_0x2c67[_0x1a6156];return _0x480dda;};'use strict';var multer=require(_0x72c6('0x0'));var util=require(_0x72c6('0x1'));var path=require(_0x72c6('0x2'));var timeout=require(_0x72c6('0x3'));var express=require('express');var router=express[_0x72c6('0x4')]();var fs_extra=require(_0x72c6('0x5'));var auth=require(_0x72c6('0x6'));var interaction=require(_0x72c6('0x7'));var config=require(_0x72c6('0x8'));var controller=require(_0x72c6('0x9'));router[_0x72c6('0xa')]('/',auth['isAuthenticated'](),controller[_0x72c6('0xb')]);router[_0x72c6('0xa')](_0x72c6('0xc'),auth[_0x72c6('0xd')](),controller[_0x72c6('0xe')]);router[_0x72c6('0xa')](_0x72c6('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x72c6('0xa')](_0x72c6('0x10'),auth[_0x72c6('0xd')](),controller[_0x72c6('0x11')]);router[_0x72c6('0xa')](_0x72c6('0x12'),auth[_0x72c6('0xd')](),controller['getTeams']);router[_0x72c6('0xa')](_0x72c6('0x13'),auth[_0x72c6('0xd')](),controller[_0x72c6('0x14')]);router[_0x72c6('0x15')]('/',auth[_0x72c6('0xd')](),controller['create']);router[_0x72c6('0x15')](_0x72c6('0x12'),auth[_0x72c6('0xd')](),controller[_0x72c6('0x16')]);router[_0x72c6('0x15')](_0x72c6('0x13'),auth[_0x72c6('0xd')](),controller[_0x72c6('0x17')]);router[_0x72c6('0x18')]('/:id',auth[_0x72c6('0xd')](),controller['update']);router[_0x72c6('0x19')](_0x72c6('0xf'),auth[_0x72c6('0xd')](),controller[_0x72c6('0x1a')]);router[_0x72c6('0x19')](_0x72c6('0x12'),auth[_0x72c6('0xd')](),controller['removeTeams']);router['delete'](_0x72c6('0x13'),auth[_0x72c6('0xd')](),controller['removeAgents']);module[_0x72c6('0x1b')]=router;
\ No newline at end of file
+var _0xc6c3=['isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','put','update','delete','removeTeams','removeAgents','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get'];(function(_0x55ba8f,_0x311aa9){var _0x356f33=function(_0x48070d){while(--_0x48070d){_0x55ba8f['push'](_0x55ba8f['shift']());}};_0x356f33(++_0x311aa9);}(_0xc6c3,0x7f));var _0x3c6c=function(_0x5e7e4e,_0x2c0b9e){_0x5e7e4e=_0x5e7e4e-0x0;var _0x3d8ee2=_0xc6c3[_0x5e7e4e];return _0x3d8ee2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3c6c('0x0'));var timeout=require(_0x3c6c('0x1'));var express=require('express');var router=express[_0x3c6c('0x2')]();var fs_extra=require(_0x3c6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3c6c('0x4'));var config=require(_0x3c6c('0x5'));var controller=require(_0x3c6c('0x6'));router[_0x3c6c('0x7')]('/',auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x9')]);router['get']('/describe',auth[_0x3c6c('0x8')](),controller[_0x3c6c('0xa')]);router['get'](_0x3c6c('0xb'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0xc')]);router[_0x3c6c('0x7')](_0x3c6c('0xd'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0xe')]);router['get'](_0x3c6c('0xf'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x10')]);router[_0x3c6c('0x7')](_0x3c6c('0x11'),auth[_0x3c6c('0x8')](),controller['getAgents']);router[_0x3c6c('0x12')]('/',auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x13')]);router[_0x3c6c('0x12')]('/:id/teams',auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x14')]);router['post'](_0x3c6c('0x11'),auth[_0x3c6c('0x8')](),controller['addAgents']);router[_0x3c6c('0x15')](_0x3c6c('0xb'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x16')]);router[_0x3c6c('0x17')](_0x3c6c('0xb'),auth[_0x3c6c('0x8')](),controller['destroy']);router[_0x3c6c('0x17')](_0x3c6c('0xf'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x18')]);router[_0x3c6c('0x17')](_0x3c6c('0x11'),auth[_0x3c6c('0x8')](),controller[_0x3c6c('0x19')]);module[_0x3c6c('0x1a')]=router;
\ No newline at end of file
index 24de806..667db24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ae3=['sequelize','name','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x48f689,_0x13b180){var _0x3c2894=function(_0x20a067){while(--_0x20a067){_0x48f689['push'](_0x48f689['shift']());}};_0x3c2894(++_0x13b180);}(_0x4ae3,0x1e3));var _0x34ae=function(_0x4970d6,_0x2e6b07){_0x4970d6=_0x4970d6-0x0;var _0x2857f3=_0x4ae3[_0x4970d6];return _0x2857f3;};'use strict';var Sequelize=require(_0x34ae('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x34ae('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x34ae('0x2')]},'timeout':{'type':Sequelize[_0x34ae('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x34ae('0x4'),_0x34ae('0x5'),_0x34ae('0x6'))}};
\ No newline at end of file
+var _0xe09f=['STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x21081b,_0x2b6556){var _0x281f3c=function(_0x245301){while(--_0x245301){_0x21081b['push'](_0x21081b['shift']());}};_0x281f3c(++_0x2b6556);}(_0xe09f,0xfb));var _0xfe09=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe09f[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0xfe09('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe09('0x1')],'unique':_0xfe09('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfe09('0x1')]},'timeout':{'type':Sequelize[_0xfe09('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xfe09('0x4'),_0xfe09('0x5'),_0xfe09('0x6'))}};
\ No newline at end of file
index bdec369..b971be7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3222=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','defaults','localhost','./mailQueue.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MailQueues','stack','name','send','map','MailQueue','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','filter','merge','options','where','includeAll','include','rows','catch','params','keys','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','createdAt','SIP','updatedAt','getTeams','Team','pick','addTeams','Agents','interface','transaction','each','forEach','emit','userMailQueue:save','removeTeams','ids','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','TeamId','all','union','compact','userMailQueue:remove','addAgents','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x5e7f48,_0xb4c115){var _0x2f12bb=function(_0x289882){while(--_0x289882){_0x5e7f48['push'](_0x5e7f48['shift']());}};_0x2f12bb(++_0xb4c115);}(_0x3222,0x101));var _0x2322=function(_0x3adcc0,_0xa93930){_0x3adcc0=_0x3adcc0-0x0;var _0x16de7f=_0x3222[_0x3adcc0];return _0x16de7f;};'use strict';var emlformat=require(_0x2322('0x0'));var rimraf=require(_0x2322('0x1'));var zipdir=require(_0x2322('0x2'));var jsonpatch=require(_0x2322('0x3'));var rp=require(_0x2322('0x4'));var moment=require(_0x2322('0x5'));var BPromise=require(_0x2322('0x6'));var Mustache=require(_0x2322('0x7'));var util=require('util');var path=require(_0x2322('0x8'));var sox=require(_0x2322('0x9'));var csv=require(_0x2322('0xa'));var ejs=require(_0x2322('0xb'));var fs=require('fs');var fs_extra=require(_0x2322('0xc'));var _=require(_0x2322('0xd'));var squel=require('squel');var crypto=require(_0x2322('0xe'));var jsforce=require(_0x2322('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x2322('0xa'));var querystring=require(_0x2322('0x10'));var Papa=require(_0x2322('0x11'));var Redis=require(_0x2322('0x12'));var authService=require(_0x2322('0x13'));var qs=require(_0x2322('0x14'));var as=require(_0x2322('0x15'));var hardwareService=require(_0x2322('0x16'));var logger=require(_0x2322('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x2322('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x2322('0x19'))['db'];config['redis']=_[_0x2322('0x1a')](config['redis'],{'host':_0x2322('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2322('0x1c'))[_0x2322('0x1d')](socket);function respondWithStatusCode(_0x1255ff,_0x2261c1){_0x2261c1=_0x2261c1||0xcc;return function(_0x911bcc){if(_0x911bcc){return _0x1255ff[_0x2322('0x1e')](_0x2261c1);}return _0x1255ff['status'](_0x2261c1)[_0x2322('0x1f')]();};}function respondWithResult(_0x5028c0,_0x483f59){_0x483f59=_0x483f59||0xc8;return function(_0x4d22bb){if(_0x4d22bb){return _0x5028c0[_0x2322('0x20')](_0x483f59)['json'](_0x4d22bb);}};}function respondWithFilteredResult(_0x2b5829,_0x35a1ee){return function(_0x56f953){if(_0x56f953){var _0x62f0e=typeof _0x35a1ee[_0x2322('0x21')]===_0x2322('0x22')&&typeof _0x35a1ee[_0x2322('0x23')]===_0x2322('0x22');var _0xc63539=_0x56f953[_0x2322('0x24')];var _0x53357d=_0x62f0e?0x0:_0x35a1ee[_0x2322('0x21')];var _0x521a3c=_0x62f0e?_0x56f953[_0x2322('0x24')]:_0x35a1ee[_0x2322('0x21')]+_0x35a1ee[_0x2322('0x23')];var _0x20abc1;if(_0x521a3c>=_0xc63539){_0x521a3c=_0xc63539;_0x20abc1=0xc8;}else{_0x20abc1=0xce;}_0x2b5829['status'](_0x20abc1);return _0x2b5829[_0x2322('0x25')](_0x2322('0x26'),_0x53357d+'-'+_0x521a3c+'/'+_0xc63539)[_0x2322('0x27')](_0x56f953);}return null;};}function patchUpdates(_0x476c76){return function(_0x48eceb){try{jsonpatch[_0x2322('0x28')](_0x48eceb,_0x476c76,!![]);}catch(_0x268fbd){return BPromise[_0x2322('0x29')](_0x268fbd);}return _0x48eceb[_0x2322('0x2a')]();};}function saveUpdates(_0x3596a0,_0x174d55){return function(_0x456f9b){if(_0x456f9b){return _0x456f9b[_0x2322('0x2b')](_0x3596a0)[_0x2322('0x2c')](function(_0x453fc1){return _0x453fc1;});}return null;};}function removeEntity(_0x4be7b7,_0x25cfea){return function(_0x41123a){if(_0x41123a){return _0x41123a[_0x2322('0x2d')]()['then'](function(){var _0x551636=_0x41123a[_0x2322('0x2e')]({'plain':!![]});var _0x883514=_0x2322('0x2f');return db['UserProfileResource'][_0x2322('0x2d')]({'where':{'type':_0x883514,'resourceId':_0x551636['id']}})[_0x2322('0x2c')](function(){return _0x41123a;});})[_0x2322('0x2c')](function(){_0x4be7b7[_0x2322('0x20')](0xcc)[_0x2322('0x1f')]();});}};}function handleEntityNotFound(_0x29b9ab,_0x4b88fd){return function(_0x4142a0){if(!_0x4142a0){_0x29b9ab[_0x2322('0x1e')](0x194);}return _0x4142a0;};}function handleError(_0x2b14a4,_0x239ded){_0x239ded=_0x239ded||0x1f4;return function(_0x4c0b30){logger['error'](_0x4c0b30[_0x2322('0x30')]);if(_0x4c0b30[_0x2322('0x31')]){delete _0x4c0b30[_0x2322('0x31')];}_0x2b14a4[_0x2322('0x20')](_0x239ded)[_0x2322('0x32')](_0x4c0b30);};}exports['index']=function(_0x5be2f3,_0x509303){var _0x1c1bf7={},_0x395be0={},_0x43e068={'count':0x0,'rows':[]};var _0x41f29b=_[_0x2322('0x33')](db[_0x2322('0x34')]['rawAttributes'],function(_0x3e483f){return{'name':_0x3e483f[_0x2322('0x35')],'type':_0x3e483f[_0x2322('0x36')][_0x2322('0x37')]};});_0x395be0[_0x2322('0x38')]=_[_0x2322('0x33')](_0x41f29b,_0x2322('0x31'));_0x395be0[_0x2322('0x39')]=_['keys'](_0x5be2f3[_0x2322('0x39')]);_0x395be0[_0x2322('0x3a')]=_[_0x2322('0x3b')](_0x395be0[_0x2322('0x38')],_0x395be0[_0x2322('0x39')]);_0x1c1bf7['attributes']=_[_0x2322('0x3b')](_0x395be0[_0x2322('0x38')],qs['fields'](_0x5be2f3['query'][_0x2322('0x3c')]));_0x1c1bf7[_0x2322('0x3d')]=_0x1c1bf7[_0x2322('0x3d')]['length']?_0x1c1bf7[_0x2322('0x3d')]:_0x395be0[_0x2322('0x38')];if(!_0x5be2f3['query']['hasOwnProperty'](_0x2322('0x3e'))){_0x1c1bf7[_0x2322('0x23')]=qs[_0x2322('0x23')](_0x5be2f3[_0x2322('0x39')][_0x2322('0x23')]);_0x1c1bf7[_0x2322('0x21')]=qs[_0x2322('0x21')](_0x5be2f3['query']['offset']);}_0x1c1bf7['order']=qs[_0x2322('0x3f')](_0x5be2f3['query']['sort']);_0x1c1bf7['where']=qs[_0x2322('0x3a')](_['pick'](_0x5be2f3['query'],_0x395be0['filters']),_0x41f29b);if(_0x5be2f3[_0x2322('0x39')][_0x2322('0x40')]){_0x1c1bf7['where']=_['merge'](_0x1c1bf7['where'],{'$or':_['map'](_0x41f29b,function(_0x2ee4b0){if(_0x2ee4b0['type']!=='VIRTUAL'){var _0x5c0adf={};_0x5c0adf[_0x2ee4b0[_0x2322('0x31')]]={'$like':'%'+_0x5be2f3[_0x2322('0x39')][_0x2322('0x40')]+'%'};return _0x5c0adf;}})});}_0x1c1bf7=_[_0x2322('0x41')]({},_0x1c1bf7,_0x5be2f3[_0x2322('0x42')]);var _0x1730c9={'where':_0x1c1bf7[_0x2322('0x43')]};return db[_0x2322('0x34')][_0x2322('0x24')](_0x1730c9)[_0x2322('0x2c')](function(_0x1e25e6){_0x43e068[_0x2322('0x24')]=_0x1e25e6;if(_0x5be2f3[_0x2322('0x39')][_0x2322('0x44')]){_0x1c1bf7[_0x2322('0x45')]=[{'all':!![]}];}return db[_0x2322('0x34')]['findAll'](_0x1c1bf7);})[_0x2322('0x2c')](function(_0x2400dd){_0x43e068[_0x2322('0x46')]=_0x2400dd;return _0x43e068;})[_0x2322('0x2c')](respondWithFilteredResult(_0x509303,_0x1c1bf7))[_0x2322('0x47')](handleError(_0x509303,null));};exports['show']=function(_0x3ffcbe,_0x1abb10){var _0x23844e={'raw':!![],'where':{'id':_0x3ffcbe[_0x2322('0x48')]['id']}},_0x245223={};_0x245223[_0x2322('0x38')]=_[_0x2322('0x49')](db['MailQueue'][_0x2322('0x4a')]);_0x245223['query']=_[_0x2322('0x49')](_0x3ffcbe[_0x2322('0x39')]);_0x245223['filters']=_['intersection'](_0x245223['model'],_0x245223['query']);_0x23844e[_0x2322('0x3d')]=_[_0x2322('0x3b')](_0x245223[_0x2322('0x38')],qs[_0x2322('0x3c')](_0x3ffcbe[_0x2322('0x39')][_0x2322('0x3c')]));_0x23844e[_0x2322('0x3d')]=_0x23844e[_0x2322('0x3d')][_0x2322('0x4b')]?_0x23844e[_0x2322('0x3d')]:_0x245223['model'];if(_0x3ffcbe[_0x2322('0x39')][_0x2322('0x44')]){_0x23844e[_0x2322('0x45')]=[{'all':!![]}];}_0x23844e=_[_0x2322('0x41')]({},_0x23844e,_0x3ffcbe[_0x2322('0x42')]);return db[_0x2322('0x34')][_0x2322('0x4c')](_0x23844e)[_0x2322('0x2c')](handleEntityNotFound(_0x1abb10,null))['then'](respondWithResult(_0x1abb10,null))[_0x2322('0x47')](handleError(_0x1abb10,null));};exports[_0x2322('0x4d')]=function(_0x618742,_0x32930c){return db[_0x2322('0x34')]['create'](_0x618742[_0x2322('0x4e')],{})['then'](function(_0x18662b){var _0x485ab8=_0x618742['user'][_0x2322('0x2e')]({'plain':!![]});if(!_0x485ab8)throw new Error(_0x2322('0x4f'));if(_0x485ab8[_0x2322('0x50')]==='user'){var _0x56d9fd=_0x18662b[_0x2322('0x2e')]({'plain':!![]});var _0x2023a8='MailQueues';return db[_0x2322('0x51')]['find']({'where':{'name':_0x2023a8,'userProfileId':_0x485ab8[_0x2322('0x52')]},'raw':!![]})['then'](function(_0x40f2c7){if(_0x40f2c7&&_0x40f2c7[_0x2322('0x53')]===0x0){return db[_0x2322('0x54')][_0x2322('0x4d')]({'name':_0x56d9fd[_0x2322('0x31')],'resourceId':_0x56d9fd['id'],'type':_0x40f2c7[_0x2322('0x31')],'sectionId':_0x40f2c7['id']},{})[_0x2322('0x2c')](function(){return _0x18662b;});}else{return _0x18662b;}})['catch'](function(_0x662a76){logger[_0x2322('0x55')](_0x2322('0x56'),_0x662a76);throw _0x662a76;});}return _0x18662b;})[_0x2322('0x2c')](respondWithResult(_0x32930c,0xc9))[_0x2322('0x47')](handleError(_0x32930c,null));};exports[_0x2322('0x2b')]=function(_0x517260,_0x5b8564){if(_0x517260[_0x2322('0x4e')]['id']){delete _0x517260[_0x2322('0x4e')]['id'];}return db[_0x2322('0x34')][_0x2322('0x4c')]({'where':{'id':_0x517260[_0x2322('0x48')]['id']}})['then'](handleEntityNotFound(_0x5b8564,null))[_0x2322('0x2c')](saveUpdates(_0x517260[_0x2322('0x4e')],null))[_0x2322('0x2c')](respondWithResult(_0x5b8564,null))[_0x2322('0x47')](handleError(_0x5b8564,null));};exports['destroy']=function(_0x304f37,_0x3be361){return db[_0x2322('0x34')][_0x2322('0x4c')]({'where':{'id':_0x304f37[_0x2322('0x48')]['id']}})[_0x2322('0x2c')](handleEntityNotFound(_0x3be361,null))[_0x2322('0x2c')](removeEntity(_0x3be361,null))[_0x2322('0x47')](handleError(_0x3be361,null));};exports['describe']=function(_0x9352bb,_0xa3cbcd){return db[_0x2322('0x34')][_0x2322('0x57')]()['then'](respondWithResult(_0xa3cbcd,null))['catch'](handleError(_0xa3cbcd,null));};exports[_0x2322('0x58')]=function(_0x3f768e,_0x476450,_0x4ec25a){var _0x3dd791={'raw':!![],'where':{}},_0x1c62de={},_0x22dae8;return db['MailQueue'][_0x2322('0x59')]({'where':{'id':_0x3f768e['params']['id']}})[_0x2322('0x2c')](handleEntityNotFound(_0x476450,null))[_0x2322('0x2c')](function(_0x14943f){if(_0x14943f){_0x22dae8=_0x14943f[_0x2322('0x2e')]({'plain':!![]});_0x1c62de['model']=_[_0x2322('0x49')](db[_0x2322('0x5a')][_0x2322('0x4a')]);_0x1c62de[_0x2322('0x39')]=_[_0x2322('0x49')](_0x3f768e[_0x2322('0x39')]);_0x1c62de[_0x2322('0x3a')]=_[_0x2322('0x3b')](_0x1c62de[_0x2322('0x38')],_0x1c62de['query']);_0x3dd791[_0x2322('0x3d')]=_[_0x2322('0x3b')](_0x1c62de['model'],qs[_0x2322('0x3c')](_0x3f768e[_0x2322('0x39')][_0x2322('0x3c')]));_0x3dd791[_0x2322('0x3d')]=_0x3dd791['attributes'][_0x2322('0x4b')]?_0x3dd791['attributes']:_0x1c62de['model'];if(!_0x3f768e[_0x2322('0x39')][_0x2322('0x5b')](_0x2322('0x3e'))){_0x3dd791[_0x2322('0x23')]=qs[_0x2322('0x23')](_0x3f768e[_0x2322('0x39')][_0x2322('0x23')]);_0x3dd791[_0x2322('0x21')]=qs[_0x2322('0x21')](_0x3f768e[_0x2322('0x39')]['offset']);}_0x3dd791[_0x2322('0x5c')]=qs[_0x2322('0x3f')](_0x3f768e[_0x2322('0x39')][_0x2322('0x3f')]);_0x3dd791[_0x2322('0x43')]=qs[_0x2322('0x3a')](_['pick'](_0x3f768e['query'],_0x1c62de['filters']));_0x3dd791['where'][_0x2322('0x5d')]=_0x14943f['id'];if(_0x3f768e['query'][_0x2322('0x40')]){_0x3dd791[_0x2322('0x43')]=_[_0x2322('0x41')](_0x3dd791['where'],{'$or':_[_0x2322('0x33')](_0x3dd791[_0x2322('0x3d')],function(_0x24dcec){var _0x32cef8={};_0x32cef8[_0x24dcec]={'$like':'%'+_0x3f768e[_0x2322('0x39')][_0x2322('0x40')]+'%'};return _0x32cef8;})});}_0x3dd791=_[_0x2322('0x41')]({},_0x3dd791,_0x3f768e[_0x2322('0x42')]);return db['UserMailQueue'][_0x2322('0x5e')](_0x3dd791);}})[_0x2322('0x2c')](function(_0x3c681d){if(_0x3c681d){return db[_0x2322('0x5f')][_0x2322('0x60')]({'where':{'id':_['map'](_0x3c681d,_0x2322('0x61')),'role':_0x2322('0x62')},'attributes':['id',_0x2322('0x31'),_0x2322('0x63'),'updatedAt',_0x2322('0x64')]});}})[_0x2322('0x2c')](function(_0x4bd88c){if(_0x4bd88c){return{'count':_0x4bd88c[_0x2322('0x24')],'rows':_[_0x2322('0x33')](_0x4bd88c[_0x2322('0x46')],function(_0x1717df){return{'membername':_0x1717df['name'],'UserId':_0x1717df['id'],'queue_name':_0x22dae8[_0x2322('0x31')],'MailQueueId':_0x22dae8['id'],'interface':util['format']('%s/%s',_0x2322('0x65'),_0x1717df[_0x2322('0x31')]),'penalty':0x0,'paused':_0x1717df['mailPause'],'createdAt':_0x1717df[_0x2322('0x64')],'updatedAt':_0x1717df[_0x2322('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2322('0x2c')](respondWithFilteredResult(_0x476450,_0x3dd791))['catch'](handleError(_0x476450,null));};exports[_0x2322('0x67')]=function(_0x39b35c,_0x5e7a2f,_0x12f3d1){var _0x5d9b06={};var _0x2be12b={};var _0xb57eba;var _0x2601e0;return db[_0x2322('0x34')][_0x2322('0x59')]({'where':{'id':_0x39b35c[_0x2322('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e7a2f,null))[_0x2322('0x2c')](function(_0xe36f4f){if(_0xe36f4f){_0xb57eba=_0xe36f4f;_0x2be12b[_0x2322('0x38')]=_[_0x2322('0x49')](db[_0x2322('0x68')][_0x2322('0x4a')]);_0x2be12b[_0x2322('0x39')]=_[_0x2322('0x49')](_0x39b35c[_0x2322('0x39')]);_0x2be12b['filters']=_[_0x2322('0x3b')](_0x2be12b[_0x2322('0x38')],_0x2be12b[_0x2322('0x39')]);_0x5d9b06['attributes']=_[_0x2322('0x3b')](_0x2be12b['model'],qs[_0x2322('0x3c')](_0x39b35c[_0x2322('0x39')][_0x2322('0x3c')]));_0x5d9b06[_0x2322('0x3d')]=_0x5d9b06['attributes']['length']?_0x5d9b06[_0x2322('0x3d')]:_0x2be12b[_0x2322('0x38')];_0x5d9b06[_0x2322('0x5c')]=qs[_0x2322('0x3f')](_0x39b35c[_0x2322('0x39')][_0x2322('0x3f')]);_0x5d9b06['where']=qs[_0x2322('0x3a')](_[_0x2322('0x69')](_0x39b35c[_0x2322('0x39')],_0x2be12b[_0x2322('0x3a')]));if(_0x39b35c[_0x2322('0x39')][_0x2322('0x40')]){_0x5d9b06[_0x2322('0x43')]=_[_0x2322('0x41')](_0x5d9b06[_0x2322('0x43')],{'$or':_['map'](_0x5d9b06[_0x2322('0x3d')],function(_0x5a0045){var _0x4e1b10={};_0x4e1b10[_0x5a0045]={'$like':'%'+_0x39b35c[_0x2322('0x39')][_0x2322('0x40')]+'%'};return _0x4e1b10;})});}_0x5d9b06=_[_0x2322('0x41')]({},_0x5d9b06,_0x39b35c[_0x2322('0x42')]);return _0xb57eba[_0x2322('0x67')](_0x5d9b06);}})[_0x2322('0x2c')](function(_0x37ca74){if(_0x37ca74){_0x2601e0=_0x37ca74[_0x2322('0x4b')];if(!_0x39b35c[_0x2322('0x39')][_0x2322('0x5b')]('nolimit')){_0x5d9b06[_0x2322('0x23')]=qs[_0x2322('0x23')](_0x39b35c[_0x2322('0x39')][_0x2322('0x23')]);_0x5d9b06[_0x2322('0x21')]=qs['offset'](_0x39b35c['query']['offset']);}return _0xb57eba[_0x2322('0x67')](_0x5d9b06);}})[_0x2322('0x2c')](function(_0x75447e){if(_0x75447e){return _0x75447e?{'count':_0x2601e0,'rows':_0x75447e}:null;}})[_0x2322('0x2c')](respondWithResult(_0x5e7a2f,null))[_0x2322('0x47')](handleError(_0x5e7a2f,null));};exports[_0x2322('0x6a')]=function(_0x66fac6,_0xaeeefc,_0x3ce51c){var _0x2502bc=_0x66fac6[_0x2322('0x4e')]['ids'];return db[_0x2322('0x68')][_0x2322('0x5e')]({'where':{'id':_0x2502bc},'attributes':['id'],'include':[{'model':db[_0x2322('0x5f')],'as':_0x2322('0x6b'),'attributes':['id',_0x2322('0x31'),'online','voicePause',_0x2322('0x6c')],'raw':!![]}]})[_0x2322('0x2c')](function(_0x3ddd81){if(_0x3ddd81){var _0x348d93=_['flatMap'](_0x3ddd81,function(_0x2d874b){var _0x6c6d1e=_0x2d874b[_0x2322('0x2e')]({'plain':!![]});return _0x6c6d1e['Agents'];});return db['MailQueue']['find']({'where':{'id':_0x66fac6[_0x2322('0x48')]['id']}})[_0x2322('0x2c')](function(_0x158522){return db['sequelize'][_0x2322('0x6d')](function(_0x210d4a){return _0x158522[_0x2322('0x6a')](_0x2502bc,{'transaction':_0x210d4a})[_0x2322('0x2c')](function(){return BPromise[_0x2322('0x6e')](_0x348d93,function(_0x264cb1){return db[_0x2322('0x5a')]['findOrCreate']({'where':{'UserId':_0x264cb1['id'],'MailQueueId':_0x66fac6[_0x2322('0x48')]['id']},'transaction':_0x210d4a});});})[_0x2322('0x2c')](function(){_0x348d93[_0x2322('0x6f')](function(_0x51b60c){socket[_0x2322('0x70')](_0x2322('0x71'),{'UserId':_0x51b60c['id'],'MailQueueId':_0x158522['id']});});});});});}})[_0x2322('0x2c')](respondWithStatusCode(_0xaeeefc,null))[_0x2322('0x47')](handleError(_0xaeeefc,null));};exports[_0x2322('0x72')]=function(_0x3b7946,_0x1a3845,_0x3b0f59){return db[_0x2322('0x68')][_0x2322('0x5e')]({'where':{'id':_0x3b7946[_0x2322('0x39')][_0x2322('0x73')]},'attributes':['id'],'include':[{'model':db[_0x2322('0x5f')],'as':_0x2322('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x2322('0x2c')](handleEntityNotFound(_0x1a3845,null))[_0x2322('0x2c')](function(_0x42bd23){var _0x39e155=_[_0x2322('0x33')](_0x42bd23,'id');var _0x472666=[];var _0x120d7b=[];var _0x4f7386=squel['select']();_0x4f7386['field'](_0x2322('0x74'))[_0x2322('0x75')](_0x2322('0x76'),'tq')[_0x2322('0x77')](_0x2322('0x78'),'ut',_0x2322('0x79'))[_0x2322('0x43')]('MailQueueId\x20=\x20?',_0x3b7946['params']['id']);for(var _0x3b2bd9=0x0;_0x3b2bd9<_0x42bd23['length'];_0x3b2bd9+=0x1){let _0x44e749=_0x42bd23[_0x3b2bd9];for(var _0x462a81=0x0;_0x462a81<_0x44e749['Agents'][_0x2322('0x4b')];_0x462a81+=0x1){let _0x172345=_0x44e749[_0x2322('0x6b')][_0x462a81];var _0x40885f=_0x4f7386[_0x2322('0x7a')]();_0x40885f['where'](_0x2322('0x7b'),_0x172345['id']);_0x120d7b['push'](db[_0x2322('0x7c')][_0x2322('0x39')](_0x40885f[_0x2322('0x7d')](),{'type':db['sequelize'][_0x2322('0x7e')][_0x2322('0x7f')]})[_0x2322('0x2c')](function(_0x54b641){if(_0x54b641[_0x2322('0x4b')]===0x1){return _0x172345['id'];}else{var _0x47123e=_['every'](_['map'](_0x54b641,_0x2322('0x80')),function(_0x42a44b){return _['includes'](_0x39e155,_0x42a44b);});if(_0x47123e){return _0x172345['id'];}}}));}}return BPromise[_0x2322('0x81')](_0x120d7b)[_0x2322('0x2c')](function(_0x53d6c5){_0x472666=_(_0x472666)[_0x2322('0x82')](_0x53d6c5)[_0x2322('0x83')]()['value']();return db[_0x2322('0x34')][_0x2322('0x4c')]({'where':{'id':_0x3b7946[_0x2322('0x48')]['id']}})['then'](function(_0x1828ca){return db[_0x2322('0x7c')][_0x2322('0x6d')](function(_0xb14541){return _0x1828ca[_0x2322('0x72')](_0x3b7946[_0x2322('0x39')]['ids'],{'transaction':_0xb14541})['then'](function(){if(!_['isEmpty'](_0x472666)){return _0x1828ca['removeAgents'](_0x472666,{'transaction':_0xb14541});}})[_0x2322('0x2c')](function(){_0x472666[_0x2322('0x6f')](function(_0xbda62b){socket[_0x2322('0x70')](_0x2322('0x84'),{'UserId':_0xbda62b,'MailQueueId':_0x1828ca['id']});});});});});});})[_0x2322('0x2c')](respondWithStatusCode(_0x1a3845,null))[_0x2322('0x47')](handleError(_0x1a3845,null));};exports[_0x2322('0x85')]=function(_0x47862,_0x1f788c,_0x574886){return db['MailQueue']['find']({'where':{'id':_0x47862['params']['id']}})[_0x2322('0x2c')](handleEntityNotFound(_0x1f788c,null))[_0x2322('0x2c')](function(_0x5bdeb1){if(_0x5bdeb1){return _0x5bdeb1[_0x2322('0x85')](_0x47862['body'][_0x2322('0x73')],_[_0x2322('0x86')](_0x47862[_0x2322('0x4e')],[_0x2322('0x73'),'id'])||{})[_0x2322('0x87')](function(_0x46cce4){for(var _0x59df42=0x0;_0x59df42<_0x47862[_0x2322('0x4e')][_0x2322('0x73')][_0x2322('0x4b')];_0x59df42+=0x1){socket[_0x2322('0x70')](_0x2322('0x71'),{'UserId':Number(_0x47862['body'][_0x2322('0x73')][_0x59df42]),'MailQueueId':Number(_0x47862[_0x2322('0x48')]['id'])});}return _0x46cce4;});}})[_0x2322('0x2c')](respondWithResult(_0x1f788c,null))[_0x2322('0x47')](handleError(_0x1f788c,null));};exports[_0x2322('0x88')]=function(_0x37ba4a,_0x4fa22a,_0x79c168){return db[_0x2322('0x34')][_0x2322('0x4c')]({'where':{'id':_0x37ba4a['params']['id']}})[_0x2322('0x2c')](handleEntityNotFound(_0x4fa22a,null))[_0x2322('0x2c')](function(_0x3734aa){if(_0x3734aa){return _0x3734aa[_0x2322('0x88')](_0x37ba4a[_0x2322('0x39')][_0x2322('0x73')])[_0x2322('0x2c')](function(){if(_['isArray'](_0x37ba4a[_0x2322('0x39')][_0x2322('0x73')])){for(var _0x9a35fb=0x0;_0x9a35fb<_0x37ba4a[_0x2322('0x39')][_0x2322('0x73')][_0x2322('0x4b')];_0x9a35fb+=0x1){socket[_0x2322('0x70')](_0x2322('0x84'),{'UserId':Number(_0x37ba4a['query']['ids'][_0x9a35fb]),'MailQueueId':Number(_0x37ba4a['params']['id'])});}}else{socket[_0x2322('0x70')](_0x2322('0x84'),{'UserId':Number(_0x37ba4a[_0x2322('0x39')]['ids']),'MailQueueId':Number(_0x37ba4a['params']['id'])});}});}})[_0x2322('0x2c')](respondWithStatusCode(_0x4fa22a,null))[_0x2322('0x47')](handleError(_0x4fa22a,null));};exports[_0x2322('0x89')]=function(_0x2105df,_0x3f40d7,_0x27ce71){var _0x51d073={};var _0x2bc518={};var _0x17688e;var _0x21e421;return db[_0x2322('0x34')][_0x2322('0x59')]({'where':{'id':_0x2105df[_0x2322('0x48')]['id']}})[_0x2322('0x2c')](handleEntityNotFound(_0x3f40d7,null))[_0x2322('0x2c')](function(_0x137a44){if(_0x137a44){_0x17688e=_0x137a44;_0x2bc518['model']=_[_0x2322('0x49')](db[_0x2322('0x5f')][_0x2322('0x4a')]);_0x2bc518[_0x2322('0x39')]=_[_0x2322('0x49')](_0x2105df[_0x2322('0x39')]);_0x2bc518[_0x2322('0x3a')]=_['intersection'](_0x2bc518[_0x2322('0x38')],_0x2bc518[_0x2322('0x39')]);_0x51d073[_0x2322('0x3d')]=_[_0x2322('0x3b')](_0x2bc518[_0x2322('0x38')],qs[_0x2322('0x3c')](_0x2105df[_0x2322('0x39')][_0x2322('0x3c')]));_0x51d073[_0x2322('0x3d')]=_0x51d073[_0x2322('0x3d')]['length']?_0x51d073['attributes']:_0x2bc518[_0x2322('0x38')];_0x51d073[_0x2322('0x5c')]=qs[_0x2322('0x3f')](_0x2105df[_0x2322('0x39')][_0x2322('0x3f')]);_0x51d073[_0x2322('0x43')]=qs[_0x2322('0x3a')](_[_0x2322('0x69')](_0x2105df[_0x2322('0x39')],_0x2bc518[_0x2322('0x3a')]));if(_0x2105df['query'][_0x2322('0x40')]){_0x51d073[_0x2322('0x43')]=_[_0x2322('0x41')](_0x51d073[_0x2322('0x43')],{'$or':_[_0x2322('0x33')](_0x51d073[_0x2322('0x3d')],function(_0x1a7d07){var _0x4fb561={};_0x4fb561[_0x1a7d07]={'$like':'%'+_0x2105df[_0x2322('0x39')][_0x2322('0x40')]+'%'};return _0x4fb561;})});}_0x51d073=_['merge']({},_0x51d073,_0x2105df[_0x2322('0x42')]);return _0x17688e['getAgents'](_0x51d073);}})[_0x2322('0x2c')](function(_0x5445fe){if(_0x5445fe){_0x21e421=_0x5445fe['length'];if(!_0x2105df[_0x2322('0x39')][_0x2322('0x5b')](_0x2322('0x3e'))){_0x51d073[_0x2322('0x23')]=qs[_0x2322('0x23')](_0x2105df[_0x2322('0x39')][_0x2322('0x23')]);_0x51d073[_0x2322('0x21')]=qs['offset'](_0x2105df[_0x2322('0x39')][_0x2322('0x21')]);}return _0x17688e[_0x2322('0x89')](_0x51d073);}})['then'](function(_0x3b4934){if(_0x3b4934){return _0x3b4934?{'count':_0x21e421,'rows':_0x3b4934}:null;}})[_0x2322('0x2c')](respondWithResult(_0x3f40d7,null))[_0x2322('0x47')](handleError(_0x3f40d7,null));};
\ No newline at end of file
+var _0x74b8=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','type','key','map','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','options','MailQueue','rows','catch','params','keys','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','autoAssociation','describe','UserMailQueue','rawAttributes','MailQueueId','findAll','findAndCountAll','UserId','agent','mailPause','updatedAt','%s/%s','createdAt','getTeams','Team','addTeams','ids','User','online','voicePause','interface','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','select','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','SELECT','every','TeamId','all','compact','value','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x74b8,0x86));var _0x874b=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x74b8[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x874b('0x0'));var jsonpatch=require(_0x874b('0x1'));var rp=require(_0x874b('0x2'));var moment=require(_0x874b('0x3'));var BPromise=require(_0x874b('0x4'));var Mustache=require(_0x874b('0x5'));var util=require(_0x874b('0x6'));var path=require(_0x874b('0x7'));var sox=require(_0x874b('0x8'));var csv=require(_0x874b('0x9'));var ejs=require(_0x874b('0xa'));var fs=require('fs');var fs_extra=require(_0x874b('0xb'));var _=require(_0x874b('0xc'));var squel=require(_0x874b('0xd'));var crypto=require(_0x874b('0xe'));var jsforce=require(_0x874b('0xf'));var deskjs=require(_0x874b('0x10'));var toCsv=require('to-csv');var querystring=require(_0x874b('0x11'));var Papa=require(_0x874b('0x12'));var Redis=require(_0x874b('0x13'));var authService=require(_0x874b('0x14'));var qs=require(_0x874b('0x15'));var as=require(_0x874b('0x16'));var hardwareService=require(_0x874b('0x17'));var logger=require('../../config/logger')(_0x874b('0x18'));var utils=require(_0x874b('0x19'));var config=require(_0x874b('0x1a'));var licenseUtil=require(_0x874b('0x1b'));var db=require('../../mysqldb')['db'];config[_0x874b('0x1c')]=_[_0x874b('0x1d')](config[_0x874b('0x1c')],{'host':_0x874b('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x874b('0x1c')]));require(_0x874b('0x1f'))[_0x874b('0x20')](socket);function respondWithStatusCode(_0x3ee409,_0x1e123d){_0x1e123d=_0x1e123d||0xcc;return function(_0x56c732){if(_0x56c732){return _0x3ee409[_0x874b('0x21')](_0x1e123d);}return _0x3ee409[_0x874b('0x22')](_0x1e123d)[_0x874b('0x23')]();};}function respondWithResult(_0x4c327e,_0x247afc){_0x247afc=_0x247afc||0xc8;return function(_0x3230ed){if(_0x3230ed){return _0x4c327e['status'](_0x247afc)[_0x874b('0x24')](_0x3230ed);}};}function respondWithFilteredResult(_0x230612,_0x41b323){return function(_0x27d943){if(_0x27d943){var _0x4c2ffb=typeof _0x41b323[_0x874b('0x25')]==='undefined'&&typeof _0x41b323['limit']===_0x874b('0x26');var _0x4c701a=_0x27d943[_0x874b('0x27')];var _0x30b4e0=_0x4c2ffb?0x0:_0x41b323[_0x874b('0x25')];var _0x30632d=_0x4c2ffb?_0x27d943[_0x874b('0x27')]:_0x41b323['offset']+_0x41b323[_0x874b('0x28')];var _0x5972fd;if(_0x30632d>=_0x4c701a){_0x30632d=_0x4c701a;_0x5972fd=0xc8;}else{_0x5972fd=0xce;}_0x230612['status'](_0x5972fd);return _0x230612[_0x874b('0x29')]('Content-Range',_0x30b4e0+'-'+_0x30632d+'/'+_0x4c701a)[_0x874b('0x24')](_0x27d943);}return null;};}function patchUpdates(_0x3c7bb3){return function(_0x583936){try{jsonpatch[_0x874b('0x2a')](_0x583936,_0x3c7bb3,!![]);}catch(_0x233dec){return BPromise[_0x874b('0x2b')](_0x233dec);}return _0x583936[_0x874b('0x2c')]();};}function saveUpdates(_0x30b18c,_0xeaca0c){return function(_0x37a5c6){if(_0x37a5c6){return _0x37a5c6[_0x874b('0x2d')](_0x30b18c)[_0x874b('0x2e')](function(_0x5bcb28){return _0x5bcb28;});}return null;};}function removeEntity(_0x52aa2f,_0x570243){return function(_0xe0ddbd){if(_0xe0ddbd){return _0xe0ddbd[_0x874b('0x2f')]()[_0x874b('0x2e')](function(){var _0x4f8d74=_0xe0ddbd['get']({'plain':!![]});var _0x3a07cc='MailQueues';return db[_0x874b('0x30')][_0x874b('0x2f')]({'where':{'type':_0x3a07cc,'resourceId':_0x4f8d74['id']}})[_0x874b('0x2e')](function(){return _0xe0ddbd;});})[_0x874b('0x2e')](function(){_0x52aa2f[_0x874b('0x22')](0xcc)[_0x874b('0x23')]();});}};}function handleEntityNotFound(_0x41c7ef,_0xc87f74){return function(_0x55c3ad){if(!_0x55c3ad){_0x41c7ef[_0x874b('0x21')](0x194);}return _0x55c3ad;};}function handleError(_0xb2b71b,_0x98ba29){_0x98ba29=_0x98ba29||0x1f4;return function(_0x21695c){logger[_0x874b('0x31')](_0x21695c[_0x874b('0x32')]);if(_0x21695c[_0x874b('0x33')]){delete _0x21695c[_0x874b('0x33')];}_0xb2b71b[_0x874b('0x22')](_0x98ba29)[_0x874b('0x34')](_0x21695c);};}exports[_0x874b('0x35')]=function(_0x25989e,_0x182239){var _0x526e92={},_0x82b21a={},_0x442244={'count':0x0,'rows':[]};var _0x20ecf1=_['map'](db['MailQueue']['rawAttributes'],function(_0x502c8e){return{'name':_0x502c8e['fieldName'],'type':_0x502c8e[_0x874b('0x36')][_0x874b('0x37')]};});_0x82b21a['model']=_[_0x874b('0x38')](_0x20ecf1,_0x874b('0x33'));_0x82b21a[_0x874b('0x39')]=_['keys'](_0x25989e[_0x874b('0x39')]);_0x82b21a['filters']=_[_0x874b('0x3a')](_0x82b21a['model'],_0x82b21a[_0x874b('0x39')]);_0x526e92['attributes']=_[_0x874b('0x3a')](_0x82b21a[_0x874b('0x3b')],qs[_0x874b('0x3c')](_0x25989e[_0x874b('0x39')]['fields']));_0x526e92[_0x874b('0x3d')]=_0x526e92[_0x874b('0x3d')][_0x874b('0x3e')]?_0x526e92[_0x874b('0x3d')]:_0x82b21a['model'];if(!_0x25989e[_0x874b('0x39')][_0x874b('0x3f')](_0x874b('0x40'))){_0x526e92[_0x874b('0x28')]=qs[_0x874b('0x28')](_0x25989e['query']['limit']);_0x526e92[_0x874b('0x25')]=qs[_0x874b('0x25')](_0x25989e['query']['offset']);}_0x526e92[_0x874b('0x41')]=qs[_0x874b('0x42')](_0x25989e[_0x874b('0x39')][_0x874b('0x42')]);_0x526e92['where']=qs['filters'](_[_0x874b('0x43')](_0x25989e[_0x874b('0x39')],_0x82b21a[_0x874b('0x44')]),_0x20ecf1);if(_0x25989e[_0x874b('0x39')][_0x874b('0x45')]){_0x526e92['where']=_[_0x874b('0x46')](_0x526e92[_0x874b('0x47')],{'$or':_[_0x874b('0x38')](_0x20ecf1,function(_0x1325cc){if(_0x1325cc[_0x874b('0x36')]!=='VIRTUAL'){var _0x3dcdae={};_0x3dcdae[_0x1325cc[_0x874b('0x33')]]={'$like':'%'+_0x25989e['query'][_0x874b('0x45')]+'%'};return _0x3dcdae;}})});}_0x526e92=_['merge']({},_0x526e92,_0x25989e[_0x874b('0x48')]);var _0x1003ae={'where':_0x526e92[_0x874b('0x47')]};return db[_0x874b('0x49')][_0x874b('0x27')](_0x1003ae)[_0x874b('0x2e')](function(_0x1616d8){_0x442244[_0x874b('0x27')]=_0x1616d8;if(_0x25989e[_0x874b('0x39')]['includeAll']){_0x526e92['include']=[{'all':!![]}];}return db[_0x874b('0x49')]['findAll'](_0x526e92);})[_0x874b('0x2e')](function(_0x159357){_0x442244[_0x874b('0x4a')]=_0x159357;return _0x442244;})['then'](respondWithFilteredResult(_0x182239,_0x526e92))[_0x874b('0x4b')](handleError(_0x182239,null));};exports['show']=function(_0x4f8336,_0xcec684){var _0x20ef4d={'raw':!![],'where':{'id':_0x4f8336[_0x874b('0x4c')]['id']}},_0x21e4c0={};_0x21e4c0[_0x874b('0x3b')]=_[_0x874b('0x4d')](db['MailQueue']['rawAttributes']);_0x21e4c0[_0x874b('0x39')]=_[_0x874b('0x4d')](_0x4f8336[_0x874b('0x39')]);_0x21e4c0[_0x874b('0x44')]=_[_0x874b('0x3a')](_0x21e4c0[_0x874b('0x3b')],_0x21e4c0['query']);_0x20ef4d[_0x874b('0x3d')]=_['intersection'](_0x21e4c0[_0x874b('0x3b')],qs[_0x874b('0x3c')](_0x4f8336[_0x874b('0x39')][_0x874b('0x3c')]));_0x20ef4d[_0x874b('0x3d')]=_0x20ef4d[_0x874b('0x3d')][_0x874b('0x3e')]?_0x20ef4d[_0x874b('0x3d')]:_0x21e4c0['model'];if(_0x4f8336['query']['includeAll']){_0x20ef4d[_0x874b('0x4e')]=[{'all':!![]}];}_0x20ef4d=_['merge']({},_0x20ef4d,_0x4f8336['options']);return db[_0x874b('0x49')][_0x874b('0x4f')](_0x20ef4d)[_0x874b('0x2e')](handleEntityNotFound(_0xcec684,null))[_0x874b('0x2e')](respondWithResult(_0xcec684,null))[_0x874b('0x4b')](handleError(_0xcec684,null));};exports[_0x874b('0x50')]=function(_0xaec2c,_0x5d68a4){return db[_0x874b('0x49')][_0x874b('0x50')](_0xaec2c[_0x874b('0x51')],{})['then'](function(_0x163502){var _0x1dfffa=_0xaec2c[_0x874b('0x52')][_0x874b('0x53')]({'plain':!![]});if(!_0x1dfffa)throw new Error(_0x874b('0x54'));if(_0x1dfffa[_0x874b('0x55')]===_0x874b('0x52')){var _0xd88d36=_0x163502[_0x874b('0x53')]({'plain':!![]});var _0x45a03f=_0x874b('0x56');return db[_0x874b('0x57')][_0x874b('0x4f')]({'where':{'name':_0x45a03f,'userProfileId':_0x1dfffa['userProfileId']},'raw':!![]})[_0x874b('0x2e')](function(_0x2a620e){if(_0x2a620e&&_0x2a620e[_0x874b('0x58')]===0x0){return db[_0x874b('0x30')]['create']({'name':_0xd88d36['name'],'resourceId':_0xd88d36['id'],'type':_0x2a620e['name'],'sectionId':_0x2a620e['id']},{})[_0x874b('0x2e')](function(){return _0x163502;});}else{return _0x163502;}})[_0x874b('0x4b')](function(_0x5a42d8){logger[_0x874b('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a42d8);throw _0x5a42d8;});}return _0x163502;})[_0x874b('0x2e')](respondWithResult(_0x5d68a4,0xc9))[_0x874b('0x4b')](handleError(_0x5d68a4,null));};exports[_0x874b('0x2d')]=function(_0xa38d4d,_0x1ee0ea){if(_0xa38d4d[_0x874b('0x51')]['id']){delete _0xa38d4d['body']['id'];}return db[_0x874b('0x49')][_0x874b('0x4f')]({'where':{'id':_0xa38d4d['params']['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x1ee0ea,null))['then'](saveUpdates(_0xa38d4d[_0x874b('0x51')],null))[_0x874b('0x2e')](respondWithResult(_0x1ee0ea,null))['catch'](handleError(_0x1ee0ea,null));};exports[_0x874b('0x2f')]=function(_0x34bff5,_0x2730ec){return db[_0x874b('0x49')]['find']({'where':{'id':_0x34bff5[_0x874b('0x4c')]['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x2730ec,null))['then'](removeEntity(_0x2730ec,null))[_0x874b('0x4b')](handleError(_0x2730ec,null));};exports[_0x874b('0x59')]=function(_0x4f2356,_0x154df7){return db[_0x874b('0x49')][_0x874b('0x59')]()[_0x874b('0x2e')](respondWithResult(_0x154df7,null))['catch'](handleError(_0x154df7,null));};exports['getMembers']=function(_0x5d3841,_0x370a69,_0x2afcfa){var _0xa2b776={'raw':!![],'where':{}},_0x41e332={},_0x5dfdb3;return db['MailQueue']['findOne']({'where':{'id':_0x5d3841['params']['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x370a69,null))[_0x874b('0x2e')](function(_0x4797a5){if(_0x4797a5){_0x5dfdb3=_0x4797a5[_0x874b('0x53')]({'plain':!![]});_0x41e332[_0x874b('0x3b')]=_[_0x874b('0x4d')](db[_0x874b('0x5a')][_0x874b('0x5b')]);_0x41e332[_0x874b('0x39')]=_[_0x874b('0x4d')](_0x5d3841[_0x874b('0x39')]);_0x41e332[_0x874b('0x44')]=_['intersection'](_0x41e332[_0x874b('0x3b')],_0x41e332['query']);_0xa2b776['attributes']=_[_0x874b('0x3a')](_0x41e332[_0x874b('0x3b')],qs[_0x874b('0x3c')](_0x5d3841['query'][_0x874b('0x3c')]));_0xa2b776[_0x874b('0x3d')]=_0xa2b776[_0x874b('0x3d')]['length']?_0xa2b776['attributes']:_0x41e332[_0x874b('0x3b')];if(!_0x5d3841[_0x874b('0x39')][_0x874b('0x3f')](_0x874b('0x40'))){_0xa2b776[_0x874b('0x28')]=qs[_0x874b('0x28')](_0x5d3841['query'][_0x874b('0x28')]);_0xa2b776['offset']=qs[_0x874b('0x25')](_0x5d3841['query']['offset']);}_0xa2b776[_0x874b('0x41')]=qs[_0x874b('0x42')](_0x5d3841['query']['sort']);_0xa2b776[_0x874b('0x47')]=qs['filters'](_['pick'](_0x5d3841['query'],_0x41e332['filters']));_0xa2b776[_0x874b('0x47')][_0x874b('0x5c')]=_0x4797a5['id'];if(_0x5d3841[_0x874b('0x39')][_0x874b('0x45')]){_0xa2b776[_0x874b('0x47')]=_[_0x874b('0x46')](_0xa2b776[_0x874b('0x47')],{'$or':_[_0x874b('0x38')](_0xa2b776[_0x874b('0x3d')],function(_0x5d4588){var _0x5a69b1={};_0x5a69b1[_0x5d4588]={'$like':'%'+_0x5d3841['query']['filter']+'%'};return _0x5a69b1;})});}_0xa2b776=_[_0x874b('0x46')]({},_0xa2b776,_0x5d3841[_0x874b('0x48')]);return db[_0x874b('0x5a')][_0x874b('0x5d')](_0xa2b776);}})[_0x874b('0x2e')](function(_0x28992d){if(_0x28992d){return db['User'][_0x874b('0x5e')]({'where':{'id':_[_0x874b('0x38')](_0x28992d,_0x874b('0x5f')),'role':_0x874b('0x60')},'attributes':['id',_0x874b('0x33'),_0x874b('0x61'),_0x874b('0x62'),'createdAt']});}})[_0x874b('0x2e')](function(_0x339659){if(_0x339659){return{'count':_0x339659[_0x874b('0x27')],'rows':_[_0x874b('0x38')](_0x339659[_0x874b('0x4a')],function(_0x233c74){return{'membername':_0x233c74['name'],'UserId':_0x233c74['id'],'queue_name':_0x5dfdb3[_0x874b('0x33')],'MailQueueId':_0x5dfdb3['id'],'interface':util['format'](_0x874b('0x63'),'SIP',_0x233c74['name']),'penalty':0x0,'paused':_0x233c74[_0x874b('0x61')],'createdAt':_0x233c74[_0x874b('0x64')],'updatedAt':_0x233c74[_0x874b('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x874b('0x2e')](respondWithFilteredResult(_0x370a69,_0xa2b776))[_0x874b('0x4b')](handleError(_0x370a69,null));};exports[_0x874b('0x65')]=function(_0x21609f,_0x13c6e4,_0x355a0b){var _0x1010b9={};var _0x26ad94={};var _0x1cd369;var _0x3e48aa;return db['MailQueue']['findOne']({'where':{'id':_0x21609f['params']['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x13c6e4,null))[_0x874b('0x2e')](function(_0x9da568){if(_0x9da568){_0x1cd369=_0x9da568;_0x26ad94['model']=_[_0x874b('0x4d')](db[_0x874b('0x66')]['rawAttributes']);_0x26ad94[_0x874b('0x39')]=_[_0x874b('0x4d')](_0x21609f[_0x874b('0x39')]);_0x26ad94[_0x874b('0x44')]=_[_0x874b('0x3a')](_0x26ad94['model'],_0x26ad94[_0x874b('0x39')]);_0x1010b9[_0x874b('0x3d')]=_[_0x874b('0x3a')](_0x26ad94[_0x874b('0x3b')],qs[_0x874b('0x3c')](_0x21609f[_0x874b('0x39')][_0x874b('0x3c')]));_0x1010b9[_0x874b('0x3d')]=_0x1010b9[_0x874b('0x3d')]['length']?_0x1010b9[_0x874b('0x3d')]:_0x26ad94[_0x874b('0x3b')];_0x1010b9['order']=qs[_0x874b('0x42')](_0x21609f[_0x874b('0x39')][_0x874b('0x42')]);_0x1010b9[_0x874b('0x47')]=qs['filters'](_[_0x874b('0x43')](_0x21609f[_0x874b('0x39')],_0x26ad94[_0x874b('0x44')]));if(_0x21609f['query']['filter']){_0x1010b9[_0x874b('0x47')]=_['merge'](_0x1010b9[_0x874b('0x47')],{'$or':_['map'](_0x1010b9[_0x874b('0x3d')],function(_0x2a812e){var _0x45cb2e={};_0x45cb2e[_0x2a812e]={'$like':'%'+_0x21609f[_0x874b('0x39')][_0x874b('0x45')]+'%'};return _0x45cb2e;})});}_0x1010b9=_['merge']({},_0x1010b9,_0x21609f[_0x874b('0x48')]);return _0x1cd369['getTeams'](_0x1010b9);}})['then'](function(_0x58092f){if(_0x58092f){_0x3e48aa=_0x58092f[_0x874b('0x3e')];if(!_0x21609f[_0x874b('0x39')][_0x874b('0x3f')](_0x874b('0x40'))){_0x1010b9['limit']=qs[_0x874b('0x28')](_0x21609f['query'][_0x874b('0x28')]);_0x1010b9[_0x874b('0x25')]=qs[_0x874b('0x25')](_0x21609f[_0x874b('0x39')][_0x874b('0x25')]);}return _0x1cd369['getTeams'](_0x1010b9);}})[_0x874b('0x2e')](function(_0x2746a7){if(_0x2746a7){return _0x2746a7?{'count':_0x3e48aa,'rows':_0x2746a7}:null;}})[_0x874b('0x2e')](respondWithResult(_0x13c6e4,null))['catch'](handleError(_0x13c6e4,null));};exports[_0x874b('0x67')]=function(_0x5e6b4e,_0x3d529e,_0x378847){var _0xc7094e=_0x5e6b4e[_0x874b('0x51')][_0x874b('0x68')];return db[_0x874b('0x66')][_0x874b('0x5d')]({'where':{'id':_0xc7094e},'attributes':['id'],'include':[{'model':db[_0x874b('0x69')],'as':'Agents','attributes':['id',_0x874b('0x33'),_0x874b('0x6a'),_0x874b('0x6b'),_0x874b('0x6c')],'raw':!![]}]})['then'](function(_0x399135){if(_0x399135){var _0xd55610=_['flatMap'](_0x399135,function(_0x483669){var _0xc690ba=_0x483669[_0x874b('0x53')]({'plain':!![]});return _0xc690ba[_0x874b('0x6d')];});return db[_0x874b('0x49')][_0x874b('0x4f')]({'where':{'id':_0x5e6b4e[_0x874b('0x4c')]['id']}})[_0x874b('0x2e')](function(_0x6a24ef){return db[_0x874b('0x6e')][_0x874b('0x6f')](function(_0xde977e){return _0x6a24ef['addTeams'](_0xc7094e,{'transaction':_0xde977e})[_0x874b('0x2e')](function(){return BPromise[_0x874b('0x70')](_0xd55610,function(_0x48dd06){return db[_0x874b('0x5a')][_0x874b('0x71')]({'where':{'UserId':_0x48dd06['id'],'MailQueueId':_0x5e6b4e[_0x874b('0x4c')]['id']},'transaction':_0xde977e});});})[_0x874b('0x2e')](function(){_0xd55610[_0x874b('0x72')](function(_0x36a3e6){socket[_0x874b('0x73')]('userMailQueue:save',{'UserId':_0x36a3e6['id'],'MailQueueId':_0x6a24ef['id']});});});});});}})[_0x874b('0x2e')](respondWithStatusCode(_0x3d529e,null))[_0x874b('0x4b')](handleError(_0x3d529e,null));};exports['removeTeams']=function(_0x3ea929,_0x18d564,_0x1fcb47){return db['Team'][_0x874b('0x5d')]({'where':{'id':_0x3ea929['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x874b('0x69')],'as':_0x874b('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x18d564,null))[_0x874b('0x2e')](function(_0x38ee3d){var _0x82d142=_[_0x874b('0x38')](_0x38ee3d,'id');var _0x318437=[];var _0x35ac42=[];var _0x4e5931=squel[_0x874b('0x74')]();_0x4e5931['field'](_0x874b('0x75'))[_0x874b('0x76')](_0x874b('0x77'),'tq')[_0x874b('0x78')](_0x874b('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x874b('0x47')](_0x874b('0x7a'),_0x3ea929['params']['id']);for(var _0x2a74ee=0x0;_0x2a74ee<_0x38ee3d[_0x874b('0x3e')];_0x2a74ee+=0x1){let _0x4800b2=_0x38ee3d[_0x2a74ee];for(var _0x289eeb=0x0;_0x289eeb<_0x4800b2[_0x874b('0x6d')]['length'];_0x289eeb+=0x1){let _0x1451ee=_0x4800b2[_0x874b('0x6d')][_0x289eeb];var _0x180601=_0x4e5931[_0x874b('0x7b')]();_0x180601[_0x874b('0x47')]('ut.UserId\x20=\x20?',_0x1451ee['id']);_0x35ac42['push'](db[_0x874b('0x6e')][_0x874b('0x39')](_0x180601['toString'](),{'type':db[_0x874b('0x6e')]['QueryTypes'][_0x874b('0x7c')]})[_0x874b('0x2e')](function(_0x188af9){if(_0x188af9[_0x874b('0x3e')]===0x1){return _0x1451ee['id'];}else{var _0x2e05d8=_[_0x874b('0x7d')](_['map'](_0x188af9,_0x874b('0x7e')),function(_0x381621){return _['includes'](_0x82d142,_0x381621);});if(_0x2e05d8){return _0x1451ee['id'];}}}));}}return BPromise[_0x874b('0x7f')](_0x35ac42)[_0x874b('0x2e')](function(_0x19f41c){_0x318437=_(_0x318437)['union'](_0x19f41c)[_0x874b('0x80')]()[_0x874b('0x81')]();return db['MailQueue'][_0x874b('0x4f')]({'where':{'id':_0x3ea929[_0x874b('0x4c')]['id']}})[_0x874b('0x2e')](function(_0x3d0ddd){return db[_0x874b('0x6e')][_0x874b('0x6f')](function(_0x261bf9){return _0x3d0ddd[_0x874b('0x82')](_0x3ea929[_0x874b('0x39')][_0x874b('0x68')],{'transaction':_0x261bf9})['then'](function(){if(!_[_0x874b('0x83')](_0x318437)){return _0x3d0ddd[_0x874b('0x84')](_0x318437,{'transaction':_0x261bf9});}})[_0x874b('0x2e')](function(){_0x318437['forEach'](function(_0x5c5194){socket['emit'](_0x874b('0x85'),{'UserId':_0x5c5194,'MailQueueId':_0x3d0ddd['id']});});});});});});})['then'](respondWithStatusCode(_0x18d564,null))['catch'](handleError(_0x18d564,null));};exports[_0x874b('0x86')]=function(_0x2afc39,_0x163ff1,_0x5e831c){return db[_0x874b('0x49')]['find']({'where':{'id':_0x2afc39['params']['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x163ff1,null))[_0x874b('0x2e')](function(_0x28d33d){if(_0x28d33d){return _0x28d33d[_0x874b('0x86')](_0x2afc39['body'][_0x874b('0x68')],_[_0x874b('0x87')](_0x2afc39[_0x874b('0x51')],[_0x874b('0x68'),'id'])||{})[_0x874b('0x88')](function(_0x41add1){for(var _0x4add01=0x0;_0x4add01<_0x2afc39[_0x874b('0x51')][_0x874b('0x68')][_0x874b('0x3e')];_0x4add01+=0x1){socket[_0x874b('0x73')]('userMailQueue:save',{'UserId':Number(_0x2afc39[_0x874b('0x51')]['ids'][_0x4add01]),'MailQueueId':Number(_0x2afc39[_0x874b('0x4c')]['id'])});}return _0x41add1;});}})[_0x874b('0x2e')](respondWithResult(_0x163ff1,null))['catch'](handleError(_0x163ff1,null));};exports[_0x874b('0x84')]=function(_0xb942e3,_0x36f74d,_0x361630){return db[_0x874b('0x49')]['find']({'where':{'id':_0xb942e3[_0x874b('0x4c')]['id']}})[_0x874b('0x2e')](handleEntityNotFound(_0x36f74d,null))[_0x874b('0x2e')](function(_0x36d829){if(_0x36d829){return _0x36d829[_0x874b('0x84')](_0xb942e3[_0x874b('0x39')]['ids'])[_0x874b('0x2e')](function(){if(_['isArray'](_0xb942e3[_0x874b('0x39')][_0x874b('0x68')])){for(var _0x20a719=0x0;_0x20a719<_0xb942e3[_0x874b('0x39')]['ids'][_0x874b('0x3e')];_0x20a719+=0x1){socket[_0x874b('0x73')](_0x874b('0x85'),{'UserId':Number(_0xb942e3['query'][_0x874b('0x68')][_0x20a719]),'MailQueueId':Number(_0xb942e3['params']['id'])});}}else{socket[_0x874b('0x73')](_0x874b('0x85'),{'UserId':Number(_0xb942e3[_0x874b('0x39')][_0x874b('0x68')]),'MailQueueId':Number(_0xb942e3[_0x874b('0x4c')]['id'])});}});}})[_0x874b('0x2e')](respondWithStatusCode(_0x36f74d,null))['catch'](handleError(_0x36f74d,null));};exports[_0x874b('0x89')]=function(_0x14d158,_0x1d4726,_0x26d8b6){var _0xed2e1b={};var _0x73b13c={};var _0x15b358;var _0x40ad2b;return db[_0x874b('0x49')][_0x874b('0x8a')]({'where':{'id':_0x14d158['params']['id']}})['then'](handleEntityNotFound(_0x1d4726,null))[_0x874b('0x2e')](function(_0x3050b2){if(_0x3050b2){_0x15b358=_0x3050b2;_0x73b13c[_0x874b('0x3b')]=_[_0x874b('0x4d')](db[_0x874b('0x69')][_0x874b('0x5b')]);_0x73b13c[_0x874b('0x39')]=_[_0x874b('0x4d')](_0x14d158[_0x874b('0x39')]);_0x73b13c[_0x874b('0x44')]=_[_0x874b('0x3a')](_0x73b13c[_0x874b('0x3b')],_0x73b13c['query']);_0xed2e1b['attributes']=_[_0x874b('0x3a')](_0x73b13c[_0x874b('0x3b')],qs[_0x874b('0x3c')](_0x14d158[_0x874b('0x39')]['fields']));_0xed2e1b[_0x874b('0x3d')]=_0xed2e1b[_0x874b('0x3d')][_0x874b('0x3e')]?_0xed2e1b['attributes']:_0x73b13c[_0x874b('0x3b')];_0xed2e1b[_0x874b('0x41')]=qs[_0x874b('0x42')](_0x14d158[_0x874b('0x39')][_0x874b('0x42')]);_0xed2e1b['where']=qs[_0x874b('0x44')](_[_0x874b('0x43')](_0x14d158[_0x874b('0x39')],_0x73b13c[_0x874b('0x44')]));if(_0x14d158['query']['filter']){_0xed2e1b[_0x874b('0x47')]=_[_0x874b('0x46')](_0xed2e1b[_0x874b('0x47')],{'$or':_[_0x874b('0x38')](_0xed2e1b['attributes'],function(_0x2e35cb){var _0xe0e5ed={};_0xe0e5ed[_0x2e35cb]={'$like':'%'+_0x14d158[_0x874b('0x39')][_0x874b('0x45')]+'%'};return _0xe0e5ed;})});}_0xed2e1b=_[_0x874b('0x46')]({},_0xed2e1b,_0x14d158[_0x874b('0x48')]);return _0x15b358[_0x874b('0x89')](_0xed2e1b);}})[_0x874b('0x2e')](function(_0x399703){if(_0x399703){_0x40ad2b=_0x399703['length'];if(!_0x14d158[_0x874b('0x39')][_0x874b('0x3f')](_0x874b('0x40'))){_0xed2e1b[_0x874b('0x28')]=qs[_0x874b('0x28')](_0x14d158['query'][_0x874b('0x28')]);_0xed2e1b[_0x874b('0x25')]=qs['offset'](_0x14d158[_0x874b('0x39')][_0x874b('0x25')]);}return _0x15b358[_0x874b('0x89')](_0xed2e1b);}})['then'](function(_0x2fe749){if(_0x2fe749){return _0x2fe749?{'count':_0x40ad2b,'rows':_0x2fe749}:null;}})['then'](respondWithResult(_0x1d4726,null))[_0x874b('0x4b')](handleError(_0x1d4726,null));};
\ No newline at end of file
index 9c9753f..85156a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x347a=['hasOwnProperty','hook','exports','MailQueue','setMaxListeners','update','remove','emit'];(function(_0x245835,_0x305d6a){var _0x5bcfd3=function(_0x13a2de){while(--_0x13a2de){_0x245835['push'](_0x245835['shift']());}};_0x5bcfd3(++_0x305d6a);}(_0x347a,0x14b));var _0xa347=function(_0x5c082a,_0x19ac27){_0x5c082a=_0x5c082a-0x0;var _0x3b60ac=_0x347a[_0x5c082a];return _0x3b60ac;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0xa347('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa347('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa347('0x2'),'afterDestroy':_0xa347('0x3')};function emitEvent(_0x17325){return function(_0x3aa6fb,_0x5a1a4c,_0xcd54ef){MailQueueEvents[_0xa347('0x4')](_0x17325+':'+_0x3aa6fb['id'],_0x3aa6fb);MailQueueEvents[_0xa347('0x4')](_0x17325,_0x3aa6fb);_0xcd54ef(null);};}for(var e in events){if(events[_0xa347('0x5')](e)){var event=events[e];MailQueue[_0xa347('0x6')](e,emitEvent(event));}}module[_0xa347('0x7')]=MailQueueEvents;
\ No newline at end of file
+var _0xd89f=['update','emit','hasOwnProperty','hook','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0xd89f,0x97));var _0xfd89=function(_0x16906a,_0x2268ea){_0x16906a=_0x16906a-0x0;var _0x559694=_0xd89f[_0x16906a];return _0x559694;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0xfd89('0x0'))['db'][_0xfd89('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xfd89('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfd89('0x3'),'afterDestroy':'remove'};function emitEvent(_0x38c7d8){return function(_0x47aaec,_0x297d98,_0x5198f1){MailQueueEvents[_0xfd89('0x4')](_0x38c7d8+':'+_0x47aaec['id'],_0x47aaec);MailQueueEvents[_0xfd89('0x4')](_0x38c7d8,_0x47aaec);_0x5198f1(null);};}for(var e in events){if(events[_0xfd89('0x5')](e)){var event=events[e];MailQueue[_0xfd89('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents;
\ No newline at end of file
index cba351e..4b82e4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6ec=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util'];(function(_0x2586f8,_0x5b3fc5){var _0x5887c7=function(_0x405326){while(--_0x405326){_0x2586f8['push'](_0x2586f8['shift']());}};_0x5887c7(++_0x5b3fc5);}(_0xb6ec,0x19e));var _0xcb6e=function(_0x5223a4,_0x5d02fa){_0x5223a4=_0x5223a4-0x0;var _0x39d88e=_0xb6ec[_0x5223a4];return _0x39d88e;};'use strict';var _=require(_0xcb6e('0x0'));var util=require(_0xcb6e('0x1'));var logger=require(_0xcb6e('0x2'))(_0xcb6e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb6e('0x4'));var fs=require('fs');var path=require(_0xcb6e('0x5'));var rimraf=require(_0xcb6e('0x6'));var config=require(_0xcb6e('0x7'));var attributes=require(_0xcb6e('0x8'));module[_0xcb6e('0x9')]=function(_0x24976d,_0x447513){return _0x24976d[_0xcb6e('0xa')](_0xcb6e('0xb'),attributes,{'tableName':_0xcb6e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1e63=['./mailQueue.attributes','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x4413f9,_0xb14b2){var _0x326096=function(_0x20abba){while(--_0x20abba){_0x4413f9['push'](_0x4413f9['shift']());}};_0x326096(++_0xb14b2);}(_0x1e63,0x1b1));var _0x31e6=function(_0x143909,_0x260f7d){_0x143909=_0x143909-0x0;var _0x5c4538=_0x1e63[_0x143909];return _0x5c4538;};'use strict';var _=require(_0x31e6('0x0'));var util=require(_0x31e6('0x1'));var logger=require(_0x31e6('0x2'))(_0x31e6('0x3'));var moment=require(_0x31e6('0x4'));var BPromise=require('bluebird');var rp=require(_0x31e6('0x5'));var fs=require('fs');var path=require(_0x31e6('0x6'));var rimraf=require(_0x31e6('0x7'));var config=require(_0x31e6('0x8'));var attributes=require(_0x31e6('0x9'));module['exports']=function(_0x237f2e,_0x5173be){return _0x237f2e[_0x31e6('0xa')](_0x31e6('0xb'),attributes,{'tableName':_0x31e6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 19d5651..55ecb70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d19=['limit','include','map','model','attributes','then','ShowMailQueue','find','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','options','where'];(function(_0x2f8947,_0x3a89ed){var _0xe3d33c=function(_0x12ee64){while(--_0x12ee64){_0x2f8947['push'](_0x2f8947['shift']());}};_0xe3d33c(++_0x3a89ed);}(_0x2d19,0x1b5));var _0x92d1=function(_0x22b39b,_0x2b7d63){_0x22b39b=_0x22b39b-0x0;var _0x280e1d=_0x2d19[_0x22b39b];return _0x280e1d;};'use strict';var _=require(_0x92d1('0x0'));var util=require('util');var moment=require(_0x92d1('0x1'));var BPromise=require(_0x92d1('0x2'));var rs=require(_0x92d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x92d1('0x4'))['db'];var utils=require(_0x92d1('0x5'));var logger=require('../../config/logger')(_0x92d1('0x6'));var config=require(_0x92d1('0x7'));var jayson=require(_0x92d1('0x8'));var client=jayson['client'][_0x92d1('0x9')]({'port':0x232a});config[_0x92d1('0xa')]=_[_0x92d1('0xb')](config[_0x92d1('0xa')],{'host':_0x92d1('0xc'),'port':0x18eb});var socket=require(_0x92d1('0xd'))(new Redis(config[_0x92d1('0xa')]));require(_0x92d1('0xe'))[_0x92d1('0xf')](socket);function respondWithRpcPromise(_0x2c0e1f,_0x4d8047,_0x12b6d0){return new BPromise(function(_0x1424e7,_0x4c941b){return client['request'](_0x2c0e1f,_0x12b6d0)['then'](function(_0x3b116b){logger[_0x92d1('0x10')](_0x92d1('0x11'),_0x4d8047,_0x92d1('0x12'));logger[_0x92d1('0x13')](_0x92d1('0x14'),_0x4d8047,'request\x20sent',JSON[_0x92d1('0x15')](_0x3b116b));if(_0x3b116b[_0x92d1('0x16')]){if(_0x3b116b[_0x92d1('0x16')][_0x92d1('0x17')]===0x1f4){logger[_0x92d1('0x16')](_0x92d1('0x11'),_0x4d8047,_0x3b116b[_0x92d1('0x16')][_0x92d1('0x18')]);return _0x4c941b(_0x3b116b[_0x92d1('0x16')][_0x92d1('0x18')]);}logger['error'](_0x92d1('0x11'),_0x4d8047,_0x3b116b[_0x92d1('0x16')][_0x92d1('0x18')]);return _0x1424e7(_0x3b116b[_0x92d1('0x16')][_0x92d1('0x18')]);}else{logger[_0x92d1('0x10')](_0x92d1('0x11'),_0x4d8047,_0x92d1('0x12'));_0x1424e7(_0x3b116b[_0x92d1('0x19')][_0x92d1('0x18')]);}})[_0x92d1('0x1a')](function(_0x3e54ad){logger['error'](_0x92d1('0x11'),_0x4d8047,_0x3e54ad);_0x4c941b(_0x3e54ad);});});}exports[_0x92d1('0x1b')]=function(_0x402ab1){var _0x408a8a=this;return new Promise(function(_0xfedfdb,_0x150fa2){return db[_0x92d1('0x1c')]['findAll']({'raw':_0x402ab1[_0x92d1('0x1d')]?_0x402ab1[_0x92d1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x402ab1[_0x92d1('0x1d')]?_0x402ab1[_0x92d1('0x1d')][_0x92d1('0x1e')]||null:null,'attributes':_0x402ab1[_0x92d1('0x1d')]?_0x402ab1[_0x92d1('0x1d')]['attributes']||null:null,'limit':_0x402ab1[_0x92d1('0x1d')]?_0x402ab1[_0x92d1('0x1d')][_0x92d1('0x1f')]||null:null,'include':_0x402ab1[_0x92d1('0x1d')]?_0x402ab1[_0x92d1('0x1d')][_0x92d1('0x20')]?_[_0x92d1('0x21')](_0x402ab1[_0x92d1('0x1d')][_0x92d1('0x20')],function(_0x298e79){return{'model':db[_0x298e79[_0x92d1('0x22')]],'as':_0x298e79['as'],'attributes':_0x298e79['attributes'],'include':_0x298e79[_0x92d1('0x20')]?_[_0x92d1('0x21')](_0x298e79['include'],function(_0x2ba4b0){return{'model':db[_0x2ba4b0[_0x92d1('0x22')]],'as':_0x2ba4b0['as'],'attributes':_0x2ba4b0['attributes'],'include':_0x2ba4b0[_0x92d1('0x20')]?_['map'](_0x2ba4b0[_0x92d1('0x20')],function(_0xe3a2d5){return{'model':db[_0xe3a2d5[_0x92d1('0x22')]],'as':_0xe3a2d5['as'],'attributes':_0xe3a2d5[_0x92d1('0x23')]};}):[]};}):[]};}):[]:[]})[_0x92d1('0x24')](function(_0xb659fd){logger[_0x92d1('0x10')](_0x92d1('0x1b'),_0x402ab1);logger[_0x92d1('0x13')](_0x92d1('0x1b'),_0x402ab1,JSON[_0x92d1('0x15')](_0xb659fd));_0xfedfdb(_0xb659fd);})[_0x92d1('0x1a')](function(_0x14dfff){logger[_0x92d1('0x16')](_0x92d1('0x1b'),_0x14dfff[_0x92d1('0x18')],_0x402ab1);_0x150fa2(_0x408a8a['error'](0x1f4,_0x14dfff[_0x92d1('0x18')]));});});};exports[_0x92d1('0x25')]=function(_0x2d415f){var _0x595ae5=this;return new Promise(function(_0x1b69e7,_0x3e067a){return db['MailQueue'][_0x92d1('0x26')]({'raw':_0x2d415f['options']?_0x2d415f[_0x92d1('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2d415f['options']?_0x2d415f['options'][_0x92d1('0x1e')]||null:null,'attributes':_0x2d415f[_0x92d1('0x1d')]?_0x2d415f[_0x92d1('0x1d')]['attributes']||null:null,'include':_0x2d415f[_0x92d1('0x1d')]?_0x2d415f[_0x92d1('0x1d')][_0x92d1('0x20')]?_['map'](_0x2d415f['options'][_0x92d1('0x20')],function(_0xceb58c){return{'model':db[_0xceb58c[_0x92d1('0x22')]],'as':_0xceb58c['as'],'attributes':_0xceb58c[_0x92d1('0x23')],'include':_0xceb58c[_0x92d1('0x20')]?_[_0x92d1('0x21')](_0xceb58c[_0x92d1('0x20')],function(_0x4d928a){return{'model':db[_0x4d928a[_0x92d1('0x22')]],'as':_0x4d928a['as'],'attributes':_0x4d928a[_0x92d1('0x23')],'include':_0x4d928a[_0x92d1('0x20')]?_['map'](_0x4d928a[_0x92d1('0x20')],function(_0x49068b){return{'model':db[_0x49068b[_0x92d1('0x22')]],'as':_0x49068b['as'],'attributes':_0x49068b[_0x92d1('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b98ff){logger['info'](_0x92d1('0x25'),_0x2d415f);logger[_0x92d1('0x13')](_0x92d1('0x25'),_0x2d415f,JSON['stringify'](_0x1b98ff));_0x1b69e7(_0x1b98ff);})[_0x92d1('0x1a')](function(_0x2b24b3){logger[_0x92d1('0x16')](_0x92d1('0x25'),_0x2b24b3[_0x92d1('0x18')],_0x2d415f);_0x3e067a(_0x595ae5[_0x92d1('0x16')](0x1f4,_0x2b24b3[_0x92d1('0x18')]));});});};
\ No newline at end of file
+var _0x85b2=['http','defaults','localhost','redis','./mailQueue.socket','register','request','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','error','message','info','catch','GetMailQueue','MailQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowMailQueue','find','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x149f4d,_0x50a8c9){var _0xe153cf=function(_0x26c7e4){while(--_0x26c7e4){_0x149f4d['push'](_0x149f4d['shift']());}};_0xe153cf(++_0x50a8c9);}(_0x85b2,0x11a));var _0x285b=function(_0x12691d,_0x598ccb){_0x12691d=_0x12691d-0x0;var _0x285d64=_0x85b2[_0x12691d];return _0x285d64;};'use strict';var _=require(_0x285b('0x0'));var util=require(_0x285b('0x1'));var moment=require(_0x285b('0x2'));var BPromise=require('bluebird');var rs=require(_0x285b('0x3'));var fs=require('fs');var Redis=require(_0x285b('0x4'));var db=require(_0x285b('0x5'))['db'];var utils=require(_0x285b('0x6'));var logger=require(_0x285b('0x7'))(_0x285b('0x8'));var config=require(_0x285b('0x9'));var jayson=require(_0x285b('0xa'));var client=jayson[_0x285b('0xb')][_0x285b('0xc')]({'port':0x232a});config['redis']=_[_0x285b('0xd')](config['redis'],{'host':_0x285b('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x285b('0xf')]));require(_0x285b('0x10'))[_0x285b('0x11')](socket);function respondWithRpcPromise(_0x4eeaf1,_0x54a433,_0x2eab6e){return new BPromise(function(_0x429929,_0x24bfb8){return client[_0x285b('0x12')](_0x4eeaf1,_0x2eab6e)['then'](function(_0x492d88){logger['info'](_0x285b('0x13'),_0x54a433,_0x285b('0x14'));logger[_0x285b('0x15')](_0x285b('0x16'),_0x54a433,'request\x20sent',JSON['stringify'](_0x492d88));if(_0x492d88[_0x285b('0x17')]){if(_0x492d88[_0x285b('0x17')]['code']===0x1f4){logger[_0x285b('0x17')](_0x285b('0x13'),_0x54a433,_0x492d88[_0x285b('0x17')][_0x285b('0x18')]);return _0x24bfb8(_0x492d88[_0x285b('0x17')][_0x285b('0x18')]);}logger[_0x285b('0x17')](_0x285b('0x13'),_0x54a433,_0x492d88[_0x285b('0x17')][_0x285b('0x18')]);return _0x429929(_0x492d88[_0x285b('0x17')]['message']);}else{logger[_0x285b('0x19')](_0x285b('0x13'),_0x54a433,_0x285b('0x14'));_0x429929(_0x492d88['result'][_0x285b('0x18')]);}})[_0x285b('0x1a')](function(_0x2896b9){logger[_0x285b('0x17')](_0x285b('0x13'),_0x54a433,_0x2896b9);_0x24bfb8(_0x2896b9);});});}exports[_0x285b('0x1b')]=function(_0x33db9a){var _0x115c5d=this;return new Promise(function(_0x1577af,_0xa42e50){return db[_0x285b('0x1c')][_0x285b('0x1d')]({'raw':_0x33db9a[_0x285b('0x1e')]?_0x33db9a[_0x285b('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x33db9a['options']?_0x33db9a[_0x285b('0x1e')][_0x285b('0x1f')]||null:null,'attributes':_0x33db9a[_0x285b('0x1e')]?_0x33db9a[_0x285b('0x1e')][_0x285b('0x20')]||null:null,'limit':_0x33db9a[_0x285b('0x1e')]?_0x33db9a[_0x285b('0x1e')][_0x285b('0x21')]||null:null,'include':_0x33db9a['options']?_0x33db9a['options'][_0x285b('0x22')]?_[_0x285b('0x23')](_0x33db9a[_0x285b('0x1e')]['include'],function(_0x414b10){return{'model':db[_0x414b10[_0x285b('0x24')]],'as':_0x414b10['as'],'attributes':_0x414b10[_0x285b('0x20')],'include':_0x414b10['include']?_[_0x285b('0x23')](_0x414b10[_0x285b('0x22')],function(_0x1db08){return{'model':db[_0x1db08[_0x285b('0x24')]],'as':_0x1db08['as'],'attributes':_0x1db08[_0x285b('0x20')],'include':_0x1db08['include']?_[_0x285b('0x23')](_0x1db08[_0x285b('0x22')],function(_0x201095){return{'model':db[_0x201095['model']],'as':_0x201095['as'],'attributes':_0x201095['attributes']};}):[]};}):[]};}):[]:[]})[_0x285b('0x25')](function(_0x3fb61a){logger[_0x285b('0x19')](_0x285b('0x1b'),_0x33db9a);logger['debug'](_0x285b('0x1b'),_0x33db9a,JSON['stringify'](_0x3fb61a));_0x1577af(_0x3fb61a);})[_0x285b('0x1a')](function(_0x433968){logger[_0x285b('0x17')](_0x285b('0x1b'),_0x433968[_0x285b('0x18')],_0x33db9a);_0xa42e50(_0x115c5d[_0x285b('0x17')](0x1f4,_0x433968[_0x285b('0x18')]));});});};exports[_0x285b('0x26')]=function(_0x52e8d6){var _0x22c2ae=this;return new Promise(function(_0x29d984,_0x22e27e){return db[_0x285b('0x1c')][_0x285b('0x27')]({'raw':_0x52e8d6[_0x285b('0x1e')]?_0x52e8d6[_0x285b('0x1e')][_0x285b('0x28')]===undefined?!![]:![]:!![],'where':_0x52e8d6['options']?_0x52e8d6[_0x285b('0x1e')]['where']||null:null,'attributes':_0x52e8d6[_0x285b('0x1e')]?_0x52e8d6['options']['attributes']||null:null,'include':_0x52e8d6[_0x285b('0x1e')]?_0x52e8d6[_0x285b('0x1e')][_0x285b('0x22')]?_[_0x285b('0x23')](_0x52e8d6[_0x285b('0x1e')][_0x285b('0x22')],function(_0x117c9c){return{'model':db[_0x117c9c['model']],'as':_0x117c9c['as'],'attributes':_0x117c9c['attributes'],'include':_0x117c9c[_0x285b('0x22')]?_['map'](_0x117c9c['include'],function(_0x4cef75){return{'model':db[_0x4cef75['model']],'as':_0x4cef75['as'],'attributes':_0x4cef75['attributes'],'include':_0x4cef75[_0x285b('0x22')]?_['map'](_0x4cef75['include'],function(_0x53b410){return{'model':db[_0x53b410[_0x285b('0x24')]],'as':_0x53b410['as'],'attributes':_0x53b410[_0x285b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x285b('0x25')](function(_0x49653a){logger[_0x285b('0x19')](_0x285b('0x26'),_0x52e8d6);logger[_0x285b('0x15')](_0x285b('0x26'),_0x52e8d6,JSON[_0x285b('0x29')](_0x49653a));_0x29d984(_0x49653a);})[_0x285b('0x1a')](function(_0x19bc4b){logger[_0x285b('0x17')](_0x285b('0x26'),_0x19bc4b[_0x285b('0x18')],_0x52e8d6);_0x22e27e(_0x22c2ae['error'](0x1f4,_0x19bc4b[_0x285b('0x18')]));});});};
\ No newline at end of file
index 91c51d3..81e6b1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68ab=['remove','update','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x53a7eb,_0x1bfd4c){var _0x2092d1=function(_0x520acf){while(--_0x520acf){_0x53a7eb['push'](_0x53a7eb['shift']());}};_0x2092d1(++_0x1bfd4c);}(_0x68ab,0x76));var _0xb68a=function(_0x4bf485,_0xa8db09){_0x4bf485=_0x4bf485-0x0;var _0xdfb631=_0x68ab[_0x4bf485];return _0xdfb631;};'use strict';var MailQueueEvents=require(_0xb68a('0x0'));var events=[_0xb68a('0x1'),_0xb68a('0x2'),_0xb68a('0x3')];function createListener(_0x238b03,_0x29b5f2){return function(_0x328962){_0x29b5f2['emit'](_0x238b03,_0x328962);};}function removeListener(_0x5a53b2,_0x23444f){return function(){MailQueueEvents[_0xb68a('0x4')](_0x5a53b2,_0x23444f);};}exports[_0xb68a('0x5')]=function(_0x54d4bf){for(var _0x342565=0x0,_0x3b9be6=events[_0xb68a('0x6')];_0x342565<_0x3b9be6;_0x342565++){var _0x2643cb=events[_0x342565];var _0x3f2584=createListener(_0xb68a('0x7')+_0x2643cb,_0x54d4bf);MailQueueEvents['on'](_0x2643cb,_0x3f2584);}};
\ No newline at end of file
+var _0xa2dd=['remove','update','removeListener','mailQueue:','./mailQueue.events'];(function(_0x358281,_0x4ece3b){var _0x526624=function(_0x31b5b5){while(--_0x31b5b5){_0x358281['push'](_0x358281['shift']());}};_0x526624(++_0x4ece3b);}(_0xa2dd,0xea));var _0xda2d=function(_0x2846f1,_0x5de9e7){_0x2846f1=_0x2846f1-0x0;var _0x40c747=_0xa2dd[_0x2846f1];return _0x40c747;};'use strict';var MailQueueEvents=require(_0xda2d('0x0'));var events=['save',_0xda2d('0x1'),_0xda2d('0x2')];function createListener(_0x359103,_0x8dc1c1){return function(_0x33fb50){_0x8dc1c1['emit'](_0x359103,_0x33fb50);};}function removeListener(_0x47bd15,_0x1bdca8){return function(){MailQueueEvents[_0xda2d('0x3')](_0x47bd15,_0x1bdca8);};}exports['register']=function(_0xaebb41){for(var _0x3632c5=0x0,_0x3cd7a8=events['length'];_0x3632c5<_0x3cd7a8;_0x3632c5++){var _0x383063=events[_0x3632c5];var _0x210ad6=createListener(_0xda2d('0x4')+_0x383063,_0xaebb41);MailQueueEvents['on'](_0x383063,_0x210ad6);}};
\ No newline at end of file
index fd01f9d..09ee0c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc959=['delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/:id','post','create','put'];(function(_0x818a34,_0x3f83ce){var _0x21d62b=function(_0x36908b){while(--_0x36908b){_0x818a34['push'](_0x818a34['shift']());}};_0x21d62b(++_0x3f83ce);}(_0xc959,0x1c5));var _0x9c95=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xc959[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x9c95('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9c95('0x1'));var express=require('express');var router=express[_0x9c95('0x2')]();var fs_extra=require(_0x9c95('0x3'));var auth=require(_0x9c95('0x4'));var interaction=require(_0x9c95('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router['get']('/',auth[_0x9c95('0x6')](),controller['index']);router['get']('/describe',auth[_0x9c95('0x6')](),controller['describe']);router[_0x9c95('0x7')](_0x9c95('0x8'),auth[_0x9c95('0x6')](),controller['show']);router[_0x9c95('0x9')]('/',auth[_0x9c95('0x6')](),controller[_0x9c95('0xa')]);router[_0x9c95('0xb')](_0x9c95('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x9c95('0xc')](_0x9c95('0x8'),auth[_0x9c95('0x6')](),controller[_0x9c95('0xd')]);module[_0x9c95('0xe')]=router;
\ No newline at end of file
+var _0xcaa5=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueueReport.controller','index','get','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy'];(function(_0x915908,_0x333bc8){var _0x26a3ea=function(_0x4def06){while(--_0x4def06){_0x915908['push'](_0x915908['shift']());}};_0x26a3ea(++_0x333bc8);}(_0xcaa5,0x166));var _0x5caa=function(_0x4b7e4d,_0x82d2ab){_0x4b7e4d=_0x4b7e4d-0x0;var _0x38d6af=_0xcaa5[_0x4b7e4d];return _0x38d6af;};'use strict';var multer=require(_0x5caa('0x0'));var util=require(_0x5caa('0x1'));var path=require(_0x5caa('0x2'));var timeout=require(_0x5caa('0x3'));var express=require(_0x5caa('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5caa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5caa('0x6'));var controller=require(_0x5caa('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5caa('0x8')]);router[_0x5caa('0x9')](_0x5caa('0xa'),auth['isAuthenticated'](),controller[_0x5caa('0xb')]);router[_0x5caa('0x9')](_0x5caa('0xc'),auth[_0x5caa('0xd')](),controller[_0x5caa('0xe')]);router[_0x5caa('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5caa('0x10')](_0x5caa('0xc'),auth[_0x5caa('0xd')](),controller[_0x5caa('0x11')]);router[_0x5caa('0x12')](_0x5caa('0xc'),auth['isAuthenticated'](),controller[_0x5caa('0x13')]);module[_0x5caa('0x14')]=router;
\ No newline at end of file
index 4808310..5ba9295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0863=['DATE','moment','sequelize','STRING'];(function(_0x48e853,_0x9585c5){var _0x1e45fd=function(_0xbc4fe2){while(--_0xbc4fe2){_0x48e853['push'](_0x48e853['shift']());}};_0x1e45fd(++_0x9585c5);}(_0x0863,0x1c5));var _0x3086=function(_0x36b96a,_0x30ae54){_0x36b96a=_0x36b96a-0x0;var _0x2dc9fc=_0x0863[_0x36b96a];return _0x2dc9fc;};'use strict';var moment=require(_0x3086('0x0'));var Sequelize=require(_0x3086('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x3086('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3086('0x2')]},'joinAt':{'type':Sequelize[_0x3086('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc70a=['moment','sequelize','STRING','DATE'];(function(_0x2ab0c7,_0x5e7d42){var _0x4de4ea=function(_0x1317a3){while(--_0x1317a3){_0x2ab0c7['push'](_0x2ab0c7['shift']());}};_0x4de4ea(++_0x5e7d42);}(_0xc70a,0x78));var _0xac70=function(_0x1b7668,_0x378b1d){_0x1b7668=_0x1b7668-0x0;var _0x13762=_0xc70a[_0x1b7668];return _0x13762;};'use strict';var moment=require(_0xac70('0x0'));var Sequelize=require(_0xac70('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xac70('0x2')]},'joinAt':{'type':Sequelize[_0xac70('0x3')]},'leaveAt':{'type':Sequelize[_0xac70('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xac70('0x3')]},'reason':{'type':Sequelize[_0xac70('0x2')]}};
\ No newline at end of file
index 817a4ea..9c0a2e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x4e77c6,_0x4c359c){var _0x3e326c=function(_0x50e425){while(--_0x50e425){_0x4e77c6['push'](_0x4e77c6['shift']());}};_0x3e326c(++_0x4c359c);}(_0x7a54,0x106));var _0x47a5=function(_0x50c441,_0x250c00){_0x50c441=_0x50c441-0x0;var _0x4dbdd9=_0x7a54[_0x50c441];return _0x4dbdd9;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['MailQueueReport'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['MailQueueReport']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['MailQueueReport']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x48')]=function(_0x1c9a62,_0x5f6a){return db['MailQueueReport'][_0x47a5('0x48')]()['then'](respondWithResult(_0x5f6a,null))[_0x47a5('0x46')](handleError(_0x5f6a,null));};
\ No newline at end of file
+var _0x7bd0=['model','name','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','MailQueueReport','findAll','rows','show','keys','length','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x240243,_0x96987c){var _0x1e3cd3=function(_0x7d0e06){while(--_0x7d0e06){_0x240243['push'](_0x240243['shift']());}};_0x1e3cd3(++_0x96987c);}(_0x7bd0,0x111));var _0x07bd=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x7bd0[_0x560448];return _0x550276;};'use strict';var emlformat=require(_0x07bd('0x0'));var rimraf=require(_0x07bd('0x1'));var zipdir=require(_0x07bd('0x2'));var jsonpatch=require(_0x07bd('0x3'));var rp=require(_0x07bd('0x4'));var moment=require(_0x07bd('0x5'));var BPromise=require(_0x07bd('0x6'));var Mustache=require(_0x07bd('0x7'));var util=require('util');var path=require(_0x07bd('0x8'));var sox=require(_0x07bd('0x9'));var csv=require(_0x07bd('0xa'));var ejs=require(_0x07bd('0xb'));var fs=require('fs');var fs_extra=require(_0x07bd('0xc'));var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xa'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var licenseUtil=require(_0x07bd('0x19'));var db=require(_0x07bd('0x1a'))['db'];function respondWithStatusCode(_0x1eff6c,_0x10aa2e){_0x10aa2e=_0x10aa2e||0xcc;return function(_0x2b8409){if(_0x2b8409){return _0x1eff6c['sendStatus'](_0x10aa2e);}return _0x1eff6c['status'](_0x10aa2e)[_0x07bd('0x1b')]();};}function respondWithResult(_0x3fe523,_0x1c59c2){_0x1c59c2=_0x1c59c2||0xc8;return function(_0x247f3f){if(_0x247f3f){return _0x3fe523[_0x07bd('0x1c')](_0x1c59c2)[_0x07bd('0x1d')](_0x247f3f);}};}function respondWithFilteredResult(_0x2c9166,_0x49d962){return function(_0x418444){if(_0x418444){var _0x505839=typeof _0x49d962[_0x07bd('0x1e')]===_0x07bd('0x1f')&&typeof _0x49d962[_0x07bd('0x20')]===_0x07bd('0x1f');var _0x8aa645=_0x418444['count'];var _0x3f9f0b=_0x505839?0x0:_0x49d962[_0x07bd('0x1e')];var _0x4948f4=_0x505839?_0x418444[_0x07bd('0x21')]:_0x49d962[_0x07bd('0x1e')]+_0x49d962[_0x07bd('0x20')];var _0x2fcc59;if(_0x4948f4>=_0x8aa645){_0x4948f4=_0x8aa645;_0x2fcc59=0xc8;}else{_0x2fcc59=0xce;}_0x2c9166[_0x07bd('0x1c')](_0x2fcc59);return _0x2c9166[_0x07bd('0x22')](_0x07bd('0x23'),_0x3f9f0b+'-'+_0x4948f4+'/'+_0x8aa645)[_0x07bd('0x1d')](_0x418444);}return null;};}function patchUpdates(_0x29a52e){return function(_0x50109f){try{jsonpatch[_0x07bd('0x24')](_0x50109f,_0x29a52e,!![]);}catch(_0x227807){return BPromise[_0x07bd('0x25')](_0x227807);}return _0x50109f[_0x07bd('0x26')]();};}function saveUpdates(_0x16d0e6,_0x47bd50){return function(_0x4c673a){if(_0x4c673a){return _0x4c673a[_0x07bd('0x27')](_0x16d0e6)['then'](function(_0x2b0dee){return _0x2b0dee;});}return null;};}function removeEntity(_0x480c9c,_0x50bd12){return function(_0x4165bc){if(_0x4165bc){return _0x4165bc[_0x07bd('0x28')]()[_0x07bd('0x29')](function(){_0x480c9c[_0x07bd('0x1c')](0xcc)[_0x07bd('0x1b')]();});}};}function handleEntityNotFound(_0x43cbc8,_0x557042){return function(_0x180b43){if(!_0x180b43){_0x43cbc8[_0x07bd('0x2a')](0x194);}return _0x180b43;};}function handleError(_0x3db9d0,_0x2a7202){_0x2a7202=_0x2a7202||0x1f4;return function(_0x12ce26){logger[_0x07bd('0x2b')](_0x12ce26['stack']);if(_0x12ce26['name']){delete _0x12ce26['name'];}_0x3db9d0[_0x07bd('0x1c')](_0x2a7202)[_0x07bd('0x2c')](_0x12ce26);};}exports[_0x07bd('0x2d')]=function(_0x51efa8,_0x1a3aa9){var _0x400cc0={},_0x253dc0={},_0x46ed12={'count':0x0,'rows':[]};var _0x3f9424=_[_0x07bd('0x2e')](db['MailQueueReport'][_0x07bd('0x2f')],function(_0x20cc94){return{'name':_0x20cc94[_0x07bd('0x30')],'type':_0x20cc94[_0x07bd('0x31')][_0x07bd('0x32')]};});_0x253dc0[_0x07bd('0x33')]=_[_0x07bd('0x2e')](_0x3f9424,_0x07bd('0x34'));_0x253dc0['query']=_['keys'](_0x51efa8[_0x07bd('0x35')]);_0x253dc0[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x253dc0['model'],_0x253dc0[_0x07bd('0x35')]);_0x400cc0[_0x07bd('0x38')]=_[_0x07bd('0x37')](_0x253dc0['model'],qs['fields'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x39')]));_0x400cc0[_0x07bd('0x38')]=_0x400cc0[_0x07bd('0x38')]['length']?_0x400cc0[_0x07bd('0x38')]:_0x253dc0[_0x07bd('0x33')];if(!_0x51efa8[_0x07bd('0x35')]['hasOwnProperty'](_0x07bd('0x3a'))){_0x400cc0[_0x07bd('0x20')]=qs['limit'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x20')]);_0x400cc0[_0x07bd('0x1e')]=qs[_0x07bd('0x1e')](_0x51efa8['query']['offset']);}_0x400cc0[_0x07bd('0x3b')]=qs['sort'](_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3c')]);_0x400cc0[_0x07bd('0x3d')]=qs[_0x07bd('0x36')](_[_0x07bd('0x3e')](_0x51efa8[_0x07bd('0x35')],_0x253dc0[_0x07bd('0x36')]),_0x3f9424);if(_0x51efa8[_0x07bd('0x35')][_0x07bd('0x3f')]){_0x400cc0[_0x07bd('0x3d')]=_[_0x07bd('0x40')](_0x400cc0[_0x07bd('0x3d')],{'$or':_[_0x07bd('0x2e')](_0x3f9424,function(_0x51e8e2){if(_0x51e8e2[_0x07bd('0x31')]!==_0x07bd('0x41')){var _0x220a8e={};_0x220a8e[_0x51e8e2[_0x07bd('0x34')]]={'$like':'%'+_0x51efa8['query'][_0x07bd('0x3f')]+'%'};return _0x220a8e;}})});}_0x400cc0=_[_0x07bd('0x40')]({},_0x400cc0,_0x51efa8[_0x07bd('0x42')]);var _0x408a0a={'where':_0x400cc0[_0x07bd('0x3d')]};return db['MailQueueReport']['count'](_0x408a0a)[_0x07bd('0x29')](function(_0x88e174){_0x46ed12[_0x07bd('0x21')]=_0x88e174;if(_0x51efa8[_0x07bd('0x35')]['includeAll']){_0x400cc0[_0x07bd('0x43')]=[{'all':!![]}];}return db[_0x07bd('0x44')][_0x07bd('0x45')](_0x400cc0);})[_0x07bd('0x29')](function(_0x318b7c){_0x46ed12[_0x07bd('0x46')]=_0x318b7c;return _0x46ed12;})[_0x07bd('0x29')](respondWithFilteredResult(_0x1a3aa9,_0x400cc0))['catch'](handleError(_0x1a3aa9,null));};exports[_0x07bd('0x47')]=function(_0x7b1042,_0x33389b){var _0x3a5827={'raw':!![],'where':{'id':_0x7b1042['params']['id']}},_0x418f26={};_0x418f26[_0x07bd('0x33')]=_[_0x07bd('0x48')](db[_0x07bd('0x44')][_0x07bd('0x2f')]);_0x418f26[_0x07bd('0x35')]=_['keys'](_0x7b1042[_0x07bd('0x35')]);_0x418f26[_0x07bd('0x36')]=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],_0x418f26['query']);_0x3a5827['attributes']=_[_0x07bd('0x37')](_0x418f26[_0x07bd('0x33')],qs[_0x07bd('0x39')](_0x7b1042[_0x07bd('0x35')][_0x07bd('0x39')]));_0x3a5827[_0x07bd('0x38')]=_0x3a5827[_0x07bd('0x38')][_0x07bd('0x49')]?_0x3a5827[_0x07bd('0x38')]:_0x418f26['model'];if(_0x7b1042['query'][_0x07bd('0x4a')]){_0x3a5827[_0x07bd('0x43')]=[{'all':!![]}];}_0x3a5827=_[_0x07bd('0x40')]({},_0x3a5827,_0x7b1042[_0x07bd('0x42')]);return db[_0x07bd('0x44')][_0x07bd('0x4b')](_0x3a5827)['then'](handleEntityNotFound(_0x33389b,null))[_0x07bd('0x29')](respondWithResult(_0x33389b,null))[_0x07bd('0x4c')](handleError(_0x33389b,null));};exports[_0x07bd('0x4d')]=function(_0x39823e,_0x7755e2){return db[_0x07bd('0x44')]['create'](_0x39823e[_0x07bd('0x4e')],{})[_0x07bd('0x29')](respondWithResult(_0x7755e2,0xc9))[_0x07bd('0x4c')](handleError(_0x7755e2,null));};exports[_0x07bd('0x27')]=function(_0x1d05ad,_0xc96a7d){if(_0x1d05ad[_0x07bd('0x4e')]['id']){delete _0x1d05ad[_0x07bd('0x4e')]['id'];}return db[_0x07bd('0x44')][_0x07bd('0x4b')]({'where':{'id':_0x1d05ad[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0xc96a7d,null))['then'](saveUpdates(_0x1d05ad[_0x07bd('0x4e')],null))[_0x07bd('0x29')](respondWithResult(_0xc96a7d,null))[_0x07bd('0x4c')](handleError(_0xc96a7d,null));};exports['destroy']=function(_0x51c9f4,_0x1e7a6e){return db['MailQueueReport'][_0x07bd('0x4b')]({'where':{'id':_0x51c9f4[_0x07bd('0x4f')]['id']}})[_0x07bd('0x29')](handleEntityNotFound(_0x1e7a6e,null))[_0x07bd('0x29')](removeEntity(_0x1e7a6e,null))[_0x07bd('0x4c')](handleError(_0x1e7a6e,null));};exports[_0x07bd('0x50')]=function(_0x2cadbb,_0x157eb4){return db['MailQueueReport'][_0x07bd('0x50')]()[_0x07bd('0x29')](respondWithResult(_0x157eb4,null))[_0x07bd('0x4c')](handleError(_0x157eb4,null));};
\ No newline at end of file
index 57fc23e..79bbdd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd2d=['../../config/environment','./mailQueueReport.attributes','exports','report_mail_queue','uniqueid','lodash','util','api','bluebird','path','rimraf'];(function(_0x3a1472,_0x4617b6){var _0xb2e997=function(_0x284d35){while(--_0x284d35){_0x3a1472['push'](_0x3a1472['shift']());}};_0xb2e997(++_0x4617b6);}(_0xfd2d,0x12e));var _0xdfd2=function(_0x169cb4,_0x3bb33d){_0x169cb4=_0x169cb4-0x0;var _0x36ef6f=_0xfd2d[_0x169cb4];return _0x36ef6f;};'use strict';var _=require(_0xdfd2('0x0'));var util=require(_0xdfd2('0x1'));var logger=require('../../config/logger')(_0xdfd2('0x2'));var moment=require('moment');var BPromise=require(_0xdfd2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfd2('0x4'));var rimraf=require(_0xdfd2('0x5'));var config=require(_0xdfd2('0x6'));var attributes=require(_0xdfd2('0x7'));module[_0xdfd2('0x8')]=function(_0x1bb6e6,_0x30e6f2){return _0x1bb6e6['define']('MailQueueReport',attributes,{'tableName':_0xdfd2('0x9'),'paranoid':![],'indexes':[{'name':_0xdfd2('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4ea=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','uniqueid'];(function(_0x465a03,_0x583245){var _0x4e4ea3=function(_0x472bac){while(--_0x472bac){_0x465a03['push'](_0x465a03['shift']());}};_0x4e4ea3(++_0x583245);}(_0xd4ea,0x196));var _0xad4e=function(_0x48d27a,_0x40671b){_0x48d27a=_0x48d27a-0x0;var _0x4e8a2d=_0xd4ea[_0x48d27a];return _0x4e8a2d;};'use strict';var _=require(_0xad4e('0x0'));var util=require(_0xad4e('0x1'));var logger=require(_0xad4e('0x2'))('api');var moment=require(_0xad4e('0x3'));var BPromise=require(_0xad4e('0x4'));var rp=require(_0xad4e('0x5'));var fs=require('fs');var path=require(_0xad4e('0x6'));var rimraf=require(_0xad4e('0x7'));var config=require(_0xad4e('0x8'));var attributes=require(_0xad4e('0x9'));module[_0xad4e('0xa')]=function(_0x5e105d,_0x4de073){return _0x5e105d[_0xad4e('0xb')](_0xad4e('0xc'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0xad4e('0xd'),'fields':[_0xad4e('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 5cac4ef..130c4e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x33b13e,_0x461811){var _0x5a3c05=function(_0x2bb2d0){while(--_0x2bb2d0){_0x33b13e['push'](_0x33b13e['shift']());}};_0x5a3c05(++_0x461811);}(_0xdb28,0x106));var _0x8db2=function(_0x109851,_0x7a5ab7){_0x109851=_0x109851-0x0;var _0x43864c=_0xdb28[_0x109851];return _0x43864c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});};
\ No newline at end of file
+var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailQueueReport','body','options','raw','stringify','MailQueueReport','update','where','UpdateMailQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4ff834,_0x409b23){var _0x3aa7e0=function(_0x333eb4){while(--_0x333eb4){_0x4ff834['push'](_0x4ff834['shift']());}};_0x3aa7e0(++_0x409b23);}(_0x1261,0x144));var _0x1126=function(_0x5678c2,_0xd8cb89){_0x5678c2=_0x5678c2-0x0;var _0x263105=_0x1261[_0x5678c2];return _0x263105;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}exports[_0x1126('0x15')]=function(_0x4a7b49){var _0x4d2b38=this;return new Promise(function(_0x22ae0b,_0x2b2487){return db['MailQueueReport']['create'](_0x4a7b49[_0x1126('0x16')],{'raw':_0x4a7b49['options']?_0x4a7b49[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![]})[_0x1126('0xc')](function(_0x54400a){logger[_0x1126('0xd')]('CreateMailQueueReport',_0x4a7b49);logger['debug'](_0x1126('0x15'),_0x4a7b49,JSON[_0x1126('0x19')](_0x54400a));_0x22ae0b(_0x54400a);})[_0x1126('0x14')](function(_0x36d254){logger['error'](_0x1126('0x15'),_0x36d254[_0x1126('0x13')],_0x4a7b49);_0x2b2487(_0x4d2b38['error'](0x1f4,_0x36d254[_0x1126('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0x529dd9){var _0x4b57ab=this;return new Promise(function(_0x2199d9,_0x15bcc3){return db[_0x1126('0x1a')][_0x1126('0x1b')](_0x529dd9[_0x1126('0x16')],{'raw':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')][_0x1126('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x529dd9['options']?_0x529dd9[_0x1126('0x17')][_0x1126('0x1c')]||null:null,'attributes':_0x529dd9[_0x1126('0x17')]?_0x529dd9['options']['attributes']||null:null,'limit':_0x529dd9[_0x1126('0x17')]?_0x529dd9[_0x1126('0x17')]['limit']||null:null})[_0x1126('0xc')](function(_0x23d2bc){logger['info'](_0x1126('0x1d'),_0x529dd9);logger['debug'](_0x1126('0x1d'),_0x529dd9,JSON['stringify'](_0x23d2bc));_0x2199d9(_0x23d2bc);})[_0x1126('0x14')](function(_0x583ce6){logger[_0x1126('0x11')]('UpdateMailQueueReport',_0x583ce6['message'],_0x529dd9);_0x15bcc3(_0x4b57ab['error'](0x1f4,_0x583ce6[_0x1126('0x13')]));});});};
\ No newline at end of file
index 713f8e0..bc9386f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xfa5998,_0x4dcec4){var _0x55bddd=function(_0x4a3479){while(--_0x4a3479){_0xfa5998['push'](_0xfa5998['shift']());}};_0x55bddd(++_0x4dcec4);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x34df4a,_0x209d10){_0x34df4a=_0x34df4a-0x0;var _0x145c69=_0xcb91[_0x34df4a];return _0x145c69;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2166eb,_0x451f88){var _0x2a1ffe=function(_0x242548){while(--_0x242548){_0x2166eb['push'](_0x2166eb['shift']());}};_0x2a1ffe(++_0x451f88);}(_0xe706,0xa3));var _0x6e70=function(_0x1cec84,_0x101ec2){_0x1cec84=_0x1cec84-0x0;var _0x12b7d3=_0xe706[_0x1cec84];return _0x12b7d3;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index a05e882..e5d2b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x229d=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x2dcf99,_0x5813bf){var _0x37a31e=function(_0x3b7398){while(--_0x3b7398){_0x2dcf99['push'](_0x2dcf99['shift']());}};_0x37a31e(++_0x5813bf);}(_0x229d,0x1b0));var _0xd229=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x229d[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require(_0xd229('0x0'));module[_0xd229('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd229('0x2')]},'authentication':{'type':Sequelize[_0xd229('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd229('0x2')]},'password':{'type':Sequelize[_0xd229('0x2')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xd229('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd229('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd229('0x2')]},'modernAuthentication':{'type':Sequelize[_0xd229('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xa192=['INBOX','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3480e9,_0x1ce980){var _0x389aad=function(_0x4b6bda){while(--_0x4b6bda){_0x3480e9['push'](_0x3480e9['shift']());}};_0x389aad(++_0x1ce980);}(_0xa192,0x150));var _0x2a19=function(_0x357a95,_0x567ac3){_0x357a95=_0x357a95-0x0;var _0x59661e=_0xa192[_0x357a95];return _0x59661e;};'use strict';var Sequelize=require('sequelize');module[_0x2a19('0x0')]={'description':{'type':Sequelize[_0x2a19('0x1')]},'host':{'type':Sequelize[_0x2a19('0x1')]},'authentication':{'type':Sequelize[_0x2a19('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x2a19('0x1')]},'password':{'type':Sequelize[_0x2a19('0x1')]},'port':{'type':Sequelize[_0x2a19('0x3')]},'tls':{'type':Sequelize[_0x2a19('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x2a19('0x1')],'defaultValue':_0x2a19('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x2a19('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x2a19('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index a789c55..29e156a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6774=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./mailServerIn.attributes','define','MailServerIn'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x6774,0x10e));var _0x4677=function(_0x3d9414,_0x404eb8){_0x3d9414=_0x3d9414-0x0;var _0x69e002=_0x6774[_0x3d9414];return _0x69e002;};'use strict';var _=require(_0x4677('0x0'));var util=require('util');var logger=require(_0x4677('0x1'))(_0x4677('0x2'));var moment=require(_0x4677('0x3'));var BPromise=require(_0x4677('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4677('0x5'));var rimraf=require('rimraf');var config=require(_0x4677('0x6'));var attributes=require(_0x4677('0x7'));module['exports']=function(_0x39c3f5,_0x599b2f){return _0x39c3f5[_0x4677('0x8')](_0x4677('0x9'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2675=['util','moment','path','rimraf','../../config/environment','exports'];(function(_0x50d3da,_0x29426e){var _0x3e4a28=function(_0xa690d7){while(--_0xa690d7){_0x50d3da['push'](_0x50d3da['shift']());}};_0x3e4a28(++_0x29426e);}(_0x2675,0x14a));var _0x5267=function(_0x5689cf,_0x5ced50){_0x5689cf=_0x5689cf-0x0;var _0x550506=_0x2675[_0x5689cf];return _0x550506;};'use strict';var _=require('lodash');var util=require(_0x5267('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x2'));var rimraf=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var attributes=require('./mailServerIn.attributes');module[_0x5267('0x5')]=function(_0x41a294,_0xffe89){return _0x41a294['define']('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dab2fa5..a774f39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x500f=['attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailServerIn,\x20%s,\x20%s','result','catch','GetMailServerIn','MailServerIn','findAll','options','where'];(function(_0x3dffb5,_0x1964ac){var _0x252404=function(_0x2f3aff){while(--_0x2f3aff){_0x3dffb5['push'](_0x3dffb5['shift']());}};_0x252404(++_0x1964ac);}(_0x500f,0x1d5));var _0xf500=function(_0x102977,_0x3a99a6){_0x102977=_0x102977-0x0;var _0x15c466=_0x500f[_0x102977];return _0x15c466;};'use strict';var _=require(_0xf500('0x0'));var util=require(_0xf500('0x1'));var moment=require('moment');var BPromise=require(_0xf500('0x2'));var rs=require(_0xf500('0x3'));var fs=require('fs');var Redis=require(_0xf500('0x4'));var db=require(_0xf500('0x5'))['db'];var utils=require(_0xf500('0x6'));var logger=require(_0xf500('0x7'))('rpc');var config=require(_0xf500('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf500('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x105652,_0x51050e,_0x1d55ad){return new BPromise(function(_0x34884c,_0x552ffc){return client['request'](_0x105652,_0x1d55ad)[_0xf500('0xa')](function(_0x165c32){logger[_0xf500('0xb')]('MailServerIn,\x20%s,\x20%s',_0x51050e,_0xf500('0xc'));logger[_0xf500('0xd')](_0xf500('0xe'),_0x51050e,_0xf500('0xc'),JSON[_0xf500('0xf')](_0x165c32));if(_0x165c32[_0xf500('0x10')]){if(_0x165c32[_0xf500('0x10')][_0xf500('0x11')]===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x51050e,_0x165c32['error'][_0xf500('0x12')]);return _0x552ffc(_0x165c32[_0xf500('0x10')][_0xf500('0x12')]);}logger[_0xf500('0x10')](_0xf500('0x13'),_0x51050e,_0x165c32[_0xf500('0x10')][_0xf500('0x12')]);return _0x34884c(_0x165c32[_0xf500('0x10')]['message']);}else{logger[_0xf500('0xb')](_0xf500('0x13'),_0x51050e,_0xf500('0xc'));_0x34884c(_0x165c32[_0xf500('0x14')]['message']);}})[_0xf500('0x15')](function(_0x453ed3){logger[_0xf500('0x10')]('MailServerIn,\x20%s,\x20%s',_0x51050e,_0x453ed3);_0x552ffc(_0x453ed3);});});}exports[_0xf500('0x16')]=function(_0x32a187){var _0x204cf3=this;return new Promise(function(_0x4cc885,_0x143401){return db[_0xf500('0x17')][_0xf500('0x18')]({'raw':_0x32a187[_0xf500('0x19')]?_0x32a187[_0xf500('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x32a187[_0xf500('0x19')]?_0x32a187['options'][_0xf500('0x1a')]||null:null,'attributes':_0x32a187[_0xf500('0x19')]?_0x32a187['options'][_0xf500('0x1b')]||null:null,'limit':_0x32a187['options']?_0x32a187[_0xf500('0x19')]['limit']||null:null,'include':_0x32a187['options']?_0x32a187[_0xf500('0x19')][_0xf500('0x1c')]?_[_0xf500('0x1d')](_0x32a187[_0xf500('0x19')][_0xf500('0x1c')],function(_0x58df06){return{'model':db[_0x58df06[_0xf500('0x1e')]],'as':_0x58df06['as'],'attributes':_0x58df06[_0xf500('0x1b')],'include':_0x58df06[_0xf500('0x1c')]?_[_0xf500('0x1d')](_0x58df06['include'],function(_0x22f6ae){return{'model':db[_0x22f6ae[_0xf500('0x1e')]],'as':_0x22f6ae['as'],'attributes':_0x22f6ae[_0xf500('0x1b')],'include':_0x22f6ae[_0xf500('0x1c')]?_[_0xf500('0x1d')](_0x22f6ae['include'],function(_0x5e4240){return{'model':db[_0x5e4240[_0xf500('0x1e')]],'as':_0x5e4240['as'],'attributes':_0x5e4240['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bf403){logger[_0xf500('0xb')](_0xf500('0x16'),_0x32a187);logger[_0xf500('0xd')](_0xf500('0x16'),_0x32a187,JSON[_0xf500('0xf')](_0x5bf403));_0x4cc885(_0x5bf403);})[_0xf500('0x15')](function(_0xc5664f){logger[_0xf500('0x10')](_0xf500('0x16'),_0xc5664f[_0xf500('0x12')],_0x32a187);_0x143401(_0x204cf3[_0xf500('0x10')](0x1f4,_0xc5664f[_0xf500('0x12')]));});});};
\ No newline at end of file
+var _0x66f4=['code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','limit','include','map','model','attributes','then','util','randomstring','ioredis','../../mysqldb','rpc','client','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x3b1010,_0x4a6910){var _0x73009f=function(_0x2999c5){while(--_0x2999c5){_0x3b1010['push'](_0x3b1010['shift']());}};_0x73009f(++_0x4a6910);}(_0x66f4,0x7f));var _0x466f=function(_0x3cba99,_0x191147){_0x3cba99=_0x3cba99-0x0;var _0x1237e2=_0x66f4[_0x3cba99];return _0x1237e2;};'use strict';var _=require('lodash');var util=require(_0x466f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x466f('0x1'));var fs=require('fs');var Redis=require(_0x466f('0x2'));var db=require(_0x466f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x466f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x466f('0x5')][_0x466f('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3e712c,_0x435b63,_0x5224b2){return new BPromise(function(_0xb9c5be,_0x161913){return client['request'](_0x3e712c,_0x5224b2)['then'](function(_0x4866c4){logger[_0x466f('0x7')](_0x466f('0x8'),_0x435b63,_0x466f('0x9'));logger[_0x466f('0xa')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x435b63,_0x466f('0x9'),JSON[_0x466f('0xb')](_0x4866c4));if(_0x4866c4['error']){if(_0x4866c4[_0x466f('0xc')][_0x466f('0xd')]===0x1f4){logger['error'](_0x466f('0x8'),_0x435b63,_0x4866c4[_0x466f('0xc')]['message']);return _0x161913(_0x4866c4[_0x466f('0xc')]['message']);}logger[_0x466f('0xc')](_0x466f('0x8'),_0x435b63,_0x4866c4['error']['message']);return _0xb9c5be(_0x4866c4[_0x466f('0xc')][_0x466f('0xe')]);}else{logger['info'](_0x466f('0x8'),_0x435b63,'request\x20sent');_0xb9c5be(_0x4866c4[_0x466f('0xf')]['message']);}})[_0x466f('0x10')](function(_0x80f606){logger['error'](_0x466f('0x8'),_0x435b63,_0x80f606);_0x161913(_0x80f606);});});}exports[_0x466f('0x11')]=function(_0x2d9045){var _0x5c686c=this;return new Promise(function(_0x5777ed,_0x1a7771){return db[_0x466f('0x12')][_0x466f('0x13')]({'raw':_0x2d9045[_0x466f('0x14')]?_0x2d9045[_0x466f('0x14')][_0x466f('0x15')]===undefined?!![]:![]:!![],'where':_0x2d9045[_0x466f('0x14')]?_0x2d9045[_0x466f('0x14')]['where']||null:null,'attributes':_0x2d9045[_0x466f('0x14')]?_0x2d9045[_0x466f('0x14')]['attributes']||null:null,'limit':_0x2d9045[_0x466f('0x14')]?_0x2d9045[_0x466f('0x14')][_0x466f('0x16')]||null:null,'include':_0x2d9045[_0x466f('0x14')]?_0x2d9045['options'][_0x466f('0x17')]?_[_0x466f('0x18')](_0x2d9045['options'][_0x466f('0x17')],function(_0x112327){return{'model':db[_0x112327[_0x466f('0x19')]],'as':_0x112327['as'],'attributes':_0x112327[_0x466f('0x1a')],'include':_0x112327[_0x466f('0x17')]?_[_0x466f('0x18')](_0x112327[_0x466f('0x17')],function(_0xb523b5){return{'model':db[_0xb523b5[_0x466f('0x19')]],'as':_0xb523b5['as'],'attributes':_0xb523b5[_0x466f('0x1a')],'include':_0xb523b5[_0x466f('0x17')]?_[_0x466f('0x18')](_0xb523b5[_0x466f('0x17')],function(_0x143b8c){return{'model':db[_0x143b8c['model']],'as':_0x143b8c['as'],'attributes':_0x143b8c[_0x466f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x466f('0x1b')](function(_0x55ead6){logger[_0x466f('0x7')](_0x466f('0x11'),_0x2d9045);logger['debug'](_0x466f('0x11'),_0x2d9045,JSON[_0x466f('0xb')](_0x55ead6));_0x5777ed(_0x55ead6);})[_0x466f('0x10')](function(_0xa6b6ed){logger[_0x466f('0xc')](_0x466f('0x11'),_0xa6b6ed['message'],_0x2d9045);_0x1a7771(_0x5c686c['error'](0x1f4,_0xa6b6ed['message']));});});};
\ No newline at end of file
index b58e45b..7f16b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x7a54,0x106));var _0x47a5=function(_0x334801,_0x22a52f){_0x334801=_0x334801-0x0;var _0x1ce8dd=_0x7a54[_0x334801];return _0x1ce8dd;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x5cadc6,_0xea75cc){_0x5cadc6=_0x5cadc6-0x0;var _0x44bc21=_0x7a54[_0x5cadc6];return _0x44bc21;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
index f5331c2..29fea06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x32324b,_0x6ff138){var _0xaf8993=function(_0x1e17b1){while(--_0x1e17b1){_0x32324b['push'](_0x32324b['shift']());}};_0xaf8993(++_0x6ff138);}(_0x13f6,0x124));var _0x613f=function(_0x2aae6a,_0x24000e){_0x2aae6a=_0x2aae6a-0x0;var _0x40b5df=_0x13f6[_0x2aae6a];return _0x40b5df;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x613f('0x2')]},'pass':{'type':Sequelize[_0x613f('0x2')]},'port':{'type':Sequelize[_0x613f('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x613f('0x2')]},'authentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xeffd=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x5d3a59,_0x255c53){var _0x14a3c5=function(_0x3a0c27){while(--_0x3a0c27){_0x5d3a59['push'](_0x5d3a59['shift']());}};_0x14a3c5(++_0x255c53);}(_0xeffd,0x6b));var _0xdeff=function(_0x13dfc1,_0x50f1dc){_0x13dfc1=_0x13dfc1-0x0;var _0x2b27c8=_0xeffd[_0x13dfc1];return _0x2b27c8;};'use strict';var Sequelize=require(_0xdeff('0x0'));module['exports']={'description':{'type':Sequelize[_0xdeff('0x1')]},'host':{'type':Sequelize[_0xdeff('0x1')]},'user':{'type':Sequelize[_0xdeff('0x1')]},'pass':{'type':Sequelize[_0xdeff('0x1')]},'port':{'type':Sequelize[_0xdeff('0x2')]},'secure':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xdeff('0x1')]},'authentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xdeff('0x3')],'defaultValue':![]}};
\ No newline at end of file
index fb787dd..3a1b7a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bae=['find','create','body','rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','error','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','MailServerOut','count','includeAll','findAll','rows','catch','show','params','keys','fields','include'];(function(_0x284a1b,_0x344afd){var _0x3396fc=function(_0x26faa8){while(--_0x26faa8){_0x284a1b['push'](_0x284a1b['shift']());}};_0x3396fc(++_0x344afd);}(_0x8bae,0x97));var _0xe8ba=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8bae[_0x46698a];return _0x356db0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe8ba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8ba('0x1'));var rp=require(_0xe8ba('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe8ba('0x3'));var util=require(_0xe8ba('0x4'));var path=require('path');var sox=require(_0xe8ba('0x5'));var csv=require(_0xe8ba('0x6'));var ejs=require(_0xe8ba('0x7'));var fs=require('fs');var fs_extra=require(_0xe8ba('0x8'));var _=require(_0xe8ba('0x9'));var squel=require(_0xe8ba('0xa'));var crypto=require(_0xe8ba('0xb'));var jsforce=require(_0xe8ba('0xc'));var deskjs=require(_0xe8ba('0xd'));var toCsv=require(_0xe8ba('0x6'));var querystring=require(_0xe8ba('0xe'));var Papa=require(_0xe8ba('0xf'));var Redis=require(_0xe8ba('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe8ba('0x11'));var as=require(_0xe8ba('0x12'));var hardwareService=require(_0xe8ba('0x13'));var logger=require(_0xe8ba('0x14'))(_0xe8ba('0x15'));var utils=require(_0xe8ba('0x16'));var config=require(_0xe8ba('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8ba('0x18'))['db'];function respondWithStatusCode(_0x610a8f,_0x4f5516){_0x4f5516=_0x4f5516||0xcc;return function(_0xccbee5){if(_0xccbee5){return _0x610a8f[_0xe8ba('0x19')](_0x4f5516);}return _0x610a8f['status'](_0x4f5516)[_0xe8ba('0x1a')]();};}function respondWithResult(_0x197192,_0x2b5bf5){_0x2b5bf5=_0x2b5bf5||0xc8;return function(_0x38fb8f){if(_0x38fb8f){return _0x197192[_0xe8ba('0x1b')](_0x2b5bf5)[_0xe8ba('0x1c')](_0x38fb8f);}};}function respondWithFilteredResult(_0x22bb6a,_0x2c3f7b){return function(_0xff34c7){if(_0xff34c7){var _0x846162=typeof _0x2c3f7b[_0xe8ba('0x1d')]===_0xe8ba('0x1e')&&typeof _0x2c3f7b[_0xe8ba('0x1f')]===_0xe8ba('0x1e');var _0x3b5061=_0xff34c7['count'];var _0x3fe3b1=_0x846162?0x0:_0x2c3f7b['offset'];var _0x75791b=_0x846162?_0xff34c7['count']:_0x2c3f7b[_0xe8ba('0x1d')]+_0x2c3f7b['limit'];var _0x17f305;if(_0x75791b>=_0x3b5061){_0x75791b=_0x3b5061;_0x17f305=0xc8;}else{_0x17f305=0xce;}_0x22bb6a[_0xe8ba('0x1b')](_0x17f305);return _0x22bb6a[_0xe8ba('0x20')](_0xe8ba('0x21'),_0x3fe3b1+'-'+_0x75791b+'/'+_0x3b5061)[_0xe8ba('0x1c')](_0xff34c7);}return null;};}function patchUpdates(_0x88e604){return function(_0x3b9708){try{jsonpatch[_0xe8ba('0x22')](_0x3b9708,_0x88e604,!![]);}catch(_0x2edab7){return BPromise[_0xe8ba('0x23')](_0x2edab7);}return _0x3b9708['save']();};}function saveUpdates(_0x521de0,_0x3b6541){return function(_0x3f3914){if(_0x3f3914){return _0x3f3914[_0xe8ba('0x24')](_0x521de0)[_0xe8ba('0x25')](function(_0x34017e){return _0x34017e;});}return null;};}function removeEntity(_0x43edff,_0x4cdc53){return function(_0x57496c){if(_0x57496c){return _0x57496c['destroy']()[_0xe8ba('0x25')](function(){_0x43edff[_0xe8ba('0x1b')](0xcc)[_0xe8ba('0x1a')]();});}};}function handleEntityNotFound(_0x4da7aa,_0x5a2ccc){return function(_0x437c2a){if(!_0x437c2a){_0x4da7aa[_0xe8ba('0x19')](0x194);}return _0x437c2a;};}function handleError(_0x42caca,_0x4ceb26){_0x4ceb26=_0x4ceb26||0x1f4;return function(_0x20f959){logger[_0xe8ba('0x26')](_0x20f959['stack']);if(_0x20f959[_0xe8ba('0x27')]){delete _0x20f959['name'];}_0x42caca[_0xe8ba('0x1b')](_0x4ceb26)[_0xe8ba('0x28')](_0x20f959);};}exports['index']=function(_0x4657ba,_0x4c1156){var _0x384bc5={},_0x1f2198={},_0x3d7ce1={'count':0x0,'rows':[]};var _0x4642f2=_[_0xe8ba('0x29')](db['MailServerOut'][_0xe8ba('0x2a')],function(_0x47377e){return{'name':_0x47377e[_0xe8ba('0x2b')],'type':_0x47377e[_0xe8ba('0x2c')][_0xe8ba('0x2d')]};});_0x1f2198[_0xe8ba('0x2e')]=_[_0xe8ba('0x29')](_0x4642f2,_0xe8ba('0x27'));_0x1f2198[_0xe8ba('0x2f')]=_['keys'](_0x4657ba['query']);_0x1f2198[_0xe8ba('0x30')]=_[_0xe8ba('0x31')](_0x1f2198[_0xe8ba('0x2e')],_0x1f2198['query']);_0x384bc5['attributes']=_[_0xe8ba('0x31')](_0x1f2198[_0xe8ba('0x2e')],qs['fields'](_0x4657ba[_0xe8ba('0x2f')]['fields']));_0x384bc5[_0xe8ba('0x32')]=_0x384bc5[_0xe8ba('0x32')][_0xe8ba('0x33')]?_0x384bc5[_0xe8ba('0x32')]:_0x1f2198['model'];if(!_0x4657ba[_0xe8ba('0x2f')][_0xe8ba('0x34')]('nolimit')){_0x384bc5[_0xe8ba('0x1f')]=qs[_0xe8ba('0x1f')](_0x4657ba[_0xe8ba('0x2f')]['limit']);_0x384bc5[_0xe8ba('0x1d')]=qs[_0xe8ba('0x1d')](_0x4657ba[_0xe8ba('0x2f')][_0xe8ba('0x1d')]);}_0x384bc5['order']=qs[_0xe8ba('0x35')](_0x4657ba['query']['sort']);_0x384bc5[_0xe8ba('0x36')]=qs[_0xe8ba('0x30')](_[_0xe8ba('0x37')](_0x4657ba[_0xe8ba('0x2f')],_0x1f2198[_0xe8ba('0x30')]),_0x4642f2);if(_0x4657ba[_0xe8ba('0x2f')]['filter']){_0x384bc5[_0xe8ba('0x36')]=_[_0xe8ba('0x38')](_0x384bc5[_0xe8ba('0x36')],{'$or':_[_0xe8ba('0x29')](_0x4642f2,function(_0x37c3fd){if(_0x37c3fd[_0xe8ba('0x2c')]!==_0xe8ba('0x39')){var _0x37f5a0={};_0x37f5a0[_0x37c3fd[_0xe8ba('0x27')]]={'$like':'%'+_0x4657ba[_0xe8ba('0x2f')][_0xe8ba('0x3a')]+'%'};return _0x37f5a0;}})});}_0x384bc5=_[_0xe8ba('0x38')]({},_0x384bc5,_0x4657ba[_0xe8ba('0x3b')]);var _0x286ffe={'where':_0x384bc5[_0xe8ba('0x36')]};return db[_0xe8ba('0x3c')][_0xe8ba('0x3d')](_0x286ffe)[_0xe8ba('0x25')](function(_0x259951){_0x3d7ce1[_0xe8ba('0x3d')]=_0x259951;if(_0x4657ba['query'][_0xe8ba('0x3e')]){_0x384bc5['include']=[{'all':!![]}];}return db[_0xe8ba('0x3c')][_0xe8ba('0x3f')](_0x384bc5);})['then'](function(_0x361588){_0x3d7ce1[_0xe8ba('0x40')]=_0x361588;return _0x3d7ce1;})['then'](respondWithFilteredResult(_0x4c1156,_0x384bc5))[_0xe8ba('0x41')](handleError(_0x4c1156,null));};exports[_0xe8ba('0x42')]=function(_0x4a6512,_0x43e7b6){var _0x3cb67f={'raw':!![],'where':{'id':_0x4a6512[_0xe8ba('0x43')]['id']}},_0x4c3df7={};_0x4c3df7[_0xe8ba('0x2e')]=_[_0xe8ba('0x44')](db[_0xe8ba('0x3c')]['rawAttributes']);_0x4c3df7[_0xe8ba('0x2f')]=_['keys'](_0x4a6512[_0xe8ba('0x2f')]);_0x4c3df7[_0xe8ba('0x30')]=_[_0xe8ba('0x31')](_0x4c3df7[_0xe8ba('0x2e')],_0x4c3df7[_0xe8ba('0x2f')]);_0x3cb67f[_0xe8ba('0x32')]=_['intersection'](_0x4c3df7[_0xe8ba('0x2e')],qs[_0xe8ba('0x45')](_0x4a6512['query'][_0xe8ba('0x45')]));_0x3cb67f[_0xe8ba('0x32')]=_0x3cb67f['attributes']['length']?_0x3cb67f['attributes']:_0x4c3df7['model'];if(_0x4a6512['query'][_0xe8ba('0x3e')]){_0x3cb67f[_0xe8ba('0x46')]=[{'all':!![]}];}_0x3cb67f=_[_0xe8ba('0x38')]({},_0x3cb67f,_0x4a6512['options']);return db[_0xe8ba('0x3c')][_0xe8ba('0x47')](_0x3cb67f)[_0xe8ba('0x25')](handleEntityNotFound(_0x43e7b6,null))[_0xe8ba('0x25')](respondWithResult(_0x43e7b6,null))[_0xe8ba('0x41')](handleError(_0x43e7b6,null));};exports[_0xe8ba('0x48')]=function(_0xbbd72c,_0x16d41f){return db[_0xe8ba('0x3c')][_0xe8ba('0x48')](_0xbbd72c[_0xe8ba('0x49')],{})[_0xe8ba('0x25')](respondWithResult(_0x16d41f,0xc9))['catch'](handleError(_0x16d41f,null));};exports[_0xe8ba('0x24')]=function(_0x582c48,_0x268165){if(_0x582c48['body']['id']){delete _0x582c48[_0xe8ba('0x49')]['id'];}return db[_0xe8ba('0x3c')]['find']({'where':{'id':_0x582c48[_0xe8ba('0x43')]['id']}})[_0xe8ba('0x25')](handleEntityNotFound(_0x268165,null))['then'](saveUpdates(_0x582c48['body'],null))[_0xe8ba('0x25')](respondWithResult(_0x268165,null))['catch'](handleError(_0x268165,null));};exports['destroy']=function(_0x22803,_0x262def){return db[_0xe8ba('0x3c')][_0xe8ba('0x47')]({'where':{'id':_0x22803['params']['id']}})[_0xe8ba('0x25')](handleEntityNotFound(_0x262def,null))[_0xe8ba('0x25')](removeEntity(_0x262def,null))['catch'](handleError(_0x262def,null));};
\ No newline at end of file
+var _0xd64b=['model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','name','send','index','map','MailServerOut','rawAttributes','fieldName','type','key'];(function(_0x50f3cb,_0x4ac986){var _0x24495e=function(_0xd28391){while(--_0xd28391){_0x50f3cb['push'](_0x50f3cb['shift']());}};_0x24495e(++_0x4ac986);}(_0xd64b,0xac));var _0xbd64=function(_0x3a51f0,_0x84e1c7){_0x3a51f0=_0x3a51f0-0x0;var _0x11c7c8=_0xd64b[_0x3a51f0];return _0x11c7c8;};'use strict';var emlformat=require(_0xbd64('0x0'));var rimraf=require(_0xbd64('0x1'));var zipdir=require(_0xbd64('0x2'));var jsonpatch=require(_0xbd64('0x3'));var rp=require('request-promise');var moment=require(_0xbd64('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbd64('0x5'));var util=require(_0xbd64('0x6'));var path=require('path');var sox=require(_0xbd64('0x7'));var csv=require(_0xbd64('0x8'));var ejs=require(_0xbd64('0x9'));var fs=require('fs');var fs_extra=require(_0xbd64('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbd64('0xb'));var jsforce=require(_0xbd64('0xc'));var deskjs=require(_0xbd64('0xd'));var toCsv=require(_0xbd64('0x8'));var querystring=require('querystring');var Papa=require(_0xbd64('0xe'));var Redis=require(_0xbd64('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbd64('0x10'));var as=require(_0xbd64('0x11'));var hardwareService=require(_0xbd64('0x12'));var logger=require(_0xbd64('0x13'))(_0xbd64('0x14'));var utils=require(_0xbd64('0x15'));var config=require(_0xbd64('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd64('0x17'))['db'];function respondWithStatusCode(_0x99455b,_0x2edda2){_0x2edda2=_0x2edda2||0xcc;return function(_0xa958fd){if(_0xa958fd){return _0x99455b[_0xbd64('0x18')](_0x2edda2);}return _0x99455b['status'](_0x2edda2)[_0xbd64('0x19')]();};}function respondWithResult(_0x41dc7d,_0x46c15b){_0x46c15b=_0x46c15b||0xc8;return function(_0x3767f0){if(_0x3767f0){return _0x41dc7d[_0xbd64('0x1a')](_0x46c15b)[_0xbd64('0x1b')](_0x3767f0);}};}function respondWithFilteredResult(_0x104d87,_0x5334d3){return function(_0x5d9169){if(_0x5d9169){var _0x57f79a=typeof _0x5334d3[_0xbd64('0x1c')]===_0xbd64('0x1d')&&typeof _0x5334d3[_0xbd64('0x1e')]===_0xbd64('0x1d');var _0x27f7b0=_0x5d9169[_0xbd64('0x1f')];var _0x4fc527=_0x57f79a?0x0:_0x5334d3[_0xbd64('0x1c')];var _0xdb330f=_0x57f79a?_0x5d9169[_0xbd64('0x1f')]:_0x5334d3[_0xbd64('0x1c')]+_0x5334d3[_0xbd64('0x1e')];var _0x24b9bf;if(_0xdb330f>=_0x27f7b0){_0xdb330f=_0x27f7b0;_0x24b9bf=0xc8;}else{_0x24b9bf=0xce;}_0x104d87[_0xbd64('0x1a')](_0x24b9bf);return _0x104d87[_0xbd64('0x20')]('Content-Range',_0x4fc527+'-'+_0xdb330f+'/'+_0x27f7b0)['json'](_0x5d9169);}return null;};}function patchUpdates(_0x2f32ef){return function(_0x54f86b){try{jsonpatch[_0xbd64('0x21')](_0x54f86b,_0x2f32ef,!![]);}catch(_0x1e4ea3){return BPromise[_0xbd64('0x22')](_0x1e4ea3);}return _0x54f86b[_0xbd64('0x23')]();};}function saveUpdates(_0x1f566e,_0x2d9c7e){return function(_0x4b925e){if(_0x4b925e){return _0x4b925e['update'](_0x1f566e)['then'](function(_0x3c428c){return _0x3c428c;});}return null;};}function removeEntity(_0x449476,_0x39d09e){return function(_0x4178f0){if(_0x4178f0){return _0x4178f0[_0xbd64('0x24')]()[_0xbd64('0x25')](function(){_0x449476[_0xbd64('0x1a')](0xcc)[_0xbd64('0x19')]();});}};}function handleEntityNotFound(_0x4b2aa0,_0x283cea){return function(_0x1099b6){if(!_0x1099b6){_0x4b2aa0[_0xbd64('0x18')](0x194);}return _0x1099b6;};}function handleError(_0x33f778,_0x447db9){_0x447db9=_0x447db9||0x1f4;return function(_0x2a061b){logger['error'](_0x2a061b['stack']);if(_0x2a061b[_0xbd64('0x26')]){delete _0x2a061b[_0xbd64('0x26')];}_0x33f778['status'](_0x447db9)[_0xbd64('0x27')](_0x2a061b);};}exports[_0xbd64('0x28')]=function(_0x3b57f1,_0x43b3f2){var _0x2d1543={},_0x5c1802={},_0x5ea0fd={'count':0x0,'rows':[]};var _0x178016=_[_0xbd64('0x29')](db[_0xbd64('0x2a')][_0xbd64('0x2b')],function(_0x5f5336){return{'name':_0x5f5336[_0xbd64('0x2c')],'type':_0x5f5336[_0xbd64('0x2d')][_0xbd64('0x2e')]};});_0x5c1802[_0xbd64('0x2f')]=_[_0xbd64('0x29')](_0x178016,_0xbd64('0x26'));_0x5c1802['query']=_[_0xbd64('0x30')](_0x3b57f1[_0xbd64('0x31')]);_0x5c1802[_0xbd64('0x32')]=_[_0xbd64('0x33')](_0x5c1802[_0xbd64('0x2f')],_0x5c1802[_0xbd64('0x31')]);_0x2d1543[_0xbd64('0x34')]=_[_0xbd64('0x33')](_0x5c1802['model'],qs['fields'](_0x3b57f1[_0xbd64('0x31')][_0xbd64('0x35')]));_0x2d1543[_0xbd64('0x34')]=_0x2d1543[_0xbd64('0x34')][_0xbd64('0x36')]?_0x2d1543[_0xbd64('0x34')]:_0x5c1802['model'];if(!_0x3b57f1[_0xbd64('0x31')][_0xbd64('0x37')](_0xbd64('0x38'))){_0x2d1543[_0xbd64('0x1e')]=qs[_0xbd64('0x1e')](_0x3b57f1[_0xbd64('0x31')][_0xbd64('0x1e')]);_0x2d1543[_0xbd64('0x1c')]=qs['offset'](_0x3b57f1['query'][_0xbd64('0x1c')]);}_0x2d1543[_0xbd64('0x39')]=qs['sort'](_0x3b57f1[_0xbd64('0x31')]['sort']);_0x2d1543['where']=qs[_0xbd64('0x32')](_[_0xbd64('0x3a')](_0x3b57f1[_0xbd64('0x31')],_0x5c1802[_0xbd64('0x32')]),_0x178016);if(_0x3b57f1[_0xbd64('0x31')]['filter']){_0x2d1543[_0xbd64('0x3b')]=_[_0xbd64('0x3c')](_0x2d1543[_0xbd64('0x3b')],{'$or':_['map'](_0x178016,function(_0x334dba){if(_0x334dba[_0xbd64('0x2d')]!=='VIRTUAL'){var _0x458223={};_0x458223[_0x334dba[_0xbd64('0x26')]]={'$like':'%'+_0x3b57f1[_0xbd64('0x31')][_0xbd64('0x3d')]+'%'};return _0x458223;}})});}_0x2d1543=_[_0xbd64('0x3c')]({},_0x2d1543,_0x3b57f1[_0xbd64('0x3e')]);var _0x1bcb1f={'where':_0x2d1543[_0xbd64('0x3b')]};return db['MailServerOut'][_0xbd64('0x1f')](_0x1bcb1f)['then'](function(_0x143d43){_0x5ea0fd['count']=_0x143d43;if(_0x3b57f1[_0xbd64('0x31')]['includeAll']){_0x2d1543[_0xbd64('0x3f')]=[{'all':!![]}];}return db[_0xbd64('0x2a')][_0xbd64('0x40')](_0x2d1543);})[_0xbd64('0x25')](function(_0x3ca835){_0x5ea0fd[_0xbd64('0x41')]=_0x3ca835;return _0x5ea0fd;})[_0xbd64('0x25')](respondWithFilteredResult(_0x43b3f2,_0x2d1543))[_0xbd64('0x42')](handleError(_0x43b3f2,null));};exports[_0xbd64('0x43')]=function(_0xa40a7a,_0xef7076){var _0x3f9387={'raw':!![],'where':{'id':_0xa40a7a[_0xbd64('0x44')]['id']}},_0x4a714c={};_0x4a714c[_0xbd64('0x2f')]=_['keys'](db['MailServerOut']['rawAttributes']);_0x4a714c[_0xbd64('0x31')]=_[_0xbd64('0x30')](_0xa40a7a[_0xbd64('0x31')]);_0x4a714c['filters']=_[_0xbd64('0x33')](_0x4a714c[_0xbd64('0x2f')],_0x4a714c[_0xbd64('0x31')]);_0x3f9387[_0xbd64('0x34')]=_[_0xbd64('0x33')](_0x4a714c[_0xbd64('0x2f')],qs[_0xbd64('0x35')](_0xa40a7a[_0xbd64('0x31')][_0xbd64('0x35')]));_0x3f9387[_0xbd64('0x34')]=_0x3f9387[_0xbd64('0x34')][_0xbd64('0x36')]?_0x3f9387['attributes']:_0x4a714c[_0xbd64('0x2f')];if(_0xa40a7a['query'][_0xbd64('0x45')]){_0x3f9387[_0xbd64('0x3f')]=[{'all':!![]}];}_0x3f9387=_[_0xbd64('0x3c')]({},_0x3f9387,_0xa40a7a[_0xbd64('0x3e')]);return db[_0xbd64('0x2a')][_0xbd64('0x46')](_0x3f9387)[_0xbd64('0x25')](handleEntityNotFound(_0xef7076,null))['then'](respondWithResult(_0xef7076,null))['catch'](handleError(_0xef7076,null));};exports[_0xbd64('0x47')]=function(_0x3b5c43,_0x57342b){return db[_0xbd64('0x2a')]['create'](_0x3b5c43[_0xbd64('0x48')],{})[_0xbd64('0x25')](respondWithResult(_0x57342b,0xc9))[_0xbd64('0x42')](handleError(_0x57342b,null));};exports['update']=function(_0x36c1dc,_0x2203eb){if(_0x36c1dc[_0xbd64('0x48')]['id']){delete _0x36c1dc[_0xbd64('0x48')]['id'];}return db[_0xbd64('0x2a')]['find']({'where':{'id':_0x36c1dc[_0xbd64('0x44')]['id']}})[_0xbd64('0x25')](handleEntityNotFound(_0x2203eb,null))[_0xbd64('0x25')](saveUpdates(_0x36c1dc[_0xbd64('0x48')],null))['then'](respondWithResult(_0x2203eb,null))['catch'](handleError(_0x2203eb,null));};exports[_0xbd64('0x24')]=function(_0x5aa85f,_0x6add50){return db[_0xbd64('0x2a')][_0xbd64('0x46')]({'where':{'id':_0x5aa85f[_0xbd64('0x44')]['id']}})[_0xbd64('0x25')](handleEntityNotFound(_0x6add50,null))[_0xbd64('0x25')](removeEntity(_0x6add50,null))[_0xbd64('0x42')](handleError(_0x6add50,null));};
\ No newline at end of file
index 5becb86..730d738 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa48b=['MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','exports','define'];(function(_0x83de69,_0x204d4f){var _0x24bc46=function(_0x36b115){while(--_0x36b115){_0x83de69['push'](_0x83de69['shift']());}};_0x24bc46(++_0x204d4f);}(_0xa48b,0x6a));var _0xba48=function(_0x3cdcfb,_0x161e5c){_0x3cdcfb=_0x3cdcfb-0x0;var _0x59f5da=_0xa48b[_0x3cdcfb];return _0x59f5da;};'use strict';var _=require(_0xba48('0x0'));var util=require(_0xba48('0x1'));var logger=require(_0xba48('0x2'))(_0xba48('0x3'));var moment=require('moment');var BPromise=require(_0xba48('0x4'));var rp=require(_0xba48('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xba48('0x6'));var config=require(_0xba48('0x7'));var attributes=require(_0xba48('0x8'));module[_0xba48('0x9')]=function(_0x1376b8,_0x375121){return _0x1376b8[_0xba48('0xa')](_0xba48('0xb'),attributes,{'tableName':_0xba48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x476e=['rimraf','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x9c08ca,_0x4d3960){var _0x26541e=function(_0x3a5967){while(--_0x3a5967){_0x9c08ca['push'](_0x9c08ca['shift']());}};_0x26541e(++_0x4d3960);}(_0x476e,0x12e));var _0xe476=function(_0x571928,_0x2897ee){_0x571928=_0x571928-0x0;var _0x601517=_0x476e[_0x571928];return _0x601517;};'use strict';var _=require('lodash');var util=require(_0xe476('0x0'));var logger=require(_0xe476('0x1'))('api');var moment=require(_0xe476('0x2'));var BPromise=require(_0xe476('0x3'));var rp=require(_0xe476('0x4'));var fs=require('fs');var path=require(_0xe476('0x5'));var rimraf=require(_0xe476('0x6'));var config=require('../../config/environment');var attributes=require(_0xe476('0x7'));module[_0xe476('0x8')]=function(_0x2b8183,_0xf3cceb){return _0x2b8183['define'](_0xe476('0x9'),attributes,{'tableName':_0xe476('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8c00b54..b947b0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x735e9,_0x519954){var _0x294a3e=function(_0x13fece){while(--_0x13fece){_0x735e9['push'](_0x735e9['shift']());}};_0x294a3e(++_0x519954);}(_0x1261,0x144));var _0x1126=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x1261[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x52369a,_0x1f6d57){var _0x5d1202=function(_0x486583){while(--_0x486583){_0x52369a['push'](_0x52369a['shift']());}};_0x5d1202(++_0x1f6d57);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('MailServerOut,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});}
\ No newline at end of file
index c72dd39..d327bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9d9=['update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id','show'];(function(_0xdc1aa3,_0x3591ee){var _0x1f858f=function(_0x420fb4){while(--_0x420fb4){_0xdc1aa3['push'](_0xdc1aa3['shift']());}};_0x1f858f(++_0x3591ee);}(_0xe9d9,0xb8));var _0x9e9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9d9[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x9e9d('0x0'));var util=require(_0x9e9d('0x1'));var path=require(_0x9e9d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e9d('0x3')]();var fs_extra=require(_0x9e9d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e9d('0x5'));var config=require(_0x9e9d('0x6'));var controller=require(_0x9e9d('0x7'));router[_0x9e9d('0x8')]('/',auth[_0x9e9d('0x9')](),controller[_0x9e9d('0xa')]);router[_0x9e9d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x9e9d('0xb')]);router[_0x9e9d('0x8')](_0x9e9d('0xc'),auth[_0x9e9d('0x9')](),controller[_0x9e9d('0xd')]);router['post']('/',auth[_0x9e9d('0x9')](),controller['create']);router['put'](_0x9e9d('0xc'),auth[_0x9e9d('0x9')](),controller[_0x9e9d('0xe')]);router[_0x9e9d('0xf')]('/:id',auth[_0x9e9d('0x9')](),controller[_0x9e9d('0x10')]);module[_0x9e9d('0x11')]=router;
\ No newline at end of file
+var _0x339a=['isAuthenticated','describe','get','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','/describe'];(function(_0xdb3785,_0x2ff276){var _0x4c9155=function(_0x4ab90b){while(--_0x4ab90b){_0xdb3785['push'](_0xdb3785['shift']());}};_0x4c9155(++_0x2ff276);}(_0x339a,0x1ac));var _0xa339=function(_0x2189cc,_0x2da091){_0x2189cc=_0x2189cc-0x0;var _0x1e3052=_0x339a[_0x2189cc];return _0x1e3052;};'use strict';var multer=require(_0xa339('0x0'));var util=require(_0xa339('0x1'));var path=require(_0xa339('0x2'));var timeout=require(_0xa339('0x3'));var express=require(_0xa339('0x4'));var router=express[_0xa339('0x5')]();var fs_extra=require(_0xa339('0x6'));var auth=require(_0xa339('0x7'));var interaction=require(_0xa339('0x8'));var config=require(_0xa339('0x9'));var controller=require(_0xa339('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa339('0xb'),auth[_0xa339('0xc')](),controller[_0xa339('0xd')]);router[_0xa339('0xe')](_0xa339('0xf'),auth[_0xa339('0xc')](),controller[_0xa339('0x10')]);router[_0xa339('0x11')]('/',auth[_0xa339('0xc')](),controller[_0xa339('0x12')]);router[_0xa339('0x13')](_0xa339('0xf'),auth['isAuthenticated'](),controller['update']);router[_0xa339('0x14')](_0xa339('0xf'),auth[_0xa339('0xc')](),controller[_0xa339('0x15')]);module['exports']=router;
\ No newline at end of file
index a9cb04f..e00815d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb65=['exports','STRING'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xfb65,0x82));var _0x5fb6=function(_0x1458e2,_0x1b45c2){_0x1458e2=_0x1458e2-0x0;var _0x4d191c=_0xfb65[_0x1458e2];return _0x4d191c;};'use strict';var Sequelize=require('sequelize');module[_0x5fb6('0x0')]={'name':{'type':Sequelize[_0x5fb6('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5fb6('0x1')]}};
\ No newline at end of file
+var _0xda19=['STRING','exports'];(function(_0x3bc2d9,_0x39008f){var _0x4286d1=function(_0x378a98){while(--_0x378a98){_0x3bc2d9['push'](_0x3bc2d9['shift']());}};_0x4286d1(++_0x39008f);}(_0xda19,0xd5));var _0x9da1=function(_0x47f1b8,_0x2becb2){_0x47f1b8=_0x47f1b8-0x0;var _0x20b5cf=_0xda19[_0x47f1b8];return _0x20b5cf;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9da1('0x1')]}};
\ No newline at end of file
index d5f096f..b671903 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9b4=['path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','sendStatus','stack','name','send','index','MailSubstatus','rawAttributes','type','key','model','map','keys','query','filters','fields','attributes','nolimit','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','params','intersection','find','create','body','update','destroy','describe','eml-format','zip-dir','moment','mustache'];(function(_0x117ad0,_0x58e070){var _0x2970dc=function(_0x60b100){while(--_0x60b100){_0x117ad0['push'](_0x117ad0['shift']());}};_0x2970dc(++_0x58e070);}(_0xf9b4,0xd1));var _0x4f9b=function(_0x1f48e5,_0x451e6e){_0x1f48e5=_0x1f48e5-0x0;var _0x342f42=_0xf9b4[_0x1f48e5];return _0x342f42;};'use strict';var emlformat=require(_0x4f9b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4f9b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4f9b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f9b('0x3'));var util=require('util');var path=require(_0x4f9b('0x4'));var sox=require(_0x4f9b('0x5'));var csv=require(_0x4f9b('0x6'));var ejs=require(_0x4f9b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f9b('0x8'));var squel=require(_0x4f9b('0x9'));var crypto=require(_0x4f9b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4f9b('0x6'));var querystring=require(_0x4f9b('0xb'));var Papa=require(_0x4f9b('0xc'));var Redis=require(_0x4f9b('0xd'));var authService=require(_0x4f9b('0xe'));var qs=require(_0x4f9b('0xf'));var as=require(_0x4f9b('0x10'));var hardwareService=require(_0x4f9b('0x11'));var logger=require(_0x4f9b('0x12'))(_0x4f9b('0x13'));var utils=require(_0x4f9b('0x14'));var config=require(_0x4f9b('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x4f9b('0x16'))['db'];function respondWithStatusCode(_0x43e26e,_0x3cb24c){_0x3cb24c=_0x3cb24c||0xcc;return function(_0x298eed){if(_0x298eed){return _0x43e26e['sendStatus'](_0x3cb24c);}return _0x43e26e[_0x4f9b('0x17')](_0x3cb24c)[_0x4f9b('0x18')]();};}function respondWithResult(_0x34c2cd,_0x20d421){_0x20d421=_0x20d421||0xc8;return function(_0x5f086f){if(_0x5f086f){return _0x34c2cd['status'](_0x20d421)[_0x4f9b('0x19')](_0x5f086f);}};}function respondWithFilteredResult(_0x3afda5,_0x4cb050){return function(_0x216cc3){if(_0x216cc3){var _0x5728b5=typeof _0x4cb050[_0x4f9b('0x1a')]===_0x4f9b('0x1b')&&typeof _0x4cb050[_0x4f9b('0x1c')]===_0x4f9b('0x1b');var _0x49bf06=_0x216cc3[_0x4f9b('0x1d')];var _0x5cb991=_0x5728b5?0x0:_0x4cb050[_0x4f9b('0x1a')];var _0x14cbec=_0x5728b5?_0x216cc3['count']:_0x4cb050[_0x4f9b('0x1a')]+_0x4cb050[_0x4f9b('0x1c')];var _0x4c9d4b;if(_0x14cbec>=_0x49bf06){_0x14cbec=_0x49bf06;_0x4c9d4b=0xc8;}else{_0x4c9d4b=0xce;}_0x3afda5[_0x4f9b('0x17')](_0x4c9d4b);return _0x3afda5[_0x4f9b('0x1e')](_0x4f9b('0x1f'),_0x5cb991+'-'+_0x14cbec+'/'+_0x49bf06)[_0x4f9b('0x19')](_0x216cc3);}return null;};}function patchUpdates(_0x465c0f){return function(_0x125957){try{jsonpatch[_0x4f9b('0x20')](_0x125957,_0x465c0f,!![]);}catch(_0x16d577){return BPromise[_0x4f9b('0x21')](_0x16d577);}return _0x125957['save']();};}function saveUpdates(_0x588813,_0xc3b0a0){return function(_0x1b8b05){if(_0x1b8b05){return _0x1b8b05['update'](_0x588813)[_0x4f9b('0x22')](function(_0x2ded17){return _0x2ded17;});}return null;};}function removeEntity(_0x334fbf,_0x54f402){return function(_0x2242e6){if(_0x2242e6){return _0x2242e6['destroy']()[_0x4f9b('0x22')](function(){_0x334fbf[_0x4f9b('0x17')](0xcc)[_0x4f9b('0x18')]();});}};}function handleEntityNotFound(_0x4c4a6c,_0x4f4322){return function(_0x16fa6a){if(!_0x16fa6a){_0x4c4a6c[_0x4f9b('0x23')](0x194);}return _0x16fa6a;};}function handleError(_0x248098,_0x5ef71f){_0x5ef71f=_0x5ef71f||0x1f4;return function(_0x41f0f5){logger['error'](_0x41f0f5[_0x4f9b('0x24')]);if(_0x41f0f5[_0x4f9b('0x25')]){delete _0x41f0f5['name'];}_0x248098[_0x4f9b('0x17')](_0x5ef71f)[_0x4f9b('0x26')](_0x41f0f5);};}exports[_0x4f9b('0x27')]=function(_0x50392e,_0x5acb7e){var _0x2944ac={},_0x42e11b={},_0x3d6cd1={'count':0x0,'rows':[]};var _0x1f7030=_['map'](db[_0x4f9b('0x28')][_0x4f9b('0x29')],function(_0x719121){return{'name':_0x719121['fieldName'],'type':_0x719121[_0x4f9b('0x2a')][_0x4f9b('0x2b')]};});_0x42e11b[_0x4f9b('0x2c')]=_[_0x4f9b('0x2d')](_0x1f7030,_0x4f9b('0x25'));_0x42e11b['query']=_[_0x4f9b('0x2e')](_0x50392e[_0x4f9b('0x2f')]);_0x42e11b[_0x4f9b('0x30')]=_['intersection'](_0x42e11b[_0x4f9b('0x2c')],_0x42e11b[_0x4f9b('0x2f')]);_0x2944ac['attributes']=_['intersection'](_0x42e11b[_0x4f9b('0x2c')],qs[_0x4f9b('0x31')](_0x50392e[_0x4f9b('0x2f')][_0x4f9b('0x31')]));_0x2944ac['attributes']=_0x2944ac['attributes']['length']?_0x2944ac[_0x4f9b('0x32')]:_0x42e11b[_0x4f9b('0x2c')];if(!_0x50392e['query']['hasOwnProperty'](_0x4f9b('0x33'))){_0x2944ac[_0x4f9b('0x1c')]=qs[_0x4f9b('0x1c')](_0x50392e[_0x4f9b('0x2f')][_0x4f9b('0x1c')]);_0x2944ac[_0x4f9b('0x1a')]=qs['offset'](_0x50392e[_0x4f9b('0x2f')]['offset']);}_0x2944ac['order']=qs[_0x4f9b('0x34')](_0x50392e['query'][_0x4f9b('0x34')]);_0x2944ac['where']=qs[_0x4f9b('0x30')](_[_0x4f9b('0x35')](_0x50392e[_0x4f9b('0x2f')],_0x42e11b[_0x4f9b('0x30')]),_0x1f7030);if(_0x50392e[_0x4f9b('0x2f')]['filter']){_0x2944ac[_0x4f9b('0x36')]=_[_0x4f9b('0x37')](_0x2944ac[_0x4f9b('0x36')],{'$or':_['map'](_0x1f7030,function(_0x387968){if(_0x387968['type']!==_0x4f9b('0x38')){var _0x206952={};_0x206952[_0x387968[_0x4f9b('0x25')]]={'$like':'%'+_0x50392e[_0x4f9b('0x2f')][_0x4f9b('0x39')]+'%'};return _0x206952;}})});}_0x2944ac=_['merge']({},_0x2944ac,_0x50392e[_0x4f9b('0x3a')]);var _0xb0b266={'where':_0x2944ac[_0x4f9b('0x36')]};return db[_0x4f9b('0x28')][_0x4f9b('0x1d')](_0xb0b266)['then'](function(_0x5076dd){_0x3d6cd1[_0x4f9b('0x1d')]=_0x5076dd;if(_0x50392e[_0x4f9b('0x2f')][_0x4f9b('0x3b')]){_0x2944ac[_0x4f9b('0x3c')]=[{'all':!![]}];}return db[_0x4f9b('0x28')]['findAll'](_0x2944ac);})[_0x4f9b('0x22')](function(_0x16aa29){_0x3d6cd1['rows']=_0x16aa29;return _0x3d6cd1;})[_0x4f9b('0x22')](respondWithFilteredResult(_0x5acb7e,_0x2944ac))[_0x4f9b('0x3d')](handleError(_0x5acb7e,null));};exports[_0x4f9b('0x3e')]=function(_0x5eebd9,_0x389506){var _0x2593e5={'raw':!![],'where':{'id':_0x5eebd9[_0x4f9b('0x3f')]['id']}},_0x55c607={};_0x55c607[_0x4f9b('0x2c')]=_['keys'](db[_0x4f9b('0x28')][_0x4f9b('0x29')]);_0x55c607['query']=_[_0x4f9b('0x2e')](_0x5eebd9[_0x4f9b('0x2f')]);_0x55c607[_0x4f9b('0x30')]=_['intersection'](_0x55c607['model'],_0x55c607[_0x4f9b('0x2f')]);_0x2593e5[_0x4f9b('0x32')]=_[_0x4f9b('0x40')](_0x55c607['model'],qs[_0x4f9b('0x31')](_0x5eebd9[_0x4f9b('0x2f')]['fields']));_0x2593e5[_0x4f9b('0x32')]=_0x2593e5[_0x4f9b('0x32')]['length']?_0x2593e5['attributes']:_0x55c607['model'];if(_0x5eebd9[_0x4f9b('0x2f')]['includeAll']){_0x2593e5[_0x4f9b('0x3c')]=[{'all':!![]}];}_0x2593e5=_[_0x4f9b('0x37')]({},_0x2593e5,_0x5eebd9[_0x4f9b('0x3a')]);return db[_0x4f9b('0x28')][_0x4f9b('0x41')](_0x2593e5)['then'](handleEntityNotFound(_0x389506,null))[_0x4f9b('0x22')](respondWithResult(_0x389506,null))['catch'](handleError(_0x389506,null));};exports[_0x4f9b('0x42')]=function(_0x665ea3,_0x326178){return db[_0x4f9b('0x28')][_0x4f9b('0x42')](_0x665ea3[_0x4f9b('0x43')],{})[_0x4f9b('0x22')](respondWithResult(_0x326178,0xc9))[_0x4f9b('0x3d')](handleError(_0x326178,null));};exports[_0x4f9b('0x44')]=function(_0x188f4c,_0x4064f7){if(_0x188f4c[_0x4f9b('0x43')]['id']){delete _0x188f4c[_0x4f9b('0x43')]['id'];}return db[_0x4f9b('0x28')]['find']({'where':{'id':_0x188f4c[_0x4f9b('0x3f')]['id']}})[_0x4f9b('0x22')](handleEntityNotFound(_0x4064f7,null))[_0x4f9b('0x22')](saveUpdates(_0x188f4c[_0x4f9b('0x43')],null))[_0x4f9b('0x22')](respondWithResult(_0x4064f7,null))['catch'](handleError(_0x4064f7,null));};exports[_0x4f9b('0x45')]=function(_0xc3a77a,_0x1f1468){return db[_0x4f9b('0x28')][_0x4f9b('0x41')]({'where':{'id':_0xc3a77a[_0x4f9b('0x3f')]['id']}})[_0x4f9b('0x22')](handleEntityNotFound(_0x1f1468,null))[_0x4f9b('0x22')](removeEntity(_0x1f1468,null))['catch'](handleError(_0x1f1468,null));};exports[_0x4f9b('0x46')]=function(_0x45956c,_0x192fee){return db[_0x4f9b('0x28')]['describe']()[_0x4f9b('0x22')](respondWithResult(_0x192fee,null))[_0x4f9b('0x3d')](handleError(_0x192fee,null));};
\ No newline at end of file
+var _0x2bf1=['crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x13ca7c,_0x26bbf4){var _0x541bea=function(_0x4376af){while(--_0x4376af){_0x13ca7c['push'](_0x13ca7c['shift']());}};_0x541bea(++_0x26bbf4);}(_0x2bf1,0x175));var _0x12bf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x2bf1[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x12bf('0x0'));var rimraf=require(_0x12bf('0x1'));var zipdir=require(_0x12bf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x12bf('0x3'));var BPromise=require(_0x12bf('0x4'));var Mustache=require(_0x12bf('0x5'));var util=require(_0x12bf('0x6'));var path=require(_0x12bf('0x7'));var sox=require('sox');var csv=require(_0x12bf('0x8'));var ejs=require(_0x12bf('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12bf('0xa'));var squel=require(_0x12bf('0xb'));var crypto=require(_0x12bf('0xc'));var jsforce=require(_0x12bf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x12bf('0x8'));var querystring=require(_0x12bf('0xe'));var Papa=require(_0x12bf('0xf'));var Redis=require('ioredis');var authService=require(_0x12bf('0x10'));var qs=require(_0x12bf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x12bf('0x12'));var logger=require(_0x12bf('0x13'))('api');var utils=require(_0x12bf('0x14'));var config=require(_0x12bf('0x15'));var licenseUtil=require(_0x12bf('0x16'));var db=require(_0x12bf('0x17'))['db'];function respondWithStatusCode(_0x3cb723,_0x2e696f){_0x2e696f=_0x2e696f||0xcc;return function(_0x3f51f5){if(_0x3f51f5){return _0x3cb723[_0x12bf('0x18')](_0x2e696f);}return _0x3cb723['status'](_0x2e696f)['end']();};}function respondWithResult(_0x504869,_0x10ca41){_0x10ca41=_0x10ca41||0xc8;return function(_0x13a681){if(_0x13a681){return _0x504869['status'](_0x10ca41)[_0x12bf('0x19')](_0x13a681);}};}function respondWithFilteredResult(_0x46ff3d,_0x22cec1){return function(_0x324e3d){if(_0x324e3d){var _0x5368ec=typeof _0x22cec1['offset']===_0x12bf('0x1a')&&typeof _0x22cec1['limit']===_0x12bf('0x1a');var _0xa683f1=_0x324e3d[_0x12bf('0x1b')];var _0x47fec2=_0x5368ec?0x0:_0x22cec1['offset'];var _0x3e0f28=_0x5368ec?_0x324e3d['count']:_0x22cec1[_0x12bf('0x1c')]+_0x22cec1[_0x12bf('0x1d')];var _0x5c11f5;if(_0x3e0f28>=_0xa683f1){_0x3e0f28=_0xa683f1;_0x5c11f5=0xc8;}else{_0x5c11f5=0xce;}_0x46ff3d[_0x12bf('0x1e')](_0x5c11f5);return _0x46ff3d[_0x12bf('0x1f')](_0x12bf('0x20'),_0x47fec2+'-'+_0x3e0f28+'/'+_0xa683f1)['json'](_0x324e3d);}return null;};}function patchUpdates(_0x51c8d1){return function(_0x1111f5){try{jsonpatch[_0x12bf('0x21')](_0x1111f5,_0x51c8d1,!![]);}catch(_0x4c7ca2){return BPromise[_0x12bf('0x22')](_0x4c7ca2);}return _0x1111f5[_0x12bf('0x23')]();};}function saveUpdates(_0x247135,_0x5225b7){return function(_0x13d42d){if(_0x13d42d){return _0x13d42d[_0x12bf('0x24')](_0x247135)[_0x12bf('0x25')](function(_0x2e7041){return _0x2e7041;});}return null;};}function removeEntity(_0x3cb102,_0x36db92){return function(_0x68e807){if(_0x68e807){return _0x68e807[_0x12bf('0x26')]()[_0x12bf('0x25')](function(){_0x3cb102[_0x12bf('0x1e')](0xcc)[_0x12bf('0x27')]();});}};}function handleEntityNotFound(_0x21a4cb,_0x4883b2){return function(_0x2a2fef){if(!_0x2a2fef){_0x21a4cb[_0x12bf('0x18')](0x194);}return _0x2a2fef;};}function handleError(_0x1d4b95,_0x4a28ae){_0x4a28ae=_0x4a28ae||0x1f4;return function(_0x4ac258){logger[_0x12bf('0x28')](_0x4ac258[_0x12bf('0x29')]);if(_0x4ac258['name']){delete _0x4ac258[_0x12bf('0x2a')];}_0x1d4b95[_0x12bf('0x1e')](_0x4a28ae)[_0x12bf('0x2b')](_0x4ac258);};}exports[_0x12bf('0x2c')]=function(_0x3cb425,_0x37688c){var _0x5a4175={},_0x3b1b1f={},_0x4ef387={'count':0x0,'rows':[]};var _0x3ba9d7=_[_0x12bf('0x2d')](db[_0x12bf('0x2e')][_0x12bf('0x2f')],function(_0x5ab07e){return{'name':_0x5ab07e[_0x12bf('0x30')],'type':_0x5ab07e[_0x12bf('0x31')][_0x12bf('0x32')]};});_0x3b1b1f[_0x12bf('0x33')]=_['map'](_0x3ba9d7,'name');_0x3b1b1f['query']=_[_0x12bf('0x34')](_0x3cb425[_0x12bf('0x35')]);_0x3b1b1f['filters']=_[_0x12bf('0x36')](_0x3b1b1f[_0x12bf('0x33')],_0x3b1b1f['query']);_0x5a4175[_0x12bf('0x37')]=_[_0x12bf('0x36')](_0x3b1b1f[_0x12bf('0x33')],qs[_0x12bf('0x38')](_0x3cb425[_0x12bf('0x35')]['fields']));_0x5a4175[_0x12bf('0x37')]=_0x5a4175[_0x12bf('0x37')][_0x12bf('0x39')]?_0x5a4175[_0x12bf('0x37')]:_0x3b1b1f[_0x12bf('0x33')];if(!_0x3cb425['query'][_0x12bf('0x3a')](_0x12bf('0x3b'))){_0x5a4175[_0x12bf('0x1d')]=qs[_0x12bf('0x1d')](_0x3cb425[_0x12bf('0x35')][_0x12bf('0x1d')]);_0x5a4175['offset']=qs[_0x12bf('0x1c')](_0x3cb425[_0x12bf('0x35')][_0x12bf('0x1c')]);}_0x5a4175[_0x12bf('0x3c')]=qs['sort'](_0x3cb425[_0x12bf('0x35')]['sort']);_0x5a4175[_0x12bf('0x3d')]=qs[_0x12bf('0x3e')](_['pick'](_0x3cb425[_0x12bf('0x35')],_0x3b1b1f[_0x12bf('0x3e')]),_0x3ba9d7);if(_0x3cb425[_0x12bf('0x35')][_0x12bf('0x3f')]){_0x5a4175[_0x12bf('0x3d')]=_[_0x12bf('0x40')](_0x5a4175['where'],{'$or':_[_0x12bf('0x2d')](_0x3ba9d7,function(_0x59d7aa){if(_0x59d7aa[_0x12bf('0x31')]!=='VIRTUAL'){var _0x2a72c1={};_0x2a72c1[_0x59d7aa[_0x12bf('0x2a')]]={'$like':'%'+_0x3cb425['query'][_0x12bf('0x3f')]+'%'};return _0x2a72c1;}})});}_0x5a4175=_[_0x12bf('0x40')]({},_0x5a4175,_0x3cb425[_0x12bf('0x41')]);var _0x563caf={'where':_0x5a4175[_0x12bf('0x3d')]};return db['MailSubstatus']['count'](_0x563caf)[_0x12bf('0x25')](function(_0x7c1a3a){_0x4ef387['count']=_0x7c1a3a;if(_0x3cb425['query'][_0x12bf('0x42')]){_0x5a4175[_0x12bf('0x43')]=[{'all':!![]}];}return db[_0x12bf('0x2e')][_0x12bf('0x44')](_0x5a4175);})[_0x12bf('0x25')](function(_0x7d9792){_0x4ef387[_0x12bf('0x45')]=_0x7d9792;return _0x4ef387;})[_0x12bf('0x25')](respondWithFilteredResult(_0x37688c,_0x5a4175))[_0x12bf('0x46')](handleError(_0x37688c,null));};exports[_0x12bf('0x47')]=function(_0x13cf9d,_0x11da4d){var _0x3ef8c3={'raw':!![],'where':{'id':_0x13cf9d[_0x12bf('0x48')]['id']}},_0x522e99={};_0x522e99[_0x12bf('0x33')]=_[_0x12bf('0x34')](db[_0x12bf('0x2e')][_0x12bf('0x2f')]);_0x522e99[_0x12bf('0x35')]=_[_0x12bf('0x34')](_0x13cf9d[_0x12bf('0x35')]);_0x522e99['filters']=_[_0x12bf('0x36')](_0x522e99['model'],_0x522e99[_0x12bf('0x35')]);_0x3ef8c3[_0x12bf('0x37')]=_[_0x12bf('0x36')](_0x522e99[_0x12bf('0x33')],qs[_0x12bf('0x38')](_0x13cf9d[_0x12bf('0x35')][_0x12bf('0x38')]));_0x3ef8c3[_0x12bf('0x37')]=_0x3ef8c3[_0x12bf('0x37')]['length']?_0x3ef8c3[_0x12bf('0x37')]:_0x522e99['model'];if(_0x13cf9d[_0x12bf('0x35')][_0x12bf('0x42')]){_0x3ef8c3[_0x12bf('0x43')]=[{'all':!![]}];}_0x3ef8c3=_[_0x12bf('0x40')]({},_0x3ef8c3,_0x13cf9d['options']);return db[_0x12bf('0x2e')]['find'](_0x3ef8c3)[_0x12bf('0x25')](handleEntityNotFound(_0x11da4d,null))[_0x12bf('0x25')](respondWithResult(_0x11da4d,null))[_0x12bf('0x46')](handleError(_0x11da4d,null));};exports[_0x12bf('0x49')]=function(_0x254187,_0x48bbb1){return db['MailSubstatus']['create'](_0x254187[_0x12bf('0x4a')],{})[_0x12bf('0x25')](respondWithResult(_0x48bbb1,0xc9))[_0x12bf('0x46')](handleError(_0x48bbb1,null));};exports[_0x12bf('0x24')]=function(_0x48f4e0,_0x27f635){if(_0x48f4e0[_0x12bf('0x4a')]['id']){delete _0x48f4e0[_0x12bf('0x4a')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x48f4e0[_0x12bf('0x48')]['id']}})[_0x12bf('0x25')](handleEntityNotFound(_0x27f635,null))[_0x12bf('0x25')](saveUpdates(_0x48f4e0[_0x12bf('0x4a')],null))[_0x12bf('0x25')](respondWithResult(_0x27f635,null))[_0x12bf('0x46')](handleError(_0x27f635,null));};exports[_0x12bf('0x26')]=function(_0x4f1162,_0x47abce){return db['MailSubstatus'][_0x12bf('0x4b')]({'where':{'id':_0x4f1162['params']['id']}})[_0x12bf('0x25')](handleEntityNotFound(_0x47abce,null))[_0x12bf('0x25')](removeEntity(_0x47abce,null))['catch'](handleError(_0x47abce,null));};exports[_0x12bf('0x4c')]=function(_0xc75e8,_0x227066){return db['MailSubstatus'][_0x12bf('0x4c')]()[_0x12bf('0x25')](respondWithResult(_0x227066,null))[_0x12bf('0x46')](handleError(_0x227066,null));};
\ No newline at end of file
index ecae882..b4934bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x027b=['../../mysqldb','emit','exports','events'];(function(_0x11b12b,_0xa6d069){var _0x7ca0b9=function(_0x2e2158){while(--_0x2e2158){_0x11b12b['push'](_0x11b12b['shift']());}};_0x7ca0b9(++_0xa6d069);}(_0x027b,0x7b));var _0xb027=function(_0x54a40c,_0x2ec8be){_0x54a40c=_0x54a40c-0x0;var _0x3553e0=_0x027b[_0x54a40c];return _0x3553e0;};'use strict';var EventEmitter=require(_0xb027('0x0'));var MailSubstatus=require(_0xb027('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x1c8997){return function(_0xa30389,_0x474672,_0x1ce0a8){MailSubstatusEvents[_0xb027('0x2')](_0x1c8997+':'+_0xa30389['id'],_0xa30389);MailSubstatusEvents[_0xb027('0x2')](_0x1c8997,_0xa30389);_0x1ce0a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0xb027('0x3')]=MailSubstatusEvents;
\ No newline at end of file
+var _0xcf98=['MailSubstatus','setMaxListeners','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x4fb5a1,_0x5bdee4){var _0x2ede19=function(_0x42c089){while(--_0x42c089){_0x4fb5a1['push'](_0x4fb5a1['shift']());}};_0x2ede19(++_0x5bdee4);}(_0xcf98,0xfa));var _0x8cf9=function(_0x3f2cb4,_0x5ca27c){_0x3f2cb4=_0x3f2cb4-0x0;var _0x342185=_0xcf98[_0x3f2cb4];return _0x342185;};'use strict';var EventEmitter=require(_0x8cf9('0x0'));var MailSubstatus=require(_0x8cf9('0x1'))['db'][_0x8cf9('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x8cf9('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x203a39){return function(_0x3f6eff,_0x16251d,_0x472a51){MailSubstatusEvents['emit'](_0x203a39+':'+_0x3f6eff['id'],_0x3f6eff);MailSubstatusEvents[_0x8cf9('0x4')](_0x203a39,_0x3f6eff);_0x472a51(null);};}for(var e in events){if(events[_0x8cf9('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x8cf9('0x6')]=MailSubstatusEvents;
\ No newline at end of file
index 8283ab6..37424c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaced=['MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','./mailSubstatus.attributes','exports','models'];(function(_0x1b0c08,_0xd7531f){var _0x123dbf=function(_0xc34596){while(--_0xc34596){_0x1b0c08['push'](_0x1b0c08['shift']());}};_0x123dbf(++_0xd7531f);}(_0xaced,0x17e));var _0xdace=function(_0x5e6a32,_0x25edd4){_0x5e6a32=_0x5e6a32-0x0;var _0x31d361=_0xaced[_0x5e6a32];return _0x31d361;};'use strict';var attributes=require(_0xdace('0x0'));module[_0xdace('0x1')]=function(_0x1372f1){var _0x43b479=_0x1372f1[_0xdace('0x2')];return _0x1372f1['define'](_0xdace('0x3'),attributes,{'tableName':_0xdace('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x154452,_0x30187e,_0x2cdf47){return _0x43b479[_0xdace('0x5')][_0xdace('0x6')]({'value':_0x154452[_0xdace('0x7')]},{'where':{'field':_0xdace('0x8'),'value':_0x154452[_0xdace('0x9')][_0xdace('0x7')]}})[_0xdace('0xa')](function(){_0x2cdf47();})['catch'](function(_0x57496c){_0x2cdf47(_0x57496c);});}}});};
\ No newline at end of file
+var _0xc41a=['update','name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','Condition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc41a,0x19c));var _0xac41=function(_0x5e57d7,_0x5e1bce){_0x5e57d7=_0x5e57d7-0x0;var _0x6e70f0=_0xc41a[_0x5e57d7];return _0x6e70f0;};'use strict';var attributes=require(_0xac41('0x0'));module[_0xac41('0x1')]=function(_0x52cb80){var _0x4f112d=_0x52cb80['models'];return _0x52cb80[_0xac41('0x2')](_0xac41('0x3'),attributes,{'tableName':_0xac41('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x5d0732,_0x22d068,_0x4d6faa){return _0x4f112d[_0xac41('0x5')][_0xac41('0x6')]({'value':_0x5d0732[_0xac41('0x7')]},{'where':{'field':'mailSubstatus','value':_0x5d0732[_0xac41('0x8')][_0xac41('0x7')]}})[_0xac41('0x9')](function(){_0x4d6faa();})[_0xac41('0xa')](function(_0x754e2){_0x4d6faa(_0x754e2);});}}});};
\ No newline at end of file
index 2878320..61d289c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7f9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','MailSubstatus,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x59a73b,_0x5300c0){var _0x7e6d8f=function(_0x565c55){while(--_0x565c55){_0x59a73b['push'](_0x59a73b['shift']());}};_0x7e6d8f(++_0x5300c0);}(_0xd7f9,0x8b));var _0x9d7f=function(_0x2e7f96,_0x2ffe43){_0x2e7f96=_0x2e7f96-0x0;var _0x315277=_0xd7f9[_0x2e7f96];return _0x315277;};'use strict';var _=require(_0x9d7f('0x0'));var util=require(_0x9d7f('0x1'));var moment=require('moment');var BPromise=require(_0x9d7f('0x2'));var rs=require(_0x9d7f('0x3'));var fs=require('fs');var Redis=require(_0x9d7f('0x4'));var db=require(_0x9d7f('0x5'))['db'];var utils=require(_0x9d7f('0x6'));var logger=require(_0x9d7f('0x7'))(_0x9d7f('0x8'));var config=require(_0x9d7f('0x9'));var jayson=require(_0x9d7f('0xa'));var client=jayson[_0x9d7f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x85337c,_0x5be39d,_0x110e0d){return new BPromise(function(_0x3ca332,_0xd99a98){return client[_0x9d7f('0xc')](_0x85337c,_0x110e0d)[_0x9d7f('0xd')](function(_0x33a49d){logger[_0x9d7f('0xe')]('MailSubstatus,\x20%s,\x20%s',_0x5be39d,_0x9d7f('0xf'));logger[_0x9d7f('0x10')](_0x9d7f('0x11'),_0x5be39d,_0x9d7f('0xf'),JSON[_0x9d7f('0x12')](_0x33a49d));if(_0x33a49d['error']){if(_0x33a49d['error']['code']===0x1f4){logger['error'](_0x9d7f('0x13'),_0x5be39d,_0x33a49d[_0x9d7f('0x14')]['message']);return _0xd99a98(_0x33a49d[_0x9d7f('0x14')][_0x9d7f('0x15')]);}logger[_0x9d7f('0x14')](_0x9d7f('0x13'),_0x5be39d,_0x33a49d['error'][_0x9d7f('0x15')]);return _0x3ca332(_0x33a49d[_0x9d7f('0x14')][_0x9d7f('0x15')]);}else{logger['info'](_0x9d7f('0x13'),_0x5be39d,'request\x20sent');_0x3ca332(_0x33a49d[_0x9d7f('0x16')][_0x9d7f('0x15')]);}})[_0x9d7f('0x17')](function(_0xa9850a){logger['error'](_0x9d7f('0x13'),_0x5be39d,_0xa9850a);_0xd99a98(_0xa9850a);});});}
\ No newline at end of file
+var _0xd891=['then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','code','message','error','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x36778e,_0x5bf161){var _0x5bb467=function(_0x407528){while(--_0x407528){_0x36778e['push'](_0x36778e['shift']());}};_0x5bb467(++_0x5bf161);}(_0xd891,0x137));var _0x1d89=function(_0x4409a4,_0x3716f8){_0x4409a4=_0x4409a4-0x0;var _0x23b44c=_0xd891[_0x4409a4];return _0x23b44c;};'use strict';var _=require(_0x1d89('0x0'));var util=require(_0x1d89('0x1'));var moment=require('moment');var BPromise=require(_0x1d89('0x2'));var rs=require(_0x1d89('0x3'));var fs=require('fs');var Redis=require(_0x1d89('0x4'));var db=require(_0x1d89('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1d89('0x6'))('rpc');var config=require(_0x1d89('0x7'));var jayson=require(_0x1d89('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fd494,_0x5b9592,_0x50ef93){return new BPromise(function(_0x2a2301,_0x3a4860){return client['request'](_0x3fd494,_0x50ef93)[_0x1d89('0x9')](function(_0x3ceadf){logger['info'](_0x1d89('0xa'),_0x5b9592,_0x1d89('0xb'));logger[_0x1d89('0xc')](_0x1d89('0xd'),_0x5b9592,_0x1d89('0xb'),JSON['stringify'](_0x3ceadf));if(_0x3ceadf['error']){if(_0x3ceadf['error'][_0x1d89('0xe')]===0x1f4){logger['error'](_0x1d89('0xa'),_0x5b9592,_0x3ceadf['error'][_0x1d89('0xf')]);return _0x3a4860(_0x3ceadf[_0x1d89('0x10')][_0x1d89('0xf')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x5b9592,_0x3ceadf['error']['message']);return _0x2a2301(_0x3ceadf['error'][_0x1d89('0xf')]);}else{logger[_0x1d89('0x11')](_0x1d89('0xa'),_0x5b9592,'request\x20sent');_0x2a2301(_0x3ceadf[_0x1d89('0x12')][_0x1d89('0xf')]);}})[_0x1d89('0x13')](function(_0x1e80e5){logger[_0x1d89('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x5b9592,_0x1e80e5);_0x3a4860(_0x1e80e5);});});}
\ No newline at end of file
index b4f04ea..838a4fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3afd=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x482e1b,_0x4eb5b5){var _0x87caaa=function(_0x299623){while(--_0x299623){_0x482e1b['push'](_0x482e1b['shift']());}};_0x87caaa(++_0x4eb5b5);}(_0x3afd,0xaf));var _0xd3af=function(_0x547ff4,_0x416fa1){_0x547ff4=_0x547ff4-0x0;var _0xe41057=_0x3afd[_0x547ff4];return _0xe41057;};'use strict';var multer=require(_0xd3af('0x0'));var util=require(_0xd3af('0x1'));var path=require(_0xd3af('0x2'));var timeout=require(_0xd3af('0x3'));var express=require(_0xd3af('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd3af('0x5'));var interaction=require(_0xd3af('0x6'));var config=require(_0xd3af('0x7'));var controller=require('./mailTransferReport.controller');router[_0xd3af('0x8')]('/',auth['isAuthenticated'](),controller[_0xd3af('0x9')]);router[_0xd3af('0x8')](_0xd3af('0xa'),auth[_0xd3af('0xb')](),controller['describe']);router[_0xd3af('0x8')](_0xd3af('0xc'),auth['isAuthenticated'](),controller[_0xd3af('0xd')]);router[_0xd3af('0xe')]('/',auth['isAuthenticated'](),controller[_0xd3af('0xf')]);router['put'](_0xd3af('0xc'),auth[_0xd3af('0xb')](),controller['update']);router[_0xd3af('0x10')](_0xd3af('0xc'),auth[_0xd3af('0xb')](),controller[_0xd3af('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x97c4=['describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x97c4,0x1c1));var _0x497c=function(_0xcb1b7c,_0x146579){_0xcb1b7c=_0xcb1b7c-0x0;var _0x4daf31=_0x97c4[_0xcb1b7c];return _0x4daf31;};'use strict';var multer=require(_0x497c('0x0'));var util=require('util');var path=require(_0x497c('0x1'));var timeout=require(_0x497c('0x2'));var express=require(_0x497c('0x3'));var router=express[_0x497c('0x4')]();var fs_extra=require(_0x497c('0x5'));var auth=require(_0x497c('0x6'));var interaction=require(_0x497c('0x7'));var config=require(_0x497c('0x8'));var controller=require('./mailTransferReport.controller');router[_0x497c('0x9')]('/',auth['isAuthenticated'](),controller[_0x497c('0xa')]);router[_0x497c('0x9')](_0x497c('0xb'),auth[_0x497c('0xc')](),controller[_0x497c('0xd')]);router['get'](_0x497c('0xe'),auth['isAuthenticated'](),controller[_0x497c('0xf')]);router[_0x497c('0x10')]('/',auth[_0x497c('0xc')](),controller[_0x497c('0x11')]);router['put'](_0x497c('0xe'),auth['isAuthenticated'](),controller[_0x497c('0x12')]);router[_0x497c('0x13')](_0x497c('0xe'),auth['isAuthenticated'](),controller[_0x497c('0x14')]);module[_0x497c('0x15')]=router;
\ No newline at end of file
index 04aa966..0a7b68c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x48c4ef,_0x319d44){var _0x435715=function(_0x925d50){while(--_0x925d50){_0x48c4ef['push'](_0x48c4ef['shift']());}};_0x435715(++_0x319d44);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1b38b8,_0x530c8c){_0x1b38b8=_0x1b38b8-0x0;var _0x3a6092=_0xb43b[_0x1b38b8];return _0x3a6092;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x764874,_0x3ed544){var _0x29f9d5=function(_0x152dad){while(--_0x152dad){_0x764874['push'](_0x764874['shift']());}};_0x29f9d5(++_0x3ed544);}(_0x34e8,0x12c));var _0x834e=function(_0x1f5f8a,_0x33f8f5){_0x1f5f8a=_0x1f5f8a-0x0;var _0xfe8f51=_0x34e8[_0x1f5f8a];return _0xfe8f51;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
index 60d630b..05d9250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d78=['rows','catch','length','includeAll','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','name','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','options','include','findAll'];(function(_0x48e4a4,_0x120886){var _0x2c7b56=function(_0x1d5ea6){while(--_0x1d5ea6){_0x48e4a4['push'](_0x48e4a4['shift']());}};_0x2c7b56(++_0x120886);}(_0x3d78,0x1a1));var _0x83d7=function(_0x5a6489,_0x1b27a8){_0x5a6489=_0x5a6489-0x0;var _0x4d2d7e=_0x3d78[_0x5a6489];return _0x4d2d7e;};'use strict';var emlformat=require(_0x83d7('0x0'));var rimraf=require(_0x83d7('0x1'));var zipdir=require(_0x83d7('0x2'));var jsonpatch=require(_0x83d7('0x3'));var rp=require(_0x83d7('0x4'));var moment=require(_0x83d7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x83d7('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x83d7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x83d7('0x8'));var squel=require('squel');var crypto=require(_0x83d7('0x9'));var jsforce=require(_0x83d7('0xa'));var deskjs=require(_0x83d7('0xb'));var toCsv=require(_0x83d7('0x7'));var querystring=require(_0x83d7('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x83d7('0xd'));var qs=require(_0x83d7('0xe'));var as=require(_0x83d7('0xf'));var hardwareService=require(_0x83d7('0x10'));var logger=require('../../config/logger')(_0x83d7('0x11'));var utils=require(_0x83d7('0x12'));var config=require(_0x83d7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x83d7('0x14'))['db'];function respondWithStatusCode(_0x54fde1,_0x3436ce){_0x3436ce=_0x3436ce||0xcc;return function(_0x3daf65){if(_0x3daf65){return _0x54fde1[_0x83d7('0x15')](_0x3436ce);}return _0x54fde1[_0x83d7('0x16')](_0x3436ce)[_0x83d7('0x17')]();};}function respondWithResult(_0x288bfc,_0x3c0675){_0x3c0675=_0x3c0675||0xc8;return function(_0x1f52c9){if(_0x1f52c9){return _0x288bfc['status'](_0x3c0675)['json'](_0x1f52c9);}};}function respondWithFilteredResult(_0x20a5ed,_0x341741){return function(_0x25635e){if(_0x25635e){var _0x451a6b=typeof _0x341741[_0x83d7('0x18')]===_0x83d7('0x19')&&typeof _0x341741[_0x83d7('0x1a')]===_0x83d7('0x19');var _0x1a1046=_0x25635e[_0x83d7('0x1b')];var _0x3545cd=_0x451a6b?0x0:_0x341741[_0x83d7('0x18')];var _0x4da391=_0x451a6b?_0x25635e[_0x83d7('0x1b')]:_0x341741['offset']+_0x341741[_0x83d7('0x1a')];var _0x20bb9e;if(_0x4da391>=_0x1a1046){_0x4da391=_0x1a1046;_0x20bb9e=0xc8;}else{_0x20bb9e=0xce;}_0x20a5ed['status'](_0x20bb9e);return _0x20a5ed['set'](_0x83d7('0x1c'),_0x3545cd+'-'+_0x4da391+'/'+_0x1a1046)['json'](_0x25635e);}return null;};}function patchUpdates(_0xc11ed2){return function(_0x45eca5){try{jsonpatch[_0x83d7('0x1d')](_0x45eca5,_0xc11ed2,!![]);}catch(_0x197de9){return BPromise[_0x83d7('0x1e')](_0x197de9);}return _0x45eca5[_0x83d7('0x1f')]();};}function saveUpdates(_0x3930c9,_0x1f0ea5){return function(_0x5544e7){if(_0x5544e7){return _0x5544e7[_0x83d7('0x20')](_0x3930c9)[_0x83d7('0x21')](function(_0x2d1ceb){return _0x2d1ceb;});}return null;};}function removeEntity(_0xca5fd8,_0x516a71){return function(_0x23e798){if(_0x23e798){return _0x23e798['destroy']()[_0x83d7('0x21')](function(){_0xca5fd8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc6d4d5,_0x48feef){return function(_0x260923){if(!_0x260923){_0xc6d4d5['sendStatus'](0x194);}return _0x260923;};}function handleError(_0x1c12cd,_0x5e087a){_0x5e087a=_0x5e087a||0x1f4;return function(_0x19668b){logger['error'](_0x19668b['stack']);if(_0x19668b[_0x83d7('0x22')]){delete _0x19668b['name'];}_0x1c12cd[_0x83d7('0x16')](_0x5e087a)['send'](_0x19668b);};}exports['index']=function(_0x14c959,_0x5e82b5){var _0x10ba7e={},_0x2a23f8={},_0x2cf2fd={'count':0x0,'rows':[]};var _0x301a1c=_[_0x83d7('0x23')](db[_0x83d7('0x24')][_0x83d7('0x25')],function(_0x466d01){return{'name':_0x466d01[_0x83d7('0x26')],'type':_0x466d01[_0x83d7('0x27')][_0x83d7('0x28')]};});_0x2a23f8['model']=_['map'](_0x301a1c,_0x83d7('0x22'));_0x2a23f8[_0x83d7('0x29')]=_[_0x83d7('0x2a')](_0x14c959[_0x83d7('0x29')]);_0x2a23f8['filters']=_[_0x83d7('0x2b')](_0x2a23f8['model'],_0x2a23f8[_0x83d7('0x29')]);_0x10ba7e['attributes']=_[_0x83d7('0x2b')](_0x2a23f8[_0x83d7('0x2c')],qs[_0x83d7('0x2d')](_0x14c959[_0x83d7('0x29')]['fields']));_0x10ba7e[_0x83d7('0x2e')]=_0x10ba7e['attributes']['length']?_0x10ba7e[_0x83d7('0x2e')]:_0x2a23f8['model'];if(!_0x14c959[_0x83d7('0x29')][_0x83d7('0x2f')](_0x83d7('0x30'))){_0x10ba7e[_0x83d7('0x1a')]=qs['limit'](_0x14c959['query'][_0x83d7('0x1a')]);_0x10ba7e[_0x83d7('0x18')]=qs[_0x83d7('0x18')](_0x14c959[_0x83d7('0x29')][_0x83d7('0x18')]);}_0x10ba7e[_0x83d7('0x31')]=qs[_0x83d7('0x32')](_0x14c959[_0x83d7('0x29')][_0x83d7('0x32')]);_0x10ba7e['where']=qs['filters'](_[_0x83d7('0x33')](_0x14c959[_0x83d7('0x29')],_0x2a23f8[_0x83d7('0x34')]),_0x301a1c);if(_0x14c959[_0x83d7('0x29')][_0x83d7('0x35')]){_0x10ba7e[_0x83d7('0x36')]=_['merge'](_0x10ba7e[_0x83d7('0x36')],{'$or':_[_0x83d7('0x23')](_0x301a1c,function(_0x398dc5){if(_0x398dc5[_0x83d7('0x27')]!=='VIRTUAL'){var _0x5b00e1={};_0x5b00e1[_0x398dc5[_0x83d7('0x22')]]={'$like':'%'+_0x14c959[_0x83d7('0x29')]['filter']+'%'};return _0x5b00e1;}})});}_0x10ba7e=_[_0x83d7('0x37')]({},_0x10ba7e,_0x14c959[_0x83d7('0x38')]);var _0x4d9128={'where':_0x10ba7e[_0x83d7('0x36')]};return db[_0x83d7('0x24')][_0x83d7('0x1b')](_0x4d9128)[_0x83d7('0x21')](function(_0x48b38){_0x2cf2fd[_0x83d7('0x1b')]=_0x48b38;if(_0x14c959[_0x83d7('0x29')]['includeAll']){_0x10ba7e[_0x83d7('0x39')]=[{'all':!![]}];}return db[_0x83d7('0x24')][_0x83d7('0x3a')](_0x10ba7e);})['then'](function(_0x1070f6){_0x2cf2fd[_0x83d7('0x3b')]=_0x1070f6;return _0x2cf2fd;})[_0x83d7('0x21')](respondWithFilteredResult(_0x5e82b5,_0x10ba7e))[_0x83d7('0x3c')](handleError(_0x5e82b5,null));};exports['show']=function(_0x9f45df,_0x3702f6){var _0x168272={'raw':!![],'where':{'id':_0x9f45df['params']['id']}},_0x37f80c={};_0x37f80c['model']=_[_0x83d7('0x2a')](db[_0x83d7('0x24')][_0x83d7('0x25')]);_0x37f80c['query']=_['keys'](_0x9f45df[_0x83d7('0x29')]);_0x37f80c['filters']=_[_0x83d7('0x2b')](_0x37f80c['model'],_0x37f80c['query']);_0x168272['attributes']=_[_0x83d7('0x2b')](_0x37f80c[_0x83d7('0x2c')],qs['fields'](_0x9f45df[_0x83d7('0x29')][_0x83d7('0x2d')]));_0x168272[_0x83d7('0x2e')]=_0x168272[_0x83d7('0x2e')][_0x83d7('0x3d')]?_0x168272[_0x83d7('0x2e')]:_0x37f80c['model'];if(_0x9f45df[_0x83d7('0x29')][_0x83d7('0x3e')]){_0x168272[_0x83d7('0x39')]=[{'all':!![]}];}_0x168272=_['merge']({},_0x168272,_0x9f45df[_0x83d7('0x38')]);return db[_0x83d7('0x24')][_0x83d7('0x3f')](_0x168272)[_0x83d7('0x21')](handleEntityNotFound(_0x3702f6,null))[_0x83d7('0x21')](respondWithResult(_0x3702f6,null))[_0x83d7('0x3c')](handleError(_0x3702f6,null));};exports[_0x83d7('0x40')]=function(_0x362d89,_0x4a6ff8){return db[_0x83d7('0x24')]['create'](_0x362d89['body'],{})[_0x83d7('0x21')](respondWithResult(_0x4a6ff8,0xc9))[_0x83d7('0x3c')](handleError(_0x4a6ff8,null));};exports['update']=function(_0x46dcd5,_0x56d981){if(_0x46dcd5[_0x83d7('0x41')]['id']){delete _0x46dcd5[_0x83d7('0x41')]['id'];}return db[_0x83d7('0x24')][_0x83d7('0x3f')]({'where':{'id':_0x46dcd5[_0x83d7('0x42')]['id']}})[_0x83d7('0x21')](handleEntityNotFound(_0x56d981,null))['then'](saveUpdates(_0x46dcd5['body'],null))['then'](respondWithResult(_0x56d981,null))['catch'](handleError(_0x56d981,null));};exports['destroy']=function(_0x4d4cbb,_0x14c0cf){return db[_0x83d7('0x24')]['find']({'where':{'id':_0x4d4cbb['params']['id']}})[_0x83d7('0x21')](handleEntityNotFound(_0x14c0cf,null))[_0x83d7('0x21')](removeEntity(_0x14c0cf,null))['catch'](handleError(_0x14c0cf,null));};exports[_0x83d7('0x43')]=function(_0x478132,_0x3abba4){return db['MailTransferReport'][_0x83d7('0x43')]()[_0x83d7('0x21')](respondWithResult(_0x3abba4,null))[_0x83d7('0x3c')](handleError(_0x3abba4,null));};
\ No newline at end of file
+var _0xb1f7=['request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','include','MailTransferReport','rows','params','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch'];(function(_0x45e60e,_0x529bef){var _0x5717a5=function(_0x38d070){while(--_0x38d070){_0x45e60e['push'](_0x45e60e['shift']());}};_0x5717a5(++_0x529bef);}(_0xb1f7,0x1a7));var _0x7b1f=function(_0x3ca7fa,_0x4ef545){_0x3ca7fa=_0x3ca7fa-0x0;var _0x2df1be=_0xb1f7[_0x3ca7fa];return _0x2df1be;};'use strict';var emlformat=require(_0x7b1f('0x0'));var rimraf=require(_0x7b1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b1f('0x2'));var rp=require(_0x7b1f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b1f('0x4'));var util=require(_0x7b1f('0x5'));var path=require(_0x7b1f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b1f('0x7'));var fs=require('fs');var fs_extra=require(_0x7b1f('0x8'));var _=require(_0x7b1f('0x9'));var squel=require(_0x7b1f('0xa'));var crypto=require(_0x7b1f('0xb'));var jsforce=require(_0x7b1f('0xc'));var deskjs=require(_0x7b1f('0xd'));var toCsv=require(_0x7b1f('0xe'));var querystring=require(_0x7b1f('0xf'));var Papa=require(_0x7b1f('0x10'));var Redis=require(_0x7b1f('0x11'));var authService=require(_0x7b1f('0x12'));var qs=require(_0x7b1f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7b1f('0x14'));var logger=require('../../config/logger')(_0x7b1f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b1f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x520f0a,_0x268a9c){_0x268a9c=_0x268a9c||0xcc;return function(_0x12f661){if(_0x12f661){return _0x520f0a['sendStatus'](_0x268a9c);}return _0x520f0a[_0x7b1f('0x17')](_0x268a9c)[_0x7b1f('0x18')]();};}function respondWithResult(_0x1a08ac,_0x23c3ea){_0x23c3ea=_0x23c3ea||0xc8;return function(_0x3222e8){if(_0x3222e8){return _0x1a08ac[_0x7b1f('0x17')](_0x23c3ea)[_0x7b1f('0x19')](_0x3222e8);}};}function respondWithFilteredResult(_0x104804,_0x134b7a){return function(_0x22f372){if(_0x22f372){var _0x3ab107=typeof _0x134b7a[_0x7b1f('0x1a')]===_0x7b1f('0x1b')&&typeof _0x134b7a[_0x7b1f('0x1c')]===_0x7b1f('0x1b');var _0x587075=_0x22f372[_0x7b1f('0x1d')];var _0x36b32c=_0x3ab107?0x0:_0x134b7a['offset'];var _0x20a802=_0x3ab107?_0x22f372[_0x7b1f('0x1d')]:_0x134b7a['offset']+_0x134b7a[_0x7b1f('0x1c')];var _0x221c9b;if(_0x20a802>=_0x587075){_0x20a802=_0x587075;_0x221c9b=0xc8;}else{_0x221c9b=0xce;}_0x104804[_0x7b1f('0x17')](_0x221c9b);return _0x104804['set'](_0x7b1f('0x1e'),_0x36b32c+'-'+_0x20a802+'/'+_0x587075)[_0x7b1f('0x19')](_0x22f372);}return null;};}function patchUpdates(_0x2b75bc){return function(_0x988b98){try{jsonpatch['apply'](_0x988b98,_0x2b75bc,!![]);}catch(_0xd4aa5b){return BPromise[_0x7b1f('0x1f')](_0xd4aa5b);}return _0x988b98[_0x7b1f('0x20')]();};}function saveUpdates(_0x42f5c5,_0x2e65c9){return function(_0x2d2651){if(_0x2d2651){return _0x2d2651[_0x7b1f('0x21')](_0x42f5c5)[_0x7b1f('0x22')](function(_0x540924){return _0x540924;});}return null;};}function removeEntity(_0x4bd490,_0x2928cc){return function(_0x53c002){if(_0x53c002){return _0x53c002[_0x7b1f('0x23')]()[_0x7b1f('0x22')](function(){_0x4bd490[_0x7b1f('0x17')](0xcc)[_0x7b1f('0x18')]();});}};}function handleEntityNotFound(_0x159930,_0x1cf481){return function(_0x5a5fba){if(!_0x5a5fba){_0x159930[_0x7b1f('0x24')](0x194);}return _0x5a5fba;};}function handleError(_0xd39529,_0x21bcd9){_0x21bcd9=_0x21bcd9||0x1f4;return function(_0xf26afc){logger[_0x7b1f('0x25')](_0xf26afc[_0x7b1f('0x26')]);if(_0xf26afc['name']){delete _0xf26afc[_0x7b1f('0x27')];}_0xd39529['status'](_0x21bcd9)[_0x7b1f('0x28')](_0xf26afc);};}exports['index']=function(_0x4b1382,_0x24c439){var _0x38ab44={},_0x4454b6={},_0x250e51={'count':0x0,'rows':[]};var _0xd94031=_[_0x7b1f('0x29')](db['MailTransferReport'][_0x7b1f('0x2a')],function(_0xffbc74){return{'name':_0xffbc74[_0x7b1f('0x2b')],'type':_0xffbc74[_0x7b1f('0x2c')]['key']};});_0x4454b6[_0x7b1f('0x2d')]=_[_0x7b1f('0x29')](_0xd94031,_0x7b1f('0x27'));_0x4454b6['query']=_[_0x7b1f('0x2e')](_0x4b1382[_0x7b1f('0x2f')]);_0x4454b6['filters']=_[_0x7b1f('0x30')](_0x4454b6[_0x7b1f('0x2d')],_0x4454b6[_0x7b1f('0x2f')]);_0x38ab44['attributes']=_[_0x7b1f('0x30')](_0x4454b6[_0x7b1f('0x2d')],qs[_0x7b1f('0x31')](_0x4b1382['query']['fields']));_0x38ab44[_0x7b1f('0x32')]=_0x38ab44[_0x7b1f('0x32')][_0x7b1f('0x33')]?_0x38ab44[_0x7b1f('0x32')]:_0x4454b6[_0x7b1f('0x2d')];if(!_0x4b1382[_0x7b1f('0x2f')][_0x7b1f('0x34')](_0x7b1f('0x35'))){_0x38ab44[_0x7b1f('0x1c')]=qs['limit'](_0x4b1382[_0x7b1f('0x2f')][_0x7b1f('0x1c')]);_0x38ab44[_0x7b1f('0x1a')]=qs['offset'](_0x4b1382['query'][_0x7b1f('0x1a')]);}_0x38ab44['order']=qs[_0x7b1f('0x36')](_0x4b1382['query']['sort']);_0x38ab44[_0x7b1f('0x37')]=qs[_0x7b1f('0x38')](_[_0x7b1f('0x39')](_0x4b1382['query'],_0x4454b6[_0x7b1f('0x38')]),_0xd94031);if(_0x4b1382[_0x7b1f('0x2f')]['filter']){_0x38ab44[_0x7b1f('0x37')]=_['merge'](_0x38ab44[_0x7b1f('0x37')],{'$or':_[_0x7b1f('0x29')](_0xd94031,function(_0x3464f8){if(_0x3464f8[_0x7b1f('0x2c')]!==_0x7b1f('0x3a')){var _0x149859={};_0x149859[_0x3464f8[_0x7b1f('0x27')]]={'$like':'%'+_0x4b1382[_0x7b1f('0x2f')][_0x7b1f('0x3b')]+'%'};return _0x149859;}})});}_0x38ab44=_[_0x7b1f('0x3c')]({},_0x38ab44,_0x4b1382[_0x7b1f('0x3d')]);var _0x3c9b79={'where':_0x38ab44[_0x7b1f('0x37')]};return db['MailTransferReport'][_0x7b1f('0x1d')](_0x3c9b79)['then'](function(_0x301d75){_0x250e51[_0x7b1f('0x1d')]=_0x301d75;if(_0x4b1382['query']['includeAll']){_0x38ab44[_0x7b1f('0x3e')]=[{'all':!![]}];}return db[_0x7b1f('0x3f')]['findAll'](_0x38ab44);})[_0x7b1f('0x22')](function(_0x46ead7){_0x250e51[_0x7b1f('0x40')]=_0x46ead7;return _0x250e51;})[_0x7b1f('0x22')](respondWithFilteredResult(_0x24c439,_0x38ab44))['catch'](handleError(_0x24c439,null));};exports['show']=function(_0x4b9db9,_0x55668c){var _0x188934={'raw':!![],'where':{'id':_0x4b9db9[_0x7b1f('0x41')]['id']}},_0x1c729d={};_0x1c729d[_0x7b1f('0x2d')]=_['keys'](db[_0x7b1f('0x3f')][_0x7b1f('0x2a')]);_0x1c729d[_0x7b1f('0x2f')]=_['keys'](_0x4b9db9['query']);_0x1c729d[_0x7b1f('0x38')]=_[_0x7b1f('0x30')](_0x1c729d[_0x7b1f('0x2d')],_0x1c729d[_0x7b1f('0x2f')]);_0x188934[_0x7b1f('0x32')]=_[_0x7b1f('0x30')](_0x1c729d[_0x7b1f('0x2d')],qs[_0x7b1f('0x31')](_0x4b9db9[_0x7b1f('0x2f')][_0x7b1f('0x31')]));_0x188934['attributes']=_0x188934[_0x7b1f('0x32')][_0x7b1f('0x33')]?_0x188934[_0x7b1f('0x32')]:_0x1c729d[_0x7b1f('0x2d')];if(_0x4b9db9['query']['includeAll']){_0x188934[_0x7b1f('0x3e')]=[{'all':!![]}];}_0x188934=_[_0x7b1f('0x3c')]({},_0x188934,_0x4b9db9[_0x7b1f('0x3d')]);return db[_0x7b1f('0x3f')][_0x7b1f('0x42')](_0x188934)[_0x7b1f('0x22')](handleEntityNotFound(_0x55668c,null))['then'](respondWithResult(_0x55668c,null))[_0x7b1f('0x43')](handleError(_0x55668c,null));};exports[_0x7b1f('0x44')]=function(_0x16939c,_0x4452bb){return db['MailTransferReport']['create'](_0x16939c[_0x7b1f('0x45')],{})[_0x7b1f('0x22')](respondWithResult(_0x4452bb,0xc9))[_0x7b1f('0x43')](handleError(_0x4452bb,null));};exports[_0x7b1f('0x21')]=function(_0x5bb7fa,_0x343281){if(_0x5bb7fa['body']['id']){delete _0x5bb7fa[_0x7b1f('0x45')]['id'];}return db[_0x7b1f('0x3f')]['find']({'where':{'id':_0x5bb7fa[_0x7b1f('0x41')]['id']}})[_0x7b1f('0x22')](handleEntityNotFound(_0x343281,null))[_0x7b1f('0x22')](saveUpdates(_0x5bb7fa[_0x7b1f('0x45')],null))[_0x7b1f('0x22')](respondWithResult(_0x343281,null))[_0x7b1f('0x43')](handleError(_0x343281,null));};exports[_0x7b1f('0x23')]=function(_0x780eb0,_0x1c19a2){return db[_0x7b1f('0x3f')][_0x7b1f('0x42')]({'where':{'id':_0x780eb0[_0x7b1f('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c19a2,null))[_0x7b1f('0x22')](removeEntity(_0x1c19a2,null))[_0x7b1f('0x43')](handleError(_0x1c19a2,null));};exports['describe']=function(_0x4bf55c,_0x5954bd){return db[_0x7b1f('0x3f')][_0x7b1f('0x46')]()[_0x7b1f('0x22')](respondWithResult(_0x5954bd,null))[_0x7b1f('0x43')](handleError(_0x5954bd,null));};
\ No newline at end of file
index d89be01..8a9c0b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc3=['moment','bluebird','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','MailTransferReport','report_mail_transfer','lodash','../../config/logger'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x8bc3,0x82));var _0x38bc=function(_0x52121e,_0x4e7ac8){_0x52121e=_0x52121e-0x0;var _0x2d7778=_0x8bc3[_0x52121e];return _0x2d7778;};'use strict';var _=require(_0x38bc('0x0'));var util=require('util');var logger=require(_0x38bc('0x1'))('api');var moment=require(_0x38bc('0x2'));var BPromise=require(_0x38bc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38bc('0x4'));var rimraf=require(_0x38bc('0x5'));var config=require(_0x38bc('0x6'));var attributes=require(_0x38bc('0x7'));module['exports']=function(_0x29ac4e,_0x2165ed){return _0x29ac4e[_0x38bc('0x8')](_0x38bc('0x9'),attributes,{'tableName':_0x38bc('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x097c=['bluebird','request-promise','path','../../config/environment','exports','define','report_mail_transfer','lodash','util','../../config/logger','moment'];(function(_0x537200,_0x3b581e){var _0x58ac7c=function(_0x557526){while(--_0x557526){_0x537200['push'](_0x537200['shift']());}};_0x58ac7c(++_0x3b581e);}(_0x097c,0x1d5));var _0xc097=function(_0x2ffe02,_0x289098){_0x2ffe02=_0x2ffe02-0x0;var _0x52f0a=_0x097c[_0x2ffe02];return _0x52f0a;};'use strict';var _=require(_0xc097('0x0'));var util=require(_0xc097('0x1'));var logger=require(_0xc097('0x2'))('api');var moment=require(_0xc097('0x3'));var BPromise=require(_0xc097('0x4'));var rp=require(_0xc097('0x5'));var fs=require('fs');var path=require(_0xc097('0x6'));var rimraf=require('rimraf');var config=require(_0xc097('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0xc097('0x8')]=function(_0x3c9603,_0x31bc9a){return _0x3c9603[_0xc097('0x9')]('MailTransferReport',attributes,{'tableName':_0xc097('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 246a5aa..21cb830 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9976=['result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x478292,_0x3a704c){var _0x529df6=function(_0x1dcd2c){while(--_0x1dcd2c){_0x478292['push'](_0x478292['shift']());}};_0x529df6(++_0x3a704c);}(_0x9976,0x113));var _0x6997=function(_0x28bc9c,_0x5b21a8){_0x28bc9c=_0x28bc9c-0x0;var _0x1c0362=_0x9976[_0x28bc9c];return _0x1c0362;};'use strict';var _=require('lodash');var util=require(_0x6997('0x0'));var moment=require(_0x6997('0x1'));var BPromise=require('bluebird');var rs=require(_0x6997('0x2'));var fs=require('fs');var Redis=require(_0x6997('0x3'));var db=require(_0x6997('0x4'))['db'];var utils=require(_0x6997('0x5'));var logger=require(_0x6997('0x6'))(_0x6997('0x7'));var config=require('../../config/environment');var jayson=require(_0x6997('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4329a6,_0x4f5699,_0x1daef7){return new BPromise(function(_0x20817b,_0x4d94cd){return client['request'](_0x4329a6,_0x1daef7)[_0x6997('0x9')](function(_0x5baefb){logger[_0x6997('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x4f5699,'request\x20sent');logger[_0x6997('0xb')](_0x6997('0xc'),_0x4f5699,_0x6997('0xd'),JSON[_0x6997('0xe')](_0x5baefb));if(_0x5baefb[_0x6997('0xf')]){if(_0x5baefb[_0x6997('0xf')][_0x6997('0x10')]===0x1f4){logger[_0x6997('0xf')](_0x6997('0x11'),_0x4f5699,_0x5baefb[_0x6997('0xf')]['message']);return _0x4d94cd(_0x5baefb[_0x6997('0xf')][_0x6997('0x12')]);}logger['error'](_0x6997('0x11'),_0x4f5699,_0x5baefb['error']['message']);return _0x20817b(_0x5baefb[_0x6997('0xf')]['message']);}else{logger[_0x6997('0xa')](_0x6997('0x11'),_0x4f5699,_0x6997('0xd'));_0x20817b(_0x5baefb[_0x6997('0x13')][_0x6997('0x12')]);}})[_0x6997('0x14')](function(_0x2823e7){logger[_0x6997('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4f5699,_0x2823e7);_0x4d94cd(_0x2823e7);});});}
\ No newline at end of file
+var _0x3e6d=['../../config/logger','../../config/environment','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x40eabd,_0x174cff){var _0x3f8769=function(_0x4a7e52){while(--_0x4a7e52){_0x40eabd['push'](_0x40eabd['shift']());}};_0x3f8769(++_0x174cff);}(_0x3e6d,0x118));var _0xd3e6=function(_0x4d1116,_0x57b254){_0x4d1116=_0x4d1116-0x0;var _0x410a04=_0x3e6d[_0x4d1116];return _0x410a04;};'use strict';var _=require(_0xd3e6('0x0'));var util=require(_0xd3e6('0x1'));var moment=require(_0xd3e6('0x2'));var BPromise=require(_0xd3e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3e6('0x4'))['db'];var utils=require(_0xd3e6('0x5'));var logger=require(_0xd3e6('0x6'))('rpc');var config=require(_0xd3e6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd3e6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x31b2e5,_0x3dfdd,_0x2c25e1){return new BPromise(function(_0x5351d3,_0x2cd9d9){return client[_0xd3e6('0x9')](_0x31b2e5,_0x2c25e1)[_0xd3e6('0xa')](function(_0x4ff887){logger[_0xd3e6('0xb')](_0xd3e6('0xc'),_0x3dfdd,_0xd3e6('0xd'));logger[_0xd3e6('0xe')](_0xd3e6('0xf'),_0x3dfdd,_0xd3e6('0xd'),JSON[_0xd3e6('0x10')](_0x4ff887));if(_0x4ff887[_0xd3e6('0x11')]){if(_0x4ff887[_0xd3e6('0x11')][_0xd3e6('0x12')]===0x1f4){logger[_0xd3e6('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x3dfdd,_0x4ff887['error'][_0xd3e6('0x13')]);return _0x2cd9d9(_0x4ff887[_0xd3e6('0x11')]['message']);}logger[_0xd3e6('0x11')](_0xd3e6('0xc'),_0x3dfdd,_0x4ff887[_0xd3e6('0x11')]['message']);return _0x5351d3(_0x4ff887[_0xd3e6('0x11')][_0xd3e6('0x13')]);}else{logger[_0xd3e6('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x3dfdd,_0xd3e6('0xd'));_0x5351d3(_0x4ff887[_0xd3e6('0x14')]['message']);}})[_0xd3e6('0x15')](function(_0x2c82d7){logger['error'](_0xd3e6('0xc'),_0x3dfdd,_0x2c82d7);_0x2cd9d9(_0x2c82d7);});});}
\ No newline at end of file
index f3c8c1a..0a934a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99f6=['put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','isAuthenticated','show','post','create'];(function(_0x75869c,_0x247afc){var _0x4b2bba=function(_0x2b58a8){while(--_0x2b58a8){_0x75869c['push'](_0x75869c['shift']());}};_0x4b2bba(++_0x247afc);}(_0x99f6,0x194));var _0x699f=function(_0x32cce8,_0x18762f){_0x32cce8=_0x32cce8-0x0;var _0x4a732b=_0x99f6[_0x32cce8];return _0x4a732b;};'use strict';var multer=require(_0x699f('0x0'));var util=require(_0x699f('0x1'));var path=require(_0x699f('0x2'));var timeout=require(_0x699f('0x3'));var express=require(_0x699f('0x4'));var router=express['Router']();var fs_extra=require(_0x699f('0x5'));var auth=require(_0x699f('0x6'));var interaction=require(_0x699f('0x7'));var config=require(_0x699f('0x8'));var controller=require(_0x699f('0x9'));router[_0x699f('0xa')]('/',auth['isAuthenticated'](),controller[_0x699f('0xb')]);router[_0x699f('0xa')]('/describe',auth[_0x699f('0xc')](),controller['describe']);router[_0x699f('0xa')]('/:id',auth[_0x699f('0xc')](),controller[_0x699f('0xd')]);router[_0x699f('0xe')]('/',auth['isAuthenticated'](),controller[_0x699f('0xf')]);router[_0x699f('0x10')](_0x699f('0x11'),auth[_0x699f('0xc')](),controller[_0x699f('0x12')]);router['delete'](_0x699f('0x11'),auth[_0x699f('0xc')](),controller[_0x699f('0x13')]);module[_0x699f('0x14')]=router;
\ No newline at end of file
+var _0xf50a=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete'];(function(_0x52de6d,_0x13b709){var _0x2bc1ee=function(_0x4cb8e7){while(--_0x4cb8e7){_0x52de6d['push'](_0x52de6d['shift']());}};_0x2bc1ee(++_0x13b709);}(_0xf50a,0x16a));var _0xaf50=function(_0x40e854,_0x42f1f6){_0x40e854=_0x40e854-0x0;var _0x1463b3=_0xf50a[_0x40e854];return _0x1463b3;};'use strict';var multer=require(_0xaf50('0x0'));var util=require(_0xaf50('0x1'));var path=require(_0xaf50('0x2'));var timeout=require(_0xaf50('0x3'));var express=require('express');var router=express[_0xaf50('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf50('0x5'));var interaction=require(_0xaf50('0x6'));var config=require(_0xaf50('0x7'));var controller=require(_0xaf50('0x8'));router[_0xaf50('0x9')]('/',auth[_0xaf50('0xa')](),controller[_0xaf50('0xb')]);router[_0xaf50('0x9')]('/describe',auth[_0xaf50('0xa')](),controller['describe']);router[_0xaf50('0x9')](_0xaf50('0xc'),auth[_0xaf50('0xa')](),controller[_0xaf50('0xd')]);router['post']('/',auth[_0xaf50('0xa')](),controller[_0xaf50('0xe')]);router[_0xaf50('0xf')](_0xaf50('0xc'),auth[_0xaf50('0xa')](),controller[_0xaf50('0x10')]);router[_0xaf50('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xaf50('0x12')]);module[_0xaf50('0x13')]=router;
\ No newline at end of file
index beb4142..4095e29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe46b=['talk:[start]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration'];(function(_0x8f0b9b,_0x4a8681){var _0x5ce8bb=function(_0x2df705){while(--_0x2df705){_0x8f0b9b['push'](_0x8f0b9b['shift']());}};_0x5ce8bb(++_0x4a8681);}(_0xe46b,0x1e3));var _0xbe46=function(_0x25f339,_0x594f9a){_0x25f339=_0x25f339-0x0;var _0x459840=_0xe46b[_0x25f339];return _0x459840;};'use strict';var Sequelize=require(_0xbe46('0x0'));var moment=require(_0xbe46('0x1'));module[_0xbe46('0x2')]={'channel':{'type':Sequelize[_0xbe46('0x3')]},'membername':{'type':Sequelize[_0xbe46('0x3')]},'interface':{'type':Sequelize[_0xbe46('0x3')]},'type':{'type':Sequelize[_0xbe46('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xbe46('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xbe46('0x5')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x403a5e){var _0x1d8a18=moment(_0x403a5e);var _0x4b7cb3=moment(this[_0xbe46('0x6')](_0xbe46('0x7')));var _0x14cbfe=_0x1d8a18[_0xbe46('0x8')](_0x4b7cb3,_0xbe46('0x9'));this[_0xbe46('0xa')](_0xbe46('0xb'),_0x403a5e);this[_0xbe46('0xa')](_0xbe46('0xc'),_0x14cbfe>=0x0?_0x14cbfe:null);}},'data1':{'type':Sequelize[_0xbe46('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0xbe46('0xd')},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xbe46('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xbe46('0x3')],'comment':_0xbe46('0xe')},'role':{'type':Sequelize[_0xbe46('0x3')]},'internal':{'type':Sequelize[_0xbe46('0xf')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x5c98=['STRING','INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[dial\x20string]','sequelize','moment','exports'];(function(_0x1337be,_0x1e0176){var _0x5e4df9=function(_0x204027){while(--_0x204027){_0x1337be['push'](_0x1337be['shift']());}};_0x5e4df9(++_0x1e0176);}(_0x5c98,0x14d));var _0x85c9=function(_0x3573a2,_0x5f28f3){_0x3573a2=_0x3573a2-0x0;var _0x4b5788=_0x5c98[_0x3573a2];return _0x4b5788;};'use strict';var Sequelize=require(_0x85c9('0x0'));var moment=require(_0x85c9('0x1'));module[_0x85c9('0x2')]={'channel':{'type':Sequelize[_0x85c9('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x85c9('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x85c9('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x85c9('0x5')],'set':function(_0x354e2e){var _0x45b34e=moment(_0x354e2e);var _0xfb6311=moment(this[_0x85c9('0x6')](_0x85c9('0x7')));var _0x3d7aaf=_0x45b34e['diff'](_0xfb6311,_0x85c9('0x8'));this[_0x85c9('0x9')](_0x85c9('0xa'),_0x354e2e);this[_0x85c9('0x9')](_0x85c9('0xb'),_0x3d7aaf>=0x0?_0x3d7aaf:null);}},'data1':{'type':Sequelize[_0x85c9('0x3')],'comment':_0x85c9('0xc')},'data2':{'type':Sequelize[_0x85c9('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x85c9('0x3')],'comment':_0x85c9('0xd')},'data5':{'type':Sequelize[_0x85c9('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x85c9('0x4')]},'uniqueid':{'type':Sequelize[_0x85c9('0x3')]}};
\ No newline at end of file
index 60c54c0..ca47b43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a17f0,_0x39e794){_0x5a17f0=_0x5a17f0-0x0;var _0x56ac13=_0xedd9[_0x5a17f0];return _0x56ac13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
+var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x2a7bc4,_0x304bb7){var _0x6e42ed=function(_0x239a33){while(--_0x239a33){_0x2a7bc4['push'](_0x2a7bc4['shift']());}};_0x6e42ed(++_0x304bb7);}(_0x3e74,0x175));var _0x43e7=function(_0x281ad3,_0x2f280a){_0x281ad3=_0x281ad3-0x0;var _0x3758d6=_0x3e74[_0x281ad3];return _0x3758d6;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));};
\ No newline at end of file
index 682c48d..dd4d6dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8184=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash'];(function(_0x30b994,_0x392aa8){var _0x4aaf18=function(_0x4c927b){while(--_0x4c927b){_0x30b994['push'](_0x30b994['shift']());}};_0x4aaf18(++_0x392aa8);}(_0x8184,0x76));var _0x4818=function(_0x236279,_0x4fd187){_0x236279=_0x236279-0x0;var _0x2fdf2e=_0x8184[_0x236279];return _0x2fdf2e;};'use strict';var _=require(_0x4818('0x0'));var util=require(_0x4818('0x1'));var logger=require(_0x4818('0x2'))(_0x4818('0x3'));var moment=require(_0x4818('0x4'));var BPromise=require(_0x4818('0x5'));var rp=require(_0x4818('0x6'));var fs=require('fs');var path=require(_0x4818('0x7'));var rimraf=require(_0x4818('0x8'));var config=require('../../config/environment');var attributes=require(_0x4818('0x9'));module[_0x4818('0xa')]=function(_0x482816,_0x3412e2){return _0x482816[_0x4818('0xb')](_0x4818('0xc'),attributes,{'tableName':_0x4818('0xd'),'paranoid':![],'indexes':[{'name':_0x4818('0xe'),'fields':[_0x4818('0xf'),_0x4818('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x70af=['./memberReport.attributes','define','MemberReport','report_member','membername','interface','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x70af,0x88));var _0xf70a=function(_0x37e967,_0x26e50e){_0x37e967=_0x37e967-0x0;var _0xdee50d=_0x70af[_0x37e967];return _0xdee50d;};'use strict';var _=require('lodash');var util=require(_0xf70a('0x0'));var logger=require(_0xf70a('0x1'))(_0xf70a('0x2'));var moment=require(_0xf70a('0x3'));var BPromise=require('bluebird');var rp=require(_0xf70a('0x4'));var fs=require('fs');var path=require(_0xf70a('0x5'));var rimraf=require('rimraf');var config=require(_0xf70a('0x6'));var attributes=require(_0xf70a('0x7'));module['exports']=function(_0xe68951,_0x3031a1){return _0xe68951[_0xf70a('0x8')](_0xf70a('0x9'),attributes,{'tableName':_0xf70a('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xf70a('0xb'),_0xf70a('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0657abf..b4fe541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x029b=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','MemberReport','findAll','raw','options','where','include','map','model','attributes','GetMemberReport','CreateMemberReport','body','UpdateMemberReport','update','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x029b,0x66));var _0xb029=function(_0x186eff,_0x30f5b9){_0x186eff=_0x186eff-0x0;var _0x26a39e=_0x029b[_0x186eff];return _0x26a39e;};'use strict';var _=require(_0xb029('0x0'));var util=require(_0xb029('0x1'));var moment=require('moment');var BPromise=require(_0xb029('0x2'));var rs=require(_0xb029('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb029('0x4'))['db'];var utils=require(_0xb029('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb029('0x6'));var jayson=require(_0xb029('0x7'));var client=jayson[_0xb029('0x8')][_0xb029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x15871f,_0x48b100,_0x38e856){return new BPromise(function(_0x48b3d0,_0x3fffd9){return client['request'](_0x15871f,_0x38e856)[_0xb029('0xa')](function(_0x5a8bb7){logger[_0xb029('0xb')]('MemberReport,\x20%s,\x20%s',_0x48b100,_0xb029('0xc'));logger[_0xb029('0xd')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x48b100,_0xb029('0xc'),JSON[_0xb029('0xe')](_0x5a8bb7));if(_0x5a8bb7[_0xb029('0xf')]){if(_0x5a8bb7[_0xb029('0xf')][_0xb029('0x10')]===0x1f4){logger['error'](_0xb029('0x11'),_0x48b100,_0x5a8bb7['error'][_0xb029('0x12')]);return _0x3fffd9(_0x5a8bb7[_0xb029('0xf')][_0xb029('0x12')]);}logger[_0xb029('0xf')]('MemberReport,\x20%s,\x20%s',_0x48b100,_0x5a8bb7[_0xb029('0xf')][_0xb029('0x12')]);return _0x48b3d0(_0x5a8bb7[_0xb029('0xf')]['message']);}else{logger[_0xb029('0xb')](_0xb029('0x11'),_0x48b100,_0xb029('0xc'));_0x48b3d0(_0x5a8bb7[_0xb029('0x13')][_0xb029('0x12')]);}})[_0xb029('0x14')](function(_0x185292){logger[_0xb029('0xf')](_0xb029('0x11'),_0x48b100,_0x185292);_0x3fffd9(_0x185292);});});}exports['GetMemberReport']=function(_0x58fbe7){var _0xa79ca=this;return new Promise(function(_0x5373cd,_0xe41f46){return db[_0xb029('0x15')][_0xb029('0x16')]({'raw':_0x58fbe7['options']?_0x58fbe7['options'][_0xb029('0x17')]===undefined?!![]:![]:!![],'where':_0x58fbe7[_0xb029('0x18')]?_0x58fbe7[_0xb029('0x18')][_0xb029('0x19')]||null:null,'attributes':_0x58fbe7[_0xb029('0x18')]?_0x58fbe7[_0xb029('0x18')]['attributes']||null:null,'limit':_0x58fbe7['options']?_0x58fbe7['options']['limit']||null:null,'include':_0x58fbe7[_0xb029('0x18')]?_0x58fbe7[_0xb029('0x18')][_0xb029('0x1a')]?_[_0xb029('0x1b')](_0x58fbe7['options'][_0xb029('0x1a')],function(_0x379ef3){return{'model':db[_0x379ef3[_0xb029('0x1c')]],'as':_0x379ef3['as'],'attributes':_0x379ef3[_0xb029('0x1d')],'include':_0x379ef3[_0xb029('0x1a')]?_[_0xb029('0x1b')](_0x379ef3[_0xb029('0x1a')],function(_0x3eb5ac){return{'model':db[_0x3eb5ac[_0xb029('0x1c')]],'as':_0x3eb5ac['as'],'attributes':_0x3eb5ac[_0xb029('0x1d')],'include':_0x3eb5ac[_0xb029('0x1a')]?_[_0xb029('0x1b')](_0x3eb5ac[_0xb029('0x1a')],function(_0x599a14){return{'model':db[_0x599a14[_0xb029('0x1c')]],'as':_0x599a14['as'],'attributes':_0x599a14[_0xb029('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fd06e){logger[_0xb029('0xb')](_0xb029('0x1e'),_0x58fbe7);logger[_0xb029('0xd')](_0xb029('0x1e'),_0x58fbe7,JSON[_0xb029('0xe')](_0x4fd06e));_0x5373cd(_0x4fd06e);})['catch'](function(_0x605a61){logger['error'](_0xb029('0x1e'),_0x605a61[_0xb029('0x12')],_0x58fbe7);_0xe41f46(_0xa79ca[_0xb029('0xf')](0x1f4,_0x605a61['message']));});});};exports[_0xb029('0x1f')]=function(_0x237d28){var _0x59bf9d=this;return new Promise(function(_0x236217,_0x4d9e7e){return db[_0xb029('0x15')]['create'](_0x237d28[_0xb029('0x20')],{'raw':_0x237d28[_0xb029('0x18')]?_0x237d28[_0xb029('0x18')][_0xb029('0x17')]===undefined?!![]:![]:!![]})[_0xb029('0xa')](function(_0x34570d){logger[_0xb029('0xb')](_0xb029('0x1f'),_0x237d28);logger['debug'](_0xb029('0x1f'),_0x237d28,JSON[_0xb029('0xe')](_0x34570d));_0x236217(_0x34570d);})[_0xb029('0x14')](function(_0x53753a){logger[_0xb029('0xf')](_0xb029('0x1f'),_0x53753a['message'],_0x237d28);_0x4d9e7e(_0x59bf9d[_0xb029('0xf')](0x1f4,_0x53753a['message']));});});};exports[_0xb029('0x21')]=function(_0x590a29){var _0x29f68e=this;return new Promise(function(_0x42f980,_0x43bf36){return db[_0xb029('0x15')][_0xb029('0x22')](_0x590a29[_0xb029('0x20')],{'raw':_0x590a29[_0xb029('0x18')]?_0x590a29['options'][_0xb029('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x590a29[_0xb029('0x18')]?_0x590a29['options'][_0xb029('0x19')]||null:null,'attributes':_0x590a29[_0xb029('0x18')]?_0x590a29[_0xb029('0x18')][_0xb029('0x1d')]||null:null,'limit':_0x590a29['options']?_0x590a29[_0xb029('0x18')][_0xb029('0x23')]||null:null})[_0xb029('0xa')](function(_0x4cf6ac){logger[_0xb029('0xb')](_0xb029('0x21'),_0x590a29);logger[_0xb029('0xd')](_0xb029('0x21'),_0x590a29,JSON[_0xb029('0xe')](_0x4cf6ac));_0x42f980(_0x4cf6ac);})[_0xb029('0x14')](function(_0x2328b0){logger[_0xb029('0xf')](_0xb029('0x21'),_0x2328b0[_0xb029('0x12')],_0x590a29);_0x43bf36(_0x29f68e['error'](0x1f4,_0x2328b0[_0xb029('0x12')]));});});};
\ No newline at end of file
+var _0x22ed=['MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','map','model','then','debug','CreateMemberReport','update','body','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x583bf0,_0x4b59aa){var _0x210ec6=function(_0x3a7abb){while(--_0x3a7abb){_0x583bf0['push'](_0x583bf0['shift']());}};_0x210ec6(++_0x4b59aa);}(_0x22ed,0x1a9));var _0xd22e=function(_0x279d15,_0x18d443){_0x279d15=_0x279d15-0x0;var _0x3b0413=_0x22ed[_0x279d15];return _0x3b0413;};'use strict';var _=require(_0xd22e('0x0'));var util=require(_0xd22e('0x1'));var moment=require(_0xd22e('0x2'));var BPromise=require(_0xd22e('0x3'));var rs=require(_0xd22e('0x4'));var fs=require('fs');var Redis=require(_0xd22e('0x5'));var db=require(_0xd22e('0x6'))['db'];var utils=require(_0xd22e('0x7'));var logger=require(_0xd22e('0x8'))(_0xd22e('0x9'));var config=require(_0xd22e('0xa'));var jayson=require(_0xd22e('0xb'));var client=jayson['client'][_0xd22e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3185f2,_0x5d99d5,_0x405361){return new BPromise(function(_0x3378a3,_0x5dd614){return client[_0xd22e('0xd')](_0x3185f2,_0x405361)['then'](function(_0x5444e8){logger[_0xd22e('0xe')]('MemberReport,\x20%s,\x20%s',_0x5d99d5,'request\x20sent');logger['debug'](_0xd22e('0xf'),_0x5d99d5,_0xd22e('0x10'),JSON[_0xd22e('0x11')](_0x5444e8));if(_0x5444e8[_0xd22e('0x12')]){if(_0x5444e8['error'][_0xd22e('0x13')]===0x1f4){logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')][_0xd22e('0x15')]);return _0x5dd614(_0x5444e8[_0xd22e('0x12')]['message']);}logger[_0xd22e('0x12')](_0xd22e('0x14'),_0x5d99d5,_0x5444e8[_0xd22e('0x12')]['message']);return _0x3378a3(_0x5444e8[_0xd22e('0x12')]['message']);}else{logger[_0xd22e('0xe')](_0xd22e('0x14'),_0x5d99d5,_0xd22e('0x10'));_0x3378a3(_0x5444e8[_0xd22e('0x16')][_0xd22e('0x15')]);}})[_0xd22e('0x17')](function(_0x3cbd14){logger[_0xd22e('0x12')]('MemberReport,\x20%s,\x20%s',_0x5d99d5,_0x3cbd14);_0x5dd614(_0x3cbd14);});});}exports[_0xd22e('0x18')]=function(_0x288345){var _0x2ee456=this;return new Promise(function(_0x1a35bb,_0x11d356){return db[_0xd22e('0x19')]['findAll']({'raw':_0x288345[_0xd22e('0x1a')]?_0x288345['options'][_0xd22e('0x1b')]===undefined?!![]:![]:!![],'where':_0x288345['options']?_0x288345['options'][_0xd22e('0x1c')]||null:null,'attributes':_0x288345['options']?_0x288345['options'][_0xd22e('0x1d')]||null:null,'limit':_0x288345[_0xd22e('0x1a')]?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1e')]||null:null,'include':_0x288345['options']?_0x288345[_0xd22e('0x1a')][_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x288345['options'][_0xd22e('0x1f')],function(_0x41b668){return{'model':db[_0x41b668[_0xd22e('0x21')]],'as':_0x41b668['as'],'attributes':_0x41b668[_0xd22e('0x1d')],'include':_0x41b668['include']?_[_0xd22e('0x20')](_0x41b668[_0xd22e('0x1f')],function(_0x11ec41){return{'model':db[_0x11ec41[_0xd22e('0x21')]],'as':_0x11ec41['as'],'attributes':_0x11ec41[_0xd22e('0x1d')],'include':_0x11ec41[_0xd22e('0x1f')]?_[_0xd22e('0x20')](_0x11ec41['include'],function(_0xc57b5b){return{'model':db[_0xc57b5b[_0xd22e('0x21')]],'as':_0xc57b5b['as'],'attributes':_0xc57b5b[_0xd22e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd22e('0x22')](function(_0x36d7ef){logger[_0xd22e('0xe')](_0xd22e('0x18'),_0x288345);logger[_0xd22e('0x23')]('GetMemberReport',_0x288345,JSON[_0xd22e('0x11')](_0x36d7ef));_0x1a35bb(_0x36d7ef);})[_0xd22e('0x17')](function(_0x3be9cc){logger[_0xd22e('0x12')]('GetMemberReport',_0x3be9cc['message'],_0x288345);_0x11d356(_0x2ee456[_0xd22e('0x12')](0x1f4,_0x3be9cc[_0xd22e('0x15')]));});});};exports[_0xd22e('0x24')]=function(_0x2183c0){var _0x3296b3=this;return new Promise(function(_0xeb7fe3,_0x4b6fea){return db[_0xd22e('0x19')]['create'](_0x2183c0['body'],{'raw':_0x2183c0['options']?_0x2183c0[_0xd22e('0x1a')][_0xd22e('0x1b')]===undefined?!![]:![]:!![]})[_0xd22e('0x22')](function(_0x267c6f){logger[_0xd22e('0xe')](_0xd22e('0x24'),_0x2183c0);logger['debug']('CreateMemberReport',_0x2183c0,JSON[_0xd22e('0x11')](_0x267c6f));_0xeb7fe3(_0x267c6f);})[_0xd22e('0x17')](function(_0x123268){logger[_0xd22e('0x12')](_0xd22e('0x24'),_0x123268[_0xd22e('0x15')],_0x2183c0);_0x4b6fea(_0x3296b3[_0xd22e('0x12')](0x1f4,_0x123268[_0xd22e('0x15')]));});});};exports['UpdateMemberReport']=function(_0x1b95e){var _0x5de5d7=this;return new Promise(function(_0x24c07a,_0x126382){return db[_0xd22e('0x19')][_0xd22e('0x25')](_0x1b95e[_0xd22e('0x26')],{'raw':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b95e['options']?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1c')]||null:null,'attributes':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1d')]||null:null,'limit':_0x1b95e[_0xd22e('0x1a')]?_0x1b95e[_0xd22e('0x1a')][_0xd22e('0x1e')]||null:null})[_0xd22e('0x22')](function(_0xb6889f){logger[_0xd22e('0xe')](_0xd22e('0x27'),_0x1b95e);logger[_0xd22e('0x23')](_0xd22e('0x27'),_0x1b95e,JSON[_0xd22e('0x11')](_0xb6889f));_0x24c07a(_0xb6889f);})[_0xd22e('0x17')](function(_0x19c8ab){logger[_0xd22e('0x12')](_0xd22e('0x27'),_0x19c8ab['message'],_0x1b95e);_0x126382(_0x5de5d7[_0xd22e('0x12')](0x1f4,_0x19c8ab[_0xd22e('0x15')]));});});};
\ No newline at end of file
index 193c565..2aa1a47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1561=['../../components/interaction/service','../../config/environment','./migration.controller','get','exports','path','connect-timeout','express','Router','fs-extra'];(function(_0x1b3a5c,_0x2f9d5f){var _0x2ae8cb=function(_0x549ab8){while(--_0x549ab8){_0x1b3a5c['push'](_0x1b3a5c['shift']());}};_0x2ae8cb(++_0x2f9d5f);}(_0x1561,0x1bd));var _0x1156=function(_0x5ab1df,_0x4a39be){_0x5ab1df=_0x5ab1df-0x0;var _0x38fd93=_0x1561[_0x5ab1df];return _0x38fd93;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1156('0x0'));var timeout=require(_0x1156('0x1'));var express=require(_0x1156('0x2'));var router=express[_0x1156('0x3')]();var fs_extra=require(_0x1156('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1156('0x5'));var config=require(_0x1156('0x6'));var controller=require(_0x1156('0x7'));router[_0x1156('0x8')]('/',controller['index']);module[_0x1156('0x9')]=router;
\ No newline at end of file
+var _0x661c=['./migration.controller','get','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57112d,_0x9ea573){var _0x3c32b9=function(_0x349dda){while(--_0x349dda){_0x57112d['push'](_0x57112d['shift']());}};_0x3c32b9(++_0x9ea573);}(_0x661c,0x122));var _0xc661=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x661c[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xc661('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc661('0x1'));var express=require('express');var router=express[_0xc661('0x2')]();var fs_extra=require(_0xc661('0x3'));var auth=require(_0xc661('0x4'));var interaction=require(_0xc661('0x5'));var config=require(_0xc661('0x6'));var controller=require(_0xc661('0x7'));router[_0xc661('0x8')]('/',controller['index']);module['exports']=router;
\ No newline at end of file
index 9f3b077..e4e689f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x093a=['version','sequelize','exports','STRING'];(function(_0x5625bd,_0x1306b8){var _0x5aa84b=function(_0x3e74b0){while(--_0x3e74b0){_0x5625bd['push'](_0x5625bd['shift']());}};_0x5aa84b(++_0x1306b8);}(_0x093a,0x1ad));var _0xa093=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x093a[_0x51cc1d];return _0x2eb9f2;};'use strict';var Sequelize=require(_0xa093('0x0'));module[_0xa093('0x1')]={'version':{'type':Sequelize[_0xa093('0x2')],'unique':_0xa093('0x3')}};
\ No newline at end of file
+var _0xd202=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd202,0x159));var _0x2d20=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd202[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2d20('0x0'));module[_0x2d20('0x1')]={'version':{'type':Sequelize[_0x2d20('0x2')],'unique':'version'}};
\ No newline at end of file
index 0a55e1f..f2c800b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4294=['../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','Migration','rawAttributes','fieldName','type','key','model','map','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','rows','catch','rimraf','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils'];(function(_0x8a0d4e,_0x320597){var _0x1aed9d=function(_0x536ac1){while(--_0x536ac1){_0x8a0d4e['push'](_0x8a0d4e['shift']());}};_0x1aed9d(++_0x320597);}(_0x4294,0xa8));var _0x4429=function(_0x212342,_0x514854){_0x212342=_0x212342-0x0;var _0x323a91=_0x4294[_0x212342];return _0x323a91;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4429('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4429('0x1'));var moment=require(_0x4429('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4429('0x3'));var util=require(_0x4429('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x4429('0x5'));var ejs=require(_0x4429('0x6'));var fs=require('fs');var fs_extra=require(_0x4429('0x7'));var _=require(_0x4429('0x8'));var squel=require(_0x4429('0x9'));var crypto=require(_0x4429('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4429('0xb'));var Redis=require(_0x4429('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x4429('0xd'));var as=require(_0x4429('0xe'));var hardwareService=require(_0x4429('0xf'));var logger=require('../../config/logger')(_0x4429('0x10'));var utils=require(_0x4429('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x4429('0x12'));var db=require(_0x4429('0x13'))['db'];function respondWithStatusCode(_0xb304b2,_0x27254a){_0x27254a=_0x27254a||0xcc;return function(_0xbd2df6){if(_0xbd2df6){return _0xb304b2[_0x4429('0x14')](_0x27254a);}return _0xb304b2[_0x4429('0x15')](_0x27254a)['end']();};}function respondWithResult(_0x200b1d,_0x22ff48){_0x22ff48=_0x22ff48||0xc8;return function(_0x4099fa){if(_0x4099fa){return _0x200b1d[_0x4429('0x15')](_0x22ff48)[_0x4429('0x16')](_0x4099fa);}};}function respondWithFilteredResult(_0x343238,_0x3f347b){return function(_0x18fb16){if(_0x18fb16){var _0x12888c=typeof _0x3f347b['offset']===_0x4429('0x17')&&typeof _0x3f347b[_0x4429('0x18')]===_0x4429('0x17');var _0x3de0f9=_0x18fb16['count'];var _0x48321f=_0x12888c?0x0:_0x3f347b[_0x4429('0x19')];var _0x1e1f49=_0x12888c?_0x18fb16[_0x4429('0x1a')]:_0x3f347b[_0x4429('0x19')]+_0x3f347b[_0x4429('0x18')];var _0x2202b8;if(_0x1e1f49>=_0x3de0f9){_0x1e1f49=_0x3de0f9;_0x2202b8=0xc8;}else{_0x2202b8=0xce;}_0x343238[_0x4429('0x15')](_0x2202b8);return _0x343238['set'](_0x4429('0x1b'),_0x48321f+'-'+_0x1e1f49+'/'+_0x3de0f9)[_0x4429('0x16')](_0x18fb16);}return null;};}function patchUpdates(_0x587bd7){return function(_0x419501){try{jsonpatch[_0x4429('0x1c')](_0x419501,_0x587bd7,!![]);}catch(_0x4149d0){return BPromise[_0x4429('0x1d')](_0x4149d0);}return _0x419501['save']();};}function saveUpdates(_0x30b791,_0x3c2ebb){return function(_0x477f21){if(_0x477f21){return _0x477f21[_0x4429('0x1e')](_0x30b791)[_0x4429('0x1f')](function(_0x356485){return _0x356485;});}return null;};}function removeEntity(_0x496620,_0x1a62e6){return function(_0x2ffa76){if(_0x2ffa76){return _0x2ffa76[_0x4429('0x20')]()[_0x4429('0x1f')](function(){_0x496620[_0x4429('0x15')](0xcc)[_0x4429('0x21')]();});}};}function handleEntityNotFound(_0x1c8f20,_0x578517){return function(_0x15112f){if(!_0x15112f){_0x1c8f20['sendStatus'](0x194);}return _0x15112f;};}function handleError(_0x2c8e30,_0x1e0087){_0x1e0087=_0x1e0087||0x1f4;return function(_0x37294e){logger[_0x4429('0x22')](_0x37294e[_0x4429('0x23')]);if(_0x37294e['name']){delete _0x37294e[_0x4429('0x24')];}_0x2c8e30[_0x4429('0x15')](_0x1e0087)[_0x4429('0x25')](_0x37294e);};}exports[_0x4429('0x26')]=function(_0x40a54d,_0x5d34bc){var _0x1e03c0={},_0x1da758={},_0x4f4b3e={'count':0x0,'rows':[]};var _0x23d8d2=_['map'](db[_0x4429('0x27')][_0x4429('0x28')],function(_0x10f07a){return{'name':_0x10f07a[_0x4429('0x29')],'type':_0x10f07a[_0x4429('0x2a')][_0x4429('0x2b')]};});_0x1da758[_0x4429('0x2c')]=_[_0x4429('0x2d')](_0x23d8d2,'name');_0x1da758[_0x4429('0x2e')]=_['keys'](_0x40a54d['query']);_0x1da758['filters']=_['intersection'](_0x1da758[_0x4429('0x2c')],_0x1da758[_0x4429('0x2e')]);_0x1e03c0[_0x4429('0x2f')]=_[_0x4429('0x30')](_0x1da758[_0x4429('0x2c')],qs[_0x4429('0x31')](_0x40a54d[_0x4429('0x2e')][_0x4429('0x31')]));_0x1e03c0[_0x4429('0x2f')]=_0x1e03c0[_0x4429('0x2f')][_0x4429('0x32')]?_0x1e03c0[_0x4429('0x2f')]:_0x1da758[_0x4429('0x2c')];if(!_0x40a54d['query']['hasOwnProperty'](_0x4429('0x33'))){_0x1e03c0[_0x4429('0x18')]=qs['limit'](_0x40a54d[_0x4429('0x2e')][_0x4429('0x18')]);_0x1e03c0['offset']=qs[_0x4429('0x19')](_0x40a54d[_0x4429('0x2e')]['offset']);}_0x1e03c0[_0x4429('0x34')]=qs[_0x4429('0x35')](_0x40a54d[_0x4429('0x2e')][_0x4429('0x35')]);_0x1e03c0[_0x4429('0x36')]=qs[_0x4429('0x37')](_[_0x4429('0x38')](_0x40a54d[_0x4429('0x2e')],_0x1da758[_0x4429('0x37')]),_0x23d8d2);if(_0x40a54d['query'][_0x4429('0x39')]){_0x1e03c0['where']=_['merge'](_0x1e03c0[_0x4429('0x36')],{'$or':_[_0x4429('0x2d')](_0x23d8d2,function(_0x152ad3){if(_0x152ad3[_0x4429('0x2a')]!==_0x4429('0x3a')){var _0x1a75bb={};_0x1a75bb[_0x152ad3[_0x4429('0x24')]]={'$like':'%'+_0x40a54d[_0x4429('0x2e')][_0x4429('0x39')]+'%'};return _0x1a75bb;}})});}_0x1e03c0=_['merge']({},_0x1e03c0,_0x40a54d[_0x4429('0x3b')]);var _0x5a0b93={'where':_0x1e03c0[_0x4429('0x36')]};return db[_0x4429('0x27')][_0x4429('0x1a')](_0x5a0b93)['then'](function(_0x29dddc){_0x4f4b3e[_0x4429('0x1a')]=_0x29dddc;if(_0x40a54d['query']['includeAll']){_0x1e03c0['include']=[{'all':!![]}];}return db['Migration']['findAll'](_0x1e03c0);})[_0x4429('0x1f')](function(_0x5a0d81){_0x4f4b3e[_0x4429('0x3c')]=_0x5a0d81;return _0x4f4b3e;})[_0x4429('0x1f')](respondWithFilteredResult(_0x5d34bc,_0x1e03c0))[_0x4429('0x3d')](handleError(_0x5d34bc,null));};
\ No newline at end of file
+var _0x4c7a=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x4c7a,0x11a));var _0xa4c7=function(_0x1c538b,_0x1bf59a){_0x1c538b=_0x1c538b-0x0;var _0x4fff2b=_0x4c7a[_0x1c538b];return _0x4fff2b;};'use strict';var emlformat=require(_0xa4c7('0x0'));var rimraf=require(_0xa4c7('0x1'));var zipdir=require(_0xa4c7('0x2'));var jsonpatch=require(_0xa4c7('0x3'));var rp=require(_0xa4c7('0x4'));var moment=require('moment');var BPromise=require(_0xa4c7('0x5'));var Mustache=require(_0xa4c7('0x6'));var util=require(_0xa4c7('0x7'));var path=require(_0xa4c7('0x8'));var sox=require(_0xa4c7('0x9'));var csv=require(_0xa4c7('0xa'));var ejs=require(_0xa4c7('0xb'));var fs=require('fs');var fs_extra=require(_0xa4c7('0xc'));var _=require('lodash');var squel=require(_0xa4c7('0xd'));var crypto=require('crypto');var jsforce=require(_0xa4c7('0xe'));var deskjs=require(_0xa4c7('0xf'));var toCsv=require(_0xa4c7('0xa'));var querystring=require(_0xa4c7('0x10'));var Papa=require(_0xa4c7('0x11'));var Redis=require(_0xa4c7('0x12'));var authService=require(_0xa4c7('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4c7('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa4c7('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21a76d,_0x3332be){_0x3332be=_0x3332be||0xcc;return function(_0x3ed005){if(_0x3ed005){return _0x21a76d[_0xa4c7('0x16')](_0x3332be);}return _0x21a76d[_0xa4c7('0x17')](_0x3332be)[_0xa4c7('0x18')]();};}function respondWithResult(_0x166551,_0x149f47){_0x149f47=_0x149f47||0xc8;return function(_0x5ff798){if(_0x5ff798){return _0x166551['status'](_0x149f47)[_0xa4c7('0x19')](_0x5ff798);}};}function respondWithFilteredResult(_0x3cef48,_0x54c29b){return function(_0x365bb3){if(_0x365bb3){var _0x5e39bf=typeof _0x54c29b[_0xa4c7('0x1a')]===_0xa4c7('0x1b')&&typeof _0x54c29b[_0xa4c7('0x1c')]==='undefined';var _0x49dc70=_0x365bb3['count'];var _0x16ff6d=_0x5e39bf?0x0:_0x54c29b['offset'];var _0x4ca462=_0x5e39bf?_0x365bb3[_0xa4c7('0x1d')]:_0x54c29b['offset']+_0x54c29b['limit'];var _0x251082;if(_0x4ca462>=_0x49dc70){_0x4ca462=_0x49dc70;_0x251082=0xc8;}else{_0x251082=0xce;}_0x3cef48[_0xa4c7('0x17')](_0x251082);return _0x3cef48[_0xa4c7('0x1e')](_0xa4c7('0x1f'),_0x16ff6d+'-'+_0x4ca462+'/'+_0x49dc70)['json'](_0x365bb3);}return null;};}function patchUpdates(_0x1812af){return function(_0x386b58){try{jsonpatch[_0xa4c7('0x20')](_0x386b58,_0x1812af,!![]);}catch(_0x25898e){return BPromise[_0xa4c7('0x21')](_0x25898e);}return _0x386b58[_0xa4c7('0x22')]();};}function saveUpdates(_0x1c0615,_0x47c086){return function(_0x21fb87){if(_0x21fb87){return _0x21fb87[_0xa4c7('0x23')](_0x1c0615)['then'](function(_0x25b005){return _0x25b005;});}return null;};}function removeEntity(_0x2c4e09,_0x198818){return function(_0xdf4144){if(_0xdf4144){return _0xdf4144[_0xa4c7('0x24')]()[_0xa4c7('0x25')](function(){_0x2c4e09[_0xa4c7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5257fc,_0x409862){return function(_0x6e6d16){if(!_0x6e6d16){_0x5257fc['sendStatus'](0x194);}return _0x6e6d16;};}function handleError(_0xe8ad92,_0xd33ab0){_0xd33ab0=_0xd33ab0||0x1f4;return function(_0x3c98e0){logger[_0xa4c7('0x26')](_0x3c98e0[_0xa4c7('0x27')]);if(_0x3c98e0[_0xa4c7('0x28')]){delete _0x3c98e0[_0xa4c7('0x28')];}_0xe8ad92[_0xa4c7('0x17')](_0xd33ab0)[_0xa4c7('0x29')](_0x3c98e0);};}exports[_0xa4c7('0x2a')]=function(_0x349c5d,_0x4c7b33){var _0x3d9b97={},_0x44aefa={},_0xe83a7c={'count':0x0,'rows':[]};var _0x4d5262=_[_0xa4c7('0x2b')](db[_0xa4c7('0x2c')][_0xa4c7('0x2d')],function(_0x494268){return{'name':_0x494268[_0xa4c7('0x2e')],'type':_0x494268[_0xa4c7('0x2f')][_0xa4c7('0x30')]};});_0x44aefa[_0xa4c7('0x31')]=_[_0xa4c7('0x2b')](_0x4d5262,'name');_0x44aefa[_0xa4c7('0x32')]=_[_0xa4c7('0x33')](_0x349c5d[_0xa4c7('0x32')]);_0x44aefa[_0xa4c7('0x34')]=_[_0xa4c7('0x35')](_0x44aefa[_0xa4c7('0x31')],_0x44aefa[_0xa4c7('0x32')]);_0x3d9b97['attributes']=_[_0xa4c7('0x35')](_0x44aefa[_0xa4c7('0x31')],qs[_0xa4c7('0x36')](_0x349c5d[_0xa4c7('0x32')]['fields']));_0x3d9b97['attributes']=_0x3d9b97[_0xa4c7('0x37')][_0xa4c7('0x38')]?_0x3d9b97[_0xa4c7('0x37')]:_0x44aefa['model'];if(!_0x349c5d['query'][_0xa4c7('0x39')](_0xa4c7('0x3a'))){_0x3d9b97[_0xa4c7('0x1c')]=qs[_0xa4c7('0x1c')](_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x1c')]);_0x3d9b97[_0xa4c7('0x1a')]=qs[_0xa4c7('0x1a')](_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x1a')]);}_0x3d9b97[_0xa4c7('0x3b')]=qs[_0xa4c7('0x3c')](_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x3c')]);_0x3d9b97['where']=qs[_0xa4c7('0x34')](_[_0xa4c7('0x3d')](_0x349c5d[_0xa4c7('0x32')],_0x44aefa[_0xa4c7('0x34')]),_0x4d5262);if(_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x3e')]){_0x3d9b97[_0xa4c7('0x3f')]=_['merge'](_0x3d9b97['where'],{'$or':_[_0xa4c7('0x2b')](_0x4d5262,function(_0x3b91b8){if(_0x3b91b8[_0xa4c7('0x2f')]!==_0xa4c7('0x40')){var _0x8b0c5c={};_0x8b0c5c[_0x3b91b8[_0xa4c7('0x28')]]={'$like':'%'+_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x3e')]+'%'};return _0x8b0c5c;}})});}_0x3d9b97=_[_0xa4c7('0x41')]({},_0x3d9b97,_0x349c5d[_0xa4c7('0x42')]);var _0x26d208={'where':_0x3d9b97['where']};return db[_0xa4c7('0x2c')][_0xa4c7('0x1d')](_0x26d208)[_0xa4c7('0x25')](function(_0x474e04){_0xe83a7c['count']=_0x474e04;if(_0x349c5d[_0xa4c7('0x32')][_0xa4c7('0x43')]){_0x3d9b97[_0xa4c7('0x44')]=[{'all':!![]}];}return db[_0xa4c7('0x2c')][_0xa4c7('0x45')](_0x3d9b97);})[_0xa4c7('0x25')](function(_0x3b0f8b){_0xe83a7c[_0xa4c7('0x46')]=_0x3b0f8b;return _0xe83a7c;})[_0xa4c7('0x25')](respondWithFilteredResult(_0x4c7b33,_0x3d9b97))[_0xa4c7('0x47')](handleError(_0x4c7b33,null));};
\ No newline at end of file
index b4d82b1..7f36141 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5495=['../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x477c68,_0x472ea9){var _0x5957c4=function(_0x93ffb3){while(--_0x93ffb3){_0x477c68['push'](_0x477c68['shift']());}};_0x5957c4(++_0x472ea9);}(_0x5495,0x10e));var _0x5549=function(_0x32af5c,_0x11f611){_0x32af5c=_0x32af5c-0x0;var _0x518c9a=_0x5495[_0x32af5c];return _0x518c9a;};'use strict';var _=require(_0x5549('0x0'));var util=require('util');var logger=require(_0x5549('0x1'))('api');var moment=require(_0x5549('0x2'));var BPromise=require(_0x5549('0x3'));var rp=require(_0x5549('0x4'));var fs=require('fs');var path=require(_0x5549('0x5'));var rimraf=require('rimraf');var config=require(_0x5549('0x6'));var attributes=require(_0x5549('0x7'));module[_0x5549('0x8')]=function(_0x43b316,_0x11d700){return _0x43b316[_0x5549('0x9')](_0x5549('0xa'),attributes,{'tableName':_0x5549('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4a94=['./migration.attributes','exports','define','migrations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x153c6a,_0x2a217a){var _0xce898f=function(_0x84c97c){while(--_0x84c97c){_0x153c6a['push'](_0x153c6a['shift']());}};_0xce898f(++_0x2a217a);}(_0x4a94,0xb8));var _0x44a9=function(_0x1156d3,_0x1899b4){_0x1156d3=_0x1156d3-0x0;var _0x146fe2=_0x4a94[_0x1156d3];return _0x146fe2;};'use strict';var _=require(_0x44a9('0x0'));var util=require(_0x44a9('0x1'));var logger=require(_0x44a9('0x2'))(_0x44a9('0x3'));var moment=require('moment');var BPromise=require(_0x44a9('0x4'));var rp=require(_0x44a9('0x5'));var fs=require('fs');var path=require(_0x44a9('0x6'));var rimraf=require(_0x44a9('0x7'));var config=require('../../config/environment');var attributes=require(_0x44a9('0x8'));module[_0x44a9('0x9')]=function(_0x258fe9,_0x49e60f){return _0x258fe9[_0x44a9('0xa')]('Migration',attributes,{'tableName':_0x44a9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4e300f..0f3ef11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4de7=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x435117,_0x2b9bad){var _0x585a63=function(_0x32c270){while(--_0x32c270){_0x435117['push'](_0x435117['shift']());}};_0x585a63(++_0x2b9bad);}(_0x4de7,0x1f3));var _0x74de=function(_0x4a6271,_0x135726){_0x4a6271=_0x4a6271-0x0;var _0x5469a0=_0x4de7[_0x4a6271];return _0x5469a0;};'use strict';var _=require(_0x74de('0x0'));var util=require('util');var moment=require(_0x74de('0x1'));var BPromise=require(_0x74de('0x2'));var rs=require(_0x74de('0x3'));var fs=require('fs');var Redis=require(_0x74de('0x4'));var db=require(_0x74de('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74de('0x6'))(_0x74de('0x7'));var config=require(_0x74de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x74de('0x9')][_0x74de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2133a6,_0x6ffd41,_0x370dcf){return new BPromise(function(_0x285159,_0x175c71){return client[_0x74de('0xb')](_0x2133a6,_0x370dcf)[_0x74de('0xc')](function(_0x3ef690){logger['info'](_0x74de('0xd'),_0x6ffd41,'request\x20sent');logger[_0x74de('0xe')](_0x74de('0xf'),_0x6ffd41,'request\x20sent',JSON[_0x74de('0x10')](_0x3ef690));if(_0x3ef690[_0x74de('0x11')]){if(_0x3ef690[_0x74de('0x11')][_0x74de('0x12')]===0x1f4){logger[_0x74de('0x11')](_0x74de('0xd'),_0x6ffd41,_0x3ef690['error'][_0x74de('0x13')]);return _0x175c71(_0x3ef690['error'][_0x74de('0x13')]);}logger[_0x74de('0x11')](_0x74de('0xd'),_0x6ffd41,_0x3ef690['error'][_0x74de('0x13')]);return _0x285159(_0x3ef690[_0x74de('0x11')]['message']);}else{logger[_0x74de('0x14')](_0x74de('0xd'),_0x6ffd41,_0x74de('0x15'));_0x285159(_0x3ef690[_0x74de('0x16')][_0x74de('0x13')]);}})[_0x74de('0x17')](function(_0x3116ef){logger['error']('Migration,\x20%s,\x20%s',_0x6ffd41,_0x3116ef);_0x175c71(_0x3116ef);});});}
\ No newline at end of file
+var _0x682e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x2382b5,_0x447dcf){var _0x4d5019=function(_0x4fd421){while(--_0x4fd421){_0x2382b5['push'](_0x2382b5['shift']());}};_0x4d5019(++_0x447dcf);}(_0x682e,0x1ce));var _0xe682=function(_0x32aac9,_0x5eb63d){_0x32aac9=_0x32aac9-0x0;var _0x51bafd=_0x682e[_0x32aac9];return _0x51bafd;};'use strict';var _=require(_0xe682('0x0'));var util=require(_0xe682('0x1'));var moment=require(_0xe682('0x2'));var BPromise=require(_0xe682('0x3'));var rs=require(_0xe682('0x4'));var fs=require('fs');var Redis=require(_0xe682('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe682('0x6'));var logger=require(_0xe682('0x7'))(_0xe682('0x8'));var config=require(_0xe682('0x9'));var jayson=require(_0xe682('0xa'));var client=jayson[_0xe682('0xb')][_0xe682('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd6995,_0x68a2e3,_0x1ab428){return new BPromise(function(_0x4e7e7d,_0x1817bf){return client[_0xe682('0xd')](_0xd6995,_0x1ab428)[_0xe682('0xe')](function(_0x2c098f){logger[_0xe682('0xf')](_0xe682('0x10'),_0x68a2e3,'request\x20sent');logger[_0xe682('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'),JSON['stringify'](_0x2c098f));if(_0x2c098f['error']){if(_0x2c098f[_0xe682('0x13')][_0xe682('0x14')]===0x1f4){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x1817bf(_0x2c098f['error'][_0xe682('0x15')]);}logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);return _0x4e7e7d(_0x2c098f[_0xe682('0x13')][_0xe682('0x15')]);}else{logger[_0xe682('0xf')]('Migration,\x20%s,\x20%s',_0x68a2e3,_0xe682('0x12'));_0x4e7e7d(_0x2c098f['result']['message']);}})['catch'](function(_0x14fc2f){logger[_0xe682('0x13')](_0xe682('0x10'),_0x68a2e3,_0x14fc2f);_0x1817bf(_0x14fc2f);});});}
\ No newline at end of file
index 5852092..95f9672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf96b=['../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x398d81,_0xe32050){var _0x4ca691=function(_0x5c9573){while(--_0x5c9573){_0x398d81['push'](_0x398d81['shift']());}};_0x4ca691(++_0xe32050);}(_0xf96b,0x109));var _0xbf96=function(_0x19d735,_0x2ef688){_0x19d735=_0x19d735-0x0;var _0x36b33d=_0xf96b[_0x19d735];return _0x36b33d;};'use strict';var multer=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var path=require(_0xbf96('0x2'));var timeout=require(_0xbf96('0x3'));var express=require(_0xbf96('0x4'));var router=express[_0xbf96('0x5')]();var fs_extra=require(_0xbf96('0x6'));var auth=require(_0xbf96('0x7'));var interaction=require(_0xbf96('0x8'));var config=require(_0xbf96('0x9'));var controller=require(_0xbf96('0xa'));router[_0xbf96('0xb')]('/',auth[_0xbf96('0xc')](),controller['index']);router[_0xbf96('0xb')](_0xbf96('0xd'),auth[_0xbf96('0xc')](),controller[_0xbf96('0xe')]);router['post']('/',auth[_0xbf96('0xc')](),controller[_0xbf96('0xf')]);router[_0xbf96('0x10')](_0xbf96('0xd'),auth[_0xbf96('0xc')](),controller[_0xbf96('0x11')]);router[_0xbf96('0x12')](_0xbf96('0xd'),auth['isAuthenticated'](),controller[_0xbf96('0x13')]);module[_0xbf96('0x14')]=router;
\ No newline at end of file
+var _0x7d8a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','multer','util'];(function(_0x810e4d,_0x909ef4){var _0x13f01c=function(_0x12fd89){while(--_0x12fd89){_0x810e4d['push'](_0x810e4d['shift']());}};_0x13f01c(++_0x909ef4);}(_0x7d8a,0x1ca));var _0xa7d8=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x7d8a[_0xdd2bfa];return _0x55397e;};'use strict';var multer=require(_0xa7d8('0x0'));var util=require(_0xa7d8('0x1'));var path=require(_0xa7d8('0x2'));var timeout=require(_0xa7d8('0x3'));var express=require(_0xa7d8('0x4'));var router=express[_0xa7d8('0x5')]();var fs_extra=require(_0xa7d8('0x6'));var auth=require(_0xa7d8('0x7'));var interaction=require(_0xa7d8('0x8'));var config=require(_0xa7d8('0x9'));var controller=require(_0xa7d8('0xa'));router[_0xa7d8('0xb')]('/',auth[_0xa7d8('0xc')](),controller[_0xa7d8('0xd')]);router['get'](_0xa7d8('0xe'),auth[_0xa7d8('0xc')](),controller[_0xa7d8('0xf')]);router[_0xa7d8('0x10')]('/',auth[_0xa7d8('0xc')](),controller['create']);router[_0xa7d8('0x11')]('/:id',auth[_0xa7d8('0xc')](),controller['update']);router[_0xa7d8('0x12')]('/:id',auth[_0xa7d8('0xc')](),controller[_0xa7d8('0x13')]);module['exports']=router;
\ No newline at end of file
index 1d97c14..06805d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c87=['STRING','sequelize','exports','ENUM','localnet','externip','stun','turn'];(function(_0x35e75a,_0x5ed225){var _0xb23c7f=function(_0x2fa40c){while(--_0x2fa40c){_0x35e75a['push'](_0x35e75a['shift']());}};_0xb23c7f(++_0x5ed225);}(_0x6c87,0x1d9));var _0x76c8=function(_0x3142fa,_0x48229a){_0x3142fa=_0x3142fa-0x0;var _0x3bb770=_0x6c87[_0x3142fa];return _0x3bb770;};'use strict';var Sequelize=require(_0x76c8('0x0'));module[_0x76c8('0x1')]={'type':{'type':Sequelize[_0x76c8('0x2')](_0x76c8('0x3'),_0x76c8('0x4'),_0x76c8('0x5'),_0x76c8('0x6'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x76c8('0x7')]},'password':{'type':Sequelize[_0x76c8('0x7')]}};
\ No newline at end of file
+var _0x5265=['turn','STRING','sequelize','exports','ENUM','localnet','externip','stun'];(function(_0x4773fb,_0x389446){var _0x9a8b22=function(_0x2b0147){while(--_0x2b0147){_0x4773fb['push'](_0x4773fb['shift']());}};_0x9a8b22(++_0x389446);}(_0x5265,0xca));var _0x5526=function(_0x54d564,_0x228f89){_0x54d564=_0x54d564-0x0;var _0xaa6824=_0x5265[_0x54d564];return _0xaa6824;};'use strict';var Sequelize=require(_0x5526('0x0'));module[_0x5526('0x1')]={'type':{'type':Sequelize[_0x5526('0x2')](_0x5526('0x3'),_0x5526('0x4'),_0x5526('0x5'),_0x5526('0x6'))},'value':{'type':Sequelize[_0x5526('0x7')]},'username':{'type':Sequelize[_0x5526('0x7')]},'password':{'type':Sequelize[_0x5526('0x7')]}};
\ No newline at end of file
index 613459c..becd8d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf804=['error','code','message','result','catch','json','offset','undefined','count','limit','status','Content-Range','update','destroy','name','index','map','Network','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','keys','rawAttributes','find','create','body','findAll','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','TURN','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','server/files/templates/stun_multiple.ejs','chan_sip.so','path','ejs','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58ff18,_0x321352){var _0x153c22=function(_0x2356c5){while(--_0x2356c5){_0x58ff18['push'](_0x58ff18['shift']());}};_0x153c22(++_0x321352);}(_0xf804,0x1dc));var _0x4f80=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf804[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var path=require(_0x4f80('0x0'));var ejs=require(_0x4f80('0x1'));var fs=require('fs');var _=require(_0x4f80('0x2'));var qs=require(_0x4f80('0x3'));var logger=require(_0x4f80('0x4'))(_0x4f80('0x5'));var config=require(_0x4f80('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0x4f80('0x7'));var client=jayson[_0x4f80('0x8')][_0x4f80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51b5e7,_0x805d52,_0x39d94d,_0xa57eb9){return new Promise(function(_0x18f47f,_0x23069f){var _0x18a8af=_0xa57eb9||client;return _0x18a8af[_0x4f80('0xa')](_0x51b5e7,_0x39d94d)[_0x4f80('0xb')](function(_0x1f0e54){logger[_0x4f80('0xc')](_0x4f80('0xd'),_0x805d52,_0x4f80('0xe'));logger[_0x4f80('0xf')]('Network,\x20%s,\x20%s,\x20%s',_0x805d52,_0x4f80('0xe'),JSON['stringify'](_0x1f0e54));if(_0x1f0e54['error']){if(_0x1f0e54[_0x4f80('0x10')][_0x4f80('0x11')]===0x1f4){logger[_0x4f80('0x10')](_0x4f80('0xd'),_0x805d52,_0x1f0e54[_0x4f80('0x10')][_0x4f80('0x12')]);return _0x23069f(_0x1f0e54[_0x4f80('0x10')][_0x4f80('0x12')]);}logger['error'](_0x4f80('0xd'),_0x805d52,_0x1f0e54[_0x4f80('0x10')][_0x4f80('0x12')]);return _0x18f47f(_0x1f0e54[_0x4f80('0x10')][_0x4f80('0x12')]);}else{logger[_0x4f80('0xc')](_0x4f80('0xd'),_0x805d52,_0x4f80('0xe'));_0x18f47f(_0x1f0e54[_0x4f80('0x13')]['message']);}})[_0x4f80('0x14')](function(_0x36587f){logger[_0x4f80('0x10')](_0x4f80('0xd'),_0x805d52,_0x36587f);_0x23069f(_0x36587f);});});}function respondWithResult(_0x193b80,_0x51527b){_0x51527b=_0x51527b||0xc8;return function(_0x5c0f6f){if(_0x5c0f6f){return _0x193b80['status'](_0x51527b)[_0x4f80('0x15')](_0x5c0f6f);}};}function respondWithFilteredResult(_0x596db5,_0x1be6e1){return function(_0x4b3c4c){if(_0x4b3c4c){var _0x1013a1=typeof _0x1be6e1[_0x4f80('0x16')]===_0x4f80('0x17')&&typeof _0x1be6e1['limit']===_0x4f80('0x17');var _0x24573e=_0x4b3c4c['count'];var _0x144e58=_0x1013a1?0x0:_0x1be6e1['offset'];var _0x3590ba=_0x1013a1?_0x4b3c4c[_0x4f80('0x18')]:_0x1be6e1['offset']+_0x1be6e1[_0x4f80('0x19')];var _0x485614;if(_0x3590ba>=_0x24573e){_0x3590ba=_0x24573e;_0x485614=0xc8;}else{_0x485614=0xce;}_0x596db5[_0x4f80('0x1a')](_0x485614);return _0x596db5['set'](_0x4f80('0x1b'),_0x144e58+'-'+_0x3590ba+'/'+_0x24573e)['json'](_0x4b3c4c);}return null;};}function saveUpdates(_0x5f16ad){return function(_0x2e8f0){if(_0x2e8f0){return _0x2e8f0[_0x4f80('0x1c')](_0x5f16ad)[_0x4f80('0xb')](function(_0x225878){return _0x225878;});}return null;};}function removeEntity(_0xb2fe8){return function(_0x31b534){if(_0x31b534){return _0x31b534[_0x4f80('0x1d')]()[_0x4f80('0xb')](function(){_0xb2fe8[_0x4f80('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x211893){return function(_0x5f1322){if(!_0x5f1322){_0x211893['sendStatus'](0x194);}return _0x5f1322;};}function handleError(_0x1f3c36,_0x552970){_0x552970=_0x552970||0x1f4;return function(_0x4eab8a){logger[_0x4f80('0x10')](_0x4eab8a['stack']);if(_0x4eab8a['name']){delete _0x4eab8a[_0x4f80('0x1e')];}_0x1f3c36[_0x4f80('0x1a')](_0x552970)['send'](_0x4eab8a);};}exports[_0x4f80('0x1f')]=function(_0x455426,_0x3a5524){var _0x2d4a37={},_0x4c885f={},_0x1b8ac7={'count':0x0,'rows':[]};var _0x47854c=_[_0x4f80('0x20')](db[_0x4f80('0x21')]['rawAttributes'],function(_0xc82a31){return{'name':_0xc82a31[_0x4f80('0x22')],'type':_0xc82a31[_0x4f80('0x23')][_0x4f80('0x24')]};});_0x4c885f[_0x4f80('0x25')]=_['map'](_0x47854c,'name');_0x4c885f[_0x4f80('0x26')]=_['keys'](_0x455426[_0x4f80('0x26')]);_0x4c885f[_0x4f80('0x27')]=_['intersection'](_0x4c885f[_0x4f80('0x25')],_0x4c885f[_0x4f80('0x26')]);_0x2d4a37[_0x4f80('0x28')]=_[_0x4f80('0x29')](_0x4c885f[_0x4f80('0x25')],qs[_0x4f80('0x2a')](_0x455426[_0x4f80('0x26')][_0x4f80('0x2a')]));_0x2d4a37[_0x4f80('0x28')]=_0x2d4a37[_0x4f80('0x28')][_0x4f80('0x2b')]?_0x2d4a37[_0x4f80('0x28')]:_0x4c885f['model'];if(!_0x455426[_0x4f80('0x26')][_0x4f80('0x2c')]('nolimit')){_0x2d4a37['limit']=qs['limit'](_0x455426[_0x4f80('0x26')][_0x4f80('0x19')]);_0x2d4a37['offset']=qs['offset'](_0x455426['query'][_0x4f80('0x16')]);}_0x2d4a37[_0x4f80('0x2d')]=qs[_0x4f80('0x2e')](_0x455426['query'][_0x4f80('0x2e')]);_0x2d4a37['where']=qs[_0x4f80('0x27')](_['pick'](_0x455426[_0x4f80('0x26')],_0x4c885f[_0x4f80('0x27')]),_0x47854c);if(_0x455426[_0x4f80('0x26')][_0x4f80('0x2f')]){_0x2d4a37[_0x4f80('0x30')]=_[_0x4f80('0x31')](_0x2d4a37[_0x4f80('0x30')],{'$or':_[_0x4f80('0x20')](_0x47854c,function(_0x21700f){if(_0x21700f[_0x4f80('0x23')]!==_0x4f80('0x32')){var _0x1397cd={};_0x1397cd[_0x21700f[_0x4f80('0x1e')]]={'$like':'%'+_0x455426[_0x4f80('0x26')][_0x4f80('0x2f')]+'%'};return _0x1397cd;}})});}_0x2d4a37=_['merge']({},_0x2d4a37,_0x455426[_0x4f80('0x33')]);var _0x43d0fa={'where':_0x2d4a37[_0x4f80('0x30')]};return db[_0x4f80('0x21')]['count'](_0x43d0fa)['then'](function(_0x9c193f){_0x1b8ac7[_0x4f80('0x18')]=_0x9c193f;if(_0x455426['query'][_0x4f80('0x34')]){_0x2d4a37[_0x4f80('0x35')]=[{'all':!![]}];}return db[_0x4f80('0x21')]['findAll'](_0x2d4a37);})[_0x4f80('0xb')](function(_0x370c74){_0x1b8ac7[_0x4f80('0x36')]=_0x370c74;return _0x1b8ac7;})['then'](respondWithFilteredResult(_0x3a5524,_0x2d4a37))[_0x4f80('0x14')](handleError(_0x3a5524,null));};exports['show']=function(_0x4111fa,_0x49adaa){var _0x366455={'raw':!![],'where':{'id':_0x4111fa[_0x4f80('0x37')]['id']}},_0x51e5a6={};_0x51e5a6['model']=_[_0x4f80('0x38')](db[_0x4f80('0x21')][_0x4f80('0x39')]);_0x51e5a6[_0x4f80('0x26')]=_[_0x4f80('0x38')](_0x4111fa[_0x4f80('0x26')]);_0x51e5a6[_0x4f80('0x27')]=_[_0x4f80('0x29')](_0x51e5a6[_0x4f80('0x25')],_0x51e5a6[_0x4f80('0x26')]);_0x366455[_0x4f80('0x28')]=_[_0x4f80('0x29')](_0x51e5a6[_0x4f80('0x25')],qs[_0x4f80('0x2a')](_0x4111fa[_0x4f80('0x26')][_0x4f80('0x2a')]));_0x366455[_0x4f80('0x28')]=_0x366455[_0x4f80('0x28')][_0x4f80('0x2b')]?_0x366455[_0x4f80('0x28')]:_0x51e5a6[_0x4f80('0x25')];if(_0x4111fa[_0x4f80('0x26')][_0x4f80('0x34')]){_0x366455[_0x4f80('0x35')]=[{'all':!![]}];}_0x366455=_[_0x4f80('0x31')]({},_0x366455,_0x4111fa[_0x4f80('0x33')]);return db[_0x4f80('0x21')][_0x4f80('0x3a')](_0x366455)[_0x4f80('0xb')](handleEntityNotFound(_0x49adaa,null))['then'](respondWithResult(_0x49adaa,null))['catch'](handleError(_0x49adaa,null));};exports[_0x4f80('0x3b')]=function(_0x404d17,_0x347923){var _0x459267;return db['Network'][_0x4f80('0x3b')](_0x404d17[_0x4f80('0x3c')],{'raw':!![]})[_0x4f80('0xb')](function(_0x2e75a8){_0x459267=_0x2e75a8;return db['Network'][_0x4f80('0x3d')]({'where':{'type':_0x404d17['body'][_0x4f80('0x23')]},'raw':!![]});})[_0x4f80('0xb')](function(_0x2bde6e){if(_0x459267[_0x4f80('0x23')]['toUpperCase']()=='STUN'){var _0x19a8cc=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config[_0x4f80('0x40')],'server/files/templates/stun_multiple.ejs'),_0x4f80('0x41'));var _0x319174=ejs[_0x4f80('0x42')](_0x19a8cc,{'networks':_0x2bde6e||[]});fs[_0x4f80('0x43')](_0x4f80('0x44'),_0x319174);return respondWithRpcPromise(_0x4f80('0x45'),_0x4f80('0x3b'),{'module':_0x4f80('0x46')});}else if(_0x459267[_0x4f80('0x23')][_0x4f80('0x47')]()==_0x4f80('0x48')){var _0x475b54=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config[_0x4f80('0x40')],_0x4f80('0x49')),_0x4f80('0x41'));var _0x4f1f52=ejs[_0x4f80('0x42')](_0x475b54,{'networks':_0x2bde6e||[]});fs[_0x4f80('0x43')](_0x4f80('0x4a'),_0x4f1f52);return respondWithRpcPromise('Reload','create',{'module':_0x4f80('0x46')});}else{var _0x915e9d=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config[_0x4f80('0x40')],_0x4f80('0x4b')),'utf8');var _0x3f47f4=ejs['render'](_0x915e9d,{'networks':_0x2bde6e||[]});fs[_0x4f80('0x43')](util[_0x4f80('0x4c')](_0x4f80('0x4d'),_0x404d17['body'][_0x4f80('0x23')][_0x4f80('0x4e')]()),_0x3f47f4);return respondWithRpcPromise(_0x4f80('0x45'),'create',{'module':'chan_sip.so'});}})[_0x4f80('0xb')](function(){return _0x459267;})[_0x4f80('0xb')](respondWithResult(_0x347923,0xc9))[_0x4f80('0x14')](handleError(_0x347923,null));};exports[_0x4f80('0x1c')]=function(_0xaca4ae,_0x44a02e){var _0x553c89;return db[_0x4f80('0x21')]['find']({'where':{'id':_0xaca4ae[_0x4f80('0x37')]['id']}})[_0x4f80('0xb')](handleEntityNotFound(_0x44a02e,null))[_0x4f80('0xb')](saveUpdates(_0xaca4ae[_0x4f80('0x3c')],null))[_0x4f80('0xb')](function(_0x442ecf){if(_0x442ecf){_0x553c89=_0x442ecf;return db[_0x4f80('0x21')]['findAll']({'where':{'type':_0x553c89[_0x4f80('0x23')]},'raw':!![]});}return null;})[_0x4f80('0xb')](function(_0x5f34d0){if(_0x553c89[_0x4f80('0x23')][_0x4f80('0x47')]()==_0x4f80('0x4f')){var _0x460071=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config[_0x4f80('0x40')],_0x4f80('0x50')),_0x4f80('0x41'));var _0x46bca5=ejs['render'](_0x460071,{'networks':_0x5f34d0||[]});fs['writeFileSync'](_0x4f80('0x44'),_0x46bca5);return respondWithRpcPromise(_0x4f80('0x45'),'update',{'module':_0x4f80('0x46')});}else if(_0x553c89[_0x4f80('0x23')][_0x4f80('0x47')]()==_0x4f80('0x48')){var _0x41b55e=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config['root'],_0x4f80('0x49')),_0x4f80('0x41'));var _0x2b3ba3=ejs[_0x4f80('0x42')](_0x41b55e,{'networks':_0x5f34d0||[]});fs['writeFileSync'](_0x4f80('0x4a'),_0x2b3ba3);return respondWithRpcPromise('Reload','update',{'module':_0x4f80('0x46')});}else{var _0x449a18=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config['root'],'server/files/templates/network.ejs'),_0x4f80('0x41'));var _0x17ed39=ejs[_0x4f80('0x42')](_0x449a18,{'networks':_0x5f34d0||[]});fs[_0x4f80('0x43')](util[_0x4f80('0x4c')](_0x4f80('0x4d'),_0xaca4ae[_0x4f80('0x3c')][_0x4f80('0x23')][_0x4f80('0x4e')]()),_0x17ed39);return respondWithRpcPromise(_0x4f80('0x45'),'update',{'module':_0x4f80('0x51')});}})['then'](function(_0xc461cf){if(_0xc461cf){return _0x553c89;}return null;})[_0x4f80('0xb')](respondWithResult(_0x44a02e,null))[_0x4f80('0x14')](handleError(_0x44a02e,null));};exports[_0x4f80('0x1d')]=function(_0x578245,_0x380d62){var _0x26430f;return db[_0x4f80('0x21')][_0x4f80('0x3a')]({'where':{'id':_0x578245[_0x4f80('0x37')]['id']}})[_0x4f80('0xb')](function(_0x454975){_0x26430f=_0x454975;return _0x454975;})[_0x4f80('0xb')](handleEntityNotFound(_0x380d62,null))[_0x4f80('0xb')](removeEntity(_0x380d62,null))[_0x4f80('0xb')](function(){if(_0x26430f){return db[_0x4f80('0x21')][_0x4f80('0x3d')]({'where':{'type':_0x26430f[_0x4f80('0x23')]},'raw':!![]});}})['then'](function(_0x51bfd6){if(_0x26430f[_0x4f80('0x23')][_0x4f80('0x47')]()==_0x4f80('0x4f')){var _0x4e21d7=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x4f80('0x41'));var _0x416836=ejs[_0x4f80('0x42')](_0x4e21d7,{'networks':_0x51bfd6||[]});fs[_0x4f80('0x43')](_0x4f80('0x44'),_0x416836);return respondWithRpcPromise('Reload',_0x4f80('0x1d'),{'module':_0x4f80('0x46')});}else if(_0x26430f[_0x4f80('0x23')][_0x4f80('0x47')]()==_0x4f80('0x48')){var _0x6841f7=fs['readFileSync'](path[_0x4f80('0x3f')](config['root'],'server/files/templates/turn_multiple.ejs'),_0x4f80('0x41'));var _0x51986b=ejs[_0x4f80('0x42')](_0x6841f7,{'networks':_0x51bfd6||[]});fs[_0x4f80('0x43')]('/etc/asterisk/turn_xcally.conf',_0x51986b);return respondWithRpcPromise(_0x4f80('0x45'),_0x4f80('0x1d'),{'module':'res_stun_monitor.so'});}else{var _0x75ab5b=fs[_0x4f80('0x3e')](path[_0x4f80('0x3f')](config[_0x4f80('0x40')],_0x4f80('0x4b')),_0x4f80('0x41'));var _0x546f31=ejs[_0x4f80('0x42')](_0x75ab5b,{'networks':_0x51bfd6||[]});fs['writeFileSync'](util[_0x4f80('0x4c')]('/etc/asterisk/sip_xcally_%s.conf',_0x26430f[_0x4f80('0x23')][_0x4f80('0x4e')]()),_0x546f31);return respondWithRpcPromise(_0x4f80('0x45'),'destroy',{'module':'chan_sip.so'});}})[_0x4f80('0x14')](handleError(_0x380d62,null));};
\ No newline at end of file
+var _0xc6fa=['offset','undefined','limit','count','status','Content-Range','update','destroy','end','sendStatus','name','send','map','rawAttributes','fieldName','key','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','params','Network','keys','find','create','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','findAll','server/files/templates/stun_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','util','path','ejs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','json'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0xc6fa,0x90));var _0xac6f=function(_0x4df6f9,_0x44bd65){_0x4df6f9=_0x4df6f9-0x0;var _0x4b1a73=_0xc6fa[_0x4df6f9];return _0x4b1a73;};'use strict';var util=require(_0xac6f('0x0'));var path=require(_0xac6f('0x1'));var ejs=require(_0xac6f('0x2'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0xac6f('0x3'))(_0xac6f('0x4'));var config=require(_0xac6f('0x5'));var db=require(_0xac6f('0x6'))['db'];var jayson=require(_0xac6f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5abc67,_0x549ef6,_0x2c7e15,_0x5c8849){return new Promise(function(_0x4348a5,_0x324d53){var _0x26f4cf=_0x5c8849||client;return _0x26f4cf[_0xac6f('0x8')](_0x5abc67,_0x2c7e15)[_0xac6f('0x9')](function(_0x7f0e8d){logger[_0xac6f('0xa')](_0xac6f('0xb'),_0x549ef6,_0xac6f('0xc'));logger[_0xac6f('0xd')](_0xac6f('0xe'),_0x549ef6,_0xac6f('0xc'),JSON[_0xac6f('0xf')](_0x7f0e8d));if(_0x7f0e8d['error']){if(_0x7f0e8d[_0xac6f('0x10')][_0xac6f('0x11')]===0x1f4){logger['error'](_0xac6f('0xb'),_0x549ef6,_0x7f0e8d['error'][_0xac6f('0x12')]);return _0x324d53(_0x7f0e8d[_0xac6f('0x10')][_0xac6f('0x12')]);}logger[_0xac6f('0x10')](_0xac6f('0xb'),_0x549ef6,_0x7f0e8d['error']['message']);return _0x4348a5(_0x7f0e8d[_0xac6f('0x10')][_0xac6f('0x12')]);}else{logger[_0xac6f('0xa')](_0xac6f('0xb'),_0x549ef6,_0xac6f('0xc'));_0x4348a5(_0x7f0e8d[_0xac6f('0x13')][_0xac6f('0x12')]);}})[_0xac6f('0x14')](function(_0x2db1bb){logger['error'](_0xac6f('0xb'),_0x549ef6,_0x2db1bb);_0x324d53(_0x2db1bb);});});}function respondWithResult(_0x352f2c,_0x4b2bdf){_0x4b2bdf=_0x4b2bdf||0xc8;return function(_0x498f18){if(_0x498f18){return _0x352f2c['status'](_0x4b2bdf)[_0xac6f('0x15')](_0x498f18);}};}function respondWithFilteredResult(_0x10b294,_0x4f2a1a){return function(_0x53c37e){if(_0x53c37e){var _0x69b8b5=typeof _0x4f2a1a[_0xac6f('0x16')]===_0xac6f('0x17')&&typeof _0x4f2a1a[_0xac6f('0x18')]===_0xac6f('0x17');var _0x54750b=_0x53c37e[_0xac6f('0x19')];var _0x237f97=_0x69b8b5?0x0:_0x4f2a1a[_0xac6f('0x16')];var _0xae695f=_0x69b8b5?_0x53c37e[_0xac6f('0x19')]:_0x4f2a1a[_0xac6f('0x16')]+_0x4f2a1a[_0xac6f('0x18')];var _0x3125a0;if(_0xae695f>=_0x54750b){_0xae695f=_0x54750b;_0x3125a0=0xc8;}else{_0x3125a0=0xce;}_0x10b294[_0xac6f('0x1a')](_0x3125a0);return _0x10b294['set'](_0xac6f('0x1b'),_0x237f97+'-'+_0xae695f+'/'+_0x54750b)[_0xac6f('0x15')](_0x53c37e);}return null;};}function saveUpdates(_0x5debc7){return function(_0x4d00ac){if(_0x4d00ac){return _0x4d00ac[_0xac6f('0x1c')](_0x5debc7)['then'](function(_0x3632f0){return _0x3632f0;});}return null;};}function removeEntity(_0xc2457a){return function(_0x4b0916){if(_0x4b0916){return _0x4b0916[_0xac6f('0x1d')]()[_0xac6f('0x9')](function(){_0xc2457a[_0xac6f('0x1a')](0xcc)[_0xac6f('0x1e')]();});}};}function handleEntityNotFound(_0x118abb){return function(_0xf8c02c){if(!_0xf8c02c){_0x118abb[_0xac6f('0x1f')](0x194);}return _0xf8c02c;};}function handleError(_0x10a4bb,_0x15c71f){_0x15c71f=_0x15c71f||0x1f4;return function(_0xaccc26){logger[_0xac6f('0x10')](_0xaccc26['stack']);if(_0xaccc26['name']){delete _0xaccc26[_0xac6f('0x20')];}_0x10a4bb[_0xac6f('0x1a')](_0x15c71f)[_0xac6f('0x21')](_0xaccc26);};}exports['index']=function(_0x3815fa,_0x4a8dec){var _0x565140={},_0x33e9e5={},_0x347f8f={'count':0x0,'rows':[]};var _0x50c57e=_[_0xac6f('0x22')](db['Network'][_0xac6f('0x23')],function(_0x3d84b6){return{'name':_0x3d84b6[_0xac6f('0x24')],'type':_0x3d84b6['type'][_0xac6f('0x25')]};});_0x33e9e5['model']=_[_0xac6f('0x22')](_0x50c57e,'name');_0x33e9e5[_0xac6f('0x26')]=_['keys'](_0x3815fa[_0xac6f('0x26')]);_0x33e9e5[_0xac6f('0x27')]=_['intersection'](_0x33e9e5[_0xac6f('0x28')],_0x33e9e5[_0xac6f('0x26')]);_0x565140[_0xac6f('0x29')]=_[_0xac6f('0x2a')](_0x33e9e5[_0xac6f('0x28')],qs['fields'](_0x3815fa['query'][_0xac6f('0x2b')]));_0x565140[_0xac6f('0x29')]=_0x565140[_0xac6f('0x29')][_0xac6f('0x2c')]?_0x565140[_0xac6f('0x29')]:_0x33e9e5['model'];if(!_0x3815fa[_0xac6f('0x26')][_0xac6f('0x2d')](_0xac6f('0x2e'))){_0x565140[_0xac6f('0x18')]=qs[_0xac6f('0x18')](_0x3815fa['query'][_0xac6f('0x18')]);_0x565140[_0xac6f('0x16')]=qs[_0xac6f('0x16')](_0x3815fa[_0xac6f('0x26')][_0xac6f('0x16')]);}_0x565140['order']=qs['sort'](_0x3815fa[_0xac6f('0x26')][_0xac6f('0x2f')]);_0x565140[_0xac6f('0x30')]=qs[_0xac6f('0x27')](_[_0xac6f('0x31')](_0x3815fa['query'],_0x33e9e5[_0xac6f('0x27')]),_0x50c57e);if(_0x3815fa[_0xac6f('0x26')][_0xac6f('0x32')]){_0x565140['where']=_[_0xac6f('0x33')](_0x565140['where'],{'$or':_[_0xac6f('0x22')](_0x50c57e,function(_0x2e53f6){if(_0x2e53f6[_0xac6f('0x34')]!==_0xac6f('0x35')){var _0x8372d9={};_0x8372d9[_0x2e53f6[_0xac6f('0x20')]]={'$like':'%'+_0x3815fa[_0xac6f('0x26')][_0xac6f('0x32')]+'%'};return _0x8372d9;}})});}_0x565140=_[_0xac6f('0x33')]({},_0x565140,_0x3815fa[_0xac6f('0x36')]);var _0x3e9403={'where':_0x565140[_0xac6f('0x30')]};return db['Network'][_0xac6f('0x19')](_0x3e9403)[_0xac6f('0x9')](function(_0x1f5e52){_0x347f8f[_0xac6f('0x19')]=_0x1f5e52;if(_0x3815fa[_0xac6f('0x26')][_0xac6f('0x37')]){_0x565140['include']=[{'all':!![]}];}return db['Network']['findAll'](_0x565140);})['then'](function(_0x198748){_0x347f8f['rows']=_0x198748;return _0x347f8f;})[_0xac6f('0x9')](respondWithFilteredResult(_0x4a8dec,_0x565140))[_0xac6f('0x14')](handleError(_0x4a8dec,null));};exports['show']=function(_0x542d0a,_0x48c1aa){var _0x309c4b={'raw':!![],'where':{'id':_0x542d0a[_0xac6f('0x38')]['id']}},_0x15a1a2={};_0x15a1a2[_0xac6f('0x28')]=_['keys'](db[_0xac6f('0x39')]['rawAttributes']);_0x15a1a2[_0xac6f('0x26')]=_[_0xac6f('0x3a')](_0x542d0a[_0xac6f('0x26')]);_0x15a1a2[_0xac6f('0x27')]=_['intersection'](_0x15a1a2[_0xac6f('0x28')],_0x15a1a2[_0xac6f('0x26')]);_0x309c4b[_0xac6f('0x29')]=_[_0xac6f('0x2a')](_0x15a1a2[_0xac6f('0x28')],qs['fields'](_0x542d0a[_0xac6f('0x26')]['fields']));_0x309c4b[_0xac6f('0x29')]=_0x309c4b[_0xac6f('0x29')][_0xac6f('0x2c')]?_0x309c4b[_0xac6f('0x29')]:_0x15a1a2[_0xac6f('0x28')];if(_0x542d0a['query'][_0xac6f('0x37')]){_0x309c4b['include']=[{'all':!![]}];}_0x309c4b=_[_0xac6f('0x33')]({},_0x309c4b,_0x542d0a[_0xac6f('0x36')]);return db[_0xac6f('0x39')][_0xac6f('0x3b')](_0x309c4b)['then'](handleEntityNotFound(_0x48c1aa,null))['then'](respondWithResult(_0x48c1aa,null))[_0xac6f('0x14')](handleError(_0x48c1aa,null));};exports[_0xac6f('0x3c')]=function(_0x4a2a5b,_0x5aa0ea){var _0x3b6dfc;return db['Network']['create'](_0x4a2a5b[_0xac6f('0x3d')],{'raw':!![]})['then'](function(_0x577ae6){_0x3b6dfc=_0x577ae6;return db[_0xac6f('0x39')]['findAll']({'where':{'type':_0x4a2a5b['body'][_0xac6f('0x34')]},'raw':!![]});})['then'](function(_0x385d74){if(_0x3b6dfc[_0xac6f('0x34')][_0xac6f('0x3e')]()==_0xac6f('0x3f')){var _0x5f4fa6=fs[_0xac6f('0x40')](path[_0xac6f('0x41')](config[_0xac6f('0x42')],'server/files/templates/stun_multiple.ejs'),_0xac6f('0x43'));var _0x2a1ee3=ejs[_0xac6f('0x44')](_0x5f4fa6,{'networks':_0x385d74||[]});fs[_0xac6f('0x45')](_0xac6f('0x46'),_0x2a1ee3);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x3c'),{'module':_0xac6f('0x48')});}else if(_0x3b6dfc[_0xac6f('0x34')][_0xac6f('0x3e')]()==_0xac6f('0x49')){var _0x1969a0=fs[_0xac6f('0x40')](path[_0xac6f('0x41')](config[_0xac6f('0x42')],_0xac6f('0x4a')),_0xac6f('0x43'));var _0x1d8543=ejs[_0xac6f('0x44')](_0x1969a0,{'networks':_0x385d74||[]});fs[_0xac6f('0x45')]('/etc/asterisk/turn_xcally.conf',_0x1d8543);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x3c'),{'module':_0xac6f('0x48')});}else{var _0x862169=fs[_0xac6f('0x40')](path['join'](config[_0xac6f('0x42')],_0xac6f('0x4b')),'utf8');var _0x5710e2=ejs['render'](_0x862169,{'networks':_0x385d74||[]});fs['writeFileSync'](util['format'](_0xac6f('0x4c'),_0x4a2a5b['body']['type'][_0xac6f('0x4d')]()),_0x5710e2);return respondWithRpcPromise('Reload',_0xac6f('0x3c'),{'module':_0xac6f('0x4e')});}})[_0xac6f('0x9')](function(){return _0x3b6dfc;})['then'](respondWithResult(_0x5aa0ea,0xc9))[_0xac6f('0x14')](handleError(_0x5aa0ea,null));};exports['update']=function(_0xe84561,_0x1b5424){var _0x3524b7;return db[_0xac6f('0x39')][_0xac6f('0x3b')]({'where':{'id':_0xe84561[_0xac6f('0x38')]['id']}})[_0xac6f('0x9')](handleEntityNotFound(_0x1b5424,null))[_0xac6f('0x9')](saveUpdates(_0xe84561['body'],null))[_0xac6f('0x9')](function(_0x511274){if(_0x511274){_0x3524b7=_0x511274;return db[_0xac6f('0x39')][_0xac6f('0x4f')]({'where':{'type':_0x3524b7[_0xac6f('0x34')]},'raw':!![]});}return null;})[_0xac6f('0x9')](function(_0x2fd5d7){if(_0x3524b7['type'][_0xac6f('0x3e')]()=='STUN'){var _0x59bdef=fs['readFileSync'](path[_0xac6f('0x41')](config[_0xac6f('0x42')],_0xac6f('0x50')),_0xac6f('0x43'));var _0x4d01b8=ejs['render'](_0x59bdef,{'networks':_0x2fd5d7||[]});fs['writeFileSync'](_0xac6f('0x46'),_0x4d01b8);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x1c'),{'module':_0xac6f('0x48')});}else if(_0x3524b7[_0xac6f('0x34')][_0xac6f('0x3e')]()==_0xac6f('0x49')){var _0x401f97=fs[_0xac6f('0x40')](path[_0xac6f('0x41')](config['root'],_0xac6f('0x4a')),_0xac6f('0x43'));var _0x104580=ejs[_0xac6f('0x44')](_0x401f97,{'networks':_0x2fd5d7||[]});fs[_0xac6f('0x45')](_0xac6f('0x51'),_0x104580);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x1c'),{'module':_0xac6f('0x48')});}else{var _0x2f1642=fs['readFileSync'](path['join'](config[_0xac6f('0x42')],'server/files/templates/network.ejs'),'utf8');var _0x6a2307=ejs[_0xac6f('0x44')](_0x2f1642,{'networks':_0x2fd5d7||[]});fs[_0xac6f('0x45')](util[_0xac6f('0x52')]('/etc/asterisk/sip_xcally_%s.conf',_0xe84561['body'][_0xac6f('0x34')][_0xac6f('0x4d')]()),_0x6a2307);return respondWithRpcPromise(_0xac6f('0x47'),'update',{'module':'chan_sip.so'});}})[_0xac6f('0x9')](function(_0x5ec7a5){if(_0x5ec7a5){return _0x3524b7;}return null;})['then'](respondWithResult(_0x1b5424,null))[_0xac6f('0x14')](handleError(_0x1b5424,null));};exports['destroy']=function(_0x57e162,_0x5bbaa6){var _0x130f1e;return db[_0xac6f('0x39')][_0xac6f('0x3b')]({'where':{'id':_0x57e162['params']['id']}})[_0xac6f('0x9')](function(_0x5b9117){_0x130f1e=_0x5b9117;return _0x5b9117;})['then'](handleEntityNotFound(_0x5bbaa6,null))[_0xac6f('0x9')](removeEntity(_0x5bbaa6,null))[_0xac6f('0x9')](function(){if(_0x130f1e){return db[_0xac6f('0x39')][_0xac6f('0x4f')]({'where':{'type':_0x130f1e['type']},'raw':!![]});}})['then'](function(_0x5901e2){if(_0x130f1e['type'][_0xac6f('0x3e')]()==_0xac6f('0x3f')){var _0x52c8f7=fs[_0xac6f('0x40')](path['join'](config['root'],_0xac6f('0x50')),'utf8');var _0x563926=ejs[_0xac6f('0x44')](_0x52c8f7,{'networks':_0x5901e2||[]});fs[_0xac6f('0x45')](_0xac6f('0x46'),_0x563926);return respondWithRpcPromise(_0xac6f('0x47'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x130f1e[_0xac6f('0x34')][_0xac6f('0x3e')]()==_0xac6f('0x49')){var _0x5c2084=fs['readFileSync'](path[_0xac6f('0x41')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x491767=ejs['render'](_0x5c2084,{'networks':_0x5901e2||[]});fs[_0xac6f('0x45')](_0xac6f('0x51'),_0x491767);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x1d'),{'module':_0xac6f('0x48')});}else{var _0x2299ad=fs[_0xac6f('0x40')](path[_0xac6f('0x41')](config[_0xac6f('0x42')],'server/files/templates/network.ejs'),_0xac6f('0x43'));var _0x355357=ejs[_0xac6f('0x44')](_0x2299ad,{'networks':_0x5901e2||[]});fs['writeFileSync'](util[_0xac6f('0x52')](_0xac6f('0x4c'),_0x130f1e[_0xac6f('0x34')]['toLowerCase']()),_0x355357);return respondWithRpcPromise(_0xac6f('0x47'),_0xac6f('0x1d'),{'module':_0xac6f('0x4e')});}})[_0xac6f('0x14')](handleError(_0x5bbaa6,null));};
\ No newline at end of file
index 06c589f..00a7f07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb469=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xb469,0x13b));var _0x9b46=function(_0x111639,_0xca4344){_0x111639=_0x111639-0x0;var _0x30ad0f=_0xb469[_0x111639];return _0x30ad0f;};'use strict';var _=require(_0x9b46('0x0'));var util=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var moment=require(_0x9b46('0x4'));var BPromise=require(_0x9b46('0x5'));var rp=require(_0x9b46('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b46('0x7'));var config=require(_0x9b46('0x8'));var attributes=require('./network.attributes');module[_0x9b46('0x9')]=function(_0x405d1c,_0x50b49e){return _0x405d1c[_0x9b46('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2bb0=['exports','define','Network','lodash','util','../../config/logger','moment','path','../../config/environment','./network.attributes'];(function(_0x46a643,_0x1984c2){var _0xb7334e=function(_0x4f77bc){while(--_0x4f77bc){_0x46a643['push'](_0x46a643['shift']());}};_0xb7334e(++_0x1984c2);}(_0x2bb0,0xf3));var _0x02bb=function(_0x7cad11,_0x159b93){_0x7cad11=_0x7cad11-0x0;var _0x4818f6=_0x2bb0[_0x7cad11];return _0x4818f6;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var logger=require(_0x02bb('0x2'))('api');var moment=require(_0x02bb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x02bb('0x4'));var rimraf=require('rimraf');var config=require(_0x02bb('0x5'));var attributes=require(_0x02bb('0x6'));module[_0x02bb('0x7')]=function(_0x390ff7,_0x43dbb7){return _0x390ff7[_0x02bb('0x8')](_0x02bb('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2b5d908..2d68efa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x1b21ce,_0x5391d5){_0x1b21ce=_0x1b21ce-0x0;var _0xa75b17=_0x7a54[_0x1b21ce];return _0xa75b17;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4c47f9,_0x4daa38){var _0x3f44d4=function(_0x4a391d){while(--_0x4a391d){_0x4c47f9['push'](_0x4c47f9['shift']());}};_0x3f44d4(++_0x4daa38);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}
\ No newline at end of file
index da27b51..be872fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2266=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','show','/:id/dispositions','/:id/canned_answers','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','addAgents','send','/:id','update','delete','destroy','removeDispositions','removeAgents','util','path'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x2266,0x1c5));var _0x6226=function(_0x3f72e,_0x348df0){_0x3f72e=_0x3f72e-0x0;var _0x1c83b7=_0x2266[_0x3f72e];return _0x1c83b7;};'use strict';var multer=require('multer');var util=require(_0x6226('0x0'));var path=require(_0x6226('0x1'));var timeout=require(_0x6226('0x2'));var express=require(_0x6226('0x3'));var router=express[_0x6226('0x4')]();var fs_extra=require(_0x6226('0x5'));var auth=require(_0x6226('0x6'));var interaction=require(_0x6226('0x7'));var config=require(_0x6226('0x8'));var controller=require('./openchannelAccount.controller');router[_0x6226('0x9')]('/',auth[_0x6226('0xa')](),controller['index']);router['get'](_0x6226('0xb'),auth[_0x6226('0xa')](),controller['describe']);router[_0x6226('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x6226('0xc')]);router[_0x6226('0x9')](_0x6226('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x6226('0x9')](_0x6226('0xe'),auth[_0x6226('0xa')](),controller['getAnswers']);router[_0x6226('0x9')]('/:id/applications',auth[_0x6226('0xa')](),controller[_0x6226('0xf')]);router[_0x6226('0x9')](_0x6226('0x10'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x6226('0x9')](_0x6226('0x11'),auth[_0x6226('0xa')](),controller[_0x6226('0x12')]);router[_0x6226('0x13')]('/',auth[_0x6226('0xa')](),controller[_0x6226('0x14')]);router[_0x6226('0x13')](_0x6226('0xd'),auth[_0x6226('0xa')](),controller[_0x6226('0x15')]);router[_0x6226('0x13')](_0x6226('0xe'),auth['isAuthenticated'](),controller[_0x6226('0x16')]);router['post'](_0x6226('0x17'),controller[_0x6226('0x18')]);router[_0x6226('0x13')](_0x6226('0x19'),auth['isAuthenticated'](),controller[_0x6226('0x1a')]);router[_0x6226('0x13')](_0x6226('0x11'),auth[_0x6226('0xa')](),controller[_0x6226('0x1b')]);router[_0x6226('0x13')]('/:id/send',auth['isAuthenticated'](),controller[_0x6226('0x1c')]);router['put'](_0x6226('0x1d'),auth[_0x6226('0xa')](),controller[_0x6226('0x1e')]);router[_0x6226('0x1f')](_0x6226('0x1d'),auth[_0x6226('0xa')](),controller[_0x6226('0x20')]);router[_0x6226('0x1f')](_0x6226('0xd'),auth[_0x6226('0xa')](),controller[_0x6226('0x21')]);router['delete'](_0x6226('0xe'),auth[_0x6226('0xa')](),controller['removeAnswers']);router[_0x6226('0x1f')](_0x6226('0x11'),auth[_0x6226('0xa')](),controller[_0x6226('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0xd53c=['/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','/:id/users','multer','util','path','express','Router','fs-extra','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index'];(function(_0x1e16fa,_0x31d4dc){var _0x10a236=function(_0x45ea63){while(--_0x45ea63){_0x1e16fa['push'](_0x1e16fa['shift']());}};_0x10a236(++_0x31d4dc);}(_0xd53c,0x14b));var _0xcd53=function(_0x160bcf,_0x5dbeb6){_0x160bcf=_0x160bcf-0x0;var _0x454716=_0xd53c[_0x160bcf];return _0x454716;};'use strict';var multer=require(_0xcd53('0x0'));var util=require(_0xcd53('0x1'));var path=require(_0xcd53('0x2'));var timeout=require('connect-timeout');var express=require(_0xcd53('0x3'));var router=express[_0xcd53('0x4')]();var fs_extra=require(_0xcd53('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xcd53('0x6'));var controller=require(_0xcd53('0x7'));router[_0xcd53('0x8')]('/',auth[_0xcd53('0x9')](),controller[_0xcd53('0xa')]);router[_0xcd53('0x8')](_0xcd53('0xb'),auth[_0xcd53('0x9')](),controller['describe']);router[_0xcd53('0x8')](_0xcd53('0xc'),auth['isAuthenticated'](),controller[_0xcd53('0xd')]);router[_0xcd53('0x8')](_0xcd53('0xe'),auth[_0xcd53('0x9')](),controller[_0xcd53('0xf')]);router['get'](_0xcd53('0x10'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x11')]);router['get'](_0xcd53('0x12'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x13')]);router[_0xcd53('0x8')](_0xcd53('0x14'),auth[_0xcd53('0x9')](),controller['getInteractions']);router[_0xcd53('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xcd53('0x15')]('/',auth[_0xcd53('0x9')](),controller[_0xcd53('0x16')]);router[_0xcd53('0x15')]('/:id/dispositions',auth[_0xcd53('0x9')](),controller[_0xcd53('0x17')]);router[_0xcd53('0x15')](_0xcd53('0x10'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x18')]);router['post'](_0xcd53('0x19'),controller[_0xcd53('0x1a')]);router['post'](_0xcd53('0x12'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x1b')]);router[_0xcd53('0x15')]('/:id/users',auth[_0xcd53('0x9')](),controller[_0xcd53('0x1c')]);router[_0xcd53('0x15')](_0xcd53('0x1d'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x1e')]);router[_0xcd53('0x1f')]('/:id',auth[_0xcd53('0x9')](),controller[_0xcd53('0x20')]);router[_0xcd53('0x21')]('/:id',auth[_0xcd53('0x9')](),controller[_0xcd53('0x22')]);router[_0xcd53('0x21')](_0xcd53('0xe'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x23')]);router[_0xcd53('0x21')](_0xcd53('0x10'),auth[_0xcd53('0x9')](),controller[_0xcd53('0x24')]);router[_0xcd53('0x21')](_0xcd53('0x25'),auth[_0xcd53('0x9')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 43cdfb8..59dbec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92fd=['setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','generate','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x299089,_0x3cff81){var _0x11c91f=function(_0x3e135b){while(--_0x3e135b){_0x299089['push'](_0x299089['shift']());}};_0x11c91f(++_0x3cff81);}(_0x92fd,0x1ca));var _0xd92f=function(_0x41648f,_0x4a8936){_0x41648f=_0x41648f-0x0;var _0x20340a=_0x92fd[_0x41648f];return _0x20340a;};'use strict';var Sequelize=require(_0xd92f('0x0'));var rs=require('randomstring');module[_0xd92f('0x1')]={'name':{'type':Sequelize[_0xd92f('0x2')],'unique':_0xd92f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd92f('0x2')]},'token':{'type':Sequelize[_0xd92f('0x2')],'defaultValue':function(){return rs[_0xd92f('0x4')]();}},'replyUri':{'type':Sequelize[_0xd92f('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd92f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd92f('0x5');}},'notificationSound':{'type':Sequelize[_0xd92f('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd92f('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd92f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd92f('0x2')]},'queueTransfer':{'type':Sequelize[_0xd92f('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd92f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd92f('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd92f('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xd92f('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xd92f('0x6')],'defaultValue':![],'comment':_0xd92f('0x9'),'set':function(_0x2ff4da){if(!_0x2ff4da)this[_0xd92f('0xa')]('mandatoryDispositionPauseId',null);this[_0xd92f('0xa')](_0xd92f('0xb'),_0x2ff4da);}}};
\ No newline at end of file
+var _0xe300=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x3fb5f9,_0xa4c2d9){var _0x541745=function(_0x4faa48){while(--_0x4faa48){_0x3fb5f9['push'](_0x3fb5f9['shift']());}};_0x541745(++_0xa4c2d9);}(_0xe300,0x80));var _0x0e30=function(_0xec707d,_0x4396bb){_0xec707d=_0xec707d-0x0;var _0x445025=_0xe300[_0xec707d];return _0x445025;};'use strict';var Sequelize=require(_0x0e30('0x0'));var rs=require(_0x0e30('0x1'));module['exports']={'name':{'type':Sequelize[_0x0e30('0x2')],'unique':_0x0e30('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0e30('0x2')]},'token':{'type':Sequelize[_0x0e30('0x2')],'defaultValue':function(){return rs[_0x0e30('0x4')]();}},'replyUri':{'type':Sequelize[_0x0e30('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0e30('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0e30('0x5')],'defaultValue':function(){return _0x0e30('0x6');}},'notificationSound':{'type':Sequelize[_0x0e30('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0e30('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0e30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0e30('0x2')]},'queueTransfer':{'type':Sequelize[_0x0e30('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0e30('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0e30('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0e30('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x0e30('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x0e30('0x7')],'defaultValue':![],'comment':_0x0e30('0xa'),'set':function(_0x10e078){if(!_0x10e078)this[_0x0e30('0xb')](_0x0e30('0xc'),null);this['setDataValue'](_0x0e30('0xd'),_0x10e078);}}};
\ No newline at end of file
index b44595d..da7ed8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc9d=['Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','DESC','out','spread','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','reject','update','then','OpenchannelAccounts','UserProfileResource','stack','name','send','map','OpenchannelAccount','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','filter','type','VIRTUAL','merge','options','findAll','show','params','mandatoryDispositionPause','intersection','includeAll','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','Disposition','hasOwnProperty','order','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','pick','notify','CmContact','no\x20available\x20attributes','difference','updatedAt','ListId','isNil','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','Contacts','OpenchannelApplication','Applications','List','account','applications','list','orderBy','priority','asc','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','contact','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','findOne','destroy','OpenchannelAccountId','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','internal'];(function(_0x2853c0,_0x5d9c2a){var _0x34a63d=function(_0x55f7a0){while(--_0x55f7a0){_0x2853c0['push'](_0x2853c0['shift']());}};_0x34a63d(++_0x5d9c2a);}(_0xbc9d,0xcc));var _0xdbc9=function(_0x318959,_0x46c97c){_0x318959=_0x318959-0x0;var _0x14508f=_0xbc9d[_0x318959];return _0x14508f;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require('request-promise');var moment=require(_0xdbc9('0x4'));var BPromise=require(_0xdbc9('0x5'));var Mustache=require(_0xdbc9('0x6'));var util=require(_0xdbc9('0x7'));var path=require(_0xdbc9('0x8'));var sox=require('sox');var csv=require(_0xdbc9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require(_0xdbc9('0xc'));var crypto=require('crypto');var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require(_0xdbc9('0x9'));var querystring=require('querystring');var Papa=require(_0xdbc9('0xf'));var Redis=require(_0xdbc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdbc9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdbc9('0x12'));var logger=require('../../config/logger')(_0xdbc9('0x13'));var utils=require(_0xdbc9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdbc9('0x15'));var db=require(_0xdbc9('0x16'))['db'];config['redis']=_[_0xdbc9('0x17')](config[_0xdbc9('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xdbc9('0x19'))(new Redis(config[_0xdbc9('0x18')]));require(_0xdbc9('0x1a'))['register'](socket);var jayson=require(_0xdbc9('0x1b'));var client=jayson[_0xdbc9('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xdbc9('0x1c')][_0xdbc9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4a642d,_0x48b833,_0x538128,_0x3eef2f){return new BPromise(function(_0x3b51b1,_0x1c1b42){var _0x29d83a=_0x3eef2f||client;return _0x29d83a[_0xdbc9('0x1e')](_0x4a642d,_0x538128)['then'](function(_0x165831){logger[_0xdbc9('0x1f')](_0xdbc9('0x20'),_0x48b833,_0xdbc9('0x21'));logger['debug'](_0xdbc9('0x22'),_0x48b833,_0xdbc9('0x21'),JSON[_0xdbc9('0x23')](_0x165831));if(_0x165831[_0xdbc9('0x24')]){if(_0x165831[_0xdbc9('0x24')][_0xdbc9('0x25')]===0x1f4){logger[_0xdbc9('0x24')](_0xdbc9('0x20'),_0x48b833,_0x165831[_0xdbc9('0x24')][_0xdbc9('0x26')]);return _0x1c1b42(_0x165831[_0xdbc9('0x24')][_0xdbc9('0x26')]);}logger[_0xdbc9('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x48b833,_0x165831[_0xdbc9('0x24')][_0xdbc9('0x26')]);return _0x3b51b1(_0x165831[_0xdbc9('0x24')]['message']);}else{logger['info'](_0xdbc9('0x20'),_0x48b833,_0xdbc9('0x21'));_0x3b51b1(_0x165831['result']['message']);}})[_0xdbc9('0x27')](function(_0x2c3e99){logger[_0xdbc9('0x24')](_0xdbc9('0x20'),_0x48b833,_0x2c3e99);_0x1c1b42(_0x2c3e99);});});}function respondWithStatusCode(_0x28d719,_0x465a5e){_0x465a5e=_0x465a5e||0xcc;return function(_0xe5d443){if(_0xe5d443){return _0x28d719[_0xdbc9('0x28')](_0x465a5e);}return _0x28d719['status'](_0x465a5e)[_0xdbc9('0x29')]();};}function respondWithResult(_0x2553ac,_0x4ba13c){_0x4ba13c=_0x4ba13c||0xc8;return function(_0x14ea19){if(_0x14ea19){return _0x2553ac[_0xdbc9('0x2a')](_0x4ba13c)[_0xdbc9('0x2b')](_0x14ea19);}};}function respondWithFilteredResult(_0x4fc4a4,_0x410292){return function(_0x415188){if(_0x415188){var _0x31a11c=typeof _0x410292[_0xdbc9('0x2c')]===_0xdbc9('0x2d')&&typeof _0x410292[_0xdbc9('0x2e')]==='undefined';var _0x2a62bf=_0x415188[_0xdbc9('0x2f')];var _0x7b3eb5=_0x31a11c?0x0:_0x410292[_0xdbc9('0x2c')];var _0x29ba66=_0x31a11c?_0x415188[_0xdbc9('0x2f')]:_0x410292[_0xdbc9('0x2c')]+_0x410292['limit'];var _0x42a9bb;if(_0x29ba66>=_0x2a62bf){_0x29ba66=_0x2a62bf;_0x42a9bb=0xc8;}else{_0x42a9bb=0xce;}_0x4fc4a4[_0xdbc9('0x2a')](_0x42a9bb);return _0x4fc4a4['set'](_0xdbc9('0x30'),_0x7b3eb5+'-'+_0x29ba66+'/'+_0x2a62bf)[_0xdbc9('0x2b')](_0x415188);}return null;};}function patchUpdates(_0x476e66){return function(_0x4a54a0){try{jsonpatch['apply'](_0x4a54a0,_0x476e66,!![]);}catch(_0x37bd48){return BPromise[_0xdbc9('0x31')](_0x37bd48);}return _0x4a54a0['save']();};}function saveUpdates(_0x48b86d,_0x3f01f9){return function(_0x4396c6){if(_0x4396c6){return _0x4396c6[_0xdbc9('0x32')](_0x48b86d)['then'](function(_0x13ce6a){return _0x13ce6a;});}return null;};}function removeEntity(_0x131c55,_0x236a37){return function(_0xe39e74){if(_0xe39e74){return _0xe39e74['destroy']()[_0xdbc9('0x33')](function(){var _0x1274f2=_0xe39e74['get']({'plain':!![]});var _0x53aa6f=_0xdbc9('0x34');return db[_0xdbc9('0x35')]['destroy']({'where':{'type':_0x53aa6f,'resourceId':_0x1274f2['id']}})[_0xdbc9('0x33')](function(){return _0xe39e74;});})[_0xdbc9('0x33')](function(){_0x131c55[_0xdbc9('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5be3,_0x5c54be){return function(_0xef5b6){if(!_0xef5b6){_0x1c5be3[_0xdbc9('0x28')](0x194);}return _0xef5b6;};}function handleError(_0x368148,_0x18e71b){_0x18e71b=_0x18e71b||0x1f4;return function(_0x5194c0){logger[_0xdbc9('0x24')](_0x5194c0[_0xdbc9('0x36')]);if(_0x5194c0[_0xdbc9('0x37')]){delete _0x5194c0['name'];}_0x368148['status'](_0x18e71b)[_0xdbc9('0x38')](_0x5194c0);};}exports['index']=function(_0x2e8ed4,_0x503022){var _0x31c346={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1ec990={},_0x45192f={'count':0x0,'rows':[]};var _0x2ea47f=_[_0xdbc9('0x39')](db[_0xdbc9('0x3a')][_0xdbc9('0x3b')],function(_0xdcf4f2){return{'name':_0xdcf4f2[_0xdbc9('0x3c')],'type':_0xdcf4f2['type'][_0xdbc9('0x3d')]};});_0x1ec990[_0xdbc9('0x3e')]=_['map'](_0x2ea47f,_0xdbc9('0x37'));_0x1ec990[_0xdbc9('0x3f')]=_[_0xdbc9('0x40')](_0x2e8ed4[_0xdbc9('0x3f')]);_0x1ec990[_0xdbc9('0x41')]=_['intersection'](_0x1ec990['model'],_0x1ec990[_0xdbc9('0x3f')]);_0x31c346[_0xdbc9('0x42')]=_['intersection'](_0x1ec990[_0xdbc9('0x3e')],qs[_0xdbc9('0x43')](_0x2e8ed4['query'][_0xdbc9('0x43')]));_0x31c346[_0xdbc9('0x42')]=_0x31c346[_0xdbc9('0x42')][_0xdbc9('0x44')]?_0x31c346[_0xdbc9('0x42')]:_0x1ec990[_0xdbc9('0x3e')];if(!_0x2e8ed4[_0xdbc9('0x3f')]['hasOwnProperty'](_0xdbc9('0x45'))){_0x31c346[_0xdbc9('0x2e')]=qs['limit'](_0x2e8ed4[_0xdbc9('0x3f')][_0xdbc9('0x2e')]);_0x31c346[_0xdbc9('0x2c')]=qs[_0xdbc9('0x2c')](_0x2e8ed4[_0xdbc9('0x3f')][_0xdbc9('0x2c')]);}_0x31c346['order']=qs[_0xdbc9('0x46')](_0x2e8ed4[_0xdbc9('0x3f')][_0xdbc9('0x46')]);_0x31c346[_0xdbc9('0x47')]=qs[_0xdbc9('0x41')](_['pick'](_0x2e8ed4[_0xdbc9('0x3f')],_0x1ec990[_0xdbc9('0x41')]),_0x2ea47f);if(_0x2e8ed4[_0xdbc9('0x3f')][_0xdbc9('0x48')]){_0x31c346['where']=_['merge'](_0x31c346[_0xdbc9('0x47')],{'$or':_[_0xdbc9('0x39')](_0x2ea47f,function(_0x18f7b5){if(_0x18f7b5[_0xdbc9('0x49')]!==_0xdbc9('0x4a')){var _0x2edd42={};_0x2edd42[_0x18f7b5[_0xdbc9('0x37')]]={'$like':'%'+_0x2e8ed4[_0xdbc9('0x3f')][_0xdbc9('0x48')]+'%'};return _0x2edd42;}})});}_0x31c346=_[_0xdbc9('0x4b')]({},_0x31c346,_0x2e8ed4[_0xdbc9('0x4c')]);var _0x4988de={'where':_0x31c346[_0xdbc9('0x47')]};return db['OpenchannelAccount'][_0xdbc9('0x2f')](_0x4988de)[_0xdbc9('0x33')](function(_0x27c7dd){_0x45192f[_0xdbc9('0x2f')]=_0x27c7dd;if(_0x2e8ed4[_0xdbc9('0x3f')]['includeAll']){_0x31c346['include']=[{'all':!![]}];}return db[_0xdbc9('0x3a')][_0xdbc9('0x4d')](_0x31c346);})[_0xdbc9('0x33')](function(_0x44c7cd){_0x45192f['rows']=_0x44c7cd;return _0x45192f;})['then'](respondWithFilteredResult(_0x503022,_0x31c346))['catch'](handleError(_0x503022,null));};exports[_0xdbc9('0x4e')]=function(_0x1d4d4f,_0x26b0dc){var _0x308ea2={'raw':![],'where':{'id':_0x1d4d4f[_0xdbc9('0x4f')]['id']},'include':[{'model':db['Pause'],'as':_0xdbc9('0x50')}]},_0x45741c={};_0x45741c[_0xdbc9('0x3e')]=_[_0xdbc9('0x40')](db[_0xdbc9('0x3a')]['rawAttributes']);_0x45741c[_0xdbc9('0x3f')]=_[_0xdbc9('0x40')](_0x1d4d4f[_0xdbc9('0x3f')]);_0x45741c[_0xdbc9('0x41')]=_[_0xdbc9('0x51')](_0x45741c[_0xdbc9('0x3e')],_0x45741c['query']);_0x308ea2[_0xdbc9('0x42')]=_[_0xdbc9('0x51')](_0x45741c['model'],qs[_0xdbc9('0x43')](_0x1d4d4f[_0xdbc9('0x3f')]['fields']));_0x308ea2[_0xdbc9('0x42')]=_0x308ea2['attributes'][_0xdbc9('0x44')]?_0x308ea2[_0xdbc9('0x42')]:_0x45741c[_0xdbc9('0x3e')];if(_0x1d4d4f['query'][_0xdbc9('0x52')]){_0x308ea2[_0xdbc9('0x53')]=[{'all':!![]}];}_0x308ea2=_[_0xdbc9('0x4b')]({},_0x308ea2,_0x1d4d4f[_0xdbc9('0x4c')]);return db[_0xdbc9('0x3a')]['find'](_0x308ea2)[_0xdbc9('0x33')](handleEntityNotFound(_0x26b0dc,null))[_0xdbc9('0x33')](respondWithResult(_0x26b0dc,null))[_0xdbc9('0x27')](handleError(_0x26b0dc,null));};exports[_0xdbc9('0x54')]=function(_0x5d0d4f,_0x40fa48){return db[_0xdbc9('0x3a')]['create'](_0x5d0d4f['body'],{})['then'](function(_0x30b3c8){var _0x118687=_0x5d0d4f['user']['get']({'plain':!![]});if(!_0x118687)throw new Error(_0xdbc9('0x55'));if(_0x118687[_0xdbc9('0x56')]===_0xdbc9('0x57')){var _0xe2bbab=_0x30b3c8[_0xdbc9('0x58')]({'plain':!![]});var _0x52c8b5=_0xdbc9('0x34');return db[_0xdbc9('0x59')][_0xdbc9('0x5a')]({'where':{'name':_0x52c8b5,'userProfileId':_0x118687[_0xdbc9('0x5b')]},'raw':!![]})[_0xdbc9('0x33')](function(_0x3d8598){if(_0x3d8598&&_0x3d8598[_0xdbc9('0x5c')]===0x0){return db[_0xdbc9('0x35')][_0xdbc9('0x54')]({'name':_0xe2bbab[_0xdbc9('0x37')],'resourceId':_0xe2bbab['id'],'type':_0x3d8598[_0xdbc9('0x37')],'sectionId':_0x3d8598['id']},{})[_0xdbc9('0x33')](function(){return _0x30b3c8;});}else{return _0x30b3c8;}})['catch'](function(_0x3ccd42){logger[_0xdbc9('0x24')](_0xdbc9('0x5d'),_0x3ccd42);throw _0x3ccd42;});}return _0x30b3c8;})[_0xdbc9('0x33')](respondWithResult(_0x40fa48,0xc9))['catch'](handleError(_0x40fa48,null));};exports[_0xdbc9('0x32')]=function(_0x4ba876,_0x3aa0b0){if(_0x4ba876[_0xdbc9('0x5e')]['id']){delete _0x4ba876[_0xdbc9('0x5e')]['id'];}return db['OpenchannelAccount'][_0xdbc9('0x5a')]({'where':{'id':_0x4ba876[_0xdbc9('0x4f')]['id']},'include':[{'model':db[_0xdbc9('0x5f')],'as':'mandatoryDispositionPause'}]})[_0xdbc9('0x33')](handleEntityNotFound(_0x3aa0b0,null))[_0xdbc9('0x33')](saveUpdates(_0x4ba876['body'],null))['then'](respondWithResult(_0x3aa0b0,null))[_0xdbc9('0x27')](handleError(_0x3aa0b0,null));};exports['destroy']=function(_0x26a9de,_0x31cd9c){return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x26a9de[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x31cd9c,null))[_0xdbc9('0x33')](removeEntity(_0x31cd9c,null))[_0xdbc9('0x27')](handleError(_0x31cd9c,null));};exports[_0xdbc9('0x60')]=function(_0x2cf32d,_0x27593e){return db['OpenchannelAccount'][_0xdbc9('0x60')]()[_0xdbc9('0x33')](respondWithResult(_0x27593e,null))[_0xdbc9('0x27')](handleError(_0x27593e,null));};exports[_0xdbc9('0x61')]=function(_0x4a7cb5,_0x4276df,_0x4c6d6b){if(_0x4a7cb5[_0xdbc9('0x5e')]['id']){delete _0x4a7cb5[_0xdbc9('0x5e')]['id'];}return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x4a7cb5['params']['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x4276df,null))[_0xdbc9('0x33')](function(_0x53b769){if(_0x53b769){_0x4a7cb5[_0xdbc9('0x5e')]['OpenchannelAccountId']=_0x53b769['id'];return db[_0xdbc9('0x62')][_0xdbc9('0x54')](_0x4a7cb5['body']);}})[_0xdbc9('0x33')](respondWithResult(_0x4276df,null))[_0xdbc9('0x27')](handleError(_0x4276df,null));};exports['getDispositions']=function(_0x513cd9,_0x263e05,_0x3607dc){var _0x10e747={'raw':![],'where':{}};var _0x5801bd={};var _0x51f404={'count':0x0,'rows':[]};return db[_0xdbc9('0x3a')]['findOne']({'where':{'id':_0x513cd9[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x263e05,null))[_0xdbc9('0x33')](function(_0x2a62a6){if(_0x2a62a6){_0x5801bd['model']=_[_0xdbc9('0x40')](db[_0xdbc9('0x62')][_0xdbc9('0x3b')]);_0x5801bd[_0xdbc9('0x3f')]=_['keys'](_0x513cd9[_0xdbc9('0x3f')]);_0x5801bd[_0xdbc9('0x41')]=_[_0xdbc9('0x51')](_0x5801bd[_0xdbc9('0x3e')],_0x5801bd[_0xdbc9('0x3f')]);_0x10e747[_0xdbc9('0x42')]=_[_0xdbc9('0x51')](_0x5801bd[_0xdbc9('0x3e')],qs['fields'](_0x513cd9['query'][_0xdbc9('0x43')]));_0x10e747['attributes']=_0x10e747['attributes'][_0xdbc9('0x44')]?_0x10e747[_0xdbc9('0x42')]:_0x5801bd[_0xdbc9('0x3e')];if(!_0x513cd9[_0xdbc9('0x3f')][_0xdbc9('0x63')](_0xdbc9('0x45'))){_0x10e747['limit']=qs['limit'](_0x513cd9['query'][_0xdbc9('0x2e')]);_0x10e747[_0xdbc9('0x2c')]=qs[_0xdbc9('0x2c')](_0x513cd9['query'][_0xdbc9('0x2c')]);}_0x10e747[_0xdbc9('0x64')]=qs[_0xdbc9('0x46')](_0x513cd9[_0xdbc9('0x3f')][_0xdbc9('0x46')]);_0x10e747['where']=qs['filters'](_['pick'](_0x513cd9['query'],_0x5801bd['filters']));_0x10e747[_0xdbc9('0x47')]['OpenchannelAccountId']=_0x2a62a6['id'];if(_0x513cd9[_0xdbc9('0x3f')][_0xdbc9('0x48')]){_0x10e747[_0xdbc9('0x47')]=_['merge'](_0x10e747[_0xdbc9('0x47')],{'$or':_[_0xdbc9('0x39')](_0x10e747['attributes'],function(_0x5b50df){var _0x5c1e5d={};_0x5c1e5d[_0x5b50df]={'$like':'%'+_0x513cd9['query'][_0xdbc9('0x48')]+'%'};return _0x5c1e5d;})});}_0x10e747=_[_0xdbc9('0x4b')]({},_0x10e747,_0x513cd9[_0xdbc9('0x4c')]);return db[_0xdbc9('0x62')][_0xdbc9('0x2f')]({'where':_0x10e747['where']})[_0xdbc9('0x33')](function(_0x47490b){_0x51f404[_0xdbc9('0x2f')]=_0x47490b;if(_0x513cd9[_0xdbc9('0x3f')][_0xdbc9('0x52')]){_0x10e747[_0xdbc9('0x53')]=[{'all':!![]}];}return db[_0xdbc9('0x62')][_0xdbc9('0x4d')](_0x10e747);})[_0xdbc9('0x33')](function(_0x162c9c){_0x51f404[_0xdbc9('0x65')]=_0x162c9c;return _0x51f404;});}})[_0xdbc9('0x33')](respondWithFilteredResult(_0x263e05,_0x10e747))[_0xdbc9('0x27')](handleError(_0x263e05,null));};exports[_0xdbc9('0x66')]=function(_0x3a2cba,_0x39345e,_0x159cea){return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x3a2cba[_0xdbc9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x39345e,null))[_0xdbc9('0x33')](function(_0x582152){if(_0x582152){return _0x582152[_0xdbc9('0x66')](_0x3a2cba[_0xdbc9('0x3f')][_0xdbc9('0x67')]);}})['then'](respondWithStatusCode(_0x39345e,null))[_0xdbc9('0x27')](handleError(_0x39345e,null));};exports[_0xdbc9('0x68')]=function(_0x483e6c,_0x14cd51,_0x640ebe){if(_0x483e6c[_0xdbc9('0x5e')]['id']){delete _0x483e6c['body']['id'];}return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x483e6c[_0xdbc9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x14cd51,null))[_0xdbc9('0x33')](function(_0x2161bd){if(_0x2161bd){_0x483e6c[_0xdbc9('0x5e')]['OpenchannelAccountId']=_0x2161bd['id'];return db[_0xdbc9('0x69')][_0xdbc9('0x54')](_0x483e6c['body']);}})[_0xdbc9('0x33')](respondWithResult(_0x14cd51,null))[_0xdbc9('0x27')](handleError(_0x14cd51,null));};exports[_0xdbc9('0x6a')]=function(_0x3f6462,_0x18ecec,_0x3b304d){var _0x47bac6={'raw':![],'where':{}};var _0x4192e4={};var _0x377bf8={'count':0x0,'rows':[]};return db[_0xdbc9('0x3a')]['findOne']({'where':{'id':_0x3f6462[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x18ecec,null))[_0xdbc9('0x33')](function(_0x3a9d05){if(_0x3a9d05){_0x4192e4[_0xdbc9('0x3e')]=_[_0xdbc9('0x40')](db[_0xdbc9('0x69')][_0xdbc9('0x3b')]);_0x4192e4[_0xdbc9('0x3f')]=_[_0xdbc9('0x40')](_0x3f6462[_0xdbc9('0x3f')]);_0x4192e4[_0xdbc9('0x41')]=_[_0xdbc9('0x51')](_0x4192e4['model'],_0x4192e4['query']);_0x47bac6[_0xdbc9('0x42')]=_[_0xdbc9('0x51')](_0x4192e4[_0xdbc9('0x3e')],qs[_0xdbc9('0x43')](_0x3f6462[_0xdbc9('0x3f')][_0xdbc9('0x43')]));_0x47bac6['attributes']=_0x47bac6[_0xdbc9('0x42')][_0xdbc9('0x44')]?_0x47bac6[_0xdbc9('0x42')]:_0x4192e4[_0xdbc9('0x3e')];if(!_0x3f6462[_0xdbc9('0x3f')]['hasOwnProperty'](_0xdbc9('0x45'))){_0x47bac6[_0xdbc9('0x2e')]=qs[_0xdbc9('0x2e')](_0x3f6462['query'][_0xdbc9('0x2e')]);_0x47bac6[_0xdbc9('0x2c')]=qs[_0xdbc9('0x2c')](_0x3f6462[_0xdbc9('0x3f')][_0xdbc9('0x2c')]);}_0x47bac6[_0xdbc9('0x64')]=qs['sort'](_0x3f6462['query'][_0xdbc9('0x46')]);_0x47bac6[_0xdbc9('0x47')]=qs['filters'](_[_0xdbc9('0x6b')](_0x3f6462[_0xdbc9('0x3f')],_0x4192e4[_0xdbc9('0x41')]));_0x47bac6['where']['OpenchannelAccountId']=_0x3a9d05['id'];if(_0x3f6462[_0xdbc9('0x3f')]['filter']){_0x47bac6[_0xdbc9('0x47')]=_[_0xdbc9('0x4b')](_0x47bac6['where'],{'$or':_[_0xdbc9('0x39')](_0x47bac6[_0xdbc9('0x42')],function(_0x3e3eec){var _0x41863a={};_0x41863a[_0x3e3eec]={'$like':'%'+_0x3f6462[_0xdbc9('0x3f')][_0xdbc9('0x48')]+'%'};return _0x41863a;})});}_0x47bac6=_[_0xdbc9('0x4b')]({},_0x47bac6,_0x3f6462['options']);return db[_0xdbc9('0x69')][_0xdbc9('0x2f')]({'where':_0x47bac6[_0xdbc9('0x47')]})[_0xdbc9('0x33')](function(_0x47dbac){_0x377bf8['count']=_0x47dbac;if(_0x3f6462[_0xdbc9('0x3f')][_0xdbc9('0x52')]){_0x47bac6[_0xdbc9('0x53')]=[{'all':!![]}];}return db[_0xdbc9('0x69')][_0xdbc9('0x4d')](_0x47bac6);})[_0xdbc9('0x33')](function(_0x15e312){_0x377bf8[_0xdbc9('0x65')]=_0x15e312;return _0x377bf8;});}})['then'](respondWithFilteredResult(_0x18ecec,_0x47bac6))[_0xdbc9('0x27')](handleError(_0x18ecec,null));};exports['removeAnswers']=function(_0x285d5a,_0xc88206,_0x5271fe){return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x285d5a['params']['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0xc88206,null))[_0xdbc9('0x33')](function(_0x40b44a){if(_0x40b44a){return _0x40b44a['removeAnswers'](_0x285d5a[_0xdbc9('0x3f')][_0xdbc9('0x67')]);}})[_0xdbc9('0x33')](respondWithStatusCode(_0xc88206,null))[_0xdbc9('0x27')](handleError(_0xc88206,null));};exports[_0xdbc9('0x6c')]=function(_0x612189,_0x1ab43a,_0x524882){var _0x124649={'body':_0x612189[_0xdbc9('0x5e')],'channel':'openchannel'};var _0x45e5c6=[];var _0xf8de91=[];var _0x304abf={};var _0x3126ce=![];return db[_0xdbc9('0x6d')]['describe']()[_0xdbc9('0x33')](function(_0x2daac3){if(!_0x2daac3){throw new db['Sequelize']['ValidationError'](_0xdbc9('0x6e'));}_0x45e5c6=_[_0xdbc9('0x6f')](_[_0xdbc9('0x40')](_0x2daac3),['createdAt',_0xdbc9('0x70')]);_0xf8de91=_['difference'](_['keys'](_0x2daac3),['createdAt','updatedAt','CompanyId',_0xdbc9('0x71')]);if(_0x612189[_0xdbc9('0x5e')]['id']){delete _0x612189[_0xdbc9('0x5e')]['id'];}if(_[_0xdbc9('0x72')](_0x612189['body']['from'])){throw new db[(_0xdbc9('0x73'))][(_0xdbc9('0x74'))](_0xdbc9('0x75'));}if(_[_0xdbc9('0x72')](_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x5e')])||_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x5e')]===''){throw new db[(_0xdbc9('0x73'))][(_0xdbc9('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x612189[_0xdbc9('0x5e')]['mapKey'])){throw new db[(_0xdbc9('0x73'))]['ValidationError'](_0xdbc9('0x76')+_0xf8de91);}if(!_[_0xdbc9('0x77')](_0xf8de91,_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x78')])){throw new db[(_0xdbc9('0x73'))][(_0xdbc9('0x74'))](_0xdbc9('0x79')+_0xf8de91);}_0x304abf[_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x78')]]=_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x7a')];})['then'](function(){return db[_0xdbc9('0x3a')]['find']({'where':{'id':_0x612189[_0xdbc9('0x4f')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xdbc9('0x6d')],'as':_0xdbc9('0x7b'),'where':_0x304abf,'limit':0x1,'order':[[_0xdbc9('0x70'),'DESC']]}]},{'model':db[_0xdbc9('0x7c')],'as':_0xdbc9('0x7d')}]});})['then'](handleEntityNotFound(_0x1ab43a,null))[_0xdbc9('0x33')](function(_0x5f5bc6){if(_0x5f5bc6&&_0x5f5bc6[_0xdbc9('0x7e')]){_0x124649[_0xdbc9('0x7f')]=_0x5f5bc6;_0x124649[_0xdbc9('0x80')]=_0x5f5bc6[_0xdbc9('0x7d')];_0x124649[_0xdbc9('0x81')]=_0x5f5bc6[_0xdbc9('0x7e')];_0x124649[_0xdbc9('0x80')]=_[_0xdbc9('0x82')](_0x124649[_0xdbc9('0x80')],[_0xdbc9('0x83')],[_0xdbc9('0x84')]);if(_0x124649[_0xdbc9('0x7f')][_0xdbc9('0x7d')]){delete _0x124649[_0xdbc9('0x7f')]['Applications'];}if(_0x124649[_0xdbc9('0x7f')][_0xdbc9('0x7e')]&&_0x124649[_0xdbc9('0x7f')][_0xdbc9('0x7e')][_0xdbc9('0x7b')][_0xdbc9('0x44')]){return _0x124649[_0xdbc9('0x7f')][_0xdbc9('0x7e')][_0xdbc9('0x7b')][0x0];}var _0xf7c386=_[_0xdbc9('0x17')](_0x612189[_0xdbc9('0x5e')],{'firstName':_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x7a')],'ListId':_0x5f5bc6[_0xdbc9('0x71')]});_0xf7c386[_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x78')]]=_0x612189[_0xdbc9('0x5e')]['from'];return db['CmContact'][_0xdbc9('0x54')](_0xf7c386,{'fields':_0x45e5c6,'raw':!![]});}})[_0xdbc9('0x33')](handleEntityNotFound(_0x1ab43a,null))['then'](function(_0x35bc8d){_0x124649['contact']=_0x35bc8d;if(_0x35bc8d){var _0x51d016={'ContactId':_0x35bc8d['id'],'OpenchannelAccountId':_0x612189[_0xdbc9('0x4f')]['id'],'from':(_0x35bc8d[_0xdbc9('0x85')]||'')+'\x20'+(_0x35bc8d[_0xdbc9('0x86')]||'')};var _0x12ab80={'OpenchannelAccountId':_0x612189[_0xdbc9('0x4f')]['id'],'closed':![]};if(_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x87')]){_0x12ab80[_0xdbc9('0x87')]=_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x87')];return db[_0xdbc9('0x88')][_0xdbc9('0x5a')]({'where':_0x12ab80})[_0xdbc9('0x33')](function(_0x4c2434){if(_0x4c2434){return[_0x4c2434,![]];}_0x51d016[_0xdbc9('0x87')]=_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x87')];_0x51d016[_0xdbc9('0x89')]=_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x89')];return db[_0xdbc9('0x88')]['create'](_0x51d016)[_0xdbc9('0x33')](function(_0x2c9d13){return[_0x2c9d13,!![]];});});}else{_0x12ab80[_0xdbc9('0x87')]=null;}_0x12ab80[_0xdbc9('0x8a')]=_0x35bc8d['id'];return db[_0xdbc9('0x88')]['find']({'where':_0x12ab80})['then'](function(_0x47048f){if(_0x47048f){return[_0x47048f,![]];}return db[_0xdbc9('0x88')][_0xdbc9('0x54')](_0x51d016)[_0xdbc9('0x33')](function(_0x9bd252){return[_0x9bd252,!![]];});});}})['spread'](function(_0x1acff6,_0xd39eb4){if(_0x1acff6){_0x3126ce=_0xd39eb4;if(!_0xd39eb4){var _0x4814e3={'from':(_0x124649[_0xdbc9('0x8b')][_0xdbc9('0x85')]||'')+'\x20'+(_0x124649[_0xdbc9('0x8b')]['lastName']||'')};if(_0x612189['body'][_0xdbc9('0x87')]&&_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x8c')]&&_0x612189['body']['threadId']!=_0x612189[_0xdbc9('0x5e')]['messageId']){_0x4814e3[_0xdbc9('0x87')]=_0x612189[_0xdbc9('0x5e')]['messageId'];}return _0x1acff6[_0xdbc9('0x32')](_0x4814e3);}else{return _0x1acff6;}}})[_0xdbc9('0x33')](function(_0x224969){_0x124649[_0xdbc9('0x8d')]=_0x224969[_0xdbc9('0x58')]({'plain':!![]});_0x124649[_0xdbc9('0x8d')][_0xdbc9('0x8e')]=_0x3126ce;if(_0x124649[_0xdbc9('0x8d')]['created']){if(_0x124649[_0xdbc9('0x7f')][_0xdbc9('0x8f')]){_0x124649[_0xdbc9('0x80')]['push']({'id':0x0,'priority':_0x124649[_0xdbc9('0x80')][_0xdbc9('0x44')]+0x1,'app':_0xdbc9('0x90'),'appdata':_0xdbc9('0x91'),'interval':_0xdbc9('0x92')});}}return db[_0xdbc9('0x93')][_0xdbc9('0x54')]({'body':_0x612189[_0xdbc9('0x5e')][_0xdbc9('0x5e')],'OpenchannelAccountId':_0x612189['params']['id'],'OpenchannelInteractionId':_0x224969['id'],'direction':'in','ContactId':_0x124649[_0xdbc9('0x8b')]['id'],'AttachmentId':_0x612189[_0xdbc9('0x5e')]['AttachmentId']});})[_0xdbc9('0x33')](function(_0x54fa46){_0x124649[_0xdbc9('0x26')]=_0x54fa46;if(_0x124649[_0xdbc9('0x8d')][_0xdbc9('0x94')]){return db['User'][_0xdbc9('0x5a')]({'attributes':['id','name'],'where':{'id':_0x124649[_0xdbc9('0x8d')][_0xdbc9('0x94')]}})[_0xdbc9('0x33')](function(_0x411347){if(_0x411347){_0x124649[_0xdbc9('0x80')][_0xdbc9('0x95')]({'id':0x0,'priority':0x0,'app':_0xdbc9('0x96'),'appdata':_0x411347['name']+','+(_0x124649[_0xdbc9('0x7f')][_0xdbc9('0x97')]||0xa),'interval':_0xdbc9('0x92')});_0x124649['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xdbc9('0x98'),_0x124649);});}return respondWithRpcPromise(_0xdbc9('0x99'),_0xdbc9('0x98'),_0x124649);})[_0xdbc9('0x33')](function(_0x21e978){respondWithRpcPromise(_0xdbc9('0x9a'),'EventManager',{'event':_0xdbc9('0x6c'),'message':_0x21e978},client9002);return _0x21e978;})['then'](respondWithResult(_0x1ab43a,null))[_0xdbc9('0x27')](handleError(_0x1ab43a,null));};exports[_0xdbc9('0x9b')]=function(_0xd1bd3c,_0x5b0917){var _0x4f18f7=_0xd1bd3c[_0xdbc9('0x4f')]['id'];var _0x20ff4d=_0xd1bd3c[_0xdbc9('0x5e')];var _0x1e6c8b=0xc8;var _0x3fd9af=null;return db[_0xdbc9('0x9c')][_0xdbc9('0x9d')]({'isolationLevel':db['sequelize'][_0xdbc9('0x9e')]['ISOLATION_LEVELS'][_0xdbc9('0x9f')]},function(_0x118b20){return db[_0xdbc9('0x3a')][_0xdbc9('0xa0')]({'where':{'id':_0x4f18f7},'transaction':_0x118b20})[_0xdbc9('0x33')](function(_0x5d8093){if(_0x5d8093){return db[_0xdbc9('0x7c')][_0xdbc9('0xa1')]({'where':{'OpenchannelAccountId':_0x4f18f7},'transaction':_0x118b20})[_0xdbc9('0x33')](function(){var _0x24e587=_[_0xdbc9('0x39')](_0x20ff4d,function(_0x2a442c){_0x2a442c[_0xdbc9('0xa2')]=_0x4f18f7;return _0x2a442c;});return db[_0xdbc9('0x7c')]['bulkCreate'](_0x24e587,{'transaction':_0x118b20});});}else{_0x1e6c8b=0x194;_0x3fd9af=[];}});})[_0xdbc9('0x33')](function(){if(_0x1e6c8b!==0x194){return db[_0xdbc9('0x7c')][_0xdbc9('0xa3')]({'where':{'OpenchannelAccountId':_0x4f18f7},'order':_0xdbc9('0x83')})[_0xdbc9('0x33')](function(_0x1ddd1a){_0x3fd9af=_0x1ddd1a;});}})[_0xdbc9('0x27')](function(_0x1d0df3){_0x1e6c8b=0x1f4;logger['error'](_0x1d0df3[_0xdbc9('0x36')]);if(_0x1d0df3[_0xdbc9('0x37')]){delete _0x1d0df3[_0xdbc9('0x37')];}_0x3fd9af=_0x1d0df3;})['finally'](function(){if(_0x3fd9af===null){_0x5b0917[_0xdbc9('0x28')](_0x1e6c8b);}else{if(_0x1e6c8b===0x1f4){_0x5b0917['status'](_0x1e6c8b)[_0xdbc9('0x38')](_0x3fd9af);}else{_0x5b0917[_0xdbc9('0x2a')](_0x1e6c8b)[_0xdbc9('0x2b')](_0x3fd9af);}}});};exports['getApplications']=function(_0x554ff8,_0x1c51c4,_0x837f73){var _0x21f3f5={};var _0x45c150={};var _0x783ce9;var _0x5ccd82;return db['OpenchannelAccount'][_0xdbc9('0xa0')]({'where':{'id':_0x554ff8[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x1c51c4,null))[_0xdbc9('0x33')](function(_0x136740){if(_0x136740){_0x783ce9=_0x136740;_0x45c150['model']=_[_0xdbc9('0x40')](db[_0xdbc9('0x7c')][_0xdbc9('0x3b')]);_0x45c150[_0xdbc9('0x3f')]=_[_0xdbc9('0x40')](_0x554ff8[_0xdbc9('0x3f')]);_0x45c150['filters']=_[_0xdbc9('0x51')](_0x45c150[_0xdbc9('0x3e')],_0x45c150['query']);_0x21f3f5[_0xdbc9('0x42')]=_[_0xdbc9('0x51')](_0x45c150[_0xdbc9('0x3e')],qs['fields'](_0x554ff8[_0xdbc9('0x3f')]['fields']));_0x21f3f5['attributes']=_0x21f3f5[_0xdbc9('0x42')][_0xdbc9('0x44')]?_0x21f3f5['attributes']:_0x45c150[_0xdbc9('0x3e')];_0x21f3f5[_0xdbc9('0x64')]=qs['sort'](_0x554ff8[_0xdbc9('0x3f')][_0xdbc9('0x46')]);_0x21f3f5[_0xdbc9('0x47')]=qs[_0xdbc9('0x41')](_[_0xdbc9('0x6b')](_0x554ff8[_0xdbc9('0x3f')],_0x45c150[_0xdbc9('0x41')]));if(_0x554ff8[_0xdbc9('0x3f')]['filter']){_0x21f3f5[_0xdbc9('0x47')]=_[_0xdbc9('0x4b')](_0x21f3f5['where'],{'$or':_['map'](_0x21f3f5[_0xdbc9('0x42')],function(_0xcb1a7a){var _0x3b8f99={};_0x3b8f99[_0xcb1a7a]={'$like':'%'+_0x554ff8[_0xdbc9('0x3f')][_0xdbc9('0x48')]+'%'};return _0x3b8f99;})});}_0x21f3f5=_[_0xdbc9('0x4b')]({},_0x21f3f5,_0x554ff8['options']);return _0x783ce9[_0xdbc9('0xa4')](_0x21f3f5);}})[_0xdbc9('0x33')](function(_0x3904f3){if(_0x3904f3){_0x5ccd82=_0x3904f3[_0xdbc9('0x44')];if(!_0x554ff8[_0xdbc9('0x3f')][_0xdbc9('0x63')](_0xdbc9('0x45'))){_0x21f3f5['limit']=qs[_0xdbc9('0x2e')](_0x554ff8[_0xdbc9('0x3f')][_0xdbc9('0x2e')]);_0x21f3f5[_0xdbc9('0x2c')]=qs[_0xdbc9('0x2c')](_0x554ff8['query'][_0xdbc9('0x2c')]);}return _0x783ce9[_0xdbc9('0xa4')](_0x21f3f5);}})['then'](function(_0x11f311){if(_0x11f311){return _0x11f311?{'count':_0x5ccd82,'rows':_0x11f311}:null;}})[_0xdbc9('0x33')](respondWithResult(_0x1c51c4,null))[_0xdbc9('0x27')](handleError(_0x1c51c4,null));};exports[_0xdbc9('0xa5')]=function(_0x52821e,_0xb74477,_0x1dc923){var _0x56dbaf={'raw':![],'where':{}};var _0x1f373e={};var _0xd7ae88={'count':0x0,'rows':[]};return db[_0xdbc9('0x3a')][_0xdbc9('0xa0')]({'where':{'id':_0x52821e[_0xdbc9('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb74477,null))['then'](function(_0xf6647){if(_0xf6647){_0x1f373e[_0xdbc9('0x3e')]=_[_0xdbc9('0x40')](db['OpenchannelInteraction']['rawAttributes']);_0x1f373e[_0xdbc9('0x3f')]=_[_0xdbc9('0x40')](_0x52821e[_0xdbc9('0x3f')]);_0x1f373e[_0xdbc9('0x41')]=_[_0xdbc9('0x51')](_0x1f373e[_0xdbc9('0x3e')],_0x1f373e[_0xdbc9('0x3f')]);_0x56dbaf['attributes']=_[_0xdbc9('0x51')](_0x1f373e[_0xdbc9('0x3e')],qs[_0xdbc9('0x43')](_0x52821e[_0xdbc9('0x3f')]['fields']));_0x56dbaf[_0xdbc9('0x42')]=_0x56dbaf[_0xdbc9('0x42')]['length']?_0x56dbaf[_0xdbc9('0x42')]:_0x1f373e[_0xdbc9('0x3e')];if(!_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0x63')]('nolimit')){_0x56dbaf[_0xdbc9('0x2e')]=qs[_0xdbc9('0x2e')](_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0x2e')]);_0x56dbaf['offset']=qs[_0xdbc9('0x2c')](_0x52821e[_0xdbc9('0x3f')]['offset']);}_0x56dbaf[_0xdbc9('0x64')]=qs[_0xdbc9('0x46')](_0x52821e['query'][_0xdbc9('0x46')]);_0x56dbaf['where']=qs[_0xdbc9('0x41')](_['pick'](_0x52821e[_0xdbc9('0x3f')],_0x1f373e[_0xdbc9('0x41')]));_0x56dbaf['where'][_0xdbc9('0xa2')]=_0xf6647['id'];if(_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0x48')]){_0x56dbaf[_0xdbc9('0x47')]=_[_0xdbc9('0x4b')](_0x56dbaf[_0xdbc9('0x47')],{'$or':_[_0xdbc9('0x39')](_0x56dbaf[_0xdbc9('0x42')],function(_0xcc0de2){var _0x3f817c={};_0x3f817c[_0xcc0de2]={'$like':'%'+_0x52821e['query'][_0xdbc9('0x48')]+'%'};return _0x3f817c;})});}_0x56dbaf=_[_0xdbc9('0x4b')]({},_0x56dbaf,_0x52821e[_0xdbc9('0x4c')]);return db['OpenchannelInteraction'][_0xdbc9('0x2f')]({'where':_0x56dbaf['where']})[_0xdbc9('0x33')](function(_0x35a242){_0xd7ae88['count']=_0x35a242;if(_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0x52')]){_0x56dbaf[_0xdbc9('0x53')]=[{'model':db[_0xdbc9('0x6d')],'as':_0xdbc9('0xa6'),'required':![]},{'model':db[_0xdbc9('0xa7')],'as':_0xdbc9('0xa8'),'attributes':[_0xdbc9('0x37'),'fullname',_0xdbc9('0xa9')],'required':![]},{'model':db['Tag'],'as':_0xdbc9('0xaa'),'attributes':['id',_0xdbc9('0x37'),'color'],'where':_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0xab')]?{'id':_0x52821e['query'][_0xdbc9('0xab')]}:undefined,'required':_0x52821e[_0xdbc9('0x3f')][_0xdbc9('0xab')]?!![]:![]}];}return db[_0xdbc9('0x88')][_0xdbc9('0x4d')](_0x56dbaf);})[_0xdbc9('0x33')](function(_0x213535){_0xd7ae88[_0xdbc9('0x65')]=_0x213535;return _0xd7ae88;});}})['then'](respondWithFilteredResult(_0xb74477,_0x56dbaf))[_0xdbc9('0x27')](handleError(_0xb74477,null));};exports[_0xdbc9('0xac')]=function(_0x5e5e99,_0x25739b,_0x36e5d7){return db[_0xdbc9('0x3a')][_0xdbc9('0x5a')]({'where':{'id':_0x5e5e99[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x25739b,null))[_0xdbc9('0x33')](function(_0x2663ab){if(_0x2663ab){return _0x2663ab[_0xdbc9('0xac')](_0x5e5e99[_0xdbc9('0x5e')][_0xdbc9('0x67')],_[_0xdbc9('0xad')](_0x5e5e99['body'],['ids','id'])||{})['spread'](function(_0x28d172){for(var _0x390d6c=0x0;_0x390d6c<_0x5e5e99[_0xdbc9('0x5e')][_0xdbc9('0x67')][_0xdbc9('0x44')];_0x390d6c+=0x1){socket[_0xdbc9('0xae')](_0xdbc9('0xaf'),{'UserId':Number(_0x5e5e99[_0xdbc9('0x5e')]['ids'][_0x390d6c]),'OpenchannelAccountId':Number(_0x5e5e99['params']['id'])});}return _0x28d172;});}})[_0xdbc9('0x33')](respondWithResult(_0x25739b,null))[_0xdbc9('0x27')](handleError(_0x25739b,null));};exports['removeAgents']=function(_0x164fe8,_0x497fab,_0x1bc232){return db['OpenchannelAccount'][_0xdbc9('0x5a')]({'where':{'id':_0x164fe8[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x497fab,null))[_0xdbc9('0x33')](function(_0x57a4b4){if(_0x57a4b4){return _0x57a4b4[_0xdbc9('0xb0')](_0x164fe8['query'][_0xdbc9('0x67')])[_0xdbc9('0x33')](function(){if(_[_0xdbc9('0xb1')](_0x164fe8[_0xdbc9('0x3f')][_0xdbc9('0x67')])){for(var _0x623a45=0x0;_0x623a45<_0x164fe8[_0xdbc9('0x3f')][_0xdbc9('0x67')][_0xdbc9('0x44')];_0x623a45+=0x1){socket[_0xdbc9('0xae')]('userOpenchannelAccount:remove',{'UserId':Number(_0x164fe8[_0xdbc9('0x3f')][_0xdbc9('0x67')][_0x623a45]),'OpenchannelAccountId':Number(_0x164fe8[_0xdbc9('0x4f')]['id'])});}}else{socket['emit'](_0xdbc9('0xb2'),{'UserId':Number(_0x164fe8[_0xdbc9('0x3f')][_0xdbc9('0x67')]),'OpenchannelAccountId':Number(_0x164fe8[_0xdbc9('0x4f')]['id'])});}});}})[_0xdbc9('0x33')](respondWithStatusCode(_0x497fab,null))[_0xdbc9('0x27')](handleError(_0x497fab,null));};exports[_0xdbc9('0xb3')]=function(_0x46da4e,_0x3d2258,_0x3955ef){var _0x13f49b={};var _0x39ab7e={};var _0x2147d8;var _0x1c66b2;return db[_0xdbc9('0x3a')][_0xdbc9('0xa0')]({'where':{'id':_0x46da4e[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x3d2258,null))[_0xdbc9('0x33')](function(_0x2aba9a){if(_0x2aba9a){_0x2147d8=_0x2aba9a;_0x39ab7e['model']=_[_0xdbc9('0x40')](db[_0xdbc9('0xa7')][_0xdbc9('0x3b')]);_0x39ab7e['query']=_[_0xdbc9('0x40')](_0x46da4e[_0xdbc9('0x3f')]);_0x39ab7e[_0xdbc9('0x41')]=_[_0xdbc9('0x51')](_0x39ab7e[_0xdbc9('0x3e')],_0x39ab7e[_0xdbc9('0x3f')]);_0x13f49b['attributes']=_[_0xdbc9('0x51')](_0x39ab7e[_0xdbc9('0x3e')],qs[_0xdbc9('0x43')](_0x46da4e[_0xdbc9('0x3f')]['fields']));_0x13f49b[_0xdbc9('0x42')]=_0x13f49b['attributes'][_0xdbc9('0x44')]?_0x13f49b[_0xdbc9('0x42')]:_0x39ab7e[_0xdbc9('0x3e')];_0x13f49b[_0xdbc9('0x64')]=qs[_0xdbc9('0x46')](_0x46da4e[_0xdbc9('0x3f')][_0xdbc9('0x46')]);_0x13f49b[_0xdbc9('0x47')]=qs[_0xdbc9('0x41')](_[_0xdbc9('0x6b')](_0x46da4e[_0xdbc9('0x3f')],_0x39ab7e[_0xdbc9('0x41')]));if(_0x46da4e[_0xdbc9('0x3f')][_0xdbc9('0x48')]){_0x13f49b[_0xdbc9('0x47')]=_[_0xdbc9('0x4b')](_0x13f49b[_0xdbc9('0x47')],{'$or':_[_0xdbc9('0x39')](_0x13f49b[_0xdbc9('0x42')],function(_0x3b0670){var _0x17a5f6={};_0x17a5f6[_0x3b0670]={'$like':'%'+_0x46da4e['query'][_0xdbc9('0x48')]+'%'};return _0x17a5f6;})});}_0x13f49b=_[_0xdbc9('0x4b')]({},_0x13f49b,_0x46da4e[_0xdbc9('0x4c')]);return _0x2147d8[_0xdbc9('0xb3')](_0x13f49b);}})[_0xdbc9('0x33')](function(_0x5e5959){if(_0x5e5959){_0x1c66b2=_0x5e5959[_0xdbc9('0x44')];if(!_0x46da4e[_0xdbc9('0x3f')][_0xdbc9('0x63')](_0xdbc9('0x45'))){_0x13f49b[_0xdbc9('0x2e')]=qs[_0xdbc9('0x2e')](_0x46da4e[_0xdbc9('0x3f')]['limit']);_0x13f49b['offset']=qs[_0xdbc9('0x2c')](_0x46da4e['query']['offset']);}return _0x2147d8[_0xdbc9('0xb3')](_0x13f49b);}})['then'](function(_0x53aace){if(_0x53aace){return _0x53aace?{'count':_0x1c66b2,'rows':_0x53aace}:null;}})[_0xdbc9('0x33')](respondWithResult(_0x3d2258,null))[_0xdbc9('0x27')](handleError(_0x3d2258,null));};exports[_0xdbc9('0x38')]=function(_0x2e579a,_0x26dbc4,_0x31fe7d){var _0x9f6a92,_0x92d068,_0x379ec8;if(_['isNil'](_0x2e579a[_0xdbc9('0x5e')]['body'])||_0x2e579a[_0xdbc9('0x5e')]['body']===''){throw new db[(_0xdbc9('0x73'))][(_0xdbc9('0x74'))](_0xdbc9('0xb4'));}if(_[_0xdbc9('0x72')](_0x2e579a['body']['to'])){}_0x9f6a92=_0x2e579a[_0xdbc9('0x5e')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x2e579a[_0xdbc9('0x4f')]['id']}})[_0xdbc9('0x33')](handleEntityNotFound(_0x26dbc4,null))['then'](function(_0x579f97){if(_0x579f97){return db['OpenchannelAccount'][_0xdbc9('0x5a')]({'where':{'id':_0x579f97['id']},'include':[{'model':db[_0xdbc9('0xb5')],'as':'List','include':[{'model':db[_0xdbc9('0x6d')],'as':_0xdbc9('0x7b'),'where':{[_0x579f97['mapKey']]:_0x9f6a92},'limit':0x1,'order':[[_0xdbc9('0x70'),_0xdbc9('0xb6')]]}]}]})[_0xdbc9('0x33')](handleEntityNotFound(_0x26dbc4,null))[_0xdbc9('0x33')](function(_0x56d848){if(_0x56d848&&_0x56d848[_0xdbc9('0x7e')]){_0x92d068=_0x56d848[_0xdbc9('0x58')]({'plain':!![]});if(_0x92d068[_0xdbc9('0x7e')]&&_0x92d068[_0xdbc9('0x7e')][_0xdbc9('0x7b')][_0xdbc9('0x44')]){return _0x92d068[_0xdbc9('0x7e')]['Contacts'][0x0];}return db[_0xdbc9('0x6d')][_0xdbc9('0x54')](_[_0xdbc9('0x17')](_0x2e579a['body'],{'firstName':_0x9f6a92,[_0x56d848[_0xdbc9('0x78')]]:_0x9f6a92,'phone':_0x9f6a92,'ListId':_0x92d068[_0xdbc9('0x71')]}));}})[_0xdbc9('0x33')](handleEntityNotFound(_0x26dbc4,null))[_0xdbc9('0x33')](function(_0x350d34){if(_0x350d34){_0x379ec8=_0x350d34;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x379ec8['id'],'closed':![],'OpenchannelAccountId':_0x92d068['id']}})[_0xdbc9('0x33')](function(_0x5e1254){if(_0x5e1254){return[_0x5e1254,![]];}return db[_0xdbc9('0x88')][_0xdbc9('0x54')]({'UserId':_0x2e579a['user']['id'],'ContactId':_0x379ec8['id'],'OpenchannelAccountId':_0x92d068['id'],'lastMsgDirection':_0xdbc9('0xb7'),'firstMsgDirection':'out','Messages':[_[_0xdbc9('0x4b')](_0x2e579a[_0xdbc9('0x5e')],{'read':![],'body':_0x2e579a['body']['body'],'OpenchannelAccountId':_0x92d068['id'],'UserId':_0x2e579a[_0xdbc9('0x57')]['id'],'ContactId':_0x379ec8['id']})]},{'include':[{'model':db[_0xdbc9('0x93')],'as':'Messages'}]})[_0xdbc9('0x33')](function(_0x334bf7){return[_0x334bf7,!![]];});});}})[_0xdbc9('0xb8')](function(_0x42589c,_0x3e086b){if(_0x3e086b){return _0x42589c;}return db[_0xdbc9('0x93')]['create'](_[_0xdbc9('0x4b')](_0x2e579a['body'],{'read':![],'body':_0x2e579a[_0xdbc9('0x5e')][_0xdbc9('0x5e')],'OpenchannelAccountId':_0x92d068['id'],'OpenchannelInteractionId':_0x42589c['id'],'UserId':_0x2e579a[_0xdbc9('0x57')]['id'],'ContactId':_0x379ec8['id']}))[_0xdbc9('0x33')](function(_0x3858f4){_0x42589c['dataValues']['Messages']=[];_0x42589c['dataValues'][_0xdbc9('0xb9')]['push'](_0x3858f4[_0xdbc9('0xba')]);return _0x42589c;});});}})['then'](respondWithResult(_0x26dbc4,null))[_0xdbc9('0x27')](handleError(_0x26dbc4,null));};
\ No newline at end of file
+var _0xcebf=['forcedOwnership','startRouting','Start','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','findAndCountAll','stack','finally','getApplications','findOne','Contact','Owner','internal','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','user','out','dataValues','Messages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','http','client','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','apply','reject','save','update','OpenchannelAccounts','UserProfileResource','send','Pause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','intersection','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','show','mandatoryDispositionPause','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','describe','addDisposition','OpenchannelAccountId','Disposition','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','notify','openchannel','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','from','ValidationError','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','Contacts','DESC','account','Applications','applications','orderBy','priority','ListId','contact','lastName','threadId','OpenchannelInteraction','externalUrl','spread','firstName','messageId','interaction','autoclose','push','unmanaged','*,*,*,*','OpenchannelMessage','UserId','User','unshift','agent'];(function(_0x4a2124,_0x29ad24){var _0x2ad7f8=function(_0x1c0bb5){while(--_0x1c0bb5){_0x4a2124['push'](_0x4a2124['shift']());}};_0x2ad7f8(++_0x29ad24);}(_0xcebf,0x1a0));var _0xfceb=function(_0x2dcfdd,_0x58e470){_0x2dcfdd=_0x2dcfdd-0x0;var _0x43f755=_0xcebf[_0x2dcfdd];return _0x43f755;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfceb('0x0'));var zipdir=require(_0xfceb('0x1'));var jsonpatch=require(_0xfceb('0x2'));var rp=require(_0xfceb('0x3'));var moment=require(_0xfceb('0x4'));var BPromise=require(_0xfceb('0x5'));var Mustache=require(_0xfceb('0x6'));var util=require(_0xfceb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xfceb('0x8'));var ejs=require(_0xfceb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfceb('0xa'));var squel=require(_0xfceb('0xb'));var crypto=require(_0xfceb('0xc'));var jsforce=require(_0xfceb('0xd'));var deskjs=require(_0xfceb('0xe'));var toCsv=require(_0xfceb('0x8'));var querystring=require('querystring');var Papa=require(_0xfceb('0xf'));var Redis=require(_0xfceb('0x10'));var authService=require(_0xfceb('0x11'));var qs=require(_0xfceb('0x12'));var as=require(_0xfceb('0x13'));var hardwareService=require(_0xfceb('0x14'));var logger=require(_0xfceb('0x15'))(_0xfceb('0x16'));var utils=require(_0xfceb('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfceb('0x18'));var db=require(_0xfceb('0x19'))['db'];config['redis']=_[_0xfceb('0x1a')](config[_0xfceb('0x1b')],{'host':_0xfceb('0x1c'),'port':0x18eb});var socket=require(_0xfceb('0x1d'))(new Redis(config[_0xfceb('0x1b')]));require('./openchannelAccount.socket')[_0xfceb('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xfceb('0x1f')]({'port':0x232c});var client9002=jayson[_0xfceb('0x20')][_0xfceb('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x156c2b,_0x271875,_0x6cfd42,_0x120a91){return new BPromise(function(_0x1ae6ee,_0x247b34){var _0x52fc29=_0x120a91||client;return _0x52fc29[_0xfceb('0x21')](_0x156c2b,_0x6cfd42)[_0xfceb('0x22')](function(_0x2734a9){logger[_0xfceb('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x271875,'request\x20sent');logger[_0xfceb('0x24')](_0xfceb('0x25'),_0x271875,_0xfceb('0x26'),JSON[_0xfceb('0x27')](_0x2734a9));if(_0x2734a9[_0xfceb('0x28')]){if(_0x2734a9[_0xfceb('0x28')]['code']===0x1f4){logger['error'](_0xfceb('0x29'),_0x271875,_0x2734a9[_0xfceb('0x28')][_0xfceb('0x2a')]);return _0x247b34(_0x2734a9['error']['message']);}logger[_0xfceb('0x28')](_0xfceb('0x29'),_0x271875,_0x2734a9[_0xfceb('0x28')][_0xfceb('0x2a')]);return _0x1ae6ee(_0x2734a9['error'][_0xfceb('0x2a')]);}else{logger[_0xfceb('0x23')](_0xfceb('0x29'),_0x271875,_0xfceb('0x26'));_0x1ae6ee(_0x2734a9['result'][_0xfceb('0x2a')]);}})[_0xfceb('0x2b')](function(_0x1c02fc){logger[_0xfceb('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x271875,_0x1c02fc);_0x247b34(_0x1c02fc);});});}function respondWithStatusCode(_0x2f8c84,_0x358f7e){_0x358f7e=_0x358f7e||0xcc;return function(_0x13568a){if(_0x13568a){return _0x2f8c84[_0xfceb('0x2c')](_0x358f7e);}return _0x2f8c84[_0xfceb('0x2d')](_0x358f7e)[_0xfceb('0x2e')]();};}function respondWithResult(_0x1064b5,_0x540edf){_0x540edf=_0x540edf||0xc8;return function(_0x3a3c7b){if(_0x3a3c7b){return _0x1064b5['status'](_0x540edf)[_0xfceb('0x2f')](_0x3a3c7b);}};}function respondWithFilteredResult(_0x30fc93,_0x4b39d1){return function(_0x19ed53){if(_0x19ed53){var _0x3fd367=typeof _0x4b39d1['offset']==='undefined'&&typeof _0x4b39d1[_0xfceb('0x30')]===_0xfceb('0x31');var _0x1c1952=_0x19ed53['count'];var _0x586de9=_0x3fd367?0x0:_0x4b39d1['offset'];var _0x16d3af=_0x3fd367?_0x19ed53[_0xfceb('0x32')]:_0x4b39d1['offset']+_0x4b39d1['limit'];var _0xba02ea;if(_0x16d3af>=_0x1c1952){_0x16d3af=_0x1c1952;_0xba02ea=0xc8;}else{_0xba02ea=0xce;}_0x30fc93[_0xfceb('0x2d')](_0xba02ea);return _0x30fc93[_0xfceb('0x33')](_0xfceb('0x34'),_0x586de9+'-'+_0x16d3af+'/'+_0x1c1952)[_0xfceb('0x2f')](_0x19ed53);}return null;};}function patchUpdates(_0x2ba659){return function(_0x424f25){try{jsonpatch[_0xfceb('0x35')](_0x424f25,_0x2ba659,!![]);}catch(_0x5f4397){return BPromise[_0xfceb('0x36')](_0x5f4397);}return _0x424f25[_0xfceb('0x37')]();};}function saveUpdates(_0x35aa12,_0x164202){return function(_0x4af878){if(_0x4af878){return _0x4af878[_0xfceb('0x38')](_0x35aa12)[_0xfceb('0x22')](function(_0x25a65b){return _0x25a65b;});}return null;};}function removeEntity(_0x5b9993,_0x33a0cc){return function(_0x447920){if(_0x447920){return _0x447920['destroy']()['then'](function(){var _0x2de37c=_0x447920['get']({'plain':!![]});var _0x53ceb0=_0xfceb('0x39');return db[_0xfceb('0x3a')]['destroy']({'where':{'type':_0x53ceb0,'resourceId':_0x2de37c['id']}})['then'](function(){return _0x447920;});})[_0xfceb('0x22')](function(){_0x5b9993['status'](0xcc)[_0xfceb('0x2e')]();});}};}function handleEntityNotFound(_0x3efdc8,_0x385bbe){return function(_0x2e58a2){if(!_0x2e58a2){_0x3efdc8['sendStatus'](0x194);}return _0x2e58a2;};}function handleError(_0x5acc1f,_0x1a8034){_0x1a8034=_0x1a8034||0x1f4;return function(_0x63bbba){logger[_0xfceb('0x28')](_0x63bbba['stack']);if(_0x63bbba['name']){delete _0x63bbba['name'];}_0x5acc1f[_0xfceb('0x2d')](_0x1a8034)[_0xfceb('0x3b')](_0x63bbba);};}exports['index']=function(_0x58afe8,_0xa4d17){var _0x4c3c32={'include':[{'model':db[_0xfceb('0x3c')],'as':'mandatoryDispositionPause'}]},_0x17acf9={},_0xa397e3={'count':0x0,'rows':[]};var _0x1873f1=_[_0xfceb('0x3d')](db[_0xfceb('0x3e')][_0xfceb('0x3f')],function(_0x2b4a7a){return{'name':_0x2b4a7a[_0xfceb('0x40')],'type':_0x2b4a7a['type'][_0xfceb('0x41')]};});_0x17acf9[_0xfceb('0x42')]=_[_0xfceb('0x3d')](_0x1873f1,_0xfceb('0x43'));_0x17acf9[_0xfceb('0x44')]=_[_0xfceb('0x45')](_0x58afe8[_0xfceb('0x44')]);_0x17acf9[_0xfceb('0x46')]=_['intersection'](_0x17acf9[_0xfceb('0x42')],_0x17acf9[_0xfceb('0x44')]);_0x4c3c32[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x17acf9[_0xfceb('0x42')],qs[_0xfceb('0x49')](_0x58afe8[_0xfceb('0x44')][_0xfceb('0x49')]));_0x4c3c32['attributes']=_0x4c3c32[_0xfceb('0x47')][_0xfceb('0x4a')]?_0x4c3c32[_0xfceb('0x47')]:_0x17acf9[_0xfceb('0x42')];if(!_0x58afe8['query']['hasOwnProperty'](_0xfceb('0x4b'))){_0x4c3c32[_0xfceb('0x30')]=qs[_0xfceb('0x30')](_0x58afe8[_0xfceb('0x44')]['limit']);_0x4c3c32[_0xfceb('0x4c')]=qs[_0xfceb('0x4c')](_0x58afe8[_0xfceb('0x44')][_0xfceb('0x4c')]);}_0x4c3c32[_0xfceb('0x4d')]=qs['sort'](_0x58afe8[_0xfceb('0x44')][_0xfceb('0x4e')]);_0x4c3c32[_0xfceb('0x4f')]=qs['filters'](_[_0xfceb('0x50')](_0x58afe8[_0xfceb('0x44')],_0x17acf9[_0xfceb('0x46')]),_0x1873f1);if(_0x58afe8[_0xfceb('0x44')][_0xfceb('0x51')]){_0x4c3c32[_0xfceb('0x4f')]=_[_0xfceb('0x52')](_0x4c3c32['where'],{'$or':_[_0xfceb('0x3d')](_0x1873f1,function(_0x50c1f1){if(_0x50c1f1[_0xfceb('0x53')]!==_0xfceb('0x54')){var _0x4957c4={};_0x4957c4[_0x50c1f1[_0xfceb('0x43')]]={'$like':'%'+_0x58afe8[_0xfceb('0x44')]['filter']+'%'};return _0x4957c4;}})});}_0x4c3c32=_['merge']({},_0x4c3c32,_0x58afe8[_0xfceb('0x55')]);var _0x397848={'where':_0x4c3c32[_0xfceb('0x4f')]};return db[_0xfceb('0x3e')][_0xfceb('0x32')](_0x397848)[_0xfceb('0x22')](function(_0x1eda50){_0xa397e3[_0xfceb('0x32')]=_0x1eda50;if(_0x58afe8[_0xfceb('0x44')][_0xfceb('0x56')]){_0x4c3c32['include']=[{'all':!![]}];}return db[_0xfceb('0x3e')][_0xfceb('0x57')](_0x4c3c32);})[_0xfceb('0x22')](function(_0x565688){_0xa397e3['rows']=_0x565688;return _0xa397e3;})[_0xfceb('0x22')](respondWithFilteredResult(_0xa4d17,_0x4c3c32))[_0xfceb('0x2b')](handleError(_0xa4d17,null));};exports[_0xfceb('0x58')]=function(_0x1af1a8,_0x401be5){var _0x1f205e={'raw':![],'where':{'id':_0x1af1a8['params']['id']},'include':[{'model':db[_0xfceb('0x3c')],'as':_0xfceb('0x59')}]},_0x3dfa6b={};_0x3dfa6b[_0xfceb('0x42')]=_[_0xfceb('0x45')](db[_0xfceb('0x3e')][_0xfceb('0x3f')]);_0x3dfa6b[_0xfceb('0x44')]=_[_0xfceb('0x45')](_0x1af1a8[_0xfceb('0x44')]);_0x3dfa6b[_0xfceb('0x46')]=_[_0xfceb('0x48')](_0x3dfa6b[_0xfceb('0x42')],_0x3dfa6b['query']);_0x1f205e[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x3dfa6b[_0xfceb('0x42')],qs[_0xfceb('0x49')](_0x1af1a8[_0xfceb('0x44')][_0xfceb('0x49')]));_0x1f205e[_0xfceb('0x47')]=_0x1f205e[_0xfceb('0x47')]['length']?_0x1f205e[_0xfceb('0x47')]:_0x3dfa6b['model'];if(_0x1af1a8[_0xfceb('0x44')][_0xfceb('0x56')]){_0x1f205e[_0xfceb('0x5a')]=[{'all':!![]}];}_0x1f205e=_[_0xfceb('0x52')]({},_0x1f205e,_0x1af1a8[_0xfceb('0x55')]);return db[_0xfceb('0x3e')][_0xfceb('0x5b')](_0x1f205e)[_0xfceb('0x22')](handleEntityNotFound(_0x401be5,null))[_0xfceb('0x22')](respondWithResult(_0x401be5,null))['catch'](handleError(_0x401be5,null));};exports[_0xfceb('0x5c')]=function(_0x3ae094,_0x1d01e7){return db[_0xfceb('0x3e')][_0xfceb('0x5c')](_0x3ae094[_0xfceb('0x5d')],{})[_0xfceb('0x22')](function(_0x440648){var _0x342a08=_0x3ae094['user'][_0xfceb('0x5e')]({'plain':!![]});if(!_0x342a08)throw new Error(_0xfceb('0x5f'));if(_0x342a08[_0xfceb('0x60')]==='user'){var _0x231b2=_0x440648[_0xfceb('0x5e')]({'plain':!![]});var _0x9a6992=_0xfceb('0x39');return db[_0xfceb('0x61')]['find']({'where':{'name':_0x9a6992,'userProfileId':_0x342a08[_0xfceb('0x62')]},'raw':!![]})['then'](function(_0x2f0366){if(_0x2f0366&&_0x2f0366[_0xfceb('0x63')]===0x0){return db[_0xfceb('0x3a')][_0xfceb('0x5c')]({'name':_0x231b2[_0xfceb('0x43')],'resourceId':_0x231b2['id'],'type':_0x2f0366['name'],'sectionId':_0x2f0366['id']},{})[_0xfceb('0x22')](function(){return _0x440648;});}else{return _0x440648;}})['catch'](function(_0x5bdbdd){logger['error'](_0xfceb('0x64'),_0x5bdbdd);throw _0x5bdbdd;});}return _0x440648;})[_0xfceb('0x22')](respondWithResult(_0x1d01e7,0xc9))[_0xfceb('0x2b')](handleError(_0x1d01e7,null));};exports[_0xfceb('0x38')]=function(_0xb4b0bc,_0x3c5dab){if(_0xb4b0bc[_0xfceb('0x5d')]['id']){delete _0xb4b0bc[_0xfceb('0x5d')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0xb4b0bc['params']['id']},'include':[{'model':db[_0xfceb('0x3c')],'as':_0xfceb('0x59')}]})[_0xfceb('0x22')](handleEntityNotFound(_0x3c5dab,null))[_0xfceb('0x22')](saveUpdates(_0xb4b0bc[_0xfceb('0x5d')],null))[_0xfceb('0x22')](respondWithResult(_0x3c5dab,null))[_0xfceb('0x2b')](handleError(_0x3c5dab,null));};exports[_0xfceb('0x65')]=function(_0x569547,_0x1eac58){return db['OpenchannelAccount'][_0xfceb('0x5b')]({'where':{'id':_0x569547[_0xfceb('0x66')]['id']}})['then'](handleEntityNotFound(_0x1eac58,null))[_0xfceb('0x22')](removeEntity(_0x1eac58,null))[_0xfceb('0x2b')](handleError(_0x1eac58,null));};exports[_0xfceb('0x67')]=function(_0x721b1f,_0x29307f){return db[_0xfceb('0x3e')][_0xfceb('0x67')]()[_0xfceb('0x22')](respondWithResult(_0x29307f,null))[_0xfceb('0x2b')](handleError(_0x29307f,null));};exports[_0xfceb('0x68')]=function(_0x4c4940,_0x4a3cc0,_0x354e80){if(_0x4c4940['body']['id']){delete _0x4c4940['body']['id'];}return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x4c4940[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x4a3cc0,null))[_0xfceb('0x22')](function(_0x263fc1){if(_0x263fc1){_0x4c4940['body'][_0xfceb('0x69')]=_0x263fc1['id'];return db[_0xfceb('0x6a')][_0xfceb('0x5c')](_0x4c4940[_0xfceb('0x5d')]);}})['then'](respondWithResult(_0x4a3cc0,null))['catch'](handleError(_0x4a3cc0,null));};exports['getDispositions']=function(_0x336c65,_0x5740d6,_0x348607){var _0x16b488={'raw':![],'where':{}};var _0x467f1c={};var _0x48f1d6={'count':0x0,'rows':[]};return db[_0xfceb('0x3e')]['findOne']({'where':{'id':_0x336c65[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x5740d6,null))[_0xfceb('0x22')](function(_0x476c1f){if(_0x476c1f){_0x467f1c['model']=_[_0xfceb('0x45')](db['Disposition'][_0xfceb('0x3f')]);_0x467f1c[_0xfceb('0x44')]=_[_0xfceb('0x45')](_0x336c65['query']);_0x467f1c['filters']=_['intersection'](_0x467f1c[_0xfceb('0x42')],_0x467f1c['query']);_0x16b488[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x467f1c[_0xfceb('0x42')],qs['fields'](_0x336c65[_0xfceb('0x44')][_0xfceb('0x49')]));_0x16b488['attributes']=_0x16b488[_0xfceb('0x47')][_0xfceb('0x4a')]?_0x16b488[_0xfceb('0x47')]:_0x467f1c[_0xfceb('0x42')];if(!_0x336c65['query'][_0xfceb('0x6b')](_0xfceb('0x4b'))){_0x16b488[_0xfceb('0x30')]=qs['limit'](_0x336c65['query'][_0xfceb('0x30')]);_0x16b488[_0xfceb('0x4c')]=qs[_0xfceb('0x4c')](_0x336c65['query'][_0xfceb('0x4c')]);}_0x16b488[_0xfceb('0x4d')]=qs[_0xfceb('0x4e')](_0x336c65[_0xfceb('0x44')]['sort']);_0x16b488[_0xfceb('0x4f')]=qs[_0xfceb('0x46')](_[_0xfceb('0x50')](_0x336c65[_0xfceb('0x44')],_0x467f1c[_0xfceb('0x46')]));_0x16b488['where'][_0xfceb('0x69')]=_0x476c1f['id'];if(_0x336c65[_0xfceb('0x44')][_0xfceb('0x51')]){_0x16b488[_0xfceb('0x4f')]=_['merge'](_0x16b488['where'],{'$or':_[_0xfceb('0x3d')](_0x16b488[_0xfceb('0x47')],function(_0x349c2b){var _0x40c3e8={};_0x40c3e8[_0x349c2b]={'$like':'%'+_0x336c65['query']['filter']+'%'};return _0x40c3e8;})});}_0x16b488=_[_0xfceb('0x52')]({},_0x16b488,_0x336c65[_0xfceb('0x55')]);return db['Disposition'][_0xfceb('0x32')]({'where':_0x16b488[_0xfceb('0x4f')]})[_0xfceb('0x22')](function(_0x38badd){_0x48f1d6[_0xfceb('0x32')]=_0x38badd;if(_0x336c65[_0xfceb('0x44')]['includeAll']){_0x16b488[_0xfceb('0x5a')]=[{'all':!![]}];}return db[_0xfceb('0x6a')][_0xfceb('0x57')](_0x16b488);})[_0xfceb('0x22')](function(_0xb96141){_0x48f1d6[_0xfceb('0x6c')]=_0xb96141;return _0x48f1d6;});}})[_0xfceb('0x22')](respondWithFilteredResult(_0x5740d6,_0x16b488))['catch'](handleError(_0x5740d6,null));};exports[_0xfceb('0x6d')]=function(_0x59cd9b,_0x594e27,_0x37856a){return db['OpenchannelAccount']['find']({'where':{'id':_0x59cd9b[_0xfceb('0x66')]['id']}})['then'](handleEntityNotFound(_0x594e27,null))[_0xfceb('0x22')](function(_0x189949){if(_0x189949){return _0x189949[_0xfceb('0x6d')](_0x59cd9b[_0xfceb('0x44')][_0xfceb('0x6e')]);}})[_0xfceb('0x22')](respondWithStatusCode(_0x594e27,null))['catch'](handleError(_0x594e27,null));};exports[_0xfceb('0x6f')]=function(_0x3e783d,_0x1b4840,_0x442163){if(_0x3e783d['body']['id']){delete _0x3e783d[_0xfceb('0x5d')]['id'];}return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x3e783d[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x1b4840,null))['then'](function(_0x4fea87){if(_0x4fea87){_0x3e783d[_0xfceb('0x5d')][_0xfceb('0x69')]=_0x4fea87['id'];return db[_0xfceb('0x70')][_0xfceb('0x5c')](_0x3e783d['body']);}})[_0xfceb('0x22')](respondWithResult(_0x1b4840,null))[_0xfceb('0x2b')](handleError(_0x1b4840,null));};exports[_0xfceb('0x71')]=function(_0x247399,_0x322e8c,_0x590676){var _0x3f47e5={'raw':![],'where':{}};var _0x11ff6c={};var _0x5b8f08={'count':0x0,'rows':[]};return db[_0xfceb('0x3e')]['findOne']({'where':{'id':_0x247399['params']['id']}})['then'](handleEntityNotFound(_0x322e8c,null))[_0xfceb('0x22')](function(_0x885c0a){if(_0x885c0a){_0x11ff6c[_0xfceb('0x42')]=_[_0xfceb('0x45')](db[_0xfceb('0x70')]['rawAttributes']);_0x11ff6c[_0xfceb('0x44')]=_['keys'](_0x247399[_0xfceb('0x44')]);_0x11ff6c[_0xfceb('0x46')]=_[_0xfceb('0x48')](_0x11ff6c[_0xfceb('0x42')],_0x11ff6c[_0xfceb('0x44')]);_0x3f47e5[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x11ff6c[_0xfceb('0x42')],qs[_0xfceb('0x49')](_0x247399[_0xfceb('0x44')]['fields']));_0x3f47e5[_0xfceb('0x47')]=_0x3f47e5[_0xfceb('0x47')]['length']?_0x3f47e5[_0xfceb('0x47')]:_0x11ff6c[_0xfceb('0x42')];if(!_0x247399[_0xfceb('0x44')]['hasOwnProperty'](_0xfceb('0x4b'))){_0x3f47e5['limit']=qs[_0xfceb('0x30')](_0x247399[_0xfceb('0x44')][_0xfceb('0x30')]);_0x3f47e5[_0xfceb('0x4c')]=qs['offset'](_0x247399[_0xfceb('0x44')][_0xfceb('0x4c')]);}_0x3f47e5[_0xfceb('0x4d')]=qs[_0xfceb('0x4e')](_0x247399[_0xfceb('0x44')]['sort']);_0x3f47e5['where']=qs[_0xfceb('0x46')](_[_0xfceb('0x50')](_0x247399[_0xfceb('0x44')],_0x11ff6c[_0xfceb('0x46')]));_0x3f47e5[_0xfceb('0x4f')][_0xfceb('0x69')]=_0x885c0a['id'];if(_0x247399[_0xfceb('0x44')][_0xfceb('0x51')]){_0x3f47e5[_0xfceb('0x4f')]=_[_0xfceb('0x52')](_0x3f47e5[_0xfceb('0x4f')],{'$or':_['map'](_0x3f47e5[_0xfceb('0x47')],function(_0x4dfbd9){var _0x1435ba={};_0x1435ba[_0x4dfbd9]={'$like':'%'+_0x247399[_0xfceb('0x44')][_0xfceb('0x51')]+'%'};return _0x1435ba;})});}_0x3f47e5=_[_0xfceb('0x52')]({},_0x3f47e5,_0x247399[_0xfceb('0x55')]);return db[_0xfceb('0x70')][_0xfceb('0x32')]({'where':_0x3f47e5['where']})[_0xfceb('0x22')](function(_0x2e10fa){_0x5b8f08[_0xfceb('0x32')]=_0x2e10fa;if(_0x247399['query'][_0xfceb('0x56')]){_0x3f47e5[_0xfceb('0x5a')]=[{'all':!![]}];}return db[_0xfceb('0x70')]['findAll'](_0x3f47e5);})['then'](function(_0x327607){_0x5b8f08[_0xfceb('0x6c')]=_0x327607;return _0x5b8f08;});}})[_0xfceb('0x22')](respondWithFilteredResult(_0x322e8c,_0x3f47e5))[_0xfceb('0x2b')](handleError(_0x322e8c,null));};exports['removeAnswers']=function(_0x22c43f,_0x5904e0,_0x5558bb){return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x22c43f[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x5904e0,null))['then'](function(_0x24ca35){if(_0x24ca35){return _0x24ca35['removeAnswers'](_0x22c43f['query'][_0xfceb('0x6e')]);}})['then'](respondWithStatusCode(_0x5904e0,null))[_0xfceb('0x2b')](handleError(_0x5904e0,null));};exports[_0xfceb('0x72')]=function(_0x2356d5,_0x30e5a0,_0x27784f){var _0x7d1922={'body':_0x2356d5[_0xfceb('0x5d')],'channel':_0xfceb('0x73')};var _0x17a7e8=[];var _0x16e9d0=[];var _0x2c5f86={};var _0x3a75f3=![];return db[_0xfceb('0x74')][_0xfceb('0x67')]()[_0xfceb('0x22')](function(_0x5d4d6d){if(!_0x5d4d6d){throw new db[(_0xfceb('0x75'))]['ValidationError']('no\x20available\x20attributes');}_0x17a7e8=_[_0xfceb('0x76')](_[_0xfceb('0x45')](_0x5d4d6d),[_0xfceb('0x77'),_0xfceb('0x78')]);_0x16e9d0=_[_0xfceb('0x76')](_[_0xfceb('0x45')](_0x5d4d6d),[_0xfceb('0x77'),_0xfceb('0x78'),_0xfceb('0x79'),'ListId']);if(_0x2356d5[_0xfceb('0x5d')]['id']){delete _0x2356d5[_0xfceb('0x5d')]['id'];}if(_['isNil'](_0x2356d5['body'][_0xfceb('0x7a')])){throw new db['Sequelize'][(_0xfceb('0x7b'))](_0xfceb('0x7c'));}if(_[_0xfceb('0x7d')](_0x2356d5['body'][_0xfceb('0x5d')])||_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x5d')]===''){throw new db[(_0xfceb('0x75'))][(_0xfceb('0x7b'))](_0xfceb('0x7e'));}if(_['isNil'](_0x2356d5['body'][_0xfceb('0x7f')])){throw new db[(_0xfceb('0x75'))][(_0xfceb('0x7b'))](_0xfceb('0x80')+_0x16e9d0);}if(!_[_0xfceb('0x81')](_0x16e9d0,_0x2356d5['body']['mapKey'])){throw new db[(_0xfceb('0x75'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16e9d0);}_0x2c5f86[_0x2356d5['body'][_0xfceb('0x7f')]]=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x7a')];})[_0xfceb('0x22')](function(){return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x2356d5[_0xfceb('0x66')]['id']},'include':[{'model':db['CmList'],'as':_0xfceb('0x82'),'include':[{'model':db['CmContact'],'as':_0xfceb('0x83'),'where':_0x2c5f86,'limit':0x1,'order':[[_0xfceb('0x78'),_0xfceb('0x84')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0xfceb('0x22')](handleEntityNotFound(_0x30e5a0,null))[_0xfceb('0x22')](function(_0x360084){if(_0x360084&&_0x360084[_0xfceb('0x82')]){_0x7d1922[_0xfceb('0x85')]=_0x360084;_0x7d1922['applications']=_0x360084[_0xfceb('0x86')];_0x7d1922['list']=_0x360084[_0xfceb('0x82')];_0x7d1922[_0xfceb('0x87')]=_[_0xfceb('0x88')](_0x7d1922['applications'],[_0xfceb('0x89')],['asc']);if(_0x7d1922[_0xfceb('0x85')][_0xfceb('0x86')]){delete _0x7d1922['account'][_0xfceb('0x86')];}if(_0x7d1922[_0xfceb('0x85')][_0xfceb('0x82')]&&_0x7d1922[_0xfceb('0x85')][_0xfceb('0x82')][_0xfceb('0x83')][_0xfceb('0x4a')]){return _0x7d1922[_0xfceb('0x85')]['List'][_0xfceb('0x83')][0x0];}var _0x3c3efc=_['defaults'](_0x2356d5[_0xfceb('0x5d')],{'firstName':_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x7a')],'ListId':_0x360084[_0xfceb('0x8a')]});_0x3c3efc[_0x2356d5[_0xfceb('0x5d')]['mapKey']]=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x7a')];return db[_0xfceb('0x74')][_0xfceb('0x5c')](_0x3c3efc,{'fields':_0x17a7e8,'raw':!![]});}})[_0xfceb('0x22')](handleEntityNotFound(_0x30e5a0,null))[_0xfceb('0x22')](function(_0x163450){_0x7d1922[_0xfceb('0x8b')]=_0x163450;if(_0x163450){var _0xefc960={'ContactId':_0x163450['id'],'OpenchannelAccountId':_0x2356d5[_0xfceb('0x66')]['id'],'from':(_0x163450['firstName']||'')+'\x20'+(_0x163450[_0xfceb('0x8c')]||'')};var _0x38985c={'OpenchannelAccountId':_0x2356d5['params']['id'],'closed':![]};if(_0x2356d5[_0xfceb('0x5d')]['threadId']){_0x38985c[_0xfceb('0x8d')]=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x8d')];return db[_0xfceb('0x8e')][_0xfceb('0x5b')]({'where':_0x38985c})[_0xfceb('0x22')](function(_0x42ee12){if(_0x42ee12){return[_0x42ee12,![]];}_0xefc960[_0xfceb('0x8d')]=_0x2356d5['body'][_0xfceb('0x8d')];_0xefc960[_0xfceb('0x8f')]=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x8f')];return db[_0xfceb('0x8e')][_0xfceb('0x5c')](_0xefc960)[_0xfceb('0x22')](function(_0x12c3e8){return[_0x12c3e8,!![]];});});}else{_0x38985c['threadId']=null;}_0x38985c['ContactId']=_0x163450['id'];return db[_0xfceb('0x8e')][_0xfceb('0x5b')]({'where':_0x38985c})['then'](function(_0x5e0b67){if(_0x5e0b67){return[_0x5e0b67,![]];}return db[_0xfceb('0x8e')][_0xfceb('0x5c')](_0xefc960)[_0xfceb('0x22')](function(_0x53d028){return[_0x53d028,!![]];});});}})[_0xfceb('0x90')](function(_0x346785,_0x4bf376){if(_0x346785){_0x3a75f3=_0x4bf376;if(!_0x4bf376){var _0x3347f6={'from':(_0x7d1922['contact'][_0xfceb('0x91')]||'')+'\x20'+(_0x7d1922[_0xfceb('0x8b')][_0xfceb('0x8c')]||'')};if(_0x2356d5['body'][_0xfceb('0x8d')]&&_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x92')]&&_0x2356d5[_0xfceb('0x5d')]['threadId']!=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x92')]){_0x3347f6[_0xfceb('0x8d')]=_0x2356d5[_0xfceb('0x5d')][_0xfceb('0x92')];}return _0x346785['update'](_0x3347f6);}else{return _0x346785;}}})[_0xfceb('0x22')](function(_0x30d79a){_0x7d1922['interaction']=_0x30d79a[_0xfceb('0x5e')]({'plain':!![]});_0x7d1922[_0xfceb('0x93')]['created']=_0x3a75f3;if(_0x7d1922[_0xfceb('0x93')]['created']){if(_0x7d1922[_0xfceb('0x85')][_0xfceb('0x94')]){_0x7d1922['applications'][_0xfceb('0x95')]({'id':0x0,'priority':_0x7d1922[_0xfceb('0x87')][_0xfceb('0x4a')]+0x1,'app':'close','appdata':_0xfceb('0x96'),'interval':_0xfceb('0x97')});}}return db[_0xfceb('0x98')][_0xfceb('0x5c')]({'body':_0x2356d5['body'][_0xfceb('0x5d')],'OpenchannelAccountId':_0x2356d5[_0xfceb('0x66')]['id'],'OpenchannelInteractionId':_0x30d79a['id'],'direction':'in','ContactId':_0x7d1922[_0xfceb('0x8b')]['id'],'AttachmentId':_0x2356d5[_0xfceb('0x5d')]['AttachmentId']});})[_0xfceb('0x22')](function(_0x41396d){_0x7d1922['message']=_0x41396d;if(_0x7d1922[_0xfceb('0x93')][_0xfceb('0x99')]){return db[_0xfceb('0x9a')][_0xfceb('0x5b')]({'attributes':['id',_0xfceb('0x43')],'where':{'id':_0x7d1922['interaction'][_0xfceb('0x99')]}})['then'](function(_0x413d3e){if(_0x413d3e){_0x7d1922[_0xfceb('0x87')][_0xfceb('0x9b')]({'id':0x0,'priority':0x0,'app':_0xfceb('0x9c'),'appdata':_0x413d3e[_0xfceb('0x43')]+','+(_0x7d1922[_0xfceb('0x85')]['waitForTheAssignedAgent']||0xa),'interval':_0xfceb('0x97')});_0x7d1922[_0xfceb('0x9d')]=![];}return respondWithRpcPromise('Start',_0xfceb('0x9e'),_0x7d1922);});}return respondWithRpcPromise(_0xfceb('0x9f'),_0xfceb('0x9e'),_0x7d1922);})[_0xfceb('0x22')](function(_0x28edf5){respondWithRpcPromise(_0xfceb('0xa0'),_0xfceb('0xa0'),{'event':_0xfceb('0x72'),'message':_0x28edf5},client9002);return _0x28edf5;})[_0xfceb('0x22')](respondWithResult(_0x30e5a0,null))['catch'](handleError(_0x30e5a0,null));};exports[_0xfceb('0xa1')]=function(_0xad6902,_0x28f48a){var _0x2d1b65=_0xad6902[_0xfceb('0x66')]['id'];var _0x5758d8=_0xad6902[_0xfceb('0x5d')];var _0x284af6=0xc8;var _0x3c03af=null;return db[_0xfceb('0xa2')][_0xfceb('0xa3')]({'isolationLevel':db['sequelize'][_0xfceb('0xa4')][_0xfceb('0xa5')][_0xfceb('0xa6')]},function(_0x464b4a){return db[_0xfceb('0x3e')]['findOne']({'where':{'id':_0x2d1b65},'transaction':_0x464b4a})[_0xfceb('0x22')](function(_0x272ce8){if(_0x272ce8){return db[_0xfceb('0xa7')][_0xfceb('0x65')]({'where':{'OpenchannelAccountId':_0x2d1b65},'transaction':_0x464b4a})[_0xfceb('0x22')](function(){var _0x216657=_[_0xfceb('0x3d')](_0x5758d8,function(_0x48160d){_0x48160d[_0xfceb('0x69')]=_0x2d1b65;return _0x48160d;});return db['OpenchannelApplication']['bulkCreate'](_0x216657,{'transaction':_0x464b4a});});}else{_0x284af6=0x194;_0x3c03af=[];}});})[_0xfceb('0x22')](function(){if(_0x284af6!==0x194){return db[_0xfceb('0xa7')][_0xfceb('0xa8')]({'where':{'OpenchannelAccountId':_0x2d1b65},'order':'priority'})[_0xfceb('0x22')](function(_0x2f42dd){_0x3c03af=_0x2f42dd;});}})[_0xfceb('0x2b')](function(_0x5c8607){_0x284af6=0x1f4;logger['error'](_0x5c8607[_0xfceb('0xa9')]);if(_0x5c8607[_0xfceb('0x43')]){delete _0x5c8607[_0xfceb('0x43')];}_0x3c03af=_0x5c8607;})[_0xfceb('0xaa')](function(){if(_0x3c03af===null){_0x28f48a[_0xfceb('0x2c')](_0x284af6);}else{if(_0x284af6===0x1f4){_0x28f48a[_0xfceb('0x2d')](_0x284af6)['send'](_0x3c03af);}else{_0x28f48a[_0xfceb('0x2d')](_0x284af6)[_0xfceb('0x2f')](_0x3c03af);}}});};exports[_0xfceb('0xab')]=function(_0x58635b,_0x43374e,_0x39d1ee){var _0x106a52={};var _0x3147cf={};var _0x5178d3;var _0x56c96a;return db[_0xfceb('0x3e')][_0xfceb('0xac')]({'where':{'id':_0x58635b[_0xfceb('0x66')]['id']}})['then'](handleEntityNotFound(_0x43374e,null))['then'](function(_0x348d6f){if(_0x348d6f){_0x5178d3=_0x348d6f;_0x3147cf[_0xfceb('0x42')]=_[_0xfceb('0x45')](db[_0xfceb('0xa7')][_0xfceb('0x3f')]);_0x3147cf[_0xfceb('0x44')]=_['keys'](_0x58635b[_0xfceb('0x44')]);_0x3147cf[_0xfceb('0x46')]=_[_0xfceb('0x48')](_0x3147cf[_0xfceb('0x42')],_0x3147cf[_0xfceb('0x44')]);_0x106a52[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x3147cf[_0xfceb('0x42')],qs[_0xfceb('0x49')](_0x58635b[_0xfceb('0x44')][_0xfceb('0x49')]));_0x106a52[_0xfceb('0x47')]=_0x106a52[_0xfceb('0x47')][_0xfceb('0x4a')]?_0x106a52['attributes']:_0x3147cf[_0xfceb('0x42')];_0x106a52['order']=qs[_0xfceb('0x4e')](_0x58635b['query'][_0xfceb('0x4e')]);_0x106a52['where']=qs[_0xfceb('0x46')](_[_0xfceb('0x50')](_0x58635b[_0xfceb('0x44')],_0x3147cf[_0xfceb('0x46')]));if(_0x58635b[_0xfceb('0x44')][_0xfceb('0x51')]){_0x106a52['where']=_[_0xfceb('0x52')](_0x106a52[_0xfceb('0x4f')],{'$or':_[_0xfceb('0x3d')](_0x106a52[_0xfceb('0x47')],function(_0x1bbd97){var _0x37dece={};_0x37dece[_0x1bbd97]={'$like':'%'+_0x58635b[_0xfceb('0x44')][_0xfceb('0x51')]+'%'};return _0x37dece;})});}_0x106a52=_[_0xfceb('0x52')]({},_0x106a52,_0x58635b[_0xfceb('0x55')]);return _0x5178d3[_0xfceb('0xab')](_0x106a52);}})[_0xfceb('0x22')](function(_0xc241b3){if(_0xc241b3){_0x56c96a=_0xc241b3[_0xfceb('0x4a')];if(!_0x58635b[_0xfceb('0x44')][_0xfceb('0x6b')](_0xfceb('0x4b'))){_0x106a52[_0xfceb('0x30')]=qs[_0xfceb('0x30')](_0x58635b[_0xfceb('0x44')][_0xfceb('0x30')]);_0x106a52['offset']=qs['offset'](_0x58635b[_0xfceb('0x44')][_0xfceb('0x4c')]);}return _0x5178d3[_0xfceb('0xab')](_0x106a52);}})[_0xfceb('0x22')](function(_0x2a8cd6){if(_0x2a8cd6){return _0x2a8cd6?{'count':_0x56c96a,'rows':_0x2a8cd6}:null;}})[_0xfceb('0x22')](respondWithResult(_0x43374e,null))[_0xfceb('0x2b')](handleError(_0x43374e,null));};exports['getInteractions']=function(_0x3380ef,_0x1f84b1,_0x43a1d9){var _0xfbdac8={'raw':![],'where':{}};var _0x202e00={};var _0x1db3c6={'count':0x0,'rows':[]};return db[_0xfceb('0x3e')][_0xfceb('0xac')]({'where':{'id':_0x3380ef[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x1f84b1,null))[_0xfceb('0x22')](function(_0x1384fd){if(_0x1384fd){_0x202e00[_0xfceb('0x42')]=_[_0xfceb('0x45')](db[_0xfceb('0x8e')][_0xfceb('0x3f')]);_0x202e00[_0xfceb('0x44')]=_[_0xfceb('0x45')](_0x3380ef[_0xfceb('0x44')]);_0x202e00[_0xfceb('0x46')]=_[_0xfceb('0x48')](_0x202e00[_0xfceb('0x42')],_0x202e00[_0xfceb('0x44')]);_0xfbdac8['attributes']=_[_0xfceb('0x48')](_0x202e00[_0xfceb('0x42')],qs['fields'](_0x3380ef[_0xfceb('0x44')][_0xfceb('0x49')]));_0xfbdac8[_0xfceb('0x47')]=_0xfbdac8['attributes']['length']?_0xfbdac8['attributes']:_0x202e00[_0xfceb('0x42')];if(!_0x3380ef['query'][_0xfceb('0x6b')](_0xfceb('0x4b'))){_0xfbdac8[_0xfceb('0x30')]=qs['limit'](_0x3380ef[_0xfceb('0x44')]['limit']);_0xfbdac8[_0xfceb('0x4c')]=qs[_0xfceb('0x4c')](_0x3380ef[_0xfceb('0x44')][_0xfceb('0x4c')]);}_0xfbdac8['order']=qs[_0xfceb('0x4e')](_0x3380ef[_0xfceb('0x44')]['sort']);_0xfbdac8[_0xfceb('0x4f')]=qs[_0xfceb('0x46')](_['pick'](_0x3380ef[_0xfceb('0x44')],_0x202e00['filters']));_0xfbdac8['where'][_0xfceb('0x69')]=_0x1384fd['id'];if(_0x3380ef[_0xfceb('0x44')][_0xfceb('0x51')]){_0xfbdac8[_0xfceb('0x4f')]=_[_0xfceb('0x52')](_0xfbdac8[_0xfceb('0x4f')],{'$or':_['map'](_0xfbdac8[_0xfceb('0x47')],function(_0x3c4fce){var _0x30fcd4={};_0x30fcd4[_0x3c4fce]={'$like':'%'+_0x3380ef[_0xfceb('0x44')]['filter']+'%'};return _0x30fcd4;})});}_0xfbdac8=_[_0xfceb('0x52')]({},_0xfbdac8,_0x3380ef['options']);return db[_0xfceb('0x8e')]['count']({'where':_0xfbdac8[_0xfceb('0x4f')]})[_0xfceb('0x22')](function(_0xc64446){_0x1db3c6['count']=_0xc64446;if(_0x3380ef[_0xfceb('0x44')][_0xfceb('0x56')]){_0xfbdac8[_0xfceb('0x5a')]=[{'model':db[_0xfceb('0x74')],'as':_0xfceb('0xad'),'required':![]},{'model':db[_0xfceb('0x9a')],'as':_0xfceb('0xae'),'attributes':[_0xfceb('0x43'),'fullname',_0xfceb('0xaf')],'required':![]},{'model':db['Tag'],'as':_0xfceb('0xb0'),'attributes':['id','name',_0xfceb('0xb1')],'where':_0x3380ef[_0xfceb('0x44')]['tag']?{'id':_0x3380ef[_0xfceb('0x44')][_0xfceb('0xb2')]}:undefined,'required':_0x3380ef[_0xfceb('0x44')][_0xfceb('0xb2')]?!![]:![]}];}return db['OpenchannelInteraction']['findAll'](_0xfbdac8);})['then'](function(_0x10f324){_0x1db3c6[_0xfceb('0x6c')]=_0x10f324;return _0x1db3c6;});}})['then'](respondWithFilteredResult(_0x1f84b1,_0xfbdac8))[_0xfceb('0x2b')](handleError(_0x1f84b1,null));};exports[_0xfceb('0xb3')]=function(_0x16151a,_0x491af8,_0x39b42b){return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x16151a[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x491af8,null))[_0xfceb('0x22')](function(_0x16afb8){if(_0x16afb8){return _0x16afb8['addAgents'](_0x16151a[_0xfceb('0x5d')][_0xfceb('0x6e')],_[_0xfceb('0xb4')](_0x16151a[_0xfceb('0x5d')],[_0xfceb('0x6e'),'id'])||{})[_0xfceb('0x90')](function(_0x12ecce){for(var _0x4cb1f0=0x0;_0x4cb1f0<_0x16151a[_0xfceb('0x5d')][_0xfceb('0x6e')]['length'];_0x4cb1f0+=0x1){socket[_0xfceb('0xb5')](_0xfceb('0xb6'),{'UserId':Number(_0x16151a[_0xfceb('0x5d')][_0xfceb('0x6e')][_0x4cb1f0]),'OpenchannelAccountId':Number(_0x16151a[_0xfceb('0x66')]['id'])});}return _0x12ecce;});}})[_0xfceb('0x22')](respondWithResult(_0x491af8,null))['catch'](handleError(_0x491af8,null));};exports[_0xfceb('0xb7')]=function(_0x158a67,_0x5db688,_0x5150ab){return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x158a67['params']['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x5db688,null))[_0xfceb('0x22')](function(_0x26dc76){if(_0x26dc76){return _0x26dc76['removeAgents'](_0x158a67['query'][_0xfceb('0x6e')])['then'](function(){if(_[_0xfceb('0xb8')](_0x158a67[_0xfceb('0x44')]['ids'])){for(var _0x2ea812=0x0;_0x2ea812<_0x158a67[_0xfceb('0x44')]['ids'][_0xfceb('0x4a')];_0x2ea812+=0x1){socket[_0xfceb('0xb5')]('userOpenchannelAccount:remove',{'UserId':Number(_0x158a67[_0xfceb('0x44')]['ids'][_0x2ea812]),'OpenchannelAccountId':Number(_0x158a67[_0xfceb('0x66')]['id'])});}}else{socket[_0xfceb('0xb5')](_0xfceb('0xb9'),{'UserId':Number(_0x158a67[_0xfceb('0x44')][_0xfceb('0x6e')]),'OpenchannelAccountId':Number(_0x158a67[_0xfceb('0x66')]['id'])});}});}})[_0xfceb('0x22')](respondWithStatusCode(_0x5db688,null))[_0xfceb('0x2b')](handleError(_0x5db688,null));};exports[_0xfceb('0xba')]=function(_0x2f694f,_0x53455d,_0x2d2a4d){var _0x25f0f6={};var _0x3d0c11={};var _0x14edf7;var _0x176349;return db[_0xfceb('0x3e')][_0xfceb('0xac')]({'where':{'id':_0x2f694f[_0xfceb('0x66')]['id']}})[_0xfceb('0x22')](handleEntityNotFound(_0x53455d,null))[_0xfceb('0x22')](function(_0x43be4c){if(_0x43be4c){_0x14edf7=_0x43be4c;_0x3d0c11[_0xfceb('0x42')]=_[_0xfceb('0x45')](db[_0xfceb('0x9a')][_0xfceb('0x3f')]);_0x3d0c11['query']=_[_0xfceb('0x45')](_0x2f694f[_0xfceb('0x44')]);_0x3d0c11[_0xfceb('0x46')]=_[_0xfceb('0x48')](_0x3d0c11['model'],_0x3d0c11[_0xfceb('0x44')]);_0x25f0f6[_0xfceb('0x47')]=_[_0xfceb('0x48')](_0x3d0c11[_0xfceb('0x42')],qs[_0xfceb('0x49')](_0x2f694f[_0xfceb('0x44')]['fields']));_0x25f0f6[_0xfceb('0x47')]=_0x25f0f6['attributes']['length']?_0x25f0f6[_0xfceb('0x47')]:_0x3d0c11['model'];_0x25f0f6['order']=qs[_0xfceb('0x4e')](_0x2f694f[_0xfceb('0x44')][_0xfceb('0x4e')]);_0x25f0f6[_0xfceb('0x4f')]=qs['filters'](_[_0xfceb('0x50')](_0x2f694f[_0xfceb('0x44')],_0x3d0c11[_0xfceb('0x46')]));if(_0x2f694f[_0xfceb('0x44')][_0xfceb('0x51')]){_0x25f0f6[_0xfceb('0x4f')]=_[_0xfceb('0x52')](_0x25f0f6['where'],{'$or':_[_0xfceb('0x3d')](_0x25f0f6['attributes'],function(_0x32592f){var _0x3c1016={};_0x3c1016[_0x32592f]={'$like':'%'+_0x2f694f['query']['filter']+'%'};return _0x3c1016;})});}_0x25f0f6=_[_0xfceb('0x52')]({},_0x25f0f6,_0x2f694f[_0xfceb('0x55')]);return _0x14edf7[_0xfceb('0xba')](_0x25f0f6);}})[_0xfceb('0x22')](function(_0x11b881){if(_0x11b881){_0x176349=_0x11b881['length'];if(!_0x2f694f['query']['hasOwnProperty']('nolimit')){_0x25f0f6[_0xfceb('0x30')]=qs[_0xfceb('0x30')](_0x2f694f['query']['limit']);_0x25f0f6[_0xfceb('0x4c')]=qs[_0xfceb('0x4c')](_0x2f694f[_0xfceb('0x44')][_0xfceb('0x4c')]);}return _0x14edf7[_0xfceb('0xba')](_0x25f0f6);}})[_0xfceb('0x22')](function(_0x1588a5){if(_0x1588a5){return _0x1588a5?{'count':_0x176349,'rows':_0x1588a5}:null;}})['then'](respondWithResult(_0x53455d,null))[_0xfceb('0x2b')](handleError(_0x53455d,null));};exports[_0xfceb('0x3b')]=function(_0x472d83,_0x1eec98,_0x4d63c8){var _0x558888,_0x2b88b0,_0x5cb6fe;if(_['isNil'](_0x472d83[_0xfceb('0x5d')]['body'])||_0x472d83[_0xfceb('0x5d')][_0xfceb('0x5d')]===''){throw new db[(_0xfceb('0x75'))][(_0xfceb('0x7b'))](_0xfceb('0x7e'));}if(_[_0xfceb('0x7d')](_0x472d83[_0xfceb('0x5d')]['to'])){}_0x558888=_0x472d83['body']['to'];return db['OpenchannelAccount'][_0xfceb('0xac')]({'where':{'id':_0x472d83[_0xfceb('0x66')]['id']}})['then'](handleEntityNotFound(_0x1eec98,null))['then'](function(_0x2f0fca){if(_0x2f0fca){return db[_0xfceb('0x3e')][_0xfceb('0x5b')]({'where':{'id':_0x2f0fca['id']},'include':[{'model':db['CmList'],'as':_0xfceb('0x82'),'include':[{'model':db[_0xfceb('0x74')],'as':_0xfceb('0x83'),'where':{[_0x2f0fca[_0xfceb('0x7f')]]:_0x558888},'limit':0x1,'order':[[_0xfceb('0x78'),_0xfceb('0x84')]]}]}]})['then'](handleEntityNotFound(_0x1eec98,null))['then'](function(_0x11fc49){if(_0x11fc49&&_0x11fc49[_0xfceb('0x82')]){_0x2b88b0=_0x11fc49['get']({'plain':!![]});if(_0x2b88b0[_0xfceb('0x82')]&&_0x2b88b0['List'][_0xfceb('0x83')][_0xfceb('0x4a')]){return _0x2b88b0[_0xfceb('0x82')][_0xfceb('0x83')][0x0];}return db[_0xfceb('0x74')]['create'](_[_0xfceb('0x1a')](_0x472d83[_0xfceb('0x5d')],{'firstName':_0x558888,[_0x11fc49[_0xfceb('0x7f')]]:_0x558888,'phone':_0x558888,'ListId':_0x2b88b0[_0xfceb('0x8a')]}));}})[_0xfceb('0x22')](handleEntityNotFound(_0x1eec98,null))[_0xfceb('0x22')](function(_0x2186a9){if(_0x2186a9){_0x5cb6fe=_0x2186a9;return db[_0xfceb('0x8e')][_0xfceb('0x5b')]({'where':{'ContactId':_0x5cb6fe['id'],'closed':![],'OpenchannelAccountId':_0x2b88b0['id']}})[_0xfceb('0x22')](function(_0x43850b){if(_0x43850b){return[_0x43850b,![]];}return db['OpenchannelInteraction'][_0xfceb('0x5c')]({'UserId':_0x472d83[_0xfceb('0xbb')]['id'],'ContactId':_0x5cb6fe['id'],'OpenchannelAccountId':_0x2b88b0['id'],'lastMsgDirection':_0xfceb('0xbc'),'firstMsgDirection':_0xfceb('0xbc'),'Messages':[_[_0xfceb('0x52')](_0x472d83['body'],{'read':![],'body':_0x472d83[_0xfceb('0x5d')]['body'],'OpenchannelAccountId':_0x2b88b0['id'],'UserId':_0x472d83[_0xfceb('0xbb')]['id'],'ContactId':_0x5cb6fe['id']})]},{'include':[{'model':db[_0xfceb('0x98')],'as':'Messages'}]})[_0xfceb('0x22')](function(_0x3cb874){return[_0x3cb874,!![]];});});}})[_0xfceb('0x90')](function(_0x210282,_0x58a852){if(_0x58a852){return _0x210282;}return db['OpenchannelMessage'][_0xfceb('0x5c')](_['merge'](_0x472d83[_0xfceb('0x5d')],{'read':![],'body':_0x472d83[_0xfceb('0x5d')]['body'],'OpenchannelAccountId':_0x2b88b0['id'],'OpenchannelInteractionId':_0x210282['id'],'UserId':_0x472d83['user']['id'],'ContactId':_0x5cb6fe['id']}))[_0xfceb('0x22')](function(_0x5a4893){_0x210282[_0xfceb('0xbd')][_0xfceb('0xbe')]=[];_0x210282[_0xfceb('0xbd')][_0xfceb('0xbe')][_0xfceb('0x95')](_0x5a4893[_0xfceb('0xbd')]);return _0x210282;});});}})['then'](respondWithResult(_0x1eec98,null))['catch'](handleError(_0x1eec98,null));};
\ No newline at end of file
index 149cf90..a4dcee5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['exports','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x3afaae,_0x1ee943){var _0x21c7cc=function(_0x4f545d){while(--_0x4f545d){_0x3afaae['push'](_0x3afaae['shift']());}};_0x21c7cc(++_0x1ee943);}(_0x9bde,0xe1));var _0xe9bd=function(_0x4d5d52,_0x544d1c){_0x4d5d52=_0x4d5d52-0x0;var _0x2aa066=_0x9bde[_0x4d5d52];return _0x2aa066;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0xe9bd('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xe9bd('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe9bd('0x2'),'afterDestroy':_0xe9bd('0x3')};function emitEvent(_0x131f6a){return function(_0x1c1b34,_0x10822d,_0x1a4d14){OpenchannelAccountEvents[_0xe9bd('0x4')](_0x131f6a+':'+_0x1c1b34['id'],_0x1c1b34);OpenchannelAccountEvents['emit'](_0x131f6a,_0x1c1b34);_0x1a4d14(null);};}for(var e in events){if(events[_0xe9bd('0x5')](e)){var event=events[e];OpenchannelAccount[_0xe9bd('0x6')](e,emitEvent(event));}}module[_0xe9bd('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0x668b,0x140));var _0xb668=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x668b[_0x18d631];return _0x50d708;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index 24dd795..a109eed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xca357,_0x4495c9){var _0x516022=function(_0x5a759a){while(--_0x5a759a){_0xca357['push'](_0xca357['shift']());}};_0x516022(++_0x4495c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x8a3a4b,_0xede576){var _0x3e860f=function(_0x29b941){while(--_0x29b941){_0x8a3a4b['push'](_0x8a3a4b['shift']());}};_0x3e860f(++_0xede576);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 57f8ac0..8647e08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8130=['redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x21ebef,_0x555253){var _0xc27e9d=function(_0x46441c){while(--_0x46441c){_0x21ebef['push'](_0x21ebef['shift']());}};_0xc27e9d(++_0x555253);}(_0x8130,0x146));var _0x0813=function(_0x30d610,_0x2f6971){_0x30d610=_0x30d610-0x0;var _0x5083af=_0x8130[_0x30d610];return _0x5083af;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});config[_0x0813('0xa')]=_[_0x0813('0xb')](config[_0x0813('0xa')],{'host':_0x0813('0xc'),'port':0x18eb});var socket=require(_0x0813('0xd'))(new Redis(config[_0x0813('0xa')]));require('./openchannelAccount.socket')[_0x0813('0xe')](socket);function respondWithRpcPromise(_0x1815be,_0x251ca8,_0x5a9c5e){return new BPromise(function(_0x5550c8,_0x15f8d6){return client['request'](_0x1815be,_0x5a9c5e)[_0x0813('0xf')](function(_0x5b54ec){logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));logger[_0x0813('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x251ca8,'request\x20sent',JSON[_0x0813('0x14')](_0x5b54ec));if(_0x5b54ec[_0x0813('0x15')]){if(_0x5b54ec['error'][_0x0813('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x15f8d6(_0x5b54ec['error'][_0x0813('0x17')]);}logger['error'](_0x0813('0x11'),_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x5550c8(_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);}else{logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));_0x5550c8(_0x5b54ec['result'][_0x0813('0x17')]);}})['catch'](function(_0x112720){logger[_0x0813('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x112720);_0x15f8d6(_0x112720);});});}
\ No newline at end of file
+var _0xd547=['request','then','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter','register'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0xd547,0x1c1));var _0x7d54=function(_0x15165e,_0x47648c){_0x15165e=_0x15165e-0x0;var _0x3383e3=_0xd547[_0x15165e];return _0x3383e3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d54('0x0'));var BPromise=require(_0x7d54('0x1'));var rs=require(_0x7d54('0x2'));var fs=require('fs');var Redis=require(_0x7d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d54('0x4'))('rpc');var config=require(_0x7d54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d54('0x6')][_0x7d54('0x7')]({'port':0x232a});config[_0x7d54('0x8')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7d54('0x9'))(new Redis(config[_0x7d54('0x8')]));require('./openchannelAccount.socket')[_0x7d54('0xa')](socket);function respondWithRpcPromise(_0x48b250,_0x2bede6,_0x4d9dc3){return new BPromise(function(_0x1d7ff7,_0x570460){return client[_0x7d54('0xb')](_0x48b250,_0x4d9dc3)[_0x7d54('0xc')](function(_0x5bd01a){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x2bede6,_0x7d54('0xd'));logger[_0x7d54('0xe')](_0x7d54('0xf'),_0x2bede6,'request\x20sent',JSON[_0x7d54('0x10')](_0x5bd01a));if(_0x5bd01a['error']){if(_0x5bd01a[_0x7d54('0x11')]['code']===0x1f4){logger[_0x7d54('0x11')](_0x7d54('0x12'),_0x2bede6,_0x5bd01a['error'][_0x7d54('0x13')]);return _0x570460(_0x5bd01a[_0x7d54('0x11')][_0x7d54('0x13')]);}logger['error'](_0x7d54('0x12'),_0x2bede6,_0x5bd01a[_0x7d54('0x11')][_0x7d54('0x13')]);return _0x1d7ff7(_0x5bd01a[_0x7d54('0x11')][_0x7d54('0x13')]);}else{logger[_0x7d54('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x2bede6,_0x7d54('0xd'));_0x1d7ff7(_0x5bd01a[_0x7d54('0x15')]['message']);}})[_0x7d54('0x16')](function(_0x4b9caf){logger['error'](_0x7d54('0x12'),_0x2bede6,_0x4b9caf);_0x570460(_0x4b9caf);});});}
\ No newline at end of file
index 2c4e220..d833da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe80c=['save','remove','update','emit','removeListener','openchannelAccount:'];(function(_0x5a5d1b,_0x34fb86){var _0x50edc1=function(_0x307968){while(--_0x307968){_0x5a5d1b['push'](_0x5a5d1b['shift']());}};_0x50edc1(++_0x34fb86);}(_0xe80c,0x1c2));var _0xce80=function(_0x517eba,_0x1efb63){_0x517eba=_0x517eba-0x0;var _0x23a9d5=_0xe80c[_0x517eba];return _0x23a9d5;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xce80('0x0'),_0xce80('0x1'),_0xce80('0x2')];function createListener(_0x3cf532,_0x41b78c){return function(_0x589448){_0x41b78c[_0xce80('0x3')](_0x3cf532,_0x589448);};}function removeListener(_0xd0d912,_0x411d5e){return function(){OpenchannelAccountEvents[_0xce80('0x4')](_0xd0d912,_0x411d5e);};}exports['register']=function(_0xb10325){for(var _0x150f6a=0x0,_0xd8b88e=events['length'];_0x150f6a<_0xd8b88e;_0x150f6a++){var _0x2e1dc6=events[_0x150f6a];var _0x4c2e58=createListener(_0xce80('0x5')+_0x2e1dc6,_0xb10325);OpenchannelAccountEvents['on'](_0x2e1dc6,_0x4c2e58);}};
\ No newline at end of file
+var _0x37dc=['save','remove','update','emit','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x156b61,_0x277b89){var _0x3a4d4c=function(_0x58b353){while(--_0x58b353){_0x156b61['push'](_0x156b61['shift']());}};_0x3a4d4c(++_0x277b89);}(_0x37dc,0x1e9));var _0xc37d=function(_0x463fb3,_0x227d8c){_0x463fb3=_0x463fb3-0x0;var _0x14b13c=_0x37dc[_0x463fb3];return _0x14b13c;};'use strict';var OpenchannelAccountEvents=require(_0xc37d('0x0'));var events=[_0xc37d('0x1'),_0xc37d('0x2'),_0xc37d('0x3')];function createListener(_0x4cfb8b,_0x3f4a3e){return function(_0x551d27){_0x3f4a3e[_0xc37d('0x4')](_0x4cfb8b,_0x551d27);};}function removeListener(_0x52c6ae,_0x5ecb1f){return function(){OpenchannelAccountEvents['removeListener'](_0x52c6ae,_0x5ecb1f);};}exports['register']=function(_0x33c9db){for(var _0xa63f50=0x0,_0x11fe31=events[_0xc37d('0x5')];_0xa63f50<_0x11fe31;_0xa63f50++){var _0x1d6e8b=events[_0xa63f50];var _0x2076b3=createListener(_0xc37d('0x6')+_0x1d6e8b,_0x33c9db);OpenchannelAccountEvents['on'](_0x1d6e8b,_0x2076b3);}};
\ No newline at end of file
index e08a5c5..9907f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a61=['index','get','/:id','post','put','update','delete','exports','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0x0a61,0x1a8));var _0x10a6=function(_0x54ef0f,_0x5f510c){_0x54ef0f=_0x54ef0f-0x0;var _0x1e2f34=_0x0a61[_0x54ef0f];return _0x1e2f34;};'use strict';var multer=require('multer');var util=require(_0x10a6('0x0'));var path=require(_0x10a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x10a6('0x2'));var router=express['Router']();var fs_extra=require(_0x10a6('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x10a6('0x4'));var config=require(_0x10a6('0x5'));var controller=require(_0x10a6('0x6'));router['get']('/',auth[_0x10a6('0x7')](),controller[_0x10a6('0x8')]);router[_0x10a6('0x9')](_0x10a6('0xa'),auth[_0x10a6('0x7')](),controller['show']);router[_0x10a6('0xb')]('/',auth[_0x10a6('0x7')](),controller['create']);router[_0x10a6('0xc')](_0x10a6('0xa'),auth[_0x10a6('0x7')](),controller[_0x10a6('0xd')]);router[_0x10a6('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x10a6('0xf')]=router;
\ No newline at end of file
+var _0x892d=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelApplication.controller','isAuthenticated','index','/:id','show','post','create','update','destroy','exports'];(function(_0x105d22,_0x1ff278){var _0x41ea1b=function(_0x45ba13){while(--_0x45ba13){_0x105d22['push'](_0x105d22['shift']());}};_0x41ea1b(++_0x1ff278);}(_0x892d,0x150));var _0xd892=function(_0x59e508,_0x2c94c3){_0x59e508=_0x59e508-0x0;var _0x2599e1=_0x892d[_0x59e508];return _0x2599e1;};'use strict';var multer=require('multer');var util=require(_0xd892('0x0'));var path=require(_0xd892('0x1'));var timeout=require(_0xd892('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd892('0x3'));var auth=require(_0xd892('0x4'));var interaction=require(_0xd892('0x5'));var config=require('../../config/environment');var controller=require(_0xd892('0x6'));router['get']('/',auth[_0xd892('0x7')](),controller[_0xd892('0x8')]);router['get'](_0xd892('0x9'),auth[_0xd892('0x7')](),controller[_0xd892('0xa')]);router[_0xd892('0xb')]('/',auth[_0xd892('0x7')](),controller[_0xd892('0xc')]);router['put']('/:id',auth[_0xd892('0x7')](),controller[_0xd892('0xd')]);router['delete'](_0xd892('0x9'),auth['isAuthenticated'](),controller[_0xd892('0xe')]);module[_0xd892('0xf')]=router;
\ No newline at end of file
index ca173cf..ebb7552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd516=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x632fe,_0x3d53c4){var _0x53a8c2=function(_0x19b528){while(--_0x19b528){_0x632fe['push'](_0x632fe['shift']());}};_0x53a8c2(++_0x3d53c4);}(_0xd516,0x193));var _0x6d51=function(_0x8414bf,_0x4f587b){_0x8414bf=_0x8414bf-0x0;var _0x5846ad=_0xd516[_0x8414bf];return _0x5846ad;};'use strict';var Sequelize=require(_0x6d51('0x0'));module[_0x6d51('0x1')]={'priority':{'type':Sequelize[_0x6d51('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6d51('0x3')],'allowNull':![],'defaultValue':_0x6d51('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6d51('0x3')]},'interval':{'type':Sequelize[_0x6d51('0x3')],'defaultValue':_0x6d51('0x5')}};
\ No newline at end of file
+var _0x0576=['noop','TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0576,0x13b));var _0x6057=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0576[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x6057('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6057('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6057('0x2')],'allowNull':![],'defaultValue':_0x6057('0x3')},'appdata':{'type':Sequelize[_0x6057('0x4')]()},'description':{'type':Sequelize[_0x6057('0x2')]},'interval':{'type':Sequelize[_0x6057('0x2')],'defaultValue':_0x6057('0x5')}};
\ No newline at end of file
index 656a1bf..348bc15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a98=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','then','error','name','send','map','OpenchannelApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x10a8e8,_0x2918a3){var _0x364137=function(_0x55bb13){while(--_0x55bb13){_0x10a8e8['push'](_0x10a8e8['shift']());}};_0x364137(++_0x2918a3);}(_0x5a98,0x14c));var _0x85a9=function(_0x41808b,_0x1fc538){_0x41808b=_0x41808b-0x0;var _0x1c188e=_0x5a98[_0x41808b];return _0x1c188e;};'use strict';var emlformat=require(_0x85a9('0x0'));var rimraf=require(_0x85a9('0x1'));var zipdir=require(_0x85a9('0x2'));var jsonpatch=require(_0x85a9('0x3'));var rp=require(_0x85a9('0x4'));var moment=require(_0x85a9('0x5'));var BPromise=require(_0x85a9('0x6'));var Mustache=require('mustache');var util=require(_0x85a9('0x7'));var path=require(_0x85a9('0x8'));var sox=require(_0x85a9('0x9'));var csv=require(_0x85a9('0xa'));var ejs=require(_0x85a9('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x85a9('0xc'));var squel=require(_0x85a9('0xd'));var crypto=require(_0x85a9('0xe'));var jsforce=require(_0x85a9('0xf'));var deskjs=require(_0x85a9('0x10'));var toCsv=require('to-csv');var querystring=require(_0x85a9('0x11'));var Papa=require(_0x85a9('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x85a9('0x13'));var as=require(_0x85a9('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x85a9('0x15'));var config=require(_0x85a9('0x16'));var licenseUtil=require(_0x85a9('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29337d,_0x69f67b){_0x69f67b=_0x69f67b||0xcc;return function(_0x158ba4){if(_0x158ba4){return _0x29337d[_0x85a9('0x18')](_0x69f67b);}return _0x29337d[_0x85a9('0x19')](_0x69f67b)[_0x85a9('0x1a')]();};}function respondWithResult(_0x4ce341,_0x417d9b){_0x417d9b=_0x417d9b||0xc8;return function(_0x21afb9){if(_0x21afb9){return _0x4ce341[_0x85a9('0x19')](_0x417d9b)[_0x85a9('0x1b')](_0x21afb9);}};}function respondWithFilteredResult(_0x4e1074,_0x65e0e5){return function(_0x174ec8){if(_0x174ec8){var _0x27e60c=typeof _0x65e0e5[_0x85a9('0x1c')]===_0x85a9('0x1d')&&typeof _0x65e0e5[_0x85a9('0x1e')]==='undefined';var _0x943e32=_0x174ec8[_0x85a9('0x1f')];var _0x14cfb4=_0x27e60c?0x0:_0x65e0e5[_0x85a9('0x1c')];var _0x2a33c0=_0x27e60c?_0x174ec8[_0x85a9('0x1f')]:_0x65e0e5[_0x85a9('0x1c')]+_0x65e0e5[_0x85a9('0x1e')];var _0x4ecd20;if(_0x2a33c0>=_0x943e32){_0x2a33c0=_0x943e32;_0x4ecd20=0xc8;}else{_0x4ecd20=0xce;}_0x4e1074[_0x85a9('0x19')](_0x4ecd20);return _0x4e1074['set'](_0x85a9('0x20'),_0x14cfb4+'-'+_0x2a33c0+'/'+_0x943e32)['json'](_0x174ec8);}return null;};}function patchUpdates(_0xec6357){return function(_0x9d427){try{jsonpatch[_0x85a9('0x21')](_0x9d427,_0xec6357,!![]);}catch(_0xce51c2){return BPromise['reject'](_0xce51c2);}return _0x9d427['save']();};}function saveUpdates(_0x400cd7,_0x5276bd){return function(_0x158445){if(_0x158445){return _0x158445['update'](_0x400cd7)['then'](function(_0x36a793){return _0x36a793;});}return null;};}function removeEntity(_0x1e47bc,_0x54ffd9){return function(_0x441183){if(_0x441183){return _0x441183[_0x85a9('0x22')]()[_0x85a9('0x23')](function(){_0x1e47bc[_0x85a9('0x19')](0xcc)[_0x85a9('0x1a')]();});}};}function handleEntityNotFound(_0x3a0c95,_0x30c391){return function(_0x397897){if(!_0x397897){_0x3a0c95[_0x85a9('0x18')](0x194);}return _0x397897;};}function handleError(_0x265f67,_0x666ba8){_0x666ba8=_0x666ba8||0x1f4;return function(_0x1fdb5b){logger[_0x85a9('0x24')](_0x1fdb5b['stack']);if(_0x1fdb5b[_0x85a9('0x25')]){delete _0x1fdb5b[_0x85a9('0x25')];}_0x265f67[_0x85a9('0x19')](_0x666ba8)[_0x85a9('0x26')](_0x1fdb5b);};}exports['index']=function(_0x30c825,_0x1002e1){var _0x5f5ace={},_0x22262f={},_0x378022={'count':0x0,'rows':[]};var _0x20911d=_[_0x85a9('0x27')](db[_0x85a9('0x28')][_0x85a9('0x29')],function(_0x38c5c2){return{'name':_0x38c5c2['fieldName'],'type':_0x38c5c2[_0x85a9('0x2a')][_0x85a9('0x2b')]};});_0x22262f[_0x85a9('0x2c')]=_[_0x85a9('0x27')](_0x20911d,_0x85a9('0x25'));_0x22262f[_0x85a9('0x2d')]=_[_0x85a9('0x2e')](_0x30c825[_0x85a9('0x2d')]);_0x22262f[_0x85a9('0x2f')]=_[_0x85a9('0x30')](_0x22262f['model'],_0x22262f[_0x85a9('0x2d')]);_0x5f5ace[_0x85a9('0x31')]=_[_0x85a9('0x30')](_0x22262f[_0x85a9('0x2c')],qs[_0x85a9('0x32')](_0x30c825[_0x85a9('0x2d')]['fields']));_0x5f5ace[_0x85a9('0x31')]=_0x5f5ace[_0x85a9('0x31')][_0x85a9('0x33')]?_0x5f5ace[_0x85a9('0x31')]:_0x22262f[_0x85a9('0x2c')];if(!_0x30c825['query']['hasOwnProperty'](_0x85a9('0x34'))){_0x5f5ace[_0x85a9('0x1e')]=qs[_0x85a9('0x1e')](_0x30c825[_0x85a9('0x2d')][_0x85a9('0x1e')]);_0x5f5ace[_0x85a9('0x1c')]=qs[_0x85a9('0x1c')](_0x30c825['query'][_0x85a9('0x1c')]);}_0x5f5ace['order']=qs[_0x85a9('0x35')](_0x30c825[_0x85a9('0x2d')][_0x85a9('0x35')]);_0x5f5ace[_0x85a9('0x36')]=qs[_0x85a9('0x2f')](_[_0x85a9('0x37')](_0x30c825[_0x85a9('0x2d')],_0x22262f[_0x85a9('0x2f')]),_0x20911d);if(_0x30c825[_0x85a9('0x2d')][_0x85a9('0x38')]){_0x5f5ace[_0x85a9('0x36')]=_['merge'](_0x5f5ace[_0x85a9('0x36')],{'$or':_['map'](_0x20911d,function(_0x4decf2){if(_0x4decf2[_0x85a9('0x2a')]!==_0x85a9('0x39')){var _0x208ce4={};_0x208ce4[_0x4decf2[_0x85a9('0x25')]]={'$like':'%'+_0x30c825[_0x85a9('0x2d')]['filter']+'%'};return _0x208ce4;}})});}_0x5f5ace=_[_0x85a9('0x3a')]({},_0x5f5ace,_0x30c825[_0x85a9('0x3b')]);var _0x39aad5={'where':_0x5f5ace['where']};return db[_0x85a9('0x28')][_0x85a9('0x1f')](_0x39aad5)['then'](function(_0x389662){_0x378022['count']=_0x389662;if(_0x30c825[_0x85a9('0x2d')][_0x85a9('0x3c')]){_0x5f5ace[_0x85a9('0x3d')]=[{'all':!![]}];}return db[_0x85a9('0x28')]['findAll'](_0x5f5ace);})[_0x85a9('0x23')](function(_0xc5420c){_0x378022[_0x85a9('0x3e')]=_0xc5420c;return _0x378022;})[_0x85a9('0x23')](respondWithFilteredResult(_0x1002e1,_0x5f5ace))[_0x85a9('0x3f')](handleError(_0x1002e1,null));};exports[_0x85a9('0x40')]=function(_0x162936,_0x2b5906){var _0x58a1b0={'raw':!![],'where':{'id':_0x162936['params']['id']}},_0x37b95a={};_0x37b95a[_0x85a9('0x2c')]=_[_0x85a9('0x2e')](db['OpenchannelApplication'][_0x85a9('0x29')]);_0x37b95a[_0x85a9('0x2d')]=_['keys'](_0x162936['query']);_0x37b95a[_0x85a9('0x2f')]=_[_0x85a9('0x30')](_0x37b95a['model'],_0x37b95a[_0x85a9('0x2d')]);_0x58a1b0['attributes']=_[_0x85a9('0x30')](_0x37b95a[_0x85a9('0x2c')],qs['fields'](_0x162936[_0x85a9('0x2d')]['fields']));_0x58a1b0[_0x85a9('0x31')]=_0x58a1b0[_0x85a9('0x31')][_0x85a9('0x33')]?_0x58a1b0[_0x85a9('0x31')]:_0x37b95a[_0x85a9('0x2c')];if(_0x162936['query']['includeAll']){_0x58a1b0[_0x85a9('0x3d')]=[{'all':!![]}];}_0x58a1b0=_['merge']({},_0x58a1b0,_0x162936[_0x85a9('0x3b')]);return db['OpenchannelApplication']['find'](_0x58a1b0)[_0x85a9('0x23')](handleEntityNotFound(_0x2b5906,null))[_0x85a9('0x23')](respondWithResult(_0x2b5906,null))['catch'](handleError(_0x2b5906,null));};exports[_0x85a9('0x41')]=function(_0x6a32b7,_0x372113){return db[_0x85a9('0x28')][_0x85a9('0x41')](_0x6a32b7['body'],{})[_0x85a9('0x23')](respondWithResult(_0x372113,0xc9))['catch'](handleError(_0x372113,null));};exports[_0x85a9('0x42')]=function(_0x594a4c,_0x1900da){if(_0x594a4c[_0x85a9('0x43')]['id']){delete _0x594a4c['body']['id'];}return db[_0x85a9('0x28')][_0x85a9('0x44')]({'where':{'id':_0x594a4c[_0x85a9('0x45')]['id']}})[_0x85a9('0x23')](handleEntityNotFound(_0x1900da,null))['then'](saveUpdates(_0x594a4c[_0x85a9('0x43')],null))['then'](respondWithResult(_0x1900da,null))[_0x85a9('0x3f')](handleError(_0x1900da,null));};exports[_0x85a9('0x22')]=function(_0x5f3737,_0x1b1868){return db[_0x85a9('0x28')][_0x85a9('0x44')]({'where':{'id':_0x5f3737[_0x85a9('0x45')]['id']}})[_0x85a9('0x23')](handleEntityNotFound(_0x1b1868,null))['then'](removeEntity(_0x1b1868,null))[_0x85a9('0x3f')](handleError(_0x1b1868,null));};
\ No newline at end of file
+var _0x34e0=['merge','VIRTUAL','OpenchannelApplication','count','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where'];(function(_0x3fd123,_0x306718){var _0x123a49=function(_0x28294d){while(--_0x28294d){_0x3fd123['push'](_0x3fd123['shift']());}};_0x123a49(++_0x306718);}(_0x34e0,0xf9));var _0x034e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x34e0[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x034e('0x0'));var rimraf=require(_0x034e('0x1'));var zipdir=require(_0x034e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x034e('0x3'));var moment=require(_0x034e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x034e('0x5'));var util=require(_0x034e('0x6'));var path=require(_0x034e('0x7'));var sox=require(_0x034e('0x8'));var csv=require('to-csv');var ejs=require(_0x034e('0x9'));var fs=require('fs');var fs_extra=require(_0x034e('0xa'));var _=require(_0x034e('0xb'));var squel=require(_0x034e('0xc'));var crypto=require(_0x034e('0xd'));var jsforce=require(_0x034e('0xe'));var deskjs=require(_0x034e('0xf'));var toCsv=require(_0x034e('0x10'));var querystring=require(_0x034e('0x11'));var Papa=require(_0x034e('0x12'));var Redis=require(_0x034e('0x13'));var authService=require(_0x034e('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x034e('0x15'));var licenseUtil=require(_0x034e('0x16'));var db=require(_0x034e('0x17'))['db'];function respondWithStatusCode(_0x386e44,_0x20ee65){_0x20ee65=_0x20ee65||0xcc;return function(_0x5db4fa){if(_0x5db4fa){return _0x386e44[_0x034e('0x18')](_0x20ee65);}return _0x386e44[_0x034e('0x19')](_0x20ee65)[_0x034e('0x1a')]();};}function respondWithResult(_0x19ffd0,_0x4c8efc){_0x4c8efc=_0x4c8efc||0xc8;return function(_0x523330){if(_0x523330){return _0x19ffd0['status'](_0x4c8efc)[_0x034e('0x1b')](_0x523330);}};}function respondWithFilteredResult(_0x488a36,_0x3b64cb){return function(_0x9137e2){if(_0x9137e2){var _0x2d7611=typeof _0x3b64cb[_0x034e('0x1c')]===_0x034e('0x1d')&&typeof _0x3b64cb[_0x034e('0x1e')]===_0x034e('0x1d');var _0x587e67=_0x9137e2['count'];var _0x3b80fb=_0x2d7611?0x0:_0x3b64cb['offset'];var _0x54ce29=_0x2d7611?_0x9137e2['count']:_0x3b64cb[_0x034e('0x1c')]+_0x3b64cb[_0x034e('0x1e')];var _0x1d0695;if(_0x54ce29>=_0x587e67){_0x54ce29=_0x587e67;_0x1d0695=0xc8;}else{_0x1d0695=0xce;}_0x488a36[_0x034e('0x19')](_0x1d0695);return _0x488a36[_0x034e('0x1f')](_0x034e('0x20'),_0x3b80fb+'-'+_0x54ce29+'/'+_0x587e67)[_0x034e('0x1b')](_0x9137e2);}return null;};}function patchUpdates(_0x4d668a){return function(_0x292f1a){try{jsonpatch[_0x034e('0x21')](_0x292f1a,_0x4d668a,!![]);}catch(_0x1c1ac4){return BPromise[_0x034e('0x22')](_0x1c1ac4);}return _0x292f1a[_0x034e('0x23')]();};}function saveUpdates(_0x46dd38,_0x3894ff){return function(_0x38b197){if(_0x38b197){return _0x38b197[_0x034e('0x24')](_0x46dd38)[_0x034e('0x25')](function(_0x8f3c46){return _0x8f3c46;});}return null;};}function removeEntity(_0x4d58c3,_0x1da491){return function(_0x824961){if(_0x824961){return _0x824961[_0x034e('0x26')]()[_0x034e('0x25')](function(){_0x4d58c3[_0x034e('0x19')](0xcc)[_0x034e('0x1a')]();});}};}function handleEntityNotFound(_0x27c557,_0x378119){return function(_0xa931c5){if(!_0xa931c5){_0x27c557[_0x034e('0x18')](0x194);}return _0xa931c5;};}function handleError(_0x454aec,_0x4b664d){_0x4b664d=_0x4b664d||0x1f4;return function(_0x465c04){logger[_0x034e('0x27')](_0x465c04[_0x034e('0x28')]);if(_0x465c04[_0x034e('0x29')]){delete _0x465c04[_0x034e('0x29')];}_0x454aec['status'](_0x4b664d)[_0x034e('0x2a')](_0x465c04);};}exports[_0x034e('0x2b')]=function(_0x19f843,_0x470a8d){var _0x1daed6={},_0x50f4e8={},_0x1134f8={'count':0x0,'rows':[]};var _0x272b29=_[_0x034e('0x2c')](db['OpenchannelApplication'][_0x034e('0x2d')],function(_0x2eafab){return{'name':_0x2eafab['fieldName'],'type':_0x2eafab[_0x034e('0x2e')][_0x034e('0x2f')]};});_0x50f4e8[_0x034e('0x30')]=_[_0x034e('0x2c')](_0x272b29,_0x034e('0x29'));_0x50f4e8[_0x034e('0x31')]=_[_0x034e('0x32')](_0x19f843[_0x034e('0x31')]);_0x50f4e8['filters']=_[_0x034e('0x33')](_0x50f4e8[_0x034e('0x30')],_0x50f4e8[_0x034e('0x31')]);_0x1daed6[_0x034e('0x34')]=_[_0x034e('0x33')](_0x50f4e8[_0x034e('0x30')],qs[_0x034e('0x35')](_0x19f843[_0x034e('0x31')]['fields']));_0x1daed6[_0x034e('0x34')]=_0x1daed6[_0x034e('0x34')][_0x034e('0x36')]?_0x1daed6[_0x034e('0x34')]:_0x50f4e8[_0x034e('0x30')];if(!_0x19f843[_0x034e('0x31')][_0x034e('0x37')](_0x034e('0x38'))){_0x1daed6[_0x034e('0x1e')]=qs['limit'](_0x19f843['query'][_0x034e('0x1e')]);_0x1daed6[_0x034e('0x1c')]=qs['offset'](_0x19f843[_0x034e('0x31')]['offset']);}_0x1daed6[_0x034e('0x39')]=qs[_0x034e('0x3a')](_0x19f843[_0x034e('0x31')][_0x034e('0x3a')]);_0x1daed6['where']=qs['filters'](_[_0x034e('0x3b')](_0x19f843[_0x034e('0x31')],_0x50f4e8[_0x034e('0x3c')]),_0x272b29);if(_0x19f843[_0x034e('0x31')][_0x034e('0x3d')]){_0x1daed6[_0x034e('0x3e')]=_[_0x034e('0x3f')](_0x1daed6['where'],{'$or':_[_0x034e('0x2c')](_0x272b29,function(_0x1fde7b){if(_0x1fde7b[_0x034e('0x2e')]!==_0x034e('0x40')){var _0x2528cd={};_0x2528cd[_0x1fde7b[_0x034e('0x29')]]={'$like':'%'+_0x19f843['query'][_0x034e('0x3d')]+'%'};return _0x2528cd;}})});}_0x1daed6=_['merge']({},_0x1daed6,_0x19f843['options']);var _0x440326={'where':_0x1daed6[_0x034e('0x3e')]};return db[_0x034e('0x41')][_0x034e('0x42')](_0x440326)[_0x034e('0x25')](function(_0x304008){_0x1134f8[_0x034e('0x42')]=_0x304008;if(_0x19f843['query'][_0x034e('0x43')]){_0x1daed6[_0x034e('0x44')]=[{'all':!![]}];}return db[_0x034e('0x41')][_0x034e('0x45')](_0x1daed6);})[_0x034e('0x25')](function(_0x37d2ce){_0x1134f8[_0x034e('0x46')]=_0x37d2ce;return _0x1134f8;})[_0x034e('0x25')](respondWithFilteredResult(_0x470a8d,_0x1daed6))[_0x034e('0x47')](handleError(_0x470a8d,null));};exports[_0x034e('0x48')]=function(_0x139775,_0x26ffe0){var _0x1160ce={'raw':!![],'where':{'id':_0x139775['params']['id']}},_0xd80c45={};_0xd80c45[_0x034e('0x30')]=_[_0x034e('0x32')](db[_0x034e('0x41')][_0x034e('0x2d')]);_0xd80c45[_0x034e('0x31')]=_['keys'](_0x139775[_0x034e('0x31')]);_0xd80c45[_0x034e('0x3c')]=_[_0x034e('0x33')](_0xd80c45[_0x034e('0x30')],_0xd80c45[_0x034e('0x31')]);_0x1160ce[_0x034e('0x34')]=_['intersection'](_0xd80c45['model'],qs[_0x034e('0x35')](_0x139775[_0x034e('0x31')][_0x034e('0x35')]));_0x1160ce[_0x034e('0x34')]=_0x1160ce['attributes']['length']?_0x1160ce[_0x034e('0x34')]:_0xd80c45['model'];if(_0x139775[_0x034e('0x31')][_0x034e('0x43')]){_0x1160ce[_0x034e('0x44')]=[{'all':!![]}];}_0x1160ce=_[_0x034e('0x3f')]({},_0x1160ce,_0x139775[_0x034e('0x49')]);return db['OpenchannelApplication'][_0x034e('0x4a')](_0x1160ce)[_0x034e('0x25')](handleEntityNotFound(_0x26ffe0,null))[_0x034e('0x25')](respondWithResult(_0x26ffe0,null))[_0x034e('0x47')](handleError(_0x26ffe0,null));};exports['create']=function(_0x1d0eb0,_0x115155){return db[_0x034e('0x41')][_0x034e('0x4b')](_0x1d0eb0[_0x034e('0x4c')],{})[_0x034e('0x25')](respondWithResult(_0x115155,0xc9))[_0x034e('0x47')](handleError(_0x115155,null));};exports['update']=function(_0x4bb6c8,_0x29b928){if(_0x4bb6c8[_0x034e('0x4c')]['id']){delete _0x4bb6c8[_0x034e('0x4c')]['id'];}return db[_0x034e('0x41')]['find']({'where':{'id':_0x4bb6c8[_0x034e('0x4d')]['id']}})[_0x034e('0x25')](handleEntityNotFound(_0x29b928,null))['then'](saveUpdates(_0x4bb6c8['body'],null))[_0x034e('0x25')](respondWithResult(_0x29b928,null))['catch'](handleError(_0x29b928,null));};exports[_0x034e('0x26')]=function(_0x22b551,_0x28fdbd){return db['OpenchannelApplication']['find']({'where':{'id':_0x22b551['params']['id']}})[_0x034e('0x25')](handleEntityNotFound(_0x28fdbd,null))[_0x034e('0x25')](removeEntity(_0x28fdbd,null))['catch'](handleError(_0x28fdbd,null));};
\ No newline at end of file
index fa674f7..1d2f170 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa549=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xa549,0x151));var _0x9a54=function(_0x16a0d8,_0x19f6c0){_0x16a0d8=_0x16a0d8-0x0;var _0x540161=_0xa549[_0x16a0d8];return _0x540161;};'use strict';var _=require(_0x9a54('0x0'));var util=require(_0x9a54('0x1'));var logger=require(_0x9a54('0x2'))('api');var moment=require(_0x9a54('0x3'));var BPromise=require('bluebird');var rp=require(_0x9a54('0x4'));var fs=require('fs');var path=require(_0x9a54('0x5'));var rimraf=require(_0x9a54('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a54('0x7'));module[_0x9a54('0x8')]=function(_0x3e2a75,_0x2736d){return _0x3e2a75[_0x9a54('0x9')](_0x9a54('0xa'),attributes,{'tableName':_0x9a54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9a54('0xc'),'collate':_0x9a54('0xd')});};
\ No newline at end of file
+var _0x98d6=['utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment','define','OpenchannelApplication','openchannel_applications'];(function(_0x383b90,_0x931dfa){var _0x5a2e83=function(_0x20c92d){while(--_0x20c92d){_0x383b90['push'](_0x383b90['shift']());}};_0x5a2e83(++_0x931dfa);}(_0x98d6,0xf3));var _0x698d=function(_0x25e4d1,_0x845147){_0x25e4d1=_0x25e4d1-0x0;var _0x5bcae5=_0x98d6[_0x25e4d1];return _0x5bcae5;};'use strict';var _=require(_0x698d('0x0'));var util=require(_0x698d('0x1'));var logger=require('../../config/logger')(_0x698d('0x2'));var moment=require('moment');var BPromise=require(_0x698d('0x3'));var rp=require(_0x698d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x698d('0x5'));var config=require(_0x698d('0x6'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x3ac12f,_0x4a4e5e){return _0x3ac12f[_0x698d('0x7')](_0x698d('0x8'),attributes,{'tableName':_0x698d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x698d('0xa')});};
\ No newline at end of file
index 1ac5372..5276a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5df9=['debug','stringify','error','OpenchannelApplication,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','options','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x5df9,0xec));var _0x95df=function(_0x697cc5,_0x27fa4d){_0x697cc5=_0x697cc5-0x0;var _0x283421=_0x5df9[_0x697cc5];return _0x283421;};'use strict';var _=require(_0x95df('0x0'));var util=require(_0x95df('0x1'));var moment=require(_0x95df('0x2'));var BPromise=require(_0x95df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95df('0x4'));var db=require(_0x95df('0x5'))['db'];var utils=require(_0x95df('0x6'));var logger=require(_0x95df('0x7'))(_0x95df('0x8'));var config=require(_0x95df('0x9'));var jayson=require(_0x95df('0xa'));var client=jayson[_0x95df('0xb')][_0x95df('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x494982,_0x35e01e,_0x11ad97){return new BPromise(function(_0x502840,_0x48d3e5){return client['request'](_0x494982,_0x11ad97)[_0x95df('0xd')](function(_0x49f9b8){logger[_0x95df('0xe')]('OpenchannelApplication,\x20%s,\x20%s',_0x35e01e,_0x95df('0xf'));logger[_0x95df('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x35e01e,_0x95df('0xf'),JSON[_0x95df('0x11')](_0x49f9b8));if(_0x49f9b8[_0x95df('0x12')]){if(_0x49f9b8['error']['code']===0x1f4){logger[_0x95df('0x12')](_0x95df('0x13'),_0x35e01e,_0x49f9b8[_0x95df('0x12')][_0x95df('0x14')]);return _0x48d3e5(_0x49f9b8['error'][_0x95df('0x14')]);}logger[_0x95df('0x12')](_0x95df('0x13'),_0x35e01e,_0x49f9b8[_0x95df('0x12')][_0x95df('0x14')]);return _0x502840(_0x49f9b8[_0x95df('0x12')][_0x95df('0x14')]);}else{logger[_0x95df('0xe')](_0x95df('0x13'),_0x35e01e,_0x95df('0xf'));_0x502840(_0x49f9b8[_0x95df('0x15')]['message']);}})[_0x95df('0x16')](function(_0x56d647){logger[_0x95df('0x12')](_0x95df('0x13'),_0x35e01e,_0x56d647);_0x48d3e5(_0x56d647);});});}exports[_0x95df('0x17')]=function(_0x5daa17){var _0x5ec1c4=this;return new Promise(function(_0x4cf6ea,_0x43e03f){return db[_0x95df('0x18')]['update'](_0x5daa17['body'],{'raw':_0x5daa17[_0x95df('0x19')]?_0x5daa17[_0x95df('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5daa17['options']?_0x5daa17[_0x95df('0x19')][_0x95df('0x1a')]||null:null,'attributes':_0x5daa17['options']?_0x5daa17['options']['attributes']||null:null,'limit':_0x5daa17[_0x95df('0x19')]?_0x5daa17['options'][_0x95df('0x1b')]||null:null})[_0x95df('0xd')](function(_0x30203a){logger[_0x95df('0xe')](_0x95df('0x17'),_0x5daa17);logger[_0x95df('0x10')](_0x95df('0x17'),_0x5daa17,JSON['stringify'](_0x30203a));_0x4cf6ea(_0x30203a);})[_0x95df('0x16')](function(_0x11e721){logger[_0x95df('0x12')](_0x95df('0x17'),_0x11e721[_0x95df('0x14')],_0x5daa17);_0x43e03f(_0x5ec1c4[_0x95df('0x12')](0x1f4,_0x11e721[_0x95df('0x14')]));});});};
\ No newline at end of file
+var _0xc5c3=['raw','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','update','body','options'];(function(_0x5b5720,_0x56ffee){var _0x49601d=function(_0x45868a){while(--_0x45868a){_0x5b5720['push'](_0x5b5720['shift']());}};_0x49601d(++_0x56ffee);}(_0xc5c3,0x158));var _0x3c5c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3c5c('0x0'));var util=require(_0x3c5c('0x1'));var moment=require(_0x3c5c('0x2'));var BPromise=require(_0x3c5c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c5c('0x4'));var db=require(_0x3c5c('0x5'))['db'];var utils=require(_0x3c5c('0x6'));var logger=require('../../config/logger')(_0x3c5c('0x7'));var config=require(_0x3c5c('0x8'));var jayson=require(_0x3c5c('0x9'));var client=jayson['client'][_0x3c5c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c75d1,_0x1349a5,_0x3674bf){return new BPromise(function(_0x258297,_0x4f6570){return client[_0x3c5c('0xb')](_0x2c75d1,_0x3674bf)[_0x3c5c('0xc')](function(_0x3e8890){logger[_0x3c5c('0xd')](_0x3c5c('0xe'),_0x1349a5,_0x3c5c('0xf'));logger[_0x3c5c('0x10')](_0x3c5c('0x11'),_0x1349a5,'request\x20sent',JSON[_0x3c5c('0x12')](_0x3e8890));if(_0x3e8890['error']){if(_0x3e8890[_0x3c5c('0x13')][_0x3c5c('0x14')]===0x1f4){logger['error'](_0x3c5c('0xe'),_0x1349a5,_0x3e8890[_0x3c5c('0x13')][_0x3c5c('0x15')]);return _0x4f6570(_0x3e8890['error'][_0x3c5c('0x15')]);}logger['error'](_0x3c5c('0xe'),_0x1349a5,_0x3e8890[_0x3c5c('0x13')][_0x3c5c('0x15')]);return _0x258297(_0x3e8890['error'][_0x3c5c('0x15')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x1349a5,_0x3c5c('0xf'));_0x258297(_0x3e8890[_0x3c5c('0x16')][_0x3c5c('0x15')]);}})[_0x3c5c('0x17')](function(_0x3f8e7e){logger[_0x3c5c('0x13')](_0x3c5c('0xe'),_0x1349a5,_0x3f8e7e);_0x4f6570(_0x3f8e7e);});});}exports[_0x3c5c('0x18')]=function(_0x4f21af){var _0x1ce85d=this;return new Promise(function(_0x2b9565,_0x598a0f){return db['OpenchannelApplication'][_0x3c5c('0x19')](_0x4f21af[_0x3c5c('0x1a')],{'raw':_0x4f21af[_0x3c5c('0x1b')]?_0x4f21af[_0x3c5c('0x1b')][_0x3c5c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f21af[_0x3c5c('0x1b')]?_0x4f21af[_0x3c5c('0x1b')][_0x3c5c('0x1d')]||null:null,'attributes':_0x4f21af[_0x3c5c('0x1b')]?_0x4f21af['options'][_0x3c5c('0x1e')]||null:null,'limit':_0x4f21af[_0x3c5c('0x1b')]?_0x4f21af[_0x3c5c('0x1b')]['limit']||null:null})[_0x3c5c('0xc')](function(_0x53f4f5){logger['info'](_0x3c5c('0x18'),_0x4f21af);logger[_0x3c5c('0x10')](_0x3c5c('0x18'),_0x4f21af,JSON['stringify'](_0x53f4f5));_0x2b9565(_0x53f4f5);})['catch'](function(_0x2f4e53){logger['error'](_0x3c5c('0x18'),_0x2f4e53[_0x3c5c('0x15')],_0x4f21af);_0x598a0f(_0x1ce85d[_0x3c5c('0x13')](0x1f4,_0x2f4e53['message']));});});};
\ No newline at end of file
index 462b056..e218564 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x879e=['/:id/download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','update','delete','/:id','openchannelinteraction:destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id/messages','getMessages'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x879e,0x75));var _0xe879=function(_0x502a32,_0x23d261){_0x502a32=_0x502a32-0x0;var _0x30191c=_0x879e[_0x502a32];return _0x30191c;};'use strict';var multer=require(_0xe879('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe879('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe879('0x2'));var auth=require(_0xe879('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe879('0x4'));var controller=require(_0xe879('0x5'));router[_0xe879('0x6')]('/',auth[_0xe879('0x7')](),controller[_0xe879('0x8')]);router['get'](_0xe879('0x9'),auth[_0xe879('0x7')](),controller[_0xe879('0xa')]);router[_0xe879('0x6')]('/:id',auth[_0xe879('0x7')](),controller['show']);router[_0xe879('0x6')](_0xe879('0xb'),auth[_0xe879('0x7')](),controller[_0xe879('0xc')]);router[_0xe879('0x6')](_0xe879('0xd'),auth[_0xe879('0x7')](),controller['download']);router[_0xe879('0xe')]('/',auth['isAuthenticated'](),controller[_0xe879('0xf')]);router[_0xe879('0xe')]('/:id/messages',auth[_0xe879('0x7')](),controller[_0xe879('0x10')]);router[_0xe879('0xe')](_0xe879('0x11'),auth[_0xe879('0x7')](),interaction[_0xe879('0x12')](_0xe879('0x13'),_0xe879('0x14')),controller[_0xe879('0x15')]);router['put']('/:id',auth[_0xe879('0x7')](),interaction[_0xe879('0x12')](_0xe879('0x13'),'openchannelinteraction:update'),controller[_0xe879('0x16')]);router[_0xe879('0x17')](_0xe879('0x18'),auth[_0xe879('0x7')](),interaction['tracked'](_0xe879('0x13'),_0xe879('0x19')),controller['destroy']);router['delete'](_0xe879('0x11'),auth[_0xe879('0x7')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xe3fc=['get','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xe3fc,0x1e6));var _0xce3f=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xe3fc[_0x58965a];return _0x254efc;};'use strict';var multer=require(_0xce3f('0x0'));var util=require(_0xce3f('0x1'));var path=require(_0xce3f('0x2'));var timeout=require(_0xce3f('0x3'));var express=require('express');var router=express[_0xce3f('0x4')]();var fs_extra=require(_0xce3f('0x5'));var auth=require(_0xce3f('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0xce3f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xce3f('0x8'),auth[_0xce3f('0x9')](),controller[_0xce3f('0xa')]);router[_0xce3f('0x7')](_0xce3f('0xb'),auth[_0xce3f('0x9')](),controller['show']);router[_0xce3f('0x7')](_0xce3f('0xc'),auth['isAuthenticated'](),controller[_0xce3f('0xd')]);router['get'](_0xce3f('0xe'),auth[_0xce3f('0x9')](),controller[_0xce3f('0xf')]);router[_0xce3f('0x10')]('/',auth[_0xce3f('0x9')](),controller[_0xce3f('0x11')]);router[_0xce3f('0x10')](_0xce3f('0xc'),auth[_0xce3f('0x9')](),controller[_0xce3f('0x12')]);router['post'](_0xce3f('0x13'),auth['isAuthenticated'](),interaction[_0xce3f('0x14')](_0xce3f('0x15'),_0xce3f('0x16')),controller[_0xce3f('0x17')]);router['put']('/:id',auth[_0xce3f('0x9')](),interaction[_0xce3f('0x14')]('openchannel',_0xce3f('0x18')),controller['update']);router[_0xce3f('0x19')](_0xce3f('0xb'),auth[_0xce3f('0x9')](),interaction[_0xce3f('0x14')](_0xce3f('0x15'),_0xce3f('0x1a')),controller['destroy']);router[_0xce3f('0x19')](_0xce3f('0x13'),auth[_0xce3f('0x9')](),controller[_0xce3f('0x1b')]);module[_0xce3f('0x1c')]=router;
\ No newline at end of file
index 0604ac3..78028a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2830=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x2830,0x117));var _0x0283=function(_0x2a9775,_0x48f6f1){_0x2a9775=_0x2a9775-0x0;var _0x2efc73=_0x2830[_0x2a9775];return _0x2efc73;};'use strict';var Sequelize=require(_0x0283('0x0'));module[_0x0283('0x1')]={'closed':{'type':Sequelize[_0x0283('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0283('0x3')]},'disposition':{'type':Sequelize[_0x0283('0x4')]},'secondDisposition':{'type':Sequelize[_0x0283('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0283('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0283('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x0283('0x4')]},'lastMsgAt':{'type':Sequelize[_0x0283('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0283('0x5')]('in',_0x0283('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x0283('0x5')]('in',_0x0283('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0283('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x8a55=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3f3034,_0x150243){var _0x1a20a5=function(_0x20572e){while(--_0x20572e){_0x3f3034['push'](_0x3f3034['shift']());}};_0x1a20a5(++_0x150243);}(_0x8a55,0x185));var _0x58a5=function(_0x1fe971,_0x207d99){_0x1fe971=_0x1fe971-0x0;var _0x3d3e5a=_0x8a55[_0x1fe971];return _0x3d3e5a;};'use strict';var Sequelize=require(_0x58a5('0x0'));module[_0x58a5('0x1')]={'closed':{'type':Sequelize[_0x58a5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x58a5('0x3')]},'disposition':{'type':Sequelize[_0x58a5('0x4')]},'secondDisposition':{'type':Sequelize[_0x58a5('0x4')]},'thirdDisposition':{'type':Sequelize[_0x58a5('0x4')]},'note':{'type':Sequelize[_0x58a5('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x58a5('0x4')]},'externalUrl':{'type':Sequelize[_0x58a5('0x4')]},'lastMsgAt':{'type':Sequelize[_0x58a5('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x58a5('0x5')]('in',_0x58a5('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x58a5('0x5')]('in',_0x58a5('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x58a5('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x58a5('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 841cbd2..3f97887 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0d3=['pipe','System','Contact','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','then','error','stack','name','send','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','catch','from','params','keys','filters','intersection','model','attributes','fields','length','includeAll','options','find','create','body','describe','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','merge','OpenchannelMessage','include','rows','spread','Tag','findAll','color','emit','removeTags','unix','toString','join','root','tmp','server','files','attachments','transcript-%d-%s.zip','push','User','fullname','firstName','lastName','Attachment','Messages','createdAt','read','Account','get','mkdirSync','Openchannel','Owner','closedAt','disposition','threadId','Public','map','basename','existsSync'];(function(_0x180053,_0x3e4a7a){var _0x107796=function(_0x1a0eaa){while(--_0x1a0eaa){_0x180053['push'](_0x180053['shift']());}};_0x107796(++_0x3e4a7a);}(_0xe0d3,0x107));var _0x3e0d=function(_0x305269,_0x3e6b51){_0x305269=_0x305269-0x0;var _0x44f1f1=_0xe0d3[_0x305269];return _0x44f1f1;};'use strict';var rimraf=require(_0x3e0d('0x0'));var zipdir=require(_0x3e0d('0x1'));var moment=require(_0x3e0d('0x2'));var util=require(_0x3e0d('0x3'));var path=require(_0x3e0d('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3e0d('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0x3e0d('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x3e0d('0x7'))(_0x3e0d('0x8'));var config=require(_0x3e0d('0x9'));var db=require(_0x3e0d('0xa'))['db'];config[_0x3e0d('0xb')]=_[_0x3e0d('0xc')](config[_0x3e0d('0xb')],{'host':_0x3e0d('0xd'),'port':0x18eb});var socket=require(_0x3e0d('0xe'))(new Redis(config['redis']));require(_0x3e0d('0xf'))[_0x3e0d('0x10')](socket);function respondWithStatusCode(_0xad21bf,_0x33dfdd){_0x33dfdd=_0x33dfdd||0xcc;return function(_0x10178b){if(_0x10178b){return _0xad21bf[_0x3e0d('0x11')](_0x33dfdd);}return _0xad21bf[_0x3e0d('0x12')](_0x33dfdd)[_0x3e0d('0x13')]();};}function respondWithResult(_0x885c46,_0x42121c){_0x42121c=_0x42121c||0xc8;return function(_0x88263){if(_0x88263){return _0x885c46['status'](_0x42121c)[_0x3e0d('0x14')](_0x88263);}};}function respondWithFilteredResult(_0x121b9b,_0x1ec480){return function(_0x6f9d63){if(_0x6f9d63){var _0x4f8164=typeof _0x1ec480['offset']===_0x3e0d('0x15')&&typeof _0x1ec480['limit']===_0x3e0d('0x15');var _0x175e43=_0x6f9d63[_0x3e0d('0x16')];var _0x24c803=_0x4f8164?0x0:_0x1ec480[_0x3e0d('0x17')];var _0x512b1f=_0x4f8164?_0x6f9d63[_0x3e0d('0x16')]:_0x1ec480['offset']+_0x1ec480[_0x3e0d('0x18')];var _0x32b99c;if(_0x512b1f>=_0x175e43){_0x512b1f=_0x175e43;_0x32b99c=0xc8;}else{_0x32b99c=0xce;}_0x121b9b[_0x3e0d('0x12')](_0x32b99c);return _0x121b9b[_0x3e0d('0x19')](_0x3e0d('0x1a'),_0x24c803+'-'+_0x512b1f+'/'+_0x175e43)[_0x3e0d('0x14')](_0x6f9d63);}return null;};}function saveUpdates(_0x4d9336){return function(_0x20b80f){if(_0x20b80f){return _0x20b80f[_0x3e0d('0x1b')](_0x4d9336)['then'](function(_0x1f3442){return _0x1f3442;});}return null;};}function removeEntity(_0x47083f){return function(_0x198643){if(_0x198643){return _0x198643[_0x3e0d('0x1c')]()[_0x3e0d('0x1d')](function(){_0x47083f[_0x3e0d('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x501cf6){return function(_0xe37713){if(!_0xe37713){_0x501cf6[_0x3e0d('0x11')](0x194);}return _0xe37713;};}function handleError(_0x3ff55e,_0x5526ae){_0x5526ae=_0x5526ae||0x1f4;return function(_0x1da366){logger[_0x3e0d('0x1e')](_0x1da366[_0x3e0d('0x1f')]);if(_0x1da366['name']){delete _0x1da366[_0x3e0d('0x20')];}_0x3ff55e[_0x3e0d('0x12')](_0x5526ae)[_0x3e0d('0x21')](_0x1da366);};}exports['index']=function(_0x147c60,_0x4dcb20){var _0x2a938f={};var _0x3f451a=_['map'](db[_0x3e0d('0x22')][_0x3e0d('0x23')],function(_0x4063be){return{'name':_0x4063be[_0x3e0d('0x24')],'type':_0x4063be[_0x3e0d('0x25')][_0x3e0d('0x26')]};});_0x2a938f=qs[_0x3e0d('0x27')](_0x3f451a,_0x147c60);return interaction['findAll'](_0x3e0d('0x28'),_0x147c60[_0x3e0d('0x29')],_0x147c60[_0x3e0d('0x2a')],_0x2a938f,_0x3f451a)[_0x3e0d('0x1d')](respondWithFilteredResult(_0x4dcb20,_0x2a938f))[_0x3e0d('0x2b')](handleError(_0x4dcb20,null));};exports['show']=function(_0x5224e6,_0x36d64e){var _0x24741e={};if(_0x5224e6[_0x3e0d('0x29')]['type']&&_0x5224e6[_0x3e0d('0x29')]['type']===_0x3e0d('0x2c')){_0x24741e['from']=_0x5224e6[_0x3e0d('0x2d')]['id'];}else{_0x24741e['id']=_0x5224e6[_0x3e0d('0x2d')]['id'];}var _0x1f744b={'raw':![],'where':_0x24741e},_0x5d8cbd={};_0x5d8cbd['model']=_[_0x3e0d('0x2e')](db[_0x3e0d('0x22')][_0x3e0d('0x23')]);_0x5d8cbd[_0x3e0d('0x29')]=_[_0x3e0d('0x2e')](_0x5224e6['query']);_0x5d8cbd[_0x3e0d('0x2f')]=_[_0x3e0d('0x30')](_0x5d8cbd[_0x3e0d('0x31')],_0x5d8cbd[_0x3e0d('0x29')]);_0x1f744b[_0x3e0d('0x32')]=_[_0x3e0d('0x30')](_0x5d8cbd[_0x3e0d('0x31')],qs[_0x3e0d('0x33')](_0x5224e6[_0x3e0d('0x29')][_0x3e0d('0x33')]));_0x1f744b['attributes']=_0x1f744b[_0x3e0d('0x32')][_0x3e0d('0x34')]?_0x1f744b['attributes']:_0x5d8cbd[_0x3e0d('0x31')];if(_0x5224e6['query'][_0x3e0d('0x35')]){_0x1f744b['include']=[{'all':!![]}];}_0x1f744b=_['merge']({},_0x1f744b,_0x5224e6[_0x3e0d('0x36')]);return db['OpenchannelInteraction'][_0x3e0d('0x37')](_0x1f744b)[_0x3e0d('0x1d')](handleEntityNotFound(_0x36d64e,null))[_0x3e0d('0x1d')](respondWithResult(_0x36d64e,null))['catch'](handleError(_0x36d64e,null));};exports[_0x3e0d('0x38')]=function(_0x963404,_0x3753a1){return db[_0x3e0d('0x22')][_0x3e0d('0x38')](_0x963404[_0x3e0d('0x39')],{})[_0x3e0d('0x1d')](respondWithResult(_0x3753a1,0xc9))[_0x3e0d('0x2b')](handleError(_0x3753a1,null));};exports[_0x3e0d('0x1b')]=function(_0x52e0b6,_0x2f29e0){if(_0x52e0b6[_0x3e0d('0x39')]['id']){delete _0x52e0b6[_0x3e0d('0x39')]['id'];}return db['OpenchannelInteraction'][_0x3e0d('0x37')]({'where':{'id':_0x52e0b6[_0x3e0d('0x2d')]['id']}})[_0x3e0d('0x1d')](handleEntityNotFound(_0x2f29e0,null))['then'](saveUpdates(_0x52e0b6[_0x3e0d('0x39')],null))[_0x3e0d('0x1d')](respondWithResult(_0x2f29e0,null))[_0x3e0d('0x2b')](handleError(_0x2f29e0,null));};exports[_0x3e0d('0x1c')]=function(_0x1e09e3,_0x442339){return db[_0x3e0d('0x22')][_0x3e0d('0x37')]({'where':{'id':_0x1e09e3[_0x3e0d('0x2d')]['id']}})['then'](handleEntityNotFound(_0x442339,null))[_0x3e0d('0x1d')](removeEntity(_0x442339,null))['catch'](handleError(_0x442339,null));};exports[_0x3e0d('0x3a')]=function(_0x3c4935,_0x6b88f0){return db['OpenchannelInteraction'][_0x3e0d('0x3a')]()[_0x3e0d('0x1d')](respondWithResult(_0x6b88f0,null))[_0x3e0d('0x2b')](handleError(_0x6b88f0,null));};exports[_0x3e0d('0x3b')]=function(_0x5030f7,_0x5c5f75){return db['OpenchannelMessage'][_0x3e0d('0x37')]({'where':{'id':_0x5030f7['params']['id']}})[_0x3e0d('0x1d')](handleEntityNotFound(_0x5c5f75,null))[_0x3e0d('0x1d')](function(_0x127981){if(_0x127981){return _0x127981[_0x3e0d('0x3b')](_0x5030f7['body'][_0x3e0d('0x3c')],_[_0x3e0d('0x3d')](_0x5030f7[_0x3e0d('0x39')],[_0x3e0d('0x3c'),'id'])||{});}})[_0x3e0d('0x1d')](respondWithResult(_0x5c5f75,null))[_0x3e0d('0x2b')](handleError(_0x5c5f75,null));};exports[_0x3e0d('0x3e')]=function(_0xe8976e,_0x3d1f0b){var _0x287087={'raw':![],'where':{}};var _0x4a84ca={};var _0x593f3e={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0xe8976e['params']['id']}})[_0x3e0d('0x1d')](handleEntityNotFound(_0x3d1f0b,null))[_0x3e0d('0x1d')](function(_0x43f9d9){if(_0x43f9d9){_0x4a84ca[_0x3e0d('0x31')]=_[_0x3e0d('0x2e')](db['OpenchannelMessage']['rawAttributes']);_0x4a84ca['query']=_[_0x3e0d('0x2e')](_0xe8976e[_0x3e0d('0x29')]);_0x4a84ca[_0x3e0d('0x2f')]=_['intersection'](_0x4a84ca[_0x3e0d('0x31')],_0x4a84ca[_0x3e0d('0x29')]);_0x287087[_0x3e0d('0x32')]=_['intersection'](_0x4a84ca[_0x3e0d('0x31')],qs[_0x3e0d('0x33')](_0xe8976e[_0x3e0d('0x29')][_0x3e0d('0x33')]));_0x287087[_0x3e0d('0x32')]=_0x287087[_0x3e0d('0x32')]['length']?_0x287087[_0x3e0d('0x32')]:_0x4a84ca[_0x3e0d('0x31')];if(!_0xe8976e['query'][_0x3e0d('0x3f')](_0x3e0d('0x40'))){_0x287087['limit']=qs['limit'](_0xe8976e[_0x3e0d('0x29')][_0x3e0d('0x18')]);_0x287087['offset']=qs[_0x3e0d('0x17')](_0xe8976e['query'][_0x3e0d('0x17')]);}_0x287087[_0x3e0d('0x41')]=qs[_0x3e0d('0x42')](_0xe8976e[_0x3e0d('0x29')]['sort']);_0x287087[_0x3e0d('0x43')]=qs[_0x3e0d('0x2f')](_[_0x3e0d('0x44')](_0xe8976e[_0x3e0d('0x29')],_0x4a84ca['filters']));_0x287087['where'][_0x3e0d('0x45')]=_0x43f9d9['id'];if(_0xe8976e[_0x3e0d('0x29')][_0x3e0d('0x46')]){_0x287087[_0x3e0d('0x43')]=_['merge'](_0x287087[_0x3e0d('0x43')],{'$or':_['map'](_0x287087[_0x3e0d('0x32')],function(_0xe3b00c){var _0x9b5ce9={};_0x9b5ce9[_0xe3b00c]={'$like':'%'+_0xe8976e['query'][_0x3e0d('0x46')]+'%'};return _0x9b5ce9;})});}if(_0xe8976e[_0x3e0d('0x29')][_0x3e0d('0x47')]){var _0x1bebdf=_0xe8976e['query'][_0x3e0d('0x47')][_0x3e0d('0x48')](',');var _0x5a89b1={};_0x5a89b1[_0x1bebdf[0x0]]={'$gte':moment(_0x1bebdf[0x1])[_0x3e0d('0x49')](_0x3e0d('0x4a'))};_0x287087[_0x3e0d('0x43')]=_[_0x3e0d('0x4b')](_0x287087[_0x3e0d('0x43')],_0x5a89b1);}_0x287087=_[_0x3e0d('0x4b')]({},_0x287087,_0xe8976e[_0x3e0d('0x36')]);return db[_0x3e0d('0x4c')][_0x3e0d('0x16')]({'where':_0x287087[_0x3e0d('0x43')]})[_0x3e0d('0x1d')](function(_0x32cd75){_0x593f3e[_0x3e0d('0x16')]=_0x32cd75;if(_0xe8976e[_0x3e0d('0x29')]['includeAll']){_0x287087[_0x3e0d('0x4d')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x287087);})[_0x3e0d('0x1d')](function(_0x2c2df7){_0x593f3e[_0x3e0d('0x4e')]=_0x2c2df7;return _0x593f3e;});}})['then'](respondWithFilteredResult(_0x3d1f0b,_0x287087))['catch'](handleError(_0x3d1f0b,null));};exports['addTags']=function(_0x593bf8,_0x56c4ed){return db[_0x3e0d('0x22')]['find']({'where':{'id':_0x593bf8[_0x3e0d('0x2d')]['id']}})[_0x3e0d('0x1d')](handleEntityNotFound(_0x56c4ed,null))[_0x3e0d('0x1d')](function(_0x529a55){if(_0x529a55){return _0x529a55['setTags'](_0x593bf8[_0x3e0d('0x39')][_0x3e0d('0x3c')],_[_0x3e0d('0x3d')](_0x593bf8[_0x3e0d('0x39')],['ids','id'])||{})[_0x3e0d('0x4f')](function(){return db[_0x3e0d('0x50')][_0x3e0d('0x51')]({'attributes':['id',_0x3e0d('0x20'),_0x3e0d('0x52')],'where':{'id':_0x593bf8[_0x3e0d('0x39')][_0x3e0d('0x3c')]}});})[_0x3e0d('0x1d')](function(_0x386ecd){socket[_0x3e0d('0x53')]('openchannelInteractionTags:save',{'id':Number(_0x593bf8['params']['id']),'tags':_0x386ecd||[]});return{'id':Number(_0x593bf8[_0x3e0d('0x2d')]['id']),'tags':_0x386ecd||[]};});}})['then'](respondWithResult(_0x56c4ed,null))[_0x3e0d('0x2b')](handleError(_0x56c4ed,null));};exports[_0x3e0d('0x54')]=function(_0x3ef93e,_0x39f831){return db[_0x3e0d('0x22')][_0x3e0d('0x37')]({'where':{'id':_0x3ef93e[_0x3e0d('0x2d')]['id']}})[_0x3e0d('0x1d')](handleEntityNotFound(_0x39f831,null))[_0x3e0d('0x1d')](function(_0xf3b449){if(_0xf3b449){return _0xf3b449[_0x3e0d('0x54')](_0x3ef93e[_0x3e0d('0x29')][_0x3e0d('0x3c')]);}})[_0x3e0d('0x1d')](respondWithStatusCode(_0x39f831,null))['catch'](handleError(_0x39f831,null));};exports['download']=function(_0x1ead17,_0x232ce5){var _0x102195=moment()[_0x3e0d('0x55')]()[_0x3e0d('0x56')]();var _0x4191f2=path[_0x3e0d('0x57')](config[_0x3e0d('0x58')],'server','files',_0x3e0d('0x59'));var _0x29de58=path['join'](config[_0x3e0d('0x58')],_0x3e0d('0x5a'),_0x3e0d('0x5b'),_0x3e0d('0x5c'));var _0x5adff9=path[_0x3e0d('0x57')](_0x4191f2,_0x102195);var _0x1be106=util['format'](_0x3e0d('0x5d'),_0x1ead17['params']['id'],_0x102195);var _0x422e5b=path[_0x3e0d('0x57')](_0x4191f2,_0x1be106);var _0x337042=[];_0x337042[_0x3e0d('0x5e')]({'model':db[_0x3e0d('0x5f')],'as':_0x3e0d('0x5f'),'attributes':['id',_0x3e0d('0x60')],'raw':!![]});_0x337042[_0x3e0d('0x5e')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0x3e0d('0x61'),_0x3e0d('0x62')],'raw':!![]});if(_0x1ead17[_0x3e0d('0x29')]['attachments']){_0x337042['push']({'model':db[_0x3e0d('0x63')],'as':_0x3e0d('0x63'),'raw':!![]});}var _0x448311=[{'model':db[_0x3e0d('0x4c')],'as':_0x3e0d('0x64'),'attributes':['id',_0x3e0d('0x39'),_0x3e0d('0x65'),'direction','secret',_0x3e0d('0x66')],'include':_0x337042}];_0x448311[_0x3e0d('0x5e')]({'model':db['OpenchannelAccount'],'as':_0x3e0d('0x67'),'attributes':['id',_0x3e0d('0x20')]});_0x448311[_0x3e0d('0x5e')]({'model':db[_0x3e0d('0x5f')],'as':'Owner','attributes':['id',_0x3e0d('0x60')]});return db[_0x3e0d('0x22')][_0x3e0d('0x37')]({'where':{'id':_0x1ead17[_0x3e0d('0x2d')]['id']},'include':_0x448311})[_0x3e0d('0x1d')](handleEntityNotFound(_0x232ce5,null))[_0x3e0d('0x1d')](function(_0x4fe021){if(_0x4fe021){var _0x1ffdd4=_0x4fe021[_0x3e0d('0x68')]({'plain':!![]});fs[_0x3e0d('0x69')](_0x5adff9);var _0x29e646={'channel':_0x3e0d('0x6a'),'account':_0x1ffdd4[_0x3e0d('0x67')][_0x3e0d('0x20')],'agent':_0x1ffdd4[_0x3e0d('0x6b')]?_0x1ffdd4['Owner'][_0x3e0d('0x60')]:'N.A.','createdAt':moment(_0x1ffdd4[_0x3e0d('0x65')])[_0x3e0d('0x49')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3e0d('0x56')](),'closedAt':_0x1ffdd4['closed']?moment(_0x1ffdd4[_0x3e0d('0x6c')])[_0x3e0d('0x49')](_0x3e0d('0x4a'))[_0x3e0d('0x56')]():'','disposition':_0x1ffdd4[_0x3e0d('0x6d')],'visibility':_0x1ffdd4[_0x3e0d('0x6e')]?_0x3e0d('0x6f'):'Private','messages':_(_0x1ffdd4[_0x3e0d('0x64')])[_0x3e0d('0x46')]({'secret':![]})[_0x3e0d('0x70')](function(_0x3138ba){if(_0x3138ba['Attachment']){var _0x57900c=path[_0x3e0d('0x57')](_0x29de58,_0x3138ba[_0x3e0d('0x63')][_0x3e0d('0x71')]);if(fs[_0x3e0d('0x72')](_0x57900c)){fs['createReadStream'](_0x57900c)[_0x3e0d('0x73')](fs['createWriteStream'](path[_0x3e0d('0x57')](_0x5adff9,_0x3138ba[_0x3e0d('0x63')]['basename'])));}}return{'date':moment(_0x3138ba[_0x3e0d('0x65')])['format'](_0x3e0d('0x4a'))[_0x3e0d('0x56')](),'sender':_0x3138ba['direction']==='out'?_0x3138ba[_0x3e0d('0x5f')]?_0x3138ba['User']['fullname']:_0x3e0d('0x74'):_0x3138ba['Contact'][_0x3e0d('0x61')]+(_0x3138ba[_0x3e0d('0x75')][_0x3e0d('0x62')]?'\x20'+_0x3138ba['Contact'][_0x3e0d('0x62')]:''),'body':_0x3138ba['Attachment']?_0x3138ba['Attachment'][_0x3e0d('0x71')]:_0x3138ba['body'],'direction':_0x3138ba['direction']===_0x3e0d('0x76')?'A':'C','secret':_0x3138ba['secret'],'read':_0x3138ba[_0x3e0d('0x66')],'attachment':_0x3138ba[_0x3e0d('0x63')]};})['value']()};return ejs[_0x3e0d('0x77')](path['join'](config[_0x3e0d('0x58')],_0x3e0d('0x5a'),_0x3e0d('0x78'),_0x3e0d('0x79')),{'interaction':_0x29e646})[_0x3e0d('0x1d')](function(_0x313db7){var _0x247101=path[_0x3e0d('0x57')](_0x5adff9,'transcript-'+_0x1ffdd4['id']+'-'+_0x102195+_0x3e0d('0x7a'));var _0x24964e={'path':_0x247101,'channel':_0x3e0d('0x6a'),'interactionId':_0x1ffdd4['id']};return pdf[_0x3e0d('0x7b')](_0x313db7,_0x24964e);})[_0x3e0d('0x1d')](function(){return new Promise(function(_0x27af4f,_0x5bea6f){zipdir(_0x5adff9,{'saveTo':_0x422e5b},function(_0x27f715,_0x447b63){if(_0x27f715)return _0x5bea6f(_0x27f715);return _0x27af4f(_0x447b63);});})[_0x3e0d('0x1d')](function(){return new Promise(function(_0x5cd9d7,_0x4993ac){rimraf(_0x5adff9,function(_0x5b85d5){if(_0x5b85d5)_0x4993ac(_0x5b85d5);return _0x5cd9d7();});});})[_0x3e0d('0x1d')](function(){return _0x232ce5['download'](_0x422e5b,_0x1be106,function(_0x3644ec){if(_0x3644ec){logger[_0x3e0d('0x1e')](_0x3e0d('0x7c'),_0x3644ec);}else{fs[_0x3e0d('0x7d')](_0x422e5b);}});});});}else{return _0x232ce5[_0x3e0d('0x11')](0xc8);}})[_0x3e0d('0x2b')](handleError(_0x232ce5,null));};
\ No newline at end of file
+var _0xc11c=['split','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','includeAll','include','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','N.A.','format','closed','closedAt','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','System','out','value','renderFile','views','downloadInteraction.ejs','.pdf','Openchannel','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','localhost','socket.io-emitter','redis','./openchannelInteraction.socket','register','sendStatus','status','offset','count','limit','set','Content-Range','update','destroy','then','end','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','user','catch','query','from','keys','filters','intersection','attributes','model','fields','length','merge','options','find','create','body','params','describe','addMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','where','pick','OpenchannelInteractionId','filter','$gte'];(function(_0xad7be7,_0x2a355c){var _0x41a415=function(_0x16e53b){while(--_0x16e53b){_0xad7be7['push'](_0xad7be7['shift']());}};_0x41a415(++_0x2a355c);}(_0xc11c,0x144));var _0xcc11=function(_0x33a92b,_0x59ad96){_0x33a92b=_0x33a92b-0x0;var _0x4093ae=_0xc11c[_0x33a92b];return _0x4093ae;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xcc11('0x0'));var moment=require(_0xcc11('0x1'));var util=require(_0xcc11('0x2'));var path=require(_0xcc11('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xcc11('0x4'));var Redis=require(_0xcc11('0x5'));var interaction=require(_0xcc11('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xcc11('0x7'));var logger=require(_0xcc11('0x8'))('api');var config=require(_0xcc11('0x9'));var db=require(_0xcc11('0xa'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xcc11('0xb'),'port':0x18eb});var socket=require(_0xcc11('0xc'))(new Redis(config[_0xcc11('0xd')]));require(_0xcc11('0xe'))[_0xcc11('0xf')](socket);function respondWithStatusCode(_0x5ac97d,_0x343145){_0x343145=_0x343145||0xcc;return function(_0x296a08){if(_0x296a08){return _0x5ac97d[_0xcc11('0x10')](_0x343145);}return _0x5ac97d['status'](_0x343145)['end']();};}function respondWithResult(_0x709720,_0x258fdd){_0x258fdd=_0x258fdd||0xc8;return function(_0x3172c8){if(_0x3172c8){return _0x709720[_0xcc11('0x11')](_0x258fdd)['json'](_0x3172c8);}};}function respondWithFilteredResult(_0x50f9c0,_0x1de14a){return function(_0xacfa93){if(_0xacfa93){var _0x2890d0=typeof _0x1de14a[_0xcc11('0x12')]==='undefined'&&typeof _0x1de14a['limit']==='undefined';var _0x378836=_0xacfa93['count'];var _0x5522ca=_0x2890d0?0x0:_0x1de14a[_0xcc11('0x12')];var _0x30023=_0x2890d0?_0xacfa93[_0xcc11('0x13')]:_0x1de14a['offset']+_0x1de14a[_0xcc11('0x14')];var _0x5006cc;if(_0x30023>=_0x378836){_0x30023=_0x378836;_0x5006cc=0xc8;}else{_0x5006cc=0xce;}_0x50f9c0[_0xcc11('0x11')](_0x5006cc);return _0x50f9c0[_0xcc11('0x15')](_0xcc11('0x16'),_0x5522ca+'-'+_0x30023+'/'+_0x378836)['json'](_0xacfa93);}return null;};}function saveUpdates(_0x557aa4){return function(_0x33d721){if(_0x33d721){return _0x33d721[_0xcc11('0x17')](_0x557aa4)['then'](function(_0x49792a){return _0x49792a;});}return null;};}function removeEntity(_0x3d727e){return function(_0x2a3733){if(_0x2a3733){return _0x2a3733[_0xcc11('0x18')]()[_0xcc11('0x19')](function(){_0x3d727e[_0xcc11('0x11')](0xcc)[_0xcc11('0x1a')]();});}};}function handleEntityNotFound(_0x7c57d3){return function(_0x17450d){if(!_0x17450d){_0x7c57d3['sendStatus'](0x194);}return _0x17450d;};}function handleError(_0x393e9c,_0x3055b7){_0x3055b7=_0x3055b7||0x1f4;return function(_0x14f709){logger[_0xcc11('0x1b')](_0x14f709[_0xcc11('0x1c')]);if(_0x14f709[_0xcc11('0x1d')]){delete _0x14f709[_0xcc11('0x1d')];}_0x393e9c[_0xcc11('0x11')](_0x3055b7)[_0xcc11('0x1e')](_0x14f709);};}exports[_0xcc11('0x1f')]=function(_0x26b7eb,_0x55661a){var _0x330380={};var _0x24dbc7=_[_0xcc11('0x20')](db[_0xcc11('0x21')][_0xcc11('0x22')],function(_0xa7d383){return{'name':_0xa7d383[_0xcc11('0x23')],'type':_0xa7d383[_0xcc11('0x24')][_0xcc11('0x25')]};});_0x330380=qs[_0xcc11('0x26')](_0x24dbc7,_0x26b7eb);return interaction[_0xcc11('0x27')](_0xcc11('0x28'),_0x26b7eb['query'],_0x26b7eb[_0xcc11('0x29')],_0x330380,_0x24dbc7)[_0xcc11('0x19')](respondWithFilteredResult(_0x55661a,_0x330380))[_0xcc11('0x2a')](handleError(_0x55661a,null));};exports['show']=function(_0x388814,_0x2ed7b2){var _0x1d286c={};if(_0x388814[_0xcc11('0x2b')][_0xcc11('0x24')]&&_0x388814[_0xcc11('0x2b')][_0xcc11('0x24')]===_0xcc11('0x2c')){_0x1d286c[_0xcc11('0x2c')]=_0x388814['params']['id'];}else{_0x1d286c['id']=_0x388814['params']['id'];}var _0x57aebc={'raw':![],'where':_0x1d286c},_0x177622={};_0x177622['model']=_[_0xcc11('0x2d')](db[_0xcc11('0x21')][_0xcc11('0x22')]);_0x177622[_0xcc11('0x2b')]=_['keys'](_0x388814[_0xcc11('0x2b')]);_0x177622[_0xcc11('0x2e')]=_[_0xcc11('0x2f')](_0x177622['model'],_0x177622[_0xcc11('0x2b')]);_0x57aebc[_0xcc11('0x30')]=_[_0xcc11('0x2f')](_0x177622[_0xcc11('0x31')],qs[_0xcc11('0x32')](_0x388814[_0xcc11('0x2b')][_0xcc11('0x32')]));_0x57aebc[_0xcc11('0x30')]=_0x57aebc[_0xcc11('0x30')][_0xcc11('0x33')]?_0x57aebc[_0xcc11('0x30')]:_0x177622['model'];if(_0x388814['query']['includeAll']){_0x57aebc['include']=[{'all':!![]}];}_0x57aebc=_[_0xcc11('0x34')]({},_0x57aebc,_0x388814[_0xcc11('0x35')]);return db[_0xcc11('0x21')][_0xcc11('0x36')](_0x57aebc)['then'](handleEntityNotFound(_0x2ed7b2,null))['then'](respondWithResult(_0x2ed7b2,null))[_0xcc11('0x2a')](handleError(_0x2ed7b2,null));};exports['create']=function(_0x212f99,_0x2147b2){return db['OpenchannelInteraction'][_0xcc11('0x37')](_0x212f99[_0xcc11('0x38')],{})[_0xcc11('0x19')](respondWithResult(_0x2147b2,0xc9))[_0xcc11('0x2a')](handleError(_0x2147b2,null));};exports[_0xcc11('0x17')]=function(_0x10dfdc,_0x41da91){if(_0x10dfdc[_0xcc11('0x38')]['id']){delete _0x10dfdc[_0xcc11('0x38')]['id'];}return db['OpenchannelInteraction'][_0xcc11('0x36')]({'where':{'id':_0x10dfdc[_0xcc11('0x39')]['id']}})[_0xcc11('0x19')](handleEntityNotFound(_0x41da91,null))['then'](saveUpdates(_0x10dfdc[_0xcc11('0x38')],null))[_0xcc11('0x19')](respondWithResult(_0x41da91,null))[_0xcc11('0x2a')](handleError(_0x41da91,null));};exports[_0xcc11('0x18')]=function(_0x2da584,_0x491086){return db[_0xcc11('0x21')]['find']({'where':{'id':_0x2da584[_0xcc11('0x39')]['id']}})['then'](handleEntityNotFound(_0x491086,null))['then'](removeEntity(_0x491086,null))[_0xcc11('0x2a')](handleError(_0x491086,null));};exports[_0xcc11('0x3a')]=function(_0x30e1e5,_0x150271){return db[_0xcc11('0x21')][_0xcc11('0x3a')]()[_0xcc11('0x19')](respondWithResult(_0x150271,null))[_0xcc11('0x2a')](handleError(_0x150271,null));};exports[_0xcc11('0x3b')]=function(_0x16553a,_0x1aef82){return db['OpenchannelMessage']['find']({'where':{'id':_0x16553a['params']['id']}})[_0xcc11('0x19')](handleEntityNotFound(_0x1aef82,null))[_0xcc11('0x19')](function(_0xcab5f5){if(_0xcab5f5){return _0xcab5f5[_0xcc11('0x3b')](_0x16553a[_0xcc11('0x38')][_0xcc11('0x3c')],_[_0xcc11('0x3d')](_0x16553a[_0xcc11('0x38')],[_0xcc11('0x3c'),'id'])||{});}})[_0xcc11('0x19')](respondWithResult(_0x1aef82,null))[_0xcc11('0x2a')](handleError(_0x1aef82,null));};exports['getMessages']=function(_0x385c00,_0x134620){var _0x37aa1f={'raw':![],'where':{}};var _0x4672e9={};var _0x328ade={'count':0x0,'rows':[]};return db[_0xcc11('0x21')][_0xcc11('0x3e')]({'where':{'id':_0x385c00[_0xcc11('0x39')]['id']}})[_0xcc11('0x19')](handleEntityNotFound(_0x134620,null))[_0xcc11('0x19')](function(_0x638d14){if(_0x638d14){_0x4672e9[_0xcc11('0x31')]=_[_0xcc11('0x2d')](db['OpenchannelMessage']['rawAttributes']);_0x4672e9[_0xcc11('0x2b')]=_['keys'](_0x385c00[_0xcc11('0x2b')]);_0x4672e9['filters']=_['intersection'](_0x4672e9[_0xcc11('0x31')],_0x4672e9[_0xcc11('0x2b')]);_0x37aa1f[_0xcc11('0x30')]=_[_0xcc11('0x2f')](_0x4672e9[_0xcc11('0x31')],qs[_0xcc11('0x32')](_0x385c00[_0xcc11('0x2b')][_0xcc11('0x32')]));_0x37aa1f[_0xcc11('0x30')]=_0x37aa1f[_0xcc11('0x30')][_0xcc11('0x33')]?_0x37aa1f[_0xcc11('0x30')]:_0x4672e9[_0xcc11('0x31')];if(!_0x385c00[_0xcc11('0x2b')][_0xcc11('0x3f')](_0xcc11('0x40'))){_0x37aa1f[_0xcc11('0x14')]=qs[_0xcc11('0x14')](_0x385c00['query'][_0xcc11('0x14')]);_0x37aa1f[_0xcc11('0x12')]=qs['offset'](_0x385c00['query'][_0xcc11('0x12')]);}_0x37aa1f[_0xcc11('0x41')]=qs[_0xcc11('0x42')](_0x385c00[_0xcc11('0x2b')][_0xcc11('0x42')]);_0x37aa1f[_0xcc11('0x43')]=qs['filters'](_[_0xcc11('0x44')](_0x385c00[_0xcc11('0x2b')],_0x4672e9[_0xcc11('0x2e')]));_0x37aa1f[_0xcc11('0x43')][_0xcc11('0x45')]=_0x638d14['id'];if(_0x385c00[_0xcc11('0x2b')][_0xcc11('0x46')]){_0x37aa1f[_0xcc11('0x43')]=_[_0xcc11('0x34')](_0x37aa1f[_0xcc11('0x43')],{'$or':_[_0xcc11('0x20')](_0x37aa1f[_0xcc11('0x30')],function(_0x289916){var _0x6b34f8={};_0x6b34f8[_0x289916]={'$like':'%'+_0x385c00[_0xcc11('0x2b')]['filter']+'%'};return _0x6b34f8;})});}if(_0x385c00[_0xcc11('0x2b')][_0xcc11('0x47')]){var _0x35ba1e=_0x385c00[_0xcc11('0x2b')][_0xcc11('0x47')][_0xcc11('0x48')](',');var _0x3a3eec={};_0x3a3eec[_0x35ba1e[0x0]]={'$gte':moment(_0x35ba1e[0x1])['format'](_0xcc11('0x49'))};_0x37aa1f['where']=_['merge'](_0x37aa1f[_0xcc11('0x43')],_0x3a3eec);}_0x37aa1f=_[_0xcc11('0x34')]({},_0x37aa1f,_0x385c00[_0xcc11('0x35')]);return db[_0xcc11('0x4a')][_0xcc11('0x13')]({'where':_0x37aa1f['where']})['then'](function(_0x54578c){_0x328ade[_0xcc11('0x13')]=_0x54578c;if(_0x385c00[_0xcc11('0x2b')][_0xcc11('0x4b')]){_0x37aa1f[_0xcc11('0x4c')]=[{'all':!![]}];}return db[_0xcc11('0x4a')][_0xcc11('0x27')](_0x37aa1f);})[_0xcc11('0x19')](function(_0x528108){_0x328ade[_0xcc11('0x4d')]=_0x528108;return _0x328ade;});}})[_0xcc11('0x19')](respondWithFilteredResult(_0x134620,_0x37aa1f))['catch'](handleError(_0x134620,null));};exports[_0xcc11('0x4e')]=function(_0x5dd0fb,_0xc47d95){return db[_0xcc11('0x21')][_0xcc11('0x36')]({'where':{'id':_0x5dd0fb[_0xcc11('0x39')]['id']}})[_0xcc11('0x19')](handleEntityNotFound(_0xc47d95,null))['then'](function(_0x2ef1e6){if(_0x2ef1e6){return _0x2ef1e6['setTags'](_0x5dd0fb[_0xcc11('0x38')]['ids'],_['omit'](_0x5dd0fb[_0xcc11('0x38')],[_0xcc11('0x3c'),'id'])||{})[_0xcc11('0x4f')](function(){return db[_0xcc11('0x50')][_0xcc11('0x27')]({'attributes':['id','name',_0xcc11('0x51')],'where':{'id':_0x5dd0fb[_0xcc11('0x38')][_0xcc11('0x3c')]}});})[_0xcc11('0x19')](function(_0x131fc1){socket[_0xcc11('0x52')](_0xcc11('0x53'),{'id':Number(_0x5dd0fb[_0xcc11('0x39')]['id']),'tags':_0x131fc1||[]});return{'id':Number(_0x5dd0fb[_0xcc11('0x39')]['id']),'tags':_0x131fc1||[]};});}})[_0xcc11('0x19')](respondWithResult(_0xc47d95,null))['catch'](handleError(_0xc47d95,null));};exports[_0xcc11('0x54')]=function(_0x4996cd,_0x3969a8){return db[_0xcc11('0x21')]['find']({'where':{'id':_0x4996cd[_0xcc11('0x39')]['id']}})[_0xcc11('0x19')](handleEntityNotFound(_0x3969a8,null))[_0xcc11('0x19')](function(_0x583f3d){if(_0x583f3d){return _0x583f3d[_0xcc11('0x54')](_0x4996cd['query'][_0xcc11('0x3c')]);}})[_0xcc11('0x19')](respondWithStatusCode(_0x3969a8,null))[_0xcc11('0x2a')](handleError(_0x3969a8,null));};exports[_0xcc11('0x55')]=function(_0x3725ed,_0x5e1966){var _0x47e986=moment()[_0xcc11('0x56')]()[_0xcc11('0x57')]();var _0x589d9e=path[_0xcc11('0x58')](config[_0xcc11('0x59')],_0xcc11('0x5a'),_0xcc11('0x5b'),'tmp');var _0x1996ca=path[_0xcc11('0x58')](config[_0xcc11('0x59')],'server',_0xcc11('0x5b'),_0xcc11('0x5c'));var _0x4072b2=path[_0xcc11('0x58')](_0x589d9e,_0x47e986);var _0x1bdf41=util['format'](_0xcc11('0x5d'),_0x3725ed[_0xcc11('0x39')]['id'],_0x47e986);var _0x33c953=path[_0xcc11('0x58')](_0x589d9e,_0x1bdf41);var _0x57c8d0=[];_0x57c8d0['push']({'model':db[_0xcc11('0x5e')],'as':'User','attributes':['id',_0xcc11('0x5f')],'raw':!![]});_0x57c8d0[_0xcc11('0x60')]({'model':db[_0xcc11('0x61')],'as':_0xcc11('0x62'),'attributes':['id','firstName',_0xcc11('0x63')],'raw':!![]});if(_0x3725ed[_0xcc11('0x2b')]['attachments']){_0x57c8d0['push']({'model':db[_0xcc11('0x64')],'as':_0xcc11('0x64'),'raw':!![]});}var _0x307c59=[{'model':db[_0xcc11('0x4a')],'as':_0xcc11('0x65'),'attributes':['id',_0xcc11('0x38'),_0xcc11('0x66'),_0xcc11('0x67'),_0xcc11('0x68'),_0xcc11('0x69')],'include':_0x57c8d0}];_0x307c59[_0xcc11('0x60')]({'model':db[_0xcc11('0x6a')],'as':_0xcc11('0x6b'),'attributes':['id',_0xcc11('0x1d')]});_0x307c59[_0xcc11('0x60')]({'model':db[_0xcc11('0x5e')],'as':_0xcc11('0x6c'),'attributes':['id','fullname']});return db[_0xcc11('0x21')][_0xcc11('0x36')]({'where':{'id':_0x3725ed['params']['id']},'include':_0x307c59})[_0xcc11('0x19')](handleEntityNotFound(_0x5e1966,null))['then'](function(_0x43cf17){if(_0x43cf17){var _0xfef6de=_0x43cf17[_0xcc11('0x6d')]({'plain':!![]});fs[_0xcc11('0x6e')](_0x4072b2);var _0x3bb113={'channel':'Openchannel','account':_0xfef6de[_0xcc11('0x6b')][_0xcc11('0x1d')],'agent':_0xfef6de[_0xcc11('0x6c')]?_0xfef6de['Owner'][_0xcc11('0x5f')]:_0xcc11('0x6f'),'createdAt':moment(_0xfef6de[_0xcc11('0x66')])[_0xcc11('0x70')](_0xcc11('0x49'))['toString'](),'closedAt':_0xfef6de[_0xcc11('0x71')]?moment(_0xfef6de[_0xcc11('0x72')])[_0xcc11('0x70')](_0xcc11('0x49'))[_0xcc11('0x57')]():'','disposition':_0xfef6de['disposition'],'visibility':_0xfef6de[_0xcc11('0x73')]?_0xcc11('0x74'):_0xcc11('0x75'),'messages':_(_0xfef6de[_0xcc11('0x65')])[_0xcc11('0x46')]({'secret':![]})[_0xcc11('0x20')](function(_0x1acb78){if(_0x1acb78[_0xcc11('0x64')]){var _0x188f07=path[_0xcc11('0x58')](_0x1996ca,_0x1acb78[_0xcc11('0x64')][_0xcc11('0x76')]);if(fs[_0xcc11('0x77')](_0x188f07)){fs[_0xcc11('0x78')](_0x188f07)['pipe'](fs[_0xcc11('0x79')](path[_0xcc11('0x58')](_0x4072b2,_0x1acb78[_0xcc11('0x64')][_0xcc11('0x76')])));}}return{'date':moment(_0x1acb78[_0xcc11('0x66')])[_0xcc11('0x70')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcc11('0x57')](),'sender':_0x1acb78[_0xcc11('0x67')]==='out'?_0x1acb78[_0xcc11('0x5e')]?_0x1acb78['User'][_0xcc11('0x5f')]:_0xcc11('0x7a'):_0x1acb78[_0xcc11('0x62')]['firstName']+(_0x1acb78[_0xcc11('0x62')]['lastName']?'\x20'+_0x1acb78[_0xcc11('0x62')]['lastName']:''),'body':_0x1acb78[_0xcc11('0x64')]?_0x1acb78[_0xcc11('0x64')][_0xcc11('0x76')]:_0x1acb78[_0xcc11('0x38')],'direction':_0x1acb78[_0xcc11('0x67')]===_0xcc11('0x7b')?'A':'C','secret':_0x1acb78[_0xcc11('0x68')],'read':_0x1acb78[_0xcc11('0x69')],'attachment':_0x1acb78[_0xcc11('0x64')]};})[_0xcc11('0x7c')]()};return ejs[_0xcc11('0x7d')](path[_0xcc11('0x58')](config[_0xcc11('0x59')],'server',_0xcc11('0x7e'),_0xcc11('0x7f')),{'interaction':_0x3bb113})[_0xcc11('0x19')](function(_0x2d5542){var _0x2fa5ce=path[_0xcc11('0x58')](_0x4072b2,'transcript-'+_0xfef6de['id']+'-'+_0x47e986+_0xcc11('0x80'));var _0xa72631={'path':_0x2fa5ce,'channel':_0xcc11('0x81'),'interactionId':_0xfef6de['id']};return pdf[_0xcc11('0x82')](_0x2d5542,_0xa72631);})[_0xcc11('0x19')](function(){return new Promise(function(_0x2466f2,_0x446dac){zipdir(_0x4072b2,{'saveTo':_0x33c953},function(_0x6bb9c3,_0x89fffb){if(_0x6bb9c3)return _0x446dac(_0x6bb9c3);return _0x2466f2(_0x89fffb);});})[_0xcc11('0x19')](function(){return new Promise(function(_0x1d62c1,_0x36bf0c){rimraf(_0x4072b2,function(_0x434193){if(_0x434193)_0x36bf0c(_0x434193);return _0x1d62c1();});});})[_0xcc11('0x19')](function(){return _0x5e1966[_0xcc11('0x55')](_0x33c953,_0x1bdf41,function(_0x24d955){if(_0x24d955){logger[_0xcc11('0x1b')](_0xcc11('0x83'),_0x24d955);}else{fs['unlinkSync'](_0x33c953);}});});});}else{return _0x5e1966[_0xcc11('0x10')](0xc8);}})[_0xcc11('0x2a')](handleError(_0x5e1966,null));};
\ No newline at end of file
index a09350d..3f1816c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9da1=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch'];(function(_0x522c65,_0x230660){var _0x55037a=function(_0xbb43a1){while(--_0xbb43a1){_0x522c65['push'](_0x522c65['shift']());}};_0x55037a(++_0x230660);}(_0x9da1,0x9c));var _0x19da=function(_0x3411a4,_0x60d585){_0x3411a4=_0x3411a4-0x0;var _0x4eb325=_0x9da1[_0x3411a4];return _0x4eb325;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x19da('0x0'))['db'][_0x19da('0x1')];var OpenchannelMessage=require(_0x19da('0x0'))['db'][_0x19da('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x19da('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2ca80e){return function(_0x2c2280,_0x4d3145,_0x4f8303){_0x2c2280[_0x19da('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3ba41b){_0x2c2280[_0x19da('0x5')](_0x19da('0x6'),_0x3ba41b[_0x19da('0x7')](function(_0x274dff){return{'id':_0x274dff['id']};}));return OpenchannelMessage[_0x19da('0x8')]({'where':{'OpenchannelInteractionId':_0x2c2280['id'],'direction':'in','read':![]},'raw':!![]});})[_0x19da('0x9')](function(_0x272fd8){_0x2c2280[_0x19da('0x5')](_0x19da('0xa'),_0x272fd8[_0x19da('0xb')]);OpenchannelInteractionEvents[_0x19da('0xc')](_0x2ca80e+':'+_0x2c2280['id'],_0x2c2280);OpenchannelInteractionEvents[_0x19da('0xc')](_0x2ca80e,_0x2c2280);_0x4f8303(null);})[_0x19da('0xd')](_0x4f8303(null));};}for(var e in events){if(events[_0x19da('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x19da('0xf')](e,emitEvent(event));}}module[_0x19da('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x04a6=['events','OpenchannelInteraction','../../mysqldb','OpenchannelMessage','setMaxListeners','update','remove','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x551224,_0x1910dd){var _0x21df46=function(_0x55dbcd){while(--_0x55dbcd){_0x551224['push'](_0x551224['shift']());}};_0x21df46(++_0x1910dd);}(_0x04a6,0x1ed));var _0x604a=function(_0x568535,_0x35f2ad){_0x568535=_0x568535-0x0;var _0x3fbaa4=_0x04a6[_0x568535];return _0x3fbaa4;};'use strict';var EventEmitter=require(_0x604a('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0x604a('0x1')];var OpenchannelMessage=require(_0x604a('0x2'))['db'][_0x604a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x604a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x604a('0x5'),'afterDestroy':_0x604a('0x6')};function emitEvent(_0x41a1d6){return function(_0x292808,_0x25c1e6,_0x138e99){_0x292808['getUsers']({'attributes':['id'],'raw':!![]})[_0x604a('0x7')](function(_0x2e89ea){_0x292808['setDataValue'](_0x604a('0x8'),_0x2e89ea[_0x604a('0x9')](function(_0x98d8d1){return{'id':_0x98d8d1['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x292808['id'],'direction':'in','read':![]},'raw':!![]});})[_0x604a('0x7')](function(_0x2feed1){_0x292808[_0x604a('0xa')](_0x604a('0xb'),_0x2feed1[_0x604a('0xc')]);OpenchannelInteractionEvents['emit'](_0x41a1d6+':'+_0x292808['id'],_0x292808);OpenchannelInteractionEvents[_0x604a('0xd')](_0x41a1d6,_0x292808);_0x138e99(null);})[_0x604a('0xe')](_0x138e99(null));};}for(var e in events){if(events[_0x604a('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x604a('0x10')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index 8f36dfc..ee6a402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6441=['moment','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x6441,0x96));var _0x1644=function(_0x54f4d5,_0xac1080){_0x54f4d5=_0x54f4d5-0x0;var _0x1ac75a=_0x6441[_0x54f4d5];return _0x1ac75a;};'use strict';var _=require('lodash');var util=require(_0x1644('0x0'));var logger=require(_0x1644('0x1'))(_0x1644('0x2'));var moment=require(_0x1644('0x3'));var BPromise=require('bluebird');var rp=require(_0x1644('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1644('0x5'));var config=require(_0x1644('0x6'));var attributes=require(_0x1644('0x7'));module['exports']=function(_0x28dd39,_0x38c1dd){return _0x28dd39['define'](_0x1644('0x8'),attributes,{'tableName':_0x1644('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1644('0xa'),'collate':_0x1644('0xb'),'hooks':{'beforeUpdate':function(_0x39a698,_0x4658ad,_0x41929d){if(_0x39a698[_0x1644('0xc')](_0x1644('0xd'))){_0x39a698[_0x1644('0xe')]=moment()[_0x1644('0xf')](_0x1644('0x10'));}_0x41929d(null,_0x39a698);}}});};
\ No newline at end of file
+var _0xc00e=['utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','openchannel_interactions','utf8mb4'];(function(_0x485979,_0x42107f){var _0xd1cebe=function(_0x364e2a){while(--_0x364e2a){_0x485979['push'](_0x485979['shift']());}};_0xd1cebe(++_0x42107f);}(_0xc00e,0x1e1));var _0xec00=function(_0x2c97db,_0x187a37){_0x2c97db=_0x2c97db-0x0;var _0xceabb1=_0xc00e[_0x2c97db];return _0xceabb1;};'use strict';var _=require('lodash');var util=require(_0xec00('0x0'));var logger=require(_0xec00('0x1'))(_0xec00('0x2'));var moment=require(_0xec00('0x3'));var BPromise=require(_0xec00('0x4'));var rp=require(_0xec00('0x5'));var fs=require('fs');var path=require(_0xec00('0x6'));var rimraf=require('rimraf');var config=require(_0xec00('0x7'));var attributes=require(_0xec00('0x8'));module[_0xec00('0x9')]=function(_0x38bb7a,_0x2d7f1f){return _0x38bb7a[_0xec00('0xa')]('OpenchannelInteraction',attributes,{'tableName':_0xec00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec00('0xc'),'collate':_0xec00('0xd'),'hooks':{'beforeUpdate':function(_0x2522a7,_0x22419f,_0x47de19){if(_0x2522a7[_0xec00('0xe')](_0xec00('0xf'))){_0x2522a7[_0xec00('0x10')]=moment()[_0xec00('0x11')](_0xec00('0x12'));}_0x47de19(null,_0x2522a7);}}});};
\ No newline at end of file
index db546dc..d2d877f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bbd=['defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','debug','find','where','addTags','ids','spread','stringify','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis'];(function(_0x2aa090,_0x20b150){var _0x3ef49c=function(_0x3adbb8){while(--_0x3adbb8){_0x2aa090['push'](_0x2aa090['shift']());}};_0x3ef49c(++_0x20b150);}(_0x9bbd,0x1b7));var _0xd9bb=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9bbd[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xd9bb('0x0'));var util=require(_0xd9bb('0x1'));var moment=require(_0xd9bb('0x2'));var BPromise=require(_0xd9bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9bb('0x4'));var db=require(_0xd9bb('0x5'))['db'];var utils=require(_0xd9bb('0x6'));var logger=require('../../config/logger')(_0xd9bb('0x7'));var config=require(_0xd9bb('0x8'));var jayson=require(_0xd9bb('0x9'));var client=jayson['client'][_0xd9bb('0xa')]({'port':0x232a});config[_0xd9bb('0xb')]=_[_0xd9bb('0xc')](config[_0xd9bb('0xb')],{'host':_0xd9bb('0xd'),'port':0x18eb});var socket=require(_0xd9bb('0xe'))(new Redis(config[_0xd9bb('0xb')]));require(_0xd9bb('0xf'))[_0xd9bb('0x10')](socket);function respondWithRpcPromise(_0x124daa,_0xebf63f,_0x27f740){return new BPromise(function(_0x3f637c,_0x5b31c4){return client[_0xd9bb('0x11')](_0x124daa,_0x27f740)[_0xd9bb('0x12')](function(_0x2cbbb1){logger[_0xd9bb('0x13')](_0xd9bb('0x14'),_0xebf63f,_0xd9bb('0x15'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xebf63f,_0xd9bb('0x15'),JSON['stringify'](_0x2cbbb1));if(_0x2cbbb1[_0xd9bb('0x16')]){if(_0x2cbbb1[_0xd9bb('0x16')][_0xd9bb('0x17')]===0x1f4){logger[_0xd9bb('0x16')](_0xd9bb('0x14'),_0xebf63f,_0x2cbbb1['error'][_0xd9bb('0x18')]);return _0x5b31c4(_0x2cbbb1[_0xd9bb('0x16')][_0xd9bb('0x18')]);}logger[_0xd9bb('0x16')](_0xd9bb('0x14'),_0xebf63f,_0x2cbbb1[_0xd9bb('0x16')][_0xd9bb('0x18')]);return _0x3f637c(_0x2cbbb1[_0xd9bb('0x16')][_0xd9bb('0x18')]);}else{logger[_0xd9bb('0x13')](_0xd9bb('0x14'),_0xebf63f,_0xd9bb('0x15'));_0x3f637c(_0x2cbbb1[_0xd9bb('0x19')]['message']);}})[_0xd9bb('0x1a')](function(_0x34427d){logger[_0xd9bb('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0xebf63f,_0x34427d);_0x5b31c4(_0x34427d);});});}exports[_0xd9bb('0x1b')]=function(_0x573f05){var _0x40c128=this;return new Promise(function(_0x4263b4,_0x690499){return db[_0xd9bb('0x1c')][_0xd9bb('0x1d')](_0x573f05[_0xd9bb('0x1e')],{'raw':_0x573f05['options']?_0x573f05[_0xd9bb('0x1f')][_0xd9bb('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x573f05[_0xd9bb('0x1f')]?_0x573f05['options']['where']||null:null,'attributes':_0x573f05[_0xd9bb('0x1f')]?_0x573f05['options']['attributes']||null:null,'limit':_0x573f05[_0xd9bb('0x1f')]?_0x573f05[_0xd9bb('0x1f')]['limit']||null:null})['then'](function(_0x35035b){logger['info'](_0xd9bb('0x1b'),_0x573f05);logger[_0xd9bb('0x21')](_0xd9bb('0x1b'),_0x573f05,JSON['stringify'](_0x35035b));_0x4263b4(_0x35035b);})[_0xd9bb('0x1a')](function(_0x391b86){logger[_0xd9bb('0x16')]('UpdateOpenchannelInteraction',_0x391b86[_0xd9bb('0x18')],_0x573f05);_0x690499(_0x40c128[_0xd9bb('0x16')](0x1f4,_0x391b86[_0xd9bb('0x18')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x417afb){return new Promise(function(_0x3720d5,_0x19248b){return db[_0xd9bb('0x1c')][_0xd9bb('0x22')]({'where':_0x417afb['options']?_0x417afb[_0xd9bb('0x1f')][_0xd9bb('0x23')]||null:null})[_0xd9bb('0x12')](function(_0x100ec4){if(_0x100ec4){return _0x100ec4[_0xd9bb('0x24')](_0x417afb[_0xd9bb('0x1e')][_0xd9bb('0x25')],_['omit'](_0x417afb[_0xd9bb('0x1e')],[_0xd9bb('0x25'),'id'])||{});}})[_0xd9bb('0x26')](function(_0x181881){logger['info']('AddTags',_0x417afb);logger[_0xd9bb('0x21')]('AddTags',_0x417afb,JSON[_0xd9bb('0x27')](_0x181881));_0x3720d5(_0x181881);})[_0xd9bb('0x1a')](function(_0x175f0e){logger[_0xd9bb('0x16')](_0xd9bb('0x28'),_0x175f0e['message'],_0x417afb);_0x19248b(_this['error'](0x1f4,_0x175f0e[_0xd9bb('0x18')]));});});};
\ No newline at end of file
+var _0x485b=['raw','where','attributes','limit','AddTagsToOpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelInteraction,\x20%s,\x20%s','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options'];(function(_0x5f8b46,_0x2050a7){var _0x2258f6=function(_0x5fd2f4){while(--_0x5fd2f4){_0x5f8b46['push'](_0x5f8b46['shift']());}};_0x2258f6(++_0x2050a7);}(_0x485b,0x152));var _0xb485=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x485b[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xb485('0x0'));var util=require(_0xb485('0x1'));var moment=require(_0xb485('0x2'));var BPromise=require(_0xb485('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb485('0x4'));var db=require(_0xb485('0x5'))['db'];var utils=require(_0xb485('0x6'));var logger=require(_0xb485('0x7'))(_0xb485('0x8'));var config=require('../../config/environment');var jayson=require(_0xb485('0x9'));var client=jayson['client'][_0xb485('0xa')]({'port':0x232a});config[_0xb485('0xb')]=_[_0xb485('0xc')](config[_0xb485('0xb')],{'host':_0xb485('0xd'),'port':0x18eb});var socket=require(_0xb485('0xe'))(new Redis(config[_0xb485('0xb')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x208be5,_0x5668b5,_0x94b2a4){return new BPromise(function(_0x52f99b,_0x2fc593){return client['request'](_0x208be5,_0x94b2a4)[_0xb485('0xf')](function(_0xafc5c7){logger[_0xb485('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5668b5,_0xb485('0x11'));logger[_0xb485('0x12')](_0xb485('0x13'),_0x5668b5,_0xb485('0x11'),JSON[_0xb485('0x14')](_0xafc5c7));if(_0xafc5c7[_0xb485('0x15')]){if(_0xafc5c7[_0xb485('0x15')][_0xb485('0x16')]===0x1f4){logger[_0xb485('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x5668b5,_0xafc5c7[_0xb485('0x15')][_0xb485('0x17')]);return _0x2fc593(_0xafc5c7[_0xb485('0x15')][_0xb485('0x17')]);}logger[_0xb485('0x15')](_0xb485('0x18'),_0x5668b5,_0xafc5c7['error'][_0xb485('0x17')]);return _0x52f99b(_0xafc5c7[_0xb485('0x15')][_0xb485('0x17')]);}else{logger[_0xb485('0x10')](_0xb485('0x18'),_0x5668b5,_0xb485('0x11'));_0x52f99b(_0xafc5c7['result'][_0xb485('0x17')]);}})[_0xb485('0x19')](function(_0x57c03b){logger[_0xb485('0x15')](_0xb485('0x18'),_0x5668b5,_0x57c03b);_0x2fc593(_0x57c03b);});});}exports[_0xb485('0x1a')]=function(_0x24eea9){var _0x418647=this;return new Promise(function(_0x2c1228,_0x4e5794){return db[_0xb485('0x1b')][_0xb485('0x1c')](_0x24eea9[_0xb485('0x1d')],{'raw':_0x24eea9[_0xb485('0x1e')]?_0x24eea9[_0xb485('0x1e')][_0xb485('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24eea9[_0xb485('0x1e')]?_0x24eea9[_0xb485('0x1e')][_0xb485('0x20')]||null:null,'attributes':_0x24eea9['options']?_0x24eea9[_0xb485('0x1e')][_0xb485('0x21')]||null:null,'limit':_0x24eea9[_0xb485('0x1e')]?_0x24eea9['options'][_0xb485('0x22')]||null:null})['then'](function(_0xff2468){logger[_0xb485('0x10')](_0xb485('0x1a'),_0x24eea9);logger[_0xb485('0x12')]('UpdateOpenchannelInteraction',_0x24eea9,JSON['stringify'](_0xff2468));_0x2c1228(_0xff2468);})[_0xb485('0x19')](function(_0x3895de){logger['error'](_0xb485('0x1a'),_0x3895de[_0xb485('0x17')],_0x24eea9);_0x4e5794(_0x418647[_0xb485('0x15')](0x1f4,_0x3895de['message']));});});};exports[_0xb485('0x23')]=function(_0x56ddcd){return new Promise(function(_0x254549,_0x19fa5b){return db[_0xb485('0x1b')]['find']({'where':_0x56ddcd[_0xb485('0x1e')]?_0x56ddcd[_0xb485('0x1e')][_0xb485('0x20')]||null:null})[_0xb485('0xf')](function(_0x55157a){if(_0x55157a){return _0x55157a[_0xb485('0x24')](_0x56ddcd[_0xb485('0x1d')][_0xb485('0x25')],_[_0xb485('0x26')](_0x56ddcd['body'],[_0xb485('0x25'),'id'])||{});}})[_0xb485('0x27')](function(_0x5bf417){logger['info'](_0xb485('0x28'),_0x56ddcd);logger[_0xb485('0x12')](_0xb485('0x28'),_0x56ddcd,JSON[_0xb485('0x14')](_0x5bf417));_0x254549(_0x5bf417);})[_0xb485('0x19')](function(_0x1a5ccb){logger[_0xb485('0x15')]('AddTags',_0x1a5ccb[_0xb485('0x17')],_0x56ddcd);_0x19fa5b(_this['error'](0x1f4,_0x1a5ccb[_0xb485('0x17')]));});});};
\ No newline at end of file
index 6e5dc1d..d300157 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804c=['openchannelInteraction:','./openchannelInteraction.events','emit','removeListener','register','length'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x804c,0x1e7));var _0xc804=function(_0x40838a,_0x39e088){_0x40838a=_0x40838a-0x0;var _0x366756=_0x804c[_0x40838a];return _0x366756;};'use strict';var OpenchannelInteractionEvents=require(_0xc804('0x0'));var events=['save','remove','update'];function createListener(_0x103066,_0x392abf){return function(_0x4ef20c){_0x392abf[_0xc804('0x1')](_0x103066,_0x4ef20c);};}function removeListener(_0x50199d,_0x37a143){return function(){OpenchannelInteractionEvents[_0xc804('0x2')](_0x50199d,_0x37a143);};}exports[_0xc804('0x3')]=function(_0x51123f){for(var _0x228788=0x0,_0x2e0a28=events[_0xc804('0x4')];_0x228788<_0x2e0a28;_0x228788++){var _0x39b38d=events[_0x228788];var _0x1dc3cd=createListener(_0xc804('0x5')+_0x39b38d,_0x51123f);OpenchannelInteractionEvents['on'](_0x39b38d,_0x1dc3cd);}};
\ No newline at end of file
+var _0x3f56=['remove','update','removeListener','register','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x11e1ab,_0x4bb093){var _0x530ca0=function(_0x329d8b){while(--_0x329d8b){_0x11e1ab['push'](_0x11e1ab['shift']());}};_0x530ca0(++_0x4bb093);}(_0x3f56,0x9f));var _0x63f5=function(_0x352e0f,_0x4b4816){_0x352e0f=_0x352e0f-0x0;var _0x2d75c3=_0x3f56[_0x352e0f];return _0x2d75c3;};'use strict';var OpenchannelInteractionEvents=require(_0x63f5('0x0'));var events=[_0x63f5('0x1'),_0x63f5('0x2'),_0x63f5('0x3')];function createListener(_0x494886,_0x512879){return function(_0x56f20f){_0x512879['emit'](_0x494886,_0x56f20f);};}function removeListener(_0x4c100d,_0x2584ce){return function(){OpenchannelInteractionEvents[_0x63f5('0x4')](_0x4c100d,_0x2584ce);};}exports[_0x63f5('0x5')]=function(_0x4b5957){for(var _0x36e088=0x0,_0x4f49f2=events['length'];_0x36e088<_0x4f49f2;_0x36e088++){var _0x1fef42=events[_0x36e088];var _0xb57029=createListener(_0x63f5('0x6')+_0x1fef42,_0x4b5957);OpenchannelInteractionEvents['on'](_0x1fef42,_0xb57029);}};
\ No newline at end of file
index 0ea271c..1f3a5b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x54b7b0,_0x576d95){var _0x3aa45f=function(_0x43e337){while(--_0x43e337){_0x54b7b0['push'](_0x54b7b0['shift']());}};_0x3aa45f(++_0x576d95);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router;
\ No newline at end of file
+var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router;
\ No newline at end of file
index ed8aeac..09a448c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1619=['ENUM','out','STRING','TEXT','BOOLEAN'];(function(_0x37897a,_0x1a355a){var _0x2701fb=function(_0x545c7e){while(--_0x545c7e){_0x37897a['push'](_0x37897a['shift']());}};_0x2701fb(++_0x1a355a);}(_0x1619,0x189));var _0x9161=function(_0x44acf4,_0x28790d){_0x44acf4=_0x44acf4-0x0;var _0x48ac04=_0x1619[_0x44acf4];return _0x48ac04;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x9161('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9161('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9161('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9161('0x2')]('in','out'),'defaultValue':_0x9161('0x3'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x9161('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x867f=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x867f,0xdc));var _0xf867=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0x867f[_0x231a47];return _0x48d7c9;};'use strict';var Sequelize=require(_0xf867('0x0'));module[_0xf867('0x1')]={'body':{'type':Sequelize[_0xf867('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xf867('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf867('0x4')]('in','out'),'defaultValue':_0xf867('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xf867('0x6')]},'providerResponse':{'type':Sequelize[_0xf867('0x2')]}};
\ No newline at end of file
index 1bc5d65..4946ad4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3e7=['where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','body','describe','openchannel-interactions','accept','openchannel','readAt','format','UserId','user','agent','get','OpenchannelInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','sequelize','QueryTypes','SELECT','SIP/%s','rejectmessage','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','./openchannelMessage.socket','register','jayson/promise','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','map','OpenchannelMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge'];(function(_0xe703e8,_0x23cca7){var _0xfad3d3=function(_0x59422e){while(--_0x59422e){_0xe703e8['push'](_0xe703e8['shift']());}};_0xfad3d3(++_0x23cca7);}(_0xb3e7,0xb7));var _0x7b3e=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0xb3e7[_0x3de8a4];return _0x4635cf;};'use strict';var emlformat=require(_0x7b3e('0x0'));var rimraf=require(_0x7b3e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b3e('0x2'));var rp=require('request-promise');var moment=require(_0x7b3e('0x3'));var BPromise=require(_0x7b3e('0x4'));var Mustache=require(_0x7b3e('0x5'));var util=require(_0x7b3e('0x6'));var path=require(_0x7b3e('0x7'));var sox=require('sox');var csv=require(_0x7b3e('0x8'));var ejs=require(_0x7b3e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7b3e('0xa'));var squel=require(_0x7b3e('0xb'));var crypto=require(_0x7b3e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7b3e('0xd'));var toCsv=require(_0x7b3e('0x8'));var querystring=require(_0x7b3e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7b3e('0xf'));var qs=require(_0x7b3e('0x10'));var as=require(_0x7b3e('0x11'));var hardwareService=require(_0x7b3e('0x12'));var logger=require(_0x7b3e('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x7b3e('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7b3e('0x15')]=_[_0x7b3e('0x16')](config[_0x7b3e('0x15')],{'host':_0x7b3e('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b3e('0x15')]));require(_0x7b3e('0x18'))[_0x7b3e('0x19')](socket);var jayson=require(_0x7b3e('0x1a'));var client=jayson['client'][_0x7b3e('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0x7b3e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ede84,_0x59a3ae,_0x313c90,_0xa213dc){return new BPromise(function(_0x559782,_0x4a1fbc){var _0x34bab9=_0xa213dc||client;return _0x34bab9[_0x7b3e('0x1c')](_0x5ede84,_0x313c90)[_0x7b3e('0x1d')](function(_0x13ea41){logger[_0x7b3e('0x1e')](_0x7b3e('0x1f'),_0x59a3ae,'request\x20sent');logger[_0x7b3e('0x20')](_0x7b3e('0x21'),_0x59a3ae,_0x7b3e('0x22'),JSON[_0x7b3e('0x23')](_0x13ea41));if(_0x13ea41['error']){if(_0x13ea41['error']['code']===0x1f4){logger[_0x7b3e('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x59a3ae,_0x13ea41[_0x7b3e('0x24')][_0x7b3e('0x25')]);return _0x4a1fbc(_0x13ea41[_0x7b3e('0x24')][_0x7b3e('0x25')]);}logger[_0x7b3e('0x24')](_0x7b3e('0x1f'),_0x59a3ae,_0x13ea41[_0x7b3e('0x24')]['message']);return _0x559782(_0x13ea41[_0x7b3e('0x24')][_0x7b3e('0x25')]);}else{logger[_0x7b3e('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x59a3ae,_0x7b3e('0x22'));_0x559782(_0x13ea41[_0x7b3e('0x26')]['message']);}})[_0x7b3e('0x27')](function(_0x51ec9d){logger[_0x7b3e('0x24')](_0x7b3e('0x1f'),_0x59a3ae,_0x51ec9d);_0x4a1fbc(_0x51ec9d);});});}function respondWithStatusCode(_0x3f071c,_0x127bf4){_0x127bf4=_0x127bf4||0xcc;return function(_0x569dac){if(_0x569dac){return _0x3f071c['sendStatus'](_0x127bf4);}return _0x3f071c[_0x7b3e('0x28')](_0x127bf4)[_0x7b3e('0x29')]();};}function respondWithResult(_0x557b4b,_0x5505e6){_0x5505e6=_0x5505e6||0xc8;return function(_0x5906f2){if(_0x5906f2){return _0x557b4b[_0x7b3e('0x28')](_0x5505e6)[_0x7b3e('0x2a')](_0x5906f2);}};}function respondWithFilteredResult(_0x1d78d0,_0x298e11){return function(_0x3d2774){if(_0x3d2774){var _0x4e5666=typeof _0x298e11[_0x7b3e('0x2b')]===_0x7b3e('0x2c')&&typeof _0x298e11['limit']===_0x7b3e('0x2c');var _0x1f37cc=_0x3d2774['count'];var _0x13e1a4=_0x4e5666?0x0:_0x298e11[_0x7b3e('0x2b')];var _0x5ed337=_0x4e5666?_0x3d2774[_0x7b3e('0x2d')]:_0x298e11['offset']+_0x298e11[_0x7b3e('0x2e')];var _0x42c78d;if(_0x5ed337>=_0x1f37cc){_0x5ed337=_0x1f37cc;_0x42c78d=0xc8;}else{_0x42c78d=0xce;}_0x1d78d0[_0x7b3e('0x28')](_0x42c78d);return _0x1d78d0[_0x7b3e('0x2f')](_0x7b3e('0x30'),_0x13e1a4+'-'+_0x5ed337+'/'+_0x1f37cc)[_0x7b3e('0x2a')](_0x3d2774);}return null;};}function patchUpdates(_0x128ccc){return function(_0x463d87){try{jsonpatch[_0x7b3e('0x31')](_0x463d87,_0x128ccc,!![]);}catch(_0x446c43){return BPromise['reject'](_0x446c43);}return _0x463d87[_0x7b3e('0x32')]();};}function saveUpdates(_0x15573e,_0x20ab50){return function(_0x4407fa){if(_0x4407fa){return _0x4407fa['update'](_0x15573e)[_0x7b3e('0x1d')](function(_0x34e206){return _0x34e206;});}return null;};}function removeEntity(_0x4c0b72,_0x1e5933){return function(_0x5cbc60){if(_0x5cbc60){return _0x5cbc60[_0x7b3e('0x33')]()[_0x7b3e('0x1d')](function(){_0x4c0b72['status'](0xcc)[_0x7b3e('0x29')]();});}};}function handleEntityNotFound(_0x34c5b4,_0x5a7f3b){return function(_0x3be339){if(!_0x3be339){_0x34c5b4[_0x7b3e('0x34')](0x194);}return _0x3be339;};}function handleError(_0x35e80e,_0x30cbc3){_0x30cbc3=_0x30cbc3||0x1f4;return function(_0x3e4a28){logger[_0x7b3e('0x24')](_0x3e4a28[_0x7b3e('0x35')]);if(_0x3e4a28['name']){delete _0x3e4a28[_0x7b3e('0x36')];}_0x35e80e[_0x7b3e('0x28')](_0x30cbc3)[_0x7b3e('0x37')](_0x3e4a28);};}exports['index']=function(_0x1f367e,_0xb436a3){var _0x3138dc={},_0xd6a7f2={},_0x207b6d={'count':0x0,'rows':[]};var _0x48d289=_[_0x7b3e('0x38')](db[_0x7b3e('0x39')][_0x7b3e('0x3a')],function(_0x22be57){return{'name':_0x22be57[_0x7b3e('0x3b')],'type':_0x22be57['type'][_0x7b3e('0x3c')]};});_0xd6a7f2[_0x7b3e('0x3d')]=_[_0x7b3e('0x38')](_0x48d289,_0x7b3e('0x36'));_0xd6a7f2[_0x7b3e('0x3e')]=_[_0x7b3e('0x3f')](_0x1f367e[_0x7b3e('0x3e')]);_0xd6a7f2[_0x7b3e('0x40')]=_[_0x7b3e('0x41')](_0xd6a7f2['model'],_0xd6a7f2[_0x7b3e('0x3e')]);_0x3138dc[_0x7b3e('0x42')]=_[_0x7b3e('0x41')](_0xd6a7f2[_0x7b3e('0x3d')],qs['fields'](_0x1f367e['query'][_0x7b3e('0x43')]));_0x3138dc[_0x7b3e('0x42')]=_0x3138dc[_0x7b3e('0x42')][_0x7b3e('0x44')]?_0x3138dc[_0x7b3e('0x42')]:_0xd6a7f2['model'];if(!_0x1f367e[_0x7b3e('0x3e')][_0x7b3e('0x45')]('nolimit')){_0x3138dc[_0x7b3e('0x2e')]=qs[_0x7b3e('0x2e')](_0x1f367e[_0x7b3e('0x3e')][_0x7b3e('0x2e')]);_0x3138dc[_0x7b3e('0x2b')]=qs[_0x7b3e('0x2b')](_0x1f367e[_0x7b3e('0x3e')][_0x7b3e('0x2b')]);}_0x3138dc[_0x7b3e('0x46')]=qs['sort'](_0x1f367e['query'][_0x7b3e('0x47')]);_0x3138dc['where']=qs['filters'](_[_0x7b3e('0x48')](_0x1f367e[_0x7b3e('0x3e')],_0xd6a7f2[_0x7b3e('0x40')]),_0x48d289);if(_0x1f367e[_0x7b3e('0x3e')][_0x7b3e('0x49')]){_0x3138dc['where']=_[_0x7b3e('0x4a')](_0x3138dc[_0x7b3e('0x4b')],{'$or':_[_0x7b3e('0x38')](_0x48d289,function(_0x4b7401){if(_0x4b7401[_0x7b3e('0x4c')]!==_0x7b3e('0x4d')){var _0x21fe21={};_0x21fe21[_0x4b7401[_0x7b3e('0x36')]]={'$like':'%'+_0x1f367e['query'][_0x7b3e('0x49')]+'%'};return _0x21fe21;}})});}_0x3138dc=_[_0x7b3e('0x4a')]({},_0x3138dc,_0x1f367e[_0x7b3e('0x4e')]);var _0x3109fb={'where':_0x3138dc[_0x7b3e('0x4b')]};return db[_0x7b3e('0x39')][_0x7b3e('0x2d')](_0x3109fb)[_0x7b3e('0x1d')](function(_0x31afec){_0x207b6d[_0x7b3e('0x2d')]=_0x31afec;if(_0x1f367e[_0x7b3e('0x3e')][_0x7b3e('0x4f')]){_0x3138dc[_0x7b3e('0x50')]=[{'all':!![]}];}return db[_0x7b3e('0x39')][_0x7b3e('0x51')](_0x3138dc);})[_0x7b3e('0x1d')](function(_0x71ec10){_0x207b6d[_0x7b3e('0x52')]=_0x71ec10;return _0x207b6d;})[_0x7b3e('0x1d')](respondWithFilteredResult(_0xb436a3,_0x3138dc))[_0x7b3e('0x27')](handleError(_0xb436a3,null));};exports[_0x7b3e('0x53')]=function(_0x56c5c2,_0x1d4dfd){var _0x11f492={'raw':!![],'where':{'id':_0x56c5c2[_0x7b3e('0x54')]['id']}},_0x4328c5={};_0x4328c5[_0x7b3e('0x3d')]=_[_0x7b3e('0x3f')](db['OpenchannelMessage'][_0x7b3e('0x3a')]);_0x4328c5[_0x7b3e('0x3e')]=_[_0x7b3e('0x3f')](_0x56c5c2[_0x7b3e('0x3e')]);_0x4328c5[_0x7b3e('0x40')]=_[_0x7b3e('0x41')](_0x4328c5[_0x7b3e('0x3d')],_0x4328c5[_0x7b3e('0x3e')]);_0x11f492[_0x7b3e('0x42')]=_[_0x7b3e('0x41')](_0x4328c5['model'],qs[_0x7b3e('0x43')](_0x56c5c2[_0x7b3e('0x3e')]['fields']));_0x11f492[_0x7b3e('0x42')]=_0x11f492[_0x7b3e('0x42')][_0x7b3e('0x44')]?_0x11f492['attributes']:_0x4328c5[_0x7b3e('0x3d')];if(_0x56c5c2[_0x7b3e('0x3e')][_0x7b3e('0x4f')]){_0x11f492[_0x7b3e('0x50')]=[{'all':!![]}];}_0x11f492=_[_0x7b3e('0x4a')]({},_0x11f492,_0x56c5c2[_0x7b3e('0x4e')]);return db[_0x7b3e('0x39')][_0x7b3e('0x55')](_0x11f492)[_0x7b3e('0x1d')](handleEntityNotFound(_0x1d4dfd,null))['then'](respondWithResult(_0x1d4dfd,null))['catch'](handleError(_0x1d4dfd,null));};exports['create']=function(_0x408b2d,_0x3bf2af){return db[_0x7b3e('0x39')]['create'](_0x408b2d[_0x7b3e('0x56')],{})[_0x7b3e('0x1d')](respondWithResult(_0x3bf2af,0xc9))[_0x7b3e('0x27')](handleError(_0x3bf2af,null));};exports['update']=function(_0x643d21,_0x3c02b3){if(_0x643d21[_0x7b3e('0x56')]['id']){delete _0x643d21[_0x7b3e('0x56')]['id'];}return db[_0x7b3e('0x39')][_0x7b3e('0x55')]({'where':{'id':_0x643d21[_0x7b3e('0x54')]['id']}})[_0x7b3e('0x1d')](handleEntityNotFound(_0x3c02b3,null))['then'](saveUpdates(_0x643d21['body'],null))[_0x7b3e('0x1d')](respondWithResult(_0x3c02b3,null))[_0x7b3e('0x27')](handleError(_0x3c02b3,null));};exports[_0x7b3e('0x33')]=function(_0x23bde9,_0x59059d){return db[_0x7b3e('0x39')]['find']({'where':{'id':_0x23bde9[_0x7b3e('0x54')]['id']}})['then'](handleEntityNotFound(_0x59059d,null))['then'](removeEntity(_0x59059d,null))[_0x7b3e('0x27')](handleError(_0x59059d,null));};exports['describe']=function(_0x2f4f3b,_0x5e5c19){return db[_0x7b3e('0x39')][_0x7b3e('0x57')]()['then'](respondWithResult(_0x5e5c19,null))['catch'](handleError(_0x5e5c19,null));};var interaction_log=require(_0x7b3e('0x13'))(_0x7b3e('0x58'));exports[_0x7b3e('0x59')]=function(_0x3a6c64,_0x437bfd,_0x456e66){var _0x4c7a95={'agent':{},'channel':_0x7b3e('0x5a')};if(_0x3a6c64['body']['id']){delete _0x3a6c64[_0x7b3e('0x56')]['id'];}_0x3a6c64[_0x7b3e('0x56')]['read']=!![];_0x3a6c64['body'][_0x7b3e('0x5b')]=moment()[_0x7b3e('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x3a6c64['body'][_0x7b3e('0x5d')]=_0x3a6c64[_0x7b3e('0x56')][_0x7b3e('0x5d')]||_0x3a6c64[_0x7b3e('0x5e')]['id'];_0x4c7a95[_0x7b3e('0x5f')]['id']=_0x3a6c64['body'][_0x7b3e('0x5d')];return db['OpenchannelMessage'][_0x7b3e('0x55')]({'where':{'id':_0x3a6c64[_0x7b3e('0x54')]['id'],'UserId':null}})[_0x7b3e('0x1d')](handleEntityNotFound(_0x437bfd,null))['then'](saveUpdates(_0x3a6c64[_0x7b3e('0x56')],null))[_0x7b3e('0x1d')](function(_0x233b39){if(_0x233b39){_0x4c7a95[_0x7b3e('0x25')]=_0x233b39[_0x7b3e('0x60')]({'plain':!![]});return db[_0x7b3e('0x61')][_0x7b3e('0x55')]({'where':{'id':_0x233b39['OpenchannelInteractionId']}});}return null;})[_0x7b3e('0x1d')](handleEntityNotFound(_0x437bfd,null))[_0x7b3e('0x1d')](function(_0x24f598){if(_0x24f598){return _0x24f598['update']({'UserId':_0x3a6c64[_0x7b3e('0x56')][_0x7b3e('0x5d')],'read1stAt':_[_0x7b3e('0x62')](_0x24f598['read1stAt'])?moment()[_0x7b3e('0x5c')](_0x7b3e('0x63')):undefined});}return null;})[_0x7b3e('0x1d')](function(_0x18526b){if(_0x18526b){_0x4c7a95[_0x7b3e('0x64')]=_0x18526b[_0x7b3e('0x60')]({'plain':!![]});interaction_log[_0x7b3e('0x1e')](_0x7b3e('0x65'),_0x3a6c64[_0x7b3e('0x5e')]['id'],_0x3a6c64[_0x7b3e('0x5e')][_0x7b3e('0x36')],_0x3a6c64['user'][_0x7b3e('0x66')],_0x4c7a95[_0x7b3e('0x64')]['id'],_0x3a6c64['body']?JSON[_0x7b3e('0x23')](_0x3a6c64[_0x7b3e('0x56')]):'null');return respondWithRpcPromise(_0x7b3e('0x67'),'acceptMessage',_0x4c7a95);}return null;})[_0x7b3e('0x1d')](function(_0x57cfe3){var _0x4713eb=_0x7b3e('0x68')+_0x57cfe3[_0x7b3e('0x25')]['ContactId'];return db['sequelize'][_0x7b3e('0x3e')](_0x4713eb,{'type':db[_0x7b3e('0x69')]['QueryTypes']['SELECT'],'raw':!![]})[_0x7b3e('0x1d')](function(_0x6cd37e){return _0x6cd37e;});})[_0x7b3e('0x1d')](function(_0xc7dd2a){if(_0xc7dd2a){_0x4c7a95[_0x7b3e('0x25')]['contact']=_0xc7dd2a[0x0];if(!_0x3a6c64[_0x7b3e('0x56')]['UserId'])return;return db[_0x7b3e('0x6a')][_0x7b3e('0x55')]({'where':{'id':_0x3a6c64['body'][_0x7b3e('0x5d')],'role':_0x7b3e('0x5f')},'attributes':['id',_0x7b3e('0x36'),_0x7b3e('0x6b'),_0x7b3e('0x6c'),_0x7b3e('0x6d')],'raw':!![]});}return null;})['then'](function(_0x69f1c6){if(!_0x69f1c6)return null;_0x4c7a95[_0x7b3e('0x25')][_0x7b3e('0x5f')]=_0x69f1c6;return _0x4c7a95;})[_0x7b3e('0x1d')](function(_0x6881d){if(_0x6881d){if(_0x3a6c64['body'][_0x7b3e('0x6e')]){_0x4c7a95[_0x7b3e('0x25')][_0x7b3e('0x6f')]=util['format']('SIP/%s',_0x3a6c64[_0x7b3e('0x5e')][_0x7b3e('0x36')]);_0x4c7a95[_0x7b3e('0x25')][_0x7b3e('0x70')]=_0x4c7a95['channel'];_0x4c7a95[_0x7b3e('0x25')][_0x7b3e('0x71')]=_0x4c7a95[_0x7b3e('0x70')];_0x4c7a95['message'][_0x7b3e('0x72')]=_0x7b3e('0x59');return respondWithRpcPromise(_0x7b3e('0x73'),_0x7b3e('0x73'),{'event':_0x7b3e('0x74'),'message':_0x4c7a95[_0x7b3e('0x25')]},client9002)[_0x7b3e('0x1d')](function(){return _0x4c7a95;});}return _0x4c7a95;}return null;})['then'](respondWithResult(_0x437bfd,null))[_0x7b3e('0x27')](handleError(_0x437bfd,null));};var interaction_log=require(_0x7b3e('0x13'))(_0x7b3e('0x58'));exports[_0x7b3e('0x75')]=function(_0x40790a,_0xd86f4d,_0x22723d){var _0x51e4a6={'agent':{},'channel':_0x7b3e('0x5a')};if(_0x40790a[_0x7b3e('0x56')]['id']){delete _0x40790a['body']['id'];}_0x40790a[_0x7b3e('0x56')][_0x7b3e('0x5d')]=_0x40790a['body']['UserId']||_0x40790a[_0x7b3e('0x5e')]['id'];_0x51e4a6['agent']['id']=_0x40790a[_0x7b3e('0x56')][_0x7b3e('0x5d')];return db[_0x7b3e('0x39')][_0x7b3e('0x55')]({'where':{'id':_0x40790a[_0x7b3e('0x54')]['id'],'UserId':null}})[_0x7b3e('0x1d')](handleEntityNotFound(_0xd86f4d,null))[_0x7b3e('0x1d')](function(_0x5df771){if(_0x5df771){_0x51e4a6[_0x7b3e('0x25')]=_0x5df771['get']({'plain':!![]});return db[_0x7b3e('0x61')]['find']({'where':{'id':_0x5df771[_0x7b3e('0x76')]}});}return null;})['then'](handleEntityNotFound(_0xd86f4d,null))['then'](function(_0x3f6301){if(_0x3f6301){_0x51e4a6['interaction']=_0x3f6301[_0x7b3e('0x60')]({'plain':!![]});interaction_log[_0x7b3e('0x1e')](_0x7b3e('0x77'),_0x40790a[_0x7b3e('0x5e')]['id'],_0x40790a[_0x7b3e('0x5e')][_0x7b3e('0x36')],_0x40790a[_0x7b3e('0x5e')][_0x7b3e('0x66')],_0x51e4a6[_0x7b3e('0x64')]['id'],_0x40790a[_0x7b3e('0x56')]?JSON[_0x7b3e('0x23')](_0x40790a[_0x7b3e('0x56')]):_0x7b3e('0x78'));return respondWithRpcPromise(_0x7b3e('0x79'),_0x7b3e('0x7a'),_0x51e4a6);}return null;})[_0x7b3e('0x1d')](function(_0xe2634){var _0x14ea9c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe2634[_0x7b3e('0x25')][_0x7b3e('0x7b')];return db[_0x7b3e('0x7c')][_0x7b3e('0x3e')](_0x14ea9c,{'type':db[_0x7b3e('0x69')][_0x7b3e('0x7d')][_0x7b3e('0x7e')],'raw':!![]})[_0x7b3e('0x1d')](function(_0x49de7e){return _0x49de7e;});})[_0x7b3e('0x1d')](function(_0x287652){if(_0x287652){_0x51e4a6[_0x7b3e('0x25')]['contact']=_0x287652[0x0];if(!_0x40790a[_0x7b3e('0x56')]['UserId'])return;return db[_0x7b3e('0x6a')][_0x7b3e('0x55')]({'where':{'id':_0x40790a[_0x7b3e('0x56')]['UserId'],'role':_0x7b3e('0x5f')},'attributes':['id','name',_0x7b3e('0x6b'),'email',_0x7b3e('0x6d')],'raw':!![]});}return null;})[_0x7b3e('0x1d')](function(_0x49cb27){if(!_0x49cb27)return null;_0x51e4a6['message']['agent']=_0x49cb27;return _0x51e4a6;})[_0x7b3e('0x1d')](function(_0x5c66d4){if(_0x5c66d4){_0x5c66d4['message'][_0x7b3e('0x6f')]=util['format'](_0x7b3e('0x7f'),_0x40790a[_0x7b3e('0x5e')][_0x7b3e('0x36')]);_0x5c66d4['message']['channel']=_0x51e4a6[_0x7b3e('0x70')];_0x5c66d4[_0x7b3e('0x25')][_0x7b3e('0x71')]=_0x51e4a6[_0x7b3e('0x70')];_0x5c66d4['message'][_0x7b3e('0x72')]=_0x7b3e('0x75');respondWithRpcPromise(_0x7b3e('0x73'),_0x7b3e('0x73'),{'event':_0x7b3e('0x80'),'message':_0x5c66d4['message']},client9002);return _0x51e4a6;}return null;})[_0x7b3e('0x1d')](respondWithResult(_0xd86f4d,null))[_0x7b3e('0x27')](handleError(_0xd86f4d,null));};
\ No newline at end of file
+var _0x9494=['limit','count','set','Content-Range','update','destroy','end','stack','name','send','OpenchannelMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','map','filter','merge','options','includeAll','include','findAll','rows','show','keys','find','body','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','params','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rimraf','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','http','client','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','info','result','message','catch','sendStatus','status','json','offset','undefined'];(function(_0x1e2bf2,_0x137000){var _0x2a8780=function(_0x4a55bb){while(--_0x4a55bb){_0x1e2bf2['push'](_0x1e2bf2['shift']());}};_0x2a8780(++_0x137000);}(_0x9494,0xcf));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4949('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4949('0x1'));var moment=require(_0x4949('0x2'));var BPromise=require(_0x4949('0x3'));var Mustache=require('mustache');var util=require(_0x4949('0x4'));var path=require('path');var sox=require(_0x4949('0x5'));var csv=require(_0x4949('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4949('0x7'));var _=require(_0x4949('0x8'));var squel=require(_0x4949('0x9'));var crypto=require(_0x4949('0xa'));var jsforce=require(_0x4949('0xb'));var deskjs=require(_0x4949('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4949('0xd'));var Papa=require(_0x4949('0xe'));var Redis=require(_0x4949('0xf'));var authService=require(_0x4949('0x10'));var qs=require(_0x4949('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4949('0x12'));var logger=require('../../config/logger')(_0x4949('0x13'));var utils=require(_0x4949('0x14'));var config=require(_0x4949('0x15'));var licenseUtil=require(_0x4949('0x16'));var db=require(_0x4949('0x17'))['db'];config['redis']=_[_0x4949('0x18')](config[_0x4949('0x19')],{'host':_0x4949('0x1a'),'port':0x18eb});var socket=require(_0x4949('0x1b'))(new Redis(config[_0x4949('0x19')]));require(_0x4949('0x1c'))[_0x4949('0x1d')](socket);var jayson=require(_0x4949('0x1e'));var client=jayson['client'][_0x4949('0x1f')]({'port':0x232c});var client9002=jayson[_0x4949('0x20')][_0x4949('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2e90cc,_0x47f1ba,_0x562d6e,_0x1489e5){return new BPromise(function(_0x5b790a,_0x52f586){var _0x4ee5d9=_0x1489e5||client;return _0x4ee5d9['request'](_0x2e90cc,_0x562d6e)[_0x4949('0x21')](function(_0x1306fb){logger['info'](_0x4949('0x22'),_0x47f1ba,_0x4949('0x23'));logger['debug'](_0x4949('0x24'),_0x47f1ba,'request\x20sent',JSON[_0x4949('0x25')](_0x1306fb));if(_0x1306fb[_0x4949('0x26')]){if(_0x1306fb['error'][_0x4949('0x27')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x47f1ba,_0x1306fb[_0x4949('0x26')]['message']);return _0x52f586(_0x1306fb['error']['message']);}logger['error'](_0x4949('0x22'),_0x47f1ba,_0x1306fb[_0x4949('0x26')]['message']);return _0x5b790a(_0x1306fb[_0x4949('0x26')]['message']);}else{logger[_0x4949('0x28')](_0x4949('0x22'),_0x47f1ba,_0x4949('0x23'));_0x5b790a(_0x1306fb[_0x4949('0x29')][_0x4949('0x2a')]);}})[_0x4949('0x2b')](function(_0x21b370){logger['error'](_0x4949('0x22'),_0x47f1ba,_0x21b370);_0x52f586(_0x21b370);});});}function respondWithStatusCode(_0x458002,_0x5b4767){_0x5b4767=_0x5b4767||0xcc;return function(_0x55a46a){if(_0x55a46a){return _0x458002[_0x4949('0x2c')](_0x5b4767);}return _0x458002[_0x4949('0x2d')](_0x5b4767)['end']();};}function respondWithResult(_0x1ed426,_0x332548){_0x332548=_0x332548||0xc8;return function(_0x452863){if(_0x452863){return _0x1ed426[_0x4949('0x2d')](_0x332548)[_0x4949('0x2e')](_0x452863);}};}function respondWithFilteredResult(_0x530305,_0x508fca){return function(_0x5e452c){if(_0x5e452c){var _0x19065c=typeof _0x508fca[_0x4949('0x2f')]===_0x4949('0x30')&&typeof _0x508fca[_0x4949('0x31')]==='undefined';var _0x5d557c=_0x5e452c[_0x4949('0x32')];var _0x363380=_0x19065c?0x0:_0x508fca[_0x4949('0x2f')];var _0x15e748=_0x19065c?_0x5e452c[_0x4949('0x32')]:_0x508fca['offset']+_0x508fca[_0x4949('0x31')];var _0x7f1831;if(_0x15e748>=_0x5d557c){_0x15e748=_0x5d557c;_0x7f1831=0xc8;}else{_0x7f1831=0xce;}_0x530305[_0x4949('0x2d')](_0x7f1831);return _0x530305[_0x4949('0x33')](_0x4949('0x34'),_0x363380+'-'+_0x15e748+'/'+_0x5d557c)[_0x4949('0x2e')](_0x5e452c);}return null;};}function patchUpdates(_0x5cd039){return function(_0x1976cb){try{jsonpatch['apply'](_0x1976cb,_0x5cd039,!![]);}catch(_0x8a3d31){return BPromise['reject'](_0x8a3d31);}return _0x1976cb['save']();};}function saveUpdates(_0x196155,_0x53638d){return function(_0x3250de){if(_0x3250de){return _0x3250de[_0x4949('0x35')](_0x196155)[_0x4949('0x21')](function(_0x1b8093){return _0x1b8093;});}return null;};}function removeEntity(_0x6547ff,_0x22646d){return function(_0x5ccc62){if(_0x5ccc62){return _0x5ccc62[_0x4949('0x36')]()['then'](function(){_0x6547ff[_0x4949('0x2d')](0xcc)[_0x4949('0x37')]();});}};}function handleEntityNotFound(_0x5a9658,_0x32cee7){return function(_0x276555){if(!_0x276555){_0x5a9658[_0x4949('0x2c')](0x194);}return _0x276555;};}function handleError(_0x1f878f,_0x13dd02){_0x13dd02=_0x13dd02||0x1f4;return function(_0x140f99){logger['error'](_0x140f99[_0x4949('0x38')]);if(_0x140f99[_0x4949('0x39')]){delete _0x140f99[_0x4949('0x39')];}_0x1f878f[_0x4949('0x2d')](_0x13dd02)[_0x4949('0x3a')](_0x140f99);};}exports['index']=function(_0xd52da,_0x15b004){var _0x365839={},_0x1ca1bc={},_0x5804d8={'count':0x0,'rows':[]};var _0x349042=_['map'](db[_0x4949('0x3b')][_0x4949('0x3c')],function(_0x349afc){return{'name':_0x349afc[_0x4949('0x3d')],'type':_0x349afc[_0x4949('0x3e')]['key']};});_0x1ca1bc[_0x4949('0x3f')]=_['map'](_0x349042,_0x4949('0x39'));_0x1ca1bc[_0x4949('0x40')]=_['keys'](_0xd52da[_0x4949('0x40')]);_0x1ca1bc[_0x4949('0x41')]=_[_0x4949('0x42')](_0x1ca1bc[_0x4949('0x3f')],_0x1ca1bc['query']);_0x365839[_0x4949('0x43')]=_[_0x4949('0x42')](_0x1ca1bc[_0x4949('0x3f')],qs[_0x4949('0x44')](_0xd52da[_0x4949('0x40')][_0x4949('0x44')]));_0x365839[_0x4949('0x43')]=_0x365839[_0x4949('0x43')][_0x4949('0x45')]?_0x365839[_0x4949('0x43')]:_0x1ca1bc[_0x4949('0x3f')];if(!_0xd52da['query'][_0x4949('0x46')](_0x4949('0x47'))){_0x365839['limit']=qs[_0x4949('0x31')](_0xd52da[_0x4949('0x40')][_0x4949('0x31')]);_0x365839[_0x4949('0x2f')]=qs['offset'](_0xd52da[_0x4949('0x40')][_0x4949('0x2f')]);}_0x365839['order']=qs[_0x4949('0x48')](_0xd52da['query'][_0x4949('0x48')]);_0x365839[_0x4949('0x49')]=qs['filters'](_['pick'](_0xd52da[_0x4949('0x40')],_0x1ca1bc[_0x4949('0x41')]),_0x349042);if(_0xd52da[_0x4949('0x40')]['filter']){_0x365839[_0x4949('0x49')]=_['merge'](_0x365839[_0x4949('0x49')],{'$or':_[_0x4949('0x4a')](_0x349042,function(_0x45ef85){if(_0x45ef85['type']!=='VIRTUAL'){var _0x67fedf={};_0x67fedf[_0x45ef85['name']]={'$like':'%'+_0xd52da['query'][_0x4949('0x4b')]+'%'};return _0x67fedf;}})});}_0x365839=_[_0x4949('0x4c')]({},_0x365839,_0xd52da[_0x4949('0x4d')]);var _0x5cfe59={'where':_0x365839['where']};return db[_0x4949('0x3b')][_0x4949('0x32')](_0x5cfe59)[_0x4949('0x21')](function(_0x16019d){_0x5804d8[_0x4949('0x32')]=_0x16019d;if(_0xd52da[_0x4949('0x40')][_0x4949('0x4e')]){_0x365839[_0x4949('0x4f')]=[{'all':!![]}];}return db[_0x4949('0x3b')][_0x4949('0x50')](_0x365839);})[_0x4949('0x21')](function(_0x51e978){_0x5804d8[_0x4949('0x51')]=_0x51e978;return _0x5804d8;})[_0x4949('0x21')](respondWithFilteredResult(_0x15b004,_0x365839))[_0x4949('0x2b')](handleError(_0x15b004,null));};exports[_0x4949('0x52')]=function(_0x1529a8,_0x3d0d72){var _0x17f6fd={'raw':!![],'where':{'id':_0x1529a8['params']['id']}},_0x5ef171={};_0x5ef171[_0x4949('0x3f')]=_['keys'](db['OpenchannelMessage'][_0x4949('0x3c')]);_0x5ef171[_0x4949('0x40')]=_[_0x4949('0x53')](_0x1529a8[_0x4949('0x40')]);_0x5ef171[_0x4949('0x41')]=_[_0x4949('0x42')](_0x5ef171[_0x4949('0x3f')],_0x5ef171[_0x4949('0x40')]);_0x17f6fd['attributes']=_[_0x4949('0x42')](_0x5ef171[_0x4949('0x3f')],qs[_0x4949('0x44')](_0x1529a8[_0x4949('0x40')][_0x4949('0x44')]));_0x17f6fd['attributes']=_0x17f6fd['attributes'][_0x4949('0x45')]?_0x17f6fd[_0x4949('0x43')]:_0x5ef171['model'];if(_0x1529a8[_0x4949('0x40')][_0x4949('0x4e')]){_0x17f6fd[_0x4949('0x4f')]=[{'all':!![]}];}_0x17f6fd=_['merge']({},_0x17f6fd,_0x1529a8[_0x4949('0x4d')]);return db[_0x4949('0x3b')][_0x4949('0x54')](_0x17f6fd)[_0x4949('0x21')](handleEntityNotFound(_0x3d0d72,null))['then'](respondWithResult(_0x3d0d72,null))[_0x4949('0x2b')](handleError(_0x3d0d72,null));};exports['create']=function(_0x231d92,_0xd9636d){return db[_0x4949('0x3b')]['create'](_0x231d92[_0x4949('0x55')],{})['then'](respondWithResult(_0xd9636d,0xc9))[_0x4949('0x2b')](handleError(_0xd9636d,null));};exports[_0x4949('0x35')]=function(_0x58cf0f,_0x531d45){if(_0x58cf0f[_0x4949('0x55')]['id']){delete _0x58cf0f['body']['id'];}return db['OpenchannelMessage'][_0x4949('0x54')]({'where':{'id':_0x58cf0f['params']['id']}})[_0x4949('0x21')](handleEntityNotFound(_0x531d45,null))['then'](saveUpdates(_0x58cf0f[_0x4949('0x55')],null))['then'](respondWithResult(_0x531d45,null))[_0x4949('0x2b')](handleError(_0x531d45,null));};exports['destroy']=function(_0x36e0d7,_0x29ccfc){return db[_0x4949('0x3b')][_0x4949('0x54')]({'where':{'id':_0x36e0d7['params']['id']}})[_0x4949('0x21')](handleEntityNotFound(_0x29ccfc,null))[_0x4949('0x21')](removeEntity(_0x29ccfc,null))[_0x4949('0x2b')](handleError(_0x29ccfc,null));};exports[_0x4949('0x56')]=function(_0x5698b0,_0x199d18){return db['OpenchannelMessage'][_0x4949('0x56')]()[_0x4949('0x21')](respondWithResult(_0x199d18,null))[_0x4949('0x2b')](handleError(_0x199d18,null));};var interaction_log=require(_0x4949('0x57'))(_0x4949('0x58'));exports[_0x4949('0x59')]=function(_0xe500e5,_0x1a435f,_0xeecb08){var _0x3d191a={'agent':{},'channel':_0x4949('0x5a')};if(_0xe500e5[_0x4949('0x55')]['id']){delete _0xe500e5[_0x4949('0x55')]['id'];}_0xe500e5[_0x4949('0x55')][_0x4949('0x5b')]=!![];_0xe500e5[_0x4949('0x55')]['readAt']=moment()[_0x4949('0x5c')](_0x4949('0x5d'));_0xe500e5[_0x4949('0x55')][_0x4949('0x5e')]=_0xe500e5[_0x4949('0x55')][_0x4949('0x5e')]||_0xe500e5[_0x4949('0x5f')]['id'];_0x3d191a['agent']['id']=_0xe500e5[_0x4949('0x55')][_0x4949('0x5e')];return db[_0x4949('0x3b')][_0x4949('0x54')]({'where':{'id':_0xe500e5[_0x4949('0x60')]['id'],'UserId':null}})[_0x4949('0x21')](handleEntityNotFound(_0x1a435f,null))['then'](saveUpdates(_0xe500e5[_0x4949('0x55')],null))[_0x4949('0x21')](function(_0xee78c5){if(_0xee78c5){_0x3d191a[_0x4949('0x2a')]=_0xee78c5[_0x4949('0x61')]({'plain':!![]});return db[_0x4949('0x62')]['find']({'where':{'id':_0xee78c5[_0x4949('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x1a435f,null))[_0x4949('0x21')](function(_0x2bef44){if(_0x2bef44){return _0x2bef44[_0x4949('0x35')]({'UserId':_0xe500e5[_0x4949('0x55')][_0x4949('0x5e')],'read1stAt':_[_0x4949('0x64')](_0x2bef44[_0x4949('0x65')])?moment()[_0x4949('0x5c')](_0x4949('0x5d')):undefined});}return null;})['then'](function(_0x40f984){if(_0x40f984){_0x3d191a[_0x4949('0x66')]=_0x40f984['get']({'plain':!![]});interaction_log[_0x4949('0x28')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe500e5[_0x4949('0x5f')]['id'],_0xe500e5['user'][_0x4949('0x39')],_0xe500e5[_0x4949('0x5f')][_0x4949('0x67')],_0x3d191a[_0x4949('0x66')]['id'],_0xe500e5[_0x4949('0x55')]?JSON[_0x4949('0x25')](_0xe500e5[_0x4949('0x55')]):_0x4949('0x68'));return respondWithRpcPromise(_0x4949('0x69'),_0x4949('0x6a'),_0x3d191a);}return null;})[_0x4949('0x21')](function(_0x26f5c7){var _0x5acefb=_0x4949('0x6b')+_0x26f5c7['message']['ContactId'];return db[_0x4949('0x6c')][_0x4949('0x40')](_0x5acefb,{'type':db[_0x4949('0x6d')][_0x4949('0x6e')][_0x4949('0x6f')],'raw':!![]})[_0x4949('0x21')](function(_0x254b09){return _0x254b09;});})[_0x4949('0x21')](function(_0x2c0161){if(_0x2c0161){_0x3d191a[_0x4949('0x2a')][_0x4949('0x70')]=_0x2c0161[0x0];if(!_0xe500e5[_0x4949('0x55')][_0x4949('0x5e')])return;return db[_0x4949('0x71')]['find']({'where':{'id':_0xe500e5[_0x4949('0x55')]['UserId'],'role':_0x4949('0x72')},'attributes':['id','name',_0x4949('0x73'),_0x4949('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x4a7880){if(!_0x4a7880)return null;_0x3d191a[_0x4949('0x2a')][_0x4949('0x72')]=_0x4a7880;return _0x3d191a;})['then'](function(_0x41c85f){if(_0x41c85f){if(_0xe500e5[_0x4949('0x55')]['manual']){_0x3d191a[_0x4949('0x2a')][_0x4949('0x75')]=util[_0x4949('0x5c')](_0x4949('0x76'),_0xe500e5[_0x4949('0x5f')][_0x4949('0x39')]);_0x3d191a[_0x4949('0x2a')][_0x4949('0x77')]=_0x3d191a[_0x4949('0x77')];_0x3d191a[_0x4949('0x2a')][_0x4949('0x78')]=_0x3d191a['channel'];_0x3d191a[_0x4949('0x2a')][_0x4949('0x79')]='accept';return respondWithRpcPromise(_0x4949('0x7a'),'EventManager',{'event':_0x4949('0x7b'),'message':_0x3d191a[_0x4949('0x2a')]},client9002)[_0x4949('0x21')](function(){return _0x3d191a;});}return _0x3d191a;}return null;})[_0x4949('0x21')](respondWithResult(_0x1a435f,null))[_0x4949('0x2b')](handleError(_0x1a435f,null));};var interaction_log=require(_0x4949('0x57'))(_0x4949('0x58'));exports[_0x4949('0x7c')]=function(_0x51ceb8,_0x7060ef,_0x3dd1d8){var _0x2d6929={'agent':{},'channel':_0x4949('0x5a')};if(_0x51ceb8[_0x4949('0x55')]['id']){delete _0x51ceb8[_0x4949('0x55')]['id'];}_0x51ceb8[_0x4949('0x55')][_0x4949('0x5e')]=_0x51ceb8[_0x4949('0x55')][_0x4949('0x5e')]||_0x51ceb8['user']['id'];_0x2d6929[_0x4949('0x72')]['id']=_0x51ceb8['body'][_0x4949('0x5e')];return db[_0x4949('0x3b')][_0x4949('0x54')]({'where':{'id':_0x51ceb8[_0x4949('0x60')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x7060ef,null))['then'](function(_0x1e42a5){if(_0x1e42a5){_0x2d6929[_0x4949('0x2a')]=_0x1e42a5[_0x4949('0x61')]({'plain':!![]});return db[_0x4949('0x62')]['find']({'where':{'id':_0x1e42a5['OpenchannelInteractionId']}});}return null;})[_0x4949('0x21')](handleEntityNotFound(_0x7060ef,null))['then'](function(_0x1bd561){if(_0x1bd561){_0x2d6929[_0x4949('0x66')]=_0x1bd561[_0x4949('0x61')]({'plain':!![]});interaction_log[_0x4949('0x28')](_0x4949('0x7d'),_0x51ceb8[_0x4949('0x5f')]['id'],_0x51ceb8[_0x4949('0x5f')][_0x4949('0x39')],_0x51ceb8['user'][_0x4949('0x67')],_0x2d6929[_0x4949('0x66')]['id'],_0x51ceb8[_0x4949('0x55')]?JSON[_0x4949('0x25')](_0x51ceb8[_0x4949('0x55')]):_0x4949('0x68'));return respondWithRpcPromise(_0x4949('0x7e'),_0x4949('0x7f'),_0x2d6929);}return null;})[_0x4949('0x21')](function(_0x3bdcd){var _0x1c052e=_0x4949('0x6b')+_0x3bdcd[_0x4949('0x2a')]['ContactId'];return db[_0x4949('0x6c')][_0x4949('0x40')](_0x1c052e,{'type':db['Sequelize']['QueryTypes'][_0x4949('0x6f')],'raw':!![]})[_0x4949('0x21')](function(_0x3a01ed){return _0x3a01ed;});})['then'](function(_0x5b86ec){if(_0x5b86ec){_0x2d6929['message'][_0x4949('0x70')]=_0x5b86ec[0x0];if(!_0x51ceb8[_0x4949('0x55')]['UserId'])return;return db[_0x4949('0x71')]['find']({'where':{'id':_0x51ceb8[_0x4949('0x55')]['UserId'],'role':_0x4949('0x72')},'attributes':['id',_0x4949('0x39'),_0x4949('0x73'),_0x4949('0x74'),'internal'],'raw':!![]});}return null;})[_0x4949('0x21')](function(_0x2f1a69){if(!_0x2f1a69)return null;_0x2d6929[_0x4949('0x2a')][_0x4949('0x72')]=_0x2f1a69;return _0x2d6929;})['then'](function(_0x1c49f0){if(_0x1c49f0){_0x1c49f0[_0x4949('0x2a')][_0x4949('0x75')]=util['format'](_0x4949('0x76'),_0x51ceb8[_0x4949('0x5f')][_0x4949('0x39')]);_0x1c49f0[_0x4949('0x2a')][_0x4949('0x77')]=_0x2d6929[_0x4949('0x77')];_0x1c49f0[_0x4949('0x2a')][_0x4949('0x78')]=_0x2d6929[_0x4949('0x77')];_0x1c49f0[_0x4949('0x2a')][_0x4949('0x79')]=_0x4949('0x7c');respondWithRpcPromise(_0x4949('0x7a'),_0x4949('0x7a'),{'event':'rejectmessage','message':_0x1c49f0['message']},client9002);return _0x2d6929;}return null;})['then'](respondWithResult(_0x7060ef,null))['catch'](handleError(_0x7060ef,null));};
\ No newline at end of file
index 5a99912..88eff63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x482e=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelMessage'];(function(_0x3a5595,_0x267381){var _0x3cac19=function(_0x50953f){while(--_0x50953f){_0x3a5595['push'](_0x3a5595['shift']());}};_0x3cac19(++_0x267381);}(_0x482e,0x19b));var _0xe482=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x482e[_0x25d386];return _0x857f4a;};'use strict';var EventEmitter=require(_0xe482('0x0'));var OpenchannelMessage=require(_0xe482('0x1'))['db'][_0xe482('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe482('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe482('0x4'),'afterDestroy':_0xe482('0x5')};function emitEvent(_0x481464){return function(_0x5689ad,_0xce3961,_0x5f0c1a){OpenchannelMessageEvents[_0xe482('0x6')](_0x481464+':'+_0x5689ad['id'],_0x5689ad);OpenchannelMessageEvents['emit'](_0x481464,_0x5689ad);_0x5f0c1a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xe482('0x7')](e,emitEvent(event));}}module[_0xe482('0x8')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xd655=['setMaxListeners','save','remove','hasOwnProperty','hook','../../mysqldb','OpenchannelMessage'];(function(_0x51bb26,_0x522011){var _0x5cc1c7=function(_0x3d43ca){while(--_0x3d43ca){_0x51bb26['push'](_0x51bb26['shift']());}};_0x5cc1c7(++_0x522011);}(_0xd655,0x16a));var _0x5d65=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xd655[_0x6e1239];return _0x418150;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x5d65('0x0'))['db'][_0x5d65('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5d65('0x2')](0x0);var events={'afterCreate':_0x5d65('0x3'),'afterUpdate':'update','afterDestroy':_0x5d65('0x4')};function emitEvent(_0x4a2afa){return function(_0xe7eaf5,_0x4ca447,_0x28ed8e){OpenchannelMessageEvents['emit'](_0x4a2afa+':'+_0xe7eaf5['id'],_0xe7eaf5);OpenchannelMessageEvents['emit'](_0x4a2afa,_0xe7eaf5);_0x28ed8e(null);};}for(var e in events){if(events[_0x5d65('0x5')](e)){var event=events[e];OpenchannelMessage[_0x5d65('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index 33a2ba5..5015be6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c22=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Contact','keys','info','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','Interactions','length','Interaction','omit','POST','method','GET','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','catch','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x1e1fa7,_0x3b2b89){var _0x10b981=function(_0x571c1f){while(--_0x571c1f){_0x1e1fa7['push'](_0x1e1fa7['shift']());}};_0x10b981(++_0x3b2b89);}(_0x3c22,0x14f));var _0x23c2=function(_0x2b3444,_0x4a74dd){_0x2b3444=_0x2b3444-0x0;var _0x2fddc0=_0x3c22[_0x2b3444];return _0x2fddc0;};'use strict';var _=require('lodash');var util=require(_0x23c2('0x0'));var logger=require(_0x23c2('0x1'))(_0x23c2('0x2'));var moment=require(_0x23c2('0x3'));var BPromise=require(_0x23c2('0x4'));var rp=require(_0x23c2('0x5'));var fs=require('fs');var path=require(_0x23c2('0x6'));var rimraf=require(_0x23c2('0x7'));var config=require(_0x23c2('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x23c2('0x9')]=function(_0xab8c5a,_0x38a7e4){return _0xab8c5a['define'](_0x23c2('0xa'),attributes,{'tableName':_0x23c2('0xb'),'paranoid':![],'indexes':[{'name':_0x23c2('0xc'),'fields':[_0x23c2('0xd')],'type':_0x23c2('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x43cd21,_0x31ed5a,_0x5a1744){var _0x39330e=_0xab8c5a['models'];var _0x26e553=_0x43cd21[_0x23c2('0xf')]({'plain':!![]});if(_0x26e553[_0x23c2('0x10')][_0x23c2('0x11')]()==='in'||_0x26e553['direction']['toLowerCase']()===_0x23c2('0x12')&&!_0x26e553[_0x23c2('0x13')]&&!_[_0x23c2('0x14')](_0x26e553[_0x23c2('0x15')])){_0x39330e['OpenchannelInteraction'][_0x23c2('0x16')]({'where':{'id':_0x26e553[_0x23c2('0x17')]}})[_0x23c2('0x18')](function(_0x260c91){if(_0x260c91){_0x260c91[_0x23c2('0x19')]({'lastMsgAt':_0x26e553[_0x23c2('0x1a')],'lastMsgDirection':_0x26e553[_0x23c2('0x10')][_0x23c2('0x11')]()});}})['catch'](function(_0x554881){console[_0x23c2('0x1b')](_0x554881);});}if(_0x26e553[_0x23c2('0x10')]===_0x23c2('0x12')&&!_0x26e553[_0x23c2('0x13')]){var _0x5c0507;_0x39330e[_0x23c2('0x1c')][_0x23c2('0x1d')]()['then'](function(_0x4c4edf){return _0x39330e[_0x23c2('0x1e')][_0x23c2('0x1f')]({'where':{'id':_0x26e553[_0x23c2('0x20')]},'include':[{'model':_0x39330e[_0x23c2('0x21')],'as':'Interactions','where':{'id':_0x26e553[_0x23c2('0x17')]},'limit':0x1,'include':[{'model':_0x39330e['CmContact'],'as':_0x23c2('0x22'),'attributes':_[_0x23c2('0x23')](_0x4c4edf)}]}]});})[_0x23c2('0x18')](function(_0x5e16e9){_0x5c0507=_0x5e16e9[_0x23c2('0xf')]({'plain':!![]});if(_0x5c0507&&_0x5c0507['replyUri']){logger[_0x23c2('0x24')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util['format'](_0x23c2('0x25'),_0x26e553['id'],_0x5c0507[_0x23c2('0x26')]));if(_0x5c0507['Interactions']&&_0x5c0507[_0x23c2('0x27')][_0x23c2('0x28')]){_0x26e553[_0x23c2('0x29')]=_[_0x23c2('0x2a')](_0x5c0507[_0x23c2('0x27')][0x0],_0x23c2('0x22'));_0x26e553[_0x23c2('0x22')]=_0x5c0507['Interactions'][0x0]['Contact'];}var _0x31ed5a={'method':_0x23c2('0x2b'),'uri':encodeURI(_0x5c0507[_0x23c2('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x31ed5a[_0x23c2('0x2c')]){case _0x23c2('0x2d'):_0x31ed5a['qs']=_0x26e553;break;case'POST':_0x31ed5a[_0x23c2('0xd')]=_0x26e553;break;}return rp(_0x31ed5a)['then'](function(_0x27fc48){logger['info'](_0x23c2('0x2e'),_0x23c2('0x2f'),util[_0x23c2('0x30')](_0x23c2('0x31'),_0x26e553['id'],_0x5c0507[_0x23c2('0x26')]));if(_0x27fc48['body'][_0x23c2('0x32')]&&_0x27fc48[_0x23c2('0xd')][_0x23c2('0x32')]!=_0x26e553[_0x23c2('0x29')][_0x23c2('0x32')]){return _0x39330e[_0x23c2('0x21')][_0x23c2('0x19')]({'threadId':_0x27fc48[_0x23c2('0xd')][_0x23c2('0x32')]},{'where':{'id':_0x26e553['Interaction']['id']}});}else{return;}})[_0x23c2('0x18')](function(){return _0x43cd21[_0x23c2('0x19')]({'read':!![]});})[_0x23c2('0x33')](function(_0x16af20){logger['error'](_0x23c2('0x2e'),'afterCreate',util[_0x23c2('0x34')](_0x16af20,{'showHidden':![],'depth':null}));_0x5a1744();});}else{_0x5a1744();}})[_0x23c2('0x35')](function(){_0x5a1744();});}else{_0x5a1744();}}},'charset':_0x23c2('0x36'),'collate':_0x23c2('0x37')});};
\ No newline at end of file
+var _0x8f35=['out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','body','threadId','Interaction','inspect','finally','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x1804e3,_0x187854){var _0x4cb8f7=function(_0x237771){while(--_0x237771){_0x1804e3['push'](_0x1804e3['shift']());}};_0x4cb8f7(++_0x187854);}(_0x8f35,0xcd));var _0x58f3=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x8f35[_0xaa1b3e];return _0x454d7d;};'use strict';var _=require(_0x58f3('0x0'));var util=require(_0x58f3('0x1'));var logger=require(_0x58f3('0x2'))(_0x58f3('0x3'));var moment=require(_0x58f3('0x4'));var BPromise=require(_0x58f3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58f3('0x6'));var rimraf=require(_0x58f3('0x7'));var config=require(_0x58f3('0x8'));var attributes=require(_0x58f3('0x9'));module[_0x58f3('0xa')]=function(_0x21fb36,_0x4bb60c){return _0x21fb36[_0x58f3('0xb')](_0x58f3('0xc'),attributes,{'tableName':_0x58f3('0xd'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x58f3('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ea9ea,_0x5cb4f1,_0x4c6bf9){var _0x13daa8=_0x21fb36[_0x58f3('0xf')];var _0x4cee48=_0x1ea9ea[_0x58f3('0x10')]({'plain':!![]});if(_0x4cee48[_0x58f3('0x11')]['toLowerCase']()==='in'||_0x4cee48[_0x58f3('0x11')][_0x58f3('0x12')]()===_0x58f3('0x13')&&!_0x4cee48[_0x58f3('0x14')]&&!_[_0x58f3('0x15')](_0x4cee48[_0x58f3('0x16')])){_0x13daa8['OpenchannelInteraction'][_0x58f3('0x17')]({'where':{'id':_0x4cee48[_0x58f3('0x18')]}})[_0x58f3('0x19')](function(_0x8b0e3b){if(_0x8b0e3b){_0x8b0e3b[_0x58f3('0x1a')]({'lastMsgAt':_0x4cee48[_0x58f3('0x1b')],'lastMsgDirection':_0x4cee48[_0x58f3('0x11')][_0x58f3('0x12')]()});}})[_0x58f3('0x1c')](function(_0x40f537){console[_0x58f3('0x1d')](_0x40f537);});}if(_0x4cee48[_0x58f3('0x11')]===_0x58f3('0x13')&&!_0x4cee48[_0x58f3('0x14')]){var _0x5669e8;_0x13daa8[_0x58f3('0x1e')][_0x58f3('0x1f')]()[_0x58f3('0x19')](function(_0x1200fb){return _0x13daa8[_0x58f3('0x20')]['find']({'where':{'id':_0x4cee48[_0x58f3('0x21')]},'include':[{'model':_0x13daa8[_0x58f3('0x22')],'as':_0x58f3('0x23'),'where':{'id':_0x4cee48[_0x58f3('0x18')]},'limit':0x1,'include':[{'model':_0x13daa8[_0x58f3('0x1e')],'as':_0x58f3('0x24'),'attributes':_[_0x58f3('0x25')](_0x1200fb)}]}]});})[_0x58f3('0x19')](function(_0x4e5a0a){_0x5669e8=_0x4e5a0a[_0x58f3('0x10')]({'plain':!![]});if(_0x5669e8&&_0x5669e8[_0x58f3('0x26')]){logger[_0x58f3('0x27')](_0x58f3('0x28'),_0x58f3('0x29'),util[_0x58f3('0x2a')](_0x58f3('0x2b'),_0x4cee48['id'],_0x5669e8[_0x58f3('0x26')]));if(_0x5669e8[_0x58f3('0x23')]&&_0x5669e8[_0x58f3('0x23')][_0x58f3('0x2c')]){_0x4cee48['Interaction']=_[_0x58f3('0x2d')](_0x5669e8[_0x58f3('0x23')][0x0],_0x58f3('0x24'));_0x4cee48[_0x58f3('0x24')]=_0x5669e8[_0x58f3('0x23')][0x0][_0x58f3('0x24')];}var _0x5cb4f1={'method':_0x58f3('0x2e'),'uri':encodeURI(_0x5669e8['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5cb4f1[_0x58f3('0x2f')]){case _0x58f3('0x30'):_0x5cb4f1['qs']=_0x4cee48;break;case _0x58f3('0x2e'):_0x5cb4f1['body']=_0x4cee48;break;}return rp(_0x5cb4f1)[_0x58f3('0x19')](function(_0x2901ff){logger['info'](_0x58f3('0x28'),_0x58f3('0x29'),util[_0x58f3('0x2a')](_0x58f3('0x31'),_0x4cee48['id'],_0x5669e8['replyUri']));if(_0x2901ff[_0x58f3('0x32')][_0x58f3('0x33')]&&_0x2901ff[_0x58f3('0x32')][_0x58f3('0x33')]!=_0x4cee48[_0x58f3('0x34')][_0x58f3('0x33')]){return _0x13daa8[_0x58f3('0x22')][_0x58f3('0x1a')]({'threadId':_0x2901ff[_0x58f3('0x32')][_0x58f3('0x33')]},{'where':{'id':_0x4cee48[_0x58f3('0x34')]['id']}});}else{return;}})[_0x58f3('0x19')](function(){return _0x1ea9ea['update']({'read':!![]});})[_0x58f3('0x1c')](function(_0xcfb390){logger[_0x58f3('0x1d')](_0x58f3('0x28'),_0x58f3('0x29'),util[_0x58f3('0x35')](_0xcfb390,{'showHidden':![],'depth':null}));_0x4c6bf9();});}else{_0x4c6bf9();}})[_0x58f3('0x36')](function(){_0x4c6bf9();});}else{_0x4c6bf9();}}},'charset':_0x58f3('0x37'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index f36689d..5016a54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x322098,_0x5bcfe3){var _0x578799=function(_0x18944c){while(--_0x18944c){_0x322098['push'](_0x322098['shift']());}};_0x578799(++_0x5bcfe3);}(_0x5f66,0x1a0));var _0x65f6=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x5f66[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x629007,_0x160165){var _0x127e16=function(_0x4abf0c){while(--_0x4abf0c){_0x629007['push'](_0x629007['shift']());}};_0x127e16(++_0x160165);}(_0x7a54,0x106));var _0x47a5=function(_0x562180,_0x4cd352){_0x562180=_0x562180-0x0;var _0x58bd63=_0x7a54[_0x562180];return _0x58bd63;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});};
\ No newline at end of file
index ec5cf33..5f56745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85d0=['emit','register','length','openchannelMessage:'];(function(_0x4903ce,_0x32ead6){var _0x3df6c3=function(_0x5b07c8){while(--_0x5b07c8){_0x4903ce['push'](_0x4903ce['shift']());}};_0x3df6c3(++_0x32ead6);}(_0x85d0,0x164));var _0x085d=function(_0x1dbc7f,_0x57b29c){_0x1dbc7f=_0x1dbc7f-0x0;var _0x1df731=_0x85d0[_0x1dbc7f];return _0x1df731;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save','remove','update'];function createListener(_0x297001,_0x1716e5){return function(_0xfd8773){_0x1716e5[_0x085d('0x0')](_0x297001,_0xfd8773);};}function removeListener(_0x231765,_0x19ae4c){return function(){OpenchannelMessageEvents['removeListener'](_0x231765,_0x19ae4c);};}exports[_0x085d('0x1')]=function(_0x5c917f){for(var _0x364f09=0x0,_0x9acc97=events[_0x085d('0x2')];_0x364f09<_0x9acc97;_0x364f09++){var _0x4a12b7=events[_0x364f09];var _0xf65d01=createListener(_0x085d('0x3')+_0x4a12b7,_0x5c917f);OpenchannelMessageEvents['on'](_0x4a12b7,_0xf65d01);}};
\ No newline at end of file
+var _0x081c=['length','./openchannelMessage.events','register'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0x081c,0xeb));var _0xc081=function(_0xfd2dd2,_0x41e8d6){_0xfd2dd2=_0xfd2dd2-0x0;var _0x3f28f1=_0x081c[_0xfd2dd2];return _0x3f28f1;};'use strict';var OpenchannelMessageEvents=require(_0xc081('0x0'));var events=['save','remove','update'];function createListener(_0x57e9f1,_0x2897c8){return function(_0x39e8db){_0x2897c8['emit'](_0x57e9f1,_0x39e8db);};}function removeListener(_0x20310e,_0x5d0d77){return function(){OpenchannelMessageEvents['removeListener'](_0x20310e,_0x5d0d77);};}exports[_0xc081('0x1')]=function(_0x2b8dee){for(var _0xfe9282=0x0,_0x5ab694=events[_0xc081('0x2')];_0xfe9282<_0x5ab694;_0xfe9282++){var _0x486f61=events[_0xfe9282];var _0x227dc4=createListener('openchannelMessage:'+_0x486f61,_0x2b8dee);OpenchannelMessageEvents['on'](_0x486f61,_0x227dc4);}};
\ No newline at end of file
index 121ea13..4db9354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8592=['destroy','delete','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','getAgents','create','post','addTeams','/:id/users','put','update'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8592,0x197));var _0x2859=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0x8592[_0x4de9e8];return _0x4db0de;};'use strict';var multer=require(_0x2859('0x0'));var util=require(_0x2859('0x1'));var path=require(_0x2859('0x2'));var timeout=require(_0x2859('0x3'));var express=require(_0x2859('0x4'));var router=express[_0x2859('0x5')]();var fs_extra=require(_0x2859('0x6'));var auth=require(_0x2859('0x7'));var interaction=require(_0x2859('0x8'));var config=require(_0x2859('0x9'));var controller=require(_0x2859('0xa'));router[_0x2859('0xb')]('/',auth['isAuthenticated'](),controller[_0x2859('0xc')]);router[_0x2859('0xb')](_0x2859('0xd'),auth[_0x2859('0xe')](),controller[_0x2859('0xf')]);router[_0x2859('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2859('0x10')]);router[_0x2859('0xb')](_0x2859('0x11'),auth['isAuthenticated'](),controller['getMembers']);router[_0x2859('0xb')](_0x2859('0x12'),auth[_0x2859('0xe')](),controller[_0x2859('0x13')]);router[_0x2859('0xb')]('/:id/users',auth[_0x2859('0xe')](),controller[_0x2859('0x14')]);router['post']('/',auth[_0x2859('0xe')](),controller[_0x2859('0x15')]);router[_0x2859('0x16')](_0x2859('0x12'),auth[_0x2859('0xe')](),controller[_0x2859('0x17')]);router[_0x2859('0x16')](_0x2859('0x18'),auth['isAuthenticated'](),controller['addAgents']);router[_0x2859('0x19')]('/:id',auth[_0x2859('0xe')](),controller[_0x2859('0x1a')]);router['delete']('/:id',auth[_0x2859('0xe')](),controller[_0x2859('0x1b')]);router[_0x2859('0x1c')](_0x2859('0x12'),auth[_0x2859('0xe')](),controller[_0x2859('0x1d')]);router['delete'](_0x2859('0x18'),auth[_0x2859('0xe')](),controller['removeAgents']);module[_0x2859('0x1e')]=router;
\ No newline at end of file
+var _0x9541=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','/:id','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9541,0x76));var _0x1954=function(_0x1e0bda,_0x4a592d){_0x1e0bda=_0x1e0bda-0x0;var _0x1fe0af=_0x9541[_0x1e0bda];return _0x1fe0af;};'use strict';var multer=require(_0x1954('0x0'));var util=require(_0x1954('0x1'));var path=require(_0x1954('0x2'));var timeout=require(_0x1954('0x3'));var express=require(_0x1954('0x4'));var router=express['Router']();var fs_extra=require(_0x1954('0x5'));var auth=require(_0x1954('0x6'));var interaction=require(_0x1954('0x7'));var config=require(_0x1954('0x8'));var controller=require(_0x1954('0x9'));router[_0x1954('0xa')]('/',auth[_0x1954('0xb')](),controller['index']);router[_0x1954('0xa')](_0x1954('0xc'),auth[_0x1954('0xb')](),controller['describe']);router[_0x1954('0xa')]('/:id',auth[_0x1954('0xb')](),controller[_0x1954('0xd')]);router[_0x1954('0xa')](_0x1954('0xe'),auth[_0x1954('0xb')](),controller[_0x1954('0xf')]);router[_0x1954('0xa')](_0x1954('0x10'),auth['isAuthenticated'](),controller[_0x1954('0x11')]);router['get'](_0x1954('0x12'),auth['isAuthenticated'](),controller[_0x1954('0x13')]);router[_0x1954('0x14')]('/',auth[_0x1954('0xb')](),controller[_0x1954('0x15')]);router[_0x1954('0x14')]('/:id/teams',auth[_0x1954('0xb')](),controller[_0x1954('0x16')]);router[_0x1954('0x14')]('/:id/users',auth['isAuthenticated'](),controller[_0x1954('0x17')]);router[_0x1954('0x18')]('/:id',auth[_0x1954('0xb')](),controller['update']);router[_0x1954('0x19')](_0x1954('0x1a'),auth['isAuthenticated'](),controller[_0x1954('0x1b')]);router[_0x1954('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x1954('0x1c')]);router[_0x1954('0x19')]('/:id/users',auth[_0x1954('0xb')](),controller[_0x1954('0x1d')]);module[_0x1954('0x1e')]=router;
\ No newline at end of file
index aed5d0c..757ec00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5000=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x26f518,_0x5a6c2d){var _0x3666d=function(_0x38ef7f){while(--_0x38ef7f){_0x26f518['push'](_0x26f518['shift']());}};_0x3666d(++_0x5a6c2d);}(_0x5000,0x110));var _0x0500=function(_0x3b9d25,_0x3d9c64){_0x3b9d25=_0x3b9d25-0x0;var _0x38a18e=_0x5000[_0x3b9d25];return _0x38a18e;};'use strict';var Sequelize=require(_0x0500('0x0'));module['exports']={'name':{'type':Sequelize[_0x0500('0x1')],'unique':_0x0500('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0500('0x1')]},'timeout':{'type':Sequelize[_0x0500('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0500('0x4')](_0x0500('0x5'),_0x0500('0x6'),_0x0500('0x7'))}};
\ No newline at end of file
+var _0x2f5b=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER'];(function(_0x3f56af,_0x2fb687){var _0x21ef73=function(_0x5203e3){while(--_0x5203e3){_0x3f56af['push'](_0x3f56af['shift']());}};_0x21ef73(++_0x2fb687);}(_0x2f5b,0xf0));var _0xb2f5=function(_0x59d73d,_0x3e2092){_0x59d73d=_0x59d73d-0x0;var _0x39a5c1=_0x2f5b[_0x59d73d];return _0x39a5c1;};'use strict';var Sequelize=require(_0xb2f5('0x0'));module[_0xb2f5('0x1')]={'name':{'type':Sequelize[_0xb2f5('0x2')],'unique':_0xb2f5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xb2f5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xb2f5('0x5'),_0xb2f5('0x6'),'roundrobin')}};
\ No newline at end of file
index 5608f83..46e7153 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc171=['Content-Range','apply','reject','save','update','get','OpenchannelQueues','UserProfileResource','destroy','then','end','error','stack','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','format','SIP','createdAt','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','userOpenchannelQueue:save','select','field','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','QueryTypes','every','TeamId','includes','all','union','compact','transaction','removeTeams','isEmpty','emit','userOpenchannelQueue:remove','addAgents','spread','removeAgents','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x39548c,_0x411161){var _0x2571bd=function(_0x5b4d2a){while(--_0x5b4d2a){_0x39548c['push'](_0x39548c['shift']());}};_0x2571bd(++_0x411161);}(_0xc171,0x68));var _0x1c17=function(_0xe8fa1f,_0x12bba1){_0xe8fa1f=_0xe8fa1f-0x0;var _0x4b3a65=_0xc171[_0xe8fa1f];return _0x4b3a65;};'use strict';var emlformat=require(_0x1c17('0x0'));var rimraf=require(_0x1c17('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c17('0x2'));var rp=require(_0x1c17('0x3'));var moment=require(_0x1c17('0x4'));var BPromise=require(_0x1c17('0x5'));var Mustache=require(_0x1c17('0x6'));var util=require(_0x1c17('0x7'));var path=require('path');var sox=require(_0x1c17('0x8'));var csv=require(_0x1c17('0x9'));var ejs=require(_0x1c17('0xa'));var fs=require('fs');var fs_extra=require(_0x1c17('0xb'));var _=require(_0x1c17('0xc'));var squel=require(_0x1c17('0xd'));var crypto=require(_0x1c17('0xe'));var jsforce=require(_0x1c17('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1c17('0x10'));var Papa=require(_0x1c17('0x11'));var Redis=require(_0x1c17('0x12'));var authService=require(_0x1c17('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1c17('0x14'));var hardwareService=require(_0x1c17('0x15'));var logger=require(_0x1c17('0x16'))(_0x1c17('0x17'));var utils=require(_0x1c17('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1c17('0x19'))['db'];config['redis']=_['defaults'](config[_0x1c17('0x1a')],{'host':_0x1c17('0x1b'),'port':0x18eb});var socket=require(_0x1c17('0x1c'))(new Redis(config[_0x1c17('0x1a')]));require(_0x1c17('0x1d'))['register'](socket);function respondWithStatusCode(_0x1d8a4d,_0x310e43){_0x310e43=_0x310e43||0xcc;return function(_0xf3215d){if(_0xf3215d){return _0x1d8a4d[_0x1c17('0x1e')](_0x310e43);}return _0x1d8a4d[_0x1c17('0x1f')](_0x310e43)['end']();};}function respondWithResult(_0x4fabce,_0x5af1ef){_0x5af1ef=_0x5af1ef||0xc8;return function(_0x3253f4){if(_0x3253f4){return _0x4fabce['status'](_0x5af1ef)[_0x1c17('0x20')](_0x3253f4);}};}function respondWithFilteredResult(_0x46b2be,_0x4f38ba){return function(_0x261048){if(_0x261048){var _0x3a3884=typeof _0x4f38ba[_0x1c17('0x21')]===_0x1c17('0x22')&&typeof _0x4f38ba[_0x1c17('0x23')]===_0x1c17('0x22');var _0x1152e8=_0x261048[_0x1c17('0x24')];var _0x10e602=_0x3a3884?0x0:_0x4f38ba[_0x1c17('0x21')];var _0x35e998=_0x3a3884?_0x261048[_0x1c17('0x24')]:_0x4f38ba[_0x1c17('0x21')]+_0x4f38ba[_0x1c17('0x23')];var _0x4fb2da;if(_0x35e998>=_0x1152e8){_0x35e998=_0x1152e8;_0x4fb2da=0xc8;}else{_0x4fb2da=0xce;}_0x46b2be['status'](_0x4fb2da);return _0x46b2be[_0x1c17('0x25')](_0x1c17('0x26'),_0x10e602+'-'+_0x35e998+'/'+_0x1152e8)[_0x1c17('0x20')](_0x261048);}return null;};}function patchUpdates(_0x1b11bf){return function(_0x1e445f){try{jsonpatch[_0x1c17('0x27')](_0x1e445f,_0x1b11bf,!![]);}catch(_0x12b73f){return BPromise[_0x1c17('0x28')](_0x12b73f);}return _0x1e445f[_0x1c17('0x29')]();};}function saveUpdates(_0x38755b,_0x3ae195){return function(_0xcd7f83){if(_0xcd7f83){return _0xcd7f83[_0x1c17('0x2a')](_0x38755b)['then'](function(_0x4274d9){return _0x4274d9;});}return null;};}function removeEntity(_0x1c4791,_0x3f7fd1){return function(_0x4b7852){if(_0x4b7852){return _0x4b7852['destroy']()['then'](function(){var _0x13d154=_0x4b7852[_0x1c17('0x2b')]({'plain':!![]});var _0x4104ae=_0x1c17('0x2c');return db[_0x1c17('0x2d')][_0x1c17('0x2e')]({'where':{'type':_0x4104ae,'resourceId':_0x13d154['id']}})[_0x1c17('0x2f')](function(){return _0x4b7852;});})[_0x1c17('0x2f')](function(){_0x1c4791[_0x1c17('0x1f')](0xcc)[_0x1c17('0x30')]();});}};}function handleEntityNotFound(_0xf96d88,_0x5752d5){return function(_0x378a93){if(!_0x378a93){_0xf96d88['sendStatus'](0x194);}return _0x378a93;};}function handleError(_0x4d3744,_0x4a071b){_0x4a071b=_0x4a071b||0x1f4;return function(_0xeed3bf){logger[_0x1c17('0x31')](_0xeed3bf[_0x1c17('0x32')]);if(_0xeed3bf[_0x1c17('0x33')]){delete _0xeed3bf[_0x1c17('0x33')];}_0x4d3744['status'](_0x4a071b)['send'](_0xeed3bf);};}exports[_0x1c17('0x34')]=function(_0x4dd780,_0x336684){var _0x1a3958={},_0x2e59eb={},_0xd1cb58={'count':0x0,'rows':[]};var _0x378ae7=_[_0x1c17('0x35')](db[_0x1c17('0x36')][_0x1c17('0x37')],function(_0x21eb2b){return{'name':_0x21eb2b[_0x1c17('0x38')],'type':_0x21eb2b[_0x1c17('0x39')][_0x1c17('0x3a')]};});_0x2e59eb['model']=_['map'](_0x378ae7,_0x1c17('0x33'));_0x2e59eb[_0x1c17('0x3b')]=_[_0x1c17('0x3c')](_0x4dd780[_0x1c17('0x3b')]);_0x2e59eb[_0x1c17('0x3d')]=_[_0x1c17('0x3e')](_0x2e59eb[_0x1c17('0x3f')],_0x2e59eb[_0x1c17('0x3b')]);_0x1a3958[_0x1c17('0x40')]=_[_0x1c17('0x3e')](_0x2e59eb[_0x1c17('0x3f')],qs[_0x1c17('0x41')](_0x4dd780[_0x1c17('0x3b')][_0x1c17('0x41')]));_0x1a3958['attributes']=_0x1a3958[_0x1c17('0x40')][_0x1c17('0x42')]?_0x1a3958[_0x1c17('0x40')]:_0x2e59eb[_0x1c17('0x3f')];if(!_0x4dd780['query'][_0x1c17('0x43')](_0x1c17('0x44'))){_0x1a3958[_0x1c17('0x23')]=qs[_0x1c17('0x23')](_0x4dd780[_0x1c17('0x3b')]['limit']);_0x1a3958[_0x1c17('0x21')]=qs[_0x1c17('0x21')](_0x4dd780['query'][_0x1c17('0x21')]);}_0x1a3958[_0x1c17('0x45')]=qs[_0x1c17('0x46')](_0x4dd780[_0x1c17('0x3b')][_0x1c17('0x46')]);_0x1a3958[_0x1c17('0x47')]=qs[_0x1c17('0x3d')](_[_0x1c17('0x48')](_0x4dd780[_0x1c17('0x3b')],_0x2e59eb[_0x1c17('0x3d')]),_0x378ae7);if(_0x4dd780[_0x1c17('0x3b')][_0x1c17('0x49')]){_0x1a3958[_0x1c17('0x47')]=_['merge'](_0x1a3958[_0x1c17('0x47')],{'$or':_[_0x1c17('0x35')](_0x378ae7,function(_0x23c346){if(_0x23c346[_0x1c17('0x39')]!==_0x1c17('0x4a')){var _0x4487e4={};_0x4487e4[_0x23c346[_0x1c17('0x33')]]={'$like':'%'+_0x4dd780[_0x1c17('0x3b')][_0x1c17('0x49')]+'%'};return _0x4487e4;}})});}_0x1a3958=_['merge']({},_0x1a3958,_0x4dd780[_0x1c17('0x4b')]);var _0x5a5f62={'where':_0x1a3958[_0x1c17('0x47')]};return db[_0x1c17('0x36')][_0x1c17('0x24')](_0x5a5f62)[_0x1c17('0x2f')](function(_0x1b987e){_0xd1cb58[_0x1c17('0x24')]=_0x1b987e;if(_0x4dd780['query'][_0x1c17('0x4c')]){_0x1a3958[_0x1c17('0x4d')]=[{'all':!![]}];}return db[_0x1c17('0x36')][_0x1c17('0x4e')](_0x1a3958);})[_0x1c17('0x2f')](function(_0x3559e6){_0xd1cb58[_0x1c17('0x4f')]=_0x3559e6;return _0xd1cb58;})[_0x1c17('0x2f')](respondWithFilteredResult(_0x336684,_0x1a3958))[_0x1c17('0x50')](handleError(_0x336684,null));};exports[_0x1c17('0x51')]=function(_0x3121fb,_0x2dabdf){var _0x3f5670={'raw':!![],'where':{'id':_0x3121fb[_0x1c17('0x52')]['id']}},_0x1489fe={};_0x1489fe[_0x1c17('0x3f')]=_[_0x1c17('0x3c')](db[_0x1c17('0x36')][_0x1c17('0x37')]);_0x1489fe[_0x1c17('0x3b')]=_['keys'](_0x3121fb[_0x1c17('0x3b')]);_0x1489fe[_0x1c17('0x3d')]=_[_0x1c17('0x3e')](_0x1489fe[_0x1c17('0x3f')],_0x1489fe['query']);_0x3f5670[_0x1c17('0x40')]=_[_0x1c17('0x3e')](_0x1489fe[_0x1c17('0x3f')],qs[_0x1c17('0x41')](_0x3121fb[_0x1c17('0x3b')][_0x1c17('0x41')]));_0x3f5670[_0x1c17('0x40')]=_0x3f5670[_0x1c17('0x40')][_0x1c17('0x42')]?_0x3f5670[_0x1c17('0x40')]:_0x1489fe[_0x1c17('0x3f')];if(_0x3121fb[_0x1c17('0x3b')]['includeAll']){_0x3f5670['include']=[{'all':!![]}];}_0x3f5670=_[_0x1c17('0x53')]({},_0x3f5670,_0x3121fb[_0x1c17('0x4b')]);return db[_0x1c17('0x36')]['find'](_0x3f5670)[_0x1c17('0x2f')](handleEntityNotFound(_0x2dabdf,null))[_0x1c17('0x2f')](respondWithResult(_0x2dabdf,null))[_0x1c17('0x50')](handleError(_0x2dabdf,null));};exports[_0x1c17('0x54')]=function(_0x43311c,_0x54fc46){return db['OpenchannelQueue'][_0x1c17('0x54')](_0x43311c[_0x1c17('0x55')],{})[_0x1c17('0x2f')](function(_0x44b21f){var _0x3f64ac=_0x43311c['user']['get']({'plain':!![]});if(!_0x3f64ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f64ac['role']==='user'){var _0x577499=_0x44b21f[_0x1c17('0x2b')]({'plain':!![]});var _0x2dede8=_0x1c17('0x2c');return db[_0x1c17('0x56')]['find']({'where':{'name':_0x2dede8,'userProfileId':_0x3f64ac[_0x1c17('0x57')]},'raw':!![]})['then'](function(_0x31f4c0){if(_0x31f4c0&&_0x31f4c0['autoAssociation']===0x0){return db[_0x1c17('0x2d')][_0x1c17('0x54')]({'name':_0x577499[_0x1c17('0x33')],'resourceId':_0x577499['id'],'type':_0x31f4c0[_0x1c17('0x33')],'sectionId':_0x31f4c0['id']},{})[_0x1c17('0x2f')](function(){return _0x44b21f;});}else{return _0x44b21f;}})['catch'](function(_0xb087a3){logger[_0x1c17('0x31')](_0x1c17('0x58'),_0xb087a3);throw _0xb087a3;});}return _0x44b21f;})[_0x1c17('0x2f')](respondWithResult(_0x54fc46,0xc9))[_0x1c17('0x50')](handleError(_0x54fc46,null));};exports[_0x1c17('0x2a')]=function(_0x21b0c9,_0x556a7a){if(_0x21b0c9[_0x1c17('0x55')]['id']){delete _0x21b0c9[_0x1c17('0x55')]['id'];}return db[_0x1c17('0x36')][_0x1c17('0x59')]({'where':{'id':_0x21b0c9[_0x1c17('0x52')]['id']}})[_0x1c17('0x2f')](handleEntityNotFound(_0x556a7a,null))[_0x1c17('0x2f')](saveUpdates(_0x21b0c9[_0x1c17('0x55')],null))[_0x1c17('0x2f')](respondWithResult(_0x556a7a,null))[_0x1c17('0x50')](handleError(_0x556a7a,null));};exports['destroy']=function(_0x1e99b9,_0x3e937f){return db[_0x1c17('0x36')][_0x1c17('0x59')]({'where':{'id':_0x1e99b9[_0x1c17('0x52')]['id']}})[_0x1c17('0x2f')](handleEntityNotFound(_0x3e937f,null))['then'](removeEntity(_0x3e937f,null))[_0x1c17('0x50')](handleError(_0x3e937f,null));};exports[_0x1c17('0x5a')]=function(_0x3b26f0,_0x289e41){return db[_0x1c17('0x36')][_0x1c17('0x5a')]()['then'](respondWithResult(_0x289e41,null))['catch'](handleError(_0x289e41,null));};exports[_0x1c17('0x5b')]=function(_0xe97349,_0x3a375e,_0x28d87e){var _0x30c339={'raw':!![],'where':{}},_0x4fd986={},_0x49abf6;return db[_0x1c17('0x36')][_0x1c17('0x5c')]({'where':{'id':_0xe97349[_0x1c17('0x52')]['id']}})['then'](handleEntityNotFound(_0x3a375e,null))[_0x1c17('0x2f')](function(_0x278335){if(_0x278335){_0x49abf6=_0x278335[_0x1c17('0x2b')]({'plain':!![]});_0x4fd986['model']=_[_0x1c17('0x3c')](db[_0x1c17('0x5d')][_0x1c17('0x37')]);_0x4fd986[_0x1c17('0x3b')]=_[_0x1c17('0x3c')](_0xe97349['query']);_0x4fd986[_0x1c17('0x3d')]=_[_0x1c17('0x3e')](_0x4fd986['model'],_0x4fd986['query']);_0x30c339[_0x1c17('0x40')]=_[_0x1c17('0x3e')](_0x4fd986['model'],qs['fields'](_0xe97349[_0x1c17('0x3b')][_0x1c17('0x41')]));_0x30c339[_0x1c17('0x40')]=_0x30c339[_0x1c17('0x40')][_0x1c17('0x42')]?_0x30c339[_0x1c17('0x40')]:_0x4fd986['model'];if(!_0xe97349['query'][_0x1c17('0x43')](_0x1c17('0x44'))){_0x30c339[_0x1c17('0x23')]=qs[_0x1c17('0x23')](_0xe97349['query'][_0x1c17('0x23')]);_0x30c339[_0x1c17('0x21')]=qs[_0x1c17('0x21')](_0xe97349['query'][_0x1c17('0x21')]);}_0x30c339['order']=qs[_0x1c17('0x46')](_0xe97349[_0x1c17('0x3b')][_0x1c17('0x46')]);_0x30c339[_0x1c17('0x47')]=qs[_0x1c17('0x3d')](_[_0x1c17('0x48')](_0xe97349[_0x1c17('0x3b')],_0x4fd986[_0x1c17('0x3d')]));_0x30c339[_0x1c17('0x47')][_0x1c17('0x5e')]=_0x278335['id'];if(_0xe97349[_0x1c17('0x3b')][_0x1c17('0x49')]){_0x30c339['where']=_[_0x1c17('0x53')](_0x30c339[_0x1c17('0x47')],{'$or':_[_0x1c17('0x35')](_0x30c339[_0x1c17('0x40')],function(_0x37b3a7){var _0x200f1c={};_0x200f1c[_0x37b3a7]={'$like':'%'+_0xe97349['query'][_0x1c17('0x49')]+'%'};return _0x200f1c;})});}_0x30c339=_[_0x1c17('0x53')]({},_0x30c339,_0xe97349[_0x1c17('0x4b')]);return db[_0x1c17('0x5d')][_0x1c17('0x4e')](_0x30c339);}})[_0x1c17('0x2f')](function(_0x404dbd){if(_0x404dbd){return db[_0x1c17('0x5f')][_0x1c17('0x60')]({'where':{'id':_[_0x1c17('0x35')](_0x404dbd,_0x1c17('0x61')),'role':_0x1c17('0x62')},'attributes':['id',_0x1c17('0x33'),_0x1c17('0x63'),'updatedAt','createdAt']});}})['then'](function(_0x31883c){if(_0x31883c){return{'count':_0x31883c['count'],'rows':_['map'](_0x31883c[_0x1c17('0x4f')],function(_0x22a491){return{'membername':_0x22a491[_0x1c17('0x33')],'UserId':_0x22a491['id'],'queue_name':_0x49abf6['name'],'OpenchannelQueueId':_0x49abf6['id'],'interface':util[_0x1c17('0x64')]('%s/%s',_0x1c17('0x65'),_0x22a491[_0x1c17('0x33')]),'penalty':0x0,'paused':_0x22a491[_0x1c17('0x63')],'createdAt':_0x22a491[_0x1c17('0x66')],'updatedAt':_0x22a491['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3a375e,_0x30c339))['catch'](handleError(_0x3a375e,null));};exports['getTeams']=function(_0x2a22c0,_0x2b85c2,_0x59448f){var _0x3e4632={};var _0x8ce4f0={};var _0x4182f9;var _0x51f811;return db['OpenchannelQueue'][_0x1c17('0x5c')]({'where':{'id':_0x2a22c0['params']['id']}})[_0x1c17('0x2f')](handleEntityNotFound(_0x2b85c2,null))['then'](function(_0x5aa160){if(_0x5aa160){_0x4182f9=_0x5aa160;_0x8ce4f0[_0x1c17('0x3f')]=_['keys'](db[_0x1c17('0x67')][_0x1c17('0x37')]);_0x8ce4f0[_0x1c17('0x3b')]=_[_0x1c17('0x3c')](_0x2a22c0[_0x1c17('0x3b')]);_0x8ce4f0[_0x1c17('0x3d')]=_[_0x1c17('0x3e')](_0x8ce4f0[_0x1c17('0x3f')],_0x8ce4f0[_0x1c17('0x3b')]);_0x3e4632[_0x1c17('0x40')]=_[_0x1c17('0x3e')](_0x8ce4f0[_0x1c17('0x3f')],qs[_0x1c17('0x41')](_0x2a22c0['query'][_0x1c17('0x41')]));_0x3e4632[_0x1c17('0x40')]=_0x3e4632['attributes'][_0x1c17('0x42')]?_0x3e4632['attributes']:_0x8ce4f0['model'];_0x3e4632[_0x1c17('0x45')]=qs[_0x1c17('0x46')](_0x2a22c0[_0x1c17('0x3b')]['sort']);_0x3e4632[_0x1c17('0x47')]=qs[_0x1c17('0x3d')](_['pick'](_0x2a22c0['query'],_0x8ce4f0['filters']));if(_0x2a22c0[_0x1c17('0x3b')][_0x1c17('0x49')]){_0x3e4632['where']=_[_0x1c17('0x53')](_0x3e4632[_0x1c17('0x47')],{'$or':_[_0x1c17('0x35')](_0x3e4632[_0x1c17('0x40')],function(_0x545604){var _0xe1dde7={};_0xe1dde7[_0x545604]={'$like':'%'+_0x2a22c0[_0x1c17('0x3b')][_0x1c17('0x49')]+'%'};return _0xe1dde7;})});}_0x3e4632=_[_0x1c17('0x53')]({},_0x3e4632,_0x2a22c0[_0x1c17('0x4b')]);return _0x4182f9[_0x1c17('0x68')](_0x3e4632);}})['then'](function(_0x535578){if(_0x535578){_0x51f811=_0x535578['length'];if(!_0x2a22c0[_0x1c17('0x3b')]['hasOwnProperty'](_0x1c17('0x44'))){_0x3e4632[_0x1c17('0x23')]=qs['limit'](_0x2a22c0[_0x1c17('0x3b')][_0x1c17('0x23')]);_0x3e4632[_0x1c17('0x21')]=qs[_0x1c17('0x21')](_0x2a22c0[_0x1c17('0x3b')][_0x1c17('0x21')]);}return _0x4182f9[_0x1c17('0x68')](_0x3e4632);}})[_0x1c17('0x2f')](function(_0xa5b75a){if(_0xa5b75a){return _0xa5b75a?{'count':_0x51f811,'rows':_0xa5b75a}:null;}})[_0x1c17('0x2f')](respondWithResult(_0x2b85c2,null))[_0x1c17('0x50')](handleError(_0x2b85c2,null));};exports[_0x1c17('0x69')]=function(_0x3f3491,_0x446256,_0x301a24){var _0xec6c1f=_0x3f3491[_0x1c17('0x55')][_0x1c17('0x6a')];return db[_0x1c17('0x67')][_0x1c17('0x4e')]({'where':{'id':_0xec6c1f},'attributes':['id'],'include':[{'model':db[_0x1c17('0x5f')],'as':_0x1c17('0x6b'),'attributes':['id',_0x1c17('0x33'),_0x1c17('0x6c'),_0x1c17('0x6d'),_0x1c17('0x6e')],'raw':!![]}]})[_0x1c17('0x2f')](function(_0x129e21){if(_0x129e21){var _0xa15760=_[_0x1c17('0x6f')](_0x129e21,function(_0x15b08c){var _0x95846f=_0x15b08c[_0x1c17('0x2b')]({'plain':!![]});return _0x95846f['Agents'];});return db[_0x1c17('0x36')][_0x1c17('0x59')]({'where':{'id':_0x3f3491['params']['id']}})[_0x1c17('0x2f')](function(_0x400c97){return db[_0x1c17('0x70')]['transaction'](function(_0x460d4d){return _0x400c97['addTeams'](_0xec6c1f,{'transaction':_0x460d4d})[_0x1c17('0x2f')](function(){return BPromise[_0x1c17('0x71')](_0xa15760,function(_0x34f443){return db[_0x1c17('0x5d')][_0x1c17('0x72')]({'where':{'UserId':_0x34f443['id'],'OpenchannelQueueId':_0x3f3491[_0x1c17('0x52')]['id']},'transaction':_0x460d4d});});})[_0x1c17('0x2f')](function(){_0xa15760[_0x1c17('0x73')](function(_0x4626e2){socket['emit'](_0x1c17('0x74'),{'UserId':_0x4626e2['id'],'OpenchannelQueueId':_0x400c97['id']});});});});});}})[_0x1c17('0x2f')](respondWithStatusCode(_0x446256,null))['catch'](handleError(_0x446256,null));};exports['removeTeams']=function(_0x56db61,_0x2b024d,_0x353713){return db[_0x1c17('0x67')][_0x1c17('0x4e')]({'where':{'id':_0x56db61[_0x1c17('0x3b')][_0x1c17('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1c17('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x1c17('0x2f')](handleEntityNotFound(_0x2b024d,null))['then'](function(_0x203a5f){var _0x2bf34f=_['map'](_0x203a5f,'id');var _0x5dff64=[];var _0xfe3ab5=[];var _0x4029ba=squel[_0x1c17('0x75')]();_0x4029ba[_0x1c17('0x76')]('tq.TeamId')[_0x1c17('0x77')](_0x1c17('0x78'),'tq')[_0x1c17('0x79')](_0x1c17('0x7a'),'ut',_0x1c17('0x7b'))[_0x1c17('0x47')]('OpenchannelQueueId\x20=\x20?',_0x56db61[_0x1c17('0x52')]['id']);for(var _0x525001=0x0;_0x525001<_0x203a5f['length'];_0x525001+=0x1){let _0x3725ed=_0x203a5f[_0x525001];for(var _0x5ac111=0x0;_0x5ac111<_0x3725ed[_0x1c17('0x6b')][_0x1c17('0x42')];_0x5ac111+=0x1){let _0x46723e=_0x3725ed['Agents'][_0x5ac111];var _0x41f655=_0x4029ba[_0x1c17('0x7c')]();_0x41f655[_0x1c17('0x47')]('ut.UserId\x20=\x20?',_0x46723e['id']);_0xfe3ab5[_0x1c17('0x7d')](db[_0x1c17('0x70')][_0x1c17('0x3b')](_0x41f655['toString'](),{'type':db[_0x1c17('0x70')][_0x1c17('0x7e')]['SELECT']})[_0x1c17('0x2f')](function(_0x5ca801){if(_0x5ca801[_0x1c17('0x42')]===0x1){return _0x46723e['id'];}else{var _0x1df336=_[_0x1c17('0x7f')](_[_0x1c17('0x35')](_0x5ca801,_0x1c17('0x80')),function(_0x19f7a1){return _[_0x1c17('0x81')](_0x2bf34f,_0x19f7a1);});if(_0x1df336){return _0x46723e['id'];}}}));}}return BPromise[_0x1c17('0x82')](_0xfe3ab5)[_0x1c17('0x2f')](function(_0x1549d8){_0x5dff64=_(_0x5dff64)[_0x1c17('0x83')](_0x1549d8)[_0x1c17('0x84')]()['value']();return db['OpenchannelQueue'][_0x1c17('0x59')]({'where':{'id':_0x56db61[_0x1c17('0x52')]['id']}})[_0x1c17('0x2f')](function(_0x14185e){return db['sequelize'][_0x1c17('0x85')](function(_0x26e2a8){return _0x14185e[_0x1c17('0x86')](_0x56db61[_0x1c17('0x3b')][_0x1c17('0x6a')],{'transaction':_0x26e2a8})[_0x1c17('0x2f')](function(){if(!_[_0x1c17('0x87')](_0x5dff64)){return _0x14185e['removeAgents'](_0x5dff64,{'transaction':_0x26e2a8});}})[_0x1c17('0x2f')](function(){_0x5dff64[_0x1c17('0x73')](function(_0xbdca6e){socket[_0x1c17('0x88')](_0x1c17('0x89'),{'UserId':_0xbdca6e,'OpenchannelQueueId':_0x14185e['id']});});});});});});})['then'](respondWithStatusCode(_0x2b024d,null))['catch'](handleError(_0x2b024d,null));};exports[_0x1c17('0x8a')]=function(_0x5625b5,_0x52b096,_0x36b078){return db[_0x1c17('0x36')]['find']({'where':{'id':_0x5625b5['params']['id']}})['then'](handleEntityNotFound(_0x52b096,null))[_0x1c17('0x2f')](function(_0x20d1f8){if(_0x20d1f8){return _0x20d1f8['addAgents'](_0x5625b5[_0x1c17('0x55')][_0x1c17('0x6a')],_['omit'](_0x5625b5[_0x1c17('0x55')],[_0x1c17('0x6a'),'id'])||{})[_0x1c17('0x8b')](function(_0x48e556){for(var _0x1a2514=0x0;_0x1a2514<_0x5625b5[_0x1c17('0x55')]['ids'][_0x1c17('0x42')];_0x1a2514+=0x1){socket[_0x1c17('0x88')](_0x1c17('0x74'),{'UserId':Number(_0x5625b5['body']['ids'][_0x1a2514]),'OpenchannelQueueId':Number(_0x5625b5[_0x1c17('0x52')]['id'])});}return _0x48e556;});}})[_0x1c17('0x2f')](respondWithResult(_0x52b096,null))[_0x1c17('0x50')](handleError(_0x52b096,null));};exports[_0x1c17('0x8c')]=function(_0x2f7831,_0x2ea13c,_0x3e8087){return db[_0x1c17('0x36')][_0x1c17('0x59')]({'where':{'id':_0x2f7831[_0x1c17('0x52')]['id']}})[_0x1c17('0x2f')](handleEntityNotFound(_0x2ea13c,null))['then'](function(_0x1a6704){if(_0x1a6704){return _0x1a6704[_0x1c17('0x8c')](_0x2f7831['query'][_0x1c17('0x6a')])[_0x1c17('0x2f')](function(){if(_['isArray'](_0x2f7831[_0x1c17('0x3b')][_0x1c17('0x6a')])){for(var _0x594be3=0x0;_0x594be3<_0x2f7831[_0x1c17('0x3b')][_0x1c17('0x6a')][_0x1c17('0x42')];_0x594be3+=0x1){socket[_0x1c17('0x88')](_0x1c17('0x89'),{'UserId':Number(_0x2f7831[_0x1c17('0x3b')][_0x1c17('0x6a')][_0x594be3]),'OpenchannelQueueId':Number(_0x2f7831[_0x1c17('0x52')]['id'])});}}else{socket[_0x1c17('0x88')](_0x1c17('0x89'),{'UserId':Number(_0x2f7831['query'][_0x1c17('0x6a')]),'OpenchannelQueueId':Number(_0x2f7831[_0x1c17('0x52')]['id'])});}});}})[_0x1c17('0x2f')](respondWithStatusCode(_0x2ea13c,null))['catch'](handleError(_0x2ea13c,null));};exports[_0x1c17('0x8d')]=function(_0x596ace,_0x5bdcd1,_0x58a8fb){var _0x3eabff={};var _0x4911c4={};var _0xf1f809;var _0x5238c3;return db[_0x1c17('0x36')][_0x1c17('0x5c')]({'where':{'id':_0x596ace[_0x1c17('0x52')]['id']}})[_0x1c17('0x2f')](handleEntityNotFound(_0x5bdcd1,null))['then'](function(_0x3f8191){if(_0x3f8191){_0xf1f809=_0x3f8191;_0x4911c4[_0x1c17('0x3f')]=_['keys'](db[_0x1c17('0x5f')][_0x1c17('0x37')]);_0x4911c4[_0x1c17('0x3b')]=_[_0x1c17('0x3c')](_0x596ace['query']);_0x4911c4[_0x1c17('0x3d')]=_['intersection'](_0x4911c4['model'],_0x4911c4[_0x1c17('0x3b')]);_0x3eabff[_0x1c17('0x40')]=_[_0x1c17('0x3e')](_0x4911c4[_0x1c17('0x3f')],qs[_0x1c17('0x41')](_0x596ace[_0x1c17('0x3b')][_0x1c17('0x41')]));_0x3eabff['attributes']=_0x3eabff[_0x1c17('0x40')][_0x1c17('0x42')]?_0x3eabff[_0x1c17('0x40')]:_0x4911c4['model'];_0x3eabff[_0x1c17('0x45')]=qs[_0x1c17('0x46')](_0x596ace[_0x1c17('0x3b')]['sort']);_0x3eabff['where']=qs['filters'](_[_0x1c17('0x48')](_0x596ace[_0x1c17('0x3b')],_0x4911c4[_0x1c17('0x3d')]));if(_0x596ace[_0x1c17('0x3b')][_0x1c17('0x49')]){_0x3eabff[_0x1c17('0x47')]=_['merge'](_0x3eabff[_0x1c17('0x47')],{'$or':_[_0x1c17('0x35')](_0x3eabff['attributes'],function(_0x51e873){var _0x3cb414={};_0x3cb414[_0x51e873]={'$like':'%'+_0x596ace[_0x1c17('0x3b')]['filter']+'%'};return _0x3cb414;})});}_0x3eabff=_[_0x1c17('0x53')]({},_0x3eabff,_0x596ace['options']);return _0xf1f809[_0x1c17('0x8d')](_0x3eabff);}})[_0x1c17('0x2f')](function(_0x451614){if(_0x451614){_0x5238c3=_0x451614[_0x1c17('0x42')];if(!_0x596ace[_0x1c17('0x3b')][_0x1c17('0x43')](_0x1c17('0x44'))){_0x3eabff[_0x1c17('0x23')]=qs['limit'](_0x596ace[_0x1c17('0x3b')][_0x1c17('0x23')]);_0x3eabff['offset']=qs[_0x1c17('0x21')](_0x596ace[_0x1c17('0x3b')][_0x1c17('0x21')]);}return _0xf1f809['getAgents'](_0x3eabff);}})['then'](function(_0x3a9124){if(_0x3a9124){return _0x3a9124?{'count':_0x5238c3,'rows':_0x3a9124}:null;}})[_0x1c17('0x2f')](respondWithResult(_0x5bdcd1,null))[_0x1c17('0x50')](handleError(_0x5bdcd1,null));};
\ No newline at end of file
+var _0x30d4=['team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','pick','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','OpenchannelQueue','rawAttributes','fieldName','key','map','query','intersection','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','describe','getMembers','params','UserOpenchannelQueue','OpenchannelQueueId','findAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','order','User','Agents','voicePause','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','tq.TeamId','from'];(function(_0x985364,_0xb9eb08){var _0x55a692=function(_0x88c3fa){while(--_0x88c3fa){_0x985364['push'](_0x985364['shift']());}};_0x55a692(++_0xb9eb08);}(_0x30d4,0x13b));var _0x430d=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x30d4[_0x47a7d0];return _0xb9bd08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x430d('0x0'));var zipdir=require(_0x430d('0x1'));var jsonpatch=require(_0x430d('0x2'));var rp=require(_0x430d('0x3'));var moment=require(_0x430d('0x4'));var BPromise=require(_0x430d('0x5'));var Mustache=require(_0x430d('0x6'));var util=require('util');var path=require(_0x430d('0x7'));var sox=require(_0x430d('0x8'));var csv=require('to-csv');var ejs=require(_0x430d('0x9'));var fs=require('fs');var fs_extra=require(_0x430d('0xa'));var _=require(_0x430d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x430d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x430d('0xd'));var querystring=require(_0x430d('0xe'));var Papa=require(_0x430d('0xf'));var Redis=require(_0x430d('0x10'));var authService=require(_0x430d('0x11'));var qs=require(_0x430d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x430d('0x13'));var logger=require(_0x430d('0x14'))(_0x430d('0x15'));var utils=require(_0x430d('0x16'));var config=require(_0x430d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x430d('0x18'))['db'];config[_0x430d('0x19')]=_['defaults'](config[_0x430d('0x19')],{'host':_0x430d('0x1a'),'port':0x18eb});var socket=require(_0x430d('0x1b'))(new Redis(config[_0x430d('0x19')]));require(_0x430d('0x1c'))[_0x430d('0x1d')](socket);function respondWithStatusCode(_0x1e4414,_0xe9f10b){_0xe9f10b=_0xe9f10b||0xcc;return function(_0x5154ea){if(_0x5154ea){return _0x1e4414[_0x430d('0x1e')](_0xe9f10b);}return _0x1e4414[_0x430d('0x1f')](_0xe9f10b)[_0x430d('0x20')]();};}function respondWithResult(_0x40bc7c,_0x35612e){_0x35612e=_0x35612e||0xc8;return function(_0x17d8a5){if(_0x17d8a5){return _0x40bc7c['status'](_0x35612e)[_0x430d('0x21')](_0x17d8a5);}};}function respondWithFilteredResult(_0x22b683,_0x3d4f78){return function(_0x41d6a0){if(_0x41d6a0){var _0x33a945=typeof _0x3d4f78[_0x430d('0x22')]===_0x430d('0x23')&&typeof _0x3d4f78[_0x430d('0x24')]===_0x430d('0x23');var _0x1e1c9e=_0x41d6a0[_0x430d('0x25')];var _0x1f3b95=_0x33a945?0x0:_0x3d4f78[_0x430d('0x22')];var _0x5a40a6=_0x33a945?_0x41d6a0[_0x430d('0x25')]:_0x3d4f78['offset']+_0x3d4f78[_0x430d('0x24')];var _0x1b4ffc;if(_0x5a40a6>=_0x1e1c9e){_0x5a40a6=_0x1e1c9e;_0x1b4ffc=0xc8;}else{_0x1b4ffc=0xce;}_0x22b683[_0x430d('0x1f')](_0x1b4ffc);return _0x22b683[_0x430d('0x26')](_0x430d('0x27'),_0x1f3b95+'-'+_0x5a40a6+'/'+_0x1e1c9e)['json'](_0x41d6a0);}return null;};}function patchUpdates(_0x3b97ff){return function(_0x5ce49a){try{jsonpatch[_0x430d('0x28')](_0x5ce49a,_0x3b97ff,!![]);}catch(_0x5d88d5){return BPromise[_0x430d('0x29')](_0x5d88d5);}return _0x5ce49a['save']();};}function saveUpdates(_0x5a8229,_0x355dfb){return function(_0x590167){if(_0x590167){return _0x590167['update'](_0x5a8229)[_0x430d('0x2a')](function(_0x4e8208){return _0x4e8208;});}return null;};}function removeEntity(_0x339ec4,_0x5c214c){return function(_0x508993){if(_0x508993){return _0x508993[_0x430d('0x2b')]()[_0x430d('0x2a')](function(){var _0x18ffaf=_0x508993[_0x430d('0x2c')]({'plain':!![]});var _0x4e6b38=_0x430d('0x2d');return db[_0x430d('0x2e')][_0x430d('0x2b')]({'where':{'type':_0x4e6b38,'resourceId':_0x18ffaf['id']}})[_0x430d('0x2a')](function(){return _0x508993;});})[_0x430d('0x2a')](function(){_0x339ec4[_0x430d('0x1f')](0xcc)[_0x430d('0x20')]();});}};}function handleEntityNotFound(_0x5778ab,_0x878034){return function(_0x203efd){if(!_0x203efd){_0x5778ab[_0x430d('0x1e')](0x194);}return _0x203efd;};}function handleError(_0x2888fd,_0x26bdf2){_0x26bdf2=_0x26bdf2||0x1f4;return function(_0x434f0e){logger[_0x430d('0x2f')](_0x434f0e[_0x430d('0x30')]);if(_0x434f0e['name']){delete _0x434f0e[_0x430d('0x31')];}_0x2888fd[_0x430d('0x1f')](_0x26bdf2)[_0x430d('0x32')](_0x434f0e);};}exports[_0x430d('0x33')]=function(_0x4efa88,_0x6b2408){var _0x27b056={},_0x5cfca9={},_0x5ad4a4={'count':0x0,'rows':[]};var _0x4c81d7=_['map'](db[_0x430d('0x34')][_0x430d('0x35')],function(_0x140fec){return{'name':_0x140fec[_0x430d('0x36')],'type':_0x140fec['type'][_0x430d('0x37')]};});_0x5cfca9['model']=_[_0x430d('0x38')](_0x4c81d7,_0x430d('0x31'));_0x5cfca9[_0x430d('0x39')]=_['keys'](_0x4efa88['query']);_0x5cfca9['filters']=_[_0x430d('0x3a')](_0x5cfca9['model'],_0x5cfca9['query']);_0x27b056[_0x430d('0x3b')]=_['intersection'](_0x5cfca9[_0x430d('0x3c')],qs[_0x430d('0x3d')](_0x4efa88[_0x430d('0x39')][_0x430d('0x3d')]));_0x27b056['attributes']=_0x27b056[_0x430d('0x3b')]['length']?_0x27b056[_0x430d('0x3b')]:_0x5cfca9[_0x430d('0x3c')];if(!_0x4efa88['query'][_0x430d('0x3e')](_0x430d('0x3f'))){_0x27b056[_0x430d('0x24')]=qs['limit'](_0x4efa88['query'][_0x430d('0x24')]);_0x27b056[_0x430d('0x22')]=qs[_0x430d('0x22')](_0x4efa88[_0x430d('0x39')][_0x430d('0x22')]);}_0x27b056['order']=qs[_0x430d('0x40')](_0x4efa88['query']['sort']);_0x27b056[_0x430d('0x41')]=qs[_0x430d('0x42')](_['pick'](_0x4efa88[_0x430d('0x39')],_0x5cfca9[_0x430d('0x42')]),_0x4c81d7);if(_0x4efa88[_0x430d('0x39')]['filter']){_0x27b056['where']=_[_0x430d('0x43')](_0x27b056[_0x430d('0x41')],{'$or':_[_0x430d('0x38')](_0x4c81d7,function(_0x4cab07){if(_0x4cab07['type']!==_0x430d('0x44')){var _0x3242c7={};_0x3242c7[_0x4cab07[_0x430d('0x31')]]={'$like':'%'+_0x4efa88['query'][_0x430d('0x45')]+'%'};return _0x3242c7;}})});}_0x27b056=_[_0x430d('0x43')]({},_0x27b056,_0x4efa88[_0x430d('0x46')]);var _0x4cf52a={'where':_0x27b056['where']};return db[_0x430d('0x34')][_0x430d('0x25')](_0x4cf52a)[_0x430d('0x2a')](function(_0x447f9e){_0x5ad4a4[_0x430d('0x25')]=_0x447f9e;if(_0x4efa88[_0x430d('0x39')][_0x430d('0x47')]){_0x27b056[_0x430d('0x48')]=[{'all':!![]}];}return db[_0x430d('0x34')]['findAll'](_0x27b056);})[_0x430d('0x2a')](function(_0x1899a1){_0x5ad4a4[_0x430d('0x49')]=_0x1899a1;return _0x5ad4a4;})['then'](respondWithFilteredResult(_0x6b2408,_0x27b056))[_0x430d('0x4a')](handleError(_0x6b2408,null));};exports[_0x430d('0x4b')]=function(_0x181be2,_0x6d04ba){var _0xd584d3={'raw':!![],'where':{'id':_0x181be2['params']['id']}},_0x2e9aa9={};_0x2e9aa9['model']=_[_0x430d('0x4c')](db[_0x430d('0x34')]['rawAttributes']);_0x2e9aa9[_0x430d('0x39')]=_['keys'](_0x181be2[_0x430d('0x39')]);_0x2e9aa9['filters']=_[_0x430d('0x3a')](_0x2e9aa9[_0x430d('0x3c')],_0x2e9aa9[_0x430d('0x39')]);_0xd584d3[_0x430d('0x3b')]=_['intersection'](_0x2e9aa9[_0x430d('0x3c')],qs[_0x430d('0x3d')](_0x181be2[_0x430d('0x39')]['fields']));_0xd584d3[_0x430d('0x3b')]=_0xd584d3[_0x430d('0x3b')][_0x430d('0x4d')]?_0xd584d3[_0x430d('0x3b')]:_0x2e9aa9[_0x430d('0x3c')];if(_0x181be2['query'][_0x430d('0x47')]){_0xd584d3[_0x430d('0x48')]=[{'all':!![]}];}_0xd584d3=_[_0x430d('0x43')]({},_0xd584d3,_0x181be2[_0x430d('0x46')]);return db[_0x430d('0x34')][_0x430d('0x4e')](_0xd584d3)[_0x430d('0x2a')](handleEntityNotFound(_0x6d04ba,null))[_0x430d('0x2a')](respondWithResult(_0x6d04ba,null))[_0x430d('0x4a')](handleError(_0x6d04ba,null));};exports[_0x430d('0x4f')]=function(_0x953a54,_0x7292ab){return db[_0x430d('0x34')][_0x430d('0x4f')](_0x953a54[_0x430d('0x50')],{})[_0x430d('0x2a')](function(_0x486166){var _0xc6d390=_0x953a54[_0x430d('0x51')]['get']({'plain':!![]});if(!_0xc6d390)throw new Error(_0x430d('0x52'));if(_0xc6d390[_0x430d('0x53')]===_0x430d('0x51')){var _0x40a203=_0x486166[_0x430d('0x2c')]({'plain':!![]});var _0x528cea='OpenchannelQueues';return db[_0x430d('0x54')][_0x430d('0x4e')]({'where':{'name':_0x528cea,'userProfileId':_0xc6d390[_0x430d('0x55')]},'raw':!![]})[_0x430d('0x2a')](function(_0x1b96be){if(_0x1b96be&&_0x1b96be['autoAssociation']===0x0){return db['UserProfileResource'][_0x430d('0x4f')]({'name':_0x40a203[_0x430d('0x31')],'resourceId':_0x40a203['id'],'type':_0x1b96be[_0x430d('0x31')],'sectionId':_0x1b96be['id']},{})['then'](function(){return _0x486166;});}else{return _0x486166;}})['catch'](function(_0x58d3db){logger[_0x430d('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58d3db);throw _0x58d3db;});}return _0x486166;})[_0x430d('0x2a')](respondWithResult(_0x7292ab,0xc9))['catch'](handleError(_0x7292ab,null));};exports[_0x430d('0x56')]=function(_0x2e95af,_0x59825a){if(_0x2e95af[_0x430d('0x50')]['id']){delete _0x2e95af[_0x430d('0x50')]['id'];}return db[_0x430d('0x34')][_0x430d('0x4e')]({'where':{'id':_0x2e95af['params']['id']}})['then'](handleEntityNotFound(_0x59825a,null))[_0x430d('0x2a')](saveUpdates(_0x2e95af[_0x430d('0x50')],null))[_0x430d('0x2a')](respondWithResult(_0x59825a,null))[_0x430d('0x4a')](handleError(_0x59825a,null));};exports[_0x430d('0x2b')]=function(_0x107c4a,_0x3ebe32){return db[_0x430d('0x34')][_0x430d('0x4e')]({'where':{'id':_0x107c4a['params']['id']}})[_0x430d('0x2a')](handleEntityNotFound(_0x3ebe32,null))[_0x430d('0x2a')](removeEntity(_0x3ebe32,null))[_0x430d('0x4a')](handleError(_0x3ebe32,null));};exports[_0x430d('0x57')]=function(_0x44d731,_0x5f45ab){return db['OpenchannelQueue'][_0x430d('0x57')]()[_0x430d('0x2a')](respondWithResult(_0x5f45ab,null))[_0x430d('0x4a')](handleError(_0x5f45ab,null));};exports[_0x430d('0x58')]=function(_0x31c3e2,_0x830ab8,_0x212ce4){var _0x3faacd={'raw':!![],'where':{}},_0x448564={},_0x4bde2c;return db[_0x430d('0x34')]['findOne']({'where':{'id':_0x31c3e2[_0x430d('0x59')]['id']}})[_0x430d('0x2a')](handleEntityNotFound(_0x830ab8,null))[_0x430d('0x2a')](function(_0x3bcff1){if(_0x3bcff1){_0x4bde2c=_0x3bcff1[_0x430d('0x2c')]({'plain':!![]});_0x448564[_0x430d('0x3c')]=_[_0x430d('0x4c')](db[_0x430d('0x5a')][_0x430d('0x35')]);_0x448564[_0x430d('0x39')]=_['keys'](_0x31c3e2[_0x430d('0x39')]);_0x448564['filters']=_[_0x430d('0x3a')](_0x448564[_0x430d('0x3c')],_0x448564[_0x430d('0x39')]);_0x3faacd[_0x430d('0x3b')]=_[_0x430d('0x3a')](_0x448564['model'],qs[_0x430d('0x3d')](_0x31c3e2[_0x430d('0x39')][_0x430d('0x3d')]));_0x3faacd['attributes']=_0x3faacd[_0x430d('0x3b')][_0x430d('0x4d')]?_0x3faacd[_0x430d('0x3b')]:_0x448564['model'];if(!_0x31c3e2[_0x430d('0x39')][_0x430d('0x3e')]('nolimit')){_0x3faacd[_0x430d('0x24')]=qs[_0x430d('0x24')](_0x31c3e2[_0x430d('0x39')][_0x430d('0x24')]);_0x3faacd[_0x430d('0x22')]=qs[_0x430d('0x22')](_0x31c3e2[_0x430d('0x39')][_0x430d('0x22')]);}_0x3faacd['order']=qs[_0x430d('0x40')](_0x31c3e2['query']['sort']);_0x3faacd[_0x430d('0x41')]=qs[_0x430d('0x42')](_['pick'](_0x31c3e2[_0x430d('0x39')],_0x448564[_0x430d('0x42')]));_0x3faacd[_0x430d('0x41')][_0x430d('0x5b')]=_0x3bcff1['id'];if(_0x31c3e2[_0x430d('0x39')][_0x430d('0x45')]){_0x3faacd[_0x430d('0x41')]=_['merge'](_0x3faacd[_0x430d('0x41')],{'$or':_[_0x430d('0x38')](_0x3faacd['attributes'],function(_0x5a60c6){var _0x45a548={};_0x45a548[_0x5a60c6]={'$like':'%'+_0x31c3e2[_0x430d('0x39')]['filter']+'%'};return _0x45a548;})});}_0x3faacd=_[_0x430d('0x43')]({},_0x3faacd,_0x31c3e2[_0x430d('0x46')]);return db[_0x430d('0x5a')][_0x430d('0x5c')](_0x3faacd);}})[_0x430d('0x2a')](function(_0x1e74ea){if(_0x1e74ea){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x1e74ea,_0x430d('0x5d')),'role':'agent'},'attributes':['id','name',_0x430d('0x5e'),'updatedAt',_0x430d('0x5f')]});}})['then'](function(_0xdfa8ab){if(_0xdfa8ab){return{'count':_0xdfa8ab[_0x430d('0x25')],'rows':_['map'](_0xdfa8ab[_0x430d('0x49')],function(_0x25c139){return{'membername':_0x25c139['name'],'UserId':_0x25c139['id'],'queue_name':_0x4bde2c[_0x430d('0x31')],'OpenchannelQueueId':_0x4bde2c['id'],'interface':util[_0x430d('0x60')](_0x430d('0x61'),_0x430d('0x62'),_0x25c139[_0x430d('0x31')]),'penalty':0x0,'paused':_0x25c139[_0x430d('0x5e')],'createdAt':_0x25c139[_0x430d('0x5f')],'updatedAt':_0x25c139[_0x430d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x430d('0x2a')](respondWithFilteredResult(_0x830ab8,_0x3faacd))[_0x430d('0x4a')](handleError(_0x830ab8,null));};exports[_0x430d('0x64')]=function(_0x26ec93,_0x14dbd4,_0x9e39d2){var _0x2f57c3={};var _0x148d17={};var _0xe5a446;var _0x48fde5;return db['OpenchannelQueue'][_0x430d('0x65')]({'where':{'id':_0x26ec93[_0x430d('0x59')]['id']}})[_0x430d('0x2a')](handleEntityNotFound(_0x14dbd4,null))[_0x430d('0x2a')](function(_0x283d71){if(_0x283d71){_0xe5a446=_0x283d71;_0x148d17[_0x430d('0x3c')]=_['keys'](db[_0x430d('0x66')][_0x430d('0x35')]);_0x148d17[_0x430d('0x39')]=_[_0x430d('0x4c')](_0x26ec93[_0x430d('0x39')]);_0x148d17[_0x430d('0x42')]=_[_0x430d('0x3a')](_0x148d17[_0x430d('0x3c')],_0x148d17['query']);_0x2f57c3[_0x430d('0x3b')]=_[_0x430d('0x3a')](_0x148d17[_0x430d('0x3c')],qs[_0x430d('0x3d')](_0x26ec93[_0x430d('0x39')]['fields']));_0x2f57c3[_0x430d('0x3b')]=_0x2f57c3[_0x430d('0x3b')][_0x430d('0x4d')]?_0x2f57c3[_0x430d('0x3b')]:_0x148d17[_0x430d('0x3c')];_0x2f57c3[_0x430d('0x67')]=qs[_0x430d('0x40')](_0x26ec93[_0x430d('0x39')]['sort']);_0x2f57c3[_0x430d('0x41')]=qs[_0x430d('0x42')](_['pick'](_0x26ec93['query'],_0x148d17[_0x430d('0x42')]));if(_0x26ec93[_0x430d('0x39')][_0x430d('0x45')]){_0x2f57c3[_0x430d('0x41')]=_[_0x430d('0x43')](_0x2f57c3[_0x430d('0x41')],{'$or':_[_0x430d('0x38')](_0x2f57c3[_0x430d('0x3b')],function(_0x25b495){var _0x2f3a7b={};_0x2f3a7b[_0x25b495]={'$like':'%'+_0x26ec93[_0x430d('0x39')]['filter']+'%'};return _0x2f3a7b;})});}_0x2f57c3=_[_0x430d('0x43')]({},_0x2f57c3,_0x26ec93['options']);return _0xe5a446[_0x430d('0x64')](_0x2f57c3);}})[_0x430d('0x2a')](function(_0x5eda93){if(_0x5eda93){_0x48fde5=_0x5eda93['length'];if(!_0x26ec93[_0x430d('0x39')][_0x430d('0x3e')]('nolimit')){_0x2f57c3[_0x430d('0x24')]=qs['limit'](_0x26ec93['query'][_0x430d('0x24')]);_0x2f57c3[_0x430d('0x22')]=qs['offset'](_0x26ec93[_0x430d('0x39')][_0x430d('0x22')]);}return _0xe5a446['getTeams'](_0x2f57c3);}})[_0x430d('0x2a')](function(_0x1af566){if(_0x1af566){return _0x1af566?{'count':_0x48fde5,'rows':_0x1af566}:null;}})[_0x430d('0x2a')](respondWithResult(_0x14dbd4,null))['catch'](handleError(_0x14dbd4,null));};exports['addTeams']=function(_0x2d3142,_0x45a9d5,_0x645e0c){var _0x3e4863=_0x2d3142['body']['ids'];return db[_0x430d('0x66')][_0x430d('0x5c')]({'where':{'id':_0x3e4863},'attributes':['id'],'include':[{'model':db[_0x430d('0x68')],'as':_0x430d('0x69'),'attributes':['id',_0x430d('0x31'),'online',_0x430d('0x6a'),_0x430d('0x6b')],'raw':!![]}]})['then'](function(_0x387f5d){if(_0x387f5d){var _0x40877d=_[_0x430d('0x6c')](_0x387f5d,function(_0x572a50){var _0x122977=_0x572a50[_0x430d('0x2c')]({'plain':!![]});return _0x122977['Agents'];});return db[_0x430d('0x34')][_0x430d('0x4e')]({'where':{'id':_0x2d3142[_0x430d('0x59')]['id']}})[_0x430d('0x2a')](function(_0x325915){return db[_0x430d('0x6d')]['transaction'](function(_0x1cb7bd){return _0x325915['addTeams'](_0x3e4863,{'transaction':_0x1cb7bd})[_0x430d('0x2a')](function(){return BPromise[_0x430d('0x6e')](_0x40877d,function(_0x3b8541){return db[_0x430d('0x5a')][_0x430d('0x6f')]({'where':{'UserId':_0x3b8541['id'],'OpenchannelQueueId':_0x2d3142[_0x430d('0x59')]['id']},'transaction':_0x1cb7bd});});})['then'](function(){_0x40877d[_0x430d('0x70')](function(_0x3ac937){socket[_0x430d('0x71')](_0x430d('0x72'),{'UserId':_0x3ac937['id'],'OpenchannelQueueId':_0x325915['id']});});});});});}})[_0x430d('0x2a')](respondWithStatusCode(_0x45a9d5,null))['catch'](handleError(_0x45a9d5,null));};exports[_0x430d('0x73')]=function(_0x408d18,_0x343a0c,_0x560450){return db['Team'][_0x430d('0x5c')]({'where':{'id':_0x408d18['query'][_0x430d('0x74')]},'attributes':['id'],'include':[{'model':db[_0x430d('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x430d('0x2a')](handleEntityNotFound(_0x343a0c,null))[_0x430d('0x2a')](function(_0x29bce5){var _0x2854fd=_[_0x430d('0x38')](_0x29bce5,'id');var _0x12f262=[];var _0x2e4272=[];var _0x312076=squel['select']();_0x312076[_0x430d('0x75')](_0x430d('0x76'))[_0x430d('0x77')](_0x430d('0x78'),'tq')['join'](_0x430d('0x79'),'ut',_0x430d('0x7a'))['where'](_0x430d('0x7b'),_0x408d18[_0x430d('0x59')]['id']);for(var _0x32fade=0x0;_0x32fade<_0x29bce5[_0x430d('0x4d')];_0x32fade+=0x1){let _0x209756=_0x29bce5[_0x32fade];for(var _0x30fc5e=0x0;_0x30fc5e<_0x209756[_0x430d('0x69')][_0x430d('0x4d')];_0x30fc5e+=0x1){let _0x4599c5=_0x209756[_0x430d('0x69')][_0x30fc5e];var _0x2ad4af=_0x312076[_0x430d('0x7c')]();_0x2ad4af[_0x430d('0x41')]('ut.UserId\x20=\x20?',_0x4599c5['id']);_0x2e4272[_0x430d('0x7d')](db[_0x430d('0x6d')][_0x430d('0x39')](_0x2ad4af[_0x430d('0x7e')](),{'type':db[_0x430d('0x6d')][_0x430d('0x7f')][_0x430d('0x80')]})[_0x430d('0x2a')](function(_0x3f0da6){if(_0x3f0da6['length']===0x1){return _0x4599c5['id'];}else{var _0x164245=_[_0x430d('0x81')](_['map'](_0x3f0da6,_0x430d('0x82')),function(_0x17ceda){return _[_0x430d('0x83')](_0x2854fd,_0x17ceda);});if(_0x164245){return _0x4599c5['id'];}}}));}}return BPromise[_0x430d('0x84')](_0x2e4272)[_0x430d('0x2a')](function(_0x41b740){_0x12f262=_(_0x12f262)[_0x430d('0x85')](_0x41b740)[_0x430d('0x86')]()[_0x430d('0x87')]();return db['OpenchannelQueue'][_0x430d('0x4e')]({'where':{'id':_0x408d18[_0x430d('0x59')]['id']}})['then'](function(_0x2874d9){return db['sequelize'][_0x430d('0x88')](function(_0x21b224){return _0x2874d9[_0x430d('0x73')](_0x408d18[_0x430d('0x39')][_0x430d('0x74')],{'transaction':_0x21b224})[_0x430d('0x2a')](function(){if(!_[_0x430d('0x89')](_0x12f262)){return _0x2874d9[_0x430d('0x8a')](_0x12f262,{'transaction':_0x21b224});}})[_0x430d('0x2a')](function(){_0x12f262[_0x430d('0x70')](function(_0x2db02d){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x2db02d,'OpenchannelQueueId':_0x2874d9['id']});});});});});});})[_0x430d('0x2a')](respondWithStatusCode(_0x343a0c,null))[_0x430d('0x4a')](handleError(_0x343a0c,null));};exports[_0x430d('0x8b')]=function(_0x30b5d4,_0x3f7c2c,_0x46e2a4){return db[_0x430d('0x34')][_0x430d('0x4e')]({'where':{'id':_0x30b5d4[_0x430d('0x59')]['id']}})[_0x430d('0x2a')](handleEntityNotFound(_0x3f7c2c,null))['then'](function(_0x32efd5){if(_0x32efd5){return _0x32efd5[_0x430d('0x8b')](_0x30b5d4[_0x430d('0x50')][_0x430d('0x74')],_['omit'](_0x30b5d4[_0x430d('0x50')],[_0x430d('0x74'),'id'])||{})[_0x430d('0x8c')](function(_0x51271f){for(var _0x5dfe1a=0x0;_0x5dfe1a<_0x30b5d4['body']['ids'][_0x430d('0x4d')];_0x5dfe1a+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x30b5d4['body'][_0x430d('0x74')][_0x5dfe1a]),'OpenchannelQueueId':Number(_0x30b5d4[_0x430d('0x59')]['id'])});}return _0x51271f;});}})[_0x430d('0x2a')](respondWithResult(_0x3f7c2c,null))[_0x430d('0x4a')](handleError(_0x3f7c2c,null));};exports[_0x430d('0x8a')]=function(_0x1704bc,_0x217896,_0x3c2b8d){return db[_0x430d('0x34')][_0x430d('0x4e')]({'where':{'id':_0x1704bc[_0x430d('0x59')]['id']}})['then'](handleEntityNotFound(_0x217896,null))[_0x430d('0x2a')](function(_0x58a147){if(_0x58a147){return _0x58a147[_0x430d('0x8a')](_0x1704bc[_0x430d('0x39')][_0x430d('0x74')])[_0x430d('0x2a')](function(){if(_[_0x430d('0x8d')](_0x1704bc[_0x430d('0x39')][_0x430d('0x74')])){for(var _0x3f6f4a=0x0;_0x3f6f4a<_0x1704bc['query']['ids'][_0x430d('0x4d')];_0x3f6f4a+=0x1){socket[_0x430d('0x71')](_0x430d('0x8e'),{'UserId':Number(_0x1704bc[_0x430d('0x39')][_0x430d('0x74')][_0x3f6f4a]),'OpenchannelQueueId':Number(_0x1704bc[_0x430d('0x59')]['id'])});}}else{socket[_0x430d('0x71')](_0x430d('0x8e'),{'UserId':Number(_0x1704bc[_0x430d('0x39')][_0x430d('0x74')]),'OpenchannelQueueId':Number(_0x1704bc[_0x430d('0x59')]['id'])});}});}})[_0x430d('0x2a')](respondWithStatusCode(_0x217896,null))['catch'](handleError(_0x217896,null));};exports[_0x430d('0x8f')]=function(_0x17e767,_0x1c2385,_0x4e4243){var _0x2af55c={};var _0x207193={};var _0x2538df;var _0x228706;return db[_0x430d('0x34')][_0x430d('0x65')]({'where':{'id':_0x17e767[_0x430d('0x59')]['id']}})[_0x430d('0x2a')](handleEntityNotFound(_0x1c2385,null))[_0x430d('0x2a')](function(_0x3a6f74){if(_0x3a6f74){_0x2538df=_0x3a6f74;_0x207193[_0x430d('0x3c')]=_[_0x430d('0x4c')](db[_0x430d('0x68')][_0x430d('0x35')]);_0x207193[_0x430d('0x39')]=_[_0x430d('0x4c')](_0x17e767[_0x430d('0x39')]);_0x207193[_0x430d('0x42')]=_[_0x430d('0x3a')](_0x207193[_0x430d('0x3c')],_0x207193['query']);_0x2af55c[_0x430d('0x3b')]=_['intersection'](_0x207193[_0x430d('0x3c')],qs[_0x430d('0x3d')](_0x17e767[_0x430d('0x39')][_0x430d('0x3d')]));_0x2af55c[_0x430d('0x3b')]=_0x2af55c[_0x430d('0x3b')][_0x430d('0x4d')]?_0x2af55c[_0x430d('0x3b')]:_0x207193['model'];_0x2af55c[_0x430d('0x67')]=qs[_0x430d('0x40')](_0x17e767[_0x430d('0x39')][_0x430d('0x40')]);_0x2af55c[_0x430d('0x41')]=qs[_0x430d('0x42')](_[_0x430d('0x90')](_0x17e767['query'],_0x207193[_0x430d('0x42')]));if(_0x17e767[_0x430d('0x39')]['filter']){_0x2af55c[_0x430d('0x41')]=_['merge'](_0x2af55c[_0x430d('0x41')],{'$or':_[_0x430d('0x38')](_0x2af55c['attributes'],function(_0x220d65){var _0x2f9ecd={};_0x2f9ecd[_0x220d65]={'$like':'%'+_0x17e767[_0x430d('0x39')]['filter']+'%'};return _0x2f9ecd;})});}_0x2af55c=_[_0x430d('0x43')]({},_0x2af55c,_0x17e767[_0x430d('0x46')]);return _0x2538df[_0x430d('0x8f')](_0x2af55c);}})[_0x430d('0x2a')](function(_0x3d1556){if(_0x3d1556){_0x228706=_0x3d1556['length'];if(!_0x17e767['query'][_0x430d('0x3e')]('nolimit')){_0x2af55c[_0x430d('0x24')]=qs['limit'](_0x17e767[_0x430d('0x39')][_0x430d('0x24')]);_0x2af55c[_0x430d('0x22')]=qs['offset'](_0x17e767[_0x430d('0x39')][_0x430d('0x22')]);}return _0x2538df['getAgents'](_0x2af55c);}})[_0x430d('0x2a')](function(_0x2809e4){if(_0x2809e4){return _0x2809e4?{'count':_0x228706,'rows':_0x2809e4}:null;}})[_0x430d('0x2a')](respondWithResult(_0x1c2385,null))[_0x430d('0x4a')](handleError(_0x1c2385,null));};
\ No newline at end of file
index 072bd40..2354e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee0e=['../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2126d9,_0x3d5e60){var _0x4a21a3=function(_0x667cc2){while(--_0x667cc2){_0x2126d9['push'](_0x2126d9['shift']());}};_0x4a21a3(++_0x3d5e60);}(_0xee0e,0x171));var _0xeee0=function(_0x146be0,_0x39a85e){_0x146be0=_0x146be0-0x0;var _0x1bcc25=_0xee0e[_0x146be0];return _0x1bcc25;};'use strict';var EventEmitter=require(_0xeee0('0x0'));var OpenchannelQueue=require(_0xeee0('0x1'))['db'][_0xeee0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeee0('0x3'),'afterUpdate':_0xeee0('0x4'),'afterDestroy':_0xeee0('0x5')};function emitEvent(_0x145e4f){return function(_0x439a71,_0x24c264,_0x349e3f){OpenchannelQueueEvents[_0xeee0('0x6')](_0x145e4f+':'+_0x439a71['id'],_0x439a71);OpenchannelQueueEvents[_0xeee0('0x6')](_0x145e4f,_0x439a71);_0x349e3f(null);};}for(var e in events){if(events[_0xeee0('0x7')](e)){var event=events[e];OpenchannelQueue[_0xeee0('0x8')](e,emitEvent(event));}}module[_0xeee0('0x9')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x48bd=['OpenchannelQueue','setMaxListeners','save','update','remove','emit','hook'];(function(_0x35b18a,_0x6b2fbe){var _0x4db1bd=function(_0x389e62){while(--_0x389e62){_0x35b18a['push'](_0x35b18a['shift']());}};_0x4db1bd(++_0x6b2fbe);}(_0x48bd,0x70));var _0xd48b=function(_0x40ae12,_0x74b302){_0x40ae12=_0x40ae12-0x0;var _0x357745=_0x48bd[_0x40ae12];return _0x357745;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require('../../mysqldb')['db'][_0xd48b('0x0')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd48b('0x1')](0x0);var events={'afterCreate':_0xd48b('0x2'),'afterUpdate':_0xd48b('0x3'),'afterDestroy':_0xd48b('0x4')};function emitEvent(_0x55ba94){return function(_0xdd5ed3,_0x524ce6,_0x5f2464){OpenchannelQueueEvents['emit'](_0x55ba94+':'+_0xdd5ed3['id'],_0xdd5ed3);OpenchannelQueueEvents[_0xd48b('0x5')](_0x55ba94,_0xdd5ed3);_0x5f2464(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xd48b('0x6')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index bc58a95..d85739e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x281a=['./openchannelQueue.attributes','exports','define','OpenchannelQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x281a,0x1cb));var _0xa281=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x281a[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xa281('0x0'));var util=require(_0xa281('0x1'));var logger=require(_0xa281('0x2'))(_0xa281('0x3'));var moment=require(_0xa281('0x4'));var BPromise=require(_0xa281('0x5'));var rp=require(_0xa281('0x6'));var fs=require('fs');var path=require(_0xa281('0x7'));var rimraf=require('rimraf');var config=require(_0xa281('0x8'));var attributes=require(_0xa281('0x9'));module[_0xa281('0xa')]=function(_0x288afa,_0x39c60b){return _0x288afa[_0xa281('0xb')](_0xa281('0xc'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf34b=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','lodash'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xf34b,0xe6));var _0xbf34=function(_0x1ffe65,_0x3ef3e7){_0x1ffe65=_0x1ffe65-0x0;var _0x45eac5=_0xf34b[_0x1ffe65];return _0x45eac5;};'use strict';var _=require(_0xbf34('0x0'));var util=require(_0xbf34('0x1'));var logger=require(_0xbf34('0x2'))(_0xbf34('0x3'));var moment=require(_0xbf34('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf34('0x5'));var rimraf=require(_0xbf34('0x6'));var config=require(_0xbf34('0x7'));var attributes=require(_0xbf34('0x8'));module['exports']=function(_0xc86b1b,_0x3070fc){return _0xc86b1b[_0xbf34('0x9')]('OpenchannelQueue',attributes,{'tableName':_0xbf34('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 166ffbd..46751c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca6a=['redis','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','catch','find','ShowOpenchannelQueue','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','socket.io-emitter'];(function(_0x39e85c,_0x3bca61){var _0xf96780=function(_0x3b0708){while(--_0x3b0708){_0x39e85c['push'](_0x39e85c['shift']());}};_0xf96780(++_0x3bca61);}(_0xca6a,0x106));var _0xaca6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca6a[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xaca6('0x0'));var util=require(_0xaca6('0x1'));var moment=require(_0xaca6('0x2'));var BPromise=require(_0xaca6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaca6('0x4'));var logger=require(_0xaca6('0x5'))('rpc');var config=require(_0xaca6('0x6'));var jayson=require(_0xaca6('0x7'));var client=jayson[_0xaca6('0x8')]['http']({'port':0x232a});config['redis']=_[_0xaca6('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xaca6('0xa'))(new Redis(config[_0xaca6('0xb')]));require(_0xaca6('0xc'))[_0xaca6('0xd')](socket);function respondWithRpcPromise(_0x466b8f,_0x2d016e,_0x28a784){return new BPromise(function(_0xc3a3f,_0x2abdbc){return client[_0xaca6('0xe')](_0x466b8f,_0x28a784)[_0xaca6('0xf')](function(_0x22dcaf){logger[_0xaca6('0x10')](_0xaca6('0x11'),_0x2d016e,_0xaca6('0x12'));logger[_0xaca6('0x13')](_0xaca6('0x14'),_0x2d016e,_0xaca6('0x12'),JSON['stringify'](_0x22dcaf));if(_0x22dcaf['error']){if(_0x22dcaf[_0xaca6('0x15')]['code']===0x1f4){logger[_0xaca6('0x15')](_0xaca6('0x11'),_0x2d016e,_0x22dcaf[_0xaca6('0x15')][_0xaca6('0x16')]);return _0x2abdbc(_0x22dcaf[_0xaca6('0x15')]['message']);}logger[_0xaca6('0x15')](_0xaca6('0x11'),_0x2d016e,_0x22dcaf[_0xaca6('0x15')][_0xaca6('0x16')]);return _0xc3a3f(_0x22dcaf[_0xaca6('0x15')][_0xaca6('0x16')]);}else{logger[_0xaca6('0x10')](_0xaca6('0x11'),_0x2d016e,_0xaca6('0x12'));_0xc3a3f(_0x22dcaf[_0xaca6('0x17')][_0xaca6('0x16')]);}})['catch'](function(_0x14ddce){logger[_0xaca6('0x15')](_0xaca6('0x11'),_0x2d016e,_0x14ddce);_0x2abdbc(_0x14ddce);});});}exports[_0xaca6('0x18')]=function(_0x53aef9){var _0x3e02b2=this;return new Promise(function(_0x4bceeb,_0x43add9){return db[_0xaca6('0x19')][_0xaca6('0x1a')]({'raw':_0x53aef9[_0xaca6('0x1b')]?_0x53aef9[_0xaca6('0x1b')][_0xaca6('0x1c')]===undefined?!![]:![]:!![],'where':_0x53aef9[_0xaca6('0x1b')]?_0x53aef9['options'][_0xaca6('0x1d')]||null:null,'attributes':_0x53aef9[_0xaca6('0x1b')]?_0x53aef9['options'][_0xaca6('0x1e')]||null:null,'limit':_0x53aef9[_0xaca6('0x1b')]?_0x53aef9[_0xaca6('0x1b')][_0xaca6('0x1f')]||null:null,'include':_0x53aef9[_0xaca6('0x1b')]?_0x53aef9[_0xaca6('0x1b')][_0xaca6('0x20')]?_['map'](_0x53aef9[_0xaca6('0x1b')]['include'],function(_0x33db8d){return{'model':db[_0x33db8d[_0xaca6('0x21')]],'as':_0x33db8d['as'],'attributes':_0x33db8d[_0xaca6('0x1e')],'include':_0x33db8d[_0xaca6('0x20')]?_[_0xaca6('0x22')](_0x33db8d[_0xaca6('0x20')],function(_0x7dde9a){return{'model':db[_0x7dde9a['model']],'as':_0x7dde9a['as'],'attributes':_0x7dde9a[_0xaca6('0x1e')],'include':_0x7dde9a[_0xaca6('0x20')]?_['map'](_0x7dde9a['include'],function(_0x321cf7){return{'model':db[_0x321cf7[_0xaca6('0x21')]],'as':_0x321cf7['as'],'attributes':_0x321cf7[_0xaca6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaca6('0xf')](function(_0x326a04){logger[_0xaca6('0x10')](_0xaca6('0x18'),_0x53aef9);logger[_0xaca6('0x13')](_0xaca6('0x18'),_0x53aef9,JSON[_0xaca6('0x23')](_0x326a04));_0x4bceeb(_0x326a04);})[_0xaca6('0x24')](function(_0x3403cd){logger[_0xaca6('0x15')]('GetOpenchannelQueue',_0x3403cd[_0xaca6('0x16')],_0x53aef9);_0x43add9(_0x3e02b2[_0xaca6('0x15')](0x1f4,_0x3403cd[_0xaca6('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x282641){var _0x124936=this;return new Promise(function(_0x470b10,_0x56dc99){return db['OpenchannelQueue'][_0xaca6('0x25')]({'raw':_0x282641[_0xaca6('0x1b')]?_0x282641[_0xaca6('0x1b')][_0xaca6('0x1c')]===undefined?!![]:![]:!![],'where':_0x282641[_0xaca6('0x1b')]?_0x282641['options'][_0xaca6('0x1d')]||null:null,'attributes':_0x282641[_0xaca6('0x1b')]?_0x282641['options'][_0xaca6('0x1e')]||null:null,'include':_0x282641[_0xaca6('0x1b')]?_0x282641[_0xaca6('0x1b')][_0xaca6('0x20')]?_[_0xaca6('0x22')](_0x282641['options']['include'],function(_0xa9b509){return{'model':db[_0xa9b509[_0xaca6('0x21')]],'as':_0xa9b509['as'],'attributes':_0xa9b509[_0xaca6('0x1e')],'include':_0xa9b509[_0xaca6('0x20')]?_[_0xaca6('0x22')](_0xa9b509[_0xaca6('0x20')],function(_0x37c2ea){return{'model':db[_0x37c2ea[_0xaca6('0x21')]],'as':_0x37c2ea['as'],'attributes':_0x37c2ea[_0xaca6('0x1e')],'include':_0x37c2ea['include']?_[_0xaca6('0x22')](_0x37c2ea['include'],function(_0x5a9d6c){return{'model':db[_0x5a9d6c[_0xaca6('0x21')]],'as':_0x5a9d6c['as'],'attributes':_0x5a9d6c[_0xaca6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xaca6('0xf')](function(_0x3c9af3){logger[_0xaca6('0x10')]('ShowOpenchannelQueue',_0x282641);logger[_0xaca6('0x13')]('ShowOpenchannelQueue',_0x282641,JSON[_0xaca6('0x23')](_0x3c9af3));_0x470b10(_0x3c9af3);})['catch'](function(_0x16d6f2){logger[_0xaca6('0x15')](_0xaca6('0x26'),_0x16d6f2[_0xaca6('0x16')],_0x282641);_0x56dc99(_0x124936[_0xaca6('0x15')](0x1f4,_0x16d6f2[_0xaca6('0x16')]));});});};
\ No newline at end of file
+var _0xdd2b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','then','info','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','OpenchannelQueue','find','debug','lodash','util','bluebird'];(function(_0x8b8b71,_0x24e532){var _0x4610e0=function(_0x4cf6ac){while(--_0x4cf6ac){_0x8b8b71['push'](_0x8b8b71['shift']());}};_0x4610e0(++_0x24e532);}(_0xdd2b,0x183));var _0xbdd2=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xdd2b[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xbdd2('0x0'));var util=require(_0xbdd2('0x1'));var moment=require('moment');var BPromise=require(_0xbdd2('0x2'));var rs=require(_0xbdd2('0x3'));var fs=require('fs');var Redis=require(_0xbdd2('0x4'));var db=require(_0xbdd2('0x5'))['db'];var utils=require(_0xbdd2('0x6'));var logger=require(_0xbdd2('0x7'))('rpc');var config=require(_0xbdd2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdd2('0x9')]['http']({'port':0x232a});config[_0xbdd2('0xa')]=_[_0xbdd2('0xb')](config['redis'],{'host':_0xbdd2('0xc'),'port':0x18eb});var socket=require(_0xbdd2('0xd'))(new Redis(config[_0xbdd2('0xa')]));require(_0xbdd2('0xe'))[_0xbdd2('0xf')](socket);function respondWithRpcPromise(_0x573bf8,_0xe5c3ae,_0x3cf73e){return new BPromise(function(_0x1b5e8e,_0x18ee11){return client['request'](_0x573bf8,_0x3cf73e)[_0xbdd2('0x10')](function(_0x4a9df5){logger[_0xbdd2('0x11')]('OpenchannelQueue,\x20%s,\x20%s',_0xe5c3ae,_0xbdd2('0x12'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xe5c3ae,'request\x20sent',JSON[_0xbdd2('0x13')](_0x4a9df5));if(_0x4a9df5[_0xbdd2('0x14')]){if(_0x4a9df5[_0xbdd2('0x14')][_0xbdd2('0x15')]===0x1f4){logger[_0xbdd2('0x14')](_0xbdd2('0x16'),_0xe5c3ae,_0x4a9df5[_0xbdd2('0x14')][_0xbdd2('0x17')]);return _0x18ee11(_0x4a9df5[_0xbdd2('0x14')][_0xbdd2('0x17')]);}logger[_0xbdd2('0x14')](_0xbdd2('0x16'),_0xe5c3ae,_0x4a9df5[_0xbdd2('0x14')][_0xbdd2('0x17')]);return _0x1b5e8e(_0x4a9df5[_0xbdd2('0x14')][_0xbdd2('0x17')]);}else{logger['info'](_0xbdd2('0x16'),_0xe5c3ae,_0xbdd2('0x12'));_0x1b5e8e(_0x4a9df5[_0xbdd2('0x18')]['message']);}})[_0xbdd2('0x19')](function(_0x550526){logger[_0xbdd2('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0xe5c3ae,_0x550526);_0x18ee11(_0x550526);});});}exports[_0xbdd2('0x1a')]=function(_0x22010c){var _0x3a5350=this;return new Promise(function(_0x39041e,_0x3dfc7f){return db['OpenchannelQueue']['findAll']({'raw':_0x22010c[_0xbdd2('0x1b')]?_0x22010c[_0xbdd2('0x1b')][_0xbdd2('0x1c')]===undefined?!![]:![]:!![],'where':_0x22010c['options']?_0x22010c[_0xbdd2('0x1b')][_0xbdd2('0x1d')]||null:null,'attributes':_0x22010c[_0xbdd2('0x1b')]?_0x22010c[_0xbdd2('0x1b')][_0xbdd2('0x1e')]||null:null,'limit':_0x22010c[_0xbdd2('0x1b')]?_0x22010c[_0xbdd2('0x1b')][_0xbdd2('0x1f')]||null:null,'include':_0x22010c[_0xbdd2('0x1b')]?_0x22010c[_0xbdd2('0x1b')][_0xbdd2('0x20')]?_[_0xbdd2('0x21')](_0x22010c['options']['include'],function(_0x536d13){return{'model':db[_0x536d13[_0xbdd2('0x22')]],'as':_0x536d13['as'],'attributes':_0x536d13[_0xbdd2('0x1e')],'include':_0x536d13[_0xbdd2('0x20')]?_['map'](_0x536d13[_0xbdd2('0x20')],function(_0x2ec411){return{'model':db[_0x2ec411[_0xbdd2('0x22')]],'as':_0x2ec411['as'],'attributes':_0x2ec411[_0xbdd2('0x1e')],'include':_0x2ec411[_0xbdd2('0x20')]?_[_0xbdd2('0x21')](_0x2ec411[_0xbdd2('0x20')],function(_0x46abd2){return{'model':db[_0x46abd2['model']],'as':_0x46abd2['as'],'attributes':_0x46abd2[_0xbdd2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbdd2('0x10')](function(_0x4c127b){logger[_0xbdd2('0x11')]('GetOpenchannelQueue',_0x22010c);logger['debug'](_0xbdd2('0x1a'),_0x22010c,JSON[_0xbdd2('0x13')](_0x4c127b));_0x39041e(_0x4c127b);})['catch'](function(_0x24ba3c){logger[_0xbdd2('0x14')](_0xbdd2('0x1a'),_0x24ba3c[_0xbdd2('0x17')],_0x22010c);_0x3dfc7f(_0x3a5350[_0xbdd2('0x14')](0x1f4,_0x24ba3c[_0xbdd2('0x17')]));});});};exports[_0xbdd2('0x23')]=function(_0x5aec4b){var _0x37c23=this;return new Promise(function(_0x2e528d,_0x500a8b){return db[_0xbdd2('0x24')][_0xbdd2('0x25')]({'raw':_0x5aec4b[_0xbdd2('0x1b')]?_0x5aec4b[_0xbdd2('0x1b')][_0xbdd2('0x1c')]===undefined?!![]:![]:!![],'where':_0x5aec4b['options']?_0x5aec4b[_0xbdd2('0x1b')][_0xbdd2('0x1d')]||null:null,'attributes':_0x5aec4b[_0xbdd2('0x1b')]?_0x5aec4b[_0xbdd2('0x1b')][_0xbdd2('0x1e')]||null:null,'include':_0x5aec4b['options']?_0x5aec4b[_0xbdd2('0x1b')][_0xbdd2('0x20')]?_['map'](_0x5aec4b[_0xbdd2('0x1b')][_0xbdd2('0x20')],function(_0x215392){return{'model':db[_0x215392['model']],'as':_0x215392['as'],'attributes':_0x215392['attributes'],'include':_0x215392[_0xbdd2('0x20')]?_[_0xbdd2('0x21')](_0x215392['include'],function(_0x3d6315){return{'model':db[_0x3d6315['model']],'as':_0x3d6315['as'],'attributes':_0x3d6315[_0xbdd2('0x1e')],'include':_0x3d6315[_0xbdd2('0x20')]?_['map'](_0x3d6315[_0xbdd2('0x20')],function(_0x4a60d2){return{'model':db[_0x4a60d2[_0xbdd2('0x22')]],'as':_0x4a60d2['as'],'attributes':_0x4a60d2[_0xbdd2('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x128789){logger['info'](_0xbdd2('0x23'),_0x5aec4b);logger[_0xbdd2('0x26')](_0xbdd2('0x23'),_0x5aec4b,JSON[_0xbdd2('0x13')](_0x128789));_0x2e528d(_0x128789);})[_0xbdd2('0x19')](function(_0x2477aa){logger[_0xbdd2('0x14')](_0xbdd2('0x23'),_0x2477aa['message'],_0x5aec4b);_0x500a8b(_0x37c23[_0xbdd2('0x14')](0x1f4,_0x2477aa[_0xbdd2('0x17')]));});});};
\ No newline at end of file
index e05ba8b..eb137bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbec=['removeListener','register','length','openchannelQueue:','save','remove','emit'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xdbec,0x107));var _0xcdbe=function(_0x3b0f30,_0x1b47df){_0x3b0f30=_0x3b0f30-0x0;var _0x164cd9=_0xdbec[_0x3b0f30];return _0x164cd9;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xcdbe('0x0'),_0xcdbe('0x1'),'update'];function createListener(_0x52af55,_0x29e0c4){return function(_0x4a4d8f){_0x29e0c4[_0xcdbe('0x2')](_0x52af55,_0x4a4d8f);};}function removeListener(_0x25de10,_0x46685c){return function(){OpenchannelQueueEvents[_0xcdbe('0x3')](_0x25de10,_0x46685c);};}exports[_0xcdbe('0x4')]=function(_0x42f1ae){for(var _0x432480=0x0,_0xa7420b=events[_0xcdbe('0x5')];_0x432480<_0xa7420b;_0x432480++){var _0x3081a5=events[_0x432480];var _0x411bec=createListener(_0xcdbe('0x6')+_0x3081a5,_0x42f1ae);OpenchannelQueueEvents['on'](_0x3081a5,_0x411bec);}};
\ No newline at end of file
+var _0x0a34=['removeListener','save','remove','update','emit'];(function(_0x10cf01,_0x33966a){var _0x5aba29=function(_0x5e1413){while(--_0x5e1413){_0x10cf01['push'](_0x10cf01['shift']());}};_0x5aba29(++_0x33966a);}(_0x0a34,0x1c3));var _0x40a3=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x0a34[_0x2064e5];return _0x21a233;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x40a3('0x0'),_0x40a3('0x1'),_0x40a3('0x2')];function createListener(_0x153ab5,_0x469db2){return function(_0xe27b55){_0x469db2[_0x40a3('0x3')](_0x153ab5,_0xe27b55);};}function removeListener(_0x24b316,_0x7ee258){return function(){OpenchannelQueueEvents[_0x40a3('0x4')](_0x24b316,_0x7ee258);};}exports['register']=function(_0x40cc7f){for(var _0x4efb5c=0x0,_0x42e573=events['length'];_0x4efb5c<_0x42e573;_0x4efb5c++){var _0x806448=events[_0x4efb5c];var _0x4d3e04=createListener('openchannelQueue:'+_0x806448,_0x40cc7f);OpenchannelQueueEvents['on'](_0x806448,_0x4d3e04);}};
\ No newline at end of file
index 78bb96a..22c1f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf603=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','show','put','update','delete','/:id','destroy','util'];(function(_0x32ef7a,_0x23c75c){var _0xcad8ef=function(_0x26b9cd){while(--_0x26b9cd){_0x32ef7a['push'](_0x32ef7a['shift']());}};_0xcad8ef(++_0x23c75c);}(_0xf603,0x71));var _0x3f60=function(_0xa2cfff,_0x26f817){_0xa2cfff=_0xa2cfff-0x0;var _0x2307b0=_0xf603[_0xa2cfff];return _0x2307b0;};'use strict';var multer=require('multer');var util=require(_0x3f60('0x0'));var path=require('path');var timeout=require(_0x3f60('0x1'));var express=require(_0x3f60('0x2'));var router=express[_0x3f60('0x3')]();var fs_extra=require(_0x3f60('0x4'));var auth=require(_0x3f60('0x5'));var interaction=require(_0x3f60('0x6'));var config=require(_0x3f60('0x7'));var controller=require(_0x3f60('0x8'));router['get']('/',auth[_0x3f60('0x9')](),controller['index']);router[_0x3f60('0xa')](_0x3f60('0xb'),auth[_0x3f60('0x9')](),controller[_0x3f60('0xc')]);router['get']('/:id',auth[_0x3f60('0x9')](),controller[_0x3f60('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3f60('0xe')]('/:id',auth[_0x3f60('0x9')](),controller[_0x3f60('0xf')]);router[_0x3f60('0x10')](_0x3f60('0x11'),auth[_0x3f60('0x9')](),controller[_0x3f60('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0xc1c0=['put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x200013,_0x38b4f9){var _0x5bee93=function(_0x244201){while(--_0x244201){_0x200013['push'](_0x200013['shift']());}};_0x5bee93(++_0x38b4f9);}(_0xc1c0,0x1e0));var _0x0c1c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1c0[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0c1c('0x0'));var util=require('util');var path=require(_0x0c1c('0x1'));var timeout=require(_0x0c1c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0c1c('0x3'));var auth=require(_0x0c1c('0x4'));var interaction=require(_0x0c1c('0x5'));var config=require('../../config/environment');var controller=require(_0x0c1c('0x6'));router['get']('/',auth[_0x0c1c('0x7')](),controller[_0x0c1c('0x8')]);router[_0x0c1c('0x9')](_0x0c1c('0xa'),auth[_0x0c1c('0x7')](),controller[_0x0c1c('0xb')]);router[_0x0c1c('0x9')](_0x0c1c('0xc'),auth[_0x0c1c('0x7')](),controller[_0x0c1c('0xd')]);router['post']('/',auth[_0x0c1c('0x7')](),controller['create']);router[_0x0c1c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0c1c('0xf')]);router[_0x0c1c('0x10')](_0x0c1c('0xc'),auth['isAuthenticated'](),controller[_0x0c1c('0x11')]);module[_0x0c1c('0x12')]=router;
\ No newline at end of file
index 1723086..98755a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['sequelize','exports','STRING','DATE'];(function(_0x3a2798,_0x2e2ec6){var _0x2c5a84=function(_0x5f3e94){while(--_0x5f3e94){_0x3a2798['push'](_0x3a2798['shift']());}};_0x2c5a84(++_0x2e2ec6);}(_0x13f5,0x16c));var _0x513f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x13f5[_0x413feb];return _0x40ee88;};'use strict';var moment=require('moment');var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'uniqueid':{'type':Sequelize[_0x513f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x513f('0x2')]},'joinAt':{'type':Sequelize[_0x513f('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x513f('0x3')]},'reason':{'type':Sequelize[_0x513f('0x2')]}};
\ No newline at end of file
+var _0xaf5d=['exports','STRING','DATE','moment','sequelize'];(function(_0x5c338d,_0x2c9274){var _0x28f8f5=function(_0x3b0562){while(--_0x3b0562){_0x5c338d['push'](_0x5c338d['shift']());}};_0x28f8f5(++_0x2c9274);}(_0xaf5d,0xf8));var _0xdaf5=function(_0x5eae16,_0x10d463){_0x5eae16=_0x5eae16-0x0;var _0x863487=_0xaf5d[_0x5eae16];return _0x863487;};'use strict';var moment=require(_0xdaf5('0x0'));var Sequelize=require(_0xdaf5('0x1'));module[_0xdaf5('0x2')]={'uniqueid':{'type':Sequelize[_0xdaf5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdaf5('0x3')]},'joinAt':{'type':Sequelize[_0xdaf5('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xdaf5('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f4f2dc5..337eb0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x166e=['fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','options','count','includeAll','include','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','path','to-csv','ejs'];(function(_0x5a3b9d,_0x143367){var _0x392295=function(_0x340f90){while(--_0x340f90){_0x5a3b9d['push'](_0x5a3b9d['shift']());}};_0x392295(++_0x143367);}(_0x166e,0x1a4));var _0xe166=function(_0x5f5a9f,_0x235835){_0x5f5a9f=_0x5f5a9f-0x0;var _0x188989=_0x166e[_0x5f5a9f];return _0x188989;};'use strict';var emlformat=require(_0xe166('0x0'));var rimraf=require(_0xe166('0x1'));var zipdir=require(_0xe166('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe166('0x3'));var sox=require('sox');var csv=require(_0xe166('0x4'));var ejs=require(_0xe166('0x5'));var fs=require('fs');var fs_extra=require(_0xe166('0x6'));var _=require(_0xe166('0x7'));var squel=require(_0xe166('0x8'));var crypto=require(_0xe166('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe166('0x4'));var querystring=require(_0xe166('0xa'));var Papa=require(_0xe166('0xb'));var Redis=require(_0xe166('0xc'));var authService=require(_0xe166('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe166('0xe'));var logger=require('../../config/logger')(_0xe166('0xf'));var utils=require(_0xe166('0x10'));var config=require(_0xe166('0x11'));var licenseUtil=require(_0xe166('0x12'));var db=require(_0xe166('0x13'))['db'];function respondWithStatusCode(_0x54be34,_0x13cdfd){_0x13cdfd=_0x13cdfd||0xcc;return function(_0x4bd146){if(_0x4bd146){return _0x54be34[_0xe166('0x14')](_0x13cdfd);}return _0x54be34[_0xe166('0x15')](_0x13cdfd)['end']();};}function respondWithResult(_0x1e3d7a,_0x12b89e){_0x12b89e=_0x12b89e||0xc8;return function(_0xeb3c01){if(_0xeb3c01){return _0x1e3d7a[_0xe166('0x15')](_0x12b89e)[_0xe166('0x16')](_0xeb3c01);}};}function respondWithFilteredResult(_0x3a222c,_0x4028de){return function(_0x2ce9a1){if(_0x2ce9a1){var _0x144a0b=typeof _0x4028de[_0xe166('0x17')]===_0xe166('0x18')&&typeof _0x4028de[_0xe166('0x19')]===_0xe166('0x18');var _0x350db2=_0x2ce9a1['count'];var _0x48f19b=_0x144a0b?0x0:_0x4028de[_0xe166('0x17')];var _0x25fa72=_0x144a0b?_0x2ce9a1['count']:_0x4028de[_0xe166('0x17')]+_0x4028de[_0xe166('0x19')];var _0x106413;if(_0x25fa72>=_0x350db2){_0x25fa72=_0x350db2;_0x106413=0xc8;}else{_0x106413=0xce;}_0x3a222c[_0xe166('0x15')](_0x106413);return _0x3a222c[_0xe166('0x1a')](_0xe166('0x1b'),_0x48f19b+'-'+_0x25fa72+'/'+_0x350db2)[_0xe166('0x16')](_0x2ce9a1);}return null;};}function patchUpdates(_0x4175ce){return function(_0x55e03e){try{jsonpatch[_0xe166('0x1c')](_0x55e03e,_0x4175ce,!![]);}catch(_0x1466a4){return BPromise[_0xe166('0x1d')](_0x1466a4);}return _0x55e03e[_0xe166('0x1e')]();};}function saveUpdates(_0x110bfa,_0xe55923){return function(_0x5a86cd){if(_0x5a86cd){return _0x5a86cd[_0xe166('0x1f')](_0x110bfa)[_0xe166('0x20')](function(_0x340f93){return _0x340f93;});}return null;};}function removeEntity(_0x5cf171,_0x49d448){return function(_0x13919a){if(_0x13919a){return _0x13919a[_0xe166('0x21')]()[_0xe166('0x20')](function(){_0x5cf171['status'](0xcc)[_0xe166('0x22')]();});}};}function handleEntityNotFound(_0x4fdc12,_0x29a8b5){return function(_0x304540){if(!_0x304540){_0x4fdc12[_0xe166('0x14')](0x194);}return _0x304540;};}function handleError(_0x27d29b,_0x43865a){_0x43865a=_0x43865a||0x1f4;return function(_0xcd771c){logger[_0xe166('0x23')](_0xcd771c[_0xe166('0x24')]);if(_0xcd771c['name']){delete _0xcd771c[_0xe166('0x25')];}_0x27d29b[_0xe166('0x15')](_0x43865a)[_0xe166('0x26')](_0xcd771c);};}exports['index']=function(_0x1319a6,_0x10bafc){var _0x4a1bef={},_0x449412={},_0x2044e9={'count':0x0,'rows':[]};var _0x1846c5=_[_0xe166('0x27')](db[_0xe166('0x28')][_0xe166('0x29')],function(_0x439b6f){return{'name':_0x439b6f[_0xe166('0x2a')],'type':_0x439b6f[_0xe166('0x2b')][_0xe166('0x2c')]};});_0x449412[_0xe166('0x2d')]=_[_0xe166('0x27')](_0x1846c5,_0xe166('0x25'));_0x449412[_0xe166('0x2e')]=_[_0xe166('0x2f')](_0x1319a6[_0xe166('0x2e')]);_0x449412['filters']=_[_0xe166('0x30')](_0x449412[_0xe166('0x2d')],_0x449412['query']);_0x4a1bef[_0xe166('0x31')]=_['intersection'](_0x449412[_0xe166('0x2d')],qs['fields'](_0x1319a6[_0xe166('0x2e')][_0xe166('0x32')]));_0x4a1bef['attributes']=_0x4a1bef[_0xe166('0x31')][_0xe166('0x33')]?_0x4a1bef[_0xe166('0x31')]:_0x449412[_0xe166('0x2d')];if(!_0x1319a6[_0xe166('0x2e')]['hasOwnProperty'](_0xe166('0x34'))){_0x4a1bef['limit']=qs[_0xe166('0x19')](_0x1319a6[_0xe166('0x2e')][_0xe166('0x19')]);_0x4a1bef[_0xe166('0x17')]=qs['offset'](_0x1319a6[_0xe166('0x2e')][_0xe166('0x17')]);}_0x4a1bef[_0xe166('0x35')]=qs[_0xe166('0x36')](_0x1319a6['query']['sort']);_0x4a1bef['where']=qs[_0xe166('0x37')](_[_0xe166('0x38')](_0x1319a6['query'],_0x449412[_0xe166('0x37')]),_0x1846c5);if(_0x1319a6[_0xe166('0x2e')][_0xe166('0x39')]){_0x4a1bef['where']=_['merge'](_0x4a1bef[_0xe166('0x3a')],{'$or':_[_0xe166('0x27')](_0x1846c5,function(_0x39d9ba){if(_0x39d9ba[_0xe166('0x2b')]!=='VIRTUAL'){var _0x354d6d={};_0x354d6d[_0x39d9ba[_0xe166('0x25')]]={'$like':'%'+_0x1319a6['query']['filter']+'%'};return _0x354d6d;}})});}_0x4a1bef=_['merge']({},_0x4a1bef,_0x1319a6[_0xe166('0x3b')]);var _0x426727={'where':_0x4a1bef[_0xe166('0x3a')]};return db[_0xe166('0x28')]['count'](_0x426727)[_0xe166('0x20')](function(_0x2ed3b3){_0x2044e9[_0xe166('0x3c')]=_0x2ed3b3;if(_0x1319a6['query'][_0xe166('0x3d')]){_0x4a1bef[_0xe166('0x3e')]=[{'all':!![]}];}return db[_0xe166('0x28')]['findAll'](_0x4a1bef);})[_0xe166('0x20')](function(_0x211630){_0x2044e9[_0xe166('0x3f')]=_0x211630;return _0x2044e9;})[_0xe166('0x20')](respondWithFilteredResult(_0x10bafc,_0x4a1bef))[_0xe166('0x40')](handleError(_0x10bafc,null));};exports[_0xe166('0x41')]=function(_0x4eeea9,_0x843c42){var _0x1a210c={'raw':!![],'where':{'id':_0x4eeea9[_0xe166('0x42')]['id']}},_0x2ef5bd={};_0x2ef5bd[_0xe166('0x2d')]=_[_0xe166('0x2f')](db[_0xe166('0x28')][_0xe166('0x29')]);_0x2ef5bd[_0xe166('0x2e')]=_[_0xe166('0x2f')](_0x4eeea9['query']);_0x2ef5bd[_0xe166('0x37')]=_['intersection'](_0x2ef5bd[_0xe166('0x2d')],_0x2ef5bd[_0xe166('0x2e')]);_0x1a210c['attributes']=_[_0xe166('0x30')](_0x2ef5bd[_0xe166('0x2d')],qs[_0xe166('0x32')](_0x4eeea9[_0xe166('0x2e')][_0xe166('0x32')]));_0x1a210c[_0xe166('0x31')]=_0x1a210c[_0xe166('0x31')]['length']?_0x1a210c['attributes']:_0x2ef5bd[_0xe166('0x2d')];if(_0x4eeea9[_0xe166('0x2e')][_0xe166('0x3d')]){_0x1a210c[_0xe166('0x3e')]=[{'all':!![]}];}_0x1a210c=_['merge']({},_0x1a210c,_0x4eeea9['options']);return db['OpenchannelQueueReport'][_0xe166('0x43')](_0x1a210c)[_0xe166('0x20')](handleEntityNotFound(_0x843c42,null))[_0xe166('0x20')](respondWithResult(_0x843c42,null))[_0xe166('0x40')](handleError(_0x843c42,null));};exports[_0xe166('0x44')]=function(_0x3d248d,_0x1252f3){return db[_0xe166('0x28')][_0xe166('0x44')](_0x3d248d[_0xe166('0x45')],{})[_0xe166('0x20')](respondWithResult(_0x1252f3,0xc9))[_0xe166('0x40')](handleError(_0x1252f3,null));};exports[_0xe166('0x1f')]=function(_0x388e4b,_0x1a1f40){if(_0x388e4b[_0xe166('0x45')]['id']){delete _0x388e4b['body']['id'];}return db[_0xe166('0x28')][_0xe166('0x43')]({'where':{'id':_0x388e4b[_0xe166('0x42')]['id']}})[_0xe166('0x20')](handleEntityNotFound(_0x1a1f40,null))[_0xe166('0x20')](saveUpdates(_0x388e4b[_0xe166('0x45')],null))[_0xe166('0x20')](respondWithResult(_0x1a1f40,null))[_0xe166('0x40')](handleError(_0x1a1f40,null));};exports[_0xe166('0x21')]=function(_0x1dd2d7,_0x5b0554){return db[_0xe166('0x28')][_0xe166('0x43')]({'where':{'id':_0x1dd2d7['params']['id']}})[_0xe166('0x20')](handleEntityNotFound(_0x5b0554,null))['then'](removeEntity(_0x5b0554,null))[_0xe166('0x40')](handleError(_0x5b0554,null));};exports[_0xe166('0x46')]=function(_0x3583e1,_0x3233da){return db[_0xe166('0x28')][_0xe166('0x46')]()[_0xe166('0x20')](respondWithResult(_0x3233da,null))[_0xe166('0x40')](handleError(_0x3233da,null));};
\ No newline at end of file
+var _0x6cfb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','include','findAll','rows','show','keys','includeAll','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x5e4c34,_0x387a28){var _0xfd8fb0=function(_0x1fed41){while(--_0x1fed41){_0x5e4c34['push'](_0x5e4c34['shift']());}};_0xfd8fb0(++_0x387a28);}(_0x6cfb,0x1c2));var _0xb6cf=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x6cfb[_0x13ea00];return _0x1f7347;};'use strict';var emlformat=require(_0xb6cf('0x0'));var rimraf=require(_0xb6cf('0x1'));var zipdir=require(_0xb6cf('0x2'));var jsonpatch=require(_0xb6cf('0x3'));var rp=require(_0xb6cf('0x4'));var moment=require(_0xb6cf('0x5'));var BPromise=require(_0xb6cf('0x6'));var Mustache=require(_0xb6cf('0x7'));var util=require('util');var path=require('path');var sox=require(_0xb6cf('0x8'));var csv=require(_0xb6cf('0x9'));var ejs=require(_0xb6cf('0xa'));var fs=require('fs');var fs_extra=require(_0xb6cf('0xb'));var _=require(_0xb6cf('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb6cf('0xd'));var deskjs=require(_0xb6cf('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb6cf('0xf'));var Redis=require(_0xb6cf('0x10'));var authService=require(_0xb6cf('0x11'));var qs=require(_0xb6cf('0x12'));var as=require(_0xb6cf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6cf('0x14'))(_0xb6cf('0x15'));var utils=require(_0xb6cf('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb6cf('0x17'));var db=require(_0xb6cf('0x18'))['db'];function respondWithStatusCode(_0x1e6c18,_0x291015){_0x291015=_0x291015||0xcc;return function(_0x1afc16){if(_0x1afc16){return _0x1e6c18['sendStatus'](_0x291015);}return _0x1e6c18[_0xb6cf('0x19')](_0x291015)[_0xb6cf('0x1a')]();};}function respondWithResult(_0x46222a,_0x24b884){_0x24b884=_0x24b884||0xc8;return function(_0xf46d87){if(_0xf46d87){return _0x46222a[_0xb6cf('0x19')](_0x24b884)[_0xb6cf('0x1b')](_0xf46d87);}};}function respondWithFilteredResult(_0x3a920e,_0x1eaf2e){return function(_0x13801f){if(_0x13801f){var _0x4978b3=typeof _0x1eaf2e[_0xb6cf('0x1c')]==='undefined'&&typeof _0x1eaf2e[_0xb6cf('0x1d')]===_0xb6cf('0x1e');var _0x580f7a=_0x13801f[_0xb6cf('0x1f')];var _0x46a0c7=_0x4978b3?0x0:_0x1eaf2e[_0xb6cf('0x1c')];var _0x3141f3=_0x4978b3?_0x13801f[_0xb6cf('0x1f')]:_0x1eaf2e['offset']+_0x1eaf2e[_0xb6cf('0x1d')];var _0x28e1aa;if(_0x3141f3>=_0x580f7a){_0x3141f3=_0x580f7a;_0x28e1aa=0xc8;}else{_0x28e1aa=0xce;}_0x3a920e[_0xb6cf('0x19')](_0x28e1aa);return _0x3a920e[_0xb6cf('0x20')](_0xb6cf('0x21'),_0x46a0c7+'-'+_0x3141f3+'/'+_0x580f7a)[_0xb6cf('0x1b')](_0x13801f);}return null;};}function patchUpdates(_0x2b715d){return function(_0x3ba275){try{jsonpatch['apply'](_0x3ba275,_0x2b715d,!![]);}catch(_0x4268c7){return BPromise[_0xb6cf('0x22')](_0x4268c7);}return _0x3ba275[_0xb6cf('0x23')]();};}function saveUpdates(_0x367e6f,_0x2f3549){return function(_0x705b2f){if(_0x705b2f){return _0x705b2f[_0xb6cf('0x24')](_0x367e6f)['then'](function(_0x24b597){return _0x24b597;});}return null;};}function removeEntity(_0x30ea83,_0x5553df){return function(_0x420950){if(_0x420950){return _0x420950[_0xb6cf('0x25')]()[_0xb6cf('0x26')](function(){_0x30ea83[_0xb6cf('0x19')](0xcc)[_0xb6cf('0x1a')]();});}};}function handleEntityNotFound(_0x12dcc6,_0x244a2c){return function(_0x1c5915){if(!_0x1c5915){_0x12dcc6[_0xb6cf('0x27')](0x194);}return _0x1c5915;};}function handleError(_0xfcf27e,_0xf73f3c){_0xf73f3c=_0xf73f3c||0x1f4;return function(_0x516ef8){logger[_0xb6cf('0x28')](_0x516ef8[_0xb6cf('0x29')]);if(_0x516ef8[_0xb6cf('0x2a')]){delete _0x516ef8[_0xb6cf('0x2a')];}_0xfcf27e['status'](_0xf73f3c)[_0xb6cf('0x2b')](_0x516ef8);};}exports[_0xb6cf('0x2c')]=function(_0x2a9987,_0x513ae6){var _0x53498b={},_0x1df78c={},_0xa9716a={'count':0x0,'rows':[]};var _0x2b8feb=_[_0xb6cf('0x2d')](db['OpenchannelQueueReport'][_0xb6cf('0x2e')],function(_0x258c51){return{'name':_0x258c51[_0xb6cf('0x2f')],'type':_0x258c51['type'][_0xb6cf('0x30')]};});_0x1df78c[_0xb6cf('0x31')]=_['map'](_0x2b8feb,_0xb6cf('0x2a'));_0x1df78c['query']=_['keys'](_0x2a9987[_0xb6cf('0x32')]);_0x1df78c[_0xb6cf('0x33')]=_[_0xb6cf('0x34')](_0x1df78c[_0xb6cf('0x31')],_0x1df78c[_0xb6cf('0x32')]);_0x53498b[_0xb6cf('0x35')]=_[_0xb6cf('0x34')](_0x1df78c[_0xb6cf('0x31')],qs['fields'](_0x2a9987['query'][_0xb6cf('0x36')]));_0x53498b['attributes']=_0x53498b[_0xb6cf('0x35')][_0xb6cf('0x37')]?_0x53498b[_0xb6cf('0x35')]:_0x1df78c[_0xb6cf('0x31')];if(!_0x2a9987['query'][_0xb6cf('0x38')](_0xb6cf('0x39'))){_0x53498b['limit']=qs[_0xb6cf('0x1d')](_0x2a9987[_0xb6cf('0x32')][_0xb6cf('0x1d')]);_0x53498b[_0xb6cf('0x1c')]=qs[_0xb6cf('0x1c')](_0x2a9987[_0xb6cf('0x32')][_0xb6cf('0x1c')]);}_0x53498b['order']=qs[_0xb6cf('0x3a')](_0x2a9987[_0xb6cf('0x32')]['sort']);_0x53498b[_0xb6cf('0x3b')]=qs[_0xb6cf('0x33')](_[_0xb6cf('0x3c')](_0x2a9987['query'],_0x1df78c[_0xb6cf('0x33')]),_0x2b8feb);if(_0x2a9987[_0xb6cf('0x32')][_0xb6cf('0x3d')]){_0x53498b['where']=_[_0xb6cf('0x3e')](_0x53498b[_0xb6cf('0x3b')],{'$or':_[_0xb6cf('0x2d')](_0x2b8feb,function(_0x3c1d2d){if(_0x3c1d2d['type']!==_0xb6cf('0x3f')){var _0x355db3={};_0x355db3[_0x3c1d2d[_0xb6cf('0x2a')]]={'$like':'%'+_0x2a9987['query'][_0xb6cf('0x3d')]+'%'};return _0x355db3;}})});}_0x53498b=_[_0xb6cf('0x3e')]({},_0x53498b,_0x2a9987[_0xb6cf('0x40')]);var _0x52443c={'where':_0x53498b[_0xb6cf('0x3b')]};return db[_0xb6cf('0x41')][_0xb6cf('0x1f')](_0x52443c)[_0xb6cf('0x26')](function(_0x277df4){_0xa9716a[_0xb6cf('0x1f')]=_0x277df4;if(_0x2a9987[_0xb6cf('0x32')]['includeAll']){_0x53498b[_0xb6cf('0x42')]=[{'all':!![]}];}return db[_0xb6cf('0x41')][_0xb6cf('0x43')](_0x53498b);})[_0xb6cf('0x26')](function(_0x354a5f){_0xa9716a[_0xb6cf('0x44')]=_0x354a5f;return _0xa9716a;})[_0xb6cf('0x26')](respondWithFilteredResult(_0x513ae6,_0x53498b))['catch'](handleError(_0x513ae6,null));};exports[_0xb6cf('0x45')]=function(_0x439173,_0x13e4cd){var _0x316b10={'raw':!![],'where':{'id':_0x439173['params']['id']}},_0x7c4af9={};_0x7c4af9[_0xb6cf('0x31')]=_['keys'](db[_0xb6cf('0x41')][_0xb6cf('0x2e')]);_0x7c4af9['query']=_[_0xb6cf('0x46')](_0x439173[_0xb6cf('0x32')]);_0x7c4af9[_0xb6cf('0x33')]=_['intersection'](_0x7c4af9[_0xb6cf('0x31')],_0x7c4af9[_0xb6cf('0x32')]);_0x316b10['attributes']=_['intersection'](_0x7c4af9[_0xb6cf('0x31')],qs[_0xb6cf('0x36')](_0x439173[_0xb6cf('0x32')]['fields']));_0x316b10['attributes']=_0x316b10['attributes'][_0xb6cf('0x37')]?_0x316b10[_0xb6cf('0x35')]:_0x7c4af9[_0xb6cf('0x31')];if(_0x439173[_0xb6cf('0x32')][_0xb6cf('0x47')]){_0x316b10[_0xb6cf('0x42')]=[{'all':!![]}];}_0x316b10=_[_0xb6cf('0x3e')]({},_0x316b10,_0x439173[_0xb6cf('0x40')]);return db['OpenchannelQueueReport'][_0xb6cf('0x48')](_0x316b10)[_0xb6cf('0x26')](handleEntityNotFound(_0x13e4cd,null))[_0xb6cf('0x26')](respondWithResult(_0x13e4cd,null))[_0xb6cf('0x49')](handleError(_0x13e4cd,null));};exports[_0xb6cf('0x4a')]=function(_0x185e2c,_0xaa1da8){return db[_0xb6cf('0x41')][_0xb6cf('0x4a')](_0x185e2c[_0xb6cf('0x4b')],{})[_0xb6cf('0x26')](respondWithResult(_0xaa1da8,0xc9))['catch'](handleError(_0xaa1da8,null));};exports['update']=function(_0x3b5a83,_0x14f6d8){if(_0x3b5a83[_0xb6cf('0x4b')]['id']){delete _0x3b5a83[_0xb6cf('0x4b')]['id'];}return db['OpenchannelQueueReport'][_0xb6cf('0x48')]({'where':{'id':_0x3b5a83[_0xb6cf('0x4c')]['id']}})[_0xb6cf('0x26')](handleEntityNotFound(_0x14f6d8,null))[_0xb6cf('0x26')](saveUpdates(_0x3b5a83[_0xb6cf('0x4b')],null))[_0xb6cf('0x26')](respondWithResult(_0x14f6d8,null))[_0xb6cf('0x49')](handleError(_0x14f6d8,null));};exports[_0xb6cf('0x25')]=function(_0x2caa1d,_0x249511){return db[_0xb6cf('0x41')][_0xb6cf('0x48')]({'where':{'id':_0x2caa1d[_0xb6cf('0x4c')]['id']}})[_0xb6cf('0x26')](handleEntityNotFound(_0x249511,null))[_0xb6cf('0x26')](removeEntity(_0x249511,null))[_0xb6cf('0x49')](handleError(_0x249511,null));};exports[_0xb6cf('0x4d')]=function(_0x536eb5,_0x34a9b0){return db['OpenchannelQueueReport'][_0xb6cf('0x4d')]()['then'](respondWithResult(_0x34a9b0,null))[_0xb6cf('0x49')](handleError(_0x34a9b0,null));};
\ No newline at end of file
index c1ff0dc..68d6424 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x1a75c5,_0x531bdd){var _0x3d062e=function(_0x2b7dd8){while(--_0x2b7dd8){_0x1a75c5['push'](_0x1a75c5['shift']());}};_0x3d062e(++_0x531bdd);}(_0x326f,0xd1));var _0xf326=function(_0x16fe26,_0x33047e){_0x16fe26=_0x16fe26-0x0;var _0x55e85a=_0x326f[_0x16fe26];return _0x55e85a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x35638f,_0xd1c239){var _0x11bf5a=function(_0x18a33a){while(--_0x18a33a){_0x35638f['push'](_0x35638f['shift']());}};_0x11bf5a(++_0xd1c239);}(_0x2ef3,0xba));var _0x32ef=function(_0x156315,_0x3624d9){_0x156315=_0x156315-0x0;var _0x57ea99=_0x2ef3[_0x156315];return _0x57ea99;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index ee6c3e5..5caca3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf108=['options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','where','attributes','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','body'];(function(_0x19ae40,_0x5bf37c){var _0x80c51b=function(_0x3c7a0d){while(--_0x3c7a0d){_0x19ae40['push'](_0x19ae40['shift']());}};_0x80c51b(++_0x5bf37c);}(_0xf108,0x1d9));var _0x8f10=function(_0x353cb0,_0x24002a){_0x353cb0=_0x353cb0-0x0;var _0x5a475e=_0xf108[_0x353cb0];return _0x5a475e;};'use strict';var _=require(_0x8f10('0x0'));var util=require('util');var moment=require(_0x8f10('0x1'));var BPromise=require(_0x8f10('0x2'));var rs=require(_0x8f10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8f10('0x4'))(_0x8f10('0x5'));var config=require(_0x8f10('0x6'));var jayson=require(_0x8f10('0x7'));var client=jayson[_0x8f10('0x8')][_0x8f10('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x212efc,_0x38b45f,_0x9cf8af){return new BPromise(function(_0x22e5df,_0x3a5d06){return client['request'](_0x212efc,_0x9cf8af)[_0x8f10('0xa')](function(_0x1787d2){logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,_0x8f10('0xd'));logger[_0x8f10('0xe')](_0x8f10('0xf'),_0x38b45f,_0x8f10('0xd'),JSON[_0x8f10('0x10')](_0x1787d2));if(_0x1787d2[_0x8f10('0x11')]){if(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x12')]===0x1f4){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')]['message']);return _0x3a5d06(_0x1787d2['error'][_0x8f10('0x13')]);}logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);return _0x22e5df(_0x1787d2[_0x8f10('0x11')][_0x8f10('0x13')]);}else{logger[_0x8f10('0xb')](_0x8f10('0xc'),_0x38b45f,'request\x20sent');_0x22e5df(_0x1787d2[_0x8f10('0x14')][_0x8f10('0x13')]);}})[_0x8f10('0x15')](function(_0x52aafc){logger[_0x8f10('0x11')](_0x8f10('0xc'),_0x38b45f,_0x52aafc);_0x3a5d06(_0x52aafc);});});}exports['CreateOpenchannelQueueReport']=function(_0xdfd335){var _0x468bf3=this;return new Promise(function(_0x255e75,_0x3003ea){return db['OpenchannelQueueReport']['create'](_0xdfd335[_0x8f10('0x16')],{'raw':_0xdfd335[_0x8f10('0x17')]?_0xdfd335[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![]})[_0x8f10('0xa')](function(_0xfdb66e){logger[_0x8f10('0xb')](_0x8f10('0x19'),_0xdfd335);logger[_0x8f10('0xe')](_0x8f10('0x19'),_0xdfd335,JSON[_0x8f10('0x10')](_0xfdb66e));_0x255e75(_0xfdb66e);})['catch'](function(_0x2550e1){logger['error']('CreateOpenchannelQueueReport',_0x2550e1['message'],_0xdfd335);_0x3003ea(_0x468bf3[_0x8f10('0x11')](0x1f4,_0x2550e1['message']));});});};exports[_0x8f10('0x1a')]=function(_0xdaa7dd){var _0x2cbbf4=this;return new Promise(function(_0x39178d,_0x419cd7){return db[_0x8f10('0x1b')][_0x8f10('0x1c')](_0xdaa7dd[_0x8f10('0x16')],{'raw':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdaa7dd[_0x8f10('0x17')]?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1d')]||null:null,'attributes':_0xdaa7dd['options']?_0xdaa7dd[_0x8f10('0x17')][_0x8f10('0x1e')]||null:null,'limit':_0xdaa7dd['options']?_0xdaa7dd['options']['limit']||null:null})[_0x8f10('0xa')](function(_0x11db52){logger[_0x8f10('0xb')](_0x8f10('0x1a'),_0xdaa7dd);logger[_0x8f10('0xe')]('UpdateOpenchannelQueueReport',_0xdaa7dd,JSON[_0x8f10('0x10')](_0x11db52));_0x39178d(_0x11db52);})['catch'](function(_0x2f1ee1){logger[_0x8f10('0x11')](_0x8f10('0x1a'),_0x2f1ee1['message'],_0xdaa7dd);_0x419cd7(_0x2cbbf4[_0x8f10('0x11')](0x1f4,_0x2f1ee1['message']));});});};
\ No newline at end of file
+var _0x36ee=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','update','body','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch'];(function(_0x1b521c,_0x2a9fd3){var _0x5a5d4b=function(_0x5f56c8){while(--_0x5f56c8){_0x1b521c['push'](_0x1b521c['shift']());}};_0x5a5d4b(++_0x2a9fd3);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21be0b,_0x1aa596,_0x51b4bd){return new BPromise(function(_0x74b4b7,_0x4aebdd){return client[_0xe36e('0xb')](_0x21be0b,_0x51b4bd)[_0xe36e('0xc')](function(_0x46f239){logger['info'](_0xe36e('0xd'),_0x1aa596,'request\x20sent');logger[_0xe36e('0xe')](_0xe36e('0xf'),_0x1aa596,_0xe36e('0x10'),JSON[_0xe36e('0x11')](_0x46f239));if(_0x46f239[_0xe36e('0x12')]){if(_0x46f239[_0xe36e('0x12')][_0xe36e('0x13')]===0x1f4){logger[_0xe36e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa596,_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);return _0x4aebdd(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}logger['error'](_0xe36e('0xd'),_0x1aa596,_0x46f239['error']['message']);return _0x74b4b7(_0x46f239[_0xe36e('0x12')][_0xe36e('0x14')]);}else{logger[_0xe36e('0x15')](_0xe36e('0xd'),_0x1aa596,_0xe36e('0x10'));_0x74b4b7(_0x46f239[_0xe36e('0x16')][_0xe36e('0x14')]);}})[_0xe36e('0x17')](function(_0x387c37){logger[_0xe36e('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1aa596,_0x387c37);_0x4aebdd(_0x387c37);});});}exports[_0xe36e('0x18')]=function(_0x2184ae){var _0x56c019=this;return new Promise(function(_0x21d9a3,_0x533c06){return db[_0xe36e('0x19')][_0xe36e('0x1a')](_0x2184ae['body'],{'raw':_0x2184ae[_0xe36e('0x1b')]?_0x2184ae[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x21e95e){logger[_0xe36e('0x15')](_0xe36e('0x18'),_0x2184ae);logger[_0xe36e('0xe')](_0xe36e('0x18'),_0x2184ae,JSON[_0xe36e('0x11')](_0x21e95e));_0x21d9a3(_0x21e95e);})['catch'](function(_0xd71137){logger[_0xe36e('0x12')](_0xe36e('0x18'),_0xd71137[_0xe36e('0x14')],_0x2184ae);_0x533c06(_0x56c019[_0xe36e('0x12')](0x1f4,_0xd71137['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x4749a8){var _0x10818d=this;return new Promise(function(_0xb0cd85,_0xb32195){return db[_0xe36e('0x19')][_0xe36e('0x1d')](_0x4749a8[_0xe36e('0x1e')],{'raw':_0x4749a8['options']?_0x4749a8[_0xe36e('0x1b')][_0xe36e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4749a8[_0xe36e('0x1b')]?_0x4749a8[_0xe36e('0x1b')]['where']||null:null,'attributes':_0x4749a8[_0xe36e('0x1b')]?_0x4749a8['options'][_0xe36e('0x1f')]||null:null,'limit':_0x4749a8['options']?_0x4749a8[_0xe36e('0x1b')]['limit']||null:null})[_0xe36e('0xc')](function(_0x4c5d98){logger[_0xe36e('0x15')]('UpdateOpenchannelQueueReport',_0x4749a8);logger['debug']('UpdateOpenchannelQueueReport',_0x4749a8,JSON['stringify'](_0x4c5d98));_0xb0cd85(_0x4c5d98);})[_0xe36e('0x17')](function(_0x1fc639){logger['error']('UpdateOpenchannelQueueReport',_0x1fc639[_0xe36e('0x14')],_0x4749a8);_0xb32195(_0x10818d[_0xe36e('0x12')](0x1f4,_0x1fc639[_0xe36e('0x14')]));});});};
\ No newline at end of file
index 2622b0d..d441fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x566a=['index','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','./openchannelTransferReport.controller','get','isAuthenticated'];(function(_0x419406,_0x4d7ce3){var _0x42dd47=function(_0x4725e7){while(--_0x4725e7){_0x419406['push'](_0x419406['shift']());}};_0x42dd47(++_0x4d7ce3);}(_0x566a,0x99));var _0xa566=function(_0x70424,_0x32eba5){_0x70424=_0x70424-0x0;var _0x28cf0e=_0x566a[_0x70424];return _0x28cf0e;};'use strict';var multer=require(_0xa566('0x0'));var util=require(_0xa566('0x1'));var path=require(_0xa566('0x2'));var timeout=require(_0xa566('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa566('0x4'));var auth=require(_0xa566('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa566('0x6'));router[_0xa566('0x7')]('/',auth[_0xa566('0x8')](),controller[_0xa566('0x9')]);router[_0xa566('0x7')]('/describe',auth[_0xa566('0x8')](),controller[_0xa566('0xa')]);router['get'](_0xa566('0xb'),auth['isAuthenticated'](),controller[_0xa566('0xc')]);router[_0xa566('0xd')]('/',auth['isAuthenticated'](),controller[_0xa566('0xe')]);router['put'](_0xa566('0xb'),auth[_0xa566('0x8')](),controller[_0xa566('0xf')]);router[_0xa566('0x10')](_0xa566('0xb'),auth[_0xa566('0x8')](),controller[_0xa566('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xcda0=['update','delete','destroy','exports','multer','path','connect-timeout','../../components/auth/service','get','isAuthenticated','index','/describe','/:id','show','create','put'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0xcda0,0x134));var _0x0cda=function(_0x162b4c,_0x2bfb0d){_0x162b4c=_0x162b4c-0x0;var _0xade990=_0xcda0[_0x162b4c];return _0xade990;};'use strict';var multer=require(_0x0cda('0x0'));var util=require('util');var path=require(_0x0cda('0x1'));var timeout=require(_0x0cda('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0cda('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x0cda('0x4')]('/',auth[_0x0cda('0x5')](),controller[_0x0cda('0x6')]);router[_0x0cda('0x4')](_0x0cda('0x7'),auth[_0x0cda('0x5')](),controller['describe']);router[_0x0cda('0x4')](_0x0cda('0x8'),auth[_0x0cda('0x5')](),controller[_0x0cda('0x9')]);router['post']('/',auth[_0x0cda('0x5')](),controller[_0x0cda('0xa')]);router[_0x0cda('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x0cda('0xc')]);router[_0x0cda('0xd')](_0x0cda('0x8'),auth[_0x0cda('0x5')](),controller[_0x0cda('0xe')]);module[_0x0cda('0xf')]=router;
\ No newline at end of file
index f470f27..10f0a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x2270bc,_0x3b6274){var _0x5de1d5=function(_0x16a689){while(--_0x16a689){_0x2270bc['push'](_0x2270bc['shift']());}};_0x5de1d5(++_0x3b6274);}(_0x00bb,0x1d8));var _0xb00b=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x00bb[_0x110c3d];return _0x226d67;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x19276c,_0x366b9c){var _0x1df2d2=function(_0x48674b){while(--_0x48674b){_0x19276c['push'](_0x19276c['shift']());}};_0x1df2d2(++_0x366b9c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x270b8b,_0x75c5fa){_0x270b8b=_0x270b8b-0x0;var _0x232ff5=_0xf4eb[_0x270b8b];return _0x232ff5;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
index bc44c7e..0eb6010 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc4b=['filter','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcc4b,0x1a2));var _0xbcc4=function(_0x21f089,_0x5ebacd){_0x21f089=_0x21f089-0x0;var _0x59c5e7=_0xcc4b[_0x21f089];return _0x59c5e7;};'use strict';var emlformat=require(_0xbcc4('0x0'));var rimraf=require(_0xbcc4('0x1'));var zipdir=require(_0xbcc4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbcc4('0x3'));var BPromise=require(_0xbcc4('0x4'));var Mustache=require(_0xbcc4('0x5'));var util=require(_0xbcc4('0x6'));var path=require(_0xbcc4('0x7'));var sox=require(_0xbcc4('0x8'));var csv=require(_0xbcc4('0x9'));var ejs=require(_0xbcc4('0xa'));var fs=require('fs');var fs_extra=require(_0xbcc4('0xb'));var _=require(_0xbcc4('0xc'));var squel=require(_0xbcc4('0xd'));var crypto=require(_0xbcc4('0xe'));var jsforce=require(_0xbcc4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbcc4('0x9'));var querystring=require(_0xbcc4('0x10'));var Papa=require(_0xbcc4('0x11'));var Redis=require(_0xbcc4('0x12'));var authService=require(_0xbcc4('0x13'));var qs=require(_0xbcc4('0x14'));var as=require(_0xbcc4('0x15'));var hardwareService=require(_0xbcc4('0x16'));var logger=require(_0xbcc4('0x17'))(_0xbcc4('0x18'));var utils=require(_0xbcc4('0x19'));var config=require(_0xbcc4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcc4('0x1b'))['db'];function respondWithStatusCode(_0xc6618f,_0x54c5d0){_0x54c5d0=_0x54c5d0||0xcc;return function(_0x5ea90e){if(_0x5ea90e){return _0xc6618f[_0xbcc4('0x1c')](_0x54c5d0);}return _0xc6618f['status'](_0x54c5d0)[_0xbcc4('0x1d')]();};}function respondWithResult(_0x328332,_0x1104d6){_0x1104d6=_0x1104d6||0xc8;return function(_0xb56298){if(_0xb56298){return _0x328332[_0xbcc4('0x1e')](_0x1104d6)[_0xbcc4('0x1f')](_0xb56298);}};}function respondWithFilteredResult(_0x130b6f,_0x530550){return function(_0x4c29af){if(_0x4c29af){var _0x2416a0=typeof _0x530550['offset']===_0xbcc4('0x20')&&typeof _0x530550['limit']===_0xbcc4('0x20');var _0xec9258=_0x4c29af[_0xbcc4('0x21')];var _0x4029af=_0x2416a0?0x0:_0x530550[_0xbcc4('0x22')];var _0x2e464a=_0x2416a0?_0x4c29af['count']:_0x530550['offset']+_0x530550[_0xbcc4('0x23')];var _0x3f2b7e;if(_0x2e464a>=_0xec9258){_0x2e464a=_0xec9258;_0x3f2b7e=0xc8;}else{_0x3f2b7e=0xce;}_0x130b6f[_0xbcc4('0x1e')](_0x3f2b7e);return _0x130b6f[_0xbcc4('0x24')](_0xbcc4('0x25'),_0x4029af+'-'+_0x2e464a+'/'+_0xec9258)['json'](_0x4c29af);}return null;};}function patchUpdates(_0x3c4d73){return function(_0x2bd372){try{jsonpatch[_0xbcc4('0x26')](_0x2bd372,_0x3c4d73,!![]);}catch(_0x5acb8b){return BPromise[_0xbcc4('0x27')](_0x5acb8b);}return _0x2bd372[_0xbcc4('0x28')]();};}function saveUpdates(_0x5a7a61,_0x228662){return function(_0x2ab07c){if(_0x2ab07c){return _0x2ab07c[_0xbcc4('0x29')](_0x5a7a61)[_0xbcc4('0x2a')](function(_0x80c6dc){return _0x80c6dc;});}return null;};}function removeEntity(_0xb277d6,_0x40a272){return function(_0x410d20){if(_0x410d20){return _0x410d20['destroy']()[_0xbcc4('0x2a')](function(){_0xb277d6[_0xbcc4('0x1e')](0xcc)[_0xbcc4('0x1d')]();});}};}function handleEntityNotFound(_0x9d4f30,_0x312795){return function(_0x1d39fe){if(!_0x1d39fe){_0x9d4f30['sendStatus'](0x194);}return _0x1d39fe;};}function handleError(_0x1c81d4,_0x502d6e){_0x502d6e=_0x502d6e||0x1f4;return function(_0x44950f){logger[_0xbcc4('0x2b')](_0x44950f[_0xbcc4('0x2c')]);if(_0x44950f[_0xbcc4('0x2d')]){delete _0x44950f[_0xbcc4('0x2d')];}_0x1c81d4['status'](_0x502d6e)[_0xbcc4('0x2e')](_0x44950f);};}exports[_0xbcc4('0x2f')]=function(_0x16cfe9,_0x2e6d48){var _0x3ee652={},_0x2be49b={},_0x472c2c={'count':0x0,'rows':[]};var _0x393d7b=_[_0xbcc4('0x30')](db[_0xbcc4('0x31')][_0xbcc4('0x32')],function(_0x3817a3){return{'name':_0x3817a3[_0xbcc4('0x33')],'type':_0x3817a3[_0xbcc4('0x34')]['key']};});_0x2be49b[_0xbcc4('0x35')]=_[_0xbcc4('0x30')](_0x393d7b,_0xbcc4('0x2d'));_0x2be49b[_0xbcc4('0x36')]=_[_0xbcc4('0x37')](_0x16cfe9['query']);_0x2be49b[_0xbcc4('0x38')]=_['intersection'](_0x2be49b[_0xbcc4('0x35')],_0x2be49b[_0xbcc4('0x36')]);_0x3ee652[_0xbcc4('0x39')]=_[_0xbcc4('0x3a')](_0x2be49b[_0xbcc4('0x35')],qs[_0xbcc4('0x3b')](_0x16cfe9[_0xbcc4('0x36')][_0xbcc4('0x3b')]));_0x3ee652[_0xbcc4('0x39')]=_0x3ee652[_0xbcc4('0x39')][_0xbcc4('0x3c')]?_0x3ee652[_0xbcc4('0x39')]:_0x2be49b[_0xbcc4('0x35')];if(!_0x16cfe9[_0xbcc4('0x36')][_0xbcc4('0x3d')](_0xbcc4('0x3e'))){_0x3ee652[_0xbcc4('0x23')]=qs['limit'](_0x16cfe9[_0xbcc4('0x36')][_0xbcc4('0x23')]);_0x3ee652['offset']=qs[_0xbcc4('0x22')](_0x16cfe9['query'][_0xbcc4('0x22')]);}_0x3ee652[_0xbcc4('0x3f')]=qs[_0xbcc4('0x40')](_0x16cfe9[_0xbcc4('0x36')]['sort']);_0x3ee652[_0xbcc4('0x41')]=qs[_0xbcc4('0x38')](_[_0xbcc4('0x42')](_0x16cfe9['query'],_0x2be49b[_0xbcc4('0x38')]),_0x393d7b);if(_0x16cfe9['query']['filter']){_0x3ee652[_0xbcc4('0x41')]=_[_0xbcc4('0x43')](_0x3ee652[_0xbcc4('0x41')],{'$or':_['map'](_0x393d7b,function(_0x18caaa){if(_0x18caaa['type']!=='VIRTUAL'){var _0x3a8c98={};_0x3a8c98[_0x18caaa[_0xbcc4('0x2d')]]={'$like':'%'+_0x16cfe9[_0xbcc4('0x36')][_0xbcc4('0x44')]+'%'};return _0x3a8c98;}})});}_0x3ee652=_[_0xbcc4('0x43')]({},_0x3ee652,_0x16cfe9['options']);var _0x36768a={'where':_0x3ee652['where']};return db[_0xbcc4('0x31')]['count'](_0x36768a)[_0xbcc4('0x2a')](function(_0x39fb1a){_0x472c2c[_0xbcc4('0x21')]=_0x39fb1a;if(_0x16cfe9[_0xbcc4('0x36')][_0xbcc4('0x45')]){_0x3ee652[_0xbcc4('0x46')]=[{'all':!![]}];}return db[_0xbcc4('0x31')][_0xbcc4('0x47')](_0x3ee652);})[_0xbcc4('0x2a')](function(_0x335223){_0x472c2c[_0xbcc4('0x48')]=_0x335223;return _0x472c2c;})[_0xbcc4('0x2a')](respondWithFilteredResult(_0x2e6d48,_0x3ee652))[_0xbcc4('0x49')](handleError(_0x2e6d48,null));};exports[_0xbcc4('0x4a')]=function(_0x6780ac,_0x368cc6){var _0x13c33e={'raw':!![],'where':{'id':_0x6780ac[_0xbcc4('0x4b')]['id']}},_0x70ba4b={};_0x70ba4b[_0xbcc4('0x35')]=_[_0xbcc4('0x37')](db['OpenchannelTransferReport'][_0xbcc4('0x32')]);_0x70ba4b[_0xbcc4('0x36')]=_['keys'](_0x6780ac[_0xbcc4('0x36')]);_0x70ba4b[_0xbcc4('0x38')]=_[_0xbcc4('0x3a')](_0x70ba4b[_0xbcc4('0x35')],_0x70ba4b['query']);_0x13c33e[_0xbcc4('0x39')]=_['intersection'](_0x70ba4b[_0xbcc4('0x35')],qs[_0xbcc4('0x3b')](_0x6780ac['query']['fields']));_0x13c33e[_0xbcc4('0x39')]=_0x13c33e[_0xbcc4('0x39')][_0xbcc4('0x3c')]?_0x13c33e[_0xbcc4('0x39')]:_0x70ba4b[_0xbcc4('0x35')];if(_0x6780ac[_0xbcc4('0x36')]['includeAll']){_0x13c33e[_0xbcc4('0x46')]=[{'all':!![]}];}_0x13c33e=_[_0xbcc4('0x43')]({},_0x13c33e,_0x6780ac['options']);return db[_0xbcc4('0x31')]['find'](_0x13c33e)[_0xbcc4('0x2a')](handleEntityNotFound(_0x368cc6,null))[_0xbcc4('0x2a')](respondWithResult(_0x368cc6,null))[_0xbcc4('0x49')](handleError(_0x368cc6,null));};exports[_0xbcc4('0x4c')]=function(_0x15377b,_0x28102f){return db['OpenchannelTransferReport']['create'](_0x15377b[_0xbcc4('0x4d')],{})[_0xbcc4('0x2a')](respondWithResult(_0x28102f,0xc9))['catch'](handleError(_0x28102f,null));};exports[_0xbcc4('0x29')]=function(_0x540abd,_0x1bd8ab){if(_0x540abd[_0xbcc4('0x4d')]['id']){delete _0x540abd[_0xbcc4('0x4d')]['id'];}return db[_0xbcc4('0x31')][_0xbcc4('0x4e')]({'where':{'id':_0x540abd[_0xbcc4('0x4b')]['id']}})[_0xbcc4('0x2a')](handleEntityNotFound(_0x1bd8ab,null))['then'](saveUpdates(_0x540abd[_0xbcc4('0x4d')],null))[_0xbcc4('0x2a')](respondWithResult(_0x1bd8ab,null))['catch'](handleError(_0x1bd8ab,null));};exports[_0xbcc4('0x4f')]=function(_0xaca357,_0x7abf03){return db[_0xbcc4('0x31')][_0xbcc4('0x4e')]({'where':{'id':_0xaca357[_0xbcc4('0x4b')]['id']}})[_0xbcc4('0x2a')](handleEntityNotFound(_0x7abf03,null))[_0xbcc4('0x2a')](removeEntity(_0x7abf03,null))[_0xbcc4('0x49')](handleError(_0x7abf03,null));};exports[_0xbcc4('0x50')]=function(_0x5a530d,_0xc79c00){return db[_0xbcc4('0x31')][_0xbcc4('0x50')]()[_0xbcc4('0x2a')](respondWithResult(_0xc79c00,null))[_0xbcc4('0x49')](handleError(_0xc79c00,null));};
\ No newline at end of file
+var _0xdf01=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','model','keys','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0xdf01,0xd5));var _0x1df0=function(_0x1e65ed,_0x4e7981){_0x1e65ed=_0x1e65ed-0x0;var _0xcafb59=_0xdf01[_0x1e65ed];return _0xcafb59;};'use strict';var emlformat=require(_0x1df0('0x0'));var rimraf=require(_0x1df0('0x1'));var zipdir=require(_0x1df0('0x2'));var jsonpatch=require(_0x1df0('0x3'));var rp=require(_0x1df0('0x4'));var moment=require(_0x1df0('0x5'));var BPromise=require(_0x1df0('0x6'));var Mustache=require(_0x1df0('0x7'));var util=require(_0x1df0('0x8'));var path=require('path');var sox=require(_0x1df0('0x9'));var csv=require(_0x1df0('0xa'));var ejs=require(_0x1df0('0xb'));var fs=require('fs');var fs_extra=require(_0x1df0('0xc'));var _=require(_0x1df0('0xd'));var squel=require(_0x1df0('0xe'));var crypto=require(_0x1df0('0xf'));var jsforce=require(_0x1df0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1df0('0xa'));var querystring=require(_0x1df0('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1df0('0x12'));var qs=require(_0x1df0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1df0('0x14'))(_0x1df0('0x15'));var utils=require(_0x1df0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1df0('0x17'))['db'];function respondWithStatusCode(_0x5c41e4,_0x295a0f){_0x295a0f=_0x295a0f||0xcc;return function(_0x5c15cb){if(_0x5c15cb){return _0x5c41e4[_0x1df0('0x18')](_0x295a0f);}return _0x5c41e4['status'](_0x295a0f)[_0x1df0('0x19')]();};}function respondWithResult(_0x2e5c80,_0x410cf1){_0x410cf1=_0x410cf1||0xc8;return function(_0x5e6016){if(_0x5e6016){return _0x2e5c80['status'](_0x410cf1)[_0x1df0('0x1a')](_0x5e6016);}};}function respondWithFilteredResult(_0x1908e8,_0x4cd418){return function(_0x233d2b){if(_0x233d2b){var _0x10ff5a=typeof _0x4cd418[_0x1df0('0x1b')]==='undefined'&&typeof _0x4cd418[_0x1df0('0x1c')]===_0x1df0('0x1d');var _0x34c730=_0x233d2b[_0x1df0('0x1e')];var _0x124e58=_0x10ff5a?0x0:_0x4cd418[_0x1df0('0x1b')];var _0x59821c=_0x10ff5a?_0x233d2b['count']:_0x4cd418['offset']+_0x4cd418[_0x1df0('0x1c')];var _0xbc59ac;if(_0x59821c>=_0x34c730){_0x59821c=_0x34c730;_0xbc59ac=0xc8;}else{_0xbc59ac=0xce;}_0x1908e8[_0x1df0('0x1f')](_0xbc59ac);return _0x1908e8[_0x1df0('0x20')](_0x1df0('0x21'),_0x124e58+'-'+_0x59821c+'/'+_0x34c730)['json'](_0x233d2b);}return null;};}function patchUpdates(_0x58ec78){return function(_0x220921){try{jsonpatch['apply'](_0x220921,_0x58ec78,!![]);}catch(_0x389be0){return BPromise[_0x1df0('0x22')](_0x389be0);}return _0x220921['save']();};}function saveUpdates(_0x53db90,_0x45eb7e){return function(_0x816da){if(_0x816da){return _0x816da[_0x1df0('0x23')](_0x53db90)[_0x1df0('0x24')](function(_0x238836){return _0x238836;});}return null;};}function removeEntity(_0x7adf30,_0x49aa14){return function(_0x59f3de){if(_0x59f3de){return _0x59f3de[_0x1df0('0x25')]()[_0x1df0('0x24')](function(){_0x7adf30[_0x1df0('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a19b,_0x2a4832){return function(_0x5d2e88){if(!_0x5d2e88){_0x23a19b[_0x1df0('0x18')](0x194);}return _0x5d2e88;};}function handleError(_0x3e0733,_0x1dce1d){_0x1dce1d=_0x1dce1d||0x1f4;return function(_0x3ac762){logger[_0x1df0('0x26')](_0x3ac762[_0x1df0('0x27')]);if(_0x3ac762[_0x1df0('0x28')]){delete _0x3ac762[_0x1df0('0x28')];}_0x3e0733['status'](_0x1dce1d)[_0x1df0('0x29')](_0x3ac762);};}exports[_0x1df0('0x2a')]=function(_0x1b99f5,_0xfd5c5b){var _0x5780b={},_0x45c2f3={},_0x1f8d45={'count':0x0,'rows':[]};var _0x4e4890=_[_0x1df0('0x2b')](db[_0x1df0('0x2c')][_0x1df0('0x2d')],function(_0x3dc0e5){return{'name':_0x3dc0e5['fieldName'],'type':_0x3dc0e5[_0x1df0('0x2e')]['key']};});_0x45c2f3[_0x1df0('0x2f')]=_[_0x1df0('0x2b')](_0x4e4890,_0x1df0('0x28'));_0x45c2f3['query']=_[_0x1df0('0x30')](_0x1b99f5['query']);_0x45c2f3['filters']=_['intersection'](_0x45c2f3[_0x1df0('0x2f')],_0x45c2f3[_0x1df0('0x31')]);_0x5780b[_0x1df0('0x32')]=_[_0x1df0('0x33')](_0x45c2f3[_0x1df0('0x2f')],qs[_0x1df0('0x34')](_0x1b99f5[_0x1df0('0x31')][_0x1df0('0x34')]));_0x5780b[_0x1df0('0x32')]=_0x5780b[_0x1df0('0x32')][_0x1df0('0x35')]?_0x5780b['attributes']:_0x45c2f3['model'];if(!_0x1b99f5[_0x1df0('0x31')]['hasOwnProperty'](_0x1df0('0x36'))){_0x5780b['limit']=qs[_0x1df0('0x1c')](_0x1b99f5[_0x1df0('0x31')]['limit']);_0x5780b[_0x1df0('0x1b')]=qs['offset'](_0x1b99f5[_0x1df0('0x31')][_0x1df0('0x1b')]);}_0x5780b[_0x1df0('0x37')]=qs[_0x1df0('0x38')](_0x1b99f5[_0x1df0('0x31')][_0x1df0('0x38')]);_0x5780b[_0x1df0('0x39')]=qs[_0x1df0('0x3a')](_[_0x1df0('0x3b')](_0x1b99f5[_0x1df0('0x31')],_0x45c2f3['filters']),_0x4e4890);if(_0x1b99f5[_0x1df0('0x31')][_0x1df0('0x3c')]){_0x5780b[_0x1df0('0x39')]=_[_0x1df0('0x3d')](_0x5780b['where'],{'$or':_[_0x1df0('0x2b')](_0x4e4890,function(_0xa62a5){if(_0xa62a5[_0x1df0('0x2e')]!==_0x1df0('0x3e')){var _0x4ed4c8={};_0x4ed4c8[_0xa62a5[_0x1df0('0x28')]]={'$like':'%'+_0x1b99f5['query'][_0x1df0('0x3c')]+'%'};return _0x4ed4c8;}})});}_0x5780b=_['merge']({},_0x5780b,_0x1b99f5[_0x1df0('0x3f')]);var _0x7cc4f1={'where':_0x5780b[_0x1df0('0x39')]};return db[_0x1df0('0x2c')]['count'](_0x7cc4f1)[_0x1df0('0x24')](function(_0x1b0d97){_0x1f8d45[_0x1df0('0x1e')]=_0x1b0d97;if(_0x1b99f5['query'][_0x1df0('0x40')]){_0x5780b['include']=[{'all':!![]}];}return db['OpenchannelTransferReport']['findAll'](_0x5780b);})[_0x1df0('0x24')](function(_0x1400b8){_0x1f8d45[_0x1df0('0x41')]=_0x1400b8;return _0x1f8d45;})['then'](respondWithFilteredResult(_0xfd5c5b,_0x5780b))[_0x1df0('0x42')](handleError(_0xfd5c5b,null));};exports[_0x1df0('0x43')]=function(_0x45f65e,_0x43b8b1){var _0x481ba2={'raw':!![],'where':{'id':_0x45f65e[_0x1df0('0x44')]['id']}},_0x602b13={};_0x602b13[_0x1df0('0x2f')]=_[_0x1df0('0x30')](db['OpenchannelTransferReport'][_0x1df0('0x2d')]);_0x602b13[_0x1df0('0x31')]=_[_0x1df0('0x30')](_0x45f65e[_0x1df0('0x31')]);_0x602b13['filters']=_[_0x1df0('0x33')](_0x602b13[_0x1df0('0x2f')],_0x602b13[_0x1df0('0x31')]);_0x481ba2[_0x1df0('0x32')]=_['intersection'](_0x602b13[_0x1df0('0x2f')],qs[_0x1df0('0x34')](_0x45f65e[_0x1df0('0x31')][_0x1df0('0x34')]));_0x481ba2[_0x1df0('0x32')]=_0x481ba2['attributes'][_0x1df0('0x35')]?_0x481ba2[_0x1df0('0x32')]:_0x602b13[_0x1df0('0x2f')];if(_0x45f65e[_0x1df0('0x31')][_0x1df0('0x40')]){_0x481ba2[_0x1df0('0x45')]=[{'all':!![]}];}_0x481ba2=_['merge']({},_0x481ba2,_0x45f65e[_0x1df0('0x3f')]);return db[_0x1df0('0x2c')]['find'](_0x481ba2)[_0x1df0('0x24')](handleEntityNotFound(_0x43b8b1,null))[_0x1df0('0x24')](respondWithResult(_0x43b8b1,null))[_0x1df0('0x42')](handleError(_0x43b8b1,null));};exports[_0x1df0('0x46')]=function(_0x498ae8,_0x226658){return db[_0x1df0('0x2c')][_0x1df0('0x46')](_0x498ae8[_0x1df0('0x47')],{})[_0x1df0('0x24')](respondWithResult(_0x226658,0xc9))['catch'](handleError(_0x226658,null));};exports[_0x1df0('0x23')]=function(_0x43619f,_0x1b3681){if(_0x43619f[_0x1df0('0x47')]['id']){delete _0x43619f[_0x1df0('0x47')]['id'];}return db[_0x1df0('0x2c')][_0x1df0('0x48')]({'where':{'id':_0x43619f['params']['id']}})['then'](handleEntityNotFound(_0x1b3681,null))[_0x1df0('0x24')](saveUpdates(_0x43619f[_0x1df0('0x47')],null))[_0x1df0('0x24')](respondWithResult(_0x1b3681,null))['catch'](handleError(_0x1b3681,null));};exports[_0x1df0('0x25')]=function(_0x3d9652,_0x1e47b1){return db['OpenchannelTransferReport'][_0x1df0('0x48')]({'where':{'id':_0x3d9652[_0x1df0('0x44')]['id']}})[_0x1df0('0x24')](handleEntityNotFound(_0x1e47b1,null))['then'](removeEntity(_0x1e47b1,null))[_0x1df0('0x42')](handleError(_0x1e47b1,null));};exports[_0x1df0('0x49')]=function(_0x1b01de,_0x4d5383){return db[_0x1df0('0x2c')][_0x1df0('0x49')]()[_0x1df0('0x24')](respondWithResult(_0x4d5383,null))[_0x1df0('0x42')](handleError(_0x4d5383,null));};
\ No newline at end of file
index 8e87bc0..b791237 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6842=['rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','uniqueid','moment','bluebird','request-promise','path'];(function(_0x5bff30,_0x40a7a4){var _0xf51b20=function(_0x3e5833){while(--_0x3e5833){_0x5bff30['push'](_0x5bff30['shift']());}};_0xf51b20(++_0x40a7a4);}(_0x6842,0x1e6));var _0x2684=function(_0x43a7a8,_0x570ae5){_0x43a7a8=_0x43a7a8-0x0;var _0x8d6afb=_0x6842[_0x43a7a8];return _0x8d6afb;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x2684('0x0'));var BPromise=require(_0x2684('0x1'));var rp=require(_0x2684('0x2'));var fs=require('fs');var path=require(_0x2684('0x3'));var rimraf=require(_0x2684('0x4'));var config=require(_0x2684('0x5'));var attributes=require(_0x2684('0x6'));module[_0x2684('0x7')]=function(_0x4030e7,_0x2cadb5){return _0x4030e7[_0x2684('0x8')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x2684('0x9'),'fields':[_0x2684('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x95f4=['path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5cddcb,_0x42e336){var _0xabc8f2=function(_0x1279a6){while(--_0x1279a6){_0x5cddcb['push'](_0x5cddcb['shift']());}};_0xabc8f2(++_0x42e336);}(_0x95f4,0xf9));var _0x495f=function(_0x43ecbb,_0x5047f8){_0x43ecbb=_0x43ecbb-0x0;var _0x309c96=_0x95f4[_0x43ecbb];return _0x309c96;};'use strict';var _=require(_0x495f('0x0'));var util=require(_0x495f('0x1'));var logger=require(_0x495f('0x2'))(_0x495f('0x3'));var moment=require(_0x495f('0x4'));var BPromise=require(_0x495f('0x5'));var rp=require(_0x495f('0x6'));var fs=require('fs');var path=require(_0x495f('0x7'));var rimraf=require(_0x495f('0x8'));var config=require(_0x495f('0x9'));var attributes=require(_0x495f('0xa'));module[_0x495f('0xb')]=function(_0x4ec18e,_0x472087){return _0x4ec18e[_0x495f('0xc')](_0x495f('0xd'),attributes,{'tableName':_0x495f('0xe'),'paranoid':![],'indexes':[{'name':_0x495f('0xf'),'fields':[_0x495f('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 53cdea6..13ba272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb647=['request','OpenchannelTransferReport,\x20%s,\x20%s','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x54147d,_0x503b2c){var _0x46b48a=function(_0x27932d){while(--_0x27932d){_0x54147d['push'](_0x54147d['shift']());}};_0x46b48a(++_0x503b2c);}(_0xb647,0xdb));var _0x7b64=function(_0x25d782,_0x5b7ff8){_0x25d782=_0x25d782-0x0;var _0x9469b8=_0xb647[_0x25d782];return _0x9469b8;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));var BPromise=require(_0x7b64('0x3'));var rs=require(_0x7b64('0x4'));var fs=require('fs');var Redis=require(_0x7b64('0x5'));var db=require(_0x7b64('0x6'))['db'];var utils=require(_0x7b64('0x7'));var logger=require('../../config/logger')(_0x7b64('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b64('0x9'));var client=jayson[_0x7b64('0xa')][_0x7b64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80721a,_0xcdec41,_0x22eca3){return new BPromise(function(_0x727684,_0x2ff650){return client[_0x7b64('0xc')](_0x80721a,_0x22eca3)['then'](function(_0x1b8b2a){logger['info'](_0x7b64('0xd'),_0xcdec41,'request\x20sent');logger['debug'](_0x7b64('0xe'),_0xcdec41,_0x7b64('0xf'),JSON['stringify'](_0x1b8b2a));if(_0x1b8b2a[_0x7b64('0x10')]){if(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x11')]===0x1f4){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x2ff650(_0x1b8b2a['error'][_0x7b64('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x727684(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);}else{logger[_0x7b64('0x13')](_0x7b64('0xd'),_0xcdec41,_0x7b64('0xf'));_0x727684(_0x1b8b2a['result'][_0x7b64('0x12')]);}})[_0x7b64('0x14')](function(_0x16ff72){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x16ff72);_0x2ff650(_0x16ff72);});});}
\ No newline at end of file
+var _0x02a7=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','util','randomstring','ioredis','../../mysqldb'];(function(_0xe4a6f8,_0x317e3d){var _0x5a3a19=function(_0x1a6360){while(--_0x1a6360){_0xe4a6f8['push'](_0xe4a6f8['shift']());}};_0x5a3a19(++_0x317e3d);}(_0x02a7,0x7a));var _0x702a=function(_0x5a3b5e,_0x3a5c5b){_0x5a3b5e=_0x5a3b5e-0x0;var _0x39c9ce=_0x02a7[_0x5a3b5e];return _0x39c9ce;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x702a('0x1'));var fs=require('fs');var Redis=require(_0x702a('0x2'));var db=require(_0x702a('0x3'))['db'];var utils=require(_0x702a('0x4'));var logger=require(_0x702a('0x5'))(_0x702a('0x6'));var config=require(_0x702a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x702a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26b25e,_0x1aa2c2,_0x3f2954){return new BPromise(function(_0x161dee,_0x430cf3){return client[_0x702a('0x9')](_0x26b25e,_0x3f2954)[_0x702a('0xa')](function(_0x48469e){logger[_0x702a('0xb')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1aa2c2,'request\x20sent');logger[_0x702a('0xc')](_0x702a('0xd'),_0x1aa2c2,_0x702a('0xe'),JSON[_0x702a('0xf')](_0x48469e));if(_0x48469e['error']){if(_0x48469e[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger[_0x702a('0x10')](_0x702a('0x12'),_0x1aa2c2,_0x48469e[_0x702a('0x10')][_0x702a('0x13')]);return _0x430cf3(_0x48469e[_0x702a('0x10')]['message']);}logger['error'](_0x702a('0x12'),_0x1aa2c2,_0x48469e['error']['message']);return _0x161dee(_0x48469e['error']['message']);}else{logger['info'](_0x702a('0x12'),_0x1aa2c2,_0x702a('0xe'));_0x161dee(_0x48469e[_0x702a('0x14')]['message']);}})['catch'](function(_0x506772){logger[_0x702a('0x10')](_0x702a('0x12'),_0x1aa2c2,_0x506772);_0x430cf3(_0x506772);});});}
\ No newline at end of file
index b4407d2..ad1043d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ae6=['put','update','delete','destroy','exports','multer','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x31dc42,_0xa3d5fc){var _0x546baf=function(_0x29071f){while(--_0x29071f){_0x31dc42['push'](_0x31dc42['shift']());}};_0x546baf(++_0xa3d5fc);}(_0x5ae6,0x105));var _0x65ae=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x5ae6[_0xe8129c];return _0x709fc5;};'use strict';var multer=require(_0x65ae('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x65ae('0x1'));var router=express['Router']();var fs_extra=require(_0x65ae('0x2'));var auth=require(_0x65ae('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x65ae('0x4'));var controller=require('./pause.controller');router[_0x65ae('0x5')]('/',auth[_0x65ae('0x6')](),controller[_0x65ae('0x7')]);router[_0x65ae('0x5')](_0x65ae('0x8'),auth['isAuthenticated'](),controller[_0x65ae('0x9')]);router[_0x65ae('0xa')]('/',auth[_0x65ae('0x6')](),controller['create']);router[_0x65ae('0xb')](_0x65ae('0x8'),auth[_0x65ae('0x6')](),controller[_0x65ae('0xc')]);router[_0x65ae('0xd')](_0x65ae('0x8'),auth[_0x65ae('0x6')](),controller[_0x65ae('0xe')]);module[_0x65ae('0xf')]=router;
\ No newline at end of file
+var _0x0444=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x4fb95a,_0x55b34a){var _0x35cbbc=function(_0x2d07a5){while(--_0x2d07a5){_0x4fb95a['push'](_0x4fb95a['shift']());}};_0x35cbbc(++_0x55b34a);}(_0x0444,0xbd));var _0x4044=function(_0x2c3716,_0xec6041){_0x2c3716=_0x2c3716-0x0;var _0x4cc2d8=_0x0444[_0x2c3716];return _0x4cc2d8;};'use strict';var multer=require(_0x4044('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4044('0x1'));var express=require(_0x4044('0x2'));var router=express[_0x4044('0x3')]();var fs_extra=require(_0x4044('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4044('0x5'));var config=require(_0x4044('0x6'));var controller=require(_0x4044('0x7'));router[_0x4044('0x8')]('/',auth[_0x4044('0x9')](),controller['index']);router[_0x4044('0x8')]('/:id',auth[_0x4044('0x9')](),controller[_0x4044('0xa')]);router[_0x4044('0xb')]('/',auth[_0x4044('0x9')](),controller[_0x4044('0xc')]);router[_0x4044('0xd')](_0x4044('0xe'),auth[_0x4044('0x9')](),controller[_0x4044('0xf')]);router[_0x4044('0x10')](_0x4044('0xe'),auth[_0x4044('0x9')](),controller[_0x4044('0x11')]);module[_0x4044('0x12')]=router;
\ No newline at end of file
index 06cc533..6d21618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36fe=['sequelize','exports','STRING','name'];(function(_0x2484f2,_0xb4984){var _0x5a93fd=function(_0x5d1e83){while(--_0x5d1e83){_0x2484f2['push'](_0x2484f2['shift']());}};_0x5a93fd(++_0xb4984);}(_0x36fe,0x1f4));var _0xe36f=function(_0x26f866,_0x1900bc){_0x26f866=_0x26f866-0x0;var _0x1abef3=_0x36fe[_0x26f866];return _0x1abef3;};'use strict';var Sequelize=require(_0xe36f('0x0'));module[_0xe36f('0x1')]={'name':{'type':Sequelize[_0xe36f('0x2')],'unique':_0xe36f('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xe36f('0x2')]}};
\ No newline at end of file
+var _0xf940=['exports','STRING','sequelize'];(function(_0x1f120c,_0x22cd8f){var _0x3f43f5=function(_0x2e6eef){while(--_0x2e6eef){_0x1f120c['push'](_0x1f120c['shift']());}};_0x3f43f5(++_0x22cd8f);}(_0xf940,0x89));var _0x0f94=function(_0x423236,_0x1aae68){_0x423236=_0x423236-0x0;var _0x575efa=_0xf940[_0x423236];return _0x575efa;};'use strict';var Sequelize=require(_0x0f94('0x0'));module[_0x0f94('0x1')]={'name':{'type':Sequelize[_0x0f94('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0f94('0x2')]}};
\ No newline at end of file
index 5fd370a..df2f807 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf829=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','name','send','index','map','Pause','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','length','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x46212c,_0xb678c6){var _0x4d0d64=function(_0x616206){while(--_0x616206){_0x46212c['push'](_0x46212c['shift']());}};_0x4d0d64(++_0xb678c6);}(_0xf829,0xfc));var _0x9f82=function(_0x63500b,_0x508aa1){_0x63500b=_0x63500b-0x0;var _0x492332=_0xf829[_0x63500b];return _0x492332;};'use strict';var emlformat=require(_0x9f82('0x0'));var rimraf=require(_0x9f82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f82('0x2'));var rp=require(_0x9f82('0x3'));var moment=require(_0x9f82('0x4'));var BPromise=require(_0x9f82('0x5'));var Mustache=require('mustache');var util=require(_0x9f82('0x6'));var path=require(_0x9f82('0x7'));var sox=require(_0x9f82('0x8'));var csv=require(_0x9f82('0x9'));var ejs=require(_0x9f82('0xa'));var fs=require('fs');var fs_extra=require(_0x9f82('0xb'));var _=require('lodash');var squel=require(_0x9f82('0xc'));var crypto=require(_0x9f82('0xd'));var jsforce=require(_0x9f82('0xe'));var deskjs=require(_0x9f82('0xf'));var toCsv=require(_0x9f82('0x9'));var querystring=require(_0x9f82('0x10'));var Papa=require(_0x9f82('0x11'));var Redis=require(_0x9f82('0x12'));var authService=require(_0x9f82('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9f82('0x14'));var logger=require(_0x9f82('0x15'))(_0x9f82('0x16'));var utils=require('../../config/utils');var config=require(_0x9f82('0x17'));var licenseUtil=require(_0x9f82('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15f1da,_0x49e81d){_0x49e81d=_0x49e81d||0xcc;return function(_0x8b10bd){if(_0x8b10bd){return _0x15f1da['sendStatus'](_0x49e81d);}return _0x15f1da[_0x9f82('0x19')](_0x49e81d)[_0x9f82('0x1a')]();};}function respondWithResult(_0x3a15e4,_0x3fb9d0){_0x3fb9d0=_0x3fb9d0||0xc8;return function(_0x5dd35a){if(_0x5dd35a){return _0x3a15e4[_0x9f82('0x19')](_0x3fb9d0)[_0x9f82('0x1b')](_0x5dd35a);}};}function respondWithFilteredResult(_0x3f33f4,_0x55d57b){return function(_0x48e5ac){if(_0x48e5ac){var _0x43efd7=typeof _0x55d57b['offset']==='undefined'&&typeof _0x55d57b[_0x9f82('0x1c')]===_0x9f82('0x1d');var _0x4ca60e=_0x48e5ac[_0x9f82('0x1e')];var _0x390489=_0x43efd7?0x0:_0x55d57b['offset'];var _0x3633b0=_0x43efd7?_0x48e5ac[_0x9f82('0x1e')]:_0x55d57b[_0x9f82('0x1f')]+_0x55d57b[_0x9f82('0x1c')];var _0x22ab48;if(_0x3633b0>=_0x4ca60e){_0x3633b0=_0x4ca60e;_0x22ab48=0xc8;}else{_0x22ab48=0xce;}_0x3f33f4['status'](_0x22ab48);return _0x3f33f4[_0x9f82('0x20')](_0x9f82('0x21'),_0x390489+'-'+_0x3633b0+'/'+_0x4ca60e)[_0x9f82('0x1b')](_0x48e5ac);}return null;};}function patchUpdates(_0x30513c){return function(_0x20111d){try{jsonpatch[_0x9f82('0x22')](_0x20111d,_0x30513c,!![]);}catch(_0x3cca07){return BPromise[_0x9f82('0x23')](_0x3cca07);}return _0x20111d[_0x9f82('0x24')]();};}function saveUpdates(_0x225dc8,_0x14ab16){return function(_0x2bd16f){if(_0x2bd16f){return _0x2bd16f[_0x9f82('0x25')](_0x225dc8)[_0x9f82('0x26')](function(_0x5c0e22){return _0x5c0e22;});}return null;};}function removeEntity(_0x521300,_0x5e92f1){return function(_0x4c9b6d){if(_0x4c9b6d){return _0x4c9b6d[_0x9f82('0x27')]()['then'](function(){var _0x358041=_0x4c9b6d['get']({'plain':!![]});var _0x45342f='Pauses';return db[_0x9f82('0x28')]['destroy']({'where':{'type':_0x45342f,'resourceId':_0x358041['id']}})['then'](function(){return _0x4c9b6d;});})[_0x9f82('0x26')](function(){_0x521300[_0x9f82('0x19')](0xcc)[_0x9f82('0x1a')]();});}};}function handleEntityNotFound(_0x421ee6,_0x4832be){return function(_0x4bf7c2){if(!_0x4bf7c2){_0x421ee6[_0x9f82('0x29')](0x194);}return _0x4bf7c2;};}function handleError(_0x221ed4,_0x186866){_0x186866=_0x186866||0x1f4;return function(_0x3cdd40){logger[_0x9f82('0x2a')](_0x3cdd40['stack']);if(_0x3cdd40[_0x9f82('0x2b')]){delete _0x3cdd40[_0x9f82('0x2b')];}_0x221ed4[_0x9f82('0x19')](_0x186866)[_0x9f82('0x2c')](_0x3cdd40);};}exports[_0x9f82('0x2d')]=function(_0xe432f8,_0x322d74){var _0x58ed42={},_0x232d9d={},_0x577511={'count':0x0,'rows':[]};var _0x35ec6d=_[_0x9f82('0x2e')](db[_0x9f82('0x2f')][_0x9f82('0x30')],function(_0x46af82){return{'name':_0x46af82[_0x9f82('0x31')],'type':_0x46af82[_0x9f82('0x32')]['key']};});_0x232d9d[_0x9f82('0x33')]=_[_0x9f82('0x2e')](_0x35ec6d,_0x9f82('0x2b'));_0x232d9d[_0x9f82('0x34')]=_['keys'](_0xe432f8[_0x9f82('0x34')]);_0x232d9d[_0x9f82('0x35')]=_[_0x9f82('0x36')](_0x232d9d[_0x9f82('0x33')],_0x232d9d[_0x9f82('0x34')]);_0x58ed42[_0x9f82('0x37')]=_[_0x9f82('0x36')](_0x232d9d[_0x9f82('0x33')],qs[_0x9f82('0x38')](_0xe432f8[_0x9f82('0x34')][_0x9f82('0x38')]));_0x58ed42[_0x9f82('0x37')]=_0x58ed42['attributes']['length']?_0x58ed42[_0x9f82('0x37')]:_0x232d9d['model'];if(!_0xe432f8[_0x9f82('0x34')][_0x9f82('0x39')](_0x9f82('0x3a'))){_0x58ed42[_0x9f82('0x1c')]=qs[_0x9f82('0x1c')](_0xe432f8['query']['limit']);_0x58ed42[_0x9f82('0x1f')]=qs['offset'](_0xe432f8[_0x9f82('0x34')][_0x9f82('0x1f')]);}_0x58ed42[_0x9f82('0x3b')]=qs[_0x9f82('0x3c')](_0xe432f8[_0x9f82('0x34')][_0x9f82('0x3c')]);_0x58ed42[_0x9f82('0x3d')]=qs[_0x9f82('0x35')](_[_0x9f82('0x3e')](_0xe432f8['query'],_0x232d9d[_0x9f82('0x35')]),_0x35ec6d);if(_0xe432f8['query'][_0x9f82('0x3f')]){_0x58ed42[_0x9f82('0x3d')]=_[_0x9f82('0x40')](_0x58ed42[_0x9f82('0x3d')],{'$or':_[_0x9f82('0x2e')](_0x35ec6d,function(_0x307952){if(_0x307952[_0x9f82('0x32')]!==_0x9f82('0x41')){var _0xe0a784={};_0xe0a784[_0x307952['name']]={'$like':'%'+_0xe432f8['query'][_0x9f82('0x3f')]+'%'};return _0xe0a784;}})});}_0x58ed42=_[_0x9f82('0x40')]({},_0x58ed42,_0xe432f8[_0x9f82('0x42')]);var _0x50e256={'where':_0x58ed42[_0x9f82('0x3d')]};return db['Pause'][_0x9f82('0x1e')](_0x50e256)[_0x9f82('0x26')](function(_0x5d9b9a){_0x577511[_0x9f82('0x1e')]=_0x5d9b9a;if(_0xe432f8['query'][_0x9f82('0x43')]){_0x58ed42[_0x9f82('0x44')]=[{'all':!![]}];}return db[_0x9f82('0x2f')]['findAll'](_0x58ed42);})[_0x9f82('0x26')](function(_0x28215e){_0x577511[_0x9f82('0x45')]=_0x28215e;return _0x577511;})['then'](respondWithFilteredResult(_0x322d74,_0x58ed42))['catch'](handleError(_0x322d74,null));};exports['show']=function(_0x3b4682,_0x512fca){var _0x8a52e9={'raw':!![],'where':{'id':_0x3b4682['params']['id']}},_0x2c2869={};_0x2c2869[_0x9f82('0x33')]=_[_0x9f82('0x46')](db['Pause'][_0x9f82('0x30')]);_0x2c2869[_0x9f82('0x34')]=_[_0x9f82('0x46')](_0x3b4682['query']);_0x2c2869[_0x9f82('0x35')]=_['intersection'](_0x2c2869[_0x9f82('0x33')],_0x2c2869[_0x9f82('0x34')]);_0x8a52e9['attributes']=_[_0x9f82('0x36')](_0x2c2869[_0x9f82('0x33')],qs[_0x9f82('0x38')](_0x3b4682[_0x9f82('0x34')][_0x9f82('0x38')]));_0x8a52e9[_0x9f82('0x37')]=_0x8a52e9[_0x9f82('0x37')][_0x9f82('0x47')]?_0x8a52e9[_0x9f82('0x37')]:_0x2c2869[_0x9f82('0x33')];if(_0x3b4682[_0x9f82('0x34')]['includeAll']){_0x8a52e9[_0x9f82('0x44')]=[{'all':!![]}];}_0x8a52e9=_[_0x9f82('0x40')]({},_0x8a52e9,_0x3b4682[_0x9f82('0x42')]);return db[_0x9f82('0x2f')][_0x9f82('0x48')](_0x8a52e9)[_0x9f82('0x26')](handleEntityNotFound(_0x512fca,null))['then'](respondWithResult(_0x512fca,null))[_0x9f82('0x49')](handleError(_0x512fca,null));};exports[_0x9f82('0x4a')]=function(_0x1bd072,_0x386be0){return db[_0x9f82('0x2f')]['create'](_0x1bd072['body'],{})[_0x9f82('0x26')](function(_0x3a641d){var _0x324675=_0x1bd072[_0x9f82('0x4b')][_0x9f82('0x4c')]({'plain':!![]});if(!_0x324675)throw new Error(_0x9f82('0x4d'));if(_0x324675[_0x9f82('0x4e')]===_0x9f82('0x4b')){var _0xfaa030=_0x3a641d[_0x9f82('0x4c')]({'plain':!![]});var _0x1293ff=_0x9f82('0x4f');return db[_0x9f82('0x50')][_0x9f82('0x48')]({'where':{'name':_0x1293ff,'userProfileId':_0x324675[_0x9f82('0x51')]},'raw':!![]})[_0x9f82('0x26')](function(_0x24b123){if(_0x24b123&&_0x24b123[_0x9f82('0x52')]===0x0){return db[_0x9f82('0x28')][_0x9f82('0x4a')]({'name':_0xfaa030[_0x9f82('0x2b')],'resourceId':_0xfaa030['id'],'type':_0x24b123[_0x9f82('0x2b')],'sectionId':_0x24b123['id']},{})[_0x9f82('0x26')](function(){return _0x3a641d;});}else{return _0x3a641d;}})['catch'](function(_0x2d3466){logger[_0x9f82('0x2a')](_0x9f82('0x53'),_0x2d3466);throw _0x2d3466;});}return _0x3a641d;})['then'](respondWithResult(_0x386be0,0xc9))[_0x9f82('0x49')](handleError(_0x386be0,null));};exports[_0x9f82('0x25')]=function(_0x40e235,_0x4c234f){if(_0x40e235[_0x9f82('0x54')]['id']){delete _0x40e235[_0x9f82('0x54')]['id'];}return db[_0x9f82('0x2f')][_0x9f82('0x48')]({'where':{'id':_0x40e235[_0x9f82('0x55')]['id']}})[_0x9f82('0x26')](handleEntityNotFound(_0x4c234f,null))[_0x9f82('0x26')](saveUpdates(_0x40e235[_0x9f82('0x54')],null))['then'](respondWithResult(_0x4c234f,null))[_0x9f82('0x49')](handleError(_0x4c234f,null));};exports[_0x9f82('0x27')]=function(_0xb017e4,_0x356ad0){return db['Pause']['find']({'where':{'id':_0xb017e4[_0x9f82('0x55')]['id']}})[_0x9f82('0x26')](handleEntityNotFound(_0x356ad0,null))[_0x9f82('0x26')](removeEntity(_0x356ad0,null))[_0x9f82('0x49')](handleError(_0x356ad0,null));};
\ No newline at end of file
+var _0x1004=['VIRTUAL','options','findAll','rows','catch','params','includeAll','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','fast-json-patch','moment','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3a4956,_0x5b5a50){var _0x1f0c3b=function(_0x117de4){while(--_0x117de4){_0x3a4956['push'](_0x3a4956['shift']());}};_0x1f0c3b(++_0x5b5a50);}(_0x1004,0x1ae));var _0x4100=function(_0x353866,_0x2f7b67){_0x353866=_0x353866-0x0;var _0x4c1b0f=_0x1004[_0x353866];return _0x4c1b0f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4100('0x0'));var rp=require('request-promise');var moment=require(_0x4100('0x1'));var BPromise=require(_0x4100('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4100('0x3'));var sox=require(_0x4100('0x4'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4100('0x5'));var _=require(_0x4100('0x6'));var squel=require(_0x4100('0x7'));var crypto=require(_0x4100('0x8'));var jsforce=require(_0x4100('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4100('0xa'));var Papa=require('papaparse');var Redis=require(_0x4100('0xb'));var authService=require(_0x4100('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x4100('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4100('0xe'));var utils=require(_0x4100('0xf'));var config=require(_0x4100('0x10'));var licenseUtil=require(_0x4100('0x11'));var db=require(_0x4100('0x12'))['db'];function respondWithStatusCode(_0x1f1da3,_0x31ccb6){_0x31ccb6=_0x31ccb6||0xcc;return function(_0x25fdcd){if(_0x25fdcd){return _0x1f1da3[_0x4100('0x13')](_0x31ccb6);}return _0x1f1da3[_0x4100('0x14')](_0x31ccb6)[_0x4100('0x15')]();};}function respondWithResult(_0x3ee9dd,_0xba451d){_0xba451d=_0xba451d||0xc8;return function(_0x47b969){if(_0x47b969){return _0x3ee9dd[_0x4100('0x14')](_0xba451d)['json'](_0x47b969);}};}function respondWithFilteredResult(_0x564254,_0x379942){return function(_0xd54fe){if(_0xd54fe){var _0x4e7be2=typeof _0x379942[_0x4100('0x16')]===_0x4100('0x17')&&typeof _0x379942[_0x4100('0x18')]===_0x4100('0x17');var _0x134978=_0xd54fe[_0x4100('0x19')];var _0xa4742b=_0x4e7be2?0x0:_0x379942[_0x4100('0x16')];var _0x32f234=_0x4e7be2?_0xd54fe[_0x4100('0x19')]:_0x379942[_0x4100('0x16')]+_0x379942[_0x4100('0x18')];var _0x363a08;if(_0x32f234>=_0x134978){_0x32f234=_0x134978;_0x363a08=0xc8;}else{_0x363a08=0xce;}_0x564254['status'](_0x363a08);return _0x564254[_0x4100('0x1a')](_0x4100('0x1b'),_0xa4742b+'-'+_0x32f234+'/'+_0x134978)[_0x4100('0x1c')](_0xd54fe);}return null;};}function patchUpdates(_0x3c45fb){return function(_0x46ccfa){try{jsonpatch[_0x4100('0x1d')](_0x46ccfa,_0x3c45fb,!![]);}catch(_0x32dbcd){return BPromise[_0x4100('0x1e')](_0x32dbcd);}return _0x46ccfa[_0x4100('0x1f')]();};}function saveUpdates(_0x1a2201,_0x3252fa){return function(_0x4ebd29){if(_0x4ebd29){return _0x4ebd29['update'](_0x1a2201)[_0x4100('0x20')](function(_0x32fc6b){return _0x32fc6b;});}return null;};}function removeEntity(_0x205c91,_0x128bcb){return function(_0x4c370c){if(_0x4c370c){return _0x4c370c['destroy']()['then'](function(){var _0x187103=_0x4c370c['get']({'plain':!![]});var _0x3c4228=_0x4100('0x21');return db[_0x4100('0x22')]['destroy']({'where':{'type':_0x3c4228,'resourceId':_0x187103['id']}})[_0x4100('0x20')](function(){return _0x4c370c;});})[_0x4100('0x20')](function(){_0x205c91[_0x4100('0x14')](0xcc)[_0x4100('0x15')]();});}};}function handleEntityNotFound(_0x29475f,_0x588c0d){return function(_0x521a22){if(!_0x521a22){_0x29475f[_0x4100('0x13')](0x194);}return _0x521a22;};}function handleError(_0x49fb1a,_0xe3f095){_0xe3f095=_0xe3f095||0x1f4;return function(_0x410ba5){logger[_0x4100('0x23')](_0x410ba5[_0x4100('0x24')]);if(_0x410ba5[_0x4100('0x25')]){delete _0x410ba5[_0x4100('0x25')];}_0x49fb1a[_0x4100('0x14')](_0xe3f095)[_0x4100('0x26')](_0x410ba5);};}exports[_0x4100('0x27')]=function(_0x2211ba,_0x3d52e4){var _0x262880={},_0x2a4e33={},_0x612d7e={'count':0x0,'rows':[]};var _0x59ac2a=_[_0x4100('0x28')](db[_0x4100('0x29')][_0x4100('0x2a')],function(_0x369b77){return{'name':_0x369b77[_0x4100('0x2b')],'type':_0x369b77[_0x4100('0x2c')][_0x4100('0x2d')]};});_0x2a4e33[_0x4100('0x2e')]=_[_0x4100('0x28')](_0x59ac2a,_0x4100('0x25'));_0x2a4e33[_0x4100('0x2f')]=_[_0x4100('0x30')](_0x2211ba['query']);_0x2a4e33[_0x4100('0x31')]=_['intersection'](_0x2a4e33[_0x4100('0x2e')],_0x2a4e33['query']);_0x262880['attributes']=_[_0x4100('0x32')](_0x2a4e33[_0x4100('0x2e')],qs['fields'](_0x2211ba['query'][_0x4100('0x33')]));_0x262880[_0x4100('0x34')]=_0x262880[_0x4100('0x34')][_0x4100('0x35')]?_0x262880['attributes']:_0x2a4e33['model'];if(!_0x2211ba[_0x4100('0x2f')][_0x4100('0x36')](_0x4100('0x37'))){_0x262880[_0x4100('0x18')]=qs[_0x4100('0x18')](_0x2211ba['query'][_0x4100('0x18')]);_0x262880[_0x4100('0x16')]=qs[_0x4100('0x16')](_0x2211ba[_0x4100('0x2f')][_0x4100('0x16')]);}_0x262880[_0x4100('0x38')]=qs[_0x4100('0x39')](_0x2211ba['query'][_0x4100('0x39')]);_0x262880[_0x4100('0x3a')]=qs[_0x4100('0x31')](_[_0x4100('0x3b')](_0x2211ba[_0x4100('0x2f')],_0x2a4e33[_0x4100('0x31')]),_0x59ac2a);if(_0x2211ba[_0x4100('0x2f')][_0x4100('0x3c')]){_0x262880[_0x4100('0x3a')]=_[_0x4100('0x3d')](_0x262880['where'],{'$or':_['map'](_0x59ac2a,function(_0x24df06){if(_0x24df06[_0x4100('0x2c')]!==_0x4100('0x3e')){var _0x5e6f36={};_0x5e6f36[_0x24df06['name']]={'$like':'%'+_0x2211ba[_0x4100('0x2f')][_0x4100('0x3c')]+'%'};return _0x5e6f36;}})});}_0x262880=_['merge']({},_0x262880,_0x2211ba[_0x4100('0x3f')]);var _0x46b4a8={'where':_0x262880[_0x4100('0x3a')]};return db[_0x4100('0x29')][_0x4100('0x19')](_0x46b4a8)['then'](function(_0x596be2){_0x612d7e['count']=_0x596be2;if(_0x2211ba[_0x4100('0x2f')]['includeAll']){_0x262880['include']=[{'all':!![]}];}return db['Pause'][_0x4100('0x40')](_0x262880);})[_0x4100('0x20')](function(_0x315445){_0x612d7e[_0x4100('0x41')]=_0x315445;return _0x612d7e;})[_0x4100('0x20')](respondWithFilteredResult(_0x3d52e4,_0x262880))[_0x4100('0x42')](handleError(_0x3d52e4,null));};exports['show']=function(_0x3d6a4b,_0x1bbe8d){var _0x28ccb0={'raw':!![],'where':{'id':_0x3d6a4b[_0x4100('0x43')]['id']}},_0x3538f7={};_0x3538f7['model']=_[_0x4100('0x30')](db[_0x4100('0x29')]['rawAttributes']);_0x3538f7['query']=_[_0x4100('0x30')](_0x3d6a4b[_0x4100('0x2f')]);_0x3538f7['filters']=_[_0x4100('0x32')](_0x3538f7[_0x4100('0x2e')],_0x3538f7[_0x4100('0x2f')]);_0x28ccb0[_0x4100('0x34')]=_[_0x4100('0x32')](_0x3538f7['model'],qs[_0x4100('0x33')](_0x3d6a4b[_0x4100('0x2f')][_0x4100('0x33')]));_0x28ccb0[_0x4100('0x34')]=_0x28ccb0[_0x4100('0x34')]['length']?_0x28ccb0[_0x4100('0x34')]:_0x3538f7[_0x4100('0x2e')];if(_0x3d6a4b['query'][_0x4100('0x44')]){_0x28ccb0[_0x4100('0x45')]=[{'all':!![]}];}_0x28ccb0=_[_0x4100('0x3d')]({},_0x28ccb0,_0x3d6a4b[_0x4100('0x3f')]);return db[_0x4100('0x29')]['find'](_0x28ccb0)['then'](handleEntityNotFound(_0x1bbe8d,null))[_0x4100('0x20')](respondWithResult(_0x1bbe8d,null))[_0x4100('0x42')](handleError(_0x1bbe8d,null));};exports[_0x4100('0x46')]=function(_0x5bd4c4,_0x2961d1){return db[_0x4100('0x29')]['create'](_0x5bd4c4[_0x4100('0x47')],{})[_0x4100('0x20')](function(_0x1856f9){var _0x5203e6=_0x5bd4c4[_0x4100('0x48')][_0x4100('0x49')]({'plain':!![]});if(!_0x5203e6)throw new Error(_0x4100('0x4a'));if(_0x5203e6[_0x4100('0x4b')]==='user'){var _0x4c3fea=_0x1856f9['get']({'plain':!![]});var _0xd99d14=_0x4100('0x21');return db['UserProfileSection'][_0x4100('0x4c')]({'where':{'name':_0xd99d14,'userProfileId':_0x5203e6[_0x4100('0x4d')]},'raw':!![]})[_0x4100('0x20')](function(_0x5a1d41){if(_0x5a1d41&&_0x5a1d41[_0x4100('0x4e')]===0x0){return db[_0x4100('0x22')][_0x4100('0x46')]({'name':_0x4c3fea[_0x4100('0x25')],'resourceId':_0x4c3fea['id'],'type':_0x5a1d41[_0x4100('0x25')],'sectionId':_0x5a1d41['id']},{})[_0x4100('0x20')](function(){return _0x1856f9;});}else{return _0x1856f9;}})[_0x4100('0x42')](function(_0x286982){logger[_0x4100('0x23')](_0x4100('0x4f'),_0x286982);throw _0x286982;});}return _0x1856f9;})[_0x4100('0x20')](respondWithResult(_0x2961d1,0xc9))[_0x4100('0x42')](handleError(_0x2961d1,null));};exports[_0x4100('0x50')]=function(_0x4849a0,_0x41779a){if(_0x4849a0[_0x4100('0x47')]['id']){delete _0x4849a0[_0x4100('0x47')]['id'];}return db[_0x4100('0x29')]['find']({'where':{'id':_0x4849a0[_0x4100('0x43')]['id']}})['then'](handleEntityNotFound(_0x41779a,null))[_0x4100('0x20')](saveUpdates(_0x4849a0[_0x4100('0x47')],null))['then'](respondWithResult(_0x41779a,null))['catch'](handleError(_0x41779a,null));};exports[_0x4100('0x51')]=function(_0x1abf97,_0x5d4d7f){return db[_0x4100('0x29')][_0x4100('0x4c')]({'where':{'id':_0x1abf97[_0x4100('0x43')]['id']}})[_0x4100('0x20')](handleEntityNotFound(_0x5d4d7f,null))[_0x4100('0x20')](removeEntity(_0x5d4d7f,null))[_0x4100('0x42')](handleError(_0x5d4d7f,null));};
\ No newline at end of file
index 3d5bb6b..57a6743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0xaa7ea3,_0x149995){var _0x3956db=function(_0x34040f){while(--_0x34040f){_0xaa7ea3['push'](_0xaa7ea3['shift']());}};_0x3956db(++_0x149995);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','tools_pauses','lodash'];(function(_0x766e30,_0x5b9e9a){var _0x13fdd4=function(_0x4daa96){while(--_0x4daa96){_0x766e30['push'](_0x766e30['shift']());}};_0x13fdd4(++_0x5b9e9a);}(_0xabce,0x103));var _0xeabc=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xabce[_0x1eda20];return _0x31b953;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./pause.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('Pause',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 13b3107..e4fa227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4c725d,_0x14c463){var _0x4043f6=function(_0x284161){while(--_0x284161){_0x4c725d['push'](_0x4c725d['shift']());}};_0x4043f6(++_0x14c463);}(_0xb10b,0x12a));var _0xbb10=function(_0xe2070e,_0x3a8903){_0xe2070e=_0xe2070e-0x0;var _0x377eee=_0xb10b[_0xe2070e];return _0x377eee;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x3c1f1a,_0x5bd4){var _0x20f4fa=function(_0x5687fc){while(--_0x5687fc){_0x3c1f1a['push'](_0x3c1f1a['shift']());}};_0x20f4fa(++_0x5bd4);}(_0x7a54,0x106));var _0x47a5=function(_0x696774,_0x15891b){_0x696774=_0x696774-0x0;var _0x180bc2=_0x7a54[_0x696774];return _0x180bc2;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
index d8ccafc..0f9de87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','file','/webhook','put','isAuthenticated','delete','exports','multer','util'];(function(_0xdb3240,_0x28512d){var _0x50f48c=function(_0x1c5c51){while(--_0x1c5c51){_0xdb3240['push'](_0xdb3240['shift']());}};_0x50f48c(++_0x28512d);}(_0x2d17,0x17e));var _0x72d1=function(_0x18af8d,_0x5426f1){_0x18af8d=_0x18af8d-0x0;var _0x2c66eb=_0x2d17[_0x18af8d];return _0x2c66eb;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./plugin.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/webhook',controller[_0x72d1('0x9')]);router[_0x72d1('0x7')](_0x72d1('0xa'),auth['isAuthenticated'](),controller[_0x72d1('0xb')]);router[_0x72d1('0x7')](_0x72d1('0xc'),auth['isAuthenticated'](),controller[_0x72d1('0xd')]);var upload=multer({'storage':multer[_0x72d1('0xe')]({'destination':function(_0x45eb4a,_0x14a41e,_0x3cb9c2){_0x3cb9c2(null,path[_0x72d1('0xf')](config[_0x72d1('0x10')],_0x72d1('0x11')));},'filename':function(_0x273ccf,_0x2f5a78,_0x5ad4df){_0x2f5a78[_0x72d1('0x12')]=_0x2f5a78[_0x72d1('0x12')][_0x72d1('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5ad4df(null,util[_0x72d1('0x14')](_0x72d1('0x15'),path[_0x72d1('0x16')](_0x2f5a78[_0x72d1('0x12')],path[_0x72d1('0x17')](_0x2f5a78[_0x72d1('0x12')])),Date[_0x72d1('0x18')](),path[_0x72d1('0x17')](_0x2f5a78[_0x72d1('0x12')])));}})});router[_0x72d1('0x19')]('/',upload['single'](_0x72d1('0x1a')),controller['upload']);router[_0x72d1('0x19')](_0x72d1('0x1b'),controller['webhookPost']);router[_0x72d1('0x1c')](_0x72d1('0xa'),auth[_0x72d1('0x1d')](),controller['update']);router['delete'](_0x72d1('0xa'),auth[_0x72d1('0x1d')](),controller[_0x72d1('0x1e')]);module[_0x72d1('0x1f')]=router;
\ No newline at end of file
+var _0xd6d6=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id','isAuthenticated','/:id/download','download','diskStorage','join','originalname','replace','format','%s-%s%s','extname','now','post','file','upload','put','update','exports','multer','util'];(function(_0x5ec453,_0x30b0ba){var _0x25548f=function(_0x387b62){while(--_0x387b62){_0x5ec453['push'](_0x5ec453['shift']());}};_0x25548f(++_0x30b0ba);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x352b05,_0x49947d){_0x352b05=_0x352b05-0x0;var _0x1479c3=_0xd6d6[_0x352b05];return _0x1479c3;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var fs_extra=require(_0x6d6d('0x5'));var auth=require(_0x6d6d('0x6'));var interaction=require(_0x6d6d('0x7'));var config=require(_0x6d6d('0x8'));var controller=require(_0x6d6d('0x9'));router[_0x6d6d('0xa')]('/',auth['isAuthenticated'](),controller[_0x6d6d('0xb')]);router[_0x6d6d('0xa')](_0x6d6d('0xc'),controller[_0x6d6d('0xd')]);router[_0x6d6d('0xa')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller['show']);router['get'](_0x6d6d('0x10'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x11')]);var upload=multer({'storage':multer[_0x6d6d('0x12')]({'destination':function(_0xf84314,_0x576c88,_0x1f2b86){_0x1f2b86(null,path[_0x6d6d('0x13')](config['root'],'server/files/plugins'));},'filename':function(_0x176618,_0x32146d,_0xe61c36){_0x32146d[_0x6d6d('0x14')]=_0x32146d[_0x6d6d('0x14')][_0x6d6d('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xe61c36(null,util[_0x6d6d('0x16')](_0x6d6d('0x17'),path['basename'](_0x32146d[_0x6d6d('0x14')],path[_0x6d6d('0x18')](_0x32146d[_0x6d6d('0x14')])),Date[_0x6d6d('0x19')](),path[_0x6d6d('0x18')](_0x32146d['originalname'])));}})});router[_0x6d6d('0x1a')]('/',upload['single'](_0x6d6d('0x1b')),controller[_0x6d6d('0x1c')]);router[_0x6d6d('0x1a')]('/webhook',controller['webhookPost']);router[_0x6d6d('0x1d')](_0x6d6d('0xe'),auth[_0x6d6d('0xf')](),controller[_0x6d6d('0x1e')]);router['delete']('/:id',auth[_0x6d6d('0xf')](),controller['delete']);module[_0x6d6d('0x1f')]=router;
\ No newline at end of file
index 9e711ef..3da929e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ec3=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','never'];(function(_0x554520,_0x40cf3b){var _0x2528b8=function(_0x2b4022){while(--_0x2b4022){_0x554520['push'](_0x554520['shift']());}};_0x2528b8(++_0x40cf3b);}(_0x9ec3,0xcd));var _0x39ec=function(_0x4988d1,_0x11ce15){_0x4988d1=_0x4988d1-0x0;var _0x6640a7=_0x9ec3[_0x4988d1];return _0x6640a7;};'use strict';var Sequelize=require(_0x39ec('0x0'));module[_0x39ec('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x39ec('0x2'),'script')},'description':{'type':Sequelize[_0x39ec('0x3')]},'version':{'type':Sequelize[_0x39ec('0x3')]},'path':{'type':Sequelize[_0x39ec('0x4')],'comment':_0x39ec('0x5')},'active':{'type':Sequelize[_0x39ec('0x6')],'defaultValue':0x0,'comment':_0x39ec('0x7')},'sidebar':{'type':Sequelize[_0x39ec('0x8')](_0x39ec('0x9'),'agentOnly','always',_0x39ec('0xa')),'defaultValue':'always','comment':_0x39ec('0xb')},'icon':{'type':Sequelize[_0x39ec('0x4')]},'adminUrl':{'type':Sequelize[_0x39ec('0x4')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x39ec('0x4')]},'scriptPath':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x49bf=['always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly'];(function(_0x40bb13,_0x52452e){var _0x434bec=function(_0x2aa3e3){while(--_0x2aa3e3){_0x40bb13['push'](_0x40bb13['shift']());}};_0x434bec(++_0x52452e);}(_0x49bf,0x152));var _0xf49b=function(_0x5eeaae,_0x51fdbc){_0x5eeaae=_0x5eeaae-0x0;var _0x274cf8=_0x49bf[_0x5eeaae];return _0x274cf8;};'use strict';var Sequelize=require(_0xf49b('0x0'));module[_0xf49b('0x1')]={'name':{'type':Sequelize[_0xf49b('0x2')]},'type':{'type':Sequelize['ENUM'](_0xf49b('0x3'),_0xf49b('0x4'))},'description':{'type':Sequelize[_0xf49b('0x5')]},'version':{'type':Sequelize[_0xf49b('0x5')]},'path':{'type':Sequelize[_0xf49b('0x2')],'comment':_0xf49b('0x6')},'active':{'type':Sequelize[_0xf49b('0x7')],'defaultValue':0x0,'comment':_0xf49b('0x8')},'sidebar':{'type':Sequelize[_0xf49b('0x9')](_0xf49b('0xa'),_0xf49b('0xb'),_0xf49b('0xc'),'never'),'defaultValue':_0xf49b('0xc'),'comment':_0xf49b('0xd')},'icon':{'type':Sequelize[_0xf49b('0x2')]},'adminUrl':{'type':Sequelize[_0xf49b('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xf49b('0x2')]},'scriptPath':{'type':Sequelize[_0xf49b('0x2')]}};
\ No newline at end of file
index dad86b9..83acb6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0e0=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','get','UserProfileResource','destroy','stack','name','send','index','Plugin','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','catch','params','fields','include','options','join','root','format','basename','createWriteStream','warning','ENOENT','Sequelize','Error','error','glob','**/*','server/files/plugins','dirname','node_modules/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','test','Warning:\x20admin\x20view\x20not\x20specified','scriptName','plugins','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','Plugins','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','headers','content-type','statusCode','http://localhost:','%s%s','content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0xae9024,_0x17f58e){var _0x23e7d3=function(_0x5911fb){while(--_0x5911fb){_0xae9024['push'](_0xae9024['shift']());}};_0x23e7d3(++_0x17f58e);}(_0xb0e0,0x8c));var _0x0b0e=function(_0x56a96d,_0x4aed8c){_0x56a96d=_0x56a96d-0x0;var _0x2d8c16=_0xb0e0[_0x56a96d];return _0x2d8c16;};'use strict';var emlformat=require(_0x0b0e('0x0'));var rimraf=require(_0x0b0e('0x1'));var zipdir=require(_0x0b0e('0x2'));var jsonpatch=require(_0x0b0e('0x3'));var rp=require(_0x0b0e('0x4'));var moment=require(_0x0b0e('0x5'));var BPromise=require(_0x0b0e('0x6'));var Mustache=require(_0x0b0e('0x7'));var util=require('util');var path=require(_0x0b0e('0x8'));var sox=require(_0x0b0e('0x9'));var csv=require(_0x0b0e('0xa'));var ejs=require(_0x0b0e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0b0e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b0e('0xd'));var toCsv=require(_0x0b0e('0xa'));var querystring=require(_0x0b0e('0xe'));var Papa=require(_0x0b0e('0xf'));var extract=require(_0x0b0e('0x10'));var rimraf=require(_0x0b0e('0x1'));var archiver=require('archiver');var Redis=require(_0x0b0e('0x11'));var authService=require(_0x0b0e('0x12'));var qs=require(_0x0b0e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b0e('0x14'));var logger=require(_0x0b0e('0x15'))(_0x0b0e('0x16'));var utils=require(_0x0b0e('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0b0e('0x18'))['db'];config[_0x0b0e('0x19')]=_[_0x0b0e('0x1a')](config['redis'],{'host':_0x0b0e('0x1b'),'port':0x18eb});var socket=require(_0x0b0e('0x1c'))(new Redis(config['redis']));require('./plugin.socket')[_0x0b0e('0x1d')](socket);function respondWithStatusCode(_0x2cc730,_0x4cd546){_0x4cd546=_0x4cd546||0xcc;return function(_0x56c34e){if(_0x56c34e){return _0x2cc730[_0x0b0e('0x1e')](_0x4cd546);}return _0x2cc730[_0x0b0e('0x1f')](_0x4cd546)[_0x0b0e('0x20')]();};}function respondWithResult(_0x56c4b2,_0x3eedeb){_0x3eedeb=_0x3eedeb||0xc8;return function(_0x2a0b0a){if(_0x2a0b0a){return _0x56c4b2[_0x0b0e('0x1f')](_0x3eedeb)[_0x0b0e('0x21')](_0x2a0b0a);}};}function respondWithFilteredResult(_0x37516f,_0x58e29f){return function(_0x312b56){if(_0x312b56){var _0xb38a6a=typeof _0x58e29f[_0x0b0e('0x22')]===_0x0b0e('0x23')&&typeof _0x58e29f[_0x0b0e('0x24')]===_0x0b0e('0x23');var _0x216c30=_0x312b56[_0x0b0e('0x25')];var _0x3f847b=_0xb38a6a?0x0:_0x58e29f[_0x0b0e('0x22')];var _0x58df03=_0xb38a6a?_0x312b56[_0x0b0e('0x25')]:_0x58e29f[_0x0b0e('0x22')]+_0x58e29f[_0x0b0e('0x24')];var _0x4ef824;if(_0x58df03>=_0x216c30){_0x58df03=_0x216c30;_0x4ef824=0xc8;}else{_0x4ef824=0xce;}_0x37516f['status'](_0x4ef824);return _0x37516f[_0x0b0e('0x26')]('Content-Range',_0x3f847b+'-'+_0x58df03+'/'+_0x216c30)[_0x0b0e('0x21')](_0x312b56);}return null;};}function patchUpdates(_0x4e003f){return function(_0x2b1e01){try{jsonpatch[_0x0b0e('0x27')](_0x2b1e01,_0x4e003f,!![]);}catch(_0x45a091){return BPromise['reject'](_0x45a091);}return _0x2b1e01[_0x0b0e('0x28')]();};}function saveUpdates(_0x55594b,_0xb6b510){return function(_0x1a5fa0){if(_0x1a5fa0){return _0x1a5fa0[_0x0b0e('0x29')](_0x55594b)[_0x0b0e('0x2a')](function(_0x53a3f5){return _0x53a3f5;});}return null;};}function removeEntity(_0x27f7d8,_0x4500ae){return function(_0x1442d7){if(_0x1442d7){return _0x1442d7['destroy']()[_0x0b0e('0x2a')](function(){var _0x5d6d5b=_0x1442d7[_0x0b0e('0x2b')]({'plain':!![]});var _0x11e7c7='Plugins';return db[_0x0b0e('0x2c')][_0x0b0e('0x2d')]({'where':{'type':_0x11e7c7,'resourceId':_0x5d6d5b['id']}})[_0x0b0e('0x2a')](function(){return _0x1442d7;});})[_0x0b0e('0x2a')](function(){_0x27f7d8['status'](0xcc)[_0x0b0e('0x20')]();});}};}function handleEntityNotFound(_0x456008,_0x4da0bf){return function(_0x53e22d){if(!_0x53e22d){_0x456008[_0x0b0e('0x1e')](0x194);}return _0x53e22d;};}function handleError(_0x5c2829,_0x24442a){_0x24442a=_0x24442a||0x1f4;return function(_0x558793){logger['error'](_0x558793[_0x0b0e('0x2e')]);if(_0x558793[_0x0b0e('0x2f')]){delete _0x558793[_0x0b0e('0x2f')];}_0x5c2829[_0x0b0e('0x1f')](_0x24442a)[_0x0b0e('0x30')](_0x558793);};}exports[_0x0b0e('0x31')]=function(_0x3fd26b,_0xe71564){var _0x27815d={},_0x3065ab={},_0x2ac564={'count':0x0,'rows':[]};var _0xcf8b2f=_['map'](db[_0x0b0e('0x32')][_0x0b0e('0x33')],function(_0x1455e8){return{'name':_0x1455e8['fieldName'],'type':_0x1455e8[_0x0b0e('0x34')]['key']};});_0x3065ab['model']=_[_0x0b0e('0x35')](_0xcf8b2f,_0x0b0e('0x2f'));_0x3065ab[_0x0b0e('0x36')]=_[_0x0b0e('0x37')](_0x3fd26b[_0x0b0e('0x36')]);_0x3065ab[_0x0b0e('0x38')]=_[_0x0b0e('0x39')](_0x3065ab['model'],_0x3065ab[_0x0b0e('0x36')]);_0x27815d[_0x0b0e('0x3a')]=_[_0x0b0e('0x39')](_0x3065ab[_0x0b0e('0x3b')],qs['fields'](_0x3fd26b['query']['fields']));_0x27815d[_0x0b0e('0x3a')]=_0x27815d[_0x0b0e('0x3a')][_0x0b0e('0x3c')]?_0x27815d[_0x0b0e('0x3a')]:_0x3065ab[_0x0b0e('0x3b')];if(!_0x3fd26b[_0x0b0e('0x36')][_0x0b0e('0x3d')](_0x0b0e('0x3e'))){_0x27815d['limit']=qs[_0x0b0e('0x24')](_0x3fd26b[_0x0b0e('0x36')]['limit']);_0x27815d[_0x0b0e('0x22')]=qs['offset'](_0x3fd26b[_0x0b0e('0x36')][_0x0b0e('0x22')]);}_0x27815d[_0x0b0e('0x3f')]=qs[_0x0b0e('0x40')](_0x3fd26b[_0x0b0e('0x36')][_0x0b0e('0x40')]);_0x27815d[_0x0b0e('0x41')]=qs[_0x0b0e('0x38')](_[_0x0b0e('0x42')](_0x3fd26b[_0x0b0e('0x36')],_0x3065ab[_0x0b0e('0x38')]),_0xcf8b2f);if(_0x3fd26b['query']['filter']){_0x27815d[_0x0b0e('0x41')]=_[_0x0b0e('0x43')](_0x27815d[_0x0b0e('0x41')],{'$or':_[_0x0b0e('0x35')](_0xcf8b2f,function(_0x33fa6c){if(_0x33fa6c[_0x0b0e('0x34')]!==_0x0b0e('0x44')){var _0x22e7e6={};_0x22e7e6[_0x33fa6c['name']]={'$like':'%'+_0x3fd26b[_0x0b0e('0x36')][_0x0b0e('0x45')]+'%'};return _0x22e7e6;}})});}_0x27815d=_[_0x0b0e('0x43')]({},_0x27815d,_0x3fd26b['options']);var _0x31b9ef={'where':_0x27815d[_0x0b0e('0x41')]};return db[_0x0b0e('0x32')][_0x0b0e('0x25')](_0x31b9ef)[_0x0b0e('0x2a')](function(_0x35d5f2){_0x2ac564[_0x0b0e('0x25')]=_0x35d5f2;if(_0x3fd26b[_0x0b0e('0x36')][_0x0b0e('0x46')]){_0x27815d['include']=[{'all':!![]}];}return db['Plugin'][_0x0b0e('0x47')](_0x27815d);})[_0x0b0e('0x2a')](function(_0x80d8ee){_0x2ac564['rows']=_0x80d8ee;return _0x2ac564;})[_0x0b0e('0x2a')](respondWithFilteredResult(_0xe71564,_0x27815d))[_0x0b0e('0x48')](handleError(_0xe71564,null));};exports['show']=function(_0x5a2bda,_0x5401c5){var _0x49f2aa={'raw':!![],'where':{'id':_0x5a2bda[_0x0b0e('0x49')]['id']}},_0x1b4da4={};_0x1b4da4[_0x0b0e('0x3b')]=_[_0x0b0e('0x37')](db[_0x0b0e('0x32')]['rawAttributes']);_0x1b4da4['query']=_[_0x0b0e('0x37')](_0x5a2bda['query']);_0x1b4da4['filters']=_['intersection'](_0x1b4da4[_0x0b0e('0x3b')],_0x1b4da4['query']);_0x49f2aa['attributes']=_[_0x0b0e('0x39')](_0x1b4da4[_0x0b0e('0x3b')],qs[_0x0b0e('0x4a')](_0x5a2bda['query'][_0x0b0e('0x4a')]));_0x49f2aa['attributes']=_0x49f2aa[_0x0b0e('0x3a')][_0x0b0e('0x3c')]?_0x49f2aa[_0x0b0e('0x3a')]:_0x1b4da4[_0x0b0e('0x3b')];if(_0x5a2bda['query'][_0x0b0e('0x46')]){_0x49f2aa[_0x0b0e('0x4b')]=[{'all':!![]}];}_0x49f2aa=_[_0x0b0e('0x43')]({},_0x49f2aa,_0x5a2bda[_0x0b0e('0x4c')]);return db['Plugin']['find'](_0x49f2aa)[_0x0b0e('0x2a')](handleEntityNotFound(_0x5401c5,null))[_0x0b0e('0x2a')](respondWithResult(_0x5401c5,null))[_0x0b0e('0x48')](handleError(_0x5401c5,null));};exports['download']=function(_0x3ef66e,_0x2be955,_0x5e95a8){return db[_0x0b0e('0x32')]['find']({'where':{'id':_0x3ef66e[_0x0b0e('0x49')]['id']},'attributes':[_0x0b0e('0x2f'),_0x0b0e('0x8')],'raw':!![]})[_0x0b0e('0x2a')](handleEntityNotFound(_0x2be955,null))[_0x0b0e('0x2a')](function(_0x36600d){if(_0x36600d){var _0x146ac1=path[_0x0b0e('0x4d')](config[_0x0b0e('0x4e')],'server/files/plugins',util[_0x0b0e('0x4f')]('%s.zip',path[_0x0b0e('0x50')](_0x36600d['path'])));var _0x26bfb2=fs[_0x0b0e('0x51')](_0x146ac1);var _0x521ce1=archiver('zip',{'zlib':{'level':0x9}});_0x521ce1['on'](_0x0b0e('0x52'),function(_0x53c71c){if(_0x53c71c['code']===_0x0b0e('0x53')){logger['error'](_0x53c71c);}else{throw new db[(_0x0b0e('0x54'))][(_0x0b0e('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x521ce1['on'](_0x0b0e('0x56'),function(_0x230e45){throw new db[(_0x0b0e('0x54'))][(_0x0b0e('0x55'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x521ce1['pipe'](_0x26bfb2);_0x521ce1[_0x0b0e('0x57')](_0x0b0e('0x58'),{'cwd':path[_0x0b0e('0x4d')](config[_0x0b0e('0x4e')],_0x0b0e('0x59'),path[_0x0b0e('0x5a')](_0x36600d[_0x0b0e('0x8')])),'ignore':[path[_0x0b0e('0x4d')](path[_0x0b0e('0x50')](_0x36600d['path']),_0x0b0e('0x5b')),path[_0x0b0e('0x4d')](path[_0x0b0e('0x50')](_0x36600d[_0x0b0e('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x0b0e('0x5c')]();_0x26bfb2['on'](_0x0b0e('0x5d'),function(){if(!fs[_0x0b0e('0x5e')](_0x146ac1)){throw new db[(_0x0b0e('0x54'))]['Error'](_0x0b0e('0x5f'));}return _0x2be955[_0x0b0e('0x60')](_0x146ac1,util[_0x0b0e('0x4f')](_0x0b0e('0x61'),path['basename'](_0x36600d[_0x0b0e('0x8')])),function(_0x2c8467){if(_0x2c8467){throw new db['Sequelize']['Error'](_0x0b0e('0x62'));}fs['unlinkSync'](_0x146ac1);logger[_0x0b0e('0x63')](_0x0b0e('0x64'));logger['info']('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x2be955,null));};exports[_0x0b0e('0x65')]=function(_0x5c294f,_0x500205,_0x41260d){var _0x74901c=path[_0x0b0e('0x50')](_0x5c294f['file'][_0x0b0e('0x66')],path[_0x0b0e('0x67')](_0x5c294f['file'][_0x0b0e('0x66')]));var _0x37bc49=path[_0x0b0e('0x4d')](config[_0x0b0e('0x4e')],_0x0b0e('0x59'),_0x5c294f[_0x0b0e('0x68')][_0x0b0e('0x66')]);var _0x2ccd65=path[_0x0b0e('0x4d')](config[_0x0b0e('0x4e')],'server/files/plugins',_0x74901c);logger['info'](_0x0b0e('0x69'),_0x37bc49);logger[_0x0b0e('0x63')](_0x0b0e('0x6a'),_0x2ccd65);try{fs[_0x0b0e('0x6b')](_0x37bc49,parseInt(_0x0b0e('0x6c'),0x8));extract(_0x37bc49,{'dir':_0x2ccd65},function(_0x340b8b){if(_0x340b8b){logger[_0x0b0e('0x56')](_0x340b8b);handleError(_0x340b8b,!![]);};var _0x436b06=fs[_0x0b0e('0x6d')](_0x2ccd65);if(_0x436b06[_0x0b0e('0x3c')]>0x1){removeReferences(_0x37bc49,_0x2ccd65);logger[_0x0b0e('0x56')]('Invalid\x20plugin\x20structure');return _0x41260d(new Error(_0x0b0e('0x6e')));}var _0x1cc957=fs[_0x0b0e('0x6f')](path[_0x0b0e('0x4d')](_0x2ccd65,_0x436b06[0x0]));if(_0x1cc957['isFile']()){removeReferences(_0x37bc49,_0x2ccd65);logger[_0x0b0e('0x56')](_0x0b0e('0x6e'));return _0x41260d(new Error('Invalid\x20plugin\x20structure'));}if(_0x1cc957[_0x0b0e('0x70')]()){var _0x465c3d=fs[_0x0b0e('0x6d')](path['join'](_0x2ccd65,_0x436b06[0x0]));if(_0x465c3d[_0x0b0e('0x3c')]===0x0){removeReferences(_0x37bc49,_0x2ccd65);logger[_0x0b0e('0x56')](_0x0b0e('0x6e'));return _0x41260d(new Error('Invalid\x20plugin\x20structure'));}var _0x6ef355=_0x465c3d['some'](function(_0xe63490){return _0xe63490===_0x0b0e('0x71');});if(!_0x6ef355){return _0x41260d(new Error(_0x0b0e('0x72')));}var _0xd35286=fs[_0x0b0e('0x73')](path[_0x0b0e('0x4d')](_0x2ccd65,_0x436b06[0x0],'manifest.json'));var _0x154d81=JSON[_0x0b0e('0x74')](_0xd35286);if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x2f')]){return _0x41260d(new Error(_0x0b0e('0x75')));}if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x34')]){return _0x41260d(new Error(_0x0b0e('0x76')));}if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x77')]){return _0x41260d(new Error(_0x0b0e('0x78')));}if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x79')]){return _0x41260d(new Error(_0x0b0e('0x7a')));}if(_0x154d81[_0x0b0e('0x34')]===_0x0b0e('0x7b')){if('undefined'==typeof _0x154d81[_0x0b0e('0x79')][_0x0b0e('0x7c')]){return _0x41260d(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x0b0e('0x23')==typeof _0x154d81['parameters'][_0x0b0e('0x7c')][_0x0b0e('0x7d')]&&_0x0b0e('0x23')==typeof _0x154d81['parameters'][_0x0b0e('0x7c')][_0x0b0e('0x7e')]){return _0x41260d(new Error(_0x0b0e('0x7f')));}}else if(_0x154d81['type']===_0x0b0e('0x80')){if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x79')]['scriptName']){return _0x41260d(new Error(_0x0b0e('0x81')));}if(_0x0b0e('0x23')==typeof _0x154d81[_0x0b0e('0x79')][_0x0b0e('0x82')]){return _0x41260d(new Error(_0x0b0e('0x83')));}}else{return _0x41260d(new Error(_0x0b0e('0x84')));}var _0x3a0cfa=_0x154d81['name'];var _0x1f7cd6=_0x154d81[_0x0b0e('0x85')];var _0x5ef5bc=_0x154d81[_0x0b0e('0x34')];var _0x43edf8=_0x154d81[_0x0b0e('0x86')]?_0x154d81['sidebar']:_0x0b0e('0x87');var _0x4af9eb=_0x154d81['icon']?_0x154d81['icon']:'icon-apps';var _0x412f77='';var _0x39855d='';var _0x5bc882='';var _0x3f1363='';var _0xc4c344=_0x154d81['version'];if(_0x5ef5bc==='html'){if(_0x0b0e('0x23')!=typeof _0x154d81['parameters'][_0x0b0e('0x7c')]['admin']){var _0x4a9b51=_0x154d81[_0x0b0e('0x79')]['views'][_0x0b0e('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x0b0e('0x88')](_0x4a9b51)){_0x412f77=path[_0x0b0e('0x4d')]('plugins',_0x74901c,_0x436b06[0x0],_0x4a9b51);}else{_0x412f77=_0x4a9b51;}}else{logger[_0x0b0e('0x63')](_0x0b0e('0x89'));}if('undefined'!=typeof _0x154d81['parameters']['views']['agent']){var _0x228d9a=_0x154d81['parameters'][_0x0b0e('0x7c')][_0x0b0e('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x0b0e('0x88')](_0x228d9a)){_0x39855d=path[_0x0b0e('0x4d')]('plugins',_0x74901c,_0x436b06[0x0],_0x228d9a);}else{_0x39855d=_0x228d9a;}}else{logger[_0x0b0e('0x63')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x5ef5bc==='script'){_0x5bc882=_0x154d81[_0x0b0e('0x79')][_0x0b0e('0x8a')];_0x3f1363=_0x154d81[_0x0b0e('0x79')][_0x0b0e('0x82')];if(_0x0b0e('0x23')!=typeof _0x154d81['parameters']['views']){if(_0x0b0e('0x23')!=typeof _0x154d81['parameters']['views'][_0x0b0e('0x7d')]){var _0x4a9b51=_0x154d81[_0x0b0e('0x79')]['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x4a9b51)){_0x412f77=path['join'](_0x0b0e('0x8b'),_0x74901c,_0x436b06[0x0],_0x4a9b51);}else{_0x412f77=_0x4a9b51;}}if(_0x0b0e('0x23')!=typeof _0x154d81[_0x0b0e('0x79')][_0x0b0e('0x7c')][_0x0b0e('0x7e')]){var _0x228d9a=_0x154d81[_0x0b0e('0x79')][_0x0b0e('0x7c')][_0x0b0e('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x0b0e('0x88')](_0x228d9a)){_0x39855d=path[_0x0b0e('0x4d')](_0x0b0e('0x8b'),_0x74901c,_0x436b06[0x0],_0x228d9a);}else{_0x39855d=_0x228d9a;}}}}var _0x3bc73b={'name':_0x3a0cfa,'description':_0x1f7cd6,'path':path[_0x0b0e('0x4d')](_0x74901c,_0x436b06[0x0]),'type':_0x5ef5bc,'sidebar':_0x43edf8,'icon':_0x4af9eb,'adminUrl':_0x412f77,'agentUrl':_0x39855d,'scriptName':_0x5bc882,'scriptPath':_0x3f1363,'version':_0xc4c344};removeReferences(_0x37bc49,null);return db[_0x0b0e('0x32')][_0x0b0e('0x8c')](_0x3bc73b)[_0x0b0e('0x2a')](function(_0x14e376){var _0x39f14b={'role':_0x5c294f[_0x0b0e('0x8d')][_0x0b0e('0x8e')],'userProfileId':_0x5c294f[_0x0b0e('0x8d')][_0x0b0e('0x8f')]};if(!_0x39f14b)throw new Error(_0x0b0e('0x90'));if(_0x39f14b[_0x0b0e('0x8e')]==='user'){var _0x8afe93=_0x14e376[_0x0b0e('0x2b')]({'plain':!![]});return db['UserProfileSection'][_0x0b0e('0x91')]({'where':{'name':_0x0b0e('0x92'),'userProfileId':_0x39f14b[_0x0b0e('0x8f')]},'raw':!![]})[_0x0b0e('0x2a')](function(_0x5b3524){if(_0x5b3524&&_0x5b3524[_0x0b0e('0x93')]===0x0){return db[_0x0b0e('0x2c')][_0x0b0e('0x8c')]({'name':_0x8afe93[_0x0b0e('0x2f')],'resourceId':_0x8afe93['id'],'type':_0x5b3524[_0x0b0e('0x2f')],'sectionId':_0x5b3524['id']},{})[_0x0b0e('0x2a')](function(){return _0x14e376;});}else{return _0x14e376;}})['catch'](function(_0x33fa23){logger[_0x0b0e('0x56')](_0x0b0e('0x94'),_0x33fa23);throw _0x33fa23;});}return _0x14e376;})['then'](respondWithResult(_0x500205,null))[_0x0b0e('0x48')](handleError(_0x500205,null));}});}catch(_0x23b641){_0x500205[_0x0b0e('0x1f')](0x1f4)['send'](_0x23b641);}};function removeReferences(_0x13db8f,_0x2388e3){try{if(_0x13db8f){fs['unlinkSync'](_0x13db8f);logger['info'](_0x0b0e('0x95'));}if(_0x2388e3){rimraf(_0x2388e3,function(){});logger[_0x0b0e('0x63')](_0x0b0e('0x96'));}}catch(_0x37f69c){logger[_0x0b0e('0x56')](_0x37f69c);}}exports[_0x0b0e('0x29')]=function(_0x4e2b08,_0x112a92,_0x1f29fc){return db[_0x0b0e('0x32')]['find']({'where':{'id':_0x4e2b08[_0x0b0e('0x49')]['id']}})[_0x0b0e('0x2a')](handleEntityNotFound(_0x112a92,null))[_0x0b0e('0x2a')](saveUpdates(_0x4e2b08[_0x0b0e('0x8d')],null))[_0x0b0e('0x2a')](respondWithResult(_0x112a92,null))['catch'](handleError(_0x112a92,null));};exports['delete']=function(_0x424474,_0x21bce6,_0x2bfa03){return db['Plugin'][_0x0b0e('0x91')]({'where':{'id':_0x424474[_0x0b0e('0x49')]['id']}})[_0x0b0e('0x2a')](function(_0x663eed){if(_0x663eed){return _0x663eed['destroy']();}})['then'](function(_0x5ac157){rimraf(path['join'](config[_0x0b0e('0x4e')],_0x0b0e('0x59'),path[_0x0b0e('0x5a')](_0x5ac157[_0x0b0e('0x8')])),function(){});return _0x5ac157;})['then'](handleEntityNotFound(_0x21bce6,null))[_0x0b0e('0x2a')](respondWithStatusCode(_0x21bce6,null))[_0x0b0e('0x48')](handleError(_0x21bce6,null));};exports[_0x0b0e('0x97')]=function(_0x563e77,_0x3604f7,_0x5cc852){return BPromise[_0x0b0e('0x98')]()[_0x0b0e('0x2a')](function(){if(!_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x8')]){throw new Error(_0x0b0e('0x99'));}if(!_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x9a')]){throw new Error(_0x0b0e('0x9b'));}var _0x3cd480=_0x563e77['query'][_0x0b0e('0x9c')]?_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x9c')]+':'+_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x9a')]:'http://localhost:'+_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x9a')];var _0x2a73de=_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x21')]?_0x563e77[_0x0b0e('0x36')]['json']:!![];var _0x68e2cf=_0x563e77['query'][_0x0b0e('0x9d')]?_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x9d')]:null;var _0x5b3004={'method':_0x563e77[_0x0b0e('0x9e')],'uri':util[_0x0b0e('0x4f')]('%s%s',_0x3cd480,_0x563e77[_0x0b0e('0x36')][_0x0b0e('0x8')]),'json':_0x2a73de,'resolveWithFullResponse':!![],'encoding':_0x68e2cf,'qs':_0x563e77[_0x0b0e('0x36')]};if(_0x563e77['headers']){_0x5b3004['headers']=_0x563e77['headers'];if(_0x5b3004[_0x0b0e('0x9f')]['content-length']){delete _0x5b3004[_0x0b0e('0x9f')]['content-length'];}}if(_0x5b3004[_0x0b0e('0x9f')][_0x0b0e('0xa0')]){delete _0x5b3004['headers']['content-type'];}return rp(_0x5b3004);})[_0x0b0e('0x2a')](function(_0x699d1c){if(_0x699d1c){_0x3604f7[_0x0b0e('0x26')](_0x699d1c['headers']);logger[_0x0b0e('0x63')](_0x699d1c['body']);if(_['endsWith'](_0x563e77['query']['path'],'download')&&_0x699d1c[_0x0b0e('0xa1')]==0x1f4){return _0x3604f7['sendStatus'](_0x699d1c['statusCode']);}else{return _0x3604f7[_0x0b0e('0x1f')](_0x699d1c[_0x0b0e('0xa1')])['send'](_0x699d1c[_0x0b0e('0x8d')]);}}else{return _0x3604f7['sendStatus'](0xc8);}})[_0x0b0e('0x48')](handleError(_0x3604f7,null));};exports['webhookPost']=function(_0x294ac0,_0x3c5578,_0x524847){return BPromise[_0x0b0e('0x98')]()[_0x0b0e('0x2a')](function(){if(!_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x8')]){throw new Error(_0x0b0e('0x99'));}if(!_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0xe2c972=_0x294ac0[_0x0b0e('0x36')]['hostname']?_0x294ac0[_0x0b0e('0x36')]['hostname']+':'+_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x9a')]:_0x0b0e('0xa2')+_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x9a')];var _0x481e0b=_0x294ac0['query'][_0x0b0e('0x21')]?_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x21')]:!![];var _0x67552b=_0x294ac0['query'][_0x0b0e('0x9d')]?_0x294ac0[_0x0b0e('0x36')]['encoding']:null;var _0x1cd819={'method':_0x294ac0[_0x0b0e('0x9e')],'uri':util[_0x0b0e('0x4f')](_0x0b0e('0xa3'),_0xe2c972,_0x294ac0[_0x0b0e('0x36')][_0x0b0e('0x8')]),'json':_0x481e0b,'resolveWithFullResponse':!![],'encoding':_0x67552b,'body':_0x294ac0[_0x0b0e('0x8d')]};if(_0x294ac0['headers']){_0x1cd819[_0x0b0e('0x9f')]=_0x294ac0[_0x0b0e('0x9f')];if(_0x1cd819[_0x0b0e('0x9f')][_0x0b0e('0xa4')]){delete _0x1cd819[_0x0b0e('0x9f')]['content-length'];}}if(_0x1cd819['headers'][_0x0b0e('0xa0')]){delete _0x1cd819[_0x0b0e('0x9f')]['content-type'];}return rp(_0x1cd819);})['then'](function(_0x242775){if(_0x242775){_0x3c5578[_0x0b0e('0x26')](_0x242775[_0x0b0e('0x9f')]);logger[_0x0b0e('0x63')](_0x242775['body']);return _0x3c5578[_0x0b0e('0x1f')](_0x242775[_0x0b0e('0xa1')])[_0x0b0e('0x30')](_0x242775['body']);}else{return _0x3c5578[_0x0b0e('0x1e')](0xc8);}})[_0x0b0e('0x48')](handleError(_0x3c5578,null));};
\ No newline at end of file
+var _0xf57f=['Error\x20while\x20generating\x20the\x20zip\x20archive','**/*','server/files/plugins','join','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','html','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','dirname','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','sendStatus','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','download','root','format','basename','createWriteStream','zip','warning','code','Sequelize','Error'];(function(_0x59197e,_0x5781d2){var _0x3cc0fa=function(_0x494855){while(--_0x494855){_0x59197e['push'](_0x59197e['shift']());}};_0x3cc0fa(++_0x5781d2);}(_0xf57f,0xfa));var _0xff57=function(_0x141352,_0x5aa338){_0x141352=_0x141352-0x0;var _0x3d8110=_0xf57f[_0x141352];return _0x3d8110;};'use strict';var emlformat=require(_0xff57('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xff57('0x1'));var moment=require(_0xff57('0x2'));var BPromise=require(_0xff57('0x3'));var Mustache=require(_0xff57('0x4'));var util=require('util');var path=require(_0xff57('0x5'));var sox=require(_0xff57('0x6'));var csv=require(_0xff57('0x7'));var ejs=require(_0xff57('0x8'));var fs=require('fs');var fs_extra=require(_0xff57('0x9'));var _=require('lodash');var squel=require(_0xff57('0xa'));var crypto=require(_0xff57('0xb'));var jsforce=require(_0xff57('0xc'));var deskjs=require(_0xff57('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff57('0xe'));var Papa=require(_0xff57('0xf'));var extract=require(_0xff57('0x10'));var rimraf=require(_0xff57('0x11'));var archiver=require(_0xff57('0x12'));var Redis=require(_0xff57('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xff57('0x14'));var hardwareService=require(_0xff57('0x15'));var logger=require(_0xff57('0x16'))(_0xff57('0x17'));var utils=require(_0xff57('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xff57('0x19'));var db=require('../../mysqldb')['db'];config[_0xff57('0x1a')]=_[_0xff57('0x1b')](config[_0xff57('0x1a')],{'host':_0xff57('0x1c'),'port':0x18eb});var socket=require(_0xff57('0x1d'))(new Redis(config[_0xff57('0x1a')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x40e2a1,_0x30a2d0){_0x30a2d0=_0x30a2d0||0xcc;return function(_0x2bef2b){if(_0x2bef2b){return _0x40e2a1['sendStatus'](_0x30a2d0);}return _0x40e2a1['status'](_0x30a2d0)[_0xff57('0x1e')]();};}function respondWithResult(_0x220126,_0x2e538f){_0x2e538f=_0x2e538f||0xc8;return function(_0x342a56){if(_0x342a56){return _0x220126[_0xff57('0x1f')](_0x2e538f)[_0xff57('0x20')](_0x342a56);}};}function respondWithFilteredResult(_0x531a20,_0x11dc46){return function(_0xd8b1d2){if(_0xd8b1d2){var _0x9e647c=typeof _0x11dc46[_0xff57('0x21')]===_0xff57('0x22')&&typeof _0x11dc46[_0xff57('0x23')]===_0xff57('0x22');var _0x206e91=_0xd8b1d2[_0xff57('0x24')];var _0x3c7ac0=_0x9e647c?0x0:_0x11dc46[_0xff57('0x21')];var _0x53750a=_0x9e647c?_0xd8b1d2['count']:_0x11dc46[_0xff57('0x21')]+_0x11dc46[_0xff57('0x23')];var _0x4b8816;if(_0x53750a>=_0x206e91){_0x53750a=_0x206e91;_0x4b8816=0xc8;}else{_0x4b8816=0xce;}_0x531a20['status'](_0x4b8816);return _0x531a20[_0xff57('0x25')](_0xff57('0x26'),_0x3c7ac0+'-'+_0x53750a+'/'+_0x206e91)[_0xff57('0x20')](_0xd8b1d2);}return null;};}function patchUpdates(_0x145824){return function(_0x2f5236){try{jsonpatch[_0xff57('0x27')](_0x2f5236,_0x145824,!![]);}catch(_0x1df1bd){return BPromise[_0xff57('0x28')](_0x1df1bd);}return _0x2f5236[_0xff57('0x29')]();};}function saveUpdates(_0x5241ce,_0x614d85){return function(_0x140c43){if(_0x140c43){return _0x140c43[_0xff57('0x2a')](_0x5241ce)[_0xff57('0x2b')](function(_0x131e44){return _0x131e44;});}return null;};}function removeEntity(_0x260911,_0x56c1e4){return function(_0x3a608f){if(_0x3a608f){return _0x3a608f[_0xff57('0x2c')]()['then'](function(){var _0x1b5cb1=_0x3a608f[_0xff57('0x2d')]({'plain':!![]});var _0x3a2eba=_0xff57('0x2e');return db[_0xff57('0x2f')][_0xff57('0x2c')]({'where':{'type':_0x3a2eba,'resourceId':_0x1b5cb1['id']}})[_0xff57('0x2b')](function(){return _0x3a608f;});})['then'](function(){_0x260911[_0xff57('0x1f')](0xcc)[_0xff57('0x1e')]();});}};}function handleEntityNotFound(_0x51a869,_0x88d241){return function(_0x28a076){if(!_0x28a076){_0x51a869['sendStatus'](0x194);}return _0x28a076;};}function handleError(_0x240b85,_0x111aa9){_0x111aa9=_0x111aa9||0x1f4;return function(_0x2204b1){logger[_0xff57('0x30')](_0x2204b1['stack']);if(_0x2204b1[_0xff57('0x31')]){delete _0x2204b1['name'];}_0x240b85['status'](_0x111aa9)[_0xff57('0x32')](_0x2204b1);};}exports[_0xff57('0x33')]=function(_0x56d1ad,_0x4e1379){var _0x4ca8fe={},_0x3850d9={},_0x51a878={'count':0x0,'rows':[]};var _0x16c7b0=_[_0xff57('0x34')](db[_0xff57('0x35')][_0xff57('0x36')],function(_0x56dbcc){return{'name':_0x56dbcc[_0xff57('0x37')],'type':_0x56dbcc[_0xff57('0x38')]['key']};});_0x3850d9['model']=_['map'](_0x16c7b0,_0xff57('0x31'));_0x3850d9[_0xff57('0x39')]=_[_0xff57('0x3a')](_0x56d1ad[_0xff57('0x39')]);_0x3850d9[_0xff57('0x3b')]=_[_0xff57('0x3c')](_0x3850d9[_0xff57('0x3d')],_0x3850d9[_0xff57('0x39')]);_0x4ca8fe[_0xff57('0x3e')]=_['intersection'](_0x3850d9[_0xff57('0x3d')],qs[_0xff57('0x3f')](_0x56d1ad[_0xff57('0x39')][_0xff57('0x3f')]));_0x4ca8fe[_0xff57('0x3e')]=_0x4ca8fe['attributes'][_0xff57('0x40')]?_0x4ca8fe[_0xff57('0x3e')]:_0x3850d9['model'];if(!_0x56d1ad[_0xff57('0x39')]['hasOwnProperty'](_0xff57('0x41'))){_0x4ca8fe[_0xff57('0x23')]=qs[_0xff57('0x23')](_0x56d1ad[_0xff57('0x39')]['limit']);_0x4ca8fe[_0xff57('0x21')]=qs[_0xff57('0x21')](_0x56d1ad[_0xff57('0x39')][_0xff57('0x21')]);}_0x4ca8fe['order']=qs[_0xff57('0x42')](_0x56d1ad['query']['sort']);_0x4ca8fe[_0xff57('0x43')]=qs['filters'](_[_0xff57('0x44')](_0x56d1ad[_0xff57('0x39')],_0x3850d9[_0xff57('0x3b')]),_0x16c7b0);if(_0x56d1ad[_0xff57('0x39')][_0xff57('0x45')]){_0x4ca8fe[_0xff57('0x43')]=_[_0xff57('0x46')](_0x4ca8fe[_0xff57('0x43')],{'$or':_[_0xff57('0x34')](_0x16c7b0,function(_0x54524b){if(_0x54524b['type']!==_0xff57('0x47')){var _0x5a1541={};_0x5a1541[_0x54524b['name']]={'$like':'%'+_0x56d1ad[_0xff57('0x39')]['filter']+'%'};return _0x5a1541;}})});}_0x4ca8fe=_[_0xff57('0x46')]({},_0x4ca8fe,_0x56d1ad[_0xff57('0x48')]);var _0x4cd291={'where':_0x4ca8fe[_0xff57('0x43')]};return db[_0xff57('0x35')][_0xff57('0x24')](_0x4cd291)[_0xff57('0x2b')](function(_0x17f960){_0x51a878[_0xff57('0x24')]=_0x17f960;if(_0x56d1ad[_0xff57('0x39')][_0xff57('0x49')]){_0x4ca8fe[_0xff57('0x4a')]=[{'all':!![]}];}return db[_0xff57('0x35')][_0xff57('0x4b')](_0x4ca8fe);})[_0xff57('0x2b')](function(_0x9174f){_0x51a878[_0xff57('0x4c')]=_0x9174f;return _0x51a878;})[_0xff57('0x2b')](respondWithFilteredResult(_0x4e1379,_0x4ca8fe))[_0xff57('0x4d')](handleError(_0x4e1379,null));};exports['show']=function(_0x16afa2,_0x222042){var _0x18cb52={'raw':!![],'where':{'id':_0x16afa2[_0xff57('0x4e')]['id']}},_0x6afff3={};_0x6afff3['model']=_['keys'](db[_0xff57('0x35')][_0xff57('0x36')]);_0x6afff3[_0xff57('0x39')]=_[_0xff57('0x3a')](_0x16afa2[_0xff57('0x39')]);_0x6afff3[_0xff57('0x3b')]=_[_0xff57('0x3c')](_0x6afff3[_0xff57('0x3d')],_0x6afff3[_0xff57('0x39')]);_0x18cb52[_0xff57('0x3e')]=_[_0xff57('0x3c')](_0x6afff3[_0xff57('0x3d')],qs[_0xff57('0x3f')](_0x16afa2[_0xff57('0x39')][_0xff57('0x3f')]));_0x18cb52[_0xff57('0x3e')]=_0x18cb52[_0xff57('0x3e')][_0xff57('0x40')]?_0x18cb52['attributes']:_0x6afff3[_0xff57('0x3d')];if(_0x16afa2[_0xff57('0x39')][_0xff57('0x49')]){_0x18cb52[_0xff57('0x4a')]=[{'all':!![]}];}_0x18cb52=_['merge']({},_0x18cb52,_0x16afa2['options']);return db['Plugin'][_0xff57('0x4f')](_0x18cb52)[_0xff57('0x2b')](handleEntityNotFound(_0x222042,null))['then'](respondWithResult(_0x222042,null))[_0xff57('0x4d')](handleError(_0x222042,null));};exports[_0xff57('0x50')]=function(_0x745ef2,_0x1effcd,_0x342858){return db[_0xff57('0x35')]['find']({'where':{'id':_0x745ef2['params']['id']},'attributes':[_0xff57('0x31'),_0xff57('0x5')],'raw':!![]})[_0xff57('0x2b')](handleEntityNotFound(_0x1effcd,null))['then'](function(_0x29d3af){if(_0x29d3af){var _0xc5089f=path['join'](config[_0xff57('0x51')],'server/files/plugins',util[_0xff57('0x52')]('%s.zip',path[_0xff57('0x53')](_0x29d3af['path'])));var _0x57da62=fs[_0xff57('0x54')](_0xc5089f);var _0x5001e9=archiver(_0xff57('0x55'),{'zlib':{'level':0x9}});_0x5001e9['on'](_0xff57('0x56'),function(_0x51f9d4){if(_0x51f9d4[_0xff57('0x57')]==='ENOENT'){logger[_0xff57('0x30')](_0x51f9d4);}else{throw new db[(_0xff57('0x58'))][(_0xff57('0x59'))](_0xff57('0x5a'));}});_0x5001e9['on'](_0xff57('0x30'),function(_0x3ad5f1){throw new db[(_0xff57('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x5001e9['pipe'](_0x57da62);_0x5001e9['glob'](_0xff57('0x5b'),{'cwd':path['join'](config[_0xff57('0x51')],_0xff57('0x5c'),path['dirname'](_0x29d3af[_0xff57('0x5')])),'ignore':[path[_0xff57('0x5d')](path[_0xff57('0x53')](_0x29d3af[_0xff57('0x5')]),_0xff57('0x5e')),path[_0xff57('0x5d')](path[_0xff57('0x53')](_0x29d3af['path']),_0xff57('0x5f'))],'nodir':!![]})[_0xff57('0x60')]();_0x57da62['on'](_0xff57('0x61'),function(){if(!fs[_0xff57('0x62')](_0xc5089f)){throw new db['Sequelize'][(_0xff57('0x59'))](_0xff57('0x63'));}return _0x1effcd[_0xff57('0x50')](_0xc5089f,util[_0xff57('0x52')](_0xff57('0x64'),path[_0xff57('0x53')](_0x29d3af['path'])),function(_0x3ed030){if(_0x3ed030){throw new db['Sequelize'][(_0xff57('0x59'))](_0xff57('0x65'));}fs[_0xff57('0x66')](_0xc5089f);logger[_0xff57('0x67')]('Download\x20completed');logger[_0xff57('0x67')](_0xff57('0x68'));});});}return null;})[_0xff57('0x4d')](handleError(_0x1effcd,null));};exports['upload']=function(_0xf0c66e,_0x1efdc2,_0x41d79d){var _0x136ab9=path[_0xff57('0x53')](_0xf0c66e[_0xff57('0x69')][_0xff57('0x6a')],path[_0xff57('0x6b')](_0xf0c66e['file'][_0xff57('0x6a')]));var _0x8d4d5f=path[_0xff57('0x5d')](config[_0xff57('0x51')],_0xff57('0x5c'),_0xf0c66e[_0xff57('0x69')]['filename']);var _0x1a3468=path[_0xff57('0x5d')](config[_0xff57('0x51')],_0xff57('0x5c'),_0x136ab9);logger['info'](_0xff57('0x6c'),_0x8d4d5f);logger[_0xff57('0x67')](_0xff57('0x6d'),_0x1a3468);try{fs['chmodSync'](_0x8d4d5f,parseInt('0777',0x8));extract(_0x8d4d5f,{'dir':_0x1a3468},function(_0x198f33){if(_0x198f33){logger[_0xff57('0x30')](_0x198f33);handleError(_0x198f33,!![]);};var _0x26ac82=fs['readdirSync'](_0x1a3468);if(_0x26ac82[_0xff57('0x40')]>0x1){removeReferences(_0x8d4d5f,_0x1a3468);logger[_0xff57('0x30')](_0xff57('0x6e'));return _0x41d79d(new Error(_0xff57('0x6e')));}var _0x2ca768=fs[_0xff57('0x6f')](path['join'](_0x1a3468,_0x26ac82[0x0]));if(_0x2ca768[_0xff57('0x70')]()){removeReferences(_0x8d4d5f,_0x1a3468);logger[_0xff57('0x30')](_0xff57('0x6e'));return _0x41d79d(new Error(_0xff57('0x6e')));}if(_0x2ca768[_0xff57('0x71')]()){var _0x337a2d=fs[_0xff57('0x72')](path[_0xff57('0x5d')](_0x1a3468,_0x26ac82[0x0]));if(_0x337a2d['length']===0x0){removeReferences(_0x8d4d5f,_0x1a3468);logger[_0xff57('0x30')]('Invalid\x20plugin\x20structure');return _0x41d79d(new Error('Invalid\x20plugin\x20structure'));}var _0x16d74b=_0x337a2d['some'](function(_0x19b512){return _0x19b512==='manifest.json';});if(!_0x16d74b){return _0x41d79d(new Error(_0xff57('0x73')));}var _0x3f8744=fs[_0xff57('0x74')](path['join'](_0x1a3468,_0x26ac82[0x0],_0xff57('0x75')));var _0x4cf847=JSON[_0xff57('0x76')](_0x3f8744);if(_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x31')]){return _0x41d79d(new Error(_0xff57('0x77')));}if(_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x38')]){return _0x41d79d(new Error(_0xff57('0x78')));}if(_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x79')]){return _0x41d79d(new Error(_0xff57('0x7a')));}if('undefined'==typeof _0x4cf847[_0xff57('0x7b')]){return _0x41d79d(new Error(_0xff57('0x7c')));}if(_0x4cf847[_0xff57('0x38')]==='html'){if('undefined'==typeof _0x4cf847[_0xff57('0x7b')]['views']){return _0x41d79d(new Error(_0xff57('0x7d')));}if(_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x7b')][_0xff57('0x7e')]['admin']&&_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x7b')]['views'][_0xff57('0x7f')]){return _0x41d79d(new Error(_0xff57('0x80')));}}else if(_0x4cf847[_0xff57('0x38')]===_0xff57('0x81')){if(_0xff57('0x22')==typeof _0x4cf847['parameters'][_0xff57('0x82')]){return _0x41d79d(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xff57('0x22')==typeof _0x4cf847[_0xff57('0x7b')]['scriptPath']){return _0x41d79d(new Error(_0xff57('0x83')));}}else{return _0x41d79d(new Error(_0xff57('0x84')));}var _0x2d6a6d=_0x4cf847[_0xff57('0x31')];var _0x69c96=_0x4cf847[_0xff57('0x85')];var _0x135959=_0x4cf847[_0xff57('0x38')];var _0x3a9731=_0x4cf847[_0xff57('0x86')]?_0x4cf847[_0xff57('0x86')]:_0xff57('0x87');var _0x125a56=_0x4cf847[_0xff57('0x88')]?_0x4cf847[_0xff57('0x88')]:'icon-apps';var _0x28dcfb='';var _0x14a7e5='';var _0x2bce76='';var _0x39ea86='';var _0x273186=_0x4cf847[_0xff57('0x79')];if(_0x135959===_0xff57('0x89')){if(_0xff57('0x22')!=typeof _0x4cf847['parameters'][_0xff57('0x7e')][_0xff57('0x8a')]){var _0x9e93e9=_0x4cf847[_0xff57('0x7b')]['views'][_0xff57('0x8a')];if(!/^(f|ht)tps?:\/\//i['test'](_0x9e93e9)){_0x28dcfb=path[_0xff57('0x5d')](_0xff57('0x8b'),_0x136ab9,_0x26ac82[0x0],_0x9e93e9);}else{_0x28dcfb=_0x9e93e9;}}else{logger[_0xff57('0x67')](_0xff57('0x8c'));}if('undefined'!=typeof _0x4cf847[_0xff57('0x7b')][_0xff57('0x7e')]['agent']){var _0x19fd96=_0x4cf847[_0xff57('0x7b')][_0xff57('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xff57('0x8d')](_0x19fd96)){_0x14a7e5=path[_0xff57('0x5d')](_0xff57('0x8b'),_0x136ab9,_0x26ac82[0x0],_0x19fd96);}else{_0x14a7e5=_0x19fd96;}}else{logger[_0xff57('0x67')](_0xff57('0x8e'));}}else if(_0x135959==='script'){_0x2bce76=_0x4cf847['parameters'][_0xff57('0x82')];_0x39ea86=_0x4cf847['parameters']['scriptPath'];if('undefined'!=typeof _0x4cf847['parameters']['views']){if(_0xff57('0x22')!=typeof _0x4cf847['parameters']['views'][_0xff57('0x8a')]){var _0x9e93e9=_0x4cf847['parameters'][_0xff57('0x7e')][_0xff57('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xff57('0x8d')](_0x9e93e9)){_0x28dcfb=path[_0xff57('0x5d')](_0xff57('0x8b'),_0x136ab9,_0x26ac82[0x0],_0x9e93e9);}else{_0x28dcfb=_0x9e93e9;}}if(_0xff57('0x22')!=typeof _0x4cf847['parameters'][_0xff57('0x7e')][_0xff57('0x7f')]){var _0x19fd96=_0x4cf847[_0xff57('0x7b')][_0xff57('0x7e')][_0xff57('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xff57('0x8d')](_0x19fd96)){_0x14a7e5=path[_0xff57('0x5d')](_0xff57('0x8b'),_0x136ab9,_0x26ac82[0x0],_0x19fd96);}else{_0x14a7e5=_0x19fd96;}}}}var _0x4d839f={'name':_0x2d6a6d,'description':_0x69c96,'path':path['join'](_0x136ab9,_0x26ac82[0x0]),'type':_0x135959,'sidebar':_0x3a9731,'icon':_0x125a56,'adminUrl':_0x28dcfb,'agentUrl':_0x14a7e5,'scriptName':_0x2bce76,'scriptPath':_0x39ea86,'version':_0x273186};removeReferences(_0x8d4d5f,null);return db[_0xff57('0x35')][_0xff57('0x8f')](_0x4d839f)[_0xff57('0x2b')](function(_0x5f4f74){var _0x55da0e={'role':_0xf0c66e[_0xff57('0x90')][_0xff57('0x91')],'userProfileId':_0xf0c66e[_0xff57('0x90')][_0xff57('0x92')]};if(!_0x55da0e)throw new Error(_0xff57('0x93'));if(_0x55da0e[_0xff57('0x91')]===_0xff57('0x94')){var _0x510c39=_0x5f4f74[_0xff57('0x2d')]({'plain':!![]});return db[_0xff57('0x95')][_0xff57('0x4f')]({'where':{'name':_0xff57('0x2e'),'userProfileId':_0x55da0e['userProfileId']},'raw':!![]})[_0xff57('0x2b')](function(_0x4eae10){if(_0x4eae10&&_0x4eae10[_0xff57('0x96')]===0x0){return db[_0xff57('0x2f')][_0xff57('0x8f')]({'name':_0x510c39[_0xff57('0x31')],'resourceId':_0x510c39['id'],'type':_0x4eae10[_0xff57('0x31')],'sectionId':_0x4eae10['id']},{})[_0xff57('0x2b')](function(){return _0x5f4f74;});}else{return _0x5f4f74;}})[_0xff57('0x4d')](function(_0x389df1){logger[_0xff57('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x389df1);throw _0x389df1;});}return _0x5f4f74;})[_0xff57('0x2b')](respondWithResult(_0x1efdc2,null))[_0xff57('0x4d')](handleError(_0x1efdc2,null));}});}catch(_0x44be40){_0x1efdc2[_0xff57('0x1f')](0x1f4)[_0xff57('0x32')](_0x44be40);}};function removeReferences(_0x5c5219,_0x471165){try{if(_0x5c5219){fs[_0xff57('0x66')](_0x5c5219);logger[_0xff57('0x67')](_0xff57('0x97'));}if(_0x471165){rimraf(_0x471165,function(){});logger['info']('Extracted\x20folder\x20removed');}}catch(_0x46c2cc){logger['error'](_0x46c2cc);}}exports[_0xff57('0x2a')]=function(_0x357a02,_0x211389,_0x52bd7e){return db[_0xff57('0x35')]['find']({'where':{'id':_0x357a02['params']['id']}})['then'](handleEntityNotFound(_0x211389,null))['then'](saveUpdates(_0x357a02[_0xff57('0x90')],null))[_0xff57('0x2b')](respondWithResult(_0x211389,null))[_0xff57('0x4d')](handleError(_0x211389,null));};exports['delete']=function(_0x35cca6,_0x3563e9,_0x5550f6){return db[_0xff57('0x35')][_0xff57('0x4f')]({'where':{'id':_0x35cca6[_0xff57('0x4e')]['id']}})[_0xff57('0x2b')](function(_0x55adea){if(_0x55adea){return _0x55adea['destroy']();}})[_0xff57('0x2b')](function(_0x47b07d){rimraf(path['join'](config[_0xff57('0x51')],'server/files/plugins',path[_0xff57('0x98')](_0x47b07d[_0xff57('0x5')])),function(){});return _0x47b07d;})[_0xff57('0x2b')](handleEntityNotFound(_0x3563e9,null))['then'](respondWithStatusCode(_0x3563e9,null))['catch'](handleError(_0x3563e9,null));};exports[_0xff57('0x99')]=function(_0x55132b,_0x1a5486,_0x954d6c){return BPromise[_0xff57('0x9a')]()[_0xff57('0x2b')](function(){if(!_0x55132b[_0xff57('0x39')][_0xff57('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x55132b[_0xff57('0x39')]['port']){throw new Error(_0xff57('0x9b'));}var _0x5adfc6=_0x55132b[_0xff57('0x39')][_0xff57('0x9c')]?_0x55132b['query'][_0xff57('0x9c')]+':'+_0x55132b[_0xff57('0x39')]['port']:_0xff57('0x9d')+_0x55132b['query'][_0xff57('0x9e')];var _0x4695c9=_0x55132b['query'][_0xff57('0x20')]?_0x55132b[_0xff57('0x39')][_0xff57('0x20')]:!![];var _0x27541f=_0x55132b[_0xff57('0x39')][_0xff57('0x9f')]?_0x55132b['query']['encoding']:null;var _0xa86762={'method':_0x55132b[_0xff57('0xa0')],'uri':util['format'](_0xff57('0xa1'),_0x5adfc6,_0x55132b[_0xff57('0x39')][_0xff57('0x5')]),'json':_0x4695c9,'resolveWithFullResponse':!![],'encoding':_0x27541f,'qs':_0x55132b[_0xff57('0x39')]};if(_0x55132b[_0xff57('0xa2')]){_0xa86762['headers']=_0x55132b[_0xff57('0xa2')];if(_0xa86762[_0xff57('0xa2')][_0xff57('0xa3')]){delete _0xa86762['headers']['content-length'];}}if(_0xa86762[_0xff57('0xa2')][_0xff57('0xa4')]){delete _0xa86762[_0xff57('0xa2')][_0xff57('0xa4')];}return rp(_0xa86762);})[_0xff57('0x2b')](function(_0x2a1916){if(_0x2a1916){_0x1a5486[_0xff57('0x25')](_0x2a1916[_0xff57('0xa2')]);logger[_0xff57('0x67')](_0x2a1916[_0xff57('0x90')]);if(_[_0xff57('0xa5')](_0x55132b[_0xff57('0x39')][_0xff57('0x5')],_0xff57('0x50'))&&_0x2a1916[_0xff57('0xa6')]==0x1f4){return _0x1a5486[_0xff57('0xa7')](_0x2a1916[_0xff57('0xa6')]);}else{return _0x1a5486[_0xff57('0x1f')](_0x2a1916[_0xff57('0xa6')])[_0xff57('0x32')](_0x2a1916[_0xff57('0x90')]);}}else{return _0x1a5486[_0xff57('0xa7')](0xc8);}})['catch'](handleError(_0x1a5486,null));};exports[_0xff57('0xa8')]=function(_0x5a0ba2,_0x14a29b,_0x168d56){return BPromise[_0xff57('0x9a')]()[_0xff57('0x2b')](function(){if(!_0x5a0ba2['query'][_0xff57('0x5')]){throw new Error(_0xff57('0xa9'));}if(!_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9e')]){throw new Error(_0xff57('0x9b'));}var _0x53cd73=_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9c')]?_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9c')]+':'+_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9e')]:_0xff57('0x9d')+_0x5a0ba2['query'][_0xff57('0x9e')];var _0x97d259=_0x5a0ba2[_0xff57('0x39')][_0xff57('0x20')]?_0x5a0ba2[_0xff57('0x39')][_0xff57('0x20')]:!![];var _0x206643=_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9f')]?_0x5a0ba2[_0xff57('0x39')][_0xff57('0x9f')]:null;var _0x9689e6={'method':_0x5a0ba2[_0xff57('0xa0')],'uri':util[_0xff57('0x52')](_0xff57('0xa1'),_0x53cd73,_0x5a0ba2[_0xff57('0x39')][_0xff57('0x5')]),'json':_0x97d259,'resolveWithFullResponse':!![],'encoding':_0x206643,'body':_0x5a0ba2[_0xff57('0x90')]};if(_0x5a0ba2[_0xff57('0xa2')]){_0x9689e6['headers']=_0x5a0ba2[_0xff57('0xa2')];if(_0x9689e6['headers'][_0xff57('0xa3')]){delete _0x9689e6['headers'][_0xff57('0xa3')];}}if(_0x9689e6['headers'][_0xff57('0xa4')]){delete _0x9689e6[_0xff57('0xa2')][_0xff57('0xa4')];}return rp(_0x9689e6);})[_0xff57('0x2b')](function(_0xb35d43){if(_0xb35d43){_0x14a29b[_0xff57('0x25')](_0xb35d43['headers']);logger[_0xff57('0x67')](_0xb35d43['body']);return _0x14a29b['status'](_0xb35d43[_0xff57('0xa6')])[_0xff57('0x32')](_0xb35d43['body']);}else{return _0x14a29b[_0xff57('0xa7')](0xc8);}})[_0xff57('0x4d')](handleError(_0x14a29b,null));};
\ No newline at end of file
index a5b8ba9..62c80ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb2a=['../../mysqldb','Plugin','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5e95ba,_0x3d990e){var _0x3943e7=function(_0x53a0b9){while(--_0x53a0b9){_0x5e95ba['push'](_0x5e95ba['shift']());}};_0x3943e7(++_0x3d990e);}(_0xdb2a,0x16f));var _0xadb2=function(_0x300848,_0x5e93df){_0x300848=_0x300848-0x0;var _0x32114a=_0xdb2a[_0x300848];return _0x32114a;};'use strict';var EventEmitter=require(_0xadb2('0x0'));var Plugin=require(_0xadb2('0x1'))['db'][_0xadb2('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xadb2('0x3'),'afterDestroy':_0xadb2('0x4')};function emitEvent(_0x5a3885){return function(_0x364980,_0x51f39a,_0x3aa5e1){PluginEvents[_0xadb2('0x5')](_0x5a3885+':'+_0x364980['id'],_0x364980);PluginEvents[_0xadb2('0x5')](_0x5a3885,_0x364980);_0x3aa5e1(null);};}for(var e in events){if(events[_0xadb2('0x6')](e)){var event=events[e];Plugin[_0xadb2('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents;
\ No newline at end of file
+var _0x87f1=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x50fc21,_0x34ff9f){var _0x49a00c=function(_0xe80939){while(--_0xe80939){_0x50fc21['push'](_0x50fc21['shift']());}};_0x49a00c(++_0x34ff9f);}(_0x87f1,0x170));var _0x187f=function(_0x3c8c63,_0x5530ea){_0x3c8c63=_0x3c8c63-0x0;var _0x872537=_0x87f1[_0x3c8c63];return _0x872537;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){PluginEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);PluginEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=PluginEvents;
\ No newline at end of file
index 691557e..03c2c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56f3=['util','../../config/logger','api','request-promise','../../config/environment','./plugin.attributes','exports','define','plugins'];(function(_0x4849fa,_0x50280e){var _0x34452e=function(_0x58a1c6){while(--_0x58a1c6){_0x4849fa['push'](_0x4849fa['shift']());}};_0x34452e(++_0x50280e);}(_0x56f3,0x87));var _0x356f=function(_0x5b8e58,_0x49126b){_0x5b8e58=_0x5b8e58-0x0;var _0x5c4500=_0x56f3[_0x5b8e58];return _0x5c4500;};'use strict';var _=require('lodash');var util=require(_0x356f('0x0'));var logger=require(_0x356f('0x1'))(_0x356f('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x356f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x356f('0x4'));var attributes=require(_0x356f('0x5'));module[_0x356f('0x6')]=function(_0x1d31bb,_0x3579c4){return _0x1d31bb[_0x356f('0x7')]('Plugin',attributes,{'tableName':_0x356f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x34d8=['util','../../config/logger','request-promise','path','rimraf','../../config/environment','./plugin.attributes','define','plugins','lodash'];(function(_0x591aad,_0x435cbc){var _0xc88695=function(_0x5402c8){while(--_0x5402c8){_0x591aad['push'](_0x591aad['shift']());}};_0xc88695(++_0x435cbc);}(_0x34d8,0x167));var _0x834d=function(_0x23e030,_0x155e69){_0x23e030=_0x23e030-0x0;var _0x3305dc=_0x34d8[_0x23e030];return _0x3305dc;};'use strict';var _=require(_0x834d('0x0'));var util=require(_0x834d('0x1'));var logger=require(_0x834d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x834d('0x3'));var fs=require('fs');var path=require(_0x834d('0x4'));var rimraf=require(_0x834d('0x5'));var config=require(_0x834d('0x6'));var attributes=require(_0x834d('0x7'));module['exports']=function(_0x1ca2d7,_0x13b441){return _0x1ca2d7[_0x834d('0x8')]('Plugin',attributes,{'tableName':_0x834d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 90c5bdd..7a8dd85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c25=['body','options','raw','CreatePlugin','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Plugin','create'];(function(_0x5e3225,_0x2a218e){var _0x554c54=function(_0x340dfc){while(--_0x340dfc){_0x5e3225['push'](_0x5e3225['shift']());}};_0x554c54(++_0x2a218e);}(_0x9c25,0xaa));var _0x59c2=function(_0x1b2bae,_0x5dd16b){_0x1b2bae=_0x1b2bae-0x0;var _0xfc291a=_0x9c25[_0x1b2bae];return _0xfc291a;};'use strict';var _=require(_0x59c2('0x0'));var util=require('util');var moment=require(_0x59c2('0x1'));var BPromise=require(_0x59c2('0x2'));var rs=require(_0x59c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x59c2('0x5'))('rpc');var config=require(_0x59c2('0x6'));var jayson=require(_0x59c2('0x7'));var client=jayson[_0x59c2('0x8')][_0x59c2('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x59c2('0xa')],{'host':_0x59c2('0xb'),'port':0x18eb});var socket=require(_0x59c2('0xc'))(new Redis(config[_0x59c2('0xa')]));require(_0x59c2('0xd'))[_0x59c2('0xe')](socket);function respondWithRpcPromise(_0x264ee5,_0x4206b9,_0x1cda1a){return new BPromise(function(_0x562fb3,_0x204a46){return client[_0x59c2('0xf')](_0x264ee5,_0x1cda1a)[_0x59c2('0x10')](function(_0x15c856){logger[_0x59c2('0x11')](_0x59c2('0x12'),_0x4206b9,_0x59c2('0x13'));logger[_0x59c2('0x14')](_0x59c2('0x15'),_0x4206b9,_0x59c2('0x13'),JSON[_0x59c2('0x16')](_0x15c856));if(_0x15c856[_0x59c2('0x17')]){if(_0x15c856[_0x59c2('0x17')]['code']===0x1f4){logger[_0x59c2('0x17')]('Plugin,\x20%s,\x20%s',_0x4206b9,_0x15c856[_0x59c2('0x17')][_0x59c2('0x18')]);return _0x204a46(_0x15c856[_0x59c2('0x17')][_0x59c2('0x18')]);}logger[_0x59c2('0x17')](_0x59c2('0x12'),_0x4206b9,_0x15c856['error'][_0x59c2('0x18')]);return _0x562fb3(_0x15c856[_0x59c2('0x17')][_0x59c2('0x18')]);}else{logger[_0x59c2('0x11')](_0x59c2('0x12'),_0x4206b9,_0x59c2('0x13'));_0x562fb3(_0x15c856[_0x59c2('0x19')]['message']);}})['catch'](function(_0x2b9d9e){logger[_0x59c2('0x17')](_0x59c2('0x12'),_0x4206b9,_0x2b9d9e);_0x204a46(_0x2b9d9e);});});}exports['CreatePlugin']=function(_0x43f498){var _0x556e88=this;return new Promise(function(_0x405674,_0xfb53ec){return db[_0x59c2('0x1a')][_0x59c2('0x1b')](_0x43f498[_0x59c2('0x1c')],{'raw':_0x43f498[_0x59c2('0x1d')]?_0x43f498['options'][_0x59c2('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x8aeeeb){logger['info'](_0x59c2('0x1f'),_0x43f498);logger[_0x59c2('0x14')]('CreatePlugin',_0x43f498,JSON['stringify'](_0x8aeeeb));_0x405674(_0x8aeeeb);})[_0x59c2('0x20')](function(_0xbe69e3){logger['error'](_0x59c2('0x1f'),_0xbe69e3[_0x59c2('0x18')],_0x43f498);_0xfb53ec(_0x556e88['error'](0x1f4,_0xbe69e3['message']));});});};
\ No newline at end of file
+var _0xd21b=['bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','Plugin,\x20%s,\x20%s','debug','stringify','error','message','info','catch','Plugin','create','body','options','CreatePlugin','moment'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0xd21b,0xcf));var _0xbd21=function(_0x348b29,_0x3be5e9){_0x348b29=_0x348b29-0x0;var _0xc260c5=_0xd21b[_0x348b29];return _0xc260c5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbd21('0x0'));var BPromise=require(_0xbd21('0x1'));var rs=require(_0xbd21('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd21('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbd21('0x4'));var config=require('../../config/environment');var jayson=require(_0xbd21('0x5'));var client=jayson[_0xbd21('0x6')]['http']({'port':0x232a});config[_0xbd21('0x7')]=_[_0xbd21('0x8')](config['redis'],{'host':_0xbd21('0x9'),'port':0x18eb});var socket=require(_0xbd21('0xa'))(new Redis(config['redis']));require('./plugin.socket')[_0xbd21('0xb')](socket);function respondWithRpcPromise(_0x34e61c,_0x155e23,_0x20c37f){return new BPromise(function(_0x5c9958,_0x502b17){return client[_0xbd21('0xc')](_0x34e61c,_0x20c37f)[_0xbd21('0xd')](function(_0x250fa6){logger['info'](_0xbd21('0xe'),_0x155e23,'request\x20sent');logger[_0xbd21('0xf')]('Plugin,\x20%s,\x20%s,\x20%s',_0x155e23,'request\x20sent',JSON[_0xbd21('0x10')](_0x250fa6));if(_0x250fa6[_0xbd21('0x11')]){if(_0x250fa6['error']['code']===0x1f4){logger[_0xbd21('0x11')](_0xbd21('0xe'),_0x155e23,_0x250fa6['error'][_0xbd21('0x12')]);return _0x502b17(_0x250fa6['error'][_0xbd21('0x12')]);}logger['error'](_0xbd21('0xe'),_0x155e23,_0x250fa6[_0xbd21('0x11')][_0xbd21('0x12')]);return _0x5c9958(_0x250fa6[_0xbd21('0x11')]['message']);}else{logger[_0xbd21('0x13')]('Plugin,\x20%s,\x20%s',_0x155e23,'request\x20sent');_0x5c9958(_0x250fa6['result'][_0xbd21('0x12')]);}})[_0xbd21('0x14')](function(_0x3d14a1){logger['error'](_0xbd21('0xe'),_0x155e23,_0x3d14a1);_0x502b17(_0x3d14a1);});});}exports['CreatePlugin']=function(_0x59d1b0){var _0x48f387=this;return new Promise(function(_0x5b735e,_0x22b6a3){return db[_0xbd21('0x15')][_0xbd21('0x16')](_0x59d1b0[_0xbd21('0x17')],{'raw':_0x59d1b0[_0xbd21('0x18')]?_0x59d1b0[_0xbd21('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xbd21('0xd')](function(_0x52bf86){logger[_0xbd21('0x13')](_0xbd21('0x19'),_0x59d1b0);logger[_0xbd21('0xf')]('CreatePlugin',_0x59d1b0,JSON[_0xbd21('0x10')](_0x52bf86));_0x5b735e(_0x52bf86);})['catch'](function(_0x523b11){logger[_0xbd21('0x11')]('CreatePlugin',_0x523b11[_0xbd21('0x12')],_0x59d1b0);_0x22b6a3(_0x48f387[_0xbd21('0x11')](0x1f4,_0x523b11[_0xbd21('0x12')]));});});};
\ No newline at end of file
index df91199..441a723 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba48=['emit','removeListener','register','length','plugin:','./plugin.events','save','remove','update'];(function(_0x4c8f89,_0x318d19){var _0x5c5685=function(_0x28ea15){while(--_0x28ea15){_0x4c8f89['push'](_0x4c8f89['shift']());}};_0x5c5685(++_0x318d19);}(_0xba48,0x101));var _0x8ba4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xba48[_0x49ca18];return _0x145d54;};'use strict';var PluginEvents=require(_0x8ba4('0x0'));var events=[_0x8ba4('0x1'),_0x8ba4('0x2'),_0x8ba4('0x3')];function createListener(_0x3d9c28,_0x1ea01b){return function(_0xfdb0c3){_0x1ea01b[_0x8ba4('0x4')](_0x3d9c28,_0xfdb0c3);};}function removeListener(_0x2eaf1c,_0x3d3729){return function(){PluginEvents[_0x8ba4('0x5')](_0x2eaf1c,_0x3d3729);};}exports[_0x8ba4('0x6')]=function(_0x209ced){for(var _0xadaa01=0x0,_0x3ab5d3=events[_0x8ba4('0x7')];_0xadaa01<_0x3ab5d3;_0xadaa01++){var _0x3cebee=events[_0xadaa01];var _0x2e10c2=createListener(_0x8ba4('0x8')+_0x3cebee,_0x209ced);PluginEvents['on'](_0x3cebee,_0x2e10c2);}};
\ No newline at end of file
+var _0xed7d=['update','removeListener','register','./plugin.events','save'];(function(_0x232326,_0x15a309){var _0x2c9cf7=function(_0x33d769){while(--_0x33d769){_0x232326['push'](_0x232326['shift']());}};_0x2c9cf7(++_0x15a309);}(_0xed7d,0x1ed));var _0xded7=function(_0x243d52,_0x2d5634){_0x243d52=_0x243d52-0x0;var _0xbbf923=_0xed7d[_0x243d52];return _0xbbf923;};'use strict';var PluginEvents=require(_0xded7('0x0'));var events=[_0xded7('0x1'),'remove',_0xded7('0x2')];function createListener(_0x2abbd9,_0x3c1889){return function(_0x397408){_0x3c1889['emit'](_0x2abbd9,_0x397408);};}function removeListener(_0x49001e,_0x34667f){return function(){PluginEvents[_0xded7('0x3')](_0x49001e,_0x34667f);};}exports[_0xded7('0x4')]=function(_0x1019a6){for(var _0x6cc91e=0x0,_0x302a7d=events['length'];_0x6cc91e<_0x302a7d;_0x6cc91e++){var _0x432894=events[_0x6cc91e];var _0x58f6f2=createListener('plugin:'+_0x432894,_0x1019a6);PluginEvents['on'](_0x432894,_0x58f6f2);}};
\ No newline at end of file
index a5414d4..bf60241 100644 (file)
@@ -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(_0x470f4f,_0x3c3290){var _0xae867f=function(_0x2a0712){while(--_0x2a0712){_0x470f4f['push'](_0x470f4f['shift']());}};_0xae867f(++_0x3c3290);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x5ab453,_0x5f07a8){var _0x363b89=function(_0x3fcf1e){while(--_0x3fcf1e){_0x5ab453['push'](_0x5ab453['shift']());}};_0x363b89(++_0x5f07a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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
index 5d602ed..b680e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde2c=['start','dump','update','restart','stop','hasOwnProperty','params','destroy','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status','json','error','stack','name','send','info','list','reject','express','motion2','then','catch','show','create','body','script','cwd','chdir','dirname'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xde2c,0x7f));var _0xcde2=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0xde2c[_0x5c6299];return _0x23b564;};'use strict';var _=require(_0xcde2('0x0'));var pm2=require(_0xcde2('0x1'));var logger=require(_0xcde2('0x2'))(_0xcde2('0x3'));var path=require(_0xcde2('0x4'));var exec=require(_0xcde2('0x5'))[_0xcde2('0x6')];var BPromise=require(_0xcde2('0x7'));function handleEntityNotFound(_0x55c175,_0x4353c8){return function(_0x196898){if(!_0x196898){_0x55c175[_0xcde2('0x8')](0x194);;}return _0x196898;};}function respondWithResult(_0x1398de,_0x401b16){_0x401b16=_0x401b16||0xc8;return function(_0x53c558){if(_0x53c558){return _0x1398de[_0xcde2('0x9')](_0x401b16)[_0xcde2('0xa')](_0x53c558);}return null;};}function handleError(_0x9c7036,_0x544235){_0x544235=_0x544235||0x1f4;return function(_0x582a6c){logger[_0xcde2('0xb')](_0x582a6c[_0xcde2('0xc')]);if(_0x582a6c['name']){delete _0x582a6c[_0xcde2('0xd')];}_0x9c7036[_0xcde2('0x9')](_0x544235)[_0xcde2('0xe')](_0x582a6c);};}function execChildProcess(){return new BPromise(function(_0x127358,_0x54b7c5){exec('npm\x20install',function(_0x25677f,_0x1bc697,_0x3b1333){logger[_0xcde2('0xf')](_0x1bc697);logger[_0xcde2('0xf')](_0x3b1333);if(_0x25677f){logger[_0xcde2('0xb')](_0x25677f);return _0x54b7c5(_0x25677f);}return _0x127358(_0x1bc697);});});}exports['index']=function(_0x211215,_0x577062){return pm2[_0xcde2('0x10')]()['then'](function(_0x4b0e0e){if(_0x4b0e0e){var _0x34e079=_[_0xcde2('0x11')](_0x4b0e0e,function(_0x417505){return _0x417505[_0xcde2('0xd')]===_0xcde2('0x12')||_0x417505['name']===_0xcde2('0x13');});return{'rows':_0x34e079,'count':_0x34e079['length']};}return null;})[_0xcde2('0x14')](respondWithResult(_0x577062,null))[_0xcde2('0x15')](handleError(_0x577062,null));};exports[_0xcde2('0x16')]=function(_0x1f1858,_0x5223f1){return pm2['describe'](_0x1f1858['params']['id'])[_0xcde2('0x14')](respondWithResult(_0x5223f1,null))['then'](handleEntityNotFound(_0x5223f1,null))[_0xcde2('0x15')](handleError(_0x5223f1,null));};exports[_0xcde2('0x17')]=function(_0x252372,_0x481fc0){if(_0x252372[_0xcde2('0x18')][_0xcde2('0xd')]&&_0x252372[_0xcde2('0x18')][_0xcde2('0x19')]){var _0x43df7a=path['join'](__dirname,'../../files/plugins',_0x252372['body'][_0xcde2('0x19')]);var _0x3e5170=process[_0xcde2('0x1a')]();process[_0xcde2('0x1b')](path[_0xcde2('0x1c')](_0x43df7a));return execChildProcess()['then'](function(_0x1104b8){process['chdir'](_0x3e5170);return pm2[_0xcde2('0x1d')]({'name':_0x252372[_0xcde2('0x18')][_0xcde2('0xd')],'script':_0x43df7a});})['then'](function(_0x593aa4){pm2[_0xcde2('0x1e')]();return _0x593aa4[0x0];})[_0xcde2('0x14')](respondWithResult(_0x481fc0,0xc9))[_0xcde2('0x15')](handleError(_0x481fc0,null));}else{return _0x481fc0[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xcde2('0x1f')]=function(_0x45275a,_0x1dce65){if(_0x45275a['body']['id']){delete _0x45275a[_0xcde2('0x18')]['id'];}var _0x348ca1={'online':_0xcde2('0x20'),'stopped':_0xcde2('0x21')};if(_0x348ca1[_0xcde2('0x22')](_0x45275a[_0xcde2('0x18')][_0xcde2('0x9')])){return pm2[_0x348ca1[_0x45275a[_0xcde2('0x18')]['status']]](_0x45275a[_0xcde2('0x23')]['id'])['then'](respondWithResult(_0x1dce65,0xc8))[_0xcde2('0x15')](handleError(_0x1dce65,null));}else{return _0x1dce65[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':'Unknown\x20status'});}};exports[_0xcde2('0x24')]=function(_0x28fedd,_0x58afb1){if(_0x28fedd[_0xcde2('0x18')]['id']){delete _0x28fedd[_0xcde2('0x18')]['id'];}if(_0x28fedd[_0xcde2('0x23')]['id']){return pm2[_0xcde2('0x25')](_0x28fedd[_0xcde2('0x23')]['id'])[_0xcde2('0x14')](function(_0x11b817){pm2[_0xcde2('0x1e')]();return _0x11b817[0x0];})['then'](respondWithResult(_0x58afb1,null))[_0xcde2('0x15')](handleError(_0x58afb1,null));}else{return _0x58afb1[_0xcde2('0x9')](0x1f4)[_0xcde2('0xe')]({'message':_0xcde2('0x26')});}};
\ No newline at end of file
+var _0x55e0=['hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','exec','bluebird','sendStatus','json','error','name','status','send','info','index','then','reject','express','motion2','catch','show','params','body','script','join','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','update','restart'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x55e0,0xdc));var _0x055e=function(_0x48eecb,_0x4cc6cd){_0x48eecb=_0x48eecb-0x0;var _0x21caa9=_0x55e0[_0x48eecb];return _0x21caa9;};'use strict';var _=require(_0x055e('0x0'));var pm2=require(_0x055e('0x1'));var logger=require(_0x055e('0x2'))(_0x055e('0x3'));var path=require('path');var exec=require('child_process')[_0x055e('0x4')];var BPromise=require(_0x055e('0x5'));function handleEntityNotFound(_0x33cd7b,_0x2773e4){return function(_0x157473){if(!_0x157473){_0x33cd7b[_0x055e('0x6')](0x194);;}return _0x157473;};}function respondWithResult(_0x490ee1,_0x5239f6){_0x5239f6=_0x5239f6||0xc8;return function(_0x4384ff){if(_0x4384ff){return _0x490ee1['status'](_0x5239f6)[_0x055e('0x7')](_0x4384ff);}return null;};}function handleError(_0x3c4cf,_0x376618){_0x376618=_0x376618||0x1f4;return function(_0x230c32){logger[_0x055e('0x8')](_0x230c32['stack']);if(_0x230c32[_0x055e('0x9')]){delete _0x230c32[_0x055e('0x9')];}_0x3c4cf[_0x055e('0xa')](_0x376618)[_0x055e('0xb')](_0x230c32);};}function execChildProcess(){return new BPromise(function(_0x238068,_0x5237d9){exec('npm\x20install',function(_0x187cce,_0x51c524,_0x3c44b2){logger[_0x055e('0xc')](_0x51c524);logger[_0x055e('0xc')](_0x3c44b2);if(_0x187cce){logger[_0x055e('0x8')](_0x187cce);return _0x5237d9(_0x187cce);}return _0x238068(_0x51c524);});});}exports[_0x055e('0xd')]=function(_0x31c649,_0x236a2b){return pm2['list']()[_0x055e('0xe')](function(_0xb80d83){if(_0xb80d83){var _0x3cfd14=_[_0x055e('0xf')](_0xb80d83,function(_0x222817){return _0x222817['name']===_0x055e('0x10')||_0x222817[_0x055e('0x9')]===_0x055e('0x11');});return{'rows':_0x3cfd14,'count':_0x3cfd14['length']};}return null;})[_0x055e('0xe')](respondWithResult(_0x236a2b,null))[_0x055e('0x12')](handleError(_0x236a2b,null));};exports[_0x055e('0x13')]=function(_0x2bad86,_0x2cc84e){return pm2['describe'](_0x2bad86[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x2cc84e,null))[_0x055e('0xe')](handleEntityNotFound(_0x2cc84e,null))[_0x055e('0x12')](handleError(_0x2cc84e,null));};exports['create']=function(_0x4004ce,_0x3cdd68){if(_0x4004ce['body'][_0x055e('0x9')]&&_0x4004ce[_0x055e('0x15')][_0x055e('0x16')]){var _0x124d86=path[_0x055e('0x17')](__dirname,_0x055e('0x18'),_0x4004ce['body'][_0x055e('0x16')]);var _0x2f0346=process[_0x055e('0x19')]();process['chdir'](path[_0x055e('0x1a')](_0x124d86));return execChildProcess()[_0x055e('0xe')](function(_0x32c64e){process[_0x055e('0x1b')](_0x2f0346);return pm2['start']({'name':_0x4004ce[_0x055e('0x15')]['name'],'script':_0x124d86});})[_0x055e('0xe')](function(_0x42a6aa){pm2[_0x055e('0x1c')]();return _0x42a6aa[0x0];})[_0x055e('0xe')](respondWithResult(_0x3cdd68,0xc9))[_0x055e('0x12')](handleError(_0x3cdd68,null));}else{return _0x3cdd68[_0x055e('0xa')](0x1f4)['send']({'message':_0x055e('0x1d')});}};exports[_0x055e('0x1e')]=function(_0x2a82f8,_0x4b5891){if(_0x2a82f8[_0x055e('0x15')]['id']){delete _0x2a82f8[_0x055e('0x15')]['id'];}var _0x42f2df={'online':_0x055e('0x1f'),'stopped':'stop'};if(_0x42f2df[_0x055e('0x20')](_0x2a82f8['body'][_0x055e('0xa')])){return pm2[_0x42f2df[_0x2a82f8[_0x055e('0x15')][_0x055e('0xa')]]](_0x2a82f8[_0x055e('0x14')]['id'])[_0x055e('0xe')](respondWithResult(_0x4b5891,0xc8))['catch'](handleError(_0x4b5891,null));}else{return _0x4b5891[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':_0x055e('0x21')});}};exports[_0x055e('0x22')]=function(_0x36abb2,_0x225c88){if(_0x36abb2[_0x055e('0x15')]['id']){delete _0x36abb2[_0x055e('0x15')]['id'];}if(_0x36abb2['params']['id']){return pm2[_0x055e('0x23')](_0x36abb2[_0x055e('0x14')]['id'])['then'](function(_0xd9298d){pm2[_0x055e('0x1c')]();return _0xd9298d[0x0];})[_0x055e('0xe')](respondWithResult(_0x225c88,null))[_0x055e('0x12')](handleError(_0x225c88,null));}else{return _0x225c88[_0x055e('0xa')](0x1f4)[_0x055e('0xb')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index 7a14376..d953d53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x429a=['Router','./realtime.controller','get','/agents','isAuthenticated','/queues','express'];(function(_0x5781f3,_0x4352d7){var _0x1b6245=function(_0xdc7ab2){while(--_0xdc7ab2){_0x5781f3['push'](_0x5781f3['shift']());}};_0x1b6245(++_0x4352d7);}(_0x429a,0xd8));var _0xa429=function(_0x55fb83,_0x1d3856){_0x55fb83=_0x55fb83-0x0;var _0x59a87a=_0x429a[_0x55fb83];return _0x59a87a;};'use strict';var express=require(_0xa429('0x0'));var router=express[_0xa429('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa429('0x2'));router[_0xa429('0x3')](_0xa429('0x4'),auth[_0xa429('0x5')](),controller['getAgents']);router[_0xa429('0x3')](_0xa429('0x6'),auth['isAuthenticated'](),controller['getQueues']);module['exports']=router;
\ No newline at end of file
+var _0x3e4b=['get','/queues','getQueues','exports','Router','../../components/auth/service','./realtime.controller','isAuthenticated','getAgents'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x3e4b,0x1f3));var _0xb3e4=function(_0x143ccb,_0xa3a72b){_0x143ccb=_0x143ccb-0x0;var _0x414743=_0x3e4b[_0x143ccb];return _0x414743;};'use strict';var express=require('express');var router=express[_0xb3e4('0x0')]();var auth=require(_0xb3e4('0x1'));var controller=require(_0xb3e4('0x2'));router['get']('/agents',auth[_0xb3e4('0x3')](),controller[_0xb3e4('0x4')]);router[_0xb3e4('0x5')](_0xb3e4('0x6'),auth[_0xb3e4('0x3')](),controller[_0xb3e4('0x7')]);module[_0xb3e4('0x8')]=router;
\ No newline at end of file
index 9889a16..3395dd0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdd9=['name','voice','request','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','then','loggedIn','available','talking','paused','outbound','push','pTalking','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','agents','waiting','busy','find','pick','filter','queue','connectedlinenum','internal','toString','length','UserId','accountcode','online','loggedInDb','User','Queue','getChannels','toLowerCase','Invalid\x20channel','getAgents','query','globalQueueFilter','globalStatusFilter','*pause','channel','sort','includes','globalStatus','getUpdatedSortOptions','fields','order','rows','getAgentIdsByStatus','rawAttributes','fieldName','key','role','getOptions','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','agent','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','pause','Status','sortAgentsByStatus','getQueues','type','getRealtimeAgents','util','lodash','jayson/promise','api','../../mysqldb','client','offset','undefined','limit','count','status','set','Content-Range','json','error','stack'];(function(_0x3f81b0,_0x40dc4b){var _0x1995a2=function(_0x3f0309){while(--_0x3f0309){_0x3f81b0['push'](_0x3f81b0['shift']());}};_0x1995a2(++_0x40dc4b);}(_0xfdd9,0x143));var _0x9fdd=function(_0x215426,_0x365d31){_0x215426=_0x215426-0x0;var _0x36179f=_0xfdd9[_0x215426];return _0x36179f;};'use strict';var util=require(_0x9fdd('0x0'));var _=require(_0x9fdd('0x1'));var jayson=require(_0x9fdd('0x2'));var rta=require('../../components/realtime/agents');var qs=require('../../components/parsers/qs');var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fdd('0x3'));var db=require(_0x9fdd('0x4'))['db'];var amiClient=jayson[_0x9fdd('0x5')]['http']({'port':0x232a});var routingClient=jayson['client']['http']({'port':0x232c});function respondWithFilteredResult(_0x50b831,_0x3c8dab){return function(_0x48ef89){if(_0x48ef89){var _0x1f588d=typeof _0x3c8dab[_0x9fdd('0x6')]===_0x9fdd('0x7')&&typeof _0x3c8dab[_0x9fdd('0x8')]===_0x9fdd('0x7');var _0x1f09df=_0x48ef89[_0x9fdd('0x9')];var _0x46b9ba=_0x1f588d?0x0:_0x3c8dab['offset'];var _0x1d38da=_0x1f588d?_0x48ef89[_0x9fdd('0x9')]:_0x3c8dab[_0x9fdd('0x6')]+_0x3c8dab[_0x9fdd('0x8')];var _0x3803f2;if(_0x1d38da>=_0x1f09df){_0x1d38da=_0x1f09df;_0x3803f2=0xc8;}else{_0x3803f2=0xce;}_0x50b831[_0x9fdd('0xa')](_0x3803f2);return _0x50b831[_0x9fdd('0xb')](_0x9fdd('0xc'),_0x46b9ba+'-'+_0x1d38da+'/'+_0x1f09df)[_0x9fdd('0xd')](_0x48ef89);}return null;};}function handleError(_0xc1804d,_0x30f559){_0x30f559=_0x30f559||0x1f4;return function(_0xad4d77){logger[_0x9fdd('0xe')](_0xad4d77[_0x9fdd('0xf')]);if(_0xad4d77[_0x9fdd('0x10')]){delete _0xad4d77['name'];}_0xc1804d['status'](_0x30f559)['send'](_0xad4d77);};}function getRealtimeQueues(_0x18075a,_0x116932){return new Promise(function(_0x3fe354,_0x2a399a){var _0xbf2da=_0x116932===_0x9fdd('0x11')?amiClient:routingClient;return _0xbf2da[_0x9fdd('0x12')](_[_0x9fdd('0x13')](_0x116932)+_0x9fdd('0x14'),_0x18075a)['then'](function(_0x425ffa){if(_0x425ffa['error'])throw new Error(util[_0x9fdd('0x15')](_0x9fdd('0x16'),_0x116932));return _0x3fe354(_0x425ffa[_0x9fdd('0x17')]);})[_0x9fdd('0x18')](function(_0x2025c5){_0x2a399a(_0x2025c5);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x348b92,_0x191f73){return amiClient[_0x9fdd('0x12')](_0x9fdd('0x19'),{})[_0x9fdd('0x1a')](function(_0x3ad68f){if(_0x3ad68f['error'])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x348b92(_0x3ad68f[_0x9fdd('0x17')]);})[_0x9fdd('0x18')](function(_0x301eef){_0x191f73(_0x301eef);});});}function initializeQueues(_0x3135e6,_0x2176d2,_0x3363ea,_0x3811ab){var _0x483595=[_0x9fdd('0x1b'),_0x9fdd('0x1c'),'waiting',_0x9fdd('0x1d'),_0x9fdd('0x1e')];if(_0x3363ea===_0x9fdd('0x11')&&_0x3811ab===_0x9fdd('0x1f')){_0x483595[_0x9fdd('0x20')](_0x9fdd('0x21'),'originated',_0x9fdd('0x22'),_0x9fdd('0x23'),_0x9fdd('0x24'),'Trunk',_0x9fdd('0x25'),_0x9fdd('0x26'),_0x9fdd('0x27'),'erlangCallToSecond',_0x9fdd('0x28'),_0x9fdd('0x29'),_0x9fdd('0x2a'),_0x9fdd('0x2b'),_0x9fdd('0x2c'),_0x9fdd('0x2d'),_0x9fdd('0x2e'),_0x9fdd('0x2f'),_0x9fdd('0x30'),_0x9fdd('0x31'),_0x9fdd('0x32'),_0x9fdd('0x33'));}return _0x3135e6[_0x9fdd('0x34')](function(_0x372b96){var _0xadce8c=_0x372b96['get']({'plain':!![]});_0xadce8c[_0x9fdd('0x35')]=[];_0xadce8c[_0x9fdd('0x1e')]=0x0;_0xadce8c['loggedInDb']=0x0;_0xadce8c[_0x9fdd('0x1b')]=0x0;_0xadce8c[_0x9fdd('0x1c')]=0x0;_0xadce8c[_0x9fdd('0x36')]=0x0;if(_0x3363ea===_0x9fdd('0x11')){_0xadce8c['talking']=0x0;_0xadce8c[_0x9fdd('0x37')]=0x0;if(_0x3811ab==='outbound'){_0xadce8c[_0x9fdd('0x21')]=0x0;_0xadce8c['originated']=0x0;}}var _0x35e6f6=_[_0x9fdd('0x38')](_0x2176d2,['id',_0xadce8c['id']]);if(_0x35e6f6)_['merge'](_0xadce8c,_[_0x9fdd('0x39')](_0x35e6f6,_0x483595));return _0xadce8c;});}function updateAgentVoiceStatus(_0xc9a200,_0x979fe5,_0x2a14e5){var _0x39c344=_[_0x9fdd('0x3a')](_0x2a14e5,[_0x9fdd('0x3b'),_0x979fe5[_0x9fdd('0x10')]]);if(_0x39c344['length']===0x0)return _0xc9a200['busy']=!![];if(_['some'](_0x39c344,[_0x9fdd('0x3c'),_0xc9a200[_0x9fdd('0x3d')][_0x9fdd('0x3e')]()]))return _0xc9a200[_0x9fdd('0x1d')]=!![];if(!_0xc9a200[_0x9fdd('0x1d')])return _0xc9a200[_0x9fdd('0x37')]=!![];}function getVoiceQueueAgents(_0x4e4826,_0x361f4,_0x372b9d,_0x482b8e){var _0x920dec=_[_0x9fdd('0x38')](_0x361f4,['id',_0x4e4826['id']]);if(!_0x920dec)return _0x4e4826;return _0x920dec['getMembers']({'raw':!![]})[_0x9fdd('0x1a')](function(_0x47a525){for(var _0x57c329=0x0;_0x57c329<_0x47a525[_0x9fdd('0x3f')];_0x57c329++){var _0x298d1f=_[_0x9fdd('0x38')](_0x372b9d,['id',_0x47a525[_0x57c329]['UserId']]);if(!_0x298d1f){_0x298d1f={'id':_0x47a525[_0x57c329][_0x9fdd('0x40')],'name':_0x47a525[_0x57c329][_0x9fdd('0x40')],'accountcode':'','online':![]};}var _0x487a8a={'id':_0x298d1f['id'],'name':_0x298d1f[_0x9fdd('0x10')],'internal':_0x298d1f[_0x9fdd('0x41')],'online':Boolean(_0x298d1f[_0x9fdd('0x42')]),'paused':Boolean(_0x47a525[_0x57c329][_0x9fdd('0x1e')])};if(_0x298d1f['voiceStatus']===_0x9fdd('0x1d'))updateAgentVoiceStatus(_0x487a8a,_0x4e4826,_0x482b8e);if(_0x487a8a[_0x9fdd('0x42')])_0x4e4826[_0x9fdd('0x43')]++;if(_0x487a8a[_0x9fdd('0x37')])_0x4e4826[_0x9fdd('0x37')]++;if(_0x487a8a[_0x9fdd('0x1e')]&&!_0x487a8a[_0x9fdd('0x37')]&&!_0x487a8a[_0x9fdd('0x1d')])_0x4e4826['paused']++;_0x4e4826[_0x9fdd('0x35')][_0x9fdd('0x20')](_0x487a8a);}return _0x4e4826;});}function getQueueAgents(_0x1ca61e,_0x1f1fec,_0x4ae3c2){var _0x1635ec=_0x9fdd('0x44')+_[_0x9fdd('0x13')](_0x4ae3c2)+_0x9fdd('0x45');var _0x226a59=_0x4ae3c2+'Pause';return db[_0x1635ec]['findAll']({'where':{[_[_0x9fdd('0x13')](_0x4ae3c2)+'QueueId']:_0x1ca61e['id']},'raw':!![]})[_0x9fdd('0x1a')](function(_0x8ce22d){for(var _0xa4ac47=0x0;_0xa4ac47<_0x8ce22d[_0x9fdd('0x3f')];_0xa4ac47++){var _0x33bf93=_[_0x9fdd('0x38')](_0x1f1fec,['id',_0x8ce22d[_0xa4ac47][_0x9fdd('0x40')]]);if(!_0x33bf93){_0x33bf93={'id':_0x8ce22d[_0xa4ac47]['UserId'],'name':_0x8ce22d[_0xa4ac47][_0x9fdd('0x40')],'online':![],['pauseField']:![]};}var _0x4dba02={'id':_0x33bf93['id'],'name':_0x33bf93['name'],'online':Boolean(_0x33bf93['online']),'paused':Boolean(_0x33bf93[_0x226a59])};if(_0x4dba02[_0x9fdd('0x42')])_0x1ca61e[_0x9fdd('0x43')]++;_0x1ca61e['agents'][_0x9fdd('0x20')](_0x4dba02);}return _0x1ca61e;});}function validateChannel(_0x44d1d3){var _0x246545=utils[_0x9fdd('0x46')]();if(!_['includes'](_0x246545,_0x44d1d3[_0x9fdd('0x47')]()))throw new Error(_0x9fdd('0x48'));return _0x44d1d3['toLowerCase']();}exports[_0x9fdd('0x49')]=function(_0x5f1773,_0x144956){var _0x1aa3eb={'count':0x0,'rows':[]};var _0x5b3ec8={};var _0x525c84;var _0x2ff8d1;var _0x5e5584;var _0x1a8ea2;var _0x55dc7f=utils[_0x9fdd('0x46')]();var _0x395587=_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4b')];var _0x41628d=_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4c')];var _0x2d5cda=_0x5f1773[_0x9fdd('0x4a')]['pauseTypeFilter'];var _0x160bd8=_0x41628d==='pause'||_0x41628d===_0x9fdd('0x4d')?!![]:![];var _0x4c25a5=[];var _0x556db5;Promise['resolve']()[_0x9fdd('0x1a')](function(){if(_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4e')]){_0x525c84=validateChannel(_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4e')]);}if(!_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4f')]||!_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4f')][_0x9fdd('0x50')](_0x9fdd('0x51'))){_0x5f1773[_0x9fdd('0x4a')]['sort']=rta['validateSortParameter'](_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x4f')]);return;}var _0x3ed28e=rta[_0x9fdd('0x52')](_0x5f1773['query']['sort']);_0x5f1773['query'][_0x9fdd('0x4f')]=_0x3ed28e[_0x9fdd('0x53')]['join'](',');_0x2ff8d1=_0x3ed28e[_0x9fdd('0x54')];})[_0x9fdd('0x1a')](function(){if(!_0x395587){return[];}return rta['getAgentIdsByQueues'](_0x395587,_0x525c84);})['then'](function(_0x2c96a2){_0x4c25a5=_0x2c96a2;return rta['getRealtimeAgents']();})[_0x9fdd('0x1a')](function(_0x3a669c){_0x1a8ea2=_0x3a669c[_0x9fdd('0x55')];if((!_0x41628d||_0x160bd8)&&!_0x2ff8d1){return _0x4c25a5;}if(_0x2ff8d1&&!_0x41628d){return rta['getSortedAgentsIdsByStatus'](_0x1a8ea2,_0x4c25a5,_0x2ff8d1);}else{return rta[_0x9fdd('0x56')](_0x1a8ea2,_0x4c25a5,_0x41628d);}})[_0x9fdd('0x1a')](function(_0x1e3ff0){_0x4c25a5=_0x1e3ff0;var _0x1d2b6f=![];if(_0x4c25a5[_0x9fdd('0x3f')]===0x0){if(_0x395587||_0x41628d){_0x1d2b6f=!![];}if(_0x160bd8){_0x1d2b6f=![];}}if(_0x1d2b6f){return _0x1aa3eb;}var _0x50aa8f=_[_0x9fdd('0x34')](db[_0x9fdd('0x44')][_0x9fdd('0x57')],function(_0x285436){return{'name':_0x285436[_0x9fdd('0x58')],'type':_0x285436['type'][_0x9fdd('0x59')]};});_0x5f1773['query'][_0x9fdd('0x5a')]='agent';_0x5f1773[_0x9fdd('0x4a')][_0x9fdd('0x42')]=!![];_0x5b3ec8=qs[_0x9fdd('0x5b')](_0x50aa8f,_0x5f1773);_0x5b3ec8['raw']=!![];var _0x3a1514=[];if(_0x4c25a5[_0x9fdd('0x3f')]>0x0){_0x3a1514[_0x9fdd('0x20')]({'id':{'$in':_0x4c25a5}});if(_0x2ff8d1&&!_0x41628d){_0x556db5=[db[_0x9fdd('0x5c')][_0x9fdd('0x5d')](_0x9fdd('0x5e')+_0x4c25a5+')')];_0x5b3ec8[_0x9fdd('0x54')]=_0x556db5;}}if(_0x160bd8){_0x55dc7f[_0x9fdd('0x5f')](function(_0x32f932){var _0x57ab21=!![];if(_0x41628d===_0x9fdd('0x4d')&&_0x525c84!==_0x32f932){_0x57ab21=![];}_0x3a1514['push']({[_0x32f932+_0x9fdd('0x60')]:_0x57ab21});});if(_0x2d5cda){_0x3a1514['push']({'pauseType':_0x2d5cda});}}else if(_0x41628d){_0x55dc7f[_0x9fdd('0x5f')](function(_0x4770b2){_0x3a1514[_0x9fdd('0x20')]({[_0x4770b2+'Pause']:![]});});}_0x5b3ec8[_0x9fdd('0x61')]=_['merge'](_0x5b3ec8[_0x9fdd('0x61')],{'$and':_0x3a1514});if(_0x5f1773['user']['role']===_0x9fdd('0x62')){var _0xe2948c={'params':{'id':_0x5f1773[_0x9fdd('0x62')][_0x9fdd('0x63')]},'query':{'section':_0x9fdd('0x64'),'role':_0x9fdd('0x65'),'online':!![],'raw':!![],'ids':_0x4c25a5,'customSorting':_0x556db5}};if(_0x160bd8){_0xe2948c[_0x9fdd('0x4a')]['extraQueryConditions']=_0x3a1514;}_0xe2948c[_0x9fdd('0x4a')]=Object[_0x9fdd('0x66')](_0xe2948c[_0x9fdd('0x4a')],_0x5f1773[_0x9fdd('0x4a')]);delete _0xe2948c[_0x9fdd('0x4a')]['id'];return db[_0x9fdd('0x67')][_0x9fdd('0x68')](_0xe2948c);}return db[_0x9fdd('0x44')][_0x9fdd('0x69')](_0x5b3ec8);})[_0x9fdd('0x1a')](function(_0x6910a6){_0x1aa3eb[_0x9fdd('0x9')]=_0x6910a6['count'];_0x5e5584=_0x6910a6[_0x9fdd('0x55')];return _0x5e5584['map'](function(_0x45f342){var _0x433473=_[_0x9fdd('0x38')](_0x1a8ea2,['id',_0x45f342['id']]);if(_0x433473){var _0x336c8d=rta[_0x9fdd('0x6a')](_0x433473);_['merge'](_0x45f342,_0x336c8d);}_0x45f342[_0x9fdd('0x51')]=rta['getAgentStatus'](_0x45f342);if(_0x45f342[_0x9fdd('0x51')][_0x9fdd('0x50')](_0x9fdd('0x6b'))){_0x55dc7f[_0x9fdd('0x5f')](function(_0x8fabcf){if(_0x45f342[_0x8fabcf+_0x9fdd('0x60')]){_0x45f342[_0x8fabcf+_0x9fdd('0x6c')]=_0x9fdd('0x6b');}});}return _0x45f342;});})[_0x9fdd('0x1a')](function(_0x51cbdb){if(!_0x2ff8d1||_0x556db5){return _0x51cbdb;}return rta[_0x9fdd('0x6d')](_0x51cbdb,_0x2ff8d1);})['then'](function(_0x1d0785){_0x1aa3eb['rows']=_0x1d0785;return _0x1aa3eb;})[_0x9fdd('0x1a')](respondWithFilteredResult(_0x144956,_0x5b3ec8))['catch'](handleError(_0x144956,null));};exports[_0x9fdd('0x6e')]=function(_0x12de89,_0x2c3dc3){var _0x6e7772={'count':0x0,'rows':[]},_0x26def1={},_0x2aa879,_0x11a134,_0x94d611,_0x186643,_0x491a69;Promise['resolve']()[_0x9fdd('0x1a')](function(){if(_0x12de89['query'][_0x9fdd('0x4e')])_0x2aa879=validateChannel(_0x12de89[_0x9fdd('0x4a')][_0x9fdd('0x4e')]);var _0xbdcb81=_[_0x9fdd('0x13')](_0x2aa879)+'Queue';var _0x4c01cf=_[_0x9fdd('0x34')](db[_0xbdcb81][_0x9fdd('0x57')],function(_0x14f248){return{'name':_0x14f248[_0x9fdd('0x58')],'type':_0x14f248['type'][_0x9fdd('0x59')]};});_0x26def1=qs[_0x9fdd('0x5b')](_0x4c01cf,_0x12de89);if(_0x12de89[_0x9fdd('0x62')][_0x9fdd('0x5a')]===_0x9fdd('0x62')){var _0x354ea1={'params':{'id':_0x12de89[_0x9fdd('0x62')][_0x9fdd('0x63')]},'query':{'section':_0x2aa879===_0x9fdd('0x11')&&_0x12de89[_0x9fdd('0x4a')]['type']===_0x9fdd('0x1f')?'QueueCampaigns':_[_0x9fdd('0x13')](_0x2aa879)+_0x9fdd('0x14'),'type':_0x12de89['query'][_0x9fdd('0x6f')],'nolimit':!![],'sort':_0x9fdd('0x10'),'filter':_0x12de89['query'][_0x9fdd('0x3a')]}};return db['UserProfile'][_0x9fdd('0x68')](_0x354ea1);}return db[_0xbdcb81][_0x9fdd('0x69')](_0x26def1);})[_0x9fdd('0x1a')](function(_0x4a6288){_0x6e7772[_0x9fdd('0x9')]=_0x4a6288[_0x9fdd('0x9')];_0x11a134=_0x4a6288[_0x9fdd('0x55')];return getRealtimeQueues(_0x12de89,_0x2aa879);})[_0x9fdd('0x1a')](function(_0x532e69){_0x186643=_0x532e69[_0x9fdd('0x55')];return rta[_0x9fdd('0x70')]();})['then'](function(_0x342468){_0x94d611=_0x342468['rows'];if(_0x2aa879!='voice')return;return getRealtimeVoiceQueueChannels();})[_0x9fdd('0x1a')](function(_0x3b97c1){_0x491a69=_0x3b97c1?_0x3b97c1[_0x9fdd('0x55')]:[];return initializeQueues(_0x11a134,_0x186643,_0x2aa879,_0x12de89[_0x9fdd('0x4a')][_0x9fdd('0x6f')]);})['then'](function(_0x584225){var _0x311403=_0x584225[_0x9fdd('0x34')](function(_0x1ad21d){if(_0x2aa879===_0x9fdd('0x11'))return getVoiceQueueAgents(_0x1ad21d,_0x11a134,_0x94d611,_0x491a69);else return getQueueAgents(_0x1ad21d,_0x94d611,_0x2aa879);});return Promise['all'](_0x311403);})['then'](function(_0x38c3c3){_0x6e7772[_0x9fdd('0x55')]=_0x38c3c3;return _0x6e7772;})[_0x9fdd('0x1a')](respondWithFilteredResult(_0x2c3dc3,_0x26def1))[_0x9fdd('0x18')](handleError(_0x2c3dc3,null));};
\ No newline at end of file
+var _0xaaf0=['startCase','Queues','then','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','VoiceQueuesChannels','error','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','available','waiting','paused','voice','outbound','push','originated','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','loggedIn','talking','pTalking','find','pick','filter','queue','length','busy','some','toString','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','User','findAll','getChannels','includes','toLowerCase','Invalid\x20channel','getAgents','globalQueueFilter','query','pauseTypeFilter','*pause','resolve','channel','sort','globalStatus','validateSortParameter','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','rawAttributes','key','role','agent','getOptions','literal','forEach','where','merge','user','userProfileId','Agents','assign','UserProfile','getResources','findAndCountAll','filterAgentAttributes','getAgentStatus','pause','Status','getQueues','Queue','type','all','util','lodash','jayson/promise','../../components/realtime/agents','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','offset','undefined','count','limit','status','set','Content-Range','stack','name','send','request'];(function(_0x3256c6,_0x3166f8){var _0x19ae14=function(_0x532a54){while(--_0x532a54){_0x3256c6['push'](_0x3256c6['shift']());}};_0x19ae14(++_0x3166f8);}(_0xaaf0,0x1d3));var _0x0aaf=function(_0x136628,_0xdd3206){_0x136628=_0x136628-0x0;var _0x35aad7=_0xaaf0[_0x136628];return _0x35aad7;};'use strict';var util=require(_0x0aaf('0x0'));var _=require(_0x0aaf('0x1'));var jayson=require(_0x0aaf('0x2'));var rta=require(_0x0aaf('0x3'));var qs=require(_0x0aaf('0x4'));var utils=require('../../config/utils');var logger=require(_0x0aaf('0x5'))(_0x0aaf('0x6'));var db=require(_0x0aaf('0x7'))['db'];var amiClient=jayson[_0x0aaf('0x8')][_0x0aaf('0x9')]({'port':0x232a});var routingClient=jayson[_0x0aaf('0x8')][_0x0aaf('0x9')]({'port':0x232c});function respondWithFilteredResult(_0x193292,_0x1fcc35){return function(_0x205221){if(_0x205221){var _0xa9ba4=typeof _0x1fcc35[_0x0aaf('0xa')]===_0x0aaf('0xb')&&typeof _0x1fcc35['limit']===_0x0aaf('0xb');var _0x6250ef=_0x205221[_0x0aaf('0xc')];var _0x239e65=_0xa9ba4?0x0:_0x1fcc35[_0x0aaf('0xa')];var _0x305f13=_0xa9ba4?_0x205221[_0x0aaf('0xc')]:_0x1fcc35[_0x0aaf('0xa')]+_0x1fcc35[_0x0aaf('0xd')];var _0x35cf49;if(_0x305f13>=_0x6250ef){_0x305f13=_0x6250ef;_0x35cf49=0xc8;}else{_0x35cf49=0xce;}_0x193292[_0x0aaf('0xe')](_0x35cf49);return _0x193292[_0x0aaf('0xf')](_0x0aaf('0x10'),_0x239e65+'-'+_0x305f13+'/'+_0x6250ef)['json'](_0x205221);}return null;};}function handleError(_0x5b8869,_0x1f1cc4){_0x1f1cc4=_0x1f1cc4||0x1f4;return function(_0x36b1ad){logger['error'](_0x36b1ad[_0x0aaf('0x11')]);if(_0x36b1ad[_0x0aaf('0x12')]){delete _0x36b1ad['name'];}_0x5b8869[_0x0aaf('0xe')](_0x1f1cc4)[_0x0aaf('0x13')](_0x36b1ad);};}function getRealtimeQueues(_0x307627,_0x1ee2e1){return new Promise(function(_0x5e9b15,_0xd3699c){var _0x3dc8cf=_0x1ee2e1==='voice'?amiClient:routingClient;return _0x3dc8cf[_0x0aaf('0x14')](_[_0x0aaf('0x15')](_0x1ee2e1)+_0x0aaf('0x16'),_0x307627)[_0x0aaf('0x17')](function(_0x52ee02){if(_0x52ee02['error'])throw new Error(util[_0x0aaf('0x18')](_0x0aaf('0x19'),_0x1ee2e1));return _0x5e9b15(_0x52ee02[_0x0aaf('0x1a')]);})[_0x0aaf('0x1b')](function(_0x301f01){_0xd3699c(_0x301f01);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x24ac81,_0x415cc9){return amiClient[_0x0aaf('0x14')](_0x0aaf('0x1c'),{})[_0x0aaf('0x17')](function(_0x109997){if(_0x109997[_0x0aaf('0x1d')])throw new Error(_0x0aaf('0x1e'));return _0x24ac81(_0x109997[_0x0aaf('0x1a')]);})[_0x0aaf('0x1b')](function(_0x136910){_0x415cc9(_0x136910);});});}function initializeQueues(_0x229bff,_0x480077,_0x1addb0,_0x3addf8){var _0xd50bc0=['loggedIn',_0x0aaf('0x1f'),_0x0aaf('0x20'),'talking',_0x0aaf('0x21')];if(_0x1addb0===_0x0aaf('0x22')&&_0x3addf8===_0x0aaf('0x23')){_0xd50bc0[_0x0aaf('0x24')]('pTalking',_0x0aaf('0x25'),_0x0aaf('0x26'),'dialActive',_0x0aaf('0x27'),_0x0aaf('0x28'),_0x0aaf('0x29'),_0x0aaf('0x2a'),_0x0aaf('0x2b'),_0x0aaf('0x2c'),'erlangAbandonmentRate',_0x0aaf('0x2d'),_0x0aaf('0x2e'),_0x0aaf('0x2f'),_0x0aaf('0x30'),_0x0aaf('0x31'),_0x0aaf('0x32'),'predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout',_0x0aaf('0x33'),_0x0aaf('0x34'),_0x0aaf('0x35'));}return _0x229bff[_0x0aaf('0x36')](function(_0x3b4bb1){var _0xd3e2f5=_0x3b4bb1[_0x0aaf('0x37')]({'plain':!![]});_0xd3e2f5[_0x0aaf('0x38')]=[];_0xd3e2f5[_0x0aaf('0x21')]=0x0;_0xd3e2f5['loggedInDb']=0x0;_0xd3e2f5[_0x0aaf('0x39')]=0x0;_0xd3e2f5[_0x0aaf('0x1f')]=0x0;_0xd3e2f5[_0x0aaf('0x20')]=0x0;if(_0x1addb0===_0x0aaf('0x22')){_0xd3e2f5[_0x0aaf('0x3a')]=0x0;_0xd3e2f5['busy']=0x0;if(_0x3addf8===_0x0aaf('0x23')){_0xd3e2f5[_0x0aaf('0x3b')]=0x0;_0xd3e2f5[_0x0aaf('0x25')]=0x0;}}var _0x674072=_[_0x0aaf('0x3c')](_0x480077,['id',_0xd3e2f5['id']]);if(_0x674072)_['merge'](_0xd3e2f5,_[_0x0aaf('0x3d')](_0x674072,_0xd50bc0));return _0xd3e2f5;});}function updateAgentVoiceStatus(_0x362b3b,_0x2023f6,_0x5414b6){var _0x2b19f2=_[_0x0aaf('0x3e')](_0x5414b6,[_0x0aaf('0x3f'),_0x2023f6[_0x0aaf('0x12')]]);if(_0x2b19f2[_0x0aaf('0x40')]===0x0)return _0x362b3b[_0x0aaf('0x41')]=!![];if(_[_0x0aaf('0x42')](_0x2b19f2,['connectedlinenum',_0x362b3b['internal'][_0x0aaf('0x43')]()]))return _0x362b3b[_0x0aaf('0x3a')]=!![];if(!_0x362b3b['talking'])return _0x362b3b[_0x0aaf('0x41')]=!![];}function getVoiceQueueAgents(_0x3b6a51,_0x3e3289,_0x94621,_0x22d334){var _0x493746=_[_0x0aaf('0x3c')](_0x3e3289,['id',_0x3b6a51['id']]);if(!_0x493746)return _0x3b6a51;return _0x493746[_0x0aaf('0x44')]({'raw':!![]})[_0x0aaf('0x17')](function(_0x39e149){for(var _0x39af7f=0x0;_0x39af7f<_0x39e149['length'];_0x39af7f++){var _0x33a5f2=_[_0x0aaf('0x3c')](_0x94621,['id',_0x39e149[_0x39af7f]['UserId']]);if(!_0x33a5f2){_0x33a5f2={'id':_0x39e149[_0x39af7f][_0x0aaf('0x45')],'name':_0x39e149[_0x39af7f]['UserId'],'accountcode':'','online':![]};}var _0x2b2785={'id':_0x33a5f2['id'],'name':_0x33a5f2['name'],'internal':_0x33a5f2[_0x0aaf('0x46')],'online':Boolean(_0x33a5f2[_0x0aaf('0x47')]),'paused':Boolean(_0x39e149[_0x39af7f]['paused'])};if(_0x33a5f2[_0x0aaf('0x48')]===_0x0aaf('0x3a'))updateAgentVoiceStatus(_0x2b2785,_0x3b6a51,_0x22d334);if(_0x2b2785['online'])_0x3b6a51[_0x0aaf('0x49')]++;if(_0x2b2785[_0x0aaf('0x41')])_0x3b6a51[_0x0aaf('0x41')]++;if(_0x2b2785['paused']&&!_0x2b2785[_0x0aaf('0x41')]&&!_0x2b2785[_0x0aaf('0x3a')])_0x3b6a51['paused']++;_0x3b6a51[_0x0aaf('0x38')][_0x0aaf('0x24')](_0x2b2785);}return _0x3b6a51;});}function getQueueAgents(_0xd1ef68,_0x2f30ed,_0x19e822){var _0x4a38ad=_0x0aaf('0x4a')+_[_0x0aaf('0x15')](_0x19e822)+'Queue';var _0x25314d=_0x19e822+'Pause';return db[_0x4a38ad][_0x0aaf('0x4b')]({'where':{[_['startCase'](_0x19e822)+'QueueId']:_0xd1ef68['id']},'raw':!![]})['then'](function(_0x2d1c0b){for(var _0x443157=0x0;_0x443157<_0x2d1c0b[_0x0aaf('0x40')];_0x443157++){var _0x1a0422=_['find'](_0x2f30ed,['id',_0x2d1c0b[_0x443157][_0x0aaf('0x45')]]);if(!_0x1a0422){_0x1a0422={'id':_0x2d1c0b[_0x443157][_0x0aaf('0x45')],'name':_0x2d1c0b[_0x443157][_0x0aaf('0x45')],'online':![],['pauseField']:![]};}var _0x207f28={'id':_0x1a0422['id'],'name':_0x1a0422[_0x0aaf('0x12')],'online':Boolean(_0x1a0422[_0x0aaf('0x47')]),'paused':Boolean(_0x1a0422[_0x25314d])};if(_0x207f28[_0x0aaf('0x47')])_0xd1ef68[_0x0aaf('0x49')]++;_0xd1ef68[_0x0aaf('0x38')][_0x0aaf('0x24')](_0x207f28);}return _0xd1ef68;});}function validateChannel(_0x29b468){var _0x299398=utils[_0x0aaf('0x4c')]();if(!_[_0x0aaf('0x4d')](_0x299398,_0x29b468[_0x0aaf('0x4e')]()))throw new Error(_0x0aaf('0x4f'));return _0x29b468[_0x0aaf('0x4e')]();}exports[_0x0aaf('0x50')]=function(_0x48df70,_0x19f851){var _0x12b6e0={'count':0x0,'rows':[]};var _0x4f39c7={};var _0xcc4ef9;var _0x31c32c;var _0x54d338;var _0x2911d9;var _0x403902=utils[_0x0aaf('0x4c')]();var _0x895900=_0x48df70['query'][_0x0aaf('0x51')];var _0x52ba78=_0x48df70['query']['globalStatusFilter'];var _0x17572f=_0x48df70[_0x0aaf('0x52')][_0x0aaf('0x53')];var _0x29b9c7=_0x52ba78==='pause'||_0x52ba78===_0x0aaf('0x54')?!![]:![];var _0x3de7a5=[];var _0x4269c1;Promise[_0x0aaf('0x55')]()[_0x0aaf('0x17')](function(){if(_0x48df70['query'][_0x0aaf('0x56')]){_0xcc4ef9=validateChannel(_0x48df70[_0x0aaf('0x52')]['channel']);}if(!_0x48df70['query'][_0x0aaf('0x57')]||!_0x48df70[_0x0aaf('0x52')]['sort']['includes'](_0x0aaf('0x58'))){_0x48df70[_0x0aaf('0x52')][_0x0aaf('0x57')]=rta[_0x0aaf('0x59')](_0x48df70[_0x0aaf('0x52')]['sort']);return;}var _0x58de95=rta['getUpdatedSortOptions'](_0x48df70[_0x0aaf('0x52')]['sort']);_0x48df70['query'][_0x0aaf('0x57')]=_0x58de95[_0x0aaf('0x5a')][_0x0aaf('0x5b')](',');_0x31c32c=_0x58de95[_0x0aaf('0x5c')];})[_0x0aaf('0x17')](function(){if(!_0x895900){return[];}return rta[_0x0aaf('0x5d')](_0x895900,_0xcc4ef9);})[_0x0aaf('0x17')](function(_0x5033ee){_0x3de7a5=_0x5033ee;return rta[_0x0aaf('0x5e')]();})[_0x0aaf('0x17')](function(_0x437748){_0x2911d9=_0x437748[_0x0aaf('0x5f')];if((!_0x52ba78||_0x29b9c7)&&!_0x31c32c){return _0x3de7a5;}if(_0x31c32c&&!_0x52ba78){return rta[_0x0aaf('0x60')](_0x2911d9,_0x3de7a5,_0x31c32c);}else{return rta[_0x0aaf('0x61')](_0x2911d9,_0x3de7a5,_0x52ba78);}})[_0x0aaf('0x17')](function(_0x5496f5){_0x3de7a5=_0x5496f5;var _0xb24170=![];if(_0x3de7a5[_0x0aaf('0x40')]===0x0){if(_0x895900||_0x52ba78){_0xb24170=!![];}if(_0x29b9c7){_0xb24170=![];}}if(_0xb24170){return _0x12b6e0;}var _0x42e29c=_[_0x0aaf('0x36')](db[_0x0aaf('0x4a')][_0x0aaf('0x62')],function(_0x40d898){return{'name':_0x40d898['fieldName'],'type':_0x40d898['type'][_0x0aaf('0x63')]};});_0x48df70[_0x0aaf('0x52')][_0x0aaf('0x64')]=_0x0aaf('0x65');_0x48df70['query'][_0x0aaf('0x47')]=!![];_0x4f39c7=qs[_0x0aaf('0x66')](_0x42e29c,_0x48df70);_0x4f39c7['raw']=!![];var _0x442ccf=[];if(_0x3de7a5[_0x0aaf('0x40')]>0x0){_0x442ccf[_0x0aaf('0x24')]({'id':{'$in':_0x3de7a5}});if(_0x31c32c&&!_0x52ba78){_0x4269c1=[db['sequelize'][_0x0aaf('0x67')]('FIELD(id,'+_0x3de7a5+')')];_0x4f39c7[_0x0aaf('0x5c')]=_0x4269c1;}}if(_0x29b9c7){_0x403902[_0x0aaf('0x68')](function(_0x556eec){var _0x322f86=!![];if(_0x52ba78===_0x0aaf('0x54')&&_0xcc4ef9!==_0x556eec){_0x322f86=![];}_0x442ccf[_0x0aaf('0x24')]({[_0x556eec+'Pause']:_0x322f86});});if(_0x17572f){_0x442ccf['push']({'pauseType':_0x17572f});}}else if(_0x52ba78){_0x403902['forEach'](function(_0x5c7437){_0x442ccf[_0x0aaf('0x24')]({[_0x5c7437+'Pause']:![]});});}_0x4f39c7[_0x0aaf('0x69')]=_[_0x0aaf('0x6a')](_0x4f39c7[_0x0aaf('0x69')],{'$and':_0x442ccf});if(_0x48df70[_0x0aaf('0x6b')]['role']==='user'){var _0x51c17={'params':{'id':_0x48df70['user'][_0x0aaf('0x6c')]},'query':{'section':_0x0aaf('0x6d'),'role':_0x0aaf('0x65'),'online':!![],'raw':!![],'ids':_0x3de7a5,'customSorting':_0x4269c1}};if(_0x29b9c7){_0x51c17[_0x0aaf('0x52')]['extraQueryConditions']=_0x442ccf;}_0x51c17[_0x0aaf('0x52')]=Object[_0x0aaf('0x6e')](_0x51c17['query'],_0x48df70[_0x0aaf('0x52')]);delete _0x51c17['query']['id'];return db[_0x0aaf('0x6f')][_0x0aaf('0x70')](_0x51c17);}return db['User'][_0x0aaf('0x71')](_0x4f39c7);})[_0x0aaf('0x17')](function(_0x695ec7){_0x12b6e0['count']=_0x695ec7['count'];_0x54d338=_0x695ec7['rows'];return _0x54d338['map'](function(_0x2a1736){var _0xdd136e=_[_0x0aaf('0x3c')](_0x2911d9,['id',_0x2a1736['id']]);if(_0xdd136e){var _0xec276b=rta[_0x0aaf('0x72')](_0xdd136e);_[_0x0aaf('0x6a')](_0x2a1736,_0xec276b);}_0x2a1736['globalStatus']=rta[_0x0aaf('0x73')](_0x2a1736);if(_0x2a1736[_0x0aaf('0x58')]['includes'](_0x0aaf('0x74'))){_0x403902[_0x0aaf('0x68')](function(_0x18d5f4){if(_0x2a1736[_0x18d5f4+'Pause']){_0x2a1736[_0x18d5f4+_0x0aaf('0x75')]=_0x0aaf('0x74');}});}return _0x2a1736;});})['then'](function(_0x27ad23){if(!_0x31c32c||_0x4269c1){return _0x27ad23;}return rta['sortAgentsByStatus'](_0x27ad23,_0x31c32c);})[_0x0aaf('0x17')](function(_0x5629d6){_0x12b6e0[_0x0aaf('0x5f')]=_0x5629d6;return _0x12b6e0;})[_0x0aaf('0x17')](respondWithFilteredResult(_0x19f851,_0x4f39c7))[_0x0aaf('0x1b')](handleError(_0x19f851,null));};exports[_0x0aaf('0x76')]=function(_0x4db75c,_0x5f5644){var _0x4ebd98={'count':0x0,'rows':[]},_0x5a1c1e={},_0x26c75a,_0xdcb43f,_0x13b3c5,_0x584caa,_0x106994;Promise[_0x0aaf('0x55')]()[_0x0aaf('0x17')](function(){if(_0x4db75c[_0x0aaf('0x52')][_0x0aaf('0x56')])_0x26c75a=validateChannel(_0x4db75c['query'][_0x0aaf('0x56')]);var _0x41d64b=_[_0x0aaf('0x15')](_0x26c75a)+_0x0aaf('0x77');var _0x57a34f=_['map'](db[_0x41d64b][_0x0aaf('0x62')],function(_0x446703){return{'name':_0x446703['fieldName'],'type':_0x446703[_0x0aaf('0x78')][_0x0aaf('0x63')]};});_0x5a1c1e=qs[_0x0aaf('0x66')](_0x57a34f,_0x4db75c);if(_0x4db75c['user'][_0x0aaf('0x64')]===_0x0aaf('0x6b')){var _0x108a0e={'params':{'id':_0x4db75c[_0x0aaf('0x6b')][_0x0aaf('0x6c')]},'query':{'section':_0x26c75a===_0x0aaf('0x22')&&_0x4db75c[_0x0aaf('0x52')][_0x0aaf('0x78')]===_0x0aaf('0x23')?'QueueCampaigns':_['startCase'](_0x26c75a)+_0x0aaf('0x16'),'type':_0x4db75c['query'][_0x0aaf('0x78')],'nolimit':!![],'sort':'name','filter':_0x4db75c['query'][_0x0aaf('0x3e')]}};return db['UserProfile']['getResources'](_0x108a0e);}return db[_0x41d64b][_0x0aaf('0x71')](_0x5a1c1e);})['then'](function(_0x1466aa){_0x4ebd98[_0x0aaf('0xc')]=_0x1466aa['count'];_0xdcb43f=_0x1466aa[_0x0aaf('0x5f')];return getRealtimeQueues(_0x4db75c,_0x26c75a);})[_0x0aaf('0x17')](function(_0x436492){_0x584caa=_0x436492[_0x0aaf('0x5f')];return rta[_0x0aaf('0x5e')]();})['then'](function(_0x42a7a9){_0x13b3c5=_0x42a7a9[_0x0aaf('0x5f')];if(_0x26c75a!=_0x0aaf('0x22'))return;return getRealtimeVoiceQueueChannels();})[_0x0aaf('0x17')](function(_0x2e103b){_0x106994=_0x2e103b?_0x2e103b['rows']:[];return initializeQueues(_0xdcb43f,_0x584caa,_0x26c75a,_0x4db75c[_0x0aaf('0x52')]['type']);})[_0x0aaf('0x17')](function(_0x2998cf){var _0x2a142a=_0x2998cf[_0x0aaf('0x36')](function(_0x49afca){if(_0x26c75a==='voice')return getVoiceQueueAgents(_0x49afca,_0xdcb43f,_0x13b3c5,_0x106994);else return getQueueAgents(_0x49afca,_0x13b3c5,_0x26c75a);});return Promise[_0x0aaf('0x79')](_0x2a142a);})[_0x0aaf('0x17')](function(_0x2aa13b){_0x4ebd98[_0x0aaf('0x5f')]=_0x2aa13b;return _0x4ebd98;})['then'](respondWithFilteredResult(_0x5f5644,_0x5a1c1e))['catch'](handleError(_0x5f5644,null));};
\ No newline at end of file
index ec70a5a..47ea021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2a2ee3,_0x5e67ba){var _0x192c81=function(_0x8f6d51){while(--_0x8f6d51){_0x2a2ee3['push'](_0x2a2ee3['shift']());}};_0x192c81(++_0x5e67ba);}(_0x70e0,0x17b));var _0x070e=function(_0x2364cc,_0x1b978d){_0x2364cc=_0x2364cc-0x0;var _0x1d96e8=_0x70e0[_0x2364cc];return _0x1d96e8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x57671f,_0x4da2b2){var _0x1f80c4=function(_0x168cd0){while(--_0x168cd0){_0x57671f['push'](_0x57671f['shift']());}};_0x1f80c4(++_0x4da2b2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 9f6cc60..dca614e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5294=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0xa9859c,_0x50500d){var _0x3e23f9=function(_0x4f242a){while(--_0x4f242a){_0xa9859c['push'](_0xa9859c['shift']());}};_0x3e23f9(++_0x50500d);}(_0x5294,0x111));var _0x4529=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x5294[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0x4529('0x0'));module[_0x4529('0x1')]={'state':{'type':Sequelize[_0x4529('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4529('0x3')]},'scheduledat':{'type':Sequelize[_0x4529('0x4')]},'uniqueid':{'type':Sequelize[_0x4529('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4529('0x4')]},'ringtime':{'type':Sequelize[_0x4529('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4529('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4529('0x3')]}};
\ No newline at end of file
+var _0xfc65=['INTEGER','sequelize','STRING','DATE'];(function(_0x1245de,_0x7024d8){var _0x2183bd=function(_0x2f5dfd){while(--_0x2f5dfd){_0x1245de['push'](_0x1245de['shift']());}};_0x2183bd(++_0x7024d8);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x4e45b7,_0x1572e4){_0x4e45b7=_0x4e45b7-0x0;var _0x3678dd=_0xfc65[_0x4e45b7];return _0x3678dd;};'use strict';var Sequelize=require(_0x5fc6('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x5fc6('0x1')]},'scheduledat':{'type':Sequelize[_0x5fc6('0x2')]},'uniqueid':{'type':Sequelize[_0x5fc6('0x1')]},'starttime':{'type':Sequelize[_0x5fc6('0x2')]},'responsetime':{'type':Sequelize[_0x5fc6('0x2')]},'ringtime':{'type':Sequelize[_0x5fc6('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x5fc6('0x1')]},'campaigntype':{'type':Sequelize[_0x5fc6('0x1')]},'membername':{'type':Sequelize[_0x5fc6('0x1')]}};
\ No newline at end of file
index 7a2f28b..7ba9a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13a0=['ReportAgentPreview','report_agent_preview','lodash','../../config/logger','api','bluebird','path','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x10e80a,_0x37bc49){var _0xc600ee=function(_0x9494a4){while(--_0x9494a4){_0x10e80a['push'](_0x10e80a['shift']());}};_0xc600ee(++_0x37bc49);}(_0x13a0,0xde));var _0x013a=function(_0x3c80e8,_0x2bb4ff){_0x3c80e8=_0x3c80e8-0x0;var _0xe57191=_0x13a0[_0x3c80e8];return _0xe57191;};'use strict';var _=require(_0x013a('0x0'));var util=require('util');var logger=require(_0x013a('0x1'))(_0x013a('0x2'));var moment=require('moment');var BPromise=require(_0x013a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x013a('0x4'));var rimraf=require('rimraf');var config=require(_0x013a('0x5'));var attributes=require(_0x013a('0x6'));module[_0x013a('0x7')]=function(_0x3a7312,_0x1dc5f5){return _0x3a7312[_0x013a('0x8')](_0x013a('0x9'),attributes,{'tableName':_0x013a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c3c=['moment','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','lodash','../../config/logger','api'];(function(_0x73ea6d,_0x57d5bd){var _0x4c3a66=function(_0xb3ffd1){while(--_0xb3ffd1){_0x73ea6d['push'](_0x73ea6d['shift']());}};_0x4c3a66(++_0x57d5bd);}(_0x2c3c,0xce));var _0xc2c3=function(_0x2d930d,_0x41d75c){_0x2d930d=_0x2d930d-0x0;var _0x372806=_0x2c3c[_0x2d930d];return _0x372806;};'use strict';var _=require(_0xc2c3('0x0'));var util=require('util');var logger=require(_0xc2c3('0x1'))(_0xc2c3('0x2'));var moment=require(_0xc2c3('0x3'));var BPromise=require('bluebird');var rp=require(_0xc2c3('0x4'));var fs=require('fs');var path=require(_0xc2c3('0x5'));var rimraf=require('rimraf');var config=require(_0xc2c3('0x6'));var attributes=require(_0xc2c3('0x7'));module[_0xc2c3('0x8')]=function(_0x45fe2c,_0x32085b){return _0x45fe2c[_0xc2c3('0x9')]('ReportAgentPreview',attributes,{'tableName':_0xc2c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 82b543e..6eec281 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36a7=['code','message','result','CreateReportAgentPreview','create','body','options','raw','debug','catch','lodash','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error'];(function(_0x367e70,_0x589b7f){var _0x37898e=function(_0x2599a8){while(--_0x2599a8){_0x367e70['push'](_0x367e70['shift']());}};_0x37898e(++_0x589b7f);}(_0x36a7,0x128));var _0x736a=function(_0x450423,_0x3e37c7){_0x450423=_0x450423-0x0;var _0x38bc27=_0x36a7[_0x450423];return _0x38bc27;};'use strict';var _=require(_0x736a('0x0'));var util=require(_0x736a('0x1'));var moment=require(_0x736a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x736a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x736a('0x4'))(_0x736a('0x5'));var config=require(_0x736a('0x6'));var jayson=require(_0x736a('0x7'));var client=jayson[_0x736a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19788f,_0xc0487a,_0x1cadf1){return new BPromise(function(_0xf3dfbc,_0x1a8199){return client[_0x736a('0x9')](_0x19788f,_0x1cadf1)[_0x736a('0xa')](function(_0x59ac51){logger[_0x736a('0xb')](_0x736a('0xc'),_0xc0487a,_0x736a('0xd'));logger['debug'](_0x736a('0xe'),_0xc0487a,_0x736a('0xd'),JSON['stringify'](_0x59ac51));if(_0x59ac51['error']){if(_0x59ac51[_0x736a('0xf')][_0x736a('0x10')]===0x1f4){logger['error'](_0x736a('0xc'),_0xc0487a,_0x59ac51[_0x736a('0xf')][_0x736a('0x11')]);return _0x1a8199(_0x59ac51[_0x736a('0xf')][_0x736a('0x11')]);}logger[_0x736a('0xf')](_0x736a('0xc'),_0xc0487a,_0x59ac51[_0x736a('0xf')]['message']);return _0xf3dfbc(_0x59ac51['error'][_0x736a('0x11')]);}else{logger['info'](_0x736a('0xc'),_0xc0487a,'request\x20sent');_0xf3dfbc(_0x59ac51[_0x736a('0x12')][_0x736a('0x11')]);}})['catch'](function(_0x556c16){logger[_0x736a('0xf')](_0x736a('0xc'),_0xc0487a,_0x556c16);_0x1a8199(_0x556c16);});});}exports[_0x736a('0x13')]=function(_0x57d063){var _0x59497c=this;return new Promise(function(_0x5a236b,_0x3da9fd){return db['ReportAgentPreview'][_0x736a('0x14')](_0x57d063[_0x736a('0x15')],{'raw':_0x57d063[_0x736a('0x16')]?_0x57d063[_0x736a('0x16')][_0x736a('0x17')]===undefined?!![]:![]:!![]})[_0x736a('0xa')](function(_0x247942){logger[_0x736a('0xb')](_0x736a('0x13'),_0x57d063);logger[_0x736a('0x18')]('CreateReportAgentPreview',_0x57d063,JSON['stringify'](_0x247942));_0x5a236b(_0x247942);})[_0x736a('0x19')](function(_0x509deb){logger[_0x736a('0xf')]('CreateReportAgentPreview',_0x509deb['message'],_0x57d063);_0x3da9fd(_0x59497c[_0x736a('0xf')](0x1f4,_0x509deb[_0x736a('0x11')]));});});};
\ No newline at end of file
+var _0x0153=['jayson/promise','client','http','then','info','ReportAgentPreview,\x20%s,\x20%s','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ReportAgentPreview','create','body','options','CreateReportAgentPreview','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0153,0x1e3));var _0x3015=function(_0x15a1ee,_0x5e17c8){_0x15a1ee=_0x15a1ee-0x0;var _0xb0a43d=_0x0153[_0x15a1ee];return _0xb0a43d;};'use strict';var _=require('lodash');var util=require(_0x3015('0x0'));var moment=require(_0x3015('0x1'));var BPromise=require(_0x3015('0x2'));var rs=require(_0x3015('0x3'));var fs=require('fs');var Redis=require(_0x3015('0x4'));var db=require(_0x3015('0x5'))['db'];var utils=require(_0x3015('0x6'));var logger=require(_0x3015('0x7'))(_0x3015('0x8'));var config=require(_0x3015('0x9'));var jayson=require(_0x3015('0xa'));var client=jayson[_0x3015('0xb')][_0x3015('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe3fb1d,_0x524441,_0x2569a8){return new BPromise(function(_0x2e226e,_0x5a5770){return client['request'](_0xe3fb1d,_0x2569a8)[_0x3015('0xd')](function(_0xd2d020){logger[_0x3015('0xe')](_0x3015('0xf'),_0x524441,'request\x20sent');logger[_0x3015('0x10')](_0x3015('0x11'),_0x524441,_0x3015('0x12'),JSON['stringify'](_0xd2d020));if(_0xd2d020[_0x3015('0x13')]){if(_0xd2d020['error'][_0x3015('0x14')]===0x1f4){logger[_0x3015('0x13')](_0x3015('0xf'),_0x524441,_0xd2d020[_0x3015('0x13')]['message']);return _0x5a5770(_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);}logger[_0x3015('0x13')](_0x3015('0xf'),_0x524441,_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);return _0x2e226e(_0xd2d020[_0x3015('0x13')][_0x3015('0x15')]);}else{logger['info'](_0x3015('0xf'),_0x524441,_0x3015('0x12'));_0x2e226e(_0xd2d020[_0x3015('0x16')][_0x3015('0x15')]);}})[_0x3015('0x17')](function(_0x3700ee){logger[_0x3015('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x524441,_0x3700ee);_0x5a5770(_0x3700ee);});});}exports['CreateReportAgentPreview']=function(_0x391940){var _0x1e8065=this;return new Promise(function(_0x15512e,_0x3996dd){return db[_0x3015('0x18')][_0x3015('0x19')](_0x391940[_0x3015('0x1a')],{'raw':_0x391940[_0x3015('0x1b')]?_0x391940[_0x3015('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x3015('0xd')](function(_0x500030){logger[_0x3015('0xe')]('CreateReportAgentPreview',_0x391940);logger[_0x3015('0x10')](_0x3015('0x1c'),_0x391940,JSON['stringify'](_0x500030));_0x15512e(_0x500030);})[_0x3015('0x17')](function(_0x4d2b02){logger[_0x3015('0x13')]('CreateReportAgentPreview',_0x4d2b02[_0x3015('0x15')],_0x391940);_0x3996dd(_0x1e8065[_0x3015('0x13')](0x1f4,_0x4d2b02['message']));});});};
\ No newline at end of file
index 09a171b..7b1822a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc275=['/agents/:id/notify','agentNotify','exports','util','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','voiceQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','/campaigns','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','queueNotify','chat','/chat/queues/:id','showChatQueues','fax','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','sms','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id'];(function(_0x1f19f6,_0x177dba){var _0x179343=function(_0x51ecc5){while(--_0x51ecc5){_0x1f19f6['push'](_0x1f19f6['shift']());}};_0x179343(++_0x177dba);}(_0xc275,0x1c5));var _0x5c27=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc275[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x5c27('0x0'));var path=require('path');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router[_0x5c27('0x1')](_0x5c27('0x2'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x4')]);router[_0x5c27('0x1')](_0x5c27('0x5'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x6')]);router[_0x5c27('0x1')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5c27('0x3')](),controller[_0x5c27('0x7')]);router[_0x5c27('0x1')]('/voice/queues',auth['isAuthenticated'](),controller[_0x5c27('0x8')]);router[_0x5c27('0x1')]('/chat/queues',auth['isAuthenticated'](),controller['chatQueues']);router[_0x5c27('0x1')](_0x5c27('0x9'),auth[_0x5c27('0x3')](),controller[_0x5c27('0xa')]);router[_0x5c27('0x1')]('/mail/accounts',auth[_0x5c27('0x3')](),controller[_0x5c27('0xb')]);router[_0x5c27('0x1')](_0x5c27('0xc'),auth[_0x5c27('0x3')](),controller['openchannelQueues']);router['get'](_0x5c27('0xd'),auth[_0x5c27('0x3')](),controller[_0x5c27('0xe')]);router[_0x5c27('0x1')](_0x5c27('0xf'),auth['isAuthenticated'](),controller[_0x5c27('0x10')]);router[_0x5c27('0x1')](_0x5c27('0x11'),auth['isAuthenticated'](),controller[_0x5c27('0x12')]);router['get'](_0x5c27('0x13'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x14')]);router[_0x5c27('0x1')](_0x5c27('0x15'),auth[_0x5c27('0x3')](),controller['voiceQueuesChannels']);router['get']('/voice/queues/channels/:uniqueid',auth[_0x5c27('0x3')](),controller[_0x5c27('0x16')]);router['get'](_0x5c27('0x17'),auth['isAuthenticated'](),controller[_0x5c27('0x18')]);router[_0x5c27('0x1')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x5c27('0x3')](),controller[_0x5c27('0x19')]);router[_0x5c27('0x1')](_0x5c27('0x1a'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x1b')]);router[_0x5c27('0x1c')](_0x5c27('0x1a'),auth[_0x5c27('0x3')](),controller['updateVoiceQueue']);router['get']('/outbound',auth[_0x5c27('0x3')](),controller[_0x5c27('0x1d')]);router[_0x5c27('0x1')](_0x5c27('0x1e'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x1f')]);router['get'](_0x5c27('0x20'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x21')]);router[_0x5c27('0x1c')](_0x5c27('0x22'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x23')]);router['get']('/telephones',auth[_0x5c27('0x3')](),controller[_0x5c27('0x24')]);router[_0x5c27('0x1')](_0x5c27('0x25'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x26')]);router['get'](_0x5c27('0x27'),auth[_0x5c27('0x3')](),controller['campaigns']);router[_0x5c27('0x1')]('/fax/accounts',auth[_0x5c27('0x3')](),controller[_0x5c27('0x28')]);router[_0x5c27('0x1')](_0x5c27('0x29'),auth[_0x5c27('0x3')](),controller['chatQueuesWaitingInteractions']);router[_0x5c27('0x1')](_0x5c27('0x2a'),auth['isAuthenticated'](),controller[_0x5c27('0x2b')]);router['get'](_0x5c27('0x2c'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x2d')]);router[_0x5c27('0x1')]('/openchannel/queues/:id/waitinginteractions',auth[_0x5c27('0x3')](),controller[_0x5c27('0x2e')]);router[_0x5c27('0x1')](_0x5c27('0x2f'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x30')]);router['get'](_0x5c27('0x31'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x32')]);router[_0x5c27('0x1')](_0x5c27('0x33'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x34')]);router[_0x5c27('0x35')](_0x5c27('0x36'),auth[_0x5c27('0x3')](),controller['queueNotify'](_0x5c27('0x37')));router[_0x5c27('0x1')](_0x5c27('0x38'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x39')]);router[_0x5c27('0x35')]('/chat/queues/:id/notify',auth[_0x5c27('0x3')](),controller[_0x5c27('0x3a')](_0x5c27('0x3b')));router[_0x5c27('0x1')](_0x5c27('0x3c'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x3d')]);router[_0x5c27('0x35')]('/fax/queues/:id/notify',auth[_0x5c27('0x3')](),controller[_0x5c27('0x3a')](_0x5c27('0x3e')));router['get']('/fax/queues/:id',auth[_0x5c27('0x3')](),controller[_0x5c27('0x3f')]);router[_0x5c27('0x35')](_0x5c27('0x40'),auth[_0x5c27('0x3')](),controller['queueNotify'](_0x5c27('0x41')));router[_0x5c27('0x1')](_0x5c27('0x42'),auth[_0x5c27('0x3')](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x5c27('0x3')](),controller[_0x5c27('0x3a')](_0x5c27('0x43')));router[_0x5c27('0x35')]('/whatsapp/queues/:id/notify',auth[_0x5c27('0x3')](),controller['queueNotify'](_0x5c27('0x44')));router[_0x5c27('0x1')](_0x5c27('0x45'),auth['isAuthenticated'](),controller[_0x5c27('0x46')]);router[_0x5c27('0x1')](_0x5c27('0x47'),auth[_0x5c27('0x3')](),controller['showWhatsappQueues']);router['post'](_0x5c27('0x48'),auth[_0x5c27('0x3')](),controller[_0x5c27('0x49')]);module[_0x5c27('0x4a')]=router;
\ No newline at end of file
+var _0x397e=['smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','exports','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/telephones','telephones','/trunks','trunks','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions'];(function(_0x34e0fd,_0x544215){var _0x450df2=function(_0x2a39d8){while(--_0x2a39d8){_0x34e0fd['push'](_0x34e0fd['shift']());}};_0x450df2(++_0x544215);}(_0x397e,0x6b));var _0xe397=function(_0x3db0ba,_0x2be65c){_0x3db0ba=_0x3db0ba-0x0;var _0x2d8e9a=_0x397e[_0x3db0ba];return _0x2d8e9a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var express=require(_0xe397('0x0'));var router=express['Router']();var auth=require(_0xe397('0x1'));var controller=require(_0xe397('0x2'));router[_0xe397('0x3')](_0xe397('0x4'),auth[_0xe397('0x5')](),controller[_0xe397('0x6')]);router[_0xe397('0x3')]('/voice/channels/:uniqueid/mixmonitor',auth[_0xe397('0x5')](),controller[_0xe397('0x7')]);router[_0xe397('0x3')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xe397('0x5')](),controller[_0xe397('0x8')]);router[_0xe397('0x3')]('/voice/queues',auth[_0xe397('0x5')](),controller['voiceQueues']);router[_0xe397('0x3')](_0xe397('0x9'),auth[_0xe397('0x5')](),controller[_0xe397('0xa')]);router['get'](_0xe397('0xb'),auth[_0xe397('0x5')](),controller[_0xe397('0xc')]);router[_0xe397('0x3')](_0xe397('0xd'),auth[_0xe397('0x5')](),controller[_0xe397('0xe')]);router[_0xe397('0x3')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0xe397('0xf')]);router[_0xe397('0x3')]('/sms/queues',auth[_0xe397('0x5')](),controller[_0xe397('0x10')]);router[_0xe397('0x3')](_0xe397('0x11'),auth[_0xe397('0x5')](),controller[_0xe397('0x12')]);router[_0xe397('0x3')](_0xe397('0x13'),auth[_0xe397('0x5')](),controller[_0xe397('0x14')]);router[_0xe397('0x3')](_0xe397('0x15'),auth[_0xe397('0x5')](),controller[_0xe397('0x16')]);router[_0xe397('0x3')](_0xe397('0x17'),auth[_0xe397('0x5')](),controller[_0xe397('0x18')]);router[_0xe397('0x3')](_0xe397('0x19'),auth[_0xe397('0x5')](),controller['voiceQueuesChannel']);router[_0xe397('0x3')](_0xe397('0x1a'),auth[_0xe397('0x5')](),controller[_0xe397('0x1b')]);router[_0xe397('0x3')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth['isAuthenticated'](),controller[_0xe397('0x1c')]);router[_0xe397('0x3')](_0xe397('0x1d'),auth[_0xe397('0x5')](),controller[_0xe397('0x1e')]);router[_0xe397('0x1f')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0xe397('0x20')]);router[_0xe397('0x3')](_0xe397('0x21'),auth['isAuthenticated'](),controller[_0xe397('0x22')]);router[_0xe397('0x3')](_0xe397('0x23'),auth[_0xe397('0x5')](),controller[_0xe397('0x24')]);router[_0xe397('0x3')](_0xe397('0x25'),auth[_0xe397('0x5')](),controller[_0xe397('0x26')]);router['put']('/agents/:id/capacity',auth['isAuthenticated'](),controller['agentCapacity']);router[_0xe397('0x3')](_0xe397('0x27'),auth[_0xe397('0x5')](),controller[_0xe397('0x28')]);router[_0xe397('0x3')](_0xe397('0x29'),auth[_0xe397('0x5')](),controller[_0xe397('0x2a')]);router['get']('/campaigns',auth[_0xe397('0x5')](),controller['campaigns']);router[_0xe397('0x3')](_0xe397('0x2b'),auth['isAuthenticated'](),controller[_0xe397('0x2c')]);router[_0xe397('0x3')]('/chat/queues/waitinginteractions',auth[_0xe397('0x5')](),controller[_0xe397('0x2d')]);router['get'](_0xe397('0x2e'),auth[_0xe397('0x5')](),controller[_0xe397('0x2f')]);router['get'](_0xe397('0x30'),auth[_0xe397('0x5')](),controller[_0xe397('0x31')]);router[_0xe397('0x3')](_0xe397('0x32'),auth[_0xe397('0x5')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xe397('0x3')]('/sms/queues/waitinginteractions',auth[_0xe397('0x5')](),controller[_0xe397('0x33')]);router[_0xe397('0x3')](_0xe397('0x34'),auth[_0xe397('0x5')](),controller['whatsappQueuesWaitingInteractions']);router[_0xe397('0x3')](_0xe397('0x35'),auth[_0xe397('0x5')](),controller['faxQueuesWaitingInteractions']);router[_0xe397('0x36')](_0xe397('0x37'),auth['isAuthenticated'](),controller[_0xe397('0x38')](_0xe397('0x39')));router[_0xe397('0x3')](_0xe397('0x3a'),auth[_0xe397('0x5')](),controller[_0xe397('0x3b')]);router[_0xe397('0x36')](_0xe397('0x3c'),auth['isAuthenticated'](),controller['queueNotify'](_0xe397('0x3d')));router['get'](_0xe397('0x3e'),auth[_0xe397('0x5')](),controller['showChatQueues']);router[_0xe397('0x36')](_0xe397('0x3f'),auth[_0xe397('0x5')](),controller['queueNotify']('fax'));router[_0xe397('0x3')](_0xe397('0x40'),auth['isAuthenticated'](),controller[_0xe397('0x41')]);router[_0xe397('0x36')]('/openchannel/queues/:id/notify',auth['isAuthenticated'](),controller[_0xe397('0x38')](_0xe397('0x42')));router[_0xe397('0x3')](_0xe397('0x43'),auth['isAuthenticated'](),controller[_0xe397('0x44')]);router[_0xe397('0x36')]('/sms/queues/:id/notify',auth[_0xe397('0x5')](),controller[_0xe397('0x38')](_0xe397('0x45')));router['post'](_0xe397('0x46'),auth[_0xe397('0x5')](),controller[_0xe397('0x38')](_0xe397('0x47')));router[_0xe397('0x3')](_0xe397('0x48'),auth['isAuthenticated'](),controller[_0xe397('0x49')]);router[_0xe397('0x3')](_0xe397('0x4a'),auth[_0xe397('0x5')](),controller[_0xe397('0x4b')]);router['post'](_0xe397('0x4c'),auth[_0xe397('0x5')](),controller[_0xe397('0x4d')]);module[_0xe397('0x4e')]=router;
\ No newline at end of file
index d812e23..2901059 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8fb=['ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','map','queue_id','uniq','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Message','bluebird','moment','lodash','util','jayson/promise','client','http','then','error','code','message','result','catch','status','json','sendStatus','stack','name','isNil','find','rows','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','updateAttributes','findOrCreate','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','capacity','Telephones','Trunks','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd8fb,0x99));var _0xbd8f=function(_0x52b347,_0x3a9642){_0x52b347=_0x52b347-0x0;var _0x15f756=_0xd8fb[_0x52b347];return _0x15f756;};'use strict';var BPromise=require(_0xbd8f('0x0'));var moment=require(_0xbd8f('0x1'));var _=require(_0xbd8f('0x2'));var util=require(_0xbd8f('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xbd8f('0x4'));var amiClient=jayson[_0xbd8f('0x5')]['http']({'port':0x232a});var mailClient=jayson[_0xbd8f('0x5')][_0xbd8f('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0xbd8f('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){var _0x493298=_0x578499?_0x578499:amiClient;return _0x493298['request'](_0x4e97cf,_0xf503c4)[_0xbd8f('0x7')](function(_0x2393a9){if(_0x2393a9[_0xbd8f('0x8')]){if(_0x2393a9['error'][_0xbd8f('0x9')]===0x1f4){return _0x403edc(_0x2393a9[_0xbd8f('0x8')]['message']);}return _0x197827(_0x2393a9['error'][_0xbd8f('0xa')]);}else{_0x197827(_0x2393a9[_0xbd8f('0xb')]);}})[_0xbd8f('0xc')](function(_0x5d5705){_0x403edc(_0x5d5705);});});}function respondWithResult(_0x230988,_0x159f09){_0x159f09=_0x159f09||0xc8;return function(_0x39be16){if(_0x39be16){return _0x230988[_0xbd8f('0xd')](_0x159f09)[_0xbd8f('0xe')](_0x39be16);}return _0x230988[_0xbd8f('0xf')](0x194);};}function handleError(_0x37d4d5,_0x29ffe8){_0x29ffe8=_0x29ffe8||0x1f4;return function(_0x14606c){logger['error'](_0x14606c[_0xbd8f('0x10')]);if(_0x14606c[_0xbd8f('0x11')]){delete _0x14606c[_0xbd8f('0x11')];}_0x37d4d5[_0xbd8f('0xd')](_0x29ffe8)['send'](_0x14606c);};}function findById(_0x174929){return function(_0x63db18){if(!_['isNil'](_0x174929)&&!_[_0xbd8f('0x12')](_0x63db18)&&!_[_0xbd8f('0x12')](_0x63db18['rows'])){return _[_0xbd8f('0x13')](_0x63db18[_0xbd8f('0x14')],function(_0x47d317){return _0x47d317['id']==_0x174929;});}return null;};}exports['voiceChannels']=function(_0x33f77c,_0x5d2fdb){return respondWithRpcPromise('VoiceChannels',_0x33f77c[_0xbd8f('0x15')])['then'](respondWithResult(_0x5d2fdb,null))[_0xbd8f('0xc')](handleError(_0x5d2fdb,null));};exports[_0xbd8f('0x16')]=function(_0xb47c8e,_0x897f25){return respondWithRpcPromise(_0xbd8f('0x17'),_[_0xbd8f('0x18')](_0xb47c8e[_0xbd8f('0x15')],_0xb47c8e[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x897f25,null))[_0xbd8f('0xc')](handleError(_0x897f25,null));};exports[_0xbd8f('0x1a')]=function(_0x1628f5,_0x2f7c45){return respondWithRpcPromise(_0xbd8f('0x1b'),_[_0xbd8f('0x18')](_0x1628f5[_0xbd8f('0x15')],_0x1628f5[_0xbd8f('0x19')]))['then'](respondWithResult(_0x2f7c45,null))[_0xbd8f('0xc')](handleError(_0x2f7c45,null));};exports[_0xbd8f('0x1c')]=function(_0x1f9fcc,_0x2f3df7){return respondWithRpcPromise(_0xbd8f('0x1d'),_0x1f9fcc[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2f3df7,null))[_0xbd8f('0xc')](handleError(_0x2f3df7,null));};exports['showVoiceQueues']=function(_0x40cb43,_0x421f3e){return respondWithRpcPromise('VoiceQueues',_0x40cb43[_0xbd8f('0x15')])['then'](findById(_0x40cb43[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x421f3e,null))[_0xbd8f('0xc')](handleError(_0x421f3e,null));};exports[_0xbd8f('0x1e')]=function(_0x2aefa2,_0x247b07){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xbd8f('0x18')](_0x2aefa2[_0xbd8f('0x1f')],_0x2aefa2[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x247b07,null))[_0xbd8f('0xc')](handleError(_0x247b07,null));};exports[_0xbd8f('0x20')]=function(_0x2a4b32,_0x479a0c){return respondWithRpcPromise(_0xbd8f('0x21'),_[_0xbd8f('0x18')](_0x2a4b32[_0xbd8f('0x15')],_0x2a4b32[_0xbd8f('0x19')]))['then'](respondWithResult(_0x479a0c,null))['catch'](handleError(_0x479a0c,null));};exports[_0xbd8f('0x22')]=function(_0x3cdec2,_0x2fd6f8){return respondWithRpcPromise(_0xbd8f('0x23'),_0x3cdec2['query'])[_0xbd8f('0x7')](respondWithResult(_0x2fd6f8,null))[_0xbd8f('0xc')](handleError(_0x2fd6f8,null));};exports[_0xbd8f('0x24')]=function(_0x2137ed,_0x25ad9a){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xbd8f('0x18')](_0x2137ed[_0xbd8f('0x15')],_0x2137ed[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x25ad9a,null))[_0xbd8f('0xc')](handleError(_0x25ad9a,null));};exports['voiceQueuesChannelHangup']=function(_0x24e5f4,_0x5f404e){return respondWithRpcPromise(_0xbd8f('0x25'),_[_0xbd8f('0x18')](_0x24e5f4[_0xbd8f('0x15')],_0x24e5f4[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x5f404e,null))[_0xbd8f('0xc')](handleError(_0x5f404e,null));};exports['voiceQueuesChannelRedirect']=function(_0x4bafcd,_0x4c9a8d){return respondWithRpcPromise(_0xbd8f('0x26'),_[_0xbd8f('0x18')](_0x4bafcd[_0xbd8f('0x15')],_0x4bafcd[_0xbd8f('0x19')]))[_0xbd8f('0x7')](respondWithResult(_0x4c9a8d,null))[_0xbd8f('0xc')](handleError(_0x4c9a8d,null));};exports[_0xbd8f('0x27')]=function(_0x30c1c2,_0x2d4882){return respondWithRpcPromise(_0xbd8f('0x28'),_0x30c1c2[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x2d4882,null))[_0xbd8f('0xc')](handleError(_0x2d4882,null));};exports[_0xbd8f('0x29')]=function(_0x391d45,_0x50e081){return respondWithRpcPromise(_0xbd8f('0x2a'),_0x391d45[_0xbd8f('0x15')])['then'](respondWithResult(_0x50e081,null))[_0xbd8f('0xc')](handleError(_0x50e081,null));};exports[_0xbd8f('0x2b')]=function(_0x3d3902,_0x582bcf){var _0x21da54;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')])[_0xbd8f('0x7')](function(_0x298952){_0x21da54=_0x298952;return respondWithRpcPromise('Agents',_0x3d3902[_0xbd8f('0x15')],routingClient);})[_0xbd8f('0x7')](function(_0xdab323){return _['merge']({},_0xdab323,_0x21da54);})[_0xbd8f('0x7')](respondWithResult(_0x582bcf,null))[_0xbd8f('0xc')](handleError(_0x582bcf,null));};exports[_0xbd8f('0x2c')]=function(_0x351027,_0x280d95){if(_0x351027[_0xbd8f('0x1f')]&&_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]&&_0x351027[_0xbd8f('0x2e')]&&_0x351027['user']['name']){for(var _0x2907a3 in _0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')]){if(_0x351027[_0xbd8f('0x1f')]['interaction'][_0xbd8f('0x2f')](_0x2907a3)){db[_0xbd8f('0x30')][_0xbd8f('0x31')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3]&&_0x351027['body'][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')]?{'$notIn':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3]}:{'$ne':null}}})[_0xbd8f('0x7')](function(_0x151f82){var _0x1ea49a=moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x36c43f=0x0,_0x2fbbbe=_0x151f82[_0xbd8f('0x32')];_0x36c43f<_0x2fbbbe;_0x36c43f+=0x1){_0x151f82[_0x36c43f][_0xbd8f('0x34')]({'exitAt':_0x1ea49a});}});for(var _0x229bc0=0x0;_0x229bc0<_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0xbd8f('0x32')];_0x229bc0+=0x1){db['MemberReport'][_0xbd8f('0x35')]({'where':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'type':_0xbd8f('0x36'),'uniqueid':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x2d')][_0x2907a3][_0x229bc0],'exitAt':null},'defaults':{'channel':_0x2907a3,'membername':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')],'interface':_[_0xbd8f('0x12')](_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')])?util[_0xbd8f('0x33')](_0xbd8f('0x38'),_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x11')]):_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x37')],'type':_0xbd8f('0x36'),'enterAt':moment()[_0xbd8f('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xbd8f('0x39'),'internal':_0x351027[_0xbd8f('0x2e')][_0xbd8f('0x3a')],'uniqueid':_0x351027[_0xbd8f('0x1f')]['interaction'][_0x2907a3][_0x229bc0]}});}}}}return respondWithRpcPromise(_0xbd8f('0x3b'),{'id':_0x351027['params']['id'],'capacity':_0x351027[_0xbd8f('0x1f')][_0xbd8f('0x3c')]},routingClient)[_0xbd8f('0x7')](respondWithResult(_0x280d95,null))[_0xbd8f('0xc')](handleError(_0x280d95,null));};exports['telephones']=function(_0x3964f5,_0x35b814){return respondWithRpcPromise(_0xbd8f('0x3d'),_0x3964f5[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x35b814,null))[_0xbd8f('0xc')](handleError(_0x35b814,null));};exports['trunks']=function(_0x42a597,_0x4a2da8){return respondWithRpcPromise(_0xbd8f('0x3e'),_0x42a597[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x4a2da8,null))[_0xbd8f('0xc')](handleError(_0x4a2da8,null));};exports[_0xbd8f('0x3f')]=function(_0x358424,_0x2a331d){return respondWithRpcPromise(_0xbd8f('0x40'),_0x358424[_0xbd8f('0x15')])['then'](respondWithResult(_0x2a331d,null))[_0xbd8f('0xc')](handleError(_0x2a331d,null));};exports['chatQueues']=function(_0xd09e5,_0xb04dae){return respondWithRpcPromise('ChatQueues',_0xd09e5[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0xb04dae,null))['catch'](handleError(_0xb04dae,null));};exports['showChatQueues']=function(_0x55de68,_0x4042e0){return respondWithRpcPromise(_0xbd8f('0x41'),_0x55de68[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x55de68[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x4042e0,null))['catch'](handleError(_0x4042e0,null));};exports[_0xbd8f('0x42')]=function(_0x3848cb,_0x21d40b){return respondWithRpcPromise(_0xbd8f('0x43'),_0x3848cb[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x21d40b,null))[_0xbd8f('0xc')](handleError(_0x21d40b,null));};exports['showMailQueues']=function(_0x9cf2d5,_0x40c834){return respondWithRpcPromise(_0xbd8f('0x43'),_0x9cf2d5['query'],routingClient)[_0xbd8f('0x7')](findById(_0x9cf2d5[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x40c834,null))[_0xbd8f('0xc')](handleError(_0x40c834,null));};exports['mailAccounts']=function(_0x5327f2,_0x388af8){return respondWithRpcPromise('MailAccounts',_0x5327f2[_0xbd8f('0x15')],mailClient)[_0xbd8f('0x7')](respondWithResult(_0x388af8,null))[_0xbd8f('0xc')](handleError(_0x388af8,null));};exports[_0xbd8f('0x44')]=function(_0x4a86a9,_0x5ea275){return respondWithRpcPromise(_0xbd8f('0x45'),_0x4a86a9[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5ea275,null))[_0xbd8f('0xc')](handleError(_0x5ea275,null));};exports[_0xbd8f('0x46')]=function(_0x21cad7,_0x31adfb){return respondWithRpcPromise(_0xbd8f('0x45'),_0x21cad7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x21cad7[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x31adfb,null))[_0xbd8f('0xc')](handleError(_0x31adfb,null));};exports[_0xbd8f('0x47')]=function(_0x225ebd,_0x12ee82){return respondWithRpcPromise(_0xbd8f('0x48'),_0x225ebd[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x12ee82,null))[_0xbd8f('0xc')](handleError(_0x12ee82,null));};exports[_0xbd8f('0x49')]=function(_0x538fd7,_0x5e18fc){return respondWithRpcPromise(_0xbd8f('0x48'),_0x538fd7[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x538fd7['params']['id']))['then'](respondWithResult(_0x5e18fc,null))[_0xbd8f('0xc')](handleError(_0x5e18fc,null));};exports['whatsappQueues']=function(_0x565e63,_0x5b5bd8){return respondWithRpcPromise('WhatsappQueues',_0x565e63['query'],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b5bd8,null))['catch'](handleError(_0x5b5bd8,null));};exports[_0xbd8f('0x4a')]=function(_0x400aac,_0x53f297){return respondWithRpcPromise(_0xbd8f('0x4b'),_0x400aac[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](findById(_0x400aac[_0xbd8f('0x19')]['id']))[_0xbd8f('0x7')](respondWithResult(_0x53f297,null))['catch'](handleError(_0x53f297,null));};exports['faxQueues']=function(_0x378e72,_0x44469e){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x378e72[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x44469e,null))[_0xbd8f('0xc')](handleError(_0x44469e,null));};exports['showFaxQueues']=function(_0x4eddf2,_0x467b0f){return respondWithRpcPromise(_0xbd8f('0x4c'),_0x4eddf2['query'],routingClient)[_0xbd8f('0x7')](findById(_0x4eddf2[_0xbd8f('0x19')]['id']))['then'](respondWithResult(_0x467b0f,null))[_0xbd8f('0xc')](handleError(_0x467b0f,null));};exports[_0xbd8f('0x4d')]=function(_0x10268a,_0x5a8c8f){return respondWithRpcPromise('FaxAccounts',_0x10268a[_0xbd8f('0x15')])[_0xbd8f('0x7')](respondWithResult(_0x5a8c8f,null))[_0xbd8f('0xc')](handleError(_0x5a8c8f,null));};exports[_0xbd8f('0x4e')]=function(_0x41be86,_0x5b900c){return respondWithRpcPromise(_0xbd8f('0x4f'),_0x41be86[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x5b900c,null))[_0xbd8f('0xc')](handleError(_0x5b900c,null));};exports[_0xbd8f('0x50')]=function(_0x3574a6,_0x2a7eaa){return respondWithRpcPromise(_0xbd8f('0x51'),_0x3574a6[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2a7eaa,null))[_0xbd8f('0xc')](handleError(_0x2a7eaa,null));};exports[_0xbd8f('0x52')]=function(_0x34eec5,_0x40fc53){return respondWithRpcPromise(_0xbd8f('0x53'),_0x34eec5[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x40fc53,null))[_0xbd8f('0xc')](handleError(_0x40fc53,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x38d98e,_0x2957fd){return respondWithRpcPromise(_0xbd8f('0x53'),_0x38d98e[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](function(_0x18ccf2){if(_0x38d98e['query']['type']!==undefined){var _0x2a3982=_(_0x18ccf2[_0xbd8f('0x14')])['filter']([_0x38d98e[_0xbd8f('0x15')]['type'],_0x38d98e[_0xbd8f('0x19')]['id']])[_0xbd8f('0x54')](_0xbd8f('0x55'))[_0xbd8f('0x56')]()['value']();return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x84e98d){return _0x2a3982['indexOf'](_0x84e98d[_0xbd8f('0x55')])>-0x1;});}else{return _0x18ccf2[_0xbd8f('0x14')][_0xbd8f('0x57')](function(_0x161ec8){return _0x161ec8['queue_id']===parseInt(_0x38d98e[_0xbd8f('0x19')]['id']);});}})[_0xbd8f('0x7')](respondWithResult(_0x2957fd,null))[_0xbd8f('0xc')](handleError(_0x2957fd,null));};exports[_0xbd8f('0x58')]=function(_0x18645e,_0x23e962){return respondWithRpcPromise(_0xbd8f('0x59'),_0x18645e[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x23e962,null))[_0xbd8f('0xc')](handleError(_0x23e962,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3da31b,_0x4e908d){return respondWithRpcPromise(_0xbd8f('0x5a'),_0x3da31b[_0xbd8f('0x15')],routingClient)['then'](respondWithResult(_0x4e908d,null))[_0xbd8f('0xc')](handleError(_0x4e908d,null));};exports[_0xbd8f('0x5b')]=function(_0x60cd2b,_0x2ab853){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x60cd2b[_0xbd8f('0x15')],routingClient)[_0xbd8f('0x7')](respondWithResult(_0x2ab853,null))[_0xbd8f('0xc')](handleError(_0x2ab853,null));};exports[_0xbd8f('0x5c')]=function(_0x58651d){return function(_0x4e19ec,_0x2fb942){var _0x3641e9,_0x1f685d;var _0x2acd13=_[_0xbd8f('0x5d')](_0x58651d);var _0x53076d=_0x58651d===_0xbd8f('0x5e')?_0xbd8f('0x5f'):_0xbd8f('0x60');return db[_0x2acd13+_0xbd8f('0x61')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x4e19ec['params']['id']}})['then'](function(_0x542075){if(_[_0xbd8f('0x12')](_0x542075)){throw new Error(_0x2acd13+'\x20Queue\x20not\x20found');}_0x3641e9=_0x542075;return db[_0x2acd13+'Message']['findOne']({'where':{'id':_0x4e19ec[_0xbd8f('0x1f')][_0xbd8f('0x63')]},'include':[{'model':db[_0x2acd13+_0xbd8f('0x64')],'as':_0xbd8f('0x64')},{'model':db[_0x2acd13+_0x53076d],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0xefcfc1){if(_[_0xbd8f('0x12')](_0xefcfc1)){throw new Error(_0x2acd13+'\x20Message\x20not\x20found');}_0x1f685d=_0xefcfc1;return _0xefcfc1[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3caa98={'uniqueid':_0x58651d+'.'+_0x1f685d['id']+'.'+_0x1f685d['Interaction']['id'],'FromUserId':_0x4e19ec[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66')};_0x3caa98[_0x2acd13+_0xbd8f('0x67')]=_0x1f685d['id'];_0x3caa98[_0x2acd13+_0xbd8f('0x68')]=_0x1f685d[_0xbd8f('0x64')]['id'];_0x3caa98[_0xbd8f('0x69')+_0x2acd13+_0x53076d+'Id']=_0x1f685d[_0xbd8f('0x60')]['id'];_0x3caa98['To'+_0x2acd13+_0xbd8f('0x6a')]=_0x3641e9['id'];return db[_0x2acd13+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3caa98);})['then'](function(){return respondWithRpcPromise(_0xbd8f('0x6d'),{'channel':_0x58651d,'interaction':_0x1f685d[_0xbd8f('0x64')],'message':_0x1f685d,'account':_0x1f685d[_0xbd8f('0x60')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3641e9[_0xbd8f('0x11')]+','+(_0x1f685d['Account'][_0xbd8f('0x6e')]||0x12c),'interval':_0xbd8f('0x6f')}]},routingClient);})[_0xbd8f('0x7')](respondWithResult(_0x2fb942,null))[_0xbd8f('0xc')](handleError(_0x2fb942,null));};};exports[_0xbd8f('0x70')]=function(_0x57762c,_0xe58b64){var _0x198d4b,_0x60c94c;if(_[_0xbd8f('0x12')](_0x57762c[_0xbd8f('0x1f')][_0xbd8f('0x71')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x672cfb=_0x57762c[_0xbd8f('0x1f')]['channel'];var _0x49e15e=_[_0xbd8f('0x5d')](_0x672cfb);var _0x5b0716=_0x672cfb==='chat'?'Website':_0xbd8f('0x60');return db[_0xbd8f('0x72')][_0xbd8f('0x62')]({'raw':!![],'where':{'id':_0x57762c[_0xbd8f('0x19')]['id'],'role':'agent'}})[_0xbd8f('0x7')](function(_0x398cc9){if(_['isNil'](_0x398cc9)){throw new Error('Agent\x20not\x20found');}_0x198d4b=_0x398cc9;return db[_0x49e15e+_0xbd8f('0x73')]['findOne']({'where':{'id':_0x57762c[_0xbd8f('0x1f')]['messageId']},'include':[{'model':db[_0x49e15e+'Interaction'],'as':_0xbd8f('0x64')},{'model':db[_0x49e15e+_0x5b0716],'as':_0xbd8f('0x60')}]});})[_0xbd8f('0x7')](function(_0x18e9f0){if(_[_0xbd8f('0x12')](_0x18e9f0)){throw new Error(_0x49e15e+'\x20Message\x20not\x20found');}_0x60c94c=_0x18e9f0;return _0x18e9f0[_0xbd8f('0x65')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbd8f('0x7')](function(){var _0x3a6ec4={'uniqueid':_0x672cfb+'.'+_0x60c94c['id']+'.'+_0x60c94c['Interaction']['id'],'FromUserId':_0x57762c[_0xbd8f('0x2e')]['id'],'type':_0xbd8f('0x66'),'ToUserId':_0x198d4b['id']};_0x3a6ec4[_0x49e15e+_0xbd8f('0x67')]=_0x60c94c['id'];_0x3a6ec4[_0x49e15e+_0xbd8f('0x68')]=_0x60c94c[_0xbd8f('0x64')]['id'];_0x3a6ec4[_0xbd8f('0x69')+_0x49e15e+_0x5b0716+'Id']=_0x60c94c[_0xbd8f('0x60')]['id'];return db[_0x49e15e+_0xbd8f('0x6b')][_0xbd8f('0x6c')](_0x3a6ec4);})[_0xbd8f('0x7')](function(){return respondWithRpcPromise('Start',{'channel':_0x672cfb,'interaction':_0x60c94c['Interaction'],'message':_0x60c94c,'account':_0x60c94c['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x198d4b[_0xbd8f('0x11')]+','+(_0x60c94c[_0xbd8f('0x60')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0xe58b64,null))['catch'](handleError(_0xe58b64,null));};
\ No newline at end of file
+var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x2299d3,_0x9e339e){var _0x2cbde0=function(_0x347965){while(--_0x347965){_0x2299d3['push'](_0x2299d3['shift']());}};_0x2cbde0(++_0x9e339e);}(_0x6f47,0xc7));var _0x76f4=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x6f47[_0x1beef3];return _0x5af964;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));};
\ No newline at end of file
index 33226d8..680dfa9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa927=['isAuthenticated','index','get','/:id','show','/:id/run','run','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa927,0xc4));var _0x7a92=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xa927[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x7a92('0x0'));var util=require(_0x7a92('0x1'));var path=require(_0x7a92('0x2'));var timeout=require(_0x7a92('0x3'));var express=require(_0x7a92('0x4'));var router=express[_0x7a92('0x5')]();var fs_extra=require(_0x7a92('0x6'));var auth=require(_0x7a92('0x7'));var interaction=require(_0x7a92('0x8'));var config=require(_0x7a92('0x9'));var controller=require(_0x7a92('0xa'));router['get']('/',auth[_0x7a92('0xb')](),controller[_0x7a92('0xc')]);router[_0x7a92('0xd')](_0x7a92('0xe'),auth[_0x7a92('0xb')](),controller[_0x7a92('0xf')]);router[_0x7a92('0xd')](_0x7a92('0x10'),auth['isAuthenticated'](),controller[_0x7a92('0x11')]);router[_0x7a92('0x12')]('/',auth[_0x7a92('0xb')](),controller[_0x7a92('0x13')]);router['put'](_0x7a92('0xe'),auth['isAuthenticated'](),controller[_0x7a92('0x14')]);router[_0x7a92('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x7a92('0x16')]=router;
\ No newline at end of file
+var _0x1853=['/:id','show','/:id/run','run','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x580d72,_0x4a0b29){var _0x54452b=function(_0x27d1a4){while(--_0x27d1a4){_0x580d72['push'](_0x580d72['shift']());}};_0x54452b(++_0x4a0b29);}(_0x1853,0xf0));var _0x3185=function(_0x45fa67,_0x54f9c8){_0x45fa67=_0x45fa67-0x0;var _0x2eddaf=_0x1853[_0x45fa67];return _0x2eddaf;};'use strict';var multer=require(_0x3185('0x0'));var util=require(_0x3185('0x1'));var path=require(_0x3185('0x2'));var timeout=require(_0x3185('0x3'));var express=require(_0x3185('0x4'));var router=express[_0x3185('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3185('0x6'));var interaction=require(_0x3185('0x7'));var config=require(_0x3185('0x8'));var controller=require(_0x3185('0x9'));router[_0x3185('0xa')]('/',auth[_0x3185('0xb')](),controller[_0x3185('0xc')]);router[_0x3185('0xa')](_0x3185('0xd'),auth[_0x3185('0xb')](),controller[_0x3185('0xe')]);router[_0x3185('0xa')](_0x3185('0xf'),auth[_0x3185('0xb')](),controller[_0x3185('0x10')]);router[_0x3185('0x11')]('/',auth['isAuthenticated'](),controller[_0x3185('0x12')]);router[_0x3185('0x13')]('/:id',auth[_0x3185('0xb')](),controller['update']);router[_0x3185('0x14')](_0x3185('0xd'),auth[_0x3185('0xb')](),controller[_0x3185('0x15')]);module[_0x3185('0x16')]=router;
\ No newline at end of file
index 68426d5..09cedeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2c9=['STRING','BOOLEAN','0\x200\x20*\x20*\x20*','INTEGER','ENUM','years','quarters','weeks','minutes','days','csv','pdf','TEXT','sequelize','exports'];(function(_0x4cfa5e,_0x45fab8){var _0x13b2a6=function(_0x2c1e61){while(--_0x2c1e61){_0x4cfa5e['push'](_0x4cfa5e['shift']());}};_0x13b2a6(++_0x45fab8);}(_0xa2c9,0xd0));var _0x9a2c=function(_0x107e32,_0x5654ac){_0x107e32=_0x107e32-0x0;var _0x132a2b=_0xa2c9[_0x107e32];return _0x132a2b;};'use strict';var Sequelize=require(_0x9a2c('0x0'));module[_0x9a2c('0x1')]={'name':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9a2c('0x2')]},'active':{'type':Sequelize[_0x9a2c('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9a2c('0x2')],'allowNull':![],'defaultValue':_0x9a2c('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9a2c('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9a2c('0x6')](_0x9a2c('0x7'),_0x9a2c('0x8'),'months',_0x9a2c('0x9'),'days','hours',_0x9a2c('0xa')),'allowNull':![],'defaultValue':_0x9a2c('0xb')},'output':{'type':Sequelize[_0x9a2c('0x6')](_0x9a2c('0xc'),_0x9a2c('0xd'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM']('custom','default'),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x9a2c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9a2c('0x2')]},'cc':{'type':Sequelize[_0x9a2c('0xe')]},'bcc':{'type':Sequelize[_0x9a2c('0xe')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc58f=['weeks','days','csv','pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','ENUM','quarters','months'];(function(_0x56e0e5,_0x2e3937){var _0x27bb15=function(_0x186336){while(--_0x186336){_0x56e0e5['push'](_0x56e0e5['shift']());}};_0x27bb15(++_0x2e3937);}(_0xc58f,0x70));var _0xfc58=function(_0x374ff6,_0x30546f){_0x374ff6=_0x374ff6-0x0;var _0x58203b=_0xc58f[_0x374ff6];return _0x58203b;};'use strict';var Sequelize=require(_0xfc58('0x0'));module[_0xfc58('0x1')]={'name':{'type':Sequelize[_0xfc58('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfc58('0x2')]},'active':{'type':Sequelize[_0xfc58('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xfc58('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xfc58('0x4')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfc58('0x5')]('years',_0xfc58('0x6'),_0xfc58('0x7'),_0xfc58('0x8'),_0xfc58('0x9'),'hours','minutes'),'allowNull':![],'defaultValue':_0xfc58('0x9')},'output':{'type':Sequelize['ENUM'](_0xfc58('0xa'),_0xfc58('0xb'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xfc58('0x5')](_0xfc58('0xc'),_0xfc58('0xd')),'allowNull':![],'defaultValue':_0xfc58('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xfc58('0x2')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xfc58('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xfc58('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 1ec89d6..c8df731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20a9=['attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','update','body','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','error','name','send','index','Schedule','rawAttributes','type','model','map','query','keys','filters','intersection'];(function(_0x460fa1,_0xf9c99c){var _0x3ccd27=function(_0x36a01a){while(--_0x36a01a){_0x460fa1['push'](_0x460fa1['shift']());}};_0x3ccd27(++_0xf9c99c);}(_0x20a9,0x72));var _0x920a=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x20a9[_0x41d432];return _0x1650f9;};'use strict';var emlformat=require(_0x920a('0x0'));var rimraf=require(_0x920a('0x1'));var zipdir=require(_0x920a('0x2'));var jsonpatch=require(_0x920a('0x3'));var rp=require(_0x920a('0x4'));var moment=require(_0x920a('0x5'));var BPromise=require(_0x920a('0x6'));var Mustache=require(_0x920a('0x7'));var util=require(_0x920a('0x8'));var path=require('path');var sox=require(_0x920a('0x9'));var csv=require(_0x920a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x920a('0xb'));var squel=require('squel');var crypto=require(_0x920a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x920a('0xd'));var toCsv=require(_0x920a('0xa'));var querystring=require(_0x920a('0xe'));var Papa=require(_0x920a('0xf'));var Redis=require(_0x920a('0x10'));var authService=require(_0x920a('0x11'));var qs=require(_0x920a('0x12'));var as=require(_0x920a('0x13'));var hardwareService=require(_0x920a('0x14'));var logger=require(_0x920a('0x15'))(_0x920a('0x16'));var utils=require(_0x920a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x920a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x87699,_0x18ad6f){_0x18ad6f=_0x18ad6f||0xcc;return function(_0xed0f69){if(_0xed0f69){return _0x87699[_0x920a('0x19')](_0x18ad6f);}return _0x87699[_0x920a('0x1a')](_0x18ad6f)[_0x920a('0x1b')]();};}function respondWithResult(_0x3fb93f,_0x3a84f6){_0x3a84f6=_0x3a84f6||0xc8;return function(_0x104b2d){if(_0x104b2d){return _0x3fb93f[_0x920a('0x1a')](_0x3a84f6)['json'](_0x104b2d);}};}function respondWithFilteredResult(_0x232840,_0xe58373){return function(_0x3532e){if(_0x3532e){var _0x4021ce=typeof _0xe58373[_0x920a('0x1c')]===_0x920a('0x1d')&&typeof _0xe58373['limit']===_0x920a('0x1d');var _0x2e562e=_0x3532e[_0x920a('0x1e')];var _0x23a017=_0x4021ce?0x0:_0xe58373['offset'];var _0x2bfeaa=_0x4021ce?_0x3532e[_0x920a('0x1e')]:_0xe58373['offset']+_0xe58373[_0x920a('0x1f')];var _0x2c4f69;if(_0x2bfeaa>=_0x2e562e){_0x2bfeaa=_0x2e562e;_0x2c4f69=0xc8;}else{_0x2c4f69=0xce;}_0x232840[_0x920a('0x1a')](_0x2c4f69);return _0x232840[_0x920a('0x20')]('Content-Range',_0x23a017+'-'+_0x2bfeaa+'/'+_0x2e562e)['json'](_0x3532e);}return null;};}function patchUpdates(_0x580186){return function(_0x47cc30){try{jsonpatch[_0x920a('0x21')](_0x47cc30,_0x580186,!![]);}catch(_0x44e7e9){return BPromise[_0x920a('0x22')](_0x44e7e9);}return _0x47cc30[_0x920a('0x23')]();};}function saveUpdates(_0x206533,_0x458661){return function(_0x35fdcd){if(_0x35fdcd){return _0x35fdcd['update'](_0x206533)[_0x920a('0x24')](function(_0x587bc9){return _0x587bc9;});}return null;};}function removeEntity(_0x1cac59,_0x5312c7){return function(_0x48919e){if(_0x48919e){return _0x48919e[_0x920a('0x25')]()[_0x920a('0x24')](function(){var _0x12a3ee=_0x48919e[_0x920a('0x26')]({'plain':!![]});var _0x45d236=_0x920a('0x27');return db[_0x920a('0x28')][_0x920a('0x25')]({'where':{'type':_0x45d236,'resourceId':_0x12a3ee['id']}})['then'](function(){return _0x48919e;});})[_0x920a('0x24')](function(){_0x1cac59[_0x920a('0x1a')](0xcc)[_0x920a('0x1b')]();});}};}function handleEntityNotFound(_0x2d5c2b,_0x368a38){return function(_0x17a606){if(!_0x17a606){_0x2d5c2b['sendStatus'](0x194);}return _0x17a606;};}function handleError(_0x41d471,_0x4b2ab5){_0x4b2ab5=_0x4b2ab5||0x1f4;return function(_0x48c7d4){logger[_0x920a('0x29')](_0x48c7d4['stack']);if(_0x48c7d4['name']){delete _0x48c7d4[_0x920a('0x2a')];}_0x41d471[_0x920a('0x1a')](_0x4b2ab5)[_0x920a('0x2b')](_0x48c7d4);};}exports[_0x920a('0x2c')]=function(_0x72b510,_0x598102){var _0xbbc80e={},_0x534b51={},_0x4db241={'count':0x0,'rows':[]};var _0x2e0ad0=_['map'](db[_0x920a('0x2d')][_0x920a('0x2e')],function(_0x3861cb){return{'name':_0x3861cb['fieldName'],'type':_0x3861cb[_0x920a('0x2f')]['key']};});_0x534b51[_0x920a('0x30')]=_[_0x920a('0x31')](_0x2e0ad0,_0x920a('0x2a'));_0x534b51[_0x920a('0x32')]=_[_0x920a('0x33')](_0x72b510[_0x920a('0x32')]);_0x534b51[_0x920a('0x34')]=_[_0x920a('0x35')](_0x534b51['model'],_0x534b51['query']);_0xbbc80e[_0x920a('0x36')]=_['intersection'](_0x534b51[_0x920a('0x30')],qs[_0x920a('0x37')](_0x72b510['query'][_0x920a('0x37')]));_0xbbc80e[_0x920a('0x36')]=_0xbbc80e['attributes'][_0x920a('0x38')]?_0xbbc80e[_0x920a('0x36')]:_0x534b51['model'];if(!_0x72b510[_0x920a('0x32')][_0x920a('0x39')](_0x920a('0x3a'))){_0xbbc80e[_0x920a('0x1f')]=qs[_0x920a('0x1f')](_0x72b510[_0x920a('0x32')][_0x920a('0x1f')]);_0xbbc80e[_0x920a('0x1c')]=qs[_0x920a('0x1c')](_0x72b510[_0x920a('0x32')][_0x920a('0x1c')]);}_0xbbc80e['order']=qs[_0x920a('0x3b')](_0x72b510[_0x920a('0x32')]['sort']);_0xbbc80e['where']=qs['filters'](_[_0x920a('0x3c')](_0x72b510[_0x920a('0x32')],_0x534b51[_0x920a('0x34')]),_0x2e0ad0);if(_0x72b510[_0x920a('0x32')][_0x920a('0x3d')]){_0xbbc80e[_0x920a('0x3e')]=_['merge'](_0xbbc80e['where'],{'$or':_[_0x920a('0x31')](_0x2e0ad0,function(_0x21f1c9){if(_0x21f1c9['type']!==_0x920a('0x3f')){var _0x3cc5fd={};_0x3cc5fd[_0x21f1c9[_0x920a('0x2a')]]={'$like':'%'+_0x72b510[_0x920a('0x32')][_0x920a('0x3d')]+'%'};return _0x3cc5fd;}})});}_0xbbc80e=_[_0x920a('0x40')]({},_0xbbc80e,_0x72b510[_0x920a('0x41')]);var _0x1a033c={'where':_0xbbc80e['where']};return db[_0x920a('0x2d')]['count'](_0x1a033c)[_0x920a('0x24')](function(_0x447c06){_0x4db241[_0x920a('0x1e')]=_0x447c06;if(_0x72b510[_0x920a('0x32')][_0x920a('0x42')]){_0xbbc80e[_0x920a('0x43')]=[{'all':!![]}];}return db[_0x920a('0x2d')][_0x920a('0x44')](_0xbbc80e);})[_0x920a('0x24')](function(_0x4505d2){_0x4db241[_0x920a('0x45')]=_0x4505d2;return _0x4db241;})['then'](respondWithFilteredResult(_0x598102,_0xbbc80e))[_0x920a('0x46')](handleError(_0x598102,null));};exports[_0x920a('0x47')]=function(_0x13ce50,_0xdcea89){var _0x23014b={'raw':![],'where':{'id':_0x13ce50['params']['id']}},_0x47ccaa={};_0x47ccaa[_0x920a('0x30')]=_[_0x920a('0x33')](db[_0x920a('0x2d')][_0x920a('0x2e')]);_0x47ccaa[_0x920a('0x32')]=_['keys'](_0x13ce50[_0x920a('0x32')]);_0x47ccaa[_0x920a('0x34')]=_[_0x920a('0x35')](_0x47ccaa[_0x920a('0x30')],_0x47ccaa[_0x920a('0x32')]);_0x23014b[_0x920a('0x36')]=_[_0x920a('0x35')](_0x47ccaa['model'],qs[_0x920a('0x37')](_0x13ce50['query'][_0x920a('0x37')]));_0x23014b[_0x920a('0x36')]=_0x23014b[_0x920a('0x36')][_0x920a('0x38')]?_0x23014b[_0x920a('0x36')]:_0x47ccaa[_0x920a('0x30')];if(_0x13ce50[_0x920a('0x32')][_0x920a('0x42')]){_0x23014b[_0x920a('0x43')]=[{'all':!![]}];}_0x23014b=_[_0x920a('0x40')]({},_0x23014b,_0x13ce50[_0x920a('0x41')]);return db[_0x920a('0x2d')][_0x920a('0x48')](_0x23014b)[_0x920a('0x24')](handleEntityNotFound(_0xdcea89,null))[_0x920a('0x24')](respondWithResult(_0xdcea89,null))[_0x920a('0x46')](handleError(_0xdcea89,null));};exports[_0x920a('0x49')]=function(_0x444949,_0x3c28c0){return db[_0x920a('0x2d')][_0x920a('0x49')](_0x444949['body'],{})[_0x920a('0x24')](function(_0x28f4c5){var _0x5c8bde=_0x444949[_0x920a('0x4a')][_0x920a('0x26')]({'plain':!![]});if(!_0x5c8bde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c8bde[_0x920a('0x4b')]===_0x920a('0x4a')){var _0x402cdf=_0x28f4c5['get']({'plain':!![]});var _0x482fda=_0x920a('0x27');return db[_0x920a('0x4c')]['find']({'where':{'name':_0x482fda,'userProfileId':_0x5c8bde[_0x920a('0x4d')]},'raw':!![]})[_0x920a('0x24')](function(_0x441c6a){if(_0x441c6a&&_0x441c6a[_0x920a('0x4e')]===0x0){return db[_0x920a('0x28')][_0x920a('0x49')]({'name':_0x402cdf[_0x920a('0x2a')],'resourceId':_0x402cdf['id'],'type':_0x441c6a[_0x920a('0x2a')],'sectionId':_0x441c6a['id']},{})['then'](function(){return _0x28f4c5;});}else{return _0x28f4c5;}})['catch'](function(_0x191003){logger[_0x920a('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x191003);throw _0x191003;});}return _0x28f4c5;})[_0x920a('0x24')](respondWithResult(_0x3c28c0,0xc9))[_0x920a('0x46')](handleError(_0x3c28c0,null));};exports[_0x920a('0x4f')]=function(_0x541cb6,_0x3d81c9){if(_0x541cb6[_0x920a('0x50')]['id']){delete _0x541cb6[_0x920a('0x50')]['id'];}return db[_0x920a('0x2d')]['find']({'where':{'id':_0x541cb6[_0x920a('0x51')]['id']}})['then'](handleEntityNotFound(_0x3d81c9,null))[_0x920a('0x24')](saveUpdates(_0x541cb6[_0x920a('0x50')],null))[_0x920a('0x24')](respondWithResult(_0x3d81c9,null))['catch'](handleError(_0x3d81c9,null));};exports[_0x920a('0x25')]=function(_0x155817,_0xa81bd0){return db['Schedule'][_0x920a('0x48')]({'where':{'id':_0x155817[_0x920a('0x51')]['id']}})[_0x920a('0x24')](handleEntityNotFound(_0xa81bd0,null))[_0x920a('0x24')](removeEntity(_0xa81bd0,null))[_0x920a('0x46')](handleError(_0xa81bd0,null));};exports[_0x920a('0x52')]=function(_0x3a2844,_0x33cb96,_0x1d2b46){var _0x2de238=require(_0x920a('0x53'));return db[_0x920a('0x2d')][_0x920a('0x48')]({'where':{'id':_0x3a2844['params']['id']},'raw':!![]})[_0x920a('0x24')](handleEntityNotFound(_0x33cb96,null))[_0x920a('0x24')](function(){_0x2de238[_0x920a('0x52')](_0x3a2844['params']['id']);})[_0x920a('0x24')](respondWithStatusCode(_0x33cb96,null))[_0x920a('0x46')](handleError(_0x33cb96,null));};
\ No newline at end of file
+var _0x73cc=['length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','error','name','send','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x3eec42,_0x192ed2){var _0x110bf0=function(_0x4ef488){while(--_0x4ef488){_0x3eec42['push'](_0x3eec42['shift']());}};_0x110bf0(++_0x192ed2);}(_0x73cc,0xc6));var _0xc73c=function(_0x381ffb,_0x16de2f){_0x381ffb=_0x381ffb-0x0;var _0x119179=_0x73cc[_0x381ffb];return _0x119179;};'use strict';var emlformat=require(_0xc73c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc73c('0x1'));var jsonpatch=require(_0xc73c('0x2'));var rp=require(_0xc73c('0x3'));var moment=require('moment');var BPromise=require(_0xc73c('0x4'));var Mustache=require(_0xc73c('0x5'));var util=require(_0xc73c('0x6'));var path=require(_0xc73c('0x7'));var sox=require(_0xc73c('0x8'));var csv=require(_0xc73c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc73c('0xa'));var _=require('lodash');var squel=require(_0xc73c('0xb'));var crypto=require(_0xc73c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc73c('0xd'));var toCsv=require(_0xc73c('0x9'));var querystring=require(_0xc73c('0xe'));var Papa=require(_0xc73c('0xf'));var Redis=require(_0xc73c('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc73c('0x11'));var hardwareService=require(_0xc73c('0x12'));var logger=require(_0xc73c('0x13'))('api');var utils=require(_0xc73c('0x14'));var config=require(_0xc73c('0x15'));var licenseUtil=require(_0xc73c('0x16'));var db=require(_0xc73c('0x17'))['db'];function respondWithStatusCode(_0x38ff6d,_0x4df1a9){_0x4df1a9=_0x4df1a9||0xcc;return function(_0x1bd8e6){if(_0x1bd8e6){return _0x38ff6d[_0xc73c('0x18')](_0x4df1a9);}return _0x38ff6d[_0xc73c('0x19')](_0x4df1a9)[_0xc73c('0x1a')]();};}function respondWithResult(_0x4e8a65,_0x4e3008){_0x4e3008=_0x4e3008||0xc8;return function(_0x289b0f){if(_0x289b0f){return _0x4e8a65['status'](_0x4e3008)[_0xc73c('0x1b')](_0x289b0f);}};}function respondWithFilteredResult(_0x266111,_0x1ca575){return function(_0x52dc2a){if(_0x52dc2a){var _0x20f9a2=typeof _0x1ca575[_0xc73c('0x1c')]===_0xc73c('0x1d')&&typeof _0x1ca575['limit']===_0xc73c('0x1d');var _0xf83925=_0x52dc2a[_0xc73c('0x1e')];var _0x121552=_0x20f9a2?0x0:_0x1ca575[_0xc73c('0x1c')];var _0x578751=_0x20f9a2?_0x52dc2a[_0xc73c('0x1e')]:_0x1ca575['offset']+_0x1ca575[_0xc73c('0x1f')];var _0x3f4686;if(_0x578751>=_0xf83925){_0x578751=_0xf83925;_0x3f4686=0xc8;}else{_0x3f4686=0xce;}_0x266111['status'](_0x3f4686);return _0x266111[_0xc73c('0x20')](_0xc73c('0x21'),_0x121552+'-'+_0x578751+'/'+_0xf83925)[_0xc73c('0x1b')](_0x52dc2a);}return null;};}function patchUpdates(_0x56a953){return function(_0x200e14){try{jsonpatch[_0xc73c('0x22')](_0x200e14,_0x56a953,!![]);}catch(_0x5a5f0a){return BPromise[_0xc73c('0x23')](_0x5a5f0a);}return _0x200e14[_0xc73c('0x24')]();};}function saveUpdates(_0x325ae2,_0x1752a2){return function(_0x3e5b17){if(_0x3e5b17){return _0x3e5b17[_0xc73c('0x25')](_0x325ae2)[_0xc73c('0x26')](function(_0x5269fa){return _0x5269fa;});}return null;};}function removeEntity(_0x428534,_0x325f97){return function(_0x17784d){if(_0x17784d){return _0x17784d[_0xc73c('0x27')]()['then'](function(){var _0x2734c8=_0x17784d[_0xc73c('0x28')]({'plain':!![]});var _0x34bfaf=_0xc73c('0x29');return db['UserProfileResource'][_0xc73c('0x27')]({'where':{'type':_0x34bfaf,'resourceId':_0x2734c8['id']}})[_0xc73c('0x26')](function(){return _0x17784d;});})[_0xc73c('0x26')](function(){_0x428534[_0xc73c('0x19')](0xcc)[_0xc73c('0x1a')]();});}};}function handleEntityNotFound(_0xef70a4,_0x5d118b){return function(_0x2d5717){if(!_0x2d5717){_0xef70a4[_0xc73c('0x18')](0x194);}return _0x2d5717;};}function handleError(_0x48ae31,_0x6df2b2){_0x6df2b2=_0x6df2b2||0x1f4;return function(_0x3463d1){logger[_0xc73c('0x2a')](_0x3463d1['stack']);if(_0x3463d1[_0xc73c('0x2b')]){delete _0x3463d1['name'];}_0x48ae31['status'](_0x6df2b2)[_0xc73c('0x2c')](_0x3463d1);};}exports['index']=function(_0x1e0f32,_0x490441){var _0x7fe3f3={},_0x26f456={},_0x37308c={'count':0x0,'rows':[]};var _0x3060d2=_['map'](db[_0xc73c('0x2d')][_0xc73c('0x2e')],function(_0x5c24a3){return{'name':_0x5c24a3[_0xc73c('0x2f')],'type':_0x5c24a3[_0xc73c('0x30')][_0xc73c('0x31')]};});_0x26f456[_0xc73c('0x32')]=_[_0xc73c('0x33')](_0x3060d2,_0xc73c('0x2b'));_0x26f456[_0xc73c('0x34')]=_[_0xc73c('0x35')](_0x1e0f32[_0xc73c('0x34')]);_0x26f456['filters']=_[_0xc73c('0x36')](_0x26f456[_0xc73c('0x32')],_0x26f456[_0xc73c('0x34')]);_0x7fe3f3[_0xc73c('0x37')]=_[_0xc73c('0x36')](_0x26f456['model'],qs[_0xc73c('0x38')](_0x1e0f32['query'][_0xc73c('0x38')]));_0x7fe3f3[_0xc73c('0x37')]=_0x7fe3f3[_0xc73c('0x37')][_0xc73c('0x39')]?_0x7fe3f3[_0xc73c('0x37')]:_0x26f456[_0xc73c('0x32')];if(!_0x1e0f32[_0xc73c('0x34')][_0xc73c('0x3a')](_0xc73c('0x3b'))){_0x7fe3f3[_0xc73c('0x1f')]=qs[_0xc73c('0x1f')](_0x1e0f32[_0xc73c('0x34')][_0xc73c('0x1f')]);_0x7fe3f3[_0xc73c('0x1c')]=qs[_0xc73c('0x1c')](_0x1e0f32[_0xc73c('0x34')]['offset']);}_0x7fe3f3['order']=qs['sort'](_0x1e0f32[_0xc73c('0x34')][_0xc73c('0x3c')]);_0x7fe3f3[_0xc73c('0x3d')]=qs[_0xc73c('0x3e')](_['pick'](_0x1e0f32['query'],_0x26f456['filters']),_0x3060d2);if(_0x1e0f32[_0xc73c('0x34')][_0xc73c('0x3f')]){_0x7fe3f3['where']=_[_0xc73c('0x40')](_0x7fe3f3[_0xc73c('0x3d')],{'$or':_[_0xc73c('0x33')](_0x3060d2,function(_0x5f591f){if(_0x5f591f[_0xc73c('0x30')]!==_0xc73c('0x41')){var _0x8fc28f={};_0x8fc28f[_0x5f591f[_0xc73c('0x2b')]]={'$like':'%'+_0x1e0f32[_0xc73c('0x34')]['filter']+'%'};return _0x8fc28f;}})});}_0x7fe3f3=_[_0xc73c('0x40')]({},_0x7fe3f3,_0x1e0f32[_0xc73c('0x42')]);var _0x15b441={'where':_0x7fe3f3[_0xc73c('0x3d')]};return db[_0xc73c('0x2d')][_0xc73c('0x1e')](_0x15b441)[_0xc73c('0x26')](function(_0x48e9df){_0x37308c[_0xc73c('0x1e')]=_0x48e9df;if(_0x1e0f32['query'][_0xc73c('0x43')]){_0x7fe3f3[_0xc73c('0x44')]=[{'all':!![]}];}return db[_0xc73c('0x2d')][_0xc73c('0x45')](_0x7fe3f3);})[_0xc73c('0x26')](function(_0x202419){_0x37308c['rows']=_0x202419;return _0x37308c;})[_0xc73c('0x26')](respondWithFilteredResult(_0x490441,_0x7fe3f3))[_0xc73c('0x46')](handleError(_0x490441,null));};exports[_0xc73c('0x47')]=function(_0x3aa3cc,_0x349176){var _0x2f83d0={'raw':![],'where':{'id':_0x3aa3cc[_0xc73c('0x48')]['id']}},_0x58494d={};_0x58494d[_0xc73c('0x32')]=_[_0xc73c('0x35')](db[_0xc73c('0x2d')][_0xc73c('0x2e')]);_0x58494d[_0xc73c('0x34')]=_[_0xc73c('0x35')](_0x3aa3cc[_0xc73c('0x34')]);_0x58494d[_0xc73c('0x3e')]=_[_0xc73c('0x36')](_0x58494d[_0xc73c('0x32')],_0x58494d[_0xc73c('0x34')]);_0x2f83d0['attributes']=_[_0xc73c('0x36')](_0x58494d[_0xc73c('0x32')],qs['fields'](_0x3aa3cc[_0xc73c('0x34')][_0xc73c('0x38')]));_0x2f83d0['attributes']=_0x2f83d0['attributes'][_0xc73c('0x39')]?_0x2f83d0[_0xc73c('0x37')]:_0x58494d[_0xc73c('0x32')];if(_0x3aa3cc[_0xc73c('0x34')][_0xc73c('0x43')]){_0x2f83d0[_0xc73c('0x44')]=[{'all':!![]}];}_0x2f83d0=_[_0xc73c('0x40')]({},_0x2f83d0,_0x3aa3cc[_0xc73c('0x42')]);return db[_0xc73c('0x2d')]['find'](_0x2f83d0)[_0xc73c('0x26')](handleEntityNotFound(_0x349176,null))[_0xc73c('0x26')](respondWithResult(_0x349176,null))[_0xc73c('0x46')](handleError(_0x349176,null));};exports[_0xc73c('0x49')]=function(_0x1bf398,_0x459b5c){return db[_0xc73c('0x2d')][_0xc73c('0x49')](_0x1bf398['body'],{})['then'](function(_0x95e686){var _0xdc9285=_0x1bf398['user'][_0xc73c('0x28')]({'plain':!![]});if(!_0xdc9285)throw new Error(_0xc73c('0x4a'));if(_0xdc9285[_0xc73c('0x4b')]===_0xc73c('0x4c')){var _0x5c58f2=_0x95e686[_0xc73c('0x28')]({'plain':!![]});var _0x18f5c9='Scheduler';return db[_0xc73c('0x4d')][_0xc73c('0x4e')]({'where':{'name':_0x18f5c9,'userProfileId':_0xdc9285['userProfileId']},'raw':!![]})[_0xc73c('0x26')](function(_0x3d221c){if(_0x3d221c&&_0x3d221c[_0xc73c('0x4f')]===0x0){return db[_0xc73c('0x50')]['create']({'name':_0x5c58f2[_0xc73c('0x2b')],'resourceId':_0x5c58f2['id'],'type':_0x3d221c[_0xc73c('0x2b')],'sectionId':_0x3d221c['id']},{})[_0xc73c('0x26')](function(){return _0x95e686;});}else{return _0x95e686;}})[_0xc73c('0x46')](function(_0x395a52){logger[_0xc73c('0x2a')](_0xc73c('0x51'),_0x395a52);throw _0x395a52;});}return _0x95e686;})[_0xc73c('0x26')](respondWithResult(_0x459b5c,0xc9))[_0xc73c('0x46')](handleError(_0x459b5c,null));};exports[_0xc73c('0x25')]=function(_0x5235b5,_0x4f847c){if(_0x5235b5[_0xc73c('0x52')]['id']){delete _0x5235b5[_0xc73c('0x52')]['id'];}return db[_0xc73c('0x2d')]['find']({'where':{'id':_0x5235b5['params']['id']}})['then'](handleEntityNotFound(_0x4f847c,null))[_0xc73c('0x26')](saveUpdates(_0x5235b5[_0xc73c('0x52')],null))['then'](respondWithResult(_0x4f847c,null))['catch'](handleError(_0x4f847c,null));};exports[_0xc73c('0x27')]=function(_0xd87ec1,_0x3e51ee){return db[_0xc73c('0x2d')][_0xc73c('0x4e')]({'where':{'id':_0xd87ec1[_0xc73c('0x48')]['id']}})['then'](handleEntityNotFound(_0x3e51ee,null))[_0xc73c('0x26')](removeEntity(_0x3e51ee,null))[_0xc73c('0x46')](handleError(_0x3e51ee,null));};exports[_0xc73c('0x53')]=function(_0x18f4ea,_0x1391e0,_0x49e505){var _0x5cc3ec=require(_0xc73c('0x54'));return db['Schedule'][_0xc73c('0x4e')]({'where':{'id':_0x18f4ea[_0xc73c('0x48')]['id']},'raw':!![]})[_0xc73c('0x26')](handleEntityNotFound(_0x1391e0,null))[_0xc73c('0x26')](function(){_0x5cc3ec[_0xc73c('0x53')](_0x18f4ea[_0xc73c('0x48')]['id']);})[_0xc73c('0x26')](respondWithStatusCode(_0x1391e0,null))[_0xc73c('0x46')](handleError(_0x1391e0,null));};
\ No newline at end of file
index 70fe786..97ad946 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf9d=['rimraf','../../config/environment','./schedule.attributes','define','Schedule','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3a868c,_0x13b06c){var _0x51610d=function(_0x4a9362){while(--_0x4a9362){_0x3a868c['push'](_0x3a868c['shift']());}};_0x51610d(++_0x13b06c);}(_0xcf9d,0x7d));var _0xdcf9=function(_0x4d95eb,_0x222cf9){_0x4d95eb=_0x4d95eb-0x0;var _0x508bf5=_0xcf9d[_0x4d95eb];return _0x508bf5;};'use strict';var _=require(_0xdcf9('0x0'));var util=require(_0xdcf9('0x1'));var logger=require(_0xdcf9('0x2'))(_0xdcf9('0x3'));var moment=require(_0xdcf9('0x4'));var BPromise=require(_0xdcf9('0x5'));var rp=require(_0xdcf9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdcf9('0x7'));var config=require(_0xdcf9('0x8'));var attributes=require(_0xdcf9('0x9'));module['exports']=function(_0x151f62,_0x1a51b4){return _0x151f62[_0xdcf9('0xa')](_0xdcf9('0xb'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd586=['bluebird','path','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','../../config/logger','moment'];(function(_0x17c483,_0xc69535){var _0x112bdb=function(_0x19adb9){while(--_0x19adb9){_0x17c483['push'](_0x17c483['shift']());}};_0x112bdb(++_0xc69535);}(_0xd586,0x1d3));var _0x6d58=function(_0x39b1e1,_0x489013){_0x39b1e1=_0x39b1e1-0x0;var _0x4e19a5=_0xd586[_0x39b1e1];return _0x4e19a5;};'use strict';var _=require(_0x6d58('0x0'));var util=require('util');var logger=require(_0x6d58('0x1'))('api');var moment=require(_0x6d58('0x2'));var BPromise=require(_0x6d58('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d58('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d58('0x5'));module[_0x6d58('0x6')]=function(_0x4286e9,_0x236103){return _0x4286e9[_0x6d58('0x7')](_0x6d58('0x8'),attributes,{'tableName':_0x6d58('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 627f322..3d70d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63e7=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63e7,0xef));var _0x763e=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x63e7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x763e('0x0'));var util=require(_0x763e('0x1'));var moment=require(_0x763e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x763e('0x3'));var db=require(_0x763e('0x4'))['db'];var utils=require(_0x763e('0x5'));var logger=require(_0x763e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x763e('0x7'));var client=jayson[_0x763e('0x8')][_0x763e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46a15f,_0x158401,_0x41d529){return new BPromise(function(_0x20c06e,_0x41747b){return client['request'](_0x46a15f,_0x41d529)[_0x763e('0xa')](function(_0xbb38eb){logger[_0x763e('0xb')](_0x763e('0xc'),_0x158401,_0x763e('0xd'));logger['debug'](_0x763e('0xe'),_0x158401,_0x763e('0xd'),JSON[_0x763e('0xf')](_0xbb38eb));if(_0xbb38eb[_0x763e('0x10')]){if(_0xbb38eb[_0x763e('0x10')][_0x763e('0x11')]===0x1f4){logger[_0x763e('0x10')](_0x763e('0xc'),_0x158401,_0xbb38eb[_0x763e('0x10')]['message']);return _0x41747b(_0xbb38eb['error'][_0x763e('0x12')]);}logger[_0x763e('0x10')](_0x763e('0xc'),_0x158401,_0xbb38eb['error'][_0x763e('0x12')]);return _0x20c06e(_0xbb38eb['error']['message']);}else{logger[_0x763e('0xb')]('Schedule,\x20%s,\x20%s',_0x158401,_0x763e('0xd'));_0x20c06e(_0xbb38eb[_0x763e('0x13')]['message']);}})['catch'](function(_0x16811e){logger['error']('Schedule,\x20%s,\x20%s',_0x158401,_0x16811e);_0x41747b(_0x16811e);});});}
\ No newline at end of file
+var _0x1f49=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x22c2db,_0x3534e6){var _0x254a57=function(_0x16f415){while(--_0x16f415){_0x22c2db['push'](_0x22c2db['shift']());}};_0x254a57(++_0x3534e6);}(_0x1f49,0x193));var _0x91f4=function(_0x215e65,_0x183f97){_0x215e65=_0x215e65-0x0;var _0xa85842=_0x1f49[_0x215e65];return _0xa85842;};'use strict';var _=require(_0x91f4('0x0'));var util=require(_0x91f4('0x1'));var moment=require(_0x91f4('0x2'));var BPromise=require(_0x91f4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x91f4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91f4('0x5'));var logger=require(_0x91f4('0x6'))(_0x91f4('0x7'));var config=require(_0x91f4('0x8'));var jayson=require(_0x91f4('0x9'));var client=jayson[_0x91f4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1533ac,_0x1bcfd3,_0x54572c){return new BPromise(function(_0x7aea9,_0x119685){return client[_0x91f4('0xb')](_0x1533ac,_0x54572c)[_0x91f4('0xc')](function(_0xc09c12){logger[_0x91f4('0xd')](_0x91f4('0xe'),_0x1bcfd3,_0x91f4('0xf'));logger[_0x91f4('0x10')](_0x91f4('0x11'),_0x1bcfd3,_0x91f4('0xf'),JSON[_0x91f4('0x12')](_0xc09c12));if(_0xc09c12[_0x91f4('0x13')]){if(_0xc09c12[_0x91f4('0x13')]['code']===0x1f4){logger[_0x91f4('0x13')](_0x91f4('0xe'),_0x1bcfd3,_0xc09c12[_0x91f4('0x13')][_0x91f4('0x14')]);return _0x119685(_0xc09c12[_0x91f4('0x13')]['message']);}logger[_0x91f4('0x13')](_0x91f4('0xe'),_0x1bcfd3,_0xc09c12[_0x91f4('0x13')][_0x91f4('0x14')]);return _0x7aea9(_0xc09c12['error'][_0x91f4('0x14')]);}else{logger[_0x91f4('0xd')](_0x91f4('0xe'),_0x1bcfd3,_0x91f4('0xf'));_0x7aea9(_0xc09c12[_0x91f4('0x15')][_0x91f4('0x14')]);}})[_0x91f4('0x16')](function(_0x220ede){logger[_0x91f4('0x13')](_0x91f4('0xe'),_0x1bcfd3,_0x220ede);_0x119685(_0x220ede);});});}
\ No newline at end of file
index 4c42f3e..bcad6da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xafdd=['../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17b88d,_0x18aa0e){var _0x2321b0=function(_0x46b4b7){while(--_0x46b4b7){_0x17b88d['push'](_0x17b88d['shift']());}};_0x2321b0(++_0x18aa0e);}(_0xafdd,0x1c6));var _0xdafd=function(_0x382762,_0x1544f7){_0x382762=_0x382762-0x0;var _0x46641f=_0xafdd[_0x382762];return _0x46641f;};'use strict';var multer=require(_0xdafd('0x0'));var util=require(_0xdafd('0x1'));var path=require(_0xdafd('0x2'));var timeout=require(_0xdafd('0x3'));var express=require(_0xdafd('0x4'));var router=express[_0xdafd('0x5')]();var fs_extra=require(_0xdafd('0x6'));var auth=require(_0xdafd('0x7'));var interaction=require(_0xdafd('0x8'));var config=require(_0xdafd('0x9'));var controller=require('./screenRecording.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdafd('0xa')]);router[_0xdafd('0xb')](_0xdafd('0xc'),auth[_0xdafd('0xd')](),controller['describe']);router[_0xdafd('0xb')](_0xdafd('0xe'),auth[_0xdafd('0xd')](),controller[_0xdafd('0xf')]);router[_0xdafd('0xb')]('/:id/download',auth[_0xdafd('0xd')](),controller['download']);router[_0xdafd('0x10')]('/',auth[_0xdafd('0xd')](),controller[_0xdafd('0x11')]);router[_0xdafd('0x12')](_0xdafd('0xe'),auth[_0xdafd('0xd')](),controller[_0xdafd('0x13')]);router['delete'](_0xdafd('0xe'),auth[_0xdafd('0xd')](),controller[_0xdafd('0x14')]);module[_0xdafd('0x15')]=router;
\ No newline at end of file
+var _0x9c3b=['/:id','download','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe'];(function(_0x23cf73,_0xceb1db){var _0x31b572=function(_0xd38a29){while(--_0xd38a29){_0x23cf73['push'](_0x23cf73['shift']());}};_0x31b572(++_0xceb1db);}(_0x9c3b,0x157));var _0xb9c3=function(_0x45a244,_0x12f982){_0x45a244=_0x45a244-0x0;var _0x57edbc=_0x9c3b[_0x45a244];return _0x57edbc;};'use strict';var multer=require(_0xb9c3('0x0'));var util=require(_0xb9c3('0x1'));var path=require(_0xb9c3('0x2'));var timeout=require(_0xb9c3('0x3'));var express=require(_0xb9c3('0x4'));var router=express[_0xb9c3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb9c3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb9c3('0x7'));var controller=require(_0xb9c3('0x8'));router[_0xb9c3('0x9')]('/',auth['isAuthenticated'](),controller[_0xb9c3('0xa')]);router['get'](_0xb9c3('0xb'),auth[_0xb9c3('0xc')](),controller[_0xb9c3('0xd')]);router[_0xb9c3('0x9')](_0xb9c3('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xb9c3('0x9')]('/:id/download',auth['isAuthenticated'](),controller[_0xb9c3('0xf')]);router[_0xb9c3('0x10')]('/',auth[_0xb9c3('0xc')](),controller[_0xb9c3('0x11')]);router[_0xb9c3('0x12')]('/:id',auth[_0xb9c3('0xc')](),controller['update']);router[_0xb9c3('0x13')](_0xb9c3('0xe'),auth[_0xb9c3('0xc')](),controller[_0xb9c3('0x14')]);module['exports']=router;
\ No newline at end of file
index 03294ae..13998e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x726f=['toString','updatedAt','sequelize','moment','../../config/environment','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4fec5d,_0x110ea6){var _0x1b7e82=function(_0x4d26b1){while(--_0x4d26b1){_0x4fec5d['push'](_0x4fec5d['shift']());}};_0x1b7e82(++_0x110ea6);}(_0x726f,0xa2));var _0xf726=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x726f[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0xf726('0x0'));var moment=require(_0xf726('0x1'));var path=require('path');var config=require(_0xf726('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xf726('0x3')](_0xf726('0x4'))?path[_0xf726('0x5')](this[_0xf726('0x3')](_0xf726('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xf726('0x6')]},'channel':{'type':Sequelize[_0xf726('0x6')]},'value':{'type':Sequelize[_0xf726('0x6')],'set':function(_0x2dd6b8){var _0x2ed93b=_0x2dd6b8[_0xf726('0x7')](/\\/g,'/');this[_0xf726('0x8')](_0xf726('0x4'),_0x2ed93b);}},'rating':{'type':Sequelize[_0xf726('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xf726('0x9')],'set':function(_0x45c2a3){this[_0xf726('0x8')]('startedAt',moment()['subtract'](_0x45c2a3,'ms'));this['setDataValue'](_0xf726('0xa'),moment());this['setDataValue']('duration',_0x45c2a3);}},'startedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')]('startedAt'))[_0xf726('0xc')](_0xf726('0xd'))[_0xf726('0xe')]();}},'closedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')](_0xf726('0xa')))[_0xf726('0xc')](_0xf726('0xd'))['toString']();}},'createdAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this['getDataValue']('createdAt'))[_0xf726('0xc')](_0xf726('0xd'))['toString']();}},'updatedAt':{'type':Sequelize[_0xf726('0xb')],'get':function(){return moment(this[_0xf726('0x3')](_0xf726('0xf')))['format'](_0xf726('0xd'))[_0xf726('0xe')]();}}};
\ No newline at end of file
+var _0x8a5c=['VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','moment','path','../../config/environment','exports'];(function(_0x16db1f,_0x333e43){var _0x4585f5=function(_0xa64a14){while(--_0xa64a14){_0x16db1f['push'](_0x16db1f['shift']());}};_0x4585f5(++_0x333e43);}(_0x8a5c,0x136));var _0xc8a5=function(_0xfb8181,_0x5b1512){_0xfb8181=_0xfb8181-0x0;var _0x46a08b=_0x8a5c[_0xfb8181];return _0x46a08b;};'use strict';var Sequelize=require(_0xc8a5('0x0'));var moment=require(_0xc8a5('0x1'));var path=require(_0xc8a5('0x2'));var config=require(_0xc8a5('0x3'));module[_0xc8a5('0x4')]={'format':{'type':Sequelize[_0xc8a5('0x5')],'get':function(){return this[_0xc8a5('0x6')](_0xc8a5('0x7'))?path[_0xc8a5('0x8')](this['getDataValue'](_0xc8a5('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0xc8a5('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xc8a5('0x9')],'set':function(_0xcee97e){var _0xd6de78=_0xcee97e[_0xc8a5('0xa')](/\\/g,'/');this['setDataValue'](_0xc8a5('0x7'),_0xd6de78);}},'rating':{'type':Sequelize[_0xc8a5('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc8a5('0xb')],'set':function(_0x2c1fe9){this[_0xc8a5('0xc')](_0xc8a5('0xd'),moment()[_0xc8a5('0xe')](_0x2c1fe9,'ms'));this[_0xc8a5('0xc')](_0xc8a5('0xf'),moment());this['setDataValue']('duration',_0x2c1fe9);}},'startedAt':{'type':Sequelize[_0xc8a5('0x10')],'get':function(){return moment(this['getDataValue'](_0xc8a5('0xd')))[_0xc8a5('0x11')](_0xc8a5('0x12'))[_0xc8a5('0x13')]();}},'closedAt':{'type':Sequelize[_0xc8a5('0x10')],'get':function(){return moment(this['getDataValue'](_0xc8a5('0xf')))[_0xc8a5('0x11')]('MM-DD-YYYY\x20HH:mm')[_0xc8a5('0x13')]();}},'createdAt':{'type':Sequelize[_0xc8a5('0x10')],'get':function(){return moment(this[_0xc8a5('0x6')](_0xc8a5('0x14')))[_0xc8a5('0x11')](_0xc8a5('0x12'))['toString']();}},'updatedAt':{'type':Sequelize[_0xc8a5('0x10')],'get':function(){return moment(this[_0xc8a5('0x6')]('updatedAt'))[_0xc8a5('0x11')](_0xc8a5('0x12'))['toString']();}}};
\ No newline at end of file
index eee273a..d13e3db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x5a4889,_0x21c78e){var _0x2fa8de=function(_0x4c0ba0){while(--_0x4c0ba0){_0x5a4889['push'](_0x5a4889['shift']());}};_0x2fa8de(++_0x21c78e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));};
\ No newline at end of file
+var _0x5636=['rawAttributes','fieldName','type','key','model','differenceBy','map','format','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ScreenRecording','count','includeAll','include','findAll','rows','catch','show','find','create','body','duration','createdAt','closedAt','value','describe','uniqueid','params','join','root','server/files/screen_recordings','%s.cypher','existsSync','secrets','recording','Sequelize','ValidationError','download','filename','extname','unlink','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','index'];(function(_0x1c0be3,_0x27d5a5){var _0x1001c3=function(_0xfd1377){while(--_0xfd1377){_0x1c0be3['push'](_0x1c0be3['shift']());}};_0x1001c3(++_0x27d5a5);}(_0x5636,0x102));var _0x6563=function(_0x398d6b,_0x2bd173){_0x398d6b=_0x398d6b-0x0;var _0x488104=_0x5636[_0x398d6b];return _0x488104;};'use strict';var emlformat=require(_0x6563('0x0'));var rimraf=require(_0x6563('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6563('0x2'));var BPromise=require(_0x6563('0x3'));var Mustache=require(_0x6563('0x4'));var util=require('util');var path=require(_0x6563('0x5'));var sox=require(_0x6563('0x6'));var csv=require(_0x6563('0x7'));var ejs=require(_0x6563('0x8'));var fs=require('fs');var fs_extra=require(_0x6563('0x9'));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('0x7'));var querystring=require(_0x6563('0xf'));var Papa=require(_0x6563('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6563('0x11'));var as=require(_0x6563('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x6563('0x13'));var config=require(_0x6563('0x14'));var licenseUtil=require(_0x6563('0x15'));var db=require(_0x6563('0x16'))['db'];function respondWithStatusCode(_0x33816e,_0x2ed676){_0x2ed676=_0x2ed676||0xcc;return function(_0x31d3fa){if(_0x31d3fa){return _0x33816e[_0x6563('0x17')](_0x2ed676);}return _0x33816e[_0x6563('0x18')](_0x2ed676)['end']();};}function respondWithResult(_0xa0a0b6,_0x5e9329){_0x5e9329=_0x5e9329||0xc8;return function(_0x37131e){if(_0x37131e){return _0xa0a0b6[_0x6563('0x18')](_0x5e9329)[_0x6563('0x19')](_0x37131e);}};}function respondWithFilteredResult(_0x10d08c,_0x5af5d0){return function(_0x26f26e){if(_0x26f26e){var _0x11baa2=typeof _0x5af5d0[_0x6563('0x1a')]===_0x6563('0x1b')&&typeof _0x5af5d0['limit']===_0x6563('0x1b');var _0x589632=_0x26f26e['count'];var _0x47972a=_0x11baa2?0x0:_0x5af5d0[_0x6563('0x1a')];var _0x4f5609=_0x11baa2?_0x26f26e['count']:_0x5af5d0[_0x6563('0x1a')]+_0x5af5d0[_0x6563('0x1c')];var _0x17a29f;if(_0x4f5609>=_0x589632){_0x4f5609=_0x589632;_0x17a29f=0xc8;}else{_0x17a29f=0xce;}_0x10d08c[_0x6563('0x18')](_0x17a29f);return _0x10d08c[_0x6563('0x1d')](_0x6563('0x1e'),_0x47972a+'-'+_0x4f5609+'/'+_0x589632)[_0x6563('0x19')](_0x26f26e);}return null;};}function patchUpdates(_0x93a45){return function(_0x2a70f0){try{jsonpatch['apply'](_0x2a70f0,_0x93a45,!![]);}catch(_0x2f2905){return BPromise[_0x6563('0x1f')](_0x2f2905);}return _0x2a70f0[_0x6563('0x20')]();};}function saveUpdates(_0x5a335c,_0x293db2){return function(_0x5c37bb){if(_0x5c37bb){return _0x5c37bb[_0x6563('0x21')](_0x5a335c)[_0x6563('0x22')](function(_0x5610b0){return _0x5610b0;});}return null;};}function removeEntity(_0x5773e2,_0x3ab7f6){return function(_0x492f45){if(_0x492f45){return _0x492f45[_0x6563('0x23')]()[_0x6563('0x22')](function(){_0x5773e2[_0x6563('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd860d5,_0x51ff06){return function(_0x7ea857){if(!_0x7ea857){_0xd860d5[_0x6563('0x17')](0x194);}return _0x7ea857;};}function handleError(_0x5e5aeb,_0x365b16){_0x365b16=_0x365b16||0x1f4;return function(_0x28252d){logger['error'](_0x28252d[_0x6563('0x24')]);if(_0x28252d['name']){delete _0x28252d[_0x6563('0x25')];}_0x5e5aeb['status'](_0x365b16)['send'](_0x28252d);};}exports[_0x6563('0x26')]=function(_0x118d31,_0x17326c){var _0x2a1550={},_0x3eb23b={},_0x4b4d3b={'count':0x0,'rows':[]};var _0x3c8bd1=_['map'](db['ScreenRecording'][_0x6563('0x27')],function(_0x35af37){return{'name':_0x35af37[_0x6563('0x28')],'type':_0x35af37[_0x6563('0x29')][_0x6563('0x2a')]};});_0x3eb23b[_0x6563('0x2b')]=_[_0x6563('0x2c')](_[_0x6563('0x2d')](_0x3c8bd1,_0x6563('0x25')),[_0x6563('0x2e')]);_0x3eb23b['query']=_[_0x6563('0x2f')](_0x118d31[_0x6563('0x30')]);_0x3eb23b[_0x6563('0x31')]=_[_0x6563('0x32')](_0x3eb23b[_0x6563('0x2b')],_0x3eb23b[_0x6563('0x30')]);_0x2a1550[_0x6563('0x33')]=_['intersection'](_0x3eb23b[_0x6563('0x2b')],qs[_0x6563('0x34')](_0x118d31[_0x6563('0x30')][_0x6563('0x34')]));_0x2a1550[_0x6563('0x33')]=_0x2a1550[_0x6563('0x33')]['length']?_0x2a1550[_0x6563('0x33')]:_0x3eb23b[_0x6563('0x2b')];if(!_0x118d31[_0x6563('0x30')][_0x6563('0x35')](_0x6563('0x36'))){_0x2a1550[_0x6563('0x1c')]=qs[_0x6563('0x1c')](_0x118d31['query'][_0x6563('0x1c')]);_0x2a1550[_0x6563('0x1a')]=qs['offset'](_0x118d31[_0x6563('0x30')][_0x6563('0x1a')]);}_0x2a1550['order']=qs['sort'](_0x118d31[_0x6563('0x30')][_0x6563('0x37')]);_0x2a1550[_0x6563('0x38')]=qs[_0x6563('0x31')](_['pick'](_0x118d31[_0x6563('0x30')],_0x3eb23b[_0x6563('0x31')]),_0x3c8bd1);if(_0x118d31['query'][_0x6563('0x39')]){_0x2a1550[_0x6563('0x38')]=_[_0x6563('0x3a')](_0x2a1550[_0x6563('0x38')],{'$or':_[_0x6563('0x2d')](_0x3c8bd1,function(_0x1f6341){if(_0x1f6341[_0x6563('0x29')]!==_0x6563('0x3b')){var _0x2e4177={};_0x2e4177[_0x1f6341['name']]={'$like':'%'+_0x118d31[_0x6563('0x30')][_0x6563('0x39')]+'%'};return _0x2e4177;}})});}_0x2a1550=_[_0x6563('0x3a')]({},_0x2a1550,_0x118d31[_0x6563('0x3c')]);var _0x5ebe88={'where':_0x2a1550['where']};return db[_0x6563('0x3d')][_0x6563('0x3e')](_0x5ebe88)[_0x6563('0x22')](function(_0x5db29d){_0x4b4d3b[_0x6563('0x3e')]=_0x5db29d;if(_0x118d31['query'][_0x6563('0x3f')]){_0x2a1550[_0x6563('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0x6563('0x41')](_0x2a1550);})[_0x6563('0x22')](function(_0xea186){_0x4b4d3b[_0x6563('0x42')]=_0xea186;return _0x4b4d3b;})[_0x6563('0x22')](respondWithFilteredResult(_0x17326c,_0x2a1550))[_0x6563('0x43')](handleError(_0x17326c,null));};exports[_0x6563('0x44')]=function(_0x32932f,_0xd30789){var _0xfc7eb1={'raw':![],'where':{'id':_0x32932f['params']['id']}},_0x2acb52={};_0x2acb52['model']=_[_0x6563('0x2f')](db[_0x6563('0x3d')][_0x6563('0x27')]);_0x2acb52[_0x6563('0x30')]=_[_0x6563('0x2f')](_0x32932f[_0x6563('0x30')]);_0x2acb52[_0x6563('0x31')]=_['intersection'](_0x2acb52[_0x6563('0x2b')],_0x2acb52[_0x6563('0x30')]);_0xfc7eb1[_0x6563('0x33')]=_[_0x6563('0x32')](_0x2acb52['model'],qs[_0x6563('0x34')](_0x32932f[_0x6563('0x30')][_0x6563('0x34')]));_0xfc7eb1[_0x6563('0x33')]=_0xfc7eb1[_0x6563('0x33')]['length']?_0xfc7eb1['attributes']:_0x2acb52[_0x6563('0x2b')];if(_0x32932f[_0x6563('0x30')][_0x6563('0x3f')]){_0xfc7eb1['include']=[{'all':!![]}];}_0xfc7eb1=_[_0x6563('0x3a')]({},_0xfc7eb1,_0x32932f[_0x6563('0x3c')]);return db[_0x6563('0x3d')][_0x6563('0x45')](_0xfc7eb1)['then'](handleEntityNotFound(_0xd30789,null))[_0x6563('0x22')](respondWithResult(_0xd30789,null))[_0x6563('0x43')](handleError(_0xd30789,null));};exports[_0x6563('0x46')]=function(_0x55e927,_0x35b0ce){return db['ScreenRecording'][_0x6563('0x46')](_0x55e927['body'],{})['then'](respondWithResult(_0x35b0ce,0xc9))[_0x6563('0x43')](handleError(_0x35b0ce,null));};exports[_0x6563('0x21')]=function(_0x2ebab0,_0xb84325){if(_0x2ebab0[_0x6563('0x47')]['id']){delete _0x2ebab0[_0x6563('0x47')]['id'];}delete _0x2ebab0[_0x6563('0x47')][_0x6563('0x48')];delete _0x2ebab0[_0x6563('0x47')][_0x6563('0x49')];delete _0x2ebab0['body'][_0x6563('0x4a')];delete _0x2ebab0['body'][_0x6563('0x4b')];return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':{'id':_0x2ebab0['params']['id']}})[_0x6563('0x22')](handleEntityNotFound(_0xb84325,null))[_0x6563('0x22')](saveUpdates(_0x2ebab0['body'],null))[_0x6563('0x22')](respondWithResult(_0xb84325,null))[_0x6563('0x43')](handleError(_0xb84325,null));};exports[_0x6563('0x4c')]=function(_0x3883f3,_0xbd920a){return db['ScreenRecording'][_0x6563('0x4c')]()['then'](respondWithResult(_0xbd920a,null))[_0x6563('0x43')](handleError(_0xbd920a,null));};exports['download']=function(_0xd2ed6b,_0x5992c8,_0x55e002){var _0x5c8274=require('../../components/encryptor');var _0x270667=![];var _0x5ade56={};if(_0xd2ed6b[_0x6563('0x30')]['type']&&_0xd2ed6b[_0x6563('0x30')][_0x6563('0x29')]===_0x6563('0x4d')){_0x5ade56[_0x6563('0x4d')]=_0xd2ed6b[_0x6563('0x4e')]['id'];}else{_0x5ade56['id']=_0xd2ed6b[_0x6563('0x4e')]['id'];}return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':_0x5ade56,'attributes':['id',_0x6563('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x5992c8,null))[_0x6563('0x22')](function(_0x28b1c6){if(_0x28b1c6){var _0x97ee3=path[_0x6563('0x4f')](config[_0x6563('0x50')],_0x6563('0x51'),_0x28b1c6[_0x6563('0x4b')]);var _0x32c715=util[_0x6563('0x2e')](_0x6563('0x52'),_0x97ee3);if(fs[_0x6563('0x53')](_0x32c715)){_0x270667=!![];return _0x5c8274['decryptFile'](_0x32c715,_0x97ee3,config[_0x6563('0x54')][_0x6563('0x55')])[_0x6563('0x22')](function(){return _0x28b1c6;});}return _0x28b1c6;}})[_0x6563('0x22')](function(_0x46c26c){if(_0x46c26c){var _0x3c06ac=path[_0x6563('0x4f')](config[_0x6563('0x50')],'server/files/screen_recordings',_0x46c26c[_0x6563('0x4b')]);if(!fs['existsSync'](_0x3c06ac)){throw new db[(_0x6563('0x56'))][(_0x6563('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x46c26c['filename']){return _0x5992c8[_0x6563('0x58')](_0x3c06ac,_0x46c26c[_0x6563('0x59')]+path[_0x6563('0x5a')](_0x3c06ac),function(){if(_0x270667){fs[_0x6563('0x5b')](_0x3c06ac);}});}else{return _0x5992c8['download'](_0x3c06ac,function(_0x2a3df0){if(_0x270667){fs['unlink'](_0x3c06ac);}});}}})[_0x6563('0x43')](function(_0x29aecb){if(_0x29aecb['message']==='ScreenRecording\x20not\x20found'){_0x5992c8[_0x6563('0x18')](0x194)['send']('Not\x20found');}else{return handleError(_0x5992c8,null);}});};exports[_0x6563('0x23')]=function(_0x49d6a5,_0x356010){return db[_0x6563('0x3d')][_0x6563('0x45')]({'where':{'id':_0x49d6a5[_0x6563('0x4e')]['id']}})['then'](function(_0x83d5c){if(_[_0x6563('0x5c')](_0x83d5c)){throw new ReferenceError(_0x6563('0x5d'));}return _0x83d5c;})[_0x6563('0x22')](function(_0x3ffb7f){var _0x2d4694=path[_0x6563('0x4f')](config[_0x6563('0x50')],'server/files/screen_recordings',_0x3ffb7f['value']);logger[_0x6563('0x5e')](_0x6563('0x5f'),_0x2d4694);if(!_['isNil'](_0x3ffb7f['value'])&&fs['existsSync'](_0x2d4694)){logger[_0x6563('0x5e')](_0x6563('0x60')+_0x2d4694+_0x6563('0x61'));fs[_0x6563('0x62')](_0x2d4694);}_0x2d4694=_0x2d4694+'.cypher';if(!_[_0x6563('0x5c')](_0x3ffb7f[_0x6563('0x4b')])&&fs[_0x6563('0x53')](_0x2d4694)){logger[_0x6563('0x5e')](_0x6563('0x60')+_0x2d4694+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2d4694);}return _0x3ffb7f;})[_0x6563('0x22')](function(_0x1d7b5d){if(!_0x1d7b5d)throw new InternalError();return _0x1d7b5d[_0x6563('0x23')]();})['then'](function(){_0x356010[_0x6563('0x18')](0xcc)['end']();})[_0x6563('0x43')](handleError(_0x356010,null));};
\ No newline at end of file
index fb67fcf..e16328a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x014c=['../../config/environment','define','ScreenRecording','interactionid','../../config/logger','api','moment','path'];(function(_0x1631b2,_0xd36b45){var _0x308435=function(_0x173f18){while(--_0x173f18){_0x1631b2['push'](_0x1631b2['shift']());}};_0x308435(++_0xd36b45);}(_0x014c,0x14c));var _0xc014=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x014c[_0x38fb0d];return _0x30a5d6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc014('0x0'))(_0xc014('0x1'));var moment=require(_0xc014('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc014('0x3'));var rimraf=require('rimraf');var config=require(_0xc014('0x4'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x3ef4a9,_0x292d17){return _0x3ef4a9[_0xc014('0x5')](_0xc014('0x6'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0xc014('0x7'),'fields':[_0xc014('0x7')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfb3f=['rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','request-promise','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfb3f,0x1c3));var _0xffb3=function(_0x3d0c76,_0x4486df){_0x3d0c76=_0x3d0c76-0x0;var _0x3a9db7=_0xfb3f[_0x3d0c76];return _0x3a9db7;};'use strict';var _=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var logger=require(_0xffb3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xffb3('0x3'));var fs=require('fs');var path=require(_0xffb3('0x4'));var rimraf=require(_0xffb3('0x5'));var config=require('../../config/environment');var attributes=require(_0xffb3('0x6'));module[_0xffb3('0x7')]=function(_0x2d9b18,_0x66fd86){return _0x2d9b18[_0xffb3('0x8')](_0xffb3('0x9'),attributes,{'tableName':_0xffb3('0xa'),'paranoid':![],'indexes':[{'name':_0xffb3('0xb'),'fields':[_0xffb3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 31473cc..272017b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9995=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x470ab8,_0x2b1097){var _0x298eee=function(_0x25dd32){while(--_0x25dd32){_0x470ab8['push'](_0x470ab8['shift']());}};_0x298eee(++_0x2b1097);}(_0x9995,0xca));var _0x5999=function(_0x33fa0a,_0x2ec558){_0x33fa0a=_0x33fa0a-0x0;var _0x7147fe=_0x9995[_0x33fa0a];return _0x7147fe;};'use strict';var _=require(_0x5999('0x0'));var util=require(_0x5999('0x1'));var moment=require(_0x5999('0x2'));var BPromise=require(_0x5999('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5999('0x4'));var db=require(_0x5999('0x5'))['db'];var utils=require(_0x5999('0x6'));var logger=require(_0x5999('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5999('0x8')][_0x5999('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1acc6d,_0x5d95b4,_0x5cae20){return new BPromise(function(_0x13f3ce,_0x2d875f){return client[_0x5999('0xa')](_0x1acc6d,_0x5cae20)[_0x5999('0xb')](function(_0x39b6c8){logger[_0x5999('0xc')](_0x5999('0xd'),_0x5d95b4,_0x5999('0xe'));logger[_0x5999('0xf')](_0x5999('0x10'),_0x5d95b4,'request\x20sent',JSON[_0x5999('0x11')](_0x39b6c8));if(_0x39b6c8['error']){if(_0x39b6c8[_0x5999('0x12')][_0x5999('0x13')]===0x1f4){logger[_0x5999('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x5d95b4,_0x39b6c8[_0x5999('0x12')]['message']);return _0x2d875f(_0x39b6c8[_0x5999('0x12')][_0x5999('0x14')]);}logger[_0x5999('0x12')](_0x5999('0xd'),_0x5d95b4,_0x39b6c8[_0x5999('0x12')][_0x5999('0x14')]);return _0x13f3ce(_0x39b6c8[_0x5999('0x12')][_0x5999('0x14')]);}else{logger[_0x5999('0xc')]('ScreenRecording,\x20%s,\x20%s',_0x5d95b4,_0x5999('0xe'));_0x13f3ce(_0x39b6c8['result'][_0x5999('0x14')]);}})[_0x5999('0x15')](function(_0x4c19b2){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x5d95b4,_0x4c19b2);_0x2d875f(_0x4c19b2);});});}
\ No newline at end of file
+var _0xed5a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x204453,_0x3d4f5a){var _0x21d9f4=function(_0x19d35f){while(--_0x19d35f){_0x204453['push'](_0x204453['shift']());}};_0x21d9f4(++_0x3d4f5a);}(_0xed5a,0x117));var _0xaed5=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0xed5a[_0x2a0738];return _0x159679;};'use strict';var _=require(_0xaed5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaed5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaed5('0x2'));var db=require(_0xaed5('0x3'))['db'];var utils=require(_0xaed5('0x4'));var logger=require(_0xaed5('0x5'))(_0xaed5('0x6'));var config=require(_0xaed5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaed5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x259eb9,_0x43c2bc,_0x500b19){return new BPromise(function(_0x48766b,_0x2494a1){return client[_0xaed5('0x9')](_0x259eb9,_0x500b19)[_0xaed5('0xa')](function(_0x1fbcd6){logger[_0xaed5('0xb')](_0xaed5('0xc'),_0x43c2bc,_0xaed5('0xd'));logger[_0xaed5('0xe')](_0xaed5('0xf'),_0x43c2bc,_0xaed5('0xd'),JSON[_0xaed5('0x10')](_0x1fbcd6));if(_0x1fbcd6[_0xaed5('0x11')]){if(_0x1fbcd6[_0xaed5('0x11')][_0xaed5('0x12')]===0x1f4){logger['error'](_0xaed5('0xc'),_0x43c2bc,_0x1fbcd6[_0xaed5('0x11')]['message']);return _0x2494a1(_0x1fbcd6[_0xaed5('0x11')][_0xaed5('0x13')]);}logger[_0xaed5('0x11')](_0xaed5('0xc'),_0x43c2bc,_0x1fbcd6['error']['message']);return _0x48766b(_0x1fbcd6['error'][_0xaed5('0x13')]);}else{logger[_0xaed5('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x43c2bc,'request\x20sent');_0x48766b(_0x1fbcd6[_0xaed5('0x14')]['message']);}})['catch'](function(_0x228569){logger[_0xaed5('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x43c2bc,_0x228569);_0x2494a1(_0x228569);});});}
\ No newline at end of file
index df6fe19..457350b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fde=['single','file','addLogo','logologin','extname','post','/:id/preferred','addPreferred','express','Router','fs-extra','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','getLogo','gdpr','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','/:id/logo'];(function(_0x3c815e,_0x3d8105){var _0xf66654=function(_0x55cf6b){while(--_0x55cf6b){_0x3c815e['push'](_0x3c815e['shift']());}};_0xf66654(++_0x3d8105);}(_0x2fde,0x1e8));var _0xe2fd=function(_0x2de775,_0x537797){_0x2de775=_0x2de775-0x0;var _0x4db3e6=_0x2fde[_0x2de775];return _0x4db3e6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe2fd('0x0'));var router=express[_0xe2fd('0x1')]();var fs_extra=require(_0xe2fd('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe2fd('0x3'));var controller=require(_0xe2fd('0x4'));router[_0xe2fd('0x5')]('/',auth['isAuthenticated'](),controller[_0xe2fd('0x6')]);router['get'](_0xe2fd('0x7'),controller[_0xe2fd('0x8')]);router['get'](_0xe2fd('0x9'),controller[_0xe2fd('0xa')]);router[_0xe2fd('0x5')]('/:id/logo',controller[_0xe2fd('0xb')]);router['get']('/:id/logo_login',controller['getLogoLogin']);router[_0xe2fd('0x5')]('/:id/gdpr',controller[_0xe2fd('0xc')]);router[_0xe2fd('0x5')]('/:id/preferred',controller['getPreferred']);router[_0xe2fd('0x5')](_0xe2fd('0xd'),controller[_0xe2fd('0xe')]);var upload=multer({'storage':multer[_0xe2fd('0xf')]({'destination':function(_0x3aa0a4,_0xf4ca1b,_0x56cc98){_0x56cc98(null,path[_0xe2fd('0x10')](config[_0xe2fd('0x11')],_0xe2fd('0x12')));},'filename':function(_0x4ca6ba,_0x37ddfe,_0x380ace){_0x380ace(null,util[_0xe2fd('0x13')](_0xe2fd('0x14'),_0xe2fd('0x15'),path['extname'](_0x37ddfe[_0xe2fd('0x16')])));}})});router['post'](_0xe2fd('0x17'),upload[_0xe2fd('0x18')](_0xe2fd('0x19')),controller[_0xe2fd('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9258c0,_0x150ac7,_0x29d989){_0x29d989(null,path[_0xe2fd('0x10')](config[_0xe2fd('0x11')],'server/files/images/logos/'));},'filename':function(_0x517b6c,_0x106516,_0x25e99e){_0x25e99e(null,util['format'](_0xe2fd('0x14'),_0xe2fd('0x1b'),path[_0xe2fd('0x1c')](_0x106516[_0xe2fd('0x16')])));}})});router[_0xe2fd('0x1d')]('/:id/logo_login',upload[_0xe2fd('0x18')](_0xe2fd('0x19')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xe2fd('0xf')]({'destination':function(_0x5d37ed,_0x15c780,_0x2179b3){_0x2179b3(null,path[_0xe2fd('0x10')](config['root'],'server/files/images/logos/'));},'filename':function(_0x5c6fdb,_0x249728,_0x112293){_0x112293(null,util[_0xe2fd('0x13')](_0xe2fd('0x14'),'preferred',path['extname'](_0x249728['originalname'])));}})});router[_0xe2fd('0x1d')](_0xe2fd('0x1e'),upload[_0xe2fd('0x18')](_0xe2fd('0x19')),controller[_0xe2fd('0x1f')]);var upload=multer({'storage':multer[_0xe2fd('0xf')]({'destination':function(_0x4ff7fc,_0x4661c3,_0x5756b8){_0x5756b8(null,path['join'](config[_0xe2fd('0x11')],_0xe2fd('0x12')));},'filename':function(_0x111b57,_0x2565f2,_0x4fdee4){_0x4fdee4(null,util[_0xe2fd('0x13')]('%s%s','favicon',path[_0xe2fd('0x1c')](_0x2565f2[_0xe2fd('0x16')])));}})});router[_0xe2fd('0x1d')](_0xe2fd('0xd'),upload[_0xe2fd('0x18')]('file'),controller['addFavicon']);router['put'](_0xe2fd('0x9'),auth['isAuthenticated'](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x0c23=['getLogo','getLogoLogin','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','file','addLogo','join','logologin','/:id/logo_login','single','addLogoLogin','preferred','addPreferred','addFavicon','put','update','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo'];(function(_0x1b188d,_0x23330d){var _0x9c0b20=function(_0x269faa){while(--_0x269faa){_0x1b188d['push'](_0x1b188d['shift']());}};_0x9c0b20(++_0x23330d);}(_0x0c23,0x175));var _0x30c2=function(_0x2ad1ae,_0x3d3dd5){_0x2ad1ae=_0x2ad1ae-0x0;var _0x2a7ace=_0x0c23[_0x2ad1ae];return _0x2a7ace;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x30c2('0x0'));var express=require('express');var router=express[_0x30c2('0x1')]();var fs_extra=require(_0x30c2('0x2'));var auth=require(_0x30c2('0x3'));var interaction=require(_0x30c2('0x4'));var config=require(_0x30c2('0x5'));var controller=require(_0x30c2('0x6'));router[_0x30c2('0x7')]('/',auth[_0x30c2('0x8')](),controller[_0x30c2('0x9')]);router['get'](_0x30c2('0xa'),controller['getDate']);router['get'](_0x30c2('0xb'),controller[_0x30c2('0xc')]);router[_0x30c2('0x7')](_0x30c2('0xd'),controller[_0x30c2('0xe')]);router[_0x30c2('0x7')]('/:id/logo_login',controller[_0x30c2('0xf')]);router[_0x30c2('0x7')]('/:id/gdpr',controller[_0x30c2('0x10')]);router[_0x30c2('0x7')](_0x30c2('0x11'),controller[_0x30c2('0x12')]);router[_0x30c2('0x7')](_0x30c2('0x13'),controller[_0x30c2('0x14')]);var upload=multer({'storage':multer[_0x30c2('0x15')]({'destination':function(_0xdba2d8,_0xc1cf14,_0x49a4b8){_0x49a4b8(null,path['join'](config[_0x30c2('0x16')],_0x30c2('0x17')));},'filename':function(_0x33e602,_0x443ccb,_0x28f266){_0x28f266(null,util[_0x30c2('0x18')](_0x30c2('0x19'),_0x30c2('0x1a'),path[_0x30c2('0x1b')](_0x443ccb[_0x30c2('0x1c')])));}})});router[_0x30c2('0x1d')]('/:id/logo',upload['single'](_0x30c2('0x1e')),controller[_0x30c2('0x1f')]);var upload=multer({'storage':multer[_0x30c2('0x15')]({'destination':function(_0x237693,_0x13580a,_0x4f6cfa){_0x4f6cfa(null,path[_0x30c2('0x20')](config[_0x30c2('0x16')],_0x30c2('0x17')));},'filename':function(_0x15353b,_0x3f61ab,_0x59a9d2){_0x59a9d2(null,util['format'](_0x30c2('0x19'),_0x30c2('0x21'),path[_0x30c2('0x1b')](_0x3f61ab[_0x30c2('0x1c')])));}})});router[_0x30c2('0x1d')](_0x30c2('0x22'),upload[_0x30c2('0x23')]('file'),controller[_0x30c2('0x24')]);var upload=multer({'storage':multer[_0x30c2('0x15')]({'destination':function(_0x2b58a0,_0x3970d2,_0xf75538){_0xf75538(null,path['join'](config[_0x30c2('0x16')],_0x30c2('0x17')));},'filename':function(_0x2b757c,_0x3e5aba,_0x5afd61){_0x5afd61(null,util['format'](_0x30c2('0x19'),_0x30c2('0x25'),path[_0x30c2('0x1b')](_0x3e5aba[_0x30c2('0x1c')])));}})});router['post'](_0x30c2('0x11'),upload[_0x30c2('0x23')](_0x30c2('0x1e')),controller[_0x30c2('0x26')]);var upload=multer({'storage':multer[_0x30c2('0x15')]({'destination':function(_0x2898bb,_0x2ae08a,_0x29626d){_0x29626d(null,path['join'](config[_0x30c2('0x16')],_0x30c2('0x17')));},'filename':function(_0x219f3d,_0x5b3a5d,_0x3e69fd){_0x3e69fd(null,util[_0x30c2('0x18')](_0x30c2('0x19'),'favicon',path['extname'](_0x5b3a5d[_0x30c2('0x1c')])));}})});router['post'](_0x30c2('0x13'),upload[_0x30c2('0x23')](_0x30c2('0x1e')),controller[_0x30c2('0x27')]);router[_0x30c2('0x28')](_0x30c2('0xb'),auth['isAuthenticated'](),controller[_0x30c2('0x29')]);module[_0x30c2('0x2a')]=router;
\ No newline at end of file
index 1d3e191..9862603 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3c4273,_0x48ceef){var _0x5774bb=function(_0x3a19a4){while(--_0x3a19a4){_0x3c4273['push'](_0x3c4273['shift']());}};_0x5774bb(++_0x48ceef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
+var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x3ec579,_0x1ba7e2){var _0x3c5910=function(_0x142cd9){while(--_0x142cd9){_0x3ec579['push'](_0x3ec579['shift']());}};_0x3c5910(++_0x1ba7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}};
\ No newline at end of file
index ae933b4..b2c5c11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc746=['message','Setting,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count','reject','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','Setting','findAll','show','params','find','update','body','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','logo','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','toLower','upperFirst','custom','default_logo.svg','Sequelize','download','getLicense','defaultLoginLogo','defaultPreferred','root','default_loginLogo.svg','default','gdpr','securePassword','default_preferred.png','ValidationError','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','utcOffset','now','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','jayson/promise','request','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48562e,_0x1da1bc){var _0x19df96=function(_0xf7fd7e){while(--_0xf7fd7e){_0x48562e['push'](_0x48562e['shift']());}};_0x19df96(++_0x1da1bc);}(_0xc746,0xc9));var _0x6c74=function(_0x4cbb54,_0x87d062){_0x4cbb54=_0x4cbb54-0x0;var _0x39f2e1=_0xc746[_0x4cbb54];return _0x39f2e1;};'use strict';var emlformat=require(_0x6c74('0x0'));var rimraf=require(_0x6c74('0x1'));var zipdir=require(_0x6c74('0x2'));var jsonpatch=require(_0x6c74('0x3'));var rp=require(_0x6c74('0x4'));var moment=require(_0x6c74('0x5'));var BPromise=require(_0x6c74('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6c74('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6c74('0x8'));var fs=require('fs');var fs_extra=require(_0x6c74('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6c74('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6c74('0xb'));var querystring=require(_0x6c74('0xc'));var Papa=require(_0x6c74('0xd'));var Redis=require(_0x6c74('0xe'));var authService=require(_0x6c74('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6c74('0x10'));var hardwareService=require(_0x6c74('0x11'));var logger=require(_0x6c74('0x12'))('api');var utils=require(_0x6c74('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0x6c74('0x14'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e93a5,_0x34adfb,_0x23bd7e,_0x167c89){return new BPromise(function(_0x504061,_0xb7ce50){var _0x306ecf=_0x167c89||client;return _0x306ecf[_0x6c74('0x15')](_0x2e93a5,_0x23bd7e)[_0x6c74('0x16')](function(_0x19bb25){logger[_0x6c74('0x17')]('Setting,\x20%s,\x20%s',_0x34adfb,_0x6c74('0x18'));logger['debug'](_0x6c74('0x19'),_0x34adfb,'request\x20sent',JSON[_0x6c74('0x1a')](_0x19bb25));if(_0x19bb25[_0x6c74('0x1b')]){if(_0x19bb25[_0x6c74('0x1b')][_0x6c74('0x1c')]===0x1f4){logger[_0x6c74('0x1b')]('Setting,\x20%s,\x20%s',_0x34adfb,_0x19bb25[_0x6c74('0x1b')][_0x6c74('0x1d')]);return _0xb7ce50(_0x19bb25['error'][_0x6c74('0x1d')]);}logger[_0x6c74('0x1b')](_0x6c74('0x1e'),_0x34adfb,_0x19bb25['error'][_0x6c74('0x1d')]);return _0x504061(_0x19bb25[_0x6c74('0x1b')][_0x6c74('0x1d')]);}else{logger[_0x6c74('0x17')](_0x6c74('0x1e'),_0x34adfb,'request\x20sent');_0x504061(_0x19bb25[_0x6c74('0x1f')][_0x6c74('0x1d')]);}})[_0x6c74('0x20')](function(_0x339ce2){logger[_0x6c74('0x1b')](_0x6c74('0x1e'),_0x34adfb,_0x339ce2);_0xb7ce50(_0x339ce2);});});}function respondWithStatusCode(_0x44db67,_0x2cf4d0){_0x2cf4d0=_0x2cf4d0||0xcc;return function(_0x590e44){if(_0x590e44){return _0x44db67['sendStatus'](_0x2cf4d0);}return _0x44db67[_0x6c74('0x21')](_0x2cf4d0)[_0x6c74('0x22')]();};}function respondWithResult(_0x57b131,_0x56c7d3){_0x56c7d3=_0x56c7d3||0xc8;return function(_0x1d1cea){if(_0x1d1cea){return _0x57b131[_0x6c74('0x21')](_0x56c7d3)[_0x6c74('0x23')](_0x1d1cea);}};}function respondWithFilteredResult(_0x1beac0,_0x590eab){return function(_0x5f53c9){if(_0x5f53c9){var _0x1731b3=typeof _0x590eab[_0x6c74('0x24')]===_0x6c74('0x25')&&typeof _0x590eab[_0x6c74('0x26')]===_0x6c74('0x25');var _0x42c451=_0x5f53c9[_0x6c74('0x27')];var _0x2b422c=_0x1731b3?0x0:_0x590eab[_0x6c74('0x24')];var _0x37112f=_0x1731b3?_0x5f53c9[_0x6c74('0x27')]:_0x590eab[_0x6c74('0x24')]+_0x590eab[_0x6c74('0x26')];var _0x146825;if(_0x37112f>=_0x42c451){_0x37112f=_0x42c451;_0x146825=0xc8;}else{_0x146825=0xce;}_0x1beac0[_0x6c74('0x21')](_0x146825);return _0x1beac0['set']('Content-Range',_0x2b422c+'-'+_0x37112f+'/'+_0x42c451)['json'](_0x5f53c9);}return null;};}function patchUpdates(_0x22e291){return function(_0x41e5f5){try{jsonpatch['apply'](_0x41e5f5,_0x22e291,!![]);}catch(_0x304d97){return BPromise[_0x6c74('0x28')](_0x304d97);}return _0x41e5f5['save']();};}function saveUpdates(_0x599b2c,_0x1d326c){return function(_0xf36af3){if(_0xf36af3){return _0xf36af3['update'](_0x599b2c)[_0x6c74('0x16')](function(_0x5d7f99){return _0x5d7f99;});}return null;};}function removeEntity(_0x5d1970,_0x51620a){return function(_0x8cf5ac){if(_0x8cf5ac){return _0x8cf5ac[_0x6c74('0x29')]()['then'](function(){_0x5d1970[_0x6c74('0x21')](0xcc)[_0x6c74('0x22')]();});}};}function handleEntityNotFound(_0x50b8a0,_0x24414a){return function(_0x1d8428){if(!_0x1d8428){_0x50b8a0[_0x6c74('0x2a')](0x194);}return _0x1d8428;};}function handleError(_0x1ca17e,_0x3a9acc){_0x3a9acc=_0x3a9acc||0x1f4;return function(_0x10803b){logger[_0x6c74('0x1b')](_0x10803b[_0x6c74('0x2b')]);if(_0x10803b[_0x6c74('0x2c')]){delete _0x10803b[_0x6c74('0x2c')];}_0x1ca17e[_0x6c74('0x21')](_0x3a9acc)[_0x6c74('0x2d')](_0x10803b);};}exports[_0x6c74('0x2e')]=function(_0x4fb59e,_0x32bafa){var _0x1a9bb9={},_0x34c3dc={},_0x1ec89c={'count':0x0,'rows':[]};var _0x295641=_[_0x6c74('0x2f')](db['Setting'][_0x6c74('0x30')],function(_0x2566ef){return{'name':_0x2566ef[_0x6c74('0x31')],'type':_0x2566ef['type'][_0x6c74('0x32')]};});_0x34c3dc[_0x6c74('0x33')]=_[_0x6c74('0x2f')](_0x295641,_0x6c74('0x2c'));_0x34c3dc[_0x6c74('0x34')]=_[_0x6c74('0x35')](_0x4fb59e[_0x6c74('0x34')]);_0x34c3dc[_0x6c74('0x36')]=_[_0x6c74('0x37')](_0x34c3dc[_0x6c74('0x33')],_0x34c3dc[_0x6c74('0x34')]);_0x1a9bb9['attributes']=_[_0x6c74('0x37')](_0x34c3dc['model'],qs['fields'](_0x4fb59e[_0x6c74('0x34')][_0x6c74('0x38')]));_0x1a9bb9[_0x6c74('0x39')]=_0x1a9bb9[_0x6c74('0x39')][_0x6c74('0x3a')]?_0x1a9bb9[_0x6c74('0x39')]:_0x34c3dc[_0x6c74('0x33')];if(!_0x4fb59e[_0x6c74('0x34')][_0x6c74('0x3b')](_0x6c74('0x3c'))){_0x1a9bb9[_0x6c74('0x26')]=qs['limit'](_0x4fb59e['query'][_0x6c74('0x26')]);_0x1a9bb9[_0x6c74('0x24')]=qs[_0x6c74('0x24')](_0x4fb59e[_0x6c74('0x34')][_0x6c74('0x24')]);}_0x1a9bb9[_0x6c74('0x3d')]=qs[_0x6c74('0x3e')](_0x4fb59e[_0x6c74('0x34')]['sort']);_0x1a9bb9[_0x6c74('0x3f')]=qs[_0x6c74('0x36')](_[_0x6c74('0x40')](_0x4fb59e[_0x6c74('0x34')],_0x34c3dc[_0x6c74('0x36')]),_0x295641);if(_0x4fb59e['query'][_0x6c74('0x41')]){_0x1a9bb9[_0x6c74('0x3f')]=_[_0x6c74('0x42')](_0x1a9bb9[_0x6c74('0x3f')],{'$or':_[_0x6c74('0x2f')](_0x295641,function(_0x36a521){if(_0x36a521[_0x6c74('0x43')]!==_0x6c74('0x44')){var _0x242772={};_0x242772[_0x36a521[_0x6c74('0x2c')]]={'$like':'%'+_0x4fb59e[_0x6c74('0x34')][_0x6c74('0x41')]+'%'};return _0x242772;}})});}_0x1a9bb9=_[_0x6c74('0x42')]({},_0x1a9bb9,_0x4fb59e[_0x6c74('0x45')]);var _0x4cedb6={'where':_0x1a9bb9[_0x6c74('0x3f')]};return db['Setting'][_0x6c74('0x27')](_0x4cedb6)[_0x6c74('0x16')](function(_0x5939fa){_0x1ec89c[_0x6c74('0x27')]=_0x5939fa;if(_0x4fb59e[_0x6c74('0x34')]['includeAll']){_0x1a9bb9[_0x6c74('0x46')]=[{'all':!![]}];}return db[_0x6c74('0x47')][_0x6c74('0x48')](_0x1a9bb9);})[_0x6c74('0x16')](function(_0x4c3280){_0x1ec89c['rows']=_0x4c3280;return _0x1ec89c;})['then'](respondWithFilteredResult(_0x32bafa,_0x1a9bb9))[_0x6c74('0x20')](handleError(_0x32bafa,null));};exports[_0x6c74('0x49')]=function(_0x10f9f0,_0x8569d3){var _0x5d46f4={'raw':![],'where':{'id':_0x10f9f0[_0x6c74('0x4a')]['id']}},_0x204d7d={};_0x204d7d[_0x6c74('0x33')]=_['keys'](db[_0x6c74('0x47')][_0x6c74('0x30')]);_0x204d7d[_0x6c74('0x34')]=_[_0x6c74('0x35')](_0x10f9f0['query']);_0x204d7d[_0x6c74('0x36')]=_[_0x6c74('0x37')](_0x204d7d[_0x6c74('0x33')],_0x204d7d['query']);_0x5d46f4[_0x6c74('0x39')]=_[_0x6c74('0x37')](_0x204d7d['model'],qs['fields'](_0x10f9f0[_0x6c74('0x34')][_0x6c74('0x38')]));_0x5d46f4['attributes']=_0x5d46f4[_0x6c74('0x39')][_0x6c74('0x3a')]?_0x5d46f4['attributes']:_0x204d7d['model'];if(_0x10f9f0[_0x6c74('0x34')]['includeAll']){_0x5d46f4[_0x6c74('0x46')]=[{'all':!![]}];}_0x5d46f4=_[_0x6c74('0x42')]({},_0x5d46f4,_0x10f9f0[_0x6c74('0x45')]);return db[_0x6c74('0x47')][_0x6c74('0x4b')](_0x5d46f4)[_0x6c74('0x16')](handleEntityNotFound(_0x8569d3,null))[_0x6c74('0x16')](respondWithResult(_0x8569d3,null))[_0x6c74('0x20')](handleError(_0x8569d3,null));};exports[_0x6c74('0x4c')]=function(_0x4f9756,_0x214330){if(_0x4f9756['body']['id']){delete _0x4f9756[_0x6c74('0x4d')]['id'];}return db[_0x6c74('0x47')]['find']({'where':{'id':_0x4f9756[_0x6c74('0x4a')]['id']}})[_0x6c74('0x16')](handleEntityNotFound(_0x214330,null))[_0x6c74('0x16')](saveUpdates(_0x4f9756[_0x6c74('0x4d')],null))[_0x6c74('0x16')](respondWithResult(_0x214330,null))[_0x6c74('0x20')](handleError(_0x214330,null));};exports[_0x6c74('0x4e')]=function(_0x50226e,_0x485979,_0x3fee96){if(_0x50226e[_0x6c74('0x4f')]&&_0x50226e[_0x6c74('0x4f')][_0x6c74('0x50')]){_0x50226e[_0x6c74('0x4d')]['logo']=_0x50226e[_0x6c74('0x4f')][_0x6c74('0x50')];}return db['Setting'][_0x6c74('0x4b')]({'where':{'id':_0x50226e['params']['id']}})[_0x6c74('0x16')](handleEntityNotFound(_0x485979,null))[_0x6c74('0x16')](saveUpdates(_0x50226e[_0x6c74('0x4d')],null))[_0x6c74('0x16')](respondWithResult(_0x485979,null))[_0x6c74('0x20')](handleError(_0x485979,null));};exports[_0x6c74('0x51')]=function(_0x461573,_0x443993,_0xbb4994){if(_0x461573['file']&&_0x461573['file'][_0x6c74('0x50')]){_0x461573[_0x6c74('0x4d')][_0x6c74('0x52')]=_0x461573[_0x6c74('0x4f')][_0x6c74('0x50')];}return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0x461573[_0x6c74('0x4a')]['id']}})[_0x6c74('0x16')](handleEntityNotFound(_0x443993,null))[_0x6c74('0x16')](saveUpdates(_0x461573[_0x6c74('0x4d')],null))[_0x6c74('0x16')](respondWithResult(_0x443993,null))[_0x6c74('0x20')](handleError(_0x443993,null));};var utilLicense=require(_0x6c74('0x53'));exports[_0x6c74('0x54')]=function(_0xd9d237,_0x29c241,_0x4064c9){var _0x188494=_0x6c74('0x55');var _0x48b28b={'custom':![]};return utilLicense['getLicense']()[_0x6c74('0x16')](function(_0x24a696){if(_0x24a696){_0x48b28b=_0x24a696;}return db['Setting'][_0x6c74('0x4b')]({'where':{'id':_0xd9d237['params']['id']},'attributes':[_0x6c74('0x56'),_0x6c74('0x52'),_0x6c74('0x57'),_0x6c74('0x58'),_0x6c74('0x59'),'defaultLoginLogo','defaultPreferred',_0x6c74('0x5a')],'raw':!![]});})[_0x6c74('0x16')](handleEntityNotFound(_0x29c241,null))['then'](function(_0x16b0b0){if(_0x16b0b0){var _0x30839b=_0x16b0b0[_0x6c74('0x56')]&&fs[_0x6c74('0x5b')](path[_0x6c74('0x5c')](config['root'],_0x188494,_[_0x6c74('0x5d')](_0x16b0b0[_0x6c74('0x56')])))?path[_0x6c74('0x5c')](config['root'],_0x188494,_[_0x6c74('0x5d')](_0x16b0b0[_0x6c74('0x56')])):path[_0x6c74('0x5c')](config['root'],_0x188494,_[_0x6c74('0x5d')]('default_logo.svg'));var _0x39b1fb='default'+_[_0x6c74('0x5e')](_0x6c74('0x56'));if(_0x16b0b0[_0x39b1fb]||!_0x48b28b[_0x6c74('0x5f')]){_0x30839b=path['join'](config['root'],_0x188494,_['toLower'](_0x6c74('0x60')));}if(!fs[_0x6c74('0x5b')](_0x30839b)){throw new db[(_0x6c74('0x61'))]['ValidationError'](_[_0x6c74('0x5e')](_0x6c74('0x56'))+'\x20not\x20found');}return _0x29c241[_0x6c74('0x62')](_0x30839b);}})[_0x6c74('0x20')](handleError(_0x29c241,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0xd5cd1,_0x34d843,_0x3ed124){var _0x65ab0f=_0x6c74('0x55');var _0x1a8cd6={'custom':![]};return utilLicense[_0x6c74('0x63')]()[_0x6c74('0x16')](function(_0x17bd2c){if(_0x17bd2c){_0x1a8cd6=_0x17bd2c;}return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0xd5cd1['params']['id']},'attributes':[_0x6c74('0x56'),_0x6c74('0x52'),'preferred',_0x6c74('0x58'),_0x6c74('0x59'),_0x6c74('0x64'),_0x6c74('0x65'),'defaultFavicon'],'raw':!![]});})[_0x6c74('0x16')](handleEntityNotFound(_0x34d843,null))[_0x6c74('0x16')](function(_0x5cdceb){if(_0x5cdceb){var _0x2939aa=_0x5cdceb['loginLogo']&&fs[_0x6c74('0x5b')](path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x65ab0f,_[_0x6c74('0x5d')](_0x5cdceb[_0x6c74('0x52')])))?path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x65ab0f,_['toLower'](_0x5cdceb['loginLogo'])):path[_0x6c74('0x5c')](config['root'],_0x65ab0f,_['toLower'](_0x6c74('0x67')));var _0x4755c0=_0x6c74('0x68')+_[_0x6c74('0x5e')](_0x6c74('0x52'));if(_0x5cdceb[_0x4755c0]||!_0x1a8cd6[_0x6c74('0x5f')]){_0x2939aa=path[_0x6c74('0x5c')](config['root'],_0x65ab0f,_[_0x6c74('0x5d')](_0x6c74('0x67')));}if(!fs[_0x6c74('0x5b')](_0x2939aa)){throw new db[(_0x6c74('0x61'))]['ValidationError'](_[_0x6c74('0x5e')](_0x6c74('0x52'))+'\x20not\x20found');}return _0x34d843['download'](_0x2939aa);}})[_0x6c74('0x20')](handleError(_0x34d843,null));};exports[_0x6c74('0x69')]=function(_0x40999b,_0x5b7650){return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0x40999b[_0x6c74('0x4a')]['id']},'attributes':[_0x6c74('0x6a')]})[_0x6c74('0x16')](respondWithResult(_0x5b7650,null))[_0x6c74('0x20')](handleError(_0x5b7650,null));};exports['addPreferred']=function(_0x3569b8,_0x3c4c19,_0x5ad511){if(_0x3569b8['file']&&_0x3569b8['file']['filename']){_0x3569b8[_0x6c74('0x4d')]['preferred']=_0x3569b8[_0x6c74('0x4f')]['filename'];}return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0x3569b8['params']['id']}})[_0x6c74('0x16')](handleEntityNotFound(_0x3c4c19,null))[_0x6c74('0x16')](saveUpdates(_0x3569b8['body'],null))[_0x6c74('0x16')](respondWithResult(_0x3c4c19,null))[_0x6c74('0x20')](handleError(_0x3c4c19,null));};var utilLicense=require(_0x6c74('0x53'));exports['getPreferred']=function(_0x5f0341,_0x47bd0b,_0x36bba7){var _0x4fc844=_0x6c74('0x55');var _0x38730c={'custom':![]};return utilLicense[_0x6c74('0x63')]()['then'](function(_0x11ea3f){if(_0x11ea3f){_0x38730c=_0x11ea3f;}return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0x5f0341[_0x6c74('0x4a')]['id']},'attributes':[_0x6c74('0x56'),'loginLogo',_0x6c74('0x57'),'favicon','defaultLogo',_0x6c74('0x64'),_0x6c74('0x65'),_0x6c74('0x5a')],'raw':!![]});})[_0x6c74('0x16')](handleEntityNotFound(_0x47bd0b,null))[_0x6c74('0x16')](function(_0x221142){if(_0x221142){var _0xd173f6=_0x221142[_0x6c74('0x57')]&&fs[_0x6c74('0x5b')](path['join'](config[_0x6c74('0x66')],_0x4fc844,_[_0x6c74('0x5d')](_0x221142[_0x6c74('0x57')])))?path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x4fc844,_['toLower'](_0x221142[_0x6c74('0x57')])):path['join'](config[_0x6c74('0x66')],_0x4fc844,_[_0x6c74('0x5d')](_0x6c74('0x6b')));var _0x3b0bc0=_0x6c74('0x68')+_[_0x6c74('0x5e')](_0x6c74('0x57'));if(_0x221142[_0x3b0bc0]||!_0x38730c[_0x6c74('0x5f')]||!_0x38730c[_0x6c74('0x57')]){_0xd173f6=path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x4fc844,_[_0x6c74('0x5d')](_0x6c74('0x6b')));}if(!fs[_0x6c74('0x5b')](_0xd173f6)){throw new db['Sequelize'][(_0x6c74('0x6c'))](_[_0x6c74('0x5e')](_0x6c74('0x57'))+_0x6c74('0x6d'));}return _0x47bd0b[_0x6c74('0x62')](_0xd173f6);}})[_0x6c74('0x20')](handleError(_0x47bd0b,null));};exports[_0x6c74('0x6e')]=function(_0x2422a2,_0x10fed6,_0x5340ce){if(_0x2422a2[_0x6c74('0x4f')]&&_0x2422a2[_0x6c74('0x4f')][_0x6c74('0x50')]){_0x2422a2[_0x6c74('0x4d')]['favicon']=_0x2422a2[_0x6c74('0x4f')][_0x6c74('0x50')];}return db[_0x6c74('0x47')][_0x6c74('0x4b')]({'where':{'id':_0x2422a2[_0x6c74('0x4a')]['id']}})['then'](handleEntityNotFound(_0x10fed6,null))[_0x6c74('0x16')](saveUpdates(_0x2422a2[_0x6c74('0x4d')],null))[_0x6c74('0x16')](respondWithResult(_0x10fed6,null))[_0x6c74('0x20')](handleError(_0x10fed6,null));};var utilLicense=require(_0x6c74('0x53'));exports[_0x6c74('0x6f')]=function(_0x8cfcc1,_0x109005,_0x2b6325){var _0x5d4367=_0x6c74('0x55');var _0x52daaa={'custom':![]};return utilLicense[_0x6c74('0x63')]()['then'](function(_0x4e9527){if(_0x4e9527){_0x52daaa=_0x4e9527;}return db['Setting']['find']({'where':{'id':_0x8cfcc1['params']['id']},'attributes':[_0x6c74('0x56'),_0x6c74('0x52'),'preferred',_0x6c74('0x58'),_0x6c74('0x59'),_0x6c74('0x64'),'defaultPreferred',_0x6c74('0x5a')],'raw':!![]});})[_0x6c74('0x16')](handleEntityNotFound(_0x109005,null))[_0x6c74('0x16')](function(_0x30a2f2){if(_0x30a2f2){var _0x141ecf=_0x30a2f2[_0x6c74('0x58')]&&fs[_0x6c74('0x5b')](path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x5d4367,_['toLower'](_0x30a2f2[_0x6c74('0x58')])))?path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x5d4367,_[_0x6c74('0x5d')](_0x30a2f2[_0x6c74('0x58')])):path['join'](config[_0x6c74('0x66')],_0x5d4367,_[_0x6c74('0x5d')]('default_favicon.ico'));var _0x15d15f=_0x6c74('0x68')+_[_0x6c74('0x5e')](_0x6c74('0x58'));if(_0x30a2f2[_0x15d15f]||!_0x52daaa[_0x6c74('0x5f')]){_0x141ecf=path[_0x6c74('0x5c')](config[_0x6c74('0x66')],_0x5d4367,_[_0x6c74('0x5d')](_0x6c74('0x70')));}if(!fs[_0x6c74('0x5b')](_0x141ecf)){throw new db[(_0x6c74('0x61'))]['ValidationError'](_[_0x6c74('0x5e')](_0x6c74('0x58'))+_0x6c74('0x6d'));}return _0x109005[_0x6c74('0x62')](_0x141ecf);}})[_0x6c74('0x20')](handleError(_0x109005,null));};exports['getDate']=function(_0xe56999,_0x35ccf8){var _0x50de61={'offset':moment()[_0x6c74('0x71')]()};_0x50de61[_0x6c74('0x72')]=moment()[_0x6c74('0x71')](_0x50de61['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x35ccf8[_0x6c74('0x21')](0xc8)[_0x6c74('0x2d')](_0x50de61);};
\ No newline at end of file
+var _0xcdc8=['index','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','Setting','rows','show','params','find','catch','body','addLogo','file','filename','addLogoLogin','loginLogo','getLogo','getLicense','logo','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','server/files/images/logos','default_loginLogo.svg','default','upperFirst','custom','gdpr','securePassword','preferred','getPreferred','default_preferred.png','addFavicon','default_favicon.ico','getDate','utcOffset','now','format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Setting,\x20%s,\x20%s','message','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','stack','name','send'];(function(_0x4ec83e,_0x374b31){var _0xf75486=function(_0x3f362f){while(--_0x3f362f){_0x4ec83e['push'](_0x4ec83e['shift']());}};_0xf75486(++_0x374b31);}(_0xcdc8,0x1a9));var _0x8cdc=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xcdc8[_0x543084];return _0x306a57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cdc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cdc('0x1'));var rp=require('request-promise');var moment=require(_0x8cdc('0x2'));var BPromise=require(_0x8cdc('0x3'));var Mustache=require(_0x8cdc('0x4'));var util=require('util');var path=require(_0x8cdc('0x5'));var sox=require(_0x8cdc('0x6'));var csv=require(_0x8cdc('0x7'));var ejs=require(_0x8cdc('0x8'));var fs=require('fs');var fs_extra=require(_0x8cdc('0x9'));var _=require(_0x8cdc('0xa'));var squel=require('squel');var crypto=require(_0x8cdc('0xb'));var jsforce=require(_0x8cdc('0xc'));var deskjs=require(_0x8cdc('0xd'));var toCsv=require(_0x8cdc('0x7'));var querystring=require('querystring');var Papa=require(_0x8cdc('0xe'));var Redis=require(_0x8cdc('0xf'));var authService=require(_0x8cdc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8cdc('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8cdc('0x12'));var utils=require(_0x8cdc('0x13'));var config=require(_0x8cdc('0x14'));var licenseUtil=require(_0x8cdc('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8cdc('0x16'));var client=jayson['client'][_0x8cdc('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x28d82e,_0x41bc33,_0x3b8f37,_0x535c38){return new BPromise(function(_0x59261b,_0x484bc2){var _0x233295=_0x535c38||client;return _0x233295[_0x8cdc('0x18')](_0x28d82e,_0x3b8f37)[_0x8cdc('0x19')](function(_0x251f52){logger[_0x8cdc('0x1a')]('Setting,\x20%s,\x20%s',_0x41bc33,'request\x20sent');logger[_0x8cdc('0x1b')](_0x8cdc('0x1c'),_0x41bc33,_0x8cdc('0x1d'),JSON[_0x8cdc('0x1e')](_0x251f52));if(_0x251f52[_0x8cdc('0x1f')]){if(_0x251f52[_0x8cdc('0x1f')][_0x8cdc('0x20')]===0x1f4){logger['error'](_0x8cdc('0x21'),_0x41bc33,_0x251f52[_0x8cdc('0x1f')]['message']);return _0x484bc2(_0x251f52[_0x8cdc('0x1f')]['message']);}logger['error']('Setting,\x20%s,\x20%s',_0x41bc33,_0x251f52[_0x8cdc('0x1f')][_0x8cdc('0x22')]);return _0x59261b(_0x251f52[_0x8cdc('0x1f')]['message']);}else{logger[_0x8cdc('0x1a')](_0x8cdc('0x21'),_0x41bc33,_0x8cdc('0x1d'));_0x59261b(_0x251f52['result']['message']);}})['catch'](function(_0x356a56){logger[_0x8cdc('0x1f')]('Setting,\x20%s,\x20%s',_0x41bc33,_0x356a56);_0x484bc2(_0x356a56);});});}function respondWithStatusCode(_0xe4e79c,_0x36a3bf){_0x36a3bf=_0x36a3bf||0xcc;return function(_0x43ed33){if(_0x43ed33){return _0xe4e79c[_0x8cdc('0x23')](_0x36a3bf);}return _0xe4e79c[_0x8cdc('0x24')](_0x36a3bf)[_0x8cdc('0x25')]();};}function respondWithResult(_0x4ce0b9,_0x3de1c8){_0x3de1c8=_0x3de1c8||0xc8;return function(_0x2c8664){if(_0x2c8664){return _0x4ce0b9[_0x8cdc('0x24')](_0x3de1c8)[_0x8cdc('0x26')](_0x2c8664);}};}function respondWithFilteredResult(_0x1c413d,_0x380764){return function(_0x534358){if(_0x534358){var _0x2b750c=typeof _0x380764[_0x8cdc('0x27')]===_0x8cdc('0x28')&&typeof _0x380764[_0x8cdc('0x29')]===_0x8cdc('0x28');var _0x43f28f=_0x534358['count'];var _0x308109=_0x2b750c?0x0:_0x380764[_0x8cdc('0x27')];var _0x4f896c=_0x2b750c?_0x534358[_0x8cdc('0x2a')]:_0x380764[_0x8cdc('0x27')]+_0x380764[_0x8cdc('0x29')];var _0x2d97e9;if(_0x4f896c>=_0x43f28f){_0x4f896c=_0x43f28f;_0x2d97e9=0xc8;}else{_0x2d97e9=0xce;}_0x1c413d[_0x8cdc('0x24')](_0x2d97e9);return _0x1c413d[_0x8cdc('0x2b')]('Content-Range',_0x308109+'-'+_0x4f896c+'/'+_0x43f28f)[_0x8cdc('0x26')](_0x534358);}return null;};}function patchUpdates(_0x5e2fbc){return function(_0x31d767){try{jsonpatch[_0x8cdc('0x2c')](_0x31d767,_0x5e2fbc,!![]);}catch(_0x2b5977){return BPromise[_0x8cdc('0x2d')](_0x2b5977);}return _0x31d767['save']();};}function saveUpdates(_0x18930c,_0x1c2723){return function(_0x3cf315){if(_0x3cf315){return _0x3cf315[_0x8cdc('0x2e')](_0x18930c)[_0x8cdc('0x19')](function(_0x2036a9){return _0x2036a9;});}return null;};}function removeEntity(_0x8a8576,_0x205d38){return function(_0x362234){if(_0x362234){return _0x362234[_0x8cdc('0x2f')]()[_0x8cdc('0x19')](function(){_0x8a8576[_0x8cdc('0x24')](0xcc)[_0x8cdc('0x25')]();});}};}function handleEntityNotFound(_0x486a28,_0x382f2b){return function(_0x570402){if(!_0x570402){_0x486a28[_0x8cdc('0x23')](0x194);}return _0x570402;};}function handleError(_0x23d057,_0x4ad351){_0x4ad351=_0x4ad351||0x1f4;return function(_0x5e0917){logger['error'](_0x5e0917[_0x8cdc('0x30')]);if(_0x5e0917['name']){delete _0x5e0917[_0x8cdc('0x31')];}_0x23d057['status'](_0x4ad351)[_0x8cdc('0x32')](_0x5e0917);};}exports[_0x8cdc('0x33')]=function(_0xeb1f3f,_0x2e1249){var _0x48a10e={},_0x2b9028={},_0x8a2a8e={'count':0x0,'rows':[]};var _0x37368f=_['map'](db['Setting']['rawAttributes'],function(_0x195a8d){return{'name':_0x195a8d[_0x8cdc('0x34')],'type':_0x195a8d[_0x8cdc('0x35')][_0x8cdc('0x36')]};});_0x2b9028[_0x8cdc('0x37')]=_[_0x8cdc('0x38')](_0x37368f,_0x8cdc('0x31'));_0x2b9028['query']=_[_0x8cdc('0x39')](_0xeb1f3f[_0x8cdc('0x3a')]);_0x2b9028[_0x8cdc('0x3b')]=_[_0x8cdc('0x3c')](_0x2b9028['model'],_0x2b9028[_0x8cdc('0x3a')]);_0x48a10e[_0x8cdc('0x3d')]=_[_0x8cdc('0x3c')](_0x2b9028[_0x8cdc('0x37')],qs['fields'](_0xeb1f3f['query'][_0x8cdc('0x3e')]));_0x48a10e['attributes']=_0x48a10e[_0x8cdc('0x3d')][_0x8cdc('0x3f')]?_0x48a10e[_0x8cdc('0x3d')]:_0x2b9028[_0x8cdc('0x37')];if(!_0xeb1f3f[_0x8cdc('0x3a')][_0x8cdc('0x40')]('nolimit')){_0x48a10e[_0x8cdc('0x29')]=qs['limit'](_0xeb1f3f['query'][_0x8cdc('0x29')]);_0x48a10e[_0x8cdc('0x27')]=qs[_0x8cdc('0x27')](_0xeb1f3f['query']['offset']);}_0x48a10e[_0x8cdc('0x41')]=qs['sort'](_0xeb1f3f[_0x8cdc('0x3a')][_0x8cdc('0x42')]);_0x48a10e[_0x8cdc('0x43')]=qs['filters'](_['pick'](_0xeb1f3f['query'],_0x2b9028[_0x8cdc('0x3b')]),_0x37368f);if(_0xeb1f3f['query']['filter']){_0x48a10e['where']=_['merge'](_0x48a10e['where'],{'$or':_[_0x8cdc('0x38')](_0x37368f,function(_0x22c88b){if(_0x22c88b[_0x8cdc('0x35')]!==_0x8cdc('0x44')){var _0x44af71={};_0x44af71[_0x22c88b[_0x8cdc('0x31')]]={'$like':'%'+_0xeb1f3f['query'][_0x8cdc('0x45')]+'%'};return _0x44af71;}})});}_0x48a10e=_[_0x8cdc('0x46')]({},_0x48a10e,_0xeb1f3f[_0x8cdc('0x47')]);var _0x350b40={'where':_0x48a10e[_0x8cdc('0x43')]};return db['Setting'][_0x8cdc('0x2a')](_0x350b40)['then'](function(_0x41b6b9){_0x8a2a8e[_0x8cdc('0x2a')]=_0x41b6b9;if(_0xeb1f3f[_0x8cdc('0x3a')][_0x8cdc('0x48')]){_0x48a10e[_0x8cdc('0x49')]=[{'all':!![]}];}return db[_0x8cdc('0x4a')]['findAll'](_0x48a10e);})[_0x8cdc('0x19')](function(_0x46f0a1){_0x8a2a8e[_0x8cdc('0x4b')]=_0x46f0a1;return _0x8a2a8e;})[_0x8cdc('0x19')](respondWithFilteredResult(_0x2e1249,_0x48a10e))['catch'](handleError(_0x2e1249,null));};exports[_0x8cdc('0x4c')]=function(_0x2560e8,_0x5ecdc5){var _0x46fc14={'raw':![],'where':{'id':_0x2560e8[_0x8cdc('0x4d')]['id']}},_0x4b9a97={};_0x4b9a97[_0x8cdc('0x37')]=_[_0x8cdc('0x39')](db[_0x8cdc('0x4a')]['rawAttributes']);_0x4b9a97[_0x8cdc('0x3a')]=_['keys'](_0x2560e8[_0x8cdc('0x3a')]);_0x4b9a97[_0x8cdc('0x3b')]=_[_0x8cdc('0x3c')](_0x4b9a97[_0x8cdc('0x37')],_0x4b9a97['query']);_0x46fc14[_0x8cdc('0x3d')]=_[_0x8cdc('0x3c')](_0x4b9a97['model'],qs[_0x8cdc('0x3e')](_0x2560e8[_0x8cdc('0x3a')][_0x8cdc('0x3e')]));_0x46fc14['attributes']=_0x46fc14['attributes'][_0x8cdc('0x3f')]?_0x46fc14[_0x8cdc('0x3d')]:_0x4b9a97[_0x8cdc('0x37')];if(_0x2560e8['query'][_0x8cdc('0x48')]){_0x46fc14[_0x8cdc('0x49')]=[{'all':!![]}];}_0x46fc14=_[_0x8cdc('0x46')]({},_0x46fc14,_0x2560e8[_0x8cdc('0x47')]);return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')](_0x46fc14)[_0x8cdc('0x19')](handleEntityNotFound(_0x5ecdc5,null))[_0x8cdc('0x19')](respondWithResult(_0x5ecdc5,null))[_0x8cdc('0x4f')](handleError(_0x5ecdc5,null));};exports['update']=function(_0xa3b6a3,_0x36641a){if(_0xa3b6a3[_0x8cdc('0x50')]['id']){delete _0xa3b6a3[_0x8cdc('0x50')]['id'];}return db[_0x8cdc('0x4a')]['find']({'where':{'id':_0xa3b6a3[_0x8cdc('0x4d')]['id']}})[_0x8cdc('0x19')](handleEntityNotFound(_0x36641a,null))[_0x8cdc('0x19')](saveUpdates(_0xa3b6a3[_0x8cdc('0x50')],null))[_0x8cdc('0x19')](respondWithResult(_0x36641a,null))[_0x8cdc('0x4f')](handleError(_0x36641a,null));};exports[_0x8cdc('0x51')]=function(_0x19e9d1,_0x551d4b,_0x11b8a6){if(_0x19e9d1[_0x8cdc('0x52')]&&_0x19e9d1[_0x8cdc('0x52')]['filename']){_0x19e9d1[_0x8cdc('0x50')]['logo']=_0x19e9d1[_0x8cdc('0x52')][_0x8cdc('0x53')];}return db['Setting'][_0x8cdc('0x4e')]({'where':{'id':_0x19e9d1['params']['id']}})[_0x8cdc('0x19')](handleEntityNotFound(_0x551d4b,null))[_0x8cdc('0x19')](saveUpdates(_0x19e9d1[_0x8cdc('0x50')],null))[_0x8cdc('0x19')](respondWithResult(_0x551d4b,null))[_0x8cdc('0x4f')](handleError(_0x551d4b,null));};exports[_0x8cdc('0x54')]=function(_0x206186,_0x319030,_0x2a489f){if(_0x206186[_0x8cdc('0x52')]&&_0x206186[_0x8cdc('0x52')][_0x8cdc('0x53')]){_0x206186[_0x8cdc('0x50')][_0x8cdc('0x55')]=_0x206186[_0x8cdc('0x52')]['filename'];}return db[_0x8cdc('0x4a')]['find']({'where':{'id':_0x206186[_0x8cdc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x319030,null))[_0x8cdc('0x19')](saveUpdates(_0x206186['body'],null))[_0x8cdc('0x19')](respondWithResult(_0x319030,null))[_0x8cdc('0x4f')](handleError(_0x319030,null));};var utilLicense=require(_0x8cdc('0x15'));exports[_0x8cdc('0x56')]=function(_0x71d508,_0x2c0c22,_0x8dd375){var _0x31ef61='server/files/images/logos';var _0x336437={'custom':![]};return utilLicense[_0x8cdc('0x57')]()[_0x8cdc('0x19')](function(_0x9e3497){if(_0x9e3497){_0x336437=_0x9e3497;}return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')]({'where':{'id':_0x71d508[_0x8cdc('0x4d')]['id']},'attributes':[_0x8cdc('0x58'),'loginLogo','preferred',_0x8cdc('0x59'),_0x8cdc('0x5a'),_0x8cdc('0x5b'),_0x8cdc('0x5c'),_0x8cdc('0x5d')],'raw':!![]});})[_0x8cdc('0x19')](handleEntityNotFound(_0x2c0c22,null))[_0x8cdc('0x19')](function(_0x405b4d){if(_0x405b4d){var _0x4d54f3=_0x405b4d[_0x8cdc('0x58')]&&fs[_0x8cdc('0x5e')](path[_0x8cdc('0x5f')](config['root'],_0x31ef61,_['toLower'](_0x405b4d['logo'])))?path[_0x8cdc('0x5f')](config['root'],_0x31ef61,_[_0x8cdc('0x60')](_0x405b4d['logo'])):path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x31ef61,_['toLower']('default_logo.svg'));var _0x46930a='default'+_['upperFirst'](_0x8cdc('0x58'));if(_0x405b4d[_0x46930a]||!_0x336437['custom']){_0x4d54f3=path['join'](config[_0x8cdc('0x61')],_0x31ef61,_[_0x8cdc('0x60')]('default_logo.svg'));}if(!fs['existsSync'](_0x4d54f3)){throw new db[(_0x8cdc('0x62'))][(_0x8cdc('0x63'))](_['upperFirst']('logo')+_0x8cdc('0x64'));}return _0x2c0c22[_0x8cdc('0x65')](_0x4d54f3);}})[_0x8cdc('0x4f')](handleError(_0x2c0c22,null));};var utilLicense=require('../../config/license/util');exports[_0x8cdc('0x66')]=function(_0x562724,_0x144f96,_0x18b419){var _0x498ffb=_0x8cdc('0x67');var _0x415f88={'custom':![]};return utilLicense['getLicense']()[_0x8cdc('0x19')](function(_0x57bbe8){if(_0x57bbe8){_0x415f88=_0x57bbe8;}return db['Setting'][_0x8cdc('0x4e')]({'where':{'id':_0x562724[_0x8cdc('0x4d')]['id']},'attributes':['logo',_0x8cdc('0x55'),'preferred',_0x8cdc('0x59'),_0x8cdc('0x5a'),_0x8cdc('0x5b'),'defaultPreferred',_0x8cdc('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x144f96,null))[_0x8cdc('0x19')](function(_0x1c8fb0){if(_0x1c8fb0){var _0x46a3cc=_0x1c8fb0[_0x8cdc('0x55')]&&fs[_0x8cdc('0x5e')](path[_0x8cdc('0x5f')](config['root'],_0x498ffb,_[_0x8cdc('0x60')](_0x1c8fb0['loginLogo'])))?path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x498ffb,_[_0x8cdc('0x60')](_0x1c8fb0[_0x8cdc('0x55')])):path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x498ffb,_[_0x8cdc('0x60')](_0x8cdc('0x68')));var _0x66ffc9=_0x8cdc('0x69')+_[_0x8cdc('0x6a')](_0x8cdc('0x55'));if(_0x1c8fb0[_0x66ffc9]||!_0x415f88[_0x8cdc('0x6b')]){_0x46a3cc=path['join'](config[_0x8cdc('0x61')],_0x498ffb,_['toLower'](_0x8cdc('0x68')));}if(!fs[_0x8cdc('0x5e')](_0x46a3cc)){throw new db[(_0x8cdc('0x62'))][(_0x8cdc('0x63'))](_['upperFirst'](_0x8cdc('0x55'))+'\x20not\x20found');}return _0x144f96[_0x8cdc('0x65')](_0x46a3cc);}})[_0x8cdc('0x4f')](handleError(_0x144f96,null));};exports[_0x8cdc('0x6c')]=function(_0x1275c4,_0x807eb3){return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')]({'where':{'id':_0x1275c4[_0x8cdc('0x4d')]['id']},'attributes':[_0x8cdc('0x6d')]})[_0x8cdc('0x19')](respondWithResult(_0x807eb3,null))['catch'](handleError(_0x807eb3,null));};exports['addPreferred']=function(_0x15cb6a,_0x52cae3,_0x33f5df){if(_0x15cb6a[_0x8cdc('0x52')]&&_0x15cb6a[_0x8cdc('0x52')][_0x8cdc('0x53')]){_0x15cb6a[_0x8cdc('0x50')][_0x8cdc('0x6e')]=_0x15cb6a[_0x8cdc('0x52')][_0x8cdc('0x53')];}return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')]({'where':{'id':_0x15cb6a['params']['id']}})[_0x8cdc('0x19')](handleEntityNotFound(_0x52cae3,null))['then'](saveUpdates(_0x15cb6a['body'],null))[_0x8cdc('0x19')](respondWithResult(_0x52cae3,null))[_0x8cdc('0x4f')](handleError(_0x52cae3,null));};var utilLicense=require(_0x8cdc('0x15'));exports[_0x8cdc('0x6f')]=function(_0x18b15a,_0x2daad8,_0x180c92){var _0x10028c=_0x8cdc('0x67');var _0xa5a9={'custom':![]};return utilLicense[_0x8cdc('0x57')]()[_0x8cdc('0x19')](function(_0x244a89){if(_0x244a89){_0xa5a9=_0x244a89;}return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')]({'where':{'id':_0x18b15a[_0x8cdc('0x4d')]['id']},'attributes':['logo','loginLogo',_0x8cdc('0x6e'),_0x8cdc('0x59'),'defaultLogo',_0x8cdc('0x5b'),_0x8cdc('0x5c'),_0x8cdc('0x5d')],'raw':!![]});})['then'](handleEntityNotFound(_0x2daad8,null))[_0x8cdc('0x19')](function(_0x63ebd9){if(_0x63ebd9){var _0x4263f8=_0x63ebd9[_0x8cdc('0x6e')]&&fs[_0x8cdc('0x5e')](path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x10028c,_[_0x8cdc('0x60')](_0x63ebd9[_0x8cdc('0x6e')])))?path['join'](config[_0x8cdc('0x61')],_0x10028c,_[_0x8cdc('0x60')](_0x63ebd9[_0x8cdc('0x6e')])):path['join'](config[_0x8cdc('0x61')],_0x10028c,_[_0x8cdc('0x60')](_0x8cdc('0x70')));var _0x2a7519=_0x8cdc('0x69')+_['upperFirst'](_0x8cdc('0x6e'));if(_0x63ebd9[_0x2a7519]||!_0xa5a9[_0x8cdc('0x6b')]||!_0xa5a9[_0x8cdc('0x6e')]){_0x4263f8=path['join'](config[_0x8cdc('0x61')],_0x10028c,_['toLower'](_0x8cdc('0x70')));}if(!fs[_0x8cdc('0x5e')](_0x4263f8)){throw new db[(_0x8cdc('0x62'))]['ValidationError'](_['upperFirst'](_0x8cdc('0x6e'))+_0x8cdc('0x64'));}return _0x2daad8['download'](_0x4263f8);}})['catch'](handleError(_0x2daad8,null));};exports[_0x8cdc('0x71')]=function(_0x1ff696,_0x5678cb,_0x53aa81){if(_0x1ff696[_0x8cdc('0x52')]&&_0x1ff696[_0x8cdc('0x52')][_0x8cdc('0x53')]){_0x1ff696[_0x8cdc('0x50')]['favicon']=_0x1ff696['file'][_0x8cdc('0x53')];}return db[_0x8cdc('0x4a')][_0x8cdc('0x4e')]({'where':{'id':_0x1ff696['params']['id']}})[_0x8cdc('0x19')](handleEntityNotFound(_0x5678cb,null))['then'](saveUpdates(_0x1ff696[_0x8cdc('0x50')],null))['then'](respondWithResult(_0x5678cb,null))[_0x8cdc('0x4f')](handleError(_0x5678cb,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x540bac,_0x4ab752,_0x1e4294){var _0x1569dd=_0x8cdc('0x67');var _0xb90c2e={'custom':![]};return utilLicense[_0x8cdc('0x57')]()[_0x8cdc('0x19')](function(_0x2a36b3){if(_0x2a36b3){_0xb90c2e=_0x2a36b3;}return db['Setting'][_0x8cdc('0x4e')]({'where':{'id':_0x540bac[_0x8cdc('0x4d')]['id']},'attributes':[_0x8cdc('0x58'),_0x8cdc('0x55'),_0x8cdc('0x6e'),_0x8cdc('0x59'),_0x8cdc('0x5a'),_0x8cdc('0x5b'),_0x8cdc('0x5c'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4ab752,null))[_0x8cdc('0x19')](function(_0x113914){if(_0x113914){var _0x2be093=_0x113914['favicon']&&fs['existsSync'](path['join'](config[_0x8cdc('0x61')],_0x1569dd,_[_0x8cdc('0x60')](_0x113914[_0x8cdc('0x59')])))?path['join'](config[_0x8cdc('0x61')],_0x1569dd,_[_0x8cdc('0x60')](_0x113914[_0x8cdc('0x59')])):path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x1569dd,_[_0x8cdc('0x60')](_0x8cdc('0x72')));var _0x1b41bb=_0x8cdc('0x69')+_[_0x8cdc('0x6a')](_0x8cdc('0x59'));if(_0x113914[_0x1b41bb]||!_0xb90c2e[_0x8cdc('0x6b')]){_0x2be093=path[_0x8cdc('0x5f')](config[_0x8cdc('0x61')],_0x1569dd,_[_0x8cdc('0x60')]('default_favicon.ico'));}if(!fs[_0x8cdc('0x5e')](_0x2be093)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x8cdc('0x59'))+_0x8cdc('0x64'));}return _0x4ab752[_0x8cdc('0x65')](_0x2be093);}})[_0x8cdc('0x4f')](handleError(_0x4ab752,null));};exports[_0x8cdc('0x73')]=function(_0x37ab7d,_0x4adf70){var _0x2054d7={'offset':moment()[_0x8cdc('0x74')]()};_0x2054d7[_0x8cdc('0x75')]=moment()[_0x8cdc('0x74')](_0x2054d7[_0x8cdc('0x27')])[_0x8cdc('0x76')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x4adf70[_0x8cdc('0x24')](0xc8)[_0x8cdc('0x32')](_0x2054d7);};
\ No newline at end of file
index 0331cc4..7eeb9ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03cf517..9f3016e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e22=['request\x20sent','stringify','error','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','debug','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e22,0x6e));var _0x26e2=function(_0x129296,_0x426355){_0x129296=_0x129296-0x0;var _0x59a9a6=_0x6e22[_0x129296];return _0x59a9a6;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x26e2('0x0'));var rs=require(_0x26e2('0x1'));var fs=require('fs');var Redis=require(_0x26e2('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x26e2('0x3'))(_0x26e2('0x4'));var config=require(_0x26e2('0x5'));var jayson=require(_0x26e2('0x6'));var client=jayson[_0x26e2('0x7')][_0x26e2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24135c,_0x532725,_0x46aefe){return new BPromise(function(_0x474ed6,_0x4105e6){return client[_0x26e2('0x9')](_0x24135c,_0x46aefe)[_0x26e2('0xa')](function(_0x78075f){logger[_0x26e2('0xb')](_0x26e2('0xc'),_0x532725,'request\x20sent');logger['debug'](_0x26e2('0xd'),_0x532725,_0x26e2('0xe'),JSON[_0x26e2('0xf')](_0x78075f));if(_0x78075f[_0x26e2('0x10')]){if(_0x78075f[_0x26e2('0x10')]['code']===0x1f4){logger[_0x26e2('0x10')](_0x26e2('0xc'),_0x532725,_0x78075f[_0x26e2('0x10')][_0x26e2('0x11')]);return _0x4105e6(_0x78075f['error'][_0x26e2('0x11')]);}logger['error'](_0x26e2('0xc'),_0x532725,_0x78075f[_0x26e2('0x10')][_0x26e2('0x11')]);return _0x474ed6(_0x78075f['error'][_0x26e2('0x11')]);}else{logger[_0x26e2('0xb')](_0x26e2('0xc'),_0x532725,_0x26e2('0xe'));_0x474ed6(_0x78075f[_0x26e2('0x12')]['message']);}})[_0x26e2('0x13')](function(_0x3ceb38){logger['error']('Setting,\x20%s,\x20%s',_0x532725,_0x3ceb38);_0x4105e6(_0x3ceb38);});});}exports[_0x26e2('0x14')]=function(_0x5b733c){var _0x4f9373=this;return new Promise(function(_0x334880,_0x511b56){return db[_0x26e2('0x15')][_0x26e2('0x16')]({'raw':_0x5b733c[_0x26e2('0x17')]?_0x5b733c[_0x26e2('0x17')][_0x26e2('0x18')]===undefined?!![]:![]:!![],'where':_0x5b733c[_0x26e2('0x17')]?_0x5b733c[_0x26e2('0x17')][_0x26e2('0x19')]||null:null,'attributes':_0x5b733c['options']?_0x5b733c[_0x26e2('0x17')][_0x26e2('0x1a')]||null:null,'include':_0x5b733c[_0x26e2('0x17')]?_0x5b733c['options'][_0x26e2('0x1b')]?_[_0x26e2('0x1c')](_0x5b733c[_0x26e2('0x17')]['include'],function(_0x25d511){return{'model':db[_0x25d511[_0x26e2('0x1d')]],'as':_0x25d511['as'],'attributes':_0x25d511[_0x26e2('0x1a')],'include':_0x25d511[_0x26e2('0x1b')]?_[_0x26e2('0x1c')](_0x25d511[_0x26e2('0x1b')],function(_0x20636c){return{'model':db[_0x20636c['model']],'as':_0x20636c['as'],'attributes':_0x20636c['attributes'],'include':_0x20636c[_0x26e2('0x1b')]?_[_0x26e2('0x1c')](_0x20636c[_0x26e2('0x1b')],function(_0x466f0c){return{'model':db[_0x466f0c[_0x26e2('0x1d')]],'as':_0x466f0c['as'],'attributes':_0x466f0c[_0x26e2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x26e2('0xa')](function(_0x328616){logger[_0x26e2('0xb')](_0x26e2('0x14'),_0x5b733c);logger[_0x26e2('0x1e')]('ShowSetting',_0x5b733c,JSON[_0x26e2('0xf')](_0x328616));_0x334880(_0x328616);})[_0x26e2('0x13')](function(_0x515edc){logger[_0x26e2('0x10')](_0x26e2('0x14'),_0x515edc[_0x26e2('0x11')],_0x5b733c);_0x511b56(_0x4f9373[_0x26e2('0x10')](0x1f4,_0x515edc[_0x26e2('0x11')]));});});};
\ No newline at end of file
+var _0x76e1=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSetting','Setting','find','raw','options','where','attributes','include','map','model','util','moment'];(function(_0x5d1bf9,_0x36ba89){var _0x374b81=function(_0x1811ba){while(--_0x1811ba){_0x5d1bf9['push'](_0x5d1bf9['shift']());}};_0x374b81(++_0x36ba89);}(_0x76e1,0xe5));var _0x176e=function(_0x33c1fd,_0x30c356){_0x33c1fd=_0x33c1fd-0x0;var _0x4cab6c=_0x76e1[_0x33c1fd];return _0x4cab6c;};'use strict';var _=require('lodash');var util=require(_0x176e('0x0'));var moment=require(_0x176e('0x1'));var BPromise=require(_0x176e('0x2'));var rs=require(_0x176e('0x3'));var fs=require('fs');var Redis=require(_0x176e('0x4'));var db=require(_0x176e('0x5'))['db'];var utils=require(_0x176e('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x176e('0x7'));var jayson=require(_0x176e('0x8'));var client=jayson[_0x176e('0x9')][_0x176e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f1c37,_0x436e66,_0x46db6f){return new BPromise(function(_0x1e0079,_0x42344a){return client[_0x176e('0xb')](_0x5f1c37,_0x46db6f)['then'](function(_0x1cc12e){logger[_0x176e('0xc')](_0x176e('0xd'),_0x436e66,_0x176e('0xe'));logger[_0x176e('0xf')](_0x176e('0x10'),_0x436e66,_0x176e('0xe'),JSON[_0x176e('0x11')](_0x1cc12e));if(_0x1cc12e[_0x176e('0x12')]){if(_0x1cc12e[_0x176e('0x12')][_0x176e('0x13')]===0x1f4){logger[_0x176e('0x12')](_0x176e('0xd'),_0x436e66,_0x1cc12e['error']['message']);return _0x42344a(_0x1cc12e['error'][_0x176e('0x14')]);}logger[_0x176e('0x12')]('Setting,\x20%s,\x20%s',_0x436e66,_0x1cc12e[_0x176e('0x12')][_0x176e('0x14')]);return _0x1e0079(_0x1cc12e[_0x176e('0x12')][_0x176e('0x14')]);}else{logger[_0x176e('0xc')](_0x176e('0xd'),_0x436e66,_0x176e('0xe'));_0x1e0079(_0x1cc12e[_0x176e('0x15')]['message']);}})[_0x176e('0x16')](function(_0x54fb40){logger[_0x176e('0x12')]('Setting,\x20%s,\x20%s',_0x436e66,_0x54fb40);_0x42344a(_0x54fb40);});});}exports[_0x176e('0x17')]=function(_0x584dd5){var _0x5cb8f1=this;return new Promise(function(_0x5beff1,_0x3aaf3f){return db[_0x176e('0x18')][_0x176e('0x19')]({'raw':_0x584dd5['options']?_0x584dd5['options'][_0x176e('0x1a')]===undefined?!![]:![]:!![],'where':_0x584dd5['options']?_0x584dd5[_0x176e('0x1b')][_0x176e('0x1c')]||null:null,'attributes':_0x584dd5['options']?_0x584dd5[_0x176e('0x1b')][_0x176e('0x1d')]||null:null,'include':_0x584dd5[_0x176e('0x1b')]?_0x584dd5[_0x176e('0x1b')][_0x176e('0x1e')]?_[_0x176e('0x1f')](_0x584dd5[_0x176e('0x1b')][_0x176e('0x1e')],function(_0x46bd95){return{'model':db[_0x46bd95[_0x176e('0x20')]],'as':_0x46bd95['as'],'attributes':_0x46bd95[_0x176e('0x1d')],'include':_0x46bd95[_0x176e('0x1e')]?_[_0x176e('0x1f')](_0x46bd95['include'],function(_0x3259d5){return{'model':db[_0x3259d5[_0x176e('0x20')]],'as':_0x3259d5['as'],'attributes':_0x3259d5['attributes'],'include':_0x3259d5[_0x176e('0x1e')]?_['map'](_0x3259d5[_0x176e('0x1e')],function(_0x38bb2a){return{'model':db[_0x38bb2a['model']],'as':_0x38bb2a['as'],'attributes':_0x38bb2a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c7939){logger[_0x176e('0xc')](_0x176e('0x17'),_0x584dd5);logger[_0x176e('0xf')](_0x176e('0x17'),_0x584dd5,JSON[_0x176e('0x11')](_0x1c7939));_0x5beff1(_0x1c7939);})[_0x176e('0x16')](function(_0x28f84e){logger[_0x176e('0x12')](_0x176e('0x17'),_0x28f84e[_0x176e('0x14')],_0x584dd5);_0x3aaf3f(_0x5cb8f1['error'](0x1f4,_0x28f84e[_0x176e('0x14')]));});});};
\ No newline at end of file
index 34b7216..657f744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addAnswer','/:id/notify','notify','/:id/applications','/:id/send','/:id/status','status','addAgents','put','update','delete','destroy','removeDispositions','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1a3c70,_0x805ba2){_0x1a3c70=_0x1a3c70-0x0;var _0x126237=_0x1cb9[_0x1a3c70];return _0x126237;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0x8')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x8')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x8')]('/:id/applications',auth[_0x91cb('0x9')](),controller[_0x91cb('0x13')]);router['get'](_0x91cb('0x14'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x15')]);router[_0x91cb('0x8')]('/:id/status',controller['statusGet']);router[_0x91cb('0x8')](_0x91cb('0x16'),auth['isAuthenticated'](),controller['getAgents']);router[_0x91cb('0x17')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x18')]);router['post'](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller['addDisposition']);router[_0x91cb('0x17')](_0x91cb('0x11'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x19')]);router['post'](_0x91cb('0x1a'),controller[_0x91cb('0x1b')]);router['post'](_0x91cb('0x1c'),auth['isAuthenticated'](),controller['addApplications']);router[_0x91cb('0x17')](_0x91cb('0x1d'),auth['isAuthenticated'](),controller['send']);router['post'](_0x91cb('0x1e'),controller[_0x91cb('0x1f')]);router[_0x91cb('0x17')](_0x91cb('0x16'),auth['isAuthenticated'](),controller[_0x91cb('0x20')]);router[_0x91cb('0x21')](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0x22')]);router[_0x91cb('0x23')](_0x91cb('0xd'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x24')]);router[_0x91cb('0x23')](_0x91cb('0xf'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x25')]);router['delete']('/:id/canned_answers',auth[_0x91cb('0x9')](),controller['removeAnswers']);router[_0x91cb('0x23')](_0x91cb('0x16'),auth[_0x91cb('0x9')](),controller['removeAgents']);module[_0x91cb('0x26')]=router;
\ No newline at end of file
+var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','getAgents','post','/:id/applications','addApplications','/:id/send','send','/:id/users','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf494,0x1c6));var _0x4f49=function(_0x28e376,_0x282696){_0x28e376=_0x28e376-0x0;var _0x23c705=_0xf494[_0x28e376];return _0x23c705;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0xa')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['getDispositions']);router[_0x4f49('0xa')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);router['get']('/:id/applications',auth[_0x4f49('0xb')](),controller[_0x4f49('0x13')]);router['get'](_0x4f49('0x14'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x15')]);router[_0x4f49('0xa')](_0x4f49('0x16'),controller[_0x4f49('0x17')]);router[_0x4f49('0xa')]('/:id/users',auth[_0x4f49('0xb')](),controller[_0x4f49('0x18')]);router[_0x4f49('0x19')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4f49('0x19')](_0x4f49('0x10'),auth[_0x4f49('0xb')](),controller['addDisposition']);router[_0x4f49('0x19')](_0x4f49('0x11'),auth[_0x4f49('0xb')](),controller['addAnswer']);router['post']('/:id/notify',controller['notify']);router[_0x4f49('0x19')](_0x4f49('0x1a'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1b')]);router['post'](_0x4f49('0x1c'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x1d')]);router[_0x4f49('0x19')](_0x4f49('0x16'),controller['status']);router[_0x4f49('0x19')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller['addAgents']);router[_0x4f49('0x1f')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x20')]);router[_0x4f49('0x21')](_0x4f49('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4f49('0x21')](_0x4f49('0x10'),auth['isAuthenticated'](),controller[_0x4f49('0x22')]);router[_0x4f49('0x21')](_0x4f49('0x11'),auth['isAuthenticated'](),controller[_0x4f49('0x23')]);router[_0x4f49('0x21')](_0x4f49('0x1e'),auth[_0x4f49('0xb')](),controller[_0x4f49('0x24')]);module[_0x4f49('0x25')]=router;
\ No newline at end of file
index 6d3f89c..144abb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0950=['csc','infobip','intelepeer','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','randomstring','exports','STRING','generate','ENUM','skebby','connectel','plivo','clickatell','bandwidth'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0950,0x100));var _0x0095=function(_0x4e6fc7,_0x6b9a5d){_0x4e6fc7=_0x4e6fc7-0x0;var _0x3c2ef6=_0x0950[_0x4e6fc7];return _0x3c2ef6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x0095('0x0'));module[_0x0095('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x0095('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x0095('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x0095('0x2')],'defaultValue':function(){return rs[_0x0095('0x3')]();}},'phone':{'type':Sequelize[_0x0095('0x2')]},'type':{'type':Sequelize[_0x0095('0x4')]('twilio',_0x0095('0x5'),_0x0095('0x6'),'clicksend',_0x0095('0x7'),_0x0095('0x8'),_0x0095('0x9'),_0x0095('0xa'),_0x0095('0xb'),_0x0095('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x0095('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x0095('0x4')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x0095('0x2')]},'apiKey':{'type':Sequelize[_0x0095('0x2')]},'applicationId':{'type':Sequelize[_0x0095('0x2')]},'accountId':{'type':Sequelize[_0x0095('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0095('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0095('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0095('0xe')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0095('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0095('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0095('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0095('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0095('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x0095('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0095('0xf')],'comment':_0x0095('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x0095('0xe')],'defaultValue':![],'comment':_0x0095('0x11'),'set':function(_0x4fc337){if(!_0x4fc337)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue'](_0x0095('0x12'),_0x4fc337);}}};
\ No newline at end of file
+var _0xe1ef=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','name','STRING','generate','ENUM','skebby','clicksend','plivo','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x149a59,_0x53e1c9){var _0x449425=function(_0x17da19){while(--_0x17da19){_0x149a59['push'](_0x149a59['shift']());}};_0x449425(++_0x53e1c9);}(_0xe1ef,0x11d));var _0xfe1e=function(_0x3b5bec,_0x23cdb2){_0x3b5bec=_0x3b5bec-0x0;var _0x3ad765=_0xe1ef[_0x3b5bec];return _0x3ad765;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xfe1e('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xfe1e('0x1'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0xfe1e('0x2')],'defaultValue':function(){return rs[_0xfe1e('0x3')]();}},'phone':{'type':Sequelize[_0xfe1e('0x2')]},'type':{'type':Sequelize[_0xfe1e('0x4')]('twilio',_0xfe1e('0x5'),'connectel',_0xfe1e('0x6'),_0xfe1e('0x7'),'clickatell','bandwidth',_0xfe1e('0x8'),_0xfe1e('0x9'),_0xfe1e('0xa'))},'accountSid':{'type':Sequelize[_0xfe1e('0x2')]},'authId':{'type':Sequelize[_0xfe1e('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xfe1e('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xfe1e('0x2')]},'password':{'type':Sequelize[_0xfe1e('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xfe1e('0x2')]},'accountId':{'type':Sequelize[_0xfe1e('0x2')]},'senderString':{'type':Sequelize[_0xfe1e('0x2')]},'deliveryReport':{'type':Sequelize[_0xfe1e('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xfe1e('0x2')]},'notificationTemplate':{'type':Sequelize[_0xfe1e('0xc')],'defaultValue':function(){return _0xfe1e('0xd');}},'notificationSound':{'type':Sequelize[_0xfe1e('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfe1e('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfe1e('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfe1e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xfe1e('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfe1e('0xe')],'comment':_0xfe1e('0xf')},'mandatoryDisposition':{'type':Sequelize[_0xfe1e('0xb')],'defaultValue':![],'comment':_0xfe1e('0x10'),'set':function(_0x9b2377){if(!_0x9b2377)this[_0xfe1e('0x11')](_0xfe1e('0x12'),null);this[_0xfe1e('0x11')](_0xfe1e('0x13'),_0x9b2377);}}};
\ No newline at end of file
index 0d6f68b..01299ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7006=['then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','json','undefined','limit','count','offset','status','set','Content-Range','reject','save','update','destroy','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','type','filter','options','includeAll','include','findAll','rows','params','merge','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','autoAssociation','describe','SmsAccountId','Disposition','getDispositions','findOne','keys','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','Body','messageId','skebby','sender','connectel','from','clicksend','plivo','Text','MessageUUID','infobip','results','segmentedMessage','fromNumber','text','replyMessageId','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','list','omit','defaults','contact','SmsInteraction','interaction','autoclose','close','unmanaged','*,*,*,*','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','DESC','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','DELIVERED','clickatell','redif','error_code','groupName','RECEIVED_BY_RECIPIENT','DELIVRD','csc','message-id','state','addAgents','spread','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','request'];(function(_0x14bfdd,_0x980233){var _0x3a8113=function(_0x525f75){while(--_0x525f75){_0x14bfdd['push'](_0x14bfdd['shift']());}};_0x3a8113(++_0x980233);}(_0x7006,0x1af));var _0x6700=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x7006[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require(_0x6700('0x0'));var rimraf=require(_0x6700('0x1'));var zipdir=require(_0x6700('0x2'));var jsonpatch=require(_0x6700('0x3'));var rp=require(_0x6700('0x4'));var moment=require(_0x6700('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6700('0x6'));var util=require(_0x6700('0x7'));var path=require(_0x6700('0x8'));var sox=require(_0x6700('0x9'));var csv=require('to-csv');var ejs=require(_0x6700('0xa'));var fs=require('fs');var fs_extra=require(_0x6700('0xb'));var _=require(_0x6700('0xc'));var squel=require(_0x6700('0xd'));var crypto=require(_0x6700('0xe'));var jsforce=require(_0x6700('0xf'));var deskjs=require(_0x6700('0x10'));var toCsv=require(_0x6700('0x11'));var querystring=require(_0x6700('0x12'));var Papa=require(_0x6700('0x13'));var Redis=require(_0x6700('0x14'));var authService=require(_0x6700('0x15'));var qs=require(_0x6700('0x16'));var as=require(_0x6700('0x17'));var hardwareService=require(_0x6700('0x18'));var logger=require(_0x6700('0x19'))(_0x6700('0x1a'));var utils=require(_0x6700('0x1b'));var config=require(_0x6700('0x1c'));var licenseUtil=require(_0x6700('0x1d'));var db=require(_0x6700('0x1e'))['db'];config[_0x6700('0x1f')]=_['defaults'](config[_0x6700('0x1f')],{'host':_0x6700('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6700('0x1f')]));require('./smsAccount.socket')[_0x6700('0x21')](socket);var jayson=require(_0x6700('0x22'));var client=jayson[_0x6700('0x23')]['http']({'port':0x232c});function respondWithRpcPromise(_0x83bb9d,_0x1d9463,_0x1ff719,_0x3b405b){return new BPromise(function(_0x1cab80,_0x46916a){var _0x4d5157=_0x3b405b||client;return _0x4d5157[_0x6700('0x24')](_0x83bb9d,_0x1ff719)[_0x6700('0x25')](function(_0x4cf0b1){logger[_0x6700('0x26')](_0x6700('0x27'),_0x1d9463,_0x6700('0x28'));logger[_0x6700('0x29')](_0x6700('0x2a'),_0x1d9463,_0x6700('0x28'),JSON[_0x6700('0x2b')](_0x4cf0b1));if(_0x4cf0b1[_0x6700('0x2c')]){if(_0x4cf0b1['error'][_0x6700('0x2d')]===0x1f4){logger['error']('SmsAccount,\x20%s,\x20%s',_0x1d9463,_0x4cf0b1[_0x6700('0x2c')][_0x6700('0x2e')]);return _0x46916a(_0x4cf0b1[_0x6700('0x2c')]['message']);}logger[_0x6700('0x2c')]('SmsAccount,\x20%s,\x20%s',_0x1d9463,_0x4cf0b1[_0x6700('0x2c')]['message']);return _0x1cab80(_0x4cf0b1[_0x6700('0x2c')][_0x6700('0x2e')]);}else{logger[_0x6700('0x26')](_0x6700('0x27'),_0x1d9463,_0x6700('0x28'));_0x1cab80(_0x4cf0b1[_0x6700('0x2f')][_0x6700('0x2e')]);}})[_0x6700('0x30')](function(_0x45475f){logger[_0x6700('0x2c')]('SmsAccount,\x20%s,\x20%s',_0x1d9463,_0x45475f);_0x46916a(_0x45475f);});});}function respondWithStatusCode(_0x4e3a7b,_0x4ea89b){_0x4ea89b=_0x4ea89b||0xcc;return function(_0x337099){if(_0x337099){return _0x4e3a7b[_0x6700('0x31')](_0x4ea89b);}return _0x4e3a7b['status'](_0x4ea89b)[_0x6700('0x32')]();};}function respondWithResult(_0x4f54a5,_0x116a80){_0x116a80=_0x116a80||0xc8;return function(_0x1a44f5){if(_0x1a44f5){return _0x4f54a5['status'](_0x116a80)[_0x6700('0x33')](_0x1a44f5);}};}function respondWithFilteredResult(_0x1ac61a,_0x5dbd56){return function(_0x3d912b){if(_0x3d912b){var _0x2cf473=typeof _0x5dbd56['offset']===_0x6700('0x34')&&typeof _0x5dbd56[_0x6700('0x35')]==='undefined';var _0x289b92=_0x3d912b[_0x6700('0x36')];var _0x3bb354=_0x2cf473?0x0:_0x5dbd56['offset'];var _0x24d3a7=_0x2cf473?_0x3d912b[_0x6700('0x36')]:_0x5dbd56[_0x6700('0x37')]+_0x5dbd56[_0x6700('0x35')];var _0xb908af;if(_0x24d3a7>=_0x289b92){_0x24d3a7=_0x289b92;_0xb908af=0xc8;}else{_0xb908af=0xce;}_0x1ac61a[_0x6700('0x38')](_0xb908af);return _0x1ac61a[_0x6700('0x39')](_0x6700('0x3a'),_0x3bb354+'-'+_0x24d3a7+'/'+_0x289b92)[_0x6700('0x33')](_0x3d912b);}return null;};}function patchUpdates(_0x166e63){return function(_0x5aacbf){try{jsonpatch['apply'](_0x5aacbf,_0x166e63,!![]);}catch(_0x3bb943){return BPromise[_0x6700('0x3b')](_0x3bb943);}return _0x5aacbf[_0x6700('0x3c')]();};}function saveUpdates(_0x47b69b,_0x57f218){return function(_0x42781c){if(_0x42781c){return _0x42781c[_0x6700('0x3d')](_0x47b69b)[_0x6700('0x25')](function(_0x34e635){return _0x34e635;});}return null;};}function removeEntity(_0x295f56,_0x53b529){return function(_0x149646){if(_0x149646){return _0x149646[_0x6700('0x3e')]()[_0x6700('0x25')](function(){var _0xd03de=_0x149646['get']({'plain':!![]});var _0x3a1a06=_0x6700('0x3f');return db[_0x6700('0x40')]['destroy']({'where':{'type':_0x3a1a06,'resourceId':_0xd03de['id']}})['then'](function(){return _0x149646;});})[_0x6700('0x25')](function(){_0x295f56['status'](0xcc)[_0x6700('0x32')]();});}};}function handleEntityNotFound(_0x430745,_0x1cf424){return function(_0x233c5b){if(!_0x233c5b){_0x430745[_0x6700('0x31')](0x194);}return _0x233c5b;};}function handleError(_0x4b0be8,_0x150305){_0x150305=_0x150305||0x1f4;return function(_0x31aead){logger[_0x6700('0x2c')](_0x31aead[_0x6700('0x41')]);if(_0x31aead[_0x6700('0x42')]){delete _0x31aead['name'];}_0x4b0be8[_0x6700('0x38')](_0x150305)[_0x6700('0x43')](_0x31aead);};}exports[_0x6700('0x44')]=function(_0x1ce958,_0x4543d9){var _0x3e24e5={'include':[{'model':db[_0x6700('0x45')],'as':_0x6700('0x46')}]},_0x18ad61={},_0x2208b3={'count':0x0,'rows':[]};var _0x548af9=_[_0x6700('0x47')](db[_0x6700('0x48')][_0x6700('0x49')],function(_0x5e0b19){return{'name':_0x5e0b19[_0x6700('0x4a')],'type':_0x5e0b19['type'][_0x6700('0x4b')]};});_0x18ad61[_0x6700('0x4c')]=_[_0x6700('0x47')](_0x548af9,'name');_0x18ad61[_0x6700('0x4d')]=_['keys'](_0x1ce958[_0x6700('0x4d')]);_0x18ad61['filters']=_[_0x6700('0x4e')](_0x18ad61['model'],_0x18ad61[_0x6700('0x4d')]);_0x3e24e5[_0x6700('0x4f')]=_['intersection'](_0x18ad61['model'],qs[_0x6700('0x50')](_0x1ce958[_0x6700('0x4d')][_0x6700('0x50')]));_0x3e24e5['attributes']=_0x3e24e5['attributes'][_0x6700('0x51')]?_0x3e24e5[_0x6700('0x4f')]:_0x18ad61[_0x6700('0x4c')];if(!_0x1ce958['query'][_0x6700('0x52')]('nolimit')){_0x3e24e5[_0x6700('0x35')]=qs[_0x6700('0x35')](_0x1ce958[_0x6700('0x4d')]['limit']);_0x3e24e5['offset']=qs[_0x6700('0x37')](_0x1ce958[_0x6700('0x4d')][_0x6700('0x37')]);}_0x3e24e5[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x1ce958['query'][_0x6700('0x54')]);_0x3e24e5[_0x6700('0x55')]=qs[_0x6700('0x56')](_[_0x6700('0x57')](_0x1ce958['query'],_0x18ad61[_0x6700('0x56')]),_0x548af9);if(_0x1ce958['query']['filter']){_0x3e24e5[_0x6700('0x55')]=_['merge'](_0x3e24e5[_0x6700('0x55')],{'$or':_['map'](_0x548af9,function(_0x47912a){if(_0x47912a[_0x6700('0x58')]!=='VIRTUAL'){var _0x562143={};_0x562143[_0x47912a[_0x6700('0x42')]]={'$like':'%'+_0x1ce958['query'][_0x6700('0x59')]+'%'};return _0x562143;}})});}_0x3e24e5=_['merge']({},_0x3e24e5,_0x1ce958[_0x6700('0x5a')]);var _0x3368fc={'where':_0x3e24e5[_0x6700('0x55')]};return db['SmsAccount'][_0x6700('0x36')](_0x3368fc)[_0x6700('0x25')](function(_0x4267f7){_0x2208b3[_0x6700('0x36')]=_0x4267f7;if(_0x1ce958[_0x6700('0x4d')][_0x6700('0x5b')]){_0x3e24e5[_0x6700('0x5c')]=[{'all':!![]}];}return db['SmsAccount'][_0x6700('0x5d')](_0x3e24e5);})['then'](function(_0x331c00){_0x2208b3[_0x6700('0x5e')]=_0x331c00;return _0x2208b3;})[_0x6700('0x25')](respondWithFilteredResult(_0x4543d9,_0x3e24e5))[_0x6700('0x30')](handleError(_0x4543d9,null));};exports['show']=function(_0x2913c1,_0x4a6026){var _0x2bbe7c={'raw':![],'where':{'id':_0x2913c1[_0x6700('0x5f')]['id']},'include':[{'model':db[_0x6700('0x45')],'as':_0x6700('0x46')}]},_0x514d5c={};_0x514d5c[_0x6700('0x4c')]=_['keys'](db[_0x6700('0x48')][_0x6700('0x49')]);_0x514d5c['query']=_['keys'](_0x2913c1['query']);_0x514d5c[_0x6700('0x56')]=_[_0x6700('0x4e')](_0x514d5c['model'],_0x514d5c['query']);_0x2bbe7c[_0x6700('0x4f')]=_[_0x6700('0x4e')](_0x514d5c[_0x6700('0x4c')],qs[_0x6700('0x50')](_0x2913c1[_0x6700('0x4d')][_0x6700('0x50')]));_0x2bbe7c[_0x6700('0x4f')]=_0x2bbe7c[_0x6700('0x4f')][_0x6700('0x51')]?_0x2bbe7c[_0x6700('0x4f')]:_0x514d5c[_0x6700('0x4c')];if(_0x2913c1[_0x6700('0x4d')][_0x6700('0x5b')]){_0x2bbe7c[_0x6700('0x5c')]=[{'all':!![]}];}_0x2bbe7c=_[_0x6700('0x60')]({},_0x2bbe7c,_0x2913c1['options']);return db[_0x6700('0x48')]['find'](_0x2bbe7c)[_0x6700('0x25')](handleEntityNotFound(_0x4a6026,null))[_0x6700('0x25')](respondWithResult(_0x4a6026,null))[_0x6700('0x30')](handleError(_0x4a6026,null));};exports[_0x6700('0x61')]=function(_0x43403c,_0x34cf07){return db['SmsAccount'][_0x6700('0x61')](_0x43403c[_0x6700('0x62')],{})[_0x6700('0x25')](function(_0x42d6d6){var _0x63f4e1=_0x43403c['user'][_0x6700('0x63')]({'plain':!![]});if(!_0x63f4e1)throw new Error(_0x6700('0x64'));if(_0x63f4e1[_0x6700('0x65')]===_0x6700('0x66')){var _0x1a112f=_0x42d6d6[_0x6700('0x63')]({'plain':!![]});var _0x411e1b=_0x6700('0x3f');return db['UserProfileSection'][_0x6700('0x67')]({'where':{'name':_0x411e1b,'userProfileId':_0x63f4e1['userProfileId']},'raw':!![]})[_0x6700('0x25')](function(_0x9fecf0){if(_0x9fecf0&&_0x9fecf0[_0x6700('0x68')]===0x0){return db[_0x6700('0x40')][_0x6700('0x61')]({'name':_0x1a112f['name'],'resourceId':_0x1a112f['id'],'type':_0x9fecf0[_0x6700('0x42')],'sectionId':_0x9fecf0['id']},{})[_0x6700('0x25')](function(){return _0x42d6d6;});}else{return _0x42d6d6;}})[_0x6700('0x30')](function(_0x120cdd){logger[_0x6700('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x120cdd);throw _0x120cdd;});}return _0x42d6d6;})[_0x6700('0x25')](respondWithResult(_0x34cf07,0xc9))[_0x6700('0x30')](handleError(_0x34cf07,null));};exports[_0x6700('0x3d')]=function(_0x18d1be,_0x349506){if(_0x18d1be['body']['id']){delete _0x18d1be[_0x6700('0x62')]['id'];}return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x18d1be[_0x6700('0x5f')]['id']},'include':[{'model':db[_0x6700('0x45')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x349506,null))['then'](saveUpdates(_0x18d1be[_0x6700('0x62')],null))[_0x6700('0x25')](respondWithResult(_0x349506,null))[_0x6700('0x30')](handleError(_0x349506,null));};exports[_0x6700('0x3e')]=function(_0x6abf5e,_0x46770e){return db[_0x6700('0x48')]['find']({'where':{'id':_0x6abf5e[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x46770e,null))[_0x6700('0x25')](removeEntity(_0x46770e,null))[_0x6700('0x30')](handleError(_0x46770e,null));};exports[_0x6700('0x69')]=function(_0x1b2d18,_0x43cb09){return db[_0x6700('0x48')][_0x6700('0x69')]()[_0x6700('0x25')](respondWithResult(_0x43cb09,null))[_0x6700('0x30')](handleError(_0x43cb09,null));};exports['addDisposition']=function(_0x22aab6,_0x2fcb05,_0x5e51f2){if(_0x22aab6[_0x6700('0x62')]['id']){delete _0x22aab6['body']['id'];}return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x22aab6[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x2fcb05,null))[_0x6700('0x25')](function(_0x535f05){if(_0x535f05){_0x22aab6[_0x6700('0x62')][_0x6700('0x6a')]=_0x535f05['id'];return db[_0x6700('0x6b')][_0x6700('0x61')](_0x22aab6[_0x6700('0x62')]);}})[_0x6700('0x25')](respondWithResult(_0x2fcb05,null))[_0x6700('0x30')](handleError(_0x2fcb05,null));};exports[_0x6700('0x6c')]=function(_0x48d56b,_0x1f960e,_0x475016){var _0x2754ac={'raw':![],'where':{}};var _0x16d5e8={};var _0x39a7b4={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6700('0x6d')]({'where':{'id':_0x48d56b[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x1f960e,null))['then'](function(_0xd463b2){if(_0xd463b2){_0x16d5e8['model']=_[_0x6700('0x6e')](db[_0x6700('0x6b')][_0x6700('0x49')]);_0x16d5e8['query']=_[_0x6700('0x6e')](_0x48d56b['query']);_0x16d5e8[_0x6700('0x56')]=_[_0x6700('0x4e')](_0x16d5e8[_0x6700('0x4c')],_0x16d5e8[_0x6700('0x4d')]);_0x2754ac[_0x6700('0x4f')]=_[_0x6700('0x4e')](_0x16d5e8[_0x6700('0x4c')],qs[_0x6700('0x50')](_0x48d56b['query']['fields']));_0x2754ac[_0x6700('0x4f')]=_0x2754ac[_0x6700('0x4f')][_0x6700('0x51')]?_0x2754ac[_0x6700('0x4f')]:_0x16d5e8[_0x6700('0x4c')];if(!_0x48d56b[_0x6700('0x4d')][_0x6700('0x52')](_0x6700('0x6f'))){_0x2754ac['limit']=qs[_0x6700('0x35')](_0x48d56b[_0x6700('0x4d')][_0x6700('0x35')]);_0x2754ac[_0x6700('0x37')]=qs[_0x6700('0x37')](_0x48d56b[_0x6700('0x4d')][_0x6700('0x37')]);}_0x2754ac[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x48d56b['query']['sort']);_0x2754ac[_0x6700('0x55')]=qs[_0x6700('0x56')](_[_0x6700('0x57')](_0x48d56b[_0x6700('0x4d')],_0x16d5e8[_0x6700('0x56')]));_0x2754ac['where']['SmsAccountId']=_0xd463b2['id'];if(_0x48d56b[_0x6700('0x4d')][_0x6700('0x59')]){_0x2754ac['where']=_[_0x6700('0x60')](_0x2754ac[_0x6700('0x55')],{'$or':_[_0x6700('0x47')](_0x2754ac[_0x6700('0x4f')],function(_0x2da187){var _0x33b16b={};_0x33b16b[_0x2da187]={'$like':'%'+_0x48d56b[_0x6700('0x4d')]['filter']+'%'};return _0x33b16b;})});}_0x2754ac=_[_0x6700('0x60')]({},_0x2754ac,_0x48d56b[_0x6700('0x5a')]);return db[_0x6700('0x6b')]['count']({'where':_0x2754ac['where']})[_0x6700('0x25')](function(_0x442967){_0x39a7b4[_0x6700('0x36')]=_0x442967;if(_0x48d56b[_0x6700('0x4d')][_0x6700('0x5b')]){_0x2754ac[_0x6700('0x5c')]=[{'all':!![]}];}return db[_0x6700('0x6b')][_0x6700('0x5d')](_0x2754ac);})[_0x6700('0x25')](function(_0x926a98){_0x39a7b4[_0x6700('0x5e')]=_0x926a98;return _0x39a7b4;});}})[_0x6700('0x25')](respondWithFilteredResult(_0x1f960e,_0x2754ac))['catch'](handleError(_0x1f960e,null));};exports[_0x6700('0x70')]=function(_0xb0d5a6,_0x4cd459,_0x514038){return db[_0x6700('0x48')]['find']({'where':{'id':_0xb0d5a6['params']['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x4cd459,null))['then'](function(_0x492693){if(_0x492693){return _0x492693[_0x6700('0x70')](_0xb0d5a6[_0x6700('0x4d')][_0x6700('0x71')]);}})[_0x6700('0x25')](respondWithStatusCode(_0x4cd459,null))['catch'](handleError(_0x4cd459,null));};exports[_0x6700('0x72')]=function(_0x2779fe,_0x484b20,_0x1cd8e3){if(_0x2779fe[_0x6700('0x62')]['id']){delete _0x2779fe[_0x6700('0x62')]['id'];}return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x2779fe[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x484b20,null))[_0x6700('0x25')](function(_0x30c118){if(_0x30c118){_0x2779fe[_0x6700('0x62')][_0x6700('0x6a')]=_0x30c118['id'];return db[_0x6700('0x73')][_0x6700('0x61')](_0x2779fe[_0x6700('0x62')]);}})[_0x6700('0x25')](respondWithResult(_0x484b20,null))['catch'](handleError(_0x484b20,null));};exports[_0x6700('0x74')]=function(_0x2d6705,_0x1399f6,_0x5476ea){var _0x5f326d={'raw':![],'where':{}};var _0x4e2b51={};var _0x202f29={'count':0x0,'rows':[]};return db[_0x6700('0x48')][_0x6700('0x6d')]({'where':{'id':_0x2d6705['params']['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x1399f6,null))[_0x6700('0x25')](function(_0x4b0637){if(_0x4b0637){_0x4e2b51['model']=_[_0x6700('0x6e')](db[_0x6700('0x73')]['rawAttributes']);_0x4e2b51['query']=_['keys'](_0x2d6705[_0x6700('0x4d')]);_0x4e2b51[_0x6700('0x56')]=_[_0x6700('0x4e')](_0x4e2b51[_0x6700('0x4c')],_0x4e2b51['query']);_0x5f326d['attributes']=_[_0x6700('0x4e')](_0x4e2b51['model'],qs['fields'](_0x2d6705[_0x6700('0x4d')][_0x6700('0x50')]));_0x5f326d['attributes']=_0x5f326d[_0x6700('0x4f')][_0x6700('0x51')]?_0x5f326d['attributes']:_0x4e2b51[_0x6700('0x4c')];if(!_0x2d6705[_0x6700('0x4d')][_0x6700('0x52')]('nolimit')){_0x5f326d[_0x6700('0x35')]=qs['limit'](_0x2d6705[_0x6700('0x4d')][_0x6700('0x35')]);_0x5f326d[_0x6700('0x37')]=qs[_0x6700('0x37')](_0x2d6705[_0x6700('0x4d')]['offset']);}_0x5f326d[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x2d6705[_0x6700('0x4d')]['sort']);_0x5f326d[_0x6700('0x55')]=qs['filters'](_[_0x6700('0x57')](_0x2d6705[_0x6700('0x4d')],_0x4e2b51[_0x6700('0x56')]));_0x5f326d['where'][_0x6700('0x6a')]=_0x4b0637['id'];if(_0x2d6705['query'][_0x6700('0x59')]){_0x5f326d[_0x6700('0x55')]=_[_0x6700('0x60')](_0x5f326d[_0x6700('0x55')],{'$or':_['map'](_0x5f326d[_0x6700('0x4f')],function(_0x4a69ce){var _0x4b8884={};_0x4b8884[_0x4a69ce]={'$like':'%'+_0x2d6705['query'][_0x6700('0x59')]+'%'};return _0x4b8884;})});}_0x5f326d=_[_0x6700('0x60')]({},_0x5f326d,_0x2d6705[_0x6700('0x5a')]);return db[_0x6700('0x73')][_0x6700('0x36')]({'where':_0x5f326d[_0x6700('0x55')]})[_0x6700('0x25')](function(_0x3bd9ed){_0x202f29[_0x6700('0x36')]=_0x3bd9ed;if(_0x2d6705[_0x6700('0x4d')][_0x6700('0x5b')]){_0x5f326d[_0x6700('0x5c')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5f326d);})['then'](function(_0x59be82){_0x202f29[_0x6700('0x5e')]=_0x59be82;return _0x202f29;});}})['then'](respondWithFilteredResult(_0x1399f6,_0x5f326d))[_0x6700('0x30')](handleError(_0x1399f6,null));};exports[_0x6700('0x75')]=function(_0x24ab94,_0xec14ed,_0x3c04ef){return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x24ab94[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0xec14ed,null))[_0x6700('0x25')](function(_0x49516d){if(_0x49516d){return _0x49516d[_0x6700('0x75')](_0x24ab94[_0x6700('0x4d')][_0x6700('0x71')]);}})[_0x6700('0x25')](respondWithStatusCode(_0xec14ed,null))[_0x6700('0x30')](handleError(_0xec14ed,null));};exports[_0x6700('0x76')]=function(_0x1088d0,_0x3cc68b,_0x28c6f4){var _0x2d3377={'channel':_0x6700('0x77')};var _0x43ad34=[];var _0x2b6a22=[];var _0x189aa0={};return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x1088d0[_0x6700('0x5f')]['id']},'include':[{'model':db[_0x6700('0x78')],'as':_0x6700('0x79')}]})[_0x6700('0x25')](handleEntityNotFound(_0x3cc68b,null))[_0x6700('0x25')](function(_0x36a15d){_0x2d3377[_0x6700('0x7a')]=_0x36a15d;_0x2d3377[_0x6700('0x7b')]=_[_0x6700('0x7c')](_0x36a15d[_0x6700('0x79')],[_0x6700('0x7d')],[_0x6700('0x7e')]);if(_0x2d3377['account'][_0x6700('0x79')]){delete _0x2d3377[_0x6700('0x7a')][_0x6700('0x79')];}return db[_0x6700('0x7f')][_0x6700('0x69')]();})['then'](function(_0x12dae6){if(!_0x12dae6){throw new db[(_0x6700('0x80'))][(_0x6700('0x81'))]('no\x20available\x20attributes');}_0x43ad34=_[_0x6700('0x82')](_['keys'](_0x12dae6),[_0x6700('0x83'),_0x6700('0x84')]);_0x2b6a22=_[_0x6700('0x82')](_['keys'](_0x12dae6),[_0x6700('0x83'),_0x6700('0x84'),_0x6700('0x85'),_0x6700('0x86')]);_0x2d3377[_0x6700('0x62')]={'mapKey':_0x6700('0x87')};if(_0x2d3377['account'][_0x6700('0x58')]){switch(_0x2d3377[_0x6700('0x7a')]['type']){case _0x6700('0x88'):_0x2d3377['body']['from']=_0x1088d0[_0x6700('0x62')][_0x6700('0x89')];_0x2d3377[_0x6700('0x62')][_0x6700('0x62')]=_0x1088d0[_0x6700('0x62')][_0x6700('0x8a')];_0x2d3377[_0x6700('0x62')][_0x6700('0x8b')]=_0x1088d0[_0x6700('0x62')]['MessageSid'];break;case _0x6700('0x8c'):_0x2d3377[_0x6700('0x62')]['from']='+'+_0x1088d0['body'][_0x6700('0x8d')];_0x2d3377[_0x6700('0x62')][_0x6700('0x62')]=_0x1088d0[_0x6700('0x62')]['text'];break;case _0x6700('0x8e'):_0x2d3377['body'][_0x6700('0x8f')]=_0x1088d0[_0x6700('0x62')][_0x6700('0x8f')];_0x2d3377[_0x6700('0x62')]['body']=_0x1088d0[_0x6700('0x62')][_0x6700('0x2e')];break;case _0x6700('0x90'):_0x2d3377[_0x6700('0x62')]['from']=_0x1088d0[_0x6700('0x62')]['from'];_0x2d3377['body'][_0x6700('0x62')]=_0x1088d0['body'][_0x6700('0x62')];_0x2d3377['body']['messageId']=_0x1088d0['body']['message_id'];break;case _0x6700('0x91'):_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')]=_0x1088d0[_0x6700('0x62')]['From'];_0x2d3377['body']['body']=_0x1088d0['body'][_0x6700('0x92')];_0x2d3377[_0x6700('0x62')][_0x6700('0x8b')]=_0x1088d0[_0x6700('0x62')][_0x6700('0x93')];break;case _0x6700('0x94'):_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')]='+'+_0x1088d0[_0x6700('0x62')][_0x6700('0x95')][0x0][_0x6700('0x8f')];_0x2d3377['body']['body']=_0x1088d0[_0x6700('0x62')][_0x6700('0x95')][0x0]['text'];_0x2d3377['body']['messageId']=_0x1088d0['body']['results'][0x0][_0x6700('0x8b')];break;case'csc':_0x2d3377[_0x6700('0x62')]['from']=_0x1088d0[_0x6700('0x62')]['originatingAddress'];_0x2d3377[_0x6700('0x62')][_0x6700('0x62')]=_0x1088d0['body'][_0x6700('0x96')][_0x6700('0x2e')];break;case'clickatell':_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')]=_0x1088d0[_0x6700('0x62')][_0x6700('0x97')];_0x2d3377[_0x6700('0x62')][_0x6700('0x62')]=_0x1088d0['body'][_0x6700('0x98')];_0x2d3377['body'][_0x6700('0x8b')]=_0x1088d0['body'][_0x6700('0x99')];break;case _0x6700('0x9a'):_0x2d3377[_0x6700('0x62')][_0x6700('0x8b')]=_0x1088d0[_0x6700('0x62')][0x0][_0x6700('0x2e')]['id'];_0x2d3377['body'][_0x6700('0x8f')]=_0x1088d0[_0x6700('0x62')][0x0][_0x6700('0x2e')][_0x6700('0x8f')];_0x2d3377[_0x6700('0x62')][_0x6700('0x62')]=_0x1088d0[_0x6700('0x62')][0x0][_0x6700('0x2e')]['text'];break;case _0x6700('0x9b'):_0x2d3377['body']['from']=_0x1088d0[_0x6700('0x62')][_0x6700('0x8f')];_0x2d3377[_0x6700('0x62')]['body']=_0x1088d0[_0x6700('0x62')][_0x6700('0x2e')];_0x2d3377[_0x6700('0x62')][_0x6700('0x8b')]=_0x1088d0[_0x6700('0x62')][_0x6700('0x9c')];break;}}if(_0x2d3377['body']['id']){delete _0x2d3377['body']['id'];}if(_[_0x6700('0x9d')](_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')])){throw new db[(_0x6700('0x80'))][(_0x6700('0x81'))]('from\x20is\x20mandatory');}if(_[_0x6700('0x9d')](_0x2d3377['body'][_0x6700('0x62')])||_0x2d3377['body'][_0x6700('0x62')]===''){throw new db[(_0x6700('0x80'))]['ValidationError'](_0x6700('0x9e'));}if(_[_0x6700('0x9d')](_0x2d3377[_0x6700('0x62')][_0x6700('0x9f')])){throw new db[(_0x6700('0x80'))][(_0x6700('0x81'))](_0x6700('0xa0')+_0x2b6a22);}if(!_[_0x6700('0xa1')](_0x2b6a22,_0x2d3377['body'][_0x6700('0x9f')])){throw new db[(_0x6700('0x80'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2b6a22);}_0x189aa0[_0x2d3377[_0x6700('0x62')][_0x6700('0x9f')]]=_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')];return db[_0x6700('0xa2')][_0x6700('0x67')]({'where':{'id':_0x2d3377['account'][_0x6700('0x86')]},'include':[{'model':db[_0x6700('0x7f')],'as':_0x6700('0xa3'),'where':_0x189aa0,'limit':0x1,'order':[['updatedAt','DESC']]}]});})['then'](handleEntityNotFound(_0x3cc68b,null))['then'](function(_0x93b061){if(_0x93b061){_0x2d3377[_0x6700('0xa4')]=_[_0x6700('0xa5')](_0x93b061,['Contacts']);if(_0x93b061[_0x6700('0xa3')]['length']){return _0x93b061[_0x6700('0xa3')][0x0];}var _0x55b838=_[_0x6700('0xa6')](_0x2d3377[_0x6700('0x62')],{'firstName':_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')],'ListId':_0x93b061['id']});_0x55b838[_0x2d3377[_0x6700('0x62')][_0x6700('0x9f')]]=_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')];return db[_0x6700('0x7f')]['create'](_0x55b838,{'fields':_0x43ad34,'raw':!![]});}})[_0x6700('0x25')](handleEntityNotFound(_0x3cc68b,null))[_0x6700('0x25')](function(_0x381bee){if(_0x381bee){_0x2d3377[_0x6700('0xa7')]=_0x381bee;var _0x560ecd={'ContactId':_0x381bee['id'],'phone':_0x2d3377[_0x6700('0x62')][_0x6700('0x8f')],'SmsAccountId':_0x1088d0[_0x6700('0x5f')]['id']};var _0xab496f={'ContactId':_0x381bee['id'],'SmsAccountId':_0x1088d0[_0x6700('0x5f')]['id'],'closed':![]};return db[_0x6700('0xa8')]['find']({'where':_0xab496f})['then'](function(_0x16ec10){if(_0x16ec10){return[_0x16ec10,![]];}return db[_0x6700('0xa8')][_0x6700('0x61')](_0x560ecd)[_0x6700('0x25')](function(_0x43df9a){return[_0x43df9a,!![]];});});}})['spread'](function(_0x233070,_0x2a2913){_0x2d3377[_0x6700('0xa9')]=_0x233070[_0x6700('0x63')]({'plain':!![]});_0x2d3377[_0x6700('0xa9')]['created']=![];if(_0x2a2913){if(_0x2d3377[_0x6700('0x7a')][_0x6700('0xaa')]){_0x2d3377[_0x6700('0x7b')]['push']({'id':0x0,'priority':_0x2d3377['applications'][_0x6700('0x51')]+0x1,'app':_0x6700('0xab'),'appdata':_0x6700('0xac'),'interval':_0x6700('0xad')});}_0x2d3377['interaction'][_0x6700('0xae')]=!![];}return db[_0x6700('0xaf')]['create']({'phone':_0x2d3377[_0x6700('0x62')]['from'],'messageId':_0x2d3377[_0x6700('0x62')]['messageId'],'body':_0x2d3377[_0x6700('0x62')]['body'],'SmsAccountId':_0x1088d0['params']['id'],'SmsInteractionId':_0x233070['id'],'direction':'in','ContactId':_0x233070['ContactId'],'AttachmentId':_0x2d3377[_0x6700('0x62')][_0x6700('0xb0')]});})[_0x6700('0x25')](function(_0x494a49){_0x2d3377[_0x6700('0x2e')]=_0x494a49;if(_0x2d3377[_0x6700('0xa9')][_0x6700('0xb1')]){return db[_0x6700('0xb2')][_0x6700('0x67')]({'attributes':['id',_0x6700('0x42')],'where':{'id':_0x2d3377[_0x6700('0xa9')][_0x6700('0xb1')]}})[_0x6700('0x25')](function(_0x47ab6c){if(_0x47ab6c){_0x2d3377[_0x6700('0x7b')][_0x6700('0xb3')]({'id':0x0,'priority':0x0,'app':_0x6700('0xb4'),'appdata':_0x47ab6c[_0x6700('0x42')]+','+(_0x2d3377[_0x6700('0x7a')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6700('0xb5'),_0x6700('0xb6'),_0x2d3377);});}return respondWithRpcPromise(_0x6700('0xb5'),'startRouting',_0x2d3377);})[_0x6700('0x25')](function(_0x1abac7){if(_0x1abac7){var _0xed00da=0xc8;var _0x52f1e1=_0x6700('0xb7');logger[_0x6700('0x26')](_0x6700('0x2a'),_0x52f1e1,_0xed00da,_0x6700('0xb8'));logger['debug'](_0x6700('0xb9'),_0x52f1e1,_0xed00da,'entity\x20found',JSON[_0x6700('0x2b')](_0x1abac7));if(_0x2d3377[_0x6700('0x7a')]['type']==='twilio'){return _0x3cc68b[_0x6700('0x38')](_0xed00da)[_0x6700('0x39')](_0x6700('0xba'),'text/xml')[_0x6700('0x43')](_0x6700('0xbb'));}else{return _0x3cc68b['status'](_0xed00da)['json'](_0x1abac7);}}})[_0x6700('0x30')](handleError(_0x3cc68b,null));};exports[_0x6700('0xbc')]=function(_0x320f1f,_0x39cff8){var _0x1d2994=_0x320f1f[_0x6700('0x5f')]['id'];var _0x58bcf5=_0x320f1f['body'];var _0x544070=0xc8;var _0x85351c=null;return db[_0x6700('0xbd')]['transaction']({'isolationLevel':db['sequelize'][_0x6700('0xbe')][_0x6700('0xbf')]['READ_COMMITTED']},function(_0x3bc645){return db[_0x6700('0x48')][_0x6700('0x6d')]({'where':{'id':_0x1d2994},'transaction':_0x3bc645})[_0x6700('0x25')](function(_0x4c608c){if(_0x4c608c){return db[_0x6700('0x78')][_0x6700('0x3e')]({'where':{'SmsAccountId':_0x1d2994},'transaction':_0x3bc645})[_0x6700('0x25')](function(){var _0x3250f5=_[_0x6700('0x47')](_0x58bcf5,function(_0x3d5c54){_0x3d5c54['SmsAccountId']=_0x1d2994;return _0x3d5c54;});return db[_0x6700('0x78')][_0x6700('0xc0')](_0x3250f5,{'transaction':_0x3bc645});});}else{_0x544070=0x194;_0x85351c=[];}});})[_0x6700('0x25')](function(){if(_0x544070!==0x194){return db[_0x6700('0x78')][_0x6700('0xc1')]({'where':{'SmsAccountId':_0x1d2994},'order':_0x6700('0x7d')})[_0x6700('0x25')](function(_0x3965e8){_0x85351c=_0x3965e8;});}})[_0x6700('0x30')](function(_0x2ff894){_0x544070=0x1f4;logger['error'](_0x2ff894[_0x6700('0x41')]);if(_0x2ff894[_0x6700('0x42')]){delete _0x2ff894[_0x6700('0x42')];}_0x85351c=_0x2ff894;})[_0x6700('0xc2')](function(){if(_0x85351c===null){_0x39cff8[_0x6700('0x31')](_0x544070);}else{if(_0x544070===0x1f4){_0x39cff8[_0x6700('0x38')](_0x544070)['send'](_0x85351c);}else{_0x39cff8[_0x6700('0x38')](_0x544070)[_0x6700('0x33')](_0x85351c);}}});};exports[_0x6700('0xc3')]=function(_0x2633ae,_0x488bd0,_0x508240){var _0xef7b75={};var _0x21557d={};var _0x378a66;var _0x1823fe;return db[_0x6700('0x48')][_0x6700('0x6d')]({'where':{'id':_0x2633ae[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x488bd0,null))['then'](function(_0xa26858){if(_0xa26858){_0x378a66=_0xa26858;_0x21557d[_0x6700('0x4c')]=_['keys'](db[_0x6700('0x78')][_0x6700('0x49')]);_0x21557d[_0x6700('0x4d')]=_['keys'](_0x2633ae[_0x6700('0x4d')]);_0x21557d[_0x6700('0x56')]=_[_0x6700('0x4e')](_0x21557d['model'],_0x21557d['query']);_0xef7b75[_0x6700('0x4f')]=_['intersection'](_0x21557d[_0x6700('0x4c')],qs['fields'](_0x2633ae['query'][_0x6700('0x50')]));_0xef7b75['attributes']=_0xef7b75[_0x6700('0x4f')][_0x6700('0x51')]?_0xef7b75[_0x6700('0x4f')]:_0x21557d[_0x6700('0x4c')];_0xef7b75[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x2633ae[_0x6700('0x4d')][_0x6700('0x54')]);_0xef7b75[_0x6700('0x55')]=qs[_0x6700('0x56')](_[_0x6700('0x57')](_0x2633ae['query'],_0x21557d[_0x6700('0x56')]));if(_0x2633ae['query'][_0x6700('0x59')]){_0xef7b75['where']=_[_0x6700('0x60')](_0xef7b75[_0x6700('0x55')],{'$or':_['map'](_0xef7b75[_0x6700('0x4f')],function(_0xca996d){var _0x35e1c6={};_0x35e1c6[_0xca996d]={'$like':'%'+_0x2633ae[_0x6700('0x4d')][_0x6700('0x59')]+'%'};return _0x35e1c6;})});}_0xef7b75=_[_0x6700('0x60')]({},_0xef7b75,_0x2633ae[_0x6700('0x5a')]);return _0x378a66[_0x6700('0xc3')](_0xef7b75);}})[_0x6700('0x25')](function(_0x19388e){if(_0x19388e){_0x1823fe=_0x19388e[_0x6700('0x51')];if(!_0x2633ae['query'][_0x6700('0x52')](_0x6700('0x6f'))){_0xef7b75[_0x6700('0x35')]=qs[_0x6700('0x35')](_0x2633ae[_0x6700('0x4d')][_0x6700('0x35')]);_0xef7b75[_0x6700('0x37')]=qs[_0x6700('0x37')](_0x2633ae[_0x6700('0x4d')][_0x6700('0x37')]);}return _0x378a66['getApplications'](_0xef7b75);}})['then'](function(_0x4bc5fa){if(_0x4bc5fa){return _0x4bc5fa?{'count':_0x1823fe,'rows':_0x4bc5fa}:null;}})['then'](respondWithResult(_0x488bd0,null))[_0x6700('0x30')](handleError(_0x488bd0,null));};exports[_0x6700('0xc4')]=function(_0x46b564,_0x4f5e45,_0x293338){var _0x2c4e8c={'raw':![],'where':{}};var _0x2a4f85={};var _0x5deb26={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6700('0x6d')]({'where':{'id':_0x46b564[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x4f5e45,null))['then'](function(_0x17b61b){if(_0x17b61b){_0x2a4f85['model']=_[_0x6700('0x6e')](db[_0x6700('0xa8')][_0x6700('0x49')]);_0x2a4f85[_0x6700('0x4d')]=_[_0x6700('0x6e')](_0x46b564['query']);_0x2a4f85[_0x6700('0x56')]=_[_0x6700('0x4e')](_0x2a4f85[_0x6700('0x4c')],_0x2a4f85['query']);_0x2c4e8c[_0x6700('0x4f')]=_[_0x6700('0x4e')](_0x2a4f85[_0x6700('0x4c')],qs['fields'](_0x46b564[_0x6700('0x4d')][_0x6700('0x50')]));_0x2c4e8c[_0x6700('0x4f')]=_0x2c4e8c['attributes']['length']?_0x2c4e8c[_0x6700('0x4f')]:_0x2a4f85['model'];if(!_0x46b564['query'][_0x6700('0x52')]('nolimit')){_0x2c4e8c['limit']=qs[_0x6700('0x35')](_0x46b564[_0x6700('0x4d')][_0x6700('0x35')]);_0x2c4e8c[_0x6700('0x37')]=qs[_0x6700('0x37')](_0x46b564[_0x6700('0x4d')][_0x6700('0x37')]);}_0x2c4e8c[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x46b564[_0x6700('0x4d')][_0x6700('0x54')]);_0x2c4e8c[_0x6700('0x55')]=qs['filters'](_[_0x6700('0x57')](_0x46b564[_0x6700('0x4d')],_0x2a4f85[_0x6700('0x56')]));_0x2c4e8c[_0x6700('0x55')]['SmsAccountId']=_0x17b61b['id'];if(_0x46b564[_0x6700('0x4d')][_0x6700('0x59')]){_0x2c4e8c[_0x6700('0x55')]=_[_0x6700('0x60')](_0x2c4e8c[_0x6700('0x55')],{'$or':_[_0x6700('0x47')](_0x2c4e8c['attributes'],function(_0x3fce79){var _0x1bb910={};_0x1bb910[_0x3fce79]={'$like':'%'+_0x46b564[_0x6700('0x4d')][_0x6700('0x59')]+'%'};return _0x1bb910;})});}_0x2c4e8c=_['merge']({},_0x2c4e8c,_0x46b564[_0x6700('0x5a')]);return db['SmsInteraction'][_0x6700('0x36')]({'where':_0x2c4e8c[_0x6700('0x55')]})[_0x6700('0x25')](function(_0x2b5574){_0x5deb26['count']=_0x2b5574;if(_0x46b564['query']['includeAll']){_0x2c4e8c[_0x6700('0x5c')]=[{'model':db[_0x6700('0x7f')],'as':_0x6700('0xc5'),'required':![]},{'model':db[_0x6700('0xb2')],'as':'Owner','attributes':[_0x6700('0x42'),_0x6700('0xc6'),_0x6700('0xc7')],'required':![]},{'model':db['Tag'],'as':_0x6700('0xc8'),'attributes':['id',_0x6700('0x42'),_0x6700('0xc9')],'where':_0x46b564[_0x6700('0x4d')][_0x6700('0xca')]?{'id':_0x46b564[_0x6700('0x4d')]['tag']}:undefined,'required':_0x46b564[_0x6700('0x4d')][_0x6700('0xca')]?!![]:![]}];}return db[_0x6700('0xa8')][_0x6700('0x5d')](_0x2c4e8c);})[_0x6700('0x25')](function(_0x15f3fe){_0x5deb26[_0x6700('0x5e')]=_0x15f3fe;return _0x5deb26;});}})[_0x6700('0x25')](respondWithFilteredResult(_0x4f5e45,_0x2c4e8c))[_0x6700('0x30')](handleError(_0x4f5e45,null));};exports[_0x6700('0x43')]=function(_0x26bd90,_0x1f2d4d,_0x3873dc){var _0x512f22,_0x1841b7,_0x5e4c1a;if(_[_0x6700('0x9d')](_0x26bd90[_0x6700('0x62')][_0x6700('0x62')])||_0x26bd90[_0x6700('0x62')]['body']===''){throw new db[(_0x6700('0x80'))][(_0x6700('0x81'))](_0x6700('0x9e'));}if(_[_0x6700('0x9d')](_0x26bd90[_0x6700('0x62')]['to'])){throw new db['Sequelize'][(_0x6700('0x81'))](_0x6700('0xcb'));}_0x512f22=_0x26bd90[_0x6700('0x62')]['to'];return db[_0x6700('0x48')]['find']({'where':{'id':_0x26bd90[_0x6700('0x5f')]['id']},'include':[{'model':db[_0x6700('0xa2')],'as':_0x6700('0xcc'),'include':[{'model':db[_0x6700('0x7f')],'as':'Contacts','where':{'mobile':_0x512f22},'limit':0x1,'order':[[_0x6700('0x84'),_0x6700('0xcd')]]}]}]})['then'](handleEntityNotFound(_0x1f2d4d,null))[_0x6700('0x25')](function(_0x5ba7c2){if(_0x5ba7c2&&_0x5ba7c2[_0x6700('0xcc')]){_0x1841b7=_0x5ba7c2[_0x6700('0x63')]({'plain':!![]});if(_0x1841b7['List']&&_0x1841b7[_0x6700('0xcc')][_0x6700('0xa3')]['length']){return _0x1841b7['List'][_0x6700('0xa3')][0x0];}return db[_0x6700('0x7f')][_0x6700('0x61')](_[_0x6700('0xa6')](_0x26bd90[_0x6700('0x62')],{'firstName':_0x512f22,'mobile':_0x512f22,'phone':_0x512f22,'ListId':_0x1841b7[_0x6700('0x86')]}));}})['then'](handleEntityNotFound(_0x1f2d4d,null))[_0x6700('0x25')](function(_0x1fe027){if(_0x1fe027){_0x5e4c1a=_0x1fe027;return db[_0x6700('0xa8')][_0x6700('0x67')]({'where':{'ContactId':_0x5e4c1a['id'],'closed':![],'SmsAccountId':_0x1841b7['id']}})[_0x6700('0x25')](function(_0x3ba6f5){if(_0x3ba6f5){return[_0x3ba6f5,![]];}return db['SmsInteraction'][_0x6700('0x61')]({'UserId':_0x26bd90['user']['id'],'ContactId':_0x5e4c1a['id'],'SmsAccountId':_0x1841b7['id'],'phone':_0x512f22,'firstMsgDirection':_0x6700('0xce'),'Messages':[_[_0x6700('0x60')](_0x26bd90['body'],{'read':![],'body':_0x26bd90['body'][_0x6700('0x62')],'phone':_0x512f22,'SmsAccountId':_0x1841b7['id'],'UserId':_0x26bd90[_0x6700('0x66')]['id'],'ContactId':_0x5e4c1a['id']})]},{'include':[{'model':db[_0x6700('0xaf')],'as':'Messages'}]})[_0x6700('0x25')](function(_0x3abdcc){return[_0x3abdcc,!![]];});});}})['spread'](function(_0x340cc9,_0x1ad020){if(_0x1ad020){return _0x340cc9;}return db[_0x6700('0xaf')]['create'](_[_0x6700('0x60')](_0x26bd90[_0x6700('0x62')],{'read':![],'body':_0x26bd90[_0x6700('0x62')][_0x6700('0x62')],'phone':_0x512f22,'SmsAccountId':_0x1841b7['id'],'SmsInteractionId':_0x340cc9['id'],'UserId':_0x26bd90[_0x6700('0x66')]['id'],'ContactId':_0x5e4c1a['id']}))['then'](function(_0x2f2221){_0x340cc9['dataValues'][_0x6700('0xcf')]=[];_0x340cc9[_0x6700('0xd0')][_0x6700('0xcf')][_0x6700('0xd1')](_0x2f2221['dataValues']);return _0x340cc9;});})[_0x6700('0x25')](respondWithResult(_0x1f2d4d,null))[_0x6700('0x30')](handleError(_0x1f2d4d,null));};exports[_0x6700('0x38')]=function(_0x3dd1b2,_0x587729,_0x993bfe){if(_0x3dd1b2[_0x6700('0x62')]['id']){delete _0x3dd1b2[_0x6700('0x62')]['id'];}var _0x32c848,_0x3d313f,_0x4c1a81;return db['SmsAccount'][_0x6700('0x67')]({'where':{'id':_0x3dd1b2[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x587729,null))['then'](function(_0x318c60){if(_0x318c60){_0x4c1a81=_0x318c60;logger[_0x6700('0x29')](_0x6700('0x2a'),_0x6700('0x38'),_0x6700('0xd2'),_0x318c60[_0x6700('0x58')],util[_0x6700('0xd3')](_0x3dd1b2[_0x6700('0x62')],{'showHidden':![],'depth':null}));switch(_0x318c60[_0x6700('0x58')]){case'skebby':if(_0x3dd1b2[_0x6700('0x62')]['skebby_dispatch_id']&&_0x3dd1b2[_0x6700('0x62')][_0x6700('0x38')]){_0x3d313f=_0x3dd1b2['body']['status'];return db[_0x6700('0xaf')][_0x6700('0x67')]({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')][_0x6700('0xd4')]}});}break;case _0x6700('0x8e'):if(_0x3dd1b2[_0x6700('0x62')][_0x6700('0xd5')]&&_0x3dd1b2['body'][_0x6700('0xd6')]){_0x3d313f=_0x3dd1b2[_0x6700('0x62')]['statusInt'];return db[_0x6700('0xaf')]['find']({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')]['requestid']}});}break;case _0x6700('0x90'):if(_0x3dd1b2[_0x6700('0x62')][_0x6700('0xd7')]&&_0x3dd1b2[_0x6700('0x62')][_0x6700('0xd8')]){_0x3d313f=_0x3dd1b2[_0x6700('0x62')]['status_code'];return db[_0x6700('0xaf')][_0x6700('0x67')]({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')][_0x6700('0xd7')]}});}break;case _0x6700('0x94'):var _0x10e4ee=_0x3dd1b2[_0x6700('0x62')]['results'][0x0];if(_0x10e4ee[_0x6700('0x8b')]&&_0x10e4ee[_0x6700('0x38')]['groupName']===_0x6700('0xd9')){_0x3d313f=_0x10e4ee[_0x6700('0x38')]['groupName'];return db['SmsMessage'][_0x6700('0x67')]({'where':{'messageId':_0x10e4ee[_0x6700('0x8b')]}});}break;case _0x6700('0xda'):if(_0x3dd1b2[_0x6700('0x62')]['messageId']&&_0x3dd1b2['body']['status']){_0x3d313f=_0x3dd1b2[_0x6700('0x62')][_0x6700('0x38')];return db['SmsMessage'][_0x6700('0x67')]({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')][_0x6700('0x8b')]}});}break;case'bandwidth':if(_0x3dd1b2[_0x6700('0x62')][0x0][_0x6700('0x2e')]['id']){_0x3d313f=_0x3dd1b2[_0x6700('0x62')][0x0][_0x6700('0x58')];return db[_0x6700('0xaf')][_0x6700('0x67')]({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')][0x0][_0x6700('0x2e')]['id']}});}break;case _0x6700('0x9b'):if(_0x3dd1b2['body'][_0x6700('0xdb')]&&_0x3dd1b2[_0x6700('0x62')][_0x6700('0x38')]){_0x3d313f=_0x3dd1b2['body'][_0x6700('0x38')];return db[_0x6700('0xaf')][_0x6700('0x67')]({'where':{'messageId':_0x3dd1b2[_0x6700('0x62')][_0x6700('0xdb')]}});}break;}}})[_0x6700('0x25')](handleEntityNotFound(_0x587729,null))[_0x6700('0x25')](function(_0x5bb032){if(_0x5bb032){_0x32c848=_0x5bb032;switch(_0x4c1a81[_0x6700('0x58')]){case _0x6700('0x8c'):if(_0x3d313f==='DELIVERED'){return _0x32c848['update']({'read':!![]});}else{logger[_0x6700('0x2c')](_0x6700('0x2a'),_0x6700('0x38'),'skebby',util['inspect'](_0x3dd1b2[_0x6700('0x62')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x3d313f==='1'){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')](_0x6700('0x2a'),_0x6700('0x38'),_0x6700('0x8c'),util[_0x6700('0xd3')](_0x3dd1b2['body'],{'showHidden':![],'depth':null}));}break;case _0x6700('0x90'):if(!_0x3dd1b2['body'][_0x6700('0xdc')]&&_0x3d313f>=0xc8&&_0x3d313f<=0xce){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')](_0x6700('0x2a'),_0x6700('0x38'),_0x6700('0x90'),util['inspect'](_0x3dd1b2['body'],{'showHidden':![],'depth':null}));}break;case _0x6700('0x94'):var _0x1b3768=_0x3dd1b2[_0x6700('0x62')]['results'][0x0];if(_0x1b3768[_0x6700('0x38')][_0x6700('0xdd')]==='DELIVERED'){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6700('0x38'),_0x6700('0x94'),util[_0x6700('0xd3')](_0x3dd1b2['body'],{'showHidden':![],'depth':null}));}break;case _0x6700('0xda'):if(_0x3d313f=='DELIVERED_TO_GATEWAY'||_0x3d313f==_0x6700('0xde')){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6700('0x38'),_0x6700('0xda'),util[_0x6700('0xd3')](_0x3dd1b2[_0x6700('0x62')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3d313f=='message-delivered'){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger['error'](_0x6700('0x2a'),_0x6700('0x38'),'bandwidth',util[_0x6700('0xd3')](_0x3dd1b2[_0x6700('0x62')],{'showHidden':![],'depth':null}));}break;case _0x6700('0x9b'):if(_0x3d313f===_0x6700('0xdf')||_0x3d313f==='ACCEPTD'){return _0x32c848[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6700('0x38'),_0x6700('0x9b'),util[_0x6700('0xd3')](_0x3dd1b2[_0x6700('0x62')],{'showHidden':![],'depth':null}));}break;}return _0x32c848;}})['then'](respondWithResult(_0x587729,null))[_0x6700('0x30')](handleError(_0x587729,null));};exports['statusGet']=function(_0x54ac3e,_0x23530d,_0x2370f2){var _0x2b3076,_0x46a8cb,_0x23f021;return db['SmsAccount']['find']({'where':{'id':_0x54ac3e[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x23530d,null))['then'](function(_0x36d53b){if(_0x36d53b){_0x23f021=_0x36d53b;logger[_0x6700('0x29')](_0x6700('0x2a'),_0x6700('0x38'),'received\x20delivery\x20report\x20from',_0x36d53b[_0x6700('0x58')],util[_0x6700('0xd3')](_0x54ac3e[_0x6700('0x4d')],{'showHidden':![],'depth':null}));switch(_0x36d53b[_0x6700('0x58')]){case _0x6700('0xe0'):if(_0x54ac3e[_0x6700('0x4d')][_0x6700('0xe1')]&&_0x54ac3e[_0x6700('0x4d')][_0x6700('0xe2')]){_0x46a8cb=_0x54ac3e[_0x6700('0x4d')]['state'];return db[_0x6700('0xaf')]['find']({'where':{'messageId':_0x54ac3e[_0x6700('0x4d')][_0x6700('0xe1')]}});}break;}}})[_0x6700('0x25')](handleEntityNotFound(_0x23530d,null))[_0x6700('0x25')](function(_0x4b7976){if(_0x4b7976){_0x2b3076=_0x4b7976;switch(_0x23f021['type']){case _0x6700('0xe0'):if(_0x46a8cb==='2'||_0x46a8cb==='6'){return _0x2b3076[_0x6700('0x3d')]({'read':!![]});}else{logger[_0x6700('0x2c')](_0x6700('0x2a'),_0x6700('0x38'),_0x6700('0xe0'),util['inspect'](_0x54ac3e[_0x6700('0x4d')],{'showHidden':![],'depth':null}));};break;}return _0x2b3076;}})[_0x6700('0x25')](respondWithResult(_0x23530d,null))[_0x6700('0x30')](handleError(_0x23530d,null));};exports[_0x6700('0xe3')]=function(_0x1d66c8,_0x1e1468,_0x466ef7){return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x1d66c8[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x1e1468,null))['then'](function(_0x8153fe){if(_0x8153fe){return _0x8153fe[_0x6700('0xe3')](_0x1d66c8[_0x6700('0x62')][_0x6700('0x71')],_[_0x6700('0xa5')](_0x1d66c8[_0x6700('0x62')],[_0x6700('0x71'),'id'])||{})[_0x6700('0xe4')](function(_0x566efa){for(var _0x1d3d6f=0x0;_0x1d3d6f<_0x1d66c8[_0x6700('0x62')]['ids'][_0x6700('0x51')];_0x1d3d6f+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x1d66c8[_0x6700('0x62')]['ids'][_0x1d3d6f]),'SmsAccountId':Number(_0x1d66c8[_0x6700('0x5f')]['id'])});}return _0x566efa;});}})[_0x6700('0x25')](respondWithResult(_0x1e1468,null))[_0x6700('0x30')](handleError(_0x1e1468,null));};exports[_0x6700('0xe5')]=function(_0x460d92,_0x3fc78a,_0x565175){return db[_0x6700('0x48')][_0x6700('0x67')]({'where':{'id':_0x460d92['params']['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x3fc78a,null))[_0x6700('0x25')](function(_0x355b8f){if(_0x355b8f){return _0x355b8f['removeAgents'](_0x460d92['query'][_0x6700('0x71')])[_0x6700('0x25')](function(){if(_[_0x6700('0xe6')](_0x460d92[_0x6700('0x4d')][_0x6700('0x71')])){for(var _0x5cd4b0=0x0;_0x5cd4b0<_0x460d92['query'][_0x6700('0x71')]['length'];_0x5cd4b0+=0x1){socket[_0x6700('0xe7')](_0x6700('0xe8'),{'UserId':Number(_0x460d92[_0x6700('0x4d')][_0x6700('0x71')][_0x5cd4b0]),'SmsAccountId':Number(_0x460d92['params']['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x460d92['query'][_0x6700('0x71')]),'SmsAccountId':Number(_0x460d92[_0x6700('0x5f')]['id'])});}});}})[_0x6700('0x25')](respondWithStatusCode(_0x3fc78a,null))[_0x6700('0x30')](handleError(_0x3fc78a,null));};exports['getAgents']=function(_0x5bc419,_0x53b65a,_0x45fa41){var _0x307b68={};var _0x14ca58={};var _0x174e25;var _0x592176;return db['SmsAccount'][_0x6700('0x6d')]({'where':{'id':_0x5bc419[_0x6700('0x5f')]['id']}})[_0x6700('0x25')](handleEntityNotFound(_0x53b65a,null))[_0x6700('0x25')](function(_0x453b47){if(_0x453b47){_0x174e25=_0x453b47;_0x14ca58[_0x6700('0x4c')]=_[_0x6700('0x6e')](db[_0x6700('0xb2')][_0x6700('0x49')]);_0x14ca58[_0x6700('0x4d')]=_[_0x6700('0x6e')](_0x5bc419[_0x6700('0x4d')]);_0x14ca58[_0x6700('0x56')]=_['intersection'](_0x14ca58['model'],_0x14ca58[_0x6700('0x4d')]);_0x307b68[_0x6700('0x4f')]=_[_0x6700('0x4e')](_0x14ca58['model'],qs[_0x6700('0x50')](_0x5bc419[_0x6700('0x4d')][_0x6700('0x50')]));_0x307b68[_0x6700('0x4f')]=_0x307b68[_0x6700('0x4f')][_0x6700('0x51')]?_0x307b68[_0x6700('0x4f')]:_0x14ca58['model'];_0x307b68[_0x6700('0x53')]=qs[_0x6700('0x54')](_0x5bc419[_0x6700('0x4d')][_0x6700('0x54')]);_0x307b68['where']=qs[_0x6700('0x56')](_['pick'](_0x5bc419['query'],_0x14ca58[_0x6700('0x56')]));if(_0x5bc419[_0x6700('0x4d')][_0x6700('0x59')]){_0x307b68['where']=_[_0x6700('0x60')](_0x307b68['where'],{'$or':_[_0x6700('0x47')](_0x307b68[_0x6700('0x4f')],function(_0x30c9a2){var _0x3bb8c1={};_0x3bb8c1[_0x30c9a2]={'$like':'%'+_0x5bc419[_0x6700('0x4d')][_0x6700('0x59')]+'%'};return _0x3bb8c1;})});}_0x307b68=_[_0x6700('0x60')]({},_0x307b68,_0x5bc419[_0x6700('0x5a')]);return _0x174e25[_0x6700('0xe9')](_0x307b68);}})[_0x6700('0x25')](function(_0x18eb8f){if(_0x18eb8f){_0x592176=_0x18eb8f['length'];if(!_0x5bc419[_0x6700('0x4d')][_0x6700('0x52')]('nolimit')){_0x307b68[_0x6700('0x35')]=qs[_0x6700('0x35')](_0x5bc419[_0x6700('0x4d')][_0x6700('0x35')]);_0x307b68[_0x6700('0x37')]=qs[_0x6700('0x37')](_0x5bc419[_0x6700('0x4d')][_0x6700('0x37')]);}return _0x174e25[_0x6700('0xe9')](_0x307b68);}})[_0x6700('0x25')](function(_0x1dc426){if(_0x1dc426){return _0x1dc426?{'count':_0x592176,'rows':_0x1dc426}:null;}})[_0x6700('0x25')](respondWithResult(_0x53b65a,null))['catch'](handleError(_0x53b65a,null));};
\ No newline at end of file
+var _0x9453=['List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','infobip','DELIVERED','groupName','clickatell','redif','SmsAccount,\x20%s,\x20%s,\x20%s','error_code','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','jayson/promise','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','destroy','get','SmsAccounts','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','SmsAccount','findAll','show','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','create','update','params','describe','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','account','applications','orderBy','priority','asc','Applications','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','mobile','from','From','Body','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','messageId','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','CmContact','SmsInteraction','spread','interaction','created','autoclose','push','*,*,*,*','SmsMessage','ContactId','UserId','agent','Start','startRouting','receiveMessage','twilio','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','Transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory'];(function(_0x5cc53f,_0x2652f8){var _0x3a0d7c=function(_0x12623b){while(--_0x12623b){_0x5cc53f['push'](_0x5cc53f['shift']());}};_0x3a0d7c(++_0x2652f8);}(_0x9453,0x1ed));var _0x3945=function(_0x1998d9,_0x40c1ea){_0x1998d9=_0x1998d9-0x0;var _0x31e64e=_0x9453[_0x1998d9];return _0x31e64e;};'use strict';var emlformat=require(_0x3945('0x0'));var rimraf=require(_0x3945('0x1'));var zipdir=require(_0x3945('0x2'));var jsonpatch=require(_0x3945('0x3'));var rp=require(_0x3945('0x4'));var moment=require(_0x3945('0x5'));var BPromise=require(_0x3945('0x6'));var Mustache=require(_0x3945('0x7'));var util=require(_0x3945('0x8'));var path=require(_0x3945('0x9'));var sox=require(_0x3945('0xa'));var csv=require('to-csv');var ejs=require(_0x3945('0xb'));var fs=require('fs');var fs_extra=require(_0x3945('0xc'));var _=require(_0x3945('0xd'));var squel=require(_0x3945('0xe'));var crypto=require(_0x3945('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x3945('0x10'));var toCsv=require(_0x3945('0x11'));var querystring=require(_0x3945('0x12'));var Papa=require(_0x3945('0x13'));var Redis=require('ioredis');var authService=require(_0x3945('0x14'));var qs=require(_0x3945('0x15'));var as=require(_0x3945('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3945('0x17'))(_0x3945('0x18'));var utils=require(_0x3945('0x19'));var config=require(_0x3945('0x1a'));var licenseUtil=require(_0x3945('0x1b'));var db=require('../../mysqldb')['db'];config[_0x3945('0x1c')]=_['defaults'](config[_0x3945('0x1c')],{'host':_0x3945('0x1d'),'port':0x18eb});var socket=require(_0x3945('0x1e'))(new Redis(config[_0x3945('0x1c')]));require('./smsAccount.socket')[_0x3945('0x1f')](socket);var jayson=require(_0x3945('0x20'));var client=jayson['client'][_0x3945('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2916e2,_0x47e7e9,_0x44e440,_0x52e148){return new BPromise(function(_0x37224c,_0x497e36){var _0x53999e=_0x52e148||client;return _0x53999e['request'](_0x2916e2,_0x44e440)[_0x3945('0x22')](function(_0x492fa9){logger[_0x3945('0x23')](_0x3945('0x24'),_0x47e7e9,_0x3945('0x25'));logger[_0x3945('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47e7e9,_0x3945('0x25'),JSON[_0x3945('0x27')](_0x492fa9));if(_0x492fa9[_0x3945('0x28')]){if(_0x492fa9[_0x3945('0x28')][_0x3945('0x29')]===0x1f4){logger['error'](_0x3945('0x24'),_0x47e7e9,_0x492fa9['error'][_0x3945('0x2a')]);return _0x497e36(_0x492fa9[_0x3945('0x28')][_0x3945('0x2a')]);}logger[_0x3945('0x28')](_0x3945('0x24'),_0x47e7e9,_0x492fa9['error'][_0x3945('0x2a')]);return _0x37224c(_0x492fa9['error'][_0x3945('0x2a')]);}else{logger[_0x3945('0x23')](_0x3945('0x24'),_0x47e7e9,_0x3945('0x25'));_0x37224c(_0x492fa9[_0x3945('0x2b')][_0x3945('0x2a')]);}})[_0x3945('0x2c')](function(_0x4d6b27){logger[_0x3945('0x28')](_0x3945('0x24'),_0x47e7e9,_0x4d6b27);_0x497e36(_0x4d6b27);});});}function respondWithStatusCode(_0x5563c4,_0xc864fe){_0xc864fe=_0xc864fe||0xcc;return function(_0x1afc3d){if(_0x1afc3d){return _0x5563c4['sendStatus'](_0xc864fe);}return _0x5563c4[_0x3945('0x2d')](_0xc864fe)[_0x3945('0x2e')]();};}function respondWithResult(_0x1d993f,_0x1006d7){_0x1006d7=_0x1006d7||0xc8;return function(_0x23d1fe){if(_0x23d1fe){return _0x1d993f['status'](_0x1006d7)[_0x3945('0x2f')](_0x23d1fe);}};}function respondWithFilteredResult(_0x103900,_0x3f626d){return function(_0x472172){if(_0x472172){var _0x3042af=typeof _0x3f626d[_0x3945('0x30')]==='undefined'&&typeof _0x3f626d[_0x3945('0x31')]===_0x3945('0x32');var _0x18ba1f=_0x472172[_0x3945('0x33')];var _0xcc9460=_0x3042af?0x0:_0x3f626d['offset'];var _0x144b82=_0x3042af?_0x472172[_0x3945('0x33')]:_0x3f626d['offset']+_0x3f626d[_0x3945('0x31')];var _0x249330;if(_0x144b82>=_0x18ba1f){_0x144b82=_0x18ba1f;_0x249330=0xc8;}else{_0x249330=0xce;}_0x103900[_0x3945('0x2d')](_0x249330);return _0x103900[_0x3945('0x34')](_0x3945('0x35'),_0xcc9460+'-'+_0x144b82+'/'+_0x18ba1f)['json'](_0x472172);}return null;};}function patchUpdates(_0x3056e3){return function(_0x2f25e1){try{jsonpatch[_0x3945('0x36')](_0x2f25e1,_0x3056e3,!![]);}catch(_0x3b5995){return BPromise[_0x3945('0x37')](_0x3b5995);}return _0x2f25e1['save']();};}function saveUpdates(_0x2d9dc1,_0x9c059f){return function(_0x3fe47b){if(_0x3fe47b){return _0x3fe47b['update'](_0x2d9dc1)[_0x3945('0x22')](function(_0x4fb63b){return _0x4fb63b;});}return null;};}function removeEntity(_0x50064e,_0x5da29c){return function(_0x252dff){if(_0x252dff){return _0x252dff[_0x3945('0x38')]()[_0x3945('0x22')](function(){var _0x97ace3=_0x252dff[_0x3945('0x39')]({'plain':!![]});var _0x5c8927=_0x3945('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x5c8927,'resourceId':_0x97ace3['id']}})[_0x3945('0x22')](function(){return _0x252dff;});})['then'](function(){_0x50064e[_0x3945('0x2d')](0xcc)[_0x3945('0x2e')]();});}};}function handleEntityNotFound(_0x18c6f2,_0x20ab6f){return function(_0x487a87){if(!_0x487a87){_0x18c6f2[_0x3945('0x3b')](0x194);}return _0x487a87;};}function handleError(_0xa125a5,_0x54db13){_0x54db13=_0x54db13||0x1f4;return function(_0x530267){logger['error'](_0x530267[_0x3945('0x3c')]);if(_0x530267['name']){delete _0x530267[_0x3945('0x3d')];}_0xa125a5[_0x3945('0x2d')](_0x54db13)['send'](_0x530267);};}exports[_0x3945('0x3e')]=function(_0x49bcf9,_0x4d1207){var _0x4e185e={'include':[{'model':db[_0x3945('0x3f')],'as':_0x3945('0x40')}]},_0x4f1677={},_0x5d382b={'count':0x0,'rows':[]};var _0x3b0b43=_[_0x3945('0x41')](db['SmsAccount'][_0x3945('0x42')],function(_0x3798ae){return{'name':_0x3798ae[_0x3945('0x43')],'type':_0x3798ae[_0x3945('0x44')]['key']};});_0x4f1677[_0x3945('0x45')]=_['map'](_0x3b0b43,_0x3945('0x3d'));_0x4f1677[_0x3945('0x46')]=_[_0x3945('0x47')](_0x49bcf9[_0x3945('0x46')]);_0x4f1677[_0x3945('0x48')]=_['intersection'](_0x4f1677[_0x3945('0x45')],_0x4f1677['query']);_0x4e185e['attributes']=_[_0x3945('0x49')](_0x4f1677[_0x3945('0x45')],qs['fields'](_0x49bcf9[_0x3945('0x46')][_0x3945('0x4a')]));_0x4e185e[_0x3945('0x4b')]=_0x4e185e[_0x3945('0x4b')][_0x3945('0x4c')]?_0x4e185e['attributes']:_0x4f1677['model'];if(!_0x49bcf9['query']['hasOwnProperty'](_0x3945('0x4d'))){_0x4e185e[_0x3945('0x31')]=qs[_0x3945('0x31')](_0x49bcf9[_0x3945('0x46')][_0x3945('0x31')]);_0x4e185e['offset']=qs[_0x3945('0x30')](_0x49bcf9['query']['offset']);}_0x4e185e['order']=qs[_0x3945('0x4e')](_0x49bcf9['query'][_0x3945('0x4e')]);_0x4e185e[_0x3945('0x4f')]=qs['filters'](_['pick'](_0x49bcf9[_0x3945('0x46')],_0x4f1677[_0x3945('0x48')]),_0x3b0b43);if(_0x49bcf9[_0x3945('0x46')]['filter']){_0x4e185e[_0x3945('0x4f')]=_[_0x3945('0x50')](_0x4e185e[_0x3945('0x4f')],{'$or':_[_0x3945('0x41')](_0x3b0b43,function(_0x929141){if(_0x929141[_0x3945('0x44')]!==_0x3945('0x51')){var _0x3bf5e3={};_0x3bf5e3[_0x929141['name']]={'$like':'%'+_0x49bcf9[_0x3945('0x46')][_0x3945('0x52')]+'%'};return _0x3bf5e3;}})});}_0x4e185e=_[_0x3945('0x50')]({},_0x4e185e,_0x49bcf9[_0x3945('0x53')]);var _0x77a588={'where':_0x4e185e['where']};return db['SmsAccount'][_0x3945('0x33')](_0x77a588)[_0x3945('0x22')](function(_0x332f53){_0x5d382b[_0x3945('0x33')]=_0x332f53;if(_0x49bcf9[_0x3945('0x46')][_0x3945('0x54')]){_0x4e185e[_0x3945('0x55')]=[{'all':!![]}];}return db[_0x3945('0x56')][_0x3945('0x57')](_0x4e185e);})[_0x3945('0x22')](function(_0x5af32d){_0x5d382b['rows']=_0x5af32d;return _0x5d382b;})[_0x3945('0x22')](respondWithFilteredResult(_0x4d1207,_0x4e185e))['catch'](handleError(_0x4d1207,null));};exports[_0x3945('0x58')]=function(_0x5d089a,_0x16a097){var _0x3a8ab4={'raw':![],'where':{'id':_0x5d089a['params']['id']},'include':[{'model':db[_0x3945('0x3f')],'as':_0x3945('0x40')}]},_0x2ccc1a={};_0x2ccc1a[_0x3945('0x45')]=_[_0x3945('0x47')](db['SmsAccount'][_0x3945('0x42')]);_0x2ccc1a[_0x3945('0x46')]=_[_0x3945('0x47')](_0x5d089a[_0x3945('0x46')]);_0x2ccc1a[_0x3945('0x48')]=_[_0x3945('0x49')](_0x2ccc1a[_0x3945('0x45')],_0x2ccc1a[_0x3945('0x46')]);_0x3a8ab4[_0x3945('0x4b')]=_[_0x3945('0x49')](_0x2ccc1a['model'],qs['fields'](_0x5d089a['query'][_0x3945('0x4a')]));_0x3a8ab4[_0x3945('0x4b')]=_0x3a8ab4[_0x3945('0x4b')]['length']?_0x3a8ab4[_0x3945('0x4b')]:_0x2ccc1a[_0x3945('0x45')];if(_0x5d089a['query']['includeAll']){_0x3a8ab4[_0x3945('0x55')]=[{'all':!![]}];}_0x3a8ab4=_[_0x3945('0x50')]({},_0x3a8ab4,_0x5d089a['options']);return db['SmsAccount'][_0x3945('0x59')](_0x3a8ab4)[_0x3945('0x22')](handleEntityNotFound(_0x16a097,null))[_0x3945('0x22')](respondWithResult(_0x16a097,null))[_0x3945('0x2c')](handleError(_0x16a097,null));};exports['create']=function(_0x350132,_0x21830c){return db['SmsAccount']['create'](_0x350132[_0x3945('0x5a')],{})['then'](function(_0x3819bd){var _0x465851=_0x350132[_0x3945('0x5b')][_0x3945('0x39')]({'plain':!![]});if(!_0x465851)throw new Error(_0x3945('0x5c'));if(_0x465851['role']===_0x3945('0x5b')){var _0x231186=_0x3819bd[_0x3945('0x39')]({'plain':!![]});var _0x3c644f=_0x3945('0x3a');return db['UserProfileSection'][_0x3945('0x59')]({'where':{'name':_0x3c644f,'userProfileId':_0x465851[_0x3945('0x5d')]},'raw':!![]})['then'](function(_0x37e9d9){if(_0x37e9d9&&_0x37e9d9[_0x3945('0x5e')]===0x0){return db[_0x3945('0x5f')][_0x3945('0x60')]({'name':_0x231186[_0x3945('0x3d')],'resourceId':_0x231186['id'],'type':_0x37e9d9['name'],'sectionId':_0x37e9d9['id']},{})[_0x3945('0x22')](function(){return _0x3819bd;});}else{return _0x3819bd;}})['catch'](function(_0x5bb4ba){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bb4ba);throw _0x5bb4ba;});}return _0x3819bd;})[_0x3945('0x22')](respondWithResult(_0x21830c,0xc9))[_0x3945('0x2c')](handleError(_0x21830c,null));};exports[_0x3945('0x61')]=function(_0x2079e3,_0x35ec77){if(_0x2079e3['body']['id']){delete _0x2079e3[_0x3945('0x5a')]['id'];}return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0x2079e3[_0x3945('0x62')]['id']},'include':[{'model':db[_0x3945('0x3f')],'as':_0x3945('0x40')}]})['then'](handleEntityNotFound(_0x35ec77,null))[_0x3945('0x22')](saveUpdates(_0x2079e3['body'],null))['then'](respondWithResult(_0x35ec77,null))[_0x3945('0x2c')](handleError(_0x35ec77,null));};exports[_0x3945('0x38')]=function(_0x520185,_0x17b5bc){return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0x520185[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x17b5bc,null))['then'](removeEntity(_0x17b5bc,null))[_0x3945('0x2c')](handleError(_0x17b5bc,null));};exports[_0x3945('0x63')]=function(_0x229da3,_0x1c62f4){return db[_0x3945('0x56')][_0x3945('0x63')]()[_0x3945('0x22')](respondWithResult(_0x1c62f4,null))[_0x3945('0x2c')](handleError(_0x1c62f4,null));};exports['addDisposition']=function(_0x14f36a,_0x177bb9,_0x140280){if(_0x14f36a[_0x3945('0x5a')]['id']){delete _0x14f36a[_0x3945('0x5a')]['id'];}return db['SmsAccount'][_0x3945('0x59')]({'where':{'id':_0x14f36a[_0x3945('0x62')]['id']}})['then'](handleEntityNotFound(_0x177bb9,null))['then'](function(_0x21f6ca){if(_0x21f6ca){_0x14f36a[_0x3945('0x5a')][_0x3945('0x64')]=_0x21f6ca['id'];return db[_0x3945('0x65')][_0x3945('0x60')](_0x14f36a[_0x3945('0x5a')]);}})[_0x3945('0x22')](respondWithResult(_0x177bb9,null))[_0x3945('0x2c')](handleError(_0x177bb9,null));};exports[_0x3945('0x66')]=function(_0x336573,_0x4d6c08,_0x4d535a){var _0x192bfd={'raw':![],'where':{}};var _0x97fa9c={};var _0x20ddfc={'count':0x0,'rows':[]};return db[_0x3945('0x56')][_0x3945('0x67')]({'where':{'id':_0x336573[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x4d6c08,null))[_0x3945('0x22')](function(_0x263aa8){if(_0x263aa8){_0x97fa9c[_0x3945('0x45')]=_[_0x3945('0x47')](db[_0x3945('0x65')][_0x3945('0x42')]);_0x97fa9c[_0x3945('0x46')]=_['keys'](_0x336573[_0x3945('0x46')]);_0x97fa9c[_0x3945('0x48')]=_['intersection'](_0x97fa9c[_0x3945('0x45')],_0x97fa9c[_0x3945('0x46')]);_0x192bfd[_0x3945('0x4b')]=_[_0x3945('0x49')](_0x97fa9c['model'],qs[_0x3945('0x4a')](_0x336573['query'][_0x3945('0x4a')]));_0x192bfd[_0x3945('0x4b')]=_0x192bfd[_0x3945('0x4b')][_0x3945('0x4c')]?_0x192bfd['attributes']:_0x97fa9c['model'];if(!_0x336573[_0x3945('0x46')][_0x3945('0x68')](_0x3945('0x4d'))){_0x192bfd[_0x3945('0x31')]=qs[_0x3945('0x31')](_0x336573[_0x3945('0x46')]['limit']);_0x192bfd['offset']=qs[_0x3945('0x30')](_0x336573[_0x3945('0x46')][_0x3945('0x30')]);}_0x192bfd[_0x3945('0x69')]=qs['sort'](_0x336573[_0x3945('0x46')][_0x3945('0x4e')]);_0x192bfd[_0x3945('0x4f')]=qs[_0x3945('0x48')](_[_0x3945('0x6a')](_0x336573['query'],_0x97fa9c[_0x3945('0x48')]));_0x192bfd[_0x3945('0x4f')][_0x3945('0x64')]=_0x263aa8['id'];if(_0x336573[_0x3945('0x46')][_0x3945('0x52')]){_0x192bfd['where']=_[_0x3945('0x50')](_0x192bfd['where'],{'$or':_[_0x3945('0x41')](_0x192bfd['attributes'],function(_0x2e1c58){var _0x4aab15={};_0x4aab15[_0x2e1c58]={'$like':'%'+_0x336573['query'][_0x3945('0x52')]+'%'};return _0x4aab15;})});}_0x192bfd=_[_0x3945('0x50')]({},_0x192bfd,_0x336573[_0x3945('0x53')]);return db[_0x3945('0x65')][_0x3945('0x33')]({'where':_0x192bfd[_0x3945('0x4f')]})[_0x3945('0x22')](function(_0xe6324d){_0x20ddfc[_0x3945('0x33')]=_0xe6324d;if(_0x336573[_0x3945('0x46')][_0x3945('0x54')]){_0x192bfd[_0x3945('0x55')]=[{'all':!![]}];}return db[_0x3945('0x65')]['findAll'](_0x192bfd);})[_0x3945('0x22')](function(_0x15cb1e){_0x20ddfc[_0x3945('0x6b')]=_0x15cb1e;return _0x20ddfc;});}})['then'](respondWithFilteredResult(_0x4d6c08,_0x192bfd))['catch'](handleError(_0x4d6c08,null));};exports['removeDispositions']=function(_0x26e6cd,_0x39bc0e,_0x1e0f6b){return db['SmsAccount'][_0x3945('0x59')]({'where':{'id':_0x26e6cd[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x39bc0e,null))[_0x3945('0x22')](function(_0x57cb19){if(_0x57cb19){return _0x57cb19[_0x3945('0x6c')](_0x26e6cd[_0x3945('0x46')][_0x3945('0x6d')]);}})[_0x3945('0x22')](respondWithStatusCode(_0x39bc0e,null))['catch'](handleError(_0x39bc0e,null));};exports[_0x3945('0x6e')]=function(_0x22150d,_0x363e1c,_0x4452e9){if(_0x22150d[_0x3945('0x5a')]['id']){delete _0x22150d[_0x3945('0x5a')]['id'];}return db[_0x3945('0x56')]['find']({'where':{'id':_0x22150d['params']['id']}})['then'](handleEntityNotFound(_0x363e1c,null))['then'](function(_0x43f7cb){if(_0x43f7cb){_0x22150d[_0x3945('0x5a')][_0x3945('0x64')]=_0x43f7cb['id'];return db[_0x3945('0x6f')][_0x3945('0x60')](_0x22150d['body']);}})[_0x3945('0x22')](respondWithResult(_0x363e1c,null))[_0x3945('0x2c')](handleError(_0x363e1c,null));};exports[_0x3945('0x70')]=function(_0x47f943,_0x4d95ec,_0x53efec){var _0x3c7b42={'raw':![],'where':{}};var _0x2fdd2f={};var _0x570c83={'count':0x0,'rows':[]};return db[_0x3945('0x56')][_0x3945('0x67')]({'where':{'id':_0x47f943[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x4d95ec,null))[_0x3945('0x22')](function(_0x22a10a){if(_0x22a10a){_0x2fdd2f[_0x3945('0x45')]=_[_0x3945('0x47')](db[_0x3945('0x6f')]['rawAttributes']);_0x2fdd2f['query']=_[_0x3945('0x47')](_0x47f943[_0x3945('0x46')]);_0x2fdd2f[_0x3945('0x48')]=_['intersection'](_0x2fdd2f[_0x3945('0x45')],_0x2fdd2f[_0x3945('0x46')]);_0x3c7b42[_0x3945('0x4b')]=_[_0x3945('0x49')](_0x2fdd2f['model'],qs[_0x3945('0x4a')](_0x47f943[_0x3945('0x46')]['fields']));_0x3c7b42[_0x3945('0x4b')]=_0x3c7b42[_0x3945('0x4b')][_0x3945('0x4c')]?_0x3c7b42[_0x3945('0x4b')]:_0x2fdd2f['model'];if(!_0x47f943[_0x3945('0x46')]['hasOwnProperty'](_0x3945('0x4d'))){_0x3c7b42['limit']=qs[_0x3945('0x31')](_0x47f943[_0x3945('0x46')][_0x3945('0x31')]);_0x3c7b42['offset']=qs[_0x3945('0x30')](_0x47f943[_0x3945('0x46')]['offset']);}_0x3c7b42[_0x3945('0x69')]=qs['sort'](_0x47f943['query'][_0x3945('0x4e')]);_0x3c7b42[_0x3945('0x4f')]=qs[_0x3945('0x48')](_[_0x3945('0x6a')](_0x47f943[_0x3945('0x46')],_0x2fdd2f[_0x3945('0x48')]));_0x3c7b42['where'][_0x3945('0x64')]=_0x22a10a['id'];if(_0x47f943[_0x3945('0x46')][_0x3945('0x52')]){_0x3c7b42[_0x3945('0x4f')]=_['merge'](_0x3c7b42[_0x3945('0x4f')],{'$or':_[_0x3945('0x41')](_0x3c7b42['attributes'],function(_0x289f04){var _0x17d14e={};_0x17d14e[_0x289f04]={'$like':'%'+_0x47f943[_0x3945('0x46')][_0x3945('0x52')]+'%'};return _0x17d14e;})});}_0x3c7b42=_['merge']({},_0x3c7b42,_0x47f943[_0x3945('0x53')]);return db[_0x3945('0x6f')]['count']({'where':_0x3c7b42['where']})['then'](function(_0x3c0ac3){_0x570c83[_0x3945('0x33')]=_0x3c0ac3;if(_0x47f943['query'][_0x3945('0x54')]){_0x3c7b42[_0x3945('0x55')]=[{'all':!![]}];}return db[_0x3945('0x6f')][_0x3945('0x57')](_0x3c7b42);})['then'](function(_0x552754){_0x570c83[_0x3945('0x6b')]=_0x552754;return _0x570c83;});}})[_0x3945('0x22')](respondWithFilteredResult(_0x4d95ec,_0x3c7b42))[_0x3945('0x2c')](handleError(_0x4d95ec,null));};exports[_0x3945('0x71')]=function(_0x1bcec3,_0x5164b9,_0x555db4){return db[_0x3945('0x56')]['find']({'where':{'id':_0x1bcec3[_0x3945('0x62')]['id']}})['then'](handleEntityNotFound(_0x5164b9,null))[_0x3945('0x22')](function(_0x3952d2){if(_0x3952d2){return _0x3952d2[_0x3945('0x71')](_0x1bcec3[_0x3945('0x46')]['ids']);}})[_0x3945('0x22')](respondWithStatusCode(_0x5164b9,null))[_0x3945('0x2c')](handleError(_0x5164b9,null));};exports[_0x3945('0x72')]=function(_0x2e5a2f,_0x1fb897,_0x4ff2bc){var _0x3b5293={'channel':_0x3945('0x73')};var _0x125c78=[];var _0x78204e=[];var _0x58438c={};return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0x2e5a2f[_0x3945('0x62')]['id']},'include':[{'model':db[_0x3945('0x74')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x1fb897,null))[_0x3945('0x22')](function(_0x47148c){_0x3b5293[_0x3945('0x75')]=_0x47148c;_0x3b5293[_0x3945('0x76')]=_[_0x3945('0x77')](_0x47148c['Applications'],[_0x3945('0x78')],[_0x3945('0x79')]);if(_0x3b5293[_0x3945('0x75')]['Applications']){delete _0x3b5293[_0x3945('0x75')][_0x3945('0x7a')];}return db['CmContact'][_0x3945('0x63')]();})[_0x3945('0x22')](function(_0x513741){if(!_0x513741){throw new db[(_0x3945('0x7b'))][(_0x3945('0x7c'))](_0x3945('0x7d'));}_0x125c78=_[_0x3945('0x7e')](_['keys'](_0x513741),['createdAt',_0x3945('0x7f')]);_0x78204e=_[_0x3945('0x7e')](_[_0x3945('0x47')](_0x513741),[_0x3945('0x80'),_0x3945('0x7f'),_0x3945('0x81'),_0x3945('0x82')]);_0x3b5293[_0x3945('0x5a')]={'mapKey':_0x3945('0x83')};if(_0x3b5293[_0x3945('0x75')][_0x3945('0x44')]){switch(_0x3b5293['account'][_0x3945('0x44')]){case'twilio':_0x3b5293['body'][_0x3945('0x84')]=_0x2e5a2f['body'][_0x3945('0x85')];_0x3b5293['body'][_0x3945('0x5a')]=_0x2e5a2f['body'][_0x3945('0x86')];_0x3b5293[_0x3945('0x5a')]['messageId']=_0x2e5a2f[_0x3945('0x5a')]['MessageSid'];break;case _0x3945('0x87'):_0x3b5293['body']['from']='+'+_0x2e5a2f['body'][_0x3945('0x88')];_0x3b5293[_0x3945('0x5a')][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x89')];break;case _0x3945('0x8a'):_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x84')];_0x3b5293['body'][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x2a')];break;case _0x3945('0x8b'):_0x3b5293[_0x3945('0x5a')]['from']=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x84')];_0x3b5293[_0x3945('0x5a')][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x5a')];_0x3b5293[_0x3945('0x5a')]['messageId']=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x8c')];break;case _0x3945('0x8d'):_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x85')];_0x3b5293[_0x3945('0x5a')]['body']=_0x2e5a2f['body'][_0x3945('0x8e')];_0x3b5293['body'][_0x3945('0x8f')]=_0x2e5a2f[_0x3945('0x5a')]['MessageUUID'];break;case'infobip':_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')]='+'+_0x2e5a2f['body'][_0x3945('0x90')][0x0][_0x3945('0x84')];_0x3b5293[_0x3945('0x5a')][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x90')][0x0]['text'];_0x3b5293[_0x3945('0x5a')][_0x3945('0x8f')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x90')][0x0]['messageId'];break;case _0x3945('0x91'):_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x92')];_0x3b5293[_0x3945('0x5a')][_0x3945('0x5a')]=_0x2e5a2f['body'][_0x3945('0x93')]['message'];break;case'clickatell':_0x3b5293[_0x3945('0x5a')]['from']=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x94')];_0x3b5293['body'][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x89')];_0x3b5293[_0x3945('0x5a')][_0x3945('0x8f')]=_0x2e5a2f['body'][_0x3945('0x95')];break;case _0x3945('0x96'):_0x3b5293[_0x3945('0x5a')][_0x3945('0x8f')]=_0x2e5a2f[_0x3945('0x5a')][0x0][_0x3945('0x2a')]['id'];_0x3b5293[_0x3945('0x5a')]['from']=_0x2e5a2f['body'][0x0][_0x3945('0x2a')][_0x3945('0x84')];_0x3b5293['body'][_0x3945('0x5a')]=_0x2e5a2f[_0x3945('0x5a')][0x0]['message'][_0x3945('0x89')];break;case _0x3945('0x97'):_0x3b5293[_0x3945('0x5a')]['from']=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x84')];_0x3b5293[_0x3945('0x5a')]['body']=_0x2e5a2f['body']['message'];_0x3b5293[_0x3945('0x5a')][_0x3945('0x8f')]=_0x2e5a2f[_0x3945('0x5a')][_0x3945('0x98')];break;}}if(_0x3b5293[_0x3945('0x5a')]['id']){delete _0x3b5293[_0x3945('0x5a')]['id'];}if(_[_0x3945('0x99')](_0x3b5293['body'][_0x3945('0x84')])){throw new db['Sequelize'][(_0x3945('0x7c'))]('from\x20is\x20mandatory');}if(_[_0x3945('0x99')](_0x3b5293[_0x3945('0x5a')][_0x3945('0x5a')])||_0x3b5293['body'][_0x3945('0x5a')]===''){throw new db[(_0x3945('0x7b'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3945('0x99')](_0x3b5293[_0x3945('0x5a')][_0x3945('0x9a')])){throw new db[(_0x3945('0x7b'))][(_0x3945('0x7c'))](_0x3945('0x9b')+_0x78204e);}if(!_['includes'](_0x78204e,_0x3b5293[_0x3945('0x5a')][_0x3945('0x9a')])){throw new db[(_0x3945('0x7b'))][(_0x3945('0x7c'))](_0x3945('0x9c')+_0x78204e);}_0x58438c[_0x3b5293[_0x3945('0x5a')]['mapKey']]=_0x3b5293['body'][_0x3945('0x84')];return db[_0x3945('0x9d')][_0x3945('0x59')]({'where':{'id':_0x3b5293[_0x3945('0x75')]['ListId']},'include':[{'model':db['CmContact'],'as':_0x3945('0x9e'),'where':_0x58438c,'limit':0x1,'order':[[_0x3945('0x7f'),_0x3945('0x9f')]]}]});})[_0x3945('0x22')](handleEntityNotFound(_0x1fb897,null))['then'](function(_0xcaaf74){if(_0xcaaf74){_0x3b5293[_0x3945('0xa0')]=_[_0x3945('0xa1')](_0xcaaf74,['Contacts']);if(_0xcaaf74['Contacts'][_0x3945('0x4c')]){return _0xcaaf74[_0x3945('0x9e')][0x0];}var _0x36c47a=_[_0x3945('0xa2')](_0x3b5293[_0x3945('0x5a')],{'firstName':_0x3b5293[_0x3945('0x5a')]['from'],'ListId':_0xcaaf74['id']});_0x36c47a[_0x3b5293[_0x3945('0x5a')][_0x3945('0x9a')]]=_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')];return db[_0x3945('0xa3')]['create'](_0x36c47a,{'fields':_0x125c78,'raw':!![]});}})['then'](handleEntityNotFound(_0x1fb897,null))[_0x3945('0x22')](function(_0x3f99ab){if(_0x3f99ab){_0x3b5293['contact']=_0x3f99ab;var _0x45287f={'ContactId':_0x3f99ab['id'],'phone':_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')],'SmsAccountId':_0x2e5a2f[_0x3945('0x62')]['id']};var _0x5a6e7f={'ContactId':_0x3f99ab['id'],'SmsAccountId':_0x2e5a2f['params']['id'],'closed':![]};return db[_0x3945('0xa4')]['find']({'where':_0x5a6e7f})[_0x3945('0x22')](function(_0x1305e4){if(_0x1305e4){return[_0x1305e4,![]];}return db[_0x3945('0xa4')][_0x3945('0x60')](_0x45287f)[_0x3945('0x22')](function(_0x3a457a){return[_0x3a457a,!![]];});});}})[_0x3945('0xa5')](function(_0xbda5d9,_0x16f529){_0x3b5293[_0x3945('0xa6')]=_0xbda5d9[_0x3945('0x39')]({'plain':!![]});_0x3b5293[_0x3945('0xa6')][_0x3945('0xa7')]=![];if(_0x16f529){if(_0x3b5293[_0x3945('0x75')][_0x3945('0xa8')]){_0x3b5293['applications'][_0x3945('0xa9')]({'id':0x0,'priority':_0x3b5293[_0x3945('0x76')][_0x3945('0x4c')]+0x1,'app':'close','appdata':'unmanaged','interval':_0x3945('0xaa')});}_0x3b5293[_0x3945('0xa6')][_0x3945('0xa7')]=!![];}return db[_0x3945('0xab')]['create']({'phone':_0x3b5293[_0x3945('0x5a')][_0x3945('0x84')],'messageId':_0x3b5293['body']['messageId'],'body':_0x3b5293[_0x3945('0x5a')]['body'],'SmsAccountId':_0x2e5a2f[_0x3945('0x62')]['id'],'SmsInteractionId':_0xbda5d9['id'],'direction':'in','ContactId':_0xbda5d9[_0x3945('0xac')],'AttachmentId':_0x3b5293[_0x3945('0x5a')]['AttachmentId']});})[_0x3945('0x22')](function(_0x557d90){_0x3b5293[_0x3945('0x2a')]=_0x557d90;if(_0x3b5293[_0x3945('0xa6')][_0x3945('0xad')]){return db['User'][_0x3945('0x59')]({'attributes':['id','name'],'where':{'id':_0x3b5293['interaction'][_0x3945('0xad')]}})[_0x3945('0x22')](function(_0x4d4330){if(_0x4d4330){_0x3b5293[_0x3945('0x76')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3945('0xae'),'appdata':_0x4d4330[_0x3945('0x3d')]+','+(_0x3b5293[_0x3945('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x3945('0xaa')});}return respondWithRpcPromise(_0x3945('0xaf'),_0x3945('0xb0'),_0x3b5293);});}return respondWithRpcPromise(_0x3945('0xaf'),_0x3945('0xb0'),_0x3b5293);})[_0x3945('0x22')](function(_0x378789){if(_0x378789){var _0x430c1b=0xc8;var _0x31c01f=_0x3945('0xb1');logger[_0x3945('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x31c01f,_0x430c1b,'entity\x20found');logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x31c01f,_0x430c1b,'entity\x20found',JSON['stringify'](_0x378789));if(_0x3b5293[_0x3945('0x75')]['type']===_0x3945('0xb2')){return _0x1fb897[_0x3945('0x2d')](_0x430c1b)[_0x3945('0x34')](_0x3945('0xb3'),_0x3945('0xb4'))[_0x3945('0xb5')](_0x3945('0xb6'));}else{return _0x1fb897[_0x3945('0x2d')](_0x430c1b)[_0x3945('0x2f')](_0x378789);}}})[_0x3945('0x2c')](handleError(_0x1fb897,null));};exports[_0x3945('0xb7')]=function(_0x514f67,_0x3f36b0){var _0x5ac414=_0x514f67[_0x3945('0x62')]['id'];var _0x2e50af=_0x514f67[_0x3945('0x5a')];var _0x460c08=0xc8;var _0x2b0bc2=null;return db[_0x3945('0xb8')][_0x3945('0xb9')]({'isolationLevel':db[_0x3945('0xb8')][_0x3945('0xba')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1747f2){return db[_0x3945('0x56')][_0x3945('0x67')]({'where':{'id':_0x5ac414},'transaction':_0x1747f2})[_0x3945('0x22')](function(_0x50b312){if(_0x50b312){return db[_0x3945('0x74')][_0x3945('0x38')]({'where':{'SmsAccountId':_0x5ac414},'transaction':_0x1747f2})[_0x3945('0x22')](function(){var _0x10df46=_[_0x3945('0x41')](_0x2e50af,function(_0x2699d0){_0x2699d0[_0x3945('0x64')]=_0x5ac414;return _0x2699d0;});return db[_0x3945('0x74')][_0x3945('0xbb')](_0x10df46,{'transaction':_0x1747f2});});}else{_0x460c08=0x194;_0x2b0bc2=[];}});})[_0x3945('0x22')](function(){if(_0x460c08!==0x194){return db[_0x3945('0x74')][_0x3945('0xbc')]({'where':{'SmsAccountId':_0x5ac414},'order':_0x3945('0x78')})['then'](function(_0xef019e){_0x2b0bc2=_0xef019e;});}})['catch'](function(_0xbe64d1){_0x460c08=0x1f4;logger['error'](_0xbe64d1['stack']);if(_0xbe64d1[_0x3945('0x3d')]){delete _0xbe64d1[_0x3945('0x3d')];}_0x2b0bc2=_0xbe64d1;})['finally'](function(){if(_0x2b0bc2===null){_0x3f36b0['sendStatus'](_0x460c08);}else{if(_0x460c08===0x1f4){_0x3f36b0[_0x3945('0x2d')](_0x460c08)['send'](_0x2b0bc2);}else{_0x3f36b0['status'](_0x460c08)[_0x3945('0x2f')](_0x2b0bc2);}}});};exports['getApplications']=function(_0x3f5a7a,_0x3febbc,_0xe4f41b){var _0x157b5b={};var _0x3d7ed8={};var _0x4649a2;var _0x24b153;return db['SmsAccount']['findOne']({'where':{'id':_0x3f5a7a[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x3febbc,null))[_0x3945('0x22')](function(_0x5a5359){if(_0x5a5359){_0x4649a2=_0x5a5359;_0x3d7ed8[_0x3945('0x45')]=_[_0x3945('0x47')](db[_0x3945('0x74')][_0x3945('0x42')]);_0x3d7ed8[_0x3945('0x46')]=_['keys'](_0x3f5a7a[_0x3945('0x46')]);_0x3d7ed8['filters']=_[_0x3945('0x49')](_0x3d7ed8[_0x3945('0x45')],_0x3d7ed8[_0x3945('0x46')]);_0x157b5b['attributes']=_[_0x3945('0x49')](_0x3d7ed8[_0x3945('0x45')],qs[_0x3945('0x4a')](_0x3f5a7a['query'][_0x3945('0x4a')]));_0x157b5b[_0x3945('0x4b')]=_0x157b5b[_0x3945('0x4b')][_0x3945('0x4c')]?_0x157b5b[_0x3945('0x4b')]:_0x3d7ed8[_0x3945('0x45')];_0x157b5b['order']=qs[_0x3945('0x4e')](_0x3f5a7a[_0x3945('0x46')][_0x3945('0x4e')]);_0x157b5b[_0x3945('0x4f')]=qs[_0x3945('0x48')](_[_0x3945('0x6a')](_0x3f5a7a['query'],_0x3d7ed8['filters']));if(_0x3f5a7a[_0x3945('0x46')][_0x3945('0x52')]){_0x157b5b['where']=_['merge'](_0x157b5b[_0x3945('0x4f')],{'$or':_[_0x3945('0x41')](_0x157b5b[_0x3945('0x4b')],function(_0x48a6ef){var _0x482149={};_0x482149[_0x48a6ef]={'$like':'%'+_0x3f5a7a[_0x3945('0x46')][_0x3945('0x52')]+'%'};return _0x482149;})});}_0x157b5b=_[_0x3945('0x50')]({},_0x157b5b,_0x3f5a7a[_0x3945('0x53')]);return _0x4649a2[_0x3945('0xbd')](_0x157b5b);}})[_0x3945('0x22')](function(_0x283bef){if(_0x283bef){_0x24b153=_0x283bef['length'];if(!_0x3f5a7a['query'][_0x3945('0x68')](_0x3945('0x4d'))){_0x157b5b['limit']=qs[_0x3945('0x31')](_0x3f5a7a[_0x3945('0x46')][_0x3945('0x31')]);_0x157b5b[_0x3945('0x30')]=qs[_0x3945('0x30')](_0x3f5a7a[_0x3945('0x46')][_0x3945('0x30')]);}return _0x4649a2[_0x3945('0xbd')](_0x157b5b);}})[_0x3945('0x22')](function(_0x3bc58e){if(_0x3bc58e){return _0x3bc58e?{'count':_0x24b153,'rows':_0x3bc58e}:null;}})[_0x3945('0x22')](respondWithResult(_0x3febbc,null))['catch'](handleError(_0x3febbc,null));};exports[_0x3945('0xbe')]=function(_0x5c014d,_0x2f764b,_0x1dd989){var _0x2ff638={'raw':![],'where':{}};var _0x288a3e={};var _0x52474d={'count':0x0,'rows':[]};return db[_0x3945('0x56')][_0x3945('0x67')]({'where':{'id':_0x5c014d[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x2f764b,null))[_0x3945('0x22')](function(_0x5ce097){if(_0x5ce097){_0x288a3e[_0x3945('0x45')]=_[_0x3945('0x47')](db[_0x3945('0xa4')][_0x3945('0x42')]);_0x288a3e[_0x3945('0x46')]=_[_0x3945('0x47')](_0x5c014d[_0x3945('0x46')]);_0x288a3e[_0x3945('0x48')]=_[_0x3945('0x49')](_0x288a3e['model'],_0x288a3e[_0x3945('0x46')]);_0x2ff638[_0x3945('0x4b')]=_[_0x3945('0x49')](_0x288a3e[_0x3945('0x45')],qs[_0x3945('0x4a')](_0x5c014d[_0x3945('0x46')][_0x3945('0x4a')]));_0x2ff638[_0x3945('0x4b')]=_0x2ff638[_0x3945('0x4b')][_0x3945('0x4c')]?_0x2ff638['attributes']:_0x288a3e[_0x3945('0x45')];if(!_0x5c014d[_0x3945('0x46')]['hasOwnProperty'](_0x3945('0x4d'))){_0x2ff638['limit']=qs[_0x3945('0x31')](_0x5c014d[_0x3945('0x46')]['limit']);_0x2ff638[_0x3945('0x30')]=qs['offset'](_0x5c014d[_0x3945('0x46')]['offset']);}_0x2ff638[_0x3945('0x69')]=qs[_0x3945('0x4e')](_0x5c014d['query'][_0x3945('0x4e')]);_0x2ff638['where']=qs[_0x3945('0x48')](_[_0x3945('0x6a')](_0x5c014d[_0x3945('0x46')],_0x288a3e[_0x3945('0x48')]));_0x2ff638[_0x3945('0x4f')][_0x3945('0x64')]=_0x5ce097['id'];if(_0x5c014d[_0x3945('0x46')][_0x3945('0x52')]){_0x2ff638['where']=_[_0x3945('0x50')](_0x2ff638['where'],{'$or':_[_0x3945('0x41')](_0x2ff638[_0x3945('0x4b')],function(_0x1705ce){var _0x108aed={};_0x108aed[_0x1705ce]={'$like':'%'+_0x5c014d[_0x3945('0x46')][_0x3945('0x52')]+'%'};return _0x108aed;})});}_0x2ff638=_['merge']({},_0x2ff638,_0x5c014d[_0x3945('0x53')]);return db[_0x3945('0xa4')]['count']({'where':_0x2ff638['where']})[_0x3945('0x22')](function(_0x28ba20){_0x52474d[_0x3945('0x33')]=_0x28ba20;if(_0x5c014d[_0x3945('0x46')][_0x3945('0x54')]){_0x2ff638['include']=[{'model':db[_0x3945('0xa3')],'as':_0x3945('0xbf'),'required':![]},{'model':db[_0x3945('0xc0')],'as':_0x3945('0xc1'),'attributes':[_0x3945('0x3d'),_0x3945('0xc2'),_0x3945('0xc3')],'required':![]},{'model':db[_0x3945('0xc4')],'as':'Tags','attributes':['id',_0x3945('0x3d'),_0x3945('0xc5')],'where':_0x5c014d['query'][_0x3945('0xc6')]?{'id':_0x5c014d[_0x3945('0x46')][_0x3945('0xc6')]}:undefined,'required':_0x5c014d[_0x3945('0x46')]['tag']?!![]:![]}];}return db[_0x3945('0xa4')][_0x3945('0x57')](_0x2ff638);})[_0x3945('0x22')](function(_0x57e034){_0x52474d['rows']=_0x57e034;return _0x52474d;});}})['then'](respondWithFilteredResult(_0x2f764b,_0x2ff638))[_0x3945('0x2c')](handleError(_0x2f764b,null));};exports['send']=function(_0x21c896,_0x42969c,_0x445bcd){var _0x5b6ce5,_0x268a35,_0x48bf3d;if(_['isNil'](_0x21c896['body']['body'])||_0x21c896[_0x3945('0x5a')][_0x3945('0x5a')]===''){throw new db['Sequelize'][(_0x3945('0x7c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x3945('0x99')](_0x21c896['body']['to'])){throw new db[(_0x3945('0x7b'))]['ValidationError'](_0x3945('0xc7'));}_0x5b6ce5=_0x21c896[_0x3945('0x5a')]['to'];return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0x21c896['params']['id']},'include':[{'model':db[_0x3945('0x9d')],'as':_0x3945('0xc8'),'include':[{'model':db[_0x3945('0xa3')],'as':_0x3945('0x9e'),'where':{'mobile':_0x5b6ce5},'limit':0x1,'order':[[_0x3945('0x7f'),_0x3945('0x9f')]]}]}]})[_0x3945('0x22')](handleEntityNotFound(_0x42969c,null))['then'](function(_0x434451){if(_0x434451&&_0x434451[_0x3945('0xc8')]){_0x268a35=_0x434451[_0x3945('0x39')]({'plain':!![]});if(_0x268a35[_0x3945('0xc8')]&&_0x268a35[_0x3945('0xc8')][_0x3945('0x9e')][_0x3945('0x4c')]){return _0x268a35['List'][_0x3945('0x9e')][0x0];}return db[_0x3945('0xa3')][_0x3945('0x60')](_[_0x3945('0xa2')](_0x21c896[_0x3945('0x5a')],{'firstName':_0x5b6ce5,'mobile':_0x5b6ce5,'phone':_0x5b6ce5,'ListId':_0x268a35[_0x3945('0x82')]}));}})[_0x3945('0x22')](handleEntityNotFound(_0x42969c,null))['then'](function(_0x518508){if(_0x518508){_0x48bf3d=_0x518508;return db[_0x3945('0xa4')]['find']({'where':{'ContactId':_0x48bf3d['id'],'closed':![],'SmsAccountId':_0x268a35['id']}})[_0x3945('0x22')](function(_0x233fc5){if(_0x233fc5){return[_0x233fc5,![]];}return db[_0x3945('0xa4')][_0x3945('0x60')]({'UserId':_0x21c896['user']['id'],'ContactId':_0x48bf3d['id'],'SmsAccountId':_0x268a35['id'],'phone':_0x5b6ce5,'firstMsgDirection':_0x3945('0xc9'),'Messages':[_[_0x3945('0x50')](_0x21c896[_0x3945('0x5a')],{'read':![],'body':_0x21c896[_0x3945('0x5a')][_0x3945('0x5a')],'phone':_0x5b6ce5,'SmsAccountId':_0x268a35['id'],'UserId':_0x21c896['user']['id'],'ContactId':_0x48bf3d['id']})]},{'include':[{'model':db[_0x3945('0xab')],'as':_0x3945('0xca')}]})['then'](function(_0x5eb0d8){return[_0x5eb0d8,!![]];});});}})[_0x3945('0xa5')](function(_0x2705d3,_0x57003d){if(_0x57003d){return _0x2705d3;}return db['SmsMessage'][_0x3945('0x60')](_[_0x3945('0x50')](_0x21c896[_0x3945('0x5a')],{'read':![],'body':_0x21c896[_0x3945('0x5a')]['body'],'phone':_0x5b6ce5,'SmsAccountId':_0x268a35['id'],'SmsInteractionId':_0x2705d3['id'],'UserId':_0x21c896[_0x3945('0x5b')]['id'],'ContactId':_0x48bf3d['id']}))['then'](function(_0x973276){_0x2705d3['dataValues'][_0x3945('0xca')]=[];_0x2705d3['dataValues'][_0x3945('0xca')][_0x3945('0xa9')](_0x973276[_0x3945('0xcb')]);return _0x2705d3;});})[_0x3945('0x22')](respondWithResult(_0x42969c,null))[_0x3945('0x2c')](handleError(_0x42969c,null));};exports[_0x3945('0x2d')]=function(_0x537e8e,_0x140ce4,_0x406ba5){if(_0x537e8e[_0x3945('0x5a')]['id']){delete _0x537e8e['body']['id'];}var _0x4d79be,_0x237201,_0x4c9ac2;return db['SmsAccount'][_0x3945('0x59')]({'where':{'id':_0x537e8e[_0x3945('0x62')]['id']}})['then'](handleEntityNotFound(_0x140ce4,null))[_0x3945('0x22')](function(_0x31eebf){if(_0x31eebf){_0x4c9ac2=_0x31eebf;logger[_0x3945('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3945('0x2d'),_0x3945('0xcc'),_0x31eebf[_0x3945('0x44')],util[_0x3945('0xcd')](_0x537e8e[_0x3945('0x5a')],{'showHidden':![],'depth':null}));switch(_0x31eebf[_0x3945('0x44')]){case _0x3945('0x87'):if(_0x537e8e[_0x3945('0x5a')][_0x3945('0xce')]&&_0x537e8e[_0x3945('0x5a')][_0x3945('0x2d')]){_0x237201=_0x537e8e[_0x3945('0x5a')]['status'];return db[_0x3945('0xab')][_0x3945('0x59')]({'where':{'messageId':_0x537e8e[_0x3945('0x5a')][_0x3945('0xce')]}});}break;case _0x3945('0x8a'):if(_0x537e8e[_0x3945('0x5a')]['requestid']&&_0x537e8e[_0x3945('0x5a')]['statusInt']){_0x237201=_0x537e8e[_0x3945('0x5a')][_0x3945('0xcf')];return db[_0x3945('0xab')][_0x3945('0x59')]({'where':{'messageId':_0x537e8e['body'][_0x3945('0xd0')]}});}break;case'clicksend':if(_0x537e8e[_0x3945('0x5a')][_0x3945('0x8c')]&&_0x537e8e[_0x3945('0x5a')][_0x3945('0xd1')]){_0x237201=_0x537e8e['body'][_0x3945('0xd1')];return db['SmsMessage'][_0x3945('0x59')]({'where':{'messageId':_0x537e8e[_0x3945('0x5a')]['message_id']}});}break;case _0x3945('0xd2'):var _0x4b8725=_0x537e8e['body']['results'][0x0];if(_0x4b8725[_0x3945('0x8f')]&&_0x4b8725[_0x3945('0x2d')]['groupName']===_0x3945('0xd3')){_0x237201=_0x4b8725[_0x3945('0x2d')][_0x3945('0xd4')];return db[_0x3945('0xab')][_0x3945('0x59')]({'where':{'messageId':_0x4b8725[_0x3945('0x8f')]}});}break;case _0x3945('0xd5'):if(_0x537e8e[_0x3945('0x5a')][_0x3945('0x8f')]&&_0x537e8e['body'][_0x3945('0x2d')]){_0x237201=_0x537e8e['body'][_0x3945('0x2d')];return db['SmsMessage'][_0x3945('0x59')]({'where':{'messageId':_0x537e8e[_0x3945('0x5a')][_0x3945('0x8f')]}});}break;case _0x3945('0x96'):if(_0x537e8e[_0x3945('0x5a')][0x0][_0x3945('0x2a')]['id']){_0x237201=_0x537e8e[_0x3945('0x5a')][0x0][_0x3945('0x44')];return db[_0x3945('0xab')]['find']({'where':{'messageId':_0x537e8e['body'][0x0]['message']['id']}});}break;case _0x3945('0x97'):if(_0x537e8e[_0x3945('0x5a')][_0x3945('0xd6')]&&_0x537e8e[_0x3945('0x5a')][_0x3945('0x2d')]){_0x237201=_0x537e8e[_0x3945('0x5a')][_0x3945('0x2d')];return db[_0x3945('0xab')][_0x3945('0x59')]({'where':{'messageId':_0x537e8e[_0x3945('0x5a')]['redif']}});}break;}}})[_0x3945('0x22')](handleEntityNotFound(_0x140ce4,null))[_0x3945('0x22')](function(_0x58cd67){if(_0x58cd67){_0x4d79be=_0x58cd67;switch(_0x4c9ac2[_0x3945('0x44')]){case _0x3945('0x87'):if(_0x237201===_0x3945('0xd3')){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),_0x3945('0x2d'),_0x3945('0x87'),util['inspect'](_0x537e8e[_0x3945('0x5a')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x237201==='1'){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),_0x3945('0x2d'),_0x3945('0x87'),util[_0x3945('0xcd')](_0x537e8e[_0x3945('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x3945('0x8b'):if(!_0x537e8e[_0x3945('0x5a')][_0x3945('0xd8')]&&_0x237201>=0xc8&&_0x237201<=0xce){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),_0x3945('0x2d'),_0x3945('0x8b'),util[_0x3945('0xcd')](_0x537e8e['body'],{'showHidden':![],'depth':null}));}break;case _0x3945('0xd2'):var _0x27cb5b=_0x537e8e['body']['results'][0x0];if(_0x27cb5b[_0x3945('0x2d')]['groupName']==='DELIVERED'){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger['error'](_0x3945('0xd7'),'status','infobip',util[_0x3945('0xcd')](_0x537e8e[_0x3945('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x3945('0xd5'):if(_0x237201==_0x3945('0xd9')||_0x237201=='RECEIVED_BY_RECIPIENT'){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),'status',_0x3945('0xd5'),util[_0x3945('0xcd')](_0x537e8e['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x237201==_0x3945('0xda')){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),'status',_0x3945('0x96'),util[_0x3945('0xcd')](_0x537e8e[_0x3945('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x3945('0x97'):if(_0x237201===_0x3945('0xdb')||_0x237201===_0x3945('0xdc')){return _0x4d79be[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3945('0x2d'),_0x3945('0x97'),util[_0x3945('0xcd')](_0x537e8e['body'],{'showHidden':![],'depth':null}));}break;}return _0x4d79be;}})[_0x3945('0x22')](respondWithResult(_0x140ce4,null))[_0x3945('0x2c')](handleError(_0x140ce4,null));};exports[_0x3945('0xdd')]=function(_0xbfc365,_0x16f2c6,_0x2d794b){var _0x4056dc,_0x56da3f,_0x518489;return db[_0x3945('0x56')]['find']({'where':{'id':_0xbfc365['params']['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x16f2c6,null))['then'](function(_0x570a82){if(_0x570a82){_0x518489=_0x570a82;logger['debug'](_0x3945('0xd7'),_0x3945('0x2d'),_0x3945('0xcc'),_0x570a82[_0x3945('0x44')],util[_0x3945('0xcd')](_0xbfc365[_0x3945('0x46')],{'showHidden':![],'depth':null}));switch(_0x570a82[_0x3945('0x44')]){case _0x3945('0x91'):if(_0xbfc365[_0x3945('0x46')][_0x3945('0xde')]&&_0xbfc365[_0x3945('0x46')][_0x3945('0xdf')]){_0x56da3f=_0xbfc365[_0x3945('0x46')][_0x3945('0xdf')];return db[_0x3945('0xab')][_0x3945('0x59')]({'where':{'messageId':_0xbfc365[_0x3945('0x46')][_0x3945('0xde')]}});}break;}}})['then'](handleEntityNotFound(_0x16f2c6,null))[_0x3945('0x22')](function(_0x3afc3a){if(_0x3afc3a){_0x4056dc=_0x3afc3a;switch(_0x518489[_0x3945('0x44')]){case _0x3945('0x91'):if(_0x56da3f==='2'||_0x56da3f==='6'){return _0x4056dc[_0x3945('0x61')]({'read':!![]});}else{logger[_0x3945('0x28')](_0x3945('0xd7'),_0x3945('0x2d'),'csc',util[_0x3945('0xcd')](_0xbfc365[_0x3945('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x4056dc;}})['then'](respondWithResult(_0x16f2c6,null))[_0x3945('0x2c')](handleError(_0x16f2c6,null));};exports[_0x3945('0xe0')]=function(_0xe6ff33,_0x4dd531,_0x2b152f){return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0xe6ff33[_0x3945('0x62')]['id']}})['then'](handleEntityNotFound(_0x4dd531,null))[_0x3945('0x22')](function(_0x270100){if(_0x270100){return _0x270100[_0x3945('0xe0')](_0xe6ff33[_0x3945('0x5a')][_0x3945('0x6d')],_['omit'](_0xe6ff33[_0x3945('0x5a')],[_0x3945('0x6d'),'id'])||{})[_0x3945('0xa5')](function(_0x41e02b){for(var _0x4930b0=0x0;_0x4930b0<_0xe6ff33[_0x3945('0x5a')][_0x3945('0x6d')][_0x3945('0x4c')];_0x4930b0+=0x1){socket[_0x3945('0xe1')](_0x3945('0xe2'),{'UserId':Number(_0xe6ff33[_0x3945('0x5a')]['ids'][_0x4930b0]),'SmsAccountId':Number(_0xe6ff33[_0x3945('0x62')]['id'])});}return _0x41e02b;});}})[_0x3945('0x22')](respondWithResult(_0x4dd531,null))['catch'](handleError(_0x4dd531,null));};exports[_0x3945('0xe3')]=function(_0x5b0ecd,_0x413d35,_0x4ef714){return db[_0x3945('0x56')][_0x3945('0x59')]({'where':{'id':_0x5b0ecd[_0x3945('0x62')]['id']}})[_0x3945('0x22')](handleEntityNotFound(_0x413d35,null))[_0x3945('0x22')](function(_0x6fa2f4){if(_0x6fa2f4){return _0x6fa2f4[_0x3945('0xe3')](_0x5b0ecd['query']['ids'])[_0x3945('0x22')](function(){if(_[_0x3945('0xe4')](_0x5b0ecd[_0x3945('0x46')]['ids'])){for(var _0x5b9cf7=0x0;_0x5b9cf7<_0x5b0ecd[_0x3945('0x46')][_0x3945('0x6d')][_0x3945('0x4c')];_0x5b9cf7+=0x1){socket[_0x3945('0xe1')](_0x3945('0xe5'),{'UserId':Number(_0x5b0ecd[_0x3945('0x46')]['ids'][_0x5b9cf7]),'SmsAccountId':Number(_0x5b0ecd[_0x3945('0x62')]['id'])});}}else{socket['emit'](_0x3945('0xe5'),{'UserId':Number(_0x5b0ecd['query'][_0x3945('0x6d')]),'SmsAccountId':Number(_0x5b0ecd[_0x3945('0x62')]['id'])});}});}})[_0x3945('0x22')](respondWithStatusCode(_0x413d35,null))[_0x3945('0x2c')](handleError(_0x413d35,null));};exports[_0x3945('0xe6')]=function(_0x60ddff,_0x43e52b,_0x2c2d6f){var _0x3972d3={};var _0x58b376={};var _0xc95d20;var _0x290862;return db[_0x3945('0x56')][_0x3945('0x67')]({'where':{'id':_0x60ddff[_0x3945('0x62')]['id']}})['then'](handleEntityNotFound(_0x43e52b,null))[_0x3945('0x22')](function(_0x8230bf){if(_0x8230bf){_0xc95d20=_0x8230bf;_0x58b376['model']=_[_0x3945('0x47')](db[_0x3945('0xc0')][_0x3945('0x42')]);_0x58b376[_0x3945('0x46')]=_[_0x3945('0x47')](_0x60ddff['query']);_0x58b376[_0x3945('0x48')]=_['intersection'](_0x58b376[_0x3945('0x45')],_0x58b376[_0x3945('0x46')]);_0x3972d3[_0x3945('0x4b')]=_[_0x3945('0x49')](_0x58b376[_0x3945('0x45')],qs[_0x3945('0x4a')](_0x60ddff[_0x3945('0x46')][_0x3945('0x4a')]));_0x3972d3[_0x3945('0x4b')]=_0x3972d3[_0x3945('0x4b')][_0x3945('0x4c')]?_0x3972d3['attributes']:_0x58b376[_0x3945('0x45')];_0x3972d3[_0x3945('0x69')]=qs[_0x3945('0x4e')](_0x60ddff['query'][_0x3945('0x4e')]);_0x3972d3['where']=qs[_0x3945('0x48')](_['pick'](_0x60ddff[_0x3945('0x46')],_0x58b376['filters']));if(_0x60ddff['query'][_0x3945('0x52')]){_0x3972d3[_0x3945('0x4f')]=_[_0x3945('0x50')](_0x3972d3['where'],{'$or':_[_0x3945('0x41')](_0x3972d3['attributes'],function(_0x402e4a){var _0x5679f0={};_0x5679f0[_0x402e4a]={'$like':'%'+_0x60ddff[_0x3945('0x46')][_0x3945('0x52')]+'%'};return _0x5679f0;})});}_0x3972d3=_[_0x3945('0x50')]({},_0x3972d3,_0x60ddff[_0x3945('0x53')]);return _0xc95d20[_0x3945('0xe6')](_0x3972d3);}})[_0x3945('0x22')](function(_0x4272b9){if(_0x4272b9){_0x290862=_0x4272b9[_0x3945('0x4c')];if(!_0x60ddff['query'][_0x3945('0x68')](_0x3945('0x4d'))){_0x3972d3['limit']=qs[_0x3945('0x31')](_0x60ddff[_0x3945('0x46')][_0x3945('0x31')]);_0x3972d3[_0x3945('0x30')]=qs[_0x3945('0x30')](_0x60ddff['query'][_0x3945('0x30')]);}return _0xc95d20['getAgents'](_0x3972d3);}})[_0x3945('0x22')](function(_0x5e0b3e){if(_0x5e0b3e){return _0x5e0b3e?{'count':_0x290862,'rows':_0x5e0b3e}:null;}})[_0x3945('0x22')](respondWithResult(_0x43e52b,null))[_0x3945('0x2c')](handleError(_0x43e52b,null));};
\ No newline at end of file
index 241c200..acb612b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42dc=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','update','remove'];(function(_0xa3494b,_0x2bf68d){var _0x5d4ca2=function(_0x2fb267){while(--_0x2fb267){_0xa3494b['push'](_0xa3494b['shift']());}};_0x5d4ca2(++_0x2bf68d);}(_0x42dc,0x1da));var _0xc42d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x42dc[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xc42d('0x0'));var SmsAccount=require(_0xc42d('0x1'))['db'][_0xc42d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc42d('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc42d('0x4'),'afterDestroy':_0xc42d('0x5')};function emitEvent(_0x394e16){return function(_0x36d05a,_0x4ac3cc,_0x5da1e4){SmsAccountEvents['emit'](_0x394e16+':'+_0x36d05a['id'],_0x36d05a);SmsAccountEvents[_0xc42d('0x6')](_0x394e16,_0x36d05a);_0x5da1e4(null);};}for(var e in events){if(events[_0xc42d('0x7')](e)){var event=events[e];SmsAccount[_0xc42d('0x8')](e,emitEvent(event));}}module[_0xc42d('0x9')]=SmsAccountEvents;
\ No newline at end of file
+var _0x537e=['setMaxListeners','save','update','emit','hook','events','SmsAccount'];(function(_0x4d9d1e,_0x3c2d20){var _0x1b9d54=function(_0x373c21){while(--_0x373c21){_0x4d9d1e['push'](_0x4d9d1e['shift']());}};_0x1b9d54(++_0x3c2d20);}(_0x537e,0x67));var _0xe537=function(_0x3bd7ff,_0x8eb6cd){_0x3bd7ff=_0x3bd7ff-0x0;var _0xda1118=_0x537e[_0x3bd7ff];return _0xda1118;};'use strict';var EventEmitter=require(_0xe537('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xe537('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xe537('0x2')](0x0);var events={'afterCreate':_0xe537('0x3'),'afterUpdate':_0xe537('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e368d){return function(_0x5349e6,_0x196fb5,_0x3032e4){SmsAccountEvents[_0xe537('0x5')](_0x3e368d+':'+_0x5349e6['id'],_0x5349e6);SmsAccountEvents['emit'](_0x3e368d,_0x5349e6);_0x3032e4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xe537('0x6')](e,emitEvent(event));}}module['exports']=SmsAccountEvents;
\ No newline at end of file
index f0dec13..b30cc9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e7=['util','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts'];(function(_0x7e3f06,_0x426f70){var _0x12b8ff=function(_0x47c83c){while(--_0x47c83c){_0x7e3f06['push'](_0x7e3f06['shift']());}};_0x12b8ff(++_0x426f70);}(_0x13e7,0xd1));var _0x713e=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x13e7[_0x260f28];return _0x3aefcc;};'use strict';var _=require('lodash');var util=require(_0x713e('0x0'));var logger=require('../../config/logger')(_0x713e('0x1'));var moment=require(_0x713e('0x2'));var BPromise=require(_0x713e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x713e('0x4'));var rimraf=require(_0x713e('0x5'));var config=require(_0x713e('0x6'));var attributes=require(_0x713e('0x7'));module[_0x713e('0x8')]=function(_0x4755b4,_0x3c964e){return _0x4755b4[_0x713e('0x9')]('SmsAccount',attributes,{'tableName':_0x713e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9dc7=['exports','define','SmsAccount','sms_accounts','lodash','api','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x459876,_0x11aa89){var _0x3ec9d2=function(_0xd65a3c){while(--_0xd65a3c){_0x459876['push'](_0x459876['shift']());}};_0x3ec9d2(++_0x11aa89);}(_0x9dc7,0x1b1));var _0x79dc=function(_0x2a05a0,_0x1e0ce2){_0x2a05a0=_0x2a05a0-0x0;var _0x3e70ae=_0x9dc7[_0x2a05a0];return _0x3e70ae;};'use strict';var _=require(_0x79dc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x79dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79dc('0x2'));var fs=require('fs');var path=require(_0x79dc('0x3'));var rimraf=require(_0x79dc('0x4'));var config=require(_0x79dc('0x5'));var attributes=require(_0x79dc('0x6'));module[_0x79dc('0x7')]=function(_0x288845,_0x3317df){return _0x288845[_0x79dc('0x8')](_0x79dc('0x9'),attributes,{'tableName':_0x79dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 770443f..34add49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28b=['then','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./smsAccount.socket','request','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','SmsAccount,\x20%s,\x20%s','message','ShowSmsAccount','find','options','raw','where','attributes','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe28b,0x1de));var _0xbe28=function(_0x3bdc95,_0x1fc10a){_0x3bdc95=_0x3bdc95-0x0;var _0x50efc4=_0xe28b[_0x3bdc95];return _0x50efc4;};'use strict';var _=require(_0xbe28('0x0'));var util=require('util');var moment=require(_0xbe28('0x1'));var BPromise=require(_0xbe28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe28('0x3'));var db=require(_0xbe28('0x4'))['db'];var utils=require(_0xbe28('0x5'));var logger=require(_0xbe28('0x6'))('rpc');var config=require(_0xbe28('0x7'));var jayson=require(_0xbe28('0x8'));var client=jayson[_0xbe28('0x9')][_0xbe28('0xa')]({'port':0x232a});config[_0xbe28('0xb')]=_[_0xbe28('0xc')](config[_0xbe28('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe28('0xb')]));require(_0xbe28('0xd'))['register'](socket);function respondWithRpcPromise(_0x65eb57,_0x579f05,_0x258922){return new BPromise(function(_0x2a2b0b,_0x17917a){return client[_0xbe28('0xe')](_0x65eb57,_0x258922)['then'](function(_0x5691cf){logger[_0xbe28('0xf')]('SmsAccount,\x20%s,\x20%s',_0x579f05,_0xbe28('0x10'));logger[_0xbe28('0x11')](_0xbe28('0x12'),_0x579f05,_0xbe28('0x10'),JSON['stringify'](_0x5691cf));if(_0x5691cf[_0xbe28('0x13')]){if(_0x5691cf[_0xbe28('0x13')][_0xbe28('0x14')]===0x1f4){logger[_0xbe28('0x13')](_0xbe28('0x15'),_0x579f05,_0x5691cf[_0xbe28('0x13')]['message']);return _0x17917a(_0x5691cf[_0xbe28('0x13')][_0xbe28('0x16')]);}logger['error'](_0xbe28('0x15'),_0x579f05,_0x5691cf['error'][_0xbe28('0x16')]);return _0x2a2b0b(_0x5691cf[_0xbe28('0x13')][_0xbe28('0x16')]);}else{logger[_0xbe28('0xf')](_0xbe28('0x15'),_0x579f05,_0xbe28('0x10'));_0x2a2b0b(_0x5691cf['result'][_0xbe28('0x16')]);}})['catch'](function(_0x4db93c){logger[_0xbe28('0x13')]('SmsAccount,\x20%s,\x20%s',_0x579f05,_0x4db93c);_0x17917a(_0x4db93c);});});}exports[_0xbe28('0x17')]=function(_0x697f91){var _0x48d6bd=this;return new Promise(function(_0x187ffb,_0x542b6d){return db['SmsAccount'][_0xbe28('0x18')]({'raw':_0x697f91['options']?_0x697f91[_0xbe28('0x19')][_0xbe28('0x1a')]===undefined?!![]:![]:!![],'where':_0x697f91['options']?_0x697f91[_0xbe28('0x19')][_0xbe28('0x1b')]||null:null,'attributes':_0x697f91[_0xbe28('0x19')]?_0x697f91[_0xbe28('0x19')][_0xbe28('0x1c')]||null:null,'include':_0x697f91[_0xbe28('0x19')]?_0x697f91[_0xbe28('0x19')][_0xbe28('0x1d')]?_[_0xbe28('0x1e')](_0x697f91[_0xbe28('0x19')][_0xbe28('0x1d')],function(_0x55fedd){return{'model':db[_0x55fedd[_0xbe28('0x1f')]],'as':_0x55fedd['as'],'attributes':_0x55fedd['attributes'],'include':_0x55fedd[_0xbe28('0x1d')]?_['map'](_0x55fedd['include'],function(_0x3dc237){return{'model':db[_0x3dc237[_0xbe28('0x1f')]],'as':_0x3dc237['as'],'attributes':_0x3dc237[_0xbe28('0x1c')],'include':_0x3dc237[_0xbe28('0x1d')]?_[_0xbe28('0x1e')](_0x3dc237['include'],function(_0x53da46){return{'model':db[_0x53da46[_0xbe28('0x1f')]],'as':_0x53da46['as'],'attributes':_0x53da46[_0xbe28('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xbe28('0x20')](function(_0xd5dedf){logger[_0xbe28('0xf')](_0xbe28('0x17'),_0x697f91);logger['debug'](_0xbe28('0x17'),_0x697f91,JSON['stringify'](_0xd5dedf));_0x187ffb(_0xd5dedf);})[_0xbe28('0x21')](function(_0xf2ec34){logger['error'](_0xbe28('0x17'),_0xf2ec34[_0xbe28('0x16')],_0x697f91);_0x542b6d(_0x48d6bd[_0xbe28('0x13')](0x1f4,_0xf2ec34['message']));});});};
\ No newline at end of file
+var _0x36e8=['lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./smsAccount.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','catch'];(function(_0x457f47,_0x22dc6c){var _0x43e1ca=function(_0x5be873){while(--_0x5be873){_0x457f47['push'](_0x457f47['shift']());}};_0x43e1ca(++_0x22dc6c);}(_0x36e8,0xd8));var _0x836e=function(_0x54ffe8,_0x21774d){_0x54ffe8=_0x54ffe8-0x0;var _0xf1bfea=_0x36e8[_0x54ffe8];return _0xf1bfea;};'use strict';var _=require(_0x836e('0x0'));var util=require(_0x836e('0x1'));var moment=require(_0x836e('0x2'));var BPromise=require(_0x836e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x836e('0x4'))['db'];var utils=require(_0x836e('0x5'));var logger=require(_0x836e('0x6'))(_0x836e('0x7'));var config=require('../../config/environment');var jayson=require(_0x836e('0x8'));var client=jayson[_0x836e('0x9')][_0x836e('0xa')]({'port':0x232a});config[_0x836e('0xb')]=_['defaults'](config[_0x836e('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x836e('0xc'))(new Redis(config[_0x836e('0xb')]));require(_0x836e('0xd'))[_0x836e('0xe')](socket);function respondWithRpcPromise(_0x54126f,_0x4d954e,_0x8f9d8d){return new BPromise(function(_0x28e834,_0xd9fcff){return client[_0x836e('0xf')](_0x54126f,_0x8f9d8d)[_0x836e('0x10')](function(_0x26bcd7){logger[_0x836e('0x11')]('SmsAccount,\x20%s,\x20%s',_0x4d954e,'request\x20sent');logger[_0x836e('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4d954e,_0x836e('0x13'),JSON[_0x836e('0x14')](_0x26bcd7));if(_0x26bcd7[_0x836e('0x15')]){if(_0x26bcd7[_0x836e('0x15')][_0x836e('0x16')]===0x1f4){logger[_0x836e('0x15')](_0x836e('0x17'),_0x4d954e,_0x26bcd7['error'][_0x836e('0x18')]);return _0xd9fcff(_0x26bcd7[_0x836e('0x15')][_0x836e('0x18')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4d954e,_0x26bcd7[_0x836e('0x15')][_0x836e('0x18')]);return _0x28e834(_0x26bcd7[_0x836e('0x15')]['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x4d954e,'request\x20sent');_0x28e834(_0x26bcd7['result'][_0x836e('0x18')]);}})['catch'](function(_0x5d84b1){logger[_0x836e('0x15')]('SmsAccount,\x20%s,\x20%s',_0x4d954e,_0x5d84b1);_0xd9fcff(_0x5d84b1);});});}exports['ShowSmsAccount']=function(_0x1b9a25){var _0x3217b8=this;return new Promise(function(_0x14400c,_0x2addec){return db[_0x836e('0x19')][_0x836e('0x1a')]({'raw':_0x1b9a25[_0x836e('0x1b')]?_0x1b9a25[_0x836e('0x1b')][_0x836e('0x1c')]===undefined?!![]:![]:!![],'where':_0x1b9a25[_0x836e('0x1b')]?_0x1b9a25['options'][_0x836e('0x1d')]||null:null,'attributes':_0x1b9a25[_0x836e('0x1b')]?_0x1b9a25[_0x836e('0x1b')][_0x836e('0x1e')]||null:null,'include':_0x1b9a25[_0x836e('0x1b')]?_0x1b9a25['options'][_0x836e('0x1f')]?_['map'](_0x1b9a25[_0x836e('0x1b')][_0x836e('0x1f')],function(_0x3d482a){return{'model':db[_0x3d482a[_0x836e('0x20')]],'as':_0x3d482a['as'],'attributes':_0x3d482a[_0x836e('0x1e')],'include':_0x3d482a[_0x836e('0x1f')]?_['map'](_0x3d482a['include'],function(_0x4eec44){return{'model':db[_0x4eec44['model']],'as':_0x4eec44['as'],'attributes':_0x4eec44[_0x836e('0x1e')],'include':_0x4eec44['include']?_[_0x836e('0x21')](_0x4eec44['include'],function(_0x33c84f){return{'model':db[_0x33c84f[_0x836e('0x20')]],'as':_0x33c84f['as'],'attributes':_0x33c84f[_0x836e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x836e('0x10')](function(_0x3a614e){logger['info'](_0x836e('0x22'),_0x1b9a25);logger[_0x836e('0x12')](_0x836e('0x22'),_0x1b9a25,JSON[_0x836e('0x14')](_0x3a614e));_0x14400c(_0x3a614e);})[_0x836e('0x23')](function(_0x1dc7ae){logger['error'](_0x836e('0x22'),_0x1dc7ae['message'],_0x1b9a25);_0x2addec(_0x3217b8[_0x836e('0x15')](0x1f4,_0x1dc7ae[_0x836e('0x18')]));});});};
\ No newline at end of file
index 149cd1f..1e7b40b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 988c039..870631a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 51b25df..b3d16ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1929=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x2ecdf7,_0x10c014){var _0x4c0bfc=function(_0x2ac838){while(--_0x2ac838){_0x2ecdf7['push'](_0x2ecdf7['shift']());}};_0x4c0bfc(++_0x10c014);}(_0x1929,0x77));var _0x9192=function(_0x328534,_0x33b41e){_0x328534=_0x328534-0x0;var _0x2796c0=_0x1929[_0x328534];return _0x2796c0;};'use strict';var Sequelize=require(_0x9192('0x0'));module[_0x9192('0x1')]={'priority':{'type':Sequelize[_0x9192('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9192('0x3')],'allowNull':![],'defaultValue':_0x9192('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9192('0x3')]},'interval':{'type':Sequelize[_0x9192('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xfec8=['*,*,*,*','STRING','noop'];(function(_0x10dcf,_0xedb57f){var _0x5b056e=function(_0x216b8a){while(--_0x216b8a){_0x10dcf['push'](_0x10dcf['shift']());}};_0x5b056e(++_0xedb57f);}(_0xfec8,0x1ea));var _0x8fec=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xfec8[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x8fec('0x0')],'allowNull':![],'defaultValue':_0x8fec('0x1')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x8fec('0x0')]},'interval':{'type':Sequelize[_0x8fec('0x0')],'defaultValue':_0x8fec('0x2')}};
\ No newline at end of file
index cdc6084..60b3715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd011=['stack','name','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x41320f,_0x28a6fa){var _0x555dc7=function(_0x22de94){while(--_0x22de94){_0x41320f['push'](_0x41320f['shift']());}};_0x555dc7(++_0x28a6fa);}(_0xd011,0x6e));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1d01('0x0'));var jsonpatch=require(_0x1d01('0x1'));var rp=require(_0x1d01('0x2'));var moment=require(_0x1d01('0x3'));var BPromise=require(_0x1d01('0x4'));var Mustache=require('mustache');var util=require(_0x1d01('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1d01('0x6'));var fs=require('fs');var fs_extra=require(_0x1d01('0x7'));var _=require('lodash');var squel=require(_0x1d01('0x8'));var crypto=require(_0x1d01('0x9'));var jsforce=require(_0x1d01('0xa'));var deskjs=require(_0x1d01('0xb'));var toCsv=require('to-csv');var querystring=require(_0x1d01('0xc'));var Papa=require(_0x1d01('0xd'));var Redis=require(_0x1d01('0xe'));var authService=require(_0x1d01('0xf'));var qs=require(_0x1d01('0x10'));var as=require(_0x1d01('0x11'));var hardwareService=require(_0x1d01('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1d01('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1d01('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf32421,_0x45ff76){_0x45ff76=_0x45ff76||0xcc;return function(_0x2d18eb){if(_0x2d18eb){return _0xf32421['sendStatus'](_0x45ff76);}return _0xf32421[_0x1d01('0x15')](_0x45ff76)[_0x1d01('0x16')]();};}function respondWithResult(_0x11c11d,_0x167140){_0x167140=_0x167140||0xc8;return function(_0x4a5b9e){if(_0x4a5b9e){return _0x11c11d[_0x1d01('0x15')](_0x167140)[_0x1d01('0x17')](_0x4a5b9e);}};}function respondWithFilteredResult(_0x2344dd,_0x282625){return function(_0x3e90cc){if(_0x3e90cc){var _0x23fad3=typeof _0x282625[_0x1d01('0x18')]===_0x1d01('0x19')&&typeof _0x282625['limit']==='undefined';var _0x8fa03a=_0x3e90cc[_0x1d01('0x1a')];var _0x465f3f=_0x23fad3?0x0:_0x282625['offset'];var _0x34f1c5=_0x23fad3?_0x3e90cc[_0x1d01('0x1a')]:_0x282625[_0x1d01('0x18')]+_0x282625[_0x1d01('0x1b')];var _0x668cbf;if(_0x34f1c5>=_0x8fa03a){_0x34f1c5=_0x8fa03a;_0x668cbf=0xc8;}else{_0x668cbf=0xce;}_0x2344dd[_0x1d01('0x15')](_0x668cbf);return _0x2344dd[_0x1d01('0x1c')](_0x1d01('0x1d'),_0x465f3f+'-'+_0x34f1c5+'/'+_0x8fa03a)['json'](_0x3e90cc);}return null;};}function patchUpdates(_0x4ac642){return function(_0x210f36){try{jsonpatch[_0x1d01('0x1e')](_0x210f36,_0x4ac642,!![]);}catch(_0x5e4d70){return BPromise[_0x1d01('0x1f')](_0x5e4d70);}return _0x210f36[_0x1d01('0x20')]();};}function saveUpdates(_0x299bfd,_0x1e9031){return function(_0x4bef58){if(_0x4bef58){return _0x4bef58[_0x1d01('0x21')](_0x299bfd)[_0x1d01('0x22')](function(_0x1ae21e){return _0x1ae21e;});}return null;};}function removeEntity(_0x23c3b6,_0x44a383){return function(_0x549236){if(_0x549236){return _0x549236[_0x1d01('0x23')]()[_0x1d01('0x22')](function(){_0x23c3b6[_0x1d01('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4787a9,_0x15dab6){return function(_0x5e587b){if(!_0x5e587b){_0x4787a9[_0x1d01('0x24')](0x194);}return _0x5e587b;};}function handleError(_0x5bc9cb,_0x37811b){_0x37811b=_0x37811b||0x1f4;return function(_0x263b0a){logger[_0x1d01('0x25')](_0x263b0a[_0x1d01('0x26')]);if(_0x263b0a[_0x1d01('0x27')]){delete _0x263b0a[_0x1d01('0x27')];}_0x5bc9cb['status'](_0x37811b)['send'](_0x263b0a);};}exports[_0x1d01('0x28')]=function(_0x18f8e4,_0x528295){var _0x49b530={},_0x5a61b7={},_0x3c71f9={'count':0x0,'rows':[]};var _0x22bc1c=_[_0x1d01('0x29')](db[_0x1d01('0x2a')][_0x1d01('0x2b')],function(_0x19a448){return{'name':_0x19a448[_0x1d01('0x2c')],'type':_0x19a448[_0x1d01('0x2d')][_0x1d01('0x2e')]};});_0x5a61b7[_0x1d01('0x2f')]=_[_0x1d01('0x29')](_0x22bc1c,'name');_0x5a61b7[_0x1d01('0x30')]=_[_0x1d01('0x31')](_0x18f8e4[_0x1d01('0x30')]);_0x5a61b7[_0x1d01('0x32')]=_[_0x1d01('0x33')](_0x5a61b7[_0x1d01('0x2f')],_0x5a61b7[_0x1d01('0x30')]);_0x49b530[_0x1d01('0x34')]=_[_0x1d01('0x33')](_0x5a61b7[_0x1d01('0x2f')],qs[_0x1d01('0x35')](_0x18f8e4[_0x1d01('0x30')]['fields']));_0x49b530[_0x1d01('0x34')]=_0x49b530[_0x1d01('0x34')][_0x1d01('0x36')]?_0x49b530[_0x1d01('0x34')]:_0x5a61b7[_0x1d01('0x2f')];if(!_0x18f8e4[_0x1d01('0x30')][_0x1d01('0x37')]('nolimit')){_0x49b530['limit']=qs[_0x1d01('0x1b')](_0x18f8e4['query'][_0x1d01('0x1b')]);_0x49b530[_0x1d01('0x18')]=qs[_0x1d01('0x18')](_0x18f8e4[_0x1d01('0x30')]['offset']);}_0x49b530[_0x1d01('0x38')]=qs[_0x1d01('0x39')](_0x18f8e4[_0x1d01('0x30')][_0x1d01('0x39')]);_0x49b530[_0x1d01('0x3a')]=qs[_0x1d01('0x32')](_[_0x1d01('0x3b')](_0x18f8e4[_0x1d01('0x30')],_0x5a61b7[_0x1d01('0x32')]),_0x22bc1c);if(_0x18f8e4[_0x1d01('0x30')][_0x1d01('0x3c')]){_0x49b530[_0x1d01('0x3a')]=_['merge'](_0x49b530[_0x1d01('0x3a')],{'$or':_[_0x1d01('0x29')](_0x22bc1c,function(_0x143521){if(_0x143521['type']!==_0x1d01('0x3d')){var _0x145db0={};_0x145db0[_0x143521['name']]={'$like':'%'+_0x18f8e4[_0x1d01('0x30')][_0x1d01('0x3c')]+'%'};return _0x145db0;}})});}_0x49b530=_[_0x1d01('0x3e')]({},_0x49b530,_0x18f8e4[_0x1d01('0x3f')]);var _0x1e5611={'where':_0x49b530[_0x1d01('0x3a')]};return db[_0x1d01('0x2a')][_0x1d01('0x1a')](_0x1e5611)['then'](function(_0x51fedd){_0x3c71f9[_0x1d01('0x1a')]=_0x51fedd;if(_0x18f8e4[_0x1d01('0x30')][_0x1d01('0x40')]){_0x49b530[_0x1d01('0x41')]=[{'all':!![]}];}return db[_0x1d01('0x2a')][_0x1d01('0x42')](_0x49b530);})['then'](function(_0x38ff16){_0x3c71f9[_0x1d01('0x43')]=_0x38ff16;return _0x3c71f9;})[_0x1d01('0x22')](respondWithFilteredResult(_0x528295,_0x49b530))['catch'](handleError(_0x528295,null));};exports[_0x1d01('0x44')]=function(_0x31db5f,_0x1aa044){var _0x540466={'raw':!![],'where':{'id':_0x31db5f[_0x1d01('0x45')]['id']}},_0x156bd1={};_0x156bd1[_0x1d01('0x2f')]=_[_0x1d01('0x31')](db['SmsApplication'][_0x1d01('0x2b')]);_0x156bd1[_0x1d01('0x30')]=_[_0x1d01('0x31')](_0x31db5f['query']);_0x156bd1[_0x1d01('0x32')]=_['intersection'](_0x156bd1[_0x1d01('0x2f')],_0x156bd1[_0x1d01('0x30')]);_0x540466[_0x1d01('0x34')]=_[_0x1d01('0x33')](_0x156bd1[_0x1d01('0x2f')],qs[_0x1d01('0x35')](_0x31db5f['query'][_0x1d01('0x35')]));_0x540466[_0x1d01('0x34')]=_0x540466['attributes'][_0x1d01('0x36')]?_0x540466['attributes']:_0x156bd1['model'];if(_0x31db5f[_0x1d01('0x30')][_0x1d01('0x40')]){_0x540466[_0x1d01('0x41')]=[{'all':!![]}];}_0x540466=_[_0x1d01('0x3e')]({},_0x540466,_0x31db5f[_0x1d01('0x3f')]);return db[_0x1d01('0x2a')][_0x1d01('0x46')](_0x540466)['then'](handleEntityNotFound(_0x1aa044,null))[_0x1d01('0x22')](respondWithResult(_0x1aa044,null))[_0x1d01('0x47')](handleError(_0x1aa044,null));};exports[_0x1d01('0x48')]=function(_0x84be6d,_0x502aca){return db[_0x1d01('0x2a')]['create'](_0x84be6d[_0x1d01('0x49')],{})['then'](respondWithResult(_0x502aca,0xc9))[_0x1d01('0x47')](handleError(_0x502aca,null));};exports[_0x1d01('0x21')]=function(_0x58c069,_0x489794){if(_0x58c069[_0x1d01('0x49')]['id']){delete _0x58c069['body']['id'];}return db[_0x1d01('0x2a')]['find']({'where':{'id':_0x58c069[_0x1d01('0x45')]['id']}})[_0x1d01('0x22')](handleEntityNotFound(_0x489794,null))[_0x1d01('0x22')](saveUpdates(_0x58c069['body'],null))[_0x1d01('0x22')](respondWithResult(_0x489794,null))[_0x1d01('0x47')](handleError(_0x489794,null));};exports['destroy']=function(_0x2f5e13,_0x3e6b8d){return db[_0x1d01('0x2a')][_0x1d01('0x46')]({'where':{'id':_0x2f5e13['params']['id']}})['then'](handleEntityNotFound(_0x3e6b8d,null))[_0x1d01('0x22')](removeEntity(_0x3e6b8d,null))[_0x1d01('0x47')](handleError(_0x3e6b8d,null));};
\ No newline at end of file
+var _0x1072=['moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','offset','set','Content-Range','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsApplication','count','includeAll','include','findAll','catch','show','params','create','body','find','rimraf','zip-dir','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1072,0x8d));var _0x2107=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x1072[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2107('0x0'));var zipdir=require(_0x2107('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2107('0x2'));var moment=require(_0x2107('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2107('0x4'));var util=require(_0x2107('0x5'));var path=require(_0x2107('0x6'));var sox=require(_0x2107('0x7'));var csv=require(_0x2107('0x8'));var ejs=require(_0x2107('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2107('0xa'));var squel=require(_0x2107('0xb'));var crypto=require('crypto');var jsforce=require(_0x2107('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2107('0x8'));var querystring=require('querystring');var Papa=require(_0x2107('0xd'));var Redis=require(_0x2107('0xe'));var authService=require(_0x2107('0xf'));var qs=require(_0x2107('0x10'));var as=require(_0x2107('0x11'));var hardwareService=require(_0x2107('0x12'));var logger=require(_0x2107('0x13'))(_0x2107('0x14'));var utils=require(_0x2107('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2107('0x16'));var db=require(_0x2107('0x17'))['db'];function respondWithStatusCode(_0x2ca117,_0x4d6102){_0x4d6102=_0x4d6102||0xcc;return function(_0x1d6c57){if(_0x1d6c57){return _0x2ca117[_0x2107('0x18')](_0x4d6102);}return _0x2ca117[_0x2107('0x19')](_0x4d6102)[_0x2107('0x1a')]();};}function respondWithResult(_0x154329,_0x5c42ca){_0x5c42ca=_0x5c42ca||0xc8;return function(_0x19292a){if(_0x19292a){return _0x154329[_0x2107('0x19')](_0x5c42ca)[_0x2107('0x1b')](_0x19292a);}};}function respondWithFilteredResult(_0x27bb72,_0x385008){return function(_0xcf4632){if(_0xcf4632){var _0x14148b=typeof _0x385008['offset']===_0x2107('0x1c')&&typeof _0x385008['limit']===_0x2107('0x1c');var _0x2456ae=_0xcf4632['count'];var _0x24f650=_0x14148b?0x0:_0x385008['offset'];var _0x5baf79=_0x14148b?_0xcf4632['count']:_0x385008[_0x2107('0x1d')]+_0x385008['limit'];var _0x922e10;if(_0x5baf79>=_0x2456ae){_0x5baf79=_0x2456ae;_0x922e10=0xc8;}else{_0x922e10=0xce;}_0x27bb72['status'](_0x922e10);return _0x27bb72[_0x2107('0x1e')](_0x2107('0x1f'),_0x24f650+'-'+_0x5baf79+'/'+_0x2456ae)[_0x2107('0x1b')](_0xcf4632);}return null;};}function patchUpdates(_0x335f66){return function(_0x28a028){try{jsonpatch['apply'](_0x28a028,_0x335f66,!![]);}catch(_0x1d8fb7){return BPromise['reject'](_0x1d8fb7);}return _0x28a028['save']();};}function saveUpdates(_0x120be0,_0x76ac5f){return function(_0x500f6c){if(_0x500f6c){return _0x500f6c[_0x2107('0x20')](_0x120be0)[_0x2107('0x21')](function(_0x2d5260){return _0x2d5260;});}return null;};}function removeEntity(_0x48573b,_0x4fd699){return function(_0xa99e8e){if(_0xa99e8e){return _0xa99e8e[_0x2107('0x22')]()[_0x2107('0x21')](function(){_0x48573b[_0x2107('0x19')](0xcc)[_0x2107('0x1a')]();});}};}function handleEntityNotFound(_0x4282ab,_0x375cfb){return function(_0x13f1b3){if(!_0x13f1b3){_0x4282ab[_0x2107('0x18')](0x194);}return _0x13f1b3;};}function handleError(_0x52b3ab,_0x3b29cc){_0x3b29cc=_0x3b29cc||0x1f4;return function(_0x39204a){logger['error'](_0x39204a[_0x2107('0x23')]);if(_0x39204a[_0x2107('0x24')]){delete _0x39204a[_0x2107('0x24')];}_0x52b3ab[_0x2107('0x19')](_0x3b29cc)[_0x2107('0x25')](_0x39204a);};}exports[_0x2107('0x26')]=function(_0x719d5a,_0x38159c){var _0x2e1a49={},_0x5eaff9={},_0x18a5e4={'count':0x0,'rows':[]};var _0x5b1066=_[_0x2107('0x27')](db['SmsApplication'][_0x2107('0x28')],function(_0x3ebe08){return{'name':_0x3ebe08[_0x2107('0x29')],'type':_0x3ebe08[_0x2107('0x2a')]['key']};});_0x5eaff9[_0x2107('0x2b')]=_[_0x2107('0x27')](_0x5b1066,'name');_0x5eaff9['query']=_[_0x2107('0x2c')](_0x719d5a[_0x2107('0x2d')]);_0x5eaff9[_0x2107('0x2e')]=_['intersection'](_0x5eaff9['model'],_0x5eaff9['query']);_0x2e1a49[_0x2107('0x2f')]=_[_0x2107('0x30')](_0x5eaff9['model'],qs[_0x2107('0x31')](_0x719d5a[_0x2107('0x2d')]['fields']));_0x2e1a49[_0x2107('0x2f')]=_0x2e1a49[_0x2107('0x2f')]['length']?_0x2e1a49[_0x2107('0x2f')]:_0x5eaff9[_0x2107('0x2b')];if(!_0x719d5a[_0x2107('0x2d')][_0x2107('0x32')](_0x2107('0x33'))){_0x2e1a49[_0x2107('0x34')]=qs['limit'](_0x719d5a['query'][_0x2107('0x34')]);_0x2e1a49[_0x2107('0x1d')]=qs[_0x2107('0x1d')](_0x719d5a[_0x2107('0x2d')]['offset']);}_0x2e1a49[_0x2107('0x35')]=qs[_0x2107('0x36')](_0x719d5a['query'][_0x2107('0x36')]);_0x2e1a49[_0x2107('0x37')]=qs[_0x2107('0x2e')](_[_0x2107('0x38')](_0x719d5a[_0x2107('0x2d')],_0x5eaff9['filters']),_0x5b1066);if(_0x719d5a[_0x2107('0x2d')][_0x2107('0x39')]){_0x2e1a49[_0x2107('0x37')]=_['merge'](_0x2e1a49['where'],{'$or':_[_0x2107('0x27')](_0x5b1066,function(_0x2dcb56){if(_0x2dcb56[_0x2107('0x2a')]!==_0x2107('0x3a')){var _0x2660e2={};_0x2660e2[_0x2dcb56[_0x2107('0x24')]]={'$like':'%'+_0x719d5a[_0x2107('0x2d')][_0x2107('0x39')]+'%'};return _0x2660e2;}})});}_0x2e1a49=_[_0x2107('0x3b')]({},_0x2e1a49,_0x719d5a[_0x2107('0x3c')]);var _0x339f50={'where':_0x2e1a49[_0x2107('0x37')]};return db[_0x2107('0x3d')][_0x2107('0x3e')](_0x339f50)['then'](function(_0x49283c){_0x18a5e4[_0x2107('0x3e')]=_0x49283c;if(_0x719d5a[_0x2107('0x2d')][_0x2107('0x3f')]){_0x2e1a49[_0x2107('0x40')]=[{'all':!![]}];}return db[_0x2107('0x3d')][_0x2107('0x41')](_0x2e1a49);})['then'](function(_0x27a55d){_0x18a5e4['rows']=_0x27a55d;return _0x18a5e4;})[_0x2107('0x21')](respondWithFilteredResult(_0x38159c,_0x2e1a49))[_0x2107('0x42')](handleError(_0x38159c,null));};exports[_0x2107('0x43')]=function(_0xd6b574,_0x488e8f){var _0x21d696={'raw':!![],'where':{'id':_0xd6b574[_0x2107('0x44')]['id']}},_0x5e17db={};_0x5e17db['model']=_[_0x2107('0x2c')](db['SmsApplication'][_0x2107('0x28')]);_0x5e17db['query']=_['keys'](_0xd6b574[_0x2107('0x2d')]);_0x5e17db['filters']=_[_0x2107('0x30')](_0x5e17db['model'],_0x5e17db['query']);_0x21d696['attributes']=_[_0x2107('0x30')](_0x5e17db[_0x2107('0x2b')],qs[_0x2107('0x31')](_0xd6b574[_0x2107('0x2d')][_0x2107('0x31')]));_0x21d696[_0x2107('0x2f')]=_0x21d696['attributes']['length']?_0x21d696['attributes']:_0x5e17db[_0x2107('0x2b')];if(_0xd6b574[_0x2107('0x2d')]['includeAll']){_0x21d696[_0x2107('0x40')]=[{'all':!![]}];}_0x21d696=_['merge']({},_0x21d696,_0xd6b574['options']);return db[_0x2107('0x3d')]['find'](_0x21d696)['then'](handleEntityNotFound(_0x488e8f,null))[_0x2107('0x21')](respondWithResult(_0x488e8f,null))[_0x2107('0x42')](handleError(_0x488e8f,null));};exports[_0x2107('0x45')]=function(_0x512b8c,_0x75c61f){return db['SmsApplication']['create'](_0x512b8c[_0x2107('0x46')],{})[_0x2107('0x21')](respondWithResult(_0x75c61f,0xc9))[_0x2107('0x42')](handleError(_0x75c61f,null));};exports[_0x2107('0x20')]=function(_0x32f7dc,_0x1fe659){if(_0x32f7dc[_0x2107('0x46')]['id']){delete _0x32f7dc[_0x2107('0x46')]['id'];}return db[_0x2107('0x3d')][_0x2107('0x47')]({'where':{'id':_0x32f7dc[_0x2107('0x44')]['id']}})[_0x2107('0x21')](handleEntityNotFound(_0x1fe659,null))[_0x2107('0x21')](saveUpdates(_0x32f7dc['body'],null))[_0x2107('0x21')](respondWithResult(_0x1fe659,null))[_0x2107('0x42')](handleError(_0x1fe659,null));};exports[_0x2107('0x22')]=function(_0x378865,_0x4ee863){return db[_0x2107('0x3d')][_0x2107('0x47')]({'where':{'id':_0x378865['params']['id']}})[_0x2107('0x21')](handleEntityNotFound(_0x4ee863,null))[_0x2107('0x21')](removeEntity(_0x4ee863,null))[_0x2107('0x42')](handleError(_0x4ee863,null));};
\ No newline at end of file
index 5e3bbef..103a742 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa525=['utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','sms_applications'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xa525,0x10f));var _0x5a52=function(_0x54e3df,_0x39edfa){_0x54e3df=_0x54e3df-0x0;var _0xa62ae5=_0xa525[_0x54e3df];return _0xa62ae5;};'use strict';var _=require(_0x5a52('0x0'));var util=require(_0x5a52('0x1'));var logger=require(_0x5a52('0x2'))(_0x5a52('0x3'));var moment=require(_0x5a52('0x4'));var BPromise=require(_0x5a52('0x5'));var rp=require(_0x5a52('0x6'));var fs=require('fs');var path=require(_0x5a52('0x7'));var rimraf=require(_0x5a52('0x8'));var config=require(_0x5a52('0x9'));var attributes=require(_0x5a52('0xa'));module[_0x5a52('0xb')]=function(_0x350300,_0x8d0ff){return _0x350300[_0x5a52('0xc')]('SmsApplication',attributes,{'tableName':_0x5a52('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5a52('0xe'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x419c=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x27c302,_0x1902ba){var _0x510c03=function(_0x3a7ffa){while(--_0x3a7ffa){_0x27c302['push'](_0x27c302['shift']());}};_0x510c03(++_0x1902ba);}(_0x419c,0xd2));var _0xc419=function(_0xebe6e2,_0x2f84d7){_0xebe6e2=_0xebe6e2-0x0;var _0x3e35cb=_0x419c[_0xebe6e2];return _0x3e35cb;};'use strict';var _=require(_0xc419('0x0'));var util=require(_0xc419('0x1'));var logger=require(_0xc419('0x2'))(_0xc419('0x3'));var moment=require(_0xc419('0x4'));var BPromise=require(_0xc419('0x5'));var rp=require(_0xc419('0x6'));var fs=require('fs');var path=require(_0xc419('0x7'));var rimraf=require(_0xc419('0x8'));var config=require(_0xc419('0x9'));var attributes=require(_0xc419('0xa'));module[_0xc419('0xb')]=function(_0x532292,_0x39a82f){return _0x532292[_0xc419('0xc')](_0xc419('0xd'),attributes,{'tableName':_0xc419('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 02aef53..3f23f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02a7=['SmsApplication,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x02a7,0x1a6));var _0x702a=function(_0x3b533c,_0x1f4990){_0x3b533c=_0x3b533c-0x0;var _0x1050e3=_0x02a7[_0x3b533c];return _0x1050e3;};'use strict';var _=require('lodash');var util=require(_0x702a('0x0'));var moment=require(_0x702a('0x1'));var BPromise=require(_0x702a('0x2'));var rs=require(_0x702a('0x3'));var fs=require('fs');var Redis=require(_0x702a('0x4'));var db=require(_0x702a('0x5'))['db'];var utils=require(_0x702a('0x6'));var logger=require(_0x702a('0x7'))(_0x702a('0x8'));var config=require(_0x702a('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x702a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6736,_0x27bfc7,_0x3f5ff8){return new BPromise(function(_0x51bf52,_0x562fdb){return client['request'](_0x4b6736,_0x3f5ff8)['then'](function(_0x3cb569){logger[_0x702a('0xb')]('SmsApplication,\x20%s,\x20%s',_0x27bfc7,_0x702a('0xc'));logger[_0x702a('0xd')](_0x702a('0xe'),_0x27bfc7,_0x702a('0xc'),JSON[_0x702a('0xf')](_0x3cb569));if(_0x3cb569[_0x702a('0x10')]){if(_0x3cb569[_0x702a('0x10')][_0x702a('0x11')]===0x1f4){logger['error'](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x562fdb(_0x3cb569[_0x702a('0x10')]['message']);}logger[_0x702a('0x10')](_0x702a('0x12'),_0x27bfc7,_0x3cb569[_0x702a('0x10')][_0x702a('0x13')]);return _0x51bf52(_0x3cb569[_0x702a('0x10')]['message']);}else{logger[_0x702a('0xb')](_0x702a('0x12'),_0x27bfc7,_0x702a('0xc'));_0x51bf52(_0x3cb569[_0x702a('0x14')][_0x702a('0x13')]);}})[_0x702a('0x15')](function(_0x451881){logger['error']('SmsApplication,\x20%s,\x20%s',_0x27bfc7,_0x451881);_0x562fdb(_0x451881);});});}
\ No newline at end of file
+var _0x49db=['request','then','info','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x49db,0xc5));var _0xb49d=function(_0x16cb3c,_0x952fb7){_0x16cb3c=_0x16cb3c-0x0;var _0x3690a8=_0x49db[_0x16cb3c];return _0x3690a8;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var moment=require(_0xb49d('0x2'));var BPromise=require(_0xb49d('0x3'));var rs=require(_0xb49d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb49d('0x5'))['db'];var utils=require(_0xb49d('0x6'));var logger=require(_0xb49d('0x7'))('rpc');var config=require(_0xb49d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb49d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4180c8,_0x15f52f,_0x572ee4){return new BPromise(function(_0x12e114,_0x128caa){return client[_0xb49d('0xa')](_0x4180c8,_0x572ee4)[_0xb49d('0xb')](function(_0x3d4825){logger[_0xb49d('0xc')]('SmsApplication,\x20%s,\x20%s',_0x15f52f,'request\x20sent');logger[_0xb49d('0xd')](_0xb49d('0xe'),_0x15f52f,_0xb49d('0xf'),JSON[_0xb49d('0x10')](_0x3d4825));if(_0x3d4825[_0xb49d('0x11')]){if(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x12')]===0x1f4){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x3d4825['error'][_0xb49d('0x14')]);return _0x128caa(_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);}logger[_0xb49d('0x11')]('SmsApplication,\x20%s,\x20%s',_0x15f52f,_0x3d4825[_0xb49d('0x11')][_0xb49d('0x14')]);return _0x12e114(_0x3d4825['error'][_0xb49d('0x14')]);}else{logger[_0xb49d('0xc')](_0xb49d('0x13'),_0x15f52f,_0xb49d('0xf'));_0x12e114(_0x3d4825[_0xb49d('0x15')][_0xb49d('0x14')]);}})[_0xb49d('0x16')](function(_0x584ade){logger[_0xb49d('0x11')](_0xb49d('0x13'),_0x15f52f,_0x584ade);_0x128caa(_0x584ade);});});}
\ No newline at end of file
index d8bb0fc..34f43ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['sms','smsinteraction:addtags','addTags','put','/:id','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked'];(function(_0x4c8d28,_0x175726){var _0x17330e=function(_0x5369ae){while(--_0x5369ae){_0x4c8d28['push'](_0x4c8d28['shift']());}};_0x17330e(++_0x175726);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0x9')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x9')](_0x0baf('0x10'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x11')]);router[_0x0baf('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0baf('0x12')](_0x0baf('0xe'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x13')]);router['post'](_0x0baf('0x14'),auth['isAuthenticated'](),interaction[_0x0baf('0x15')](_0x0baf('0x16'),_0x0baf('0x17')),controller[_0x0baf('0x18')]);router[_0x0baf('0x19')](_0x0baf('0x1a'),auth['isAuthenticated'](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1b')),controller[_0x0baf('0x1c')]);router[_0x0baf('0x1d')](_0x0baf('0x1a'),auth[_0x0baf('0xa')](),interaction['tracked'](_0x0baf('0x16'),_0x0baf('0x1e')),controller[_0x0baf('0x1f')]);router[_0x0baf('0x1d')](_0x0baf('0x14'),auth[_0x0baf('0xa')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0xea28=['put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','post','tracked','sms','smsinteraction:addtags','addTags'];(function(_0x24e003,_0x40b67d){var _0x4849ec=function(_0x5162c2){while(--_0x5162c2){_0x24e003['push'](_0x24e003['shift']());}};_0x4849ec(++_0x40b67d);}(_0xea28,0x13a));var _0x8ea2=function(_0x41f201,_0x592b3f){_0x41f201=_0x41f201-0x0;var _0x21e23b=_0xea28[_0x41f201];return _0x21e23b;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getMessages']);router['get'](_0x8ea2('0x12'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x13')]);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['addMessage']);router[_0x8ea2('0x15')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x18')),controller[_0x8ea2('0x19')]);router[_0x8ea2('0x1a')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1b')),controller[_0x8ea2('0x1c')]);router[_0x8ea2('0x1d')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),interaction[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x8ea2('0x1e')),controller[_0x8ea2('0x1f')]);router[_0x8ea2('0x1d')](_0x8ea2('0x20'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x21')]);module['exports']=router;
\ No newline at end of file
index 689c874..3bbabbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f75=['moment','exports','DATE','STRING','ENUM','out','sequelize'];(function(_0x19068c,_0x5c09a2){var _0x440b73=function(_0x8dd492){while(--_0x8dd492){_0x19068c['push'](_0x19068c['shift']());}};_0x440b73(++_0x5c09a2);}(_0x1f75,0x12c));var _0x51f7=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x1f75[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x51f7('0x0'));var moment=require(_0x51f7('0x1'));module[_0x51f7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x51f7('0x3')]},'disposition':{'type':Sequelize[_0x51f7('0x4')]},'secondDisposition':{'type':Sequelize[_0x51f7('0x4')]},'thirdDisposition':{'type':Sequelize[_0x51f7('0x4')]},'note':{'type':Sequelize[_0x51f7('0x4')]},'phone':{'type':Sequelize[_0x51f7('0x4')]},'read1stAt':{'type':Sequelize[_0x51f7('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x51f7('0x5')]('in',_0x51f7('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51f7('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x51f7('0x5')]('in',_0x51f7('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4074=['ENUM','out','sequelize','moment','exports','DATE','STRING'];(function(_0x324661,_0x3fb798){var _0x135bed=function(_0x15aed6){while(--_0x15aed6){_0x324661['push'](_0x324661['shift']());}};_0x135bed(++_0x3fb798);}(_0x4074,0xf0));var _0x4407=function(_0x5d629b,_0x4241cd){_0x5d629b=_0x5d629b-0x0;var _0x54b482=_0x4074[_0x5d629b];return _0x54b482;};'use strict';var Sequelize=require(_0x4407('0x0'));var moment=require(_0x4407('0x1'));module[_0x4407('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4407('0x3')]},'disposition':{'type':Sequelize[_0x4407('0x4')]},'secondDisposition':{'type':Sequelize[_0x4407('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4407('0x4')]},'note':{'type':Sequelize[_0x4407('0x4')]},'phone':{'type':Sequelize[_0x4407('0x4')]},'read1stAt':{'type':Sequelize[_0x4407('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4407('0x5')]('in',_0x4407('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4407('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4407('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index f003b6c..6ad2309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf33d=['SmsInteraction','getOptions','user','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','create','body','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','order','sort','where','SmsInteractionId','filter','$gte','split','format','includeAll','findAll','rows','addTags','setTags','omit','spread','Tag','emit','removeTags','download','unix','join','server','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','secret','read','SmsAccount','Account','Owner','get','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','toString','direction','out','System','value','renderFile','root','views','downloadInteraction.ejs','transcript-','Sms','unlinkSync','rimraf','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','offset','undefined','limit','count','status','set','json','destroy','then','stack','name','send','index','map'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xf33d,0xc5));var _0xdf33=function(_0x1bbe7c,_0x546931){_0x1bbe7c=_0x1bbe7c-0x0;var _0x5ab2b7=_0xf33d[_0x1bbe7c];return _0x5ab2b7;};'use strict';var rimraf=require(_0xdf33('0x0'));var zipdir=require(_0xdf33('0x1'));var moment=require(_0xdf33('0x2'));var BPromise=require(_0xdf33('0x3'));var util=require('util');var path=require(_0xdf33('0x4'));var ejs=require(_0xdf33('0x5'));var fs=require('fs');var _=require(_0xdf33('0x6'));var Redis=require(_0xdf33('0x7'));var interaction=require(_0xdf33('0x8'));var qs=require(_0xdf33('0x9'));var pdf=require('../../components/export/pdf');var logger=require(_0xdf33('0xa'))('api');var config=require(_0xdf33('0xb'));var db=require(_0xdf33('0xc'))['db'];config[_0xdf33('0xd')]=_[_0xdf33('0xe')](config[_0xdf33('0xd')],{'host':_0xdf33('0xf'),'port':0x18eb});var socket=require(_0xdf33('0x10'))(new Redis(config[_0xdf33('0xd')]));require(_0xdf33('0x11'))[_0xdf33('0x12')](socket);function respondWithStatusCode(_0x2542c1,_0x30428c){_0x30428c=_0x30428c||0xcc;return function(_0x1a2df5){if(_0x1a2df5){return _0x2542c1[_0xdf33('0x13')](_0x30428c);}return _0x2542c1['status'](_0x30428c)[_0xdf33('0x14')]();};}function respondWithResult(_0x4afbbf,_0x31ebda){_0x31ebda=_0x31ebda||0xc8;return function(_0x603dc7){if(_0x603dc7){return _0x4afbbf['status'](_0x31ebda)['json'](_0x603dc7);}};}function respondWithFilteredResult(_0x38c68d,_0x31747a){return function(_0x422b97){if(_0x422b97){var _0x55a1df=typeof _0x31747a[_0xdf33('0x15')]===_0xdf33('0x16')&&typeof _0x31747a[_0xdf33('0x17')]==='undefined';var _0x130728=_0x422b97[_0xdf33('0x18')];var _0x3c9328=_0x55a1df?0x0:_0x31747a[_0xdf33('0x15')];var _0x520f09=_0x55a1df?_0x422b97['count']:_0x31747a[_0xdf33('0x15')]+_0x31747a['limit'];var _0x390462;if(_0x520f09>=_0x130728){_0x520f09=_0x130728;_0x390462=0xc8;}else{_0x390462=0xce;}_0x38c68d[_0xdf33('0x19')](_0x390462);return _0x38c68d[_0xdf33('0x1a')]('Content-Range',_0x3c9328+'-'+_0x520f09+'/'+_0x130728)[_0xdf33('0x1b')](_0x422b97);}return null;};}function saveUpdates(_0x554f89){return function(_0x54ddbd){if(_0x54ddbd){return _0x54ddbd['update'](_0x554f89)['then'](function(_0x40f68a){return _0x40f68a;});}return null;};}function removeEntity(_0x29df64){return function(_0xf78291){if(_0xf78291){return _0xf78291[_0xdf33('0x1c')]()[_0xdf33('0x1d')](function(){_0x29df64[_0xdf33('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b4dab){return function(_0x5892b3){if(!_0x5892b3){_0x5b4dab[_0xdf33('0x13')](0x194);}return _0x5892b3;};}function handleError(_0x571afd,_0x44e6df){_0x44e6df=_0x44e6df||0x1f4;return function(_0x3ef1a3){logger['error'](_0x3ef1a3[_0xdf33('0x1e')]);if(_0x3ef1a3[_0xdf33('0x1f')]){delete _0x3ef1a3[_0xdf33('0x1f')];}_0x571afd[_0xdf33('0x19')](_0x44e6df)[_0xdf33('0x20')](_0x3ef1a3);};}exports[_0xdf33('0x21')]=function(_0x3cce99,_0x175afa){var _0x1a41e1={};var _0x8133f4=_[_0xdf33('0x22')](db[_0xdf33('0x23')]['rawAttributes'],function(_0xfaeb0f){return{'name':_0xfaeb0f['fieldName'],'type':_0xfaeb0f['type']['key']};});_0x1a41e1=qs[_0xdf33('0x24')](_0x8133f4,_0x3cce99);return interaction['findAll']('sms',_0x3cce99['query'],_0x3cce99[_0xdf33('0x25')],_0x1a41e1,_0x8133f4)[_0xdf33('0x1d')](respondWithFilteredResult(_0x175afa,_0x1a41e1))['catch'](handleError(_0x175afa,null));};exports[_0xdf33('0x26')]=function(_0x36f107,_0x9b1f24){var _0x242602={'raw':![],'where':{'id':_0x36f107[_0xdf33('0x27')]['id']}},_0x887242={};_0x887242[_0xdf33('0x28')]=_[_0xdf33('0x29')](db['SmsInteraction'][_0xdf33('0x2a')]);_0x887242[_0xdf33('0x2b')]=_[_0xdf33('0x29')](_0x36f107[_0xdf33('0x2b')]);_0x887242[_0xdf33('0x2c')]=_[_0xdf33('0x2d')](_0x887242[_0xdf33('0x28')],_0x887242[_0xdf33('0x2b')]);_0x242602['attributes']=_[_0xdf33('0x2d')](_0x887242['model'],qs['fields'](_0x36f107[_0xdf33('0x2b')][_0xdf33('0x2e')]));_0x242602[_0xdf33('0x2f')]=_0x242602[_0xdf33('0x2f')][_0xdf33('0x30')]?_0x242602[_0xdf33('0x2f')]:_0x887242[_0xdf33('0x28')];if(_0x36f107[_0xdf33('0x2b')]['includeAll']){_0x242602[_0xdf33('0x31')]=[{'all':!![]}];}_0x242602=_[_0xdf33('0x32')]({},_0x242602,_0x36f107[_0xdf33('0x33')]);return db[_0xdf33('0x23')][_0xdf33('0x34')](_0x242602)[_0xdf33('0x1d')](handleEntityNotFound(_0x9b1f24,null))[_0xdf33('0x1d')](respondWithResult(_0x9b1f24,null))[_0xdf33('0x35')](handleError(_0x9b1f24,null));};exports['create']=function(_0x5b4a5b,_0x44e6be){return db[_0xdf33('0x23')][_0xdf33('0x36')](_0x5b4a5b[_0xdf33('0x37')],{})['then'](respondWithResult(_0x44e6be,0xc9))['catch'](handleError(_0x44e6be,null));};exports['update']=function(_0x3bf332,_0x3562ac){if(_0x3bf332[_0xdf33('0x37')]['id']){delete _0x3bf332[_0xdf33('0x37')]['id'];}return db[_0xdf33('0x23')][_0xdf33('0x34')]({'where':{'id':_0x3bf332[_0xdf33('0x27')]['id']}})[_0xdf33('0x1d')](handleEntityNotFound(_0x3562ac,null))[_0xdf33('0x1d')](saveUpdates(_0x3bf332[_0xdf33('0x37')],null))[_0xdf33('0x1d')](respondWithResult(_0x3562ac,null))[_0xdf33('0x35')](handleError(_0x3562ac,null));};exports[_0xdf33('0x1c')]=function(_0x3002ae,_0x41b899){return db[_0xdf33('0x23')]['find']({'where':{'id':_0x3002ae[_0xdf33('0x27')]['id']}})[_0xdf33('0x1d')](handleEntityNotFound(_0x41b899,null))[_0xdf33('0x1d')](removeEntity(_0x41b899,null))[_0xdf33('0x35')](handleError(_0x41b899,null));};exports['describe']=function(_0x2b23ba,_0x290e77){return db[_0xdf33('0x23')]['describe']()[_0xdf33('0x1d')](respondWithResult(_0x290e77,null))[_0xdf33('0x35')](handleError(_0x290e77,null));};exports[_0xdf33('0x38')]=function(_0xbff663,_0x1f1f4d){return db[_0xdf33('0x39')][_0xdf33('0x34')]({'where':{'id':_0xbff663['params']['id']}})[_0xdf33('0x1d')](handleEntityNotFound(_0x1f1f4d,null))[_0xdf33('0x1d')](function(_0x330f23){if(_0x330f23){return _0x330f23[_0xdf33('0x38')](_0xbff663[_0xdf33('0x37')][_0xdf33('0x3a')],_['omit'](_0xbff663['body'],[_0xdf33('0x3a'),'id'])||{});}})[_0xdf33('0x1d')](respondWithResult(_0x1f1f4d,null))[_0xdf33('0x35')](handleError(_0x1f1f4d,null));};exports[_0xdf33('0x3b')]=function(_0x198f77,_0x18dce2){var _0xfdec0f={'raw':![],'where':{}};var _0xed23e2={};var _0x58e54d={'count':0x0,'rows':[]};return db[_0xdf33('0x23')][_0xdf33('0x3c')]({'where':{'id':_0x198f77[_0xdf33('0x27')]['id']}})[_0xdf33('0x1d')](handleEntityNotFound(_0x18dce2,null))[_0xdf33('0x1d')](function(_0x23dd65){if(_0x23dd65){_0xed23e2[_0xdf33('0x28')]=_[_0xdf33('0x29')](db[_0xdf33('0x39')][_0xdf33('0x2a')]);_0xed23e2['query']=_['keys'](_0x198f77[_0xdf33('0x2b')]);_0xed23e2[_0xdf33('0x2c')]=_['intersection'](_0xed23e2['model'],_0xed23e2['query']);_0xfdec0f[_0xdf33('0x2f')]=_['intersection'](_0xed23e2[_0xdf33('0x28')],qs['fields'](_0x198f77[_0xdf33('0x2b')]['fields']));_0xfdec0f[_0xdf33('0x2f')]=_0xfdec0f[_0xdf33('0x2f')][_0xdf33('0x30')]?_0xfdec0f[_0xdf33('0x2f')]:_0xed23e2['model'];if(!_0x198f77[_0xdf33('0x2b')]['hasOwnProperty'](_0xdf33('0x3d'))){_0xfdec0f[_0xdf33('0x17')]=qs['limit'](_0x198f77['query'][_0xdf33('0x17')]);_0xfdec0f['offset']=qs['offset'](_0x198f77[_0xdf33('0x2b')][_0xdf33('0x15')]);}_0xfdec0f[_0xdf33('0x3e')]=qs[_0xdf33('0x3f')](_0x198f77[_0xdf33('0x2b')][_0xdf33('0x3f')]);_0xfdec0f['where']=qs[_0xdf33('0x2c')](_['pick'](_0x198f77[_0xdf33('0x2b')],_0xed23e2[_0xdf33('0x2c')]));_0xfdec0f[_0xdf33('0x40')][_0xdf33('0x41')]=_0x23dd65['id'];if(_0x198f77[_0xdf33('0x2b')][_0xdf33('0x42')]){_0xfdec0f[_0xdf33('0x40')]=_[_0xdf33('0x32')](_0xfdec0f[_0xdf33('0x40')],{'$or':_['map'](_0xfdec0f[_0xdf33('0x2f')],function(_0x436e3e){var _0x20538b={};_0x20538b[_0x436e3e]={'$like':'%'+_0x198f77['query'][_0xdf33('0x42')]+'%'};return _0x20538b;})});}if(_0x198f77['query']['$gte']){var _0x3baae2=_0x198f77[_0xdf33('0x2b')][_0xdf33('0x43')][_0xdf33('0x44')](',');var _0x496c51={};_0x496c51[_0x3baae2[0x0]]={'$gte':moment(_0x3baae2[0x1])[_0xdf33('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0xfdec0f[_0xdf33('0x40')]=_[_0xdf33('0x32')](_0xfdec0f[_0xdf33('0x40')],_0x496c51);}_0xfdec0f=_[_0xdf33('0x32')]({},_0xfdec0f,_0x198f77[_0xdf33('0x33')]);return db[_0xdf33('0x39')]['count']({'where':_0xfdec0f['where']})['then'](function(_0x4e1cdc){_0x58e54d['count']=_0x4e1cdc;if(_0x198f77[_0xdf33('0x2b')][_0xdf33('0x46')]){_0xfdec0f['include']=[{'all':!![]}];}return db['SmsMessage'][_0xdf33('0x47')](_0xfdec0f);})[_0xdf33('0x1d')](function(_0x29e3cc){_0x58e54d[_0xdf33('0x48')]=_0x29e3cc;return _0x58e54d;});}})['then'](respondWithFilteredResult(_0x18dce2,_0xfdec0f))[_0xdf33('0x35')](handleError(_0x18dce2,null));};exports[_0xdf33('0x49')]=function(_0x408997,_0xe81d21){return db[_0xdf33('0x23')][_0xdf33('0x34')]({'where':{'id':_0x408997[_0xdf33('0x27')]['id']}})['then'](handleEntityNotFound(_0xe81d21,null))['then'](function(_0x4b06e0){if(_0x4b06e0){return _0x4b06e0[_0xdf33('0x4a')](_0x408997[_0xdf33('0x37')]['ids'],_[_0xdf33('0x4b')](_0x408997[_0xdf33('0x37')],[_0xdf33('0x3a'),'id'])||{})[_0xdf33('0x4c')](function(){return db[_0xdf33('0x4d')][_0xdf33('0x47')]({'attributes':['id',_0xdf33('0x1f'),'color'],'where':{'id':_0x408997['body'][_0xdf33('0x3a')]}});})[_0xdf33('0x1d')](function(_0x42ac11){socket[_0xdf33('0x4e')]('smsInteractionTags:save',{'id':Number(_0x408997[_0xdf33('0x27')]['id']),'tags':_0x42ac11||[]});return{'id':Number(_0x408997[_0xdf33('0x27')]['id']),'tags':_0x42ac11||[]};});}})[_0xdf33('0x1d')](respondWithResult(_0xe81d21,null))[_0xdf33('0x35')](handleError(_0xe81d21,null));};exports[_0xdf33('0x4f')]=function(_0x3b3be4,_0x2711c6){return db[_0xdf33('0x23')][_0xdf33('0x34')]({'where':{'id':_0x3b3be4[_0xdf33('0x27')]['id']}})[_0xdf33('0x1d')](handleEntityNotFound(_0x2711c6,null))[_0xdf33('0x1d')](function(_0x1e6e22){if(_0x1e6e22){return _0x1e6e22[_0xdf33('0x4f')](_0x3b3be4[_0xdf33('0x2b')]['ids']);}})['then'](respondWithStatusCode(_0x2711c6,null))[_0xdf33('0x35')](handleError(_0x2711c6,null));};exports[_0xdf33('0x50')]=function(_0x4f5ddd,_0x78710f){var _0x68d3f6=moment()[_0xdf33('0x51')]()['toString']();var _0x1c7ba4=path[_0xdf33('0x52')](config['root'],_0xdf33('0x53'),'files',_0xdf33('0x54'));var _0x4169fb=path[_0xdf33('0x52')](_0x1c7ba4,_0x68d3f6);var _0x50602e=util[_0xdf33('0x45')](_0xdf33('0x55'),_0x4f5ddd[_0xdf33('0x27')]['id'],_0x68d3f6);var _0x1e9777=path[_0xdf33('0x52')](_0x1c7ba4,_0x50602e);var _0x529705=[];_0x529705[_0xdf33('0x56')]({'model':db[_0xdf33('0x57')],'as':'User','attributes':['id',_0xdf33('0x58')],'raw':!![]});_0x529705['push']({'model':db[_0xdf33('0x59')],'as':_0xdf33('0x5a'),'attributes':['id',_0xdf33('0x5b'),_0xdf33('0x5c')],'raw':!![]});var _0x3c8d90=[{'model':db[_0xdf33('0x39')],'as':_0xdf33('0x5d'),'attributes':['id',_0xdf33('0x37'),'createdAt','direction',_0xdf33('0x5e'),_0xdf33('0x5f')],'include':_0x529705}];_0x3c8d90[_0xdf33('0x56')]({'model':db[_0xdf33('0x60')],'as':_0xdf33('0x61'),'attributes':['id',_0xdf33('0x1f')]});_0x3c8d90[_0xdf33('0x56')]({'model':db[_0xdf33('0x57')],'as':_0xdf33('0x62'),'attributes':['id',_0xdf33('0x58')]});return db[_0xdf33('0x23')]['find']({'where':{'id':_0x4f5ddd['params']['id']},'include':_0x3c8d90})['then'](handleEntityNotFound(_0x78710f,null))[_0xdf33('0x1d')](function(_0x56d63c){if(_0x56d63c){var _0x3d4e60=_0x56d63c[_0xdf33('0x63')]({'plain':!![]});fs['mkdirSync'](_0x4169fb);var _0x51e664={'channel':'Sms','account':_0x3d4e60['Account']['name'],'agent':_0x3d4e60[_0xdf33('0x62')]?_0x3d4e60[_0xdf33('0x62')]['fullname']:_0xdf33('0x64'),'createdAt':moment(_0x3d4e60[_0xdf33('0x65')])[_0xdf33('0x45')](_0xdf33('0x66'))['toString'](),'closedAt':_0x3d4e60[_0xdf33('0x67')]?moment(_0x3d4e60['closedAt'])[_0xdf33('0x45')](_0xdf33('0x66'))['toString']():'','disposition':_0x3d4e60['disposition'],'messages':_(_0x3d4e60['Messages'])['filter']({'secret':![]})[_0xdf33('0x22')](function(_0x659d77){return{'date':moment(_0x659d77[_0xdf33('0x65')])['format'](_0xdf33('0x66'))[_0xdf33('0x68')](),'sender':_0x659d77[_0xdf33('0x69')]===_0xdf33('0x6a')?_0x659d77[_0xdf33('0x57')]?_0x659d77[_0xdf33('0x57')]['fullname']:_0xdf33('0x6b'):_0x659d77[_0xdf33('0x5a')]['firstName']+(_0x659d77[_0xdf33('0x5a')]['lastName']?'\x20'+_0x659d77[_0xdf33('0x5a')]['lastName']:''),'body':_0x659d77[_0xdf33('0x37')],'direction':_0x659d77['direction']===_0xdf33('0x6a')?'A':'C','secret':_0x659d77[_0xdf33('0x5e')],'read':_0x659d77[_0xdf33('0x5f')]};})[_0xdf33('0x6c')]()};return ejs[_0xdf33('0x6d')](path['join'](config[_0xdf33('0x6e')],'server',_0xdf33('0x6f'),_0xdf33('0x70')),{'interaction':_0x51e664})[_0xdf33('0x1d')](function(_0xd0c104){var _0x14813f=path[_0xdf33('0x52')](_0x4169fb,_0xdf33('0x71')+_0x3d4e60['id']+'-'+_0x68d3f6+'.pdf');var _0x3f3bed={'path':_0x14813f,'channel':_0xdf33('0x72'),'interactionId':_0x3d4e60['id']};return pdf['createPdfFromHTML'](_0xd0c104,_0x3f3bed);})[_0xdf33('0x1d')](function(){return new BPromise(function(_0x159e33,_0x167d82){zipdir(_0x4169fb,{'saveTo':_0x1e9777},function(_0x2660e6,_0xc4c3b6){if(_0x2660e6)return _0x167d82(_0x2660e6);return _0x159e33(_0xc4c3b6);});})[_0xdf33('0x1d')](function(){return new BPromise(function(_0x4e7198,_0x35c856){rimraf(_0x4169fb,function(_0x7f68c8){if(_0x7f68c8)_0x35c856(_0x7f68c8);return _0x4e7198();});});})[_0xdf33('0x1d')](function(){return _0x78710f['download'](_0x1e9777,_0x50602e,function(_0x21cb88){if(_0x21cb88){console['log']('err',_0x21cb88);}else{fs[_0xdf33('0x73')](_0x1e9777);}});});});}else{return _0x78710f[_0xdf33('0x13')](0xc8);}})['catch'](handleError(_0x78710f,null));};
\ No newline at end of file
+var _0xe491=['format','YYYY-MM-DD\x20HH:mm:ss','options','rows','addTags','setTags','omit','spread','color','emit','smsInteractionTags:save','removeTags','unix','toString','join','root','server','files','tmp','transcript-%d-%s.zip','User','fullname','push','lastName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','Sms','N.A.','createdAt','closed','disposition','out','System','Contact','firstName','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','json','undefined','count','offset','limit','Content-Range','update','then','destroy','status','error','stack','name','send','index','map','SmsInteraction','rawAttributes','fieldName','type','getOptions','findAll','sms','query','catch','show','params','model','keys','intersection','attributes','fields','include','merge','find','create','body','describe','SmsMessage','addMessage','ids','getMessages','filters','length','hasOwnProperty','nolimit','order','sort','where','SmsInteractionId','filter','$gte'];(function(_0x2783d3,_0x5e9266){var _0x192e49=function(_0x31ef58){while(--_0x31ef58){_0x2783d3['push'](_0x2783d3['shift']());}};_0x192e49(++_0x5e9266);}(_0xe491,0x1a0));var _0x1e49=function(_0x2f0bdb,_0x526579){_0x2f0bdb=_0x2f0bdb-0x0;var _0x51e822=_0xe491[_0x2f0bdb];return _0x51e822;};'use strict';var rimraf=require(_0x1e49('0x0'));var zipdir=require(_0x1e49('0x1'));var moment=require('moment');var BPromise=require(_0x1e49('0x2'));var util=require(_0x1e49('0x3'));var path=require(_0x1e49('0x4'));var ejs=require(_0x1e49('0x5'));var fs=require('fs');var _=require(_0x1e49('0x6'));var Redis=require(_0x1e49('0x7'));var interaction=require(_0x1e49('0x8'));var qs=require('../../components/parsers/qs');var pdf=require(_0x1e49('0x9'));var logger=require(_0x1e49('0xa'))(_0x1e49('0xb'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x1e49('0xc')]=_[_0x1e49('0xd')](config[_0x1e49('0xc')],{'host':_0x1e49('0xe'),'port':0x18eb});var socket=require(_0x1e49('0xf'))(new Redis(config[_0x1e49('0xc')]));require(_0x1e49('0x10'))[_0x1e49('0x11')](socket);function respondWithStatusCode(_0x31a078,_0x2a365a){_0x2a365a=_0x2a365a||0xcc;return function(_0x435287){if(_0x435287){return _0x31a078[_0x1e49('0x12')](_0x2a365a);}return _0x31a078['status'](_0x2a365a)[_0x1e49('0x13')]();};}function respondWithResult(_0xd8661b,_0x1f5478){_0x1f5478=_0x1f5478||0xc8;return function(_0x469f3b){if(_0x469f3b){return _0xd8661b['status'](_0x1f5478)[_0x1e49('0x14')](_0x469f3b);}};}function respondWithFilteredResult(_0x423385,_0x4f52d9){return function(_0xabd589){if(_0xabd589){var _0x3d9696=typeof _0x4f52d9['offset']===_0x1e49('0x15')&&typeof _0x4f52d9['limit']===_0x1e49('0x15');var _0x281c60=_0xabd589[_0x1e49('0x16')];var _0xb5e7f6=_0x3d9696?0x0:_0x4f52d9[_0x1e49('0x17')];var _0x5c4a8f=_0x3d9696?_0xabd589[_0x1e49('0x16')]:_0x4f52d9[_0x1e49('0x17')]+_0x4f52d9[_0x1e49('0x18')];var _0x532854;if(_0x5c4a8f>=_0x281c60){_0x5c4a8f=_0x281c60;_0x532854=0xc8;}else{_0x532854=0xce;}_0x423385['status'](_0x532854);return _0x423385['set'](_0x1e49('0x19'),_0xb5e7f6+'-'+_0x5c4a8f+'/'+_0x281c60)[_0x1e49('0x14')](_0xabd589);}return null;};}function saveUpdates(_0x849a3d){return function(_0x4376af){if(_0x4376af){return _0x4376af[_0x1e49('0x1a')](_0x849a3d)[_0x1e49('0x1b')](function(_0x5e879d){return _0x5e879d;});}return null;};}function removeEntity(_0x393e55){return function(_0x32b2d1){if(_0x32b2d1){return _0x32b2d1[_0x1e49('0x1c')]()[_0x1e49('0x1b')](function(){_0x393e55[_0x1e49('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f250){return function(_0x1f442c){if(!_0x1f442c){_0x33f250[_0x1e49('0x12')](0x194);}return _0x1f442c;};}function handleError(_0x5b174c,_0x1dcbf0){_0x1dcbf0=_0x1dcbf0||0x1f4;return function(_0x1eb45a){logger[_0x1e49('0x1e')](_0x1eb45a[_0x1e49('0x1f')]);if(_0x1eb45a['name']){delete _0x1eb45a[_0x1e49('0x20')];}_0x5b174c[_0x1e49('0x1d')](_0x1dcbf0)[_0x1e49('0x21')](_0x1eb45a);};}exports[_0x1e49('0x22')]=function(_0x122d3d,_0x454dbc){var _0x4e7f31={};var _0x24c630=_[_0x1e49('0x23')](db[_0x1e49('0x24')][_0x1e49('0x25')],function(_0x1fefb6){return{'name':_0x1fefb6[_0x1e49('0x26')],'type':_0x1fefb6[_0x1e49('0x27')]['key']};});_0x4e7f31=qs[_0x1e49('0x28')](_0x24c630,_0x122d3d);return interaction[_0x1e49('0x29')](_0x1e49('0x2a'),_0x122d3d[_0x1e49('0x2b')],_0x122d3d['user'],_0x4e7f31,_0x24c630)[_0x1e49('0x1b')](respondWithFilteredResult(_0x454dbc,_0x4e7f31))[_0x1e49('0x2c')](handleError(_0x454dbc,null));};exports[_0x1e49('0x2d')]=function(_0x385c02,_0x298cc7){var _0x4f906e={'raw':![],'where':{'id':_0x385c02[_0x1e49('0x2e')]['id']}},_0x5d3231={};_0x5d3231[_0x1e49('0x2f')]=_[_0x1e49('0x30')](db['SmsInteraction'][_0x1e49('0x25')]);_0x5d3231[_0x1e49('0x2b')]=_['keys'](_0x385c02[_0x1e49('0x2b')]);_0x5d3231['filters']=_[_0x1e49('0x31')](_0x5d3231['model'],_0x5d3231['query']);_0x4f906e[_0x1e49('0x32')]=_[_0x1e49('0x31')](_0x5d3231[_0x1e49('0x2f')],qs[_0x1e49('0x33')](_0x385c02[_0x1e49('0x2b')][_0x1e49('0x33')]));_0x4f906e[_0x1e49('0x32')]=_0x4f906e[_0x1e49('0x32')]['length']?_0x4f906e[_0x1e49('0x32')]:_0x5d3231[_0x1e49('0x2f')];if(_0x385c02[_0x1e49('0x2b')]['includeAll']){_0x4f906e[_0x1e49('0x34')]=[{'all':!![]}];}_0x4f906e=_[_0x1e49('0x35')]({},_0x4f906e,_0x385c02['options']);return db[_0x1e49('0x24')][_0x1e49('0x36')](_0x4f906e)[_0x1e49('0x1b')](handleEntityNotFound(_0x298cc7,null))[_0x1e49('0x1b')](respondWithResult(_0x298cc7,null))[_0x1e49('0x2c')](handleError(_0x298cc7,null));};exports[_0x1e49('0x37')]=function(_0x311713,_0x64b7bc){return db[_0x1e49('0x24')][_0x1e49('0x37')](_0x311713[_0x1e49('0x38')],{})[_0x1e49('0x1b')](respondWithResult(_0x64b7bc,0xc9))[_0x1e49('0x2c')](handleError(_0x64b7bc,null));};exports['update']=function(_0x1492da,_0x3723e2){if(_0x1492da[_0x1e49('0x38')]['id']){delete _0x1492da[_0x1e49('0x38')]['id'];}return db[_0x1e49('0x24')][_0x1e49('0x36')]({'where':{'id':_0x1492da[_0x1e49('0x2e')]['id']}})[_0x1e49('0x1b')](handleEntityNotFound(_0x3723e2,null))['then'](saveUpdates(_0x1492da[_0x1e49('0x38')],null))[_0x1e49('0x1b')](respondWithResult(_0x3723e2,null))[_0x1e49('0x2c')](handleError(_0x3723e2,null));};exports[_0x1e49('0x1c')]=function(_0x228b04,_0xf239c1){return db[_0x1e49('0x24')][_0x1e49('0x36')]({'where':{'id':_0x228b04[_0x1e49('0x2e')]['id']}})['then'](handleEntityNotFound(_0xf239c1,null))[_0x1e49('0x1b')](removeEntity(_0xf239c1,null))[_0x1e49('0x2c')](handleError(_0xf239c1,null));};exports[_0x1e49('0x39')]=function(_0x136463,_0x3e23b8){return db[_0x1e49('0x24')][_0x1e49('0x39')]()['then'](respondWithResult(_0x3e23b8,null))[_0x1e49('0x2c')](handleError(_0x3e23b8,null));};exports['addMessage']=function(_0x4670a0,_0x5c6548){return db[_0x1e49('0x3a')][_0x1e49('0x36')]({'where':{'id':_0x4670a0['params']['id']}})[_0x1e49('0x1b')](handleEntityNotFound(_0x5c6548,null))[_0x1e49('0x1b')](function(_0xded17){if(_0xded17){return _0xded17[_0x1e49('0x3b')](_0x4670a0['body'][_0x1e49('0x3c')],_['omit'](_0x4670a0[_0x1e49('0x38')],[_0x1e49('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x5c6548,null))[_0x1e49('0x2c')](handleError(_0x5c6548,null));};exports[_0x1e49('0x3d')]=function(_0x107185,_0x353d24){var _0x5f4d53={'raw':![],'where':{}};var _0x3f7697={};var _0x338e2d={'count':0x0,'rows':[]};return db[_0x1e49('0x24')]['findOne']({'where':{'id':_0x107185[_0x1e49('0x2e')]['id']}})[_0x1e49('0x1b')](handleEntityNotFound(_0x353d24,null))[_0x1e49('0x1b')](function(_0x402beb){if(_0x402beb){_0x3f7697[_0x1e49('0x2f')]=_['keys'](db['SmsMessage']['rawAttributes']);_0x3f7697[_0x1e49('0x2b')]=_[_0x1e49('0x30')](_0x107185[_0x1e49('0x2b')]);_0x3f7697[_0x1e49('0x3e')]=_[_0x1e49('0x31')](_0x3f7697[_0x1e49('0x2f')],_0x3f7697[_0x1e49('0x2b')]);_0x5f4d53['attributes']=_[_0x1e49('0x31')](_0x3f7697[_0x1e49('0x2f')],qs['fields'](_0x107185[_0x1e49('0x2b')][_0x1e49('0x33')]));_0x5f4d53[_0x1e49('0x32')]=_0x5f4d53[_0x1e49('0x32')][_0x1e49('0x3f')]?_0x5f4d53[_0x1e49('0x32')]:_0x3f7697[_0x1e49('0x2f')];if(!_0x107185[_0x1e49('0x2b')][_0x1e49('0x40')](_0x1e49('0x41'))){_0x5f4d53[_0x1e49('0x18')]=qs['limit'](_0x107185[_0x1e49('0x2b')][_0x1e49('0x18')]);_0x5f4d53[_0x1e49('0x17')]=qs['offset'](_0x107185[_0x1e49('0x2b')][_0x1e49('0x17')]);}_0x5f4d53[_0x1e49('0x42')]=qs[_0x1e49('0x43')](_0x107185[_0x1e49('0x2b')][_0x1e49('0x43')]);_0x5f4d53[_0x1e49('0x44')]=qs['filters'](_['pick'](_0x107185[_0x1e49('0x2b')],_0x3f7697[_0x1e49('0x3e')]));_0x5f4d53[_0x1e49('0x44')][_0x1e49('0x45')]=_0x402beb['id'];if(_0x107185[_0x1e49('0x2b')][_0x1e49('0x46')]){_0x5f4d53[_0x1e49('0x44')]=_[_0x1e49('0x35')](_0x5f4d53['where'],{'$or':_['map'](_0x5f4d53[_0x1e49('0x32')],function(_0x3b9d07){var _0x5f0405={};_0x5f0405[_0x3b9d07]={'$like':'%'+_0x107185[_0x1e49('0x2b')][_0x1e49('0x46')]+'%'};return _0x5f0405;})});}if(_0x107185['query'][_0x1e49('0x47')]){var _0x23cb34=_0x107185[_0x1e49('0x2b')]['$gte']['split'](',');var _0x3aff0d={};_0x3aff0d[_0x23cb34[0x0]]={'$gte':moment(_0x23cb34[0x1])[_0x1e49('0x48')](_0x1e49('0x49'))};_0x5f4d53['where']=_[_0x1e49('0x35')](_0x5f4d53[_0x1e49('0x44')],_0x3aff0d);}_0x5f4d53=_[_0x1e49('0x35')]({},_0x5f4d53,_0x107185[_0x1e49('0x4a')]);return db['SmsMessage']['count']({'where':_0x5f4d53[_0x1e49('0x44')]})['then'](function(_0x5336e9){_0x338e2d[_0x1e49('0x16')]=_0x5336e9;if(_0x107185[_0x1e49('0x2b')]['includeAll']){_0x5f4d53['include']=[{'all':!![]}];}return db[_0x1e49('0x3a')]['findAll'](_0x5f4d53);})['then'](function(_0x2eb0c0){_0x338e2d[_0x1e49('0x4b')]=_0x2eb0c0;return _0x338e2d;});}})[_0x1e49('0x1b')](respondWithFilteredResult(_0x353d24,_0x5f4d53))[_0x1e49('0x2c')](handleError(_0x353d24,null));};exports[_0x1e49('0x4c')]=function(_0x2accca,_0x10abf8){return db[_0x1e49('0x24')][_0x1e49('0x36')]({'where':{'id':_0x2accca[_0x1e49('0x2e')]['id']}})[_0x1e49('0x1b')](handleEntityNotFound(_0x10abf8,null))[_0x1e49('0x1b')](function(_0x227e4c){if(_0x227e4c){return _0x227e4c[_0x1e49('0x4d')](_0x2accca[_0x1e49('0x38')][_0x1e49('0x3c')],_[_0x1e49('0x4e')](_0x2accca[_0x1e49('0x38')],['ids','id'])||{})[_0x1e49('0x4f')](function(){return db['Tag'][_0x1e49('0x29')]({'attributes':['id','name',_0x1e49('0x50')],'where':{'id':_0x2accca[_0x1e49('0x38')][_0x1e49('0x3c')]}});})[_0x1e49('0x1b')](function(_0x1b06a9){socket[_0x1e49('0x51')](_0x1e49('0x52'),{'id':Number(_0x2accca[_0x1e49('0x2e')]['id']),'tags':_0x1b06a9||[]});return{'id':Number(_0x2accca[_0x1e49('0x2e')]['id']),'tags':_0x1b06a9||[]};});}})[_0x1e49('0x1b')](respondWithResult(_0x10abf8,null))['catch'](handleError(_0x10abf8,null));};exports[_0x1e49('0x53')]=function(_0x3cec7f,_0x17fe9f){return db[_0x1e49('0x24')][_0x1e49('0x36')]({'where':{'id':_0x3cec7f[_0x1e49('0x2e')]['id']}})[_0x1e49('0x1b')](handleEntityNotFound(_0x17fe9f,null))[_0x1e49('0x1b')](function(_0x4c3ad2){if(_0x4c3ad2){return _0x4c3ad2[_0x1e49('0x53')](_0x3cec7f[_0x1e49('0x2b')][_0x1e49('0x3c')]);}})[_0x1e49('0x1b')](respondWithStatusCode(_0x17fe9f,null))[_0x1e49('0x2c')](handleError(_0x17fe9f,null));};exports['download']=function(_0x510ff2,_0x4f108a){var _0x3821e4=moment()[_0x1e49('0x54')]()[_0x1e49('0x55')]();var _0x9d3094=path[_0x1e49('0x56')](config[_0x1e49('0x57')],_0x1e49('0x58'),_0x1e49('0x59'),_0x1e49('0x5a'));var _0x21372b=path[_0x1e49('0x56')](_0x9d3094,_0x3821e4);var _0x175589=util[_0x1e49('0x48')](_0x1e49('0x5b'),_0x510ff2['params']['id'],_0x3821e4);var _0x32107c=path[_0x1e49('0x56')](_0x9d3094,_0x175589);var _0x7269f6=[];_0x7269f6['push']({'model':db[_0x1e49('0x5c')],'as':_0x1e49('0x5c'),'attributes':['id',_0x1e49('0x5d')],'raw':!![]});_0x7269f6[_0x1e49('0x5e')]({'model':db['CmContact'],'as':'Contact','attributes':['id','firstName',_0x1e49('0x5f')],'raw':!![]});var _0x54cd8a=[{'model':db['SmsMessage'],'as':_0x1e49('0x60'),'attributes':['id',_0x1e49('0x38'),'createdAt',_0x1e49('0x61'),_0x1e49('0x62'),_0x1e49('0x63')],'include':_0x7269f6}];_0x54cd8a['push']({'model':db[_0x1e49('0x64')],'as':_0x1e49('0x65'),'attributes':['id',_0x1e49('0x20')]});_0x54cd8a['push']({'model':db[_0x1e49('0x5c')],'as':_0x1e49('0x66'),'attributes':['id',_0x1e49('0x5d')]});return db['SmsInteraction'][_0x1e49('0x36')]({'where':{'id':_0x510ff2[_0x1e49('0x2e')]['id']},'include':_0x54cd8a})[_0x1e49('0x1b')](handleEntityNotFound(_0x4f108a,null))[_0x1e49('0x1b')](function(_0x2fc37d){if(_0x2fc37d){var _0xc09e08=_0x2fc37d[_0x1e49('0x67')]({'plain':!![]});fs[_0x1e49('0x68')](_0x21372b);var _0x5d85d1={'channel':_0x1e49('0x69'),'account':_0xc09e08[_0x1e49('0x65')][_0x1e49('0x20')],'agent':_0xc09e08[_0x1e49('0x66')]?_0xc09e08[_0x1e49('0x66')][_0x1e49('0x5d')]:_0x1e49('0x6a'),'createdAt':moment(_0xc09e08[_0x1e49('0x6b')])[_0x1e49('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1e49('0x55')](),'closedAt':_0xc09e08[_0x1e49('0x6c')]?moment(_0xc09e08['closedAt'])[_0x1e49('0x48')](_0x1e49('0x49'))[_0x1e49('0x55')]():'','disposition':_0xc09e08[_0x1e49('0x6d')],'messages':_(_0xc09e08[_0x1e49('0x60')])[_0x1e49('0x46')]({'secret':![]})['map'](function(_0x4b13a3){return{'date':moment(_0x4b13a3['createdAt'])[_0x1e49('0x48')](_0x1e49('0x49'))['toString'](),'sender':_0x4b13a3['direction']===_0x1e49('0x6e')?_0x4b13a3[_0x1e49('0x5c')]?_0x4b13a3[_0x1e49('0x5c')]['fullname']:_0x1e49('0x6f'):_0x4b13a3[_0x1e49('0x70')][_0x1e49('0x71')]+(_0x4b13a3[_0x1e49('0x70')][_0x1e49('0x5f')]?'\x20'+_0x4b13a3['Contact']['lastName']:''),'body':_0x4b13a3[_0x1e49('0x38')],'direction':_0x4b13a3[_0x1e49('0x61')]===_0x1e49('0x6e')?'A':'C','secret':_0x4b13a3['secret'],'read':_0x4b13a3[_0x1e49('0x63')]};})['value']()};return ejs['renderFile'](path[_0x1e49('0x56')](config[_0x1e49('0x57')],_0x1e49('0x58'),_0x1e49('0x72'),_0x1e49('0x73')),{'interaction':_0x5d85d1})[_0x1e49('0x1b')](function(_0xbb6882){var _0x40b624=path[_0x1e49('0x56')](_0x21372b,_0x1e49('0x74')+_0xc09e08['id']+'-'+_0x3821e4+_0x1e49('0x75'));var _0x5ea086={'path':_0x40b624,'channel':_0x1e49('0x69'),'interactionId':_0xc09e08['id']};return pdf['createPdfFromHTML'](_0xbb6882,_0x5ea086);})['then'](function(){return new BPromise(function(_0x706b7b,_0x9e2b7f){zipdir(_0x21372b,{'saveTo':_0x32107c},function(_0x1393f4,_0x226170){if(_0x1393f4)return _0x9e2b7f(_0x1393f4);return _0x706b7b(_0x226170);});})[_0x1e49('0x1b')](function(){return new BPromise(function(_0x3a019a,_0x37633b){rimraf(_0x21372b,function(_0x493a09){if(_0x493a09)_0x37633b(_0x493a09);return _0x3a019a();});});})[_0x1e49('0x1b')](function(){return _0x4f108a[_0x1e49('0x76')](_0x32107c,_0x175589,function(_0x2cf097){if(_0x2cf097){console[_0x1e49('0x77')](_0x1e49('0x78'),_0x2cf097);}else{fs[_0x1e49('0x79')](_0x32107c);}});});});}else{return _0x4f108a[_0x1e49('0x12')](0xc8);}})[_0x1e49('0x2c')](handleError(_0x4f108a,null));};
\ No newline at end of file
index 85f7e88..bc388e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9582=['../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x54c1e0,_0x4cf4e5){var _0x5192a6=function(_0x29139a){while(--_0x29139a){_0x54c1e0['push'](_0x54c1e0['shift']());}};_0x5192a6(++_0x4cf4e5);}(_0x9582,0x95));var _0x2958=function(_0x3aac1e,_0x4176b5){_0x3aac1e=_0x3aac1e-0x0;var _0x2f1b98=_0x9582[_0x3aac1e];return _0x2f1b98;};'use strict';var EventEmitter=require(_0x2958('0x0'));var SmsInteraction=require(_0x2958('0x1'))['db'][_0x2958('0x2')];var SmsMessage=require(_0x2958('0x1'))['db'][_0x2958('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2958('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2958('0x5'),'afterDestroy':_0x2958('0x6')};function emitEvent(_0x136c77){return function(_0x195138,_0x2f15c9,_0xbde128){_0x195138[_0x2958('0x7')]({'attributes':['id'],'raw':!![]})[_0x2958('0x8')](function(_0xa385ec){_0x195138[_0x2958('0x9')]('Users',_0xa385ec['map'](function(_0x313702){return{'id':_0x313702['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x195138['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2958('0x8')](function(_0x51e460){_0x195138[_0x2958('0x9')]('unreadMessages',_0x51e460[_0x2958('0xa')]);SmsInteractionEvents[_0x2958('0xb')](_0x136c77+':'+_0x195138['id'],_0x195138);SmsInteractionEvents[_0x2958('0xb')](_0x136c77,_0x195138);_0xbde128(null);})[_0x2958('0xc')](_0xbde128(null));};}for(var e in events){if(events[_0x2958('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x2958('0xe')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0xa1771e,_0x1e21cd){var _0x158f3a=function(_0x6487e2){while(--_0x6487e2){_0xa1771e['push'](_0xa1771e['shift']());}};_0x158f3a(++_0x1e21cd);}(_0x3266,0x6a));var _0x6326=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x3266[_0x36ed3c];return _0x52a2e0;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents;
\ No newline at end of file
index cace791..893c8aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ff7=['moment','request-promise','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x34ecf0,_0x407a2c){var _0x2ad601=function(_0x22dc39){while(--_0x22dc39){_0x34ecf0['push'](_0x34ecf0['shift']());}};_0x2ad601(++_0x407a2c);}(_0x3ff7,0x1e1));var _0x73ff=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x3ff7[_0x10f6e8];return _0x35bb3c;};'use strict';var _=require(_0x73ff('0x0'));var util=require(_0x73ff('0x1'));var logger=require('../../config/logger')(_0x73ff('0x2'));var moment=require(_0x73ff('0x3'));var BPromise=require('bluebird');var rp=require(_0x73ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73ff('0x5'));var config=require(_0x73ff('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x73ff('0x7')]=function(_0x4c600e,_0x5f30fe){return _0x4c600e['define'](_0x73ff('0x8'),attributes,{'tableName':_0x73ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x398dbd,_0x234f48,_0x98c3bc){if(_0x398dbd['changed']('closed')){_0x398dbd['closedAt']=moment()['format'](_0x73ff('0xa'));}_0x98c3bc(null,_0x398dbd);}}});};
\ No newline at end of file
+var _0xbcad=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x44aa52,_0x5c1b42){var _0xb76201=function(_0x282e21){while(--_0x282e21){_0x44aa52['push'](_0x44aa52['shift']());}};_0xb76201(++_0x5c1b42);}(_0xbcad,0x1b1));var _0xdbca=function(_0x54219a,_0x298507){_0x54219a=_0x54219a-0x0;var _0x451d2b=_0xbcad[_0x54219a];return _0x451d2b;};'use strict';var _=require(_0xdbca('0x0'));var util=require('util');var logger=require(_0xdbca('0x1'))(_0xdbca('0x2'));var moment=require(_0xdbca('0x3'));var BPromise=require(_0xdbca('0x4'));var rp=require(_0xdbca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdbca('0x6'));var config=require(_0xdbca('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xdbca('0x8')]=function(_0x3e4b6a,_0x2b2cea){return _0x3e4b6a[_0xdbca('0x9')]('SmsInteraction',attributes,{'tableName':_0xdbca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4166e1,_0x3c39e4,_0x597b28){if(_0x4166e1[_0xdbca('0xb')]('closed')){_0x4166e1['closedAt']=moment()[_0xdbca('0xc')](_0xdbca('0xd'));}_0x597b28(null,_0x4166e1);}}});};
\ No newline at end of file
index 024091a..05d54ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4d1=['./smsInteraction.socket','request','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsInteraction','body','options','raw','where','attributes','limit','then','UpdateSmsInteraction','AddTagsToSmsInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x4f0217,_0x29aa7e){var _0x4da152=function(_0x213af1){while(--_0x213af1){_0x4f0217['push'](_0x4f0217['shift']());}};_0x4da152(++_0x29aa7e);}(_0xa4d1,0x1d3));var _0x1a4d=function(_0x1a73af,_0x5b5055){_0x1a73af=_0x1a73af-0x0;var _0x4d309a=_0xa4d1[_0x1a73af];return _0x4d309a;};'use strict';var _=require(_0x1a4d('0x0'));var util=require('util');var moment=require(_0x1a4d('0x1'));var BPromise=require('bluebird');var rs=require(_0x1a4d('0x2'));var fs=require('fs');var Redis=require(_0x1a4d('0x3'));var db=require(_0x1a4d('0x4'))['db'];var utils=require(_0x1a4d('0x5'));var logger=require('../../config/logger')(_0x1a4d('0x6'));var config=require(_0x1a4d('0x7'));var jayson=require(_0x1a4d('0x8'));var client=jayson['client'][_0x1a4d('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1a4d('0xa')],{'host':_0x1a4d('0xb'),'port':0x18eb});var socket=require(_0x1a4d('0xc'))(new Redis(config[_0x1a4d('0xa')]));require(_0x1a4d('0xd'))['register'](socket);function respondWithRpcPromise(_0x5c0165,_0x319e0c,_0x26a513){return new BPromise(function(_0x383bc4,_0x3130ca){return client[_0x1a4d('0xe')](_0x5c0165,_0x26a513)['then'](function(_0x3daa79){logger[_0x1a4d('0xf')](_0x1a4d('0x10'),_0x319e0c,_0x1a4d('0x11'));logger[_0x1a4d('0x12')](_0x1a4d('0x13'),_0x319e0c,'request\x20sent',JSON[_0x1a4d('0x14')](_0x3daa79));if(_0x3daa79[_0x1a4d('0x15')]){if(_0x3daa79[_0x1a4d('0x15')][_0x1a4d('0x16')]===0x1f4){logger[_0x1a4d('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x319e0c,_0x3daa79[_0x1a4d('0x15')]['message']);return _0x3130ca(_0x3daa79[_0x1a4d('0x15')][_0x1a4d('0x17')]);}logger[_0x1a4d('0x15')](_0x1a4d('0x10'),_0x319e0c,_0x3daa79['error'][_0x1a4d('0x17')]);return _0x383bc4(_0x3daa79['error']['message']);}else{logger[_0x1a4d('0xf')](_0x1a4d('0x10'),_0x319e0c,'request\x20sent');_0x383bc4(_0x3daa79['result'][_0x1a4d('0x17')]);}})[_0x1a4d('0x18')](function(_0x23a917){logger['error'](_0x1a4d('0x10'),_0x319e0c,_0x23a917);_0x3130ca(_0x23a917);});});}exports['UpdateSmsInteraction']=function(_0x1f1e43){var _0x39c31a=this;return new Promise(function(_0x5a0836,_0x45e4b2){return db[_0x1a4d('0x19')]['update'](_0x1f1e43[_0x1a4d('0x1a')],{'raw':_0x1f1e43[_0x1a4d('0x1b')]?_0x1f1e43['options'][_0x1a4d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f1e43[_0x1a4d('0x1b')]?_0x1f1e43['options'][_0x1a4d('0x1d')]||null:null,'attributes':_0x1f1e43[_0x1a4d('0x1b')]?_0x1f1e43[_0x1a4d('0x1b')][_0x1a4d('0x1e')]||null:null,'limit':_0x1f1e43[_0x1a4d('0x1b')]?_0x1f1e43[_0x1a4d('0x1b')][_0x1a4d('0x1f')]||null:null})[_0x1a4d('0x20')](function(_0x44bfb9){logger[_0x1a4d('0xf')](_0x1a4d('0x21'),_0x1f1e43);logger['debug'](_0x1a4d('0x21'),_0x1f1e43,JSON['stringify'](_0x44bfb9));_0x5a0836(_0x44bfb9);})['catch'](function(_0x2d19b5){logger[_0x1a4d('0x15')](_0x1a4d('0x21'),_0x2d19b5[_0x1a4d('0x17')],_0x1f1e43);_0x45e4b2(_0x39c31a['error'](0x1f4,_0x2d19b5['message']));});});};exports[_0x1a4d('0x22')]=function(_0xafdc90){return new Promise(function(_0x2ab0d3,_0x842ad0){return db[_0x1a4d('0x19')]['find']({'where':_0xafdc90['options']?_0xafdc90[_0x1a4d('0x1b')][_0x1a4d('0x1d')]||null:null})[_0x1a4d('0x20')](function(_0x4ab742){if(_0x4ab742){return _0x4ab742[_0x1a4d('0x23')](_0xafdc90[_0x1a4d('0x1a')][_0x1a4d('0x24')],_[_0x1a4d('0x25')](_0xafdc90[_0x1a4d('0x1a')],['ids','id'])||{});}})[_0x1a4d('0x26')](function(_0x52fb52){logger['info'](_0x1a4d('0x27'),_0xafdc90);logger['debug'](_0x1a4d('0x27'),_0xafdc90,JSON[_0x1a4d('0x14')](_0x52fb52));_0x2ab0d3(_0x52fb52);})[_0x1a4d('0x18')](function(_0x5ed11b){logger[_0x1a4d('0x15')]('AddTags',_0x5ed11b[_0x1a4d('0x17')],_0xafdc90);_0x842ad0(_this[_0x1a4d('0x15')](0x1f4,_0x5ed11b[_0x1a4d('0x17')]));});});};
\ No newline at end of file
+var _0xd3f9=['AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateSmsInteraction','SmsInteraction','update','body','options','attributes','limit','catch','find','then','ids','omit'];(function(_0xeb3257,_0xfa4e63){var _0x426c59=function(_0xe87f70){while(--_0xe87f70){_0xeb3257['push'](_0xeb3257['shift']());}};_0x426c59(++_0xfa4e63);}(_0xd3f9,0x157));var _0x9d3f=function(_0x4f6ea1,_0x2e58bd){_0x4f6ea1=_0x4f6ea1-0x0;var _0xeafe93=_0xd3f9[_0x4f6ea1];return _0xeafe93;};'use strict';var _=require(_0x9d3f('0x0'));var util=require(_0x9d3f('0x1'));var moment=require(_0x9d3f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d3f('0x3'));var db=require(_0x9d3f('0x4'))['db'];var utils=require(_0x9d3f('0x5'));var logger=require(_0x9d3f('0x6'))(_0x9d3f('0x7'));var config=require(_0x9d3f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d3f('0x9')][_0x9d3f('0xa')]({'port':0x232a});config['redis']=_[_0x9d3f('0xb')](config[_0x9d3f('0xc')],{'host':_0x9d3f('0xd'),'port':0x18eb});var socket=require(_0x9d3f('0xe'))(new Redis(config['redis']));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x4524c9,_0x4ce895,_0x5962d1){return new BPromise(function(_0x2371b7,_0x53038a){return client['request'](_0x4524c9,_0x5962d1)['then'](function(_0x4d7a6b){logger[_0x9d3f('0xf')](_0x9d3f('0x10'),_0x4ce895,_0x9d3f('0x11'));logger[_0x9d3f('0x12')](_0x9d3f('0x13'),_0x4ce895,_0x9d3f('0x11'),JSON[_0x9d3f('0x14')](_0x4d7a6b));if(_0x4d7a6b[_0x9d3f('0x15')]){if(_0x4d7a6b[_0x9d3f('0x15')][_0x9d3f('0x16')]===0x1f4){logger[_0x9d3f('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x4ce895,_0x4d7a6b[_0x9d3f('0x15')][_0x9d3f('0x17')]);return _0x53038a(_0x4d7a6b['error'][_0x9d3f('0x17')]);}logger[_0x9d3f('0x15')](_0x9d3f('0x10'),_0x4ce895,_0x4d7a6b[_0x9d3f('0x15')]['message']);return _0x2371b7(_0x4d7a6b['error'][_0x9d3f('0x17')]);}else{logger[_0x9d3f('0xf')]('SmsInteraction,\x20%s,\x20%s',_0x4ce895,_0x9d3f('0x11'));_0x2371b7(_0x4d7a6b[_0x9d3f('0x18')][_0x9d3f('0x17')]);}})['catch'](function(_0x1f69c6){logger['error'](_0x9d3f('0x10'),_0x4ce895,_0x1f69c6);_0x53038a(_0x1f69c6);});});}exports[_0x9d3f('0x19')]=function(_0x62d521){var _0x5864cb=this;return new Promise(function(_0x22fde9,_0x5de2f2){return db[_0x9d3f('0x1a')][_0x9d3f('0x1b')](_0x62d521[_0x9d3f('0x1c')],{'raw':_0x62d521[_0x9d3f('0x1d')]?_0x62d521[_0x9d3f('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x62d521['options']?_0x62d521[_0x9d3f('0x1d')]['where']||null:null,'attributes':_0x62d521[_0x9d3f('0x1d')]?_0x62d521[_0x9d3f('0x1d')][_0x9d3f('0x1e')]||null:null,'limit':_0x62d521[_0x9d3f('0x1d')]?_0x62d521[_0x9d3f('0x1d')][_0x9d3f('0x1f')]||null:null})['then'](function(_0x197baf){logger[_0x9d3f('0xf')](_0x9d3f('0x19'),_0x62d521);logger[_0x9d3f('0x12')](_0x9d3f('0x19'),_0x62d521,JSON[_0x9d3f('0x14')](_0x197baf));_0x22fde9(_0x197baf);})[_0x9d3f('0x20')](function(_0x3b1992){logger[_0x9d3f('0x15')](_0x9d3f('0x19'),_0x3b1992['message'],_0x62d521);_0x5de2f2(_0x5864cb[_0x9d3f('0x15')](0x1f4,_0x3b1992[_0x9d3f('0x17')]));});});};exports['AddTagsToSmsInteraction']=function(_0x202191){return new Promise(function(_0x4e269f,_0x51e50c){return db['SmsInteraction'][_0x9d3f('0x21')]({'where':_0x202191[_0x9d3f('0x1d')]?_0x202191['options']['where']||null:null})[_0x9d3f('0x22')](function(_0x16e022){if(_0x16e022){return _0x16e022['addTags'](_0x202191['body'][_0x9d3f('0x23')],_[_0x9d3f('0x24')](_0x202191[_0x9d3f('0x1c')],[_0x9d3f('0x23'),'id'])||{});}})['spread'](function(_0x4bf12c){logger[_0x9d3f('0xf')](_0x9d3f('0x25'),_0x202191);logger['debug'](_0x9d3f('0x25'),_0x202191,JSON['stringify'](_0x4bf12c));_0x4e269f(_0x4bf12c);})['catch'](function(_0x3b1fee){logger[_0x9d3f('0x15')](_0x9d3f('0x25'),_0x3b1fee['message'],_0x202191);_0x51e50c(_this[_0x9d3f('0x15')](0x1f4,_0x3b1fee[_0x9d3f('0x17')]));});});};
\ No newline at end of file
index 8238686..b4cbde4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3927=['length','smsInteraction:','save','remove','update','emit'];(function(_0x566d06,_0x91860d){var _0x51233e=function(_0x34d75c){while(--_0x34d75c){_0x566d06['push'](_0x566d06['shift']());}};_0x51233e(++_0x91860d);}(_0x3927,0x188));var _0x7392=function(_0x130664,_0x16f1e2){_0x130664=_0x130664-0x0;var _0x580947=_0x3927[_0x130664];return _0x580947;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x7392('0x0'),_0x7392('0x1'),_0x7392('0x2')];function createListener(_0x5e31f3,_0x14157b){return function(_0x4c07a0){_0x14157b[_0x7392('0x3')](_0x5e31f3,_0x4c07a0);};}function removeListener(_0x396d90,_0x48569c){return function(){SmsInteractionEvents['removeListener'](_0x396d90,_0x48569c);};}exports['register']=function(_0x55dfbe){for(var _0x2fc114=0x0,_0x2c81d7=events[_0x7392('0x4')];_0x2fc114<_0x2c81d7;_0x2fc114++){var _0x357d29=events[_0x2fc114];var _0x4f1012=createListener(_0x7392('0x5')+_0x357d29,_0x55dfbe);SmsInteractionEvents['on'](_0x357d29,_0x4f1012);}};
\ No newline at end of file
+var _0x2e1a=['update','emit','register','./smsInteraction.events','save','remove'];(function(_0x40f7be,_0x49e2a3){var _0x5dde74=function(_0x5cec4b){while(--_0x5cec4b){_0x40f7be['push'](_0x40f7be['shift']());}};_0x5dde74(++_0x49e2a3);}(_0x2e1a,0x129));var _0xa2e1=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0x2e1a[_0x19d350];return _0x3bfc8d;};'use strict';var SmsInteractionEvents=require(_0xa2e1('0x0'));var events=[_0xa2e1('0x1'),_0xa2e1('0x2'),_0xa2e1('0x3')];function createListener(_0x5a473f,_0x41e04e){return function(_0x2869fb){_0x41e04e[_0xa2e1('0x4')](_0x5a473f,_0x2869fb);};}function removeListener(_0x59141d,_0x3f7e5d){return function(){SmsInteractionEvents['removeListener'](_0x59141d,_0x3f7e5d);};}exports[_0xa2e1('0x5')]=function(_0x5d9c4a){for(var _0xbff67a=0x0,_0x44d74d=events['length'];_0xbff67a<_0x44d74d;_0xbff67a++){var _0x208f0e=events[_0xbff67a];var _0x169fec=createListener('smsInteraction:'+_0x208f0e,_0x5d9c4a);SmsInteractionEvents['on'](_0x208f0e,_0x169fec);}};
\ No newline at end of file
index fe78012..1591e53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa212=['isAuthenticated','index','/describe','/:id','show','tracked','sms','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','fs-extra','../../config/environment','./smsMessage.controller','get'];(function(_0x39d9bc,_0x25db5f){var _0x1662b3=function(_0x33a746){while(--_0x33a746){_0x39d9bc['push'](_0x39d9bc['shift']());}};_0x1662b3(++_0x25db5f);}(_0xa212,0xec));var _0x2a21=function(_0x52f206,_0x3974f5){_0x52f206=_0x52f206-0x0;var _0x45e74f=_0xa212[_0x52f206];return _0x45e74f;};'use strict';var multer=require(_0x2a21('0x0'));var util=require(_0x2a21('0x1'));var path=require(_0x2a21('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x2a21('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a21('0x4'));var controller=require(_0x2a21('0x5'));router[_0x2a21('0x6')]('/',auth[_0x2a21('0x7')](),controller[_0x2a21('0x8')]);router['get'](_0x2a21('0x9'),auth[_0x2a21('0x7')](),controller['describe']);router['get'](_0x2a21('0xa'),auth[_0x2a21('0x7')](),controller[_0x2a21('0xb')]);router['post']('/',auth[_0x2a21('0x7')](),interaction[_0x2a21('0xc')](_0x2a21('0xd'),_0x2a21('0xe')),controller[_0x2a21('0xf')]);router['post'](_0x2a21('0x10'),controller[_0x2a21('0x11')]);router[_0x2a21('0x12')](_0x2a21('0xa'),auth[_0x2a21('0x7')](),controller[_0x2a21('0x13')]);router[_0x2a21('0x12')](_0x2a21('0x14'),auth['isAuthenticated'](),controller[_0x2a21('0x15')]);router[_0x2a21('0x12')](_0x2a21('0x16'),auth[_0x2a21('0x7')](),controller[_0x2a21('0x17')]);router[_0x2a21('0x18')](_0x2a21('0xa'),auth[_0x2a21('0x7')](),controller[_0x2a21('0x19')]);module[_0x2a21('0x1a')]=router;
\ No newline at end of file
+var _0xd1fb=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2dc387,_0x506fe8){var _0x4f48ef=function(_0x473889){while(--_0x473889){_0x2dc387['push'](_0x2dc387['shift']());}};_0x4f48ef(++_0x506fe8);}(_0xd1fb,0xa2));var _0xbd1f=function(_0x465c0e,_0x224a56){_0x465c0e=_0x465c0e-0x0;var _0x1ad857=_0xd1fb[_0x465c0e];return _0x1ad857;};'use strict';var multer=require(_0xbd1f('0x0'));var util=require(_0xbd1f('0x1'));var path=require(_0xbd1f('0x2'));var timeout=require(_0xbd1f('0x3'));var express=require(_0xbd1f('0x4'));var router=express[_0xbd1f('0x5')]();var fs_extra=require(_0xbd1f('0x6'));var auth=require(_0xbd1f('0x7'));var interaction=require(_0xbd1f('0x8'));var config=require(_0xbd1f('0x9'));var controller=require('./smsMessage.controller');router[_0xbd1f('0xa')]('/',auth[_0xbd1f('0xb')](),controller[_0xbd1f('0xc')]);router[_0xbd1f('0xa')](_0xbd1f('0xd'),auth[_0xbd1f('0xb')](),controller['describe']);router[_0xbd1f('0xa')](_0xbd1f('0xe'),auth[_0xbd1f('0xb')](),controller[_0xbd1f('0xf')]);router[_0xbd1f('0x10')]('/',auth[_0xbd1f('0xb')](),interaction['tracked']('sms',_0xbd1f('0x11')),controller[_0xbd1f('0x12')]);router[_0xbd1f('0x10')](_0xbd1f('0x13'),controller[_0xbd1f('0x14')]);router[_0xbd1f('0x15')](_0xbd1f('0xe'),auth[_0xbd1f('0xb')](),controller[_0xbd1f('0x16')]);router[_0xbd1f('0x15')](_0xbd1f('0x17'),auth[_0xbd1f('0xb')](),controller[_0xbd1f('0x18')]);router[_0xbd1f('0x15')](_0xbd1f('0x19'),auth['isAuthenticated'](),controller['reject']);router[_0xbd1f('0x1a')](_0xbd1f('0xe'),auth[_0xbd1f('0xb')](),controller['destroy']);module[_0xbd1f('0x1b')]=router;
\ No newline at end of file
index 168bda7..89836f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b13=['medium','ENUM','out','STRING','BOOLEAN','exports','TEXT'];(function(_0x4b87dc,_0x65bfba){var _0x4c3b12=function(_0xf7ff85){while(--_0xf7ff85){_0x4b87dc['push'](_0x4b87dc['shift']());}};_0x4c3b12(++_0x65bfba);}(_0x6b13,0xd0));var _0x36b1=function(_0x57b740,_0x3a8814){_0x57b740=_0x57b740-0x0;var _0x576e93=_0x6b13[_0x57b740];return _0x576e93;};'use strict';var Sequelize=require('sequelize');module[_0x36b1('0x0')]={'body':{'type':Sequelize[_0x36b1('0x1')](_0x36b1('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x36b1('0x3')]('in',_0x36b1('0x4')),'defaultValue':_0x36b1('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x36b1('0x5')](0xbe)},'phone':{'type':Sequelize[_0x36b1('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x36b1('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x36b1('0x5')]},'providerResponse':{'type':Sequelize[_0x36b1('0x1')]}};
\ No newline at end of file
+var _0x7bb8=['DATE','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0x417a53,_0x3a26b5){var _0x4c817c=function(_0x3b71ce){while(--_0x3b71ce){_0x417a53['push'](_0x417a53['shift']());}};_0x4c817c(++_0x3a26b5);}(_0x7bb8,0xe8));var _0x87bb=function(_0x200678,_0x352375){_0x200678=_0x200678-0x0;var _0x19c9d8=_0x7bb8[_0x200678];return _0x19c9d8;};'use strict';var Sequelize=require('sequelize');module[_0x87bb('0x0')]={'body':{'type':Sequelize[_0x87bb('0x1')](_0x87bb('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x87bb('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x87bb('0x4')),'defaultValue':_0x87bb('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x87bb('0x5')]},'readAt':{'type':Sequelize[_0x87bb('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x87bb('0x5')]},'providerResponse':{'type':Sequelize[_0x87bb('0x1')]}};
\ No newline at end of file
index 50afc7e..83b0053 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552c=['type','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','DELIVERED','infobip','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','request','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','destroy','sendStatus','index','map','SmsMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','name','options','rows','then','catch','show','params','includeAll','include','find','create','body','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','SmsInteractionId','read1stAt','interaction','get','info','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','RejectMessage','sequelize','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from'];(function(_0x4fa81b,_0x21526f){var _0x5936e9=function(_0x26c79a){while(--_0x26c79a){_0x4fa81b['push'](_0x4fa81b['shift']());}};_0x5936e9(++_0x21526f);}(_0x552c,0xa0));var _0xc552=function(_0x80b9b8,_0x2a2163){_0x80b9b8=_0x80b9b8-0x0;var _0xb7fe18=_0x552c[_0x80b9b8];return _0xb7fe18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc552('0x0'));var zipdir=require(_0xc552('0x1'));var jsonpatch=require(_0xc552('0x2'));var rp=require(_0xc552('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc552('0x4'));var csv=require(_0xc552('0x5'));var ejs=require(_0xc552('0x6'));var fs=require('fs');var fs_extra=require(_0xc552('0x7'));var _=require(_0xc552('0x8'));var squel=require(_0xc552('0x9'));var crypto=require(_0xc552('0xa'));var jsforce=require(_0xc552('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc552('0x5'));var querystring=require('querystring');var Papa=require(_0xc552('0xc'));var Redis=require('ioredis');var authService=require(_0xc552('0xd'));var qs=require(_0xc552('0xe'));var as=require(_0xc552('0xf'));var hardwareService=require(_0xc552('0x10'));var logger=require('../../config/logger')(_0xc552('0x11'));var utils=require(_0xc552('0x12'));var config=require(_0xc552('0x13'));var licenseUtil=require(_0xc552('0x14'));var db=require('../../mysqldb')['db'];config[_0xc552('0x15')]=_[_0xc552('0x16')](config[_0xc552('0x15')],{'host':_0xc552('0x17'),'port':0x18eb});var socket=require(_0xc552('0x18'))(new Redis(config['redis']));require(_0xc552('0x19'))[_0xc552('0x1a')](socket);var jayson=require(_0xc552('0x1b'));var client=jayson['client'][_0xc552('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0xc552('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5b2026,_0x1074af,_0x487b00,_0xf6ec72){return new BPromise(function(_0x26ae4e,_0xb933c9){var _0x530720=_0xf6ec72||client;return _0x530720[_0xc552('0x1d')](_0x5b2026,_0x487b00)['then'](function(_0x483d61){logger['info'](_0xc552('0x1e'),_0x1074af,_0xc552('0x1f'));logger[_0xc552('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1074af,_0xc552('0x1f'),JSON[_0xc552('0x21')](_0x483d61));if(_0x483d61['error']){if(_0x483d61[_0xc552('0x22')][_0xc552('0x23')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x1074af,_0x483d61[_0xc552('0x22')][_0xc552('0x24')]);return _0xb933c9(_0x483d61[_0xc552('0x22')]['message']);}logger[_0xc552('0x22')](_0xc552('0x1e'),_0x1074af,_0x483d61[_0xc552('0x22')][_0xc552('0x24')]);return _0x26ae4e(_0x483d61[_0xc552('0x22')][_0xc552('0x24')]);}else{logger['info'](_0xc552('0x1e'),_0x1074af,_0xc552('0x1f'));_0x26ae4e(_0x483d61[_0xc552('0x25')][_0xc552('0x24')]);}})['catch'](function(_0x43ef9b){logger['error'](_0xc552('0x1e'),_0x1074af,_0x43ef9b);_0xb933c9(_0x43ef9b);});});}function respondWithStatusCode(_0x43a4a9,_0x48e6e3){_0x48e6e3=_0x48e6e3||0xcc;return function(_0x13270e){if(_0x13270e){return _0x43a4a9['sendStatus'](_0x48e6e3);}return _0x43a4a9[_0xc552('0x26')](_0x48e6e3)[_0xc552('0x27')]();};}function respondWithResult(_0x333aed,_0x5a739c){_0x5a739c=_0x5a739c||0xc8;return function(_0x5a5edc){if(_0x5a5edc){return _0x333aed[_0xc552('0x26')](_0x5a739c)[_0xc552('0x28')](_0x5a5edc);}};}function respondWithFilteredResult(_0x424a4a,_0xd8d84d){return function(_0x1043be){if(_0x1043be){var _0x447f1d=typeof _0xd8d84d['offset']===_0xc552('0x29')&&typeof _0xd8d84d[_0xc552('0x2a')]==='undefined';var _0x2bd7ab=_0x1043be[_0xc552('0x2b')];var _0x2cb2b1=_0x447f1d?0x0:_0xd8d84d[_0xc552('0x2c')];var _0x4725e1=_0x447f1d?_0x1043be['count']:_0xd8d84d[_0xc552('0x2c')]+_0xd8d84d[_0xc552('0x2a')];var _0x2cac00;if(_0x4725e1>=_0x2bd7ab){_0x4725e1=_0x2bd7ab;_0x2cac00=0xc8;}else{_0x2cac00=0xce;}_0x424a4a[_0xc552('0x26')](_0x2cac00);return _0x424a4a['set'](_0xc552('0x2d'),_0x2cb2b1+'-'+_0x4725e1+'/'+_0x2bd7ab)[_0xc552('0x28')](_0x1043be);}return null;};}function patchUpdates(_0x58750b){return function(_0xe29fba){try{jsonpatch[_0xc552('0x2e')](_0xe29fba,_0x58750b,!![]);}catch(_0x2b9051){return BPromise[_0xc552('0x2f')](_0x2b9051);}return _0xe29fba['save']();};}function saveUpdates(_0x277cdd,_0x411b68){return function(_0x3bab58){if(_0x3bab58){return _0x3bab58[_0xc552('0x30')](_0x277cdd)['then'](function(_0x55d2ff){return _0x55d2ff;});}return null;};}function removeEntity(_0x1fce53,_0x3a20c){return function(_0x3a4523){if(_0x3a4523){return _0x3a4523[_0xc552('0x31')]()['then'](function(){_0x1fce53[_0xc552('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10285d,_0x5bb804){return function(_0x25f5a3){if(!_0x25f5a3){_0x10285d[_0xc552('0x32')](0x194);}return _0x25f5a3;};}function handleError(_0x4e0855,_0xb18b27){_0xb18b27=_0xb18b27||0x1f4;return function(_0x490443){logger[_0xc552('0x22')](_0x490443['stack']);if(_0x490443['name']){delete _0x490443['name'];}_0x4e0855[_0xc552('0x26')](_0xb18b27)['send'](_0x490443);};}exports[_0xc552('0x33')]=function(_0x4a62ff,_0x3c2c10){var _0x36db75={},_0x3d98da={},_0x585022={'count':0x0,'rows':[]};var _0x4f655a=_[_0xc552('0x34')](db[_0xc552('0x35')][_0xc552('0x36')],function(_0x566cd7){return{'name':_0x566cd7[_0xc552('0x37')],'type':_0x566cd7['type'][_0xc552('0x38')]};});_0x3d98da[_0xc552('0x39')]=_['map'](_0x4f655a,'name');_0x3d98da['query']=_[_0xc552('0x3a')](_0x4a62ff[_0xc552('0x3b')]);_0x3d98da[_0xc552('0x3c')]=_[_0xc552('0x3d')](_0x3d98da[_0xc552('0x39')],_0x3d98da[_0xc552('0x3b')]);_0x36db75['attributes']=_['intersection'](_0x3d98da[_0xc552('0x39')],qs[_0xc552('0x3e')](_0x4a62ff[_0xc552('0x3b')][_0xc552('0x3e')]));_0x36db75[_0xc552('0x3f')]=_0x36db75[_0xc552('0x3f')][_0xc552('0x40')]?_0x36db75[_0xc552('0x3f')]:_0x3d98da[_0xc552('0x39')];if(!_0x4a62ff[_0xc552('0x3b')]['hasOwnProperty'](_0xc552('0x41'))){_0x36db75[_0xc552('0x2a')]=qs[_0xc552('0x2a')](_0x4a62ff['query'][_0xc552('0x2a')]);_0x36db75[_0xc552('0x2c')]=qs[_0xc552('0x2c')](_0x4a62ff[_0xc552('0x3b')][_0xc552('0x2c')]);}_0x36db75[_0xc552('0x42')]=qs[_0xc552('0x43')](_0x4a62ff[_0xc552('0x3b')][_0xc552('0x43')]);_0x36db75[_0xc552('0x44')]=qs[_0xc552('0x3c')](_[_0xc552('0x45')](_0x4a62ff['query'],_0x3d98da['filters']),_0x4f655a);if(_0x4a62ff[_0xc552('0x3b')]['filter']){_0x36db75[_0xc552('0x44')]=_[_0xc552('0x46')](_0x36db75[_0xc552('0x44')],{'$or':_['map'](_0x4f655a,function(_0x16d3cd){if(_0x16d3cd['type']!=='VIRTUAL'){var _0x304d12={};_0x304d12[_0x16d3cd[_0xc552('0x47')]]={'$like':'%'+_0x4a62ff[_0xc552('0x3b')]['filter']+'%'};return _0x304d12;}})});}_0x36db75=_['merge']({},_0x36db75,_0x4a62ff[_0xc552('0x48')]);var _0x4056ba={'where':_0x36db75[_0xc552('0x44')]};return db[_0xc552('0x35')][_0xc552('0x2b')](_0x4056ba)['then'](function(_0x3fa89e){_0x585022[_0xc552('0x2b')]=_0x3fa89e;if(_0x4a62ff[_0xc552('0x3b')]['includeAll']){_0x36db75['include']=[{'all':!![]}];}return db[_0xc552('0x35')]['findAll'](_0x36db75);})['then'](function(_0x191bbe){_0x585022[_0xc552('0x49')]=_0x191bbe;return _0x585022;})[_0xc552('0x4a')](respondWithFilteredResult(_0x3c2c10,_0x36db75))[_0xc552('0x4b')](handleError(_0x3c2c10,null));};exports[_0xc552('0x4c')]=function(_0x1c1809,_0x457e9d){var _0x53bb59={'raw':!![],'where':{'id':_0x1c1809[_0xc552('0x4d')]['id']}},_0x5b9915={};_0x5b9915[_0xc552('0x39')]=_['keys'](db[_0xc552('0x35')][_0xc552('0x36')]);_0x5b9915['query']=_['keys'](_0x1c1809[_0xc552('0x3b')]);_0x5b9915['filters']=_[_0xc552('0x3d')](_0x5b9915[_0xc552('0x39')],_0x5b9915[_0xc552('0x3b')]);_0x53bb59[_0xc552('0x3f')]=_[_0xc552('0x3d')](_0x5b9915[_0xc552('0x39')],qs[_0xc552('0x3e')](_0x1c1809[_0xc552('0x3b')][_0xc552('0x3e')]));_0x53bb59[_0xc552('0x3f')]=_0x53bb59[_0xc552('0x3f')][_0xc552('0x40')]?_0x53bb59[_0xc552('0x3f')]:_0x5b9915['model'];if(_0x1c1809['query'][_0xc552('0x4e')]){_0x53bb59[_0xc552('0x4f')]=[{'all':!![]}];}_0x53bb59=_[_0xc552('0x46')]({},_0x53bb59,_0x1c1809[_0xc552('0x48')]);return db['SmsMessage'][_0xc552('0x50')](_0x53bb59)['then'](handleEntityNotFound(_0x457e9d,null))['then'](respondWithResult(_0x457e9d,null))[_0xc552('0x4b')](handleError(_0x457e9d,null));};exports['create']=function(_0x24be95,_0x3197a3){return db[_0xc552('0x35')][_0xc552('0x51')](_0x24be95['body'],{})[_0xc552('0x4a')](respondWithResult(_0x3197a3,0xc9))[_0xc552('0x4b')](handleError(_0x3197a3,null));};exports['update']=function(_0x5c2ef6,_0x5033bc){if(_0x5c2ef6[_0xc552('0x52')]['id']){delete _0x5c2ef6[_0xc552('0x52')]['id'];}return db[_0xc552('0x35')][_0xc552('0x50')]({'where':{'id':_0x5c2ef6[_0xc552('0x4d')]['id']}})[_0xc552('0x4a')](handleEntityNotFound(_0x5033bc,null))['then'](saveUpdates(_0x5c2ef6['body'],null))[_0xc552('0x4a')](respondWithResult(_0x5033bc,null))['catch'](handleError(_0x5033bc,null));};exports['destroy']=function(_0x466be3,_0x2cdcc7){return db[_0xc552('0x35')][_0xc552('0x50')]({'where':{'id':_0x466be3[_0xc552('0x4d')]['id']}})[_0xc552('0x4a')](handleEntityNotFound(_0x2cdcc7,null))[_0xc552('0x4a')](removeEntity(_0x2cdcc7,null))[_0xc552('0x4b')](handleError(_0x2cdcc7,null));};exports[_0xc552('0x53')]=function(_0x22c63b,_0x10f51){return db[_0xc552('0x35')][_0xc552('0x53')]()[_0xc552('0x4a')](respondWithResult(_0x10f51,null))['catch'](handleError(_0x10f51,null));};var interaction_log=require(_0xc552('0x54'))(_0xc552('0x55'));exports[_0xc552('0x56')]=function(_0xdb66ee,_0x2a3a53,_0x1bcfba){var _0x9c38b4={'agent':{},'channel':_0xc552('0x57')};if(_0xdb66ee[_0xc552('0x52')]['id']){delete _0xdb66ee[_0xc552('0x52')]['id'];}_0xdb66ee['body'][_0xc552('0x58')]=!![];_0xdb66ee[_0xc552('0x52')][_0xc552('0x59')]=moment()[_0xc552('0x5a')](_0xc552('0x5b'));_0xdb66ee[_0xc552('0x52')][_0xc552('0x5c')]=_0xdb66ee[_0xc552('0x52')]['UserId']||_0xdb66ee['user']['id'];_0x9c38b4[_0xc552('0x5d')]['id']=_0xdb66ee[_0xc552('0x52')][_0xc552('0x5c')];return db['SmsMessage'][_0xc552('0x50')]({'where':{'id':_0xdb66ee['params']['id'],'UserId':null}})[_0xc552('0x4a')](handleEntityNotFound(_0x2a3a53,null))[_0xc552('0x4a')](saveUpdates(_0xdb66ee[_0xc552('0x52')],null))['then'](function(_0x46140e){if(_0x46140e){_0x9c38b4['message']=_0x46140e['get']({'plain':!![]});return db[_0xc552('0x5e')][_0xc552('0x50')]({'where':{'id':_0x46140e[_0xc552('0x5f')]}});}return null;})[_0xc552('0x4a')](handleEntityNotFound(_0x2a3a53,null))['then'](function(_0x868b63){if(_0x868b63){return _0x868b63[_0xc552('0x30')]({'UserId':_0xdb66ee[_0xc552('0x52')][_0xc552('0x5c')],'read1stAt':_['isNil'](_0x868b63[_0xc552('0x60')])?moment()[_0xc552('0x5a')](_0xc552('0x5b')):undefined});}return null;})[_0xc552('0x4a')](function(_0x554a56){if(_0x554a56){_0x9c38b4[_0xc552('0x61')]=_0x554a56[_0xc552('0x62')]({'plain':!![]});interaction_log[_0xc552('0x63')](_0xc552('0x64'),_0xdb66ee[_0xc552('0x65')]['id'],_0xdb66ee[_0xc552('0x65')][_0xc552('0x47')],_0xdb66ee[_0xc552('0x65')][_0xc552('0x66')],_0x9c38b4[_0xc552('0x61')]['id'],_0xdb66ee[_0xc552('0x52')]?JSON[_0xc552('0x21')](_0xdb66ee['body']):_0xc552('0x67'));return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x9c38b4);}return null;})[_0xc552('0x4a')](function(_0x2f835d){var _0x498d96=_0xc552('0x68')+_0x2f835d[_0xc552('0x24')][_0xc552('0x69')];return db['sequelize']['query'](_0x498d96,{'type':db[_0xc552('0x6a')][_0xc552('0x6b')][_0xc552('0x6c')],'raw':!![]})[_0xc552('0x4a')](function(_0x25a0ad){return _0x25a0ad;});})[_0xc552('0x4a')](function(_0x496216){if(_0x496216){_0x9c38b4[_0xc552('0x24')][_0xc552('0x6d')]=_0x496216[0x0];if(!_0xdb66ee[_0xc552('0x52')][_0xc552('0x5c')])return;return db[_0xc552('0x6e')][_0xc552('0x50')]({'where':{'id':_0xdb66ee[_0xc552('0x52')][_0xc552('0x5c')],'role':_0xc552('0x5d')},'attributes':['id',_0xc552('0x47'),_0xc552('0x6f'),_0xc552('0x70'),_0xc552('0x71')],'raw':!![]});}return null;})[_0xc552('0x4a')](function(_0x1c317c){if(!_0x1c317c)return null;_0x9c38b4[_0xc552('0x24')][_0xc552('0x5d')]=_0x1c317c;return _0x9c38b4;})['then'](function(_0x41e436){if(_0x41e436){if(_0xdb66ee[_0xc552('0x52')][_0xc552('0x72')]){_0x9c38b4[_0xc552('0x24')][_0xc552('0x73')]=util[_0xc552('0x5a')](_0xc552('0x74'),_0xdb66ee[_0xc552('0x65')]['name']);_0x9c38b4[_0xc552('0x24')][_0xc552('0x75')]=_0x9c38b4['channel'];_0x9c38b4[_0xc552('0x24')][_0xc552('0x76')]=_0x9c38b4['channel'];_0x9c38b4[_0xc552('0x24')][_0xc552('0x77')]=_0xc552('0x56');return respondWithRpcPromise(_0xc552('0x78'),_0xc552('0x78'),{'event':_0xc552('0x79'),'message':_0x9c38b4[_0xc552('0x24')]},client9002)[_0xc552('0x4a')](function(){return _0x9c38b4;});}return _0x9c38b4;}return null;})[_0xc552('0x4a')](respondWithResult(_0x2a3a53,null))[_0xc552('0x4b')](handleError(_0x2a3a53,null));};var interaction_log=require(_0xc552('0x54'))('sms-interactions');exports['reject']=function(_0x1d2aa5,_0x5b0136,_0x38725a){var _0x16f04a={'agent':{},'channel':_0xc552('0x57')};if(_0x1d2aa5[_0xc552('0x52')]['id']){delete _0x1d2aa5[_0xc552('0x52')]['id'];}_0x1d2aa5[_0xc552('0x52')][_0xc552('0x5c')]=_0x1d2aa5[_0xc552('0x52')]['UserId']||_0x1d2aa5[_0xc552('0x65')]['id'];_0x16f04a['agent']['id']=_0x1d2aa5[_0xc552('0x52')]['UserId'];return db['SmsMessage'][_0xc552('0x50')]({'where':{'id':_0x1d2aa5[_0xc552('0x4d')]['id'],'UserId':null}})[_0xc552('0x4a')](handleEntityNotFound(_0x5b0136,null))[_0xc552('0x4a')](function(_0x3b01de){if(_0x3b01de){_0x16f04a['message']=_0x3b01de['get']({'plain':!![]});return db[_0xc552('0x5e')][_0xc552('0x50')]({'where':{'id':_0x3b01de[_0xc552('0x5f')]}});}return null;})[_0xc552('0x4a')](handleEntityNotFound(_0x5b0136,null))[_0xc552('0x4a')](function(_0x2135d3){if(_0x2135d3){_0x16f04a[_0xc552('0x61')]=_0x2135d3[_0xc552('0x62')]({'plain':!![]});interaction_log[_0xc552('0x63')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1d2aa5['user']['id'],_0x1d2aa5[_0xc552('0x65')][_0xc552('0x47')],_0x1d2aa5[_0xc552('0x65')][_0xc552('0x66')],_0x16f04a[_0xc552('0x61')]['id'],_0x1d2aa5[_0xc552('0x52')]?JSON[_0xc552('0x21')](_0x1d2aa5[_0xc552('0x52')]):_0xc552('0x67'));return respondWithRpcPromise(_0xc552('0x7a'),'rejectMessage',_0x16f04a);}return null;})[_0xc552('0x4a')](function(_0x52b702){var _0x351aee=_0xc552('0x68')+_0x52b702[_0xc552('0x24')]['ContactId'];return db[_0xc552('0x7b')][_0xc552('0x3b')](_0x351aee,{'type':db[_0xc552('0x6a')]['QueryTypes'][_0xc552('0x6c')],'raw':!![]})[_0xc552('0x4a')](function(_0x33a535){return _0x33a535;});})[_0xc552('0x4a')](function(_0x4cb39f){if(_0x4cb39f){_0x16f04a[_0xc552('0x24')]['contact']=_0x4cb39f[0x0];if(!_0x1d2aa5['body'][_0xc552('0x5c')])return;return db['User'][_0xc552('0x50')]({'where':{'id':_0x1d2aa5[_0xc552('0x52')][_0xc552('0x5c')],'role':_0xc552('0x5d')},'attributes':['id',_0xc552('0x47'),_0xc552('0x6f'),'email',_0xc552('0x71')],'raw':!![]});}return null;})['then'](function(_0x5011f2){if(!_0x5011f2)return null;_0x16f04a[_0xc552('0x24')][_0xc552('0x5d')]=_0x5011f2;return _0x16f04a;})[_0xc552('0x4a')](function(_0x5eaed8){if(_0x5eaed8){_0x5eaed8['message'][_0xc552('0x73')]=util[_0xc552('0x5a')](_0xc552('0x74'),_0x1d2aa5[_0xc552('0x65')][_0xc552('0x47')]);_0x5eaed8['message']['channel']=_0x16f04a[_0xc552('0x75')];_0x5eaed8[_0xc552('0x24')]['motionChannel']=_0x16f04a[_0xc552('0x75')];_0x5eaed8[_0xc552('0x24')]['event']=_0xc552('0x2f');respondWithRpcPromise(_0xc552('0x78'),_0xc552('0x78'),{'event':_0xc552('0x7c'),'message':_0x5eaed8[_0xc552('0x24')]},client9002);return _0x16f04a;}return null;})[_0xc552('0x4a')](respondWithResult(_0x5b0136,null))[_0xc552('0x4b')](handleError(_0x5b0136,null));};exports[_0xc552('0x26')]=function(_0x44c9aa,_0x5c0849,_0x121d83){if(_0x44c9aa['body']['id']){delete _0x44c9aa[_0xc552('0x52')]['id'];}var _0x3eca87;return db[_0xc552('0x35')][_0xc552('0x50')]({'where':{'id':_0x44c9aa[_0xc552('0x4d')]['id']}})[_0xc552('0x4a')](handleEntityNotFound(_0x5c0849,null))[_0xc552('0x4a')](function(_0x2cfae5){if(_0x2cfae5){_0x3eca87=_0x2cfae5;return db['SmsAccount'][_0xc552('0x50')]({'where':{'id':_0x2cfae5[_0xc552('0x7d')]}});}})['then'](handleEntityNotFound(_0x5c0849,null))['then'](function(_0xe80d81){if(_0xe80d81){logger[_0xc552('0x20')](_0xc552('0x7e'),_0xc552('0x26'),_0xc552('0x7f'),_0xe80d81[_0xc552('0x80')],util[_0xc552('0x81')](_0x44c9aa['body'],{'showHidden':![],'depth':null}));switch(_0xe80d81['type']){case _0xc552('0x82'):if(_0x44c9aa[_0xc552('0x52')][_0xc552('0x83')]&&_0x44c9aa[_0xc552('0x52')][_0xc552('0x83')]===_0x3eca87[_0xc552('0x84')]){return _0x3eca87['update']({'read':!![]});}else{logger[_0xc552('0x22')](_0xc552('0x85'),'status',_0xc552('0x82'),util['inspect'](_0x44c9aa[_0xc552('0x52')],{'showHidden':![],'depth':null}));}break;case _0xc552('0x86'):if(_0x44c9aa[_0xc552('0x52')][_0xc552('0x87')]&&_0x44c9aa[_0xc552('0x52')]['MessageUUID']===_0x3eca87[_0xc552('0x84')]&&_[_0xc552('0x88')]([_0xc552('0x89'),_0xc552('0x8a')],_0x44c9aa[_0xc552('0x52')][_0xc552('0x8b')])>=0x0){return _0x3eca87[_0xc552('0x30')]({'read':!![]});}else{logger[_0xc552('0x22')](_0xc552('0x85'),_0xc552('0x26'),_0xc552('0x8c'),util[_0xc552('0x81')](_0x44c9aa['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3d9ce3=_0x44c9aa[_0xc552('0x52')][_0xc552('0x8d')][0x0];if(_0x3d9ce3['status']['groupName']===_0xc552('0x8e')){return _0x3eca87[_0xc552('0x30')]({'read':!![]});}else{logger['error'](_0xc552('0x85'),_0xc552('0x26'),_0xc552('0x8f'),util[_0xc552('0x81')](_0x44c9aa[_0xc552('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x3eca87;}})[_0xc552('0x4a')](respondWithResult(_0x5c0849,null))[_0xc552('0x4b')](handleError(_0x5c0849,null));};
\ No newline at end of file
+var _0xa6ce=['accept','sms','read','readAt','format','user','UserId','get','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','Sequelize','contact','agent','fullname','email','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','interface','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','Status','results','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','update','stack','name','send','index','map','SmsMessage','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','destroy','sms-interactions'];(function(_0x4d08b8,_0x34c445){var _0x70214a=function(_0x4db67c){while(--_0x4db67c){_0x4d08b8['push'](_0x4d08b8['shift']());}};_0x70214a(++_0x34c445);}(_0xa6ce,0x15e));var _0xea6c=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0xa6ce[_0xa60623];return _0x4a6487;};'use strict';var emlformat=require(_0xea6c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xea6c('0x1'));var jsonpatch=require(_0xea6c('0x2'));var rp=require('request-promise');var moment=require(_0xea6c('0x3'));var BPromise=require(_0xea6c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xea6c('0x5'));var sox=require(_0xea6c('0x6'));var csv=require(_0xea6c('0x7'));var ejs=require(_0xea6c('0x8'));var fs=require('fs');var fs_extra=require(_0xea6c('0x9'));var _=require(_0xea6c('0xa'));var squel=require('squel');var crypto=require(_0xea6c('0xb'));var jsforce=require(_0xea6c('0xc'));var deskjs=require(_0xea6c('0xd'));var toCsv=require(_0xea6c('0x7'));var querystring=require(_0xea6c('0xe'));var Papa=require(_0xea6c('0xf'));var Redis=require(_0xea6c('0x10'));var authService=require(_0xea6c('0x11'));var qs=require(_0xea6c('0x12'));var as=require(_0xea6c('0x13'));var hardwareService=require(_0xea6c('0x14'));var logger=require(_0xea6c('0x15'))(_0xea6c('0x16'));var utils=require(_0xea6c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xea6c('0x18'));var db=require(_0xea6c('0x19'))['db'];config[_0xea6c('0x1a')]=_['defaults'](config[_0xea6c('0x1a')],{'host':_0xea6c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea6c('0x1a')]));require(_0xea6c('0x1c'))[_0xea6c('0x1d')](socket);var jayson=require(_0xea6c('0x1e'));var client=jayson[_0xea6c('0x1f')][_0xea6c('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xea6c('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x4f9c92,_0x25b150,_0x6499ed,_0x12768a){return new BPromise(function(_0x105b0b,_0x2dd4fe){var _0x55f9e4=_0x12768a||client;return _0x55f9e4[_0xea6c('0x21')](_0x4f9c92,_0x6499ed)[_0xea6c('0x22')](function(_0x254f8e){logger[_0xea6c('0x23')](_0xea6c('0x24'),_0x25b150,_0xea6c('0x25'));logger[_0xea6c('0x26')](_0xea6c('0x27'),_0x25b150,_0xea6c('0x25'),JSON[_0xea6c('0x28')](_0x254f8e));if(_0x254f8e['error']){if(_0x254f8e[_0xea6c('0x29')]['code']===0x1f4){logger[_0xea6c('0x29')]('SmsMessage,\x20%s,\x20%s',_0x25b150,_0x254f8e[_0xea6c('0x29')][_0xea6c('0x2a')]);return _0x2dd4fe(_0x254f8e[_0xea6c('0x29')]['message']);}logger[_0xea6c('0x29')](_0xea6c('0x24'),_0x25b150,_0x254f8e['error']['message']);return _0x105b0b(_0x254f8e[_0xea6c('0x29')]['message']);}else{logger['info'](_0xea6c('0x24'),_0x25b150,_0xea6c('0x25'));_0x105b0b(_0x254f8e[_0xea6c('0x2b')][_0xea6c('0x2a')]);}})[_0xea6c('0x2c')](function(_0x4fa0ea){logger[_0xea6c('0x29')]('SmsMessage,\x20%s,\x20%s',_0x25b150,_0x4fa0ea);_0x2dd4fe(_0x4fa0ea);});});}function respondWithStatusCode(_0x5df5e9,_0x16e88d){_0x16e88d=_0x16e88d||0xcc;return function(_0x52953a){if(_0x52953a){return _0x5df5e9[_0xea6c('0x2d')](_0x16e88d);}return _0x5df5e9[_0xea6c('0x2e')](_0x16e88d)[_0xea6c('0x2f')]();};}function respondWithResult(_0x269b48,_0x156832){_0x156832=_0x156832||0xc8;return function(_0x110d56){if(_0x110d56){return _0x269b48[_0xea6c('0x2e')](_0x156832)[_0xea6c('0x30')](_0x110d56);}};}function respondWithFilteredResult(_0x348a38,_0x118385){return function(_0x15327f){if(_0x15327f){var _0x22e059=typeof _0x118385['offset']===_0xea6c('0x31')&&typeof _0x118385[_0xea6c('0x32')]==='undefined';var _0x559953=_0x15327f['count'];var _0x434fa7=_0x22e059?0x0:_0x118385[_0xea6c('0x33')];var _0xc6836=_0x22e059?_0x15327f[_0xea6c('0x34')]:_0x118385[_0xea6c('0x33')]+_0x118385[_0xea6c('0x32')];var _0x7b5a22;if(_0xc6836>=_0x559953){_0xc6836=_0x559953;_0x7b5a22=0xc8;}else{_0x7b5a22=0xce;}_0x348a38[_0xea6c('0x2e')](_0x7b5a22);return _0x348a38[_0xea6c('0x35')]('Content-Range',_0x434fa7+'-'+_0xc6836+'/'+_0x559953)[_0xea6c('0x30')](_0x15327f);}return null;};}function patchUpdates(_0xf7b677){return function(_0x439013){try{jsonpatch[_0xea6c('0x36')](_0x439013,_0xf7b677,!![]);}catch(_0x3c5530){return BPromise[_0xea6c('0x37')](_0x3c5530);}return _0x439013['save']();};}function saveUpdates(_0xc0c5b9,_0x18c59e){return function(_0x4a3332){if(_0x4a3332){return _0x4a3332[_0xea6c('0x38')](_0xc0c5b9)[_0xea6c('0x22')](function(_0x2b707b){return _0x2b707b;});}return null;};}function removeEntity(_0x4ca2a4,_0x5ef27c){return function(_0x4fa399){if(_0x4fa399){return _0x4fa399['destroy']()['then'](function(){_0x4ca2a4[_0xea6c('0x2e')](0xcc)[_0xea6c('0x2f')]();});}};}function handleEntityNotFound(_0xac32bc,_0x151c66){return function(_0x507d35){if(!_0x507d35){_0xac32bc[_0xea6c('0x2d')](0x194);}return _0x507d35;};}function handleError(_0xd23f80,_0x424d21){_0x424d21=_0x424d21||0x1f4;return function(_0x525861){logger[_0xea6c('0x29')](_0x525861[_0xea6c('0x39')]);if(_0x525861['name']){delete _0x525861[_0xea6c('0x3a')];}_0xd23f80[_0xea6c('0x2e')](_0x424d21)[_0xea6c('0x3b')](_0x525861);};}exports[_0xea6c('0x3c')]=function(_0x375a07,_0x44724){var _0x1fbb3d={},_0x3259aa={},_0x404a74={'count':0x0,'rows':[]};var _0x3e3e=_[_0xea6c('0x3d')](db[_0xea6c('0x3e')]['rawAttributes'],function(_0x21b561){return{'name':_0x21b561['fieldName'],'type':_0x21b561[_0xea6c('0x3f')][_0xea6c('0x40')]};});_0x3259aa[_0xea6c('0x41')]=_[_0xea6c('0x3d')](_0x3e3e,_0xea6c('0x3a'));_0x3259aa['query']=_[_0xea6c('0x42')](_0x375a07[_0xea6c('0x43')]);_0x3259aa[_0xea6c('0x44')]=_['intersection'](_0x3259aa['model'],_0x3259aa[_0xea6c('0x43')]);_0x1fbb3d['attributes']=_[_0xea6c('0x45')](_0x3259aa[_0xea6c('0x41')],qs[_0xea6c('0x46')](_0x375a07[_0xea6c('0x43')]['fields']));_0x1fbb3d[_0xea6c('0x47')]=_0x1fbb3d[_0xea6c('0x47')][_0xea6c('0x48')]?_0x1fbb3d['attributes']:_0x3259aa[_0xea6c('0x41')];if(!_0x375a07['query'][_0xea6c('0x49')](_0xea6c('0x4a'))){_0x1fbb3d['limit']=qs[_0xea6c('0x32')](_0x375a07[_0xea6c('0x43')][_0xea6c('0x32')]);_0x1fbb3d[_0xea6c('0x33')]=qs[_0xea6c('0x33')](_0x375a07[_0xea6c('0x43')]['offset']);}_0x1fbb3d[_0xea6c('0x4b')]=qs[_0xea6c('0x4c')](_0x375a07[_0xea6c('0x43')][_0xea6c('0x4c')]);_0x1fbb3d[_0xea6c('0x4d')]=qs[_0xea6c('0x44')](_[_0xea6c('0x4e')](_0x375a07[_0xea6c('0x43')],_0x3259aa[_0xea6c('0x44')]),_0x3e3e);if(_0x375a07[_0xea6c('0x43')][_0xea6c('0x4f')]){_0x1fbb3d[_0xea6c('0x4d')]=_[_0xea6c('0x50')](_0x1fbb3d[_0xea6c('0x4d')],{'$or':_['map'](_0x3e3e,function(_0x15f9e6){if(_0x15f9e6[_0xea6c('0x3f')]!=='VIRTUAL'){var _0x54f9f7={};_0x54f9f7[_0x15f9e6[_0xea6c('0x3a')]]={'$like':'%'+_0x375a07[_0xea6c('0x43')][_0xea6c('0x4f')]+'%'};return _0x54f9f7;}})});}_0x1fbb3d=_[_0xea6c('0x50')]({},_0x1fbb3d,_0x375a07[_0xea6c('0x51')]);var _0xa544eb={'where':_0x1fbb3d[_0xea6c('0x4d')]};return db[_0xea6c('0x3e')][_0xea6c('0x34')](_0xa544eb)[_0xea6c('0x22')](function(_0x52330c){_0x404a74['count']=_0x52330c;if(_0x375a07[_0xea6c('0x43')][_0xea6c('0x52')]){_0x1fbb3d[_0xea6c('0x53')]=[{'all':!![]}];}return db['SmsMessage'][_0xea6c('0x54')](_0x1fbb3d);})['then'](function(_0x31aaae){_0x404a74[_0xea6c('0x55')]=_0x31aaae;return _0x404a74;})[_0xea6c('0x22')](respondWithFilteredResult(_0x44724,_0x1fbb3d))['catch'](handleError(_0x44724,null));};exports[_0xea6c('0x56')]=function(_0x4c146a,_0x128dc8){var _0xb81bce={'raw':!![],'where':{'id':_0x4c146a[_0xea6c('0x57')]['id']}},_0x196e49={};_0x196e49[_0xea6c('0x41')]=_[_0xea6c('0x42')](db[_0xea6c('0x3e')][_0xea6c('0x58')]);_0x196e49[_0xea6c('0x43')]=_[_0xea6c('0x42')](_0x4c146a[_0xea6c('0x43')]);_0x196e49[_0xea6c('0x44')]=_[_0xea6c('0x45')](_0x196e49[_0xea6c('0x41')],_0x196e49[_0xea6c('0x43')]);_0xb81bce[_0xea6c('0x47')]=_[_0xea6c('0x45')](_0x196e49[_0xea6c('0x41')],qs[_0xea6c('0x46')](_0x4c146a[_0xea6c('0x43')][_0xea6c('0x46')]));_0xb81bce['attributes']=_0xb81bce[_0xea6c('0x47')][_0xea6c('0x48')]?_0xb81bce[_0xea6c('0x47')]:_0x196e49[_0xea6c('0x41')];if(_0x4c146a[_0xea6c('0x43')][_0xea6c('0x52')]){_0xb81bce['include']=[{'all':!![]}];}_0xb81bce=_[_0xea6c('0x50')]({},_0xb81bce,_0x4c146a[_0xea6c('0x51')]);return db[_0xea6c('0x3e')][_0xea6c('0x59')](_0xb81bce)[_0xea6c('0x22')](handleEntityNotFound(_0x128dc8,null))[_0xea6c('0x22')](respondWithResult(_0x128dc8,null))['catch'](handleError(_0x128dc8,null));};exports[_0xea6c('0x5a')]=function(_0x551933,_0x1dccf1){return db[_0xea6c('0x3e')]['create'](_0x551933[_0xea6c('0x5b')],{})['then'](respondWithResult(_0x1dccf1,0xc9))['catch'](handleError(_0x1dccf1,null));};exports[_0xea6c('0x38')]=function(_0x1d0bec,_0x4379e4){if(_0x1d0bec[_0xea6c('0x5b')]['id']){delete _0x1d0bec[_0xea6c('0x5b')]['id'];}return db[_0xea6c('0x3e')][_0xea6c('0x59')]({'where':{'id':_0x1d0bec[_0xea6c('0x57')]['id']}})['then'](handleEntityNotFound(_0x4379e4,null))['then'](saveUpdates(_0x1d0bec['body'],null))[_0xea6c('0x22')](respondWithResult(_0x4379e4,null))[_0xea6c('0x2c')](handleError(_0x4379e4,null));};exports[_0xea6c('0x5c')]=function(_0x62864b,_0x43c483){return db[_0xea6c('0x3e')]['find']({'where':{'id':_0x62864b[_0xea6c('0x57')]['id']}})[_0xea6c('0x22')](handleEntityNotFound(_0x43c483,null))[_0xea6c('0x22')](removeEntity(_0x43c483,null))[_0xea6c('0x2c')](handleError(_0x43c483,null));};exports['describe']=function(_0x214711,_0x367e3e){return db['SmsMessage']['describe']()[_0xea6c('0x22')](respondWithResult(_0x367e3e,null))[_0xea6c('0x2c')](handleError(_0x367e3e,null));};var interaction_log=require(_0xea6c('0x15'))(_0xea6c('0x5d'));exports[_0xea6c('0x5e')]=function(_0x46079e,_0x27b7d5,_0xb93247){var _0x1a5fa9={'agent':{},'channel':_0xea6c('0x5f')};if(_0x46079e[_0xea6c('0x5b')]['id']){delete _0x46079e[_0xea6c('0x5b')]['id'];}_0x46079e[_0xea6c('0x5b')][_0xea6c('0x60')]=!![];_0x46079e['body'][_0xea6c('0x61')]=moment()[_0xea6c('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x46079e[_0xea6c('0x5b')]['UserId']=_0x46079e[_0xea6c('0x5b')]['UserId']||_0x46079e[_0xea6c('0x63')]['id'];_0x1a5fa9['agent']['id']=_0x46079e[_0xea6c('0x5b')][_0xea6c('0x64')];return db['SmsMessage'][_0xea6c('0x59')]({'where':{'id':_0x46079e['params']['id'],'UserId':null}})[_0xea6c('0x22')](handleEntityNotFound(_0x27b7d5,null))[_0xea6c('0x22')](saveUpdates(_0x46079e['body'],null))[_0xea6c('0x22')](function(_0x3f05b5){if(_0x3f05b5){_0x1a5fa9[_0xea6c('0x2a')]=_0x3f05b5[_0xea6c('0x65')]({'plain':!![]});return db['SmsInteraction'][_0xea6c('0x59')]({'where':{'id':_0x3f05b5[_0xea6c('0x66')]}});}return null;})[_0xea6c('0x22')](handleEntityNotFound(_0x27b7d5,null))[_0xea6c('0x22')](function(_0xd1d503){if(_0xd1d503){return _0xd1d503['update']({'UserId':_0x46079e[_0xea6c('0x5b')][_0xea6c('0x64')],'read1stAt':_[_0xea6c('0x67')](_0xd1d503[_0xea6c('0x68')])?moment()[_0xea6c('0x62')](_0xea6c('0x69')):undefined});}return null;})['then'](function(_0x3ea0f8){if(_0x3ea0f8){_0x1a5fa9[_0xea6c('0x6a')]=_0x3ea0f8[_0xea6c('0x65')]({'plain':!![]});interaction_log[_0xea6c('0x23')](_0xea6c('0x6b'),_0x46079e[_0xea6c('0x63')]['id'],_0x46079e['user']['name'],_0x46079e[_0xea6c('0x63')][_0xea6c('0x6c')],_0x1a5fa9[_0xea6c('0x6a')]['id'],_0x46079e[_0xea6c('0x5b')]?JSON[_0xea6c('0x28')](_0x46079e[_0xea6c('0x5b')]):'null');return respondWithRpcPromise(_0xea6c('0x6d'),_0xea6c('0x6e'),_0x1a5fa9);}return null;})[_0xea6c('0x22')](function(_0x3f066a){var _0x400e4a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f066a[_0xea6c('0x2a')]['ContactId'];return db['sequelize'][_0xea6c('0x43')](_0x400e4a,{'type':db[_0xea6c('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0xea6c('0x22')](function(_0x483cd2){return _0x483cd2;});})[_0xea6c('0x22')](function(_0x2b764b){if(_0x2b764b){_0x1a5fa9['message'][_0xea6c('0x70')]=_0x2b764b[0x0];if(!_0x46079e[_0xea6c('0x5b')][_0xea6c('0x64')])return;return db['User'][_0xea6c('0x59')]({'where':{'id':_0x46079e[_0xea6c('0x5b')]['UserId'],'role':_0xea6c('0x71')},'attributes':['id',_0xea6c('0x3a'),_0xea6c('0x72'),_0xea6c('0x73'),'internal'],'raw':!![]});}return null;})['then'](function(_0x437769){if(!_0x437769)return null;_0x1a5fa9[_0xea6c('0x2a')][_0xea6c('0x71')]=_0x437769;return _0x1a5fa9;})[_0xea6c('0x22')](function(_0x2c4913){if(_0x2c4913){if(_0x46079e[_0xea6c('0x5b')][_0xea6c('0x74')]){_0x1a5fa9[_0xea6c('0x2a')]['interface']=util[_0xea6c('0x62')](_0xea6c('0x75'),_0x46079e['user']['name']);_0x1a5fa9[_0xea6c('0x2a')]['channel']=_0x1a5fa9[_0xea6c('0x76')];_0x1a5fa9[_0xea6c('0x2a')][_0xea6c('0x77')]=_0x1a5fa9[_0xea6c('0x76')];_0x1a5fa9[_0xea6c('0x2a')][_0xea6c('0x78')]='accept';return respondWithRpcPromise(_0xea6c('0x79'),_0xea6c('0x79'),{'event':_0xea6c('0x7a'),'message':_0x1a5fa9[_0xea6c('0x2a')]},client9002)[_0xea6c('0x22')](function(){return _0x1a5fa9;});}return _0x1a5fa9;}return null;})[_0xea6c('0x22')](respondWithResult(_0x27b7d5,null))[_0xea6c('0x2c')](handleError(_0x27b7d5,null));};var interaction_log=require(_0xea6c('0x15'))(_0xea6c('0x5d'));exports[_0xea6c('0x37')]=function(_0x17c613,_0x140b95,_0x16acd9){var _0x571b2c={'agent':{},'channel':_0xea6c('0x5f')};if(_0x17c613[_0xea6c('0x5b')]['id']){delete _0x17c613[_0xea6c('0x5b')]['id'];}_0x17c613[_0xea6c('0x5b')]['UserId']=_0x17c613[_0xea6c('0x5b')][_0xea6c('0x64')]||_0x17c613[_0xea6c('0x63')]['id'];_0x571b2c['agent']['id']=_0x17c613['body'][_0xea6c('0x64')];return db[_0xea6c('0x3e')][_0xea6c('0x59')]({'where':{'id':_0x17c613[_0xea6c('0x57')]['id'],'UserId':null}})[_0xea6c('0x22')](handleEntityNotFound(_0x140b95,null))[_0xea6c('0x22')](function(_0x561a91){if(_0x561a91){_0x571b2c[_0xea6c('0x2a')]=_0x561a91[_0xea6c('0x65')]({'plain':!![]});return db[_0xea6c('0x7b')][_0xea6c('0x59')]({'where':{'id':_0x561a91[_0xea6c('0x66')]}});}return null;})[_0xea6c('0x22')](handleEntityNotFound(_0x140b95,null))['then'](function(_0x44aef6){if(_0x44aef6){_0x571b2c[_0xea6c('0x6a')]=_0x44aef6[_0xea6c('0x65')]({'plain':!![]});interaction_log[_0xea6c('0x23')](_0xea6c('0x7c'),_0x17c613[_0xea6c('0x63')]['id'],_0x17c613['user'][_0xea6c('0x3a')],_0x17c613[_0xea6c('0x63')][_0xea6c('0x6c')],_0x571b2c['interaction']['id'],_0x17c613[_0xea6c('0x5b')]?JSON[_0xea6c('0x28')](_0x17c613[_0xea6c('0x5b')]):_0xea6c('0x7d'));return respondWithRpcPromise(_0xea6c('0x7e'),_0xea6c('0x7f'),_0x571b2c);}return null;})[_0xea6c('0x22')](function(_0x45cff3){var _0x500267=_0xea6c('0x80')+_0x45cff3['message'][_0xea6c('0x81')];return db[_0xea6c('0x82')][_0xea6c('0x43')](_0x500267,{'type':db[_0xea6c('0x6f')][_0xea6c('0x83')][_0xea6c('0x84')],'raw':!![]})[_0xea6c('0x22')](function(_0x165836){return _0x165836;});})[_0xea6c('0x22')](function(_0x48e1f3){if(_0x48e1f3){_0x571b2c[_0xea6c('0x2a')]['contact']=_0x48e1f3[0x0];if(!_0x17c613[_0xea6c('0x5b')]['UserId'])return;return db['User'][_0xea6c('0x59')]({'where':{'id':_0x17c613[_0xea6c('0x5b')][_0xea6c('0x64')],'role':_0xea6c('0x71')},'attributes':['id',_0xea6c('0x3a'),_0xea6c('0x72'),'email','internal'],'raw':!![]});}return null;})[_0xea6c('0x22')](function(_0xf98360){if(!_0xf98360)return null;_0x571b2c[_0xea6c('0x2a')][_0xea6c('0x71')]=_0xf98360;return _0x571b2c;})[_0xea6c('0x22')](function(_0x14ec6b){if(_0x14ec6b){_0x14ec6b[_0xea6c('0x2a')][_0xea6c('0x85')]=util[_0xea6c('0x62')]('SIP/%s',_0x17c613[_0xea6c('0x63')][_0xea6c('0x3a')]);_0x14ec6b[_0xea6c('0x2a')][_0xea6c('0x76')]=_0x571b2c[_0xea6c('0x76')];_0x14ec6b[_0xea6c('0x2a')]['motionChannel']=_0x571b2c[_0xea6c('0x76')];_0x14ec6b[_0xea6c('0x2a')][_0xea6c('0x78')]=_0xea6c('0x37');respondWithRpcPromise(_0xea6c('0x79'),_0xea6c('0x79'),{'event':_0xea6c('0x86'),'message':_0x14ec6b[_0xea6c('0x2a')]},client9002);return _0x571b2c;}return null;})[_0xea6c('0x22')](respondWithResult(_0x140b95,null))[_0xea6c('0x2c')](handleError(_0x140b95,null));};exports[_0xea6c('0x2e')]=function(_0x47fb74,_0x204135,_0x3c2d9b){if(_0x47fb74[_0xea6c('0x5b')]['id']){delete _0x47fb74[_0xea6c('0x5b')]['id'];}var _0x2dfb00;return db[_0xea6c('0x3e')][_0xea6c('0x59')]({'where':{'id':_0x47fb74[_0xea6c('0x57')]['id']}})['then'](handleEntityNotFound(_0x204135,null))[_0xea6c('0x22')](function(_0xb93ae){if(_0xb93ae){_0x2dfb00=_0xb93ae;return db[_0xea6c('0x87')][_0xea6c('0x59')]({'where':{'id':_0xb93ae['SmsAccountId']}});}})[_0xea6c('0x22')](handleEntityNotFound(_0x204135,null))[_0xea6c('0x22')](function(_0x54b73a){if(_0x54b73a){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0xea6c('0x88'),_0x54b73a[_0xea6c('0x3f')],util[_0xea6c('0x89')](_0x47fb74['body'],{'showHidden':![],'depth':null}));switch(_0x54b73a[_0xea6c('0x3f')]){case _0xea6c('0x8a'):if(_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x8b')]&&_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x8b')]===_0x2dfb00[_0xea6c('0x8c')]){return _0x2dfb00[_0xea6c('0x38')]({'read':!![]});}else{logger[_0xea6c('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xea6c('0x2e'),_0xea6c('0x8a'),util[_0xea6c('0x89')](_0x47fb74['body'],{'showHidden':![],'depth':null}));}break;case _0xea6c('0x8d'):if(_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x8e')]&&_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x8e')]===_0x2dfb00['messageId']&&_[_0xea6c('0x8f')](['sent','delivered'],_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x90')])>=0x0){return _0x2dfb00[_0xea6c('0x38')]({'read':!![]});}else{logger[_0xea6c('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','plivio',util[_0xea6c('0x89')](_0x47fb74['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xe827b4=_0x47fb74[_0xea6c('0x5b')][_0xea6c('0x91')][0x0];if(_0xe827b4[_0xea6c('0x2e')]['groupName']===_0xea6c('0x92')){return _0x2dfb00[_0xea6c('0x38')]({'read':!![]});}else{logger[_0xea6c('0x29')](_0xea6c('0x93'),'status','infobip',util['inspect'](_0x47fb74['body'],{'showHidden':![],'depth':null}));}break;}return _0x2dfb00;}})[_0xea6c('0x22')](respondWithResult(_0x204135,null))[_0xea6c('0x2c')](handleError(_0x204135,null));};
\ No newline at end of file
index 33a02e1..39c999a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad74=['hook','exports','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x4ec13d,_0x5e11ea){var _0xe1f19b=function(_0x4af04b){while(--_0x4af04b){_0x4ec13d['push'](_0x4ec13d['shift']());}};_0xe1f19b(++_0x5e11ea);}(_0xad74,0x102));var _0x4ad7=function(_0x528442,_0x3f7aed){_0x528442=_0x528442-0x0;var _0x4c42cd=_0xad74[_0x528442];return _0x4c42cd;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x4ad7('0x0'))['db'][_0x4ad7('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4ad7('0x2')](0x0);var events={'afterCreate':_0x4ad7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4fe1da){return function(_0x2c1272,_0x5222f4,_0x40cb21){SmsMessageEvents[_0x4ad7('0x4')](_0x4fe1da+':'+_0x2c1272['id'],_0x2c1272);SmsMessageEvents[_0x4ad7('0x4')](_0x4fe1da,_0x2c1272);_0x40cb21(null);};}for(var e in events){if(events[_0x4ad7('0x5')](e)){var event=events[e];SmsMessage[_0x4ad7('0x6')](e,emitEvent(event));}}module[_0x4ad7('0x7')]=SmsMessageEvents;
\ No newline at end of file
+var _0x519c=['../../mysqldb','SmsMessage','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5bfaf1,_0x7cb94d){var _0x1b6d2e=function(_0x4f2064){while(--_0x4f2064){_0x5bfaf1['push'](_0x5bfaf1['shift']());}};_0x1b6d2e(++_0x7cb94d);}(_0x519c,0x177));var _0xc519=function(_0x5b76c6,_0x5e5dad){_0x5b76c6=_0x5b76c6-0x0;var _0xfdbd0a=_0x519c[_0x5b76c6];return _0xfdbd0a;};'use strict';var EventEmitter=require(_0xc519('0x0'));var SmsMessage=require(_0xc519('0x1'))['db'][_0xc519('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc519('0x3'),'afterDestroy':_0xc519('0x4')};function emitEvent(_0x1b0aeb){return function(_0x22d775,_0x42aa35,_0x39ba32){SmsMessageEvents[_0xc519('0x5')](_0x1b0aeb+':'+_0x22d775['id'],_0x22d775);SmsMessageEvents[_0xc519('0x5')](_0x1b0aeb,_0x22d775);_0x39ba32(null);};}for(var e in events){if(events[_0xc519('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xc519('0x7')]=SmsMessageEvents;
\ No newline at end of file
index 2928dea..551e327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2db4=['rimraf','exports','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get','toLowerCase','direction','secret','isNil','SmsInteraction','findOne','SmsInteractionId','update','createdAt','catch','out','find','SmsAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','remote','/status?token=','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','GET','POST','user_key','session_key','total_sent','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','password','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','length','apiKey','createHash','md5','digest','signature=','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','util','../../config/logger','api','moment','bluebird'];(function(_0x25bf86,_0x32efbb){var _0x564d47=function(_0x5849c3){while(--_0x5849c3){_0x25bf86['push'](_0x25bf86['shift']());}};_0x564d47(++_0x32efbb);}(_0x2db4,0x1ef));var _0x42db=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x2db4[_0x5b561d];return _0x431060;};'use strict';var _=require('lodash');var util=require(_0x42db('0x0'));var logger=require(_0x42db('0x1'))(_0x42db('0x2'));var moment=require(_0x42db('0x3'));var BPromise=require(_0x42db('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x42db('0x5'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0x42db('0x6')]=function(_0x1f9aee,_0x554fb8){return _0x1f9aee['define'](_0x42db('0x7'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x42db('0x8'),'fields':[_0x42db('0x8')]},{'name':_0x42db('0x9'),'fields':[_0x42db('0xa')],'type':_0x42db('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2161e9,_0x7301d8,_0x378d8e){var _0x3f2152=_0x1f9aee[_0x42db('0xc')];var _0x1ed32d=_0x2161e9[_0x42db('0xd')]({'plain':!![]});if(_0x1ed32d['direction'][_0x42db('0xe')]()==='in'||_0x1ed32d[_0x42db('0xf')]['toLowerCase']()==='out'&&!_0x1ed32d[_0x42db('0x10')]&&!_['isNil'](_0x1ed32d['UserId'])&&!_[_0x42db('0x11')](_0x1ed32d['SmsInteractionId'])){_0x3f2152[_0x42db('0x12')][_0x42db('0x13')]({'where':{'id':_0x1ed32d[_0x42db('0x14')]}})['then'](function(_0x4d5feb){if(_0x4d5feb){_0x4d5feb[_0x42db('0x15')]({'lastMsgAt':_0x1ed32d[_0x42db('0x16')],'lastMsgDirection':_0x1ed32d[_0x42db('0xf')][_0x42db('0xe')]()});}})[_0x42db('0x17')](function(_0xda164a){console['error'](_0xda164a);});}if(_0x1ed32d['direction']===_0x42db('0x18')&&!_0x1ed32d[_0x42db('0x10')]){var _0xa84483;_0x3f2152['SmsAccount'][_0x42db('0x19')]({'where':{'id':_0x1ed32d[_0x42db('0x1a')]},'raw':!![]})[_0x42db('0x1b')](function(_0x3c976d){_0xa84483=_0x3c976d;if(_0xa84483&&_0xa84483[_0x42db('0x1c')]){switch(_0xa84483['type']){case _0x42db('0x1d'):var _0x1e3974=require(_0x42db('0x1d'));if(_0xa84483[_0x42db('0x1e')]&&_0xa84483[_0x42db('0x1f')]&&_0xa84483[_0x42db('0x20')]){var _0x3e3a66=new _0x1e3974(_0xa84483[_0x42db('0x1e')],_0xa84483[_0x42db('0x1f')]);_0x3e3a66[_0x42db('0x21')][_0x42db('0x22')]({'body':_0x1ed32d[_0x42db('0xa')],'to':_0x1ed32d['phone'],'from':_0xa84483[_0x42db('0x20')],'statusCallback':_0xa84483[_0x42db('0x23')]+'/api/sms/messages/'+_0x1ed32d['id']+_0x42db('0x24')+_0xa84483['token']})[_0x42db('0x1b')](function(_0x11ae21){if(_0x11ae21[_0x42db('0x25')]){return _0x2161e9['update']({'messageId':_0x11ae21[_0x42db('0x25')]});}})[_0x42db('0x17')](function(_0x40d501){logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x1d'),util[_0x42db('0x29')](_0x40d501,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x1d'),_0x42db('0x2a'));}break;case'skebby':var _0xa7c82f=_0x42db('0x2b');if(_0xa84483[_0x42db('0x2c')]&&_0xa84483['password']){var _0xd1a1e5={'recipient':[_0x1ed32d[_0x42db('0x20')]],'message':_0x1ed32d['body'],'message_type':_0xa84483[_0x42db('0x2d')]};if(_0xa84483['smsMethod']&&_0xa84483[_0x42db('0x2d')]!=='SI'){_0xd1a1e5[_0x42db('0x2e')]=_0xa84483[_0x42db('0x20')];}var _0x58a676={'url':_0xa7c82f+_0x42db('0x2f')+_0xa84483[_0x42db('0x2c')]+_0x42db('0x30')+_0xa84483['password'],'method':_0x42db('0x31')};rp(_0x58a676)['then'](function(_0x4c75f5){var _0x4cc67f=_0x4c75f5['split'](';');var _0x5dcbb3={'user_key':_0x4cc67f[0x0],'session_key':_0x4cc67f[0x1]};_0x58a676={'url':_0xa7c82f+'sms','method':_0x42db('0x32'),'headers':{'user_key':_0x5dcbb3[_0x42db('0x33')],'Session_key':_0x5dcbb3[_0x42db('0x34')]},'json':!![],'body':_0xd1a1e5};return rp(_0x58a676);})[_0x42db('0x1b')](function(_0x21de19){if(_0x21de19[_0x42db('0x35')]>=0x1){var _0x4fe3f3={'messageId':_0x21de19['internal_order_id']};if(_0xa84483[_0x42db('0x2d')]!=='GP'||!_0xa84483[_0x42db('0x36')]){_0x4fe3f3[_0x42db('0x37')]=!![];}return _0x2161e9[_0x42db('0x15')](_0x4fe3f3);}else{return logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x38'),util['inspect'](_0x21de19,{'showHidden':![],'depth':null}));}})['catch'](function(_0x215d81){return logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate',_0x42db('0x38'),util[_0x42db('0x29')](_0x215d81,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x38'),_0x42db('0x39'));}break;case _0x42db('0x3a'):if(_0xa84483['authToken']){var _0x3b47c8={'recipient':_0x1ed32d['phone'],'message':_0x1ed32d[_0x42db('0xa')],'sender':_0xa84483[_0x42db('0x3b')]||_0xa84483['phone'],'authorization':_0xa84483[_0x42db('0x1f')]};var _0x7301d8={'method':_0x42db('0x32'),'uri':_0x42db('0x3c'),'body':_0x3b47c8,'json':!![]};rp(_0x7301d8)[_0x42db('0x1b')](function(_0x45e5d3){var _0x50d895={'messageId':_0x45e5d3[_0x42db('0x3d')]};if(!_0xa84483[_0x42db('0x36')]){_0x50d895[_0x42db('0x37')]=!![];}return _0x2161e9[_0x42db('0x15')](_0x50d895);})[_0x42db('0x17')](function(_0x27d829){logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42db('0x3a'),util[_0x42db('0x29')](_0x27d829,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x3a'),_0x42db('0x3e'));}break;case _0x42db('0x3f'):if(_0xa84483[_0x42db('0x2c')]&&_0xa84483[_0x42db('0x40')]){var _0x3b47c8={'messages':[{'source':_0x42db('0x41'),'to':_0x1ed32d['phone'],'body':_0x1ed32d[_0x42db('0xa')],'from':_0xa84483[_0x42db('0x3b')]||_0xa84483[_0x42db('0x20')]}]};var _0x33c493=util[_0x42db('0x42')](_0x42db('0x43'),_0xa84483['username'],_0xa84483[_0x42db('0x40')]);var _0x7301d8={'method':'POST','uri':_0x42db('0x44'),'body':_0x3b47c8,'headers':{'Authorization':util['format'](_0x42db('0x45'),new Buffer(_0x33c493)['toString'](_0x42db('0x46')))},'json':!![]};rp(_0x7301d8)[_0x42db('0x1b')](function(_0x2e269f){if(_0x2e269f['http_code']>=0xc8&&_0x2e269f[_0x42db('0x47')]<=0xce){if(_0x2e269f[_0x42db('0x48')]&&_0x2e269f['data']['queued_count']>0x0){var _0x2def30=_[_0x42db('0x49')](_0x2e269f[_0x42db('0x48')][_0x42db('0x21')]);var _0x2f2051={'messageId':_0x2def30[_0x42db('0x4a')]};if(!_0xa84483[_0x42db('0x36')]){_0x2f2051[_0x42db('0x37')]=!![];}return _0x2161e9[_0x42db('0x15')](_0x2f2051);}else{logger['error'](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x4b'),util[_0x42db('0x29')](_0x2e269f,{'showHidden':![],'depth':null}));}}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),'clickSend',util['inspect'](_0x2e269f,{'showHidden':![],'depth':null}));}})[_0x42db('0x17')](function(_0x462414){logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x4b'),util[_0x42db('0x29')](_0x462414,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x42db('0x4c'):if(_0xa84483['authId']&&_0xa84483[_0x42db('0x1f')]){var _0x3b47c8={'dst':_0x1ed32d[_0x42db('0x20')],'text':_0x1ed32d[_0x42db('0xa')],'src':_0xa84483[_0x42db('0x3b')]||_0xa84483[_0x42db('0x20')],'url':_0xa84483[_0x42db('0x23')]+_0x42db('0x4d')+_0x1ed32d['id']+_0x42db('0x24')+_0xa84483['token']};var _0x33c493=util['format'](_0x42db('0x43'),_0xa84483[_0x42db('0x4e')],_0xa84483['authToken']);var _0x7301d8={'method':_0x42db('0x32'),'uri':util[_0x42db('0x42')](_0x42db('0x4f'),_0xa84483[_0x42db('0x4e')]),'body':_0x3b47c8,'headers':{'Authorization':util[_0x42db('0x42')](_0x42db('0x45'),new Buffer(_0x33c493)[_0x42db('0x50')]('base64'))},'json':!![]};rp(_0x7301d8)[_0x42db('0x1b')](function(_0x512f03){var _0x2a6dd6={'messageId':_0x512f03[_0x42db('0x51')][0x0]};return _0x2161e9[_0x42db('0x15')](_0x2a6dd6);})[_0x42db('0x17')](function(_0x85308a){logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate','plivo',util[_0x42db('0x29')](_0x85308a,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x4c'),_0x42db('0x52'));}break;case'infobip':if(_0xa84483[_0x42db('0x2c')]&&_0xa84483['password']){if(_0xa84483[_0x42db('0x53')]){var _0x2b14c5={'method':_0x42db('0x32'),'uri':_0xa84483[_0x42db('0x53')]+_0x42db('0x54'),'body':{'username':_0xa84483[_0x42db('0x2c')],'password':_0xa84483[_0x42db('0x40')]},'json':!![]};return rp(_0x2b14c5)[_0x42db('0x1b')](function(_0x297dad){var _0x5807b9={'method':_0x42db('0x32'),'uri':_0xa84483['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0xa84483[_0x42db('0x20')],'destinations':[{'to':_0x1ed32d[_0x42db('0x20')]}],'text':_0x1ed32d['body'],'notifyUrl':_0xa84483[_0x42db('0x23')]+_0x42db('0x4d')+_0x1ed32d['id']+_0x42db('0x24')+_0xa84483['token'],'notifyContentType':_0x42db('0x55'),'callbackData':_0xa84483['phone']+';'+_0x1ed32d[_0x42db('0xa')]}]},'headers':{'Authorization':_0x42db('0x56')+_0x297dad['token']},'json':!![]};return rp(_0x5807b9)['then'](function(_0x1362c7){if(_0x1362c7[_0x42db('0x21')]){var _0x405c35={'messageId':_0x1362c7['messages'][0x0][_0x42db('0x8')]};if(!_0xa84483['deliveryReport']){_0x405c35[_0x42db('0x37')]=!![];}return _0x2161e9['update'](_0x405c35);}else{return logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),'infobip',util[_0x42db('0x29')](_0x1362c7,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x329d77){return logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x57'),util['inspect'](_0x329d77,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x57'),_0x42db('0x58'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x57'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x42db('0x59'):var _0x35bb4c=require(_0x42db('0x5a'));if(_0xa84483['apiKey']){var _0x6b3368={};_0x6b3368[_0x42db('0x5b')]=_0xa84483[_0x42db('0x2c')];_0x6b3368['phone']=_0x1ed32d[_0x42db('0x20')];_0x6b3368[_0x42db('0x2e')]=_0xa84483[_0x42db('0x20')];_0x6b3368[_0x42db('0x5c')]=_0x1ed32d[_0x42db('0xa')];_0x6b3368[_0x42db('0x5d')]=+new Date();var _0x4de2a2='';var _0x56200e='';var _0xa53e56=Object[_0x42db('0x5e')](_0x6b3368);_0xa53e56[_0x42db('0x5f')]();for(var _0x582937=0x0;_0x582937<_0xa53e56[_0x42db('0x60')];_0x582937++){if(_0x4de2a2!=''){_0x4de2a2+='&';}_0x4de2a2+=_0xa53e56[_0x582937]+'='+encodeURIComponent(_0x6b3368[_0xa53e56[_0x582937]]);_0x56200e+=_0x6b3368[_0xa53e56[_0x582937]];}_0x56200e+=_0xa84483[_0x42db('0x61')];_0x56200e=_0x35bb4c[_0x42db('0x62')](_0x42db('0x63'))[_0x42db('0x15')](_0x56200e)[_0x42db('0x64')]('hex');if(_0x4de2a2!==''){_0x4de2a2+='&';}_0x4de2a2+=_0x42db('0x65')+_0x56200e;var _0x58a676={'method':_0x42db('0x31'),'uri':_0xa84483[_0x42db('0x53')]+'/external/get/send.php?'+_0x4de2a2,'json':!![]};return rp(_0x58a676)[_0x42db('0x1b')](function(_0x4cafa1){var _0x31377a=Object[_0x42db('0x5e')](_0x4cafa1);if(_0x4cafa1[_0x31377a[0x0]]['error']&&parseInt(_0x4cafa1[_0x31377a[0x0]][_0x42db('0x26')])===0x0){var _0x1ba292={'messageId':_0x4cafa1[_0x31377a[0x0]][_0x42db('0x66')]};if(!_0xa84483['deliveryReport']){_0x1ba292[_0x42db('0x37')]=!![];}return _0x2161e9[_0x42db('0x15')](_0x1ba292);}else{return logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x59'),util[_0x42db('0x29')](_0x4cafa1[_0x42db('0x26')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x26bba1){return logger['error'](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x59'),util['inspect'](_0x26bba1,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate',_0x42db('0x59'),_0x42db('0x67'));}break;case'clickatell':if(_0xa84483[_0x42db('0x61')]){var _0x510c56={'method':_0x42db('0x32'),'uri':_0x42db('0x68'),'headers':{'Authorization':_0xa84483[_0x42db('0x61')]},'body':{'content':_0x1ed32d[_0x42db('0xa')],'to':[_0x1ed32d[_0x42db('0x20')]],'from':_0xa84483['phone'],'binary':![],'clientMessageId':_0x42db('0x69'),'charset':_0x42db('0x6a')},'json':!![]};rp(_0x510c56)[_0x42db('0x1b')](function(_0x195ae6){if(!_0x195ae6[_0x42db('0x26')]){var _0x19689a={'messageId':_0x195ae6[_0x42db('0x21')][0x0][_0x42db('0x6b')]};if(!_0xa84483[_0x42db('0x36')]){_0x19689a[_0x42db('0x37')]=!![];}return _0x2161e9[_0x42db('0x15')](_0x19689a);}else{return logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate',_0x42db('0x6c'),util[_0x42db('0x29')](_0x195ae6[_0x42db('0x26')],{'showHidden':![],'depth':null}));}})[_0x42db('0x17')](function(_0xb3dc7a){return logger['error'](_0x42db('0x27'),'afterCreate',_0x42db('0x6c'),util[_0x42db('0x29')](_0xb3dc7a,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x42db('0x6d'):if(_0xa84483[_0x42db('0x2c')]&&_0xa84483['password']){var _0x33c493=util[_0x42db('0x42')](_0x42db('0x43'),_0xa84483[_0x42db('0x2c')],_0xa84483[_0x42db('0x40')]);var _0x7301d8={'method':_0x42db('0x32'),'uri':_0x42db('0x6e')+_0xa84483[_0x42db('0x6f')]+_0x42db('0x70'),'body':{'to':[_0x1ed32d[_0x42db('0x20')]],'text':_0x1ed32d[_0x42db('0xa')],'from':_0xa84483[_0x42db('0x20')],'applicationId':_0xa84483[_0x42db('0x71')]},'headers':{'Authorization':util['format'](_0x42db('0x45'),new Buffer(_0x33c493)[_0x42db('0x50')](_0x42db('0x46')))},'json':!![]};rp(_0x7301d8)['then'](function(_0x5179de){if(_0x5179de['id']){var _0x12c2dd={'messageId':_0x5179de['id']};return _0x2161e9[_0x42db('0x15')](_0x12c2dd);}else{logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x6d'),util['inspect'](_0x5179de,{'showHidden':![],'depth':null}));}})[_0x42db('0x17')](function(_0x3303e5){logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate',_0x42db('0x6d'),util[_0x42db('0x29')](_0x3303e5,{'showHidden':![],'depth':null}));});}else{logger[_0x42db('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x42db('0x6d'),_0x42db('0x39'));}break;case _0x42db('0x72'):if(_0xa84483[_0x42db('0x61')]){var _0x3b31c0={};var _0x58a676={'method':_0x42db('0x32'),'uri':_0x42db('0x73'),'headers':{'Authorization':_0x42db('0x74')+_0xa84483['apiKey'],'Content-Type':_0x42db('0x55')},'body':{'from':_0xa84483[_0x42db('0x20')],'to':_0x1ed32d[_0x42db('0x20')],'text':_0x1ed32d['body']},'json':!![]};return rp(_0x58a676)[_0x42db('0x1b')](function(_0x581387){if(_0x581387[_0x42db('0x75')]==0xca){_0x3b31c0[_0x42db('0x76')]=_0x581387;var _0x27f8df={'method':_0x42db('0x32'),'uri':_0x42db('0x77'),'headers':{'Authorization':_0x42db('0x74')+_0xa84483[_0x42db('0x61')],'Content-Type':_0x42db('0x55')},'body':{'refid':_0x3b31c0[_0x42db('0x76')][_0x42db('0x78')]},'json':!![]};return rp(_0x27f8df)[_0x42db('0x1b')](function(_0x3add98){_0x3b31c0[_0x42db('0x79')]=_0x3add98;var _0x563ca7={'messageId':_0x3b31c0[_0x42db('0x76')]['refid'],'read':!![]};return _0x2161e9[_0x42db('0x15')](_0x563ca7);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x42db('0x28'),_0x42db('0x72'),util[_0x42db('0x29')](_0x581387,{'showHidden':![],'depth':null}));}})['catch'](function(_0x100a56){return logger[_0x42db('0x26')](_0x42db('0x27'),_0x42db('0x28'),_0x42db('0x72'),util[_0x42db('0x29')](_0x100a56,{'showHidden':![],'depth':null}));});}else{return logger[_0x42db('0x26')](_0x42db('0x27'),'afterCreate',_0x42db('0x72'),_0x42db('0x7a'));}break;}}})[_0x42db('0x7b')](function(){_0x378d8e();});}else{_0x378d8e();}}},'charset':_0x42db('0x7c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd636=['toString','base64','http_code','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','length','digest','hex','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','intelepeer','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','./smsMessage.attributes','exports','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','then','update','createdAt','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','&password=','GET','split','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s'];(function(_0x8d8835,_0x2dd562){var _0x2f8f81=function(_0x22e74f){while(--_0x22e74f){_0x8d8835['push'](_0x8d8835['shift']());}};_0x2f8f81(++_0x2dd562);}(_0xd636,0xa7));var _0x6d63=function(_0x571bde,_0x352e98){_0x571bde=_0x571bde-0x0;var _0x4deccb=_0xd636[_0x571bde];return _0x4deccb;};'use strict';var _=require(_0x6d63('0x0'));var util=require(_0x6d63('0x1'));var logger=require(_0x6d63('0x2'))(_0x6d63('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6d63('0x4'));var fs=require('fs');var path=require(_0x6d63('0x5'));var rimraf=require(_0x6d63('0x6'));var config=require('../../config/environment');var attributes=require(_0x6d63('0x7'));module[_0x6d63('0x8')]=function(_0x5248b7,_0x276f87){return _0x5248b7[_0x6d63('0x9')]('SmsMessage',attributes,{'tableName':_0x6d63('0xa'),'paranoid':![],'indexes':[{'name':_0x6d63('0xb'),'fields':[_0x6d63('0xb')]},{'name':_0x6d63('0xc'),'fields':[_0x6d63('0xd')],'type':_0x6d63('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x355d26,_0x5e3a61,_0x1dadb5){var _0x343150=_0x5248b7['models'];var _0x10e218=_0x355d26['get']({'plain':!![]});if(_0x10e218[_0x6d63('0xf')]['toLowerCase']()==='in'||_0x10e218[_0x6d63('0xf')][_0x6d63('0x10')]()===_0x6d63('0x11')&&!_0x10e218[_0x6d63('0x12')]&&!_[_0x6d63('0x13')](_0x10e218[_0x6d63('0x14')])&&!_[_0x6d63('0x13')](_0x10e218[_0x6d63('0x15')])){_0x343150[_0x6d63('0x16')]['findOne']({'where':{'id':_0x10e218[_0x6d63('0x15')]}})[_0x6d63('0x17')](function(_0x2cfad4){if(_0x2cfad4){_0x2cfad4[_0x6d63('0x18')]({'lastMsgAt':_0x10e218[_0x6d63('0x19')],'lastMsgDirection':_0x10e218[_0x6d63('0xf')][_0x6d63('0x10')]()});}})[_0x6d63('0x1a')](function(_0xe8ee2){console['error'](_0xe8ee2);});}if(_0x10e218[_0x6d63('0xf')]===_0x6d63('0x11')&&!_0x10e218['secret']){var _0xd2153f;_0x343150[_0x6d63('0x1b')][_0x6d63('0x1c')]({'where':{'id':_0x10e218[_0x6d63('0x1d')]},'raw':!![]})[_0x6d63('0x17')](function(_0x1c777d){_0xd2153f=_0x1c777d;if(_0xd2153f&&_0xd2153f[_0x6d63('0x1e')]){switch(_0xd2153f['type']){case'twilio':var _0xc1e280=require(_0x6d63('0x1f'));if(_0xd2153f[_0x6d63('0x20')]&&_0xd2153f[_0x6d63('0x21')]&&_0xd2153f[_0x6d63('0x22')]){var _0x1b8b06=new _0xc1e280(_0xd2153f[_0x6d63('0x20')],_0xd2153f[_0x6d63('0x21')]);_0x1b8b06[_0x6d63('0x23')][_0x6d63('0x24')]({'body':_0x10e218[_0x6d63('0xd')],'to':_0x10e218[_0x6d63('0x22')],'from':_0xd2153f[_0x6d63('0x22')],'statusCallback':_0xd2153f[_0x6d63('0x25')]+_0x6d63('0x26')+_0x10e218['id']+_0x6d63('0x27')+_0xd2153f[_0x6d63('0x28')]})['then'](function(_0x104323){if(_0x104323[_0x6d63('0x29')]){return _0x355d26[_0x6d63('0x18')]({'messageId':_0x104323[_0x6d63('0x29')]});}})['catch'](function(_0x5a84ab){logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x1f'),util[_0x6d63('0x2d')](_0x5a84ab,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x1f'),_0x6d63('0x2e'));}break;case _0x6d63('0x2f'):var _0x3d26ec=_0x6d63('0x30');if(_0xd2153f[_0x6d63('0x31')]&&_0xd2153f[_0x6d63('0x32')]){var _0x4673f1={'recipient':[_0x10e218[_0x6d63('0x22')]],'message':_0x10e218[_0x6d63('0xd')],'message_type':_0xd2153f['smsMethod']};if(_0xd2153f['smsMethod']&&_0xd2153f[_0x6d63('0x33')]!=='SI'){_0x4673f1[_0x6d63('0x34')]=_0xd2153f[_0x6d63('0x22')];}var _0x4e6dd4={'url':_0x3d26ec+'login?username='+_0xd2153f[_0x6d63('0x31')]+_0x6d63('0x35')+_0xd2153f[_0x6d63('0x32')],'method':_0x6d63('0x36')};rp(_0x4e6dd4)[_0x6d63('0x17')](function(_0x17b0c8){var _0x331e75=_0x17b0c8[_0x6d63('0x37')](';');var _0x1a7e5a={'user_key':_0x331e75[0x0],'session_key':_0x331e75[0x1]};_0x4e6dd4={'url':_0x3d26ec+'sms','method':_0x6d63('0x38'),'headers':{'user_key':_0x1a7e5a[_0x6d63('0x39')],'Session_key':_0x1a7e5a[_0x6d63('0x3a')]},'json':!![],'body':_0x4673f1};return rp(_0x4e6dd4);})['then'](function(_0x169d8f){if(_0x169d8f[_0x6d63('0x3b')]>=0x1){var _0x3c9c28={'messageId':_0x169d8f[_0x6d63('0x3c')]};if(_0xd2153f[_0x6d63('0x33')]!=='GP'||!_0xd2153f[_0x6d63('0x3d')]){_0x3c9c28[_0x6d63('0x3e')]=!![];}return _0x355d26[_0x6d63('0x18')](_0x3c9c28);}else{return logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x2f'),util[_0x6d63('0x2d')](_0x169d8f,{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x2fe2c3){return logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x2f'),util[_0x6d63('0x2d')](_0x2fe2c3,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x2f'),_0x6d63('0x3f'));}break;case _0x6d63('0x40'):if(_0xd2153f['authToken']){var _0xb164fc={'recipient':_0x10e218[_0x6d63('0x22')],'message':_0x10e218[_0x6d63('0xd')],'sender':_0xd2153f[_0x6d63('0x41')]||_0xd2153f[_0x6d63('0x22')],'authorization':_0xd2153f[_0x6d63('0x21')]};var _0x5e3a61={'method':_0x6d63('0x38'),'uri':_0x6d63('0x42'),'body':_0xb164fc,'json':!![]};rp(_0x5e3a61)[_0x6d63('0x17')](function(_0x52a855){var _0x315fbe={'messageId':_0x52a855[_0x6d63('0x43')]};if(!_0xd2153f[_0x6d63('0x3d')]){_0x315fbe[_0x6d63('0x3e')]=!![];}return _0x355d26[_0x6d63('0x18')](_0x315fbe);})['catch'](function(_0x3091bf){logger['error'](_0x6d63('0x2b'),'afterCreate',_0x6d63('0x40'),util[_0x6d63('0x2d')](_0x3091bf,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0x6d63('0x44'));}break;case'clicksend':if(_0xd2153f['username']&&_0xd2153f[_0x6d63('0x32')]){var _0xb164fc={'messages':[{'source':_0x6d63('0x45'),'to':_0x10e218[_0x6d63('0x22')],'body':_0x10e218[_0x6d63('0xd')],'from':_0xd2153f[_0x6d63('0x41')]||_0xd2153f[_0x6d63('0x22')]}]};var _0xa1c3e7=util[_0x6d63('0x46')]('%s:%s',_0xd2153f[_0x6d63('0x31')],_0xd2153f[_0x6d63('0x32')]);var _0x5e3a61={'method':'POST','uri':_0x6d63('0x47'),'body':_0xb164fc,'headers':{'Authorization':util['format'](_0x6d63('0x48'),new Buffer(_0xa1c3e7)[_0x6d63('0x49')](_0x6d63('0x4a')))},'json':!![]};rp(_0x5e3a61)['then'](function(_0x4001ae){if(_0x4001ae[_0x6d63('0x4b')]>=0xc8&&_0x4001ae[_0x6d63('0x4b')]<=0xce){if(_0x4001ae[_0x6d63('0x4c')]&&_0x4001ae[_0x6d63('0x4c')]['queued_count']>0x0){var _0x5dc55f=_['head'](_0x4001ae[_0x6d63('0x4c')][_0x6d63('0x23')]);var _0x818e29={'messageId':_0x5dc55f[_0x6d63('0x4d')]};if(!_0xd2153f[_0x6d63('0x3d')]){_0x818e29[_0x6d63('0x3e')]=!![];}return _0x355d26[_0x6d63('0x18')](_0x818e29);}else{logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),'clickSend',util['inspect'](_0x4001ae,{'showHidden':![],'depth':null}));}}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x4e'),util[_0x6d63('0x2d')](_0x4001ae,{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x38af1d){logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x4e'),util[_0x6d63('0x2d')](_0x38af1d,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x4e'),_0x6d63('0x3f'));}break;case _0x6d63('0x4f'):if(_0xd2153f[_0x6d63('0x50')]&&_0xd2153f[_0x6d63('0x21')]){var _0xb164fc={'dst':_0x10e218[_0x6d63('0x22')],'text':_0x10e218[_0x6d63('0xd')],'src':_0xd2153f[_0x6d63('0x41')]||_0xd2153f['phone'],'url':_0xd2153f['remote']+_0x6d63('0x26')+_0x10e218['id']+_0x6d63('0x27')+_0xd2153f[_0x6d63('0x28')]};var _0xa1c3e7=util[_0x6d63('0x46')]('%s:%s',_0xd2153f[_0x6d63('0x50')],_0xd2153f['authToken']);var _0x5e3a61={'method':_0x6d63('0x38'),'uri':util[_0x6d63('0x46')](_0x6d63('0x51'),_0xd2153f[_0x6d63('0x50')]),'body':_0xb164fc,'headers':{'Authorization':util[_0x6d63('0x46')](_0x6d63('0x48'),new Buffer(_0xa1c3e7)[_0x6d63('0x49')](_0x6d63('0x4a')))},'json':!![]};rp(_0x5e3a61)[_0x6d63('0x17')](function(_0x4970d9){var _0x5236d0={'messageId':_0x4970d9[_0x6d63('0x52')][0x0]};return _0x355d26[_0x6d63('0x18')](_0x5236d0);})[_0x6d63('0x1a')](function(_0x47e013){logger[_0x6d63('0x2a')](_0x6d63('0x2b'),'afterCreate','plivo',util[_0x6d63('0x2d')](_0x47e013,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x4f'),_0x6d63('0x53'));}break;case'infobip':if(_0xd2153f[_0x6d63('0x31')]&&_0xd2153f['password']){if(_0xd2153f[_0x6d63('0x54')]){var _0x30a13b={'method':_0x6d63('0x38'),'uri':_0xd2153f[_0x6d63('0x54')]+_0x6d63('0x55'),'body':{'username':_0xd2153f[_0x6d63('0x31')],'password':_0xd2153f[_0x6d63('0x32')]},'json':!![]};return rp(_0x30a13b)[_0x6d63('0x17')](function(_0x56a066){var _0x88e4ea={'method':_0x6d63('0x38'),'uri':_0xd2153f[_0x6d63('0x54')]+_0x6d63('0x56'),'body':{'messages':[{'from':_0xd2153f[_0x6d63('0x22')],'destinations':[{'to':_0x10e218[_0x6d63('0x22')]}],'text':_0x10e218[_0x6d63('0xd')],'notifyUrl':_0xd2153f[_0x6d63('0x25')]+'/api/sms/messages/'+_0x10e218['id']+'/status?token='+_0xd2153f['token'],'notifyContentType':_0x6d63('0x57'),'callbackData':_0xd2153f[_0x6d63('0x22')]+';'+_0x10e218['body']}]},'headers':{'Authorization':_0x6d63('0x58')+_0x56a066[_0x6d63('0x28')]},'json':!![]};return rp(_0x88e4ea)[_0x6d63('0x17')](function(_0x3744ff){if(_0x3744ff[_0x6d63('0x23')]){var _0x26eeab={'messageId':_0x3744ff[_0x6d63('0x23')][0x0][_0x6d63('0xb')]};if(!_0xd2153f[_0x6d63('0x3d')]){_0x26eeab[_0x6d63('0x3e')]=!![];}return _0x355d26[_0x6d63('0x18')](_0x26eeab);}else{return logger['error'](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x59'),util[_0x6d63('0x2d')](_0x3744ff,{'showHidden':![],'depth':null}));}});})[_0x6d63('0x1a')](function(_0x457e9d){return logger['error'](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x59'),util[_0x6d63('0x2d')](_0x457e9d,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),'infobip',_0x6d63('0x5a'));}}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x6d63('0x5b'):var _0x13af98=require(_0x6d63('0x5c'));if(_0xd2153f[_0x6d63('0x5d')]){var _0x4e2678={};_0x4e2678[_0x6d63('0x5e')]=_0xd2153f['username'];_0x4e2678['phone']=_0x10e218[_0x6d63('0x22')];_0x4e2678[_0x6d63('0x34')]=_0xd2153f[_0x6d63('0x22')];_0x4e2678[_0x6d63('0x5f')]=_0x10e218['body'];_0x4e2678['timestamp']=+new Date();var _0x3e5d73='';var _0x1934ac='';var _0x17e49a=Object[_0x6d63('0x60')](_0x4e2678);_0x17e49a['sort']();for(var _0x4360fa=0x0;_0x4360fa<_0x17e49a[_0x6d63('0x61')];_0x4360fa++){if(_0x3e5d73!=''){_0x3e5d73+='&';}_0x3e5d73+=_0x17e49a[_0x4360fa]+'='+encodeURIComponent(_0x4e2678[_0x17e49a[_0x4360fa]]);_0x1934ac+=_0x4e2678[_0x17e49a[_0x4360fa]];}_0x1934ac+=_0xd2153f[_0x6d63('0x5d')];_0x1934ac=_0x13af98['createHash']('md5')[_0x6d63('0x18')](_0x1934ac)[_0x6d63('0x62')](_0x6d63('0x63'));if(_0x3e5d73!==''){_0x3e5d73+='&';}_0x3e5d73+='signature='+_0x1934ac;var _0x4e6dd4={'method':_0x6d63('0x36'),'uri':_0xd2153f[_0x6d63('0x54')]+_0x6d63('0x64')+_0x3e5d73,'json':!![]};return rp(_0x4e6dd4)[_0x6d63('0x17')](function(_0x5c8626){var _0x11c90d=Object['keys'](_0x5c8626);if(_0x5c8626[_0x11c90d[0x0]]['error']&&parseInt(_0x5c8626[_0x11c90d[0x0]][_0x6d63('0x2a')])===0x0){var _0x13a103={'messageId':_0x5c8626[_0x11c90d[0x0]][_0x6d63('0x65')]};if(!_0xd2153f[_0x6d63('0x3d')]){_0x13a103['read']=!![];}return _0x355d26[_0x6d63('0x18')](_0x13a103);}else{return logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x5b'),util['inspect'](_0x5c8626[_0x6d63('0x2a')],{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x2f00d0){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x5b'),util[_0x6d63('0x2d')](_0x2f00d0,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x5b'),_0x6d63('0x66'));}break;case _0x6d63('0x67'):if(_0xd2153f[_0x6d63('0x5d')]){var _0x9b4e3a={'method':_0x6d63('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xd2153f['apiKey']},'body':{'content':_0x10e218['body'],'to':[_0x10e218[_0x6d63('0x22')]],'from':_0xd2153f[_0x6d63('0x22')],'binary':![],'clientMessageId':'uuid','charset':_0x6d63('0x68')},'json':!![]};rp(_0x9b4e3a)['then'](function(_0x169d2a){if(!_0x169d2a[_0x6d63('0x2a')]){var _0x32cc0c={'messageId':_0x169d2a[_0x6d63('0x23')][0x0][_0x6d63('0x69')]};if(!_0xd2153f[_0x6d63('0x3d')]){_0x32cc0c[_0x6d63('0x3e')]=!![];}return _0x355d26[_0x6d63('0x18')](_0x32cc0c);}else{return logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x67'),util[_0x6d63('0x2d')](_0x169d2a[_0x6d63('0x2a')],{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x397958){return logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x67'),util[_0x6d63('0x2d')](_0x397958,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),'afterCreate',_0x6d63('0x67'),_0x6d63('0x66'));}break;case _0x6d63('0x6a'):if(_0xd2153f[_0x6d63('0x31')]&&_0xd2153f[_0x6d63('0x32')]){var _0xa1c3e7=util[_0x6d63('0x46')]('%s:%s',_0xd2153f[_0x6d63('0x31')],_0xd2153f['password']);var _0x5e3a61={'method':_0x6d63('0x38'),'uri':_0x6d63('0x6b')+_0xd2153f['accountId']+_0x6d63('0x6c'),'body':{'to':[_0x10e218[_0x6d63('0x22')]],'text':_0x10e218[_0x6d63('0xd')],'from':_0xd2153f[_0x6d63('0x22')],'applicationId':_0xd2153f[_0x6d63('0x6d')]},'headers':{'Authorization':util[_0x6d63('0x46')]('Basic\x20%s',new Buffer(_0xa1c3e7)[_0x6d63('0x49')](_0x6d63('0x4a')))},'json':!![]};rp(_0x5e3a61)[_0x6d63('0x17')](function(_0x32ce22){if(_0x32ce22['id']){var _0x17859a={'messageId':_0x32ce22['id']};return _0x355d26['update'](_0x17859a);}else{logger['error'](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x6a'),util[_0x6d63('0x2d')](_0x32ce22,{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x2f227d){logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),'bandwidth',util[_0x6d63('0x2d')](_0x2f227d,{'showHidden':![],'depth':null}));});}else{logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x6a'),_0x6d63('0x3f'));}break;case'intelepeer':if(_0xd2153f[_0x6d63('0x5d')]){var _0x1185c0={};var _0x4e6dd4={'method':'POST','uri':_0x6d63('0x6e'),'headers':{'Authorization':_0x6d63('0x6f')+_0xd2153f[_0x6d63('0x5d')],'Content-Type':_0x6d63('0x57')},'body':{'from':_0xd2153f[_0x6d63('0x22')],'to':_0x10e218[_0x6d63('0x22')],'text':_0x10e218[_0x6d63('0xd')]},'json':!![]};return rp(_0x4e6dd4)['then'](function(_0x9c0889){if(_0x9c0889['code']==0xca){_0x1185c0[_0x6d63('0x70')]=_0x9c0889;var _0xcc58bf={'method':_0x6d63('0x38'),'uri':_0x6d63('0x71'),'headers':{'Authorization':_0x6d63('0x6f')+_0xd2153f[_0x6d63('0x5d')],'Content-Type':_0x6d63('0x57')},'body':{'refid':_0x1185c0[_0x6d63('0x70')]['refid']},'json':!![]};return rp(_0xcc58bf)[_0x6d63('0x17')](function(_0x3147fc){_0x1185c0[_0x6d63('0x72')]=_0x3147fc;var _0x15a20b={'messageId':_0x1185c0[_0x6d63('0x70')][_0x6d63('0x73')],'read':!![]};return _0x355d26[_0x6d63('0x18')](_0x15a20b);});}else{return logger[_0x6d63('0x2a')](_0x6d63('0x2b'),_0x6d63('0x2c'),_0x6d63('0x74'),util[_0x6d63('0x2d')](_0x9c0889,{'showHidden':![],'depth':null}));}})[_0x6d63('0x1a')](function(_0x4f91c5){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x74'),util[_0x6d63('0x2d')](_0x4f91c5,{'showHidden':![],'depth':null}));});}else{return logger[_0x6d63('0x2a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6d63('0x2c'),_0x6d63('0x74'),_0x6d63('0x75'));}break;}}})['finally'](function(){_0x1dadb5();});}else{_0x1dadb5();}}},'charset':_0x6d63('0x76'),'collate':_0x6d63('0x77')});};
\ No newline at end of file
index 949d20b..3e52a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8303=['socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','CreateSmsMessage','debug','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x241ee4,_0x31b04a){var _0x2cb581=function(_0x127d16){while(--_0x127d16){_0x241ee4['push'](_0x241ee4['shift']());}};_0x2cb581(++_0x31b04a);}(_0x8303,0xac));var _0x3830=function(_0x5bb349,_0x41b1fc){_0x5bb349=_0x5bb349-0x0;var _0x272870=_0x8303[_0x5bb349];return _0x272870;};'use strict';var _=require('lodash');var util=require(_0x3830('0x0'));var moment=require(_0x3830('0x1'));var BPromise=require(_0x3830('0x2'));var rs=require(_0x3830('0x3'));var fs=require('fs');var Redis=require(_0x3830('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3830('0x5'));var logger=require(_0x3830('0x6'))(_0x3830('0x7'));var config=require(_0x3830('0x8'));var jayson=require(_0x3830('0x9'));var client=jayson['client'][_0x3830('0xa')]({'port':0x232a});config[_0x3830('0xb')]=_[_0x3830('0xc')](config['redis'],{'host':_0x3830('0xd'),'port':0x18eb});var socket=require(_0x3830('0xe'))(new Redis(config[_0x3830('0xb')]));require(_0x3830('0xf'))[_0x3830('0x10')](socket);function respondWithRpcPromise(_0x4d7065,_0x3057e8,_0x340013){return new BPromise(function(_0x14a801,_0x13e02b){return client[_0x3830('0x11')](_0x4d7065,_0x340013)[_0x3830('0x12')](function(_0x3037e5){logger[_0x3830('0x13')](_0x3830('0x14'),_0x3057e8,_0x3830('0x15'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3057e8,'request\x20sent',JSON[_0x3830('0x16')](_0x3037e5));if(_0x3037e5[_0x3830('0x17')]){if(_0x3037e5['error'][_0x3830('0x18')]===0x1f4){logger[_0x3830('0x17')](_0x3830('0x14'),_0x3057e8,_0x3037e5['error'][_0x3830('0x19')]);return _0x13e02b(_0x3037e5[_0x3830('0x17')]['message']);}logger[_0x3830('0x17')](_0x3830('0x14'),_0x3057e8,_0x3037e5[_0x3830('0x17')][_0x3830('0x19')]);return _0x14a801(_0x3037e5[_0x3830('0x17')][_0x3830('0x19')]);}else{logger[_0x3830('0x13')](_0x3830('0x14'),_0x3057e8,_0x3830('0x15'));_0x14a801(_0x3037e5[_0x3830('0x1a')][_0x3830('0x19')]);}})[_0x3830('0x1b')](function(_0x2f8ae3){logger[_0x3830('0x17')](_0x3830('0x14'),_0x3057e8,_0x2f8ae3);_0x13e02b(_0x2f8ae3);});});}exports['CreateSmsMessage']=function(_0x276c89){var _0x1f6c9c=this;return new Promise(function(_0x25ee51,_0x496f2a){return db['SmsMessage']['create'](_0x276c89['body'],{'raw':_0x276c89[_0x3830('0x1c')]?_0x276c89[_0x3830('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x3830('0x12')](function(_0x1e593e){logger['info'](_0x3830('0x1d'),_0x276c89);logger[_0x3830('0x1e')](_0x3830('0x1d'),_0x276c89,JSON[_0x3830('0x16')](_0x1e593e));_0x25ee51(_0x1e593e);})['catch'](function(_0x589a1d){logger[_0x3830('0x17')](_0x3830('0x1d'),_0x589a1d[_0x3830('0x19')],_0x276c89);_0x496f2a(_0x1f6c9c['error'](0x1f4,_0x589a1d[_0x3830('0x19')]));});});};
\ No newline at end of file
+var _0x4e96=['SmsMessage,\x20%s,\x20%s','message','result','SmsMessage','create','options','raw','CreateSmsMessage','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x58659c,_0xe56aec){var _0x1e0ec9=function(_0x143341){while(--_0x143341){_0x58659c['push'](_0x58659c['shift']());}};_0x1e0ec9(++_0xe56aec);}(_0x4e96,0x1d7));var _0x64e9=function(_0x431cd4,_0x172bcb){_0x431cd4=_0x431cd4-0x0;var _0x8a4e64=_0x4e96[_0x431cd4];return _0x8a4e64;};'use strict';var _=require(_0x64e9('0x0'));var util=require(_0x64e9('0x1'));var moment=require(_0x64e9('0x2'));var BPromise=require(_0x64e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64e9('0x4'));var db=require(_0x64e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64e9('0x6'))(_0x64e9('0x7'));var config=require(_0x64e9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x64e9('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x64e9('0xa')],{'host':_0x64e9('0xb'),'port':0x18eb});var socket=require(_0x64e9('0xc'))(new Redis(config[_0x64e9('0xa')]));require(_0x64e9('0xd'))[_0x64e9('0xe')](socket);function respondWithRpcPromise(_0x219603,_0x4cb4e0,_0x9ee702){return new BPromise(function(_0x23d152,_0x4ce211){return client[_0x64e9('0xf')](_0x219603,_0x9ee702)[_0x64e9('0x10')](function(_0x2dd4d6){logger[_0x64e9('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4cb4e0,_0x64e9('0x12'));logger[_0x64e9('0x13')](_0x64e9('0x14'),_0x4cb4e0,_0x64e9('0x12'),JSON[_0x64e9('0x15')](_0x2dd4d6));if(_0x2dd4d6['error']){if(_0x2dd4d6[_0x64e9('0x16')][_0x64e9('0x17')]===0x1f4){logger[_0x64e9('0x16')](_0x64e9('0x18'),_0x4cb4e0,_0x2dd4d6[_0x64e9('0x16')]['message']);return _0x4ce211(_0x2dd4d6[_0x64e9('0x16')][_0x64e9('0x19')]);}logger['error'](_0x64e9('0x18'),_0x4cb4e0,_0x2dd4d6[_0x64e9('0x16')][_0x64e9('0x19')]);return _0x23d152(_0x2dd4d6[_0x64e9('0x16')][_0x64e9('0x19')]);}else{logger[_0x64e9('0x11')]('SmsMessage,\x20%s,\x20%s',_0x4cb4e0,'request\x20sent');_0x23d152(_0x2dd4d6[_0x64e9('0x1a')][_0x64e9('0x19')]);}})['catch'](function(_0x172959){logger[_0x64e9('0x16')](_0x64e9('0x18'),_0x4cb4e0,_0x172959);_0x4ce211(_0x172959);});});}exports['CreateSmsMessage']=function(_0x520e91){var _0x2409ef=this;return new Promise(function(_0x4d13d7,_0x22418b){return db[_0x64e9('0x1b')][_0x64e9('0x1c')](_0x520e91['body'],{'raw':_0x520e91[_0x64e9('0x1d')]?_0x520e91[_0x64e9('0x1d')][_0x64e9('0x1e')]===undefined?!![]:![]:!![]})[_0x64e9('0x10')](function(_0x1cf923){logger['info']('CreateSmsMessage',_0x520e91);logger[_0x64e9('0x13')](_0x64e9('0x1f'),_0x520e91,JSON[_0x64e9('0x15')](_0x1cf923));_0x4d13d7(_0x1cf923);})[_0x64e9('0x20')](function(_0x220478){logger[_0x64e9('0x16')](_0x64e9('0x1f'),_0x220478[_0x64e9('0x19')],_0x520e91);_0x22418b(_0x2409ef[_0x64e9('0x16')](0x1f4,_0x220478[_0x64e9('0x19')]));});});};
\ No newline at end of file
index 8972a15..c82562b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae48=['remove','update','emit','register','smsMessage:','./smsMessage.events','save'];(function(_0x169fbb,_0x399b7f){var _0x4e0bff=function(_0x492752){while(--_0x492752){_0x169fbb['push'](_0x169fbb['shift']());}};_0x4e0bff(++_0x399b7f);}(_0xae48,0x140));var _0x8ae4=function(_0x13e724,_0x296739){_0x13e724=_0x13e724-0x0;var _0x334a44=_0xae48[_0x13e724];return _0x334a44;};'use strict';var SmsMessageEvents=require(_0x8ae4('0x0'));var events=[_0x8ae4('0x1'),_0x8ae4('0x2'),_0x8ae4('0x3')];function createListener(_0x20a6ca,_0x416fd2){return function(_0x5721f3){_0x416fd2[_0x8ae4('0x4')](_0x20a6ca,_0x5721f3);};}function removeListener(_0x44ed28,_0x52c164){return function(){SmsMessageEvents['removeListener'](_0x44ed28,_0x52c164);};}exports[_0x8ae4('0x5')]=function(_0x42a965){for(var _0x68e3c7=0x0,_0x27db08=events['length'];_0x68e3c7<_0x27db08;_0x68e3c7++){var _0x4255c7=events[_0x68e3c7];var _0x47b65e=createListener(_0x8ae4('0x6')+_0x4255c7,_0x42a965);SmsMessageEvents['on'](_0x4255c7,_0x47b65e);}};
\ No newline at end of file
+var _0xc58d=['removeListener','length','smsMessage:','./smsMessage.events','save','remove','update','emit'];(function(_0x3a1ef3,_0x8777f7){var _0x3ad144=function(_0x2efe49){while(--_0x2efe49){_0x3a1ef3['push'](_0x3a1ef3['shift']());}};_0x3ad144(++_0x8777f7);}(_0xc58d,0x15b));var _0xdc58=function(_0x31981f,_0x544cb7){_0x31981f=_0x31981f-0x0;var _0x52ac37=_0xc58d[_0x31981f];return _0x52ac37;};'use strict';var SmsMessageEvents=require(_0xdc58('0x0'));var events=[_0xdc58('0x1'),_0xdc58('0x2'),_0xdc58('0x3')];function createListener(_0x46dfeb,_0x9d9420){return function(_0x2b5231){_0x9d9420[_0xdc58('0x4')](_0x46dfeb,_0x2b5231);};}function removeListener(_0xe7020e,_0x233359){return function(){SmsMessageEvents[_0xdc58('0x5')](_0xe7020e,_0x233359);};}exports['register']=function(_0x2f448b){for(var _0x445569=0x0,_0x13b9ee=events[_0xdc58('0x6')];_0x445569<_0x13b9ee;_0x445569++){var _0x120bf1=events[_0x445569];var _0x5c6d2c=createListener(_0xdc58('0x7')+_0x120bf1,_0x2f448b);SmsMessageEvents['on'](_0x120bf1,_0x5c6d2c);}};
\ No newline at end of file
index 39d0258..c122de7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9419=['fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','removeTeams','delete','removeAgents','exports','multer','util','connect-timeout','express','Router'];(function(_0x50a1b2,_0x40a45d){var _0x3bd507=function(_0x111adf){while(--_0x111adf){_0x50a1b2['push'](_0x50a1b2['shift']());}};_0x3bd507(++_0x40a45d);}(_0x9419,0x157));var _0x9941=function(_0x4e9a52,_0x25b20d){_0x4e9a52=_0x4e9a52-0x0;var _0x2d425f=_0x9419[_0x4e9a52];return _0x2d425f;};'use strict';var multer=require(_0x9941('0x0'));var util=require(_0x9941('0x1'));var path=require('path');var timeout=require(_0x9941('0x2'));var express=require(_0x9941('0x3'));var router=express[_0x9941('0x4')]();var fs_extra=require(_0x9941('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9941('0x6'));var config=require(_0x9941('0x7'));var controller=require('./smsQueue.controller');router[_0x9941('0x8')]('/',auth[_0x9941('0x9')](),controller[_0x9941('0xa')]);router[_0x9941('0x8')](_0x9941('0xb'),auth[_0x9941('0x9')](),controller[_0x9941('0xc')]);router[_0x9941('0x8')](_0x9941('0xd'),auth[_0x9941('0x9')](),controller[_0x9941('0xe')]);router[_0x9941('0x8')]('/:id/members',auth[_0x9941('0x9')](),controller[_0x9941('0xf')]);router[_0x9941('0x8')](_0x9941('0x10'),auth[_0x9941('0x9')](),controller[_0x9941('0x11')]);router[_0x9941('0x8')](_0x9941('0x12'),auth[_0x9941('0x9')](),controller[_0x9941('0x13')]);router[_0x9941('0x14')]('/',auth[_0x9941('0x9')](),controller[_0x9941('0x15')]);router[_0x9941('0x14')]('/:id/teams',auth[_0x9941('0x9')](),controller[_0x9941('0x16')]);router[_0x9941('0x14')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x9941('0x17')]('/:id',auth['isAuthenticated'](),controller[_0x9941('0x18')]);router['delete']('/:id',auth[_0x9941('0x9')](),controller['destroy']);router['delete']('/:id/teams',auth[_0x9941('0x9')](),controller[_0x9941('0x19')]);router[_0x9941('0x1a')](_0x9941('0x12'),auth[_0x9941('0x9')](),controller[_0x9941('0x1b')]);module[_0x9941('0x1c')]=router;
\ No newline at end of file
+var _0x8483=['create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','./smsQueue.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8483,0x1c9));var _0x3848=function(_0x4030f7,_0x2c4631){_0x4030f7=_0x4030f7-0x0;var _0x17e14c=_0x8483[_0x4030f7];return _0x17e14c;};'use strict';var multer=require(_0x3848('0x0'));var util=require(_0x3848('0x1'));var path=require(_0x3848('0x2'));var timeout=require(_0x3848('0x3'));var express=require(_0x3848('0x4'));var router=express[_0x3848('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3848('0x6'));router['get']('/',auth[_0x3848('0x7')](),controller['index']);router[_0x3848('0x8')](_0x3848('0x9'),auth[_0x3848('0x7')](),controller[_0x3848('0xa')]);router[_0x3848('0x8')](_0x3848('0xb'),auth[_0x3848('0x7')](),controller[_0x3848('0xc')]);router[_0x3848('0x8')](_0x3848('0xd'),auth[_0x3848('0x7')](),controller['getMembers']);router[_0x3848('0x8')](_0x3848('0xe'),auth[_0x3848('0x7')](),controller[_0x3848('0xf')]);router[_0x3848('0x8')](_0x3848('0x10'),auth[_0x3848('0x7')](),controller[_0x3848('0x11')]);router[_0x3848('0x12')]('/',auth[_0x3848('0x7')](),controller[_0x3848('0x13')]);router[_0x3848('0x12')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3848('0x14')]);router[_0x3848('0x12')](_0x3848('0x10'),auth[_0x3848('0x7')](),controller[_0x3848('0x15')]);router[_0x3848('0x16')]('/:id',auth[_0x3848('0x7')](),controller['update']);router['delete']('/:id',auth[_0x3848('0x7')](),controller[_0x3848('0x17')]);router[_0x3848('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3848('0x19')]);router[_0x3848('0x18')]('/:id/users',auth[_0x3848('0x7')](),controller[_0x3848('0x1a')]);module[_0x3848('0x1b')]=router;
\ No newline at end of file
index 446865b..1fe5686 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb439=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3acd57,_0x215783){var _0x4599c6=function(_0x4ad8ca){while(--_0x4ad8ca){_0x3acd57['push'](_0x3acd57['shift']());}};_0x4599c6(++_0x215783);}(_0xb439,0x139));var _0x9b43=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xb439[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x9b43('0x0'));module[_0x9b43('0x1')]={'name':{'type':Sequelize[_0x9b43('0x2')],'unique':_0x9b43('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9b43('0x2')]},'timeout':{'type':Sequelize[_0x9b43('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9b43('0x5')](_0x9b43('0x6'),_0x9b43('0x7'),_0x9b43('0x8'))}};
\ No newline at end of file
+var _0x44f1=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x693e69,_0x4ac0bd){var _0xedaaee=function(_0x39b94d){while(--_0x39b94d){_0x693e69['push'](_0x693e69['shift']());}};_0xedaaee(++_0x4ac0bd);}(_0x44f1,0x89));var _0x144f=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x44f1[_0x2b5eae];return _0x5f3ac9;};'use strict';var Sequelize=require(_0x144f('0x0'));module[_0x144f('0x1')]={'name':{'type':Sequelize[_0x144f('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x144f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x144f('0x4')](_0x144f('0x5'),_0x144f('0x6'),_0x144f('0x7'))}};
\ No newline at end of file
index e26d7b4..f274365 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a6d=['intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','params','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','UserProfileResource','update','body','describe','getMembers','UserSmsQueue','order','pick','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','findOrCreate','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','json','offset','limit','count','Content-Range','apply','reject','save','then','destroy','get','sendStatus','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0x38fc07,_0x199ce3){var _0x51dfd7=function(_0x5eec30){while(--_0x5eec30){_0x38fc07['push'](_0x38fc07['shift']());}};_0x51dfd7(++_0x199ce3);}(_0x9a6d,0x171));var _0xd9a6=function(_0x4e6060,_0x4d1ff9){_0x4e6060=_0x4e6060-0x0;var _0xa4a56=_0x9a6d[_0x4e6060];return _0xa4a56;};'use strict';var emlformat=require(_0xd9a6('0x0'));var rimraf=require(_0xd9a6('0x1'));var zipdir=require(_0xd9a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9a6('0x3'));var moment=require(_0xd9a6('0x4'));var BPromise=require(_0xd9a6('0x5'));var Mustache=require(_0xd9a6('0x6'));var util=require(_0xd9a6('0x7'));var path=require('path');var sox=require(_0xd9a6('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd9a6('0x9'));var squel=require('squel');var crypto=require(_0xd9a6('0xa'));var jsforce=require(_0xd9a6('0xb'));var deskjs=require(_0xd9a6('0xc'));var toCsv=require(_0xd9a6('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd9a6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd9a6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd9a6('0x10'));var logger=require(_0xd9a6('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd9a6('0x12'));var licenseUtil=require(_0xd9a6('0x13'));var db=require(_0xd9a6('0x14'))['db'];config[_0xd9a6('0x15')]=_['defaults'](config[_0xd9a6('0x15')],{'host':_0xd9a6('0x16'),'port':0x18eb});var socket=require(_0xd9a6('0x17'))(new Redis(config[_0xd9a6('0x15')]));require(_0xd9a6('0x18'))[_0xd9a6('0x19')](socket);function respondWithStatusCode(_0x4ff596,_0x3a656d){_0x3a656d=_0x3a656d||0xcc;return function(_0x39b997){if(_0x39b997){return _0x4ff596['sendStatus'](_0x3a656d);}return _0x4ff596[_0xd9a6('0x1a')](_0x3a656d)[_0xd9a6('0x1b')]();};}function respondWithResult(_0x1d7c45,_0x37b415){_0x37b415=_0x37b415||0xc8;return function(_0x54d8cf){if(_0x54d8cf){return _0x1d7c45[_0xd9a6('0x1a')](_0x37b415)[_0xd9a6('0x1c')](_0x54d8cf);}};}function respondWithFilteredResult(_0x1bff45,_0x669819){return function(_0x2cdecc){if(_0x2cdecc){var _0x5326a1=typeof _0x669819[_0xd9a6('0x1d')]==='undefined'&&typeof _0x669819[_0xd9a6('0x1e')]==='undefined';var _0x36e902=_0x2cdecc[_0xd9a6('0x1f')];var _0x1cdd47=_0x5326a1?0x0:_0x669819[_0xd9a6('0x1d')];var _0x1923a7=_0x5326a1?_0x2cdecc['count']:_0x669819[_0xd9a6('0x1d')]+_0x669819[_0xd9a6('0x1e')];var _0x52b51c;if(_0x1923a7>=_0x36e902){_0x1923a7=_0x36e902;_0x52b51c=0xc8;}else{_0x52b51c=0xce;}_0x1bff45['status'](_0x52b51c);return _0x1bff45['set'](_0xd9a6('0x20'),_0x1cdd47+'-'+_0x1923a7+'/'+_0x36e902)[_0xd9a6('0x1c')](_0x2cdecc);}return null;};}function patchUpdates(_0x57a952){return function(_0x554734){try{jsonpatch[_0xd9a6('0x21')](_0x554734,_0x57a952,!![]);}catch(_0x4b3219){return BPromise[_0xd9a6('0x22')](_0x4b3219);}return _0x554734[_0xd9a6('0x23')]();};}function saveUpdates(_0x15b733,_0x2ea11b){return function(_0x105502){if(_0x105502){return _0x105502['update'](_0x15b733)[_0xd9a6('0x24')](function(_0x579c1e){return _0x579c1e;});}return null;};}function removeEntity(_0x3cb3f6,_0x38250f){return function(_0x2107a5){if(_0x2107a5){return _0x2107a5[_0xd9a6('0x25')]()[_0xd9a6('0x24')](function(){var _0x27d448=_0x2107a5[_0xd9a6('0x26')]({'plain':!![]});var _0x25e983='SmsQueues';return db['UserProfileResource'][_0xd9a6('0x25')]({'where':{'type':_0x25e983,'resourceId':_0x27d448['id']}})[_0xd9a6('0x24')](function(){return _0x2107a5;});})[_0xd9a6('0x24')](function(){_0x3cb3f6[_0xd9a6('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c94b5,_0x336dd0){return function(_0x5e3fad){if(!_0x5e3fad){_0x1c94b5[_0xd9a6('0x27')](0x194);}return _0x5e3fad;};}function handleError(_0xa89ba5,_0x348ab6){_0x348ab6=_0x348ab6||0x1f4;return function(_0x28ca36){logger[_0xd9a6('0x28')](_0x28ca36[_0xd9a6('0x29')]);if(_0x28ca36[_0xd9a6('0x2a')]){delete _0x28ca36['name'];}_0xa89ba5['status'](_0x348ab6)[_0xd9a6('0x2b')](_0x28ca36);};}exports[_0xd9a6('0x2c')]=function(_0x31b408,_0x16b54d){var _0x4dca36={},_0x5173db={},_0x820f67={'count':0x0,'rows':[]};var _0x29fc65=_[_0xd9a6('0x2d')](db[_0xd9a6('0x2e')][_0xd9a6('0x2f')],function(_0x30da24){return{'name':_0x30da24[_0xd9a6('0x30')],'type':_0x30da24[_0xd9a6('0x31')][_0xd9a6('0x32')]};});_0x5173db['model']=_[_0xd9a6('0x2d')](_0x29fc65,_0xd9a6('0x2a'));_0x5173db[_0xd9a6('0x33')]=_[_0xd9a6('0x34')](_0x31b408['query']);_0x5173db[_0xd9a6('0x35')]=_[_0xd9a6('0x36')](_0x5173db['model'],_0x5173db['query']);_0x4dca36['attributes']=_[_0xd9a6('0x36')](_0x5173db['model'],qs[_0xd9a6('0x37')](_0x31b408[_0xd9a6('0x33')][_0xd9a6('0x37')]));_0x4dca36[_0xd9a6('0x38')]=_0x4dca36[_0xd9a6('0x38')][_0xd9a6('0x39')]?_0x4dca36[_0xd9a6('0x38')]:_0x5173db[_0xd9a6('0x3a')];if(!_0x31b408['query'][_0xd9a6('0x3b')](_0xd9a6('0x3c'))){_0x4dca36[_0xd9a6('0x1e')]=qs[_0xd9a6('0x1e')](_0x31b408[_0xd9a6('0x33')][_0xd9a6('0x1e')]);_0x4dca36['offset']=qs[_0xd9a6('0x1d')](_0x31b408[_0xd9a6('0x33')]['offset']);}_0x4dca36['order']=qs[_0xd9a6('0x3d')](_0x31b408[_0xd9a6('0x33')][_0xd9a6('0x3d')]);_0x4dca36['where']=qs['filters'](_['pick'](_0x31b408[_0xd9a6('0x33')],_0x5173db[_0xd9a6('0x35')]),_0x29fc65);if(_0x31b408[_0xd9a6('0x33')][_0xd9a6('0x3e')]){_0x4dca36[_0xd9a6('0x3f')]=_['merge'](_0x4dca36[_0xd9a6('0x3f')],{'$or':_[_0xd9a6('0x2d')](_0x29fc65,function(_0x44fdc9){if(_0x44fdc9[_0xd9a6('0x31')]!==_0xd9a6('0x40')){var _0x1aa8d3={};_0x1aa8d3[_0x44fdc9['name']]={'$like':'%'+_0x31b408[_0xd9a6('0x33')][_0xd9a6('0x3e')]+'%'};return _0x1aa8d3;}})});}_0x4dca36=_[_0xd9a6('0x41')]({},_0x4dca36,_0x31b408[_0xd9a6('0x42')]);var _0x21ce1f={'where':_0x4dca36[_0xd9a6('0x3f')]};return db[_0xd9a6('0x2e')][_0xd9a6('0x1f')](_0x21ce1f)[_0xd9a6('0x24')](function(_0x3f75b0){_0x820f67[_0xd9a6('0x1f')]=_0x3f75b0;if(_0x31b408['query']['includeAll']){_0x4dca36[_0xd9a6('0x43')]=[{'all':!![]}];}return db[_0xd9a6('0x2e')][_0xd9a6('0x44')](_0x4dca36);})[_0xd9a6('0x24')](function(_0x2d60de){_0x820f67[_0xd9a6('0x45')]=_0x2d60de;return _0x820f67;})[_0xd9a6('0x24')](respondWithFilteredResult(_0x16b54d,_0x4dca36))['catch'](handleError(_0x16b54d,null));};exports[_0xd9a6('0x46')]=function(_0x238fa0,_0x479f34){var _0x3ca2db={'raw':!![],'where':{'id':_0x238fa0[_0xd9a6('0x47')]['id']}},_0x106a77={};_0x106a77[_0xd9a6('0x3a')]=_[_0xd9a6('0x34')](db['SmsQueue'][_0xd9a6('0x2f')]);_0x106a77[_0xd9a6('0x33')]=_[_0xd9a6('0x34')](_0x238fa0['query']);_0x106a77[_0xd9a6('0x35')]=_[_0xd9a6('0x36')](_0x106a77[_0xd9a6('0x3a')],_0x106a77[_0xd9a6('0x33')]);_0x3ca2db[_0xd9a6('0x38')]=_[_0xd9a6('0x36')](_0x106a77[_0xd9a6('0x3a')],qs[_0xd9a6('0x37')](_0x238fa0[_0xd9a6('0x33')][_0xd9a6('0x37')]));_0x3ca2db[_0xd9a6('0x38')]=_0x3ca2db[_0xd9a6('0x38')][_0xd9a6('0x39')]?_0x3ca2db[_0xd9a6('0x38')]:_0x106a77['model'];if(_0x238fa0[_0xd9a6('0x33')]['includeAll']){_0x3ca2db[_0xd9a6('0x43')]=[{'all':!![]}];}_0x3ca2db=_[_0xd9a6('0x41')]({},_0x3ca2db,_0x238fa0[_0xd9a6('0x42')]);return db[_0xd9a6('0x2e')]['find'](_0x3ca2db)['then'](handleEntityNotFound(_0x479f34,null))['then'](respondWithResult(_0x479f34,null))[_0xd9a6('0x48')](handleError(_0x479f34,null));};exports[_0xd9a6('0x49')]=function(_0x102fc4,_0x2589f9){return db[_0xd9a6('0x2e')][_0xd9a6('0x49')](_0x102fc4['body'],{})['then'](function(_0x3e4831){var _0x5c81df=_0x102fc4[_0xd9a6('0x4a')]['get']({'plain':!![]});if(!_0x5c81df)throw new Error(_0xd9a6('0x4b'));if(_0x5c81df['role']==='user'){var _0x763ae6=_0x3e4831[_0xd9a6('0x26')]({'plain':!![]});var _0x1bafff='SmsQueues';return db[_0xd9a6('0x4c')][_0xd9a6('0x4d')]({'where':{'name':_0x1bafff,'userProfileId':_0x5c81df['userProfileId']},'raw':!![]})['then'](function(_0x3fd079){if(_0x3fd079&&_0x3fd079[_0xd9a6('0x4e')]===0x0){return db[_0xd9a6('0x4f')][_0xd9a6('0x49')]({'name':_0x763ae6['name'],'resourceId':_0x763ae6['id'],'type':_0x3fd079[_0xd9a6('0x2a')],'sectionId':_0x3fd079['id']},{})[_0xd9a6('0x24')](function(){return _0x3e4831;});}else{return _0x3e4831;}})[_0xd9a6('0x48')](function(_0x12b8df){logger[_0xd9a6('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12b8df);throw _0x12b8df;});}return _0x3e4831;})[_0xd9a6('0x24')](respondWithResult(_0x2589f9,0xc9))[_0xd9a6('0x48')](handleError(_0x2589f9,null));};exports[_0xd9a6('0x50')]=function(_0x52612e,_0x3b9074){if(_0x52612e[_0xd9a6('0x51')]['id']){delete _0x52612e[_0xd9a6('0x51')]['id'];}return db[_0xd9a6('0x2e')][_0xd9a6('0x4d')]({'where':{'id':_0x52612e[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x3b9074,null))[_0xd9a6('0x24')](saveUpdates(_0x52612e['body'],null))[_0xd9a6('0x24')](respondWithResult(_0x3b9074,null))[_0xd9a6('0x48')](handleError(_0x3b9074,null));};exports['destroy']=function(_0x3bfffb,_0x39c1e5){return db['SmsQueue'][_0xd9a6('0x4d')]({'where':{'id':_0x3bfffb['params']['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x39c1e5,null))['then'](removeEntity(_0x39c1e5,null))[_0xd9a6('0x48')](handleError(_0x39c1e5,null));};exports[_0xd9a6('0x52')]=function(_0x3289d1,_0x208e39){return db['SmsQueue'][_0xd9a6('0x52')]()[_0xd9a6('0x24')](respondWithResult(_0x208e39,null))[_0xd9a6('0x48')](handleError(_0x208e39,null));};exports[_0xd9a6('0x53')]=function(_0x141323,_0x382cd8,_0x341020){var _0x263671={'raw':!![],'where':{}},_0x52ddd6={},_0x35c133;return db['SmsQueue']['findOne']({'where':{'id':_0x141323[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x382cd8,null))[_0xd9a6('0x24')](function(_0x35daae){if(_0x35daae){_0x35c133=_0x35daae[_0xd9a6('0x26')]({'plain':!![]});_0x52ddd6[_0xd9a6('0x3a')]=_[_0xd9a6('0x34')](db[_0xd9a6('0x54')][_0xd9a6('0x2f')]);_0x52ddd6[_0xd9a6('0x33')]=_[_0xd9a6('0x34')](_0x141323[_0xd9a6('0x33')]);_0x52ddd6[_0xd9a6('0x35')]=_[_0xd9a6('0x36')](_0x52ddd6[_0xd9a6('0x3a')],_0x52ddd6['query']);_0x263671[_0xd9a6('0x38')]=_[_0xd9a6('0x36')](_0x52ddd6['model'],qs[_0xd9a6('0x37')](_0x141323[_0xd9a6('0x33')][_0xd9a6('0x37')]));_0x263671[_0xd9a6('0x38')]=_0x263671['attributes'][_0xd9a6('0x39')]?_0x263671['attributes']:_0x52ddd6[_0xd9a6('0x3a')];if(!_0x141323[_0xd9a6('0x33')]['hasOwnProperty'](_0xd9a6('0x3c'))){_0x263671[_0xd9a6('0x1e')]=qs['limit'](_0x141323['query'][_0xd9a6('0x1e')]);_0x263671[_0xd9a6('0x1d')]=qs[_0xd9a6('0x1d')](_0x141323[_0xd9a6('0x33')][_0xd9a6('0x1d')]);}_0x263671[_0xd9a6('0x55')]=qs[_0xd9a6('0x3d')](_0x141323[_0xd9a6('0x33')]['sort']);_0x263671[_0xd9a6('0x3f')]=qs[_0xd9a6('0x35')](_[_0xd9a6('0x56')](_0x141323[_0xd9a6('0x33')],_0x52ddd6[_0xd9a6('0x35')]));_0x263671['where'][_0xd9a6('0x57')]=_0x35daae['id'];if(_0x141323[_0xd9a6('0x33')][_0xd9a6('0x3e')]){_0x263671[_0xd9a6('0x3f')]=_[_0xd9a6('0x41')](_0x263671[_0xd9a6('0x3f')],{'$or':_[_0xd9a6('0x2d')](_0x263671[_0xd9a6('0x38')],function(_0x2d33eb){var _0x2c7738={};_0x2c7738[_0x2d33eb]={'$like':'%'+_0x141323[_0xd9a6('0x33')][_0xd9a6('0x3e')]+'%'};return _0x2c7738;})});}_0x263671=_[_0xd9a6('0x41')]({},_0x263671,_0x141323['options']);return db['UserSmsQueue'][_0xd9a6('0x44')](_0x263671);}})[_0xd9a6('0x24')](function(_0x5bab22){if(_0x5bab22){return db[_0xd9a6('0x58')][_0xd9a6('0x59')]({'where':{'id':_[_0xd9a6('0x2d')](_0x5bab22,_0xd9a6('0x5a')),'role':_0xd9a6('0x5b')},'attributes':['id',_0xd9a6('0x2a'),_0xd9a6('0x5c'),_0xd9a6('0x5d'),_0xd9a6('0x5e')]});}})[_0xd9a6('0x24')](function(_0x480389){if(_0x480389){return{'count':_0x480389[_0xd9a6('0x1f')],'rows':_[_0xd9a6('0x2d')](_0x480389[_0xd9a6('0x45')],function(_0x1dccaf){return{'membername':_0x1dccaf[_0xd9a6('0x2a')],'UserId':_0x1dccaf['id'],'queue_name':_0x35c133[_0xd9a6('0x2a')],'SmsQueueId':_0x35c133['id'],'interface':util[_0xd9a6('0x5f')](_0xd9a6('0x60'),_0xd9a6('0x61'),_0x1dccaf[_0xd9a6('0x2a')]),'penalty':0x0,'paused':_0x1dccaf['smsPause'],'createdAt':_0x1dccaf[_0xd9a6('0x5e')],'updatedAt':_0x1dccaf[_0xd9a6('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xd9a6('0x24')](respondWithFilteredResult(_0x382cd8,_0x263671))[_0xd9a6('0x48')](handleError(_0x382cd8,null));};exports[_0xd9a6('0x62')]=function(_0xa0f1d7,_0x4262de,_0x106c8e){var _0xeaf20c={};var _0x5c4125={};var _0x3a7438;var _0xfd3fee;return db['SmsQueue'][_0xd9a6('0x63')]({'where':{'id':_0xa0f1d7['params']['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x4262de,null))['then'](function(_0x5b87cd){if(_0x5b87cd){_0x3a7438=_0x5b87cd;_0x5c4125[_0xd9a6('0x3a')]=_[_0xd9a6('0x34')](db[_0xd9a6('0x64')]['rawAttributes']);_0x5c4125['query']=_[_0xd9a6('0x34')](_0xa0f1d7[_0xd9a6('0x33')]);_0x5c4125[_0xd9a6('0x35')]=_[_0xd9a6('0x36')](_0x5c4125[_0xd9a6('0x3a')],_0x5c4125[_0xd9a6('0x33')]);_0xeaf20c[_0xd9a6('0x38')]=_[_0xd9a6('0x36')](_0x5c4125[_0xd9a6('0x3a')],qs[_0xd9a6('0x37')](_0xa0f1d7['query']['fields']));_0xeaf20c[_0xd9a6('0x38')]=_0xeaf20c[_0xd9a6('0x38')]['length']?_0xeaf20c[_0xd9a6('0x38')]:_0x5c4125[_0xd9a6('0x3a')];_0xeaf20c[_0xd9a6('0x55')]=qs['sort'](_0xa0f1d7[_0xd9a6('0x33')][_0xd9a6('0x3d')]);_0xeaf20c['where']=qs[_0xd9a6('0x35')](_[_0xd9a6('0x56')](_0xa0f1d7[_0xd9a6('0x33')],_0x5c4125[_0xd9a6('0x35')]));if(_0xa0f1d7[_0xd9a6('0x33')]['filter']){_0xeaf20c['where']=_[_0xd9a6('0x41')](_0xeaf20c[_0xd9a6('0x3f')],{'$or':_[_0xd9a6('0x2d')](_0xeaf20c[_0xd9a6('0x38')],function(_0x98b3eb){var _0x339a0e={};_0x339a0e[_0x98b3eb]={'$like':'%'+_0xa0f1d7[_0xd9a6('0x33')]['filter']+'%'};return _0x339a0e;})});}_0xeaf20c=_[_0xd9a6('0x41')]({},_0xeaf20c,_0xa0f1d7[_0xd9a6('0x42')]);return _0x3a7438['getTeams'](_0xeaf20c);}})[_0xd9a6('0x24')](function(_0x47ede6){if(_0x47ede6){_0xfd3fee=_0x47ede6[_0xd9a6('0x39')];if(!_0xa0f1d7['query']['hasOwnProperty'](_0xd9a6('0x3c'))){_0xeaf20c[_0xd9a6('0x1e')]=qs[_0xd9a6('0x1e')](_0xa0f1d7['query']['limit']);_0xeaf20c[_0xd9a6('0x1d')]=qs[_0xd9a6('0x1d')](_0xa0f1d7['query'][_0xd9a6('0x1d')]);}return _0x3a7438[_0xd9a6('0x62')](_0xeaf20c);}})[_0xd9a6('0x24')](function(_0x11d378){if(_0x11d378){return _0x11d378?{'count':_0xfd3fee,'rows':_0x11d378}:null;}})['then'](respondWithResult(_0x4262de,null))[_0xd9a6('0x48')](handleError(_0x4262de,null));};exports[_0xd9a6('0x65')]=function(_0x45fdee,_0x481c1f,_0x583b26){var _0x4dbfce=_0x45fdee[_0xd9a6('0x51')][_0xd9a6('0x66')];return db['Team'][_0xd9a6('0x44')]({'where':{'id':_0x4dbfce},'attributes':['id'],'include':[{'model':db[_0xd9a6('0x58')],'as':'Agents','attributes':['id',_0xd9a6('0x2a'),_0xd9a6('0x67'),_0xd9a6('0x68'),_0xd9a6('0x69')],'raw':!![]}]})[_0xd9a6('0x24')](function(_0x534027){if(_0x534027){var _0x5dce7d=_[_0xd9a6('0x6a')](_0x534027,function(_0x2af53d){var _0x1e3f45=_0x2af53d[_0xd9a6('0x26')]({'plain':!![]});return _0x1e3f45[_0xd9a6('0x6b')];});return db[_0xd9a6('0x2e')]['find']({'where':{'id':_0x45fdee[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](function(_0x5b8b60){return db[_0xd9a6('0x6c')]['transaction'](function(_0x344a58){return _0x5b8b60[_0xd9a6('0x65')](_0x4dbfce,{'transaction':_0x344a58})[_0xd9a6('0x24')](function(){return BPromise[_0xd9a6('0x6d')](_0x5dce7d,function(_0x52778b){return db[_0xd9a6('0x54')][_0xd9a6('0x6e')]({'where':{'UserId':_0x52778b['id'],'SmsQueueId':_0x45fdee[_0xd9a6('0x47')]['id']},'transaction':_0x344a58});});})[_0xd9a6('0x24')](function(){_0x5dce7d['forEach'](function(_0x47f353){socket[_0xd9a6('0x6f')](_0xd9a6('0x70'),{'UserId':_0x47f353['id'],'SmsQueueId':_0x5b8b60['id']});});});});});}})[_0xd9a6('0x24')](respondWithStatusCode(_0x481c1f,null))[_0xd9a6('0x48')](handleError(_0x481c1f,null));};exports[_0xd9a6('0x71')]=function(_0x5b8e46,_0x6492c6,_0x2c3bcc){return db[_0xd9a6('0x64')]['findAll']({'where':{'id':_0x5b8e46[_0xd9a6('0x33')][_0xd9a6('0x66')]},'attributes':['id'],'include':[{'model':db[_0xd9a6('0x58')],'as':_0xd9a6('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6492c6,null))[_0xd9a6('0x24')](function(_0x535103){var _0x4cbf47=_[_0xd9a6('0x2d')](_0x535103,'id');var _0xbd2262=[];var _0x5864a1=[];var _0x3c8a14=squel[_0xd9a6('0x72')]();_0x3c8a14['field'](_0xd9a6('0x73'))[_0xd9a6('0x74')](_0xd9a6('0x75'),'tq')[_0xd9a6('0x76')](_0xd9a6('0x77'),'ut',_0xd9a6('0x78'))[_0xd9a6('0x3f')](_0xd9a6('0x79'),_0x5b8e46['params']['id']);for(var _0x5e9338=0x0;_0x5e9338<_0x535103[_0xd9a6('0x39')];_0x5e9338+=0x1){let _0x2c33d5=_0x535103[_0x5e9338];for(var _0x198e71=0x0;_0x198e71<_0x2c33d5[_0xd9a6('0x6b')]['length'];_0x198e71+=0x1){let _0x32784d=_0x2c33d5[_0xd9a6('0x6b')][_0x198e71];var _0x1a6f05=_0x3c8a14[_0xd9a6('0x7a')]();_0x1a6f05[_0xd9a6('0x3f')](_0xd9a6('0x7b'),_0x32784d['id']);_0x5864a1[_0xd9a6('0x7c')](db['sequelize'][_0xd9a6('0x33')](_0x1a6f05[_0xd9a6('0x7d')](),{'type':db['sequelize']['QueryTypes'][_0xd9a6('0x7e')]})[_0xd9a6('0x24')](function(_0x5e6e32){if(_0x5e6e32['length']===0x1){return _0x32784d['id'];}else{var _0x257263=_[_0xd9a6('0x7f')](_[_0xd9a6('0x2d')](_0x5e6e32,_0xd9a6('0x80')),function(_0xa51336){return _[_0xd9a6('0x81')](_0x4cbf47,_0xa51336);});if(_0x257263){return _0x32784d['id'];}}}));}}return BPromise[_0xd9a6('0x82')](_0x5864a1)[_0xd9a6('0x24')](function(_0x5d4d65){_0xbd2262=_(_0xbd2262)[_0xd9a6('0x83')](_0x5d4d65)[_0xd9a6('0x84')]()['value']();return db[_0xd9a6('0x2e')]['find']({'where':{'id':_0x5b8e46[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](function(_0x594572){return db[_0xd9a6('0x6c')][_0xd9a6('0x85')](function(_0x4b1d27){return _0x594572[_0xd9a6('0x71')](_0x5b8e46[_0xd9a6('0x33')]['ids'],{'transaction':_0x4b1d27})[_0xd9a6('0x24')](function(){if(!_[_0xd9a6('0x86')](_0xbd2262)){return _0x594572[_0xd9a6('0x87')](_0xbd2262,{'transaction':_0x4b1d27});}})[_0xd9a6('0x24')](function(){_0xbd2262['forEach'](function(_0x45ad8e){socket['emit'](_0xd9a6('0x88'),{'UserId':_0x45ad8e,'SmsQueueId':_0x594572['id']});});});});});});})[_0xd9a6('0x24')](respondWithStatusCode(_0x6492c6,null))[_0xd9a6('0x48')](handleError(_0x6492c6,null));};exports[_0xd9a6('0x89')]=function(_0x330c89,_0x2e00f7,_0x14d9d9){return db[_0xd9a6('0x2e')][_0xd9a6('0x4d')]({'where':{'id':_0x330c89[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x2e00f7,null))[_0xd9a6('0x24')](function(_0x5ad453){if(_0x5ad453){return _0x5ad453[_0xd9a6('0x89')](_0x330c89[_0xd9a6('0x51')][_0xd9a6('0x66')],_[_0xd9a6('0x8a')](_0x330c89['body'],[_0xd9a6('0x66'),'id'])||{})['spread'](function(_0x45b8cf){for(var _0x128e37=0x0;_0x128e37<_0x330c89[_0xd9a6('0x51')][_0xd9a6('0x66')]['length'];_0x128e37+=0x1){socket[_0xd9a6('0x6f')](_0xd9a6('0x70'),{'UserId':Number(_0x330c89['body'][_0xd9a6('0x66')][_0x128e37]),'SmsQueueId':Number(_0x330c89[_0xd9a6('0x47')]['id'])});}return _0x45b8cf;});}})[_0xd9a6('0x24')](respondWithResult(_0x2e00f7,null))[_0xd9a6('0x48')](handleError(_0x2e00f7,null));};exports[_0xd9a6('0x87')]=function(_0xd19ec8,_0x44be12,_0x3b4a4d){return db[_0xd9a6('0x2e')][_0xd9a6('0x4d')]({'where':{'id':_0xd19ec8['params']['id']}})['then'](handleEntityNotFound(_0x44be12,null))[_0xd9a6('0x24')](function(_0x389fab){if(_0x389fab){return _0x389fab['removeAgents'](_0xd19ec8[_0xd9a6('0x33')][_0xd9a6('0x66')])[_0xd9a6('0x24')](function(){if(_[_0xd9a6('0x8b')](_0xd19ec8[_0xd9a6('0x33')][_0xd9a6('0x66')])){for(var _0x4d7db0=0x0;_0x4d7db0<_0xd19ec8[_0xd9a6('0x33')][_0xd9a6('0x66')][_0xd9a6('0x39')];_0x4d7db0+=0x1){socket['emit'](_0xd9a6('0x88'),{'UserId':Number(_0xd19ec8[_0xd9a6('0x33')][_0xd9a6('0x66')][_0x4d7db0]),'SmsQueueId':Number(_0xd19ec8[_0xd9a6('0x47')]['id'])});}}else{socket[_0xd9a6('0x6f')](_0xd9a6('0x88'),{'UserId':Number(_0xd19ec8[_0xd9a6('0x33')][_0xd9a6('0x66')]),'SmsQueueId':Number(_0xd19ec8[_0xd9a6('0x47')]['id'])});}});}})[_0xd9a6('0x24')](respondWithStatusCode(_0x44be12,null))['catch'](handleError(_0x44be12,null));};exports[_0xd9a6('0x8c')]=function(_0x2f88e5,_0x8d1dc2,_0x4d1b36){var _0x1a40a5={};var _0xde6e73={};var _0x5da946;var _0x34246c;return db[_0xd9a6('0x2e')][_0xd9a6('0x63')]({'where':{'id':_0x2f88e5[_0xd9a6('0x47')]['id']}})[_0xd9a6('0x24')](handleEntityNotFound(_0x8d1dc2,null))[_0xd9a6('0x24')](function(_0x4c4708){if(_0x4c4708){_0x5da946=_0x4c4708;_0xde6e73['model']=_[_0xd9a6('0x34')](db[_0xd9a6('0x58')][_0xd9a6('0x2f')]);_0xde6e73[_0xd9a6('0x33')]=_[_0xd9a6('0x34')](_0x2f88e5['query']);_0xde6e73[_0xd9a6('0x35')]=_[_0xd9a6('0x36')](_0xde6e73['model'],_0xde6e73[_0xd9a6('0x33')]);_0x1a40a5[_0xd9a6('0x38')]=_[_0xd9a6('0x36')](_0xde6e73['model'],qs[_0xd9a6('0x37')](_0x2f88e5['query'][_0xd9a6('0x37')]));_0x1a40a5[_0xd9a6('0x38')]=_0x1a40a5['attributes'][_0xd9a6('0x39')]?_0x1a40a5['attributes']:_0xde6e73[_0xd9a6('0x3a')];_0x1a40a5[_0xd9a6('0x55')]=qs[_0xd9a6('0x3d')](_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x3d')]);_0x1a40a5[_0xd9a6('0x3f')]=qs['filters'](_[_0xd9a6('0x56')](_0x2f88e5[_0xd9a6('0x33')],_0xde6e73[_0xd9a6('0x35')]));if(_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x3e')]){_0x1a40a5[_0xd9a6('0x3f')]=_[_0xd9a6('0x41')](_0x1a40a5[_0xd9a6('0x3f')],{'$or':_['map'](_0x1a40a5[_0xd9a6('0x38')],function(_0x2f6387){var _0x24d99c={};_0x24d99c[_0x2f6387]={'$like':'%'+_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x3e')]+'%'};return _0x24d99c;})});}_0x1a40a5=_[_0xd9a6('0x41')]({},_0x1a40a5,_0x2f88e5[_0xd9a6('0x42')]);return _0x5da946[_0xd9a6('0x8c')](_0x1a40a5);}})[_0xd9a6('0x24')](function(_0x239bd8){if(_0x239bd8){_0x34246c=_0x239bd8[_0xd9a6('0x39')];if(!_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x3b')](_0xd9a6('0x3c'))){_0x1a40a5[_0xd9a6('0x1e')]=qs[_0xd9a6('0x1e')](_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x1e')]);_0x1a40a5[_0xd9a6('0x1d')]=qs['offset'](_0x2f88e5[_0xd9a6('0x33')][_0xd9a6('0x1d')]);}return _0x5da946[_0xd9a6('0x8c')](_0x1a40a5);}})['then'](function(_0x1e588d){if(_0x1e588d){return _0x1e588d?{'count':_0x34246c,'rows':_0x1e588d}:null;}})['then'](respondWithResult(_0x8d1dc2,null))[_0xd9a6('0x48')](handleError(_0x8d1dc2,null));};
\ No newline at end of file
+var _0xda2d=['json','offset','undefined','limit','count','set','apply','reject','save','then','get','SmsQueues','UserProfileResource','destroy','stack','name','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','filter','SmsQueue','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','options','User','findAndCountAll','UserId','smsPause','updatedAt','rows','%s/%s','createdAt','Team','getTeams','Agents','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end'];(function(_0x57e18a,_0x199383){var _0x1181c7=function(_0x2503e8){while(--_0x2503e8){_0x57e18a['push'](_0x57e18a['shift']());}};_0x1181c7(++_0x199383);}(_0xda2d,0x102));var _0xdda2=function(_0x5254e9,_0x434e48){_0x5254e9=_0x5254e9-0x0;var _0x15a1c8=_0xda2d[_0x5254e9];return _0x15a1c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdda2('0x0'));var zipdir=require(_0xdda2('0x1'));var jsonpatch=require(_0xdda2('0x2'));var rp=require(_0xdda2('0x3'));var moment=require(_0xdda2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xdda2('0x5'));var sox=require(_0xdda2('0x6'));var csv=require(_0xdda2('0x7'));var ejs=require(_0xdda2('0x8'));var fs=require('fs');var fs_extra=require(_0xdda2('0x9'));var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xdda2('0x19')](config[_0xdda2('0x1a')],{'host':_0xdda2('0x1b'),'port':0x18eb});var socket=require(_0xdda2('0x1c'))(new Redis(config[_0xdda2('0x1a')]));require(_0xdda2('0x1d'))[_0xdda2('0x1e')](socket);function respondWithStatusCode(_0x4df902,_0x79c6d4){_0x79c6d4=_0x79c6d4||0xcc;return function(_0x4b0220){if(_0x4b0220){return _0x4df902[_0xdda2('0x1f')](_0x79c6d4);}return _0x4df902[_0xdda2('0x20')](_0x79c6d4)[_0xdda2('0x21')]();};}function respondWithResult(_0x457764,_0x1922b1){_0x1922b1=_0x1922b1||0xc8;return function(_0x5d8a83){if(_0x5d8a83){return _0x457764['status'](_0x1922b1)[_0xdda2('0x22')](_0x5d8a83);}};}function respondWithFilteredResult(_0x518c6d,_0x1a5192){return function(_0x1a3b35){if(_0x1a3b35){var _0x335fb5=typeof _0x1a5192[_0xdda2('0x23')]===_0xdda2('0x24')&&typeof _0x1a5192[_0xdda2('0x25')]===_0xdda2('0x24');var _0x351151=_0x1a3b35[_0xdda2('0x26')];var _0x337b0b=_0x335fb5?0x0:_0x1a5192[_0xdda2('0x23')];var _0x6fdede=_0x335fb5?_0x1a3b35['count']:_0x1a5192[_0xdda2('0x23')]+_0x1a5192['limit'];var _0xc4567c;if(_0x6fdede>=_0x351151){_0x6fdede=_0x351151;_0xc4567c=0xc8;}else{_0xc4567c=0xce;}_0x518c6d[_0xdda2('0x20')](_0xc4567c);return _0x518c6d[_0xdda2('0x27')]('Content-Range',_0x337b0b+'-'+_0x6fdede+'/'+_0x351151)[_0xdda2('0x22')](_0x1a3b35);}return null;};}function patchUpdates(_0x5a9bb8){return function(_0x425489){try{jsonpatch[_0xdda2('0x28')](_0x425489,_0x5a9bb8,!![]);}catch(_0x4ac3eb){return BPromise[_0xdda2('0x29')](_0x4ac3eb);}return _0x425489[_0xdda2('0x2a')]();};}function saveUpdates(_0x2528d7,_0x13b0f3){return function(_0x45ee9d){if(_0x45ee9d){return _0x45ee9d['update'](_0x2528d7)[_0xdda2('0x2b')](function(_0x4be5ea){return _0x4be5ea;});}return null;};}function removeEntity(_0x2391a5,_0x31d48b){return function(_0x5436d1){if(_0x5436d1){return _0x5436d1['destroy']()[_0xdda2('0x2b')](function(){var _0x4567e7=_0x5436d1[_0xdda2('0x2c')]({'plain':!![]});var _0x5e9e74=_0xdda2('0x2d');return db[_0xdda2('0x2e')][_0xdda2('0x2f')]({'where':{'type':_0x5e9e74,'resourceId':_0x4567e7['id']}})[_0xdda2('0x2b')](function(){return _0x5436d1;});})[_0xdda2('0x2b')](function(){_0x2391a5[_0xdda2('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c37d,_0x255bbc){return function(_0x53acb5){if(!_0x53acb5){_0x24c37d[_0xdda2('0x1f')](0x194);}return _0x53acb5;};}function handleError(_0x2cfaca,_0x3b18b8){_0x3b18b8=_0x3b18b8||0x1f4;return function(_0x15e511){logger['error'](_0x15e511[_0xdda2('0x30')]);if(_0x15e511[_0xdda2('0x31')]){delete _0x15e511['name'];}_0x2cfaca[_0xdda2('0x20')](_0x3b18b8)['send'](_0x15e511);};}exports[_0xdda2('0x32')]=function(_0x55809a,_0x53ff76){var _0x510b7b={},_0x239c25={},_0x5bfc17={'count':0x0,'rows':[]};var _0x1b13f4=_['map'](db['SmsQueue']['rawAttributes'],function(_0x4637c1){return{'name':_0x4637c1[_0xdda2('0x33')],'type':_0x4637c1[_0xdda2('0x34')][_0xdda2('0x35')]};});_0x239c25[_0xdda2('0x36')]=_[_0xdda2('0x37')](_0x1b13f4,_0xdda2('0x31'));_0x239c25[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x55809a[_0xdda2('0x38')]);_0x239c25['filters']=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],_0x239c25[_0xdda2('0x38')]);_0x510b7b[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x239c25[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x55809a['query']['fields']));_0x510b7b[_0xdda2('0x3b')]=_0x510b7b[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x510b7b['attributes']:_0x239c25['model'];if(!_0x55809a[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x510b7b[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x55809a['query'][_0xdda2('0x25')]);_0x510b7b[_0xdda2('0x23')]=qs['offset'](_0x55809a['query'][_0xdda2('0x23')]);}_0x510b7b[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x55809a[_0xdda2('0x38')][_0xdda2('0x41')]);_0x510b7b['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x55809a[_0xdda2('0x38')],_0x239c25[_0xdda2('0x42')]),_0x1b13f4);if(_0x55809a['query']['filter']){_0x510b7b[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x510b7b[_0xdda2('0x44')],{'$or':_['map'](_0x1b13f4,function(_0x1bb2a7){if(_0x1bb2a7['type']!==_0xdda2('0x46')){var _0x4c68d7={};_0x4c68d7[_0x1bb2a7[_0xdda2('0x31')]]={'$like':'%'+_0x55809a[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0x4c68d7;}})});}_0x510b7b=_[_0xdda2('0x45')]({},_0x510b7b,_0x55809a['options']);var _0x1c5195={'where':_0x510b7b['where']};return db[_0xdda2('0x48')]['count'](_0x1c5195)[_0xdda2('0x2b')](function(_0x12589b){_0x5bfc17[_0xdda2('0x26')]=_0x12589b;if(_0x55809a[_0xdda2('0x38')][_0xdda2('0x49')]){_0x510b7b['include']=[{'all':!![]}];}return db[_0xdda2('0x48')][_0xdda2('0x4a')](_0x510b7b);})['then'](function(_0x2caced){_0x5bfc17['rows']=_0x2caced;return _0x5bfc17;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x53ff76,_0x510b7b))[_0xdda2('0x4b')](handleError(_0x53ff76,null));};exports[_0xdda2('0x4c')]=function(_0x355b6a,_0x3f1f9b){var _0x6718ea={'raw':!![],'where':{'id':_0x355b6a[_0xdda2('0x4d')]['id']}},_0x550351={};_0x550351[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x48')][_0xdda2('0x4e')]);_0x550351[_0xdda2('0x38')]=_['keys'](_0x355b6a['query']);_0x550351['filters']=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],_0x550351['query']);_0x6718ea[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x550351[_0xdda2('0x36')],qs['fields'](_0x355b6a[_0xdda2('0x38')][_0xdda2('0x3c')]));_0x6718ea['attributes']=_0x6718ea['attributes'][_0xdda2('0x3d')]?_0x6718ea['attributes']:_0x550351[_0xdda2('0x36')];if(_0x355b6a['query'][_0xdda2('0x49')]){_0x6718ea[_0xdda2('0x4f')]=[{'all':!![]}];}_0x6718ea=_['merge']({},_0x6718ea,_0x355b6a['options']);return db[_0xdda2('0x48')][_0xdda2('0x50')](_0x6718ea)[_0xdda2('0x2b')](handleEntityNotFound(_0x3f1f9b,null))[_0xdda2('0x2b')](respondWithResult(_0x3f1f9b,null))['catch'](handleError(_0x3f1f9b,null));};exports[_0xdda2('0x51')]=function(_0x3bba94,_0x3d2cb0){return db[_0xdda2('0x48')][_0xdda2('0x51')](_0x3bba94['body'],{})[_0xdda2('0x2b')](function(_0x40b610){var _0x51f2b6=_0x3bba94[_0xdda2('0x52')][_0xdda2('0x2c')]({'plain':!![]});if(!_0x51f2b6)throw new Error(_0xdda2('0x53'));if(_0x51f2b6[_0xdda2('0x54')]===_0xdda2('0x52')){var _0x265169=_0x40b610['get']({'plain':!![]});var _0x2c58c7='SmsQueues';return db[_0xdda2('0x55')]['find']({'where':{'name':_0x2c58c7,'userProfileId':_0x51f2b6[_0xdda2('0x56')]},'raw':!![]})['then'](function(_0x3b5bbf){if(_0x3b5bbf&&_0x3b5bbf[_0xdda2('0x57')]===0x0){return db[_0xdda2('0x2e')][_0xdda2('0x51')]({'name':_0x265169[_0xdda2('0x31')],'resourceId':_0x265169['id'],'type':_0x3b5bbf[_0xdda2('0x31')],'sectionId':_0x3b5bbf['id']},{})[_0xdda2('0x2b')](function(){return _0x40b610;});}else{return _0x40b610;}})[_0xdda2('0x4b')](function(_0x538ebb){logger[_0xdda2('0x58')](_0xdda2('0x59'),_0x538ebb);throw _0x538ebb;});}return _0x40b610;})[_0xdda2('0x2b')](respondWithResult(_0x3d2cb0,0xc9))['catch'](handleError(_0x3d2cb0,null));};exports[_0xdda2('0x5a')]=function(_0x1c2d24,_0x56ddf2){if(_0x1c2d24[_0xdda2('0x5b')]['id']){delete _0x1c2d24['body']['id'];}return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x1c2d24[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x56ddf2,null))[_0xdda2('0x2b')](saveUpdates(_0x1c2d24['body'],null))['then'](respondWithResult(_0x56ddf2,null))['catch'](handleError(_0x56ddf2,null));};exports[_0xdda2('0x2f')]=function(_0x1a940b,_0x5984f2){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x1a940b[_0xdda2('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5984f2,null))[_0xdda2('0x2b')](removeEntity(_0x5984f2,null))[_0xdda2('0x4b')](handleError(_0x5984f2,null));};exports[_0xdda2('0x5c')]=function(_0x58ae15,_0x2b2c1d){return db[_0xdda2('0x48')][_0xdda2('0x5c')]()[_0xdda2('0x2b')](respondWithResult(_0x2b2c1d,null))['catch'](handleError(_0x2b2c1d,null));};exports[_0xdda2('0x5d')]=function(_0x4c94a3,_0x494b81,_0x58fcec){var _0x285cec={'raw':!![],'where':{}},_0x35b38a={},_0x2432c0;return db[_0xdda2('0x48')][_0xdda2('0x5e')]({'where':{'id':_0x4c94a3[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x494b81,null))[_0xdda2('0x2b')](function(_0x269ad1){if(_0x269ad1){_0x2432c0=_0x269ad1[_0xdda2('0x2c')]({'plain':!![]});_0x35b38a[_0xdda2('0x36')]=_['keys'](db[_0xdda2('0x5f')][_0xdda2('0x4e')]);_0x35b38a[_0xdda2('0x38')]=_[_0xdda2('0x39')](_0x4c94a3[_0xdda2('0x38')]);_0x35b38a[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0x35b38a['model'],_0x35b38a[_0xdda2('0x38')]);_0x285cec[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x35b38a[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x4c94a3['query'][_0xdda2('0x3c')]));_0x285cec[_0xdda2('0x3b')]=_0x285cec[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x285cec[_0xdda2('0x3b')]:_0x35b38a['model'];if(!_0x4c94a3[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x285cec[_0xdda2('0x25')]=qs[_0xdda2('0x25')](_0x4c94a3['query'][_0xdda2('0x25')]);_0x285cec[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x4c94a3['query'][_0xdda2('0x23')]);}_0x285cec['order']=qs[_0xdda2('0x41')](_0x4c94a3[_0xdda2('0x38')][_0xdda2('0x41')]);_0x285cec['where']=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x4c94a3['query'],_0x35b38a[_0xdda2('0x42')]));_0x285cec['where'][_0xdda2('0x60')]=_0x269ad1['id'];if(_0x4c94a3[_0xdda2('0x38')][_0xdda2('0x47')]){_0x285cec[_0xdda2('0x44')]=_[_0xdda2('0x45')](_0x285cec['where'],{'$or':_['map'](_0x285cec[_0xdda2('0x3b')],function(_0x25cf60){var _0x547fbd={};_0x547fbd[_0x25cf60]={'$like':'%'+_0x4c94a3['query'][_0xdda2('0x47')]+'%'};return _0x547fbd;})});}_0x285cec=_['merge']({},_0x285cec,_0x4c94a3[_0xdda2('0x61')]);return db[_0xdda2('0x5f')]['findAll'](_0x285cec);}})[_0xdda2('0x2b')](function(_0x156c00){if(_0x156c00){return db[_0xdda2('0x62')][_0xdda2('0x63')]({'where':{'id':_[_0xdda2('0x37')](_0x156c00,_0xdda2('0x64')),'role':'agent'},'attributes':['id',_0xdda2('0x31'),_0xdda2('0x65'),_0xdda2('0x66'),'createdAt']});}})[_0xdda2('0x2b')](function(_0x2ec405){if(_0x2ec405){return{'count':_0x2ec405['count'],'rows':_['map'](_0x2ec405[_0xdda2('0x67')],function(_0x232823){return{'membername':_0x232823[_0xdda2('0x31')],'UserId':_0x232823['id'],'queue_name':_0x2432c0['name'],'SmsQueueId':_0x2432c0['id'],'interface':util['format'](_0xdda2('0x68'),'SIP',_0x232823[_0xdda2('0x31')]),'penalty':0x0,'paused':_0x232823[_0xdda2('0x65')],'createdAt':_0x232823[_0xdda2('0x69')],'updatedAt':_0x232823[_0xdda2('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdda2('0x2b')](respondWithFilteredResult(_0x494b81,_0x285cec))[_0xdda2('0x4b')](handleError(_0x494b81,null));};exports['getTeams']=function(_0x5170b7,_0x218b96,_0x4eabc4){var _0x2de01c={};var _0x2de4f5={};var _0x15f581;var _0x19d210;return db[_0xdda2('0x48')][_0xdda2('0x5e')]({'where':{'id':_0x5170b7[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x218b96,null))[_0xdda2('0x2b')](function(_0x495a28){if(_0x495a28){_0x15f581=_0x495a28;_0x2de4f5[_0xdda2('0x36')]=_[_0xdda2('0x39')](db[_0xdda2('0x6a')][_0xdda2('0x4e')]);_0x2de4f5['query']=_[_0xdda2('0x39')](_0x5170b7[_0xdda2('0x38')]);_0x2de4f5[_0xdda2('0x42')]=_[_0xdda2('0x3a')](_0x2de4f5['model'],_0x2de4f5['query']);_0x2de01c[_0xdda2('0x3b')]=_[_0xdda2('0x3a')](_0x2de4f5[_0xdda2('0x36')],qs[_0xdda2('0x3c')](_0x5170b7['query'][_0xdda2('0x3c')]));_0x2de01c[_0xdda2('0x3b')]=_0x2de01c[_0xdda2('0x3b')][_0xdda2('0x3d')]?_0x2de01c[_0xdda2('0x3b')]:_0x2de4f5[_0xdda2('0x36')];_0x2de01c[_0xdda2('0x40')]=qs[_0xdda2('0x41')](_0x5170b7[_0xdda2('0x38')][_0xdda2('0x41')]);_0x2de01c[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_[_0xdda2('0x43')](_0x5170b7[_0xdda2('0x38')],_0x2de4f5[_0xdda2('0x42')]));if(_0x5170b7['query'][_0xdda2('0x47')]){_0x2de01c[_0xdda2('0x44')]=_['merge'](_0x2de01c['where'],{'$or':_[_0xdda2('0x37')](_0x2de01c[_0xdda2('0x3b')],function(_0x1ba7dd){var _0xdc4cdc={};_0xdc4cdc[_0x1ba7dd]={'$like':'%'+_0x5170b7[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0xdc4cdc;})});}_0x2de01c=_['merge']({},_0x2de01c,_0x5170b7[_0xdda2('0x61')]);return _0x15f581[_0xdda2('0x6b')](_0x2de01c);}})[_0xdda2('0x2b')](function(_0x2bb4f3){if(_0x2bb4f3){_0x19d210=_0x2bb4f3['length'];if(!_0x5170b7[_0xdda2('0x38')]['hasOwnProperty'](_0xdda2('0x3f'))){_0x2de01c[_0xdda2('0x25')]=qs['limit'](_0x5170b7[_0xdda2('0x38')][_0xdda2('0x25')]);_0x2de01c[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x5170b7[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x15f581[_0xdda2('0x6b')](_0x2de01c);}})[_0xdda2('0x2b')](function(_0x3a375d){if(_0x3a375d){return _0x3a375d?{'count':_0x19d210,'rows':_0x3a375d}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x218b96,null))[_0xdda2('0x4b')](handleError(_0x218b96,null));};exports['addTeams']=function(_0x574680,_0x39d0a5,_0x17d593){var _0x3baaf8=_0x574680[_0xdda2('0x5b')]['ids'];return db[_0xdda2('0x6a')][_0xdda2('0x4a')]({'where':{'id':_0x3baaf8},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdda2('0x6c'),'attributes':['id',_0xdda2('0x31'),'online','voicePause',_0xdda2('0x6d')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x179b1a){if(_0x179b1a){var _0x22b832=_[_0xdda2('0x6e')](_0x179b1a,function(_0x2478e2){var _0x525e93=_0x2478e2[_0xdda2('0x2c')]({'plain':!![]});return _0x525e93[_0xdda2('0x6c')];});return db['SmsQueue'][_0xdda2('0x50')]({'where':{'id':_0x574680[_0xdda2('0x4d')]['id']}})['then'](function(_0x2da4a7){return db[_0xdda2('0x6f')][_0xdda2('0x70')](function(_0x500333){return _0x2da4a7[_0xdda2('0x71')](_0x3baaf8,{'transaction':_0x500333})['then'](function(){return BPromise[_0xdda2('0x72')](_0x22b832,function(_0x38028e){return db[_0xdda2('0x5f')][_0xdda2('0x73')]({'where':{'UserId':_0x38028e['id'],'SmsQueueId':_0x574680['params']['id']},'transaction':_0x500333});});})['then'](function(){_0x22b832[_0xdda2('0x74')](function(_0x11c1c8){socket['emit'](_0xdda2('0x75'),{'UserId':_0x11c1c8['id'],'SmsQueueId':_0x2da4a7['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x39d0a5,null))[_0xdda2('0x4b')](handleError(_0x39d0a5,null));};exports[_0xdda2('0x76')]=function(_0x19fbb9,_0x35d920,_0x2d5ec4){return db[_0xdda2('0x6a')][_0xdda2('0x4a')]({'where':{'id':_0x19fbb9[_0xdda2('0x38')][_0xdda2('0x77')]},'attributes':['id'],'include':[{'model':db[_0xdda2('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x35d920,null))['then'](function(_0x3f265f){var _0x4edf20=_[_0xdda2('0x37')](_0x3f265f,'id');var _0x323af8=[];var _0x2f18a0=[];var _0xe797aa=squel['select']();_0xe797aa[_0xdda2('0x78')](_0xdda2('0x79'))[_0xdda2('0x7a')]('team_has_sms_queues','tq')[_0xdda2('0x7b')](_0xdda2('0x7c'),'ut',_0xdda2('0x7d'))['where']('SmsQueueId\x20=\x20?',_0x19fbb9[_0xdda2('0x4d')]['id']);for(var _0x46e3e4=0x0;_0x46e3e4<_0x3f265f[_0xdda2('0x3d')];_0x46e3e4+=0x1){let _0x5e3718=_0x3f265f[_0x46e3e4];for(var _0x29a037=0x0;_0x29a037<_0x5e3718[_0xdda2('0x6c')][_0xdda2('0x3d')];_0x29a037+=0x1){let _0x130c5d=_0x5e3718[_0xdda2('0x6c')][_0x29a037];var _0x10ebab=_0xe797aa[_0xdda2('0x7e')]();_0x10ebab['where'](_0xdda2('0x7f'),_0x130c5d['id']);_0x2f18a0[_0xdda2('0x80')](db[_0xdda2('0x6f')][_0xdda2('0x38')](_0x10ebab['toString'](),{'type':db[_0xdda2('0x6f')][_0xdda2('0x81')][_0xdda2('0x82')]})[_0xdda2('0x2b')](function(_0x52d32c){if(_0x52d32c['length']===0x1){return _0x130c5d['id'];}else{var _0x59baac=_[_0xdda2('0x83')](_[_0xdda2('0x37')](_0x52d32c,_0xdda2('0x84')),function(_0x429f24){return _[_0xdda2('0x85')](_0x4edf20,_0x429f24);});if(_0x59baac){return _0x130c5d['id'];}}}));}}return BPromise[_0xdda2('0x86')](_0x2f18a0)['then'](function(_0x2fcd81){_0x323af8=_(_0x323af8)[_0xdda2('0x87')](_0x2fcd81)[_0xdda2('0x88')]()[_0xdda2('0x89')]();return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x19fbb9[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](function(_0x4cdca6){return db[_0xdda2('0x6f')]['transaction'](function(_0x161043){return _0x4cdca6['removeTeams'](_0x19fbb9[_0xdda2('0x38')]['ids'],{'transaction':_0x161043})[_0xdda2('0x2b')](function(){if(!_[_0xdda2('0x8a')](_0x323af8)){return _0x4cdca6[_0xdda2('0x8b')](_0x323af8,{'transaction':_0x161043});}})[_0xdda2('0x2b')](function(){_0x323af8[_0xdda2('0x74')](function(_0x18a102){socket[_0xdda2('0x8c')](_0xdda2('0x8d'),{'UserId':_0x18a102,'SmsQueueId':_0x4cdca6['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x35d920,null))['catch'](handleError(_0x35d920,null));};exports[_0xdda2('0x8e')]=function(_0x434d79,_0x5db550,_0x42db44){return db[_0xdda2('0x48')][_0xdda2('0x50')]({'where':{'id':_0x434d79['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x5db550,null))[_0xdda2('0x2b')](function(_0x251408){if(_0x251408){return _0x251408[_0xdda2('0x8e')](_0x434d79[_0xdda2('0x5b')][_0xdda2('0x77')],_[_0xdda2('0x8f')](_0x434d79[_0xdda2('0x5b')],[_0xdda2('0x77'),'id'])||{})[_0xdda2('0x90')](function(_0x4d4ce2){for(var _0x30aaac=0x0;_0x30aaac<_0x434d79[_0xdda2('0x5b')][_0xdda2('0x77')][_0xdda2('0x3d')];_0x30aaac+=0x1){socket[_0xdda2('0x8c')]('userSmsQueue:save',{'UserId':Number(_0x434d79[_0xdda2('0x5b')][_0xdda2('0x77')][_0x30aaac]),'SmsQueueId':Number(_0x434d79[_0xdda2('0x4d')]['id'])});}return _0x4d4ce2;});}})['then'](respondWithResult(_0x5db550,null))[_0xdda2('0x4b')](handleError(_0x5db550,null));};exports[_0xdda2('0x8b')]=function(_0x427638,_0x55d48c,_0x2a0468){return db['SmsQueue']['find']({'where':{'id':_0x427638[_0xdda2('0x4d')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x55d48c,null))[_0xdda2('0x2b')](function(_0x3b33aa){if(_0x3b33aa){return _0x3b33aa[_0xdda2('0x8b')](_0x427638[_0xdda2('0x38')][_0xdda2('0x77')])['then'](function(){if(_['isArray'](_0x427638[_0xdda2('0x38')][_0xdda2('0x77')])){for(var _0x3de061=0x0;_0x3de061<_0x427638[_0xdda2('0x38')][_0xdda2('0x77')]['length'];_0x3de061+=0x1){socket[_0xdda2('0x8c')](_0xdda2('0x8d'),{'UserId':Number(_0x427638[_0xdda2('0x38')][_0xdda2('0x77')][_0x3de061]),'SmsQueueId':Number(_0x427638[_0xdda2('0x4d')]['id'])});}}else{socket[_0xdda2('0x8c')](_0xdda2('0x8d'),{'UserId':Number(_0x427638[_0xdda2('0x38')][_0xdda2('0x77')]),'SmsQueueId':Number(_0x427638[_0xdda2('0x4d')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x55d48c,null))[_0xdda2('0x4b')](handleError(_0x55d48c,null));};exports[_0xdda2('0x91')]=function(_0x1aaa9c,_0x3e415f,_0x416993){var _0x47b7a5={};var _0x1512aa={};var _0x4c9cbb;var _0x7f91a5;return db[_0xdda2('0x48')][_0xdda2('0x5e')]({'where':{'id':_0x1aaa9c['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x3e415f,null))[_0xdda2('0x2b')](function(_0x3d59cb){if(_0x3d59cb){_0x4c9cbb=_0x3d59cb;_0x1512aa['model']=_[_0xdda2('0x39')](db[_0xdda2('0x62')][_0xdda2('0x4e')]);_0x1512aa['query']=_['keys'](_0x1aaa9c[_0xdda2('0x38')]);_0x1512aa['filters']=_[_0xdda2('0x3a')](_0x1512aa[_0xdda2('0x36')],_0x1512aa[_0xdda2('0x38')]);_0x47b7a5[_0xdda2('0x3b')]=_['intersection'](_0x1512aa[_0xdda2('0x36')],qs['fields'](_0x1aaa9c['query']['fields']));_0x47b7a5['attributes']=_0x47b7a5[_0xdda2('0x3b')]['length']?_0x47b7a5[_0xdda2('0x3b')]:_0x1512aa[_0xdda2('0x36')];_0x47b7a5['order']=qs['sort'](_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x41')]);_0x47b7a5[_0xdda2('0x44')]=qs[_0xdda2('0x42')](_['pick'](_0x1aaa9c['query'],_0x1512aa[_0xdda2('0x42')]));if(_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x47')]){_0x47b7a5[_0xdda2('0x44')]=_['merge'](_0x47b7a5[_0xdda2('0x44')],{'$or':_[_0xdda2('0x37')](_0x47b7a5[_0xdda2('0x3b')],function(_0x211015){var _0xf08532={};_0xf08532[_0x211015]={'$like':'%'+_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x47')]+'%'};return _0xf08532;})});}_0x47b7a5=_[_0xdda2('0x45')]({},_0x47b7a5,_0x1aaa9c[_0xdda2('0x61')]);return _0x4c9cbb[_0xdda2('0x91')](_0x47b7a5);}})[_0xdda2('0x2b')](function(_0x26144b){if(_0x26144b){_0x7f91a5=_0x26144b[_0xdda2('0x3d')];if(!_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x3e')](_0xdda2('0x3f'))){_0x47b7a5['limit']=qs[_0xdda2('0x25')](_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x25')]);_0x47b7a5[_0xdda2('0x23')]=qs[_0xdda2('0x23')](_0x1aaa9c[_0xdda2('0x38')][_0xdda2('0x23')]);}return _0x4c9cbb[_0xdda2('0x91')](_0x47b7a5);}})[_0xdda2('0x2b')](function(_0x1c008c){if(_0x1c008c){return _0x1c008c?{'count':_0x7f91a5,'rows':_0x1c008c}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x3e415f,null))[_0xdda2('0x4b')](handleError(_0x3e415f,null));};
\ No newline at end of file
index c58ce66..aaf984a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3711=['remove','emit','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x1599eb,_0x1c64f9){var _0x3761c8=function(_0x106b43){while(--_0x106b43){_0x1599eb['push'](_0x1599eb['shift']());}};_0x3761c8(++_0x1c64f9);}(_0x3711,0x198));var _0x1371=function(_0x54dac5,_0x2c84ab){_0x54dac5=_0x54dac5-0x0;var _0x5e606e=_0x3711[_0x54dac5];return _0x5e606e;};'use strict';var EventEmitter=require(_0x1371('0x0'));var SmsQueue=require(_0x1371('0x1'))['db'][_0x1371('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x1371('0x3')](0x0);var events={'afterCreate':_0x1371('0x4'),'afterUpdate':_0x1371('0x5'),'afterDestroy':_0x1371('0x6')};function emitEvent(_0x20f798){return function(_0x1ae67d,_0x1b5cb5,_0x459ccc){SmsQueueEvents[_0x1371('0x7')](_0x20f798+':'+_0x1ae67d['id'],_0x1ae67d);SmsQueueEvents[_0x1371('0x7')](_0x20f798,_0x1ae67d);_0x459ccc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x1371('0x8')]=SmsQueueEvents;
\ No newline at end of file
+var _0x4353=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update','remove','emit'];(function(_0x41a78c,_0x1ce07f){var _0x55a8c8=function(_0x411dc5){while(--_0x411dc5){_0x41a78c['push'](_0x41a78c['shift']());}};_0x55a8c8(++_0x1ce07f);}(_0x4353,0x137));var _0x3435=function(_0x40e313,_0x1b5ef1){_0x40e313=_0x40e313-0x0;var _0x1b73d3=_0x4353[_0x40e313];return _0x1b73d3;};'use strict';var EventEmitter=require(_0x3435('0x0'));var SmsQueue=require(_0x3435('0x1'))['db'][_0x3435('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3435('0x3')](0x0);var events={'afterCreate':_0x3435('0x4'),'afterUpdate':_0x3435('0x5'),'afterDestroy':_0x3435('0x6')};function emitEvent(_0x13b8f0){return function(_0x2a79de,_0x55a807,_0x3a09a3){SmsQueueEvents[_0x3435('0x7')](_0x13b8f0+':'+_0x2a79de['id'],_0x2a79de);SmsQueueEvents[_0x3435('0x7')](_0x13b8f0,_0x2a79de);_0x3a09a3(null);};}for(var e in events){if(events[_0x3435('0x8')](e)){var event=events[e];SmsQueue[_0x3435('0x9')](e,emitEvent(event));}}module[_0x3435('0xa')]=SmsQueueEvents;
\ No newline at end of file
index 65f0ffa..6e7686a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19a2=['../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2d9b06,_0x48e7c9){var _0x4bfd88=function(_0x2695c8){while(--_0x2695c8){_0x2d9b06['push'](_0x2d9b06['shift']());}};_0x4bfd88(++_0x48e7c9);}(_0x19a2,0x124));var _0x219a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x19a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x219a('0x0'));var util=require('util');var logger=require(_0x219a('0x1'))(_0x219a('0x2'));var moment=require('moment');var BPromise=require(_0x219a('0x3'));var rp=require(_0x219a('0x4'));var fs=require('fs');var path=require(_0x219a('0x5'));var rimraf=require(_0x219a('0x6'));var config=require(_0x219a('0x7'));var attributes=require(_0x219a('0x8'));module[_0x219a('0x9')]=function(_0x55b974,_0x2112d7){return _0x55b974[_0x219a('0xa')](_0x219a('0xb'),attributes,{'tableName':_0x219a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe1d7=['rimraf','../../config/environment','./smsQueue.attributes','define','SmsQueue','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x35c325,_0x281a22){var _0x292ecb=function(_0x370f03){while(--_0x370f03){_0x35c325['push'](_0x35c325['shift']());}};_0x292ecb(++_0x281a22);}(_0xe1d7,0x1b2));var _0x7e1d=function(_0x2ef548,_0x3f534f){_0x2ef548=_0x2ef548-0x0;var _0x3b1cb9=_0xe1d7[_0x2ef548];return _0x3b1cb9;};'use strict';var _=require(_0x7e1d('0x0'));var util=require(_0x7e1d('0x1'));var logger=require(_0x7e1d('0x2'))(_0x7e1d('0x3'));var moment=require(_0x7e1d('0x4'));var BPromise=require(_0x7e1d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7e1d('0x6'));var config=require(_0x7e1d('0x7'));var attributes=require(_0x7e1d('0x8'));module['exports']=function(_0x3f1ec1,_0x20dfc2){return _0x3f1ec1[_0x7e1d('0x9')](_0x7e1d('0xa'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16b07ef..cdc43fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe886=['GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','stringify','find','ShowSmsQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','redis','localhost','socket.io-emitter','register','then','info','SmsQueue,\x20%s,\x20%s','debug','error','code','message','result','catch'];(function(_0x152718,_0x4cd37e){var _0x504ff6=function(_0x10d336){while(--_0x10d336){_0x152718['push'](_0x152718['shift']());}};_0x504ff6(++_0x4cd37e);}(_0xe886,0xe0));var _0x6e88=function(_0x5bdf58,_0x2a3a6f){_0x5bdf58=_0x5bdf58-0x0;var _0x100b14=_0xe886[_0x5bdf58];return _0x100b14;};'use strict';var _=require('lodash');var util=require(_0x6e88('0x0'));var moment=require(_0x6e88('0x1'));var BPromise=require(_0x6e88('0x2'));var rs=require(_0x6e88('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e88('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6e88('0x5'))(_0x6e88('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e88('0x7')]['http']({'port':0x232a});config[_0x6e88('0x8')]=_['defaults'](config[_0x6e88('0x8')],{'host':_0x6e88('0x9'),'port':0x18eb});var socket=require(_0x6e88('0xa'))(new Redis(config[_0x6e88('0x8')]));require('./smsQueue.socket')[_0x6e88('0xb')](socket);function respondWithRpcPromise(_0x1f926f,_0x49235c,_0x3234f9){return new BPromise(function(_0x585c9c,_0x2cac1c){return client['request'](_0x1f926f,_0x3234f9)[_0x6e88('0xc')](function(_0x412827){logger[_0x6e88('0xd')](_0x6e88('0xe'),_0x49235c,'request\x20sent');logger[_0x6e88('0xf')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x49235c,'request\x20sent',JSON['stringify'](_0x412827));if(_0x412827[_0x6e88('0x10')]){if(_0x412827[_0x6e88('0x10')][_0x6e88('0x11')]===0x1f4){logger[_0x6e88('0x10')]('SmsQueue,\x20%s,\x20%s',_0x49235c,_0x412827[_0x6e88('0x10')]['message']);return _0x2cac1c(_0x412827[_0x6e88('0x10')]['message']);}logger[_0x6e88('0x10')]('SmsQueue,\x20%s,\x20%s',_0x49235c,_0x412827['error'][_0x6e88('0x12')]);return _0x585c9c(_0x412827[_0x6e88('0x10')][_0x6e88('0x12')]);}else{logger[_0x6e88('0xd')]('SmsQueue,\x20%s,\x20%s',_0x49235c,'request\x20sent');_0x585c9c(_0x412827[_0x6e88('0x13')][_0x6e88('0x12')]);}})[_0x6e88('0x14')](function(_0x25618b){logger[_0x6e88('0x10')](_0x6e88('0xe'),_0x49235c,_0x25618b);_0x2cac1c(_0x25618b);});});}exports[_0x6e88('0x15')]=function(_0x146336){var _0x13cf74=this;return new Promise(function(_0x1456de,_0x2ebf70){return db[_0x6e88('0x16')][_0x6e88('0x17')]({'raw':_0x146336[_0x6e88('0x18')]?_0x146336[_0x6e88('0x18')][_0x6e88('0x19')]===undefined?!![]:![]:!![],'where':_0x146336[_0x6e88('0x18')]?_0x146336[_0x6e88('0x18')][_0x6e88('0x1a')]||null:null,'attributes':_0x146336['options']?_0x146336[_0x6e88('0x18')]['attributes']||null:null,'limit':_0x146336[_0x6e88('0x18')]?_0x146336[_0x6e88('0x18')][_0x6e88('0x1b')]||null:null,'include':_0x146336[_0x6e88('0x18')]?_0x146336[_0x6e88('0x18')][_0x6e88('0x1c')]?_[_0x6e88('0x1d')](_0x146336[_0x6e88('0x18')][_0x6e88('0x1c')],function(_0x264c78){return{'model':db[_0x264c78[_0x6e88('0x1e')]],'as':_0x264c78['as'],'attributes':_0x264c78[_0x6e88('0x1f')],'include':_0x264c78['include']?_[_0x6e88('0x1d')](_0x264c78[_0x6e88('0x1c')],function(_0x14e9ca){return{'model':db[_0x14e9ca[_0x6e88('0x1e')]],'as':_0x14e9ca['as'],'attributes':_0x14e9ca[_0x6e88('0x1f')],'include':_0x14e9ca[_0x6e88('0x1c')]?_[_0x6e88('0x1d')](_0x14e9ca[_0x6e88('0x1c')],function(_0x567987){return{'model':db[_0x567987[_0x6e88('0x1e')]],'as':_0x567987['as'],'attributes':_0x567987[_0x6e88('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6e88('0xc')](function(_0xdc9103){logger[_0x6e88('0xd')](_0x6e88('0x15'),_0x146336);logger[_0x6e88('0xf')](_0x6e88('0x15'),_0x146336,JSON[_0x6e88('0x20')](_0xdc9103));_0x1456de(_0xdc9103);})[_0x6e88('0x14')](function(_0x330e40){logger[_0x6e88('0x10')](_0x6e88('0x15'),_0x330e40[_0x6e88('0x12')],_0x146336);_0x2ebf70(_0x13cf74[_0x6e88('0x10')](0x1f4,_0x330e40[_0x6e88('0x12')]));});});};exports['ShowSmsQueue']=function(_0x1ddf38){var _0x4c9f1f=this;return new Promise(function(_0x2f68fd,_0x1d315c){return db[_0x6e88('0x16')][_0x6e88('0x21')]({'raw':_0x1ddf38[_0x6e88('0x18')]?_0x1ddf38[_0x6e88('0x18')][_0x6e88('0x19')]===undefined?!![]:![]:!![],'where':_0x1ddf38['options']?_0x1ddf38[_0x6e88('0x18')][_0x6e88('0x1a')]||null:null,'attributes':_0x1ddf38['options']?_0x1ddf38[_0x6e88('0x18')][_0x6e88('0x1f')]||null:null,'include':_0x1ddf38[_0x6e88('0x18')]?_0x1ddf38[_0x6e88('0x18')]['include']?_[_0x6e88('0x1d')](_0x1ddf38['options']['include'],function(_0x21364e){return{'model':db[_0x21364e[_0x6e88('0x1e')]],'as':_0x21364e['as'],'attributes':_0x21364e[_0x6e88('0x1f')],'include':_0x21364e['include']?_[_0x6e88('0x1d')](_0x21364e[_0x6e88('0x1c')],function(_0xa9ba83){return{'model':db[_0xa9ba83[_0x6e88('0x1e')]],'as':_0xa9ba83['as'],'attributes':_0xa9ba83[_0x6e88('0x1f')],'include':_0xa9ba83[_0x6e88('0x1c')]?_['map'](_0xa9ba83[_0x6e88('0x1c')],function(_0x3ea3e8){return{'model':db[_0x3ea3e8[_0x6e88('0x1e')]],'as':_0x3ea3e8['as'],'attributes':_0x3ea3e8[_0x6e88('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x6e88('0xc')](function(_0x1f0f2f){logger[_0x6e88('0xd')](_0x6e88('0x22'),_0x1ddf38);logger[_0x6e88('0xf')](_0x6e88('0x22'),_0x1ddf38,JSON[_0x6e88('0x20')](_0x1f0f2f));_0x2f68fd(_0x1f0f2f);})[_0x6e88('0x14')](function(_0x1c8960){logger[_0x6e88('0x10')](_0x6e88('0x22'),_0x1c8960['message'],_0x1ddf38);_0x1d315c(_0x4c9f1f[_0x6e88('0x10')](0x1f4,_0x1c8960[_0x6e88('0x12')]));});});};
\ No newline at end of file
+var _0xc0e7=['message','result','catch','GetSmsQueue','SmsQueue','options','where','attributes','include','map','model','ShowSmsQueue','find','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x79a66,_0x2a8c12){var _0x3f0064=function(_0x374255){while(--_0x374255){_0x79a66['push'](_0x79a66['shift']());}};_0x3f0064(++_0x2a8c12);}(_0xc0e7,0x15a));var _0x7c0e=function(_0x534e11,_0x279f23){_0x534e11=_0x534e11-0x0;var _0x49f6c7=_0xc0e7[_0x534e11];return _0x49f6c7;};'use strict';var _=require('lodash');var util=require(_0x7c0e('0x0'));var moment=require('moment');var BPromise=require(_0x7c0e('0x1'));var rs=require(_0x7c0e('0x2'));var fs=require('fs');var Redis=require(_0x7c0e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c0e('0x4'));var logger=require(_0x7c0e('0x5'))(_0x7c0e('0x6'));var config=require(_0x7c0e('0x7'));var jayson=require(_0x7c0e('0x8'));var client=jayson['client'][_0x7c0e('0x9')]({'port':0x232a});config['redis']=_[_0x7c0e('0xa')](config[_0x7c0e('0xb')],{'host':_0x7c0e('0xc'),'port':0x18eb});var socket=require(_0x7c0e('0xd'))(new Redis(config[_0x7c0e('0xb')]));require(_0x7c0e('0xe'))['register'](socket);function respondWithRpcPromise(_0x2e5029,_0x23f78d,_0x2559c5){return new BPromise(function(_0x19c785,_0x4910e8){return client[_0x7c0e('0xf')](_0x2e5029,_0x2559c5)[_0x7c0e('0x10')](function(_0x299c93){logger[_0x7c0e('0x11')](_0x7c0e('0x12'),_0x23f78d,'request\x20sent');logger[_0x7c0e('0x13')](_0x7c0e('0x14'),_0x23f78d,_0x7c0e('0x15'),JSON[_0x7c0e('0x16')](_0x299c93));if(_0x299c93[_0x7c0e('0x17')]){if(_0x299c93[_0x7c0e('0x17')]['code']===0x1f4){logger['error'](_0x7c0e('0x12'),_0x23f78d,_0x299c93[_0x7c0e('0x17')]['message']);return _0x4910e8(_0x299c93['error'][_0x7c0e('0x18')]);}logger['error'](_0x7c0e('0x12'),_0x23f78d,_0x299c93[_0x7c0e('0x17')][_0x7c0e('0x18')]);return _0x19c785(_0x299c93['error'][_0x7c0e('0x18')]);}else{logger['info'](_0x7c0e('0x12'),_0x23f78d,'request\x20sent');_0x19c785(_0x299c93[_0x7c0e('0x19')]['message']);}})[_0x7c0e('0x1a')](function(_0x14cf18){logger[_0x7c0e('0x17')](_0x7c0e('0x12'),_0x23f78d,_0x14cf18);_0x4910e8(_0x14cf18);});});}exports[_0x7c0e('0x1b')]=function(_0xd2f42b){var _0x1a1de7=this;return new Promise(function(_0x598850,_0x31540f){return db[_0x7c0e('0x1c')]['findAll']({'raw':_0xd2f42b[_0x7c0e('0x1d')]?_0xd2f42b[_0x7c0e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0xd2f42b[_0x7c0e('0x1d')]?_0xd2f42b['options'][_0x7c0e('0x1e')]||null:null,'attributes':_0xd2f42b['options']?_0xd2f42b['options'][_0x7c0e('0x1f')]||null:null,'limit':_0xd2f42b[_0x7c0e('0x1d')]?_0xd2f42b[_0x7c0e('0x1d')]['limit']||null:null,'include':_0xd2f42b[_0x7c0e('0x1d')]?_0xd2f42b[_0x7c0e('0x1d')][_0x7c0e('0x20')]?_[_0x7c0e('0x21')](_0xd2f42b[_0x7c0e('0x1d')][_0x7c0e('0x20')],function(_0x584205){return{'model':db[_0x584205['model']],'as':_0x584205['as'],'attributes':_0x584205[_0x7c0e('0x1f')],'include':_0x584205[_0x7c0e('0x20')]?_[_0x7c0e('0x21')](_0x584205[_0x7c0e('0x20')],function(_0x31873f){return{'model':db[_0x31873f['model']],'as':_0x31873f['as'],'attributes':_0x31873f[_0x7c0e('0x1f')],'include':_0x31873f[_0x7c0e('0x20')]?_[_0x7c0e('0x21')](_0x31873f[_0x7c0e('0x20')],function(_0xb95146){return{'model':db[_0xb95146[_0x7c0e('0x22')]],'as':_0xb95146['as'],'attributes':_0xb95146['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c0e('0x10')](function(_0x5128df){logger[_0x7c0e('0x11')](_0x7c0e('0x1b'),_0xd2f42b);logger[_0x7c0e('0x13')](_0x7c0e('0x1b'),_0xd2f42b,JSON[_0x7c0e('0x16')](_0x5128df));_0x598850(_0x5128df);})[_0x7c0e('0x1a')](function(_0x197c44){logger[_0x7c0e('0x17')](_0x7c0e('0x1b'),_0x197c44[_0x7c0e('0x18')],_0xd2f42b);_0x31540f(_0x1a1de7[_0x7c0e('0x17')](0x1f4,_0x197c44[_0x7c0e('0x18')]));});});};exports[_0x7c0e('0x23')]=function(_0x5ec975){var _0x570be3=this;return new Promise(function(_0x5438e4,_0xbe21dd){return db['SmsQueue'][_0x7c0e('0x24')]({'raw':_0x5ec975[_0x7c0e('0x1d')]?_0x5ec975[_0x7c0e('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x5ec975[_0x7c0e('0x1d')]?_0x5ec975['options']['where']||null:null,'attributes':_0x5ec975[_0x7c0e('0x1d')]?_0x5ec975['options']['attributes']||null:null,'include':_0x5ec975[_0x7c0e('0x1d')]?_0x5ec975['options'][_0x7c0e('0x20')]?_[_0x7c0e('0x21')](_0x5ec975['options']['include'],function(_0x4b183a){return{'model':db[_0x4b183a['model']],'as':_0x4b183a['as'],'attributes':_0x4b183a[_0x7c0e('0x1f')],'include':_0x4b183a[_0x7c0e('0x20')]?_['map'](_0x4b183a['include'],function(_0x3bb4a4){return{'model':db[_0x3bb4a4['model']],'as':_0x3bb4a4['as'],'attributes':_0x3bb4a4[_0x7c0e('0x1f')],'include':_0x3bb4a4['include']?_[_0x7c0e('0x21')](_0x3bb4a4[_0x7c0e('0x20')],function(_0x29ad33){return{'model':db[_0x29ad33['model']],'as':_0x29ad33['as'],'attributes':_0x29ad33['attributes']};}):[]};}):[]};}):[]:[]})[_0x7c0e('0x10')](function(_0x508041){logger['info'](_0x7c0e('0x23'),_0x5ec975);logger[_0x7c0e('0x13')]('ShowSmsQueue',_0x5ec975,JSON['stringify'](_0x508041));_0x5438e4(_0x508041);})[_0x7c0e('0x1a')](function(_0xa6d736){logger[_0x7c0e('0x17')](_0x7c0e('0x23'),_0xa6d736[_0x7c0e('0x18')],_0x5ec975);_0xbe21dd(_0x570be3[_0x7c0e('0x17')](0x1f4,_0xa6d736[_0x7c0e('0x18')]));});});};
\ No newline at end of file
index e649417..b131f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b5e=['length','smsQueue:','save','remove','update','removeListener','register'];(function(_0x143274,_0x3cdcb0){var _0x281aa5=function(_0x194e90){while(--_0x194e90){_0x143274['push'](_0x143274['shift']());}};_0x281aa5(++_0x3cdcb0);}(_0x8b5e,0x136));var _0xe8b5=function(_0x55077d,_0x5e153c){_0x55077d=_0x55077d-0x0;var _0x8eb585=_0x8b5e[_0x55077d];return _0x8eb585;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xe8b5('0x0'),_0xe8b5('0x1'),_0xe8b5('0x2')];function createListener(_0x221eed,_0x352e37){return function(_0x9ba18){_0x352e37['emit'](_0x221eed,_0x9ba18);};}function removeListener(_0x14d529,_0x4e2d4d){return function(){SmsQueueEvents[_0xe8b5('0x3')](_0x14d529,_0x4e2d4d);};}exports[_0xe8b5('0x4')]=function(_0x464042){for(var _0x135b9c=0x0,_0x53e2de=events[_0xe8b5('0x5')];_0x135b9c<_0x53e2de;_0x135b9c++){var _0x10e20d=events[_0x135b9c];var _0x3000b9=createListener(_0xe8b5('0x6')+_0x10e20d,_0x464042);SmsQueueEvents['on'](_0x10e20d,_0x3000b9);}};
\ No newline at end of file
+var _0x50f0=['remove','update','length','smsQueue:','save'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x50f0,0xd1));var _0x050f=function(_0x1f3aec,_0x24c18e){_0x1f3aec=_0x1f3aec-0x0;var _0x409f0d=_0x50f0[_0x1f3aec];return _0x409f0d;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x050f('0x0'),_0x050f('0x1'),_0x050f('0x2')];function createListener(_0x3d7a5d,_0x4255f6){return function(_0x540c54){_0x4255f6['emit'](_0x3d7a5d,_0x540c54);};}function removeListener(_0x4b0e63,_0x26a203){return function(){SmsQueueEvents['removeListener'](_0x4b0e63,_0x26a203);};}exports['register']=function(_0xf91793){for(var _0x126d7f=0x0,_0xc887db=events[_0x050f('0x3')];_0x126d7f<_0xc887db;_0x126d7f++){var _0x1f9c2e=events[_0x126d7f];var _0x4bb112=createListener(_0x050f('0x4')+_0x1f9c2e,_0xf91793);SmsQueueEvents['on'](_0x1f9c2e,_0x4bb112);}};
\ No newline at end of file
index f6a32c2..056d18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac22=['./smsQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1db4b0,_0xfb1f37){var _0x37c4c1=function(_0x4314dd){while(--_0x4314dd){_0x1db4b0['push'](_0x1db4b0['shift']());}};_0x37c4c1(++_0xfb1f37);}(_0xac22,0x138));var _0x2ac2=function(_0x53fa17,_0x109e56){_0x53fa17=_0x53fa17-0x0;var _0x50f67f=_0xac22[_0x53fa17];return _0x50f67f;};'use strict';var multer=require('multer');var util=require(_0x2ac2('0x0'));var path=require(_0x2ac2('0x1'));var timeout=require(_0x2ac2('0x2'));var express=require(_0x2ac2('0x3'));var router=express[_0x2ac2('0x4')]();var fs_extra=require(_0x2ac2('0x5'));var auth=require(_0x2ac2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ac2('0x7'));var controller=require(_0x2ac2('0x8'));router[_0x2ac2('0x9')]('/',auth['isAuthenticated'](),controller[_0x2ac2('0xa')]);router[_0x2ac2('0x9')]('/describe',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xc')]);router[_0x2ac2('0x9')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller[_0x2ac2('0xe')]);router[_0x2ac2('0xf')]('/',auth[_0x2ac2('0xb')](),controller[_0x2ac2('0x10')]);router[_0x2ac2('0x11')](_0x2ac2('0xd'),auth[_0x2ac2('0xb')](),controller['update']);router[_0x2ac2('0x12')](_0x2ac2('0xd'),auth['isAuthenticated'](),controller[_0x2ac2('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xebf4=['delete','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','show','isAuthenticated','create','put','update'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0xebf4,0xe3));var _0x4ebf=function(_0x542850,_0x272d61){_0x542850=_0x542850-0x0;var _0x3a56c5=_0xebf4[_0x542850];return _0x3a56c5;};'use strict';var multer=require(_0x4ebf('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4ebf('0x1'));var router=express[_0x4ebf('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4ebf('0x3'));var interaction=require(_0x4ebf('0x4'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x4ebf('0x5')]('/',auth['isAuthenticated'](),controller[_0x4ebf('0x6')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x4ebf('0x5')](_0x4ebf('0x7'),auth['isAuthenticated'](),controller[_0x4ebf('0x8')]);router['post']('/',auth[_0x4ebf('0x9')](),controller[_0x4ebf('0xa')]);router[_0x4ebf('0xb')](_0x4ebf('0x7'),auth[_0x4ebf('0x9')](),controller[_0x4ebf('0xc')]);router[_0x4ebf('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x4ebf('0xe')]=router;
\ No newline at end of file
index 2dc159a..548b0b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1c6=['DATE','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf1c6,0x145));var _0x6f1c=function(_0x55c66d,_0x4a8054){_0x55c66d=_0x55c66d-0x0;var _0x4faa7f=_0xf1c6[_0x55c66d];return _0x4faa7f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x6f1c('0x0')]={'uniqueid':{'type':Sequelize[_0x6f1c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x6f1c('0x1')]},'joinAt':{'type':Sequelize[_0x6f1c('0x2')]},'leaveAt':{'type':Sequelize[_0x6f1c('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x6f1c('0x1')]}};
\ No newline at end of file
+var _0x1031=['STRING','DATE','moment','sequelize'];(function(_0x1910fb,_0x37b4f3){var _0x1d6a06=function(_0x59fdaa){while(--_0x59fdaa){_0x1910fb['push'](_0x1910fb['shift']());}};_0x1d6a06(++_0x37b4f3);}(_0x1031,0x16a));var _0x1103=function(_0x1c0991,_0x4f22d2){_0x1c0991=_0x1c0991-0x0;var _0x5034de=_0x1031[_0x1c0991];return _0x5034de;};'use strict';var moment=require(_0x1103('0x0'));var Sequelize=require(_0x1103('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x1103('0x2')]},'joinAt':{'type':Sequelize[_0x1103('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x1103('0x3')]},'reason':{'type':Sequelize[_0x1103('0x2')]}};
\ No newline at end of file
index 97bca60..07d8bfc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd975=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','catch','show','keys','include','options','create','update','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x37ae26,_0x2ecd70){var _0x1b1902=function(_0x5a6ae0){while(--_0x5a6ae0){_0x37ae26['push'](_0x37ae26['shift']());}};_0x1b1902(++_0x2ecd70);}(_0xd975,0x8d));var _0x5d97=function(_0x4d8ece,_0x79865b){_0x4d8ece=_0x4d8ece-0x0;var _0x1ea0f8=_0xd975[_0x4d8ece];return _0x1ea0f8;};'use strict';var emlformat=require(_0x5d97('0x0'));var rimraf=require(_0x5d97('0x1'));var zipdir=require(_0x5d97('0x2'));var jsonpatch=require(_0x5d97('0x3'));var rp=require(_0x5d97('0x4'));var moment=require(_0x5d97('0x5'));var BPromise=require(_0x5d97('0x6'));var Mustache=require(_0x5d97('0x7'));var util=require(_0x5d97('0x8'));var path=require(_0x5d97('0x9'));var sox=require(_0x5d97('0xa'));var csv=require('to-csv');var ejs=require(_0x5d97('0xb'));var fs=require('fs');var fs_extra=require(_0x5d97('0xc'));var _=require(_0x5d97('0xd'));var squel=require(_0x5d97('0xe'));var crypto=require(_0x5d97('0xf'));var jsforce=require(_0x5d97('0x10'));var deskjs=require(_0x5d97('0x11'));var toCsv=require(_0x5d97('0x12'));var querystring=require(_0x5d97('0x13'));var Papa=require('papaparse');var Redis=require(_0x5d97('0x14'));var authService=require(_0x5d97('0x15'));var qs=require(_0x5d97('0x16'));var as=require(_0x5d97('0x17'));var hardwareService=require(_0x5d97('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0x5d97('0x19'));var config=require(_0x5d97('0x1a'));var licenseUtil=require(_0x5d97('0x1b'));var db=require(_0x5d97('0x1c'))['db'];function respondWithStatusCode(_0x3cf6fa,_0x156d56){_0x156d56=_0x156d56||0xcc;return function(_0x383de8){if(_0x383de8){return _0x3cf6fa['sendStatus'](_0x156d56);}return _0x3cf6fa[_0x5d97('0x1d')](_0x156d56)[_0x5d97('0x1e')]();};}function respondWithResult(_0x407f14,_0x39befe){_0x39befe=_0x39befe||0xc8;return function(_0x1483c5){if(_0x1483c5){return _0x407f14[_0x5d97('0x1d')](_0x39befe)[_0x5d97('0x1f')](_0x1483c5);}};}function respondWithFilteredResult(_0x3d7afe,_0x5108e5){return function(_0x2009d1){if(_0x2009d1){var _0x2b8735=typeof _0x5108e5[_0x5d97('0x20')]===_0x5d97('0x21')&&typeof _0x5108e5['limit']===_0x5d97('0x21');var _0x126b1e=_0x2009d1[_0x5d97('0x22')];var _0x574aa0=_0x2b8735?0x0:_0x5108e5['offset'];var _0x1dee16=_0x2b8735?_0x2009d1[_0x5d97('0x22')]:_0x5108e5[_0x5d97('0x20')]+_0x5108e5[_0x5d97('0x23')];var _0x1e8852;if(_0x1dee16>=_0x126b1e){_0x1dee16=_0x126b1e;_0x1e8852=0xc8;}else{_0x1e8852=0xce;}_0x3d7afe[_0x5d97('0x1d')](_0x1e8852);return _0x3d7afe[_0x5d97('0x24')](_0x5d97('0x25'),_0x574aa0+'-'+_0x1dee16+'/'+_0x126b1e)['json'](_0x2009d1);}return null;};}function patchUpdates(_0x1be3b1){return function(_0xdc0f6e){try{jsonpatch[_0x5d97('0x26')](_0xdc0f6e,_0x1be3b1,!![]);}catch(_0x51018b){return BPromise[_0x5d97('0x27')](_0x51018b);}return _0xdc0f6e[_0x5d97('0x28')]();};}function saveUpdates(_0x1af8df,_0x106882){return function(_0x198403){if(_0x198403){return _0x198403['update'](_0x1af8df)['then'](function(_0x5d3480){return _0x5d3480;});}return null;};}function removeEntity(_0x34d312,_0x411603){return function(_0x2da733){if(_0x2da733){return _0x2da733[_0x5d97('0x29')]()[_0x5d97('0x2a')](function(){_0x34d312['status'](0xcc)[_0x5d97('0x1e')]();});}};}function handleEntityNotFound(_0x3fa7d7,_0x1546d8){return function(_0x25a819){if(!_0x25a819){_0x3fa7d7['sendStatus'](0x194);}return _0x25a819;};}function handleError(_0x27a525,_0x4cb220){_0x4cb220=_0x4cb220||0x1f4;return function(_0x20b7d9){logger[_0x5d97('0x2b')](_0x20b7d9[_0x5d97('0x2c')]);if(_0x20b7d9[_0x5d97('0x2d')]){delete _0x20b7d9['name'];}_0x27a525['status'](_0x4cb220)[_0x5d97('0x2e')](_0x20b7d9);};}exports[_0x5d97('0x2f')]=function(_0x3c85ad,_0x2dce53){var _0xaf0375={},_0x11f75e={},_0x419a9e={'count':0x0,'rows':[]};var _0x3b79b1=_[_0x5d97('0x30')](db[_0x5d97('0x31')][_0x5d97('0x32')],function(_0x1e1074){return{'name':_0x1e1074[_0x5d97('0x33')],'type':_0x1e1074[_0x5d97('0x34')][_0x5d97('0x35')]};});_0x11f75e[_0x5d97('0x36')]=_['map'](_0x3b79b1,'name');_0x11f75e[_0x5d97('0x37')]=_['keys'](_0x3c85ad['query']);_0x11f75e[_0x5d97('0x38')]=_[_0x5d97('0x39')](_0x11f75e['model'],_0x11f75e[_0x5d97('0x37')]);_0xaf0375[_0x5d97('0x3a')]=_[_0x5d97('0x39')](_0x11f75e[_0x5d97('0x36')],qs['fields'](_0x3c85ad[_0x5d97('0x37')][_0x5d97('0x3b')]));_0xaf0375['attributes']=_0xaf0375[_0x5d97('0x3a')][_0x5d97('0x3c')]?_0xaf0375[_0x5d97('0x3a')]:_0x11f75e[_0x5d97('0x36')];if(!_0x3c85ad['query'][_0x5d97('0x3d')](_0x5d97('0x3e'))){_0xaf0375[_0x5d97('0x23')]=qs[_0x5d97('0x23')](_0x3c85ad[_0x5d97('0x37')][_0x5d97('0x23')]);_0xaf0375[_0x5d97('0x20')]=qs[_0x5d97('0x20')](_0x3c85ad['query'][_0x5d97('0x20')]);}_0xaf0375[_0x5d97('0x3f')]=qs[_0x5d97('0x40')](_0x3c85ad[_0x5d97('0x37')][_0x5d97('0x40')]);_0xaf0375[_0x5d97('0x41')]=qs[_0x5d97('0x38')](_['pick'](_0x3c85ad[_0x5d97('0x37')],_0x11f75e['filters']),_0x3b79b1);if(_0x3c85ad[_0x5d97('0x37')][_0x5d97('0x42')]){_0xaf0375[_0x5d97('0x41')]=_[_0x5d97('0x43')](_0xaf0375[_0x5d97('0x41')],{'$or':_[_0x5d97('0x30')](_0x3b79b1,function(_0x16cb4c){if(_0x16cb4c[_0x5d97('0x34')]!==_0x5d97('0x44')){var _0x1ce967={};_0x1ce967[_0x16cb4c[_0x5d97('0x2d')]]={'$like':'%'+_0x3c85ad[_0x5d97('0x37')][_0x5d97('0x42')]+'%'};return _0x1ce967;}})});}_0xaf0375=_['merge']({},_0xaf0375,_0x3c85ad['options']);var _0x3be2bf={'where':_0xaf0375[_0x5d97('0x41')]};return db[_0x5d97('0x31')][_0x5d97('0x22')](_0x3be2bf)[_0x5d97('0x2a')](function(_0x1e224d){_0x419a9e[_0x5d97('0x22')]=_0x1e224d;if(_0x3c85ad['query'][_0x5d97('0x45')]){_0xaf0375['include']=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0xaf0375);})[_0x5d97('0x2a')](function(_0x524ad){_0x419a9e['rows']=_0x524ad;return _0x419a9e;})[_0x5d97('0x2a')](respondWithFilteredResult(_0x2dce53,_0xaf0375))[_0x5d97('0x46')](handleError(_0x2dce53,null));};exports[_0x5d97('0x47')]=function(_0x2d475c,_0x2ed1bb){var _0x473d92={'raw':!![],'where':{'id':_0x2d475c['params']['id']}},_0x1a3393={};_0x1a3393[_0x5d97('0x36')]=_[_0x5d97('0x48')](db[_0x5d97('0x31')][_0x5d97('0x32')]);_0x1a3393[_0x5d97('0x37')]=_[_0x5d97('0x48')](_0x2d475c['query']);_0x1a3393[_0x5d97('0x38')]=_[_0x5d97('0x39')](_0x1a3393[_0x5d97('0x36')],_0x1a3393['query']);_0x473d92['attributes']=_['intersection'](_0x1a3393[_0x5d97('0x36')],qs[_0x5d97('0x3b')](_0x2d475c[_0x5d97('0x37')]['fields']));_0x473d92[_0x5d97('0x3a')]=_0x473d92[_0x5d97('0x3a')][_0x5d97('0x3c')]?_0x473d92[_0x5d97('0x3a')]:_0x1a3393[_0x5d97('0x36')];if(_0x2d475c['query'][_0x5d97('0x45')]){_0x473d92[_0x5d97('0x49')]=[{'all':!![]}];}_0x473d92=_[_0x5d97('0x43')]({},_0x473d92,_0x2d475c[_0x5d97('0x4a')]);return db[_0x5d97('0x31')]['find'](_0x473d92)[_0x5d97('0x2a')](handleEntityNotFound(_0x2ed1bb,null))[_0x5d97('0x2a')](respondWithResult(_0x2ed1bb,null))[_0x5d97('0x46')](handleError(_0x2ed1bb,null));};exports[_0x5d97('0x4b')]=function(_0x5c7d29,_0x325d8f){return db['SmsQueueReport'][_0x5d97('0x4b')](_0x5c7d29['body'],{})['then'](respondWithResult(_0x325d8f,0xc9))[_0x5d97('0x46')](handleError(_0x325d8f,null));};exports[_0x5d97('0x4c')]=function(_0x2009f0,_0x5403e5){if(_0x2009f0[_0x5d97('0x4d')]['id']){delete _0x2009f0[_0x5d97('0x4d')]['id'];}return db['SmsQueueReport'][_0x5d97('0x4e')]({'where':{'id':_0x2009f0[_0x5d97('0x4f')]['id']}})[_0x5d97('0x2a')](handleEntityNotFound(_0x5403e5,null))['then'](saveUpdates(_0x2009f0[_0x5d97('0x4d')],null))[_0x5d97('0x2a')](respondWithResult(_0x5403e5,null))[_0x5d97('0x46')](handleError(_0x5403e5,null));};exports[_0x5d97('0x29')]=function(_0x13d02e,_0x58e274){return db[_0x5d97('0x31')][_0x5d97('0x4e')]({'where':{'id':_0x13d02e[_0x5d97('0x4f')]['id']}})[_0x5d97('0x2a')](handleEntityNotFound(_0x58e274,null))[_0x5d97('0x2a')](removeEntity(_0x58e274,null))[_0x5d97('0x46')](handleError(_0x58e274,null));};exports[_0x5d97('0x50')]=function(_0x5d48c2,_0x8119a){return db[_0x5d97('0x31')][_0x5d97('0x50')]()[_0x5d97('0x2a')](respondWithResult(_0x8119a,null))['catch'](handleError(_0x8119a,null));};
\ No newline at end of file
+var _0x4bde=['stack','name','send','index','SmsQueueReport','fieldName','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','describe','zip-dir','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0x4bde,0x181));var _0xe4bd=function(_0x2fc032,_0x5227a4){_0x2fc032=_0x2fc032-0x0;var _0x238fb2=_0x4bde[_0x2fc032];return _0x238fb2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe4bd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe4bd('0x1'));var BPromise=require(_0xe4bd('0x2'));var Mustache=require(_0xe4bd('0x3'));var util=require(_0xe4bd('0x4'));var path=require(_0xe4bd('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe4bd('0x6'));var fs=require('fs');var fs_extra=require(_0xe4bd('0x7'));var _=require(_0xe4bd('0x8'));var squel=require('squel');var crypto=require(_0xe4bd('0x9'));var jsforce=require(_0xe4bd('0xa'));var deskjs=require(_0xe4bd('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe4bd('0xc'));var Redis=require('ioredis');var authService=require(_0xe4bd('0xd'));var qs=require(_0xe4bd('0xe'));var as=require(_0xe4bd('0xf'));var hardwareService=require(_0xe4bd('0x10'));var logger=require(_0xe4bd('0x11'))(_0xe4bd('0x12'));var utils=require(_0xe4bd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe4bd('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e506f,_0x5f2d5e){_0x5f2d5e=_0x5f2d5e||0xcc;return function(_0x96c221){if(_0x96c221){return _0x5e506f[_0xe4bd('0x15')](_0x5f2d5e);}return _0x5e506f[_0xe4bd('0x16')](_0x5f2d5e)[_0xe4bd('0x17')]();};}function respondWithResult(_0x2375b2,_0x110b0a){_0x110b0a=_0x110b0a||0xc8;return function(_0x5df937){if(_0x5df937){return _0x2375b2[_0xe4bd('0x16')](_0x110b0a)[_0xe4bd('0x18')](_0x5df937);}};}function respondWithFilteredResult(_0x143eb0,_0x4e03be){return function(_0x4389a6){if(_0x4389a6){var _0x554ee8=typeof _0x4e03be[_0xe4bd('0x19')]===_0xe4bd('0x1a')&&typeof _0x4e03be[_0xe4bd('0x1b')]==='undefined';var _0x149703=_0x4389a6[_0xe4bd('0x1c')];var _0x2a9490=_0x554ee8?0x0:_0x4e03be[_0xe4bd('0x19')];var _0x3a744a=_0x554ee8?_0x4389a6[_0xe4bd('0x1c')]:_0x4e03be['offset']+_0x4e03be[_0xe4bd('0x1b')];var _0x51eb1c;if(_0x3a744a>=_0x149703){_0x3a744a=_0x149703;_0x51eb1c=0xc8;}else{_0x51eb1c=0xce;}_0x143eb0[_0xe4bd('0x16')](_0x51eb1c);return _0x143eb0[_0xe4bd('0x1d')]('Content-Range',_0x2a9490+'-'+_0x3a744a+'/'+_0x149703)['json'](_0x4389a6);}return null;};}function patchUpdates(_0x263808){return function(_0x5208e3){try{jsonpatch['apply'](_0x5208e3,_0x263808,!![]);}catch(_0x4ab21d){return BPromise[_0xe4bd('0x1e')](_0x4ab21d);}return _0x5208e3[_0xe4bd('0x1f')]();};}function saveUpdates(_0x4ce6f1,_0x568bc1){return function(_0x32906c){if(_0x32906c){return _0x32906c[_0xe4bd('0x20')](_0x4ce6f1)[_0xe4bd('0x21')](function(_0x3dfcd5){return _0x3dfcd5;});}return null;};}function removeEntity(_0x25f31d,_0x345bc1){return function(_0x1acdd6){if(_0x1acdd6){return _0x1acdd6[_0xe4bd('0x22')]()['then'](function(){_0x25f31d[_0xe4bd('0x16')](0xcc)[_0xe4bd('0x17')]();});}};}function handleEntityNotFound(_0x1c03a9,_0x464980){return function(_0x1f2e5b){if(!_0x1f2e5b){_0x1c03a9[_0xe4bd('0x15')](0x194);}return _0x1f2e5b;};}function handleError(_0x2395e0,_0x558d96){_0x558d96=_0x558d96||0x1f4;return function(_0x125eee){logger['error'](_0x125eee[_0xe4bd('0x23')]);if(_0x125eee[_0xe4bd('0x24')]){delete _0x125eee[_0xe4bd('0x24')];}_0x2395e0[_0xe4bd('0x16')](_0x558d96)[_0xe4bd('0x25')](_0x125eee);};}exports[_0xe4bd('0x26')]=function(_0xfc9695,_0x298085){var _0x57c43f={},_0x3dc82b={},_0x927e7={'count':0x0,'rows':[]};var _0x223576=_['map'](db[_0xe4bd('0x27')]['rawAttributes'],function(_0x1f9b93){return{'name':_0x1f9b93[_0xe4bd('0x28')],'type':_0x1f9b93['type'][_0xe4bd('0x29')]};});_0x3dc82b['model']=_[_0xe4bd('0x2a')](_0x223576,'name');_0x3dc82b['query']=_['keys'](_0xfc9695[_0xe4bd('0x2b')]);_0x3dc82b[_0xe4bd('0x2c')]=_[_0xe4bd('0x2d')](_0x3dc82b['model'],_0x3dc82b['query']);_0x57c43f[_0xe4bd('0x2e')]=_['intersection'](_0x3dc82b[_0xe4bd('0x2f')],qs['fields'](_0xfc9695['query'][_0xe4bd('0x30')]));_0x57c43f['attributes']=_0x57c43f[_0xe4bd('0x2e')][_0xe4bd('0x31')]?_0x57c43f[_0xe4bd('0x2e')]:_0x3dc82b[_0xe4bd('0x2f')];if(!_0xfc9695[_0xe4bd('0x2b')][_0xe4bd('0x32')]('nolimit')){_0x57c43f[_0xe4bd('0x1b')]=qs['limit'](_0xfc9695[_0xe4bd('0x2b')]['limit']);_0x57c43f[_0xe4bd('0x19')]=qs[_0xe4bd('0x19')](_0xfc9695['query'][_0xe4bd('0x19')]);}_0x57c43f[_0xe4bd('0x33')]=qs[_0xe4bd('0x34')](_0xfc9695[_0xe4bd('0x2b')][_0xe4bd('0x34')]);_0x57c43f[_0xe4bd('0x35')]=qs[_0xe4bd('0x2c')](_['pick'](_0xfc9695[_0xe4bd('0x2b')],_0x3dc82b['filters']),_0x223576);if(_0xfc9695['query']['filter']){_0x57c43f[_0xe4bd('0x35')]=_[_0xe4bd('0x36')](_0x57c43f['where'],{'$or':_[_0xe4bd('0x2a')](_0x223576,function(_0x3e1215){if(_0x3e1215['type']!=='VIRTUAL'){var _0x486193={};_0x486193[_0x3e1215[_0xe4bd('0x24')]]={'$like':'%'+_0xfc9695[_0xe4bd('0x2b')][_0xe4bd('0x37')]+'%'};return _0x486193;}})});}_0x57c43f=_['merge']({},_0x57c43f,_0xfc9695[_0xe4bd('0x38')]);var _0x1e37cb={'where':_0x57c43f[_0xe4bd('0x35')]};return db[_0xe4bd('0x27')]['count'](_0x1e37cb)[_0xe4bd('0x21')](function(_0x155a3d){_0x927e7[_0xe4bd('0x1c')]=_0x155a3d;if(_0xfc9695[_0xe4bd('0x2b')][_0xe4bd('0x39')]){_0x57c43f[_0xe4bd('0x3a')]=[{'all':!![]}];}return db['SmsQueueReport'][_0xe4bd('0x3b')](_0x57c43f);})[_0xe4bd('0x21')](function(_0x5adcba){_0x927e7[_0xe4bd('0x3c')]=_0x5adcba;return _0x927e7;})[_0xe4bd('0x21')](respondWithFilteredResult(_0x298085,_0x57c43f))[_0xe4bd('0x3d')](handleError(_0x298085,null));};exports[_0xe4bd('0x3e')]=function(_0x59f791,_0x51fac6){var _0x5eb4e4={'raw':!![],'where':{'id':_0x59f791[_0xe4bd('0x3f')]['id']}},_0x2d5fde={};_0x2d5fde['model']=_['keys'](db['SmsQueueReport'][_0xe4bd('0x40')]);_0x2d5fde[_0xe4bd('0x2b')]=_[_0xe4bd('0x41')](_0x59f791[_0xe4bd('0x2b')]);_0x2d5fde[_0xe4bd('0x2c')]=_[_0xe4bd('0x2d')](_0x2d5fde['model'],_0x2d5fde[_0xe4bd('0x2b')]);_0x5eb4e4[_0xe4bd('0x2e')]=_[_0xe4bd('0x2d')](_0x2d5fde[_0xe4bd('0x2f')],qs[_0xe4bd('0x30')](_0x59f791[_0xe4bd('0x2b')][_0xe4bd('0x30')]));_0x5eb4e4[_0xe4bd('0x2e')]=_0x5eb4e4[_0xe4bd('0x2e')]['length']?_0x5eb4e4[_0xe4bd('0x2e')]:_0x2d5fde[_0xe4bd('0x2f')];if(_0x59f791[_0xe4bd('0x2b')][_0xe4bd('0x39')]){_0x5eb4e4[_0xe4bd('0x3a')]=[{'all':!![]}];}_0x5eb4e4=_['merge']({},_0x5eb4e4,_0x59f791[_0xe4bd('0x38')]);return db['SmsQueueReport']['find'](_0x5eb4e4)['then'](handleEntityNotFound(_0x51fac6,null))['then'](respondWithResult(_0x51fac6,null))[_0xe4bd('0x3d')](handleError(_0x51fac6,null));};exports[_0xe4bd('0x42')]=function(_0x1b7f47,_0x2d594f){return db[_0xe4bd('0x27')][_0xe4bd('0x42')](_0x1b7f47['body'],{})[_0xe4bd('0x21')](respondWithResult(_0x2d594f,0xc9))['catch'](handleError(_0x2d594f,null));};exports['update']=function(_0x5218d7,_0x1898af){if(_0x5218d7['body']['id']){delete _0x5218d7[_0xe4bd('0x43')]['id'];}return db[_0xe4bd('0x27')][_0xe4bd('0x44')]({'where':{'id':_0x5218d7[_0xe4bd('0x3f')]['id']}})[_0xe4bd('0x21')](handleEntityNotFound(_0x1898af,null))[_0xe4bd('0x21')](saveUpdates(_0x5218d7[_0xe4bd('0x43')],null))[_0xe4bd('0x21')](respondWithResult(_0x1898af,null))[_0xe4bd('0x3d')](handleError(_0x1898af,null));};exports['destroy']=function(_0x18a335,_0x1494a9){return db[_0xe4bd('0x27')]['find']({'where':{'id':_0x18a335['params']['id']}})[_0xe4bd('0x21')](handleEntityNotFound(_0x1494a9,null))[_0xe4bd('0x21')](removeEntity(_0x1494a9,null))['catch'](handleError(_0x1494a9,null));};exports[_0xe4bd('0x45')]=function(_0x5d0629,_0x53c1de){return db[_0xe4bd('0x27')][_0xe4bd('0x45')]()[_0xe4bd('0x21')](respondWithResult(_0x53c1de,null))[_0xe4bd('0x3d')](handleError(_0x53c1de,null));};
\ No newline at end of file
index e353217..3365c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5af381,_0x2a7263){var _0x48527d=function(_0x4afe97){while(--_0x4afe97){_0x5af381['push'](_0x5af381['shift']());}};_0x48527d(++_0x2a7263);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x17aaa8,_0x277dd3){var _0x772fd5=function(_0x46e5d1){while(--_0x46e5d1){_0x17aaa8['push'](_0x17aaa8['shift']());}};_0x772fd5(++_0x277dd3);}(_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 logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index b7e6fe4..4e666aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fb7=['raw','then','CreateSmsQueueReport','UpdateSmsQueueReport','update','body','where','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SmsQueueReport','create','options'];(function(_0xdb27ca,_0xf439ed){var _0x146897=function(_0x28c1e6){while(--_0x28c1e6){_0xdb27ca['push'](_0xdb27ca['shift']());}};_0x146897(++_0xf439ed);}(_0x9fb7,0x111));var _0x79fb=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9fb7[_0x4fde08];return _0x12e725;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x79fb('0x0'));var BPromise=require(_0x79fb('0x1'));var rs=require(_0x79fb('0x2'));var fs=require('fs');var Redis=require(_0x79fb('0x3'));var db=require(_0x79fb('0x4'))['db'];var utils=require(_0x79fb('0x5'));var logger=require(_0x79fb('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x79fb('0x7'));var client=jayson[_0x79fb('0x8')][_0x79fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ff33b,_0x201c9c,_0x1689c8){return new BPromise(function(_0x554f75,_0x48c172){return client[_0x79fb('0xa')](_0x3ff33b,_0x1689c8)['then'](function(_0x28949e){logger[_0x79fb('0xb')](_0x79fb('0xc'),_0x201c9c,_0x79fb('0xd'));logger[_0x79fb('0xe')](_0x79fb('0xf'),_0x201c9c,_0x79fb('0xd'),JSON[_0x79fb('0x10')](_0x28949e));if(_0x28949e['error']){if(_0x28949e[_0x79fb('0x11')][_0x79fb('0x12')]===0x1f4){logger[_0x79fb('0x11')](_0x79fb('0xc'),_0x201c9c,_0x28949e[_0x79fb('0x11')][_0x79fb('0x13')]);return _0x48c172(_0x28949e[_0x79fb('0x11')][_0x79fb('0x13')]);}logger['error'](_0x79fb('0xc'),_0x201c9c,_0x28949e[_0x79fb('0x11')]['message']);return _0x554f75(_0x28949e[_0x79fb('0x11')][_0x79fb('0x13')]);}else{logger[_0x79fb('0xb')](_0x79fb('0xc'),_0x201c9c,_0x79fb('0xd'));_0x554f75(_0x28949e['result'][_0x79fb('0x13')]);}})[_0x79fb('0x14')](function(_0x3ed36b){logger[_0x79fb('0x11')](_0x79fb('0xc'),_0x201c9c,_0x3ed36b);_0x48c172(_0x3ed36b);});});}exports['CreateSmsQueueReport']=function(_0x1c97b8){var _0xc14a4d=this;return new Promise(function(_0x31828f,_0x543ee8){return db[_0x79fb('0x15')][_0x79fb('0x16')](_0x1c97b8['body'],{'raw':_0x1c97b8['options']?_0x1c97b8[_0x79fb('0x17')][_0x79fb('0x18')]===undefined?!![]:![]:!![]})[_0x79fb('0x19')](function(_0x178968){logger[_0x79fb('0xb')]('CreateSmsQueueReport',_0x1c97b8);logger['debug'](_0x79fb('0x1a'),_0x1c97b8,JSON[_0x79fb('0x10')](_0x178968));_0x31828f(_0x178968);})[_0x79fb('0x14')](function(_0xf48276){logger['error'](_0x79fb('0x1a'),_0xf48276[_0x79fb('0x13')],_0x1c97b8);_0x543ee8(_0xc14a4d[_0x79fb('0x11')](0x1f4,_0xf48276[_0x79fb('0x13')]));});});};exports[_0x79fb('0x1b')]=function(_0x30dc1e){var _0x594203=this;return new Promise(function(_0x1e8e26,_0xc3fff5){return db[_0x79fb('0x15')][_0x79fb('0x1c')](_0x30dc1e[_0x79fb('0x1d')],{'raw':_0x30dc1e[_0x79fb('0x17')]?_0x30dc1e[_0x79fb('0x17')][_0x79fb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30dc1e['options']?_0x30dc1e[_0x79fb('0x17')][_0x79fb('0x1e')]||null:null,'attributes':_0x30dc1e[_0x79fb('0x17')]?_0x30dc1e['options'][_0x79fb('0x1f')]||null:null,'limit':_0x30dc1e[_0x79fb('0x17')]?_0x30dc1e[_0x79fb('0x17')][_0x79fb('0x20')]||null:null})['then'](function(_0x1d2911){logger[_0x79fb('0xb')](_0x79fb('0x1b'),_0x30dc1e);logger[_0x79fb('0xe')](_0x79fb('0x1b'),_0x30dc1e,JSON[_0x79fb('0x10')](_0x1d2911));_0x1e8e26(_0x1d2911);})[_0x79fb('0x14')](function(_0x1a43c4){logger[_0x79fb('0x11')](_0x79fb('0x1b'),_0x1a43c4[_0x79fb('0x13')],_0x30dc1e);_0xc3fff5(_0x594203[_0x79fb('0x11')](0x1f4,_0x1a43c4[_0x79fb('0x13')]));});});};
\ No newline at end of file
+var _0x6141=['body','options','raw','debug','catch','SmsQueueReport','update','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateSmsQueueReport'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x6141,0x154));var _0x1614=function(_0x5750dc,_0x2b855c){_0x5750dc=_0x5750dc-0x0;var _0x40457a=_0x6141[_0x5750dc];return _0x40457a;};'use strict';var _=require(_0x1614('0x0'));var util=require(_0x1614('0x1'));var moment=require(_0x1614('0x2'));var BPromise=require(_0x1614('0x3'));var rs=require(_0x1614('0x4'));var fs=require('fs');var Redis=require(_0x1614('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1614('0x6'));var logger=require('../../config/logger')(_0x1614('0x7'));var config=require(_0x1614('0x8'));var jayson=require(_0x1614('0x9'));var client=jayson[_0x1614('0xa')][_0x1614('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x41534d,_0x57e760,_0x4c581c){return new BPromise(function(_0x42403a,_0x45124f){return client[_0x1614('0xc')](_0x41534d,_0x4c581c)[_0x1614('0xd')](function(_0x4a032e){logger[_0x1614('0xe')](_0x1614('0xf'),_0x57e760,_0x1614('0x10'));logger['debug']('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x57e760,_0x1614('0x10'),JSON[_0x1614('0x11')](_0x4a032e));if(_0x4a032e[_0x1614('0x12')]){if(_0x4a032e[_0x1614('0x12')][_0x1614('0x13')]===0x1f4){logger[_0x1614('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x57e760,_0x4a032e[_0x1614('0x12')][_0x1614('0x14')]);return _0x45124f(_0x4a032e[_0x1614('0x12')][_0x1614('0x14')]);}logger[_0x1614('0x12')](_0x1614('0xf'),_0x57e760,_0x4a032e[_0x1614('0x12')][_0x1614('0x14')]);return _0x42403a(_0x4a032e[_0x1614('0x12')][_0x1614('0x14')]);}else{logger[_0x1614('0xe')](_0x1614('0xf'),_0x57e760,_0x1614('0x10'));_0x42403a(_0x4a032e[_0x1614('0x15')][_0x1614('0x14')]);}})['catch'](function(_0x491487){logger[_0x1614('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x57e760,_0x491487);_0x45124f(_0x491487);});});}exports[_0x1614('0x16')]=function(_0x25020f){var _0x3b50ad=this;return new Promise(function(_0x39f3c2,_0x3c0c36){return db['SmsQueueReport']['create'](_0x25020f[_0x1614('0x17')],{'raw':_0x25020f[_0x1614('0x18')]?_0x25020f[_0x1614('0x18')][_0x1614('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x8be345){logger[_0x1614('0xe')](_0x1614('0x16'),_0x25020f);logger[_0x1614('0x1a')](_0x1614('0x16'),_0x25020f,JSON['stringify'](_0x8be345));_0x39f3c2(_0x8be345);})[_0x1614('0x1b')](function(_0x45b6ad){logger[_0x1614('0x12')](_0x1614('0x16'),_0x45b6ad[_0x1614('0x14')],_0x25020f);_0x3c0c36(_0x3b50ad['error'](0x1f4,_0x45b6ad['message']));});});};exports['UpdateSmsQueueReport']=function(_0xf46483){var _0x2218e2=this;return new Promise(function(_0x1c8bd8,_0x1051a3){return db[_0x1614('0x1c')][_0x1614('0x1d')](_0xf46483[_0x1614('0x17')],{'raw':_0xf46483[_0x1614('0x18')]?_0xf46483[_0x1614('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf46483[_0x1614('0x18')]?_0xf46483[_0x1614('0x18')]['where']||null:null,'attributes':_0xf46483[_0x1614('0x18')]?_0xf46483[_0x1614('0x18')][_0x1614('0x1e')]||null:null,'limit':_0xf46483['options']?_0xf46483['options'][_0x1614('0x1f')]||null:null})['then'](function(_0x2ee1a0){logger[_0x1614('0xe')](_0x1614('0x20'),_0xf46483);logger['debug']('UpdateSmsQueueReport',_0xf46483,JSON[_0x1614('0x11')](_0x2ee1a0));_0x1c8bd8(_0x2ee1a0);})[_0x1614('0x1b')](function(_0x4beff0){logger[_0x1614('0x12')](_0x1614('0x20'),_0x4beff0[_0x1614('0x14')],_0xf46483);_0x1051a3(_0x2218e2[_0x1614('0x12')](0x1f4,_0x4beff0[_0x1614('0x14')]));});});};
\ No newline at end of file
index a1d495e..a72180f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cc=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0xf3cc[_0x38537f];return _0x141e23;};'use strict';var multer=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var path=require(_0xcf3c('0x2'));var timeout=require(_0xcf3c('0x3'));var express=require('express');var router=express[_0xcf3c('0x4')]();var fs_extra=require(_0xcf3c('0x5'));var auth=require(_0xcf3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf3c('0x7'));var controller=require(_0xcf3c('0x8'));router['get']('/',auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xa')]);router[_0xcf3c('0xb')](_0xcf3c('0xc'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xd')]);router[_0xcf3c('0xb')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcf3c('0x10')]);router[_0xcf3c('0x11')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0x12')]);router[_0xcf3c('0x13')](_0xcf3c('0xe'),auth[_0xcf3c('0x9')](),controller['destroy']);module[_0xcf3c('0x14')]=router;
\ No newline at end of file
+var _0x3c17=['Router','fs-extra','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','delete','destroy','multer','path','express'];(function(_0x345ce2,_0x330f6b){var _0x308670=function(_0x460dc9){while(--_0x460dc9){_0x345ce2['push'](_0x345ce2['shift']());}};_0x308670(++_0x330f6b);}(_0x3c17,0x1a1));var _0x73c1=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x3c17[_0x33032e];return _0x13316b;};'use strict';var multer=require(_0x73c1('0x0'));var util=require('util');var path=require(_0x73c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x73c1('0x2'));var router=express[_0x73c1('0x3')]();var fs_extra=require(_0x73c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var controller=require(_0x73c1('0x7'));router[_0x73c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x73c1('0x9')]);router['get'](_0x73c1('0xa'),auth[_0x73c1('0xb')](),controller[_0x73c1('0xc')]);router['get']('/:id',auth[_0x73c1('0xb')](),controller[_0x73c1('0xd')]);router[_0x73c1('0xe')]('/',auth[_0x73c1('0xb')](),controller[_0x73c1('0xf')]);router[_0x73c1('0x10')](_0x73c1('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x73c1('0x12')](_0x73c1('0x11'),auth[_0x73c1('0xb')](),controller[_0x73c1('0x13')]);module['exports']=router;
\ No newline at end of file
index 15c287b..209fbe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x8b631b,_0x386724){var _0x3e6832=function(_0x17a132){while(--_0x17a132){_0x8b631b['push'](_0x8b631b['shift']());}};_0x3e6832(++_0x386724);}(_0x34e8,0x12c));var _0x834e=function(_0x578a47,_0x3407e1){_0x578a47=_0x578a47-0x0;var _0x4b74cb=_0x34e8[_0x578a47];return _0x4b74cb;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0xa43ac6,_0x458311){var _0x2ae764=function(_0x398479){while(--_0x398479){_0xa43ac6['push'](_0xa43ac6['shift']());}};_0x2ae764(++_0x458311);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0xcb91[_0x274dd7];return _0x148829;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index e9bafa1..5a2e307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccaa=['fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x2cb9eb,_0x1c78e2){var _0x44151f=function(_0x478318){while(--_0x478318){_0x2cb9eb['push'](_0x2cb9eb['shift']());}};_0x44151f(++_0x1c78e2);}(_0xccaa,0x123));var _0xacca=function(_0x4b281a,_0x1733de){_0x4b281a=_0x4b281a-0x0;var _0x3149a7=_0xccaa[_0x4b281a];return _0x3149a7;};'use strict';var emlformat=require(_0xacca('0x0'));var rimraf=require(_0xacca('0x1'));var zipdir=require(_0xacca('0x2'));var jsonpatch=require(_0xacca('0x3'));var rp=require(_0xacca('0x4'));var moment=require(_0xacca('0x5'));var BPromise=require(_0xacca('0x6'));var Mustache=require(_0xacca('0x7'));var util=require(_0xacca('0x8'));var path=require(_0xacca('0x9'));var sox=require(_0xacca('0xa'));var csv=require(_0xacca('0xb'));var ejs=require(_0xacca('0xc'));var fs=require('fs');var fs_extra=require(_0xacca('0xd'));var _=require(_0xacca('0xe'));var squel=require(_0xacca('0xf'));var crypto=require('crypto');var jsforce=require(_0xacca('0x10'));var deskjs=require(_0xacca('0x11'));var toCsv=require(_0xacca('0xb'));var querystring=require(_0xacca('0x12'));var Papa=require('papaparse');var Redis=require(_0xacca('0x13'));var authService=require(_0xacca('0x14'));var qs=require(_0xacca('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacca('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xacca('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xacca('0x18'));var db=require(_0xacca('0x19'))['db'];function respondWithStatusCode(_0x2a4cb3,_0x1f76dc){_0x1f76dc=_0x1f76dc||0xcc;return function(_0x4379eb){if(_0x4379eb){return _0x2a4cb3[_0xacca('0x1a')](_0x1f76dc);}return _0x2a4cb3[_0xacca('0x1b')](_0x1f76dc)['end']();};}function respondWithResult(_0x368cce,_0x499f4e){_0x499f4e=_0x499f4e||0xc8;return function(_0x37006f){if(_0x37006f){return _0x368cce[_0xacca('0x1b')](_0x499f4e)[_0xacca('0x1c')](_0x37006f);}};}function respondWithFilteredResult(_0x4ee206,_0x21cacb){return function(_0x58efd4){if(_0x58efd4){var _0x294506=typeof _0x21cacb['offset']===_0xacca('0x1d')&&typeof _0x21cacb[_0xacca('0x1e')]===_0xacca('0x1d');var _0x85b30a=_0x58efd4[_0xacca('0x1f')];var _0x38ecd8=_0x294506?0x0:_0x21cacb['offset'];var _0x1f435d=_0x294506?_0x58efd4[_0xacca('0x1f')]:_0x21cacb[_0xacca('0x20')]+_0x21cacb[_0xacca('0x1e')];var _0x517316;if(_0x1f435d>=_0x85b30a){_0x1f435d=_0x85b30a;_0x517316=0xc8;}else{_0x517316=0xce;}_0x4ee206[_0xacca('0x1b')](_0x517316);return _0x4ee206[_0xacca('0x21')](_0xacca('0x22'),_0x38ecd8+'-'+_0x1f435d+'/'+_0x85b30a)[_0xacca('0x1c')](_0x58efd4);}return null;};}function patchUpdates(_0x1e6f93){return function(_0x260175){try{jsonpatch[_0xacca('0x23')](_0x260175,_0x1e6f93,!![]);}catch(_0x4943f5){return BPromise['reject'](_0x4943f5);}return _0x260175['save']();};}function saveUpdates(_0x22c1c6,_0x2ce21f){return function(_0x1ceeb8){if(_0x1ceeb8){return _0x1ceeb8[_0xacca('0x24')](_0x22c1c6)[_0xacca('0x25')](function(_0x52923e){return _0x52923e;});}return null;};}function removeEntity(_0x375e56,_0x310a08){return function(_0x31153f){if(_0x31153f){return _0x31153f[_0xacca('0x26')]()[_0xacca('0x25')](function(){_0x375e56['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7846,_0x237cd1){return function(_0x1d89c3){if(!_0x1d89c3){_0x2f7846[_0xacca('0x1a')](0x194);}return _0x1d89c3;};}function handleError(_0x297bd9,_0x36eef2){_0x36eef2=_0x36eef2||0x1f4;return function(_0x12aa7a){logger[_0xacca('0x27')](_0x12aa7a[_0xacca('0x28')]);if(_0x12aa7a[_0xacca('0x29')]){delete _0x12aa7a[_0xacca('0x29')];}_0x297bd9['status'](_0x36eef2)[_0xacca('0x2a')](_0x12aa7a);};}exports[_0xacca('0x2b')]=function(_0x1c8792,_0x69221e){var _0x2a6d19={},_0x3b90a3={},_0x1aea2c={'count':0x0,'rows':[]};var _0x4c1c3e=_[_0xacca('0x2c')](db[_0xacca('0x2d')]['rawAttributes'],function(_0x4baf2b){return{'name':_0x4baf2b[_0xacca('0x2e')],'type':_0x4baf2b[_0xacca('0x2f')][_0xacca('0x30')]};});_0x3b90a3['model']=_[_0xacca('0x2c')](_0x4c1c3e,'name');_0x3b90a3[_0xacca('0x31')]=_['keys'](_0x1c8792['query']);_0x3b90a3[_0xacca('0x32')]=_['intersection'](_0x3b90a3[_0xacca('0x33')],_0x3b90a3[_0xacca('0x31')]);_0x2a6d19[_0xacca('0x34')]=_[_0xacca('0x35')](_0x3b90a3[_0xacca('0x33')],qs[_0xacca('0x36')](_0x1c8792[_0xacca('0x31')][_0xacca('0x36')]));_0x2a6d19[_0xacca('0x34')]=_0x2a6d19[_0xacca('0x34')][_0xacca('0x37')]?_0x2a6d19['attributes']:_0x3b90a3[_0xacca('0x33')];if(!_0x1c8792[_0xacca('0x31')]['hasOwnProperty'](_0xacca('0x38'))){_0x2a6d19[_0xacca('0x1e')]=qs['limit'](_0x1c8792['query'][_0xacca('0x1e')]);_0x2a6d19[_0xacca('0x20')]=qs[_0xacca('0x20')](_0x1c8792[_0xacca('0x31')][_0xacca('0x20')]);}_0x2a6d19[_0xacca('0x39')]=qs[_0xacca('0x3a')](_0x1c8792[_0xacca('0x31')][_0xacca('0x3a')]);_0x2a6d19[_0xacca('0x3b')]=qs[_0xacca('0x32')](_['pick'](_0x1c8792[_0xacca('0x31')],_0x3b90a3[_0xacca('0x32')]),_0x4c1c3e);if(_0x1c8792[_0xacca('0x31')][_0xacca('0x3c')]){_0x2a6d19[_0xacca('0x3b')]=_[_0xacca('0x3d')](_0x2a6d19['where'],{'$or':_[_0xacca('0x2c')](_0x4c1c3e,function(_0x1ddb19){if(_0x1ddb19[_0xacca('0x2f')]!==_0xacca('0x3e')){var _0x4ffea4={};_0x4ffea4[_0x1ddb19[_0xacca('0x29')]]={'$like':'%'+_0x1c8792[_0xacca('0x31')]['filter']+'%'};return _0x4ffea4;}})});}_0x2a6d19=_[_0xacca('0x3d')]({},_0x2a6d19,_0x1c8792[_0xacca('0x3f')]);var _0xa02480={'where':_0x2a6d19[_0xacca('0x3b')]};return db['SmsTransferReport'][_0xacca('0x1f')](_0xa02480)[_0xacca('0x25')](function(_0x168a4b){_0x1aea2c['count']=_0x168a4b;if(_0x1c8792[_0xacca('0x31')][_0xacca('0x40')]){_0x2a6d19['include']=[{'all':!![]}];}return db[_0xacca('0x2d')][_0xacca('0x41')](_0x2a6d19);})[_0xacca('0x25')](function(_0x23d018){_0x1aea2c[_0xacca('0x42')]=_0x23d018;return _0x1aea2c;})[_0xacca('0x25')](respondWithFilteredResult(_0x69221e,_0x2a6d19))[_0xacca('0x43')](handleError(_0x69221e,null));};exports[_0xacca('0x44')]=function(_0x5d341e,_0x380e20){var _0x8db4bd={'raw':!![],'where':{'id':_0x5d341e['params']['id']}},_0xee06eb={};_0xee06eb[_0xacca('0x33')]=_[_0xacca('0x45')](db[_0xacca('0x2d')][_0xacca('0x46')]);_0xee06eb[_0xacca('0x31')]=_[_0xacca('0x45')](_0x5d341e[_0xacca('0x31')]);_0xee06eb[_0xacca('0x32')]=_[_0xacca('0x35')](_0xee06eb[_0xacca('0x33')],_0xee06eb['query']);_0x8db4bd['attributes']=_[_0xacca('0x35')](_0xee06eb[_0xacca('0x33')],qs[_0xacca('0x36')](_0x5d341e[_0xacca('0x31')][_0xacca('0x36')]));_0x8db4bd[_0xacca('0x34')]=_0x8db4bd[_0xacca('0x34')][_0xacca('0x37')]?_0x8db4bd[_0xacca('0x34')]:_0xee06eb[_0xacca('0x33')];if(_0x5d341e[_0xacca('0x31')][_0xacca('0x40')]){_0x8db4bd['include']=[{'all':!![]}];}_0x8db4bd=_[_0xacca('0x3d')]({},_0x8db4bd,_0x5d341e[_0xacca('0x3f')]);return db[_0xacca('0x2d')]['find'](_0x8db4bd)[_0xacca('0x25')](handleEntityNotFound(_0x380e20,null))[_0xacca('0x25')](respondWithResult(_0x380e20,null))['catch'](handleError(_0x380e20,null));};exports[_0xacca('0x47')]=function(_0x2a250a,_0x1c1b02){return db[_0xacca('0x2d')][_0xacca('0x47')](_0x2a250a[_0xacca('0x48')],{})[_0xacca('0x25')](respondWithResult(_0x1c1b02,0xc9))[_0xacca('0x43')](handleError(_0x1c1b02,null));};exports[_0xacca('0x24')]=function(_0x32cf71,_0x234382){if(_0x32cf71[_0xacca('0x48')]['id']){delete _0x32cf71[_0xacca('0x48')]['id'];}return db[_0xacca('0x2d')][_0xacca('0x49')]({'where':{'id':_0x32cf71['params']['id']}})['then'](handleEntityNotFound(_0x234382,null))[_0xacca('0x25')](saveUpdates(_0x32cf71[_0xacca('0x48')],null))['then'](respondWithResult(_0x234382,null))[_0xacca('0x43')](handleError(_0x234382,null));};exports[_0xacca('0x26')]=function(_0x4b6004,_0x37ea63){return db[_0xacca('0x2d')][_0xacca('0x49')]({'where':{'id':_0x4b6004[_0xacca('0x4a')]['id']}})[_0xacca('0x25')](handleEntityNotFound(_0x37ea63,null))[_0xacca('0x25')](removeEntity(_0x37ea63,null))['catch'](handleError(_0x37ea63,null));};exports[_0xacca('0x4b')]=function(_0x5e1c28,_0x3c0a53){return db[_0xacca('0x2d')][_0xacca('0x4b')]()['then'](respondWithResult(_0x3c0a53,null))[_0xacca('0x43')](handleError(_0x3c0a53,null));};
\ No newline at end of file
+var _0x5fae=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','end','sendStatus','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','catch','show','params','options','create','body','describe','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x2af326,_0x12fb47){var _0x1adfe3=function(_0x4ae2cc){while(--_0x4ae2cc){_0x2af326['push'](_0x2af326['shift']());}};_0x1adfe3(++_0x12fb47);}(_0x5fae,0x120));var _0xe5fa=function(_0x4b11c3,_0x4bbdb7){_0x4b11c3=_0x4b11c3-0x0;var _0x517ad5=_0x5fae[_0x4b11c3];return _0x517ad5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe5fa('0x0'));var jsonpatch=require(_0xe5fa('0x1'));var rp=require('request-promise');var moment=require(_0xe5fa('0x2'));var BPromise=require(_0xe5fa('0x3'));var Mustache=require(_0xe5fa('0x4'));var util=require(_0xe5fa('0x5'));var path=require(_0xe5fa('0x6'));var sox=require(_0xe5fa('0x7'));var csv=require(_0xe5fa('0x8'));var ejs=require(_0xe5fa('0x9'));var fs=require('fs');var fs_extra=require(_0xe5fa('0xa'));var _=require(_0xe5fa('0xb'));var squel=require(_0xe5fa('0xc'));var crypto=require(_0xe5fa('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe5fa('0xe'));var toCsv=require(_0xe5fa('0x8'));var querystring=require(_0xe5fa('0xf'));var Papa=require(_0xe5fa('0x10'));var Redis=require(_0xe5fa('0x11'));var authService=require(_0xe5fa('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe5fa('0x13'));var hardwareService=require(_0xe5fa('0x14'));var logger=require(_0xe5fa('0x15'))(_0xe5fa('0x16'));var utils=require('../../config/utils');var config=require(_0xe5fa('0x17'));var licenseUtil=require(_0xe5fa('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1060e,_0x1f0d44){_0x1f0d44=_0x1f0d44||0xcc;return function(_0x3564b0){if(_0x3564b0){return _0x1060e['sendStatus'](_0x1f0d44);}return _0x1060e[_0xe5fa('0x19')](_0x1f0d44)['end']();};}function respondWithResult(_0x127ccb,_0x254b8b){_0x254b8b=_0x254b8b||0xc8;return function(_0x288d9d){if(_0x288d9d){return _0x127ccb[_0xe5fa('0x19')](_0x254b8b)[_0xe5fa('0x1a')](_0x288d9d);}};}function respondWithFilteredResult(_0x57efc8,_0xa9ffe){return function(_0x4140b1){if(_0x4140b1){var _0x1e0efc=typeof _0xa9ffe[_0xe5fa('0x1b')]===_0xe5fa('0x1c')&&typeof _0xa9ffe[_0xe5fa('0x1d')]===_0xe5fa('0x1c');var _0x259a06=_0x4140b1[_0xe5fa('0x1e')];var _0xe1e466=_0x1e0efc?0x0:_0xa9ffe[_0xe5fa('0x1b')];var _0x13c5f6=_0x1e0efc?_0x4140b1[_0xe5fa('0x1e')]:_0xa9ffe[_0xe5fa('0x1b')]+_0xa9ffe[_0xe5fa('0x1d')];var _0x55656b;if(_0x13c5f6>=_0x259a06){_0x13c5f6=_0x259a06;_0x55656b=0xc8;}else{_0x55656b=0xce;}_0x57efc8[_0xe5fa('0x19')](_0x55656b);return _0x57efc8[_0xe5fa('0x1f')](_0xe5fa('0x20'),_0xe1e466+'-'+_0x13c5f6+'/'+_0x259a06)[_0xe5fa('0x1a')](_0x4140b1);}return null;};}function patchUpdates(_0x7a7f9){return function(_0xe1d5f6){try{jsonpatch['apply'](_0xe1d5f6,_0x7a7f9,!![]);}catch(_0x44a4c7){return BPromise[_0xe5fa('0x21')](_0x44a4c7);}return _0xe1d5f6['save']();};}function saveUpdates(_0x3c5cea,_0x59de83){return function(_0x35b634){if(_0x35b634){return _0x35b634['update'](_0x3c5cea)[_0xe5fa('0x22')](function(_0x4c6e25){return _0x4c6e25;});}return null;};}function removeEntity(_0x2be03f,_0x192d58){return function(_0x4bce57){if(_0x4bce57){return _0x4bce57[_0xe5fa('0x23')]()[_0xe5fa('0x22')](function(){_0x2be03f[_0xe5fa('0x19')](0xcc)[_0xe5fa('0x24')]();});}};}function handleEntityNotFound(_0x5558f3,_0xdfaddc){return function(_0x23d857){if(!_0x23d857){_0x5558f3[_0xe5fa('0x25')](0x194);}return _0x23d857;};}function handleError(_0x3fc866,_0x521726){_0x521726=_0x521726||0x1f4;return function(_0x392d3a){logger['error'](_0x392d3a[_0xe5fa('0x26')]);if(_0x392d3a['name']){delete _0x392d3a[_0xe5fa('0x27')];}_0x3fc866[_0xe5fa('0x19')](_0x521726)[_0xe5fa('0x28')](_0x392d3a);};}exports[_0xe5fa('0x29')]=function(_0x2c387f,_0x3db49a){var _0x5eb905={},_0x3f1130={},_0x41f736={'count':0x0,'rows':[]};var _0x2d419a=_['map'](db[_0xe5fa('0x2a')][_0xe5fa('0x2b')],function(_0x158105){return{'name':_0x158105[_0xe5fa('0x2c')],'type':_0x158105[_0xe5fa('0x2d')]['key']};});_0x3f1130['model']=_[_0xe5fa('0x2e')](_0x2d419a,'name');_0x3f1130[_0xe5fa('0x2f')]=_[_0xe5fa('0x30')](_0x2c387f[_0xe5fa('0x2f')]);_0x3f1130[_0xe5fa('0x31')]=_[_0xe5fa('0x32')](_0x3f1130['model'],_0x3f1130['query']);_0x5eb905[_0xe5fa('0x33')]=_['intersection'](_0x3f1130[_0xe5fa('0x34')],qs[_0xe5fa('0x35')](_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x35')]));_0x5eb905[_0xe5fa('0x33')]=_0x5eb905[_0xe5fa('0x33')][_0xe5fa('0x36')]?_0x5eb905[_0xe5fa('0x33')]:_0x3f1130[_0xe5fa('0x34')];if(!_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x37')](_0xe5fa('0x38'))){_0x5eb905['limit']=qs[_0xe5fa('0x1d')](_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x1d')]);_0x5eb905[_0xe5fa('0x1b')]=qs['offset'](_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x1b')]);}_0x5eb905[_0xe5fa('0x39')]=qs['sort'](_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x3a')]);_0x5eb905[_0xe5fa('0x3b')]=qs[_0xe5fa('0x31')](_[_0xe5fa('0x3c')](_0x2c387f[_0xe5fa('0x2f')],_0x3f1130['filters']),_0x2d419a);if(_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x3d')]){_0x5eb905['where']=_['merge'](_0x5eb905['where'],{'$or':_['map'](_0x2d419a,function(_0xa2f0cf){if(_0xa2f0cf[_0xe5fa('0x2d')]!==_0xe5fa('0x3e')){var _0x51a01a={};_0x51a01a[_0xa2f0cf[_0xe5fa('0x27')]]={'$like':'%'+_0x2c387f[_0xe5fa('0x2f')][_0xe5fa('0x3d')]+'%'};return _0x51a01a;}})});}_0x5eb905=_[_0xe5fa('0x3f')]({},_0x5eb905,_0x2c387f['options']);var _0xcc831d={'where':_0x5eb905[_0xe5fa('0x3b')]};return db[_0xe5fa('0x2a')][_0xe5fa('0x1e')](_0xcc831d)[_0xe5fa('0x22')](function(_0x4b5c71){_0x41f736[_0xe5fa('0x1e')]=_0x4b5c71;if(_0x2c387f['query'][_0xe5fa('0x40')]){_0x5eb905[_0xe5fa('0x41')]=[{'all':!![]}];}return db[_0xe5fa('0x2a')]['findAll'](_0x5eb905);})[_0xe5fa('0x22')](function(_0x3330a5){_0x41f736['rows']=_0x3330a5;return _0x41f736;})[_0xe5fa('0x22')](respondWithFilteredResult(_0x3db49a,_0x5eb905))[_0xe5fa('0x42')](handleError(_0x3db49a,null));};exports[_0xe5fa('0x43')]=function(_0x514167,_0x20d6fb){var _0x1a95cb={'raw':!![],'where':{'id':_0x514167[_0xe5fa('0x44')]['id']}},_0x1cf0a0={};_0x1cf0a0[_0xe5fa('0x34')]=_['keys'](db['SmsTransferReport']['rawAttributes']);_0x1cf0a0['query']=_['keys'](_0x514167[_0xe5fa('0x2f')]);_0x1cf0a0[_0xe5fa('0x31')]=_[_0xe5fa('0x32')](_0x1cf0a0['model'],_0x1cf0a0['query']);_0x1a95cb[_0xe5fa('0x33')]=_[_0xe5fa('0x32')](_0x1cf0a0[_0xe5fa('0x34')],qs[_0xe5fa('0x35')](_0x514167[_0xe5fa('0x2f')][_0xe5fa('0x35')]));_0x1a95cb[_0xe5fa('0x33')]=_0x1a95cb[_0xe5fa('0x33')][_0xe5fa('0x36')]?_0x1a95cb[_0xe5fa('0x33')]:_0x1cf0a0['model'];if(_0x514167[_0xe5fa('0x2f')][_0xe5fa('0x40')]){_0x1a95cb[_0xe5fa('0x41')]=[{'all':!![]}];}_0x1a95cb=_[_0xe5fa('0x3f')]({},_0x1a95cb,_0x514167[_0xe5fa('0x45')]);return db[_0xe5fa('0x2a')]['find'](_0x1a95cb)[_0xe5fa('0x22')](handleEntityNotFound(_0x20d6fb,null))['then'](respondWithResult(_0x20d6fb,null))['catch'](handleError(_0x20d6fb,null));};exports[_0xe5fa('0x46')]=function(_0x2d2753,_0x248cf7){return db[_0xe5fa('0x2a')]['create'](_0x2d2753[_0xe5fa('0x47')],{})[_0xe5fa('0x22')](respondWithResult(_0x248cf7,0xc9))[_0xe5fa('0x42')](handleError(_0x248cf7,null));};exports['update']=function(_0x1e4a0f,_0x4a79b5){if(_0x1e4a0f[_0xe5fa('0x47')]['id']){delete _0x1e4a0f[_0xe5fa('0x47')]['id'];}return db[_0xe5fa('0x2a')]['find']({'where':{'id':_0x1e4a0f[_0xe5fa('0x44')]['id']}})[_0xe5fa('0x22')](handleEntityNotFound(_0x4a79b5,null))[_0xe5fa('0x22')](saveUpdates(_0x1e4a0f[_0xe5fa('0x47')],null))[_0xe5fa('0x22')](respondWithResult(_0x4a79b5,null))['catch'](handleError(_0x4a79b5,null));};exports['destroy']=function(_0x18039d,_0x2561e1){return db[_0xe5fa('0x2a')]['find']({'where':{'id':_0x18039d[_0xe5fa('0x44')]['id']}})['then'](handleEntityNotFound(_0x2561e1,null))['then'](removeEntity(_0x2561e1,null))[_0xe5fa('0x42')](handleError(_0x2561e1,null));};exports['describe']=function(_0x55d544,_0x314585){return db[_0xe5fa('0x2a')][_0xe5fa('0x48')]()['then'](respondWithResult(_0x314585,null))[_0xe5fa('0x42')](handleError(_0x314585,null));};
\ No newline at end of file
index 2b0673a..cfe0309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x657f=['rimraf','../../config/environment','exports','define','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0x2fe78e,_0x5456eb){var _0x240ea8=function(_0x8047fb){while(--_0x8047fb){_0x2fe78e['push'](_0x2fe78e['shift']());}};_0x240ea8(++_0x5456eb);}(_0x657f,0xaa));var _0xf657=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x657f[_0x62c958];return _0x57ec61;};'use strict';var _=require('lodash');var util=require(_0xf657('0x0'));var logger=require('../../config/logger')(_0xf657('0x1'));var moment=require(_0xf657('0x2'));var BPromise=require(_0xf657('0x3'));var rp=require(_0xf657('0x4'));var fs=require('fs');var path=require(_0xf657('0x5'));var rimraf=require(_0xf657('0x6'));var config=require(_0xf657('0x7'));var attributes=require('./smsTransferReport.attributes');module[_0xf657('0x8')]=function(_0x585003,_0x40515e){return _0x585003[_0xf657('0x9')]('SmsTransferReport',attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xf657('0xa'),'fields':[_0xf657('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5292=['rimraf','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','lodash','util','api','bluebird','request-promise','path'];(function(_0x1fede1,_0x39db39){var _0x4476a6=function(_0x3d4133){while(--_0x3d4133){_0x1fede1['push'](_0x1fede1['shift']());}};_0x4476a6(++_0x39db39);}(_0x5292,0xf7));var _0x2529=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0x5292[_0x528575];return _0x3063b7;};'use strict';var _=require(_0x2529('0x0'));var util=require(_0x2529('0x1'));var logger=require('../../config/logger')(_0x2529('0x2'));var moment=require('moment');var BPromise=require(_0x2529('0x3'));var rp=require(_0x2529('0x4'));var fs=require('fs');var path=require(_0x2529('0x5'));var rimraf=require(_0x2529('0x6'));var config=require('../../config/environment');var attributes=require(_0x2529('0x7'));module['exports']=function(_0x4c9b4c,_0x4e7a9e){return _0x4c9b4c[_0x2529('0x8')](_0x2529('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2529('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 453dcd2..15eb813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d9=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54dfbd,_0x56856f){var _0x4f539d=function(_0x25bf53){while(--_0x25bf53){_0x54dfbd['push'](_0x54dfbd['shift']());}};_0x4f539d(++_0x56856f);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x941d('0x0'));var util=require(_0x941d('0x1'));var moment=require(_0x941d('0x2'));var BPromise=require(_0x941d('0x3'));var rs=require(_0x941d('0x4'));var fs=require('fs');var Redis=require(_0x941d('0x5'));var db=require(_0x941d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x941d('0x7'))(_0x941d('0x8'));var config=require('../../config/environment');var jayson=require(_0x941d('0x9'));var client=jayson[_0x941d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x179094,_0x5b100e,_0x3825df){return new BPromise(function(_0xa9021c,_0x33b259){return client[_0x941d('0xb')](_0x179094,_0x3825df)[_0x941d('0xc')](function(_0x546a1a){logger[_0x941d('0xd')](_0x941d('0xe'),_0x5b100e,_0x941d('0xf'));logger[_0x941d('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x5b100e,_0x941d('0xf'),JSON[_0x941d('0x11')](_0x546a1a));if(_0x546a1a[_0x941d('0x12')]){if(_0x546a1a[_0x941d('0x12')][_0x941d('0x13')]===0x1f4){logger[_0x941d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5b100e,_0x546a1a[_0x941d('0x12')]['message']);return _0x33b259(_0x546a1a['error'][_0x941d('0x14')]);}logger[_0x941d('0x12')](_0x941d('0xe'),_0x5b100e,_0x546a1a[_0x941d('0x12')][_0x941d('0x14')]);return _0xa9021c(_0x546a1a[_0x941d('0x12')][_0x941d('0x14')]);}else{logger[_0x941d('0xd')](_0x941d('0xe'),_0x5b100e,_0x941d('0xf'));_0xa9021c(_0x546a1a[_0x941d('0x15')]['message']);}})[_0x941d('0x16')](function(_0x244d96){logger[_0x941d('0x12')](_0x941d('0xe'),_0x5b100e,_0x244d96);_0x33b259(_0x244d96);});});}
\ No newline at end of file
+var _0x4491=['rpc','jayson/promise','http','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xff245e,_0x3302bd){var _0x119a86=function(_0x2b3579){while(--_0x2b3579){_0xff245e['push'](_0xff245e['shift']());}};_0x119a86(++_0x3302bd);}(_0x4491,0x1bb));var _0x1449=function(_0x52247e,_0x213914){_0x52247e=_0x52247e-0x0;var _0x53409c=_0x4491[_0x52247e];return _0x53409c;};'use strict';var _=require(_0x1449('0x0'));var util=require('util');var moment=require(_0x1449('0x1'));var BPromise=require('bluebird');var rs=require(_0x1449('0x2'));var fs=require('fs');var Redis=require(_0x1449('0x3'));var db=require(_0x1449('0x4'))['db'];var utils=require(_0x1449('0x5'));var logger=require(_0x1449('0x6'))(_0x1449('0x7'));var config=require('../../config/environment');var jayson=require(_0x1449('0x8'));var client=jayson['client'][_0x1449('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5dfe4c,_0x3b79bd,_0x2f4189){return new BPromise(function(_0x10e119,_0x3bc237){return client['request'](_0x5dfe4c,_0x2f4189)[_0x1449('0xa')](function(_0x2ea86d){logger['info'](_0x1449('0xb'),_0x3b79bd,_0x1449('0xc'));logger['debug'](_0x1449('0xd'),_0x3b79bd,_0x1449('0xc'),JSON['stringify'](_0x2ea86d));if(_0x2ea86d[_0x1449('0xe')]){if(_0x2ea86d['error']['code']===0x1f4){logger[_0x1449('0xe')](_0x1449('0xb'),_0x3b79bd,_0x2ea86d[_0x1449('0xe')][_0x1449('0xf')]);return _0x3bc237(_0x2ea86d[_0x1449('0xe')][_0x1449('0xf')]);}logger[_0x1449('0xe')](_0x1449('0xb'),_0x3b79bd,_0x2ea86d[_0x1449('0xe')][_0x1449('0xf')]);return _0x10e119(_0x2ea86d[_0x1449('0xe')][_0x1449('0xf')]);}else{logger[_0x1449('0x10')](_0x1449('0xb'),_0x3b79bd,_0x1449('0xc'));_0x10e119(_0x2ea86d['result'][_0x1449('0xf')]);}})[_0x1449('0x11')](function(_0x4a3508){logger[_0x1449('0xe')](_0x1449('0xb'),_0x3b79bd,_0x4a3508);_0x3bc237(_0x4a3508);});});}
\ No newline at end of file
index d71bb6f..f68bb16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09e5=['server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','post','single','file','create','/:id','update','delete','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','download','diskStorage','join','root'];(function(_0x14c00f,_0x11b192){var _0x19fbda=function(_0xf9caa4){while(--_0xf9caa4){_0x14c00f['push'](_0x14c00f['shift']());}};_0x19fbda(++_0x11b192);}(_0x09e5,0xb7));var _0x509e=function(_0x541803,_0x3d5f1b){_0x541803=_0x541803-0x0;var _0x204265=_0x09e5[_0x541803];return _0x204265;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x509e('0x0'));var router=express[_0x509e('0x1')]();var fs_extra=require(_0x509e('0x2'));var auth=require(_0x509e('0x3'));var interaction=require(_0x509e('0x4'));var config=require(_0x509e('0x5'));var controller=require('./sound.controller');router[_0x509e('0x6')]('/',auth[_0x509e('0x7')](),controller['index']);router[_0x509e('0x6')]('/:id',auth[_0x509e('0x7')](),controller[_0x509e('0x8')]);router[_0x509e('0x6')]('/:id/download',auth[_0x509e('0x7')](),controller[_0x509e('0x9')]);var upload=multer({'storage':multer[_0x509e('0xa')]({'destination':function(_0x15bd72,_0x5852c6,_0x447c60){_0x447c60(null,path[_0x509e('0xb')](config[_0x509e('0xc')],_0x509e('0xd')));},'filename':function(_0x583621,_0x598dc1,_0x137829){_0x598dc1[_0x509e('0xe')]=_0x598dc1[_0x509e('0xe')][_0x509e('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x137829(null,util[_0x509e('0x10')](_0x509e('0x11'),path['basename'](_0x598dc1[_0x509e('0xe')],path[_0x509e('0x12')](_0x598dc1[_0x509e('0xe')])),Date[_0x509e('0x13')](),path[_0x509e('0x12')](_0x598dc1[_0x509e('0xe')])));}})});router[_0x509e('0x14')]('/',upload[_0x509e('0x15')](_0x509e('0x16')),controller[_0x509e('0x17')]);router['put'](_0x509e('0x18'),auth[_0x509e('0x7')](),controller[_0x509e('0x19')]);router['delete'](_0x509e('0x18'),auth[_0x509e('0x7')](),controller[_0x509e('0x1a')]);module[_0x509e('0x1b')]=router;
\ No newline at end of file
+var _0xad2b=['./sound.controller','get','isAuthenticated','index','show','diskStorage','join','server/files/sounds/original/','originalname','replace','%s-%s%s','basename','now','file','create','/:id','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x6c5c66,_0x220b59){var _0xe845b9=function(_0x1a7e88){while(--_0x1a7e88){_0x6c5c66['push'](_0x6c5c66['shift']());}};_0xe845b9(++_0x220b59);}(_0xad2b,0xda));var _0xbad2=function(_0x411e9d,_0x3f5b3c){_0x411e9d=_0x411e9d-0x0;var _0x56d84d=_0xad2b[_0x411e9d];return _0x56d84d;};'use strict';var multer=require(_0xbad2('0x0'));var util=require(_0xbad2('0x1'));var path=require(_0xbad2('0x2'));var timeout=require('connect-timeout');var express=require(_0xbad2('0x3'));var router=express['Router']();var fs_extra=require(_0xbad2('0x4'));var auth=require(_0xbad2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbad2('0x6'));var controller=require(_0xbad2('0x7'));router[_0xbad2('0x8')]('/',auth[_0xbad2('0x9')](),controller[_0xbad2('0xa')]);router['get']('/:id',auth[_0xbad2('0x9')](),controller[_0xbad2('0xb')]);router[_0xbad2('0x8')]('/:id/download',auth[_0xbad2('0x9')](),controller['download']);var upload=multer({'storage':multer[_0xbad2('0xc')]({'destination':function(_0x577b1c,_0x1d69ac,_0x160fcc){_0x160fcc(null,path[_0xbad2('0xd')](config['root'],_0xbad2('0xe')));},'filename':function(_0x31c020,_0x59fe2b,_0x3eb102){_0x59fe2b[_0xbad2('0xf')]=_0x59fe2b[_0xbad2('0xf')][_0xbad2('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3eb102(null,util['format'](_0xbad2('0x11'),path[_0xbad2('0x12')](_0x59fe2b['originalname'],path['extname'](_0x59fe2b['originalname'])),Date[_0xbad2('0x13')](),path['extname'](_0x59fe2b[_0xbad2('0xf')])));}})});router['post']('/',upload['single'](_0xbad2('0x14')),controller[_0xbad2('0x15')]);router['put'](_0xbad2('0x16'),auth['isAuthenticated'](),controller['update']);router[_0xbad2('0x17')](_0xbad2('0x16'),auth[_0xbad2('0x9')](),controller[_0xbad2('0x17')]);module[_0xbad2('0x18')]=router;
\ No newline at end of file
index ab2037b..018e5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x56ac=['INTEGER','sequelize','exports','STRING','name','FLOAT','BIGINT'];(function(_0x13cfcd,_0x2c3d5d){var _0x3b4a88=function(_0x27ca3c){while(--_0x27ca3c){_0x13cfcd['push'](_0x13cfcd['shift']());}};_0x3b4a88(++_0x2c3d5d);}(_0x56ac,0xef));var _0xc56a=function(_0x5c04fa,_0x45c19f){_0x5c04fa=_0x5c04fa-0x0;var _0x2ff2df=_0x56ac[_0x5c04fa];return _0x2ff2df;};'use strict';var Sequelize=require(_0xc56a('0x0'));module[_0xc56a('0x1')]={'name':{'type':Sequelize[_0xc56a('0x2')],'unique':_0xc56a('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc56a('0x2')]},'display_name':{'type':Sequelize[_0xc56a('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xc56a('0x2')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xc56a('0x4')]},'original_sampleCount':{'type':Sequelize[_0xc56a('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xc56a('0x5')]},'original_sampleRate':{'type':Sequelize[_0xc56a('0x6')]},'converted_format':{'type':Sequelize[_0xc56a('0x2')]},'converted_duration':{'type':Sequelize[_0xc56a('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xc56a('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc56a('0x6')]},'converted_bitRate':{'type':Sequelize[_0xc56a('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xc56a('0x6')]}};
\ No newline at end of file
+var _0x2b1f=['sequelize','exports','STRING','name','FLOAT','INTEGER','BIGINT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2b1f,0x149));var _0xf2b1=function(_0x14017d,_0x346fdf){_0x14017d=_0x14017d-0x0;var _0x37d4aa=_0x2b1f[_0x14017d];return _0x37d4aa;};'use strict';var Sequelize=require(_0xf2b1('0x0'));module[_0xf2b1('0x1')]={'name':{'type':Sequelize[_0xf2b1('0x2')],'unique':_0xf2b1('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0xf2b1('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xf2b1('0x2')]},'original_format':{'type':Sequelize[_0xf2b1('0x2')]},'original_duration':{'type':Sequelize[_0xf2b1('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf2b1('0x5')]},'original_bitRate':{'type':Sequelize[_0xf2b1('0x6')]},'original_sampleRate':{'type':Sequelize[_0xf2b1('0x5')]},'converted_format':{'type':Sequelize[_0xf2b1('0x2')]},'converted_duration':{'type':Sequelize[_0xf2b1('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf2b1('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 0ed14fd..f4bea46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f0a=['originalname','basename','filename','extname','substring','wav','server/files/sounds/original','info','chmodSync','0777','transcode','unlinkSync','send','original_duration','duration','original_sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','sampleCount','converted_channelCount','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','Sounds','UserProfileResource','destroy','error','stack','name','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','catch','show','params','length','find','save_name','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','download','format','%s.%s','converted_format','create','file'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3f0a,0x18a));var _0xa3f0=function(_0x4bbb8d,_0xa3dc2){_0x4bbb8d=_0x4bbb8d-0x0;var _0x330148=_0x3f0a[_0x4bbb8d];return _0x330148;};'use strict';var emlformat=require(_0xa3f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa3f0('0x1'));var jsonpatch=require(_0xa3f0('0x2'));var rp=require('request-promise');var moment=require(_0xa3f0('0x3'));var BPromise=require(_0xa3f0('0x4'));var Mustache=require(_0xa3f0('0x5'));var util=require(_0xa3f0('0x6'));var path=require(_0xa3f0('0x7'));var sox=require(_0xa3f0('0x8'));var csv=require(_0xa3f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3f0('0xa'));var _=require(_0xa3f0('0xb'));var squel=require(_0xa3f0('0xc'));var crypto=require(_0xa3f0('0xd'));var jsforce=require(_0xa3f0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa3f0('0x9'));var querystring=require(_0xa3f0('0xf'));var Papa=require(_0xa3f0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa3f0('0x11'));var as=require(_0xa3f0('0x12'));var hardwareService=require(_0xa3f0('0x13'));var logger=require(_0xa3f0('0x14'))(_0xa3f0('0x15'));var utils=require(_0xa3f0('0x16'));var config=require(_0xa3f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa3f0('0x18'))['db'];function respondWithStatusCode(_0x3f7a8e,_0x35851a){_0x35851a=_0x35851a||0xcc;return function(_0x2683e1){if(_0x2683e1){return _0x3f7a8e[_0xa3f0('0x19')](_0x35851a);}return _0x3f7a8e[_0xa3f0('0x1a')](_0x35851a)[_0xa3f0('0x1b')]();};}function respondWithResult(_0x30bd8b,_0x4e740c){_0x4e740c=_0x4e740c||0xc8;return function(_0x53b4ce){if(_0x53b4ce){return _0x30bd8b[_0xa3f0('0x1a')](_0x4e740c)[_0xa3f0('0x1c')](_0x53b4ce);}};}function respondWithFilteredResult(_0x4151e5,_0x2310ec){return function(_0x542fe3){if(_0x542fe3){var _0x136a4a=typeof _0x2310ec[_0xa3f0('0x1d')]===_0xa3f0('0x1e')&&typeof _0x2310ec[_0xa3f0('0x1f')]==='undefined';var _0xbb422a=_0x542fe3[_0xa3f0('0x20')];var _0x392951=_0x136a4a?0x0:_0x2310ec[_0xa3f0('0x1d')];var _0x45f0fd=_0x136a4a?_0x542fe3['count']:_0x2310ec[_0xa3f0('0x1d')]+_0x2310ec[_0xa3f0('0x1f')];var _0x127da4;if(_0x45f0fd>=_0xbb422a){_0x45f0fd=_0xbb422a;_0x127da4=0xc8;}else{_0x127da4=0xce;}_0x4151e5['status'](_0x127da4);return _0x4151e5[_0xa3f0('0x21')]('Content-Range',_0x392951+'-'+_0x45f0fd+'/'+_0xbb422a)[_0xa3f0('0x1c')](_0x542fe3);}return null;};}function patchUpdates(_0x2b6669){return function(_0x58dfb3){try{jsonpatch[_0xa3f0('0x22')](_0x58dfb3,_0x2b6669,!![]);}catch(_0x5be455){return BPromise[_0xa3f0('0x23')](_0x5be455);}return _0x58dfb3[_0xa3f0('0x24')]();};}function saveUpdates(_0x39fa89,_0x579236){return function(_0x2c3af2){if(_0x2c3af2){return _0x2c3af2[_0xa3f0('0x25')](_0x39fa89)[_0xa3f0('0x26')](function(_0x276dc8){return _0x276dc8;});}return null;};}function removeEntity(_0x4e22b5,_0x1d3459){return function(_0x1a9bd0){if(_0x1a9bd0){return _0x1a9bd0['destroy']()[_0xa3f0('0x26')](function(){var _0x533935=_0x1a9bd0['get']({'plain':!![]});var _0x25d07f=_0xa3f0('0x27');return db[_0xa3f0('0x28')][_0xa3f0('0x29')]({'where':{'type':_0x25d07f,'resourceId':_0x533935['id']}})['then'](function(){return _0x1a9bd0;});})[_0xa3f0('0x26')](function(){_0x4e22b5[_0xa3f0('0x1a')](0xcc)[_0xa3f0('0x1b')]();});}};}function handleEntityNotFound(_0x58c02f,_0x5899c3){return function(_0x1ea3e1){if(!_0x1ea3e1){_0x58c02f['sendStatus'](0x194);}return _0x1ea3e1;};}function handleError(_0x2df70d,_0x27920f){_0x27920f=_0x27920f||0x1f4;return function(_0x3d7518){logger[_0xa3f0('0x2a')](_0x3d7518[_0xa3f0('0x2b')]);if(_0x3d7518[_0xa3f0('0x2c')]){delete _0x3d7518[_0xa3f0('0x2c')];}_0x2df70d[_0xa3f0('0x1a')](_0x27920f)['send'](_0x3d7518);};}exports[_0xa3f0('0x2d')]=function(_0x9cff66,_0x3412a3){var _0x729e9a={},_0x2b90dd={},_0x2997ae={'count':0x0,'rows':[]};var _0x315016=_[_0xa3f0('0x2e')](db[_0xa3f0('0x2f')][_0xa3f0('0x30')],function(_0x8e1c60){return{'name':_0x8e1c60[_0xa3f0('0x31')],'type':_0x8e1c60[_0xa3f0('0x32')]['key']};});_0x2b90dd[_0xa3f0('0x33')]=_[_0xa3f0('0x2e')](_0x315016,_0xa3f0('0x2c'));_0x2b90dd[_0xa3f0('0x34')]=_[_0xa3f0('0x35')](_0x9cff66[_0xa3f0('0x34')]);_0x2b90dd[_0xa3f0('0x36')]=_['intersection'](_0x2b90dd[_0xa3f0('0x33')],_0x2b90dd[_0xa3f0('0x34')]);_0x729e9a[_0xa3f0('0x37')]=_[_0xa3f0('0x38')](_0x2b90dd['model'],qs[_0xa3f0('0x39')](_0x9cff66['query']['fields']));_0x729e9a['attributes']=_0x729e9a[_0xa3f0('0x37')]['length']?_0x729e9a['attributes']:_0x2b90dd[_0xa3f0('0x33')];if(!_0x9cff66[_0xa3f0('0x34')][_0xa3f0('0x3a')](_0xa3f0('0x3b'))){_0x729e9a[_0xa3f0('0x1f')]=qs[_0xa3f0('0x1f')](_0x9cff66['query'][_0xa3f0('0x1f')]);_0x729e9a['offset']=qs[_0xa3f0('0x1d')](_0x9cff66['query'][_0xa3f0('0x1d')]);}_0x729e9a[_0xa3f0('0x3c')]=qs[_0xa3f0('0x3d')](_0x9cff66[_0xa3f0('0x34')][_0xa3f0('0x3d')]);_0x729e9a[_0xa3f0('0x3e')]=qs[_0xa3f0('0x36')](_[_0xa3f0('0x3f')](_0x9cff66[_0xa3f0('0x34')],_0x2b90dd[_0xa3f0('0x36')]),_0x315016);if(_0x9cff66['query'][_0xa3f0('0x40')]){_0x729e9a[_0xa3f0('0x3e')]=_['merge'](_0x729e9a[_0xa3f0('0x3e')],{'$or':_[_0xa3f0('0x2e')](_0x315016,function(_0x21eb41){if(_0x21eb41[_0xa3f0('0x32')]!=='VIRTUAL'){var _0x2a9aad={};_0x2a9aad[_0x21eb41[_0xa3f0('0x2c')]]={'$like':'%'+_0x9cff66[_0xa3f0('0x34')][_0xa3f0('0x40')]+'%'};return _0x2a9aad;}})});}_0x729e9a=_['merge']({},_0x729e9a,_0x9cff66['options']);var _0x115908={'where':_0x729e9a[_0xa3f0('0x3e')]};return db['Sound'][_0xa3f0('0x20')](_0x115908)['then'](function(_0x4415cd){_0x2997ae[_0xa3f0('0x20')]=_0x4415cd;if(_0x9cff66['query'][_0xa3f0('0x41')]){_0x729e9a[_0xa3f0('0x42')]=[{'all':!![]}];}return db[_0xa3f0('0x2f')][_0xa3f0('0x43')](_0x729e9a);})[_0xa3f0('0x26')](function(_0x24b02b){_0x2997ae['rows']=_0x24b02b;return _0x2997ae;})[_0xa3f0('0x26')](respondWithFilteredResult(_0x3412a3,_0x729e9a))[_0xa3f0('0x44')](handleError(_0x3412a3,null));};exports[_0xa3f0('0x45')]=function(_0x2a620c,_0x3ec2cd){var _0xc2f54b={'raw':!![],'where':{'id':_0x2a620c[_0xa3f0('0x46')]['id']}},_0xe32160={};_0xe32160[_0xa3f0('0x33')]=_[_0xa3f0('0x35')](db[_0xa3f0('0x2f')][_0xa3f0('0x30')]);_0xe32160['query']=_[_0xa3f0('0x35')](_0x2a620c[_0xa3f0('0x34')]);_0xe32160['filters']=_[_0xa3f0('0x38')](_0xe32160[_0xa3f0('0x33')],_0xe32160[_0xa3f0('0x34')]);_0xc2f54b[_0xa3f0('0x37')]=_[_0xa3f0('0x38')](_0xe32160[_0xa3f0('0x33')],qs['fields'](_0x2a620c['query']['fields']));_0xc2f54b[_0xa3f0('0x37')]=_0xc2f54b[_0xa3f0('0x37')][_0xa3f0('0x47')]?_0xc2f54b[_0xa3f0('0x37')]:_0xe32160[_0xa3f0('0x33')];if(_0x2a620c[_0xa3f0('0x34')][_0xa3f0('0x41')]){_0xc2f54b['include']=[{'all':!![]}];}_0xc2f54b=_['merge']({},_0xc2f54b,_0x2a620c['options']);return db[_0xa3f0('0x2f')][_0xa3f0('0x48')](_0xc2f54b)['then'](handleEntityNotFound(_0x3ec2cd,null))[_0xa3f0('0x26')](respondWithResult(_0x3ec2cd,null))[_0xa3f0('0x44')](handleError(_0x3ec2cd,null));};exports['download']=function(_0x3ac67d,_0x2ce34e,_0x29f065){return db[_0xa3f0('0x2f')][_0xa3f0('0x48')]({'where':{'id':_0x3ac67d[_0xa3f0('0x46')]['id']},'attributes':[_0xa3f0('0x2c'),_0xa3f0('0x49'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0x2ce34e,null))[_0xa3f0('0x26')](function(_0x429013){if(_0x429013){if(!fs[_0xa3f0('0x4a')](path[_0xa3f0('0x4b')](config[_0xa3f0('0x4c')],_0xa3f0('0x4d'),_0x429013[_0xa3f0('0x49')]+'.'+_0x429013['converted_format']))){throw new db['Sequelize'][(_0xa3f0('0x4e'))](_0xa3f0('0x4f'));}return _0x2ce34e[_0xa3f0('0x50')](path[_0xa3f0('0x4b')](config[_0xa3f0('0x4c')],_0xa3f0('0x4d'),util[_0xa3f0('0x51')](_0xa3f0('0x52'),_0x429013['save_name'],_0x429013['converted_format'])),util[_0xa3f0('0x51')](_0xa3f0('0x52'),_0x429013[_0xa3f0('0x2c')],_0x429013[_0xa3f0('0x53')]));}return null;})[_0xa3f0('0x44')](handleError(_0x2ce34e,null));};exports[_0xa3f0('0x54')]=function(_0x334c13,_0x470f1c,_0xc6faa){var _0x4691b6={'name':path['basename'](_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x56')],path['extname'](_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x56')])),'save_name':path[_0xa3f0('0x57')](_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x58')],path[_0xa3f0('0x59')](_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x58')])),'original_format':path['extname'](_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x56')])[_0xa3f0('0x5a')](0x1),'converted_format':_0xa3f0('0x5b')};var _0xe7631c=path[_0xa3f0('0x4b')](config['root'],_0xa3f0('0x5c'),_0x334c13[_0xa3f0('0x55')][_0xa3f0('0x58')]);var _0x16d39b=path[_0xa3f0('0x4b')](config['root'],_0xa3f0('0x4d'),util[_0xa3f0('0x51')]('%s.%s',path[_0xa3f0('0x57')](_0x334c13['file'][_0xa3f0('0x58')],path[_0xa3f0('0x59')](_0x334c13[_0xa3f0('0x55')]['filename'])),_0x4691b6[_0xa3f0('0x53')]));logger[_0xa3f0('0x5d')]('Sound\x20upload\x20filepath:\x20%s',_0xe7631c);logger[_0xa3f0('0x5d')]('Sound\x20upload\x20destination:\x20%s',_0x16d39b);try{fs[_0xa3f0('0x5e')](_0xe7631c,parseInt(_0xa3f0('0x5f'),0x8));var _0x52c0b4=sox[_0xa3f0('0x60')](_0xe7631c,_0x16d39b,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x52c0b4['on'](_0xa3f0('0x2a'),function(_0x3e80de){fs[_0xa3f0('0x61')](_0xe7631c);_0x470f1c['status'](0x1f4)[_0xa3f0('0x62')](_0x3e80de);});_0x52c0b4['on']('src',function(_0x518ee7){_0x4691b6[_0xa3f0('0x63')]=isNaN(_0x518ee7[_0xa3f0('0x64')])?null:_0x518ee7[_0xa3f0('0x64')]*0x3e8;_0x4691b6[_0xa3f0('0x65')]=isNaN(_0x518ee7['sampleCount'])?null:_0x518ee7['sampleCount'];_0x4691b6['original_channelCount']=isNaN(_0x518ee7['channelCount'])?null:_0x518ee7[_0xa3f0('0x66')];_0x4691b6['original_bitRate']=isNaN(_0x518ee7[_0xa3f0('0x67')])?null:_0x518ee7[_0xa3f0('0x67')];_0x4691b6[_0xa3f0('0x68')]=isNaN(_0x518ee7[_0xa3f0('0x69')])?null:_0x518ee7[_0xa3f0('0x69')];});_0x52c0b4['on']('dest',function(_0x5cc6f3){_0x4691b6[_0xa3f0('0x6a')]=isNaN(_0x5cc6f3['duration'])?null:_0x5cc6f3[_0xa3f0('0x64')]*0x3e8;_0x4691b6[_0xa3f0('0x6b')]=isNaN(_0x5cc6f3[_0xa3f0('0x6c')])?null:_0x5cc6f3[_0xa3f0('0x6c')];_0x4691b6[_0xa3f0('0x6d')]=isNaN(_0x5cc6f3[_0xa3f0('0x66')])?null:_0x5cc6f3[_0xa3f0('0x66')];_0x4691b6['converted_bitRate']=isNaN(_0x5cc6f3[_0xa3f0('0x67')])?null:_0x5cc6f3['bitRate'];_0x4691b6['converted_sampleRate']=isNaN(_0x5cc6f3[_0xa3f0('0x69')])?null:_0x5cc6f3[_0xa3f0('0x69')];});_0x52c0b4['on'](_0xa3f0('0x1b'),function(){fs['chmodSync'](_0x16d39b,parseInt('0777',0x8));return db[_0xa3f0('0x2f')][_0xa3f0('0x54')](_0x4691b6)[_0xa3f0('0x26')](function(_0x499801){var _0x1f8fb2={'role':_0x334c13[_0xa3f0('0x6e')]['role'],'userProfileId':_0x334c13[_0xa3f0('0x6e')][_0xa3f0('0x6f')]};if(!_0x1f8fb2)throw new Error(_0xa3f0('0x70'));if(_0x1f8fb2[_0xa3f0('0x71')]==='user'){var _0x5c2444=_0x499801['get']({'plain':!![]});return db[_0xa3f0('0x72')][_0xa3f0('0x48')]({'where':{'name':_0xa3f0('0x27'),'userProfileId':_0x1f8fb2[_0xa3f0('0x6f')]},'raw':!![]})[_0xa3f0('0x26')](function(_0x53c3de){if(_0x53c3de&&_0x53c3de[_0xa3f0('0x73')]===0x0){return db['UserProfileResource'][_0xa3f0('0x54')]({'name':_0x5c2444[_0xa3f0('0x2c')],'resourceId':_0x5c2444['id'],'type':_0x53c3de[_0xa3f0('0x2c')],'sectionId':_0x53c3de['id']},{})[_0xa3f0('0x26')](function(){return _0x499801;});}else{return _0x499801;}})[_0xa3f0('0x44')](function(_0xef7a17){logger[_0xa3f0('0x2a')](_0xa3f0('0x74'),_0xef7a17);throw _0xef7a17;});}return _0x499801;})[_0xa3f0('0x26')](respondWithResult(_0x470f1c,null))[_0xa3f0('0x44')](handleError(_0x470f1c,null));});_0x52c0b4['start']();}catch(_0x4e111b){_0x470f1c[_0xa3f0('0x1a')](0x1f4)[_0xa3f0('0x62')](_0x4e111b);}};exports[_0xa3f0('0x25')]=function(_0x3ca058,_0x5ecc6c,_0x5361fb){return db[_0xa3f0('0x2f')][_0xa3f0('0x48')]({'where':{'id':_0x3ca058[_0xa3f0('0x46')]['id']}})[_0xa3f0('0x26')](handleEntityNotFound(_0x5ecc6c,null))[_0xa3f0('0x26')](saveUpdates(_[_0xa3f0('0x3f')](_0x3ca058['body'],['name',_0xa3f0('0x75')]),null))[_0xa3f0('0x26')](respondWithResult(_0x5ecc6c,null))['catch'](handleError(_0x5ecc6c,null));};exports[_0xa3f0('0x76')]=function(_0x450e2a,_0x500a72,_0x1c324b){return db[_0xa3f0('0x2f')][_0xa3f0('0x48')]({'where':{'id':_0x450e2a[_0xa3f0('0x46')]['id']}})[_0xa3f0('0x26')](function(_0x11224e){if(_0x11224e){return _0x11224e['destroy']();}})[_0xa3f0('0x26')](function(_0x181dfe){var _0x3a8400=path[_0xa3f0('0x4b')](config[_0xa3f0('0x4c')],'server/files/sounds/original',util[_0xa3f0('0x51')]('%s.%s',_0x181dfe[_0xa3f0('0x49')],_0x181dfe[_0xa3f0('0x77')]));var _0x229567=path[_0xa3f0('0x4b')](config[_0xa3f0('0x4c')],_0xa3f0('0x4d'),util['format'](_0xa3f0('0x52'),_0x181dfe[_0xa3f0('0x49')],_0x181dfe['converted_format']));fs['unlinkSync'](_0x3a8400);fs[_0xa3f0('0x61')](_0x229567);return _0x181dfe;})[_0xa3f0('0x26')](function(_0x1e91ac){if(_0x1e91ac){return _0x500a72[_0xa3f0('0x1a')](0xcc)[_0xa3f0('0x1b')]();}})[_0xa3f0('0x26')](handleEntityNotFound(_0x500a72,null))['catch'](handleError(_0x500a72,null));};
\ No newline at end of file
+var _0x7969=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Sounds','UserProfileResource','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','catch','show','include','find','download','params','save_name','root','server/files/sounds/converted','converted_format','Sequelize','Sound\x20not\x20found','join','format','%s.%s','create','file','originalname','extname','basename','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','role','body','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','original_format','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x7969,0x6e));var _0x9796=function(_0x2ca381,_0x2011e9){_0x2ca381=_0x2ca381-0x0;var _0x46129f=_0x7969[_0x2ca381];return _0x46129f;};'use strict';var emlformat=require(_0x9796('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9796('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9796('0x2'));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 fs_extra=require(_0x9796('0xa'));var _=require(_0x9796('0xb'));var squel=require(_0x9796('0xc'));var crypto=require('crypto');var jsforce=require(_0x9796('0xd'));var deskjs=require(_0x9796('0xe'));var toCsv=require(_0x9796('0x8'));var querystring=require('querystring');var Papa=require(_0x9796('0xf'));var Redis=require(_0x9796('0x10'));var authService=require(_0x9796('0x11'));var qs=require(_0x9796('0x12'));var as=require(_0x9796('0x13'));var hardwareService=require(_0x9796('0x14'));var logger=require(_0x9796('0x15'))(_0x9796('0x16'));var utils=require(_0x9796('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9796('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a7509,_0x32d7dc){_0x32d7dc=_0x32d7dc||0xcc;return function(_0x599607){if(_0x599607){return _0x2a7509[_0x9796('0x19')](_0x32d7dc);}return _0x2a7509[_0x9796('0x1a')](_0x32d7dc)[_0x9796('0x1b')]();};}function respondWithResult(_0x1b80da,_0x5e8fb8){_0x5e8fb8=_0x5e8fb8||0xc8;return function(_0x23cae8){if(_0x23cae8){return _0x1b80da[_0x9796('0x1a')](_0x5e8fb8)[_0x9796('0x1c')](_0x23cae8);}};}function respondWithFilteredResult(_0x145909,_0x724f2e){return function(_0x409fbc){if(_0x409fbc){var _0xd0c450=typeof _0x724f2e[_0x9796('0x1d')]===_0x9796('0x1e')&&typeof _0x724f2e[_0x9796('0x1f')]===_0x9796('0x1e');var _0x3ae733=_0x409fbc['count'];var _0x2920e9=_0xd0c450?0x0:_0x724f2e['offset'];var _0x24e2ed=_0xd0c450?_0x409fbc[_0x9796('0x20')]:_0x724f2e[_0x9796('0x1d')]+_0x724f2e['limit'];var _0xf8b81e;if(_0x24e2ed>=_0x3ae733){_0x24e2ed=_0x3ae733;_0xf8b81e=0xc8;}else{_0xf8b81e=0xce;}_0x145909[_0x9796('0x1a')](_0xf8b81e);return _0x145909[_0x9796('0x21')](_0x9796('0x22'),_0x2920e9+'-'+_0x24e2ed+'/'+_0x3ae733)[_0x9796('0x1c')](_0x409fbc);}return null;};}function patchUpdates(_0x247e11){return function(_0x443374){try{jsonpatch[_0x9796('0x23')](_0x443374,_0x247e11,!![]);}catch(_0x43376c){return BPromise['reject'](_0x43376c);}return _0x443374[_0x9796('0x24')]();};}function saveUpdates(_0x264c1d,_0x1e5da4){return function(_0x31b71e){if(_0x31b71e){return _0x31b71e[_0x9796('0x25')](_0x264c1d)['then'](function(_0x3e4e6f){return _0x3e4e6f;});}return null;};}function removeEntity(_0x1bf702,_0x535038){return function(_0x3e759d){if(_0x3e759d){return _0x3e759d[_0x9796('0x26')]()[_0x9796('0x27')](function(){var _0x2e6c64=_0x3e759d[_0x9796('0x28')]({'plain':!![]});var _0x1e05d8=_0x9796('0x29');return db[_0x9796('0x2a')][_0x9796('0x26')]({'where':{'type':_0x1e05d8,'resourceId':_0x2e6c64['id']}})[_0x9796('0x27')](function(){return _0x3e759d;});})['then'](function(){_0x1bf702[_0x9796('0x1a')](0xcc)[_0x9796('0x1b')]();});}};}function handleEntityNotFound(_0x284750,_0x4e0176){return function(_0x40a595){if(!_0x40a595){_0x284750[_0x9796('0x19')](0x194);}return _0x40a595;};}function handleError(_0x34b6f6,_0x2d6686){_0x2d6686=_0x2d6686||0x1f4;return function(_0x2bbda9){logger['error'](_0x2bbda9[_0x9796('0x2b')]);if(_0x2bbda9[_0x9796('0x2c')]){delete _0x2bbda9['name'];}_0x34b6f6['status'](_0x2d6686)[_0x9796('0x2d')](_0x2bbda9);};}exports[_0x9796('0x2e')]=function(_0x5a738d,_0x1c29a0){var _0x463e65={},_0x5410ea={},_0x570ea7={'count':0x0,'rows':[]};var _0xb69be8=_[_0x9796('0x2f')](db[_0x9796('0x30')][_0x9796('0x31')],function(_0x29db35){return{'name':_0x29db35[_0x9796('0x32')],'type':_0x29db35[_0x9796('0x33')][_0x9796('0x34')]};});_0x5410ea[_0x9796('0x35')]=_[_0x9796('0x2f')](_0xb69be8,_0x9796('0x2c'));_0x5410ea['query']=_[_0x9796('0x36')](_0x5a738d[_0x9796('0x37')]);_0x5410ea[_0x9796('0x38')]=_[_0x9796('0x39')](_0x5410ea[_0x9796('0x35')],_0x5410ea[_0x9796('0x37')]);_0x463e65[_0x9796('0x3a')]=_[_0x9796('0x39')](_0x5410ea[_0x9796('0x35')],qs[_0x9796('0x3b')](_0x5a738d[_0x9796('0x37')][_0x9796('0x3b')]));_0x463e65[_0x9796('0x3a')]=_0x463e65[_0x9796('0x3a')][_0x9796('0x3c')]?_0x463e65['attributes']:_0x5410ea[_0x9796('0x35')];if(!_0x5a738d['query'][_0x9796('0x3d')](_0x9796('0x3e'))){_0x463e65[_0x9796('0x1f')]=qs[_0x9796('0x1f')](_0x5a738d['query']['limit']);_0x463e65[_0x9796('0x1d')]=qs[_0x9796('0x1d')](_0x5a738d[_0x9796('0x37')]['offset']);}_0x463e65['order']=qs['sort'](_0x5a738d[_0x9796('0x37')][_0x9796('0x3f')]);_0x463e65['where']=qs[_0x9796('0x38')](_[_0x9796('0x40')](_0x5a738d['query'],_0x5410ea[_0x9796('0x38')]),_0xb69be8);if(_0x5a738d[_0x9796('0x37')][_0x9796('0x41')]){_0x463e65['where']=_['merge'](_0x463e65[_0x9796('0x42')],{'$or':_[_0x9796('0x2f')](_0xb69be8,function(_0x1832ca){if(_0x1832ca[_0x9796('0x33')]!==_0x9796('0x43')){var _0xbf3a7c={};_0xbf3a7c[_0x1832ca[_0x9796('0x2c')]]={'$like':'%'+_0x5a738d['query'][_0x9796('0x41')]+'%'};return _0xbf3a7c;}})});}_0x463e65=_[_0x9796('0x44')]({},_0x463e65,_0x5a738d['options']);var _0x32a6e0={'where':_0x463e65[_0x9796('0x42')]};return db[_0x9796('0x30')][_0x9796('0x20')](_0x32a6e0)[_0x9796('0x27')](function(_0x24134f){_0x570ea7['count']=_0x24134f;if(_0x5a738d['query'][_0x9796('0x45')]){_0x463e65['include']=[{'all':!![]}];}return db[_0x9796('0x30')][_0x9796('0x46')](_0x463e65);})['then'](function(_0x36099f){_0x570ea7['rows']=_0x36099f;return _0x570ea7;})[_0x9796('0x27')](respondWithFilteredResult(_0x1c29a0,_0x463e65))[_0x9796('0x47')](handleError(_0x1c29a0,null));};exports[_0x9796('0x48')]=function(_0x56be4d,_0x4a3326){var _0x5f4824={'raw':!![],'where':{'id':_0x56be4d['params']['id']}},_0x1058e5={};_0x1058e5[_0x9796('0x35')]=_[_0x9796('0x36')](db[_0x9796('0x30')][_0x9796('0x31')]);_0x1058e5['query']=_['keys'](_0x56be4d[_0x9796('0x37')]);_0x1058e5[_0x9796('0x38')]=_[_0x9796('0x39')](_0x1058e5['model'],_0x1058e5[_0x9796('0x37')]);_0x5f4824[_0x9796('0x3a')]=_[_0x9796('0x39')](_0x1058e5[_0x9796('0x35')],qs[_0x9796('0x3b')](_0x56be4d['query'][_0x9796('0x3b')]));_0x5f4824[_0x9796('0x3a')]=_0x5f4824['attributes'][_0x9796('0x3c')]?_0x5f4824['attributes']:_0x1058e5[_0x9796('0x35')];if(_0x56be4d[_0x9796('0x37')][_0x9796('0x45')]){_0x5f4824[_0x9796('0x49')]=[{'all':!![]}];}_0x5f4824=_[_0x9796('0x44')]({},_0x5f4824,_0x56be4d['options']);return db['Sound'][_0x9796('0x4a')](_0x5f4824)[_0x9796('0x27')](handleEntityNotFound(_0x4a3326,null))[_0x9796('0x27')](respondWithResult(_0x4a3326,null))[_0x9796('0x47')](handleError(_0x4a3326,null));};exports[_0x9796('0x4b')]=function(_0x523db3,_0xfc4bc0,_0x200d7d){return db['Sound'][_0x9796('0x4a')]({'where':{'id':_0x523db3[_0x9796('0x4c')]['id']},'attributes':[_0x9796('0x2c'),_0x9796('0x4d'),'converted_format'],'raw':!![]})['then'](handleEntityNotFound(_0xfc4bc0,null))['then'](function(_0x108616){if(_0x108616){if(!fs['existsSync'](path['join'](config[_0x9796('0x4e')],_0x9796('0x4f'),_0x108616[_0x9796('0x4d')]+'.'+_0x108616[_0x9796('0x50')]))){throw new db[(_0x9796('0x51'))]['ValidationError'](_0x9796('0x52'));}return _0xfc4bc0[_0x9796('0x4b')](path[_0x9796('0x53')](config[_0x9796('0x4e')],'server/files/sounds/converted',util[_0x9796('0x54')](_0x9796('0x55'),_0x108616[_0x9796('0x4d')],_0x108616[_0x9796('0x50')])),util[_0x9796('0x54')]('%s.%s',_0x108616[_0x9796('0x2c')],_0x108616[_0x9796('0x50')]));}return null;})[_0x9796('0x47')](handleError(_0xfc4bc0,null));};exports[_0x9796('0x56')]=function(_0x4bb4c5,_0x3cd19e,_0x155bba){var _0x2429fc={'name':path['basename'](_0x4bb4c5[_0x9796('0x57')][_0x9796('0x58')],path[_0x9796('0x59')](_0x4bb4c5[_0x9796('0x57')][_0x9796('0x58')])),'save_name':path[_0x9796('0x5a')](_0x4bb4c5[_0x9796('0x57')]['filename'],path['extname'](_0x4bb4c5[_0x9796('0x57')]['filename'])),'original_format':path['extname'](_0x4bb4c5['file']['originalname'])[_0x9796('0x5b')](0x1),'converted_format':_0x9796('0x5c')};var _0x4247b3=path['join'](config[_0x9796('0x4e')],_0x9796('0x5d'),_0x4bb4c5[_0x9796('0x57')][_0x9796('0x5e')]);var _0xfd73af=path[_0x9796('0x53')](config[_0x9796('0x4e')],_0x9796('0x4f'),util['format'](_0x9796('0x55'),path['basename'](_0x4bb4c5[_0x9796('0x57')][_0x9796('0x5e')],path[_0x9796('0x59')](_0x4bb4c5['file'][_0x9796('0x5e')])),_0x2429fc[_0x9796('0x50')]));logger[_0x9796('0x5f')](_0x9796('0x60'),_0x4247b3);logger['info'](_0x9796('0x61'),_0xfd73af);try{fs[_0x9796('0x62')](_0x4247b3,parseInt(_0x9796('0x63'),0x8));var _0x4035ea=sox[_0x9796('0x64')](_0x4247b3,_0xfd73af,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4035ea['on']('error',function(_0x5f57da){fs[_0x9796('0x65')](_0x4247b3);_0x3cd19e[_0x9796('0x1a')](0x1f4)[_0x9796('0x2d')](_0x5f57da);});_0x4035ea['on'](_0x9796('0x66'),function(_0x5c5b4a){_0x2429fc[_0x9796('0x67')]=isNaN(_0x5c5b4a[_0x9796('0x68')])?null:_0x5c5b4a[_0x9796('0x68')]*0x3e8;_0x2429fc[_0x9796('0x69')]=isNaN(_0x5c5b4a[_0x9796('0x6a')])?null:_0x5c5b4a[_0x9796('0x6a')];_0x2429fc[_0x9796('0x6b')]=isNaN(_0x5c5b4a[_0x9796('0x6c')])?null:_0x5c5b4a[_0x9796('0x6c')];_0x2429fc[_0x9796('0x6d')]=isNaN(_0x5c5b4a[_0x9796('0x6e')])?null:_0x5c5b4a[_0x9796('0x6e')];_0x2429fc[_0x9796('0x6f')]=isNaN(_0x5c5b4a[_0x9796('0x70')])?null:_0x5c5b4a['sampleRate'];});_0x4035ea['on'](_0x9796('0x71'),function(_0x324b0d){_0x2429fc['converted_duration']=isNaN(_0x324b0d['duration'])?null:_0x324b0d[_0x9796('0x68')]*0x3e8;_0x2429fc[_0x9796('0x72')]=isNaN(_0x324b0d[_0x9796('0x6a')])?null:_0x324b0d[_0x9796('0x6a')];_0x2429fc[_0x9796('0x73')]=isNaN(_0x324b0d['channelCount'])?null:_0x324b0d[_0x9796('0x6c')];_0x2429fc[_0x9796('0x74')]=isNaN(_0x324b0d[_0x9796('0x6e')])?null:_0x324b0d[_0x9796('0x6e')];_0x2429fc[_0x9796('0x75')]=isNaN(_0x324b0d[_0x9796('0x70')])?null:_0x324b0d[_0x9796('0x70')];});_0x4035ea['on']('end',function(){fs[_0x9796('0x62')](_0xfd73af,parseInt(_0x9796('0x63'),0x8));return db[_0x9796('0x30')][_0x9796('0x56')](_0x2429fc)[_0x9796('0x27')](function(_0x51a80c){var _0x4453ac={'role':_0x4bb4c5['body'][_0x9796('0x76')],'userProfileId':_0x4bb4c5[_0x9796('0x77')][_0x9796('0x78')]};if(!_0x4453ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4453ac['role']===_0x9796('0x79')){var _0x41850b=_0x51a80c[_0x9796('0x28')]({'plain':!![]});return db[_0x9796('0x7a')][_0x9796('0x4a')]({'where':{'name':'Sounds','userProfileId':_0x4453ac[_0x9796('0x78')]},'raw':!![]})[_0x9796('0x27')](function(_0x3a9611){if(_0x3a9611&&_0x3a9611[_0x9796('0x7b')]===0x0){return db['UserProfileResource'][_0x9796('0x56')]({'name':_0x41850b['name'],'resourceId':_0x41850b['id'],'type':_0x3a9611[_0x9796('0x2c')],'sectionId':_0x3a9611['id']},{})[_0x9796('0x27')](function(){return _0x51a80c;});}else{return _0x51a80c;}})[_0x9796('0x47')](function(_0x2f6994){logger['error'](_0x9796('0x7c'),_0x2f6994);throw _0x2f6994;});}return _0x51a80c;})[_0x9796('0x27')](respondWithResult(_0x3cd19e,null))[_0x9796('0x47')](handleError(_0x3cd19e,null));});_0x4035ea[_0x9796('0x7d')]();}catch(_0x20a4a1){_0x3cd19e[_0x9796('0x1a')](0x1f4)[_0x9796('0x2d')](_0x20a4a1);}};exports[_0x9796('0x25')]=function(_0x46c7de,_0x32c8a6,_0xbcfe1f){return db[_0x9796('0x30')][_0x9796('0x4a')]({'where':{'id':_0x46c7de[_0x9796('0x4c')]['id']}})[_0x9796('0x27')](handleEntityNotFound(_0x32c8a6,null))[_0x9796('0x27')](saveUpdates(_[_0x9796('0x40')](_0x46c7de[_0x9796('0x77')],['name',_0x9796('0x7e')]),null))[_0x9796('0x27')](respondWithResult(_0x32c8a6,null))[_0x9796('0x47')](handleError(_0x32c8a6,null));};exports['delete']=function(_0x37182d,_0x3b5ec3,_0xc248f5){return db['Sound'][_0x9796('0x4a')]({'where':{'id':_0x37182d['params']['id']}})[_0x9796('0x27')](function(_0x3de83d){if(_0x3de83d){return _0x3de83d[_0x9796('0x26')]();}})[_0x9796('0x27')](function(_0x411859){var _0x11d170=path[_0x9796('0x53')](config[_0x9796('0x4e')],_0x9796('0x5d'),util[_0x9796('0x54')](_0x9796('0x55'),_0x411859[_0x9796('0x4d')],_0x411859[_0x9796('0x7f')]));var _0x5060bc=path[_0x9796('0x53')](config[_0x9796('0x4e')],_0x9796('0x4f'),util[_0x9796('0x54')](_0x9796('0x55'),_0x411859[_0x9796('0x4d')],_0x411859[_0x9796('0x50')]));fs[_0x9796('0x65')](_0x11d170);fs[_0x9796('0x65')](_0x5060bc);return _0x411859;})[_0x9796('0x27')](function(_0x379fa3){if(_0x379fa3){return _0x3b5ec3[_0x9796('0x1a')](0xcc)['end']();}})[_0x9796('0x27')](handleEntityNotFound(_0x3b5ec3,null))[_0x9796('0x47')](handleError(_0x3b5ec3,null));};
\ No newline at end of file
index 66aa763..ab6ea2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac74=['rimraf','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','api','moment','bluebird','path'];(function(_0x171531,_0xdccc2d){var _0x4cec68=function(_0x5d0f7b){while(--_0x5d0f7b){_0x171531['push'](_0x171531['shift']());}};_0x4cec68(++_0xdccc2d);}(_0xac74,0x156));var _0x4ac7=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xac74[_0x245afe];return _0x4eefde;};'use strict';var _=require('lodash');var util=require(_0x4ac7('0x0'));var logger=require(_0x4ac7('0x1'))(_0x4ac7('0x2'));var moment=require(_0x4ac7('0x3'));var BPromise=require(_0x4ac7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ac7('0x5'));var rimraf=require(_0x4ac7('0x6'));var config=require('../../config/environment');var attributes=require(_0x4ac7('0x7'));module[_0x4ac7('0x8')]=function(_0xdb2b3b,_0xb637){return _0xdb2b3b[_0x4ac7('0x9')](_0x4ac7('0xa'),attributes,{'tableName':_0x4ac7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7f4d=['request-promise','rimraf','../../config/environment','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0x7f4d,0xb5));var _0xd7f4=function(_0x72994c,_0x597f21){_0x72994c=_0x72994c-0x0;var _0x421abc=_0x7f4d[_0x72994c];return _0x421abc;};'use strict';var _=require(_0xd7f4('0x0'));var util=require(_0xd7f4('0x1'));var logger=require(_0xd7f4('0x2'))(_0xd7f4('0x3'));var moment=require(_0xd7f4('0x4'));var BPromise=require(_0xd7f4('0x5'));var rp=require(_0xd7f4('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7f4('0x7'));var config=require(_0xd7f4('0x8'));var attributes=require('./sound.attributes');module['exports']=function(_0x13b30b,_0x5833cd){return _0x13b30b['define'](_0xd7f4('0x9'),attributes,{'tableName':_0xd7f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb471b4..ece0a52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5bb=['http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','ShowSound','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../config/logger','jayson/promise','client'];(function(_0x597be4,_0x27e874){var _0x2b2608=function(_0x37ca34){while(--_0x37ca34){_0x597be4['push'](_0x597be4['shift']());}};_0x2b2608(++_0x27e874);}(_0xe5bb,0x1e5));var _0xbe5b=function(_0x2980bb,_0x364ecb){_0x2980bb=_0x2980bb-0x0;var _0x285360=_0xe5bb[_0x2980bb];return _0x285360;};'use strict';var _=require(_0xbe5b('0x0'));var util=require(_0xbe5b('0x1'));var moment=require(_0xbe5b('0x2'));var BPromise=require(_0xbe5b('0x3'));var rs=require(_0xbe5b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbe5b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbe5b('0x6'));var client=jayson[_0xbe5b('0x7')][_0xbe5b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57118b,_0x281371,_0x523dca){return new BPromise(function(_0x14cd35,_0x33fdef){return client[_0xbe5b('0x9')](_0x57118b,_0x523dca)[_0xbe5b('0xa')](function(_0x36be3d){logger[_0xbe5b('0xb')](_0xbe5b('0xc'),_0x281371,_0xbe5b('0xd'));logger[_0xbe5b('0xe')](_0xbe5b('0xf'),_0x281371,_0xbe5b('0xd'),JSON['stringify'](_0x36be3d));if(_0x36be3d['error']){if(_0x36be3d['error'][_0xbe5b('0x10')]===0x1f4){logger[_0xbe5b('0x11')](_0xbe5b('0xc'),_0x281371,_0x36be3d[_0xbe5b('0x11')][_0xbe5b('0x12')]);return _0x33fdef(_0x36be3d[_0xbe5b('0x11')][_0xbe5b('0x12')]);}logger[_0xbe5b('0x11')](_0xbe5b('0xc'),_0x281371,_0x36be3d['error'][_0xbe5b('0x12')]);return _0x14cd35(_0x36be3d[_0xbe5b('0x11')][_0xbe5b('0x12')]);}else{logger[_0xbe5b('0xb')](_0xbe5b('0xc'),_0x281371,_0xbe5b('0xd'));_0x14cd35(_0x36be3d[_0xbe5b('0x13')]['message']);}})[_0xbe5b('0x14')](function(_0x46c138){logger[_0xbe5b('0x11')](_0xbe5b('0xc'),_0x281371,_0x46c138);_0x33fdef(_0x46c138);});});}exports[_0xbe5b('0x15')]=function(_0x4b312a){var _0x4a7081=this;return new Promise(function(_0x349235,_0x54c977){return db['Sound'][_0xbe5b('0x16')]({'raw':_0x4b312a[_0xbe5b('0x17')]?_0x4b312a['options'][_0xbe5b('0x18')]===undefined?!![]:![]:!![],'where':_0x4b312a[_0xbe5b('0x17')]?_0x4b312a['options']['where']||null:null,'attributes':_0x4b312a['options']?_0x4b312a[_0xbe5b('0x17')][_0xbe5b('0x19')]||null:null,'include':_0x4b312a['options']?_0x4b312a[_0xbe5b('0x17')][_0xbe5b('0x1a')]?_[_0xbe5b('0x1b')](_0x4b312a[_0xbe5b('0x17')]['include'],function(_0x665934){return{'model':db[_0x665934[_0xbe5b('0x1c')]],'as':_0x665934['as'],'attributes':_0x665934['attributes'],'include':_0x665934['include']?_['map'](_0x665934['include'],function(_0x122769){return{'model':db[_0x122769[_0xbe5b('0x1c')]],'as':_0x122769['as'],'attributes':_0x122769[_0xbe5b('0x19')],'include':_0x122769[_0xbe5b('0x1a')]?_[_0xbe5b('0x1b')](_0x122769[_0xbe5b('0x1a')],function(_0x3929b9){return{'model':db[_0x3929b9[_0xbe5b('0x1c')]],'as':_0x3929b9['as'],'attributes':_0x3929b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe5b('0xa')](function(_0x5a33b5){logger['info']('ShowSound',_0x4b312a);logger[_0xbe5b('0xe')](_0xbe5b('0x15'),_0x4b312a,JSON['stringify'](_0x5a33b5));_0x349235(_0x5a33b5);})[_0xbe5b('0x14')](function(_0x16fe6d){logger['error'](_0xbe5b('0x15'),_0x16fe6d[_0xbe5b('0x12')],_0x4b312a);_0x54c977(_0x4a7081[_0xbe5b('0x11')](0x1f4,_0x16fe6d['message']));});});};
\ No newline at end of file
+var _0x5b2c=['http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowSound','Sound','find','options','raw','where','include','map','model','attributes','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3f0b15,_0x29a0c6){var _0x371196=function(_0x39ea4e){while(--_0x39ea4e){_0x3f0b15['push'](_0x3f0b15['shift']());}};_0x371196(++_0x29a0c6);}(_0x5b2c,0xf0));var _0xc5b2=function(_0x1dc913,_0x17cfee){_0x1dc913=_0x1dc913-0x0;var _0x3c937d=_0x5b2c[_0x1dc913];return _0x3c937d;};'use strict';var _=require(_0xc5b2('0x0'));var util=require(_0xc5b2('0x1'));var moment=require(_0xc5b2('0x2'));var BPromise=require(_0xc5b2('0x3'));var rs=require(_0xc5b2('0x4'));var fs=require('fs');var Redis=require(_0xc5b2('0x5'));var db=require(_0xc5b2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc5b2('0x7'))(_0xc5b2('0x8'));var config=require(_0xc5b2('0x9'));var jayson=require(_0xc5b2('0xa'));var client=jayson[_0xc5b2('0xb')][_0xc5b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5e56ad,_0x73aad4,_0x2aec99){return new BPromise(function(_0x10f55e,_0x315c8f){return client[_0xc5b2('0xd')](_0x5e56ad,_0x2aec99)[_0xc5b2('0xe')](function(_0x486c47){logger[_0xc5b2('0xf')](_0xc5b2('0x10'),_0x73aad4,_0xc5b2('0x11'));logger['debug'](_0xc5b2('0x12'),_0x73aad4,_0xc5b2('0x11'),JSON['stringify'](_0x486c47));if(_0x486c47[_0xc5b2('0x13')]){if(_0x486c47[_0xc5b2('0x13')][_0xc5b2('0x14')]===0x1f4){logger[_0xc5b2('0x13')](_0xc5b2('0x10'),_0x73aad4,_0x486c47[_0xc5b2('0x13')][_0xc5b2('0x15')]);return _0x315c8f(_0x486c47['error']['message']);}logger['error'](_0xc5b2('0x10'),_0x73aad4,_0x486c47['error']['message']);return _0x10f55e(_0x486c47[_0xc5b2('0x13')][_0xc5b2('0x15')]);}else{logger['info'](_0xc5b2('0x10'),_0x73aad4,_0xc5b2('0x11'));_0x10f55e(_0x486c47[_0xc5b2('0x16')][_0xc5b2('0x15')]);}})[_0xc5b2('0x17')](function(_0x1980d1){logger[_0xc5b2('0x13')]('Sound,\x20%s,\x20%s',_0x73aad4,_0x1980d1);_0x315c8f(_0x1980d1);});});}exports[_0xc5b2('0x18')]=function(_0x533630){var _0x48dbc4=this;return new Promise(function(_0x1b327f,_0x249dbc){return db[_0xc5b2('0x19')][_0xc5b2('0x1a')]({'raw':_0x533630['options']?_0x533630[_0xc5b2('0x1b')][_0xc5b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x533630['options']?_0x533630[_0xc5b2('0x1b')][_0xc5b2('0x1d')]||null:null,'attributes':_0x533630[_0xc5b2('0x1b')]?_0x533630[_0xc5b2('0x1b')]['attributes']||null:null,'include':_0x533630['options']?_0x533630['options'][_0xc5b2('0x1e')]?_[_0xc5b2('0x1f')](_0x533630[_0xc5b2('0x1b')]['include'],function(_0xe69a87){return{'model':db[_0xe69a87[_0xc5b2('0x20')]],'as':_0xe69a87['as'],'attributes':_0xe69a87[_0xc5b2('0x21')],'include':_0xe69a87[_0xc5b2('0x1e')]?_['map'](_0xe69a87[_0xc5b2('0x1e')],function(_0x53e1e1){return{'model':db[_0x53e1e1['model']],'as':_0x53e1e1['as'],'attributes':_0x53e1e1[_0xc5b2('0x21')],'include':_0x53e1e1[_0xc5b2('0x1e')]?_['map'](_0x53e1e1[_0xc5b2('0x1e')],function(_0xee1c8b){return{'model':db[_0xee1c8b[_0xc5b2('0x20')]],'as':_0xee1c8b['as'],'attributes':_0xee1c8b[_0xc5b2('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377622){logger[_0xc5b2('0xf')](_0xc5b2('0x18'),_0x533630);logger[_0xc5b2('0x22')]('ShowSound',_0x533630,JSON[_0xc5b2('0x23')](_0x377622));_0x1b327f(_0x377622);})[_0xc5b2('0x17')](function(_0x504fda){logger['error'](_0xc5b2('0x18'),_0x504fda[_0xc5b2('0x15')],_0x533630);_0x249dbc(_0x48dbc4[_0xc5b2('0x13')](0x1f4,_0x504fda[_0xc5b2('0x15')]));});});};
\ No newline at end of file
index b249a53..12c4ea8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x5c1de9,_0x16b37a){var _0x452529=function(_0x42a23b){while(--_0x42a23b){_0x5c1de9['push'](_0x5c1de9['shift']());}};_0x452529(++_0x16b37a);}(_0x2032,0xd9));var _0x2203=function(_0x164f5d,_0xe134c9){_0x164f5d=_0x164f5d-0x0;var _0x37de94=_0x2032[_0x164f5d];return _0x37de94;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router;
\ No newline at end of file
+var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./squareMessage.controller','get'];(function(_0xd31621,_0x17b567){var _0x2e7ac0=function(_0x3c5a8d){while(--_0x3c5a8d){_0xd31621['push'](_0xd31621['shift']());}};_0x2e7ac0(++_0x17b567);}(_0xda2d,0x102));var _0xdda2=function(_0x2db905,_0x1a2aa5){_0x2db905=_0x2db905-0x0;var _0x339277=_0xda2d[_0x2db905];return _0x339277;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router;
\ No newline at end of file
index ec375c5..ea04303 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb60a=['ENUM','out','sequelize','exports','STRING','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb60a,0xb0));var _0xab60=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xb60a[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xab60('0x0'));module[_0xab60('0x1')]={'uniqueid':{'type':Sequelize[_0xab60('0x2')]},'body':{'type':Sequelize[_0xab60('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xab60('0x4')]('in',_0xab60('0x5')),'defaultValue':_0xab60('0x5'),'allowNull':![]},'providerName':{'type':Sequelize[_0xab60('0x2')]},'providerResponse':{'type':Sequelize[_0xab60('0x3')]}};
\ No newline at end of file
+var _0xf8ca=['sequelize','exports','STRING','TEXT','medium','ENUM','out'];(function(_0x1a1c83,_0x18872e){var _0x443dda=function(_0x291137){while(--_0x291137){_0x1a1c83['push'](_0x1a1c83['shift']());}};_0x443dda(++_0x18872e);}(_0xf8ca,0xbd));var _0xaf8c=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xf8ca[_0x456fb1];return _0x4083d6;};'use strict';var Sequelize=require(_0xaf8c('0x0'));module[_0xaf8c('0x1')]={'uniqueid':{'type':Sequelize[_0xaf8c('0x2')]},'body':{'type':Sequelize[_0xaf8c('0x3')](_0xaf8c('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xaf8c('0x5')]('in',_0xaf8c('0x6')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xaf8c('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 8aeea84..b1f3c9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x429b=['SquareMessage','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','rawAttributes','keys','find','catch','create','body','update','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','reject','save','then','end','error','stack','name','index'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x429b,0x70));var _0xb429=function(_0x588bcb,_0x3b3eeb){_0x588bcb=_0x588bcb-0x0;var _0x548c83=_0x429b[_0x588bcb];return _0x548c83;};'use strict';var emlformat=require(_0xb429('0x0'));var rimraf=require(_0xb429('0x1'));var zipdir=require(_0xb429('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb429('0x3'));var moment=require(_0xb429('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb429('0x5'));var util=require(_0xb429('0x6'));var path=require(_0xb429('0x7'));var sox=require(_0xb429('0x8'));var csv=require(_0xb429('0x9'));var ejs=require(_0xb429('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb429('0xb'));var squel=require(_0xb429('0xc'));var crypto=require(_0xb429('0xd'));var jsforce=require(_0xb429('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb429('0x9'));var querystring=require(_0xb429('0xf'));var Papa=require(_0xb429('0x10'));var Redis=require('ioredis');var authService=require(_0xb429('0x11'));var qs=require(_0xb429('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb429('0x13'));var logger=require(_0xb429('0x14'))(_0xb429('0x15'));var utils=require(_0xb429('0x16'));var config=require(_0xb429('0x17'));var licenseUtil=require(_0xb429('0x18'));var db=require(_0xb429('0x19'))['db'];function respondWithStatusCode(_0x10b7d6,_0x11b73e){_0x11b73e=_0x11b73e||0xcc;return function(_0x274fd8){if(_0x274fd8){return _0x10b7d6[_0xb429('0x1a')](_0x11b73e);}return _0x10b7d6[_0xb429('0x1b')](_0x11b73e)['end']();};}function respondWithResult(_0x201c6f,_0xa701a5){_0xa701a5=_0xa701a5||0xc8;return function(_0x3dc6a2){if(_0x3dc6a2){return _0x201c6f[_0xb429('0x1b')](_0xa701a5)[_0xb429('0x1c')](_0x3dc6a2);}};}function respondWithFilteredResult(_0x2f582a,_0x2ae8c2){return function(_0x812115){if(_0x812115){var _0x3079e1=typeof _0x2ae8c2['offset']==='undefined'&&typeof _0x2ae8c2[_0xb429('0x1d')]===_0xb429('0x1e');var _0x3b6908=_0x812115['count'];var _0x4252e4=_0x3079e1?0x0:_0x2ae8c2['offset'];var _0x546dff=_0x3079e1?_0x812115['count']:_0x2ae8c2[_0xb429('0x1f')]+_0x2ae8c2['limit'];var _0x58b921;if(_0x546dff>=_0x3b6908){_0x546dff=_0x3b6908;_0x58b921=0xc8;}else{_0x58b921=0xce;}_0x2f582a['status'](_0x58b921);return _0x2f582a['set']('Content-Range',_0x4252e4+'-'+_0x546dff+'/'+_0x3b6908)[_0xb429('0x1c')](_0x812115);}return null;};}function patchUpdates(_0x5b0c7d){return function(_0x20f327){try{jsonpatch['apply'](_0x20f327,_0x5b0c7d,!![]);}catch(_0x357a8b){return BPromise[_0xb429('0x20')](_0x357a8b);}return _0x20f327[_0xb429('0x21')]();};}function saveUpdates(_0x209368,_0x27e205){return function(_0xfe7933){if(_0xfe7933){return _0xfe7933['update'](_0x209368)['then'](function(_0x47a74b){return _0x47a74b;});}return null;};}function removeEntity(_0x589308,_0x428ab1){return function(_0x225e4f){if(_0x225e4f){return _0x225e4f['destroy']()[_0xb429('0x22')](function(){_0x589308['status'](0xcc)[_0xb429('0x23')]();});}};}function handleEntityNotFound(_0x4afd71,_0xd3826a){return function(_0x38fd45){if(!_0x38fd45){_0x4afd71[_0xb429('0x1a')](0x194);}return _0x38fd45;};}function handleError(_0x571903,_0x1bf48b){_0x1bf48b=_0x1bf48b||0x1f4;return function(_0x56491a){logger[_0xb429('0x24')](_0x56491a[_0xb429('0x25')]);if(_0x56491a[_0xb429('0x26')]){delete _0x56491a[_0xb429('0x26')];}_0x571903[_0xb429('0x1b')](_0x1bf48b)['send'](_0x56491a);};}exports[_0xb429('0x27')]=function(_0x1066bf,_0x254221){var _0x26681d={},_0x80cf84={},_0x2c45e3={'count':0x0,'rows':[]};var _0x439652=_['map'](db[_0xb429('0x28')]['rawAttributes'],function(_0x52955f){return{'name':_0x52955f['fieldName'],'type':_0x52955f[_0xb429('0x29')][_0xb429('0x2a')]};});_0x80cf84[_0xb429('0x2b')]=_[_0xb429('0x2c')](_0x439652,_0xb429('0x26'));_0x80cf84['query']=_['keys'](_0x1066bf[_0xb429('0x2d')]);_0x80cf84[_0xb429('0x2e')]=_[_0xb429('0x2f')](_0x80cf84['model'],_0x80cf84[_0xb429('0x2d')]);_0x26681d[_0xb429('0x30')]=_[_0xb429('0x2f')](_0x80cf84[_0xb429('0x2b')],qs[_0xb429('0x31')](_0x1066bf[_0xb429('0x2d')]['fields']));_0x26681d[_0xb429('0x30')]=_0x26681d['attributes'][_0xb429('0x32')]?_0x26681d['attributes']:_0x80cf84['model'];if(!_0x1066bf[_0xb429('0x2d')][_0xb429('0x33')](_0xb429('0x34'))){_0x26681d[_0xb429('0x1d')]=qs[_0xb429('0x1d')](_0x1066bf[_0xb429('0x2d')]['limit']);_0x26681d[_0xb429('0x1f')]=qs['offset'](_0x1066bf[_0xb429('0x2d')][_0xb429('0x1f')]);}_0x26681d[_0xb429('0x35')]=qs['sort'](_0x1066bf[_0xb429('0x2d')][_0xb429('0x36')]);_0x26681d[_0xb429('0x37')]=qs[_0xb429('0x2e')](_[_0xb429('0x38')](_0x1066bf[_0xb429('0x2d')],_0x80cf84[_0xb429('0x2e')]),_0x439652);if(_0x1066bf['query'][_0xb429('0x39')]){_0x26681d[_0xb429('0x37')]=_['merge'](_0x26681d[_0xb429('0x37')],{'$or':_[_0xb429('0x2c')](_0x439652,function(_0x537af9){if(_0x537af9[_0xb429('0x29')]!==_0xb429('0x3a')){var _0x8398f7={};_0x8398f7[_0x537af9[_0xb429('0x26')]]={'$like':'%'+_0x1066bf[_0xb429('0x2d')][_0xb429('0x39')]+'%'};return _0x8398f7;}})});}_0x26681d=_[_0xb429('0x3b')]({},_0x26681d,_0x1066bf[_0xb429('0x3c')]);var _0x25c398={'where':_0x26681d[_0xb429('0x37')]};return db[_0xb429('0x28')]['count'](_0x25c398)['then'](function(_0x2adf8a){_0x2c45e3[_0xb429('0x3d')]=_0x2adf8a;if(_0x1066bf['query'][_0xb429('0x3e')]){_0x26681d[_0xb429('0x3f')]=[{'all':!![]}];}return db[_0xb429('0x28')][_0xb429('0x40')](_0x26681d);})[_0xb429('0x22')](function(_0xd6fb7f){_0x2c45e3[_0xb429('0x41')]=_0xd6fb7f;return _0x2c45e3;})[_0xb429('0x22')](respondWithFilteredResult(_0x254221,_0x26681d))['catch'](handleError(_0x254221,null));};exports[_0xb429('0x42')]=function(_0x247e68,_0x975167){var _0x505014={'raw':!![],'where':{'id':_0x247e68['params']['id']}},_0x3f8c86={};_0x3f8c86[_0xb429('0x2b')]=_['keys'](db[_0xb429('0x28')][_0xb429('0x43')]);_0x3f8c86['query']=_[_0xb429('0x44')](_0x247e68[_0xb429('0x2d')]);_0x3f8c86[_0xb429('0x2e')]=_[_0xb429('0x2f')](_0x3f8c86['model'],_0x3f8c86[_0xb429('0x2d')]);_0x505014[_0xb429('0x30')]=_['intersection'](_0x3f8c86[_0xb429('0x2b')],qs[_0xb429('0x31')](_0x247e68[_0xb429('0x2d')]['fields']));_0x505014[_0xb429('0x30')]=_0x505014['attributes'][_0xb429('0x32')]?_0x505014['attributes']:_0x3f8c86[_0xb429('0x2b')];if(_0x247e68[_0xb429('0x2d')][_0xb429('0x3e')]){_0x505014['include']=[{'all':!![]}];}_0x505014=_[_0xb429('0x3b')]({},_0x505014,_0x247e68[_0xb429('0x3c')]);return db[_0xb429('0x28')][_0xb429('0x45')](_0x505014)['then'](handleEntityNotFound(_0x975167,null))[_0xb429('0x22')](respondWithResult(_0x975167,null))[_0xb429('0x46')](handleError(_0x975167,null));};exports[_0xb429('0x47')]=function(_0x18a724,_0x4f2b28){return db[_0xb429('0x28')]['create'](_0x18a724[_0xb429('0x48')],{})[_0xb429('0x22')](respondWithResult(_0x4f2b28,0xc9))['catch'](handleError(_0x4f2b28,null));};exports[_0xb429('0x49')]=function(_0x3de032,_0x4ea7b9){if(_0x3de032['body']['id']){delete _0x3de032[_0xb429('0x48')]['id'];}return db[_0xb429('0x28')][_0xb429('0x45')]({'where':{'id':_0x3de032[_0xb429('0x4a')]['id']}})[_0xb429('0x22')](handleEntityNotFound(_0x4ea7b9,null))[_0xb429('0x22')](saveUpdates(_0x3de032[_0xb429('0x48')],null))['then'](respondWithResult(_0x4ea7b9,null))[_0xb429('0x46')](handleError(_0x4ea7b9,null));};exports[_0xb429('0x4b')]=function(_0x4facdc,_0x16ba4a){return db[_0xb429('0x28')]['find']({'where':{'id':_0x4facdc['params']['id']}})[_0xb429('0x22')](handleEntityNotFound(_0x16ba4a,null))[_0xb429('0x22')](removeEntity(_0x16ba4a,null))[_0xb429('0x46')](handleError(_0x16ba4a,null));};
\ No newline at end of file
+var _0x97b2=['params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','catch','show','length','find','create','body','update'];(function(_0x2bea83,_0x1d875a){var _0x46101e=function(_0x163c07){while(--_0x163c07){_0x2bea83['push'](_0x2bea83['shift']());}};_0x46101e(++_0x1d875a);}(_0x97b2,0x1b7));var _0x297b=function(_0x427352,_0x1bce61){_0x427352=_0x427352-0x0;var _0x23e0e6=_0x97b2[_0x427352];return _0x23e0e6;};'use strict';var emlformat=require(_0x297b('0x0'));var rimraf=require(_0x297b('0x1'));var zipdir=require(_0x297b('0x2'));var jsonpatch=require(_0x297b('0x3'));var rp=require(_0x297b('0x4'));var moment=require(_0x297b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x297b('0x6'));var util=require(_0x297b('0x7'));var path=require('path');var sox=require(_0x297b('0x8'));var csv=require(_0x297b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x297b('0xa'));var crypto=require(_0x297b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x297b('0xc'));var toCsv=require(_0x297b('0x9'));var querystring=require('querystring');var Papa=require(_0x297b('0xd'));var Redis=require('ioredis');var authService=require(_0x297b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x297b('0xf'));var hardwareService=require(_0x297b('0x10'));var logger=require(_0x297b('0x11'))(_0x297b('0x12'));var utils=require(_0x297b('0x13'));var config=require(_0x297b('0x14'));var licenseUtil=require(_0x297b('0x15'));var db=require(_0x297b('0x16'))['db'];function respondWithStatusCode(_0x17c231,_0xd833be){_0xd833be=_0xd833be||0xcc;return function(_0xf8a700){if(_0xf8a700){return _0x17c231[_0x297b('0x17')](_0xd833be);}return _0x17c231[_0x297b('0x18')](_0xd833be)[_0x297b('0x19')]();};}function respondWithResult(_0x27f44b,_0x56c7ed){_0x56c7ed=_0x56c7ed||0xc8;return function(_0x3446e6){if(_0x3446e6){return _0x27f44b[_0x297b('0x18')](_0x56c7ed)['json'](_0x3446e6);}};}function respondWithFilteredResult(_0x376287,_0x1a1434){return function(_0x4455f3){if(_0x4455f3){var _0x241ff6=typeof _0x1a1434[_0x297b('0x1a')]===_0x297b('0x1b')&&typeof _0x1a1434['limit']===_0x297b('0x1b');var _0x34854d=_0x4455f3[_0x297b('0x1c')];var _0x5618eb=_0x241ff6?0x0:_0x1a1434['offset'];var _0x161a40=_0x241ff6?_0x4455f3['count']:_0x1a1434[_0x297b('0x1a')]+_0x1a1434[_0x297b('0x1d')];var _0x2379dd;if(_0x161a40>=_0x34854d){_0x161a40=_0x34854d;_0x2379dd=0xc8;}else{_0x2379dd=0xce;}_0x376287[_0x297b('0x18')](_0x2379dd);return _0x376287[_0x297b('0x1e')]('Content-Range',_0x5618eb+'-'+_0x161a40+'/'+_0x34854d)[_0x297b('0x1f')](_0x4455f3);}return null;};}function patchUpdates(_0x250b19){return function(_0x5d2fa5){try{jsonpatch[_0x297b('0x20')](_0x5d2fa5,_0x250b19,!![]);}catch(_0x367c09){return BPromise[_0x297b('0x21')](_0x367c09);}return _0x5d2fa5[_0x297b('0x22')]();};}function saveUpdates(_0x4776e1,_0xa5bf63){return function(_0x402c1d){if(_0x402c1d){return _0x402c1d['update'](_0x4776e1)[_0x297b('0x23')](function(_0x19d8f3){return _0x19d8f3;});}return null;};}function removeEntity(_0x3df595,_0x56ed4b){return function(_0x279451){if(_0x279451){return _0x279451[_0x297b('0x24')]()[_0x297b('0x23')](function(){_0x3df595[_0x297b('0x18')](0xcc)[_0x297b('0x19')]();});}};}function handleEntityNotFound(_0x4e995f,_0x578d13){return function(_0x27ab73){if(!_0x27ab73){_0x4e995f[_0x297b('0x17')](0x194);}return _0x27ab73;};}function handleError(_0x46c23d,_0x2894b0){_0x2894b0=_0x2894b0||0x1f4;return function(_0x3f63dc){logger[_0x297b('0x25')](_0x3f63dc[_0x297b('0x26')]);if(_0x3f63dc['name']){delete _0x3f63dc['name'];}_0x46c23d['status'](_0x2894b0)[_0x297b('0x27')](_0x3f63dc);};}exports['index']=function(_0x5c2c26,_0x861618){var _0x323c47={},_0x2d64a={},_0xe51de={'count':0x0,'rows':[]};var _0x1caa2b=_[_0x297b('0x28')](db['SquareMessage'][_0x297b('0x29')],function(_0x50d2d0){return{'name':_0x50d2d0[_0x297b('0x2a')],'type':_0x50d2d0[_0x297b('0x2b')][_0x297b('0x2c')]};});_0x2d64a[_0x297b('0x2d')]=_[_0x297b('0x28')](_0x1caa2b,_0x297b('0x2e'));_0x2d64a[_0x297b('0x2f')]=_[_0x297b('0x30')](_0x5c2c26[_0x297b('0x2f')]);_0x2d64a[_0x297b('0x31')]=_[_0x297b('0x32')](_0x2d64a[_0x297b('0x2d')],_0x2d64a['query']);_0x323c47['attributes']=_[_0x297b('0x32')](_0x2d64a[_0x297b('0x2d')],qs[_0x297b('0x33')](_0x5c2c26[_0x297b('0x2f')]['fields']));_0x323c47[_0x297b('0x34')]=_0x323c47['attributes']['length']?_0x323c47[_0x297b('0x34')]:_0x2d64a[_0x297b('0x2d')];if(!_0x5c2c26[_0x297b('0x2f')][_0x297b('0x35')]('nolimit')){_0x323c47[_0x297b('0x1d')]=qs['limit'](_0x5c2c26[_0x297b('0x2f')][_0x297b('0x1d')]);_0x323c47['offset']=qs[_0x297b('0x1a')](_0x5c2c26[_0x297b('0x2f')]['offset']);}_0x323c47['order']=qs[_0x297b('0x36')](_0x5c2c26[_0x297b('0x2f')][_0x297b('0x36')]);_0x323c47['where']=qs[_0x297b('0x31')](_['pick'](_0x5c2c26[_0x297b('0x2f')],_0x2d64a['filters']),_0x1caa2b);if(_0x5c2c26[_0x297b('0x2f')][_0x297b('0x37')]){_0x323c47[_0x297b('0x38')]=_[_0x297b('0x39')](_0x323c47[_0x297b('0x38')],{'$or':_['map'](_0x1caa2b,function(_0x3895af){if(_0x3895af[_0x297b('0x2b')]!==_0x297b('0x3a')){var _0x581897={};_0x581897[_0x3895af[_0x297b('0x2e')]]={'$like':'%'+_0x5c2c26[_0x297b('0x2f')][_0x297b('0x37')]+'%'};return _0x581897;}})});}_0x323c47=_[_0x297b('0x39')]({},_0x323c47,_0x5c2c26[_0x297b('0x3b')]);var _0x32ce4c={'where':_0x323c47[_0x297b('0x38')]};return db[_0x297b('0x3c')][_0x297b('0x1c')](_0x32ce4c)[_0x297b('0x23')](function(_0x54ea17){_0xe51de['count']=_0x54ea17;if(_0x5c2c26[_0x297b('0x2f')][_0x297b('0x3d')]){_0x323c47[_0x297b('0x3e')]=[{'all':!![]}];}return db[_0x297b('0x3c')][_0x297b('0x3f')](_0x323c47);})[_0x297b('0x23')](function(_0x4a3e31){_0xe51de[_0x297b('0x40')]=_0x4a3e31;return _0xe51de;})[_0x297b('0x23')](respondWithFilteredResult(_0x861618,_0x323c47))[_0x297b('0x41')](handleError(_0x861618,null));};exports[_0x297b('0x42')]=function(_0x45a868,_0x1168ea){var _0x31780c={'raw':!![],'where':{'id':_0x45a868['params']['id']}},_0x3b89e3={};_0x3b89e3[_0x297b('0x2d')]=_['keys'](db[_0x297b('0x3c')][_0x297b('0x29')]);_0x3b89e3[_0x297b('0x2f')]=_[_0x297b('0x30')](_0x45a868[_0x297b('0x2f')]);_0x3b89e3[_0x297b('0x31')]=_[_0x297b('0x32')](_0x3b89e3['model'],_0x3b89e3[_0x297b('0x2f')]);_0x31780c[_0x297b('0x34')]=_['intersection'](_0x3b89e3[_0x297b('0x2d')],qs[_0x297b('0x33')](_0x45a868[_0x297b('0x2f')]['fields']));_0x31780c[_0x297b('0x34')]=_0x31780c[_0x297b('0x34')][_0x297b('0x43')]?_0x31780c['attributes']:_0x3b89e3[_0x297b('0x2d')];if(_0x45a868[_0x297b('0x2f')][_0x297b('0x3d')]){_0x31780c['include']=[{'all':!![]}];}_0x31780c=_[_0x297b('0x39')]({},_0x31780c,_0x45a868[_0x297b('0x3b')]);return db[_0x297b('0x3c')][_0x297b('0x44')](_0x31780c)[_0x297b('0x23')](handleEntityNotFound(_0x1168ea,null))['then'](respondWithResult(_0x1168ea,null))[_0x297b('0x41')](handleError(_0x1168ea,null));};exports[_0x297b('0x45')]=function(_0x5895b4,_0x3469f1){return db[_0x297b('0x3c')][_0x297b('0x45')](_0x5895b4[_0x297b('0x46')],{})[_0x297b('0x23')](respondWithResult(_0x3469f1,0xc9))[_0x297b('0x41')](handleError(_0x3469f1,null));};exports[_0x297b('0x47')]=function(_0x4e7e7e,_0x17d098){if(_0x4e7e7e[_0x297b('0x46')]['id']){delete _0x4e7e7e[_0x297b('0x46')]['id'];}return db[_0x297b('0x3c')]['find']({'where':{'id':_0x4e7e7e[_0x297b('0x48')]['id']}})[_0x297b('0x23')](handleEntityNotFound(_0x17d098,null))[_0x297b('0x23')](saveUpdates(_0x4e7e7e['body'],null))[_0x297b('0x23')](respondWithResult(_0x17d098,null))[_0x297b('0x41')](handleError(_0x17d098,null));};exports[_0x297b('0x24')]=function(_0xc11452,_0x5411e6){return db['SquareMessage'][_0x297b('0x44')]({'where':{'id':_0xc11452[_0x297b('0x48')]['id']}})[_0x297b('0x23')](handleEntityNotFound(_0x5411e6,null))['then'](removeEntity(_0x5411e6,null))[_0x297b('0x41')](handleError(_0x5411e6,null));};
\ No newline at end of file
index 0bb26ea..c8143b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa354=['define','SquareMessage','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x40b69c,_0x40448f){var _0x32bd22=function(_0x3d6a9b){while(--_0x3d6a9b){_0x40b69c['push'](_0x40b69c['shift']());}};_0x32bd22(++_0x40448f);}(_0xa354,0x13d));var _0x4a35=function(_0x4e302f,_0x5eb4a8){_0x4e302f=_0x4e302f-0x0;var _0x5a4227=_0xa354[_0x4e302f];return _0x5a4227;};'use strict';var _=require(_0x4a35('0x0'));var util=require('util');var logger=require(_0x4a35('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a35('0x2'));var fs=require('fs');var path=require(_0x4a35('0x3'));var rimraf=require(_0x4a35('0x4'));var config=require(_0x4a35('0x5'));var attributes=require('./squareMessage.attributes');module[_0x4a35('0x6')]=function(_0x53f77a,_0x2ece51){return _0x53f77a[_0x4a35('0x7')](_0x4a35('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x14b3=['util','api','moment','bluebird','rimraf','../../config/environment','./squareMessage.attributes','exports','lodash'];(function(_0x4a725f,_0x414a30){var _0x129b30=function(_0x190451){while(--_0x190451){_0x4a725f['push'](_0x4a725f['shift']());}};_0x129b30(++_0x414a30);}(_0x14b3,0x98));var _0x314b=function(_0x4a095e,_0x381cd5){_0x4a095e=_0x4a095e-0x0;var _0x10ef73=_0x14b3[_0x4a095e];return _0x10ef73;};'use strict';var _=require(_0x314b('0x0'));var util=require(_0x314b('0x1'));var logger=require('../../config/logger')(_0x314b('0x2'));var moment=require(_0x314b('0x3'));var BPromise=require(_0x314b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x314b('0x5'));var config=require(_0x314b('0x6'));var attributes=require(_0x314b('0x7'));module[_0x314b('0x8')]=function(_0x21a08a,_0x291e46){return _0x21a08a['define']('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ca393b0..6f5b036 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa216=['catch','CreateSquareMessage','SquareMessage','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x18a288,_0x1fc847){var _0x4467b1=function(_0x1551b6){while(--_0x1551b6){_0x18a288['push'](_0x18a288['shift']());}};_0x4467b1(++_0x1fc847);}(_0xa216,0x1c6));var _0x6a21=function(_0x163b76,_0x579912){_0x163b76=_0x163b76-0x0;var _0x262091=_0xa216[_0x163b76];return _0x262091;};'use strict';var _=require(_0x6a21('0x0'));var util=require(_0x6a21('0x1'));var moment=require(_0x6a21('0x2'));var BPromise=require(_0x6a21('0x3'));var rs=require(_0x6a21('0x4'));var fs=require('fs');var Redis=require(_0x6a21('0x5'));var db=require(_0x6a21('0x6'))['db'];var utils=require(_0x6a21('0x7'));var logger=require(_0x6a21('0x8'))(_0x6a21('0x9'));var config=require(_0x6a21('0xa'));var jayson=require(_0x6a21('0xb'));var client=jayson[_0x6a21('0xc')][_0x6a21('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5d5c59,_0x30b30b,_0xb20ed2){return new BPromise(function(_0x34a554,_0x9d7c2c){return client[_0x6a21('0xe')](_0x5d5c59,_0xb20ed2)[_0x6a21('0xf')](function(_0x2bc2c0){logger[_0x6a21('0x10')](_0x6a21('0x11'),_0x30b30b,_0x6a21('0x12'));logger[_0x6a21('0x13')](_0x6a21('0x14'),_0x30b30b,'request\x20sent',JSON[_0x6a21('0x15')](_0x2bc2c0));if(_0x2bc2c0[_0x6a21('0x16')]){if(_0x2bc2c0[_0x6a21('0x16')][_0x6a21('0x17')]===0x1f4){logger['error'](_0x6a21('0x11'),_0x30b30b,_0x2bc2c0[_0x6a21('0x16')][_0x6a21('0x18')]);return _0x9d7c2c(_0x2bc2c0['error'][_0x6a21('0x18')]);}logger['error'](_0x6a21('0x11'),_0x30b30b,_0x2bc2c0['error'][_0x6a21('0x18')]);return _0x34a554(_0x2bc2c0[_0x6a21('0x16')]['message']);}else{logger['info'](_0x6a21('0x11'),_0x30b30b,'request\x20sent');_0x34a554(_0x2bc2c0[_0x6a21('0x19')]['message']);}})[_0x6a21('0x1a')](function(_0xe1faec){logger[_0x6a21('0x16')]('SquareMessage,\x20%s,\x20%s',_0x30b30b,_0xe1faec);_0x9d7c2c(_0xe1faec);});});}exports[_0x6a21('0x1b')]=function(_0x474e5c){var _0x4ca275=this;return new Promise(function(_0x395cc3,_0x536008){return db[_0x6a21('0x1c')]['create'](_0x474e5c[_0x6a21('0x1d')],{'raw':_0x474e5c[_0x6a21('0x1e')]?_0x474e5c[_0x6a21('0x1e')][_0x6a21('0x1f')]===undefined?!![]:![]:!![]})[_0x6a21('0xf')](function(_0x95ccf2){logger[_0x6a21('0x10')](_0x6a21('0x1b'),_0x474e5c);logger['debug'](_0x6a21('0x1b'),_0x474e5c,JSON[_0x6a21('0x15')](_0x95ccf2));_0x395cc3(_0x95ccf2);})[_0x6a21('0x1a')](function(_0x18ecef){logger[_0x6a21('0x16')](_0x6a21('0x1b'),_0x18ecef['message'],_0x474e5c);_0x536008(_0x4ca275[_0x6a21('0x16')](0x1f4,_0x18ecef[_0x6a21('0x18')]));});});};
\ No newline at end of file
+var _0x2fa0=['CreateSquareMessage','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','catch','create','body','options'];(function(_0x314007,_0x2ca16e){var _0x2ec231=function(_0x57b340){while(--_0x57b340){_0x314007['push'](_0x314007['shift']());}};_0x2ec231(++_0x2ca16e);}(_0x2fa0,0x1f0));var _0x02fa=function(_0xac7a9b,_0x53c954){_0xac7a9b=_0xac7a9b-0x0;var _0x618f4c=_0x2fa0[_0xac7a9b];return _0x618f4c;};'use strict';var _=require(_0x02fa('0x0'));var util=require(_0x02fa('0x1'));var moment=require('moment');var BPromise=require(_0x02fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02fa('0x3'));var db=require(_0x02fa('0x4'))['db'];var utils=require(_0x02fa('0x5'));var logger=require(_0x02fa('0x6'))(_0x02fa('0x7'));var config=require(_0x02fa('0x8'));var jayson=require(_0x02fa('0x9'));var client=jayson[_0x02fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x462e3e,_0xf5a7ac,_0x30bedb){return new BPromise(function(_0x1fde4f,_0xfb8c09){return client['request'](_0x462e3e,_0x30bedb)[_0x02fa('0xb')](function(_0x207daa){logger[_0x02fa('0xc')]('SquareMessage,\x20%s,\x20%s',_0xf5a7ac,'request\x20sent');logger['debug'](_0x02fa('0xd'),_0xf5a7ac,_0x02fa('0xe'),JSON[_0x02fa('0xf')](_0x207daa));if(_0x207daa['error']){if(_0x207daa[_0x02fa('0x10')][_0x02fa('0x11')]===0x1f4){logger[_0x02fa('0x10')](_0x02fa('0x12'),_0xf5a7ac,_0x207daa[_0x02fa('0x10')][_0x02fa('0x13')]);return _0xfb8c09(_0x207daa[_0x02fa('0x10')]['message']);}logger[_0x02fa('0x10')](_0x02fa('0x12'),_0xf5a7ac,_0x207daa[_0x02fa('0x10')][_0x02fa('0x13')]);return _0x1fde4f(_0x207daa[_0x02fa('0x10')][_0x02fa('0x13')]);}else{logger[_0x02fa('0xc')](_0x02fa('0x12'),_0xf5a7ac,_0x02fa('0xe'));_0x1fde4f(_0x207daa['result'][_0x02fa('0x13')]);}})[_0x02fa('0x14')](function(_0x5b2def){logger[_0x02fa('0x10')]('SquareMessage,\x20%s,\x20%s',_0xf5a7ac,_0x5b2def);_0xfb8c09(_0x5b2def);});});}exports['CreateSquareMessage']=function(_0x441106){var _0x4ffb77=this;return new Promise(function(_0x404953,_0x5a62af){return db['SquareMessage'][_0x02fa('0x15')](_0x441106[_0x02fa('0x16')],{'raw':_0x441106['options']?_0x441106[_0x02fa('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4e73a9){logger['info'](_0x02fa('0x18'),_0x441106);logger[_0x02fa('0x19')](_0x02fa('0x18'),_0x441106,JSON[_0x02fa('0xf')](_0x4e73a9));_0x404953(_0x4e73a9);})[_0x02fa('0x14')](function(_0x49653d){logger[_0x02fa('0x10')](_0x02fa('0x18'),_0x49653d[_0x02fa('0x13')],_0x441106);_0x5a62af(_0x4ffb77[_0x02fa('0x10')](0x1f4,_0x49653d[_0x02fa('0x13')]));});});};
\ No newline at end of file
index 34053cb..ffc9cf8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be1=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/test','15s','post','create','put','update','delete','destroy','util','connect-timeout','express'];(function(_0x3f9924,_0x2b66d6){var _0x1fb85e=function(_0x2ca373){while(--_0x2ca373){_0x3f9924['push'](_0x3f9924['shift']());}};_0x1fb85e(++_0x2b66d6);}(_0x0be1,0x151));var _0x10be=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0x0be1[_0xc40b9f];return _0x535b9c;};'use strict';var multer=require('multer');var util=require(_0x10be('0x0'));var path=require('path');var timeout=require(_0x10be('0x1'));var express=require(_0x10be('0x2'));var router=express['Router']();var fs_extra=require(_0x10be('0x3'));var auth=require(_0x10be('0x4'));var interaction=require(_0x10be('0x5'));var config=require(_0x10be('0x6'));var controller=require('./squareOdbc.controller');router[_0x10be('0x7')]('/',auth[_0x10be('0x8')](),controller[_0x10be('0x9')]);router[_0x10be('0x7')](_0x10be('0xa'),auth[_0x10be('0x8')](),controller[_0x10be('0xb')]);router[_0x10be('0x7')](_0x10be('0xc'),auth[_0x10be('0x8')](),timeout(_0x10be('0xd')),controller['test']);router[_0x10be('0xe')]('/',auth[_0x10be('0x8')](),controller[_0x10be('0xf')]);router[_0x10be('0x10')](_0x10be('0xa'),auth[_0x10be('0x8')](),controller[_0x10be('0x11')]);router[_0x10be('0x12')]('/:id',auth[_0x10be('0x8')](),controller[_0x10be('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x2ccc=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put'];(function(_0x501c2d,_0x5c239f){var _0x410bc7=function(_0x4268aa){while(--_0x4268aa){_0x501c2d['push'](_0x501c2d['shift']());}};_0x410bc7(++_0x5c239f);}(_0x2ccc,0x118));var _0xc2cc=function(_0x1bc512,_0x3b98ae){_0x1bc512=_0x1bc512-0x0;var _0x90f1c1=_0x2ccc[_0x1bc512];return _0x90f1c1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc2cc('0x0'));var timeout=require(_0xc2cc('0x1'));var express=require(_0xc2cc('0x2'));var router=express[_0xc2cc('0x3')]();var fs_extra=require(_0xc2cc('0x4'));var auth=require(_0xc2cc('0x5'));var interaction=require(_0xc2cc('0x6'));var config=require(_0xc2cc('0x7'));var controller=require(_0xc2cc('0x8'));router[_0xc2cc('0x9')]('/',auth[_0xc2cc('0xa')](),controller[_0xc2cc('0xb')]);router[_0xc2cc('0x9')](_0xc2cc('0xc'),auth[_0xc2cc('0xa')](),controller[_0xc2cc('0xd')]);router[_0xc2cc('0x9')](_0xc2cc('0xe'),auth[_0xc2cc('0xa')](),timeout(_0xc2cc('0xf')),controller[_0xc2cc('0x10')]);router[_0xc2cc('0x11')]('/',auth[_0xc2cc('0xa')](),controller['create']);router[_0xc2cc('0x12')](_0xc2cc('0xc'),auth[_0xc2cc('0xa')](),controller[_0xc2cc('0x13')]);router[_0xc2cc('0x14')](_0xc2cc('0xc'),auth[_0xc2cc('0xa')](),controller[_0xc2cc('0x15')]);module[_0xc2cc('0x16')]=router;
\ No newline at end of file
index c657037..c8f3163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x285f=['exports','STRING','name'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0x285f,0x144));var _0xf285=function(_0x1e3df4,_0xb7dd65){_0x1e3df4=_0x1e3df4-0x0;var _0x5c29a2=_0x285f[_0x1e3df4];return _0x5c29a2;};'use strict';var Sequelize=require('sequelize');module[_0xf285('0x0')]={'name':{'type':Sequelize[_0xf285('0x1')],'unique':_0xf285('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xf285('0x1')]},'description':{'type':Sequelize[_0xf285('0x1')]}};
\ No newline at end of file
+var _0x1326=['STRING','sequelize'];(function(_0xeda63d,_0x1da6f7){var _0x59994b=function(_0x288d9b){while(--_0x288d9b){_0xeda63d['push'](_0xeda63d['shift']());}};_0x59994b(++_0x1da6f7);}(_0x1326,0x101));var _0x6132=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0x1326[_0x2493f7];return _0x594ab2;};'use strict';var Sequelize=require(_0x6132('0x0'));module['exports']={'name':{'type':Sequelize[_0x6132('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x6132('0x1')]},'description':{'type':Sequelize[_0x6132('0x1')]}};
\ No newline at end of file
index bc4d8e3..f387a3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6232=['update','then','get','ODBC','UserProfileResource','destroy','end','error','stack','name','send','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','SquareOdbc','findAll','rows','catch','show','rawAttributes','length','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','offset','count','Content-Range','json','apply','reject','save'];(function(_0xd71a41,_0x10d290){var _0x10dfa0=function(_0x82e5f8){while(--_0x82e5f8){_0xd71a41['push'](_0xd71a41['shift']());}};_0x10dfa0(++_0x10d290);}(_0x6232,0x8f));var _0x2623=function(_0x548955,_0x144815){_0x548955=_0x548955-0x0;var _0xa8a9b9=_0x6232[_0x548955];return _0xa8a9b9;};'use strict';var emlformat=require(_0x2623('0x0'));var rimraf=require(_0x2623('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2623('0x2'));var moment=require('moment');var BPromise=require(_0x2623('0x3'));var Mustache=require(_0x2623('0x4'));var util=require(_0x2623('0x5'));var path=require(_0x2623('0x6'));var sox=require(_0x2623('0x7'));var csv=require(_0x2623('0x8'));var ejs=require(_0x2623('0x9'));var fs=require('fs');var fs_extra=require(_0x2623('0xa'));var _=require(_0x2623('0xb'));var squel=require(_0x2623('0xc'));var crypto=require('crypto');var jsforce=require(_0x2623('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2623('0x8'));var querystring=require('querystring');var Papa=require(_0x2623('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2623('0xf'));var as=require(_0x2623('0x10'));var hardwareService=require(_0x2623('0x11'));var logger=require(_0x2623('0x12'))(_0x2623('0x13'));var utils=require(_0x2623('0x14'));var config=require(_0x2623('0x15'));var licenseUtil=require(_0x2623('0x16'));var db=require(_0x2623('0x17'))['db'];function respondWithStatusCode(_0x5e73df,_0x200403){_0x200403=_0x200403||0xcc;return function(_0x2d6e4d){if(_0x2d6e4d){return _0x5e73df[_0x2623('0x18')](_0x200403);}return _0x5e73df[_0x2623('0x19')](_0x200403)['end']();};}function respondWithResult(_0x19c33a,_0xa1cc1e){_0xa1cc1e=_0xa1cc1e||0xc8;return function(_0x5e7d06){if(_0x5e7d06){return _0x19c33a['status'](_0xa1cc1e)['json'](_0x5e7d06);}};}function respondWithFilteredResult(_0x5a4e05,_0x5e7433){return function(_0x50d506){if(_0x50d506){var _0x2a6440=typeof _0x5e7433['offset']===_0x2623('0x1a')&&typeof _0x5e7433[_0x2623('0x1b')]===_0x2623('0x1a');var _0x2d88ea=_0x50d506['count'];var _0x42c497=_0x2a6440?0x0:_0x5e7433[_0x2623('0x1c')];var _0xecb4cd=_0x2a6440?_0x50d506[_0x2623('0x1d')]:_0x5e7433[_0x2623('0x1c')]+_0x5e7433['limit'];var _0x1f465c;if(_0xecb4cd>=_0x2d88ea){_0xecb4cd=_0x2d88ea;_0x1f465c=0xc8;}else{_0x1f465c=0xce;}_0x5a4e05['status'](_0x1f465c);return _0x5a4e05['set'](_0x2623('0x1e'),_0x42c497+'-'+_0xecb4cd+'/'+_0x2d88ea)[_0x2623('0x1f')](_0x50d506);}return null;};}function patchUpdates(_0x159725){return function(_0x340647){try{jsonpatch[_0x2623('0x20')](_0x340647,_0x159725,!![]);}catch(_0x3aaae4){return BPromise[_0x2623('0x21')](_0x3aaae4);}return _0x340647[_0x2623('0x22')]();};}function saveUpdates(_0x217940,_0x5e01d2){return function(_0x534952){if(_0x534952){return _0x534952[_0x2623('0x23')](_0x217940)['then'](function(_0x4d383f){return _0x4d383f;});}return null;};}function removeEntity(_0x31f65f,_0x532732){return function(_0x33ec16){if(_0x33ec16){return _0x33ec16['destroy']()[_0x2623('0x24')](function(){var _0x3f3c10=_0x33ec16[_0x2623('0x25')]({'plain':!![]});var _0x5499ea=_0x2623('0x26');return db[_0x2623('0x27')][_0x2623('0x28')]({'where':{'type':_0x5499ea,'resourceId':_0x3f3c10['id']}})[_0x2623('0x24')](function(){return _0x33ec16;});})[_0x2623('0x24')](function(){_0x31f65f[_0x2623('0x19')](0xcc)[_0x2623('0x29')]();});}};}function handleEntityNotFound(_0x43ad48,_0xef61d0){return function(_0x31416a){if(!_0x31416a){_0x43ad48[_0x2623('0x18')](0x194);}return _0x31416a;};}function handleError(_0xc7e61f,_0x46e802){_0x46e802=_0x46e802||0x1f4;return function(_0x4772a9){logger[_0x2623('0x2a')](_0x4772a9[_0x2623('0x2b')]);if(_0x4772a9[_0x2623('0x2c')]){delete _0x4772a9[_0x2623('0x2c')];}_0xc7e61f['status'](_0x46e802)[_0x2623('0x2d')](_0x4772a9);};}exports[_0x2623('0x2e')]=function(_0x2ffa08,_0x46d798){var _0x321220={},_0x59ee25={},_0x305e58={'count':0x0,'rows':[]};var _0x2bb4a7=_[_0x2623('0x2f')](db['SquareOdbc']['rawAttributes'],function(_0x1afc21){return{'name':_0x1afc21[_0x2623('0x30')],'type':_0x1afc21['type'][_0x2623('0x31')]};});_0x59ee25['model']=_[_0x2623('0x2f')](_0x2bb4a7,_0x2623('0x2c'));_0x59ee25[_0x2623('0x32')]=_[_0x2623('0x33')](_0x2ffa08[_0x2623('0x32')]);_0x59ee25['filters']=_[_0x2623('0x34')](_0x59ee25[_0x2623('0x35')],_0x59ee25[_0x2623('0x32')]);_0x321220[_0x2623('0x36')]=_[_0x2623('0x34')](_0x59ee25['model'],qs[_0x2623('0x37')](_0x2ffa08[_0x2623('0x32')]['fields']));_0x321220['attributes']=_0x321220['attributes']['length']?_0x321220['attributes']:_0x59ee25[_0x2623('0x35')];if(!_0x2ffa08[_0x2623('0x32')][_0x2623('0x38')](_0x2623('0x39'))){_0x321220[_0x2623('0x1b')]=qs['limit'](_0x2ffa08['query']['limit']);_0x321220[_0x2623('0x1c')]=qs[_0x2623('0x1c')](_0x2ffa08['query'][_0x2623('0x1c')]);}_0x321220[_0x2623('0x3a')]=qs[_0x2623('0x3b')](_0x2ffa08['query'][_0x2623('0x3b')]);_0x321220['where']=qs[_0x2623('0x3c')](_[_0x2623('0x3d')](_0x2ffa08['query'],_0x59ee25['filters']),_0x2bb4a7);if(_0x2ffa08[_0x2623('0x32')][_0x2623('0x3e')]){_0x321220[_0x2623('0x3f')]=_[_0x2623('0x40')](_0x321220[_0x2623('0x3f')],{'$or':_[_0x2623('0x2f')](_0x2bb4a7,function(_0x349d8c){if(_0x349d8c['type']!==_0x2623('0x41')){var _0x37be9a={};_0x37be9a[_0x349d8c[_0x2623('0x2c')]]={'$like':'%'+_0x2ffa08[_0x2623('0x32')]['filter']+'%'};return _0x37be9a;}})});}_0x321220=_[_0x2623('0x40')]({},_0x321220,_0x2ffa08[_0x2623('0x42')]);var _0x972551={'where':_0x321220[_0x2623('0x3f')]};return db['SquareOdbc'][_0x2623('0x1d')](_0x972551)[_0x2623('0x24')](function(_0xebd85f){_0x305e58[_0x2623('0x1d')]=_0xebd85f;if(_0x2ffa08['query']['includeAll']){_0x321220[_0x2623('0x43')]=[{'all':!![]}];}return db[_0x2623('0x44')][_0x2623('0x45')](_0x321220);})[_0x2623('0x24')](function(_0x3ba220){_0x305e58[_0x2623('0x46')]=_0x3ba220;return _0x305e58;})[_0x2623('0x24')](respondWithFilteredResult(_0x46d798,_0x321220))[_0x2623('0x47')](handleError(_0x46d798,null));};exports[_0x2623('0x48')]=function(_0x413a95,_0x51372d){var _0x57c7f3={'raw':!![],'where':{'id':_0x413a95['params']['id']}},_0x5e363d={};_0x5e363d[_0x2623('0x35')]=_[_0x2623('0x33')](db[_0x2623('0x44')][_0x2623('0x49')]);_0x5e363d[_0x2623('0x32')]=_['keys'](_0x413a95[_0x2623('0x32')]);_0x5e363d[_0x2623('0x3c')]=_[_0x2623('0x34')](_0x5e363d[_0x2623('0x35')],_0x5e363d[_0x2623('0x32')]);_0x57c7f3[_0x2623('0x36')]=_[_0x2623('0x34')](_0x5e363d['model'],qs[_0x2623('0x37')](_0x413a95[_0x2623('0x32')][_0x2623('0x37')]));_0x57c7f3[_0x2623('0x36')]=_0x57c7f3[_0x2623('0x36')][_0x2623('0x4a')]?_0x57c7f3['attributes']:_0x5e363d[_0x2623('0x35')];if(_0x413a95['query'][_0x2623('0x4b')]){_0x57c7f3[_0x2623('0x43')]=[{'all':!![]}];}_0x57c7f3=_[_0x2623('0x40')]({},_0x57c7f3,_0x413a95[_0x2623('0x42')]);return db[_0x2623('0x44')][_0x2623('0x4c')](_0x57c7f3)[_0x2623('0x24')](handleEntityNotFound(_0x51372d,null))[_0x2623('0x24')](respondWithResult(_0x51372d,null))['catch'](handleError(_0x51372d,null));};exports[_0x2623('0x4d')]=function(_0x5f0969,_0x164e87){return db['SquareOdbc'][_0x2623('0x4d')](_0x5f0969[_0x2623('0x4e')],{})[_0x2623('0x24')](function(_0xdeadfc){var _0x49a81f=_0x5f0969['user']['get']({'plain':!![]});if(!_0x49a81f)throw new Error(_0x2623('0x4f'));if(_0x49a81f[_0x2623('0x50')]==='user'){var _0x4d0a28=_0xdeadfc[_0x2623('0x25')]({'plain':!![]});var _0x286b1a=_0x2623('0x26');return db[_0x2623('0x51')][_0x2623('0x4c')]({'where':{'name':_0x286b1a,'userProfileId':_0x49a81f[_0x2623('0x52')]},'raw':!![]})[_0x2623('0x24')](function(_0x5754b1){if(_0x5754b1&&_0x5754b1['autoAssociation']===0x0){return db['UserProfileResource'][_0x2623('0x4d')]({'name':_0x4d0a28[_0x2623('0x2c')],'resourceId':_0x4d0a28['id'],'type':_0x5754b1[_0x2623('0x2c')],'sectionId':_0x5754b1['id']},{})[_0x2623('0x24')](function(){return _0xdeadfc;});}else{return _0xdeadfc;}})['catch'](function(_0x1f6937){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f6937);throw _0x1f6937;});}return _0xdeadfc;})[_0x2623('0x24')](respondWithResult(_0x164e87,0xc9))[_0x2623('0x47')](handleError(_0x164e87,null));};exports[_0x2623('0x23')]=function(_0x41319a,_0x3554db){if(_0x41319a[_0x2623('0x4e')]['id']){delete _0x41319a['body']['id'];}return db[_0x2623('0x44')][_0x2623('0x4c')]({'where':{'id':_0x41319a['params']['id']}})['then'](handleEntityNotFound(_0x3554db,null))[_0x2623('0x24')](saveUpdates(_0x41319a['body'],null))['then'](respondWithResult(_0x3554db,null))[_0x2623('0x47')](handleError(_0x3554db,null));};exports['destroy']=function(_0x4d733b,_0x26f455){return db['SquareOdbc'][_0x2623('0x4c')]({'where':{'id':_0x4d733b[_0x2623('0x53')]['id']}})[_0x2623('0x24')](handleEntityNotFound(_0x26f455,null))['then'](removeEntity(_0x26f455,null))[_0x2623('0x47')](handleError(_0x26f455,null));};exports[_0x2623('0x54')]=function(_0x475036,_0x190d9c,_0x499bca){var _0x582aaf;return db['SquareOdbc'][_0x2623('0x4c')]({'where':{'id':_0x475036['params']['id']},'attributes':['id',_0x2623('0x55')]})[_0x2623('0x24')](handleEntityNotFound(_0x190d9c,null))[_0x2623('0x24')](function(_0x3f6e9b){if(_0x3f6e9b){var _0x112414=require(_0x2623('0x56'))();_0x112414[_0x2623('0x57')](_0x3f6e9b[_0x2623('0x55')]);_0x112414[_0x2623('0x58')]();return _0x3f6e9b;}})['then'](respondWithResult(_0x190d9c,null))[_0x2623('0x47')](handleError(_0x190d9c,null));};
\ No newline at end of file
+var _0x5473=['UserProfileSection','userProfileId','autoAssociation','catch','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','UserProfileResource','destroy','end','error','stack','name','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SquareOdbc','includeAll','findAll','rows','show','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC'];(function(_0x58a4d5,_0x5f3298){var _0x169f33=function(_0xecbf8f){while(--_0xecbf8f){_0x58a4d5['push'](_0x58a4d5['shift']());}};_0x169f33(++_0x5f3298);}(_0x5473,0x172));var _0x3547=function(_0x353fba,_0x46db7e){_0x353fba=_0x353fba-0x0;var _0x4694e4=_0x5473[_0x353fba];return _0x4694e4;};'use strict';var emlformat=require(_0x3547('0x0'));var rimraf=require(_0x3547('0x1'));var zipdir=require(_0x3547('0x2'));var jsonpatch=require(_0x3547('0x3'));var rp=require('request-promise');var moment=require(_0x3547('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3547('0x5'));var util=require(_0x3547('0x6'));var path=require(_0x3547('0x7'));var sox=require(_0x3547('0x8'));var csv=require(_0x3547('0x9'));var ejs=require(_0x3547('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3547('0xb'));var squel=require(_0x3547('0xc'));var crypto=require(_0x3547('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x3547('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3547('0xf'));var Papa=require('papaparse');var Redis=require(_0x3547('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3547('0x11'));var as=require(_0x3547('0x12'));var hardwareService=require(_0x3547('0x13'));var logger=require(_0x3547('0x14'))(_0x3547('0x15'));var utils=require(_0x3547('0x16'));var config=require(_0x3547('0x17'));var licenseUtil=require(_0x3547('0x18'));var db=require(_0x3547('0x19'))['db'];function respondWithStatusCode(_0x1a06df,_0x62553c){_0x62553c=_0x62553c||0xcc;return function(_0x13c87){if(_0x13c87){return _0x1a06df[_0x3547('0x1a')](_0x62553c);}return _0x1a06df[_0x3547('0x1b')](_0x62553c)['end']();};}function respondWithResult(_0x38d932,_0x10ad27){_0x10ad27=_0x10ad27||0xc8;return function(_0x4fbf0f){if(_0x4fbf0f){return _0x38d932[_0x3547('0x1b')](_0x10ad27)[_0x3547('0x1c')](_0x4fbf0f);}};}function respondWithFilteredResult(_0x40eac5,_0x5bcf1f){return function(_0x589fc4){if(_0x589fc4){var _0x4401c4=typeof _0x5bcf1f[_0x3547('0x1d')]==='undefined'&&typeof _0x5bcf1f['limit']===_0x3547('0x1e');var _0x3b016c=_0x589fc4[_0x3547('0x1f')];var _0x768a04=_0x4401c4?0x0:_0x5bcf1f[_0x3547('0x1d')];var _0x337b12=_0x4401c4?_0x589fc4[_0x3547('0x1f')]:_0x5bcf1f[_0x3547('0x1d')]+_0x5bcf1f[_0x3547('0x20')];var _0x448cb7;if(_0x337b12>=_0x3b016c){_0x337b12=_0x3b016c;_0x448cb7=0xc8;}else{_0x448cb7=0xce;}_0x40eac5[_0x3547('0x1b')](_0x448cb7);return _0x40eac5[_0x3547('0x21')](_0x3547('0x22'),_0x768a04+'-'+_0x337b12+'/'+_0x3b016c)[_0x3547('0x1c')](_0x589fc4);}return null;};}function patchUpdates(_0x146131){return function(_0x4d4439){try{jsonpatch[_0x3547('0x23')](_0x4d4439,_0x146131,!![]);}catch(_0x42fd74){return BPromise[_0x3547('0x24')](_0x42fd74);}return _0x4d4439[_0x3547('0x25')]();};}function saveUpdates(_0x2f83a0,_0x4187ba){return function(_0x26ad53){if(_0x26ad53){return _0x26ad53[_0x3547('0x26')](_0x2f83a0)[_0x3547('0x27')](function(_0x3cf403){return _0x3cf403;});}return null;};}function removeEntity(_0x3bb054,_0x1ba688){return function(_0xc0e3c4){if(_0xc0e3c4){return _0xc0e3c4['destroy']()[_0x3547('0x27')](function(){var _0x1c4f9b=_0xc0e3c4['get']({'plain':!![]});var _0x7d9391='ODBC';return db[_0x3547('0x28')][_0x3547('0x29')]({'where':{'type':_0x7d9391,'resourceId':_0x1c4f9b['id']}})[_0x3547('0x27')](function(){return _0xc0e3c4;});})[_0x3547('0x27')](function(){_0x3bb054[_0x3547('0x1b')](0xcc)[_0x3547('0x2a')]();});}};}function handleEntityNotFound(_0x34d219,_0x33b695){return function(_0x909628){if(!_0x909628){_0x34d219[_0x3547('0x1a')](0x194);}return _0x909628;};}function handleError(_0x4d6c17,_0x25e59d){_0x25e59d=_0x25e59d||0x1f4;return function(_0x3488b7){logger[_0x3547('0x2b')](_0x3488b7[_0x3547('0x2c')]);if(_0x3488b7[_0x3547('0x2d')]){delete _0x3488b7[_0x3547('0x2d')];}_0x4d6c17[_0x3547('0x1b')](_0x25e59d)['send'](_0x3488b7);};}exports[_0x3547('0x2e')]=function(_0x55a4ea,_0x243e9f){var _0x59760c={},_0x457cc3={},_0x7c196e={'count':0x0,'rows':[]};var _0x105926=_['map'](db['SquareOdbc'][_0x3547('0x2f')],function(_0x11074f){return{'name':_0x11074f[_0x3547('0x30')],'type':_0x11074f[_0x3547('0x31')]['key']};});_0x457cc3[_0x3547('0x32')]=_[_0x3547('0x33')](_0x105926,_0x3547('0x2d'));_0x457cc3[_0x3547('0x34')]=_[_0x3547('0x35')](_0x55a4ea[_0x3547('0x34')]);_0x457cc3[_0x3547('0x36')]=_[_0x3547('0x37')](_0x457cc3[_0x3547('0x32')],_0x457cc3['query']);_0x59760c[_0x3547('0x38')]=_['intersection'](_0x457cc3[_0x3547('0x32')],qs[_0x3547('0x39')](_0x55a4ea[_0x3547('0x34')]['fields']));_0x59760c[_0x3547('0x38')]=_0x59760c[_0x3547('0x38')][_0x3547('0x3a')]?_0x59760c['attributes']:_0x457cc3['model'];if(!_0x55a4ea[_0x3547('0x34')]['hasOwnProperty'](_0x3547('0x3b'))){_0x59760c[_0x3547('0x20')]=qs[_0x3547('0x20')](_0x55a4ea[_0x3547('0x34')][_0x3547('0x20')]);_0x59760c[_0x3547('0x1d')]=qs[_0x3547('0x1d')](_0x55a4ea[_0x3547('0x34')][_0x3547('0x1d')]);}_0x59760c[_0x3547('0x3c')]=qs[_0x3547('0x3d')](_0x55a4ea[_0x3547('0x34')][_0x3547('0x3d')]);_0x59760c['where']=qs[_0x3547('0x36')](_['pick'](_0x55a4ea[_0x3547('0x34')],_0x457cc3[_0x3547('0x36')]),_0x105926);if(_0x55a4ea[_0x3547('0x34')]['filter']){_0x59760c[_0x3547('0x3e')]=_[_0x3547('0x3f')](_0x59760c['where'],{'$or':_[_0x3547('0x33')](_0x105926,function(_0x253569){if(_0x253569['type']!==_0x3547('0x40')){var _0x928959={};_0x928959[_0x253569['name']]={'$like':'%'+_0x55a4ea[_0x3547('0x34')][_0x3547('0x41')]+'%'};return _0x928959;}})});}_0x59760c=_[_0x3547('0x3f')]({},_0x59760c,_0x55a4ea[_0x3547('0x42')]);var _0x5ab0f3={'where':_0x59760c['where']};return db[_0x3547('0x43')][_0x3547('0x1f')](_0x5ab0f3)['then'](function(_0x3199c6){_0x7c196e[_0x3547('0x1f')]=_0x3199c6;if(_0x55a4ea[_0x3547('0x34')][_0x3547('0x44')]){_0x59760c['include']=[{'all':!![]}];}return db['SquareOdbc'][_0x3547('0x45')](_0x59760c);})[_0x3547('0x27')](function(_0x81d2cb){_0x7c196e[_0x3547('0x46')]=_0x81d2cb;return _0x7c196e;})[_0x3547('0x27')](respondWithFilteredResult(_0x243e9f,_0x59760c))['catch'](handleError(_0x243e9f,null));};exports[_0x3547('0x47')]=function(_0xc763ce,_0x2b041d){var _0x42285c={'raw':!![],'where':{'id':_0xc763ce['params']['id']}},_0x3d98a3={};_0x3d98a3[_0x3547('0x32')]=_[_0x3547('0x35')](db[_0x3547('0x43')][_0x3547('0x2f')]);_0x3d98a3[_0x3547('0x34')]=_[_0x3547('0x35')](_0xc763ce[_0x3547('0x34')]);_0x3d98a3[_0x3547('0x36')]=_[_0x3547('0x37')](_0x3d98a3[_0x3547('0x32')],_0x3d98a3[_0x3547('0x34')]);_0x42285c['attributes']=_[_0x3547('0x37')](_0x3d98a3[_0x3547('0x32')],qs[_0x3547('0x39')](_0xc763ce[_0x3547('0x34')][_0x3547('0x39')]));_0x42285c[_0x3547('0x38')]=_0x42285c['attributes'][_0x3547('0x3a')]?_0x42285c[_0x3547('0x38')]:_0x3d98a3[_0x3547('0x32')];if(_0xc763ce[_0x3547('0x34')][_0x3547('0x44')]){_0x42285c[_0x3547('0x48')]=[{'all':!![]}];}_0x42285c=_[_0x3547('0x3f')]({},_0x42285c,_0xc763ce['options']);return db[_0x3547('0x43')][_0x3547('0x49')](_0x42285c)[_0x3547('0x27')](handleEntityNotFound(_0x2b041d,null))[_0x3547('0x27')](respondWithResult(_0x2b041d,null))['catch'](handleError(_0x2b041d,null));};exports[_0x3547('0x4a')]=function(_0x130819,_0x2df196){return db['SquareOdbc'][_0x3547('0x4a')](_0x130819[_0x3547('0x4b')],{})[_0x3547('0x27')](function(_0x453266){var _0x195493=_0x130819['user'][_0x3547('0x4c')]({'plain':!![]});if(!_0x195493)throw new Error(_0x3547('0x4d'));if(_0x195493[_0x3547('0x4e')]==='user'){var _0x5dd537=_0x453266[_0x3547('0x4c')]({'plain':!![]});var _0x52869c=_0x3547('0x4f');return db[_0x3547('0x50')][_0x3547('0x49')]({'where':{'name':_0x52869c,'userProfileId':_0x195493[_0x3547('0x51')]},'raw':!![]})[_0x3547('0x27')](function(_0x284036){if(_0x284036&&_0x284036[_0x3547('0x52')]===0x0){return db[_0x3547('0x28')][_0x3547('0x4a')]({'name':_0x5dd537[_0x3547('0x2d')],'resourceId':_0x5dd537['id'],'type':_0x284036['name'],'sectionId':_0x284036['id']},{})[_0x3547('0x27')](function(){return _0x453266;});}else{return _0x453266;}})[_0x3547('0x53')](function(_0x2777bb){logger[_0x3547('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2777bb);throw _0x2777bb;});}return _0x453266;})[_0x3547('0x27')](respondWithResult(_0x2df196,0xc9))['catch'](handleError(_0x2df196,null));};exports[_0x3547('0x26')]=function(_0x402d55,_0x8d3d44){if(_0x402d55[_0x3547('0x4b')]['id']){delete _0x402d55[_0x3547('0x4b')]['id'];}return db[_0x3547('0x43')][_0x3547('0x49')]({'where':{'id':_0x402d55[_0x3547('0x54')]['id']}})[_0x3547('0x27')](handleEntityNotFound(_0x8d3d44,null))[_0x3547('0x27')](saveUpdates(_0x402d55[_0x3547('0x4b')],null))[_0x3547('0x27')](respondWithResult(_0x8d3d44,null))[_0x3547('0x53')](handleError(_0x8d3d44,null));};exports['destroy']=function(_0x564424,_0x4c47ee){return db['SquareOdbc'][_0x3547('0x49')]({'where':{'id':_0x564424[_0x3547('0x54')]['id']}})[_0x3547('0x27')](handleEntityNotFound(_0x4c47ee,null))[_0x3547('0x27')](removeEntity(_0x4c47ee,null))[_0x3547('0x53')](handleError(_0x4c47ee,null));};exports[_0x3547('0x55')]=function(_0x105a72,_0x50498f,_0x1f5583){var _0x3f1748;return db[_0x3547('0x43')]['find']({'where':{'id':_0x105a72[_0x3547('0x54')]['id']},'attributes':['id',_0x3547('0x56')]})[_0x3547('0x27')](handleEntityNotFound(_0x50498f,null))[_0x3547('0x27')](function(_0x51faac){if(_0x51faac){var _0x304db8=require(_0x3547('0x57'))();_0x304db8[_0x3547('0x58')](_0x51faac[_0x3547('0x56')]);_0x304db8[_0x3547('0x59')]();return _0x51faac;}})['then'](respondWithResult(_0x50498f,null))[_0x3547('0x53')](handleError(_0x50498f,null));};
\ No newline at end of file
index bd80d3d..19bec3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x530a=['api','bluebird','request-promise','path','rimraf','../../config/environment','square_odbc','lodash','util','../../config/logger'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x530a,0xed));var _0xa530=function(_0x52bacd,_0x3745c9){_0x52bacd=_0x52bacd-0x0;var _0x487b48=_0x530a[_0x52bacd];return _0x487b48;};'use strict';var _=require(_0xa530('0x0'));var util=require(_0xa530('0x1'));var logger=require(_0xa530('0x2'))(_0xa530('0x3'));var moment=require('moment');var BPromise=require(_0xa530('0x4'));var rp=require(_0xa530('0x5'));var fs=require('fs');var path=require(_0xa530('0x6'));var rimraf=require(_0xa530('0x7'));var config=require(_0xa530('0x8'));var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x5a6b92,_0x10e138){return _0x5a6b92['define']('SquareOdbc',attributes,{'tableName':_0xa530('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9d1f=['exports','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./squareOdbc.attributes'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9d1f,0x9d));var _0xf9d1=function(_0x3eb630,_0x552586){_0x3eb630=_0x3eb630-0x0;var _0x1b840d=_0x9d1f[_0x3eb630];return _0x1b840d;};'use strict';var _=require(_0xf9d1('0x0'));var util=require('util');var logger=require(_0xf9d1('0x1'))(_0xf9d1('0x2'));var moment=require(_0xf9d1('0x3'));var BPromise=require(_0xf9d1('0x4'));var rp=require(_0xf9d1('0x5'));var fs=require('fs');var path=require(_0xf9d1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf9d1('0x7'));module[_0xf9d1('0x8')]=function(_0x27ce23,_0x2a0569){return _0x27ce23['define'](_0xf9d1('0x9'),attributes,{'tableName':_0xf9d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 87dce55..3125ecd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c4b=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','result','SquareOdbc','find','options','raw','attributes','include','map','model','ShowSquareOdbc','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x19efbc,_0x10b7d7){var _0x205c5e=function(_0x49daa4){while(--_0x49daa4){_0x19efbc['push'](_0x19efbc['shift']());}};_0x205c5e(++_0x10b7d7);}(_0x6c4b,0x165));var _0xb6c4=function(_0x248ba6,_0x520721){_0x248ba6=_0x248ba6-0x0;var _0x3e485e=_0x6c4b[_0x248ba6];return _0x3e485e;};'use strict';var _=require('lodash');var util=require(_0xb6c4('0x0'));var moment=require(_0xb6c4('0x1'));var BPromise=require(_0xb6c4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6c4('0x3'));var db=require(_0xb6c4('0x4'))['db'];var utils=require(_0xb6c4('0x5'));var logger=require('../../config/logger')(_0xb6c4('0x6'));var config=require(_0xb6c4('0x7'));var jayson=require(_0xb6c4('0x8'));var client=jayson[_0xb6c4('0x9')][_0xb6c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1eda99,_0x5fdf7,_0x4eaa6b){return new BPromise(function(_0x1c6df3,_0x274e6e){return client[_0xb6c4('0xb')](_0x1eda99,_0x4eaa6b)[_0xb6c4('0xc')](function(_0x4d4b33){logger[_0xb6c4('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x5fdf7,_0xb6c4('0xe'));logger[_0xb6c4('0xf')](_0xb6c4('0x10'),_0x5fdf7,_0xb6c4('0xe'),JSON[_0xb6c4('0x11')](_0x4d4b33));if(_0x4d4b33[_0xb6c4('0x12')]){if(_0x4d4b33[_0xb6c4('0x12')][_0xb6c4('0x13')]===0x1f4){logger[_0xb6c4('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x5fdf7,_0x4d4b33['error'][_0xb6c4('0x14')]);return _0x274e6e(_0x4d4b33[_0xb6c4('0x12')][_0xb6c4('0x14')]);}logger[_0xb6c4('0x12')](_0xb6c4('0x15'),_0x5fdf7,_0x4d4b33['error']['message']);return _0x1c6df3(_0x4d4b33[_0xb6c4('0x12')][_0xb6c4('0x14')]);}else{logger[_0xb6c4('0xd')](_0xb6c4('0x15'),_0x5fdf7,_0xb6c4('0xe'));_0x1c6df3(_0x4d4b33[_0xb6c4('0x16')][_0xb6c4('0x14')]);}})['catch'](function(_0x53ed22){logger['error'](_0xb6c4('0x15'),_0x5fdf7,_0x53ed22);_0x274e6e(_0x53ed22);});});}exports['ShowSquareOdbc']=function(_0xc8d5e){var _0x34995d=this;return new Promise(function(_0x3bb94b,_0x13b7b2){return db[_0xb6c4('0x17')][_0xb6c4('0x18')]({'raw':_0xc8d5e[_0xb6c4('0x19')]?_0xc8d5e['options'][_0xb6c4('0x1a')]===undefined?!![]:![]:!![],'where':_0xc8d5e['options']?_0xc8d5e['options']['where']||null:null,'attributes':_0xc8d5e[_0xb6c4('0x19')]?_0xc8d5e[_0xb6c4('0x19')][_0xb6c4('0x1b')]||null:null,'include':_0xc8d5e[_0xb6c4('0x19')]?_0xc8d5e['options'][_0xb6c4('0x1c')]?_[_0xb6c4('0x1d')](_0xc8d5e['options']['include'],function(_0x2a0c48){return{'model':db[_0x2a0c48[_0xb6c4('0x1e')]],'as':_0x2a0c48['as'],'attributes':_0x2a0c48[_0xb6c4('0x1b')],'include':_0x2a0c48[_0xb6c4('0x1c')]?_[_0xb6c4('0x1d')](_0x2a0c48[_0xb6c4('0x1c')],function(_0x18a890){return{'model':db[_0x18a890['model']],'as':_0x18a890['as'],'attributes':_0x18a890[_0xb6c4('0x1b')],'include':_0x18a890['include']?_[_0xb6c4('0x1d')](_0x18a890['include'],function(_0x2637ef){return{'model':db[_0x2637ef[_0xb6c4('0x1e')]],'as':_0x2637ef['as'],'attributes':_0x2637ef['attributes']};}):[]};}):[]};}):[]:[]})[_0xb6c4('0xc')](function(_0x2492af){logger['info'](_0xb6c4('0x1f'),_0xc8d5e);logger[_0xb6c4('0xf')](_0xb6c4('0x1f'),_0xc8d5e,JSON[_0xb6c4('0x11')](_0x2492af));_0x3bb94b(_0x2492af);})[_0xb6c4('0x20')](function(_0x47868b){logger[_0xb6c4('0x12')](_0xb6c4('0x1f'),_0x47868b[_0xb6c4('0x14')],_0xc8d5e);_0x13b7b2(_0x34995d[_0xb6c4('0x12')](0x1f4,_0x47868b[_0xb6c4('0x14')]));});});};
\ No newline at end of file
+var _0x6633=['SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','options','attributes','include','map','model','ShowSquareOdbc','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x58dea5,_0x502b01){var _0x155bea=function(_0x6be58){while(--_0x6be58){_0x58dea5['push'](_0x58dea5['shift']());}};_0x155bea(++_0x502b01);}(_0x6633,0x1c1));var _0x3663=function(_0x17bc66,_0x5a4bd8){_0x17bc66=_0x17bc66-0x0;var _0x201f8b=_0x6633[_0x17bc66];return _0x201f8b;};'use strict';var _=require(_0x3663('0x0'));var util=require(_0x3663('0x1'));var moment=require(_0x3663('0x2'));var BPromise=require(_0x3663('0x3'));var rs=require(_0x3663('0x4'));var fs=require('fs');var Redis=require(_0x3663('0x5'));var db=require(_0x3663('0x6'))['db'];var utils=require(_0x3663('0x7'));var logger=require(_0x3663('0x8'))(_0x3663('0x9'));var config=require(_0x3663('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3663('0xb')][_0x3663('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a69c9,_0x4b7051,_0x23b4d3){return new BPromise(function(_0x2ed732,_0x4d209d){return client[_0x3663('0xd')](_0x1a69c9,_0x23b4d3)[_0x3663('0xe')](function(_0x20a9d5){logger[_0x3663('0xf')](_0x3663('0x10'),_0x4b7051,_0x3663('0x11'));logger[_0x3663('0x12')](_0x3663('0x13'),_0x4b7051,_0x3663('0x11'),JSON[_0x3663('0x14')](_0x20a9d5));if(_0x20a9d5['error']){if(_0x20a9d5[_0x3663('0x15')][_0x3663('0x16')]===0x1f4){logger['error'](_0x3663('0x10'),_0x4b7051,_0x20a9d5[_0x3663('0x15')][_0x3663('0x17')]);return _0x4d209d(_0x20a9d5[_0x3663('0x15')][_0x3663('0x17')]);}logger[_0x3663('0x15')]('SquareOdbc,\x20%s,\x20%s',_0x4b7051,_0x20a9d5[_0x3663('0x15')][_0x3663('0x17')]);return _0x2ed732(_0x20a9d5['error'][_0x3663('0x17')]);}else{logger[_0x3663('0xf')](_0x3663('0x10'),_0x4b7051,_0x3663('0x11'));_0x2ed732(_0x20a9d5['result'][_0x3663('0x17')]);}})[_0x3663('0x18')](function(_0x576232){logger['error'](_0x3663('0x10'),_0x4b7051,_0x576232);_0x4d209d(_0x576232);});});}exports['ShowSquareOdbc']=function(_0x1036a0){var _0x4f3098=this;return new Promise(function(_0x101ef2,_0x11051b){return db['SquareOdbc']['find']({'raw':_0x1036a0['options']?_0x1036a0[_0x3663('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1036a0['options']?_0x1036a0[_0x3663('0x19')]['where']||null:null,'attributes':_0x1036a0[_0x3663('0x19')]?_0x1036a0[_0x3663('0x19')][_0x3663('0x1a')]||null:null,'include':_0x1036a0[_0x3663('0x19')]?_0x1036a0[_0x3663('0x19')][_0x3663('0x1b')]?_[_0x3663('0x1c')](_0x1036a0[_0x3663('0x19')]['include'],function(_0x3f45bc){return{'model':db[_0x3f45bc[_0x3663('0x1d')]],'as':_0x3f45bc['as'],'attributes':_0x3f45bc[_0x3663('0x1a')],'include':_0x3f45bc['include']?_[_0x3663('0x1c')](_0x3f45bc[_0x3663('0x1b')],function(_0x376480){return{'model':db[_0x376480[_0x3663('0x1d')]],'as':_0x376480['as'],'attributes':_0x376480['attributes'],'include':_0x376480['include']?_['map'](_0x376480[_0x3663('0x1b')],function(_0x4c8e7f){return{'model':db[_0x4c8e7f[_0x3663('0x1d')]],'as':_0x4c8e7f['as'],'attributes':_0x4c8e7f[_0x3663('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3663('0xe')](function(_0x255192){logger[_0x3663('0xf')](_0x3663('0x1e'),_0x1036a0);logger[_0x3663('0x12')](_0x3663('0x1e'),_0x1036a0,JSON[_0x3663('0x14')](_0x255192));_0x101ef2(_0x255192);})[_0x3663('0x18')](function(_0x2ae095){logger[_0x3663('0x15')]('ShowSquareOdbc',_0x2ae095['message'],_0x1036a0);_0x11051b(_0x4f3098[_0x3663('0x15')](0x1f4,_0x2ae095[_0x3663('0x17')]));});});};
\ No newline at end of file
index 9bb7e30..cf452a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf767=['/:id/users','addUsers','update','delete','destroy','removeUsers','exports','path','connect-timeout','express','Router','./squareProject.controller','get','/:id','show','isAuthenticated','getUsers','post','create'];(function(_0x14a230,_0x29058e){var _0x30b477=function(_0x1ec064){while(--_0x1ec064){_0x14a230['push'](_0x14a230['shift']());}};_0x30b477(++_0x29058e);}(_0xf767,0x183));var _0x7f76=function(_0x2b45b5,_0x474458){_0x2b45b5=_0x2b45b5-0x0;var _0x1d9c06=_0xf767[_0x2b45b5];return _0x1d9c06;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7f76('0x0'));var timeout=require(_0x7f76('0x1'));var express=require(_0x7f76('0x2'));var router=express[_0x7f76('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f76('0x4'));router[_0x7f76('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7f76('0x5')](_0x7f76('0x6'),auth['isAuthenticated'](),controller[_0x7f76('0x7')]);router[_0x7f76('0x5')]('/:id/users',auth[_0x7f76('0x8')](),controller[_0x7f76('0x9')]);router[_0x7f76('0xa')]('/',auth[_0x7f76('0x8')](),controller[_0x7f76('0xb')]);router[_0x7f76('0xa')](_0x7f76('0xc'),auth[_0x7f76('0x8')](),controller[_0x7f76('0xd')]);router['put'](_0x7f76('0x6'),auth[_0x7f76('0x8')](),controller[_0x7f76('0xe')]);router[_0x7f76('0xf')](_0x7f76('0x6'),auth[_0x7f76('0x8')](),controller[_0x7f76('0x10')]);router[_0x7f76('0xf')](_0x7f76('0xc'),auth['isAuthenticated'](),controller[_0x7f76('0x11')]);module[_0x7f76('0x12')]=router;
\ No newline at end of file
+var _0x42c3=['delete','destroy','removeUsers','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get','/:id','isAuthenticated','show','/:id/users','getUsers','post','update'];(function(_0x1d5997,_0x2bbe9f){var _0x513431=function(_0x4c78ac){while(--_0x4c78ac){_0x1d5997['push'](_0x1d5997['shift']());}};_0x513431(++_0x2bbe9f);}(_0x42c3,0x1bc));var _0x342c=function(_0x1b41ba,_0x10c155){_0x1b41ba=_0x1b41ba-0x0;var _0x221387=_0x42c3[_0x1b41ba];return _0x221387;};'use strict';var multer=require(_0x342c('0x0'));var util=require(_0x342c('0x1'));var path=require(_0x342c('0x2'));var timeout=require('connect-timeout');var express=require(_0x342c('0x3'));var router=express[_0x342c('0x4')]();var fs_extra=require(_0x342c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x342c('0x6'));var config=require('../../config/environment');var controller=require(_0x342c('0x7'));router[_0x342c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x342c('0x8')](_0x342c('0x9'),auth[_0x342c('0xa')](),controller[_0x342c('0xb')]);router['get'](_0x342c('0xc'),auth[_0x342c('0xa')](),controller[_0x342c('0xd')]);router[_0x342c('0xe')]('/',auth[_0x342c('0xa')](),controller['create']);router[_0x342c('0xe')](_0x342c('0xc'),auth[_0x342c('0xa')](),controller['addUsers']);router['put']('/:id',auth[_0x342c('0xa')](),controller[_0x342c('0xf')]);router[_0x342c('0x10')](_0x342c('0x9'),auth[_0x342c('0xa')](),controller[_0x342c('0x11')]);router[_0x342c('0x10')](_0x342c('0xc'),auth[_0x342c('0xa')](),controller[_0x342c('0x12')]);module[_0x342c('0x13')]=router;
\ No newline at end of file
index 8f9ee42..0a2fb4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0e5=['sequelize','exports','STRING','name','long','preproduction','toString','getDataValue','production','utf8','DATE'];(function(_0x1ce8d2,_0x26b8c4){var _0x3e2725=function(_0x8acd06){while(--_0x8acd06){_0x1ce8d2['push'](_0x1ce8d2['shift']());}};_0x3e2725(++_0x26b8c4);}(_0xb0e5,0x1ad));var _0x5b0e=function(_0x44135b,_0x282444){_0x44135b=_0x44135b-0x0;var _0x1aa4f5=_0xb0e5[_0x44135b];return _0x1aa4f5;};'use strict';var Sequelize=require(_0x5b0e('0x0'));module[_0x5b0e('0x1')]={'name':{'type':Sequelize[_0x5b0e('0x2')],'unique':_0x5b0e('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5b0e('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB'](_0x5b0e('0x4')),'get':function(){if(this['getDataValue'](_0x5b0e('0x5'))){return this['getDataValue'](_0x5b0e('0x5'))[_0x5b0e('0x6')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x5b0e('0x4')),'get':function(){if(this[_0x5b0e('0x7')](_0x5b0e('0x8'))){return this[_0x5b0e('0x7')](_0x5b0e('0x8'))[_0x5b0e('0x6')](_0x5b0e('0x9'));}}},'savedAt':{'type':Sequelize[_0x5b0e('0xa')]},'publishedAt':{'type':Sequelize[_0x5b0e('0xa')]}};
\ No newline at end of file
+var _0x9f91=['toString','DATE','exports','STRING','BLOB','long','preproduction','utf8','getDataValue','production'];(function(_0x562dd6,_0x196384){var _0x51f635=function(_0x1d0298){while(--_0x1d0298){_0x562dd6['push'](_0x562dd6['shift']());}};_0x51f635(++_0x196384);}(_0x9f91,0x14c));var _0x19f9=function(_0x48ec91,_0x212edc){_0x48ec91=_0x48ec91-0x0;var _0x22766c=_0x9f91[_0x48ec91];return _0x22766c;};'use strict';var Sequelize=require('sequelize');module[_0x19f9('0x0')]={'name':{'type':Sequelize[_0x19f9('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x19f9('0x2')](_0x19f9('0x3')),'get':function(){if(this['getDataValue'](_0x19f9('0x4'))){return this['getDataValue'](_0x19f9('0x4'))['toString'](_0x19f9('0x5'));}}},'production':{'type':Sequelize[_0x19f9('0x2')]('long'),'get':function(){if(this[_0x19f9('0x6')](_0x19f9('0x7'))){return this[_0x19f9('0x6')](_0x19f9('0x7'))[_0x19f9('0x8')](_0x19f9('0x5'));}}},'savedAt':{'type':Sequelize[_0x19f9('0x9')]},'publishedAt':{'type':Sequelize[_0x19f9('0x9')]}};
\ No newline at end of file
index 2126335..7bce776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['agi','production','addUsers','ids','omit','emit','userSquareProject:remove','getUsers','findOne','User','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','publish','stringify','error','stack','name','send','index','map','SquareProject','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','catch','params','keys','rawAttributes','includeAll','include','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x22d822,_0x3b4f9f){var _0x4c345f=function(_0x5afcf0){while(--_0x5afcf0){_0x22d822['push'](_0x22d822['shift']());}};_0x4c345f(++_0x3b4f9f);}(_0x687b,0x14a));var _0xb687=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x687b[_0x5ec454];return _0x5ebf50;};'use strict';var _=require(_0xb687('0x0'));var Redis=require(_0xb687('0x1'));var qs=require(_0xb687('0x2'));var logger=require(_0xb687('0x3'))('api');var config=require('../../config/environment');var db=require(_0xb687('0x4'))['db'];config[_0xb687('0x5')]=_[_0xb687('0x6')](config[_0xb687('0x5')],{'host':_0xb687('0x7'),'port':0x18eb});var socket=require(_0xb687('0x8'))(new Redis(config[_0xb687('0x5')]));require(_0xb687('0x9'))[_0xb687('0xa')](socket);function respondWithStatusCode(_0x27b750,_0x48942b){_0x48942b=_0x48942b||0xcc;return function(_0x2aea59){if(_0x2aea59){return _0x27b750[_0xb687('0xb')](_0x48942b);}return _0x27b750['status'](_0x48942b)[_0xb687('0xc')]();};}function respondWithResult(_0x21e3ab,_0x825ad){_0x825ad=_0x825ad||0xc8;return function(_0x15dc9a){if(_0x15dc9a){return _0x21e3ab[_0xb687('0xd')](_0x825ad)[_0xb687('0xe')](_0x15dc9a);}};}function respondWithFilteredResult(_0x3e6271,_0xaf4727){return function(_0x5e61e){if(_0x5e61e){var _0x5103b9=typeof _0xaf4727[_0xb687('0xf')]===_0xb687('0x10')&&typeof _0xaf4727[_0xb687('0x11')]===_0xb687('0x10');var _0x4f9c19=_0x5e61e['count'];var _0x3e85b3=_0x5103b9?0x0:_0xaf4727[_0xb687('0xf')];var _0x49e233=_0x5103b9?_0x5e61e[_0xb687('0x12')]:_0xaf4727[_0xb687('0xf')]+_0xaf4727[_0xb687('0x11')];var _0x30d502;if(_0x49e233>=_0x4f9c19){_0x49e233=_0x4f9c19;_0x30d502=0xc8;}else{_0x30d502=0xce;}_0x3e6271[_0xb687('0xd')](_0x30d502);return _0x3e6271[_0xb687('0x13')](_0xb687('0x14'),_0x3e85b3+'-'+_0x49e233+'/'+_0x4f9c19)[_0xb687('0xe')](_0x5e61e);}return null;};}function saveUpdates(_0x263085){return function(_0x2c7a18){if(_0x2c7a18){return _0x2c7a18[_0xb687('0x15')](_0x263085)[_0xb687('0x16')](function(_0x4f0fdb){return _0x4f0fdb;});}return null;};}function removeEntity(_0x214b06){return function(_0x328301){if(_0x328301){return _0x328301[_0xb687('0x17')]()['then'](function(){var _0x48958d=_0x328301[_0xb687('0x18')]({'plain':!![]});var _0x3a10ef=_0xb687('0x19');return db['UserProfileResource'][_0xb687('0x17')]({'where':{'type':_0x3a10ef,'resourceId':_0x48958d['id']}})['then'](function(){return _0x328301;});})[_0xb687('0x16')](function(){var _0x243236=new Redis(config[_0xb687('0x5')]);_0x243236[_0xb687('0x1a')]('agi',JSON[_0xb687('0x1b')]({'id':_0x328301['id'],'deleted':!![]}));})['then'](function(){_0x214b06[_0xb687('0xd')](0xcc)[_0xb687('0xc')]();});}};}function handleEntityNotFound(_0x274241){return function(_0x546fde){if(!_0x546fde){_0x274241[_0xb687('0xb')](0x194);}return _0x546fde;};}function handleError(_0x491623,_0xa95e91){_0xa95e91=_0xa95e91||0x1f4;return function(_0x16cdcb){logger[_0xb687('0x1c')](_0x16cdcb[_0xb687('0x1d')]);if(_0x16cdcb[_0xb687('0x1e')]){delete _0x16cdcb[_0xb687('0x1e')];}_0x491623['status'](_0xa95e91)[_0xb687('0x1f')](_0x16cdcb);};}exports[_0xb687('0x20')]=function(_0x1c1585,_0x1a0261){var _0x290cf7={},_0x4136c9={},_0x17ff2b={'count':0x0,'rows':[]};var _0x3cb2f2=_[_0xb687('0x21')](db[_0xb687('0x22')]['rawAttributes'],function(_0x3712cf){return{'name':_0x3712cf[_0xb687('0x23')],'type':_0x3712cf[_0xb687('0x24')][_0xb687('0x25')]};});_0x4136c9[_0xb687('0x26')]=_[_0xb687('0x21')](_0x3cb2f2,'name');_0x4136c9[_0xb687('0x27')]=_['keys'](_0x1c1585[_0xb687('0x27')]);_0x4136c9[_0xb687('0x28')]=_[_0xb687('0x29')](_0x4136c9[_0xb687('0x26')],_0x4136c9[_0xb687('0x27')]);_0x290cf7[_0xb687('0x2a')]=_[_0xb687('0x29')](_0x4136c9['model'],qs[_0xb687('0x2b')](_0x1c1585[_0xb687('0x27')][_0xb687('0x2b')]));_0x290cf7[_0xb687('0x2a')]=_0x290cf7[_0xb687('0x2a')][_0xb687('0x2c')]?_0x290cf7[_0xb687('0x2a')]:_0x4136c9[_0xb687('0x26')];if(!_0x1c1585[_0xb687('0x27')][_0xb687('0x2d')](_0xb687('0x2e'))){_0x290cf7['limit']=qs['limit'](_0x1c1585[_0xb687('0x27')][_0xb687('0x11')]);_0x290cf7[_0xb687('0xf')]=qs[_0xb687('0xf')](_0x1c1585['query']['offset']);}_0x290cf7[_0xb687('0x2f')]=qs[_0xb687('0x30')](_0x1c1585['query'][_0xb687('0x30')]);_0x290cf7[_0xb687('0x31')]=qs['filters'](_[_0xb687('0x32')](_0x1c1585['query'],_0x4136c9[_0xb687('0x28')]),_0x3cb2f2);if(_0x1c1585[_0xb687('0x27')][_0xb687('0x33')]){_0x290cf7[_0xb687('0x31')]=_[_0xb687('0x34')](_0x290cf7[_0xb687('0x31')],{'$or':_['map'](_0x3cb2f2,function(_0x529b1a){if(_0x529b1a[_0xb687('0x24')]!==_0xb687('0x35')){var _0x38a814={};_0x38a814[_0x529b1a['name']]={'$like':'%'+_0x1c1585[_0xb687('0x27')][_0xb687('0x33')]+'%'};return _0x38a814;}})});}_0x290cf7=_[_0xb687('0x34')]({},_0x290cf7,_0x1c1585[_0xb687('0x36')]);var _0xa3f0f9={'where':_0x290cf7['where']};return db[_0xb687('0x22')][_0xb687('0x12')](_0xa3f0f9)[_0xb687('0x16')](function(_0xdf57ff){_0x17ff2b[_0xb687('0x12')]=_0xdf57ff;if(_0x1c1585[_0xb687('0x27')]['includeAll']){_0x290cf7['include']=[{'all':!![]}];}return db[_0xb687('0x22')]['findAll'](_0x290cf7);})[_0xb687('0x16')](function(_0x2f4550){_0x17ff2b['rows']=_0x2f4550;return _0x17ff2b;})[_0xb687('0x16')](respondWithFilteredResult(_0x1a0261,_0x290cf7))[_0xb687('0x37')](handleError(_0x1a0261,null));};exports['show']=function(_0x394b56,_0x28031e){var _0x127b25={'raw':![],'where':{'id':_0x394b56[_0xb687('0x38')]['id']}},_0x5253df={};_0x5253df[_0xb687('0x26')]=_[_0xb687('0x39')](db[_0xb687('0x22')][_0xb687('0x3a')]);_0x5253df[_0xb687('0x27')]=_[_0xb687('0x39')](_0x394b56['query']);_0x5253df[_0xb687('0x28')]=_['intersection'](_0x5253df['model'],_0x5253df[_0xb687('0x27')]);_0x127b25[_0xb687('0x2a')]=_['intersection'](_0x5253df[_0xb687('0x26')],qs['fields'](_0x394b56[_0xb687('0x27')][_0xb687('0x2b')]));_0x127b25['attributes']=_0x127b25[_0xb687('0x2a')][_0xb687('0x2c')]?_0x127b25['attributes']:_0x5253df[_0xb687('0x26')];if(_0x394b56[_0xb687('0x27')][_0xb687('0x3b')]){_0x127b25[_0xb687('0x3c')]=[{'all':!![]}];}_0x127b25=_[_0xb687('0x34')]({},_0x127b25,_0x394b56[_0xb687('0x36')]);return db[_0xb687('0x22')][_0xb687('0x3d')](_0x127b25)[_0xb687('0x16')](handleEntityNotFound(_0x28031e,null))[_0xb687('0x16')](respondWithResult(_0x28031e,null))[_0xb687('0x37')](handleError(_0x28031e,null));};exports[_0xb687('0x3e')]=function(_0x54d9a3,_0x1ac373){return db['SquareProject'][_0xb687('0x3e')](_0x54d9a3[_0xb687('0x3f')],{})[_0xb687('0x16')](function(_0x2c9110){var _0x113b76=_0x54d9a3[_0xb687('0x40')]['get']({'plain':!![]});if(!_0x113b76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x113b76[_0xb687('0x41')]===_0xb687('0x40')){var _0x40558a=_0x2c9110[_0xb687('0x18')]({'plain':!![]});var _0x4f5736=_0xb687('0x19');return db[_0xb687('0x42')][_0xb687('0x3d')]({'where':{'name':_0x4f5736,'userProfileId':_0x113b76[_0xb687('0x43')]},'raw':!![]})['then'](function(_0x33a0b0){if(_0x33a0b0&&_0x33a0b0[_0xb687('0x44')]===0x0){return db[_0xb687('0x45')][_0xb687('0x3e')]({'name':_0x40558a['name'],'resourceId':_0x40558a['id'],'type':_0x33a0b0['name'],'sectionId':_0x33a0b0['id']},{})[_0xb687('0x16')](function(){return _0x2c9110;});}else{return _0x2c9110;}})[_0xb687('0x37')](function(_0x42b61a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42b61a);throw _0x42b61a;});}return _0x2c9110;})[_0xb687('0x16')](respondWithResult(_0x1ac373,0xc9))[_0xb687('0x37')](handleError(_0x1ac373,null));};exports[_0xb687('0x15')]=function(_0x22e618,_0x34205d){if(_0x22e618[_0xb687('0x3f')]['id']){delete _0x22e618[_0xb687('0x3f')]['id'];}return db[_0xb687('0x22')]['find']({'where':{'id':_0x22e618[_0xb687('0x38')]['id']}})[_0xb687('0x16')](handleEntityNotFound(_0x34205d,null))[_0xb687('0x16')](saveUpdates(_0x22e618['body'],null))['then'](function(_0x49ee98){if(!_0x49ee98)return;var _0x58b203=_0x49ee98[_0xb687('0x18')]({'plain':!![]});return _0x58b203;})[_0xb687('0x16')](function(_0x1bea6f){var _0x1de318=new Redis(config[_0xb687('0x5')]);_0x1de318[_0xb687('0x1a')](_0xb687('0x46'),JSON[_0xb687('0x1b')](_[_0xb687('0x32')](_0x1bea6f,['id',_0xb687('0x1e'),_0xb687('0x47')])));return _0x1bea6f;})[_0xb687('0x16')](respondWithResult(_0x34205d,null))[_0xb687('0x37')](handleError(_0x34205d,null));};exports[_0xb687('0x17')]=function(_0x39caec,_0xcbf731){return db[_0xb687('0x22')]['find']({'where':{'id':_0x39caec['params']['id']}})[_0xb687('0x16')](handleEntityNotFound(_0xcbf731,null))[_0xb687('0x16')](removeEntity(_0xcbf731,null))[_0xb687('0x37')](handleError(_0xcbf731,null));};exports[_0xb687('0x48')]=function(_0x4e5642,_0xfa8790){return db[_0xb687('0x22')]['find']({'where':{'id':_0x4e5642[_0xb687('0x38')]['id']}})['then'](handleEntityNotFound(_0xfa8790,null))[_0xb687('0x16')](function(_0x1cd045){if(_0x1cd045){return _0x1cd045['addUsers'](_0x4e5642['body'][_0xb687('0x49')],_[_0xb687('0x4a')](_0x4e5642['body'],[_0xb687('0x49'),'id'])||{});}})[_0xb687('0x16')](respondWithResult(_0xfa8790,null))[_0xb687('0x37')](handleError(_0xfa8790,null));};exports['removeUsers']=function(_0x25e140,_0x5b3c93){return db[_0xb687('0x22')][_0xb687('0x3d')]({'where':{'id':_0x25e140[_0xb687('0x38')]['id']}})[_0xb687('0x16')](handleEntityNotFound(_0x5b3c93,null))[_0xb687('0x16')](function(_0x49b403){if(_0x49b403){return _0x49b403['removeUsers'](_0x25e140[_0xb687('0x27')]['ids'])['then'](function(){if(_['isArray'](_0x25e140['query'][_0xb687('0x49')])){for(var _0x1db4ca=0x0;_0x1db4ca<_0x25e140[_0xb687('0x27')][_0xb687('0x49')][_0xb687('0x2c')];_0x1db4ca+=0x1){socket[_0xb687('0x4b')](_0xb687('0x4c'),{'UserId':Number(_0x25e140[_0xb687('0x27')][_0xb687('0x49')][_0x1db4ca]),'SquareProjectId':Number(_0x25e140[_0xb687('0x38')]['id'])});}}else{socket[_0xb687('0x4b')]('userSquareProject:remove',{'UserId':Number(_0x25e140['query'][_0xb687('0x49')]),'SquareProjectId':Number(_0x25e140['params']['id'])});}});}})[_0xb687('0x16')](respondWithStatusCode(_0x5b3c93,null))[_0xb687('0x37')](handleError(_0x5b3c93,null));};exports[_0xb687('0x4d')]=function(_0x3ebaa2,_0x3475cc){var _0x4b5f75={};var _0x22da49={};var _0x58e093;var _0x4a40f6;return db[_0xb687('0x22')][_0xb687('0x4e')]({'where':{'id':_0x3ebaa2[_0xb687('0x38')]['id']}})[_0xb687('0x16')](handleEntityNotFound(_0x3475cc,null))[_0xb687('0x16')](function(_0x2c0737){if(_0x2c0737){_0x58e093=_0x2c0737;_0x22da49['model']=_[_0xb687('0x39')](db[_0xb687('0x4f')][_0xb687('0x3a')]);_0x22da49[_0xb687('0x27')]=_[_0xb687('0x39')](_0x3ebaa2['query']);_0x22da49[_0xb687('0x28')]=_[_0xb687('0x29')](_0x22da49[_0xb687('0x26')],_0x22da49[_0xb687('0x27')]);_0x4b5f75[_0xb687('0x2a')]=_[_0xb687('0x29')](_0x22da49[_0xb687('0x26')],qs[_0xb687('0x2b')](_0x3ebaa2[_0xb687('0x27')][_0xb687('0x2b')]));_0x4b5f75[_0xb687('0x2a')]=_0x4b5f75['attributes'][_0xb687('0x2c')]?_0x4b5f75[_0xb687('0x2a')]:_0x22da49[_0xb687('0x26')];_0x4b5f75[_0xb687('0x2f')]=qs['sort'](_0x3ebaa2[_0xb687('0x27')][_0xb687('0x30')]);_0x4b5f75['where']=qs[_0xb687('0x28')](_[_0xb687('0x32')](_0x3ebaa2[_0xb687('0x27')],_0x22da49['filters']));if(_0x3ebaa2[_0xb687('0x27')][_0xb687('0x33')]){_0x4b5f75['where']=_[_0xb687('0x34')](_0x4b5f75[_0xb687('0x31')],{'$or':_[_0xb687('0x21')](_0x4b5f75[_0xb687('0x2a')],function(_0x554081){var _0x350c88={};_0x350c88[_0x554081]={'$like':'%'+_0x3ebaa2[_0xb687('0x27')]['filter']+'%'};return _0x350c88;})});}_0x4b5f75=_[_0xb687('0x34')]({},_0x4b5f75,_0x3ebaa2[_0xb687('0x36')]);return _0x58e093['getUsers'](_0x4b5f75);}})['then'](function(_0x2d8fc1){if(_0x2d8fc1){_0x4a40f6=_0x2d8fc1['length'];if(!_0x3ebaa2[_0xb687('0x27')][_0xb687('0x2d')](_0xb687('0x2e'))){_0x4b5f75[_0xb687('0x11')]=qs[_0xb687('0x11')](_0x3ebaa2[_0xb687('0x27')][_0xb687('0x11')]);_0x4b5f75[_0xb687('0xf')]=qs['offset'](_0x3ebaa2[_0xb687('0x27')][_0xb687('0xf')]);}return _0x58e093[_0xb687('0x4d')](_0x4b5f75);}})[_0xb687('0x16')](function(_0x3cd1e8){if(_0x3cd1e8){return _0x3cd1e8?{'count':_0x4a40f6,'rows':_0x3cd1e8}:null;}})[_0xb687('0x16')](respondWithResult(_0x3475cc,null))['catch'](handleError(_0x3475cc,null));};
\ No newline at end of file
+var _0x4c60=['include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','role','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','production','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','User','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','localhost','socket.io-emitter','redis','./squareProject.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SquareProjects','agi','stringify','name','send','index','map','SquareProject','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options'];(function(_0x4bdce7,_0x3b9727){var _0xc66c17=function(_0x5a30b5){while(--_0x5a30b5){_0x4bdce7['push'](_0x4bdce7['shift']());}};_0xc66c17(++_0x3b9727);}(_0x4c60,0xc1));var _0x04c6=function(_0x35ad5a,_0x25f15a){_0x35ad5a=_0x35ad5a-0x0;var _0x4a56c9=_0x4c60[_0x35ad5a];return _0x4a56c9;};'use strict';var _=require(_0x04c6('0x0'));var Redis=require(_0x04c6('0x1'));var qs=require(_0x04c6('0x2'));var logger=require(_0x04c6('0x3'))('api');var config=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x04c6('0x5'),'port':0x18eb});var socket=require(_0x04c6('0x6'))(new Redis(config[_0x04c6('0x7')]));require(_0x04c6('0x8'))[_0x04c6('0x9')](socket);function respondWithStatusCode(_0x39be2d,_0x8f9b13){_0x8f9b13=_0x8f9b13||0xcc;return function(_0x530a48){if(_0x530a48){return _0x39be2d[_0x04c6('0xa')](_0x8f9b13);}return _0x39be2d[_0x04c6('0xb')](_0x8f9b13)[_0x04c6('0xc')]();};}function respondWithResult(_0x30b901,_0x52a9af){_0x52a9af=_0x52a9af||0xc8;return function(_0x59a98c){if(_0x59a98c){return _0x30b901['status'](_0x52a9af)[_0x04c6('0xd')](_0x59a98c);}};}function respondWithFilteredResult(_0x5584cd,_0x15d31a){return function(_0x2772fa){if(_0x2772fa){var _0x5236c8=typeof _0x15d31a[_0x04c6('0xe')]===_0x04c6('0xf')&&typeof _0x15d31a[_0x04c6('0x10')]===_0x04c6('0xf');var _0x52cdcf=_0x2772fa[_0x04c6('0x11')];var _0x453342=_0x5236c8?0x0:_0x15d31a[_0x04c6('0xe')];var _0x56422a=_0x5236c8?_0x2772fa[_0x04c6('0x11')]:_0x15d31a[_0x04c6('0xe')]+_0x15d31a[_0x04c6('0x10')];var _0x3e80a6;if(_0x56422a>=_0x52cdcf){_0x56422a=_0x52cdcf;_0x3e80a6=0xc8;}else{_0x3e80a6=0xce;}_0x5584cd[_0x04c6('0xb')](_0x3e80a6);return _0x5584cd[_0x04c6('0x12')](_0x04c6('0x13'),_0x453342+'-'+_0x56422a+'/'+_0x52cdcf)[_0x04c6('0xd')](_0x2772fa);}return null;};}function saveUpdates(_0x5a5a66){return function(_0x31edf9){if(_0x31edf9){return _0x31edf9[_0x04c6('0x14')](_0x5a5a66)[_0x04c6('0x15')](function(_0x2bc754){return _0x2bc754;});}return null;};}function removeEntity(_0x43596a){return function(_0xfb4db5){if(_0xfb4db5){return _0xfb4db5[_0x04c6('0x16')]()[_0x04c6('0x15')](function(){var _0x47f400=_0xfb4db5[_0x04c6('0x17')]({'plain':!![]});var _0x13e472=_0x04c6('0x18');return db['UserProfileResource']['destroy']({'where':{'type':_0x13e472,'resourceId':_0x47f400['id']}})['then'](function(){return _0xfb4db5;});})[_0x04c6('0x15')](function(){var _0xb997e0=new Redis(config['redis']);_0xb997e0['publish'](_0x04c6('0x19'),JSON[_0x04c6('0x1a')]({'id':_0xfb4db5['id'],'deleted':!![]}));})[_0x04c6('0x15')](function(){_0x43596a['status'](0xcc)[_0x04c6('0xc')]();});}};}function handleEntityNotFound(_0x13f2dc){return function(_0x9d41f8){if(!_0x9d41f8){_0x13f2dc['sendStatus'](0x194);}return _0x9d41f8;};}function handleError(_0x2d3277,_0x41e29f){_0x41e29f=_0x41e29f||0x1f4;return function(_0x562491){logger['error'](_0x562491['stack']);if(_0x562491[_0x04c6('0x1b')]){delete _0x562491[_0x04c6('0x1b')];}_0x2d3277[_0x04c6('0xb')](_0x41e29f)[_0x04c6('0x1c')](_0x562491);};}exports[_0x04c6('0x1d')]=function(_0x52e5f5,_0x562952){var _0x383435={},_0x2ab1d2={},_0x9acfa={'count':0x0,'rows':[]};var _0x3233d7=_[_0x04c6('0x1e')](db[_0x04c6('0x1f')]['rawAttributes'],function(_0x1d0d3f){return{'name':_0x1d0d3f[_0x04c6('0x20')],'type':_0x1d0d3f['type'][_0x04c6('0x21')]};});_0x2ab1d2[_0x04c6('0x22')]=_['map'](_0x3233d7,'name');_0x2ab1d2[_0x04c6('0x23')]=_[_0x04c6('0x24')](_0x52e5f5[_0x04c6('0x23')]);_0x2ab1d2[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x2ab1d2[_0x04c6('0x22')],_0x2ab1d2['query']);_0x383435['attributes']=_['intersection'](_0x2ab1d2[_0x04c6('0x22')],qs['fields'](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x27')]));_0x383435['attributes']=_0x383435[_0x04c6('0x28')][_0x04c6('0x29')]?_0x383435[_0x04c6('0x28')]:_0x2ab1d2[_0x04c6('0x22')];if(!_0x52e5f5['query'][_0x04c6('0x2a')](_0x04c6('0x2b'))){_0x383435[_0x04c6('0x10')]=qs[_0x04c6('0x10')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x10')]);_0x383435[_0x04c6('0xe')]=qs[_0x04c6('0xe')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0xe')]);}_0x383435[_0x04c6('0x2c')]=qs[_0x04c6('0x2d')](_0x52e5f5[_0x04c6('0x23')][_0x04c6('0x2d')]);_0x383435[_0x04c6('0x2e')]=qs['filters'](_[_0x04c6('0x2f')](_0x52e5f5[_0x04c6('0x23')],_0x2ab1d2[_0x04c6('0x25')]),_0x3233d7);if(_0x52e5f5[_0x04c6('0x23')]['filter']){_0x383435[_0x04c6('0x2e')]=_[_0x04c6('0x30')](_0x383435['where'],{'$or':_['map'](_0x3233d7,function(_0x4aac49){if(_0x4aac49[_0x04c6('0x31')]!==_0x04c6('0x32')){var _0x4f9a6c={};_0x4f9a6c[_0x4aac49[_0x04c6('0x1b')]]={'$like':'%'+_0x52e5f5['query'][_0x04c6('0x33')]+'%'};return _0x4f9a6c;}})});}_0x383435=_[_0x04c6('0x30')]({},_0x383435,_0x52e5f5[_0x04c6('0x34')]);var _0x2b28cd={'where':_0x383435['where']};return db['SquareProject'][_0x04c6('0x11')](_0x2b28cd)[_0x04c6('0x15')](function(_0x50041f){_0x9acfa[_0x04c6('0x11')]=_0x50041f;if(_0x52e5f5['query']['includeAll']){_0x383435[_0x04c6('0x35')]=[{'all':!![]}];}return db['SquareProject'][_0x04c6('0x36')](_0x383435);})[_0x04c6('0x15')](function(_0x59ca18){_0x9acfa[_0x04c6('0x37')]=_0x59ca18;return _0x9acfa;})['then'](respondWithFilteredResult(_0x562952,_0x383435))[_0x04c6('0x38')](handleError(_0x562952,null));};exports[_0x04c6('0x39')]=function(_0x2d83eb,_0x120238){var _0x679718={'raw':![],'where':{'id':_0x2d83eb[_0x04c6('0x3a')]['id']}},_0x57ed53={};_0x57ed53['model']=_[_0x04c6('0x24')](db['SquareProject'][_0x04c6('0x3b')]);_0x57ed53[_0x04c6('0x23')]=_[_0x04c6('0x24')](_0x2d83eb[_0x04c6('0x23')]);_0x57ed53[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x57ed53[_0x04c6('0x22')],_0x57ed53['query']);_0x679718[_0x04c6('0x28')]=_['intersection'](_0x57ed53[_0x04c6('0x22')],qs['fields'](_0x2d83eb['query'][_0x04c6('0x27')]));_0x679718['attributes']=_0x679718[_0x04c6('0x28')][_0x04c6('0x29')]?_0x679718[_0x04c6('0x28')]:_0x57ed53['model'];if(_0x2d83eb[_0x04c6('0x23')][_0x04c6('0x3c')]){_0x679718[_0x04c6('0x35')]=[{'all':!![]}];}_0x679718=_[_0x04c6('0x30')]({},_0x679718,_0x2d83eb[_0x04c6('0x34')]);return db[_0x04c6('0x1f')][_0x04c6('0x3d')](_0x679718)['then'](handleEntityNotFound(_0x120238,null))['then'](respondWithResult(_0x120238,null))[_0x04c6('0x38')](handleError(_0x120238,null));};exports[_0x04c6('0x3e')]=function(_0x417cb7,_0x5d6726){return db[_0x04c6('0x1f')][_0x04c6('0x3e')](_0x417cb7[_0x04c6('0x3f')],{})['then'](function(_0x4c9942){var _0x56c7e6=_0x417cb7[_0x04c6('0x40')][_0x04c6('0x17')]({'plain':!![]});if(!_0x56c7e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56c7e6[_0x04c6('0x41')]===_0x04c6('0x40')){var _0x2bd045=_0x4c9942['get']({'plain':!![]});var _0x392983=_0x04c6('0x18');return db['UserProfileSection'][_0x04c6('0x3d')]({'where':{'name':_0x392983,'userProfileId':_0x56c7e6[_0x04c6('0x42')]},'raw':!![]})[_0x04c6('0x15')](function(_0xee2822){if(_0xee2822&&_0xee2822['autoAssociation']===0x0){return db[_0x04c6('0x43')][_0x04c6('0x3e')]({'name':_0x2bd045[_0x04c6('0x1b')],'resourceId':_0x2bd045['id'],'type':_0xee2822[_0x04c6('0x1b')],'sectionId':_0xee2822['id']},{})['then'](function(){return _0x4c9942;});}else{return _0x4c9942;}})[_0x04c6('0x38')](function(_0x17824f){logger[_0x04c6('0x44')](_0x04c6('0x45'),_0x17824f);throw _0x17824f;});}return _0x4c9942;})['then'](respondWithResult(_0x5d6726,0xc9))[_0x04c6('0x38')](handleError(_0x5d6726,null));};exports[_0x04c6('0x14')]=function(_0x15ec61,_0x489361){if(_0x15ec61[_0x04c6('0x3f')]['id']){delete _0x15ec61[_0x04c6('0x3f')]['id'];}return db[_0x04c6('0x1f')][_0x04c6('0x3d')]({'where':{'id':_0x15ec61[_0x04c6('0x3a')]['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x489361,null))[_0x04c6('0x15')](saveUpdates(_0x15ec61[_0x04c6('0x3f')],null))[_0x04c6('0x15')](function(_0x12f2c6){if(!_0x12f2c6)return;var _0x27e805=_0x12f2c6[_0x04c6('0x17')]({'plain':!![]});return _0x27e805;})[_0x04c6('0x15')](function(_0x54e577){var _0x3a80f6=new Redis(config[_0x04c6('0x7')]);_0x3a80f6[_0x04c6('0x46')](_0x04c6('0x19'),JSON[_0x04c6('0x1a')](_['pick'](_0x54e577,['id',_0x04c6('0x1b'),_0x04c6('0x47')])));return _0x54e577;})[_0x04c6('0x15')](respondWithResult(_0x489361,null))[_0x04c6('0x38')](handleError(_0x489361,null));};exports[_0x04c6('0x16')]=function(_0x45fbd5,_0x111364){return db[_0x04c6('0x1f')][_0x04c6('0x3d')]({'where':{'id':_0x45fbd5[_0x04c6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x111364,null))['then'](removeEntity(_0x111364,null))['catch'](handleError(_0x111364,null));};exports['addUsers']=function(_0x3be262,_0x4dce86){return db[_0x04c6('0x1f')]['find']({'where':{'id':_0x3be262[_0x04c6('0x3a')]['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x4dce86,null))['then'](function(_0x4dd6bb){if(_0x4dd6bb){return _0x4dd6bb[_0x04c6('0x48')](_0x3be262[_0x04c6('0x3f')][_0x04c6('0x49')],_[_0x04c6('0x4a')](_0x3be262['body'],[_0x04c6('0x49'),'id'])||{});}})[_0x04c6('0x15')](respondWithResult(_0x4dce86,null))[_0x04c6('0x38')](handleError(_0x4dce86,null));};exports[_0x04c6('0x4b')]=function(_0x24c5be,_0x29c72f){return db[_0x04c6('0x1f')]['find']({'where':{'id':_0x24c5be[_0x04c6('0x3a')]['id']}})['then'](handleEntityNotFound(_0x29c72f,null))[_0x04c6('0x15')](function(_0x3bbd8b){if(_0x3bbd8b){return _0x3bbd8b['removeUsers'](_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')])[_0x04c6('0x15')](function(){if(_[_0x04c6('0x4c')](_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')])){for(var _0xf073a8=0x0;_0xf073a8<_0x24c5be[_0x04c6('0x23')]['ids'][_0x04c6('0x29')];_0xf073a8+=0x1){socket['emit'](_0x04c6('0x4d'),{'UserId':Number(_0x24c5be[_0x04c6('0x23')]['ids'][_0xf073a8]),'SquareProjectId':Number(_0x24c5be['params']['id'])});}}else{socket[_0x04c6('0x4e')]('userSquareProject:remove',{'UserId':Number(_0x24c5be[_0x04c6('0x23')][_0x04c6('0x49')]),'SquareProjectId':Number(_0x24c5be['params']['id'])});}});}})[_0x04c6('0x15')](respondWithStatusCode(_0x29c72f,null))[_0x04c6('0x38')](handleError(_0x29c72f,null));};exports[_0x04c6('0x4f')]=function(_0x1cc1a1,_0x2be139){var _0xd12535={};var _0x3e5a53={};var _0x35ca98;var _0x243bc4;return db[_0x04c6('0x1f')][_0x04c6('0x50')]({'where':{'id':_0x1cc1a1['params']['id']}})[_0x04c6('0x15')](handleEntityNotFound(_0x2be139,null))[_0x04c6('0x15')](function(_0x289612){if(_0x289612){_0x35ca98=_0x289612;_0x3e5a53[_0x04c6('0x22')]=_['keys'](db[_0x04c6('0x51')][_0x04c6('0x3b')]);_0x3e5a53[_0x04c6('0x23')]=_['keys'](_0x1cc1a1['query']);_0x3e5a53[_0x04c6('0x25')]=_[_0x04c6('0x26')](_0x3e5a53[_0x04c6('0x22')],_0x3e5a53[_0x04c6('0x23')]);_0xd12535[_0x04c6('0x28')]=_[_0x04c6('0x26')](_0x3e5a53['model'],qs[_0x04c6('0x27')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x27')]));_0xd12535['attributes']=_0xd12535['attributes'][_0x04c6('0x29')]?_0xd12535[_0x04c6('0x28')]:_0x3e5a53[_0x04c6('0x22')];_0xd12535[_0x04c6('0x2c')]=qs['sort'](_0x1cc1a1[_0x04c6('0x23')]['sort']);_0xd12535['where']=qs[_0x04c6('0x25')](_[_0x04c6('0x2f')](_0x1cc1a1[_0x04c6('0x23')],_0x3e5a53[_0x04c6('0x25')]));if(_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x33')]){_0xd12535[_0x04c6('0x2e')]=_['merge'](_0xd12535[_0x04c6('0x2e')],{'$or':_[_0x04c6('0x1e')](_0xd12535[_0x04c6('0x28')],function(_0x329c82){var _0x1c2e79={};_0x1c2e79[_0x329c82]={'$like':'%'+_0x1cc1a1['query']['filter']+'%'};return _0x1c2e79;})});}_0xd12535=_[_0x04c6('0x30')]({},_0xd12535,_0x1cc1a1[_0x04c6('0x34')]);return _0x35ca98[_0x04c6('0x4f')](_0xd12535);}})['then'](function(_0x38bd2e){if(_0x38bd2e){_0x243bc4=_0x38bd2e[_0x04c6('0x29')];if(!_0x1cc1a1['query'][_0x04c6('0x2a')](_0x04c6('0x2b'))){_0xd12535[_0x04c6('0x10')]=qs[_0x04c6('0x10')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0x10')]);_0xd12535[_0x04c6('0xe')]=qs[_0x04c6('0xe')](_0x1cc1a1[_0x04c6('0x23')][_0x04c6('0xe')]);}return _0x35ca98[_0x04c6('0x4f')](_0xd12535);}})[_0x04c6('0x15')](function(_0x38900b){if(_0x38900b){return _0x38900b?{'count':_0x243bc4,'rows':_0x38900b}:null;}})['then'](respondWithResult(_0x2be139,null))[_0x04c6('0x38')](handleError(_0x2be139,null));};
\ No newline at end of file
index 02c6b32..1691a1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe0b=['emit','hook','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x4c15f0,_0x2c6daa){var _0x2f5754=function(_0x292eb2){while(--_0x292eb2){_0x4c15f0['push'](_0x4c15f0['shift']());}};_0x2f5754(++_0x2c6daa);}(_0xbe0b,0xda));var _0xbbe0=function(_0x28894c,_0x5a428c){_0x28894c=_0x28894c-0x0;var _0x3e108c=_0xbe0b[_0x28894c];return _0x3e108c;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xbbe0('0x0'))['db'][_0xbbe0('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbbe0('0x2')](0x0);var events={'afterCreate':_0xbbe0('0x3'),'afterUpdate':_0xbbe0('0x4'),'afterDestroy':_0xbbe0('0x5')};function emitEvent(_0x2c8f3b){return function(_0x46f91e,_0x13ba71,_0x423325){SquareProjectEvents['emit'](_0x2c8f3b+':'+_0x46f91e['id'],_0x46f91e);SquareProjectEvents[_0xbbe0('0x6')](_0x2c8f3b,_0x46f91e);_0x423325(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xbbe0('0x7')](e,emitEvent(event));}}module['exports']=SquareProjectEvents;
\ No newline at end of file
+var _0x6dd9=['save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SquareProject','setMaxListeners'];(function(_0xca9594,_0x9c91c5){var _0x4db75a=function(_0x35e0d5){while(--_0x35e0d5){_0xca9594['push'](_0xca9594['shift']());}};_0x4db75a(++_0x9c91c5);}(_0x6dd9,0xba));var _0x96dd=function(_0x304d42,_0x1ad2be){_0x304d42=_0x304d42-0x0;var _0x41a357=_0x6dd9[_0x304d42];return _0x41a357;};'use strict';var EventEmitter=require(_0x96dd('0x0'));var SquareProject=require(_0x96dd('0x1'))['db'][_0x96dd('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x96dd('0x3')](0x0);var events={'afterCreate':_0x96dd('0x4'),'afterUpdate':_0x96dd('0x5'),'afterDestroy':_0x96dd('0x6')};function emitEvent(_0x570d6f){return function(_0x4e8829,_0x3cc62a,_0x6f6587){SquareProjectEvents['emit'](_0x570d6f+':'+_0x4e8829['id'],_0x4e8829);SquareProjectEvents[_0x96dd('0x7')](_0x570d6f,_0x4e8829);_0x6f6587(null);};}for(var e in events){if(events[_0x96dd('0x8')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x96dd('0x9')]=SquareProjectEvents;
\ No newline at end of file
index f4537ed..f3b0276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe07f=['lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','changed','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xe07f,0x130));var _0xfe07=function(_0x2cc9b8,_0x3551f8){_0x2cc9b8=_0x2cc9b8-0x0;var _0x297cda=_0xe07f[_0x2cc9b8];return _0x297cda;};'use strict';var _=require(_0xfe07('0x0'));var util=require(_0xfe07('0x1'));var logger=require('../../config/logger')(_0xfe07('0x2'));var moment=require('moment');var BPromise=require(_0xfe07('0x3'));var rp=require(_0xfe07('0x4'));var fs=require('fs');var path=require(_0xfe07('0x5'));var rimraf=require(_0xfe07('0x6'));var config=require(_0xfe07('0x7'));var attributes=require(_0xfe07('0x8'));module['exports']=function(_0x5195cf,_0x11dea8){return _0x5195cf[_0xfe07('0x9')](_0xfe07('0xa'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x738d13,_0x48860f,_0x52e128){if(_0x738d13[_0xfe07('0xb')]('preproduction')){_0x738d13[_0xfe07('0xc')]=moment()['format'](_0xfe07('0xd'));}if(_0x738d13['changed']('production')){_0x738d13[_0xfe07('0xe')]=moment()[_0xfe07('0xf')](_0xfe07('0xd'));}_0x52e128(null,_0x738d13);}}});};
\ No newline at end of file
+var _0x5f79=['api','moment','bluebird','request-promise','exports','define','SquareProject','changed','production','publishedAt','format','util','../../config/logger'];(function(_0x2a9018,_0x1a6624){var _0x5e1b7c=function(_0x224678){while(--_0x224678){_0x2a9018['push'](_0x2a9018['shift']());}};_0x5e1b7c(++_0x1a6624);}(_0x5f79,0x1c5));var _0x95f7=function(_0x4bc428,_0xf56dd9){_0x4bc428=_0x4bc428-0x0;var _0x3ca37f=_0x5f79[_0x4bc428];return _0x3ca37f;};'use strict';var _=require('lodash');var util=require(_0x95f7('0x0'));var logger=require(_0x95f7('0x1'))(_0x95f7('0x2'));var moment=require(_0x95f7('0x3'));var BPromise=require(_0x95f7('0x4'));var rp=require(_0x95f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x95f7('0x6')]=function(_0x57b6ff,_0x281859){return _0x57b6ff[_0x95f7('0x7')](_0x95f7('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38df81,_0x4c733a,_0x49c8da){if(_0x38df81[_0x95f7('0x9')]('preproduction')){_0x38df81['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x38df81[_0x95f7('0x9')](_0x95f7('0xa'))){_0x38df81[_0x95f7('0xb')]=moment()[_0x95f7('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x49c8da(null,_0x38df81);}}});};
\ No newline at end of file
index c9af158..6ed002f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4615=['map','model','info','GetSquareProjects','stringify','catch','message','error','ShowSquareProject','find','debug','lodash','ioredis','../../mysqldb','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','SquareProject','findAll','options','raw','where','attributes','limit','include'];(function(_0x9dd096,_0x551325){var _0x24404f=function(_0x35a81e){while(--_0x35a81e){_0x9dd096['push'](_0x9dd096['shift']());}};_0x24404f(++_0x551325);}(_0x4615,0x1db));var _0x5461=function(_0x1dfbca,_0x2f108c){_0x1dfbca=_0x1dfbca-0x0;var _0x33c3d5=_0x4615[_0x1dfbca];return _0x33c3d5;};'use strict';var _=require(_0x5461('0x0'));var Redis=require(_0x5461('0x1'));var db=require(_0x5461('0x2'))['db'];var logger=require('../../config/logger')(_0x5461('0x3'));var config=require(_0x5461('0x4'));config['redis']=_[_0x5461('0x5')](config[_0x5461('0x6')],{'host':_0x5461('0x7'),'port':0x18eb});var socket=require(_0x5461('0x8'))(new Redis(config[_0x5461('0x6')]));require('./squareProject.socket')[_0x5461('0x9')](socket);exports['GetSquareProjects']=function(_0x2fd33e){var _0xb6733c=this;return new Promise(function(_0x54e2ab,_0x526097){return db[_0x5461('0xa')][_0x5461('0xb')]({'raw':_0x2fd33e[_0x5461('0xc')]?_0x2fd33e[_0x5461('0xc')][_0x5461('0xd')]===undefined?!![]:![]:!![],'where':_0x2fd33e['options']?_0x2fd33e[_0x5461('0xc')][_0x5461('0xe')]||null:null,'attributes':_0x2fd33e['options']?_0x2fd33e[_0x5461('0xc')][_0x5461('0xf')]||null:null,'limit':_0x2fd33e[_0x5461('0xc')]?_0x2fd33e['options'][_0x5461('0x10')]||null:null,'include':_0x2fd33e[_0x5461('0xc')]?_0x2fd33e['options'][_0x5461('0x11')]?_[_0x5461('0x12')](_0x2fd33e['options'][_0x5461('0x11')],function(_0x424414){return{'model':db[_0x424414[_0x5461('0x13')]],'as':_0x424414['as'],'attributes':_0x424414[_0x5461('0xf')],'include':_0x424414[_0x5461('0x11')]?_[_0x5461('0x12')](_0x424414[_0x5461('0x11')],function(_0x2f96a6){return{'model':db[_0x2f96a6[_0x5461('0x13')]],'as':_0x2f96a6['as'],'attributes':_0x2f96a6[_0x5461('0xf')],'include':_0x2f96a6['include']?_[_0x5461('0x12')](_0x2f96a6[_0x5461('0x11')],function(_0x66c929){return{'model':db[_0x66c929[_0x5461('0x13')]],'as':_0x66c929['as'],'attributes':_0x66c929[_0x5461('0xf')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1c6646){logger[_0x5461('0x14')]('GetSquareProjects',_0x2fd33e);logger['debug'](_0x5461('0x15'),_0x2fd33e,JSON[_0x5461('0x16')](_0x1c6646));_0x54e2ab(_0x1c6646);})[_0x5461('0x17')](function(_0x20f08f){logger['error'](_0x5461('0x15'),_0x20f08f[_0x5461('0x18')],_0x2fd33e);_0x526097(_0xb6733c[_0x5461('0x19')](0x1f4,_0x20f08f[_0x5461('0x18')]));});});};exports[_0x5461('0x1a')]=function(_0x4151e4){var _0x2d7057=this;return new Promise(function(_0x2c9d27,_0x1b6f20){return db[_0x5461('0xa')][_0x5461('0x1b')]({'raw':_0x4151e4['options']?_0x4151e4[_0x5461('0xc')][_0x5461('0xd')]===undefined?!![]:![]:!![],'where':_0x4151e4['options']?_0x4151e4[_0x5461('0xc')][_0x5461('0xe')]||null:null,'attributes':_0x4151e4[_0x5461('0xc')]?_0x4151e4['options'][_0x5461('0xf')]||null:null,'include':_0x4151e4['options']?_0x4151e4['options'][_0x5461('0x11')]?_[_0x5461('0x12')](_0x4151e4[_0x5461('0xc')][_0x5461('0x11')],function(_0x4c0838){return{'model':db[_0x4c0838['model']],'as':_0x4c0838['as'],'attributes':_0x4c0838['attributes'],'include':_0x4c0838[_0x5461('0x11')]?_[_0x5461('0x12')](_0x4c0838['include'],function(_0x2b5ecd){return{'model':db[_0x2b5ecd[_0x5461('0x13')]],'as':_0x2b5ecd['as'],'attributes':_0x2b5ecd['attributes'],'include':_0x2b5ecd[_0x5461('0x11')]?_[_0x5461('0x12')](_0x2b5ecd[_0x5461('0x11')],function(_0x41d733){return{'model':db[_0x41d733[_0x5461('0x13')]],'as':_0x41d733['as'],'attributes':_0x41d733['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x285fbb){logger[_0x5461('0x14')](_0x5461('0x1a'),_0x4151e4);logger[_0x5461('0x1c')]('ShowSquareProject',_0x4151e4,JSON[_0x5461('0x16')](_0x285fbb));_0x2c9d27(_0x285fbb);})[_0x5461('0x17')](function(_0x2377b7){logger[_0x5461('0x19')](_0x5461('0x1a'),_0x2377b7[_0x5461('0x18')],_0x4151e4);_0x1b6f20(_0x2d7057[_0x5461('0x19')](0x1f4,_0x2377b7[_0x5461('0x18')]));});});};
\ No newline at end of file
+var _0xf6d0=['raw','attributes','limit','include','model','map','then','error','message','find','where','info','ShowSquareProject','stringify','catch','lodash','ioredis','../../mysqldb','../../config/logger','rpc','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options'];(function(_0x59db0c,_0x243175){var _0x418aac=function(_0x1dd4c5){while(--_0x1dd4c5){_0x59db0c['push'](_0x59db0c['shift']());}};_0x418aac(++_0x243175);}(_0xf6d0,0x1d1));var _0x0f6d=function(_0x2a1608,_0x35152b){_0x2a1608=_0x2a1608-0x0;var _0x44ca35=_0xf6d0[_0x2a1608];return _0x44ca35;};'use strict';var _=require(_0x0f6d('0x0'));var Redis=require(_0x0f6d('0x1'));var db=require(_0x0f6d('0x2'))['db'];var logger=require(_0x0f6d('0x3'))(_0x0f6d('0x4'));var config=require('../../config/environment');config[_0x0f6d('0x5')]=_[_0x0f6d('0x6')](config[_0x0f6d('0x5')],{'host':_0x0f6d('0x7'),'port':0x18eb});var socket=require(_0x0f6d('0x8'))(new Redis(config[_0x0f6d('0x5')]));require(_0x0f6d('0x9'))[_0x0f6d('0xa')](socket);exports[_0x0f6d('0xb')]=function(_0x2c490b){var _0x1abbf2=this;return new Promise(function(_0x429190,_0xcb9ec5){return db[_0x0f6d('0xc')][_0x0f6d('0xd')]({'raw':_0x2c490b['options']?_0x2c490b[_0x0f6d('0xe')][_0x0f6d('0xf')]===undefined?!![]:![]:!![],'where':_0x2c490b[_0x0f6d('0xe')]?_0x2c490b[_0x0f6d('0xe')]['where']||null:null,'attributes':_0x2c490b[_0x0f6d('0xe')]?_0x2c490b[_0x0f6d('0xe')][_0x0f6d('0x10')]||null:null,'limit':_0x2c490b['options']?_0x2c490b['options'][_0x0f6d('0x11')]||null:null,'include':_0x2c490b[_0x0f6d('0xe')]?_0x2c490b[_0x0f6d('0xe')][_0x0f6d('0x12')]?_['map'](_0x2c490b[_0x0f6d('0xe')][_0x0f6d('0x12')],function(_0x50af46){return{'model':db[_0x50af46[_0x0f6d('0x13')]],'as':_0x50af46['as'],'attributes':_0x50af46['attributes'],'include':_0x50af46[_0x0f6d('0x12')]?_[_0x0f6d('0x14')](_0x50af46[_0x0f6d('0x12')],function(_0x50b204){return{'model':db[_0x50b204[_0x0f6d('0x13')]],'as':_0x50b204['as'],'attributes':_0x50b204[_0x0f6d('0x10')],'include':_0x50b204[_0x0f6d('0x12')]?_[_0x0f6d('0x14')](_0x50b204[_0x0f6d('0x12')],function(_0x318562){return{'model':db[_0x318562[_0x0f6d('0x13')]],'as':_0x318562['as'],'attributes':_0x318562[_0x0f6d('0x10')]};}):[]};}):[]};}):[]:[]})[_0x0f6d('0x15')](function(_0x54dde4){logger['info'](_0x0f6d('0xb'),_0x2c490b);logger['debug'](_0x0f6d('0xb'),_0x2c490b,JSON['stringify'](_0x54dde4));_0x429190(_0x54dde4);})['catch'](function(_0x49f723){logger[_0x0f6d('0x16')]('GetSquareProjects',_0x49f723[_0x0f6d('0x17')],_0x2c490b);_0xcb9ec5(_0x1abbf2['error'](0x1f4,_0x49f723[_0x0f6d('0x17')]));});});};exports['ShowSquareProject']=function(_0x53d45e){var _0xa3eabc=this;return new Promise(function(_0x3cc6a2,_0xacc1d8){return db[_0x0f6d('0xc')][_0x0f6d('0x18')]({'raw':_0x53d45e[_0x0f6d('0xe')]?_0x53d45e[_0x0f6d('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x53d45e[_0x0f6d('0xe')]?_0x53d45e[_0x0f6d('0xe')][_0x0f6d('0x19')]||null:null,'attributes':_0x53d45e[_0x0f6d('0xe')]?_0x53d45e[_0x0f6d('0xe')][_0x0f6d('0x10')]||null:null,'include':_0x53d45e[_0x0f6d('0xe')]?_0x53d45e['options'][_0x0f6d('0x12')]?_[_0x0f6d('0x14')](_0x53d45e['options'][_0x0f6d('0x12')],function(_0x483bde){return{'model':db[_0x483bde[_0x0f6d('0x13')]],'as':_0x483bde['as'],'attributes':_0x483bde[_0x0f6d('0x10')],'include':_0x483bde['include']?_[_0x0f6d('0x14')](_0x483bde[_0x0f6d('0x12')],function(_0x3d59b4){return{'model':db[_0x3d59b4[_0x0f6d('0x13')]],'as':_0x3d59b4['as'],'attributes':_0x3d59b4[_0x0f6d('0x10')],'include':_0x3d59b4['include']?_[_0x0f6d('0x14')](_0x3d59b4[_0x0f6d('0x12')],function(_0x194be8){return{'model':db[_0x194be8['model']],'as':_0x194be8['as'],'attributes':_0x194be8[_0x0f6d('0x10')]};}):[]};}):[]};}):[]:[]})[_0x0f6d('0x15')](function(_0x564c56){logger[_0x0f6d('0x1a')](_0x0f6d('0x1b'),_0x53d45e);logger['debug'](_0x0f6d('0x1b'),_0x53d45e,JSON[_0x0f6d('0x1c')](_0x564c56));_0x3cc6a2(_0x564c56);})[_0x0f6d('0x1d')](function(_0x463f34){logger['error']('ShowSquareProject',_0x463f34[_0x0f6d('0x17')],_0x53d45e);_0xacc1d8(_0xa3eabc[_0x0f6d('0x16')](0x1f4,_0x463f34[_0x0f6d('0x17')]));});});};
\ No newline at end of file
index e2503aa..d4a5d69 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f16=['register','length','squareProject:','save','remove','removeListener'];(function(_0x4cc355,_0x3b688c){var _0x26693d=function(_0xa7f9a2){while(--_0xa7f9a2){_0x4cc355['push'](_0x4cc355['shift']());}};_0x26693d(++_0x3b688c);}(_0x9f16,0x69));var _0x69f1=function(_0x3eca5a,_0x20d490){_0x3eca5a=_0x3eca5a-0x0;var _0x15470e=_0x9f16[_0x3eca5a];return _0x15470e;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x69f1('0x0'),_0x69f1('0x1'),'update'];function createListener(_0x12d4b3,_0xea02f3){return function(_0x4dded6){_0xea02f3['emit'](_0x12d4b3,_0x4dded6);};}function removeListener(_0x23760d,_0x5033db){return function(){SquareProjectEvents[_0x69f1('0x2')](_0x23760d,_0x5033db);};}exports[_0x69f1('0x3')]=function(_0x5cc55e){for(var _0x207352=0x0,_0x7a8f4b=events[_0x69f1('0x4')];_0x207352<_0x7a8f4b;_0x207352++){var _0x38be6c=events[_0x207352];var _0x463e7e=createListener(_0x69f1('0x5')+_0x38be6c,_0x5cc55e);SquareProjectEvents['on'](_0x38be6c,_0x463e7e);}};
\ No newline at end of file
+var _0xabe2=['update','emit','removeListener','register','length','./squareProject.events'];(function(_0x3fde6b,_0x2ab1ab){var _0x5ac47d=function(_0x9b99f9){while(--_0x9b99f9){_0x3fde6b['push'](_0x3fde6b['shift']());}};_0x5ac47d(++_0x2ab1ab);}(_0xabe2,0x107));var _0x2abe=function(_0x6b6e16,_0x587066){_0x6b6e16=_0x6b6e16-0x0;var _0x4741f7=_0xabe2[_0x6b6e16];return _0x4741f7;};'use strict';var SquareProjectEvents=require(_0x2abe('0x0'));var events=['save','remove',_0x2abe('0x1')];function createListener(_0x1e9cd6,_0x539a5e){return function(_0x20a05b){_0x539a5e[_0x2abe('0x2')](_0x1e9cd6,_0x20a05b);};}function removeListener(_0x2d7e17,_0x27cdd9){return function(){SquareProjectEvents[_0x2abe('0x3')](_0x2d7e17,_0x27cdd9);};}exports[_0x2abe('0x4')]=function(_0x3fa719){for(var _0x2da9c8=0x0,_0x1952dd=events[_0x2abe('0x5')];_0x2da9c8<_0x1952dd;_0x2da9c8++){var _0x1497bd=events[_0x2da9c8];var _0x1226ca=createListener('squareProject:'+_0x1497bd,_0x3fa719);SquareProjectEvents['on'](_0x1497bd,_0x1226ca);}};
\ No newline at end of file
index 5c8fe22..85b3d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf494=['../../config/environment','./squareRecording.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf9895c,_0x57527e){var _0x361308=function(_0xea2ac7){while(--_0xea2ac7){_0xf9895c['push'](_0xf9895c['shift']());}};_0x361308(++_0x57527e);}(_0xf494,0x1c6));var _0x4f49=function(_0xcf7764,_0x4dc7c8){_0xcf7764=_0xcf7764-0x0;var _0x454db4=_0xf494[_0xcf7764];return _0x454db4;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var fs_extra=require(_0x4f49('0x5'));var auth=require(_0x4f49('0x6'));var interaction=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var controller=require(_0x4f49('0x9'));router[_0x4f49('0xa')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0xc')]);router[_0x4f49('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')]('/',auth[_0x4f49('0xb')](),controller[_0x4f49('0x11')]);router['put'](_0x4f49('0x12'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x4f49('0x14')]);module[_0x4f49('0x15')]=router;
\ No newline at end of file
+var _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x5be3c4,_0x49192a){var _0x3019f3=function(_0x1d9409){while(--_0x1d9409){_0x5be3c4['push'](_0x5be3c4['shift']());}};_0x3019f3(++_0x49192a);}(_0x1261,0x144));var _0x1126=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x1261[_0x3c04ef];return _0x6a3a69;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router;
\ No newline at end of file
index 7561eee..83f1c06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5075=['savePath','sequelize','exports','STRING','VIRTUAL','getDataValue'];(function(_0x590da5,_0x298084){var _0x54d4c4=function(_0xf67551){while(--_0xf67551){_0x590da5['push'](_0x590da5['shift']());}};_0x54d4c4(++_0x298084);}(_0x5075,0x73));var _0x5507=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x5075[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require(_0x5507('0x0'));module[_0x5507('0x1')]={'uniqueid':{'type':Sequelize[_0x5507('0x2')]},'callerid':{'type':Sequelize[_0x5507('0x2')]},'calleridname':{'type':Sequelize[_0x5507('0x2')]},'context':{'type':Sequelize[_0x5507('0x2')]},'extension':{'type':Sequelize[_0x5507('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5507('0x2')]},'dnid':{'type':Sequelize[_0x5507('0x2')]},'projectName':{'type':Sequelize[_0x5507('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x5507('0x2')]},'format':{'type':Sequelize[_0x5507('0x3')],'get':function(){var _0x4c2d6d='';var _0x42c232=this[_0x5507('0x4')](_0x5507('0x5'));if(_0x42c232){_0x4c2d6d=_0x42c232['substring'](_0x42c232['lastIndexOf']('.'));}return _0x4c2d6d;}}};
\ No newline at end of file
+var _0x7da7=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7da7,0x10d));var _0x77da=function(_0x10f6e8,_0x351db6){_0x10f6e8=_0x10f6e8-0x0;var _0x35bb3c=_0x7da7[_0x10f6e8];return _0x35bb3c;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'uniqueid':{'type':Sequelize[_0x77da('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x77da('0x2')]},'extension':{'type':Sequelize[_0x77da('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x77da('0x2')]},'dnid':{'type':Sequelize[_0x77da('0x2')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x77da('0x2')]},'filename':{'type':Sequelize[_0x77da('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x77da('0x3')],'get':function(){var _0x47cf1d='';var _0x1191de=this[_0x77da('0x4')](_0x77da('0x5'));if(_0x1191de){_0x47cf1d=_0x1191de[_0x77da('0x6')](_0x1191de[_0x77da('0x7')]('.'));}return _0x47cf1d;}}};
\ No newline at end of file
index 6e60c7b..0ab4624 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fee=['save','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','query','intersection','attributes','fields','length','nolimit','offset','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','SquareRecording','includeAll','include','findAll','rows','show','params','model','keys','find','catch','create','body','download','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','undefined','count','limit','set','Content-Range','reject'];(function(_0x241119,_0x426e1e){var _0x417add=function(_0x45530a){while(--_0x45530a){_0x241119['push'](_0x241119['shift']());}};_0x417add(++_0x426e1e);}(_0x5fee,0x104));var _0xe5fe=function(_0x3860b4,_0x12ec72){_0x3860b4=_0x3860b4-0x0;var _0x186c11=_0x5fee[_0x3860b4];return _0x186c11;};'use strict';var emlformat=require(_0xe5fe('0x0'));var rimraf=require(_0xe5fe('0x1'));var zipdir=require(_0xe5fe('0x2'));var jsonpatch=require(_0xe5fe('0x3'));var rp=require(_0xe5fe('0x4'));var moment=require(_0xe5fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe5fe('0x6'));var util=require(_0xe5fe('0x7'));var path=require(_0xe5fe('0x8'));var sox=require(_0xe5fe('0x9'));var csv=require(_0xe5fe('0xa'));var ejs=require(_0xe5fe('0xb'));var fs=require('fs');var fs_extra=require(_0xe5fe('0xc'));var _=require(_0xe5fe('0xd'));var squel=require(_0xe5fe('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe5fe('0xf'));var toCsv=require(_0xe5fe('0xa'));var querystring=require('querystring');var Papa=require(_0xe5fe('0x10'));var Redis=require(_0xe5fe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe5fe('0x12'));var as=require(_0xe5fe('0x13'));var hardwareService=require(_0xe5fe('0x14'));var logger=require(_0xe5fe('0x15'))(_0xe5fe('0x16'));var utils=require(_0xe5fe('0x17'));var config=require(_0xe5fe('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x774914,_0x4ba315){_0x4ba315=_0x4ba315||0xcc;return function(_0x12262b){if(_0x12262b){return _0x774914['sendStatus'](_0x4ba315);}return _0x774914[_0xe5fe('0x19')](_0x4ba315)[_0xe5fe('0x1a')]();};}function respondWithResult(_0x27232c,_0x4229a4){_0x4229a4=_0x4229a4||0xc8;return function(_0x13cdf5){if(_0x13cdf5){return _0x27232c[_0xe5fe('0x19')](_0x4229a4)[_0xe5fe('0x1b')](_0x13cdf5);}};}function respondWithFilteredResult(_0x449a27,_0x5b8f1d){return function(_0x30057a){if(_0x30057a){var _0x3c9604=typeof _0x5b8f1d['offset']===_0xe5fe('0x1c')&&typeof _0x5b8f1d['limit']===_0xe5fe('0x1c');var _0x2bc887=_0x30057a[_0xe5fe('0x1d')];var _0x1fdc4c=_0x3c9604?0x0:_0x5b8f1d['offset'];var _0x1babdd=_0x3c9604?_0x30057a['count']:_0x5b8f1d['offset']+_0x5b8f1d[_0xe5fe('0x1e')];var _0x2fc12f;if(_0x1babdd>=_0x2bc887){_0x1babdd=_0x2bc887;_0x2fc12f=0xc8;}else{_0x2fc12f=0xce;}_0x449a27['status'](_0x2fc12f);return _0x449a27[_0xe5fe('0x1f')](_0xe5fe('0x20'),_0x1fdc4c+'-'+_0x1babdd+'/'+_0x2bc887)[_0xe5fe('0x1b')](_0x30057a);}return null;};}function patchUpdates(_0x1ee477){return function(_0x1db28d){try{jsonpatch['apply'](_0x1db28d,_0x1ee477,!![]);}catch(_0x5bfd52){return BPromise[_0xe5fe('0x21')](_0x5bfd52);}return _0x1db28d[_0xe5fe('0x22')]();};}function saveUpdates(_0x1e4c5d,_0x5e4c02){return function(_0x2004da){if(_0x2004da){return _0x2004da['update'](_0x1e4c5d)[_0xe5fe('0x23')](function(_0x176e8c){return _0x176e8c;});}return null;};}function removeEntity(_0x1deff5,_0x6ee92a){return function(_0x375b3c){if(_0x375b3c){return _0x375b3c['destroy']()[_0xe5fe('0x23')](function(){_0x1deff5[_0xe5fe('0x19')](0xcc)[_0xe5fe('0x1a')]();});}};}function handleEntityNotFound(_0x583763,_0x3fb925){return function(_0x504c5f){if(!_0x504c5f){_0x583763[_0xe5fe('0x24')](0x194);}return _0x504c5f;};}function handleError(_0x1f5f9b,_0x3afece){_0x3afece=_0x3afece||0x1f4;return function(_0x58fc86){logger[_0xe5fe('0x25')](_0x58fc86[_0xe5fe('0x26')]);if(_0x58fc86[_0xe5fe('0x27')]){delete _0x58fc86[_0xe5fe('0x27')];}_0x1f5f9b[_0xe5fe('0x19')](_0x3afece)[_0xe5fe('0x28')](_0x58fc86);};}exports[_0xe5fe('0x29')]=function(_0x72286e,_0x1a6c0b){var _0x432073={},_0x4b2345={},_0x4e905f={'count':0x0,'rows':[]};var _0x4f1db5=_[_0xe5fe('0x2a')](db['SquareRecording'][_0xe5fe('0x2b')],function(_0x24b324){return{'name':_0x24b324[_0xe5fe('0x2c')],'type':_0x24b324['type']['key']};});_0x4b2345['model']=_[_0xe5fe('0x2a')](_0x4f1db5,_0xe5fe('0x27'));_0x4b2345[_0xe5fe('0x2d')]=_['keys'](_0x72286e[_0xe5fe('0x2d')]);_0x4b2345['filters']=_[_0xe5fe('0x2e')](_0x4b2345['model'],_0x4b2345[_0xe5fe('0x2d')]);_0x432073[_0xe5fe('0x2f')]=_[_0xe5fe('0x2e')](_0x4b2345['model'],qs[_0xe5fe('0x30')](_0x72286e[_0xe5fe('0x2d')][_0xe5fe('0x30')]));_0x432073[_0xe5fe('0x2f')]=_0x432073[_0xe5fe('0x2f')][_0xe5fe('0x31')]?_0x432073[_0xe5fe('0x2f')]:_0x4b2345['model'];if(!_0x72286e[_0xe5fe('0x2d')]['hasOwnProperty'](_0xe5fe('0x32'))){_0x432073[_0xe5fe('0x1e')]=qs[_0xe5fe('0x1e')](_0x72286e[_0xe5fe('0x2d')][_0xe5fe('0x1e')]);_0x432073['offset']=qs[_0xe5fe('0x33')](_0x72286e[_0xe5fe('0x2d')][_0xe5fe('0x33')]);}_0x432073[_0xe5fe('0x34')]=qs[_0xe5fe('0x35')](_0x72286e['query'][_0xe5fe('0x35')]);_0x432073[_0xe5fe('0x36')]=qs[_0xe5fe('0x37')](_[_0xe5fe('0x38')](_0x72286e['query'],_0x4b2345[_0xe5fe('0x37')]),_0x4f1db5);if(_0x72286e['query'][_0xe5fe('0x39')]){_0x432073['where']=_['merge'](_0x432073[_0xe5fe('0x36')],{'$or':_[_0xe5fe('0x2a')](_0x4f1db5,function(_0x4e1375){if(_0x4e1375[_0xe5fe('0x3a')]!==_0xe5fe('0x3b')){var _0x3da5b8={};_0x3da5b8[_0x4e1375['name']]={'$like':'%'+_0x72286e[_0xe5fe('0x2d')][_0xe5fe('0x39')]+'%'};return _0x3da5b8;}})});}_0x432073=_[_0xe5fe('0x3c')]({},_0x432073,_0x72286e[_0xe5fe('0x3d')]);var _0x2df903={'where':_0x432073[_0xe5fe('0x36')]};return db[_0xe5fe('0x3e')][_0xe5fe('0x1d')](_0x2df903)[_0xe5fe('0x23')](function(_0x40be4f){_0x4e905f[_0xe5fe('0x1d')]=_0x40be4f;if(_0x72286e['query'][_0xe5fe('0x3f')]){_0x432073[_0xe5fe('0x40')]=[{'all':!![]}];}return db[_0xe5fe('0x3e')][_0xe5fe('0x41')](_0x432073);})[_0xe5fe('0x23')](function(_0x3914c3){_0x4e905f[_0xe5fe('0x42')]=_0x3914c3;return _0x4e905f;})[_0xe5fe('0x23')](respondWithFilteredResult(_0x1a6c0b,_0x432073))['catch'](handleError(_0x1a6c0b,null));};exports[_0xe5fe('0x43')]=function(_0x29e293,_0x2fb3a3){var _0x4e4199={'raw':!![],'where':{'id':_0x29e293[_0xe5fe('0x44')]['id']}},_0x168c3c={};_0x168c3c[_0xe5fe('0x45')]=_[_0xe5fe('0x46')](db['SquareRecording'][_0xe5fe('0x2b')]);_0x168c3c[_0xe5fe('0x2d')]=_['keys'](_0x29e293[_0xe5fe('0x2d')]);_0x168c3c[_0xe5fe('0x37')]=_[_0xe5fe('0x2e')](_0x168c3c['model'],_0x168c3c[_0xe5fe('0x2d')]);_0x4e4199[_0xe5fe('0x2f')]=_[_0xe5fe('0x2e')](_0x168c3c[_0xe5fe('0x45')],qs[_0xe5fe('0x30')](_0x29e293[_0xe5fe('0x2d')][_0xe5fe('0x30')]));_0x4e4199[_0xe5fe('0x2f')]=_0x4e4199[_0xe5fe('0x2f')][_0xe5fe('0x31')]?_0x4e4199[_0xe5fe('0x2f')]:_0x168c3c[_0xe5fe('0x45')];if(_0x29e293['query']['includeAll']){_0x4e4199['include']=[{'all':!![]}];}_0x4e4199=_[_0xe5fe('0x3c')]({},_0x4e4199,_0x29e293['options']);return db[_0xe5fe('0x3e')][_0xe5fe('0x47')](_0x4e4199)[_0xe5fe('0x23')](handleEntityNotFound(_0x2fb3a3,null))[_0xe5fe('0x23')](respondWithResult(_0x2fb3a3,null))[_0xe5fe('0x48')](handleError(_0x2fb3a3,null));};exports[_0xe5fe('0x49')]=function(_0x1008a7,_0x57c1b1){return db[_0xe5fe('0x3e')][_0xe5fe('0x49')](_0x1008a7[_0xe5fe('0x4a')],{})[_0xe5fe('0x23')](respondWithResult(_0x57c1b1,0xc9))[_0xe5fe('0x48')](handleError(_0x57c1b1,null));};exports['update']=function(_0x223a8b,_0x1e3f48){if(_0x223a8b[_0xe5fe('0x4a')]['id']){delete _0x223a8b[_0xe5fe('0x4a')]['id'];}return db[_0xe5fe('0x3e')][_0xe5fe('0x47')]({'where':{'id':_0x223a8b[_0xe5fe('0x44')]['id']}})[_0xe5fe('0x23')](handleEntityNotFound(_0x1e3f48,null))[_0xe5fe('0x23')](saveUpdates(_0x223a8b[_0xe5fe('0x4a')],null))[_0xe5fe('0x23')](respondWithResult(_0x1e3f48,null))[_0xe5fe('0x48')](handleError(_0x1e3f48,null));};exports[_0xe5fe('0x4b')]=function(_0x5723be,_0x522233,_0xf5fb50){var _0x5d6c3a=require('../../components/encryptor');var _0xe509a2=![];var _0xd57e20={};if(_0x5723be['query']['type']&&_0x5723be[_0xe5fe('0x2d')][_0xe5fe('0x3a')]===_0xe5fe('0x4c')){_0xd57e20[_0xe5fe('0x4c')]=_0x5723be[_0xe5fe('0x44')]['id'];}else{_0xd57e20['id']=_0x5723be[_0xe5fe('0x44')]['id'];}return db[_0xe5fe('0x3e')][_0xe5fe('0x47')]({'where':_0xd57e20,'attributes':['id',_0xe5fe('0x4d'),_0xe5fe('0x4e')],'raw':!![]})[_0xe5fe('0x23')](handleEntityNotFound(_0x522233,null))[_0xe5fe('0x23')](function(_0x103fb0){if(_0x103fb0){var _0x49c737=_0x103fb0['savePath'];var _0x171f17=util[_0xe5fe('0x4f')](_0xe5fe('0x50'),_0x49c737);if(fs[_0xe5fe('0x51')](_0x171f17)){_0xe509a2=!![];return _0x5d6c3a[_0xe5fe('0x52')](_0x171f17,_0x49c737,config[_0xe5fe('0x53')][_0xe5fe('0x54')])['then'](function(){return _0x103fb0;});}return _0x103fb0;}})[_0xe5fe('0x23')](function(_0x32ff10){if(_0x32ff10){var _0x4d5bdc=_0x32ff10[_0xe5fe('0x4d')];if(!fs[_0xe5fe('0x51')](_0x4d5bdc)){throw new db[(_0xe5fe('0x55'))][(_0xe5fe('0x56'))](_0xe5fe('0x57'));}if(_0x32ff10[_0xe5fe('0x4e')]){return _0x522233['download'](_0x4d5bdc,_0x32ff10['filename']+path[_0xe5fe('0x58')](_0x4d5bdc),function(){if(_0xe509a2){fs[_0xe5fe('0x59')](_0x4d5bdc);}});}else{return _0x522233['download'](_0x4d5bdc,function(_0x107a9c){if(_0xe509a2){fs[_0xe5fe('0x59')](_0x4d5bdc);}});}}})[_0xe5fe('0x48')](function(_0x5992a9){if(_0x5992a9['message']===_0xe5fe('0x57')){_0x522233[_0xe5fe('0x19')](0x194)['send']('Not\x20found');}else{return handleError(_0x522233,null);}});};exports[_0xe5fe('0x5a')]=function(_0x1837f3,_0x2f94e4){return db[_0xe5fe('0x3e')][_0xe5fe('0x47')]({'where':{'id':_0x1837f3[_0xe5fe('0x44')]['id']}})[_0xe5fe('0x23')](function(_0x97cd7f){if(_[_0xe5fe('0x5b')](_0x97cd7f)){throw new ReferenceError(_0xe5fe('0x5c'));}return _0x97cd7f;})[_0xe5fe('0x23')](function(_0xa98ffd){var _0x86a97a=_0xa98ffd['savePath'];logger[_0xe5fe('0x5d')](_0xe5fe('0x5e'),_0x86a97a);if(!_[_0xe5fe('0x5b')](_0xa98ffd[_0xe5fe('0x4d')])&&fs[_0xe5fe('0x51')](_0x86a97a)){logger['info'](_0xe5fe('0x5f')+_0x86a97a+_0xe5fe('0x60'));fs[_0xe5fe('0x61')](_0x86a97a);}_0x86a97a=_0x86a97a+'.cypher';if(!_[_0xe5fe('0x5b')](_0xa98ffd['savePath'])&&fs[_0xe5fe('0x51')](_0x86a97a)){logger[_0xe5fe('0x5d')](_0xe5fe('0x5f')+_0x86a97a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe5fe('0x61')](_0x86a97a);}return _0xa98ffd;})[_0xe5fe('0x23')](function(_0x439d78){if(!_0x439d78)throw new InternalError();return _0x439d78[_0xe5fe('0x5a')]();})['then'](function(){_0x2f94e4[_0xe5fe('0x19')](0xcc)[_0xe5fe('0x1a')]();})[_0xe5fe('0x48')](handleError(_0x2f94e4,null));};
\ No newline at end of file
+var _0x10b6=['apply','reject','save','then','destroy','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','keys','length','options','find','create','catch','update','body','download','../../components/encryptor','uniqueid','params','savePath','filename','format','%s.cypher','existsSync','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x51b4a4,_0x41a5f5){var _0x2c84ec=function(_0x11d865){while(--_0x11d865){_0x51b4a4['push'](_0x51b4a4['shift']());}};_0x2c84ec(++_0x41a5f5);}(_0x10b6,0x1c8));var _0x610b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x10b6[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x610b('0x0'));var rimraf=require(_0x610b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x610b('0x2'));var rp=require('request-promise');var moment=require(_0x610b('0x3'));var BPromise=require(_0x610b('0x4'));var Mustache=require('mustache');var util=require(_0x610b('0x5'));var path=require('path');var sox=require(_0x610b('0x6'));var csv=require('to-csv');var ejs=require(_0x610b('0x7'));var fs=require('fs');var fs_extra=require(_0x610b('0x8'));var _=require(_0x610b('0x9'));var squel=require(_0x610b('0xa'));var crypto=require(_0x610b('0xb'));var jsforce=require(_0x610b('0xc'));var deskjs=require(_0x610b('0xd'));var toCsv=require(_0x610b('0xe'));var querystring=require('querystring');var Papa=require(_0x610b('0xf'));var Redis=require(_0x610b('0x10'));var authService=require(_0x610b('0x11'));var qs=require(_0x610b('0x12'));var as=require(_0x610b('0x13'));var hardwareService=require(_0x610b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x610b('0x15'));var config=require(_0x610b('0x16'));var licenseUtil=require(_0x610b('0x17'));var db=require(_0x610b('0x18'))['db'];function respondWithStatusCode(_0x31e2ed,_0x28b375){_0x28b375=_0x28b375||0xcc;return function(_0x5ef90f){if(_0x5ef90f){return _0x31e2ed[_0x610b('0x19')](_0x28b375);}return _0x31e2ed['status'](_0x28b375)['end']();};}function respondWithResult(_0x4704d1,_0x3c92ab){_0x3c92ab=_0x3c92ab||0xc8;return function(_0x2e1756){if(_0x2e1756){return _0x4704d1[_0x610b('0x1a')](_0x3c92ab)[_0x610b('0x1b')](_0x2e1756);}};}function respondWithFilteredResult(_0x93155a,_0x2204e7){return function(_0x3e2181){if(_0x3e2181){var _0x3dd32b=typeof _0x2204e7[_0x610b('0x1c')]===_0x610b('0x1d')&&typeof _0x2204e7[_0x610b('0x1e')]===_0x610b('0x1d');var _0x42e4d6=_0x3e2181[_0x610b('0x1f')];var _0x5c3e69=_0x3dd32b?0x0:_0x2204e7[_0x610b('0x1c')];var _0x113653=_0x3dd32b?_0x3e2181['count']:_0x2204e7['offset']+_0x2204e7[_0x610b('0x1e')];var _0x20ab64;if(_0x113653>=_0x42e4d6){_0x113653=_0x42e4d6;_0x20ab64=0xc8;}else{_0x20ab64=0xce;}_0x93155a[_0x610b('0x1a')](_0x20ab64);return _0x93155a[_0x610b('0x20')](_0x610b('0x21'),_0x5c3e69+'-'+_0x113653+'/'+_0x42e4d6)['json'](_0x3e2181);}return null;};}function patchUpdates(_0x177efd){return function(_0x28fc13){try{jsonpatch[_0x610b('0x22')](_0x28fc13,_0x177efd,!![]);}catch(_0x69057e){return BPromise[_0x610b('0x23')](_0x69057e);}return _0x28fc13[_0x610b('0x24')]();};}function saveUpdates(_0x34929e,_0x543da8){return function(_0x148df2){if(_0x148df2){return _0x148df2['update'](_0x34929e)[_0x610b('0x25')](function(_0x4c13da){return _0x4c13da;});}return null;};}function removeEntity(_0x14d587,_0xf9d340){return function(_0x538690){if(_0x538690){return _0x538690[_0x610b('0x26')]()['then'](function(){_0x14d587['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x292887,_0x10fc9c){return function(_0x407483){if(!_0x407483){_0x292887[_0x610b('0x19')](0x194);}return _0x407483;};}function handleError(_0x327968,_0x1af953){_0x1af953=_0x1af953||0x1f4;return function(_0x54cbab){logger['error'](_0x54cbab[_0x610b('0x27')]);if(_0x54cbab[_0x610b('0x28')]){delete _0x54cbab[_0x610b('0x28')];}_0x327968['status'](_0x1af953)['send'](_0x54cbab);};}exports[_0x610b('0x29')]=function(_0x4fde1e,_0x1628b3){var _0x451f24={},_0x223898={},_0x3eab4a={'count':0x0,'rows':[]};var _0x27c1d8=_[_0x610b('0x2a')](db[_0x610b('0x2b')][_0x610b('0x2c')],function(_0x2150df){return{'name':_0x2150df[_0x610b('0x2d')],'type':_0x2150df[_0x610b('0x2e')][_0x610b('0x2f')]};});_0x223898[_0x610b('0x30')]=_['map'](_0x27c1d8,'name');_0x223898[_0x610b('0x31')]=_['keys'](_0x4fde1e[_0x610b('0x31')]);_0x223898[_0x610b('0x32')]=_[_0x610b('0x33')](_0x223898[_0x610b('0x30')],_0x223898[_0x610b('0x31')]);_0x451f24['attributes']=_[_0x610b('0x33')](_0x223898[_0x610b('0x30')],qs['fields'](_0x4fde1e['query'][_0x610b('0x34')]));_0x451f24[_0x610b('0x35')]=_0x451f24[_0x610b('0x35')]['length']?_0x451f24['attributes']:_0x223898[_0x610b('0x30')];if(!_0x4fde1e['query'][_0x610b('0x36')](_0x610b('0x37'))){_0x451f24[_0x610b('0x1e')]=qs['limit'](_0x4fde1e[_0x610b('0x31')][_0x610b('0x1e')]);_0x451f24[_0x610b('0x1c')]=qs['offset'](_0x4fde1e['query']['offset']);}_0x451f24[_0x610b('0x38')]=qs[_0x610b('0x39')](_0x4fde1e[_0x610b('0x31')]['sort']);_0x451f24[_0x610b('0x3a')]=qs[_0x610b('0x32')](_[_0x610b('0x3b')](_0x4fde1e[_0x610b('0x31')],_0x223898[_0x610b('0x32')]),_0x27c1d8);if(_0x4fde1e[_0x610b('0x31')][_0x610b('0x3c')]){_0x451f24[_0x610b('0x3a')]=_[_0x610b('0x3d')](_0x451f24[_0x610b('0x3a')],{'$or':_[_0x610b('0x2a')](_0x27c1d8,function(_0x56fe4c){if(_0x56fe4c[_0x610b('0x2e')]!==_0x610b('0x3e')){var _0xf27107={};_0xf27107[_0x56fe4c['name']]={'$like':'%'+_0x4fde1e[_0x610b('0x31')][_0x610b('0x3c')]+'%'};return _0xf27107;}})});}_0x451f24=_[_0x610b('0x3d')]({},_0x451f24,_0x4fde1e['options']);var _0x17ddb9={'where':_0x451f24['where']};return db[_0x610b('0x2b')][_0x610b('0x1f')](_0x17ddb9)[_0x610b('0x25')](function(_0x2d1fa6){_0x3eab4a[_0x610b('0x1f')]=_0x2d1fa6;if(_0x4fde1e['query'][_0x610b('0x3f')]){_0x451f24[_0x610b('0x40')]=[{'all':!![]}];}return db[_0x610b('0x2b')][_0x610b('0x41')](_0x451f24);})['then'](function(_0x17305f){_0x3eab4a[_0x610b('0x42')]=_0x17305f;return _0x3eab4a;})['then'](respondWithFilteredResult(_0x1628b3,_0x451f24))['catch'](handleError(_0x1628b3,null));};exports[_0x610b('0x43')]=function(_0xf20785,_0x3cb338){var _0x557704={'raw':!![],'where':{'id':_0xf20785['params']['id']}},_0x1d3e9a={};_0x1d3e9a[_0x610b('0x30')]=_[_0x610b('0x44')](db[_0x610b('0x2b')][_0x610b('0x2c')]);_0x1d3e9a[_0x610b('0x31')]=_['keys'](_0xf20785[_0x610b('0x31')]);_0x1d3e9a[_0x610b('0x32')]=_[_0x610b('0x33')](_0x1d3e9a[_0x610b('0x30')],_0x1d3e9a[_0x610b('0x31')]);_0x557704['attributes']=_[_0x610b('0x33')](_0x1d3e9a[_0x610b('0x30')],qs[_0x610b('0x34')](_0xf20785[_0x610b('0x31')][_0x610b('0x34')]));_0x557704['attributes']=_0x557704[_0x610b('0x35')][_0x610b('0x45')]?_0x557704[_0x610b('0x35')]:_0x1d3e9a[_0x610b('0x30')];if(_0xf20785[_0x610b('0x31')][_0x610b('0x3f')]){_0x557704[_0x610b('0x40')]=[{'all':!![]}];}_0x557704=_['merge']({},_0x557704,_0xf20785[_0x610b('0x46')]);return db[_0x610b('0x2b')][_0x610b('0x47')](_0x557704)[_0x610b('0x25')](handleEntityNotFound(_0x3cb338,null))['then'](respondWithResult(_0x3cb338,null))['catch'](handleError(_0x3cb338,null));};exports[_0x610b('0x48')]=function(_0xaccbfb,_0x182380){return db[_0x610b('0x2b')][_0x610b('0x48')](_0xaccbfb['body'],{})[_0x610b('0x25')](respondWithResult(_0x182380,0xc9))[_0x610b('0x49')](handleError(_0x182380,null));};exports[_0x610b('0x4a')]=function(_0x572961,_0x990e78){if(_0x572961[_0x610b('0x4b')]['id']){delete _0x572961[_0x610b('0x4b')]['id'];}return db['SquareRecording'][_0x610b('0x47')]({'where':{'id':_0x572961['params']['id']}})[_0x610b('0x25')](handleEntityNotFound(_0x990e78,null))[_0x610b('0x25')](saveUpdates(_0x572961['body'],null))[_0x610b('0x25')](respondWithResult(_0x990e78,null))[_0x610b('0x49')](handleError(_0x990e78,null));};exports[_0x610b('0x4c')]=function(_0xfc23fa,_0x297cf0,_0x49123d){var _0x4e249e=require(_0x610b('0x4d'));var _0x41c871=![];var _0xc28fde={};if(_0xfc23fa['query'][_0x610b('0x2e')]&&_0xfc23fa[_0x610b('0x31')][_0x610b('0x2e')]===_0x610b('0x4e')){_0xc28fde[_0x610b('0x4e')]=_0xfc23fa[_0x610b('0x4f')]['id'];}else{_0xc28fde['id']=_0xfc23fa[_0x610b('0x4f')]['id'];}return db[_0x610b('0x2b')][_0x610b('0x47')]({'where':_0xc28fde,'attributes':['id',_0x610b('0x50'),_0x610b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x297cf0,null))['then'](function(_0x4d1dd1){if(_0x4d1dd1){var _0x18bed1=_0x4d1dd1['savePath'];var _0x17d645=util[_0x610b('0x52')](_0x610b('0x53'),_0x18bed1);if(fs[_0x610b('0x54')](_0x17d645)){_0x41c871=!![];return _0x4e249e['decryptFile'](_0x17d645,_0x18bed1,config['secrets'][_0x610b('0x55')])[_0x610b('0x25')](function(){return _0x4d1dd1;});}return _0x4d1dd1;}})[_0x610b('0x25')](function(_0x347f3d){if(_0x347f3d){var _0x2ed293=_0x347f3d[_0x610b('0x50')];if(!fs[_0x610b('0x54')](_0x2ed293)){throw new db['Sequelize'][(_0x610b('0x56'))](_0x610b('0x57'));}if(_0x347f3d[_0x610b('0x51')]){return _0x297cf0[_0x610b('0x4c')](_0x2ed293,_0x347f3d['filename']+path[_0x610b('0x58')](_0x2ed293),function(){if(_0x41c871){fs[_0x610b('0x59')](_0x2ed293);}});}else{return _0x297cf0[_0x610b('0x4c')](_0x2ed293,function(_0x927dd0){if(_0x41c871){fs[_0x610b('0x59')](_0x2ed293);}});}}})[_0x610b('0x49')](function(_0x437f06){if(_0x437f06[_0x610b('0x5a')]===_0x610b('0x57')){_0x297cf0['status'](0x194)['send'](_0x610b('0x5b'));}else{return handleError(_0x297cf0,null);}});};exports['destroy']=function(_0x52b1e1,_0x5a333f){return db[_0x610b('0x2b')][_0x610b('0x47')]({'where':{'id':_0x52b1e1[_0x610b('0x4f')]['id']}})[_0x610b('0x25')](function(_0x252a77){if(_[_0x610b('0x5c')](_0x252a77)){throw new ReferenceError('Entity\x20not\x20found');}return _0x252a77;})[_0x610b('0x25')](function(_0x5ecd37){var _0x212012=_0x5ecd37[_0x610b('0x50')];logger[_0x610b('0x5d')]('cancellazione\x20fisica\x20documento\x20%s',_0x212012);if(!_[_0x610b('0x5c')](_0x5ecd37['savePath'])&&fs[_0x610b('0x54')](_0x212012)){logger[_0x610b('0x5d')]('File:\x20\x22'+_0x212012+_0x610b('0x5e'));fs['unlinkSync'](_0x212012);}_0x212012=_0x212012+_0x610b('0x5f');if(!_[_0x610b('0x5c')](_0x5ecd37[_0x610b('0x50')])&&fs['existsSync'](_0x212012)){logger[_0x610b('0x5d')](_0x610b('0x60')+_0x212012+_0x610b('0x5e'));fs[_0x610b('0x61')](_0x212012);}return _0x5ecd37;})[_0x610b('0x25')](function(_0x125cd4){if(!_0x125cd4)throw new InternalError();return _0x125cd4[_0x610b('0x26')]();})['then'](function(){_0x5a333f['status'](0xcc)['end']();})[_0x610b('0x49')](handleError(_0x5a333f,null));};
\ No newline at end of file
index 8520381..0cceae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x147b=['api','moment','request-promise','path','rimraf','./squareRecording.attributes','define','lodash','util'];(function(_0x409b64,_0x36bb17){var _0x2e8dd3=function(_0x2c8cdf){while(--_0x2c8cdf){_0x409b64['push'](_0x409b64['shift']());}};_0x2e8dd3(++_0x36bb17);}(_0x147b,0x193));var _0xb147=function(_0x3f7101,_0x3af08b){_0x3f7101=_0x3f7101-0x0;var _0x1a30a0=_0x147b[_0x3f7101];return _0x1a30a0;};'use strict';var _=require(_0xb147('0x0'));var util=require(_0xb147('0x1'));var logger=require('../../config/logger')(_0xb147('0x2'));var moment=require(_0xb147('0x3'));var BPromise=require('bluebird');var rp=require(_0xb147('0x4'));var fs=require('fs');var path=require(_0xb147('0x5'));var rimraf=require(_0xb147('0x6'));var config=require('../../config/environment');var attributes=require(_0xb147('0x7'));module['exports']=function(_0x2432f1,_0x72c3cf){return _0x2432f1[_0xb147('0x8')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x644f=['square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x222214,_0x5c3279){var _0x303520=function(_0x4d71ec){while(--_0x4d71ec){_0x222214['push'](_0x222214['shift']());}};_0x303520(++_0x5c3279);}(_0x644f,0x177));var _0xf644=function(_0x309d93,_0x157662){_0x309d93=_0x309d93-0x0;var _0x2dd61d=_0x644f[_0x309d93];return _0x2dd61d;};'use strict';var _=require('lodash');var util=require(_0xf644('0x0'));var logger=require(_0xf644('0x1'))(_0xf644('0x2'));var moment=require(_0xf644('0x3'));var BPromise=require(_0xf644('0x4'));var rp=require(_0xf644('0x5'));var fs=require('fs');var path=require(_0xf644('0x6'));var rimraf=require(_0xf644('0x7'));var config=require(_0xf644('0x8'));var attributes=require('./squareRecording.attributes');module['exports']=function(_0x23cd49,_0x16e2f2){return _0x23cd49[_0xf644('0x9')]('SquareRecording',attributes,{'tableName':_0xf644('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e9aa0f..a1ee3ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929d=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SquareRecording,\x20%s,\x20%s','CreateSquareRecording','SquareRecording','body','options','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1f1170,_0x3b5783){var _0x127b7b=function(_0x30c5ed){while(--_0x30c5ed){_0x1f1170['push'](_0x1f1170['shift']());}};_0x127b7b(++_0x3b5783);}(_0x929d,0x6f));var _0xd929=function(_0x20cb61,_0x11856e){_0x20cb61=_0x20cb61-0x0;var _0x4f5674=_0x929d[_0x20cb61];return _0x4f5674;};'use strict';var _=require('lodash');var util=require(_0xd929('0x0'));var moment=require(_0xd929('0x1'));var BPromise=require(_0xd929('0x2'));var rs=require(_0xd929('0x3'));var fs=require('fs');var Redis=require(_0xd929('0x4'));var db=require(_0xd929('0x5'))['db'];var utils=require(_0xd929('0x6'));var logger=require(_0xd929('0x7'))(_0xd929('0x8'));var config=require(_0xd929('0x9'));var jayson=require(_0xd929('0xa'));var client=jayson[_0xd929('0xb')][_0xd929('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x222ee5,_0x2128f7,_0x383f52){return new BPromise(function(_0x5aea5c,_0x4aa3b0){return client[_0xd929('0xd')](_0x222ee5,_0x383f52)[_0xd929('0xe')](function(_0x5b4e4c){logger[_0xd929('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2128f7,_0xd929('0x10'));logger[_0xd929('0x11')](_0xd929('0x12'),_0x2128f7,_0xd929('0x10'),JSON[_0xd929('0x13')](_0x5b4e4c));if(_0x5b4e4c[_0xd929('0x14')]){if(_0x5b4e4c[_0xd929('0x14')][_0xd929('0x15')]===0x1f4){logger[_0xd929('0x14')]('SquareRecording,\x20%s,\x20%s',_0x2128f7,_0x5b4e4c[_0xd929('0x14')][_0xd929('0x16')]);return _0x4aa3b0(_0x5b4e4c[_0xd929('0x14')]['message']);}logger[_0xd929('0x14')]('SquareRecording,\x20%s,\x20%s',_0x2128f7,_0x5b4e4c['error']['message']);return _0x5aea5c(_0x5b4e4c[_0xd929('0x14')][_0xd929('0x16')]);}else{logger[_0xd929('0xf')]('SquareRecording,\x20%s,\x20%s',_0x2128f7,_0xd929('0x10'));_0x5aea5c(_0x5b4e4c[_0xd929('0x17')][_0xd929('0x16')]);}})[_0xd929('0x18')](function(_0x2e7360){logger[_0xd929('0x14')](_0xd929('0x19'),_0x2128f7,_0x2e7360);_0x4aa3b0(_0x2e7360);});});}exports[_0xd929('0x1a')]=function(_0x313b4c){var _0x3e66c0=this;return new Promise(function(_0x1e034d,_0x4ff191){return db[_0xd929('0x1b')]['create'](_0x313b4c[_0xd929('0x1c')],{'raw':_0x313b4c[_0xd929('0x1d')]?_0x313b4c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0xa04a9f){logger[_0xd929('0xf')]('CreateSquareRecording',_0x313b4c);logger[_0xd929('0x11')](_0xd929('0x1a'),_0x313b4c,JSON[_0xd929('0x13')](_0xa04a9f));_0x1e034d(_0xa04a9f);})[_0xd929('0x18')](function(_0x4431b6){logger[_0xd929('0x14')](_0xd929('0x1a'),_0x4431b6['message'],_0x313b4c);_0x4ff191(_0x3e66c0['error'](0x1f4,_0x4431b6['message']));});});};
\ No newline at end of file
+var _0x246a=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','request\x20sent','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','create','body','options','raw','catch','lodash'];(function(_0x47103e,_0x54aebd){var _0x3d5aab=function(_0x1995a0){while(--_0x1995a0){_0x47103e['push'](_0x47103e['shift']());}};_0x3d5aab(++_0x54aebd);}(_0x246a,0x16b));var _0xa246=function(_0x4dea81,_0x8788ef){_0x4dea81=_0x4dea81-0x0;var _0x1fb3be=_0x246a[_0x4dea81];return _0x1fb3be;};'use strict';var _=require(_0xa246('0x0'));var util=require(_0xa246('0x1'));var moment=require('moment');var BPromise=require(_0xa246('0x2'));var rs=require(_0xa246('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa246('0x4'))['db'];var utils=require(_0xa246('0x5'));var logger=require(_0xa246('0x6'))(_0xa246('0x7'));var config=require(_0xa246('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa246('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4feb6d,_0x597cdd,_0x177bfe){return new BPromise(function(_0x444b43,_0x2c4954){return client[_0xa246('0xa')](_0x4feb6d,_0x177bfe)[_0xa246('0xb')](function(_0x46a3ca){logger[_0xa246('0xc')]('SquareRecording,\x20%s,\x20%s',_0x597cdd,'request\x20sent');logger[_0xa246('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x597cdd,_0xa246('0xe'),JSON[_0xa246('0xf')](_0x46a3ca));if(_0x46a3ca[_0xa246('0x10')]){if(_0x46a3ca[_0xa246('0x10')]['code']===0x1f4){logger[_0xa246('0x10')](_0xa246('0x11'),_0x597cdd,_0x46a3ca['error'][_0xa246('0x12')]);return _0x2c4954(_0x46a3ca[_0xa246('0x10')]['message']);}logger['error'](_0xa246('0x11'),_0x597cdd,_0x46a3ca[_0xa246('0x10')][_0xa246('0x12')]);return _0x444b43(_0x46a3ca[_0xa246('0x10')][_0xa246('0x12')]);}else{logger[_0xa246('0xc')](_0xa246('0x11'),_0x597cdd,'request\x20sent');_0x444b43(_0x46a3ca[_0xa246('0x13')][_0xa246('0x12')]);}})['catch'](function(_0x44559d){logger[_0xa246('0x10')]('SquareRecording,\x20%s,\x20%s',_0x597cdd,_0x44559d);_0x2c4954(_0x44559d);});});}exports[_0xa246('0x14')]=function(_0x31d561){var _0x524619=this;return new Promise(function(_0x5a4ce9,_0x3725b1){return db['SquareRecording'][_0xa246('0x15')](_0x31d561[_0xa246('0x16')],{'raw':_0x31d561[_0xa246('0x17')]?_0x31d561[_0xa246('0x17')][_0xa246('0x18')]===undefined?!![]:![]:!![]})[_0xa246('0xb')](function(_0x380204){logger[_0xa246('0xc')](_0xa246('0x14'),_0x31d561);logger[_0xa246('0xd')](_0xa246('0x14'),_0x31d561,JSON[_0xa246('0xf')](_0x380204));_0x5a4ce9(_0x380204);})[_0xa246('0x19')](function(_0x2a42c4){logger[_0xa246('0x10')](_0xa246('0x14'),_0x2a42c4[_0xa246('0x12')],_0x31d561);_0x3725b1(_0x524619[_0xa246('0x10')](0x1f4,_0x2a42c4[_0xa246('0x12')]));});});};
\ No newline at end of file
index fcc2f56..5900f8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x36d831,_0x6c602a){var _0x5bc013=function(_0x1b0e7f){while(--_0x1b0e7f){_0x36d831['push'](_0x36d831['shift']());}};_0x5bc013(++_0x6c602a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 788a22f..833fd30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f92=['BOOLEAN','exports','STRING','DATE'];(function(_0x2027d6,_0x1c9197){var _0x3a506e=function(_0x287f08){while(--_0x287f08){_0x2027d6['push'](_0x2027d6['shift']());}};_0x3a506e(++_0x1c9197);}(_0x2f92,0x1d1));var _0x22f9=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x2f92[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require('sequelize');module[_0x22f9('0x0')]={'network':{'type':Sequelize[_0x22f9('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x22f9('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x22f9('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x22f9('0x1')]},'callerid':{'type':Sequelize[_0x22f9('0x1')]},'calleridname':{'type':Sequelize[_0x22f9('0x1')]},'callingpres':{'type':Sequelize[_0x22f9('0x1')]},'callingani2':{'type':Sequelize[_0x22f9('0x1')]},'callington':{'type':Sequelize[_0x22f9('0x1')]},'callingtns':{'type':Sequelize[_0x22f9('0x1')]},'dnid':{'type':Sequelize[_0x22f9('0x1')]},'rdnis':{'type':Sequelize[_0x22f9('0x1')]},'context':{'type':Sequelize[_0x22f9('0x1')]},'extension':{'type':Sequelize[_0x22f9('0x1')]},'priority':{'type':Sequelize[_0x22f9('0x1')]},'enhanced':{'type':Sequelize[_0x22f9('0x1')]},'accountcode':{'type':Sequelize[_0x22f9('0x1')]},'threadid':{'type':Sequelize[_0x22f9('0x1')]},'project_name':{'type':Sequelize[_0x22f9('0x1')]},'joinAt':{'type':Sequelize[_0x22f9('0x2')]},'leaveAt':{'type':Sequelize[_0x22f9('0x2')]},'bot':{'type':Sequelize[_0x22f9('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x69a2=['sequelize','STRING','BOOLEAN'];(function(_0x2ce55c,_0x2a57bf){var _0x63be75=function(_0x595691){while(--_0x595691){_0x2ce55c['push'](_0x2ce55c['shift']());}};_0x63be75(++_0x2a57bf);}(_0x69a2,0x1a1));var _0x269a=function(_0x115bdf,_0x4de32c){_0x115bdf=_0x115bdf-0x0;var _0x4c608e=_0x69a2[_0x115bdf];return _0x4c608e;};'use strict';var Sequelize=require(_0x269a('0x0'));module['exports']={'network':{'type':Sequelize[_0x269a('0x1')]},'network_script':{'type':Sequelize[_0x269a('0x1')]},'request':{'type':Sequelize[_0x269a('0x1')]},'channel':{'type':Sequelize[_0x269a('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x269a('0x1')]},'uniqueid':{'type':Sequelize[_0x269a('0x1')]},'version':{'type':Sequelize[_0x269a('0x1')]},'callerid':{'type':Sequelize[_0x269a('0x1')]},'calleridname':{'type':Sequelize[_0x269a('0x1')]},'callingpres':{'type':Sequelize[_0x269a('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x269a('0x1')]},'callingtns':{'type':Sequelize[_0x269a('0x1')]},'dnid':{'type':Sequelize[_0x269a('0x1')]},'rdnis':{'type':Sequelize[_0x269a('0x1')]},'context':{'type':Sequelize[_0x269a('0x1')]},'extension':{'type':Sequelize[_0x269a('0x1')]},'priority':{'type':Sequelize[_0x269a('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x269a('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 5329192..876aa2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x798e=['then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','SquareReport','includeAll','include','rows','show','catch','create','body','update','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','apply','reject'];(function(_0x54efc8,_0x1894b8){var _0x2619d2=function(_0x5adde7){while(--_0x5adde7){_0x54efc8['push'](_0x54efc8['shift']());}};_0x2619d2(++_0x1894b8);}(_0x798e,0xb7));var _0xe798=function(_0x72a92c,_0x5be1f8){_0x72a92c=_0x72a92c-0x0;var _0x4c07f4=_0x798e[_0x72a92c];return _0x4c07f4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe798('0x0'));var zipdir=require(_0xe798('0x1'));var jsonpatch=require(_0xe798('0x2'));var rp=require(_0xe798('0x3'));var moment=require(_0xe798('0x4'));var BPromise=require(_0xe798('0x5'));var Mustache=require(_0xe798('0x6'));var util=require(_0xe798('0x7'));var path=require(_0xe798('0x8'));var sox=require(_0xe798('0x9'));var csv=require(_0xe798('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe798('0xb'));var squel=require(_0xe798('0xc'));var crypto=require(_0xe798('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe798('0xe'));var Papa=require('papaparse');var Redis=require(_0xe798('0xf'));var authService=require(_0xe798('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe798('0x11'));var hardwareService=require(_0xe798('0x12'));var logger=require(_0xe798('0x13'))(_0xe798('0x14'));var utils=require(_0xe798('0x15'));var config=require(_0xe798('0x16'));var licenseUtil=require(_0xe798('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7845,_0xcc59b1){_0xcc59b1=_0xcc59b1||0xcc;return function(_0x2c30d8){if(_0x2c30d8){return _0x3e7845[_0xe798('0x18')](_0xcc59b1);}return _0x3e7845['status'](_0xcc59b1)['end']();};}function respondWithResult(_0x375a2f,_0x3cd281){_0x3cd281=_0x3cd281||0xc8;return function(_0x3cd12d){if(_0x3cd12d){return _0x375a2f[_0xe798('0x19')](_0x3cd281)[_0xe798('0x1a')](_0x3cd12d);}};}function respondWithFilteredResult(_0x4b517e,_0x362989){return function(_0x5a4e99){if(_0x5a4e99){var _0x365a46=typeof _0x362989[_0xe798('0x1b')]===_0xe798('0x1c')&&typeof _0x362989[_0xe798('0x1d')]===_0xe798('0x1c');var _0x1d0441=_0x5a4e99[_0xe798('0x1e')];var _0x45dc86=_0x365a46?0x0:_0x362989['offset'];var _0x1efa4a=_0x365a46?_0x5a4e99[_0xe798('0x1e')]:_0x362989[_0xe798('0x1b')]+_0x362989['limit'];var _0x3ad990;if(_0x1efa4a>=_0x1d0441){_0x1efa4a=_0x1d0441;_0x3ad990=0xc8;}else{_0x3ad990=0xce;}_0x4b517e['status'](_0x3ad990);return _0x4b517e['set']('Content-Range',_0x45dc86+'-'+_0x1efa4a+'/'+_0x1d0441)['json'](_0x5a4e99);}return null;};}function patchUpdates(_0xa30cf1){return function(_0x14ee26){try{jsonpatch[_0xe798('0x1f')](_0x14ee26,_0xa30cf1,!![]);}catch(_0x177383){return BPromise[_0xe798('0x20')](_0x177383);}return _0x14ee26['save']();};}function saveUpdates(_0x4e95c8,_0xac5136){return function(_0x21d352){if(_0x21d352){return _0x21d352['update'](_0x4e95c8)[_0xe798('0x21')](function(_0x5a9969){return _0x5a9969;});}return null;};}function removeEntity(_0x4a7514,_0x2bb502){return function(_0x1f4feb){if(_0x1f4feb){return _0x1f4feb[_0xe798('0x22')]()[_0xe798('0x21')](function(){_0x4a7514[_0xe798('0x19')](0xcc)[_0xe798('0x23')]();});}};}function handleEntityNotFound(_0xce6502,_0x59d32a){return function(_0x14576a){if(!_0x14576a){_0xce6502[_0xe798('0x18')](0x194);}return _0x14576a;};}function handleError(_0x48e6e8,_0x295267){_0x295267=_0x295267||0x1f4;return function(_0x41471c){logger['error'](_0x41471c[_0xe798('0x24')]);if(_0x41471c['name']){delete _0x41471c[_0xe798('0x25')];}_0x48e6e8['status'](_0x295267)['send'](_0x41471c);};}exports[_0xe798('0x26')]=function(_0x4eb6b2,_0x41e202){var _0x4e2553={},_0x3ce456={},_0x2c7da2={'count':0x0,'rows':[]};var _0x14cba7=_[_0xe798('0x27')](db['SquareReport'][_0xe798('0x28')],function(_0xe39e2f){return{'name':_0xe39e2f[_0xe798('0x29')],'type':_0xe39e2f[_0xe798('0x2a')][_0xe798('0x2b')]};});_0x3ce456[_0xe798('0x2c')]=_['map'](_0x14cba7,_0xe798('0x25'));_0x3ce456[_0xe798('0x2d')]=_[_0xe798('0x2e')](_0x4eb6b2[_0xe798('0x2d')]);_0x3ce456[_0xe798('0x2f')]=_[_0xe798('0x30')](_0x3ce456[_0xe798('0x2c')],_0x3ce456['query']);_0x4e2553[_0xe798('0x31')]=_['intersection'](_0x3ce456['model'],qs[_0xe798('0x32')](_0x4eb6b2[_0xe798('0x2d')]['fields']));_0x4e2553[_0xe798('0x31')]=_0x4e2553[_0xe798('0x31')][_0xe798('0x33')]?_0x4e2553[_0xe798('0x31')]:_0x3ce456[_0xe798('0x2c')];if(!_0x4eb6b2[_0xe798('0x2d')][_0xe798('0x34')]('nolimit')){_0x4e2553[_0xe798('0x1d')]=qs['limit'](_0x4eb6b2[_0xe798('0x2d')][_0xe798('0x1d')]);_0x4e2553['offset']=qs[_0xe798('0x1b')](_0x4eb6b2['query'][_0xe798('0x1b')]);}_0x4e2553[_0xe798('0x35')]=qs['sort'](_0x4eb6b2[_0xe798('0x2d')]['sort']);_0x4e2553[_0xe798('0x36')]=qs[_0xe798('0x2f')](_[_0xe798('0x37')](_0x4eb6b2[_0xe798('0x2d')],_0x3ce456[_0xe798('0x2f')]),_0x14cba7);if(_0x4eb6b2[_0xe798('0x2d')][_0xe798('0x38')]){_0x4e2553['where']=_[_0xe798('0x39')](_0x4e2553[_0xe798('0x36')],{'$or':_['map'](_0x14cba7,function(_0x5ab6b5){if(_0x5ab6b5['type']!==_0xe798('0x3a')){var _0x58b375={};_0x58b375[_0x5ab6b5[_0xe798('0x25')]]={'$like':'%'+_0x4eb6b2[_0xe798('0x2d')][_0xe798('0x38')]+'%'};return _0x58b375;}})});}_0x4e2553=_[_0xe798('0x39')]({},_0x4e2553,_0x4eb6b2[_0xe798('0x3b')]);var _0x264e38={'where':_0x4e2553[_0xe798('0x36')]};return db[_0xe798('0x3c')][_0xe798('0x1e')](_0x264e38)['then'](function(_0x308cab){_0x2c7da2[_0xe798('0x1e')]=_0x308cab;if(_0x4eb6b2[_0xe798('0x2d')][_0xe798('0x3d')]){_0x4e2553[_0xe798('0x3e')]=[{'all':!![]}];}return db[_0xe798('0x3c')]['findAll'](_0x4e2553);})[_0xe798('0x21')](function(_0x13fe4f){_0x2c7da2[_0xe798('0x3f')]=_0x13fe4f;return _0x2c7da2;})[_0xe798('0x21')](respondWithFilteredResult(_0x41e202,_0x4e2553))['catch'](handleError(_0x41e202,null));};exports[_0xe798('0x40')]=function(_0x542391,_0x29d921){var _0x4f103f={'raw':!![],'where':{'id':_0x542391['params']['id']}},_0x3c4b74={};_0x3c4b74[_0xe798('0x2c')]=_[_0xe798('0x2e')](db[_0xe798('0x3c')]['rawAttributes']);_0x3c4b74[_0xe798('0x2d')]=_[_0xe798('0x2e')](_0x542391[_0xe798('0x2d')]);_0x3c4b74[_0xe798('0x2f')]=_['intersection'](_0x3c4b74[_0xe798('0x2c')],_0x3c4b74[_0xe798('0x2d')]);_0x4f103f[_0xe798('0x31')]=_['intersection'](_0x3c4b74[_0xe798('0x2c')],qs[_0xe798('0x32')](_0x542391[_0xe798('0x2d')][_0xe798('0x32')]));_0x4f103f['attributes']=_0x4f103f['attributes']['length']?_0x4f103f[_0xe798('0x31')]:_0x3c4b74[_0xe798('0x2c')];if(_0x542391[_0xe798('0x2d')]['includeAll']){_0x4f103f['include']=[{'all':!![]}];}_0x4f103f=_[_0xe798('0x39')]({},_0x4f103f,_0x542391[_0xe798('0x3b')]);return db[_0xe798('0x3c')]['find'](_0x4f103f)['then'](handleEntityNotFound(_0x29d921,null))[_0xe798('0x21')](respondWithResult(_0x29d921,null))[_0xe798('0x41')](handleError(_0x29d921,null));};exports[_0xe798('0x42')]=function(_0x2f88da,_0x57d628){return db[_0xe798('0x3c')][_0xe798('0x42')](_0x2f88da[_0xe798('0x43')],{})['then'](respondWithResult(_0x57d628,0xc9))['catch'](handleError(_0x57d628,null));};exports[_0xe798('0x44')]=function(_0x59a73e,_0xe9eddf){if(_0x59a73e[_0xe798('0x43')]['id']){delete _0x59a73e[_0xe798('0x43')]['id'];}return db['SquareReport']['find']({'where':{'id':_0x59a73e['params']['id']}})[_0xe798('0x21')](handleEntityNotFound(_0xe9eddf,null))['then'](saveUpdates(_0x59a73e['body'],null))[_0xe798('0x21')](respondWithResult(_0xe9eddf,null))[_0xe798('0x41')](handleError(_0xe9eddf,null));};exports[_0xe798('0x22')]=function(_0x3f2a60,_0x399ccd){return db['SquareReport'][_0xe798('0x45')]({'where':{'id':_0x3f2a60[_0xe798('0x46')]['id']}})[_0xe798('0x21')](handleEntityNotFound(_0x399ccd,null))['then'](removeEntity(_0x399ccd,null))['catch'](handleError(_0x399ccd,null));};exports[_0xe798('0x47')]=function(_0x555c86,_0x4db322){return db[_0xe798('0x3c')][_0xe798('0x47')]()[_0xe798('0x21')](respondWithResult(_0x4db322,null))['catch'](handleError(_0x4db322,null));};
\ No newline at end of file
+var _0x3b08=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','stack','name','send','SquareReport','fieldName','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','merge','options','where','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5ca0b3,_0x33f5ef){var _0x6ba806=function(_0x58b844){while(--_0x58b844){_0x5ca0b3['push'](_0x5ca0b3['shift']());}};_0x6ba806(++_0x33f5ef);}(_0x3b08,0x8e));var _0x83b0=function(_0x416c7a,_0x588be3){_0x416c7a=_0x416c7a-0x0;var _0x461fae=_0x3b08[_0x416c7a];return _0x461fae;};'use strict';var emlformat=require(_0x83b0('0x0'));var rimraf=require(_0x83b0('0x1'));var zipdir=require(_0x83b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x83b0('0x3'));var moment=require(_0x83b0('0x4'));var BPromise=require(_0x83b0('0x5'));var Mustache=require(_0x83b0('0x6'));var util=require(_0x83b0('0x7'));var path=require(_0x83b0('0x8'));var sox=require(_0x83b0('0x9'));var csv=require(_0x83b0('0xa'));var ejs=require(_0x83b0('0xb'));var fs=require('fs');var fs_extra=require(_0x83b0('0xc'));var _=require(_0x83b0('0xd'));var squel=require(_0x83b0('0xe'));var crypto=require(_0x83b0('0xf'));var jsforce=require(_0x83b0('0x10'));var deskjs=require(_0x83b0('0x11'));var toCsv=require(_0x83b0('0xa'));var querystring=require(_0x83b0('0x12'));var Papa=require(_0x83b0('0x13'));var Redis=require(_0x83b0('0x14'));var authService=require(_0x83b0('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x83b0('0x16'));var hardwareService=require(_0x83b0('0x17'));var logger=require(_0x83b0('0x18'))('api');var utils=require(_0x83b0('0x19'));var config=require(_0x83b0('0x1a'));var licenseUtil=require(_0x83b0('0x1b'));var db=require(_0x83b0('0x1c'))['db'];function respondWithStatusCode(_0x2baae5,_0x54cb52){_0x54cb52=_0x54cb52||0xcc;return function(_0x3b2431){if(_0x3b2431){return _0x2baae5[_0x83b0('0x1d')](_0x54cb52);}return _0x2baae5[_0x83b0('0x1e')](_0x54cb52)[_0x83b0('0x1f')]();};}function respondWithResult(_0x32b096,_0x4a4583){_0x4a4583=_0x4a4583||0xc8;return function(_0xedb021){if(_0xedb021){return _0x32b096[_0x83b0('0x1e')](_0x4a4583)['json'](_0xedb021);}};}function respondWithFilteredResult(_0x49541a,_0xa0b701){return function(_0x1c7658){if(_0x1c7658){var _0x35e64d=typeof _0xa0b701['offset']===_0x83b0('0x20')&&typeof _0xa0b701[_0x83b0('0x21')]==='undefined';var _0x8806ee=_0x1c7658[_0x83b0('0x22')];var _0x3f4eba=_0x35e64d?0x0:_0xa0b701[_0x83b0('0x23')];var _0x1d8416=_0x35e64d?_0x1c7658[_0x83b0('0x22')]:_0xa0b701[_0x83b0('0x23')]+_0xa0b701[_0x83b0('0x21')];var _0x5ea5a7;if(_0x1d8416>=_0x8806ee){_0x1d8416=_0x8806ee;_0x5ea5a7=0xc8;}else{_0x5ea5a7=0xce;}_0x49541a['status'](_0x5ea5a7);return _0x49541a[_0x83b0('0x24')](_0x83b0('0x25'),_0x3f4eba+'-'+_0x1d8416+'/'+_0x8806ee)[_0x83b0('0x26')](_0x1c7658);}return null;};}function patchUpdates(_0xea55e1){return function(_0x4307c7){try{jsonpatch[_0x83b0('0x27')](_0x4307c7,_0xea55e1,!![]);}catch(_0x807f2a){return BPromise['reject'](_0x807f2a);}return _0x4307c7[_0x83b0('0x28')]();};}function saveUpdates(_0x97f60f,_0x40b775){return function(_0x5d1a88){if(_0x5d1a88){return _0x5d1a88[_0x83b0('0x29')](_0x97f60f)[_0x83b0('0x2a')](function(_0x3bb795){return _0x3bb795;});}return null;};}function removeEntity(_0x43a18d,_0x176d13){return function(_0x5ef345){if(_0x5ef345){return _0x5ef345['destroy']()[_0x83b0('0x2a')](function(){_0x43a18d[_0x83b0('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4293,_0xb2fb4c){return function(_0x42ef71){if(!_0x42ef71){_0x2a4293[_0x83b0('0x1d')](0x194);}return _0x42ef71;};}function handleError(_0x358de5,_0x56890a){_0x56890a=_0x56890a||0x1f4;return function(_0x7ec7c4){logger['error'](_0x7ec7c4[_0x83b0('0x2b')]);if(_0x7ec7c4[_0x83b0('0x2c')]){delete _0x7ec7c4[_0x83b0('0x2c')];}_0x358de5['status'](_0x56890a)[_0x83b0('0x2d')](_0x7ec7c4);};}exports['index']=function(_0x59f27c,_0x6bc5f0){var _0x3d5298={},_0x40632c={},_0x2d3c18={'count':0x0,'rows':[]};var _0x15003d=_['map'](db[_0x83b0('0x2e')]['rawAttributes'],function(_0xc984af){return{'name':_0xc984af[_0x83b0('0x2f')],'type':_0xc984af['type']['key']};});_0x40632c[_0x83b0('0x30')]=_[_0x83b0('0x31')](_0x15003d,'name');_0x40632c[_0x83b0('0x32')]=_[_0x83b0('0x33')](_0x59f27c['query']);_0x40632c[_0x83b0('0x34')]=_['intersection'](_0x40632c[_0x83b0('0x30')],_0x40632c['query']);_0x3d5298['attributes']=_[_0x83b0('0x35')](_0x40632c[_0x83b0('0x30')],qs[_0x83b0('0x36')](_0x59f27c['query'][_0x83b0('0x36')]));_0x3d5298[_0x83b0('0x37')]=_0x3d5298[_0x83b0('0x37')][_0x83b0('0x38')]?_0x3d5298[_0x83b0('0x37')]:_0x40632c[_0x83b0('0x30')];if(!_0x59f27c[_0x83b0('0x32')]['hasOwnProperty'](_0x83b0('0x39'))){_0x3d5298[_0x83b0('0x21')]=qs[_0x83b0('0x21')](_0x59f27c[_0x83b0('0x32')]['limit']);_0x3d5298[_0x83b0('0x23')]=qs[_0x83b0('0x23')](_0x59f27c['query'][_0x83b0('0x23')]);}_0x3d5298[_0x83b0('0x3a')]=qs['sort'](_0x59f27c[_0x83b0('0x32')][_0x83b0('0x3b')]);_0x3d5298['where']=qs[_0x83b0('0x34')](_[_0x83b0('0x3c')](_0x59f27c[_0x83b0('0x32')],_0x40632c['filters']),_0x15003d);if(_0x59f27c[_0x83b0('0x32')]['filter']){_0x3d5298['where']=_['merge'](_0x3d5298['where'],{'$or':_[_0x83b0('0x31')](_0x15003d,function(_0x208b69){if(_0x208b69['type']!=='VIRTUAL'){var _0x55059d={};_0x55059d[_0x208b69[_0x83b0('0x2c')]]={'$like':'%'+_0x59f27c[_0x83b0('0x32')][_0x83b0('0x3d')]+'%'};return _0x55059d;}})});}_0x3d5298=_[_0x83b0('0x3e')]({},_0x3d5298,_0x59f27c[_0x83b0('0x3f')]);var _0x1178a8={'where':_0x3d5298[_0x83b0('0x40')]};return db[_0x83b0('0x2e')][_0x83b0('0x22')](_0x1178a8)[_0x83b0('0x2a')](function(_0x15e7d3){_0x2d3c18[_0x83b0('0x22')]=_0x15e7d3;if(_0x59f27c[_0x83b0('0x32')][_0x83b0('0x41')]){_0x3d5298['include']=[{'all':!![]}];}return db[_0x83b0('0x2e')][_0x83b0('0x42')](_0x3d5298);})[_0x83b0('0x2a')](function(_0x3f8c92){_0x2d3c18[_0x83b0('0x43')]=_0x3f8c92;return _0x2d3c18;})[_0x83b0('0x2a')](respondWithFilteredResult(_0x6bc5f0,_0x3d5298))[_0x83b0('0x44')](handleError(_0x6bc5f0,null));};exports[_0x83b0('0x45')]=function(_0x3ac9a6,_0x1b8e7e){var _0xb747da={'raw':!![],'where':{'id':_0x3ac9a6[_0x83b0('0x46')]['id']}},_0x842257={};_0x842257[_0x83b0('0x30')]=_['keys'](db[_0x83b0('0x2e')][_0x83b0('0x47')]);_0x842257[_0x83b0('0x32')]=_[_0x83b0('0x33')](_0x3ac9a6[_0x83b0('0x32')]);_0x842257[_0x83b0('0x34')]=_[_0x83b0('0x35')](_0x842257[_0x83b0('0x30')],_0x842257['query']);_0xb747da[_0x83b0('0x37')]=_[_0x83b0('0x35')](_0x842257['model'],qs['fields'](_0x3ac9a6['query'][_0x83b0('0x36')]));_0xb747da[_0x83b0('0x37')]=_0xb747da[_0x83b0('0x37')]['length']?_0xb747da[_0x83b0('0x37')]:_0x842257[_0x83b0('0x30')];if(_0x3ac9a6['query'][_0x83b0('0x41')]){_0xb747da[_0x83b0('0x48')]=[{'all':!![]}];}_0xb747da=_[_0x83b0('0x3e')]({},_0xb747da,_0x3ac9a6[_0x83b0('0x3f')]);return db[_0x83b0('0x2e')][_0x83b0('0x49')](_0xb747da)[_0x83b0('0x2a')](handleEntityNotFound(_0x1b8e7e,null))[_0x83b0('0x2a')](respondWithResult(_0x1b8e7e,null))[_0x83b0('0x44')](handleError(_0x1b8e7e,null));};exports[_0x83b0('0x4a')]=function(_0x49f4a3,_0x553da4){return db[_0x83b0('0x2e')][_0x83b0('0x4a')](_0x49f4a3[_0x83b0('0x4b')],{})[_0x83b0('0x2a')](respondWithResult(_0x553da4,0xc9))[_0x83b0('0x44')](handleError(_0x553da4,null));};exports[_0x83b0('0x29')]=function(_0x399667,_0x2a3480){if(_0x399667[_0x83b0('0x4b')]['id']){delete _0x399667[_0x83b0('0x4b')]['id'];}return db[_0x83b0('0x2e')]['find']({'where':{'id':_0x399667[_0x83b0('0x46')]['id']}})[_0x83b0('0x2a')](handleEntityNotFound(_0x2a3480,null))[_0x83b0('0x2a')](saveUpdates(_0x399667[_0x83b0('0x4b')],null))[_0x83b0('0x2a')](respondWithResult(_0x2a3480,null))['catch'](handleError(_0x2a3480,null));};exports['destroy']=function(_0x46d769,_0x5a73ba){return db[_0x83b0('0x2e')]['find']({'where':{'id':_0x46d769[_0x83b0('0x46')]['id']}})['then'](handleEntityNotFound(_0x5a73ba,null))[_0x83b0('0x2a')](removeEntity(_0x5a73ba,null))[_0x83b0('0x44')](handleError(_0x5a73ba,null));};exports[_0x83b0('0x4c')]=function(_0x4a8124,_0x34c4c3){return db[_0x83b0('0x2e')][_0x83b0('0x4c')]()['then'](respondWithResult(_0x34c4c3,null))['catch'](handleError(_0x34c4c3,null));};
\ No newline at end of file
index 1b7f1f2..2f4100f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eb3=['SquareReport','report_square','uid_pname','uniqueid','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3eb3,0x105));var _0x33eb=function(_0x32aa29,_0x4bb75e){_0x32aa29=_0x32aa29-0x0;var _0xde4056=_0x3eb3[_0x32aa29];return _0xde4056;};'use strict';var _=require(_0x33eb('0x0'));var util=require(_0x33eb('0x1'));var logger=require(_0x33eb('0x2'))(_0x33eb('0x3'));var moment=require(_0x33eb('0x4'));var BPromise=require(_0x33eb('0x5'));var rp=require(_0x33eb('0x6'));var fs=require('fs');var path=require(_0x33eb('0x7'));var rimraf=require(_0x33eb('0x8'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x33eb('0x9')]=function(_0x4298a9,_0x3db5eb){return _0x4298a9[_0x33eb('0xa')](_0x33eb('0xb'),attributes,{'tableName':_0x33eb('0xc'),'paranoid':![],'indexes':[{'name':_0x33eb('0xd'),'fields':[_0x33eb('0xe'),'project_name']},{'name':'leaveAt','fields':[_0x33eb('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a9a=['uid_pname','uniqueid','project_name','leaveAt','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','SquareReport'];(function(_0x1f7bc9,_0xd2e513){var _0x4c470b=function(_0x35ed26){while(--_0x35ed26){_0x1f7bc9['push'](_0x1f7bc9['shift']());}};_0x4c470b(++_0xd2e513);}(_0x9a9a,0x1c4));var _0xa9a9=function(_0xda3608,_0x383c76){_0xda3608=_0xda3608-0x0;var _0xb65cda=_0x9a9a[_0xda3608];return _0xb65cda;};'use strict';var _=require('lodash');var util=require(_0xa9a9('0x0'));var logger=require(_0xa9a9('0x1'))(_0xa9a9('0x2'));var moment=require('moment');var BPromise=require(_0xa9a9('0x3'));var rp=require(_0xa9a9('0x4'));var fs=require('fs');var path=require(_0xa9a9('0x5'));var rimraf=require(_0xa9a9('0x6'));var config=require('../../config/environment');var attributes=require(_0xa9a9('0x7'));module[_0xa9a9('0x8')]=function(_0x540184,_0x1a5d92){return _0x540184['define'](_0xa9a9('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xa9a9('0xa'),'fields':[_0xa9a9('0xb'),_0xa9a9('0xc')]},{'name':_0xa9a9('0xd'),'fields':[_0xa9a9('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 08829c2..679687d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f01=['../../config/logger','../../config/environment','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateSquareReport','SquareReport','create','body','options','raw','update','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x22e4e8,_0x39a580){var _0x3896db=function(_0x4dd593){while(--_0x4dd593){_0x22e4e8['push'](_0x22e4e8['shift']());}};_0x3896db(++_0x39a580);}(_0x3f01,0x185));var _0x13f0=function(_0x39621b,_0x1533a2){_0x39621b=_0x39621b-0x0;var _0x290c5a=_0x3f01[_0x39621b];return _0x290c5a;};'use strict';var _=require(_0x13f0('0x0'));var util=require(_0x13f0('0x1'));var moment=require(_0x13f0('0x2'));var BPromise=require(_0x13f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13f0('0x4'));var db=require(_0x13f0('0x5'))['db'];var utils=require(_0x13f0('0x6'));var logger=require(_0x13f0('0x7'))('rpc');var config=require(_0x13f0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x13f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x220d78,_0x50d715,_0x308df6){return new BPromise(function(_0x5e2cb6,_0x4cbdf7){return client[_0x13f0('0xa')](_0x220d78,_0x308df6)[_0x13f0('0xb')](function(_0x3e0f02){logger[_0x13f0('0xc')](_0x13f0('0xd'),_0x50d715,_0x13f0('0xe'));logger[_0x13f0('0xf')](_0x13f0('0x10'),_0x50d715,_0x13f0('0xe'),JSON[_0x13f0('0x11')](_0x3e0f02));if(_0x3e0f02['error']){if(_0x3e0f02[_0x13f0('0x12')]['code']===0x1f4){logger[_0x13f0('0x12')](_0x13f0('0xd'),_0x50d715,_0x3e0f02[_0x13f0('0x12')][_0x13f0('0x13')]);return _0x4cbdf7(_0x3e0f02[_0x13f0('0x12')][_0x13f0('0x13')]);}logger['error'](_0x13f0('0xd'),_0x50d715,_0x3e0f02[_0x13f0('0x12')][_0x13f0('0x13')]);return _0x5e2cb6(_0x3e0f02['error'][_0x13f0('0x13')]);}else{logger[_0x13f0('0xc')](_0x13f0('0xd'),_0x50d715,'request\x20sent');_0x5e2cb6(_0x3e0f02[_0x13f0('0x14')]['message']);}})[_0x13f0('0x15')](function(_0x31aa84){logger['error']('SquareReport,\x20%s,\x20%s',_0x50d715,_0x31aa84);_0x4cbdf7(_0x31aa84);});});}exports[_0x13f0('0x16')]=function(_0x324893){var _0x4c8a56=this;return new Promise(function(_0x68c8c3,_0x10cca0){return db[_0x13f0('0x17')][_0x13f0('0x18')](_0x324893[_0x13f0('0x19')],{'raw':_0x324893[_0x13f0('0x1a')]?_0x324893['options'][_0x13f0('0x1b')]===undefined?!![]:![]:!![]})[_0x13f0('0xb')](function(_0xe0b01e){logger[_0x13f0('0xc')](_0x13f0('0x16'),_0x324893);logger['debug'](_0x13f0('0x16'),_0x324893,JSON[_0x13f0('0x11')](_0xe0b01e));_0x68c8c3(_0xe0b01e);})[_0x13f0('0x15')](function(_0x5d855f){logger[_0x13f0('0x12')](_0x13f0('0x16'),_0x5d855f[_0x13f0('0x13')],_0x324893);_0x10cca0(_0x4c8a56[_0x13f0('0x12')](0x1f4,_0x5d855f[_0x13f0('0x13')]));});});};exports['UpdateSquareReport']=function(_0x26446e){var _0x33bf5f=this;return new Promise(function(_0x2b7c7a,_0x174aa1){return db['SquareReport'][_0x13f0('0x1c')](_0x26446e[_0x13f0('0x19')],{'raw':_0x26446e[_0x13f0('0x1a')]?_0x26446e[_0x13f0('0x1a')][_0x13f0('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26446e[_0x13f0('0x1a')]?_0x26446e[_0x13f0('0x1a')][_0x13f0('0x1d')]||null:null,'attributes':_0x26446e[_0x13f0('0x1a')]?_0x26446e[_0x13f0('0x1a')][_0x13f0('0x1e')]||null:null,'limit':_0x26446e[_0x13f0('0x1a')]?_0x26446e[_0x13f0('0x1a')][_0x13f0('0x1f')]||null:null})[_0x13f0('0xb')](function(_0x117333){logger[_0x13f0('0xc')](_0x13f0('0x20'),_0x26446e);logger[_0x13f0('0xf')](_0x13f0('0x20'),_0x26446e,JSON[_0x13f0('0x11')](_0x117333));_0x2b7c7a(_0x117333);})[_0x13f0('0x15')](function(_0x1f118a){logger['error'](_0x13f0('0x20'),_0x1f118a['message'],_0x26446e);_0x174aa1(_0x33bf5f['error'](0x1f4,_0x1f118a[_0x13f0('0x13')]));});});};
\ No newline at end of file
+var _0x5515=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','message','result','CreateSquareReport','SquareReport','create','options','raw','catch','UpdateSquareReport','update','attributes','limit','then','stringify','lodash'];(function(_0x11430b,_0x1ea8c8){var _0x4e9bbc=function(_0x4b11c4){while(--_0x4b11c4){_0x11430b['push'](_0x11430b['shift']());}};_0x4e9bbc(++_0x1ea8c8);}(_0x5515,0x15b));var _0x5551=function(_0x54c56d,_0x44db2d){_0x54c56d=_0x54c56d-0x0;var _0x374680=_0x5515[_0x54c56d];return _0x374680;};'use strict';var _=require(_0x5551('0x0'));var util=require(_0x5551('0x1'));var moment=require(_0x5551('0x2'));var BPromise=require('bluebird');var rs=require(_0x5551('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5551('0x4'))['db'];var utils=require(_0x5551('0x5'));var logger=require(_0x5551('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5551('0x7'));var client=jayson[_0x5551('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x364e0d,_0x3ec194,_0x450f91){return new BPromise(function(_0x1cf4a1,_0x52ca3f){return client['request'](_0x364e0d,_0x450f91)['then'](function(_0x112955){logger[_0x5551('0x9')](_0x5551('0xa'),_0x3ec194,_0x5551('0xb'));logger[_0x5551('0xc')](_0x5551('0xd'),_0x3ec194,'request\x20sent',JSON['stringify'](_0x112955));if(_0x112955[_0x5551('0xe')]){if(_0x112955[_0x5551('0xe')]['code']===0x1f4){logger[_0x5551('0xe')](_0x5551('0xa'),_0x3ec194,_0x112955[_0x5551('0xe')][_0x5551('0xf')]);return _0x52ca3f(_0x112955[_0x5551('0xe')][_0x5551('0xf')]);}logger[_0x5551('0xe')](_0x5551('0xa'),_0x3ec194,_0x112955[_0x5551('0xe')][_0x5551('0xf')]);return _0x1cf4a1(_0x112955['error'][_0x5551('0xf')]);}else{logger[_0x5551('0x9')](_0x5551('0xa'),_0x3ec194,_0x5551('0xb'));_0x1cf4a1(_0x112955[_0x5551('0x10')]['message']);}})['catch'](function(_0x35b8ba){logger['error'](_0x5551('0xa'),_0x3ec194,_0x35b8ba);_0x52ca3f(_0x35b8ba);});});}exports[_0x5551('0x11')]=function(_0x18b38d){var _0x4ea082=this;return new Promise(function(_0x533102,_0x37b5e3){return db[_0x5551('0x12')][_0x5551('0x13')](_0x18b38d['body'],{'raw':_0x18b38d['options']?_0x18b38d[_0x5551('0x14')][_0x5551('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x59ce7f){logger[_0x5551('0x9')](_0x5551('0x11'),_0x18b38d);logger['debug']('CreateSquareReport',_0x18b38d,JSON['stringify'](_0x59ce7f));_0x533102(_0x59ce7f);})[_0x5551('0x16')](function(_0x2cde0b){logger[_0x5551('0xe')](_0x5551('0x11'),_0x2cde0b[_0x5551('0xf')],_0x18b38d);_0x37b5e3(_0x4ea082[_0x5551('0xe')](0x1f4,_0x2cde0b[_0x5551('0xf')]));});});};exports[_0x5551('0x17')]=function(_0x12ee85){var _0x2c4565=this;return new Promise(function(_0x1a9e78,_0xaf385c){return db[_0x5551('0x12')][_0x5551('0x18')](_0x12ee85['body'],{'raw':_0x12ee85['options']?_0x12ee85[_0x5551('0x14')][_0x5551('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12ee85[_0x5551('0x14')]?_0x12ee85[_0x5551('0x14')]['where']||null:null,'attributes':_0x12ee85[_0x5551('0x14')]?_0x12ee85['options'][_0x5551('0x19')]||null:null,'limit':_0x12ee85[_0x5551('0x14')]?_0x12ee85['options'][_0x5551('0x1a')]||null:null})[_0x5551('0x1b')](function(_0x26cf8a){logger['info'](_0x5551('0x17'),_0x12ee85);logger[_0x5551('0xc')](_0x5551('0x17'),_0x12ee85,JSON[_0x5551('0x1c')](_0x26cf8a));_0x1a9e78(_0x26cf8a);})[_0x5551('0x16')](function(_0x29ff41){logger[_0x5551('0xe')](_0x5551('0x17'),_0x29ff41[_0x5551('0xf')],_0x12ee85);_0xaf385c(_0x2c4565[_0x5551('0xe')](0x1f4,_0x29ff41[_0x5551('0xf')]));});});};
\ No newline at end of file
index 87ce0c3..bad3391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaea=['../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','show','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x152ea8,_0x3fb53f){var _0x4c0ebe=function(_0x1c2641){while(--_0x1c2641){_0x152ea8['push'](_0x152ea8['shift']());}};_0x4c0ebe(++_0x3fb53f);}(_0xfaea,0xcc));var _0xafae=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0xfaea[_0x55e1d1];return _0x1165db;};'use strict';var multer=require(_0xafae('0x0'));var util=require(_0xafae('0x1'));var path=require(_0xafae('0x2'));var timeout=require(_0xafae('0x3'));var express=require('express');var router=express[_0xafae('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xafae('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xafae('0x6'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xafae('0x7')](),controller[_0xafae('0x8')]);router['get'](_0xafae('0x9'),auth[_0xafae('0x7')](),controller[_0xafae('0xa')]);router[_0xafae('0xb')]('/:id',auth[_0xafae('0x7')](),controller[_0xafae('0xc')]);router[_0xafae('0xd')]('/',auth[_0xafae('0x7')](),controller['create']);router[_0xafae('0xe')](_0xafae('0xf'),auth[_0xafae('0x7')](),controller['update']);router[_0xafae('0x10')](_0xafae('0xf'),auth[_0xafae('0x7')](),controller[_0xafae('0x11')]);module[_0xafae('0x12')]=router;
\ No newline at end of file
+var _0xd7b1=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','describe','create','put'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0xd7b1,0x1a8));var _0x1d7b=function(_0x2d84db,_0x5e1ad6){_0x2d84db=_0x2d84db-0x0;var _0x1bb5af=_0xd7b1[_0x2d84db];return _0x1bb5af;};'use strict';var multer=require(_0x1d7b('0x0'));var util=require(_0x1d7b('0x1'));var path=require(_0x1d7b('0x2'));var timeout=require(_0x1d7b('0x3'));var express=require(_0x1d7b('0x4'));var router=express[_0x1d7b('0x5')]();var fs_extra=require(_0x1d7b('0x6'));var auth=require(_0x1d7b('0x7'));var interaction=require(_0x1d7b('0x8'));var config=require(_0x1d7b('0x9'));var controller=require(_0x1d7b('0xa'));router['get']('/',auth[_0x1d7b('0xb')](),controller[_0x1d7b('0xc')]);router['get']('/describe',auth[_0x1d7b('0xb')](),controller[_0x1d7b('0xd')]);router['get']('/:id',auth[_0x1d7b('0xb')](),controller['show']);router['post']('/',auth[_0x1d7b('0xb')](),controller[_0x1d7b('0xe')]);router[_0x1d7b('0xf')](_0x1d7b('0x10'),auth[_0x1d7b('0xb')](),controller[_0x1d7b('0x11')]);router['delete'](_0x1d7b('0x10'),auth[_0x1d7b('0xb')](),controller[_0x1d7b('0x12')]);module[_0x1d7b('0x13')]=router;
\ No newline at end of file
index f43a2b4..6fe1978 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf31f=['TEXT','exports','STRING'];(function(_0x3b5d45,_0x597509){var _0x3cbc78=function(_0x667d99){while(--_0x667d99){_0x3b5d45['push'](_0x3b5d45['shift']());}};_0x3cbc78(++_0x597509);}(_0xf31f,0x6a));var _0xff31=function(_0x31878f,_0x5ec28a){_0x31878f=_0x31878f-0x0;var _0x401817=_0xf31f[_0x31878f];return _0x401817;};'use strict';var Sequelize=require('sequelize');module[_0xff31('0x0')]={'uniqueid':{'type':Sequelize[_0xff31('0x1')]},'node':{'type':Sequelize[_0xff31('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xff31('0x2')]},'project_name':{'type':Sequelize[_0xff31('0x1')]},'callerid':{'type':Sequelize[_0xff31('0x1')]}};
\ No newline at end of file
+var _0x5b96=['STRING','TEXT','sequelize'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x5b96,0xbc));var _0x65b9=function(_0xd1a252,_0x16396f){_0xd1a252=_0xd1a252-0x0;var _0x560ee1=_0x5b96[_0xd1a252];return _0x560ee1;};'use strict';var Sequelize=require(_0x65b9('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x65b9('0x1')]},'node':{'type':Sequelize[_0x65b9('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x65b9('0x2')]},'project_name':{'type':Sequelize[_0x65b9('0x1')]},'callerid':{'type':Sequelize[_0x65b9('0x1')]}};
\ No newline at end of file
index 6fa9274..e29bc23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a0=['name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareDetailsReport','includeAll','findAll','rows','catch','show','params','include','create','body','update','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','then','destroy','error','stack'];(function(_0x49511f,_0x357bbe){var _0x12bf17=function(_0x6b120a){while(--_0x6b120a){_0x49511f['push'](_0x49511f['shift']());}};_0x12bf17(++_0x357bbe);}(_0x73a0,0x1f4));var _0x073a=function(_0x4a7ea7,_0x30e751){_0x4a7ea7=_0x4a7ea7-0x0;var _0x4f4278=_0x73a0[_0x4a7ea7];return _0x4f4278;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x073a('0x0'));var zipdir=require(_0x073a('0x1'));var jsonpatch=require(_0x073a('0x2'));var rp=require(_0x073a('0x3'));var moment=require(_0x073a('0x4'));var BPromise=require(_0x073a('0x5'));var Mustache=require(_0x073a('0x6'));var util=require(_0x073a('0x7'));var path=require(_0x073a('0x8'));var sox=require(_0x073a('0x9'));var csv=require(_0x073a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x073a('0xb'));var squel=require(_0x073a('0xc'));var crypto=require(_0x073a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x073a('0xa'));var querystring=require(_0x073a('0xe'));var Papa=require(_0x073a('0xf'));var Redis=require(_0x073a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x073a('0x11'));var as=require(_0x073a('0x12'));var hardwareService=require(_0x073a('0x13'));var logger=require(_0x073a('0x14'))(_0x073a('0x15'));var utils=require(_0x073a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x073a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a331c,_0x3d7f62){_0x3d7f62=_0x3d7f62||0xcc;return function(_0x1d4df2){if(_0x1d4df2){return _0x5a331c[_0x073a('0x18')](_0x3d7f62);}return _0x5a331c[_0x073a('0x19')](_0x3d7f62)[_0x073a('0x1a')]();};}function respondWithResult(_0xb5b2e3,_0x469890){_0x469890=_0x469890||0xc8;return function(_0x3fb679){if(_0x3fb679){return _0xb5b2e3[_0x073a('0x19')](_0x469890)[_0x073a('0x1b')](_0x3fb679);}};}function respondWithFilteredResult(_0xf5ef2c,_0x434526){return function(_0x318142){if(_0x318142){var _0x902084=typeof _0x434526['offset']==='undefined'&&typeof _0x434526[_0x073a('0x1c')]===_0x073a('0x1d');var _0x425f0e=_0x318142[_0x073a('0x1e')];var _0x2f7a7a=_0x902084?0x0:_0x434526['offset'];var _0x59c1bf=_0x902084?_0x318142[_0x073a('0x1e')]:_0x434526[_0x073a('0x1f')]+_0x434526[_0x073a('0x1c')];var _0x1bbffd;if(_0x59c1bf>=_0x425f0e){_0x59c1bf=_0x425f0e;_0x1bbffd=0xc8;}else{_0x1bbffd=0xce;}_0xf5ef2c['status'](_0x1bbffd);return _0xf5ef2c['set'](_0x073a('0x20'),_0x2f7a7a+'-'+_0x59c1bf+'/'+_0x425f0e)[_0x073a('0x1b')](_0x318142);}return null;};}function patchUpdates(_0x38b312){return function(_0x3c850c){try{jsonpatch[_0x073a('0x21')](_0x3c850c,_0x38b312,!![]);}catch(_0x993a15){return BPromise[_0x073a('0x22')](_0x993a15);}return _0x3c850c['save']();};}function saveUpdates(_0x4bec04,_0x4c74c0){return function(_0x437c20){if(_0x437c20){return _0x437c20['update'](_0x4bec04)[_0x073a('0x23')](function(_0x4a3dce){return _0x4a3dce;});}return null;};}function removeEntity(_0x546072,_0x1d12a8){return function(_0x2eb3dd){if(_0x2eb3dd){return _0x2eb3dd[_0x073a('0x24')]()[_0x073a('0x23')](function(){_0x546072['status'](0xcc)[_0x073a('0x1a')]();});}};}function handleEntityNotFound(_0x175552,_0x50d792){return function(_0x702543){if(!_0x702543){_0x175552[_0x073a('0x18')](0x194);}return _0x702543;};}function handleError(_0x11864b,_0x4bf97c){_0x4bf97c=_0x4bf97c||0x1f4;return function(_0x183815){logger[_0x073a('0x25')](_0x183815[_0x073a('0x26')]);if(_0x183815[_0x073a('0x27')]){delete _0x183815[_0x073a('0x27')];}_0x11864b[_0x073a('0x19')](_0x4bf97c)[_0x073a('0x28')](_0x183815);};}exports[_0x073a('0x29')]=function(_0x3b4193,_0x1efa90){var _0x1a06bc={},_0x2ffeb6={},_0x16892d={'count':0x0,'rows':[]};var _0x445215=_[_0x073a('0x2a')](db['SquareDetailsReport'][_0x073a('0x2b')],function(_0xeb4b1b){return{'name':_0xeb4b1b[_0x073a('0x2c')],'type':_0xeb4b1b['type'][_0x073a('0x2d')]};});_0x2ffeb6[_0x073a('0x2e')]=_[_0x073a('0x2a')](_0x445215,_0x073a('0x27'));_0x2ffeb6[_0x073a('0x2f')]=_[_0x073a('0x30')](_0x3b4193[_0x073a('0x2f')]);_0x2ffeb6[_0x073a('0x31')]=_[_0x073a('0x32')](_0x2ffeb6['model'],_0x2ffeb6['query']);_0x1a06bc[_0x073a('0x33')]=_[_0x073a('0x32')](_0x2ffeb6[_0x073a('0x2e')],qs[_0x073a('0x34')](_0x3b4193[_0x073a('0x2f')][_0x073a('0x34')]));_0x1a06bc[_0x073a('0x33')]=_0x1a06bc[_0x073a('0x33')][_0x073a('0x35')]?_0x1a06bc[_0x073a('0x33')]:_0x2ffeb6[_0x073a('0x2e')];if(!_0x3b4193['query'][_0x073a('0x36')](_0x073a('0x37'))){_0x1a06bc['limit']=qs[_0x073a('0x1c')](_0x3b4193['query'][_0x073a('0x1c')]);_0x1a06bc[_0x073a('0x1f')]=qs[_0x073a('0x1f')](_0x3b4193[_0x073a('0x2f')]['offset']);}_0x1a06bc[_0x073a('0x38')]=qs[_0x073a('0x39')](_0x3b4193[_0x073a('0x2f')]['sort']);_0x1a06bc[_0x073a('0x3a')]=qs[_0x073a('0x31')](_[_0x073a('0x3b')](_0x3b4193[_0x073a('0x2f')],_0x2ffeb6['filters']),_0x445215);if(_0x3b4193[_0x073a('0x2f')][_0x073a('0x3c')]){_0x1a06bc[_0x073a('0x3a')]=_[_0x073a('0x3d')](_0x1a06bc[_0x073a('0x3a')],{'$or':_[_0x073a('0x2a')](_0x445215,function(_0x272fd4){if(_0x272fd4[_0x073a('0x3e')]!==_0x073a('0x3f')){var _0x3b1fca={};_0x3b1fca[_0x272fd4[_0x073a('0x27')]]={'$like':'%'+_0x3b4193['query']['filter']+'%'};return _0x3b1fca;}})});}_0x1a06bc=_[_0x073a('0x3d')]({},_0x1a06bc,_0x3b4193[_0x073a('0x40')]);var _0x4f001c={'where':_0x1a06bc[_0x073a('0x3a')]};return db[_0x073a('0x41')][_0x073a('0x1e')](_0x4f001c)['then'](function(_0x545666){_0x16892d[_0x073a('0x1e')]=_0x545666;if(_0x3b4193['query'][_0x073a('0x42')]){_0x1a06bc['include']=[{'all':!![]}];}return db[_0x073a('0x41')][_0x073a('0x43')](_0x1a06bc);})[_0x073a('0x23')](function(_0x4620e5){_0x16892d[_0x073a('0x44')]=_0x4620e5;return _0x16892d;})[_0x073a('0x23')](respondWithFilteredResult(_0x1efa90,_0x1a06bc))[_0x073a('0x45')](handleError(_0x1efa90,null));};exports[_0x073a('0x46')]=function(_0x1a0654,_0x53d9be){var _0x194581={'raw':!![],'where':{'id':_0x1a0654[_0x073a('0x47')]['id']}},_0x578ccc={};_0x578ccc[_0x073a('0x2e')]=_[_0x073a('0x30')](db[_0x073a('0x41')][_0x073a('0x2b')]);_0x578ccc[_0x073a('0x2f')]=_[_0x073a('0x30')](_0x1a0654[_0x073a('0x2f')]);_0x578ccc[_0x073a('0x31')]=_[_0x073a('0x32')](_0x578ccc[_0x073a('0x2e')],_0x578ccc[_0x073a('0x2f')]);_0x194581[_0x073a('0x33')]=_[_0x073a('0x32')](_0x578ccc[_0x073a('0x2e')],qs['fields'](_0x1a0654['query']['fields']));_0x194581[_0x073a('0x33')]=_0x194581[_0x073a('0x33')][_0x073a('0x35')]?_0x194581['attributes']:_0x578ccc[_0x073a('0x2e')];if(_0x1a0654[_0x073a('0x2f')][_0x073a('0x42')]){_0x194581[_0x073a('0x48')]=[{'all':!![]}];}_0x194581=_[_0x073a('0x3d')]({},_0x194581,_0x1a0654['options']);return db[_0x073a('0x41')]['find'](_0x194581)[_0x073a('0x23')](handleEntityNotFound(_0x53d9be,null))[_0x073a('0x23')](respondWithResult(_0x53d9be,null))[_0x073a('0x45')](handleError(_0x53d9be,null));};exports[_0x073a('0x49')]=function(_0x1c719f,_0x382639){return db[_0x073a('0x41')]['create'](_0x1c719f[_0x073a('0x4a')],{})['then'](respondWithResult(_0x382639,0xc9))[_0x073a('0x45')](handleError(_0x382639,null));};exports[_0x073a('0x4b')]=function(_0x2db311,_0x5d242b){if(_0x2db311[_0x073a('0x4a')]['id']){delete _0x2db311[_0x073a('0x4a')]['id'];}return db[_0x073a('0x41')][_0x073a('0x4c')]({'where':{'id':_0x2db311[_0x073a('0x47')]['id']}})[_0x073a('0x23')](handleEntityNotFound(_0x5d242b,null))['then'](saveUpdates(_0x2db311[_0x073a('0x4a')],null))['then'](respondWithResult(_0x5d242b,null))[_0x073a('0x45')](handleError(_0x5d242b,null));};exports[_0x073a('0x24')]=function(_0x476800,_0x3a7427){return db[_0x073a('0x41')][_0x073a('0x4c')]({'where':{'id':_0x476800[_0x073a('0x47')]['id']}})[_0x073a('0x23')](handleEntityNotFound(_0x3a7427,null))[_0x073a('0x23')](removeEntity(_0x3a7427,null))['catch'](handleError(_0x3a7427,null));};exports['describe']=function(_0x19321d,_0x5baf80){return db['SquareDetailsReport']['describe']()[_0x073a('0x23')](respondWithResult(_0x5baf80,null))[_0x073a('0x45')](handleError(_0x5baf80,null));};
\ No newline at end of file
+var _0x41bb=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','SquareDetailsReport','findAll','rows','show','params','includeAll','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x5d1d83,_0x321c02){var _0xb5a581=function(_0x547573){while(--_0x547573){_0x5d1d83['push'](_0x5d1d83['shift']());}};_0xb5a581(++_0x321c02);}(_0x41bb,0xc5));var _0xb41b=function(_0x2af627,_0x33d47f){_0x2af627=_0x2af627-0x0;var _0x14eda9=_0x41bb[_0x2af627];return _0x14eda9;};'use strict';var emlformat=require(_0xb41b('0x0'));var rimraf=require(_0xb41b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb41b('0x2'));var rp=require('request-promise');var moment=require(_0xb41b('0x3'));var BPromise=require(_0xb41b('0x4'));var Mustache=require(_0xb41b('0x5'));var util=require(_0xb41b('0x6'));var path=require('path');var sox=require(_0xb41b('0x7'));var csv=require(_0xb41b('0x8'));var ejs=require(_0xb41b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb41b('0xa'));var jsforce=require(_0xb41b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb41b('0x8'));var querystring=require(_0xb41b('0xc'));var Papa=require(_0xb41b('0xd'));var Redis=require(_0xb41b('0xe'));var authService=require(_0xb41b('0xf'));var qs=require(_0xb41b('0x10'));var as=require(_0xb41b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb41b('0x12'))('api');var utils=require(_0xb41b('0x13'));var config=require(_0xb41b('0x14'));var licenseUtil=require(_0xb41b('0x15'));var db=require(_0xb41b('0x16'))['db'];function respondWithStatusCode(_0x2066d5,_0x5f1ea4){_0x5f1ea4=_0x5f1ea4||0xcc;return function(_0x353ba3){if(_0x353ba3){return _0x2066d5[_0xb41b('0x17')](_0x5f1ea4);}return _0x2066d5[_0xb41b('0x18')](_0x5f1ea4)[_0xb41b('0x19')]();};}function respondWithResult(_0x3be1ec,_0x4e8603){_0x4e8603=_0x4e8603||0xc8;return function(_0x4e7f11){if(_0x4e7f11){return _0x3be1ec['status'](_0x4e8603)[_0xb41b('0x1a')](_0x4e7f11);}};}function respondWithFilteredResult(_0xdc5fb0,_0x143a81){return function(_0x338920){if(_0x338920){var _0x29ea51=typeof _0x143a81['offset']===_0xb41b('0x1b')&&typeof _0x143a81[_0xb41b('0x1c')]===_0xb41b('0x1b');var _0xcf0728=_0x338920[_0xb41b('0x1d')];var _0x47154d=_0x29ea51?0x0:_0x143a81[_0xb41b('0x1e')];var _0x5df8c2=_0x29ea51?_0x338920['count']:_0x143a81['offset']+_0x143a81[_0xb41b('0x1c')];var _0x503e86;if(_0x5df8c2>=_0xcf0728){_0x5df8c2=_0xcf0728;_0x503e86=0xc8;}else{_0x503e86=0xce;}_0xdc5fb0[_0xb41b('0x18')](_0x503e86);return _0xdc5fb0[_0xb41b('0x1f')](_0xb41b('0x20'),_0x47154d+'-'+_0x5df8c2+'/'+_0xcf0728)['json'](_0x338920);}return null;};}function patchUpdates(_0x53bc44){return function(_0x1a1386){try{jsonpatch[_0xb41b('0x21')](_0x1a1386,_0x53bc44,!![]);}catch(_0xd1bc61){return BPromise[_0xb41b('0x22')](_0xd1bc61);}return _0x1a1386[_0xb41b('0x23')]();};}function saveUpdates(_0x42dccb,_0x4c73da){return function(_0x58f149){if(_0x58f149){return _0x58f149[_0xb41b('0x24')](_0x42dccb)[_0xb41b('0x25')](function(_0x871b35){return _0x871b35;});}return null;};}function removeEntity(_0x583741,_0x14e9c8){return function(_0x2441d6){if(_0x2441d6){return _0x2441d6['destroy']()[_0xb41b('0x25')](function(){_0x583741[_0xb41b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed3c7e,_0x4a7992){return function(_0x2d0f27){if(!_0x2d0f27){_0xed3c7e[_0xb41b('0x17')](0x194);}return _0x2d0f27;};}function handleError(_0x53e3a2,_0x3af2c){_0x3af2c=_0x3af2c||0x1f4;return function(_0x4265b8){logger['error'](_0x4265b8['stack']);if(_0x4265b8[_0xb41b('0x26')]){delete _0x4265b8[_0xb41b('0x26')];}_0x53e3a2[_0xb41b('0x18')](_0x3af2c)[_0xb41b('0x27')](_0x4265b8);};}exports[_0xb41b('0x28')]=function(_0x181cbd,_0x253efb){var _0x545395={},_0x26ef96={},_0xb68029={'count':0x0,'rows':[]};var _0x5069aa=_[_0xb41b('0x29')](db['SquareDetailsReport'][_0xb41b('0x2a')],function(_0x31d4cd){return{'name':_0x31d4cd['fieldName'],'type':_0x31d4cd[_0xb41b('0x2b')]['key']};});_0x26ef96[_0xb41b('0x2c')]=_[_0xb41b('0x29')](_0x5069aa,'name');_0x26ef96[_0xb41b('0x2d')]=_[_0xb41b('0x2e')](_0x181cbd[_0xb41b('0x2d')]);_0x26ef96[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],_0x26ef96[_0xb41b('0x2d')]);_0x545395[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x26ef96[_0xb41b('0x2c')],qs['fields'](_0x181cbd[_0xb41b('0x2d')]['fields']));_0x545395['attributes']=_0x545395[_0xb41b('0x31')][_0xb41b('0x32')]?_0x545395[_0xb41b('0x31')]:_0x26ef96[_0xb41b('0x2c')];if(!_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x33')](_0xb41b('0x34'))){_0x545395[_0xb41b('0x1c')]=qs[_0xb41b('0x1c')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1c')]);_0x545395['offset']=qs[_0xb41b('0x1e')](_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x1e')]);}_0x545395[_0xb41b('0x35')]=qs[_0xb41b('0x36')](_0x181cbd[_0xb41b('0x2d')]['sort']);_0x545395['where']=qs[_0xb41b('0x2f')](_[_0xb41b('0x37')](_0x181cbd['query'],_0x26ef96[_0xb41b('0x2f')]),_0x5069aa);if(_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]){_0x545395[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x545395['where'],{'$or':_[_0xb41b('0x29')](_0x5069aa,function(_0x5775d3){if(_0x5775d3[_0xb41b('0x2b')]!==_0xb41b('0x3b')){var _0x799d6={};_0x799d6[_0x5775d3[_0xb41b('0x26')]]={'$like':'%'+_0x181cbd[_0xb41b('0x2d')][_0xb41b('0x38')]+'%'};return _0x799d6;}})});}_0x545395=_[_0xb41b('0x3a')]({},_0x545395,_0x181cbd[_0xb41b('0x3c')]);var _0x2b0721={'where':_0x545395['where']};return db['SquareDetailsReport']['count'](_0x2b0721)[_0xb41b('0x25')](function(_0x5147ce){_0xb68029['count']=_0x5147ce;if(_0x181cbd[_0xb41b('0x2d')]['includeAll']){_0x545395[_0xb41b('0x3d')]=[{'all':!![]}];}return db[_0xb41b('0x3e')][_0xb41b('0x3f')](_0x545395);})[_0xb41b('0x25')](function(_0x4fa390){_0xb68029[_0xb41b('0x40')]=_0x4fa390;return _0xb68029;})[_0xb41b('0x25')](respondWithFilteredResult(_0x253efb,_0x545395))['catch'](handleError(_0x253efb,null));};exports[_0xb41b('0x41')]=function(_0xa70324,_0x3f181c){var _0x174d6c={'raw':!![],'where':{'id':_0xa70324[_0xb41b('0x42')]['id']}},_0x47bab5={};_0x47bab5['model']=_[_0xb41b('0x2e')](db[_0xb41b('0x3e')][_0xb41b('0x2a')]);_0x47bab5['query']=_['keys'](_0xa70324[_0xb41b('0x2d')]);_0x47bab5[_0xb41b('0x2f')]=_[_0xb41b('0x30')](_0x47bab5[_0xb41b('0x2c')],_0x47bab5[_0xb41b('0x2d')]);_0x174d6c[_0xb41b('0x31')]=_[_0xb41b('0x30')](_0x47bab5['model'],qs['fields'](_0xa70324[_0xb41b('0x2d')]['fields']));_0x174d6c[_0xb41b('0x31')]=_0x174d6c['attributes'][_0xb41b('0x32')]?_0x174d6c['attributes']:_0x47bab5[_0xb41b('0x2c')];if(_0xa70324['query'][_0xb41b('0x43')]){_0x174d6c[_0xb41b('0x3d')]=[{'all':!![]}];}_0x174d6c=_[_0xb41b('0x3a')]({},_0x174d6c,_0xa70324[_0xb41b('0x3c')]);return db['SquareDetailsReport'][_0xb41b('0x44')](_0x174d6c)[_0xb41b('0x25')](handleEntityNotFound(_0x3f181c,null))['then'](respondWithResult(_0x3f181c,null))[_0xb41b('0x45')](handleError(_0x3f181c,null));};exports['create']=function(_0x5cc658,_0x5733d0){return db['SquareDetailsReport'][_0xb41b('0x46')](_0x5cc658[_0xb41b('0x47')],{})[_0xb41b('0x25')](respondWithResult(_0x5733d0,0xc9))[_0xb41b('0x45')](handleError(_0x5733d0,null));};exports[_0xb41b('0x24')]=function(_0x349a6c,_0x34d076){if(_0x349a6c[_0xb41b('0x47')]['id']){delete _0x349a6c[_0xb41b('0x47')]['id'];}return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x349a6c[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x34d076,null))[_0xb41b('0x25')](saveUpdates(_0x349a6c[_0xb41b('0x47')],null))[_0xb41b('0x25')](respondWithResult(_0x34d076,null))['catch'](handleError(_0x34d076,null));};exports[_0xb41b('0x48')]=function(_0x5e041d,_0x4a7aa3){return db[_0xb41b('0x3e')][_0xb41b('0x44')]({'where':{'id':_0x5e041d[_0xb41b('0x42')]['id']}})[_0xb41b('0x25')](handleEntityNotFound(_0x4a7aa3,null))[_0xb41b('0x25')](removeEntity(_0x4a7aa3,null))[_0xb41b('0x45')](handleError(_0x4a7aa3,null));};exports[_0xb41b('0x49')]=function(_0x23d6c6,_0x2befc7){return db[_0xb41b('0x3e')][_0xb41b('0x49')]()[_0xb41b('0x25')](respondWithResult(_0x2befc7,null))[_0xb41b('0x45')](handleError(_0x2befc7,null));};
\ No newline at end of file
index 503bfd1..02f6d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x373e=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','../../config/logger','moment','path'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x373e,0x19d));var _0xe373=function(_0x406417,_0xccd2e){_0x406417=_0x406417-0x0;var _0x50f070=_0x373e[_0x406417];return _0x50f070;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe373('0x0'))('api');var moment=require(_0xe373('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe373('0x2'));var rimraf=require(_0xe373('0x3'));var config=require(_0xe373('0x4'));var attributes=require(_0xe373('0x5'));module[_0xe373('0x6')]=function(_0x3ce8fa,_0x1b84f9){return _0x3ce8fa['define'](_0xe373('0x7'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ca9=['rimraf','exports','report_square_details','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ca9,0x1a1));var _0x98ca=function(_0x5b246b,_0x2aa807){_0x5b246b=_0x5b246b-0x0;var _0x2bb22a=_0x8ca9[_0x5b246b];return _0x2bb22a;};'use strict';var _=require(_0x98ca('0x0'));var util=require('util');var logger=require(_0x98ca('0x1'))(_0x98ca('0x2'));var moment=require('moment');var BPromise=require(_0x98ca('0x3'));var rp=require(_0x98ca('0x4'));var fs=require('fs');var path=require(_0x98ca('0x5'));var rimraf=require(_0x98ca('0x6'));var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x98ca('0x7')]=function(_0x51c890,_0x2e5f12){return _0x51c890['define']('SquareDetailsReport',attributes,{'tableName':_0x98ca('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 930927d..a6bf449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb62e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','then','lodash','util'];(function(_0x39ad4f,_0x1e941b){var _0x2dc7ff=function(_0x4420f2){while(--_0x4420f2){_0x39ad4f['push'](_0x39ad4f['shift']());}};_0x2dc7ff(++_0x1e941b);}(_0xb62e,0x1de));var _0xeb62=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb62e[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31f5ea,_0x5e0dc4,_0x2065a0){return new BPromise(function(_0xab7049,_0x1e10ae){return client[_0xeb62('0xc')](_0x31f5ea,_0x2065a0)['then'](function(_0x5cdef3){logger[_0xeb62('0xd')](_0xeb62('0xe'),_0x5e0dc4,_0xeb62('0xf'));logger[_0xeb62('0x10')](_0xeb62('0x11'),_0x5e0dc4,_0xeb62('0xf'),JSON[_0xeb62('0x12')](_0x5cdef3));if(_0x5cdef3[_0xeb62('0x13')]){if(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x14')]===0x1f4){logger['error'](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);return _0x1e10ae(_0x5cdef3[_0xeb62('0x13')]['message']);}logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x5cdef3[_0xeb62('0x13')]['message']);return _0xab7049(_0x5cdef3[_0xeb62('0x13')][_0xeb62('0x15')]);}else{logger[_0xeb62('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e0dc4,_0xeb62('0xf'));_0xab7049(_0x5cdef3[_0xeb62('0x16')][_0xeb62('0x15')]);}})[_0xeb62('0x17')](function(_0x3fb280){logger[_0xeb62('0x13')](_0xeb62('0xe'),_0x5e0dc4,_0x3fb280);_0x1e10ae(_0x3fb280);});});}exports[_0xeb62('0x18')]=function(_0x39b138){var _0x27fd84=this;return new Promise(function(_0x27efc8,_0x11d516){return db[_0xeb62('0x19')]['create'](_0x39b138[_0xeb62('0x1a')],{'raw':_0x39b138[_0xeb62('0x1b')]?_0x39b138[_0xeb62('0x1b')][_0xeb62('0x1c')]===undefined?!![]:![]:!![]})[_0xeb62('0x1d')](function(_0x24cbf3){logger[_0xeb62('0xd')]('CreateSquareDetailsReport',_0x39b138);logger['debug'](_0xeb62('0x18'),_0x39b138,JSON[_0xeb62('0x12')](_0x24cbf3));_0x27efc8(_0x24cbf3);})[_0xeb62('0x17')](function(_0x13243f){logger[_0xeb62('0x13')]('CreateSquareDetailsReport',_0x13243f['message'],_0x39b138);_0x11d516(_0x27fd84[_0xeb62('0x13')](0x1f4,_0x13243f[_0xeb62('0x15')]));});});};
\ No newline at end of file
+var _0x235b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','lodash'];(function(_0x1f6d38,_0x37b165){var _0x38f4cb=function(_0x4d653c){while(--_0x4d653c){_0x1f6d38['push'](_0x1f6d38['shift']());}};_0x38f4cb(++_0x37b165);}(_0x235b,0x1ed));var _0xb235=function(_0x34de19,_0x4bc988){_0x34de19=_0x34de19-0x0;var _0x895510=_0x235b[_0x34de19];return _0x895510;};'use strict';var _=require(_0xb235('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb235('0x1'));var rs=require(_0xb235('0x2'));var fs=require('fs');var Redis=require(_0xb235('0x3'));var db=require(_0xb235('0x4'))['db'];var utils=require(_0xb235('0x5'));var logger=require(_0xb235('0x6'))('rpc');var config=require(_0xb235('0x7'));var jayson=require(_0xb235('0x8'));var client=jayson[_0xb235('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12d0ae,_0x44559a,_0x2affe8){return new BPromise(function(_0x436d63,_0x3241b4){return client['request'](_0x12d0ae,_0x2affe8)['then'](function(_0xecf759){logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));logger[_0xb235('0xd')](_0xb235('0xe'),_0x44559a,_0xb235('0xc'),JSON[_0xb235('0xf')](_0xecf759));if(_0xecf759['error']){if(_0xecf759[_0xb235('0x10')][_0xb235('0x11')]===0x1f4){logger[_0xb235('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x44559a,_0xecf759[_0xb235('0x10')]['message']);return _0x3241b4(_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);}logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0xecf759[_0xb235('0x10')][_0xb235('0x12')]);return _0x436d63(_0xecf759[_0xb235('0x10')]['message']);}else{logger[_0xb235('0xa')](_0xb235('0xb'),_0x44559a,_0xb235('0xc'));_0x436d63(_0xecf759[_0xb235('0x13')][_0xb235('0x12')]);}})[_0xb235('0x14')](function(_0x16f044){logger[_0xb235('0x10')](_0xb235('0xb'),_0x44559a,_0x16f044);_0x3241b4(_0x16f044);});});}exports[_0xb235('0x15')]=function(_0x2f1c46){var _0x1b9eae=this;return new Promise(function(_0x1f7cb9,_0x55a479){return db[_0xb235('0x16')]['create'](_0x2f1c46[_0xb235('0x17')],{'raw':_0x2f1c46['options']?_0x2f1c46[_0xb235('0x18')][_0xb235('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x447ec6){logger[_0xb235('0xa')](_0xb235('0x15'),_0x2f1c46);logger[_0xb235('0xd')](_0xb235('0x15'),_0x2f1c46,JSON['stringify'](_0x447ec6));_0x1f7cb9(_0x447ec6);})[_0xb235('0x14')](function(_0x12f787){logger[_0xb235('0x10')](_0xb235('0x15'),_0x12f787[_0xb235('0x12')],_0x2f1c46);_0x55a479(_0x1b9eae[_0xb235('0x10')](0x1f4,_0x12f787['message']));});});};
\ No newline at end of file
index 395b45b..07ea733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa766=['isAuthenticated','index','get','/process/:pid/kill','killProcess','express','Router','../../components/auth/service','./system.controller'];(function(_0x3eb85e,_0x1924c1){var _0x24311a=function(_0x431b4c){while(--_0x431b4c){_0x3eb85e['push'](_0x3eb85e['shift']());}};_0x24311a(++_0x1924c1);}(_0xa766,0x113));var _0x6a76=function(_0x26c14e,_0x5f0ec2){_0x26c14e=_0x26c14e-0x0;var _0x38f312=_0xa766[_0x26c14e];return _0x38f312;};'use strict';var express=require(_0x6a76('0x0'));var router=express[_0x6a76('0x1')]();var auth=require(_0x6a76('0x2'));var controller=require(_0x6a76('0x3'));router['get']('/',auth[_0x6a76('0x4')](),controller[_0x6a76('0x5')]);router[_0x6a76('0x6')](_0x6a76('0x7'),auth['isAuthenticated'](),controller[_0x6a76('0x8')]);module['exports']=router;
\ No newline at end of file
+var _0x779e=['/process/:pid/kill','killProcess','Router','./system.controller','get','isAuthenticated','index'];(function(_0x2c26a0,_0x2b9577){var _0x3e26d2=function(_0xcd6fc5){while(--_0xcd6fc5){_0x2c26a0['push'](_0x2c26a0['shift']());}};_0x3e26d2(++_0x2b9577);}(_0x779e,0x159));var _0xe779=function(_0x36d25e,_0x1a047d){_0x36d25e=_0x36d25e-0x0;var _0x4b95b8=_0x779e[_0x36d25e];return _0x4b95b8;};'use strict';var express=require('express');var router=express[_0xe779('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0xe779('0x1'));router[_0xe779('0x2')]('/',auth[_0xe779('0x3')](),controller[_0xe779('0x4')]);router[_0xe779('0x2')](_0xe779('0x5'),auth[_0xe779('0x3')](),controller[_0xe779('0x6')]);module['exports']=router;
\ No newline at end of file
index 9faad39..38a7835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf631=['Process\x20with\x20pid\x20%s\x20not\x20found!','kill','pid','SIGINT','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','getAllData','then','json','catch','components/import/cm','format','params','split','length'];(function(_0x5b43ac,_0x9424bc){var _0x2f0a71=function(_0x777c0d){while(--_0x777c0d){_0x5b43ac['push'](_0x5b43ac['shift']());}};_0x2f0a71(++_0x9424bc);}(_0xf631,0x18b));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';var info=require(_0x1f63('0x0'));var exec=require(_0x1f63('0x1'))[_0x1f63('0x2')];var logger=require(_0x1f63('0x3'))(_0x1f63('0x4'));var util=require('util');var BPromise=require(_0x1f63('0x5'));var _=require(_0x1f63('0x6'));function handleError(_0x36cb59,_0x332c22,_0x4ce69d){_0x332c22=_0x332c22||0x1f4;return function(_0xf532c6){logger['error'](_0x1f63('0x7'),_0x4ce69d,_0x332c22,util[_0x1f63('0x8')](_0xf532c6,{'showHidden':![],'depth':null}));delete _0xf532c6['name'];_0x36cb59[_0x1f63('0x9')](_0x332c22)['send'](_0xf532c6);};}exports['index']=function(_0x15da75,_0x230a57){return info[_0x1f63('0xa')]()[_0x1f63('0xb')](function(_0x59f72c){return _0x230a57[_0x1f63('0x9')](0xc8)[_0x1f63('0xc')](_0x59f72c);})[_0x1f63('0xd')](function(_0x1cc5a5){return _0x230a57['status'](0x1f4)['json'](_0x1cc5a5);});};exports['killProcess']=function(_0xefe923,_0x1e62e2){var _0x255636=[_0x1f63('0xe')];return new BPromise(function(_0x262266,_0xc1acac){return exec(util[_0x1f63('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0xefe923[_0x1f63('0x10')]['pid']),function(_0x11848a,_0x2c2720,_0x2c56a3){if(_0x11848a){return _0xc1acac(_0x11848a);}return _0x262266(_0x2c2720);});})['then'](function(_0x26df6a){var _0x4fcbb5=![];var _0x445f16=_0x26df6a[_0x1f63('0x11')](/\n/);for(var _0xac7540=0x0,_0x502a0d=_0x255636[_0x1f63('0x12')];_0xac7540<_0x502a0d,_0x4fcbb5===![];_0xac7540+=0x1){if(_0x26df6a['indexOf'](_0x255636[_0xac7540])>=0x0){_0x4fcbb5=!![];}}if(!_0x4fcbb5){throw new Error(util[_0x1f63('0xf')](_0x1f63('0x13'),_0xefe923[_0x1f63('0x10')]['pid']));}process[_0x1f63('0x14')](_0xefe923[_0x1f63('0x10')][_0x1f63('0x15')],_0x1f63('0x16'));return _0x1e62e2[_0x1f63('0x9')](0xc8)[_0x1f63('0xc')]({'message':util[_0x1f63('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0xefe923[_0x1f63('0x10')][_0x1f63('0x15')])});})[_0x1f63('0xd')](handleError(_0x1e62e2,null,'killProcess'));};
\ No newline at end of file
+var _0x9078=['systeminformation','exec','util','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','getAllData','status','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','then','split','length','indexOf','pid','kill','SIGINT','format','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x9078,0xaf));var _0x8907=function(_0x3e5176,_0x122db4){_0x3e5176=_0x3e5176-0x0;var _0x23f161=_0x9078[_0x3e5176];return _0x23f161;};'use strict';var info=require(_0x8907('0x0'));var exec=require('child_process')[_0x8907('0x1')];var logger=require('../../config/logger')('api');var util=require(_0x8907('0x2'));var BPromise=require('bluebird');var _=require(_0x8907('0x3'));function handleError(_0x363a06,_0x59b5ff,_0x11723d){_0x59b5ff=_0x59b5ff||0x1f4;return function(_0x4ff770){logger[_0x8907('0x4')](_0x8907('0x5'),_0x11723d,_0x59b5ff,util[_0x8907('0x6')](_0x4ff770,{'showHidden':![],'depth':null}));delete _0x4ff770[_0x8907('0x7')];_0x363a06['status'](_0x59b5ff)['send'](_0x4ff770);};}exports['index']=function(_0x106ad7,_0x3e3fd8){return info[_0x8907('0x8')]()['then'](function(_0x2a7ac7){return _0x3e3fd8[_0x8907('0x9')](0xc8)[_0x8907('0xa')](_0x2a7ac7);})[_0x8907('0xb')](function(_0x1f30b3){return _0x3e3fd8[_0x8907('0x9')](0x1f4)[_0x8907('0xa')](_0x1f30b3);});};exports[_0x8907('0xc')]=function(_0x575aaa,_0x3efa99){var _0x52c353=[_0x8907('0xd')];return new BPromise(function(_0x22b5a4,_0x593b5a){return exec(util['format'](_0x8907('0xe'),_0x575aaa[_0x8907('0xf')]['pid']),function(_0x5ef1bd,_0x4f102d,_0x1ab09c){if(_0x5ef1bd){return _0x593b5a(_0x5ef1bd);}return _0x22b5a4(_0x4f102d);});})[_0x8907('0x10')](function(_0x3de803){var _0x359076=![];var _0x5c6742=_0x3de803[_0x8907('0x11')](/\n/);for(var _0x7aabb2=0x0,_0x5d6aa3=_0x52c353[_0x8907('0x12')];_0x7aabb2<_0x5d6aa3,_0x359076===![];_0x7aabb2+=0x1){if(_0x3de803[_0x8907('0x13')](_0x52c353[_0x7aabb2])>=0x0){_0x359076=!![];}}if(!_0x359076){throw new Error(util['format']('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x575aaa['params'][_0x8907('0x14')]));}process[_0x8907('0x15')](_0x575aaa['params'][_0x8907('0x14')],_0x8907('0x16'));return _0x3efa99['status'](0xc8)[_0x8907('0xa')]({'message':util[_0x8907('0x17')](_0x8907('0x18'),_0x575aaa[_0x8907('0xf')][_0x8907('0x14')])});})['catch'](handleError(_0x3efa99,null,_0x8907('0xc')));};
\ No newline at end of file
index 814c402..2eb56b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51f9=['connect-timeout','fs-extra','../../components/auth/service','./tag.controller','get','isAuthenticated','index','show','post','create','/:id','multer'];(function(_0x29f511,_0x9c4ab6){var _0x21636d=function(_0x59d7a8){while(--_0x59d7a8){_0x29f511['push'](_0x29f511['shift']());}};_0x21636d(++_0x9c4ab6);}(_0x51f9,0x1eb));var _0x951f=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x51f9[_0x45fc6a];return _0x14bcfd;};'use strict';var multer=require(_0x951f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x951f('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x951f('0x2'));var auth=require(_0x951f('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x951f('0x4'));router[_0x951f('0x5')]('/',auth[_0x951f('0x6')](),controller[_0x951f('0x7')]);router[_0x951f('0x5')]('/:id',auth[_0x951f('0x6')](),controller[_0x951f('0x8')]);router[_0x951f('0x9')]('/',auth['isAuthenticated'](),controller[_0x951f('0xa')]);router['put'](_0x951f('0xb'),auth[_0x951f('0x6')](),controller['update']);router['delete']('/:id',auth[_0x951f('0x6')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf5dd=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x27a8e1,_0x51ce9c){var _0x1c4267=function(_0x3ad9e7){while(--_0x3ad9e7){_0x27a8e1['push'](_0x27a8e1['shift']());}};_0x1c4267(++_0x51ce9c);}(_0xf5dd,0x1ad));var _0xdf5d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf5dd[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xdf5d('0x0'));var util=require(_0xdf5d('0x1'));var path=require(_0xdf5d('0x2'));var timeout=require(_0xdf5d('0x3'));var express=require(_0xdf5d('0x4'));var router=express[_0xdf5d('0x5')]();var fs_extra=require(_0xdf5d('0x6'));var auth=require(_0xdf5d('0x7'));var interaction=require(_0xdf5d('0x8'));var config=require(_0xdf5d('0x9'));var controller=require(_0xdf5d('0xa'));router['get']('/',auth[_0xdf5d('0xb')](),controller[_0xdf5d('0xc')]);router[_0xdf5d('0xd')](_0xdf5d('0xe'),auth[_0xdf5d('0xb')](),controller[_0xdf5d('0xf')]);router[_0xdf5d('0x10')]('/',auth[_0xdf5d('0xb')](),controller[_0xdf5d('0x11')]);router[_0xdf5d('0x12')](_0xdf5d('0xe'),auth[_0xdf5d('0xb')](),controller[_0xdf5d('0x13')]);router['delete'](_0xdf5d('0xe'),auth[_0xdf5d('0xb')](),controller[_0xdf5d('0x14')]);module[_0xdf5d('0x15')]=router;
\ No newline at end of file
index 0771218..7f23c80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfecd=['STRING','name','#0091EA','sequelize'];(function(_0x2a702f,_0x377aa7){var _0x52106f=function(_0x45726f){while(--_0x45726f){_0x2a702f['push'](_0x2a702f['shift']());}};_0x52106f(++_0x377aa7);}(_0xfecd,0x107));var _0xdfec=function(_0xa43d11,_0x5a70b6){_0xa43d11=_0xa43d11-0x0;var _0x265ce9=_0xfecd[_0xa43d11];return _0x265ce9;};'use strict';var Sequelize=require(_0xdfec('0x0'));module['exports']={'name':{'type':Sequelize[_0xdfec('0x1')],'unique':_0xdfec('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xdfec('0x3')},'description':{'type':Sequelize[_0xdfec('0x1')]}};
\ No newline at end of file
+var _0x67da=['name','#0091EA','exports','STRING'];(function(_0x412080,_0xf9659d){var _0x24df2c=function(_0x2b82ae){while(--_0x2b82ae){_0x412080['push'](_0x412080['shift']());}};_0x24df2c(++_0xf9659d);}(_0x67da,0x192));var _0xa67d=function(_0xb90425,_0x2c3e63){_0xb90425=_0xb90425-0x0;var _0x25ac17=_0x67da[_0xb90425];return _0x25ac17;};'use strict';var Sequelize=require('sequelize');module[_0xa67d('0x0')]={'name':{'type':Sequelize[_0xa67d('0x1')],'unique':_0xa67d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa67d('0x1')],'defaultValue':_0xa67d('0x3')},'description':{'type':Sequelize[_0xa67d('0x1')]}};
\ No newline at end of file
index 4510817..93d99b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2121=['include','findAll','rows','catch','show','params','length','options','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','find','userProfileId','create','destroy','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','type','key','map','query','keys','intersection','model','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll'];(function(_0x1d4bb6,_0x45885e){var _0x5588a3=function(_0x4f1c13){while(--_0x4f1c13){_0x1d4bb6['push'](_0x1d4bb6['shift']());}};_0x5588a3(++_0x45885e);}(_0x2121,0x1b4));var _0x1212=function(_0x476a8e,_0x3177a2){_0x476a8e=_0x476a8e-0x0;var _0x296b3d=_0x2121[_0x476a8e];return _0x296b3d;};'use strict';var emlformat=require(_0x1212('0x0'));var rimraf=require(_0x1212('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1212('0x2'));var moment=require(_0x1212('0x3'));var BPromise=require(_0x1212('0x4'));var Mustache=require(_0x1212('0x5'));var util=require(_0x1212('0x6'));var path=require('path');var sox=require(_0x1212('0x7'));var csv=require('to-csv');var ejs=require(_0x1212('0x8'));var fs=require('fs');var fs_extra=require(_0x1212('0x9'));var _=require(_0x1212('0xa'));var squel=require(_0x1212('0xb'));var crypto=require(_0x1212('0xc'));var jsforce=require(_0x1212('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1212('0xe'));var querystring=require(_0x1212('0xf'));var Papa=require(_0x1212('0x10'));var Redis=require(_0x1212('0x11'));var authService=require(_0x1212('0x12'));var qs=require(_0x1212('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1212('0x14'))(_0x1212('0x15'));var utils=require(_0x1212('0x16'));var config=require(_0x1212('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1212('0x18'))['db'];function respondWithStatusCode(_0x3cb42e,_0x17882d){_0x17882d=_0x17882d||0xcc;return function(_0x3e33fe){if(_0x3e33fe){return _0x3cb42e[_0x1212('0x19')](_0x17882d);}return _0x3cb42e[_0x1212('0x1a')](_0x17882d)[_0x1212('0x1b')]();};}function respondWithResult(_0x3ee480,_0x469cf6){_0x469cf6=_0x469cf6||0xc8;return function(_0x35b8ac){if(_0x35b8ac){return _0x3ee480[_0x1212('0x1a')](_0x469cf6)[_0x1212('0x1c')](_0x35b8ac);}};}function respondWithFilteredResult(_0x5ecfe5,_0x13e062){return function(_0x1919e1){if(_0x1919e1){var _0x5cc246=typeof _0x13e062['offset']==='undefined'&&typeof _0x13e062[_0x1212('0x1d')]===_0x1212('0x1e');var _0x768995=_0x1919e1[_0x1212('0x1f')];var _0x3cf284=_0x5cc246?0x0:_0x13e062[_0x1212('0x20')];var _0xb0dc88=_0x5cc246?_0x1919e1[_0x1212('0x1f')]:_0x13e062[_0x1212('0x20')]+_0x13e062['limit'];var _0x3c638a;if(_0xb0dc88>=_0x768995){_0xb0dc88=_0x768995;_0x3c638a=0xc8;}else{_0x3c638a=0xce;}_0x5ecfe5[_0x1212('0x1a')](_0x3c638a);return _0x5ecfe5[_0x1212('0x21')](_0x1212('0x22'),_0x3cf284+'-'+_0xb0dc88+'/'+_0x768995)[_0x1212('0x1c')](_0x1919e1);}return null;};}function patchUpdates(_0x2e656f){return function(_0x7d0810){try{jsonpatch[_0x1212('0x23')](_0x7d0810,_0x2e656f,!![]);}catch(_0x4e5437){return BPromise[_0x1212('0x24')](_0x4e5437);}return _0x7d0810[_0x1212('0x25')]();};}function saveUpdates(_0x46d6df,_0x5d15ca){return function(_0x1571fd){if(_0x1571fd){return _0x1571fd[_0x1212('0x26')](_0x46d6df)[_0x1212('0x27')](function(_0x28c92b){return _0x28c92b;});}return null;};}function removeEntity(_0x52132b,_0x58ab5b){return function(_0x59cd01){if(_0x59cd01){return _0x59cd01['destroy']()['then'](function(){var _0xec5b8d=_0x59cd01[_0x1212('0x28')]({'plain':!![]});var _0x4c32a7=_0x1212('0x29');return db[_0x1212('0x2a')]['destroy']({'where':{'type':_0x4c32a7,'resourceId':_0xec5b8d['id']}})[_0x1212('0x27')](function(){return _0x59cd01;});})[_0x1212('0x27')](function(){_0x52132b[_0x1212('0x1a')](0xcc)[_0x1212('0x1b')]();});}};}function handleEntityNotFound(_0x3a0ddf,_0x3f6be3){return function(_0x2750b0){if(!_0x2750b0){_0x3a0ddf[_0x1212('0x19')](0x194);}return _0x2750b0;};}function handleError(_0x53aa25,_0x156b50){_0x156b50=_0x156b50||0x1f4;return function(_0x7706a0){logger[_0x1212('0x2b')](_0x7706a0[_0x1212('0x2c')]);if(_0x7706a0[_0x1212('0x2d')]){delete _0x7706a0[_0x1212('0x2d')];}_0x53aa25[_0x1212('0x1a')](_0x156b50)[_0x1212('0x2e')](_0x7706a0);};}exports[_0x1212('0x2f')]=function(_0x1e3506,_0x4b8e34){var _0x5a9b18={},_0x365232={},_0x5769a9={'count':0x0,'rows':[]};var _0x339d58=_['map'](db[_0x1212('0x30')]['rawAttributes'],function(_0x2c9313){return{'name':_0x2c9313[_0x1212('0x31')],'type':_0x2c9313[_0x1212('0x32')][_0x1212('0x33')]};});_0x365232['model']=_[_0x1212('0x34')](_0x339d58,_0x1212('0x2d'));_0x365232[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1e3506[_0x1212('0x35')]);_0x365232['filters']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],_0x365232[_0x1212('0x35')]);_0x5a9b18['attributes']=_[_0x1212('0x37')](_0x365232[_0x1212('0x38')],qs[_0x1212('0x39')](_0x1e3506[_0x1212('0x35')]['fields']));_0x5a9b18[_0x1212('0x3a')]=_0x5a9b18[_0x1212('0x3a')]['length']?_0x5a9b18[_0x1212('0x3a')]:_0x365232[_0x1212('0x38')];if(!_0x1e3506[_0x1212('0x35')]['hasOwnProperty'](_0x1212('0x3b'))){_0x5a9b18[_0x1212('0x1d')]=qs[_0x1212('0x1d')](_0x1e3506['query'][_0x1212('0x1d')]);_0x5a9b18['offset']=qs[_0x1212('0x20')](_0x1e3506[_0x1212('0x35')]['offset']);}_0x5a9b18['order']=qs[_0x1212('0x3c')](_0x1e3506['query'][_0x1212('0x3c')]);_0x5a9b18[_0x1212('0x3d')]=qs[_0x1212('0x3e')](_[_0x1212('0x3f')](_0x1e3506[_0x1212('0x35')],_0x365232[_0x1212('0x3e')]),_0x339d58);if(_0x1e3506[_0x1212('0x35')][_0x1212('0x40')]){_0x5a9b18[_0x1212('0x3d')]=_[_0x1212('0x41')](_0x5a9b18[_0x1212('0x3d')],{'$or':_[_0x1212('0x34')](_0x339d58,function(_0x4995e1){if(_0x4995e1[_0x1212('0x32')]!==_0x1212('0x42')){var _0x42b95a={};_0x42b95a[_0x4995e1[_0x1212('0x2d')]]={'$like':'%'+_0x1e3506[_0x1212('0x35')]['filter']+'%'};return _0x42b95a;}})});}_0x5a9b18=_[_0x1212('0x41')]({},_0x5a9b18,_0x1e3506['options']);var _0x50fc00={'where':_0x5a9b18[_0x1212('0x3d')]};return db[_0x1212('0x30')][_0x1212('0x1f')](_0x50fc00)[_0x1212('0x27')](function(_0x469fcd){_0x5769a9['count']=_0x469fcd;if(_0x1e3506['query'][_0x1212('0x43')]){_0x5a9b18[_0x1212('0x44')]=[{'all':!![]}];}return db[_0x1212('0x30')][_0x1212('0x45')](_0x5a9b18);})[_0x1212('0x27')](function(_0x640717){_0x5769a9[_0x1212('0x46')]=_0x640717;return _0x5769a9;})[_0x1212('0x27')](respondWithFilteredResult(_0x4b8e34,_0x5a9b18))[_0x1212('0x47')](handleError(_0x4b8e34,null));};exports[_0x1212('0x48')]=function(_0x1af6ae,_0x15e1ce){var _0x4e1a32={'raw':!![],'where':{'id':_0x1af6ae[_0x1212('0x49')]['id']}},_0x584d32={};_0x584d32[_0x1212('0x38')]=_['keys'](db[_0x1212('0x30')]['rawAttributes']);_0x584d32[_0x1212('0x35')]=_[_0x1212('0x36')](_0x1af6ae[_0x1212('0x35')]);_0x584d32[_0x1212('0x3e')]=_[_0x1212('0x37')](_0x584d32['model'],_0x584d32[_0x1212('0x35')]);_0x4e1a32[_0x1212('0x3a')]=_[_0x1212('0x37')](_0x584d32['model'],qs[_0x1212('0x39')](_0x1af6ae[_0x1212('0x35')]['fields']));_0x4e1a32[_0x1212('0x3a')]=_0x4e1a32[_0x1212('0x3a')][_0x1212('0x4a')]?_0x4e1a32[_0x1212('0x3a')]:_0x584d32[_0x1212('0x38')];if(_0x1af6ae[_0x1212('0x35')]['includeAll']){_0x4e1a32[_0x1212('0x44')]=[{'all':!![]}];}_0x4e1a32=_[_0x1212('0x41')]({},_0x4e1a32,_0x1af6ae[_0x1212('0x4b')]);return db['Tag']['find'](_0x4e1a32)[_0x1212('0x27')](handleEntityNotFound(_0x15e1ce,null))['then'](respondWithResult(_0x15e1ce,null))[_0x1212('0x47')](handleError(_0x15e1ce,null));};exports['create']=function(_0x50a8ef,_0x19a24f){return db[_0x1212('0x30')]['create'](_0x50a8ef[_0x1212('0x4c')],{})['then'](function(_0x2972a3){var _0x24cae5=_0x50a8ef['user']['get']({'plain':!![]});if(!_0x24cae5)throw new Error(_0x1212('0x4d'));if(_0x24cae5['role']===_0x1212('0x4e')){var _0x53a46f=_0x2972a3[_0x1212('0x28')]({'plain':!![]});var _0x49b71b=_0x1212('0x29');return db[_0x1212('0x4f')][_0x1212('0x50')]({'where':{'name':_0x49b71b,'userProfileId':_0x24cae5[_0x1212('0x51')]},'raw':!![]})[_0x1212('0x27')](function(_0xcc376d){if(_0xcc376d&&_0xcc376d['autoAssociation']===0x0){return db['UserProfileResource'][_0x1212('0x52')]({'name':_0x53a46f[_0x1212('0x2d')],'resourceId':_0x53a46f['id'],'type':_0xcc376d[_0x1212('0x2d')],'sectionId':_0xcc376d['id']},{})[_0x1212('0x27')](function(){return _0x2972a3;});}else{return _0x2972a3;}})[_0x1212('0x47')](function(_0x3c1acf){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c1acf);throw _0x3c1acf;});}return _0x2972a3;})['then'](respondWithResult(_0x19a24f,0xc9))[_0x1212('0x47')](handleError(_0x19a24f,null));};exports[_0x1212('0x26')]=function(_0x233854,_0x160cb8){if(_0x233854[_0x1212('0x4c')]['id']){delete _0x233854['body']['id'];}return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x233854[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x160cb8,null))[_0x1212('0x27')](saveUpdates(_0x233854[_0x1212('0x4c')],null))['then'](respondWithResult(_0x160cb8,null))[_0x1212('0x47')](handleError(_0x160cb8,null));};exports[_0x1212('0x53')]=function(_0x31d8be,_0x4a86bd){return db[_0x1212('0x30')][_0x1212('0x50')]({'where':{'id':_0x31d8be[_0x1212('0x49')]['id']}})[_0x1212('0x27')](handleEntityNotFound(_0x4a86bd,null))['then'](removeEntity(_0x4a86bd,null))[_0x1212('0x47')](handleError(_0x4a86bd,null));};
\ No newline at end of file
+var _0xc36d=['error','stack','name','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','Tags','UserProfileResource'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0xc36d,0x7d));var _0xdc36=function(_0x4e9f29,_0x1bbcbf){_0x4e9f29=_0x4e9f29-0x0;var _0x8e1ab3=_0xc36d[_0x4e9f29];return _0x8e1ab3;};'use strict';var emlformat=require(_0xdc36('0x0'));var rimraf=require(_0xdc36('0x1'));var zipdir=require(_0xdc36('0x2'));var jsonpatch=require(_0xdc36('0x3'));var rp=require(_0xdc36('0x4'));var moment=require(_0xdc36('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc36('0x6'));var util=require(_0xdc36('0x7'));var path=require('path');var sox=require(_0xdc36('0x8'));var csv=require(_0xdc36('0x9'));var ejs=require(_0xdc36('0xa'));var fs=require('fs');var fs_extra=require(_0xdc36('0xb'));var _=require(_0xdc36('0xc'));var squel=require('squel');var crypto=require(_0xdc36('0xd'));var jsforce=require(_0xdc36('0xe'));var deskjs=require(_0xdc36('0xf'));var toCsv=require(_0xdc36('0x9'));var querystring=require('querystring');var Papa=require(_0xdc36('0x10'));var Redis=require(_0xdc36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc36('0x12'));var as=require(_0xdc36('0x13'));var hardwareService=require(_0xdc36('0x14'));var logger=require('../../config/logger')(_0xdc36('0x15'));var utils=require(_0xdc36('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc36('0x17'))['db'];function respondWithStatusCode(_0x276692,_0x519fa5){_0x519fa5=_0x519fa5||0xcc;return function(_0x5d62ee){if(_0x5d62ee){return _0x276692['sendStatus'](_0x519fa5);}return _0x276692[_0xdc36('0x18')](_0x519fa5)[_0xdc36('0x19')]();};}function respondWithResult(_0x243d54,_0xae6ad3){_0xae6ad3=_0xae6ad3||0xc8;return function(_0x30803d){if(_0x30803d){return _0x243d54[_0xdc36('0x18')](_0xae6ad3)[_0xdc36('0x1a')](_0x30803d);}};}function respondWithFilteredResult(_0x809cf0,_0x57ebde){return function(_0x155cce){if(_0x155cce){var _0x526ac8=typeof _0x57ebde['offset']==='undefined'&&typeof _0x57ebde[_0xdc36('0x1b')]===_0xdc36('0x1c');var _0x5a498f=_0x155cce[_0xdc36('0x1d')];var _0x219a73=_0x526ac8?0x0:_0x57ebde[_0xdc36('0x1e')];var _0x225878=_0x526ac8?_0x155cce[_0xdc36('0x1d')]:_0x57ebde[_0xdc36('0x1e')]+_0x57ebde['limit'];var _0x3d4c4c;if(_0x225878>=_0x5a498f){_0x225878=_0x5a498f;_0x3d4c4c=0xc8;}else{_0x3d4c4c=0xce;}_0x809cf0[_0xdc36('0x18')](_0x3d4c4c);return _0x809cf0['set'](_0xdc36('0x1f'),_0x219a73+'-'+_0x225878+'/'+_0x5a498f)[_0xdc36('0x1a')](_0x155cce);}return null;};}function patchUpdates(_0x3f25f0){return function(_0x5f15ef){try{jsonpatch[_0xdc36('0x20')](_0x5f15ef,_0x3f25f0,!![]);}catch(_0x235a39){return BPromise['reject'](_0x235a39);}return _0x5f15ef[_0xdc36('0x21')]();};}function saveUpdates(_0x480277,_0x5a6e35){return function(_0x12f9d8){if(_0x12f9d8){return _0x12f9d8[_0xdc36('0x22')](_0x480277)[_0xdc36('0x23')](function(_0xda916b){return _0xda916b;});}return null;};}function removeEntity(_0x2d83c0,_0x34d261){return function(_0x14b595){if(_0x14b595){return _0x14b595[_0xdc36('0x24')]()['then'](function(){var _0x34057e=_0x14b595['get']({'plain':!![]});var _0x2338d7=_0xdc36('0x25');return db[_0xdc36('0x26')]['destroy']({'where':{'type':_0x2338d7,'resourceId':_0x34057e['id']}})[_0xdc36('0x23')](function(){return _0x14b595;});})[_0xdc36('0x23')](function(){_0x2d83c0[_0xdc36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a005,_0x2f3b6a){return function(_0x2a596d){if(!_0x2a596d){_0x28a005['sendStatus'](0x194);}return _0x2a596d;};}function handleError(_0x3c39e3,_0x2dcef7){_0x2dcef7=_0x2dcef7||0x1f4;return function(_0x4b15b4){logger[_0xdc36('0x27')](_0x4b15b4[_0xdc36('0x28')]);if(_0x4b15b4['name']){delete _0x4b15b4[_0xdc36('0x29')];}_0x3c39e3['status'](_0x2dcef7)['send'](_0x4b15b4);};}exports['index']=function(_0x3b0839,_0x2f2bb4){var _0x4f57aa={},_0x13bf82={},_0x983eab={'count':0x0,'rows':[]};var _0x336447=_['map'](db[_0xdc36('0x2a')][_0xdc36('0x2b')],function(_0x1d010c){return{'name':_0x1d010c[_0xdc36('0x2c')],'type':_0x1d010c[_0xdc36('0x2d')][_0xdc36('0x2e')]};});_0x13bf82[_0xdc36('0x2f')]=_['map'](_0x336447,_0xdc36('0x29'));_0x13bf82[_0xdc36('0x30')]=_['keys'](_0x3b0839['query']);_0x13bf82[_0xdc36('0x31')]=_[_0xdc36('0x32')](_0x13bf82[_0xdc36('0x2f')],_0x13bf82['query']);_0x4f57aa['attributes']=_[_0xdc36('0x32')](_0x13bf82[_0xdc36('0x2f')],qs[_0xdc36('0x33')](_0x3b0839[_0xdc36('0x30')][_0xdc36('0x33')]));_0x4f57aa[_0xdc36('0x34')]=_0x4f57aa[_0xdc36('0x34')][_0xdc36('0x35')]?_0x4f57aa[_0xdc36('0x34')]:_0x13bf82[_0xdc36('0x2f')];if(!_0x3b0839[_0xdc36('0x30')]['hasOwnProperty'](_0xdc36('0x36'))){_0x4f57aa[_0xdc36('0x1b')]=qs[_0xdc36('0x1b')](_0x3b0839[_0xdc36('0x30')]['limit']);_0x4f57aa[_0xdc36('0x1e')]=qs[_0xdc36('0x1e')](_0x3b0839[_0xdc36('0x30')][_0xdc36('0x1e')]);}_0x4f57aa['order']=qs[_0xdc36('0x37')](_0x3b0839['query']['sort']);_0x4f57aa[_0xdc36('0x38')]=qs[_0xdc36('0x31')](_[_0xdc36('0x39')](_0x3b0839['query'],_0x13bf82[_0xdc36('0x31')]),_0x336447);if(_0x3b0839['query'][_0xdc36('0x3a')]){_0x4f57aa[_0xdc36('0x38')]=_[_0xdc36('0x3b')](_0x4f57aa['where'],{'$or':_[_0xdc36('0x3c')](_0x336447,function(_0x3394ca){if(_0x3394ca[_0xdc36('0x2d')]!==_0xdc36('0x3d')){var _0x50cf7b={};_0x50cf7b[_0x3394ca[_0xdc36('0x29')]]={'$like':'%'+_0x3b0839[_0xdc36('0x30')][_0xdc36('0x3a')]+'%'};return _0x50cf7b;}})});}_0x4f57aa=_['merge']({},_0x4f57aa,_0x3b0839['options']);var _0x2cefcf={'where':_0x4f57aa[_0xdc36('0x38')]};return db['Tag']['count'](_0x2cefcf)[_0xdc36('0x23')](function(_0x8f4c80){_0x983eab[_0xdc36('0x1d')]=_0x8f4c80;if(_0x3b0839[_0xdc36('0x30')][_0xdc36('0x3e')]){_0x4f57aa[_0xdc36('0x3f')]=[{'all':!![]}];}return db[_0xdc36('0x2a')][_0xdc36('0x40')](_0x4f57aa);})[_0xdc36('0x23')](function(_0x125f0e){_0x983eab[_0xdc36('0x41')]=_0x125f0e;return _0x983eab;})[_0xdc36('0x23')](respondWithFilteredResult(_0x2f2bb4,_0x4f57aa))[_0xdc36('0x42')](handleError(_0x2f2bb4,null));};exports[_0xdc36('0x43')]=function(_0x1f2604,_0x133166){var _0xc8cb3d={'raw':!![],'where':{'id':_0x1f2604[_0xdc36('0x44')]['id']}},_0x16dcb7={};_0x16dcb7[_0xdc36('0x2f')]=_[_0xdc36('0x45')](db[_0xdc36('0x2a')][_0xdc36('0x2b')]);_0x16dcb7[_0xdc36('0x30')]=_[_0xdc36('0x45')](_0x1f2604[_0xdc36('0x30')]);_0x16dcb7['filters']=_[_0xdc36('0x32')](_0x16dcb7[_0xdc36('0x2f')],_0x16dcb7['query']);_0xc8cb3d['attributes']=_[_0xdc36('0x32')](_0x16dcb7['model'],qs[_0xdc36('0x33')](_0x1f2604['query'][_0xdc36('0x33')]));_0xc8cb3d[_0xdc36('0x34')]=_0xc8cb3d[_0xdc36('0x34')][_0xdc36('0x35')]?_0xc8cb3d[_0xdc36('0x34')]:_0x16dcb7[_0xdc36('0x2f')];if(_0x1f2604[_0xdc36('0x30')][_0xdc36('0x3e')]){_0xc8cb3d[_0xdc36('0x3f')]=[{'all':!![]}];}_0xc8cb3d=_[_0xdc36('0x3b')]({},_0xc8cb3d,_0x1f2604[_0xdc36('0x46')]);return db[_0xdc36('0x2a')][_0xdc36('0x47')](_0xc8cb3d)[_0xdc36('0x23')](handleEntityNotFound(_0x133166,null))[_0xdc36('0x23')](respondWithResult(_0x133166,null))[_0xdc36('0x42')](handleError(_0x133166,null));};exports[_0xdc36('0x48')]=function(_0x3399cc,_0x562c86){return db['Tag'][_0xdc36('0x48')](_0x3399cc[_0xdc36('0x49')],{})[_0xdc36('0x23')](function(_0x45dd51){var _0x205f76=_0x3399cc[_0xdc36('0x4a')]['get']({'plain':!![]});if(!_0x205f76)throw new Error(_0xdc36('0x4b'));if(_0x205f76[_0xdc36('0x4c')]===_0xdc36('0x4a')){var _0x49f456=_0x45dd51[_0xdc36('0x4d')]({'plain':!![]});var _0x53ed42=_0xdc36('0x25');return db[_0xdc36('0x4e')][_0xdc36('0x47')]({'where':{'name':_0x53ed42,'userProfileId':_0x205f76[_0xdc36('0x4f')]},'raw':!![]})['then'](function(_0x2f1707){if(_0x2f1707&&_0x2f1707[_0xdc36('0x50')]===0x0){return db[_0xdc36('0x26')][_0xdc36('0x48')]({'name':_0x49f456[_0xdc36('0x29')],'resourceId':_0x49f456['id'],'type':_0x2f1707[_0xdc36('0x29')],'sectionId':_0x2f1707['id']},{})[_0xdc36('0x23')](function(){return _0x45dd51;});}else{return _0x45dd51;}})[_0xdc36('0x42')](function(_0x4abeaf){logger[_0xdc36('0x27')](_0xdc36('0x51'),_0x4abeaf);throw _0x4abeaf;});}return _0x45dd51;})[_0xdc36('0x23')](respondWithResult(_0x562c86,0xc9))[_0xdc36('0x42')](handleError(_0x562c86,null));};exports[_0xdc36('0x22')]=function(_0x187b00,_0x1e7332){if(_0x187b00[_0xdc36('0x49')]['id']){delete _0x187b00['body']['id'];}return db['Tag'][_0xdc36('0x47')]({'where':{'id':_0x187b00[_0xdc36('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e7332,null))[_0xdc36('0x23')](saveUpdates(_0x187b00[_0xdc36('0x49')],null))['then'](respondWithResult(_0x1e7332,null))['catch'](handleError(_0x1e7332,null));};exports[_0xdc36('0x24')]=function(_0x5cf2ee,_0x4277b4){return db['Tag'][_0xdc36('0x47')]({'where':{'id':_0x5cf2ee['params']['id']}})['then'](handleEntityNotFound(_0x4277b4,null))[_0xdc36('0x23')](removeEntity(_0x4277b4,null))['catch'](handleError(_0x4277b4,null));};
\ No newline at end of file
index 1577c6e..dd40531 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd601=['moment','bluebird','path','rimraf','./tag.attributes','exports','Tag','tools_tags','util','../../config/logger','api'];(function(_0x50d3e5,_0x4ae0ac){var _0x3e6219=function(_0x551839){while(--_0x551839){_0x50d3e5['push'](_0x50d3e5['shift']());}};_0x3e6219(++_0x4ae0ac);}(_0xd601,0x17e));var _0x1d60=function(_0x4ad8d6,_0x4a387b){_0x4ad8d6=_0x4ad8d6-0x0;var _0x4fef56=_0xd601[_0x4ad8d6];return _0x4fef56;};'use strict';var _=require('lodash');var util=require(_0x1d60('0x0'));var logger=require(_0x1d60('0x1'))(_0x1d60('0x2'));var moment=require(_0x1d60('0x3'));var BPromise=require(_0x1d60('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d60('0x5'));var rimraf=require(_0x1d60('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d60('0x7'));module[_0x1d60('0x8')]=function(_0x5265d0,_0x3853a1){return _0x5265d0['define'](_0x1d60('0x9'),attributes,{'tableName':_0x1d60('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3b43=['rimraf','./tag.attributes','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x37b851,_0x469969){var _0x574599=function(_0x4e6ab8){while(--_0x4e6ab8){_0x37b851['push'](_0x37b851['shift']());}};_0x574599(++_0x469969);}(_0x3b43,0x71));var _0x33b4=function(_0x20da8e,_0x110922){_0x20da8e=_0x20da8e-0x0;var _0x31cd29=_0x3b43[_0x20da8e];return _0x31cd29;};'use strict';var _=require(_0x33b4('0x0'));var util=require(_0x33b4('0x1'));var logger=require(_0x33b4('0x2'))(_0x33b4('0x3'));var moment=require(_0x33b4('0x4'));var BPromise=require(_0x33b4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x33b4('0x6'));var rimraf=require(_0x33b4('0x7'));var config=require('../../config/environment');var attributes=require(_0x33b4('0x8'));module['exports']=function(_0x28f32a,_0x53bb1c){return _0x28f32a[_0x33b4('0x9')](_0x33b4('0xa'),attributes,{'tableName':_0x33b4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2ad49a6..97ef516 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb205=['../../config/environment','client','http','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0xb205,0xf0));var _0x5b20=function(_0x3b7b45,_0x2b6e82){_0x3b7b45=_0x3b7b45-0x0;var _0x3e0e23=_0xb205[_0x3b7b45];return _0x3e0e23;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var moment=require(_0x5b20('0x2'));var BPromise=require(_0x5b20('0x3'));var rs=require(_0x5b20('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5b20('0x5'));var logger=require('../../config/logger')(_0x5b20('0x6'));var config=require(_0x5b20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5b20('0x8')][_0x5b20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x364e48,_0x5c1ff9,_0x32b467){return new BPromise(function(_0x13fb27,_0x528c54){return client['request'](_0x364e48,_0x32b467)[_0x5b20('0xa')](function(_0xb77426){logger[_0x5b20('0xb')](_0x5b20('0xc'),_0x5c1ff9,_0x5b20('0xd'));logger[_0x5b20('0xe')](_0x5b20('0xf'),_0x5c1ff9,'request\x20sent',JSON[_0x5b20('0x10')](_0xb77426));if(_0xb77426[_0x5b20('0x11')]){if(_0xb77426[_0x5b20('0x11')]['code']===0x1f4){logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x528c54(_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);}logger['error'](_0x5b20('0xc'),_0x5c1ff9,_0xb77426[_0x5b20('0x11')][_0x5b20('0x12')]);return _0x13fb27(_0xb77426[_0x5b20('0x11')]['message']);}else{logger['info'](_0x5b20('0xc'),_0x5c1ff9,'request\x20sent');_0x13fb27(_0xb77426['result'][_0x5b20('0x12')]);}})['catch'](function(_0x43b7b0){logger[_0x5b20('0x11')](_0x5b20('0xc'),_0x5c1ff9,_0x43b7b0);_0x528c54(_0x43b7b0);});});}
\ No newline at end of file
+var _0x5db8=['info','Tag,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x5db8,0xbb));var _0x85db=function(_0x329905,_0x13c144){_0x329905=_0x329905-0x0;var _0x3aa42=_0x5db8[_0x329905];return _0x3aa42;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var moment=require(_0x85db('0x2'));var BPromise=require('bluebird');var rs=require(_0x85db('0x3'));var fs=require('fs');var Redis=require(_0x85db('0x4'));var db=require(_0x85db('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x85db('0x6'));var config=require(_0x85db('0x7'));var jayson=require(_0x85db('0x8'));var client=jayson[_0x85db('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x489b13,_0x2b9f25,_0x3a10dd){return new BPromise(function(_0xc6fd00,_0x308988){return client['request'](_0x489b13,_0x3a10dd)[_0x85db('0xa')](function(_0x54f0c1){logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));logger[_0x85db('0xe')]('Tag,\x20%s,\x20%s,\x20%s',_0x2b9f25,'request\x20sent',JSON['stringify'](_0x54f0c1));if(_0x54f0c1[_0x85db('0xf')]){if(_0x54f0c1[_0x85db('0xf')]['code']===0x1f4){logger[_0x85db('0xf')]('Tag,\x20%s,\x20%s',_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0x308988(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);return _0xc6fd00(_0x54f0c1[_0x85db('0xf')][_0x85db('0x10')]);}else{logger[_0x85db('0xb')](_0x85db('0xc'),_0x2b9f25,_0x85db('0xd'));_0xc6fd00(_0x54f0c1['result'][_0x85db('0x10')]);}})[_0x85db('0x11')](function(_0x11e7da){logger[_0x85db('0xf')](_0x85db('0xc'),_0x2b9f25,_0x11e7da);_0x308988(_0x11e7da);});});}
\ No newline at end of file
index e9797dd..1f93165 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index 5a1054d..ac5457a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x1edc59,_0xc3f03d){var _0x610e2d=function(_0x3cb6a0){while(--_0x3cb6a0){_0x1edc59['push'](_0x1edc59['shift']());}};_0x610e2d(++_0xc3f03d);}(_0xb10b,0x12a));var _0xbb10=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0xb10b[_0x381bff];return _0x201ab1;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xe706=['STRING','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe706,0xa3));var _0x6e70=function(_0x1eff7c,_0x357ad0){_0x1eff7c=_0x1eff7c-0x0;var _0x304854=_0xe706[_0x1eff7c];return _0x304854;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize[_0x6e70('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x6e70('0x2')]}};
\ No newline at end of file
index d8a99d5..3c8c134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a0=['attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','rows','show','params','include','options','find','user','get','Teams','UserProfileSection','autoAssociation','UserProfileResource','create','catch','body','sequelize','transaction','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','VoiceQueueId','UserVoiceQueue','destroy','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserVoicePrefix','VoicePrefixId','getQueues','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','channel','Queues','addQueues','findOne','add','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Fax','Openchannel','through','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','penalty','all','spread','removeAgents','Whatsapp','Queue:remove','TeamVoicePrefix','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','redis','socket.io-emitter','./team.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','map','Team','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields'];(function(_0x5d38c4,_0x451a17){var _0x2558eb=function(_0x20a914){while(--_0x20a914){_0x5d38c4['push'](_0x5d38c4['shift']());}};_0x2558eb(++_0x451a17);}(_0xd5a0,0x18b));var _0x0d5a=function(_0x2d1db5,_0x7455eb){_0x2d1db5=_0x2d1db5-0x0;var _0x228e0d=_0xd5a0[_0x2d1db5];return _0x228e0d;};'use strict';var emlformat=require(_0x0d5a('0x0'));var rimraf=require(_0x0d5a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d5a('0x2'));var rp=require('request-promise');var moment=require(_0x0d5a('0x3'));var BPromise=require(_0x0d5a('0x4'));var Mustache=require(_0x0d5a('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0d5a('0x6'));var csv=require(_0x0d5a('0x7'));var ejs=require(_0x0d5a('0x8'));var fs=require('fs');var fs_extra=require(_0x0d5a('0x9'));var _=require(_0x0d5a('0xa'));var squel=require(_0x0d5a('0xb'));var crypto=require(_0x0d5a('0xc'));var jsforce=require(_0x0d5a('0xd'));var deskjs=require(_0x0d5a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0d5a('0xf'));var Papa=require(_0x0d5a('0x10'));var Redis=require(_0x0d5a('0x11'));var authService=require(_0x0d5a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d5a('0x13'));var logger=require(_0x0d5a('0x14'))(_0x0d5a('0x15'));var utils=require(_0x0d5a('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x0d5a('0x17')](config[_0x0d5a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d5a('0x19'))(new Redis(config[_0x0d5a('0x18')]));require(_0x0d5a('0x1a'))[_0x0d5a('0x1b')](socket);function respondWithStatusCode(_0x5d23d8,_0x245a1e){_0x245a1e=_0x245a1e||0xcc;return function(_0x426d64){if(_0x426d64){return _0x5d23d8['sendStatus'](_0x245a1e);}return _0x5d23d8['status'](_0x245a1e)['end']();};}function respondWithResult(_0x578d79,_0x43abd8){_0x43abd8=_0x43abd8||0xc8;return function(_0x48a0fa){if(_0x48a0fa){return _0x578d79[_0x0d5a('0x1c')](_0x43abd8)[_0x0d5a('0x1d')](_0x48a0fa);}};}function respondWithFilteredResult(_0x180cf7,_0x1a330a){return function(_0x45696c){if(_0x45696c){var _0x30995a=typeof _0x1a330a[_0x0d5a('0x1e')]===_0x0d5a('0x1f')&&typeof _0x1a330a[_0x0d5a('0x20')]===_0x0d5a('0x1f');var _0x11f8f4=_0x45696c[_0x0d5a('0x21')];var _0xba9324=_0x30995a?0x0:_0x1a330a[_0x0d5a('0x1e')];var _0x44b532=_0x30995a?_0x45696c[_0x0d5a('0x21')]:_0x1a330a[_0x0d5a('0x1e')]+_0x1a330a[_0x0d5a('0x20')];var _0x20dec5;if(_0x44b532>=_0x11f8f4){_0x44b532=_0x11f8f4;_0x20dec5=0xc8;}else{_0x20dec5=0xce;}_0x180cf7['status'](_0x20dec5);return _0x180cf7[_0x0d5a('0x22')](_0x0d5a('0x23'),_0xba9324+'-'+_0x44b532+'/'+_0x11f8f4)[_0x0d5a('0x1d')](_0x45696c);}return null;};}function patchUpdates(_0x257660){return function(_0x5c61f2){try{jsonpatch[_0x0d5a('0x24')](_0x5c61f2,_0x257660,!![]);}catch(_0x5d68d9){return BPromise[_0x0d5a('0x25')](_0x5d68d9);}return _0x5c61f2['save']();};}function saveUpdates(_0x10dd50,_0x3e0d12){return function(_0x57973d){if(_0x57973d){return _0x57973d[_0x0d5a('0x26')](_0x10dd50)[_0x0d5a('0x27')](function(_0xc5827e){return _0xc5827e;});}return null;};}function handleEntityNotFound(_0x54e900,_0x243155){return function(_0xc8efd5){if(!_0xc8efd5){_0x54e900[_0x0d5a('0x28')](0x194);}return _0xc8efd5;};}function handleError(_0xb0d34d,_0x54e22c){_0x54e22c=_0x54e22c||0x1f4;return function(_0x10ad5f){logger['error'](_0x10ad5f[_0x0d5a('0x29')]);if(_0x10ad5f['name']){delete _0x10ad5f[_0x0d5a('0x2a')];}_0xb0d34d[_0x0d5a('0x1c')](_0x54e22c)[_0x0d5a('0x2b')](_0x10ad5f);};}exports['index']=function(_0x2a3747,_0x3cb2e3){var _0x9cafba={},_0x1eb5ea={},_0x2dafa4={'count':0x0,'rows':[]};var _0x18e65a=_[_0x0d5a('0x2c')](db[_0x0d5a('0x2d')][_0x0d5a('0x2e')],function(_0x43278a){return{'name':_0x43278a[_0x0d5a('0x2f')],'type':_0x43278a['type'][_0x0d5a('0x30')]};});_0x1eb5ea[_0x0d5a('0x31')]=_[_0x0d5a('0x2c')](_0x18e65a,'name');_0x1eb5ea['query']=_[_0x0d5a('0x32')](_0x2a3747[_0x0d5a('0x33')]);_0x1eb5ea[_0x0d5a('0x34')]=_[_0x0d5a('0x35')](_0x1eb5ea[_0x0d5a('0x31')],_0x1eb5ea[_0x0d5a('0x33')]);_0x9cafba['attributes']=_[_0x0d5a('0x35')](_0x1eb5ea[_0x0d5a('0x31')],qs[_0x0d5a('0x36')](_0x2a3747[_0x0d5a('0x33')][_0x0d5a('0x36')]));_0x9cafba[_0x0d5a('0x37')]=_0x9cafba[_0x0d5a('0x37')][_0x0d5a('0x38')]?_0x9cafba['attributes']:_0x1eb5ea[_0x0d5a('0x31')];if(!_0x2a3747[_0x0d5a('0x33')][_0x0d5a('0x39')](_0x0d5a('0x3a'))){_0x9cafba[_0x0d5a('0x20')]=qs['limit'](_0x2a3747[_0x0d5a('0x33')][_0x0d5a('0x20')]);_0x9cafba['offset']=qs[_0x0d5a('0x1e')](_0x2a3747[_0x0d5a('0x33')]['offset']);}_0x9cafba['order']=qs[_0x0d5a('0x3b')](_0x2a3747[_0x0d5a('0x33')][_0x0d5a('0x3b')]);_0x9cafba[_0x0d5a('0x3c')]=qs[_0x0d5a('0x34')](_[_0x0d5a('0x3d')](_0x2a3747[_0x0d5a('0x33')],_0x1eb5ea[_0x0d5a('0x34')]),_0x18e65a);if(_0x2a3747['query'][_0x0d5a('0x3e')]){_0x9cafba[_0x0d5a('0x3c')]=_['merge'](_0x9cafba[_0x0d5a('0x3c')],{'$or':_['map'](_0x18e65a,function(_0x2365f3){if(_0x2365f3['type']!==_0x0d5a('0x3f')){var _0x21d2fe={};_0x21d2fe[_0x2365f3[_0x0d5a('0x2a')]]={'$like':'%'+_0x2a3747[_0x0d5a('0x33')]['filter']+'%'};return _0x21d2fe;}})});}_0x9cafba=_[_0x0d5a('0x40')]({},_0x9cafba,_0x2a3747['options']);var _0x4e8d8c={'where':_0x9cafba[_0x0d5a('0x3c')]};return db[_0x0d5a('0x2d')][_0x0d5a('0x21')](_0x4e8d8c)[_0x0d5a('0x27')](function(_0x484b47){_0x2dafa4[_0x0d5a('0x21')]=_0x484b47;if(_0x2a3747[_0x0d5a('0x33')][_0x0d5a('0x41')]){_0x9cafba['include']=[{'all':!![]}];}return db[_0x0d5a('0x2d')]['findAll'](_0x9cafba);})[_0x0d5a('0x27')](function(_0x5c0b88){_0x2dafa4[_0x0d5a('0x42')]=_0x5c0b88;return _0x2dafa4;})[_0x0d5a('0x27')](respondWithFilteredResult(_0x3cb2e3,_0x9cafba))['catch'](handleError(_0x3cb2e3,null));};exports[_0x0d5a('0x43')]=function(_0x17262d,_0x6d8adc){var _0x29b199={'raw':![],'where':{'id':_0x17262d[_0x0d5a('0x44')]['id']}},_0x2c3122={};_0x2c3122[_0x0d5a('0x31')]=_[_0x0d5a('0x32')](db[_0x0d5a('0x2d')][_0x0d5a('0x2e')]);_0x2c3122[_0x0d5a('0x33')]=_[_0x0d5a('0x32')](_0x17262d[_0x0d5a('0x33')]);_0x2c3122[_0x0d5a('0x34')]=_[_0x0d5a('0x35')](_0x2c3122['model'],_0x2c3122[_0x0d5a('0x33')]);_0x29b199[_0x0d5a('0x37')]=_['intersection'](_0x2c3122[_0x0d5a('0x31')],qs[_0x0d5a('0x36')](_0x17262d[_0x0d5a('0x33')][_0x0d5a('0x36')]));_0x29b199['attributes']=_0x29b199[_0x0d5a('0x37')][_0x0d5a('0x38')]?_0x29b199['attributes']:_0x2c3122['model'];if(_0x17262d[_0x0d5a('0x33')][_0x0d5a('0x41')]){_0x29b199[_0x0d5a('0x45')]=[{'all':!![]}];}_0x29b199=_[_0x0d5a('0x40')]({},_0x29b199,_0x17262d[_0x0d5a('0x46')]);return db[_0x0d5a('0x2d')][_0x0d5a('0x47')](_0x29b199)[_0x0d5a('0x27')](handleEntityNotFound(_0x6d8adc,null))[_0x0d5a('0x27')](respondWithResult(_0x6d8adc,null))['catch'](handleError(_0x6d8adc,null));};exports['create']=function(_0x44cb36,_0xe61abf){return db[_0x0d5a('0x2d')]['create'](_0x44cb36['body'],{})[_0x0d5a('0x27')](function(_0x56aef4){var _0x24367e=_0x44cb36[_0x0d5a('0x48')][_0x0d5a('0x49')]({'plain':!![]});if(!_0x24367e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24367e['role']===_0x0d5a('0x48')){var _0x4b182a=_0x56aef4[_0x0d5a('0x49')]({'plain':!![]});var _0x20fe7b=_0x0d5a('0x4a');return db[_0x0d5a('0x4b')][_0x0d5a('0x47')]({'where':{'name':_0x20fe7b,'userProfileId':_0x24367e['userProfileId']},'raw':!![]})[_0x0d5a('0x27')](function(_0x5aaa61){if(_0x5aaa61&&_0x5aaa61[_0x0d5a('0x4c')]===0x0){return db[_0x0d5a('0x4d')][_0x0d5a('0x4e')]({'name':_0x4b182a[_0x0d5a('0x2a')],'resourceId':_0x4b182a['id'],'type':_0x5aaa61[_0x0d5a('0x2a')],'sectionId':_0x5aaa61['id']},{})[_0x0d5a('0x27')](function(){return _0x56aef4;});}else{return _0x56aef4;}})[_0x0d5a('0x4f')](function(_0x5e23eb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e23eb);throw _0x5e23eb;});}return _0x56aef4;})['then'](respondWithResult(_0xe61abf,0xc9))[_0x0d5a('0x4f')](handleError(_0xe61abf,null));};exports[_0x0d5a('0x26')]=function(_0x5c9b68,_0x50f858){if(_0x5c9b68[_0x0d5a('0x50')]['id']){delete _0x5c9b68[_0x0d5a('0x50')]['id'];}return db[_0x0d5a('0x2d')]['find']({'where':{'id':_0x5c9b68['params']['id']}})[_0x0d5a('0x27')](handleEntityNotFound(_0x50f858,null))['then'](saveUpdates(_0x5c9b68[_0x0d5a('0x50')],null))[_0x0d5a('0x27')](respondWithResult(_0x50f858,null))[_0x0d5a('0x4f')](handleError(_0x50f858,null));};exports['destroy']=function(_0x3ea7c3,_0x1b5b3a){var _0x96995e=_0x3ea7c3[_0x0d5a('0x44')]['id'];var _0x4a8a15=[];return db[_0x0d5a('0x51')][_0x0d5a('0x52')](function(_0x3fed22){var _0x458fa2='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x458fa2,{'type':db[_0x0d5a('0x53')][_0x0d5a('0x54')]['SELECT'],'raw':!![],'transaction':_0x3fed22})[_0x0d5a('0x27')](function(_0x2fcc66){_0x4a8a15=_[_0x0d5a('0x2c')](_0x2fcc66,function(_0x336480){return Number(_0x336480[_0x0d5a('0x55')]);});})[_0x0d5a('0x27')](function(){var _0x35002a=_0x0d5a('0x56')+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x35002a,{'type':db[_0x0d5a('0x53')][_0x0d5a('0x54')][_0x0d5a('0x57')],'raw':!![],'transaction':_0x3fed22});})['then'](function(_0x13a61a){var _0x22949a=_[_0x0d5a('0x2c')](_0x13a61a,function(_0x33ab5e){return Number(_0x33ab5e[_0x0d5a('0x58')]);});return db[_0x0d5a('0x59')][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'VoiceQueueId':{'$in':_0x22949a}},'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(){var _0x4447a6=_0x0d5a('0x5b')+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x4447a6,{'type':db[_0x0d5a('0x53')]['QueryTypes'][_0x0d5a('0x57')],'raw':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x533bb0){var _0x1954e3=_[_0x0d5a('0x2c')](_0x533bb0,function(_0x19ac73){return Number(_0x19ac73[_0x0d5a('0x5c')]);});return db[_0x0d5a('0x5d')][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'MailQueueId':{'$in':_0x1954e3}},'transaction':_0x3fed22});})['then'](function(){var _0xc88e25='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0xc88e25,{'type':db['Sequelize'][_0x0d5a('0x54')][_0x0d5a('0x57')],'raw':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x3e5eed){var _0x358c62=_[_0x0d5a('0x2c')](_0x3e5eed,function(_0xe5eaaa){return Number(_0xe5eaaa[_0x0d5a('0x5e')]);});return db[_0x0d5a('0x5f')]['destroy']({'where':{'UserId':{'$in':_0x4a8a15},'SmsQueueId':{'$in':_0x358c62}},'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(){var _0xd3e70f=_0x0d5a('0x60')+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0xd3e70f,{'type':db[_0x0d5a('0x53')][_0x0d5a('0x54')]['SELECT'],'raw':!![],'transaction':_0x3fed22});})['then'](function(_0x22c707){var _0x35c55e=_['map'](_0x22c707,function(_0x33dd94){return Number(_0x33dd94[_0x0d5a('0x61')]);});return db[_0x0d5a('0x62')]['destroy']({'where':{'UserId':{'$in':_0x4a8a15},'ChatQueueId':{'$in':_0x35c55e}},'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(){var _0x569df9='SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20'+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x569df9,{'type':db[_0x0d5a('0x53')][_0x0d5a('0x54')]['SELECT'],'raw':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x581014){var _0x2a3b9b=_[_0x0d5a('0x2c')](_0x581014,function(_0x248e81){return Number(_0x248e81['FaxQueueId']);});return db['UserFaxQueue'][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'FaxQueueId':{'$in':_0x2a3b9b}},'transaction':_0x3fed22});})['then'](function(){var _0x4ed4eb=_0x0d5a('0x63')+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x4ed4eb,{'type':db[_0x0d5a('0x53')][_0x0d5a('0x54')][_0x0d5a('0x57')],'raw':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x49b890){var _0x4d6e02=_[_0x0d5a('0x2c')](_0x49b890,function(_0x55746d){return Number(_0x55746d[_0x0d5a('0x64')]);});return db['UserOpenchannelQueue'][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'OpenchannelQueueId':{'$in':_0x4d6e02}},'transaction':_0x3fed22});})['then'](function(){var _0x1dd312=_0x0d5a('0x65')+_0x96995e;return db[_0x0d5a('0x51')][_0x0d5a('0x33')](_0x1dd312,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x5b51bb){var _0x4c4b02=_[_0x0d5a('0x2c')](_0x5b51bb,function(_0x35245f){return Number(_0x35245f[_0x0d5a('0x66')]);});return db['UserWhatsappQueue'][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'WhatsappQueueId':{'$in':_0x4c4b02}},'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(){return db['TeamVoicePrefix'][_0x0d5a('0x47')]({'where':{'TeamId':_0x96995e}});})[_0x0d5a('0x27')](function(_0x46aa58){if(_0x46aa58===null){return;}return db[_0x0d5a('0x67')][_0x0d5a('0x5a')]({'where':{'UserId':{'$in':_0x4a8a15},'VoicePrefixId':_0x46aa58[_0x0d5a('0x68')]},'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(){return db['Team'][_0x0d5a('0x5a')]({'where':{'id':_0x96995e},'cascade':!![],'transaction':_0x3fed22});})[_0x0d5a('0x27')](function(_0x2c96d3){if(_0x2c96d3===0x0){_0x1b5b3a[_0x0d5a('0x28')](0x194);}else{return db[_0x0d5a('0x4d')][_0x0d5a('0x5a')]({'where':{'type':'Teams','resourceId':_0x96995e},'cascade':!![],'transaction':_0x3fed22})['then'](function(){_0x1b5b3a['status'](0xcc)['end']();});}})[_0x0d5a('0x4f')](function(_0x319cc0){_0x1b5b3a[_0x0d5a('0x1c')](0x1f4)[_0x0d5a('0x2b')](_0x319cc0);});});};exports[_0x0d5a('0x69')]=function(_0x3df786,_0x5f2e0a,_0x56952f){return db[_0x0d5a('0x2d')]['findOne']({'where':{'id':_0x3df786[_0x0d5a('0x44')]['id']}})[_0x0d5a('0x27')](handleEntityNotFound(_0x5f2e0a,null))['then'](function(_0x9735a4){if(!_0x3df786['query']['channel']||!utils[_0x0d5a('0x6a')](_0x3df786[_0x0d5a('0x33')]['channel'])){throw new db[(_0x0d5a('0x53'))][(_0x0d5a('0x6b'))](_0x0d5a('0x6c'));}var _0x2db77f={};var _0x5381f5={};_0x5381f5[_0x0d5a('0x31')]=_[_0x0d5a('0x32')](db[_[_0x0d5a('0x6d')](_0x3df786[_0x0d5a('0x33')]['channel'][_0x0d5a('0x6e')]())+_0x0d5a('0x6f')]['rawAttributes']);_0x5381f5[_0x0d5a('0x33')]=_[_0x0d5a('0x32')](_0x3df786[_0x0d5a('0x33')]);_0x5381f5['filters']=_[_0x0d5a('0x35')](_0x5381f5['model'],_0x5381f5[_0x0d5a('0x33')]);_0x2db77f[_0x0d5a('0x37')]=_[_0x0d5a('0x35')](_0x5381f5[_0x0d5a('0x31')],qs[_0x0d5a('0x36')](_0x3df786['query'][_0x0d5a('0x36')]));_0x2db77f['attributes']=_0x2db77f[_0x0d5a('0x37')][_0x0d5a('0x38')]?_0x2db77f[_0x0d5a('0x37')]:_0x5381f5[_0x0d5a('0x31')];_0x2db77f[_0x0d5a('0x20')]=qs[_0x0d5a('0x20')](_0x3df786['query'][_0x0d5a('0x20')]);_0x2db77f['offset']=qs[_0x0d5a('0x1e')](_0x3df786['query'][_0x0d5a('0x1e')]);_0x2db77f[_0x0d5a('0x70')]=qs['sort'](_0x3df786[_0x0d5a('0x33')][_0x0d5a('0x3b')]);_0x2db77f[_0x0d5a('0x3c')]=qs[_0x0d5a('0x34')](_[_0x0d5a('0x3d')](_0x3df786[_0x0d5a('0x33')],_0x5381f5[_0x0d5a('0x34')]));_0x2db77f=_[_0x0d5a('0x40')]({},_0x2db77f,_0x3df786['options']);return _0x9735a4[_0x0d5a('0x49')+_[_0x0d5a('0x6d')](_0x3df786[_0x0d5a('0x33')][_0x0d5a('0x71')]['toLowerCase']())+_0x0d5a('0x72')](_0x2db77f);})[_0x0d5a('0x27')](respondWithResult(_0x5f2e0a,null))['catch'](handleError(_0x5f2e0a,null));};exports[_0x0d5a('0x73')]=function(_0x59f486,_0x2308ea,_0x3160a0){return db[_0x0d5a('0x2d')][_0x0d5a('0x74')]({'where':{'id':_0x59f486[_0x0d5a('0x44')]['id']}})['then'](function(_0xbf7c97){if(_0xbf7c97){if(!_0x59f486[_0x0d5a('0x50')]['channel']||!utils[_0x0d5a('0x6a')](_0x59f486[_0x0d5a('0x50')][_0x0d5a('0x71')])){throw new db[(_0x0d5a('0x53'))][(_0x0d5a('0x6b'))](_0x0d5a('0x6c'));}return _0xbf7c97[_0x0d5a('0x75')+_[_0x0d5a('0x6d')](_0x59f486['body'][_0x0d5a('0x71')]['toLowerCase']())+_0x0d5a('0x72')](_0x59f486[_0x0d5a('0x50')][_0x0d5a('0x76')]);}return null;})[_0x0d5a('0x27')](handleEntityNotFound(_0x2308ea,null))['then'](respondWithStatusCode(_0x2308ea,null))[_0x0d5a('0x4f')](handleError(_0x2308ea,null));};exports[_0x0d5a('0x77')]=function(_0x57b9a1,_0x37d631,_0x55241e){return db[_0x0d5a('0x2d')][_0x0d5a('0x74')]({'where':{'id':_0x57b9a1[_0x0d5a('0x44')]['id']}})[_0x0d5a('0x27')](function(_0x531608){if(_0x531608){if(!_0x57b9a1[_0x0d5a('0x33')][_0x0d5a('0x71')]||!utils[_0x0d5a('0x6a')](_0x57b9a1[_0x0d5a('0x33')][_0x0d5a('0x71')])){throw new db['Sequelize'][(_0x0d5a('0x6b'))](_0x0d5a('0x6c'));}return _0x531608[_0x0d5a('0x78')+_[_0x0d5a('0x6d')](_0x57b9a1[_0x0d5a('0x33')][_0x0d5a('0x71')]['toLowerCase']())+_0x0d5a('0x72')](_0x57b9a1[_0x0d5a('0x33')][_0x0d5a('0x76')]);}return null;})[_0x0d5a('0x27')](handleEntityNotFound(_0x37d631,null))[_0x0d5a('0x27')](respondWithStatusCode(_0x37d631,null))[_0x0d5a('0x4f')](handleError(_0x37d631,null));};exports[_0x0d5a('0x79')]=function(_0x2dfcb9,_0x41db89){var _0x18389e=_[_0x0d5a('0x7a')](_0x2dfcb9['body'][_0x0d5a('0x76')])?_0x2dfcb9[_0x0d5a('0x50')][_0x0d5a('0x76')]:[_0x2dfcb9[_0x0d5a('0x50')][_0x0d5a('0x76')]];var _0x263b34=_0x2dfcb9['params']['id'];return db[_0x0d5a('0x2d')][_0x0d5a('0x47')]({'where':{'id':_0x263b34}})[_0x0d5a('0x27')](handleEntityNotFound(_0x41db89,null))[_0x0d5a('0x27')](function(_0x2c0efd){if(_0x2c0efd){var _0x5aacfa=[_0x0d5a('0x7b'),'Chat',_0x0d5a('0x7c'),_0x0d5a('0x7d'),_0x0d5a('0x7e'),_0x0d5a('0x7f'),'Whatsapp'];return db[_0x0d5a('0x51')]['transaction'](function(_0x12bf09){var _0x18cf76=_[_0x0d5a('0x2c')](_0x5aacfa,function(_0x49573a){var _0x50bb5e={'attributes':['id','name']};if(_0x49573a===_0x0d5a('0x7b')){_0x50bb5e[_0x0d5a('0x80')]={'attributes':['penalty']};}return _0x2c0efd[_0x0d5a('0x49')+_0x49573a+'Queues'](_0x50bb5e)[_0x0d5a('0x27')](function(_0x4331dd){var _0x45c8de=_[_0x0d5a('0x2c')](_0x4331dd,function(_0x5d6b97){var _0x48e282=_[_0x0d5a('0x2c')](_0x18389e,function(_0x5ec21c){var _0x3a439f={'where':{'UserId':_0x5ec21c,[_0x49573a+_0x0d5a('0x81')]:_0x5d6b97['id']},'transaction':_0x12bf09};if(_0x49573a===_0x0d5a('0x7b')){_0x3a439f[_0x0d5a('0x17')]={'penalty':_0x5d6b97[_0x0d5a('0x82')]['penalty']};}return db[_0x0d5a('0x83')+_0x49573a+'Queue'][_0x0d5a('0x84')](_0x3a439f)[_0x0d5a('0x27')](function(){socket[_0x0d5a('0x85')]('user'+_0x49573a+_0x0d5a('0x86'),{'UserId':_0x5ec21c,[_0x49573a+'QueueId']:_0x5d6b97['id']});if(_0x49573a!==_0x0d5a('0x7b')){return;}return db[_0x0d5a('0x83')]['findAll']({'where':{'id':_0x18389e,'online':0x1},'attributes':['id','name','online',_0x0d5a('0x87'),_0x0d5a('0x88')],'raw':!![]})[_0x0d5a('0x27')](function(_0x307863){var _0x354262=_[_0x0d5a('0x2c')](_0x307863,function(_0x2de0fd){return db[_0x0d5a('0x89')][_0x0d5a('0x8a')]({'membername':_0x2de0fd[_0x0d5a('0x2a')],'UserId':_0x2de0fd['id'],'queue_name':_0x5d6b97[_0x0d5a('0x2a')],'VoiceQueueId':_0x5d6b97['id'],'interface':_[_0x0d5a('0x8b')](_0x2de0fd[_0x0d5a('0x88')])?util[_0x0d5a('0x8c')](_0x0d5a('0x8d'),_0x2de0fd['name']):_0x2de0fd[_0x0d5a('0x88')],'paused':_0x2de0fd[_0x0d5a('0x87')]||![],'penalty':_0x5d6b97[_0x0d5a('0x82')][_0x0d5a('0x8e')]},{'transaction':_0x12bf09});});return Promise['all'](_0x354262);});});});return Promise['all'](_0x48e282);});return Promise[_0x0d5a('0x8f')](_0x45c8de);})[_0x0d5a('0x27')](function(){return db['TeamVoicePrefix'][_0x0d5a('0x74')]({'where':{'teamId':_0x263b34}})['then'](function(_0x6e146a){if(_0x6e146a){var _0x224332=_['map'](_0x18389e,function(_0x420a47){db['UserVoicePrefix']['upsert']({'UserId':_0x420a47,'VoicePrefixId':_0x6e146a[_0x0d5a('0x68')]});});return Promise['all'](_0x224332);}});});});return Promise[_0x0d5a('0x8f')](_0x18cf76)[_0x0d5a('0x27')](function(){return _0x2c0efd[_0x0d5a('0x79')](_0x18389e,{'transaction':_0x12bf09})[_0x0d5a('0x90')](function(_0x1d6d36){return _0x1d6d36;});});});}})[_0x0d5a('0x27')](respondWithResult(_0x41db89,null))[_0x0d5a('0x4f')](handleError(_0x41db89,null));};exports[_0x0d5a('0x91')]=function(_0x2ab612,_0x52feb6){var _0x2a07fb=_[_0x0d5a('0x7a')](_0x2ab612['query'][_0x0d5a('0x76')])?_0x2ab612['query'][_0x0d5a('0x76')]:[_0x2ab612[_0x0d5a('0x33')][_0x0d5a('0x76')]];var _0x2e7eae=_0x2ab612['params']['id'];return db['Team'][_0x0d5a('0x47')]({'where':{'id':_0x2e7eae}})['then'](handleEntityNotFound(_0x52feb6,null))[_0x0d5a('0x27')](function(_0x538cb0){if(_0x538cb0){var _0x2b51d3=[_0x0d5a('0x7b'),'Chat',_0x0d5a('0x7c'),'Sms',_0x0d5a('0x7e'),_0x0d5a('0x7f'),_0x0d5a('0x92')];return db[_0x0d5a('0x51')][_0x0d5a('0x52')](function(_0x48d375){var _0x13006b=_[_0x0d5a('0x2c')](_0x2b51d3,function(_0x2c7ba3){var _0x2001af={'attributes':['id',_0x0d5a('0x2a')]};return _0x538cb0[_0x0d5a('0x49')+_0x2c7ba3+'Queues'](_0x2001af)[_0x0d5a('0x27')](function(_0xaa71ce){var _0x214aa9=_[_0x0d5a('0x2c')](_0xaa71ce,function(_0x35e65b){return _0x35e65b['removeAgents'](_0x2a07fb,{'transaction':_0x48d375})[_0x0d5a('0x27')](function(){var _0x510ec5=_[_0x0d5a('0x2c')](_0x2a07fb,function(_0x12f5f0){socket['emit'](_0x0d5a('0x48')+_0x2c7ba3+_0x0d5a('0x93'),{'UserId':Number(_0x12f5f0),[_0x2c7ba3+_0x0d5a('0x81')]:_0x35e65b['id']});if(_0x2c7ba3!=='Voice'){return;}return db[_0x0d5a('0x89')]['destroy']({'where':{'VoiceQueueId':_0x35e65b['id'],'UserId':_0x12f5f0},'transaction':_0x48d375});});return Promise[_0x0d5a('0x8f')](_0x510ec5);});});return Promise[_0x0d5a('0x8f')](_0x214aa9);});});return Promise[_0x0d5a('0x8f')](_0x13006b)['then'](function(){return _0x538cb0[_0x0d5a('0x91')](_0x2a07fb,{'transaction':_0x48d375});})[_0x0d5a('0x27')](function(){return db[_0x0d5a('0x94')][_0x0d5a('0x74')]({'where':{'teamId':_0x2e7eae}})[_0x0d5a('0x27')](function(_0x2208b7){if(_0x2208b7){var _0x1be321=_[_0x0d5a('0x2c')](_0x2a07fb,function(_0x18fefc){db['UserVoicePrefix'][_0x0d5a('0x5a')]({'where':{'UserId':_0x18fefc,'VoicePrefixId':_0x2208b7[_0x0d5a('0x68')]}});});return Promise[_0x0d5a('0x8f')](_0x1be321);}});});});}})[_0x0d5a('0x27')](respondWithStatusCode(_0x52feb6,null))['catch'](handleError(_0x52feb6,null));};exports[_0x0d5a('0x95')]=function(_0x28f67e,_0x5db39c,_0x5736e1){var _0x4b182e={};var _0x26a927={};var _0x3e7716;var _0x2d4145;return db[_0x0d5a('0x2d')][_0x0d5a('0x74')]({'where':{'id':_0x28f67e[_0x0d5a('0x44')]['id']}})[_0x0d5a('0x27')](handleEntityNotFound(_0x5db39c,null))[_0x0d5a('0x27')](function(_0x37c7ab){if(_0x37c7ab){_0x3e7716=_0x37c7ab;_0x26a927['model']=_[_0x0d5a('0x32')](db[_0x0d5a('0x83')][_0x0d5a('0x2e')]);_0x26a927[_0x0d5a('0x33')]=_['keys'](_0x28f67e['query']);_0x26a927['filters']=_[_0x0d5a('0x35')](_0x26a927[_0x0d5a('0x31')],_0x26a927[_0x0d5a('0x33')]);_0x4b182e[_0x0d5a('0x37')]=_[_0x0d5a('0x35')](_0x26a927['model'],qs[_0x0d5a('0x36')](_0x28f67e[_0x0d5a('0x33')]['fields']));_0x4b182e[_0x0d5a('0x37')]=_0x4b182e['attributes'][_0x0d5a('0x38')]?_0x4b182e[_0x0d5a('0x37')]:_0x26a927[_0x0d5a('0x31')];_0x4b182e[_0x0d5a('0x70')]=qs['sort'](_0x28f67e[_0x0d5a('0x33')][_0x0d5a('0x3b')]);_0x4b182e[_0x0d5a('0x3c')]=qs[_0x0d5a('0x34')](_[_0x0d5a('0x3d')](_0x28f67e[_0x0d5a('0x33')],_0x26a927[_0x0d5a('0x34')]));if(_0x28f67e['query'][_0x0d5a('0x3e')]){_0x4b182e['where']=_[_0x0d5a('0x40')](_0x4b182e[_0x0d5a('0x3c')],{'$or':_[_0x0d5a('0x2c')](_0x4b182e[_0x0d5a('0x37')],function(_0x14f235){var _0x384299={};_0x384299[_0x14f235]={'$like':'%'+_0x28f67e['query']['filter']+'%'};return _0x384299;})});}_0x4b182e=_[_0x0d5a('0x40')]({},_0x4b182e,_0x28f67e[_0x0d5a('0x46')]);return _0x3e7716[_0x0d5a('0x95')](_0x4b182e);}})['then'](function(_0x53295c){if(_0x53295c){_0x2d4145=_0x53295c[_0x0d5a('0x38')];if(!_0x28f67e['query'][_0x0d5a('0x39')]('nolimit')){_0x4b182e[_0x0d5a('0x20')]=qs[_0x0d5a('0x20')](_0x28f67e[_0x0d5a('0x33')][_0x0d5a('0x20')]);_0x4b182e[_0x0d5a('0x1e')]=qs['offset'](_0x28f67e[_0x0d5a('0x33')][_0x0d5a('0x1e')]);}return _0x3e7716[_0x0d5a('0x95')](_0x4b182e);}})['then'](function(_0x1f5f5b){if(_0x1f5f5b){return _0x1f5f5b?{'count':_0x2d4145,'rows':_0x1f5f5b}:null;}})['then'](respondWithResult(_0x5db39c,null))[_0x0d5a('0x4f')](handleError(_0x5db39c,null));};
\ No newline at end of file
+var _0x212a=['UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SmsQueueId','UserSmsQueue','destroy','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','add','ids','removeQueues','remove','addAgents','isArray','Voice','Sms','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','interface','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','all','upsert','spread','removeAgents','Chat','Mail','Fax','Queue:remove','options','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','Team','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','includeAll','find','create','body','get','user','Teams'];(function(_0x283fe6,_0x12604c){var _0xd8998=function(_0x13777b){while(--_0x13777b){_0x283fe6['push'](_0x283fe6['shift']());}};_0xd8998(++_0x12604c);}(_0x212a,0xe7));var _0xa212=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x212a[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0xa212('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa212('0x1'));var rp=require('request-promise');var moment=require(_0xa212('0x2'));var BPromise=require(_0xa212('0x3'));var Mustache=require(_0xa212('0x4'));var util=require(_0xa212('0x5'));var path=require(_0xa212('0x6'));var sox=require(_0xa212('0x7'));var csv=require(_0xa212('0x8'));var ejs=require(_0xa212('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa212('0xa'));var crypto=require('crypto');var jsforce=require(_0xa212('0xb'));var deskjs=require(_0xa212('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa212('0xd'));var Redis=require('ioredis');var authService=require(_0xa212('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa212('0xf'));var hardwareService=require(_0xa212('0x10'));var logger=require(_0xa212('0x11'))(_0xa212('0x12'));var utils=require(_0xa212('0x13'));var config=require(_0xa212('0x14'));var licenseUtil=require(_0xa212('0x15'));var db=require(_0xa212('0x16'))['db'];config[_0xa212('0x17')]=_['defaults'](config[_0xa212('0x17')],{'host':_0xa212('0x18'),'port':0x18eb});var socket=require(_0xa212('0x19'))(new Redis(config[_0xa212('0x17')]));require(_0xa212('0x1a'))['register'](socket);function respondWithStatusCode(_0x3561a8,_0x54b082){_0x54b082=_0x54b082||0xcc;return function(_0x543aac){if(_0x543aac){return _0x3561a8[_0xa212('0x1b')](_0x54b082);}return _0x3561a8[_0xa212('0x1c')](_0x54b082)[_0xa212('0x1d')]();};}function respondWithResult(_0x5a59a2,_0x2af603){_0x2af603=_0x2af603||0xc8;return function(_0x518dfd){if(_0x518dfd){return _0x5a59a2[_0xa212('0x1c')](_0x2af603)[_0xa212('0x1e')](_0x518dfd);}};}function respondWithFilteredResult(_0xf02c6,_0x4d4a25){return function(_0x5b413f){if(_0x5b413f){var _0x28c9d6=typeof _0x4d4a25[_0xa212('0x1f')]===_0xa212('0x20')&&typeof _0x4d4a25[_0xa212('0x21')]===_0xa212('0x20');var _0x1a5204=_0x5b413f[_0xa212('0x22')];var _0x52b999=_0x28c9d6?0x0:_0x4d4a25[_0xa212('0x1f')];var _0x1b41f7=_0x28c9d6?_0x5b413f[_0xa212('0x22')]:_0x4d4a25[_0xa212('0x1f')]+_0x4d4a25['limit'];var _0xc6156e;if(_0x1b41f7>=_0x1a5204){_0x1b41f7=_0x1a5204;_0xc6156e=0xc8;}else{_0xc6156e=0xce;}_0xf02c6[_0xa212('0x1c')](_0xc6156e);return _0xf02c6['set'](_0xa212('0x23'),_0x52b999+'-'+_0x1b41f7+'/'+_0x1a5204)[_0xa212('0x1e')](_0x5b413f);}return null;};}function patchUpdates(_0x5e854b){return function(_0x58d732){try{jsonpatch[_0xa212('0x24')](_0x58d732,_0x5e854b,!![]);}catch(_0x58be35){return BPromise[_0xa212('0x25')](_0x58be35);}return _0x58d732[_0xa212('0x26')]();};}function saveUpdates(_0x318cdc,_0x141543){return function(_0xca4bd9){if(_0xca4bd9){return _0xca4bd9[_0xa212('0x27')](_0x318cdc)[_0xa212('0x28')](function(_0x47d6d8){return _0x47d6d8;});}return null;};}function handleEntityNotFound(_0xe8db05,_0x526b3f){return function(_0x395611){if(!_0x395611){_0xe8db05[_0xa212('0x1b')](0x194);}return _0x395611;};}function handleError(_0x578eed,_0x1c3d72){_0x1c3d72=_0x1c3d72||0x1f4;return function(_0x484f53){logger[_0xa212('0x29')](_0x484f53[_0xa212('0x2a')]);if(_0x484f53[_0xa212('0x2b')]){delete _0x484f53[_0xa212('0x2b')];}_0x578eed['status'](_0x1c3d72)[_0xa212('0x2c')](_0x484f53);};}exports[_0xa212('0x2d')]=function(_0x2be932,_0x205d0b){var _0x33e274={},_0x21f7d1={},_0x4153ed={'count':0x0,'rows':[]};var _0x5d51cf=_['map'](db[_0xa212('0x2e')][_0xa212('0x2f')],function(_0x32040e){return{'name':_0x32040e[_0xa212('0x30')],'type':_0x32040e[_0xa212('0x31')]['key']};});_0x21f7d1[_0xa212('0x32')]=_[_0xa212('0x33')](_0x5d51cf,_0xa212('0x2b'));_0x21f7d1['query']=_[_0xa212('0x34')](_0x2be932[_0xa212('0x35')]);_0x21f7d1[_0xa212('0x36')]=_[_0xa212('0x37')](_0x21f7d1[_0xa212('0x32')],_0x21f7d1[_0xa212('0x35')]);_0x33e274['attributes']=_[_0xa212('0x37')](_0x21f7d1[_0xa212('0x32')],qs[_0xa212('0x38')](_0x2be932[_0xa212('0x35')]['fields']));_0x33e274[_0xa212('0x39')]=_0x33e274[_0xa212('0x39')][_0xa212('0x3a')]?_0x33e274[_0xa212('0x39')]:_0x21f7d1['model'];if(!_0x2be932['query'][_0xa212('0x3b')](_0xa212('0x3c'))){_0x33e274[_0xa212('0x21')]=qs['limit'](_0x2be932[_0xa212('0x35')][_0xa212('0x21')]);_0x33e274['offset']=qs[_0xa212('0x1f')](_0x2be932[_0xa212('0x35')]['offset']);}_0x33e274['order']=qs[_0xa212('0x3d')](_0x2be932[_0xa212('0x35')][_0xa212('0x3d')]);_0x33e274['where']=qs[_0xa212('0x36')](_[_0xa212('0x3e')](_0x2be932[_0xa212('0x35')],_0x21f7d1['filters']),_0x5d51cf);if(_0x2be932[_0xa212('0x35')][_0xa212('0x3f')]){_0x33e274[_0xa212('0x40')]=_[_0xa212('0x41')](_0x33e274[_0xa212('0x40')],{'$or':_[_0xa212('0x33')](_0x5d51cf,function(_0x46995d){if(_0x46995d[_0xa212('0x31')]!==_0xa212('0x42')){var _0x42ca17={};_0x42ca17[_0x46995d[_0xa212('0x2b')]]={'$like':'%'+_0x2be932[_0xa212('0x35')]['filter']+'%'};return _0x42ca17;}})});}_0x33e274=_[_0xa212('0x41')]({},_0x33e274,_0x2be932['options']);var _0x4adc06={'where':_0x33e274[_0xa212('0x40')]};return db['Team'][_0xa212('0x22')](_0x4adc06)[_0xa212('0x28')](function(_0x29e525){_0x4153ed[_0xa212('0x22')]=_0x29e525;if(_0x2be932['query']['includeAll']){_0x33e274[_0xa212('0x43')]=[{'all':!![]}];}return db[_0xa212('0x2e')][_0xa212('0x44')](_0x33e274);})[_0xa212('0x28')](function(_0x1deaf9){_0x4153ed[_0xa212('0x45')]=_0x1deaf9;return _0x4153ed;})[_0xa212('0x28')](respondWithFilteredResult(_0x205d0b,_0x33e274))['catch'](handleError(_0x205d0b,null));};exports[_0xa212('0x46')]=function(_0x564931,_0x1fdeb3){var _0x31b1a6={'raw':![],'where':{'id':_0x564931[_0xa212('0x47')]['id']}},_0x30909e={};_0x30909e[_0xa212('0x32')]=_[_0xa212('0x34')](db[_0xa212('0x2e')]['rawAttributes']);_0x30909e[_0xa212('0x35')]=_[_0xa212('0x34')](_0x564931[_0xa212('0x35')]);_0x30909e[_0xa212('0x36')]=_['intersection'](_0x30909e[_0xa212('0x32')],_0x30909e['query']);_0x31b1a6[_0xa212('0x39')]=_['intersection'](_0x30909e[_0xa212('0x32')],qs[_0xa212('0x38')](_0x564931[_0xa212('0x35')][_0xa212('0x38')]));_0x31b1a6[_0xa212('0x39')]=_0x31b1a6[_0xa212('0x39')][_0xa212('0x3a')]?_0x31b1a6[_0xa212('0x39')]:_0x30909e[_0xa212('0x32')];if(_0x564931[_0xa212('0x35')][_0xa212('0x48')]){_0x31b1a6[_0xa212('0x43')]=[{'all':!![]}];}_0x31b1a6=_[_0xa212('0x41')]({},_0x31b1a6,_0x564931['options']);return db[_0xa212('0x2e')][_0xa212('0x49')](_0x31b1a6)[_0xa212('0x28')](handleEntityNotFound(_0x1fdeb3,null))[_0xa212('0x28')](respondWithResult(_0x1fdeb3,null))['catch'](handleError(_0x1fdeb3,null));};exports['create']=function(_0x48bd1d,_0x1b57ba){return db[_0xa212('0x2e')][_0xa212('0x4a')](_0x48bd1d[_0xa212('0x4b')],{})[_0xa212('0x28')](function(_0x4ba497){var _0x1f5b74=_0x48bd1d['user'][_0xa212('0x4c')]({'plain':!![]});if(!_0x1f5b74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f5b74['role']===_0xa212('0x4d')){var _0x1c6191=_0x4ba497[_0xa212('0x4c')]({'plain':!![]});var _0x374eaf=_0xa212('0x4e');return db[_0xa212('0x4f')]['find']({'where':{'name':_0x374eaf,'userProfileId':_0x1f5b74[_0xa212('0x50')]},'raw':!![]})['then'](function(_0x58fc1d){if(_0x58fc1d&&_0x58fc1d[_0xa212('0x51')]===0x0){return db['UserProfileResource'][_0xa212('0x4a')]({'name':_0x1c6191[_0xa212('0x2b')],'resourceId':_0x1c6191['id'],'type':_0x58fc1d[_0xa212('0x2b')],'sectionId':_0x58fc1d['id']},{})[_0xa212('0x28')](function(){return _0x4ba497;});}else{return _0x4ba497;}})[_0xa212('0x52')](function(_0x15c412){logger[_0xa212('0x29')](_0xa212('0x53'),_0x15c412);throw _0x15c412;});}return _0x4ba497;})[_0xa212('0x28')](respondWithResult(_0x1b57ba,0xc9))[_0xa212('0x52')](handleError(_0x1b57ba,null));};exports[_0xa212('0x27')]=function(_0x17d9d3,_0x5d3100){if(_0x17d9d3[_0xa212('0x4b')]['id']){delete _0x17d9d3[_0xa212('0x4b')]['id'];}return db['Team'][_0xa212('0x49')]({'where':{'id':_0x17d9d3['params']['id']}})['then'](handleEntityNotFound(_0x5d3100,null))['then'](saveUpdates(_0x17d9d3[_0xa212('0x4b')],null))[_0xa212('0x28')](respondWithResult(_0x5d3100,null))['catch'](handleError(_0x5d3100,null));};exports['destroy']=function(_0x473806,_0x33f44f){var _0x4c58d3=_0x473806[_0xa212('0x47')]['id'];var _0x311be0=[];return db[_0xa212('0x54')][_0xa212('0x55')](function(_0x51c734){var _0x974d3a=_0xa212('0x56')+_0x4c58d3;return db[_0xa212('0x54')][_0xa212('0x35')](_0x974d3a,{'type':db[_0xa212('0x57')][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734})['then'](function(_0x25b4dc){_0x311be0=_[_0xa212('0x33')](_0x25b4dc,function(_0x275586){return Number(_0x275586[_0xa212('0x5a')]);});})['then'](function(){var _0x3ffc6f='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4c58d3;return db[_0xa212('0x54')][_0xa212('0x35')](_0x3ffc6f,{'type':db['Sequelize'][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x1dd756){var _0xd6299a=_[_0xa212('0x33')](_0x1dd756,function(_0xceda5a){return Number(_0xceda5a['VoiceQueueId']);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x311be0},'VoiceQueueId':{'$in':_0xd6299a}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0x35c2fc=_0xa212('0x5b')+_0x4c58d3;return db[_0xa212('0x54')][_0xa212('0x35')](_0x35c2fc,{'type':db['Sequelize'][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x3d9f6c){var _0x12cd19=_[_0xa212('0x33')](_0x3d9f6c,function(_0x5bc68d){return Number(_0x5bc68d[_0xa212('0x5c')]);});return db[_0xa212('0x5d')]['destroy']({'where':{'UserId':{'$in':_0x311be0},'MailQueueId':{'$in':_0x12cd19}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0x2317e2='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4c58d3;return db[_0xa212('0x54')][_0xa212('0x35')](_0x2317e2,{'type':db[_0xa212('0x57')][_0xa212('0x58')]['SELECT'],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x95d593){var _0x1645e1=_[_0xa212('0x33')](_0x95d593,function(_0x2027f4){return Number(_0x2027f4[_0xa212('0x5e')]);});return db[_0xa212('0x5f')][_0xa212('0x60')]({'where':{'UserId':{'$in':_0x311be0},'SmsQueueId':{'$in':_0x1645e1}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0x4280d4=_0xa212('0x61')+_0x4c58d3;return db['sequelize'][_0xa212('0x35')](_0x4280d4,{'type':db[_0xa212('0x57')][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x58aabe){var _0x4a3798=_[_0xa212('0x33')](_0x58aabe,function(_0x324f6d){return Number(_0x324f6d['ChatQueueId']);});return db[_0xa212('0x62')]['destroy']({'where':{'UserId':{'$in':_0x311be0},'ChatQueueId':{'$in':_0x4a3798}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0x1186be=_0xa212('0x63')+_0x4c58d3;return db[_0xa212('0x54')]['query'](_0x1186be,{'type':db[_0xa212('0x57')][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x3a13ac){var _0x585cc6=_[_0xa212('0x33')](_0x3a13ac,function(_0x59a61f){return Number(_0x59a61f[_0xa212('0x64')]);});return db[_0xa212('0x65')]['destroy']({'where':{'UserId':{'$in':_0x311be0},'FaxQueueId':{'$in':_0x585cc6}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0x38161c=_0xa212('0x66')+_0x4c58d3;return db[_0xa212('0x54')]['query'](_0x38161c,{'type':db['Sequelize'][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})['then'](function(_0xdeefa9){var _0x2ee2e8=_[_0xa212('0x33')](_0xdeefa9,function(_0x40f5ec){return Number(_0x40f5ec[_0xa212('0x67')]);});return db[_0xa212('0x68')][_0xa212('0x60')]({'where':{'UserId':{'$in':_0x311be0},'OpenchannelQueueId':{'$in':_0x2ee2e8}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){var _0xb5c917=_0xa212('0x69')+_0x4c58d3;return db['sequelize'][_0xa212('0x35')](_0xb5c917,{'type':db[_0xa212('0x57')][_0xa212('0x58')][_0xa212('0x59')],'raw':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0xb1d756){var _0x6c6b49=_[_0xa212('0x33')](_0xb1d756,function(_0x3d9bc3){return Number(_0x3d9bc3[_0xa212('0x6a')]);});return db[_0xa212('0x6b')]['destroy']({'where':{'UserId':{'$in':_0x311be0},'WhatsappQueueId':{'$in':_0x6c6b49}},'transaction':_0x51c734});})[_0xa212('0x28')](function(){return db[_0xa212('0x6c')][_0xa212('0x49')]({'where':{'TeamId':_0x4c58d3}});})['then'](function(_0x10a85a){if(_0x10a85a===null){return;}return db[_0xa212('0x6d')][_0xa212('0x60')]({'where':{'UserId':{'$in':_0x311be0},'VoicePrefixId':_0x10a85a[_0xa212('0x6e')]},'transaction':_0x51c734});})[_0xa212('0x28')](function(){return db[_0xa212('0x2e')]['destroy']({'where':{'id':_0x4c58d3},'cascade':!![],'transaction':_0x51c734});})[_0xa212('0x28')](function(_0x3128f1){if(_0x3128f1===0x0){_0x33f44f[_0xa212('0x1b')](0x194);}else{return db['UserProfileResource'][_0xa212('0x60')]({'where':{'type':_0xa212('0x4e'),'resourceId':_0x4c58d3},'cascade':!![],'transaction':_0x51c734})[_0xa212('0x28')](function(){_0x33f44f['status'](0xcc)[_0xa212('0x1d')]();});}})[_0xa212('0x52')](function(_0x2520ed){_0x33f44f[_0xa212('0x1c')](0x1f4)[_0xa212('0x2c')](_0x2520ed);});});};exports[_0xa212('0x6f')]=function(_0x3932af,_0xdfc943,_0x5da1e2){return db['Team'][_0xa212('0x70')]({'where':{'id':_0x3932af['params']['id']}})[_0xa212('0x28')](handleEntityNotFound(_0xdfc943,null))[_0xa212('0x28')](function(_0x1af9c0){if(!_0x3932af[_0xa212('0x35')][_0xa212('0x71')]||!utils[_0xa212('0x72')](_0x3932af[_0xa212('0x35')]['channel'])){throw new db[(_0xa212('0x57'))][(_0xa212('0x73'))](_0xa212('0x74'));}var _0x42db99={};var _0x42075a={};_0x42075a[_0xa212('0x32')]=_['keys'](db[_[_0xa212('0x75')](_0x3932af[_0xa212('0x35')][_0xa212('0x71')][_0xa212('0x76')]())+_0xa212('0x77')]['rawAttributes']);_0x42075a[_0xa212('0x35')]=_['keys'](_0x3932af[_0xa212('0x35')]);_0x42075a[_0xa212('0x36')]=_[_0xa212('0x37')](_0x42075a[_0xa212('0x32')],_0x42075a[_0xa212('0x35')]);_0x42db99['attributes']=_['intersection'](_0x42075a['model'],qs[_0xa212('0x38')](_0x3932af['query'][_0xa212('0x38')]));_0x42db99[_0xa212('0x39')]=_0x42db99['attributes']['length']?_0x42db99[_0xa212('0x39')]:_0x42075a[_0xa212('0x32')];_0x42db99['limit']=qs[_0xa212('0x21')](_0x3932af[_0xa212('0x35')][_0xa212('0x21')]);_0x42db99['offset']=qs[_0xa212('0x1f')](_0x3932af[_0xa212('0x35')]['offset']);_0x42db99[_0xa212('0x78')]=qs['sort'](_0x3932af[_0xa212('0x35')][_0xa212('0x3d')]);_0x42db99[_0xa212('0x40')]=qs[_0xa212('0x36')](_[_0xa212('0x3e')](_0x3932af[_0xa212('0x35')],_0x42075a[_0xa212('0x36')]));_0x42db99=_[_0xa212('0x41')]({},_0x42db99,_0x3932af['options']);return _0x1af9c0[_0xa212('0x4c')+_[_0xa212('0x75')](_0x3932af[_0xa212('0x35')][_0xa212('0x71')]['toLowerCase']())+_0xa212('0x79')](_0x42db99);})[_0xa212('0x28')](respondWithResult(_0xdfc943,null))[_0xa212('0x52')](handleError(_0xdfc943,null));};exports[_0xa212('0x7a')]=function(_0x4f8ce8,_0x3c33c9,_0x46641e){return db['Team'][_0xa212('0x70')]({'where':{'id':_0x4f8ce8[_0xa212('0x47')]['id']}})[_0xa212('0x28')](function(_0x42a7e3){if(_0x42a7e3){if(!_0x4f8ce8[_0xa212('0x4b')][_0xa212('0x71')]||!utils[_0xa212('0x72')](_0x4f8ce8[_0xa212('0x4b')][_0xa212('0x71')])){throw new db[(_0xa212('0x57'))][(_0xa212('0x73'))]('Unknown\x20channel');}return _0x42a7e3[_0xa212('0x7b')+_[_0xa212('0x75')](_0x4f8ce8['body'][_0xa212('0x71')]['toLowerCase']())+_0xa212('0x79')](_0x4f8ce8[_0xa212('0x4b')][_0xa212('0x7c')]);}return null;})[_0xa212('0x28')](handleEntityNotFound(_0x3c33c9,null))[_0xa212('0x28')](respondWithStatusCode(_0x3c33c9,null))['catch'](handleError(_0x3c33c9,null));};exports[_0xa212('0x7d')]=function(_0x48768e,_0x5dbccd,_0xacb845){return db[_0xa212('0x2e')]['findOne']({'where':{'id':_0x48768e[_0xa212('0x47')]['id']}})[_0xa212('0x28')](function(_0x51340d){if(_0x51340d){if(!_0x48768e[_0xa212('0x35')]['channel']||!utils[_0xa212('0x72')](_0x48768e[_0xa212('0x35')][_0xa212('0x71')])){throw new db[(_0xa212('0x57'))][(_0xa212('0x73'))](_0xa212('0x74'));}return _0x51340d[_0xa212('0x7e')+_[_0xa212('0x75')](_0x48768e[_0xa212('0x35')][_0xa212('0x71')][_0xa212('0x76')]())+_0xa212('0x79')](_0x48768e[_0xa212('0x35')][_0xa212('0x7c')]);}return null;})[_0xa212('0x28')](handleEntityNotFound(_0x5dbccd,null))[_0xa212('0x28')](respondWithStatusCode(_0x5dbccd,null))[_0xa212('0x52')](handleError(_0x5dbccd,null));};exports[_0xa212('0x7f')]=function(_0x5a049e,_0x385c44){var _0x238ae2=_[_0xa212('0x80')](_0x5a049e[_0xa212('0x4b')][_0xa212('0x7c')])?_0x5a049e[_0xa212('0x4b')][_0xa212('0x7c')]:[_0x5a049e[_0xa212('0x4b')]['ids']];var _0x2c7aa2=_0x5a049e['params']['id'];return db[_0xa212('0x2e')][_0xa212('0x49')]({'where':{'id':_0x2c7aa2}})[_0xa212('0x28')](handleEntityNotFound(_0x385c44,null))[_0xa212('0x28')](function(_0x3af376){if(_0x3af376){var _0x8e27ce=[_0xa212('0x81'),'Chat','Mail',_0xa212('0x82'),'Fax',_0xa212('0x83'),_0xa212('0x84')];return db[_0xa212('0x54')][_0xa212('0x55')](function(_0x5a2bca){var _0x2e74fb=_[_0xa212('0x33')](_0x8e27ce,function(_0x282e60){var _0x2cd3ab={'attributes':['id',_0xa212('0x2b')]};if(_0x282e60==='Voice'){_0x2cd3ab[_0xa212('0x85')]={'attributes':[_0xa212('0x86')]};}return _0x3af376['get'+_0x282e60+'Queues'](_0x2cd3ab)[_0xa212('0x28')](function(_0x2cdb29){var _0x586fa2=_['map'](_0x2cdb29,function(_0x3c0c1c){var _0x1e1b51=_['map'](_0x238ae2,function(_0x323b48){var _0x6632b7={'where':{'UserId':_0x323b48,[_0x282e60+_0xa212('0x87')]:_0x3c0c1c['id']},'transaction':_0x5a2bca};if(_0x282e60==='Voice'){_0x6632b7['defaults']={'penalty':_0x3c0c1c[_0xa212('0x88')][_0xa212('0x86')]};}return db[_0xa212('0x89')+_0x282e60+_0xa212('0x77')]['findOrCreate'](_0x6632b7)[_0xa212('0x28')](function(){socket[_0xa212('0x8a')](_0xa212('0x4d')+_0x282e60+'Queue:save',{'UserId':_0x323b48,[_0x282e60+_0xa212('0x87')]:_0x3c0c1c['id']});if(_0x282e60!==_0xa212('0x81')){return;}return db[_0xa212('0x89')][_0xa212('0x44')]({'where':{'id':_0x238ae2,'online':0x1},'attributes':['id',_0xa212('0x2b'),'online','voicePause',_0xa212('0x8b')],'raw':!![]})[_0xa212('0x28')](function(_0x5c5376){var _0xcf473f=_[_0xa212('0x33')](_0x5c5376,function(_0x2cbffc){return db[_0xa212('0x8c')]['upsert']({'membername':_0x2cbffc[_0xa212('0x2b')],'UserId':_0x2cbffc['id'],'queue_name':_0x3c0c1c[_0xa212('0x2b')],'VoiceQueueId':_0x3c0c1c['id'],'interface':_[_0xa212('0x8d')](_0x2cbffc[_0xa212('0x8b')])?util[_0xa212('0x8e')](_0xa212('0x8f'),_0x2cbffc[_0xa212('0x2b')]):_0x2cbffc[_0xa212('0x8b')],'paused':_0x2cbffc[_0xa212('0x90')]||![],'penalty':_0x3c0c1c[_0xa212('0x88')][_0xa212('0x86')]},{'transaction':_0x5a2bca});});return Promise[_0xa212('0x91')](_0xcf473f);});});});return Promise[_0xa212('0x91')](_0x1e1b51);});return Promise[_0xa212('0x91')](_0x586fa2);})['then'](function(){return db[_0xa212('0x6c')][_0xa212('0x70')]({'where':{'teamId':_0x2c7aa2}})[_0xa212('0x28')](function(_0x1b1663){if(_0x1b1663){var _0x440822=_[_0xa212('0x33')](_0x238ae2,function(_0x43166a){db[_0xa212('0x6d')][_0xa212('0x92')]({'UserId':_0x43166a,'VoicePrefixId':_0x1b1663['VoicePrefixId']});});return Promise['all'](_0x440822);}});});});return Promise['all'](_0x2e74fb)[_0xa212('0x28')](function(){return _0x3af376['addAgents'](_0x238ae2,{'transaction':_0x5a2bca})[_0xa212('0x93')](function(_0x4b4f25){return _0x4b4f25;});});});}})[_0xa212('0x28')](respondWithResult(_0x385c44,null))[_0xa212('0x52')](handleError(_0x385c44,null));};exports[_0xa212('0x94')]=function(_0x31af57,_0x2996a5){var _0x8fd6ee=_[_0xa212('0x80')](_0x31af57['query'][_0xa212('0x7c')])?_0x31af57[_0xa212('0x35')]['ids']:[_0x31af57[_0xa212('0x35')]['ids']];var _0x3f26a1=_0x31af57[_0xa212('0x47')]['id'];return db['Team'][_0xa212('0x49')]({'where':{'id':_0x3f26a1}})[_0xa212('0x28')](handleEntityNotFound(_0x2996a5,null))[_0xa212('0x28')](function(_0x58057e){if(_0x58057e){var _0x51c710=[_0xa212('0x81'),_0xa212('0x95'),_0xa212('0x96'),_0xa212('0x82'),_0xa212('0x97'),_0xa212('0x83'),'Whatsapp'];return db[_0xa212('0x54')][_0xa212('0x55')](function(_0x3904b6){var _0xa4bc7d=_[_0xa212('0x33')](_0x51c710,function(_0x4d3d3a){var _0x5ba4ec={'attributes':['id',_0xa212('0x2b')]};return _0x58057e[_0xa212('0x4c')+_0x4d3d3a+_0xa212('0x79')](_0x5ba4ec)['then'](function(_0x52a0dd){var _0x34d6ad=_[_0xa212('0x33')](_0x52a0dd,function(_0x3b791c){return _0x3b791c[_0xa212('0x94')](_0x8fd6ee,{'transaction':_0x3904b6})[_0xa212('0x28')](function(){var _0x586d3e=_[_0xa212('0x33')](_0x8fd6ee,function(_0x17f98d){socket['emit'](_0xa212('0x4d')+_0x4d3d3a+_0xa212('0x98'),{'UserId':Number(_0x17f98d),[_0x4d3d3a+'QueueId']:_0x3b791c['id']});if(_0x4d3d3a!==_0xa212('0x81')){return;}return db[_0xa212('0x8c')]['destroy']({'where':{'VoiceQueueId':_0x3b791c['id'],'UserId':_0x17f98d},'transaction':_0x3904b6});});return Promise[_0xa212('0x91')](_0x586d3e);});});return Promise['all'](_0x34d6ad);});});return Promise[_0xa212('0x91')](_0xa4bc7d)[_0xa212('0x28')](function(){return _0x58057e[_0xa212('0x94')](_0x8fd6ee,{'transaction':_0x3904b6});})[_0xa212('0x28')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x3f26a1}})['then'](function(_0x1b87ff){if(_0x1b87ff){var _0x49e2c6=_[_0xa212('0x33')](_0x8fd6ee,function(_0x512b4c){db['UserVoicePrefix'][_0xa212('0x60')]({'where':{'UserId':_0x512b4c,'VoicePrefixId':_0x1b87ff[_0xa212('0x6e')]}});});return Promise[_0xa212('0x91')](_0x49e2c6);}});});});}})[_0xa212('0x28')](respondWithStatusCode(_0x2996a5,null))[_0xa212('0x52')](handleError(_0x2996a5,null));};exports['getAgents']=function(_0x29da88,_0x2f2200,_0x21e366){var _0x3e5295={};var _0x1e3182={};var _0x5328f3;var _0x19e284;return db[_0xa212('0x2e')][_0xa212('0x70')]({'where':{'id':_0x29da88[_0xa212('0x47')]['id']}})[_0xa212('0x28')](handleEntityNotFound(_0x2f2200,null))[_0xa212('0x28')](function(_0x53418e){if(_0x53418e){_0x5328f3=_0x53418e;_0x1e3182[_0xa212('0x32')]=_['keys'](db[_0xa212('0x89')][_0xa212('0x2f')]);_0x1e3182[_0xa212('0x35')]=_[_0xa212('0x34')](_0x29da88[_0xa212('0x35')]);_0x1e3182[_0xa212('0x36')]=_['intersection'](_0x1e3182[_0xa212('0x32')],_0x1e3182[_0xa212('0x35')]);_0x3e5295[_0xa212('0x39')]=_['intersection'](_0x1e3182[_0xa212('0x32')],qs[_0xa212('0x38')](_0x29da88[_0xa212('0x35')][_0xa212('0x38')]));_0x3e5295[_0xa212('0x39')]=_0x3e5295[_0xa212('0x39')][_0xa212('0x3a')]?_0x3e5295[_0xa212('0x39')]:_0x1e3182[_0xa212('0x32')];_0x3e5295['order']=qs['sort'](_0x29da88[_0xa212('0x35')][_0xa212('0x3d')]);_0x3e5295[_0xa212('0x40')]=qs[_0xa212('0x36')](_[_0xa212('0x3e')](_0x29da88[_0xa212('0x35')],_0x1e3182['filters']));if(_0x29da88[_0xa212('0x35')][_0xa212('0x3f')]){_0x3e5295['where']=_[_0xa212('0x41')](_0x3e5295[_0xa212('0x40')],{'$or':_[_0xa212('0x33')](_0x3e5295[_0xa212('0x39')],function(_0x13fc91){var _0x208fea={};_0x208fea[_0x13fc91]={'$like':'%'+_0x29da88[_0xa212('0x35')][_0xa212('0x3f')]+'%'};return _0x208fea;})});}_0x3e5295=_[_0xa212('0x41')]({},_0x3e5295,_0x29da88[_0xa212('0x99')]);return _0x5328f3[_0xa212('0x9a')](_0x3e5295);}})[_0xa212('0x28')](function(_0x5b2302){if(_0x5b2302){_0x19e284=_0x5b2302[_0xa212('0x3a')];if(!_0x29da88[_0xa212('0x35')][_0xa212('0x3b')](_0xa212('0x3c'))){_0x3e5295[_0xa212('0x21')]=qs[_0xa212('0x21')](_0x29da88['query'][_0xa212('0x21')]);_0x3e5295[_0xa212('0x1f')]=qs[_0xa212('0x1f')](_0x29da88[_0xa212('0x35')][_0xa212('0x1f')]);}return _0x5328f3['getAgents'](_0x3e5295);}})[_0xa212('0x28')](function(_0x1d40b5){if(_0x1d40b5){return _0x1d40b5?{'count':_0x19e284,'rows':_0x1d40b5}:null;}})[_0xa212('0x28')](respondWithResult(_0x2f2200,null))[_0xa212('0x52')](handleError(_0x2f2200,null));};
\ No newline at end of file
index e577e85..1b450e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe04a=['../../mysqldb','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x364d69,_0x49dd61){var _0x44ede3=function(_0x307d93){while(--_0x307d93){_0x364d69['push'](_0x364d69['shift']());}};_0x44ede3(++_0x49dd61);}(_0xe04a,0x1aa));var _0xae04=function(_0x527ce2,_0x4b80b6){_0x527ce2=_0x527ce2-0x0;var _0x409b7a=_0xe04a[_0x527ce2];return _0x409b7a;};'use strict';var EventEmitter=require(_0xae04('0x0'));var Team=require(_0xae04('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xae04('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xae04('0x3'),'afterDestroy':_0xae04('0x4')};function emitEvent(_0x36925f){return function(_0x169773,_0x564ad6,_0x268b08){TeamEvents['emit'](_0x36925f+':'+_0x169773['id'],_0x169773);TeamEvents['emit'](_0x36925f,_0x169773);_0x268b08(null);};}for(var e in events){if(events[_0xae04('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xae04('0x6')]=TeamEvents;
\ No newline at end of file
+var _0xb2fc=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Team'];(function(_0x47d928,_0x469fd5){var _0x249745=function(_0x40bc03){while(--_0x40bc03){_0x47d928['push'](_0x47d928['shift']());}};_0x249745(++_0x469fd5);}(_0xb2fc,0x14a));var _0xcb2f=function(_0x241278,_0x225c3f){_0x241278=_0x241278-0x0;var _0x34033b=_0xb2fc[_0x241278];return _0x34033b;};'use strict';var EventEmitter=require(_0xcb2f('0x0'));var Team=require(_0xcb2f('0x1'))['db'][_0xcb2f('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcb2f('0x3'),'afterUpdate':'update','afterDestroy':_0xcb2f('0x4')};function emitEvent(_0x4f663e){return function(_0x240bb2,_0x3ddf47,_0x5f44a2){TeamEvents[_0xcb2f('0x5')](_0x4f663e+':'+_0x240bb2['id'],_0x240bb2);TeamEvents['emit'](_0x4f663e,_0x240bb2);_0x5f44a2(null);};}for(var e in events){if(events[_0xcb2f('0x6')](e)){var event=events[e];Team[_0xcb2f('0x7')](e,emitEvent(event));}}module[_0xcb2f('0x8')]=TeamEvents;
\ No newline at end of file
index 8433cf7..e898d8f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8306=['./team.attributes','get','Queues','setDataValue','channel','catch','exports','Team','Fax','Mail','Sms','Whatsapp','resolve','then','map','lodash'];(function(_0xbfc859,_0x38c2a5){var _0x5bf43d=function(_0x45785a){while(--_0x45785a){_0xbfc859['push'](_0xbfc859['shift']());}};_0x5bf43d(++_0x38c2a5);}(_0x8306,0x15f));var _0x6830=function(_0x8393ff,_0x2f4dbe){_0x8393ff=_0x8393ff-0x0;var _0x2fbfb5=_0x8306[_0x8393ff];return _0x2fbfb5;};'use strict';var _=require(_0x6830('0x0'));var attributes=require(_0x6830('0x1'));function getQueuesByChannel(_0x496981,_0x5de930){var _0x20db5c=_0x6830('0x2')+_0x5de930+_0x6830('0x3');return _0x496981[_0x20db5c]()['then'](function(_0x306778){return _['map'](_0x306778,function(_0x3e84de){_0x3e84de[_0x6830('0x4')](_0x6830('0x5'),_0x5de930);return _0x3e84de;});})[_0x6830('0x6')](function(_0x1f6ec9){throw _0x1f6ec9;});}module[_0x6830('0x7')]=function(_0x15fdc5){return _0x15fdc5['define'](_0x6830('0x8'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x575bb6=this;var _0x1e5d41=['Chat',_0x6830('0x9'),_0x6830('0xa'),'Openchannel',_0x6830('0xb'),'Voice',_0x6830('0xc')];return Promise[_0x6830('0xd')]()[_0x6830('0xe')](function(){var _0x54d5c6=_[_0x6830('0xf')](_0x1e5d41,function(_0x384c60){return getQueuesByChannel(_0x575bb6,_0x384c60);});return Promise['all'](_0x54d5c6);})[_0x6830('0x6')](function(_0x9796eb){throw _0x9796eb;});}}});};
\ No newline at end of file
+var _0xf63c=['Openchannel','Sms','Voice','Whatsapp','resolve','map','all','catch','lodash','./team.attributes','Queues','then','setDataValue','channel','exports','define','Team','teams','Fax','Mail'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0xf63c,0x15c));var _0xcf63=function(_0xade05a,_0x5b1d96){_0xade05a=_0xade05a-0x0;var _0x5475fd=_0xf63c[_0xade05a];return _0x5475fd;};'use strict';var _=require(_0xcf63('0x0'));var attributes=require(_0xcf63('0x1'));function getQueuesByChannel(_0xd0aed7,_0x5800db){var _0x583833='get'+_0x5800db+_0xcf63('0x2');return _0xd0aed7[_0x583833]()[_0xcf63('0x3')](function(_0x4a423b){return _['map'](_0x4a423b,function(_0x56d76c){_0x56d76c[_0xcf63('0x4')](_0xcf63('0x5'),_0x5800db);return _0x56d76c;});})['catch'](function(_0x4b1f88){throw _0x4b1f88;});}module[_0xcf63('0x6')]=function(_0x20a4c2){return _0x20a4c2[_0xcf63('0x7')](_0xcf63('0x8'),attributes,{'tableName':_0xcf63('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5c2fa5=this;var _0x160100=['Chat',_0xcf63('0xa'),_0xcf63('0xb'),_0xcf63('0xc'),_0xcf63('0xd'),_0xcf63('0xe'),_0xcf63('0xf')];return Promise[_0xcf63('0x10')]()['then'](function(){var _0x2489b8=_[_0xcf63('0x11')](_0x160100,function(_0x330d2d){return getQueuesByChannel(_0x5c2fa5,_0x330d2d);});return Promise[_0xcf63('0x12')](_0x2489b8);})[_0xcf63('0x13')](function(_0x364fb4){throw _0x364fb4;});}}});};
\ No newline at end of file
index 633f2f7..343d84c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d79=['code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','localhost','socket.io-emitter','redis','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x26e873,_0x2449b5){var _0x304d21=function(_0xece3cd){while(--_0xece3cd){_0x26e873['push'](_0x26e873['shift']());}};_0x304d21(++_0x2449b5);}(_0x9d79,0x79));var _0x99d7=function(_0x301d7a,_0x562552){_0x301d7a=_0x301d7a-0x0;var _0xcec011=_0x9d79[_0x301d7a];return _0xcec011;};'use strict';var _=require(_0x99d7('0x0'));var util=require(_0x99d7('0x1'));var moment=require(_0x99d7('0x2'));var BPromise=require(_0x99d7('0x3'));var rs=require(_0x99d7('0x4'));var fs=require('fs');var Redis=require(_0x99d7('0x5'));var db=require(_0x99d7('0x6'))['db'];var utils=require(_0x99d7('0x7'));var logger=require(_0x99d7('0x8'))('rpc');var config=require(_0x99d7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x99d7('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x99d7('0xb'),'port':0x18eb});var socket=require(_0x99d7('0xc'))(new Redis(config[_0x99d7('0xd')]));require(_0x99d7('0xe'))[_0x99d7('0xf')](socket);function respondWithRpcPromise(_0x47cd07,_0xe6a91a,_0x5ae047){return new BPromise(function(_0x14221a,_0x1183db){return client[_0x99d7('0x10')](_0x47cd07,_0x5ae047)[_0x99d7('0x11')](function(_0x5ca47a){logger['info'](_0x99d7('0x12'),_0xe6a91a,_0x99d7('0x13'));logger[_0x99d7('0x14')](_0x99d7('0x15'),_0xe6a91a,'request\x20sent',JSON[_0x99d7('0x16')](_0x5ca47a));if(_0x5ca47a[_0x99d7('0x17')]){if(_0x5ca47a[_0x99d7('0x17')][_0x99d7('0x18')]===0x1f4){logger[_0x99d7('0x17')](_0x99d7('0x12'),_0xe6a91a,_0x5ca47a[_0x99d7('0x17')][_0x99d7('0x19')]);return _0x1183db(_0x5ca47a[_0x99d7('0x17')]['message']);}logger[_0x99d7('0x17')](_0x99d7('0x12'),_0xe6a91a,_0x5ca47a['error'][_0x99d7('0x19')]);return _0x14221a(_0x5ca47a[_0x99d7('0x17')][_0x99d7('0x19')]);}else{logger[_0x99d7('0x1a')](_0x99d7('0x12'),_0xe6a91a,_0x99d7('0x13'));_0x14221a(_0x5ca47a[_0x99d7('0x1b')]['message']);}})[_0x99d7('0x1c')](function(_0x185fe7){logger[_0x99d7('0x17')](_0x99d7('0x12'),_0xe6a91a,_0x185fe7);_0x1183db(_0x185fe7);});});}
\ No newline at end of file
+var _0x6d70=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','Team,\x20%s,\x20%s'];(function(_0xa2db7,_0x1bd5f0){var _0x59c5f9=function(_0x3bbeeb){while(--_0x3bbeeb){_0xa2db7['push'](_0xa2db7['shift']());}};_0x59c5f9(++_0x1bd5f0);}(_0x6d70,0x18b));var _0x06d7=function(_0x37adbe,_0x19fb75){_0x37adbe=_0x37adbe-0x0;var _0x534e43=_0x6d70[_0x37adbe];return _0x534e43;};'use strict';var _=require(_0x06d7('0x0'));var util=require(_0x06d7('0x1'));var moment=require('moment');var BPromise=require(_0x06d7('0x2'));var rs=require(_0x06d7('0x3'));var fs=require('fs');var Redis=require(_0x06d7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x06d7('0x5'));var logger=require('../../config/logger')(_0x06d7('0x6'));var config=require('../../config/environment');var jayson=require(_0x06d7('0x7'));var client=jayson[_0x06d7('0x8')][_0x06d7('0x9')]({'port':0x232a});config[_0x06d7('0xa')]=_[_0x06d7('0xb')](config[_0x06d7('0xa')],{'host':_0x06d7('0xc'),'port':0x18eb});var socket=require(_0x06d7('0xd'))(new Redis(config[_0x06d7('0xa')]));require(_0x06d7('0xe'))['register'](socket);function respondWithRpcPromise(_0x35b6f5,_0x2956c6,_0x11215c){return new BPromise(function(_0xb32781,_0x57a7b8){return client[_0x06d7('0xf')](_0x35b6f5,_0x11215c)[_0x06d7('0x10')](function(_0x44889c){logger[_0x06d7('0x11')]('Team,\x20%s,\x20%s',_0x2956c6,_0x06d7('0x12'));logger[_0x06d7('0x13')](_0x06d7('0x14'),_0x2956c6,_0x06d7('0x12'),JSON[_0x06d7('0x15')](_0x44889c));if(_0x44889c['error']){if(_0x44889c[_0x06d7('0x16')][_0x06d7('0x17')]===0x1f4){logger['error'](_0x06d7('0x18'),_0x2956c6,_0x44889c[_0x06d7('0x16')][_0x06d7('0x19')]);return _0x57a7b8(_0x44889c[_0x06d7('0x16')][_0x06d7('0x19')]);}logger[_0x06d7('0x16')](_0x06d7('0x18'),_0x2956c6,_0x44889c[_0x06d7('0x16')][_0x06d7('0x19')]);return _0xb32781(_0x44889c[_0x06d7('0x16')]['message']);}else{logger['info'](_0x06d7('0x18'),_0x2956c6,_0x06d7('0x12'));_0xb32781(_0x44889c[_0x06d7('0x1a')]['message']);}})[_0x06d7('0x1b')](function(_0xa3b677){logger['error'](_0x06d7('0x18'),_0x2956c6,_0xa3b677);_0x57a7b8(_0xa3b677);});});}
\ No newline at end of file
index 55b524c..bba9858 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa42e=['emit','removeListener','length','team:','./team.events','remove','update'];(function(_0x18c530,_0x1ef42a){var _0x560b6d=function(_0x56b3c){while(--_0x56b3c){_0x18c530['push'](_0x18c530['shift']());}};_0x560b6d(++_0x1ef42a);}(_0xa42e,0xba));var _0xea42=function(_0xfd95eb,_0x3ac56d){_0xfd95eb=_0xfd95eb-0x0;var _0x5e2c66=_0xa42e[_0xfd95eb];return _0x5e2c66;};'use strict';var TeamEvents=require(_0xea42('0x0'));var events=['save',_0xea42('0x1'),_0xea42('0x2')];function createListener(_0x58c225,_0x55e7c7){return function(_0x59ce30){_0x55e7c7[_0xea42('0x3')](_0x58c225,_0x59ce30);};}function removeListener(_0x547b89,_0x161d89){return function(){TeamEvents[_0xea42('0x4')](_0x547b89,_0x161d89);};}exports['register']=function(_0x193d30){for(var _0x5437fa=0x0,_0x4ae432=events[_0xea42('0x5')];_0x5437fa<_0x4ae432;_0x5437fa++){var _0x5c22d1=events[_0x5437fa];var _0x488eea=createListener(_0xea42('0x6')+_0x5c22d1,_0x193d30);TeamEvents['on'](_0x5c22d1,_0x488eea);}};
\ No newline at end of file
+var _0x7d06=['./team.events','save','remove','update','emit','removeListener','length','team:'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x7d06,0x158));var _0x67d0=function(_0x58aeda,_0x3206ca){_0x58aeda=_0x58aeda-0x0;var _0x4e96b4=_0x7d06[_0x58aeda];return _0x4e96b4;};'use strict';var TeamEvents=require(_0x67d0('0x0'));var events=[_0x67d0('0x1'),_0x67d0('0x2'),_0x67d0('0x3')];function createListener(_0x362738,_0x5c7201){return function(_0x3a80da){_0x5c7201[_0x67d0('0x4')](_0x362738,_0x3a80da);};}function removeListener(_0x2fa05c,_0x58e193){return function(){TeamEvents[_0x67d0('0x5')](_0x2fa05c,_0x58e193);};}exports['register']=function(_0x1ba2b3){for(var _0x1f4dc9=0x0,_0x367f1d=events[_0x67d0('0x6')];_0x1f4dc9<_0x367f1d;_0x1f4dc9++){var _0x3c9976=events[_0x1f4dc9];var _0x481a08=createListener(_0x67d0('0x7')+_0x3c9976,_0x1ba2b3);TeamEvents['on'](_0x3c9976,_0x481a08);}};
\ No newline at end of file
index 5e4fccd..dc971da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37a4=['INTEGER','sequelize'];(function(_0x2582e6,_0x1c15f1){var _0x391e57=function(_0x500b87){while(--_0x500b87){_0x2582e6['push'](_0x2582e6['shift']());}};_0x391e57(++_0x1c15f1);}(_0x37a4,0xcb));var _0x437a=function(_0x1a66d1,_0x2f34f9){_0x1a66d1=_0x1a66d1-0x0;var _0x40cd27=_0x37a4[_0x1a66d1];return _0x40cd27;};'use strict';var Sequelize=require(_0x437a('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x437a('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x5ed3=['exports','INTEGER','sequelize'];(function(_0x4ce310,_0x489712){var _0x4434e2=function(_0x285026){while(--_0x285026){_0x4ce310['push'](_0x4ce310['shift']());}};_0x4434e2(++_0x489712);}(_0x5ed3,0x9e));var _0x35ed=function(_0x3b6e6b,_0x33d90f){_0x3b6e6b=_0x3b6e6b-0x0;var _0x5dbfcd=_0x5ed3[_0x3b6e6b];return _0x5dbfcd;};'use strict';var Sequelize=require(_0x35ed('0x0'));module[_0x35ed('0x1')]={'TeamId':{'type':Sequelize[_0x35ed('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x35ed('0x2')]}};
\ No newline at end of file
index 20f13a9..89171de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x082b=['api','bluebird','request-promise','rimraf','../../config/environment','exports','define','team_has_voice_prefixes','lodash','util','../../config/logger'];(function(_0x5445a4,_0x30be95){var _0xb17872=function(_0x6f55aa){while(--_0x6f55aa){_0x5445a4['push'](_0x5445a4['shift']());}};_0xb17872(++_0x30be95);}(_0x082b,0x1ec));var _0xb082=function(_0x74bcc6,_0x38d8fd){_0x74bcc6=_0x74bcc6-0x0;var _0x1de813=_0x082b[_0x74bcc6];return _0x1de813;};'use strict';var _=require(_0xb082('0x0'));var util=require(_0xb082('0x1'));var logger=require(_0xb082('0x2'))(_0xb082('0x3'));var moment=require('moment');var BPromise=require(_0xb082('0x4'));var rp=require(_0xb082('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb082('0x6'));var config=require(_0xb082('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0xb082('0x8')]=function(_0x37b715,_0x16e0b8){return _0x37b715[_0xb082('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0xb082('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x69d3=['../../config/logger','moment','bluebird','rimraf','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x69d3,0xda));var _0x369d=function(_0x10c6f,_0x73a42c){_0x10c6f=_0x10c6f-0x0;var _0x3ea406=_0x69d3[_0x10c6f];return _0x3ea406;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var logger=require(_0x369d('0x2'))('api');var moment=require(_0x369d('0x3'));var BPromise=require(_0x369d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x369d('0x5'));var config=require('../../config/environment');var attributes=require('./teamVoicePrefix.attributes');module[_0x369d('0x6')]=function(_0x2f2a53,_0x18c9f1){return _0x2f2a53[_0x369d('0x7')](_0x369d('0x8'),attributes,{'tableName':_0x369d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8a4ee3a..fe081ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4643da,_0x5939f1){var _0x2f7b89=function(_0x2ac157){while(--_0x2ac157){_0x4643da['push'](_0x4643da['shift']());}};_0x2f7b89(++_0x5939f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xfaa7fb,_0x15fba4){var _0x17d46c=function(_0xbbbad9){while(--_0xbbbad9){_0xfaa7fb['push'](_0xfaa7fb['shift']());}};_0x17d46c(++_0x15fba4);}(_0x70e0,0x17b));var _0x070e=function(_0x3ff30e,_0x1603af){_0x3ff30e=_0x3ff30e-0x0;var _0x37ab59=_0x70e0[_0x3ff30e];return _0x37ab59;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index e6e65b8..e28b9e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x307e=['INTEGER'];(function(_0x3c6d35,_0x40d855){var _0x16510e=function(_0x347d16){while(--_0x347d16){_0x3c6d35['push'](_0x3c6d35['shift']());}};_0x16510e(++_0x40d855);}(_0x307e,0x1ec));var _0xe307=function(_0xca96cf,_0x12408){_0xca96cf=_0xca96cf-0x0;var _0x6ab1c8=_0x307e[_0xca96cf];return _0x6ab1c8;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xe307('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0e3a=['exports','INTEGER'];(function(_0x434563,_0xed19a1){var _0x14128e=function(_0x1fa1b6){while(--_0x1fa1b6){_0x434563['push'](_0x434563['shift']());}};_0x14128e(++_0xed19a1);}(_0x0e3a,0x1c6));var _0xa0e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e3a[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module[_0xa0e3('0x0')]={'penalty':{'type':Sequelize[_0xa0e3('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 34ae027..eb2aa9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3be=['team_has_voice_queues','lodash','util','../../config/logger','api','bluebird','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x1a3255,_0xb5ed83){var _0x2866a7=function(_0x19c4aa){while(--_0x19c4aa){_0x1a3255['push'](_0x1a3255['shift']());}};_0x2866a7(++_0xb5ed83);}(_0xf3be,0x1e1));var _0xef3b=function(_0x4a14f6,_0x5676ab){_0x4a14f6=_0x4a14f6-0x0;var _0x5239ef=_0xf3be[_0x4a14f6];return _0x5239ef;};'use strict';var _=require(_0xef3b('0x0'));var util=require(_0xef3b('0x1'));var logger=require(_0xef3b('0x2'))(_0xef3b('0x3'));var moment=require('moment');var BPromise=require(_0xef3b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef3b('0x5'));module[_0xef3b('0x6')]=function(_0x48f499,_0x3dfcc2){return _0x48f499[_0xef3b('0x7')](_0xef3b('0x8'),attributes,{'tableName':_0xef3b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f99=['define','team_has_voice_queues','lodash','util','api','moment','bluebird','path','rimraf','./teamVoiceQueue.attributes','exports'];(function(_0x413727,_0x17adb1){var _0x5f46d7=function(_0xbb668e){while(--_0xbb668e){_0x413727['push'](_0x413727['shift']());}};_0x5f46d7(++_0x17adb1);}(_0x4f99,0x157));var _0x94f9=function(_0x11dd48,_0x4531a4){_0x11dd48=_0x11dd48-0x0;var _0x11222c=_0x4f99[_0x11dd48];return _0x11222c;};'use strict';var _=require(_0x94f9('0x0'));var util=require(_0x94f9('0x1'));var logger=require('../../config/logger')(_0x94f9('0x2'));var moment=require(_0x94f9('0x3'));var BPromise=require(_0x94f9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x94f9('0x5'));var rimraf=require(_0x94f9('0x6'));var config=require('../../config/environment');var attributes=require(_0x94f9('0x7'));module[_0x94f9('0x8')]=function(_0x36d91c,_0x253a79){return _0x36d91c[_0x94f9('0x9')]('TeamVoiceQueue',attributes,{'tableName':_0x94f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7ac6912..c7517c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e5d=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0xd6f3de,_0x459c30){var _0x3e119b=function(_0x39f107){while(--_0x39f107){_0xd6f3de['push'](_0xd6f3de['shift']());}};_0x3e119b(++_0x459c30);}(_0x4e5d,0x152));var _0xd4e5=function(_0x211f66,_0x6d409f){_0x211f66=_0x211f66-0x0;var _0x324240=_0x4e5d[_0x211f66];return _0x324240;};'use strict';var _=require(_0xd4e5('0x0'));var util=require('util');var moment=require(_0xd4e5('0x1'));var BPromise=require(_0xd4e5('0x2'));var rs=require(_0xd4e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4e5('0x4'))['db'];var utils=require(_0xd4e5('0x5'));var logger=require('../../config/logger')(_0xd4e5('0x6'));var config=require(_0xd4e5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd4e5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ccbf3,_0x5a723c,_0x2858d5){return new BPromise(function(_0x52d62e,_0x1bf4ef){return client[_0xd4e5('0x9')](_0x3ccbf3,_0x2858d5)[_0xd4e5('0xa')](function(_0x18a95f){logger[_0xd4e5('0xb')](_0xd4e5('0xc'),_0x5a723c,_0xd4e5('0xd'));logger[_0xd4e5('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x5a723c,_0xd4e5('0xd'),JSON[_0xd4e5('0xf')](_0x18a95f));if(_0x18a95f['error']){if(_0x18a95f[_0xd4e5('0x10')][_0xd4e5('0x11')]===0x1f4){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x5a723c,_0x18a95f[_0xd4e5('0x10')]['message']);return _0x1bf4ef(_0x18a95f[_0xd4e5('0x10')][_0xd4e5('0x12')]);}logger[_0xd4e5('0x10')](_0xd4e5('0xc'),_0x5a723c,_0x18a95f[_0xd4e5('0x10')]['message']);return _0x52d62e(_0x18a95f[_0xd4e5('0x10')][_0xd4e5('0x12')]);}else{logger[_0xd4e5('0xb')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a723c,_0xd4e5('0xd'));_0x52d62e(_0x18a95f[_0xd4e5('0x13')][_0xd4e5('0x12')]);}})[_0xd4e5('0x14')](function(_0x3fbd37){logger[_0xd4e5('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5a723c,_0x3fbd37);_0x1bf4ef(_0x3fbd37);});});}
\ No newline at end of file
+var _0xdfb5=['TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2383c3,_0x4fd9de){var _0x2cadbc=function(_0x2d0810){while(--_0x2d0810){_0x2383c3['push'](_0x2383c3['shift']());}};_0x2cadbc(++_0x4fd9de);}(_0xdfb5,0x8a));var _0x5dfb=function(_0x5efd07,_0x4a7b72){_0x5efd07=_0x5efd07-0x0;var _0x21c9f3=_0xdfb5[_0x5efd07];return _0x21c9f3;};'use strict';var _=require(_0x5dfb('0x0'));var util=require('util');var moment=require(_0x5dfb('0x1'));var BPromise=require(_0x5dfb('0x2'));var rs=require(_0x5dfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dfb('0x4'))['db'];var utils=require(_0x5dfb('0x5'));var logger=require(_0x5dfb('0x6'))(_0x5dfb('0x7'));var config=require('../../config/environment');var jayson=require(_0x5dfb('0x8'));var client=jayson[_0x5dfb('0x9')][_0x5dfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xae7f0e,_0x53c72b,_0x18db16){return new BPromise(function(_0x37eeb0,_0x419549){return client[_0x5dfb('0xb')](_0xae7f0e,_0x18db16)[_0x5dfb('0xc')](function(_0x9fe518){logger['info'](_0x5dfb('0xd'),_0x53c72b,_0x5dfb('0xe'));logger[_0x5dfb('0xf')](_0x5dfb('0x10'),_0x53c72b,_0x5dfb('0xe'),JSON['stringify'](_0x9fe518));if(_0x9fe518[_0x5dfb('0x11')]){if(_0x9fe518['error'][_0x5dfb('0x12')]===0x1f4){logger[_0x5dfb('0x11')](_0x5dfb('0xd'),_0x53c72b,_0x9fe518[_0x5dfb('0x11')]['message']);return _0x419549(_0x9fe518['error'][_0x5dfb('0x13')]);}logger[_0x5dfb('0x11')](_0x5dfb('0xd'),_0x53c72b,_0x9fe518['error'][_0x5dfb('0x13')]);return _0x37eeb0(_0x9fe518[_0x5dfb('0x11')]['message']);}else{logger['info'](_0x5dfb('0xd'),_0x53c72b,_0x5dfb('0xe'));_0x37eeb0(_0x9fe518[_0x5dfb('0x14')][_0x5dfb('0x13')]);}})[_0x5dfb('0x15')](function(_0x5596af){logger[_0x5dfb('0x11')](_0x5dfb('0xd'),_0x53c72b,_0x5596af);_0x419549(_0x5596af);});});}
\ No newline at end of file
index 06fa19e..f6d0bcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x3b9b48,_0x520d45){var _0x1828cb=function(_0x264541){while(--_0x264541){_0x3b9b48['push'](_0x3b9b48['shift']());}};_0x1828cb(++_0x520d45);}(_0xf8f2,0xc2));var _0x2f8f=function(_0x4a3bd4,_0x4205ec){_0x4a3bd4=_0x4a3bd4-0x0;var _0x246fb9=_0xf8f2[_0x4a3bd4];return _0x246fb9;};'use strict';var multer=require(_0x2f8f('0x0'));var util=require(_0x2f8f('0x1'));var path=require(_0x2f8f('0x2'));var timeout=require(_0x2f8f('0x3'));var express=require('express');var router=express[_0x2f8f('0x4')]();var fs_extra=require(_0x2f8f('0x5'));var auth=require(_0x2f8f('0x6'));var interaction=require(_0x2f8f('0x7'));var config=require(_0x2f8f('0x8'));var controller=require('./template.controller');router[_0x2f8f('0x9')]('/',auth[_0x2f8f('0xa')](),controller[_0x2f8f('0xb')]);router[_0x2f8f('0x9')](_0x2f8f('0xc'),auth[_0x2f8f('0xa')](),controller[_0x2f8f('0xd')]);router[_0x2f8f('0xe')]('/',auth['isAuthenticated'](),controller[_0x2f8f('0xf')]);router[_0x2f8f('0x10')](_0x2f8f('0xc'),auth[_0x2f8f('0xa')](),controller['update']);router[_0x2f8f('0x11')](_0x2f8f('0xc'),auth['isAuthenticated'](),controller[_0x2f8f('0x12')]);module[_0x2f8f('0x13')]=router;
\ No newline at end of file
+var _0xebcd=['../../config/environment','./template.controller','get','isAuthenticated','index','create','put','/:id','update','delete','destroy','exports','multer','path','Router','../../components/auth/service'];(function(_0x137f1a,_0x2887df){var _0x439923=function(_0x3d3075){while(--_0x3d3075){_0x137f1a['push'](_0x137f1a['shift']());}};_0x439923(++_0x2887df);}(_0xebcd,0x18c));var _0xdebc=function(_0x1f1a97,_0xadfc15){_0x1f1a97=_0x1f1a97-0x0;var _0x29fc6a=_0xebcd[_0x1f1a97];return _0x29fc6a;};'use strict';var multer=require(_0xdebc('0x0'));var util=require('util');var path=require(_0xdebc('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdebc('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xdebc('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdebc('0x4'));var controller=require(_0xdebc('0x5'));router[_0xdebc('0x6')]('/',auth[_0xdebc('0x7')](),controller[_0xdebc('0x8')]);router[_0xdebc('0x6')]('/:id',auth[_0xdebc('0x7')](),controller['show']);router['post']('/',auth[_0xdebc('0x7')](),controller[_0xdebc('0x9')]);router[_0xdebc('0xa')](_0xdebc('0xb'),auth[_0xdebc('0x7')](),controller[_0xdebc('0xc')]);router[_0xdebc('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xdebc('0xe')]);module[_0xdebc('0xf')]=router;
\ No newline at end of file
index c0accef..54514a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f8=['sequelize','TEXT'];(function(_0x5f3caa,_0x4f8417){var _0x57097a=function(_0x3b742b){while(--_0x3b742b){_0x5f3caa['push'](_0x5f3caa['shift']());}};_0x57097a(++_0x4f8417);}(_0xe1f8,0x17c));var _0x8e1f=function(_0x29b75d,_0x59a909){_0x29b75d=_0x29b75d-0x0;var _0x5f02ae=_0xe1f8[_0x29b75d];return _0x5f02ae;};'use strict';var Sequelize=require(_0x8e1f('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x8e1f('0x1')]}};
\ No newline at end of file
+var _0x262b=['exports','STRING','sequelize'];(function(_0x59216e,_0x867c5b){var _0x20e424=function(_0xcef8f2){while(--_0xcef8f2){_0x59216e['push'](_0x59216e['shift']());}};_0x20e424(++_0x867c5b);}(_0x262b,0x1d6));var _0xb262=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x262b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb262('0x0'));module[_0xb262('0x1')]={'name':{'type':Sequelize[_0xb262('0x2')]},'description':{'type':Sequelize[_0xb262('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 55aa5ed..6ef8fb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3811=['../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','get','Templates','then','sendStatus','error','send','index','Template','rawAttributes','fieldName','type','key','model','map','name','query','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','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','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../config/license/hardware','../../config/utils','../../config/license/util'];(function(_0x3ccdf8,_0x584ceb){var _0x243dab=function(_0x1a90d1){while(--_0x1a90d1){_0x3ccdf8['push'](_0x3ccdf8['shift']());}};_0x243dab(++_0x584ceb);}(_0x3811,0xe6));var _0x1381=function(_0x35b2c3,_0x2156d3){_0x35b2c3=_0x35b2c3-0x0;var _0x1da291=_0x3811[_0x35b2c3];return _0x1da291;};'use strict';var emlformat=require(_0x1381('0x0'));var rimraf=require(_0x1381('0x1'));var zipdir=require(_0x1381('0x2'));var jsonpatch=require(_0x1381('0x3'));var rp=require(_0x1381('0x4'));var moment=require(_0x1381('0x5'));var BPromise=require(_0x1381('0x6'));var Mustache=require(_0x1381('0x7'));var util=require(_0x1381('0x8'));var path=require(_0x1381('0x9'));var sox=require(_0x1381('0xa'));var csv=require('to-csv');var ejs=require(_0x1381('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1381('0xc'));var squel=require(_0x1381('0xd'));var crypto=require('crypto');var jsforce=require(_0x1381('0xe'));var deskjs=require(_0x1381('0xf'));var toCsv=require(_0x1381('0x10'));var querystring=require('querystring');var Papa=require(_0x1381('0x11'));var Redis=require(_0x1381('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1381('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1381('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1381('0x15'));var db=require(_0x1381('0x16'))['db'];function respondWithStatusCode(_0x48e304,_0x4149d6){_0x4149d6=_0x4149d6||0xcc;return function(_0x1d421b){if(_0x1d421b){return _0x48e304['sendStatus'](_0x4149d6);}return _0x48e304[_0x1381('0x17')](_0x4149d6)[_0x1381('0x18')]();};}function respondWithResult(_0x598f33,_0x538c27){_0x538c27=_0x538c27||0xc8;return function(_0x4763cb){if(_0x4763cb){return _0x598f33['status'](_0x538c27)[_0x1381('0x19')](_0x4763cb);}};}function respondWithFilteredResult(_0x483aeb,_0x55b094){return function(_0x5641f3){if(_0x5641f3){var _0x1987c6=typeof _0x55b094[_0x1381('0x1a')]===_0x1381('0x1b')&&typeof _0x55b094[_0x1381('0x1c')]===_0x1381('0x1b');var _0x4fa36d=_0x5641f3[_0x1381('0x1d')];var _0x365da0=_0x1987c6?0x0:_0x55b094[_0x1381('0x1a')];var _0xed4ee8=_0x1987c6?_0x5641f3[_0x1381('0x1d')]:_0x55b094[_0x1381('0x1a')]+_0x55b094[_0x1381('0x1c')];var _0x3889e2;if(_0xed4ee8>=_0x4fa36d){_0xed4ee8=_0x4fa36d;_0x3889e2=0xc8;}else{_0x3889e2=0xce;}_0x483aeb[_0x1381('0x17')](_0x3889e2);return _0x483aeb[_0x1381('0x1e')](_0x1381('0x1f'),_0x365da0+'-'+_0xed4ee8+'/'+_0x4fa36d)['json'](_0x5641f3);}return null;};}function patchUpdates(_0x303701){return function(_0x192506){try{jsonpatch[_0x1381('0x20')](_0x192506,_0x303701,!![]);}catch(_0x41aab1){return BPromise['reject'](_0x41aab1);}return _0x192506[_0x1381('0x21')]();};}function saveUpdates(_0x46b2ba,_0x2b1ea2){return function(_0x2ebefe){if(_0x2ebefe){return _0x2ebefe[_0x1381('0x22')](_0x46b2ba)['then'](function(_0x28f12c){return _0x28f12c;});}return null;};}function removeEntity(_0x263249,_0x56e5b6){return function(_0xe0c928){if(_0xe0c928){return _0xe0c928['destroy']()['then'](function(){var _0x1385c7=_0xe0c928[_0x1381('0x23')]({'plain':!![]});var _0x55e9fe=_0x1381('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x55e9fe,'resourceId':_0x1385c7['id']}})[_0x1381('0x25')](function(){return _0xe0c928;});})['then'](function(){_0x263249[_0x1381('0x17')](0xcc)[_0x1381('0x18')]();});}};}function handleEntityNotFound(_0x421064,_0x3a5c71){return function(_0x36a614){if(!_0x36a614){_0x421064[_0x1381('0x26')](0x194);}return _0x36a614;};}function handleError(_0x2723b3,_0x19b5c2){_0x19b5c2=_0x19b5c2||0x1f4;return function(_0xa6e039){logger[_0x1381('0x27')](_0xa6e039['stack']);if(_0xa6e039['name']){delete _0xa6e039['name'];}_0x2723b3[_0x1381('0x17')](_0x19b5c2)[_0x1381('0x28')](_0xa6e039);};}exports[_0x1381('0x29')]=function(_0x1c7b58,_0x191142){var _0x423eb7={},_0x43528b={},_0x514970={'count':0x0,'rows':[]};var _0x55d922=_['map'](db[_0x1381('0x2a')][_0x1381('0x2b')],function(_0x42f5c4){return{'name':_0x42f5c4[_0x1381('0x2c')],'type':_0x42f5c4[_0x1381('0x2d')][_0x1381('0x2e')]};});_0x43528b[_0x1381('0x2f')]=_[_0x1381('0x30')](_0x55d922,_0x1381('0x31'));_0x43528b[_0x1381('0x32')]=_['keys'](_0x1c7b58[_0x1381('0x32')]);_0x43528b[_0x1381('0x33')]=_['intersection'](_0x43528b[_0x1381('0x2f')],_0x43528b[_0x1381('0x32')]);_0x423eb7[_0x1381('0x34')]=_[_0x1381('0x35')](_0x43528b[_0x1381('0x2f')],qs['fields'](_0x1c7b58[_0x1381('0x32')]['fields']));_0x423eb7[_0x1381('0x34')]=_0x423eb7['attributes'][_0x1381('0x36')]?_0x423eb7['attributes']:_0x43528b[_0x1381('0x2f')];if(!_0x1c7b58[_0x1381('0x32')][_0x1381('0x37')](_0x1381('0x38'))){_0x423eb7[_0x1381('0x1c')]=qs[_0x1381('0x1c')](_0x1c7b58[_0x1381('0x32')][_0x1381('0x1c')]);_0x423eb7[_0x1381('0x1a')]=qs[_0x1381('0x1a')](_0x1c7b58['query'][_0x1381('0x1a')]);}_0x423eb7['order']=qs[_0x1381('0x39')](_0x1c7b58[_0x1381('0x32')]['sort']);_0x423eb7['where']=qs[_0x1381('0x33')](_[_0x1381('0x3a')](_0x1c7b58[_0x1381('0x32')],_0x43528b[_0x1381('0x33')]),_0x55d922);if(_0x1c7b58[_0x1381('0x32')][_0x1381('0x3b')]){_0x423eb7[_0x1381('0x3c')]=_[_0x1381('0x3d')](_0x423eb7[_0x1381('0x3c')],{'$or':_[_0x1381('0x30')](_0x55d922,function(_0x5eb11a){if(_0x5eb11a[_0x1381('0x2d')]!=='VIRTUAL'){var _0x4e0e2f={};_0x4e0e2f[_0x5eb11a[_0x1381('0x31')]]={'$like':'%'+_0x1c7b58[_0x1381('0x32')][_0x1381('0x3b')]+'%'};return _0x4e0e2f;}})});}_0x423eb7=_[_0x1381('0x3d')]({},_0x423eb7,_0x1c7b58[_0x1381('0x3e')]);var _0x554b91={'where':_0x423eb7[_0x1381('0x3c')]};return db[_0x1381('0x2a')]['count'](_0x554b91)[_0x1381('0x25')](function(_0x1979cd){_0x514970['count']=_0x1979cd;if(_0x1c7b58[_0x1381('0x32')][_0x1381('0x3f')]){_0x423eb7[_0x1381('0x40')]=[{'all':!![]}];}return db[_0x1381('0x2a')][_0x1381('0x41')](_0x423eb7);})[_0x1381('0x25')](function(_0x513042){_0x514970[_0x1381('0x42')]=_0x513042;return _0x514970;})['then'](respondWithFilteredResult(_0x191142,_0x423eb7))[_0x1381('0x43')](handleError(_0x191142,null));};exports[_0x1381('0x44')]=function(_0x4935e3,_0x762fd4){var _0x33dbe2={'raw':!![],'where':{'id':_0x4935e3[_0x1381('0x45')]['id']}},_0xade938={};_0xade938[_0x1381('0x2f')]=_['keys'](db[_0x1381('0x2a')]['rawAttributes']);_0xade938[_0x1381('0x32')]=_[_0x1381('0x46')](_0x4935e3['query']);_0xade938[_0x1381('0x33')]=_['intersection'](_0xade938[_0x1381('0x2f')],_0xade938[_0x1381('0x32')]);_0x33dbe2[_0x1381('0x34')]=_[_0x1381('0x35')](_0xade938['model'],qs[_0x1381('0x47')](_0x4935e3[_0x1381('0x32')][_0x1381('0x47')]));_0x33dbe2[_0x1381('0x34')]=_0x33dbe2[_0x1381('0x34')][_0x1381('0x36')]?_0x33dbe2['attributes']:_0xade938[_0x1381('0x2f')];if(_0x4935e3[_0x1381('0x32')][_0x1381('0x3f')]){_0x33dbe2[_0x1381('0x40')]=[{'all':!![]}];}_0x33dbe2=_['merge']({},_0x33dbe2,_0x4935e3['options']);return db[_0x1381('0x2a')][_0x1381('0x48')](_0x33dbe2)[_0x1381('0x25')](handleEntityNotFound(_0x762fd4,null))[_0x1381('0x25')](respondWithResult(_0x762fd4,null))[_0x1381('0x43')](handleError(_0x762fd4,null));};exports[_0x1381('0x49')]=function(_0x305f5f,_0x576b08){return db[_0x1381('0x2a')][_0x1381('0x49')](_0x305f5f[_0x1381('0x4a')],{})[_0x1381('0x25')](function(_0x5044e0){var _0x176204=_0x305f5f[_0x1381('0x4b')][_0x1381('0x23')]({'plain':!![]});if(!_0x176204)throw new Error(_0x1381('0x4c'));if(_0x176204[_0x1381('0x4d')]===_0x1381('0x4b')){var _0x82bdd6=_0x5044e0[_0x1381('0x23')]({'plain':!![]});var _0x565dee=_0x1381('0x24');return db[_0x1381('0x4e')][_0x1381('0x48')]({'where':{'name':_0x565dee,'userProfileId':_0x176204[_0x1381('0x4f')]},'raw':!![]})[_0x1381('0x25')](function(_0x1faf38){if(_0x1faf38&&_0x1faf38[_0x1381('0x50')]===0x0){return db[_0x1381('0x51')][_0x1381('0x49')]({'name':_0x82bdd6['name'],'resourceId':_0x82bdd6['id'],'type':_0x1faf38[_0x1381('0x31')],'sectionId':_0x1faf38['id']},{})[_0x1381('0x25')](function(){return _0x5044e0;});}else{return _0x5044e0;}})[_0x1381('0x43')](function(_0x5bc315){logger['error'](_0x1381('0x52'),_0x5bc315);throw _0x5bc315;});}return _0x5044e0;})[_0x1381('0x25')](respondWithResult(_0x576b08,0xc9))[_0x1381('0x43')](handleError(_0x576b08,null));};exports[_0x1381('0x22')]=function(_0x300789,_0x63faac){if(_0x300789['body']['id']){delete _0x300789[_0x1381('0x4a')]['id'];}return db[_0x1381('0x2a')]['find']({'where':{'id':_0x300789[_0x1381('0x45')]['id']}})[_0x1381('0x25')](handleEntityNotFound(_0x63faac,null))[_0x1381('0x25')](saveUpdates(_0x300789['body'],null))[_0x1381('0x25')](respondWithResult(_0x63faac,null))[_0x1381('0x43')](handleError(_0x63faac,null));};exports[_0x1381('0x53')]=function(_0x1b41f3,_0x365f8f){return db[_0x1381('0x2a')][_0x1381('0x48')]({'where':{'id':_0x1b41f3['params']['id']}})[_0x1381('0x25')](handleEntityNotFound(_0x365f8f,null))[_0x1381('0x25')](removeEntity(_0x365f8f,null))[_0x1381('0x43')](handleError(_0x365f8f,null));};
\ No newline at end of file
+var _0x88a2=['fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','save','then','destroy','Templates','error','stack','name','index','Template','rawAttributes','fieldName','type','model','map','query','keys','attributes','intersection'];(function(_0x533933,_0x40e45f){var _0xa1a919=function(_0x1759e1){while(--_0x1759e1){_0x533933['push'](_0x533933['shift']());}};_0xa1a919(++_0x40e45f);}(_0x88a2,0x64));var _0x288a=function(_0x26dafa,_0x1f4821){_0x26dafa=_0x26dafa-0x0;var _0x166331=_0x88a2[_0x26dafa];return _0x166331;};'use strict';var emlformat=require(_0x288a('0x0'));var rimraf=require(_0x288a('0x1'));var zipdir=require(_0x288a('0x2'));var jsonpatch=require(_0x288a('0x3'));var rp=require(_0x288a('0x4'));var moment=require(_0x288a('0x5'));var BPromise=require(_0x288a('0x6'));var Mustache=require(_0x288a('0x7'));var util=require(_0x288a('0x8'));var path=require('path');var sox=require(_0x288a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x288a('0xa'));var _=require(_0x288a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x288a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x288a('0xd'));var Redis=require(_0x288a('0xe'));var authService=require(_0x288a('0xf'));var qs=require(_0x288a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x288a('0x11'));var logger=require(_0x288a('0x12'))(_0x288a('0x13'));var utils=require(_0x288a('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x288a('0x15'))['db'];function respondWithStatusCode(_0x3901c0,_0x4aba4a){_0x4aba4a=_0x4aba4a||0xcc;return function(_0x141dd8){if(_0x141dd8){return _0x3901c0[_0x288a('0x16')](_0x4aba4a);}return _0x3901c0['status'](_0x4aba4a)[_0x288a('0x17')]();};}function respondWithResult(_0x2fdaab,_0x43eebb){_0x43eebb=_0x43eebb||0xc8;return function(_0x4dd309){if(_0x4dd309){return _0x2fdaab[_0x288a('0x18')](_0x43eebb)[_0x288a('0x19')](_0x4dd309);}};}function respondWithFilteredResult(_0x11d923,_0x335fb7){return function(_0x7202d1){if(_0x7202d1){var _0x195079=typeof _0x335fb7[_0x288a('0x1a')]===_0x288a('0x1b')&&typeof _0x335fb7[_0x288a('0x1c')]===_0x288a('0x1b');var _0x196209=_0x7202d1['count'];var _0x174753=_0x195079?0x0:_0x335fb7[_0x288a('0x1a')];var _0x5bd227=_0x195079?_0x7202d1['count']:_0x335fb7['offset']+_0x335fb7[_0x288a('0x1c')];var _0x545ac6;if(_0x5bd227>=_0x196209){_0x5bd227=_0x196209;_0x545ac6=0xc8;}else{_0x545ac6=0xce;}_0x11d923['status'](_0x545ac6);return _0x11d923[_0x288a('0x1d')](_0x288a('0x1e'),_0x174753+'-'+_0x5bd227+'/'+_0x196209)['json'](_0x7202d1);}return null;};}function patchUpdates(_0x3d5508){return function(_0x451133){try{jsonpatch[_0x288a('0x1f')](_0x451133,_0x3d5508,!![]);}catch(_0x299bbd){return BPromise['reject'](_0x299bbd);}return _0x451133[_0x288a('0x20')]();};}function saveUpdates(_0x318f0e,_0x5b70e8){return function(_0x128240){if(_0x128240){return _0x128240['update'](_0x318f0e)[_0x288a('0x21')](function(_0x278006){return _0x278006;});}return null;};}function removeEntity(_0xbc6342,_0x27d7fd){return function(_0x10cc64){if(_0x10cc64){return _0x10cc64[_0x288a('0x22')]()[_0x288a('0x21')](function(){var _0x12e4f1=_0x10cc64['get']({'plain':!![]});var _0x479ee7=_0x288a('0x23');return db['UserProfileResource'][_0x288a('0x22')]({'where':{'type':_0x479ee7,'resourceId':_0x12e4f1['id']}})[_0x288a('0x21')](function(){return _0x10cc64;});})[_0x288a('0x21')](function(){_0xbc6342[_0x288a('0x18')](0xcc)[_0x288a('0x17')]();});}};}function handleEntityNotFound(_0x3c6465,_0x4592d3){return function(_0x3f3db4){if(!_0x3f3db4){_0x3c6465[_0x288a('0x16')](0x194);}return _0x3f3db4;};}function handleError(_0x5a155,_0x39bd19){_0x39bd19=_0x39bd19||0x1f4;return function(_0x230f0b){logger[_0x288a('0x24')](_0x230f0b[_0x288a('0x25')]);if(_0x230f0b[_0x288a('0x26')]){delete _0x230f0b['name'];}_0x5a155[_0x288a('0x18')](_0x39bd19)['send'](_0x230f0b);};}exports[_0x288a('0x27')]=function(_0x28718a,_0x5eb702){var _0x17c145={},_0x22ce4f={},_0x3c6726={'count':0x0,'rows':[]};var _0xb25059=_['map'](db[_0x288a('0x28')][_0x288a('0x29')],function(_0x42ce11){return{'name':_0x42ce11[_0x288a('0x2a')],'type':_0x42ce11[_0x288a('0x2b')]['key']};});_0x22ce4f[_0x288a('0x2c')]=_[_0x288a('0x2d')](_0xb25059,_0x288a('0x26'));_0x22ce4f[_0x288a('0x2e')]=_[_0x288a('0x2f')](_0x28718a[_0x288a('0x2e')]);_0x22ce4f['filters']=_['intersection'](_0x22ce4f[_0x288a('0x2c')],_0x22ce4f[_0x288a('0x2e')]);_0x17c145[_0x288a('0x30')]=_[_0x288a('0x31')](_0x22ce4f[_0x288a('0x2c')],qs[_0x288a('0x32')](_0x28718a['query'][_0x288a('0x32')]));_0x17c145[_0x288a('0x30')]=_0x17c145['attributes'][_0x288a('0x33')]?_0x17c145[_0x288a('0x30')]:_0x22ce4f['model'];if(!_0x28718a[_0x288a('0x2e')]['hasOwnProperty']('nolimit')){_0x17c145[_0x288a('0x1c')]=qs[_0x288a('0x1c')](_0x28718a[_0x288a('0x2e')]['limit']);_0x17c145[_0x288a('0x1a')]=qs[_0x288a('0x1a')](_0x28718a[_0x288a('0x2e')][_0x288a('0x1a')]);}_0x17c145['order']=qs[_0x288a('0x34')](_0x28718a['query'][_0x288a('0x34')]);_0x17c145[_0x288a('0x35')]=qs[_0x288a('0x36')](_[_0x288a('0x37')](_0x28718a[_0x288a('0x2e')],_0x22ce4f[_0x288a('0x36')]),_0xb25059);if(_0x28718a[_0x288a('0x2e')][_0x288a('0x38')]){_0x17c145[_0x288a('0x35')]=_[_0x288a('0x39')](_0x17c145[_0x288a('0x35')],{'$or':_['map'](_0xb25059,function(_0x377a6b){if(_0x377a6b['type']!==_0x288a('0x3a')){var _0x427468={};_0x427468[_0x377a6b[_0x288a('0x26')]]={'$like':'%'+_0x28718a[_0x288a('0x2e')][_0x288a('0x38')]+'%'};return _0x427468;}})});}_0x17c145=_[_0x288a('0x39')]({},_0x17c145,_0x28718a[_0x288a('0x3b')]);var _0x3b6421={'where':_0x17c145['where']};return db[_0x288a('0x28')]['count'](_0x3b6421)[_0x288a('0x21')](function(_0x17d297){_0x3c6726[_0x288a('0x3c')]=_0x17d297;if(_0x28718a[_0x288a('0x2e')][_0x288a('0x3d')]){_0x17c145['include']=[{'all':!![]}];}return db[_0x288a('0x28')][_0x288a('0x3e')](_0x17c145);})['then'](function(_0xeee9e5){_0x3c6726['rows']=_0xeee9e5;return _0x3c6726;})[_0x288a('0x21')](respondWithFilteredResult(_0x5eb702,_0x17c145))[_0x288a('0x3f')](handleError(_0x5eb702,null));};exports[_0x288a('0x40')]=function(_0x508eeb,_0xb9a1c5){var _0x2b43f6={'raw':!![],'where':{'id':_0x508eeb[_0x288a('0x41')]['id']}},_0xc08e02={};_0xc08e02[_0x288a('0x2c')]=_['keys'](db['Template'][_0x288a('0x29')]);_0xc08e02[_0x288a('0x2e')]=_['keys'](_0x508eeb[_0x288a('0x2e')]);_0xc08e02['filters']=_[_0x288a('0x31')](_0xc08e02[_0x288a('0x2c')],_0xc08e02[_0x288a('0x2e')]);_0x2b43f6['attributes']=_['intersection'](_0xc08e02[_0x288a('0x2c')],qs[_0x288a('0x32')](_0x508eeb[_0x288a('0x2e')]['fields']));_0x2b43f6['attributes']=_0x2b43f6[_0x288a('0x30')][_0x288a('0x33')]?_0x2b43f6['attributes']:_0xc08e02['model'];if(_0x508eeb[_0x288a('0x2e')][_0x288a('0x3d')]){_0x2b43f6[_0x288a('0x42')]=[{'all':!![]}];}_0x2b43f6=_[_0x288a('0x39')]({},_0x2b43f6,_0x508eeb[_0x288a('0x3b')]);return db[_0x288a('0x28')]['find'](_0x2b43f6)[_0x288a('0x21')](handleEntityNotFound(_0xb9a1c5,null))[_0x288a('0x21')](respondWithResult(_0xb9a1c5,null))[_0x288a('0x3f')](handleError(_0xb9a1c5,null));};exports[_0x288a('0x43')]=function(_0x15271e,_0x465e4c){return db[_0x288a('0x28')][_0x288a('0x43')](_0x15271e[_0x288a('0x44')],{})[_0x288a('0x21')](function(_0x16ad2d){var _0x2421b4=_0x15271e[_0x288a('0x45')]['get']({'plain':!![]});if(!_0x2421b4)throw new Error(_0x288a('0x46'));if(_0x2421b4['role']==='user'){var _0x2da929=_0x16ad2d['get']({'plain':!![]});var _0x7d90f3=_0x288a('0x23');return db['UserProfileSection'][_0x288a('0x47')]({'where':{'name':_0x7d90f3,'userProfileId':_0x2421b4[_0x288a('0x48')]},'raw':!![]})[_0x288a('0x21')](function(_0x4ab63a){if(_0x4ab63a&&_0x4ab63a[_0x288a('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x2da929[_0x288a('0x26')],'resourceId':_0x2da929['id'],'type':_0x4ab63a[_0x288a('0x26')],'sectionId':_0x4ab63a['id']},{})[_0x288a('0x21')](function(){return _0x16ad2d;});}else{return _0x16ad2d;}})[_0x288a('0x3f')](function(_0x4d55c0){logger[_0x288a('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d55c0);throw _0x4d55c0;});}return _0x16ad2d;})[_0x288a('0x21')](respondWithResult(_0x465e4c,0xc9))[_0x288a('0x3f')](handleError(_0x465e4c,null));};exports[_0x288a('0x4a')]=function(_0x3e283b,_0x52dbe1){if(_0x3e283b[_0x288a('0x44')]['id']){delete _0x3e283b[_0x288a('0x44')]['id'];}return db[_0x288a('0x28')][_0x288a('0x47')]({'where':{'id':_0x3e283b['params']['id']}})[_0x288a('0x21')](handleEntityNotFound(_0x52dbe1,null))[_0x288a('0x21')](saveUpdates(_0x3e283b['body'],null))['then'](respondWithResult(_0x52dbe1,null))['catch'](handleError(_0x52dbe1,null));};exports[_0x288a('0x22')]=function(_0x1597b8,_0x3a264c){return db[_0x288a('0x28')][_0x288a('0x47')]({'where':{'id':_0x1597b8[_0x288a('0x41')]['id']}})[_0x288a('0x21')](handleEntityNotFound(_0x3a264c,null))[_0x288a('0x21')](removeEntity(_0x3a264c,null))['catch'](handleError(_0x3a264c,null));};
\ No newline at end of file
index 0df8008..66ce71b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3316=['lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./template.attributes','exports','define','Template','tools_templates'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0x3316,0x120));var _0x6331=function(_0x843880,_0x1516d1){_0x843880=_0x843880-0x0;var _0x49943f=_0x3316[_0x843880];return _0x49943f;};'use strict';var _=require(_0x6331('0x0'));var util=require(_0x6331('0x1'));var logger=require(_0x6331('0x2'))('api');var moment=require(_0x6331('0x3'));var BPromise=require('bluebird');var rp=require(_0x6331('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6331('0x5'));var config=require(_0x6331('0x6'));var attributes=require(_0x6331('0x7'));module[_0x6331('0x8')]=function(_0x165267,_0xe4462c){return _0x165267[_0x6331('0x9')](_0x6331('0xa'),attributes,{'tableName':_0x6331('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a22=['../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x3e43b8,_0x353d1b){var _0x3ac01b=function(_0xc8cf98){while(--_0xc8cf98){_0x3e43b8['push'](_0x3e43b8['shift']());}};_0x3ac01b(++_0x353d1b);}(_0x5a22,0x161));var _0x25a2=function(_0x44529c,_0x50b252){_0x44529c=_0x44529c-0x0;var _0xe5c58e=_0x5a22[_0x44529c];return _0xe5c58e;};'use strict';var _=require(_0x25a2('0x0'));var util=require(_0x25a2('0x1'));var logger=require(_0x25a2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x25a2('0x3'));var rp=require(_0x25a2('0x4'));var fs=require('fs');var path=require(_0x25a2('0x5'));var rimraf=require(_0x25a2('0x6'));var config=require(_0x25a2('0x7'));var attributes=require(_0x25a2('0x8'));module['exports']=function(_0x3c64b0,_0x50f85e){return _0x3c64b0[_0x25a2('0x9')](_0x25a2('0xa'),attributes,{'tableName':_0x25a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fcfdc1b..b669e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd4=['include','map','model','GetTemplate','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','options','raw','where','attributes'];(function(_0x12b3b4,_0x3899ef){var _0xa3311f=function(_0x2e2e1d){while(--_0x2e2e1d){_0x12b3b4['push'](_0x12b3b4['shift']());}};_0xa3311f(++_0x3899ef);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xbdd4[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4bdd('0x0'));var BPromise=require(_0x4bdd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4bdd('0x2'))['db'];var utils=require(_0x4bdd('0x3'));var logger=require('../../config/logger')(_0x4bdd('0x4'));var config=require(_0x4bdd('0x5'));var jayson=require(_0x4bdd('0x6'));var client=jayson['client'][_0x4bdd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5096be,_0x58d8a3,_0x49f6c1){return new BPromise(function(_0xa7889f,_0x581f14){return client[_0x4bdd('0x8')](_0x5096be,_0x49f6c1)[_0x4bdd('0x9')](function(_0x4e10c1){logger[_0x4bdd('0xa')](_0x4bdd('0xb'),_0x58d8a3,_0x4bdd('0xc'));logger[_0x4bdd('0xd')](_0x4bdd('0xe'),_0x58d8a3,'request\x20sent',JSON[_0x4bdd('0xf')](_0x4e10c1));if(_0x4e10c1[_0x4bdd('0x10')]){if(_0x4e10c1[_0x4bdd('0x10')][_0x4bdd('0x11')]===0x1f4){logger[_0x4bdd('0x10')]('Template,\x20%s,\x20%s',_0x58d8a3,_0x4e10c1[_0x4bdd('0x10')][_0x4bdd('0x12')]);return _0x581f14(_0x4e10c1[_0x4bdd('0x10')][_0x4bdd('0x12')]);}logger[_0x4bdd('0x10')](_0x4bdd('0xb'),_0x58d8a3,_0x4e10c1[_0x4bdd('0x10')][_0x4bdd('0x12')]);return _0xa7889f(_0x4e10c1[_0x4bdd('0x10')]['message']);}else{logger['info'](_0x4bdd('0xb'),_0x58d8a3,_0x4bdd('0xc'));_0xa7889f(_0x4e10c1[_0x4bdd('0x13')][_0x4bdd('0x12')]);}})[_0x4bdd('0x14')](function(_0x3f9e01){logger[_0x4bdd('0x10')](_0x4bdd('0xb'),_0x58d8a3,_0x3f9e01);_0x581f14(_0x3f9e01);});});}exports['GetTemplate']=function(_0xf6c6ba){var _0x4c8f9e=this;return new Promise(function(_0x41bb61,_0x752abd){return db[_0x4bdd('0x15')]['findAll']({'raw':_0xf6c6ba[_0x4bdd('0x16')]?_0xf6c6ba['options'][_0x4bdd('0x17')]===undefined?!![]:![]:!![],'where':_0xf6c6ba['options']?_0xf6c6ba[_0x4bdd('0x16')][_0x4bdd('0x18')]||null:null,'attributes':_0xf6c6ba[_0x4bdd('0x16')]?_0xf6c6ba['options'][_0x4bdd('0x19')]||null:null,'limit':_0xf6c6ba[_0x4bdd('0x16')]?_0xf6c6ba[_0x4bdd('0x16')]['limit']||null:null,'include':_0xf6c6ba['options']?_0xf6c6ba[_0x4bdd('0x16')][_0x4bdd('0x1a')]?_[_0x4bdd('0x1b')](_0xf6c6ba['options'][_0x4bdd('0x1a')],function(_0x2cfdb7){return{'model':db[_0x2cfdb7['model']],'as':_0x2cfdb7['as'],'attributes':_0x2cfdb7[_0x4bdd('0x19')],'include':_0x2cfdb7[_0x4bdd('0x1a')]?_[_0x4bdd('0x1b')](_0x2cfdb7[_0x4bdd('0x1a')],function(_0x62a34f){return{'model':db[_0x62a34f['model']],'as':_0x62a34f['as'],'attributes':_0x62a34f[_0x4bdd('0x19')],'include':_0x62a34f['include']?_[_0x4bdd('0x1b')](_0x62a34f[_0x4bdd('0x1a')],function(_0x1dfb0a){return{'model':db[_0x1dfb0a[_0x4bdd('0x1c')]],'as':_0x1dfb0a['as'],'attributes':_0x1dfb0a[_0x4bdd('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4bdd('0x9')](function(_0xcb953c){logger[_0x4bdd('0xa')](_0x4bdd('0x1d'),_0xf6c6ba);logger[_0x4bdd('0xd')](_0x4bdd('0x1d'),_0xf6c6ba,JSON[_0x4bdd('0xf')](_0xcb953c));_0x41bb61(_0xcb953c);})['catch'](function(_0x3d82f8){logger['error'](_0x4bdd('0x1d'),_0x3d82f8['message'],_0xf6c6ba);_0x752abd(_0x4c8f9e[_0x4bdd('0x10')](0x1f4,_0x3d82f8['message']));});});};
\ No newline at end of file
+var _0x4f3c=['raw','where','attributes','limit','map','model','include','GetTemplate','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','Template,\x20%s,\x20%s','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','findAll','options'];(function(_0x3d8753,_0x1629bd){var _0x40a29f=function(_0x57b62b){while(--_0x57b62b){_0x3d8753['push'](_0x3d8753['shift']());}};_0x40a29f(++_0x1629bd);}(_0x4f3c,0x15d));var _0xc4f3=function(_0x334d1e,_0x28a488){_0x334d1e=_0x334d1e-0x0;var _0x3b33ba=_0x4f3c[_0x334d1e];return _0x3b33ba;};'use strict';var _=require(_0xc4f3('0x0'));var util=require(_0xc4f3('0x1'));var moment=require(_0xc4f3('0x2'));var BPromise=require(_0xc4f3('0x3'));var rs=require(_0xc4f3('0x4'));var fs=require('fs');var Redis=require(_0xc4f3('0x5'));var db=require(_0xc4f3('0x6'))['db'];var utils=require(_0xc4f3('0x7'));var logger=require(_0xc4f3('0x8'))(_0xc4f3('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc4f3('0xa')][_0xc4f3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x347c7f,_0x2b8ec0,_0x20a4d6){return new BPromise(function(_0x67a87d,_0x37af8f){return client[_0xc4f3('0xc')](_0x347c7f,_0x20a4d6)[_0xc4f3('0xd')](function(_0x2c17d9){logger['info'](_0xc4f3('0xe'),_0x2b8ec0,'request\x20sent');logger['debug'](_0xc4f3('0xf'),_0x2b8ec0,'request\x20sent',JSON[_0xc4f3('0x10')](_0x2c17d9));if(_0x2c17d9[_0xc4f3('0x11')]){if(_0x2c17d9[_0xc4f3('0x11')]['code']===0x1f4){logger[_0xc4f3('0x11')]('Template,\x20%s,\x20%s',_0x2b8ec0,_0x2c17d9['error']['message']);return _0x37af8f(_0x2c17d9[_0xc4f3('0x11')][_0xc4f3('0x12')]);}logger[_0xc4f3('0x11')](_0xc4f3('0xe'),_0x2b8ec0,_0x2c17d9['error'][_0xc4f3('0x12')]);return _0x67a87d(_0x2c17d9[_0xc4f3('0x11')][_0xc4f3('0x12')]);}else{logger[_0xc4f3('0x13')]('Template,\x20%s,\x20%s',_0x2b8ec0,_0xc4f3('0x14'));_0x67a87d(_0x2c17d9[_0xc4f3('0x15')]['message']);}})[_0xc4f3('0x16')](function(_0x295324){logger[_0xc4f3('0x11')]('Template,\x20%s,\x20%s',_0x2b8ec0,_0x295324);_0x37af8f(_0x295324);});});}exports['GetTemplate']=function(_0xbc5595){var _0x22f779=this;return new Promise(function(_0x1dc5a8,_0x3a27b7){return db['Template'][_0xc4f3('0x17')]({'raw':_0xbc5595[_0xc4f3('0x18')]?_0xbc5595[_0xc4f3('0x18')][_0xc4f3('0x19')]===undefined?!![]:![]:!![],'where':_0xbc5595[_0xc4f3('0x18')]?_0xbc5595[_0xc4f3('0x18')][_0xc4f3('0x1a')]||null:null,'attributes':_0xbc5595[_0xc4f3('0x18')]?_0xbc5595[_0xc4f3('0x18')][_0xc4f3('0x1b')]||null:null,'limit':_0xbc5595[_0xc4f3('0x18')]?_0xbc5595['options'][_0xc4f3('0x1c')]||null:null,'include':_0xbc5595[_0xc4f3('0x18')]?_0xbc5595['options']['include']?_[_0xc4f3('0x1d')](_0xbc5595[_0xc4f3('0x18')]['include'],function(_0x5b3ac3){return{'model':db[_0x5b3ac3[_0xc4f3('0x1e')]],'as':_0x5b3ac3['as'],'attributes':_0x5b3ac3[_0xc4f3('0x1b')],'include':_0x5b3ac3[_0xc4f3('0x1f')]?_['map'](_0x5b3ac3[_0xc4f3('0x1f')],function(_0x460ee7){return{'model':db[_0x460ee7[_0xc4f3('0x1e')]],'as':_0x460ee7['as'],'attributes':_0x460ee7[_0xc4f3('0x1b')],'include':_0x460ee7['include']?_[_0xc4f3('0x1d')](_0x460ee7[_0xc4f3('0x1f')],function(_0x26c737){return{'model':db[_0x26c737[_0xc4f3('0x1e')]],'as':_0x26c737['as'],'attributes':_0x26c737[_0xc4f3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc4f3('0xd')](function(_0x2912e4){logger['info'](_0xc4f3('0x20'),_0xbc5595);logger[_0xc4f3('0x21')](_0xc4f3('0x20'),_0xbc5595,JSON[_0xc4f3('0x10')](_0x2912e4));_0x1dc5a8(_0x2912e4);})['catch'](function(_0x2731a5){logger[_0xc4f3('0x11')]('GetTemplate',_0x2731a5['message'],_0xbc5595);_0x3a27b7(_0x22f779[_0xc4f3('0x11')](0x1f4,_0x2731a5[_0xc4f3('0x12')]));});});};
\ No newline at end of file
index e9306fa..a203f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1853=['delete','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','addAnyCondition','addAction','put','update'];(function(_0x4704dc,_0x575a5f){var _0x254d81=function(_0x3b135d){while(--_0x3b135d){_0x4704dc['push'](_0x4704dc['shift']());}};_0x254d81(++_0x575a5f);}(_0x1853,0x114));var _0x3185=function(_0x21f98f,_0x3a67da){_0x21f98f=_0x21f98f-0x0;var _0x48fc8d=_0x1853[_0x21f98f];return _0x48fc8d;};'use strict';var multer=require(_0x3185('0x0'));var util=require('util');var path=require(_0x3185('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3185('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3185('0x3'));var interaction=require(_0x3185('0x4'));var config=require(_0x3185('0x5'));var controller=require('./trigger.controller');router[_0x3185('0x6')]('/',auth[_0x3185('0x7')](),controller[_0x3185('0x8')]);router[_0x3185('0x6')](_0x3185('0x9'),auth[_0x3185('0x7')](),controller[_0x3185('0xa')]);router['get'](_0x3185('0xb'),auth[_0x3185('0x7')](),controller[_0x3185('0xc')]);router[_0x3185('0x6')](_0x3185('0xd'),auth[_0x3185('0x7')](),controller[_0x3185('0xe')]);router['get'](_0x3185('0xf'),auth['isAuthenticated'](),controller[_0x3185('0x10')]);router['post']('/',auth[_0x3185('0x7')](),controller[_0x3185('0x11')]);router[_0x3185('0x12')](_0x3185('0xb'),auth[_0x3185('0x7')](),controller[_0x3185('0x13')]);router['post'](_0x3185('0xd'),auth['isAuthenticated'](),controller[_0x3185('0x14')]);router[_0x3185('0x12')](_0x3185('0xf'),auth[_0x3185('0x7')](),controller[_0x3185('0x15')]);router[_0x3185('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x3185('0x17')]);router[_0x3185('0x18')](_0x3185('0x9'),auth[_0x3185('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x68b7=['create','post','/:id/all_conditions','addAllCondition','addAction','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','index','/:id','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x1c60bd,_0x207c9b){var _0xc46ef9=function(_0x271c57){while(--_0x271c57){_0x1c60bd['push'](_0x1c60bd['shift']());}};_0xc46ef9(++_0x207c9b);}(_0x68b7,0x8c));var _0x768b=function(_0x158026,_0x3f114d){_0x158026=_0x158026-0x0;var _0x881a3=_0x68b7[_0x158026];return _0x881a3;};'use strict';var multer=require(_0x768b('0x0'));var util=require('util');var path=require(_0x768b('0x1'));var timeout=require(_0x768b('0x2'));var express=require(_0x768b('0x3'));var router=express['Router']();var fs_extra=require(_0x768b('0x4'));var auth=require(_0x768b('0x5'));var interaction=require(_0x768b('0x6'));var config=require('../../config/environment');var controller=require(_0x768b('0x7'));router[_0x768b('0x8')]('/',auth[_0x768b('0x9')](),controller[_0x768b('0xa')]);router[_0x768b('0x8')](_0x768b('0xb'),auth[_0x768b('0x9')](),controller['show']);router[_0x768b('0x8')]('/:id/all_conditions',auth[_0x768b('0x9')](),controller[_0x768b('0xc')]);router[_0x768b('0x8')](_0x768b('0xd'),auth[_0x768b('0x9')](),controller[_0x768b('0xe')]);router['get'](_0x768b('0xf'),auth[_0x768b('0x9')](),controller['getActions']);router['post']('/',auth[_0x768b('0x9')](),controller[_0x768b('0x10')]);router[_0x768b('0x11')](_0x768b('0x12'),auth[_0x768b('0x9')](),controller[_0x768b('0x13')]);router[_0x768b('0x11')](_0x768b('0xd'),auth[_0x768b('0x9')](),controller['addAnyCondition']);router[_0x768b('0x11')](_0x768b('0xf'),auth[_0x768b('0x9')](),controller[_0x768b('0x14')]);router[_0x768b('0x15')]('/:id',auth[_0x768b('0x9')](),controller[_0x768b('0x16')]);router[_0x768b('0x17')](_0x768b('0xb'),auth[_0x768b('0x9')](),controller[_0x768b('0x18')]);module[_0x768b('0x19')]=router;
\ No newline at end of file
index 67c5076..7f7a6db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c48=['BOOLEAN','sequelize','exports','STRING'];(function(_0x163613,_0x2d46df){var _0x3f6040=function(_0x1bc06e){while(--_0x1bc06e){_0x163613['push'](_0x163613['shift']());}};_0x3f6040(++_0x2d46df);}(_0x0c48,0xed));var _0x80c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x0c48[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x80c4('0x0'));module[_0x80c4('0x1')]={'name':{'type':Sequelize[_0x80c4('0x2')]},'channel':{'type':Sequelize[_0x80c4('0x2')]},'description':{'type':Sequelize[_0x80c4('0x2')]},'status':{'type':Sequelize[_0x80c4('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3a9f=['BOOLEAN','sequelize','STRING'];(function(_0x54ddd4,_0x3f15f4){var _0x581659=function(_0x4d37f1){while(--_0x4d37f1){_0x54ddd4['push'](_0x54ddd4['shift']());}};_0x581659(++_0x3f15f4);}(_0x3a9f,0x88));var _0xf3a9=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x3a9f[_0x4b4638];return _0x59e92b;};'use strict';var Sequelize=require(_0xf3a9('0x0'));module['exports']={'name':{'type':Sequelize[_0xf3a9('0x1')]},'channel':{'type':Sequelize[_0xf3a9('0x1')]},'description':{'type':Sequelize[_0xf3a9('0x1')]},'status':{'type':Sequelize[_0xf3a9('0x2')],'defaultValue':![]}};
\ No newline at end of file
index d2997f8..22fb78e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f7f=['includeAll','find','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','addAllCondition','TriggerAllId','TriggerAnyId','findOne','Condition','pick','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','get','Triggers','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Trigger','include','findAll','catch','show','params','keys'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x0f7f,0x1e1));var _0xf0f7=function(_0x297a45,_0x110de2){_0x297a45=_0x297a45-0x0;var _0x40784f=_0x0f7f[_0x297a45];return _0x40784f;};'use strict';var emlformat=require(_0xf0f7('0x0'));var rimraf=require(_0xf0f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf0f7('0x2'));var moment=require(_0xf0f7('0x3'));var BPromise=require(_0xf0f7('0x4'));var Mustache=require(_0xf0f7('0x5'));var util=require(_0xf0f7('0x6'));var path=require(_0xf0f7('0x7'));var sox=require('sox');var csv=require(_0xf0f7('0x8'));var ejs=require(_0xf0f7('0x9'));var fs=require('fs');var fs_extra=require(_0xf0f7('0xa'));var _=require(_0xf0f7('0xb'));var squel=require(_0xf0f7('0xc'));var crypto=require('crypto');var jsforce=require(_0xf0f7('0xd'));var deskjs=require(_0xf0f7('0xe'));var toCsv=require(_0xf0f7('0x8'));var querystring=require(_0xf0f7('0xf'));var Papa=require(_0xf0f7('0x10'));var Redis=require(_0xf0f7('0x11'));var authService=require(_0xf0f7('0x12'));var qs=require(_0xf0f7('0x13'));var as=require(_0xf0f7('0x14'));var hardwareService=require(_0xf0f7('0x15'));var logger=require('../../config/logger')(_0xf0f7('0x16'));var utils=require(_0xf0f7('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3498d0,_0x3a8f20){_0x3a8f20=_0x3a8f20||0xcc;return function(_0x46d5da){if(_0x46d5da){return _0x3498d0[_0xf0f7('0x18')](_0x3a8f20);}return _0x3498d0['status'](_0x3a8f20)[_0xf0f7('0x19')]();};}function respondWithResult(_0x26243a,_0x15167c){_0x15167c=_0x15167c||0xc8;return function(_0x592d7c){if(_0x592d7c){return _0x26243a[_0xf0f7('0x1a')](_0x15167c)[_0xf0f7('0x1b')](_0x592d7c);}};}function respondWithFilteredResult(_0x22dc0c,_0x254929){return function(_0x582568){if(_0x582568){var _0x545ebb=typeof _0x254929[_0xf0f7('0x1c')]===_0xf0f7('0x1d')&&typeof _0x254929[_0xf0f7('0x1e')]===_0xf0f7('0x1d');var _0x26b212=_0x582568[_0xf0f7('0x1f')];var _0x40ebde=_0x545ebb?0x0:_0x254929[_0xf0f7('0x1c')];var _0x48b3fe=_0x545ebb?_0x582568['count']:_0x254929[_0xf0f7('0x1c')]+_0x254929[_0xf0f7('0x1e')];var _0x4948b6;if(_0x48b3fe>=_0x26b212){_0x48b3fe=_0x26b212;_0x4948b6=0xc8;}else{_0x4948b6=0xce;}_0x22dc0c[_0xf0f7('0x1a')](_0x4948b6);return _0x22dc0c[_0xf0f7('0x20')](_0xf0f7('0x21'),_0x40ebde+'-'+_0x48b3fe+'/'+_0x26b212)[_0xf0f7('0x1b')](_0x582568);}return null;};}function patchUpdates(_0x437668){return function(_0x442078){try{jsonpatch['apply'](_0x442078,_0x437668,!![]);}catch(_0x48041b){return BPromise['reject'](_0x48041b);}return _0x442078['save']();};}function saveUpdates(_0x527b1f,_0x26076b){return function(_0x1131c5){if(_0x1131c5){return _0x1131c5[_0xf0f7('0x22')](_0x527b1f)[_0xf0f7('0x23')](function(_0xc4999b){return _0xc4999b;});}return null;};}function removeEntity(_0x2516f7,_0x5591df){return function(_0x2f9a01){if(_0x2f9a01){return _0x2f9a01['destroy']()[_0xf0f7('0x23')](function(){var _0x5d275d=_0x2f9a01[_0xf0f7('0x24')]({'plain':!![]});var _0x4288e7=_0xf0f7('0x25');return db['UserProfileResource'][_0xf0f7('0x26')]({'where':{'type':_0x4288e7,'resourceId':_0x5d275d['id']}})[_0xf0f7('0x23')](function(){return _0x2f9a01;});})[_0xf0f7('0x23')](function(){_0x2516f7[_0xf0f7('0x1a')](0xcc)[_0xf0f7('0x19')]();});}};}function handleEntityNotFound(_0x3e8e9c,_0x5a1183){return function(_0x2f22ef){if(!_0x2f22ef){_0x3e8e9c[_0xf0f7('0x18')](0x194);}return _0x2f22ef;};}function handleError(_0x1e3b18,_0x387e3f){_0x387e3f=_0x387e3f||0x1f4;return function(_0x14a947){logger[_0xf0f7('0x27')](_0x14a947[_0xf0f7('0x28')]);if(_0x14a947[_0xf0f7('0x29')]){delete _0x14a947[_0xf0f7('0x29')];}_0x1e3b18[_0xf0f7('0x1a')](_0x387e3f)[_0xf0f7('0x2a')](_0x14a947);};}exports[_0xf0f7('0x2b')]=function(_0x32627c,_0x4ef006){var _0x555b0a={},_0x1da971={},_0x279038={'count':0x0,'rows':[]};var _0x4d0cf4=_['map'](db['Trigger'][_0xf0f7('0x2c')],function(_0x4d43c8){return{'name':_0x4d43c8['fieldName'],'type':_0x4d43c8[_0xf0f7('0x2d')][_0xf0f7('0x2e')]};});_0x1da971[_0xf0f7('0x2f')]=_[_0xf0f7('0x30')](_0x4d0cf4,'name');_0x1da971[_0xf0f7('0x31')]=_['keys'](_0x32627c[_0xf0f7('0x31')]);_0x1da971[_0xf0f7('0x32')]=_['intersection'](_0x1da971[_0xf0f7('0x2f')],_0x1da971[_0xf0f7('0x31')]);_0x555b0a[_0xf0f7('0x33')]=_[_0xf0f7('0x34')](_0x1da971[_0xf0f7('0x2f')],qs[_0xf0f7('0x35')](_0x32627c['query'][_0xf0f7('0x35')]));_0x555b0a[_0xf0f7('0x33')]=_0x555b0a['attributes'][_0xf0f7('0x36')]?_0x555b0a[_0xf0f7('0x33')]:_0x1da971[_0xf0f7('0x2f')];if(!_0x32627c[_0xf0f7('0x31')][_0xf0f7('0x37')](_0xf0f7('0x38'))){_0x555b0a[_0xf0f7('0x1e')]=qs[_0xf0f7('0x1e')](_0x32627c[_0xf0f7('0x31')]['limit']);_0x555b0a['offset']=qs['offset'](_0x32627c[_0xf0f7('0x31')][_0xf0f7('0x1c')]);}_0x555b0a[_0xf0f7('0x39')]=qs[_0xf0f7('0x3a')](_0x32627c[_0xf0f7('0x31')]['sort']);_0x555b0a[_0xf0f7('0x3b')]=qs[_0xf0f7('0x32')](_['pick'](_0x32627c[_0xf0f7('0x31')],_0x1da971[_0xf0f7('0x32')]),_0x4d0cf4);if(_0x32627c[_0xf0f7('0x31')][_0xf0f7('0x3c')]){_0x555b0a[_0xf0f7('0x3b')]=_[_0xf0f7('0x3d')](_0x555b0a[_0xf0f7('0x3b')],{'$or':_['map'](_0x4d0cf4,function(_0x587268){if(_0x587268[_0xf0f7('0x2d')]!==_0xf0f7('0x3e')){var _0x26c83c={};_0x26c83c[_0x587268[_0xf0f7('0x29')]]={'$like':'%'+_0x32627c['query'][_0xf0f7('0x3c')]+'%'};return _0x26c83c;}})});}_0x555b0a=_[_0xf0f7('0x3d')]({},_0x555b0a,_0x32627c[_0xf0f7('0x3f')]);var _0xc7f59c={'where':_0x555b0a[_0xf0f7('0x3b')]};return db[_0xf0f7('0x40')][_0xf0f7('0x1f')](_0xc7f59c)[_0xf0f7('0x23')](function(_0x4344c6){_0x279038['count']=_0x4344c6;if(_0x32627c[_0xf0f7('0x31')]['includeAll']){_0x555b0a[_0xf0f7('0x41')]=[{'all':!![]}];}return db[_0xf0f7('0x40')][_0xf0f7('0x42')](_0x555b0a);})[_0xf0f7('0x23')](function(_0x4aff15){_0x279038['rows']=_0x4aff15;return _0x279038;})[_0xf0f7('0x23')](respondWithFilteredResult(_0x4ef006,_0x555b0a))[_0xf0f7('0x43')](handleError(_0x4ef006,null));};exports[_0xf0f7('0x44')]=function(_0x319a65,_0x4d9fac){var _0x57fc0d={'raw':![],'where':{'id':_0x319a65[_0xf0f7('0x45')]['id']}},_0x32ac8c={};_0x32ac8c[_0xf0f7('0x2f')]=_[_0xf0f7('0x46')](db['Trigger'][_0xf0f7('0x2c')]);_0x32ac8c[_0xf0f7('0x31')]=_[_0xf0f7('0x46')](_0x319a65[_0xf0f7('0x31')]);_0x32ac8c[_0xf0f7('0x32')]=_[_0xf0f7('0x34')](_0x32ac8c[_0xf0f7('0x2f')],_0x32ac8c[_0xf0f7('0x31')]);_0x57fc0d[_0xf0f7('0x33')]=_[_0xf0f7('0x34')](_0x32ac8c[_0xf0f7('0x2f')],qs[_0xf0f7('0x35')](_0x319a65[_0xf0f7('0x31')][_0xf0f7('0x35')]));_0x57fc0d[_0xf0f7('0x33')]=_0x57fc0d['attributes']['length']?_0x57fc0d[_0xf0f7('0x33')]:_0x32ac8c['model'];if(_0x319a65[_0xf0f7('0x31')][_0xf0f7('0x47')]){_0x57fc0d['include']=[{'all':!![]}];}_0x57fc0d=_[_0xf0f7('0x3d')]({},_0x57fc0d,_0x319a65[_0xf0f7('0x3f')]);return db[_0xf0f7('0x40')][_0xf0f7('0x48')](_0x57fc0d)['then'](handleEntityNotFound(_0x4d9fac,null))[_0xf0f7('0x23')](respondWithResult(_0x4d9fac,null))[_0xf0f7('0x43')](handleError(_0x4d9fac,null));};exports[_0xf0f7('0x49')]=function(_0x102ef2,_0x4e4e78){return db[_0xf0f7('0x40')]['create'](_0x102ef2[_0xf0f7('0x4a')],{})['then'](function(_0x2c4ab8){var _0x23996e=_0x102ef2['user'][_0xf0f7('0x24')]({'plain':!![]});if(!_0x23996e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23996e[_0xf0f7('0x4b')]===_0xf0f7('0x4c')){var _0x1e148b=_0x2c4ab8['get']({'plain':!![]});var _0x79a45f=_0xf0f7('0x25');return db[_0xf0f7('0x4d')][_0xf0f7('0x48')]({'where':{'name':_0x79a45f,'userProfileId':_0x23996e[_0xf0f7('0x4e')]},'raw':!![]})['then'](function(_0x1d72c2){if(_0x1d72c2&&_0x1d72c2[_0xf0f7('0x4f')]===0x0){return db['UserProfileResource'][_0xf0f7('0x49')]({'name':_0x1e148b[_0xf0f7('0x29')],'resourceId':_0x1e148b['id'],'type':_0x1d72c2[_0xf0f7('0x29')],'sectionId':_0x1d72c2['id']},{})['then'](function(){return _0x2c4ab8;});}else{return _0x2c4ab8;}})['catch'](function(_0x1d3ee3){logger[_0xf0f7('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d3ee3);throw _0x1d3ee3;});}return _0x2c4ab8;})[_0xf0f7('0x23')](respondWithResult(_0x4e4e78,0xc9))[_0xf0f7('0x43')](handleError(_0x4e4e78,null));};exports[_0xf0f7('0x22')]=function(_0x66b881,_0x5df02b){if(_0x66b881['body']['id']){delete _0x66b881[_0xf0f7('0x4a')]['id'];}return db[_0xf0f7('0x40')][_0xf0f7('0x48')]({'where':{'id':_0x66b881[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x5df02b,null))[_0xf0f7('0x23')](saveUpdates(_0x66b881[_0xf0f7('0x4a')],null))[_0xf0f7('0x23')](respondWithResult(_0x5df02b,null))[_0xf0f7('0x43')](handleError(_0x5df02b,null));};exports[_0xf0f7('0x26')]=function(_0x4c5148,_0x13b148){return db[_0xf0f7('0x40')][_0xf0f7('0x48')]({'where':{'id':_0x4c5148[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x13b148,null))['then'](removeEntity(_0x13b148,null))[_0xf0f7('0x43')](handleError(_0x13b148,null));};exports[_0xf0f7('0x50')]=function(_0x14d130,_0x5335cc,_0x1e2de4){if(_0x14d130[_0xf0f7('0x4a')]['id']){delete _0x14d130[_0xf0f7('0x4a')]['id'];}return db['Trigger']['find']({'where':{'id':_0x14d130[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x5335cc,null))[_0xf0f7('0x23')](function(_0x3c1bee){if(_0x3c1bee){_0x14d130[_0xf0f7('0x4a')][_0xf0f7('0x51')]=_0x3c1bee['id'];return db['Condition']['create'](_0x14d130[_0xf0f7('0x4a')]);}})[_0xf0f7('0x23')](respondWithResult(_0x5335cc,null))['catch'](handleError(_0x5335cc,null));};exports['addAnyCondition']=function(_0xf84a5e,_0x18c5fb,_0xe2bdd0){if(_0xf84a5e[_0xf0f7('0x4a')]['id']){delete _0xf84a5e[_0xf0f7('0x4a')]['id'];}return db[_0xf0f7('0x40')]['find']({'where':{'id':_0xf84a5e[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x18c5fb,null))['then'](function(_0x11293c){if(_0x11293c){_0xf84a5e[_0xf0f7('0x4a')][_0xf0f7('0x52')]=_0x11293c['id'];return db['Condition']['create'](_0xf84a5e['body']);}})[_0xf0f7('0x23')](respondWithResult(_0x18c5fb,null))['catch'](handleError(_0x18c5fb,null));};exports['getAllConditions']=function(_0x43ccb7,_0x242ae6,_0x25296c){var _0x4b7e7a={};var _0x1ecf0e={};var _0x57d29b;var _0xedf8b7;return db['Trigger'][_0xf0f7('0x53')]({'where':{'id':_0x43ccb7[_0xf0f7('0x45')]['id']}})['then'](handleEntityNotFound(_0x242ae6,null))[_0xf0f7('0x23')](function(_0x55a7d2){if(_0x55a7d2){_0x57d29b=_0x55a7d2;_0x1ecf0e[_0xf0f7('0x2f')]=_[_0xf0f7('0x46')](db[_0xf0f7('0x54')][_0xf0f7('0x2c')]);_0x1ecf0e[_0xf0f7('0x31')]=_[_0xf0f7('0x46')](_0x43ccb7[_0xf0f7('0x31')]);_0x1ecf0e[_0xf0f7('0x32')]=_[_0xf0f7('0x34')](_0x1ecf0e[_0xf0f7('0x2f')],_0x1ecf0e[_0xf0f7('0x31')]);_0x4b7e7a[_0xf0f7('0x33')]=_[_0xf0f7('0x34')](_0x1ecf0e[_0xf0f7('0x2f')],qs[_0xf0f7('0x35')](_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x35')]));_0x4b7e7a['attributes']=_0x4b7e7a[_0xf0f7('0x33')][_0xf0f7('0x36')]?_0x4b7e7a[_0xf0f7('0x33')]:_0x1ecf0e[_0xf0f7('0x2f')];_0x4b7e7a[_0xf0f7('0x39')]=qs[_0xf0f7('0x3a')](_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x3a')]);_0x4b7e7a['where']=qs[_0xf0f7('0x32')](_[_0xf0f7('0x55')](_0x43ccb7[_0xf0f7('0x31')],_0x1ecf0e['filters']));if(_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x3c')]){_0x4b7e7a[_0xf0f7('0x3b')]=_[_0xf0f7('0x3d')](_0x4b7e7a['where'],{'$or':_[_0xf0f7('0x30')](_0x4b7e7a[_0xf0f7('0x33')],function(_0x1ad8e2){var _0x4340ea={};_0x4340ea[_0x1ad8e2]={'$like':'%'+_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x3c')]+'%'};return _0x4340ea;})});}_0x4b7e7a=_['merge']({},_0x4b7e7a,_0x43ccb7[_0xf0f7('0x3f')]);return _0x57d29b[_0xf0f7('0x56')](_0x4b7e7a);}})[_0xf0f7('0x23')](function(_0x20dac4){if(_0x20dac4){_0xedf8b7=_0x20dac4[_0xf0f7('0x36')];if(!_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x37')](_0xf0f7('0x38'))){_0x4b7e7a['limit']=qs[_0xf0f7('0x1e')](_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x1e')]);_0x4b7e7a[_0xf0f7('0x1c')]=qs['offset'](_0x43ccb7[_0xf0f7('0x31')][_0xf0f7('0x1c')]);}return _0x57d29b[_0xf0f7('0x56')](_0x4b7e7a);}})['then'](function(_0x1b2aff){if(_0x1b2aff){return _0x1b2aff?{'count':_0xedf8b7,'rows':_0x1b2aff}:null;}})[_0xf0f7('0x23')](respondWithResult(_0x242ae6,null))[_0xf0f7('0x43')](handleError(_0x242ae6,null));};exports[_0xf0f7('0x57')]=function(_0x36bc53,_0x48d095,_0x4b8e4a){var _0x45c88c={};var _0x454744={};var _0x44a049;var _0x286354;return db[_0xf0f7('0x40')][_0xf0f7('0x53')]({'where':{'id':_0x36bc53['params']['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x48d095,null))[_0xf0f7('0x23')](function(_0xdaad76){if(_0xdaad76){_0x44a049=_0xdaad76;_0x454744['model']=_[_0xf0f7('0x46')](db[_0xf0f7('0x54')][_0xf0f7('0x2c')]);_0x454744[_0xf0f7('0x31')]=_[_0xf0f7('0x46')](_0x36bc53[_0xf0f7('0x31')]);_0x454744[_0xf0f7('0x32')]=_[_0xf0f7('0x34')](_0x454744[_0xf0f7('0x2f')],_0x454744[_0xf0f7('0x31')]);_0x45c88c[_0xf0f7('0x33')]=_[_0xf0f7('0x34')](_0x454744[_0xf0f7('0x2f')],qs['fields'](_0x36bc53[_0xf0f7('0x31')]['fields']));_0x45c88c[_0xf0f7('0x33')]=_0x45c88c[_0xf0f7('0x33')][_0xf0f7('0x36')]?_0x45c88c[_0xf0f7('0x33')]:_0x454744[_0xf0f7('0x2f')];_0x45c88c[_0xf0f7('0x39')]=qs['sort'](_0x36bc53[_0xf0f7('0x31')][_0xf0f7('0x3a')]);_0x45c88c[_0xf0f7('0x3b')]=qs[_0xf0f7('0x32')](_['pick'](_0x36bc53[_0xf0f7('0x31')],_0x454744[_0xf0f7('0x32')]));if(_0x36bc53['query'][_0xf0f7('0x3c')]){_0x45c88c[_0xf0f7('0x3b')]=_['merge'](_0x45c88c['where'],{'$or':_[_0xf0f7('0x30')](_0x45c88c['attributes'],function(_0x52351e){var _0x382844={};_0x382844[_0x52351e]={'$like':'%'+_0x36bc53['query'][_0xf0f7('0x3c')]+'%'};return _0x382844;})});}_0x45c88c=_['merge']({},_0x45c88c,_0x36bc53['options']);return _0x44a049[_0xf0f7('0x57')](_0x45c88c);}})[_0xf0f7('0x23')](function(_0x3316a3){if(_0x3316a3){_0x286354=_0x3316a3[_0xf0f7('0x36')];if(!_0x36bc53[_0xf0f7('0x31')][_0xf0f7('0x37')](_0xf0f7('0x38'))){_0x45c88c[_0xf0f7('0x1e')]=qs[_0xf0f7('0x1e')](_0x36bc53[_0xf0f7('0x31')]['limit']);_0x45c88c[_0xf0f7('0x1c')]=qs[_0xf0f7('0x1c')](_0x36bc53[_0xf0f7('0x31')]['offset']);}return _0x44a049[_0xf0f7('0x57')](_0x45c88c);}})[_0xf0f7('0x23')](function(_0x11aa0a){if(_0x11aa0a){return _0x11aa0a?{'count':_0x286354,'rows':_0x11aa0a}:null;}})['then'](respondWithResult(_0x48d095,null))[_0xf0f7('0x43')](handleError(_0x48d095,null));};exports[_0xf0f7('0x58')]=function(_0x1f29a0,_0x411547,_0x5d30c5){if(_0x1f29a0[_0xf0f7('0x4a')]['id']){delete _0x1f29a0['body']['id'];}return db[_0xf0f7('0x40')][_0xf0f7('0x48')]({'where':{'id':_0x1f29a0[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x411547,null))[_0xf0f7('0x23')](function(_0x58a62f){if(_0x58a62f){_0x1f29a0[_0xf0f7('0x4a')][_0xf0f7('0x59')]=_0x58a62f['id'];return db[_0xf0f7('0x5a')][_0xf0f7('0x49')](_0x1f29a0[_0xf0f7('0x4a')]);}})[_0xf0f7('0x23')](respondWithResult(_0x411547,null))[_0xf0f7('0x43')](handleError(_0x411547,null));};exports[_0xf0f7('0x5b')]=function(_0xb0a8a8,_0x47f8c6,_0x4c1138){var _0x11319b={};var _0x7ff2c9={};var _0x17f708;var _0x4fc306;return db[_0xf0f7('0x40')][_0xf0f7('0x53')]({'where':{'id':_0xb0a8a8[_0xf0f7('0x45')]['id']}})[_0xf0f7('0x23')](handleEntityNotFound(_0x47f8c6,null))[_0xf0f7('0x23')](function(_0x312c8b){if(_0x312c8b){_0x17f708=_0x312c8b;_0x7ff2c9[_0xf0f7('0x2f')]=_['keys'](db[_0xf0f7('0x5a')][_0xf0f7('0x2c')]);_0x7ff2c9[_0xf0f7('0x31')]=_['keys'](_0xb0a8a8['query']);_0x7ff2c9[_0xf0f7('0x32')]=_[_0xf0f7('0x34')](_0x7ff2c9['model'],_0x7ff2c9[_0xf0f7('0x31')]);_0x11319b[_0xf0f7('0x33')]=_[_0xf0f7('0x34')](_0x7ff2c9[_0xf0f7('0x2f')],qs['fields'](_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x35')]));_0x11319b[_0xf0f7('0x33')]=_0x11319b[_0xf0f7('0x33')]['length']?_0x11319b[_0xf0f7('0x33')]:_0x7ff2c9[_0xf0f7('0x2f')];_0x11319b['order']=qs['sort'](_0xb0a8a8[_0xf0f7('0x31')]['sort']);_0x11319b[_0xf0f7('0x3b')]=qs[_0xf0f7('0x32')](_[_0xf0f7('0x55')](_0xb0a8a8[_0xf0f7('0x31')],_0x7ff2c9['filters']));if(_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x3c')]){_0x11319b['where']=_[_0xf0f7('0x3d')](_0x11319b[_0xf0f7('0x3b')],{'$or':_[_0xf0f7('0x30')](_0x11319b[_0xf0f7('0x33')],function(_0x2d3742){var _0x2d814c={};_0x2d814c[_0x2d3742]={'$like':'%'+_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x3c')]+'%'};return _0x2d814c;})});}_0x11319b=_['merge']({},_0x11319b,_0xb0a8a8[_0xf0f7('0x3f')]);return _0x17f708['getActions'](_0x11319b);}})[_0xf0f7('0x23')](function(_0x6f34c3){if(_0x6f34c3){_0x4fc306=_0x6f34c3[_0xf0f7('0x36')];if(!_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x37')](_0xf0f7('0x38'))){_0x11319b[_0xf0f7('0x1e')]=qs[_0xf0f7('0x1e')](_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x1e')]);_0x11319b['offset']=qs[_0xf0f7('0x1c')](_0xb0a8a8[_0xf0f7('0x31')][_0xf0f7('0x1c')]);}return _0x17f708['getActions'](_0x11319b);}})[_0xf0f7('0x23')](function(_0x1c6f70){if(_0x1c6f70){return _0x1c6f70?{'count':_0x4fc306,'rows':_0x1c6f70}:null;}})['then'](respondWithResult(_0x47f8c6,null))[_0xf0f7('0x43')](handleError(_0x47f8c6,null));};
\ No newline at end of file
+var _0xb9e1=['status','set','apply','reject','save','then','destroy','get','Triggers','UserProfileResource','sendStatus','error','stack','name','send','index','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','Trigger','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','Condition','addAnyCondition','getAllConditions','findOne','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit'];(function(_0x1f27d4,_0x295f38){var _0x466b47=function(_0x5e49d7){while(--_0x5e49d7){_0x1f27d4['push'](_0x1f27d4['shift']());}};_0x466b47(++_0x295f38);}(_0xb9e1,0x1c5));var _0x1b9e=function(_0x3f2ad0,_0x10d42b){_0x3f2ad0=_0x3f2ad0-0x0;var _0x5a9b8d=_0xb9e1[_0x3f2ad0];return _0x5a9b8d;};'use strict';var emlformat=require(_0x1b9e('0x0'));var rimraf=require(_0x1b9e('0x1'));var zipdir=require(_0x1b9e('0x2'));var jsonpatch=require(_0x1b9e('0x3'));var rp=require(_0x1b9e('0x4'));var moment=require(_0x1b9e('0x5'));var BPromise=require(_0x1b9e('0x6'));var Mustache=require(_0x1b9e('0x7'));var util=require('util');var path=require('path');var sox=require(_0x1b9e('0x8'));var csv=require(_0x1b9e('0x9'));var ejs=require(_0x1b9e('0xa'));var fs=require('fs');var fs_extra=require(_0x1b9e('0xb'));var _=require(_0x1b9e('0xc'));var squel=require(_0x1b9e('0xd'));var crypto=require('crypto');var jsforce=require(_0x1b9e('0xe'));var deskjs=require(_0x1b9e('0xf'));var toCsv=require(_0x1b9e('0x9'));var querystring=require(_0x1b9e('0x10'));var Papa=require(_0x1b9e('0x11'));var Redis=require(_0x1b9e('0x12'));var authService=require(_0x1b9e('0x13'));var qs=require(_0x1b9e('0x14'));var as=require(_0x1b9e('0x15'));var hardwareService=require(_0x1b9e('0x16'));var logger=require(_0x1b9e('0x17'))(_0x1b9e('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1b9e('0x19'));var db=require(_0x1b9e('0x1a'))['db'];function respondWithStatusCode(_0x29023d,_0x5c99ce){_0x5c99ce=_0x5c99ce||0xcc;return function(_0x3f8ed6){if(_0x3f8ed6){return _0x29023d['sendStatus'](_0x5c99ce);}return _0x29023d['status'](_0x5c99ce)[_0x1b9e('0x1b')]();};}function respondWithResult(_0x186cb4,_0x51b03b){_0x51b03b=_0x51b03b||0xc8;return function(_0x1f8d95){if(_0x1f8d95){return _0x186cb4['status'](_0x51b03b)['json'](_0x1f8d95);}};}function respondWithFilteredResult(_0x95c7a8,_0x21fd27){return function(_0x12da46){if(_0x12da46){var _0x130289=typeof _0x21fd27[_0x1b9e('0x1c')]==='undefined'&&typeof _0x21fd27['limit']===_0x1b9e('0x1d');var _0x50a039=_0x12da46[_0x1b9e('0x1e')];var _0x17f3b6=_0x130289?0x0:_0x21fd27[_0x1b9e('0x1c')];var _0x4e18fd=_0x130289?_0x12da46[_0x1b9e('0x1e')]:_0x21fd27['offset']+_0x21fd27[_0x1b9e('0x1f')];var _0x2fe09b;if(_0x4e18fd>=_0x50a039){_0x4e18fd=_0x50a039;_0x2fe09b=0xc8;}else{_0x2fe09b=0xce;}_0x95c7a8[_0x1b9e('0x20')](_0x2fe09b);return _0x95c7a8[_0x1b9e('0x21')]('Content-Range',_0x17f3b6+'-'+_0x4e18fd+'/'+_0x50a039)['json'](_0x12da46);}return null;};}function patchUpdates(_0x4cc0d4){return function(_0x4cf3a5){try{jsonpatch[_0x1b9e('0x22')](_0x4cf3a5,_0x4cc0d4,!![]);}catch(_0x3f81cd){return BPromise[_0x1b9e('0x23')](_0x3f81cd);}return _0x4cf3a5[_0x1b9e('0x24')]();};}function saveUpdates(_0x496e0b,_0x2f52b9){return function(_0x32b382){if(_0x32b382){return _0x32b382['update'](_0x496e0b)[_0x1b9e('0x25')](function(_0x2aa54e){return _0x2aa54e;});}return null;};}function removeEntity(_0x2e85bd,_0x39afd3){return function(_0x4ef83e){if(_0x4ef83e){return _0x4ef83e[_0x1b9e('0x26')]()[_0x1b9e('0x25')](function(){var _0x58a093=_0x4ef83e[_0x1b9e('0x27')]({'plain':!![]});var _0xfec058=_0x1b9e('0x28');return db[_0x1b9e('0x29')][_0x1b9e('0x26')]({'where':{'type':_0xfec058,'resourceId':_0x58a093['id']}})[_0x1b9e('0x25')](function(){return _0x4ef83e;});})[_0x1b9e('0x25')](function(){_0x2e85bd[_0x1b9e('0x20')](0xcc)[_0x1b9e('0x1b')]();});}};}function handleEntityNotFound(_0x4f40c5,_0x20e78c){return function(_0x59c36f){if(!_0x59c36f){_0x4f40c5[_0x1b9e('0x2a')](0x194);}return _0x59c36f;};}function handleError(_0x134a36,_0x39ddaf){_0x39ddaf=_0x39ddaf||0x1f4;return function(_0x464802){logger[_0x1b9e('0x2b')](_0x464802[_0x1b9e('0x2c')]);if(_0x464802[_0x1b9e('0x2d')]){delete _0x464802[_0x1b9e('0x2d')];}_0x134a36['status'](_0x39ddaf)[_0x1b9e('0x2e')](_0x464802);};}exports[_0x1b9e('0x2f')]=function(_0x33329,_0x5f3f62){var _0xb51c4c={},_0x1faa93={},_0x31afe6={'count':0x0,'rows':[]};var _0x1344ad=_['map'](db['Trigger']['rawAttributes'],function(_0x3b9b94){return{'name':_0x3b9b94[_0x1b9e('0x30')],'type':_0x3b9b94['type'][_0x1b9e('0x31')]};});_0x1faa93[_0x1b9e('0x32')]=_['map'](_0x1344ad,_0x1b9e('0x2d'));_0x1faa93[_0x1b9e('0x33')]=_['keys'](_0x33329[_0x1b9e('0x33')]);_0x1faa93[_0x1b9e('0x34')]=_['intersection'](_0x1faa93['model'],_0x1faa93['query']);_0xb51c4c[_0x1b9e('0x35')]=_[_0x1b9e('0x36')](_0x1faa93[_0x1b9e('0x32')],qs[_0x1b9e('0x37')](_0x33329[_0x1b9e('0x33')][_0x1b9e('0x37')]));_0xb51c4c[_0x1b9e('0x35')]=_0xb51c4c['attributes'][_0x1b9e('0x38')]?_0xb51c4c['attributes']:_0x1faa93[_0x1b9e('0x32')];if(!_0x33329['query'][_0x1b9e('0x39')](_0x1b9e('0x3a'))){_0xb51c4c[_0x1b9e('0x1f')]=qs[_0x1b9e('0x1f')](_0x33329[_0x1b9e('0x33')][_0x1b9e('0x1f')]);_0xb51c4c['offset']=qs[_0x1b9e('0x1c')](_0x33329[_0x1b9e('0x33')][_0x1b9e('0x1c')]);}_0xb51c4c[_0x1b9e('0x3b')]=qs[_0x1b9e('0x3c')](_0x33329[_0x1b9e('0x33')][_0x1b9e('0x3c')]);_0xb51c4c['where']=qs[_0x1b9e('0x34')](_[_0x1b9e('0x3d')](_0x33329[_0x1b9e('0x33')],_0x1faa93['filters']),_0x1344ad);if(_0x33329[_0x1b9e('0x33')][_0x1b9e('0x3e')]){_0xb51c4c[_0x1b9e('0x3f')]=_[_0x1b9e('0x40')](_0xb51c4c[_0x1b9e('0x3f')],{'$or':_[_0x1b9e('0x41')](_0x1344ad,function(_0x26c602){if(_0x26c602[_0x1b9e('0x42')]!==_0x1b9e('0x43')){var _0x3a5b50={};_0x3a5b50[_0x26c602['name']]={'$like':'%'+_0x33329[_0x1b9e('0x33')][_0x1b9e('0x3e')]+'%'};return _0x3a5b50;}})});}_0xb51c4c=_['merge']({},_0xb51c4c,_0x33329[_0x1b9e('0x44')]);var _0x2eeb4a={'where':_0xb51c4c[_0x1b9e('0x3f')]};return db[_0x1b9e('0x45')][_0x1b9e('0x1e')](_0x2eeb4a)[_0x1b9e('0x25')](function(_0x25562b){_0x31afe6[_0x1b9e('0x1e')]=_0x25562b;if(_0x33329[_0x1b9e('0x33')][_0x1b9e('0x46')]){_0xb51c4c['include']=[{'all':!![]}];}return db[_0x1b9e('0x45')][_0x1b9e('0x47')](_0xb51c4c);})[_0x1b9e('0x25')](function(_0x463b8b){_0x31afe6[_0x1b9e('0x48')]=_0x463b8b;return _0x31afe6;})[_0x1b9e('0x25')](respondWithFilteredResult(_0x5f3f62,_0xb51c4c))[_0x1b9e('0x49')](handleError(_0x5f3f62,null));};exports['show']=function(_0x35aecc,_0xef8e0){var _0x347210={'raw':![],'where':{'id':_0x35aecc[_0x1b9e('0x4a')]['id']}},_0x44fcfc={};_0x44fcfc[_0x1b9e('0x32')]=_[_0x1b9e('0x4b')](db[_0x1b9e('0x45')][_0x1b9e('0x4c')]);_0x44fcfc['query']=_[_0x1b9e('0x4b')](_0x35aecc[_0x1b9e('0x33')]);_0x44fcfc[_0x1b9e('0x34')]=_['intersection'](_0x44fcfc[_0x1b9e('0x32')],_0x44fcfc['query']);_0x347210[_0x1b9e('0x35')]=_['intersection'](_0x44fcfc['model'],qs['fields'](_0x35aecc[_0x1b9e('0x33')]['fields']));_0x347210[_0x1b9e('0x35')]=_0x347210[_0x1b9e('0x35')][_0x1b9e('0x38')]?_0x347210['attributes']:_0x44fcfc[_0x1b9e('0x32')];if(_0x35aecc[_0x1b9e('0x33')][_0x1b9e('0x46')]){_0x347210[_0x1b9e('0x4d')]=[{'all':!![]}];}_0x347210=_['merge']({},_0x347210,_0x35aecc['options']);return db[_0x1b9e('0x45')]['find'](_0x347210)[_0x1b9e('0x25')](handleEntityNotFound(_0xef8e0,null))[_0x1b9e('0x25')](respondWithResult(_0xef8e0,null))[_0x1b9e('0x49')](handleError(_0xef8e0,null));};exports[_0x1b9e('0x4e')]=function(_0x2ad6d9,_0x23920c){return db['Trigger'][_0x1b9e('0x4e')](_0x2ad6d9['body'],{})[_0x1b9e('0x25')](function(_0x5efea6){var _0x33a2b0=_0x2ad6d9[_0x1b9e('0x4f')][_0x1b9e('0x27')]({'plain':!![]});if(!_0x33a2b0)throw new Error(_0x1b9e('0x50'));if(_0x33a2b0[_0x1b9e('0x51')]===_0x1b9e('0x4f')){var _0x352adb=_0x5efea6['get']({'plain':!![]});var _0x639ced=_0x1b9e('0x28');return db['UserProfileSection'][_0x1b9e('0x52')]({'where':{'name':_0x639ced,'userProfileId':_0x33a2b0[_0x1b9e('0x53')]},'raw':!![]})[_0x1b9e('0x25')](function(_0x55d7c8){if(_0x55d7c8&&_0x55d7c8[_0x1b9e('0x54')]===0x0){return db[_0x1b9e('0x29')][_0x1b9e('0x4e')]({'name':_0x352adb[_0x1b9e('0x2d')],'resourceId':_0x352adb['id'],'type':_0x55d7c8[_0x1b9e('0x2d')],'sectionId':_0x55d7c8['id']},{})[_0x1b9e('0x25')](function(){return _0x5efea6;});}else{return _0x5efea6;}})[_0x1b9e('0x49')](function(_0x1b6889){logger[_0x1b9e('0x2b')](_0x1b9e('0x55'),_0x1b6889);throw _0x1b6889;});}return _0x5efea6;})['then'](respondWithResult(_0x23920c,0xc9))[_0x1b9e('0x49')](handleError(_0x23920c,null));};exports['update']=function(_0x1b25c3,_0x2751ca){if(_0x1b25c3[_0x1b9e('0x56')]['id']){delete _0x1b25c3[_0x1b9e('0x56')]['id'];}return db['Trigger'][_0x1b9e('0x52')]({'where':{'id':_0x1b25c3['params']['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x2751ca,null))[_0x1b9e('0x25')](saveUpdates(_0x1b25c3[_0x1b9e('0x56')],null))['then'](respondWithResult(_0x2751ca,null))[_0x1b9e('0x49')](handleError(_0x2751ca,null));};exports[_0x1b9e('0x26')]=function(_0x1a29b8,_0x3858fd){return db[_0x1b9e('0x45')][_0x1b9e('0x52')]({'where':{'id':_0x1a29b8['params']['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x3858fd,null))['then'](removeEntity(_0x3858fd,null))[_0x1b9e('0x49')](handleError(_0x3858fd,null));};exports[_0x1b9e('0x57')]=function(_0x143e69,_0x476905,_0x44187e){if(_0x143e69[_0x1b9e('0x56')]['id']){delete _0x143e69['body']['id'];}return db[_0x1b9e('0x45')]['find']({'where':{'id':_0x143e69[_0x1b9e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x476905,null))[_0x1b9e('0x25')](function(_0x205a77){if(_0x205a77){_0x143e69[_0x1b9e('0x56')]['TriggerAllId']=_0x205a77['id'];return db[_0x1b9e('0x58')][_0x1b9e('0x4e')](_0x143e69[_0x1b9e('0x56')]);}})[_0x1b9e('0x25')](respondWithResult(_0x476905,null))[_0x1b9e('0x49')](handleError(_0x476905,null));};exports[_0x1b9e('0x59')]=function(_0x3eec3c,_0x46428e,_0x2b2b17){if(_0x3eec3c[_0x1b9e('0x56')]['id']){delete _0x3eec3c[_0x1b9e('0x56')]['id'];}return db[_0x1b9e('0x45')]['find']({'where':{'id':_0x3eec3c[_0x1b9e('0x4a')]['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x46428e,null))[_0x1b9e('0x25')](function(_0x3d9eba){if(_0x3d9eba){_0x3eec3c[_0x1b9e('0x56')]['TriggerAnyId']=_0x3d9eba['id'];return db[_0x1b9e('0x58')]['create'](_0x3eec3c[_0x1b9e('0x56')]);}})[_0x1b9e('0x25')](respondWithResult(_0x46428e,null))[_0x1b9e('0x49')](handleError(_0x46428e,null));};exports[_0x1b9e('0x5a')]=function(_0x2f0321,_0x3f525a,_0x1fb82e){var _0x115222={};var _0x466b66={};var _0x5286c0;var _0x3c7502;return db['Trigger'][_0x1b9e('0x5b')]({'where':{'id':_0x2f0321[_0x1b9e('0x4a')]['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x3f525a,null))[_0x1b9e('0x25')](function(_0x595a14){if(_0x595a14){_0x5286c0=_0x595a14;_0x466b66[_0x1b9e('0x32')]=_[_0x1b9e('0x4b')](db['Condition'][_0x1b9e('0x4c')]);_0x466b66[_0x1b9e('0x33')]=_[_0x1b9e('0x4b')](_0x2f0321[_0x1b9e('0x33')]);_0x466b66[_0x1b9e('0x34')]=_['intersection'](_0x466b66[_0x1b9e('0x32')],_0x466b66[_0x1b9e('0x33')]);_0x115222[_0x1b9e('0x35')]=_[_0x1b9e('0x36')](_0x466b66[_0x1b9e('0x32')],qs[_0x1b9e('0x37')](_0x2f0321[_0x1b9e('0x33')]['fields']));_0x115222[_0x1b9e('0x35')]=_0x115222[_0x1b9e('0x35')][_0x1b9e('0x38')]?_0x115222[_0x1b9e('0x35')]:_0x466b66[_0x1b9e('0x32')];_0x115222[_0x1b9e('0x3b')]=qs[_0x1b9e('0x3c')](_0x2f0321[_0x1b9e('0x33')]['sort']);_0x115222[_0x1b9e('0x3f')]=qs[_0x1b9e('0x34')](_[_0x1b9e('0x3d')](_0x2f0321[_0x1b9e('0x33')],_0x466b66[_0x1b9e('0x34')]));if(_0x2f0321[_0x1b9e('0x33')][_0x1b9e('0x3e')]){_0x115222[_0x1b9e('0x3f')]=_[_0x1b9e('0x40')](_0x115222['where'],{'$or':_['map'](_0x115222[_0x1b9e('0x35')],function(_0x13e654){var _0x12e115={};_0x12e115[_0x13e654]={'$like':'%'+_0x2f0321[_0x1b9e('0x33')][_0x1b9e('0x3e')]+'%'};return _0x12e115;})});}_0x115222=_[_0x1b9e('0x40')]({},_0x115222,_0x2f0321['options']);return _0x5286c0[_0x1b9e('0x5a')](_0x115222);}})[_0x1b9e('0x25')](function(_0xd711dd){if(_0xd711dd){_0x3c7502=_0xd711dd[_0x1b9e('0x38')];if(!_0x2f0321[_0x1b9e('0x33')][_0x1b9e('0x39')](_0x1b9e('0x3a'))){_0x115222[_0x1b9e('0x1f')]=qs[_0x1b9e('0x1f')](_0x2f0321[_0x1b9e('0x33')][_0x1b9e('0x1f')]);_0x115222[_0x1b9e('0x1c')]=qs['offset'](_0x2f0321[_0x1b9e('0x33')][_0x1b9e('0x1c')]);}return _0x5286c0[_0x1b9e('0x5a')](_0x115222);}})[_0x1b9e('0x25')](function(_0x49dca0){if(_0x49dca0){return _0x49dca0?{'count':_0x3c7502,'rows':_0x49dca0}:null;}})['then'](respondWithResult(_0x3f525a,null))['catch'](handleError(_0x3f525a,null));};exports[_0x1b9e('0x5c')]=function(_0x4b1b49,_0x3e9d33,_0x44ee8f){var _0x4fc21e={};var _0x301641={};var _0x1add78;var _0x5e550a;return db[_0x1b9e('0x45')][_0x1b9e('0x5b')]({'where':{'id':_0x4b1b49['params']['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x3e9d33,null))[_0x1b9e('0x25')](function(_0x3ece35){if(_0x3ece35){_0x1add78=_0x3ece35;_0x301641[_0x1b9e('0x32')]=_[_0x1b9e('0x4b')](db[_0x1b9e('0x58')][_0x1b9e('0x4c')]);_0x301641[_0x1b9e('0x33')]=_[_0x1b9e('0x4b')](_0x4b1b49[_0x1b9e('0x33')]);_0x301641['filters']=_[_0x1b9e('0x36')](_0x301641['model'],_0x301641['query']);_0x4fc21e[_0x1b9e('0x35')]=_['intersection'](_0x301641['model'],qs[_0x1b9e('0x37')](_0x4b1b49[_0x1b9e('0x33')][_0x1b9e('0x37')]));_0x4fc21e[_0x1b9e('0x35')]=_0x4fc21e['attributes']['length']?_0x4fc21e[_0x1b9e('0x35')]:_0x301641[_0x1b9e('0x32')];_0x4fc21e[_0x1b9e('0x3b')]=qs[_0x1b9e('0x3c')](_0x4b1b49[_0x1b9e('0x33')][_0x1b9e('0x3c')]);_0x4fc21e[_0x1b9e('0x3f')]=qs[_0x1b9e('0x34')](_[_0x1b9e('0x3d')](_0x4b1b49['query'],_0x301641[_0x1b9e('0x34')]));if(_0x4b1b49['query']['filter']){_0x4fc21e[_0x1b9e('0x3f')]=_['merge'](_0x4fc21e[_0x1b9e('0x3f')],{'$or':_[_0x1b9e('0x41')](_0x4fc21e[_0x1b9e('0x35')],function(_0x31e354){var _0x517abf={};_0x517abf[_0x31e354]={'$like':'%'+_0x4b1b49['query'][_0x1b9e('0x3e')]+'%'};return _0x517abf;})});}_0x4fc21e=_['merge']({},_0x4fc21e,_0x4b1b49[_0x1b9e('0x44')]);return _0x1add78[_0x1b9e('0x5c')](_0x4fc21e);}})[_0x1b9e('0x25')](function(_0x7003b6){if(_0x7003b6){_0x5e550a=_0x7003b6[_0x1b9e('0x38')];if(!_0x4b1b49[_0x1b9e('0x33')][_0x1b9e('0x39')](_0x1b9e('0x3a'))){_0x4fc21e[_0x1b9e('0x1f')]=qs['limit'](_0x4b1b49[_0x1b9e('0x33')]['limit']);_0x4fc21e[_0x1b9e('0x1c')]=qs[_0x1b9e('0x1c')](_0x4b1b49['query']['offset']);}return _0x1add78[_0x1b9e('0x5c')](_0x4fc21e);}})['then'](function(_0x10b96d){if(_0x10b96d){return _0x10b96d?{'count':_0x5e550a,'rows':_0x10b96d}:null;}})[_0x1b9e('0x25')](respondWithResult(_0x3e9d33,null))[_0x1b9e('0x49')](handleError(_0x3e9d33,null));};exports[_0x1b9e('0x5d')]=function(_0x1ece4c,_0x2b4d47,_0x5247ab){if(_0x1ece4c[_0x1b9e('0x56')]['id']){delete _0x1ece4c[_0x1b9e('0x56')]['id'];}return db[_0x1b9e('0x45')][_0x1b9e('0x52')]({'where':{'id':_0x1ece4c['params']['id']}})['then'](handleEntityNotFound(_0x2b4d47,null))[_0x1b9e('0x25')](function(_0xf96572){if(_0xf96572){_0x1ece4c[_0x1b9e('0x56')][_0x1b9e('0x5e')]=_0xf96572['id'];return db['Action'][_0x1b9e('0x4e')](_0x1ece4c[_0x1b9e('0x56')]);}})[_0x1b9e('0x25')](respondWithResult(_0x2b4d47,null))[_0x1b9e('0x49')](handleError(_0x2b4d47,null));};exports[_0x1b9e('0x5f')]=function(_0xcdc5c5,_0x280d6c,_0x443a1a){var _0x5219e0={};var _0x36d776={};var _0xe0fcb0;var _0x45899a;return db['Trigger']['findOne']({'where':{'id':_0xcdc5c5['params']['id']}})[_0x1b9e('0x25')](handleEntityNotFound(_0x280d6c,null))['then'](function(_0x5491d6){if(_0x5491d6){_0xe0fcb0=_0x5491d6;_0x36d776[_0x1b9e('0x32')]=_[_0x1b9e('0x4b')](db[_0x1b9e('0x60')]['rawAttributes']);_0x36d776[_0x1b9e('0x33')]=_[_0x1b9e('0x4b')](_0xcdc5c5['query']);_0x36d776[_0x1b9e('0x34')]=_[_0x1b9e('0x36')](_0x36d776[_0x1b9e('0x32')],_0x36d776[_0x1b9e('0x33')]);_0x5219e0[_0x1b9e('0x35')]=_[_0x1b9e('0x36')](_0x36d776[_0x1b9e('0x32')],qs[_0x1b9e('0x37')](_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x37')]));_0x5219e0['attributes']=_0x5219e0[_0x1b9e('0x35')][_0x1b9e('0x38')]?_0x5219e0['attributes']:_0x36d776[_0x1b9e('0x32')];_0x5219e0['order']=qs[_0x1b9e('0x3c')](_0xcdc5c5[_0x1b9e('0x33')]['sort']);_0x5219e0[_0x1b9e('0x3f')]=qs[_0x1b9e('0x34')](_[_0x1b9e('0x3d')](_0xcdc5c5['query'],_0x36d776[_0x1b9e('0x34')]));if(_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x3e')]){_0x5219e0['where']=_['merge'](_0x5219e0['where'],{'$or':_[_0x1b9e('0x41')](_0x5219e0[_0x1b9e('0x35')],function(_0x445512){var _0x661183={};_0x661183[_0x445512]={'$like':'%'+_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x3e')]+'%'};return _0x661183;})});}_0x5219e0=_['merge']({},_0x5219e0,_0xcdc5c5['options']);return _0xe0fcb0[_0x1b9e('0x5f')](_0x5219e0);}})[_0x1b9e('0x25')](function(_0x4efc98){if(_0x4efc98){_0x45899a=_0x4efc98[_0x1b9e('0x38')];if(!_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x39')](_0x1b9e('0x3a'))){_0x5219e0['limit']=qs[_0x1b9e('0x1f')](_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x1f')]);_0x5219e0['offset']=qs[_0x1b9e('0x1c')](_0xcdc5c5[_0x1b9e('0x33')][_0x1b9e('0x1c')]);}return _0xe0fcb0[_0x1b9e('0x5f')](_0x5219e0);}})[_0x1b9e('0x25')](function(_0x220c32){if(_0x220c32){return _0x220c32?{'count':_0x45899a,'rows':_0x220c32}:null;}})[_0x1b9e('0x25')](respondWithResult(_0x280d6c,null))['catch'](handleError(_0x280d6c,null));};
\ No newline at end of file
index a64f1f5..05e83ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff16=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','lodash','util','api'];(function(_0xd58764,_0x32980a){var _0x149e36=function(_0x4c5a9e){while(--_0x4c5a9e){_0xd58764['push'](_0xd58764['shift']());}};_0x149e36(++_0x32980a);}(_0xff16,0x7f));var _0x6ff1=function(_0x5161db,_0x4b1fe2){_0x5161db=_0x5161db-0x0;var _0x2544e6=_0xff16[_0x5161db];return _0x2544e6;};'use strict';var _=require(_0x6ff1('0x0'));var util=require(_0x6ff1('0x1'));var logger=require('../../config/logger')(_0x6ff1('0x2'));var moment=require(_0x6ff1('0x3'));var BPromise=require(_0x6ff1('0x4'));var rp=require(_0x6ff1('0x5'));var fs=require('fs');var path=require(_0x6ff1('0x6'));var rimraf=require(_0x6ff1('0x7'));var config=require(_0x6ff1('0x8'));var attributes=require(_0x6ff1('0x9'));module['exports']=function(_0x153a91,_0x4f8f24){return _0x153a91[_0x6ff1('0xa')](_0x6ff1('0xb'),attributes,{'tableName':_0x6ff1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6726=['../../config/logger','moment','bluebird','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','util'];(function(_0x559c8f,_0x3ed292){var _0x3710d8=function(_0x32965f){while(--_0x32965f){_0x559c8f['push'](_0x559c8f['shift']());}};_0x3710d8(++_0x3ed292);}(_0x6726,0xdb));var _0x6672=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0x6726[_0x511bd1];return _0x4c48ec;};'use strict';var _=require('lodash');var util=require(_0x6672('0x0'));var logger=require(_0x6672('0x1'))('api');var moment=require(_0x6672('0x2'));var BPromise=require(_0x6672('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6672('0x4'));var rimraf=require('rimraf');var config=require(_0x6672('0x5'));var attributes=require(_0x6672('0x6'));module[_0x6672('0x7')]=function(_0x40ba7e,_0x5701b9){return _0x40ba7e[_0x6672('0x8')](_0x6672('0x9'),attributes,{'tableName':_0x6672('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 788c055..69e64f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfe3=['code','message','result','catch','Trigger','findAll','raw','where','options','attributes','include','map','model','then','GetTrigger','ShowTrigger','find','lodash','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xed5313,_0x5da56f){var _0x1298c1=function(_0x4da621){while(--_0x4da621){_0xed5313['push'](_0xed5313['shift']());}};_0x1298c1(++_0x5da56f);}(_0xcfe3,0x1ed));var _0x3cfe=function(_0x581bf1,_0x123285){_0x581bf1=_0x581bf1-0x0;var _0x1bfcd4=_0xcfe3[_0x581bf1];return _0x1bfcd4;};'use strict';var _=require(_0x3cfe('0x0'));var util=require('util');var moment=require(_0x3cfe('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cfe('0x2'));var db=require(_0x3cfe('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3cfe('0x4'))('rpc');var config=require(_0x3cfe('0x5'));var jayson=require(_0x3cfe('0x6'));var client=jayson[_0x3cfe('0x7')][_0x3cfe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34089a,_0x30893a,_0xfa961f){return new BPromise(function(_0x55af24,_0x4c08f6){return client[_0x3cfe('0x9')](_0x34089a,_0xfa961f)['then'](function(_0x5e74b4){logger[_0x3cfe('0xa')](_0x3cfe('0xb'),_0x30893a,_0x3cfe('0xc'));logger[_0x3cfe('0xd')](_0x3cfe('0xe'),_0x30893a,_0x3cfe('0xc'),JSON[_0x3cfe('0xf')](_0x5e74b4));if(_0x5e74b4[_0x3cfe('0x10')]){if(_0x5e74b4[_0x3cfe('0x10')][_0x3cfe('0x11')]===0x1f4){logger[_0x3cfe('0x10')](_0x3cfe('0xb'),_0x30893a,_0x5e74b4[_0x3cfe('0x10')][_0x3cfe('0x12')]);return _0x4c08f6(_0x5e74b4['error']['message']);}logger[_0x3cfe('0x10')](_0x3cfe('0xb'),_0x30893a,_0x5e74b4[_0x3cfe('0x10')]['message']);return _0x55af24(_0x5e74b4[_0x3cfe('0x10')]['message']);}else{logger[_0x3cfe('0xa')](_0x3cfe('0xb'),_0x30893a,_0x3cfe('0xc'));_0x55af24(_0x5e74b4[_0x3cfe('0x13')][_0x3cfe('0x12')]);}})[_0x3cfe('0x14')](function(_0x5951e8){logger[_0x3cfe('0x10')](_0x3cfe('0xb'),_0x30893a,_0x5951e8);_0x4c08f6(_0x5951e8);});});}exports['GetTrigger']=function(_0xf9176b){var _0x10f657=this;return new Promise(function(_0x561e27,_0x2fabde){return db[_0x3cfe('0x15')][_0x3cfe('0x16')]({'raw':_0xf9176b['options']?_0xf9176b['options'][_0x3cfe('0x17')]===undefined?!![]:![]:!![],'where':_0xf9176b['options']?_0xf9176b['options'][_0x3cfe('0x18')]||null:null,'attributes':_0xf9176b[_0x3cfe('0x19')]?_0xf9176b[_0x3cfe('0x19')][_0x3cfe('0x1a')]||null:null,'limit':_0xf9176b['options']?_0xf9176b[_0x3cfe('0x19')]['limit']||null:null,'include':_0xf9176b[_0x3cfe('0x19')]?_0xf9176b[_0x3cfe('0x19')][_0x3cfe('0x1b')]?_[_0x3cfe('0x1c')](_0xf9176b[_0x3cfe('0x19')][_0x3cfe('0x1b')],function(_0x35804c){return{'model':db[_0x35804c['model']],'as':_0x35804c['as'],'attributes':_0x35804c[_0x3cfe('0x1a')],'include':_0x35804c[_0x3cfe('0x1b')]?_[_0x3cfe('0x1c')](_0x35804c[_0x3cfe('0x1b')],function(_0x4ffea1){return{'model':db[_0x4ffea1['model']],'as':_0x4ffea1['as'],'attributes':_0x4ffea1[_0x3cfe('0x1a')],'include':_0x4ffea1[_0x3cfe('0x1b')]?_[_0x3cfe('0x1c')](_0x4ffea1['include'],function(_0x37b486){return{'model':db[_0x37b486[_0x3cfe('0x1d')]],'as':_0x37b486['as'],'attributes':_0x37b486[_0x3cfe('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3cfe('0x1e')](function(_0x16ee81){logger[_0x3cfe('0xa')](_0x3cfe('0x1f'),_0xf9176b);logger[_0x3cfe('0xd')]('GetTrigger',_0xf9176b,JSON[_0x3cfe('0xf')](_0x16ee81));_0x561e27(_0x16ee81);})[_0x3cfe('0x14')](function(_0x1a832f){logger[_0x3cfe('0x10')](_0x3cfe('0x1f'),_0x1a832f[_0x3cfe('0x12')],_0xf9176b);_0x2fabde(_0x10f657[_0x3cfe('0x10')](0x1f4,_0x1a832f[_0x3cfe('0x12')]));});});};exports[_0x3cfe('0x20')]=function(_0x4ddf71){var _0x498796=this;return new Promise(function(_0x1f13d1,_0xf64909){return db[_0x3cfe('0x15')][_0x3cfe('0x21')]({'raw':_0x4ddf71[_0x3cfe('0x19')]?_0x4ddf71[_0x3cfe('0x19')][_0x3cfe('0x17')]===undefined?!![]:![]:!![],'where':_0x4ddf71[_0x3cfe('0x19')]?_0x4ddf71[_0x3cfe('0x19')][_0x3cfe('0x18')]||null:null,'attributes':_0x4ddf71[_0x3cfe('0x19')]?_0x4ddf71[_0x3cfe('0x19')][_0x3cfe('0x1a')]||null:null,'include':_0x4ddf71[_0x3cfe('0x19')]?_0x4ddf71[_0x3cfe('0x19')][_0x3cfe('0x1b')]?_[_0x3cfe('0x1c')](_0x4ddf71[_0x3cfe('0x19')][_0x3cfe('0x1b')],function(_0x122143){return{'model':db[_0x122143[_0x3cfe('0x1d')]],'as':_0x122143['as'],'attributes':_0x122143[_0x3cfe('0x1a')],'include':_0x122143['include']?_[_0x3cfe('0x1c')](_0x122143[_0x3cfe('0x1b')],function(_0x9c0b24){return{'model':db[_0x9c0b24[_0x3cfe('0x1d')]],'as':_0x9c0b24['as'],'attributes':_0x9c0b24[_0x3cfe('0x1a')],'include':_0x9c0b24[_0x3cfe('0x1b')]?_['map'](_0x9c0b24['include'],function(_0x5af865){return{'model':db[_0x5af865[_0x3cfe('0x1d')]],'as':_0x5af865['as'],'attributes':_0x5af865[_0x3cfe('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ddf91){logger['info'](_0x3cfe('0x20'),_0x4ddf71);logger[_0x3cfe('0xd')](_0x3cfe('0x20'),_0x4ddf71,JSON[_0x3cfe('0xf')](_0x4ddf91));_0x1f13d1(_0x4ddf91);})[_0x3cfe('0x14')](function(_0x27b7a9){logger[_0x3cfe('0x10')](_0x3cfe('0x20'),_0x27b7a9[_0x3cfe('0x12')],_0x4ddf71);_0xf64909(_0x498796['error'](0x1f4,_0x27b7a9['message']));});});};
\ No newline at end of file
+var _0x701d=['options','raw','where','limit','include','map','model','attributes','then','ShowTrigger','find','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','GetTrigger','Trigger'];(function(_0xee248d,_0x5dff13){var _0x243570=function(_0x34ef19){while(--_0x34ef19){_0xee248d['push'](_0xee248d['shift']());}};_0x243570(++_0x5dff13);}(_0x701d,0x8f));var _0xd701=function(_0x1aef24,_0x1f1c07){_0x1aef24=_0x1aef24-0x0;var _0xe2626d=_0x701d[_0x1aef24];return _0xe2626d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd701('0x0'));var fs=require('fs');var Redis=require(_0xd701('0x1'));var db=require(_0xd701('0x2'))['db'];var utils=require(_0xd701('0x3'));var logger=require(_0xd701('0x4'))(_0xd701('0x5'));var config=require(_0xd701('0x6'));var jayson=require(_0xd701('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f034f,_0x4f8624,_0x4db05e){return new BPromise(function(_0x1c3a2f,_0x1c864b){return client[_0xd701('0x8')](_0x5f034f,_0x4db05e)['then'](function(_0x2f2420){logger[_0xd701('0x9')]('Trigger,\x20%s,\x20%s',_0x4f8624,_0xd701('0xa'));logger[_0xd701('0xb')](_0xd701('0xc'),_0x4f8624,_0xd701('0xa'),JSON[_0xd701('0xd')](_0x2f2420));if(_0x2f2420[_0xd701('0xe')]){if(_0x2f2420['error'][_0xd701('0xf')]===0x1f4){logger[_0xd701('0xe')](_0xd701('0x10'),_0x4f8624,_0x2f2420[_0xd701('0xe')]['message']);return _0x1c864b(_0x2f2420['error'][_0xd701('0x11')]);}logger['error'](_0xd701('0x10'),_0x4f8624,_0x2f2420[_0xd701('0xe')][_0xd701('0x11')]);return _0x1c3a2f(_0x2f2420[_0xd701('0xe')][_0xd701('0x11')]);}else{logger[_0xd701('0x9')](_0xd701('0x10'),_0x4f8624,_0xd701('0xa'));_0x1c3a2f(_0x2f2420[_0xd701('0x12')][_0xd701('0x11')]);}})[_0xd701('0x13')](function(_0x318d58){logger[_0xd701('0xe')]('Trigger,\x20%s,\x20%s',_0x4f8624,_0x318d58);_0x1c864b(_0x318d58);});});}exports[_0xd701('0x14')]=function(_0x3481b9){var _0x278511=this;return new Promise(function(_0x27f769,_0x1c22d6){return db[_0xd701('0x15')]['findAll']({'raw':_0x3481b9[_0xd701('0x16')]?_0x3481b9['options'][_0xd701('0x17')]===undefined?!![]:![]:!![],'where':_0x3481b9[_0xd701('0x16')]?_0x3481b9['options'][_0xd701('0x18')]||null:null,'attributes':_0x3481b9[_0xd701('0x16')]?_0x3481b9[_0xd701('0x16')]['attributes']||null:null,'limit':_0x3481b9['options']?_0x3481b9[_0xd701('0x16')][_0xd701('0x19')]||null:null,'include':_0x3481b9['options']?_0x3481b9[_0xd701('0x16')][_0xd701('0x1a')]?_[_0xd701('0x1b')](_0x3481b9[_0xd701('0x16')]['include'],function(_0x14a203){return{'model':db[_0x14a203[_0xd701('0x1c')]],'as':_0x14a203['as'],'attributes':_0x14a203[_0xd701('0x1d')],'include':_0x14a203['include']?_['map'](_0x14a203['include'],function(_0x2d50f2){return{'model':db[_0x2d50f2[_0xd701('0x1c')]],'as':_0x2d50f2['as'],'attributes':_0x2d50f2[_0xd701('0x1d')],'include':_0x2d50f2[_0xd701('0x1a')]?_[_0xd701('0x1b')](_0x2d50f2[_0xd701('0x1a')],function(_0x5f2d6a){return{'model':db[_0x5f2d6a[_0xd701('0x1c')]],'as':_0x5f2d6a['as'],'attributes':_0x5f2d6a[_0xd701('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd701('0x1e')](function(_0x2d7928){logger[_0xd701('0x9')]('GetTrigger',_0x3481b9);logger['debug']('GetTrigger',_0x3481b9,JSON[_0xd701('0xd')](_0x2d7928));_0x27f769(_0x2d7928);})['catch'](function(_0x83f238){logger['error'](_0xd701('0x14'),_0x83f238[_0xd701('0x11')],_0x3481b9);_0x1c22d6(_0x278511[_0xd701('0xe')](0x1f4,_0x83f238[_0xd701('0x11')]));});});};exports[_0xd701('0x1f')]=function(_0x39f048){var _0x57c0f5=this;return new Promise(function(_0x55acaa,_0x572551){return db[_0xd701('0x15')][_0xd701('0x20')]({'raw':_0x39f048['options']?_0x39f048[_0xd701('0x16')][_0xd701('0x17')]===undefined?!![]:![]:!![],'where':_0x39f048[_0xd701('0x16')]?_0x39f048[_0xd701('0x16')]['where']||null:null,'attributes':_0x39f048[_0xd701('0x16')]?_0x39f048['options'][_0xd701('0x1d')]||null:null,'include':_0x39f048[_0xd701('0x16')]?_0x39f048[_0xd701('0x16')]['include']?_['map'](_0x39f048[_0xd701('0x16')][_0xd701('0x1a')],function(_0x116d48){return{'model':db[_0x116d48[_0xd701('0x1c')]],'as':_0x116d48['as'],'attributes':_0x116d48[_0xd701('0x1d')],'include':_0x116d48['include']?_['map'](_0x116d48[_0xd701('0x1a')],function(_0x31d9ea){return{'model':db[_0x31d9ea[_0xd701('0x1c')]],'as':_0x31d9ea['as'],'attributes':_0x31d9ea[_0xd701('0x1d')],'include':_0x31d9ea[_0xd701('0x1a')]?_['map'](_0x31d9ea[_0xd701('0x1a')],function(_0x8110a0){return{'model':db[_0x8110a0[_0xd701('0x1c')]],'as':_0x8110a0['as'],'attributes':_0x8110a0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd701('0x1e')](function(_0xd53c53){logger[_0xd701('0x9')](_0xd701('0x1f'),_0x39f048);logger['debug'](_0xd701('0x1f'),_0x39f048,JSON['stringify'](_0xd53c53));_0x55acaa(_0xd53c53);})[_0xd701('0x13')](function(_0x3271ae){logger[_0xd701('0xe')](_0xd701('0x1f'),_0x3271ae['message'],_0x39f048);_0x572551(_0x57c0f5['error'](0x1f4,_0x3271ae[_0xd701('0x11')]));});});};
\ No newline at end of file
index eb81048..fab59c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd887=['/:id','post','clone','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x50f6e5,_0x151ccb){var _0x5988c5=function(_0x490a93){while(--_0x490a93){_0x50f6e5['push'](_0x50f6e5['shift']());}};_0x5988c5(++_0x151ccb);}(_0xd887,0x1a9));var _0x7d88=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xd887[_0x1d70db];return _0x3060c6;};'use strict';var multer=require('multer');var util=require(_0x7d88('0x0'));var path=require(_0x7d88('0x1'));var timeout=require(_0x7d88('0x2'));var express=require(_0x7d88('0x3'));var router=express[_0x7d88('0x4')]();var fs_extra=require(_0x7d88('0x5'));var auth=require(_0x7d88('0x6'));var interaction=require(_0x7d88('0x7'));var config=require(_0x7d88('0x8'));var controller=require('./trunk.controller');router[_0x7d88('0x9')]('/',auth[_0x7d88('0xa')](),controller[_0x7d88('0xb')]);router['get'](_0x7d88('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x7d88('0xd')]('/:id/clone',auth[_0x7d88('0xa')](),controller[_0x7d88('0xe')]);router[_0x7d88('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7d88('0xf')]('/:id',auth[_0x7d88('0xa')](),controller[_0x7d88('0x10')]);router['delete'](_0x7d88('0xc'),auth[_0x7d88('0xa')](),controller[_0x7d88('0x11')]);module[_0x7d88('0x12')]=router;
\ No newline at end of file
+var _0xc889=['isAuthenticated','index','get','/:id','show','post','/:id/clone','create','put','update','delete','exports','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x487b09,_0x349b11){var _0x28830b=function(_0x51705f){while(--_0x51705f){_0x487b09['push'](_0x487b09['shift']());}};_0x28830b(++_0x349b11);}(_0xc889,0x12c));var _0x9c88=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xc889[_0x307d86];return _0x361745;};'use strict';var multer=require('multer');var util=require(_0x9c88('0x0'));var path=require('path');var timeout=require(_0x9c88('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9c88('0x2'));var auth=require(_0x9c88('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./trunk.controller');router['get']('/',auth[_0x9c88('0x4')](),controller[_0x9c88('0x5')]);router[_0x9c88('0x6')](_0x9c88('0x7'),auth['isAuthenticated'](),controller[_0x9c88('0x8')]);router[_0x9c88('0x9')](_0x9c88('0xa'),auth['isAuthenticated'](),controller['clone']);router[_0x9c88('0x9')]('/',auth[_0x9c88('0x4')](),controller[_0x9c88('0xb')]);router[_0x9c88('0xc')]('/:id',auth[_0x9c88('0x4')](),controller[_0x9c88('0xd')]);router[_0x9c88('0xe')](_0x9c88('0x7'),auth[_0x9c88('0x4')](),controller['destroy']);module[_0x9c88('0xf')]=router;
\ No newline at end of file
index 2e2e9db..50cfef1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d90=['ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','setDataValue','transport','join','getDataValue','info','shortinfo','inband','auto','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','split','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','passive','actpass','dynamic','BOOLEAN','sequelize','exports','name','ENUM','peer','friend'];(function(_0x206338,_0x2d800b){var _0x2b87f2=function(_0x436c1c){while(--_0x436c1c){_0x206338['push'](_0x206338['shift']());}};_0x2b87f2(++_0x2d800b);}(_0x1d90,0x1ce));var _0x01d9=function(_0x15066d,_0x39fb06){_0x15066d=_0x15066d-0x0;var _0x2c146c=_0x1d90[_0x15066d];return _0x2c146c;};'use strict';var Sequelize=require(_0x01d9('0x0'));module[_0x01d9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x01d9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x01d9('0x3')]('friend','user',_0x01d9('0x4')),'allowNull':![],'defaultValue':_0x01d9('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x6'),_0x01d9('0x7'),_0x01d9('0x8'),_0x01d9('0x9'),_0x01d9('0xa'),_0x01d9('0xb'),_0x01d9('0xc'),_0x01d9('0xd'))},'deny':{'type':Sequelize[_0x01d9('0xe')]},'permit':{'type':Sequelize[_0x01d9('0xe')]},'secret':{'type':Sequelize[_0x01d9('0xe')]},'md5secret':{'type':Sequelize[_0x01d9('0xe')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':'udp','set':function(_0x63b6dd){this[_0x01d9('0xf')](_0x01d9('0x10'),_0x63b6dd?_0x63b6dd[_0x01d9('0x11')](','):null);},'get':function(){return this[_0x01d9('0x12')]('transport')?this[_0x01d9('0x12')]('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833',_0x01d9('0x13'),_0x01d9('0x14'),_0x01d9('0x15'),_0x01d9('0x16')),'defaultValue':_0x01d9('0x17')},'directmedia':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no',_0x01d9('0x19'),_0x01d9('0x1a'),_0x01d9('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x01d9('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x01d9('0xe')]},'directmediadeny':{'type':Sequelize[_0x01d9('0xe')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x01d9('0x1c'),'set':function(_0x5a8f29){this[_0x01d9('0xf')]('nat',_0x5a8f29?_0x5a8f29[_0x01d9('0x11')](','):null);},'get':function(){return this[_0x01d9('0x12')](_0x01d9('0x1d'))?this['getDataValue'](_0x01d9('0x1d'))[_0x01d9('0x1e')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x01d9('0xe')]},'namedcallgroup':{'type':Sequelize[_0x01d9('0xe')]},'pickupgroup':{'type':Sequelize[_0x01d9('0xe')]},'namedpickupgroup':{'type':Sequelize[_0x01d9('0xe')]},'language':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x01d9('0xe')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':_0x01d9('0x1f')},'allow':{'type':Sequelize[_0x01d9('0xe')],'allowNull':![],'defaultValue':_0x01d9('0x20'),'set':function(_0x3d8556){this[_0x01d9('0xf')](_0x01d9('0x21'),_0x3d8556?_0x3d8556[_0x01d9('0x11')](';'):_0x01d9('0x20'));},'get':function(){return this[_0x01d9('0x12')](_0x01d9('0x21'))?this[_0x01d9('0x12')](_0x01d9('0x21'))[_0x01d9('0x1e')](';'):null;},'comment':_0x01d9('0x22')},'autoframing':{'type':Sequelize[_0x01d9('0x3')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x01d9('0x23'),'set':function(_0x441607){this[_0x01d9('0xf')](_0x01d9('0x24'),_0x441607?_0x441607[_0x01d9('0x11')](','):null);},'get':function(){return this[_0x01d9('0x12')]('insecure')?this['getDataValue']('insecure')[_0x01d9('0x1e')](','):null;},'comment':_0x01d9('0x25')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x01d9('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x01d9('0x3')]('yes','no',_0x01d9('0x26'))},'promiscredir':{'type':Sequelize['ENUM'](_0x01d9('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'accountcode':{'type':Sequelize[_0x01d9('0x27')](0xb)},'setvar':{'type':Sequelize[_0x01d9('0xe')]},'callerid':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':_0x01d9('0x28')},'amaflags':{'type':Sequelize[_0x01d9('0xe')]},'callcounter':{'type':Sequelize['ENUM'](_0x01d9('0x18'),'no'),'defaultValue':_0x01d9('0x18')},'busylevel':{'type':Sequelize[_0x01d9('0x27')](0xb)},'allowoverlap':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x01d9('0xe')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x01d9('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x01d9('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x01d9('0x18'),'no')},'mailbox':{'type':Sequelize[_0x01d9('0xe')]},'session_timers':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x2a'),_0x01d9('0x2b'),_0x01d9('0x2c'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x01d9('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x01d9('0x3')]('uac',_0x01d9('0x2d')),'defaultValue':_0x01d9('0x2d')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x01d9('0xe')]},'fromdomain':{'type':Sequelize[_0x01d9('0xe')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x01d9('0x27')](0x5)},'qualify':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no'),'defaultValue':_0x01d9('0x18')},'keepalive':{'type':Sequelize[_0x01d9('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x01d9('0xe')]},'defaultuser':{'type':Sequelize[_0x01d9('0xe')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x01d9('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x01d9('0x27')](0xb)},'sendrpid':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no',_0x01d9('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0x01d9('0xe')]},'timert1':{'type':Sequelize[_0x01d9('0x27')](0xb)},'timerb':{'type':Sequelize[_0x01d9('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x01d9('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x01d9('0xe')]},'unsolicited_mailbox':{'type':Sequelize[_0x01d9('0xe')]},'use_q850_reason':{'type':Sequelize[_0x01d9('0xe')]},'maxforwards':{'type':Sequelize[_0x01d9('0x27')](0xb)},'encryption':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x01d9('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x01d9('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no',_0x01d9('0x2f'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x01d9('0xe')]},'dtlscafile':{'type':Sequelize[_0x01d9('0xe')]},'dtlscapath':{'type':Sequelize[_0x01d9('0xe')]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x01d9('0x30'),_0x01d9('0x31')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x01d9('0xe')]},'usereqphone':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x01d9('0xe')]},'call_limit':{'type':Sequelize[_0x01d9('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no')},'vmexten':{'type':Sequelize[_0x01d9('0xe')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01d9('0xe')]},'host':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':_0x01d9('0x32')},'canreinvite':{'type':Sequelize[_0x01d9('0x3')](_0x01d9('0x18'),'no',_0x01d9('0x19'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x01d9('0xe')]},'otherFields':{'type':Sequelize[_0x01d9('0xe')]},'active':{'type':Sequelize[_0x01d9('0x33')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x01d9('0xe')],'defaultValue':'no'}};
\ No newline at end of file
+var _0xfab2=['transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','BOOLEAN','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','join','getDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfab2,0x1da));var _0x2fab=function(_0x201922,_0x2bb345){_0x201922=_0x201922-0x0;var _0x23e521=_0xfab2[_0x201922];return _0x23e521;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2fab('0x0')],'allowNull':![],'unique':_0x2fab('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x3'),_0x2fab('0x4'),_0x2fab('0x5')),'allowNull':![],'defaultValue':_0x2fab('0x3')},'context':{'type':Sequelize[_0x2fab('0x0')],'allowNull':![],'defaultValue':_0x2fab('0x6')},'callingpres':{'type':Sequelize['ENUM'](_0x2fab('0x7'),_0x2fab('0x8'),_0x2fab('0x9'),_0x2fab('0xa'),'PROHIB_NOT_SCREENED',_0x2fab('0xb'),_0x2fab('0xc'),_0x2fab('0xd'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x2fab('0x0')]},'secret':{'type':Sequelize[_0x2fab('0x0')]},'md5secret':{'type':Sequelize[_0x2fab('0x0')]},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x17b1aa){this['setDataValue']('transport',_0x17b1aa?_0x17b1aa[_0x2fab('0xe')](','):null);},'get':function(){return this[_0x2fab('0xf')]('transport')?this['getDataValue'](_0x2fab('0x10'))[_0x2fab('0x11')](','):null;},'comment':_0x2fab('0x12')},'dtmfmode':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x13'),_0x2fab('0x14'),_0x2fab('0x15'),_0x2fab('0x16'),_0x2fab('0x17')),'defaultValue':_0x2fab('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x2fab('0x18'),'no',_0x2fab('0x19'),_0x2fab('0x1a'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x2fab('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':'force_rport,comedia','set':function(_0x4abe72){this[_0x2fab('0x1b')](_0x2fab('0x1c'),_0x4abe72?_0x4abe72[_0x2fab('0xe')](','):null);},'get':function(){return this['getDataValue'](_0x2fab('0x1c'))?this[_0x2fab('0xf')](_0x2fab('0x1c'))['split'](','):null;},'comment':_0x2fab('0x1d')},'callgroup':{'type':Sequelize[_0x2fab('0x0')]},'namedcallgroup':{'type':Sequelize[_0x2fab('0x0')]},'pickupgroup':{'type':Sequelize[_0x2fab('0x0')]},'namedpickupgroup':{'type':Sequelize[_0x2fab('0x0')]},'language':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2fab('0x0')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x2fab('0x0')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x923be7){this[_0x2fab('0x1b')]('allow',_0x923be7?_0x923be7[_0x2fab('0xe')](';'):_0x2fab('0x1e'));},'get':function(){return this[_0x2fab('0xf')](_0x2fab('0x1f'))?this[_0x2fab('0xf')](_0x2fab('0x1f'))[_0x2fab('0x11')](';'):null;},'comment':_0x2fab('0x20')},'autoframing':{'type':Sequelize[_0x2fab('0x2')]('yes','no')},'insecure':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':'port,invite','set':function(_0x2aa1bc){this[_0x2fab('0x1b')]('insecure',_0x2aa1bc?_0x2aa1bc['join'](','):null);},'get':function(){return this['getDataValue']('insecure')?this[_0x2fab('0xf')]('insecure')['split'](','):null;},'comment':_0x2fab('0x21')},'trustrpid':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no',_0x2fab('0x22'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0x2fab('0x18'),'no')},'accountcode':{'type':Sequelize[_0x2fab('0x23')](0xb)},'setvar':{'type':Sequelize[_0x2fab('0x0')]},'callerid':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':_0x2fab('0x24')},'amaflags':{'type':Sequelize[_0x2fab('0x0')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2fab('0x18')},'busylevel':{'type':Sequelize[_0x2fab('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0x2fab('0x0')]},'template':{'type':Sequelize[_0x2fab('0x0')]},'videosupport':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no',_0x2fab('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x2fab('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no')},'mailbox':{'type':Sequelize[_0x2fab('0x0')]},'session_timers':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x26'),'refuse',_0x2fab('0x27'))},'session_expires':{'type':Sequelize[_0x2fab('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x28'),_0x2fab('0x29')),'defaultValue':_0x2fab('0x29')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x2fab('0x0')]},'fromdomain':{'type':Sequelize[_0x2fab('0x0')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x2fab('0x23')](0x5)},'qualify':{'type':Sequelize[_0x2fab('0x2')]('yes','no'),'defaultValue':_0x2fab('0x18')},'keepalive':{'type':Sequelize[_0x2fab('0x23')](0xb)},'defaultip':{'type':Sequelize[_0x2fab('0x0')]},'defaultuser':{'type':Sequelize[_0x2fab('0x0')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2fab('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no',_0x2fab('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2fab('0x0')]},'callbackextension':{'type':Sequelize[_0x2fab('0x0')]},'timert1':{'type':Sequelize[_0x2fab('0x23')](0xb)},'timerb':{'type':Sequelize[_0x2fab('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x2fab('0x0')]},'contactdeny':{'type':Sequelize[_0x2fab('0x0')]},'contactacl':{'type':Sequelize[_0x2fab('0x0')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x2fab('0x0')]},'maxforwards':{'type':Sequelize[_0x2fab('0x23')](0xb)},'encryption':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no')},'force_avp':{'type':Sequelize[_0x2fab('0x2')]('yes','no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x2fab('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2fab('0x18'),'no',_0x2fab('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x2fab('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2fab('0x0')]},'dtlsprivatekey':{'type':Sequelize[_0x2fab('0x0')]},'dtlscipher':{'type':Sequelize[_0x2fab('0x0')]},'dtlscafile':{'type':Sequelize[_0x2fab('0x0')]},'dtlscapath':{'type':Sequelize[_0x2fab('0x0')]},'dtlssetup':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x2c'),_0x2fab('0x2d'),_0x2fab('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2fab('0x0')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x2fab('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2fab('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x2fab('0x2')](_0x2fab('0x18'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2fab('0x0')]},'mohsuggest':{'type':Sequelize[_0x2fab('0x0')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2fab('0x0')]},'host':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':_0x2fab('0x2f')},'canreinvite':{'type':Sequelize[_0x2fab('0x2')]('yes','no',_0x2fab('0x19'),_0x2fab('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x2fab('0x0')]},'active':{'type':Sequelize[_0x2fab('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2fab('0x0')],'defaultValue':'no'}};
\ No newline at end of file
index 1b21e72..828c428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ca=['omit','createdAt','body','updatedAt','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','Trunks','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','Trunk','find','clone'];(function(_0x99fc05,_0x2cc68a){var _0xa005f7=function(_0x5efdba){while(--_0x5efdba){_0x99fc05['push'](_0x99fc05['shift']());}};_0xa005f7(++_0x2cc68a);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x170eb7,_0x1ac59b){_0x170eb7=_0x170eb7-0x0;var _0x4dfeac=_0xf2ca[_0x170eb7];return _0x4dfeac;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];var jayson=require(_0xaf2c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccb4,_0x8eaf9b,_0x935959,_0x18a8a5){return new BPromise(function(_0x293ca6,_0x152c73){var _0x214f47=_0x18a8a5||client;return _0x214f47[_0xaf2c('0x19')](_0x15ccb4,_0x935959)[_0xaf2c('0x1a')](function(_0x1d0633){logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,_0xaf2c('0x1d'));logger[_0xaf2c('0x1e')](_0xaf2c('0x1f'),_0x8eaf9b,'request\x20sent',JSON[_0xaf2c('0x20')](_0x1d0633));if(_0x1d0633['error']){if(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x22')]===0x1f4){logger[_0xaf2c('0x21')]('Trunk,\x20%s,\x20%s',_0x8eaf9b,_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);return _0x152c73(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}logger[_0xaf2c('0x21')](_0xaf2c('0x1c'),_0x8eaf9b,_0x1d0633['error'][_0xaf2c('0x23')]);return _0x293ca6(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}else{logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,'request\x20sent');_0x293ca6(_0x1d0633[_0xaf2c('0x24')][_0xaf2c('0x23')]);}})[_0xaf2c('0x25')](function(_0x4be6ed){logger['error'](_0xaf2c('0x1c'),_0x8eaf9b,_0x4be6ed);_0x152c73(_0x4be6ed);});});}function respondWithStatusCode(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0xcc;return function(_0x99f78d){if(_0x99f78d){return _0x303546['sendStatus'](_0x1cafad);}return _0x303546[_0xaf2c('0x26')](_0x1cafad)[_0xaf2c('0x27')]();};}function respondWithResult(_0x3a0145,_0x3c1ae6){_0x3c1ae6=_0x3c1ae6||0xc8;return function(_0xe929b5){if(_0xe929b5){return _0x3a0145[_0xaf2c('0x26')](_0x3c1ae6)[_0xaf2c('0x28')](_0xe929b5);}};}function respondWithFilteredResult(_0x4a8dd8,_0x29f8b0){return function(_0x2051be){if(_0x2051be){var _0x36f37c=typeof _0x29f8b0[_0xaf2c('0x29')]==='undefined'&&typeof _0x29f8b0[_0xaf2c('0x2a')]==='undefined';var _0x38db1b=_0x2051be[_0xaf2c('0x2b')];var _0x15466b=_0x36f37c?0x0:_0x29f8b0['offset'];var _0x2747bb=_0x36f37c?_0x2051be[_0xaf2c('0x2b')]:_0x29f8b0[_0xaf2c('0x29')]+_0x29f8b0['limit'];var _0xe18ba7;if(_0x2747bb>=_0x38db1b){_0x2747bb=_0x38db1b;_0xe18ba7=0xc8;}else{_0xe18ba7=0xce;}_0x4a8dd8[_0xaf2c('0x26')](_0xe18ba7);return _0x4a8dd8[_0xaf2c('0x2c')](_0xaf2c('0x2d'),_0x15466b+'-'+_0x2747bb+'/'+_0x38db1b)['json'](_0x2051be);}return null;};}function patchUpdates(_0x3da072){return function(_0x4072ff){try{jsonpatch[_0xaf2c('0x2e')](_0x4072ff,_0x3da072,!![]);}catch(_0x51a49c){return BPromise['reject'](_0x51a49c);}return _0x4072ff[_0xaf2c('0x2f')]();};}function saveUpdates(_0x4c9b4f,_0x39c0ed){return function(_0x5e7247){if(_0x5e7247){return _0x5e7247[_0xaf2c('0x30')](_0x4c9b4f)[_0xaf2c('0x1a')](function(_0x4ffbb9){return _0x4ffbb9;});}return null;};}function removeEntity(_0x1408e3,_0x5403f8){return function(_0x54db57){if(_0x54db57){return _0x54db57[_0xaf2c('0x31')]()[_0xaf2c('0x1a')](function(){var _0x211a69=_0x54db57[_0xaf2c('0x32')]({'plain':!![]});var _0x2d6ed7=_0xaf2c('0x33');return db['UserProfileResource'][_0xaf2c('0x31')]({'where':{'type':_0x2d6ed7,'resourceId':_0x211a69['id']}})['then'](function(){return _0x54db57;});})[_0xaf2c('0x1a')](function(){_0x1408e3['status'](0xcc)[_0xaf2c('0x27')]();});}};}function handleEntityNotFound(_0x59f686,_0x2f3d16){return function(_0x4e877e){if(!_0x4e877e){_0x59f686[_0xaf2c('0x34')](0x194);}return _0x4e877e;};}function handleError(_0x4b9c6b,_0x30fd87){_0x30fd87=_0x30fd87||0x1f4;return function(_0x356402){logger[_0xaf2c('0x21')](_0x356402[_0xaf2c('0x35')]);if(_0x356402[_0xaf2c('0x36')]){delete _0x356402['name'];}_0x4b9c6b['status'](_0x30fd87)[_0xaf2c('0x37')](_0x356402);};}exports[_0xaf2c('0x38')]=function(_0x409700,_0xa44813){var _0x4eeecf={},_0x316238={},_0x573db3={'count':0x0,'rows':[]};var _0xa1248e=_[_0xaf2c('0x39')](db['Trunk'][_0xaf2c('0x3a')],function(_0x24668d){return{'name':_0x24668d[_0xaf2c('0x3b')],'type':_0x24668d[_0xaf2c('0x3c')][_0xaf2c('0x3d')]};});_0x316238[_0xaf2c('0x3e')]=_[_0xaf2c('0x39')](_0xa1248e,_0xaf2c('0x36'));_0x316238[_0xaf2c('0x3f')]=_[_0xaf2c('0x40')](_0x409700[_0xaf2c('0x3f')]);_0x316238[_0xaf2c('0x41')]=_[_0xaf2c('0x42')](_0x316238['model'],_0x316238['query']);_0x4eeecf['attributes']=_[_0xaf2c('0x42')](_0x316238[_0xaf2c('0x3e')],qs[_0xaf2c('0x43')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x4eeecf[_0xaf2c('0x44')]=_0x4eeecf['attributes'][_0xaf2c('0x45')]?_0x4eeecf[_0xaf2c('0x44')]:_0x316238[_0xaf2c('0x3e')];if(!_0x409700['query']['hasOwnProperty'](_0xaf2c('0x46'))){_0x4eeecf['limit']=qs[_0xaf2c('0x2a')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x2a')]);_0x4eeecf[_0xaf2c('0x29')]=qs['offset'](_0x409700[_0xaf2c('0x3f')]['offset']);}_0x4eeecf[_0xaf2c('0x47')]=qs[_0xaf2c('0x48')](_0x409700['query'][_0xaf2c('0x48')]);_0x4eeecf['where']=qs[_0xaf2c('0x41')](_[_0xaf2c('0x49')](_0x409700[_0xaf2c('0x3f')],_0x316238[_0xaf2c('0x41')]),_0xa1248e);if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]){_0x4eeecf[_0xaf2c('0x4b')]=_[_0xaf2c('0x4c')](_0x4eeecf[_0xaf2c('0x4b')],{'$or':_['map'](_0xa1248e,function(_0x51d751){if(_0x51d751[_0xaf2c('0x3c')]!=='VIRTUAL'){var _0x4ad36e={};_0x4ad36e[_0x51d751['name']]={'$like':'%'+_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]+'%'};return _0x4ad36e;}})});}_0x4eeecf=_[_0xaf2c('0x4c')]({},_0x4eeecf,_0x409700[_0xaf2c('0x4d')]);var _0x599b2d={'where':_0x4eeecf[_0xaf2c('0x4b')]};return db['Trunk'][_0xaf2c('0x2b')](_0x599b2d)['then'](function(_0x166c26){_0x573db3[_0xaf2c('0x2b')]=_0x166c26;if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x4eeecf[_0xaf2c('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xaf2c('0x50')](_0x4eeecf);})[_0xaf2c('0x1a')](function(_0x4b3ca4){_0x573db3['rows']=_0x4b3ca4;return _0x573db3;})[_0xaf2c('0x1a')](respondWithFilteredResult(_0xa44813,_0x4eeecf))['catch'](handleError(_0xa44813,null));};exports[_0xaf2c('0x51')]=function(_0x23642b,_0x17b9ec){var _0x315b9f={'raw':![],'where':{'id':_0x23642b[_0xaf2c('0x52')]['id']}},_0x367112={};_0x367112[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x367112[_0xaf2c('0x3f')]=_['keys'](_0x23642b[_0xaf2c('0x3f')]);_0x367112[_0xaf2c('0x41')]=_['intersection'](_0x367112['model'],_0x367112['query']);_0x315b9f[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x367112['model'],qs[_0xaf2c('0x43')](_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x315b9f[_0xaf2c('0x44')]=_0x315b9f[_0xaf2c('0x44')][_0xaf2c('0x45')]?_0x315b9f[_0xaf2c('0x44')]:_0x367112['model'];if(_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x315b9f['include']=[{'all':!![]}];}_0x315b9f=_[_0xaf2c('0x4c')]({},_0x315b9f,_0x23642b[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x315b9f)[_0xaf2c('0x1a')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x1a')](respondWithResult(_0x17b9ec,null))[_0xaf2c('0x25')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x55')]=function(_0x19b82d,_0x300254){var _0x133678={'where':{'id':_0x19b82d[_0xaf2c('0x52')]['id']}},_0x10a270={};_0x10a270[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x133678[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x10a270[_0xaf2c('0x3e')],qs['fields'](_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x133678[_0xaf2c('0x44')]=_0x133678['attributes'][_0xaf2c('0x45')]?_0x133678['attributes']:_0x10a270[_0xaf2c('0x3e')];if(_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x133678[_0xaf2c('0x4f')]=[{'all':!![]}];}_0x133678=_[_0xaf2c('0x4c')]({},_0x133678,_0x19b82d[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x133678)[_0xaf2c('0x1a')](handleEntityNotFound(_0x300254,null))['then'](function(_0x41d08b){if(_0x41d08b){var _0x400dcd=_0x41d08b[_0xaf2c('0x32')]({'plain':!![]});_0x400dcd=qs[_0xaf2c('0x56')](_0x400dcd,['id',_0xaf2c('0x57'),'updatedAt']);_0x19b82d[_0xaf2c('0x58')]=_[_0xaf2c('0x56')](_0x19b82d['body'],['id',_0xaf2c('0x57'),_0xaf2c('0x59')]);return db['Trunk']['create'](_[_0xaf2c('0x4c')](_0x400dcd,_0x19b82d[_0xaf2c('0x58')]),{'include':_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x36b6f0){var _0x3f48f1=_0x19b82d['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3f48f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f48f1[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x16e9f4=_0x36b6f0[_0xaf2c('0x32')]({'plain':!![]});var _0x1a297e=_0xaf2c('0x33');return db[_0xaf2c('0x5c')][_0xaf2c('0x54')]({'where':{'name':_0x1a297e,'userProfileId':_0x3f48f1[_0xaf2c('0x5d')]},'raw':!![]})[_0xaf2c('0x1a')](function(_0x53ba41){if(_0x53ba41&&_0x53ba41[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')][_0xaf2c('0x60')]({'name':_0x16e9f4[_0xaf2c('0x36')],'resourceId':_0x16e9f4['id'],'type':_0x53ba41[_0xaf2c('0x36')],'sectionId':_0x53ba41['id']},{})['then'](function(){return _0x36b6f0;});}else{return _0x36b6f0;}})[_0xaf2c('0x25')](function(_0x28b09f){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x28b09f);throw _0x28b09f;});}return _0x36b6f0;});}})[_0xaf2c('0x1a')](respondWithResult(_0x300254,0xc9))['catch'](handleError(_0x300254,null));};exports['create']=function(_0x1166c9,_0x1ead61,_0x5849f8){var _0xf96361;return db[_0xaf2c('0x53')][_0xaf2c('0x60')](_0x1166c9['body'],{'raw':!![]})[_0xaf2c('0x1a')](function(_0x2bd845){_0xf96361=_0x2bd845;return db[_0xaf2c('0x53')][_0xaf2c('0x50')]({'raw':!![]});})['then'](function(_0x32d552){var _0x26129c=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2767c7=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x5d965c=ejs[_0xaf2c('0x67')](_0x26129c,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d965c);if(_0xf96361[_0xaf2c('0x69')]){var _0x5a95ac=ejs['render'](_0x2767c7,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6a'),_0x5a95ac);}})[_0xaf2c('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0xaf2c('0x1a')](function(){var _0x3e972c=_0x1166c9['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3e972c)throw new Error(_0xaf2c('0x6b'));if(_0x3e972c[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x6e1837=_0xf96361[_0xaf2c('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xaf2c('0x54')]({'where':{'name':_0xaf2c('0x33'),'userProfileId':_0x3e972c[_0xaf2c('0x5d')]},'raw':!![]})['then'](function(_0xc9dd21){if(_0xc9dd21&&_0xc9dd21[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')]['create']({'name':_0x6e1837[_0xaf2c('0x36')],'resourceId':_0x6e1837['id'],'type':_0xc9dd21[_0xaf2c('0x36')],'sectionId':_0xc9dd21['id']},{})[_0xaf2c('0x1a')](function(){return _0xf96361;});}else{return _0xf96361;}})[_0xaf2c('0x25')](function(_0x491160){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x491160);throw _0x491160;});}return _0xf96361;})[_0xaf2c('0x1a')](respondWithResult(_0x1ead61,0xc9))['catch'](handleError(_0x1ead61,null));};exports['update']=function(_0x427ece,_0x1b7dc1,_0x5571eb){var _0x3675d9;return db[_0xaf2c('0x53')]['find']({'where':{'id':_0x427ece[_0xaf2c('0x52')]['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1b7dc1,null))[_0xaf2c('0x1a')](saveUpdates(_0x427ece[_0xaf2c('0x58')],null))[_0xaf2c('0x1a')](function(_0x4af252){if(_0x4af252){_0x3675d9=_0x4af252;return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});}})[_0xaf2c('0x1a')](function(_0x55b568){if(_0x55b568){var _0x4f378e=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x4b9fdc=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x6c')),_0xaf2c('0x66'));var _0x41c707=ejs['render'](_0x4f378e,{'trunks':_0x55b568||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x41c707);var _0x483774=ejs['render'](_0x4b9fdc,{'trunks':_0x55b568||[]});fs['writeFileSync'](_0xaf2c('0x6a'),_0x483774);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x30'),{'module':_0xaf2c('0x6f')});}return null;})['then'](function(_0x19fbd5){if(_0x19fbd5){return _0x3675d9;}})[_0xaf2c('0x1a')](respondWithResult(_0x1b7dc1,null))[_0xaf2c('0x25')](handleError(_0x1b7dc1,null));};exports[_0xaf2c('0x31')]=function(_0x4ddf95,_0x1e8fc0,_0x23aeac){var _0x41590;return db[_0xaf2c('0x53')][_0xaf2c('0x54')]({'where':{'id':_0x4ddf95['params']['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1e8fc0,null))[_0xaf2c('0x1a')](removeEntity(_0x1e8fc0,null))['then'](function(){return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});})[_0xaf2c('0x1a')](function(_0x5bce65){var _0x1e6a12=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2a3cb4=fs[_0xaf2c('0x62')](path['join'](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x7724cc=ejs['render'](_0x1e6a12,{'trunks':_0x5bce65});var _0x4a9ea8=ejs[_0xaf2c('0x67')](_0x2a3cb4,{'trunks':_0x5bce65});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x7724cc);fs['writeFileSync'](_0xaf2c('0x6a'),_0x4a9ea8);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e8fc0,null));};
\ No newline at end of file
+var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x81bd,0x7c));var _0xd81b=function(_0x1ed010,_0x734e0b){_0x1ed010=_0x1ed010-0x0;var _0x6e22bf=_0x81bd[_0x1ed010];return _0x6e22bf;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));};
\ No newline at end of file
index bb33ffa..0933930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25ab=['../../config/logger','api','moment','path','rimraf','exports','define','Trunk'];(function(_0x4cf0b7,_0x560029){var _0x545f10=function(_0x993533){while(--_0x993533){_0x4cf0b7['push'](_0x4cf0b7['shift']());}};_0x545f10(++_0x560029);}(_0x25ab,0x118));var _0xb25a=function(_0x4301a2,_0x39c23e){_0x4301a2=_0x4301a2-0x0;var _0x4c8fae=_0x25ab[_0x4301a2];return _0x4c8fae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb25a('0x0'))(_0xb25a('0x1'));var moment=require(_0xb25a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb25a('0x3'));var rimraf=require(_0xb25a('0x4'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xb25a('0x5')]=function(_0x199179,_0x9ddbe2){return _0x199179[_0xb25a('0x6')](_0xb25a('0x7'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4ceb=['util','../../config/logger','api','bluebird','path','rimraf','./trunk.attributes','exports','define','Trunk','lodash'];(function(_0x355c5e,_0x5462d6){var _0xa1292c=function(_0x57ab4e){while(--_0x57ab4e){_0x355c5e['push'](_0x355c5e['shift']());}};_0xa1292c(++_0x5462d6);}(_0x4ceb,0x107));var _0xb4ce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4ceb[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0xb4ce('0x0'));var util=require(_0xb4ce('0x1'));var logger=require(_0xb4ce('0x2'))(_0xb4ce('0x3'));var moment=require('moment');var BPromise=require(_0xb4ce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb4ce('0x5'));var rimraf=require(_0xb4ce('0x6'));var config=require('../../config/environment');var attributes=require(_0xb4ce('0x7'));module[_0xb4ce('0x8')]=function(_0x2e9432,_0x43ddb6){return _0x2e9432[_0xb4ce('0x9')](_0xb4ce('0xa'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c6b83e0..56e65fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd23=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','map','model','attributes','ShowTrunk','randomstring','ioredis'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xfd23,0x153));var _0x3fd2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xfd23[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3fd2('0x0'));var fs=require('fs');var Redis=require(_0x3fd2('0x1'));var db=require(_0x3fd2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3fd2('0x3'))(_0x3fd2('0x4'));var config=require(_0x3fd2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3fd2('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbae14c,_0x4de54e,_0x3035ab){return new BPromise(function(_0xedc5dc,_0x28b71d){return client[_0x3fd2('0x7')](_0xbae14c,_0x3035ab)[_0x3fd2('0x8')](function(_0x2ab021){logger[_0x3fd2('0x9')](_0x3fd2('0xa'),_0x4de54e,_0x3fd2('0xb'));logger[_0x3fd2('0xc')](_0x3fd2('0xd'),_0x4de54e,_0x3fd2('0xb'),JSON[_0x3fd2('0xe')](_0x2ab021));if(_0x2ab021[_0x3fd2('0xf')]){if(_0x2ab021[_0x3fd2('0xf')][_0x3fd2('0x10')]===0x1f4){logger[_0x3fd2('0xf')](_0x3fd2('0xa'),_0x4de54e,_0x2ab021[_0x3fd2('0xf')]['message']);return _0x28b71d(_0x2ab021['error'][_0x3fd2('0x11')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x4de54e,_0x2ab021[_0x3fd2('0xf')][_0x3fd2('0x11')]);return _0xedc5dc(_0x2ab021[_0x3fd2('0xf')][_0x3fd2('0x11')]);}else{logger['info'](_0x3fd2('0xa'),_0x4de54e,'request\x20sent');_0xedc5dc(_0x2ab021[_0x3fd2('0x12')][_0x3fd2('0x11')]);}})[_0x3fd2('0x13')](function(_0x103507){logger[_0x3fd2('0xf')](_0x3fd2('0xa'),_0x4de54e,_0x103507);_0x28b71d(_0x103507);});});}exports[_0x3fd2('0x14')]=function(_0x201d36){var _0x24cd6c=this;return new Promise(function(_0x299873,_0x4a87cd){return db[_0x3fd2('0x15')]['findAll']({'raw':_0x201d36['options']?_0x201d36[_0x3fd2('0x16')][_0x3fd2('0x17')]===undefined?!![]:![]:!![],'where':_0x201d36['options']?_0x201d36[_0x3fd2('0x16')][_0x3fd2('0x18')]||null:null,'attributes':_0x201d36['options']?_0x201d36[_0x3fd2('0x16')]['attributes']||null:null,'limit':_0x201d36['options']?_0x201d36[_0x3fd2('0x16')][_0x3fd2('0x19')]||null:null,'include':_0x201d36[_0x3fd2('0x16')]?_0x201d36[_0x3fd2('0x16')][_0x3fd2('0x1a')]?_[_0x3fd2('0x1b')](_0x201d36[_0x3fd2('0x16')]['include'],function(_0x4c262b){return{'model':db[_0x4c262b[_0x3fd2('0x1c')]],'as':_0x4c262b['as'],'attributes':_0x4c262b[_0x3fd2('0x1d')],'include':_0x4c262b[_0x3fd2('0x1a')]?_['map'](_0x4c262b[_0x3fd2('0x1a')],function(_0x3756d7){return{'model':db[_0x3756d7[_0x3fd2('0x1c')]],'as':_0x3756d7['as'],'attributes':_0x3756d7[_0x3fd2('0x1d')],'include':_0x3756d7[_0x3fd2('0x1a')]?_[_0x3fd2('0x1b')](_0x3756d7['include'],function(_0x587ff3){return{'model':db[_0x587ff3[_0x3fd2('0x1c')]],'as':_0x587ff3['as'],'attributes':_0x587ff3[_0x3fd2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3fd2('0x8')](function(_0x17cfc4){logger[_0x3fd2('0x9')](_0x3fd2('0x14'),_0x201d36);logger[_0x3fd2('0xc')](_0x3fd2('0x14'),_0x201d36,JSON[_0x3fd2('0xe')](_0x17cfc4));_0x299873(_0x17cfc4);})[_0x3fd2('0x13')](function(_0x1879b9){logger[_0x3fd2('0xf')](_0x3fd2('0x14'),_0x1879b9[_0x3fd2('0x11')],_0x201d36);_0x4a87cd(_0x24cd6c[_0x3fd2('0xf')](0x1f4,_0x1879b9['message']));});});};exports[_0x3fd2('0x1e')]=function(_0x3164e7){var _0x5d3ce3=this;return new Promise(function(_0x572caa,_0x12c3e4){return db['Trunk']['find']({'raw':_0x3164e7[_0x3fd2('0x16')]?_0x3164e7['options'][_0x3fd2('0x17')]===undefined?!![]:![]:!![],'where':_0x3164e7['options']?_0x3164e7['options'][_0x3fd2('0x18')]||null:null,'attributes':_0x3164e7[_0x3fd2('0x16')]?_0x3164e7[_0x3fd2('0x16')]['attributes']||null:null,'include':_0x3164e7[_0x3fd2('0x16')]?_0x3164e7[_0x3fd2('0x16')][_0x3fd2('0x1a')]?_[_0x3fd2('0x1b')](_0x3164e7[_0x3fd2('0x16')][_0x3fd2('0x1a')],function(_0x1ce75c){return{'model':db[_0x1ce75c['model']],'as':_0x1ce75c['as'],'attributes':_0x1ce75c[_0x3fd2('0x1d')],'include':_0x1ce75c['include']?_[_0x3fd2('0x1b')](_0x1ce75c[_0x3fd2('0x1a')],function(_0x2efcf7){return{'model':db[_0x2efcf7[_0x3fd2('0x1c')]],'as':_0x2efcf7['as'],'attributes':_0x2efcf7[_0x3fd2('0x1d')],'include':_0x2efcf7[_0x3fd2('0x1a')]?_[_0x3fd2('0x1b')](_0x2efcf7[_0x3fd2('0x1a')],function(_0x2db5fd){return{'model':db[_0x2db5fd[_0x3fd2('0x1c')]],'as':_0x2db5fd['as'],'attributes':_0x2db5fd['attributes']};}):[]};}):[]};}):[]:[]})[_0x3fd2('0x8')](function(_0x1d6dc9){logger[_0x3fd2('0x9')]('ShowTrunk',_0x3164e7);logger['debug'](_0x3fd2('0x1e'),_0x3164e7,JSON['stringify'](_0x1d6dc9));_0x572caa(_0x1d6dc9);})['catch'](function(_0x47d54d){logger[_0x3fd2('0xf')](_0x3fd2('0x1e'),_0x47d54d[_0x3fd2('0x11')],_0x3164e7);_0x12c3e4(_0x5d3ce3[_0x3fd2('0xf')](0x1f4,_0x47d54d[_0x3fd2('0x11')]));});});};
\ No newline at end of file
+var _0xe921=['ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','ShowTrunk','find','util','moment','bluebird','randomstring'];(function(_0x15b6d2,_0x3bf4be){var _0x36a1e2=function(_0x752ef0){while(--_0x752ef0){_0x15b6d2['push'](_0x15b6d2['shift']());}};_0x36a1e2(++_0x3bf4be);}(_0xe921,0x104));var _0x1e92=function(_0x14d6f8,_0x2aeb50){_0x14d6f8=_0x14d6f8-0x0;var _0x550c02=_0xe921[_0x14d6f8];return _0x550c02;};'use strict';var _=require('lodash');var util=require(_0x1e92('0x0'));var moment=require(_0x1e92('0x1'));var BPromise=require(_0x1e92('0x2'));var rs=require(_0x1e92('0x3'));var fs=require('fs');var Redis=require(_0x1e92('0x4'));var db=require(_0x1e92('0x5'))['db'];var utils=require(_0x1e92('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1e92('0x7'));var client=jayson['client'][_0x1e92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3782d5,_0x1c2d09,_0xd3f304){return new BPromise(function(_0x1a4278,_0x148f5e){return client[_0x1e92('0x9')](_0x3782d5,_0xd3f304)[_0x1e92('0xa')](function(_0x3d4613){logger[_0x1e92('0xb')](_0x1e92('0xc'),_0x1c2d09,_0x1e92('0xd'));logger[_0x1e92('0xe')]('Trunk,\x20%s,\x20%s,\x20%s',_0x1c2d09,'request\x20sent',JSON[_0x1e92('0xf')](_0x3d4613));if(_0x3d4613['error']){if(_0x3d4613['error'][_0x1e92('0x10')]===0x1f4){logger[_0x1e92('0x11')](_0x1e92('0xc'),_0x1c2d09,_0x3d4613[_0x1e92('0x11')]['message']);return _0x148f5e(_0x3d4613[_0x1e92('0x11')]['message']);}logger[_0x1e92('0x11')](_0x1e92('0xc'),_0x1c2d09,_0x3d4613['error'][_0x1e92('0x12')]);return _0x1a4278(_0x3d4613[_0x1e92('0x11')][_0x1e92('0x12')]);}else{logger['info'](_0x1e92('0xc'),_0x1c2d09,_0x1e92('0xd'));_0x1a4278(_0x3d4613['result'][_0x1e92('0x12')]);}})[_0x1e92('0x13')](function(_0x192553){logger['error'](_0x1e92('0xc'),_0x1c2d09,_0x192553);_0x148f5e(_0x192553);});});}exports[_0x1e92('0x14')]=function(_0xba8624){var _0x5be5ad=this;return new Promise(function(_0x4dc8c8,_0x2ba9af){return db[_0x1e92('0x15')][_0x1e92('0x16')]({'raw':_0xba8624['options']?_0xba8624[_0x1e92('0x17')][_0x1e92('0x18')]===undefined?!![]:![]:!![],'where':_0xba8624[_0x1e92('0x17')]?_0xba8624[_0x1e92('0x17')][_0x1e92('0x19')]||null:null,'attributes':_0xba8624[_0x1e92('0x17')]?_0xba8624[_0x1e92('0x17')][_0x1e92('0x1a')]||null:null,'limit':_0xba8624[_0x1e92('0x17')]?_0xba8624[_0x1e92('0x17')][_0x1e92('0x1b')]||null:null,'include':_0xba8624[_0x1e92('0x17')]?_0xba8624[_0x1e92('0x17')][_0x1e92('0x1c')]?_[_0x1e92('0x1d')](_0xba8624[_0x1e92('0x17')][_0x1e92('0x1c')],function(_0x485508){return{'model':db[_0x485508[_0x1e92('0x1e')]],'as':_0x485508['as'],'attributes':_0x485508['attributes'],'include':_0x485508['include']?_[_0x1e92('0x1d')](_0x485508[_0x1e92('0x1c')],function(_0x263529){return{'model':db[_0x263529[_0x1e92('0x1e')]],'as':_0x263529['as'],'attributes':_0x263529[_0x1e92('0x1a')],'include':_0x263529[_0x1e92('0x1c')]?_[_0x1e92('0x1d')](_0x263529['include'],function(_0x29c5c0){return{'model':db[_0x29c5c0['model']],'as':_0x29c5c0['as'],'attributes':_0x29c5c0[_0x1e92('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42c78b){logger[_0x1e92('0xb')](_0x1e92('0x14'),_0xba8624);logger[_0x1e92('0xe')](_0x1e92('0x14'),_0xba8624,JSON[_0x1e92('0xf')](_0x42c78b));_0x4dc8c8(_0x42c78b);})['catch'](function(_0x1f1a23){logger[_0x1e92('0x11')](_0x1e92('0x14'),_0x1f1a23[_0x1e92('0x12')],_0xba8624);_0x2ba9af(_0x5be5ad[_0x1e92('0x11')](0x1f4,_0x1f1a23['message']));});});};exports[_0x1e92('0x1f')]=function(_0x1b4f18){var _0x3d67a6=this;return new Promise(function(_0x4603b3,_0x5d2b0){return db['Trunk'][_0x1e92('0x20')]({'raw':_0x1b4f18[_0x1e92('0x17')]?_0x1b4f18[_0x1e92('0x17')][_0x1e92('0x18')]===undefined?!![]:![]:!![],'where':_0x1b4f18[_0x1e92('0x17')]?_0x1b4f18[_0x1e92('0x17')][_0x1e92('0x19')]||null:null,'attributes':_0x1b4f18['options']?_0x1b4f18[_0x1e92('0x17')]['attributes']||null:null,'include':_0x1b4f18[_0x1e92('0x17')]?_0x1b4f18[_0x1e92('0x17')]['include']?_[_0x1e92('0x1d')](_0x1b4f18[_0x1e92('0x17')][_0x1e92('0x1c')],function(_0x45b1d0){return{'model':db[_0x45b1d0[_0x1e92('0x1e')]],'as':_0x45b1d0['as'],'attributes':_0x45b1d0[_0x1e92('0x1a')],'include':_0x45b1d0[_0x1e92('0x1c')]?_[_0x1e92('0x1d')](_0x45b1d0[_0x1e92('0x1c')],function(_0xd2d9b7){return{'model':db[_0xd2d9b7['model']],'as':_0xd2d9b7['as'],'attributes':_0xd2d9b7[_0x1e92('0x1a')],'include':_0xd2d9b7[_0x1e92('0x1c')]?_[_0x1e92('0x1d')](_0xd2d9b7[_0x1e92('0x1c')],function(_0x41cde1){return{'model':db[_0x41cde1[_0x1e92('0x1e')]],'as':_0x41cde1['as'],'attributes':_0x41cde1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3648ef){logger[_0x1e92('0xb')](_0x1e92('0x1f'),_0x1b4f18);logger[_0x1e92('0xe')](_0x1e92('0x1f'),_0x1b4f18,JSON[_0x1e92('0xf')](_0x3648ef));_0x4603b3(_0x3648ef);})[_0x1e92('0x13')](function(_0x20445c){logger[_0x1e92('0x11')](_0x1e92('0x1f'),_0x20445c['message'],_0x1b4f18);_0x5d2b0(_0x3d67a6['error'](0x1f4,_0x20445c[_0x1e92('0x12')]));});});};
\ No newline at end of file
index 7d00c29..2bec29a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x784b=['Router','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express'];(function(_0x238eaf,_0x5649ce){var _0x5a087c=function(_0x3b3234){while(--_0x3b3234){_0x238eaf['push'](_0x238eaf['shift']());}};_0x5a087c(++_0x5649ce);}(_0x784b,0x6b));var _0xb784=function(_0x2364bc,_0x5b1127){_0x2364bc=_0x2364bc-0x0;var _0xcdb4c=_0x784b[_0x2364bc];return _0xcdb4c;};'use strict';var express=require(_0xb784('0x0'));var router=express[_0xb784('0x1')]();var auth=require(_0xb784('0x2'));var controller=require(_0xb784('0x3'));router[_0xb784('0x4')](_0xb784('0x5'),auth[_0xb784('0x6')](),controller[_0xb784('0x7')]);module[_0xb784('0x8')]=router;
\ No newline at end of file
+var _0xcad5=['../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0x5d462e,_0x424479){var _0x312c3b=function(_0x1c15d9){while(--_0x1c15d9){_0x5d462e['push'](_0x5d462e['shift']());}};_0x312c3b(++_0x424479);}(_0xcad5,0xb2));var _0x5cad=function(_0x1ea82f,_0xdde3e5){_0x1ea82f=_0x1ea82f-0x0;var _0x327a61=_0xcad5[_0x1ea82f];return _0x327a61;};'use strict';var express=require(_0x5cad('0x0'));var router=express[_0x5cad('0x1')]();var auth=require(_0x5cad('0x2'));var controller=require(_0x5cad('0x3'));router[_0x5cad('0x4')](_0x5cad('0x5'),auth[_0x5cad('0x6')](),controller[_0x5cad('0x7')]);module[_0x5cad('0x8')]=router;
\ No newline at end of file
index d52721f..232746d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5945=['info','debug','exports','ENUM','BOOLEAN','TEXT','DATE','INTEGER','UserId'];(function(_0x48f825,_0x158809){var _0x3fd20c=function(_0x1d9033){while(--_0x1d9033){_0x48f825['push'](_0x48f825['shift']());}};_0x3fd20c(++_0x158809);}(_0x5945,0xa2));var _0x5594=function(_0x5ecc63,_0x110d0d){_0x5ecc63=_0x5ecc63-0x0;var _0x56e65f=_0x5945[_0x5ecc63];return _0x56e65f;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=['error','warning',_0x5594('0x0'),_0x5594('0x1')];module[_0x5594('0x2')]={'clientSideLoggingLevel':{'type':Sequelize[_0x5594('0x3')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x5594('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x5594('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x5594('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x5594('0x7')],'unique':_0x5594('0x8')}};
\ No newline at end of file
+var _0x13be=['error','warning','info','exports','BOOLEAN','DATE','UserId','sequelize'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x13be,0x1ef));var _0xe13b=function(_0x328830,_0x9af3ae){_0x328830=_0x328830-0x0;var _0x56c0df=_0x13be[_0x328830];return _0x56c0df;};'use strict';var Sequelize=require(_0xe13b('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xe13b('0x1'),_0xe13b('0x2'),_0xe13b('0x3'),'debug'];module[_0xe13b('0x4')]={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xe13b('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xe13b('0x5')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xe13b('0x6')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xe13b('0x7')}};
\ No newline at end of file
index 50b238d..512969e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48d=['socket.io-emitter','redis','register','defaults','localhost','status','then','sendStatus','error','stack','name','send','update','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','body','lodash','../../config/logger','../../config/environment','../../mysqldb'];(function(_0x371ad4,_0x4e23f0){var _0x796c0b=function(_0x5013c0){while(--_0x5013c0){_0x371ad4['push'](_0x371ad4['shift']());}};_0x796c0b(++_0x4e23f0);}(_0xb48d,0x194));var _0xdb48=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb48d[_0x27af45];return _0x18df21;};'use strict';var _=require(_0xdb48('0x0'));var Redis=require('ioredis');var logger=require(_0xdb48('0x1'))('api');var config=require(_0xdb48('0x2'));var db=require(_0xdb48('0x3'))['db'];var socket=require(_0xdb48('0x4'))(new Redis(config[_0xdb48('0x5')]));require('./user-setting.socket')[_0xdb48('0x6')](socket);config['redis']=_[_0xdb48('0x7')](config[_0xdb48('0x5')],{'host':_0xdb48('0x8'),'port':0x18eb});function respondWithResult(_0x5db721,_0x4e834c){_0x4e834c=_0x4e834c||0xc8;return function(_0x251ce5){if(_0x251ce5){return _0x5db721[_0xdb48('0x9')](_0x4e834c)['json'](_0x251ce5);}};}function saveUpdates(_0x15987c){return function(_0x1f6224){if(_0x1f6224){return _0x1f6224['update'](_0x15987c)[_0xdb48('0xa')](function(_0x1ea481){return _0x1ea481;});}return null;};}function handleEntityNotFound(_0x4d8e52){return function(_0x484243){if(!_0x484243){_0x4d8e52[_0xdb48('0xb')](0x194);}return _0x484243;};}function handleError(_0x31e032,_0x2917f4){_0x2917f4=_0x2917f4||0x1f4;return function(_0x547538){logger[_0xdb48('0xc')](_0x547538[_0xdb48('0xd')]);if(_0x547538['name']){delete _0x547538[_0xdb48('0xe')];}_0x31e032[_0xdb48('0x9')](_0x2917f4)[_0xdb48('0xf')](_0x547538);};}exports[_0xdb48('0x10')]=function(_0xd1fabe,_0x315da2){if(_0xd1fabe['user'][_0xdb48('0x11')]!==_0xdb48('0x12'))throw new Error(_0xdb48('0x13'));if(isNaN(Number(_0xd1fabe['params']['id'])))throw new Error(_0xdb48('0x14'));return db['UserSetting'][_0xdb48('0x15')]({'where':{'id':_0xd1fabe[_0xdb48('0x16')]['id']}})[_0xdb48('0xa')](handleEntityNotFound(_0x315da2,null))[_0xdb48('0xa')](saveUpdates(_0xd1fabe[_0xdb48('0x17')],null))['then'](respondWithResult(_0x315da2,null))['catch'](handleError(_0x315da2,null));};
\ No newline at end of file
+var _0xa98d=['./user-setting.socket','register','defaults','localhost','json','update','sendStatus','error','stack','name','status','send','user','Unauthorized','params','Invalid\x20user\x20setting\x20id','find','then','catch','lodash','../../config/logger','../../config/environment','../../mysqldb','redis'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xa98d,0xa3));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xda98('0x0'));var Redis=require('ioredis');var logger=require(_0xda98('0x1'))('api');var config=require(_0xda98('0x2'));var db=require(_0xda98('0x3'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0xda98('0x4')]));require(_0xda98('0x5'))[_0xda98('0x6')](socket);config['redis']=_[_0xda98('0x7')](config[_0xda98('0x4')],{'host':_0xda98('0x8'),'port':0x18eb});function respondWithResult(_0xd88a5f,_0x6ea268){_0x6ea268=_0x6ea268||0xc8;return function(_0x3706ba){if(_0x3706ba){return _0xd88a5f['status'](_0x6ea268)[_0xda98('0x9')](_0x3706ba);}};}function saveUpdates(_0x4ad603){return function(_0x1df38a){if(_0x1df38a){return _0x1df38a[_0xda98('0xa')](_0x4ad603)['then'](function(_0x3ba148){return _0x3ba148;});}return null;};}function handleEntityNotFound(_0x350a3c){return function(_0x571b88){if(!_0x571b88){_0x350a3c[_0xda98('0xb')](0x194);}return _0x571b88;};}function handleError(_0x5bf8f1,_0x351bdb){_0x351bdb=_0x351bdb||0x1f4;return function(_0x5542f8){logger[_0xda98('0xc')](_0x5542f8[_0xda98('0xd')]);if(_0x5542f8['name']){delete _0x5542f8[_0xda98('0xe')];}_0x5bf8f1[_0xda98('0xf')](_0x351bdb)[_0xda98('0x10')](_0x5542f8);};}exports[_0xda98('0xa')]=function(_0x3fb17b,_0x2122d5){if(_0x3fb17b[_0xda98('0x11')]['role']!=='admin')throw new Error(_0xda98('0x12'));if(isNaN(Number(_0x3fb17b[_0xda98('0x13')]['id'])))throw new Error(_0xda98('0x14'));return db['UserSetting'][_0xda98('0x15')]({'where':{'id':_0x3fb17b[_0xda98('0x13')]['id']}})[_0xda98('0x16')](handleEntityNotFound(_0x2122d5,null))[_0xda98('0x16')](saveUpdates(_0x3fb17b['body'],null))[_0xda98('0x16')](respondWithResult(_0x2122d5,null))[_0xda98('0x17')](handleError(_0x2122d5,null));};
\ No newline at end of file
index 8ac1417..cf16cba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8887=['events','UserSetting','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2b68b9,_0x3c421d){var _0x99dc46=function(_0x5654e1){while(--_0x5654e1){_0x2b68b9['push'](_0x2b68b9['shift']());}};_0x99dc46(++_0x3c421d);}(_0x8887,0x132));var _0x7888=function(_0x1f422a,_0x5ddd6d){_0x1f422a=_0x1f422a-0x0;var _0x5e3c51=_0x8887[_0x1f422a];return _0x5e3c51;};'use strict';var EventEmitter=require(_0x7888('0x0'));var UserSetting=require('../../mysqldb')['db'][_0x7888('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x7888('0x2')](0x0);var events={'afterCreate':_0x7888('0x3'),'afterUpdate':_0x7888('0x4'),'afterDestroy':_0x7888('0x5')};function emitEvent(_0x43577b){return function(_0x49217b,_0x24a7ad,_0x4e13ce){UserSettingEvents[_0x7888('0x6')](_0x43577b+':'+_0x49217b['id'],_0x49217b);UserSettingEvents['emit'](_0x43577b,_0x49217b);_0x4e13ce(null);};}for(var e in events){if(events[_0x7888('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0x7888('0x8')]=UserSettingEvents;
\ No newline at end of file
+var _0x3cdf=['hook','exports','events','../../mysqldb','UserSetting','save','update','remove','emit','hasOwnProperty'];(function(_0x3d1ea9,_0x27825a){var _0x1c1a38=function(_0x4d026c){while(--_0x4d026c){_0x3d1ea9['push'](_0x3d1ea9['shift']());}};_0x1c1a38(++_0x27825a);}(_0x3cdf,0x142));var _0xf3cd=function(_0x467bb0,_0x1ee3f4){_0x467bb0=_0x467bb0-0x0;var _0x2dea67=_0x3cdf[_0x467bb0];return _0x2dea67;};'use strict';var EventEmitter=require(_0xf3cd('0x0'));var UserSetting=require(_0xf3cd('0x1'))['db'][_0xf3cd('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf3cd('0x3'),'afterUpdate':_0xf3cd('0x4'),'afterDestroy':_0xf3cd('0x5')};function emitEvent(_0x2a5231){return function(_0x144657,_0x2e0cb7,_0x4e425e){UserSettingEvents[_0xf3cd('0x6')](_0x2a5231+':'+_0x144657['id'],_0x144657);UserSettingEvents['emit'](_0x2a5231,_0x144657);_0x4e425e(null);};}for(var e in events){if(events[_0xf3cd('0x7')](e)){var event=events[e];UserSetting[_0xf3cd('0x8')](e,emitEvent(event));}}module[_0xf3cd('0x9')]=UserSettingEvents;
\ No newline at end of file
index 5cfa1a1..175efbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4f=['define','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x21bde4,_0x57f5e4){var _0x2b20f6=function(_0x23b500){while(--_0x23b500){_0x21bde4['push'](_0x21bde4['shift']());}};_0x2b20f6(++_0x57f5e4);}(_0xee4f,0xad));var _0xfee4=function(_0x28837b,_0x4c8475){_0x28837b=_0x28837b-0x0;var _0x2dce86=_0xee4f[_0x28837b];return _0x2dce86;};'use strict';var attributes=require(_0xfee4('0x0'));module['exports']=function(_0x56a471){return _0x56a471[_0xfee4('0x1')](_0xfee4('0x2'),attributes,{'tableName':_0xfee4('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5a03c9){if(!_0x5a03c9[_0xfee4('0x4')])_0x5a03c9['clientSideLoggingEnabledSince']=null;else if(_0x5a03c9[_0xfee4('0x5')]===null)_0x5a03c9['clientSideLoggingEnabledSince']=new Date();}}});};
\ No newline at end of file
+var _0x9e0d=['clientSideLoggingEnabledSince','./user-setting.attributes','exports','define','user_settings','clientSideLoggingEnabled'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x9e0d,0xf7));var _0xd9e0=function(_0x58e590,_0x4b64c9){_0x58e590=_0x58e590-0x0;var _0x594dcf=_0x9e0d[_0x58e590];return _0x594dcf;};'use strict';var attributes=require(_0xd9e0('0x0'));module[_0xd9e0('0x1')]=function(_0x6d0b17){return _0x6d0b17[_0xd9e0('0x2')]('UserSetting',attributes,{'tableName':_0xd9e0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ec198){if(!_0x3ec198[_0xd9e0('0x4')])_0x3ec198[_0xd9e0('0x5')]=null;else if(_0x3ec198[_0xd9e0('0x5')]===null)_0x3ec198[_0xd9e0('0x5')]=new Date();}}});};
\ No newline at end of file
index 8ed685a..c9176de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb62=['register','length','./user-setting.events','save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId'];(function(_0x1533a5,_0x1d064a){var _0x1e018b=function(_0x15f9c8){while(--_0x15f9c8){_0x1533a5['push'](_0x1533a5['shift']());}};_0x1e018b(++_0x1d064a);}(_0xbb62,0x1ec));var _0x2bb6=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xbb62[_0x2576d7];return _0x16a08c;};'use strict';var UserSettingEvents=require(_0x2bb6('0x0'));var events=[_0x2bb6('0x1'),_0x2bb6('0x2'),_0x2bb6('0x3')];function createListener(_0x4517cd,_0x268ede){return function(_0x4396f0){_0x268ede[_0x2bb6('0x4')](_0x4517cd,_0x4396f0);if(_0x4517cd===_0x2bb6('0x5')){_0x268ede[_0x2bb6('0x4')](_0x2bb6('0x6')+_0x4396f0[_0x2bb6('0x7')],_0x4396f0);}};}exports[_0x2bb6('0x8')]=function(_0x19a539){for(var _0x17d221=0x0,_0x33390a=events[_0x2bb6('0x9')];_0x17d221<_0x33390a;_0x17d221++){var _0x2898b1=events[_0x17d221];var _0x42087c=createListener('user-setting:'+_0x2898b1,_0x19a539);UserSettingEvents['on'](_0x2898b1,_0x42087c);}};
\ No newline at end of file
+var _0x647a=['./user-setting.events','remove','update','user-setting:update','emit','UserId','register','length','user-setting:'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x647a,0x1dd));var _0xa647=function(_0x364af7,_0x3ac72b){_0x364af7=_0x364af7-0x0;var _0x3f5a1f=_0x647a[_0x364af7];return _0x3f5a1f;};'use strict';var UserSettingEvents=require(_0xa647('0x0'));var events=['save',_0xa647('0x1'),_0xa647('0x2')];function createListener(_0x5f5741,_0x5cfb85){return function(_0x29afce){_0x5cfb85['emit'](_0x5f5741,_0x29afce);if(_0x5f5741===_0xa647('0x3')){_0x5cfb85[_0xa647('0x4')]('user-setting:update:user-'+_0x29afce[_0xa647('0x5')],_0x29afce);}};}exports[_0xa647('0x6')]=function(_0x3a00c1){for(var _0x33fce9=0x0,_0x4cc0c8=events[_0xa647('0x7')];_0x33fce9<_0x4cc0c8;_0x33fce9++){var _0x1acf1b=events[_0x33fce9];var _0x1a1027=createListener(_0xa647('0x8')+_0x1acf1b,_0x3a00c1);UserSettingEvents['on'](_0x1acf1b,_0x1a1027);}};
\ No newline at end of file
index 0802292..69c63dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a5f=['/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','addQueues','join','root','server/files/images/','format','%s-%s','single','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addFaxAccounts','addMailAccounts','/:id/sms_accounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeApiKey','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/whoami','whoami','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6a5f,0x187));var _0xf6a5=function(_0x4534e3,_0x56de6e){_0x4534e3=_0x4534e3-0x0;var _0x50c3a3=_0x6a5f[_0x4534e3];return _0x50c3a3;};'use strict';var multer=require(_0xf6a5('0x0'));var util=require('util');var path=require(_0xf6a5('0x1'));var timeout=require('connect-timeout');var express=require(_0xf6a5('0x2'));var router=express[_0xf6a5('0x3')]();var fs_extra=require(_0xf6a5('0x4'));var auth=require(_0xf6a5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf6a5('0x6'));var controller=require('./user.controller');router[_0xf6a5('0x7')]('/',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x9')]);router[_0xf6a5('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xf6a5('0xa')]);router[_0xf6a5('0x7')](_0xf6a5('0xb'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0xc')]);router['get']('/presence',auth['isAuthenticated'](),controller['getPresence']);router['get'](_0xf6a5('0xd'),auth['isAuthenticated'](),controller[_0xf6a5('0xe')]);router['get'](_0xf6a5('0xf'),controller[_0xf6a5('0x10')]);router['get']('/:id/open_tabs',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x11')]);router[_0xf6a5('0x7')](_0xf6a5('0x12'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x13')]);router[_0xf6a5('0x7')](_0xf6a5('0x14'),auth['isAuthenticated'](),controller['getQueues']);router['get'](_0xf6a5('0x15'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x16')]);router[_0xf6a5('0x7')](_0xf6a5('0x17'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x18')]);router[_0xf6a5('0x7')](_0xf6a5('0x19'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x1a')]);router[_0xf6a5('0x7')](_0xf6a5('0x1b'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x1c')]);router[_0xf6a5('0x7')](_0xf6a5('0x1d'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x1e')]);router['get'](_0xf6a5('0x1f'),auth[_0xf6a5('0x8')](),controller['getOpenchannelInteractions']);router[_0xf6a5('0x7')](_0xf6a5('0x20'),auth[_0xf6a5('0x8')](),controller['getMailInteractions']);router[_0xf6a5('0x7')]('/:id/sms/interactions',auth['isAuthenticated'](),controller[_0xf6a5('0x21')]);router['get'](_0xf6a5('0x22'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x23')]);router[_0xf6a5('0x7')](_0xf6a5('0x24'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x25')]);router[_0xf6a5('0x7')](_0xf6a5('0x26'),auth[_0xf6a5('0x8')](),controller['getTeams']);router[_0xf6a5('0x7')](_0xf6a5('0x27'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x28')]);router[_0xf6a5('0x7')](_0xf6a5('0x29'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x2a')]);router[_0xf6a5('0x7')](_0xf6a5('0x2b'),auth[_0xf6a5('0x8')](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x2c')]);router[_0xf6a5('0x7')](_0xf6a5('0x2d'),auth[_0xf6a5('0x8')](),controller['getMailAccounts']);router[_0xf6a5('0x7')](_0xf6a5('0x2e'),auth[_0xf6a5('0x8')](),controller['getOpenchannelAccounts']);router['get']('/:id/sms_accounts',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x2f')]);router[_0xf6a5('0x7')](_0xf6a5('0x30'),auth[_0xf6a5('0x8')](),controller['getChatWebsites']);router[_0xf6a5('0x7')](_0xf6a5('0x31'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x32')]);router[_0xf6a5('0x7')](_0xf6a5('0x33'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x34')]);router[_0xf6a5('0x7')](_0xf6a5('0x35'),auth['isAuthenticated'](),controller[_0xf6a5('0x36')]);router[_0xf6a5('0x7')](_0xf6a5('0x37'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x38')]);router[_0xf6a5('0x39')](_0xf6a5('0x12'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x3a')]);router[_0xf6a5('0x39')]('/',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x3b')]);router[_0xf6a5('0x39')](_0xf6a5('0x3c'),auth[_0xf6a5('0x8')](),controller['bulkCreate']);router[_0xf6a5('0x39')](_0xf6a5('0x14'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x3d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x375698,_0x366ed1,_0x48e8a0){_0x48e8a0(null,path[_0xf6a5('0x3e')](config[_0xf6a5('0x3f')],_0xf6a5('0x40')));},'filename':function(_0x48f2a9,_0x380163,_0x1ebf69){_0x1ebf69(null,util[_0xf6a5('0x41')](_0xf6a5('0x42'),Date['now'](),_0x380163['originalname']));}})});router['post'](_0xf6a5('0xf'),upload[_0xf6a5('0x43')](_0xf6a5('0x44')),controller[_0xf6a5('0x45')]);router[_0xf6a5('0x39')](_0xf6a5('0x46'),auth['isAuthenticated'](),controller['login']);router['post'](_0xf6a5('0x47'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x48')]);router[_0xf6a5('0x39')](_0xf6a5('0x49'),auth[_0xf6a5('0x8')](),controller['pause']);router[_0xf6a5('0x39')](_0xf6a5('0x4a'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x4b')]);router[_0xf6a5('0x39')](_0xf6a5('0x26'),auth['isAuthenticated'](),controller[_0xf6a5('0x4c')]);router[_0xf6a5('0x39')](_0xf6a5('0x4d'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x4e')]);router[_0xf6a5('0x39')](_0xf6a5('0x4f'),auth[_0xf6a5('0x8')](),controller['addMailInteractions']);router[_0xf6a5('0x39')]('/:id/fax_interactions',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x50')]);router[_0xf6a5('0x39')](_0xf6a5('0x51'),auth['isAuthenticated'](),controller[_0xf6a5('0x52')]);router['post'](_0xf6a5('0x53'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x54')]);router[_0xf6a5('0x39')](_0xf6a5('0x55'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x56')]);router[_0xf6a5('0x39')](_0xf6a5('0x57'),auth['isAuthenticated'](),controller[_0xf6a5('0x58')]);router[_0xf6a5('0x39')](_0xf6a5('0x2d'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x59')]);router['post'](_0xf6a5('0x2e'),auth[_0xf6a5('0x8')](),controller['addOpenchannelAccounts']);router[_0xf6a5('0x39')](_0xf6a5('0x5a'),auth[_0xf6a5('0x8')](),controller['addSmsAccounts']);router[_0xf6a5('0x39')](_0xf6a5('0x30'),auth[_0xf6a5('0x8')](),controller['addChatWebsites']);router['post'](_0xf6a5('0x31'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xf6a5('0x39')](_0xf6a5('0x33'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x5b')]);router[_0xf6a5('0x39')](_0xf6a5('0x37'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x5c')]);router[_0xf6a5('0x5d')](_0xf6a5('0xd'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x5e')]);router[_0xf6a5('0x5d')](_0xf6a5('0x5f'),auth['isAuthenticated'](),controller[_0xf6a5('0x60')]);router[_0xf6a5('0x61')](_0xf6a5('0x14'),auth[_0xf6a5('0x8')](),controller['removeQueues']);router[_0xf6a5('0x61')](_0xf6a5('0x26'),auth['isAuthenticated'](),controller[_0xf6a5('0x62')]);router['delete'](_0xf6a5('0xd'),auth['isAuthenticated'](),controller[_0xf6a5('0x63')]);router[_0xf6a5('0x61')]('/:id/chat_interactions',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x64')]);router[_0xf6a5('0x61')](_0xf6a5('0x4f'),auth['isAuthenticated'](),controller[_0xf6a5('0x65')]);router[_0xf6a5('0x61')]('/:id/fax_interactions',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x66')]);router[_0xf6a5('0x61')](_0xf6a5('0x51'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x67')]);router['delete'](_0xf6a5('0x53'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x68')]);router['delete']('/:id/whatsapp_interactions',auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x69')]);router['delete'](_0xf6a5('0x57'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x6a')]);router[_0xf6a5('0x61')](_0xf6a5('0x2d'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x6b')]);router[_0xf6a5('0x61')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller[_0xf6a5('0x6c')]);router['delete'](_0xf6a5('0x5a'),auth[_0xf6a5('0x8')](),controller['removeSmsAccounts']);router[_0xf6a5('0x61')]('/:id/chat_websites',auth[_0xf6a5('0x8')](),controller['removeChatWebsites']);router[_0xf6a5('0x61')](_0xf6a5('0x31'),auth[_0xf6a5('0x8')](),controller['removeWhatsappAccounts']);router[_0xf6a5('0x61')](_0xf6a5('0x33'),auth[_0xf6a5('0x8')](),controller['removeSquareProjects']);router[_0xf6a5('0x61')](_0xf6a5('0x37'),auth[_0xf6a5('0x8')](),controller[_0xf6a5('0x6d')]);module['exports']=router;
\ No newline at end of file
+var _0xc68f=['getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','/:id/api_key','getApiKey','post','addContacts','create','/create_many','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','single','file','login','/:id/logout','pause','/:id/unpause','unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addWhatsappInteractions','addFaxAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','update','/:id/password','changePassword','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','delete','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSquareProjects','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings'];(function(_0x326811,_0x419d5d){var _0x2554e3=function(_0x49e1cb){while(--_0x49e1cb){_0x326811['push'](_0x326811['shift']());}};_0x2554e3(++_0x419d5d);}(_0xc68f,0x1be));var _0xfc68=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xc68f[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0xfc68('0x0'));var util=require(_0xfc68('0x1'));var path=require(_0xfc68('0x2'));var timeout=require(_0xfc68('0x3'));var express=require(_0xfc68('0x4'));var router=express[_0xfc68('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfc68('0x6'));var config=require(_0xfc68('0x7'));var controller=require(_0xfc68('0x8'));router[_0xfc68('0x9')]('/',auth[_0xfc68('0xa')](),controller[_0xfc68('0xb')]);router[_0xfc68('0x9')](_0xfc68('0xc'),auth['isAuthenticated'](),controller[_0xfc68('0xd')]);router[_0xfc68('0x9')]('/whoami',auth[_0xfc68('0xa')](),controller[_0xfc68('0xe')]);router[_0xfc68('0x9')]('/presence',auth[_0xfc68('0xa')](),controller[_0xfc68('0xf')]);router[_0xfc68('0x9')](_0xfc68('0x10'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x11')]);router[_0xfc68('0x9')](_0xfc68('0x12'),controller[_0xfc68('0x13')]);router['get'](_0xfc68('0x14'),auth['isAuthenticated'](),controller[_0xfc68('0x15')]);router[_0xfc68('0x9')](_0xfc68('0x16'),auth[_0xfc68('0xa')](),controller['getContacts']);router[_0xfc68('0x9')]('/:id/queues',auth[_0xfc68('0xa')](),controller[_0xfc68('0x17')]);router['get'](_0xfc68('0x18'),auth['isAuthenticated'](),controller[_0xfc68('0x19')]);router[_0xfc68('0x9')](_0xfc68('0x1a'),auth[_0xfc68('0xa')](),controller['getGroups']);router[_0xfc68('0x9')](_0xfc68('0x1b'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x1c')]);router['get'](_0xfc68('0x1d'),auth['isAuthenticated'](),controller[_0xfc68('0x1e')]);router[_0xfc68('0x9')](_0xfc68('0x1f'),auth[_0xfc68('0xa')](),controller['getChatInteractions']);router[_0xfc68('0x9')](_0xfc68('0x20'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x21')]);router[_0xfc68('0x9')](_0xfc68('0x22'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x23')]);router[_0xfc68('0x9')](_0xfc68('0x24'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x25')]);router[_0xfc68('0x9')]('/:id/fax/interactions',auth[_0xfc68('0xa')](),controller[_0xfc68('0x26')]);router['get']('/:id/whatsapp/interactions',auth[_0xfc68('0xa')](),controller[_0xfc68('0x27')]);router[_0xfc68('0x9')]('/:id/teams',auth[_0xfc68('0xa')](),controller[_0xfc68('0x28')]);router[_0xfc68('0x9')](_0xfc68('0x29'),auth['isAuthenticated'](),controller[_0xfc68('0x2a')]);router[_0xfc68('0x9')](_0xfc68('0x2b'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x2c')]);router['get']('/:id/prefixes',auth['isAuthenticated'](),controller[_0xfc68('0x2d')]);router[_0xfc68('0x9')](_0xfc68('0x2e'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x2f')]);router[_0xfc68('0x9')](_0xfc68('0x30'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x31')]);router['get'](_0xfc68('0x32'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x33')]);router[_0xfc68('0x9')](_0xfc68('0x34'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x35')]);router[_0xfc68('0x9')](_0xfc68('0x36'),auth['isAuthenticated'](),controller[_0xfc68('0x37')]);router[_0xfc68('0x9')](_0xfc68('0x38'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x39')]);router['get'](_0xfc68('0x3a'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x3b')]);router['get'](_0xfc68('0x3c'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xfc68('0x9')](_0xfc68('0x3d'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x3e')]);router[_0xfc68('0x3f')](_0xfc68('0x16'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x40')]);router['post']('/',auth[_0xfc68('0xa')](),controller[_0xfc68('0x41')]);router[_0xfc68('0x3f')](_0xfc68('0x42'),auth['isAuthenticated'](),controller[_0xfc68('0x43')]);router[_0xfc68('0x3f')](_0xfc68('0x44'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x45')]);var upload=multer({'storage':multer[_0xfc68('0x46')]({'destination':function(_0x49c63d,_0x22bf8c,_0x264af5){_0x264af5(null,path[_0xfc68('0x47')](config[_0xfc68('0x48')],_0xfc68('0x49')));},'filename':function(_0x31be2d,_0x4cc6f1,_0x58e7cf){_0x58e7cf(null,util[_0xfc68('0x4a')](_0xfc68('0x4b'),Date['now'](),_0x4cc6f1['originalname']));}})});router['post'](_0xfc68('0x12'),upload[_0xfc68('0x4c')](_0xfc68('0x4d')),controller['addAvatar']);router['post']('/:id/login',auth['isAuthenticated'](),controller[_0xfc68('0x4e')]);router[_0xfc68('0x3f')](_0xfc68('0x4f'),auth[_0xfc68('0xa')](),controller['logout']);router[_0xfc68('0x3f')]('/:id/pause',auth[_0xfc68('0xa')](),controller[_0xfc68('0x50')]);router[_0xfc68('0x3f')](_0xfc68('0x51'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x52')]);router[_0xfc68('0x3f')](_0xfc68('0x53'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x54')]);router[_0xfc68('0x3f')]('/:id/chat_interactions',auth[_0xfc68('0xa')](),controller[_0xfc68('0x55')]);router[_0xfc68('0x3f')](_0xfc68('0x56'),auth['isAuthenticated'](),controller[_0xfc68('0x57')]);router[_0xfc68('0x3f')](_0xfc68('0x58'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x59')]);router[_0xfc68('0x3f')](_0xfc68('0x5a'),auth['isAuthenticated'](),controller[_0xfc68('0x5b')]);router['post'](_0xfc68('0x5c'),auth[_0xfc68('0xa')](),controller['addOpenchannelInteractions']);router[_0xfc68('0x3f')]('/:id/whatsapp_interactions',auth[_0xfc68('0xa')](),controller[_0xfc68('0x5d')]);router[_0xfc68('0x3f')](_0xfc68('0x2e'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x5e')]);router[_0xfc68('0x3f')]('/:id/mail_accounts',auth[_0xfc68('0xa')](),controller['addMailAccounts']);router[_0xfc68('0x3f')](_0xfc68('0x32'),auth[_0xfc68('0xa')](),controller['addOpenchannelAccounts']);router[_0xfc68('0x3f')](_0xfc68('0x34'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x5f')]);router[_0xfc68('0x3f')]('/:id/chat_websites',auth[_0xfc68('0xa')](),controller[_0xfc68('0x60')]);router[_0xfc68('0x3f')]('/:id/whatsapp_accounts',auth[_0xfc68('0xa')](),controller[_0xfc68('0x61')]);router[_0xfc68('0x3f')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xfc68('0x62')]);router[_0xfc68('0x3f')](_0xfc68('0x3d'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x63')]);router[_0xfc68('0x64')](_0xfc68('0x10'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x65')]);router[_0xfc68('0x64')](_0xfc68('0x66'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x67')]);router['delete']('/:id/queues',auth[_0xfc68('0xa')](),controller[_0xfc68('0x68')]);router['delete']('/:id/teams',auth[_0xfc68('0xa')](),controller[_0xfc68('0x69')]);router['delete'](_0xfc68('0x10'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x6a')]);router['delete'](_0xfc68('0x6b'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x6c')]);router[_0xfc68('0x6d')](_0xfc68('0x56'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x6e')]);router[_0xfc68('0x6d')]('/:id/fax_interactions',auth[_0xfc68('0xa')](),controller[_0xfc68('0x6f')]);router[_0xfc68('0x6d')](_0xfc68('0x5a'),auth[_0xfc68('0xa')](),controller[_0xfc68('0x70')]);router[_0xfc68('0x6d')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xfc68('0x71')]);router[_0xfc68('0x6d')](_0xfc68('0x72'),auth['isAuthenticated'](),controller[_0xfc68('0x73')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0xfc68('0x74')]);router['delete'](_0xfc68('0x30'),auth['isAuthenticated'](),controller[_0xfc68('0x75')]);router[_0xfc68('0x6d')](_0xfc68('0x32'),auth[_0xfc68('0xa')](),controller['removeOpenchannelAccounts']);router[_0xfc68('0x6d')]('/:id/sms_accounts',auth[_0xfc68('0xa')](),controller['removeSmsAccounts']);router[_0xfc68('0x6d')]('/:id/chat_websites',auth[_0xfc68('0xa')](),controller['removeChatWebsites']);router[_0xfc68('0x6d')](_0xfc68('0x38'),auth[_0xfc68('0xa')](),controller['removeWhatsappAccounts']);router['delete'](_0xfc68('0x3a'),auth['isAuthenticated'](),controller[_0xfc68('0x76')]);router['delete'](_0xfc68('0x3d'),auth[_0xfc68('0xa')](),controller['removeApiKey']);module['exports']=router;
\ No newline at end of file
index c7d2ed8..5cea1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x23ea05,_0x26d1fd){var _0x1e2845=function(_0x3c48b8){while(--_0x3c48b8){_0x23ea05['push'](_0x23ea05['shift']());}};_0x1e2845(++_0x26d1fd);}(_0x34e8,0x12c));var _0x834e=function(_0x2b1491,_0x1660f4){_0x2b1491=_0x2b1491-0x0;var _0x3ca392=_0x34e8[_0x2b1491];return _0x3ca392;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x70e0=['refuse','originate','uac','uas','fingerprint','update,nonat','TEXT','showWebBar','get','isArray','wss','udp','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','insecure','\x22\x22\x20<>','always','accept'];(function(_0x27a1e7,_0x536e0d){var _0x3ddc9f=function(_0x4ac185){while(--_0x4ac185){_0x27a1e7['push'](_0x27a1e7['shift']());}};_0x3ddc9f(++_0x536e0d);}(_0x70e0,0x17b));var _0x070e=function(_0x51cf4b,_0x22af58){_0x51cf4b=_0x51cf4b-0x0;var _0x364b98=_0x70e0[_0x51cf4b];return _0x364b98;};'use strict';var Sequelize=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var util=require(_0x070e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'unique':_0x070e('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x277d32){this[_0x070e('0x5')]('name',_0x277d32);this[_0x070e('0x5')]('defaultuser',_0x277d32);},'comment':_0x070e('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x56e420){this['setDataValue'](_0x070e('0x7'),_0x56e420);this[_0x070e('0x5')](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),_0x56e420,this[_0x070e('0xb')](_0x070e('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x070e('0xd'),'validate':{'isEmail':!![]},'set':function(_0x2e3e5e){if(_0x2e3e5e){this[_0x070e('0x5')](_0x070e('0xd'),_0x2e3e5e[_0x070e('0xe')]());}}},'role':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x10'),_0x070e('0x11'),_0x070e('0x12'),_0x070e('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x4a33d2){this['setDataValue'](_0x070e('0xc'),_0x4a33d2);this[_0x070e('0x5')]('accountcode',_0x4a33d2);this['setDataValue'](_0x070e('0x8'),util[_0x070e('0x9')](_0x070e('0xa'),this[_0x070e('0xb')]('fullname'),_0x4a33d2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x070e('0x3')]},'mobile':{'type':Sequelize[_0x070e('0x3')]},'address':{'type':Sequelize[_0x070e('0x3')]},'zipcode':{'type':Sequelize[_0x070e('0x3')]},'userpic':{'type':Sequelize[_0x070e('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x070e('0x3')]},'online':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x070e('0x16')]},'voicePause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x070e('0x16')]},'chatCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x070e('0x14')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x17')},'ipaddr':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x070e('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x18'),_0x070e('0x11'),_0x070e('0x19')),'allowNull':!![],'defaultValue':_0x070e('0x18')},'context':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x1a'),_0x070e('0x1b'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x070e('0x1c'),_0x070e('0x1d'),_0x070e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'udp','set':function(_0x59c5b4){this[_0x070e('0x5')]('transport',_0x59c5b4?_0x59c5b4[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')]('transport')?this['getDataValue'](_0x070e('0x20'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0x070e('0x22'),_0x070e('0x23'),_0x070e('0x24'),_0x070e('0x25'),_0x070e('0x26')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x28'),_0x070e('0x29'),_0x070e('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x2b'),'set':function(_0x34746e){this['setDataValue']('nat',_0x34746e?_0x34746e['join'](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2c'))?this[_0x070e('0xb')](_0x070e('0x2c'))[_0x070e('0x21')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x070e('0x3')]},'namedcallgroup':{'type':Sequelize[_0x070e('0x3')]},'pickupgroup':{'type':Sequelize[_0x070e('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x070e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x070e('0x3')]},'disallow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x070e('0x3')],'allowNull':![],'defaultValue':_0x070e('0x2d'),'set':function(_0x4800a9){this[_0x070e('0x5')]('allow',_0x4800a9?_0x4800a9[_0x070e('0x1f')](';'):_0x070e('0x2d'));},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2e'))?this[_0x070e('0xb')]('allow')[_0x070e('0x21')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![],'set':function(_0x38879f){this['setDataValue'](_0x070e('0x2f'),_0x38879f?_0x38879f[_0x070e('0x1f')](','):null);},'get':function(){return this[_0x070e('0xb')](_0x070e('0x2f'))?this['getDataValue'](_0x070e('0x2f'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x070e('0x30')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x31')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x32'),_0x070e('0x33'),_0x070e('0x34')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x35'),'uas'),'allowNull':!![],'defaultValue':_0x070e('0x36')},'t38pt_usertpsource':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':_0x070e('0x27')},'keepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x070e('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no',_0x070e('0x37'),'certificate'),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x070e('0xf')]('active','passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x070e('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x070e('0xf')](_0x070e('0x27'),'no',_0x070e('0x28'),'update',_0x070e('0x38')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x070e('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x070e('0x39')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x4cb86f){this['setDataValue'](_0x070e('0x3a'),_0x4cb86f);var _0x1ae5cb=this[_0x070e('0x3b')]({'plain':!![]});switch(_0x4cb86f){case 0x0:case 0x1:var _0x122198=_0x1ae5cb[_0x070e('0x20')]?_[_0x070e('0x3c')](_0x1ae5cb['transport'])?_0x1ae5cb[_0x070e('0x20')]['join']():_0x1ae5cb[_0x070e('0x20')]:'udp';if(_0x122198===_0x070e('0x3d')){_0x122198=_0x070e('0x3e');}this['setDataValue'](_0x070e('0x20'),_0x122198);this['setDataValue'](_0x070e('0x3f'),'no');this[_0x070e('0x5')](_0x070e('0x40'),null);this[_0x070e('0x5')](_0x070e('0x41'),null);this[_0x070e('0x5')](_0x070e('0x42'),null);this[_0x070e('0x5')](_0x070e('0x43'),null);this[_0x070e('0x5')](_0x070e('0x44'),null);this[_0x070e('0x5')](_0x070e('0x45'),null);this[_0x070e('0x5')]('dtlscertfile',null);this[_0x070e('0x5')](_0x070e('0x46'),null);this[_0x070e('0x5')](_0x070e('0x47'),'no');break;case 0x2:this['setDataValue'](_0x070e('0x20'),_0x070e('0x3d'));this[_0x070e('0x5')](_0x070e('0x3f'),_0x070e('0x27'));this[_0x070e('0x5')]('avpf',_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x41'),_0x070e('0x27'));this['setDataValue'](_0x070e('0x42'),'yes');this[_0x070e('0x5')](_0x070e('0x43'),_0x070e('0x27'));this[_0x070e('0x5')](_0x070e('0x44'),'no');this['setDataValue'](_0x070e('0x45'),_0x070e('0x48'));this[_0x070e('0x5')](_0x070e('0x49'),_0x1ae5cb['dtlscertfile']||_0x070e('0x4a'));this['setDataValue'](_0x070e('0x46'),_0x1ae5cb[_0x070e('0x46')]||_0x070e('0x4b'));this['setDataValue'](_0x070e('0x47'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x070e('0x39')],'set':function(_0x5ce157){this[_0x070e('0x5')](_0x070e('0x4c'),_0x5ce157?_0x5ce157['join'](','):[]);},'get':function(){return this[_0x070e('0xb')]('permissions')?_[_0x070e('0x4d')](this[_0x070e('0xb')]('permissions')['split'](','),function(_0x29ee66){return parseInt(_0x29ee66,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x070e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x070e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x070e('0x27'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x070e('0x4e')],'get':function(){return this[_0x070e('0xb')](_0x070e('0x4f'))?this[_0x070e('0xb')](_0x070e('0x4f')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x070e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x070e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x4f720f){if(typeof _0x4f720f==='string'){var _0x1624cd=_0x4f720f==='1'?!![]:_0x4f720f==='0'?![]:_0x4f720f===_0x070e('0x50')?!![]:_0x4f720f===_0x070e('0x51')?![]:![];this[_0x070e('0x5')]('screenrecording',_0x1624cd);}else{this[_0x070e('0x5')](_0x070e('0x52'),_0x4f720f);}}},'blocked':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![],'set':function(_0xd74f9c){this[_0x070e('0x5')](_0x070e('0x53'),_0xd74f9c);if(_0xd74f9c===!![]){this['setDataValue'](_0x070e('0x54'),moment());this['setDataValue'](_0x070e('0x55'),0x0);}else{this[_0x070e('0x5')](_0x070e('0x54'),null);}}},'blockedAt':{'type':Sequelize[_0x070e('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x070e('0x14')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x070e('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x070e('0x15')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x070e('0x14')],'defaultValue':0x0}};
\ No newline at end of file
index 09daab7..91dfdb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x592d=['removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','$and','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','CmHopper','firstName','lastName','phone','Contact','dialActive','getApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','queues','teams','inbound','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unknown','unavailable','voiceStatus','busy','charAt','toUpperCase','slice','select','field','ui.createdAt','_interactions','OpenTabs','moment','util','path','lodash','squel','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','socket.io-emitter','redis','./user.socket','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','update','emit','userNotification:recalc:','get','admin','Users','agent','Telephones','telephone','filter','ignore','map','value','includes','find','name','UserProfileResource','destroy','stack','send','index','User','rawAttributes','fieldName','type','key','password','salt','getOptions','where','query','includeAll','userSetting','include','UserSetting','push','openTabs','rows','length','dataValues','sms','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','filters','intersection','attributes','fields','true','merge','options','chat','fax','body','addContacts','ids','omit','internal','findById','securePassword','validatePasswordPattern','max','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','isNil','voicemail','mailbox','VoiceMail','fullname','email','role','permissions','102','103','113','110','104','105','107','108','100','111','114','create','user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','findAll','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','ValidationError','Sequelize','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','voice','VoiceQueue','format','SIP/%s','remove','isArray','Queue:remove','UserVoiceQueueRt','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','getContacts','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','mobile','intrf','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','getChannels','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','bulkCreate','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','Team','flattenDeep','addAgent','upsert','penalty','VoicePrefixId','getDataValue','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getAssociatedQueues','removeAgent','Voice','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts'];(function(_0x2f2d39,_0x37b1e8){var _0x1b147c=function(_0x2254dc){while(--_0x2254dc){_0x2f2d39['push'](_0x2f2d39['shift']());}};_0x1b147c(++_0x37b1e8);}(_0x592d,0x1e1));var _0xd592=function(_0x1c83e8,_0x11c5e2){_0x1c83e8=_0x1c83e8-0x0;var _0x59b014=_0x592d[_0x1c83e8];return _0x59b014;};'use strict';var moment=require(_0xd592('0x0'));var util=require(_0xd592('0x1'));var path=require(_0xd592('0x2'));var fs=require('fs');var _=require(_0xd592('0x3'));var squel=require(_0xd592('0x4'));var jayson=require('jayson/promise');var Redis=require('ioredis');var authService=require(_0xd592('0x5'));var qs=require(_0xd592('0x6'));var logger=require('../../config/logger')(_0xd592('0x7'));var utils=require(_0xd592('0x8'));var config=require(_0xd592('0x9'));var licenseUtil=require(_0xd592('0xa'));var APIBadRequestError=require(_0xd592('0xb'))[_0xd592('0xc')];var APINotFoundError=require(_0xd592('0xb'))['APINotFoundError'];var APIHandleError=require(_0xd592('0xb'))['handleError'];var db=require('../../mysqldb')['db'];var socket=require(_0xd592('0xd'))(new Redis(config[_0xd592('0xe')]));require(_0xd592('0xf'))['register'](socket);config[_0xd592('0xe')]=_[_0xd592('0x10')](config[_0xd592('0xe')],{'host':_0xd592('0x11'),'port':0x18eb});var amiClient=jayson['client'][_0xd592('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x13ed3a,_0x3c4d25,_0x419ac4,_0x3e5ebc){return new Promise(function(_0x1682cf,_0x1de86d){var _0x48cdbe=_0x3e5ebc||amiClient;return _0x48cdbe[_0xd592('0x13')](_0x13ed3a,_0x419ac4)[_0xd592('0x14')](function(_0x1d8896){logger[_0xd592('0x15')](_0xd592('0x16'),_0x3c4d25,_0xd592('0x17'));logger[_0xd592('0x18')](_0xd592('0x19'),_0x3c4d25,_0xd592('0x17'),JSON[_0xd592('0x1a')](_0x1d8896));if(_0x1d8896[_0xd592('0x1b')]){if(_0x1d8896[_0xd592('0x1b')][_0xd592('0x1c')]===0x1f4){logger['error'](_0xd592('0x16'),_0x3c4d25,_0x1d8896[_0xd592('0x1b')][_0xd592('0x1d')]);return _0x1de86d(_0x1d8896[_0xd592('0x1b')][_0xd592('0x1d')]);}logger['error'](_0xd592('0x16'),_0x3c4d25,_0x1d8896[_0xd592('0x1b')][_0xd592('0x1d')]);return _0x1682cf(_0x1d8896['error'][_0xd592('0x1d')]);}else{logger[_0xd592('0x15')](_0xd592('0x16'),_0x3c4d25,_0xd592('0x17'));_0x1682cf(_0x1d8896[_0xd592('0x1e')][_0xd592('0x1d')]);}})[_0xd592('0x1f')](function(_0x39f5e2){logger[_0xd592('0x1b')](_0xd592('0x16'),_0x3c4d25,_0x39f5e2);_0x1de86d(_0x39f5e2);});});}function respondWithStatusCode(_0x45e654,_0xe7aac9){_0xe7aac9=_0xe7aac9||0xcc;return function(_0x3b2019){if(_0x3b2019){return _0x45e654[_0xd592('0x20')](_0xe7aac9);}return _0x45e654['status'](_0xe7aac9)[_0xd592('0x21')]();};}function respondWithResult(_0x4253ed,_0xe8011c){_0xe8011c=_0xe8011c||0xc8;return function(_0x5c37e3){if(_0x5c37e3){return _0x4253ed[_0xd592('0x22')](_0xe8011c)[_0xd592('0x23')](_0x5c37e3);}};}function respondWithFilteredResult(_0x23b3b8,_0xf80734){return function(_0x5db66f){if(_0x5db66f){var _0x5ec52e=typeof _0xf80734[_0xd592('0x24')]===_0xd592('0x25')&&typeof _0xf80734[_0xd592('0x26')]===_0xd592('0x25');var _0xd34d86=_0x5db66f[_0xd592('0x27')];var _0x489f09=_0x5ec52e?0x0:_0xf80734['offset'];var _0x223419=_0x5ec52e?_0x5db66f['count']:_0xf80734[_0xd592('0x24')]+_0xf80734[_0xd592('0x26')];var _0x32c85f;if(_0x223419>=_0xd34d86){_0x223419=_0xd34d86;_0x32c85f=0xc8;}else{_0x32c85f=0xce;}_0x23b3b8['status'](_0x32c85f);return _0x23b3b8[_0xd592('0x28')]('Content-Range',_0x489f09+'-'+_0x223419+'/'+_0xd34d86)[_0xd592('0x23')](_0x5db66f);}return null;};}function saveUpdates(_0x46ad5f){return function(_0x11ad33){if(_0x11ad33){return _0x11ad33[_0xd592('0x29')](_0x46ad5f)[_0xd592('0x14')](function(_0x3d1307){socket[_0xd592('0x2a')](_0xd592('0x2b')+_0x3d1307['id'],{});return _0x3d1307;});}return null;};}function removeEntity(_0x54a533){return function(_0x4892a6){if(_0x4892a6){return _0x4892a6['destroy']()[_0xd592('0x14')](function(){var _0x26b72a=_0x4892a6[_0xd592('0x2c')]({'plain':!![]});if(_0x26b72a['role']===_0xd592('0x2d'))return;var _0x485491=[{'name':_0xd592('0x2e'),'value':'user','ignore':!![]},{'name':'Agents','value':_0xd592('0x2f'),'ignore':![]},{'name':_0xd592('0x30'),'value':_0xd592('0x31'),'ignore':![]}];var _0x589149=_(_0x485491)[_0xd592('0x32')](_0xd592('0x33'))[_0xd592('0x34')](_0xd592('0x35'))['value']();if(_[_0xd592('0x36')](_0x589149,_0x26b72a['role'])){return;}var _0x2c1068=_[_0xd592('0x37')](_0x485491,['value',_0x26b72a['role']])[_0xd592('0x38')];return db[_0xd592('0x39')][_0xd592('0x3a')]({'where':{'type':_0x2c1068,'resourceId':_0x26b72a['id']}})['then'](function(){return _0x4892a6;});})[_0xd592('0x14')](function(){_0x54a533[_0xd592('0x22')](0xcc)[_0xd592('0x21')]();});}};}function handleEntityNotFound(_0x27998e){return function(_0x500fed){if(!_0x500fed){_0x27998e[_0xd592('0x20')](0x194);}return _0x500fed;};}function handleError(_0x563033,_0x1029a9){_0x1029a9=_0x1029a9||0x1f4;return function(_0x1b2380){logger[_0xd592('0x1b')](_0x1b2380[_0xd592('0x3b')]);if(_0x1b2380[_0xd592('0x38')]){delete _0x1b2380[_0xd592('0x38')];}_0x563033[_0xd592('0x22')](_0x1029a9)[_0xd592('0x3c')](_0x1b2380);};}exports[_0xd592('0x3d')]=function(_0x36c3ca,_0x23a0f4){var _0x264d1b={},_0x5a24c0={'count':0x0,'rows':[]};var _0x418d91=_(db[_0xd592('0x3e')][_0xd592('0x3f')])[_0xd592('0x34')](function(_0x702968){return{'name':_0x702968[_0xd592('0x40')],'type':_0x702968[_0xd592('0x41')][_0xd592('0x42')]};})[_0xd592('0x32')](function(_0x1707f6){return!_[_0xd592('0x36')]([_0xd592('0x43'),_0xd592('0x44')],_0x1707f6[_0xd592('0x38')]);})[_0xd592('0x35')]();_0x264d1b=qs[_0xd592('0x45')](_0x418d91,_0x36c3ca);var _0x560811={'where':_0x264d1b[_0xd592('0x46')]};return db[_0xd592('0x3e')][_0xd592('0x27')](_0x560811)[_0xd592('0x14')](function(_0x24a05c){_0x5a24c0[_0xd592('0x27')]=_0x24a05c;if(_0x36c3ca[_0xd592('0x47')][_0xd592('0x48')]){_0x264d1b['include']=[{'all':!![]}];}if(_0x36c3ca[_0xd592('0x47')][_0xd592('0x49')]==='true'){_0x264d1b[_0xd592('0x4a')]=[{'model':db[_0xd592('0x4b')],'as':_0xd592('0x49')}];}if(!_['includes'](_0x264d1b['attributes'],'id')){_0x264d1b['attributes'][_0xd592('0x4c')]('id');}return db[_0xd592('0x3e')]['findAll'](_0x264d1b);})[_0xd592('0x14')](function(_0x2ab025){_0x5a24c0['rows']=_0x2ab025;if(_0x36c3ca[_0xd592('0x47')][_0xd592('0x4d')]==='true'){var _0x112576=[];for(var _0x16d958=0x0;_0x16d958<_0x5a24c0[_0xd592('0x4e')][_0xd592('0x4f')];_0x16d958++){_0x112576[_0xd592('0x4c')](get_open_tabs('chat',_0x5a24c0[_0xd592('0x4e')][_0x16d958][_0xd592('0x50')]));_0x112576['push'](get_open_tabs(_0xd592('0x51'),_0x5a24c0[_0xd592('0x4e')][_0x16d958]['dataValues']));_0x112576['push'](get_open_tabs('fax',_0x5a24c0[_0xd592('0x4e')][_0x16d958][_0xd592('0x50')]));_0x112576['push'](get_open_tabs(_0xd592('0x52'),_0x5a24c0[_0xd592('0x4e')][_0x16d958][_0xd592('0x50')]));_0x112576['push'](get_open_tabs(_0xd592('0x53'),_0x5a24c0['rows'][_0x16d958]['dataValues']));_0x112576['push'](get_open_tabs(_0xd592('0x54'),_0x5a24c0[_0xd592('0x4e')][_0x16d958]['dataValues']));}return Promise[_0xd592('0x55')](_0x112576)['then'](function(){return _0x5a24c0;});}else{return _0x5a24c0;}})['then'](respondWithFilteredResult(_0x23a0f4,_0x264d1b))[_0xd592('0x1f')](handleError(_0x23a0f4,null));};exports[_0xd592('0x56')]=function(_0x46855b,_0x2f31b7){var _0x626cd1={'raw':![],'where':{'id':_0x46855b[_0xd592('0x57')]['id']}},_0x54d071={};_0x54d071[_0xd592('0x58')]=_[_0xd592('0x59')](_[_0xd592('0x5a')](db[_0xd592('0x3e')][_0xd592('0x3f')]),[_0xd592('0x43'),_0xd592('0x44')]);_0x54d071[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x46855b['query']);_0x54d071[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x54d071[_0xd592('0x58')],_0x54d071[_0xd592('0x47')]);_0x626cd1[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x54d071[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x46855b[_0xd592('0x47')][_0xd592('0x5e')]));_0x626cd1[_0xd592('0x5d')]=_0x626cd1[_0xd592('0x5d')]['length']?_0x626cd1[_0xd592('0x5d')]:_0x54d071[_0xd592('0x58')];if(_0x46855b['query'][_0xd592('0x48')]){_0x626cd1[_0xd592('0x4a')]=[{'all':!![]}];}if(_0x46855b[_0xd592('0x47')][_0xd592('0x49')]===_0xd592('0x5f')){_0x626cd1[_0xd592('0x4a')]=[{'model':db[_0xd592('0x4b')],'as':_0xd592('0x49')}];}_0x626cd1=_[_0xd592('0x60')]({},_0x626cd1,_0x46855b[_0xd592('0x61')]);if(!_[_0xd592('0x36')](_0x626cd1[_0xd592('0x5d')],'id')){_0x626cd1['attributes']['push']('id');}return db[_0xd592('0x3e')][_0xd592('0x37')](_0x626cd1)[_0xd592('0x14')](handleEntityNotFound(_0x2f31b7,null))[_0xd592('0x14')](function(_0x233356){var _0x5f04be=[];values=_0x233356;if(_0x46855b[_0xd592('0x47')][_0xd592('0x4d')]===_0xd592('0x5f')){_0x5f04be['push'](get_open_tabs(_0xd592('0x62'),_0x233356[_0xd592('0x50')]));_0x5f04be[_0xd592('0x4c')](get_open_tabs('sms',_0x233356[_0xd592('0x50')]));_0x5f04be[_0xd592('0x4c')](get_open_tabs(_0xd592('0x53'),_0x233356[_0xd592('0x50')]));_0x5f04be[_0xd592('0x4c')](get_open_tabs(_0xd592('0x54'),_0x233356[_0xd592('0x50')]));_0x5f04be[_0xd592('0x4c')](get_open_tabs(_0xd592('0x63'),_0x233356[_0xd592('0x50')]));_0x5f04be[_0xd592('0x4c')](get_open_tabs(_0xd592('0x52'),_0x233356[_0xd592('0x50')]));return Promise['all'](_0x5f04be);}else{return values;}})[_0xd592('0x14')](function(){return values;})['then'](respondWithResult(_0x2f31b7,null))[_0xd592('0x1f')](handleError(_0x2f31b7,null));};exports[_0xd592('0x29')]=function(_0x4c124c,_0x13e396){if(_0x4c124c[_0xd592('0x64')]['id']){delete _0x4c124c[_0xd592('0x64')]['id'];}delete _0x4c124c[_0xd592('0x64')]['role'];return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x4c124c['params']['id']}})['then'](handleEntityNotFound(_0x13e396,null))[_0xd592('0x14')](saveUpdates(_0x4c124c[_0xd592('0x64')],null))['then'](respondWithResult(_0x13e396,null))[_0xd592('0x1f')](handleError(_0x13e396,null));};exports['describe']=function(_0x37fd37,_0x41ecba){return db[_0xd592('0x3e')]['describe']()[_0xd592('0x14')](respondWithResult(_0x41ecba,null))[_0xd592('0x1f')](handleError(_0x41ecba,null));};exports[_0xd592('0x65')]=function(_0x3c8d19,_0x3d29a9){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x3c8d19[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x3d29a9,null))[_0xd592('0x14')](function(_0x37c7a8){if(_0x37c7a8){return _0x37c7a8[_0xd592('0x65')](_0x3c8d19[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x3c8d19[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{});}})[_0xd592('0x14')](respondWithResult(_0x3d29a9,null))['catch'](handleError(_0x3d29a9,null));};function validateUser(_0x516906){return new Promise(function(_0x4f6932,_0x21d520){if(_0x516906[_0xd592('0x68')])return _0x4f6932(_0x516906);return db['Setting'][_0xd592('0x69')](0x1)['then'](function(_0x31ca13){if(_0x31ca13[_0xd592('0x6a')])authService[_0xd592('0x6b')](_0x516906[_0xd592('0x43')]);db['User'][_0xd592('0x6c')](_0xd592('0x68'))['then'](function(_0x9f23b8){if(_['isNil'](_0x9f23b8)){_0x516906['internal']=_0x31ca13[_0xd592('0x6d')]||0x1;return;}if(_['isNil'](_0x31ca13[_0xd592('0x6d')])||_0x31ca13[_0xd592('0x6d')]===_0x9f23b8){_0x516906[_0xd592('0x68')]=_0x9f23b8+0x1;return;}if(_0x31ca13['min_internal']>_0x9f23b8){_0x516906['internal']=_0x31ca13['min_internal'];return;}return db[_0xd592('0x6e')]['query'](_0xd592('0x6f'),{'type':db[_0xd592('0x6e')][_0xd592('0x70')][_0xd592('0x71')]})[_0xd592('0x14')](function(_0x21d006){if(_0x21d006&&_0x21d006[_0xd592('0x4f')]){for(var _0x4fffea=0x0,_0x45eeaa=_0x21d006[_0xd592('0x4f')];_0x4fffea<_0x45eeaa&&_['isNil'](_0x516906[_0xd592('0x68')]);_0x4fffea++){if(_0x31ca13[_0xd592('0x6d')]<=_0x21d006[_0x4fffea][_0xd592('0x72')]){_0x516906[_0xd592('0x68')]=_0x21d006[_0x4fffea]['from'];}else if(_0x31ca13['min_internal']>_0x21d006[_0x4fffea]['from']&&_0x31ca13['min_internal']<=_0x21d006[_0x4fffea]['to']){_0x516906[_0xd592('0x68')]=_0x31ca13[_0xd592('0x6d')];}}}if(_[_0xd592('0x73')](_0x516906[_0xd592('0x68')])){_0x516906[_0xd592('0x68')]=_0x9f23b8+0x1;}return _0x4f6932(_0x516906);});});})[_0xd592('0x1f')](function(_0x3efe39){_0x21d520(_0x3efe39);});});}function updateUser(_0x222175){return new Promise(function(_0x1552f4,_0x1c23a2){try{if(_0x222175[_0xd592('0x74')]){_0x222175[_0xd592('0x75')]=_0x222175['internal'];_0x222175[_0xd592('0x76')]={'mailbox':_0x222175[_0xd592('0x68')],'password':_0x222175['password'],'fullname':_0x222175[_0xd592('0x77')],'email':_0x222175[_0xd592('0x78')]};}if(_0x222175[_0xd592('0x79')]==='agent'){if(!_0x222175['permissions'])_0x222175[_0xd592('0x7a')]=['101',_0xd592('0x7b'),_0xd592('0x7c'),_0xd592('0x7d'),_0xd592('0x7e'),_0xd592('0x7f'),_0xd592('0x80'),'106',_0xd592('0x81'),_0xd592('0x82'),'109',_0xd592('0x83'),_0xd592('0x84'),_0xd592('0x85'),'115'];}_0x1552f4(_0x222175);}catch(_0x76ad5b){_0x1c23a2(_0x76ad5b);}});}exports[_0xd592('0x86')]=function(_0x339d14,_0x5ec4fc){if(_0x339d14['user'][_0xd592('0x79')]==='agent')throw new Error('Unauthorized');if(_0x339d14[_0xd592('0x64')][_0xd592('0x79')]===_0xd592('0x87')&&_0x339d14['user']['role']!==_0xd592('0x2d')){throw new Error(_0xd592('0x88'));}if(_0x339d14[_0xd592('0x64')][_0xd592('0x79')]==='admin'&&_0x339d14[_0xd592('0x87')][_0xd592('0x79')]!==_0xd592('0x2d')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xd592('0x89')]([_0x339d14[_0xd592('0x64')]])['then'](function(){return validateUser(_0x339d14[_0xd592('0x64')]);})['then'](function(_0xbafa14){return updateUser(_0xbafa14)[_0xd592('0x14')](function(_0x1791e2){if(_0x1791e2[_0xd592('0x79')]===_0xd592('0x2d')){_0x1791e2[_0xd592('0x8a')]=_0x339d14['user']['settingsEnabled'];delete _0x1791e2[_0xd592('0x8b')];}return _0x1791e2;});})['then'](function(_0x1daf85){return db[_0xd592('0x3e')][_0xd592('0x86')](_0x1daf85,{'include':[{'model':db[_0xd592('0x76')],'as':_0xd592('0x76')}]});})['then'](function(_0x2e76da){if(_0x339d14[_0xd592('0x64')]['role']===_0xd592('0x87'))return _0x2e76da;if(_0x339d14[_0xd592('0x87')]['role']!==_0xd592('0x87'))return _0x2e76da;return db[_0xd592('0x8c')]['find']({'where':{'name':_0x2e76da['role']===_0xd592('0x2f')?_0xd592('0x8d'):'Telephones','userProfileId':_0x339d14['user'][_0xd592('0x8b')]},'raw':!![]})['then'](function(_0x24ab28){if(!_0x24ab28||_0x24ab28['autoAssociation']!=0x0)return _0x2e76da;return db[_0xd592('0x39')][_0xd592('0x86')]({'name':_0x2e76da[_0xd592('0x38')],'resourceId':_0x2e76da['id'],'type':_0x24ab28['name'],'sectionId':_0x24ab28['id']},{})['then'](function(){return _0x2e76da;});})[_0xd592('0x1f')](function(_0x5257c8){logger[_0xd592('0x1b')](_0xd592('0x8e'),_0x5257c8);throw _0x5257c8;});})['then'](respondWithResult(_0x5ec4fc,0xc9))[_0xd592('0x1f')](handleError(_0x5ec4fc,null));};exports['bulkCreate']=function(_0x43194c,_0xcd11ee){var _0x5e7121=_0x43194c[_0xd592('0x64')];var _0x544a26=[];if(_0x43194c[_0xd592('0x87')][_0xd592('0x79')]===_0xd592('0x2f'))throw new Error(_0xd592('0x8f'));if(_['some'](_0x5e7121,[_0xd592('0x79'),_0xd592('0x87')])&&_0x43194c[_0xd592('0x87')][_0xd592('0x79')]!==_0xd592('0x2d')){throw new Error(_0xd592('0x88'));}if(_[_0xd592('0x90')](_0x5e7121,[_0xd592('0x79'),_0xd592('0x2d')])&&_0x43194c['user'][_0xd592('0x79')]!==_0xd592('0x2d')){throw new Error(_0xd592('0x91'));}return licenseUtil[_0xd592('0x89')](_0x5e7121)[_0xd592('0x14')](function(){return validateUser(_0x5e7121[0x0]);})[_0xd592('0x14')](function(){for(var _0x30acf2=0x1;_0x30acf2<_0x5e7121[_0xd592('0x4f')];_0x30acf2++){var _0x82542d=_0x5e7121[_0x30acf2-0x1][_0xd592('0x68')];if(!_0x5e7121[_0x30acf2][_0xd592('0x68')])_0x5e7121[_0x30acf2][_0xd592('0x68')]=_0x82542d+0x1;_0x544a26['push'](validateUser(_0x5e7121[_0x30acf2]));}return Promise['all'](_0x544a26);})['then'](function(){_0x544a26=[];for(var _0x13fac4=0x0;_0x13fac4<_0x5e7121[_0xd592('0x4f')];_0x13fac4++){_0x544a26[_0xd592('0x4c')](updateUser(_0x5e7121[_0x13fac4]));}return Promise[_0xd592('0x55')](_0x544a26);})[_0xd592('0x14')](function(){_0x544a26=_0x5e7121['map'](function(_0x513ebe){return db[_0xd592('0x3e')][_0xd592('0x86')](_0x513ebe,{'include':[{'model':db[_0xd592('0x76')],'as':_0xd592('0x76')}]})[_0xd592('0x14')](function(_0xf85451){_0x513ebe['id']=_0xf85451['id'];return _0x513ebe;});});return Promise[_0xd592('0x55')](_0x544a26);})[_0xd592('0x14')](function(_0x20c73b){if(_0x43194c[_0xd592('0x64')][_0xd592('0x79')]===_0xd592('0x87'))return _0x20c73b;if(_0x43194c[_0xd592('0x87')]['role']!=='user')return _0x20c73b;var _0x430ea0=_[_0xd592('0x90')](_0x20c73b,function(_0x55a224){return _0x55a224[_0xd592('0x79')]==='agent'||_0x55a224['role']===_0xd592('0x31');});if(!_0x430ea0)return _0x20c73b;return db[_0xd592('0x8c')][_0xd592('0x92')]({'where':{'name':{'$or':['Agents',_0xd592('0x30')]},'userProfileId':_0x43194c['user'][_0xd592('0x8b')]},'raw':!![]})['then'](function(_0x37aab5){if(_[_0xd592('0x93')](_0x37aab5)||!_[_0xd592('0x90')](_0x37aab5,[_0xd592('0x94'),0x0]))return _0x20c73b;_0x544a26=[];var _0x366572=_(_0x37aab5)[_0xd592('0x34')](function(_0x2af236){if(_0x2af236['autoAssociation']===0x1)return;return _0x2af236[_0xd592('0x38')]===_0xd592('0x8d')?_0xd592('0x2f'):'telephone';})[_0xd592('0x95')]()[_0xd592('0x35')]();for(var _0x2d1bda=0x0;_0x2d1bda<_0x20c73b[_0xd592('0x4f')];_0x2d1bda++){if(!_[_0xd592('0x36')](_0x366572,_0x20c73b[_0x2d1bda][_0xd592('0x79')]))return;var _0x491c10=_0x20c73b[_0x2d1bda][_0xd592('0x79')]===_0xd592('0x2f')?'Agents':_0xd592('0x30');_0x544a26[_0xd592('0x4c')](db[_0xd592('0x39')][_0xd592('0x86')]({'name':_0x20c73b[_0x2d1bda][_0xd592('0x38')],'resourceId':_0x20c73b[_0x2d1bda]['id'],'type':_0x491c10,'sectionId':_[_0xd592('0x37')](_0x37aab5,[_0xd592('0x38'),_0x491c10])['id']},{}));}return Promise[_0xd592('0x55')](_0x544a26);});})[_0xd592('0x14')](respondWithResult(_0xcd11ee,0xc9))[_0xd592('0x1f')](handleError(_0xcd11ee,null));};exports[_0xd592('0x96')]=function(_0x20aa81,_0x27cd5c){if(_0x20aa81['body']['id']){delete _0x20aa81[_0xd592('0x64')]['id'];}return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x20aa81['params']['id']}})['then'](function(_0x49df41){if(!_0x49df41)return null;if(_0x49df41['id']===_0x20aa81[_0xd592('0x87')]['id']){if(!_0x20aa81[_0xd592('0x64')][_0xd592('0x97')]||!_0x20aa81[_0xd592('0x64')][_0xd592('0x98')]){throw new db['Sequelize'][(_0xd592('0x99'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x49df41['authenticate'](_0x20aa81[_0xd592('0x64')][_0xd592('0x97')])){throw new db[(_0xd592('0x9a'))]['ValidationError'](_0xd592('0x9b'));}if(_0x20aa81[_0xd592('0x64')]['oldPassword']===_0x20aa81[_0xd592('0x64')][_0xd592('0x98')]){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0x9c'));}}else if(_0x20aa81[_0xd592('0x87')][_0xd592('0x79')]===_0xd592('0x2d')){if(!_0x20aa81[_0xd592('0x64')]['newPassword']){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0x9d'));}}else if(_0x20aa81[_0xd592('0x87')][_0xd592('0x79')]==='user'){if(!_0x20aa81[_0xd592('0x64')][_0xd592('0x98')]){throw new db['Sequelize']['ValidationError'](_0xd592('0x9d'));}if(_0x49df41[_0xd592('0x79')]!==_0xd592('0x2f')){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))]('Unauthorized');}}else{throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0x8f'));}return _0x49df41;})[_0xd592('0x14')](handleEntityNotFound(_0x27cd5c,null))[_0xd592('0x14')](function(_0x374d68){return db[_0xd592('0x9e')][_0xd592('0x9f')]({'attributes':['id',_0xd592('0x6a'),_0xd592('0xa0'),'passwordHistoryLimit']})[_0xd592('0x14')](function(_0x3eb601){if(_0x3eb601[_0xd592('0x6a')])authService[_0xd592('0x6b')](_0x20aa81[_0xd592('0x64')]['newPassword']);if(!_0x3eb601[_0xd592('0xa0')]||!_0x374d68[_0xd592('0xa1')])return _0x374d68;authService[_0xd592('0xa2')](_0x20aa81['body']['newPassword'],_0x374d68[_0xd592('0xa1')],_0x3eb601[_0xd592('0xa3')]);return _0x374d68;})['then'](saveUpdates({'password':_0x20aa81[_0xd592('0x64')][_0xd592('0x98')],'passwordResetAt':_0x20aa81[_0xd592('0x87')]['id']==_0x20aa81[_0xd592('0x57')]['id']?moment():null,'previousPasswords':authService[_0xd592('0xa4')](_0x20aa81[_0xd592('0x64')][_0xd592('0x98')],_0x374d68[_0xd592('0xa1')])},null));})[_0xd592('0x14')](respondWithResult(_0x27cd5c,null))['catch'](handleError(_0x27cd5c,null));};exports[_0xd592('0xa5')]=function(_0x9043f1,_0x3e67b3){var _0x19cc37=_0x9043f1[_0xd592('0x64')][_0xd592('0xa6')];return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x9043f1['params']['id']},'attributes':['id','name','role',_0xd592('0xa7'),_0xd592('0xa8'),_0xd592('0xa9'),_0xd592('0xaa')]})[_0xd592('0x14')](handleEntityNotFound(_0x3e67b3,null))['then'](function(_0x15dd54){if(_0x15dd54){if(!utils[_0xd592('0xab')](_0x19cc37)){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0xac'));}return _0x15dd54[_0xd592('0xad')+_[_0xd592('0xae')](_0x19cc37[_0xd592('0xaf')]())+_0xd592('0xb0')](_0x9043f1['body']['ids'],{'penalty':_0x9043f1[_0xd592('0x64')]['penalty']||0x0})[_0xd592('0xb1')](function(_0x3ddd9a){for(var _0x3d0501=0x0;_0x3d0501<_0x9043f1[_0xd592('0x64')][_0xd592('0x66')][_0xd592('0x4f')];_0x3d0501+=0x1){var _0x440c78={'UserId':Number(_0x9043f1[_0xd592('0x57')]['id'])};_0x440c78[_[_0xd592('0xae')](_0x19cc37[_0xd592('0xaf')]())+_0xd592('0xb2')]=Number(_0x9043f1[_0xd592('0x64')][_0xd592('0x66')][_0x3d0501]);socket[_0xd592('0x2a')](_0xd592('0x87')+_[_0xd592('0xae')](_0x19cc37['toLowerCase']())+'Queue:save',_0x440c78);}return _0x3ddd9a;})['then'](function(){if(_0x19cc37===_0xd592('0xb3')){return db[_0xd592('0xb4')][_0xd592('0x92')]({'where':{'id':_0x9043f1[_0xd592('0x64')][_0xd592('0x66')]||[]},'raw':!![],'attributes':['id',_0xd592('0x38')]});}})[_0xd592('0x14')](function(_0x31d914){var _0x16a958=_0x15dd54[_0xd592('0x2c')]({'plain':!![]});var _0xffae43=[];if(_0x19cc37===_0xd592('0xb3')&&_0x16a958['role']===_0xd592('0x2f')&&_0x16a958[_0xd592('0xa7')]){for(let _0x340642=0x0;_0x340642<_0x31d914[_0xd592('0x4f')];_0x340642+=0x1){_0xffae43[_0xd592('0x4c')]({'membername':_0x16a958[_0xd592('0x38')],'UserId':_0x16a958['id'],'queue_name':_0x31d914[_0x340642]['name'],'VoiceQueueId':_0x31d914[_0x340642]['id'],'interface':_[_0xd592('0x73')](_0x16a958['interface'])?util[_0xd592('0xb5')](_0xd592('0xb6'),_0x16a958[_0xd592('0x38')]):_0x16a958[_0xd592('0xaa')],'paused':_0x16a958[_0xd592('0xa9')]||![],'penalty':_0x9043f1[_0xd592('0x64')]['penalty']||0x0});}return Promise[_0xd592('0x55')](_0xffae43['map'](function(_0x331b02){return db['UserVoiceQueueRt']['upsert'](_0x331b02);}));}return _0x15dd54;});}})['then'](respondWithStatusCode(_0x3e67b3,null))[_0xd592('0x1f')](handleError(_0x3e67b3,null));};exports['removeQueues']=function(_0x40cc5e,_0x58df9e){var _0x2c9ee1,_0x960b72;return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x40cc5e[_0xd592('0x57')]['id']},'attributes':['id','name',_0xd592('0x79')]})['then'](handleEntityNotFound(_0x58df9e,null))[_0xd592('0x14')](function(_0x2e3fd8){if(_0x2e3fd8){_0x2c9ee1=_0x2e3fd8;if(!_0x40cc5e[_0xd592('0x47')][_0xd592('0xa6')]||!utils[_0xd592('0xab')](_0x40cc5e[_0xd592('0x47')][_0xd592('0xa6')])){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0xac'));}return _0x2e3fd8[_0xd592('0xb7')+_[_0xd592('0xae')](_0x40cc5e[_0xd592('0x47')][_0xd592('0xa6')]['toLowerCase']())+_0xd592('0xb0')](_0x40cc5e[_0xd592('0x47')][_0xd592('0x66')]);}})[_0xd592('0x14')](function(_0x5e548a){if(_[_0xd592('0xb8')](_0x40cc5e['query'][_0xd592('0x66')])){for(var _0x4464d8=0x0;_0x4464d8<_0x40cc5e[_0xd592('0x47')][_0xd592('0x66')][_0xd592('0x4f')];_0x4464d8+=0x1){_0x960b72={'UserId':Number(_0x40cc5e[_0xd592('0x57')]['id'])};_0x960b72[_['capitalize'](_0x40cc5e[_0xd592('0x47')][_0xd592('0xa6')][_0xd592('0xaf')]())+'QueueId']=Number(_0x40cc5e[_0xd592('0x47')][_0xd592('0x66')][_0x4464d8]);socket[_0xd592('0x2a')](_0xd592('0x87')+_['capitalize'](_0x40cc5e[_0xd592('0x47')][_0xd592('0xa6')][_0xd592('0xaf')]())+'Queue:remove',_0x960b72);}}else{_0x960b72={'UserId':Number(_0x40cc5e[_0xd592('0x57')]['id'])};_0x960b72[_['capitalize'](_0x40cc5e[_0xd592('0x47')]['channel']['toLowerCase']())+_0xd592('0xb2')]=Number(_0x40cc5e[_0xd592('0x47')]['ids']);socket[_0xd592('0x2a')](_0xd592('0x87')+_[_0xd592('0xae')](_0x40cc5e['query'][_0xd592('0xa6')]['toLowerCase']())+_0xd592('0xb9'),_0x960b72);}return _0x5e548a;})[_0xd592('0x14')](function(){if(_0x40cc5e['query'][_0xd592('0xa6')]===_0xd592('0xb3')){return db[_0xd592('0xba')]['destroy']({'where':{'UserId':_0x40cc5e[_0xd592('0x57')]['id'],'VoiceQueueId':_0x40cc5e[_0xd592('0x47')][_0xd592('0x66')]},'individualHooks':!![]})[_0xd592('0x14')](function(){return _0x2c9ee1;});}return _0x2c9ee1;})[_0xd592('0x14')](respondWithStatusCode(_0x58df9e,null))[_0xd592('0x1f')](handleError(_0x58df9e,null));};exports['addAvatar']=function(_0x54a6bc,_0x1e1f43){_0x54a6bc['body']['userpic']=_0x54a6bc[_0xd592('0xbb')][_0xd592('0xbc')];return db[_0xd592('0x3e')]['find']({'where':{'id':_0x54a6bc[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1e1f43,null))[_0xd592('0x14')](saveUpdates(_0x54a6bc[_0xd592('0x64')],null))[_0xd592('0x14')](respondWithResult(_0x1e1f43,null))['catch'](handleError(_0x1e1f43,null));};exports[_0xd592('0xbd')]=function(_0x48ebf8,_0x6a30ff){var _0x1e8a01=path[_0xd592('0xbe')](config[_0xd592('0xbf')],_0xd592('0xc0'));return db['User']['find']({'where':{'id':_0x48ebf8[_0xd592('0x57')]['id']},'attributes':['id',_0xd592('0xc1')],'raw':!![]})[_0xd592('0x14')](handleEntityNotFound(_0x6a30ff,null))[_0xd592('0x14')](function(_0x4647f7){if(_0x4647f7){if(_[_0xd592('0x73')](_0x4647f7['userpic'])){return _0x6a30ff[_0xd592('0xc2')](_0x1e8a01);}else{if(!fs[_0xd592('0xc3')](path[_0xd592('0xbe')](config[_0xd592('0xbf')],'server/files/images/',_0x4647f7[_0xd592('0xc1')]))){return _0x6a30ff[_0xd592('0xc2')](_0x1e8a01);}return _0x6a30ff[_0xd592('0xc2')](path[_0xd592('0xbe')](config[_0xd592('0xbf')],_0xd592('0xc4'),_0x4647f7[_0xd592('0xc1')]));}}})['catch'](handleError(_0x6a30ff,null));};exports[_0xd592('0xc5')]=function(_0x340718,_0x474318){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x340718[_0xd592('0x57')]['id']},'attributes':['id']})[_0xd592('0x14')](handleEntityNotFound(_0x474318,null))[_0xd592('0x14')](function(_0x44110d){var _0x4f8afa=[];values=_0x44110d[_0xd592('0x50')];_0x4f8afa[_0xd592('0x4c')](get_open_tabs(_0xd592('0x62'),_0x44110d['dataValues']));_0x4f8afa[_0xd592('0x4c')](get_open_tabs(_0xd592('0x51'),_0x44110d[_0xd592('0x50')]));_0x4f8afa['push'](get_open_tabs(_0xd592('0x53'),_0x44110d[_0xd592('0x50')]));_0x4f8afa[_0xd592('0x4c')](get_open_tabs(_0xd592('0x54'),_0x44110d[_0xd592('0x50')]));_0x4f8afa[_0xd592('0x4c')](get_open_tabs('fax',_0x44110d[_0xd592('0x50')]));_0x4f8afa[_0xd592('0x4c')](get_open_tabs('mail',_0x44110d[_0xd592('0x50')]));return Promise['all'](_0x4f8afa);})[_0xd592('0x14')](function(_0x580dae){if(_0x580dae){var _0x3cfdbc=_[_0xd592('0x34')](values[_0xd592('0xc6')],function(_0x1d3f34){return{'channel':_0xd592('0xc7'),'id':_0x1d3f34['id'],'createdAt':_0x1d3f34[_0xd592('0xc8')]};});var _0x48f301=_['map'](values[_0xd592('0xc9')],function(_0x326555){return{'channel':_0xd592('0xca'),'id':_0x326555['id'],'createdAt':_0x326555['createdAt']};});var _0xb02a8a=_[_0xd592('0x34')](values[_0xd592('0xcb')],function(_0x37eca0){return{'channel':_0xd592('0xcc'),'id':_0x37eca0['id'],'createdAt':_0x37eca0[_0xd592('0xc8')]};});var _0x13af88=_[_0xd592('0x34')](values[_0xd592('0xcd')],function(_0x3a1843){return{'channel':_0xd592('0xce'),'id':_0x3a1843['id'],'createdAt':_0x3a1843[_0xd592('0xc8')]};});var _0x14d458=_[_0xd592('0x34')](values[_0xd592('0xcf')],function(_0xab0536){return{'channel':_0xd592('0xd0'),'id':_0xab0536['id'],'createdAt':_0xab0536[_0xd592('0xc8')]};});var _0x4565e9=_[_0xd592('0x34')](values[_0xd592('0xd1')],function(_0x3081d8){return{'channel':_0xd592('0xd2'),'id':_0x3081d8['id'],'createdAt':_0x3081d8[_0xd592('0xc8')]};});var _0x1b3a77=_[_0xd592('0xd3')](_0x3cfdbc,_0x48f301,_0xb02a8a,_0x13af88,_0x14d458,_0x4565e9);var _0x36d5c0={'count':_0x1b3a77['length'],'rows':_0x1b3a77};return _0x36d5c0;}else return null;})[_0xd592('0x14')](respondWithResult(_0x474318,null))['catch'](handleError(_0x474318,null));};exports[_0xd592('0xd4')]=function(_0xf69a18,_0x1f4031){var _0x4d6ec6={};var _0x1b5721={};var _0x3aefd3;var _0xebf8cc;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0xf69a18[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f4031,null))['then'](function(_0x1e694c){if(_0x1e694c){_0x3aefd3=_0x1e694c;_0x1b5721[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xd5')][_0xd592('0x3f')]);_0x1b5721[_0xd592('0x47')]=_['keys'](_0xf69a18[_0xd592('0x47')]);_0x1b5721[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x1b5721[_0xd592('0x58')],_0x1b5721[_0xd592('0x47')]);_0x4d6ec6['attributes']=_[_0xd592('0x5c')](_0x1b5721['model'],qs[_0xd592('0x5e')](_0xf69a18[_0xd592('0x47')][_0xd592('0x5e')]));_0x4d6ec6[_0xd592('0x5d')]=_0x4d6ec6[_0xd592('0x5d')][_0xd592('0x4f')]?_0x4d6ec6[_0xd592('0x5d')]:_0x1b5721[_0xd592('0x58')];_0x4d6ec6[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0xf69a18[_0xd592('0x47')][_0xd592('0xd7')]);_0x4d6ec6[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0xf69a18['query'],_0x1b5721[_0xd592('0x5b')]));if(_0xf69a18[_0xd592('0x47')][_0xd592('0x32')]){_0x4d6ec6[_0xd592('0x46')]=_[_0xd592('0x60')](_0x4d6ec6[_0xd592('0x46')],{'$or':_['map'](_0x4d6ec6[_0xd592('0x5d')],function(_0xc85196){var _0x4645fd={};_0x4645fd[_0xc85196]={'$like':'%'+_0xf69a18[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x4645fd;})});}_0x4d6ec6=_['merge']({},_0x4d6ec6,_0xf69a18[_0xd592('0x61')]);return _0x3aefd3[_0xd592('0xd4')](_0x4d6ec6);}})[_0xd592('0x14')](function(_0x341f4c){if(_0x341f4c){_0xebf8cc=_0x341f4c[_0xd592('0x4f')];if(_0xf69a18[_0xd592('0x47')][_0xd592('0xd9')]('includeAll')){_0x4d6ec6[_0xd592('0x4a')]=[{'model':db[_0xd592('0xda')],'as':_0xd592('0xdb'),'required':![]},{'model':db['Tag'],'as':_0xd592('0xdc'),'attributes':['id',_0xd592('0x38'),_0xd592('0xdd')],'where':_0xf69a18['query'][_0xd592('0xde')]?{'id':_0xf69a18[_0xd592('0x47')][_0xd592('0xde')]}:undefined,'required':_0xf69a18[_0xd592('0x47')][_0xd592('0xde')]?!![]:![]}];}if(!_0xf69a18[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x4d6ec6[_0xd592('0x26')]=qs[_0xd592('0x26')](_0xf69a18[_0xd592('0x47')][_0xd592('0x26')]);_0x4d6ec6[_0xd592('0x24')]=qs['offset'](_0xf69a18[_0xd592('0x47')][_0xd592('0x24')]);}return _0x3aefd3['getContacts'](_0x4d6ec6);}})[_0xd592('0x14')](function(_0x3db5b4){if(_0x3db5b4){return _0x3db5b4?{'count':_0xebf8cc,'rows':_0x3db5b4}:null;}})[_0xd592('0x14')](respondWithResult(_0x1f4031,null))[_0xd592('0x1f')](handleError(_0x1f4031,null));};exports[_0xd592('0xe0')]=function(_0x9bd37d,_0x279519){var _0x278f94;var _0x3a92b2={};var _0x32b6af;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x9bd37d[_0xd592('0x57')]['id']},'attributes':['id',_0xd592('0x38'),_0xd592('0x79')]})['then'](handleEntityNotFound(_0x279519,null))[_0xd592('0x14')](function(_0x2b38a0){if(!utils['isValidChannel'](_0x9bd37d[_0xd592('0x47')][_0xd592('0xa6')])){throw new db[(_0xd592('0x9a'))][(_0xd592('0x99'))](_0xd592('0xac'));}_0x278f94=_0x2b38a0;var _0x2319e6={};_0x2319e6[_0xd592('0x58')]=_['keys'](db[_['capitalize'](_0x9bd37d[_0xd592('0x47')][_0xd592('0xa6')])+_0xd592('0xe1')][_0xd592('0x3f')]);_0x2319e6['query']=_[_0xd592('0x5a')](_0x9bd37d[_0xd592('0x47')]);_0x2319e6[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x2319e6['model'],_0x2319e6['query']);_0x3a92b2[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x2319e6[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x9bd37d['query'][_0xd592('0x5e')]));_0x3a92b2[_0xd592('0x5d')]=_0x3a92b2[_0xd592('0x5d')][_0xd592('0x4f')]?_0x3a92b2['attributes']:_0x2319e6[_0xd592('0x58')];_0x3a92b2[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x9bd37d[_0xd592('0x47')][_0xd592('0xd7')]);_0x3a92b2[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x9bd37d[_0xd592('0x47')],_0x2319e6[_0xd592('0x5b')]));if(_0x9bd37d[_0xd592('0x47')][_0xd592('0x32')]){_0x3a92b2[_0xd592('0x46')]=_['merge'](_0x3a92b2[_0xd592('0x46')],{'$or':_['map'](_0x3a92b2[_0xd592('0x5d')],function(_0x131340){var _0x40dbb9={};_0x40dbb9[_0x131340]={'$like':'%'+_0x9bd37d[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x40dbb9;})});}_0x3a92b2=_['merge']({},_0x3a92b2,_0x9bd37d[_0xd592('0x61')]);switch(_0x278f94['role']){case _0xd592('0x2d'):return db[_['capitalize'](_0x9bd37d[_0xd592('0x47')]['channel'])+'Queue'][_0xd592('0x92')](_0x3a92b2);case _0xd592('0x87'):case _0xd592('0x2f'):return _0x278f94['get'+_[_0xd592('0xae')](_0x9bd37d[_0xd592('0x47')][_0xd592('0xa6')])+'Queues'](_0x3a92b2);default:throw new db['Sequelize'][(_0xd592('0x99'))](_0xd592('0xe2'));}})[_0xd592('0x14')](function(_0x5e66ef){_0x32b6af=_0x5e66ef[_0xd592('0x4f')];if(!_0x9bd37d['query'][_0xd592('0xd9')](_0xd592('0xdf'))){_0x3a92b2[_0xd592('0x26')]=qs['limit'](_0x9bd37d[_0xd592('0x47')][_0xd592('0x26')]);_0x3a92b2[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x9bd37d[_0xd592('0x47')][_0xd592('0x24')]);}switch(_0x278f94[_0xd592('0x79')]){case _0xd592('0x2d'):return db[_[_0xd592('0xae')](_0x9bd37d[_0xd592('0x47')]['channel'])+_0xd592('0xe1')][_0xd592('0x92')](_0x3a92b2);case _0xd592('0x87'):case _0xd592('0x2f'):return _0x278f94[_0xd592('0x2c')+_[_0xd592('0xae')](_0x9bd37d[_0xd592('0x47')][_0xd592('0xa6')])+_0xd592('0xb0')](_0x3a92b2);}})[_0xd592('0x14')](function(_0x599913){return{'count':_0x32b6af,'rows':_0x599913};})['then'](respondWithResult(_0x279519,null))['catch'](handleError(_0x279519,null));};exports['getVoiceQueuesRt']=function(_0x5a430c,_0x13baaa){var _0x4b3a79={};var _0x5bac51={};var _0x2cf83b;var _0x15ee89;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x5a430c[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x13baaa,null))[_0xd592('0x14')](function(_0x4813ab){if(_0x4813ab){_0x2cf83b=_0x4813ab;_0x5bac51[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xba')][_0xd592('0x3f')]);_0x5bac51[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x5a430c[_0xd592('0x47')]);_0x5bac51[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x5bac51['model'],_0x5bac51[_0xd592('0x47')]);_0x4b3a79['attributes']=_[_0xd592('0x5c')](_0x5bac51[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x5a430c['query'][_0xd592('0x5e')]));_0x4b3a79['attributes']=_0x4b3a79[_0xd592('0x5d')][_0xd592('0x4f')]?_0x4b3a79[_0xd592('0x5d')]:_0x5bac51['model'];_0x4b3a79[_0xd592('0xd6')]=qs['sort'](_0x5a430c['query'][_0xd592('0xd7')]);_0x4b3a79[_0xd592('0x46')]=qs['filters'](_[_0xd592('0xd8')](_0x5a430c[_0xd592('0x47')],_0x5bac51['filters']));if(_0x5a430c['query'][_0xd592('0x32')]){_0x4b3a79['where']=_['merge'](_0x4b3a79[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x4b3a79[_0xd592('0x5d')],function(_0x386c07){var _0x55c910={};_0x55c910[_0x386c07]={'$like':'%'+_0x5a430c['query'][_0xd592('0x32')]+'%'};return _0x55c910;})});}_0x4b3a79=_[_0xd592('0x60')]({},_0x4b3a79,_0x5a430c[_0xd592('0x61')]);return _0x2cf83b[_0xd592('0xe3')](_0x4b3a79);}})[_0xd592('0x14')](function(_0x1b8d6b){if(_0x1b8d6b){_0x15ee89=_0x1b8d6b[_0xd592('0x4f')];if(!_0x5a430c[_0xd592('0x47')][_0xd592('0xd9')]('nolimit')){_0x4b3a79['limit']=qs[_0xd592('0x26')](_0x5a430c['query']['limit']);_0x4b3a79[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x5a430c[_0xd592('0x47')][_0xd592('0x24')]);}return _0x2cf83b[_0xd592('0xe3')](_0x4b3a79);}})[_0xd592('0x14')](function(_0x9d8b2a){if(_0x9d8b2a){return _0x9d8b2a?{'count':_0x15ee89,'rows':_0x9d8b2a}:null;}})[_0xd592('0x14')](respondWithResult(_0x13baaa,null))[_0xd592('0x1f')](handleError(_0x13baaa,null));};exports[_0xd592('0xe4')]=function(_0x321aa6,_0x3d6e8f){var _0x4dc9e7={};var _0x49d012={};var _0x5b5e53;var _0x5b16e7;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x321aa6[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x3d6e8f,null))[_0xd592('0x14')](function(_0x1a4c3c){if(_0x1a4c3c){_0x5b5e53=_0x1a4c3c;_0x49d012[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xe5')][_0xd592('0x3f')]);_0x49d012[_0xd592('0x47')]=_['keys'](_0x321aa6[_0xd592('0x47')]);_0x49d012[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x49d012[_0xd592('0x58')],_0x49d012['query']);_0x4dc9e7[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x49d012[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x321aa6[_0xd592('0x47')][_0xd592('0x5e')]));_0x4dc9e7['attributes']=_0x4dc9e7[_0xd592('0x5d')][_0xd592('0x4f')]?_0x4dc9e7['attributes']:_0x49d012[_0xd592('0x58')];_0x4dc9e7[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x321aa6[_0xd592('0x47')][_0xd592('0xd7')]);_0x4dc9e7[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x321aa6[_0xd592('0x47')],_0x49d012[_0xd592('0x5b')]));if(_0x321aa6['query'][_0xd592('0x32')]){_0x4dc9e7[_0xd592('0x46')]=_[_0xd592('0x60')](_0x4dc9e7[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x4dc9e7[_0xd592('0x5d')],function(_0x50abc3){var _0x4e26fc={};_0x4e26fc[_0x50abc3]={'$like':'%'+_0x321aa6[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x4e26fc;})});}_0x4dc9e7=_[_0xd592('0x60')]({},_0x4dc9e7,_0x321aa6[_0xd592('0x61')]);return _0x5b5e53[_0xd592('0xe4')](_0x4dc9e7);}})[_0xd592('0x14')](function(_0x5ca718){if(_0x5ca718){_0x5b16e7=_0x5ca718['length'];if(!_0x321aa6[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x4dc9e7['limit']=qs[_0xd592('0x26')](_0x321aa6['query'][_0xd592('0x26')]);_0x4dc9e7[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x321aa6['query'][_0xd592('0x24')]);}return _0x5b5e53['getGroups'](_0x4dc9e7);}})[_0xd592('0x14')](function(_0x4c08c2){if(_0x4c08c2){return _0x4c08c2?{'count':_0x5b16e7,'rows':_0x4c08c2}:null;}})['then'](respondWithResult(_0x3d6e8f,null))[_0xd592('0x1f')](handleError(_0x3d6e8f,null));};exports[_0xd592('0xe6')]=function(_0xd43c08,_0x27088b){var _0x10f7c1={'raw':!![],'where':{}};var _0x5edc15={};var _0x5be924={'count':0x0,'rows':[]};return db[_0xd592('0x3e')]['findOne']({'where':{'id':_0xd43c08[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x27088b,null))[_0xd592('0x14')](function(_0x111109){if(_0x111109){_0x5edc15[_0xd592('0x58')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x5edc15[_0xd592('0x47')]=_[_0xd592('0x5a')](_0xd43c08[_0xd592('0x47')]);_0x5edc15[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x5edc15['model'],_0x5edc15[_0xd592('0x47')]);_0x10f7c1[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x5edc15[_0xd592('0x58')],qs[_0xd592('0x5e')](_0xd43c08[_0xd592('0x47')]['fields']));_0x10f7c1['attributes']=_0x10f7c1[_0xd592('0x5d')][_0xd592('0x4f')]?_0x10f7c1[_0xd592('0x5d')]:_0x5edc15[_0xd592('0x58')];if(!_0xd43c08[_0xd592('0x47')]['hasOwnProperty'](_0xd592('0xdf'))){_0x10f7c1[_0xd592('0x26')]=qs[_0xd592('0x26')](_0xd43c08[_0xd592('0x47')][_0xd592('0x26')]);_0x10f7c1['offset']=qs[_0xd592('0x24')](_0xd43c08['query'][_0xd592('0x24')]);}_0x10f7c1['order']=qs[_0xd592('0xd7')](_0xd43c08[_0xd592('0x47')][_0xd592('0xd7')]);_0x10f7c1[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0xd43c08['query'],_0x5edc15['filters']));_0x10f7c1[_0xd592('0x46')][_0xd592('0xe7')]=_0x111109['id'];if(_0xd43c08[_0xd592('0x47')][_0xd592('0x32')]){_0x10f7c1[_0xd592('0x46')]=_[_0xd592('0x60')](_0x10f7c1[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x10f7c1[_0xd592('0x5d')],function(_0x4e6d37){var _0x186dbe={};_0x186dbe[_0x4e6d37]={'$like':'%'+_0xd43c08['query'][_0xd592('0x32')]+'%'};return _0x186dbe;})});}_0x10f7c1=_[_0xd592('0x60')]({},_0x10f7c1,_0xd43c08[_0xd592('0x61')]);return db['VoiceRecording']['count']({'where':_0x10f7c1['where']})['then'](function(_0x1ba529){_0x5be924[_0xd592('0x27')]=_0x1ba529;if(_0xd43c08[_0xd592('0x47')]['includeAll']){_0x10f7c1[_0xd592('0x4a')]=[{'all':!![]}];}return db[_0xd592('0xe8')][_0xd592('0x92')](_0x10f7c1);})[_0xd592('0x14')](function(_0x554770){_0x5be924[_0xd592('0x4e')]=_0x554770;return _0x5be924;});}})[_0xd592('0x14')](respondWithFilteredResult(_0x27088b,_0x10f7c1))[_0xd592('0x1f')](handleError(_0x27088b,null));};exports[_0xd592('0xe9')]=function(_0x391f98,_0x17dfe2){var _0x5da874={'raw':!![],'where':{}};var _0x26d110={};var _0x20c1a3={'count':0x0,'rows':[]};return db['User'][_0xd592('0x9f')]({'where':{'id':_0x391f98['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x17dfe2,null))[_0xd592('0x14')](function(_0x392bf7){if(_0x392bf7){_0x26d110['model']=_[_0xd592('0x5a')](db[_0xd592('0xea')][_0xd592('0x3f')]);_0x26d110['query']=_[_0xd592('0x5a')](_0x391f98[_0xd592('0x47')]);_0x26d110[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x26d110['model'],_0x26d110['query']);_0x5da874[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x26d110[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x391f98[_0xd592('0x47')][_0xd592('0x5e')]));_0x5da874[_0xd592('0x5d')]=_0x5da874['attributes'][_0xd592('0x4f')]?_0x5da874[_0xd592('0x5d')]:_0x26d110[_0xd592('0x58')];if(!_0x391f98[_0xd592('0x47')][_0xd592('0xd9')]('nolimit')){_0x5da874[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x391f98[_0xd592('0x47')]['limit']);_0x5da874[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x391f98[_0xd592('0x47')][_0xd592('0x24')]);}_0x5da874[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x391f98[_0xd592('0x47')]['sort']);_0x5da874[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x391f98[_0xd592('0x47')],_0x26d110[_0xd592('0x5b')]));_0x5da874['where'][_0xd592('0xe7')]=_0x392bf7['id'];if(_0x391f98[_0xd592('0x47')][_0xd592('0x32')]){_0x5da874['where']=_[_0xd592('0x60')](_0x5da874[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x5da874['attributes'],function(_0x302e63){var _0x4c7082={};_0x4c7082[_0x302e63]={'$like':'%'+_0x391f98['query']['filter']+'%'};return _0x4c7082;})});}_0x5da874=_[_0xd592('0x60')]({},_0x5da874,_0x391f98[_0xd592('0x61')]);return db['ScreenRecording'][_0xd592('0x27')]({'where':_0x5da874['where']})[_0xd592('0x14')](function(_0x127d06){_0x20c1a3['count']=_0x127d06;if(_0x391f98[_0xd592('0x47')][_0xd592('0x48')]){_0x5da874[_0xd592('0x4a')]=[{'all':!![]}];}return db[_0xd592('0xea')][_0xd592('0x92')](_0x5da874);})['then'](function(_0x29e533){_0x20c1a3['rows']=_0x29e533;return _0x20c1a3;});}})['then'](respondWithFilteredResult(_0x17dfe2,_0x5da874))[_0xd592('0x1f')](handleError(_0x17dfe2,null));};exports[_0xd592('0xeb')]=function(_0x1d2ee9,_0x53bc9b){var _0x35102f={};var _0x286cab={};var _0x409218;var _0x2f69c0;return db['User'][_0xd592('0x9f')]({'where':{'id':_0x1d2ee9[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x53bc9b,null))['then'](function(_0x5d4887){if(_0x5d4887){_0x409218=_0x5d4887;_0x286cab['model']=_['keys'](db[_0xd592('0xec')][_0xd592('0x3f')]);_0x286cab[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x1d2ee9[_0xd592('0x47')]);_0x286cab['filters']=_[_0xd592('0x5c')](_0x286cab['model'],_0x286cab[_0xd592('0x47')]);_0x35102f[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x286cab[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x1d2ee9[_0xd592('0x47')][_0xd592('0x5e')]));_0x35102f['attributes']=_0x35102f[_0xd592('0x5d')]['length']?_0x35102f[_0xd592('0x5d')]:_0x286cab[_0xd592('0x58')];_0x35102f[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x1d2ee9[_0xd592('0x47')]['sort']);_0x35102f[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x1d2ee9['query'],_0x286cab['filters']));if(_0x1d2ee9['query']['filter']){_0x35102f[_0xd592('0x46')]=_[_0xd592('0x60')](_0x35102f[_0xd592('0x46')],{'$or':_['map'](_0x35102f['attributes'],function(_0x5a899a){var _0xfbfc4f={};_0xfbfc4f[_0x5a899a]={'$like':'%'+_0x1d2ee9['query'][_0xd592('0x32')]+'%'};return _0xfbfc4f;})});}_0x35102f=_[_0xd592('0x60')]({},_0x35102f,_0x1d2ee9[_0xd592('0x61')]);return _0x409218[_0xd592('0xeb')](_0x35102f);}})[_0xd592('0x14')](function(_0x65ae69){if(_0x65ae69){_0x2f69c0=_0x65ae69[_0xd592('0x4f')];if(!_0x1d2ee9[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x35102f[_0xd592('0x26')]=qs['limit'](_0x1d2ee9[_0xd592('0x47')][_0xd592('0x26')]);_0x35102f[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x1d2ee9[_0xd592('0x47')][_0xd592('0x24')]);}return _0x409218[_0xd592('0xeb')](_0x35102f);}})['then'](function(_0x697f07){if(_0x697f07){return _0x697f07?{'count':_0x2f69c0,'rows':_0x697f07}:null;}})[_0xd592('0x14')](respondWithResult(_0x53bc9b,null))['catch'](handleError(_0x53bc9b,null));};exports[_0xd592('0xed')]=function(_0x1a7a43,_0x4dbdf8){var _0x5844a1={};var _0x219b41={};var _0x3841e3;var _0x450a5d;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x1a7a43[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x4dbdf8,null))[_0xd592('0x14')](function(_0x4df3e1){if(_0x4df3e1){_0x3841e3=_0x4df3e1;_0x219b41[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xee')]['rawAttributes']);_0x219b41[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x1a7a43[_0xd592('0x47')]);_0x219b41['filters']=_[_0xd592('0x5c')](_0x219b41[_0xd592('0x58')],_0x219b41[_0xd592('0x47')]);_0x5844a1[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x219b41[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x1a7a43[_0xd592('0x47')][_0xd592('0x5e')]));_0x5844a1[_0xd592('0x5d')]=_0x5844a1[_0xd592('0x5d')][_0xd592('0x4f')]?_0x5844a1[_0xd592('0x5d')]:_0x219b41[_0xd592('0x58')];_0x5844a1[_0xd592('0xd6')]=qs['sort'](_0x1a7a43['query'][_0xd592('0xd7')]);_0x5844a1[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x1a7a43[_0xd592('0x47')],_0x219b41[_0xd592('0x5b')]));if(_0x1a7a43[_0xd592('0x47')]['filter']){_0x5844a1[_0xd592('0x46')]=_['merge'](_0x5844a1[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x5844a1[_0xd592('0x5d')],function(_0x668902){var _0x57901a={};_0x57901a[_0x668902]={'$like':'%'+_0x1a7a43[_0xd592('0x47')]['filter']+'%'};return _0x57901a;})});}_0x5844a1=_[_0xd592('0x60')]({},_0x5844a1,_0x1a7a43[_0xd592('0x61')]);return _0x3841e3['getOpenchannelInteractions'](_0x5844a1);}})[_0xd592('0x14')](function(_0x1be52c){if(_0x1be52c){_0x450a5d=_0x1be52c[_0xd592('0x4f')];if(!_0x1a7a43[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x5844a1['limit']=qs['limit'](_0x1a7a43[_0xd592('0x47')][_0xd592('0x26')]);_0x5844a1[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x1a7a43['query'][_0xd592('0x24')]);}return _0x3841e3[_0xd592('0xed')](_0x5844a1);}})[_0xd592('0x14')](function(_0x111c3d){if(_0x111c3d){return _0x111c3d?{'count':_0x450a5d,'rows':_0x111c3d}:null;}})[_0xd592('0x14')](respondWithResult(_0x4dbdf8,null))['catch'](handleError(_0x4dbdf8,null));};exports[_0xd592('0xef')]=function(_0x17f22f,_0x27c985){var _0x4a8332={'raw':!![],'where':{}};var _0x2f2068={};var _0x175c86={'count':0x0,'rows':[]};return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x17f22f[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x27c985,null))['then'](function(_0x3be6b3){if(_0x3be6b3){_0x2f2068[_0xd592('0x58')]=_['keys'](db[_0xd592('0xf0')][_0xd592('0x3f')]);_0x2f2068[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x17f22f[_0xd592('0x47')]);_0x2f2068['filters']=_[_0xd592('0x5c')](_0x2f2068[_0xd592('0x58')],_0x2f2068[_0xd592('0x47')]);_0x4a8332[_0xd592('0x5d')]=_['intersection'](_0x2f2068[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x17f22f[_0xd592('0x47')]['fields']));_0x4a8332[_0xd592('0x5d')]=_0x4a8332[_0xd592('0x5d')]['length']?_0x4a8332[_0xd592('0x5d')]:_0x2f2068[_0xd592('0x58')];if(!_0x17f22f[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x4a8332[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x17f22f['query'][_0xd592('0x26')]);_0x4a8332[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x17f22f[_0xd592('0x47')][_0xd592('0x24')]);}_0x4a8332[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x17f22f[_0xd592('0x47')][_0xd592('0xd7')]);_0x4a8332[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x17f22f[_0xd592('0x47')],_0x2f2068[_0xd592('0x5b')]));_0x4a8332[_0xd592('0x46')][_0xd592('0xe7')]=_0x3be6b3['id'];if(_0x17f22f[_0xd592('0x47')][_0xd592('0x32')]){_0x4a8332[_0xd592('0x46')]=_[_0xd592('0x60')](_0x4a8332[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x4a8332[_0xd592('0x5d')],function(_0x1dba11){var _0x22120d={};_0x22120d[_0x1dba11]={'$like':'%'+_0x17f22f['query'][_0xd592('0x32')]+'%'};return _0x22120d;})});}_0x4a8332=_['merge']({},_0x4a8332,_0x17f22f[_0xd592('0x61')]);return db['MailInteraction']['count']({'where':_0x4a8332[_0xd592('0x46')]})['then'](function(_0x32ba2f){_0x175c86[_0xd592('0x27')]=_0x32ba2f;if(_0x17f22f[_0xd592('0x47')][_0xd592('0x48')]){_0x4a8332['include']=[{'all':!![]}];}return db[_0xd592('0xf0')]['findAll'](_0x4a8332);})[_0xd592('0x14')](function(_0x5208b9){_0x175c86[_0xd592('0x4e')]=_0x5208b9;return _0x175c86;});}})[_0xd592('0x14')](respondWithFilteredResult(_0x27c985,_0x4a8332))[_0xd592('0x1f')](handleError(_0x27c985,null));};exports[_0xd592('0xf1')]=function(_0x20abc6,_0x34f0fc){var _0x1bb337={};var _0x5667ff={};var _0x126d77;var _0x9df212;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x20abc6[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x34f0fc,null))[_0xd592('0x14')](function(_0x4b7a8e){if(_0x4b7a8e){_0x126d77=_0x4b7a8e;_0x5667ff[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xf2')][_0xd592('0x3f')]);_0x5667ff[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x20abc6[_0xd592('0x47')]);_0x5667ff[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x5667ff[_0xd592('0x58')],_0x5667ff[_0xd592('0x47')]);_0x1bb337['attributes']=_[_0xd592('0x5c')](_0x5667ff['model'],qs['fields'](_0x20abc6['query'][_0xd592('0x5e')]));_0x1bb337[_0xd592('0x5d')]=_0x1bb337[_0xd592('0x5d')][_0xd592('0x4f')]?_0x1bb337[_0xd592('0x5d')]:_0x5667ff[_0xd592('0x58')];_0x1bb337[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x20abc6[_0xd592('0x47')][_0xd592('0xd7')]);_0x1bb337['where']=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x20abc6['query'],_0x5667ff[_0xd592('0x5b')]));if(_0x20abc6[_0xd592('0x47')][_0xd592('0x32')]){_0x1bb337[_0xd592('0x46')]=_[_0xd592('0x60')](_0x1bb337[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x1bb337[_0xd592('0x5d')],function(_0x18d73e){var _0x578ad2={};_0x578ad2[_0x18d73e]={'$like':'%'+_0x20abc6['query']['filter']+'%'};return _0x578ad2;})});}_0x1bb337=_[_0xd592('0x60')]({},_0x1bb337,_0x20abc6[_0xd592('0x61')]);return _0x126d77[_0xd592('0xf1')](_0x1bb337);}})['then'](function(_0x96d638){if(_0x96d638){_0x9df212=_0x96d638[_0xd592('0x4f')];if(!_0x20abc6[_0xd592('0x47')]['hasOwnProperty'](_0xd592('0xdf'))){_0x1bb337[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x20abc6[_0xd592('0x47')][_0xd592('0x26')]);_0x1bb337[_0xd592('0x24')]=qs['offset'](_0x20abc6['query'][_0xd592('0x24')]);}return _0x126d77['getSmsInteractions'](_0x1bb337);}})['then'](function(_0x5c3283){if(_0x5c3283){return _0x5c3283?{'count':_0x9df212,'rows':_0x5c3283}:null;}})[_0xd592('0x14')](respondWithResult(_0x34f0fc,null))[_0xd592('0x1f')](handleError(_0x34f0fc,null));};exports[_0xd592('0xf3')]=function(_0x361511,_0x507ed7){var _0x10dac6={};var _0x1ecddf={};var _0x559480;var _0x52afde;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x361511['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x507ed7,null))[_0xd592('0x14')](function(_0x61241f){if(_0x61241f){_0x559480=_0x61241f;_0x1ecddf[_0xd592('0x58')]=_['keys'](db[_0xd592('0xf4')][_0xd592('0x3f')]);_0x1ecddf[_0xd592('0x47')]=_['keys'](_0x361511[_0xd592('0x47')]);_0x1ecddf[_0xd592('0x5b')]=_['intersection'](_0x1ecddf[_0xd592('0x58')],_0x1ecddf[_0xd592('0x47')]);_0x10dac6[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x1ecddf[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x361511[_0xd592('0x47')][_0xd592('0x5e')]));_0x10dac6[_0xd592('0x5d')]=_0x10dac6[_0xd592('0x5d')][_0xd592('0x4f')]?_0x10dac6[_0xd592('0x5d')]:_0x1ecddf[_0xd592('0x58')];_0x10dac6[_0xd592('0xd6')]=qs['sort'](_0x361511['query'][_0xd592('0xd7')]);_0x10dac6['where']=qs['filters'](_[_0xd592('0xd8')](_0x361511[_0xd592('0x47')],_0x1ecddf[_0xd592('0x5b')]));if(_0x361511[_0xd592('0x47')][_0xd592('0x32')]){_0x10dac6[_0xd592('0x46')]=_[_0xd592('0x60')](_0x10dac6[_0xd592('0x46')],{'$or':_['map'](_0x10dac6[_0xd592('0x5d')],function(_0x359e8f){var _0x4a6dba={};_0x4a6dba[_0x359e8f]={'$like':'%'+_0x361511[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x4a6dba;})});}_0x10dac6=_[_0xd592('0x60')]({},_0x10dac6,_0x361511[_0xd592('0x61')]);return _0x559480[_0xd592('0xf3')](_0x10dac6);}})[_0xd592('0x14')](function(_0x2542b4){if(_0x2542b4){_0x52afde=_0x2542b4[_0xd592('0x4f')];if(!_0x361511['query'][_0xd592('0xd9')](_0xd592('0xdf'))){_0x10dac6['limit']=qs[_0xd592('0x26')](_0x361511[_0xd592('0x47')][_0xd592('0x26')]);_0x10dac6[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x361511[_0xd592('0x47')][_0xd592('0x24')]);}return _0x559480[_0xd592('0xf3')](_0x10dac6);}})[_0xd592('0x14')](function(_0x37416f){if(_0x37416f){return _0x37416f?{'count':_0x52afde,'rows':_0x37416f}:null;}})[_0xd592('0x14')](respondWithResult(_0x507ed7,null))[_0xd592('0x1f')](handleError(_0x507ed7,null));};exports[_0xd592('0xf5')]=function(_0x19a832,_0x1cc2c8){var _0x5a5682={};var _0x61e876={};var _0x1cfe5b;var _0x5f1531;return db['User'][_0xd592('0x9f')]({'where':{'id':_0x19a832[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1cc2c8,null))[_0xd592('0x14')](function(_0x8e48da){if(_0x8e48da){_0x1cfe5b=_0x8e48da;_0x61e876[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xf6')][_0xd592('0x3f')]);_0x61e876[_0xd592('0x47')]=_['keys'](_0x19a832[_0xd592('0x47')]);_0x61e876[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x61e876[_0xd592('0x58')],_0x61e876[_0xd592('0x47')]);_0x5a5682[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x61e876[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x19a832[_0xd592('0x47')]['fields']));_0x5a5682[_0xd592('0x5d')]=_0x5a5682[_0xd592('0x5d')][_0xd592('0x4f')]?_0x5a5682[_0xd592('0x5d')]:_0x61e876['model'];_0x5a5682[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x19a832[_0xd592('0x47')][_0xd592('0xd7')]);_0x5a5682[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x19a832[_0xd592('0x47')],_0x61e876[_0xd592('0x5b')]));if(_0x19a832[_0xd592('0x47')][_0xd592('0x32')]){_0x5a5682[_0xd592('0x46')]=_[_0xd592('0x60')](_0x5a5682[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x5a5682[_0xd592('0x5d')],function(_0x520a3b){var _0x1b55ed={};_0x1b55ed[_0x520a3b]={'$like':'%'+_0x19a832[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x1b55ed;})});}_0x5a5682=_[_0xd592('0x60')]({},_0x5a5682,_0x19a832[_0xd592('0x61')]);return _0x1cfe5b[_0xd592('0xf5')](_0x5a5682);}})['then'](function(_0x2fa532){if(_0x2fa532){_0x5f1531=_0x2fa532['length'];if(!_0x19a832[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x5a5682['limit']=qs[_0xd592('0x26')](_0x19a832[_0xd592('0x47')][_0xd592('0x26')]);_0x5a5682[_0xd592('0x24')]=qs['offset'](_0x19a832[_0xd592('0x47')][_0xd592('0x24')]);}return _0x1cfe5b[_0xd592('0xf5')](_0x5a5682);}})[_0xd592('0x14')](function(_0x374304){if(_0x374304){return _0x374304?{'count':_0x5f1531,'rows':_0x374304}:null;}})[_0xd592('0x14')](respondWithResult(_0x1cc2c8,null))[_0xd592('0x1f')](handleError(_0x1cc2c8,null));};exports['login']=function(_0x3f35ae,_0xc8a238,_0x55ad7e){var _0xbbf797;var _0x452928;var _0x49c298;var _0x4a0c98=!_[_0xd592('0x73')](_0x3f35ae[_0xd592('0x57')]['id'])?_0x3f35ae[_0xd592('0x57')]['id']:!_[_0xd592('0x73')](_0x3f35ae[_0xd592('0x87')]['id'])?_0x3f35ae['user']['id']:null;return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x4a0c98,'role':{'$or':[_0xd592('0x2d'),_0xd592('0x87'),_0xd592('0x2f')]}},'attributes':['id','name','phone',_0xd592('0xf7'),_0xd592('0x79'),'internal',_0xd592('0xa8')]})['then'](function(_0x1979d1){if(_0x1979d1){if(_0x1979d1[_0xd592('0x79')]===_0xd592('0x2f')){_0xbbf797=_0x1979d1;if(_0x3f35ae[_0xd592('0x64')][_0xd592('0xaa')]){_0x49c298=util[_0xd592('0xb5')]('LOCAL/%s@from-sip/n',_0xbbf797[_0x3f35ae[_0xd592('0x64')]['interface']]);}else if(_0x3f35ae['body'][_0xd592('0xf8')]){_0x49c298=util[_0xd592('0xb5')](_0xd592('0xb6'),_0x3f35ae[_0xd592('0x64')][_0xd592('0xf8')]);}else{_0x49c298=util[_0xd592('0xb5')](_0xd592('0xb6'),_0xbbf797[_0xd592('0x38')]);}socket['to'](util[_0xd592('0xb5')]('user:%s',_0xbbf797['name']))[_0xd592('0x2a')](_0xd592('0xf9'),{'user':{'id':_0xbbf797['id'],'name':_0xbbf797[_0xd592('0x38')]},'ip':_0x3f35ae[_0xd592('0xfa')][_0xd592('0xfb')]||_0x3f35ae[_0xd592('0xfc')][_0xd592('0xfd')]||_0x3f35ae[_0xd592('0xfe')][_0xd592('0xfd')]||_0x3f35ae['connection'][_0xd592('0xfe')][_0xd592('0xfd')]});return db[_0xd592('0xba')]['destroy']({'where':{'membername':_0xbbf797[_0xd592('0x38')]},'individualHooks':!![]});}}else{throw new db['Sequelize']['ValidationError'](_0xd592('0xff'));}})[_0xd592('0x14')](function(){if(_0xbbf797){return _0xbbf797[_0xd592('0x100')]({'raw':!![]});}})[_0xd592('0x14')](function(_0x3f0e32){if(_0xbbf797){if(_0x3f0e32){_0x452928=_0x3f0e32;if(_0x452928[_0xd592('0x4f')]){var _0x3410b8=_0x452928[_0xd592('0x34')](function(_0x238a41){var _0x5ac567={'membername':_0xbbf797[_0xd592('0x38')],'UserId':_0xbbf797['id'],'queue_name':_0x238a41[_0xd592('0x38')],'VoiceQueueId':_0x238a41['id'],'interface':_0x49c298,'paused':_0xbbf797['loginInPause']||![],'penalty':_0x238a41[_0xd592('0x101')]||0x0};return db['UserVoiceQueueRt']['upsert'](_0x5ac567);});return Promise['all'](_0x3410b8);}}}})[_0xd592('0x14')](function(){if(_0xbbf797){return db[_0xd592('0x102')][_0xd592('0x92')]({'where':{'membername':_0xbbf797['name'],'exitAt':null}});}})['then'](function(_0x5653d5){if(_0xbbf797){var _0x101744=[];_0x5653d5['forEach'](function(_0x331e77){_0x101744[_0xd592('0x4c')](_0x331e77[_0xd592('0x29')]({'exitAt':moment()[_0xd592('0xb5')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0xd592('0x55')](_0x101744);}})[_0xd592('0x14')](function(){if(_0xbbf797){var _0xc81725=[];var _0x23bd96=[];var _0x29ff7e=utils[_0xd592('0x103')]();var _0x5eb287={'membername':_0xbbf797['name'],'interface':_0x49c298,'enterAt':moment()['format'](_0xd592('0x104')),'role':_0xbbf797['role'],'internal':_0xbbf797[_0xd592('0x68')]};_0x29ff7e[_0xd592('0x105')](function(_0x114dea){_0xc81725[_0xd592('0x4c')](_[_0xd592('0x60')]({'channel':_0x114dea,'type':_0xd592('0x106'),'data1':_0x3f35ae[_0xd592('0x64')][_0xd592('0x107')],'data2':_0x49c298},_0x5eb287));if(_0xbbf797[_0xd592('0xa8')]){_0x23bd96['push'](_[_0xd592('0x60')]({'channel':_0x114dea,'type':_0xd592('0x108'),'data1':_0xd592('0x109')},_0x5eb287));}});return db[_0xd592('0x102')]['bulkCreate'](_0xc81725[_0xd592('0xd3')](_0x23bd96),{'individualHooks':!![]});}})[_0xd592('0x14')](function(){if(_0xbbf797){return _0xbbf797['update']({'online':!![],'lastLoginAt':moment()['format'](_0xd592('0x104')),'voicePause':_0xbbf797[_0xd592('0xa8')]||![],'mailPause':_0xbbf797['loginInPause']||![],'chatPause':_0xbbf797['loginInPause']||![],'faxPause':_0xbbf797[_0xd592('0xa8')]||![],'smsPause':_0xbbf797[_0xd592('0xa8')]||![],'openchannelPause':_0xbbf797[_0xd592('0xa8')]||![],'whatsappPause':_0xbbf797[_0xd592('0xa8')]||![],'pauseType':_0xbbf797[_0xd592('0xa8')]?_0xd592('0x109'):null,'interface':_0x49c298,'lastPauseAt':moment()[_0xd592('0xb5')](_0xd592('0x104'))});}})[_0xd592('0x14')](function(_0x123244){if(_0x3f35ae[_0xd592('0x10a')]){return _0x55ad7e();}else{return Promise[_0xd592('0x10b')](_0x123244)[_0xd592('0x14')](respondWithResult(_0xc8a238,null));}})['catch'](handleError(_0xc8a238,null));};exports[_0xd592('0x10c')]=function(_0x360488,_0x4a4f53){var _0x1e2735;return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x360488[_0xd592('0x57')]['id'],'role':'agent'},'attributes':['id','name',_0xd592('0x79')]})[_0xd592('0x14')](handleEntityNotFound(_0x4a4f53,null))[_0xd592('0x14')](function(_0x408735){if(_0x408735){_0x1e2735=_0x408735;return db[_0xd592('0xba')]['destroy']({'where':{'membername':_0x1e2735[_0xd592('0x38')]},'individualHooks':!![]});}})[_0xd592('0x14')](function(){return db['MemberReport'][_0xd592('0x92')]({'where':{'membername':_0x1e2735[_0xd592('0x38')],'exitAt':null}});})[_0xd592('0x14')](function(_0xdfe67a){var _0x3a7c1b=[];_0xdfe67a[_0xd592('0x105')](function(_0x214faa){_0x3a7c1b[_0xd592('0x4c')](_0x214faa[_0xd592('0x29')]({'exitAt':moment()[_0xd592('0xb5')](_0xd592('0x104'))}));});return Promise[_0xd592('0x55')](_0x3a7c1b);})['then'](function(){return _0x1e2735['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xd592('0x14')](respondWithResult(_0x4a4f53,null))['catch'](handleError(_0x4a4f53,null));};exports[_0xd592('0x10d')]=function(_0x220cf7,_0x3a99f0){var _0x2d319c;return db[_0xd592('0xba')][_0xd592('0x29')]({'paused':0x1},{'where':{'UserId':_0x220cf7[_0xd592('0x57')]['id']},'individualHooks':!![]})[_0xd592('0x14')](function(){return db['User'][_0xd592('0x37')]({'where':{'id':_0x220cf7['params']['id'],'role':_0xd592('0x2f')},'attributes':['id','name',_0xd592('0x79'),_0xd592('0x68'),_0xd592('0xaa'),_0xd592('0xa7')]});})[_0xd592('0x14')](handleEntityNotFound(_0x3a99f0,null))[_0xd592('0x14')](function(_0x5dd13d){if(_0x5dd13d){_0x2d319c=_0x5dd13d;return respondWithRpcPromise(_0xd592('0x10e'),_0xd592('0x10d'),{'id':_0x2d319c['id'],'name':_0x2d319c['name'],'pause':!![]});}})[_0xd592('0x14')](function(){if(_0x2d319c){return db[_0xd592('0x102')][_0xd592('0x92')]({'where':{'membername':_0x2d319c[_0xd592('0x38')],'type':_0xd592('0x108'),'exitAt':null}});}})['then'](function(_0xff4958){if(_0xff4958['length']){var _0x38992b=moment()['format'](_0xd592('0x104'));for(var _0x12e737=0x0,_0xab9050=_0xff4958[_0xd592('0x4f')];_0x12e737<_0xab9050;_0x12e737++){_0xff4958[_0x12e737][_0xd592('0x10f')]({'exitAt':_0x38992b});}}})[_0xd592('0x14')](function(){var _0x2ac7b3=[];var _0x4a611b=utils[_0xd592('0x103')]();_0x4a611b['forEach'](function(_0xdb0da9){_0x2ac7b3['push']({'channel':_0xdb0da9,'membername':_0x2d319c[_0xd592('0x38')],'interface':_[_0xd592('0x73')](_0x2d319c[_0xd592('0xaa')])?util[_0xd592('0xb5')](_0xd592('0xb6'),_0x2d319c[_0xd592('0x38')]):_0x2d319c['interface'],'type':_0xd592('0x108'),'enterAt':moment()[_0xd592('0xb5')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x220cf7[_0xd592('0x64')][_0xd592('0x41')]||_0xd592('0x110'),'role':_0x2d319c[_0xd592('0x79')],'internal':_0x2d319c[_0xd592('0x68')]});});return db[_0xd592('0x102')][_0xd592('0x111')](_0x2ac7b3,{'individualHooks':!![]});})[_0xd592('0x14')](function(){return _0x2d319c[_0xd592('0x29')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x220cf7[_0xd592('0x64')][_0xd592('0x41')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xd592('0xb5')](_0xd592('0x104'))});})[_0xd592('0x14')](respondWithResult(_0x3a99f0,null))['catch'](handleError(_0x3a99f0,null));};exports[_0xd592('0x112')]=function(_0x10773d,_0x573ed9){if(_0x10773d['body'][_0xd592('0xa6')]&&!utils[_0xd592('0xab')](_0x10773d[_0xd592('0x64')]['channel'])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x10773d[_0xd592('0x64')][_0xd592('0xa6')]));}return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x10773d[_0xd592('0x57')]['id']},'attributes':['id','name',_0xd592('0x79'),_0xd592('0x68'),'interface',_0xd592('0xa7'),'voicePause',_0xd592('0x113'),_0xd592('0x114'),_0xd592('0x115'),_0xd592('0x116'),_0xd592('0x117'),_0xd592('0x118'),_0xd592('0x119'),'lastPauseAt']})['then'](function(_0xbd2045){if(!_0xbd2045){throw new APINotFoundError(util[_0xd592('0xb5')](_0xd592('0x11a'),_0x10773d['params']['id']));}return _0xbd2045[_0xd592('0x112')](_0x10773d[_0xd592('0x64')][_0xd592('0xa6')]);})[_0xd592('0x14')](respondWithResult(_0x573ed9,null))['catch'](APIHandleError(_0x573ed9));};exports['getTeams']=function(_0x2dc515,_0xb2cc88){var _0x2889a8={};var _0x30cd62={};var _0x55ffdc;var _0x51fb5b;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x2dc515[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0xb2cc88,null))['then'](function(_0x159a49){if(_0x159a49){_0x55ffdc=_0x159a49;_0x30cd62[_0xd592('0x58')]=_[_0xd592('0x5a')](db['Team'][_0xd592('0x3f')]);_0x30cd62[_0xd592('0x47')]=_['keys'](_0x2dc515[_0xd592('0x47')]);_0x30cd62['filters']=_[_0xd592('0x5c')](_0x30cd62['model'],_0x30cd62['query']);_0x2889a8[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x30cd62['model'],qs['fields'](_0x2dc515['query'][_0xd592('0x5e')]));_0x2889a8[_0xd592('0x5d')]=_0x2889a8[_0xd592('0x5d')][_0xd592('0x4f')]?_0x2889a8[_0xd592('0x5d')]:_0x30cd62['model'];_0x2889a8[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x2dc515['query'][_0xd592('0xd7')]);_0x2889a8['where']=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x2dc515[_0xd592('0x47')],_0x30cd62['filters']));if(_0x2dc515[_0xd592('0x47')][_0xd592('0x32')]){_0x2889a8[_0xd592('0x46')]=_[_0xd592('0x60')](_0x2889a8[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x2889a8['attributes'],function(_0x40e151){var _0x179f99={};_0x179f99[_0x40e151]={'$like':'%'+_0x2dc515[_0xd592('0x47')]['filter']+'%'};return _0x179f99;})});}_0x2889a8=_[_0xd592('0x60')]({},_0x2889a8,_0x2dc515['options']);return _0x55ffdc[_0xd592('0x11b')](_0x2889a8);}})[_0xd592('0x14')](function(_0x57528f){if(_0x57528f){_0x51fb5b=_0x57528f['length'];if(!_0x2dc515[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x2889a8['limit']=qs[_0xd592('0x26')](_0x2dc515[_0xd592('0x47')]['limit']);_0x2889a8[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x2dc515[_0xd592('0x47')][_0xd592('0x24')]);}return _0x55ffdc[_0xd592('0x11b')](_0x2889a8);}})[_0xd592('0x14')](function(_0x3c49ae){if(_0x3c49ae){return _0x3c49ae?{'count':_0x51fb5b,'rows':_0x3c49ae}:null;}})['then'](respondWithResult(_0xb2cc88,null))[_0xd592('0x1f')](handleError(_0xb2cc88,null));};exports['addTeams']=function(_0x9512ce,_0x56b90f){var _0x28865e=_0x9512ce['params']['id'];var _0x2e417c=_0x9512ce['body']?_0x9512ce[_0xd592('0x64')][_0xd592('0x66')]:null;var _0x5d2da1=[];return Promise['resolve']()[_0xd592('0x14')](function(){if(!_0x2e417c)throw new APIBadRequestError(_0xd592('0x11c'));})[_0xd592('0x14')](function(){return db['User'][_0xd592('0x9f')]({'where':{'id':_0x28865e}});})[_0xd592('0x14')](function(_0x5f52aa){if(!_0x5f52aa)throw new APINotFoundError(util[_0xd592('0xb5')](_0xd592('0x11a'),_0x9512ce[_0xd592('0x57')]['id']));return db[_0xd592('0x6e')][_0xd592('0x11d')](function(_0x173dd4){return _0x5f52aa[_0xd592('0x11e')](_0x2e417c,{'transaction':_0x173dd4})[_0xd592('0x14')](function(){return db[_0xd592('0x11f')][_0xd592('0x92')]({'where':{'id':{'$in':_0x2e417c}}});})['then'](function(_0x8e4b42){var _0x384185=_['map'](_0x8e4b42,function(_0x208b02){return _0x208b02['getAssociatedQueues']();});return Promise['all'](_0x384185);})[_0xd592('0x14')](function(_0x21e584){_0x5d2da1=_[_0xd592('0x120')](_0x21e584);var _0x2dc246=_[_0xd592('0x34')](_0x5d2da1,function(_0x20e08b){return _0x20e08b[_0xd592('0x121')](_0x5f52aa['id'],{'transaction':_0x173dd4});});return Promise[_0xd592('0x55')](_0x2dc246);})[_0xd592('0x14')](function(){if(!_0x5f52aa[_0xd592('0xa7')])return;var _0x31f6b0=_['filter'](_0x5d2da1,function(_0x54d1e8){return _0x54d1e8['getDataValue'](_0xd592('0xa6'))==='Voice';});var _0x23cc17=_['map'](_0x31f6b0,function(_0x27a22f){return db[_0xd592('0xba')][_0xd592('0x122')]({'membername':_0x5f52aa[_0xd592('0x38')],'UserId':_0x5f52aa['id'],'queue_name':_0x27a22f[_0xd592('0x38')],'VoiceQueueId':_0x27a22f['id'],'interface':_[_0xd592('0x73')](_0x5f52aa[_0xd592('0xaa')])?util[_0xd592('0xb5')](_0xd592('0xb6'),_0x5f52aa[_0xd592('0x38')]):_0x5f52aa['interface'],'paused':_0x5f52aa['voicePause']||![],'penalty':_0x5f52aa[_0xd592('0x123')]},{'transaction':_0x173dd4});});return Promise[_0xd592('0x55')](_0x23cc17);})[_0xd592('0x14')](function(){return db['TeamVoicePrefix'][_0xd592('0x92')]({'where':{'teamId':{'$in':_0x2e417c}}});})[_0xd592('0x14')](function(_0x3918c6){var _0x52cb07=_['map'](_0x3918c6,function(_0x4c0323){return db['UserVoicePrefix'][_0xd592('0x86')]({'UserId':_0x5f52aa['id'],'VoicePrefixId':_0x4c0323[_0xd592('0x124')]},{'transaction':_0x173dd4});});return Promise['all'](_0x52cb07);});});})[_0xd592('0x14')](function(){for(var _0x332f95=0x0;_0x332f95<_0x5d2da1[_0xd592('0x4f')];_0x332f95++){var _0x563957=_0x5d2da1[_0x332f95][_0xd592('0x125')](_0xd592('0xa6'));var _0x52d841=_0x563957+_0xd592('0xb2');socket['emit'](_0xd592('0x87')+_0x563957+'Queue:save',{'UserId':_0x28865e,['queueField']:_0x5d2da1[_0x332f95]['id']});}})['then'](respondWithStatusCode(_0x56b90f,null))[_0xd592('0x1f')](APIHandleError(_0x56b90f));};exports[_0xd592('0x126')]=function(_0x1b8a84,_0x410be5){var _0x1a4eea=_0x1b8a84[_0xd592('0x57')]['id'];var _0x28247a=null;if(_0x1b8a84[_0xd592('0x47')]['ids']){_0x28247a=_[_0xd592('0xb8')](_0x1b8a84[_0xd592('0x47')][_0xd592('0x66')])?_0x1b8a84[_0xd592('0x47')]['ids']:[_0x1b8a84[_0xd592('0x47')][_0xd592('0x66')]];}var _0x30536d=[];return Promise[_0xd592('0x10b')]()[_0xd592('0x14')](function(){if(!_0x28247a)throw new APIBadRequestError(_0xd592('0x127'));})['then'](function(){return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x1a4eea}});})['then'](function(_0x597419){if(!_0x597419)throw new APINotFoundError(util[_0xd592('0xb5')](_0xd592('0x11a'),_0x1b8a84[_0xd592('0x57')]['id']));return db[_0xd592('0x6e')][_0xd592('0x11d')](function(_0x2759ce){return _0x597419[_0xd592('0x126')](_0x28247a,{'transaction':_0x2759ce})[_0xd592('0x14')](function(){return db['Team'][_0xd592('0x92')]({'where':{'id':{'$in':_0x28247a}}});})[_0xd592('0x14')](function(_0x16a890){var _0x214a0a=_['map'](_0x16a890,function(_0x375ec4){return _0x375ec4[_0xd592('0x128')]();});return Promise[_0xd592('0x55')](_0x214a0a);})[_0xd592('0x14')](function(_0x3932c4){_0x30536d=_[_0xd592('0x120')](_0x3932c4);var _0x3cecda=_[_0xd592('0x34')](_0x30536d,function(_0x212e51){return _0x212e51[_0xd592('0x129')](_0x597419['id'],{'transaction':_0x2759ce});});return Promise[_0xd592('0x55')](_0x3cecda);})[_0xd592('0x14')](function(){if(!_0x597419[_0xd592('0xa7')])return;var _0x20c024=_['filter'](_0x30536d,function(_0x41aeec){return _0x41aeec[_0xd592('0x125')]('channel')===_0xd592('0x12a');});var _0x49b792=_[_0xd592('0x34')](_0x20c024,function(_0x23ac35){return db[_0xd592('0xba')][_0xd592('0x3a')]({'where':{'VoiceQueueId':_0x23ac35['id'],'UserId':_0x597419['id']},'transaction':_0x2759ce});});return Promise[_0xd592('0x55')](_0x49b792);})[_0xd592('0x14')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x28247a}}});})[_0xd592('0x14')](function(_0x53e0b6){var _0x5ec3f3=_['map'](_0x53e0b6,function(_0x274b44){return db['UserVoicePrefix'][_0xd592('0x3a')]({'where':{'UserId':_0x597419['id'],'VoicePrefixId':_0x274b44[_0xd592('0x124')]}},{'transaction':_0x2759ce});});return Promise[_0xd592('0x55')](_0x5ec3f3);});});})[_0xd592('0x14')](function(){for(var _0x4b3176=0x0;_0x4b3176<_0x30536d[_0xd592('0x4f')];_0x4b3176++){var _0x398aaf=_0x30536d[_0x4b3176][_0xd592('0x125')](_0xd592('0xa6'));var _0x2e89db=_0x398aaf+'QueueId';socket[_0xd592('0x2a')](_0xd592('0x87')+_0x398aaf+_0xd592('0xb9'),{'UserId':_0x1a4eea,['queueField']:_0x30536d[_0x4b3176]['id']});}})[_0xd592('0x14')](respondWithStatusCode(_0x410be5,null))[_0xd592('0x1f')](APIHandleError(_0x410be5));};exports[_0xd592('0x12b')]=function(_0xc7f0c8,_0x2c3060){var _0x1bbb67={};var _0x19c45d={};var _0x1fe41a;var _0xe05334;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0xc7f0c8['params']['id']}})['then'](handleEntityNotFound(_0x2c3060,null))[_0xd592('0x14')](function(_0x199be1){if(_0x199be1){_0x1fe41a=_0x199be1;_0x19c45d[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0xda')][_0xd592('0x3f')]);_0x19c45d['query']=_[_0xd592('0x5a')](_0xc7f0c8['query']);_0x19c45d[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x19c45d[_0xd592('0x58')],_0x19c45d[_0xd592('0x47')]);_0x1bbb67['attributes']=_['intersection'](_0x19c45d[_0xd592('0x58')],qs[_0xd592('0x5e')](_0xc7f0c8[_0xd592('0x47')][_0xd592('0x5e')]));_0x1bbb67['attributes']=_0x1bbb67[_0xd592('0x5d')][_0xd592('0x4f')]?_0x1bbb67['attributes']:_0x19c45d[_0xd592('0x58')];_0x1bbb67[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0xc7f0c8[_0xd592('0x47')][_0xd592('0xd7')]);_0x1bbb67[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0xc7f0c8[_0xd592('0x47')],_0x19c45d[_0xd592('0x5b')]));if(_0xc7f0c8[_0xd592('0x47')][_0xd592('0x32')]){_0x1bbb67['where']=_[_0xd592('0x60')](_0x1bbb67['where'],{'$or':_[_0xd592('0x34')](_0x1bbb67[_0xd592('0x5d')],function(_0x4254c5){var _0x2b7472={};_0x2b7472[_0x4254c5]={'$like':'%'+_0xc7f0c8[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x2b7472;})});}_0x1bbb67=_[_0xd592('0x60')]({},_0x1bbb67,_0xc7f0c8['options']);return _0x1fe41a[_0xd592('0x12b')](_0x1bbb67);}})[_0xd592('0x14')](function(_0x2d400d){if(_0x2d400d){_0xe05334=_0x2d400d['length'];if(!_0xc7f0c8[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x1bbb67[_0xd592('0x26')]=qs['limit'](_0xc7f0c8[_0xd592('0x47')][_0xd592('0x26')]);_0x1bbb67[_0xd592('0x24')]=qs[_0xd592('0x24')](_0xc7f0c8[_0xd592('0x47')][_0xd592('0x24')]);}return _0x1fe41a['getLists'](_0x1bbb67);}})[_0xd592('0x14')](function(_0xf3290c){if(_0xf3290c){return _0xf3290c?{'count':_0xe05334,'rows':_0xf3290c}:null;}})[_0xd592('0x14')](respondWithResult(_0x2c3060,null))[_0xd592('0x1f')](handleError(_0x2c3060,null));};exports[_0xd592('0x12c')]=function(_0x9d95f6,_0x30b2b7){var _0x4fe867={};var _0xd238f={};var _0x2d4244;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x9d95f6[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x30b2b7,null))[_0xd592('0x14')](function(_0x34bdc0){if(_0x34bdc0){_0x2d4244=_0x34bdc0;_0xd238f['model']=_[_0xd592('0x5a')](db[_0xd592('0x3e')]['rawAttributes']);_0xd238f[_0xd592('0x47')]=_['keys'](_0x9d95f6[_0xd592('0x47')]);_0xd238f[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0xd238f[_0xd592('0x58')],_0xd238f[_0xd592('0x47')]);_0x4fe867[_0xd592('0x5d')]=_['intersection'](_0xd238f[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x9d95f6[_0xd592('0x47')]['fields']));_0x4fe867[_0xd592('0x5d')]=_0x4fe867[_0xd592('0x5d')][_0xd592('0x4f')]?_0x4fe867[_0xd592('0x5d')]:_0xd238f[_0xd592('0x58')];_0x4fe867[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x9d95f6[_0xd592('0x47')][_0xd592('0xd7')]);_0x4fe867[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x9d95f6[_0xd592('0x47')],_0xd238f[_0xd592('0x5b')]));if(_0x9d95f6[_0xd592('0x47')][_0xd592('0x32')]){_0x4fe867['where']=_[_0xd592('0x60')](_0x4fe867[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x4fe867[_0xd592('0x5d')],function(_0x1d491a){var _0x259f63={};_0x259f63[_0x1d491a]={'$like':'%'+_0x9d95f6['query'][_0xd592('0x32')]+'%'};return _0x259f63;})});}_0x4fe867[_0xd592('0x58')]=db[_0xd592('0x3e')];_0x4fe867['as']=_0xd592('0x8d');_0x4fe867=_[_0xd592('0x60')]({},_0x4fe867,_0x9d95f6[_0xd592('0x61')]);return _0x2d4244[_0xd592('0x100')]({'include':[_0x4fe867]});}})[_0xd592('0x14')](function(_0x5370ca){if(_0x5370ca){var _0x26b274={},_0x48d624=[];for(var _0x2a158e=0x0;_0x2a158e<_0x5370ca[_0xd592('0x4f')];_0x2a158e+=0x1){for(var _0xf5b252=0x0,_0x455db4;_0xf5b252<_0x5370ca[_0x2a158e][_0xd592('0x8d')][_0xd592('0x4f')];_0xf5b252+=0x1){_0x455db4=_0x5370ca[_0x2a158e][_0xd592('0x8d')][_0xf5b252][_0xd592('0x2c')]({'plain':!![]});_0x26b274[_0x455db4['id']]=_0x455db4;}}_0x26b274=_[_0xd592('0x12d')](_0x26b274);for(var _0x15a866=qs[_0xd592('0x24')](_0x9d95f6['query'][_0xd592('0x24')]);_0x15a866<_0x26b274[_0xd592('0x4f')]&&_0x48d624['length']<qs[_0xd592('0x26')](_0x9d95f6['query'][_0xd592('0x26')]);_0x15a866+=0x1){if(_0x26b274[_0x15a866]){_0x48d624[_0xd592('0x4c')](_0x26b274[_0x15a866]);}}return{'count':_0x26b274[_0xd592('0x4f')],'rows':_0x48d624};}})[_0xd592('0x14')](respondWithResult(_0x30b2b7,null))[_0xd592('0x1f')](handleError(_0x30b2b7,null));};exports[_0xd592('0x3a')]=function(_0x4503a8,_0x32d2f2){if(_0x4503a8[_0xd592('0x87')]['id']==_0x4503a8[_0xd592('0x57')]['id']){return _0x32d2f2[_0xd592('0x22')](0x1f4)[_0xd592('0x3c')]({'message':_0xd592('0x12e')});}return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x4503a8[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x32d2f2,null))[_0xd592('0x14')](removeEntity(_0x32d2f2,null))[_0xd592('0x1f')](handleError(_0x32d2f2,null));};exports[_0xd592('0x12f')]=function(_0x401a83,_0x2538e9){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x401a83['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x2538e9,null))[_0xd592('0x14')](function(_0xf8daa6){if(_0xf8daa6){return _0xf8daa6[_0xd592('0x12f')](_0x401a83[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x401a83[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{})[_0xd592('0xb1')](function(){for(var _0x5f317d=0x0;_0x5f317d<_0x401a83[_0xd592('0x64')]['ids'][_0xd592('0x4f')];_0x5f317d+=0x1){socket['emit'](_0xd592('0x130'),{'ChatInteractionId':Number(_0x401a83[_0xd592('0x64')][_0xd592('0x66')][_0x5f317d]),'UserId':Number(_0x401a83[_0xd592('0x57')]['id'])});}return _0x401a83[_0xd592('0x64')][_0xd592('0x66')];});}})[_0xd592('0x14')](respondWithResult(_0x2538e9,null))[_0xd592('0x1f')](handleError(_0x2538e9,null));};exports[_0xd592('0x131')]=function(_0x50a538,_0x4bdb62){return db[_0xd592('0x3e')]['find']({'where':{'id':_0x50a538[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x4bdb62,null))[_0xd592('0x14')](function(_0x58fec){if(_0x58fec){return _0x58fec[_0xd592('0x131')](_0x50a538[_0xd592('0x47')][_0xd592('0x66')])[_0xd592('0x14')](function(){if(_['isArray'](_0x50a538['query'][_0xd592('0x66')])){for(var _0x1d383b=0x0;_0x1d383b<_0x50a538[_0xd592('0x47')][_0xd592('0x66')][_0xd592('0x4f')];_0x1d383b+=0x1){socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x50a538['query'][_0xd592('0x66')][_0x1d383b]),'UserId':Number(_0x50a538[_0xd592('0x57')]['id'])});}}else{socket[_0xd592('0x2a')](_0xd592('0x132'),{'ChatInteractionId':Number(_0x50a538['query'][_0xd592('0x66')]),'UserId':Number(_0x50a538['params']['id'])});}});}})[_0xd592('0x14')](respondWithStatusCode(_0x4bdb62,null))[_0xd592('0x1f')](handleError(_0x4bdb62,null));};exports[_0xd592('0x133')]=function(_0x5b8fdf,_0x37160c){return db['User'][_0xd592('0x37')]({'where':{'id':_0x5b8fdf[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x37160c,null))[_0xd592('0x14')](function(_0x17a34d){if(_0x17a34d){return _0x17a34d[_0xd592('0x133')](_0x5b8fdf[_0xd592('0x64')]['ids'],_[_0xd592('0x67')](_0x5b8fdf['body'],[_0xd592('0x66'),'id'])||{})[_0xd592('0xb1')](function(){for(var _0x8bc854=0x0;_0x8bc854<_0x5b8fdf['body'][_0xd592('0x66')]['length'];_0x8bc854+=0x1){socket['emit']('user_has_mail_interactions:save',{'MailInteractionId':Number(_0x5b8fdf[_0xd592('0x64')][_0xd592('0x66')][_0x8bc854]),'UserId':Number(_0x5b8fdf[_0xd592('0x57')]['id'])});}return _0x5b8fdf[_0xd592('0x64')][_0xd592('0x66')];});}})[_0xd592('0x14')](respondWithResult(_0x37160c,null))[_0xd592('0x1f')](handleError(_0x37160c,null));};exports[_0xd592('0x134')]=function(_0x10f112,_0x488c1f){return db[_0xd592('0x3e')]['find']({'where':{'id':_0x10f112[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x488c1f,null))[_0xd592('0x14')](function(_0x1b4370){if(_0x1b4370){return _0x1b4370[_0xd592('0x134')](_0x10f112[_0xd592('0x47')][_0xd592('0x66')])[_0xd592('0x14')](function(){if(_['isArray'](_0x10f112[_0xd592('0x47')][_0xd592('0x66')])){for(var _0x361633=0x0;_0x361633<_0x10f112[_0xd592('0x47')][_0xd592('0x66')]['length'];_0x361633+=0x1){socket['emit'](_0xd592('0x135'),{'MailInteractionId':Number(_0x10f112[_0xd592('0x47')]['ids'][_0x361633]),'UserId':Number(_0x10f112[_0xd592('0x57')]['id'])});}}else{socket[_0xd592('0x2a')](_0xd592('0x135'),{'MailInteractionId':Number(_0x10f112[_0xd592('0x47')][_0xd592('0x66')]),'UserId':Number(_0x10f112[_0xd592('0x57')]['id'])});}});}})[_0xd592('0x14')](respondWithStatusCode(_0x488c1f,null))['catch'](handleError(_0x488c1f,null));};exports['addFaxInteractions']=function(_0x152def,_0x577d49){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x152def[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x577d49,null))['then'](function(_0x139cf6){if(_0x139cf6){return _0x139cf6[_0xd592('0x136')](_0x152def[_0xd592('0x64')]['ids'],_['omit'](_0x152def[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{})['spread'](function(){for(var _0x759db9=0x0;_0x759db9<_0x152def['body'][_0xd592('0x66')][_0xd592('0x4f')];_0x759db9+=0x1){socket[_0xd592('0x2a')](_0xd592('0x137'),{'FaxInteractionId':Number(_0x152def['body'][_0xd592('0x66')][_0x759db9]),'UserId':Number(_0x152def[_0xd592('0x57')]['id'])});}return _0x152def[_0xd592('0x64')]['ids'];});}})[_0xd592('0x14')](respondWithResult(_0x577d49,null))[_0xd592('0x1f')](handleError(_0x577d49,null));};exports['removeFaxInteractions']=function(_0x1d6d22,_0xc31e01){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x1d6d22[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0xc31e01,null))[_0xd592('0x14')](function(_0x23c2a9){if(_0x23c2a9){return _0x23c2a9[_0xd592('0x138')](_0x1d6d22[_0xd592('0x47')][_0xd592('0x66')])[_0xd592('0x14')](function(){if(_[_0xd592('0xb8')](_0x1d6d22[_0xd592('0x47')]['ids'])){for(var _0x14571a=0x0;_0x14571a<_0x1d6d22[_0xd592('0x47')][_0xd592('0x66')]['length'];_0x14571a+=0x1){socket[_0xd592('0x2a')](_0xd592('0x139'),{'FaxInteractionId':Number(_0x1d6d22[_0xd592('0x47')][_0xd592('0x66')][_0x14571a]),'UserId':Number(_0x1d6d22[_0xd592('0x57')]['id'])});}}else{socket['emit'](_0xd592('0x139'),{'FaxInteractionId':Number(_0x1d6d22[_0xd592('0x47')]['ids']),'UserId':Number(_0x1d6d22[_0xd592('0x57')]['id'])});}});}})[_0xd592('0x14')](respondWithStatusCode(_0xc31e01,null))[_0xd592('0x1f')](handleError(_0xc31e01,null));};exports['addSmsInteractions']=function(_0x4484a9,_0x1e4d83){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x4484a9[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1e4d83,null))[_0xd592('0x14')](function(_0x5f4105){if(_0x5f4105){return _0x5f4105[_0xd592('0x13a')](_0x4484a9[_0xd592('0x64')][_0xd592('0x66')],_['omit'](_0x4484a9[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{})[_0xd592('0xb1')](function(){for(var _0x45c6b1=0x0;_0x45c6b1<_0x4484a9[_0xd592('0x64')][_0xd592('0x66')][_0xd592('0x4f')];_0x45c6b1+=0x1){socket[_0xd592('0x2a')](_0xd592('0x13b'),{'SmsInteractionId':Number(_0x4484a9[_0xd592('0x64')][_0xd592('0x66')][_0x45c6b1]),'UserId':Number(_0x4484a9[_0xd592('0x57')]['id'])});}return _0x4484a9[_0xd592('0x64')]['ids'];});}})['then'](respondWithResult(_0x1e4d83,null))['catch'](handleError(_0x1e4d83,null));};exports[_0xd592('0x13c')]=function(_0x40a686,_0x39bfbf){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x40a686[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x39bfbf,null))[_0xd592('0x14')](function(_0x486671){if(_0x486671){return _0x486671[_0xd592('0x13c')](_0x40a686[_0xd592('0x47')][_0xd592('0x66')])['then'](function(){if(_[_0xd592('0xb8')](_0x40a686[_0xd592('0x47')]['ids'])){for(var _0x4dea9a=0x0;_0x4dea9a<_0x40a686[_0xd592('0x47')][_0xd592('0x66')]['length'];_0x4dea9a+=0x1){socket[_0xd592('0x2a')](_0xd592('0x13d'),{'SmsInteractionId':Number(_0x40a686['query'][_0xd592('0x66')][_0x4dea9a]),'UserId':Number(_0x40a686[_0xd592('0x57')]['id'])});}}else{socket['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x40a686['query'][_0xd592('0x66')]),'UserId':Number(_0x40a686['params']['id'])});}});}})[_0xd592('0x14')](respondWithStatusCode(_0x39bfbf,null))[_0xd592('0x1f')](handleError(_0x39bfbf,null));};exports['addOpenchannelInteractions']=function(_0x5d452e,_0x170b8e){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x5d452e[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x170b8e,null))[_0xd592('0x14')](function(_0x2ac3f5){if(_0x2ac3f5){return _0x2ac3f5['addOpenchannelInteractions'](_0x5d452e[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x5d452e[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{})[_0xd592('0xb1')](function(){for(var _0x2880f7=0x0;_0x2880f7<_0x5d452e[_0xd592('0x64')][_0xd592('0x66')][_0xd592('0x4f')];_0x2880f7+=0x1){socket[_0xd592('0x2a')](_0xd592('0x13e'),{'OpenchannelInteractionId':Number(_0x5d452e[_0xd592('0x64')][_0xd592('0x66')][_0x2880f7]),'UserId':Number(_0x5d452e['params']['id'])});}return _0x5d452e[_0xd592('0x64')][_0xd592('0x66')];});}})[_0xd592('0x14')](respondWithResult(_0x170b8e,null))[_0xd592('0x1f')](handleError(_0x170b8e,null));};exports[_0xd592('0x13f')]=function(_0x19c35f,_0x5aee47){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x19c35f['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x5aee47,null))[_0xd592('0x14')](function(_0x2c9edf){if(_0x2c9edf){return _0x2c9edf[_0xd592('0x13f')](_0x19c35f[_0xd592('0x47')][_0xd592('0x66')])[_0xd592('0x14')](function(){if(_['isArray'](_0x19c35f[_0xd592('0x47')][_0xd592('0x66')])){for(var _0x2fa59a=0x0;_0x2fa59a<_0x19c35f[_0xd592('0x47')][_0xd592('0x66')][_0xd592('0x4f')];_0x2fa59a+=0x1){socket[_0xd592('0x2a')](_0xd592('0x140'),{'OpenchannelInteractionId':Number(_0x19c35f[_0xd592('0x47')][_0xd592('0x66')][_0x2fa59a]),'UserId':Number(_0x19c35f['params']['id'])});}}else{socket[_0xd592('0x2a')](_0xd592('0x140'),{'OpenchannelInteractionId':Number(_0x19c35f[_0xd592('0x47')][_0xd592('0x66')]),'UserId':Number(_0x19c35f[_0xd592('0x57')]['id'])});}});}})[_0xd592('0x14')](respondWithStatusCode(_0x5aee47,null))[_0xd592('0x1f')](handleError(_0x5aee47,null));};exports['addWhatsappInteractions']=function(_0xf0ffdc,_0x32dbfe){return db[_0xd592('0x3e')]['find']({'where':{'id':_0xf0ffdc[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x32dbfe,null))[_0xd592('0x14')](function(_0x251949){if(_0x251949){return _0x251949[_0xd592('0x141')](_0xf0ffdc[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0xf0ffdc[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{})[_0xd592('0xb1')](function(){for(var _0x2d43fe=0x0;_0x2d43fe<_0xf0ffdc['body'][_0xd592('0x66')][_0xd592('0x4f')];_0x2d43fe+=0x1){socket[_0xd592('0x2a')]('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0xf0ffdc[_0xd592('0x64')][_0xd592('0x66')][_0x2d43fe]),'UserId':Number(_0xf0ffdc[_0xd592('0x57')]['id'])});}return _0xf0ffdc[_0xd592('0x64')][_0xd592('0x66')];});}})[_0xd592('0x14')](respondWithResult(_0x32dbfe,null))['catch'](handleError(_0x32dbfe,null));};exports[_0xd592('0x142')]=function(_0x2cc529,_0x42bf25){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x2cc529['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x42bf25,null))['then'](function(_0x2b0a7b){if(_0x2b0a7b){return _0x2b0a7b[_0xd592('0x142')](_0x2cc529['query']['ids']);}})[_0xd592('0x14')](respondWithStatusCode(_0x42bf25,null))[_0xd592('0x1f')](handleError(_0x42bf25,null));};exports['getVoicePrefixes']=function(_0x515cdd,_0x563624){var _0x32685d={};var _0x1e6de7={};var _0x29985c;var _0x56c170;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x515cdd[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x563624,null))[_0xd592('0x14')](function(_0x531d99){if(_0x531d99){_0x29985c=_0x531d99;_0x1e6de7[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0x143')][_0xd592('0x3f')]);_0x1e6de7['query']=_[_0xd592('0x5a')](_0x515cdd[_0xd592('0x47')]);_0x1e6de7[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x1e6de7['model'],_0x1e6de7[_0xd592('0x47')]);_0x32685d[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x1e6de7['model'],qs[_0xd592('0x5e')](_0x515cdd[_0xd592('0x47')]['fields']));_0x32685d['attributes']=_0x32685d[_0xd592('0x5d')][_0xd592('0x4f')]?_0x32685d['attributes']:_0x1e6de7[_0xd592('0x58')];_0x32685d[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x515cdd[_0xd592('0x47')]['sort']);_0x32685d['where']=qs['filters'](_['pick'](_0x515cdd[_0xd592('0x47')],_0x1e6de7[_0xd592('0x5b')]));if(_0x515cdd[_0xd592('0x47')][_0xd592('0x32')]){_0x32685d['where']=_['merge'](_0x32685d[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x32685d['attributes'],function(_0xf0314){var _0x4d398e={};_0x4d398e[_0xf0314]={'$like':'%'+_0x515cdd[_0xd592('0x47')]['filter']+'%'};return _0x4d398e;})});}_0x32685d=_[_0xd592('0x60')]({},_0x32685d,_0x515cdd['options']);return _0x29985c['getVoicePrefixes'](_0x32685d);}})['then'](function(_0x367bac){if(_0x367bac){_0x56c170=_0x367bac[_0xd592('0x4f')];if(!_0x515cdd[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x32685d[_0xd592('0x26')]=qs['limit'](_0x515cdd['query'][_0xd592('0x26')]);_0x32685d[_0xd592('0x24')]=qs['offset'](_0x515cdd[_0xd592('0x47')][_0xd592('0x24')]);}return _0x29985c[_0xd592('0x144')](_0x32685d);}})[_0xd592('0x14')](function(_0x45b3e5){if(_0x45b3e5){return _0x45b3e5?{'count':_0x56c170,'rows':_0x45b3e5}:null;}})[_0xd592('0x14')](respondWithResult(_0x563624,null))[_0xd592('0x1f')](handleError(_0x563624,null));};exports[_0xd592('0x145')]=function(_0x4cbebc,_0x2d249b){var _0x512f48={};var _0x1ea312={};var _0x333042;var _0x343480;return db['User'][_0xd592('0x9f')]({'where':{'id':_0x4cbebc[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x2d249b,null))[_0xd592('0x14')](function(_0x21704d){if(_0x21704d){_0x333042=_0x21704d;_0x1ea312['model']=_[_0xd592('0x5a')](db[_0xd592('0x146')]['rawAttributes']);_0x1ea312[_0xd592('0x47')]=_['keys'](_0x4cbebc[_0xd592('0x47')]);_0x1ea312[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x1ea312[_0xd592('0x58')],_0x1ea312['query']);_0x512f48[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x1ea312['model'],qs[_0xd592('0x5e')](_0x4cbebc[_0xd592('0x47')][_0xd592('0x5e')]));_0x512f48['attributes']=_0x512f48[_0xd592('0x5d')]['length']?_0x512f48[_0xd592('0x5d')]:_0x1ea312[_0xd592('0x58')];_0x512f48[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x4cbebc[_0xd592('0x47')]['sort']);_0x512f48[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x4cbebc[_0xd592('0x47')],_0x1ea312[_0xd592('0x5b')]));if(_0x4cbebc[_0xd592('0x47')][_0xd592('0x32')]){_0x512f48['where']=_[_0xd592('0x60')](_0x512f48[_0xd592('0x46')],{'$or':_['map'](_0x512f48[_0xd592('0x5d')],function(_0x18937c){var _0x4f0763={};_0x4f0763[_0x18937c]={'$like':'%'+_0x4cbebc['query']['filter']+'%'};return _0x4f0763;})});}_0x512f48=_[_0xd592('0x60')]({},_0x512f48,_0x4cbebc['options']);return _0x333042['getFaxAccounts'](_0x512f48);}})[_0xd592('0x14')](function(_0x14c2cc){if(_0x14c2cc){_0x343480=_0x14c2cc[_0xd592('0x4f')];if(!_0x4cbebc['query'][_0xd592('0xd9')](_0xd592('0xdf'))){_0x512f48[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x4cbebc['query']['limit']);_0x512f48[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x4cbebc[_0xd592('0x47')][_0xd592('0x24')]);}return _0x333042[_0xd592('0x145')](_0x512f48);}})[_0xd592('0x14')](function(_0x28d099){if(_0x28d099){return _0x28d099?{'count':_0x343480,'rows':_0x28d099}:null;}})[_0xd592('0x14')](respondWithResult(_0x2d249b,null))[_0xd592('0x1f')](handleError(_0x2d249b,null));};exports['addFaxAccounts']=function(_0x1a4c0b,_0x49335e){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x1a4c0b[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x49335e,null))[_0xd592('0x14')](function(_0x26a91b){if(_0x26a91b){return _0x26a91b[_0xd592('0x147')](_0x1a4c0b[_0xd592('0x64')][_0xd592('0x66')],_['omit'](_0x1a4c0b[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{});}})[_0xd592('0x14')](respondWithResult(_0x49335e,null))['catch'](handleError(_0x49335e,null));};exports['removeFaxAccounts']=function(_0x42e7bc,_0x58478e){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x42e7bc['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x58478e,null))[_0xd592('0x14')](function(_0x4def25){if(_0x4def25){return _0x4def25[_0xd592('0x148')](_0x42e7bc[_0xd592('0x47')][_0xd592('0x66')]);}})[_0xd592('0x14')](respondWithStatusCode(_0x58478e,null))[_0xd592('0x1f')](handleError(_0x58478e,null));};exports[_0xd592('0x149')]=function(_0xe5431f,_0x50a83d){var _0x2d8d95={};var _0x31ecd3={};var _0x1f20d8;var _0x4b550c;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0xe5431f[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x50a83d,null))[_0xd592('0x14')](function(_0x201f5b){if(_0x201f5b){_0x1f20d8=_0x201f5b;_0x31ecd3[_0xd592('0x58')]=_['keys'](db[_0xd592('0x14a')]['rawAttributes']);_0x31ecd3[_0xd592('0x47')]=_['keys'](_0xe5431f[_0xd592('0x47')]);_0x31ecd3['filters']=_[_0xd592('0x5c')](_0x31ecd3[_0xd592('0x58')],_0x31ecd3['query']);_0x2d8d95[_0xd592('0x5d')]=_['intersection'](_0x31ecd3[_0xd592('0x58')],qs[_0xd592('0x5e')](_0xe5431f[_0xd592('0x47')][_0xd592('0x5e')]));_0x2d8d95[_0xd592('0x5d')]=_0x2d8d95['attributes']['length']?_0x2d8d95[_0xd592('0x5d')]:_0x31ecd3[_0xd592('0x58')];_0x2d8d95[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0xe5431f[_0xd592('0x47')][_0xd592('0xd7')]);_0x2d8d95[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0xe5431f['query'],_0x31ecd3[_0xd592('0x5b')]));if(_0xe5431f[_0xd592('0x47')][_0xd592('0x32')]){_0x2d8d95['where']=_[_0xd592('0x60')](_0x2d8d95[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x2d8d95[_0xd592('0x5d')],function(_0x4dc773){var _0x33e3fc={};_0x33e3fc[_0x4dc773]={'$like':'%'+_0xe5431f[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x33e3fc;})});}_0x2d8d95=_['merge']({},_0x2d8d95,_0xe5431f['options']);return _0x1f20d8[_0xd592('0x149')](_0x2d8d95);}})[_0xd592('0x14')](function(_0x4c377){if(_0x4c377){_0x4b550c=_0x4c377['length'];if(!_0xe5431f[_0xd592('0x47')]['hasOwnProperty']('nolimit')){_0x2d8d95['limit']=qs['limit'](_0xe5431f[_0xd592('0x47')]['limit']);_0x2d8d95['offset']=qs[_0xd592('0x24')](_0xe5431f[_0xd592('0x47')][_0xd592('0x24')]);}return _0x1f20d8[_0xd592('0x149')](_0x2d8d95);}})['then'](function(_0xec50b0){if(_0xec50b0){return _0xec50b0?{'count':_0x4b550c,'rows':_0xec50b0}:null;}})['then'](respondWithResult(_0x50a83d,null))['catch'](handleError(_0x50a83d,null));};exports['addMailAccounts']=function(_0x4d54e3,_0x320a93){return db['User'][_0xd592('0x37')]({'where':{'id':_0x4d54e3[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x320a93,null))[_0xd592('0x14')](function(_0x289aba){if(_0x289aba){return _0x289aba[_0xd592('0x14b')](_0x4d54e3['body'][_0xd592('0x66')],_[_0xd592('0x67')](_0x4d54e3[_0xd592('0x64')],['ids','id'])||{});}})['then'](respondWithResult(_0x320a93,null))[_0xd592('0x1f')](handleError(_0x320a93,null));};exports[_0xd592('0x14c')]=function(_0x252f46,_0x1d1121){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x252f46[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1d1121,null))[_0xd592('0x14')](function(_0x3e4f04){if(_0x3e4f04){return _0x3e4f04[_0xd592('0x14c')](_0x252f46[_0xd592('0x47')][_0xd592('0x66')]);}})[_0xd592('0x14')](respondWithStatusCode(_0x1d1121,null))[_0xd592('0x1f')](handleError(_0x1d1121,null));};exports['getOpenchannelAccounts']=function(_0x157963,_0x1daede){var _0x4fce77={};var _0xbae077={};var _0x301b2a;var _0x5a2370;return db[_0xd592('0x3e')]['findOne']({'where':{'id':_0x157963['params']['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1daede,null))[_0xd592('0x14')](function(_0x3042a2){if(_0x3042a2){_0x301b2a=_0x3042a2;_0xbae077['model']=_['keys'](db[_0xd592('0x14d')][_0xd592('0x3f')]);_0xbae077[_0xd592('0x47')]=_['keys'](_0x157963[_0xd592('0x47')]);_0xbae077[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0xbae077[_0xd592('0x58')],_0xbae077[_0xd592('0x47')]);_0x4fce77[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0xbae077[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x157963[_0xd592('0x47')][_0xd592('0x5e')]));_0x4fce77[_0xd592('0x5d')]=_0x4fce77['attributes']['length']?_0x4fce77['attributes']:_0xbae077['model'];_0x4fce77['order']=qs[_0xd592('0xd7')](_0x157963[_0xd592('0x47')][_0xd592('0xd7')]);_0x4fce77[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x157963[_0xd592('0x47')],_0xbae077['filters']));if(_0x157963[_0xd592('0x47')][_0xd592('0x32')]){_0x4fce77[_0xd592('0x46')]=_['merge'](_0x4fce77[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x4fce77['attributes'],function(_0x36ac06){var _0x2b5998={};_0x2b5998[_0x36ac06]={'$like':'%'+_0x157963[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x2b5998;})});}_0x4fce77=_[_0xd592('0x60')]({},_0x4fce77,_0x157963[_0xd592('0x61')]);return _0x301b2a[_0xd592('0x14e')](_0x4fce77);}})[_0xd592('0x14')](function(_0x478fbe){if(_0x478fbe){_0x5a2370=_0x478fbe[_0xd592('0x4f')];if(!_0x157963[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x4fce77[_0xd592('0x26')]=qs['limit'](_0x157963[_0xd592('0x47')][_0xd592('0x26')]);_0x4fce77[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x157963[_0xd592('0x47')][_0xd592('0x24')]);}return _0x301b2a[_0xd592('0x14e')](_0x4fce77);}})[_0xd592('0x14')](function(_0x1098a9){if(_0x1098a9){return _0x1098a9?{'count':_0x5a2370,'rows':_0x1098a9}:null;}})['then'](respondWithResult(_0x1daede,null))[_0xd592('0x1f')](handleError(_0x1daede,null));};exports[_0xd592('0x14f')]=function(_0x13d086,_0x45a98a){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x13d086[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x45a98a,null))[_0xd592('0x14')](function(_0xecccfe){if(_0xecccfe){return _0xecccfe['addOpenchannelAccounts'](_0x13d086[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x13d086[_0xd592('0x64')],['ids','id'])||{});}})[_0xd592('0x14')](respondWithResult(_0x45a98a,null))['catch'](handleError(_0x45a98a,null));};exports[_0xd592('0x150')]=function(_0x188853,_0x35aeaa){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x188853[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x35aeaa,null))[_0xd592('0x14')](function(_0x5b68a8){if(_0x5b68a8){return _0x5b68a8['removeOpenchannelAccounts'](_0x188853['query'][_0xd592('0x66')]);}})[_0xd592('0x14')](respondWithStatusCode(_0x35aeaa,null))[_0xd592('0x1f')](handleError(_0x35aeaa,null));};exports[_0xd592('0x151')]=function(_0x26dfb5,_0xf9946b){var _0x101af9={};var _0x37fdbf={};var _0x569cc6;var _0x411018;return db['User'][_0xd592('0x9f')]({'where':{'id':_0x26dfb5[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0xf9946b,null))[_0xd592('0x14')](function(_0x85996){if(_0x85996){_0x569cc6=_0x85996;_0x37fdbf[_0xd592('0x58')]=_['keys'](db[_0xd592('0x152')][_0xd592('0x3f')]);_0x37fdbf[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x26dfb5[_0xd592('0x47')]);_0x37fdbf[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x37fdbf[_0xd592('0x58')],_0x37fdbf[_0xd592('0x47')]);_0x101af9[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x37fdbf[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x26dfb5['query']['fields']));_0x101af9[_0xd592('0x5d')]=_0x101af9[_0xd592('0x5d')][_0xd592('0x4f')]?_0x101af9[_0xd592('0x5d')]:_0x37fdbf[_0xd592('0x58')];_0x101af9[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x26dfb5[_0xd592('0x47')][_0xd592('0xd7')]);_0x101af9[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x26dfb5[_0xd592('0x47')],_0x37fdbf[_0xd592('0x5b')]));if(_0x26dfb5[_0xd592('0x47')][_0xd592('0x32')]){_0x101af9[_0xd592('0x46')]=_[_0xd592('0x60')](_0x101af9[_0xd592('0x46')],{'$or':_['map'](_0x101af9['attributes'],function(_0x3f07a6){var _0x68c64a={};_0x68c64a[_0x3f07a6]={'$like':'%'+_0x26dfb5[_0xd592('0x47')]['filter']+'%'};return _0x68c64a;})});}_0x101af9=_[_0xd592('0x60')]({},_0x101af9,_0x26dfb5[_0xd592('0x61')]);return _0x569cc6['getSmsAccounts'](_0x101af9);}})[_0xd592('0x14')](function(_0x3bb0c2){if(_0x3bb0c2){_0x411018=_0x3bb0c2[_0xd592('0x4f')];if(!_0x26dfb5[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x101af9[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x26dfb5['query'][_0xd592('0x26')]);_0x101af9['offset']=qs[_0xd592('0x24')](_0x26dfb5['query']['offset']);}return _0x569cc6[_0xd592('0x151')](_0x101af9);}})[_0xd592('0x14')](function(_0x4da73f){if(_0x4da73f){return _0x4da73f?{'count':_0x411018,'rows':_0x4da73f}:null;}})[_0xd592('0x14')](respondWithResult(_0xf9946b,null))[_0xd592('0x1f')](handleError(_0xf9946b,null));};exports[_0xd592('0x153')]=function(_0x3a709f,_0x4e37c6){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x3a709f['params']['id']}})['then'](handleEntityNotFound(_0x4e37c6,null))[_0xd592('0x14')](function(_0x47b509){if(_0x47b509){return _0x47b509['addSmsAccounts'](_0x3a709f[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x3a709f[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{});}})[_0xd592('0x14')](respondWithResult(_0x4e37c6,null))[_0xd592('0x1f')](handleError(_0x4e37c6,null));};exports[_0xd592('0x154')]=function(_0x208444,_0x52d535){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x208444[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x52d535,null))[_0xd592('0x14')](function(_0x113f52){if(_0x113f52){return _0x113f52['removeSmsAccounts'](_0x208444[_0xd592('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x52d535,null))[_0xd592('0x1f')](handleError(_0x52d535,null));};exports[_0xd592('0x155')]=function(_0x2793d3,_0x5ec288){var _0x257760={};var _0x47d7f9={};var _0x13b178;var _0x560f45;return db[_0xd592('0x3e')]['findOne']({'where':{'id':_0x2793d3[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x5ec288,null))['then'](function(_0x41f654){if(_0x41f654){_0x13b178=_0x41f654;_0x47d7f9[_0xd592('0x58')]=_[_0xd592('0x5a')](db[_0xd592('0x156')]['rawAttributes']);_0x47d7f9['query']=_[_0xd592('0x5a')](_0x2793d3[_0xd592('0x47')]);_0x47d7f9[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x47d7f9['model'],_0x47d7f9[_0xd592('0x47')]);_0x257760[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x47d7f9[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x2793d3[_0xd592('0x47')][_0xd592('0x5e')]));_0x257760[_0xd592('0x5d')]=_0x257760[_0xd592('0x5d')][_0xd592('0x4f')]?_0x257760[_0xd592('0x5d')]:_0x47d7f9['model'];_0x257760[_0xd592('0xd6')]=qs[_0xd592('0xd7')](_0x2793d3[_0xd592('0x47')][_0xd592('0xd7')]);_0x257760[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x2793d3[_0xd592('0x47')],_0x47d7f9[_0xd592('0x5b')]));if(_0x2793d3[_0xd592('0x47')][_0xd592('0x32')]){_0x257760[_0xd592('0x46')]=_[_0xd592('0x60')](_0x257760[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x257760['attributes'],function(_0x40a61b){var _0x200927={};_0x200927[_0x40a61b]={'$like':'%'+_0x2793d3[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x200927;})});}_0x257760=_[_0xd592('0x60')]({},_0x257760,_0x2793d3['options']);return _0x13b178[_0xd592('0x155')](_0x257760);}})[_0xd592('0x14')](function(_0x48a8b4){if(_0x48a8b4){_0x560f45=_0x48a8b4['length'];if(!_0x2793d3['query'][_0xd592('0xd9')](_0xd592('0xdf'))){_0x257760[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x2793d3[_0xd592('0x47')]['limit']);_0x257760['offset']=qs[_0xd592('0x24')](_0x2793d3['query'][_0xd592('0x24')]);}return _0x13b178[_0xd592('0x155')](_0x257760);}})['then'](function(_0x5f57a7){if(_0x5f57a7){return _0x5f57a7?{'count':_0x560f45,'rows':_0x5f57a7}:null;}})[_0xd592('0x14')](respondWithResult(_0x5ec288,null))['catch'](handleError(_0x5ec288,null));};exports['addChatWebsites']=function(_0x536238,_0x529848){return db[_0xd592('0x3e')]['find']({'where':{'id':_0x536238[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x529848,null))[_0xd592('0x14')](function(_0x4b66a){if(_0x4b66a){return _0x4b66a[_0xd592('0x157')](_0x536238[_0xd592('0x64')]['ids'],_[_0xd592('0x67')](_0x536238['body'],['ids','id'])||{});}})[_0xd592('0x14')](respondWithResult(_0x529848,null))['catch'](handleError(_0x529848,null));};exports[_0xd592('0x158')]=function(_0x3701a9,_0x1daae3){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x3701a9[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x1daae3,null))[_0xd592('0x14')](function(_0x41a11c){if(_0x41a11c){return _0x41a11c[_0xd592('0x158')](_0x3701a9[_0xd592('0x47')]['ids']);}})[_0xd592('0x14')](respondWithStatusCode(_0x1daae3,null))['catch'](handleError(_0x1daae3,null));};exports[_0xd592('0x159')]=function(_0x325b60,_0x925b5e){var _0x492aa9={};var _0x5c155d={};var _0x2f13b6;var _0x290472;return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x325b60[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x925b5e,null))[_0xd592('0x14')](function(_0x5550e0){if(_0x5550e0){_0x2f13b6=_0x5550e0;_0x5c155d['model']=_[_0xd592('0x5a')](db['WhatsappAccount'][_0xd592('0x3f')]);_0x5c155d[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x325b60[_0xd592('0x47')]);_0x5c155d[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x5c155d[_0xd592('0x58')],_0x5c155d['query']);_0x492aa9[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x5c155d['model'],qs[_0xd592('0x5e')](_0x325b60['query'][_0xd592('0x5e')]));_0x492aa9[_0xd592('0x5d')]=_0x492aa9[_0xd592('0x5d')][_0xd592('0x4f')]?_0x492aa9[_0xd592('0x5d')]:_0x5c155d[_0xd592('0x58')];_0x492aa9['order']=qs[_0xd592('0xd7')](_0x325b60[_0xd592('0x47')]['sort']);_0x492aa9[_0xd592('0x46')]=qs['filters'](_['pick'](_0x325b60[_0xd592('0x47')],_0x5c155d[_0xd592('0x5b')]));if(_0x325b60[_0xd592('0x47')][_0xd592('0x32')]){_0x492aa9[_0xd592('0x46')]=_['merge'](_0x492aa9[_0xd592('0x46')],{'$or':_[_0xd592('0x34')](_0x492aa9[_0xd592('0x5d')],function(_0x16ea8b){var _0x16f26b={};_0x16f26b[_0x16ea8b]={'$like':'%'+_0x325b60[_0xd592('0x47')][_0xd592('0x32')]+'%'};return _0x16f26b;})});}_0x492aa9=_[_0xd592('0x60')]({},_0x492aa9,_0x325b60[_0xd592('0x61')]);return _0x2f13b6['getWhatsappAccounts'](_0x492aa9);}})[_0xd592('0x14')](function(_0x47aebf){if(_0x47aebf){_0x290472=_0x47aebf[_0xd592('0x4f')];if(!_0x325b60[_0xd592('0x47')]['hasOwnProperty'](_0xd592('0xdf'))){_0x492aa9[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x325b60[_0xd592('0x47')][_0xd592('0x26')]);_0x492aa9[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x325b60[_0xd592('0x47')]['offset']);}return _0x2f13b6['getWhatsappAccounts'](_0x492aa9);}})[_0xd592('0x14')](function(_0x43d578){if(_0x43d578){return _0x43d578?{'count':_0x290472,'rows':_0x43d578}:null;}})[_0xd592('0x14')](respondWithResult(_0x925b5e,null))[_0xd592('0x1f')](handleError(_0x925b5e,null));};exports[_0xd592('0x15a')]=function(_0x554665,_0x372d65){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x554665[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x372d65,null))[_0xd592('0x14')](function(_0x1ebd58){if(_0x1ebd58){return _0x1ebd58[_0xd592('0x15a')](_0x554665[_0xd592('0x64')][_0xd592('0x66')],_['omit'](_0x554665[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{});}})['then'](respondWithResult(_0x372d65,null))[_0xd592('0x1f')](handleError(_0x372d65,null));};exports['removeWhatsappAccounts']=function(_0x3ab772,_0x4e9f48){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x3ab772[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x4e9f48,null))[_0xd592('0x14')](function(_0x4fa08f){if(_0x4fa08f){return _0x4fa08f[_0xd592('0x15b')](_0x3ab772['query'][_0xd592('0x66')]);}})['then'](respondWithStatusCode(_0x4e9f48,null))[_0xd592('0x1f')](handleError(_0x4e9f48,null));};exports[_0xd592('0x15c')]=function(_0x2585be,_0x4a1b0c){var _0x3fb7b9={};var _0x5bde17={};var _0x5051db;var _0x320328;return db[_0xd592('0x3e')]['findOne']({'where':{'id':_0x2585be['params']['id']}})['then'](handleEntityNotFound(_0x4a1b0c,null))[_0xd592('0x14')](function(_0xd2bf){if(_0xd2bf){_0x5051db=_0xd2bf;_0x5bde17[_0xd592('0x58')]=_['keys'](db[_0xd592('0x15d')][_0xd592('0x3f')]);_0x5bde17[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x2585be[_0xd592('0x47')]);_0x5bde17[_0xd592('0x5b')]=_[_0xd592('0x5c')](_0x5bde17['model'],_0x5bde17['query']);_0x3fb7b9[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x5bde17[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x2585be['query'][_0xd592('0x5e')]));_0x3fb7b9[_0xd592('0x5d')]=_0x3fb7b9[_0xd592('0x5d')][_0xd592('0x4f')]?_0x3fb7b9[_0xd592('0x5d')]:_0x5bde17['model'];_0x3fb7b9['order']=qs[_0xd592('0xd7')](_0x2585be[_0xd592('0x47')][_0xd592('0xd7')]);_0x3fb7b9[_0xd592('0x46')]=qs[_0xd592('0x5b')](_[_0xd592('0xd8')](_0x2585be[_0xd592('0x47')],_0x5bde17[_0xd592('0x5b')]));if(_0x2585be[_0xd592('0x47')][_0xd592('0x32')]){_0x3fb7b9[_0xd592('0x46')]=_[_0xd592('0x60')](_0x3fb7b9[_0xd592('0x46')],{'$or':_['map'](_0x3fb7b9[_0xd592('0x5d')],function(_0x3f2323){var _0x45b473={};_0x45b473[_0x3f2323]={'$like':'%'+_0x2585be['query'][_0xd592('0x32')]+'%'};return _0x45b473;})});}_0x3fb7b9=_['merge']({},_0x3fb7b9,_0x2585be[_0xd592('0x61')]);return _0x5051db[_0xd592('0x15c')](_0x3fb7b9);}})['then'](function(_0x23f302){if(_0x23f302){_0x320328=_0x23f302['length'];if(!_0x2585be[_0xd592('0x47')][_0xd592('0xd9')]('nolimit')){_0x3fb7b9[_0xd592('0x26')]=qs[_0xd592('0x26')](_0x2585be[_0xd592('0x47')][_0xd592('0x26')]);_0x3fb7b9[_0xd592('0x24')]=qs[_0xd592('0x24')](_0x2585be[_0xd592('0x47')]['offset']);}return _0x5051db['getSquareProjects'](_0x3fb7b9);}})['then'](function(_0x3ffff8){if(_0x3ffff8){return _0x3ffff8?{'count':_0x320328,'rows':_0x3ffff8}:null;}})[_0xd592('0x14')](respondWithResult(_0x4a1b0c,null))[_0xd592('0x1f')](handleError(_0x4a1b0c,null));};exports[_0xd592('0x15e')]=function(_0x2995db,_0x27e092){return db['User']['find']({'where':{'id':_0x2995db[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x27e092,null))[_0xd592('0x14')](function(_0x121bf1){if(_0x121bf1){return _0x121bf1[_0xd592('0x15e')](_0x2995db[_0xd592('0x64')][_0xd592('0x66')],_[_0xd592('0x67')](_0x2995db[_0xd592('0x64')],[_0xd592('0x66'),'id'])||{});}})['then'](respondWithResult(_0x27e092,null))[_0xd592('0x1f')](handleError(_0x27e092,null));};exports['removeSquareProjects']=function(_0x2d29d8,_0x55bfa9){return db[_0xd592('0x3e')][_0xd592('0x37')]({'where':{'id':_0x2d29d8[_0xd592('0x57')]['id']}})['then'](handleEntityNotFound(_0x55bfa9,null))[_0xd592('0x14')](function(_0x24ec7e){if(_0x24ec7e){return _0x24ec7e[_0xd592('0x15f')](_0x2d29d8[_0xd592('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x55bfa9,null))['catch'](handleError(_0x55bfa9,null));};exports['getScheduledCalls']=function(_0x1ab319,_0x5cccde){var _0x6c8718={},_0x351443={},_0x3dbcd6={'count':0x0,'rows':[]};var _0x206fa3=db['CmHopper'][_0xd592('0x3f')];_0x351443['model']=_['keys'](_0x206fa3);_0x351443[_0xd592('0x47')]=_[_0xd592('0x5a')](_0x1ab319['query']);_0x351443['filters']=_[_0xd592('0x5c')](_0x351443[_0xd592('0x58')],_0x351443[_0xd592('0x47')]);_0x351443[_0xd592('0x5b')]=_[_0xd592('0xd3')](_0x351443['filters'],[_0xd592('0x160'),'$or','$gt',_0xd592('0x161'),_0xd592('0x162'),_0xd592('0x163'),_0xd592('0x164'),_0xd592('0x165'),_0xd592('0x166'),_0xd592('0x167'),'$notBetween',_0xd592('0x168'),_0xd592('0x169'),'$like',_0xd592('0x16a'),_0xd592('0x16b'),_0xd592('0x16c'),'$like',_0xd592('0x16d'),_0xd592('0x16e'),_0xd592('0x16f'),_0xd592('0x170')]);_0x6c8718[_0xd592('0x5d')]=_[_0xd592('0x5c')](_0x351443[_0xd592('0x58')],qs[_0xd592('0x5e')](_0x1ab319[_0xd592('0x47')][_0xd592('0x5e')]));_0x6c8718['attributes']=_0x6c8718[_0xd592('0x5d')][_0xd592('0x4f')]?_0x6c8718['attributes']:_0x351443['model'];if(!_0x1ab319['query'][_0xd592('0xd9')](_0xd592('0xdf'))){_0x6c8718['limit']=qs[_0xd592('0x26')](_0x1ab319[_0xd592('0x47')][_0xd592('0x26')]);_0x6c8718[_0xd592('0x24')]=qs['offset'](_0x1ab319['query'][_0xd592('0x24')]);}_0x6c8718['order']=qs[_0xd592('0xd7')](_0x1ab319[_0xd592('0x47')][_0xd592('0xd7')]);_0x6c8718[_0xd592('0x46')]=qs['filters'](_[_0xd592('0xd8')](_0x1ab319[_0xd592('0x47')],_0x351443[_0xd592('0x5b')]));if(_0x1ab319[_0xd592('0x47')][_0xd592('0x32')]){_0x6c8718[_0xd592('0x46')]=_['merge'](_0x6c8718[_0xd592('0x46')],{'$or':_['map'](_0x6c8718[_0xd592('0x5d')],function(_0x5cacb2){var _0x2a0024={};_0x2a0024[_0x5cacb2]={'$like':'%'+_0x1ab319[_0xd592('0x47')]['filter']+'%'};return _0x2a0024;})});}_0x6c8718['where']={'$and':[_0x6c8718[_0xd592('0x46')],{'$or':[{'UserId':_0x1ab319[_0xd592('0x57')]['id']},{'OwnerId':_0x1ab319['params']['id']}]}]};_0x6c8718=_[_0xd592('0x60')]({},_0x6c8718,_0x1ab319[_0xd592('0x61')]);var _0x4a403c={'where':_0x6c8718[_0xd592('0x46')]};return db[_0xd592('0x171')][_0xd592('0x27')](_0x4a403c)['then'](function(_0x570924){_0x3dbcd6[_0xd592('0x27')]=_0x570924;if(_0x1ab319['query'][_0xd592('0x48')]){_0x6c8718['include']=[{'attributes':['id',_0xd592('0x172'),_0xd592('0x173'),_0xd592('0x174')],'model':db[_0xd592('0xd5')],'as':_0xd592('0x175')},{'attributes':['id',_0xd592('0x38'),_0xd592('0x176')],'model':db['VoiceQueue'],'as':_0xd592('0xe1')}];}return db[_0xd592('0x171')]['findAll'](_0x6c8718);})[_0xd592('0x14')](function(_0x2ffb90){_0x3dbcd6[_0xd592('0x4e')]=_0x2ffb90;return _0x3dbcd6;})[_0xd592('0x14')](respondWithFilteredResult(_0x5cccde,_0x6c8718))[_0xd592('0x1f')](handleError(_0x5cccde,null));};exports[_0xd592('0x177')]=function(_0x23f0ad,_0x481f5f){if(!_['isNil'](_0x23f0ad[_0xd592('0x87')]['id'])&&(_0x23f0ad[_0xd592('0x87')][_0xd592('0x79')]==_0xd592('0x2d')||_0x23f0ad[_0xd592('0x87')]['role']==_0xd592('0x87'))){return db[_0xd592('0x3e')][_0xd592('0x9f')]({'where':{'id':_0x23f0ad[_0xd592('0x57')]['id']},'raw':!![]})[_0xd592('0x14')](function(_0x3d766e){return authService['retrieveApiKey'](_0x3d766e);})[_0xd592('0x14')](function(_0x4bfb8c){if(_0x4bfb8c){return _0x481f5f[_0xd592('0x22')](0xc8)[_0xd592('0x23')]({'api_key':_0x4bfb8c[_0xd592('0x178')]});}else{return _0x481f5f[_0xd592('0x22')](0xcc)['json']({'message':_0xd592('0x179')});}})[_0xd592('0x1f')](handleError(_0x481f5f,0x193));}else{return _0x481f5f[_0xd592('0x22')](0x191)[_0xd592('0x23')]({'message':_0xd592('0x17a')});}};exports[_0xd592('0x17b')]=function(_0x3cf4f9,_0x5d88f7){if(!_[_0xd592('0x73')](_0x3cf4f9['user']['id'])&&(_0x3cf4f9[_0xd592('0x87')][_0xd592('0x79')]==_0xd592('0x2d')||_0x3cf4f9['user'][_0xd592('0x79')]==_0xd592('0x87'))){return db['User'][_0xd592('0x37')]({'where':{'id':_0x3cf4f9[_0xd592('0x57')]['id']}})[_0xd592('0x14')](function(_0x5bbc88){return authService['generateApiKey'](_0x5bbc88);})[_0xd592('0x14')](function(_0x3e0a9d){return db[_0xd592('0x3e')]['update']({'apiKeyIat':_0x3e0a9d[_0xd592('0x17c')],'apiKeyNonce':_0x3e0a9d[_0xd592('0x17d')]},{'where':{'id':_0x3cf4f9[_0xd592('0x57')]['id']}})[_0xd592('0x14')](function(){return _0x5d88f7[_0xd592('0x22')](0xc8)[_0xd592('0x23')]({'api_key':_0x3e0a9d[_0xd592('0x178')]});});})[_0xd592('0x1f')](handleError(_0x5d88f7,0x193));}else{return _0x5d88f7[_0xd592('0x22')](0x191)['json']({'message':_0xd592('0x17a')});}};exports[_0xd592('0x17e')]=function(_0x40276f,_0x174ae7){if(!_[_0xd592('0x73')](_0x40276f['user']['id'])&&(_0x40276f[_0xd592('0x87')][_0xd592('0x79')]==_0xd592('0x2d')||_0x40276f[_0xd592('0x87')]['role']==_0xd592('0x87'))){return db['User'][_0xd592('0x37')]({'where':{'id':_0x40276f[_0xd592('0x57')]['id']}})[_0xd592('0x14')](handleEntityNotFound(_0x174ae7,null))[_0xd592('0x14')](function(_0x4234ed){if(_0x4234ed&&_0x4234ed['apiKeyNonce']&&_0x4234ed['apiKeyIat'])return _0x4234ed;else throw{'message':_0xd592('0x17f')};})['then'](function(){return db['User'][_0xd592('0x29')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x40276f[_0xd592('0x57')]['id']}});})[_0xd592('0x14')](respondWithStatusCode(_0x174ae7,0xc8))[_0xd592('0x1f')](handleError(_0x174ae7,0x193));}else{return _0x174ae7[_0xd592('0x22')](0x191)['json']({'message':_0xd592('0x17a')});}};exports[_0xd592('0x180')]=function(_0x4d70d4,_0x90a530){var _0x24028e=_0x4d70d4[_0xd592('0x87')][_0xd592('0x2c')]({'plain':!![]});if(!_0x24028e){return _0x90a530[_0xd592('0x22')](0x191)[_0xd592('0x3c')](_0xd592('0x181'));}else{Promise['resolve']()[_0xd592('0x14')](function(){if(_0x4d70d4[_0xd592('0x47')][_0xd592('0x49')]!==_0xd592('0x5f'))return;return _0x4d70d4['user'][_0xd592('0x182')]();})[_0xd592('0x14')](function(_0x3e04ba){if(!_0x3e04ba)return;return _0x3e04ba['get']({'plain':!![]});})[_0xd592('0x14')](function(_0xdbc35a){_0x24028e['userSetting']=_0xdbc35a;return _0x90a530[_0xd592('0x22')](0xc8)['json'](_0x24028e);});}};exports[_0xd592('0x183')]=function(_0x3ebd60,_0x18bbb4){var _0x455dee={'offset':0x0},_0x200002={'count':0x0,'rows':[]};Promise[_0xd592('0x10b')]()['then'](function(){if(!_0x3ebd60[_0xd592('0x47')]['filter']&&!_0x3ebd60['query']['teams']&&!_0x3ebd60[_0xd592('0x47')][_0xd592('0x184')])return[];return Promise['resolve']()['then'](function(){var _0x920664=[];if(!_['isEmpty'](_0x3ebd60['query'][_0xd592('0x185')])){_0x920664['push'](db[_0xd592('0x11f')]['findAll']({'attributes':['id',_0xd592('0x38')],'where':{'id':_0x3ebd60[_0xd592('0x47')]['teams']}}));}if(!_[_0xd592('0x93')](_0x3ebd60[_0xd592('0x47')][_0xd592('0x184')])){_0x920664['push'](db[_0xd592('0xb4')][_0xd592('0x92')]({'attributes':['id',_0xd592('0x38')],'type':_0xd592('0x186'),'where':{'id':_0x3ebd60[_0xd592('0x47')][_0xd592('0x184')]}}));}return Promise['all'](_0x920664);})[_0xd592('0x14')](function(_0x2c8b20){var _0x2e8f26=_['flatten'](_0x2c8b20)[_0xd592('0x34')](function(_0x5d6a83){return _0x5d6a83['getAgents']({'attributes':['id',_0xd592('0x38'),'internal',_0xd592('0xa7')],'raw':!![]});});return Promise['all'](_0x2e8f26);})[_0xd592('0x14')](function(_0x39972c){var _0x5b2e03=_['flatten'](_0x39972c);if(!_0x3ebd60[_0xd592('0x47')][_0xd592('0x32')])return _0x5b2e03;if(_['isEmpty'](_0x5b2e03)){return db[_0xd592('0x3e')]['findAll']({'attributes':['id',_0xd592('0x38'),_0xd592('0x68'),'online'],'where':{'role':_0xd592('0x2f'),'$or':[db[_0xd592('0x6e')][_0xd592('0x46')](db[_0xd592('0x6e')]['fn']('lower',db[_0xd592('0x6e')][_0xd592('0x187')](_0xd592('0x38'))),{'$like':'%'+_0x3ebd60['query'][_0xd592('0x32')][_0xd592('0xaf')]()+'%'}),{'internal':{'$like':'%'+_0x3ebd60[_0xd592('0x47')][_0xd592('0x32')]+'%'}}]},'raw':!![]});}else{return _(_0x5b2e03)['flatten']()[_0xd592('0x32')](function(_0x10670a){return _0x10670a['name'][_0xd592('0xaf')]()['includes'](_0x3ebd60['query'][_0xd592('0x32')][_0xd592('0xaf')]())||_0x10670a[_0xd592('0x68')][_0xd592('0x188')]()['includes'](_0x3ebd60[_0xd592('0x47')][_0xd592('0x32')]);})['value']();}})[_0xd592('0x14')](function(_0x2464ac){var _0x4748ae=_0xd592('0x38');var _0x1b1edb=_0xd592('0x189');if(_0x3ebd60[_0xd592('0x47')]['sort']){_0x1b1edb=_0x3ebd60['query'][_0xd592('0xd7')][0x0]==='-'?_0xd592('0x18a'):_0xd592('0x189');_0x4748ae=_0x1b1edb==='asc'?_0x3ebd60[_0xd592('0x47')][_0xd592('0xd7')]:_0x3ebd60[_0xd592('0x47')]['sort'][_0xd592('0x18b')](0x1);}return _(_0x2464ac)[_0xd592('0x18c')]('id')[_0xd592('0x18d')]([function(_0xf3f205){return _0x4748ae===_0xd592('0x38')?_0xf3f205[_0x4748ae][_0xd592('0xaf')]():_0xf3f205[_0x4748ae];}],[_0x1b1edb])[_0xd592('0x34')](function(_0x13060f){return _['pick'](_0x13060f,['id',_0xd592('0x38'),'internal',_0xd592('0xa7')]);})[_0xd592('0x35')]();})[_0xd592('0x14')](function(_0x3ba1b7){return amiClient['request']('Agents',_0x3ebd60)['then'](function(_0x37152b){if(_0x37152b[_0xd592('0x1b')])throw new Error(_0xd592('0x18e'));var _0x4da8c2=_0x37152b[_0xd592('0x1e')];var _0x5396fb=jayson[_0xd592('0x18f')][_0xd592('0x12')]({'port':0x232c});return _0x5396fb[_0xd592('0x13')]('Agents',_0x3ebd60)[_0xd592('0x14')](function(_0x283972){if(_0x283972['error'])throw new Error(_0xd592('0x190'));var _0x5b733a=_0x283972[_0xd592('0x1e')];return _[_0xd592('0x60')]({},_0x5b733a,_0x4da8c2);});})[_0xd592('0x14')](function(_0x12eac3){return _[_0xd592('0x34')](_0x3ba1b7,function(_0x33960a){var _0x5aef62=_[_0xd592('0x37')](_0x12eac3[_0xd592('0x4e')],['id',_0x33960a['id']]);if(!_0x5aef62||!_0x33960a[_0xd592('0xa7')]){_0x33960a[_0xd592('0x22')]=_0xd592('0x191');}else if(_0x5aef62[_0xd592('0xa9')]){_0x33960a[_0xd592('0x22')]=_0xd592('0x10d');}else{_0x33960a[_0xd592('0x22')]=_[_0xd592('0x36')](['idle',_0xd592('0x192'),_0xd592('0x193'),'ringing',null,undefined],_0x5aef62[_0xd592('0x194')])?'online':_0xd592('0x195');}return _0x33960a;});});});})[_0xd592('0x14')](function(_0x1b142b){if(!_0x3ebd60[_0xd592('0x47')][_0xd592('0xd9')](_0xd592('0xdf'))){_0x455dee['limit']=qs[_0xd592('0x26')](_0x3ebd60['query'][_0xd592('0x26')]||0xa);_0x455dee['offset']=qs['offset'](_0x3ebd60['query'][_0xd592('0x24')]);}_0x200002['count']=_0x1b142b['length'];_0x200002[_0xd592('0x4e')]=_0x455dee['limit']?_0x1b142b['slice'](_0x455dee[_0xd592('0x24')],_0x455dee['offset']+_0x455dee[_0xd592('0x26')]):_0x1b142b;return _0x200002;})[_0xd592('0x14')](respondWithFilteredResult(_0x18bbb4,_0x455dee))[_0xd592('0x1f')](handleError(_0x18bbb4,null));};function get_open_tabs(_0x3f5a16,_0x53d45e){var _0x42e231=_0x3f5a16[_0xd592('0x196')](0x0)[_0xd592('0x197')]()+_0x3f5a16[_0xd592('0x198')](0x1);var _0x46e95d={'type':db[_0xd592('0x9a')][_0xd592('0x70')][_0xd592('0x71')],'raw':!![]};return new Promise(function(_0x18b873,_0x5a04b9){var _0x36ca71=squel[_0xd592('0x199')]()[_0xd592('0x19a')]('ui.'+_0x42e231+'InteractionId','id')['field'](_0xd592('0x19b'))['from']('user_has_'+_0x3f5a16+_0xd592('0x19c'),'ui')[_0xd592('0x46')]('ui.UserId\x20=\x20?',_0x53d45e['id']);return db[_0xd592('0x6e')][_0xd592('0x47')](_0x36ca71[_0xd592('0x188')](),_0x46e95d)[_0xd592('0x14')](function(_0x2dbf7a){_0x53d45e[_0x42e231+_0xd592('0x19d')]=_0x2dbf7a;_0x18b873(_0x2dbf7a);})[_0xd592('0x1f')](function(_0xdd9eb6){_0x5a04b9(_0xdd9eb6);});});}
\ No newline at end of file
+var _0xac6d=['102','103','104','107','109','100','114','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','UserProfileSection','userProfileId','autoAssociation','bulkCreate','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','compact','oldPassword','newPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','spread','ids','QueueId','Queue:save','voice','VoiceQueue','findAll','format','UserVoiceQueueRt','upsert','removeQueues','remove','emit','Queue:remove','addAvatar','userpic','file','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','existsSync','join','server/files/images/','getOpenTabs','whatsapp','CHAT','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','concat','CmContact','keys','intersection','order','sort','where','pick','merge','getContacts','hasOwnProperty','Tag','Tags','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:forcelogout','headers','x-forwarded-for','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','YYYY-MM-DD\x20HH:mm:ss','forEach','LOGIN','PAUSE','LOGININPAUSE','resolve','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','chatPause','whatsappPause','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Team','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','getAssociatedQueues','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','isArray','Query\x20parameter\x20\x27ids\x27\x20is\x20required','flattenDeep','removeAgent','Voice','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$like','$notLike','$iLike','$contains','$any','firstName','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','teams','queues','inbound','flatten','getAgents','lower','col','toString','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','voiceStatus','busy','slice','charAt','toUpperCase','select','field','InteractionId','user_has_','_interactions','OpenTabs','moment','util','lodash','squel','jayson/promise','ioredis','../../config/logger','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','handleError','./user.socket','register','defaults','redis','localhost','http','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','json','update','userNotification:recalc:','destroy','get','role','admin','user','Agents','agent','Telephones','telephone','filter','map','value','includes','find','UserProfileResource','name','send','User','rawAttributes','fieldName','password','salt','getOptions','includeAll','query','userSetting','true','include','UserSetting','attributes','push','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','all','catch','show','params','differenceBy','filters','model','fields','options','body','describe','addContacts','omit','findById','validatePasswordPattern','isNil','internal','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','permissions','101'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0xac6d,0x11a));var _0xdac6=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xac6d[_0x273c39];return _0x46d6b5;};'use strict';var moment=require(_0xdac6('0x0'));var util=require(_0xdac6('0x1'));var path=require('path');var fs=require('fs');var _=require(_0xdac6('0x2'));var squel=require(_0xdac6('0x3'));var jayson=require(_0xdac6('0x4'));var Redis=require(_0xdac6('0x5'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var logger=require(_0xdac6('0x6'))('api');var utils=require('../../config/utils');var config=require(_0xdac6('0x7'));var licenseUtil=require(_0xdac6('0x8'));var APIBadRequestError=require(_0xdac6('0x9'))[_0xdac6('0xa')];var APINotFoundError=require(_0xdac6('0x9'))[_0xdac6('0xb')];var APIHandleError=require('../../errors/api')[_0xdac6('0xc')];var db=require('../../mysqldb')['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xdac6('0xd'))[_0xdac6('0xe')](socket);config['redis']=_[_0xdac6('0xf')](config[_0xdac6('0x10')],{'host':_0xdac6('0x11'),'port':0x18eb});var amiClient=jayson['client'][_0xdac6('0x12')]({'port':0x232a});var values;function respondWithRpcPromise(_0x4e2e44,_0x43cc22,_0x3f0eb4,_0x540c80){return new Promise(function(_0x5442dc,_0xa82cd){var _0x4dfcfd=_0x540c80||amiClient;return _0x4dfcfd[_0xdac6('0x13')](_0x4e2e44,_0x3f0eb4)[_0xdac6('0x14')](function(_0x2d2f61){logger[_0xdac6('0x15')](_0xdac6('0x16'),_0x43cc22,'request\x20sent');logger['debug'](_0xdac6('0x17'),_0x43cc22,_0xdac6('0x18'),JSON['stringify'](_0x2d2f61));if(_0x2d2f61['error']){if(_0x2d2f61['error'][_0xdac6('0x19')]===0x1f4){logger[_0xdac6('0x1a')](_0xdac6('0x16'),_0x43cc22,_0x2d2f61['error'][_0xdac6('0x1b')]);return _0xa82cd(_0x2d2f61[_0xdac6('0x1a')][_0xdac6('0x1b')]);}logger['error']('User,\x20%s,\x20%s',_0x43cc22,_0x2d2f61['error'][_0xdac6('0x1b')]);return _0x5442dc(_0x2d2f61[_0xdac6('0x1a')]['message']);}else{logger[_0xdac6('0x15')](_0xdac6('0x16'),_0x43cc22,'request\x20sent');_0x5442dc(_0x2d2f61[_0xdac6('0x1c')][_0xdac6('0x1b')]);}})['catch'](function(_0x25ec0b){logger[_0xdac6('0x1a')](_0xdac6('0x16'),_0x43cc22,_0x25ec0b);_0xa82cd(_0x25ec0b);});});}function respondWithStatusCode(_0x49eb44,_0x1a677e){_0x1a677e=_0x1a677e||0xcc;return function(_0x529723){if(_0x529723){return _0x49eb44[_0xdac6('0x1d')](_0x1a677e);}return _0x49eb44[_0xdac6('0x1e')](_0x1a677e)[_0xdac6('0x1f')]();};}function respondWithResult(_0x6e6157,_0x48a271){_0x48a271=_0x48a271||0xc8;return function(_0x80e93c){if(_0x80e93c){return _0x6e6157['status'](_0x48a271)['json'](_0x80e93c);}};}function respondWithFilteredResult(_0x34bf5e,_0x9c7ec3){return function(_0x7ae15d){if(_0x7ae15d){var _0x2687e3=typeof _0x9c7ec3[_0xdac6('0x20')]===_0xdac6('0x21')&&typeof _0x9c7ec3[_0xdac6('0x22')]===_0xdac6('0x21');var _0x986129=_0x7ae15d[_0xdac6('0x23')];var _0x5d291a=_0x2687e3?0x0:_0x9c7ec3[_0xdac6('0x20')];var _0x3b7379=_0x2687e3?_0x7ae15d[_0xdac6('0x23')]:_0x9c7ec3[_0xdac6('0x20')]+_0x9c7ec3['limit'];var _0x65a338;if(_0x3b7379>=_0x986129){_0x3b7379=_0x986129;_0x65a338=0xc8;}else{_0x65a338=0xce;}_0x34bf5e[_0xdac6('0x1e')](_0x65a338);return _0x34bf5e[_0xdac6('0x24')]('Content-Range',_0x5d291a+'-'+_0x3b7379+'/'+_0x986129)[_0xdac6('0x25')](_0x7ae15d);}return null;};}function saveUpdates(_0x56fa51){return function(_0x386260){if(_0x386260){return _0x386260[_0xdac6('0x26')](_0x56fa51)[_0xdac6('0x14')](function(_0x39d0ce){socket['emit'](_0xdac6('0x27')+_0x39d0ce['id'],{});return _0x39d0ce;});}return null;};}function removeEntity(_0x472000){return function(_0x535542){if(_0x535542){return _0x535542[_0xdac6('0x28')]()[_0xdac6('0x14')](function(){var _0x4f3071=_0x535542[_0xdac6('0x29')]({'plain':!![]});if(_0x4f3071[_0xdac6('0x2a')]===_0xdac6('0x2b'))return;var _0x48ff8f=[{'name':'Users','value':_0xdac6('0x2c'),'ignore':!![]},{'name':_0xdac6('0x2d'),'value':_0xdac6('0x2e'),'ignore':![]},{'name':_0xdac6('0x2f'),'value':_0xdac6('0x30'),'ignore':![]}];var _0x11be86=_(_0x48ff8f)[_0xdac6('0x31')]('ignore')[_0xdac6('0x32')]('value')[_0xdac6('0x33')]();if(_[_0xdac6('0x34')](_0x11be86,_0x4f3071[_0xdac6('0x2a')])){return;}var _0x520817=_[_0xdac6('0x35')](_0x48ff8f,['value',_0x4f3071[_0xdac6('0x2a')]])['name'];return db[_0xdac6('0x36')]['destroy']({'where':{'type':_0x520817,'resourceId':_0x4f3071['id']}})[_0xdac6('0x14')](function(){return _0x535542;});})[_0xdac6('0x14')](function(){_0x472000[_0xdac6('0x1e')](0xcc)[_0xdac6('0x1f')]();});}};}function handleEntityNotFound(_0x16f178){return function(_0x3fc026){if(!_0x3fc026){_0x16f178[_0xdac6('0x1d')](0x194);}return _0x3fc026;};}function handleError(_0x2b58dc,_0x53f2d5){_0x53f2d5=_0x53f2d5||0x1f4;return function(_0x5c7b2d){logger[_0xdac6('0x1a')](_0x5c7b2d['stack']);if(_0x5c7b2d[_0xdac6('0x37')]){delete _0x5c7b2d[_0xdac6('0x37')];}_0x2b58dc[_0xdac6('0x1e')](_0x53f2d5)[_0xdac6('0x38')](_0x5c7b2d);};}exports['index']=function(_0x36a836,_0x301969){var _0x2e8437={},_0x309f15={'count':0x0,'rows':[]};var _0x2e236b=_(db[_0xdac6('0x39')][_0xdac6('0x3a')])[_0xdac6('0x32')](function(_0x15e99d){return{'name':_0x15e99d[_0xdac6('0x3b')],'type':_0x15e99d['type']['key']};})[_0xdac6('0x31')](function(_0x1155f2){return!_['includes']([_0xdac6('0x3c'),_0xdac6('0x3d')],_0x1155f2[_0xdac6('0x37')]);})[_0xdac6('0x33')]();_0x2e8437=qs[_0xdac6('0x3e')](_0x2e236b,_0x36a836);var _0x3d7c67={'where':_0x2e8437['where']};return db[_0xdac6('0x39')][_0xdac6('0x23')](_0x3d7c67)[_0xdac6('0x14')](function(_0x30e276){_0x309f15[_0xdac6('0x23')]=_0x30e276;if(_0x36a836['query'][_0xdac6('0x3f')]){_0x2e8437['include']=[{'all':!![]}];}if(_0x36a836[_0xdac6('0x40')][_0xdac6('0x41')]===_0xdac6('0x42')){_0x2e8437[_0xdac6('0x43')]=[{'model':db[_0xdac6('0x44')],'as':_0xdac6('0x41')}];}if(!_[_0xdac6('0x34')](_0x2e8437['attributes'],'id')){_0x2e8437[_0xdac6('0x45')][_0xdac6('0x46')]('id');}return db[_0xdac6('0x39')]['findAll'](_0x2e8437);})['then'](function(_0x22b972){_0x309f15[_0xdac6('0x47')]=_0x22b972;if(_0x36a836[_0xdac6('0x40')][_0xdac6('0x48')]===_0xdac6('0x42')){var _0x255a51=[];for(var _0x2257ed=0x0;_0x2257ed<_0x309f15['rows'][_0xdac6('0x49')];_0x2257ed++){_0x255a51[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4a'),_0x309f15[_0xdac6('0x47')][_0x2257ed][_0xdac6('0x4b')]));_0x255a51[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4c'),_0x309f15[_0xdac6('0x47')][_0x2257ed][_0xdac6('0x4b')]));_0x255a51['push'](get_open_tabs(_0xdac6('0x4d'),_0x309f15[_0xdac6('0x47')][_0x2257ed][_0xdac6('0x4b')]));_0x255a51[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4e'),_0x309f15['rows'][_0x2257ed][_0xdac6('0x4b')]));_0x255a51[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4f'),_0x309f15['rows'][_0x2257ed][_0xdac6('0x4b')]));_0x255a51[_0xdac6('0x46')](get_open_tabs('whatsapp',_0x309f15[_0xdac6('0x47')][_0x2257ed][_0xdac6('0x4b')]));}return Promise[_0xdac6('0x50')](_0x255a51)[_0xdac6('0x14')](function(){return _0x309f15;});}else{return _0x309f15;}})['then'](respondWithFilteredResult(_0x301969,_0x2e8437))[_0xdac6('0x51')](handleError(_0x301969,null));};exports[_0xdac6('0x52')]=function(_0xc0bab5,_0x466b45){var _0x45a8ab={'raw':![],'where':{'id':_0xc0bab5[_0xdac6('0x53')]['id']}},_0x4b3089={};_0x4b3089['model']=_[_0xdac6('0x54')](_['keys'](db[_0xdac6('0x39')][_0xdac6('0x3a')]),['password','salt']);_0x4b3089[_0xdac6('0x40')]=_['keys'](_0xc0bab5[_0xdac6('0x40')]);_0x4b3089[_0xdac6('0x55')]=_['intersection'](_0x4b3089['model'],_0x4b3089[_0xdac6('0x40')]);_0x45a8ab[_0xdac6('0x45')]=_['intersection'](_0x4b3089[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0xc0bab5[_0xdac6('0x40')]['fields']));_0x45a8ab[_0xdac6('0x45')]=_0x45a8ab[_0xdac6('0x45')][_0xdac6('0x49')]?_0x45a8ab['attributes']:_0x4b3089[_0xdac6('0x56')];if(_0xc0bab5[_0xdac6('0x40')][_0xdac6('0x3f')]){_0x45a8ab[_0xdac6('0x43')]=[{'all':!![]}];}if(_0xc0bab5[_0xdac6('0x40')][_0xdac6('0x41')]===_0xdac6('0x42')){_0x45a8ab[_0xdac6('0x43')]=[{'model':db[_0xdac6('0x44')],'as':'userSetting'}];}_0x45a8ab=_['merge']({},_0x45a8ab,_0xc0bab5[_0xdac6('0x58')]);if(!_[_0xdac6('0x34')](_0x45a8ab['attributes'],'id')){_0x45a8ab[_0xdac6('0x45')][_0xdac6('0x46')]('id');}return db[_0xdac6('0x39')][_0xdac6('0x35')](_0x45a8ab)['then'](handleEntityNotFound(_0x466b45,null))[_0xdac6('0x14')](function(_0x40c4ed){var _0x9bdc1a=[];values=_0x40c4ed;if(_0xc0bab5[_0xdac6('0x40')][_0xdac6('0x48')]==='true'){_0x9bdc1a['push'](get_open_tabs('chat',_0x40c4ed[_0xdac6('0x4b')]));_0x9bdc1a['push'](get_open_tabs(_0xdac6('0x4c'),_0x40c4ed['dataValues']));_0x9bdc1a[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4f'),_0x40c4ed[_0xdac6('0x4b')]));_0x9bdc1a['push'](get_open_tabs('whatsapp',_0x40c4ed[_0xdac6('0x4b')]));_0x9bdc1a[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4d'),_0x40c4ed[_0xdac6('0x4b')]));_0x9bdc1a['push'](get_open_tabs(_0xdac6('0x4e'),_0x40c4ed[_0xdac6('0x4b')]));return Promise[_0xdac6('0x50')](_0x9bdc1a);}else{return values;}})['then'](function(){return values;})[_0xdac6('0x14')](respondWithResult(_0x466b45,null))[_0xdac6('0x51')](handleError(_0x466b45,null));};exports[_0xdac6('0x26')]=function(_0x40891e,_0x9b3ee9){if(_0x40891e['body']['id']){delete _0x40891e['body']['id'];}delete _0x40891e[_0xdac6('0x59')][_0xdac6('0x2a')];return db[_0xdac6('0x39')]['find']({'where':{'id':_0x40891e[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x9b3ee9,null))[_0xdac6('0x14')](saveUpdates(_0x40891e[_0xdac6('0x59')],null))[_0xdac6('0x14')](respondWithResult(_0x9b3ee9,null))['catch'](handleError(_0x9b3ee9,null));};exports[_0xdac6('0x5a')]=function(_0x5ecb64,_0x38698e){return db[_0xdac6('0x39')][_0xdac6('0x5a')]()[_0xdac6('0x14')](respondWithResult(_0x38698e,null))[_0xdac6('0x51')](handleError(_0x38698e,null));};exports['addContacts']=function(_0xb5afca,_0x396dcc){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0xb5afca[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x396dcc,null))[_0xdac6('0x14')](function(_0x24dfe1){if(_0x24dfe1){return _0x24dfe1[_0xdac6('0x5b')](_0xb5afca[_0xdac6('0x59')]['ids'],_[_0xdac6('0x5c')](_0xb5afca[_0xdac6('0x59')],['ids','id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x396dcc,null))[_0xdac6('0x51')](handleError(_0x396dcc,null));};function validateUser(_0x3c99eb){return new Promise(function(_0x156d76,_0x5c32b2){if(_0x3c99eb['internal'])return _0x156d76(_0x3c99eb);return db['Setting'][_0xdac6('0x5d')](0x1)[_0xdac6('0x14')](function(_0x11dc02){if(_0x11dc02['securePassword'])authService[_0xdac6('0x5e')](_0x3c99eb[_0xdac6('0x3c')]);db[_0xdac6('0x39')]['max']('internal')[_0xdac6('0x14')](function(_0x567e4c){if(_[_0xdac6('0x5f')](_0x567e4c)){_0x3c99eb[_0xdac6('0x60')]=_0x11dc02['min_internal']||0x1;return;}if(_[_0xdac6('0x5f')](_0x11dc02[_0xdac6('0x61')])||_0x11dc02[_0xdac6('0x61')]===_0x567e4c){_0x3c99eb[_0xdac6('0x60')]=_0x567e4c+0x1;return;}if(_0x11dc02[_0xdac6('0x61')]>_0x567e4c){_0x3c99eb['internal']=_0x11dc02['min_internal'];return;}return db[_0xdac6('0x62')]['query'](_0xdac6('0x63'),{'type':db[_0xdac6('0x62')][_0xdac6('0x64')][_0xdac6('0x65')]})[_0xdac6('0x14')](function(_0x20ee77){if(_0x20ee77&&_0x20ee77['length']){for(var _0x52e7cb=0x0,_0x3c4e36=_0x20ee77[_0xdac6('0x49')];_0x52e7cb<_0x3c4e36&&_[_0xdac6('0x5f')](_0x3c99eb['internal']);_0x52e7cb++){if(_0x11dc02[_0xdac6('0x61')]<=_0x20ee77[_0x52e7cb][_0xdac6('0x66')]){_0x3c99eb[_0xdac6('0x60')]=_0x20ee77[_0x52e7cb]['from'];}else if(_0x11dc02['min_internal']>_0x20ee77[_0x52e7cb][_0xdac6('0x66')]&&_0x11dc02[_0xdac6('0x61')]<=_0x20ee77[_0x52e7cb]['to']){_0x3c99eb['internal']=_0x11dc02[_0xdac6('0x61')];}}}if(_[_0xdac6('0x5f')](_0x3c99eb[_0xdac6('0x60')])){_0x3c99eb['internal']=_0x567e4c+0x1;}return _0x156d76(_0x3c99eb);});});})['catch'](function(_0x72a087){_0x5c32b2(_0x72a087);});});}function updateUser(_0x2ff786){return new Promise(function(_0x280d94,_0x580b99){try{if(_0x2ff786[_0xdac6('0x67')]){_0x2ff786[_0xdac6('0x68')]=_0x2ff786['internal'];_0x2ff786[_0xdac6('0x69')]={'mailbox':_0x2ff786[_0xdac6('0x60')],'password':_0x2ff786['password'],'fullname':_0x2ff786[_0xdac6('0x6a')],'email':_0x2ff786[_0xdac6('0x6b')]};}if(_0x2ff786[_0xdac6('0x2a')]==='agent'){if(!_0x2ff786[_0xdac6('0x6c')])_0x2ff786[_0xdac6('0x6c')]=[_0xdac6('0x6d'),_0xdac6('0x6e'),_0xdac6('0x6f'),'113','110',_0xdac6('0x70'),'105','106',_0xdac6('0x71'),'108',_0xdac6('0x72'),_0xdac6('0x73'),'111',_0xdac6('0x74'),'115'];}_0x280d94(_0x2ff786);}catch(_0x21315c){_0x580b99(_0x21315c);}});}exports[_0xdac6('0x75')]=function(_0x1c7684,_0xcc3557){if(_0x1c7684['user']['role']===_0xdac6('0x2e'))throw new Error('Unauthorized');if(_0x1c7684['body'][_0xdac6('0x2a')]===_0xdac6('0x2c')&&_0x1c7684[_0xdac6('0x2c')][_0xdac6('0x2a')]!=='admin'){throw new Error(_0xdac6('0x76'));}if(_0x1c7684[_0xdac6('0x59')]['role']===_0xdac6('0x2b')&&_0x1c7684[_0xdac6('0x2c')][_0xdac6('0x2a')]!==_0xdac6('0x2b')){throw new Error(_0xdac6('0x77'));}return licenseUtil[_0xdac6('0x78')]([_0x1c7684[_0xdac6('0x59')]])[_0xdac6('0x14')](function(){return validateUser(_0x1c7684[_0xdac6('0x59')]);})[_0xdac6('0x14')](function(_0x3d2f95){return updateUser(_0x3d2f95)[_0xdac6('0x14')](function(_0x457eba){if(_0x457eba[_0xdac6('0x2a')]===_0xdac6('0x2b')){_0x457eba[_0xdac6('0x79')]=_0x1c7684[_0xdac6('0x2c')][_0xdac6('0x79')];delete _0x457eba['userProfileId'];}return _0x457eba;});})[_0xdac6('0x14')](function(_0x3bba69){return db[_0xdac6('0x39')][_0xdac6('0x75')](_0x3bba69,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0xdac6('0x14')](function(_0x149cd6){if(_0x1c7684[_0xdac6('0x59')][_0xdac6('0x2a')]===_0xdac6('0x2c'))return _0x149cd6;if(_0x1c7684[_0xdac6('0x2c')]['role']!==_0xdac6('0x2c'))return _0x149cd6;return db[_0xdac6('0x7a')][_0xdac6('0x35')]({'where':{'name':_0x149cd6[_0xdac6('0x2a')]===_0xdac6('0x2e')?_0xdac6('0x2d'):_0xdac6('0x2f'),'userProfileId':_0x1c7684[_0xdac6('0x2c')][_0xdac6('0x7b')]},'raw':!![]})[_0xdac6('0x14')](function(_0x49ece0){if(!_0x49ece0||_0x49ece0[_0xdac6('0x7c')]!=0x0)return _0x149cd6;return db[_0xdac6('0x36')][_0xdac6('0x75')]({'name':_0x149cd6[_0xdac6('0x37')],'resourceId':_0x149cd6['id'],'type':_0x49ece0[_0xdac6('0x37')],'sectionId':_0x49ece0['id']},{})[_0xdac6('0x14')](function(){return _0x149cd6;});})[_0xdac6('0x51')](function(_0x5b6dde){logger[_0xdac6('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b6dde);throw _0x5b6dde;});})['then'](respondWithResult(_0xcc3557,0xc9))['catch'](handleError(_0xcc3557,null));};exports[_0xdac6('0x7d')]=function(_0x327dab,_0x1c8e7c){var _0x4a9d18=_0x327dab[_0xdac6('0x59')];var _0x572aa9=[];if(_0x327dab[_0xdac6('0x2c')][_0xdac6('0x2a')]===_0xdac6('0x2e'))throw new Error(_0xdac6('0x7e'));if(_['some'](_0x4a9d18,[_0xdac6('0x2a'),_0xdac6('0x2c')])&&_0x327dab[_0xdac6('0x2c')]['role']!==_0xdac6('0x2b')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xdac6('0x7f')](_0x4a9d18,[_0xdac6('0x2a'),_0xdac6('0x2b')])&&_0x327dab[_0xdac6('0x2c')][_0xdac6('0x2a')]!==_0xdac6('0x2b')){throw new Error(_0xdac6('0x80'));}return licenseUtil[_0xdac6('0x78')](_0x4a9d18)[_0xdac6('0x14')](function(){return validateUser(_0x4a9d18[0x0]);})[_0xdac6('0x14')](function(){for(var _0x1bf0a3=0x1;_0x1bf0a3<_0x4a9d18['length'];_0x1bf0a3++){var _0x2739c3=_0x4a9d18[_0x1bf0a3-0x1]['internal'];if(!_0x4a9d18[_0x1bf0a3]['internal'])_0x4a9d18[_0x1bf0a3]['internal']=_0x2739c3+0x1;_0x572aa9[_0xdac6('0x46')](validateUser(_0x4a9d18[_0x1bf0a3]));}return Promise[_0xdac6('0x50')](_0x572aa9);})[_0xdac6('0x14')](function(){_0x572aa9=[];for(var _0x48c00c=0x0;_0x48c00c<_0x4a9d18[_0xdac6('0x49')];_0x48c00c++){_0x572aa9[_0xdac6('0x46')](updateUser(_0x4a9d18[_0x48c00c]));}return Promise[_0xdac6('0x50')](_0x572aa9);})['then'](function(){_0x572aa9=_0x4a9d18[_0xdac6('0x32')](function(_0x221d3d){return db[_0xdac6('0x39')][_0xdac6('0x75')](_0x221d3d,{'include':[{'model':db[_0xdac6('0x69')],'as':_0xdac6('0x69')}]})[_0xdac6('0x14')](function(_0x27a0e8){_0x221d3d['id']=_0x27a0e8['id'];return _0x221d3d;});});return Promise['all'](_0x572aa9);})[_0xdac6('0x14')](function(_0x3b1024){if(_0x327dab['body'][_0xdac6('0x2a')]===_0xdac6('0x2c'))return _0x3b1024;if(_0x327dab[_0xdac6('0x2c')][_0xdac6('0x2a')]!==_0xdac6('0x2c'))return _0x3b1024;var _0x2c06b6=_[_0xdac6('0x7f')](_0x3b1024,function(_0x276dba){return _0x276dba[_0xdac6('0x2a')]===_0xdac6('0x2e')||_0x276dba[_0xdac6('0x2a')]===_0xdac6('0x30');});if(!_0x2c06b6)return _0x3b1024;return db['UserProfileSection']['findAll']({'where':{'name':{'$or':[_0xdac6('0x2d'),_0xdac6('0x2f')]},'userProfileId':_0x327dab[_0xdac6('0x2c')][_0xdac6('0x7b')]},'raw':!![]})['then'](function(_0x47017b){if(_[_0xdac6('0x81')](_0x47017b)||!_['some'](_0x47017b,[_0xdac6('0x7c'),0x0]))return _0x3b1024;_0x572aa9=[];var _0x5c7960=_(_0x47017b)[_0xdac6('0x32')](function(_0x5517fe){if(_0x5517fe['autoAssociation']===0x1)return;return _0x5517fe[_0xdac6('0x37')]===_0xdac6('0x2d')?_0xdac6('0x2e'):_0xdac6('0x30');})[_0xdac6('0x82')]()['value']();for(var _0x5f00d4=0x0;_0x5f00d4<_0x3b1024['length'];_0x5f00d4++){if(!_[_0xdac6('0x34')](_0x5c7960,_0x3b1024[_0x5f00d4][_0xdac6('0x2a')]))return;var _0xd9cd10=_0x3b1024[_0x5f00d4]['role']===_0xdac6('0x2e')?'Agents':_0xdac6('0x2f');_0x572aa9[_0xdac6('0x46')](db[_0xdac6('0x36')]['create']({'name':_0x3b1024[_0x5f00d4][_0xdac6('0x37')],'resourceId':_0x3b1024[_0x5f00d4]['id'],'type':_0xd9cd10,'sectionId':_[_0xdac6('0x35')](_0x47017b,['name',_0xd9cd10])['id']},{}));}return Promise[_0xdac6('0x50')](_0x572aa9);});})['then'](respondWithResult(_0x1c8e7c,0xc9))['catch'](handleError(_0x1c8e7c,null));};exports['changePassword']=function(_0x591f27,_0x10f1cd){if(_0x591f27[_0xdac6('0x59')]['id']){delete _0x591f27['body']['id'];}return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x591f27[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](function(_0x3d5b5e){if(!_0x3d5b5e)return null;if(_0x3d5b5e['id']===_0x591f27[_0xdac6('0x2c')]['id']){if(!_0x591f27[_0xdac6('0x59')][_0xdac6('0x83')]||!_0x591f27[_0xdac6('0x59')][_0xdac6('0x84')]){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x87'));}if(!_0x3d5b5e[_0xdac6('0x88')](_0x591f27[_0xdac6('0x59')]['oldPassword'])){throw new db[(_0xdac6('0x85'))]['ValidationError'](_0xdac6('0x89'));}if(_0x591f27[_0xdac6('0x59')][_0xdac6('0x83')]===_0x591f27['body'][_0xdac6('0x84')]){throw new db[(_0xdac6('0x85'))]['ValidationError'](_0xdac6('0x8a'));}}else if(_0x591f27[_0xdac6('0x2c')][_0xdac6('0x2a')]===_0xdac6('0x2b')){if(!_0x591f27['body'][_0xdac6('0x84')]){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x8b'));}}else if(_0x591f27[_0xdac6('0x2c')][_0xdac6('0x2a')]==='user'){if(!_0x591f27['body'][_0xdac6('0x84')]){throw new db['Sequelize'][(_0xdac6('0x86'))](_0xdac6('0x8b'));}if(_0x3d5b5e['role']!==_0xdac6('0x2e')){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x7e'));}}else{throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x7e'));}return _0x3d5b5e;})[_0xdac6('0x14')](handleEntityNotFound(_0x10f1cd,null))[_0xdac6('0x14')](function(_0x45380e){return db[_0xdac6('0x8c')][_0xdac6('0x8d')]({'attributes':['id',_0xdac6('0x8e'),_0xdac6('0x8f'),_0xdac6('0x90')]})[_0xdac6('0x14')](function(_0x350ece){if(_0x350ece[_0xdac6('0x8e')])authService[_0xdac6('0x5e')](_0x591f27['body'][_0xdac6('0x84')]);if(!_0x350ece[_0xdac6('0x8f')]||!_0x45380e[_0xdac6('0x91')])return _0x45380e;authService[_0xdac6('0x92')](_0x591f27[_0xdac6('0x59')]['newPassword'],_0x45380e['previousPasswords'],_0x350ece['passwordHistoryLimit']);return _0x45380e;})[_0xdac6('0x14')](saveUpdates({'password':_0x591f27[_0xdac6('0x59')]['newPassword'],'passwordResetAt':_0x591f27[_0xdac6('0x2c')]['id']==_0x591f27[_0xdac6('0x53')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x591f27['body'][_0xdac6('0x84')],_0x45380e[_0xdac6('0x91')])},null));})[_0xdac6('0x14')](respondWithResult(_0x10f1cd,null))[_0xdac6('0x51')](handleError(_0x10f1cd,null));};exports[_0xdac6('0x93')]=function(_0x3d3054,_0x38835a){var _0x4eacbf=_0x3d3054[_0xdac6('0x59')][_0xdac6('0x94')];return db['User'][_0xdac6('0x35')]({'where':{'id':_0x3d3054[_0xdac6('0x53')]['id']},'attributes':['id',_0xdac6('0x37'),_0xdac6('0x2a'),_0xdac6('0x95'),_0xdac6('0x96'),_0xdac6('0x97'),_0xdac6('0x98')]})['then'](handleEntityNotFound(_0x38835a,null))[_0xdac6('0x14')](function(_0x5081b0){if(_0x5081b0){if(!utils[_0xdac6('0x99')](_0x4eacbf)){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x9a'));}return _0x5081b0[_0xdac6('0x9b')+_[_0xdac6('0x9c')](_0x4eacbf[_0xdac6('0x9d')]())+_0xdac6('0x9e')](_0x3d3054[_0xdac6('0x59')]['ids'],{'penalty':_0x3d3054[_0xdac6('0x59')][_0xdac6('0x9f')]||0x0})[_0xdac6('0xa0')](function(_0x144025){for(var _0x342279=0x0;_0x342279<_0x3d3054[_0xdac6('0x59')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x342279+=0x1){var _0x2c5d6f={'UserId':Number(_0x3d3054[_0xdac6('0x53')]['id'])};_0x2c5d6f[_['capitalize'](_0x4eacbf[_0xdac6('0x9d')]())+_0xdac6('0xa2')]=Number(_0x3d3054['body'][_0xdac6('0xa1')][_0x342279]);socket['emit'](_0xdac6('0x2c')+_[_0xdac6('0x9c')](_0x4eacbf[_0xdac6('0x9d')]())+_0xdac6('0xa3'),_0x2c5d6f);}return _0x144025;})[_0xdac6('0x14')](function(){if(_0x4eacbf===_0xdac6('0xa4')){return db[_0xdac6('0xa5')][_0xdac6('0xa6')]({'where':{'id':_0x3d3054[_0xdac6('0x59')][_0xdac6('0xa1')]||[]},'raw':!![],'attributes':['id','name']});}})[_0xdac6('0x14')](function(_0x1f2059){var _0x2a69e3=_0x5081b0[_0xdac6('0x29')]({'plain':!![]});var _0x45ff90=[];if(_0x4eacbf===_0xdac6('0xa4')&&_0x2a69e3[_0xdac6('0x2a')]===_0xdac6('0x2e')&&_0x2a69e3[_0xdac6('0x95')]){for(let _0x5980aa=0x0;_0x5980aa<_0x1f2059['length'];_0x5980aa+=0x1){_0x45ff90['push']({'membername':_0x2a69e3[_0xdac6('0x37')],'UserId':_0x2a69e3['id'],'queue_name':_0x1f2059[_0x5980aa][_0xdac6('0x37')],'VoiceQueueId':_0x1f2059[_0x5980aa]['id'],'interface':_['isNil'](_0x2a69e3[_0xdac6('0x98')])?util[_0xdac6('0xa7')]('SIP/%s',_0x2a69e3[_0xdac6('0x37')]):_0x2a69e3[_0xdac6('0x98')],'paused':_0x2a69e3[_0xdac6('0x97')]||![],'penalty':_0x3d3054['body']['penalty']||0x0});}return Promise[_0xdac6('0x50')](_0x45ff90[_0xdac6('0x32')](function(_0xb44d01){return db[_0xdac6('0xa8')][_0xdac6('0xa9')](_0xb44d01);}));}return _0x5081b0;});}})['then'](respondWithStatusCode(_0x38835a,null))['catch'](handleError(_0x38835a,null));};exports[_0xdac6('0xaa')]=function(_0x38c737,_0x400e13){var _0x29ccb3,_0x1027ec;return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x38c737['params']['id']},'attributes':['id','name',_0xdac6('0x2a')]})[_0xdac6('0x14')](handleEntityNotFound(_0x400e13,null))[_0xdac6('0x14')](function(_0x1049c9){if(_0x1049c9){_0x29ccb3=_0x1049c9;if(!_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')]||!utils[_0xdac6('0x99')](_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')])){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x9a'));}return _0x1049c9[_0xdac6('0xab')+_[_0xdac6('0x9c')](_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')]['toLowerCase']())+_0xdac6('0x9e')](_0x38c737[_0xdac6('0x40')][_0xdac6('0xa1')]);}})[_0xdac6('0x14')](function(_0x3b8de3){if(_['isArray'](_0x38c737[_0xdac6('0x40')][_0xdac6('0xa1')])){for(var _0x468824=0x0;_0x468824<_0x38c737['query'][_0xdac6('0xa1')][_0xdac6('0x49')];_0x468824+=0x1){_0x1027ec={'UserId':Number(_0x38c737[_0xdac6('0x53')]['id'])};_0x1027ec[_[_0xdac6('0x9c')](_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')]['toLowerCase']())+_0xdac6('0xa2')]=Number(_0x38c737['query'][_0xdac6('0xa1')][_0x468824]);socket[_0xdac6('0xac')]('user'+_[_0xdac6('0x9c')](_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')]['toLowerCase']())+_0xdac6('0xad'),_0x1027ec);}}else{_0x1027ec={'UserId':Number(_0x38c737['params']['id'])};_0x1027ec[_[_0xdac6('0x9c')](_0x38c737[_0xdac6('0x40')]['channel'][_0xdac6('0x9d')]())+_0xdac6('0xa2')]=Number(_0x38c737[_0xdac6('0x40')][_0xdac6('0xa1')]);socket['emit']('user'+_[_0xdac6('0x9c')](_0x38c737['query'][_0xdac6('0x94')][_0xdac6('0x9d')]())+_0xdac6('0xad'),_0x1027ec);}return _0x3b8de3;})['then'](function(){if(_0x38c737[_0xdac6('0x40')][_0xdac6('0x94')]===_0xdac6('0xa4')){return db[_0xdac6('0xa8')]['destroy']({'where':{'UserId':_0x38c737[_0xdac6('0x53')]['id'],'VoiceQueueId':_0x38c737['query'][_0xdac6('0xa1')]},'individualHooks':!![]})['then'](function(){return _0x29ccb3;});}return _0x29ccb3;})[_0xdac6('0x14')](respondWithStatusCode(_0x400e13,null))['catch'](handleError(_0x400e13,null));};exports[_0xdac6('0xae')]=function(_0x2aa15b,_0xbdbd58){_0x2aa15b[_0xdac6('0x59')][_0xdac6('0xaf')]=_0x2aa15b[_0xdac6('0xb0')][_0xdac6('0xb1')];return db[_0xdac6('0x39')]['find']({'where':{'id':_0x2aa15b['params']['id']}})['then'](handleEntityNotFound(_0xbdbd58,null))['then'](saveUpdates(_0x2aa15b[_0xdac6('0x59')],null))[_0xdac6('0x14')](respondWithResult(_0xbdbd58,null))[_0xdac6('0x51')](handleError(_0xbdbd58,null));};exports[_0xdac6('0xb2')]=function(_0x418ddf,_0x2c5306){var _0x4bd7a=path['join'](config[_0xdac6('0xb3')],_0xdac6('0xb4'));return db['User'][_0xdac6('0x35')]({'where':{'id':_0x418ddf[_0xdac6('0x53')]['id']},'attributes':['id',_0xdac6('0xaf')],'raw':!![]})[_0xdac6('0x14')](handleEntityNotFound(_0x2c5306,null))[_0xdac6('0x14')](function(_0x389255){if(_0x389255){if(_[_0xdac6('0x5f')](_0x389255[_0xdac6('0xaf')])){return _0x2c5306[_0xdac6('0xb5')](_0x4bd7a);}else{if(!fs[_0xdac6('0xb6')](path[_0xdac6('0xb7')](config[_0xdac6('0xb3')],_0xdac6('0xb8'),_0x389255[_0xdac6('0xaf')]))){return _0x2c5306[_0xdac6('0xb5')](_0x4bd7a);}return _0x2c5306[_0xdac6('0xb5')](path['join'](config[_0xdac6('0xb3')],_0xdac6('0xb8'),_0x389255[_0xdac6('0xaf')]));}}})[_0xdac6('0x51')](handleError(_0x2c5306,null));};exports[_0xdac6('0xb9')]=function(_0x573210,_0x2c873c){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x573210[_0xdac6('0x53')]['id']},'attributes':['id']})[_0xdac6('0x14')](handleEntityNotFound(_0x2c873c,null))[_0xdac6('0x14')](function(_0x5ef6de){var _0x2f834f=[];values=_0x5ef6de['dataValues'];_0x2f834f[_0xdac6('0x46')](get_open_tabs('chat',_0x5ef6de[_0xdac6('0x4b')]));_0x2f834f[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4c'),_0x5ef6de[_0xdac6('0x4b')]));_0x2f834f[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4f'),_0x5ef6de[_0xdac6('0x4b')]));_0x2f834f[_0xdac6('0x46')](get_open_tabs(_0xdac6('0xba'),_0x5ef6de['dataValues']));_0x2f834f[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4d'),_0x5ef6de[_0xdac6('0x4b')]));_0x2f834f[_0xdac6('0x46')](get_open_tabs(_0xdac6('0x4e'),_0x5ef6de['dataValues']));return Promise[_0xdac6('0x50')](_0x2f834f);})[_0xdac6('0x14')](function(_0x5e675d){if(_0x5e675d){var _0x175559=_[_0xdac6('0x32')](values['ChatOpenTabs'],function(_0x21b9db){return{'channel':_0xdac6('0xbb'),'id':_0x21b9db['id'],'createdAt':_0x21b9db['createdAt']};});var _0x2c6080=_[_0xdac6('0x32')](values['FaxOpenTabs'],function(_0x447c3f){return{'channel':'FAX','id':_0x447c3f['id'],'createdAt':_0x447c3f[_0xdac6('0xbc')]};});var _0x2f8733=_[_0xdac6('0x32')](values[_0xdac6('0xbd')],function(_0x4b8fac){return{'channel':_0xdac6('0xbe'),'id':_0x4b8fac['id'],'createdAt':_0x4b8fac[_0xdac6('0xbc')]};});var _0x37fddf=_[_0xdac6('0x32')](values[_0xdac6('0xbf')],function(_0x553d56){return{'channel':_0xdac6('0xc0'),'id':_0x553d56['id'],'createdAt':_0x553d56['createdAt']};});var _0x27fb18=_[_0xdac6('0x32')](values[_0xdac6('0xc1')],function(_0x3f46bd){return{'channel':_0xdac6('0xc2'),'id':_0x3f46bd['id'],'createdAt':_0x3f46bd[_0xdac6('0xbc')]};});var _0x4fda83=_['map'](values[_0xdac6('0xc3')],function(_0x50c285){return{'channel':_0xdac6('0xc4'),'id':_0x50c285['id'],'createdAt':_0x50c285[_0xdac6('0xbc')]};});var _0x30777a=_[_0xdac6('0xc5')](_0x175559,_0x2c6080,_0x2f8733,_0x37fddf,_0x27fb18,_0x4fda83);var _0x39e575={'count':_0x30777a['length'],'rows':_0x30777a};return _0x39e575;}else return null;})[_0xdac6('0x14')](respondWithResult(_0x2c873c,null))[_0xdac6('0x51')](handleError(_0x2c873c,null));};exports['getContacts']=function(_0x49df08,_0x22c209){var _0x3d9d78={};var _0x2d0ce6={};var _0x18b7a4;var _0x22a77c;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x49df08[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x22c209,null))[_0xdac6('0x14')](function(_0xb4564b){if(_0xb4564b){_0x18b7a4=_0xb4564b;_0x2d0ce6[_0xdac6('0x56')]=_['keys'](db[_0xdac6('0xc6')][_0xdac6('0x3a')]);_0x2d0ce6['query']=_[_0xdac6('0xc7')](_0x49df08[_0xdac6('0x40')]);_0x2d0ce6[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x2d0ce6[_0xdac6('0x56')],_0x2d0ce6['query']);_0x3d9d78['attributes']=_[_0xdac6('0xc8')](_0x2d0ce6[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x49df08[_0xdac6('0x40')][_0xdac6('0x57')]));_0x3d9d78[_0xdac6('0x45')]=_0x3d9d78['attributes'][_0xdac6('0x49')]?_0x3d9d78[_0xdac6('0x45')]:_0x2d0ce6['model'];_0x3d9d78[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x49df08[_0xdac6('0x40')][_0xdac6('0xca')]);_0x3d9d78[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x49df08['query'],_0x2d0ce6['filters']));if(_0x49df08[_0xdac6('0x40')][_0xdac6('0x31')]){_0x3d9d78[_0xdac6('0xcb')]=_['merge'](_0x3d9d78[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x3d9d78['attributes'],function(_0x6f09f0){var _0x276db9={};_0x276db9[_0x6f09f0]={'$like':'%'+_0x49df08['query']['filter']+'%'};return _0x276db9;})});}_0x3d9d78=_[_0xdac6('0xcd')]({},_0x3d9d78,_0x49df08[_0xdac6('0x58')]);return _0x18b7a4[_0xdac6('0xce')](_0x3d9d78);}})['then'](function(_0x1ba0d3){if(_0x1ba0d3){_0x22a77c=_0x1ba0d3[_0xdac6('0x49')];if(_0x49df08[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0x3f'))){_0x3d9d78[_0xdac6('0x43')]=[{'model':db['CmList'],'as':'List','required':![]},{'model':db[_0xdac6('0xd0')],'as':_0xdac6('0xd1'),'attributes':['id',_0xdac6('0x37'),'color'],'where':_0x49df08[_0xdac6('0x40')][_0xdac6('0xd2')]?{'id':_0x49df08[_0xdac6('0x40')][_0xdac6('0xd2')]}:undefined,'required':_0x49df08[_0xdac6('0x40')][_0xdac6('0xd2')]?!![]:![]}];}if(!_0x49df08[_0xdac6('0x40')][_0xdac6('0xcf')]('nolimit')){_0x3d9d78[_0xdac6('0x22')]=qs['limit'](_0x49df08[_0xdac6('0x40')][_0xdac6('0x22')]);_0x3d9d78[_0xdac6('0x20')]=qs['offset'](_0x49df08[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x18b7a4[_0xdac6('0xce')](_0x3d9d78);}})[_0xdac6('0x14')](function(_0x376ec9){if(_0x376ec9){return _0x376ec9?{'count':_0x22a77c,'rows':_0x376ec9}:null;}})[_0xdac6('0x14')](respondWithResult(_0x22c209,null))[_0xdac6('0x51')](handleError(_0x22c209,null));};exports[_0xdac6('0xd3')]=function(_0x1cd499,_0x189992){var _0x2c24d4;var _0x7d20b4={};var _0x124374;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x1cd499[_0xdac6('0x53')]['id']},'attributes':['id',_0xdac6('0x37'),_0xdac6('0x2a')]})[_0xdac6('0x14')](handleEntityNotFound(_0x189992,null))[_0xdac6('0x14')](function(_0x39f57c){if(!utils[_0xdac6('0x99')](_0x1cd499[_0xdac6('0x40')][_0xdac6('0x94')])){throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0x9a'));}_0x2c24d4=_0x39f57c;var _0x37aac0={};_0x37aac0['model']=_[_0xdac6('0xc7')](db[_['capitalize'](_0x1cd499['query'][_0xdac6('0x94')])+_0xdac6('0xd4')][_0xdac6('0x3a')]);_0x37aac0[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x1cd499[_0xdac6('0x40')]);_0x37aac0[_0xdac6('0x55')]=_['intersection'](_0x37aac0[_0xdac6('0x56')],_0x37aac0[_0xdac6('0x40')]);_0x7d20b4['attributes']=_[_0xdac6('0xc8')](_0x37aac0[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x1cd499['query']['fields']));_0x7d20b4[_0xdac6('0x45')]=_0x7d20b4[_0xdac6('0x45')][_0xdac6('0x49')]?_0x7d20b4[_0xdac6('0x45')]:_0x37aac0[_0xdac6('0x56')];_0x7d20b4[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x1cd499[_0xdac6('0x40')][_0xdac6('0xca')]);_0x7d20b4['where']=qs[_0xdac6('0x55')](_['pick'](_0x1cd499[_0xdac6('0x40')],_0x37aac0[_0xdac6('0x55')]));if(_0x1cd499['query']['filter']){_0x7d20b4[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x7d20b4[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x7d20b4['attributes'],function(_0x4384d5){var _0x1ced8f={};_0x1ced8f[_0x4384d5]={'$like':'%'+_0x1cd499[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x1ced8f;})});}_0x7d20b4=_['merge']({},_0x7d20b4,_0x1cd499[_0xdac6('0x58')]);switch(_0x2c24d4['role']){case'admin':return db[_[_0xdac6('0x9c')](_0x1cd499['query'][_0xdac6('0x94')])+_0xdac6('0xd4')][_0xdac6('0xa6')](_0x7d20b4);case _0xdac6('0x2c'):case'agent':return _0x2c24d4[_0xdac6('0x29')+_['capitalize'](_0x1cd499['query']['channel'])+_0xdac6('0x9e')](_0x7d20b4);default:throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0xd5'));}})[_0xdac6('0x14')](function(_0x400609){_0x124374=_0x400609[_0xdac6('0x49')];if(!_0x1cd499[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x7d20b4[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x1cd499['query'][_0xdac6('0x22')]);_0x7d20b4['offset']=qs[_0xdac6('0x20')](_0x1cd499[_0xdac6('0x40')]['offset']);}switch(_0x2c24d4[_0xdac6('0x2a')]){case _0xdac6('0x2b'):return db[_[_0xdac6('0x9c')](_0x1cd499[_0xdac6('0x40')][_0xdac6('0x94')])+_0xdac6('0xd4')][_0xdac6('0xa6')](_0x7d20b4);case _0xdac6('0x2c'):case _0xdac6('0x2e'):return _0x2c24d4[_0xdac6('0x29')+_[_0xdac6('0x9c')](_0x1cd499[_0xdac6('0x40')][_0xdac6('0x94')])+'Queues'](_0x7d20b4);}})[_0xdac6('0x14')](function(_0x5817f5){return{'count':_0x124374,'rows':_0x5817f5};})[_0xdac6('0x14')](respondWithResult(_0x189992,null))[_0xdac6('0x51')](handleError(_0x189992,null));};exports[_0xdac6('0xd7')]=function(_0x24cc75,_0x6b41f1){var _0x59d64d={};var _0x2b4c42={};var _0x286d1d;var _0x1bdbe0;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x24cc75[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x6b41f1,null))[_0xdac6('0x14')](function(_0x16c2e0){if(_0x16c2e0){_0x286d1d=_0x16c2e0;_0x2b4c42[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0xa8')][_0xdac6('0x3a')]);_0x2b4c42[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x24cc75['query']);_0x2b4c42['filters']=_[_0xdac6('0xc8')](_0x2b4c42['model'],_0x2b4c42[_0xdac6('0x40')]);_0x59d64d['attributes']=_['intersection'](_0x2b4c42[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x24cc75[_0xdac6('0x40')]['fields']));_0x59d64d[_0xdac6('0x45')]=_0x59d64d[_0xdac6('0x45')][_0xdac6('0x49')]?_0x59d64d[_0xdac6('0x45')]:_0x2b4c42[_0xdac6('0x56')];_0x59d64d[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x24cc75[_0xdac6('0x40')]['sort']);_0x59d64d[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x24cc75['query'],_0x2b4c42[_0xdac6('0x55')]));if(_0x24cc75['query'][_0xdac6('0x31')]){_0x59d64d[_0xdac6('0xcb')]=_['merge'](_0x59d64d[_0xdac6('0xcb')],{'$or':_['map'](_0x59d64d[_0xdac6('0x45')],function(_0x1badd5){var _0x46faa3={};_0x46faa3[_0x1badd5]={'$like':'%'+_0x24cc75[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x46faa3;})});}_0x59d64d=_[_0xdac6('0xcd')]({},_0x59d64d,_0x24cc75[_0xdac6('0x58')]);return _0x286d1d[_0xdac6('0xd7')](_0x59d64d);}})[_0xdac6('0x14')](function(_0x29511a){if(_0x29511a){_0x1bdbe0=_0x29511a[_0xdac6('0x49')];if(!_0x24cc75[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x59d64d[_0xdac6('0x22')]=qs['limit'](_0x24cc75[_0xdac6('0x40')]['limit']);_0x59d64d[_0xdac6('0x20')]=qs['offset'](_0x24cc75[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x286d1d[_0xdac6('0xd7')](_0x59d64d);}})[_0xdac6('0x14')](function(_0x313371){if(_0x313371){return _0x313371?{'count':_0x1bdbe0,'rows':_0x313371}:null;}})['then'](respondWithResult(_0x6b41f1,null))[_0xdac6('0x51')](handleError(_0x6b41f1,null));};exports[_0xdac6('0xd8')]=function(_0x26a1eb,_0x354e0a){var _0x121c0c={};var _0x5f0c8a={};var _0x44bf44;var _0x5901d0;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x26a1eb[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x354e0a,null))[_0xdac6('0x14')](function(_0x3605fd){if(_0x3605fd){_0x44bf44=_0x3605fd;_0x5f0c8a['model']=_['keys'](db[_0xdac6('0xd9')]['rawAttributes']);_0x5f0c8a['query']=_[_0xdac6('0xc7')](_0x26a1eb[_0xdac6('0x40')]);_0x5f0c8a[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x5f0c8a[_0xdac6('0x56')],_0x5f0c8a[_0xdac6('0x40')]);_0x121c0c[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x5f0c8a['model'],qs[_0xdac6('0x57')](_0x26a1eb[_0xdac6('0x40')][_0xdac6('0x57')]));_0x121c0c[_0xdac6('0x45')]=_0x121c0c[_0xdac6('0x45')][_0xdac6('0x49')]?_0x121c0c[_0xdac6('0x45')]:_0x5f0c8a[_0xdac6('0x56')];_0x121c0c[_0xdac6('0xc9')]=qs['sort'](_0x26a1eb[_0xdac6('0x40')][_0xdac6('0xca')]);_0x121c0c['where']=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x26a1eb[_0xdac6('0x40')],_0x5f0c8a[_0xdac6('0x55')]));if(_0x26a1eb[_0xdac6('0x40')][_0xdac6('0x31')]){_0x121c0c['where']=_[_0xdac6('0xcd')](_0x121c0c[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x121c0c[_0xdac6('0x45')],function(_0xba8d14){var _0x24e11d={};_0x24e11d[_0xba8d14]={'$like':'%'+_0x26a1eb[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x24e11d;})});}_0x121c0c=_[_0xdac6('0xcd')]({},_0x121c0c,_0x26a1eb['options']);return _0x44bf44[_0xdac6('0xd8')](_0x121c0c);}})[_0xdac6('0x14')](function(_0x1c8e05){if(_0x1c8e05){_0x5901d0=_0x1c8e05['length'];if(!_0x26a1eb[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x121c0c['limit']=qs[_0xdac6('0x22')](_0x26a1eb[_0xdac6('0x40')][_0xdac6('0x22')]);_0x121c0c[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x26a1eb[_0xdac6('0x40')]['offset']);}return _0x44bf44[_0xdac6('0xd8')](_0x121c0c);}})[_0xdac6('0x14')](function(_0x9f9234){if(_0x9f9234){return _0x9f9234?{'count':_0x5901d0,'rows':_0x9f9234}:null;}})[_0xdac6('0x14')](respondWithResult(_0x354e0a,null))[_0xdac6('0x51')](handleError(_0x354e0a,null));};exports[_0xdac6('0xda')]=function(_0x17bec6,_0x3a6412){var _0x84e095={'raw':!![],'where':{}};var _0x25d913={};var _0x5723fd={'count':0x0,'rows':[]};return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x17bec6['params']['id']}})['then'](handleEntityNotFound(_0x3a6412,null))[_0xdac6('0x14')](function(_0x57f65e){if(_0x57f65e){_0x25d913[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db['VoiceRecording']['rawAttributes']);_0x25d913[_0xdac6('0x40')]=_['keys'](_0x17bec6[_0xdac6('0x40')]);_0x25d913['filters']=_[_0xdac6('0xc8')](_0x25d913[_0xdac6('0x56')],_0x25d913[_0xdac6('0x40')]);_0x84e095[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x25d913[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x17bec6['query']['fields']));_0x84e095[_0xdac6('0x45')]=_0x84e095[_0xdac6('0x45')][_0xdac6('0x49')]?_0x84e095[_0xdac6('0x45')]:_0x25d913[_0xdac6('0x56')];if(!_0x17bec6['query'][_0xdac6('0xcf')]('nolimit')){_0x84e095[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x17bec6[_0xdac6('0x40')][_0xdac6('0x22')]);_0x84e095[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x17bec6[_0xdac6('0x40')]['offset']);}_0x84e095[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x17bec6[_0xdac6('0x40')][_0xdac6('0xca')]);_0x84e095[_0xdac6('0xcb')]=qs['filters'](_['pick'](_0x17bec6[_0xdac6('0x40')],_0x25d913['filters']));_0x84e095[_0xdac6('0xcb')][_0xdac6('0xdb')]=_0x57f65e['id'];if(_0x17bec6[_0xdac6('0x40')][_0xdac6('0x31')]){_0x84e095[_0xdac6('0xcb')]=_['merge'](_0x84e095['where'],{'$or':_[_0xdac6('0x32')](_0x84e095['attributes'],function(_0x527937){var _0x456948={};_0x456948[_0x527937]={'$like':'%'+_0x17bec6['query'][_0xdac6('0x31')]+'%'};return _0x456948;})});}_0x84e095=_['merge']({},_0x84e095,_0x17bec6[_0xdac6('0x58')]);return db['VoiceRecording']['count']({'where':_0x84e095[_0xdac6('0xcb')]})['then'](function(_0x2833a8){_0x5723fd[_0xdac6('0x23')]=_0x2833a8;if(_0x17bec6[_0xdac6('0x40')][_0xdac6('0x3f')]){_0x84e095[_0xdac6('0x43')]=[{'all':!![]}];}return db[_0xdac6('0xdc')][_0xdac6('0xa6')](_0x84e095);})[_0xdac6('0x14')](function(_0x565d74){_0x5723fd[_0xdac6('0x47')]=_0x565d74;return _0x5723fd;});}})[_0xdac6('0x14')](respondWithFilteredResult(_0x3a6412,_0x84e095))[_0xdac6('0x51')](handleError(_0x3a6412,null));};exports[_0xdac6('0xdd')]=function(_0x5cca3b,_0x1bf4a4){var _0x5057a5={'raw':!![],'where':{}};var _0x282718={};var _0x578f85={'count':0x0,'rows':[]};return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x5cca3b[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x1bf4a4,null))[_0xdac6('0x14')](function(_0x531704){if(_0x531704){_0x282718['model']=_[_0xdac6('0xc7')](db[_0xdac6('0xde')][_0xdac6('0x3a')]);_0x282718[_0xdac6('0x40')]=_['keys'](_0x5cca3b['query']);_0x282718[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x282718['model'],_0x282718[_0xdac6('0x40')]);_0x5057a5[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x282718[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x5cca3b[_0xdac6('0x40')][_0xdac6('0x57')]));_0x5057a5[_0xdac6('0x45')]=_0x5057a5['attributes'][_0xdac6('0x49')]?_0x5057a5[_0xdac6('0x45')]:_0x282718['model'];if(!_0x5cca3b[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x5057a5[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x5cca3b[_0xdac6('0x40')][_0xdac6('0x22')]);_0x5057a5[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x5cca3b['query'][_0xdac6('0x20')]);}_0x5057a5[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x5cca3b[_0xdac6('0x40')][_0xdac6('0xca')]);_0x5057a5[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x5cca3b[_0xdac6('0x40')],_0x282718['filters']));_0x5057a5['where'][_0xdac6('0xdb')]=_0x531704['id'];if(_0x5cca3b[_0xdac6('0x40')][_0xdac6('0x31')]){_0x5057a5[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x5057a5[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x5057a5['attributes'],function(_0x46080d){var _0x3f2bbc={};_0x3f2bbc[_0x46080d]={'$like':'%'+_0x5cca3b[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x3f2bbc;})});}_0x5057a5=_['merge']({},_0x5057a5,_0x5cca3b['options']);return db[_0xdac6('0xde')][_0xdac6('0x23')]({'where':_0x5057a5['where']})['then'](function(_0x3adfb0){_0x578f85[_0xdac6('0x23')]=_0x3adfb0;if(_0x5cca3b[_0xdac6('0x40')][_0xdac6('0x3f')]){_0x5057a5[_0xdac6('0x43')]=[{'all':!![]}];}return db[_0xdac6('0xde')][_0xdac6('0xa6')](_0x5057a5);})[_0xdac6('0x14')](function(_0x2f7fbe){_0x578f85[_0xdac6('0x47')]=_0x2f7fbe;return _0x578f85;});}})[_0xdac6('0x14')](respondWithFilteredResult(_0x1bf4a4,_0x5057a5))['catch'](handleError(_0x1bf4a4,null));};exports[_0xdac6('0xdf')]=function(_0x5a1f12,_0x3d9c66){var _0xd33689={};var _0x1f6972={};var _0x36f411;var _0x2241d1;return db['User'][_0xdac6('0x8d')]({'where':{'id':_0x5a1f12['params']['id']}})['then'](handleEntityNotFound(_0x3d9c66,null))['then'](function(_0x1205ea){if(_0x1205ea){_0x36f411=_0x1205ea;_0x1f6972[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0xe0')][_0xdac6('0x3a')]);_0x1f6972[_0xdac6('0x40')]=_['keys'](_0x5a1f12[_0xdac6('0x40')]);_0x1f6972[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x1f6972[_0xdac6('0x56')],_0x1f6972[_0xdac6('0x40')]);_0xd33689[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x1f6972[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x5a1f12[_0xdac6('0x40')][_0xdac6('0x57')]));_0xd33689[_0xdac6('0x45')]=_0xd33689[_0xdac6('0x45')]['length']?_0xd33689[_0xdac6('0x45')]:_0x1f6972[_0xdac6('0x56')];_0xd33689[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x5a1f12[_0xdac6('0x40')]['sort']);_0xd33689[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x5a1f12['query'],_0x1f6972['filters']));if(_0x5a1f12[_0xdac6('0x40')][_0xdac6('0x31')]){_0xd33689['where']=_[_0xdac6('0xcd')](_0xd33689[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0xd33689[_0xdac6('0x45')],function(_0x2860d3){var _0x4d5c6e={};_0x4d5c6e[_0x2860d3]={'$like':'%'+_0x5a1f12[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x4d5c6e;})});}_0xd33689=_[_0xdac6('0xcd')]({},_0xd33689,_0x5a1f12[_0xdac6('0x58')]);return _0x36f411[_0xdac6('0xdf')](_0xd33689);}})[_0xdac6('0x14')](function(_0xb481db){if(_0xb481db){_0x2241d1=_0xb481db[_0xdac6('0x49')];if(!_0x5a1f12[_0xdac6('0x40')][_0xdac6('0xcf')]('nolimit')){_0xd33689[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x5a1f12[_0xdac6('0x40')]['limit']);_0xd33689[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x5a1f12[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x36f411['getChatInteractions'](_0xd33689);}})[_0xdac6('0x14')](function(_0x3dcf41){if(_0x3dcf41){return _0x3dcf41?{'count':_0x2241d1,'rows':_0x3dcf41}:null;}})[_0xdac6('0x14')](respondWithResult(_0x3d9c66,null))['catch'](handleError(_0x3d9c66,null));};exports['getOpenchannelInteractions']=function(_0x2f5854,_0xcd7f19){var _0x1c51f2={};var _0x6a96f6={};var _0x4c0a2b;var _0x1e9e7c;return db[_0xdac6('0x39')]['findOne']({'where':{'id':_0x2f5854['params']['id']}})['then'](handleEntityNotFound(_0xcd7f19,null))[_0xdac6('0x14')](function(_0x526583){if(_0x526583){_0x4c0a2b=_0x526583;_0x6a96f6[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0xe1')][_0xdac6('0x3a')]);_0x6a96f6[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x2f5854[_0xdac6('0x40')]);_0x6a96f6[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x6a96f6[_0xdac6('0x56')],_0x6a96f6[_0xdac6('0x40')]);_0x1c51f2[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x6a96f6[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x2f5854[_0xdac6('0x40')]['fields']));_0x1c51f2[_0xdac6('0x45')]=_0x1c51f2[_0xdac6('0x45')][_0xdac6('0x49')]?_0x1c51f2[_0xdac6('0x45')]:_0x6a96f6[_0xdac6('0x56')];_0x1c51f2[_0xdac6('0xc9')]=qs['sort'](_0x2f5854[_0xdac6('0x40')][_0xdac6('0xca')]);_0x1c51f2[_0xdac6('0xcb')]=qs['filters'](_['pick'](_0x2f5854[_0xdac6('0x40')],_0x6a96f6[_0xdac6('0x55')]));if(_0x2f5854[_0xdac6('0x40')][_0xdac6('0x31')]){_0x1c51f2[_0xdac6('0xcb')]=_['merge'](_0x1c51f2[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x1c51f2[_0xdac6('0x45')],function(_0x27718f){var _0x320595={};_0x320595[_0x27718f]={'$like':'%'+_0x2f5854['query'][_0xdac6('0x31')]+'%'};return _0x320595;})});}_0x1c51f2=_[_0xdac6('0xcd')]({},_0x1c51f2,_0x2f5854[_0xdac6('0x58')]);return _0x4c0a2b['getOpenchannelInteractions'](_0x1c51f2);}})[_0xdac6('0x14')](function(_0x4d90b6){if(_0x4d90b6){_0x1e9e7c=_0x4d90b6[_0xdac6('0x49')];if(!_0x2f5854['query']['hasOwnProperty']('nolimit')){_0x1c51f2[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x2f5854['query'][_0xdac6('0x22')]);_0x1c51f2[_0xdac6('0x20')]=qs['offset'](_0x2f5854[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x4c0a2b['getOpenchannelInteractions'](_0x1c51f2);}})[_0xdac6('0x14')](function(_0x49a54e){if(_0x49a54e){return _0x49a54e?{'count':_0x1e9e7c,'rows':_0x49a54e}:null;}})['then'](respondWithResult(_0xcd7f19,null))[_0xdac6('0x51')](handleError(_0xcd7f19,null));};exports[_0xdac6('0xe2')]=function(_0x2e10d4,_0x1e37f6){var _0x40ccc3={'raw':!![],'where':{}};var _0x52bdf6={};var _0x498c24={'count':0x0,'rows':[]};return db[_0xdac6('0x39')]['findOne']({'where':{'id':_0x2e10d4[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1e37f6,null))['then'](function(_0x2fc547){if(_0x2fc547){_0x52bdf6[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0xe3')][_0xdac6('0x3a')]);_0x52bdf6['query']=_['keys'](_0x2e10d4[_0xdac6('0x40')]);_0x52bdf6[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x52bdf6['model'],_0x52bdf6[_0xdac6('0x40')]);_0x40ccc3[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x52bdf6[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x2e10d4[_0xdac6('0x40')][_0xdac6('0x57')]));_0x40ccc3[_0xdac6('0x45')]=_0x40ccc3[_0xdac6('0x45')][_0xdac6('0x49')]?_0x40ccc3[_0xdac6('0x45')]:_0x52bdf6[_0xdac6('0x56')];if(!_0x2e10d4[_0xdac6('0x40')]['hasOwnProperty']('nolimit')){_0x40ccc3['limit']=qs[_0xdac6('0x22')](_0x2e10d4[_0xdac6('0x40')][_0xdac6('0x22')]);_0x40ccc3[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x2e10d4[_0xdac6('0x40')][_0xdac6('0x20')]);}_0x40ccc3[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x2e10d4[_0xdac6('0x40')][_0xdac6('0xca')]);_0x40ccc3[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x2e10d4[_0xdac6('0x40')],_0x52bdf6[_0xdac6('0x55')]));_0x40ccc3[_0xdac6('0xcb')]['UserId']=_0x2fc547['id'];if(_0x2e10d4['query'][_0xdac6('0x31')]){_0x40ccc3[_0xdac6('0xcb')]=_['merge'](_0x40ccc3['where'],{'$or':_[_0xdac6('0x32')](_0x40ccc3[_0xdac6('0x45')],function(_0x3954b1){var _0x5c0a6f={};_0x5c0a6f[_0x3954b1]={'$like':'%'+_0x2e10d4['query'][_0xdac6('0x31')]+'%'};return _0x5c0a6f;})});}_0x40ccc3=_['merge']({},_0x40ccc3,_0x2e10d4[_0xdac6('0x58')]);return db['MailInteraction'][_0xdac6('0x23')]({'where':_0x40ccc3[_0xdac6('0xcb')]})[_0xdac6('0x14')](function(_0x15f9c3){_0x498c24[_0xdac6('0x23')]=_0x15f9c3;if(_0x2e10d4['query'][_0xdac6('0x3f')]){_0x40ccc3[_0xdac6('0x43')]=[{'all':!![]}];}return db[_0xdac6('0xe3')][_0xdac6('0xa6')](_0x40ccc3);})[_0xdac6('0x14')](function(_0x1de0d3){_0x498c24[_0xdac6('0x47')]=_0x1de0d3;return _0x498c24;});}})[_0xdac6('0x14')](respondWithFilteredResult(_0x1e37f6,_0x40ccc3))[_0xdac6('0x51')](handleError(_0x1e37f6,null));};exports[_0xdac6('0xe4')]=function(_0x3d34df,_0x17b8d2){var _0x5c4c2c={};var _0x2e5d13={};var _0x564c41;var _0x1b13e8;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x3d34df[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x17b8d2,null))[_0xdac6('0x14')](function(_0x4d0a9d){if(_0x4d0a9d){_0x564c41=_0x4d0a9d;_0x2e5d13[_0xdac6('0x56')]=_['keys'](db[_0xdac6('0xe5')][_0xdac6('0x3a')]);_0x2e5d13[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x3d34df[_0xdac6('0x40')]);_0x2e5d13[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x2e5d13[_0xdac6('0x56')],_0x2e5d13[_0xdac6('0x40')]);_0x5c4c2c['attributes']=_[_0xdac6('0xc8')](_0x2e5d13[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x3d34df[_0xdac6('0x40')][_0xdac6('0x57')]));_0x5c4c2c[_0xdac6('0x45')]=_0x5c4c2c[_0xdac6('0x45')][_0xdac6('0x49')]?_0x5c4c2c[_0xdac6('0x45')]:_0x2e5d13[_0xdac6('0x56')];_0x5c4c2c['order']=qs[_0xdac6('0xca')](_0x3d34df['query'][_0xdac6('0xca')]);_0x5c4c2c[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_['pick'](_0x3d34df['query'],_0x2e5d13['filters']));if(_0x3d34df[_0xdac6('0x40')][_0xdac6('0x31')]){_0x5c4c2c[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x5c4c2c[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x5c4c2c[_0xdac6('0x45')],function(_0xd37816){var _0x1dc716={};_0x1dc716[_0xd37816]={'$like':'%'+_0x3d34df[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x1dc716;})});}_0x5c4c2c=_[_0xdac6('0xcd')]({},_0x5c4c2c,_0x3d34df['options']);return _0x564c41[_0xdac6('0xe4')](_0x5c4c2c);}})[_0xdac6('0x14')](function(_0x46001f){if(_0x46001f){_0x1b13e8=_0x46001f[_0xdac6('0x49')];if(!_0x3d34df[_0xdac6('0x40')]['hasOwnProperty']('nolimit')){_0x5c4c2c[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x3d34df[_0xdac6('0x40')][_0xdac6('0x22')]);_0x5c4c2c[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x3d34df[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x564c41[_0xdac6('0xe4')](_0x5c4c2c);}})[_0xdac6('0x14')](function(_0x213219){if(_0x213219){return _0x213219?{'count':_0x1b13e8,'rows':_0x213219}:null;}})[_0xdac6('0x14')](respondWithResult(_0x17b8d2,null))['catch'](handleError(_0x17b8d2,null));};exports[_0xdac6('0xe6')]=function(_0x4c7a1a,_0x4eb277){var _0x574649={};var _0x374eb3={};var _0x33b6d1;var _0x58bd1a;return db['User'][_0xdac6('0x8d')]({'where':{'id':_0x4c7a1a[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x4eb277,null))[_0xdac6('0x14')](function(_0x37d12d){if(_0x37d12d){_0x33b6d1=_0x37d12d;_0x374eb3[_0xdac6('0x56')]=_['keys'](db[_0xdac6('0xe7')][_0xdac6('0x3a')]);_0x374eb3[_0xdac6('0x40')]=_['keys'](_0x4c7a1a[_0xdac6('0x40')]);_0x374eb3['filters']=_[_0xdac6('0xc8')](_0x374eb3['model'],_0x374eb3['query']);_0x574649[_0xdac6('0x45')]=_['intersection'](_0x374eb3[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x4c7a1a[_0xdac6('0x40')][_0xdac6('0x57')]));_0x574649['attributes']=_0x574649[_0xdac6('0x45')][_0xdac6('0x49')]?_0x574649[_0xdac6('0x45')]:_0x374eb3[_0xdac6('0x56')];_0x574649[_0xdac6('0xc9')]=qs['sort'](_0x4c7a1a[_0xdac6('0x40')][_0xdac6('0xca')]);_0x574649[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_['pick'](_0x4c7a1a[_0xdac6('0x40')],_0x374eb3[_0xdac6('0x55')]));if(_0x4c7a1a[_0xdac6('0x40')][_0xdac6('0x31')]){_0x574649[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x574649[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x574649[_0xdac6('0x45')],function(_0x5f3b45){var _0x5f089b={};_0x5f089b[_0x5f3b45]={'$like':'%'+_0x4c7a1a[_0xdac6('0x40')]['filter']+'%'};return _0x5f089b;})});}_0x574649=_[_0xdac6('0xcd')]({},_0x574649,_0x4c7a1a[_0xdac6('0x58')]);return _0x33b6d1[_0xdac6('0xe6')](_0x574649);}})[_0xdac6('0x14')](function(_0x1b2cb4){if(_0x1b2cb4){_0x58bd1a=_0x1b2cb4['length'];if(!_0x4c7a1a[_0xdac6('0x40')]['hasOwnProperty'](_0xdac6('0xd6'))){_0x574649[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x4c7a1a[_0xdac6('0x40')][_0xdac6('0x22')]);_0x574649[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x4c7a1a[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x33b6d1['getFaxInteractions'](_0x574649);}})[_0xdac6('0x14')](function(_0x85f89d){if(_0x85f89d){return _0x85f89d?{'count':_0x58bd1a,'rows':_0x85f89d}:null;}})[_0xdac6('0x14')](respondWithResult(_0x4eb277,null))['catch'](handleError(_0x4eb277,null));};exports[_0xdac6('0xe8')]=function(_0x43ac1f,_0x5cbaee){var _0x3ea6e5={};var _0x59bbcf={};var _0x258417;var _0x28e1be;return db[_0xdac6('0x39')]['findOne']({'where':{'id':_0x43ac1f[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x5cbaee,null))[_0xdac6('0x14')](function(_0x105ea3){if(_0x105ea3){_0x258417=_0x105ea3;_0x59bbcf[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0xe9')][_0xdac6('0x3a')]);_0x59bbcf[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x43ac1f['query']);_0x59bbcf[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x59bbcf[_0xdac6('0x56')],_0x59bbcf['query']);_0x3ea6e5[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x59bbcf['model'],qs[_0xdac6('0x57')](_0x43ac1f['query'][_0xdac6('0x57')]));_0x3ea6e5[_0xdac6('0x45')]=_0x3ea6e5[_0xdac6('0x45')][_0xdac6('0x49')]?_0x3ea6e5[_0xdac6('0x45')]:_0x59bbcf[_0xdac6('0x56')];_0x3ea6e5[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x43ac1f[_0xdac6('0x40')][_0xdac6('0xca')]);_0x3ea6e5[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x43ac1f[_0xdac6('0x40')],_0x59bbcf[_0xdac6('0x55')]));if(_0x43ac1f[_0xdac6('0x40')][_0xdac6('0x31')]){_0x3ea6e5[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x3ea6e5[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x3ea6e5[_0xdac6('0x45')],function(_0x4cb772){var _0x1538e7={};_0x1538e7[_0x4cb772]={'$like':'%'+_0x43ac1f[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x1538e7;})});}_0x3ea6e5=_['merge']({},_0x3ea6e5,_0x43ac1f[_0xdac6('0x58')]);return _0x258417[_0xdac6('0xe8')](_0x3ea6e5);}})[_0xdac6('0x14')](function(_0x489377){if(_0x489377){_0x28e1be=_0x489377[_0xdac6('0x49')];if(!_0x43ac1f[_0xdac6('0x40')]['hasOwnProperty']('nolimit')){_0x3ea6e5[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x43ac1f[_0xdac6('0x40')][_0xdac6('0x22')]);_0x3ea6e5[_0xdac6('0x20')]=qs['offset'](_0x43ac1f[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x258417[_0xdac6('0xe8')](_0x3ea6e5);}})[_0xdac6('0x14')](function(_0xe94fd4){if(_0xe94fd4){return _0xe94fd4?{'count':_0x28e1be,'rows':_0xe94fd4}:null;}})[_0xdac6('0x14')](respondWithResult(_0x5cbaee,null))[_0xdac6('0x51')](handleError(_0x5cbaee,null));};exports[_0xdac6('0xea')]=function(_0xce4f58,_0x41c507,_0x5036a4){var _0xe97e26;var _0x307afe;var _0x346284;var _0x3d0891=!_[_0xdac6('0x5f')](_0xce4f58[_0xdac6('0x53')]['id'])?_0xce4f58[_0xdac6('0x53')]['id']:!_[_0xdac6('0x5f')](_0xce4f58['user']['id'])?_0xce4f58[_0xdac6('0x2c')]['id']:null;return db['User'][_0xdac6('0x35')]({'where':{'id':_0x3d0891,'role':{'$or':[_0xdac6('0x2b'),_0xdac6('0x2c'),_0xdac6('0x2e')]}},'attributes':['id',_0xdac6('0x37'),_0xdac6('0xeb'),_0xdac6('0xec'),'role',_0xdac6('0x60'),_0xdac6('0x96')]})[_0xdac6('0x14')](function(_0x1be0ca){if(_0x1be0ca){if(_0x1be0ca[_0xdac6('0x2a')]==='agent'){_0xe97e26=_0x1be0ca;if(_0xce4f58['body'][_0xdac6('0x98')]){_0x346284=util[_0xdac6('0xa7')](_0xdac6('0xed'),_0xe97e26[_0xce4f58[_0xdac6('0x59')][_0xdac6('0x98')]]);}else if(_0xce4f58['body'][_0xdac6('0xee')]){_0x346284=util[_0xdac6('0xa7')](_0xdac6('0xef'),_0xce4f58[_0xdac6('0x59')]['intrf']);}else{_0x346284=util[_0xdac6('0xa7')](_0xdac6('0xef'),_0xe97e26[_0xdac6('0x37')]);}socket['to'](util[_0xdac6('0xa7')]('user:%s',_0xe97e26['name']))[_0xdac6('0xac')](_0xdac6('0xf0'),{'user':{'id':_0xe97e26['id'],'name':_0xe97e26[_0xdac6('0x37')]},'ip':_0xce4f58[_0xdac6('0xf1')][_0xdac6('0xf2')]||_0xce4f58['connection']['remoteAddress']||_0xce4f58[_0xdac6('0xf3')][_0xdac6('0xf4')]||_0xce4f58[_0xdac6('0xf5')][_0xdac6('0xf3')][_0xdac6('0xf4')]});return db[_0xdac6('0xa8')][_0xdac6('0x28')]({'where':{'membername':_0xe97e26[_0xdac6('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0xdac6('0x85'))][(_0xdac6('0x86'))](_0xdac6('0xf6'));}})[_0xdac6('0x14')](function(){if(_0xe97e26){return _0xe97e26['getVoiceQueues']({'raw':!![]});}})[_0xdac6('0x14')](function(_0x1db68c){if(_0xe97e26){if(_0x1db68c){_0x307afe=_0x1db68c;if(_0x307afe[_0xdac6('0x49')]){var _0x457b79=_0x307afe[_0xdac6('0x32')](function(_0x4f374c){var _0x1717a9={'membername':_0xe97e26['name'],'UserId':_0xe97e26['id'],'queue_name':_0x4f374c['name'],'VoiceQueueId':_0x4f374c['id'],'interface':_0x346284,'paused':_0xe97e26[_0xdac6('0x96')]||![],'penalty':_0x4f374c[_0xdac6('0xf7')]||0x0};return db['UserVoiceQueueRt'][_0xdac6('0xa9')](_0x1717a9);});return Promise['all'](_0x457b79);}}}})[_0xdac6('0x14')](function(){if(_0xe97e26){return db[_0xdac6('0xf8')][_0xdac6('0xa6')]({'where':{'membername':_0xe97e26[_0xdac6('0x37')],'exitAt':null}});}})[_0xdac6('0x14')](function(_0x5d7d96){if(_0xe97e26){var _0xf20d30=[];_0x5d7d96['forEach'](function(_0x5f38d0){_0xf20d30['push'](_0x5f38d0[_0xdac6('0x26')]({'exitAt':moment()[_0xdac6('0xa7')](_0xdac6('0xf9'))}));});return Promise[_0xdac6('0x50')](_0xf20d30);}})[_0xdac6('0x14')](function(){if(_0xe97e26){var _0x3c451d=[];var _0x2914b7=[];var _0x4cd80c=utils['getChannels']();var _0x105dab={'membername':_0xe97e26['name'],'interface':_0x346284,'enterAt':moment()[_0xdac6('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xe97e26[_0xdac6('0x2a')],'internal':_0xe97e26['internal']};_0x4cd80c[_0xdac6('0xfa')](function(_0x3c9e00){_0x3c451d['push'](_['merge']({'channel':_0x3c9e00,'type':_0xdac6('0xfb'),'data1':_0xce4f58[_0xdac6('0x59')]['device'],'data2':_0x346284},_0x105dab));if(_0xe97e26[_0xdac6('0x96')]){_0x2914b7[_0xdac6('0x46')](_['merge']({'channel':_0x3c9e00,'type':_0xdac6('0xfc'),'data1':_0xdac6('0xfd')},_0x105dab));}});return db[_0xdac6('0xf8')][_0xdac6('0x7d')](_0x3c451d[_0xdac6('0xc5')](_0x2914b7),{'individualHooks':!![]});}})['then'](function(){if(_0xe97e26){return _0xe97e26[_0xdac6('0x26')]({'online':!![],'lastLoginAt':moment()[_0xdac6('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0xe97e26[_0xdac6('0x96')]||![],'mailPause':_0xe97e26[_0xdac6('0x96')]||![],'chatPause':_0xe97e26[_0xdac6('0x96')]||![],'faxPause':_0xe97e26[_0xdac6('0x96')]||![],'smsPause':_0xe97e26[_0xdac6('0x96')]||![],'openchannelPause':_0xe97e26[_0xdac6('0x96')]||![],'whatsappPause':_0xe97e26['loginInPause']||![],'pauseType':_0xe97e26['loginInPause']?_0xdac6('0xfd'):null,'interface':_0x346284,'lastPauseAt':moment()[_0xdac6('0xa7')](_0xdac6('0xf9'))});}})[_0xdac6('0x14')](function(_0x26dbee){if(_0xce4f58['isMiddleware']){return _0x5036a4();}else{return Promise[_0xdac6('0xfe')](_0x26dbee)[_0xdac6('0x14')](respondWithResult(_0x41c507,null));}})[_0xdac6('0x51')](handleError(_0x41c507,null));};exports['logout']=function(_0x18f762,_0x1858b1){var _0x286112;return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x18f762[_0xdac6('0x53')]['id'],'role':_0xdac6('0x2e')},'attributes':['id',_0xdac6('0x37'),_0xdac6('0x2a')]})[_0xdac6('0x14')](handleEntityNotFound(_0x1858b1,null))[_0xdac6('0x14')](function(_0x2fbdab){if(_0x2fbdab){_0x286112=_0x2fbdab;return db[_0xdac6('0xa8')][_0xdac6('0x28')]({'where':{'membername':_0x286112[_0xdac6('0x37')]},'individualHooks':!![]});}})['then'](function(){return db[_0xdac6('0xf8')]['findAll']({'where':{'membername':_0x286112['name'],'exitAt':null}});})['then'](function(_0x3f3bfe){var _0x500108=[];_0x3f3bfe[_0xdac6('0xfa')](function(_0x4d5a1b){_0x500108[_0xdac6('0x46')](_0x4d5a1b[_0xdac6('0x26')]({'exitAt':moment()['format'](_0xdac6('0xf9'))}));});return Promise['all'](_0x500108);})[_0xdac6('0x14')](function(){return _0x286112[_0xdac6('0x26')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xdac6('0x14')](respondWithResult(_0x1858b1,null))['catch'](handleError(_0x1858b1,null));};exports[_0xdac6('0xff')]=function(_0x335ec7,_0x51d841){var _0x450115;return db[_0xdac6('0xa8')][_0xdac6('0x26')]({'paused':0x1},{'where':{'UserId':_0x335ec7['params']['id']},'individualHooks':!![]})[_0xdac6('0x14')](function(){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x335ec7[_0xdac6('0x53')]['id'],'role':_0xdac6('0x2e')},'attributes':['id','name','role',_0xdac6('0x60'),_0xdac6('0x98'),_0xdac6('0x95')]});})['then'](handleEntityNotFound(_0x51d841,null))[_0xdac6('0x14')](function(_0xbcb857){if(_0xbcb857){_0x450115=_0xbcb857;return respondWithRpcPromise(_0xdac6('0x100'),_0xdac6('0xff'),{'id':_0x450115['id'],'name':_0x450115[_0xdac6('0x37')],'pause':!![]});}})[_0xdac6('0x14')](function(){if(_0x450115){return db[_0xdac6('0xf8')][_0xdac6('0xa6')]({'where':{'membername':_0x450115['name'],'type':'PAUSE','exitAt':null}});}})[_0xdac6('0x14')](function(_0x9873b6){if(_0x9873b6[_0xdac6('0x49')]){var _0x291580=moment()[_0xdac6('0xa7')](_0xdac6('0xf9'));for(var _0x325d11=0x0,_0x1b412f=_0x9873b6[_0xdac6('0x49')];_0x325d11<_0x1b412f;_0x325d11++){_0x9873b6[_0x325d11][_0xdac6('0x101')]({'exitAt':_0x291580});}}})[_0xdac6('0x14')](function(){var _0x3293ff=[];var _0x3feaaf=utils[_0xdac6('0x102')]();_0x3feaaf[_0xdac6('0xfa')](function(_0x4f82a3){_0x3293ff[_0xdac6('0x46')]({'channel':_0x4f82a3,'membername':_0x450115[_0xdac6('0x37')],'interface':_['isNil'](_0x450115[_0xdac6('0x98')])?util['format'](_0xdac6('0xef'),_0x450115['name']):_0x450115[_0xdac6('0x98')],'type':_0xdac6('0xfc'),'enterAt':moment()[_0xdac6('0xa7')](_0xdac6('0xf9')),'data1':_0x335ec7[_0xdac6('0x59')]['type']||_0xdac6('0x103'),'role':_0x450115[_0xdac6('0x2a')],'internal':_0x450115['internal']});});return db[_0xdac6('0xf8')][_0xdac6('0x7d')](_0x3293ff,{'individualHooks':!![]});})[_0xdac6('0x14')](function(){return _0x450115[_0xdac6('0x26')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x335ec7[_0xdac6('0x59')]['type']||_0xdac6('0x103'),'lastPauseAt':moment()[_0xdac6('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdac6('0x14')](respondWithResult(_0x51d841,null))[_0xdac6('0x51')](handleError(_0x51d841,null));};exports[_0xdac6('0x104')]=function(_0x778bd8,_0x466f63){if(_0x778bd8[_0xdac6('0x59')][_0xdac6('0x94')]&&!utils[_0xdac6('0x99')](_0x778bd8[_0xdac6('0x59')]['channel'])){throw new APIBadRequestError(util[_0xdac6('0xa7')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x778bd8[_0xdac6('0x59')][_0xdac6('0x94')]));}return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x778bd8['params']['id']},'attributes':['id','name',_0xdac6('0x2a'),_0xdac6('0x60'),'interface','online','voicePause','mailPause',_0xdac6('0x105'),'faxPause','openchannelPause','smsPause',_0xdac6('0x106'),'pauseType',_0xdac6('0x107')]})[_0xdac6('0x14')](function(_0x37acd0){if(!_0x37acd0){throw new APINotFoundError(util[_0xdac6('0xa7')](_0xdac6('0x108'),_0x778bd8['params']['id']));}return _0x37acd0[_0xdac6('0x104')](_0x778bd8['body'][_0xdac6('0x94')]);})[_0xdac6('0x14')](respondWithResult(_0x466f63,null))[_0xdac6('0x51')](APIHandleError(_0x466f63));};exports[_0xdac6('0x109')]=function(_0x3ee491,_0x3afd6f){var _0xa1bd1e={};var _0x45e53f={};var _0x1be152;var _0x370974;return db['User'][_0xdac6('0x8d')]({'where':{'id':_0x3ee491[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x3afd6f,null))[_0xdac6('0x14')](function(_0x2be90d){if(_0x2be90d){_0x1be152=_0x2be90d;_0x45e53f[_0xdac6('0x56')]=_['keys'](db[_0xdac6('0x10a')][_0xdac6('0x3a')]);_0x45e53f[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x3ee491['query']);_0x45e53f[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x45e53f['model'],_0x45e53f[_0xdac6('0x40')]);_0xa1bd1e[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x45e53f[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x3ee491[_0xdac6('0x40')]['fields']));_0xa1bd1e['attributes']=_0xa1bd1e[_0xdac6('0x45')]['length']?_0xa1bd1e[_0xdac6('0x45')]:_0x45e53f[_0xdac6('0x56')];_0xa1bd1e[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x3ee491['query']['sort']);_0xa1bd1e[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x3ee491[_0xdac6('0x40')],_0x45e53f[_0xdac6('0x55')]));if(_0x3ee491[_0xdac6('0x40')]['filter']){_0xa1bd1e[_0xdac6('0xcb')]=_['merge'](_0xa1bd1e[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0xa1bd1e[_0xdac6('0x45')],function(_0x14c412){var _0x21fc74={};_0x21fc74[_0x14c412]={'$like':'%'+_0x3ee491[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x21fc74;})});}_0xa1bd1e=_['merge']({},_0xa1bd1e,_0x3ee491['options']);return _0x1be152['getTeams'](_0xa1bd1e);}})[_0xdac6('0x14')](function(_0x28f45e){if(_0x28f45e){_0x370974=_0x28f45e['length'];if(!_0x3ee491[_0xdac6('0x40')]['hasOwnProperty']('nolimit')){_0xa1bd1e[_0xdac6('0x22')]=qs['limit'](_0x3ee491[_0xdac6('0x40')][_0xdac6('0x22')]);_0xa1bd1e[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x3ee491[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x1be152[_0xdac6('0x109')](_0xa1bd1e);}})['then'](function(_0x5ea12e){if(_0x5ea12e){return _0x5ea12e?{'count':_0x370974,'rows':_0x5ea12e}:null;}})[_0xdac6('0x14')](respondWithResult(_0x3afd6f,null))[_0xdac6('0x51')](handleError(_0x3afd6f,null));};exports[_0xdac6('0x10b')]=function(_0x21f97c,_0x2eee9b){var _0x25fc37=_0x21f97c['params']['id'];var _0x27d5a2=_0x21f97c['body']?_0x21f97c['body'][_0xdac6('0xa1')]:null;var _0x449158=[];return Promise[_0xdac6('0xfe')]()[_0xdac6('0x14')](function(){if(!_0x27d5a2)throw new APIBadRequestError(_0xdac6('0x10c'));})['then'](function(){return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x25fc37}});})['then'](function(_0x402edf){if(!_0x402edf)throw new APINotFoundError(util[_0xdac6('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x21f97c['params']['id']));return db[_0xdac6('0x62')][_0xdac6('0x10d')](function(_0x36e85e){return _0x402edf['addTeams'](_0x27d5a2,{'transaction':_0x36e85e})['then'](function(){return db[_0xdac6('0x10a')]['findAll']({'where':{'id':{'$in':_0x27d5a2}}});})[_0xdac6('0x14')](function(_0x1ee933){var _0xe05a3b=_[_0xdac6('0x32')](_0x1ee933,function(_0x4ca4d8){return _0x4ca4d8[_0xdac6('0x10e')]();});return Promise[_0xdac6('0x50')](_0xe05a3b);})[_0xdac6('0x14')](function(_0x4e6dae){_0x449158=_['flattenDeep'](_0x4e6dae);var _0x5cc12c=_[_0xdac6('0x32')](_0x449158,function(_0x14a1b9){return _0x14a1b9['addAgent'](_0x402edf['id'],{'transaction':_0x36e85e});});return Promise[_0xdac6('0x50')](_0x5cc12c);})[_0xdac6('0x14')](function(){if(!_0x402edf[_0xdac6('0x95')])return;var _0x1bd141=_['filter'](_0x449158,function(_0x2707cb){return _0x2707cb[_0xdac6('0x10f')](_0xdac6('0x94'))==='Voice';});var _0x59786f=_[_0xdac6('0x32')](_0x1bd141,function(_0xe8307b){return db[_0xdac6('0xa8')][_0xdac6('0xa9')]({'membername':_0x402edf[_0xdac6('0x37')],'UserId':_0x402edf['id'],'queue_name':_0xe8307b[_0xdac6('0x37')],'VoiceQueueId':_0xe8307b['id'],'interface':_[_0xdac6('0x5f')](_0x402edf[_0xdac6('0x98')])?util[_0xdac6('0xa7')]('SIP/%s',_0x402edf[_0xdac6('0x37')]):_0x402edf[_0xdac6('0x98')],'paused':_0x402edf[_0xdac6('0x97')]||![],'penalty':_0x402edf[_0xdac6('0x9f')]},{'transaction':_0x36e85e});});return Promise[_0xdac6('0x50')](_0x59786f);})['then'](function(){return db[_0xdac6('0x110')][_0xdac6('0xa6')]({'where':{'teamId':{'$in':_0x27d5a2}}});})[_0xdac6('0x14')](function(_0x225f22){var _0x12efea=_[_0xdac6('0x32')](_0x225f22,function(_0x2f980c){return db[_0xdac6('0x111')]['create']({'UserId':_0x402edf['id'],'VoicePrefixId':_0x2f980c[_0xdac6('0x112')]},{'transaction':_0x36e85e});});return Promise[_0xdac6('0x50')](_0x12efea);});});})[_0xdac6('0x14')](function(){for(var _0x4089e0=0x0;_0x4089e0<_0x449158['length'];_0x4089e0++){var _0x447fc4=_0x449158[_0x4089e0][_0xdac6('0x10f')]('channel');var _0x50fdb5=_0x447fc4+_0xdac6('0xa2');socket['emit']('user'+_0x447fc4+_0xdac6('0xa3'),{'UserId':_0x25fc37,['queueField']:_0x449158[_0x4089e0]['id']});}})['then'](respondWithStatusCode(_0x2eee9b,null))[_0xdac6('0x51')](APIHandleError(_0x2eee9b));};exports['removeTeams']=function(_0x118719,_0x74b50a){var _0x9148fc=_0x118719[_0xdac6('0x53')]['id'];var _0x164587=null;if(_0x118719['query'][_0xdac6('0xa1')]){_0x164587=_[_0xdac6('0x113')](_0x118719['query'][_0xdac6('0xa1')])?_0x118719[_0xdac6('0x40')][_0xdac6('0xa1')]:[_0x118719['query'][_0xdac6('0xa1')]];}var _0x1f6c1b=[];return Promise[_0xdac6('0xfe')]()['then'](function(){if(!_0x164587)throw new APIBadRequestError(_0xdac6('0x114'));})[_0xdac6('0x14')](function(){return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x9148fc}});})[_0xdac6('0x14')](function(_0x24d38b){if(!_0x24d38b)throw new APINotFoundError(util[_0xdac6('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0x118719['params']['id']));return db['sequelize'][_0xdac6('0x10d')](function(_0x247140){return _0x24d38b['removeTeams'](_0x164587,{'transaction':_0x247140})['then'](function(){return db[_0xdac6('0x10a')][_0xdac6('0xa6')]({'where':{'id':{'$in':_0x164587}}});})[_0xdac6('0x14')](function(_0x456a26){var _0x322ab7=_[_0xdac6('0x32')](_0x456a26,function(_0x107cde){return _0x107cde[_0xdac6('0x10e')]();});return Promise[_0xdac6('0x50')](_0x322ab7);})[_0xdac6('0x14')](function(_0x4100fc){_0x1f6c1b=_[_0xdac6('0x115')](_0x4100fc);var _0x2b1c98=_[_0xdac6('0x32')](_0x1f6c1b,function(_0x2b684b){return _0x2b684b[_0xdac6('0x116')](_0x24d38b['id'],{'transaction':_0x247140});});return Promise['all'](_0x2b1c98);})[_0xdac6('0x14')](function(){if(!_0x24d38b['online'])return;var _0x5a2f7b=_[_0xdac6('0x31')](_0x1f6c1b,function(_0x50f97d){return _0x50f97d[_0xdac6('0x10f')]('channel')===_0xdac6('0x117');});var _0x24b167=_[_0xdac6('0x32')](_0x5a2f7b,function(_0x33f0cf){return db[_0xdac6('0xa8')][_0xdac6('0x28')]({'where':{'VoiceQueueId':_0x33f0cf['id'],'UserId':_0x24d38b['id']},'transaction':_0x247140});});return Promise[_0xdac6('0x50')](_0x24b167);})[_0xdac6('0x14')](function(){return db[_0xdac6('0x110')][_0xdac6('0xa6')]({'where':{'teamId':{'$in':_0x164587}}});})[_0xdac6('0x14')](function(_0x59edc2){var _0x4437c6=_['map'](_0x59edc2,function(_0x1ac682){return db[_0xdac6('0x111')][_0xdac6('0x28')]({'where':{'UserId':_0x24d38b['id'],'VoicePrefixId':_0x1ac682[_0xdac6('0x112')]}},{'transaction':_0x247140});});return Promise[_0xdac6('0x50')](_0x4437c6);});});})[_0xdac6('0x14')](function(){for(var _0x424a49=0x0;_0x424a49<_0x1f6c1b[_0xdac6('0x49')];_0x424a49++){var _0x47bdb6=_0x1f6c1b[_0x424a49][_0xdac6('0x10f')](_0xdac6('0x94'));var _0x298146=_0x47bdb6+_0xdac6('0xa2');socket[_0xdac6('0xac')](_0xdac6('0x2c')+_0x47bdb6+'Queue:remove',{'UserId':_0x9148fc,['queueField']:_0x1f6c1b[_0x424a49]['id']});}})['then'](respondWithStatusCode(_0x74b50a,null))[_0xdac6('0x51')](APIHandleError(_0x74b50a));};exports[_0xdac6('0x118')]=function(_0x2bc7a9,_0x32f814){var _0x5d8774={};var _0x324ba7={};var _0x5b38dc;var _0x32756c;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x2bc7a9[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x32f814,null))['then'](function(_0x3db287){if(_0x3db287){_0x5b38dc=_0x3db287;_0x324ba7[_0xdac6('0x56')]=_['keys'](db['CmList']['rawAttributes']);_0x324ba7[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x2bc7a9['query']);_0x324ba7[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x324ba7[_0xdac6('0x56')],_0x324ba7[_0xdac6('0x40')]);_0x5d8774[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x324ba7[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x2bc7a9['query'][_0xdac6('0x57')]));_0x5d8774['attributes']=_0x5d8774[_0xdac6('0x45')][_0xdac6('0x49')]?_0x5d8774['attributes']:_0x324ba7[_0xdac6('0x56')];_0x5d8774['order']=qs['sort'](_0x2bc7a9[_0xdac6('0x40')][_0xdac6('0xca')]);_0x5d8774[_0xdac6('0xcb')]=qs['filters'](_[_0xdac6('0xcc')](_0x2bc7a9[_0xdac6('0x40')],_0x324ba7[_0xdac6('0x55')]));if(_0x2bc7a9['query'][_0xdac6('0x31')]){_0x5d8774[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x5d8774[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x5d8774['attributes'],function(_0x34c4c1){var _0x2f1970={};_0x2f1970[_0x34c4c1]={'$like':'%'+_0x2bc7a9[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x2f1970;})});}_0x5d8774=_[_0xdac6('0xcd')]({},_0x5d8774,_0x2bc7a9['options']);return _0x5b38dc[_0xdac6('0x118')](_0x5d8774);}})[_0xdac6('0x14')](function(_0x1fdb46){if(_0x1fdb46){_0x32756c=_0x1fdb46['length'];if(!_0x2bc7a9['query'][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x5d8774[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x2bc7a9[_0xdac6('0x40')]['limit']);_0x5d8774['offset']=qs[_0xdac6('0x20')](_0x2bc7a9['query']['offset']);}return _0x5b38dc[_0xdac6('0x118')](_0x5d8774);}})[_0xdac6('0x14')](function(_0x187be2){if(_0x187be2){return _0x187be2?{'count':_0x32756c,'rows':_0x187be2}:null;}})[_0xdac6('0x14')](respondWithResult(_0x32f814,null))['catch'](handleError(_0x32f814,null));};exports['getAgents']=function(_0xdcb709,_0x153415){var _0x4449c4={};var _0x3123bd={};var _0x1fd542;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0xdcb709[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x153415,null))[_0xdac6('0x14')](function(_0x2362cb){if(_0x2362cb){_0x1fd542=_0x2362cb;_0x3123bd[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x39')][_0xdac6('0x3a')]);_0x3123bd[_0xdac6('0x40')]=_['keys'](_0xdcb709[_0xdac6('0x40')]);_0x3123bd[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x3123bd['model'],_0x3123bd[_0xdac6('0x40')]);_0x4449c4[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x3123bd['model'],qs['fields'](_0xdcb709[_0xdac6('0x40')][_0xdac6('0x57')]));_0x4449c4[_0xdac6('0x45')]=_0x4449c4[_0xdac6('0x45')][_0xdac6('0x49')]?_0x4449c4[_0xdac6('0x45')]:_0x3123bd[_0xdac6('0x56')];_0x4449c4[_0xdac6('0xc9')]=qs['sort'](_0xdcb709[_0xdac6('0x40')][_0xdac6('0xca')]);_0x4449c4[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0xdcb709[_0xdac6('0x40')],_0x3123bd[_0xdac6('0x55')]));if(_0xdcb709[_0xdac6('0x40')][_0xdac6('0x31')]){_0x4449c4[_0xdac6('0xcb')]=_['merge'](_0x4449c4['where'],{'$or':_[_0xdac6('0x32')](_0x4449c4[_0xdac6('0x45')],function(_0x3ecaa8){var _0x5b32d7={};_0x5b32d7[_0x3ecaa8]={'$like':'%'+_0xdcb709[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x5b32d7;})});}_0x4449c4['model']=db[_0xdac6('0x39')];_0x4449c4['as']=_0xdac6('0x2d');_0x4449c4=_[_0xdac6('0xcd')]({},_0x4449c4,_0xdcb709[_0xdac6('0x58')]);return _0x1fd542['getVoiceQueues']({'include':[_0x4449c4]});}})[_0xdac6('0x14')](function(_0x3dbe5b){if(_0x3dbe5b){var _0x220b58={},_0x49662d=[];for(var _0x38469f=0x0;_0x38469f<_0x3dbe5b[_0xdac6('0x49')];_0x38469f+=0x1){for(var _0x10da3a=0x0,_0x920518;_0x10da3a<_0x3dbe5b[_0x38469f][_0xdac6('0x2d')][_0xdac6('0x49')];_0x10da3a+=0x1){_0x920518=_0x3dbe5b[_0x38469f][_0xdac6('0x2d')][_0x10da3a]['get']({'plain':!![]});_0x220b58[_0x920518['id']]=_0x920518;}}_0x220b58=_['values'](_0x220b58);for(var _0x1e05eb=qs[_0xdac6('0x20')](_0xdcb709[_0xdac6('0x40')][_0xdac6('0x20')]);_0x1e05eb<_0x220b58['length']&&_0x49662d[_0xdac6('0x49')]<qs['limit'](_0xdcb709[_0xdac6('0x40')][_0xdac6('0x22')]);_0x1e05eb+=0x1){if(_0x220b58[_0x1e05eb]){_0x49662d[_0xdac6('0x46')](_0x220b58[_0x1e05eb]);}}return{'count':_0x220b58[_0xdac6('0x49')],'rows':_0x49662d};}})['then'](respondWithResult(_0x153415,null))['catch'](handleError(_0x153415,null));};exports[_0xdac6('0x28')]=function(_0x67c21,_0x25874e){if(_0x67c21[_0xdac6('0x2c')]['id']==_0x67c21[_0xdac6('0x53')]['id']){return _0x25874e[_0xdac6('0x1e')](0x1f4)[_0xdac6('0x38')]({'message':_0xdac6('0x119')});}return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x67c21[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x25874e,null))[_0xdac6('0x14')](removeEntity(_0x25874e,null))[_0xdac6('0x51')](handleError(_0x25874e,null));};exports[_0xdac6('0x11a')]=function(_0x4725bc,_0x37ca99){return db[_0xdac6('0x39')]['find']({'where':{'id':_0x4725bc[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x37ca99,null))[_0xdac6('0x14')](function(_0x5a0a10){if(_0x5a0a10){return _0x5a0a10[_0xdac6('0x11a')](_0x4725bc['body'][_0xdac6('0xa1')],_[_0xdac6('0x5c')](_0x4725bc[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{})[_0xdac6('0xa0')](function(){for(var _0x4a882b=0x0;_0x4a882b<_0x4725bc[_0xdac6('0x59')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x4a882b+=0x1){socket[_0xdac6('0xac')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x4725bc[_0xdac6('0x59')][_0xdac6('0xa1')][_0x4a882b]),'UserId':Number(_0x4725bc['params']['id'])});}return _0x4725bc[_0xdac6('0x59')][_0xdac6('0xa1')];});}})[_0xdac6('0x14')](respondWithResult(_0x37ca99,null))['catch'](handleError(_0x37ca99,null));};exports[_0xdac6('0x11b')]=function(_0x53869a,_0x26836c){return db['User']['find']({'where':{'id':_0x53869a[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x26836c,null))[_0xdac6('0x14')](function(_0x64ff87){if(_0x64ff87){return _0x64ff87['removeChatInteractions'](_0x53869a[_0xdac6('0x40')]['ids'])[_0xdac6('0x14')](function(){if(_[_0xdac6('0x113')](_0x53869a[_0xdac6('0x40')]['ids'])){for(var _0x53fcf7=0x0;_0x53fcf7<_0x53869a['query']['ids'][_0xdac6('0x49')];_0x53fcf7+=0x1){socket[_0xdac6('0xac')](_0xdac6('0x11c'),{'ChatInteractionId':Number(_0x53869a['query']['ids'][_0x53fcf7]),'UserId':Number(_0x53869a[_0xdac6('0x53')]['id'])});}}else{socket['emit'](_0xdac6('0x11c'),{'ChatInteractionId':Number(_0x53869a[_0xdac6('0x40')][_0xdac6('0xa1')]),'UserId':Number(_0x53869a[_0xdac6('0x53')]['id'])});}});}})[_0xdac6('0x14')](respondWithStatusCode(_0x26836c,null))['catch'](handleError(_0x26836c,null));};exports[_0xdac6('0x11d')]=function(_0x35d3f5,_0x2db1eb){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x35d3f5[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x2db1eb,null))[_0xdac6('0x14')](function(_0x47519c){if(_0x47519c){return _0x47519c[_0xdac6('0x11d')](_0x35d3f5['body']['ids'],_[_0xdac6('0x5c')](_0x35d3f5[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{})['spread'](function(){for(var _0x156497=0x0;_0x156497<_0x35d3f5[_0xdac6('0x59')]['ids']['length'];_0x156497+=0x1){socket[_0xdac6('0xac')](_0xdac6('0x11e'),{'MailInteractionId':Number(_0x35d3f5['body'][_0xdac6('0xa1')][_0x156497]),'UserId':Number(_0x35d3f5[_0xdac6('0x53')]['id'])});}return _0x35d3f5[_0xdac6('0x59')][_0xdac6('0xa1')];});}})[_0xdac6('0x14')](respondWithResult(_0x2db1eb,null))[_0xdac6('0x51')](handleError(_0x2db1eb,null));};exports[_0xdac6('0x11f')]=function(_0x595e91,_0x1a7e3f){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x595e91[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1a7e3f,null))['then'](function(_0x44110d){if(_0x44110d){return _0x44110d[_0xdac6('0x11f')](_0x595e91['query'][_0xdac6('0xa1')])[_0xdac6('0x14')](function(){if(_[_0xdac6('0x113')](_0x595e91['query'][_0xdac6('0xa1')])){for(var _0x9b3502=0x0;_0x9b3502<_0x595e91[_0xdac6('0x40')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x9b3502+=0x1){socket[_0xdac6('0xac')](_0xdac6('0x120'),{'MailInteractionId':Number(_0x595e91[_0xdac6('0x40')][_0xdac6('0xa1')][_0x9b3502]),'UserId':Number(_0x595e91['params']['id'])});}}else{socket[_0xdac6('0xac')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x595e91[_0xdac6('0x40')][_0xdac6('0xa1')]),'UserId':Number(_0x595e91[_0xdac6('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x1a7e3f,null))[_0xdac6('0x51')](handleError(_0x1a7e3f,null));};exports[_0xdac6('0x121')]=function(_0x2d92d6,_0x5d6bcc){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x2d92d6[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x5d6bcc,null))['then'](function(_0x16e4a5){if(_0x16e4a5){return _0x16e4a5['addFaxInteractions'](_0x2d92d6[_0xdac6('0x59')][_0xdac6('0xa1')],_['omit'](_0x2d92d6['body'],['ids','id'])||{})[_0xdac6('0xa0')](function(){for(var _0x114980=0x0;_0x114980<_0x2d92d6[_0xdac6('0x59')]['ids'][_0xdac6('0x49')];_0x114980+=0x1){socket[_0xdac6('0xac')]('user_has_fax_interactions:save',{'FaxInteractionId':Number(_0x2d92d6[_0xdac6('0x59')]['ids'][_0x114980]),'UserId':Number(_0x2d92d6[_0xdac6('0x53')]['id'])});}return _0x2d92d6[_0xdac6('0x59')][_0xdac6('0xa1')];});}})[_0xdac6('0x14')](respondWithResult(_0x5d6bcc,null))['catch'](handleError(_0x5d6bcc,null));};exports['removeFaxInteractions']=function(_0x261b8f,_0x38c5a8){return db[_0xdac6('0x39')]['find']({'where':{'id':_0x261b8f[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x38c5a8,null))[_0xdac6('0x14')](function(_0x42bec3){if(_0x42bec3){return _0x42bec3[_0xdac6('0x122')](_0x261b8f[_0xdac6('0x40')]['ids'])[_0xdac6('0x14')](function(){if(_[_0xdac6('0x113')](_0x261b8f[_0xdac6('0x40')][_0xdac6('0xa1')])){for(var _0x4e126d=0x0;_0x4e126d<_0x261b8f[_0xdac6('0x40')][_0xdac6('0xa1')]['length'];_0x4e126d+=0x1){socket[_0xdac6('0xac')](_0xdac6('0x123'),{'FaxInteractionId':Number(_0x261b8f['query'][_0xdac6('0xa1')][_0x4e126d]),'UserId':Number(_0x261b8f[_0xdac6('0x53')]['id'])});}}else{socket['emit'](_0xdac6('0x123'),{'FaxInteractionId':Number(_0x261b8f[_0xdac6('0x40')]['ids']),'UserId':Number(_0x261b8f[_0xdac6('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x38c5a8,null))[_0xdac6('0x51')](handleError(_0x38c5a8,null));};exports['addSmsInteractions']=function(_0x2620f9,_0x40e417){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x2620f9['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x40e417,null))[_0xdac6('0x14')](function(_0x2a0395){if(_0x2a0395){return _0x2a0395[_0xdac6('0x124')](_0x2620f9[_0xdac6('0x59')]['ids'],_[_0xdac6('0x5c')](_0x2620f9[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{})[_0xdac6('0xa0')](function(){for(var _0x527da3=0x0;_0x527da3<_0x2620f9[_0xdac6('0x59')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x527da3+=0x1){socket['emit'](_0xdac6('0x125'),{'SmsInteractionId':Number(_0x2620f9[_0xdac6('0x59')]['ids'][_0x527da3]),'UserId':Number(_0x2620f9[_0xdac6('0x53')]['id'])});}return _0x2620f9[_0xdac6('0x59')][_0xdac6('0xa1')];});}})[_0xdac6('0x14')](respondWithResult(_0x40e417,null))[_0xdac6('0x51')](handleError(_0x40e417,null));};exports[_0xdac6('0x126')]=function(_0x58daf1,_0x1ee6bd){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x58daf1['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1ee6bd,null))[_0xdac6('0x14')](function(_0x5e40e3){if(_0x5e40e3){return _0x5e40e3[_0xdac6('0x126')](_0x58daf1['query'][_0xdac6('0xa1')])[_0xdac6('0x14')](function(){if(_[_0xdac6('0x113')](_0x58daf1[_0xdac6('0x40')][_0xdac6('0xa1')])){for(var _0x10ba51=0x0;_0x10ba51<_0x58daf1[_0xdac6('0x40')][_0xdac6('0xa1')]['length'];_0x10ba51+=0x1){socket[_0xdac6('0xac')](_0xdac6('0x127'),{'SmsInteractionId':Number(_0x58daf1[_0xdac6('0x40')][_0xdac6('0xa1')][_0x10ba51]),'UserId':Number(_0x58daf1[_0xdac6('0x53')]['id'])});}}else{socket['emit'](_0xdac6('0x127'),{'SmsInteractionId':Number(_0x58daf1[_0xdac6('0x40')][_0xdac6('0xa1')]),'UserId':Number(_0x58daf1[_0xdac6('0x53')]['id'])});}});}})[_0xdac6('0x14')](respondWithStatusCode(_0x1ee6bd,null))[_0xdac6('0x51')](handleError(_0x1ee6bd,null));};exports[_0xdac6('0x128')]=function(_0x586352,_0x2cf2b4){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x586352['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x2cf2b4,null))[_0xdac6('0x14')](function(_0x436546){if(_0x436546){return _0x436546['addOpenchannelInteractions'](_0x586352['body'][_0xdac6('0xa1')],_['omit'](_0x586352[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{})['spread'](function(){for(var _0x2593c5=0x0;_0x2593c5<_0x586352[_0xdac6('0x59')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x2593c5+=0x1){socket['emit'](_0xdac6('0x129'),{'OpenchannelInteractionId':Number(_0x586352[_0xdac6('0x59')][_0xdac6('0xa1')][_0x2593c5]),'UserId':Number(_0x586352[_0xdac6('0x53')]['id'])});}return _0x586352[_0xdac6('0x59')][_0xdac6('0xa1')];});}})['then'](respondWithResult(_0x2cf2b4,null))[_0xdac6('0x51')](handleError(_0x2cf2b4,null));};exports['removeOpenchannelInteractions']=function(_0x513ba3,_0x57bff0){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x513ba3[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x57bff0,null))[_0xdac6('0x14')](function(_0x10c3f6){if(_0x10c3f6){return _0x10c3f6[_0xdac6('0x12a')](_0x513ba3[_0xdac6('0x40')][_0xdac6('0xa1')])[_0xdac6('0x14')](function(){if(_[_0xdac6('0x113')](_0x513ba3[_0xdac6('0x40')][_0xdac6('0xa1')])){for(var _0x3976d1=0x0;_0x3976d1<_0x513ba3[_0xdac6('0x40')][_0xdac6('0xa1')][_0xdac6('0x49')];_0x3976d1+=0x1){socket[_0xdac6('0xac')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x513ba3[_0xdac6('0x40')][_0xdac6('0xa1')][_0x3976d1]),'UserId':Number(_0x513ba3[_0xdac6('0x53')]['id'])});}}else{socket[_0xdac6('0xac')](_0xdac6('0x12b'),{'OpenchannelInteractionId':Number(_0x513ba3['query'][_0xdac6('0xa1')]),'UserId':Number(_0x513ba3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x57bff0,null))[_0xdac6('0x51')](handleError(_0x57bff0,null));};exports['addWhatsappInteractions']=function(_0x18ccbe,_0x1b2723){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x18ccbe[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x1b2723,null))[_0xdac6('0x14')](function(_0x34d599){if(_0x34d599){return _0x34d599[_0xdac6('0x12c')](_0x18ccbe['body']['ids'],_['omit'](_0x18ccbe[_0xdac6('0x59')],['ids','id'])||{})[_0xdac6('0xa0')](function(){for(var _0xcb16f5=0x0;_0xcb16f5<_0x18ccbe[_0xdac6('0x59')]['ids'][_0xdac6('0x49')];_0xcb16f5+=0x1){socket['emit'](_0xdac6('0x12d'),{'WhatsappInteractionId':Number(_0x18ccbe[_0xdac6('0x59')][_0xdac6('0xa1')][_0xcb16f5]),'UserId':Number(_0x18ccbe[_0xdac6('0x53')]['id'])});}return _0x18ccbe['body'][_0xdac6('0xa1')];});}})[_0xdac6('0x14')](respondWithResult(_0x1b2723,null))[_0xdac6('0x51')](handleError(_0x1b2723,null));};exports[_0xdac6('0x12e')]=function(_0x158221,_0x245822){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x158221[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x245822,null))[_0xdac6('0x14')](function(_0x1fad49){if(_0x1fad49){return _0x1fad49[_0xdac6('0x12e')](_0x158221[_0xdac6('0x40')]['ids']);}})[_0xdac6('0x14')](respondWithStatusCode(_0x245822,null))['catch'](handleError(_0x245822,null));};exports[_0xdac6('0x12f')]=function(_0xdefd1,_0x3f3789){var _0x532f35={};var _0x4ab4b0={};var _0x27195b;var _0x213bbe;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0xdefd1[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x3f3789,null))['then'](function(_0x2bc6af){if(_0x2bc6af){_0x27195b=_0x2bc6af;_0x4ab4b0[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x130')][_0xdac6('0x3a')]);_0x4ab4b0[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0xdefd1[_0xdac6('0x40')]);_0x4ab4b0[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x4ab4b0['model'],_0x4ab4b0[_0xdac6('0x40')]);_0x532f35['attributes']=_['intersection'](_0x4ab4b0[_0xdac6('0x56')],qs['fields'](_0xdefd1['query'][_0xdac6('0x57')]));_0x532f35[_0xdac6('0x45')]=_0x532f35[_0xdac6('0x45')][_0xdac6('0x49')]?_0x532f35[_0xdac6('0x45')]:_0x4ab4b0[_0xdac6('0x56')];_0x532f35['order']=qs[_0xdac6('0xca')](_0xdefd1[_0xdac6('0x40')][_0xdac6('0xca')]);_0x532f35[_0xdac6('0xcb')]=qs['filters'](_[_0xdac6('0xcc')](_0xdefd1[_0xdac6('0x40')],_0x4ab4b0[_0xdac6('0x55')]));if(_0xdefd1[_0xdac6('0x40')][_0xdac6('0x31')]){_0x532f35[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x532f35[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x532f35[_0xdac6('0x45')],function(_0xc274e0){var _0x11a52d={};_0x11a52d[_0xc274e0]={'$like':'%'+_0xdefd1[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x11a52d;})});}_0x532f35=_[_0xdac6('0xcd')]({},_0x532f35,_0xdefd1[_0xdac6('0x58')]);return _0x27195b[_0xdac6('0x12f')](_0x532f35);}})['then'](function(_0x4746e0){if(_0x4746e0){_0x213bbe=_0x4746e0[_0xdac6('0x49')];if(!_0xdefd1[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x532f35[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0xdefd1[_0xdac6('0x40')][_0xdac6('0x22')]);_0x532f35[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0xdefd1[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x27195b[_0xdac6('0x12f')](_0x532f35);}})[_0xdac6('0x14')](function(_0x118c37){if(_0x118c37){return _0x118c37?{'count':_0x213bbe,'rows':_0x118c37}:null;}})[_0xdac6('0x14')](respondWithResult(_0x3f3789,null))['catch'](handleError(_0x3f3789,null));};exports[_0xdac6('0x131')]=function(_0x59f0be,_0x3c1c95){var _0x29302b={};var _0x49cd1e={};var _0x573c18;var _0x3cf82b;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x59f0be['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x3c1c95,null))['then'](function(_0xe7a21b){if(_0xe7a21b){_0x573c18=_0xe7a21b;_0x49cd1e[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x132')][_0xdac6('0x3a')]);_0x49cd1e[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x59f0be['query']);_0x49cd1e[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x49cd1e['model'],_0x49cd1e['query']);_0x29302b[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x49cd1e[_0xdac6('0x56')],qs['fields'](_0x59f0be[_0xdac6('0x40')]['fields']));_0x29302b[_0xdac6('0x45')]=_0x29302b[_0xdac6('0x45')][_0xdac6('0x49')]?_0x29302b[_0xdac6('0x45')]:_0x49cd1e[_0xdac6('0x56')];_0x29302b['order']=qs[_0xdac6('0xca')](_0x59f0be[_0xdac6('0x40')]['sort']);_0x29302b['where']=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x59f0be[_0xdac6('0x40')],_0x49cd1e['filters']));if(_0x59f0be[_0xdac6('0x40')]['filter']){_0x29302b['where']=_['merge'](_0x29302b[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x29302b[_0xdac6('0x45')],function(_0x41a2d4){var _0x82bb0={};_0x82bb0[_0x41a2d4]={'$like':'%'+_0x59f0be[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x82bb0;})});}_0x29302b=_[_0xdac6('0xcd')]({},_0x29302b,_0x59f0be[_0xdac6('0x58')]);return _0x573c18[_0xdac6('0x131')](_0x29302b);}})['then'](function(_0x5e2b72){if(_0x5e2b72){_0x3cf82b=_0x5e2b72[_0xdac6('0x49')];if(!_0x59f0be[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x29302b[_0xdac6('0x22')]=qs['limit'](_0x59f0be['query'][_0xdac6('0x22')]);_0x29302b['offset']=qs[_0xdac6('0x20')](_0x59f0be[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x573c18['getFaxAccounts'](_0x29302b);}})[_0xdac6('0x14')](function(_0x5a6f8b){if(_0x5a6f8b){return _0x5a6f8b?{'count':_0x3cf82b,'rows':_0x5a6f8b}:null;}})['then'](respondWithResult(_0x3c1c95,null))[_0xdac6('0x51')](handleError(_0x3c1c95,null));};exports[_0xdac6('0x133')]=function(_0x28de18,_0x1fbc6c){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x28de18[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1fbc6c,null))[_0xdac6('0x14')](function(_0x341c55){if(_0x341c55){return _0x341c55[_0xdac6('0x133')](_0x28de18[_0xdac6('0x59')][_0xdac6('0xa1')],_[_0xdac6('0x5c')](_0x28de18[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x1fbc6c,null))['catch'](handleError(_0x1fbc6c,null));};exports[_0xdac6('0x134')]=function(_0x40ece6,_0x1b8aa8){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x40ece6[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1b8aa8,null))[_0xdac6('0x14')](function(_0x4471d6){if(_0x4471d6){return _0x4471d6['removeFaxAccounts'](_0x40ece6[_0xdac6('0x40')][_0xdac6('0xa1')]);}})['then'](respondWithStatusCode(_0x1b8aa8,null))[_0xdac6('0x51')](handleError(_0x1b8aa8,null));};exports[_0xdac6('0x135')]=function(_0x485356,_0xc07a4b){var _0x397671={};var _0x29c063={};var _0x315720;var _0xd08e43;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x485356[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0xc07a4b,null))['then'](function(_0x4198a0){if(_0x4198a0){_0x315720=_0x4198a0;_0x29c063[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x136')][_0xdac6('0x3a')]);_0x29c063[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x485356[_0xdac6('0x40')]);_0x29c063['filters']=_['intersection'](_0x29c063[_0xdac6('0x56')],_0x29c063[_0xdac6('0x40')]);_0x397671[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x29c063[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x485356[_0xdac6('0x40')][_0xdac6('0x57')]));_0x397671[_0xdac6('0x45')]=_0x397671[_0xdac6('0x45')]['length']?_0x397671[_0xdac6('0x45')]:_0x29c063[_0xdac6('0x56')];_0x397671[_0xdac6('0xc9')]=qs[_0xdac6('0xca')](_0x485356['query'][_0xdac6('0xca')]);_0x397671[_0xdac6('0xcb')]=qs['filters'](_[_0xdac6('0xcc')](_0x485356[_0xdac6('0x40')],_0x29c063[_0xdac6('0x55')]));if(_0x485356[_0xdac6('0x40')][_0xdac6('0x31')]){_0x397671[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x397671[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x397671[_0xdac6('0x45')],function(_0x1bc38b){var _0x2f0dab={};_0x2f0dab[_0x1bc38b]={'$like':'%'+_0x485356[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x2f0dab;})});}_0x397671=_[_0xdac6('0xcd')]({},_0x397671,_0x485356[_0xdac6('0x58')]);return _0x315720[_0xdac6('0x135')](_0x397671);}})[_0xdac6('0x14')](function(_0x4b27ef){if(_0x4b27ef){_0xd08e43=_0x4b27ef[_0xdac6('0x49')];if(!_0x485356[_0xdac6('0x40')][_0xdac6('0xcf')]('nolimit')){_0x397671[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x485356[_0xdac6('0x40')][_0xdac6('0x22')]);_0x397671[_0xdac6('0x20')]=qs['offset'](_0x485356[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x315720[_0xdac6('0x135')](_0x397671);}})[_0xdac6('0x14')](function(_0x4e0e1e){if(_0x4e0e1e){return _0x4e0e1e?{'count':_0xd08e43,'rows':_0x4e0e1e}:null;}})[_0xdac6('0x14')](respondWithResult(_0xc07a4b,null))[_0xdac6('0x51')](handleError(_0xc07a4b,null));};exports[_0xdac6('0x137')]=function(_0x5ed453,_0x52d761){return db[_0xdac6('0x39')]['find']({'where':{'id':_0x5ed453['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x52d761,null))['then'](function(_0x159fe7){if(_0x159fe7){return _0x159fe7[_0xdac6('0x137')](_0x5ed453[_0xdac6('0x59')][_0xdac6('0xa1')],_[_0xdac6('0x5c')](_0x5ed453['body'],[_0xdac6('0xa1'),'id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x52d761,null))[_0xdac6('0x51')](handleError(_0x52d761,null));};exports[_0xdac6('0x138')]=function(_0x53352f,_0x586ce2){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x53352f['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x586ce2,null))[_0xdac6('0x14')](function(_0xa7cfeb){if(_0xa7cfeb){return _0xa7cfeb[_0xdac6('0x138')](_0x53352f[_0xdac6('0x40')][_0xdac6('0xa1')]);}})[_0xdac6('0x14')](respondWithStatusCode(_0x586ce2,null))[_0xdac6('0x51')](handleError(_0x586ce2,null));};exports['getOpenchannelAccounts']=function(_0x328305,_0x35e964){var _0x1cb3f4={};var _0xe47e3={};var _0x55f071;var _0xcdb9a;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x328305[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x35e964,null))[_0xdac6('0x14')](function(_0x4d1a46){if(_0x4d1a46){_0x55f071=_0x4d1a46;_0xe47e3[_0xdac6('0x56')]=_['keys'](db['OpenchannelAccount'][_0xdac6('0x3a')]);_0xe47e3[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x328305[_0xdac6('0x40')]);_0xe47e3[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0xe47e3[_0xdac6('0x56')],_0xe47e3[_0xdac6('0x40')]);_0x1cb3f4[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0xe47e3[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x328305[_0xdac6('0x40')][_0xdac6('0x57')]));_0x1cb3f4[_0xdac6('0x45')]=_0x1cb3f4[_0xdac6('0x45')]['length']?_0x1cb3f4[_0xdac6('0x45')]:_0xe47e3[_0xdac6('0x56')];_0x1cb3f4[_0xdac6('0xc9')]=qs['sort'](_0x328305[_0xdac6('0x40')][_0xdac6('0xca')]);_0x1cb3f4[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x328305[_0xdac6('0x40')],_0xe47e3['filters']));if(_0x328305[_0xdac6('0x40')][_0xdac6('0x31')]){_0x1cb3f4[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x1cb3f4[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x1cb3f4[_0xdac6('0x45')],function(_0x11c583){var _0xd46a59={};_0xd46a59[_0x11c583]={'$like':'%'+_0x328305[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0xd46a59;})});}_0x1cb3f4=_['merge']({},_0x1cb3f4,_0x328305[_0xdac6('0x58')]);return _0x55f071['getOpenchannelAccounts'](_0x1cb3f4);}})[_0xdac6('0x14')](function(_0x3915e0){if(_0x3915e0){_0xcdb9a=_0x3915e0[_0xdac6('0x49')];if(!_0x328305[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x1cb3f4[_0xdac6('0x22')]=qs['limit'](_0x328305['query'][_0xdac6('0x22')]);_0x1cb3f4[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x328305[_0xdac6('0x40')]['offset']);}return _0x55f071[_0xdac6('0x139')](_0x1cb3f4);}})[_0xdac6('0x14')](function(_0x4336fc){if(_0x4336fc){return _0x4336fc?{'count':_0xcdb9a,'rows':_0x4336fc}:null;}})[_0xdac6('0x14')](respondWithResult(_0x35e964,null))['catch'](handleError(_0x35e964,null));};exports[_0xdac6('0x13a')]=function(_0x59f26d,_0x3c1db9){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x59f26d[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x3c1db9,null))[_0xdac6('0x14')](function(_0x28f741){if(_0x28f741){return _0x28f741['addOpenchannelAccounts'](_0x59f26d['body'][_0xdac6('0xa1')],_[_0xdac6('0x5c')](_0x59f26d['body'],[_0xdac6('0xa1'),'id'])||{});}})['then'](respondWithResult(_0x3c1db9,null))['catch'](handleError(_0x3c1db9,null));};exports[_0xdac6('0x13b')]=function(_0x137022,_0x6b63a){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x137022[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x6b63a,null))['then'](function(_0x21c961){if(_0x21c961){return _0x21c961['removeOpenchannelAccounts'](_0x137022['query']['ids']);}})['then'](respondWithStatusCode(_0x6b63a,null))[_0xdac6('0x51')](handleError(_0x6b63a,null));};exports['getSmsAccounts']=function(_0x1c21a8,_0x2caa4){var _0x148cde={};var _0x567a0d={};var _0x443fa6;var _0x1ffc27;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x1c21a8[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x2caa4,null))[_0xdac6('0x14')](function(_0xb3377c){if(_0xb3377c){_0x443fa6=_0xb3377c;_0x567a0d[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x13c')]['rawAttributes']);_0x567a0d[_0xdac6('0x40')]=_['keys'](_0x1c21a8['query']);_0x567a0d[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x567a0d[_0xdac6('0x56')],_0x567a0d[_0xdac6('0x40')]);_0x148cde[_0xdac6('0x45')]=_['intersection'](_0x567a0d['model'],qs['fields'](_0x1c21a8[_0xdac6('0x40')][_0xdac6('0x57')]));_0x148cde[_0xdac6('0x45')]=_0x148cde[_0xdac6('0x45')][_0xdac6('0x49')]?_0x148cde[_0xdac6('0x45')]:_0x567a0d['model'];_0x148cde[_0xdac6('0xc9')]=qs['sort'](_0x1c21a8[_0xdac6('0x40')][_0xdac6('0xca')]);_0x148cde[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_['pick'](_0x1c21a8[_0xdac6('0x40')],_0x567a0d[_0xdac6('0x55')]));if(_0x1c21a8['query'][_0xdac6('0x31')]){_0x148cde['where']=_[_0xdac6('0xcd')](_0x148cde[_0xdac6('0xcb')],{'$or':_['map'](_0x148cde[_0xdac6('0x45')],function(_0x5b2049){var _0x100482={};_0x100482[_0x5b2049]={'$like':'%'+_0x1c21a8[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x100482;})});}_0x148cde=_[_0xdac6('0xcd')]({},_0x148cde,_0x1c21a8['options']);return _0x443fa6[_0xdac6('0x13d')](_0x148cde);}})['then'](function(_0x163837){if(_0x163837){_0x1ffc27=_0x163837[_0xdac6('0x49')];if(!_0x1c21a8[_0xdac6('0x40')]['hasOwnProperty']('nolimit')){_0x148cde[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x1c21a8['query'][_0xdac6('0x22')]);_0x148cde[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x1c21a8[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x443fa6[_0xdac6('0x13d')](_0x148cde);}})[_0xdac6('0x14')](function(_0x434597){if(_0x434597){return _0x434597?{'count':_0x1ffc27,'rows':_0x434597}:null;}})['then'](respondWithResult(_0x2caa4,null))[_0xdac6('0x51')](handleError(_0x2caa4,null));};exports[_0xdac6('0x13e')]=function(_0x415e39,_0x195529){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x415e39[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x195529,null))['then'](function(_0x1a998b){if(_0x1a998b){return _0x1a998b['addSmsAccounts'](_0x415e39['body'][_0xdac6('0xa1')],_['omit'](_0x415e39[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{});}})['then'](respondWithResult(_0x195529,null))['catch'](handleError(_0x195529,null));};exports[_0xdac6('0x13f')]=function(_0x34c5c0,_0x1f6e78){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x34c5c0[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1f6e78,null))[_0xdac6('0x14')](function(_0x4c436d){if(_0x4c436d){return _0x4c436d[_0xdac6('0x13f')](_0x34c5c0[_0xdac6('0x40')][_0xdac6('0xa1')]);}})[_0xdac6('0x14')](respondWithStatusCode(_0x1f6e78,null))[_0xdac6('0x51')](handleError(_0x1f6e78,null));};exports[_0xdac6('0x140')]=function(_0x485f93,_0x4cbc03){var _0x53dce9={};var _0x1c8db0={};var _0x10b554;var _0x2c39cb;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x485f93[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x4cbc03,null))[_0xdac6('0x14')](function(_0x591700){if(_0x591700){_0x10b554=_0x591700;_0x1c8db0[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x141')]['rawAttributes']);_0x1c8db0[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x485f93[_0xdac6('0x40')]);_0x1c8db0[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x1c8db0['model'],_0x1c8db0[_0xdac6('0x40')]);_0x53dce9[_0xdac6('0x45')]=_[_0xdac6('0xc8')](_0x1c8db0[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x485f93['query'][_0xdac6('0x57')]));_0x53dce9[_0xdac6('0x45')]=_0x53dce9['attributes'][_0xdac6('0x49')]?_0x53dce9[_0xdac6('0x45')]:_0x1c8db0[_0xdac6('0x56')];_0x53dce9[_0xdac6('0xc9')]=qs['sort'](_0x485f93['query'][_0xdac6('0xca')]);_0x53dce9['where']=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x485f93[_0xdac6('0x40')],_0x1c8db0['filters']));if(_0x485f93[_0xdac6('0x40')]['filter']){_0x53dce9['where']=_['merge'](_0x53dce9['where'],{'$or':_[_0xdac6('0x32')](_0x53dce9[_0xdac6('0x45')],function(_0x1ff720){var _0x38ba89={};_0x38ba89[_0x1ff720]={'$like':'%'+_0x485f93[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x38ba89;})});}_0x53dce9=_[_0xdac6('0xcd')]({},_0x53dce9,_0x485f93['options']);return _0x10b554[_0xdac6('0x140')](_0x53dce9);}})[_0xdac6('0x14')](function(_0x523a80){if(_0x523a80){_0x2c39cb=_0x523a80[_0xdac6('0x49')];if(!_0x485f93['query'][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x53dce9[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x485f93[_0xdac6('0x40')]['limit']);_0x53dce9[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x485f93[_0xdac6('0x40')]['offset']);}return _0x10b554[_0xdac6('0x140')](_0x53dce9);}})[_0xdac6('0x14')](function(_0x53dcb6){if(_0x53dcb6){return _0x53dcb6?{'count':_0x2c39cb,'rows':_0x53dcb6}:null;}})[_0xdac6('0x14')](respondWithResult(_0x4cbc03,null))['catch'](handleError(_0x4cbc03,null));};exports[_0xdac6('0x142')]=function(_0x3b98f6,_0x199b4c){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x3b98f6[_0xdac6('0x53')]['id']}})['then'](handleEntityNotFound(_0x199b4c,null))[_0xdac6('0x14')](function(_0x551ad3){if(_0x551ad3){return _0x551ad3[_0xdac6('0x142')](_0x3b98f6[_0xdac6('0x59')][_0xdac6('0xa1')],_['omit'](_0x3b98f6['body'],['ids','id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x199b4c,null))['catch'](handleError(_0x199b4c,null));};exports['removeChatWebsites']=function(_0xc27e0e,_0x1c841c){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0xc27e0e['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x1c841c,null))[_0xdac6('0x14')](function(_0x550b26){if(_0x550b26){return _0x550b26[_0xdac6('0x143')](_0xc27e0e['query'][_0xdac6('0xa1')]);}})[_0xdac6('0x14')](respondWithStatusCode(_0x1c841c,null))['catch'](handleError(_0x1c841c,null));};exports[_0xdac6('0x144')]=function(_0x26a119,_0x2a6c48){var _0x5369ba={};var _0x495e2a={};var _0x4fa709;var _0x5d1a03;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x26a119['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x2a6c48,null))[_0xdac6('0x14')](function(_0x456776){if(_0x456776){_0x4fa709=_0x456776;_0x495e2a[_0xdac6('0x56')]=_[_0xdac6('0xc7')](db[_0xdac6('0x145')][_0xdac6('0x3a')]);_0x495e2a[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x26a119['query']);_0x495e2a[_0xdac6('0x55')]=_[_0xdac6('0xc8')](_0x495e2a[_0xdac6('0x56')],_0x495e2a['query']);_0x5369ba[_0xdac6('0x45')]=_['intersection'](_0x495e2a[_0xdac6('0x56')],qs[_0xdac6('0x57')](_0x26a119['query'][_0xdac6('0x57')]));_0x5369ba[_0xdac6('0x45')]=_0x5369ba[_0xdac6('0x45')]['length']?_0x5369ba[_0xdac6('0x45')]:_0x495e2a['model'];_0x5369ba['order']=qs[_0xdac6('0xca')](_0x26a119[_0xdac6('0x40')][_0xdac6('0xca')]);_0x5369ba[_0xdac6('0xcb')]=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x26a119[_0xdac6('0x40')],_0x495e2a[_0xdac6('0x55')]));if(_0x26a119[_0xdac6('0x40')][_0xdac6('0x31')]){_0x5369ba[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x5369ba[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x5369ba['attributes'],function(_0x35de28){var _0x280ac3={};_0x280ac3[_0x35de28]={'$like':'%'+_0x26a119[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x280ac3;})});}_0x5369ba=_[_0xdac6('0xcd')]({},_0x5369ba,_0x26a119[_0xdac6('0x58')]);return _0x4fa709['getWhatsappAccounts'](_0x5369ba);}})[_0xdac6('0x14')](function(_0x13939b){if(_0x13939b){_0x5d1a03=_0x13939b['length'];if(!_0x26a119['query'][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x5369ba[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x26a119[_0xdac6('0x40')][_0xdac6('0x22')]);_0x5369ba[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x26a119[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x4fa709['getWhatsappAccounts'](_0x5369ba);}})[_0xdac6('0x14')](function(_0x3e35c4){if(_0x3e35c4){return _0x3e35c4?{'count':_0x5d1a03,'rows':_0x3e35c4}:null;}})[_0xdac6('0x14')](respondWithResult(_0x2a6c48,null))[_0xdac6('0x51')](handleError(_0x2a6c48,null));};exports[_0xdac6('0x146')]=function(_0x13d30f,_0x19988b){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x13d30f['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x19988b,null))['then'](function(_0x1f9d51){if(_0x1f9d51){return _0x1f9d51[_0xdac6('0x146')](_0x13d30f[_0xdac6('0x59')]['ids'],_[_0xdac6('0x5c')](_0x13d30f[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x19988b,null))[_0xdac6('0x51')](handleError(_0x19988b,null));};exports[_0xdac6('0x147')]=function(_0x121e1d,_0x23b0ab){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x121e1d[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x23b0ab,null))[_0xdac6('0x14')](function(_0x1c24b7){if(_0x1c24b7){return _0x1c24b7[_0xdac6('0x147')](_0x121e1d['query'][_0xdac6('0xa1')]);}})[_0xdac6('0x14')](respondWithStatusCode(_0x23b0ab,null))['catch'](handleError(_0x23b0ab,null));};exports['getSquareProjects']=function(_0x53a6ab,_0x4a6319){var _0x2d21c1={};var _0x363dfe={};var _0x376f67;var _0x314c10;return db[_0xdac6('0x39')][_0xdac6('0x8d')]({'where':{'id':_0x53a6ab[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x4a6319,null))[_0xdac6('0x14')](function(_0x379582){if(_0x379582){_0x376f67=_0x379582;_0x363dfe[_0xdac6('0x56')]=_['keys'](db['SquareProject'][_0xdac6('0x3a')]);_0x363dfe['query']=_[_0xdac6('0xc7')](_0x53a6ab[_0xdac6('0x40')]);_0x363dfe[_0xdac6('0x55')]=_['intersection'](_0x363dfe[_0xdac6('0x56')],_0x363dfe['query']);_0x2d21c1['attributes']=_[_0xdac6('0xc8')](_0x363dfe['model'],qs[_0xdac6('0x57')](_0x53a6ab[_0xdac6('0x40')]['fields']));_0x2d21c1['attributes']=_0x2d21c1[_0xdac6('0x45')][_0xdac6('0x49')]?_0x2d21c1['attributes']:_0x363dfe[_0xdac6('0x56')];_0x2d21c1[_0xdac6('0xc9')]=qs['sort'](_0x53a6ab[_0xdac6('0x40')][_0xdac6('0xca')]);_0x2d21c1['where']=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x53a6ab[_0xdac6('0x40')],_0x363dfe[_0xdac6('0x55')]));if(_0x53a6ab['query']['filter']){_0x2d21c1['where']=_[_0xdac6('0xcd')](_0x2d21c1[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x2d21c1[_0xdac6('0x45')],function(_0x18e623){var _0x4c3374={};_0x4c3374[_0x18e623]={'$like':'%'+_0x53a6ab[_0xdac6('0x40')][_0xdac6('0x31')]+'%'};return _0x4c3374;})});}_0x2d21c1=_['merge']({},_0x2d21c1,_0x53a6ab[_0xdac6('0x58')]);return _0x376f67[_0xdac6('0x148')](_0x2d21c1);}})[_0xdac6('0x14')](function(_0x2d029){if(_0x2d029){_0x314c10=_0x2d029[_0xdac6('0x49')];if(!_0x53a6ab[_0xdac6('0x40')][_0xdac6('0xcf')](_0xdac6('0xd6'))){_0x2d21c1[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x53a6ab[_0xdac6('0x40')][_0xdac6('0x22')]);_0x2d21c1[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x53a6ab[_0xdac6('0x40')][_0xdac6('0x20')]);}return _0x376f67[_0xdac6('0x148')](_0x2d21c1);}})[_0xdac6('0x14')](function(_0x24887b){if(_0x24887b){return _0x24887b?{'count':_0x314c10,'rows':_0x24887b}:null;}})[_0xdac6('0x14')](respondWithResult(_0x4a6319,null))['catch'](handleError(_0x4a6319,null));};exports[_0xdac6('0x149')]=function(_0x5e31ee,_0x374165){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x5e31ee[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x374165,null))[_0xdac6('0x14')](function(_0x4895dc){if(_0x4895dc){return _0x4895dc[_0xdac6('0x149')](_0x5e31ee[_0xdac6('0x59')][_0xdac6('0xa1')],_[_0xdac6('0x5c')](_0x5e31ee[_0xdac6('0x59')],[_0xdac6('0xa1'),'id'])||{});}})[_0xdac6('0x14')](respondWithResult(_0x374165,null))[_0xdac6('0x51')](handleError(_0x374165,null));};exports[_0xdac6('0x14a')]=function(_0x47898d,_0x446375){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x47898d['params']['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x446375,null))[_0xdac6('0x14')](function(_0x5bc42a){if(_0x5bc42a){return _0x5bc42a[_0xdac6('0x14a')](_0x47898d[_0xdac6('0x40')][_0xdac6('0xa1')]);}})['then'](respondWithStatusCode(_0x446375,null))['catch'](handleError(_0x446375,null));};exports[_0xdac6('0x14b')]=function(_0x33fa26,_0x295419){var _0x4d2001={},_0x9d89e1={},_0x2c8779={'count':0x0,'rows':[]};var _0x5bc763=db[_0xdac6('0x14c')][_0xdac6('0x3a')];_0x9d89e1['model']=_[_0xdac6('0xc7')](_0x5bc763);_0x9d89e1[_0xdac6('0x40')]=_[_0xdac6('0xc7')](_0x33fa26[_0xdac6('0x40')]);_0x9d89e1['filters']=_[_0xdac6('0xc8')](_0x9d89e1[_0xdac6('0x56')],_0x9d89e1[_0xdac6('0x40')]);_0x9d89e1[_0xdac6('0x55')]=_['concat'](_0x9d89e1[_0xdac6('0x55')],[_0xdac6('0x14d'),_0xdac6('0x14e'),_0xdac6('0x14f'),_0xdac6('0x150'),_0xdac6('0x151'),'$lte',_0xdac6('0x152'),_0xdac6('0x153'),_0xdac6('0x154'),_0xdac6('0x155'),_0xdac6('0x156'),'$in','$notIn',_0xdac6('0x157'),_0xdac6('0x158'),_0xdac6('0x159'),'$notILike','$like','$overlap',_0xdac6('0x15a'),'$contained',_0xdac6('0x15b')]);_0x4d2001['attributes']=_[_0xdac6('0xc8')](_0x9d89e1[_0xdac6('0x56')],qs['fields'](_0x33fa26[_0xdac6('0x40')]['fields']));_0x4d2001[_0xdac6('0x45')]=_0x4d2001['attributes'][_0xdac6('0x49')]?_0x4d2001[_0xdac6('0x45')]:_0x9d89e1[_0xdac6('0x56')];if(!_0x33fa26[_0xdac6('0x40')]['hasOwnProperty'](_0xdac6('0xd6'))){_0x4d2001[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x33fa26['query'][_0xdac6('0x22')]);_0x4d2001[_0xdac6('0x20')]=qs[_0xdac6('0x20')](_0x33fa26[_0xdac6('0x40')][_0xdac6('0x20')]);}_0x4d2001['order']=qs['sort'](_0x33fa26['query']['sort']);_0x4d2001['where']=qs[_0xdac6('0x55')](_[_0xdac6('0xcc')](_0x33fa26[_0xdac6('0x40')],_0x9d89e1[_0xdac6('0x55')]));if(_0x33fa26[_0xdac6('0x40')][_0xdac6('0x31')]){_0x4d2001[_0xdac6('0xcb')]=_[_0xdac6('0xcd')](_0x4d2001[_0xdac6('0xcb')],{'$or':_[_0xdac6('0x32')](_0x4d2001[_0xdac6('0x45')],function(_0xe2824){var _0x4ec3a8={};_0x4ec3a8[_0xe2824]={'$like':'%'+_0x33fa26['query']['filter']+'%'};return _0x4ec3a8;})});}_0x4d2001[_0xdac6('0xcb')]={'$and':[_0x4d2001[_0xdac6('0xcb')],{'$or':[{'UserId':_0x33fa26[_0xdac6('0x53')]['id']},{'OwnerId':_0x33fa26[_0xdac6('0x53')]['id']}]}]};_0x4d2001=_[_0xdac6('0xcd')]({},_0x4d2001,_0x33fa26[_0xdac6('0x58')]);var _0x459361={'where':_0x4d2001[_0xdac6('0xcb')]};return db[_0xdac6('0x14c')][_0xdac6('0x23')](_0x459361)['then'](function(_0x558733){_0x2c8779['count']=_0x558733;if(_0x33fa26[_0xdac6('0x40')][_0xdac6('0x3f')]){_0x4d2001['include']=[{'attributes':['id',_0xdac6('0x15c'),'lastName',_0xdac6('0xeb')],'model':db[_0xdac6('0xc6')],'as':'Contact'},{'attributes':['id',_0xdac6('0x37'),'dialActive'],'model':db[_0xdac6('0xa5')],'as':_0xdac6('0xd4')}];}return db[_0xdac6('0x14c')][_0xdac6('0xa6')](_0x4d2001);})['then'](function(_0x3b814a){_0x2c8779[_0xdac6('0x47')]=_0x3b814a;return _0x2c8779;})[_0xdac6('0x14')](respondWithFilteredResult(_0x295419,_0x4d2001))['catch'](handleError(_0x295419,null));};exports[_0xdac6('0x15d')]=function(_0x3927a6,_0x388295){if(!_[_0xdac6('0x5f')](_0x3927a6[_0xdac6('0x2c')]['id'])&&(_0x3927a6['user'][_0xdac6('0x2a')]==_0xdac6('0x2b')||_0x3927a6[_0xdac6('0x2c')][_0xdac6('0x2a')]==_0xdac6('0x2c'))){return db[_0xdac6('0x39')]['findOne']({'where':{'id':_0x3927a6[_0xdac6('0x53')]['id']},'raw':!![]})[_0xdac6('0x14')](function(_0x202964){return authService[_0xdac6('0x15e')](_0x202964);})[_0xdac6('0x14')](function(_0x2ada4e){if(_0x2ada4e){return _0x388295[_0xdac6('0x1e')](0xc8)[_0xdac6('0x25')]({'api_key':_0x2ada4e[_0xdac6('0x15f')]});}else{return _0x388295[_0xdac6('0x1e')](0xcc)['json']({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0xdac6('0x51')](handleError(_0x388295,0x193));}else{return _0x388295[_0xdac6('0x1e')](0x191)[_0xdac6('0x25')]({'message':_0xdac6('0x160')});}};exports[_0xdac6('0x161')]=function(_0x526e23,_0xc6e082){if(!_['isNil'](_0x526e23['user']['id'])&&(_0x526e23[_0xdac6('0x2c')][_0xdac6('0x2a')]==_0xdac6('0x2b')||_0x526e23[_0xdac6('0x2c')][_0xdac6('0x2a')]==_0xdac6('0x2c'))){return db[_0xdac6('0x39')][_0xdac6('0x35')]({'where':{'id':_0x526e23[_0xdac6('0x53')]['id']}})['then'](function(_0x1ef8bf){return authService['generateApiKey'](_0x1ef8bf);})['then'](function(_0x178919){return db[_0xdac6('0x39')]['update']({'apiKeyIat':_0x178919[_0xdac6('0x162')],'apiKeyNonce':_0x178919[_0xdac6('0x163')]},{'where':{'id':_0x526e23[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](function(){return _0xc6e082['status'](0xc8)[_0xdac6('0x25')]({'api_key':_0x178919[_0xdac6('0x15f')]});});})[_0xdac6('0x51')](handleError(_0xc6e082,0x193));}else{return _0xc6e082[_0xdac6('0x1e')](0x191)[_0xdac6('0x25')]({'message':_0xdac6('0x160')});}};exports[_0xdac6('0x164')]=function(_0x4f0bc5,_0x5af199){if(!_[_0xdac6('0x5f')](_0x4f0bc5[_0xdac6('0x2c')]['id'])&&(_0x4f0bc5['user'][_0xdac6('0x2a')]=='admin'||_0x4f0bc5[_0xdac6('0x2c')]['role']=='user')){return db['User'][_0xdac6('0x35')]({'where':{'id':_0x4f0bc5[_0xdac6('0x53')]['id']}})[_0xdac6('0x14')](handleEntityNotFound(_0x5af199,null))[_0xdac6('0x14')](function(_0x3e9f95){if(_0x3e9f95&&_0x3e9f95[_0xdac6('0x165')]&&_0x3e9f95[_0xdac6('0x166')])return _0x3e9f95;else throw{'message':'API\x20key\x20not\x20available'};})[_0xdac6('0x14')](function(){return db[_0xdac6('0x39')][_0xdac6('0x26')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x4f0bc5[_0xdac6('0x53')]['id']}});})[_0xdac6('0x14')](respondWithStatusCode(_0x5af199,0xc8))['catch'](handleError(_0x5af199,0x193));}else{return _0x5af199[_0xdac6('0x1e')](0x191)['json']({'message':_0xdac6('0x160')});}};exports[_0xdac6('0x167')]=function(_0x4ca926,_0x8bd820){var _0x15f0d1=_0x4ca926[_0xdac6('0x2c')][_0xdac6('0x29')]({'plain':!![]});if(!_0x15f0d1){return _0x8bd820[_0xdac6('0x1e')](0x191)['send'](_0xdac6('0x168'));}else{Promise[_0xdac6('0xfe')]()[_0xdac6('0x14')](function(){if(_0x4ca926['query'][_0xdac6('0x41')]!=='true')return;return _0x4ca926[_0xdac6('0x2c')][_0xdac6('0x169')]();})[_0xdac6('0x14')](function(_0x353427){if(!_0x353427)return;return _0x353427[_0xdac6('0x29')]({'plain':!![]});})[_0xdac6('0x14')](function(_0x5d94fd){_0x15f0d1['userSetting']=_0x5d94fd;return _0x8bd820['status'](0xc8)[_0xdac6('0x25')](_0x15f0d1);});}};exports[_0xdac6('0x16a')]=function(_0x2384e0,_0x14420f){var _0x58af89={'offset':0x0},_0x30880b={'count':0x0,'rows':[]};Promise[_0xdac6('0xfe')]()[_0xdac6('0x14')](function(){if(!_0x2384e0['query']['filter']&&!_0x2384e0['query'][_0xdac6('0x16b')]&&!_0x2384e0['query']['queues'])return[];return Promise[_0xdac6('0xfe')]()[_0xdac6('0x14')](function(){var _0x721206=[];if(!_[_0xdac6('0x81')](_0x2384e0[_0xdac6('0x40')][_0xdac6('0x16b')])){_0x721206[_0xdac6('0x46')](db[_0xdac6('0x10a')][_0xdac6('0xa6')]({'attributes':['id',_0xdac6('0x37')],'where':{'id':_0x2384e0[_0xdac6('0x40')][_0xdac6('0x16b')]}}));}if(!_['isEmpty'](_0x2384e0[_0xdac6('0x40')][_0xdac6('0x16c')])){_0x721206[_0xdac6('0x46')](db[_0xdac6('0xa5')][_0xdac6('0xa6')]({'attributes':['id',_0xdac6('0x37')],'type':_0xdac6('0x16d'),'where':{'id':_0x2384e0[_0xdac6('0x40')][_0xdac6('0x16c')]}}));}return Promise[_0xdac6('0x50')](_0x721206);})[_0xdac6('0x14')](function(_0x2b915c){var _0x289d73=_[_0xdac6('0x16e')](_0x2b915c)[_0xdac6('0x32')](function(_0x75af76){return _0x75af76[_0xdac6('0x16f')]({'attributes':['id',_0xdac6('0x37'),'internal','online'],'raw':!![]});});return Promise[_0xdac6('0x50')](_0x289d73);})[_0xdac6('0x14')](function(_0x32c9d3){var _0x2871bc=_[_0xdac6('0x16e')](_0x32c9d3);if(!_0x2384e0[_0xdac6('0x40')]['filter'])return _0x2871bc;if(_[_0xdac6('0x81')](_0x2871bc)){return db[_0xdac6('0x39')][_0xdac6('0xa6')]({'attributes':['id',_0xdac6('0x37'),_0xdac6('0x60'),'online'],'where':{'role':_0xdac6('0x2e'),'$or':[db[_0xdac6('0x62')][_0xdac6('0xcb')](db['sequelize']['fn'](_0xdac6('0x170'),db[_0xdac6('0x62')][_0xdac6('0x171')](_0xdac6('0x37'))),{'$like':'%'+_0x2384e0[_0xdac6('0x40')]['filter']['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x2384e0['query'][_0xdac6('0x31')]+'%'}}]},'raw':!![]});}else{return _(_0x2871bc)[_0xdac6('0x16e')]()['filter'](function(_0xaf5224){return _0xaf5224[_0xdac6('0x37')]['toLowerCase']()[_0xdac6('0x34')](_0x2384e0[_0xdac6('0x40')][_0xdac6('0x31')][_0xdac6('0x9d')]())||_0xaf5224['internal'][_0xdac6('0x172')]()[_0xdac6('0x34')](_0x2384e0['query'][_0xdac6('0x31')]);})[_0xdac6('0x33')]();}})[_0xdac6('0x14')](function(_0xe36182){var _0x1d9e95=_0xdac6('0x37');var _0x571f89=_0xdac6('0x173');if(_0x2384e0['query']['sort']){_0x571f89=_0x2384e0[_0xdac6('0x40')][_0xdac6('0xca')][0x0]==='-'?_0xdac6('0x174'):_0xdac6('0x173');_0x1d9e95=_0x571f89===_0xdac6('0x173')?_0x2384e0[_0xdac6('0x40')][_0xdac6('0xca')]:_0x2384e0[_0xdac6('0x40')]['sort'][_0xdac6('0x175')](0x1);}return _(_0xe36182)[_0xdac6('0x176')]('id')[_0xdac6('0x177')]([function(_0x3d9e8e){return _0x1d9e95===_0xdac6('0x37')?_0x3d9e8e[_0x1d9e95]['toLowerCase']():_0x3d9e8e[_0x1d9e95];}],[_0x571f89])[_0xdac6('0x32')](function(_0x39d68d){return _['pick'](_0x39d68d,['id','name',_0xdac6('0x60'),'online']);})[_0xdac6('0x33')]();})['then'](function(_0x28da7b){return amiClient[_0xdac6('0x13')](_0xdac6('0x2d'),_0x2384e0)[_0xdac6('0x14')](function(_0x29ca5b){if(_0x29ca5b[_0xdac6('0x1a')])throw new Error(_0xdac6('0x178'));var _0x7d4d62=_0x29ca5b[_0xdac6('0x1c')];var _0xb36085=jayson[_0xdac6('0x179')][_0xdac6('0x12')]({'port':0x232c});return _0xb36085[_0xdac6('0x13')](_0xdac6('0x2d'),_0x2384e0)[_0xdac6('0x14')](function(_0x1ebc0b){if(_0x1ebc0b['error'])throw new Error(_0xdac6('0x17a'));var _0x288da4=_0x1ebc0b[_0xdac6('0x1c')];return _[_0xdac6('0xcd')]({},_0x288da4,_0x7d4d62);});})[_0xdac6('0x14')](function(_0x4e887f){return _['map'](_0x28da7b,function(_0x36ed15){var _0x3dbfd0=_[_0xdac6('0x35')](_0x4e887f[_0xdac6('0x47')],['id',_0x36ed15['id']]);if(!_0x3dbfd0||!_0x36ed15[_0xdac6('0x95')]){_0x36ed15['status']=_0xdac6('0x17b');}else if(_0x3dbfd0['voicePause']){_0x36ed15[_0xdac6('0x1e')]=_0xdac6('0xff');}else{_0x36ed15[_0xdac6('0x1e')]=_[_0xdac6('0x34')]([_0xdac6('0x17c'),'unknown','unavailable','ringing',null,undefined],_0x3dbfd0[_0xdac6('0x17d')])?'online':_0xdac6('0x17e');}return _0x36ed15;});});});})[_0xdac6('0x14')](function(_0x5dd656){if(!_0x2384e0['query'][_0xdac6('0xcf')]('nolimit')){_0x58af89[_0xdac6('0x22')]=qs[_0xdac6('0x22')](_0x2384e0['query'][_0xdac6('0x22')]||0xa);_0x58af89[_0xdac6('0x20')]=qs['offset'](_0x2384e0['query'][_0xdac6('0x20')]);}_0x30880b['count']=_0x5dd656[_0xdac6('0x49')];_0x30880b[_0xdac6('0x47')]=_0x58af89[_0xdac6('0x22')]?_0x5dd656[_0xdac6('0x17f')](_0x58af89[_0xdac6('0x20')],_0x58af89[_0xdac6('0x20')]+_0x58af89[_0xdac6('0x22')]):_0x5dd656;return _0x30880b;})[_0xdac6('0x14')](respondWithFilteredResult(_0x14420f,_0x58af89))['catch'](handleError(_0x14420f,null));};function get_open_tabs(_0x142087,_0x5a9395){var _0x5852b=_0x142087[_0xdac6('0x180')](0x0)[_0xdac6('0x181')]()+_0x142087['slice'](0x1);var _0x147c01={'type':db[_0xdac6('0x85')][_0xdac6('0x64')][_0xdac6('0x65')],'raw':!![]};return new Promise(function(_0x1db7be,_0x36a275){var _0x1f4f2f=squel[_0xdac6('0x182')]()[_0xdac6('0x183')]('ui.'+_0x5852b+_0xdac6('0x184'),'id')[_0xdac6('0x183')]('ui.createdAt')[_0xdac6('0x66')](_0xdac6('0x185')+_0x142087+_0xdac6('0x186'),'ui')['where']('ui.UserId\x20=\x20?',_0x5a9395['id']);return db[_0xdac6('0x62')][_0xdac6('0x40')](_0x1f4f2f[_0xdac6('0x172')](),_0x147c01)['then'](function(_0x13b70e){_0x5a9395[_0x5852b+_0xdac6('0x187')]=_0x13b70e;_0x1db7be(_0x13b70e);})['catch'](function(_0x4a3431){_0x36a275(_0x4a3431);});});}
\ No newline at end of file
index 95a9c89..2d5c46d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe39b=['update','emit','exports','events','User','setMaxListeners'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0xe39b,0x8d));var _0xbe39=function(_0x1e4857,_0x3716c1){_0x1e4857=_0x1e4857-0x0;var _0x218038=_0xe39b[_0x1e4857];return _0x218038;};'use strict';var EventEmitter=require(_0xbe39('0x0'));var User=require('../../mysqldb')['db'][_0xbe39('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xbe39('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbe39('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3ab2e9){return function(_0x95efbd,_0x5e3815,_0x4dfc42){UserEvents[_0xbe39('0x4')](_0x3ab2e9+':'+_0x95efbd['id'],_0x95efbd);UserEvents[_0xbe39('0x4')](_0x3ab2e9,_0x95efbd);_0x4dfc42(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0xbe39('0x5')]=UserEvents;
\ No newline at end of file
+var _0x9c90=['events','../../mysqldb','User','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2078a0,_0x19f173){var _0x1ea2a6=function(_0x5c26c5){while(--_0x5c26c5){_0x2078a0['push'](_0x2078a0['shift']());}};_0x1ea2a6(++_0x19f173);}(_0x9c90,0x1cc));var _0x09c9=function(_0x3d38ae,_0x51102b){_0x3d38ae=_0x3d38ae-0x0;var _0x3757ee=_0x9c90[_0x3d38ae];return _0x3757ee;};'use strict';var EventEmitter=require(_0x09c9('0x0'));var User=require(_0x09c9('0x1'))['db'][_0x09c9('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x09c9('0x3')](0x0);var events={'afterCreate':_0x09c9('0x4'),'afterUpdate':_0x09c9('0x5'),'afterDestroy':_0x09c9('0x6')};function emitEvent(_0x217f06){return function(_0x53da61,_0x425851,_0x21c852){UserEvents[_0x09c9('0x7')](_0x217f06+':'+_0x53da61['id'],_0x53da61);UserEvents[_0x09c9('0x7')](_0x217f06,_0x53da61);_0x21c852(null);};}for(var e in events){if(events[_0x09c9('0x8')](e)){var event=events[e];User[_0x09c9('0x9')](e,emitEvent(event));}}module['exports']=UserEvents;
\ No newline at end of file
index 6200c1a..6dda8b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6c1=['moment','lodash','jayson/promise','./user.attributes','google','length','context','system','prefix','Set','format','chanspy','push','MixMonitor','auth','merge','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','wav','WAV','gsm','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','defaults','VoiceChanSpy','findAll','then','concat','catch','exports','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','find','privacyEnabled','updateMd5Password','updatePassword','UserProfile','changed','internal','createUserSetting','error','bulkCreate','VoiceExtension','destroy','encryptPassword','function','Missing\x20Callback','toString','base64','salt','from','sha1','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','client','http','Agents','request','result','manual','voice','QueuePause','message','UserVoiceQueueRt','update','findOne','PAUSE','map','YYYY-MM-DD\x20HH:mm:ss','all','voicePause','faxPause','smsPause','whatsappPause','Pause','getRealtimeData','getChannels','forEach','Status','bluebird','crypto','util'];(function(_0x566063,_0x3b80ef){var _0x424b75=function(_0x4e4225){while(--_0x4e4225){_0x566063['push'](_0x566063['shift']());}};_0x424b75(++_0x3b80ef);}(_0xd6c1,0x1a9));var _0x1d6c=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xd6c1[_0x178e48];return _0x440d7e;};'use strict';var BPromise=require(_0x1d6c('0x0'));var crypto=require(_0x1d6c('0x1'));var util=require(_0x1d6c('0x2'));var md5=require('md5');var moment=require(_0x1d6c('0x3'));var _=require(_0x1d6c('0x4'));var jayson=require(_0x1d6c('0x5'));var attributes=require(_0x1d6c('0x6'));var authTypes=[_0x1d6c('0x7')];var validatePresenceOf=function(_0x14a3e0){return _0x14a3e0&&_0x14a3e0[_0x1d6c('0x8')];};var getChanSpyApplications=function(_0x19da72,_0x45083f,_0x2df17c){var _0x2cc287={'context':_0x19da72[_0x1d6c('0x9')]||'from-sip','type':_0x1d6c('0xa'),'isApp':![],'UserId':_0x19da72['id']};var _0x3726ce=[];for(var _0x184c2d=0x0,_0x423cbb=0x1;_0x184c2d<_0x2df17c[_0x1d6c('0x8')];_0x184c2d++,_0x423cbb=0x1){var _0x2ae370={'exten':util['format']('%s%s',_0x2df17c[_0x184c2d][_0x1d6c('0xb')],_0x45083f),'ChanSpyId':_0x2df17c[_0x184c2d]['id']};_0x3726ce['push'](_['merge']({'app':_0x1d6c('0xc'),'appdata':util[_0x1d6c('0xd')]('CDR(type)=%s',_0x1d6c('0xe')),'priority':_0x423cbb++},_0x2cc287,_0x2ae370));if(_0x2df17c[_0x184c2d]['record']){_0x3726ce[_0x1d6c('0xf')](_['merge']({'app':_0x1d6c('0x10'),'appdata':util[_0x1d6c('0xd')]('${UNIQUEID}.%s,a',_0x2df17c[_0x184c2d]['recordingFormat']),'priority':_0x423cbb++},_0x2cc287,_0x2ae370));}if(_0x2df17c[_0x184c2d][_0x1d6c('0x11')]){_0x3726ce[_0x1d6c('0xf')](_[_0x1d6c('0x12')]({'app':_0x1d6c('0x13'),'appdata':_0x2df17c[_0x184c2d][_0x1d6c('0x14')],'priority':_0x423cbb++},_0x2cc287,_0x2ae370));}_0x3726ce[_0x1d6c('0xf')](_[_0x1d6c('0x12')]({'app':_0x1d6c('0x15'),'appdata':util[_0x1d6c('0xd')](_0x1d6c('0x16'),_0x19da72[_0x1d6c('0x17')],_0x2df17c[_0x184c2d][_0x1d6c('0x18')]?_0x2df17c[_0x184c2d]['options'][_0x1d6c('0x19')](''):''),'priority':_0x423cbb++},_0x2cc287,_0x2ae370));if(_0x2df17c[_0x184c2d][_0x1d6c('0x1a')]){_0x3726ce['push'](_[_0x1d6c('0x12')]({'app':_0x1d6c('0x1b'),'priority':_0x423cbb++},_0x2cc287,_0x2ae370));}}return _0x3726ce;};var getUserApplications=function(_0xcc3678,_0x5e622c){var _0x2cdc9a=[_0x1d6c('0x1c'),_0x1d6c('0x1d'),_0x1d6c('0x1e')];var _0x38e557={'context':_0xcc3678[_0x1d6c('0x9')]||'from-sip','exten':_0x5e622c,'type':_0x1d6c('0xa'),'isApp':![],'UserId':_0xcc3678['id']};var _0x36595e=[{'app':_0x1d6c('0xc'),'appdata':_0x1d6c('0x1f')}];if(_0xcc3678[_0x1d6c('0x20')]&&_[_0x1d6c('0x21')](_0x2cdc9a,_0xcc3678['extensionMonitor'])){_0x36595e[_0x1d6c('0xf')]({'app':_0x1d6c('0xc'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x36595e[_0x1d6c('0xf')]({'app':_0x1d6c('0xc'),'appdata':util['format'](_0x1d6c('0x22'),_0xcc3678['extensionMonitor'])});_0x36595e['push']({'app':_0x1d6c('0x23'),'appdata':util[_0x1d6c('0xd')](_0x1d6c('0x24'),_0xcc3678['name'])});}else{_0x36595e[_0x1d6c('0xf')]({'app':_0x1d6c('0x23'),'appdata':util[_0x1d6c('0xd')](_0x1d6c('0x25'),_0xcc3678['name'])});}_0x36595e['push']({'app':_0x1d6c('0x26')});for(var _0x53a355=0x0;_0x53a355<_0x36595e['length'];_0x53a355++){_0x36595e[_0x53a355][_0x1d6c('0x27')]=_0x53a355+0x1;_0x36595e[_0x53a355]=_[_0x1d6c('0x28')](_0x36595e[_0x53a355],_0x38e557);}return _0x36595e;};var getChanSpyPromise=function(_0x23e221,_0x20a3cb){return new BPromise(function(_0x3c30cb,_0x425657){return _0x23e221[_0x1d6c('0x29')][_0x1d6c('0x2a')]()[_0x1d6c('0x2b')](function(_0x545376){if(_0x545376){var _0x24554e=getChanSpyApplications(_0x20a3cb,_0x20a3cb['internal'],_0x545376);if(_0x20a3cb['internal']!=_0x20a3cb[_0x1d6c('0x17')]){_0x24554e=_0x24554e[_0x1d6c('0x2c')](getChanSpyApplications(_0x20a3cb,_0x20a3cb[_0x1d6c('0x17')],_0x545376));}return _0x3c30cb(_0x24554e);}return _0x3c30cb([]);})[_0x1d6c('0x2d')](function(_0x856f29){_0x425657(_0x856f29);});});};module[_0x1d6c('0x2e')]=function(_0x360451){var _0x806683=_0x360451['models'];return _0x360451[_0x1d6c('0x2f')](_0x1d6c('0x30'),attributes,{'tableName':_0x1d6c('0x31'),'charset':_0x1d6c('0x32'),'collate':_0x1d6c('0x33'),'hooks':{'beforeCreate':function(_0x3a8754,_0x20a3e4,_0x4fdfce){var _0x41bd51=typeof _0x3a8754[_0x1d6c('0x34')]===_0x1d6c('0x35')?BPromise[_0x1d6c('0x36')](null):_0x806683['UserProfile'][_0x1d6c('0x37')]({'where':{'id':_0x3a8754['userProfileId']}});_0x41bd51[_0x1d6c('0x2b')](function(_0x296da1){if(_0x296da1){_0x3a8754[_0x1d6c('0x38')]=_0x296da1[_0x1d6c('0x38')];}})[_0x1d6c('0x2b')](function(){_0x3a8754[_0x1d6c('0x39')]();_0x3a8754[_0x1d6c('0x3a')](_0x4fdfce);})['catch'](function(_0x4bd4ea){_0x4fdfce(_0x4bd4ea);});},'beforeUpdate':function(_0x4b754e,_0x298656,_0x1b856a){Promise[_0x1d6c('0x36')]()[_0x1d6c('0x2b')](function(){if(_0x4b754e['changed']('userProfileId')===![])return;return _0x806683[_0x1d6c('0x3b')][_0x1d6c('0x37')]({'where':{'id':_0x4b754e[_0x1d6c('0x34')]}})[_0x1d6c('0x2b')](function(_0x567341){if(_0x567341)_0x4b754e[_0x1d6c('0x38')]=_0x567341[_0x1d6c('0x38')];return;});})[_0x1d6c('0x2b')](function(){if(_0x4b754e[_0x1d6c('0x3c')](_0x1d6c('0x14'))){_0x4b754e['updateMd5Password']();return _0x4b754e[_0x1d6c('0x3a')](_0x1b856a);}_0x1b856a();})[_0x1d6c('0x2d')](function(_0x37df69){_0x1b856a(_0x37df69);});},'afterCreate':function(_0x5a0508,_0x22cf10,_0x53e462){var _0x218429=getUserApplications(_0x5a0508,_0x5a0508[_0x1d6c('0x3d')]);if(_0x5a0508[_0x1d6c('0x3d')]!=_0x5a0508['name']){_0x218429=_0x218429[_0x1d6c('0x2c')](getUserApplications(_0x5a0508,_0x5a0508[_0x1d6c('0x17')]));}return Promise[_0x1d6c('0x36')]()[_0x1d6c('0x2b')](function(){if(!_0x5a0508['userSetting']){return _0x5a0508[_0x1d6c('0x3e')]({'clientSideLoggingLevel':_0x1d6c('0x3f'),'clientSideLoggingEnabled':![]});}})[_0x1d6c('0x2b')](function(){return _0x806683['VoiceExtension'][_0x1d6c('0x40')](_0x218429);})[_0x1d6c('0x2b')](function(){if(_0x5a0508['chanspy']){return getChanSpyPromise(_0x806683,_0x5a0508);}})[_0x1d6c('0x2b')](function(_0x572280){if(_0x572280&&_0x572280['length']){return _0x806683[_0x1d6c('0x41')]['bulkCreate'](_0x572280);}})[_0x1d6c('0x2b')](function(){_0x53e462();})[_0x1d6c('0x2d')](function(_0x4fbcf5){_0x53e462(_0x4fbcf5);});},'afterUpdate':function(_0x44dbcb,_0x423aa4,_0x37d3e8){return BPromise[_0x1d6c('0x36')]()[_0x1d6c('0x2b')](function(){if(_0x44dbcb[_0x1d6c('0x3c')](_0x1d6c('0xe'))||_0x44dbcb[_0x1d6c('0x3c')](_0x1d6c('0x9'))){return _0x806683['VoiceExtension'][_0x1d6c('0x42')]({'where':{'UserId':_0x44dbcb['id'],'type':_0x1d6c('0xa'),'ChanSpyId':{'$ne':null}}})[_0x1d6c('0x2b')](function(){if(_0x44dbcb[_0x1d6c('0xe')]){return getChanSpyPromise(_0x806683,_0x44dbcb)[_0x1d6c('0x2b')](function(_0x2c7d31){if(_0x2c7d31&&_0x2c7d31[_0x1d6c('0x8')]){return _0x806683[_0x1d6c('0x41')]['bulkCreate'](_0x2c7d31);}});}});}})['then'](function(){if(_0x44dbcb[_0x1d6c('0x3c')]('extensionMonitor')||_0x44dbcb[_0x1d6c('0x3c')]('context')){return _0x806683['VoiceExtension']['destroy']({'where':{'UserId':_0x44dbcb['id'],'type':_0x1d6c('0xa'),'ChanSpyId':null}})[_0x1d6c('0x2b')](function(){var _0x2a760c=getUserApplications(_0x44dbcb,_0x44dbcb[_0x1d6c('0x3d')]);if(_0x44dbcb[_0x1d6c('0x3d')]!=_0x44dbcb[_0x1d6c('0x17')]){_0x2a760c=_0x2a760c['concat'](getUserApplications(_0x44dbcb,_0x44dbcb[_0x1d6c('0x17')]));}return _0x806683[_0x1d6c('0x41')]['bulkCreate'](_0x2a760c);});}})[_0x1d6c('0x2b')](function(){_0x37d3e8();})['catch'](function(_0xb2d1c0){_0x37d3e8(_0xb2d1c0);});},'afterDestroy':function(_0x4abaae){return _0x806683[_0x1d6c('0x41')]['destroy']({'where':{'UserId':_0x4abaae['id'],'type':_0x1d6c('0xa')}});}},'instanceMethods':{'authenticate':function(_0x52a40a,_0x3b3d34){if(!_0x3b3d34){return this[_0x1d6c('0x14')]===this[_0x1d6c('0x43')](_0x52a40a);}var _0x3025de=this;this['encryptPassword'](_0x52a40a,function(_0x516e29,_0x4b9c40){if(_0x516e29){_0x3b3d34(_0x516e29);}if(_0x3025de[_0x1d6c('0x14')]===_0x4b9c40){_0x3b3d34(null,!![]);}else{_0x3b3d34(null,![]);}});},'makeSalt':function(_0x8eede2,_0x4a205a){var _0x31f2f9=0x10;if(typeof arguments[0x0]===_0x1d6c('0x44')){_0x4a205a=arguments[0x0];_0x8eede2=_0x31f2f9;}else if(typeof arguments[0x1]===_0x1d6c('0x44')){_0x4a205a=arguments[0x1];}else{throw new Error(_0x1d6c('0x45'));}if(!_0x8eede2){_0x8eede2=_0x31f2f9;}return crypto['randomBytes'](_0x8eede2,function(_0x7d8450,_0xd70641){if(_0x7d8450){_0x4a205a(_0x7d8450);}return _0x4a205a(null,_0xd70641[_0x1d6c('0x46')](_0x1d6c('0x47')));});},'encryptPassword':function(_0x3b57bf,_0x4f9b26){if(!_0x3b57bf||!this[_0x1d6c('0x48')]){return _0x4f9b26?_0x4f9b26(null):null;}var _0x3a537c=0x2710;var _0x7e23a0=0x40;var _0x32eeb2=Buffer[_0x1d6c('0x49')](this[_0x1d6c('0x48')],_0x1d6c('0x47'));if(!_0x4f9b26){return crypto['pbkdf2Sync'](_0x3b57bf,_0x32eeb2,_0x3a537c,_0x7e23a0,_0x1d6c('0x4a'))[_0x1d6c('0x46')](_0x1d6c('0x47'));}return crypto[_0x1d6c('0x4b')](_0x3b57bf,_0x32eeb2,_0x3a537c,_0x7e23a0,'sha1',function(_0xb8165f,_0x5ccebb){if(_0xb8165f){_0x4f9b26(_0xb8165f);}return _0x4f9b26(null,_0x5ccebb[_0x1d6c('0x46')]('base64'));});},'updatePassword':function(_0x4bb161){if(!this[_0x1d6c('0x14')]){return _0x4bb161(null);}if(!validatePresenceOf(this[_0x1d6c('0x14')])&&authTypes[_0x1d6c('0x4c')](this[_0x1d6c('0x4d')])===-0x1){_0x4bb161(new Error(_0x1d6c('0x4e')));}var _0xf4f562=this;this[_0x1d6c('0x4f')](function(_0x575e41,_0x47d798){if(_0x575e41){return _0x4bb161(_0x575e41);}_0xf4f562['salt']=_0x47d798;_0xf4f562[_0x1d6c('0x43')](_0xf4f562['password'],function(_0x1cc507,_0x5773d6){if(_0x1cc507){_0x4bb161(_0x1cc507);}_0xf4f562['password']=_0x5773d6;_0x4bb161(null);});});},'updateMd5Password':function(){this[_0x1d6c('0x50')]=md5(this[_0x1d6c('0x17')]+_0x1d6c('0x51')+this['password']);return this[_0x1d6c('0x50')];},'getRealtimeData':function(){var _0x1fb857={'id':this['id']};var _0x570b01=jayson[_0x1d6c('0x52')]['http']({'port':0x232a});var _0x4f7c37=jayson['client'][_0x1d6c('0x53')]({'port':0x232c});var _0x23176d={};var _0x50e013={};return _0x570b01['request'](_0x1d6c('0x54'),_0x1fb857)[_0x1d6c('0x2b')](function(_0x20fae7){if(_0x20fae7['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)');}_0x23176d=_0x20fae7['result'];return _0x4f7c37[_0x1d6c('0x55')](_0x1d6c('0x54'),_0x1fb857);})[_0x1d6c('0x2b')](function(_0x522816){if(_0x522816['error']){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0x50e013=_0x522816[_0x1d6c('0x56')];var _0x46f306=_['merge']({},_0x23176d,_0x50e013);return _0x46f306;})[_0x1d6c('0x2d')](function(_0x25ca41){throw _0x25ca41;});},'unpause':function(_0x448571,_0x3dbf49=_0x1d6c('0x57')){var _0x3c9656=this;var _0x4e29b9={};return Promise['resolve']()['then'](function(){if(!_0x448571||_0x448571===_0x1d6c('0x58')&&_0x3dbf49===_0x1d6c('0x57')){var _0x331146=jayson[_0x1d6c('0x52')][_0x1d6c('0x53')]({'port':0x232a});return _0x331146['request'](_0x1d6c('0x59'),{'id':_0x3c9656['id'],'name':_0x3c9656['name'],'pause':![]})['then'](function(_0x35761d){if(_0x35761d[_0x1d6c('0x3f')]){throw new Error(util[_0x1d6c('0xd')]('Unable\x20to\x20unpause\x20agent\x20%s:$s',_0x3c9656['id'],_0x3c9656[_0x1d6c('0x17')]));}return _0x35761d['result'][_0x1d6c('0x5a')];});}})[_0x1d6c('0x2b')](function(){if(!_0x448571||_0x448571===_0x1d6c('0x58')){return _0x806683[_0x1d6c('0x5b')][_0x1d6c('0x5c')]({'paused':0x0},{'where':{'UserId':_0x3c9656['id']},'individualHooks':!![]});}})['then'](function(){var _0x293c39=!_0x448571?_0x1d6c('0x2a'):_0x1d6c('0x5d');return _0x806683['MemberReport'][_0x293c39]({'where':{'channel':_0x448571,'membername':_0x3c9656['name'],'type':_0x1d6c('0x5e'),'exitAt':null}});})['then'](function(_0x44317b){if(_0x44317b){var _0x105698=Array['isArray'](_0x44317b)?_0x44317b:[_0x44317b];var _0x51ea37=_0x105698[_0x1d6c('0x5f')](function(_0x2bd20f){return _0x2bd20f['update']({'exitAt':moment()['format'](_0x1d6c('0x60')),'data2':_0x3dbf49});});return Promise[_0x1d6c('0x61')](_0x51ea37);}})[_0x1d6c('0x2b')](function(){if(!_0x448571){_0x4e29b9[_0x1d6c('0x62')]=![];_0x4e29b9['mailPause']=![];_0x4e29b9['chatPause']=![];_0x4e29b9[_0x1d6c('0x63')]=![];_0x4e29b9[_0x1d6c('0x64')]=![];_0x4e29b9[_0x1d6c('0x65')]=![];_0x4e29b9['openchannelPause']=![];}else{_0x4e29b9[_0x448571+_0x1d6c('0x66')]=![];}return _0x3c9656[_0x1d6c('0x67')]();})[_0x1d6c('0x2b')](function(_0x49130a){var _0x37ab37=require('../../config/utils');var _0x22dde2=_0x37ab37[_0x1d6c('0x68')]();_0x22dde2[_0x1d6c('0x69')](function(_0x1c987f){var _0x3f5531=_0x1c987f+_0x1d6c('0x6a');_0x3c9656['setDataValue']([_0x3f5531],_0x49130a[_0x3f5531]);});return _0x3c9656[_0x1d6c('0x5c')](_0x4e29b9);})['catch'](function(_0xfe697f){throw _0xfe697f;});}}});};
\ No newline at end of file
+var _0x95bb=['findAll','MemberReport','PAUSE','isArray','YYYY-MM-DD\x20HH:mm:ss','voicePause','mailPause','chatPause','faxPause','smsPause','openchannelPause','Pause','getRealtimeData','../../config/utils','forEach','Status','bluebird','md5','moment','lodash','jayson/promise','./user.attributes','length','context','from-sip','format','%s%s','prefix','Set','chanspy','record','push','merge','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','wav','WAV','system','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','VoiceChanSpy','then','internal','catch','exports','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','privacyEnabled','updateMd5Password','changed','updatePassword','userSetting','createUserSetting','VoiceExtension','bulkCreate','destroy','concat','encryptPassword','function','randomBytes','toString','base64','pbkdf2Sync','sha1','pbkdf2','indexOf','Invalid\x20password','makeSalt','salt','md5secret','client','http','request','Agents','error','result','voice','QueuePause','update'];(function(_0x4f6e97,_0x121c56){var _0x48ee74=function(_0x2dee01){while(--_0x2dee01){_0x4f6e97['push'](_0x4f6e97['shift']());}};_0x48ee74(++_0x121c56);}(_0x95bb,0x1a0));var _0xb95b=function(_0x4c171c,_0x25a516){_0x4c171c=_0x4c171c-0x0;var _0x35b103=_0x95bb[_0x4c171c];return _0x35b103;};'use strict';var BPromise=require(_0xb95b('0x0'));var crypto=require('crypto');var util=require('util');var md5=require(_0xb95b('0x1'));var moment=require(_0xb95b('0x2'));var _=require(_0xb95b('0x3'));var jayson=require(_0xb95b('0x4'));var attributes=require(_0xb95b('0x5'));var authTypes=['google'];var validatePresenceOf=function(_0x222022){return _0x222022&&_0x222022[_0xb95b('0x6')];};var getChanSpyApplications=function(_0x33107e,_0x4e0bd2,_0x1c2fa8){var _0x25482e={'context':_0x33107e[_0xb95b('0x7')]||_0xb95b('0x8'),'type':'system','isApp':![],'UserId':_0x33107e['id']};var _0x2a3a9c=[];for(var _0x35923c=0x0,_0x45f96f=0x1;_0x35923c<_0x1c2fa8['length'];_0x35923c++,_0x45f96f=0x1){var _0x42b087={'exten':util[_0xb95b('0x9')](_0xb95b('0xa'),_0x1c2fa8[_0x35923c][_0xb95b('0xb')],_0x4e0bd2),'ChanSpyId':_0x1c2fa8[_0x35923c]['id']};_0x2a3a9c['push'](_['merge']({'app':_0xb95b('0xc'),'appdata':util[_0xb95b('0x9')]('CDR(type)=%s',_0xb95b('0xd')),'priority':_0x45f96f++},_0x25482e,_0x42b087));if(_0x1c2fa8[_0x35923c][_0xb95b('0xe')]){_0x2a3a9c[_0xb95b('0xf')](_[_0xb95b('0x10')]({'app':'MixMonitor','appdata':util[_0xb95b('0x9')]('${UNIQUEID}.%s,a',_0x1c2fa8[_0x35923c][_0xb95b('0x11')]),'priority':_0x45f96f++},_0x25482e,_0x42b087));}if(_0x1c2fa8[_0x35923c][_0xb95b('0x12')]){_0x2a3a9c[_0xb95b('0xf')](_['merge']({'app':_0xb95b('0x13'),'appdata':_0x1c2fa8[_0x35923c][_0xb95b('0x14')],'priority':_0x45f96f++},_0x25482e,_0x42b087));}_0x2a3a9c[_0xb95b('0xf')](_[_0xb95b('0x10')]({'app':_0xb95b('0x15'),'appdata':util['format'](_0xb95b('0x16'),_0x33107e[_0xb95b('0x17')],_0x1c2fa8[_0x35923c][_0xb95b('0x18')]?_0x1c2fa8[_0x35923c]['options'][_0xb95b('0x19')](''):''),'priority':_0x45f96f++},_0x25482e,_0x42b087));if(_0x1c2fa8[_0x35923c][_0xb95b('0xe')]){_0x2a3a9c[_0xb95b('0xf')](_[_0xb95b('0x10')]({'app':'StopMixMonitor','priority':_0x45f96f++},_0x25482e,_0x42b087));}}return _0x2a3a9c;};var getUserApplications=function(_0x3f6b1d,_0x28a14b){var _0x33fbf7=[_0xb95b('0x1a'),_0xb95b('0x1b'),'gsm'];var _0x533f5c={'context':_0x3f6b1d[_0xb95b('0x7')]||_0xb95b('0x8'),'exten':_0x28a14b,'type':_0xb95b('0x1c'),'isApp':![],'UserId':_0x3f6b1d['id']};var _0xfbbe45=[{'app':_0xb95b('0xc'),'appdata':_0xb95b('0x1d')}];if(_0x3f6b1d[_0xb95b('0x1e')]&&_[_0xb95b('0x1f')](_0x33fbf7,_0x3f6b1d['extensionMonitor'])){_0xfbbe45[_0xb95b('0xf')]({'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0xfbbe45[_0xb95b('0xf')]({'app':_0xb95b('0xc'),'appdata':util[_0xb95b('0x9')](_0xb95b('0x20'),_0x3f6b1d[_0xb95b('0x1e')])});_0xfbbe45[_0xb95b('0xf')]({'app':_0xb95b('0x21'),'appdata':util[_0xb95b('0x9')](_0xb95b('0x22'),_0x3f6b1d[_0xb95b('0x17')])});}else{_0xfbbe45[_0xb95b('0xf')]({'app':_0xb95b('0x21'),'appdata':util[_0xb95b('0x9')](_0xb95b('0x23'),_0x3f6b1d['name'])});}_0xfbbe45[_0xb95b('0xf')]({'app':_0xb95b('0x24')});for(var _0x5ccbfc=0x0;_0x5ccbfc<_0xfbbe45[_0xb95b('0x6')];_0x5ccbfc++){_0xfbbe45[_0x5ccbfc]['priority']=_0x5ccbfc+0x1;_0xfbbe45[_0x5ccbfc]=_['defaults'](_0xfbbe45[_0x5ccbfc],_0x533f5c);}return _0xfbbe45;};var getChanSpyPromise=function(_0x1ea93e,_0x3f85af){return new BPromise(function(_0x525729,_0x45b7b9){return _0x1ea93e[_0xb95b('0x25')]['findAll']()[_0xb95b('0x26')](function(_0x156996){if(_0x156996){var _0xf49dc3=getChanSpyApplications(_0x3f85af,_0x3f85af['internal'],_0x156996);if(_0x3f85af[_0xb95b('0x27')]!=_0x3f85af[_0xb95b('0x17')]){_0xf49dc3=_0xf49dc3['concat'](getChanSpyApplications(_0x3f85af,_0x3f85af['name'],_0x156996));}return _0x525729(_0xf49dc3);}return _0x525729([]);})[_0xb95b('0x28')](function(_0x15f967){_0x45b7b9(_0x15f967);});});};module[_0xb95b('0x29')]=function(_0x642a64){var _0x15ba62=_0x642a64['models'];return _0x642a64[_0xb95b('0x2a')](_0xb95b('0x2b'),attributes,{'tableName':_0xb95b('0x2c'),'charset':_0xb95b('0x2d'),'collate':_0xb95b('0x2e'),'hooks':{'beforeCreate':function(_0x5a225e,_0x1fe4d5,_0x22eb76){var _0x54ba30=typeof _0x5a225e[_0xb95b('0x2f')]===_0xb95b('0x30')?BPromise[_0xb95b('0x31')](null):_0x15ba62[_0xb95b('0x32')][_0xb95b('0x33')]({'where':{'id':_0x5a225e['userProfileId']}});_0x54ba30[_0xb95b('0x26')](function(_0x5112b9){if(_0x5112b9){_0x5a225e[_0xb95b('0x34')]=_0x5112b9[_0xb95b('0x34')];}})[_0xb95b('0x26')](function(){_0x5a225e[_0xb95b('0x35')]();_0x5a225e['updatePassword'](_0x22eb76);})['catch'](function(_0x26062b){_0x22eb76(_0x26062b);});},'beforeUpdate':function(_0x3f079e,_0x4193fe,_0x1bed3a){Promise[_0xb95b('0x31')]()[_0xb95b('0x26')](function(){if(_0x3f079e[_0xb95b('0x36')](_0xb95b('0x2f'))===![])return;return _0x15ba62[_0xb95b('0x32')][_0xb95b('0x33')]({'where':{'id':_0x3f079e[_0xb95b('0x2f')]}})[_0xb95b('0x26')](function(_0x4210e1){if(_0x4210e1)_0x3f079e[_0xb95b('0x34')]=_0x4210e1[_0xb95b('0x34')];return;});})[_0xb95b('0x26')](function(){if(_0x3f079e[_0xb95b('0x36')](_0xb95b('0x14'))){_0x3f079e[_0xb95b('0x35')]();return _0x3f079e[_0xb95b('0x37')](_0x1bed3a);}_0x1bed3a();})[_0xb95b('0x28')](function(_0x367142){_0x1bed3a(_0x367142);});},'afterCreate':function(_0x286fcf,_0x2a35db,_0x2b4825){var _0x261f3e=getUserApplications(_0x286fcf,_0x286fcf[_0xb95b('0x27')]);if(_0x286fcf['internal']!=_0x286fcf[_0xb95b('0x17')]){_0x261f3e=_0x261f3e['concat'](getUserApplications(_0x286fcf,_0x286fcf['name']));}return Promise[_0xb95b('0x31')]()[_0xb95b('0x26')](function(){if(!_0x286fcf[_0xb95b('0x38')]){return _0x286fcf[_0xb95b('0x39')]({'clientSideLoggingLevel':'error','clientSideLoggingEnabled':![]});}})[_0xb95b('0x26')](function(){return _0x15ba62['VoiceExtension']['bulkCreate'](_0x261f3e);})[_0xb95b('0x26')](function(){if(_0x286fcf[_0xb95b('0xd')]){return getChanSpyPromise(_0x15ba62,_0x286fcf);}})[_0xb95b('0x26')](function(_0x5996dd){if(_0x5996dd&&_0x5996dd['length']){return _0x15ba62[_0xb95b('0x3a')][_0xb95b('0x3b')](_0x5996dd);}})[_0xb95b('0x26')](function(){_0x2b4825();})[_0xb95b('0x28')](function(_0x293b43){_0x2b4825(_0x293b43);});},'afterUpdate':function(_0x17900d,_0x2ce012,_0x44fdc5){return BPromise[_0xb95b('0x31')]()[_0xb95b('0x26')](function(){if(_0x17900d[_0xb95b('0x36')](_0xb95b('0xd'))||_0x17900d[_0xb95b('0x36')]('context')){return _0x15ba62[_0xb95b('0x3a')]['destroy']({'where':{'UserId':_0x17900d['id'],'type':_0xb95b('0x1c'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x17900d[_0xb95b('0xd')]){return getChanSpyPromise(_0x15ba62,_0x17900d)[_0xb95b('0x26')](function(_0x3f90d1){if(_0x3f90d1&&_0x3f90d1['length']){return _0x15ba62[_0xb95b('0x3a')][_0xb95b('0x3b')](_0x3f90d1);}});}});}})[_0xb95b('0x26')](function(){if(_0x17900d[_0xb95b('0x36')](_0xb95b('0x1e'))||_0x17900d[_0xb95b('0x36')](_0xb95b('0x7'))){return _0x15ba62[_0xb95b('0x3a')][_0xb95b('0x3c')]({'where':{'UserId':_0x17900d['id'],'type':_0xb95b('0x1c'),'ChanSpyId':null}})[_0xb95b('0x26')](function(){var _0x4608f5=getUserApplications(_0x17900d,_0x17900d[_0xb95b('0x27')]);if(_0x17900d['internal']!=_0x17900d[_0xb95b('0x17')]){_0x4608f5=_0x4608f5[_0xb95b('0x3d')](getUserApplications(_0x17900d,_0x17900d['name']));}return _0x15ba62[_0xb95b('0x3a')][_0xb95b('0x3b')](_0x4608f5);});}})[_0xb95b('0x26')](function(){_0x44fdc5();})[_0xb95b('0x28')](function(_0x4a4876){_0x44fdc5(_0x4a4876);});},'afterDestroy':function(_0x7a151a){return _0x15ba62['VoiceExtension'][_0xb95b('0x3c')]({'where':{'UserId':_0x7a151a['id'],'type':_0xb95b('0x1c')}});}},'instanceMethods':{'authenticate':function(_0x52e2af,_0xe64c11){if(!_0xe64c11){return this[_0xb95b('0x14')]===this[_0xb95b('0x3e')](_0x52e2af);}var _0x5ab8c5=this;this[_0xb95b('0x3e')](_0x52e2af,function(_0x347a67,_0x33267b){if(_0x347a67){_0xe64c11(_0x347a67);}if(_0x5ab8c5['password']===_0x33267b){_0xe64c11(null,!![]);}else{_0xe64c11(null,![]);}});},'makeSalt':function(_0x3b125e,_0x151280){var _0x1f5589=0x10;if(typeof arguments[0x0]===_0xb95b('0x3f')){_0x151280=arguments[0x0];_0x3b125e=_0x1f5589;}else if(typeof arguments[0x1]===_0xb95b('0x3f')){_0x151280=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x3b125e){_0x3b125e=_0x1f5589;}return crypto[_0xb95b('0x40')](_0x3b125e,function(_0xb28aaa,_0x472fde){if(_0xb28aaa){_0x151280(_0xb28aaa);}return _0x151280(null,_0x472fde[_0xb95b('0x41')](_0xb95b('0x42')));});},'encryptPassword':function(_0x4eb198,_0x449c3d){if(!_0x4eb198||!this['salt']){return _0x449c3d?_0x449c3d(null):null;}var _0x85b852=0x2710;var _0x45c7cb=0x40;var _0x125b1c=Buffer['from'](this['salt'],'base64');if(!_0x449c3d){return crypto[_0xb95b('0x43')](_0x4eb198,_0x125b1c,_0x85b852,_0x45c7cb,_0xb95b('0x44'))['toString'](_0xb95b('0x42'));}return crypto[_0xb95b('0x45')](_0x4eb198,_0x125b1c,_0x85b852,_0x45c7cb,_0xb95b('0x44'),function(_0x4c8789,_0x49f6ef){if(_0x4c8789){_0x449c3d(_0x4c8789);}return _0x449c3d(null,_0x49f6ef[_0xb95b('0x41')](_0xb95b('0x42')));});},'updatePassword':function(_0x1990f0){if(!this[_0xb95b('0x14')]){return _0x1990f0(null);}if(!validatePresenceOf(this[_0xb95b('0x14')])&&authTypes[_0xb95b('0x46')](this['provider'])===-0x1){_0x1990f0(new Error(_0xb95b('0x47')));}var _0x5673cd=this;this[_0xb95b('0x48')](function(_0x499f27,_0x7e8918){if(_0x499f27){return _0x1990f0(_0x499f27);}_0x5673cd[_0xb95b('0x49')]=_0x7e8918;_0x5673cd[_0xb95b('0x3e')](_0x5673cd['password'],function(_0x42a242,_0x2510b7){if(_0x42a242){_0x1990f0(_0x42a242);}_0x5673cd[_0xb95b('0x14')]=_0x2510b7;_0x1990f0(null);});});},'updateMd5Password':function(){this[_0xb95b('0x4a')]=md5(this[_0xb95b('0x17')]+':asterisk:'+this['password']);return this[_0xb95b('0x4a')];},'getRealtimeData':function(){var _0x12eace={'id':this['id']};var _0x5ade57=jayson[_0xb95b('0x4b')][_0xb95b('0x4c')]({'port':0x232a});var _0x50e2f2=jayson[_0xb95b('0x4b')]['http']({'port':0x232c});var _0x851d77={};var _0xf8433b={};return _0x5ade57[_0xb95b('0x4d')](_0xb95b('0x4e'),_0x12eace)[_0xb95b('0x26')](function(_0x25f264){if(_0x25f264[_0xb95b('0x4f')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(AMI)');}_0x851d77=_0x25f264[_0xb95b('0x50')];return _0x50e2f2['request'](_0xb95b('0x4e'),_0x12eace);})[_0xb95b('0x26')](function(_0x732046){if(_0x732046[_0xb95b('0x4f')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agent\x20(Routing)');}_0xf8433b=_0x732046[_0xb95b('0x50')];var _0x233bec=_[_0xb95b('0x10')]({},_0x851d77,_0xf8433b);return _0x233bec;})[_0xb95b('0x28')](function(_0x57b946){throw _0x57b946;});},'unpause':function(_0x1861c8,_0x51a43c='manual'){var _0x2f9570=this;var _0x566679={};return Promise['resolve']()[_0xb95b('0x26')](function(){if(!_0x1861c8||_0x1861c8===_0xb95b('0x51')&&_0x51a43c==='manual'){var _0x29c0e6=jayson[_0xb95b('0x4b')][_0xb95b('0x4c')]({'port':0x232a});return _0x29c0e6[_0xb95b('0x4d')](_0xb95b('0x52'),{'id':_0x2f9570['id'],'name':_0x2f9570[_0xb95b('0x17')],'pause':![]})[_0xb95b('0x26')](function(_0x48e51b){if(_0x48e51b[_0xb95b('0x4f')]){throw new Error(util['format']('Unable\x20to\x20unpause\x20agent\x20%s:$s',_0x2f9570['id'],_0x2f9570[_0xb95b('0x17')]));}return _0x48e51b[_0xb95b('0x50')]['message'];});}})[_0xb95b('0x26')](function(){if(!_0x1861c8||_0x1861c8===_0xb95b('0x51')){return _0x15ba62['UserVoiceQueueRt'][_0xb95b('0x53')]({'paused':0x0},{'where':{'UserId':_0x2f9570['id']},'individualHooks':!![]});}})['then'](function(){var _0x549ff1=!_0x1861c8?_0xb95b('0x54'):'findOne';return _0x15ba62[_0xb95b('0x55')][_0x549ff1]({'where':{'channel':_0x1861c8,'membername':_0x2f9570[_0xb95b('0x17')],'type':_0xb95b('0x56'),'exitAt':null}});})[_0xb95b('0x26')](function(_0x483f9){if(_0x483f9){var _0x502b13=Array[_0xb95b('0x57')](_0x483f9)?_0x483f9:[_0x483f9];var _0xd36e37=_0x502b13['map'](function(_0x5b8fe4){return _0x5b8fe4[_0xb95b('0x53')]({'exitAt':moment()[_0xb95b('0x9')](_0xb95b('0x58')),'data2':_0x51a43c});});return Promise['all'](_0xd36e37);}})[_0xb95b('0x26')](function(){if(!_0x1861c8){_0x566679[_0xb95b('0x59')]=![];_0x566679[_0xb95b('0x5a')]=![];_0x566679[_0xb95b('0x5b')]=![];_0x566679[_0xb95b('0x5c')]=![];_0x566679[_0xb95b('0x5d')]=![];_0x566679['whatsappPause']=![];_0x566679[_0xb95b('0x5e')]=![];}else{_0x566679[_0x1861c8+_0xb95b('0x5f')]=![];}return _0x2f9570[_0xb95b('0x60')]();})[_0xb95b('0x26')](function(_0xdc9596){var _0x32a36b=require(_0xb95b('0x61'));var _0x21e058=_0x32a36b['getChannels']();_0x21e058[_0xb95b('0x62')](function(_0x49aecd){var _0x1e280c=_0x49aecd+_0xb95b('0x63');_0x2f9570['setDataValue']([_0x1e280c],_0xdc9596[_0x1e280c]);});return _0x2f9570[_0xb95b('0x53')](_0x566679);})[_0xb95b('0x28')](function(_0x33c591){throw _0x33c591;});}}});};
\ No newline at end of file
index 025f211..c2c2289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0eb=['getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','loginInPause','merge','concat','LOGININPAUSE','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','./user.socket','register','GetUser','User','options','attributes','limit','include','model','map','then','info','debug','stringify','catch','message','error','ShowUser','find','where','PauseUser','name','interface','update','findAll','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','PAUSE','body','DEFAULT\x20PAUSE','role','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','internal','online','voicePause','mailPause','openchannelPause','smsPause','whatsappPause','pauseType','params','unpause','UserVoiceQueueRt','destroy','all','LoginUser','phone','count','agent','../../config/license/util','getLicense','agents'];(function(_0x4efdc0,_0xa2ff3){var _0x5ada0d=function(_0x3b20ce){while(--_0x3b20ce){_0x4efdc0['push'](_0x4efdc0['shift']());}};_0x5ada0d(++_0xa2ff3);}(_0xe0eb,0xb8));var _0xbe0e=function(_0x185fce,_0x4d45cf){_0x185fce=_0x185fce-0x0;var _0x3065d0=_0xe0eb[_0x185fce];return _0x3065d0;};'use strict';var _=require(_0xbe0e('0x0'));var util=require(_0xbe0e('0x1'));var moment=require(_0xbe0e('0x2'));var BPromise=require(_0xbe0e('0x3'));var Redis=require(_0xbe0e('0x4'));var db=require(_0xbe0e('0x5'))['db'];var utils=require(_0xbe0e('0x6'));var logger=require(_0xbe0e('0x7'))(_0xbe0e('0x8'));var config=require(_0xbe0e('0x9'));config[_0xbe0e('0xa')]=_[_0xbe0e('0xb')](config[_0xbe0e('0xa')],{'host':_0xbe0e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe0e('0xa')]));require(_0xbe0e('0xd'))[_0xbe0e('0xe')](socket);exports[_0xbe0e('0xf')]=function(_0x5b55e5){var _0x4a35eb=this;return new Promise(function(_0x46ca17,_0x3bc71d){return db[_0xbe0e('0x10')]['findAll']({'raw':_0x5b55e5[_0xbe0e('0x11')]?_0x5b55e5[_0xbe0e('0x11')]['raw']===undefined?!![]:![]:!![],'where':_0x5b55e5[_0xbe0e('0x11')]?_0x5b55e5[_0xbe0e('0x11')]['where']||null:null,'attributes':_0x5b55e5[_0xbe0e('0x11')]?_0x5b55e5['options'][_0xbe0e('0x12')]||null:null,'limit':_0x5b55e5[_0xbe0e('0x11')]?_0x5b55e5[_0xbe0e('0x11')][_0xbe0e('0x13')]||null:null,'include':_0x5b55e5[_0xbe0e('0x11')]?_0x5b55e5[_0xbe0e('0x11')][_0xbe0e('0x14')]?_['map'](_0x5b55e5['options'][_0xbe0e('0x14')],function(_0x133f25){return{'model':db[_0x133f25[_0xbe0e('0x15')]],'as':_0x133f25['as'],'attributes':_0x133f25[_0xbe0e('0x12')],'include':_0x133f25[_0xbe0e('0x14')]?_[_0xbe0e('0x16')](_0x133f25[_0xbe0e('0x14')],function(_0x5edbfc){return{'model':db[_0x5edbfc[_0xbe0e('0x15')]],'as':_0x5edbfc['as'],'attributes':_0x5edbfc[_0xbe0e('0x12')],'include':_0x5edbfc[_0xbe0e('0x14')]?_[_0xbe0e('0x16')](_0x5edbfc[_0xbe0e('0x14')],function(_0x5a01f5){return{'model':db[_0x5a01f5['model']],'as':_0x5a01f5['as'],'attributes':_0x5a01f5[_0xbe0e('0x12')]};}):[]};}):[]};}):[]:[]})[_0xbe0e('0x17')](function(_0x1ec1f0){logger[_0xbe0e('0x18')](_0xbe0e('0xf'),_0x5b55e5);logger[_0xbe0e('0x19')](_0xbe0e('0xf'),_0x5b55e5,JSON[_0xbe0e('0x1a')](_0x1ec1f0));_0x46ca17(_0x1ec1f0);})[_0xbe0e('0x1b')](function(_0x2860ef){logger['error']('GetUser',_0x2860ef[_0xbe0e('0x1c')],_0x5b55e5);_0x3bc71d(_0x4a35eb[_0xbe0e('0x1d')](0x1f4,_0x2860ef[_0xbe0e('0x1c')]));});});};exports[_0xbe0e('0x1e')]=function(_0x13b710){var _0x42d4d1=this;return new Promise(function(_0xb6c4e8,_0x288b5d){return db[_0xbe0e('0x10')][_0xbe0e('0x1f')]({'raw':_0x13b710['options']?_0x13b710['options']['raw']===undefined?!![]:![]:!![],'where':_0x13b710[_0xbe0e('0x11')]?_0x13b710['options'][_0xbe0e('0x20')]||null:null,'attributes':_0x13b710[_0xbe0e('0x11')]?_0x13b710['options']['attributes']||null:null,'include':_0x13b710[_0xbe0e('0x11')]?_0x13b710[_0xbe0e('0x11')][_0xbe0e('0x14')]?_[_0xbe0e('0x16')](_0x13b710[_0xbe0e('0x11')][_0xbe0e('0x14')],function(_0x4d3396){return{'model':db[_0x4d3396[_0xbe0e('0x15')]],'as':_0x4d3396['as'],'attributes':_0x4d3396[_0xbe0e('0x12')],'include':_0x4d3396['include']?_[_0xbe0e('0x16')](_0x4d3396[_0xbe0e('0x14')],function(_0x4257df){return{'model':db[_0x4257df[_0xbe0e('0x15')]],'as':_0x4257df['as'],'attributes':_0x4257df['attributes'],'include':_0x4257df[_0xbe0e('0x14')]?_[_0xbe0e('0x16')](_0x4257df[_0xbe0e('0x14')],function(_0x36be96){return{'model':db[_0x36be96[_0xbe0e('0x15')]],'as':_0x36be96['as'],'attributes':_0x36be96[_0xbe0e('0x12')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16bcb3){logger['info'](_0xbe0e('0x1e'),_0x13b710);logger[_0xbe0e('0x19')](_0xbe0e('0x1e'),_0x13b710,JSON[_0xbe0e('0x1a')](_0x16bcb3));_0xb6c4e8(_0x16bcb3);})[_0xbe0e('0x1b')](function(_0x308bc1){logger[_0xbe0e('0x1d')](_0xbe0e('0x1e'),_0x308bc1['message'],_0x13b710);_0x288b5d(_0x42d4d1['error'](0x1f4,_0x308bc1[_0xbe0e('0x1c')]));});});};exports[_0xbe0e('0x21')]=function(_0x4e52d8){var _0x28f932=this;return new Promise(function(_0x396715,_0x2fff35){var _0x126a01;return db[_0xbe0e('0x10')][_0xbe0e('0x1f')]({'where':_0x4e52d8[_0xbe0e('0x11')]['where']||{},'attributes':['id',_0xbe0e('0x22'),'role','internal',_0xbe0e('0x23')]})[_0xbe0e('0x17')](function(_0x275257){if(_0x275257){_0x126a01=_0x275257;return db['UserVoiceQueueRt'][_0xbe0e('0x24')]({'paused':0x1},{'where':{'UserId':_0x126a01['id']},'individualHooks':!![]});}})[_0xbe0e('0x17')](function(){if(_0x126a01){return db['MemberReport'][_0xbe0e('0x25')]({'where':{'membername':_0x126a01[_0xbe0e('0x22')],'type':'PAUSE','exitAt':null}});}})[_0xbe0e('0x17')](function(_0x33dd57){if(_0x126a01){if(_0x33dd57&&_0x33dd57['length']){var _0x4fb46a=moment()[_0xbe0e('0x26')](_0xbe0e('0x27'));for(var _0x1e402b=0x0,_0x2feb47=_0x33dd57[_0xbe0e('0x28')];_0x1e402b<_0x2feb47;_0x1e402b++){_0x33dd57[_0x1e402b][_0xbe0e('0x29')]({'exitAt':_0x4fb46a});}}}})[_0xbe0e('0x17')](function(){if(_0x126a01){var _0x1daeec=[];var _0x151a7f=utils[_0xbe0e('0x2a')]();_0x151a7f[_0xbe0e('0x2b')](function(_0x25c978){_0x1daeec[_0xbe0e('0x2c')]({'channel':_0x25c978,'membername':_0x126a01[_0xbe0e('0x22')],'interface':_[_0xbe0e('0x2d')](_0x126a01[_0xbe0e('0x23')])?util[_0xbe0e('0x26')](_0xbe0e('0x2e'),_0x126a01[_0xbe0e('0x22')]):_0x126a01[_0xbe0e('0x23')],'type':_0xbe0e('0x2f'),'enterAt':moment()[_0xbe0e('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x4e52d8[_0xbe0e('0x30')]['type']||_0xbe0e('0x31'),'role':_0x126a01[_0xbe0e('0x32')],'internal':_0x126a01['internal'],'uniqueid':_0x4e52d8[_0xbe0e('0x30')][_0xbe0e('0x33')]||null});});return db[_0xbe0e('0x34')][_0xbe0e('0x35')](_0x1daeec,{'individualHooks':!![]});}})['then'](function(){if(_0x126a01){return _0x126a01[_0xbe0e('0x24')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4e52d8[_0xbe0e('0x30')][_0xbe0e('0x36')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xbe0e('0x26')](_0xbe0e('0x27'))});}})[_0xbe0e('0x17')](function(_0x15f833){_0x396715(_0x15f833);})[_0xbe0e('0x1b')](function(_0x1d86b1){_0x2fff35(_0x28f932['error'](0x1f4,_0x1d86b1[_0xbe0e('0x1c')]));});});};exports[_0xbe0e('0x37')]=function(_0x418f63){var _0x2992a1=this;return new Promise(function(_0x50d70a,_0x58a2f1){if(_0x418f63[_0xbe0e('0x30')][_0xbe0e('0x38')]&&!utils[_0xbe0e('0x39')](_0x418f63[_0xbe0e('0x30')][_0xbe0e('0x38')])){throw new Error(util[_0xbe0e('0x26')](_0xbe0e('0x3a'),_0x418f63['body'][_0xbe0e('0x38')]));}return db[_0xbe0e('0x10')][_0xbe0e('0x3b')]({'where':_0x418f63[_0xbe0e('0x11')][_0xbe0e('0x20')]||{},'attributes':['id',_0xbe0e('0x22'),_0xbe0e('0x32'),_0xbe0e('0x3c'),_0xbe0e('0x23'),_0xbe0e('0x3d'),_0xbe0e('0x3e'),_0xbe0e('0x3f'),'chatPause','faxPause',_0xbe0e('0x40'),_0xbe0e('0x41'),_0xbe0e('0x42'),_0xbe0e('0x43'),'lastPauseAt']})[_0xbe0e('0x17')](function(_0x204c83){if(!_0x204c83){throw new Error(util[_0xbe0e('0x26')]('User\x20with\x20id\x20%s\x20not\x20found',_0x418f63[_0xbe0e('0x44')]['id']));}return _0x204c83[_0xbe0e('0x45')](_0x418f63[_0xbe0e('0x30')]['channel'],'system');})[_0xbe0e('0x17')](function(_0x40b612){_0x50d70a(_0x40b612);})['catch'](function(_0x53c19c){_0x58a2f1(_0x2992a1['error'](0x1f4,_0x53c19c[_0xbe0e('0x1c')]));});});};exports['LogoutUser']=function(_0x22a239){var _0x13c0c2=this;return new Promise(function(_0x59e6a1,_0x4639a3){var _0x4e8816;return db['User'][_0xbe0e('0x3b')]({'where':_0x22a239[_0xbe0e('0x11')][_0xbe0e('0x20')]||{},'attributes':['id',_0xbe0e('0x22')]})[_0xbe0e('0x17')](function(_0x24a141){if(_0x24a141){_0x4e8816=_0x24a141;return db[_0xbe0e('0x46')][_0xbe0e('0x47')]({'where':{'membername':_0x4e8816['name']},'individualHooks':!![]});}})[_0xbe0e('0x17')](function(){if(_0x4e8816){return db[_0xbe0e('0x34')][_0xbe0e('0x25')]({'where':{'membername':_0x4e8816['name'],'exitAt':null}});}})[_0xbe0e('0x17')](function(_0x21d86b){if(_0x4e8816){if(_0x21d86b&&_0x21d86b[_0xbe0e('0x28')]){var _0xf59733=[];_0x21d86b[_0xbe0e('0x2b')](function(_0x2b4fd4){_0xf59733[_0xbe0e('0x2c')](_0x2b4fd4['update']({'exitAt':moment()[_0xbe0e('0x26')](_0xbe0e('0x27'))}));});return BPromise[_0xbe0e('0x48')](_0xf59733);}}})[_0xbe0e('0x17')](function(){if(_0x4e8816){return _0x4e8816[_0xbe0e('0x24')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xbe0e('0x17')](function(_0x3ccd98){_0x59e6a1(_0x3ccd98);})['catch'](function(_0x3cdb8c){_0x4639a3(_0x13c0c2[_0xbe0e('0x1d')](0x1f4,_0x3cdb8c['message']));});});};exports[_0xbe0e('0x49')]=function(_0x5a15f2){var _0xb9e47f=this;return new Promise(function(_0x5c1585,_0x35fc37){var _0x39fcd9;var _0x39d2c5;var _0x5c8a32;var _0x45bf99;return db[_0xbe0e('0x10')][_0xbe0e('0x3b')]({'where':_0x5a15f2[_0xbe0e('0x11')][_0xbe0e('0x20')]||{},'attributes':['id','name',_0xbe0e('0x32'),'mobile',_0xbe0e('0x4a'),'internal','loginInPause',_0xbe0e('0x23')]})['then'](function(_0x467bca){if(_0x467bca){_0x39fcd9=_0x467bca;_0x45bf99=_0x5a15f2[_0xbe0e('0x30')][_0xbe0e('0x23')]?_0x5a15f2[_0xbe0e('0x30')]['interface']:util[_0xbe0e('0x26')](_0xbe0e('0x2e'),_0x39fcd9['name']);return db[_0xbe0e('0x10')][_0xbe0e('0x4b')]({'where':{'role':_0xbe0e('0x4c'),'online':!![],'id':{'$ne':_0x39fcd9['id']}}});}})['then'](function(_0x1d0cee){if(_0x1d0cee){_0x5c8a32=_0x1d0cee;return require(_0xbe0e('0x4d'))[_0xbe0e('0x4e')]();}})[_0xbe0e('0x17')](function(_0x395d91){if(_0x395d91&&_0x395d91[_0xbe0e('0x4f')]&&_0x5c8a32>=_0x395d91[_0xbe0e('0x4f')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xbe0e('0x17')](function(){if(_0x39fcd9){return db[_0xbe0e('0x46')][_0xbe0e('0x47')]({'where':{'membername':_0x39fcd9['name']},'individualHooks':!![]});}})['then'](function(){if(_0x39fcd9){return _0x39fcd9[_0xbe0e('0x50')]({'raw':!![]});}})[_0xbe0e('0x17')](function(_0xc462b6){if(_0x39fcd9){if(_0xc462b6){var _0x3556b5=[];_0x39d2c5=_0xc462b6;if(_0x39d2c5[_0xbe0e('0x28')]){for(var _0x362c3e=0x0;_0x362c3e<_0x39d2c5[_0xbe0e('0x28')];_0x362c3e++){_0x3556b5[_0xbe0e('0x2c')](db[_0xbe0e('0x46')][_0xbe0e('0x51')]({'membername':_0x39fcd9[_0xbe0e('0x22')],'UserId':_0x39fcd9['id'],'queue_name':_0x39d2c5[_0x362c3e][_0xbe0e('0x22')],'VoiceQueueId':_0x39d2c5[_0x362c3e]['id'],'interface':_0x45bf99,'paused':_0x39fcd9['loginInPause']||![],'penalty':_0x39d2c5[_0x362c3e][_0xbe0e('0x52')]||0x0}));}return BPromise[_0xbe0e('0x48')](_0x3556b5);}}}})[_0xbe0e('0x17')](function(){if(_0x39fcd9){return db[_0xbe0e('0x34')][_0xbe0e('0x25')]({'where':{'membername':_0x39fcd9['name'],'exitAt':null}});}})['then'](function(_0x5bdfa8){if(_0x39fcd9){if(_0x5bdfa8&&_0x5bdfa8['length']){var _0x39dc9d=[];_0x5bdfa8[_0xbe0e('0x2b')](function(_0x92de13){_0x39dc9d[_0xbe0e('0x2c')](_0x92de13[_0xbe0e('0x24')]({'exitAt':moment()[_0xbe0e('0x26')](_0xbe0e('0x27'))}));});return BPromise[_0xbe0e('0x48')](_0x39dc9d);}}})['then'](function(){if(_0x39fcd9){var _0x1de561=[];var _0x5b7ee2=[];var _0x329036=utils[_0xbe0e('0x2a')]();var _0x3a45e={'membername':_0x39fcd9[_0xbe0e('0x22')],'interface':_0x45bf99,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x39fcd9[_0xbe0e('0x32')],'internal':_0x39fcd9[_0xbe0e('0x3c')]};_0x329036[_0xbe0e('0x2b')](function(_0x382a00){_0x1de561[_0xbe0e('0x2c')](_['merge']({'channel':_0x382a00,'type':_0xbe0e('0x53'),'data1':'callysquare','data2':_0x45bf99},_0x3a45e));if(_0x39fcd9[_0xbe0e('0x54')]){_0x5b7ee2[_0xbe0e('0x2c')](_[_0xbe0e('0x55')]({'channel':_0x382a00,'type':_0xbe0e('0x2f'),'data1':'LOGININPAUSE'},_0x3a45e));}});return db[_0xbe0e('0x34')][_0xbe0e('0x35')](_0x1de561[_0xbe0e('0x56')](_0x5b7ee2),{'individualHooks':!![]});}})['then'](function(){if(_0x39fcd9){return _0x39fcd9['update']({'online':!![],'lastLoginAt':moment()[_0xbe0e('0x26')](_0xbe0e('0x27')),'voicePause':_0x39fcd9[_0xbe0e('0x54')]||![],'mailPause':_0x39fcd9[_0xbe0e('0x54')]||![],'chatPause':_0x39fcd9[_0xbe0e('0x54')]||![],'faxPause':_0x39fcd9[_0xbe0e('0x54')]||![],'smsPause':_0x39fcd9[_0xbe0e('0x54')]||![],'openchannelPause':_0x39fcd9[_0xbe0e('0x54')]||![],'pauseType':_0x39fcd9[_0xbe0e('0x54')]?_0xbe0e('0x57'):null,'lastPauseAt':moment()[_0xbe0e('0x26')](_0xbe0e('0x27')),'interface':_0x45bf99});}})[_0xbe0e('0x17')](function(_0x5406c6){_0x5c1585(_0x5406c6);})[_0xbe0e('0x1b')](function(_0x2bcd4e){_0x35fc37(_0xb9e47f[_0xbe0e('0x1d')](0x1f4,_0x2bcd4e[_0xbe0e('0x1c')]));});});};
\ No newline at end of file
+var _0xd289=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','GetUser','User','findAll','options','where','attributes','include','map','then','info','debug','stringify','catch','message','error','ShowUser','find','raw','model','PauseUser','name','interface','MemberReport','PAUSE','length','format','updateAttributes','forEach','push','body','type','internal','uniqueid','update','DEFAULT\x20PAUSE','YYYY-MM-DD\x20HH:mm:ss','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','role','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','params','LogoutUser','all','LoginUser','phone','loginInPause','SIP/%s','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','UserVoiceQueueRt','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','LOGIN','callysquare','bulkCreate','concat','LOGININPAUSE','lodash','moment'];(function(_0x37e4a3,_0x5584ae){var _0x5ce226=function(_0x5ab81a){while(--_0x5ab81a){_0x37e4a3['push'](_0x37e4a3['shift']());}};_0x5ce226(++_0x5584ae);}(_0xd289,0xa8));var _0x9d28=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xd289[_0xdefbc3];return _0x367798;};'use strict';var _=require(_0x9d28('0x0'));var util=require('util');var moment=require(_0x9d28('0x1'));var BPromise=require('bluebird');var Redis=require(_0x9d28('0x2'));var db=require(_0x9d28('0x3'))['db'];var utils=require(_0x9d28('0x4'));var logger=require(_0x9d28('0x5'))(_0x9d28('0x6'));var config=require(_0x9d28('0x7'));config[_0x9d28('0x8')]=_[_0x9d28('0x9')](config[_0x9d28('0x8')],{'host':_0x9d28('0xa'),'port':0x18eb});var socket=require(_0x9d28('0xb'))(new Redis(config['redis']));require(_0x9d28('0xc'))['register'](socket);exports[_0x9d28('0xd')]=function(_0x407231){var _0x4bf336=this;return new Promise(function(_0x284fa7,_0xadfa2f){return db[_0x9d28('0xe')][_0x9d28('0xf')]({'raw':_0x407231[_0x9d28('0x10')]?_0x407231[_0x9d28('0x10')]['raw']===undefined?!![]:![]:!![],'where':_0x407231[_0x9d28('0x10')]?_0x407231[_0x9d28('0x10')][_0x9d28('0x11')]||null:null,'attributes':_0x407231[_0x9d28('0x10')]?_0x407231[_0x9d28('0x10')][_0x9d28('0x12')]||null:null,'limit':_0x407231['options']?_0x407231['options']['limit']||null:null,'include':_0x407231[_0x9d28('0x10')]?_0x407231[_0x9d28('0x10')][_0x9d28('0x13')]?_[_0x9d28('0x14')](_0x407231[_0x9d28('0x10')][_0x9d28('0x13')],function(_0x3b1cfc){return{'model':db[_0x3b1cfc['model']],'as':_0x3b1cfc['as'],'attributes':_0x3b1cfc['attributes'],'include':_0x3b1cfc[_0x9d28('0x13')]?_['map'](_0x3b1cfc[_0x9d28('0x13')],function(_0x5dbe5c){return{'model':db[_0x5dbe5c['model']],'as':_0x5dbe5c['as'],'attributes':_0x5dbe5c[_0x9d28('0x12')],'include':_0x5dbe5c[_0x9d28('0x13')]?_[_0x9d28('0x14')](_0x5dbe5c[_0x9d28('0x13')],function(_0xa187bd){return{'model':db[_0xa187bd['model']],'as':_0xa187bd['as'],'attributes':_0xa187bd['attributes']};}):[]};}):[]};}):[]:[]})[_0x9d28('0x15')](function(_0x31650f){logger[_0x9d28('0x16')](_0x9d28('0xd'),_0x407231);logger[_0x9d28('0x17')](_0x9d28('0xd'),_0x407231,JSON[_0x9d28('0x18')](_0x31650f));_0x284fa7(_0x31650f);})[_0x9d28('0x19')](function(_0x99090a){logger['error'](_0x9d28('0xd'),_0x99090a[_0x9d28('0x1a')],_0x407231);_0xadfa2f(_0x4bf336[_0x9d28('0x1b')](0x1f4,_0x99090a[_0x9d28('0x1a')]));});});};exports[_0x9d28('0x1c')]=function(_0x12cbe0){var _0x5226f4=this;return new Promise(function(_0xcc441a,_0x151fa0){return db[_0x9d28('0xe')][_0x9d28('0x1d')]({'raw':_0x12cbe0[_0x9d28('0x10')]?_0x12cbe0['options'][_0x9d28('0x1e')]===undefined?!![]:![]:!![],'where':_0x12cbe0['options']?_0x12cbe0[_0x9d28('0x10')][_0x9d28('0x11')]||null:null,'attributes':_0x12cbe0[_0x9d28('0x10')]?_0x12cbe0[_0x9d28('0x10')][_0x9d28('0x12')]||null:null,'include':_0x12cbe0[_0x9d28('0x10')]?_0x12cbe0[_0x9d28('0x10')][_0x9d28('0x13')]?_[_0x9d28('0x14')](_0x12cbe0[_0x9d28('0x10')][_0x9d28('0x13')],function(_0x304331){return{'model':db[_0x304331[_0x9d28('0x1f')]],'as':_0x304331['as'],'attributes':_0x304331['attributes'],'include':_0x304331['include']?_[_0x9d28('0x14')](_0x304331[_0x9d28('0x13')],function(_0x142207){return{'model':db[_0x142207[_0x9d28('0x1f')]],'as':_0x142207['as'],'attributes':_0x142207[_0x9d28('0x12')],'include':_0x142207[_0x9d28('0x13')]?_['map'](_0x142207[_0x9d28('0x13')],function(_0x3cc172){return{'model':db[_0x3cc172[_0x9d28('0x1f')]],'as':_0x3cc172['as'],'attributes':_0x3cc172[_0x9d28('0x12')]};}):[]};}):[]};}):[]:[]})[_0x9d28('0x15')](function(_0x4c97f8){logger[_0x9d28('0x16')](_0x9d28('0x1c'),_0x12cbe0);logger[_0x9d28('0x17')](_0x9d28('0x1c'),_0x12cbe0,JSON['stringify'](_0x4c97f8));_0xcc441a(_0x4c97f8);})[_0x9d28('0x19')](function(_0x544e83){logger[_0x9d28('0x1b')](_0x9d28('0x1c'),_0x544e83[_0x9d28('0x1a')],_0x12cbe0);_0x151fa0(_0x5226f4['error'](0x1f4,_0x544e83[_0x9d28('0x1a')]));});});};exports[_0x9d28('0x20')]=function(_0xc08da){var _0x223354=this;return new Promise(function(_0x1a7f7a,_0x5d77c0){var _0x23dea4;return db[_0x9d28('0xe')][_0x9d28('0x1d')]({'where':_0xc08da[_0x9d28('0x10')][_0x9d28('0x11')]||{},'attributes':['id',_0x9d28('0x21'),'role','internal',_0x9d28('0x22')]})[_0x9d28('0x15')](function(_0x371f42){if(_0x371f42){_0x23dea4=_0x371f42;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0x23dea4['id']},'individualHooks':!![]});}})[_0x9d28('0x15')](function(){if(_0x23dea4){return db[_0x9d28('0x23')][_0x9d28('0xf')]({'where':{'membername':_0x23dea4['name'],'type':_0x9d28('0x24'),'exitAt':null}});}})['then'](function(_0x438631){if(_0x23dea4){if(_0x438631&&_0x438631[_0x9d28('0x25')]){var _0xaed25a=moment()[_0x9d28('0x26')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x211cd4=0x0,_0x5eb202=_0x438631[_0x9d28('0x25')];_0x211cd4<_0x5eb202;_0x211cd4++){_0x438631[_0x211cd4][_0x9d28('0x27')]({'exitAt':_0xaed25a});}}}})[_0x9d28('0x15')](function(){if(_0x23dea4){var _0x1d5c14=[];var _0x374a46=utils['getChannels']();_0x374a46[_0x9d28('0x28')](function(_0x2cf3e6){_0x1d5c14[_0x9d28('0x29')]({'channel':_0x2cf3e6,'membername':_0x23dea4[_0x9d28('0x21')],'interface':_['isNil'](_0x23dea4[_0x9d28('0x22')])?util[_0x9d28('0x26')]('SIP/%s',_0x23dea4[_0x9d28('0x21')]):_0x23dea4[_0x9d28('0x22')],'type':_0x9d28('0x24'),'enterAt':moment()[_0x9d28('0x26')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xc08da[_0x9d28('0x2a')][_0x9d28('0x2b')]||'DEFAULT\x20PAUSE','role':_0x23dea4['role'],'internal':_0x23dea4[_0x9d28('0x2c')],'uniqueid':_0xc08da[_0x9d28('0x2a')][_0x9d28('0x2d')]||null});});return db[_0x9d28('0x23')]['bulkCreate'](_0x1d5c14,{'individualHooks':!![]});}})[_0x9d28('0x15')](function(){if(_0x23dea4){return _0x23dea4[_0x9d28('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xc08da[_0x9d28('0x2a')][_0x9d28('0x2b')]||_0x9d28('0x2f'),'lastPauseAt':moment()[_0x9d28('0x26')](_0x9d28('0x30'))});}})['then'](function(_0x192db){_0x1a7f7a(_0x192db);})[_0x9d28('0x19')](function(_0x1efe00){_0x5d77c0(_0x223354[_0x9d28('0x1b')](0x1f4,_0x1efe00[_0x9d28('0x1a')]));});});};exports['UnpauseUser']=function(_0x401d7e){var _0x388ce9=this;return new Promise(function(_0x4f8b28,_0x33abd1){if(_0x401d7e['body'][_0x9d28('0x31')]&&!utils[_0x9d28('0x32')](_0x401d7e[_0x9d28('0x2a')]['channel'])){throw new Error(util['format'](_0x9d28('0x33'),_0x401d7e[_0x9d28('0x2a')][_0x9d28('0x31')]));}return db[_0x9d28('0xe')][_0x9d28('0x34')]({'where':_0x401d7e[_0x9d28('0x10')]['where']||{},'attributes':['id',_0x9d28('0x21'),_0x9d28('0x35'),_0x9d28('0x2c'),_0x9d28('0x22'),_0x9d28('0x36'),_0x9d28('0x37'),_0x9d28('0x38'),_0x9d28('0x39'),_0x9d28('0x3a'),_0x9d28('0x3b'),'smsPause',_0x9d28('0x3c'),_0x9d28('0x3d'),_0x9d28('0x3e')]})[_0x9d28('0x15')](function(_0x5b131c){if(!_0x5b131c){throw new Error(util['format'](_0x9d28('0x3f'),_0x401d7e[_0x9d28('0x40')]['id']));}return _0x5b131c['unpause'](_0x401d7e['body'][_0x9d28('0x31')],'system');})[_0x9d28('0x15')](function(_0x3957a2){_0x4f8b28(_0x3957a2);})['catch'](function(_0x1f8256){_0x33abd1(_0x388ce9[_0x9d28('0x1b')](0x1f4,_0x1f8256[_0x9d28('0x1a')]));});});};exports[_0x9d28('0x41')]=function(_0x50c96a){var _0x48c35e=this;return new Promise(function(_0x43e972,_0x449719){var _0x2eb0ef;return db[_0x9d28('0xe')]['findOne']({'where':_0x50c96a['options'][_0x9d28('0x11')]||{},'attributes':['id',_0x9d28('0x21')]})['then'](function(_0x1d8dc6){if(_0x1d8dc6){_0x2eb0ef=_0x1d8dc6;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x2eb0ef[_0x9d28('0x21')]},'individualHooks':!![]});}})['then'](function(){if(_0x2eb0ef){return db['MemberReport'][_0x9d28('0xf')]({'where':{'membername':_0x2eb0ef[_0x9d28('0x21')],'exitAt':null}});}})[_0x9d28('0x15')](function(_0x2f647e){if(_0x2eb0ef){if(_0x2f647e&&_0x2f647e[_0x9d28('0x25')]){var _0x356a32=[];_0x2f647e[_0x9d28('0x28')](function(_0x41fd33){_0x356a32[_0x9d28('0x29')](_0x41fd33[_0x9d28('0x2e')]({'exitAt':moment()[_0x9d28('0x26')](_0x9d28('0x30'))}));});return BPromise[_0x9d28('0x42')](_0x356a32);}}})[_0x9d28('0x15')](function(){if(_0x2eb0ef){return _0x2eb0ef[_0x9d28('0x2e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9d28('0x15')](function(_0x39c29c){_0x43e972(_0x39c29c);})[_0x9d28('0x19')](function(_0x2d57ba){_0x449719(_0x48c35e['error'](0x1f4,_0x2d57ba[_0x9d28('0x1a')]));});});};exports[_0x9d28('0x43')]=function(_0x383f85){var _0x26a355=this;return new Promise(function(_0x20c4ba,_0x3edb2e){var _0x5a9eaf;var _0x573470;var _0x13cf9c;var _0x182eee;return db[_0x9d28('0xe')]['findOne']({'where':_0x383f85[_0x9d28('0x10')][_0x9d28('0x11')]||{},'attributes':['id',_0x9d28('0x21'),_0x9d28('0x35'),'mobile',_0x9d28('0x44'),_0x9d28('0x2c'),_0x9d28('0x45'),_0x9d28('0x22')]})['then'](function(_0xe7dd16){if(_0xe7dd16){_0x5a9eaf=_0xe7dd16;_0x182eee=_0x383f85[_0x9d28('0x2a')][_0x9d28('0x22')]?_0x383f85[_0x9d28('0x2a')]['interface']:util[_0x9d28('0x26')](_0x9d28('0x46'),_0x5a9eaf[_0x9d28('0x21')]);return db[_0x9d28('0xe')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x5a9eaf['id']}}});}})[_0x9d28('0x15')](function(_0x30425c){if(_0x30425c){_0x13cf9c=_0x30425c;return require(_0x9d28('0x47'))['getLicense']();}})['then'](function(_0x1b999b){if(_0x1b999b&&_0x1b999b[_0x9d28('0x48')]&&_0x13cf9c>=_0x1b999b[_0x9d28('0x48')]){throw new Error(_0x9d28('0x49'));}})[_0x9d28('0x15')](function(){if(_0x5a9eaf){return db[_0x9d28('0x4a')]['destroy']({'where':{'membername':_0x5a9eaf[_0x9d28('0x21')]},'individualHooks':!![]});}})[_0x9d28('0x15')](function(){if(_0x5a9eaf){return _0x5a9eaf[_0x9d28('0x4b')]({'raw':!![]});}})['then'](function(_0x29430c){if(_0x5a9eaf){if(_0x29430c){var _0x28fe55=[];_0x573470=_0x29430c;if(_0x573470[_0x9d28('0x25')]){for(var _0x4d8a5e=0x0;_0x4d8a5e<_0x573470[_0x9d28('0x25')];_0x4d8a5e++){_0x28fe55[_0x9d28('0x29')](db[_0x9d28('0x4a')][_0x9d28('0x4c')]({'membername':_0x5a9eaf[_0x9d28('0x21')],'UserId':_0x5a9eaf['id'],'queue_name':_0x573470[_0x4d8a5e][_0x9d28('0x21')],'VoiceQueueId':_0x573470[_0x4d8a5e]['id'],'interface':_0x182eee,'paused':_0x5a9eaf[_0x9d28('0x45')]||![],'penalty':_0x573470[_0x4d8a5e][_0x9d28('0x4d')]||0x0}));}return BPromise[_0x9d28('0x42')](_0x28fe55);}}}})[_0x9d28('0x15')](function(){if(_0x5a9eaf){return db[_0x9d28('0x23')][_0x9d28('0xf')]({'where':{'membername':_0x5a9eaf[_0x9d28('0x21')],'exitAt':null}});}})[_0x9d28('0x15')](function(_0x14b5e7){if(_0x5a9eaf){if(_0x14b5e7&&_0x14b5e7['length']){var _0x184920=[];_0x14b5e7[_0x9d28('0x28')](function(_0x21cd95){_0x184920['push'](_0x21cd95['update']({'exitAt':moment()[_0x9d28('0x26')](_0x9d28('0x30'))}));});return BPromise['all'](_0x184920);}}})[_0x9d28('0x15')](function(){if(_0x5a9eaf){var _0x5c04f9=[];var _0x32592e=[];var _0x560af5=utils[_0x9d28('0x4e')]();var _0x317d95={'membername':_0x5a9eaf['name'],'interface':_0x182eee,'enterAt':moment()[_0x9d28('0x26')](_0x9d28('0x30')),'role':_0x5a9eaf[_0x9d28('0x35')],'internal':_0x5a9eaf['internal']};_0x560af5[_0x9d28('0x28')](function(_0x19fcc7){_0x5c04f9['push'](_[_0x9d28('0x4f')]({'channel':_0x19fcc7,'type':_0x9d28('0x50'),'data1':_0x9d28('0x51'),'data2':_0x182eee},_0x317d95));if(_0x5a9eaf[_0x9d28('0x45')]){_0x32592e[_0x9d28('0x29')](_[_0x9d28('0x4f')]({'channel':_0x19fcc7,'type':_0x9d28('0x24'),'data1':'LOGININPAUSE'},_0x317d95));}});return db[_0x9d28('0x23')][_0x9d28('0x52')](_0x5c04f9[_0x9d28('0x53')](_0x32592e),{'individualHooks':!![]});}})[_0x9d28('0x15')](function(){if(_0x5a9eaf){return _0x5a9eaf['update']({'online':!![],'lastLoginAt':moment()[_0x9d28('0x26')](_0x9d28('0x30')),'voicePause':_0x5a9eaf['loginInPause']||![],'mailPause':_0x5a9eaf[_0x9d28('0x45')]||![],'chatPause':_0x5a9eaf[_0x9d28('0x45')]||![],'faxPause':_0x5a9eaf[_0x9d28('0x45')]||![],'smsPause':_0x5a9eaf['loginInPause']||![],'openchannelPause':_0x5a9eaf[_0x9d28('0x45')]||![],'pauseType':_0x5a9eaf['loginInPause']?_0x9d28('0x54'):null,'lastPauseAt':moment()[_0x9d28('0x26')](_0x9d28('0x30')),'interface':_0x182eee});}})['then'](function(_0x24c088){_0x20c4ba(_0x24c088);})[_0x9d28('0x19')](function(_0x1bf04e){_0x3edb2e(_0x26a355[_0x9d28('0x1b')](0x1f4,_0x1bf04e[_0x9d28('0x1a')]));});});};
\ No newline at end of file
index 5055407..0f26ef8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabec=['remove','update','emit','register','user:','./user.events','save'];(function(_0x2910aa,_0x161cc8){var _0x1a9af8=function(_0x523157){while(--_0x523157){_0x2910aa['push'](_0x2910aa['shift']());}};_0x1a9af8(++_0x161cc8);}(_0xabec,0xe5));var _0xcabe=function(_0x47cfa0,_0x176b87){_0x47cfa0=_0x47cfa0-0x0;var _0x386b1d=_0xabec[_0x47cfa0];return _0x386b1d;};'use strict';var UserEvents=require(_0xcabe('0x0'));var events=[_0xcabe('0x1'),_0xcabe('0x2'),_0xcabe('0x3')];function createListener(_0xf49fe5,_0x53e358){return function(_0x8047c){_0x53e358[_0xcabe('0x4')](_0xf49fe5,_0x8047c);};}function removeListener(_0x4006d1,_0x54dffe){return function(){UserEvents['removeListener'](_0x4006d1,_0x54dffe);};}exports[_0xcabe('0x5')]=function(_0x94e0e9){for(var _0x352e9c=0x0,_0x2a22cb=events['length'];_0x352e9c<_0x2a22cb;_0x352e9c++){var _0x3cc836=events[_0x352e9c];var _0x1550e7=createListener(_0xcabe('0x6')+_0x3cc836,_0x94e0e9);UserEvents['on'](_0x3cc836,_0x1550e7);}};
\ No newline at end of file
+var _0xb9b8=['user:','./user.events','save','remove','emit','register'];(function(_0x2f148c,_0x108789){var _0x1a8a78=function(_0x42d7bf){while(--_0x42d7bf){_0x2f148c['push'](_0x2f148c['shift']());}};_0x1a8a78(++_0x108789);}(_0xb9b8,0xcd));var _0x8b9b=function(_0xccf869,_0x2556a5){_0xccf869=_0xccf869-0x0;var _0x21a9db=_0xb9b8[_0xccf869];return _0x21a9db;};'use strict';var UserEvents=require(_0x8b9b('0x0'));var events=[_0x8b9b('0x1'),_0x8b9b('0x2'),'update'];function createListener(_0x4a7256,_0x4dc2be){return function(_0x447a3b){_0x4dc2be[_0x8b9b('0x3')](_0x4a7256,_0x447a3b);};}function removeListener(_0x153206,_0xd97989){return function(){UserEvents['removeListener'](_0x153206,_0xd97989);};}exports[_0x8b9b('0x4')]=function(_0x17ebce){for(var _0x2df6bf=0x0,_0x5d634c=events['length'];_0x2df6bf<_0x5d634c;_0x2df6bf++){var _0x2abd87=events[_0x2df6bf];var _0xdecfc0=createListener(_0x8b9b('0x5')+_0x2abd87,_0x17ebce);UserEvents['on'](_0x2abd87,_0xdecfc0);}};
\ No newline at end of file
index 6e8ff7f..967b068 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x4d44e3,_0x191d39){var _0x362843=function(_0x4810f7){while(--_0x4810f7){_0x4d44e3['push'](_0x4d44e3['shift']());}};_0x362843(++_0x191d39);}(_0x70e0,0x17b));var _0x070e=function(_0x30c739,_0x3190a8){_0x30c739=_0x30c739-0x0;var _0x4a9462=_0x70e0[_0x30c739];return _0x4a9462;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2acaaf,_0x1df48e){var _0x1cb04c=function(_0x3ebb91){while(--_0x3ebb91){_0x2acaaf['push'](_0x2acaaf['shift']());}};_0x1cb04c(++_0x1df48e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xcb91[_0x1602ef];return _0x5870ee;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index 52d7426..97791e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd25b=['INTEGER','sequelize'];(function(_0x58e247,_0x4145e8){var _0x47d1d6=function(_0x185a7b){while(--_0x185a7b){_0x58e247['push'](_0x58e247['shift']());}};_0x47d1d6(++_0x4145e8);}(_0xd25b,0x7d));var _0xbd25=function(_0x33055c,_0x51252b){_0x33055c=_0x33055c-0x0;var _0x21bc31=_0xd25b[_0x33055c];return _0x21bc31;};'use strict';var Sequelize=require(_0xbd25('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbd25('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x7eea=['sequelize','exports','INTEGER'];(function(_0x1968a4,_0x45308f){var _0x28bff0=function(_0x359b61){while(--_0x359b61){_0x1968a4['push'](_0x1968a4['shift']());}};_0x28bff0(++_0x45308f);}(_0x7eea,0x7e));var _0xa7ee=function(_0x51d379,_0x1fe125){_0x51d379=_0x51d379-0x0;var _0x38afeb=_0x7eea[_0x51d379];return _0x38afeb;};'use strict';var Sequelize=require(_0xa7ee('0x0'));module[_0xa7ee('0x1')]={'penalty':{'type':Sequelize[_0xa7ee('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index dea4f0f..d5b7210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a2e=['UserChatQueue','lodash','../../config/logger','moment','request-promise','../../config/environment','exports','define'];(function(_0x29aeb9,_0x2455e2){var _0x4eaa21=function(_0x1086c0){while(--_0x1086c0){_0x29aeb9['push'](_0x29aeb9['shift']());}};_0x4eaa21(++_0x2455e2);}(_0x8a2e,0x119));var _0xe8a2=function(_0x42c45c,_0x449312){_0x42c45c=_0x42c45c-0x0;var _0x195da6=_0x8a2e[_0x42c45c];return _0x195da6;};'use strict';var _=require(_0xe8a2('0x0'));var util=require('util');var logger=require(_0xe8a2('0x1'))('api');var moment=require(_0xe8a2('0x2'));var BPromise=require('bluebird');var rp=require(_0xe8a2('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe8a2('0x4'));var attributes=require('./userChatQueue.attributes');module[_0xe8a2('0x5')]=function(_0x553c04,_0x38a7fb){return _0x553c04[_0xe8a2('0x6')](_0xe8a2('0x7'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c79=['define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports'];(function(_0x590a38,_0x2bc65c){var _0xf36626=function(_0x551cd1){while(--_0x551cd1){_0x590a38['push'](_0x590a38['shift']());}};_0xf36626(++_0x2bc65c);}(_0x2c79,0x1df));var _0x92c7=function(_0x582de2,_0x5efaee){_0x582de2=_0x582de2-0x0;var _0x1f1b9a=_0x2c79[_0x582de2];return _0x1f1b9a;};'use strict';var _=require(_0x92c7('0x0'));var util=require(_0x92c7('0x1'));var logger=require(_0x92c7('0x2'))(_0x92c7('0x3'));var moment=require(_0x92c7('0x4'));var BPromise=require('bluebird');var rp=require(_0x92c7('0x5'));var fs=require('fs');var path=require(_0x92c7('0x6'));var rimraf=require(_0x92c7('0x7'));var config=require(_0x92c7('0x8'));var attributes=require(_0x92c7('0x9'));module[_0x92c7('0xa')]=function(_0x85a108,_0x148e2a){return _0x85a108[_0x92c7('0xb')](_0x92c7('0xc'),attributes,{'tableName':_0x92c7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c102022..c4cb49d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d4=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x129422,_0x4af03c){var _0x3f7f3a=function(_0x1b1fcd){while(--_0x1b1fcd){_0x129422['push'](_0x129422['shift']());}};_0x3f7f3a(++_0x4af03c);}(_0x81d4,0x1c2));var _0x481d=function(_0x34c736,_0x159995){_0x34c736=_0x34c736-0x0;var _0x42a69f=_0x81d4[_0x34c736];return _0x42a69f;};'use strict';var _=require('lodash');var util=require(_0x481d('0x0'));var moment=require(_0x481d('0x1'));var BPromise=require(_0x481d('0x2'));var rs=require(_0x481d('0x3'));var fs=require('fs');var Redis=require(_0x481d('0x4'));var db=require(_0x481d('0x5'))['db'];var utils=require(_0x481d('0x6'));var logger=require(_0x481d('0x7'))(_0x481d('0x8'));var config=require(_0x481d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x481d('0xa')][_0x481d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a635a,_0x362806,_0x1f9949){return new BPromise(function(_0x26768f,_0x16a23b){return client[_0x481d('0xc')](_0x2a635a,_0x1f9949)[_0x481d('0xd')](function(_0x4e678f){logger[_0x481d('0xe')](_0x481d('0xf'),_0x362806,'request\x20sent');logger[_0x481d('0x10')](_0x481d('0x11'),_0x362806,_0x481d('0x12'),JSON['stringify'](_0x4e678f));if(_0x4e678f[_0x481d('0x13')]){if(_0x4e678f['error']['code']===0x1f4){logger['error'](_0x481d('0xf'),_0x362806,_0x4e678f[_0x481d('0x13')][_0x481d('0x14')]);return _0x16a23b(_0x4e678f[_0x481d('0x13')][_0x481d('0x14')]);}logger[_0x481d('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x362806,_0x4e678f['error'][_0x481d('0x14')]);return _0x26768f(_0x4e678f[_0x481d('0x13')]['message']);}else{logger[_0x481d('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x362806,_0x481d('0x12'));_0x26768f(_0x4e678f[_0x481d('0x15')][_0x481d('0x14')]);}})[_0x481d('0x16')](function(_0x371589){logger[_0x481d('0x13')](_0x481d('0xf'),_0x362806,_0x371589);_0x16a23b(_0x371589);});});}
\ No newline at end of file
+var _0xa711=['client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x169c83,_0xe00242){var _0x3ef8e1=function(_0x307f9c){while(--_0x307f9c){_0x169c83['push'](_0x169c83['shift']());}};_0x3ef8e1(++_0xe00242);}(_0xa711,0x121));var _0x1a71=function(_0x40cff4,_0x335c3f){_0x40cff4=_0x40cff4-0x0;var _0x191a2c=_0xa711[_0x40cff4];return _0x191a2c;};'use strict';var _=require(_0x1a71('0x0'));var util=require(_0x1a71('0x1'));var moment=require(_0x1a71('0x2'));var BPromise=require('bluebird');var rs=require(_0x1a71('0x3'));var fs=require('fs');var Redis=require(_0x1a71('0x4'));var db=require(_0x1a71('0x5'))['db'];var utils=require(_0x1a71('0x6'));var logger=require('../../config/logger')(_0x1a71('0x7'));var config=require(_0x1a71('0x8'));var jayson=require(_0x1a71('0x9'));var client=jayson[_0x1a71('0xa')][_0x1a71('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fd84c,_0x267d53,_0x1f363d){return new BPromise(function(_0x690051,_0x43f1ac){return client[_0x1a71('0xc')](_0x1fd84c,_0x1f363d)[_0x1a71('0xd')](function(_0x23660b){logger[_0x1a71('0xe')](_0x1a71('0xf'),_0x267d53,_0x1a71('0x10'));logger[_0x1a71('0x11')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x267d53,_0x1a71('0x10'),JSON[_0x1a71('0x12')](_0x23660b));if(_0x23660b[_0x1a71('0x13')]){if(_0x23660b[_0x1a71('0x13')]['code']===0x1f4){logger[_0x1a71('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x267d53,_0x23660b['error'][_0x1a71('0x14')]);return _0x43f1ac(_0x23660b[_0x1a71('0x13')][_0x1a71('0x14')]);}logger[_0x1a71('0x13')]('UserChatQueue,\x20%s,\x20%s',_0x267d53,_0x23660b[_0x1a71('0x13')][_0x1a71('0x14')]);return _0x690051(_0x23660b[_0x1a71('0x13')][_0x1a71('0x14')]);}else{logger[_0x1a71('0xe')](_0x1a71('0xf'),_0x267d53,_0x1a71('0x10'));_0x690051(_0x23660b[_0x1a71('0x15')][_0x1a71('0x14')]);}})[_0x1a71('0x16')](function(_0x3ca1a0){logger[_0x1a71('0x13')](_0x1a71('0xf'),_0x267d53,_0x3ca1a0);_0x43f1ac(_0x3ca1a0);});});}
\ No newline at end of file
index 03ce81b..07e8fb7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x4058db,_0xfbcc1c){var _0x1a64dc=function(_0x551539){while(--_0x551539){_0x4058db['push'](_0x4058db['shift']());}};_0x1a64dc(++_0xfbcc1c);}(_0xe706,0xa3));var _0x6e70=function(_0x3530d0,_0x4dfb47){_0x3530d0=_0x3530d0-0x0;var _0x2165c6=_0xe706[_0x3530d0];return _0x2165c6;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x47fbdd,_0x487e75){var _0x39172c=function(_0x32d8e2){while(--_0x32d8e2){_0x47fbdd['push'](_0x47fbdd['shift']());}};_0x39172c(++_0x487e75);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 400a8e7..ef86ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8df5=['INTEGER','sequelize','exports'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x8df5,0x85));var _0x58df=function(_0x23e20e,_0x45f48b){_0x23e20e=_0x23e20e-0x0;var _0x4a11dd=_0x8df5[_0x23e20e];return _0x4a11dd;};'use strict';var Sequelize=require(_0x58df('0x0'));module[_0x58df('0x1')]={'penalty':{'type':Sequelize[_0x58df('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x58df('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe435=['INTEGER','sequelize','exports'];(function(_0x5f26a9,_0xc3bca7){var _0x1ea28b=function(_0x163002){while(--_0x163002){_0x5f26a9['push'](_0x5f26a9['shift']());}};_0x1ea28b(++_0xc3bca7);}(_0xe435,0xf4));var _0x5e43=function(_0x2b4849,_0x2824ba){_0x2b4849=_0x2b4849-0x0;var _0x1426b7=_0xe435[_0x2b4849];return _0x1426b7;};'use strict';var Sequelize=require(_0x5e43('0x0'));module[_0x5e43('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5e43('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 358cebb..f93bf85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0243=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','define','UserFaxQueue','user_has_fax_queues','util'];(function(_0x5279d6,_0x41ac51){var _0x1dbda1=function(_0x5b0fc9){while(--_0x5b0fc9){_0x5279d6['push'](_0x5279d6['shift']());}};_0x1dbda1(++_0x41ac51);}(_0x0243,0x110));var _0x3024=function(_0x5d04ee,_0x2a38ca){_0x5d04ee=_0x5d04ee-0x0;var _0x4a666a=_0x0243[_0x5d04ee];return _0x4a666a;};'use strict';var _=require('lodash');var util=require(_0x3024('0x0'));var logger=require(_0x3024('0x1'))(_0x3024('0x2'));var moment=require(_0x3024('0x3'));var BPromise=require(_0x3024('0x4'));var rp=require(_0x3024('0x5'));var fs=require('fs');var path=require(_0x3024('0x6'));var rimraf=require(_0x3024('0x7'));var config=require(_0x3024('0x8'));var attributes=require(_0x3024('0x9'));module['exports']=function(_0x5383b5,_0x24954c){return _0x5383b5[_0x3024('0xa')](_0x3024('0xb'),attributes,{'tableName':_0x3024('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5cd9=['../../config/environment','UserFaxQueue','user_has_fax_queues','api','moment','path','rimraf'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5cd9,0x8f));var _0x95cd=function(_0x281a36,_0x1b3ab0){_0x281a36=_0x281a36-0x0;var _0x33333c=_0x5cd9[_0x281a36];return _0x33333c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x95cd('0x0'));var moment=require(_0x95cd('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95cd('0x2'));var rimraf=require(_0x95cd('0x3'));var config=require(_0x95cd('0x4'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x3c9cfd,_0x3f53a5){return _0x3c9cfd['define'](_0x95cd('0x5'),attributes,{'tableName':_0x95cd('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 744ade9..f515ff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2023=['request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x6b15e9,_0x20eaa3){var _0x630fd6=function(_0x2b25a4){while(--_0x2b25a4){_0x6b15e9['push'](_0x6b15e9['shift']());}};_0x630fd6(++_0x20eaa3);}(_0x2023,0x79));var _0x3202=function(_0x1c7ff5,_0x4ee6ce){_0x1c7ff5=_0x1c7ff5-0x0;var _0x3f6599=_0x2023[_0x1c7ff5];return _0x3f6599;};'use strict';var _=require(_0x3202('0x0'));var util=require(_0x3202('0x1'));var moment=require('moment');var BPromise=require(_0x3202('0x2'));var rs=require(_0x3202('0x3'));var fs=require('fs');var Redis=require(_0x3202('0x4'));var db=require(_0x3202('0x5'))['db'];var utils=require(_0x3202('0x6'));var logger=require(_0x3202('0x7'))('rpc');var config=require(_0x3202('0x8'));var jayson=require(_0x3202('0x9'));var client=jayson[_0x3202('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x128e9a,_0x5c28e6,_0x17032f){return new BPromise(function(_0x1430b7,_0x313ed3){return client[_0x3202('0xb')](_0x128e9a,_0x17032f)[_0x3202('0xc')](function(_0x9467b4){logger[_0x3202('0xd')](_0x3202('0xe'),_0x5c28e6,'request\x20sent');logger[_0x3202('0xf')](_0x3202('0x10'),_0x5c28e6,_0x3202('0x11'),JSON['stringify'](_0x9467b4));if(_0x9467b4['error']){if(_0x9467b4[_0x3202('0x12')][_0x3202('0x13')]===0x1f4){logger[_0x3202('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x5c28e6,_0x9467b4['error']['message']);return _0x313ed3(_0x9467b4[_0x3202('0x12')]['message']);}logger[_0x3202('0x12')](_0x3202('0xe'),_0x5c28e6,_0x9467b4[_0x3202('0x12')]['message']);return _0x1430b7(_0x9467b4[_0x3202('0x12')][_0x3202('0x14')]);}else{logger[_0x3202('0xd')](_0x3202('0xe'),_0x5c28e6,'request\x20sent');_0x1430b7(_0x9467b4['result'][_0x3202('0x14')]);}})[_0x3202('0x15')](function(_0x3c1613){logger[_0x3202('0x12')](_0x3202('0xe'),_0x5c28e6,_0x3c1613);_0x313ed3(_0x3c1613);});});}
\ No newline at end of file
+var _0x1219=['code','message','info','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','client','http','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ff2e6,_0x45aa46){var _0x596aa8=function(_0x49db0f){while(--_0x49db0f){_0x1ff2e6['push'](_0x1ff2e6['shift']());}};_0x596aa8(++_0x45aa46);}(_0x1219,0x140));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var moment=require('moment');var BPromise=require(_0x9121('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9121('0x3'))['db'];var utils=require(_0x9121('0x4'));var logger=require('../../config/logger')(_0x9121('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9121('0x6')][_0x9121('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49662d,_0x5cfc7c,_0xdf2906){return new BPromise(function(_0x16546f,_0x1acd2c){return client[_0x9121('0x8')](_0x49662d,_0xdf2906)[_0x9121('0x9')](function(_0x4c35b7){logger['info'](_0x9121('0xa'),_0x5cfc7c,_0x9121('0xb'));logger[_0x9121('0xc')](_0x9121('0xd'),_0x5cfc7c,_0x9121('0xb'),JSON[_0x9121('0xe')](_0x4c35b7));if(_0x4c35b7[_0x9121('0xf')]){if(_0x4c35b7[_0x9121('0xf')][_0x9121('0x10')]===0x1f4){logger[_0x9121('0xf')](_0x9121('0xa'),_0x5cfc7c,_0x4c35b7['error']['message']);return _0x1acd2c(_0x4c35b7[_0x9121('0xf')][_0x9121('0x11')]);}logger['error'](_0x9121('0xa'),_0x5cfc7c,_0x4c35b7[_0x9121('0xf')]['message']);return _0x16546f(_0x4c35b7[_0x9121('0xf')][_0x9121('0x11')]);}else{logger[_0x9121('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x5cfc7c,'request\x20sent');_0x16546f(_0x4c35b7[_0x9121('0x13')][_0x9121('0x11')]);}})[_0x9121('0x14')](function(_0x4d489b){logger[_0x9121('0xf')](_0x9121('0xa'),_0x5cfc7c,_0x4d489b);_0x1acd2c(_0x4d489b);});});}
\ No newline at end of file
index 22a0356..88c9c5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0xe4976c,_0x50e724){var _0xb69102=function(_0x41f58e){while(--_0x41f58e){_0xe4976c['push'](_0xe4976c['shift']());}};_0xb69102(++_0x50e724);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4b3444,_0x223723){var _0x333126=function(_0x3b59b1){while(--_0x3b59b1){_0x4b3444['push'](_0x4b3444['shift']());}};_0x333126(++_0x223723);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index ce4e2c4..5d7a252 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4b0=['exports','INTEGER'];(function(_0x2e98d5,_0x1665f4){var _0x3f8ee4=function(_0x216bd8){while(--_0x216bd8){_0x2e98d5['push'](_0x2e98d5['shift']());}};_0x3f8ee4(++_0x1665f4);}(_0xe4b0,0x10e));var _0x0e4b=function(_0x493696,_0x1c1d41){_0x493696=_0x493696-0x0;var _0x3c4e2a=_0xe4b0[_0x493696];return _0x3c4e2a;};'use strict';var Sequelize=require('sequelize');module[_0x0e4b('0x0')]={'penalty':{'type':Sequelize[_0x0e4b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0604=['INTEGER','exports'];(function(_0x25ee76,_0x6535a3){var _0x392a09=function(_0x41a342){while(--_0x41a342){_0x25ee76['push'](_0x25ee76['shift']());}};_0x392a09(++_0x6535a3);}(_0x0604,0x179));var _0x4060=function(_0x20ab7e,_0x3115cd){_0x20ab7e=_0x20ab7e-0x0;var _0x2fe1f9=_0x0604[_0x20ab7e];return _0x2fe1f9;};'use strict';var Sequelize=require('sequelize');module[_0x4060('0x0')]={'penalty':{'type':Sequelize[_0x4060('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 32fb925..2e9448e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949a=['path','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2244a6,_0x52edc8){var _0x3727a1=function(_0x5772be){while(--_0x5772be){_0x2244a6['push'](_0x2244a6['shift']());}};_0x3727a1(++_0x52edc8);}(_0x949a,0xaf));var _0xa949=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x949a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa949('0x0'));var util=require(_0xa949('0x1'));var logger=require(_0xa949('0x2'))(_0xa949('0x3'));var moment=require(_0xa949('0x4'));var BPromise=require(_0xa949('0x5'));var rp=require(_0xa949('0x6'));var fs=require('fs');var path=require(_0xa949('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa949('0x8'));module[_0xa949('0x9')]=function(_0x4a8af3,_0x1a0f58){return _0x4a8af3[_0xa949('0xa')](_0xa949('0xb'),attributes,{'tableName':_0xa949('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x414d=['path','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ee87a,_0x4f80ef){var _0x502dea=function(_0xf24d7a){while(--_0xf24d7a){_0x2ee87a['push'](_0x2ee87a['shift']());}};_0x502dea(++_0x4f80ef);}(_0x414d,0x95));var _0xd414=function(_0x2f0274,_0x2dd966){_0x2f0274=_0x2f0274-0x0;var _0x188cca=_0x414d[_0x2f0274];return _0x188cca;};'use strict';var _=require(_0xd414('0x0'));var util=require(_0xd414('0x1'));var logger=require(_0xd414('0x2'))(_0xd414('0x3'));var moment=require(_0xd414('0x4'));var BPromise=require(_0xd414('0x5'));var rp=require(_0xd414('0x6'));var fs=require('fs');var path=require(_0xd414('0x7'));var rimraf=require('rimraf');var config=require(_0xd414('0x8'));var attributes=require(_0xd414('0x9'));module[_0xd414('0xa')]=function(_0x202246,_0x4c8de5){return _0x202246[_0xd414('0xb')](_0xd414('0xc'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a69702c..fb3d959 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x1cb9,0x14e));var _0x91cb=function(_0x55d5d8,_0x274a74){_0x55d5d8=_0x55d5d8-0x0;var _0x47af0f=_0x1cb9[_0x55d5d8];return _0x47af0f;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('UserMailQueue,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x5280a4,_0x31a82b){var _0x60dd06=function(_0x2633c1){while(--_0x2633c1){_0x5280a4['push'](_0x5280a4['shift']());}};_0x60dd06(++_0x31a82b);}(_0x00bb,0x1d8));var _0xb00b=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x00bb[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});}
\ No newline at end of file
index f0c29c5..ec4067a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48c4=['fs-extra','../../components/auth/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','express','Router'];(function(_0x3a38e1,_0x216e3f){var _0x1f8950=function(_0x5c7665){while(--_0x5c7665){_0x3a38e1['push'](_0x3a38e1['shift']());}};_0x1f8950(++_0x216e3f);}(_0x48c4,0x97));var _0x448c=function(_0x2d95e5,_0x5438d8){_0x2d95e5=_0x2d95e5-0x0;var _0x956e3c=_0x48c4[_0x2d95e5];return _0x956e3c;};'use strict';var multer=require(_0x448c('0x0'));var util=require(_0x448c('0x1'));var path=require(_0x448c('0x2'));var timeout=require('connect-timeout');var express=require(_0x448c('0x3'));var router=express[_0x448c('0x4')]();var fs_extra=require(_0x448c('0x5'));var auth=require(_0x448c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x448c('0x7'));var controller=require(_0x448c('0x8'));router[_0x448c('0x9')]('/',auth[_0x448c('0xa')](),controller[_0x448c('0xb')]);module[_0x448c('0xc')]=router;
\ No newline at end of file
+var _0xaaef=['Router','fs-extra','../../config/environment','isAuthenticated','sendUserNotification','exports','util','path','connect-timeout'];(function(_0x4334af,_0x21e066){var _0xec5be0=function(_0x1ee788){while(--_0x1ee788){_0x4334af['push'](_0x4334af['shift']());}};_0xec5be0(++_0x21e066);}(_0xaaef,0xf0));var _0xfaae=function(_0x4a1e07,_0x572c45){_0x4a1e07=_0x4a1e07-0x0;var _0x42ce0f=_0xaaef[_0x4a1e07];return _0x42ce0f;};'use strict';var multer=require('multer');var util=require(_0xfaae('0x0'));var path=require(_0xfaae('0x1'));var timeout=require(_0xfaae('0x2'));var express=require('express');var router=express[_0xfaae('0x3')]();var fs_extra=require(_0xfaae('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfaae('0x5'));var controller=require('./userNotification.controller');router['post']('/',auth[_0xfaae('0x6')](),controller[_0xfaae('0x7')]);module[_0xfaae('0x8')]=router;
\ No newline at end of file
index fa937ed..dcc99ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9222=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x9222,0xe9));var _0x2922=function(_0x2cc473,_0x1190ea){_0x2cc473=_0x2cc473-0x0;var _0x450287=_0x9222[_0x2cc473];return _0x450287;};'use strict';var Sequelize=require(_0x2922('0x0'));module[_0x2922('0x1')]={'body':{'type':Sequelize[_0x2922('0x2')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x2922('0x2')]},'recipientsDescription':{'type':Sequelize[_0x2922('0x3')]},'beep':{'type':Sequelize[_0x2922('0x4')]}};
\ No newline at end of file
+var _0xaa5f=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x27e098,_0x36e1f9){var _0x284fb1=function(_0x5e5be2){while(--_0x5e5be2){_0x27e098['push'](_0x27e098['shift']());}};_0x284fb1(++_0x36e1f9);}(_0xaa5f,0x165));var _0xfaa5=function(_0x3209d2,_0x18673a){_0x3209d2=_0x3209d2-0x0;var _0x1a6788=_0xaa5f[_0x3209d2];return _0x1a6788;};'use strict';var Sequelize=require(_0xfaa5('0x0'));module[_0xfaa5('0x1')]={'body':{'type':Sequelize[_0xfaa5('0x2')]},'senderName':{'type':Sequelize[_0xfaa5('0x3')]},'recipientsId':{'type':Sequelize[_0xfaa5('0x2')]},'recipientsDescription':{'type':Sequelize[_0xfaa5('0x3')]},'beep':{'type':Sequelize[_0xfaa5('0x4')]}};
\ No newline at end of file
index e2f4d42..b390f48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb71d=['chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','whatsappqueue','team','user','some','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','UserNotification','create','forEach','emit','userNotification:send','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','catch','startCase','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./userNotification.socket','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','then','end','sendStatus','error','name','send','sendUserNotification','body','hasOwnProperty','text','ValidationError','TemplateId','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb71d,0xf5));var _0xdb71=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb71d[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0xdb71('0x0'));var rimraf=require(_0xdb71('0x1'));var zipdir=require(_0xdb71('0x2'));var jsonpatch=require(_0xdb71('0x3'));var rp=require(_0xdb71('0x4'));var moment=require(_0xdb71('0x5'));var BPromise=require(_0xdb71('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdb71('0x7'));var sox=require(_0xdb71('0x8'));var csv=require(_0xdb71('0x9'));var ejs=require(_0xdb71('0xa'));var fs=require('fs');var fs_extra=require(_0xdb71('0xb'));var _=require(_0xdb71('0xc'));var squel=require(_0xdb71('0xd'));var crypto=require(_0xdb71('0xe'));var jsforce=require(_0xdb71('0xf'));var deskjs=require(_0xdb71('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdb71('0x11'));var authService=require(_0xdb71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdb71('0x13'));var hardwareService=require(_0xdb71('0x14'));var logger=require(_0xdb71('0x15'))(_0xdb71('0x16'));var utils=require('../../config/utils');var config=require(_0xdb71('0x17'));var licenseUtil=require(_0xdb71('0x18'));var db=require(_0xdb71('0x19'))['db'];config[_0xdb71('0x1a')]=_['defaults'](config[_0xdb71('0x1a')],{'host':_0xdb71('0x1b'),'port':0x18eb});var socket=require(_0xdb71('0x1c'))(new Redis(config[_0xdb71('0x1a')]));require(_0xdb71('0x1d'))['register'](socket);function respondWithStatusCode(_0x1fff42,_0x30adc5){_0x30adc5=_0x30adc5||0xcc;return function(_0x20e6c5){if(_0x20e6c5){return _0x1fff42['sendStatus'](_0x30adc5);}return _0x1fff42[_0xdb71('0x1e')](_0x30adc5)['end']();};}function respondWithResult(_0x4f01d2,_0xccbea0){_0xccbea0=_0xccbea0||0xc8;return function(_0x409809){if(_0x409809){return _0x4f01d2[_0xdb71('0x1e')](_0xccbea0)[_0xdb71('0x1f')](_0x409809);}};}function respondWithFilteredResult(_0x55a9ce,_0x3d634e){return function(_0x130918){if(_0x130918){var _0x46cbb1=typeof _0x3d634e['offset']===_0xdb71('0x20')&&typeof _0x3d634e[_0xdb71('0x21')]==='undefined';var _0x16b0f8=_0x130918[_0xdb71('0x22')];var _0x106cba=_0x46cbb1?0x0:_0x3d634e['offset'];var _0x22d438=_0x46cbb1?_0x130918[_0xdb71('0x22')]:_0x3d634e['offset']+_0x3d634e['limit'];var _0x33e6c2;if(_0x22d438>=_0x16b0f8){_0x22d438=_0x16b0f8;_0x33e6c2=0xc8;}else{_0x33e6c2=0xce;}_0x55a9ce['status'](_0x33e6c2);return _0x55a9ce[_0xdb71('0x23')](_0xdb71('0x24'),_0x106cba+'-'+_0x22d438+'/'+_0x16b0f8)[_0xdb71('0x1f')](_0x130918);}return null;};}function patchUpdates(_0x3d92e4){return function(_0x7b7745){try{jsonpatch[_0xdb71('0x25')](_0x7b7745,_0x3d92e4,!![]);}catch(_0x2a53da){return BPromise[_0xdb71('0x26')](_0x2a53da);}return _0x7b7745[_0xdb71('0x27')]();};}function saveUpdates(_0x124ab2,_0x318dd9){return function(_0xb7edaf){if(_0xb7edaf){return _0xb7edaf['update'](_0x124ab2)[_0xdb71('0x28')](function(_0x11086d){return _0x11086d;});}return null;};}function removeEntity(_0x3f69fa,_0x4d73db){return function(_0x16ff27){if(_0x16ff27){return _0x16ff27['destroy']()[_0xdb71('0x28')](function(){_0x3f69fa['status'](0xcc)[_0xdb71('0x29')]();});}};}function handleEntityNotFound(_0x4b998d,_0x4dc987){return function(_0x57bfc8){if(!_0x57bfc8){_0x4b998d[_0xdb71('0x2a')](0x194);}return _0x57bfc8;};}function handleError(_0x30419a,_0x2db2c5){_0x2db2c5=_0x2db2c5||0x1f4;return function(_0x5c89ec){logger[_0xdb71('0x2b')](_0x5c89ec['stack']);if(_0x5c89ec[_0xdb71('0x2c')]){delete _0x5c89ec['name'];}_0x30419a[_0xdb71('0x1e')](_0x2db2c5)[_0xdb71('0x2d')](_0x5c89ec);};}exports[_0xdb71('0x2e')]=function(_0x52329b,_0x16ab65,_0x34e087){if(!_0x52329b[_0xdb71('0x2f')][_0xdb71('0x30')](_0xdb71('0x31'))&&!_0x52329b[_0xdb71('0x2f')][_0xdb71('0x30')]('TemplateId')){throw new db['Sequelize'][(_0xdb71('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x52329b[_0xdb71('0x2f')][_0xdb71('0x30')](_0xdb71('0x33'))&&!_0x52329b[_0xdb71('0x2f')][_0xdb71('0x30')](_0xdb71('0x34'))){throw new db[(_0xdb71('0x35'))][(_0xdb71('0x32'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x52329b[_0xdb71('0x2f')][_0xdb71('0x30')](_0xdb71('0x36'))){throw new db[(_0xdb71('0x35'))][(_0xdb71('0x32'))](_0xdb71('0x37'));}else{try{var _0x2c2ba4=JSON[_0xdb71('0x38')](_0x52329b[_0xdb71('0x2f')][_0xdb71('0x36')]);}catch(_0x36c190){logger['error'](_0x36c190);throw new db[(_0xdb71('0x35'))]['ValidationError'](_0xdb71('0x39'));}var _0x310678=[_0xdb71('0x3a'),_0xdb71('0x3b'),_0xdb71('0x3c'),_0xdb71('0x3d'),_0xdb71('0x3e'),'voicequeue',_0xdb71('0x3f'),_0xdb71('0x40'),_0xdb71('0x41')];if(_[_0xdb71('0x42')](_0x2c2ba4,function(_0x497bf1){return!_['includes'](_0x310678,_0x497bf1[_0xdb71('0x43')]['toLowerCase']());})){throw new db['Sequelize'][(_0xdb71('0x32'))](_0xdb71('0x44'));}}}var _0x1f3611={};_0x1f3611[_0xdb71('0x45')]=_0x52329b[_0xdb71('0x2f')]['hasOwnProperty'](_0xdb71('0x45'))?_0x52329b[_0xdb71('0x2f')][_0xdb71('0x45')]:_0x52329b[_0xdb71('0x41')][_0xdb71('0x46')];_0x1f3611[_0xdb71('0x47')]=_[_0xdb71('0x48')](_0x52329b[_0xdb71('0x2f')][_0xdb71('0x47')])?null:_0x52329b['body'][_0xdb71('0x47')];_0x1f3611['beep']=_0x52329b[_0xdb71('0x2f')][_0xdb71('0x49')]||![];_0x1f3611[_0xdb71('0x4a')]=_0x52329b[_0xdb71('0x41')]['id'];return getContent(_0x52329b[_0xdb71('0x2f')])[_0xdb71('0x28')](function(_0x51e295){_0x1f3611[_0xdb71('0x2f')]=_0x51e295;return getRecipients(_0x2c2ba4);})[_0xdb71('0x28')](function(_0x4fa55c){_0x1f3611[_0xdb71('0x4b')]=_['sortBy'](_0x4fa55c)[_0xdb71('0x4c')](',');return db[_0xdb71('0x4d')][_0xdb71('0x4e')](function(_0x5d66ac){return db[_0xdb71('0x4f')][_0xdb71('0x50')](_0x1f3611,{'raw':!![],'transaction':_0x5d66ac})['then'](function(_0xbadfd3){var _0x3f956e={'sender':_0x1f3611[_0xdb71('0x45')],'description':_0x1f3611[_0xdb71('0x47')],'content':_0x1f3611['body'],'beep':_0x1f3611[_0xdb71('0x49')]};_0x4fa55c[_0xdb71('0x51')](function(_0x4f8614){_0x3f956e['recipient']=_0x4f8614;socket[_0xdb71('0x52')](_0xdb71('0x53'),_0x3f956e);});return _0xbadfd3;});});})[_0xdb71('0x28')](respondWithResult(_0x16ab65,0xc9))['catch'](handleError(_0x16ab65,null));};function getContent(_0x59dc3b){return new BPromise(function(_0x37719f,_0x485128){if(_0x59dc3b[_0xdb71('0x31')]){_0x37719f(_0x59dc3b[_0xdb71('0x31')]);return;}return db['Template'][_0xdb71('0x54')]({'attributes':[_0xdb71('0x55')],'where':{'id':_0x59dc3b[_0xdb71('0x33')]},'raw':!![]})[_0xdb71('0x28')](function(_0xcb8c5b){if(!_0xcb8c5b)throw new db[(_0xdb71('0x35'))][(_0xdb71('0x32'))](_0xdb71('0x56'));var _0x8c9d38=Mustache[_0xdb71('0x57')](_0xcb8c5b[_0xdb71('0x55')],_0x59dc3b[_0xdb71('0x34')]);_0x37719f(_0x8c9d38);})[_0xdb71('0x58')](function(_0x2dd8b2){_0x485128(_0x2dd8b2);});});}function getRecipients(_0xc4eedc){return new BPromise(function(_0x37e9ea,_0x4ef533){var _0x5b72bd=[];var _0x520ce7=[];_0xc4eedc[_0xdb71('0x51')](function(_0x1f912d){var _0x5e9966=_[_0xdb71('0x59')](_0x1f912d[_0xdb71('0x43')]['toLowerCase']());if(_0x5e9966===_0xdb71('0x5a')){_0x5b72bd=_[_0xdb71('0x5b')](_0x5b72bd,_0x1f912d[_0xdb71('0x5c')]);}else{if(_['includes'](_0x5e9966,_0xdb71('0x5d')))_0x5e9966=_0x5e9966[_0xdb71('0x5e')](_0xdb71('0x5d'),_0xdb71('0x5f'));_0x1f912d[_0xdb71('0x5c')][_0xdb71('0x51')](function(_0x4f4891){_0x520ce7[_0xdb71('0x60')](getAgents(_0x5e9966,_0x4f4891));});}});return BPromise[_0xdb71('0x61')](_0x520ce7)[_0xdb71('0x28')](function(_0xcaddbb){_0x5b72bd=_[_0xdb71('0x5b')](_0x5b72bd,_[_0xdb71('0x62')](_0xcaddbb));_0x37e9ea(_0x5b72bd);})[_0xdb71('0x58')](function(_0x1430f3){_0x4ef533(_0x1430f3);});});}function getAgents(_0xcf72ac,_0x516e0f){return new BPromise(function(_0x2d5fe8,_0x2cf3b9){return db[_0xcf72ac][_0xdb71('0x54')]({'where':{'id':_0x516e0f}})[_0xdb71('0x28')](function(_0x4b5245){return _0x4b5245[_0xdb71('0x63')]({'attributes':['id'],'raw':!![]})[_0xdb71('0x28')](function(_0x51f221){var _0x12068b=_[_0xdb71('0x64')](_0x51f221,'id');_0x2d5fe8(_0x12068b);});})['catch'](function(_0xd88db2){_0x2cf3b9(_0xd88db2);});});}
\ No newline at end of file
+var _0xfb37=['ids','queue','replace','push','flatten','getAgents','map','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./userNotification.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','sendUserNotification','body','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','user','sortBy','transaction','UserNotification','create','userNotification:send','text','Template','findOne','render','html','catch','toLowerCase','User','union'];(function(_0x37a8de,_0x47c249){var _0x46d837=function(_0x583dd9){while(--_0x583dd9){_0x37a8de['push'](_0x37a8de['shift']());}};_0x46d837(++_0x47c249);}(_0xfb37,0xc9));var _0x7fb3=function(_0x1e393b,_0x355f6b){_0x1e393b=_0x1e393b-0x0;var _0x3d0bfe=_0xfb37[_0x1e393b];return _0x3d0bfe;};'use strict';var emlformat=require(_0x7fb3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7fb3('0x1'));var rp=require(_0x7fb3('0x2'));var moment=require(_0x7fb3('0x3'));var BPromise=require(_0x7fb3('0x4'));var Mustache=require(_0x7fb3('0x5'));var util=require(_0x7fb3('0x6'));var path=require('path');var sox=require(_0x7fb3('0x7'));var csv=require(_0x7fb3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7fb3('0x9'));var _=require(_0x7fb3('0xa'));var squel=require(_0x7fb3('0xb'));var crypto=require('crypto');var jsforce=require(_0x7fb3('0xc'));var deskjs=require(_0x7fb3('0xd'));var toCsv=require(_0x7fb3('0x8'));var querystring=require('querystring');var Papa=require(_0x7fb3('0xe'));var Redis=require(_0x7fb3('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7fb3('0x10'));var as=require(_0x7fb3('0x11'));var hardwareService=require(_0x7fb3('0x12'));var logger=require(_0x7fb3('0x13'))(_0x7fb3('0x14'));var utils=require(_0x7fb3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7fb3('0x16'));var db=require(_0x7fb3('0x17'))['db'];config['redis']=_[_0x7fb3('0x18')](config[_0x7fb3('0x19')],{'host':_0x7fb3('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7fb3('0x19')]));require(_0x7fb3('0x1b'))[_0x7fb3('0x1c')](socket);function respondWithStatusCode(_0x1c4e12,_0x38be64){_0x38be64=_0x38be64||0xcc;return function(_0x3737de){if(_0x3737de){return _0x1c4e12[_0x7fb3('0x1d')](_0x38be64);}return _0x1c4e12[_0x7fb3('0x1e')](_0x38be64)['end']();};}function respondWithResult(_0x3373e3,_0x1cd97e){_0x1cd97e=_0x1cd97e||0xc8;return function(_0x2af9ec){if(_0x2af9ec){return _0x3373e3[_0x7fb3('0x1e')](_0x1cd97e)['json'](_0x2af9ec);}};}function respondWithFilteredResult(_0x3550a5,_0x2dc240){return function(_0x5e8d62){if(_0x5e8d62){var _0x4dcfe0=typeof _0x2dc240[_0x7fb3('0x1f')]===_0x7fb3('0x20')&&typeof _0x2dc240[_0x7fb3('0x21')]===_0x7fb3('0x20');var _0x552163=_0x5e8d62['count'];var _0x3f786e=_0x4dcfe0?0x0:_0x2dc240[_0x7fb3('0x1f')];var _0x13bd99=_0x4dcfe0?_0x5e8d62[_0x7fb3('0x22')]:_0x2dc240[_0x7fb3('0x1f')]+_0x2dc240[_0x7fb3('0x21')];var _0xcfa381;if(_0x13bd99>=_0x552163){_0x13bd99=_0x552163;_0xcfa381=0xc8;}else{_0xcfa381=0xce;}_0x3550a5[_0x7fb3('0x1e')](_0xcfa381);return _0x3550a5[_0x7fb3('0x23')](_0x7fb3('0x24'),_0x3f786e+'-'+_0x13bd99+'/'+_0x552163)['json'](_0x5e8d62);}return null;};}function patchUpdates(_0x44f63c){return function(_0x33b453){try{jsonpatch[_0x7fb3('0x25')](_0x33b453,_0x44f63c,!![]);}catch(_0x6e8be9){return BPromise[_0x7fb3('0x26')](_0x6e8be9);}return _0x33b453[_0x7fb3('0x27')]();};}function saveUpdates(_0x389f6c,_0x7f6dc2){return function(_0x4961c0){if(_0x4961c0){return _0x4961c0[_0x7fb3('0x28')](_0x389f6c)[_0x7fb3('0x29')](function(_0x2d3945){return _0x2d3945;});}return null;};}function removeEntity(_0x1b4422,_0x57152f){return function(_0x31f0f4){if(_0x31f0f4){return _0x31f0f4[_0x7fb3('0x2a')]()['then'](function(){_0x1b4422['status'](0xcc)[_0x7fb3('0x2b')]();});}};}function handleEntityNotFound(_0x212b04,_0x2007bb){return function(_0x1a72ce){if(!_0x1a72ce){_0x212b04[_0x7fb3('0x1d')](0x194);}return _0x1a72ce;};}function handleError(_0x5a943b,_0x447849){_0x447849=_0x447849||0x1f4;return function(_0x23e3ab){logger[_0x7fb3('0x2c')](_0x23e3ab['stack']);if(_0x23e3ab['name']){delete _0x23e3ab[_0x7fb3('0x2d')];}_0x5a943b[_0x7fb3('0x1e')](_0x447849)[_0x7fb3('0x2e')](_0x23e3ab);};}exports[_0x7fb3('0x2f')]=function(_0x1df307,_0x159ca6,_0x1311d0){if(!_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x31')]('text')&&!_0x1df307[_0x7fb3('0x30')]['hasOwnProperty'](_0x7fb3('0x32'))){throw new db['Sequelize'][(_0x7fb3('0x33'))](_0x7fb3('0x34'));}else{if(_0x1df307['body'][_0x7fb3('0x31')](_0x7fb3('0x32'))&&!_0x1df307[_0x7fb3('0x30')]['hasOwnProperty'](_0x7fb3('0x35'))){throw new db[(_0x7fb3('0x36'))]['ValidationError'](_0x7fb3('0x37'));}if(!_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x31')](_0x7fb3('0x38'))){throw new db['Sequelize'][(_0x7fb3('0x33'))](_0x7fb3('0x39'));}else{try{var _0x5589ac=JSON['parse'](_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x38')]);}catch(_0x430b12){logger[_0x7fb3('0x2c')](_0x430b12);throw new db[(_0x7fb3('0x36'))][(_0x7fb3('0x33'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x15cf2a=[_0x7fb3('0x3a'),'faxqueue',_0x7fb3('0x3b'),_0x7fb3('0x3c'),_0x7fb3('0x3d'),_0x7fb3('0x3e'),_0x7fb3('0x3f'),_0x7fb3('0x40'),'user'];if(_[_0x7fb3('0x41')](_0x5589ac,function(_0x46552b){return!_[_0x7fb3('0x42')](_0x15cf2a,_0x46552b[_0x7fb3('0x43')]['toLowerCase']());})){throw new db['Sequelize'][(_0x7fb3('0x33'))](_0x7fb3('0x44'));}}}var _0x21ab7b={};_0x21ab7b[_0x7fb3('0x45')]=_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x31')]('senderName')?_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x45')]:_0x1df307['user'][_0x7fb3('0x46')];_0x21ab7b[_0x7fb3('0x47')]=_[_0x7fb3('0x48')](_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x47')])?null:_0x1df307['body'][_0x7fb3('0x47')];_0x21ab7b[_0x7fb3('0x49')]=_0x1df307[_0x7fb3('0x30')][_0x7fb3('0x49')]||![];_0x21ab7b[_0x7fb3('0x4a')]=_0x1df307[_0x7fb3('0x4b')]['id'];return getContent(_0x1df307[_0x7fb3('0x30')])['then'](function(_0x2f137c){_0x21ab7b[_0x7fb3('0x30')]=_0x2f137c;return getRecipients(_0x5589ac);})[_0x7fb3('0x29')](function(_0x19c5b0){_0x21ab7b['recipientsId']=_[_0x7fb3('0x4c')](_0x19c5b0)['join'](',');return db['sequelize'][_0x7fb3('0x4d')](function(_0x538a4e){return db[_0x7fb3('0x4e')][_0x7fb3('0x4f')](_0x21ab7b,{'raw':!![],'transaction':_0x538a4e})[_0x7fb3('0x29')](function(_0x247f0d){var _0x237b72={'sender':_0x21ab7b['senderName'],'description':_0x21ab7b[_0x7fb3('0x47')],'content':_0x21ab7b[_0x7fb3('0x30')],'beep':_0x21ab7b[_0x7fb3('0x49')]};_0x19c5b0['forEach'](function(_0x1ed9e8){_0x237b72['recipient']=_0x1ed9e8;socket['emit'](_0x7fb3('0x50'),_0x237b72);});return _0x247f0d;});});})[_0x7fb3('0x29')](respondWithResult(_0x159ca6,0xc9))['catch'](handleError(_0x159ca6,null));};function getContent(_0x2ebd05){return new BPromise(function(_0x3546b9,_0x1abfd3){if(_0x2ebd05['text']){_0x3546b9(_0x2ebd05[_0x7fb3('0x51')]);return;}return db[_0x7fb3('0x52')][_0x7fb3('0x53')]({'attributes':['html'],'where':{'id':_0x2ebd05[_0x7fb3('0x32')]},'raw':!![]})[_0x7fb3('0x29')](function(_0x1e0766){if(!_0x1e0766)throw new db[(_0x7fb3('0x36'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2fb640=Mustache[_0x7fb3('0x54')](_0x1e0766[_0x7fb3('0x55')],_0x2ebd05['view']);_0x3546b9(_0x2fb640);})[_0x7fb3('0x56')](function(_0x54ab8f){_0x1abfd3(_0x54ab8f);});});}function getRecipients(_0x1b957b){return new BPromise(function(_0x16a53b,_0x2e28b8){var _0x19935e=[];var _0x5c7a06=[];_0x1b957b['forEach'](function(_0x900273){var _0x8c7e3f=_['startCase'](_0x900273[_0x7fb3('0x43')][_0x7fb3('0x57')]());if(_0x8c7e3f===_0x7fb3('0x58')){_0x19935e=_[_0x7fb3('0x59')](_0x19935e,_0x900273[_0x7fb3('0x5a')]);}else{if(_[_0x7fb3('0x42')](_0x8c7e3f,_0x7fb3('0x5b')))_0x8c7e3f=_0x8c7e3f[_0x7fb3('0x5c')](_0x7fb3('0x5b'),'Queue');_0x900273[_0x7fb3('0x5a')]['forEach'](function(_0x2433c2){_0x5c7a06[_0x7fb3('0x5d')](getAgents(_0x8c7e3f,_0x2433c2));});}});return BPromise['all'](_0x5c7a06)[_0x7fb3('0x29')](function(_0x2162f3){_0x19935e=_[_0x7fb3('0x59')](_0x19935e,_[_0x7fb3('0x5e')](_0x2162f3));_0x16a53b(_0x19935e);})['catch'](function(_0x42ff76){_0x2e28b8(_0x42ff76);});});}function getAgents(_0x410611,_0x497ce1){return new BPromise(function(_0x46517c,_0x44c9a5){return db[_0x410611]['findOne']({'where':{'id':_0x497ce1}})[_0x7fb3('0x29')](function(_0x2f17c0){return _0x2f17c0[_0x7fb3('0x5f')]({'attributes':['id'],'raw':!![]})[_0x7fb3('0x29')](function(_0x65eff8){var _0x12de84=_[_0x7fb3('0x60')](_0x65eff8,'id');_0x46517c(_0x12de84);});})[_0x7fb3('0x56')](function(_0x15f9bf){_0x44c9a5(_0x15f9bf);});});}
\ No newline at end of file
index 88fb853..4951f96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03fa=['hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit'];(function(_0x4c8e0b,_0xb6a426){var _0x541e66=function(_0x8c24dd){while(--_0x8c24dd){_0x4c8e0b['push'](_0x4c8e0b['shift']());}};_0x541e66(++_0xb6a426);}(_0x03fa,0x157));var _0xa03f=function(_0x49dbef,_0x59b894){_0x49dbef=_0x49dbef-0x0;var _0x1f1167=_0x03fa[_0x49dbef];return _0x1f1167;};'use strict';var EventEmitter=require(_0xa03f('0x0'));var UserNotification=require(_0xa03f('0x1'))['db'][_0xa03f('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xa03f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa03f('0x4'),'afterDestroy':_0xa03f('0x5')};function emitEvent(_0x157a1d){return function(_0x53f027,_0x26d96f,_0x3b4eb8){UserNotificationEvents['emit'](_0x157a1d+':'+_0x53f027['id'],_0x53f027);UserNotificationEvents[_0xa03f('0x6')](_0x157a1d,_0x53f027);_0x3b4eb8(null);};}for(var e in events){if(events[_0xa03f('0x7')](e)){var event=events[e];UserNotification[_0xa03f('0x8')](e,emitEvent(event));}}module[_0xa03f('0x9')]=UserNotificationEvents;
\ No newline at end of file
+var _0x9e27=['exports','events','../../mysqldb','UserNotification','setMaxListeners','update','remove','emit','hook'];(function(_0x52e093,_0x29f80a){var _0x54d955=function(_0x23e982){while(--_0x23e982){_0x52e093['push'](_0x52e093['shift']());}};_0x54d955(++_0x29f80a);}(_0x9e27,0xac));var _0x79e2=function(_0x1da7b4,_0xfb87d8){_0x1da7b4=_0x1da7b4-0x0;var _0x229908=_0x9e27[_0x1da7b4];return _0x229908;};'use strict';var EventEmitter=require(_0x79e2('0x0'));var UserNotification=require(_0x79e2('0x1'))['db'][_0x79e2('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x79e2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x79e2('0x4'),'afterDestroy':_0x79e2('0x5')};function emitEvent(_0x36caa4){return function(_0x55499e,_0x21b3e0,_0xa3958){UserNotificationEvents['emit'](_0x36caa4+':'+_0x55499e['id'],_0x55499e);UserNotificationEvents[_0x79e2('0x6')](_0x36caa4,_0x55499e);_0xa3958(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x79e2('0x7')](e,emitEvent(event));}}module[_0x79e2('0x8')]=UserNotificationEvents;
\ No newline at end of file
index 2a8ff50..7dc0154 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe947=['../../config/environment','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x55eb19,_0x16968c){var _0x13b7a1=function(_0x3c3f18){while(--_0x3c3f18){_0x55eb19['push'](_0x55eb19['shift']());}};_0x13b7a1(++_0x16968c);}(_0xe947,0xbd));var _0x7e94=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe947[_0x243b59];return _0x3e1676;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7e94('0x0'))(_0x7e94('0x1'));var moment=require(_0x7e94('0x2'));var BPromise=require(_0x7e94('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e94('0x4'));var rimraf=require(_0x7e94('0x5'));var config=require(_0x7e94('0x6'));var attributes=require('./userNotification.attributes');module[_0x7e94('0x7')]=function(_0xab17cd,_0x2f6900){return _0xab17cd[_0x7e94('0x8')](_0x7e94('0x9'),attributes,{'tableName':_0x7e94('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7e94('0xb'),'collate':_0x7e94('0xc')});};
\ No newline at end of file
+var _0x0ee2=['UserNotification','userNotifications','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userNotification.attributes','exports'];(function(_0x58530f,_0x32442f){var _0x4adc74=function(_0x404ed1){while(--_0x404ed1){_0x58530f['push'](_0x58530f['shift']());}};_0x4adc74(++_0x32442f);}(_0x0ee2,0xc6));var _0x20ee=function(_0x1bf1cf,_0x1f1924){_0x1bf1cf=_0x1bf1cf-0x0;var _0x11159f=_0x0ee2[_0x1bf1cf];return _0x11159f;};'use strict';var _=require(_0x20ee('0x0'));var util=require('util');var logger=require(_0x20ee('0x1'))(_0x20ee('0x2'));var moment=require(_0x20ee('0x3'));var BPromise=require(_0x20ee('0x4'));var rp=require(_0x20ee('0x5'));var fs=require('fs');var path=require(_0x20ee('0x6'));var rimraf=require(_0x20ee('0x7'));var config=require('../../config/environment');var attributes=require(_0x20ee('0x8'));module[_0x20ee('0x9')]=function(_0x4877b8,_0x1f207b){return _0x4877b8['define'](_0x20ee('0xa'),attributes,{'tableName':_0x20ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x20ee('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 9ee25b4..33c4043 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4352=['socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4352,0x1cf));var _0x2435=function(_0x513076,_0x41caae){_0x513076=_0x513076-0x0;var _0x5b34e1=_0x4352[_0x513076];return _0x5b34e1;};'use strict';var _=require('lodash');var util=require(_0x2435('0x0'));var moment=require('moment');var BPromise=require(_0x2435('0x1'));var rs=require(_0x2435('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2435('0x3'))['db'];var utils=require(_0x2435('0x4'));var logger=require('../../config/logger')(_0x2435('0x5'));var config=require(_0x2435('0x6'));var jayson=require(_0x2435('0x7'));var client=jayson[_0x2435('0x8')][_0x2435('0x9')]({'port':0x232a});config[_0x2435('0xa')]=_[_0x2435('0xb')](config[_0x2435('0xa')],{'host':_0x2435('0xc'),'port':0x18eb});var socket=require(_0x2435('0xd'))(new Redis(config['redis']));require(_0x2435('0xe'))[_0x2435('0xf')](socket);function respondWithRpcPromise(_0x1797d7,_0x47b4eb,_0x2a9f91){return new BPromise(function(_0x2018d5,_0x10d5dd){return client[_0x2435('0x10')](_0x1797d7,_0x2a9f91)[_0x2435('0x11')](function(_0x3d68db){logger[_0x2435('0x12')](_0x2435('0x13'),_0x47b4eb,_0x2435('0x14'));logger[_0x2435('0x15')](_0x2435('0x16'),_0x47b4eb,_0x2435('0x14'),JSON['stringify'](_0x3d68db));if(_0x3d68db[_0x2435('0x17')]){if(_0x3d68db[_0x2435('0x17')][_0x2435('0x18')]===0x1f4){logger['error'](_0x2435('0x13'),_0x47b4eb,_0x3d68db[_0x2435('0x17')]['message']);return _0x10d5dd(_0x3d68db['error'][_0x2435('0x19')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x47b4eb,_0x3d68db['error'][_0x2435('0x19')]);return _0x2018d5(_0x3d68db['error'][_0x2435('0x19')]);}else{logger[_0x2435('0x12')](_0x2435('0x13'),_0x47b4eb,_0x2435('0x14'));_0x2018d5(_0x3d68db[_0x2435('0x1a')][_0x2435('0x19')]);}})[_0x2435('0x1b')](function(_0x4f7239){logger['error'](_0x2435('0x13'),_0x47b4eb,_0x4f7239);_0x10d5dd(_0x4f7239);});});}
\ No newline at end of file
+var _0xc564=['jayson/promise','client','http','redis','defaults','socket.io-emitter','./userNotification.socket','register','info','UserNotification,\x20%s,\x20%s','debug','UserNotification,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0xb51513,_0x451c02){var _0x32cdaf=function(_0x1aa0a6){while(--_0x1aa0a6){_0xb51513['push'](_0xb51513['shift']());}};_0x32cdaf(++_0x451c02);}(_0xc564,0x162));var _0x4c56=function(_0x328c54,_0x4b3412){_0x328c54=_0x328c54-0x0;var _0x459aa2=_0xc564[_0x328c54];return _0x459aa2;};'use strict';var _=require('lodash');var util=require(_0x4c56('0x0'));var moment=require(_0x4c56('0x1'));var BPromise=require(_0x4c56('0x2'));var rs=require(_0x4c56('0x3'));var fs=require('fs');var Redis=require(_0x4c56('0x4'));var db=require(_0x4c56('0x5'))['db'];var utils=require(_0x4c56('0x6'));var logger=require(_0x4c56('0x7'))(_0x4c56('0x8'));var config=require(_0x4c56('0x9'));var jayson=require(_0x4c56('0xa'));var client=jayson[_0x4c56('0xb')][_0x4c56('0xc')]({'port':0x232a});config[_0x4c56('0xd')]=_[_0x4c56('0xe')](config[_0x4c56('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4c56('0xf'))(new Redis(config[_0x4c56('0xd')]));require(_0x4c56('0x10'))[_0x4c56('0x11')](socket);function respondWithRpcPromise(_0x47e47c,_0x5f4014,_0x5bc11b){return new BPromise(function(_0x4189a6,_0x1e72ce){return client['request'](_0x47e47c,_0x5bc11b)['then'](function(_0x545b92){logger[_0x4c56('0x12')](_0x4c56('0x13'),_0x5f4014,'request\x20sent');logger[_0x4c56('0x14')](_0x4c56('0x15'),_0x5f4014,_0x4c56('0x16'),JSON[_0x4c56('0x17')](_0x545b92));if(_0x545b92[_0x4c56('0x18')]){if(_0x545b92[_0x4c56('0x18')]['code']===0x1f4){logger['error']('UserNotification,\x20%s,\x20%s',_0x5f4014,_0x545b92[_0x4c56('0x18')][_0x4c56('0x19')]);return _0x1e72ce(_0x545b92['error'][_0x4c56('0x19')]);}logger[_0x4c56('0x18')]('UserNotification,\x20%s,\x20%s',_0x5f4014,_0x545b92[_0x4c56('0x18')]['message']);return _0x4189a6(_0x545b92[_0x4c56('0x18')][_0x4c56('0x19')]);}else{logger[_0x4c56('0x12')](_0x4c56('0x13'),_0x5f4014,'request\x20sent');_0x4189a6(_0x545b92[_0x4c56('0x1a')][_0x4c56('0x19')]);}})[_0x4c56('0x1b')](function(_0x4fc6c7){logger['error']('UserNotification,\x20%s,\x20%s',_0x5f4014,_0x4fc6c7);_0x1e72ce(_0x4fc6c7);});});}
\ No newline at end of file
index 2c349db..69befab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a9e=['userNotification:','./userNotification.events','save','update','emit','removeListener'];(function(_0x12f41b,_0x107d1c){var _0xca2b17=function(_0x127ee0){while(--_0x127ee0){_0x12f41b['push'](_0x12f41b['shift']());}};_0xca2b17(++_0x107d1c);}(_0x1a9e,0x13f));var _0xe1a9=function(_0x4aadbc,_0x4ac517){_0x4aadbc=_0x4aadbc-0x0;var _0x53ba81=_0x1a9e[_0x4aadbc];return _0x53ba81;};'use strict';var UserNotificationEvents=require(_0xe1a9('0x0'));var events=[_0xe1a9('0x1'),'remove',_0xe1a9('0x2')];function createListener(_0x1da7bb,_0x30be0c){return function(_0x50e5aa){_0x30be0c[_0xe1a9('0x3')](_0x1da7bb,_0x50e5aa);};}function removeListener(_0xb7938f,_0x3ebd0b){return function(){UserNotificationEvents[_0xe1a9('0x4')](_0xb7938f,_0x3ebd0b);};}exports['register']=function(_0xcc931){for(var _0x2febc8=0x0,_0x44496e=events['length'];_0x2febc8<_0x44496e;_0x2febc8++){var _0xf14cc1=events[_0x2febc8];var _0x105007=createListener(_0xe1a9('0x5')+_0xf14cc1,_0xcc931);UserNotificationEvents['on'](_0xf14cc1,_0x105007);}};
\ No newline at end of file
+var _0xbaf3=['length','userNotification:','update','emit','removeListener'];(function(_0x2b5100,_0x17c437){var _0x13c7b5=function(_0x4be4a7){while(--_0x4be4a7){_0x2b5100['push'](_0x2b5100['shift']());}};_0x13c7b5(++_0x17c437);}(_0xbaf3,0xca));var _0x3baf=function(_0x2dc09e,_0x5b0466){_0x2dc09e=_0x2dc09e-0x0;var _0x541327=_0xbaf3[_0x2dc09e];return _0x541327;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=['save','remove',_0x3baf('0x0')];function createListener(_0x122745,_0x435848){return function(_0x5a64ea){_0x435848[_0x3baf('0x1')](_0x122745,_0x5a64ea);};}function removeListener(_0x26adf9,_0x2a940f){return function(){UserNotificationEvents[_0x3baf('0x2')](_0x26adf9,_0x2a940f);};}exports['register']=function(_0x262820){for(var _0x460d19=0x0,_0x2e4d2b=events[_0x3baf('0x3')];_0x460d19<_0x2e4d2b;_0x460d19++){var _0x541137=events[_0x460d19];var _0x2e5259=createListener(_0x3baf('0x4')+_0x541137,_0x262820);UserNotificationEvents['on'](_0x541137,_0x2e5259);}};
\ No newline at end of file
index 8f5bdcb..8cb5b6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x12e352,_0x57d1de){var _0x36acd5=function(_0x4cabf2){while(--_0x4cabf2){_0x12e352['push'](_0x12e352['shift']());}};_0x36acd5(++_0x57d1de);}(_0xe706,0xa3));var _0x6e70=function(_0x53b37c,_0x1e3dae){_0x53b37c=_0x53b37c-0x0;var _0x912a5=_0xe706[_0x53b37c];return _0x912a5;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x54f6e5,_0x2da528){var _0xcd1569=function(_0x2e5a4c){while(--_0x2e5a4c){_0x54f6e5['push'](_0x54f6e5['shift']());}};_0xcd1569(++_0x2da528);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0xcb91[_0x5311a1];return _0x2acb9f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index ffdfccb..90dee7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8800=['exports','INTEGER','sequelize'];(function(_0x2d5dc9,_0x3c6481){var _0x5ad0ef=function(_0x176c4f){while(--_0x176c4f){_0x2d5dc9['push'](_0x2d5dc9['shift']());}};_0x5ad0ef(++_0x3c6481);}(_0x8800,0x182));var _0x0880=function(_0x544658,_0x27c4bb){_0x544658=_0x544658-0x0;var _0x2584d8=_0x8800[_0x544658];return _0x2584d8;};'use strict';var Sequelize=require(_0x0880('0x0'));module[_0x0880('0x1')]={'penalty':{'type':Sequelize[_0x0880('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5ca8=['exports','INTEGER','sequelize'];(function(_0x2f8e44,_0x25e114){var _0x57b567=function(_0x233b43){while(--_0x233b43){_0x2f8e44['push'](_0x2f8e44['shift']());}};_0x57b567(++_0x25e114);}(_0x5ca8,0x71));var _0x85ca=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5ca8[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x85ca('0x0'));module[_0x85ca('0x1')]={'penalty':{'type':Sequelize[_0x85ca('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 7a48234..cef2864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1528=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','../../config/logger','api','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1528,0x8e));var _0x8152=function(_0xb1cf5,_0x251a35){_0xb1cf5=_0xb1cf5-0x0;var _0x4cdf2d=_0x1528[_0xb1cf5];return _0x4cdf2d;};'use strict';var _=require(_0x8152('0x0'));var util=require('util');var logger=require(_0x8152('0x1'))(_0x8152('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8152('0x3'));var rimraf=require(_0x8152('0x4'));var config=require(_0x8152('0x5'));var attributes=require(_0x8152('0x6'));module['exports']=function(_0x5c2866,_0xd143d9){return _0x5c2866[_0x8152('0x7')](_0x8152('0x8'),attributes,{'tableName':_0x8152('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb7b=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xef4ef0,_0x3c72f9){var _0x39b60b=function(_0x1d824c){while(--_0x1d824c){_0xef4ef0['push'](_0xef4ef0['shift']());}};_0x39b60b(++_0x3c72f9);}(_0xbb7b,0x8f));var _0xbbb7=function(_0x5bcc42,_0x3ef7b4){_0x5bcc42=_0x5bcc42-0x0;var _0x2f4e4a=_0xbb7b[_0x5bcc42];return _0x2f4e4a;};'use strict';var _=require(_0xbbb7('0x0'));var util=require(_0xbbb7('0x1'));var logger=require(_0xbbb7('0x2'))(_0xbbb7('0x3'));var moment=require(_0xbbb7('0x4'));var BPromise=require(_0xbbb7('0x5'));var rp=require(_0xbbb7('0x6'));var fs=require('fs');var path=require(_0xbbb7('0x7'));var rimraf=require(_0xbbb7('0x8'));var config=require(_0xbbb7('0x9'));var attributes=require(_0xbbb7('0xa'));module[_0xbbb7('0xb')]=function(_0x32fe94,_0x210536){return _0x32fe94[_0xbbb7('0xc')](_0xbbb7('0xd'),attributes,{'tableName':_0xbbb7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a5d7de6..13d321c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37cd=['http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x596fab,_0x207831){var _0x1da920=function(_0x24e30c){while(--_0x24e30c){_0x596fab['push'](_0x596fab['shift']());}};_0x1da920(++_0x207831);}(_0x37cd,0xfd));var _0xd37c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x37cd[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xd37c('0x0'));var util=require(_0xd37c('0x1'));var moment=require(_0xd37c('0x2'));var BPromise=require(_0xd37c('0x3'));var rs=require(_0xd37c('0x4'));var fs=require('fs');var Redis=require(_0xd37c('0x5'));var db=require(_0xd37c('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd37c('0x7'));var config=require(_0xd37c('0x8'));var jayson=require(_0xd37c('0x9'));var client=jayson[_0xd37c('0xa')][_0xd37c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48eb35,_0x2d3ed5,_0x3a918b){return new BPromise(function(_0x365102,_0x3bd964){return client['request'](_0x48eb35,_0x3a918b)[_0xd37c('0xc')](function(_0x43cb5e){logger[_0xd37c('0xd')](_0xd37c('0xe'),_0x2d3ed5,_0xd37c('0xf'));logger[_0xd37c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2d3ed5,_0xd37c('0xf'),JSON[_0xd37c('0x11')](_0x43cb5e));if(_0x43cb5e['error']){if(_0x43cb5e[_0xd37c('0x12')]['code']===0x1f4){logger[_0xd37c('0x12')](_0xd37c('0xe'),_0x2d3ed5,_0x43cb5e[_0xd37c('0x12')][_0xd37c('0x13')]);return _0x3bd964(_0x43cb5e[_0xd37c('0x12')][_0xd37c('0x13')]);}logger['error'](_0xd37c('0xe'),_0x2d3ed5,_0x43cb5e[_0xd37c('0x12')]['message']);return _0x365102(_0x43cb5e[_0xd37c('0x12')][_0xd37c('0x13')]);}else{logger[_0xd37c('0xd')](_0xd37c('0xe'),_0x2d3ed5,_0xd37c('0xf'));_0x365102(_0x43cb5e[_0xd37c('0x14')][_0xd37c('0x13')]);}})[_0xd37c('0x15')](function(_0x2a9fd8){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2d3ed5,_0x2a9fd8);_0x3bd964(_0x2a9fd8);});});}
\ No newline at end of file
+var _0x08b9=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x137f1a,_0x2887df){var _0x439923=function(_0x3d3075){while(--_0x3d3075){_0x137f1a['push'](_0x137f1a['shift']());}};_0x439923(++_0x2887df);}(_0x08b9,0x158));var _0x908b=function(_0xdc66e7,_0x13a216){_0xdc66e7=_0xdc66e7-0x0;var _0x1a46af=_0x08b9[_0xdc66e7];return _0x1a46af;};'use strict';var _=require(_0x908b('0x0'));var util=require('util');var moment=require(_0x908b('0x1'));var BPromise=require(_0x908b('0x2'));var rs=require(_0x908b('0x3'));var fs=require('fs');var Redis=require(_0x908b('0x4'));var db=require(_0x908b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x908b('0x6'))(_0x908b('0x7'));var config=require(_0x908b('0x8'));var jayson=require(_0x908b('0x9'));var client=jayson[_0x908b('0xa')][_0x908b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4465c6,_0x5197a6,_0xb4162b){return new BPromise(function(_0x109edd,_0x483a09){return client[_0x908b('0xc')](_0x4465c6,_0xb4162b)[_0x908b('0xd')](function(_0xd64eaf){logger[_0x908b('0xe')](_0x908b('0xf'),_0x5197a6,'request\x20sent');logger[_0x908b('0x10')](_0x908b('0x11'),_0x5197a6,'request\x20sent',JSON[_0x908b('0x12')](_0xd64eaf));if(_0xd64eaf[_0x908b('0x13')]){if(_0xd64eaf[_0x908b('0x13')][_0x908b('0x14')]===0x1f4){logger[_0x908b('0x13')](_0x908b('0xf'),_0x5197a6,_0xd64eaf[_0x908b('0x13')][_0x908b('0x15')]);return _0x483a09(_0xd64eaf[_0x908b('0x13')][_0x908b('0x15')]);}logger['error'](_0x908b('0xf'),_0x5197a6,_0xd64eaf[_0x908b('0x13')]['message']);return _0x109edd(_0xd64eaf[_0x908b('0x13')][_0x908b('0x15')]);}else{logger[_0x908b('0xe')](_0x908b('0xf'),_0x5197a6,'request\x20sent');_0x109edd(_0xd64eaf[_0x908b('0x16')][_0x908b('0x15')]);}})[_0x908b('0x17')](function(_0x8488f){logger['error'](_0x908b('0xf'),_0x5197a6,_0x8488f);_0x483a09(_0x8488f);});});}
\ No newline at end of file
index 1f1c85d..38dffa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfff6=['put','update','destroy','delete','removeSections','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','post','create','/:id/clone','clone','addSections','/:id/resources','addResources'];(function(_0x50d040,_0x1cb424){var _0x3cc0f4=function(_0x1b2089){while(--_0x1b2089){_0x50d040['push'](_0x50d040['shift']());}};_0x3cc0f4(++_0x1cb424);}(_0xfff6,0x97));var _0x6fff=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xfff6[_0x21a9d9];return _0x46adce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6fff('0x0'));var timeout=require(_0x6fff('0x1'));var express=require(_0x6fff('0x2'));var router=express[_0x6fff('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6fff('0x4'));var interaction=require(_0x6fff('0x5'));var config=require(_0x6fff('0x6'));var controller=require(_0x6fff('0x7'));router[_0x6fff('0x8')]('/',auth[_0x6fff('0x9')](),controller[_0x6fff('0xa')]);router[_0x6fff('0x8')](_0x6fff('0xb'),auth[_0x6fff('0x9')](),controller[_0x6fff('0xc')]);router['get'](_0x6fff('0xd'),auth[_0x6fff('0x9')](),controller[_0x6fff('0xe')]);router[_0x6fff('0x8')](_0x6fff('0xf'),auth['isAuthenticated'](),controller['getSections']);router['get']('/:id/resources',auth[_0x6fff('0x9')](),controller['getResources']);router[_0x6fff('0x10')]('/',auth[_0x6fff('0x9')](),controller[_0x6fff('0x11')]);router[_0x6fff('0x10')](_0x6fff('0x12'),auth[_0x6fff('0x9')](),controller[_0x6fff('0x13')]);router[_0x6fff('0x10')](_0x6fff('0xf'),auth[_0x6fff('0x9')](),controller[_0x6fff('0x14')]);router[_0x6fff('0x10')](_0x6fff('0x15'),auth[_0x6fff('0x9')](),controller[_0x6fff('0x16')]);router[_0x6fff('0x17')](_0x6fff('0xd'),auth[_0x6fff('0x9')](),controller[_0x6fff('0x18')]);router['delete'](_0x6fff('0xd'),auth['isAuthenticated'](),controller[_0x6fff('0x19')]);router[_0x6fff('0x1a')]('/:id/sections',auth[_0x6fff('0x9')](),controller[_0x6fff('0x1b')]);router['delete'](_0x6fff('0x15'),auth[_0x6fff('0x9')](),controller['removeResources']);module[_0x6fff('0x1c')]=router;
\ No newline at end of file
+var _0xbc04=['post','create','/:id/clone','clone','addSections','/:id','removeSections','removeResources','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','describe','show','/:id/sections','/:id/resources','getResources'];(function(_0x1c3736,_0x34662d){var _0x2a3fd6=function(_0x20c5f2){while(--_0x20c5f2){_0x1c3736['push'](_0x1c3736['shift']());}};_0x2a3fd6(++_0x34662d);}(_0xbc04,0x178));var _0x4bc0=function(_0xff677e,_0x38ce30){_0xff677e=_0xff677e-0x0;var _0x4a69f7=_0xbc04[_0xff677e];return _0x4a69f7;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x4bc0('0x0'));var express=require(_0x4bc0('0x1'));var router=express[_0x4bc0('0x2')]();var fs_extra=require(_0x4bc0('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4bc0('0x4'));var config=require(_0x4bc0('0x5'));var controller=require(_0x4bc0('0x6'));router['get']('/',auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x8')]);router[_0x4bc0('0x9')]('/describe',auth[_0x4bc0('0x7')](),controller[_0x4bc0('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4bc0('0xb')]);router[_0x4bc0('0x9')](_0x4bc0('0xc'),auth[_0x4bc0('0x7')](),controller['getSections']);router['get'](_0x4bc0('0xd'),auth[_0x4bc0('0x7')](),controller[_0x4bc0('0xe')]);router[_0x4bc0('0xf')]('/',auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x10')]);router['post'](_0x4bc0('0x11'),auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x12')]);router['post'](_0x4bc0('0xc'),auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x13')]);router['post'](_0x4bc0('0xd'),auth[_0x4bc0('0x7')](),controller['addResources']);router['put'](_0x4bc0('0x14'),auth[_0x4bc0('0x7')](),controller['update']);router['delete'](_0x4bc0('0x14'),auth[_0x4bc0('0x7')](),controller['destroy']);router['delete']('/:id/sections',auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x15')]);router['delete']('/:id/resources',auth[_0x4bc0('0x7')](),controller[_0x4bc0('0x16')]);module['exports']=router;
\ No newline at end of file
index 94a6adf..262df2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36eb=['split','BOOLEAN','exports','STRING','join','getDataValue'];(function(_0x475ac0,_0x566a1c){var _0x4229bb=function(_0x5e6b58){while(--_0x5e6b58){_0x475ac0['push'](_0x475ac0['shift']());}};_0x4229bb(++_0x566a1c);}(_0x36eb,0x1e8));var _0xb36e=function(_0xcf51ed,_0x5c4294){_0xcf51ed=_0xcf51ed-0x0;var _0x3f08be=_0x36eb[_0xcf51ed];return _0x3f08be;};'use strict';var Sequelize=require('sequelize');module[_0xb36e('0x0')]={'name':{'type':Sequelize[_0xb36e('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xb36e('0x1')],'set':function(_0x5120dd){this['setDataValue']('crudPermissions',_0x5120dd?_0x5120dd[_0xb36e('0x2')](''):[]);},'get':function(){return this[_0xb36e('0x3')]('crudPermissions')?this['getDataValue']('crudPermissions')[_0xb36e('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xb36e('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb36e('0x5')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x0ac6=['STRING','setDataValue','crudPermissions','getDataValue','split','BOOLEAN'];(function(_0x18c8b5,_0x2a15d3){var _0x358984=function(_0xf5461){while(--_0xf5461){_0x18c8b5['push'](_0x18c8b5['shift']());}};_0x358984(++_0x2a15d3);}(_0x0ac6,0x1b6));var _0x60ac=function(_0x33d6cf,_0x1d1ca1){_0x33d6cf=_0x33d6cf-0x0;var _0x430deb=_0x0ac6[_0x33d6cf];return _0x430deb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x60ac('0x0')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x60ac('0x0')],'set':function(_0x50ab9c){this[_0x60ac('0x1')](_0x60ac('0x2'),_0x50ab9c?_0x50ab9c['join'](''):[]);},'get':function(){return this['getDataValue'](_0x60ac('0x2'))?this[_0x60ac('0x3')](_0x60ac('0x2'))[_0x60ac('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x60ac('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x60ac('0x5')],'defaultValue':!![]}};
\ No newline at end of file
index f7da54d..fc17b81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe056=['getResources','zip-dir','fast-json-patch','request-promise','bluebird','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','name','send','index','fieldName','type','key','model','map','keys','filters','attributes','query','fields','length','hasOwnProperty','nolimit','order','filter','where','UserProfile','findAll','rows','catch','show','intersection','includeAll','include','merge','options','create','body','clone','params','rawAttributes','find','get','omit','createdAt','sequelize','UserProfileSection','each','autoAssociation','updatedAt','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','transaction','destroy','removeSections','isEmpty','includes','enabled','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20'];(function(_0x84fd2,_0x1c6bdd){var _0x3e869e=function(_0x2f60ee){while(--_0x2f60ee){_0x84fd2['push'](_0x84fd2['shift']());}};_0x3e869e(++_0x1c6bdd);}(_0xe056,0xdb));var _0x6e05=function(_0xd8a8af,_0x1e93f0){_0xd8a8af=_0xd8a8af-0x0;var _0x5b7278=_0xe056[_0xd8a8af];return _0x5b7278;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6e05('0x0'));var jsonpatch=require(_0x6e05('0x1'));var rp=require(_0x6e05('0x2'));var moment=require('moment');var BPromise=require(_0x6e05('0x3'));var Mustache=require('mustache');var util=require(_0x6e05('0x4'));var path=require(_0x6e05('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e05('0x6'));var _=require(_0x6e05('0x7'));var squel=require(_0x6e05('0x8'));var crypto=require('crypto');var jsforce=require(_0x6e05('0x9'));var deskjs=require(_0x6e05('0xa'));var toCsv=require(_0x6e05('0xb'));var querystring=require(_0x6e05('0xc'));var Papa=require(_0x6e05('0xd'));var Redis=require('ioredis');var authService=require(_0x6e05('0xe'));var qs=require(_0x6e05('0xf'));var as=require(_0x6e05('0x10'));var hardwareService=require(_0x6e05('0x11'));var logger=require(_0x6e05('0x12'))(_0x6e05('0x13'));var utils=require('../../config/utils');var config=require(_0x6e05('0x14'));var licenseUtil=require(_0x6e05('0x15'));var db=require(_0x6e05('0x16'))['db'];config['redis']=_[_0x6e05('0x17')](config[_0x6e05('0x18')],{'host':_0x6e05('0x19'),'port':0x18eb});var socket=require(_0x6e05('0x1a'))(new Redis(config[_0x6e05('0x18')]));require('./userProfile.socket')[_0x6e05('0x1b')](socket);function respondWithStatusCode(_0x291d2c,_0x560a84){_0x560a84=_0x560a84||0xcc;return function(_0x5459a6){if(_0x5459a6){return _0x291d2c[_0x6e05('0x1c')](_0x560a84);}return _0x291d2c[_0x6e05('0x1d')](_0x560a84)[_0x6e05('0x1e')]();};}function respondWithResult(_0x5c778b,_0x128186){_0x128186=_0x128186||0xc8;return function(_0x5e9a38){if(_0x5e9a38){return _0x5c778b[_0x6e05('0x1d')](_0x128186)[_0x6e05('0x1f')](_0x5e9a38);}};}function respondWithFilteredResult(_0x517326,_0x550da7){return function(_0x9d1e04){if(_0x9d1e04){var _0x1aa378=typeof _0x550da7[_0x6e05('0x20')]===_0x6e05('0x21')&&typeof _0x550da7[_0x6e05('0x22')]==='undefined';var _0x13d0aa=_0x9d1e04['count'];var _0x57e42a=_0x1aa378?0x0:_0x550da7[_0x6e05('0x20')];var _0x43dd53=_0x1aa378?_0x9d1e04[_0x6e05('0x23')]:_0x550da7[_0x6e05('0x20')]+_0x550da7[_0x6e05('0x22')];var _0x31c52e;if(_0x43dd53>=_0x13d0aa){_0x43dd53=_0x13d0aa;_0x31c52e=0xc8;}else{_0x31c52e=0xce;}_0x517326[_0x6e05('0x1d')](_0x31c52e);return _0x517326[_0x6e05('0x24')]('Content-Range',_0x57e42a+'-'+_0x43dd53+'/'+_0x13d0aa)[_0x6e05('0x1f')](_0x9d1e04);}return null;};}function patchUpdates(_0x4db161){return function(_0x1001ae){try{jsonpatch[_0x6e05('0x25')](_0x1001ae,_0x4db161,!![]);}catch(_0x3eb6e4){return BPromise['reject'](_0x3eb6e4);}return _0x1001ae['save']();};}function saveUpdates(_0x447d4b,_0x5d80cd){return function(_0xd37372){if(_0xd37372){return _0xd37372[_0x6e05('0x26')](_0x447d4b)[_0x6e05('0x27')](function(_0x3444ea){return _0x3444ea;});}return null;};}function removeEntity(_0x3a268b,_0x19f3a6){return function(_0x46ce2e){if(_0x46ce2e){return _0x46ce2e['destroy']()[_0x6e05('0x27')](function(){_0x3a268b[_0x6e05('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x169684,_0x2dfdcc){return function(_0x578270){if(!_0x578270){_0x169684['sendStatus'](0x194);}return _0x578270;};}function handleError(_0x8a230,_0x53c447){_0x53c447=_0x53c447||0x1f4;return function(_0x2d421f){logger[_0x6e05('0x28')](_0x2d421f['stack']);if(_0x2d421f['name']){delete _0x2d421f[_0x6e05('0x29')];}_0x8a230[_0x6e05('0x1d')](_0x53c447)[_0x6e05('0x2a')](_0x2d421f);};}exports[_0x6e05('0x2b')]=function(_0x5c38f1,_0x2bc108){var _0x2791ee={},_0x8fa8b1={},_0x5bf3ca={'count':0x0,'rows':[]};var _0x1a4609=_['map'](db['UserProfile']['rawAttributes'],function(_0x3a6f85){return{'name':_0x3a6f85[_0x6e05('0x2c')],'type':_0x3a6f85[_0x6e05('0x2d')][_0x6e05('0x2e')]};});_0x8fa8b1[_0x6e05('0x2f')]=_[_0x6e05('0x30')](_0x1a4609,_0x6e05('0x29'));_0x8fa8b1['query']=_[_0x6e05('0x31')](_0x5c38f1['query']);_0x8fa8b1[_0x6e05('0x32')]=_['intersection'](_0x8fa8b1[_0x6e05('0x2f')],_0x8fa8b1['query']);_0x2791ee[_0x6e05('0x33')]=_['intersection'](_0x8fa8b1[_0x6e05('0x2f')],qs['fields'](_0x5c38f1[_0x6e05('0x34')][_0x6e05('0x35')]));_0x2791ee[_0x6e05('0x33')]=_0x2791ee[_0x6e05('0x33')][_0x6e05('0x36')]?_0x2791ee[_0x6e05('0x33')]:_0x8fa8b1['model'];if(!_0x5c38f1[_0x6e05('0x34')][_0x6e05('0x37')](_0x6e05('0x38'))){_0x2791ee[_0x6e05('0x22')]=qs['limit'](_0x5c38f1['query'][_0x6e05('0x22')]);_0x2791ee['offset']=qs[_0x6e05('0x20')](_0x5c38f1[_0x6e05('0x34')][_0x6e05('0x20')]);}_0x2791ee[_0x6e05('0x39')]=qs['sort'](_0x5c38f1[_0x6e05('0x34')]['sort']);_0x2791ee['where']=qs[_0x6e05('0x32')](_['pick'](_0x5c38f1[_0x6e05('0x34')],_0x8fa8b1[_0x6e05('0x32')]),_0x1a4609);if(_0x5c38f1[_0x6e05('0x34')][_0x6e05('0x3a')]){_0x2791ee[_0x6e05('0x3b')]=_['merge'](_0x2791ee[_0x6e05('0x3b')],{'$or':_['map'](_0x1a4609,function(_0x1d26ae){if(_0x1d26ae[_0x6e05('0x2d')]!=='VIRTUAL'){var _0xc411da={};_0xc411da[_0x1d26ae[_0x6e05('0x29')]]={'$like':'%'+_0x5c38f1[_0x6e05('0x34')][_0x6e05('0x3a')]+'%'};return _0xc411da;}})});}_0x2791ee=_['merge']({},_0x2791ee,_0x5c38f1['options']);var _0xb6cff2={'where':_0x2791ee[_0x6e05('0x3b')]};return db[_0x6e05('0x3c')][_0x6e05('0x23')](_0xb6cff2)[_0x6e05('0x27')](function(_0x5df453){_0x5bf3ca[_0x6e05('0x23')]=_0x5df453;if(_0x5c38f1['query']['includeAll']){_0x2791ee['include']=[{'all':!![]}];}return db['UserProfile'][_0x6e05('0x3d')](_0x2791ee);})['then'](function(_0x506515){_0x5bf3ca[_0x6e05('0x3e')]=_0x506515;return _0x5bf3ca;})[_0x6e05('0x27')](respondWithFilteredResult(_0x2bc108,_0x2791ee))[_0x6e05('0x3f')](handleError(_0x2bc108,null));};exports[_0x6e05('0x40')]=function(_0x54c3dc,_0x3d3d4f){var _0x59e031={'raw':![],'where':{'id':_0x54c3dc['params']['id']}},_0x220725={};_0x220725[_0x6e05('0x2f')]=_['keys'](db[_0x6e05('0x3c')]['rawAttributes']);_0x220725[_0x6e05('0x34')]=_[_0x6e05('0x31')](_0x54c3dc[_0x6e05('0x34')]);_0x220725['filters']=_['intersection'](_0x220725[_0x6e05('0x2f')],_0x220725[_0x6e05('0x34')]);_0x59e031['attributes']=_[_0x6e05('0x41')](_0x220725[_0x6e05('0x2f')],qs[_0x6e05('0x35')](_0x54c3dc[_0x6e05('0x34')][_0x6e05('0x35')]));_0x59e031[_0x6e05('0x33')]=_0x59e031[_0x6e05('0x33')][_0x6e05('0x36')]?_0x59e031[_0x6e05('0x33')]:_0x220725[_0x6e05('0x2f')];if(_0x54c3dc[_0x6e05('0x34')][_0x6e05('0x42')]){_0x59e031[_0x6e05('0x43')]=[{'all':!![]}];}_0x59e031=_[_0x6e05('0x44')]({},_0x59e031,_0x54c3dc[_0x6e05('0x45')]);return db[_0x6e05('0x3c')]['find'](_0x59e031)[_0x6e05('0x27')](handleEntityNotFound(_0x3d3d4f,null))[_0x6e05('0x27')](respondWithResult(_0x3d3d4f,null))[_0x6e05('0x3f')](handleError(_0x3d3d4f,null));};exports[_0x6e05('0x46')]=function(_0x5aada1,_0x5158cb){return db[_0x6e05('0x3c')]['create'](_0x5aada1[_0x6e05('0x47')],{})[_0x6e05('0x27')](respondWithResult(_0x5158cb,0xc9))[_0x6e05('0x3f')](handleError(_0x5158cb,null));};exports[_0x6e05('0x48')]=function(_0x55ccff,_0xb7dac1){var _0x148439={'where':{'id':_0x55ccff[_0x6e05('0x49')]['id']}},_0x10c526={};_0x10c526[_0x6e05('0x2f')]=_['keys'](db[_0x6e05('0x3c')][_0x6e05('0x4a')]);_0x148439['attributes']=_[_0x6e05('0x41')](_0x10c526[_0x6e05('0x2f')],qs[_0x6e05('0x35')](_0x55ccff[_0x6e05('0x34')][_0x6e05('0x35')]));_0x148439['attributes']=_0x148439[_0x6e05('0x33')][_0x6e05('0x36')]?_0x148439[_0x6e05('0x33')]:_0x10c526[_0x6e05('0x2f')];if(_0x55ccff[_0x6e05('0x34')]['includeAll']){_0x148439[_0x6e05('0x43')]=[{'all':!![]}];}_0x148439=_[_0x6e05('0x44')]({},_0x148439,_0x55ccff['options']);return db[_0x6e05('0x3c')][_0x6e05('0x4b')](_0x148439)[_0x6e05('0x27')](handleEntityNotFound(_0xb7dac1,null))['then'](function(_0x3f9e1f){if(_0x3f9e1f){var _0x361731=_0x3f9e1f[_0x6e05('0x4c')]({'plain':!![]});_0x361731=qs[_0x6e05('0x4d')](_0x361731,['id',_0x6e05('0x4e'),'updatedAt','crudPermissions']);_0x55ccff[_0x6e05('0x47')]=_[_0x6e05('0x4d')](_0x55ccff['body'],['id',_0x6e05('0x4e'),'updatedAt']);return db[_0x6e05('0x4f')]['transaction'](function(_0x16b307){return db[_0x6e05('0x3c')][_0x6e05('0x46')](_['merge'](_0x361731,_0x55ccff[_0x6e05('0x47')]),{'include':_0x55ccff[_0x6e05('0x34')][_0x6e05('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x16b307})[_0x6e05('0x27')](function(_0x1d0747){var _0x38416c=_0x1d0747[_0x6e05('0x4c')]({'plain':!![]});return db[_0x6e05('0x50')][_0x6e05('0x3d')]({'where':{'userProfileId':_0x55ccff['params']['id']},'raw':!![]})[_0x6e05('0x27')](function(_0x1f3834){if(_0x1f3834){return BPromise[_0x6e05('0x51')](_0x1f3834,function(_0x4913f4){return new BPromise(function(_0x254f7a,_0x1e07c0){if(_0x4913f4['autoAssociation']===null||_0x4913f4[_0x6e05('0x52')]===0x1)_0x254f7a(null);return db['UserProfileResource'][_0x6e05('0x3d')]({'where':{'sectionId':_0x4913f4['id']},'raw':!![]})[_0x6e05('0x27')](function(_0x3efb52){var _0x4b1dba=_[_0x6e05('0x30')](_0x3efb52,function(_0x2c0b82){return qs['omit'](_0x2c0b82,['id',_0x6e05('0x4e'),_0x6e05('0x53'),_0x6e05('0x54')]);});_0x254f7a(_0x4b1dba);})['catch'](function(_0x14da04){_0x1e07c0(_0x14da04);});})['then'](function(_0x146f86){var _0x630edb=qs[_0x6e05('0x4d')](_0x4913f4,['id',_0x6e05('0x4e'),_0x6e05('0x53')]);_0x630edb[_0x6e05('0x55')]=_0x38416c['id'];if(_0x146f86)_0x630edb[_0x6e05('0x56')]=_0x146f86;return _0x630edb;})[_0x6e05('0x27')](function(_0x544375){return db[_0x6e05('0x50')][_0x6e05('0x46')](_0x544375,{'include':[{'model':db[_0x6e05('0x57')],'as':_0x6e05('0x56')}],'raw':!![],'transaction':_0x16b307});});})['then'](function(){return _0x38416c;});}});});});}})[_0x6e05('0x27')](respondWithResult(_0xb7dac1,0xc9))[_0x6e05('0x3f')](handleError(_0xb7dac1,null));};exports[_0x6e05('0x26')]=function(_0x6e5d80,_0x3bb330){if(_0x6e5d80[_0x6e05('0x47')]['id']){delete _0x6e5d80[_0x6e05('0x47')]['id'];}return db[_0x6e05('0x3c')]['find']({'where':{'id':_0x6e5d80[_0x6e05('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bb330,null))[_0x6e05('0x27')](saveUpdates(_0x6e5d80[_0x6e05('0x47')],null))['then'](respondWithResult(_0x3bb330,null))[_0x6e05('0x3f')](handleError(_0x3bb330,null));};exports['destroy']=function(_0x249d8c,_0x2d4b57){return db[_0x6e05('0x3c')][_0x6e05('0x4b')]({'where':{'id':_0x249d8c[_0x6e05('0x49')]['id']}})[_0x6e05('0x27')](handleEntityNotFound(_0x2d4b57,null))[_0x6e05('0x27')](removeEntity(_0x2d4b57,null))[_0x6e05('0x3f')](handleError(_0x2d4b57,null));};exports[_0x6e05('0x58')]=function(_0x2d275a,_0x3d0b56){return db['UserProfile'][_0x6e05('0x58')]()['then'](respondWithResult(_0x3d0b56,null))[_0x6e05('0x3f')](handleError(_0x3d0b56,null));};exports[_0x6e05('0x59')]=function(_0x34303a,_0x319f44){var _0x1cb629=_0x34303a[_0x6e05('0x47')];return db[_0x6e05('0x3c')][_0x6e05('0x4b')]({'where':{'id':_0x34303a[_0x6e05('0x49')]['id']}})['then'](handleEntityNotFound(_0x319f44,null))[_0x6e05('0x27')](function(_0x82862a){if(_0x82862a){return db[_0x6e05('0x4f')][_0x6e05('0x5a')](function(_0xe901f7){return db[_0x6e05('0x50')][_0x6e05('0x5b')]({'where':{'userProfileId':_0x34303a[_0x6e05('0x49')]['id'],'sectionId':_[_0x6e05('0x30')](_0x1cb629,function(_0x177b52){return _0x177b52[_0x6e05('0x54')];})},'transaction':_0xe901f7})[_0x6e05('0x27')](function(){var _0x44fc84=_[_0x6e05('0x30')](_0x1cb629,function(_0x1e8501){_0x1e8501[_0x6e05('0x55')]=_0x34303a[_0x6e05('0x49')]['id'];return _0x1e8501;});var _0x3a7833=[];return BPromise[_0x6e05('0x51')](_0x44fc84,function(_0x50d13e){return db[_0x6e05('0x50')][_0x6e05('0x46')](_0x50d13e,{'include':[{'model':db['UserProfileResource'],'as':_0x6e05('0x56')}],'raw':!![],'transaction':_0xe901f7})['then'](function(_0x51695c){_0x3a7833['push'](_0x51695c[_0x6e05('0x4c')]({'plain':!![]}));});})[_0x6e05('0x27')](function(){return _0x3a7833;});});});}})[_0x6e05('0x27')](function(_0x3184c6){return _0x3184c6;})['then'](respondWithResult(_0x319f44,null))['catch'](handleError(_0x319f44,null));};exports[_0x6e05('0x5c')]=function(_0x2aa53b,_0x28132e){var _0x415d13;return db[_0x6e05('0x3c')][_0x6e05('0x4b')]({'where':{'id':_0x2aa53b['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x28132e,null))[_0x6e05('0x27')](function(_0x4449db){if(_0x4449db){_0x415d13=_0x4449db;return db[_0x6e05('0x50')][_0x6e05('0x5b')]({'where':{'userProfileId':_0x2aa53b[_0x6e05('0x49')]['id'],'sectionId':_0x2aa53b[_0x6e05('0x34')]['ids']}});}})[_0x6e05('0x27')](function(){return _0x415d13;})['then'](respondWithStatusCode(_0x28132e,null))['catch'](handleError(_0x28132e,null));};exports['getSections']=function(_0x3e4885,_0xaeee79){var _0x406c66=[];var _0x475c1f=[];return db[_0x6e05('0x50')][_0x6e05('0x3d')]({'where':{'userProfileId':_0x3e4885[_0x6e05('0x49')]['id']},'raw':!![]})[_0x6e05('0x27')](function(_0x204f7e){_0x406c66=_[_0x6e05('0x3a')](_0x204f7e,function(_0x28def4){return _0x28def4['enabled']===0x1||_['includes']([0x3eb,0x709],_0x28def4['sectionId']);});if(!_[_0x6e05('0x5d')](_0x406c66)){return _[_0x6e05('0x30')](_0x406c66,function(_0x573474){return _0x573474[_0x6e05('0x54')];});}else{return;}})[_0x6e05('0x27')](function(_0x5d637e){if(_0x5d637e)_0x475c1f=_0x5d637e;if(_[_0x6e05('0x5e')](_0x475c1f,0x64)){var _0x2e21db=_[_0x6e05('0x4b')](_0x406c66,{'sectionId':0x64});return hasDefaultDashboard(_0x2e21db)['then'](function(_0x581e1d){return _[_0x6e05('0x30')](_0x406c66,function(_0x1bc1d0){if(_0x1bc1d0[_0x6e05('0x54')]===0x64){_0x1bc1d0['subsections']=_0x581e1d;}return _0x1bc1d0;});});}else{return;}})['then'](function(_0x18f5ba){if(_0x18f5ba)_0x406c66=_0x18f5ba;if(_['includes'](_0x475c1f,0x3eb)){var _0x2b2426=_['find'](_0x406c66,{'sectionId':0x3eb});return getCustomDashboards(_0x2b2426)['then'](function(_0x4ac51e){return _[_0x6e05('0x30')](_0x406c66,function(_0x3ef683){if(_0x2b2426[_0x6e05('0x5f')]){if(_0x3ef683[_0x6e05('0x54')]===0x3eb){_0x3ef683[_0x6e05('0x60')]=_0x4ac51e;}}else{if(_0x3ef683[_0x6e05('0x54')]===0x64){_0x3ef683['subsections']=_0x4ac51e;}}return _0x3ef683;});});}else{return;}})[_0x6e05('0x27')](function(_0x1de2ec){if(_0x1de2ec)_0x406c66=_0x1de2ec;if(_[_0x6e05('0x5e')](_0x475c1f,0x709)){var _0x2d38fa=_['find'](_0x406c66,{'sectionId':0x709});return getPlugins(_0x2d38fa)[_0x6e05('0x27')](function(_0x5cd205){if(_0x2d38fa[_0x6e05('0x5f')]){return _[_0x6e05('0x30')](_0x406c66,function(_0x10f52e){if(_0x10f52e['sectionId']===0x709){_0x10f52e[_0x6e05('0x60')]=_0x5cd205;}return _0x10f52e;});}else{var _0x13ef5e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5cd205};var _0x2314f8=_[_0x6e05('0x30')](_0x406c66);_0x2314f8[_0x6e05('0x61')](_0x13ef5e);return _0x2314f8;}});}else{return;}})['then'](function(_0x43193a){if(_0x43193a)_0x406c66=_0x43193a;return _[_0x6e05('0x3a')](_0x406c66,[_0x6e05('0x5f'),0x1]);})['then'](respondWithResult(_0xaeee79,null))[_0x6e05('0x3f')](handleError(_0xaeee79,null));};function hasDefaultDashboard(_0x49962a){var _0x17921c=[0x65];return new BPromise(function(_0x5c37ad,_0x34ee90){try{if(_0x49962a['autoAssociation']){_0x5c37ad(_0x17921c);}else{return db[_0x6e05('0x57')][_0x6e05('0x62')]({'where':{'sectionId':_0x49962a['id']},'raw':!![]})[_0x6e05('0x27')](function(_0x3fc00c){_0x3fc00c?_0x5c37ad(_0x17921c):_0x5c37ad();});}}catch(_0x24b1ba){_0x34ee90(_0x24b1ba);}});}function getCustomDashboards(_0x443c71){var _0x36059e=[];return new BPromise(function(_0x35559a,_0x17871a){try{if(_0x443c71[_0x6e05('0x52')]){return db[_0x6e05('0x63')][_0x6e05('0x3d')]({'raw':!![]})[_0x6e05('0x27')](function(_0x2d3c7d){_0x2d3c7d[_0x6e05('0x64')](function(_0x3dd9ad){_0x36059e['push'](_0x3dd9ad['id']+0x1869f);});_0x35559a(_0x36059e);});}else{return db[_0x6e05('0x57')]['findAll']({'where':{'sectionId':_0x443c71['id']},'raw':!![]})['then'](function(_0x39c88f){_0x39c88f[_0x6e05('0x64')](function(_0x3eb0d5){_0x36059e[_0x6e05('0x61')](_0x3eb0d5[_0x6e05('0x65')]+0x1869f);});_0x35559a(_0x36059e);});}}catch(_0x681100){_0x17871a(_0x681100);}});}function getPlugins(_0x4374f9){var _0x41eb52=[];return new BPromise(function(_0x123db3,_0x261f5c){try{if(_0x4374f9[_0x6e05('0x52')]){return db[_0x6e05('0x66')][_0x6e05('0x3d')]({'raw':!![]})['then'](function(_0x5e5481){_0x5e5481[_0x6e05('0x64')](function(_0xd8f645){_0x41eb52[_0x6e05('0x61')](_0xd8f645['id']+0x15b38);});_0x123db3(_0x41eb52);});}else{return db[_0x6e05('0x57')][_0x6e05('0x3d')]({'where':{'sectionId':_0x4374f9['id']},'raw':!![]})['then'](function(_0x50d31d){_0x50d31d[_0x6e05('0x64')](function(_0x3cc8fd){_0x41eb52['push'](_0x3cc8fd[_0x6e05('0x65')]+0x15b38);});_0x123db3(_0x41eb52);});}}catch(_0x335907){_0x261f5c(_0x335907);}});}exports[_0x6e05('0x67')]=function(_0x38a5c7,_0x472fe5){return db[_0x6e05('0x3c')][_0x6e05('0x4b')]({'where':{'id':_0x38a5c7[_0x6e05('0x49')]['id']}})[_0x6e05('0x27')](handleEntityNotFound(_0x472fe5,null))[_0x6e05('0x27')](function(_0x27b24d){if(_0x27b24d){return db[_0x6e05('0x4f')]['transaction'](function(_0x230008){return db[_0x6e05('0x50')]['findAll']({'where':{'userProfileId':_0x38a5c7[_0x6e05('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x6e05('0x27')](function(_0xb8e21b){if(_0xb8e21b){return db[_0x6e05('0x50')][_0x6e05('0x5b')]({'where':{'userProfileId':_0x38a5c7[_0x6e05('0x49')]['id'],'id':_['map'](_0xb8e21b,function(_0xf6ce22){return _0xf6ce22['id'];})},'transaction':_0x230008});}})[_0x6e05('0x27')](function(_0x4f218d){var _0x432e49=_[_0x6e05('0x30')](_0x38a5c7[_0x6e05('0x47')],function(_0xe83c93){_0xe83c93[_0x6e05('0x55')]=_0x38a5c7['params']['id'];return _0xe83c93;});return db[_0x6e05('0x50')][_0x6e05('0x68')](_0x432e49,{'raw':!![],'transaction':_0x230008});})['then'](function(_0xf5a917){var _0x1c4c46=_['filter'](_[_0x6e05('0x30')](_0xf5a917,function(_0x58478a){return _0x58478a[_0x6e05('0x4c')]({'plain':!![]});}),{'includeAll':![]});if(_0x1c4c46){return db[_0x6e05('0x50')]['findAll']({'where':{'userProfileId':_0x38a5c7[_0x6e05('0x49')]['id'],'sectionId':_[_0x6e05('0x30')](_0x1c4c46,function(_0x1cadab){return _0x1cadab[_0x6e05('0x54')];})},'attributes':['id',_0x6e05('0x54')],'raw':!![]})[_0x6e05('0x27')](function(_0x4b517f){var _0x131e66=_[_0x6e05('0x30')](_0x38a5c7[_0x6e05('0x47')],function(_0x261593){_0x261593[_0x6e05('0x55')]=_0x38a5c7['params']['id'];return _0x261593;});return db[_0x6e05('0x57')][_0x6e05('0x68')](_0x131e66,{'raw':!![],'transaction':_0x230008});});}})['catch'](handleError(_0x472fe5,null));});}})[_0x6e05('0x27')](function(_0x65cbff){var _0x2d4d5b=_[_0x6e05('0x30')](_0x65cbff,function(_0x5d05c9){return _0x5d05c9['get']({'plain':!![]});});})[_0x6e05('0x27')](respondWithResult(_0x472fe5,null))[_0x6e05('0x3f')](handleError(_0x472fe5,null));};exports[_0x6e05('0x69')]=function(_0x3c6340,_0x537123,_0x3ef6ac){return db[_0x6e05('0x3c')][_0x6e05('0x4b')]({'where':{'id':_0x3c6340[_0x6e05('0x49')]['id']}})['then'](handleEntityNotFound(_0x537123,null))[_0x6e05('0x27')](function(_0x34110e){if(_0x34110e){return _0x34110e[_0x6e05('0x69')](_0x3c6340['query']['ids']);}})[_0x6e05('0x27')](respondWithStatusCode(_0x537123,null))[_0x6e05('0x3f')](handleError(_0x537123,null));};exports['getResources']=function(_0x2efd76,_0xe9575a){var _0x1b14f2={};if(!_0x2efd76[_0x6e05('0x34')]['section'])throw new Error(_0x6e05('0x6a'));if(!_0x2efd76[_0x6e05('0x34')][_0x6e05('0x37')]('nolimit')){_0x1b14f2[_0x6e05('0x22')]=qs['limit'](_0x2efd76[_0x6e05('0x34')][_0x6e05('0x22')]);_0x1b14f2[_0x6e05('0x20')]=qs[_0x6e05('0x20')](_0x2efd76[_0x6e05('0x34')][_0x6e05('0x20')]);}return db['UserProfile'][_0x6e05('0x4b')]({'where':{'id':_0x2efd76[_0x6e05('0x49')]['id']}})['then'](function(_0x39c275){if(!_0x39c275)throw new Error(_0x6e05('0x6b')+_0x2efd76['params']['id']);return db[_0x6e05('0x3c')][_0x6e05('0x6c')](_0x2efd76);})[_0x6e05('0x27')](respondWithFilteredResult(_0xe9575a,_0x1b14f2))[_0x6e05('0x3f')](handleError(_0xe9575a,null));};
\ No newline at end of file
+var _0xdf4d=['../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userProfile.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','index','UserProfile','rawAttributes','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','intersection','find','create','get','createdAt','updatedAt','crudPermissions','body','omit','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','Resources','UserProfileSection','addSections','destroy','userProfileId','push','removeSections','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','section','Missing\x20section\x20parameter','getResources','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x1d2ccb,_0x917dda){var _0x178f78=function(_0x59ba44){while(--_0x59ba44){_0x1d2ccb['push'](_0x1d2ccb['shift']());}};_0x178f78(++_0x917dda);}(_0xdf4d,0xcb));var _0xddf4=function(_0x11b88c,_0x5d8566){_0x11b88c=_0x11b88c-0x0;var _0xf4c09e=_0xdf4d[_0x11b88c];return _0xf4c09e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xddf4('0x0'));var zipdir=require(_0xddf4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xddf4('0x2'));var moment=require(_0xddf4('0x3'));var BPromise=require(_0xddf4('0x4'));var Mustache=require(_0xddf4('0x5'));var util=require(_0xddf4('0x6'));var path=require(_0xddf4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xddf4('0x8'));var fs=require('fs');var fs_extra=require(_0xddf4('0x9'));var _=require(_0xddf4('0xa'));var squel=require(_0xddf4('0xb'));var crypto=require(_0xddf4('0xc'));var jsforce=require(_0xddf4('0xd'));var deskjs=require(_0xddf4('0xe'));var toCsv=require(_0xddf4('0xf'));var querystring=require(_0xddf4('0x10'));var Papa=require(_0xddf4('0x11'));var Redis=require(_0xddf4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xddf4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf4('0x14'));var logger=require(_0xddf4('0x15'))(_0xddf4('0x16'));var utils=require(_0xddf4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xddf4('0x18'));var db=require(_0xddf4('0x19'))['db'];config[_0xddf4('0x1a')]=_[_0xddf4('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xddf4('0x1c'))(new Redis(config['redis']));require(_0xddf4('0x1d'))[_0xddf4('0x1e')](socket);function respondWithStatusCode(_0x3754f5,_0x276ab2){_0x276ab2=_0x276ab2||0xcc;return function(_0x3ef3a1){if(_0x3ef3a1){return _0x3754f5['sendStatus'](_0x276ab2);}return _0x3754f5[_0xddf4('0x1f')](_0x276ab2)['end']();};}function respondWithResult(_0x13c576,_0x464288){_0x464288=_0x464288||0xc8;return function(_0x111e2e){if(_0x111e2e){return _0x13c576[_0xddf4('0x1f')](_0x464288)[_0xddf4('0x20')](_0x111e2e);}};}function respondWithFilteredResult(_0x29ff35,_0x28f3fb){return function(_0x4d76b1){if(_0x4d76b1){var _0x49e4d3=typeof _0x28f3fb[_0xddf4('0x21')]===_0xddf4('0x22')&&typeof _0x28f3fb['limit']==='undefined';var _0x5cb24f=_0x4d76b1[_0xddf4('0x23')];var _0x412dab=_0x49e4d3?0x0:_0x28f3fb[_0xddf4('0x21')];var _0x254c7a=_0x49e4d3?_0x4d76b1[_0xddf4('0x23')]:_0x28f3fb['offset']+_0x28f3fb[_0xddf4('0x24')];var _0x5b1aee;if(_0x254c7a>=_0x5cb24f){_0x254c7a=_0x5cb24f;_0x5b1aee=0xc8;}else{_0x5b1aee=0xce;}_0x29ff35[_0xddf4('0x1f')](_0x5b1aee);return _0x29ff35[_0xddf4('0x25')](_0xddf4('0x26'),_0x412dab+'-'+_0x254c7a+'/'+_0x5cb24f)['json'](_0x4d76b1);}return null;};}function patchUpdates(_0x1f7a04){return function(_0x60b240){try{jsonpatch[_0xddf4('0x27')](_0x60b240,_0x1f7a04,!![]);}catch(_0x4ccad2){return BPromise[_0xddf4('0x28')](_0x4ccad2);}return _0x60b240[_0xddf4('0x29')]();};}function saveUpdates(_0x149a0e,_0x3d37da){return function(_0x321b6c){if(_0x321b6c){return _0x321b6c[_0xddf4('0x2a')](_0x149a0e)[_0xddf4('0x2b')](function(_0x898311){return _0x898311;});}return null;};}function removeEntity(_0x44bb39,_0x1757f6){return function(_0x2c76c6){if(_0x2c76c6){return _0x2c76c6['destroy']()[_0xddf4('0x2b')](function(){_0x44bb39['status'](0xcc)[_0xddf4('0x2c')]();});}};}function handleEntityNotFound(_0x1d9edd,_0x345d35){return function(_0x67dbb1){if(!_0x67dbb1){_0x1d9edd[_0xddf4('0x2d')](0x194);}return _0x67dbb1;};}function handleError(_0x19cfb7,_0x215f34){_0x215f34=_0x215f34||0x1f4;return function(_0x1e8945){logger[_0xddf4('0x2e')](_0x1e8945[_0xddf4('0x2f')]);if(_0x1e8945[_0xddf4('0x30')]){delete _0x1e8945['name'];}_0x19cfb7['status'](_0x215f34)['send'](_0x1e8945);};}exports[_0xddf4('0x31')]=function(_0x4c2ad9,_0xbcbbaa){var _0x10311d={},_0x3e2680={},_0x1be3e7={'count':0x0,'rows':[]};var _0x48de86=_['map'](db[_0xddf4('0x32')][_0xddf4('0x33')],function(_0x4fc988){return{'name':_0x4fc988['fieldName'],'type':_0x4fc988[_0xddf4('0x34')][_0xddf4('0x35')]};});_0x3e2680[_0xddf4('0x36')]=_['map'](_0x48de86,_0xddf4('0x30'));_0x3e2680[_0xddf4('0x37')]=_['keys'](_0x4c2ad9['query']);_0x3e2680[_0xddf4('0x38')]=_['intersection'](_0x3e2680[_0xddf4('0x36')],_0x3e2680[_0xddf4('0x37')]);_0x10311d['attributes']=_['intersection'](_0x3e2680[_0xddf4('0x36')],qs['fields'](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x39')]));_0x10311d[_0xddf4('0x3a')]=_0x10311d[_0xddf4('0x3a')][_0xddf4('0x3b')]?_0x10311d[_0xddf4('0x3a')]:_0x3e2680[_0xddf4('0x36')];if(!_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x3c')](_0xddf4('0x3d'))){_0x10311d['limit']=qs[_0xddf4('0x24')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x24')]);_0x10311d[_0xddf4('0x21')]=qs[_0xddf4('0x21')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x21')]);}_0x10311d[_0xddf4('0x3e')]=qs[_0xddf4('0x3f')](_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x3f')]);_0x10311d[_0xddf4('0x40')]=qs[_0xddf4('0x38')](_['pick'](_0x4c2ad9[_0xddf4('0x37')],_0x3e2680[_0xddf4('0x38')]),_0x48de86);if(_0x4c2ad9['query'][_0xddf4('0x41')]){_0x10311d[_0xddf4('0x40')]=_[_0xddf4('0x42')](_0x10311d[_0xddf4('0x40')],{'$or':_[_0xddf4('0x43')](_0x48de86,function(_0xd7e337){if(_0xd7e337[_0xddf4('0x34')]!==_0xddf4('0x44')){var _0x5b7bd2={};_0x5b7bd2[_0xd7e337[_0xddf4('0x30')]]={'$like':'%'+_0x4c2ad9['query']['filter']+'%'};return _0x5b7bd2;}})});}_0x10311d=_[_0xddf4('0x42')]({},_0x10311d,_0x4c2ad9[_0xddf4('0x45')]);var _0x3cd53f={'where':_0x10311d[_0xddf4('0x40')]};return db[_0xddf4('0x32')]['count'](_0x3cd53f)[_0xddf4('0x2b')](function(_0x1195d4){_0x1be3e7[_0xddf4('0x23')]=_0x1195d4;if(_0x4c2ad9[_0xddf4('0x37')][_0xddf4('0x46')]){_0x10311d[_0xddf4('0x47')]=[{'all':!![]}];}return db[_0xddf4('0x32')][_0xddf4('0x48')](_0x10311d);})[_0xddf4('0x2b')](function(_0x2f9588){_0x1be3e7[_0xddf4('0x49')]=_0x2f9588;return _0x1be3e7;})[_0xddf4('0x2b')](respondWithFilteredResult(_0xbcbbaa,_0x10311d))[_0xddf4('0x4a')](handleError(_0xbcbbaa,null));};exports['show']=function(_0x1bcb35,_0x284134){var _0x59d876={'raw':![],'where':{'id':_0x1bcb35[_0xddf4('0x4b')]['id']}},_0x8e38ea={};_0x8e38ea[_0xddf4('0x36')]=_[_0xddf4('0x4c')](db[_0xddf4('0x32')][_0xddf4('0x33')]);_0x8e38ea[_0xddf4('0x37')]=_[_0xddf4('0x4c')](_0x1bcb35[_0xddf4('0x37')]);_0x8e38ea[_0xddf4('0x38')]=_[_0xddf4('0x4d')](_0x8e38ea[_0xddf4('0x36')],_0x8e38ea['query']);_0x59d876['attributes']=_[_0xddf4('0x4d')](_0x8e38ea[_0xddf4('0x36')],qs[_0xddf4('0x39')](_0x1bcb35[_0xddf4('0x37')][_0xddf4('0x39')]));_0x59d876[_0xddf4('0x3a')]=_0x59d876['attributes'][_0xddf4('0x3b')]?_0x59d876[_0xddf4('0x3a')]:_0x8e38ea['model'];if(_0x1bcb35[_0xddf4('0x37')][_0xddf4('0x46')]){_0x59d876[_0xddf4('0x47')]=[{'all':!![]}];}_0x59d876=_[_0xddf4('0x42')]({},_0x59d876,_0x1bcb35['options']);return db[_0xddf4('0x32')][_0xddf4('0x4e')](_0x59d876)['then'](handleEntityNotFound(_0x284134,null))['then'](respondWithResult(_0x284134,null))[_0xddf4('0x4a')](handleError(_0x284134,null));};exports['create']=function(_0x288c8a,_0x27b30a){return db[_0xddf4('0x32')][_0xddf4('0x4f')](_0x288c8a['body'],{})[_0xddf4('0x2b')](respondWithResult(_0x27b30a,0xc9))[_0xddf4('0x4a')](handleError(_0x27b30a,null));};exports['clone']=function(_0x3943dc,_0x5b1552){var _0x203eed={'where':{'id':_0x3943dc[_0xddf4('0x4b')]['id']}},_0x1efc8d={};_0x1efc8d['model']=_[_0xddf4('0x4c')](db['UserProfile'][_0xddf4('0x33')]);_0x203eed['attributes']=_[_0xddf4('0x4d')](_0x1efc8d[_0xddf4('0x36')],qs[_0xddf4('0x39')](_0x3943dc[_0xddf4('0x37')][_0xddf4('0x39')]));_0x203eed['attributes']=_0x203eed[_0xddf4('0x3a')][_0xddf4('0x3b')]?_0x203eed[_0xddf4('0x3a')]:_0x1efc8d['model'];if(_0x3943dc[_0xddf4('0x37')]['includeAll']){_0x203eed[_0xddf4('0x47')]=[{'all':!![]}];}_0x203eed=_[_0xddf4('0x42')]({},_0x203eed,_0x3943dc[_0xddf4('0x45')]);return db[_0xddf4('0x32')][_0xddf4('0x4e')](_0x203eed)[_0xddf4('0x2b')](handleEntityNotFound(_0x5b1552,null))['then'](function(_0x193a18){if(_0x193a18){var _0x2a58c8=_0x193a18[_0xddf4('0x50')]({'plain':!![]});_0x2a58c8=qs['omit'](_0x2a58c8,['id',_0xddf4('0x51'),_0xddf4('0x52'),_0xddf4('0x53')]);_0x3943dc[_0xddf4('0x54')]=_[_0xddf4('0x55')](_0x3943dc['body'],['id','createdAt','updatedAt']);return db[_0xddf4('0x56')][_0xddf4('0x57')](function(_0x29dc36){return db[_0xddf4('0x32')][_0xddf4('0x4f')](_['merge'](_0x2a58c8,_0x3943dc[_0xddf4('0x54')]),{'include':_0x3943dc[_0xddf4('0x37')][_0xddf4('0x46')]?[{'all':!![]}]:undefined,'transaction':_0x29dc36})['then'](function(_0x364812){var _0x3fb248=_0x364812[_0xddf4('0x50')]({'plain':!![]});return db['UserProfileSection'][_0xddf4('0x48')]({'where':{'userProfileId':_0x3943dc[_0xddf4('0x4b')]['id']},'raw':!![]})['then'](function(_0x30ae8a){if(_0x30ae8a){return BPromise[_0xddf4('0x58')](_0x30ae8a,function(_0x3e9d8a){return new BPromise(function(_0x1d06ea,_0x11893f){if(_0x3e9d8a['autoAssociation']===null||_0x3e9d8a[_0xddf4('0x59')]===0x1)_0x1d06ea(null);return db[_0xddf4('0x5a')][_0xddf4('0x48')]({'where':{'sectionId':_0x3e9d8a['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x4c2080){var _0x32dfbf=_[_0xddf4('0x43')](_0x4c2080,function(_0x2eca89){return qs[_0xddf4('0x55')](_0x2eca89,['id',_0xddf4('0x51'),_0xddf4('0x52'),_0xddf4('0x5b')]);});_0x1d06ea(_0x32dfbf);})[_0xddf4('0x4a')](function(_0x90745b){_0x11893f(_0x90745b);});})[_0xddf4('0x2b')](function(_0x21db53){var _0x605e2c=qs['omit'](_0x3e9d8a,['id',_0xddf4('0x51'),'updatedAt']);_0x605e2c['userProfileId']=_0x3fb248['id'];if(_0x21db53)_0x605e2c[_0xddf4('0x5c')]=_0x21db53;return _0x605e2c;})['then'](function(_0x48d54a){return db[_0xddf4('0x5d')][_0xddf4('0x4f')](_0x48d54a,{'include':[{'model':db[_0xddf4('0x5a')],'as':_0xddf4('0x5c')}],'raw':!![],'transaction':_0x29dc36});});})[_0xddf4('0x2b')](function(){return _0x3fb248;});}});});});}})['then'](respondWithResult(_0x5b1552,0xc9))['catch'](handleError(_0x5b1552,null));};exports[_0xddf4('0x2a')]=function(_0x545cf8,_0x42ff2a){if(_0x545cf8[_0xddf4('0x54')]['id']){delete _0x545cf8['body']['id'];}return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x545cf8[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x42ff2a,null))[_0xddf4('0x2b')](saveUpdates(_0x545cf8[_0xddf4('0x54')],null))['then'](respondWithResult(_0x42ff2a,null))['catch'](handleError(_0x42ff2a,null));};exports['destroy']=function(_0x4a5837,_0x223028){return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x4a5837[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x223028,null))[_0xddf4('0x2b')](removeEntity(_0x223028,null))[_0xddf4('0x4a')](handleError(_0x223028,null));};exports['describe']=function(_0x82d699,_0x313551){return db[_0xddf4('0x32')]['describe']()[_0xddf4('0x2b')](respondWithResult(_0x313551,null))['catch'](handleError(_0x313551,null));};exports[_0xddf4('0x5e')]=function(_0x48f6c5,_0x1c480a){var _0xcef0c2=_0x48f6c5[_0xddf4('0x54')];return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x48f6c5[_0xddf4('0x4b')]['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x1c480a,null))[_0xddf4('0x2b')](function(_0x38e3a6){if(_0x38e3a6){return db[_0xddf4('0x56')][_0xddf4('0x57')](function(_0x37b462){return db[_0xddf4('0x5d')][_0xddf4('0x5f')]({'where':{'userProfileId':_0x48f6c5[_0xddf4('0x4b')]['id'],'sectionId':_[_0xddf4('0x43')](_0xcef0c2,function(_0x353c30){return _0x353c30['sectionId'];})},'transaction':_0x37b462})['then'](function(){var _0x33f4b3=_[_0xddf4('0x43')](_0xcef0c2,function(_0x1a700b){_0x1a700b[_0xddf4('0x60')]=_0x48f6c5[_0xddf4('0x4b')]['id'];return _0x1a700b;});var _0x446f12=[];return BPromise['each'](_0x33f4b3,function(_0x397b25){return db[_0xddf4('0x5d')][_0xddf4('0x4f')](_0x397b25,{'include':[{'model':db['UserProfileResource'],'as':_0xddf4('0x5c')}],'raw':!![],'transaction':_0x37b462})[_0xddf4('0x2b')](function(_0xd71e22){_0x446f12[_0xddf4('0x61')](_0xd71e22[_0xddf4('0x50')]({'plain':!![]}));});})[_0xddf4('0x2b')](function(){return _0x446f12;});});});}})[_0xddf4('0x2b')](function(_0x53619b){return _0x53619b;})[_0xddf4('0x2b')](respondWithResult(_0x1c480a,null))[_0xddf4('0x4a')](handleError(_0x1c480a,null));};exports[_0xddf4('0x62')]=function(_0x21efbe,_0x58dc5b){var _0x525548;return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x21efbe['params']['id']},'attributes':['id',_0xddf4('0x30')]})[_0xddf4('0x2b')](handleEntityNotFound(_0x58dc5b,null))[_0xddf4('0x2b')](function(_0x1b83ca){if(_0x1b83ca){_0x525548=_0x1b83ca;return db[_0xddf4('0x5d')]['destroy']({'where':{'userProfileId':_0x21efbe['params']['id'],'sectionId':_0x21efbe[_0xddf4('0x37')][_0xddf4('0x63')]}});}})['then'](function(){return _0x525548;})[_0xddf4('0x2b')](respondWithStatusCode(_0x58dc5b,null))[_0xddf4('0x4a')](handleError(_0x58dc5b,null));};exports['getSections']=function(_0x2572da,_0x536dc2){var _0x44d0b3=[];var _0x589ccc=[];return db[_0xddf4('0x5d')]['findAll']({'where':{'userProfileId':_0x2572da['params']['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x7cd11d){_0x44d0b3=_[_0xddf4('0x41')](_0x7cd11d,function(_0x49d894){return _0x49d894[_0xddf4('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x49d894[_0xddf4('0x5b')]);});if(!_['isEmpty'](_0x44d0b3)){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x4d5d0a){return _0x4d5d0a[_0xddf4('0x5b')];});}else{return;}})[_0xddf4('0x2b')](function(_0x5bffb4){if(_0x5bffb4)_0x589ccc=_0x5bffb4;if(_[_0xddf4('0x65')](_0x589ccc,0x64)){var _0x1b98d6=_['find'](_0x44d0b3,{'sectionId':0x64});return hasDefaultDashboard(_0x1b98d6)[_0xddf4('0x2b')](function(_0x2af3bd){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x31a74b){if(_0x31a74b[_0xddf4('0x5b')]===0x64){_0x31a74b[_0xddf4('0x66')]=_0x2af3bd;}return _0x31a74b;});});}else{return;}})['then'](function(_0x3f6d68){if(_0x3f6d68)_0x44d0b3=_0x3f6d68;if(_['includes'](_0x589ccc,0x3eb)){var _0x1f769a=_[_0xddf4('0x4e')](_0x44d0b3,{'sectionId':0x3eb});return getCustomDashboards(_0x1f769a)[_0xddf4('0x2b')](function(_0x4ffd49){return _[_0xddf4('0x43')](_0x44d0b3,function(_0x3a5ea7){if(_0x1f769a[_0xddf4('0x64')]){if(_0x3a5ea7['sectionId']===0x3eb){_0x3a5ea7[_0xddf4('0x66')]=_0x4ffd49;}}else{if(_0x3a5ea7[_0xddf4('0x5b')]===0x64){_0x3a5ea7[_0xddf4('0x66')]=_0x4ffd49;}}return _0x3a5ea7;});});}else{return;}})[_0xddf4('0x2b')](function(_0x4d20fa){if(_0x4d20fa)_0x44d0b3=_0x4d20fa;if(_[_0xddf4('0x65')](_0x589ccc,0x709)){var _0x579f66=_[_0xddf4('0x4e')](_0x44d0b3,{'sectionId':0x709});return getPlugins(_0x579f66)[_0xddf4('0x2b')](function(_0xa771f4){if(_0x579f66[_0xddf4('0x64')]){return _['map'](_0x44d0b3,function(_0x436cee){if(_0x436cee['sectionId']===0x709){_0x436cee['subsections']=_0xa771f4;}return _0x436cee;});}else{var _0x453932={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa771f4};var _0x2c431c=_[_0xddf4('0x43')](_0x44d0b3);_0x2c431c[_0xddf4('0x61')](_0x453932);return _0x2c431c;}});}else{return;}})[_0xddf4('0x2b')](function(_0x46d3ec){if(_0x46d3ec)_0x44d0b3=_0x46d3ec;return _[_0xddf4('0x41')](_0x44d0b3,['enabled',0x1]);})[_0xddf4('0x2b')](respondWithResult(_0x536dc2,null))[_0xddf4('0x4a')](handleError(_0x536dc2,null));};function hasDefaultDashboard(_0x357d09){var _0xa687cb=[0x65];return new BPromise(function(_0x1b98be,_0x226dfa){try{if(_0x357d09['autoAssociation']){_0x1b98be(_0xa687cb);}else{return db[_0xddf4('0x5a')][_0xddf4('0x67')]({'where':{'sectionId':_0x357d09['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x57dbf2){_0x57dbf2?_0x1b98be(_0xa687cb):_0x1b98be();});}}catch(_0x162f99){_0x226dfa(_0x162f99);}});}function getCustomDashboards(_0x3414fe){var _0x1caf26=[];return new BPromise(function(_0xb4f02,_0x1d4e7b){try{if(_0x3414fe['autoAssociation']){return db[_0xddf4('0x68')][_0xddf4('0x48')]({'raw':!![]})[_0xddf4('0x2b')](function(_0x233e74){_0x233e74[_0xddf4('0x69')](function(_0x327a6a){_0x1caf26[_0xddf4('0x61')](_0x327a6a['id']+0x1869f);});_0xb4f02(_0x1caf26);});}else{return db['UserProfileResource'][_0xddf4('0x48')]({'where':{'sectionId':_0x3414fe['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0xbdd3f2){_0xbdd3f2[_0xddf4('0x69')](function(_0x29f726){_0x1caf26[_0xddf4('0x61')](_0x29f726[_0xddf4('0x6a')]+0x1869f);});_0xb4f02(_0x1caf26);});}}catch(_0x5a4fc9){_0x1d4e7b(_0x5a4fc9);}});}function getPlugins(_0x131ce4){var _0x1bd8fb=[];return new BPromise(function(_0xa0e1cf,_0x107c2f){try{if(_0x131ce4[_0xddf4('0x59')]){return db[_0xddf4('0x6b')][_0xddf4('0x48')]({'raw':!![]})[_0xddf4('0x2b')](function(_0x19c91b){_0x19c91b[_0xddf4('0x69')](function(_0xb9976c){_0x1bd8fb[_0xddf4('0x61')](_0xb9976c['id']+0x15b38);});_0xa0e1cf(_0x1bd8fb);});}else{return db[_0xddf4('0x5a')][_0xddf4('0x48')]({'where':{'sectionId':_0x131ce4['id']},'raw':!![]})[_0xddf4('0x2b')](function(_0x598bde){_0x598bde[_0xddf4('0x69')](function(_0x370ae5){_0x1bd8fb[_0xddf4('0x61')](_0x370ae5[_0xddf4('0x6a')]+0x15b38);});_0xa0e1cf(_0x1bd8fb);});}}catch(_0xd0ba87){_0x107c2f(_0xd0ba87);}});}exports['addResources']=function(_0x474a38,_0xa815b0){return db[_0xddf4('0x32')][_0xddf4('0x4e')]({'where':{'id':_0x474a38['params']['id']}})['then'](handleEntityNotFound(_0xa815b0,null))[_0xddf4('0x2b')](function(_0x2adfe5){if(_0x2adfe5){return db[_0xddf4('0x56')]['transaction'](function(_0x2ad6e5){return db['UserProfileSection'][_0xddf4('0x48')]({'where':{'userProfileId':_0x474a38['params']['id']},'attributes':['id'],'raw':!![]})[_0xddf4('0x2b')](function(_0xbd1c13){if(_0xbd1c13){return db[_0xddf4('0x5d')][_0xddf4('0x5f')]({'where':{'userProfileId':_0x474a38[_0xddf4('0x4b')]['id'],'id':_['map'](_0xbd1c13,function(_0x272f73){return _0x272f73['id'];})},'transaction':_0x2ad6e5});}})[_0xddf4('0x2b')](function(_0x2a1c01){var _0x168b08=_[_0xddf4('0x43')](_0x474a38['body'],function(_0x13045f){_0x13045f[_0xddf4('0x60')]=_0x474a38['params']['id'];return _0x13045f;});return db[_0xddf4('0x5d')][_0xddf4('0x6c')](_0x168b08,{'raw':!![],'transaction':_0x2ad6e5});})[_0xddf4('0x2b')](function(_0x1bd078){var _0x15c09b=_[_0xddf4('0x41')](_[_0xddf4('0x43')](_0x1bd078,function(_0xcf9229){return _0xcf9229['get']({'plain':!![]});}),{'includeAll':![]});if(_0x15c09b){return db[_0xddf4('0x5d')][_0xddf4('0x48')]({'where':{'userProfileId':_0x474a38['params']['id'],'sectionId':_[_0xddf4('0x43')](_0x15c09b,function(_0x4ff838){return _0x4ff838[_0xddf4('0x5b')];})},'attributes':['id',_0xddf4('0x5b')],'raw':!![]})[_0xddf4('0x2b')](function(_0x3481cc){var _0x73a093=_['map'](_0x474a38[_0xddf4('0x54')],function(_0x1c590b){_0x1c590b[_0xddf4('0x60')]=_0x474a38['params']['id'];return _0x1c590b;});return db['UserProfileResource'][_0xddf4('0x6c')](_0x73a093,{'raw':!![],'transaction':_0x2ad6e5});});}})[_0xddf4('0x4a')](handleError(_0xa815b0,null));});}})['then'](function(_0x29477f){var _0x37d6b5=_[_0xddf4('0x43')](_0x29477f,function(_0xadd6e8){return _0xadd6e8[_0xddf4('0x50')]({'plain':!![]});});})[_0xddf4('0x2b')](respondWithResult(_0xa815b0,null))[_0xddf4('0x4a')](handleError(_0xa815b0,null));};exports[_0xddf4('0x6d')]=function(_0x527217,_0x31ced0,_0x3b00e8){return db['UserProfile'][_0xddf4('0x4e')]({'where':{'id':_0x527217['params']['id']}})[_0xddf4('0x2b')](handleEntityNotFound(_0x31ced0,null))[_0xddf4('0x2b')](function(_0x49d378){if(_0x49d378){return _0x49d378['removeResources'](_0x527217[_0xddf4('0x37')][_0xddf4('0x63')]);}})['then'](respondWithStatusCode(_0x31ced0,null))[_0xddf4('0x4a')](handleError(_0x31ced0,null));};exports['getResources']=function(_0x313052,_0x437188){var _0x135298={};if(!_0x313052[_0xddf4('0x37')][_0xddf4('0x6e')])throw new Error(_0xddf4('0x6f'));if(!_0x313052[_0xddf4('0x37')][_0xddf4('0x3c')](_0xddf4('0x3d'))){_0x135298['limit']=qs[_0xddf4('0x24')](_0x313052[_0xddf4('0x37')][_0xddf4('0x24')]);_0x135298['offset']=qs[_0xddf4('0x21')](_0x313052[_0xddf4('0x37')]['offset']);}return db[_0xddf4('0x32')]['find']({'where':{'id':_0x313052[_0xddf4('0x4b')]['id']}})['then'](function(_0x295783){if(!_0x295783)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x313052['params']['id']);return db[_0xddf4('0x32')][_0xddf4('0x70')](_0x313052);})[_0xddf4('0x2b')](respondWithFilteredResult(_0x437188,_0x135298))['catch'](handleError(_0x437188,null));};
\ No newline at end of file
index 7f2bc6e..3e22b03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5af=['emit','exports','../../mysqldb','UserProfile','save','update','remove'];(function(_0x4f0ef2,_0x15939b){var _0xdb3aa9=function(_0x1c480d){while(--_0x1c480d){_0x4f0ef2['push'](_0x4f0ef2['shift']());}};_0xdb3aa9(++_0x15939b);}(_0xe5af,0x9c));var _0xfe5a=function(_0x38a3f8,_0x3482ec){_0x38a3f8=_0x38a3f8-0x0;var _0x2a8ac1=_0xe5af[_0x38a3f8];return _0x2a8ac1;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xfe5a('0x0'))['db'][_0xfe5a('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfe5a('0x2'),'afterUpdate':_0xfe5a('0x3'),'afterDestroy':_0xfe5a('0x4')};function emitEvent(_0x4adbd1){return function(_0x1165e3,_0x48e3a7,_0x526677){UserProfileEvents[_0xfe5a('0x5')](_0x4adbd1+':'+_0x1165e3['id'],_0x1165e3);UserProfileEvents[_0xfe5a('0x5')](_0x4adbd1,_0x1165e3);_0x526677(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xfe5a('0x6')]=UserProfileEvents;
\ No newline at end of file
+var _0xe6e9=['../../mysqldb','UserProfile','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0xe6e9,0x182));var _0x9e6e=function(_0x6a49c9,_0x15b9e9){_0x6a49c9=_0x6a49c9-0x0;var _0x1bbb5c=_0xe6e9[_0x6a49c9];return _0x1bbb5c;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var UserProfile=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){UserProfileEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);UserProfileEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];UserProfile[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
index 81e5fdc..eecfe26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961b=['resourceId','catch','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','parentSections','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','ChatWebsite','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','agent','Telephones','membername','User','role','telephone','VoiceQueues','queue','VoiceQueue','type','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','VoicePrefix','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','admin','user','zendeskaccounts','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','Pause','scheduler','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','metrics','AnalyticMetric','toUpperCase','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','raw','section','Invalid\x20section\x20\x27','isEmpty','push','UserProfileSection','find','all','ignore','length','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','where','pick','filters','merge','key','VIRTUAL','foreignKey','options','autoAssociation','includeAll','forEach','default','reportId','DefaultReports','CustomReports','count','ids','customSorting','extraQueryConditions','include','Tags','tag','color','Agents','openTabs','chat','rows','sms','dataValues','fax','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','exports','filter','field','findAll','associatedResources','map','model','then','name','resolve','AnalyticExtractedReport'];(function(_0x20abeb,_0x1f690c){var _0x47d787=function(_0x1f3429){while(--_0x1f3429){_0x20abeb['push'](_0x20abeb['shift']());}};_0x47d787(++_0x1f690c);}(_0x961b,0x17a));var _0xb961=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x961b[_0x18abd2];return _0x1dcad6;};'use strict';var _=require(_0xb961('0x0'));var attributes=require(_0xb961('0x1'));var qs=require(_0xb961('0x2'));var squel=require('squel');module[_0xb961('0x3')]=function(_0x42277a){var _0x22bda2=_0x42277a['models'];function _0x5388c6(_0x3571f3,_0x1cffc9){return new Promise(function(_0x1bca9f,_0x17674a){if(!_0x1cffc9)return _0x1bca9f(null);var _0x396990=_0x1cffc9[_0xb961('0x4')]?{[_0x1cffc9[_0xb961('0x4')][_0xb961('0x5')]]:_0x1cffc9[_0xb961('0x4')]['value']}:undefined;return _0x22bda2[_0x3571f3][_0xb961('0x6')]({'where':_0x396990,'raw':!![]})['then'](function(_0x31af84){_0x1cffc9[_0xb961('0x7')]=_[_0xb961('0x8')](_0x31af84,'id');_0x1bca9f(_0x1cffc9);})['catch'](function(_0x5a6db8){_0x17674a(_0x5a6db8);});});}function _0x2639af(_0x3c58c6,_0x5d097a){return new Promise(function(_0x1ee6a9,_0x18cccc){var _0x170409=_0x3c58c6['filter']?{[_0x3c58c6[_0xb961('0x4')][_0xb961('0x5')]]:_0x3c58c6[_0xb961('0x4')]['value']}:undefined;return _0x22bda2[_0x3c58c6[_0xb961('0x9')]][_0xb961('0x6')]({'where':_0x170409,'raw':!![]})[_0xb961('0xa')](function(_0x5d223b){_0x5d097a[_0xb961('0x7')]=_[_0xb961('0x8')](_0x5d223b,function(_0x1f4697){return _0x1f4697[_0xb961('0xb')];});_0x1ee6a9(_0x5d097a);})['catch'](function(_0x3631c4){_0x18cccc(_0x3631c4);});});}function _0x46e5cf(_0x335880,_0x1d4056,_0x43ba2d){if(!_0x1d4056)return Promise[_0xb961('0xc')](null);return new Promise(function(_0x1249e7,_0x3bfdef){return _0x22bda2['UserProfileResource'][_0xb961('0x6')]({'where':{'sectionId':_0x1d4056['id']},'raw':!![]})['then'](function(_0x9a43a4){if(_0x335880[_0xb961('0x5')]&&_0x335880[_0xb961('0x5')]!=='id'){_0x1d4056[_0xb961('0x7')]=_['map'](_0x9a43a4,function(_0x107323){return _0x107323[_0x335880['field']];});}else{if(_0x43ba2d===_0xb961('0xd')){_0x1d4056['associatedResources']=_[_0xb961('0x8')](_0x9a43a4,function(_0x21de1e){return{'id':_0x21de1e[_0xb961('0xe')],'type':_0x21de1e['type']};});}else{_0x1d4056[_0xb961('0x7')]=_[_0xb961('0x8')](_0x9a43a4,function(_0x552b0d){return _0x552b0d[_0xb961('0xe')];});}}_0x1249e7(_0x1d4056);})[_0xb961('0xf')](function(_0x24e987){_0x3bfdef(_0x24e987);});});}function _0x102e1e(_0x551e04,_0x2938d6){var _0x559ba6={'parentSections':[]};switch(_0x551e04[_0xb961('0x10')]()){case _0xb961('0x11'):_0x559ba6[_0xb961('0x12')]='SquareProject';break;case _0xb961('0x13'):_0x559ba6['childModel']=_0xb961('0x14');break;case'squarerecordings':_0x559ba6['childModel']=_0xb961('0x15');_0x559ba6['parentSections']=[{'name':_0xb961('0x16'),'field':'name','foreignKey':_0xb961('0x17')}];break;case _0xb961('0x18'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x19');break;case _0xb961('0x1a'):_0x559ba6['childModel']=_0xb961('0x1b');_0x559ba6[_0xb961('0x1c')]=[{'name':_0xb961('0x1d'),'field':'id','foreignKey':_0xb961('0x1e')}];break;case _0xb961('0x1f'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x20');break;case'companies':_0x559ba6[_0xb961('0x12')]=_0xb961('0x21');break;case _0xb961('0x22'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x23');break;case _0xb961('0x24'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x25');break;case'chatwebsites':_0x559ba6['childModel']=_0xb961('0x26');break;case _0xb961('0x27'):_0x559ba6['childModel']=_0xb961('0x28');break;case _0xb961('0x29'):_0x559ba6[_0xb961('0x12')]='FaxAccount';break;case _0xb961('0x2a'):case _0xb961('0x2b'):case _0xb961('0x2c'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x2d');break;case _0xb961('0x2e'):_0x559ba6[_0xb961('0x12')]='VoiceContext';break;case _0xb961('0x2f'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x30');break;case _0xb961('0x31'):_0x559ba6['childModel']='VoiceRecording';_0x559ba6[_0xb961('0x1c')]=[{'name':'Agents','field':'name','foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0xb961('0x32')]}},{'name':_0xb961('0x33'),'field':_0xb961('0xb'),'foreignKey':_0xb961('0x34'),'model':_0xb961('0x35'),'filter':{'field':_0xb961('0x36'),'value':[_0xb961('0x37')]}},{'name':_0xb961('0x38'),'field':_0xb961('0xb'),'foreignKey':_0xb961('0x39'),'model':_0xb961('0x3a'),'filter':{'field':_0xb961('0x3b'),'value':['inbound']}},{'name':_0xb961('0x3c'),'field':_0xb961('0xb'),'foreignKey':_0xb961('0x39'),'model':_0xb961('0x3a'),'filter':{'field':'type','value':[_0xb961('0x3d')]}}];break;case _0xb961('0x3e'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x3f');break;case _0xb961('0x40'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x41');break;case'voiceprefixes':_0x559ba6[_0xb961('0x12')]=_0xb961('0x42');break;case'ivrcampaigns':_0x559ba6[_0xb961('0x12')]=_0xb961('0x43');break;case _0xb961('0x44'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x45');break;case _0xb961('0x46'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x47');break;case _0xb961('0x48'):_0x559ba6['childModel']=_0xb961('0x49');break;case'openchannelqueues':_0x559ba6[_0xb961('0x12')]=_0xb961('0x4a');break;case _0xb961('0x4b'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x4c');break;case _0xb961('0x4d'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x4e');break;case _0xb961('0x4f'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x50');break;case _0xb961('0x51'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x52');break;case _0xb961('0x53'):_0x559ba6['childModel']=_0xb961('0x54');break;case _0xb961('0x55'):_0x559ba6['childModel']=_0xb961('0x56');break;case _0xb961('0x57'):case _0xb961('0x58'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x3a');if(_0x2938d6){_0x559ba6[_0xb961('0x1c')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0xb961('0x59'):case'agents':case _0xb961('0x5a'):_0x559ba6['childModel']=_0xb961('0x35');if(_0x2938d6){_0x559ba6[_0xb961('0x1c')]=[{'name':_0xb961('0x5b'),'filter':{'field':_0xb961('0x36'),'value':[_0xb961('0x5c'),_0xb961('0x5d')]},'ignore':!![]},{'name':'Agents'},{'name':_0xb961('0x33')}];}break;case _0xb961('0x5e'):_0x559ba6[_0xb961('0x12')]='ZendeskAccount';break;case'salesforceaccounts':_0x559ba6['childModel']=_0xb961('0x5f');break;case'freshdeskaccounts':_0x559ba6['childModel']='FreshdeskAccount';break;case _0xb961('0x60'):_0x559ba6['childModel']=_0xb961('0x61');break;case'deskaccounts':_0x559ba6[_0xb961('0x12')]=_0xb961('0x62');break;case _0xb961('0x63'):_0x559ba6[_0xb961('0x12')]='ZohoAccount';break;case _0xb961('0x64'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x35');break;case'cannedanswers':_0x559ba6[_0xb961('0x12')]=_0xb961('0x65');break;case _0xb961('0x66'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x67');break;case _0xb961('0x68'):_0x559ba6['childModel']=_0xb961('0x69');break;case _0xb961('0x6a'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x6b');break;case'pauses':_0x559ba6['childModel']=_0xb961('0x6c');break;case _0xb961('0x6d'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x6e');break;case _0xb961('0x6f'):_0x559ba6['childModel']=_0xb961('0x70');break;case _0xb961('0x71'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x72');break;case _0xb961('0x73'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x74');break;case _0xb961('0x75'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x76');break;case _0xb961('0x77'):_0x559ba6['childModel']=_0xb961('0x78');break;case _0xb961('0x79'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x7a');break;case _0xb961('0x7b'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x7c');break;case'extractedreports':_0x559ba6[_0xb961('0x12')]=_0xb961('0xd');_0x559ba6[_0xb961('0x1c')]=[{'name':_0xb961('0x7d'),'field':'id','foreignKey':'reportId'}];break;case _0xb961('0x7e'):_0x559ba6[_0xb961('0x12')]=_0xb961('0x7f');break;}return _0x559ba6;}function _0x15f89c(_0x44a329,_0x42f1b4){var _0x4657aa=_0x44a329['charAt'](0x0)[_0xb961('0x80')]()+_0x44a329['slice'](0x1);var _0x883b74={'type':_0x22bda2['Sequelize'][_0xb961('0x81')][_0xb961('0x82')],'raw':!![]};return new Promise(function(_0x298581,_0x1f1652){var _0x2c8c09=squel[_0xb961('0x83')]()[_0xb961('0x5')](_0xb961('0x84')+_0x4657aa+_0xb961('0x85'),'id')[_0xb961('0x5')](_0xb961('0x86'))[_0xb961('0x87')](_0xb961('0x88')+_0x44a329+_0xb961('0x89'),'ui')['where']('ui.UserId\x20=\x20?',_0x42f1b4['id']);return _0x22bda2[_0xb961('0x8a')][_0xb961('0x8b')](_0x2c8c09[_0xb961('0x8c')](),_0x883b74)[_0xb961('0xa')](function(_0x46d9bd){_0x42f1b4[_0x4657aa+_0xb961('0x8d')]=_0x46d9bd;_0x298581(_0x46d9bd);})[_0xb961('0xf')](function(_0x5a61ff){_0x1f1652(_0x5a61ff);});});}return _0x42277a['define'](_0xb961('0x8e'),attributes,{'tableName':_0xb961('0x8f'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x226819){var _0x55e093={'raw':_0x226819[_0xb961('0x8b')][_0xb961('0x90')],'where':{}};var _0x17d0d4={};var _0x4661ca={'count':0x0,'rows':[]};var _0x12f397=_0x226819[_0xb961('0x8b')][_0xb961('0x91')];var _0x3aed8a=_0x226819['query']['mergeResources']||![];var _0x3a158c=_0x102e1e(_0x12f397,_0x3aed8a);if(!_0x3a158c['childModel'])throw new Error(_0xb961('0x92')+_0x12f397+'\x27');var _0x479322=[{'name':_0x12f397}];if(!_[_0xb961('0x93')](_0x3a158c['parentSections']))_0x479322=_0x3a158c[_0xb961('0x1c')];var _0x30f461=[];for(var _0x45f18a=0x0;_0x45f18a<_0x479322['length'];_0x45f18a++){_0x30f461[_0xb961('0x94')](_0x22bda2[_0xb961('0x95')][_0xb961('0x96')]({'where':{'userProfileId':_0x226819['params']['id'],'name':_0x479322[_0x45f18a]['name']},'raw':!![]}));}return Promise[_0xb961('0x97')](_0x30f461)[_0xb961('0xa')](function(_0x1e4c07){var _0x22f68b=_['filter'](_0x1e4c07,function(_0x3b4087){return _0x3b4087?_0x3b4087:undefined;});var _0x1450e4=_['filter'](_0x479322,[_0xb961('0x98'),!![]]);var _0x59a065=_[_0xb961('0x93')](_0x22f68b)&&_['isEmpty'](_0x1450e4)?null:_['union'](_0x1450e4,_0x22f68b);if(!_0x59a065)return null;var _0x43cbd9=[];for(var _0x1f2f3c=0x0;_0x1f2f3c<_0x59a065['length'];_0x1f2f3c++){var _0x170267=_[_0xb961('0x96')](_0x479322,function(_0x41043d){return _0x59a065[_0x1f2f3c]?_0x41043d['name']===_0x59a065[_0x1f2f3c][_0xb961('0xb')]:null;});if(_0x170267){if(_0x59a065[_0x1f2f3c][_0xb961('0x98')]){_0x43cbd9['push'](_0x5388c6(_0x3a158c[_0xb961('0x12')],_0x59a065[_0x1f2f3c]));}else{if(!_0x59a065[_0x1f2f3c]['autoAssociation']){_0x43cbd9[_0xb961('0x94')](_0x46e5cf(_0x170267,_0x59a065[_0x1f2f3c],_0x3a158c[_0xb961('0x12')]));}else{if(_0x170267['model']){_0x43cbd9[_0xb961('0x94')](_0x2639af(_0x170267,_0x59a065[_0x1f2f3c]));}}}}}return Promise['all'](_0x43cbd9);})['then'](function(_0x2f5f40){var _0x3e750d=_0x2f5f40;var _0x553074=null;if(_0x3e750d){_0x553074=_0x3e750d[_0xb961('0x99')]===0x1?_0x3e750d[0x0]:null;}if(!_0x553074&&!_0x3e750d)return _0x4661ca;var _0x5571f5=_0x22bda2[_0x3a158c[_0xb961('0x12')]][_0xb961('0x9a')];_0x17d0d4[_0xb961('0x9')]=_[_0xb961('0x9b')](_0x5571f5);_0x17d0d4[_0xb961('0x8b')]=_[_0xb961('0x9b')](_0x226819[_0xb961('0x8b')]);_0x17d0d4['filters']=_[_0xb961('0x9c')](_0x17d0d4[_0xb961('0x9')],_0x17d0d4[_0xb961('0x8b')]);_0x55e093[_0xb961('0x9d')]=_[_0xb961('0x9c')](_0x17d0d4[_0xb961('0x9')],qs[_0xb961('0x9e')](_0x226819[_0xb961('0x8b')][_0xb961('0x9e')]));_0x55e093[_0xb961('0x9d')]=_0x55e093[_0xb961('0x9d')][_0xb961('0x99')]?_0x55e093[_0xb961('0x9d')]:_0x17d0d4['model'];if(!_0x226819[_0xb961('0x8b')][_0xb961('0x9f')](_0xb961('0xa0'))){_0x55e093[_0xb961('0xa1')]=qs[_0xb961('0xa1')](_0x226819['query'][_0xb961('0xa1')]);_0x55e093[_0xb961('0xa2')]=qs[_0xb961('0xa2')](_0x226819[_0xb961('0x8b')][_0xb961('0xa2')]);}_0x55e093['order']=qs[_0xb961('0xa3')](_0x226819[_0xb961('0x8b')][_0xb961('0xa3')]);_0x55e093[_0xb961('0xa4')]=qs['filters'](_[_0xb961('0xa5')](_0x226819['query'],_0x17d0d4[_0xb961('0xa6')]));if(_0x226819[_0xb961('0x8b')][_0xb961('0x4')]){_0x55e093[_0xb961('0xa4')]=_[_0xb961('0xa7')](_0x55e093[_0xb961('0xa4')],{'$or':_[_0xb961('0x8')](_0x5571f5,function(_0x119cd3){if(_0x119cd3[_0xb961('0x3b')][_0xb961('0xa8')]!==_0xb961('0xa9')){var _0x70a539={};_0x70a539[_0x119cd3['field']]={'$like':'%'+_0x226819['query'][_0xb961('0x4')]+'%'};return _0x70a539;}})});}var _0x15768f=[];var _0x1e40d1=null;var _0x235b3b={};if(_0x553074){_0x1e40d1=_[_0xb961('0x96')](_0x479322,[_0xb961('0xb'),_0x553074[_0xb961('0xb')]]);if(_0x1e40d1[_0xb961('0x5')]){_0x235b3b={};if(_0x3a158c[_0xb961('0x12')]==='AnalyticExtractedReport'){_0x235b3b[_0x1e40d1[_0xb961('0xaa')]]=_[_0xb961('0x8')](_0x553074[_0xb961('0x7')],'id');}else{_0x235b3b[_0x1e40d1[_0xb961('0xaa')]]=_0x553074[_0xb961('0x7')];}_0x15768f[_0xb961('0x94')](_0x235b3b);}else{_0x55e093[_0xb961('0xa4')]['id']=_0x553074[_0xb961('0x7')];}}else{for(var _0x4700c1=0x0;_0x4700c1<_0x3e750d[_0xb961('0x99')];_0x4700c1++){_0x1e40d1=_[_0xb961('0x96')](_0x479322,['name',_0x3e750d[_0x4700c1][_0xb961('0xb')]]);if(_0x1e40d1['field']){_0x235b3b={};_0x235b3b[_0x1e40d1[_0xb961('0xaa')]]=_0x3e750d[_0x4700c1][_0xb961('0x7')];_0x15768f['push'](_0x235b3b);}else{if(!_0x55e093['where']['id'])_0x55e093['where']['id']=[];_0x3e750d[_0x4700c1][_0xb961('0x7')]['forEach'](function(_0x442bf6){_0x55e093[_0xb961('0xa4')]['id'][_0xb961('0x94')](_0x442bf6);});}}}if(!_[_0xb961('0x93')](_0x15768f)){_0x55e093[_0xb961('0xa4')]=_[_0xb961('0xa7')](_0x55e093[_0xb961('0xa4')],{'$and':{'$or':_0x15768f}});}_0x55e093=_[_0xb961('0xa7')]({},_0x55e093,_0x226819[_0xb961('0xab')]);if(_0x553074&&!_0x553074[_0xb961('0xac')]&&_0x3a158c[_0xb961('0x12')]===_0xb961('0xd')){if(_0x226819[_0xb961('0x8b')][_0xb961('0xad')]){_0x55e093['include']=[{'all':!![]}];}return _0x22bda2[_0x3a158c[_0xb961('0x12')]][_0xb961('0x6')](_0x55e093)[_0xb961('0xa')](function(_0x2a71e6){var _0x15c8ee=[];_0x2a71e6[_0xb961('0xae')](function(_0x7873c0){var _0x2ee38b;switch(_0x7873c0['reportType']){case _0xb961('0xaf'):_0x2ee38b=_[_0xb961('0x96')](_0x553074[_0xb961('0x7')],function(_0xadb43f){return _0xadb43f['id']===_0x7873c0[_0xb961('0xb0')]&&_0xadb43f[_0xb961('0x3b')]===_0xb961('0xb1');});break;case'custom':_0x2ee38b=_[_0xb961('0x96')](_0x553074[_0xb961('0x7')],function(_0x296946){return _0x296946['id']===_0x7873c0['reportId']&&_0x296946[_0xb961('0x3b')]===_0xb961('0xb2');});break;}if(_0x2ee38b)_0x15c8ee['push'](_0x7873c0);});_0x4661ca[_0xb961('0xb3')]=_0x15c8ee['length'];_0x4661ca['rows']=_0x15c8ee;return _0x4661ca;});}else{if(!_[_0xb961('0x93')](_0x226819[_0xb961('0x8b')][_0xb961('0xb4')])){_0x55e093[_0xb961('0xa4')]['id']=_0x55e093[_0xb961('0xa4')]['id']?_[_0xb961('0x9c')](_0x55e093[_0xb961('0xa4')]['id'],_0x226819[_0xb961('0x8b')][_0xb961('0xb4')]):_0x226819['query'][_0xb961('0xb4')];if(_0x226819[_0xb961('0x8b')]['customSorting']){_0x55e093['order']=_0x226819[_0xb961('0x8b')][_0xb961('0xb5')];}}if(_0x226819[_0xb961('0x8b')]['extraQueryConditions']){_0x55e093['where']=_[_0xb961('0xa7')](_0x55e093[_0xb961('0xa4')],{'$and':_0x226819['query'][_0xb961('0xb6')]});}return _0x22bda2[_0x3a158c[_0xb961('0x12')]][_0xb961('0xb3')]({'where':_0x55e093[_0xb961('0xa4')]})[_0xb961('0xa')](function(_0x166adb){_0x4661ca[_0xb961('0xb3')]=_0x166adb;if(_0x226819['query'][_0xb961('0xad')]){if(_0x3a158c[_0xb961('0x12')]==='CmContact'){_0x55e093[_0xb961('0xb7')]=[{'model':_0x22bda2[_0xb961('0x72')],'as':_0xb961('0xb8'),'attributes':['id',_0xb961('0xb'),'color'],'required':_0x226819[_0xb961('0x8b')][_0xb961('0xb9')]?!![]:![]},{'model':_0x22bda2[_0xb961('0x72')],'as':'ThroughTags','attributes':['id',_0xb961('0xb'),_0xb961('0xba')],'through':_0x226819[_0xb961('0x8b')]['tag']?{'attributes':[],'where':{'TagId':_0x226819[_0xb961('0x8b')][_0xb961('0xb9')]||undefined}}:{},'required':_0x226819[_0xb961('0x8b')][_0xb961('0xb9')]?!![]:![]}];}else{_0x55e093[_0xb961('0xb7')]=[{'all':!![]}];}}return _0x22bda2[_0x3a158c[_0xb961('0x12')]]['findAll'](_0x55e093);})['then'](function(_0x4e3f0c){_0x4661ca['rows']=_0x4e3f0c;if(_0x12f397===_0xb961('0xbb')&&_0x226819[_0xb961('0x8b')][_0xb961('0xbc')]==='true'){var _0x178b53=[];for(var _0x485f7b=0x0;_0x485f7b<_0x4661ca['rows'][_0xb961('0x99')];_0x485f7b++){_0x178b53[_0xb961('0x94')](_0x15f89c(_0xb961('0xbd'),_0x4661ca[_0xb961('0xbe')][_0x485f7b]['dataValues']));_0x178b53[_0xb961('0x94')](_0x15f89c(_0xb961('0xbf'),_0x4661ca[_0xb961('0xbe')][_0x485f7b][_0xb961('0xc0')]));_0x178b53[_0xb961('0x94')](_0x15f89c(_0xb961('0xc1'),_0x4661ca[_0xb961('0xbe')][_0x485f7b][_0xb961('0xc0')]));_0x178b53['push'](_0x15f89c(_0xb961('0xc2'),_0x4661ca[_0xb961('0xbe')][_0x485f7b][_0xb961('0xc0')]));_0x178b53[_0xb961('0x94')](_0x15f89c('openchannel',_0x4661ca['rows'][_0x485f7b][_0xb961('0xc0')]));_0x178b53[_0xb961('0x94')](_0x15f89c(_0xb961('0xc3'),_0x4661ca['rows'][_0x485f7b][_0xb961('0xc0')]));}return Promise['all'](_0x178b53)['then'](function(){return _0x4661ca;});}return _0x4661ca;});}});}}});};
\ No newline at end of file
+var _0xea23=['Pause','scheduler','Schedule','sounds','Sound','tags','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin','extractedreports','AnalyticExtractedReport','Reports','reportId','metrics','AnalyticMetric','slice','Sequelize','select','ui.','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','length','UserProfileSection','find','params','all','isEmpty','union','ignore','push','autoAssociation','rawAttributes','keys','intersection','attributes','fields','nolimit','limit','offset','order','sort','where','pick','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','custom','CustomReports','rows','ids','customSorting','extraQueryConditions','count','CmContact','Tags','color','ThroughTags','tag','openTabs','chat','sms','dataValues','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','catch','model','name','resolve','then','resourceId','toLowerCase','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','type','inbound','QueueCampaigns','VoiceQueue','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','Campaign','mailqueues','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','admin','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','vtigeraccounts','dispositions','Disposition','customdashboards','Interval','pauses'];(function(_0x1be790,_0x112549){var _0x7668c8=function(_0x47a470){while(--_0x47a470){_0x1be790['push'](_0x1be790['shift']());}};_0x7668c8(++_0x112549);}(_0xea23,0x1d6));var _0x3ea2=function(_0x34de6d,_0x467a83){_0x34de6d=_0x34de6d-0x0;var _0x59b40f=_0xea23[_0x34de6d];return _0x59b40f;};'use strict';var _=require(_0x3ea2('0x0'));var attributes=require(_0x3ea2('0x1'));var qs=require(_0x3ea2('0x2'));var squel=require(_0x3ea2('0x3'));module[_0x3ea2('0x4')]=function(_0xa60d5b){var _0x5040de=_0xa60d5b[_0x3ea2('0x5')];function _0x3fba50(_0x2e5057,_0xbbfa29){return new Promise(function(_0x2377a8,_0x2363d5){if(!_0xbbfa29)return _0x2377a8(null);var _0x4d8b31=_0xbbfa29[_0x3ea2('0x6')]?{[_0xbbfa29['filter'][_0x3ea2('0x7')]]:_0xbbfa29['filter'][_0x3ea2('0x8')]}:undefined;return _0x5040de[_0x2e5057][_0x3ea2('0x9')]({'where':_0x4d8b31,'raw':!![]})['then'](function(_0x12bdbf){_0xbbfa29[_0x3ea2('0xa')]=_[_0x3ea2('0xb')](_0x12bdbf,'id');_0x2377a8(_0xbbfa29);})[_0x3ea2('0xc')](function(_0x59a9f5){_0x2363d5(_0x59a9f5);});});}function _0x2b39c0(_0x291f6c,_0x5f3110){return new Promise(function(_0xd947cd,_0x50a62c){var _0x31b3b8=_0x291f6c[_0x3ea2('0x6')]?{[_0x291f6c[_0x3ea2('0x6')][_0x3ea2('0x7')]]:_0x291f6c[_0x3ea2('0x6')][_0x3ea2('0x8')]}:undefined;return _0x5040de[_0x291f6c[_0x3ea2('0xd')]][_0x3ea2('0x9')]({'where':_0x31b3b8,'raw':!![]})['then'](function(_0x44e9c4){_0x5f3110[_0x3ea2('0xa')]=_['map'](_0x44e9c4,function(_0x736428){return _0x736428[_0x3ea2('0xe')];});_0xd947cd(_0x5f3110);})[_0x3ea2('0xc')](function(_0x27a9ae){_0x50a62c(_0x27a9ae);});});}function _0x1d51bf(_0x20343d,_0x2ee2c2,_0x4b2998){if(!_0x2ee2c2)return Promise[_0x3ea2('0xf')](null);return new Promise(function(_0x4610b6,_0x357bf7){return _0x5040de['UserProfileResource'][_0x3ea2('0x9')]({'where':{'sectionId':_0x2ee2c2['id']},'raw':!![]})[_0x3ea2('0x10')](function(_0x686a07){if(_0x20343d[_0x3ea2('0x7')]&&_0x20343d[_0x3ea2('0x7')]!=='id'){_0x2ee2c2[_0x3ea2('0xa')]=_[_0x3ea2('0xb')](_0x686a07,function(_0x3a717a){return _0x3a717a[_0x20343d[_0x3ea2('0x7')]];});}else{if(_0x4b2998==='AnalyticExtractedReport'){_0x2ee2c2[_0x3ea2('0xa')]=_[_0x3ea2('0xb')](_0x686a07,function(_0x36f53a){return{'id':_0x36f53a[_0x3ea2('0x11')],'type':_0x36f53a['type']};});}else{_0x2ee2c2[_0x3ea2('0xa')]=_[_0x3ea2('0xb')](_0x686a07,function(_0x27d942){return _0x27d942[_0x3ea2('0x11')];});}}_0x4610b6(_0x2ee2c2);})[_0x3ea2('0xc')](function(_0x1bb0c1){_0x357bf7(_0x1bb0c1);});});}function _0x1da2a4(_0x2d3f2e,_0x3d9f01){var _0x16fc15={'parentSections':[]};switch(_0x2d3f2e[_0x3ea2('0x12')]()){case'squareprojects':_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x14');break;case _0x3ea2('0x15'):_0x16fc15['childModel']=_0x3ea2('0x16');break;case _0x3ea2('0x17'):_0x16fc15[_0x3ea2('0x13')]='SquareRecording';_0x16fc15[_0x3ea2('0x18')]=[{'name':'SquareProjects','field':'name','foreignKey':_0x3ea2('0x19')}];break;case _0x3ea2('0x1a'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x1b');break;case _0x3ea2('0x1c'):_0x16fc15[_0x3ea2('0x13')]='CmContact';_0x16fc15[_0x3ea2('0x18')]=[{'name':_0x3ea2('0x1d'),'field':'id','foreignKey':_0x3ea2('0x1e')}];break;case _0x3ea2('0x1f'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x20');break;case _0x3ea2('0x21'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x22');break;case _0x3ea2('0x23'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x24');break;case _0x3ea2('0x25'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x26');break;case _0x3ea2('0x27'):_0x16fc15[_0x3ea2('0x13')]='ChatWebsite';break;case _0x3ea2('0x28'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x29');break;case _0x3ea2('0x2a'):_0x16fc15['childModel']=_0x3ea2('0x2b');break;case'inboundroutes':case'internalroutes':case _0x3ea2('0x2c'):_0x16fc15['childModel']=_0x3ea2('0x2d');break;case _0x3ea2('0x2e'):_0x16fc15['childModel']=_0x3ea2('0x2f');break;case _0x3ea2('0x30'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x31');break;case'voicerecordings':_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x32');_0x16fc15[_0x3ea2('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x3ea2('0x33'),'model':_0x3ea2('0x34'),'filter':{'field':_0x3ea2('0x35'),'value':[_0x3ea2('0x36')]}},{'name':_0x3ea2('0x37'),'field':'name','foreignKey':'membername','model':_0x3ea2('0x34'),'filter':{'field':'role','value':[_0x3ea2('0x38')]}},{'name':_0x3ea2('0x39'),'field':_0x3ea2('0xe'),'foreignKey':_0x3ea2('0x3a'),'model':'VoiceQueue','filter':{'field':_0x3ea2('0x3b'),'value':[_0x3ea2('0x3c')]}},{'name':_0x3ea2('0x3d'),'field':'name','foreignKey':_0x3ea2('0x3a'),'model':_0x3ea2('0x3e'),'filter':{'field':_0x3ea2('0x3b'),'value':['outbound']}}];break;case _0x3ea2('0x3f'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x40');break;case _0x3ea2('0x41'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x42');break;case _0x3ea2('0x43'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x44');break;case'ivrcampaigns':_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x45');break;case _0x3ea2('0x46'):_0x16fc15[_0x3ea2('0x13')]='MailQueue';break;case _0x3ea2('0x47'):_0x16fc15['childModel']='MailAccount';break;case _0x3ea2('0x48'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x49');break;case _0x3ea2('0x4a'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x4b');break;case _0x3ea2('0x4c'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x4d');break;case'smsqueues':_0x16fc15['childModel']=_0x3ea2('0x4e');break;case _0x3ea2('0x4f'):_0x16fc15['childModel']='SmsAccount';break;case'whatsappqueues':_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x50');break;case _0x3ea2('0x51'):_0x16fc15['childModel']=_0x3ea2('0x52');break;case _0x3ea2('0x53'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x54');break;case _0x3ea2('0x55'):case _0x3ea2('0x56'):_0x16fc15['childModel']=_0x3ea2('0x3e');if(_0x3d9f01){_0x16fc15[_0x3ea2('0x18')]=[{'name':_0x3ea2('0x39')},{'name':_0x3ea2('0x3d')}];}break;case _0x3ea2('0x57'):case _0x3ea2('0x58'):case'telephones':_0x16fc15['childModel']=_0x3ea2('0x34');if(_0x3d9f01){_0x16fc15['parentSections']=[{'name':_0x3ea2('0x59'),'filter':{'field':_0x3ea2('0x35'),'value':[_0x3ea2('0x5a'),'user']},'ignore':!![]},{'name':_0x3ea2('0x5b')},{'name':_0x3ea2('0x37')}];}break;case _0x3ea2('0x5c'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x5d');break;case _0x3ea2('0x5e'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x5f');break;case _0x3ea2('0x60'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x61');break;case _0x3ea2('0x62'):_0x16fc15['childModel']='SugarcrmAccount';break;case _0x3ea2('0x63'):_0x16fc15[_0x3ea2('0x13')]='DeskAccount';break;case'zohoaccounts':_0x16fc15[_0x3ea2('0x13')]='ZohoAccount';break;case _0x3ea2('0x64'):_0x16fc15['childModel']='User';break;case'cannedanswers':_0x16fc15['childModel']='CannedAnswer';break;case _0x3ea2('0x65'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x66');break;case _0x3ea2('0x67'):_0x16fc15['childModel']='Dashboard';break;case'intervals':_0x16fc15['childModel']=_0x3ea2('0x68');break;case _0x3ea2('0x69'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x6a');break;case _0x3ea2('0x6b'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x6c');break;case _0x3ea2('0x6d'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x6e');break;case _0x3ea2('0x6f'):_0x16fc15[_0x3ea2('0x13')]='Tag';break;case'templates':_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x70');break;case _0x3ea2('0x71'):_0x16fc15[_0x3ea2('0x13')]='Trigger';break;case _0x3ea2('0x72'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x73');break;case _0x3ea2('0x74'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x75');break;case _0x3ea2('0x76'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x77');break;case _0x3ea2('0x78'):_0x16fc15[_0x3ea2('0x13')]=_0x3ea2('0x79');_0x16fc15[_0x3ea2('0x18')]=[{'name':_0x3ea2('0x7a'),'field':'id','foreignKey':_0x3ea2('0x7b')}];break;case _0x3ea2('0x7c'):_0x16fc15['childModel']=_0x3ea2('0x7d');break;}return _0x16fc15;}function _0x281807(_0x340370,_0x557e65){var _0x2c8ca9=_0x340370['charAt'](0x0)['toUpperCase']()+_0x340370[_0x3ea2('0x7e')](0x1);var _0x1943ad={'type':_0x5040de[_0x3ea2('0x7f')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x2a3cd0,_0x1221fc){var _0x219afc=squel[_0x3ea2('0x80')]()[_0x3ea2('0x7')](_0x3ea2('0x81')+_0x2c8ca9+'InteractionId','id')[_0x3ea2('0x7')]('ui.createdAt')[_0x3ea2('0x82')](_0x3ea2('0x83')+_0x340370+_0x3ea2('0x84'),'ui')['where'](_0x3ea2('0x85'),_0x557e65['id']);return _0x5040de[_0x3ea2('0x86')][_0x3ea2('0x87')](_0x219afc[_0x3ea2('0x88')](),_0x1943ad)[_0x3ea2('0x10')](function(_0x315517){_0x557e65[_0x2c8ca9+_0x3ea2('0x89')]=_0x315517;_0x2a3cd0(_0x315517);})[_0x3ea2('0xc')](function(_0x2ca32b){_0x1221fc(_0x2ca32b);});});}return _0xa60d5b[_0x3ea2('0x8a')](_0x3ea2('0x8b'),attributes,{'tableName':_0x3ea2('0x8c'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2d7415){var _0x29e2af={'raw':_0x2d7415[_0x3ea2('0x87')]['raw'],'where':{}};var _0x3ee198={};var _0x332ea1={'count':0x0,'rows':[]};var _0x32394d=_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0x8d')];var _0xc14d43=_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0x8e')]||![];var _0x25b47e=_0x1da2a4(_0x32394d,_0xc14d43);if(!_0x25b47e[_0x3ea2('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x32394d+'\x27');var _0x15f44f=[{'name':_0x32394d}];if(!_['isEmpty'](_0x25b47e[_0x3ea2('0x18')]))_0x15f44f=_0x25b47e['parentSections'];var _0xc661ad=[];for(var _0x5abcdd=0x0;_0x5abcdd<_0x15f44f[_0x3ea2('0x8f')];_0x5abcdd++){_0xc661ad['push'](_0x5040de[_0x3ea2('0x90')][_0x3ea2('0x91')]({'where':{'userProfileId':_0x2d7415[_0x3ea2('0x92')]['id'],'name':_0x15f44f[_0x5abcdd][_0x3ea2('0xe')]},'raw':!![]}));}return Promise[_0x3ea2('0x93')](_0xc661ad)['then'](function(_0x564d6e){var _0x506fa9=_['filter'](_0x564d6e,function(_0x10379f){return _0x10379f?_0x10379f:undefined;});var _0x1cebd4=_[_0x3ea2('0x6')](_0x15f44f,['ignore',!![]]);var _0x332a2f=_[_0x3ea2('0x94')](_0x506fa9)&&_[_0x3ea2('0x94')](_0x1cebd4)?null:_[_0x3ea2('0x95')](_0x1cebd4,_0x506fa9);if(!_0x332a2f)return null;var _0x35046f=[];for(var _0xdcea75=0x0;_0xdcea75<_0x332a2f[_0x3ea2('0x8f')];_0xdcea75++){var _0x25eaaf=_[_0x3ea2('0x91')](_0x15f44f,function(_0x571baa){return _0x332a2f[_0xdcea75]?_0x571baa[_0x3ea2('0xe')]===_0x332a2f[_0xdcea75][_0x3ea2('0xe')]:null;});if(_0x25eaaf){if(_0x332a2f[_0xdcea75][_0x3ea2('0x96')]){_0x35046f[_0x3ea2('0x97')](_0x3fba50(_0x25b47e[_0x3ea2('0x13')],_0x332a2f[_0xdcea75]));}else{if(!_0x332a2f[_0xdcea75][_0x3ea2('0x98')]){_0x35046f[_0x3ea2('0x97')](_0x1d51bf(_0x25eaaf,_0x332a2f[_0xdcea75],_0x25b47e[_0x3ea2('0x13')]));}else{if(_0x25eaaf[_0x3ea2('0xd')]){_0x35046f[_0x3ea2('0x97')](_0x2b39c0(_0x25eaaf,_0x332a2f[_0xdcea75]));}}}}}return Promise['all'](_0x35046f);})[_0x3ea2('0x10')](function(_0x18b4c4){var _0x35eb9f=_0x18b4c4;var _0x1bdc31=null;if(_0x35eb9f){_0x1bdc31=_0x35eb9f[_0x3ea2('0x8f')]===0x1?_0x35eb9f[0x0]:null;}if(!_0x1bdc31&&!_0x35eb9f)return _0x332ea1;var _0x161369=_0x5040de[_0x25b47e['childModel']][_0x3ea2('0x99')];_0x3ee198['model']=_[_0x3ea2('0x9a')](_0x161369);_0x3ee198[_0x3ea2('0x87')]=_[_0x3ea2('0x9a')](_0x2d7415[_0x3ea2('0x87')]);_0x3ee198['filters']=_[_0x3ea2('0x9b')](_0x3ee198[_0x3ea2('0xd')],_0x3ee198[_0x3ea2('0x87')]);_0x29e2af[_0x3ea2('0x9c')]=_[_0x3ea2('0x9b')](_0x3ee198[_0x3ea2('0xd')],qs['fields'](_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0x9d')]));_0x29e2af[_0x3ea2('0x9c')]=_0x29e2af[_0x3ea2('0x9c')][_0x3ea2('0x8f')]?_0x29e2af[_0x3ea2('0x9c')]:_0x3ee198[_0x3ea2('0xd')];if(!_0x2d7415[_0x3ea2('0x87')]['hasOwnProperty'](_0x3ea2('0x9e'))){_0x29e2af[_0x3ea2('0x9f')]=qs[_0x3ea2('0x9f')](_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0x9f')]);_0x29e2af[_0x3ea2('0xa0')]=qs[_0x3ea2('0xa0')](_0x2d7415[_0x3ea2('0x87')]['offset']);}_0x29e2af[_0x3ea2('0xa1')]=qs[_0x3ea2('0xa2')](_0x2d7415[_0x3ea2('0x87')]['sort']);_0x29e2af[_0x3ea2('0xa3')]=qs['filters'](_[_0x3ea2('0xa4')](_0x2d7415['query'],_0x3ee198['filters']));if(_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0x6')]){_0x29e2af[_0x3ea2('0xa3')]=_[_0x3ea2('0xa5')](_0x29e2af[_0x3ea2('0xa3')],{'$or':_[_0x3ea2('0xb')](_0x161369,function(_0x232e17){if(_0x232e17[_0x3ea2('0x3b')][_0x3ea2('0xa6')]!==_0x3ea2('0xa7')){var _0x17a7da={};_0x17a7da[_0x232e17[_0x3ea2('0x7')]]={'$like':'%'+_0x2d7415['query']['filter']+'%'};return _0x17a7da;}})});}var _0x68b74e=[];var _0x4d9733=null;var _0x5e0de7={};if(_0x1bdc31){_0x4d9733=_[_0x3ea2('0x91')](_0x15f44f,['name',_0x1bdc31['name']]);if(_0x4d9733[_0x3ea2('0x7')]){_0x5e0de7={};if(_0x25b47e[_0x3ea2('0x13')]===_0x3ea2('0x79')){_0x5e0de7[_0x4d9733[_0x3ea2('0xa8')]]=_[_0x3ea2('0xb')](_0x1bdc31[_0x3ea2('0xa')],'id');}else{_0x5e0de7[_0x4d9733[_0x3ea2('0xa8')]]=_0x1bdc31[_0x3ea2('0xa')];}_0x68b74e[_0x3ea2('0x97')](_0x5e0de7);}else{_0x29e2af['where']['id']=_0x1bdc31['associatedResources'];}}else{for(var _0x3c6323=0x0;_0x3c6323<_0x35eb9f[_0x3ea2('0x8f')];_0x3c6323++){_0x4d9733=_[_0x3ea2('0x91')](_0x15f44f,[_0x3ea2('0xe'),_0x35eb9f[_0x3c6323]['name']]);if(_0x4d9733[_0x3ea2('0x7')]){_0x5e0de7={};_0x5e0de7[_0x4d9733[_0x3ea2('0xa8')]]=_0x35eb9f[_0x3c6323][_0x3ea2('0xa')];_0x68b74e[_0x3ea2('0x97')](_0x5e0de7);}else{if(!_0x29e2af[_0x3ea2('0xa3')]['id'])_0x29e2af[_0x3ea2('0xa3')]['id']=[];_0x35eb9f[_0x3c6323][_0x3ea2('0xa')][_0x3ea2('0xa9')](function(_0x45fc28){_0x29e2af[_0x3ea2('0xa3')]['id'][_0x3ea2('0x97')](_0x45fc28);});}}}if(!_['isEmpty'](_0x68b74e)){_0x29e2af[_0x3ea2('0xa3')]=_[_0x3ea2('0xa5')](_0x29e2af[_0x3ea2('0xa3')],{'$and':{'$or':_0x68b74e}});}_0x29e2af=_[_0x3ea2('0xa5')]({},_0x29e2af,_0x2d7415[_0x3ea2('0xaa')]);if(_0x1bdc31&&!_0x1bdc31[_0x3ea2('0x98')]&&_0x25b47e['childModel']===_0x3ea2('0x79')){if(_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xab')]){_0x29e2af[_0x3ea2('0xac')]=[{'all':!![]}];}return _0x5040de[_0x25b47e[_0x3ea2('0x13')]]['findAll'](_0x29e2af)['then'](function(_0x329f8a){var _0x2e2ec9=[];_0x329f8a[_0x3ea2('0xa9')](function(_0x20fb0f){var _0x3a0558;switch(_0x20fb0f[_0x3ea2('0xad')]){case'default':_0x3a0558=_['find'](_0x1bdc31[_0x3ea2('0xa')],function(_0xc362fe){return _0xc362fe['id']===_0x20fb0f[_0x3ea2('0x7b')]&&_0xc362fe['type']==='DefaultReports';});break;case _0x3ea2('0xae'):_0x3a0558=_[_0x3ea2('0x91')](_0x1bdc31[_0x3ea2('0xa')],function(_0x5a09c1){return _0x5a09c1['id']===_0x20fb0f[_0x3ea2('0x7b')]&&_0x5a09c1[_0x3ea2('0x3b')]===_0x3ea2('0xaf');});break;}if(_0x3a0558)_0x2e2ec9[_0x3ea2('0x97')](_0x20fb0f);});_0x332ea1['count']=_0x2e2ec9[_0x3ea2('0x8f')];_0x332ea1[_0x3ea2('0xb0')]=_0x2e2ec9;return _0x332ea1;});}else{if(!_[_0x3ea2('0x94')](_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xb1')])){_0x29e2af[_0x3ea2('0xa3')]['id']=_0x29e2af[_0x3ea2('0xa3')]['id']?_[_0x3ea2('0x9b')](_0x29e2af[_0x3ea2('0xa3')]['id'],_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xb1')]):_0x2d7415['query']['ids'];if(_0x2d7415[_0x3ea2('0x87')]['customSorting']){_0x29e2af['order']=_0x2d7415['query'][_0x3ea2('0xb2')];}}if(_0x2d7415['query'][_0x3ea2('0xb3')]){_0x29e2af[_0x3ea2('0xa3')]=_['merge'](_0x29e2af[_0x3ea2('0xa3')],{'$and':_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xb3')]});}return _0x5040de[_0x25b47e['childModel']][_0x3ea2('0xb4')]({'where':_0x29e2af[_0x3ea2('0xa3')]})[_0x3ea2('0x10')](function(_0x5635f1){_0x332ea1[_0x3ea2('0xb4')]=_0x5635f1;if(_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xab')]){if(_0x25b47e['childModel']===_0x3ea2('0xb5')){_0x29e2af[_0x3ea2('0xac')]=[{'model':_0x5040de['Tag'],'as':_0x3ea2('0xb6'),'attributes':['id','name',_0x3ea2('0xb7')],'required':_0x2d7415[_0x3ea2('0x87')]['tag']?!![]:![]},{'model':_0x5040de['Tag'],'as':_0x3ea2('0xb8'),'attributes':['id',_0x3ea2('0xe'),_0x3ea2('0xb7')],'through':_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xb9')]?{'attributes':[],'where':{'TagId':_0x2d7415['query'][_0x3ea2('0xb9')]||undefined}}:{},'required':_0x2d7415[_0x3ea2('0x87')][_0x3ea2('0xb9')]?!![]:![]}];}else{_0x29e2af[_0x3ea2('0xac')]=[{'all':!![]}];}}return _0x5040de[_0x25b47e['childModel']][_0x3ea2('0x9')](_0x29e2af);})['then'](function(_0x456175){_0x332ea1[_0x3ea2('0xb0')]=_0x456175;if(_0x32394d==='Agents'&&_0x2d7415['query'][_0x3ea2('0xba')]==='true'){var _0x5ee1c7=[];for(var _0x349f6f=0x0;_0x349f6f<_0x332ea1[_0x3ea2('0xb0')][_0x3ea2('0x8f')];_0x349f6f++){_0x5ee1c7[_0x3ea2('0x97')](_0x281807(_0x3ea2('0xbb'),_0x332ea1['rows'][_0x349f6f]['dataValues']));_0x5ee1c7[_0x3ea2('0x97')](_0x281807(_0x3ea2('0xbc'),_0x332ea1['rows'][_0x349f6f][_0x3ea2('0xbd')]));_0x5ee1c7[_0x3ea2('0x97')](_0x281807('fax',_0x332ea1[_0x3ea2('0xb0')][_0x349f6f][_0x3ea2('0xbd')]));_0x5ee1c7['push'](_0x281807(_0x3ea2('0xbe'),_0x332ea1['rows'][_0x349f6f][_0x3ea2('0xbd')]));_0x5ee1c7[_0x3ea2('0x97')](_0x281807('openchannel',_0x332ea1[_0x3ea2('0xb0')][_0x349f6f][_0x3ea2('0xbd')]));_0x5ee1c7[_0x3ea2('0x97')](_0x281807(_0x3ea2('0xbf'),_0x332ea1[_0x3ea2('0xb0')][_0x349f6f][_0x3ea2('0xbd')]));}return Promise[_0x3ea2('0x93')](_0x5ee1c7)['then'](function(){return _0x332ea1;});}return _0x332ea1;});}});}}});};
\ No newline at end of file
index c53902b..a04b27b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bab=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','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','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbd2b1e,_0xdaf226){var _0x28e77a=function(_0x31925e){while(--_0x31925e){_0xbd2b1e['push'](_0xbd2b1e['shift']());}};_0x28e77a(++_0xdaf226);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0x6bab[_0x4d2f00];return _0x2d7b7f;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var moment=require(_0xb6ba('0x2'));var BPromise=require(_0xb6ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6ba('0x4'));var db=require(_0xb6ba('0x5'))['db'];var utils=require(_0xb6ba('0x6'));var logger=require(_0xb6ba('0x7'))(_0xb6ba('0x8'));var config=require('../../config/environment');var jayson=require(_0xb6ba('0x9'));var client=jayson['client'][_0xb6ba('0xa')]({'port':0x232a});config[_0xb6ba('0xb')]=_[_0xb6ba('0xc')](config[_0xb6ba('0xb')],{'host':_0xb6ba('0xd'),'port':0x18eb});var socket=require(_0xb6ba('0xe'))(new Redis(config[_0xb6ba('0xb')]));require(_0xb6ba('0xf'))[_0xb6ba('0x10')](socket);function respondWithRpcPromise(_0x5ae28b,_0x16cb3a,_0x55a4b0){return new BPromise(function(_0x5c4eac,_0x5c556d){return client[_0xb6ba('0x11')](_0x5ae28b,_0x55a4b0)[_0xb6ba('0x12')](function(_0x1cb42c){logger['info'](_0xb6ba('0x13'),_0x16cb3a,_0xb6ba('0x14'));logger[_0xb6ba('0x15')](_0xb6ba('0x16'),_0x16cb3a,_0xb6ba('0x14'),JSON[_0xb6ba('0x17')](_0x1cb42c));if(_0x1cb42c[_0xb6ba('0x18')]){if(_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x19')]===0x1f4){logger[_0xb6ba('0x18')](_0xb6ba('0x13'),_0x16cb3a,_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);return _0x5c556d(_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);}logger[_0xb6ba('0x18')](_0xb6ba('0x13'),_0x16cb3a,_0x1cb42c[_0xb6ba('0x18')][_0xb6ba('0x1a')]);return _0x5c4eac(_0x1cb42c['error'][_0xb6ba('0x1a')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x16cb3a,_0xb6ba('0x14'));_0x5c4eac(_0x1cb42c[_0xb6ba('0x1b')]['message']);}})[_0xb6ba('0x1c')](function(_0xf1e2f8){logger['error'](_0xb6ba('0x13'),_0x16cb3a,_0xf1e2f8);_0x5c556d(_0xf1e2f8);});});}
\ No newline at end of file
+var _0x9d5c=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x421d38,_0x121cab){var _0x24b54c=function(_0x5b17fb){while(--_0x5b17fb){_0x421d38['push'](_0x421d38['shift']());}};_0x24b54c(++_0x121cab);}(_0x9d5c,0x98));var _0xc9d5=function(_0x5ee24d,_0x80924c){_0x5ee24d=_0x5ee24d-0x0;var _0x50e9b4=_0x9d5c[_0x5ee24d];return _0x50e9b4;};'use strict';var _=require(_0xc9d5('0x0'));var util=require('util');var moment=require(_0xc9d5('0x1'));var BPromise=require(_0xc9d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc9d5('0x3'));var db=require(_0xc9d5('0x4'))['db'];var utils=require(_0xc9d5('0x5'));var logger=require('../../config/logger')(_0xc9d5('0x6'));var config=require(_0xc9d5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc9d5('0x8')][_0xc9d5('0x9')]({'port':0x232a});config[_0xc9d5('0xa')]=_[_0xc9d5('0xb')](config[_0xc9d5('0xa')],{'host':_0xc9d5('0xc'),'port':0x18eb});var socket=require(_0xc9d5('0xd'))(new Redis(config[_0xc9d5('0xa')]));require(_0xc9d5('0xe'))[_0xc9d5('0xf')](socket);function respondWithRpcPromise(_0x4b2a27,_0x5aeab3,_0x53816b){return new BPromise(function(_0x4d4fde,_0x15dcdf){return client[_0xc9d5('0x10')](_0x4b2a27,_0x53816b)[_0xc9d5('0x11')](function(_0x23d32e){logger[_0xc9d5('0x12')](_0xc9d5('0x13'),_0x5aeab3,_0xc9d5('0x14'));logger['debug']('UserProfile,\x20%s,\x20%s,\x20%s',_0x5aeab3,'request\x20sent',JSON[_0xc9d5('0x15')](_0x23d32e));if(_0x23d32e[_0xc9d5('0x16')]){if(_0x23d32e[_0xc9d5('0x16')][_0xc9d5('0x17')]===0x1f4){logger['error'](_0xc9d5('0x13'),_0x5aeab3,_0x23d32e[_0xc9d5('0x16')]['message']);return _0x15dcdf(_0x23d32e[_0xc9d5('0x16')][_0xc9d5('0x18')]);}logger['error']('UserProfile,\x20%s,\x20%s',_0x5aeab3,_0x23d32e[_0xc9d5('0x16')][_0xc9d5('0x18')]);return _0x4d4fde(_0x23d32e[_0xc9d5('0x16')]['message']);}else{logger[_0xc9d5('0x12')]('UserProfile,\x20%s,\x20%s',_0x5aeab3,_0xc9d5('0x14'));_0x4d4fde(_0x23d32e[_0xc9d5('0x19')][_0xc9d5('0x18')]);}})[_0xc9d5('0x1a')](function(_0x55aae9){logger[_0xc9d5('0x16')]('UserProfile,\x20%s,\x20%s',_0x5aeab3,_0x55aae9);_0x15dcdf(_0x55aae9);});});}
\ No newline at end of file
index 687999f..26644da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94e0=['removeListener','register','length','./userProfile.events','remove','update','emit'];(function(_0x536687,_0x37ade2){var _0x48fdb4=function(_0x2a190d){while(--_0x2a190d){_0x536687['push'](_0x536687['shift']());}};_0x48fdb4(++_0x37ade2);}(_0x94e0,0x1d8));var _0x094e=function(_0x499044,_0x1b0dd0){_0x499044=_0x499044-0x0;var _0x1d004b=_0x94e0[_0x499044];return _0x1d004b;};'use strict';var UserProfileEvents=require(_0x094e('0x0'));var events=['save',_0x094e('0x1'),_0x094e('0x2')];function createListener(_0x2703f8,_0xb9e8a2){return function(_0x3118fb){_0xb9e8a2[_0x094e('0x3')](_0x2703f8,_0x3118fb);};}function removeListener(_0x342e56,_0x5d5fa5){return function(){UserProfileEvents[_0x094e('0x4')](_0x342e56,_0x5d5fa5);};}exports[_0x094e('0x5')]=function(_0x36e09f){for(var _0x2b0667=0x0,_0xed6477=events[_0x094e('0x6')];_0x2b0667<_0xed6477;_0x2b0667++){var _0x2f9b72=events[_0x2b0667];var _0x5cea56=createListener('userProfile:'+_0x2f9b72,_0x36e09f);UserProfileEvents['on'](_0x2f9b72,_0x5cea56);}};
\ No newline at end of file
+var _0x0c71=['userProfile:','save','update','emit','register'];(function(_0x1d8718,_0x1b246f){var _0x6214f8=function(_0xf47e10){while(--_0xf47e10){_0x1d8718['push'](_0x1d8718['shift']());}};_0x6214f8(++_0x1b246f);}(_0x0c71,0x8d));var _0x10c7=function(_0x21f1c2,_0x35b412){_0x21f1c2=_0x21f1c2-0x0;var _0x365088=_0x0c71[_0x21f1c2];return _0x365088;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x10c7('0x0'),'remove',_0x10c7('0x1')];function createListener(_0x5435bf,_0x51d9cd){return function(_0xa598f7){_0x51d9cd[_0x10c7('0x2')](_0x5435bf,_0xa598f7);};}function removeListener(_0x5ac063,_0x4eafab){return function(){UserProfileEvents['removeListener'](_0x5ac063,_0x4eafab);};}exports[_0x10c7('0x3')]=function(_0x989294){for(var _0x421823=0x0,_0x2ceb85=events['length'];_0x421823<_0x2ceb85;_0x421823++){var _0x2282e9=events[_0x421823];var _0x1fd765=createListener(_0x10c7('0x4')+_0x2282e9,_0x989294);UserProfileEvents['on'](_0x2282e9,_0x1fd765);}};
\ No newline at end of file
index 456a5a0..b7d59c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc4d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','destroy'];(function(_0x212721,_0x1c0edc){var _0x369f08=function(_0x1c6077){while(--_0x1c6077){_0x212721['push'](_0x212721['shift']());}};_0x369f08(++_0x1c0edc);}(_0xfc4d,0x151));var _0xdfc4=function(_0x55ec31,_0x3f1d64){_0x55ec31=_0x55ec31-0x0;var _0x47a20e=_0xfc4d[_0x55ec31];return _0x47a20e;};'use strict';var multer=require(_0xdfc4('0x0'));var util=require(_0xdfc4('0x1'));var path=require(_0xdfc4('0x2'));var timeout=require(_0xdfc4('0x3'));var express=require(_0xdfc4('0x4'));var router=express[_0xdfc4('0x5')]();var fs_extra=require(_0xdfc4('0x6'));var auth=require(_0xdfc4('0x7'));var interaction=require(_0xdfc4('0x8'));var config=require(_0xdfc4('0x9'));var controller=require('./userProfileResource.controller');router[_0xdfc4('0xa')]('/',auth[_0xdfc4('0xb')](),controller[_0xdfc4('0xc')]);router['get'](_0xdfc4('0xd'),auth[_0xdfc4('0xb')](),controller[_0xdfc4('0xe')]);router['get'](_0xdfc4('0xf'),auth[_0xdfc4('0xb')](),controller['show']);router[_0xdfc4('0x10')]('/',auth[_0xdfc4('0xb')](),controller['create']);router[_0xdfc4('0x11')](_0xdfc4('0xf'),auth['isAuthenticated'](),controller[_0xdfc4('0x12')]);router['delete'](_0xdfc4('0xf'),auth[_0xdfc4('0xb')](),controller[_0xdfc4('0x13')]);module[_0xdfc4('0x14')]=router;
\ No newline at end of file
+var _0xf2d0=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/interaction/service'];(function(_0x3ae7a3,_0x1500cb){var _0x5028b2=function(_0x5198f8){while(--_0x5198f8){_0x3ae7a3['push'](_0x3ae7a3['shift']());}};_0x5028b2(++_0x1500cb);}(_0xf2d0,0x8a));var _0x0f2d=function(_0x196f02,_0x5265c0){_0x196f02=_0x196f02-0x0;var _0x153425=_0xf2d0[_0x196f02];return _0x153425;};'use strict';var multer=require(_0x0f2d('0x0'));var util=require(_0x0f2d('0x1'));var path=require(_0x0f2d('0x2'));var timeout=require(_0x0f2d('0x3'));var express=require('express');var router=express[_0x0f2d('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0f2d('0x5'));var config=require(_0x0f2d('0x6'));var controller=require(_0x0f2d('0x7'));router[_0x0f2d('0x8')]('/',auth[_0x0f2d('0x9')](),controller[_0x0f2d('0xa')]);router[_0x0f2d('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x0f2d('0xb')]);router[_0x0f2d('0x8')](_0x0f2d('0xc'),auth[_0x0f2d('0x9')](),controller[_0x0f2d('0xd')]);router['post']('/',auth[_0x0f2d('0x9')](),controller['create']);router[_0x0f2d('0xe')](_0x0f2d('0xc'),auth[_0x0f2d('0x9')](),controller[_0x0f2d('0xf')]);router[_0x0f2d('0x10')](_0x0f2d('0xc'),auth[_0x0f2d('0x9')](),controller[_0x0f2d('0x11')]);module['exports']=router;
\ No newline at end of file
index ec7aefb..05441a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe524=['INTEGER','STRING'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe524,0x155));var _0x4e52=function(_0x433149,_0x28c526){_0x433149=_0x433149-0x0;var _0xbf8acc=_0xe524[_0x433149];return _0xbf8acc;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4e52('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4e52('0x1')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x8274=['INTEGER','exports','STRING'];(function(_0x3f4a75,_0x1ff97e){var _0x1cd60d=function(_0x317c0d){while(--_0x317c0d){_0x3f4a75['push'](_0x3f4a75['shift']());}};_0x1cd60d(++_0x1ff97e);}(_0x8274,0x1cc));var _0x4827=function(_0x1b9647,_0x5c6da8){_0x1b9647=_0x1b9647-0x0;var _0x55caf3=_0x8274[_0x1b9647];return _0x55caf3;};'use strict';var Sequelize=require('sequelize');module[_0x4827('0x0')]={'name':{'type':Sequelize[_0x4827('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4827('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4827('0x1')],'allowNull':![]}};
\ No newline at end of file
index bf09ffd..3a780bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['index','map','UserProfileResource','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x1a37[_0x1f36bb];return _0xaf97fa;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));};
\ No newline at end of file
+var _0x57ca=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','UserProfileResource','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','params','find','catch','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4e5727,_0x4fad3a){var _0x640c9f=function(_0x37fa9a){while(--_0x37fa9a){_0x4e5727['push'](_0x4e5727['shift']());}};_0x640c9f(++_0x4fad3a);}(_0x57ca,0x108));var _0xa57c=function(_0x3a2643,_0x5410b6){_0x3a2643=_0x3a2643-0x0;var _0x4ea827=_0x57ca[_0x3a2643];return _0x4ea827;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa57c('0x0'));var zipdir=require(_0xa57c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa57c('0x2'));var moment=require(_0xa57c('0x3'));var BPromise=require(_0xa57c('0x4'));var Mustache=require(_0xa57c('0x5'));var util=require(_0xa57c('0x6'));var path=require('path');var sox=require(_0xa57c('0x7'));var csv=require(_0xa57c('0x8'));var ejs=require(_0xa57c('0x9'));var fs=require('fs');var fs_extra=require(_0xa57c('0xa'));var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x8'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa57c('0x15'));var db=require(_0xa57c('0x16'))['db'];function respondWithStatusCode(_0x1f2bb5,_0x9e25bf){_0x9e25bf=_0x9e25bf||0xcc;return function(_0x205e72){if(_0x205e72){return _0x1f2bb5['sendStatus'](_0x9e25bf);}return _0x1f2bb5[_0xa57c('0x17')](_0x9e25bf)['end']();};}function respondWithResult(_0x30d23d,_0x3d5995){_0x3d5995=_0x3d5995||0xc8;return function(_0x30940d){if(_0x30940d){return _0x30d23d[_0xa57c('0x17')](_0x3d5995)[_0xa57c('0x18')](_0x30940d);}};}function respondWithFilteredResult(_0x37a323,_0x3f900a){return function(_0x4b4bdb){if(_0x4b4bdb){var _0x26607a=typeof _0x3f900a[_0xa57c('0x19')]===_0xa57c('0x1a')&&typeof _0x3f900a['limit']===_0xa57c('0x1a');var _0x5f33f1=_0x4b4bdb[_0xa57c('0x1b')];var _0x3d781d=_0x26607a?0x0:_0x3f900a[_0xa57c('0x19')];var _0xe3d505=_0x26607a?_0x4b4bdb[_0xa57c('0x1b')]:_0x3f900a[_0xa57c('0x19')]+_0x3f900a[_0xa57c('0x1c')];var _0x595c7a;if(_0xe3d505>=_0x5f33f1){_0xe3d505=_0x5f33f1;_0x595c7a=0xc8;}else{_0x595c7a=0xce;}_0x37a323['status'](_0x595c7a);return _0x37a323[_0xa57c('0x1d')]('Content-Range',_0x3d781d+'-'+_0xe3d505+'/'+_0x5f33f1)['json'](_0x4b4bdb);}return null;};}function patchUpdates(_0x418415){return function(_0xa5b314){try{jsonpatch[_0xa57c('0x1e')](_0xa5b314,_0x418415,!![]);}catch(_0x23bec0){return BPromise['reject'](_0x23bec0);}return _0xa5b314[_0xa57c('0x1f')]();};}function saveUpdates(_0x25715f,_0x34d1bc){return function(_0x2213b2){if(_0x2213b2){return _0x2213b2[_0xa57c('0x20')](_0x25715f)[_0xa57c('0x21')](function(_0x1e0192){return _0x1e0192;});}return null;};}function removeEntity(_0x42038e,_0x2e99ed){return function(_0xdf65dd){if(_0xdf65dd){return _0xdf65dd[_0xa57c('0x22')]()[_0xa57c('0x21')](function(){_0x42038e[_0xa57c('0x17')](0xcc)[_0xa57c('0x23')]();});}};}function handleEntityNotFound(_0x431bec,_0x511a26){return function(_0x2db443){if(!_0x2db443){_0x431bec[_0xa57c('0x24')](0x194);}return _0x2db443;};}function handleError(_0x27884d,_0x5228b9){_0x5228b9=_0x5228b9||0x1f4;return function(_0x315ad7){logger[_0xa57c('0x25')](_0x315ad7[_0xa57c('0x26')]);if(_0x315ad7[_0xa57c('0x27')]){delete _0x315ad7[_0xa57c('0x27')];}_0x27884d[_0xa57c('0x17')](_0x5228b9)['send'](_0x315ad7);};}exports[_0xa57c('0x28')]=function(_0x4c1478,_0x54a18b){var _0x257661={},_0x7d10ec={},_0x5a3e03={'count':0x0,'rows':[]};var _0x12898b=_[_0xa57c('0x29')](db[_0xa57c('0x2a')]['rawAttributes'],function(_0xd779f1){return{'name':_0xd779f1['fieldName'],'type':_0xd779f1[_0xa57c('0x2b')]['key']};});_0x7d10ec[_0xa57c('0x2c')]=_['map'](_0x12898b,_0xa57c('0x27'));_0x7d10ec['query']=_[_0xa57c('0x2d')](_0x4c1478[_0xa57c('0x2e')]);_0x7d10ec[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x7d10ec[_0xa57c('0x2c')],_0x7d10ec[_0xa57c('0x2e')]);_0x257661[_0xa57c('0x31')]=_['intersection'](_0x7d10ec[_0xa57c('0x2c')],qs['fields'](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x257661[_0xa57c('0x31')]=_0x257661['attributes'][_0xa57c('0x33')]?_0x257661['attributes']:_0x7d10ec[_0xa57c('0x2c')];if(!_0x4c1478['query'][_0xa57c('0x34')]('nolimit')){_0x257661[_0xa57c('0x1c')]=qs[_0xa57c('0x1c')](_0x4c1478['query'][_0xa57c('0x1c')]);_0x257661['offset']=qs[_0xa57c('0x19')](_0x4c1478['query'][_0xa57c('0x19')]);}_0x257661[_0xa57c('0x35')]=qs[_0xa57c('0x36')](_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x36')]);_0x257661[_0xa57c('0x37')]=qs['filters'](_['pick'](_0x4c1478[_0xa57c('0x2e')],_0x7d10ec[_0xa57c('0x2f')]),_0x12898b);if(_0x4c1478[_0xa57c('0x2e')]['filter']){_0x257661[_0xa57c('0x37')]=_['merge'](_0x257661[_0xa57c('0x37')],{'$or':_[_0xa57c('0x29')](_0x12898b,function(_0x5c8256){if(_0x5c8256['type']!=='VIRTUAL'){var _0x3be888={};_0x3be888[_0x5c8256[_0xa57c('0x27')]]={'$like':'%'+_0x4c1478[_0xa57c('0x2e')][_0xa57c('0x38')]+'%'};return _0x3be888;}})});}_0x257661=_[_0xa57c('0x39')]({},_0x257661,_0x4c1478[_0xa57c('0x3a')]);var _0x5a444a={'where':_0x257661[_0xa57c('0x37')]};return db[_0xa57c('0x2a')]['count'](_0x5a444a)['then'](function(_0x5e10b){_0x5a3e03[_0xa57c('0x1b')]=_0x5e10b;if(_0x4c1478['query'][_0xa57c('0x3b')]){_0x257661[_0xa57c('0x3c')]=[{'all':!![]}];}return db[_0xa57c('0x2a')][_0xa57c('0x3d')](_0x257661);})[_0xa57c('0x21')](function(_0x43c1d7){_0x5a3e03['rows']=_0x43c1d7;return _0x5a3e03;})[_0xa57c('0x21')](respondWithFilteredResult(_0x54a18b,_0x257661))['catch'](handleError(_0x54a18b,null));};exports['show']=function(_0x5b3300,_0x520383){var _0x588199={'raw':![],'where':{'id':_0x5b3300[_0xa57c('0x3e')]['id']}},_0x39b20f={};_0x39b20f[_0xa57c('0x2c')]=_['keys'](db['UserProfileResource']['rawAttributes']);_0x39b20f[_0xa57c('0x2e')]=_[_0xa57c('0x2d')](_0x5b3300[_0xa57c('0x2e')]);_0x39b20f[_0xa57c('0x2f')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],_0x39b20f['query']);_0x588199[_0xa57c('0x31')]=_[_0xa57c('0x30')](_0x39b20f[_0xa57c('0x2c')],qs[_0xa57c('0x32')](_0x5b3300[_0xa57c('0x2e')][_0xa57c('0x32')]));_0x588199['attributes']=_0x588199[_0xa57c('0x31')][_0xa57c('0x33')]?_0x588199[_0xa57c('0x31')]:_0x39b20f[_0xa57c('0x2c')];if(_0x5b3300[_0xa57c('0x2e')]['includeAll']){_0x588199[_0xa57c('0x3c')]=[{'all':!![]}];}_0x588199=_[_0xa57c('0x39')]({},_0x588199,_0x5b3300[_0xa57c('0x3a')]);return db[_0xa57c('0x2a')][_0xa57c('0x3f')](_0x588199)[_0xa57c('0x21')](handleEntityNotFound(_0x520383,null))['then'](respondWithResult(_0x520383,null))[_0xa57c('0x40')](handleError(_0x520383,null));};exports[_0xa57c('0x41')]=function(_0x247906,_0x44ea0a){return db[_0xa57c('0x2a')][_0xa57c('0x41')](_0x247906['body'],{})['then'](respondWithResult(_0x44ea0a,0xc9))['catch'](handleError(_0x44ea0a,null));};exports['update']=function(_0x232675,_0x49492f){if(_0x232675[_0xa57c('0x42')]['id']){delete _0x232675[_0xa57c('0x42')]['id'];}return db['UserProfileResource'][_0xa57c('0x3f')]({'where':{'id':_0x232675[_0xa57c('0x3e')]['id']}})[_0xa57c('0x21')](handleEntityNotFound(_0x49492f,null))[_0xa57c('0x21')](saveUpdates(_0x232675[_0xa57c('0x42')],null))['then'](respondWithResult(_0x49492f,null))[_0xa57c('0x40')](handleError(_0x49492f,null));};exports[_0xa57c('0x22')]=function(_0x4584e8,_0xd57bac){return db[_0xa57c('0x2a')]['find']({'where':{'id':_0x4584e8[_0xa57c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xd57bac,null))['then'](removeEntity(_0xd57bac,null))[_0xa57c('0x40')](handleError(_0xd57bac,null));};exports[_0xa57c('0x43')]=function(_0x5ded49,_0x5bf336){return db['UserProfileResource'][_0xa57c('0x43')]()[_0xa57c('0x21')](respondWithResult(_0x5bf336,null))[_0xa57c('0x40')](handleError(_0x5bf336,null));};
\ No newline at end of file
index 1633484..c8b0e0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa43c=['../../config/logger','moment','bluebird','request-promise','path','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xa43c,0x1ab));var _0xca43=function(_0xd7e0a3,_0x4bd5a6){_0xd7e0a3=_0xd7e0a3-0x0;var _0x2e010d=_0xa43c[_0xd7e0a3];return _0x2e010d;};'use strict';var _=require(_0xca43('0x0'));var util=require(_0xca43('0x1'));var logger=require(_0xca43('0x2'))('api');var moment=require(_0xca43('0x3'));var BPromise=require(_0xca43('0x4'));var rp=require(_0xca43('0x5'));var fs=require('fs');var path=require(_0xca43('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca43('0x7'));module[_0xca43('0x8')]=function(_0x467da5,_0x46aef3){return _0x467da5['define']('UserProfileResource',attributes,{'tableName':_0xca43('0x9'),'paranoid':![],'indexes':[{'name':_0xca43('0xa'),'fields':[_0xca43('0xb'),_0xca43('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7dea=['rimraf','./userProfileResource.attributes','exports','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api','moment','bluebird','path'];(function(_0x3f6614,_0xefe981){var _0x7dc330=function(_0xe205d4){while(--_0xe205d4){_0x3f6614['push'](_0x3f6614['shift']());}};_0x7dc330(++_0xefe981);}(_0x7dea,0xfe));var _0xa7de=function(_0x488ed6,_0x3aec5b){_0x488ed6=_0x488ed6-0x0;var _0x2b527c=_0x7dea[_0x488ed6];return _0x2b527c;};'use strict';var _=require(_0xa7de('0x0'));var util=require(_0xa7de('0x1'));var logger=require('../../config/logger')(_0xa7de('0x2'));var moment=require(_0xa7de('0x3'));var BPromise=require(_0xa7de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa7de('0x5'));var rimraf=require(_0xa7de('0x6'));var config=require('../../config/environment');var attributes=require(_0xa7de('0x7'));module[_0xa7de('0x8')]=function(_0x1e624c,_0x4a43e7){return _0x1e624c['define']('UserProfileResource',attributes,{'tableName':_0xa7de('0x9'),'paranoid':![],'indexes':[{'name':_0xa7de('0xa'),'fields':[_0xa7de('0xb'),_0xa7de('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 59fd2d6..a300e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f7b=['client','http','request','then','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x45713c,_0x13dd54){var _0x391b8f=function(_0x5b432a){while(--_0x5b432a){_0x45713c['push'](_0x45713c['shift']());}};_0x391b8f(++_0x13dd54);}(_0x9f7b,0x7c));var _0xb9f7=function(_0x3817ce,_0x1f8947){_0x3817ce=_0x3817ce-0x0;var _0x17ccbc=_0x9f7b[_0x3817ce];return _0x17ccbc;};'use strict';var _=require(_0xb9f7('0x0'));var util=require(_0xb9f7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9f7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb9f7('0x3'));var logger=require(_0xb9f7('0x4'))(_0xb9f7('0x5'));var config=require(_0xb9f7('0x6'));var jayson=require(_0xb9f7('0x7'));var client=jayson[_0xb9f7('0x8')][_0xb9f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8f85,_0x24068c,_0x2ca376){return new BPromise(function(_0x3caa00,_0x2571a5){return client[_0xb9f7('0xa')](_0x2c8f85,_0x2ca376)[_0xb9f7('0xb')](function(_0x117d9e){logger['info'](_0xb9f7('0xc'),_0x24068c,'request\x20sent');logger[_0xb9f7('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x24068c,_0xb9f7('0xe'),JSON[_0xb9f7('0xf')](_0x117d9e));if(_0x117d9e[_0xb9f7('0x10')]){if(_0x117d9e[_0xb9f7('0x10')][_0xb9f7('0x11')]===0x1f4){logger[_0xb9f7('0x10')](_0xb9f7('0xc'),_0x24068c,_0x117d9e[_0xb9f7('0x10')]['message']);return _0x2571a5(_0x117d9e['error'][_0xb9f7('0x12')]);}logger[_0xb9f7('0x10')](_0xb9f7('0xc'),_0x24068c,_0x117d9e[_0xb9f7('0x10')]['message']);return _0x3caa00(_0x117d9e['error']['message']);}else{logger[_0xb9f7('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x24068c,_0xb9f7('0xe'));_0x3caa00(_0x117d9e[_0xb9f7('0x14')][_0xb9f7('0x12')]);}})[_0xb9f7('0x15')](function(_0x1c0552){logger[_0xb9f7('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x24068c,_0x1c0552);_0x2571a5(_0x1c0552);});});}
\ No newline at end of file
+var _0xa419=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x5effcf,_0x47af59){var _0x4d123c=function(_0x24aaef){while(--_0x24aaef){_0x5effcf['push'](_0x5effcf['shift']());}};_0x4d123c(++_0x47af59);}(_0xa419,0x1a3));var _0x9a41=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xa419[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0x9a41('0x0'));var util=require(_0x9a41('0x1'));var moment=require(_0x9a41('0x2'));var BPromise=require('bluebird');var rs=require(_0x9a41('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a41('0x4'))['db'];var utils=require(_0x9a41('0x5'));var logger=require(_0x9a41('0x6'))(_0x9a41('0x7'));var config=require(_0x9a41('0x8'));var jayson=require(_0x9a41('0x9'));var client=jayson[_0x9a41('0xa')][_0x9a41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20cede,_0x2defe7,_0x4693a5){return new BPromise(function(_0x44a265,_0x23a131){return client[_0x9a41('0xc')](_0x20cede,_0x4693a5)['then'](function(_0x397ba0){logger[_0x9a41('0xd')](_0x9a41('0xe'),_0x2defe7,_0x9a41('0xf'));logger[_0x9a41('0x10')](_0x9a41('0x11'),_0x2defe7,_0x9a41('0xf'),JSON['stringify'](_0x397ba0));if(_0x397ba0[_0x9a41('0x12')]){if(_0x397ba0[_0x9a41('0x12')]['code']===0x1f4){logger[_0x9a41('0x12')](_0x9a41('0xe'),_0x2defe7,_0x397ba0['error'][_0x9a41('0x13')]);return _0x23a131(_0x397ba0['error'][_0x9a41('0x13')]);}logger[_0x9a41('0x12')]('UserProfileResource,\x20%s,\x20%s',_0x2defe7,_0x397ba0[_0x9a41('0x12')][_0x9a41('0x13')]);return _0x44a265(_0x397ba0['error'][_0x9a41('0x13')]);}else{logger[_0x9a41('0xd')](_0x9a41('0xe'),_0x2defe7,'request\x20sent');_0x44a265(_0x397ba0[_0x9a41('0x14')][_0x9a41('0x13')]);}})[_0x9a41('0x15')](function(_0x2da098){logger['error'](_0x9a41('0xe'),_0x2defe7,_0x2da098);_0x23a131(_0x2da098);});});}
\ No newline at end of file
index 2888f23..27a07c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x804c=['/:id','show','post','create','put','update','delete','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get'];(function(_0x171539,_0x142f81){var _0xd511f=function(_0x369437){while(--_0x369437){_0x171539['push'](_0x171539['shift']());}};_0xd511f(++_0x142f81);}(_0x804c,0xfe));var _0xc804=function(_0x127a59,_0xb50fc5){_0x127a59=_0x127a59-0x0;var _0x55b887=_0x804c[_0x127a59];return _0x55b887;};'use strict';var multer=require('multer');var util=require(_0xc804('0x0'));var path=require(_0xc804('0x1'));var timeout=require(_0xc804('0x2'));var express=require(_0xc804('0x3'));var router=express[_0xc804('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc804('0x5'));var config=require(_0xc804('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xc804('0x7')](),controller[_0xc804('0x8')]);router['get'](_0xc804('0x9'),auth[_0xc804('0x7')](),controller[_0xc804('0xa')]);router[_0xc804('0xb')](_0xc804('0xc'),auth[_0xc804('0x7')](),controller[_0xc804('0xd')]);router[_0xc804('0xe')]('/',auth[_0xc804('0x7')](),controller[_0xc804('0xf')]);router[_0xc804('0x10')](_0xc804('0xc'),auth[_0xc804('0x7')](),controller[_0xc804('0x11')]);router[_0xc804('0x12')]('/:id',auth[_0xc804('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x9f1b=['show','post','create','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id'];(function(_0xae91a9,_0x5dceb8){var _0x30d73e=function(_0x56ed3c){while(--_0x56ed3c){_0xae91a9['push'](_0xae91a9['shift']());}};_0x30d73e(++_0x5dceb8);}(_0x9f1b,0xa7));var _0xb9f1=function(_0x1b251c,_0x11dee8){_0x1b251c=_0x1b251c-0x0;var _0x8e805b=_0x9f1b[_0x1b251c];return _0x8e805b;};'use strict';var multer=require('multer');var util=require(_0xb9f1('0x0'));var path=require('path');var timeout=require(_0xb9f1('0x1'));var express=require(_0xb9f1('0x2'));var router=express[_0xb9f1('0x3')]();var fs_extra=require(_0xb9f1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb9f1('0x5'));var config=require(_0xb9f1('0x6'));var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xb9f1('0x7')](),controller[_0xb9f1('0x8')]);router[_0xb9f1('0x9')](_0xb9f1('0xa'),auth[_0xb9f1('0x7')](),controller[_0xb9f1('0xb')]);router[_0xb9f1('0x9')](_0xb9f1('0xc'),auth['isAuthenticated'](),controller[_0xb9f1('0xd')]);router[_0xb9f1('0xe')]('/',auth[_0xb9f1('0x7')](),controller[_0xb9f1('0xf')]);router['put'](_0xb9f1('0xc'),auth[_0xb9f1('0x7')](),controller['update']);router['delete'](_0xb9f1('0xc'),auth[_0xb9f1('0x7')](),controller[_0xb9f1('0x10')]);module[_0xb9f1('0x11')]=router;
\ No newline at end of file
index fd9eb90..b1e8e46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7c=['setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','STRING','BOOLEAN'];(function(_0x1f6e37,_0x560390){var _0x3d17ad=function(_0x23a623){while(--_0x23a623){_0x1f6e37['push'](_0x1f6e37['shift']());}};_0x3d17ad(++_0x560390);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2ac9d4,_0xa18b7c){_0x2ac9d4=_0x2ac9d4-0x0;var _0x5f4c45=_0x1c7c[_0x2ac9d4];return _0x5f4c45;};'use strict';var Sequelize=require(_0xc1c7('0x0'));module[_0xc1c7('0x1')]={'name':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xc1c7('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0xc1c7('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc1c7('0x2')],'set':function(_0x20dad3){this[_0xc1c7('0x4')](_0xc1c7('0x5'),_0x20dad3?_0x20dad3[_0xc1c7('0x6')](''):[]);},'get':function(){return this[_0xc1c7('0x7')](_0xc1c7('0x5'))?this[_0xc1c7('0x7')](_0xc1c7('0x5'))[_0xc1c7('0x8')](''):[];}}};
\ No newline at end of file
+var _0x056b=['getDataValue','split','exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join'];(function(_0x4c8da1,_0x1b2b53){var _0x3766ee=function(_0x272977){while(--_0x272977){_0x4c8da1['push'](_0x4c8da1['shift']());}};_0x3766ee(++_0x1b2b53);}(_0x056b,0xb6));var _0xb056=function(_0x5a483f,_0x451854){_0x5a483f=_0x5a483f-0x0;var _0x45a963=_0x056b[_0x5a483f];return _0x45a963;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xb056('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb056('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xb056('0x1')],'set':function(_0x4157e0){this[_0xb056('0x4')](_0xb056('0x5'),_0x4157e0?_0x4157e0[_0xb056('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0xb056('0x5'))?this[_0xb056('0x7')](_0xb056('0x5'))[_0xb056('0x8')](''):[];}}};
\ No newline at end of file
index 5c5b38c..c151764 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabc8=['include','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','error','stack','name','map','UserProfileSection','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options'];(function(_0x283e7e,_0x513284){var _0x50b0c6=function(_0x409b0e){while(--_0x409b0e){_0x283e7e['push'](_0x283e7e['shift']());}};_0x50b0c6(++_0x513284);}(_0xabc8,0x12d));var _0x8abc=function(_0x3a60b8,_0x47caab){_0x3a60b8=_0x3a60b8-0x0;var _0x4eb583=_0xabc8[_0x3a60b8];return _0x4eb583;};'use strict';var emlformat=require(_0x8abc('0x0'));var rimraf=require(_0x8abc('0x1'));var zipdir=require(_0x8abc('0x2'));var jsonpatch=require(_0x8abc('0x3'));var rp=require(_0x8abc('0x4'));var moment=require('moment');var BPromise=require(_0x8abc('0x5'));var Mustache=require(_0x8abc('0x6'));var util=require(_0x8abc('0x7'));var path=require('path');var sox=require(_0x8abc('0x8'));var csv=require(_0x8abc('0x9'));var ejs=require(_0x8abc('0xa'));var fs=require('fs');var fs_extra=require(_0x8abc('0xb'));var _=require(_0x8abc('0xc'));var squel=require(_0x8abc('0xd'));var crypto=require(_0x8abc('0xe'));var jsforce=require(_0x8abc('0xf'));var deskjs=require(_0x8abc('0x10'));var toCsv=require(_0x8abc('0x9'));var querystring=require(_0x8abc('0x11'));var Papa=require(_0x8abc('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8abc('0x13'));var as=require(_0x8abc('0x14'));var hardwareService=require(_0x8abc('0x15'));var logger=require('../../config/logger')(_0x8abc('0x16'));var utils=require(_0x8abc('0x17'));var config=require(_0x8abc('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x610263,_0x53b0fc){_0x53b0fc=_0x53b0fc||0xcc;return function(_0x6a7f66){if(_0x6a7f66){return _0x610263[_0x8abc('0x19')](_0x53b0fc);}return _0x610263[_0x8abc('0x1a')](_0x53b0fc)[_0x8abc('0x1b')]();};}function respondWithResult(_0x20715b,_0xa1bd3f){_0xa1bd3f=_0xa1bd3f||0xc8;return function(_0x12fe65){if(_0x12fe65){return _0x20715b[_0x8abc('0x1a')](_0xa1bd3f)[_0x8abc('0x1c')](_0x12fe65);}};}function respondWithFilteredResult(_0x293b47,_0x18bedb){return function(_0x11278d){if(_0x11278d){var _0x3c5481=typeof _0x18bedb[_0x8abc('0x1d')]==='undefined'&&typeof _0x18bedb[_0x8abc('0x1e')]===_0x8abc('0x1f');var _0x5ba4b7=_0x11278d[_0x8abc('0x20')];var _0x234b9d=_0x3c5481?0x0:_0x18bedb[_0x8abc('0x1d')];var _0x3a1596=_0x3c5481?_0x11278d['count']:_0x18bedb[_0x8abc('0x1d')]+_0x18bedb[_0x8abc('0x1e')];var _0x1eebd1;if(_0x3a1596>=_0x5ba4b7){_0x3a1596=_0x5ba4b7;_0x1eebd1=0xc8;}else{_0x1eebd1=0xce;}_0x293b47[_0x8abc('0x1a')](_0x1eebd1);return _0x293b47[_0x8abc('0x21')](_0x8abc('0x22'),_0x234b9d+'-'+_0x3a1596+'/'+_0x5ba4b7)[_0x8abc('0x1c')](_0x11278d);}return null;};}function patchUpdates(_0x418cf7){return function(_0x553c4e){try{jsonpatch['apply'](_0x553c4e,_0x418cf7,!![]);}catch(_0x5dcbd0){return BPromise[_0x8abc('0x23')](_0x5dcbd0);}return _0x553c4e['save']();};}function saveUpdates(_0x54200d,_0x197ff0){return function(_0x1be7aa){if(_0x1be7aa){return _0x1be7aa[_0x8abc('0x24')](_0x54200d)[_0x8abc('0x25')](function(_0x220846){return _0x220846;});}return null;};}function removeEntity(_0x41b466,_0x598dc4){return function(_0x527459){if(_0x527459){return _0x527459[_0x8abc('0x26')]()[_0x8abc('0x25')](function(){_0x41b466[_0x8abc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x394582,_0x121f74){return function(_0x562fa4){if(!_0x562fa4){_0x394582['sendStatus'](0x194);}return _0x562fa4;};}function handleError(_0x346121,_0x14cc76){_0x14cc76=_0x14cc76||0x1f4;return function(_0x1c7a6b){logger[_0x8abc('0x27')](_0x1c7a6b[_0x8abc('0x28')]);if(_0x1c7a6b['name']){delete _0x1c7a6b[_0x8abc('0x29')];}_0x346121[_0x8abc('0x1a')](_0x14cc76)['send'](_0x1c7a6b);};}exports['index']=function(_0x4b1451,_0x5df8b9){var _0x50c3b7={},_0x1f1d5f={},_0x43f348={'count':0x0,'rows':[]};var _0x47fcaa=_[_0x8abc('0x2a')](db[_0x8abc('0x2b')][_0x8abc('0x2c')],function(_0x444631){return{'name':_0x444631[_0x8abc('0x2d')],'type':_0x444631[_0x8abc('0x2e')]['key']};});_0x1f1d5f['model']=_[_0x8abc('0x2a')](_0x47fcaa,_0x8abc('0x29'));_0x1f1d5f[_0x8abc('0x2f')]=_[_0x8abc('0x30')](_0x4b1451[_0x8abc('0x2f')]);_0x1f1d5f[_0x8abc('0x31')]=_[_0x8abc('0x32')](_0x1f1d5f['model'],_0x1f1d5f['query']);_0x50c3b7[_0x8abc('0x33')]=_[_0x8abc('0x32')](_0x1f1d5f['model'],qs['fields'](_0x4b1451[_0x8abc('0x2f')][_0x8abc('0x34')]));_0x50c3b7['attributes']=_0x50c3b7[_0x8abc('0x33')][_0x8abc('0x35')]?_0x50c3b7[_0x8abc('0x33')]:_0x1f1d5f[_0x8abc('0x36')];if(!_0x4b1451['query'][_0x8abc('0x37')](_0x8abc('0x38'))){_0x50c3b7['limit']=qs[_0x8abc('0x1e')](_0x4b1451[_0x8abc('0x2f')][_0x8abc('0x1e')]);_0x50c3b7[_0x8abc('0x1d')]=qs['offset'](_0x4b1451[_0x8abc('0x2f')]['offset']);}_0x50c3b7[_0x8abc('0x39')]=qs['sort'](_0x4b1451['query'][_0x8abc('0x3a')]);_0x50c3b7['where']=qs[_0x8abc('0x31')](_['pick'](_0x4b1451[_0x8abc('0x2f')],_0x1f1d5f['filters']),_0x47fcaa);if(_0x4b1451['query'][_0x8abc('0x3b')]){_0x50c3b7[_0x8abc('0x3c')]=_[_0x8abc('0x3d')](_0x50c3b7[_0x8abc('0x3c')],{'$or':_['map'](_0x47fcaa,function(_0x1bbc00){if(_0x1bbc00[_0x8abc('0x2e')]!==_0x8abc('0x3e')){var _0x14e902={};_0x14e902[_0x1bbc00[_0x8abc('0x29')]]={'$like':'%'+_0x4b1451['query']['filter']+'%'};return _0x14e902;}})});}_0x50c3b7=_[_0x8abc('0x3d')]({},_0x50c3b7,_0x4b1451[_0x8abc('0x3f')]);var _0x29b2a7={'where':_0x50c3b7[_0x8abc('0x3c')]};return db[_0x8abc('0x2b')]['count'](_0x29b2a7)[_0x8abc('0x25')](function(_0x28f400){_0x43f348[_0x8abc('0x20')]=_0x28f400;if(_0x4b1451[_0x8abc('0x2f')]['includeAll']){_0x50c3b7[_0x8abc('0x40')]=[{'all':!![]}];}return db[_0x8abc('0x2b')][_0x8abc('0x41')](_0x50c3b7);})['then'](function(_0x3e3771){_0x43f348[_0x8abc('0x42')]=_0x3e3771;return _0x43f348;})[_0x8abc('0x25')](respondWithFilteredResult(_0x5df8b9,_0x50c3b7))[_0x8abc('0x43')](handleError(_0x5df8b9,null));};exports[_0x8abc('0x44')]=function(_0x7604be,_0xf05527){var _0x291c74={'raw':![],'where':{'id':_0x7604be[_0x8abc('0x45')]['id']}},_0x3aa040={};_0x3aa040[_0x8abc('0x36')]=_['keys'](db['UserProfileSection'][_0x8abc('0x2c')]);_0x3aa040[_0x8abc('0x2f')]=_[_0x8abc('0x30')](_0x7604be[_0x8abc('0x2f')]);_0x3aa040[_0x8abc('0x31')]=_[_0x8abc('0x32')](_0x3aa040['model'],_0x3aa040[_0x8abc('0x2f')]);_0x291c74['attributes']=_['intersection'](_0x3aa040[_0x8abc('0x36')],qs[_0x8abc('0x34')](_0x7604be['query'][_0x8abc('0x34')]));_0x291c74['attributes']=_0x291c74[_0x8abc('0x33')][_0x8abc('0x35')]?_0x291c74['attributes']:_0x3aa040['model'];if(_0x7604be['query']['includeAll']){_0x291c74['include']=[{'all':!![]}];}_0x291c74=_[_0x8abc('0x3d')]({},_0x291c74,_0x7604be[_0x8abc('0x3f')]);return db[_0x8abc('0x2b')][_0x8abc('0x46')](_0x291c74)['then'](handleEntityNotFound(_0xf05527,null))['then'](respondWithResult(_0xf05527,null))['catch'](handleError(_0xf05527,null));};exports['create']=function(_0x2ec807,_0x2ac1f4){return db[_0x8abc('0x2b')]['create'](_0x2ec807[_0x8abc('0x47')],{})[_0x8abc('0x25')](respondWithResult(_0x2ac1f4,0xc9))[_0x8abc('0x43')](handleError(_0x2ac1f4,null));};exports[_0x8abc('0x24')]=function(_0x2c3791,_0x4812fb){if(_0x2c3791[_0x8abc('0x47')]['id']){delete _0x2c3791['body']['id'];}return db[_0x8abc('0x2b')]['find']({'where':{'id':_0x2c3791[_0x8abc('0x45')]['id']}})['then'](handleEntityNotFound(_0x4812fb,null))[_0x8abc('0x25')](saveUpdates(_0x2c3791['body'],null))[_0x8abc('0x25')](respondWithResult(_0x4812fb,null))['catch'](handleError(_0x4812fb,null));};exports[_0x8abc('0x26')]=function(_0xed4522,_0x9b1595){return db[_0x8abc('0x2b')][_0x8abc('0x46')]({'where':{'id':_0xed4522[_0x8abc('0x45')]['id']}})[_0x8abc('0x25')](handleEntityNotFound(_0x9b1595,null))[_0x8abc('0x25')](removeEntity(_0x9b1595,null))[_0x8abc('0x43')](handleError(_0x9b1595,null));};exports[_0x8abc('0x48')]=function(_0x37d03b,_0x319380){return db[_0x8abc('0x2b')][_0x8abc('0x48')]()[_0x8abc('0x25')](respondWithResult(_0x319380,null))['catch'](handleError(_0x319380,null));};
\ No newline at end of file
+var _0x98de=['intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','map','UserProfileSection','fieldName','type','key','model','keys'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x98de,0x1ce));var _0xe98d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x98de[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe98d('0x0'));var jsonpatch=require(_0xe98d('0x1'));var rp=require('request-promise');var moment=require(_0xe98d('0x2'));var BPromise=require(_0xe98d('0x3'));var Mustache=require('mustache');var util=require(_0xe98d('0x4'));var path=require(_0xe98d('0x5'));var sox=require(_0xe98d('0x6'));var csv=require(_0xe98d('0x7'));var ejs=require(_0xe98d('0x8'));var fs=require('fs');var fs_extra=require(_0xe98d('0x9'));var _=require(_0xe98d('0xa'));var squel=require(_0xe98d('0xb'));var crypto=require(_0xe98d('0xc'));var jsforce=require(_0xe98d('0xd'));var deskjs=require(_0xe98d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe98d('0xf'));var Papa=require(_0xe98d('0x10'));var Redis=require(_0xe98d('0x11'));var authService=require(_0xe98d('0x12'));var qs=require(_0xe98d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe98d('0x14'))(_0xe98d('0x15'));var utils=require('../../config/utils');var config=require(_0xe98d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe98d('0x17'))['db'];function respondWithStatusCode(_0x232401,_0x100376){_0x100376=_0x100376||0xcc;return function(_0x19e123){if(_0x19e123){return _0x232401[_0xe98d('0x18')](_0x100376);}return _0x232401[_0xe98d('0x19')](_0x100376)[_0xe98d('0x1a')]();};}function respondWithResult(_0x4efe21,_0x4dcfa1){_0x4dcfa1=_0x4dcfa1||0xc8;return function(_0x1c6967){if(_0x1c6967){return _0x4efe21[_0xe98d('0x19')](_0x4dcfa1)[_0xe98d('0x1b')](_0x1c6967);}};}function respondWithFilteredResult(_0x1d0bdc,_0x20f2b0){return function(_0x3c531d){if(_0x3c531d){var _0x1ba94a=typeof _0x20f2b0[_0xe98d('0x1c')]==='undefined'&&typeof _0x20f2b0[_0xe98d('0x1d')]===_0xe98d('0x1e');var _0x1f0d74=_0x3c531d[_0xe98d('0x1f')];var _0x23d781=_0x1ba94a?0x0:_0x20f2b0['offset'];var _0x1fc61f=_0x1ba94a?_0x3c531d[_0xe98d('0x1f')]:_0x20f2b0['offset']+_0x20f2b0[_0xe98d('0x1d')];var _0x1912b2;if(_0x1fc61f>=_0x1f0d74){_0x1fc61f=_0x1f0d74;_0x1912b2=0xc8;}else{_0x1912b2=0xce;}_0x1d0bdc[_0xe98d('0x19')](_0x1912b2);return _0x1d0bdc[_0xe98d('0x20')]('Content-Range',_0x23d781+'-'+_0x1fc61f+'/'+_0x1f0d74)[_0xe98d('0x1b')](_0x3c531d);}return null;};}function patchUpdates(_0x5bc8ed){return function(_0x1a620e){try{jsonpatch[_0xe98d('0x21')](_0x1a620e,_0x5bc8ed,!![]);}catch(_0x1e523a){return BPromise[_0xe98d('0x22')](_0x1e523a);}return _0x1a620e[_0xe98d('0x23')]();};}function saveUpdates(_0x14a082,_0x419aec){return function(_0x2891fe){if(_0x2891fe){return _0x2891fe[_0xe98d('0x24')](_0x14a082)[_0xe98d('0x25')](function(_0x15f966){return _0x15f966;});}return null;};}function removeEntity(_0x3d754e,_0x14216b){return function(_0x35d5cf){if(_0x35d5cf){return _0x35d5cf[_0xe98d('0x26')]()[_0xe98d('0x25')](function(){_0x3d754e[_0xe98d('0x19')](0xcc)[_0xe98d('0x1a')]();});}};}function handleEntityNotFound(_0x17b227,_0x4c4682){return function(_0x24a920){if(!_0x24a920){_0x17b227[_0xe98d('0x18')](0x194);}return _0x24a920;};}function handleError(_0x9e003a,_0x337a5c){_0x337a5c=_0x337a5c||0x1f4;return function(_0x5bbfff){logger['error'](_0x5bbfff[_0xe98d('0x27')]);if(_0x5bbfff[_0xe98d('0x28')]){delete _0x5bbfff['name'];}_0x9e003a[_0xe98d('0x19')](_0x337a5c)[_0xe98d('0x29')](_0x5bbfff);};}exports['index']=function(_0x33b480,_0x433fe1){var _0x23ece1={},_0x2125f5={},_0x192933={'count':0x0,'rows':[]};var _0x2fd2e5=_[_0xe98d('0x2a')](db[_0xe98d('0x2b')]['rawAttributes'],function(_0x1e016d){return{'name':_0x1e016d[_0xe98d('0x2c')],'type':_0x1e016d[_0xe98d('0x2d')][_0xe98d('0x2e')]};});_0x2125f5[_0xe98d('0x2f')]=_[_0xe98d('0x2a')](_0x2fd2e5,_0xe98d('0x28'));_0x2125f5['query']=_[_0xe98d('0x30')](_0x33b480['query']);_0x2125f5['filters']=_[_0xe98d('0x31')](_0x2125f5[_0xe98d('0x2f')],_0x2125f5[_0xe98d('0x32')]);_0x23ece1[_0xe98d('0x33')]=_[_0xe98d('0x31')](_0x2125f5[_0xe98d('0x2f')],qs[_0xe98d('0x34')](_0x33b480[_0xe98d('0x32')][_0xe98d('0x34')]));_0x23ece1[_0xe98d('0x33')]=_0x23ece1[_0xe98d('0x33')][_0xe98d('0x35')]?_0x23ece1[_0xe98d('0x33')]:_0x2125f5[_0xe98d('0x2f')];if(!_0x33b480[_0xe98d('0x32')][_0xe98d('0x36')](_0xe98d('0x37'))){_0x23ece1[_0xe98d('0x1d')]=qs['limit'](_0x33b480['query']['limit']);_0x23ece1['offset']=qs['offset'](_0x33b480[_0xe98d('0x32')][_0xe98d('0x1c')]);}_0x23ece1['order']=qs[_0xe98d('0x38')](_0x33b480[_0xe98d('0x32')][_0xe98d('0x38')]);_0x23ece1[_0xe98d('0x39')]=qs[_0xe98d('0x3a')](_['pick'](_0x33b480[_0xe98d('0x32')],_0x2125f5[_0xe98d('0x3a')]),_0x2fd2e5);if(_0x33b480[_0xe98d('0x32')][_0xe98d('0x3b')]){_0x23ece1[_0xe98d('0x39')]=_[_0xe98d('0x3c')](_0x23ece1[_0xe98d('0x39')],{'$or':_['map'](_0x2fd2e5,function(_0x52db19){if(_0x52db19[_0xe98d('0x2d')]!=='VIRTUAL'){var _0xb46105={};_0xb46105[_0x52db19['name']]={'$like':'%'+_0x33b480[_0xe98d('0x32')][_0xe98d('0x3b')]+'%'};return _0xb46105;}})});}_0x23ece1=_['merge']({},_0x23ece1,_0x33b480[_0xe98d('0x3d')]);var _0x74d59={'where':_0x23ece1['where']};return db[_0xe98d('0x2b')][_0xe98d('0x1f')](_0x74d59)[_0xe98d('0x25')](function(_0x5c88c6){_0x192933[_0xe98d('0x1f')]=_0x5c88c6;if(_0x33b480['query'][_0xe98d('0x3e')]){_0x23ece1[_0xe98d('0x3f')]=[{'all':!![]}];}return db['UserProfileSection']['findAll'](_0x23ece1);})[_0xe98d('0x25')](function(_0x4930b0){_0x192933[_0xe98d('0x40')]=_0x4930b0;return _0x192933;})[_0xe98d('0x25')](respondWithFilteredResult(_0x433fe1,_0x23ece1))[_0xe98d('0x41')](handleError(_0x433fe1,null));};exports[_0xe98d('0x42')]=function(_0x3babad,_0x19c108){var _0xf70cd={'raw':![],'where':{'id':_0x3babad[_0xe98d('0x43')]['id']}},_0x346b33={};_0x346b33['model']=_[_0xe98d('0x30')](db[_0xe98d('0x2b')][_0xe98d('0x44')]);_0x346b33[_0xe98d('0x32')]=_[_0xe98d('0x30')](_0x3babad[_0xe98d('0x32')]);_0x346b33[_0xe98d('0x3a')]=_[_0xe98d('0x31')](_0x346b33['model'],_0x346b33[_0xe98d('0x32')]);_0xf70cd[_0xe98d('0x33')]=_[_0xe98d('0x31')](_0x346b33[_0xe98d('0x2f')],qs[_0xe98d('0x34')](_0x3babad[_0xe98d('0x32')][_0xe98d('0x34')]));_0xf70cd[_0xe98d('0x33')]=_0xf70cd[_0xe98d('0x33')][_0xe98d('0x35')]?_0xf70cd['attributes']:_0x346b33[_0xe98d('0x2f')];if(_0x3babad[_0xe98d('0x32')][_0xe98d('0x3e')]){_0xf70cd[_0xe98d('0x3f')]=[{'all':!![]}];}_0xf70cd=_[_0xe98d('0x3c')]({},_0xf70cd,_0x3babad[_0xe98d('0x3d')]);return db[_0xe98d('0x2b')][_0xe98d('0x45')](_0xf70cd)[_0xe98d('0x25')](handleEntityNotFound(_0x19c108,null))['then'](respondWithResult(_0x19c108,null))[_0xe98d('0x41')](handleError(_0x19c108,null));};exports[_0xe98d('0x46')]=function(_0x1bc8f6,_0x2b18e0){return db['UserProfileSection']['create'](_0x1bc8f6['body'],{})[_0xe98d('0x25')](respondWithResult(_0x2b18e0,0xc9))[_0xe98d('0x41')](handleError(_0x2b18e0,null));};exports[_0xe98d('0x24')]=function(_0x5d5c23,_0x20558c){if(_0x5d5c23['body']['id']){delete _0x5d5c23[_0xe98d('0x47')]['id'];}return db[_0xe98d('0x2b')][_0xe98d('0x45')]({'where':{'id':_0x5d5c23['params']['id']}})[_0xe98d('0x25')](handleEntityNotFound(_0x20558c,null))[_0xe98d('0x25')](saveUpdates(_0x5d5c23[_0xe98d('0x47')],null))[_0xe98d('0x25')](respondWithResult(_0x20558c,null))[_0xe98d('0x41')](handleError(_0x20558c,null));};exports[_0xe98d('0x26')]=function(_0x2b7a21,_0x309794){return db['UserProfileSection']['find']({'where':{'id':_0x2b7a21['params']['id']}})['then'](handleEntityNotFound(_0x309794,null))[_0xe98d('0x25')](removeEntity(_0x309794,null))[_0xe98d('0x41')](handleError(_0x309794,null));};exports[_0xe98d('0x48')]=function(_0x5eaf62,_0x29270){return db['UserProfileSection'][_0xe98d('0x48')]()[_0xe98d('0x25')](respondWithResult(_0x29270,null))[_0xe98d('0x41')](handleError(_0x29270,null));};
\ No newline at end of file
index 3f98271..926680b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb054=['compositeIndex','sectionId','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0xb054,0x128));var _0x4b05=function(_0x4fbdc0,_0x5bf025){_0x4fbdc0=_0x4fbdc0-0x0;var _0x2ed5b4=_0xb054[_0x4fbdc0];return _0x2ed5b4;};'use strict';var _=require(_0x4b05('0x0'));var util=require(_0x4b05('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4b05('0x2'));var rp=require(_0x4b05('0x3'));var fs=require('fs');var path=require(_0x4b05('0x4'));var rimraf=require(_0x4b05('0x5'));var config=require(_0x4b05('0x6'));var attributes=require(_0x4b05('0x7'));module[_0x4b05('0x8')]=function(_0x30f394,_0x5cef1e){return _0x30f394[_0x4b05('0x9')](_0x4b05('0xa'),attributes,{'tableName':_0x4b05('0xb'),'paranoid':![],'indexes':[{'name':_0x4b05('0xc'),'fields':[_0x4b05('0xd'),'userProfileId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4cb=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x15321a,_0x2fde29){var _0x41d297=function(_0x264acb){while(--_0x264acb){_0x15321a['push'](_0x15321a['shift']());}};_0x41d297(++_0x2fde29);}(_0xa4cb,0x17a));var _0xba4c=function(_0x12c6a0,_0x121b8d){_0x12c6a0=_0x12c6a0-0x0;var _0x358883=_0xa4cb[_0x12c6a0];return _0x358883;};'use strict';var _=require('lodash');var util=require(_0xba4c('0x0'));var logger=require(_0xba4c('0x1'))(_0xba4c('0x2'));var moment=require(_0xba4c('0x3'));var BPromise=require(_0xba4c('0x4'));var rp=require(_0xba4c('0x5'));var fs=require('fs');var path=require(_0xba4c('0x6'));var rimraf=require(_0xba4c('0x7'));var config=require(_0xba4c('0x8'));var attributes=require(_0xba4c('0x9'));module[_0xba4c('0xa')]=function(_0x55f923,_0x5f0234){return _0x55f923[_0xba4c('0xb')](_0xba4c('0xc'),attributes,{'tableName':_0xba4c('0xd'),'paranoid':![],'indexes':[{'name':_0xba4c('0xe'),'fields':[_0xba4c('0xf'),_0xba4c('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index fe8712f..121c878 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa04f=['result','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','UserProfileSection,\x20%s,\x20%s'];(function(_0x1e44b0,_0x48f712){var _0x5570e4=function(_0x2180ee){while(--_0x2180ee){_0x1e44b0['push'](_0x1e44b0['shift']());}};_0x5570e4(++_0x48f712);}(_0xa04f,0x9a));var _0xfa04=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xa04f[_0x5f09c5];return _0x426ad9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa04('0x0'));var BPromise=require(_0xfa04('0x1'));var rs=require(_0xfa04('0x2'));var fs=require('fs');var Redis=require(_0xfa04('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfa04('0x4'));var logger=require(_0xfa04('0x5'))('rpc');var config=require(_0xfa04('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa04('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1c56f6,_0x3ec1e8,_0x4c7985){return new BPromise(function(_0x2e7f8d,_0x58ed40){return client[_0xfa04('0x8')](_0x1c56f6,_0x4c7985)[_0xfa04('0x9')](function(_0x395550){logger[_0xfa04('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x3ec1e8,_0xfa04('0xb'));logger['debug'](_0xfa04('0xc'),_0x3ec1e8,_0xfa04('0xb'),JSON[_0xfa04('0xd')](_0x395550));if(_0x395550[_0xfa04('0xe')]){if(_0x395550['error']['code']===0x1f4){logger[_0xfa04('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x3ec1e8,_0x395550[_0xfa04('0xe')][_0xfa04('0xf')]);return _0x58ed40(_0x395550[_0xfa04('0xe')][_0xfa04('0xf')]);}logger[_0xfa04('0xe')](_0xfa04('0x10'),_0x3ec1e8,_0x395550['error'][_0xfa04('0xf')]);return _0x2e7f8d(_0x395550[_0xfa04('0xe')][_0xfa04('0xf')]);}else{logger[_0xfa04('0xa')](_0xfa04('0x10'),_0x3ec1e8,'request\x20sent');_0x2e7f8d(_0x395550[_0xfa04('0x11')][_0xfa04('0xf')]);}})[_0xfa04('0x12')](function(_0x2fa8b8){logger[_0xfa04('0xe')](_0xfa04('0x10'),_0x3ec1e8,_0x2fa8b8);_0x58ed40(_0x2fa8b8);});});}
\ No newline at end of file
+var _0xcb91=['message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x571bbc,_0x242132){var _0x3e8edb=function(_0x5cc0a2){while(--_0x5cc0a2){_0x571bbc['push'](_0x571bbc['shift']());}};_0x3e8edb(++_0x242132);}(_0xcb91,0x117));var _0x1cb9=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0xcb91[_0x274dd7];return _0x148829;};'use strict';var _=require(_0x1cb9('0x0'));var util=require(_0x1cb9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require(_0x1cb9('0x4'))['db'];var utils=require(_0x1cb9('0x5'));var logger=require('../../config/logger')(_0x1cb9('0x6'));var config=require(_0x1cb9('0x7'));var jayson=require(_0x1cb9('0x8'));var client=jayson[_0x1cb9('0x9')][_0x1cb9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29b47a,_0x4a5cb5,_0x4f37ee){return new BPromise(function(_0x150587,_0x251e84){return client[_0x1cb9('0xb')](_0x29b47a,_0x4f37ee)[_0x1cb9('0xc')](function(_0x2b7131){logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4a5cb5,_0x1cb9('0xf'));logger['debug'](_0x1cb9('0x10'),_0x4a5cb5,_0x1cb9('0xf'),JSON[_0x1cb9('0x11')](_0x2b7131));if(_0x2b7131[_0x1cb9('0x12')]){if(_0x2b7131[_0x1cb9('0x12')][_0x1cb9('0x13')]===0x1f4){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4a5cb5,_0x2b7131[_0x1cb9('0x12')][_0x1cb9('0x14')]);return _0x251e84(_0x2b7131[_0x1cb9('0x12')]['message']);}logger[_0x1cb9('0x12')](_0x1cb9('0xe'),_0x4a5cb5,_0x2b7131[_0x1cb9('0x12')][_0x1cb9('0x14')]);return _0x150587(_0x2b7131[_0x1cb9('0x12')][_0x1cb9('0x14')]);}else{logger[_0x1cb9('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x4a5cb5,_0x1cb9('0xf'));_0x150587(_0x2b7131[_0x1cb9('0x15')]['message']);}})[_0x1cb9('0x16')](function(_0x32de24){logger['error']('UserProfileSection,\x20%s,\x20%s',_0x4a5cb5,_0x32de24);_0x251e84(_0x32de24);});});}
\ No newline at end of file
index 7a0159f..5fe1b83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2eefa8,_0x1647c2){var _0x2c51c5=function(_0x499570){while(--_0x499570){_0x2eefa8['push'](_0x2eefa8['shift']());}};_0x2c51c5(++_0x1647c2);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1feb9d,_0x368fd1){var _0x52d807=function(_0x499bd9){while(--_0x499bd9){_0x1feb9d['push'](_0x1feb9d['shift']());}};_0x52d807(++_0x368fd1);}(_0x70e0,0x17b));var _0x070e=function(_0x2374d4,_0x182b5a){_0x2374d4=_0x2374d4-0x0;var _0x4e51b0=_0x70e0[_0x2374d4];return _0x4e51b0;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 44e4572..cb0c4a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7979=['INTEGER'];(function(_0x4ed14a,_0x4f0171){var _0x256fbc=function(_0x184b4a){while(--_0x184b4a){_0x4ed14a['push'](_0x4ed14a['shift']());}};_0x256fbc(++_0x4f0171);}(_0x7979,0xeb));var _0x9797=function(_0x236f56,_0x3593aa){_0x236f56=_0x236f56-0x0;var _0x2d0c09=_0x7979[_0x236f56];return _0x2d0c09;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x9797('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe6c9=['sequelize','exports'];(function(_0x19e3c2,_0x177a95){var _0x2bb88f=function(_0x165f84){while(--_0x165f84){_0x19e3c2['push'](_0x19e3c2['shift']());}};_0x2bb88f(++_0x177a95);}(_0xe6c9,0x168));var _0x9e6c=function(_0x6de168,_0x48932c){_0x6de168=_0x6de168-0x0;var _0x449357=_0xe6c9[_0x6de168];return _0x449357;};'use strict';var Sequelize=require(_0x9e6c('0x0'));module[_0x9e6c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index c6c6fbf..edf436d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8e=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues'];(function(_0x3c36a5,_0x6c8d64){var _0x55fb14=function(_0x294cee){while(--_0x294cee){_0x3c36a5['push'](_0x3c36a5['shift']());}};_0x55fb14(++_0x6c8d64);}(_0x8b8e,0x108));var _0xe8b8=function(_0xfbce65,_0x3f2d34){_0xfbce65=_0xfbce65-0x0;var _0x596900=_0x8b8e[_0xfbce65];return _0x596900;};'use strict';var _=require(_0xe8b8('0x0'));var util=require('util');var logger=require(_0xe8b8('0x1'))('api');var moment=require(_0xe8b8('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8b8('0x3'));var rimraf=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var attributes=require(_0xe8b8('0x6'));module[_0xe8b8('0x7')]=function(_0x3f5dd7,_0x1c0548){return _0x3f5dd7[_0xe8b8('0x8')](_0xe8b8('0x9'),attributes,{'tableName':_0xe8b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4fb4=['./userSmsQueue.attributes','exports','define','UserSmsQueue','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4fb4,0x190));var _0x44fb=function(_0x56cde1,_0x3bc23f){_0x56cde1=_0x56cde1-0x0;var _0x2f2157=_0x4fb4[_0x56cde1];return _0x2f2157;};'use strict';var _=require('lodash');var util=require(_0x44fb('0x0'));var logger=require(_0x44fb('0x1'))(_0x44fb('0x2'));var moment=require(_0x44fb('0x3'));var BPromise=require(_0x44fb('0x4'));var rp=require(_0x44fb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var attributes=require(_0x44fb('0x8'));module[_0x44fb('0x9')]=function(_0x375d33,_0x173e70){return _0x375d33[_0x44fb('0xa')](_0x44fb('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a53a161..25bc419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb96=['catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xfb96,0x12c));var _0x6fb9=function(_0x82a302,_0xf61fd7){_0x82a302=_0x82a302-0x0;var _0x5d76ce=_0xfb96[_0x82a302];return _0x5d76ce;};'use strict';var _=require(_0x6fb9('0x0'));var util=require(_0x6fb9('0x1'));var moment=require('moment');var BPromise=require(_0x6fb9('0x2'));var rs=require(_0x6fb9('0x3'));var fs=require('fs');var Redis=require(_0x6fb9('0x4'));var db=require(_0x6fb9('0x5'))['db'];var utils=require(_0x6fb9('0x6'));var logger=require(_0x6fb9('0x7'))(_0x6fb9('0x8'));var config=require(_0x6fb9('0x9'));var jayson=require(_0x6fb9('0xa'));var client=jayson['client'][_0x6fb9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14c92f,_0x244ff5,_0x57e66d){return new BPromise(function(_0x444b90,_0xa9d232){return client[_0x6fb9('0xc')](_0x14c92f,_0x57e66d)[_0x6fb9('0xd')](function(_0x137d72){logger[_0x6fb9('0xe')](_0x6fb9('0xf'),_0x244ff5,'request\x20sent');logger[_0x6fb9('0x10')](_0x6fb9('0x11'),_0x244ff5,_0x6fb9('0x12'),JSON['stringify'](_0x137d72));if(_0x137d72['error']){if(_0x137d72[_0x6fb9('0x13')]['code']===0x1f4){logger[_0x6fb9('0x13')](_0x6fb9('0xf'),_0x244ff5,_0x137d72[_0x6fb9('0x13')][_0x6fb9('0x14')]);return _0xa9d232(_0x137d72[_0x6fb9('0x13')][_0x6fb9('0x14')]);}logger[_0x6fb9('0x13')](_0x6fb9('0xf'),_0x244ff5,_0x137d72['error'][_0x6fb9('0x14')]);return _0x444b90(_0x137d72[_0x6fb9('0x13')][_0x6fb9('0x14')]);}else{logger[_0x6fb9('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x244ff5,'request\x20sent');_0x444b90(_0x137d72[_0x6fb9('0x15')]['message']);}})[_0x6fb9('0x16')](function(_0x32e66f){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x244ff5,_0x32e66f);_0xa9d232(_0x32e66f);});});}
\ No newline at end of file
+var _0xdca4=['code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c6125,_0x3b2a9c){var _0x2f47b8=function(_0x214650){while(--_0x214650){_0x3c6125['push'](_0x3c6125['shift']());}};_0x2f47b8(++_0x3b2a9c);}(_0xdca4,0x87));var _0x4dca=function(_0x162d17,_0x2088d5){_0x162d17=_0x162d17-0x0;var _0x285f10=_0xdca4[_0x162d17];return _0x285f10;};'use strict';var _=require(_0x4dca('0x0'));var util=require(_0x4dca('0x1'));var moment=require('moment');var BPromise=require(_0x4dca('0x2'));var rs=require(_0x4dca('0x3'));var fs=require('fs');var Redis=require(_0x4dca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4dca('0x5'));var logger=require(_0x4dca('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4dca('0x7'));var client=jayson[_0x4dca('0x8')][_0x4dca('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e1f3,_0x5de330,_0x50d388){return new BPromise(function(_0x288394,_0x464c7a){return client[_0x4dca('0xa')](_0x21e1f3,_0x50d388)[_0x4dca('0xb')](function(_0x20c048){logger[_0x4dca('0xc')](_0x4dca('0xd'),_0x5de330,_0x4dca('0xe'));logger[_0x4dca('0xf')](_0x4dca('0x10'),_0x5de330,_0x4dca('0xe'),JSON[_0x4dca('0x11')](_0x20c048));if(_0x20c048[_0x4dca('0x12')]){if(_0x20c048[_0x4dca('0x12')][_0x4dca('0x13')]===0x1f4){logger[_0x4dca('0x12')](_0x4dca('0xd'),_0x5de330,_0x20c048['error'][_0x4dca('0x14')]);return _0x464c7a(_0x20c048['error'][_0x4dca('0x14')]);}logger[_0x4dca('0x12')]('UserSmsQueue,\x20%s,\x20%s',_0x5de330,_0x20c048['error'][_0x4dca('0x14')]);return _0x288394(_0x20c048['error'][_0x4dca('0x14')]);}else{logger[_0x4dca('0xc')](_0x4dca('0xd'),_0x5de330,_0x4dca('0xe'));_0x288394(_0x20c048[_0x4dca('0x15')][_0x4dca('0x14')]);}})['catch'](function(_0x57f803){logger['error'](_0x4dca('0xd'),_0x5de330,_0x57f803);_0x464c7a(_0x57f803);});});}
\ No newline at end of file
index 188badf..8eeb53d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6367=['INTEGER','sequelize'];(function(_0x403c20,_0x4a7b99){var _0x2b271a=function(_0x106ecb){while(--_0x106ecb){_0x403c20['push'](_0x403c20['shift']());}};_0x2b271a(++_0x4a7b99);}(_0x6367,0x1bd));var _0x7636=function(_0x55ff3e,_0x41077f){_0x55ff3e=_0x55ff3e-0x0;var _0x2709eb=_0x6367[_0x55ff3e];return _0x2709eb;};'use strict';var Sequelize=require(_0x7636('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x7636('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x7636('0x1')]}};
\ No newline at end of file
+var _0xf2b4=['INTEGER','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xf2b4,0x8f));var _0x4f2b=function(_0xd602b1,_0x254fb8){_0xd602b1=_0xd602b1-0x0;var _0x44c049=_0xf2b4[_0xd602b1];return _0x44c049;};'use strict';var Sequelize=require(_0x4f2b('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x4f2b('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index b5b1369..4907623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x253a91,_0xa8fea7){var _0x35dc97=function(_0x50e49c){while(--_0x50e49c){_0x253a91['push'](_0x253a91['shift']());}};_0x35dc97(++_0xa8fea7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xfbce77,_0x4f3dec){var _0xa5ab2b=function(_0xe00d88){while(--_0xe00d88){_0xfbce77['push'](_0xfbce77['shift']());}};_0xa5ab2b(++_0x4f3dec);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc7e077..1debe36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c09f9,_0x448a23){var _0x266570=function(_0x558133){while(--_0x558133){_0x5c09f9['push'](_0x5c09f9['shift']());}};_0x266570(++_0x448a23);}(_0x70e0,0x17b));var _0x070e=function(_0x172e29,_0x5e8362){_0x172e29=_0x172e29-0x0;var _0x4a911e=_0x70e0[_0x172e29];return _0x4a911e;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xa8844,_0x58e6e8){var _0x583746=function(_0x434039){while(--_0x434039){_0xa8844['push'](_0xa8844['shift']());}};_0x583746(++_0x58e6e8);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b4575,_0x398753){_0x2b4575=_0x2b4575-0x0;var _0x30ad1c=_0xedd9[_0x2b4575];return _0x30ad1c;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 52df339..7d50cad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x824b=['INTEGER'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x824b,0x10e));var _0xb824=function(_0x56cd36,_0x36b11c){_0x56cd36=_0x56cd36-0x0;var _0x213e95=_0x824b[_0x56cd36];return _0x213e95;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0xb824('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x070c=['exports','INTEGER','sequelize'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x070c,0xfb));var _0xc070=function(_0x156d1d,_0x15f6a1){_0x156d1d=_0x156d1d-0x0;var _0x2af262=_0x070c[_0x156d1d];return _0x2af262;};'use strict';var Sequelize=require(_0xc070('0x0'));module[_0xc070('0x1')]={'penalty':{'type':Sequelize[_0xc070('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 591fd37..63ab860 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f5e=['lodash','api','moment','path','rimraf','./userVoiceQueue.attributes','UserVoiceQueue','user_has_voice_queues'];(function(_0x532788,_0x232362){var _0x23c64f=function(_0x447a2f){while(--_0x447a2f){_0x532788['push'](_0x532788['shift']());}};_0x23c64f(++_0x232362);}(_0x1f5e,0x80));var _0xe1f5=function(_0xe12eb4,_0x3abf24){_0xe12eb4=_0xe12eb4-0x0;var _0xce090a=_0x1f5e[_0xe12eb4];return _0xce090a;};'use strict';var _=require(_0xe1f5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe1f5('0x1'));var moment=require(_0xe1f5('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe1f5('0x3'));var rimraf=require(_0xe1f5('0x4'));var config=require('../../config/environment');var attributes=require(_0xe1f5('0x5'));module['exports']=function(_0x1308a0,_0x1cfb6e){return _0x1308a0['define'](_0xe1f5('0x6'),attributes,{'tableName':_0xe1f5('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf69b=['api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0x919bbb,_0x55ef48){var _0x40971a=function(_0xc823b6){while(--_0xc823b6){_0x919bbb['push'](_0x919bbb['shift']());}};_0x40971a(++_0x55ef48);}(_0xf69b,0x76));var _0xbf69=function(_0xc3aae7,_0x3bfa91){_0xc3aae7=_0xc3aae7-0x0;var _0x1f365a=_0xf69b[_0xc3aae7];return _0x1f365a;};'use strict';var _=require('lodash');var util=require(_0xbf69('0x0'));var logger=require(_0xbf69('0x1'))(_0xbf69('0x2'));var moment=require(_0xbf69('0x3'));var BPromise=require(_0xbf69('0x4'));var rp=require(_0xbf69('0x5'));var fs=require('fs');var path=require(_0xbf69('0x6'));var rimraf=require(_0xbf69('0x7'));var config=require('../../config/environment');var attributes=require(_0xbf69('0x8'));module['exports']=function(_0x3a7d49,_0xc79177){return _0x3a7d49[_0xbf69('0x9')](_0xbf69('0xa'),attributes,{'tableName':_0xbf69('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e8764b..0eacfef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c5=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','bluebird'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x32c5,0xee));var _0x532c=function(_0xafde59,_0x765c42){_0xafde59=_0xafde59-0x0;var _0x519be2=_0x32c5[_0xafde59];return _0x519be2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x532c('0x0'));var BPromise=require(_0x532c('0x1'));var rs=require(_0x532c('0x2'));var fs=require('fs');var Redis=require(_0x532c('0x3'));var db=require(_0x532c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x532c('0x5'))(_0x532c('0x6'));var config=require('../../config/environment');var jayson=require(_0x532c('0x7'));var client=jayson[_0x532c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca506,_0x3f953d,_0x567e3d){return new BPromise(function(_0x5d3930,_0xd829a0){return client[_0x532c('0x9')](_0x5ca506,_0x567e3d)[_0x532c('0xa')](function(_0x2fd65c){logger[_0x532c('0xb')](_0x532c('0xc'),_0x3f953d,_0x532c('0xd'));logger[_0x532c('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3f953d,_0x532c('0xd'),JSON[_0x532c('0xf')](_0x2fd65c));if(_0x2fd65c[_0x532c('0x10')]){if(_0x2fd65c[_0x532c('0x10')][_0x532c('0x11')]===0x1f4){logger[_0x532c('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x3f953d,_0x2fd65c[_0x532c('0x10')][_0x532c('0x12')]);return _0xd829a0(_0x2fd65c['error'][_0x532c('0x12')]);}logger[_0x532c('0x10')](_0x532c('0xc'),_0x3f953d,_0x2fd65c[_0x532c('0x10')][_0x532c('0x12')]);return _0x5d3930(_0x2fd65c[_0x532c('0x10')][_0x532c('0x12')]);}else{logger[_0x532c('0xb')](_0x532c('0xc'),_0x3f953d,_0x532c('0xd'));_0x5d3930(_0x2fd65c[_0x532c('0x13')][_0x532c('0x12')]);}})['catch'](function(_0x2a758a){logger[_0x532c('0x10')](_0x532c('0xc'),_0x3f953d,_0x2a758a);_0xd829a0(_0x2a758a);});});}
\ No newline at end of file
+var _0x5632=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2e3de0,_0x594ead){var _0x520132=function(_0x1a0ff0){while(--_0x1a0ff0){_0x2e3de0['push'](_0x2e3de0['shift']());}};_0x520132(++_0x594ead);}(_0x5632,0x147));var _0x2563=function(_0x6d97a1,_0x2092b3){_0x6d97a1=_0x6d97a1-0x0;var _0x56aefa=_0x5632[_0x6d97a1];return _0x56aefa;};'use strict';var _=require(_0x2563('0x0'));var util=require(_0x2563('0x1'));var moment=require(_0x2563('0x2'));var BPromise=require(_0x2563('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2563('0x4'));var db=require(_0x2563('0x5'))['db'];var utils=require(_0x2563('0x6'));var logger=require(_0x2563('0x7'))(_0x2563('0x8'));var config=require(_0x2563('0x9'));var jayson=require(_0x2563('0xa'));var client=jayson['client'][_0x2563('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x100a7d,_0x43595d,_0xe10fe4){return new BPromise(function(_0x1942d9,_0x2e5391){return client[_0x2563('0xc')](_0x100a7d,_0xe10fe4)[_0x2563('0xd')](function(_0x3a46d8){logger[_0x2563('0xe')](_0x2563('0xf'),_0x43595d,_0x2563('0x10'));logger[_0x2563('0x11')](_0x2563('0x12'),_0x43595d,'request\x20sent',JSON[_0x2563('0x13')](_0x3a46d8));if(_0x3a46d8[_0x2563('0x14')]){if(_0x3a46d8['error'][_0x2563('0x15')]===0x1f4){logger['error'](_0x2563('0xf'),_0x43595d,_0x3a46d8[_0x2563('0x14')]['message']);return _0x2e5391(_0x3a46d8['error']['message']);}logger[_0x2563('0x14')](_0x2563('0xf'),_0x43595d,_0x3a46d8[_0x2563('0x14')][_0x2563('0x16')]);return _0x1942d9(_0x3a46d8[_0x2563('0x14')][_0x2563('0x16')]);}else{logger[_0x2563('0xe')](_0x2563('0xf'),_0x43595d,'request\x20sent');_0x1942d9(_0x3a46d8[_0x2563('0x17')][_0x2563('0x16')]);}})[_0x2563('0x18')](function(_0x2c3f96){logger['error'](_0x2563('0xf'),_0x43595d,_0x2c3f96);_0x2e5391(_0x2c3f96);});});}
\ No newline at end of file
index b4c1148..0947e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x3031e5,_0x2a73a9){var _0x2e48b4=function(_0x4bd5cf){while(--_0x4bd5cf){_0x3031e5['push'](_0x3031e5['shift']());}};_0x2e48b4(++_0x2a73a9);}(_0x9c44,0x178));var _0x49c4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x9c44[_0x334841];return _0x5beb4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1d6adf,_0x407e78){var _0x4c014f=function(_0x51b05f){while(--_0x51b05f){_0x1d6adf['push'](_0x1d6adf['shift']());}};_0x4c014f(++_0x407e78);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index 92d97ef..e8bfba3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb646=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x1f3d0b,_0x490396){var _0x5168c4=function(_0x4142a2){while(--_0x4142a2){_0x1f3d0b['push'](_0x1f3d0b['shift']());}};_0x5168c4(++_0x490396);}(_0xb646,0x83));var _0x6b64=function(_0x5dbba9,_0xba1f8e){_0x5dbba9=_0x5dbba9-0x0;var _0x4dcd1d=_0xb646[_0x5dbba9];return _0x4dcd1d;};'use strict';var Sequelize=require(_0x6b64('0x0'));module[_0x6b64('0x1')]={'uniqueid':{'type':Sequelize[_0x6b64('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x6b64('0x3')},'membername':{'type':Sequelize[_0x6b64('0x4')],'allowNull':![],'comment':_0x6b64('0x3')},'UserId':{'type':Sequelize[_0x6b64('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x6b64('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0x6b64('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x6b64('0x4')],'allowNull':![],'unique':_0x6b64('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x6b64('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x6b64('0x2')](0xb),'defaultValue':0x0,'comment':_0x6b64('0x3')}};
\ No newline at end of file
+var _0x3ef1=['Required\x20by\x20Asterisk','STRING','queue_interface','exports','INTEGER'];(function(_0x81dae,_0x4437c9){var _0x2cab87=function(_0x1f1088){while(--_0x1f1088){_0x81dae['push'](_0x81dae['shift']());}};_0x2cab87(++_0x4437c9);}(_0x3ef1,0x99));var _0x13ef=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3ef1[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x13ef('0x0')]={'uniqueid':{'type':Sequelize[_0x13ef('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x13ef('0x2')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x13ef('0x3')],'allowNull':![],'unique':_0x13ef('0x4'),'comment':_0x13ef('0x2')},'VoiceQueueId':{'type':Sequelize[_0x13ef('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x13ef('0x3')],'allowNull':![],'unique':_0x13ef('0x4'),'comment':_0x13ef('0x2')},'penalty':{'type':Sequelize[_0x13ef('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x13ef('0x1')](0xb),'defaultValue':0x0,'comment':_0x13ef('0x2')}};
\ No newline at end of file
index a94ee52..22ec925 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94d7=['remove','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x29abf7,_0x1f3cb0){var _0x22a76d=function(_0x4a1a90){while(--_0x4a1a90){_0x29abf7['push'](_0x29abf7['shift']());}};_0x22a76d(++_0x1f3cb0);}(_0x94d7,0x192));var _0x794d=function(_0x49c89c,_0xb35c3b){_0x49c89c=_0x49c89c-0x0;var _0x4ab65d=_0x94d7[_0x49c89c];return _0x4ab65d;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x794d('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x794d('0x1')](0x0);var events={'afterCreate':_0x794d('0x2'),'afterUpdate':_0x794d('0x3'),'afterDestroy':_0x794d('0x4')};function emitEvent(_0x4a12a2){return function(_0x4d97a5,_0x22f25c,_0x31b798){UserVoiceQueueRtEvents['emit'](_0x4a12a2+':'+_0x4d97a5['id'],_0x4d97a5);UserVoiceQueueRtEvents['emit'](_0x4a12a2,_0x4d97a5);_0x31b798(null);};}for(var e in events){if(events[_0x794d('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x794d('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xabc4=['exports','events','save','update','emit','hasOwnProperty','hook'];(function(_0x547890,_0x593741){var _0x2c8daa=function(_0x1b100d){while(--_0x1b100d){_0x547890['push'](_0x547890['shift']());}};_0x2c8daa(++_0x593741);}(_0xabc4,0x1e4));var _0x4abc=function(_0x1d7599,_0x49929f){_0x1d7599=_0x1d7599-0x0;var _0x55da12=_0xabc4[_0x1d7599];return _0x55da12;};'use strict';var EventEmitter=require(_0x4abc('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4abc('0x1'),'afterUpdate':_0x4abc('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5b69e9){return function(_0x41bb33,_0x58dd16,_0xad52dd){UserVoiceQueueRtEvents[_0x4abc('0x3')](_0x5b69e9+':'+_0x41bb33['id'],_0x41bb33);UserVoiceQueueRtEvents[_0x4abc('0x3')](_0x5b69e9,_0x41bb33);_0xad52dd(null);};}for(var e in events){if(events[_0x4abc('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0x4abc('0x5')](e,emitEvent(event));}}module[_0x4abc('0x6')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 23a25ad..0eea292 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40be=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x22254a,_0x180a3c){var _0x43d62a=function(_0x3dbd4b){while(--_0x3dbd4b){_0x22254a['push'](_0x22254a['shift']());}};_0x43d62a(++_0x180a3c);}(_0x40be,0x12d));var _0xe40b=function(_0x460876,_0x2430e2){_0x460876=_0x460876-0x0;var _0x2bf3a2=_0x40be[_0x460876];return _0x2bf3a2;};'use strict';var _=require(_0xe40b('0x0'));var util=require(_0xe40b('0x1'));var logger=require(_0xe40b('0x2'))(_0xe40b('0x3'));var moment=require(_0xe40b('0x4'));var BPromise=require('bluebird');var rp=require(_0xe40b('0x5'));var fs=require('fs');var path=require(_0xe40b('0x6'));var rimraf=require(_0xe40b('0x7'));var config=require(_0xe40b('0x8'));var attributes=require(_0xe40b('0x9'));module[_0xe40b('0xa')]=function(_0x43d0dc,_0x3e4166){return _0x43d0dc[_0xe40b('0xb')](_0xe40b('0xc'),attributes,{'tableName':_0xe40b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2809=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt','lodash'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x2809,0xef));var _0x9280=function(_0x19f040,_0x4b2d63){_0x19f040=_0x19f040-0x0;var _0x3ea60d=_0x2809[_0x19f040];return _0x3ea60d;};'use strict';var _=require(_0x9280('0x0'));var util=require(_0x9280('0x1'));var logger=require(_0x9280('0x2'))(_0x9280('0x3'));var moment=require('moment');var BPromise=require(_0x9280('0x4'));var rp=require(_0x9280('0x5'));var fs=require('fs');var path=require(_0x9280('0x6'));var rimraf=require(_0x9280('0x7'));var config=require(_0x9280('0x8'));var attributes=require(_0x9280('0x9'));module[_0x9280('0xa')]=function(_0x513c10,_0x19c7c7){return _0x513c10['define'](_0x9280('0xb'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69bd029..54a3db4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27b0=['http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x41284e,_0x580b34){var _0x403f86=function(_0x183d1f){while(--_0x183d1f){_0x41284e['push'](_0x41284e['shift']());}};_0x403f86(++_0x580b34);}(_0x27b0,0x108));var _0x027b=function(_0x67655b,_0x15ff31){_0x67655b=_0x67655b-0x0;var _0x71c09d=_0x27b0[_0x67655b];return _0x71c09d;};'use strict';var _=require(_0x027b('0x0'));var util=require(_0x027b('0x1'));var moment=require(_0x027b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x027b('0x3'))['db'];var utils=require(_0x027b('0x4'));var logger=require(_0x027b('0x5'))('rpc');var config=require(_0x027b('0x6'));var jayson=require(_0x027b('0x7'));var client=jayson['client'][_0x027b('0x8')]({'port':0x232a});config[_0x027b('0x9')]=_[_0x027b('0xa')](config[_0x027b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x027b('0xb'))(new Redis(config[_0x027b('0x9')]));require(_0x027b('0xc'))[_0x027b('0xd')](socket);function respondWithRpcPromise(_0x56041b,_0x20727d,_0x549d57){return new BPromise(function(_0x1d6117,_0x43bd9c){return client[_0x027b('0xe')](_0x56041b,_0x549d57)[_0x027b('0xf')](function(_0x1a4662){logger[_0x027b('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x20727d,_0x027b('0x11'));logger['debug'](_0x027b('0x12'),_0x20727d,'request\x20sent',JSON[_0x027b('0x13')](_0x1a4662));if(_0x1a4662[_0x027b('0x14')]){if(_0x1a4662[_0x027b('0x14')][_0x027b('0x15')]===0x1f4){logger['error'](_0x027b('0x16'),_0x20727d,_0x1a4662['error']['message']);return _0x43bd9c(_0x1a4662[_0x027b('0x14')][_0x027b('0x17')]);}logger[_0x027b('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x20727d,_0x1a4662[_0x027b('0x14')]['message']);return _0x1d6117(_0x1a4662[_0x027b('0x14')][_0x027b('0x17')]);}else{logger[_0x027b('0x10')](_0x027b('0x16'),_0x20727d,'request\x20sent');_0x1d6117(_0x1a4662[_0x027b('0x18')]['message']);}})['catch'](function(_0x1687e7){logger[_0x027b('0x14')](_0x027b('0x16'),_0x20727d,_0x1687e7);_0x43bd9c(_0x1687e7);});});}exports[_0x027b('0x19')]=function(_0x442b32){var _0x3e85ab=this;return new Promise(function(_0x25bb2c,_0x452a0f){return db[_0x027b('0x1a')][_0x027b('0x1b')]({'raw':_0x442b32[_0x027b('0x1c')]?_0x442b32[_0x027b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x442b32['options']?_0x442b32[_0x027b('0x1c')][_0x027b('0x1d')]||null:null,'attributes':[[db[_0x027b('0x1e')]['fn'](_0x027b('0x1f'),db[_0x027b('0x1e')]['fn']('IF',db['sequelize'][_0x027b('0x20')](_0x027b('0x21')))),'outboundQueuePauses']]})[_0x027b('0xf')](function(_0x955985){logger[_0x027b('0x10')]('GetVoiceQueueRtPauses',_0x442b32);logger['debug'](_0x027b('0x19'),_0x442b32,JSON[_0x027b('0x13')](_0x955985));_0x25bb2c(_0x955985);})['catch'](function(_0x9f69eb){logger[_0x027b('0x14')](_0x027b('0x19'),_0x9f69eb[_0x027b('0x17')],_0x442b32);_0x452a0f(_0x3e85ab['error'](0x1f4,_0x9f69eb[_0x027b('0x17')]));});});};
\ No newline at end of file
+var _0xe523=['./userVoiceQueueRt.socket','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x53d122,_0x2df79e){var _0x10584e=function(_0x49c2f9){while(--_0x49c2f9){_0x53d122['push'](_0x53d122['shift']());}};_0x10584e(++_0x2df79e);}(_0xe523,0xab));var _0x3e52=function(_0x88a94f,_0x3cd27d){_0x88a94f=_0x88a94f-0x0;var _0x4db244=_0xe523[_0x88a94f];return _0x4db244;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3e52('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e52('0x1'))['db'];var utils=require(_0x3e52('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x3e52('0x3'));var jayson=require(_0x3e52('0x4'));var client=jayson['client'][_0x3e52('0x5')]({'port':0x232a});config[_0x3e52('0x6')]=_['defaults'](config[_0x3e52('0x6')],{'host':_0x3e52('0x7'),'port':0x18eb});var socket=require(_0x3e52('0x8'))(new Redis(config[_0x3e52('0x6')]));require(_0x3e52('0x9'))[_0x3e52('0xa')](socket);function respondWithRpcPromise(_0x2c188f,_0x1a0f7d,_0x5eb425){return new BPromise(function(_0x18508c,_0x390837){return client['request'](_0x2c188f,_0x5eb425)[_0x3e52('0xb')](function(_0x235a24){logger[_0x3e52('0xc')](_0x3e52('0xd'),_0x1a0f7d,_0x3e52('0xe'));logger[_0x3e52('0xf')](_0x3e52('0x10'),_0x1a0f7d,_0x3e52('0xe'),JSON['stringify'](_0x235a24));if(_0x235a24['error']){if(_0x235a24[_0x3e52('0x11')][_0x3e52('0x12')]===0x1f4){logger[_0x3e52('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1a0f7d,_0x235a24['error'][_0x3e52('0x13')]);return _0x390837(_0x235a24[_0x3e52('0x11')][_0x3e52('0x13')]);}logger[_0x3e52('0x11')](_0x3e52('0xd'),_0x1a0f7d,_0x235a24[_0x3e52('0x11')]['message']);return _0x18508c(_0x235a24['error'][_0x3e52('0x13')]);}else{logger['info'](_0x3e52('0xd'),_0x1a0f7d,_0x3e52('0xe'));_0x18508c(_0x235a24[_0x3e52('0x14')][_0x3e52('0x13')]);}})[_0x3e52('0x15')](function(_0x370ab4){logger[_0x3e52('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x1a0f7d,_0x370ab4);_0x390837(_0x370ab4);});});}exports[_0x3e52('0x16')]=function(_0x3b3115){var _0x2c9a6e=this;return new Promise(function(_0x2d2d78,_0x25a5d7){return db[_0x3e52('0x17')]['findAll']({'raw':_0x3b3115[_0x3e52('0x18')]?_0x3b3115[_0x3e52('0x18')][_0x3e52('0x19')]===undefined?!![]:![]:!![],'where':_0x3b3115['options']?_0x3b3115['options']['where']||null:null,'attributes':[[db[_0x3e52('0x1a')]['fn'](_0x3e52('0x1b'),db[_0x3e52('0x1a')]['fn']('IF',db[_0x3e52('0x1a')]['literal'](_0x3e52('0x1c')))),_0x3e52('0x1d')]]})['then'](function(_0x33f52b){logger[_0x3e52('0xc')]('GetVoiceQueueRtPauses',_0x3b3115);logger[_0x3e52('0xf')](_0x3e52('0x16'),_0x3b3115,JSON['stringify'](_0x33f52b));_0x2d2d78(_0x33f52b);})[_0x3e52('0x15')](function(_0x5647ab){logger[_0x3e52('0x11')]('GetVoiceQueueRtPauses',_0x5647ab[_0x3e52('0x13')],_0x3b3115);_0x25a5d7(_0x2c9a6e[_0x3e52('0x11')](0x1f4,_0x5647ab[_0x3e52('0x13')]));});});};
\ No newline at end of file
index 3e52ad6..b4be666 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf70=['removeListener','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit'];(function(_0x2adf4,_0x5df6de){var _0x45d47d=function(_0x903910){while(--_0x903910){_0x2adf4['push'](_0x2adf4['shift']());}};_0x45d47d(++_0x5df6de);}(_0xdf70,0x86));var _0x0df7=function(_0x41f0df,_0x4f4c31){_0x41f0df=_0x41f0df-0x0;var _0x457d7b=_0xdf70[_0x41f0df];return _0x457d7b;};'use strict';var UserVoiceQueueRtEvents=require(_0x0df7('0x0'));var events=[_0x0df7('0x1'),_0x0df7('0x2'),'update'];function createListener(_0x380bec,_0x2267dd){return function(_0x530905){_0x2267dd[_0x0df7('0x3')](_0x380bec,_0x530905);};}function removeListener(_0x4ae128,_0x278b96){return function(){UserVoiceQueueRtEvents[_0x0df7('0x4')](_0x4ae128,_0x278b96);};}exports['register']=function(_0x523ac0){for(var _0x2521b6=0x0,_0x42090d=events['length'];_0x2521b6<_0x42090d;_0x2521b6++){var _0x1f1680=events[_0x2521b6];var _0x392337=createListener(_0x0df7('0x5')+_0x1f1680,_0x523ac0);UserVoiceQueueRtEvents['on'](_0x1f1680,_0x392337);}};
\ No newline at end of file
+var _0xe5e0=['update','emit','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x112bd4,_0x175123){var _0x451d35=function(_0x4f0c13){while(--_0x4f0c13){_0x112bd4['push'](_0x112bd4['shift']());}};_0x451d35(++_0x175123);}(_0xe5e0,0x123));var _0x0e5e=function(_0x42472d,_0x558a68){_0x42472d=_0x42472d-0x0;var _0x5b9643=_0xe5e0[_0x42472d];return _0x5b9643;};'use strict';var UserVoiceQueueRtEvents=require(_0x0e5e('0x0'));var events=[_0x0e5e('0x1'),_0x0e5e('0x2'),_0x0e5e('0x3')];function createListener(_0xc55c5c,_0x1487f7){return function(_0x278df1){_0x1487f7[_0x0e5e('0x4')](_0xc55c5c,_0x278df1);};}function removeListener(_0x2a6b6e,_0x43b942){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2a6b6e,_0x43b942);};}exports[_0x0e5e('0x5')]=function(_0x39c487){for(var _0x5cc97b=0x0,_0x2b6bd9=events['length'];_0x5cc97b<_0x2b6bd9;_0x5cc97b++){var _0x14e323=events[_0x5cc97b];var _0x4ca006=createListener(_0x0e5e('0x6')+_0x14e323,_0x39c487);UserVoiceQueueRtEvents['on'](_0x14e323,_0x4ca006);}};
\ No newline at end of file
index 9087f26..1bdfe8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5ab4a3,_0x2e75cb){var _0x5da954=function(_0x5a7d67){while(--_0x5a7d67){_0x5ab4a3['push'](_0x5ab4a3['shift']());}};_0x5da954(++_0x2e75cb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0xcb91[_0x4d35f3];return _0x382fea;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x503741,_0x4ead4e){var _0x1f9fc3=function(_0x544506){while(--_0x544506){_0x503741['push'](_0x503741['shift']());}};_0x1f9fc3(++_0x4ead4e);}(_0x9c44,0x178));var _0x49c4=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x9c44[_0x17b6e3];return _0x3906f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index ceac05d..30887b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa03c=['exports','INTEGER','sequelize'];(function(_0x71a309,_0x15f6a9){var _0x4e555b=function(_0x13c416){while(--_0x13c416){_0x71a309['push'](_0x71a309['shift']());}};_0x4e555b(++_0x15f6a9);}(_0xa03c,0x143));var _0xca03=function(_0x49dd44,_0x202813){_0x49dd44=_0x49dd44-0x0;var _0x3d320d=_0xa03c[_0x49dd44];return _0x3d320d;};'use strict';var Sequelize=require(_0xca03('0x0'));module[_0xca03('0x1')]={'penalty':{'type':Sequelize[_0xca03('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2e27=['INTEGER','sequelize','exports'];(function(_0x53197d,_0x15b954){var _0x526b95=function(_0x4dd74b){while(--_0x4dd74b){_0x53197d['push'](_0x53197d['shift']());}};_0x526b95(++_0x15b954);}(_0x2e27,0x82));var _0x72e2=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0x2e27[_0x155c64];return _0x1f154a;};'use strict';var Sequelize=require(_0x72e2('0x0'));module[_0x72e2('0x1')]={'penalty':{'type':Sequelize[_0x72e2('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 84283b3..923b1d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fe7=['path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0xda1318,_0x59f727){var _0x48c08f=function(_0x165609){while(--_0x165609){_0xda1318['push'](_0xda1318['shift']());}};_0x48c08f(++_0x59f727);}(_0x6fe7,0x10e));var _0x76fe=function(_0x364a57,_0x2e1b62){_0x364a57=_0x364a57-0x0;var _0x49fd2b=_0x6fe7[_0x364a57];return _0x49fd2b;};'use strict';var _=require(_0x76fe('0x0'));var util=require(_0x76fe('0x1'));var logger=require(_0x76fe('0x2'))('api');var moment=require(_0x76fe('0x3'));var BPromise=require(_0x76fe('0x4'));var rp=require(_0x76fe('0x5'));var fs=require('fs');var path=require(_0x76fe('0x6'));var rimraf=require(_0x76fe('0x7'));var config=require('../../config/environment');var attributes=require(_0x76fe('0x8'));module[_0x76fe('0x9')]=function(_0x48a552,_0x7c5fc1){return _0x48a552[_0x76fe('0xa')](_0x76fe('0xb'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4e0=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x28ff82,_0x578d03){var _0x26fb2d=function(_0x2d7e1a){while(--_0x2d7e1a){_0x28ff82['push'](_0x28ff82['shift']());}};_0x26fb2d(++_0x578d03);}(_0xf4e0,0x86));var _0x0f4e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf4e0[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x0f4e('0x0'));var util=require(_0x0f4e('0x1'));var logger=require(_0x0f4e('0x2'))('api');var moment=require(_0x0f4e('0x3'));var BPromise=require(_0x0f4e('0x4'));var rp=require(_0x0f4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0f4e('0x6'));var config=require(_0x0f4e('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0x0f4e('0x8')]=function(_0x282437,_0x50af97){return _0x282437[_0x0f4e('0x9')](_0x0f4e('0xa'),attributes,{'tableName':_0x0f4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 605ebba..7221d59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaed4=['jayson/promise','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x5c9888,_0x2f0589){var _0x5dbffc=function(_0x32524b){while(--_0x32524b){_0x5c9888['push'](_0x5c9888['shift']());}};_0x5dbffc(++_0x2f0589);}(_0xaed4,0x1ef));var _0x4aed=function(_0x44e260,_0x4798c6){_0x44e260=_0x44e260-0x0;var _0x4fbb80=_0xaed4[_0x44e260];return _0x4fbb80;};'use strict';var _=require(_0x4aed('0x0'));var util=require(_0x4aed('0x1'));var moment=require(_0x4aed('0x2'));var BPromise=require('bluebird');var rs=require(_0x4aed('0x3'));var fs=require('fs');var Redis=require(_0x4aed('0x4'));var db=require(_0x4aed('0x5'))['db'];var utils=require(_0x4aed('0x6'));var logger=require('../../config/logger')(_0x4aed('0x7'));var config=require(_0x4aed('0x8'));var jayson=require(_0x4aed('0x9'));var client=jayson['client'][_0x4aed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x869c30,_0xa2cb54,_0xa08f){return new BPromise(function(_0xedc0c6,_0x5f1b3f){return client[_0x4aed('0xb')](_0x869c30,_0xa08f)[_0x4aed('0xc')](function(_0x4db9a2){logger['info'](_0x4aed('0xd'),_0xa2cb54,_0x4aed('0xe'));logger[_0x4aed('0xf')](_0x4aed('0x10'),_0xa2cb54,_0x4aed('0xe'),JSON[_0x4aed('0x11')](_0x4db9a2));if(_0x4db9a2[_0x4aed('0x12')]){if(_0x4db9a2[_0x4aed('0x12')][_0x4aed('0x13')]===0x1f4){logger[_0x4aed('0x12')](_0x4aed('0xd'),_0xa2cb54,_0x4db9a2[_0x4aed('0x12')][_0x4aed('0x14')]);return _0x5f1b3f(_0x4db9a2['error']['message']);}logger[_0x4aed('0x12')](_0x4aed('0xd'),_0xa2cb54,_0x4db9a2[_0x4aed('0x12')][_0x4aed('0x14')]);return _0xedc0c6(_0x4db9a2[_0x4aed('0x12')][_0x4aed('0x14')]);}else{logger[_0x4aed('0x15')](_0x4aed('0xd'),_0xa2cb54,'request\x20sent');_0xedc0c6(_0x4db9a2[_0x4aed('0x16')]['message']);}})[_0x4aed('0x17')](function(_0x14e75e){logger['error'](_0x4aed('0xd'),_0xa2cb54,_0x14e75e);_0x5f1b3f(_0x14e75e);});});}
\ No newline at end of file
+var _0xcfac=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','moment','bluebird'];(function(_0x3cf7f2,_0x511bf2){var _0x330f20=function(_0x51ad14){while(--_0x51ad14){_0x3cf7f2['push'](_0x3cf7f2['shift']());}};_0x330f20(++_0x511bf2);}(_0xcfac,0x16c));var _0xccfa=function(_0x2bdfbc,_0x5b0ab1){_0x2bdfbc=_0x2bdfbc-0x0;var _0x16a0b2=_0xcfac[_0x2bdfbc];return _0x16a0b2;};'use strict';var _=require(_0xccfa('0x0'));var util=require(_0xccfa('0x1'));var moment=require(_0xccfa('0x2'));var BPromise=require(_0xccfa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xccfa('0x4'));var db=require(_0xccfa('0x5'))['db'];var utils=require(_0xccfa('0x6'));var logger=require(_0xccfa('0x7'))(_0xccfa('0x8'));var config=require(_0xccfa('0x9'));var jayson=require(_0xccfa('0xa'));var client=jayson[_0xccfa('0xb')][_0xccfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x443841,_0x27d732,_0x584e6a){return new BPromise(function(_0x1862b9,_0x4aec4d){return client[_0xccfa('0xd')](_0x443841,_0x584e6a)[_0xccfa('0xe')](function(_0xd2808){logger['info'](_0xccfa('0xf'),_0x27d732,_0xccfa('0x10'));logger['debug'](_0xccfa('0x11'),_0x27d732,'request\x20sent',JSON['stringify'](_0xd2808));if(_0xd2808[_0xccfa('0x12')]){if(_0xd2808['error'][_0xccfa('0x13')]===0x1f4){logger[_0xccfa('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x27d732,_0xd2808[_0xccfa('0x12')]['message']);return _0x4aec4d(_0xd2808['error'][_0xccfa('0x14')]);}logger[_0xccfa('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x27d732,_0xd2808[_0xccfa('0x12')][_0xccfa('0x14')]);return _0x1862b9(_0xd2808[_0xccfa('0x12')][_0xccfa('0x14')]);}else{logger[_0xccfa('0x15')](_0xccfa('0xf'),_0x27d732,_0xccfa('0x10'));_0x1862b9(_0xd2808[_0xccfa('0x16')]['message']);}})['catch'](function(_0xa1c8d2){logger[_0xccfa('0x12')](_0xccfa('0xf'),_0x27d732,_0xa1c8d2);_0x4aec4d(_0xa1c8d2);});});}
\ No newline at end of file
index 6936a55..b3c346c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x946e=['path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','index','/:id','show','isAuthenticated','create','update','destroy','multer'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0x946e,0x1d0));var _0xe946=function(_0x5f7917,_0x4290cc){_0x5f7917=_0x5f7917-0x0;var _0x13fdda=_0x946e[_0x5f7917];return _0x13fdda;};'use strict';var multer=require(_0xe946('0x0'));var util=require('util');var path=require(_0xe946('0x1'));var timeout=require('connect-timeout');var express=require(_0xe946('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe946('0x3'));var interaction=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var controller=require(_0xe946('0x6'));router[_0xe946('0x7')]('/',auth['isAuthenticated'](),controller[_0xe946('0x8')]);router[_0xe946('0x7')](_0xe946('0x9'),auth['isAuthenticated'](),controller[_0xe946('0xa')]);router['post']('/',auth[_0xe946('0xb')](),controller[_0xe946('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe946('0xd')]);router['delete']('/:id',auth[_0xe946('0xb')](),controller[_0xe946('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xaefc=['index','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x4492af,_0x47e25d){var _0x216729=function(_0x4964c8){while(--_0x4964c8){_0x4492af['push'](_0x4492af['shift']());}};_0x216729(++_0x47e25d);}(_0xaefc,0xc8));var _0xcaef=function(_0x26de59,_0x3fb2d4){_0x26de59=_0x26de59-0x0;var _0x4b6982=_0xaefc[_0x26de59];return _0x4b6982;};'use strict';var multer=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var path=require(_0xcaef('0x2'));var timeout=require('connect-timeout');var express=require(_0xcaef('0x3'));var router=express[_0xcaef('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var controller=require('./variable.controller');router['get']('/',auth[_0xcaef('0x7')](),controller[_0xcaef('0x8')]);router['get'](_0xcaef('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xcaef('0xa')]('/',auth[_0xcaef('0x7')](),controller['create']);router[_0xcaef('0xb')](_0xcaef('0x9'),auth['isAuthenticated'](),controller[_0xcaef('0xc')]);router[_0xcaef('0xd')](_0xcaef('0x9'),auth[_0xcaef('0x7')](),controller[_0xcaef('0xe')]);module[_0xcaef('0xf')]=router;
\ No newline at end of file
index 2c7cf8a..a91f481 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1156=['sequelize','STRING'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x1156,0x178));var _0x6115=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x1156[_0x6a0266];return _0x309e00;};'use strict';var Sequelize=require(_0x6115('0x0'));module['exports']={'name':{'type':Sequelize[_0x6115('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x63a3=['exports','STRING','name','sequelize'];(function(_0x5eb7ed,_0x3f85db){var _0x428ea0=function(_0x4b3df4){while(--_0x4b3df4){_0x5eb7ed['push'](_0x5eb7ed['shift']());}};_0x428ea0(++_0x3f85db);}(_0x63a3,0x15b));var _0x363a=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x63a3[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0x363a('0x0'));module[_0x363a('0x1')]={'name':{'type':Sequelize[_0x363a('0x2')],'unique':_0x363a('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x363a('0x2')]}};
\ No newline at end of file
index 2aee02f..bbd9ee4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe302=['keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','body','eml-format','rimraf','zip-dir','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Variables','UserProfileResource','name','index','Variable','fieldName','type','key','model','map','query'];(function(_0x139009,_0x5725e9){var _0x32f977=function(_0x2ca1e9){while(--_0x2ca1e9){_0x139009['push'](_0x139009['shift']());}};_0x32f977(++_0x5725e9);}(_0xe302,0x152));var _0x2e30=function(_0x105bfd,_0x11f049){_0x105bfd=_0x105bfd-0x0;var _0x2f486a=_0xe302[_0x105bfd];return _0x2f486a;};'use strict';var emlformat=require(_0x2e30('0x0'));var rimraf=require(_0x2e30('0x1'));var zipdir=require(_0x2e30('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2e30('0x3'));var path=require('path');var sox=require(_0x2e30('0x4'));var csv=require(_0x2e30('0x5'));var ejs=require(_0x2e30('0x6'));var fs=require('fs');var fs_extra=require(_0x2e30('0x7'));var _=require('lodash');var squel=require(_0x2e30('0x8'));var crypto=require(_0x2e30('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2e30('0x5'));var querystring=require(_0x2e30('0xa'));var Papa=require(_0x2e30('0xb'));var Redis=require(_0x2e30('0xc'));var authService=require(_0x2e30('0xd'));var qs=require(_0x2e30('0xe'));var as=require(_0x2e30('0xf'));var hardwareService=require(_0x2e30('0x10'));var logger=require(_0x2e30('0x11'))(_0x2e30('0x12'));var utils=require(_0x2e30('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2e30('0x14'))['db'];function respondWithStatusCode(_0x2003e5,_0x3baca4){_0x3baca4=_0x3baca4||0xcc;return function(_0x46889f){if(_0x46889f){return _0x2003e5[_0x2e30('0x15')](_0x3baca4);}return _0x2003e5['status'](_0x3baca4)['end']();};}function respondWithResult(_0x701579,_0x1c5253){_0x1c5253=_0x1c5253||0xc8;return function(_0x506480){if(_0x506480){return _0x701579[_0x2e30('0x16')](_0x1c5253)[_0x2e30('0x17')](_0x506480);}};}function respondWithFilteredResult(_0x340cb4,_0x36853f){return function(_0x38ba30){if(_0x38ba30){var _0x116eaa=typeof _0x36853f['offset']===_0x2e30('0x18')&&typeof _0x36853f[_0x2e30('0x19')]===_0x2e30('0x18');var _0x535046=_0x38ba30[_0x2e30('0x1a')];var _0x266697=_0x116eaa?0x0:_0x36853f[_0x2e30('0x1b')];var _0x308deb=_0x116eaa?_0x38ba30['count']:_0x36853f['offset']+_0x36853f[_0x2e30('0x19')];var _0x3aeb7e;if(_0x308deb>=_0x535046){_0x308deb=_0x535046;_0x3aeb7e=0xc8;}else{_0x3aeb7e=0xce;}_0x340cb4[_0x2e30('0x16')](_0x3aeb7e);return _0x340cb4[_0x2e30('0x1c')](_0x2e30('0x1d'),_0x266697+'-'+_0x308deb+'/'+_0x535046)[_0x2e30('0x17')](_0x38ba30);}return null;};}function patchUpdates(_0x2e1912){return function(_0x5113cf){try{jsonpatch[_0x2e30('0x1e')](_0x5113cf,_0x2e1912,!![]);}catch(_0x459f26){return BPromise[_0x2e30('0x1f')](_0x459f26);}return _0x5113cf['save']();};}function saveUpdates(_0x4cc19f,_0x10c606){return function(_0x4cbf57){if(_0x4cbf57){return _0x4cbf57[_0x2e30('0x20')](_0x4cc19f)[_0x2e30('0x21')](function(_0xa3a585){return _0xa3a585;});}return null;};}function removeEntity(_0x258152,_0x23e7b4){return function(_0x34b356){if(_0x34b356){return _0x34b356[_0x2e30('0x22')]()[_0x2e30('0x21')](function(){var _0x583762=_0x34b356[_0x2e30('0x23')]({'plain':!![]});var _0x1a78c5=_0x2e30('0x24');return db[_0x2e30('0x25')][_0x2e30('0x22')]({'where':{'type':_0x1a78c5,'resourceId':_0x583762['id']}})[_0x2e30('0x21')](function(){return _0x34b356;});})['then'](function(){_0x258152[_0x2e30('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35ef3b,_0x29a1ce){return function(_0x222023){if(!_0x222023){_0x35ef3b[_0x2e30('0x15')](0x194);}return _0x222023;};}function handleError(_0xbcd334,_0xadd194){_0xadd194=_0xadd194||0x1f4;return function(_0x491618){logger['error'](_0x491618['stack']);if(_0x491618[_0x2e30('0x26')]){delete _0x491618[_0x2e30('0x26')];}_0xbcd334[_0x2e30('0x16')](_0xadd194)['send'](_0x491618);};}exports[_0x2e30('0x27')]=function(_0x5d7e3a,_0x4b1f41){var _0x16b00d={},_0x4573fa={},_0x2b56b7={'count':0x0,'rows':[]};var _0x50837d=_['map'](db[_0x2e30('0x28')]['rawAttributes'],function(_0x39ad65){return{'name':_0x39ad65[_0x2e30('0x29')],'type':_0x39ad65[_0x2e30('0x2a')][_0x2e30('0x2b')]};});_0x4573fa[_0x2e30('0x2c')]=_[_0x2e30('0x2d')](_0x50837d,_0x2e30('0x26'));_0x4573fa[_0x2e30('0x2e')]=_[_0x2e30('0x2f')](_0x5d7e3a[_0x2e30('0x2e')]);_0x4573fa[_0x2e30('0x30')]=_['intersection'](_0x4573fa[_0x2e30('0x2c')],_0x4573fa['query']);_0x16b00d[_0x2e30('0x31')]=_['intersection'](_0x4573fa[_0x2e30('0x2c')],qs[_0x2e30('0x32')](_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x32')]));_0x16b00d[_0x2e30('0x31')]=_0x16b00d[_0x2e30('0x31')]['length']?_0x16b00d[_0x2e30('0x31')]:_0x4573fa[_0x2e30('0x2c')];if(!_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x33')](_0x2e30('0x34'))){_0x16b00d['limit']=qs['limit'](_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x19')]);_0x16b00d['offset']=qs[_0x2e30('0x1b')](_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x1b')]);}_0x16b00d[_0x2e30('0x35')]=qs[_0x2e30('0x36')](_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x36')]);_0x16b00d[_0x2e30('0x37')]=qs['filters'](_[_0x2e30('0x38')](_0x5d7e3a[_0x2e30('0x2e')],_0x4573fa[_0x2e30('0x30')]),_0x50837d);if(_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x39')]){_0x16b00d[_0x2e30('0x37')]=_[_0x2e30('0x3a')](_0x16b00d[_0x2e30('0x37')],{'$or':_['map'](_0x50837d,function(_0x4b3b9e){if(_0x4b3b9e['type']!==_0x2e30('0x3b')){var _0x55233f={};_0x55233f[_0x4b3b9e[_0x2e30('0x26')]]={'$like':'%'+_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x39')]+'%'};return _0x55233f;}})});}_0x16b00d=_['merge']({},_0x16b00d,_0x5d7e3a[_0x2e30('0x3c')]);var _0x34efe9={'where':_0x16b00d[_0x2e30('0x37')]};return db[_0x2e30('0x28')]['count'](_0x34efe9)['then'](function(_0x3be977){_0x2b56b7[_0x2e30('0x1a')]=_0x3be977;if(_0x5d7e3a[_0x2e30('0x2e')][_0x2e30('0x3d')]){_0x16b00d[_0x2e30('0x3e')]=[{'all':!![]}];}return db[_0x2e30('0x28')][_0x2e30('0x3f')](_0x16b00d);})[_0x2e30('0x21')](function(_0x2550a8){_0x2b56b7['rows']=_0x2550a8;return _0x2b56b7;})['then'](respondWithFilteredResult(_0x4b1f41,_0x16b00d))[_0x2e30('0x40')](handleError(_0x4b1f41,null));};exports[_0x2e30('0x41')]=function(_0x242d0e,_0x476c49){var _0xa66c49={'raw':!![],'where':{'id':_0x242d0e[_0x2e30('0x42')]['id']}},_0x1a55fd={};_0x1a55fd[_0x2e30('0x2c')]=_[_0x2e30('0x2f')](db[_0x2e30('0x28')]['rawAttributes']);_0x1a55fd[_0x2e30('0x2e')]=_[_0x2e30('0x2f')](_0x242d0e['query']);_0x1a55fd[_0x2e30('0x30')]=_[_0x2e30('0x43')](_0x1a55fd[_0x2e30('0x2c')],_0x1a55fd[_0x2e30('0x2e')]);_0xa66c49[_0x2e30('0x31')]=_[_0x2e30('0x43')](_0x1a55fd[_0x2e30('0x2c')],qs[_0x2e30('0x32')](_0x242d0e['query'][_0x2e30('0x32')]));_0xa66c49[_0x2e30('0x31')]=_0xa66c49[_0x2e30('0x31')][_0x2e30('0x44')]?_0xa66c49[_0x2e30('0x31')]:_0x1a55fd[_0x2e30('0x2c')];if(_0x242d0e[_0x2e30('0x2e')][_0x2e30('0x3d')]){_0xa66c49[_0x2e30('0x3e')]=[{'all':!![]}];}_0xa66c49=_[_0x2e30('0x3a')]({},_0xa66c49,_0x242d0e[_0x2e30('0x3c')]);return db[_0x2e30('0x28')][_0x2e30('0x45')](_0xa66c49)[_0x2e30('0x21')](handleEntityNotFound(_0x476c49,null))[_0x2e30('0x21')](respondWithResult(_0x476c49,null))[_0x2e30('0x40')](handleError(_0x476c49,null));};exports[_0x2e30('0x46')]=function(_0x5c4c68,_0x48fe94){return db[_0x2e30('0x28')][_0x2e30('0x46')](_0x5c4c68['body'],{})[_0x2e30('0x21')](function(_0x25c01d){var _0x3cd4f5=_0x5c4c68[_0x2e30('0x47')][_0x2e30('0x23')]({'plain':!![]});if(!_0x3cd4f5)throw new Error(_0x2e30('0x48'));if(_0x3cd4f5[_0x2e30('0x49')]===_0x2e30('0x47')){var _0x521b02=_0x25c01d['get']({'plain':!![]});var _0x9a8f0a=_0x2e30('0x24');return db['UserProfileSection'][_0x2e30('0x45')]({'where':{'name':_0x9a8f0a,'userProfileId':_0x3cd4f5[_0x2e30('0x4a')]},'raw':!![]})[_0x2e30('0x21')](function(_0x4543cd){if(_0x4543cd&&_0x4543cd[_0x2e30('0x4b')]===0x0){return db['UserProfileResource'][_0x2e30('0x46')]({'name':_0x521b02[_0x2e30('0x26')],'resourceId':_0x521b02['id'],'type':_0x4543cd[_0x2e30('0x26')],'sectionId':_0x4543cd['id']},{})[_0x2e30('0x21')](function(){return _0x25c01d;});}else{return _0x25c01d;}})[_0x2e30('0x40')](function(_0x14c06e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14c06e);throw _0x14c06e;});}return _0x25c01d;})[_0x2e30('0x21')](respondWithResult(_0x48fe94,0xc9))[_0x2e30('0x40')](handleError(_0x48fe94,null));};exports['update']=function(_0x4d4fee,_0x1b311a){if(_0x4d4fee['body']['id']){delete _0x4d4fee[_0x2e30('0x4c')]['id'];}return db[_0x2e30('0x28')][_0x2e30('0x45')]({'where':{'id':_0x4d4fee[_0x2e30('0x42')]['id']}})[_0x2e30('0x21')](handleEntityNotFound(_0x1b311a,null))['then'](saveUpdates(_0x4d4fee['body'],null))[_0x2e30('0x21')](respondWithResult(_0x1b311a,null))['catch'](handleError(_0x1b311a,null));};exports[_0x2e30('0x22')]=function(_0x4315f5,_0x26ee3e){return db[_0x2e30('0x28')]['find']({'where':{'id':_0x4315f5[_0x2e30('0x42')]['id']}})[_0x2e30('0x21')](handleEntityNotFound(_0x26ee3e,null))[_0x2e30('0x21')](removeEntity(_0x26ee3e,null))[_0x2e30('0x40')](handleError(_0x26ee3e,null));};
\ No newline at end of file
+var _0x399c=['map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','Variable','includeAll','include','findAll','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','name','send','index'];(function(_0x1fdc6a,_0xb27d4){var _0x2af46c=function(_0x3f73bf){while(--_0x3f73bf){_0x1fdc6a['push'](_0x1fdc6a['shift']());}};_0x2af46c(++_0xb27d4);}(_0x399c,0x1bf));var _0xc399=function(_0x131aca,_0x516c29){_0x131aca=_0x131aca-0x0;var _0x578af1=_0x399c[_0x131aca];return _0x578af1;};'use strict';var emlformat=require(_0xc399('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc399('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc399('0x2'));var Mustache=require(_0xc399('0x3'));var util=require(_0xc399('0x4'));var path=require(_0xc399('0x5'));var sox=require(_0xc399('0x6'));var csv=require(_0xc399('0x7'));var ejs=require(_0xc399('0x8'));var fs=require('fs');var fs_extra=require(_0xc399('0x9'));var _=require('lodash');var squel=require(_0xc399('0xa'));var crypto=require('crypto');var jsforce=require(_0xc399('0xb'));var deskjs=require(_0xc399('0xc'));var toCsv=require(_0xc399('0x7'));var querystring=require('querystring');var Papa=require(_0xc399('0xd'));var Redis=require(_0xc399('0xe'));var authService=require(_0xc399('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc399('0x10'));var hardwareService=require(_0xc399('0x11'));var logger=require(_0xc399('0x12'))(_0xc399('0x13'));var utils=require('../../config/utils');var config=require(_0xc399('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xc399('0x15'))['db'];function respondWithStatusCode(_0x4cc91f,_0x57284f){_0x57284f=_0x57284f||0xcc;return function(_0x180558){if(_0x180558){return _0x4cc91f[_0xc399('0x16')](_0x57284f);}return _0x4cc91f[_0xc399('0x17')](_0x57284f)[_0xc399('0x18')]();};}function respondWithResult(_0x3eb6f3,_0xf8c3c7){_0xf8c3c7=_0xf8c3c7||0xc8;return function(_0x5c1f3b){if(_0x5c1f3b){return _0x3eb6f3['status'](_0xf8c3c7)[_0xc399('0x19')](_0x5c1f3b);}};}function respondWithFilteredResult(_0x3e7a8c,_0x4fabc3){return function(_0x536e61){if(_0x536e61){var _0x2987bc=typeof _0x4fabc3[_0xc399('0x1a')]===_0xc399('0x1b')&&typeof _0x4fabc3[_0xc399('0x1c')]===_0xc399('0x1b');var _0x4d7096=_0x536e61[_0xc399('0x1d')];var _0x22ea22=_0x2987bc?0x0:_0x4fabc3[_0xc399('0x1a')];var _0x25d42d=_0x2987bc?_0x536e61['count']:_0x4fabc3[_0xc399('0x1a')]+_0x4fabc3['limit'];var _0x4d9450;if(_0x25d42d>=_0x4d7096){_0x25d42d=_0x4d7096;_0x4d9450=0xc8;}else{_0x4d9450=0xce;}_0x3e7a8c[_0xc399('0x17')](_0x4d9450);return _0x3e7a8c[_0xc399('0x1e')](_0xc399('0x1f'),_0x22ea22+'-'+_0x25d42d+'/'+_0x4d7096)[_0xc399('0x19')](_0x536e61);}return null;};}function patchUpdates(_0x5a2647){return function(_0x33dfd5){try{jsonpatch[_0xc399('0x20')](_0x33dfd5,_0x5a2647,!![]);}catch(_0xe02a6b){return BPromise[_0xc399('0x21')](_0xe02a6b);}return _0x33dfd5[_0xc399('0x22')]();};}function saveUpdates(_0x23de6e,_0x36a73d){return function(_0x3de637){if(_0x3de637){return _0x3de637[_0xc399('0x23')](_0x23de6e)[_0xc399('0x24')](function(_0x51c152){return _0x51c152;});}return null;};}function removeEntity(_0x4f819b,_0x57e36d){return function(_0x2210c3){if(_0x2210c3){return _0x2210c3[_0xc399('0x25')]()[_0xc399('0x24')](function(){var _0x1cbdae=_0x2210c3[_0xc399('0x26')]({'plain':!![]});var _0x324cde=_0xc399('0x27');return db[_0xc399('0x28')][_0xc399('0x25')]({'where':{'type':_0x324cde,'resourceId':_0x1cbdae['id']}})['then'](function(){return _0x2210c3;});})[_0xc399('0x24')](function(){_0x4f819b['status'](0xcc)[_0xc399('0x18')]();});}};}function handleEntityNotFound(_0xe50b8c,_0x39bd0e){return function(_0x29c3a){if(!_0x29c3a){_0xe50b8c[_0xc399('0x16')](0x194);}return _0x29c3a;};}function handleError(_0x4643f6,_0xd1a4d7){_0xd1a4d7=_0xd1a4d7||0x1f4;return function(_0x529ae4){logger[_0xc399('0x29')](_0x529ae4['stack']);if(_0x529ae4['name']){delete _0x529ae4[_0xc399('0x2a')];}_0x4643f6[_0xc399('0x17')](_0xd1a4d7)[_0xc399('0x2b')](_0x529ae4);};}exports[_0xc399('0x2c')]=function(_0x396ba,_0x1543f4){var _0x290e39={},_0x3adfcc={},_0x18006a={'count':0x0,'rows':[]};var _0x21b3a0=_[_0xc399('0x2d')](db['Variable'][_0xc399('0x2e')],function(_0x5f182e){return{'name':_0x5f182e[_0xc399('0x2f')],'type':_0x5f182e['type']['key']};});_0x3adfcc[_0xc399('0x30')]=_[_0xc399('0x2d')](_0x21b3a0,'name');_0x3adfcc[_0xc399('0x31')]=_['keys'](_0x396ba[_0xc399('0x31')]);_0x3adfcc[_0xc399('0x32')]=_[_0xc399('0x33')](_0x3adfcc['model'],_0x3adfcc['query']);_0x290e39[_0xc399('0x34')]=_[_0xc399('0x33')](_0x3adfcc[_0xc399('0x30')],qs[_0xc399('0x35')](_0x396ba[_0xc399('0x31')][_0xc399('0x35')]));_0x290e39[_0xc399('0x34')]=_0x290e39[_0xc399('0x34')]['length']?_0x290e39[_0xc399('0x34')]:_0x3adfcc[_0xc399('0x30')];if(!_0x396ba['query'][_0xc399('0x36')](_0xc399('0x37'))){_0x290e39[_0xc399('0x1c')]=qs[_0xc399('0x1c')](_0x396ba[_0xc399('0x31')][_0xc399('0x1c')]);_0x290e39[_0xc399('0x1a')]=qs[_0xc399('0x1a')](_0x396ba['query'][_0xc399('0x1a')]);}_0x290e39[_0xc399('0x38')]=qs[_0xc399('0x39')](_0x396ba[_0xc399('0x31')][_0xc399('0x39')]);_0x290e39[_0xc399('0x3a')]=qs['filters'](_['pick'](_0x396ba['query'],_0x3adfcc[_0xc399('0x32')]),_0x21b3a0);if(_0x396ba[_0xc399('0x31')][_0xc399('0x3b')]){_0x290e39[_0xc399('0x3a')]=_[_0xc399('0x3c')](_0x290e39['where'],{'$or':_['map'](_0x21b3a0,function(_0xe6643a){if(_0xe6643a[_0xc399('0x3d')]!=='VIRTUAL'){var _0x419d03={};_0x419d03[_0xe6643a['name']]={'$like':'%'+_0x396ba[_0xc399('0x31')]['filter']+'%'};return _0x419d03;}})});}_0x290e39=_['merge']({},_0x290e39,_0x396ba[_0xc399('0x3e')]);var _0x34537c={'where':_0x290e39[_0xc399('0x3a')]};return db[_0xc399('0x3f')][_0xc399('0x1d')](_0x34537c)['then'](function(_0x4f5c2a){_0x18006a[_0xc399('0x1d')]=_0x4f5c2a;if(_0x396ba[_0xc399('0x31')][_0xc399('0x40')]){_0x290e39[_0xc399('0x41')]=[{'all':!![]}];}return db['Variable'][_0xc399('0x42')](_0x290e39);})[_0xc399('0x24')](function(_0x339a56){_0x18006a['rows']=_0x339a56;return _0x18006a;})['then'](respondWithFilteredResult(_0x1543f4,_0x290e39))[_0xc399('0x43')](handleError(_0x1543f4,null));};exports[_0xc399('0x44')]=function(_0x5a76df,_0x336351){var _0x2b1331={'raw':!![],'where':{'id':_0x5a76df[_0xc399('0x45')]['id']}},_0x3889e0={};_0x3889e0['model']=_[_0xc399('0x46')](db[_0xc399('0x3f')][_0xc399('0x2e')]);_0x3889e0['query']=_[_0xc399('0x46')](_0x5a76df[_0xc399('0x31')]);_0x3889e0[_0xc399('0x32')]=_[_0xc399('0x33')](_0x3889e0['model'],_0x3889e0['query']);_0x2b1331['attributes']=_[_0xc399('0x33')](_0x3889e0[_0xc399('0x30')],qs[_0xc399('0x35')](_0x5a76df[_0xc399('0x31')][_0xc399('0x35')]));_0x2b1331[_0xc399('0x34')]=_0x2b1331['attributes'][_0xc399('0x47')]?_0x2b1331[_0xc399('0x34')]:_0x3889e0[_0xc399('0x30')];if(_0x5a76df[_0xc399('0x31')][_0xc399('0x40')]){_0x2b1331[_0xc399('0x41')]=[{'all':!![]}];}_0x2b1331=_[_0xc399('0x3c')]({},_0x2b1331,_0x5a76df[_0xc399('0x3e')]);return db[_0xc399('0x3f')][_0xc399('0x48')](_0x2b1331)[_0xc399('0x24')](handleEntityNotFound(_0x336351,null))['then'](respondWithResult(_0x336351,null))[_0xc399('0x43')](handleError(_0x336351,null));};exports[_0xc399('0x49')]=function(_0x20eeb3,_0x3d83d6){return db[_0xc399('0x3f')][_0xc399('0x49')](_0x20eeb3[_0xc399('0x4a')],{})[_0xc399('0x24')](function(_0x27a91f){var _0x59871e=_0x20eeb3[_0xc399('0x4b')][_0xc399('0x26')]({'plain':!![]});if(!_0x59871e)throw new Error(_0xc399('0x4c'));if(_0x59871e[_0xc399('0x4d')]==='user'){var _0x762ac4=_0x27a91f[_0xc399('0x26')]({'plain':!![]});var _0x433afc=_0xc399('0x27');return db[_0xc399('0x4e')][_0xc399('0x48')]({'where':{'name':_0x433afc,'userProfileId':_0x59871e[_0xc399('0x4f')]},'raw':!![]})[_0xc399('0x24')](function(_0x3e35f9){if(_0x3e35f9&&_0x3e35f9[_0xc399('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x762ac4[_0xc399('0x2a')],'resourceId':_0x762ac4['id'],'type':_0x3e35f9[_0xc399('0x2a')],'sectionId':_0x3e35f9['id']},{})[_0xc399('0x24')](function(){return _0x27a91f;});}else{return _0x27a91f;}})['catch'](function(_0x19992a){logger[_0xc399('0x29')](_0xc399('0x51'),_0x19992a);throw _0x19992a;});}return _0x27a91f;})[_0xc399('0x24')](respondWithResult(_0x3d83d6,0xc9))[_0xc399('0x43')](handleError(_0x3d83d6,null));};exports[_0xc399('0x23')]=function(_0x593376,_0x1d0866){if(_0x593376[_0xc399('0x4a')]['id']){delete _0x593376[_0xc399('0x4a')]['id'];}return db[_0xc399('0x3f')]['find']({'where':{'id':_0x593376[_0xc399('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d0866,null))[_0xc399('0x24')](saveUpdates(_0x593376[_0xc399('0x4a')],null))[_0xc399('0x24')](respondWithResult(_0x1d0866,null))['catch'](handleError(_0x1d0866,null));};exports[_0xc399('0x25')]=function(_0x286f61,_0x1d7a4d){return db[_0xc399('0x3f')][_0xc399('0x48')]({'where':{'id':_0x286f61[_0xc399('0x45')]['id']}})[_0xc399('0x24')](handleEntityNotFound(_0x1d7a4d,null))[_0xc399('0x24')](removeEntity(_0x1d7a4d,null))[_0xc399('0x43')](handleError(_0x1d7a4d,null));};
\ No newline at end of file
index 123c320..2117cbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2708=['Variable','tools_variables','lodash','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x2708,0xec));var _0x8270=function(_0x51d573,_0x47726b){_0x51d573=_0x51d573-0x0;var _0x326150=_0x2708[_0x51d573];return _0x326150;};'use strict';var _=require(_0x8270('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8270('0x1'));var BPromise=require(_0x8270('0x2'));var rp=require(_0x8270('0x3'));var fs=require('fs');var path=require(_0x8270('0x4'));var rimraf=require(_0x8270('0x5'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0x8270('0x6')]=function(_0x1f89b5,_0x131af8){return _0x1f89b5['define'](_0x8270('0x7'),attributes,{'tableName':_0x8270('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fd9=['moment','bluebird','request-promise','rimraf','../../config/environment','./variable.attributes','define','Variable','api'];(function(_0x3f7f44,_0x25aa53){var _0x3d086d=function(_0x4b4230){while(--_0x4b4230){_0x3f7f44['push'](_0x3f7f44['shift']());}};_0x3d086d(++_0x25aa53);}(_0x3fd9,0x1a6));var _0x93fd=function(_0x3c72b0,_0x28ee0b){_0x3c72b0=_0x3c72b0-0x0;var _0x56186d=_0x3fd9[_0x3c72b0];return _0x56186d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x93fd('0x0'));var moment=require(_0x93fd('0x1'));var BPromise=require(_0x93fd('0x2'));var rp=require(_0x93fd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x93fd('0x4'));var config=require(_0x93fd('0x5'));var attributes=require(_0x93fd('0x6'));module['exports']=function(_0x38d911,_0x44aaf2){return _0x38d911[_0x93fd('0x7')](_0x93fd('0x8'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f4f3cf..16eac1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0x44960d,_0x27ab5f){var _0x370dbf=function(_0x1a8098){while(--_0x1a8098){_0x44960d['push'](_0x44960d['shift']());}};_0x370dbf(++_0x27ab5f);}(_0x55ca,0x126));var _0xa55c=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x55ca[_0x13b8f3];return _0x1a6d06;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});};
\ No newline at end of file
+var _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x124269,_0x161b31){var _0x231ac3=function(_0x297925){while(--_0x297925){_0x124269['push'](_0x124269['shift']());}};_0x231ac3(++_0x161b31);}(_0x5fc3,0xa8));var _0x35fc=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x5fc3[_0xdd2bfa];return _0x55397e;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});};
\ No newline at end of file
index dabbba5..8bf07ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b49=['reset','/pull','pull','restart','/migrations','exports','express','Router','../../components/auth/service','get','/fetch','canUpdate','fetch','/reset','isAuthenticated'];(function(_0x278a3a,_0x3e46f1){var _0x5f2be3=function(_0x3a8801){while(--_0x3a8801){_0x278a3a['push'](_0x278a3a['shift']());}};_0x5f2be3(++_0x3e46f1);}(_0x5b49,0x6f));var _0x95b4=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x5b49[_0x5783f4];return _0x28e380;};'use strict';var express=require(_0x95b4('0x0'));var router=express[_0x95b4('0x1')]();var auth=require(_0x95b4('0x2'));var controller=require('./version.controller');router[_0x95b4('0x3')]('/',controller['index']);router[_0x95b4('0x3')](_0x95b4('0x4'),auth['isAuthenticated'](),auth[_0x95b4('0x5')](),controller[_0x95b4('0x6')]);router[_0x95b4('0x3')](_0x95b4('0x7'),auth[_0x95b4('0x8')](),auth['canUpdate'](),controller[_0x95b4('0x9')]);router[_0x95b4('0x3')](_0x95b4('0xa'),auth[_0x95b4('0x8')](),auth[_0x95b4('0x5')](),controller[_0x95b4('0xb')]);router[_0x95b4('0x3')]('/restart',auth['isAuthenticated'](),controller[_0x95b4('0xc')]);router['get'](_0x95b4('0xd'),controller['migrations']);module[_0x95b4('0xe')]=router;
\ No newline at end of file
+var _0xc35f=['pull','restart','/migrations','migrations','express','Router','./version.controller','get','/fetch','fetch','/reset','isAuthenticated','canUpdate','/pull'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0xc35f,0x74));var _0xfc35=function(_0x127565,_0x4cf4c7){_0x127565=_0x127565-0x0;var _0x35090e=_0xc35f[_0x127565];return _0x35090e;};'use strict';var express=require(_0xfc35('0x0'));var router=express[_0xfc35('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xfc35('0x2'));router['get']('/',controller['index']);router[_0xfc35('0x3')](_0xfc35('0x4'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0xfc35('0x5')]);router[_0xfc35('0x3')](_0xfc35('0x6'),auth[_0xfc35('0x7')](),auth[_0xfc35('0x8')](),controller['reset']);router['get'](_0xfc35('0x9'),auth[_0xfc35('0x7')](),auth[_0xfc35('0x8')](),controller[_0xfc35('0xa')]);router[_0xfc35('0x3')]('/restart',auth[_0xfc35('0x7')](),controller[_0xfc35('0xb')]);router[_0xfc35('0x3')](_0xfc35('0xc'),controller[_0xfc35('0xd')]);module['exports']=router;
\ No newline at end of file
index 4faf6bb..8456e88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x839f=['lodash','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','root','exports','query','latest','fetch','tags','version','2.0.0','status','json','master','reset','FETCH_HEAD','error','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','server','replace','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','join','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path'];(function(_0x1f3474,_0x55e896){var _0x57626c=function(_0x13742d){while(--_0x13742d){_0x1f3474['push'](_0x1f3474['shift']());}};_0x57626c(++_0x55e896);}(_0x839f,0x196));var _0xf839=function(_0x509fb2,_0x541f31){_0x509fb2=_0x509fb2-0x0;var _0x1b1072=_0x839f[_0x509fb2];return _0x1b1072;};'use strict';var Umzug=require(_0xf839('0x0'));var path=require(_0xf839('0x1'));var fs=require('fs');var _=require(_0xf839('0x2'));var pkginfo=require('pkginfo')(module,'version');var compareVersions=require(_0xf839('0x3'));var exec=require(_0xf839('0x4'))['exec'];var db=require(_0xf839('0x5'))['db'];var config=require(_0xf839('0x6'));var pm2=require(_0xf839('0x7'));var logger=require(_0xf839('0x8'))('update');var git=require('simple-git')(config[_0xf839('0x9')]);exports['index']=function(_0x5445f9,_0x21b01b){var _0x4ce5fc={'current':module[_0xf839('0xa')]['version'],'phonebar':0x2};if(_0x5445f9[_0xf839('0xb')]&&_0x5445f9[_0xf839('0xb')][_0xf839('0xc')]){return git[_0xf839('0xd')]()[_0xf839('0xe')](function(_0x2ddd79,_0x1bc345){_0x4ce5fc[_0xf839('0xc')]=(_0x2ddd79?module['exports'][_0xf839('0xf')]:_0x1bc345[_0xf839('0xc')])||_0xf839('0x10');return _0x21b01b[_0xf839('0x11')](0xc8)[_0xf839('0x12')](_0x4ce5fc);});}else{return _0x21b01b[_0xf839('0x11')](0xc8)[_0xf839('0x12')](_0x4ce5fc);}};exports[_0xf839('0xd')]=function(_0x1734a1,_0x239b76){return git[_0xf839('0xd')](['origin',_0xf839('0x13')],function(_0x41fe4f){if(_0x41fe4f){logger['error'](_0x41fe4f);return _0x239b76[_0xf839('0x11')](0x1f4)[_0xf839('0x12')](_0x41fe4f);}logger['info']('git\x20fetch');return _0x239b76[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xf839('0x14')]=function(_0x58900d,_0x10e242){return git[_0xf839('0x14')](['--hard',_0xf839('0x15')],function(_0xfe017c){if(_0xfe017c){logger[_0xf839('0x16')](_0xfe017c);return _0x10e242[_0xf839('0x11')](0x1f4)[_0xf839('0x12')](_0xfe017c);}logger[_0xf839('0x17')](_0xf839('0x18'));return _0x10e242[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':_0xf839('0x19')});});};exports['pull']=function(_0xc8d7f4,_0x4cd2ff){exec(_0xf839('0x1a'),function(_0x16dcbf,_0x36ad52,_0x12c809){logger['info'](_0x36ad52);logger[_0xf839('0x17')](_0x12c809);if(_0x16dcbf){logger[_0xf839('0x16')](_0x16dcbf);return _0x4cd2ff[_0xf839('0x11')](0x1f4)[_0xf839('0x12')](_0x16dcbf);}return _0x4cd2ff[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':_0x36ad52});});};exports[_0xf839('0x1b')]=function(_0x425691,_0x3f0152){return pm2[_0xf839('0x1b')](_0xf839('0x1c'))[_0xf839('0x1d')](function(_0x4ba787){logger[_0xf839('0x17')](_0xf839('0x1e'),_0x4ba787);return _0x3f0152[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':_0xf839('0x1f')});})['catch'](function(_0x537346){logger[_0xf839('0x16')](_0x537346);return _0x3f0152[_0xf839('0x11')](0x1f4)[_0xf839('0x12')](_0x537346);});};exports[_0xf839('0x20')]=function(_0x1b4693,_0x49a88e){var _0x3780b7=fs[_0xf839('0x21')](path['join'](config[_0xf839('0x9')],_0xf839('0x22'),'migrations'));var _0x3f389d=[];for(var _0x119ab9=0x0;_0x119ab9<_0x3780b7['length'];_0x119ab9++){var _0x43b678=_0x3780b7[_0x119ab9][_0xf839('0x23')](_0xf839('0x24'),'');if(compareVersions(module[_0xf839('0xa')]['version'],_0x43b678)===-0x1){_0x3f389d[_0xf839('0x25')](_0x43b678);}}if(_0x3f389d[_0xf839('0x26')]){var _0x10e0c6=_0x3f389d[_0xf839('0x27')](compareVersions);var _0xe1e16b=new Umzug({'storage':_0xf839('0x28'),'storageOptions':{'model':db[_0xf839('0x29')],'modelName':_0xf839('0x29'),'columnName':_0xf839('0xf')},'migrations':{'params':[db[_0xf839('0x28')][_0xf839('0x2a')](),db[_0xf839('0x28')][_0xf839('0x2b')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path[_0xf839('0x2c')](config['root'],_0xf839('0x22'),'migrations'),'pattern':/\.js$/}});_0xe1e16b['up']({'migrations':_['map'](_0x10e0c6,function(_0x294ccf){return _0x294ccf+_0xf839('0x24');})})[_0xf839('0x1d')](function(){return _0x49a88e[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':_0xf839('0x2d')+module[_0xf839('0xa')][_0xf839('0xf')]+_0xf839('0x2e')+_[_0xf839('0x2f')](_0x10e0c6),'migrations':_[_0xf839('0x2c')](_0x10e0c6)});})[_0xf839('0x30')](function(_0x3d1f33){if(_0x3d1f33 instanceof db[_0xf839('0x28')][_0xf839('0x31')]){return _0x49a88e[_0xf839('0x11')](0xc8)['json']({'output':_0xf839('0x32')});}else{return _0x49a88e[_0xf839('0x11')](0x1f4)[_0xf839('0x12')](_0x3d1f33);}});}else{return _0x49a88e[_0xf839('0x11')](0xc8)[_0xf839('0x12')]({'output':_0xf839('0x32')});}};
\ No newline at end of file
+var _0x9b48=['constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','exec','../../mysqldb','../../config/environment','../../config/pm2','update','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','json','origin','master','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','error','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','.js','exports','push','sort','Migration','getQueryInterface','sequelize'];(function(_0x294ced,_0x707cf4){var _0x460601=function(_0x42cceb){while(--_0x42cceb){_0x294ced['push'](_0x294ced['shift']());}};_0x460601(++_0x707cf4);}(_0x9b48,0x157));var _0x89b4=function(_0x267e6a,_0x25cd7c){_0x267e6a=_0x267e6a-0x0;var _0x465d5c=_0x9b48[_0x267e6a];return _0x465d5c;};'use strict';var Umzug=require(_0x89b4('0x0'));var path=require(_0x89b4('0x1'));var fs=require('fs');var _=require(_0x89b4('0x2'));var pkginfo=require(_0x89b4('0x3'))(module,_0x89b4('0x4'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0x89b4('0x5')];var db=require(_0x89b4('0x6'))['db'];var config=require(_0x89b4('0x7'));var pm2=require(_0x89b4('0x8'));var logger=require('../../config/logger')(_0x89b4('0x9'));var git=require(_0x89b4('0xa'))(config[_0x89b4('0xb')]);exports[_0x89b4('0xc')]=function(_0x14c7e5,_0x492e8d){var _0xad5fce={'current':module['exports'][_0x89b4('0x4')],'phonebar':0x2};if(_0x14c7e5['query']&&_0x14c7e5[_0x89b4('0xd')][_0x89b4('0xe')]){return git[_0x89b4('0xf')]()[_0x89b4('0x10')](function(_0x5c9714,_0x449c3a){_0xad5fce[_0x89b4('0xe')]=(_0x5c9714?module['exports'][_0x89b4('0x4')]:_0x449c3a[_0x89b4('0xe')])||_0x89b4('0x11');return _0x492e8d[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')](_0xad5fce);});}else{return _0x492e8d[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')](_0xad5fce);}};exports[_0x89b4('0xf')]=function(_0x1633f4,_0x4402d2){return git[_0x89b4('0xf')]([_0x89b4('0x14'),_0x89b4('0x15')],function(_0x2e3a77){if(_0x2e3a77){logger['error'](_0x2e3a77);return _0x4402d2[_0x89b4('0x12')](0x1f4)['json'](_0x2e3a77);}logger['info'](_0x89b4('0x16'));return _0x4402d2['status'](0xc8)[_0x89b4('0x13')]({'output':_0x89b4('0x17')});});};exports['reset']=function(_0x49e7fe,_0x442f91){return git[_0x89b4('0x18')]([_0x89b4('0x19'),_0x89b4('0x1a')],function(_0x57a662){if(_0x57a662){logger['error'](_0x57a662);return _0x442f91[_0x89b4('0x12')](0x1f4)[_0x89b4('0x13')](_0x57a662);}logger[_0x89b4('0x1b')](_0x89b4('0x1c'));return _0x442f91[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')]({'output':_0x89b4('0x1d')});});};exports['pull']=function(_0x4a634f,_0x4e16e7){exec(_0x89b4('0x1e'),function(_0x197b72,_0x3ee527,_0x1e8648){logger[_0x89b4('0x1b')](_0x3ee527);logger['info'](_0x1e8648);if(_0x197b72){logger[_0x89b4('0x1f')](_0x197b72);return _0x4e16e7[_0x89b4('0x12')](0x1f4)[_0x89b4('0x13')](_0x197b72);}return _0x4e16e7[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')]({'output':_0x3ee527});});};exports[_0x89b4('0x20')]=function(_0x3c5337,_0xbab90b){return pm2['restart'](_0x89b4('0x21'))['then'](function(_0x4f1244){logger[_0x89b4('0x1b')](_0x89b4('0x22'),_0x4f1244);return _0xbab90b[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')]({'output':_0x89b4('0x23')});})[_0x89b4('0x24')](function(_0x1c1f37){logger['error'](_0x1c1f37);return _0xbab90b['status'](0x1f4)[_0x89b4('0x13')](_0x1c1f37);});};exports[_0x89b4('0x25')]=function(_0x2e28de,_0x26b0e2){var _0x21fef1=fs[_0x89b4('0x26')](path[_0x89b4('0x27')](config[_0x89b4('0xb')],_0x89b4('0x28'),_0x89b4('0x25')));var _0x1c155c=[];for(var _0x39e722=0x0;_0x39e722<_0x21fef1[_0x89b4('0x29')];_0x39e722++){var _0x32c87e=_0x21fef1[_0x39e722]['replace'](_0x89b4('0x2a'),'');if(compareVersions(module[_0x89b4('0x2b')][_0x89b4('0x4')],_0x32c87e)===-0x1){_0x1c155c[_0x89b4('0x2c')](_0x32c87e);}}if(_0x1c155c[_0x89b4('0x29')]){var _0x4c9996=_0x1c155c[_0x89b4('0x2d')](compareVersions);var _0x34871a=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x89b4('0x2e')],'modelName':_0x89b4('0x2e'),'columnName':_0x89b4('0x4')},'migrations':{'params':[db['sequelize'][_0x89b4('0x2f')](),db[_0x89b4('0x30')][_0x89b4('0x31')],function(){throw new Error(_0x89b4('0x32'));}],'path':path[_0x89b4('0x27')](config[_0x89b4('0xb')],_0x89b4('0x28'),_0x89b4('0x25')),'pattern':/\.js$/}});_0x34871a['up']({'migrations':_[_0x89b4('0x33')](_0x4c9996,function(_0x297198){return _0x297198+_0x89b4('0x2a');})})[_0x89b4('0x34')](function(){return _0x26b0e2[_0x89b4('0x12')](0xc8)['json']({'output':_0x89b4('0x35')+module[_0x89b4('0x2b')][_0x89b4('0x4')]+'\x20to\x20'+_[_0x89b4('0x36')](_0x4c9996),'migrations':_['join'](_0x4c9996)});})[_0x89b4('0x24')](function(_0xab064e){if(_0xab064e instanceof db[_0x89b4('0x30')]['UniqueConstraintError']){return _0x26b0e2[_0x89b4('0x12')](0xc8)[_0x89b4('0x13')]({'output':_0x89b4('0x37')});}else{return _0x26b0e2[_0x89b4('0x12')](0x1f4)[_0x89b4('0x13')](_0xab064e);}});}else{return _0x26b0e2[_0x89b4('0x12')](0xc8)['json']({'output':_0x89b4('0x37')});}};
\ No newline at end of file
index dd7d192..1a66a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc275=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','delete','/:id','destroy','exports','multer','util','path'];(function(_0x961132,_0x125abe){var _0x322bdf=function(_0x45dd2e){while(--_0x45dd2e){_0x961132['push'](_0x961132['shift']());}};_0x322bdf(++_0x125abe);}(_0xc275,0xa8));var _0x5c27=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc275[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x5c27('0x0'));var util=require(_0x5c27('0x1'));var path=require(_0x5c27('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c27('0x3')]();var fs_extra=require(_0x5c27('0x4'));var auth=require(_0x5c27('0x5'));var interaction=require(_0x5c27('0x6'));var config=require(_0x5c27('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x5c27('0x8')]('/',auth[_0x5c27('0x9')](),controller[_0x5c27('0xa')]);router[_0x5c27('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5c27('0x9')](),controller[_0x5c27('0xb')]);router[_0x5c27('0xc')]('/',auth[_0x5c27('0x9')](),controller[_0x5c27('0xd')]);router[_0x5c27('0xe')]('/:id',auth[_0x5c27('0x9')](),controller['update']);router[_0x5c27('0xf')](_0x5c27('0x10'),auth['isAuthenticated'](),controller[_0x5c27('0x11')]);module[_0x5c27('0x12')]=router;
\ No newline at end of file
+var _0xf442=['post','put','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf442,0x10e));var _0x2f44=function(_0x38c3ff,_0x1e683b){_0x38c3ff=_0x38c3ff-0x0;var _0x32e213=_0xf442[_0x38c3ff];return _0x32e213;};'use strict';var multer=require(_0x2f44('0x0'));var util=require(_0x2f44('0x1'));var path=require(_0x2f44('0x2'));var timeout=require(_0x2f44('0x3'));var express=require('express');var router=express[_0x2f44('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f44('0x5'));var interaction=require(_0x2f44('0x6'));var config=require(_0x2f44('0x7'));var controller=require(_0x2f44('0x8'));router[_0x2f44('0x9')]('/',auth[_0x2f44('0xa')](),controller['index']);router[_0x2f44('0x9')](_0x2f44('0xb'),auth['isAuthenticated'](),controller[_0x2f44('0xc')]);router[_0x2f44('0x9')](_0x2f44('0xd'),auth[_0x2f44('0xa')](),controller[_0x2f44('0xe')]);router[_0x2f44('0xf')]('/',auth[_0x2f44('0xa')](),controller['create']);router[_0x2f44('0x10')]('/:id',auth[_0x2f44('0xa')](),controller[_0x2f44('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2f44('0x12')]=router;
\ No newline at end of file
index ecad179..ddc06c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9582=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9582,0x95));var _0x2958=function(_0x4c9e6d,_0x4ce959){_0x4c9e6d=_0x4c9e6d-0x0;var _0x16555c=_0x9582[_0x4c9e6d];return _0x16555c;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'type':{'type':Sequelize[_0x2958('0x2')]},'uniqueid':{'type':Sequelize[_0x2958('0x2')]},'calleridnum':{'type':Sequelize[_0x2958('0x2')]},'calleridname':{'type':Sequelize[_0x2958('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x2958('0x2')]},'membername':{'type':Sequelize[_0x2958('0x2')]},'agentcalledAt':{'type':Sequelize[_0x2958('0x3')]},'agentconnectAt':{'type':Sequelize[_0x2958('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x2958('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x2958('0x3')]},'agentdumpAt':{'type':Sequelize[_0x2958('0x3')]},'holdtime':{'type':Sequelize[_0x2958('0x4')]},'agentcomplete':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x2958('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x2958('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x2958('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x2958('0x2')]},'connectedlinenum':{'type':Sequelize[_0x2958('0x2')]},'connectedlinename':{'type':Sequelize[_0x2958('0x2')]},'language':{'type':Sequelize[_0x2958('0x2')]},'accountcode':{'type':Sequelize[_0x2958('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x2958('0x2')]},'priority':{'type':Sequelize[_0x2958('0x2')]},'destchannel':{'type':Sequelize[_0x2958('0x2')]},'destchannelstate':{'type':Sequelize[_0x2958('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x2958('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2958('0x2')]},'destcalleridname':{'type':Sequelize[_0x2958('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x2958('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x2958('0x2')]},'destaccountcode':{'type':Sequelize[_0x2958('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2958('0x2')]},'destuniqueid':{'type':Sequelize[_0x2958('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x2958('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x2958('0x6')},'transferexten':{'type':Sequelize[_0x2958('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xdd6e=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x38af48,_0x400460){var _0x445384=function(_0x464435){while(--_0x464435){_0x38af48['push'](_0x38af48['shift']());}};_0x445384(++_0x400460);}(_0xdd6e,0xa5));var _0xedd6=function(_0x84ff0a,_0x1c0f7d){_0x84ff0a=_0x84ff0a-0x0;var _0x9862f=_0xdd6e[_0x84ff0a];return _0x9862f;};'use strict';var Sequelize=require(_0xedd6('0x0'));module[_0xedd6('0x1')]={'type':{'type':Sequelize[_0xedd6('0x2')]},'uniqueid':{'type':Sequelize[_0xedd6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xedd6('0x2')]},'queue':{'type':Sequelize[_0xedd6('0x2')]},'interface':{'type':Sequelize[_0xedd6('0x2')]},'membername':{'type':Sequelize[_0xedd6('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xedd6('0x3')]},'agentdumpAt':{'type':Sequelize[_0xedd6('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xedd6('0x5')]},'agentacw':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0xedd6('0x2')]},'channel':{'type':Sequelize[_0xedd6('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xedd6('0x2')]},'connectedlinenum':{'type':Sequelize[_0xedd6('0x2')]},'connectedlinename':{'type':Sequelize[_0xedd6('0x2')]},'language':{'type':Sequelize[_0xedd6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xedd6('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xedd6('0x2')]},'destchannel':{'type':Sequelize[_0xedd6('0x2')]},'destchannelstate':{'type':Sequelize[_0xedd6('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xedd6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xedd6('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xedd6('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xedd6('0x2')]},'destlanguage':{'type':Sequelize[_0xedd6('0x2')]},'destaccountcode':{'type':Sequelize[_0xedd6('0x2')]},'destcontext':{'type':Sequelize[_0xedd6('0x2')]},'destexten':{'type':Sequelize[_0xedd6('0x2')]},'destpriority':{'type':Sequelize[_0xedd6('0x2')]},'destuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xedd6('0x2')]},'transfer':{'type':Sequelize[_0xedd6('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0xedd6('0x6')},'transferexten':{'type':Sequelize[_0xedd6('0x2')]},'transferuniqueid':{'type':Sequelize[_0xedd6('0x2')]},'agententerreason':{'type':Sequelize[_0xedd6('0x5')],'defaultValue':0x0}};
\ No newline at end of file
index 40f134e..2ea2678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index 9ba445d..a3ee51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e8=['../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','lodash','api','moment','bluebird','request-promise','rimraf'];(function(_0x456bd1,_0x49a3ce){var _0x2f820d=function(_0x29720b){while(--_0x29720b){_0x456bd1['push'](_0x456bd1['shift']());}};_0x2f820d(++_0x49a3ce);}(_0x44e8,0xd7));var _0x844e=function(_0xd117a2,_0x47d334){_0xd117a2=_0xd117a2-0x0;var _0x340a80=_0x44e8[_0xd117a2];return _0x340a80;};'use strict';var _=require(_0x844e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x844e('0x1'));var moment=require(_0x844e('0x2'));var BPromise=require(_0x844e('0x3'));var rp=require(_0x844e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x844e('0x5'));var config=require(_0x844e('0x6'));var attributes=require(_0x844e('0x7'));module[_0x844e('0x8')]=function(_0x5c8f67,_0x2f6539){return _0x5c8f67[_0x844e('0x9')](_0x844e('0xa'),attributes,{'tableName':_0x844e('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x844e('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8375=['rimraf','../../config/environment','exports','define','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x60d3f6,_0x2ba726){var _0x3bb584=function(_0x255d7a){while(--_0x255d7a){_0x60d3f6['push'](_0x60d3f6['shift']());}};_0x3bb584(++_0x2ba726);}(_0x8375,0x132));var _0x5837=function(_0x12c69d,_0x1fc7c5){_0x12c69d=_0x12c69d-0x0;var _0x1f9108=_0x8375[_0x12c69d];return _0x1f9108;};'use strict';var _=require('lodash');var util=require(_0x5837('0x0'));var logger=require(_0x5837('0x1'))(_0x5837('0x2'));var moment=require(_0x5837('0x3'));var BPromise=require(_0x5837('0x4'));var rp=require(_0x5837('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5837('0x6'));var config=require(_0x5837('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x5837('0x8')]=function(_0x438491,_0x21c9bd){return _0x438491[_0x5837('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x5837('0xa'),'paranoid':![],'indexes':[{'fields':[_0x5837('0xb'),_0x5837('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 21d80c5..83750fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8acd=['create','body','options','raw','UpdateVoiceAgentReport','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x8067b0,_0x14f855){var _0x53851a=function(_0x5cf9c5){while(--_0x5cf9c5){_0x8067b0['push'](_0x8067b0['shift']());}};_0x53851a(++_0x14f855);}(_0x8acd,0xe5));var _0xd8ac=function(_0xc0638b,_0x2fccf4){_0xc0638b=_0xc0638b-0x0;var _0xd57dfa=_0x8acd[_0xc0638b];return _0xd57dfa;};'use strict';var _=require(_0xd8ac('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8ac('0x1'));var db=require(_0xd8ac('0x2'))['db'];var utils=require(_0xd8ac('0x3'));var logger=require(_0xd8ac('0x4'))(_0xd8ac('0x5'));var config=require(_0xd8ac('0x6'));var jayson=require(_0xd8ac('0x7'));var client=jayson['client'][_0xd8ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x35bd8d,_0x39a01c,_0x5b579a){return new BPromise(function(_0x2cfbf1,_0x378398){return client[_0xd8ac('0x9')](_0x35bd8d,_0x5b579a)[_0xd8ac('0xa')](function(_0x5189c1){logger[_0xd8ac('0xb')](_0xd8ac('0xc'),_0x39a01c,_0xd8ac('0xd'));logger[_0xd8ac('0xe')](_0xd8ac('0xf'),_0x39a01c,_0xd8ac('0xd'),JSON[_0xd8ac('0x10')](_0x5189c1));if(_0x5189c1['error']){if(_0x5189c1['error'][_0xd8ac('0x11')]===0x1f4){logger[_0xd8ac('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0x39a01c,_0x5189c1[_0xd8ac('0x12')][_0xd8ac('0x13')]);return _0x378398(_0x5189c1[_0xd8ac('0x12')][_0xd8ac('0x13')]);}logger[_0xd8ac('0x12')](_0xd8ac('0xc'),_0x39a01c,_0x5189c1[_0xd8ac('0x12')][_0xd8ac('0x13')]);return _0x2cfbf1(_0x5189c1[_0xd8ac('0x12')][_0xd8ac('0x13')]);}else{logger['info'](_0xd8ac('0xc'),_0x39a01c,_0xd8ac('0xd'));_0x2cfbf1(_0x5189c1['result'][_0xd8ac('0x13')]);}})[_0xd8ac('0x14')](function(_0x30e82c){logger[_0xd8ac('0x12')](_0xd8ac('0xc'),_0x39a01c,_0x30e82c);_0x378398(_0x30e82c);});});}exports[_0xd8ac('0x15')]=function(_0x3160f8){var _0x79c96e=this;return new Promise(function(_0x173856,_0x29f22e){return db[_0xd8ac('0x16')][_0xd8ac('0x17')](_0x3160f8[_0xd8ac('0x18')],{'raw':_0x3160f8[_0xd8ac('0x19')]?_0x3160f8[_0xd8ac('0x19')][_0xd8ac('0x1a')]===undefined?!![]:![]:!![]})[_0xd8ac('0xa')](function(_0x41f197){logger[_0xd8ac('0xb')](_0xd8ac('0x15'),_0x3160f8);logger[_0xd8ac('0xe')](_0xd8ac('0x15'),_0x3160f8,JSON[_0xd8ac('0x10')](_0x41f197));_0x173856(_0x41f197);})['catch'](function(_0x50bb12){logger['error']('CreateVoiceAgentReport',_0x50bb12[_0xd8ac('0x13')],_0x3160f8);_0x29f22e(_0x79c96e['error'](0x1f4,_0x50bb12[_0xd8ac('0x13')]));});});};exports[_0xd8ac('0x1b')]=function(_0x1aa407){var _0x4e859c=this;return new Promise(function(_0x53665c,_0x3db441){return db['VoiceAgentReport']['update'](_0x1aa407[_0xd8ac('0x18')],{'raw':_0x1aa407[_0xd8ac('0x19')]?_0x1aa407[_0xd8ac('0x19')][_0xd8ac('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1aa407[_0xd8ac('0x19')]?_0x1aa407[_0xd8ac('0x19')]['where']||null:null,'attributes':_0x1aa407[_0xd8ac('0x19')]?_0x1aa407[_0xd8ac('0x19')]['attributes']||null:null,'limit':_0x1aa407[_0xd8ac('0x19')]?_0x1aa407[_0xd8ac('0x19')]['limit']||null:null})[_0xd8ac('0xa')](function(_0x3796c6){logger[_0xd8ac('0xb')]('UpdateVoiceAgentReport',_0x1aa407);logger[_0xd8ac('0xe')](_0xd8ac('0x1b'),_0x1aa407,JSON['stringify'](_0x3796c6));_0x53665c(_0x3796c6);})[_0xd8ac('0x14')](function(_0x3064b9){logger[_0xd8ac('0x12')](_0xd8ac('0x1b'),_0x3064b9['message'],_0x1aa407);_0x3db441(_0x4e859c[_0xd8ac('0x12')](0x1f4,_0x3064b9['message']));});});};
\ No newline at end of file
+var _0x5dd1=['VoiceAgentReport','create','body','options','raw','debug','update','where','attributes','limit','then','UpdateVoiceAgentReport','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport'];(function(_0x546acc,_0x1224d8){var _0x191520=function(_0x581ab2){while(--_0x581ab2){_0x546acc['push'](_0x546acc['shift']());}};_0x191520(++_0x1224d8);}(_0x5dd1,0x18c));var _0x15dd=function(_0x5c16d1,_0x9c593f){_0x5c16d1=_0x5c16d1-0x0;var _0xed5002=_0x5dd1[_0x5c16d1];return _0xed5002;};'use strict';var _=require(_0x15dd('0x0'));var util=require('util');var moment=require(_0x15dd('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x15dd('0x2'));var db=require(_0x15dd('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x15dd('0x4'))(_0x15dd('0x5'));var config=require(_0x15dd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x15dd('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48e5c7,_0x421967,_0x1f450c){return new BPromise(function(_0x359761,_0x130be9){return client[_0x15dd('0x8')](_0x48e5c7,_0x1f450c)['then'](function(_0x5124c8){logger[_0x15dd('0x9')]('VoiceAgentReport,\x20%s,\x20%s',_0x421967,_0x15dd('0xa'));logger['debug'](_0x15dd('0xb'),_0x421967,_0x15dd('0xa'),JSON[_0x15dd('0xc')](_0x5124c8));if(_0x5124c8[_0x15dd('0xd')]){if(_0x5124c8[_0x15dd('0xd')][_0x15dd('0xe')]===0x1f4){logger[_0x15dd('0xd')](_0x15dd('0xf'),_0x421967,_0x5124c8[_0x15dd('0xd')][_0x15dd('0x10')]);return _0x130be9(_0x5124c8['error'][_0x15dd('0x10')]);}logger[_0x15dd('0xd')](_0x15dd('0xf'),_0x421967,_0x5124c8['error'][_0x15dd('0x10')]);return _0x359761(_0x5124c8['error'][_0x15dd('0x10')]);}else{logger[_0x15dd('0x9')](_0x15dd('0xf'),_0x421967,_0x15dd('0xa'));_0x359761(_0x5124c8[_0x15dd('0x11')]['message']);}})[_0x15dd('0x12')](function(_0x4f9289){logger[_0x15dd('0xd')](_0x15dd('0xf'),_0x421967,_0x4f9289);_0x130be9(_0x4f9289);});});}exports[_0x15dd('0x13')]=function(_0x3ede0e){var _0x4329cc=this;return new Promise(function(_0x1cb08a,_0x1c58e4){return db[_0x15dd('0x14')][_0x15dd('0x15')](_0x3ede0e[_0x15dd('0x16')],{'raw':_0x3ede0e['options']?_0x3ede0e[_0x15dd('0x17')][_0x15dd('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1067cb){logger[_0x15dd('0x9')](_0x15dd('0x13'),_0x3ede0e);logger[_0x15dd('0x19')]('CreateVoiceAgentReport',_0x3ede0e,JSON[_0x15dd('0xc')](_0x1067cb));_0x1cb08a(_0x1067cb);})[_0x15dd('0x12')](function(_0x1e84fb){logger[_0x15dd('0xd')](_0x15dd('0x13'),_0x1e84fb[_0x15dd('0x10')],_0x3ede0e);_0x1c58e4(_0x4329cc['error'](0x1f4,_0x1e84fb[_0x15dd('0x10')]));});});};exports['UpdateVoiceAgentReport']=function(_0x39424b){var _0x4909a8=this;return new Promise(function(_0x2fb255,_0x3f0428){return db['VoiceAgentReport'][_0x15dd('0x1a')](_0x39424b[_0x15dd('0x16')],{'raw':_0x39424b['options']?_0x39424b['options'][_0x15dd('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39424b[_0x15dd('0x17')]?_0x39424b[_0x15dd('0x17')][_0x15dd('0x1b')]||null:null,'attributes':_0x39424b['options']?_0x39424b[_0x15dd('0x17')][_0x15dd('0x1c')]||null:null,'limit':_0x39424b[_0x15dd('0x17')]?_0x39424b['options'][_0x15dd('0x1d')]||null:null})[_0x15dd('0x1e')](function(_0x31ec33){logger['info'](_0x15dd('0x1f'),_0x39424b);logger[_0x15dd('0x19')](_0x15dd('0x1f'),_0x39424b,JSON['stringify'](_0x31ec33));_0x2fb255(_0x31ec33);})[_0x15dd('0x12')](function(_0x5a580b){logger[_0x15dd('0xd')](_0x15dd('0x1f'),_0x5a580b[_0x15dd('0x10')],_0x39424b);_0x3f0428(_0x4909a8['error'](0x1f4,_0x5a580b[_0x15dd('0x10')]));});});};
\ No newline at end of file
index e15e385..ccc4778 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca9e=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x528497,_0x147e87){var _0x392d59=function(_0x47d9ec){while(--_0x47d9ec){_0x528497['push'](_0x528497['shift']());}};_0x392d59(++_0x147e87);}(_0xca9e,0x136));var _0xeca9=function(_0x57dcca,_0x148ace){_0x57dcca=_0x57dcca-0x0;var _0x3b8774=_0xca9e[_0x57dcca];return _0x3b8774;};'use strict';var multer=require(_0xeca9('0x0'));var util=require(_0xeca9('0x1'));var path=require(_0xeca9('0x2'));var timeout=require(_0xeca9('0x3'));var express=require(_0xeca9('0x4'));var router=express[_0xeca9('0x5')]();var fs_extra=require(_0xeca9('0x6'));var auth=require(_0xeca9('0x7'));var interaction=require(_0xeca9('0x8'));var config=require(_0xeca9('0x9'));var controller=require(_0xeca9('0xa'));router[_0xeca9('0xb')]('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0xd')]);router['get'](_0xeca9('0xe'),auth[_0xeca9('0xc')](),controller['describe']);router['get'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x10')]);router['post']('/',auth[_0xeca9('0xc')](),controller[_0xeca9('0x11')]);router[_0xeca9('0x12')](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller[_0xeca9('0x13')]);router['delete'](_0xeca9('0xf'),auth[_0xeca9('0xc')](),controller['destroy']);module[_0xeca9('0x14')]=router;
\ No newline at end of file
+var _0x2d17=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','show','post','create','put','/:id','update','delete'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x2d17,0x17e));var _0x72d1=function(_0x199bb9,_0x10afc4){_0x199bb9=_0x199bb9-0x0;var _0x480713=_0x2d17[_0x199bb9];return _0x480713;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./voiceCallReport.controller');router[_0x72d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x72d1('0x8')]);router[_0x72d1('0x7')]('/describe',auth[_0x72d1('0x9')](),controller[_0x72d1('0xa')]);router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x9')](),controller[_0x72d1('0xb')]);router[_0x72d1('0xc')]('/',auth['isAuthenticated'](),controller[_0x72d1('0xd')]);router[_0x72d1('0xe')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x10')]);router[_0x72d1('0x11')](_0x72d1('0xf'),auth[_0x72d1('0x9')](),controller[_0x72d1('0x12')]);module[_0x72d1('0x13')]=router;
\ No newline at end of file
index 7fbe70a..622ed8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cd0=['outbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','internal','outbound','inbound-fax'];(function(_0x1453d6,_0x56e1cd){var _0x22eead=function(_0xce81f3){while(--_0xce81f3){_0x1453d6['push'](_0x1453d6['shift']());}};_0x22eead(++_0x56e1cd);}(_0x3cd0,0x8a));var _0x03cd=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x3cd0[_0xda464c];return _0x19e222;};'use strict';var Sequelize=require(_0x03cd('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x03cd('0x1')]('inbound',_0x03cd('0x2'),_0x03cd('0x3'),_0x03cd('0x4'),_0x03cd('0x5'),_0x03cd('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x03cd('0x7')]},'source':{'type':Sequelize[_0x03cd('0x7')]},'destination':{'type':Sequelize[_0x03cd('0x7')]},'destinationcontext':{'type':Sequelize[_0x03cd('0x7')]},'callerid':{'type':Sequelize[_0x03cd('0x7')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x03cd('0x7')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x03cd('0x8')]},'starttime':{'type':Sequelize[_0x03cd('0x9')]},'systemanswertime':{'type':Sequelize[_0x03cd('0x9')]},'answertime':{'type':Sequelize[_0x03cd('0x9')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0x03cd('0xa')]},'billableseconds':{'type':Sequelize[_0x03cd('0xa')]},'mohtime':{'type':Sequelize[_0x03cd('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x03cd('0x7')]},'amaflags':{'type':Sequelize[_0x03cd('0x7')]},'userfield':{'type':Sequelize[_0x03cd('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x03cd('0x7')]},'note':{'type':Sequelize[_0x03cd('0x7')]},'prefix':{'type':Sequelize[_0x03cd('0x7')]},'routeid':{'type':Sequelize[_0x03cd('0xa')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9898=['TEXT','DATE','INTEGER','exports','STRING','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x4adb96,_0x4c3d31){var _0x92d840=function(_0x5ee4d9){while(--_0x5ee4d9){_0x4adb96['push'](_0x4adb96['shift']());}};_0x92d840(++_0x4c3d31);}(_0x9898,0x12f));var _0x8989=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x9898[_0x4d8dc3];return _0x9b03d9;};'use strict';var Sequelize=require('sequelize');module[_0x8989('0x0')]={'uniqueid':{'type':Sequelize[_0x8989('0x1')]},'type':{'type':Sequelize['ENUM'](_0x8989('0x2'),_0x8989('0x3'),_0x8989('0x4'),_0x8989('0x5'),_0x8989('0x6'),'dialer')},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8989('0x1')]},'source':{'type':Sequelize[_0x8989('0x1')]},'destination':{'type':Sequelize[_0x8989('0x1')]},'destinationcontext':{'type':Sequelize[_0x8989('0x1')]},'callerid':{'type':Sequelize[_0x8989('0x1')]},'channel':{'type':Sequelize[_0x8989('0x1')]},'destinationchannel':{'type':Sequelize[_0x8989('0x1')]},'lastapplication':{'type':Sequelize[_0x8989('0x1')]},'lastdata':{'type':Sequelize[_0x8989('0x7')]},'starttime':{'type':Sequelize[_0x8989('0x8')]},'systemanswertime':{'type':Sequelize[_0x8989('0x8')]},'answertime':{'type':Sequelize[_0x8989('0x8')]},'endtime':{'type':Sequelize[_0x8989('0x8')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0x8989('0x9')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8989('0x1')]},'amaflags':{'type':Sequelize[_0x8989('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8989('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x8989('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x8989('0x1')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x8989('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x8989('0x1')]}};
\ No newline at end of file
index 5268f6a..77700a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0xadb5,0xad));var _0x5adb=function(_0x426fc6,_0x495be3){_0x426fc6=_0x426fc6-0x0;var _0x17b96a=_0xadb5[_0x426fc6];return _0x17b96a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));};
\ No newline at end of file
+var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
index b5e62df..1ad8160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e9f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','VoiceCallReport','report_call','uniqueid','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1e9f,0x107));var _0xf1e9=function(_0x1ca2e1,_0x10d773){_0x1ca2e1=_0x1ca2e1-0x0;var _0x2d1c34=_0x1e9f[_0x1ca2e1];return _0x2d1c34;};'use strict';var _=require(_0xf1e9('0x0'));var util=require('util');var logger=require(_0xf1e9('0x1'))(_0xf1e9('0x2'));var moment=require(_0xf1e9('0x3'));var BPromise=require(_0xf1e9('0x4'));var rp=require(_0xf1e9('0x5'));var fs=require('fs');var path=require(_0xf1e9('0x6'));var rimraf=require('rimraf');var config=require(_0xf1e9('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x26d29b,_0x56386d){return _0x26d29b['define'](_0xf1e9('0x8'),attributes,{'tableName':_0xf1e9('0x9'),'paranoid':![],'indexes':[{'fields':[_0xf1e9('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7aad=['report_call','lodash','../../config/logger','api','bluebird','request-promise','path','./voiceCallReport.attributes','exports'];(function(_0x5be1ac,_0x5ee1f4){var _0x21b996=function(_0x377104){while(--_0x377104){_0x5be1ac['push'](_0x5be1ac['shift']());}};_0x21b996(++_0x5ee1f4);}(_0x7aad,0x160));var _0xd7aa=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x7aad[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xd7aa('0x0'));var util=require('util');var logger=require(_0xd7aa('0x1'))(_0xd7aa('0x2'));var moment=require('moment');var BPromise=require(_0xd7aa('0x3'));var rp=require(_0xd7aa('0x4'));var fs=require('fs');var path=require(_0xd7aa('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7aa('0x6'));module[_0xd7aa('0x7')]=function(_0x2fe602,_0xb6d0b2){return _0x2fe602['define']('VoiceCallReport',attributes,{'tableName':_0xd7aa('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index bd88d04..82f6998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1976=['body','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceCallReport','findAll','options','raw','where','attributes','include','map','model','VoiceCallReport','create','CreateVoiceCallReport','UpdateVoiceCallReport'];(function(_0x180c9b,_0x13d173){var _0x3ff116=function(_0x241982){while(--_0x241982){_0x180c9b['push'](_0x180c9b['shift']());}};_0x3ff116(++_0x13d173);}(_0x1976,0x1e3));var _0x6197=function(_0x37e714,_0x2fcd2d){_0x37e714=_0x37e714-0x0;var _0xda05c1=_0x1976[_0x37e714];return _0xda05c1;};'use strict';var _=require('lodash');var util=require(_0x6197('0x0'));var moment=require('moment');var BPromise=require(_0x6197('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6197('0x2'));var db=require(_0x6197('0x3'))['db'];var utils=require(_0x6197('0x4'));var logger=require(_0x6197('0x5'))(_0x6197('0x6'));var config=require('../../config/environment');var jayson=require(_0x6197('0x7'));var client=jayson[_0x6197('0x8')][_0x6197('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c5c1,_0x15462b,_0x2fbcb3){return new BPromise(function(_0x196143,_0x46fe19){return client[_0x6197('0xa')](_0x19c5c1,_0x2fbcb3)[_0x6197('0xb')](function(_0x380a5d){logger[_0x6197('0xc')](_0x6197('0xd'),_0x15462b,_0x6197('0xe'));logger[_0x6197('0xf')](_0x6197('0x10'),_0x15462b,'request\x20sent',JSON[_0x6197('0x11')](_0x380a5d));if(_0x380a5d[_0x6197('0x12')]){if(_0x380a5d[_0x6197('0x12')]['code']===0x1f4){logger[_0x6197('0x12')](_0x6197('0xd'),_0x15462b,_0x380a5d['error'][_0x6197('0x13')]);return _0x46fe19(_0x380a5d[_0x6197('0x12')][_0x6197('0x13')]);}logger[_0x6197('0x12')](_0x6197('0xd'),_0x15462b,_0x380a5d[_0x6197('0x12')][_0x6197('0x13')]);return _0x196143(_0x380a5d[_0x6197('0x12')]['message']);}else{logger[_0x6197('0xc')](_0x6197('0xd'),_0x15462b,'request\x20sent');_0x196143(_0x380a5d[_0x6197('0x14')][_0x6197('0x13')]);}})[_0x6197('0x15')](function(_0x382abe){logger['error'](_0x6197('0xd'),_0x15462b,_0x382abe);_0x46fe19(_0x382abe);});});}exports[_0x6197('0x16')]=function(_0x143836){var _0x214049=this;return new Promise(function(_0x48024e,_0x24a557){return db['VoiceCallReport'][_0x6197('0x17')]({'raw':_0x143836[_0x6197('0x18')]?_0x143836[_0x6197('0x18')][_0x6197('0x19')]===undefined?!![]:![]:!![],'where':_0x143836[_0x6197('0x18')]?_0x143836[_0x6197('0x18')][_0x6197('0x1a')]||null:null,'attributes':_0x143836[_0x6197('0x18')]?_0x143836[_0x6197('0x18')][_0x6197('0x1b')]||null:null,'limit':_0x143836[_0x6197('0x18')]?_0x143836[_0x6197('0x18')]['limit']||null:null,'include':_0x143836[_0x6197('0x18')]?_0x143836['options'][_0x6197('0x1c')]?_['map'](_0x143836[_0x6197('0x18')][_0x6197('0x1c')],function(_0x3cc115){return{'model':db[_0x3cc115['model']],'as':_0x3cc115['as'],'attributes':_0x3cc115[_0x6197('0x1b')],'include':_0x3cc115['include']?_[_0x6197('0x1d')](_0x3cc115[_0x6197('0x1c')],function(_0x5bd5d9){return{'model':db[_0x5bd5d9[_0x6197('0x1e')]],'as':_0x5bd5d9['as'],'attributes':_0x5bd5d9[_0x6197('0x1b')],'include':_0x5bd5d9['include']?_[_0x6197('0x1d')](_0x5bd5d9[_0x6197('0x1c')],function(_0x191065){return{'model':db[_0x191065[_0x6197('0x1e')]],'as':_0x191065['as'],'attributes':_0x191065[_0x6197('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6197('0xb')](function(_0x267c88){logger[_0x6197('0xc')](_0x6197('0x16'),_0x143836);logger[_0x6197('0xf')]('GetVoiceCallReport',_0x143836,JSON[_0x6197('0x11')](_0x267c88));_0x48024e(_0x267c88);})[_0x6197('0x15')](function(_0x2eb8bc){logger[_0x6197('0x12')](_0x6197('0x16'),_0x2eb8bc['message'],_0x143836);_0x24a557(_0x214049[_0x6197('0x12')](0x1f4,_0x2eb8bc['message']));});});};exports['CreateVoiceCallReport']=function(_0x9be375){var _0x4beda7=this;return new Promise(function(_0x51b053,_0x9060cb){return db[_0x6197('0x1f')][_0x6197('0x20')](_0x9be375['body'],{'raw':_0x9be375['options']?_0x9be375[_0x6197('0x18')][_0x6197('0x19')]===undefined?!![]:![]:!![]})[_0x6197('0xb')](function(_0x514aac){logger['info']('CreateVoiceCallReport',_0x9be375);logger[_0x6197('0xf')](_0x6197('0x21'),_0x9be375,JSON[_0x6197('0x11')](_0x514aac));_0x51b053(_0x514aac);})[_0x6197('0x15')](function(_0x2a47ac){logger[_0x6197('0x12')](_0x6197('0x21'),_0x2a47ac[_0x6197('0x13')],_0x9be375);_0x9060cb(_0x4beda7[_0x6197('0x12')](0x1f4,_0x2a47ac[_0x6197('0x13')]));});});};exports[_0x6197('0x22')]=function(_0x1a3698){var _0x2e5b9a=this;return new Promise(function(_0x211163,_0x12738d){return db['VoiceCallReport']['update'](_0x1a3698[_0x6197('0x23')],{'raw':_0x1a3698[_0x6197('0x18')]?_0x1a3698[_0x6197('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a3698['options']?_0x1a3698[_0x6197('0x18')][_0x6197('0x1a')]||null:null,'attributes':_0x1a3698[_0x6197('0x18')]?_0x1a3698[_0x6197('0x18')][_0x6197('0x1b')]||null:null,'limit':_0x1a3698[_0x6197('0x18')]?_0x1a3698[_0x6197('0x18')][_0x6197('0x24')]||null:null})['then'](function(_0x1f44db){logger[_0x6197('0xc')]('UpdateVoiceCallReport',_0x1a3698);logger[_0x6197('0xf')]('UpdateVoiceCallReport',_0x1a3698,JSON[_0x6197('0x11')](_0x1f44db));_0x211163(_0x1f44db);})[_0x6197('0x15')](function(_0x7b3728){logger[_0x6197('0x12')]('UpdateVoiceCallReport',_0x7b3728[_0x6197('0x13')],_0x1a3698);_0x12738d(_0x2e5b9a[_0x6197('0x12')](0x1f4,_0x7b3728[_0x6197('0x13')]));});});};
\ No newline at end of file
+var _0x1ef3=['message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x119680,_0x1e6a47){var _0x21e81e=function(_0x313bd0){while(--_0x313bd0){_0x119680['push'](_0x119680['shift']());}};_0x21e81e(++_0x1e6a47);}(_0x1ef3,0x116));var _0x31ef=function(_0x3f62ae,_0x43b968){_0x3f62ae=_0x3f62ae-0x0;var _0x3cf725=_0x1ef3[_0x3f62ae];return _0x3cf725;};'use strict';var _=require('lodash');var util=require(_0x31ef('0x0'));var moment=require('moment');var BPromise=require(_0x31ef('0x1'));var rs=require(_0x31ef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31ef('0x3'))['db'];var utils=require(_0x31ef('0x4'));var logger=require('../../config/logger')(_0x31ef('0x5'));var config=require(_0x31ef('0x6'));var jayson=require(_0x31ef('0x7'));var client=jayson[_0x31ef('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15a732,_0x5a2d9d,_0x5b00de){return new BPromise(function(_0x26541b,_0x28290c){return client[_0x31ef('0x9')](_0x15a732,_0x5b00de)[_0x31ef('0xa')](function(_0x36f562){logger[_0x31ef('0xb')](_0x31ef('0xc'),_0x5a2d9d,_0x31ef('0xd'));logger[_0x31ef('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x5a2d9d,'request\x20sent',JSON[_0x31ef('0xf')](_0x36f562));if(_0x36f562[_0x31ef('0x10')]){if(_0x36f562['error'][_0x31ef('0x11')]===0x1f4){logger['error'](_0x31ef('0xc'),_0x5a2d9d,_0x36f562[_0x31ef('0x10')]['message']);return _0x28290c(_0x36f562[_0x31ef('0x10')][_0x31ef('0x12')]);}logger[_0x31ef('0x10')](_0x31ef('0xc'),_0x5a2d9d,_0x36f562[_0x31ef('0x10')][_0x31ef('0x12')]);return _0x26541b(_0x36f562[_0x31ef('0x10')][_0x31ef('0x12')]);}else{logger[_0x31ef('0xb')](_0x31ef('0xc'),_0x5a2d9d,'request\x20sent');_0x26541b(_0x36f562[_0x31ef('0x13')][_0x31ef('0x12')]);}})[_0x31ef('0x14')](function(_0x2ba677){logger[_0x31ef('0x10')](_0x31ef('0xc'),_0x5a2d9d,_0x2ba677);_0x28290c(_0x2ba677);});});}exports[_0x31ef('0x15')]=function(_0x5c54d3){var _0x3483ea=this;return new Promise(function(_0x227a28,_0x52c910){return db[_0x31ef('0x16')][_0x31ef('0x17')]({'raw':_0x5c54d3['options']?_0x5c54d3[_0x31ef('0x18')][_0x31ef('0x19')]===undefined?!![]:![]:!![],'where':_0x5c54d3[_0x31ef('0x18')]?_0x5c54d3['options']['where']||null:null,'attributes':_0x5c54d3[_0x31ef('0x18')]?_0x5c54d3[_0x31ef('0x18')][_0x31ef('0x1a')]||null:null,'limit':_0x5c54d3[_0x31ef('0x18')]?_0x5c54d3[_0x31ef('0x18')][_0x31ef('0x1b')]||null:null,'include':_0x5c54d3[_0x31ef('0x18')]?_0x5c54d3[_0x31ef('0x18')][_0x31ef('0x1c')]?_[_0x31ef('0x1d')](_0x5c54d3[_0x31ef('0x18')][_0x31ef('0x1c')],function(_0x3af62f){return{'model':db[_0x3af62f[_0x31ef('0x1e')]],'as':_0x3af62f['as'],'attributes':_0x3af62f[_0x31ef('0x1a')],'include':_0x3af62f[_0x31ef('0x1c')]?_['map'](_0x3af62f[_0x31ef('0x1c')],function(_0x16167d){return{'model':db[_0x16167d[_0x31ef('0x1e')]],'as':_0x16167d['as'],'attributes':_0x16167d[_0x31ef('0x1a')],'include':_0x16167d[_0x31ef('0x1c')]?_[_0x31ef('0x1d')](_0x16167d[_0x31ef('0x1c')],function(_0x10f19e){return{'model':db[_0x10f19e[_0x31ef('0x1e')]],'as':_0x10f19e['as'],'attributes':_0x10f19e['attributes']};}):[]};}):[]};}):[]:[]})[_0x31ef('0xa')](function(_0x36a28a){logger[_0x31ef('0xb')](_0x31ef('0x15'),_0x5c54d3);logger[_0x31ef('0xe')](_0x31ef('0x15'),_0x5c54d3,JSON[_0x31ef('0xf')](_0x36a28a));_0x227a28(_0x36a28a);})[_0x31ef('0x14')](function(_0x714d73){logger[_0x31ef('0x10')](_0x31ef('0x15'),_0x714d73[_0x31ef('0x12')],_0x5c54d3);_0x52c910(_0x3483ea[_0x31ef('0x10')](0x1f4,_0x714d73['message']));});});};exports[_0x31ef('0x1f')]=function(_0x509311){var _0x18bb27=this;return new Promise(function(_0x33416d,_0x1a8ba3){return db[_0x31ef('0x16')][_0x31ef('0x20')](_0x509311[_0x31ef('0x21')],{'raw':_0x509311['options']?_0x509311[_0x31ef('0x18')][_0x31ef('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3d2d0b){logger['info']('CreateVoiceCallReport',_0x509311);logger[_0x31ef('0xe')](_0x31ef('0x1f'),_0x509311,JSON[_0x31ef('0xf')](_0x3d2d0b));_0x33416d(_0x3d2d0b);})['catch'](function(_0x180962){logger[_0x31ef('0x10')]('CreateVoiceCallReport',_0x180962[_0x31ef('0x12')],_0x509311);_0x1a8ba3(_0x18bb27[_0x31ef('0x10')](0x1f4,_0x180962[_0x31ef('0x12')]));});});};exports[_0x31ef('0x22')]=function(_0x51eb6f){var _0x4a7acd=this;return new Promise(function(_0x6707,_0x312e07){return db[_0x31ef('0x16')][_0x31ef('0x23')](_0x51eb6f[_0x31ef('0x21')],{'raw':_0x51eb6f['options']?_0x51eb6f[_0x31ef('0x18')][_0x31ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51eb6f[_0x31ef('0x18')]?_0x51eb6f[_0x31ef('0x18')][_0x31ef('0x24')]||null:null,'attributes':_0x51eb6f[_0x31ef('0x18')]?_0x51eb6f['options'][_0x31ef('0x1a')]||null:null,'limit':_0x51eb6f[_0x31ef('0x18')]?_0x51eb6f[_0x31ef('0x18')][_0x31ef('0x1b')]||null:null})['then'](function(_0x3109ec){logger[_0x31ef('0xb')](_0x31ef('0x22'),_0x51eb6f);logger[_0x31ef('0xe')]('UpdateVoiceCallReport',_0x51eb6f,JSON['stringify'](_0x3109ec));_0x6707(_0x3109ec);})[_0x31ef('0x14')](function(_0xb9193a){logger['error']('UpdateVoiceCallReport',_0xb9193a[_0x31ef('0x12')],_0x51eb6f);_0x312e07(_0x4a7acd['error'](0x1f4,_0xb9193a[_0x31ef('0x12')]));});});};
\ No newline at end of file
index f94e053..5788cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25af=['/:id','show','create','put','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index'];(function(_0x403829,_0x4e8f8d){var _0x5c1cfe=function(_0x2dcef9){while(--_0x2dcef9){_0x403829['push'](_0x403829['shift']());}};_0x5c1cfe(++_0x4e8f8d);}(_0x25af,0x6c));var _0xf25a=function(_0x45707a,_0x5429fb){_0x45707a=_0x45707a-0x0;var _0x17f320=_0x25af[_0x45707a];return _0x17f320;};'use strict';var multer=require(_0xf25a('0x0'));var util=require(_0xf25a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf25a('0x2')]();var fs_extra=require(_0xf25a('0x3'));var auth=require(_0xf25a('0x4'));var interaction=require(_0xf25a('0x5'));var config=require(_0xf25a('0x6'));var controller=require(_0xf25a('0x7'));router[_0xf25a('0x8')]('/',auth[_0xf25a('0x9')](),controller[_0xf25a('0xa')]);router[_0xf25a('0x8')](_0xf25a('0xb'),auth[_0xf25a('0x9')](),controller[_0xf25a('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf25a('0xd')]);router[_0xf25a('0xe')]('/:id',auth[_0xf25a('0x9')](),controller['update']);router['delete'](_0xf25a('0xb'),auth['isAuthenticated'](),controller[_0xf25a('0xf')]);module[_0xf25a('0x10')]=router;
\ No newline at end of file
+var _0x77ce=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','put'];(function(_0x533f7b,_0x4f832c){var _0x1fecc1=function(_0x2f2845){while(--_0x2f2845){_0x533f7b['push'](_0x533f7b['shift']());}};_0x1fecc1(++_0x4f832c);}(_0x77ce,0x197));var _0xe77c=function(_0x50057a,_0x248bbc){_0x50057a=_0x50057a-0x0;var _0x2fbd1b=_0x77ce[_0x50057a];return _0x2fbd1b;};'use strict';var multer=require(_0xe77c('0x0'));var util=require(_0xe77c('0x1'));var path=require(_0xe77c('0x2'));var timeout=require(_0xe77c('0x3'));var express=require('express');var router=express[_0xe77c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe77c('0x5'));var interaction=require(_0xe77c('0x6'));var config=require(_0xe77c('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xe77c('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe77c('0x8')](_0xe77c('0x9'),auth[_0xe77c('0xa')](),controller['show']);router[_0xe77c('0xb')]('/',auth[_0xe77c('0xa')](),controller['create']);router[_0xe77c('0xc')]('/:id',auth[_0xe77c('0xa')](),controller[_0xe77c('0xd')]);router[_0xe77c('0xe')](_0xe77c('0x9'),auth[_0xe77c('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 02a2a9b..fc1253d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e4e=['BOOLEAN','sequelize','exports','STRING','name','setDataValue','options','getDataValue','split'];(function(_0xb82243,_0x5c361f){var _0x4596b8=function(_0x3efa36){while(--_0x3efa36){_0xb82243['push'](_0xb82243['shift']());}};_0x4596b8(++_0x5c361f);}(_0x6e4e,0x1ba));var _0xe6e4=function(_0x3fe720,_0x22664a){_0x3fe720=_0x3fe720-0x0;var _0x17c702=_0x6e4e[_0x3fe720];return _0x17c702;};'use strict';var Sequelize=require(_0xe6e4('0x0'));module[_0xe6e4('0x1')]={'name':{'type':Sequelize[_0xe6e4('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xe6e4('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xe6e4('0x2')],'set':function(_0xeda34f){this[_0xe6e4('0x4')](_0xe6e4('0x5'),_0xeda34f?_0xeda34f['join'](''):[]);},'get':function(){return this[_0xe6e4('0x6')]('options')?this[_0xe6e4('0x6')]('options')[_0xe6e4('0x7')](''):[];}},'auth':{'type':Sequelize[_0xe6e4('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0xe6e4('0x2')]},'record':{'type':Sequelize[_0xe6e4('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe6e4('0x2')]},'description':{'type':Sequelize[_0xe6e4('0x2')]}};
\ No newline at end of file
+var _0x6ad7=['setDataValue','getDataValue','options','split','BOOLEAN','STRING','name'];(function(_0x3c7ee6,_0x300672){var _0x4c6951=function(_0x35fb66){while(--_0x35fb66){_0x3c7ee6['push'](_0x3c7ee6['shift']());}};_0x4c6951(++_0x300672);}(_0x6ad7,0xc3));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0x76ad('0x0'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x298740){this[_0x76ad('0x1')]('options',_0x298740?_0x298740['join'](''):[]);},'get':function(){return this[_0x76ad('0x2')](_0x76ad('0x3'))?this['getDataValue'](_0x76ad('0x3'))[_0x76ad('0x4')](''):[];}},'auth':{'type':Sequelize[_0x76ad('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0x76ad('0x6')]},'record':{'type':Sequelize[_0x76ad('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x76ad('0x6')]}};
\ No newline at end of file
index a99aef8..2d746be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e16=['destroy','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','params','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','json','apply','reject','save','update','then'];(function(_0x104a84,_0x285970){var _0x4973ff=function(_0x5064e7){while(--_0x5064e7){_0x104a84['push'](_0x104a84['shift']());}};_0x4973ff(++_0x285970);}(_0x6e16,0x1d3));var _0x66e1=function(_0x436340,_0xe2aecf){_0x436340=_0x436340-0x0;var _0x37b0b3=_0x6e16[_0x436340];return _0x37b0b3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66e1('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x66e1('0x1'));var moment=require('moment');var BPromise=require(_0x66e1('0x2'));var Mustache=require(_0x66e1('0x3'));var util=require('util');var path=require(_0x66e1('0x4'));var sox=require('sox');var csv=require(_0x66e1('0x5'));var ejs=require(_0x66e1('0x6'));var fs=require('fs');var fs_extra=require(_0x66e1('0x7'));var _=require('lodash');var squel=require(_0x66e1('0x8'));var crypto=require(_0x66e1('0x9'));var jsforce=require(_0x66e1('0xa'));var deskjs=require(_0x66e1('0xb'));var toCsv=require(_0x66e1('0x5'));var querystring=require(_0x66e1('0xc'));var Papa=require(_0x66e1('0xd'));var Redis=require(_0x66e1('0xe'));var authService=require(_0x66e1('0xf'));var qs=require(_0x66e1('0x10'));var as=require(_0x66e1('0x11'));var hardwareService=require(_0x66e1('0x12'));var logger=require(_0x66e1('0x13'))(_0x66e1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x66e1('0x15'));var db=require(_0x66e1('0x16'))['db'];function respondWithStatusCode(_0x23e018,_0x497712){_0x497712=_0x497712||0xcc;return function(_0x58c184){if(_0x58c184){return _0x23e018[_0x66e1('0x17')](_0x497712);}return _0x23e018['status'](_0x497712)[_0x66e1('0x18')]();};}function respondWithResult(_0x3e36ff,_0x5b802b){_0x5b802b=_0x5b802b||0xc8;return function(_0x9c17f9){if(_0x9c17f9){return _0x3e36ff[_0x66e1('0x19')](_0x5b802b)['json'](_0x9c17f9);}};}function respondWithFilteredResult(_0x137f52,_0x12ca0b){return function(_0x18e2ab){if(_0x18e2ab){var _0x3a68b3=typeof _0x12ca0b['offset']===_0x66e1('0x1a')&&typeof _0x12ca0b[_0x66e1('0x1b')]===_0x66e1('0x1a');var _0x28e236=_0x18e2ab[_0x66e1('0x1c')];var _0x4f3276=_0x3a68b3?0x0:_0x12ca0b['offset'];var _0x2b5585=_0x3a68b3?_0x18e2ab['count']:_0x12ca0b[_0x66e1('0x1d')]+_0x12ca0b[_0x66e1('0x1b')];var _0x260e87;if(_0x2b5585>=_0x28e236){_0x2b5585=_0x28e236;_0x260e87=0xc8;}else{_0x260e87=0xce;}_0x137f52[_0x66e1('0x19')](_0x260e87);return _0x137f52[_0x66e1('0x1e')]('Content-Range',_0x4f3276+'-'+_0x2b5585+'/'+_0x28e236)[_0x66e1('0x1f')](_0x18e2ab);}return null;};}function patchUpdates(_0x23c6ce){return function(_0xe2822e){try{jsonpatch[_0x66e1('0x20')](_0xe2822e,_0x23c6ce,!![]);}catch(_0x28f6cf){return BPromise[_0x66e1('0x21')](_0x28f6cf);}return _0xe2822e[_0x66e1('0x22')]();};}function saveUpdates(_0x38cf5b,_0x11232c){return function(_0x350b81){if(_0x350b81){return _0x350b81[_0x66e1('0x23')](_0x38cf5b)[_0x66e1('0x24')](function(_0x43686e){return _0x43686e;});}return null;};}function removeEntity(_0x2ea42d,_0x756840){return function(_0x11b7f0){if(_0x11b7f0){return _0x11b7f0[_0x66e1('0x25')]()['then'](function(){var _0xca80e3=_0x11b7f0['get']({'plain':!![]});var _0x203919=_0x66e1('0x26');return db[_0x66e1('0x27')][_0x66e1('0x25')]({'where':{'type':_0x203919,'resourceId':_0xca80e3['id']}})[_0x66e1('0x24')](function(){return _0x11b7f0;});})['then'](function(){_0x2ea42d[_0x66e1('0x19')](0xcc)[_0x66e1('0x18')]();});}};}function handleEntityNotFound(_0x2c4d08,_0x57fd03){return function(_0x4036c5){if(!_0x4036c5){_0x2c4d08['sendStatus'](0x194);}return _0x4036c5;};}function handleError(_0x5e1e87,_0x21fd24){_0x21fd24=_0x21fd24||0x1f4;return function(_0x3fcc99){logger[_0x66e1('0x28')](_0x3fcc99[_0x66e1('0x29')]);if(_0x3fcc99[_0x66e1('0x2a')]){delete _0x3fcc99[_0x66e1('0x2a')];}_0x5e1e87[_0x66e1('0x19')](_0x21fd24)[_0x66e1('0x2b')](_0x3fcc99);};}exports[_0x66e1('0x2c')]=function(_0x2b9045,_0x87bf90){var _0x24730f={},_0x53227c={},_0x1fefdb={'count':0x0,'rows':[]};var _0x1a708a=_['map'](db[_0x66e1('0x2d')][_0x66e1('0x2e')],function(_0xe4df21){return{'name':_0xe4df21[_0x66e1('0x2f')],'type':_0xe4df21['type'][_0x66e1('0x30')]};});_0x53227c[_0x66e1('0x31')]=_[_0x66e1('0x32')](_0x1a708a,'name');_0x53227c[_0x66e1('0x33')]=_['keys'](_0x2b9045['query']);_0x53227c['filters']=_[_0x66e1('0x34')](_0x53227c[_0x66e1('0x31')],_0x53227c['query']);_0x24730f[_0x66e1('0x35')]=_[_0x66e1('0x34')](_0x53227c['model'],qs['fields'](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x36')]));_0x24730f[_0x66e1('0x35')]=_0x24730f['attributes'][_0x66e1('0x37')]?_0x24730f[_0x66e1('0x35')]:_0x53227c[_0x66e1('0x31')];if(!_0x2b9045[_0x66e1('0x33')]['hasOwnProperty'](_0x66e1('0x38'))){_0x24730f[_0x66e1('0x1b')]=qs[_0x66e1('0x1b')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x1b')]);_0x24730f[_0x66e1('0x1d')]=qs[_0x66e1('0x1d')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x1d')]);}_0x24730f[_0x66e1('0x39')]=qs[_0x66e1('0x3a')](_0x2b9045[_0x66e1('0x33')][_0x66e1('0x3a')]);_0x24730f[_0x66e1('0x3b')]=qs[_0x66e1('0x3c')](_[_0x66e1('0x3d')](_0x2b9045[_0x66e1('0x33')],_0x53227c['filters']),_0x1a708a);if(_0x2b9045[_0x66e1('0x33')][_0x66e1('0x3e')]){_0x24730f[_0x66e1('0x3b')]=_['merge'](_0x24730f[_0x66e1('0x3b')],{'$or':_[_0x66e1('0x32')](_0x1a708a,function(_0xcaf0ae){if(_0xcaf0ae[_0x66e1('0x3f')]!==_0x66e1('0x40')){var _0x1bd058={};_0x1bd058[_0xcaf0ae[_0x66e1('0x2a')]]={'$like':'%'+_0x2b9045[_0x66e1('0x33')]['filter']+'%'};return _0x1bd058;}})});}_0x24730f=_[_0x66e1('0x41')]({},_0x24730f,_0x2b9045[_0x66e1('0x42')]);var _0x1d331e={'where':_0x24730f[_0x66e1('0x3b')]};return db[_0x66e1('0x2d')][_0x66e1('0x1c')](_0x1d331e)[_0x66e1('0x24')](function(_0x42f58e){_0x1fefdb[_0x66e1('0x1c')]=_0x42f58e;if(_0x2b9045[_0x66e1('0x33')][_0x66e1('0x43')]){_0x24730f[_0x66e1('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x66e1('0x45')](_0x24730f);})[_0x66e1('0x24')](function(_0x561b89){_0x1fefdb[_0x66e1('0x46')]=_0x561b89;return _0x1fefdb;})[_0x66e1('0x24')](respondWithFilteredResult(_0x87bf90,_0x24730f))[_0x66e1('0x47')](handleError(_0x87bf90,null));};exports[_0x66e1('0x48')]=function(_0x986bca,_0x9d35f1){var _0x406c70={'raw':![],'where':{'id':_0x986bca['params']['id']}},_0x46511c={};_0x46511c[_0x66e1('0x31')]=_['keys'](db[_0x66e1('0x2d')]['rawAttributes']);_0x46511c['query']=_[_0x66e1('0x49')](_0x986bca[_0x66e1('0x33')]);_0x46511c[_0x66e1('0x3c')]=_['intersection'](_0x46511c[_0x66e1('0x31')],_0x46511c[_0x66e1('0x33')]);_0x406c70[_0x66e1('0x35')]=_[_0x66e1('0x34')](_0x46511c['model'],qs['fields'](_0x986bca[_0x66e1('0x33')][_0x66e1('0x36')]));_0x406c70[_0x66e1('0x35')]=_0x406c70[_0x66e1('0x35')][_0x66e1('0x37')]?_0x406c70['attributes']:_0x46511c[_0x66e1('0x31')];if(_0x986bca['query'][_0x66e1('0x43')]){_0x406c70['include']=[{'all':!![]}];}_0x406c70=_[_0x66e1('0x41')]({},_0x406c70,_0x986bca['options']);return db[_0x66e1('0x2d')][_0x66e1('0x4a')](_0x406c70)[_0x66e1('0x24')](handleEntityNotFound(_0x9d35f1,null))[_0x66e1('0x24')](respondWithResult(_0x9d35f1,null))[_0x66e1('0x47')](handleError(_0x9d35f1,null));};exports[_0x66e1('0x4b')]=function(_0x529fe2,_0x317424){return db['VoiceChanSpy'][_0x66e1('0x4b')](_0x529fe2[_0x66e1('0x4c')],{})['then'](function(_0x441405){var _0xbb788c=_0x529fe2[_0x66e1('0x4d')][_0x66e1('0x4e')]({'plain':!![]});if(!_0xbb788c)throw new Error(_0x66e1('0x4f'));if(_0xbb788c['role']===_0x66e1('0x4d')){var _0x2db8f3=_0x441405[_0x66e1('0x4e')]({'plain':!![]});var _0x6bed1f=_0x66e1('0x26');return db[_0x66e1('0x50')][_0x66e1('0x4a')]({'where':{'name':_0x6bed1f,'userProfileId':_0xbb788c[_0x66e1('0x51')]},'raw':!![]})['then'](function(_0x7c6ced){if(_0x7c6ced&&_0x7c6ced[_0x66e1('0x52')]===0x0){return db[_0x66e1('0x27')]['create']({'name':_0x2db8f3[_0x66e1('0x2a')],'resourceId':_0x2db8f3['id'],'type':_0x7c6ced[_0x66e1('0x2a')],'sectionId':_0x7c6ced['id']},{})['then'](function(){return _0x441405;});}else{return _0x441405;}})['catch'](function(_0x14d27e){logger[_0x66e1('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x14d27e);throw _0x14d27e;});}return _0x441405;})['then'](respondWithResult(_0x317424,0xc9))[_0x66e1('0x47')](handleError(_0x317424,null));};exports[_0x66e1('0x23')]=function(_0x172768,_0x1ef749){if(_0x172768[_0x66e1('0x4c')]['id']){delete _0x172768[_0x66e1('0x4c')]['id'];}return db[_0x66e1('0x2d')][_0x66e1('0x4a')]({'where':{'id':_0x172768['params']['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0x1ef749,null))[_0x66e1('0x24')](saveUpdates(_0x172768[_0x66e1('0x4c')],null))[_0x66e1('0x24')](respondWithResult(_0x1ef749,null))['catch'](handleError(_0x1ef749,null));};exports[_0x66e1('0x25')]=function(_0x33eb7f,_0x169d5a){return db[_0x66e1('0x2d')][_0x66e1('0x4a')]({'where':{'id':_0x33eb7f[_0x66e1('0x53')]['id']}})[_0x66e1('0x24')](handleEntityNotFound(_0x169d5a,null))[_0x66e1('0x24')](removeEntity(_0x169d5a,null))[_0x66e1('0x47')](handleError(_0x169d5a,null));};
\ No newline at end of file
+var _0x54ef=['pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','map','VoiceChanSpy','rawAttributes','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x224ad0,_0x2482bd){var _0x2e04fc=function(_0x5ee761){while(--_0x5ee761){_0x224ad0['push'](_0x224ad0['shift']());}};_0x2e04fc(++_0x2482bd);}(_0x54ef,0x112));var _0xf54e=function(_0x251149,_0x4cf4f7){_0x251149=_0x251149-0x0;var _0x49f70a=_0x54ef[_0x251149];return _0x49f70a;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));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 Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){var _0x474b61=_0x264a8f[_0xf54e('0x28')]({'plain':!![]});var _0x160160=_0xf54e('0x29');return db[_0xf54e('0x2a')][_0xf54e('0x27')]({'where':{'type':_0x160160,'resourceId':_0x474b61['id']}})[_0xf54e('0x26')](function(){return _0x264a8f;});})[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x5390b8,_0xb3706e){return function(_0x4cbf7c){if(!_0x4cbf7c){_0x5390b8[_0xf54e('0x19')](0x194);}return _0x4cbf7c;};}function handleError(_0x5e63f4,_0x15b888){_0x15b888=_0x15b888||0x1f4;return function(_0x269f47){logger[_0xf54e('0x2b')](_0x269f47[_0xf54e('0x2c')]);if(_0x269f47[_0xf54e('0x2d')]){delete _0x269f47[_0xf54e('0x2d')];}_0x5e63f4[_0xf54e('0x1a')](_0x15b888)['send'](_0x269f47);};}exports['index']=function(_0x2f96b1,_0x258d29){var _0x2ec92e={},_0x16d00f={},_0xb2d4c4={'count':0x0,'rows':[]};var _0x133cd7=_[_0xf54e('0x2e')](db[_0xf54e('0x2f')][_0xf54e('0x30')],function(_0x12edc3){return{'name':_0x12edc3['fieldName'],'type':_0x12edc3['type'][_0xf54e('0x31')]};});_0x16d00f[_0xf54e('0x32')]=_['map'](_0x133cd7,_0xf54e('0x2d'));_0x16d00f[_0xf54e('0x33')]=_[_0xf54e('0x34')](_0x2f96b1[_0xf54e('0x33')]);_0x16d00f['filters']=_['intersection'](_0x16d00f['model'],_0x16d00f[_0xf54e('0x33')]);_0x2ec92e[_0xf54e('0x35')]=_[_0xf54e('0x36')](_0x16d00f[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x2f96b1[_0xf54e('0x33')]['fields']));_0x2ec92e['attributes']=_0x2ec92e['attributes'][_0xf54e('0x38')]?_0x2ec92e[_0xf54e('0x35')]:_0x16d00f['model'];if(!_0x2f96b1['query'][_0xf54e('0x39')](_0xf54e('0x3a'))){_0x2ec92e[_0xf54e('0x1d')]=qs['limit'](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x1d')]);_0x2ec92e['offset']=qs[_0xf54e('0x20')](_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x20')]);}_0x2ec92e[_0xf54e('0x3b')]=qs[_0xf54e('0x3c')](_0x2f96b1[_0xf54e('0x33')]['sort']);_0x2ec92e['where']=qs[_0xf54e('0x3d')](_[_0xf54e('0x3e')](_0x2f96b1[_0xf54e('0x33')],_0x16d00f['filters']),_0x133cd7);if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]){_0x2ec92e[_0xf54e('0x40')]=_[_0xf54e('0x41')](_0x2ec92e[_0xf54e('0x40')],{'$or':_[_0xf54e('0x2e')](_0x133cd7,function(_0x17c7ec){if(_0x17c7ec[_0xf54e('0x42')]!==_0xf54e('0x43')){var _0x2087b3={};_0x2087b3[_0x17c7ec[_0xf54e('0x2d')]]={'$like':'%'+_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x3f')]+'%'};return _0x2087b3;}})});}_0x2ec92e=_[_0xf54e('0x41')]({},_0x2ec92e,_0x2f96b1[_0xf54e('0x44')]);var _0x5085c1={'where':_0x2ec92e['where']};return db['VoiceChanSpy'][_0xf54e('0x1f')](_0x5085c1)[_0xf54e('0x26')](function(_0x5398b2){_0xb2d4c4[_0xf54e('0x1f')]=_0x5398b2;if(_0x2f96b1[_0xf54e('0x33')][_0xf54e('0x45')]){_0x2ec92e['include']=[{'all':!![]}];}return db[_0xf54e('0x2f')][_0xf54e('0x46')](_0x2ec92e);})[_0xf54e('0x26')](function(_0x794be7){_0xb2d4c4[_0xf54e('0x47')]=_0x794be7;return _0xb2d4c4;})[_0xf54e('0x26')](respondWithFilteredResult(_0x258d29,_0x2ec92e))[_0xf54e('0x48')](handleError(_0x258d29,null));};exports[_0xf54e('0x49')]=function(_0x5b4ea1,_0x47bedd){var _0x11c736={'raw':![],'where':{'id':_0x5b4ea1[_0xf54e('0x4a')]['id']}},_0x3447fd={};_0x3447fd[_0xf54e('0x32')]=_[_0xf54e('0x34')](db[_0xf54e('0x2f')]['rawAttributes']);_0x3447fd[_0xf54e('0x33')]=_['keys'](_0x5b4ea1[_0xf54e('0x33')]);_0x3447fd['filters']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],_0x3447fd[_0xf54e('0x33')]);_0x11c736['attributes']=_[_0xf54e('0x36')](_0x3447fd[_0xf54e('0x32')],qs[_0xf54e('0x37')](_0x5b4ea1[_0xf54e('0x33')][_0xf54e('0x37')]));_0x11c736['attributes']=_0x11c736[_0xf54e('0x35')][_0xf54e('0x38')]?_0x11c736[_0xf54e('0x35')]:_0x3447fd[_0xf54e('0x32')];if(_0x5b4ea1['query'][_0xf54e('0x45')]){_0x11c736[_0xf54e('0x4b')]=[{'all':!![]}];}_0x11c736=_['merge']({},_0x11c736,_0x5b4ea1[_0xf54e('0x44')]);return db[_0xf54e('0x2f')][_0xf54e('0x4c')](_0x11c736)[_0xf54e('0x26')](handleEntityNotFound(_0x47bedd,null))['then'](respondWithResult(_0x47bedd,null))[_0xf54e('0x48')](handleError(_0x47bedd,null));};exports[_0xf54e('0x4d')]=function(_0x2527f6,_0xb4654f){return db[_0xf54e('0x2f')][_0xf54e('0x4d')](_0x2527f6[_0xf54e('0x4e')],{})[_0xf54e('0x26')](function(_0x15bfef){var _0x21f2f8=_0x2527f6[_0xf54e('0x4f')][_0xf54e('0x28')]({'plain':!![]});if(!_0x21f2f8)throw new Error(_0xf54e('0x50'));if(_0x21f2f8[_0xf54e('0x51')]===_0xf54e('0x4f')){var _0xa6c305=_0x15bfef[_0xf54e('0x28')]({'plain':!![]});var _0xe9338b=_0xf54e('0x29');return db[_0xf54e('0x52')]['find']({'where':{'name':_0xe9338b,'userProfileId':_0x21f2f8['userProfileId']},'raw':!![]})[_0xf54e('0x26')](function(_0x1106bb){if(_0x1106bb&&_0x1106bb[_0xf54e('0x53')]===0x0){return db[_0xf54e('0x2a')][_0xf54e('0x4d')]({'name':_0xa6c305[_0xf54e('0x2d')],'resourceId':_0xa6c305['id'],'type':_0x1106bb[_0xf54e('0x2d')],'sectionId':_0x1106bb['id']},{})[_0xf54e('0x26')](function(){return _0x15bfef;});}else{return _0x15bfef;}})[_0xf54e('0x48')](function(_0xdf63c4){logger[_0xf54e('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xdf63c4);throw _0xdf63c4;});}return _0x15bfef;})[_0xf54e('0x26')](respondWithResult(_0xb4654f,0xc9))[_0xf54e('0x48')](handleError(_0xb4654f,null));};exports[_0xf54e('0x25')]=function(_0x37e4f8,_0x1b8f16){if(_0x37e4f8[_0xf54e('0x4e')]['id']){delete _0x37e4f8[_0xf54e('0x4e')]['id'];}return db['VoiceChanSpy'][_0xf54e('0x4c')]({'where':{'id':_0x37e4f8[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x1b8f16,null))['then'](saveUpdates(_0x37e4f8[_0xf54e('0x4e')],null))['then'](respondWithResult(_0x1b8f16,null))[_0xf54e('0x48')](handleError(_0x1b8f16,null));};exports[_0xf54e('0x27')]=function(_0x3e2fd1,_0x5b882f){return db[_0xf54e('0x2f')][_0xf54e('0x4c')]({'where':{'id':_0x3e2fd1[_0xf54e('0x4a')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0x5b882f,null))[_0xf54e('0x26')](removeEntity(_0x5b882f,null))[_0xf54e('0x48')](handleError(_0x5b882f,null));};
\ No newline at end of file
index 1fcb15e..b8e114e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe22b=['push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','name','options','join','concat','internal','findAll','agent','exports','models','define','VoiceChanSpy','voice_chanspy','then','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0xe22b,0xfb));var _0xbe22=function(_0x59feb9,_0x231d10){_0x59feb9=_0x59feb9-0x0;var _0x349640=_0xe22b[_0x59feb9];return _0x349640;};'use strict';var _=require(_0xbe22('0x0'));var util=require('util');var BPromise=require(_0xbe22('0x1'));var attributes=require(_0xbe22('0x2'));var getUserApplications=function(_0x43a8cf,_0xa9511a,_0x558faa){var _0x32cff2=0x1;var _0xbb8eaa=[];var _0x2ff011={'context':_0xa9511a[_0xbe22('0x3')]||_0xbe22('0x4'),'exten':util[_0xbe22('0x5')]('%s%s',_0x43a8cf[_0xbe22('0x6')],_0x558faa),'type':_0xbe22('0x7'),'isApp':![],'ChanSpyId':_0x43a8cf['id'],'UserId':_0xa9511a['id']};_0xbb8eaa[_0xbe22('0x8')](_[_0xbe22('0x9')]({'app':_0xbe22('0xa'),'appdata':util['format']('CDR(type)=%s',_0xbe22('0xb')),'priority':_0x32cff2++},_0x2ff011));if(_0x43a8cf[_0xbe22('0xc')]){_0xbb8eaa[_0xbe22('0x8')](_[_0xbe22('0x9')]({'app':_0xbe22('0xd'),'appdata':util[_0xbe22('0x5')](_0xbe22('0xe'),_0x43a8cf[_0xbe22('0xf')]),'priority':_0x32cff2++},_0x2ff011));}if(_0x43a8cf[_0xbe22('0x10')]){_0xbb8eaa[_0xbe22('0x8')](_['merge']({'app':'Authenticate','appdata':_0x43a8cf[_0xbe22('0x11')],'priority':_0x32cff2++},_0x2ff011));}_0xbb8eaa[_0xbe22('0x8')](_[_0xbe22('0x9')]({'app':_0xbe22('0x12'),'appdata':util[_0xbe22('0x5')](_0xbe22('0x13'),_0xa9511a[_0xbe22('0x14')],_0x43a8cf[_0xbe22('0x15')]?_0x43a8cf['options'][_0xbe22('0x16')](''):''),'priority':_0x32cff2++},_0x2ff011));if(_0x43a8cf[_0xbe22('0xc')]){_0xbb8eaa[_0xbe22('0x8')](_['merge']({'app':'StopMixMonitor','priority':_0x32cff2++},_0x2ff011));}return _0xbb8eaa;};var getChanSpyApplications=function(_0x4cc52c,_0x12a3ea){var _0x46c041=[];for(var _0x5eeb10=0x0,_0x3efb46=0x1;_0x5eeb10<_0x12a3ea['length'];_0x5eeb10++,_0x3efb46=0x1){_0x46c041=_0x46c041[_0xbe22('0x17')](getUserApplications(_0x4cc52c,_0x12a3ea[_0x5eeb10],_0x12a3ea[_0x5eeb10][_0xbe22('0x18')]));if(_0x12a3ea[_0x5eeb10][_0xbe22('0x18')]!=_0x12a3ea[_0x5eeb10][_0xbe22('0x14')]){_0x46c041=_0x46c041[_0xbe22('0x17')](getUserApplications(_0x4cc52c,_0x12a3ea[_0x5eeb10],_0x12a3ea[_0x5eeb10][_0xbe22('0x14')]));}}return _0x46c041;};var getChanSpyPromise=function(_0x3b972a,_0x208334){return new BPromise(function(_0x905038,_0x4cd2b6){return _0x3b972a['User'][_0xbe22('0x19')]({'attributes':['id','name',_0xbe22('0x18')],'where':{'role':_0xbe22('0x1a'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1f297c){if(_0x1f297c){return _0x905038(getChanSpyApplications(_0x208334,_0x1f297c));}return _0x905038([]);})['catch'](function(_0x371d21){_0x4cd2b6(_0x371d21);});});};module[_0xbe22('0x1b')]=function(_0x228b3a,_0x4b0ea3){var _0x31be6c=_0x228b3a[_0xbe22('0x1c')];return _0x228b3a[_0xbe22('0x1d')](_0xbe22('0x1e'),attributes,{'tableName':_0xbe22('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3eb382,_0x5bd7e7,_0xc925b0){return getChanSpyPromise(_0x31be6c,_0x3eb382)[_0xbe22('0x20')](function(_0x4dd26e){if(_0x4dd26e&&_0x4dd26e['length']){return _0x31be6c[_0xbe22('0x21')][_0xbe22('0x22')](_0x4dd26e);}})[_0xbe22('0x20')](function(){_0xc925b0();})[_0xbe22('0x23')](function(_0x26e9a4){_0xc925b0(_0x26e9a4);});},'afterUpdate':function(_0x4c48d2,_0x26551d,_0x251249){return _0x31be6c[_0xbe22('0x21')][_0xbe22('0x24')]({'where':{'ChanSpyId':_0x4c48d2['id']}})[_0xbe22('0x20')](function(){return getChanSpyPromise(_0x31be6c,_0x4c48d2);})[_0xbe22('0x20')](function(_0x39f63d){if(_0x39f63d&&_0x39f63d['length']){return _0x31be6c[_0xbe22('0x21')][_0xbe22('0x22')](_0x39f63d);}})[_0xbe22('0x20')](function(){_0x251249();})[_0xbe22('0x23')](function(_0x5eedf4){_0x251249(_0x5eedf4);});},'afterDestroy':function(_0xc4cb78,_0x4b9362,_0xc64ece){return _0x31be6c[_0xbe22('0x21')][_0xbe22('0x24')]({'where':{'ChanSpyId':_0xc4cb78['id']}})[_0xbe22('0x20')](function(){_0xc64ece();})[_0xbe22('0x23')](function(_0x5c8453){_0xc64ece(_0x5c8453);});}}});};
\ No newline at end of file
+var _0x7067=['./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','merge','Set','format','CDR(type)=%s','chanspy','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','password','push','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7067,0x126));var _0x7706=function(_0x4779bd,_0x28dc8f){_0x4779bd=_0x4779bd-0x0;var _0x26177a=_0x7067[_0x4779bd];return _0x26177a;};'use strict';var _=require(_0x7706('0x0'));var util=require(_0x7706('0x1'));var BPromise=require('bluebird');var attributes=require(_0x7706('0x2'));var getUserApplications=function(_0x56516d,_0x30407e,_0x4740c2){var _0x140db1=0x1;var _0x43972c=[];var _0x204388={'context':_0x30407e['context']||_0x7706('0x3'),'exten':util['format'](_0x7706('0x4'),_0x56516d[_0x7706('0x5')],_0x4740c2),'type':_0x7706('0x6'),'isApp':![],'ChanSpyId':_0x56516d['id'],'UserId':_0x30407e['id']};_0x43972c['push'](_[_0x7706('0x7')]({'app':_0x7706('0x8'),'appdata':util[_0x7706('0x9')](_0x7706('0xa'),_0x7706('0xb')),'priority':_0x140db1++},_0x204388));if(_0x56516d['record']){_0x43972c['push'](_[_0x7706('0x7')]({'app':_0x7706('0xc'),'appdata':util[_0x7706('0x9')](_0x7706('0xd'),_0x56516d[_0x7706('0xe')]),'priority':_0x140db1++},_0x204388));}if(_0x56516d[_0x7706('0xf')]){_0x43972c['push'](_[_0x7706('0x7')]({'app':'Authenticate','appdata':_0x56516d[_0x7706('0x10')],'priority':_0x140db1++},_0x204388));}_0x43972c[_0x7706('0x11')](_['merge']({'app':'ChanSpy','appdata':util[_0x7706('0x9')](_0x7706('0x12'),_0x30407e[_0x7706('0x13')],_0x56516d[_0x7706('0x14')]?_0x56516d['options'][_0x7706('0x15')](''):''),'priority':_0x140db1++},_0x204388));if(_0x56516d['record']){_0x43972c[_0x7706('0x11')](_['merge']({'app':_0x7706('0x16'),'priority':_0x140db1++},_0x204388));}return _0x43972c;};var getChanSpyApplications=function(_0x5b6d9d,_0x57420b){var _0x564f57=[];for(var _0x302490=0x0,_0xe96048=0x1;_0x302490<_0x57420b[_0x7706('0x17')];_0x302490++,_0xe96048=0x1){_0x564f57=_0x564f57[_0x7706('0x18')](getUserApplications(_0x5b6d9d,_0x57420b[_0x302490],_0x57420b[_0x302490][_0x7706('0x19')]));if(_0x57420b[_0x302490][_0x7706('0x19')]!=_0x57420b[_0x302490][_0x7706('0x13')]){_0x564f57=_0x564f57[_0x7706('0x18')](getUserApplications(_0x5b6d9d,_0x57420b[_0x302490],_0x57420b[_0x302490]['name']));}}return _0x564f57;};var getChanSpyPromise=function(_0x1d93c6,_0x314e6b){return new BPromise(function(_0x1d879e,_0x3e028b){return _0x1d93c6[_0x7706('0x1a')]['findAll']({'attributes':['id','name','internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x7706('0x1b')](function(_0x584bed){if(_0x584bed){return _0x1d879e(getChanSpyApplications(_0x314e6b,_0x584bed));}return _0x1d879e([]);})[_0x7706('0x1c')](function(_0x4df2ef){_0x3e028b(_0x4df2ef);});});};module[_0x7706('0x1d')]=function(_0x43ee76,_0x38b4bd){var _0x5279ae=_0x43ee76[_0x7706('0x1e')];return _0x43ee76[_0x7706('0x1f')](_0x7706('0x20'),attributes,{'tableName':_0x7706('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f6878,_0x1fec67,_0x26a9a2){return getChanSpyPromise(_0x5279ae,_0x3f6878)[_0x7706('0x1b')](function(_0x17cf49){if(_0x17cf49&&_0x17cf49['length']){return _0x5279ae[_0x7706('0x22')]['bulkCreate'](_0x17cf49);}})[_0x7706('0x1b')](function(){_0x26a9a2();})[_0x7706('0x1c')](function(_0x531669){_0x26a9a2(_0x531669);});},'afterUpdate':function(_0xc28f5c,_0x4a6f07,_0xc2048a){return _0x5279ae[_0x7706('0x22')][_0x7706('0x23')]({'where':{'ChanSpyId':_0xc28f5c['id']}})['then'](function(){return getChanSpyPromise(_0x5279ae,_0xc28f5c);})[_0x7706('0x1b')](function(_0x42ae07){if(_0x42ae07&&_0x42ae07[_0x7706('0x17')]){return _0x5279ae[_0x7706('0x22')][_0x7706('0x24')](_0x42ae07);}})['then'](function(){_0xc2048a();})[_0x7706('0x1c')](function(_0x4de91b){_0xc2048a(_0x4de91b);});},'afterDestroy':function(_0x28f343,_0x99d14c,_0x34cbf4){return _0x5279ae['VoiceExtension'][_0x7706('0x23')]({'where':{'ChanSpyId':_0x28f343['id']}})[_0x7706('0x1b')](function(){_0x34cbf4();})[_0x7706('0x1c')](function(_0x7d4a69){_0x34cbf4(_0x7d4a69);});}}});};
\ No newline at end of file
index ab86c29..b4bcf4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec6=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x109e4c,_0x3e115e){var _0x5e8570=function(_0xf3c7c){while(--_0xf3c7c){_0x109e4c['push'](_0x109e4c['shift']());}};_0x5e8570(++_0x3e115e);}(_0x5ec6,0x7f));var _0x65ec=function(_0x3417b9,_0x4ca728){_0x3417b9=_0x3417b9-0x0;var _0x3494a9=_0x5ec6[_0x3417b9];return _0x3494a9;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d6254,_0xb3600b,_0x266254){return new BPromise(function(_0x4f8653,_0x28aa8f){return client[_0x65ec('0x9')](_0x5d6254,_0x266254)[_0x65ec('0xa')](function(_0x50e5c4){logger['info'](_0x65ec('0xb'),_0xb3600b,'request\x20sent');logger[_0x65ec('0xc')](_0x65ec('0xd'),_0xb3600b,'request\x20sent',JSON[_0x65ec('0xe')](_0x50e5c4));if(_0x50e5c4[_0x65ec('0xf')]){if(_0x50e5c4['error'][_0x65ec('0x10')]===0x1f4){logger[_0x65ec('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x28aa8f(_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);}logger[_0x65ec('0xf')](_0x65ec('0xb'),_0xb3600b,_0x50e5c4[_0x65ec('0xf')][_0x65ec('0x11')]);return _0x4f8653(_0x50e5c4['error'][_0x65ec('0x11')]);}else{logger[_0x65ec('0x12')](_0x65ec('0xb'),_0xb3600b,'request\x20sent');_0x4f8653(_0x50e5c4['result'][_0x65ec('0x11')]);}})[_0x65ec('0x13')](function(_0xa597d4){logger['error'](_0x65ec('0xb'),_0xb3600b,_0xa597d4);_0x28aa8f(_0xa597d4);});});}
\ No newline at end of file
+var _0x6a24=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x411b75,_0x4de4ca){var _0x5a9239=function(_0x1c600f){while(--_0x1c600f){_0x411b75['push'](_0x411b75['shift']());}};_0x5a9239(++_0x4de4ca);}(_0x6a24,0xd1));var _0x46a2=function(_0x273e59,_0x296d28){_0x273e59=_0x273e59-0x0;var _0x5579d5=_0x6a24[_0x273e59];return _0x5579d5;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var moment=require('moment');var BPromise=require(_0x46a2('0x2'));var rs=require(_0x46a2('0x3'));var fs=require('fs');var Redis=require(_0x46a2('0x4'));var db=require(_0x46a2('0x5'))['db'];var utils=require(_0x46a2('0x6'));var logger=require('../../config/logger')(_0x46a2('0x7'));var config=require(_0x46a2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x46a2('0x9')][_0x46a2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506698,_0x49870f,_0x2092f3){return new BPromise(function(_0x321b88,_0x587092){return client[_0x46a2('0xb')](_0x506698,_0x2092f3)['then'](function(_0x395578){logger['info'](_0x46a2('0xc'),_0x49870f,_0x46a2('0xd'));logger[_0x46a2('0xe')](_0x46a2('0xf'),_0x49870f,_0x46a2('0xd'),JSON[_0x46a2('0x10')](_0x395578));if(_0x395578[_0x46a2('0x11')]){if(_0x395578[_0x46a2('0x11')]['code']===0x1f4){logger['error'](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')]['message']);return _0x587092(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}logger[_0x46a2('0x11')](_0x46a2('0xc'),_0x49870f,_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);return _0x321b88(_0x395578[_0x46a2('0x11')][_0x46a2('0x12')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x49870f,_0x46a2('0xd'));_0x321b88(_0x395578[_0x46a2('0x13')]['message']);}})[_0x46a2('0x14')](function(_0x2d755b){logger['error'](_0x46a2('0xc'),_0x49870f,_0x2d755b);_0x587092(_0x2d755b);});});}
\ No newline at end of file
index a9bcf17..b380367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaab0=['./voiceContext.controller','get','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xaab0,0x73));var _0x0aab=function(_0x4382bc,_0x231a2d){_0x4382bc=_0x4382bc-0x0;var _0x13c82a=_0xaab0[_0x4382bc];return _0x13c82a;};'use strict';var multer=require('multer');var util=require(_0x0aab('0x0'));var path=require(_0x0aab('0x1'));var timeout=require(_0x0aab('0x2'));var express=require(_0x0aab('0x3'));var router=express['Router']();var fs_extra=require(_0x0aab('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0aab('0x5'));router[_0x0aab('0x6')]('/',auth[_0x0aab('0x7')](),controller['index']);router[_0x0aab('0x6')]('/:id',auth[_0x0aab('0x7')](),controller['show']);router['post']('/',auth[_0x0aab('0x7')](),controller[_0x0aab('0x8')]);router[_0x0aab('0x9')](_0x0aab('0xa'),auth[_0x0aab('0x7')](),controller[_0x0aab('0xb')]);router[_0x0aab('0xc')]('/:id',auth[_0x0aab('0x7')](),controller[_0x0aab('0xd')]);module[_0x0aab('0xe')]=router;
\ No newline at end of file
+var _0x8a87=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','post','isAuthenticated','put'];(function(_0xfa92d,_0x5109a8){var _0x3f9ce6=function(_0x286901){while(--_0x286901){_0xfa92d['push'](_0xfa92d['shift']());}};_0x3f9ce6(++_0x5109a8);}(_0x8a87,0x17e));var _0x78a8=function(_0x3032e2,_0x26a4e8){_0x3032e2=_0x3032e2-0x0;var _0x427aef=_0x8a87[_0x3032e2];return _0x427aef;};'use strict';var multer=require(_0x78a8('0x0'));var util=require(_0x78a8('0x1'));var path=require(_0x78a8('0x2'));var timeout=require(_0x78a8('0x3'));var express=require(_0x78a8('0x4'));var router=express[_0x78a8('0x5')]();var fs_extra=require(_0x78a8('0x6'));var auth=require(_0x78a8('0x7'));var interaction=require(_0x78a8('0x8'));var config=require(_0x78a8('0x9'));var controller=require(_0x78a8('0xa'));router[_0x78a8('0xb')]('/',auth['isAuthenticated'](),controller[_0x78a8('0xc')]);router['get'](_0x78a8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x78a8('0xe')]('/',auth[_0x78a8('0xf')](),controller['create']);router[_0x78a8('0x10')]('/:id',auth[_0x78a8('0xf')](),controller[_0x78a8('0x11')]);router[_0x78a8('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 80050d5..299bc79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d42=['sequelize','exports','name','BOOLEAN'];(function(_0x1eaf8b,_0x1ba61f){var _0x1417a8=function(_0x463bed){while(--_0x463bed){_0x1eaf8b['push'](_0x1eaf8b['shift']());}};_0x1417a8(++_0x1ba61f);}(_0x6d42,0xd8));var _0x26d4=function(_0x2d0a60,_0x3322f3){_0x2d0a60=_0x2d0a60-0x0;var _0x26ec4d=_0x6d42[_0x2d0a60];return _0x26ec4d;};'use strict';var Sequelize=require(_0x26d4('0x0'));module[_0x26d4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x26d4('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x26d4('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x4bca=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x469fcf,_0x47838e){var _0x5007e2=function(_0x4a2823){while(--_0x4a2823){_0x469fcf['push'](_0x469fcf['shift']());}};_0x5007e2(++_0x47838e);}(_0x4bca,0xb3));var _0xa4bc=function(_0xee3df5,_0x5405ca){_0xee3df5=_0xee3df5-0x0;var _0x5ed156=_0x4bca[_0xee3df5];return _0x5ed156;};'use strict';var Sequelize=require(_0xa4bc('0x0'));module[_0xa4bc('0x1')]={'name':{'type':Sequelize[_0xa4bc('0x2')],'unique':_0xa4bc('0x3')},'description':{'type':Sequelize[_0xa4bc('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa4bc('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 310b990..0ec94b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac13=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','end','stack','name','send','index','map','VoiceContext','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','findAll','rows','show','rawAttributes','include','find','create','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','squel'];(function(_0x4145af,_0x291a29){var _0x5dce84=function(_0xbfcdc0){while(--_0xbfcdc0){_0x4145af['push'](_0x4145af['shift']());}};_0x5dce84(++_0x291a29);}(_0xac13,0x18f));var _0x3ac1=function(_0x21f70b,_0x47501e){_0x21f70b=_0x21f70b-0x0;var _0x153b64=_0xac13[_0x21f70b];return _0x153b64;};'use strict';var emlformat=require(_0x3ac1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ac1('0x1'));var rp=require(_0x3ac1('0x2'));var moment=require(_0x3ac1('0x3'));var BPromise=require(_0x3ac1('0x4'));var Mustache=require(_0x3ac1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3ac1('0x6'));var ejs=require(_0x3ac1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3ac1('0x8'));var crypto=require(_0x3ac1('0x9'));var jsforce=require(_0x3ac1('0xa'));var deskjs=require(_0x3ac1('0xb'));var toCsv=require(_0x3ac1('0x6'));var querystring=require(_0x3ac1('0xc'));var Papa=require(_0x3ac1('0xd'));var Redis=require(_0x3ac1('0xe'));var authService=require(_0x3ac1('0xf'));var qs=require(_0x3ac1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3ac1('0x11'));var logger=require(_0x3ac1('0x12'))('api');var utils=require(_0x3ac1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3ac1('0x14'));var db=require(_0x3ac1('0x15'))['db'];var jayson=require(_0x3ac1('0x16'));var client=jayson[_0x3ac1('0x17')][_0x3ac1('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x4c2ed1,_0x430ac7,_0x5b53c5,_0x1db5d6){return new BPromise(function(_0x12dbd1,_0x49476f){var _0x91159c=_0x1db5d6||client;return _0x91159c['request'](_0x4c2ed1,_0x5b53c5)[_0x3ac1('0x19')](function(_0x5ddabf){logger[_0x3ac1('0x1a')](_0x3ac1('0x1b'),_0x430ac7,_0x3ac1('0x1c'));logger[_0x3ac1('0x1d')](_0x3ac1('0x1e'),_0x430ac7,_0x3ac1('0x1c'),JSON[_0x3ac1('0x1f')](_0x5ddabf));if(_0x5ddabf[_0x3ac1('0x20')]){if(_0x5ddabf[_0x3ac1('0x20')]['code']===0x1f4){logger[_0x3ac1('0x20')](_0x3ac1('0x1b'),_0x430ac7,_0x5ddabf[_0x3ac1('0x20')][_0x3ac1('0x21')]);return _0x49476f(_0x5ddabf['error'][_0x3ac1('0x21')]);}logger[_0x3ac1('0x20')](_0x3ac1('0x1b'),_0x430ac7,_0x5ddabf['error'][_0x3ac1('0x21')]);return _0x12dbd1(_0x5ddabf[_0x3ac1('0x20')][_0x3ac1('0x21')]);}else{logger[_0x3ac1('0x1a')](_0x3ac1('0x1b'),_0x430ac7,'request\x20sent');_0x12dbd1(_0x5ddabf['result'][_0x3ac1('0x21')]);}})[_0x3ac1('0x22')](function(_0x2774eb){logger[_0x3ac1('0x20')](_0x3ac1('0x1b'),_0x430ac7,_0x2774eb);_0x49476f(_0x2774eb);});});}function respondWithStatusCode(_0x3ebacc,_0x16ba04){_0x16ba04=_0x16ba04||0xcc;return function(_0x21a573){if(_0x21a573){return _0x3ebacc[_0x3ac1('0x23')](_0x16ba04);}return _0x3ebacc[_0x3ac1('0x24')](_0x16ba04)['end']();};}function respondWithResult(_0x46d0ad,_0x3e5bbf){_0x3e5bbf=_0x3e5bbf||0xc8;return function(_0x1b950e){if(_0x1b950e){return _0x46d0ad[_0x3ac1('0x24')](_0x3e5bbf)['json'](_0x1b950e);}};}function respondWithFilteredResult(_0x28e027,_0x1b8990){return function(_0xecef70){if(_0xecef70){var _0x98385d=typeof _0x1b8990[_0x3ac1('0x25')]==='undefined'&&typeof _0x1b8990[_0x3ac1('0x26')]===_0x3ac1('0x27');var _0x401a7f=_0xecef70[_0x3ac1('0x28')];var _0x278954=_0x98385d?0x0:_0x1b8990[_0x3ac1('0x25')];var _0x1b2509=_0x98385d?_0xecef70[_0x3ac1('0x28')]:_0x1b8990['offset']+_0x1b8990[_0x3ac1('0x26')];var _0x325968;if(_0x1b2509>=_0x401a7f){_0x1b2509=_0x401a7f;_0x325968=0xc8;}else{_0x325968=0xce;}_0x28e027[_0x3ac1('0x24')](_0x325968);return _0x28e027['set'](_0x3ac1('0x29'),_0x278954+'-'+_0x1b2509+'/'+_0x401a7f)[_0x3ac1('0x2a')](_0xecef70);}return null;};}function patchUpdates(_0x10e26c){return function(_0x969119){try{jsonpatch[_0x3ac1('0x2b')](_0x969119,_0x10e26c,!![]);}catch(_0x50a96b){return BPromise[_0x3ac1('0x2c')](_0x50a96b);}return _0x969119[_0x3ac1('0x2d')]();};}function saveUpdates(_0x1c5625,_0x12823c){return function(_0x21c120){if(_0x21c120){return _0x21c120[_0x3ac1('0x2e')](_0x1c5625)[_0x3ac1('0x19')](function(_0x4af40c){return _0x4af40c;});}return null;};}function removeEntity(_0x200bb6,_0x5c02bb){return function(_0x4053e7){if(_0x4053e7){return _0x4053e7[_0x3ac1('0x2f')]()[_0x3ac1('0x19')](function(){var _0x4dd08d=_0x4053e7[_0x3ac1('0x30')]({'plain':!![]});var _0x8d36e8=_0x3ac1('0x31');return db['UserProfileResource'][_0x3ac1('0x2f')]({'where':{'type':_0x8d36e8,'resourceId':_0x4dd08d['id']}})[_0x3ac1('0x19')](function(){return _0x4053e7;});})['then'](function(){_0x200bb6['status'](0xcc)[_0x3ac1('0x32')]();});}};}function handleEntityNotFound(_0x1812c0,_0x36c8cf){return function(_0x507d59){if(!_0x507d59){_0x1812c0[_0x3ac1('0x23')](0x194);}return _0x507d59;};}function handleError(_0x2c7ea0,_0x2189a5){_0x2189a5=_0x2189a5||0x1f4;return function(_0x6216fe){logger['error'](_0x6216fe[_0x3ac1('0x33')]);if(_0x6216fe[_0x3ac1('0x34')]){delete _0x6216fe['name'];}_0x2c7ea0[_0x3ac1('0x24')](_0x2189a5)[_0x3ac1('0x35')](_0x6216fe);};}exports[_0x3ac1('0x36')]=function(_0xd8d5e4,_0x3f6f52){var _0x4e96d4={},_0x28a374={},_0x3ffb0d={'count':0x0,'rows':[]};var _0x444ceb=_[_0x3ac1('0x37')](db[_0x3ac1('0x38')]['rawAttributes'],function(_0x576a40){return{'name':_0x576a40[_0x3ac1('0x39')],'type':_0x576a40['type'][_0x3ac1('0x3a')]};});_0x28a374[_0x3ac1('0x3b')]=_[_0x3ac1('0x37')](_0x444ceb,_0x3ac1('0x34'));_0x28a374['query']=_[_0x3ac1('0x3c')](_0xd8d5e4['query']);_0x28a374[_0x3ac1('0x3d')]=_[_0x3ac1('0x3e')](_0x28a374['model'],_0x28a374[_0x3ac1('0x3f')]);_0x4e96d4['attributes']=_[_0x3ac1('0x3e')](_0x28a374[_0x3ac1('0x3b')],qs[_0x3ac1('0x40')](_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x40')]));_0x4e96d4[_0x3ac1('0x41')]=_0x4e96d4[_0x3ac1('0x41')][_0x3ac1('0x42')]?_0x4e96d4[_0x3ac1('0x41')]:_0x28a374['model'];if(!_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x43')](_0x3ac1('0x44'))){_0x4e96d4[_0x3ac1('0x26')]=qs[_0x3ac1('0x26')](_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x26')]);_0x4e96d4[_0x3ac1('0x25')]=qs[_0x3ac1('0x25')](_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x25')]);}_0x4e96d4[_0x3ac1('0x45')]=qs[_0x3ac1('0x46')](_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x46')]);_0x4e96d4[_0x3ac1('0x47')]=qs[_0x3ac1('0x3d')](_['pick'](_0xd8d5e4['query'],_0x28a374[_0x3ac1('0x3d')]),_0x444ceb);if(_0xd8d5e4['query'][_0x3ac1('0x48')]){_0x4e96d4['where']=_[_0x3ac1('0x49')](_0x4e96d4[_0x3ac1('0x47')],{'$or':_['map'](_0x444ceb,function(_0x5d91a7){if(_0x5d91a7[_0x3ac1('0x4a')]!==_0x3ac1('0x4b')){var _0x4bc2b7={};_0x4bc2b7[_0x5d91a7[_0x3ac1('0x34')]]={'$like':'%'+_0xd8d5e4[_0x3ac1('0x3f')][_0x3ac1('0x48')]+'%'};return _0x4bc2b7;}})});}_0x4e96d4=_[_0x3ac1('0x49')]({},_0x4e96d4,_0xd8d5e4['options']);var _0x3bd967={'where':_0x4e96d4['where']};return db[_0x3ac1('0x38')][_0x3ac1('0x28')](_0x3bd967)[_0x3ac1('0x19')](function(_0x4f1d9e){_0x3ffb0d[_0x3ac1('0x28')]=_0x4f1d9e;if(_0xd8d5e4['query']['includeAll']){_0x4e96d4['include']=[{'all':!![]}];}return db[_0x3ac1('0x38')][_0x3ac1('0x4c')](_0x4e96d4);})[_0x3ac1('0x19')](function(_0x59b1b1){_0x3ffb0d[_0x3ac1('0x4d')]=_0x59b1b1;return _0x3ffb0d;})[_0x3ac1('0x19')](respondWithFilteredResult(_0x3f6f52,_0x4e96d4))['catch'](handleError(_0x3f6f52,null));};exports[_0x3ac1('0x4e')]=function(_0x2a592d,_0x2de36b){var _0x30cd8e={'raw':![],'where':{'id':_0x2a592d['params']['id']}},_0x18aa21={};_0x18aa21[_0x3ac1('0x3b')]=_[_0x3ac1('0x3c')](db[_0x3ac1('0x38')][_0x3ac1('0x4f')]);_0x18aa21['query']=_[_0x3ac1('0x3c')](_0x2a592d[_0x3ac1('0x3f')]);_0x18aa21[_0x3ac1('0x3d')]=_['intersection'](_0x18aa21['model'],_0x18aa21[_0x3ac1('0x3f')]);_0x30cd8e[_0x3ac1('0x41')]=_[_0x3ac1('0x3e')](_0x18aa21[_0x3ac1('0x3b')],qs['fields'](_0x2a592d[_0x3ac1('0x3f')][_0x3ac1('0x40')]));_0x30cd8e['attributes']=_0x30cd8e[_0x3ac1('0x41')]['length']?_0x30cd8e[_0x3ac1('0x41')]:_0x18aa21[_0x3ac1('0x3b')];if(_0x2a592d[_0x3ac1('0x3f')]['includeAll']){_0x30cd8e[_0x3ac1('0x50')]=[{'all':!![]}];}_0x30cd8e=_[_0x3ac1('0x49')]({},_0x30cd8e,_0x2a592d['options']);return db[_0x3ac1('0x38')][_0x3ac1('0x51')](_0x30cd8e)['then'](handleEntityNotFound(_0x2de36b,null))[_0x3ac1('0x19')](respondWithResult(_0x2de36b,null))[_0x3ac1('0x22')](handleError(_0x2de36b,null));};exports[_0x3ac1('0x52')]=function(_0x4e9bdb,_0x24250e,_0x2d1cfa){var _0x4d4c79;return db[_0x3ac1('0x38')][_0x3ac1('0x52')](_0x4e9bdb['body'],{'raw':!![]})[_0x3ac1('0x19')](function(_0x3528f8){_0x4d4c79=_0x3528f8;return db['VoiceContext'][_0x3ac1('0x4c')]({'raw':!![]});})[_0x3ac1('0x19')](function(_0x389755){var _0x409e76=fs[_0x3ac1('0x53')](path[_0x3ac1('0x54')](config['root'],_0x3ac1('0x55')),_0x3ac1('0x56'));var _0x280c67=ejs[_0x3ac1('0x57')](_0x409e76,{'contexts':_0x389755||[]});fs[_0x3ac1('0x58')](_0x3ac1('0x59'),_0x280c67);})[_0x3ac1('0x19')](function(){return respondWithRpcPromise(_0x3ac1('0x5a'),_0x3ac1('0x52'),{'module':_0x3ac1('0x5b')});})[_0x3ac1('0x19')](function(){var _0x5a49ec=_0x4e9bdb['user'][_0x3ac1('0x30')]({'plain':!![]});if(!_0x5a49ec)throw new Error(_0x3ac1('0x5c'));if(_0x5a49ec[_0x3ac1('0x5d')]===_0x3ac1('0x5e')){var _0x4d75ae=_0x4d4c79[_0x3ac1('0x30')]({'plain':!![]});return db[_0x3ac1('0x5f')][_0x3ac1('0x51')]({'where':{'name':_0x3ac1('0x31'),'userProfileId':_0x5a49ec[_0x3ac1('0x60')]},'raw':!![]})[_0x3ac1('0x19')](function(_0x26ef5f){if(_0x26ef5f&&_0x26ef5f[_0x3ac1('0x61')]===0x0){return db[_0x3ac1('0x62')][_0x3ac1('0x52')]({'name':_0x4d75ae['name'],'resourceId':_0x4d75ae['id'],'type':_0x26ef5f[_0x3ac1('0x34')],'sectionId':_0x26ef5f['id']},{})['then'](function(){return _0x4d4c79;});}else{return _0x4d4c79;}})[_0x3ac1('0x22')](function(_0x5d1f9a){logger[_0x3ac1('0x20')](_0x3ac1('0x63'),_0x5d1f9a);throw _0x5d1f9a;});}return _0x4d4c79;})[_0x3ac1('0x19')](respondWithResult(_0x24250e,0xc9))[_0x3ac1('0x22')](handleError(_0x24250e,null));};exports[_0x3ac1('0x2e')]=function(_0x50c1a8,_0xc22706,_0x26630a){var _0x4ef857;return db[_0x3ac1('0x38')]['find']({'where':{'id':_0x50c1a8[_0x3ac1('0x64')]['id']}})[_0x3ac1('0x19')](handleEntityNotFound(_0xc22706,null))['then'](saveUpdates(_0x50c1a8[_0x3ac1('0x65')],null))[_0x3ac1('0x19')](function(_0x287aed){if(_0x287aed){_0x4ef857=_0x287aed;return db[_0x3ac1('0x38')][_0x3ac1('0x4c')]({'raw':!![]});}})['then'](function(_0x4f09e6){var _0x4a994e=fs[_0x3ac1('0x53')](path[_0x3ac1('0x54')](config['root'],'server/files/templates/context.ejs'),_0x3ac1('0x56'));var _0x1b7b1a=ejs[_0x3ac1('0x57')](_0x4a994e,{'contexts':_0x4f09e6||[]});fs[_0x3ac1('0x58')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1b7b1a);})['then'](function(){return respondWithRpcPromise('Reload','update',{'module':_0x3ac1('0x5b')});})[_0x3ac1('0x19')](function(){return _0x4ef857;})[_0x3ac1('0x19')](respondWithResult(_0xc22706,null))[_0x3ac1('0x22')](handleError(_0xc22706,null));};exports['destroy']=function(_0x4cd741,_0x4a4f77,_0x26d97d){var _0x48d747;return db[_0x3ac1('0x38')][_0x3ac1('0x51')]({'where':{'id':_0x4cd741['params']['id']}})[_0x3ac1('0x19')](handleEntityNotFound(_0x4a4f77,null))['then'](removeEntity(_0x4a4f77,null))[_0x3ac1('0x19')](function(){return db[_0x3ac1('0x38')][_0x3ac1('0x4c')]({'raw':!![]});})[_0x3ac1('0x19')](function(_0x58bab1){var _0x194e95=fs[_0x3ac1('0x53')](path[_0x3ac1('0x54')](config['root'],_0x3ac1('0x55')),_0x3ac1('0x56'));var _0x28819f=ejs[_0x3ac1('0x57')](_0x194e95,{'contexts':_0x58bab1});fs[_0x3ac1('0x58')](_0x3ac1('0x59'),_0x28819f);return respondWithRpcPromise('Reload',_0x3ac1('0x2f'),{'module':'chan_sip.so'});})['catch'](handleError(_0x4a4f77,null));};
\ No newline at end of file
+var _0xb76f=['jsforce','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','request','then','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','json','reject','save','update','destroy','get','Contexts','UserProfileResource','end','stack','name','send','map','VoiceContext','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','fields','find','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','root','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xb76f,0xba));var _0xfb76=function(_0x4b5492,_0x2ac351){_0x4b5492=_0x4b5492-0x0;var _0x4055c7=_0xb76f[_0x4b5492];return _0x4055c7;};'use strict';var emlformat=require(_0xfb76('0x0'));var rimraf=require(_0xfb76('0x1'));var zipdir=require(_0xfb76('0x2'));var jsonpatch=require(_0xfb76('0x3'));var rp=require(_0xfb76('0x4'));var moment=require(_0xfb76('0x5'));var BPromise=require(_0xfb76('0x6'));var Mustache=require(_0xfb76('0x7'));var util=require(_0xfb76('0x8'));var path=require('path');var sox=require(_0xfb76('0x9'));var csv=require(_0xfb76('0xa'));var ejs=require(_0xfb76('0xb'));var fs=require('fs');var fs_extra=require(_0xfb76('0xc'));var _=require(_0xfb76('0xd'));var squel=require(_0xfb76('0xe'));var crypto=require(_0xfb76('0xf'));var jsforce=require(_0xfb76('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb76('0x11'));var Papa=require(_0xfb76('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb76('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb76('0x14'));var logger=require(_0xfb76('0x15'))(_0xfb76('0x16'));var utils=require('../../config/utils');var config=require(_0xfb76('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb76('0x18'))['db'];var jayson=require(_0xfb76('0x19'));var client=jayson[_0xfb76('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35a102,_0xae316b,_0x2f8f56,_0x2792d3){return new BPromise(function(_0x3450a5,_0x4c5404){var _0x34d1e9=_0x2792d3||client;return _0x34d1e9[_0xfb76('0x1b')](_0x35a102,_0x2f8f56)[_0xfb76('0x1c')](function(_0x3aba39){logger['info'](_0xfb76('0x1d'),_0xae316b,'request\x20sent');logger['debug'](_0xfb76('0x1e'),_0xae316b,_0xfb76('0x1f'),JSON[_0xfb76('0x20')](_0x3aba39));if(_0x3aba39[_0xfb76('0x21')]){if(_0x3aba39['error'][_0xfb76('0x22')]===0x1f4){logger[_0xfb76('0x21')](_0xfb76('0x1d'),_0xae316b,_0x3aba39[_0xfb76('0x21')][_0xfb76('0x23')]);return _0x4c5404(_0x3aba39[_0xfb76('0x21')][_0xfb76('0x23')]);}logger[_0xfb76('0x21')](_0xfb76('0x1d'),_0xae316b,_0x3aba39[_0xfb76('0x21')][_0xfb76('0x23')]);return _0x3450a5(_0x3aba39['error'][_0xfb76('0x23')]);}else{logger['info'](_0xfb76('0x1d'),_0xae316b,_0xfb76('0x1f'));_0x3450a5(_0x3aba39[_0xfb76('0x24')][_0xfb76('0x23')]);}})[_0xfb76('0x25')](function(_0x47d82d){logger[_0xfb76('0x21')](_0xfb76('0x1d'),_0xae316b,_0x47d82d);_0x4c5404(_0x47d82d);});});}function respondWithStatusCode(_0x1288a1,_0x540990){_0x540990=_0x540990||0xcc;return function(_0xd0a192){if(_0xd0a192){return _0x1288a1[_0xfb76('0x26')](_0x540990);}return _0x1288a1[_0xfb76('0x27')](_0x540990)['end']();};}function respondWithResult(_0x37a0bd,_0x160a1f){_0x160a1f=_0x160a1f||0xc8;return function(_0xeef7){if(_0xeef7){return _0x37a0bd[_0xfb76('0x27')](_0x160a1f)['json'](_0xeef7);}};}function respondWithFilteredResult(_0x48a595,_0x124db2){return function(_0x468881){if(_0x468881){var _0xdcaf3a=typeof _0x124db2['offset']===_0xfb76('0x28')&&typeof _0x124db2[_0xfb76('0x29')]===_0xfb76('0x28');var _0x1b44b5=_0x468881[_0xfb76('0x2a')];var _0x24acaa=_0xdcaf3a?0x0:_0x124db2[_0xfb76('0x2b')];var _0x319a9a=_0xdcaf3a?_0x468881[_0xfb76('0x2a')]:_0x124db2[_0xfb76('0x2b')]+_0x124db2['limit'];var _0x5f21eb;if(_0x319a9a>=_0x1b44b5){_0x319a9a=_0x1b44b5;_0x5f21eb=0xc8;}else{_0x5f21eb=0xce;}_0x48a595[_0xfb76('0x27')](_0x5f21eb);return _0x48a595[_0xfb76('0x2c')]('Content-Range',_0x24acaa+'-'+_0x319a9a+'/'+_0x1b44b5)[_0xfb76('0x2d')](_0x468881);}return null;};}function patchUpdates(_0x2e15a4){return function(_0x5ab604){try{jsonpatch['apply'](_0x5ab604,_0x2e15a4,!![]);}catch(_0x408ac5){return BPromise[_0xfb76('0x2e')](_0x408ac5);}return _0x5ab604[_0xfb76('0x2f')]();};}function saveUpdates(_0x20eed2,_0x26d55e){return function(_0x140dd8){if(_0x140dd8){return _0x140dd8[_0xfb76('0x30')](_0x20eed2)[_0xfb76('0x1c')](function(_0x31ced8){return _0x31ced8;});}return null;};}function removeEntity(_0x1700c1,_0x1e1687){return function(_0xa9a069){if(_0xa9a069){return _0xa9a069[_0xfb76('0x31')]()['then'](function(){var _0x2a6882=_0xa9a069[_0xfb76('0x32')]({'plain':!![]});var _0x5b9ac5=_0xfb76('0x33');return db[_0xfb76('0x34')][_0xfb76('0x31')]({'where':{'type':_0x5b9ac5,'resourceId':_0x2a6882['id']}})['then'](function(){return _0xa9a069;});})[_0xfb76('0x1c')](function(){_0x1700c1[_0xfb76('0x27')](0xcc)[_0xfb76('0x35')]();});}};}function handleEntityNotFound(_0xf6ad0a,_0x3fe4e9){return function(_0x169182){if(!_0x169182){_0xf6ad0a[_0xfb76('0x26')](0x194);}return _0x169182;};}function handleError(_0x14e67c,_0x105b20){_0x105b20=_0x105b20||0x1f4;return function(_0x23a197){logger[_0xfb76('0x21')](_0x23a197[_0xfb76('0x36')]);if(_0x23a197['name']){delete _0x23a197[_0xfb76('0x37')];}_0x14e67c[_0xfb76('0x27')](_0x105b20)[_0xfb76('0x38')](_0x23a197);};}exports['index']=function(_0x25df1c,_0xa80cf){var _0x1535aa={},_0x1553db={},_0x5cc82e={'count':0x0,'rows':[]};var _0x77a5b6=_[_0xfb76('0x39')](db[_0xfb76('0x3a')]['rawAttributes'],function(_0x40e5ea){return{'name':_0x40e5ea['fieldName'],'type':_0x40e5ea[_0xfb76('0x3b')][_0xfb76('0x3c')]};});_0x1553db[_0xfb76('0x3d')]=_[_0xfb76('0x39')](_0x77a5b6,'name');_0x1553db[_0xfb76('0x3e')]=_[_0xfb76('0x3f')](_0x25df1c[_0xfb76('0x3e')]);_0x1553db[_0xfb76('0x40')]=_[_0xfb76('0x41')](_0x1553db[_0xfb76('0x3d')],_0x1553db[_0xfb76('0x3e')]);_0x1535aa[_0xfb76('0x42')]=_[_0xfb76('0x41')](_0x1553db['model'],qs['fields'](_0x25df1c['query']['fields']));_0x1535aa[_0xfb76('0x42')]=_0x1535aa[_0xfb76('0x42')][_0xfb76('0x43')]?_0x1535aa[_0xfb76('0x42')]:_0x1553db[_0xfb76('0x3d')];if(!_0x25df1c[_0xfb76('0x3e')]['hasOwnProperty'](_0xfb76('0x44'))){_0x1535aa[_0xfb76('0x29')]=qs[_0xfb76('0x29')](_0x25df1c[_0xfb76('0x3e')][_0xfb76('0x29')]);_0x1535aa[_0xfb76('0x2b')]=qs[_0xfb76('0x2b')](_0x25df1c[_0xfb76('0x3e')][_0xfb76('0x2b')]);}_0x1535aa[_0xfb76('0x45')]=qs[_0xfb76('0x46')](_0x25df1c[_0xfb76('0x3e')][_0xfb76('0x46')]);_0x1535aa[_0xfb76('0x47')]=qs[_0xfb76('0x40')](_['pick'](_0x25df1c[_0xfb76('0x3e')],_0x1553db['filters']),_0x77a5b6);if(_0x25df1c[_0xfb76('0x3e')]['filter']){_0x1535aa[_0xfb76('0x47')]=_[_0xfb76('0x48')](_0x1535aa['where'],{'$or':_['map'](_0x77a5b6,function(_0x1ffd28){if(_0x1ffd28['type']!==_0xfb76('0x49')){var _0xefdd73={};_0xefdd73[_0x1ffd28[_0xfb76('0x37')]]={'$like':'%'+_0x25df1c[_0xfb76('0x3e')][_0xfb76('0x4a')]+'%'};return _0xefdd73;}})});}_0x1535aa=_[_0xfb76('0x48')]({},_0x1535aa,_0x25df1c['options']);var _0x293a82={'where':_0x1535aa[_0xfb76('0x47')]};return db[_0xfb76('0x3a')][_0xfb76('0x2a')](_0x293a82)['then'](function(_0x51c664){_0x5cc82e[_0xfb76('0x2a')]=_0x51c664;if(_0x25df1c[_0xfb76('0x3e')][_0xfb76('0x4b')]){_0x1535aa[_0xfb76('0x4c')]=[{'all':!![]}];}return db['VoiceContext'][_0xfb76('0x4d')](_0x1535aa);})[_0xfb76('0x1c')](function(_0x4f0824){_0x5cc82e[_0xfb76('0x4e')]=_0x4f0824;return _0x5cc82e;})[_0xfb76('0x1c')](respondWithFilteredResult(_0xa80cf,_0x1535aa))[_0xfb76('0x25')](handleError(_0xa80cf,null));};exports[_0xfb76('0x4f')]=function(_0x28b0ca,_0x52986f){var _0x5c263d={'raw':![],'where':{'id':_0x28b0ca['params']['id']}},_0x81c6b2={};_0x81c6b2[_0xfb76('0x3d')]=_['keys'](db[_0xfb76('0x3a')]['rawAttributes']);_0x81c6b2[_0xfb76('0x3e')]=_[_0xfb76('0x3f')](_0x28b0ca[_0xfb76('0x3e')]);_0x81c6b2[_0xfb76('0x40')]=_['intersection'](_0x81c6b2[_0xfb76('0x3d')],_0x81c6b2[_0xfb76('0x3e')]);_0x5c263d[_0xfb76('0x42')]=_[_0xfb76('0x41')](_0x81c6b2[_0xfb76('0x3d')],qs[_0xfb76('0x50')](_0x28b0ca[_0xfb76('0x3e')][_0xfb76('0x50')]));_0x5c263d[_0xfb76('0x42')]=_0x5c263d[_0xfb76('0x42')][_0xfb76('0x43')]?_0x5c263d[_0xfb76('0x42')]:_0x81c6b2[_0xfb76('0x3d')];if(_0x28b0ca[_0xfb76('0x3e')]['includeAll']){_0x5c263d[_0xfb76('0x4c')]=[{'all':!![]}];}_0x5c263d=_['merge']({},_0x5c263d,_0x28b0ca['options']);return db['VoiceContext'][_0xfb76('0x51')](_0x5c263d)[_0xfb76('0x1c')](handleEntityNotFound(_0x52986f,null))[_0xfb76('0x1c')](respondWithResult(_0x52986f,null))[_0xfb76('0x25')](handleError(_0x52986f,null));};exports[_0xfb76('0x52')]=function(_0x54da7e,_0x4d2c0d,_0x29bfd5){var _0x2fb2c4;return db[_0xfb76('0x3a')][_0xfb76('0x52')](_0x54da7e[_0xfb76('0x53')],{'raw':!![]})['then'](function(_0x45ea3a){_0x2fb2c4=_0x45ea3a;return db[_0xfb76('0x3a')][_0xfb76('0x4d')]({'raw':!![]});})['then'](function(_0x49195a){var _0x29a83a=fs[_0xfb76('0x54')](path[_0xfb76('0x55')](config['root'],_0xfb76('0x56')),_0xfb76('0x57'));var _0x10ae27=ejs[_0xfb76('0x58')](_0x29a83a,{'contexts':_0x49195a||[]});fs[_0xfb76('0x59')](_0xfb76('0x5a'),_0x10ae27);})[_0xfb76('0x1c')](function(){return respondWithRpcPromise(_0xfb76('0x5b'),_0xfb76('0x52'),{'module':'chan_sip.so'});})[_0xfb76('0x1c')](function(){var _0x117189=_0x54da7e[_0xfb76('0x5c')]['get']({'plain':!![]});if(!_0x117189)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x117189[_0xfb76('0x5d')]===_0xfb76('0x5c')){var _0x446358=_0x2fb2c4[_0xfb76('0x32')]({'plain':!![]});return db[_0xfb76('0x5e')][_0xfb76('0x51')]({'where':{'name':_0xfb76('0x33'),'userProfileId':_0x117189[_0xfb76('0x5f')]},'raw':!![]})[_0xfb76('0x1c')](function(_0x639ca7){if(_0x639ca7&&_0x639ca7[_0xfb76('0x60')]===0x0){return db[_0xfb76('0x34')]['create']({'name':_0x446358[_0xfb76('0x37')],'resourceId':_0x446358['id'],'type':_0x639ca7[_0xfb76('0x37')],'sectionId':_0x639ca7['id']},{})[_0xfb76('0x1c')](function(){return _0x2fb2c4;});}else{return _0x2fb2c4;}})['catch'](function(_0x270532){logger[_0xfb76('0x21')](_0xfb76('0x61'),_0x270532);throw _0x270532;});}return _0x2fb2c4;})[_0xfb76('0x1c')](respondWithResult(_0x4d2c0d,0xc9))['catch'](handleError(_0x4d2c0d,null));};exports[_0xfb76('0x30')]=function(_0x1147ca,_0x458111,_0x4498c7){var _0x1a56d1;return db[_0xfb76('0x3a')]['find']({'where':{'id':_0x1147ca[_0xfb76('0x62')]['id']}})[_0xfb76('0x1c')](handleEntityNotFound(_0x458111,null))['then'](saveUpdates(_0x1147ca[_0xfb76('0x53')],null))[_0xfb76('0x1c')](function(_0x367837){if(_0x367837){_0x1a56d1=_0x367837;return db[_0xfb76('0x3a')]['findAll']({'raw':!![]});}})[_0xfb76('0x1c')](function(_0x1b45ea){var _0x5024d4=fs[_0xfb76('0x54')](path['join'](config[_0xfb76('0x63')],_0xfb76('0x56')),_0xfb76('0x57'));var _0x467f73=ejs['render'](_0x5024d4,{'contexts':_0x1b45ea||[]});fs[_0xfb76('0x59')](_0xfb76('0x5a'),_0x467f73);})['then'](function(){return respondWithRpcPromise(_0xfb76('0x5b'),_0xfb76('0x30'),{'module':'chan_sip.so'});})[_0xfb76('0x1c')](function(){return _0x1a56d1;})['then'](respondWithResult(_0x458111,null))[_0xfb76('0x25')](handleError(_0x458111,null));};exports[_0xfb76('0x31')]=function(_0x203d53,_0x5f57f1,_0x2d8853){var _0x1a803c;return db[_0xfb76('0x3a')][_0xfb76('0x51')]({'where':{'id':_0x203d53['params']['id']}})['then'](handleEntityNotFound(_0x5f57f1,null))[_0xfb76('0x1c')](removeEntity(_0x5f57f1,null))[_0xfb76('0x1c')](function(){return db[_0xfb76('0x3a')][_0xfb76('0x4d')]({'raw':!![]});})[_0xfb76('0x1c')](function(_0x8c5225){var _0x41eec6=fs[_0xfb76('0x54')](path['join'](config['root'],_0xfb76('0x56')),_0xfb76('0x57'));var _0x51e428=ejs[_0xfb76('0x58')](_0x41eec6,{'contexts':_0x8c5225});fs[_0xfb76('0x59')](_0xfb76('0x5a'),_0x51e428);return respondWithRpcPromise(_0xfb76('0x5b'),_0xfb76('0x31'),{'module':_0xfb76('0x64')});})[_0xfb76('0x25')](handleError(_0x5f57f1,null));};
\ No newline at end of file
index 845113e..6274f70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash'];(function(_0x302b10,_0x3439f7){var _0x1506cc=function(_0x1c1ef1){while(--_0x1c1ef1){_0x302b10['push'](_0x302b10['shift']());}};_0x1506cc(++_0x3439f7);}(_0xef0d,0xdc));var _0xdef0=function(_0x55d8ea,_0xdaa100){_0x55d8ea=_0x55d8ea-0x0;var _0x1c96ea=_0xef0d[_0x55d8ea];return _0x1c96ea;};'use strict';var _=require(_0xdef0('0x0'));var util=require('util');var logger=require(_0xdef0('0x1'))(_0xdef0('0x2'));var moment=require(_0xdef0('0x3'));var BPromise=require(_0xdef0('0x4'));var rp=require(_0xdef0('0x5'));var fs=require('fs');var path=require(_0xdef0('0x6'));var rimraf=require(_0xdef0('0x7'));var config=require(_0xdef0('0x8'));var attributes=require(_0xdef0('0x9'));module['exports']=function(_0x2d4aca,_0x836c7e){return _0x2d4aca[_0xdef0('0xa')](_0xdef0('0xb'),attributes,{'tableName':_0xdef0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15fc=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','util'];(function(_0x2b5ccf,_0x45b1c8){var _0x4b3b60=function(_0x569223){while(--_0x569223){_0x2b5ccf['push'](_0x2b5ccf['shift']());}};_0x4b3b60(++_0x45b1c8);}(_0x15fc,0x8f));var _0xc15f=function(_0x177779,_0x16a74a){_0x177779=_0x177779-0x0;var _0x357d3c=_0x15fc[_0x177779];return _0x357d3c;};'use strict';var _=require('lodash');var util=require(_0xc15f('0x0'));var logger=require(_0xc15f('0x1'))(_0xc15f('0x2'));var moment=require(_0xc15f('0x3'));var BPromise=require(_0xc15f('0x4'));var rp=require(_0xc15f('0x5'));var fs=require('fs');var path=require(_0xc15f('0x6'));var rimraf=require(_0xc15f('0x7'));var config=require(_0xc15f('0x8'));var attributes=require(_0xc15f('0x9'));module['exports']=function(_0x47515c,_0x46a525){return _0x47515c[_0xc15f('0xa')](_0xc15f('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 14a82d7..57c4510 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d98=['request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','VoiceContext,\x20%s,\x20%s'];(function(_0x1db252,_0x3f2c5c){var _0x3e131d=function(_0x11d476){while(--_0x11d476){_0x1db252['push'](_0x1db252['shift']());}};_0x3e131d(++_0x3f2c5c);}(_0x0d98,0x149));var _0x80d9=function(_0xde1b48,_0x5c3df8){_0xde1b48=_0xde1b48-0x0;var _0xd854fc=_0x0d98[_0xde1b48];return _0xd854fc;};'use strict';var _=require(_0x80d9('0x0'));var util=require(_0x80d9('0x1'));var moment=require(_0x80d9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80d9('0x3'))['db'];var utils=require(_0x80d9('0x4'));var logger=require(_0x80d9('0x5'))(_0x80d9('0x6'));var config=require('../../config/environment');var jayson=require(_0x80d9('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e5f6b,_0x45f2f1,_0xb8d05){return new BPromise(function(_0x5cc7b7,_0x4f3fe9){return client[_0x80d9('0x8')](_0x5e5f6b,_0xb8d05)[_0x80d9('0x9')](function(_0x4e874d){logger['info'](_0x80d9('0xa'),_0x45f2f1,_0x80d9('0xb'));logger['debug'](_0x80d9('0xc'),_0x45f2f1,_0x80d9('0xb'),JSON[_0x80d9('0xd')](_0x4e874d));if(_0x4e874d[_0x80d9('0xe')]){if(_0x4e874d[_0x80d9('0xe')][_0x80d9('0xf')]===0x1f4){logger['error'](_0x80d9('0xa'),_0x45f2f1,_0x4e874d[_0x80d9('0xe')]['message']);return _0x4f3fe9(_0x4e874d[_0x80d9('0xe')][_0x80d9('0x10')]);}logger[_0x80d9('0xe')]('VoiceContext,\x20%s,\x20%s',_0x45f2f1,_0x4e874d[_0x80d9('0xe')]['message']);return _0x5cc7b7(_0x4e874d[_0x80d9('0xe')][_0x80d9('0x10')]);}else{logger[_0x80d9('0x11')](_0x80d9('0xa'),_0x45f2f1,'request\x20sent');_0x5cc7b7(_0x4e874d[_0x80d9('0x12')][_0x80d9('0x10')]);}})[_0x80d9('0x13')](function(_0xa8c7e9){logger[_0x80d9('0xe')](_0x80d9('0xa'),_0x45f2f1,_0xa8c7e9);_0x4f3fe9(_0xa8c7e9);});});}
\ No newline at end of file
+var _0x5416=['info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5416,0x13d));var _0x6541=function(_0x4581fe,_0x370018){_0x4581fe=_0x4581fe-0x0;var _0x2c3035=_0x5416[_0x4581fe];return _0x2c3035;};'use strict';var _=require(_0x6541('0x0'));var util=require(_0x6541('0x1'));var moment=require(_0x6541('0x2'));var BPromise=require(_0x6541('0x3'));var rs=require(_0x6541('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6541('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6541('0x6'))(_0x6541('0x7'));var config=require('../../config/environment');var jayson=require(_0x6541('0x8'));var client=jayson[_0x6541('0x9')][_0x6541('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38fe33,_0x176fc3,_0x327a7c){return new BPromise(function(_0x37d7cd,_0x21e1bc){return client[_0x6541('0xb')](_0x38fe33,_0x327a7c)[_0x6541('0xc')](function(_0x34270f){logger[_0x6541('0xd')](_0x6541('0xe'),_0x176fc3,'request\x20sent');logger[_0x6541('0xf')](_0x6541('0x10'),_0x176fc3,'request\x20sent',JSON['stringify'](_0x34270f));if(_0x34270f['error']){if(_0x34270f[_0x6541('0x11')][_0x6541('0x12')]===0x1f4){logger['error'](_0x6541('0xe'),_0x176fc3,_0x34270f[_0x6541('0x11')][_0x6541('0x13')]);return _0x21e1bc(_0x34270f[_0x6541('0x11')][_0x6541('0x13')]);}logger['error'](_0x6541('0xe'),_0x176fc3,_0x34270f[_0x6541('0x11')]['message']);return _0x37d7cd(_0x34270f[_0x6541('0x11')]['message']);}else{logger['info'](_0x6541('0xe'),_0x176fc3,_0x6541('0x14'));_0x37d7cd(_0x34270f[_0x6541('0x15')]['message']);}})['catch'](function(_0x20e117){logger[_0x6541('0x11')](_0x6541('0xe'),_0x176fc3,_0x20e117);_0x21e1bc(_0x20e117);});});}
\ No newline at end of file
index 35f2c34..b02d588 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa063=['describe','/:id','show','post','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','isAuthenticated','index','get'];(function(_0x3c6626,_0x524a6f){var _0xee83de=function(_0x2c4849){while(--_0x2c4849){_0x3c6626['push'](_0x3c6626['shift']());}};_0xee83de(++_0x524a6f);}(_0xa063,0x1ee));var _0x3a06=function(_0x4d65e1,_0x32e834){_0x4d65e1=_0x4d65e1-0x0;var _0x5d1041=_0xa063[_0x4d65e1];return _0x5d1041;};'use strict';var multer=require(_0x3a06('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3a06('0x1'));var express=require(_0x3a06('0x2'));var router=express[_0x3a06('0x3')]();var fs_extra=require(_0x3a06('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3a06('0x5'));var config=require('../../config/environment');var controller=require(_0x3a06('0x6'));router['get']('/',auth[_0x3a06('0x7')](),controller[_0x3a06('0x8')]);router[_0x3a06('0x9')]('/describe',auth[_0x3a06('0x7')](),controller[_0x3a06('0xa')]);router['get'](_0x3a06('0xb'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xc')]);router[_0x3a06('0xd')]('/',auth[_0x3a06('0x7')](),controller['create']);router['put'](_0x3a06('0xb'),auth[_0x3a06('0x7')](),controller[_0x3a06('0xe')]);router[_0x3a06('0xf')](_0x3a06('0xb'),auth['isAuthenticated'](),controller[_0x3a06('0x10')]);module[_0x3a06('0x11')]=router;
\ No newline at end of file
+var _0xb201=['./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb201,0x1b1));var _0x1b20=function(_0x3f4e65,_0x50c1a0){_0x3f4e65=_0x3f4e65-0x0;var _0x5eb928=_0xb201[_0x3f4e65];return _0x5eb928;};'use strict';var multer=require(_0x1b20('0x0'));var util=require('util');var path=require(_0x1b20('0x1'));var timeout=require(_0x1b20('0x2'));var express=require(_0x1b20('0x3'));var router=express[_0x1b20('0x4')]();var fs_extra=require(_0x1b20('0x5'));var auth=require(_0x1b20('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1b20('0x7'));var controller=require(_0x1b20('0x8'));router[_0x1b20('0x9')]('/',auth['isAuthenticated'](),controller[_0x1b20('0xa')]);router['get'](_0x1b20('0xb'),auth[_0x1b20('0xc')](),controller[_0x1b20('0xd')]);router[_0x1b20('0x9')]('/:id',auth[_0x1b20('0xc')](),controller[_0x1b20('0xe')]);router[_0x1b20('0xf')]('/',auth['isAuthenticated'](),controller[_0x1b20('0x10')]);router['put'](_0x1b20('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1b20('0x12')](_0x1b20('0x11'),auth[_0x1b20('0xc')](),controller[_0x1b20('0x13')]);module[_0x1b20('0x14')]=router;
\ No newline at end of file
index 10a58dc..69a804e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0xaa1e39,_0x206d14){var _0x7359f2=function(_0x5ed31d){while(--_0x5ed31d){_0xaa1e39['push'](_0xaa1e39['shift']());}};_0x7359f2(++_0x206d14);}(_0xe5b3,0x133));var _0x3e5b=function(_0x330a95,_0x2b0fe3){_0x330a95=_0x330a95-0x0;var _0xb9a8d=_0xe5b3[_0x330a95];return _0xb9a8d;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9f62=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0x9f62,0x154));var _0x29f6=function(_0x2501b5,_0x167b0a){_0x2501b5=_0x2501b5-0x0;var _0x502d9e=_0x9f62[_0x2501b5];return _0x502d9e;};'use strict';var Sequelize=require('sequelize');module[_0x29f6('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x29f6('0x1')]},'channelstate':{'type':Sequelize[_0x29f6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x29f6('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'connectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'language':{'type':Sequelize[_0x29f6('0x1')]},'accountcode':{'type':Sequelize[_0x29f6('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x29f6('0x1')]},'priority':{'type':Sequelize[_0x29f6('0x2')]},'uniqueid':{'type':Sequelize[_0x29f6('0x1')]},'linkedid':{'type':Sequelize[_0x29f6('0x1')]},'destchannel':{'type':Sequelize[_0x29f6('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x29f6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x29f6('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x29f6('0x1')]},'destexten':{'type':Sequelize[_0x29f6('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x29f6('0x1')]},'destlinkedid':{'type':Sequelize[_0x29f6('0x1')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x29f6('0x3')]},'lastevent':{'type':Sequelize[_0x29f6('0x1')],'comment':_0x29f6('0x4')},'routeId':{'type':Sequelize[_0x29f6('0x2')]},'duration':{'type':Sequelize[_0x29f6('0x2')]},'holdtime':{'type':Sequelize[_0x29f6('0x2')]},'billableseconds':{'type':Sequelize[_0x29f6('0x2')]}};
\ No newline at end of file
index a6d5803..1fa76bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe69e=['catch','create','body','describe','eml-format','zip-dir','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set','apply','update','then','destroy','error','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find'];(function(_0x92412d,_0x2ef412){var _0x2fdd56=function(_0x57fc53){while(--_0x57fc53){_0x92412d['push'](_0x92412d['shift']());}};_0x2fdd56(++_0x2ef412);}(_0xe69e,0x1ba));var _0xee69=function(_0x9b3efc,_0x577a0d){_0x9b3efc=_0x9b3efc-0x0;var _0x200f05=_0xe69e[_0x9b3efc];return _0x200f05;};'use strict';var emlformat=require(_0xee69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xee69('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee69('0x2'));var Mustache=require('mustache');var util=require(_0xee69('0x3'));var path=require(_0xee69('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee69('0x5'));var fs=require('fs');var fs_extra=require(_0xee69('0x6'));var _=require(_0xee69('0x7'));var squel=require(_0xee69('0x8'));var crypto=require(_0xee69('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xee69('0xa'));var Papa=require(_0xee69('0xb'));var Redis=require('ioredis');var authService=require(_0xee69('0xc'));var qs=require(_0xee69('0xd'));var as=require(_0xee69('0xe'));var hardwareService=require(_0xee69('0xf'));var logger=require('../../config/logger')(_0xee69('0x10'));var utils=require(_0xee69('0x11'));var config=require(_0xee69('0x12'));var licenseUtil=require(_0xee69('0x13'));var db=require(_0xee69('0x14'))['db'];function respondWithStatusCode(_0x2d9234,_0x425e0c){_0x425e0c=_0x425e0c||0xcc;return function(_0x25f18a){if(_0x25f18a){return _0x2d9234[_0xee69('0x15')](_0x425e0c);}return _0x2d9234[_0xee69('0x16')](_0x425e0c)[_0xee69('0x17')]();};}function respondWithResult(_0x78347b,_0x475eec){_0x475eec=_0x475eec||0xc8;return function(_0xe3aa13){if(_0xe3aa13){return _0x78347b[_0xee69('0x16')](_0x475eec)[_0xee69('0x18')](_0xe3aa13);}};}function respondWithFilteredResult(_0x400b6e,_0x4ae690){return function(_0x3503a6){if(_0x3503a6){var _0x283dc6=typeof _0x4ae690['offset']===_0xee69('0x19')&&typeof _0x4ae690['limit']==='undefined';var _0x4f69b9=_0x3503a6[_0xee69('0x1a')];var _0x4fb30d=_0x283dc6?0x0:_0x4ae690[_0xee69('0x1b')];var _0x5aecc9=_0x283dc6?_0x3503a6[_0xee69('0x1a')]:_0x4ae690[_0xee69('0x1b')]+_0x4ae690['limit'];var _0x188c0a;if(_0x5aecc9>=_0x4f69b9){_0x5aecc9=_0x4f69b9;_0x188c0a=0xc8;}else{_0x188c0a=0xce;}_0x400b6e[_0xee69('0x16')](_0x188c0a);return _0x400b6e[_0xee69('0x1c')]('Content-Range',_0x4fb30d+'-'+_0x5aecc9+'/'+_0x4f69b9)['json'](_0x3503a6);}return null;};}function patchUpdates(_0x3695cd){return function(_0x26c743){try{jsonpatch[_0xee69('0x1d')](_0x26c743,_0x3695cd,!![]);}catch(_0x3ad52f){return BPromise['reject'](_0x3ad52f);}return _0x26c743['save']();};}function saveUpdates(_0x5c5066,_0x36c0c0){return function(_0x5c38d6){if(_0x5c38d6){return _0x5c38d6[_0xee69('0x1e')](_0x5c5066)[_0xee69('0x1f')](function(_0x2b5b2e){return _0x2b5b2e;});}return null;};}function removeEntity(_0x206454,_0x51ad76){return function(_0x646692){if(_0x646692){return _0x646692[_0xee69('0x20')]()['then'](function(){_0x206454[_0xee69('0x16')](0xcc)[_0xee69('0x17')]();});}};}function handleEntityNotFound(_0x35d721,_0x5df1bf){return function(_0x5d6445){if(!_0x5d6445){_0x35d721[_0xee69('0x15')](0x194);}return _0x5d6445;};}function handleError(_0x3be03c,_0x43a1dc){_0x43a1dc=_0x43a1dc||0x1f4;return function(_0x3771b8){logger[_0xee69('0x21')](_0x3771b8['stack']);if(_0x3771b8['name']){delete _0x3771b8['name'];}_0x3be03c[_0xee69('0x16')](_0x43a1dc)[_0xee69('0x22')](_0x3771b8);};}exports[_0xee69('0x23')]=function(_0x5acd3b,_0x3422b8){var _0x30c6d0={},_0xdb4576={},_0x2351fa={'count':0x0,'rows':[]};var _0x2e8291=_[_0xee69('0x24')](db[_0xee69('0x25')][_0xee69('0x26')],function(_0x1e3fc6){return{'name':_0x1e3fc6[_0xee69('0x27')],'type':_0x1e3fc6[_0xee69('0x28')][_0xee69('0x29')]};});_0xdb4576['model']=_[_0xee69('0x24')](_0x2e8291,_0xee69('0x2a'));_0xdb4576[_0xee69('0x2b')]=_[_0xee69('0x2c')](_0x5acd3b[_0xee69('0x2b')]);_0xdb4576['filters']=_[_0xee69('0x2d')](_0xdb4576[_0xee69('0x2e')],_0xdb4576[_0xee69('0x2b')]);_0x30c6d0[_0xee69('0x2f')]=_[_0xee69('0x2d')](_0xdb4576[_0xee69('0x2e')],qs[_0xee69('0x30')](_0x5acd3b[_0xee69('0x2b')][_0xee69('0x30')]));_0x30c6d0[_0xee69('0x2f')]=_0x30c6d0['attributes'][_0xee69('0x31')]?_0x30c6d0[_0xee69('0x2f')]:_0xdb4576['model'];if(!_0x5acd3b['query'][_0xee69('0x32')](_0xee69('0x33'))){_0x30c6d0[_0xee69('0x34')]=qs[_0xee69('0x34')](_0x5acd3b[_0xee69('0x2b')][_0xee69('0x34')]);_0x30c6d0[_0xee69('0x1b')]=qs[_0xee69('0x1b')](_0x5acd3b[_0xee69('0x2b')][_0xee69('0x1b')]);}_0x30c6d0[_0xee69('0x35')]=qs[_0xee69('0x36')](_0x5acd3b['query']['sort']);_0x30c6d0['where']=qs[_0xee69('0x37')](_[_0xee69('0x38')](_0x5acd3b[_0xee69('0x2b')],_0xdb4576['filters']),_0x2e8291);if(_0x5acd3b[_0xee69('0x2b')][_0xee69('0x39')]){_0x30c6d0[_0xee69('0x3a')]=_[_0xee69('0x3b')](_0x30c6d0[_0xee69('0x3a')],{'$or':_[_0xee69('0x24')](_0x2e8291,function(_0x5decac){if(_0x5decac[_0xee69('0x28')]!==_0xee69('0x3c')){var _0x336edd={};_0x336edd[_0x5decac[_0xee69('0x2a')]]={'$like':'%'+_0x5acd3b['query'][_0xee69('0x39')]+'%'};return _0x336edd;}})});}_0x30c6d0=_['merge']({},_0x30c6d0,_0x5acd3b[_0xee69('0x3d')]);var _0x2fa85a={'where':_0x30c6d0['where']};return db['VoiceDialReport'][_0xee69('0x1a')](_0x2fa85a)['then'](function(_0x159223){_0x2351fa[_0xee69('0x1a')]=_0x159223;if(_0x5acd3b['query'][_0xee69('0x3e')]){_0x30c6d0[_0xee69('0x3f')]=[{'all':!![]}];}return db[_0xee69('0x25')][_0xee69('0x40')](_0x30c6d0);})[_0xee69('0x1f')](function(_0x15ae93){_0x2351fa[_0xee69('0x41')]=_0x15ae93;return _0x2351fa;})['then'](respondWithFilteredResult(_0x3422b8,_0x30c6d0))['catch'](handleError(_0x3422b8,null));};exports[_0xee69('0x42')]=function(_0x29d2e5,_0x3ef900){var _0x1d27fc={'raw':!![],'where':{'id':_0x29d2e5[_0xee69('0x43')]['id']}},_0x153e61={};_0x153e61['model']=_[_0xee69('0x2c')](db[_0xee69('0x25')][_0xee69('0x26')]);_0x153e61[_0xee69('0x2b')]=_[_0xee69('0x2c')](_0x29d2e5[_0xee69('0x2b')]);_0x153e61[_0xee69('0x37')]=_[_0xee69('0x2d')](_0x153e61[_0xee69('0x2e')],_0x153e61['query']);_0x1d27fc['attributes']=_[_0xee69('0x2d')](_0x153e61['model'],qs[_0xee69('0x30')](_0x29d2e5[_0xee69('0x2b')][_0xee69('0x30')]));_0x1d27fc[_0xee69('0x2f')]=_0x1d27fc[_0xee69('0x2f')][_0xee69('0x31')]?_0x1d27fc['attributes']:_0x153e61['model'];if(_0x29d2e5[_0xee69('0x2b')]['includeAll']){_0x1d27fc[_0xee69('0x3f')]=[{'all':!![]}];}_0x1d27fc=_[_0xee69('0x3b')]({},_0x1d27fc,_0x29d2e5[_0xee69('0x3d')]);return db['VoiceDialReport'][_0xee69('0x44')](_0x1d27fc)['then'](handleEntityNotFound(_0x3ef900,null))['then'](respondWithResult(_0x3ef900,null))[_0xee69('0x45')](handleError(_0x3ef900,null));};exports[_0xee69('0x46')]=function(_0x4eac72,_0x3d6c51){return db['VoiceDialReport']['create'](_0x4eac72[_0xee69('0x47')],{})[_0xee69('0x1f')](respondWithResult(_0x3d6c51,0xc9))[_0xee69('0x45')](handleError(_0x3d6c51,null));};exports[_0xee69('0x1e')]=function(_0x2ee8ae,_0x34cb64){if(_0x2ee8ae[_0xee69('0x47')]['id']){delete _0x2ee8ae[_0xee69('0x47')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x2ee8ae['params']['id']}})['then'](handleEntityNotFound(_0x34cb64,null))['then'](saveUpdates(_0x2ee8ae['body'],null))[_0xee69('0x1f')](respondWithResult(_0x34cb64,null))[_0xee69('0x45')](handleError(_0x34cb64,null));};exports[_0xee69('0x20')]=function(_0x4deb0e,_0x324358){return db['VoiceDialReport']['find']({'where':{'id':_0x4deb0e['params']['id']}})[_0xee69('0x1f')](handleEntityNotFound(_0x324358,null))[_0xee69('0x1f')](removeEntity(_0x324358,null))['catch'](handleError(_0x324358,null));};exports['describe']=function(_0x58aaa8,_0x29b4a3){return db['VoiceDialReport'][_0xee69('0x48')]()[_0xee69('0x1f')](respondWithResult(_0x29b4a3,null))['catch'](handleError(_0x29b4a3,null));};
\ No newline at end of file
+var _0xbc3e=['name','send','index','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','VoiceDialReport','includeAll','findAll','rows','catch','filters','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack'];(function(_0x32df96,_0x998561){var _0x40c632=function(_0x2b37cb){while(--_0x2b37cb){_0x32df96['push'](_0x32df96['shift']());}};_0x40c632(++_0x998561);}(_0xbc3e,0x10c));var _0xebc3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbc3e[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xebc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xebc3('0x1'));var jsonpatch=require(_0xebc3('0x2'));var rp=require('request-promise');var moment=require(_0xebc3('0x3'));var BPromise=require(_0xebc3('0x4'));var Mustache=require('mustache');var util=require(_0xebc3('0x5'));var path=require('path');var sox=require(_0xebc3('0x6'));var csv=require(_0xebc3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xebc3('0x8'));var _=require(_0xebc3('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xebc3('0xa'));var deskjs=require(_0xebc3('0xb'));var toCsv=require(_0xebc3('0x7'));var querystring=require(_0xebc3('0xc'));var Papa=require(_0xebc3('0xd'));var Redis=require(_0xebc3('0xe'));var authService=require(_0xebc3('0xf'));var qs=require(_0xebc3('0x10'));var as=require(_0xebc3('0x11'));var hardwareService=require(_0xebc3('0x12'));var logger=require(_0xebc3('0x13'))('api');var utils=require(_0xebc3('0x14'));var config=require(_0xebc3('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xebc3('0x16'))['db'];function respondWithStatusCode(_0x4295a5,_0x482f3c){_0x482f3c=_0x482f3c||0xcc;return function(_0x17c7a8){if(_0x17c7a8){return _0x4295a5[_0xebc3('0x17')](_0x482f3c);}return _0x4295a5[_0xebc3('0x18')](_0x482f3c)[_0xebc3('0x19')]();};}function respondWithResult(_0x576fc9,_0x269af2){_0x269af2=_0x269af2||0xc8;return function(_0x2236b8){if(_0x2236b8){return _0x576fc9['status'](_0x269af2)[_0xebc3('0x1a')](_0x2236b8);}};}function respondWithFilteredResult(_0x131ef6,_0x5d197d){return function(_0x5dac60){if(_0x5dac60){var _0x55e92e=typeof _0x5d197d['offset']===_0xebc3('0x1b')&&typeof _0x5d197d[_0xebc3('0x1c')]===_0xebc3('0x1b');var _0x38bb35=_0x5dac60[_0xebc3('0x1d')];var _0x1b1754=_0x55e92e?0x0:_0x5d197d[_0xebc3('0x1e')];var _0x46cbca=_0x55e92e?_0x5dac60[_0xebc3('0x1d')]:_0x5d197d[_0xebc3('0x1e')]+_0x5d197d[_0xebc3('0x1c')];var _0x7095c1;if(_0x46cbca>=_0x38bb35){_0x46cbca=_0x38bb35;_0x7095c1=0xc8;}else{_0x7095c1=0xce;}_0x131ef6[_0xebc3('0x18')](_0x7095c1);return _0x131ef6[_0xebc3('0x1f')](_0xebc3('0x20'),_0x1b1754+'-'+_0x46cbca+'/'+_0x38bb35)[_0xebc3('0x1a')](_0x5dac60);}return null;};}function patchUpdates(_0x4ef698){return function(_0x33d477){try{jsonpatch[_0xebc3('0x21')](_0x33d477,_0x4ef698,!![]);}catch(_0x4aefeb){return BPromise[_0xebc3('0x22')](_0x4aefeb);}return _0x33d477['save']();};}function saveUpdates(_0x3e7c39,_0x3d3861){return function(_0x1b2349){if(_0x1b2349){return _0x1b2349[_0xebc3('0x23')](_0x3e7c39)[_0xebc3('0x24')](function(_0x431ca0){return _0x431ca0;});}return null;};}function removeEntity(_0x248353,_0x2f8471){return function(_0x2436ee){if(_0x2436ee){return _0x2436ee[_0xebc3('0x25')]()[_0xebc3('0x24')](function(){_0x248353[_0xebc3('0x18')](0xcc)[_0xebc3('0x19')]();});}};}function handleEntityNotFound(_0x16dcb5,_0x217ec1){return function(_0x2f596f){if(!_0x2f596f){_0x16dcb5['sendStatus'](0x194);}return _0x2f596f;};}function handleError(_0x213e20,_0x5f4b7b){_0x5f4b7b=_0x5f4b7b||0x1f4;return function(_0x37ad63){logger[_0xebc3('0x26')](_0x37ad63[_0xebc3('0x27')]);if(_0x37ad63[_0xebc3('0x28')]){delete _0x37ad63[_0xebc3('0x28')];}_0x213e20[_0xebc3('0x18')](_0x5f4b7b)[_0xebc3('0x29')](_0x37ad63);};}exports[_0xebc3('0x2a')]=function(_0x2a9f4c,_0x3cc757){var _0x7fae7={},_0x3dd284={},_0xfc169a={'count':0x0,'rows':[]};var _0x1c80e8=_['map'](db['VoiceDialReport'][_0xebc3('0x2b')],function(_0x588287){return{'name':_0x588287[_0xebc3('0x2c')],'type':_0x588287['type'][_0xebc3('0x2d')]};});_0x3dd284[_0xebc3('0x2e')]=_[_0xebc3('0x2f')](_0x1c80e8,'name');_0x3dd284[_0xebc3('0x30')]=_[_0xebc3('0x31')](_0x2a9f4c[_0xebc3('0x30')]);_0x3dd284['filters']=_['intersection'](_0x3dd284['model'],_0x3dd284['query']);_0x7fae7[_0xebc3('0x32')]=_[_0xebc3('0x33')](_0x3dd284[_0xebc3('0x2e')],qs[_0xebc3('0x34')](_0x2a9f4c[_0xebc3('0x30')]['fields']));_0x7fae7['attributes']=_0x7fae7[_0xebc3('0x32')][_0xebc3('0x35')]?_0x7fae7['attributes']:_0x3dd284['model'];if(!_0x2a9f4c[_0xebc3('0x30')][_0xebc3('0x36')](_0xebc3('0x37'))){_0x7fae7[_0xebc3('0x1c')]=qs[_0xebc3('0x1c')](_0x2a9f4c[_0xebc3('0x30')]['limit']);_0x7fae7['offset']=qs[_0xebc3('0x1e')](_0x2a9f4c['query'][_0xebc3('0x1e')]);}_0x7fae7[_0xebc3('0x38')]=qs[_0xebc3('0x39')](_0x2a9f4c[_0xebc3('0x30')][_0xebc3('0x39')]);_0x7fae7[_0xebc3('0x3a')]=qs['filters'](_[_0xebc3('0x3b')](_0x2a9f4c[_0xebc3('0x30')],_0x3dd284['filters']),_0x1c80e8);if(_0x2a9f4c[_0xebc3('0x30')][_0xebc3('0x3c')]){_0x7fae7[_0xebc3('0x3a')]=_['merge'](_0x7fae7[_0xebc3('0x3a')],{'$or':_['map'](_0x1c80e8,function(_0x218726){if(_0x218726[_0xebc3('0x3d')]!==_0xebc3('0x3e')){var _0x25b945={};_0x25b945[_0x218726[_0xebc3('0x28')]]={'$like':'%'+_0x2a9f4c['query']['filter']+'%'};return _0x25b945;}})});}_0x7fae7=_[_0xebc3('0x3f')]({},_0x7fae7,_0x2a9f4c[_0xebc3('0x40')]);var _0x1b7ca4={'where':_0x7fae7[_0xebc3('0x3a')]};return db[_0xebc3('0x41')][_0xebc3('0x1d')](_0x1b7ca4)[_0xebc3('0x24')](function(_0x16fb39){_0xfc169a[_0xebc3('0x1d')]=_0x16fb39;if(_0x2a9f4c['query'][_0xebc3('0x42')]){_0x7fae7['include']=[{'all':!![]}];}return db[_0xebc3('0x41')][_0xebc3('0x43')](_0x7fae7);})[_0xebc3('0x24')](function(_0x4cad2a){_0xfc169a[_0xebc3('0x44')]=_0x4cad2a;return _0xfc169a;})[_0xebc3('0x24')](respondWithFilteredResult(_0x3cc757,_0x7fae7))[_0xebc3('0x45')](handleError(_0x3cc757,null));};exports['show']=function(_0x7fec5f,_0x5b64f0){var _0x249b93={'raw':!![],'where':{'id':_0x7fec5f['params']['id']}},_0x5019f0={};_0x5019f0[_0xebc3('0x2e')]=_[_0xebc3('0x31')](db[_0xebc3('0x41')][_0xebc3('0x2b')]);_0x5019f0[_0xebc3('0x30')]=_[_0xebc3('0x31')](_0x7fec5f[_0xebc3('0x30')]);_0x5019f0[_0xebc3('0x46')]=_[_0xebc3('0x33')](_0x5019f0[_0xebc3('0x2e')],_0x5019f0['query']);_0x249b93['attributes']=_['intersection'](_0x5019f0[_0xebc3('0x2e')],qs[_0xebc3('0x34')](_0x7fec5f[_0xebc3('0x30')][_0xebc3('0x34')]));_0x249b93[_0xebc3('0x32')]=_0x249b93['attributes'][_0xebc3('0x35')]?_0x249b93['attributes']:_0x5019f0[_0xebc3('0x2e')];if(_0x7fec5f[_0xebc3('0x30')][_0xebc3('0x42')]){_0x249b93[_0xebc3('0x47')]=[{'all':!![]}];}_0x249b93=_[_0xebc3('0x3f')]({},_0x249b93,_0x7fec5f[_0xebc3('0x40')]);return db[_0xebc3('0x41')][_0xebc3('0x48')](_0x249b93)[_0xebc3('0x24')](handleEntityNotFound(_0x5b64f0,null))[_0xebc3('0x24')](respondWithResult(_0x5b64f0,null))[_0xebc3('0x45')](handleError(_0x5b64f0,null));};exports[_0xebc3('0x49')]=function(_0x48cd52,_0x4cc311){return db[_0xebc3('0x41')][_0xebc3('0x49')](_0x48cd52['body'],{})[_0xebc3('0x24')](respondWithResult(_0x4cc311,0xc9))['catch'](handleError(_0x4cc311,null));};exports['update']=function(_0x532629,_0x1edd1c){if(_0x532629[_0xebc3('0x4a')]['id']){delete _0x532629[_0xebc3('0x4a')]['id'];}return db[_0xebc3('0x41')]['find']({'where':{'id':_0x532629[_0xebc3('0x4b')]['id']}})[_0xebc3('0x24')](handleEntityNotFound(_0x1edd1c,null))[_0xebc3('0x24')](saveUpdates(_0x532629[_0xebc3('0x4a')],null))[_0xebc3('0x24')](respondWithResult(_0x1edd1c,null))[_0xebc3('0x45')](handleError(_0x1edd1c,null));};exports['destroy']=function(_0x4282c6,_0xca3c34){return db['VoiceDialReport'][_0xebc3('0x48')]({'where':{'id':_0x4282c6[_0xebc3('0x4b')]['id']}})['then'](handleEntityNotFound(_0xca3c34,null))[_0xebc3('0x24')](removeEntity(_0xca3c34,null))['catch'](handleError(_0xca3c34,null));};exports[_0xebc3('0x4c')]=function(_0x2b9ba7,_0x1395e9){return db['VoiceDialReport']['describe']()[_0xebc3('0x24')](respondWithResult(_0x1395e9,null))[_0xebc3('0x45')](handleError(_0x1395e9,null));};
\ No newline at end of file
index ec818a3..1bc8018 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x270a=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./voiceDialReport.attributes'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0x270a,0xe1));var _0xa270=function(_0x3d642b,_0x1ad27e){_0x3d642b=_0x3d642b-0x0;var _0x3fe9cc=_0x270a[_0x3d642b];return _0x3fe9cc;};'use strict';var _=require(_0xa270('0x0'));var util=require(_0xa270('0x1'));var logger=require(_0xa270('0x2'))(_0xa270('0x3'));var moment=require('moment');var BPromise=require(_0xa270('0x4'));var rp=require(_0xa270('0x5'));var fs=require('fs');var path=require(_0xa270('0x6'));var rimraf=require('rimraf');var config=require(_0xa270('0x7'));var attributes=require(_0xa270('0x8'));module['exports']=function(_0x5b9e2d,_0x27872c){return _0x5b9e2d[_0xa270('0x9')](_0xa270('0xa'),attributes,{'tableName':_0xa270('0xb'),'paranoid':![],'indexes':[{'fields':[_0xa270('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdffd=['request-promise','path','rimraf','./voiceDialReport.attributes','define','report_dial','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2d74dd,_0x17d8e2){var _0xf4b7a0=function(_0x16b8b1){while(--_0x16b8b1){_0x2d74dd['push'](_0x2d74dd['shift']());}};_0xf4b7a0(++_0x17d8e2);}(_0xdffd,0xd7));var _0xddff=function(_0x33da4b,_0xafa1c8){_0x33da4b=_0x33da4b-0x0;var _0x1f0ed9=_0xdffd[_0x33da4b];return _0x1f0ed9;};'use strict';var _=require(_0xddff('0x0'));var util=require(_0xddff('0x1'));var logger=require(_0xddff('0x2'))('api');var moment=require(_0xddff('0x3'));var BPromise=require(_0xddff('0x4'));var rp=require(_0xddff('0x5'));var fs=require('fs');var path=require(_0xddff('0x6'));var rimraf=require(_0xddff('0x7'));var config=require('../../config/environment');var attributes=require(_0xddff('0x8'));module['exports']=function(_0x1c3a88,_0x1d9168){return _0x1c3a88[_0xddff('0x9')]('VoiceDialReport',attributes,{'tableName':_0xddff('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 7a38eef..54ea629 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdd=['update','where','attributes','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','stringify','UpdateVoiceDialReport'];(function(_0x4bde5f,_0x109ca8){var _0x22afd7=function(_0x3d1763){while(--_0x3d1763){_0x4bde5f['push'](_0x4bde5f['shift']());}};_0x22afd7(++_0x109ca8);}(_0x5fdd,0x139));var _0xd5fd=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x5fdd[_0x11946c];return _0x383935;};'use strict';var _=require('lodash');var util=require(_0xd5fd('0x0'));var moment=require(_0xd5fd('0x1'));var BPromise=require(_0xd5fd('0x2'));var rs=require(_0xd5fd('0x3'));var fs=require('fs');var Redis=require(_0xd5fd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd5fd('0x5'));var client=jayson[_0xd5fd('0x6')][_0xd5fd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x279cb3,_0x285cf8,_0x55135d){return new BPromise(function(_0x5220e6,_0x34a0e0){return client[_0xd5fd('0x8')](_0x279cb3,_0x55135d)[_0xd5fd('0x9')](function(_0x145a51){logger[_0xd5fd('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x285cf8,_0xd5fd('0xb'));logger[_0xd5fd('0xc')](_0xd5fd('0xd'),_0x285cf8,_0xd5fd('0xb'),JSON['stringify'](_0x145a51));if(_0x145a51[_0xd5fd('0xe')]){if(_0x145a51['error'][_0xd5fd('0xf')]===0x1f4){logger[_0xd5fd('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x285cf8,_0x145a51[_0xd5fd('0xe')][_0xd5fd('0x10')]);return _0x34a0e0(_0x145a51['error']['message']);}logger[_0xd5fd('0xe')](_0xd5fd('0x11'),_0x285cf8,_0x145a51['error'][_0xd5fd('0x10')]);return _0x5220e6(_0x145a51[_0xd5fd('0xe')][_0xd5fd('0x10')]);}else{logger[_0xd5fd('0xa')](_0xd5fd('0x11'),_0x285cf8,_0xd5fd('0xb'));_0x5220e6(_0x145a51[_0xd5fd('0x12')][_0xd5fd('0x10')]);}})[_0xd5fd('0x13')](function(_0x4f89f5){logger['error'](_0xd5fd('0x11'),_0x285cf8,_0x4f89f5);_0x34a0e0(_0x4f89f5);});});}exports[_0xd5fd('0x14')]=function(_0x1e4b19){var _0x510a43=this;return new Promise(function(_0x541447,_0x28d016){return db[_0xd5fd('0x15')][_0xd5fd('0x16')](_0x1e4b19[_0xd5fd('0x17')],{'raw':_0x1e4b19[_0xd5fd('0x18')]?_0x1e4b19[_0xd5fd('0x18')][_0xd5fd('0x19')]===undefined?!![]:![]:!![]})[_0xd5fd('0x9')](function(_0x513687){logger[_0xd5fd('0xa')](_0xd5fd('0x14'),_0x1e4b19);logger[_0xd5fd('0xc')](_0xd5fd('0x14'),_0x1e4b19,JSON[_0xd5fd('0x1a')](_0x513687));_0x541447(_0x513687);})[_0xd5fd('0x13')](function(_0x485064){logger['error'](_0xd5fd('0x14'),_0x485064['message'],_0x1e4b19);_0x28d016(_0x510a43['error'](0x1f4,_0x485064[_0xd5fd('0x10')]));});});};exports[_0xd5fd('0x1b')]=function(_0x405218){var _0x1e0388=this;return new Promise(function(_0x57088d,_0x1bfec9){return db[_0xd5fd('0x15')][_0xd5fd('0x1c')](_0x405218[_0xd5fd('0x17')],{'raw':_0x405218['options']?_0x405218[_0xd5fd('0x18')][_0xd5fd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x405218[_0xd5fd('0x18')]?_0x405218['options'][_0xd5fd('0x1d')]||null:null,'attributes':_0x405218[_0xd5fd('0x18')]?_0x405218[_0xd5fd('0x18')][_0xd5fd('0x1e')]||null:null,'limit':_0x405218[_0xd5fd('0x18')]?_0x405218[_0xd5fd('0x18')]['limit']||null:null})[_0xd5fd('0x9')](function(_0x2bab4f){logger[_0xd5fd('0xa')](_0xd5fd('0x1b'),_0x405218);logger[_0xd5fd('0xc')](_0xd5fd('0x1b'),_0x405218,JSON['stringify'](_0x2bab4f));_0x57088d(_0x2bab4f);})[_0xd5fd('0x13')](function(_0x5f3a9a){logger[_0xd5fd('0xe')]('UpdateVoiceDialReport',_0x5f3a9a[_0xd5fd('0x10')],_0x405218);_0x1bfec9(_0x1e0388[_0xd5fd('0xe')](0x1f4,_0x5f3a9a[_0xd5fd('0x10')]));});});};
\ No newline at end of file
+var _0xd3ca=['raw','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','VoiceDialReport','body','options'];(function(_0x596f6e,_0x3f8857){var _0x1e0803=function(_0x31f91f){while(--_0x31f91f){_0x596f6e['push'](_0x596f6e['shift']());}};_0x1e0803(++_0x3f8857);}(_0xd3ca,0x15d));var _0xad3c=function(_0x62e1ef,_0x252685){_0x62e1ef=_0x62e1ef-0x0;var _0x272c0e=_0xd3ca[_0x62e1ef];return _0x272c0e;};'use strict';var _=require(_0xad3c('0x0'));var util=require('util');var moment=require(_0xad3c('0x1'));var BPromise=require('bluebird');var rs=require(_0xad3c('0x2'));var fs=require('fs');var Redis=require(_0xad3c('0x3'));var db=require(_0xad3c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xad3c('0x5'))(_0xad3c('0x6'));var config=require(_0xad3c('0x7'));var jayson=require(_0xad3c('0x8'));var client=jayson['client'][_0xad3c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x712522,_0x591899,_0x43ed66){return new BPromise(function(_0x328f60,_0x263e1a){return client[_0xad3c('0xa')](_0x712522,_0x43ed66)[_0xad3c('0xb')](function(_0x1d78ff){logger['info'](_0xad3c('0xc'),_0x591899,'request\x20sent');logger['debug'](_0xad3c('0xd'),_0x591899,_0xad3c('0xe'),JSON[_0xad3c('0xf')](_0x1d78ff));if(_0x1d78ff[_0xad3c('0x10')]){if(_0x1d78ff[_0xad3c('0x10')]['code']===0x1f4){logger['error'](_0xad3c('0xc'),_0x591899,_0x1d78ff[_0xad3c('0x10')][_0xad3c('0x11')]);return _0x263e1a(_0x1d78ff[_0xad3c('0x10')][_0xad3c('0x11')]);}logger[_0xad3c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x591899,_0x1d78ff[_0xad3c('0x10')]['message']);return _0x328f60(_0x1d78ff['error'][_0xad3c('0x11')]);}else{logger['info'](_0xad3c('0xc'),_0x591899,_0xad3c('0xe'));_0x328f60(_0x1d78ff[_0xad3c('0x12')][_0xad3c('0x11')]);}})[_0xad3c('0x13')](function(_0x2acb5e){logger[_0xad3c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x591899,_0x2acb5e);_0x263e1a(_0x2acb5e);});});}exports['CreateVoiceDialReport']=function(_0x30ad2){var _0x222e6e=this;return new Promise(function(_0xf53ec1,_0x289585){return db[_0xad3c('0x14')]['create'](_0x30ad2[_0xad3c('0x15')],{'raw':_0x30ad2[_0xad3c('0x16')]?_0x30ad2[_0xad3c('0x16')][_0xad3c('0x17')]===undefined?!![]:![]:!![]})[_0xad3c('0xb')](function(_0x495401){logger['info'](_0xad3c('0x18'),_0x30ad2);logger[_0xad3c('0x19')](_0xad3c('0x18'),_0x30ad2,JSON[_0xad3c('0xf')](_0x495401));_0xf53ec1(_0x495401);})[_0xad3c('0x13')](function(_0x38bdd4){logger['error'](_0xad3c('0x18'),_0x38bdd4[_0xad3c('0x11')],_0x30ad2);_0x289585(_0x222e6e[_0xad3c('0x10')](0x1f4,_0x38bdd4[_0xad3c('0x11')]));});});};exports[_0xad3c('0x1a')]=function(_0x4e3a46){var _0x1a85af=this;return new Promise(function(_0x48f48a,_0x350c0a){return db[_0xad3c('0x14')][_0xad3c('0x1b')](_0x4e3a46['body'],{'raw':_0x4e3a46[_0xad3c('0x16')]?_0x4e3a46[_0xad3c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e3a46[_0xad3c('0x16')]?_0x4e3a46[_0xad3c('0x16')][_0xad3c('0x1c')]||null:null,'attributes':_0x4e3a46[_0xad3c('0x16')]?_0x4e3a46[_0xad3c('0x16')][_0xad3c('0x1d')]||null:null,'limit':_0x4e3a46[_0xad3c('0x16')]?_0x4e3a46['options'][_0xad3c('0x1e')]||null:null})['then'](function(_0x145805){logger['info'](_0xad3c('0x1a'),_0x4e3a46);logger['debug'](_0xad3c('0x1a'),_0x4e3a46,JSON['stringify'](_0x145805));_0x48f48a(_0x145805);})[_0xad3c('0x13')](function(_0x4ef3a8){logger[_0xad3c('0x10')](_0xad3c('0x1a'),_0x4ef3a8[_0xad3c('0x11')],_0x4e3a46);_0x350c0a(_0x1a85af[_0xad3c('0x10')](0x1f4,_0x4ef3a8['message']));});});};
\ No newline at end of file
index 00992d5..e4ce998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x665f=['exports','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','destroy'];(function(_0x110dcf,_0x5cc131){var _0x265d6c=function(_0x485fac){while(--_0x485fac){_0x110dcf['push'](_0x110dcf['shift']());}};_0x265d6c(++_0x5cc131);}(_0x665f,0x1c9));var _0xf665=function(_0x3119e0,_0x5ed5f8){_0x3119e0=_0x3119e0-0x0;var _0xb39f77=_0x665f[_0x3119e0];return _0xb39f77;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xf665('0x0'));var express=require('express');var router=express[_0xf665('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf665('0x2'));var config=require(_0xf665('0x3'));var controller=require(_0xf665('0x4'));router[_0xf665('0x5')]('/',auth['isAuthenticated'](),controller[_0xf665('0x6')]);router['get'](_0xf665('0x7'),auth[_0xf665('0x8')](),controller[_0xf665('0x9')]);router[_0xf665('0xa')]('/',auth[_0xf665('0x8')](),controller[_0xf665('0xb')]);router[_0xf665('0xa')](_0xf665('0xc'),auth[_0xf665('0x8')](),controller[_0xf665('0xd')]);router[_0xf665('0xe')](_0xf665('0x7'),auth[_0xf665('0x8')](),controller[_0xf665('0xf')]);router[_0xf665('0x10')]('/:id',auth[_0xf665('0x8')](),controller[_0xf665('0x11')]);module[_0xf665('0x12')]=router;
\ No newline at end of file
+var _0x116f=['./voiceExtension.controller','isAuthenticated','index','get','show','post','create','/:id/applications','addApplications','put','update','/:id','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x116f,0x1c7));var _0xf116=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x116f[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf116('0x0'));var timeout=require(_0xf116('0x1'));var express=require(_0xf116('0x2'));var router=express[_0xf116('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf116('0x4'));var interaction=require(_0xf116('0x5'));var config=require(_0xf116('0x6'));var controller=require(_0xf116('0x7'));router['get']('/',auth[_0xf116('0x8')](),controller[_0xf116('0x9')]);router[_0xf116('0xa')]('/:id',auth[_0xf116('0x8')](),controller[_0xf116('0xb')]);router[_0xf116('0xc')]('/',auth[_0xf116('0x8')](),controller[_0xf116('0xd')]);router['post'](_0xf116('0xe'),auth[_0xf116('0x8')](),controller[_0xf116('0xf')]);router[_0xf116('0x10')]('/:id',auth[_0xf116('0x8')](),controller[_0xf116('0x11')]);router['delete'](_0xf116('0x12'),auth[_0xf116('0x8')](),controller[_0xf116('0x13')]);module[_0xf116('0x14')]=router;
\ No newline at end of file
index 3b99ffb..165c256 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc62c=['VIRTUAL','getDataValue','exten','sequelize','exports','compositeIndex','STRING','NoOp','inbound','outbound','inbound-fax','outbound-fax','system','any','BOOLEAN'];(function(_0x1bdaae,_0x551d92){var _0x39e693=function(_0x25c3e5){while(--_0x25c3e5){_0x1bdaae['push'](_0x1bdaae['shift']());}};_0x39e693(++_0x551d92);}(_0xc62c,0x120));var _0xcc62=function(_0x427e1b,_0x4c3898){_0x427e1b=_0x427e1b-0x0;var _0x962ac0=_0xc62c[_0x427e1b];return _0x962ac0;};'use strict';var Sequelize=require(_0xcc62('0x0'));module[_0xcc62('0x1')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcc62('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xcc62('0x3')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xcc62('0x3')],'allowNull':![],'defaultValue':'1','unique':_0xcc62('0x2')},'tag':{'type':Sequelize[_0xcc62('0x3')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xcc62('0x3')],'allowNull':![],'defaultValue':_0xcc62('0x4')},'appdata':{'type':Sequelize[_0xcc62('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xcc62('0x5'),_0xcc62('0x6'),'internal',_0xcc62('0x7'),_0xcc62('0x8'),_0xcc62('0x9'),_0xcc62('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcc62('0x3')],'allowNull':![],'defaultValue':'*,*,*,*'},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xcc62('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xcc62('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xcc62('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xcc62('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xcc62('0x3')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0xcc62('0xc')],'get':function(_0x408b54){return this[_0xcc62('0xd')](_0xcc62('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0xaf26=['STRING','compositeIndex','ENUM','inbound','internal','outbound-fax','system','*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','exports'];(function(_0x42c175,_0x4011b7){var _0x45e1c5=function(_0x10f2e6){while(--_0x10f2e6){_0x42c175['push'](_0x42c175['shift']());}};_0x45e1c5(++_0x4011b7);}(_0xaf26,0x125));var _0x6af2=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xaf26[_0x245afe];return _0x4eefde;};'use strict';var Sequelize=require('sequelize');module[_0x6af2('0x0')]={'context':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![],'unique':_0x6af2('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6af2('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6af2('0x2')},'tag':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize[_0x6af2('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6af2('0x3')](_0x6af2('0x4'),'outbound',_0x6af2('0x5'),'inbound-fax',_0x6af2('0x6'),_0x6af2('0x7'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0x6af2('0x1')]},'interval':{'type':Sequelize[_0x6af2('0x1')],'allowNull':![],'defaultValue':_0x6af2('0x8')},'IntervalId':{'type':Sequelize[_0x6af2('0x9')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6af2('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6af2('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6af2('0x9')]},'recordingFormat':{'type':Sequelize[_0x6af2('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x6af2('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6af2('0xb')],'get':function(_0x4b1b7f){return this[_0x6af2('0xc')](_0x6af2('0xd'));}},'alias':{'type':Sequelize[_0x6af2('0x1')],'allowNull':!![]}};
\ No newline at end of file
index d567020..1ef8773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac6=['limit','count','offset','set','Content-Range','destroy','then','get','inbound','outbound','internal','filter','value','includes','type','find','name','UserProfileResource','end','error','stack','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','VIRTUAL','merge','includeAll','include','VoiceExtension','findAll','rows','catch','show','params','keys','options','create','body','exten','concat','user','OutboundRoutes','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','undefined'];(function(_0x86956,_0x34f00d){var _0x6f9b6=function(_0x505306){while(--_0x505306){_0x86956['push'](_0x86956['shift']());}};_0x6f9b6(++_0x34f00d);}(_0x8ac6,0x108));var _0x68ac=function(_0x12dd63,_0x5b6858){_0x12dd63=_0x12dd63-0x0;var _0x144ea7=_0x8ac6[_0x12dd63];return _0x144ea7;};'use strict';var _=require(_0x68ac('0x0'));var Redis=require(_0x68ac('0x1'));var qs=require(_0x68ac('0x2'));var logger=require(_0x68ac('0x3'))(_0x68ac('0x4'));var config=require(_0x68ac('0x5'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x68ac('0x6')](config[_0x68ac('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x68ac('0x8'))(new Redis(config['redis']));require(_0x68ac('0x9'))[_0x68ac('0xa')](socket);function respondWithStatusCode(_0x2703b2,_0x56fc07){_0x56fc07=_0x56fc07||0xcc;return function(_0x1e3fbe){if(_0x1e3fbe){return _0x2703b2[_0x68ac('0xb')](_0x56fc07);}return _0x2703b2[_0x68ac('0xc')](_0x56fc07)['end']();};}function respondWithResult(_0x39d8f9,_0x45dd8c){_0x45dd8c=_0x45dd8c||0xc8;return function(_0x2dc520){if(_0x2dc520){return _0x39d8f9['status'](_0x45dd8c)[_0x68ac('0xd')](_0x2dc520);}};}function respondWithFilteredResult(_0x44a0c7,_0xf5129b){return function(_0x3781bc){if(_0x3781bc){var _0x54426e=typeof _0xf5129b['offset']===_0x68ac('0xe')&&typeof _0xf5129b[_0x68ac('0xf')]===_0x68ac('0xe');var _0x42a2ec=_0x3781bc[_0x68ac('0x10')];var _0x4d0767=_0x54426e?0x0:_0xf5129b[_0x68ac('0x11')];var _0xedd400=_0x54426e?_0x3781bc[_0x68ac('0x10')]:_0xf5129b[_0x68ac('0x11')]+_0xf5129b[_0x68ac('0xf')];var _0x547d09;if(_0xedd400>=_0x42a2ec){_0xedd400=_0x42a2ec;_0x547d09=0xc8;}else{_0x547d09=0xce;}_0x44a0c7['status'](_0x547d09);return _0x44a0c7[_0x68ac('0x12')](_0x68ac('0x13'),_0x4d0767+'-'+_0xedd400+'/'+_0x42a2ec)[_0x68ac('0xd')](_0x3781bc);}return null;};}function removeEntity(_0x4a727a){return function(_0x4c9a35){if(_0x4c9a35){return _0x4c9a35[_0x68ac('0x14')]()[_0x68ac('0x15')](function(){var _0x48972a=_0x4c9a35[_0x68ac('0x16')]({'plain':!![]});var _0x33e754=[{'name':'InboundRoutes','value':_0x68ac('0x17'),'ignore':![]},{'name':'OutboundRoutes','value':_0x68ac('0x18'),'ignore':![]},{'name':'InternalRoutes','value':_0x68ac('0x19'),'ignore':![]}];var _0x153191=_(_0x33e754)[_0x68ac('0x1a')]('ignore')['map'](_0x68ac('0x1b'))[_0x68ac('0x1b')]();if(_[_0x68ac('0x1c')](_0x153191,_0x48972a[_0x68ac('0x1d')])){return;}var _0x1a4f49=_[_0x68ac('0x1e')](_0x33e754,[_0x68ac('0x1b'),_0x48972a[_0x68ac('0x1d')]])[_0x68ac('0x1f')];return db[_0x68ac('0x20')][_0x68ac('0x14')]({'where':{'type':_0x1a4f49,'resourceId':_0x48972a['id']}})['then'](function(){return _0x4c9a35;});})[_0x68ac('0x15')](function(){_0x4a727a['status'](0xcc)[_0x68ac('0x21')]();});}};}function handleEntityNotFound(_0x38c708){return function(_0x467b81){if(!_0x467b81){_0x38c708[_0x68ac('0xb')](0x194);}return _0x467b81;};}function handleError(_0x1e5a27,_0x4bac9a){_0x4bac9a=_0x4bac9a||0x1f4;return function(_0x19b0ce){logger[_0x68ac('0x22')](_0x19b0ce[_0x68ac('0x23')]);if(_0x19b0ce['name']){delete _0x19b0ce[_0x68ac('0x1f')];}_0x1e5a27[_0x68ac('0xc')](_0x4bac9a)['send'](_0x19b0ce);};}exports[_0x68ac('0x24')]=function(_0x5de3c6,_0x3de514){var _0x23b399={},_0x1a175c={},_0x14d3e6={'count':0x0,'rows':[]};var _0x433bec=_[_0x68ac('0x25')](db['VoiceExtension'][_0x68ac('0x26')],function(_0x33e61d){return{'name':_0x33e61d[_0x68ac('0x27')],'type':_0x33e61d[_0x68ac('0x1d')][_0x68ac('0x28')]};});_0x1a175c[_0x68ac('0x29')]=_['map'](_0x433bec,_0x68ac('0x1f'));_0x1a175c[_0x68ac('0x2a')]=_['keys'](_0x5de3c6['query']);_0x1a175c['filters']=_[_0x68ac('0x2b')](_0x1a175c[_0x68ac('0x29')],_0x1a175c[_0x68ac('0x2a')]);_0x23b399[_0x68ac('0x2c')]=_[_0x68ac('0x2b')](_0x1a175c['model'],qs[_0x68ac('0x2d')](_0x5de3c6[_0x68ac('0x2a')][_0x68ac('0x2d')]));_0x23b399['attributes']=_0x23b399[_0x68ac('0x2c')][_0x68ac('0x2e')]?_0x23b399[_0x68ac('0x2c')]:_0x1a175c['model'];if(!_0x5de3c6[_0x68ac('0x2a')][_0x68ac('0x2f')](_0x68ac('0x30'))){_0x23b399[_0x68ac('0xf')]=qs[_0x68ac('0xf')](_0x5de3c6['query'][_0x68ac('0xf')]);_0x23b399['offset']=qs[_0x68ac('0x11')](_0x5de3c6[_0x68ac('0x2a')][_0x68ac('0x11')]);}_0x23b399[_0x68ac('0x31')]=qs[_0x68ac('0x32')](_0x5de3c6[_0x68ac('0x2a')]['sort']);_0x23b399[_0x68ac('0x33')]=qs[_0x68ac('0x34')](_[_0x68ac('0x35')](_0x5de3c6[_0x68ac('0x2a')],_0x1a175c[_0x68ac('0x34')]),_0x433bec);if(_0x5de3c6['query'][_0x68ac('0x1a')]){_0x23b399[_0x68ac('0x33')]=_['merge'](_0x23b399[_0x68ac('0x33')],{'$or':_['map'](_0x433bec,function(_0x46e2de){if(_0x46e2de['type']!==_0x68ac('0x36')){var _0x35aecd={};_0x35aecd[_0x46e2de[_0x68ac('0x1f')]]={'$like':'%'+_0x5de3c6[_0x68ac('0x2a')][_0x68ac('0x1a')]+'%'};return _0x35aecd;}})});}_0x23b399=_[_0x68ac('0x37')]({},_0x23b399,_0x5de3c6['options']);var _0x193dd4={'where':_0x23b399[_0x68ac('0x33')]};return db['VoiceExtension'][_0x68ac('0x10')](_0x193dd4)['then'](function(_0x35111a){_0x14d3e6['count']=_0x35111a;if(_0x5de3c6[_0x68ac('0x2a')][_0x68ac('0x38')]){_0x23b399[_0x68ac('0x39')]=[{'all':!![]}];}return db[_0x68ac('0x3a')][_0x68ac('0x3b')](_0x23b399);})[_0x68ac('0x15')](function(_0x29c90e){_0x14d3e6[_0x68ac('0x3c')]=_0x29c90e;return _0x14d3e6;})[_0x68ac('0x15')](respondWithFilteredResult(_0x3de514,_0x23b399))[_0x68ac('0x3d')](handleError(_0x3de514,null));};exports[_0x68ac('0x3e')]=function(_0xaaf1ec,_0xf6b26e){var _0xfb149b={'raw':![],'where':{'id':_0xaaf1ec[_0x68ac('0x3f')]['id']}},_0x11157c={};_0x11157c[_0x68ac('0x29')]=_['keys'](db['VoiceExtension']['rawAttributes']);_0x11157c[_0x68ac('0x2a')]=_[_0x68ac('0x40')](_0xaaf1ec[_0x68ac('0x2a')]);_0x11157c[_0x68ac('0x34')]=_[_0x68ac('0x2b')](_0x11157c[_0x68ac('0x29')],_0x11157c[_0x68ac('0x2a')]);_0xfb149b['attributes']=_[_0x68ac('0x2b')](_0x11157c[_0x68ac('0x29')],qs[_0x68ac('0x2d')](_0xaaf1ec[_0x68ac('0x2a')][_0x68ac('0x2d')]));_0xfb149b[_0x68ac('0x2c')]=_0xfb149b[_0x68ac('0x2c')][_0x68ac('0x2e')]?_0xfb149b['attributes']:_0x11157c[_0x68ac('0x29')];if(_0xaaf1ec[_0x68ac('0x2a')][_0x68ac('0x38')]){_0xfb149b[_0x68ac('0x39')]=[{'all':!![]}];}_0xfb149b=_[_0x68ac('0x37')]({},_0xfb149b,_0xaaf1ec[_0x68ac('0x41')]);return db[_0x68ac('0x3a')]['find'](_0xfb149b)[_0x68ac('0x15')](handleEntityNotFound(_0xf6b26e,null))[_0x68ac('0x15')](respondWithResult(_0xf6b26e,null))[_0x68ac('0x3d')](handleError(_0xf6b26e,null));};exports[_0x68ac('0x14')]=function(_0x20684a,_0x39a279){return db[_0x68ac('0x3a')][_0x68ac('0x1e')]({'where':{'id':_0x20684a[_0x68ac('0x3f')]['id']}})[_0x68ac('0x15')](handleEntityNotFound(_0x39a279,null))[_0x68ac('0x15')](removeEntity(_0x39a279,null))[_0x68ac('0x3d')](handleError(_0x39a279,null));};exports[_0x68ac('0x42')]=function(_0x2bdeb0,_0x102291){if(_0x2bdeb0[_0x68ac('0x43')]['type']===_0x68ac('0x18')&&!_['startsWith'](_0x2bdeb0[_0x68ac('0x43')][_0x68ac('0x44')],'_')){_0x2bdeb0[_0x68ac('0x43')]['exten']='_'[_0x68ac('0x45')](_0x2bdeb0[_0x68ac('0x43')][_0x68ac('0x44')]);}return db['VoiceExtension'][_0x68ac('0x42')](_0x2bdeb0[_0x68ac('0x43')],{'raw':![]})[_0x68ac('0x15')](function(_0x3adb75){var _0x2914d0=_0x2bdeb0[_0x68ac('0x46')][_0x68ac('0x16')]({'plain':!![]});if(!_0x2914d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2914d0['role']===_0x68ac('0x46')){var _0x2aa505=_0x3adb75[_0x68ac('0x16')]({'plain':!![]});var _0x51e8ad=[{'name':'InboundRoutes','value':_0x68ac('0x17')},{'name':_0x68ac('0x47'),'value':_0x68ac('0x18')},{'name':_0x68ac('0x48'),'value':_0x68ac('0x19')}];var _0x993d5=_[_0x68ac('0x1e')](_0x51e8ad,['value',_0x2aa505['type']])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x993d5,'userProfileId':_0x2914d0[_0x68ac('0x49')]},'raw':!![]})['then'](function(_0x1acc25){if(_0x1acc25&&_0x1acc25[_0x68ac('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x2aa505['name'],'resourceId':_0x2aa505['id'],'type':_0x1acc25['name'],'sectionId':_0x1acc25['id']},{})[_0x68ac('0x15')](function(){return _0x3adb75;});}else{return _0x3adb75;}})['catch'](function(_0x25a647){logger['error'](_0x68ac('0x4b'),_0x25a647);throw _0x25a647;});}return _0x3adb75;})[_0x68ac('0x15')](respondWithResult(_0x102291,0xc9))[_0x68ac('0x3d')](handleError(_0x102291,null));};exports[_0x68ac('0x4c')]=function(_0x3940eb,_0x18db32){if(_0x3940eb[_0x68ac('0x43')]['id']){delete _0x3940eb[_0x68ac('0x43')]['id'];}return db[_0x68ac('0x3a')]['find']({'where':{'id':_0x3940eb[_0x68ac('0x3f')]['id']}})[_0x68ac('0x15')](handleEntityNotFound(_0x18db32,null))['then'](function(_0x914f94){if(_0x914f94){return db[_0x68ac('0x3a')][_0x68ac('0x4c')](_[_0x68ac('0x35')](_0x3940eb[_0x68ac('0x43')],[_0x68ac('0x44'),_0x68ac('0x4d'),_0x68ac('0x4e'),_0x68ac('0x4f'),_0x68ac('0x50'),'mandatoryDisposition','alias']),{'where':{'context':_0x914f94[_0x68ac('0x4d')],'exten':_0x914f94[_0x68ac('0x44')]},'individualHooks':!![]})[_0x68ac('0x15')](function(_0x1df1b9){return _0x1df1b9;});}return null;})[_0x68ac('0x15')](respondWithStatusCode(_0x18db32,null))[_0x68ac('0x3d')](handleError(_0x18db32,null));};exports[_0x68ac('0x51')]=function(_0x3fd7f2,_0x2a4d07){var _0x4ba3a7=_0x3fd7f2[_0x68ac('0x3f')]['id'];var _0x1f275f=_0x3fd7f2['body'];var _0x412820=0xc8;var _0x5a7da9=null;return db['sequelize'][_0x68ac('0x52')]({'isolationLevel':db[_0x68ac('0x53')][_0x68ac('0x54')][_0x68ac('0x55')][_0x68ac('0x56')]},function(_0x515bbb){return db[_0x68ac('0x3a')][_0x68ac('0x57')]({'where':{'id':_0x4ba3a7},'transaction':_0x515bbb})[_0x68ac('0x15')](function(_0x57a26f){if(_0x57a26f){return db[_0x68ac('0x3a')]['destroy']({'where':{'VoiceExtensionId':_0x4ba3a7},'transaction':_0x515bbb})[_0x68ac('0x15')](function(){var _0x30f0a8=_[_0x68ac('0x25')](_0x1f275f,function(_0x488645){_0x488645[_0x68ac('0x58')]=_0x4ba3a7;_0x488645['isApp']=!![];return _0x488645;});return _0x57a26f[_0x68ac('0x59')](_0x30f0a8);})[_0x68ac('0x15')](function(_0x40c702){return db['VoiceExtension']['bulkCreate'](_0x40c702,{'transaction':_0x515bbb});});}else{_0x412820=0x194;_0x5a7da9=[];}});})['then'](function(){if(_0x412820!==0x194){return db[_0x68ac('0x3a')][_0x68ac('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4ba3a7},'order':_0x68ac('0x5b')})[_0x68ac('0x15')](function(_0x2a4326){_0x5a7da9=_0x2a4326;});}})[_0x68ac('0x3d')](function(_0x1264ae){_0x412820=0x1f4;logger[_0x68ac('0x22')](_0x1264ae['stack']);if(_0x1264ae[_0x68ac('0x1f')]){delete _0x1264ae[_0x68ac('0x1f')];}_0x5a7da9=_0x1264ae;})[_0x68ac('0x5c')](function(){if(_0x5a7da9===null){_0x2a4d07[_0x68ac('0xb')](_0x412820);}else{if(_0x412820===0x1f4){_0x2a4d07[_0x68ac('0xc')](_0x412820)['send'](_0x5a7da9);}else{_0x2a4d07[_0x68ac('0xc')](_0x412820)[_0x68ac('0xd')](_0x5a7da9);}}});};
\ No newline at end of file
+var _0x7ae8=['VoiceExtension','findAll','rows','catch','show','includeAll','include','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','update','context','mandatoryDisposition','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','finally','json','../../config/logger','../../config/environment','defaults','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','set','Content-Range','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','map','value','find','type','name','UserProfileResource','then','sendStatus','error','stack','send','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','merge','options'];(function(_0x290a86,_0xd8b82){var _0x2581fa=function(_0x481218){while(--_0x481218){_0x290a86['push'](_0x290a86['shift']());}};_0x2581fa(++_0xd8b82);}(_0x7ae8,0xd8));var _0x87ae=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7ae8[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x87ae('0x0'))('api');var config=require(_0x87ae('0x1'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x87ae('0x2')](config['redis'],{'host':_0x87ae('0x3'),'port':0x18eb});var socket=require(_0x87ae('0x4'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x87ae('0x5')](socket);function respondWithStatusCode(_0x4977be,_0x4a7fe8){_0x4a7fe8=_0x4a7fe8||0xcc;return function(_0x280bc2){if(_0x280bc2){return _0x4977be['sendStatus'](_0x4a7fe8);}return _0x4977be[_0x87ae('0x6')](_0x4a7fe8)[_0x87ae('0x7')]();};}function respondWithResult(_0x4f2e42,_0x4997e7){_0x4997e7=_0x4997e7||0xc8;return function(_0x275008){if(_0x275008){return _0x4f2e42[_0x87ae('0x6')](_0x4997e7)['json'](_0x275008);}};}function respondWithFilteredResult(_0x24c113,_0xab2a76){return function(_0x1c1775){if(_0x1c1775){var _0x1d670d=typeof _0xab2a76[_0x87ae('0x8')]===_0x87ae('0x9')&&typeof _0xab2a76[_0x87ae('0xa')]===_0x87ae('0x9');var _0x54af39=_0x1c1775[_0x87ae('0xb')];var _0x5adc72=_0x1d670d?0x0:_0xab2a76[_0x87ae('0x8')];var _0x43c54f=_0x1d670d?_0x1c1775[_0x87ae('0xb')]:_0xab2a76[_0x87ae('0x8')]+_0xab2a76[_0x87ae('0xa')];var _0x58b2b2;if(_0x43c54f>=_0x54af39){_0x43c54f=_0x54af39;_0x58b2b2=0xc8;}else{_0x58b2b2=0xce;}_0x24c113[_0x87ae('0x6')](_0x58b2b2);return _0x24c113[_0x87ae('0xc')](_0x87ae('0xd'),_0x5adc72+'-'+_0x43c54f+'/'+_0x54af39)['json'](_0x1c1775);}return null;};}function removeEntity(_0x4994b0){return function(_0x4e8f08){if(_0x4e8f08){return _0x4e8f08[_0x87ae('0xe')]()['then'](function(){var _0x332e0f=_0x4e8f08[_0x87ae('0xf')]({'plain':!![]});var _0x1800dc=[{'name':_0x87ae('0x10'),'value':_0x87ae('0x11'),'ignore':![]},{'name':_0x87ae('0x12'),'value':_0x87ae('0x13'),'ignore':![]},{'name':'InternalRoutes','value':_0x87ae('0x14'),'ignore':![]}];var _0x202a60=_(_0x1800dc)[_0x87ae('0x15')](_0x87ae('0x16'))[_0x87ae('0x17')](_0x87ae('0x18'))['value']();if(_['includes'](_0x202a60,_0x332e0f['type'])){return;}var _0x1aa6ff=_[_0x87ae('0x19')](_0x1800dc,['value',_0x332e0f[_0x87ae('0x1a')]])[_0x87ae('0x1b')];return db[_0x87ae('0x1c')][_0x87ae('0xe')]({'where':{'type':_0x1aa6ff,'resourceId':_0x332e0f['id']}})[_0x87ae('0x1d')](function(){return _0x4e8f08;});})[_0x87ae('0x1d')](function(){_0x4994b0['status'](0xcc)[_0x87ae('0x7')]();});}};}function handleEntityNotFound(_0x2fc0e7){return function(_0x34df63){if(!_0x34df63){_0x2fc0e7[_0x87ae('0x1e')](0x194);}return _0x34df63;};}function handleError(_0x5e9f50,_0xcabb82){_0xcabb82=_0xcabb82||0x1f4;return function(_0x5063e5){logger[_0x87ae('0x1f')](_0x5063e5[_0x87ae('0x20')]);if(_0x5063e5[_0x87ae('0x1b')]){delete _0x5063e5[_0x87ae('0x1b')];}_0x5e9f50[_0x87ae('0x6')](_0xcabb82)[_0x87ae('0x21')](_0x5063e5);};}exports['index']=function(_0x433c83,_0x23eaad){var _0xe05edf={},_0x24dec2={},_0x1d3b39={'count':0x0,'rows':[]};var _0x59d37a=_['map'](db['VoiceExtension'][_0x87ae('0x22')],function(_0x4e52d5){return{'name':_0x4e52d5[_0x87ae('0x23')],'type':_0x4e52d5['type'][_0x87ae('0x24')]};});_0x24dec2[_0x87ae('0x25')]=_[_0x87ae('0x17')](_0x59d37a,'name');_0x24dec2[_0x87ae('0x26')]=_[_0x87ae('0x27')](_0x433c83[_0x87ae('0x26')]);_0x24dec2[_0x87ae('0x28')]=_[_0x87ae('0x29')](_0x24dec2[_0x87ae('0x25')],_0x24dec2['query']);_0xe05edf[_0x87ae('0x2a')]=_[_0x87ae('0x29')](_0x24dec2[_0x87ae('0x25')],qs[_0x87ae('0x2b')](_0x433c83['query']['fields']));_0xe05edf[_0x87ae('0x2a')]=_0xe05edf[_0x87ae('0x2a')][_0x87ae('0x2c')]?_0xe05edf[_0x87ae('0x2a')]:_0x24dec2[_0x87ae('0x25')];if(!_0x433c83[_0x87ae('0x26')][_0x87ae('0x2d')](_0x87ae('0x2e'))){_0xe05edf[_0x87ae('0xa')]=qs['limit'](_0x433c83[_0x87ae('0x26')]['limit']);_0xe05edf[_0x87ae('0x8')]=qs['offset'](_0x433c83[_0x87ae('0x26')][_0x87ae('0x8')]);}_0xe05edf[_0x87ae('0x2f')]=qs[_0x87ae('0x30')](_0x433c83['query'][_0x87ae('0x30')]);_0xe05edf['where']=qs[_0x87ae('0x28')](_[_0x87ae('0x31')](_0x433c83[_0x87ae('0x26')],_0x24dec2[_0x87ae('0x28')]),_0x59d37a);if(_0x433c83[_0x87ae('0x26')]['filter']){_0xe05edf[_0x87ae('0x32')]=_['merge'](_0xe05edf[_0x87ae('0x32')],{'$or':_[_0x87ae('0x17')](_0x59d37a,function(_0x53f5ae){if(_0x53f5ae[_0x87ae('0x1a')]!==_0x87ae('0x33')){var _0x5dbb73={};_0x5dbb73[_0x53f5ae['name']]={'$like':'%'+_0x433c83['query'][_0x87ae('0x15')]+'%'};return _0x5dbb73;}})});}_0xe05edf=_[_0x87ae('0x34')]({},_0xe05edf,_0x433c83[_0x87ae('0x35')]);var _0x423ef0={'where':_0xe05edf['where']};return db['VoiceExtension'][_0x87ae('0xb')](_0x423ef0)['then'](function(_0x15c767){_0x1d3b39['count']=_0x15c767;if(_0x433c83[_0x87ae('0x26')]['includeAll']){_0xe05edf['include']=[{'all':!![]}];}return db[_0x87ae('0x36')][_0x87ae('0x37')](_0xe05edf);})[_0x87ae('0x1d')](function(_0x35e597){_0x1d3b39[_0x87ae('0x38')]=_0x35e597;return _0x1d3b39;})[_0x87ae('0x1d')](respondWithFilteredResult(_0x23eaad,_0xe05edf))[_0x87ae('0x39')](handleError(_0x23eaad,null));};exports[_0x87ae('0x3a')]=function(_0x457dfa,_0x19e268){var _0x44a447={'raw':![],'where':{'id':_0x457dfa['params']['id']}},_0x40b113={};_0x40b113[_0x87ae('0x25')]=_['keys'](db[_0x87ae('0x36')][_0x87ae('0x22')]);_0x40b113[_0x87ae('0x26')]=_[_0x87ae('0x27')](_0x457dfa['query']);_0x40b113[_0x87ae('0x28')]=_[_0x87ae('0x29')](_0x40b113[_0x87ae('0x25')],_0x40b113['query']);_0x44a447[_0x87ae('0x2a')]=_[_0x87ae('0x29')](_0x40b113[_0x87ae('0x25')],qs['fields'](_0x457dfa[_0x87ae('0x26')][_0x87ae('0x2b')]));_0x44a447[_0x87ae('0x2a')]=_0x44a447['attributes'][_0x87ae('0x2c')]?_0x44a447[_0x87ae('0x2a')]:_0x40b113[_0x87ae('0x25')];if(_0x457dfa['query'][_0x87ae('0x3b')]){_0x44a447[_0x87ae('0x3c')]=[{'all':!![]}];}_0x44a447=_[_0x87ae('0x34')]({},_0x44a447,_0x457dfa['options']);return db[_0x87ae('0x36')][_0x87ae('0x19')](_0x44a447)[_0x87ae('0x1d')](handleEntityNotFound(_0x19e268,null))['then'](respondWithResult(_0x19e268,null))[_0x87ae('0x39')](handleError(_0x19e268,null));};exports[_0x87ae('0xe')]=function(_0x14ec4c,_0x88162a){return db[_0x87ae('0x36')][_0x87ae('0x19')]({'where':{'id':_0x14ec4c['params']['id']}})[_0x87ae('0x1d')](handleEntityNotFound(_0x88162a,null))[_0x87ae('0x1d')](removeEntity(_0x88162a,null))[_0x87ae('0x39')](handleError(_0x88162a,null));};exports[_0x87ae('0x3d')]=function(_0x5dbede,_0x19de70){if(_0x5dbede[_0x87ae('0x3e')][_0x87ae('0x1a')]===_0x87ae('0x13')&&!_[_0x87ae('0x3f')](_0x5dbede['body'][_0x87ae('0x40')],'_')){_0x5dbede[_0x87ae('0x3e')][_0x87ae('0x40')]='_'['concat'](_0x5dbede['body'][_0x87ae('0x40')]);}return db[_0x87ae('0x36')][_0x87ae('0x3d')](_0x5dbede[_0x87ae('0x3e')],{'raw':![]})[_0x87ae('0x1d')](function(_0x5e5217){var _0x5d70a1=_0x5dbede[_0x87ae('0x41')]['get']({'plain':!![]});if(!_0x5d70a1)throw new Error(_0x87ae('0x42'));if(_0x5d70a1[_0x87ae('0x43')]===_0x87ae('0x41')){var _0x102efb=_0x5e5217[_0x87ae('0xf')]({'plain':!![]});var _0x142f06=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x87ae('0x12'),'value':_0x87ae('0x13')},{'name':_0x87ae('0x44'),'value':_0x87ae('0x14')}];var _0x3017d3=_['find'](_0x142f06,[_0x87ae('0x18'),_0x102efb['type']])[_0x87ae('0x1b')];return db[_0x87ae('0x45')][_0x87ae('0x19')]({'where':{'name':_0x3017d3,'userProfileId':_0x5d70a1['userProfileId']},'raw':!![]})['then'](function(_0x475f99){if(_0x475f99&&_0x475f99[_0x87ae('0x46')]===0x0){return db[_0x87ae('0x1c')]['create']({'name':_0x102efb['name'],'resourceId':_0x102efb['id'],'type':_0x475f99[_0x87ae('0x1b')],'sectionId':_0x475f99['id']},{})[_0x87ae('0x1d')](function(){return _0x5e5217;});}else{return _0x5e5217;}})[_0x87ae('0x39')](function(_0x4c8572){logger[_0x87ae('0x1f')](_0x87ae('0x47'),_0x4c8572);throw _0x4c8572;});}return _0x5e5217;})['then'](respondWithResult(_0x19de70,0xc9))[_0x87ae('0x39')](handleError(_0x19de70,null));};exports['update']=function(_0x52adfa,_0x16e871){if(_0x52adfa[_0x87ae('0x3e')]['id']){delete _0x52adfa[_0x87ae('0x3e')]['id'];}return db[_0x87ae('0x36')][_0x87ae('0x19')]({'where':{'id':_0x52adfa[_0x87ae('0x48')]['id']}})['then'](handleEntityNotFound(_0x16e871,null))['then'](function(_0x46b584){if(_0x46b584){return db[_0x87ae('0x36')][_0x87ae('0x49')](_[_0x87ae('0x31')](_0x52adfa['body'],[_0x87ae('0x40'),_0x87ae('0x4a'),'description','recordingFormat','cutdigits',_0x87ae('0x4b'),_0x87ae('0x4c')]),{'where':{'context':_0x46b584[_0x87ae('0x4a')],'exten':_0x46b584[_0x87ae('0x40')]},'individualHooks':!![]})[_0x87ae('0x1d')](function(_0x404af8){return _0x404af8;});}return null;})['then'](respondWithStatusCode(_0x16e871,null))[_0x87ae('0x39')](handleError(_0x16e871,null));};exports[_0x87ae('0x4d')]=function(_0x49786e,_0x269035){var _0x52a7f2=_0x49786e['params']['id'];var _0x3459f6=_0x49786e[_0x87ae('0x3e')];var _0x567764=0xc8;var _0x470947=null;return db[_0x87ae('0x4e')][_0x87ae('0x4f')]({'isolationLevel':db['sequelize']['Transaction'][_0x87ae('0x50')][_0x87ae('0x51')]},function(_0xd29668){return db[_0x87ae('0x36')][_0x87ae('0x52')]({'where':{'id':_0x52a7f2},'transaction':_0xd29668})[_0x87ae('0x1d')](function(_0x591726){if(_0x591726){return db[_0x87ae('0x36')]['destroy']({'where':{'VoiceExtensionId':_0x52a7f2},'transaction':_0xd29668})[_0x87ae('0x1d')](function(){var _0x4d0ec8=_['map'](_0x3459f6,function(_0xd97395){_0xd97395[_0x87ae('0x53')]=_0x52a7f2;_0xd97395[_0x87ae('0x54')]=!![];return _0xd97395;});return _0x591726[_0x87ae('0x55')](_0x4d0ec8);})['then'](function(_0x1fc042){return db[_0x87ae('0x36')][_0x87ae('0x56')](_0x1fc042,{'transaction':_0xd29668});});}else{_0x567764=0x194;_0x470947=[];}});})[_0x87ae('0x1d')](function(){if(_0x567764!==0x194){return db[_0x87ae('0x36')][_0x87ae('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x52a7f2},'order':'cast(priority\x20as\x20unsigned)'})[_0x87ae('0x1d')](function(_0x4c374d){_0x470947=_0x4c374d;});}})['catch'](function(_0x5e8634){_0x567764=0x1f4;logger[_0x87ae('0x1f')](_0x5e8634[_0x87ae('0x20')]);if(_0x5e8634['name']){delete _0x5e8634[_0x87ae('0x1b')];}_0x470947=_0x5e8634;})[_0x87ae('0x58')](function(){if(_0x470947===null){_0x269035['sendStatus'](_0x567764);}else{if(_0x567764===0x1f4){_0x269035['status'](_0x567764)[_0x87ae('0x21')](_0x470947);}else{_0x269035[_0x87ae('0x6')](_0x567764)[_0x87ae('0x59')](_0x470947);}}});};
\ No newline at end of file
index ae0d692..2aa9c3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f2b=['VoiceExtension','setMaxListeners','update','remove','emit','events','../../mysqldb'];(function(_0x1c7e5f,_0x1cccc7){var _0x3ca34a=function(_0x1c4861){while(--_0x1c4861){_0x1c7e5f['push'](_0x1c7e5f['shift']());}};_0x3ca34a(++_0x1cccc7);}(_0x0f2b,0xec));var _0xb0f2=function(_0x2b9a40,_0x5ba986){_0x2b9a40=_0x2b9a40-0x0;var _0x139836=_0x0f2b[_0x2b9a40];return _0x139836;};'use strict';var EventEmitter=require(_0xb0f2('0x0'));var VoiceExtension=require(_0xb0f2('0x1'))['db'][_0xb0f2('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb0f2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb0f2('0x4'),'afterDestroy':_0xb0f2('0x5')};function emitEvent(_0xda7b0d){return function(_0x3f7ef5,_0x35ae94,_0xc06b99){VoiceExtensionEvents[_0xb0f2('0x6')](_0xda7b0d+':'+_0x3f7ef5['id'],_0x3f7ef5);VoiceExtensionEvents[_0xb0f2('0x6')](_0xda7b0d,_0x3f7ef5);_0xc06b99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0x1ed8=['emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','save','remove'];(function(_0x265b5d,_0x3c201b){var _0x832ba3=function(_0x4d85a6){while(--_0x4d85a6){_0x265b5d['push'](_0x265b5d['shift']());}};_0x832ba3(++_0x3c201b);}(_0x1ed8,0x1ab));var _0x81ed=function(_0x1576ed,_0xfd8bab){_0x1576ed=_0x1576ed-0x0;var _0x4e5b48=_0x1ed8[_0x1576ed];return _0x4e5b48;};'use strict';var EventEmitter=require(_0x81ed('0x0'));var VoiceExtension=require(_0x81ed('0x1'))['db'][_0x81ed('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x81ed('0x3'),'afterUpdate':'update','afterDestroy':_0x81ed('0x4')};function emitEvent(_0x31254b){return function(_0x2bc9e6,_0x567f80,_0x3a8634){VoiceExtensionEvents[_0x81ed('0x5')](_0x31254b+':'+_0x2bc9e6['id'],_0x2bc9e6);VoiceExtensionEvents[_0x81ed('0x5')](_0x31254b,_0x2bc9e6);_0x3a8634(null);};}for(var e in events){if(events[_0x81ed('0x6')](e)){var event=events[e];VoiceExtension[_0x81ed('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index 9374507..8d5f01e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34aa=['hasOwnProperty','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','intervals','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','define','VoiceExtension','get','Hangup','lodash','exports','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','timeout','options','url','split','length','name','trunk','param','phone','prefix','${EXTEN}','indexOf','U(xcally-mixmonitor-context)','replace','join','Interval','findAll','interval','IntervalId','then','*,*,*,*','map','filter','toLowerCase'];(function(_0x4dea20,_0x240d4d){var _0x506586=function(_0x3ac3d6){while(--_0x3ac3d6){_0x4dea20['push'](_0x4dea20['shift']());}};_0x506586(++_0x240d4d);}(_0x34aa,0x171));var _0xa34a=function(_0x44d9ab,_0x76bc69){_0x44d9ab=_0x44d9ab-0x0;var _0x31485e=_0x34aa[_0x44d9ab];return _0x31485e;};'use strict';var _=require(_0xa34a('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xa34a('0x1')]=function(_0x1cc043){var _0xbb3857=_0x1cc043[_0xa34a('0x2')];function _0x496e55(_0x1d7a4f){var _0x30f3a2=0x2;var _0x284561=[{'type':_0x1d7a4f[_0xa34a('0x3')],'app':_0xa34a('0x4'),'appdata':_0xa34a('0x5')+_0x1d7a4f[_0xa34a('0x3')],'context':_0x1d7a4f[_0xa34a('0x6')],'exten':_0x1d7a4f[_0xa34a('0x7')],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']},{'type':_0x1d7a4f[_0xa34a('0x3')],'app':_0x1d7a4f[_0xa34a('0x8')]?'Set':_0xa34a('0x9'),'appdata':_0x1d7a4f[_0xa34a('0x8')]?_0xa34a('0xa')+_0x1d7a4f[_0xa34a('0x8')]:_0xa34a('0xb'),'context':_0x1d7a4f['context'],'exten':_0x1d7a4f[_0xa34a('0x7')],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']}];if(_0x1d7a4f[_0xa34a('0x3')]===_0xa34a('0xc')){_0x284561[_0xa34a('0xd')]({'type':_0xa34a('0xc'),'app':_0xa34a('0x4'),'appdata':_0xa34a('0xe')+_0x1d7a4f['id'],'context':_0x1d7a4f['context'],'exten':_0x1d7a4f[_0xa34a('0x7')],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']});}_0x284561[_0xa34a('0xd')]({'type':_0x1d7a4f[_0xa34a('0x3')],'app':'Set','appdata':_0xa34a('0xf'),'context':_0x1d7a4f[_0xa34a('0x6')],'exten':_0x1d7a4f['exten'],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']},{'type':_0x1d7a4f[_0xa34a('0x3')],'app':_0xa34a('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1d7a4f[_0xa34a('0x6')],'exten':_0x1d7a4f[_0xa34a('0x7')],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']},{'type':_0x1d7a4f[_0xa34a('0x3')],'app':_0xa34a('0x4'),'appdata':_0xa34a('0x10'),'context':_0x1d7a4f['context'],'exten':_0x1d7a4f[_0xa34a('0x7')],'priority':_0x30f3a2++,'VoiceExtensionId':_0x1d7a4f['id']});return _0x284561;}function _0x56f4da(_0x179ccf){var _0x14837d=0x2;var _0x3a05ca=[{'type':_0xa34a('0x11'),'app':'Set','appdata':_0xa34a('0x12'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0x179ccf[_0xa34a('0x8')]?'Set':_0xa34a('0x9'),'appdata':_0x179ccf[_0xa34a('0x8')]?_0xa34a('0xa')+_0x179ccf['alias']:_0xa34a('0xb'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':_0xa34a('0x13')+(_0x179ccf['cutdigits']?_0xa34a('0x14')+_0x179ccf[_0xa34a('0x15')]+'}':'${EXTEN}'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':_0xa34a('0xe')+_0x179ccf['id'],'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':'outbound','app':_0xa34a('0x16'),'appdata':_0xa34a('0x17')+(_0x14837d+0x2)+_0xa34a('0x18')+(_0x14837d+0x1)+')','context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf['exten'],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':_0x179ccf[_0xa34a('0x15')]?_0xa34a('0x19')+_0x179ccf['cutdigits']+'}':_0xa34a('0x1a'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':'Set','appdata':_0xa34a('0xf'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':'Set','appdata':_0xa34a('0x1b'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf['exten'],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x179ccf['context'],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':_0xa34a('0x1c')+_0x179ccf['id'],'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']}];if(_0x179ccf['hasOwnProperty'](_0xa34a('0x1d'))&&_0x179ccf[_0xa34a('0x1d')]!=='none'){_0x3a05ca[_0xa34a('0xd')]({'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':_0xa34a('0x1e'),'context':_0x179ccf['context'],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']},{'type':_0xa34a('0x11'),'app':_0xa34a('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x179ccf[_0xa34a('0x1d')]||_0xa34a('0x1f'),'context':_0x179ccf[_0xa34a('0x6')],'exten':_0x179ccf[_0xa34a('0x7')],'priority':_0x14837d++,'VoiceExtensionId':_0x179ccf['id']});}return _0x3a05ca;}function _0x40db44(_0xaa4208,_0x50fa82){var _0x4c7a6e=[{'name':'trunk','param':0x0},{'name':_0xa34a('0x20'),'param':0x1},{'name':_0xa34a('0x21'),'param':0x2},{'name':_0xa34a('0x22'),'param':0x3}];var _0x46dc84={};var _0x2fede6=_0x50fa82[_0xa34a('0x23')](',');var _0x58b8ba=[];for(var _0x40b0d2=0x0;_0x40b0d2<_0x4c7a6e[_0xa34a('0x24')];_0x40b0d2++){switch(_0x4c7a6e[_0x40b0d2][_0xa34a('0x25')]){case _0xa34a('0x26'):_0x46dc84[_0xa34a('0x26')]=_0x2fede6[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]]['split']('/')[0x1];_0x46dc84[_0xa34a('0x28')]=_0x2fede6[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]]['split']('/')[0x2];_0x46dc84[_0xa34a('0x29')]=_0x46dc84['phone']?_0x46dc84[_0xa34a('0x28')][_0xa34a('0x23')]('$')[0x0]:undefined;_0x46dc84[_0xa34a('0x28')]=_0xaa4208[_0xa34a('0x15')]?(_0x46dc84[_0xa34a('0x29')]||'')+_0xa34a('0x14')+_0xaa4208[_0xa34a('0x15')]+'}':(_0x46dc84[_0xa34a('0x29')]||'')+_0xa34a('0x2a');_0x58b8ba[_0x4c7a6e[_0x40b0d2]['param']]=['SIP',_0x46dc84[_0xa34a('0x26')],_0x46dc84[_0xa34a('0x28')]]['join']('/');break;case _0xa34a('0x21'):_0x46dc84[_0xa34a('0x21')]=_0x2fede6[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]];if(_0xaa4208[_0xa34a('0x1d')]!=='none'){if(_0x46dc84[_0xa34a('0x21')][_0xa34a('0x2b')](_0xa34a('0x2c'))<0x0){_0x46dc84[_0xa34a('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x46dc84['options']=_0x46dc84['options'][_0xa34a('0x2d')]('U(xcally-mixmonitor-context)','');}_0x58b8ba[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]]=_0x46dc84[_0xa34a('0x21')];break;default:_0x58b8ba[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]]=_0x2fede6[_0x4c7a6e[_0x40b0d2][_0xa34a('0x27')]];}}return _0x58b8ba[_0xa34a('0x2e')](',');}function _0x5bad23(_0x4366c3,_0x433b44,_0x2a3c37){return new Promise(function(_0xbbcdcb,_0x12ece9){var _0xeed2b1=[];if(_['isEmpty'](_0x433b44))return _0xbbcdcb(_0xeed2b1);_0xbb3857[_0xa34a('0x2f')][_0xa34a('0x30')]({'attributes':['id',_0xa34a('0x31'),_0xa34a('0x32')],'raw':!![]})[_0xa34a('0x33')](function(_0x2da0b5){for(var _0x5914dc=0x0,_0x37e9e5=0x0;_0x5914dc<_0x433b44['length'];_0x5914dc++,_0x37e9e5=0x0){var _0x3c3b4e=_0x433b44[_0x5914dc];var _0x1257a5=[];var _0xc128b8=[];delete _0x3c3b4e['id'];if(_0x3c3b4e['interval']!==_0xa34a('0x34')){_0x3c3b4e['intervals']=[_0x3c3b4e[_0xa34a('0x31')]];}else{_0x3c3b4e['intervals']=_0x3c3b4e[_0xa34a('0x32')]?_[_0xa34a('0x35')](_[_0xa34a('0x36')](_0x2da0b5,{'IntervalId':_0x3c3b4e[_0xa34a('0x32')]}),_0xa34a('0x31')):[];}_0x3c3b4e['context']=_0x4366c3[_0xa34a('0x6')];_0x3c3b4e['exten']=_0x4366c3[_0xa34a('0x7')];if(_0x3c3b4e[_0xa34a('0x3')])_0x3c3b4e[_0xa34a('0x3')]=_0x3c3b4e[_0xa34a('0x3')][_0xa34a('0x37')]();if(_0x4366c3[_0xa34a('0x3')]===_0xa34a('0x11')){if(_0x3c3b4e[_0xa34a('0x38')]('tag')&&_0x3c3b4e[_0xa34a('0x39')]&&_0x3c3b4e['tag']!=='--'){_0x1257a5['push']({'type':_0x3c3b4e['type'][_0xa34a('0x37')](),'app':'Set','appdata':_0xa34a('0x3a')+_0x3c3b4e[_0xa34a('0x39')],'context':_0x4366c3['context'],'exten':_0x4366c3[_0xa34a('0x7')],'priority':_0x3c3b4e['intervals'][_0xa34a('0x24')]+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});}_0x1257a5[_0xa34a('0xd')]({'type':_0x3c3b4e[_0xa34a('0x3')][_0xa34a('0x37')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x3c3b4e[_0xa34a('0x3b')]?_0xa34a('0x3c')+_0x3c3b4e[_0xa34a('0x3b')]+')':_0xa34a('0x3d')),'context':_0x4366c3[_0xa34a('0x6')],'exten':_0x4366c3[_0xa34a('0x7')],'priority':_0x3c3b4e[_0xa34a('0x3e')][_0xa34a('0x24')]+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});}else{if(_0x3c3b4e[_0xa34a('0x38')](_0xa34a('0x3f'))){if(['queue',_0xa34a('0x40')][_0xa34a('0x41')](_0x3c3b4e[_0xa34a('0x42')]['toLowerCase']())&&_0x3c3b4e[_0xa34a('0x43')]!==_0xa34a('0x44')){if(_0x3c3b4e['answer']){_0x1257a5['push']({'type':_0x3c3b4e[_0xa34a('0x3')][_0xa34a('0x37')](),'app':_0xa34a('0x16'),'appdata':_0xa34a('0x45'),'context':_0x4366c3[_0xa34a('0x6')],'exten':_0x4366c3['exten'],'priority':_0x3c3b4e[_0xa34a('0x3e')][_0xa34a('0x24')]+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});_0x1257a5[_0xa34a('0xd')]({'type':_0x3c3b4e[_0xa34a('0x3')][_0xa34a('0x37')](),'app':'Set','appdata':_0xa34a('0x46'),'context':_0x4366c3[_0xa34a('0x6')],'exten':_0x4366c3[_0xa34a('0x7')],'priority':_0x3c3b4e[_0xa34a('0x3e')][_0xa34a('0x24')]+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});}else{_0x1257a5['push']({'type':_0x3c3b4e[_0xa34a('0x3')]['toLowerCase'](),'app':_0xa34a('0x16'),'appdata':_0xa34a('0x47'),'context':_0x4366c3[_0xa34a('0x6')],'exten':_0x4366c3[_0xa34a('0x7')],'priority':_0x3c3b4e[_0xa34a('0x3e')]['length']+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});_0x1257a5[_0xa34a('0xd')]({'type':_0x3c3b4e['type'][_0xa34a('0x37')](),'app':'Set','appdata':_0xa34a('0x48'),'context':_0x4366c3[_0xa34a('0x6')],'exten':_0x4366c3['exten'],'priority':_0x3c3b4e[_0xa34a('0x3e')][_0xa34a('0x24')]+_0x2a3c37+_0x37e9e5++,'VoiceExtensionId':_0x4366c3['id']});}}}}for(var _0x5315b9=0x0;_0x5315b9<_0x3c3b4e[_0xa34a('0x3e')][_0xa34a('0x24')];_0x5315b9++){var _0x490708=_0x2a3c37+_0x3c3b4e['intervals'][_0xa34a('0x24')];var _0x5b5014=_0x5315b9===_0x3c3b4e['intervals'][_0xa34a('0x24')]-0x1?_0x2a3c37+_0x1257a5[_0xa34a('0x24')]+_0xc128b8[_0xa34a('0x24')]+0x2:_0x2a3c37+_0x5315b9+0x1;_0x1257a5[_0xa34a('0x49')](_0x5315b9,0x0,{'type':_0x4366c3[_0xa34a('0x3')],'app':'GotoIfTime','appdata':_0x3c3b4e['intervals'][_0x5315b9]+'?'+_0x4366c3[_0xa34a('0x6')]+_0xa34a('0x4a')+_0x490708+':'+_0x4366c3['context']+',${EXTEN},'+_0x5b5014,'exten':_0x4366c3[_0xa34a('0x7')],'context':_0x4366c3[_0xa34a('0x6')],'priority':_0x2a3c37+_0x5315b9,'VoiceExtensionId':_0x4366c3['id']});}if(_0x3c3b4e['appType']===_0xa34a('0x4b'))_0x3c3b4e[_0xa34a('0x4c')]=_0x40db44(_0x4366c3,_0x3c3b4e[_0xa34a('0x4c')]);_0x3c3b4e['priority']=_0x1257a5[_0xa34a('0x24')]?_[_0xa34a('0x4d')](_0x1257a5)[_0xa34a('0x4e')]+0x1:_0x2a3c37;_0xeed2b1=_[_0xa34a('0x4f')](_0xeed2b1,_0x1257a5,[_0x3c3b4e],_0xc128b8);_0x2a3c37=_[_0xa34a('0x4d')](_0xeed2b1)['priority']+0x1;}return _0xbbcdcb(_0xeed2b1);})[_0xa34a('0x50')](function(_0xf07d3d){_0x12ece9(_0xf07d3d);});});}return _0x1cc043[_0xa34a('0x51')](_0xa34a('0x52'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x459ba7){var _0x5de8e3=this[_0xa34a('0x53')]({'plain':!![]});var _0x20dfb5=_0x5de8e3['type']==='outbound'?_0x56f4da(_0x5de8e3):_0x496e55(_0x5de8e3);return _0x5bad23(_0x5de8e3,_0x459ba7,_['last'](_0x20dfb5)[_0xa34a('0x4e')]+0x1)[_0xa34a('0x33')](function(_0x49f8f4){var _0x45461b=_[_0xa34a('0x4f')](_0x20dfb5,_0x49f8f4);_0x45461b[_0xa34a('0xd')]({'type':_0x5de8e3['type'],'app':_0xa34a('0x54'),'exten':_0x5de8e3[_0xa34a('0x7')],'context':_0x5de8e3[_0xa34a('0x6')],'priority':_[_0xa34a('0x4d')](_0x45461b)['priority']+0x1,'VoiceExtensionId':_0x5de8e3['id']});return _0x45461b;});}}});};
\ No newline at end of file
+var _0x9a14=[',${EXTEN},','outboundDial','priority','last','catch','define','VoiceExtension','voice_extensions','then','Hangup','exports','models','context','exten','type','Set','NoOp','alias','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','timeout','options','url','split','length','name','param','prefix','phone','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','*,*,*,*','intervals','map','IntervalId','toLowerCase','tag','CDR(tag)=','callerID','NoOp(No\x20number\x20available)','queue','playback','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime'];(function(_0x190e94,_0x117fc1){var _0x3012a0=function(_0x500c69){while(--_0x500c69){_0x190e94['push'](_0x190e94['shift']());}};_0x3012a0(++_0x117fc1);}(_0x9a14,0xa8));var _0x49a1=function(_0x12cbf6,_0x2f1c48){_0x12cbf6=_0x12cbf6-0x0;var _0x1b68ca=_0x9a14[_0x12cbf6];return _0x1b68ca;};'use strict';var _=require('lodash');var attributes=require('./voiceExtension.attributes');module[_0x49a1('0x0')]=function(_0x3bfde6){var _0x10e23c=_0x3bfde6[_0x49a1('0x1')];function _0x1efead(_0x26467b){var _0x10de2e=0x2;var _0x453ecf=[{'type':_0x26467b['type'],'app':'Set','appdata':'CDR(type)='+_0x26467b['type'],'context':_0x26467b[_0x49a1('0x2')],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']},{'type':_0x26467b[_0x49a1('0x4')],'app':_0x26467b['alias']?_0x49a1('0x5'):_0x49a1('0x6'),'appdata':_0x26467b[_0x49a1('0x7')]?'CDR(routeAlias)='+_0x26467b[_0x49a1('0x7')]:_0x49a1('0x8'),'context':_0x26467b['context'],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']}];if(_0x26467b[_0x49a1('0x4')]===_0x49a1('0x9')){_0x453ecf[_0x49a1('0xa')]({'type':_0x49a1('0x9'),'app':'Set','appdata':_0x49a1('0xb')+_0x26467b['id'],'context':_0x26467b[_0x49a1('0x2')],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']});}_0x453ecf[_0x49a1('0xa')]({'type':_0x26467b[_0x49a1('0x4')],'app':_0x49a1('0x5'),'appdata':_0x49a1('0xc'),'context':_0x26467b[_0x49a1('0x2')],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']},{'type':_0x26467b[_0x49a1('0x4')],'app':_0x49a1('0x5'),'appdata':_0x49a1('0xd'),'context':_0x26467b[_0x49a1('0x2')],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']},{'type':_0x26467b[_0x49a1('0x4')],'app':'Set','appdata':_0x49a1('0xe'),'context':_0x26467b[_0x49a1('0x2')],'exten':_0x26467b[_0x49a1('0x3')],'priority':_0x10de2e++,'VoiceExtensionId':_0x26467b['id']});return _0x453ecf;}function _0x479ceb(_0x450237){var _0x7b53dc=0x2;var _0x561ac4=[{'type':_0x49a1('0xf'),'app':'Set','appdata':_0x49a1('0x10'),'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237['exten'],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x450237['alias']?_0x49a1('0x5'):_0x49a1('0x6'),'appdata':_0x450237[_0x49a1('0x7')]?'CDR(routeAlias)='+_0x450237[_0x49a1('0x7')]:_0x49a1('0x8'),'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':'CDR(destination)='+(_0x450237[_0x49a1('0x11')]?_0x49a1('0x12')+_0x450237[_0x49a1('0x11')]+'}':'${EXTEN}'),'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':'Set','appdata':'CDR(routeid)='+_0x450237['id'],'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x13'),'appdata':_0x49a1('0x14')+(_0x7b53dc+0x2)+_0x49a1('0x15')+(_0x7b53dc+0x1)+')','context':_0x450237[_0x49a1('0x2')],'exten':_0x450237['exten'],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':_0x450237[_0x49a1('0x11')]?_0x49a1('0x16')+_0x450237[_0x49a1('0x11')]+'}':_0x49a1('0x17'),'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':'outbound','app':_0x49a1('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x450237['context'],'exten':_0x450237['exten'],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':_0x49a1('0xd'),'context':_0x450237['context'],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':_0x49a1('0xe'),'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':_0x49a1('0x18')+_0x450237['id'],'context':_0x450237[_0x49a1('0x2')],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']}];if(_0x450237[_0x49a1('0x19')](_0x49a1('0x1a'))&&_0x450237[_0x49a1('0x1a')]!==_0x49a1('0x1b')){_0x561ac4[_0x49a1('0xa')]({'type':'outbound','app':_0x49a1('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x450237['context'],'exten':_0x450237[_0x49a1('0x3')],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']},{'type':_0x49a1('0xf'),'app':_0x49a1('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x450237[_0x49a1('0x1a')]||_0x49a1('0x1c'),'context':_0x450237['context'],'exten':_0x450237['exten'],'priority':_0x7b53dc++,'VoiceExtensionId':_0x450237['id']});}return _0x561ac4;}function _0x319f22(_0xc9a483,_0x1eba12){var _0x45a9ce=[{'name':_0x49a1('0x1d'),'param':0x0},{'name':_0x49a1('0x1e'),'param':0x1},{'name':_0x49a1('0x1f'),'param':0x2},{'name':_0x49a1('0x20'),'param':0x3}];var _0x1581f2={};var _0x16b113=_0x1eba12[_0x49a1('0x21')](',');var _0x43eee7=[];for(var _0x45105b=0x0;_0x45105b<_0x45a9ce[_0x49a1('0x22')];_0x45105b++){switch(_0x45a9ce[_0x45105b][_0x49a1('0x23')]){case _0x49a1('0x1d'):_0x1581f2['trunk']=_0x16b113[_0x45a9ce[_0x45105b][_0x49a1('0x24')]][_0x49a1('0x21')]('/')[0x1];_0x1581f2['phone']=_0x16b113[_0x45a9ce[_0x45105b][_0x49a1('0x24')]]['split']('/')[0x2];_0x1581f2[_0x49a1('0x25')]=_0x1581f2[_0x49a1('0x26')]?_0x1581f2['phone'][_0x49a1('0x21')]('$')[0x0]:undefined;_0x1581f2[_0x49a1('0x26')]=_0xc9a483[_0x49a1('0x11')]?(_0x1581f2[_0x49a1('0x25')]||'')+_0x49a1('0x12')+_0xc9a483[_0x49a1('0x11')]+'}':(_0x1581f2[_0x49a1('0x25')]||'')+_0x49a1('0x27');_0x43eee7[_0x45a9ce[_0x45105b][_0x49a1('0x24')]]=[_0x49a1('0x28'),_0x1581f2[_0x49a1('0x1d')],_0x1581f2[_0x49a1('0x26')]][_0x49a1('0x29')]('/');break;case _0x49a1('0x1f'):_0x1581f2[_0x49a1('0x1f')]=_0x16b113[_0x45a9ce[_0x45105b][_0x49a1('0x24')]];if(_0xc9a483[_0x49a1('0x1a')]!==_0x49a1('0x1b')){if(_0x1581f2['options'][_0x49a1('0x2a')](_0x49a1('0x2b'))<0x0){_0x1581f2[_0x49a1('0x1f')]+=_0x49a1('0x2b');}}else{_0x1581f2[_0x49a1('0x1f')]=_0x1581f2[_0x49a1('0x1f')]['replace'](_0x49a1('0x2b'),'');}_0x43eee7[_0x45a9ce[_0x45105b][_0x49a1('0x24')]]=_0x1581f2[_0x49a1('0x1f')];break;default:_0x43eee7[_0x45a9ce[_0x45105b]['param']]=_0x16b113[_0x45a9ce[_0x45105b][_0x49a1('0x24')]];}}return _0x43eee7['join'](',');}function _0x4f7d07(_0x14afe1,_0x174fd8,_0x27bf5a){return new Promise(function(_0x45e125,_0x1295ca){var _0x487ffb=[];if(_[_0x49a1('0x2c')](_0x174fd8))return _0x45e125(_0x487ffb);_0x10e23c[_0x49a1('0x2d')][_0x49a1('0x2e')]({'attributes':['id',_0x49a1('0x2f'),'IntervalId'],'raw':!![]})['then'](function(_0x2a18dd){for(var _0x38648d=0x0,_0x5d3624=0x0;_0x38648d<_0x174fd8[_0x49a1('0x22')];_0x38648d++,_0x5d3624=0x0){var _0x46cf6a=_0x174fd8[_0x38648d];var _0x56c520=[];var _0x41acb1=[];delete _0x46cf6a['id'];if(_0x46cf6a[_0x49a1('0x2f')]!==_0x49a1('0x30')){_0x46cf6a[_0x49a1('0x31')]=[_0x46cf6a[_0x49a1('0x2f')]];}else{_0x46cf6a[_0x49a1('0x31')]=_0x46cf6a['IntervalId']?_[_0x49a1('0x32')](_['filter'](_0x2a18dd,{'IntervalId':_0x46cf6a[_0x49a1('0x33')]}),_0x49a1('0x2f')):[];}_0x46cf6a[_0x49a1('0x2')]=_0x14afe1[_0x49a1('0x2')];_0x46cf6a[_0x49a1('0x3')]=_0x14afe1[_0x49a1('0x3')];if(_0x46cf6a[_0x49a1('0x4')])_0x46cf6a['type']=_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')]();if(_0x14afe1[_0x49a1('0x4')]===_0x49a1('0xf')){if(_0x46cf6a['hasOwnProperty'](_0x49a1('0x35'))&&_0x46cf6a[_0x49a1('0x35')]&&_0x46cf6a[_0x49a1('0x35')]!=='--'){_0x56c520[_0x49a1('0xa')]({'type':_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')](),'app':_0x49a1('0x5'),'appdata':_0x49a1('0x36')+_0x46cf6a[_0x49a1('0x35')],'context':_0x14afe1['context'],'exten':_0x14afe1[_0x49a1('0x3')],'priority':_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});}_0x56c520[_0x49a1('0xa')]({'type':_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')](),'app':_0x49a1('0x13'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x46cf6a[_0x49a1('0x37')]?'Set(CALLERID(all)='+_0x46cf6a[_0x49a1('0x37')]+')':_0x49a1('0x38')),'context':_0x14afe1[_0x49a1('0x2')],'exten':_0x14afe1[_0x49a1('0x3')],'priority':_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});}else{if(_0x46cf6a[_0x49a1('0x19')]('answer')){if([_0x49a1('0x39'),_0x49a1('0x3a')]['includes'](_0x46cf6a[_0x49a1('0x3b')][_0x49a1('0x34')]())&&_0x46cf6a[_0x49a1('0x3c')]!==_0x49a1('0x3d')){if(_0x46cf6a[_0x49a1('0x3e')]){_0x56c520['push']({'type':_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')](),'app':_0x49a1('0x13'),'appdata':_0x49a1('0x3f'),'context':_0x14afe1[_0x49a1('0x2')],'exten':_0x14afe1[_0x49a1('0x3')],'priority':_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});_0x56c520[_0x49a1('0xa')]({'type':_0x46cf6a['type'][_0x49a1('0x34')](),'app':_0x49a1('0x5'),'appdata':_0x49a1('0x40'),'context':_0x14afe1['context'],'exten':_0x14afe1[_0x49a1('0x3')],'priority':_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});}else{_0x56c520[_0x49a1('0xa')]({'type':_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')](),'app':_0x49a1('0x13'),'appdata':_0x49a1('0x41'),'context':_0x14afe1['context'],'exten':_0x14afe1['exten'],'priority':_0x46cf6a['intervals'][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});_0x56c520[_0x49a1('0xa')]({'type':_0x46cf6a[_0x49a1('0x4')][_0x49a1('0x34')](),'app':_0x49a1('0x5'),'appdata':_0x49a1('0x42'),'context':_0x14afe1[_0x49a1('0x2')],'exten':_0x14afe1[_0x49a1('0x3')],'priority':_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')]+_0x27bf5a+_0x5d3624++,'VoiceExtensionId':_0x14afe1['id']});}}}}for(var _0x2ffccb=0x0;_0x2ffccb<_0x46cf6a[_0x49a1('0x31')][_0x49a1('0x22')];_0x2ffccb++){var _0x7ccd4=_0x27bf5a+_0x46cf6a['intervals']['length'];var _0x559cac=_0x2ffccb===_0x46cf6a[_0x49a1('0x31')]['length']-0x1?_0x27bf5a+_0x56c520['length']+_0x41acb1[_0x49a1('0x22')]+0x2:_0x27bf5a+_0x2ffccb+0x1;_0x56c520[_0x49a1('0x43')](_0x2ffccb,0x0,{'type':_0x14afe1[_0x49a1('0x4')],'app':_0x49a1('0x44'),'appdata':_0x46cf6a[_0x49a1('0x31')][_0x2ffccb]+'?'+_0x14afe1[_0x49a1('0x2')]+_0x49a1('0x45')+_0x7ccd4+':'+_0x14afe1['context']+_0x49a1('0x45')+_0x559cac,'exten':_0x14afe1[_0x49a1('0x3')],'context':_0x14afe1[_0x49a1('0x2')],'priority':_0x27bf5a+_0x2ffccb,'VoiceExtensionId':_0x14afe1['id']});}if(_0x46cf6a[_0x49a1('0x3c')]===_0x49a1('0x46'))_0x46cf6a['appdata']=_0x319f22(_0x14afe1,_0x46cf6a['appdata']);_0x46cf6a[_0x49a1('0x47')]=_0x56c520[_0x49a1('0x22')]?_[_0x49a1('0x48')](_0x56c520)['priority']+0x1:_0x27bf5a;_0x487ffb=_['concat'](_0x487ffb,_0x56c520,[_0x46cf6a],_0x41acb1);_0x27bf5a=_[_0x49a1('0x48')](_0x487ffb)[_0x49a1('0x47')]+0x1;}return _0x45e125(_0x487ffb);})[_0x49a1('0x49')](function(_0x1160cf){_0x1295ca(_0x1160cf);});});}return _0x3bfde6[_0x49a1('0x4a')](_0x49a1('0x4b'),attributes,{'tableName':_0x49a1('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x45b8c1){var _0x524c4e=this['get']({'plain':!![]});var _0x4c9c5d=_0x524c4e[_0x49a1('0x4')]===_0x49a1('0xf')?_0x479ceb(_0x524c4e):_0x1efead(_0x524c4e);return _0x4f7d07(_0x524c4e,_0x45b8c1,_['last'](_0x4c9c5d)['priority']+0x1)[_0x49a1('0x4d')](function(_0x309149){var _0x53276e=_['concat'](_0x4c9c5d,_0x309149);_0x53276e['push']({'type':_0x524c4e['type'],'app':_0x49a1('0x4e'),'exten':_0x524c4e[_0x49a1('0x3')],'context':_0x524c4e[_0x49a1('0x2')],'priority':_[_0x49a1('0x48')](_0x53276e)[_0x49a1('0x47')]+0x1,'VoiceExtensionId':_0x524c4e['id']});return _0x53276e;});}}});};
\ No newline at end of file
index 0b49d4b..d762f8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22da=['localhost','socket.io-emitter','register','request','info','VoiceExtension,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','include','map','model','GetVoiceExtension','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis'];(function(_0x29a4a7,_0x56af1d){var _0x16ecfd=function(_0x1ba227){while(--_0x1ba227){_0x29a4a7['push'](_0x29a4a7['shift']());}};_0x16ecfd(++_0x56af1d);}(_0x22da,0x80));var _0xa22d=function(_0x32b785,_0x35e7e2){_0x32b785=_0x32b785-0x0;var _0x3dcf28=_0x22da[_0x32b785];return _0x3dcf28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa22d('0x0'));var BPromise=require(_0xa22d('0x1'));var rs=require(_0xa22d('0x2'));var fs=require('fs');var Redis=require(_0xa22d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa22d('0x4'));var logger=require(_0xa22d('0x5'))(_0xa22d('0x6'));var config=require(_0xa22d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa22d('0x8')][_0xa22d('0x9')]({'port':0x232a});config['redis']=_[_0xa22d('0xa')](config[_0xa22d('0xb')],{'host':_0xa22d('0xc'),'port':0x18eb});var socket=require(_0xa22d('0xd'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0xa22d('0xe')](socket);function respondWithRpcPromise(_0x122102,_0x4dfff8,_0x312520){return new BPromise(function(_0xc742bb,_0x471738){return client[_0xa22d('0xf')](_0x122102,_0x312520)['then'](function(_0x5d25b1){logger[_0xa22d('0x10')](_0xa22d('0x11'),_0x4dfff8,'request\x20sent');logger[_0xa22d('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x4dfff8,_0xa22d('0x13'),JSON[_0xa22d('0x14')](_0x5d25b1));if(_0x5d25b1[_0xa22d('0x15')]){if(_0x5d25b1['error'][_0xa22d('0x16')]===0x1f4){logger[_0xa22d('0x15')](_0xa22d('0x11'),_0x4dfff8,_0x5d25b1[_0xa22d('0x15')][_0xa22d('0x17')]);return _0x471738(_0x5d25b1['error'][_0xa22d('0x17')]);}logger[_0xa22d('0x15')](_0xa22d('0x11'),_0x4dfff8,_0x5d25b1[_0xa22d('0x15')][_0xa22d('0x17')]);return _0xc742bb(_0x5d25b1[_0xa22d('0x15')][_0xa22d('0x17')]);}else{logger[_0xa22d('0x10')](_0xa22d('0x11'),_0x4dfff8,_0xa22d('0x13'));_0xc742bb(_0x5d25b1[_0xa22d('0x18')][_0xa22d('0x17')]);}})[_0xa22d('0x19')](function(_0x256ba0){logger[_0xa22d('0x15')](_0xa22d('0x11'),_0x4dfff8,_0x256ba0);_0x471738(_0x256ba0);});});}exports['GetVoiceExtension']=function(_0x177a0f){var _0x194d74=this;return new Promise(function(_0xd96a44,_0x4ed606){return db['VoiceExtension']['findAll']({'raw':_0x177a0f[_0xa22d('0x1a')]?_0x177a0f[_0xa22d('0x1a')][_0xa22d('0x1b')]===undefined?!![]:![]:!![],'where':_0x177a0f['options']?_0x177a0f[_0xa22d('0x1a')][_0xa22d('0x1c')]||null:null,'attributes':_0x177a0f[_0xa22d('0x1a')]?_0x177a0f['options'][_0xa22d('0x1d')]||null:null,'limit':_0x177a0f[_0xa22d('0x1a')]?_0x177a0f['options'][_0xa22d('0x1e')]||null:null,'include':_0x177a0f[_0xa22d('0x1a')]?_0x177a0f[_0xa22d('0x1a')][_0xa22d('0x1f')]?_[_0xa22d('0x20')](_0x177a0f[_0xa22d('0x1a')][_0xa22d('0x1f')],function(_0x58aa49){return{'model':db[_0x58aa49['model']],'as':_0x58aa49['as'],'attributes':_0x58aa49[_0xa22d('0x1d')],'include':_0x58aa49[_0xa22d('0x1f')]?_[_0xa22d('0x20')](_0x58aa49[_0xa22d('0x1f')],function(_0x33b1c9){return{'model':db[_0x33b1c9[_0xa22d('0x21')]],'as':_0x33b1c9['as'],'attributes':_0x33b1c9[_0xa22d('0x1d')],'include':_0x33b1c9[_0xa22d('0x1f')]?_[_0xa22d('0x20')](_0x33b1c9[_0xa22d('0x1f')],function(_0x594ac5){return{'model':db[_0x594ac5['model']],'as':_0x594ac5['as'],'attributes':_0x594ac5[_0xa22d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550dd7){logger[_0xa22d('0x10')](_0xa22d('0x22'),_0x177a0f);logger[_0xa22d('0x12')](_0xa22d('0x22'),_0x177a0f,JSON[_0xa22d('0x14')](_0x550dd7));_0xd96a44(_0x550dd7);})[_0xa22d('0x19')](function(_0x1ef634){logger[_0xa22d('0x15')]('GetVoiceExtension',_0x1ef634[_0xa22d('0x17')],_0x177a0f);_0x4ed606(_0x194d74[_0xa22d('0x15')](0x1f4,_0x1ef634[_0xa22d('0x17')]));});});};
\ No newline at end of file
+var _0xbd51=['include','model','map','then','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit'];(function(_0x543d65,_0xa907db){var _0x1cc2d8=function(_0x201ec1){while(--_0x201ec1){_0x543d65['push'](_0x543d65['shift']());}};_0x1cc2d8(++_0xa907db);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x49dc80,_0x5f260e){_0x49dc80=_0x49dc80-0x0;var _0x2da8dc=_0xbd51[_0x49dc80];return _0x2da8dc;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var moment=require(_0x1bd5('0x1'));var BPromise=require(_0x1bd5('0x2'));var rs=require(_0x1bd5('0x3'));var fs=require('fs');var Redis=require(_0x1bd5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1bd5('0x5'));var jayson=require(_0x1bd5('0x6'));var client=jayson[_0x1bd5('0x7')]['http']({'port':0x232a});config[_0x1bd5('0x8')]=_[_0x1bd5('0x9')](config[_0x1bd5('0x8')],{'host':_0x1bd5('0xa'),'port':0x18eb});var socket=require(_0x1bd5('0xb'))(new Redis(config['redis']));require(_0x1bd5('0xc'))['register'](socket);function respondWithRpcPromise(_0x2bd975,_0x28df8e,_0x3b868a){return new BPromise(function(_0x1fbc68,_0x2344e1){return client[_0x1bd5('0xd')](_0x2bd975,_0x3b868a)['then'](function(_0x456ef8){logger['info'](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));logger[_0x1bd5('0x10')](_0x1bd5('0x11'),_0x28df8e,_0x1bd5('0xf'),JSON[_0x1bd5('0x12')](_0x456ef8));if(_0x456ef8[_0x1bd5('0x13')]){if(_0x456ef8['error']['code']===0x1f4){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x2344e1(_0x456ef8['error']['message']);}logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);return _0x1fbc68(_0x456ef8[_0x1bd5('0x13')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xe'),_0x28df8e,_0x1bd5('0xf'));_0x1fbc68(_0x456ef8['result']['message']);}})[_0x1bd5('0x16')](function(_0x260827){logger[_0x1bd5('0x13')](_0x1bd5('0xe'),_0x28df8e,_0x260827);_0x2344e1(_0x260827);});});}exports[_0x1bd5('0x17')]=function(_0x2ff39a){var _0x3fbb39=this;return new Promise(function(_0x2a746d,_0x456051){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1d')]||null:null,'limit':_0x2ff39a['options']?_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1e')]||null:null,'include':_0x2ff39a[_0x1bd5('0x1a')]?_0x2ff39a['options'][_0x1bd5('0x1f')]?_['map'](_0x2ff39a[_0x1bd5('0x1a')][_0x1bd5('0x1f')],function(_0x3dba4f){return{'model':db[_0x3dba4f[_0x1bd5('0x20')]],'as':_0x3dba4f['as'],'attributes':_0x3dba4f['attributes'],'include':_0x3dba4f[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3dba4f[_0x1bd5('0x1f')],function(_0x3b1090){return{'model':db[_0x3b1090['model']],'as':_0x3b1090['as'],'attributes':_0x3b1090[_0x1bd5('0x1d')],'include':_0x3b1090[_0x1bd5('0x1f')]?_[_0x1bd5('0x21')](_0x3b1090[_0x1bd5('0x1f')],function(_0xe54b9f){return{'model':db[_0xe54b9f[_0x1bd5('0x20')]],'as':_0xe54b9f['as'],'attributes':_0xe54b9f['attributes']};}):[]};}):[]};}):[]:[]})[_0x1bd5('0x22')](function(_0x472b22){logger[_0x1bd5('0x15')]('GetVoiceExtension',_0x2ff39a);logger[_0x1bd5('0x10')](_0x1bd5('0x17'),_0x2ff39a,JSON[_0x1bd5('0x12')](_0x472b22));_0x2a746d(_0x472b22);})[_0x1bd5('0x16')](function(_0x1f4456){logger[_0x1bd5('0x13')]('GetVoiceExtension',_0x1f4456['message'],_0x2ff39a);_0x456051(_0x3fbb39[_0x1bd5('0x13')](0x1f4,_0x1f4456[_0x1bd5('0x14')]));});});};
\ No newline at end of file
index f9b92b9..a4b3abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['remove','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save'];(function(_0x121282,_0x40110a){var _0x5d33a3=function(_0x2537f5){while(--_0x2537f5){_0x121282['push'](_0x121282['shift']());}};_0x5d33a3(++_0x40110a);}(_0x7a54,0x106));var _0x47a5=function(_0x1c2496,_0x151efd){_0x1c2496=_0x1c2496-0x0;var _0x1928bb=_0x7a54[_0x1c2496];return _0x1928bb;};'use strict';var VoiceExtensionEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){VoiceExtensionEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);VoiceExtensionEvents['on'](_0x30e405,_0x506eda);}};
\ No newline at end of file
+var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x15cece,_0x19147f){var _0x182734=function(_0x12c3c1){while(--_0x12c3c1){_0x15cece['push'](_0x15cece['shift']());}};_0x182734(++_0x19147f);}(_0x2ef3,0xba));var _0x32ef=function(_0x36a00b,_0x161484){_0x36a00b=_0x36a00b-0x0;var _0x3c2837=_0x2ef3[_0x36a00b];return _0x3c2837;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}};
\ No newline at end of file
index ee2b72a..13a7934 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd4=['post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/messages'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9fd4,0x16c));var _0x49fd=function(_0x35c1db,_0xd75c15){_0x35c1db=_0x35c1db-0x0;var _0x4173ff=_0x9fd4[_0x35c1db];return _0x4173ff;};'use strict';var multer=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var path=require(_0x49fd('0x2'));var timeout=require(_0x49fd('0x3'));var express=require(_0x49fd('0x4'));var router=express[_0x49fd('0x5')]();var fs_extra=require(_0x49fd('0x6'));var auth=require(_0x49fd('0x7'));var interaction=require(_0x49fd('0x8'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x49fd('0x9')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xb')]);router[_0x49fd('0x9')]('/:id',auth[_0x49fd('0xa')](),controller[_0x49fd('0xc')]);router[_0x49fd('0x9')](_0x49fd('0xd'),auth[_0x49fd('0xa')](),controller['getMessages']);router[_0x49fd('0xe')]('/',auth[_0x49fd('0xa')](),controller[_0x49fd('0xf')]);router[_0x49fd('0x10')](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x12')]);router['delete'](_0x49fd('0x11'),auth[_0x49fd('0xa')](),controller[_0x49fd('0x13')]);module[_0x49fd('0x14')]=router;
\ No newline at end of file
+var _0x741c=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMail.controller'];(function(_0xa81aeb,_0x4928a9){var _0x3c7880=function(_0x18462d){while(--_0x18462d){_0xa81aeb['push'](_0xa81aeb['shift']());}};_0x3c7880(++_0x4928a9);}(_0x741c,0x196));var _0xc741=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x741c[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xc741('0x0'));var util=require(_0xc741('0x1'));var path=require(_0xc741('0x2'));var timeout=require(_0xc741('0x3'));var express=require(_0xc741('0x4'));var router=express[_0xc741('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc741('0x6'));var config=require('../../config/environment');var controller=require(_0xc741('0x7'));router[_0xc741('0x8')]('/',auth[_0xc741('0x9')](),controller[_0xc741('0xa')]);router[_0xc741('0x8')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller['show']);router[_0xc741('0x8')](_0xc741('0xc'),auth['isAuthenticated'](),controller[_0xc741('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc741('0xe')]);router[_0xc741('0xf')](_0xc741('0xb'),auth[_0xc741('0x9')](),controller[_0xc741('0x10')]);router[_0xc741('0x11')](_0xc741('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index a0dd227..850e9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e89=['INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','STRING','from-voicemail','contest_mailbox','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x276301,_0x215837){var _0x42fe3a=function(_0x3bb10a){while(--_0x3bb10a){_0x276301['push'](_0x276301['shift']());}};_0x42fe3a(++_0x215837);}(_0x3e89,0xf5));var _0x93e8=function(_0xff2408,_0x160185){_0xff2408=_0xff2408-0x0;var _0x1b937a=_0x3e89[_0xff2408];return _0x1b937a;};'use strict';var Sequelize=require(_0x93e8('0x0'));module['exports']={'customer_id':{'type':Sequelize[_0x93e8('0x1')]},'context':{'type':Sequelize[_0x93e8('0x1')],'defaultValue':_0x93e8('0x2'),'unique':_0x93e8('0x3')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x93e8('0x3')},'password':{'type':Sequelize[_0x93e8('0x1')]},'fullname':{'type':Sequelize[_0x93e8('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0xdc2a1a){this['setDataValue'](_0x93e8('0x4'),typeof _0xdc2a1a===_0x93e8('0x5')&&_0xdc2a1a[_0x93e8('0x6')]()?_0xdc2a1a[_0x93e8('0x6')]():null);}},'pager':{'type':Sequelize[_0x93e8('0x1')]},'tz':{'type':Sequelize[_0x93e8('0x1')],'defaultValue':_0x93e8('0x7')},'attach':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x93e8('0x9')](_0x93e8('0x8'),'no'),'defaultValue':_0x93e8('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0x93e8('0x1')]},'callback':{'type':Sequelize[_0x93e8('0x1')]},'review':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x93e8('0x9')](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x93e8('0x9')](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x93e8('0x9')](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x93e8('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x93e8('0x9')](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':_0x93e8('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x93e8('0x8'),'no'),'defaultValue':_0x93e8('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x93e8('0x1')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x93e8('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x93e8('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x93e8('0xc')],'get':function(){return this[_0x93e8('0xd')](_0x93e8('0xe'))+'\x20-\x20'+this[_0x93e8('0xd')](_0x93e8('0xf'));}}};
\ No newline at end of file
+var _0x300b=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','exports','STRING','from-voicemail','email','string','trim','central'];(function(_0x1f97e8,_0x445a4a){var _0x1ed77c=function(_0x1c990d){while(--_0x1c990d){_0x1f97e8['push'](_0x1f97e8['shift']());}};_0x1ed77c(++_0x445a4a);}(_0x300b,0xa9));var _0xb300=function(_0x137f29,_0x45a377){_0x137f29=_0x137f29-0x0;var _0x4776bf=_0x300b[_0x137f29];return _0x4776bf;};'use strict';var Sequelize=require('sequelize');module[_0xb300('0x0')]={'customer_id':{'type':Sequelize[_0xb300('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xb300('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0xb300('0x1')]},'fullname':{'type':Sequelize[_0xb300('0x1')]},'email':{'type':Sequelize[_0xb300('0x1')],'validate':{'isEmail':!![]},'set':function(_0x539e8c){this['setDataValue'](_0xb300('0x3'),typeof _0x539e8c===_0xb300('0x4')&&_0x539e8c[_0xb300('0x5')]()?_0x539e8c[_0xb300('0x5')]():null);}},'pager':{'type':Sequelize[_0xb300('0x1')]},'tz':{'type':Sequelize[_0xb300('0x1')],'defaultValue':_0xb300('0x6')},'attach':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':_0xb300('0x8'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xb300('0x8'),'no'),'defaultValue':_0xb300('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xb300('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xb300('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xb300('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':_0xb300('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xb300('0x7')](_0xb300('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xb300('0xa')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0xb300('0x1')]},'maxsecs':{'type':Sequelize[_0xb300('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xb300('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xb300('0xc')],'get':function(){return this[_0xb300('0xd')](_0xb300('0xe'))+_0xb300('0xf')+this['getDataValue']('mailbox');}}};
\ No newline at end of file
index 5f9a853..32b3d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d2d=['sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','fields','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','catch','update','find','getMessages','findOne','VoiceMailMessage','nolimit','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x584308,_0x1379b3){var _0x45865b=function(_0x145a82){while(--_0x145a82){_0x584308['push'](_0x584308['shift']());}};_0x45865b(++_0x1379b3);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x3583cb,_0x494521){_0x3583cb=_0x3583cb-0x0;var _0x37300e=_0x1d2d[_0x3583cb];return _0x37300e;};'use strict';var emlformat=require(_0xd1d2('0x0'));var rimraf=require(_0xd1d2('0x1'));var zipdir=require(_0xd1d2('0x2'));var jsonpatch=require(_0xd1d2('0x3'));var rp=require(_0xd1d2('0x4'));var moment=require('moment');var BPromise=require(_0xd1d2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd1d2('0x6'));var sox=require(_0xd1d2('0x7'));var csv=require(_0xd1d2('0x8'));var ejs=require(_0xd1d2('0x9'));var fs=require('fs');var fs_extra=require(_0xd1d2('0xa'));var _=require(_0xd1d2('0xb'));var squel=require('squel');var crypto=require(_0xd1d2('0xc'));var jsforce=require(_0xd1d2('0xd'));var deskjs=require(_0xd1d2('0xe'));var toCsv=require(_0xd1d2('0x8'));var querystring=require(_0xd1d2('0xf'));var Papa=require(_0xd1d2('0x10'));var Redis=require(_0xd1d2('0x11'));var authService=require(_0xd1d2('0x12'));var qs=require(_0xd1d2('0x13'));var as=require(_0xd1d2('0x14'));var hardwareService=require(_0xd1d2('0x15'));var logger=require(_0xd1d2('0x16'))(_0xd1d2('0x17'));var utils=require('../../config/utils');var config=require(_0xd1d2('0x18'));var licenseUtil=require(_0xd1d2('0x19'));var db=require(_0xd1d2('0x1a'))['db'];function respondWithStatusCode(_0x33f088,_0x129d8f){_0x129d8f=_0x129d8f||0xcc;return function(_0xc3ee82){if(_0xc3ee82){return _0x33f088[_0xd1d2('0x1b')](_0x129d8f);}return _0x33f088[_0xd1d2('0x1c')](_0x129d8f)[_0xd1d2('0x1d')]();};}function respondWithResult(_0x3f670f,_0x4cf702){_0x4cf702=_0x4cf702||0xc8;return function(_0x2e7fec){if(_0x2e7fec){return _0x3f670f[_0xd1d2('0x1c')](_0x4cf702)[_0xd1d2('0x1e')](_0x2e7fec);}};}function respondWithFilteredResult(_0x56de25,_0x35381b){return function(_0xc36ce){if(_0xc36ce){var _0x208425=typeof _0x35381b[_0xd1d2('0x1f')]===_0xd1d2('0x20')&&typeof _0x35381b[_0xd1d2('0x21')]===_0xd1d2('0x20');var _0x57f2f9=_0xc36ce['count'];var _0x3be186=_0x208425?0x0:_0x35381b['offset'];var _0x247b3a=_0x208425?_0xc36ce[_0xd1d2('0x22')]:_0x35381b[_0xd1d2('0x1f')]+_0x35381b[_0xd1d2('0x21')];var _0x4ab386;if(_0x247b3a>=_0x57f2f9){_0x247b3a=_0x57f2f9;_0x4ab386=0xc8;}else{_0x4ab386=0xce;}_0x56de25['status'](_0x4ab386);return _0x56de25[_0xd1d2('0x23')]('Content-Range',_0x3be186+'-'+_0x247b3a+'/'+_0x57f2f9)['json'](_0xc36ce);}return null;};}function patchUpdates(_0x1ab67c){return function(_0x27e26b){try{jsonpatch[_0xd1d2('0x24')](_0x27e26b,_0x1ab67c,!![]);}catch(_0x40170b){return BPromise['reject'](_0x40170b);}return _0x27e26b[_0xd1d2('0x25')]();};}function saveUpdates(_0xbb4d27,_0x24b8db){return function(_0x4eb082){if(_0x4eb082){return _0x4eb082['update'](_0xbb4d27)[_0xd1d2('0x26')](function(_0x3a1078){return _0x3a1078;});}return null;};}function removeEntity(_0x19d535,_0x2f92ee){return function(_0x3f229c){if(_0x3f229c){return _0x3f229c[_0xd1d2('0x27')]()[_0xd1d2('0x26')](function(){var _0x5df4af=_0x3f229c[_0xd1d2('0x28')]({'plain':!![]});var _0x42da6d=_0xd1d2('0x29');return db[_0xd1d2('0x2a')][_0xd1d2('0x27')]({'where':{'type':_0x42da6d,'resourceId':_0x5df4af['id']}})[_0xd1d2('0x26')](function(){return _0x3f229c;});})[_0xd1d2('0x26')](function(){_0x19d535[_0xd1d2('0x1c')](0xcc)[_0xd1d2('0x1d')]();});}};}function handleEntityNotFound(_0x384460,_0x3645e9){return function(_0x4e1bc2){if(!_0x4e1bc2){_0x384460['sendStatus'](0x194);}return _0x4e1bc2;};}function handleError(_0x133c6c,_0x442375){_0x442375=_0x442375||0x1f4;return function(_0x1e6072){logger[_0xd1d2('0x2b')](_0x1e6072[_0xd1d2('0x2c')]);if(_0x1e6072['name']){delete _0x1e6072[_0xd1d2('0x2d')];}_0x133c6c[_0xd1d2('0x1c')](_0x442375)[_0xd1d2('0x2e')](_0x1e6072);};}exports['index']=function(_0x19db00,_0x1db17f){var _0xbd855a={},_0x56557d={},_0x419db7={'count':0x0,'rows':[]};var _0x18528f=_[_0xd1d2('0x2f')](db[_0xd1d2('0x30')][_0xd1d2('0x31')],function(_0x14d661){return{'name':_0x14d661[_0xd1d2('0x32')],'type':_0x14d661[_0xd1d2('0x33')][_0xd1d2('0x34')]};});_0x56557d[_0xd1d2('0x35')]=_[_0xd1d2('0x2f')](_0x18528f,_0xd1d2('0x2d'));_0x56557d[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x19db00[_0xd1d2('0x36')]);_0x56557d[_0xd1d2('0x38')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],_0x56557d['query']);_0xbd855a[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x56557d[_0xd1d2('0x35')],qs['fields'](_0x19db00[_0xd1d2('0x36')]['fields']));_0xbd855a['attributes']=_0xbd855a[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0xbd855a[_0xd1d2('0x3a')]:_0x56557d[_0xd1d2('0x35')];if(!_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x3c')]('nolimit')){_0xbd855a[_0xd1d2('0x21')]=qs[_0xd1d2('0x21')](_0x19db00['query'][_0xd1d2('0x21')]);_0xbd855a[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x19db00[_0xd1d2('0x36')]['offset']);}_0xbd855a['order']=qs[_0xd1d2('0x3d')](_0x19db00['query']['sort']);_0xbd855a['where']=qs[_0xd1d2('0x38')](_['pick'](_0x19db00[_0xd1d2('0x36')],_0x56557d['filters']),_0x18528f);if(_0x19db00['query']['filter']){_0xbd855a[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0xbd855a[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x18528f,function(_0x33ba30){if(_0x33ba30[_0xd1d2('0x33')]!==_0xd1d2('0x40')){var _0x38bf16={};_0x38bf16[_0x33ba30[_0xd1d2('0x2d')]]={'$like':'%'+_0x19db00[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x38bf16;}})});}_0xbd855a=_[_0xd1d2('0x3f')]({},_0xbd855a,_0x19db00[_0xd1d2('0x42')]);var _0x18ff05={'where':_0xbd855a['where']};return db['VoiceMail'][_0xd1d2('0x22')](_0x18ff05)[_0xd1d2('0x26')](function(_0x24fc93){_0x419db7['count']=_0x24fc93;if(_0x19db00['query'][_0xd1d2('0x43')]){_0xbd855a[_0xd1d2('0x44')]=[{'all':!![]}];}return db['VoiceMail'][_0xd1d2('0x45')](_0xbd855a);})['then'](function(_0x5a3790){_0x419db7[_0xd1d2('0x46')]=_0x5a3790;return _0x419db7;})['then'](respondWithFilteredResult(_0x1db17f,_0xbd855a))['catch'](handleError(_0x1db17f,null));};exports[_0xd1d2('0x47')]=function(_0x320fa4,_0x2a8961){var _0x49dad2={'raw':!![],'where':{'id':_0x320fa4[_0xd1d2('0x48')]['id']}},_0x2ba87b={};_0x2ba87b[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db['VoiceMail'][_0xd1d2('0x31')]);_0x2ba87b[_0xd1d2('0x36')]=_['keys'](_0x320fa4[_0xd1d2('0x36')]);_0x2ba87b['filters']=_[_0xd1d2('0x39')](_0x2ba87b[_0xd1d2('0x35')],_0x2ba87b[_0xd1d2('0x36')]);_0x49dad2[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0x2ba87b['model'],qs['fields'](_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x49dad2['attributes']=_0x49dad2[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x49dad2[_0xd1d2('0x3a')]:_0x2ba87b[_0xd1d2('0x35')];if(_0x320fa4[_0xd1d2('0x36')][_0xd1d2('0x43')]){_0x49dad2[_0xd1d2('0x44')]=[{'all':!![]}];}_0x49dad2=_['merge']({},_0x49dad2,_0x320fa4[_0xd1d2('0x42')]);return db[_0xd1d2('0x30')]['find'](_0x49dad2)[_0xd1d2('0x26')](handleEntityNotFound(_0x2a8961,null))[_0xd1d2('0x26')](respondWithResult(_0x2a8961,null))['catch'](handleError(_0x2a8961,null));};exports['create']=function(_0x3d4fe3,_0x182ea8){return db['VoiceMail'][_0xd1d2('0x4a')](_0x3d4fe3[_0xd1d2('0x4b')],{})[_0xd1d2('0x26')](function(_0x23ab46){var _0x404ad2=_0x3d4fe3['user']['get']({'plain':!![]});if(!_0x404ad2)throw new Error(_0xd1d2('0x4c'));if(_0x404ad2['role']===_0xd1d2('0x4d')){var _0xcd4b70=_0x23ab46['get']({'plain':!![]});var _0x389fcb=_0xd1d2('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x389fcb,'userProfileId':_0x404ad2[_0xd1d2('0x4e')]},'raw':!![]})[_0xd1d2('0x26')](function(_0x187de4){if(_0x187de4&&_0x187de4[_0xd1d2('0x4f')]===0x0){return db[_0xd1d2('0x2a')][_0xd1d2('0x4a')]({'name':_0xcd4b70[_0xd1d2('0x2d')],'resourceId':_0xcd4b70['id'],'type':_0x187de4[_0xd1d2('0x2d')],'sectionId':_0x187de4['id']},{})[_0xd1d2('0x26')](function(){return _0x23ab46;});}else{return _0x23ab46;}})['catch'](function(_0x1958f3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1958f3);throw _0x1958f3;});}return _0x23ab46;})[_0xd1d2('0x26')](respondWithResult(_0x182ea8,0xc9))[_0xd1d2('0x50')](handleError(_0x182ea8,null));};exports[_0xd1d2('0x51')]=function(_0x47417f,_0x215dea){if(_0x47417f[_0xd1d2('0x4b')]['id']){delete _0x47417f[_0xd1d2('0x4b')]['id'];}return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0x47417f[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x215dea,null))[_0xd1d2('0x26')](saveUpdates(_0x47417f[_0xd1d2('0x4b')],null))['then'](respondWithResult(_0x215dea,null))['catch'](handleError(_0x215dea,null));};exports[_0xd1d2('0x27')]=function(_0xd5323d,_0x1562ad){return db[_0xd1d2('0x30')][_0xd1d2('0x52')]({'where':{'id':_0xd5323d[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x1562ad,null))[_0xd1d2('0x26')](removeEntity(_0x1562ad,null))[_0xd1d2('0x50')](handleError(_0x1562ad,null));};exports[_0xd1d2('0x53')]=function(_0x1788cd,_0x54406e,_0x479471){return db[_0xd1d2('0x30')][_0xd1d2('0x54')]({'where':{'id':_0x1788cd[_0xd1d2('0x48')]['id']}})[_0xd1d2('0x26')](handleEntityNotFound(_0x54406e,null))['then'](function(_0x17e149){var _0x27c629;var _0x42961d={},_0xaf2acf={};_0xaf2acf[_0xd1d2('0x35')]=_[_0xd1d2('0x37')](db[_0xd1d2('0x55')]['rawAttributes']);_0xaf2acf[_0xd1d2('0x36')]=_[_0xd1d2('0x37')](_0x1788cd[_0xd1d2('0x36')]);_0xaf2acf['filters']=_['intersection'](_0xaf2acf[_0xd1d2('0x35')],_0xaf2acf[_0xd1d2('0x36')]);_0x42961d[_0xd1d2('0x3a')]=_[_0xd1d2('0x39')](_0xaf2acf['model'],qs[_0xd1d2('0x49')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x49')]));_0x42961d['attributes']=_0x42961d[_0xd1d2('0x3a')][_0xd1d2('0x3b')]?_0x42961d['attributes']:_0xaf2acf[_0xd1d2('0x35')];if(!_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x3c')](_0xd1d2('0x56'))){_0x42961d['limit']=qs[_0xd1d2('0x21')](_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x21')]);_0x42961d[_0xd1d2('0x1f')]=qs[_0xd1d2('0x1f')](_0x1788cd['query']['offset']);}_0x42961d['order']=qs['sort'](_0x1788cd['query'][_0xd1d2('0x3d')]);_0x42961d[_0xd1d2('0x3e')]=qs[_0xd1d2('0x38')](_['pick'](_0x1788cd[_0xd1d2('0x36')],_0xaf2acf[_0xd1d2('0x38')]));if(_0x1788cd[_0xd1d2('0x36')]['filter']){_0x42961d[_0xd1d2('0x3e')]=_[_0xd1d2('0x3f')](_0x42961d[_0xd1d2('0x3e')],{'$or':_[_0xd1d2('0x2f')](_0x42961d[_0xd1d2('0x3a')],function(_0x1101a3){var _0x4a83f8={};_0x4a83f8[_0x1101a3]={'$like':'%'+_0x1788cd[_0xd1d2('0x36')][_0xd1d2('0x41')]+'%'};return _0x4a83f8;})});}_0x42961d['where']=_['merge'](_0x42961d[_0xd1d2('0x3e')],{'mailboxuser':_0x17e149[_0xd1d2('0x57')]});_0x42961d=_[_0xd1d2('0x3f')]({},_0x42961d,_0x1788cd[_0xd1d2('0x42')]);return db['VoiceMailMessage'][_0xd1d2('0x58')](_0x42961d)[_0xd1d2('0x26')](respondWithFilteredResult(_0x54406e,_0x42961d));})[_0xd1d2('0x50')](handleError(_0x54406e,null));};
\ No newline at end of file
+var _0x878f=['reject','save','update','then','destroy','get','Voicemails','UserProfileResource','end','name','send','map','VoiceMail','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','VoiceMailMessage','hasOwnProperty','findAndCountAll','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json'];(function(_0x1331e9,_0x5c2c1d){var _0x31b4fb=function(_0x411ff8){while(--_0x411ff8){_0x1331e9['push'](_0x1331e9['shift']());}};_0x31b4fb(++_0x5c2c1d);}(_0x878f,0x173));var _0xf878=function(_0x3b587b,_0x1193a1){_0x3b587b=_0x3b587b-0x0;var _0x34d583=_0x878f[_0x3b587b];return _0x34d583;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf878('0x0'));var zipdir=require(_0xf878('0x1'));var jsonpatch=require(_0xf878('0x2'));var rp=require(_0xf878('0x3'));var moment=require(_0xf878('0x4'));var BPromise=require(_0xf878('0x5'));var Mustache=require(_0xf878('0x6'));var util=require(_0xf878('0x7'));var path=require(_0xf878('0x8'));var sox=require(_0xf878('0x9'));var csv=require(_0xf878('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf878('0xb'));var squel=require(_0xf878('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf878('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf878('0xd'));var authService=require(_0xf878('0xe'));var qs=require(_0xf878('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf878('0x10'));var logger=require(_0xf878('0x11'))('api');var utils=require(_0xf878('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf878('0x13'));var db=require(_0xf878('0x14'))['db'];function respondWithStatusCode(_0x339c9c,_0x596fb5){_0x596fb5=_0x596fb5||0xcc;return function(_0x1ce004){if(_0x1ce004){return _0x339c9c[_0xf878('0x15')](_0x596fb5);}return _0x339c9c[_0xf878('0x16')](_0x596fb5)['end']();};}function respondWithResult(_0xe2c2de,_0x3902f7){_0x3902f7=_0x3902f7||0xc8;return function(_0x119e9e){if(_0x119e9e){return _0xe2c2de['status'](_0x3902f7)['json'](_0x119e9e);}};}function respondWithFilteredResult(_0x4c0948,_0x35ff2d){return function(_0x31d888){if(_0x31d888){var _0x6dbeca=typeof _0x35ff2d[_0xf878('0x17')]===_0xf878('0x18')&&typeof _0x35ff2d[_0xf878('0x19')]===_0xf878('0x18');var _0x3c5dee=_0x31d888[_0xf878('0x1a')];var _0x3b2e1b=_0x6dbeca?0x0:_0x35ff2d['offset'];var _0x2b2b54=_0x6dbeca?_0x31d888[_0xf878('0x1a')]:_0x35ff2d[_0xf878('0x17')]+_0x35ff2d[_0xf878('0x19')];var _0x3714f6;if(_0x2b2b54>=_0x3c5dee){_0x2b2b54=_0x3c5dee;_0x3714f6=0xc8;}else{_0x3714f6=0xce;}_0x4c0948[_0xf878('0x16')](_0x3714f6);return _0x4c0948[_0xf878('0x1b')]('Content-Range',_0x3b2e1b+'-'+_0x2b2b54+'/'+_0x3c5dee)[_0xf878('0x1c')](_0x31d888);}return null;};}function patchUpdates(_0x140866){return function(_0x250f85){try{jsonpatch['apply'](_0x250f85,_0x140866,!![]);}catch(_0x432e5d){return BPromise[_0xf878('0x1d')](_0x432e5d);}return _0x250f85[_0xf878('0x1e')]();};}function saveUpdates(_0x392822,_0x22d884){return function(_0x442450){if(_0x442450){return _0x442450[_0xf878('0x1f')](_0x392822)[_0xf878('0x20')](function(_0x212436){return _0x212436;});}return null;};}function removeEntity(_0x1a6506,_0x45e61f){return function(_0x566995){if(_0x566995){return _0x566995[_0xf878('0x21')]()['then'](function(){var _0xa3d3d3=_0x566995[_0xf878('0x22')]({'plain':!![]});var _0x35b3b4=_0xf878('0x23');return db[_0xf878('0x24')]['destroy']({'where':{'type':_0x35b3b4,'resourceId':_0xa3d3d3['id']}})['then'](function(){return _0x566995;});})['then'](function(){_0x1a6506[_0xf878('0x16')](0xcc)[_0xf878('0x25')]();});}};}function handleEntityNotFound(_0x38fa87,_0x5af87f){return function(_0xfa3e11){if(!_0xfa3e11){_0x38fa87[_0xf878('0x15')](0x194);}return _0xfa3e11;};}function handleError(_0x3e848d,_0xd50680){_0xd50680=_0xd50680||0x1f4;return function(_0x41dd55){logger['error'](_0x41dd55['stack']);if(_0x41dd55[_0xf878('0x26')]){delete _0x41dd55[_0xf878('0x26')];}_0x3e848d['status'](_0xd50680)[_0xf878('0x27')](_0x41dd55);};}exports['index']=function(_0x969ee3,_0x51afaf){var _0x2c61c1={},_0x49e66a={},_0x2630fb={'count':0x0,'rows':[]};var _0x48b151=_[_0xf878('0x28')](db[_0xf878('0x29')][_0xf878('0x2a')],function(_0x1f5331){return{'name':_0x1f5331[_0xf878('0x2b')],'type':_0x1f5331[_0xf878('0x2c')]['key']};});_0x49e66a[_0xf878('0x2d')]=_[_0xf878('0x28')](_0x48b151,_0xf878('0x26'));_0x49e66a[_0xf878('0x2e')]=_[_0xf878('0x2f')](_0x969ee3['query']);_0x49e66a[_0xf878('0x30')]=_[_0xf878('0x31')](_0x49e66a['model'],_0x49e66a[_0xf878('0x2e')]);_0x2c61c1[_0xf878('0x32')]=_[_0xf878('0x31')](_0x49e66a[_0xf878('0x2d')],qs[_0xf878('0x33')](_0x969ee3['query'][_0xf878('0x33')]));_0x2c61c1[_0xf878('0x32')]=_0x2c61c1[_0xf878('0x32')][_0xf878('0x34')]?_0x2c61c1['attributes']:_0x49e66a[_0xf878('0x2d')];if(!_0x969ee3['query']['hasOwnProperty'](_0xf878('0x35'))){_0x2c61c1[_0xf878('0x19')]=qs[_0xf878('0x19')](_0x969ee3[_0xf878('0x2e')][_0xf878('0x19')]);_0x2c61c1['offset']=qs[_0xf878('0x17')](_0x969ee3['query'][_0xf878('0x17')]);}_0x2c61c1[_0xf878('0x36')]=qs['sort'](_0x969ee3[_0xf878('0x2e')][_0xf878('0x37')]);_0x2c61c1['where']=qs[_0xf878('0x30')](_[_0xf878('0x38')](_0x969ee3['query'],_0x49e66a[_0xf878('0x30')]),_0x48b151);if(_0x969ee3[_0xf878('0x2e')][_0xf878('0x39')]){_0x2c61c1[_0xf878('0x3a')]=_[_0xf878('0x3b')](_0x2c61c1[_0xf878('0x3a')],{'$or':_[_0xf878('0x28')](_0x48b151,function(_0x54af54){if(_0x54af54[_0xf878('0x2c')]!==_0xf878('0x3c')){var _0x47ec1b={};_0x47ec1b[_0x54af54[_0xf878('0x26')]]={'$like':'%'+_0x969ee3['query']['filter']+'%'};return _0x47ec1b;}})});}_0x2c61c1=_[_0xf878('0x3b')]({},_0x2c61c1,_0x969ee3[_0xf878('0x3d')]);var _0x43b03e={'where':_0x2c61c1[_0xf878('0x3a')]};return db[_0xf878('0x29')]['count'](_0x43b03e)[_0xf878('0x20')](function(_0x4c4ae4){_0x2630fb[_0xf878('0x1a')]=_0x4c4ae4;if(_0x969ee3[_0xf878('0x2e')]['includeAll']){_0x2c61c1['include']=[{'all':!![]}];}return db[_0xf878('0x29')][_0xf878('0x3e')](_0x2c61c1);})[_0xf878('0x20')](function(_0x2f6ee5){_0x2630fb[_0xf878('0x3f')]=_0x2f6ee5;return _0x2630fb;})[_0xf878('0x20')](respondWithFilteredResult(_0x51afaf,_0x2c61c1))[_0xf878('0x40')](handleError(_0x51afaf,null));};exports[_0xf878('0x41')]=function(_0x3b1c67,_0x5444eb){var _0x1edaa9={'raw':!![],'where':{'id':_0x3b1c67[_0xf878('0x42')]['id']}},_0x21b4fb={};_0x21b4fb[_0xf878('0x2d')]=_[_0xf878('0x2f')](db[_0xf878('0x29')]['rawAttributes']);_0x21b4fb[_0xf878('0x2e')]=_[_0xf878('0x2f')](_0x3b1c67[_0xf878('0x2e')]);_0x21b4fb[_0xf878('0x30')]=_[_0xf878('0x31')](_0x21b4fb['model'],_0x21b4fb[_0xf878('0x2e')]);_0x1edaa9[_0xf878('0x32')]=_[_0xf878('0x31')](_0x21b4fb[_0xf878('0x2d')],qs['fields'](_0x3b1c67[_0xf878('0x2e')][_0xf878('0x33')]));_0x1edaa9[_0xf878('0x32')]=_0x1edaa9['attributes']['length']?_0x1edaa9[_0xf878('0x32')]:_0x21b4fb['model'];if(_0x3b1c67['query']['includeAll']){_0x1edaa9[_0xf878('0x43')]=[{'all':!![]}];}_0x1edaa9=_['merge']({},_0x1edaa9,_0x3b1c67[_0xf878('0x3d')]);return db[_0xf878('0x29')][_0xf878('0x44')](_0x1edaa9)[_0xf878('0x20')](handleEntityNotFound(_0x5444eb,null))[_0xf878('0x20')](respondWithResult(_0x5444eb,null))[_0xf878('0x40')](handleError(_0x5444eb,null));};exports[_0xf878('0x45')]=function(_0x526c89,_0xb0bf4c){return db[_0xf878('0x29')][_0xf878('0x45')](_0x526c89[_0xf878('0x46')],{})[_0xf878('0x20')](function(_0x47c8be){var _0x4a5b71=_0x526c89[_0xf878('0x47')][_0xf878('0x22')]({'plain':!![]});if(!_0x4a5b71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a5b71[_0xf878('0x48')]==='user'){var _0x1ce6b9=_0x47c8be[_0xf878('0x22')]({'plain':!![]});var _0x379912=_0xf878('0x23');return db['UserProfileSection'][_0xf878('0x44')]({'where':{'name':_0x379912,'userProfileId':_0x4a5b71[_0xf878('0x49')]},'raw':!![]})[_0xf878('0x20')](function(_0x5a88d1){if(_0x5a88d1&&_0x5a88d1[_0xf878('0x4a')]===0x0){return db[_0xf878('0x24')][_0xf878('0x45')]({'name':_0x1ce6b9[_0xf878('0x26')],'resourceId':_0x1ce6b9['id'],'type':_0x5a88d1['name'],'sectionId':_0x5a88d1['id']},{})[_0xf878('0x20')](function(){return _0x47c8be;});}else{return _0x47c8be;}})[_0xf878('0x40')](function(_0x3f9fce){logger['error'](_0xf878('0x4b'),_0x3f9fce);throw _0x3f9fce;});}return _0x47c8be;})[_0xf878('0x20')](respondWithResult(_0xb0bf4c,0xc9))[_0xf878('0x40')](handleError(_0xb0bf4c,null));};exports[_0xf878('0x1f')]=function(_0x5118f4,_0x5a2666){if(_0x5118f4['body']['id']){delete _0x5118f4[_0xf878('0x46')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x5118f4['params']['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x5a2666,null))[_0xf878('0x20')](saveUpdates(_0x5118f4['body'],null))[_0xf878('0x20')](respondWithResult(_0x5a2666,null))[_0xf878('0x40')](handleError(_0x5a2666,null));};exports[_0xf878('0x21')]=function(_0x4ce441,_0x5eab57){return db[_0xf878('0x29')]['find']({'where':{'id':_0x4ce441[_0xf878('0x42')]['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x5eab57,null))[_0xf878('0x20')](removeEntity(_0x5eab57,null))[_0xf878('0x40')](handleError(_0x5eab57,null));};exports[_0xf878('0x4c')]=function(_0x344aa4,_0x57f635,_0x284132){return db[_0xf878('0x29')]['findOne']({'where':{'id':_0x344aa4[_0xf878('0x42')]['id']}})[_0xf878('0x20')](handleEntityNotFound(_0x57f635,null))[_0xf878('0x20')](function(_0x282985){var _0x263f26;var _0x36b000={},_0x339141={};_0x339141['model']=_[_0xf878('0x2f')](db[_0xf878('0x4d')][_0xf878('0x2a')]);_0x339141['query']=_[_0xf878('0x2f')](_0x344aa4['query']);_0x339141[_0xf878('0x30')]=_[_0xf878('0x31')](_0x339141[_0xf878('0x2d')],_0x339141[_0xf878('0x2e')]);_0x36b000[_0xf878('0x32')]=_[_0xf878('0x31')](_0x339141[_0xf878('0x2d')],qs[_0xf878('0x33')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x33')]));_0x36b000['attributes']=_0x36b000['attributes']['length']?_0x36b000[_0xf878('0x32')]:_0x339141['model'];if(!_0x344aa4[_0xf878('0x2e')][_0xf878('0x4e')]('nolimit')){_0x36b000['limit']=qs[_0xf878('0x19')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x19')]);_0x36b000[_0xf878('0x17')]=qs[_0xf878('0x17')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x17')]);}_0x36b000[_0xf878('0x36')]=qs[_0xf878('0x37')](_0x344aa4[_0xf878('0x2e')][_0xf878('0x37')]);_0x36b000[_0xf878('0x3a')]=qs[_0xf878('0x30')](_[_0xf878('0x38')](_0x344aa4[_0xf878('0x2e')],_0x339141[_0xf878('0x30')]));if(_0x344aa4[_0xf878('0x2e')][_0xf878('0x39')]){_0x36b000['where']=_[_0xf878('0x3b')](_0x36b000['where'],{'$or':_[_0xf878('0x28')](_0x36b000[_0xf878('0x32')],function(_0x2e8a57){var _0x910e78={};_0x910e78[_0x2e8a57]={'$like':'%'+_0x344aa4[_0xf878('0x2e')][_0xf878('0x39')]+'%'};return _0x910e78;})});}_0x36b000[_0xf878('0x3a')]=_[_0xf878('0x3b')](_0x36b000[_0xf878('0x3a')],{'mailboxuser':_0x282985['mailbox']});_0x36b000=_[_0xf878('0x3b')]({},_0x36b000,_0x344aa4[_0xf878('0x3d')]);return db[_0xf878('0x4d')][_0xf878('0x4f')](_0x36b000)['then'](respondWithFilteredResult(_0x57f635,_0x36b000));})[_0xf878('0x40')](handleError(_0x57f635,null));};
\ No newline at end of file
index 52e8ac2..1e02ec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c38=['bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','api'];(function(_0x3c6c0e,_0x4575ef){var _0x1df35c=function(_0x367377){while(--_0x367377){_0x3c6c0e['push'](_0x3c6c0e['shift']());}};_0x1df35c(++_0x4575ef);}(_0x2c38,0x113));var _0x82c3=function(_0x1a15f9,_0x124b61){_0x1a15f9=_0x1a15f9-0x0;var _0x59b4d1=_0x2c38[_0x1a15f9];return _0x59b4d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x82c3('0x0'));var moment=require('moment');var BPromise=require(_0x82c3('0x1'));var rp=require(_0x82c3('0x2'));var fs=require('fs');var path=require(_0x82c3('0x3'));var rimraf=require(_0x82c3('0x4'));var config=require('../../config/environment');var attributes=require(_0x82c3('0x5'));module[_0x82c3('0x6')]=function(_0x1ed36e,_0x4c27d9){return _0x1ed36e[_0x82c3('0x7')](_0x82c3('0x8'),attributes,{'tableName':_0x82c3('0x9'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x82c3('0xa'),_0x82c3('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d1d=['bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment'];(function(_0x57af86,_0x2a3130){var _0x2d1923=function(_0x15cc42){while(--_0x15cc42){_0x57af86['push'](_0x57af86['shift']());}};_0x2d1923(++_0x2a3130);}(_0x5d1d,0xb0));var _0xd5d1=function(_0x1e5871,_0x529369){_0x1e5871=_0x1e5871-0x0;var _0x4ddbd6=_0x5d1d[_0x1e5871];return _0x4ddbd6;};'use strict';var _=require(_0xd5d1('0x0'));var util=require(_0xd5d1('0x1'));var logger=require(_0xd5d1('0x2'))('api');var moment=require(_0xd5d1('0x3'));var BPromise=require(_0xd5d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5d1('0x5'));var rimraf=require(_0xd5d1('0x6'));var config=require(_0xd5d1('0x7'));var attributes=require(_0xd5d1('0x8'));module[_0xd5d1('0x9')]=function(_0x20dd76,_0x185ea3){return _0x20dd76[_0xd5d1('0xa')](_0xd5d1('0xb'),attributes,{'tableName':_0xd5d1('0xc'),'paranoid':![],'indexes':[{'name':_0xd5d1('0xd'),'fields':[_0xd5d1('0xe'),'context']}],'timestamps':!![]});};
\ No newline at end of file
index 6e3a15d..3b18085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3eb=['then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x5904ba,_0x38ce04){var _0x996e12=function(_0x2a2e13){while(--_0x2a2e13){_0x5904ba['push'](_0x5904ba['shift']());}};_0x996e12(++_0x38ce04);}(_0xd3eb,0x128));var _0xbd3e=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0xd3eb[_0x58cbde];return _0x5799f3;};'use strict';var _=require('lodash');var util=require(_0xbd3e('0x0'));var moment=require(_0xbd3e('0x1'));var BPromise=require(_0xbd3e('0x2'));var rs=require(_0xbd3e('0x3'));var fs=require('fs');var Redis=require(_0xbd3e('0x4'));var db=require(_0xbd3e('0x5'))['db'];var utils=require(_0xbd3e('0x6'));var logger=require(_0xbd3e('0x7'))('rpc');var config=require(_0xbd3e('0x8'));var jayson=require(_0xbd3e('0x9'));var client=jayson[_0xbd3e('0xa')][_0xbd3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d131d,_0x1fcc84,_0x260763){return new BPromise(function(_0x1d0dbe,_0xd84d32){return client['request'](_0x7d131d,_0x260763)[_0xbd3e('0xc')](function(_0x861662){logger[_0xbd3e('0xd')](_0xbd3e('0xe'),_0x1fcc84,_0xbd3e('0xf'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x1fcc84,_0xbd3e('0xf'),JSON[_0xbd3e('0x10')](_0x861662));if(_0x861662[_0xbd3e('0x11')]){if(_0x861662[_0xbd3e('0x11')][_0xbd3e('0x12')]===0x1f4){logger[_0xbd3e('0x11')](_0xbd3e('0xe'),_0x1fcc84,_0x861662[_0xbd3e('0x11')][_0xbd3e('0x13')]);return _0xd84d32(_0x861662[_0xbd3e('0x11')]['message']);}logger[_0xbd3e('0x11')](_0xbd3e('0xe'),_0x1fcc84,_0x861662[_0xbd3e('0x11')][_0xbd3e('0x13')]);return _0x1d0dbe(_0x861662[_0xbd3e('0x11')][_0xbd3e('0x13')]);}else{logger[_0xbd3e('0xd')]('VoiceMail,\x20%s,\x20%s',_0x1fcc84,_0xbd3e('0xf'));_0x1d0dbe(_0x861662[_0xbd3e('0x14')]['message']);}})[_0xbd3e('0x15')](function(_0x341afc){logger[_0xbd3e('0x11')](_0xbd3e('0xe'),_0x1fcc84,_0x341afc);_0xd84d32(_0x341afc);});});}
\ No newline at end of file
+var _0x2dca=['error','message','VoiceMail,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xbfbe30,_0x62bc98){var _0x548be6=function(_0x3c725e){while(--_0x3c725e){_0xbfbe30['push'](_0xbfbe30['shift']());}};_0x548be6(++_0x62bc98);}(_0x2dca,0x15e));var _0xa2dc=function(_0x35f7f5,_0x4e2ee1){_0x35f7f5=_0x35f7f5-0x0;var _0x5567a4=_0x2dca[_0x35f7f5];return _0x5567a4;};'use strict';var _=require('lodash');var util=require(_0xa2dc('0x0'));var moment=require(_0xa2dc('0x1'));var BPromise=require(_0xa2dc('0x2'));var rs=require(_0xa2dc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa2dc('0x4'))['db'];var utils=require(_0xa2dc('0x5'));var logger=require(_0xa2dc('0x6'))(_0xa2dc('0x7'));var config=require(_0xa2dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa2dc('0x9')][_0xa2dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x55ea76,_0x397074,_0x148d9c){return new BPromise(function(_0x448fd5,_0x1acb69){return client[_0xa2dc('0xb')](_0x55ea76,_0x148d9c)[_0xa2dc('0xc')](function(_0x4587b9){logger[_0xa2dc('0xd')]('VoiceMail,\x20%s,\x20%s',_0x397074,_0xa2dc('0xe'));logger[_0xa2dc('0xf')](_0xa2dc('0x10'),_0x397074,'request\x20sent',JSON[_0xa2dc('0x11')](_0x4587b9));if(_0x4587b9['error']){if(_0x4587b9[_0xa2dc('0x12')]['code']===0x1f4){logger[_0xa2dc('0x12')]('VoiceMail,\x20%s,\x20%s',_0x397074,_0x4587b9[_0xa2dc('0x12')][_0xa2dc('0x13')]);return _0x1acb69(_0x4587b9[_0xa2dc('0x12')][_0xa2dc('0x13')]);}logger[_0xa2dc('0x12')](_0xa2dc('0x14'),_0x397074,_0x4587b9[_0xa2dc('0x12')][_0xa2dc('0x13')]);return _0x448fd5(_0x4587b9[_0xa2dc('0x12')][_0xa2dc('0x13')]);}else{logger[_0xa2dc('0xd')](_0xa2dc('0x14'),_0x397074,'request\x20sent');_0x448fd5(_0x4587b9[_0xa2dc('0x15')]['message']);}})[_0xa2dc('0x16')](function(_0x46b82b){logger['error'](_0xa2dc('0x14'),_0x397074,_0x46b82b);_0x1acb69(_0x46b82b);});});}
\ No newline at end of file
index 6a48457..d892835 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bd6=['get','/:id','isAuthenticated','show','/:id/download','post','create','put','update','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller'];(function(_0x81ad7c,_0x30b796){var _0x3660fa=function(_0x41e58e){while(--_0x41e58e){_0x81ad7c['push'](_0x81ad7c['shift']());}};_0x3660fa(++_0x30b796);}(_0x5bd6,0xf4));var _0x65bd=function(_0x512c83,_0x42a67a){_0x512c83=_0x512c83-0x0;var _0x1f7f25=_0x5bd6[_0x512c83];return _0x1f7f25;};'use strict';var multer=require(_0x65bd('0x0'));var util=require(_0x65bd('0x1'));var path=require(_0x65bd('0x2'));var timeout=require('connect-timeout');var express=require(_0x65bd('0x3'));var router=express[_0x65bd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x65bd('0x5'));var interaction=require(_0x65bd('0x6'));var config=require('../../config/environment');var controller=require(_0x65bd('0x7'));router[_0x65bd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x65bd('0x8')](_0x65bd('0x9'),auth[_0x65bd('0xa')](),controller[_0x65bd('0xb')]);router['get'](_0x65bd('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x65bd('0xd')]('/',auth[_0x65bd('0xa')](),controller[_0x65bd('0xe')]);router[_0x65bd('0xf')](_0x65bd('0x9'),auth['isAuthenticated'](),controller[_0x65bd('0x10')]);router['delete'](_0x65bd('0x9'),auth[_0x65bd('0xa')](),controller[_0x65bd('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x76e0=['put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','download'];(function(_0x4c4cfd,_0x1c0634){var _0x6b5ee8=function(_0x22b19e){while(--_0x22b19e){_0x4c4cfd['push'](_0x4c4cfd['shift']());}};_0x6b5ee8(++_0x1c0634);}(_0x76e0,0xcd));var _0x076e=function(_0x5bc5cb,_0x531ff2){_0x5bc5cb=_0x5bc5cb-0x0;var _0x30b099=_0x76e0[_0x5bc5cb];return _0x30b099;};'use strict';var multer=require('multer');var util=require(_0x076e('0x0'));var path=require(_0x076e('0x1'));var timeout=require('connect-timeout');var express=require(_0x076e('0x2'));var router=express[_0x076e('0x3')]();var fs_extra=require(_0x076e('0x4'));var auth=require(_0x076e('0x5'));var interaction=require(_0x076e('0x6'));var config=require(_0x076e('0x7'));var controller=require(_0x076e('0x8'));router[_0x076e('0x9')]('/',auth[_0x076e('0xa')](),controller['index']);router['get'](_0x076e('0xb'),auth[_0x076e('0xa')](),controller[_0x076e('0xc')]);router[_0x076e('0x9')](_0x076e('0xd'),auth[_0x076e('0xa')](),controller[_0x076e('0xe')]);router['post']('/',auth[_0x076e('0xa')](),controller['create']);router[_0x076e('0xf')](_0x076e('0xb'),auth[_0x076e('0xa')](),controller[_0x076e('0x10')]);router[_0x076e('0x11')](_0x076e('0xb'),auth[_0x076e('0xa')](),controller[_0x076e('0x12')]);module[_0x076e('0x13')]=router;
\ No newline at end of file
index 337e97a..1ca6306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb87f=['INTEGER','STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','VIRTUAL'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0xb87f,0x1a6));var _0xfb87=function(_0x75fe5e,_0x25e22f){_0x75fe5e=_0x75fe5e-0x0;var _0xcfc4a7=_0xb87f[_0x75fe5e];return _0xcfc4a7;};'use strict';var Sequelize=require(_0xfb87('0x0'));module['exports']={'name':{'type':Sequelize[_0xfb87('0x1')],'get':function(_0x568967){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xfb87('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xfb87('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xfb87('0x3')],'defaultValue':''},'stamp':{'type':_0xfb87('0x5'),'defaultValue':Sequelize[_0xfb87('0x6')](_0xfb87('0x7'))}};
\ No newline at end of file
+var _0xf7b2=['STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','VIRTUAL','getDataValue','INTEGER'];(function(_0x22f887,_0x1a1f18){var _0x38fab9=function(_0x126f64){while(--_0x126f64){_0x22f887['push'](_0x22f887['shift']());}};_0x38fab9(++_0x1a1f18);}(_0xf7b2,0x7b));var _0x2f7b=function(_0x9be3b0,_0xfd3a6b){_0x9be3b0=_0x9be3b0-0x0;var _0x2ec3d9=_0xf7b2[_0x9be3b0];return _0x2ec3d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x2f7b('0x0')],'get':function(_0x1e98e2){return this[_0x2f7b('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x2f7b('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x2f7b('0x4')](_0x2f7b('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x2f7b('0x3')],'defaultValue':''},'stamp':{'type':_0x2f7b('0x6'),'defaultValue':Sequelize[_0x2f7b('0x7')](_0x2f7b('0x8'))}};
\ No newline at end of file
index 6b43bc4..d8e9b38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7497=['.wav\x22','set','recording','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','save','update','then','destroy','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','rows','show','params','keys','find','catch','create','body','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22'];(function(_0x40f5e6,_0x1b9a1d){var _0xce7ced=function(_0x4c7079){while(--_0x4c7079){_0x40f5e6['push'](_0x40f5e6['shift']());}};_0xce7ced(++_0x1b9a1d);}(_0x7497,0x102));var _0x7749=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7497[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x7749('0x0'));var rimraf=require(_0x7749('0x1'));var zipdir=require(_0x7749('0x2'));var jsonpatch=require(_0x7749('0x3'));var rp=require(_0x7749('0x4'));var moment=require(_0x7749('0x5'));var BPromise=require(_0x7749('0x6'));var Mustache=require('mustache');var util=require(_0x7749('0x7'));var path=require(_0x7749('0x8'));var sox=require(_0x7749('0x9'));var csv=require(_0x7749('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7749('0xb'));var _=require(_0x7749('0xc'));var squel=require(_0x7749('0xd'));var crypto=require(_0x7749('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7749('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7749('0x10'));var Papa=require(_0x7749('0x11'));var Redis=require('ioredis');var authService=require(_0x7749('0x12'));var qs=require(_0x7749('0x13'));var as=require(_0x7749('0x14'));var hardwareService=require(_0x7749('0x15'));var logger=require(_0x7749('0x16'))(_0x7749('0x17'));var utils=require(_0x7749('0x18'));var config=require(_0x7749('0x19'));var licenseUtil=require(_0x7749('0x1a'));var db=require(_0x7749('0x1b'))['db'];function respondWithStatusCode(_0x558696,_0x224d53){_0x224d53=_0x224d53||0xcc;return function(_0xca2724){if(_0xca2724){return _0x558696[_0x7749('0x1c')](_0x224d53);}return _0x558696[_0x7749('0x1d')](_0x224d53)['end']();};}function respondWithResult(_0x3b4823,_0xfc6530){_0xfc6530=_0xfc6530||0xc8;return function(_0x3d8c54){if(_0x3d8c54){return _0x3b4823[_0x7749('0x1d')](_0xfc6530)['json'](_0x3d8c54);}};}function respondWithFilteredResult(_0xdc35c6,_0x5c07ce){return function(_0x44fd00){if(_0x44fd00){var _0x43cbcd=typeof _0x5c07ce[_0x7749('0x1e')]===_0x7749('0x1f')&&typeof _0x5c07ce['limit']===_0x7749('0x1f');var _0x5066c2=_0x44fd00['count'];var _0x2f2d34=_0x43cbcd?0x0:_0x5c07ce[_0x7749('0x1e')];var _0xca0e95=_0x43cbcd?_0x44fd00[_0x7749('0x20')]:_0x5c07ce[_0x7749('0x1e')]+_0x5c07ce[_0x7749('0x21')];var _0x35b622;if(_0xca0e95>=_0x5066c2){_0xca0e95=_0x5066c2;_0x35b622=0xc8;}else{_0x35b622=0xce;}_0xdc35c6[_0x7749('0x1d')](_0x35b622);return _0xdc35c6['set'](_0x7749('0x22'),_0x2f2d34+'-'+_0xca0e95+'/'+_0x5066c2)[_0x7749('0x23')](_0x44fd00);}return null;};}function patchUpdates(_0x5245aa){return function(_0x11c986){try{jsonpatch[_0x7749('0x24')](_0x11c986,_0x5245aa,!![]);}catch(_0x4b5d65){return BPromise['reject'](_0x4b5d65);}return _0x11c986[_0x7749('0x25')]();};}function saveUpdates(_0x3d98cd,_0x580420){return function(_0x516822){if(_0x516822){return _0x516822[_0x7749('0x26')](_0x3d98cd)[_0x7749('0x27')](function(_0x60d8ce){return _0x60d8ce;});}return null;};}function removeEntity(_0x403b86,_0x14d650){return function(_0x1765cc){if(_0x1765cc){return _0x1765cc[_0x7749('0x28')]()[_0x7749('0x27')](function(){_0x403b86[_0x7749('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b42dd,_0x1f090f){return function(_0x58566e){if(!_0x58566e){_0x5b42dd[_0x7749('0x1c')](0x194);}return _0x58566e;};}function handleError(_0x2c6dec,_0x4a38e4){_0x4a38e4=_0x4a38e4||0x1f4;return function(_0x57841f){logger['error'](_0x57841f['stack']);if(_0x57841f[_0x7749('0x29')]){delete _0x57841f['name'];}_0x2c6dec[_0x7749('0x1d')](_0x4a38e4)[_0x7749('0x2a')](_0x57841f);};}exports[_0x7749('0x2b')]=function(_0x5a4a64,_0x190ce5){var _0x5e78a8={},_0x2287e2={},_0x2ff436={'count':0x0,'rows':[]};var _0x4b33eb=_['map'](db[_0x7749('0x2c')][_0x7749('0x2d')],function(_0x4fcfa8){return{'name':_0x4fcfa8[_0x7749('0x2e')],'type':_0x4fcfa8[_0x7749('0x2f')][_0x7749('0x30')]};});_0x2287e2['model']=_['differenceBy'](_[_0x7749('0x31')](_0x4b33eb,'name'),[_0x7749('0x29')]);_0x2287e2[_0x7749('0x32')]=_['keys'](_0x5a4a64[_0x7749('0x32')]);_0x2287e2[_0x7749('0x33')]=_[_0x7749('0x34')](_0x2287e2['model'],_0x2287e2['query']);_0x5e78a8[_0x7749('0x35')]=_[_0x7749('0x34')](_0x2287e2[_0x7749('0x36')],qs[_0x7749('0x37')](_0x5a4a64[_0x7749('0x32')][_0x7749('0x37')]));_0x5e78a8['attributes']=_0x5e78a8[_0x7749('0x35')]['length']?_0x5e78a8['attributes']:_0x2287e2['model'];if(!_0x5a4a64[_0x7749('0x32')][_0x7749('0x38')](_0x7749('0x39'))){_0x5e78a8[_0x7749('0x21')]=qs[_0x7749('0x21')](_0x5a4a64[_0x7749('0x32')][_0x7749('0x21')]);_0x5e78a8[_0x7749('0x1e')]=qs[_0x7749('0x1e')](_0x5a4a64['query']['offset']);}_0x5e78a8[_0x7749('0x3a')]=qs[_0x7749('0x3b')](_0x5a4a64[_0x7749('0x32')][_0x7749('0x3b')]);_0x5e78a8[_0x7749('0x3c')]=qs[_0x7749('0x33')](_[_0x7749('0x3d')](_0x5a4a64[_0x7749('0x32')],_0x2287e2['filters']),_0x4b33eb);if(_0x5a4a64[_0x7749('0x32')]['filter']){_0x5e78a8[_0x7749('0x3c')]=_[_0x7749('0x3e')](_0x5e78a8[_0x7749('0x3c')],{'$or':_[_0x7749('0x31')](_0x4b33eb,function(_0x4e2249){if(_0x4e2249[_0x7749('0x2f')]!==_0x7749('0x3f')){var _0x1b74fb={};_0x1b74fb[_0x4e2249[_0x7749('0x29')]]={'$like':'%'+_0x5a4a64['query'][_0x7749('0x40')]+'%'};return _0x1b74fb;}})});}_0x5e78a8=_[_0x7749('0x3e')]({},_0x5e78a8,_0x5a4a64['options']);var _0x120771={'where':_0x5e78a8[_0x7749('0x3c')]};return db[_0x7749('0x2c')]['count'](_0x120771)['then'](function(_0x4cd376){_0x2ff436[_0x7749('0x20')]=_0x4cd376;if(_0x5a4a64[_0x7749('0x32')][_0x7749('0x41')]){_0x5e78a8[_0x7749('0x42')]=[{'all':!![]}];}return db[_0x7749('0x2c')]['findAll'](_0x5e78a8);})[_0x7749('0x27')](function(_0x58bb8c){_0x2ff436[_0x7749('0x43')]=_0x58bb8c;return _0x2ff436;})[_0x7749('0x27')](respondWithFilteredResult(_0x190ce5,_0x5e78a8))['catch'](handleError(_0x190ce5,null));};exports[_0x7749('0x44')]=function(_0x1fcddf,_0x2f1787){var _0x27b691={'raw':!![],'where':{'id':_0x1fcddf[_0x7749('0x45')]['id']}},_0x3ced1b={};_0x3ced1b[_0x7749('0x36')]=_[_0x7749('0x46')](db[_0x7749('0x2c')][_0x7749('0x2d')]);_0x3ced1b['query']=_[_0x7749('0x46')](_0x1fcddf[_0x7749('0x32')]);_0x3ced1b['filters']=_[_0x7749('0x34')](_0x3ced1b[_0x7749('0x36')],_0x3ced1b['query']);_0x27b691['attributes']=_[_0x7749('0x34')](_0x3ced1b[_0x7749('0x36')],qs[_0x7749('0x37')](_0x1fcddf[_0x7749('0x32')][_0x7749('0x37')]));_0x27b691[_0x7749('0x35')]=_0x27b691['attributes']['length']?_0x27b691[_0x7749('0x35')]:_0x3ced1b['model'];if(_0x1fcddf[_0x7749('0x32')]['includeAll']){_0x27b691[_0x7749('0x42')]=[{'all':!![]}];}_0x27b691=_['merge']({},_0x27b691,_0x1fcddf['options']);return db[_0x7749('0x2c')][_0x7749('0x47')](_0x27b691)['then'](handleEntityNotFound(_0x2f1787,null))[_0x7749('0x27')](respondWithResult(_0x2f1787,null))[_0x7749('0x48')](handleError(_0x2f1787,null));};exports[_0x7749('0x49')]=function(_0x4bab5e,_0x42fe05){return db[_0x7749('0x2c')][_0x7749('0x49')](_0x4bab5e[_0x7749('0x4a')],{})[_0x7749('0x27')](respondWithResult(_0x42fe05,0xc9))[_0x7749('0x48')](handleError(_0x42fe05,null));};exports[_0x7749('0x26')]=function(_0x1ddec3,_0x57182f){if(_0x1ddec3[_0x7749('0x4a')]['id']){delete _0x1ddec3['body']['id'];}return db[_0x7749('0x2c')][_0x7749('0x47')]({'where':{'id':_0x1ddec3[_0x7749('0x45')]['id']}})['then'](handleEntityNotFound(_0x57182f,null))[_0x7749('0x27')](saveUpdates(_0x1ddec3[_0x7749('0x4a')],null))[_0x7749('0x27')](respondWithResult(_0x57182f,null))[_0x7749('0x48')](handleError(_0x57182f,null));};exports[_0x7749('0x28')]=function(_0x38ff22,_0x5b0f6b){return db['VoiceMailMessage']['find']({'where':{'id':_0x38ff22[_0x7749('0x45')]['id']}})[_0x7749('0x27')](handleEntityNotFound(_0x5b0f6b,null))['then'](removeEntity(_0x5b0f6b,null))[_0x7749('0x48')](handleError(_0x5b0f6b,null));};exports['download']=function(_0x292b77,_0x231263,_0x205d7f){return db[_0x7749('0x2c')][_0x7749('0x47')]({'where':{'id':_0x292b77[_0x7749('0x45')]['id']},'attributes':['id','recording',_0x7749('0x4b')]})[_0x7749('0x27')](handleEntityNotFound(_0x231263,null))[_0x7749('0x27')](function(_0x1902d6){if(_0x1902d6){if(!_0x1902d6['recording']){throw new db[(_0x7749('0x4c'))][(_0x7749('0x4d'))](_0x7749('0x4e'));}var _0x2a1e38={'Content-Type':_0x7749('0x4f'),'Content-Disposition':_0x7749('0x50')};if(_0x1902d6[_0x7749('0x4b')]){_0x2a1e38['Content-Disposition']=_0x7749('0x51')+_0x1902d6[_0x7749('0x4b')]+_0x7749('0x52');}_0x231263[_0x7749('0x53')](_0x2a1e38);return _0x231263['send'](new Buffer(_0x1902d6[_0x7749('0x54')]));}})[_0x7749('0x48')](handleError(_0x231263,null));};
\ No newline at end of file
+var _0x500d=['rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','update','recording','Sequelize','VoiceMailMessage\x20not\x20found','attachment','msg_id','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','error','stack','name','index','map','VoiceMailMessage'];(function(_0x2ed4c1,_0x4032e7){var _0x4bb3b1=function(_0x2081fb){while(--_0x2081fb){_0x2ed4c1['push'](_0x2ed4c1['shift']());}};_0x4bb3b1(++_0x4032e7);}(_0x500d,0xd4));var _0xd500=function(_0x5ecde7,_0x411905){_0x5ecde7=_0x5ecde7-0x0;var _0x4c037e=_0x500d[_0x5ecde7];return _0x4c037e;};'use strict';var emlformat=require(_0xd500('0x0'));var rimraf=require(_0xd500('0x1'));var zipdir=require(_0xd500('0x2'));var jsonpatch=require(_0xd500('0x3'));var rp=require(_0xd500('0x4'));var moment=require('moment');var BPromise=require(_0xd500('0x5'));var Mustache=require(_0xd500('0x6'));var util=require(_0xd500('0x7'));var path=require(_0xd500('0x8'));var sox=require(_0xd500('0x9'));var csv=require(_0xd500('0xa'));var ejs=require(_0xd500('0xb'));var fs=require('fs');var fs_extra=require(_0xd500('0xc'));var _=require(_0xd500('0xd'));var squel=require('squel');var crypto=require(_0xd500('0xe'));var jsforce=require(_0xd500('0xf'));var deskjs=require(_0xd500('0x10'));var toCsv=require(_0xd500('0xa'));var querystring=require(_0xd500('0x11'));var Papa=require(_0xd500('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd500('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd500('0x14'));var logger=require(_0xd500('0x15'))(_0xd500('0x16'));var utils=require('../../config/utils');var config=require(_0xd500('0x17'));var licenseUtil=require(_0xd500('0x18'));var db=require(_0xd500('0x19'))['db'];function respondWithStatusCode(_0x5e7e58,_0x53effe){_0x53effe=_0x53effe||0xcc;return function(_0x3e7700){if(_0x3e7700){return _0x5e7e58[_0xd500('0x1a')](_0x53effe);}return _0x5e7e58[_0xd500('0x1b')](_0x53effe)[_0xd500('0x1c')]();};}function respondWithResult(_0x3a9a0c,_0x50accc){_0x50accc=_0x50accc||0xc8;return function(_0x225233){if(_0x225233){return _0x3a9a0c[_0xd500('0x1b')](_0x50accc)[_0xd500('0x1d')](_0x225233);}};}function respondWithFilteredResult(_0x2b9a4a,_0xe9d007){return function(_0x7fa869){if(_0x7fa869){var _0x40282e=typeof _0xe9d007[_0xd500('0x1e')]===_0xd500('0x1f')&&typeof _0xe9d007[_0xd500('0x20')]===_0xd500('0x1f');var _0x4d2a35=_0x7fa869[_0xd500('0x21')];var _0x196b43=_0x40282e?0x0:_0xe9d007[_0xd500('0x1e')];var _0x13df80=_0x40282e?_0x7fa869['count']:_0xe9d007[_0xd500('0x1e')]+_0xe9d007[_0xd500('0x20')];var _0x5dc59f;if(_0x13df80>=_0x4d2a35){_0x13df80=_0x4d2a35;_0x5dc59f=0xc8;}else{_0x5dc59f=0xce;}_0x2b9a4a[_0xd500('0x1b')](_0x5dc59f);return _0x2b9a4a[_0xd500('0x22')](_0xd500('0x23'),_0x196b43+'-'+_0x13df80+'/'+_0x4d2a35)['json'](_0x7fa869);}return null;};}function patchUpdates(_0x121033){return function(_0x11caf3){try{jsonpatch[_0xd500('0x24')](_0x11caf3,_0x121033,!![]);}catch(_0x27d6b0){return BPromise['reject'](_0x27d6b0);}return _0x11caf3[_0xd500('0x25')]();};}function saveUpdates(_0x350798,_0xacd8a7){return function(_0x4ba5c9){if(_0x4ba5c9){return _0x4ba5c9['update'](_0x350798)['then'](function(_0x26e156){return _0x26e156;});}return null;};}function removeEntity(_0x5173dc,_0x37312a){return function(_0x43b0e8){if(_0x43b0e8){return _0x43b0e8[_0xd500('0x26')]()[_0xd500('0x27')](function(){_0x5173dc['status'](0xcc)[_0xd500('0x1c')]();});}};}function handleEntityNotFound(_0xc3977d,_0x2a4998){return function(_0x2563ef){if(!_0x2563ef){_0xc3977d[_0xd500('0x1a')](0x194);}return _0x2563ef;};}function handleError(_0x13cb49,_0x7367b0){_0x7367b0=_0x7367b0||0x1f4;return function(_0x5df43e){logger[_0xd500('0x28')](_0x5df43e[_0xd500('0x29')]);if(_0x5df43e[_0xd500('0x2a')]){delete _0x5df43e[_0xd500('0x2a')];}_0x13cb49[_0xd500('0x1b')](_0x7367b0)['send'](_0x5df43e);};}exports[_0xd500('0x2b')]=function(_0x18209c,_0x3af62b){var _0x2954d5={},_0xf80d0a={},_0x4b1bff={'count':0x0,'rows':[]};var _0x7f2be2=_[_0xd500('0x2c')](db[_0xd500('0x2d')][_0xd500('0x2e')],function(_0x3a8581){return{'name':_0x3a8581[_0xd500('0x2f')],'type':_0x3a8581[_0xd500('0x30')][_0xd500('0x31')]};});_0xf80d0a[_0xd500('0x32')]=_[_0xd500('0x33')](_[_0xd500('0x2c')](_0x7f2be2,_0xd500('0x2a')),[_0xd500('0x2a')]);_0xf80d0a[_0xd500('0x34')]=_[_0xd500('0x35')](_0x18209c['query']);_0xf80d0a[_0xd500('0x36')]=_[_0xd500('0x37')](_0xf80d0a[_0xd500('0x32')],_0xf80d0a[_0xd500('0x34')]);_0x2954d5['attributes']=_[_0xd500('0x37')](_0xf80d0a[_0xd500('0x32')],qs['fields'](_0x18209c['query'][_0xd500('0x38')]));_0x2954d5[_0xd500('0x39')]=_0x2954d5[_0xd500('0x39')][_0xd500('0x3a')]?_0x2954d5['attributes']:_0xf80d0a[_0xd500('0x32')];if(!_0x18209c['query'][_0xd500('0x3b')](_0xd500('0x3c'))){_0x2954d5[_0xd500('0x20')]=qs[_0xd500('0x20')](_0x18209c[_0xd500('0x34')][_0xd500('0x20')]);_0x2954d5[_0xd500('0x1e')]=qs[_0xd500('0x1e')](_0x18209c['query'][_0xd500('0x1e')]);}_0x2954d5['order']=qs[_0xd500('0x3d')](_0x18209c[_0xd500('0x34')][_0xd500('0x3d')]);_0x2954d5[_0xd500('0x3e')]=qs[_0xd500('0x36')](_[_0xd500('0x3f')](_0x18209c[_0xd500('0x34')],_0xf80d0a[_0xd500('0x36')]),_0x7f2be2);if(_0x18209c[_0xd500('0x34')][_0xd500('0x40')]){_0x2954d5[_0xd500('0x3e')]=_[_0xd500('0x41')](_0x2954d5[_0xd500('0x3e')],{'$or':_[_0xd500('0x2c')](_0x7f2be2,function(_0x54d21e){if(_0x54d21e[_0xd500('0x30')]!==_0xd500('0x42')){var _0x12717a={};_0x12717a[_0x54d21e[_0xd500('0x2a')]]={'$like':'%'+_0x18209c[_0xd500('0x34')][_0xd500('0x40')]+'%'};return _0x12717a;}})});}_0x2954d5=_['merge']({},_0x2954d5,_0x18209c['options']);var _0x31b9a1={'where':_0x2954d5[_0xd500('0x3e')]};return db['VoiceMailMessage']['count'](_0x31b9a1)[_0xd500('0x27')](function(_0x495092){_0x4b1bff[_0xd500('0x21')]=_0x495092;if(_0x18209c[_0xd500('0x34')][_0xd500('0x43')]){_0x2954d5[_0xd500('0x44')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xd500('0x45')](_0x2954d5);})['then'](function(_0x2a60bc){_0x4b1bff[_0xd500('0x46')]=_0x2a60bc;return _0x4b1bff;})[_0xd500('0x27')](respondWithFilteredResult(_0x3af62b,_0x2954d5))[_0xd500('0x47')](handleError(_0x3af62b,null));};exports[_0xd500('0x48')]=function(_0x1552f6,_0x5d2e9d){var _0x576ca2={'raw':!![],'where':{'id':_0x1552f6[_0xd500('0x49')]['id']}},_0x3a8da4={};_0x3a8da4[_0xd500('0x32')]=_[_0xd500('0x35')](db[_0xd500('0x2d')]['rawAttributes']);_0x3a8da4[_0xd500('0x34')]=_[_0xd500('0x35')](_0x1552f6[_0xd500('0x34')]);_0x3a8da4[_0xd500('0x36')]=_['intersection'](_0x3a8da4[_0xd500('0x32')],_0x3a8da4['query']);_0x576ca2[_0xd500('0x39')]=_[_0xd500('0x37')](_0x3a8da4[_0xd500('0x32')],qs['fields'](_0x1552f6[_0xd500('0x34')][_0xd500('0x38')]));_0x576ca2['attributes']=_0x576ca2[_0xd500('0x39')]['length']?_0x576ca2[_0xd500('0x39')]:_0x3a8da4['model'];if(_0x1552f6['query'][_0xd500('0x43')]){_0x576ca2[_0xd500('0x44')]=[{'all':!![]}];}_0x576ca2=_[_0xd500('0x41')]({},_0x576ca2,_0x1552f6[_0xd500('0x4a')]);return db[_0xd500('0x2d')][_0xd500('0x4b')](_0x576ca2)[_0xd500('0x27')](handleEntityNotFound(_0x5d2e9d,null))[_0xd500('0x27')](respondWithResult(_0x5d2e9d,null))['catch'](handleError(_0x5d2e9d,null));};exports['create']=function(_0x506643,_0xed5163){return db['VoiceMailMessage'][_0xd500('0x4c')](_0x506643[_0xd500('0x4d')],{})[_0xd500('0x27')](respondWithResult(_0xed5163,0xc9))[_0xd500('0x47')](handleError(_0xed5163,null));};exports[_0xd500('0x4e')]=function(_0x35fb44,_0x2aeee0){if(_0x35fb44['body']['id']){delete _0x35fb44[_0xd500('0x4d')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x35fb44['params']['id']}})[_0xd500('0x27')](handleEntityNotFound(_0x2aeee0,null))[_0xd500('0x27')](saveUpdates(_0x35fb44[_0xd500('0x4d')],null))[_0xd500('0x27')](respondWithResult(_0x2aeee0,null))['catch'](handleError(_0x2aeee0,null));};exports[_0xd500('0x26')]=function(_0x221e1c,_0x55c038){return db[_0xd500('0x2d')][_0xd500('0x4b')]({'where':{'id':_0x221e1c[_0xd500('0x49')]['id']}})[_0xd500('0x27')](handleEntityNotFound(_0x55c038,null))[_0xd500('0x27')](removeEntity(_0x55c038,null))['catch'](handleError(_0x55c038,null));};exports['download']=function(_0x3a3004,_0x2e0637,_0x40be75){return db[_0xd500('0x2d')]['find']({'where':{'id':_0x3a3004[_0xd500('0x49')]['id']},'attributes':['id','recording','msg_id']})[_0xd500('0x27')](handleEntityNotFound(_0x2e0637,null))[_0xd500('0x27')](function(_0x5a66d9){if(_0x5a66d9){if(!_0x5a66d9[_0xd500('0x4f')]){throw new db[(_0xd500('0x50'))]['ValidationError'](_0xd500('0x51'));}var _0xb05591={'Content-Type':'audio/wav','Content-Disposition':_0xd500('0x52')};if(_0x5a66d9[_0xd500('0x53')]){_0xb05591['Content-Disposition']=_0xd500('0x54')+_0x5a66d9[_0xd500('0x53')]+_0xd500('0x55');}_0x2e0637[_0xd500('0x22')](_0xb05591);return _0x2e0637['send'](new Buffer(_0x5a66d9[_0xd500('0x4f')]));}})[_0xd500('0x47')](handleError(_0x2e0637,null));};
\ No newline at end of file
index c8deca0..d1ff7b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bdf=['request-promise','path','rimraf','../../config/environment','exports','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird'];(function(_0x648163,_0x241576){var _0x199d4d=function(_0x23055d){while(--_0x23055d){_0x648163['push'](_0x648163['shift']());}};_0x199d4d(++_0x241576);}(_0x6bdf,0x10f));var _0xf6bd=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x6bdf[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var util=require(_0xf6bd('0x0'));var logger=require(_0xf6bd('0x1'))(_0xf6bd('0x2'));var moment=require(_0xf6bd('0x3'));var BPromise=require(_0xf6bd('0x4'));var rp=require(_0xf6bd('0x5'));var fs=require('fs');var path=require(_0xf6bd('0x6'));var rimraf=require(_0xf6bd('0x7'));var config=require(_0xf6bd('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0xf6bd('0x9')]=function(_0x525f5e,_0x378142){return _0x525f5e['define']('VoiceMailMessage',attributes,{'tableName':_0xf6bd('0xa'),'paranoid':![],'indexes':[{'name':_0xf6bd('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0x25c1=['api','moment','bluebird','path','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages'];(function(_0x289fc6,_0x24f58b){var _0x2a2e5c=function(_0x315f7a){while(--_0x315f7a){_0x289fc6['push'](_0x289fc6['shift']());}};_0x2a2e5c(++_0x24f58b);}(_0x25c1,0x68));var _0x125c=function(_0x1ed198,_0x27f904){_0x1ed198=_0x1ed198-0x0;var _0x42507d=_0x25c1[_0x1ed198];return _0x42507d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x125c('0x0'));var moment=require(_0x125c('0x1'));var BPromise=require(_0x125c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x125c('0x3'));var rimraf=require('rimraf');var config=require(_0x125c('0x4'));var attributes=require(_0x125c('0x5'));module['exports']=function(_0x5363cb,_0x5d3fd9){return _0x5363cb[_0x125c('0x6')]('VoiceMailMessage',attributes,{'tableName':_0x125c('0x7'),'paranoid':![],'indexes':[{'name':'dir','fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 7998bad..8ebd749 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe7a=['../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xbe7a,0x12f));var _0xabe7=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xbe7a[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xabe7('0x0'));var util=require('util');var moment=require(_0xabe7('0x1'));var BPromise=require(_0xabe7('0x2'));var rs=require(_0xabe7('0x3'));var fs=require('fs');var Redis=require(_0xabe7('0x4'));var db=require(_0xabe7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xabe7('0x6'));var config=require(_0xabe7('0x7'));var jayson=require(_0xabe7('0x8'));var client=jayson[_0xabe7('0x9')][_0xabe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cb148,_0x4fd649,_0x1b4961){return new BPromise(function(_0x2507ec,_0x497699){return client[_0xabe7('0xb')](_0x4cb148,_0x1b4961)[_0xabe7('0xc')](function(_0x1f5b54){logger[_0xabe7('0xd')](_0xabe7('0xe'),_0x4fd649,_0xabe7('0xf'));logger[_0xabe7('0x10')](_0xabe7('0x11'),_0x4fd649,_0xabe7('0xf'),JSON['stringify'](_0x1f5b54));if(_0x1f5b54['error']){if(_0x1f5b54[_0xabe7('0x12')]['code']===0x1f4){logger[_0xabe7('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x4fd649,_0x1f5b54[_0xabe7('0x12')][_0xabe7('0x13')]);return _0x497699(_0x1f5b54[_0xabe7('0x12')]['message']);}logger[_0xabe7('0x12')](_0xabe7('0xe'),_0x4fd649,_0x1f5b54[_0xabe7('0x12')][_0xabe7('0x13')]);return _0x2507ec(_0x1f5b54['error'][_0xabe7('0x13')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x4fd649,_0xabe7('0xf'));_0x2507ec(_0x1f5b54[_0xabe7('0x14')][_0xabe7('0x13')]);}})[_0xabe7('0x15')](function(_0xdbda){logger[_0xabe7('0x12')](_0xabe7('0xe'),_0x4fd649,_0xdbda);_0x497699(_0xdbda);});});}
\ No newline at end of file
+var _0x53bf=['request\x20sent','debug','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x549fb7,_0x15340a){var _0x2d5ba4=function(_0x45b2c3){while(--_0x45b2c3){_0x549fb7['push'](_0x549fb7['shift']());}};_0x2d5ba4(++_0x15340a);}(_0x53bf,0xe0));var _0xf53b=function(_0x549de9,_0x57a310){_0x549de9=_0x549de9-0x0;var _0x24438d=_0x53bf[_0x549de9];return _0x24438d;};'use strict';var _=require(_0xf53b('0x0'));var util=require('util');var moment=require(_0xf53b('0x1'));var BPromise=require(_0xf53b('0x2'));var rs=require(_0xf53b('0x3'));var fs=require('fs');var Redis=require(_0xf53b('0x4'));var db=require(_0xf53b('0x5'))['db'];var utils=require(_0xf53b('0x6'));var logger=require(_0xf53b('0x7'))(_0xf53b('0x8'));var config=require(_0xf53b('0x9'));var jayson=require(_0xf53b('0xa'));var client=jayson[_0xf53b('0xb')][_0xf53b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x256930,_0x24d514,_0x36c92e){return new BPromise(function(_0x15c781,_0x5e950a){return client[_0xf53b('0xd')](_0x256930,_0x36c92e)[_0xf53b('0xe')](function(_0x5942c1){logger[_0xf53b('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x24d514,_0xf53b('0x10'));logger[_0xf53b('0x11')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x24d514,_0xf53b('0x10'),JSON[_0xf53b('0x12')](_0x5942c1));if(_0x5942c1[_0xf53b('0x13')]){if(_0x5942c1['error'][_0xf53b('0x14')]===0x1f4){logger['error'](_0xf53b('0x15'),_0x24d514,_0x5942c1[_0xf53b('0x13')]['message']);return _0x5e950a(_0x5942c1[_0xf53b('0x13')]['message']);}logger[_0xf53b('0x13')](_0xf53b('0x15'),_0x24d514,_0x5942c1[_0xf53b('0x13')][_0xf53b('0x16')]);return _0x15c781(_0x5942c1[_0xf53b('0x13')]['message']);}else{logger[_0xf53b('0xf')](_0xf53b('0x15'),_0x24d514,_0xf53b('0x10'));_0x15c781(_0x5942c1[_0xf53b('0x17')][_0xf53b('0x16')]);}})['catch'](function(_0x3cae5e){logger[_0xf53b('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x24d514,_0x3cae5e);_0x5e950a(_0x3cae5e);});});}
\ No newline at end of file
index ac72b44..317f1af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfddf=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','create','addSound','put','update','delete','/:id/sounds/:id2','removeSound'];(function(_0x306646,_0xdc2e1b){var _0x40bd8d=function(_0x397d05){while(--_0x397d05){_0x306646['push'](_0x306646['shift']());}};_0x40bd8d(++_0xdc2e1b);}(_0xfddf,0xa2));var _0xffdd=function(_0x4423d7,_0x3c3cce){_0x4423d7=_0x4423d7-0x0;var _0x1a3a54=_0xfddf[_0x4423d7];return _0x1a3a54;};'use strict';var multer=require(_0xffdd('0x0'));var util=require(_0xffdd('0x1'));var path=require(_0xffdd('0x2'));var timeout=require(_0xffdd('0x3'));var express=require(_0xffdd('0x4'));var router=express[_0xffdd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xffdd('0x6'));var config=require('../../config/environment');var controller=require(_0xffdd('0x7'));router[_0xffdd('0x8')]('/',auth[_0xffdd('0x9')](),controller[_0xffdd('0xa')]);router[_0xffdd('0x8')](_0xffdd('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xffdd('0x8')](_0xffdd('0xc'),auth[_0xffdd('0x9')](),controller[_0xffdd('0xd')]);router[_0xffdd('0xe')]('/',auth[_0xffdd('0x9')](),controller[_0xffdd('0xf')]);router['post'](_0xffdd('0xc'),auth['isAuthenticated'](),controller[_0xffdd('0x10')]);router[_0xffdd('0x11')](_0xffdd('0xb'),auth[_0xffdd('0x9')](),controller[_0xffdd('0x12')]);router[_0xffdd('0x13')](_0xffdd('0xb'),auth[_0xffdd('0x9')](),controller['destroy']);router[_0xffdd('0x13')](_0xffdd('0x14'),auth['isAuthenticated'](),controller[_0xffdd('0x15')]);module[_0xffdd('0x16')]=router;
\ No newline at end of file
+var _0x01e3=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','show','/:id/sounds','create','post','addSound','put','/:id','update','delete','destroy','util'];(function(_0x17cc51,_0xab2c8b){var _0x3ebd3f=function(_0x3fa9c5){while(--_0x3fa9c5){_0x17cc51['push'](_0x17cc51['shift']());}};_0x3ebd3f(++_0xab2c8b);}(_0x01e3,0x153));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x301e('0x0'));var path=require('path');var timeout=require(_0x301e('0x1'));var express=require('express');var router=express[_0x301e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x301e('0x3'));var interaction=require(_0x301e('0x4'));var config=require(_0x301e('0x5'));var controller=require(_0x301e('0x6'));router[_0x301e('0x7')]('/',auth[_0x301e('0x8')](),controller[_0x301e('0x9')]);router[_0x301e('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x301e('0xa')]);router[_0x301e('0x7')](_0x301e('0xb'),auth['isAuthenticated'](),controller['getSounds']);router['post']('/',auth[_0x301e('0x8')](),controller[_0x301e('0xc')]);router[_0x301e('0xd')](_0x301e('0xb'),auth[_0x301e('0x8')](),controller[_0x301e('0xe')]);router[_0x301e('0xf')](_0x301e('0x10'),auth[_0x301e('0x8')](),controller[_0x301e('0x11')]);router[_0x301e('0x12')](_0x301e('0x10'),auth[_0x301e('0x8')](),controller[_0x301e('0x13')]);router['delete']('/:id/sounds/:id2',auth[_0x301e('0x8')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index 989bac5..bdebc1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9ee=['mp3','TIMESTAMP','sequelize','STRING','ENUM','custom','files','quietmp3nb','quietmp3'];(function(_0x4869a6,_0x1153c2){var _0x718e6f=function(_0x3af1aa){while(--_0x3af1aa){_0x4869a6['push'](_0x4869a6['shift']());}};_0x718e6f(++_0x1153c2);}(_0xe9ee,0xb6));var _0xee9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9ee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee9e('0x0'));module['exports']={'name':{'type':Sequelize[_0xee9e('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0xee9e('0x2')](_0xee9e('0x3'),_0xee9e('0x4'),'mp3nb',_0xee9e('0x5'),_0xee9e('0x6'),_0xee9e('0x7')),'allowNull':!![],'defaultValue':_0xee9e('0x4')},'directory':{'type':Sequelize[_0xee9e('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xee9e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xee9e('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0xee9e('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc2a8=['name','custom','files','mp3nb','quietmp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x222401,_0x4b144c){var _0x4e35eb=function(_0x20e5a9){while(--_0x20e5a9){_0x222401['push'](_0x222401['shift']());}};_0x4e35eb(++_0x4b144c);}(_0xc2a8,0x13f));var _0x8c2a=function(_0x2bdf12,_0x1f7890){_0x2bdf12=_0x2bdf12-0x0;var _0x4d1bbb=_0xc2a8[_0x2bdf12];return _0x4d1bbb;};'use strict';var Sequelize=require(_0x8c2a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8c2a('0x1')},'mode':{'type':Sequelize['ENUM'](_0x8c2a('0x2'),_0x8c2a('0x3'),_0x8c2a('0x4'),'quietmp3nb',_0x8c2a('0x5'),'mp3'),'allowNull':!![],'defaultValue':_0x8c2a('0x3')},'directory':{'type':Sequelize[_0x8c2a('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0x8c2a('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8c2a('0x6')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x8c2a('0x7')},'format':{'type':Sequelize[_0x8c2a('0x6')],'allowNull':!![]},'stamp':{'type':_0x8c2a('0x8')},'defaultEntry':{'type':Sequelize[_0x8c2a('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index 3b1ab30..4d596dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ceb=['include','options','find','body','catch','create','sequelize','files','directory','join','root','0777','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','server/files/moh','format','removeSound','id2','getSounds','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','findAll','rows','show','params','includeAll'];(function(_0x1b265d,_0x2479ed){var _0x30c3d9=function(_0x267d9d){while(--_0x267d9d){_0x1b265d['push'](_0x1b265d['shift']());}};_0x30c3d9(++_0x2479ed);}(_0x7ceb,0x8f));var _0xb7ce=function(_0x10cda4,_0x22b99b){_0x10cda4=_0x10cda4-0x0;var _0x364bed=_0x7ceb[_0x10cda4];return _0x364bed;};'use strict';var emlformat=require(_0xb7ce('0x0'));var rimraf=require(_0xb7ce('0x1'));var zipdir=require(_0xb7ce('0x2'));var jsonpatch=require(_0xb7ce('0x3'));var rp=require('request-promise');var moment=require(_0xb7ce('0x4'));var BPromise=require(_0xb7ce('0x5'));var Mustache=require(_0xb7ce('0x6'));var util=require(_0xb7ce('0x7'));var path=require(_0xb7ce('0x8'));var sox=require('sox');var csv=require(_0xb7ce('0x9'));var ejs=require(_0xb7ce('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb7ce('0xb'));var jsforce=require(_0xb7ce('0xc'));var deskjs=require(_0xb7ce('0xd'));var toCsv=require(_0xb7ce('0x9'));var querystring=require(_0xb7ce('0xe'));var Papa=require('papaparse');var Redis=require(_0xb7ce('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb7ce('0x10'));var as=require(_0xb7ce('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb7ce('0x12'));var utils=require(_0xb7ce('0x13'));var config=require(_0xb7ce('0x14'));var licenseUtil=require(_0xb7ce('0x15'));var db=require(_0xb7ce('0x16'))['db'];function respondWithStatusCode(_0x454ff9,_0x10dbaf){_0x10dbaf=_0x10dbaf||0xcc;return function(_0x3be80f){if(_0x3be80f){return _0x454ff9[_0xb7ce('0x17')](_0x10dbaf);}return _0x454ff9[_0xb7ce('0x18')](_0x10dbaf)[_0xb7ce('0x19')]();};}function respondWithResult(_0x116f3c,_0x4d345d){_0x4d345d=_0x4d345d||0xc8;return function(_0x56824b){if(_0x56824b){return _0x116f3c[_0xb7ce('0x18')](_0x4d345d)[_0xb7ce('0x1a')](_0x56824b);}};}function respondWithFilteredResult(_0x1946d7,_0x6d060d){return function(_0x6ddf47){if(_0x6ddf47){var _0x326715=typeof _0x6d060d[_0xb7ce('0x1b')]===_0xb7ce('0x1c')&&typeof _0x6d060d[_0xb7ce('0x1d')]===_0xb7ce('0x1c');var _0x752d4e=_0x6ddf47[_0xb7ce('0x1e')];var _0x305a66=_0x326715?0x0:_0x6d060d[_0xb7ce('0x1b')];var _0x2ddf76=_0x326715?_0x6ddf47[_0xb7ce('0x1e')]:_0x6d060d[_0xb7ce('0x1b')]+_0x6d060d[_0xb7ce('0x1d')];var _0x34f3b1;if(_0x2ddf76>=_0x752d4e){_0x2ddf76=_0x752d4e;_0x34f3b1=0xc8;}else{_0x34f3b1=0xce;}_0x1946d7[_0xb7ce('0x18')](_0x34f3b1);return _0x1946d7['set'](_0xb7ce('0x1f'),_0x305a66+'-'+_0x2ddf76+'/'+_0x752d4e)[_0xb7ce('0x1a')](_0x6ddf47);}return null;};}function patchUpdates(_0x297617){return function(_0x41ecd5){try{jsonpatch[_0xb7ce('0x20')](_0x41ecd5,_0x297617,!![]);}catch(_0x2315c5){return BPromise['reject'](_0x2315c5);}return _0x41ecd5[_0xb7ce('0x21')]();};}function saveUpdates(_0x4ce7d8,_0x4f6603){return function(_0x4c067b){if(_0x4c067b){return _0x4c067b[_0xb7ce('0x22')](_0x4ce7d8)['then'](function(_0x3b7115){return _0x3b7115;});}return null;};}function removeEntity(_0x53ff2e,_0x47a195){return function(_0x2f0ac9){if(_0x2f0ac9){return _0x2f0ac9['destroy']()[_0xb7ce('0x23')](function(){var _0x5bf041=_0x2f0ac9[_0xb7ce('0x24')]({'plain':!![]});var _0x17e4d7=_0xb7ce('0x25');return db[_0xb7ce('0x26')][_0xb7ce('0x27')]({'where':{'type':_0x17e4d7,'resourceId':_0x5bf041['id']}})[_0xb7ce('0x23')](function(){return _0x2f0ac9;});})['then'](function(){_0x53ff2e['status'](0xcc)[_0xb7ce('0x19')]();});}};}function handleEntityNotFound(_0x442f23,_0x522b60){return function(_0x1e0aae){if(!_0x1e0aae){_0x442f23[_0xb7ce('0x17')](0x194);}return _0x1e0aae;};}function handleError(_0x24f7f1,_0x5191af){_0x5191af=_0x5191af||0x1f4;return function(_0x13cacd){logger['error'](_0x13cacd['stack']);if(_0x13cacd[_0xb7ce('0x28')]){delete _0x13cacd[_0xb7ce('0x28')];}_0x24f7f1[_0xb7ce('0x18')](_0x5191af)[_0xb7ce('0x29')](_0x13cacd);};}exports[_0xb7ce('0x2a')]=function(_0x1b98ab,_0xb343b7){var _0x77c3f6={},_0x4ac774={},_0x425a9f={'count':0x0,'rows':[]};var _0x398676=_[_0xb7ce('0x2b')](db[_0xb7ce('0x2c')][_0xb7ce('0x2d')],function(_0x504a44){return{'name':_0x504a44[_0xb7ce('0x2e')],'type':_0x504a44[_0xb7ce('0x2f')]['key']};});_0x4ac774[_0xb7ce('0x30')]=_[_0xb7ce('0x2b')](_0x398676,'name');_0x4ac774[_0xb7ce('0x31')]=_[_0xb7ce('0x32')](_0x1b98ab[_0xb7ce('0x31')]);_0x4ac774[_0xb7ce('0x33')]=_[_0xb7ce('0x34')](_0x4ac774[_0xb7ce('0x30')],_0x4ac774['query']);_0x77c3f6[_0xb7ce('0x35')]=_['intersection'](_0x4ac774[_0xb7ce('0x30')],qs[_0xb7ce('0x36')](_0x1b98ab['query'][_0xb7ce('0x36')]));_0x77c3f6[_0xb7ce('0x35')]=_0x77c3f6[_0xb7ce('0x35')][_0xb7ce('0x37')]?_0x77c3f6[_0xb7ce('0x35')]:_0x4ac774['model'];if(!_0x1b98ab[_0xb7ce('0x31')][_0xb7ce('0x38')]('nolimit')){_0x77c3f6[_0xb7ce('0x1d')]=qs[_0xb7ce('0x1d')](_0x1b98ab['query'][_0xb7ce('0x1d')]);_0x77c3f6[_0xb7ce('0x1b')]=qs[_0xb7ce('0x1b')](_0x1b98ab[_0xb7ce('0x31')][_0xb7ce('0x1b')]);}_0x77c3f6[_0xb7ce('0x39')]=qs[_0xb7ce('0x3a')](_0x1b98ab[_0xb7ce('0x31')][_0xb7ce('0x3a')]);delete _0x1b98ab['query'][_0xb7ce('0x3a')];_0x77c3f6['where']=qs[_0xb7ce('0x33')](_[_0xb7ce('0x3b')](_0x1b98ab[_0xb7ce('0x31')],_0x4ac774['filters']),_0x398676);if(_0x1b98ab['query'][_0xb7ce('0x3c')]){_0x77c3f6[_0xb7ce('0x3d')]=_[_0xb7ce('0x3e')](_0x77c3f6[_0xb7ce('0x3d')],{'$or':_[_0xb7ce('0x2b')](_0x398676,function(_0x3a3180){if(_0x3a3180[_0xb7ce('0x2f')]!==_0xb7ce('0x3f')){var _0x5d2b21={};_0x5d2b21[_0x3a3180[_0xb7ce('0x28')]]={'$like':'%'+_0x1b98ab[_0xb7ce('0x31')][_0xb7ce('0x3c')]+'%'};return _0x5d2b21;}})});}_0x77c3f6=_[_0xb7ce('0x3e')]({},_0x77c3f6,_0x1b98ab['options']);var _0x5712aa={'where':_0x77c3f6['where']};return db[_0xb7ce('0x2c')]['count'](_0x5712aa)[_0xb7ce('0x23')](function(_0x38d34c){_0x425a9f['count']=_0x38d34c;if(_0x1b98ab[_0xb7ce('0x31')]['includeAll']){_0x77c3f6['include']=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xb7ce('0x40')](_0x77c3f6);})[_0xb7ce('0x23')](function(_0x24663d){_0x425a9f[_0xb7ce('0x41')]=_0x24663d;return _0x425a9f;})['then'](respondWithFilteredResult(_0xb343b7,_0x77c3f6))['catch'](handleError(_0xb343b7,null));};exports[_0xb7ce('0x42')]=function(_0x29791d,_0x27a6b9){var _0x5de339={'raw':![],'where':{'id':_0x29791d[_0xb7ce('0x43')]['id']}},_0x13a342={};_0x13a342[_0xb7ce('0x30')]=_[_0xb7ce('0x32')](db[_0xb7ce('0x2c')]['rawAttributes']);_0x13a342[_0xb7ce('0x31')]=_[_0xb7ce('0x32')](_0x29791d['query']);_0x13a342['filters']=_[_0xb7ce('0x34')](_0x13a342[_0xb7ce('0x30')],_0x13a342[_0xb7ce('0x31')]);_0x5de339[_0xb7ce('0x35')]=_[_0xb7ce('0x34')](_0x13a342['model'],qs['fields'](_0x29791d['query'][_0xb7ce('0x36')]));_0x5de339[_0xb7ce('0x35')]=_0x5de339['attributes'][_0xb7ce('0x37')]?_0x5de339[_0xb7ce('0x35')]:_0x13a342['model'];if(_0x29791d['query'][_0xb7ce('0x44')]){_0x5de339[_0xb7ce('0x45')]=[{'all':!![]}];}_0x5de339=_['merge']({},_0x5de339,_0x29791d[_0xb7ce('0x46')]);return db[_0xb7ce('0x2c')][_0xb7ce('0x47')](_0x5de339)['then'](handleEntityNotFound(_0x27a6b9,null))[_0xb7ce('0x23')](respondWithResult(_0x27a6b9,null))['catch'](handleError(_0x27a6b9,null));};exports['update']=function(_0x2216b0,_0x4ad2c1){if(_0x2216b0[_0xb7ce('0x48')]['id']){delete _0x2216b0['body']['id'];}return db[_0xb7ce('0x2c')][_0xb7ce('0x47')]({'where':{'id':_0x2216b0[_0xb7ce('0x43')]['id']}})[_0xb7ce('0x23')](handleEntityNotFound(_0x4ad2c1,null))[_0xb7ce('0x23')](saveUpdates(_0x2216b0[_0xb7ce('0x48')],null))[_0xb7ce('0x23')](respondWithResult(_0x4ad2c1,null))[_0xb7ce('0x49')](handleError(_0x4ad2c1,null));};exports[_0xb7ce('0x4a')]=function(_0x3868bf,_0x1c52d8,_0x1c1bd7){return db[_0xb7ce('0x4b')]['transaction'](function(_0x5889b7){if(_0x3868bf['body']['mode']===_0xb7ce('0x4c')){_0x3868bf[_0xb7ce('0x48')][_0xb7ce('0x4d')]=path[_0xb7ce('0x4e')](config[_0xb7ce('0x4f')],'server/files/moh',_0x3868bf[_0xb7ce('0x48')][_0xb7ce('0x28')]);}return db[_0xb7ce('0x2c')]['create'](_0x3868bf[_0xb7ce('0x48')],{'transaction':_0x5889b7})[_0xb7ce('0x23')](function(_0x5f1393){if(_0x3868bf[_0xb7ce('0x48')]['mode']===_0xb7ce('0x4c')){fs['mkdirSync'](_0x5f1393[_0xb7ce('0x4d')],parseInt(_0xb7ce('0x50'),0x8));}var _0x4cf9d3=_0x3868bf['user'][_0xb7ce('0x24')]({'plain':!![]});if(!_0x4cf9d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf9d3[_0xb7ce('0x51')]===_0xb7ce('0x52')){var _0x549a62=_0x5f1393[_0xb7ce('0x24')]({'plain':!![]});return db['UserProfileSection'][_0xb7ce('0x47')]({'where':{'name':_0xb7ce('0x25'),'userProfileId':_0x4cf9d3['userProfileId']},'raw':!![]})[_0xb7ce('0x23')](function(_0x59791e){if(_0x59791e&&_0x59791e[_0xb7ce('0x53')]===0x0){return db[_0xb7ce('0x26')][_0xb7ce('0x4a')]({'name':_0x549a62[_0xb7ce('0x28')],'resourceId':_0x549a62['id'],'type':_0x59791e['name'],'sectionId':_0x59791e['id']},{})[_0xb7ce('0x23')](function(){return _0x5f1393;});}else{return _0x5f1393;}})[_0xb7ce('0x49')](function(_0x142115){logger['error'](_0xb7ce('0x54'),_0x142115);});}return _0x5f1393;});})[_0xb7ce('0x23')](respondWithResult(_0x1c52d8,0xc9))[_0xb7ce('0x49')](handleError(_0x1c52d8,null));};exports['destroy']=function(_0xe45809,_0x25a799,_0x88d576){var _0x3e9ef2;return db['VoiceMusicOnHold'][_0xb7ce('0x47')]({'where':{'id':_0xe45809[_0xb7ce('0x43')]['id']}})[_0xb7ce('0x23')](function(_0x3d96b9){if(_0x3d96b9){return db[_0xb7ce('0x4b')][_0xb7ce('0x55')](function(_0x440484){return _0x3d96b9[_0xb7ce('0x27')]({'transaction':_0x440484,'raw':!![]})['then'](function(_0x5e97e0){if(_0x5e97e0[_0xb7ce('0x4d')]){fs['readdirSync'](_0x5e97e0[_0xb7ce('0x4d')])['forEach'](function(_0x2137cf){fs[_0xb7ce('0x56')](path[_0xb7ce('0x4e')](_0x5e97e0[_0xb7ce('0x4d')],_0x2137cf));});fs[_0xb7ce('0x57')](_0x5e97e0[_0xb7ce('0x4d')]);}return _0x5e97e0;});})[_0xb7ce('0x49')](function(_0x473102){throw new db[(_0xb7ce('0x58'))][(_0xb7ce('0x59'))](_0x473102[_0xb7ce('0x5a')]);});}})['then'](handleEntityNotFound(_0x25a799,null))[_0xb7ce('0x23')](removeEntity(_0x25a799,null))[_0xb7ce('0x49')](handleError(_0x25a799,null));};exports[_0xb7ce('0x5b')]=function(_0x409c2a,_0x425ec3,_0x35aad0){return db['sequelize'][_0xb7ce('0x55')](function(_0x55f9c7){var _0x6142d5;return db[_0xb7ce('0x2c')][_0xb7ce('0x47')]({'where':{'id':_0x409c2a[_0xb7ce('0x43')]['id']}})[_0xb7ce('0x23')](function(_0x48419b){if(_0x48419b){_0x6142d5=_0x48419b;return _0x48419b[_0xb7ce('0x5b')](_0x409c2a['body']['id'],{'transaction':_0x55f9c7});}})['then'](function(_0x30c599){if(_0x30c599){return db[_0xb7ce('0x5c')][_0xb7ce('0x5d')]({'where':{'id':_0x409c2a[_0xb7ce('0x48')]['id']},'attributes':['id','name',_0xb7ce('0x5e'),_0xb7ce('0x5f'),_0xb7ce('0x60')],'raw':!![]});}})[_0xb7ce('0x23')](function(_0xff1904){if(_0xff1904){var _0x30de57=path[_0xb7ce('0x4e')](config[_0xb7ce('0x4f')],_0xb7ce('0x61'),util['format'](_0xb7ce('0x62'),path[_0xb7ce('0x63')](_0xff1904[_0xb7ce('0x5e')],path['extname'](_0xff1904[_0xb7ce('0x5e')])),_0xff1904[_0xb7ce('0x5f')]));var _0x1c46b0=path['join'](config['root'],_0xb7ce('0x64'),_0x6142d5['name'],util[_0xb7ce('0x65')](_0xb7ce('0x62'),_0xff1904[_0xb7ce('0x28')],_0xff1904[_0xb7ce('0x5f')]));fs['symlinkSync'](_0x30de57,_0x1c46b0);return _0xff1904;}})[_0xb7ce('0x49')](function(_0x29d07e){throw new db[(_0xb7ce('0x58'))]['ValidationError'](_0x29d07e[_0xb7ce('0x5a')]);});})[_0xb7ce('0x23')](handleEntityNotFound(_0x425ec3,null))[_0xb7ce('0x23')](respondWithResult(_0x425ec3,0xc9))[_0xb7ce('0x49')](handleError(_0x425ec3,null));};exports[_0xb7ce('0x66')]=function(_0x29c26d,_0x2b9f93,_0x3bb84c){return db[_0xb7ce('0x4b')][_0xb7ce('0x55')](function(_0x1fc686){var _0x3e886f;return db[_0xb7ce('0x2c')][_0xb7ce('0x5d')]({'where':{'id':_0x29c26d[_0xb7ce('0x43')]['id']}})[_0xb7ce('0x23')](handleEntityNotFound(_0x2b9f93,null))[_0xb7ce('0x23')](function(_0x267fc9){if(_0x267fc9){_0x3e886f=_0x267fc9;return _0x267fc9[_0xb7ce('0x66')](_0x29c26d[_0xb7ce('0x43')][_0xb7ce('0x67')]);}})[_0xb7ce('0x23')](function(_0x10cf2e){if(_0x10cf2e){return db[_0xb7ce('0x5c')][_0xb7ce('0x5d')]({'where':{'id':_0x29c26d['params']['id2']},'attributes':['id',_0xb7ce('0x28'),_0xb7ce('0x5e'),_0xb7ce('0x5f'),_0xb7ce('0x60')],'raw':!![]});}})[_0xb7ce('0x23')](function(_0x5229c8){if(_0x5229c8){fs[_0xb7ce('0x56')](path[_0xb7ce('0x4e')](_0x3e886f['directory'],util[_0xb7ce('0x65')]('%s.%s',_0x5229c8[_0xb7ce('0x28')],_0x5229c8['converted_format'])));return _0x5229c8;}})[_0xb7ce('0x49')](function(_0x11d153){throw new db[(_0xb7ce('0x58'))][(_0xb7ce('0x59'))](_0x11d153[_0xb7ce('0x5a')]);});})[_0xb7ce('0x23')](handleEntityNotFound(_0x2b9f93,null))[_0xb7ce('0x23')](respondWithStatusCode(_0x2b9f93,0xcc))[_0xb7ce('0x49')](handleError(_0x2b9f93,null));};exports[_0xb7ce('0x68')]=function(_0x2cc29f,_0x34aa8c,_0xc3a02b){var _0x359d90={};var _0x243e59={};var _0x19dcd0;var _0x5c764c;return db[_0xb7ce('0x2c')][_0xb7ce('0x5d')]({'where':{'id':_0x2cc29f[_0xb7ce('0x43')]['id']}})[_0xb7ce('0x23')](handleEntityNotFound(_0x34aa8c,null))[_0xb7ce('0x23')](function(_0x1d2334){if(_0x1d2334){_0x19dcd0=_0x1d2334;_0x243e59[_0xb7ce('0x30')]=_[_0xb7ce('0x32')](db[_0xb7ce('0x5c')]['rawAttributes']);_0x243e59[_0xb7ce('0x31')]=_['keys'](_0x2cc29f['query']);_0x243e59[_0xb7ce('0x33')]=_['intersection'](_0x243e59[_0xb7ce('0x30')],_0x243e59[_0xb7ce('0x31')]);_0x359d90['attributes']=_[_0xb7ce('0x34')](_0x243e59['model'],qs[_0xb7ce('0x36')](_0x2cc29f[_0xb7ce('0x31')][_0xb7ce('0x36')]));_0x359d90[_0xb7ce('0x35')]=_0x359d90[_0xb7ce('0x35')][_0xb7ce('0x37')]?_0x359d90[_0xb7ce('0x35')]:_0x243e59[_0xb7ce('0x30')];_0x359d90[_0xb7ce('0x39')]=qs[_0xb7ce('0x3a')](_0x2cc29f['query']['sort']);_0x359d90[_0xb7ce('0x3d')]=qs[_0xb7ce('0x33')](_[_0xb7ce('0x3b')](_0x2cc29f['query'],_0x243e59[_0xb7ce('0x33')]));if(_0x2cc29f['query'][_0xb7ce('0x3c')]){_0x359d90[_0xb7ce('0x3d')]=_[_0xb7ce('0x3e')](_0x359d90['where'],{'$or':_[_0xb7ce('0x2b')](_0x359d90[_0xb7ce('0x35')],function(_0x1e092d){var _0x40b596={};_0x40b596[_0x1e092d]={'$like':'%'+_0x2cc29f[_0xb7ce('0x31')][_0xb7ce('0x3c')]+'%'};return _0x40b596;})});}_0x359d90=_['merge']({},_0x359d90,_0x2cc29f[_0xb7ce('0x46')]);return _0x19dcd0[_0xb7ce('0x68')](_0x359d90);}})[_0xb7ce('0x23')](function(_0x5885b0){if(_0x5885b0){_0x5c764c=_0x5885b0[_0xb7ce('0x37')];if(!_0x2cc29f[_0xb7ce('0x31')]['hasOwnProperty'](_0xb7ce('0x69'))){_0x359d90[_0xb7ce('0x1d')]=qs[_0xb7ce('0x1d')](_0x2cc29f['query'][_0xb7ce('0x1d')]);_0x359d90[_0xb7ce('0x1b')]=qs[_0xb7ce('0x1b')](_0x2cc29f[_0xb7ce('0x31')]['offset']);}return _0x19dcd0[_0xb7ce('0x68')](_0x359d90);}})[_0xb7ce('0x23')](function(_0xb0a9bc){if(_0xb0a9bc){return _0xb0a9bc?{'count':_0x5c764c,'rows':_0xb0a9bc}:null;}})[_0xb7ce('0x23')](respondWithResult(_0x34aa8c,null))[_0xb7ce('0x49')](handleError(_0x34aa8c,null));};
\ No newline at end of file
+var _0x5f84=['Sequelize','removeSound','id2','format','%s.%s','order','pick','getSounds','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','error','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','keys','intersection','attributes','query','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','length','find','body','create','sequelize','transaction','mode','files','directory','join','server/files/moh','mkdirSync','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','unlinkSync','rmdirSync','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','basename','extname','symlinkSync'];(function(_0x3bbaaa,_0x357da8){var _0x4b465c=function(_0x19da7d){while(--_0x19da7d){_0x3bbaaa['push'](_0x3bbaaa['shift']());}};_0x4b465c(++_0x357da8);}(_0x5f84,0x167));var _0x45f8=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5f84[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x45f8('0x0'));var rimraf=require(_0x45f8('0x1'));var zipdir=require(_0x45f8('0x2'));var jsonpatch=require(_0x45f8('0x3'));var rp=require(_0x45f8('0x4'));var moment=require(_0x45f8('0x5'));var BPromise=require(_0x45f8('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x45f8('0x7'));var sox=require(_0x45f8('0x8'));var csv=require(_0x45f8('0x9'));var ejs=require(_0x45f8('0xa'));var fs=require('fs');var fs_extra=require(_0x45f8('0xb'));var _=require('lodash');var squel=require(_0x45f8('0xc'));var crypto=require(_0x45f8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x45f8('0x9'));var querystring=require(_0x45f8('0xe'));var Papa=require(_0x45f8('0xf'));var Redis=require(_0x45f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x45f8('0x11'));var as=require(_0x45f8('0x12'));var hardwareService=require(_0x45f8('0x13'));var logger=require('../../config/logger')(_0x45f8('0x14'));var utils=require(_0x45f8('0x15'));var config=require(_0x45f8('0x16'));var licenseUtil=require(_0x45f8('0x17'));var db=require(_0x45f8('0x18'))['db'];function respondWithStatusCode(_0x2f68fe,_0x2b9fe2){_0x2b9fe2=_0x2b9fe2||0xcc;return function(_0x1db120){if(_0x1db120){return _0x2f68fe[_0x45f8('0x19')](_0x2b9fe2);}return _0x2f68fe[_0x45f8('0x1a')](_0x2b9fe2)[_0x45f8('0x1b')]();};}function respondWithResult(_0x2de213,_0x10a8a7){_0x10a8a7=_0x10a8a7||0xc8;return function(_0x3dad18){if(_0x3dad18){return _0x2de213[_0x45f8('0x1a')](_0x10a8a7)[_0x45f8('0x1c')](_0x3dad18);}};}function respondWithFilteredResult(_0x5415be,_0x2c4aab){return function(_0x342628){if(_0x342628){var _0x1a6641=typeof _0x2c4aab[_0x45f8('0x1d')]===_0x45f8('0x1e')&&typeof _0x2c4aab[_0x45f8('0x1f')]===_0x45f8('0x1e');var _0x122532=_0x342628[_0x45f8('0x20')];var _0x5c8608=_0x1a6641?0x0:_0x2c4aab['offset'];var _0x36ac78=_0x1a6641?_0x342628[_0x45f8('0x20')]:_0x2c4aab[_0x45f8('0x1d')]+_0x2c4aab[_0x45f8('0x1f')];var _0x224f51;if(_0x36ac78>=_0x122532){_0x36ac78=_0x122532;_0x224f51=0xc8;}else{_0x224f51=0xce;}_0x5415be['status'](_0x224f51);return _0x5415be[_0x45f8('0x21')](_0x45f8('0x22'),_0x5c8608+'-'+_0x36ac78+'/'+_0x122532)[_0x45f8('0x1c')](_0x342628);}return null;};}function patchUpdates(_0x3beb63){return function(_0x4a4c03){try{jsonpatch[_0x45f8('0x23')](_0x4a4c03,_0x3beb63,!![]);}catch(_0x26aebe){return BPromise[_0x45f8('0x24')](_0x26aebe);}return _0x4a4c03[_0x45f8('0x25')]();};}function saveUpdates(_0x15a057,_0x268cdc){return function(_0x523bd2){if(_0x523bd2){return _0x523bd2[_0x45f8('0x26')](_0x15a057)[_0x45f8('0x27')](function(_0x1d77b6){return _0x1d77b6;});}return null;};}function removeEntity(_0x277321,_0x1ba3e2){return function(_0x1a854f){if(_0x1a854f){return _0x1a854f[_0x45f8('0x28')]()[_0x45f8('0x27')](function(){var _0x438033=_0x1a854f[_0x45f8('0x29')]({'plain':!![]});var _0x222555=_0x45f8('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x222555,'resourceId':_0x438033['id']}})[_0x45f8('0x27')](function(){return _0x1a854f;});})[_0x45f8('0x27')](function(){_0x277321[_0x45f8('0x1a')](0xcc)[_0x45f8('0x1b')]();});}};}function handleEntityNotFound(_0x383b1f,_0x3bd7f9){return function(_0x4c9527){if(!_0x4c9527){_0x383b1f[_0x45f8('0x19')](0x194);}return _0x4c9527;};}function handleError(_0x3bcc4d,_0x5e250b){_0x5e250b=_0x5e250b||0x1f4;return function(_0x687463){logger[_0x45f8('0x2b')](_0x687463['stack']);if(_0x687463[_0x45f8('0x2c')]){delete _0x687463[_0x45f8('0x2c')];}_0x3bcc4d[_0x45f8('0x1a')](_0x5e250b)['send'](_0x687463);};}exports[_0x45f8('0x2d')]=function(_0x1f0098,_0x49028){var _0x428fcf={},_0xe7eef2={},_0x142a55={'count':0x0,'rows':[]};var _0x3189f1=_[_0x45f8('0x2e')](db[_0x45f8('0x2f')][_0x45f8('0x30')],function(_0x4e815d){return{'name':_0x4e815d[_0x45f8('0x31')],'type':_0x4e815d[_0x45f8('0x32')][_0x45f8('0x33')]};});_0xe7eef2[_0x45f8('0x34')]=_[_0x45f8('0x2e')](_0x3189f1,'name');_0xe7eef2['query']=_[_0x45f8('0x35')](_0x1f0098['query']);_0xe7eef2['filters']=_[_0x45f8('0x36')](_0xe7eef2[_0x45f8('0x34')],_0xe7eef2['query']);_0x428fcf[_0x45f8('0x37')]=_['intersection'](_0xe7eef2['model'],qs['fields'](_0x1f0098['query']['fields']));_0x428fcf[_0x45f8('0x37')]=_0x428fcf['attributes']['length']?_0x428fcf[_0x45f8('0x37')]:_0xe7eef2['model'];if(!_0x1f0098[_0x45f8('0x38')][_0x45f8('0x39')](_0x45f8('0x3a'))){_0x428fcf[_0x45f8('0x1f')]=qs[_0x45f8('0x1f')](_0x1f0098['query']['limit']);_0x428fcf[_0x45f8('0x1d')]=qs[_0x45f8('0x1d')](_0x1f0098[_0x45f8('0x38')][_0x45f8('0x1d')]);}_0x428fcf['order']=qs[_0x45f8('0x3b')](_0x1f0098['query'][_0x45f8('0x3b')]);delete _0x1f0098[_0x45f8('0x38')][_0x45f8('0x3b')];_0x428fcf[_0x45f8('0x3c')]=qs[_0x45f8('0x3d')](_['pick'](_0x1f0098[_0x45f8('0x38')],_0xe7eef2['filters']),_0x3189f1);if(_0x1f0098[_0x45f8('0x38')][_0x45f8('0x3e')]){_0x428fcf[_0x45f8('0x3c')]=_[_0x45f8('0x3f')](_0x428fcf[_0x45f8('0x3c')],{'$or':_[_0x45f8('0x2e')](_0x3189f1,function(_0x3c5067){if(_0x3c5067['type']!==_0x45f8('0x40')){var _0x3ba066={};_0x3ba066[_0x3c5067[_0x45f8('0x2c')]]={'$like':'%'+_0x1f0098[_0x45f8('0x38')][_0x45f8('0x3e')]+'%'};return _0x3ba066;}})});}_0x428fcf=_[_0x45f8('0x3f')]({},_0x428fcf,_0x1f0098[_0x45f8('0x41')]);var _0x5460de={'where':_0x428fcf[_0x45f8('0x3c')]};return db[_0x45f8('0x2f')][_0x45f8('0x20')](_0x5460de)[_0x45f8('0x27')](function(_0x54549b){_0x142a55[_0x45f8('0x20')]=_0x54549b;if(_0x1f0098['query'][_0x45f8('0x42')]){_0x428fcf[_0x45f8('0x43')]=[{'all':!![]}];}return db[_0x45f8('0x2f')][_0x45f8('0x44')](_0x428fcf);})[_0x45f8('0x27')](function(_0x1545ee){_0x142a55[_0x45f8('0x45')]=_0x1545ee;return _0x142a55;})[_0x45f8('0x27')](respondWithFilteredResult(_0x49028,_0x428fcf))[_0x45f8('0x46')](handleError(_0x49028,null));};exports[_0x45f8('0x47')]=function(_0x10a4d9,_0x821be7){var _0x30203e={'raw':![],'where':{'id':_0x10a4d9[_0x45f8('0x48')]['id']}},_0x306bd9={};_0x306bd9[_0x45f8('0x34')]=_[_0x45f8('0x35')](db[_0x45f8('0x2f')][_0x45f8('0x30')]);_0x306bd9[_0x45f8('0x38')]=_['keys'](_0x10a4d9[_0x45f8('0x38')]);_0x306bd9[_0x45f8('0x3d')]=_[_0x45f8('0x36')](_0x306bd9[_0x45f8('0x34')],_0x306bd9['query']);_0x30203e[_0x45f8('0x37')]=_['intersection'](_0x306bd9['model'],qs['fields'](_0x10a4d9[_0x45f8('0x38')][_0x45f8('0x49')]));_0x30203e[_0x45f8('0x37')]=_0x30203e[_0x45f8('0x37')][_0x45f8('0x4a')]?_0x30203e['attributes']:_0x306bd9['model'];if(_0x10a4d9[_0x45f8('0x38')][_0x45f8('0x42')]){_0x30203e[_0x45f8('0x43')]=[{'all':!![]}];}_0x30203e=_[_0x45f8('0x3f')]({},_0x30203e,_0x10a4d9['options']);return db[_0x45f8('0x2f')][_0x45f8('0x4b')](_0x30203e)['then'](handleEntityNotFound(_0x821be7,null))['then'](respondWithResult(_0x821be7,null))[_0x45f8('0x46')](handleError(_0x821be7,null));};exports['update']=function(_0x12aac4,_0x20dac5){if(_0x12aac4['body']['id']){delete _0x12aac4[_0x45f8('0x4c')]['id'];}return db[_0x45f8('0x2f')][_0x45f8('0x4b')]({'where':{'id':_0x12aac4['params']['id']}})[_0x45f8('0x27')](handleEntityNotFound(_0x20dac5,null))[_0x45f8('0x27')](saveUpdates(_0x12aac4['body'],null))['then'](respondWithResult(_0x20dac5,null))[_0x45f8('0x46')](handleError(_0x20dac5,null));};exports[_0x45f8('0x4d')]=function(_0x4acc1e,_0x5b2af0,_0x2b4ad5){return db[_0x45f8('0x4e')][_0x45f8('0x4f')](function(_0x4dd1ce){if(_0x4acc1e[_0x45f8('0x4c')][_0x45f8('0x50')]===_0x45f8('0x51')){_0x4acc1e[_0x45f8('0x4c')][_0x45f8('0x52')]=path[_0x45f8('0x53')](config['root'],_0x45f8('0x54'),_0x4acc1e['body'][_0x45f8('0x2c')]);}return db[_0x45f8('0x2f')][_0x45f8('0x4d')](_0x4acc1e[_0x45f8('0x4c')],{'transaction':_0x4dd1ce})[_0x45f8('0x27')](function(_0x375a05){if(_0x4acc1e['body']['mode']===_0x45f8('0x51')){fs[_0x45f8('0x55')](_0x375a05[_0x45f8('0x52')],parseInt(_0x45f8('0x56'),0x8));}var _0x4f8fae=_0x4acc1e[_0x45f8('0x57')][_0x45f8('0x29')]({'plain':!![]});if(!_0x4f8fae)throw new Error(_0x45f8('0x58'));if(_0x4f8fae[_0x45f8('0x59')]===_0x45f8('0x57')){var _0x5cbc05=_0x375a05[_0x45f8('0x29')]({'plain':!![]});return db[_0x45f8('0x5a')][_0x45f8('0x4b')]({'where':{'name':_0x45f8('0x2a'),'userProfileId':_0x4f8fae[_0x45f8('0x5b')]},'raw':!![]})[_0x45f8('0x27')](function(_0x290e13){if(_0x290e13&&_0x290e13[_0x45f8('0x5c')]===0x0){return db['UserProfileResource'][_0x45f8('0x4d')]({'name':_0x5cbc05['name'],'resourceId':_0x5cbc05['id'],'type':_0x290e13[_0x45f8('0x2c')],'sectionId':_0x290e13['id']},{})['then'](function(){return _0x375a05;});}else{return _0x375a05;}})[_0x45f8('0x46')](function(_0x5b7734){logger[_0x45f8('0x2b')](_0x45f8('0x5d'),_0x5b7734);});}return _0x375a05;});})[_0x45f8('0x27')](respondWithResult(_0x5b2af0,0xc9))['catch'](handleError(_0x5b2af0,null));};exports[_0x45f8('0x28')]=function(_0x29ffb0,_0x5e6575,_0x1ee7f4){var _0x3b6c5c;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x29ffb0[_0x45f8('0x48')]['id']}})['then'](function(_0x4c2668){if(_0x4c2668){return db['sequelize']['transaction'](function(_0x52b115){return _0x4c2668[_0x45f8('0x28')]({'transaction':_0x52b115,'raw':!![]})[_0x45f8('0x27')](function(_0x516d53){if(_0x516d53[_0x45f8('0x52')]){fs['readdirSync'](_0x516d53[_0x45f8('0x52')])[_0x45f8('0x5e')](function(_0x5939db){fs[_0x45f8('0x5f')](path['join'](_0x516d53[_0x45f8('0x52')],_0x5939db));});fs[_0x45f8('0x60')](_0x516d53[_0x45f8('0x52')]);}return _0x516d53;});})[_0x45f8('0x46')](function(_0x5dcbdf){throw new db['Sequelize'][(_0x45f8('0x61'))](_0x5dcbdf['message']);});}})[_0x45f8('0x27')](handleEntityNotFound(_0x5e6575,null))[_0x45f8('0x27')](removeEntity(_0x5e6575,null))[_0x45f8('0x46')](handleError(_0x5e6575,null));};exports['addSound']=function(_0x2b517d,_0x2537ae,_0x5a7180){return db[_0x45f8('0x4e')][_0x45f8('0x4f')](function(_0x39ee19){var _0x432a1c;return db[_0x45f8('0x2f')][_0x45f8('0x4b')]({'where':{'id':_0x2b517d[_0x45f8('0x48')]['id']}})['then'](function(_0x405f7d){if(_0x405f7d){_0x432a1c=_0x405f7d;return _0x405f7d[_0x45f8('0x62')](_0x2b517d[_0x45f8('0x4c')]['id'],{'transaction':_0x39ee19});}})[_0x45f8('0x27')](function(_0x2b6172){if(_0x2b6172){return db[_0x45f8('0x63')][_0x45f8('0x64')]({'where':{'id':_0x2b517d[_0x45f8('0x4c')]['id']},'attributes':['id',_0x45f8('0x2c'),_0x45f8('0x65'),_0x45f8('0x66'),_0x45f8('0x67')],'raw':!![]});}})['then'](function(_0xf913f0){if(_0xf913f0){var _0x501c0e=path[_0x45f8('0x53')](config[_0x45f8('0x68')],_0x45f8('0x69'),util['format']('%s.%s',path[_0x45f8('0x6a')](_0xf913f0[_0x45f8('0x65')],path[_0x45f8('0x6b')](_0xf913f0[_0x45f8('0x65')])),_0xf913f0[_0x45f8('0x66')]));var _0x2f0094=path['join'](config[_0x45f8('0x68')],'server/files/moh',_0x432a1c['name'],util['format']('%s.%s',_0xf913f0['name'],_0xf913f0['converted_format']));fs[_0x45f8('0x6c')](_0x501c0e,_0x2f0094);return _0xf913f0;}})[_0x45f8('0x46')](function(_0xc3e75e){throw new db[(_0x45f8('0x6d'))][(_0x45f8('0x61'))](_0xc3e75e['message']);});})[_0x45f8('0x27')](handleEntityNotFound(_0x2537ae,null))[_0x45f8('0x27')](respondWithResult(_0x2537ae,0xc9))[_0x45f8('0x46')](handleError(_0x2537ae,null));};exports['removeSound']=function(_0x3937d3,_0x27b3b4,_0xcf4319){return db[_0x45f8('0x4e')]['transaction'](function(_0x72742a){var _0x4a538f;return db[_0x45f8('0x2f')][_0x45f8('0x64')]({'where':{'id':_0x3937d3['params']['id']}})[_0x45f8('0x27')](handleEntityNotFound(_0x27b3b4,null))['then'](function(_0x502330){if(_0x502330){_0x4a538f=_0x502330;return _0x502330[_0x45f8('0x6e')](_0x3937d3[_0x45f8('0x48')]['id2']);}})['then'](function(_0x368738){if(_0x368738){return db['Sound']['findOne']({'where':{'id':_0x3937d3[_0x45f8('0x48')][_0x45f8('0x6f')]},'attributes':['id',_0x45f8('0x2c'),_0x45f8('0x65'),_0x45f8('0x66'),_0x45f8('0x67')],'raw':!![]});}})[_0x45f8('0x27')](function(_0x488d32){if(_0x488d32){fs[_0x45f8('0x5f')](path[_0x45f8('0x53')](_0x4a538f[_0x45f8('0x52')],util[_0x45f8('0x70')](_0x45f8('0x71'),_0x488d32[_0x45f8('0x2c')],_0x488d32[_0x45f8('0x66')])));return _0x488d32;}})[_0x45f8('0x46')](function(_0x3f24b6){throw new db[(_0x45f8('0x6d'))][(_0x45f8('0x61'))](_0x3f24b6['message']);});})[_0x45f8('0x27')](handleEntityNotFound(_0x27b3b4,null))['then'](respondWithStatusCode(_0x27b3b4,0xcc))[_0x45f8('0x46')](handleError(_0x27b3b4,null));};exports['getSounds']=function(_0x324327,_0x18dadd,_0x289884){var _0x1ac202={};var _0x355b23={};var _0x367036;var _0x475df4;return db['VoiceMusicOnHold'][_0x45f8('0x64')]({'where':{'id':_0x324327[_0x45f8('0x48')]['id']}})[_0x45f8('0x27')](handleEntityNotFound(_0x18dadd,null))['then'](function(_0x39d7e6){if(_0x39d7e6){_0x367036=_0x39d7e6;_0x355b23[_0x45f8('0x34')]=_[_0x45f8('0x35')](db[_0x45f8('0x63')]['rawAttributes']);_0x355b23[_0x45f8('0x38')]=_[_0x45f8('0x35')](_0x324327[_0x45f8('0x38')]);_0x355b23['filters']=_['intersection'](_0x355b23[_0x45f8('0x34')],_0x355b23[_0x45f8('0x38')]);_0x1ac202[_0x45f8('0x37')]=_['intersection'](_0x355b23[_0x45f8('0x34')],qs[_0x45f8('0x49')](_0x324327[_0x45f8('0x38')]['fields']));_0x1ac202[_0x45f8('0x37')]=_0x1ac202[_0x45f8('0x37')][_0x45f8('0x4a')]?_0x1ac202[_0x45f8('0x37')]:_0x355b23[_0x45f8('0x34')];_0x1ac202[_0x45f8('0x72')]=qs['sort'](_0x324327[_0x45f8('0x38')][_0x45f8('0x3b')]);_0x1ac202[_0x45f8('0x3c')]=qs['filters'](_[_0x45f8('0x73')](_0x324327['query'],_0x355b23[_0x45f8('0x3d')]));if(_0x324327['query'][_0x45f8('0x3e')]){_0x1ac202[_0x45f8('0x3c')]=_['merge'](_0x1ac202[_0x45f8('0x3c')],{'$or':_[_0x45f8('0x2e')](_0x1ac202[_0x45f8('0x37')],function(_0x24e6a9){var _0x3934f7={};_0x3934f7[_0x24e6a9]={'$like':'%'+_0x324327['query'][_0x45f8('0x3e')]+'%'};return _0x3934f7;})});}_0x1ac202=_[_0x45f8('0x3f')]({},_0x1ac202,_0x324327[_0x45f8('0x41')]);return _0x367036[_0x45f8('0x74')](_0x1ac202);}})[_0x45f8('0x27')](function(_0x49efa0){if(_0x49efa0){_0x475df4=_0x49efa0['length'];if(!_0x324327[_0x45f8('0x38')][_0x45f8('0x39')](_0x45f8('0x3a'))){_0x1ac202[_0x45f8('0x1f')]=qs['limit'](_0x324327[_0x45f8('0x38')]['limit']);_0x1ac202[_0x45f8('0x1d')]=qs[_0x45f8('0x1d')](_0x324327[_0x45f8('0x38')][_0x45f8('0x1d')]);}return _0x367036[_0x45f8('0x74')](_0x1ac202);}})[_0x45f8('0x27')](function(_0x672aed){if(_0x672aed){return _0x672aed?{'count':_0x475df4,'rows':_0x672aed}:null;}})[_0x45f8('0x27')](respondWithResult(_0x18dadd,null))[_0x45f8('0x46')](handleError(_0x18dadd,null));};
\ No newline at end of file
index 213e4e3..aa80b55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9280=['moment','request-promise','path','rimraf','exports','util','../../config/logger','api'];(function(_0x111e17,_0x34ff10){var _0x31268f=function(_0x577407){while(--_0x577407){_0x111e17['push'](_0x111e17['shift']());}};_0x31268f(++_0x34ff10);}(_0x9280,0x7d));var _0x0928=function(_0x3e0b84,_0x7bc991){_0x3e0b84=_0x3e0b84-0x0;var _0x383782=_0x9280[_0x3e0b84];return _0x383782;};'use strict';var _=require('lodash');var util=require(_0x0928('0x0'));var logger=require(_0x0928('0x1'))(_0x0928('0x2'));var moment=require(_0x0928('0x3'));var BPromise=require('bluebird');var rp=require(_0x0928('0x4'));var fs=require('fs');var path=require(_0x0928('0x5'));var rimraf=require(_0x0928('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x0928('0x7')]=function(_0x48167b,_0x1f9216){return _0x48167b['define']('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb4a0=['rimraf','exports','define','voice_musiconhold','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4a0,0x1e8));var _0x0b4a=function(_0x195fa6,_0x2e812c){_0x195fa6=_0x195fa6-0x0;var _0x8a7f24=_0xb4a0[_0x195fa6];return _0x8a7f24;};'use strict';var _=require(_0x0b4a('0x0'));var util=require('util');var logger=require(_0x0b4a('0x1'))(_0x0b4a('0x2'));var moment=require(_0x0b4a('0x3'));var BPromise=require(_0x0b4a('0x4'));var rp=require(_0x0b4a('0x5'));var fs=require('fs');var path=require(_0x0b4a('0x6'));var rimraf=require(_0x0b4a('0x7'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module[_0x0b4a('0x8')]=function(_0x3b9ddb,_0x41c4cf){return _0x3b9ddb[_0x0b4a('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x0b4a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fe76cc6..cb1495f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a4fb0,_0x2817d4){var _0x1e0d5c=function(_0x3be855){while(--_0x3be855){_0x3a4fb0['push'](_0x3a4fb0['shift']());}};_0x1e0d5c(++_0x2817d4);}(_0xe706,0xa3));var _0x6e70=function(_0x126a6f,_0x390a17){_0x126a6f=_0x126a6f-0x0;var _0x3988db=_0xe706[_0x126a6f];return _0x3988db;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
+var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1d50e8,_0x71c961){var _0x4d5c90=function(_0x225077){while(--_0x225077){_0x1d50e8['push'](_0x1d50e8['shift']());}};_0x4d5c90(++_0x71c961);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
index 68090e8..263b2be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd3=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','post','addAgents','update','delete','removeAgents'];(function(_0x4e17c7,_0x14421a){var _0xdcad30=function(_0x2a0d9e){while(--_0x2a0d9e){_0x4e17c7['push'](_0x4e17c7['shift']());}};_0xdcad30(++_0x14421a);}(_0x2cd3,0xf1));var _0x32cd=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x2cd3[_0x2067e9];return _0x280ce4;};'use strict';var multer=require(_0x32cd('0x0'));var util=require('util');var path=require(_0x32cd('0x1'));var timeout=require(_0x32cd('0x2'));var express=require(_0x32cd('0x3'));var router=express[_0x32cd('0x4')]();var fs_extra=require(_0x32cd('0x5'));var auth=require(_0x32cd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32cd('0x7'));router[_0x32cd('0x8')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xa')]);router[_0x32cd('0x8')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0xc')]);router[_0x32cd('0x8')](_0x32cd('0xd'),auth[_0x32cd('0x9')](),controller[_0x32cd('0xe')]);router[_0x32cd('0x8')](_0x32cd('0xf'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x10')]);router[_0x32cd('0x8')](_0x32cd('0x11'),auth['isAuthenticated'](),controller['getTeams']);router[_0x32cd('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32cd('0x12')](_0x32cd('0xf'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x13')]);router[_0x32cd('0x12')](_0x32cd('0x11'),auth[_0x32cd('0x9')](),controller['addTeams']);router['put'](_0x32cd('0xd'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x14')]);router[_0x32cd('0x15')]('/:id',auth[_0x32cd('0x9')](),controller['destroy']);router['delete'](_0x32cd('0xf'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x16')]);router[_0x32cd('0x15')](_0x32cd('0x11'),auth[_0x32cd('0x9')](),controller['removeTeams']);module[_0x32cd('0x17')]=router;
\ No newline at end of file
+var _0xccc9=['isAuthenticated','index','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','addTeams','put','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0xccc9,0xf4));var _0x9ccc=function(_0x2f806b,_0x30392e){_0x2f806b=_0x2f806b-0x0;var _0x5c1db3=_0xccc9[_0x2f806b];return _0x5c1db3;};'use strict';var multer=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var path=require(_0x9ccc('0x2'));var timeout=require(_0x9ccc('0x3'));var express=require('express');var router=express[_0x9ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ccc('0x6'));var controller=require('./voicePrefix.controller');router[_0x9ccc('0x7')]('/',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x9')]);router[_0x9ccc('0x7')](_0x9ccc('0xa'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xb')]);router[_0x9ccc('0x7')](_0x9ccc('0xc'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xd')]);router[_0x9ccc('0x7')]('/:id/users',auth[_0x9ccc('0x8')](),controller[_0x9ccc('0xe')]);router[_0x9ccc('0x7')](_0x9ccc('0xf'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x10')]);router[_0x9ccc('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9ccc('0x11')](_0x9ccc('0x12'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x13')]);router[_0x9ccc('0x11')](_0x9ccc('0xf'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x14')]);router[_0x9ccc('0x15')](_0x9ccc('0xc'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x16')]);router['delete'](_0x9ccc('0xc'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x17')]);router[_0x9ccc('0x18')](_0x9ccc('0x12'),auth['isAuthenticated'](),controller[_0x9ccc('0x19')]);router[_0x9ccc('0x18')](_0x9ccc('0xf'),auth[_0x9ccc('0x8')](),controller[_0x9ccc('0x1a')]);module[_0x9ccc('0x1b')]=router;
\ No newline at end of file
index 2bcdba9..530c21a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee70=['name','VIRTUAL','system-','STRING','INTEGER','sequelize','exports'];(function(_0x3b219b,_0xb56344){var _0x14bf2f=function(_0x5476da){while(--_0x5476da){_0x3b219b['push'](_0x3b219b['shift']());}};_0x14bf2f(++_0xb56344);}(_0xee70,0x15c));var _0x0ee7=function(_0x331fb4,_0x1becd7){_0x331fb4=_0x331fb4-0x0;var _0x261682=_0xee70[_0x331fb4];return _0x261682;};'use strict';var Sequelize=require(_0x0ee7('0x0'));module[_0x0ee7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0ee7('0x2')},'prefix':{'type':Sequelize[_0x0ee7('0x3')],'get':function(_0xebd00f){return _0x0ee7('0x4')+this['getDataValue'](_0x0ee7('0x2'))+'-';}},'description':{'type':Sequelize[_0x0ee7('0x5')]},'callerIdAll':{'type':Sequelize[_0x0ee7('0x5')]},'VoiceExtensionId':{'type':Sequelize[_0x0ee7('0x6')]}};
\ No newline at end of file
+var _0x6c66=['VIRTUAL','getDataValue','name','sequelize','exports','STRING'];(function(_0x5f8ca9,_0x3e99ee){var _0x435ec2=function(_0x93c917){while(--_0x93c917){_0x5f8ca9['push'](_0x5f8ca9['shift']());}};_0x435ec2(++_0x3e99ee);}(_0x6c66,0x14d));var _0x66c6=function(_0x198be6,_0x882b26){_0x198be6=_0x198be6-0x0;var _0x251ba2=_0x6c66[_0x198be6];return _0x251ba2;};'use strict';var Sequelize=require(_0x66c6('0x0'));module[_0x66c6('0x1')]={'name':{'type':Sequelize[_0x66c6('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x66c6('0x3')],'get':function(_0x32816c){return'system-'+this[_0x66c6('0x4')](_0x66c6('0x5'))+'-';}},'description':{'type':Sequelize[_0x66c6('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 0a22fe3..502d5c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','order','pick','nolimit','getTeams','Team','online','voicePause','flatMap','Agents','addTeams','each','upsert','UserVoicePrefix','findOrCreate','forEach','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','clone','ut.UserId\x20=\x20?','QueryTypes','all','union','value','removeTeams','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','offset','undefined','limit','set','apply','destroy','then','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','catch','show','params','keys','fields','includeAll','include','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','${EXTEN:','charAt','update','body','system-','findById','addAgents','ids','omit','spread','emit'];(function(_0x3c8b54,_0x17ef3f){var _0x3b9152=function(_0x17c3d5){while(--_0x17c3d5){_0x3c8b54['push'](_0x3c8b54['shift']());}};_0x3b9152(++_0x17ef3f);}(_0x7880,0x1f4));var _0x0788=function(_0x385359,_0x325c57){_0x385359=_0x385359-0x0;var _0x2ea4dd=_0x7880[_0x385359];return _0x2ea4dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];config[_0x0788('0x1a')]=_[_0x0788('0x1b')](config[_0x0788('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x0788('0x1c'))(new Redis(config[_0x0788('0x1a')]));require(_0x0788('0x1d'))[_0x0788('0x1e')](socket);function respondWithStatusCode(_0x51e5d3,_0x43ca01){_0x43ca01=_0x43ca01||0xcc;return function(_0x4ed024){if(_0x4ed024){return _0x51e5d3[_0x0788('0x1f')](_0x43ca01);}return _0x51e5d3[_0x0788('0x20')](_0x43ca01)[_0x0788('0x21')]();};}function respondWithResult(_0xb406fb,_0x2ddd1a){_0x2ddd1a=_0x2ddd1a||0xc8;return function(_0x430e34){if(_0x430e34){return _0xb406fb['status'](_0x2ddd1a)['json'](_0x430e34);}};}function respondWithFilteredResult(_0x17d805,_0x461d9d){return function(_0x5b2bdc){if(_0x5b2bdc){var _0x654e4b=typeof _0x461d9d[_0x0788('0x22')]===_0x0788('0x23')&&typeof _0x461d9d['limit']===_0x0788('0x23');var _0x3fb723=_0x5b2bdc['count'];var _0x11ea01=_0x654e4b?0x0:_0x461d9d['offset'];var _0x7d0869=_0x654e4b?_0x5b2bdc['count']:_0x461d9d[_0x0788('0x22')]+_0x461d9d[_0x0788('0x24')];var _0x18ff22;if(_0x7d0869>=_0x3fb723){_0x7d0869=_0x3fb723;_0x18ff22=0xc8;}else{_0x18ff22=0xce;}_0x17d805[_0x0788('0x20')](_0x18ff22);return _0x17d805[_0x0788('0x25')]('Content-Range',_0x11ea01+'-'+_0x7d0869+'/'+_0x3fb723)['json'](_0x5b2bdc);}return null;};}function patchUpdates(_0x2270d4){return function(_0x2a1460){try{jsonpatch[_0x0788('0x26')](_0x2a1460,_0x2270d4,!![]);}catch(_0x7a99a1){return BPromise['reject'](_0x7a99a1);}return _0x2a1460['save']();};}function saveUpdates(_0x79204e,_0x18cc33){return function(_0x40309d){if(_0x40309d){return _0x40309d['update'](_0x79204e)['then'](function(_0x240459){return _0x240459;});}return null;};}function removeEntity(_0xa1f7dc,_0x5f2dda){return function(_0x48816a){if(_0x48816a){return _0x48816a[_0x0788('0x27')]()[_0x0788('0x28')](function(){var _0x57fda1=_0x48816a[_0x0788('0x29')]({'plain':!![]});var _0x40e7a6=_0x0788('0x2a');return db[_0x0788('0x2b')][_0x0788('0x27')]({'where':{'type':_0x40e7a6,'resourceId':_0x57fda1['id']}})[_0x0788('0x28')](function(){return _0x48816a;});})[_0x0788('0x28')](function(){_0xa1f7dc[_0x0788('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a5178,_0x3c5246){return function(_0x40d345){if(!_0x40d345){_0x5a5178['sendStatus'](0x194);}return _0x40d345;};}function handleError(_0x4aa48b,_0x2e2ca8){_0x2e2ca8=_0x2e2ca8||0x1f4;return function(_0x68658a){logger[_0x0788('0x2c')](_0x68658a[_0x0788('0x2d')]);if(_0x68658a[_0x0788('0x2e')]){delete _0x68658a[_0x0788('0x2e')];}_0x4aa48b[_0x0788('0x20')](_0x2e2ca8)[_0x0788('0x2f')](_0x68658a);};}exports[_0x0788('0x30')]=function(_0x85e579,_0x5ec0ed){var _0x2a08b7={},_0x1aab6a={},_0x2db509={'count':0x0,'rows':[]};var _0x2a64e4=_[_0x0788('0x31')](db[_0x0788('0x32')][_0x0788('0x33')],function(_0x15d67a){return{'name':_0x15d67a[_0x0788('0x34')],'type':_0x15d67a[_0x0788('0x35')]['key']};});_0x1aab6a['model']=_['map'](_0x2a64e4,'name');_0x1aab6a['query']=_['keys'](_0x85e579[_0x0788('0x36')]);_0x1aab6a[_0x0788('0x37')]=_[_0x0788('0x38')](_0x1aab6a['model'],_0x1aab6a[_0x0788('0x36')]);_0x2a08b7[_0x0788('0x39')]=_[_0x0788('0x38')](_0x1aab6a[_0x0788('0x3a')],qs['fields'](_0x85e579[_0x0788('0x36')]['fields']));_0x2a08b7[_0x0788('0x39')]=_0x2a08b7['attributes'][_0x0788('0x3b')]?_0x2a08b7[_0x0788('0x39')]:_0x1aab6a['model'];if(!_0x85e579[_0x0788('0x36')][_0x0788('0x3c')]('nolimit')){_0x2a08b7[_0x0788('0x24')]=qs['limit'](_0x85e579[_0x0788('0x36')]['limit']);_0x2a08b7[_0x0788('0x22')]=qs['offset'](_0x85e579[_0x0788('0x36')]['offset']);}_0x2a08b7['order']=qs[_0x0788('0x3d')](_0x85e579[_0x0788('0x36')][_0x0788('0x3d')]);_0x2a08b7[_0x0788('0x3e')]=qs[_0x0788('0x37')](_['pick'](_0x85e579['query'],_0x1aab6a['filters']),_0x2a64e4);if(_0x85e579['query'][_0x0788('0x3f')]){_0x2a08b7[_0x0788('0x3e')]=_[_0x0788('0x40')](_0x2a08b7[_0x0788('0x3e')],{'$or':_[_0x0788('0x31')](_0x2a64e4,function(_0x5993ad){if(_0x5993ad['type']!==_0x0788('0x41')){var _0x6770a8={};_0x6770a8[_0x5993ad[_0x0788('0x2e')]]={'$like':'%'+_0x85e579[_0x0788('0x36')][_0x0788('0x3f')]+'%'};return _0x6770a8;}})});}_0x2a08b7=_[_0x0788('0x40')]({},_0x2a08b7,_0x85e579[_0x0788('0x42')]);var _0x38ca94={'where':_0x2a08b7[_0x0788('0x3e')]};return db['VoicePrefix']['count'](_0x38ca94)[_0x0788('0x28')](function(_0x1d579d){_0x2db509[_0x0788('0x43')]=_0x1d579d;if(_0x85e579['query']['includeAll']){_0x2a08b7['include']=[{'all':!![]}];}return db[_0x0788('0x32')][_0x0788('0x44')](_0x2a08b7);})[_0x0788('0x28')](function(_0x189d33){_0x2db509[_0x0788('0x45')]=_0x189d33;return _0x2db509;})[_0x0788('0x28')](respondWithFilteredResult(_0x5ec0ed,_0x2a08b7))[_0x0788('0x46')](handleError(_0x5ec0ed,null));};exports[_0x0788('0x47')]=function(_0x4bd0d9,_0x15c618){var _0x19d111={'raw':![],'where':{'id':_0x4bd0d9[_0x0788('0x48')]['id']}},_0x4281ef={};_0x4281ef['model']=_[_0x0788('0x49')](db[_0x0788('0x32')]['rawAttributes']);_0x4281ef['query']=_['keys'](_0x4bd0d9[_0x0788('0x36')]);_0x4281ef['filters']=_[_0x0788('0x38')](_0x4281ef[_0x0788('0x3a')],_0x4281ef[_0x0788('0x36')]);_0x19d111[_0x0788('0x39')]=_[_0x0788('0x38')](_0x4281ef[_0x0788('0x3a')],qs[_0x0788('0x4a')](_0x4bd0d9[_0x0788('0x36')]['fields']));_0x19d111['attributes']=_0x19d111[_0x0788('0x39')][_0x0788('0x3b')]?_0x19d111[_0x0788('0x39')]:_0x4281ef['model'];if(_0x4bd0d9[_0x0788('0x36')][_0x0788('0x4b')]){_0x19d111[_0x0788('0x4c')]=[{'all':!![]}];}_0x19d111=_[_0x0788('0x40')]({},_0x19d111,_0x4bd0d9[_0x0788('0x42')]);return db['VoicePrefix']['find'](_0x19d111)[_0x0788('0x28')](handleEntityNotFound(_0x15c618,null))[_0x0788('0x28')](respondWithResult(_0x15c618,null))['catch'](handleError(_0x15c618,null));};exports[_0x0788('0x27')]=function(_0x4a6cde,_0x2103aa){return db[_0x0788('0x32')][_0x0788('0x4d')]({'where':{'id':_0x4a6cde[_0x0788('0x48')]['id']}})[_0x0788('0x28')](handleEntityNotFound(_0x2103aa,null))[_0x0788('0x28')](removeEntity(_0x2103aa,null))[_0x0788('0x46')](handleError(_0x2103aa,null));};exports[_0x0788('0x4e')]=function(_0x5f3bda,_0x179c6e){return db[_0x0788('0x32')][_0x0788('0x4e')]()['then'](respondWithResult(_0x179c6e,null))[_0x0788('0x46')](handleError(_0x179c6e,null));};exports[_0x0788('0x4f')]=function(_0x59f00e,_0x18e55e){var _0x41110d;return db[_0x0788('0x50')][_0x0788('0x51')](function(_0x137e24){return db[_0x0788('0x32')]['create'](_0x59f00e['body'],{'transaction':_0x137e24})[_0x0788('0x28')](function(_0x36304b){_0x41110d=_0x36304b['get']({'plain':!![]});return db[_0x0788('0x52')][_0x0788('0x4d')]({'where':{'id':_0x41110d[_0x0788('0x53')]},'raw':!![]})[_0x0788('0x28')](function(_0xf543a8){return createVoicePrefixExtensions(_0x41110d,_0xf543a8,_0x137e24);});});})[_0x0788('0x28')](function(){var _0x112870=_0x59f00e[_0x0788('0x54')][_0x0788('0x29')]({'plain':!![]});if(!_0x112870)throw new Error(_0x0788('0x55'));if(_0x112870[_0x0788('0x56')]===_0x0788('0x54')){var _0x55481c=_0x41110d;return db[_0x0788('0x57')][_0x0788('0x4d')]({'where':{'name':_0x0788('0x2a'),'userProfileId':_0x112870['userProfileId']},'raw':!![]})[_0x0788('0x28')](function(_0x329d44){if(_0x329d44&&_0x329d44['autoAssociation']===0x0){return db['UserProfileResource'][_0x0788('0x4f')]({'name':_0x55481c[_0x0788('0x2e')],'resourceId':_0x55481c['id'],'type':_0x329d44[_0x0788('0x2e')],'sectionId':_0x329d44['id']},{})[_0x0788('0x28')](function(){return _0x41110d;});}else{return _0x41110d;}})[_0x0788('0x46')](function(_0x4c08f9){logger['error'](_0x0788('0x58'),_0x4c08f9);throw _0x4c08f9;});}return _0x41110d;})[_0x0788('0x28')](respondWithResult(_0x18e55e,null))[_0x0788('0x46')](handleError(_0x18e55e,null));};function Extension(_0x47be71,_0x533f71,_0x3a25d3,_0x5419d9){this[_0x0788('0x59')]=_0x0788('0x5a');this[_0x0788('0x5b')]=_0x47be71;this[_0x0788('0x5c')]=_0x3a25d3;this[_0x0788('0x35')]=_0x0788('0x5d');this[_0x0788('0x5e')]=_0x0788('0x5f');this[_0x0788('0x60')]=_0x533f71;this[_0x0788('0x61')]=_0x5419d9;}function createVoicePrefixExtensions(_0x59fcbc,_0xe1a934,_0x446170){return new BPromise(function(_0x602e3b,_0x2822aa){var _0x582fed=new Extension(formatPrefixName(_0x59fcbc[_0x0788('0x62')]),0x1,_0x0788('0x63'),_0x0788('0x64'));_0x582fed[_0x0788('0x65')]=_0x59fcbc['id'];return db[_0x0788('0x52')]['create'](_0x582fed,{'transaction':_0x446170})[_0x0788('0x28')](function(_0x4aa3af){var _0x439224=_0x4aa3af[_0x0788('0x29')]({'plain':!![]});var _0x184b66=_[_0x0788('0x31')](addVoicePrefixExtensions(_0x59fcbc,_0xe1a934),function(_0x3baf23){_0x3baf23[_0x0788('0x53')]=_0x439224['id'];_0x3baf23[_0x0788('0x65')]=_0x59fcbc['id'];return _0x3baf23;});return db[_0x0788('0x52')][_0x0788('0x66')](_0x184b66,{'transaction':_0x446170})['then'](function(_0x25201f){if(!_0x25201f){return _0x2822aa(_0x0788('0x67'));}else{return _0x602e3b(_0x25201f);}})[_0x0788('0x46')](function(_0x59a436){return _0x2822aa(_0x59a436);});});;});};function addVoicePrefixExtensions(_0x50eeae,_0x6d255b){var _0x1bb234=[];var _0x31ed44=formatPrefixName(_0x50eeae['prefix']);_0x1bb234[_0x0788('0x68')](new Extension(_0x31ed44,0x2,_0x0788('0x69'),_0x0788('0x6a')+_0x50eeae[_0x0788('0x2e')]));if(_0x50eeae['callerIdAll']){_0x1bb234['push'](new Extension(_0x31ed44,0x3,'Set',_0x0788('0x6b')+_0x50eeae[_0x0788('0x6c')]));}else{_0x1bb234[_0x0788('0x68')](new Extension(_0x31ed44,0x3,'NoOp','No\x20callerid\x20available'));}_0x1bb234[_0x0788('0x68')](new Extension(_0x31ed44,0x4,'goto',_0x6d255b[_0x0788('0x59')]+','+_0x0788('0x6d')+(0x8+_0x50eeae[_0x0788('0x2e')][_0x0788('0x3b')])+'}'+','+0x1));return _0x1bb234;}function formatPrefixName(_0x1834fb){var _0x345755='_';for(var _0x20b01a=0x0;_0x20b01a<_0x1834fb[_0x0788('0x3b')];_0x20b01a++){if(_0x1834fb[_0x0788('0x6e')](_0x20b01a)=='-'){_0x345755+=_0x1834fb[_0x0788('0x6e')](_0x20b01a);}else{_0x345755+='['+_0x1834fb['charAt'](_0x20b01a)+']';}}_0x345755+='.';return _0x345755;}exports[_0x0788('0x6f')]=function(_0x30248c,_0x52926f,_0x5ab357){var _0x3b053e=_0x30248c[_0x0788('0x70')];_0x3b053e[_0x0788('0x62')]=_0x0788('0x71')+_0x3b053e[_0x0788('0x2e')]+'-';return db[_0x0788('0x50')]['transaction'](function(_0x384401){return db[_0x0788('0x32')][_0x0788('0x6f')](_0x3b053e,{'where':{'id':_0x3b053e['id']},'transaction':_0x384401})[_0x0788('0x28')](function(){return db['VoiceExtension'][_0x0788('0x27')]({'where':{'VoicePrefixId':_0x3b053e['id']},'transaction':_0x384401})[_0x0788('0x28')](function(){return db[_0x0788('0x52')][_0x0788('0x4d')]({'where':{'id':_0x3b053e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x7e11f){return createVoicePrefixExtensions(_0x3b053e,_0x7e11f,_0x384401);});});});})[_0x0788('0x28')](function(){return db[_0x0788('0x32')][_0x0788('0x72')](_0x3b053e['id']);})[_0x0788('0x28')](respondWithResult(_0x52926f,null))[_0x0788('0x46')](handleError(_0x52926f,null));};exports[_0x0788('0x73')]=function(_0x31b806,_0x1bd4ec,_0x4e6c4f){return db[_0x0788('0x32')][_0x0788('0x4d')]({'where':{'id':_0x31b806[_0x0788('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bd4ec,null))['then'](function(_0x14fc12){if(_0x14fc12){return _0x14fc12['addAgents'](_0x31b806[_0x0788('0x70')][_0x0788('0x74')],_[_0x0788('0x75')](_0x31b806[_0x0788('0x70')],[_0x0788('0x74'),'id'])||{})[_0x0788('0x76')](function(_0xb944){for(var _0x216ea9=0x0;_0x216ea9<_0x31b806[_0x0788('0x70')]['ids'][_0x0788('0x3b')];_0x216ea9+=0x1){socket[_0x0788('0x77')](_0x0788('0x78'),{'UserId':Number(_0x31b806['body'][_0x0788('0x74')][_0x216ea9]),'VoicePrefixId':Number(_0x31b806[_0x0788('0x48')]['id'])});}return _0xb944;});}})[_0x0788('0x28')](respondWithResult(_0x1bd4ec,null))['catch'](handleError(_0x1bd4ec,null));};exports[_0x0788('0x79')]=function(_0x4486ee,_0x9b98bf,_0x33a2fb){return db[_0x0788('0x32')][_0x0788('0x4d')]({'where':{'id':_0x4486ee[_0x0788('0x48')]['id']}})[_0x0788('0x28')](handleEntityNotFound(_0x9b98bf,null))[_0x0788('0x28')](function(_0x5d8ddb){if(_0x5d8ddb){return _0x5d8ddb[_0x0788('0x79')](_0x4486ee[_0x0788('0x36')][_0x0788('0x74')])[_0x0788('0x28')](function(){if(_[_0x0788('0x7a')](_0x4486ee['query'][_0x0788('0x74')])){for(var _0x358048=0x0;_0x358048<_0x4486ee[_0x0788('0x36')]['ids'][_0x0788('0x3b')];_0x358048+=0x1){socket[_0x0788('0x77')](_0x0788('0x7b'),{'UserId':Number(_0x4486ee[_0x0788('0x36')][_0x0788('0x74')][_0x358048]),'VoicePrefixId':Number(_0x4486ee['params']['id'])});}}else{socket[_0x0788('0x77')](_0x0788('0x7b'),{'UserId':Number(_0x4486ee['query'][_0x0788('0x74')]),'VoicePrefixId':Number(_0x4486ee[_0x0788('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x9b98bf,null))[_0x0788('0x46')](handleError(_0x9b98bf,null));};exports[_0x0788('0x7c')]=function(_0x9a0ef,_0x5c2d95,_0x28ad96){var _0x42c537={};var _0xbb5b1d={};var _0x53730a;var _0xddfb97;return db[_0x0788('0x32')][_0x0788('0x7d')]({'where':{'id':_0x9a0ef[_0x0788('0x48')]['id']}})[_0x0788('0x28')](handleEntityNotFound(_0x5c2d95,null))[_0x0788('0x28')](function(_0x2545a7){if(_0x2545a7){_0x53730a=_0x2545a7;_0xbb5b1d[_0x0788('0x3a')]=_['keys'](db[_0x0788('0x7e')][_0x0788('0x33')]);_0xbb5b1d[_0x0788('0x36')]=_[_0x0788('0x49')](_0x9a0ef['query']);_0xbb5b1d['filters']=_[_0x0788('0x38')](_0xbb5b1d[_0x0788('0x3a')],_0xbb5b1d['query']);_0x42c537[_0x0788('0x39')]=_[_0x0788('0x38')](_0xbb5b1d[_0x0788('0x3a')],qs['fields'](_0x9a0ef['query'][_0x0788('0x4a')]));_0x42c537[_0x0788('0x39')]=_0x42c537['attributes']['length']?_0x42c537['attributes']:_0xbb5b1d[_0x0788('0x3a')];_0x42c537[_0x0788('0x7f')]=qs['sort'](_0x9a0ef[_0x0788('0x36')][_0x0788('0x3d')]);_0x42c537[_0x0788('0x3e')]=qs[_0x0788('0x37')](_[_0x0788('0x80')](_0x9a0ef['query'],_0xbb5b1d[_0x0788('0x37')]));if(_0x9a0ef['query'][_0x0788('0x3f')]){_0x42c537['where']=_[_0x0788('0x40')](_0x42c537[_0x0788('0x3e')],{'$or':_[_0x0788('0x31')](_0x42c537[_0x0788('0x39')],function(_0x13f796){var _0x2238f6={};_0x2238f6[_0x13f796]={'$like':'%'+_0x9a0ef[_0x0788('0x36')][_0x0788('0x3f')]+'%'};return _0x2238f6;})});}_0x42c537=_[_0x0788('0x40')]({},_0x42c537,_0x9a0ef[_0x0788('0x42')]);return _0x53730a[_0x0788('0x7c')](_0x42c537);}})[_0x0788('0x28')](function(_0x1d0cb5){if(_0x1d0cb5){_0xddfb97=_0x1d0cb5['length'];if(!_0x9a0ef['query']['hasOwnProperty'](_0x0788('0x81'))){_0x42c537[_0x0788('0x24')]=qs[_0x0788('0x24')](_0x9a0ef[_0x0788('0x36')][_0x0788('0x24')]);_0x42c537[_0x0788('0x22')]=qs[_0x0788('0x22')](_0x9a0ef[_0x0788('0x36')][_0x0788('0x22')]);}return _0x53730a[_0x0788('0x7c')](_0x42c537);}})[_0x0788('0x28')](function(_0x4a4ad4){if(_0x4a4ad4){return _0x4a4ad4?{'count':_0xddfb97,'rows':_0x4a4ad4}:null;}})['then'](respondWithResult(_0x5c2d95,null))[_0x0788('0x46')](handleError(_0x5c2d95,null));};exports[_0x0788('0x82')]=function(_0x104a70,_0x1a3f4d,_0x45e33c){var _0x14ac26={};var _0x37d04b={};var _0x3c77f9;var _0x4e80d1;return db['VoicePrefix'][_0x0788('0x7d')]({'where':{'id':_0x104a70[_0x0788('0x48')]['id']}})[_0x0788('0x28')](handleEntityNotFound(_0x1a3f4d,null))[_0x0788('0x28')](function(_0x437086){if(_0x437086){_0x3c77f9=_0x437086;_0x37d04b[_0x0788('0x3a')]=_['keys'](db[_0x0788('0x83')][_0x0788('0x33')]);_0x37d04b[_0x0788('0x36')]=_[_0x0788('0x49')](_0x104a70[_0x0788('0x36')]);_0x37d04b[_0x0788('0x37')]=_[_0x0788('0x38')](_0x37d04b[_0x0788('0x3a')],_0x37d04b[_0x0788('0x36')]);_0x14ac26['attributes']=_[_0x0788('0x38')](_0x37d04b[_0x0788('0x3a')],qs[_0x0788('0x4a')](_0x104a70[_0x0788('0x36')][_0x0788('0x4a')]));_0x14ac26[_0x0788('0x39')]=_0x14ac26['attributes'][_0x0788('0x3b')]?_0x14ac26[_0x0788('0x39')]:_0x37d04b[_0x0788('0x3a')];_0x14ac26[_0x0788('0x7f')]=qs[_0x0788('0x3d')](_0x104a70[_0x0788('0x36')][_0x0788('0x3d')]);_0x14ac26[_0x0788('0x3e')]=qs[_0x0788('0x37')](_[_0x0788('0x80')](_0x104a70['query'],_0x37d04b[_0x0788('0x37')]));if(_0x104a70['query'][_0x0788('0x3f')]){_0x14ac26['where']=_[_0x0788('0x40')](_0x14ac26['where'],{'$or':_[_0x0788('0x31')](_0x14ac26[_0x0788('0x39')],function(_0x1f1f92){var _0xdfcfaf={};_0xdfcfaf[_0x1f1f92]={'$like':'%'+_0x104a70['query'][_0x0788('0x3f')]+'%'};return _0xdfcfaf;})});}_0x14ac26=_[_0x0788('0x40')]({},_0x14ac26,_0x104a70[_0x0788('0x42')]);return _0x3c77f9['getTeams'](_0x14ac26);}})[_0x0788('0x28')](function(_0x372c4f){if(_0x372c4f){_0x4e80d1=_0x372c4f['length'];if(!_0x104a70[_0x0788('0x36')][_0x0788('0x3c')](_0x0788('0x81'))){_0x14ac26[_0x0788('0x24')]=qs[_0x0788('0x24')](_0x104a70[_0x0788('0x36')][_0x0788('0x24')]);_0x14ac26['offset']=qs[_0x0788('0x22')](_0x104a70[_0x0788('0x36')][_0x0788('0x22')]);}return _0x3c77f9[_0x0788('0x82')](_0x14ac26);}})[_0x0788('0x28')](function(_0x374a10){if(_0x374a10){return _0x374a10?{'count':_0x4e80d1,'rows':_0x374a10}:null;}})[_0x0788('0x28')](respondWithResult(_0x1a3f4d,null))[_0x0788('0x46')](handleError(_0x1a3f4d,null));};exports['addTeams']=function(_0x5130c4,_0x26233b,_0x42f6df){var _0x198501=_0x5130c4[_0x0788('0x70')][_0x0788('0x74')];var _0xbedb18;return db[_0x0788('0x83')]['findAll']({'where':{'id':_0x198501},'attributes':['id'],'include':[{'model':db[_0x0788('0x7e')],'as':'Agents','attributes':['id','name',_0x0788('0x84'),_0x0788('0x85'),'interface'],'raw':!![]}]})[_0x0788('0x28')](function(_0x66474b){if(_0x66474b){_0xbedb18=_0x66474b;var _0x28d0f8=_[_0x0788('0x86')](_0x66474b,function(_0x3b7f9c){var _0x328606=_0x3b7f9c['get']({'plain':!![]});return _0x328606[_0x0788('0x87')];});return db[_0x0788('0x32')]['find']({'where':{'id':_0x5130c4[_0x0788('0x48')]['id']}})[_0x0788('0x28')](function(_0x4c59c4){return db[_0x0788('0x50')][_0x0788('0x51')](function(_0x28417e){return _0x4c59c4[_0x0788('0x88')](_0x198501,{'transaction':_0x28417e})[_0x0788('0x28')](function(){return BPromise[_0x0788('0x89')](_0xbedb18,function(_0x129506){return db['TeamVoicePrefix'][_0x0788('0x8a')]({'TeamId':_0x129506['id'],'VoicePrefixId':_0x5130c4[_0x0788('0x48')]['id']},{'transaction':_0x28417e});});})[_0x0788('0x28')](function(){return BPromise[_0x0788('0x89')](_0x28d0f8,function(_0x4c0f3d){return db[_0x0788('0x8b')][_0x0788('0x8c')]({'where':{'UserId':_0x4c0f3d['id'],'VoicePrefixId':_0x5130c4['params']['id']},'transaction':_0x28417e});});})['then'](function(){_0x28d0f8[_0x0788('0x8d')](function(_0x15a70b){socket[_0x0788('0x77')](_0x0788('0x78'),{'UserId':_0x15a70b['id'],'VoicePrefixId':_0x4c59c4['id']});});});});});}})[_0x0788('0x28')](respondWithStatusCode(_0x26233b,null))[_0x0788('0x46')](handleError(_0x26233b,null));};exports['removeTeams']=function(_0x3309e1,_0x38e809,_0x1d25bf){return db[_0x0788('0x83')][_0x0788('0x44')]({'where':{'id':_0x3309e1[_0x0788('0x36')][_0x0788('0x74')]},'attributes':['id'],'include':[{'model':db[_0x0788('0x7e')],'as':_0x0788('0x87'),'attributes':['id'],'raw':!![]}]})[_0x0788('0x28')](handleEntityNotFound(_0x38e809,null))[_0x0788('0x28')](function(_0x2297ab){var _0x235106=_[_0x0788('0x31')](_0x2297ab,'id');var _0x17da6a=[];var _0x150a05=[];var _0x1e0fb7=squel['select']();_0x1e0fb7[_0x0788('0x8e')](_0x0788('0x8f'))[_0x0788('0x90')](_0x0788('0x91'),'tq')['join'](_0x0788('0x92'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0788('0x3e')]('VoicePrefixId\x20=\x20?',_0x3309e1['params']['id']);for(var _0x34a12a=0x0;_0x34a12a<_0x2297ab[_0x0788('0x3b')];_0x34a12a+=0x1){let _0x552a5c=_0x2297ab[_0x34a12a];for(var _0x605f17=0x0;_0x605f17<_0x552a5c['Agents'][_0x0788('0x3b')];_0x605f17+=0x1){let _0x4c86ef=_0x552a5c[_0x0788('0x87')][_0x605f17];var _0x197568=_0x1e0fb7[_0x0788('0x93')]();_0x197568[_0x0788('0x3e')](_0x0788('0x94'),_0x4c86ef['id']);_0x150a05[_0x0788('0x68')](db['sequelize'][_0x0788('0x36')](_0x197568['toString'](),{'type':db[_0x0788('0x50')][_0x0788('0x95')]['SELECT']})['then'](function(_0x4c1ca6){if(_0x4c1ca6[_0x0788('0x3b')]===0x1){return _0x4c86ef['id'];}else{var _0x4b2ca7=_['every'](_['map'](_0x4c1ca6,'TeamId'),function(_0x4ce12d){return _['includes'](_0x235106,_0x4ce12d);});if(_0x4b2ca7){return _0x4c86ef['id'];}}}));}}return BPromise[_0x0788('0x96')](_0x150a05)[_0x0788('0x28')](function(_0x55e987){_0x17da6a=_(_0x17da6a)[_0x0788('0x97')](_0x55e987)['compact']()[_0x0788('0x98')]();return db['VoicePrefix'][_0x0788('0x4d')]({'where':{'id':_0x3309e1[_0x0788('0x48')]['id']}})[_0x0788('0x28')](function(_0x12448a){return db[_0x0788('0x50')][_0x0788('0x51')](function(_0x2e0714){return _0x12448a[_0x0788('0x99')](_0x3309e1[_0x0788('0x36')][_0x0788('0x74')],{'transaction':_0x2e0714})['then'](function(){if(!_[_0x0788('0x9a')](_0x17da6a)){return _0x12448a['removeAgents'](_0x17da6a,{'transaction':_0x2e0714});}})[_0x0788('0x28')](function(){_0x17da6a['forEach'](function(_0x58769c){socket[_0x0788('0x77')](_0x0788('0x7b'),{'UserId':_0x58769c,'VoicePrefixId':_0x12448a['id']});});});});});});})[_0x0788('0x28')](respondWithStatusCode(_0x38e809,null))['catch'](handleError(_0x38e809,null));};
\ No newline at end of file
+var _0xd824=['NoOp','charAt','system-','transaction','findById','addAgents','spread','ids','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','rawAttributes','sort','pick','nolimit','Team','getTeams','Agents','online','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','select','from','team_has_voice_prefixes','join','user_has_teams','VoicePrefixId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','every','includes','all','value','removeTeams','isEmpty','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','VoicePrefixes','destroy','error','name','index','map','VoicePrefix','fieldName','type','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','describe','create','sequelize','body','VoiceExtension','find','VoiceExtensionId','user','role','userProfileId','autoAssociation','UserProfileResource','context','app','system','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Set','CDR(prefix)=','push','PREFIX-CALLERIDALL='];(function(_0x5f32bf,_0xa74c85){var _0x1a19a7=function(_0xcc8169){while(--_0xcc8169){_0x5f32bf['push'](_0x5f32bf['shift']());}};_0x1a19a7(++_0xa74c85);}(_0xd824,0xc2));var _0x4d82=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd824[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x4d82('0x14')]=_[_0x4d82('0x15')](config[_0x4d82('0x14')],{'host':_0x4d82('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d82('0x14')]));require(_0x4d82('0x17'))[_0x4d82('0x18')](socket);function respondWithStatusCode(_0x486152,_0x70c598){_0x70c598=_0x70c598||0xcc;return function(_0x4f4c45){if(_0x4f4c45){return _0x486152[_0x4d82('0x19')](_0x70c598);}return _0x486152['status'](_0x70c598)[_0x4d82('0x1a')]();};}function respondWithResult(_0x496f3b,_0x474acf){_0x474acf=_0x474acf||0xc8;return function(_0xb1640d){if(_0xb1640d){return _0x496f3b[_0x4d82('0x1b')](_0x474acf)[_0x4d82('0x1c')](_0xb1640d);}};}function respondWithFilteredResult(_0x2648a8,_0x7c03fc){return function(_0x258c59){if(_0x258c59){var _0x217b72=typeof _0x7c03fc[_0x4d82('0x1d')]==='undefined'&&typeof _0x7c03fc[_0x4d82('0x1e')]===_0x4d82('0x1f');var _0x1b1e39=_0x258c59[_0x4d82('0x20')];var _0xe6260=_0x217b72?0x0:_0x7c03fc[_0x4d82('0x1d')];var _0x1a513d=_0x217b72?_0x258c59[_0x4d82('0x20')]:_0x7c03fc[_0x4d82('0x1d')]+_0x7c03fc[_0x4d82('0x1e')];var _0xf2f5a5;if(_0x1a513d>=_0x1b1e39){_0x1a513d=_0x1b1e39;_0xf2f5a5=0xc8;}else{_0xf2f5a5=0xce;}_0x2648a8['status'](_0xf2f5a5);return _0x2648a8[_0x4d82('0x21')](_0x4d82('0x22'),_0xe6260+'-'+_0x1a513d+'/'+_0x1b1e39)['json'](_0x258c59);}return null;};}function patchUpdates(_0x1a419f){return function(_0x41f194){try{jsonpatch[_0x4d82('0x23')](_0x41f194,_0x1a419f,!![]);}catch(_0x14a2d4){return BPromise[_0x4d82('0x24')](_0x14a2d4);}return _0x41f194[_0x4d82('0x25')]();};}function saveUpdates(_0x11c043,_0x462258){return function(_0x12feab){if(_0x12feab){return _0x12feab[_0x4d82('0x26')](_0x11c043)[_0x4d82('0x27')](function(_0x395efc){return _0x395efc;});}return null;};}function removeEntity(_0x7404ba,_0x284c66){return function(_0x1940ef){if(_0x1940ef){return _0x1940ef['destroy']()['then'](function(){var _0x3dcb0f=_0x1940ef[_0x4d82('0x28')]({'plain':!![]});var _0x2a0572=_0x4d82('0x29');return db['UserProfileResource'][_0x4d82('0x2a')]({'where':{'type':_0x2a0572,'resourceId':_0x3dcb0f['id']}})[_0x4d82('0x27')](function(){return _0x1940ef;});})[_0x4d82('0x27')](function(){_0x7404ba[_0x4d82('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4081f6,_0x4a7444){return function(_0x4d9ac4){if(!_0x4d9ac4){_0x4081f6['sendStatus'](0x194);}return _0x4d9ac4;};}function handleError(_0x52533b,_0x3d2229){_0x3d2229=_0x3d2229||0x1f4;return function(_0x8cfbf1){logger[_0x4d82('0x2b')](_0x8cfbf1['stack']);if(_0x8cfbf1[_0x4d82('0x2c')]){delete _0x8cfbf1[_0x4d82('0x2c')];}_0x52533b['status'](_0x3d2229)['send'](_0x8cfbf1);};}exports[_0x4d82('0x2d')]=function(_0x46a058,_0x16d30a){var _0x175961={},_0x5447f8={},_0x33d2a9={'count':0x0,'rows':[]};var _0x59cd4f=_[_0x4d82('0x2e')](db[_0x4d82('0x2f')]['rawAttributes'],function(_0x583cc5){return{'name':_0x583cc5[_0x4d82('0x30')],'type':_0x583cc5[_0x4d82('0x31')][_0x4d82('0x32')]};});_0x5447f8[_0x4d82('0x33')]=_[_0x4d82('0x2e')](_0x59cd4f,_0x4d82('0x2c'));_0x5447f8[_0x4d82('0x34')]=_[_0x4d82('0x35')](_0x46a058[_0x4d82('0x34')]);_0x5447f8[_0x4d82('0x36')]=_['intersection'](_0x5447f8[_0x4d82('0x33')],_0x5447f8[_0x4d82('0x34')]);_0x175961[_0x4d82('0x37')]=_['intersection'](_0x5447f8[_0x4d82('0x33')],qs[_0x4d82('0x38')](_0x46a058['query'][_0x4d82('0x38')]));_0x175961[_0x4d82('0x37')]=_0x175961[_0x4d82('0x37')]['length']?_0x175961[_0x4d82('0x37')]:_0x5447f8[_0x4d82('0x33')];if(!_0x46a058['query'][_0x4d82('0x39')]('nolimit')){_0x175961[_0x4d82('0x1e')]=qs[_0x4d82('0x1e')](_0x46a058['query'][_0x4d82('0x1e')]);_0x175961['offset']=qs[_0x4d82('0x1d')](_0x46a058['query']['offset']);}_0x175961[_0x4d82('0x3a')]=qs['sort'](_0x46a058[_0x4d82('0x34')]['sort']);_0x175961[_0x4d82('0x3b')]=qs[_0x4d82('0x36')](_['pick'](_0x46a058[_0x4d82('0x34')],_0x5447f8['filters']),_0x59cd4f);if(_0x46a058[_0x4d82('0x34')][_0x4d82('0x3c')]){_0x175961['where']=_[_0x4d82('0x3d')](_0x175961['where'],{'$or':_[_0x4d82('0x2e')](_0x59cd4f,function(_0x54f714){if(_0x54f714[_0x4d82('0x31')]!==_0x4d82('0x3e')){var _0x1d9e8b={};_0x1d9e8b[_0x54f714[_0x4d82('0x2c')]]={'$like':'%'+_0x46a058['query'][_0x4d82('0x3c')]+'%'};return _0x1d9e8b;}})});}_0x175961=_[_0x4d82('0x3d')]({},_0x175961,_0x46a058[_0x4d82('0x3f')]);var _0x3e29a6={'where':_0x175961[_0x4d82('0x3b')]};return db[_0x4d82('0x2f')][_0x4d82('0x20')](_0x3e29a6)['then'](function(_0x3c80d6){_0x33d2a9[_0x4d82('0x20')]=_0x3c80d6;if(_0x46a058[_0x4d82('0x34')][_0x4d82('0x40')]){_0x175961[_0x4d82('0x41')]=[{'all':!![]}];}return db['VoicePrefix'][_0x4d82('0x42')](_0x175961);})[_0x4d82('0x27')](function(_0x3f0a9f){_0x33d2a9[_0x4d82('0x43')]=_0x3f0a9f;return _0x33d2a9;})[_0x4d82('0x27')](respondWithFilteredResult(_0x16d30a,_0x175961))[_0x4d82('0x44')](handleError(_0x16d30a,null));};exports[_0x4d82('0x45')]=function(_0x5847c0,_0xe8c15f){var _0x1909da={'raw':![],'where':{'id':_0x5847c0[_0x4d82('0x46')]['id']}},_0x55e2f7={};_0x55e2f7['model']=_[_0x4d82('0x35')](db[_0x4d82('0x2f')]['rawAttributes']);_0x55e2f7[_0x4d82('0x34')]=_[_0x4d82('0x35')](_0x5847c0['query']);_0x55e2f7[_0x4d82('0x36')]=_[_0x4d82('0x47')](_0x55e2f7[_0x4d82('0x33')],_0x55e2f7['query']);_0x1909da[_0x4d82('0x37')]=_[_0x4d82('0x47')](_0x55e2f7['model'],qs['fields'](_0x5847c0[_0x4d82('0x34')][_0x4d82('0x38')]));_0x1909da[_0x4d82('0x37')]=_0x1909da[_0x4d82('0x37')][_0x4d82('0x48')]?_0x1909da[_0x4d82('0x37')]:_0x55e2f7[_0x4d82('0x33')];if(_0x5847c0['query'][_0x4d82('0x40')]){_0x1909da[_0x4d82('0x41')]=[{'all':!![]}];}_0x1909da=_[_0x4d82('0x3d')]({},_0x1909da,_0x5847c0[_0x4d82('0x3f')]);return db['VoicePrefix']['find'](_0x1909da)['then'](handleEntityNotFound(_0xe8c15f,null))[_0x4d82('0x27')](respondWithResult(_0xe8c15f,null))[_0x4d82('0x44')](handleError(_0xe8c15f,null));};exports[_0x4d82('0x2a')]=function(_0x34a08b,_0x25fc80){return db[_0x4d82('0x2f')]['find']({'where':{'id':_0x34a08b[_0x4d82('0x46')]['id']}})[_0x4d82('0x27')](handleEntityNotFound(_0x25fc80,null))[_0x4d82('0x27')](removeEntity(_0x25fc80,null))[_0x4d82('0x44')](handleError(_0x25fc80,null));};exports[_0x4d82('0x49')]=function(_0x33f498,_0x127ef3){return db[_0x4d82('0x2f')][_0x4d82('0x49')]()['then'](respondWithResult(_0x127ef3,null))[_0x4d82('0x44')](handleError(_0x127ef3,null));};exports[_0x4d82('0x4a')]=function(_0x1822db,_0x25e8b9){var _0x1d853f;return db[_0x4d82('0x4b')]['transaction'](function(_0x5cf138){return db[_0x4d82('0x2f')][_0x4d82('0x4a')](_0x1822db[_0x4d82('0x4c')],{'transaction':_0x5cf138})[_0x4d82('0x27')](function(_0x2e373a){_0x1d853f=_0x2e373a[_0x4d82('0x28')]({'plain':!![]});return db[_0x4d82('0x4d')][_0x4d82('0x4e')]({'where':{'id':_0x1d853f[_0x4d82('0x4f')]},'raw':!![]})[_0x4d82('0x27')](function(_0x367c82){return createVoicePrefixExtensions(_0x1d853f,_0x367c82,_0x5cf138);});});})[_0x4d82('0x27')](function(){var _0x517f87=_0x1822db[_0x4d82('0x50')]['get']({'plain':!![]});if(!_0x517f87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x517f87[_0x4d82('0x51')]===_0x4d82('0x50')){var _0x257dc4=_0x1d853f;return db['UserProfileSection'][_0x4d82('0x4e')]({'where':{'name':_0x4d82('0x29'),'userProfileId':_0x517f87[_0x4d82('0x52')]},'raw':!![]})[_0x4d82('0x27')](function(_0x4aaa65){if(_0x4aaa65&&_0x4aaa65[_0x4d82('0x53')]===0x0){return db[_0x4d82('0x54')][_0x4d82('0x4a')]({'name':_0x257dc4[_0x4d82('0x2c')],'resourceId':_0x257dc4['id'],'type':_0x4aaa65[_0x4d82('0x2c')],'sectionId':_0x4aaa65['id']},{})['then'](function(){return _0x1d853f;});}else{return _0x1d853f;}})[_0x4d82('0x44')](function(_0x3297ce){logger[_0x4d82('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3297ce);throw _0x3297ce;});}return _0x1d853f;})[_0x4d82('0x27')](respondWithResult(_0x25e8b9,null))[_0x4d82('0x44')](handleError(_0x25e8b9,null));};function Extension(_0x131bb5,_0x189e3f,_0x14e621,_0x3148bd){this[_0x4d82('0x55')]='from-sip';this['exten']=_0x131bb5;this[_0x4d82('0x56')]=_0x14e621;this[_0x4d82('0x31')]=_0x4d82('0x57');this['description']=_0x4d82('0x58');this[_0x4d82('0x59')]=_0x189e3f;this[_0x4d82('0x5a')]=_0x3148bd;}function createVoicePrefixExtensions(_0x3d85c2,_0x238459,_0x2aec60){return new BPromise(function(_0xa2cdb3,_0xc70504){var _0x131a10=new Extension(formatPrefixName(_0x3d85c2[_0x4d82('0x5b')]),0x1,'NoOp','Voice\x20Prefix');_0x131a10[_0x4d82('0x5c')]=_0x3d85c2['id'];return db[_0x4d82('0x4d')][_0x4d82('0x4a')](_0x131a10,{'transaction':_0x2aec60})['then'](function(_0x471349){var _0xc80c61=_0x471349[_0x4d82('0x28')]({'plain':!![]});var _0x328991=_[_0x4d82('0x2e')](addVoicePrefixExtensions(_0x3d85c2,_0x238459),function(_0x43c72e){_0x43c72e[_0x4d82('0x4f')]=_0xc80c61['id'];_0x43c72e[_0x4d82('0x5c')]=_0x3d85c2['id'];return _0x43c72e;});return db['VoiceExtension'][_0x4d82('0x5d')](_0x328991,{'transaction':_0x2aec60})[_0x4d82('0x27')](function(_0x279172){if(!_0x279172){return _0xc70504('Extensions\x20creation\x20failed');}else{return _0xa2cdb3(_0x279172);}})['catch'](function(_0x1d3e90){return _0xc70504(_0x1d3e90);});});;});};function addVoicePrefixExtensions(_0xc5b353,_0x1a785a){var _0x15d620=[];var _0x2872bf=formatPrefixName(_0xc5b353[_0x4d82('0x5b')]);_0x15d620['push'](new Extension(_0x2872bf,0x2,_0x4d82('0x5e'),_0x4d82('0x5f')+_0xc5b353[_0x4d82('0x2c')]));if(_0xc5b353['callerIdAll']){_0x15d620[_0x4d82('0x60')](new Extension(_0x2872bf,0x3,_0x4d82('0x5e'),_0x4d82('0x61')+_0xc5b353['callerIdAll']));}else{_0x15d620[_0x4d82('0x60')](new Extension(_0x2872bf,0x3,_0x4d82('0x62'),'No\x20callerid\x20available'));}_0x15d620[_0x4d82('0x60')](new Extension(_0x2872bf,0x4,'goto',_0x1a785a[_0x4d82('0x55')]+','+'${EXTEN:'+(0x8+_0xc5b353['name'][_0x4d82('0x48')])+'}'+','+0x1));return _0x15d620;}function formatPrefixName(_0x32e291){var _0x5279e3='_';for(var _0x307592=0x0;_0x307592<_0x32e291['length'];_0x307592++){if(_0x32e291[_0x4d82('0x63')](_0x307592)=='-'){_0x5279e3+=_0x32e291['charAt'](_0x307592);}else{_0x5279e3+='['+_0x32e291[_0x4d82('0x63')](_0x307592)+']';}}_0x5279e3+='.';return _0x5279e3;}exports[_0x4d82('0x26')]=function(_0x2fcf61,_0x75900c,_0x9c5e5c){var _0x456f33=_0x2fcf61[_0x4d82('0x4c')];_0x456f33[_0x4d82('0x5b')]=_0x4d82('0x64')+_0x456f33[_0x4d82('0x2c')]+'-';return db[_0x4d82('0x4b')][_0x4d82('0x65')](function(_0x14d697){return db[_0x4d82('0x2f')][_0x4d82('0x26')](_0x456f33,{'where':{'id':_0x456f33['id']},'transaction':_0x14d697})[_0x4d82('0x27')](function(){return db[_0x4d82('0x4d')][_0x4d82('0x2a')]({'where':{'VoicePrefixId':_0x456f33['id']},'transaction':_0x14d697})['then'](function(){return db['VoiceExtension'][_0x4d82('0x4e')]({'where':{'id':_0x456f33['VoiceExtensionId']},'raw':!![]})[_0x4d82('0x27')](function(_0x47644d){return createVoicePrefixExtensions(_0x456f33,_0x47644d,_0x14d697);});});});})[_0x4d82('0x27')](function(){return db[_0x4d82('0x2f')][_0x4d82('0x66')](_0x456f33['id']);})[_0x4d82('0x27')](respondWithResult(_0x75900c,null))['catch'](handleError(_0x75900c,null));};exports[_0x4d82('0x67')]=function(_0x220e87,_0x554778,_0x80d688){return db[_0x4d82('0x2f')][_0x4d82('0x4e')]({'where':{'id':_0x220e87[_0x4d82('0x46')]['id']}})[_0x4d82('0x27')](handleEntityNotFound(_0x554778,null))[_0x4d82('0x27')](function(_0x212561){if(_0x212561){return _0x212561[_0x4d82('0x67')](_0x220e87['body']['ids'],_['omit'](_0x220e87['body'],['ids','id'])||{})[_0x4d82('0x68')](function(_0x245e97){for(var _0x1fe26a=0x0;_0x1fe26a<_0x220e87['body'][_0x4d82('0x69')][_0x4d82('0x48')];_0x1fe26a+=0x1){socket[_0x4d82('0x6a')](_0x4d82('0x6b'),{'UserId':Number(_0x220e87[_0x4d82('0x4c')]['ids'][_0x1fe26a]),'VoicePrefixId':Number(_0x220e87['params']['id'])});}return _0x245e97;});}})[_0x4d82('0x27')](respondWithResult(_0x554778,null))[_0x4d82('0x44')](handleError(_0x554778,null));};exports[_0x4d82('0x6c')]=function(_0x2471b8,_0xd64d2a,_0x353c18){return db['VoicePrefix'][_0x4d82('0x4e')]({'where':{'id':_0x2471b8['params']['id']}})[_0x4d82('0x27')](handleEntityNotFound(_0xd64d2a,null))[_0x4d82('0x27')](function(_0x28a256){if(_0x28a256){return _0x28a256[_0x4d82('0x6c')](_0x2471b8[_0x4d82('0x34')]['ids'])[_0x4d82('0x27')](function(){if(_[_0x4d82('0x6d')](_0x2471b8[_0x4d82('0x34')][_0x4d82('0x69')])){for(var _0x2a50b3=0x0;_0x2a50b3<_0x2471b8[_0x4d82('0x34')][_0x4d82('0x69')][_0x4d82('0x48')];_0x2a50b3+=0x1){socket[_0x4d82('0x6a')](_0x4d82('0x6e'),{'UserId':Number(_0x2471b8[_0x4d82('0x34')]['ids'][_0x2a50b3]),'VoicePrefixId':Number(_0x2471b8[_0x4d82('0x46')]['id'])});}}else{socket[_0x4d82('0x6a')](_0x4d82('0x6e'),{'UserId':Number(_0x2471b8[_0x4d82('0x34')][_0x4d82('0x69')]),'VoicePrefixId':Number(_0x2471b8[_0x4d82('0x46')]['id'])});}});}})[_0x4d82('0x27')](respondWithStatusCode(_0xd64d2a,null))['catch'](handleError(_0xd64d2a,null));};exports[_0x4d82('0x6f')]=function(_0x3b7592,_0x5380ce,_0x21ea7c){var _0x588471={};var _0x634bfb={};var _0x5092ff;var _0x472666;return db['VoicePrefix'][_0x4d82('0x70')]({'where':{'id':_0x3b7592[_0x4d82('0x46')]['id']}})[_0x4d82('0x27')](handleEntityNotFound(_0x5380ce,null))['then'](function(_0x960e9){if(_0x960e9){_0x5092ff=_0x960e9;_0x634bfb[_0x4d82('0x33')]=_['keys'](db[_0x4d82('0x71')][_0x4d82('0x72')]);_0x634bfb[_0x4d82('0x34')]=_['keys'](_0x3b7592['query']);_0x634bfb[_0x4d82('0x36')]=_[_0x4d82('0x47')](_0x634bfb[_0x4d82('0x33')],_0x634bfb[_0x4d82('0x34')]);_0x588471[_0x4d82('0x37')]=_[_0x4d82('0x47')](_0x634bfb['model'],qs[_0x4d82('0x38')](_0x3b7592[_0x4d82('0x34')]['fields']));_0x588471[_0x4d82('0x37')]=_0x588471[_0x4d82('0x37')][_0x4d82('0x48')]?_0x588471['attributes']:_0x634bfb[_0x4d82('0x33')];_0x588471[_0x4d82('0x3a')]=qs[_0x4d82('0x73')](_0x3b7592[_0x4d82('0x34')]['sort']);_0x588471[_0x4d82('0x3b')]=qs[_0x4d82('0x36')](_[_0x4d82('0x74')](_0x3b7592[_0x4d82('0x34')],_0x634bfb['filters']));if(_0x3b7592[_0x4d82('0x34')]['filter']){_0x588471['where']=_[_0x4d82('0x3d')](_0x588471[_0x4d82('0x3b')],{'$or':_[_0x4d82('0x2e')](_0x588471[_0x4d82('0x37')],function(_0xb2d707){var _0x49d4ed={};_0x49d4ed[_0xb2d707]={'$like':'%'+_0x3b7592[_0x4d82('0x34')][_0x4d82('0x3c')]+'%'};return _0x49d4ed;})});}_0x588471=_['merge']({},_0x588471,_0x3b7592[_0x4d82('0x3f')]);return _0x5092ff[_0x4d82('0x6f')](_0x588471);}})[_0x4d82('0x27')](function(_0x210ed6){if(_0x210ed6){_0x472666=_0x210ed6['length'];if(!_0x3b7592[_0x4d82('0x34')]['hasOwnProperty'](_0x4d82('0x75'))){_0x588471[_0x4d82('0x1e')]=qs[_0x4d82('0x1e')](_0x3b7592[_0x4d82('0x34')][_0x4d82('0x1e')]);_0x588471[_0x4d82('0x1d')]=qs['offset'](_0x3b7592[_0x4d82('0x34')][_0x4d82('0x1d')]);}return _0x5092ff[_0x4d82('0x6f')](_0x588471);}})[_0x4d82('0x27')](function(_0x2c80ae){if(_0x2c80ae){return _0x2c80ae?{'count':_0x472666,'rows':_0x2c80ae}:null;}})[_0x4d82('0x27')](respondWithResult(_0x5380ce,null))[_0x4d82('0x44')](handleError(_0x5380ce,null));};exports['getTeams']=function(_0xfb0987,_0x5a65e4,_0x252db4){var _0x24a63a={};var _0x2d0b29={};var _0x44c35f;var _0x54fcd4;return db['VoicePrefix'][_0x4d82('0x70')]({'where':{'id':_0xfb0987[_0x4d82('0x46')]['id']}})[_0x4d82('0x27')](handleEntityNotFound(_0x5a65e4,null))[_0x4d82('0x27')](function(_0x45b2e3){if(_0x45b2e3){_0x44c35f=_0x45b2e3;_0x2d0b29[_0x4d82('0x33')]=_['keys'](db[_0x4d82('0x76')][_0x4d82('0x72')]);_0x2d0b29[_0x4d82('0x34')]=_[_0x4d82('0x35')](_0xfb0987[_0x4d82('0x34')]);_0x2d0b29['filters']=_[_0x4d82('0x47')](_0x2d0b29[_0x4d82('0x33')],_0x2d0b29[_0x4d82('0x34')]);_0x24a63a[_0x4d82('0x37')]=_[_0x4d82('0x47')](_0x2d0b29['model'],qs[_0x4d82('0x38')](_0xfb0987[_0x4d82('0x34')][_0x4d82('0x38')]));_0x24a63a[_0x4d82('0x37')]=_0x24a63a[_0x4d82('0x37')][_0x4d82('0x48')]?_0x24a63a['attributes']:_0x2d0b29['model'];_0x24a63a[_0x4d82('0x3a')]=qs[_0x4d82('0x73')](_0xfb0987[_0x4d82('0x34')]['sort']);_0x24a63a[_0x4d82('0x3b')]=qs[_0x4d82('0x36')](_['pick'](_0xfb0987[_0x4d82('0x34')],_0x2d0b29[_0x4d82('0x36')]));if(_0xfb0987[_0x4d82('0x34')][_0x4d82('0x3c')]){_0x24a63a[_0x4d82('0x3b')]=_[_0x4d82('0x3d')](_0x24a63a[_0x4d82('0x3b')],{'$or':_[_0x4d82('0x2e')](_0x24a63a['attributes'],function(_0x5471c3){var _0x1d1329={};_0x1d1329[_0x5471c3]={'$like':'%'+_0xfb0987[_0x4d82('0x34')][_0x4d82('0x3c')]+'%'};return _0x1d1329;})});}_0x24a63a=_['merge']({},_0x24a63a,_0xfb0987[_0x4d82('0x3f')]);return _0x44c35f[_0x4d82('0x77')](_0x24a63a);}})[_0x4d82('0x27')](function(_0x5a9056){if(_0x5a9056){_0x54fcd4=_0x5a9056[_0x4d82('0x48')];if(!_0xfb0987['query']['hasOwnProperty'](_0x4d82('0x75'))){_0x24a63a[_0x4d82('0x1e')]=qs[_0x4d82('0x1e')](_0xfb0987[_0x4d82('0x34')][_0x4d82('0x1e')]);_0x24a63a[_0x4d82('0x1d')]=qs[_0x4d82('0x1d')](_0xfb0987[_0x4d82('0x34')]['offset']);}return _0x44c35f[_0x4d82('0x77')](_0x24a63a);}})['then'](function(_0xc764bb){if(_0xc764bb){return _0xc764bb?{'count':_0x54fcd4,'rows':_0xc764bb}:null;}})[_0x4d82('0x27')](respondWithResult(_0x5a65e4,null))[_0x4d82('0x44')](handleError(_0x5a65e4,null));};exports['addTeams']=function(_0xead937,_0x59e1bc,_0x521566){var _0x1eda7c=_0xead937['body'][_0x4d82('0x69')];var _0x5ac864;return db[_0x4d82('0x76')][_0x4d82('0x42')]({'where':{'id':_0x1eda7c},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4d82('0x78'),'attributes':['id',_0x4d82('0x2c'),_0x4d82('0x79'),_0x4d82('0x7a'),_0x4d82('0x7b')],'raw':!![]}]})[_0x4d82('0x27')](function(_0x2b832e){if(_0x2b832e){_0x5ac864=_0x2b832e;var _0x402626=_[_0x4d82('0x7c')](_0x2b832e,function(_0x3be4f9){var _0x47c734=_0x3be4f9[_0x4d82('0x28')]({'plain':!![]});return _0x47c734[_0x4d82('0x78')];});return db[_0x4d82('0x2f')][_0x4d82('0x4e')]({'where':{'id':_0xead937[_0x4d82('0x46')]['id']}})[_0x4d82('0x27')](function(_0x1768e2){return db[_0x4d82('0x4b')][_0x4d82('0x65')](function(_0x1c61f5){return _0x1768e2[_0x4d82('0x7d')](_0x1eda7c,{'transaction':_0x1c61f5})[_0x4d82('0x27')](function(){return BPromise[_0x4d82('0x7e')](_0x5ac864,function(_0x44729c){return db[_0x4d82('0x7f')][_0x4d82('0x80')]({'TeamId':_0x44729c['id'],'VoicePrefixId':_0xead937[_0x4d82('0x46')]['id']},{'transaction':_0x1c61f5});});})[_0x4d82('0x27')](function(){return BPromise['each'](_0x402626,function(_0x2867e7){return db[_0x4d82('0x81')][_0x4d82('0x82')]({'where':{'UserId':_0x2867e7['id'],'VoicePrefixId':_0xead937[_0x4d82('0x46')]['id']},'transaction':_0x1c61f5});});})[_0x4d82('0x27')](function(){_0x402626['forEach'](function(_0x14b0cb){socket[_0x4d82('0x6a')](_0x4d82('0x6b'),{'UserId':_0x14b0cb['id'],'VoicePrefixId':_0x1768e2['id']});});});});});}})[_0x4d82('0x27')](respondWithStatusCode(_0x59e1bc,null))[_0x4d82('0x44')](handleError(_0x59e1bc,null));};exports['removeTeams']=function(_0xc56d02,_0x34234c,_0x23778f){return db['Team'][_0x4d82('0x42')]({'where':{'id':_0xc56d02['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x4d82('0x71')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x34234c,null))[_0x4d82('0x27')](function(_0x1d32c3){var _0x4d0047=_['map'](_0x1d32c3,'id');var _0x4f7c18=[];var _0x4277b7=[];var _0x2b7c2c=squel[_0x4d82('0x83')]();_0x2b7c2c['field']('tq.TeamId')[_0x4d82('0x84')](_0x4d82('0x85'),'tq')[_0x4d82('0x86')](_0x4d82('0x87'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4d82('0x3b')](_0x4d82('0x88'),_0xc56d02[_0x4d82('0x46')]['id']);for(var _0x2c18b2=0x0;_0x2c18b2<_0x1d32c3[_0x4d82('0x48')];_0x2c18b2+=0x1){let _0x37cac6=_0x1d32c3[_0x2c18b2];for(var _0x642d9=0x0;_0x642d9<_0x37cac6['Agents'][_0x4d82('0x48')];_0x642d9+=0x1){let _0x3097f8=_0x37cac6[_0x4d82('0x78')][_0x642d9];var _0x5ccadb=_0x2b7c2c['clone']();_0x5ccadb[_0x4d82('0x3b')](_0x4d82('0x89'),_0x3097f8['id']);_0x4277b7[_0x4d82('0x60')](db['sequelize'][_0x4d82('0x34')](_0x5ccadb[_0x4d82('0x8a')](),{'type':db[_0x4d82('0x4b')][_0x4d82('0x8b')]['SELECT']})[_0x4d82('0x27')](function(_0x3f0228){if(_0x3f0228['length']===0x1){return _0x3097f8['id'];}else{var _0x5f4633=_[_0x4d82('0x8c')](_['map'](_0x3f0228,'TeamId'),function(_0x3e4fb1){return _[_0x4d82('0x8d')](_0x4d0047,_0x3e4fb1);});if(_0x5f4633){return _0x3097f8['id'];}}}));}}return BPromise[_0x4d82('0x8e')](_0x4277b7)['then'](function(_0x4d6de5){_0x4f7c18=_(_0x4f7c18)['union'](_0x4d6de5)['compact']()[_0x4d82('0x8f')]();return db[_0x4d82('0x2f')][_0x4d82('0x4e')]({'where':{'id':_0xc56d02['params']['id']}})[_0x4d82('0x27')](function(_0x227e2c){return db[_0x4d82('0x4b')][_0x4d82('0x65')](function(_0x4f36f5){return _0x227e2c[_0x4d82('0x90')](_0xc56d02['query'][_0x4d82('0x69')],{'transaction':_0x4f36f5})[_0x4d82('0x27')](function(){if(!_[_0x4d82('0x91')](_0x4f7c18)){return _0x227e2c[_0x4d82('0x6c')](_0x4f7c18,{'transaction':_0x4f36f5});}})[_0x4d82('0x27')](function(){_0x4f7c18['forEach'](function(_0x3a0735){socket[_0x4d82('0x6a')]('userVoicePrefix:remove',{'UserId':_0x3a0735,'VoicePrefixId':_0x227e2c['id']});});});});});});})['then'](respondWithStatusCode(_0x34234c,null))['catch'](handleError(_0x34234c,null));};
\ No newline at end of file
index 24865e9..08f61eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c75=['events','VoicePrefix','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x2b50be,_0x4e3d61){var _0x212cd4=function(_0x1a7b87){while(--_0x1a7b87){_0x2b50be['push'](_0x2b50be['shift']());}};_0x212cd4(++_0x4e3d61);}(_0x0c75,0xe0));var _0x50c7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0c75[_0x2641f9];return _0x585741;};'use strict';var EventEmitter=require(_0x50c7('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x50c7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x50c7('0x2'),'afterUpdate':_0x50c7('0x3'),'afterDestroy':_0x50c7('0x4')};function emitEvent(_0x1011ae){return function(_0x3b36a1,_0x58bac1,_0x4bbf05){VoicePrefixEvents[_0x50c7('0x5')](_0x1011ae+':'+_0x3b36a1['id'],_0x3b36a1);VoicePrefixEvents[_0x50c7('0x5')](_0x1011ae,_0x3b36a1);_0x4bbf05(null);};}for(var e in events){if(events[_0x50c7('0x6')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x50c7('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x4487=['save','update','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x56d056,_0x5ae626){var _0x1d7db0=function(_0x3096c5){while(--_0x3096c5){_0x56d056['push'](_0x56d056['shift']());}};_0x1d7db0(++_0x5ae626);}(_0x4487,0x146));var _0x7448=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x4487[_0x2b9b7f];return _0x4ed19a;};'use strict';var EventEmitter=require(_0x7448('0x0'));var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7448('0x1')](0x0);var events={'afterCreate':_0x7448('0x2'),'afterUpdate':_0x7448('0x3'),'afterDestroy':'remove'};function emitEvent(_0x10a1cd){return function(_0x5c98bd,_0x14c890,_0x279c09){VoicePrefixEvents[_0x7448('0x4')](_0x10a1cd+':'+_0x5c98bd['id'],_0x5c98bd);VoicePrefixEvents[_0x7448('0x4')](_0x10a1cd,_0x5c98bd);_0x279c09(null);};}for(var e in events){if(events[_0x7448('0x5')](e)){var event=events[e];VoicePrefix[_0x7448('0x6')](e,emitEvent(event));}}module[_0x7448('0x7')]=VoicePrefixEvents;
\ No newline at end of file
index 1e36aeb..0cbbf23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa82c=['voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa82c,0x11f));var _0xca82=function(_0x320586,_0x54b8d3){_0x320586=_0x320586-0x0;var _0x426f7f=_0xa82c[_0x320586];return _0x426f7f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xca82('0x0'))(_0xca82('0x1'));var moment=require(_0xca82('0x2'));var BPromise=require(_0xca82('0x3'));var rp=require(_0xca82('0x4'));var fs=require('fs');var path=require(_0xca82('0x5'));var rimraf=require(_0xca82('0x6'));var config=require(_0xca82('0x7'));var attributes=require(_0xca82('0x8'));module[_0xca82('0x9')]=function(_0xbb6de1,_0x322a8b){return _0xbb6de1[_0xca82('0xa')](_0xca82('0xb'),attributes,{'tableName':_0xca82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cad=['moment','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger'];(function(_0x456c9d,_0xa6b604){var _0x38d5c=function(_0x5c0323){while(--_0x5c0323){_0x456c9d['push'](_0x456c9d['shift']());}};_0x38d5c(++_0xa6b604);}(_0x1cad,0x76));var _0xd1ca=function(_0x4ad300,_0x4df3df){_0x4ad300=_0x4ad300-0x0;var _0x5655c8=_0x1cad[_0x4ad300];return _0x5655c8;};'use strict';var _=require('lodash');var util=require(_0xd1ca('0x0'));var logger=require(_0xd1ca('0x1'))('api');var moment=require(_0xd1ca('0x2'));var BPromise=require('bluebird');var rp=require(_0xd1ca('0x3'));var fs=require('fs');var path=require(_0xd1ca('0x4'));var rimraf=require(_0xd1ca('0x5'));var config=require(_0xd1ca('0x6'));var attributes=require(_0xd1ca('0x7'));module[_0xd1ca('0x8')]=function(_0x3bd264,_0x2791d0){return _0x3bd264[_0xd1ca('0x9')](_0xd1ca('0xa'),attributes,{'tableName':_0xd1ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d45563c..7cd637f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96f2=['info','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request'];(function(_0x173321,_0x44952b){var _0x1e1c81=function(_0x18a649){while(--_0x18a649){_0x173321['push'](_0x173321['shift']());}};_0x1e1c81(++_0x44952b);}(_0x96f2,0xb0));var _0x296f=function(_0x23910d,_0x237b71){_0x23910d=_0x23910d-0x0;var _0x58f5db=_0x96f2[_0x23910d];return _0x58f5db;};'use strict';var _=require(_0x296f('0x0'));var util=require('util');var moment=require(_0x296f('0x1'));var BPromise=require(_0x296f('0x2'));var rs=require(_0x296f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x296f('0x4'))['db'];var utils=require(_0x296f('0x5'));var logger=require(_0x296f('0x6'))('rpc');var config=require(_0x296f('0x7'));var jayson=require(_0x296f('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x296f('0x9')]=_[_0x296f('0xa')](config[_0x296f('0x9')],{'host':_0x296f('0xb'),'port':0x18eb});var socket=require(_0x296f('0xc'))(new Redis(config[_0x296f('0x9')]));require(_0x296f('0xd'))[_0x296f('0xe')](socket);function respondWithRpcPromise(_0x2f81ac,_0x3729ab,_0x593fd9){return new BPromise(function(_0xea97f0,_0x1a2a02){return client[_0x296f('0xf')](_0x2f81ac,_0x593fd9)['then'](function(_0x2e2307){logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3729ab,'request\x20sent',JSON[_0x296f('0x13')](_0x2e2307));if(_0x2e2307[_0x296f('0x14')]){if(_0x2e2307[_0x296f('0x14')][_0x296f('0x15')]===0x1f4){logger['error'](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0x1a2a02(_0x2e2307[_0x296f('0x14')][_0x296f('0x16')]);}logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x2e2307['error']['message']);return _0xea97f0(_0x2e2307[_0x296f('0x14')]['message']);}else{logger[_0x296f('0x10')](_0x296f('0x11'),_0x3729ab,_0x296f('0x12'));_0xea97f0(_0x2e2307['result'][_0x296f('0x16')]);}})[_0x296f('0x17')](function(_0x57f19d){logger[_0x296f('0x14')](_0x296f('0x11'),_0x3729ab,_0x57f19d);_0x1a2a02(_0x57f19d);});});}
\ No newline at end of file
+var _0xc838=['then','VoicePrefix,\x20%s,\x20%s','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voicePrefix.socket','register','request'];(function(_0x3fb48b,_0x163041){var _0x3e11b5=function(_0x417cfa){while(--_0x417cfa){_0x3fb48b['push'](_0x3fb48b['shift']());}};_0x3e11b5(++_0x163041);}(_0xc838,0xbd));var _0x8c83=function(_0xab8cd6,_0x577431){_0xab8cd6=_0xab8cd6-0x0;var _0x11ef61=_0xc838[_0xab8cd6];return _0x11ef61;};'use strict';var _=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var moment=require(_0x8c83('0x2'));var BPromise=require(_0x8c83('0x3'));var rs=require(_0x8c83('0x4'));var fs=require('fs');var Redis=require(_0x8c83('0x5'));var db=require(_0x8c83('0x6'))['db'];var utils=require(_0x8c83('0x7'));var logger=require(_0x8c83('0x8'))(_0x8c83('0x9'));var config=require(_0x8c83('0xa'));var jayson=require(_0x8c83('0xb'));var client=jayson[_0x8c83('0xc')][_0x8c83('0xd')]({'port':0x232a});config[_0x8c83('0xe')]=_['defaults'](config['redis'],{'host':_0x8c83('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8c83('0xe')]));require(_0x8c83('0x10'))[_0x8c83('0x11')](socket);function respondWithRpcPromise(_0x3ce7b5,_0x452aae,_0x21442e){return new BPromise(function(_0x2e547f,_0x105a36){return client[_0x8c83('0x12')](_0x3ce7b5,_0x21442e)[_0x8c83('0x13')](function(_0x2fb6e5){logger['info'](_0x8c83('0x14'),_0x452aae,'request\x20sent');logger['debug'](_0x8c83('0x15'),_0x452aae,'request\x20sent',JSON[_0x8c83('0x16')](_0x2fb6e5));if(_0x2fb6e5[_0x8c83('0x17')]){if(_0x2fb6e5[_0x8c83('0x17')][_0x8c83('0x18')]===0x1f4){logger[_0x8c83('0x17')](_0x8c83('0x14'),_0x452aae,_0x2fb6e5[_0x8c83('0x17')][_0x8c83('0x19')]);return _0x105a36(_0x2fb6e5[_0x8c83('0x17')][_0x8c83('0x19')]);}logger['error'](_0x8c83('0x14'),_0x452aae,_0x2fb6e5[_0x8c83('0x17')]['message']);return _0x2e547f(_0x2fb6e5['error'][_0x8c83('0x19')]);}else{logger['info'](_0x8c83('0x14'),_0x452aae,'request\x20sent');_0x2e547f(_0x2fb6e5['result'][_0x8c83('0x19')]);}})['catch'](function(_0x3b0106){logger[_0x8c83('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x452aae,_0x3b0106);_0x105a36(_0x3b0106);});});}
\ No newline at end of file
index c18cff4..a6a6bf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1120=['./voicePrefix.events','save','remove','emit','removeListener','register','length','voicePrefix:'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x1120,0x140));var _0x0112=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x1120[_0x49c057];return _0xd8f0e6;};'use strict';var VoicePrefixEvents=require(_0x0112('0x0'));var events=[_0x0112('0x1'),_0x0112('0x2'),'update'];function createListener(_0x5dd0ed,_0x5190bd){return function(_0x54a1d2){_0x5190bd[_0x0112('0x3')](_0x5dd0ed,_0x54a1d2);};}function removeListener(_0x395145,_0x1d9e34){return function(){VoicePrefixEvents[_0x0112('0x4')](_0x395145,_0x1d9e34);};}exports[_0x0112('0x5')]=function(_0x10fdca){for(var _0x408230=0x0,_0x40ad0d=events[_0x0112('0x6')];_0x408230<_0x40ad0d;_0x408230++){var _0x444422=events[_0x408230];var _0x2fd18c=createListener(_0x0112('0x7')+_0x444422,_0x10fdca);VoicePrefixEvents['on'](_0x444422,_0x2fd18c);}};
\ No newline at end of file
+var _0x255f=['emit','removeListener','register','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x5dddff,_0x46bd23){var _0x5942d9=function(_0x1c9c4f){while(--_0x1c9c4f){_0x5dddff['push'](_0x5dddff['shift']());}};_0x5942d9(++_0x46bd23);}(_0x255f,0x185));var _0xf255=function(_0x3fbe05,_0x2e38f3){_0x3fbe05=_0x3fbe05-0x0;var _0x5f4d04=_0x255f[_0x3fbe05];return _0x5f4d04;};'use strict';var VoicePrefixEvents=require(_0xf255('0x0'));var events=['save',_0xf255('0x1'),_0xf255('0x2')];function createListener(_0xba19b,_0x4fae55){return function(_0x3984f5){_0x4fae55[_0xf255('0x3')](_0xba19b,_0x3984f5);};}function removeListener(_0x474ac5,_0x151b29){return function(){VoicePrefixEvents[_0xf255('0x4')](_0x474ac5,_0x151b29);};}exports[_0xf255('0x5')]=function(_0xc1d19f){for(var _0x5bbed0=0x0,_0x1236fb=events['length'];_0x5bbed0<_0x1236fb;_0x5bbed0++){var _0x481d8c=events[_0x5bbed0];var _0x4a533f=createListener(_0xf255('0x6')+_0x481d8c,_0xc1d19f);VoicePrefixEvents['on'](_0x481d8c,_0x4a533f);}};
\ No newline at end of file
index 3432b04..316f334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x3b6311,_0x15c416){var _0x4e4036=function(_0x401dcd){while(--_0x401dcd){_0x3b6311['push'](_0x3b6311['shift']());}};_0x4e4036(++_0x15c416);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router;
\ No newline at end of file
+var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x1da04e,_0x31024b){var _0xdd8c41=function(_0x2036f9){while(--_0x2036f9){_0x1da04e['push'](_0x1da04e['shift']());}};_0xdd8c41(++_0x31024b);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c7c4a,_0x520920){_0x4c7c4a=_0x4c7c4a-0x0;var _0x4d78ae=_0xb10b[_0x4c7c4a];return _0x4d78ae;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router;
\ No newline at end of file
index 43347ef..1e8ac29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a80=['name','inbound','outbound','STRING','ENUM','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','booked','progressive','power','INTEGER','yes','once','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','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','Only\x20for\x20predictive\x20method.','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','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports'];(function(_0x1c9425,_0x5d1193){var _0x354e42=function(_0xf6e101){while(--_0xf6e101){_0x1c9425['push'](_0x1c9425['shift']());}};_0x354e42(++_0x5d1193);}(_0x5a80,0x193));var _0x05a8=function(_0x3da060,_0x521687){_0x3da060=_0x3da060-0x0;var _0x137992=_0x5a80[_0x3da060];return _0x137992;};'use strict';var Sequelize=require(_0x05a8('0x0'));module[_0x05a8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x05a8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x05a8('0x3'),_0x05a8('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':''},'strategy':{'type':Sequelize[_0x05a8('0x6')]('rr',_0x05a8('0x7'),_0x05a8('0x8'),_0x05a8('0x9'),_0x05a8('0xa'),'rrmemory',_0x05a8('0xb'),_0x05a8('0xc'),_0x05a8('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0xdace7d){this[_0x05a8('0xe')](_0x05a8('0xf'),_0xdace7d?_0xdace7d:_0x05a8('0x10'));},'get':function(){var _0x3abc21=this[_0x05a8('0x11')](_0x05a8('0x12'));var _0x2bf5f0=this[_0x05a8('0x11')]('dialMethod');var _0x59eb11=this[_0x05a8('0x11')](_0x05a8('0xf'));if(_0x3abc21===_0x05a8('0x3')){return _0x59eb11;}if(_0x2bf5f0===_0x05a8('0x13')&&_0x59eb11===_0x05a8('0x10')||_0x2bf5f0===_0x05a8('0x13')&&_0x59eb11==='roundrobin'){return _0x59eb11;}if(_0x2bf5f0===_0x05a8('0x14')||_0x2bf5f0==='predictive'||_0x2bf5f0===_0x05a8('0x15')){return _0x59eb11;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x05a8('0x16')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x05a8('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x05a8('0x5')]},'weight':{'type':Sequelize[_0x05a8('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':_0x05a8('0x17')},'autopause':{'type':Sequelize['ENUM'](_0x05a8('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x05a8('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x05a8('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x05a8('0x6')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x05a8('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x05a8('0x5')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x05a8('0x16')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x05a8('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x05a8('0x17')},'announce_holdtime':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no',_0x05a8('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x17'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x05a8('0x6')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x05a8('0x5')]},'queue_youarenext':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x05a8('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x05a8('0x5')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x05a8('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x05a8('0x5')]},'queue_less_than':{'type':Sequelize[_0x05a8('0x5')]},'periodic_announce':{'type':Sequelize[_0x05a8('0x19')],'set':function(_0x42f195){this['setDataValue']('periodic_announce',_0x42f195?_0x42f195[_0x05a8('0x1a')](','):[]);},'get':function(){return this[_0x05a8('0x11')](_0x05a8('0x1b'))?this[_0x05a8('0x11')]('periodic_announce')[_0x05a8('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':_0x05a8('0x17'),'set':function(_0x3d18e3){this[_0x05a8('0xe')](_0x05a8('0x1d'),_0x3d18e3?_0x3d18e3[_0x05a8('0x1a')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x05a8('0x11')](_0x05a8('0x1d'))[_0x05a8('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':'no','set':function(_0xe0b369){this['setDataValue']('leavewhenempty',_0xe0b369?_0xe0b369[_0x05a8('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0x05a8('0x1e'))?this[_0x05a8('0x11')](_0x05a8('0x1e'))[_0x05a8('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x05a8('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x05a8('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x05a8('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x05a8('0x5')]},'description':{'type':Sequelize[_0x05a8('0x5')]},'acw':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':0x0,'set':function(_0x35e982){this[_0x05a8('0xe')](_0x05a8('0x20'),_0x35e982);if(_0x35e982){if(this[_0x05a8('0x11')](_0x05a8('0x21'))<0x2){this[_0x05a8('0xe')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':0x0,'comment':_0x05a8('0x22')},'dialMethod':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x23'),_0x05a8('0x14'),'power','predictive',_0x05a8('0x13')),'defaultValue':_0x05a8('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x05a8('0x16')](0x4)[_0x05a8('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x05a8('0x25')},'dialLimitQueue':{'type':Sequelize[_0x05a8('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x05a8('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x05a8('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x28'),'dropRate'),'defaultValue':_0x05a8('0x29'),'comment':_0x05a8('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x05a8('0x2b')](0x2)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x05a8('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x05a8('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x05a8('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x05a8('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x05a8('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x05a8('0x2e'),'comment':_0x05a8('0x2f')},'dialQueueTimeout':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x05a8('0x30')},'dialQueueProject':{'type':Sequelize[_0x05a8('0x5')],'comment':_0x05a8('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x05a8('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x05a8('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x05a8('0x36')},'dialTimezone':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x05a8('0x37')},'dialPrefix':{'type':Sequelize[_0x05a8('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x05a8('0x6')]('always',_0x05a8('0x38'),'onlyIfOpen'),'defaultValue':_0x05a8('0x39')},'dialAMDActive':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':0x0,'comment':_0x05a8('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x05a8('0x16')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x05a8('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x05a8('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x05a8('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x05a8('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x05a8('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x05a8('0x24')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x05a8('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x05a8('0x16')](0x9)[_0x05a8('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x05a8('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x05a8('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x05a8('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':0x0,'comment':_0x05a8('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x05a8('0x6')](_0x05a8('0x44'),_0x05a8('0x45')),'defaultValue':_0x05a8('0x44')},'dialQueueProject2':{'type':Sequelize[_0x05a8('0x5')],'comment':_0x05a8('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x05a8('0x46')},'dialCutDigit':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x05a8('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x05a8('0x49')},'dialDropRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)[_0x05a8('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x05a8('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x05a8('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x05a8('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x05a8('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x1f0cf8){if(!_0x1f0cf8)this[_0x05a8('0xe')](_0x05a8('0x4f'),null);this[_0x05a8('0xe')](_0x05a8('0x50'),_0x1f0cf8);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x05a8('0x16')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x05a8('0x16')](0x3)[_0x05a8('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x05a8('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x05a8('0x24')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x07a5=['STRING','name','ENUM','inbound','default','leastrecent','fewestcalls','random','rrmemory','linear','wrandom','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','INTEGER','yes','all','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#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','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)','#RecallMe\x20Timeout\x20(min:1)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07a5,0x143));var _0x507a=function(_0x3c23fd,_0x2018c2){_0x3c23fd=_0x3c23fd-0x0;var _0x3636a1=_0x07a5[_0x3c23fd];return _0x3636a1;};'use strict';var Sequelize=require(_0x507a('0x0'));module['exports']={'name':{'type':Sequelize[_0x507a('0x1')],'allowNull':![],'unique':_0x507a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x507a('0x4')},'musiconhold':{'type':Sequelize[_0x507a('0x1')],'defaultValue':_0x507a('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x507a('0x3')]('rr','ringall',_0x507a('0x6'),_0x507a('0x7'),_0x507a('0x8'),_0x507a('0x9'),_0x507a('0xa'),_0x507a('0xb'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x4a74a1){this[_0x507a('0xc')](_0x507a('0xd'),_0x4a74a1?_0x4a74a1:_0x507a('0x9'));},'get':function(){var _0x3466c2=this[_0x507a('0xe')](_0x507a('0xf'));var _0x21b97d=this['getDataValue']('dialMethod');var _0x5cb276=this[_0x507a('0xe')](_0x507a('0xd'));if(_0x3466c2===_0x507a('0x4')){return _0x5cb276;}if(_0x21b97d===_0x507a('0x10')&&_0x5cb276===_0x507a('0x9')||_0x21b97d===_0x507a('0x10')&&_0x5cb276===_0x507a('0x11')){return _0x5cb276;}if(_0x21b97d===_0x507a('0x12')||_0x21b97d==='predictive'||_0x21b97d==='power'){return _0x5cb276;}return null;}},'servicelevel':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x507a('0x13')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x507a('0x1')]},'weight':{'type':Sequelize[_0x507a('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x507a('0x14'),'no'),'defaultValue':_0x507a('0x14')},'autopause':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no',_0x507a('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x507a('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x507a('0x3')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x507a('0x1')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x507a('0x14'),'no'),'defaultValue':_0x507a('0x14')},'announce_holdtime':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x507a('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x507a('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0x507a('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x507a('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x507a('0x1')]},'queue_youarenext':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x507a('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x507a('0x1')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x507a('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x507a('0x16')],'set':function(_0x2860bd){this[_0x507a('0xc')](_0x507a('0x17'),_0x2860bd?_0x2860bd[_0x507a('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x507a('0x17'))?this[_0x507a('0xe')](_0x507a('0x17'))[_0x507a('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x507a('0x1')],'defaultValue':_0x507a('0x14'),'set':function(_0x1412f4){this[_0x507a('0xc')]('joinempty',_0x1412f4?_0x1412f4[_0x507a('0x18')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x507a('0xe')](_0x507a('0x1a'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x507a('0x1')],'defaultValue':'no','set':function(_0x3db1de){this['setDataValue'](_0x507a('0x1b'),_0x3db1de?_0x3db1de[_0x507a('0x18')](','):undefined);},'get':function(){return this[_0x507a('0xe')](_0x507a('0x1b'))?this[_0x507a('0xe')](_0x507a('0x1b'))[_0x507a('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x507a('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x507a('0x1')]},'acw':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':0x0,'set':function(_0x2cf590){this[_0x507a('0xc')]('acw',_0x2cf590);if(_0x2cf590){if(this[_0x507a('0xe')]('wrapuptime')<0x2){this['setDataValue'](_0x507a('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x507a('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':0x0,'comment':_0x507a('0x1e')},'dialMethod':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x1f'),_0x507a('0x12'),_0x507a('0x20'),_0x507a('0x21'),'booked'),'defaultValue':_0x507a('0x12'),'comment':_0x507a('0x22')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x507a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x507a('0x24')},'dialLimitQueue':{'type':Sequelize[_0x507a('0x13')](0x4)[_0x507a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x507a('0x25')](0x2)[_0x507a('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x26'),_0x507a('0x27')),'defaultValue':_0x507a('0x27'),'comment':_0x507a('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x507a('0x25')](0x2)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x507a('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x507a('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x507a('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x507a('0x1')],'defaultValue':_0x507a('0x2c'),'comment':_0x507a('0x2d')},'dialQueueTimeout':{'type':Sequelize[_0x507a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x2e')},'dialQueueProject':{'type':Sequelize[_0x507a('0x1')],'comment':_0x507a('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x32')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x3,'comment':_0x507a('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x507a('0x13')](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x507a('0x36')},'dialTimezone':{'type':Sequelize[_0x507a('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x507a('0x1')],'defaultValue':_0x507a('0x37')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x507a('0x3')](_0x507a('0x38'),_0x507a('0x39'),_0x507a('0x3a')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x507a('0x3b')},'dialAMDInitialSilence':{'type':Sequelize[_0x507a('0x13')](0x9)[_0x507a('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x507a('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x507a('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x507a('0x13')](0x9)[_0x507a('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x507a('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x507a('0x13')](0x9)[_0x507a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x507a('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x507a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x507a('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x507a('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x507a('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x507a('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x507a('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x507a('0x13')](0x9)[_0x507a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x507a('0x13')](0x5)[_0x507a('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x507a('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x507a('0x3')]('DESC',_0x507a('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x507a('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x507a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x507a('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x507a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x507a('0x13')](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x507a('0x13')](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize[_0x507a('0x13')](0x5)[_0x507a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x507a('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x507a('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x507a('0x13')],'allowNull':!![],'comment':_0x507a('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4d3f83){if(!_0x4d3f83)this['setDataValue'](_0x507a('0x4f'),null);this[_0x507a('0xc')](_0x507a('0x50'),_0x4d3f83);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x507a('0x13')](0x3)[_0x507a('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x507a('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0x507a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x507a('0x1c')],'defaultValue':![]}};
\ No newline at end of file
index cb0da46..d778840 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed1f=['querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','map','value','type','name','destroy','error','stack','send','index','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','params','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','outbound','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','role','UserProfileSection','getHoppers','CmHopper','findOne','VoiceQueueId','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','emit','userVoiceQueue:save','ids','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','toString','QueryTypes','every','includes','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','online','format','SIP/%s','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xed1f,0x170));var _0xfed1=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xed1f[_0x2112d4];return _0x434972;};'use strict';var emlformat=require(_0xfed1('0x0'));var rimraf=require(_0xfed1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfed1('0x2'));var moment=require('moment');var BPromise=require(_0xfed1('0x3'));var Mustache=require('mustache');var util=require(_0xfed1('0x4'));var path=require(_0xfed1('0x5'));var sox=require(_0xfed1('0x6'));var csv=require(_0xfed1('0x7'));var ejs=require(_0xfed1('0x8'));var fs=require('fs');var fs_extra=require(_0xfed1('0x9'));var _=require(_0xfed1('0xa'));var squel=require(_0xfed1('0xb'));var crypto=require(_0xfed1('0xc'));var jsforce=require(_0xfed1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfed1('0x7'));var querystring=require(_0xfed1('0xe'));var Papa=require(_0xfed1('0xf'));var Redis=require('ioredis');var authService=require(_0xfed1('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfed1('0x11'));var logger=require(_0xfed1('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xfed1('0x13'));var licenseUtil=require(_0xfed1('0x14'));var db=require('../../mysqldb')['db'];config[_0xfed1('0x15')]=_['defaults'](config[_0xfed1('0x15')],{'host':_0xfed1('0x16'),'port':0x18eb});var socket=require(_0xfed1('0x17'))(new Redis(config[_0xfed1('0x15')]));require('./voiceQueue.socket')[_0xfed1('0x18')](socket);function respondWithStatusCode(_0x3754c2,_0x4a0f51){_0x4a0f51=_0x4a0f51||0xcc;return function(_0x51631c){if(_0x51631c){return _0x3754c2[_0xfed1('0x19')](_0x4a0f51);}return _0x3754c2[_0xfed1('0x1a')](_0x4a0f51)[_0xfed1('0x1b')]();};}function respondWithResult(_0x5ed220,_0x223f42){_0x223f42=_0x223f42||0xc8;return function(_0x2218d5){if(_0x2218d5){return _0x5ed220[_0xfed1('0x1a')](_0x223f42)[_0xfed1('0x1c')](_0x2218d5);}};}function respondWithFilteredResult(_0x5ab809,_0x31ff97){return function(_0x4c492e){if(_0x4c492e){var _0x34512d=typeof _0x31ff97[_0xfed1('0x1d')]===_0xfed1('0x1e')&&typeof _0x31ff97[_0xfed1('0x1f')]===_0xfed1('0x1e');var _0x2926ac=_0x4c492e[_0xfed1('0x20')];var _0x10cc18=_0x34512d?0x0:_0x31ff97[_0xfed1('0x1d')];var _0x568405=_0x34512d?_0x4c492e[_0xfed1('0x20')]:_0x31ff97['offset']+_0x31ff97[_0xfed1('0x1f')];var _0x3e5ada;if(_0x568405>=_0x2926ac){_0x568405=_0x2926ac;_0x3e5ada=0xc8;}else{_0x3e5ada=0xce;}_0x5ab809[_0xfed1('0x1a')](_0x3e5ada);return _0x5ab809[_0xfed1('0x21')](_0xfed1('0x22'),_0x10cc18+'-'+_0x568405+'/'+_0x2926ac)[_0xfed1('0x1c')](_0x4c492e);}return null;};}function patchUpdates(_0x1748f5){return function(_0x15965d){try{jsonpatch['apply'](_0x15965d,_0x1748f5,!![]);}catch(_0x578aaa){return BPromise[_0xfed1('0x23')](_0x578aaa);}return _0x15965d['save']();};}function saveUpdates(_0x36a818,_0x4388f3){return function(_0x4cd3b8){if(_0x4cd3b8){return _0x4cd3b8[_0xfed1('0x24')](_0x36a818)[_0xfed1('0x25')](function(_0x472dbc){return _0x472dbc;});}return null;};}function removeEntity(_0x5bce5d,_0x1e8c3e){return function(_0xea7a81){if(_0xea7a81){return _0xea7a81['destroy']()[_0xfed1('0x25')](function(){var _0x40da7f=_0xea7a81[_0xfed1('0x26')]({'plain':!![]});var _0x5705b9=[{'name':_0xfed1('0x27'),'value':_0xfed1('0x28'),'ignore':![]},{'name':_0xfed1('0x29'),'value':'outbound','ignore':![]}];var _0x3cd60e=_(_0x5705b9)[_0xfed1('0x2a')](_0xfed1('0x2b'))[_0xfed1('0x2c')](_0xfed1('0x2d'))[_0xfed1('0x2d')]();if(_['includes'](_0x3cd60e,_0x40da7f[_0xfed1('0x2e')])){return;}var _0x43273c=_['find'](_0x5705b9,[_0xfed1('0x2d'),_0x40da7f[_0xfed1('0x2e')]])[_0xfed1('0x2f')];return db['UserProfileResource'][_0xfed1('0x30')]({'where':{'type':_0x43273c,'resourceId':_0x40da7f['id']}})[_0xfed1('0x25')](function(){return _0xea7a81;});})[_0xfed1('0x25')](function(){_0x5bce5d[_0xfed1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a57b,_0x3bf815){return function(_0x3a1f65){if(!_0x3a1f65){_0x28a57b[_0xfed1('0x19')](0x194);}return _0x3a1f65;};}function handleError(_0x2853ee,_0x51fb58){_0x51fb58=_0x51fb58||0x1f4;return function(_0xbabd6d){logger[_0xfed1('0x31')](_0xbabd6d[_0xfed1('0x32')]);if(_0xbabd6d[_0xfed1('0x2f')]){delete _0xbabd6d[_0xfed1('0x2f')];}_0x2853ee[_0xfed1('0x1a')](_0x51fb58)[_0xfed1('0x33')](_0xbabd6d);};}exports[_0xfed1('0x34')]=function(_0x4c2cde,_0x5a5b24){var _0x4e1e8d={},_0x22d942={},_0x20eff4={'count':0x0,'rows':[]};var _0x4ded3a=_[_0xfed1('0x2c')](db['VoiceQueue']['rawAttributes'],function(_0x5f000b){return{'name':_0x5f000b[_0xfed1('0x35')],'type':_0x5f000b[_0xfed1('0x2e')][_0xfed1('0x36')]};});_0x22d942['model']=_['map'](_0x4ded3a,_0xfed1('0x2f'));_0x22d942[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x4c2cde[_0xfed1('0x37')]);_0x22d942[_0xfed1('0x39')]=_[_0xfed1('0x3a')](_0x22d942[_0xfed1('0x3b')],_0x22d942['query']);_0x4e1e8d[_0xfed1('0x3c')]=_['intersection'](_0x22d942[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x4c2cde['query'][_0xfed1('0x3d')]));_0x4e1e8d[_0xfed1('0x3c')]=_0x4e1e8d['attributes'][_0xfed1('0x3e')]?_0x4e1e8d[_0xfed1('0x3c')]:_0x22d942['model'];if(!_0x4c2cde['query'][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x4e1e8d[_0xfed1('0x1f')]=qs[_0xfed1('0x1f')](_0x4c2cde['query'][_0xfed1('0x1f')]);_0x4e1e8d['offset']=qs[_0xfed1('0x1d')](_0x4c2cde['query'][_0xfed1('0x1d')]);}_0x4e1e8d[_0xfed1('0x41')]=qs[_0xfed1('0x42')](_0x4c2cde[_0xfed1('0x37')][_0xfed1('0x42')]);_0x4e1e8d['where']=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x4c2cde[_0xfed1('0x37')],_0x22d942[_0xfed1('0x39')]),_0x4ded3a);if(_0x4c2cde[_0xfed1('0x37')]['filter']){_0x4e1e8d[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x4e1e8d[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x4ded3a,function(_0x40f7b3){if(_0x40f7b3[_0xfed1('0x2e')]!==_0xfed1('0x46')){var _0x4bbab3={};_0x4bbab3[_0x40f7b3[_0xfed1('0x2f')]]={'$like':'%'+_0x4c2cde['query'][_0xfed1('0x2a')]+'%'};return _0x4bbab3;}})});}_0x4e1e8d=_[_0xfed1('0x45')]({},_0x4e1e8d,_0x4c2cde[_0xfed1('0x47')]);var _0x3ca279={'where':_0x4e1e8d[_0xfed1('0x44')]};return db[_0xfed1('0x48')][_0xfed1('0x20')](_0x3ca279)['then'](function(_0x3a151c){_0x20eff4[_0xfed1('0x20')]=_0x3a151c;if(_0x4c2cde['query'][_0xfed1('0x49')]){_0x4e1e8d[_0xfed1('0x4a')]=[{'all':!![]}];}return db[_0xfed1('0x48')][_0xfed1('0x4b')](_0x4e1e8d);})['then'](function(_0x3c961b){_0x20eff4[_0xfed1('0x4c')]=_0x3c961b;return _0x20eff4;})[_0xfed1('0x25')](respondWithFilteredResult(_0x5a5b24,_0x4e1e8d))['catch'](handleError(_0x5a5b24,null));};exports['show']=function(_0x50b00c,_0x5799e5){var _0x1b22b3={'raw':![],'where':{'id':_0x50b00c[_0xfed1('0x4d')]['id']}},_0x1ac7a8={};_0x1ac7a8[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db['VoiceQueue']['rawAttributes']);_0x1ac7a8[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x50b00c[_0xfed1('0x37')]);_0x1ac7a8['filters']=_['intersection'](_0x1ac7a8[_0xfed1('0x3b')],_0x1ac7a8[_0xfed1('0x37')]);_0x1b22b3[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x1ac7a8[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x50b00c['query'][_0xfed1('0x3d')]));_0x1b22b3['attributes']=_0x1b22b3[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x1b22b3['attributes']:_0x1ac7a8['model'];if(_0x50b00c[_0xfed1('0x37')][_0xfed1('0x49')]){_0x1b22b3[_0xfed1('0x4a')]=[{'all':!![]}];}_0x1b22b3=_[_0xfed1('0x45')]({},_0x1b22b3,_0x50b00c['options']);return db[_0xfed1('0x48')][_0xfed1('0x4e')](_0x1b22b3)['then'](handleEntityNotFound(_0x5799e5,null))[_0xfed1('0x25')](respondWithResult(_0x5799e5,null))[_0xfed1('0x4f')](handleError(_0x5799e5,null));};exports['create']=function(_0x4d7657,_0x4578a7){return db[_0xfed1('0x48')][_0xfed1('0x50')](_0x4d7657[_0xfed1('0x51')],{})[_0xfed1('0x25')](function(_0x22312e){var _0xfa30eb=_0x4d7657['user'][_0xfed1('0x26')]({'plain':!![]});if(!_0xfa30eb)throw new Error(_0xfed1('0x52'));if(_0xfa30eb['role']===_0xfed1('0x53')){var _0x566593=_0x22312e[_0xfed1('0x26')]({'plain':!![]});var _0x144938=[{'name':'VoiceQueues','value':_0xfed1('0x28')},{'name':_0xfed1('0x29'),'value':_0xfed1('0x54')}];var _0x1e866b=_[_0xfed1('0x4e')](_0x144938,[_0xfed1('0x2d'),_0x566593[_0xfed1('0x2e')]])[_0xfed1('0x2f')];return db['UserProfileSection']['find']({'where':{'name':_0x1e866b,'userProfileId':_0xfa30eb[_0xfed1('0x55')]},'raw':!![]})[_0xfed1('0x25')](function(_0x58b7b9){if(_0x58b7b9&&_0x58b7b9[_0xfed1('0x56')]===0x0){return db[_0xfed1('0x57')][_0xfed1('0x50')]({'name':_0x566593['name'],'resourceId':_0x566593['id'],'type':_0x58b7b9[_0xfed1('0x2f')],'sectionId':_0x58b7b9['id']},{})[_0xfed1('0x25')](function(){return _0x22312e;});}else{return _0x22312e;}})[_0xfed1('0x4f')](function(_0x4c80b3){logger[_0xfed1('0x31')](_0xfed1('0x58'),_0x4c80b3);throw _0x4c80b3;});}return _0x22312e;})['then'](respondWithResult(_0x4578a7,0xc9))[_0xfed1('0x4f')](handleError(_0x4578a7,null));};exports[_0xfed1('0x59')]=function(_0x3d95bd,_0x455234){var _0x394fb7={'where':{'id':_0x3d95bd['params']['id']}},_0x5dae38={};_0x5dae38[_0xfed1('0x3b')]=_['keys'](db[_0xfed1('0x48')][_0xfed1('0x5a')]);_0x394fb7['attributes']=_['intersection'](_0x5dae38[_0xfed1('0x3b')],qs['fields'](_0x3d95bd['query'][_0xfed1('0x3d')]));_0x394fb7['attributes']=_0x394fb7[_0xfed1('0x3c')]['length']?_0x394fb7[_0xfed1('0x3c')]:_0x5dae38[_0xfed1('0x3b')];if(_0x3d95bd[_0xfed1('0x37')][_0xfed1('0x49')]){_0x394fb7['include']=[{'all':!![]}];}_0x394fb7=_[_0xfed1('0x45')]({},_0x394fb7,_0x3d95bd[_0xfed1('0x47')]);return db[_0xfed1('0x48')]['find'](_0x394fb7)[_0xfed1('0x25')](handleEntityNotFound(_0x455234,null))[_0xfed1('0x25')](function(_0x57f0b0){if(_0x57f0b0){var _0x1739c7=_0x57f0b0[_0xfed1('0x26')]({'plain':!![]});_0x1739c7=qs[_0xfed1('0x5b')](_0x1739c7,['id',_0xfed1('0x5c'),_0xfed1('0x5d')]);_0x3d95bd[_0xfed1('0x51')]=_[_0xfed1('0x5b')](_0x3d95bd[_0xfed1('0x51')],['id',_0xfed1('0x5c'),_0xfed1('0x5d')]);return db[_0xfed1('0x48')]['create'](_[_0xfed1('0x45')](_0x1739c7,_0x3d95bd['body']),{'include':_0x3d95bd[_0xfed1('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0xfed1('0x25')](function(_0x44e782){var _0xeb4848=_0x3d95bd['user']['get']({'plain':!![]});if(!_0xeb4848)throw new Error(_0xfed1('0x52'));if(_0xeb4848[_0xfed1('0x5e')]===_0xfed1('0x53')){var _0x3ef5dd=_0x44e782[_0xfed1('0x26')]({'plain':!![]});var _0x5cd160=[{'name':_0xfed1('0x27'),'value':_0xfed1('0x28')},{'name':'QueueCampaigns','value':'outbound'}];var _0x3387fc=_[_0xfed1('0x4e')](_0x5cd160,[_0xfed1('0x2d'),_0x3ef5dd[_0xfed1('0x2e')]])[_0xfed1('0x2f')];return db[_0xfed1('0x5f')][_0xfed1('0x4e')]({'where':{'name':_0x3387fc,'userProfileId':_0xeb4848[_0xfed1('0x55')]},'raw':!![]})[_0xfed1('0x25')](function(_0x5b0b96){if(_0x5b0b96&&_0x5b0b96[_0xfed1('0x56')]===0x0){return db[_0xfed1('0x57')]['create']({'name':_0x3ef5dd['name'],'resourceId':_0x3ef5dd['id'],'type':_0x5b0b96[_0xfed1('0x2f')],'sectionId':_0x5b0b96['id']},{})['then'](function(){return _0x44e782;});}else{return _0x44e782;}})[_0xfed1('0x4f')](function(_0x65e384){logger[_0xfed1('0x31')](_0xfed1('0x58'),_0x65e384);throw _0x65e384;});}return _0x44e782;});}})[_0xfed1('0x25')](respondWithResult(_0x455234,0xc9))[_0xfed1('0x4f')](handleError(_0x455234,null));};exports['update']=function(_0x502107,_0x5798eb){if(_0x502107[_0xfed1('0x51')]['id']){delete _0x502107[_0xfed1('0x51')]['id'];}return db[_0xfed1('0x48')]['find']({'where':{'id':_0x502107['params']['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x5798eb,null))[_0xfed1('0x25')](saveUpdates(_0x502107[_0xfed1('0x51')],null))['then'](respondWithResult(_0x5798eb,null))[_0xfed1('0x4f')](handleError(_0x5798eb,null));};exports[_0xfed1('0x30')]=function(_0x105ba2,_0x4c4b54){return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x105ba2[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x4c4b54,null))[_0xfed1('0x25')](removeEntity(_0x4c4b54,null))[_0xfed1('0x4f')](handleError(_0x4c4b54,null));};exports[_0xfed1('0x60')]=function(_0x3ec19d,_0x413015,_0x2062d3){var _0x531eaa={'raw':![],'where':{}};var _0x21aaa9={};var _0x280ae2={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x3ec19d[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x413015,null))[_0xfed1('0x25')](function(_0x545763){if(_0x545763){_0x21aaa9[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db['CmHopper'][_0xfed1('0x5a')]);_0x21aaa9[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x3ec19d[_0xfed1('0x37')]);_0x21aaa9[_0xfed1('0x39')]=_[_0xfed1('0x3a')](_0x21aaa9[_0xfed1('0x3b')],_0x21aaa9[_0xfed1('0x37')]);_0x531eaa[_0xfed1('0x3c')]=_['intersection'](_0x21aaa9[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x3ec19d[_0xfed1('0x37')][_0xfed1('0x3d')]));_0x531eaa['attributes']=_0x531eaa[_0xfed1('0x3c')]['length']?_0x531eaa[_0xfed1('0x3c')]:_0x21aaa9[_0xfed1('0x3b')];if(!_0x3ec19d[_0xfed1('0x37')]['hasOwnProperty'](_0xfed1('0x40'))){_0x531eaa['limit']=qs['limit'](_0x3ec19d[_0xfed1('0x37')]['limit']);_0x531eaa[_0xfed1('0x1d')]=qs['offset'](_0x3ec19d['query'][_0xfed1('0x1d')]);}_0x531eaa['order']=qs['sort'](_0x3ec19d[_0xfed1('0x37')][_0xfed1('0x42')]);_0x531eaa['where']=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x3ec19d[_0xfed1('0x37')],_0x21aaa9[_0xfed1('0x39')]));_0x531eaa[_0xfed1('0x44')]['VoiceQueueId']=_0x545763['id'];if(_0x3ec19d[_0xfed1('0x37')][_0xfed1('0x2a')]){_0x531eaa[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x531eaa['where'],{'$or':_[_0xfed1('0x2c')](_0x531eaa['attributes'],function(_0x37bc3b){var _0x13e0b4={};_0x13e0b4[_0x37bc3b]={'$like':'%'+_0x3ec19d[_0xfed1('0x37')]['filter']+'%'};return _0x13e0b4;})});}_0x531eaa=_[_0xfed1('0x45')]({},_0x531eaa,_0x3ec19d[_0xfed1('0x47')]);return db[_0xfed1('0x61')]['count']({'where':_0x531eaa[_0xfed1('0x44')]})['then'](function(_0xa7eb52){_0x280ae2['count']=_0xa7eb52;if(_0x3ec19d[_0xfed1('0x37')][_0xfed1('0x49')]){_0x531eaa['include']=[{'all':!![]}];}return db[_0xfed1('0x61')][_0xfed1('0x4b')](_0x531eaa);})[_0xfed1('0x25')](function(_0x58ce1d){_0x280ae2[_0xfed1('0x4c')]=_0x58ce1d;return _0x280ae2;});}})['then'](respondWithFilteredResult(_0x413015,_0x531eaa))[_0xfed1('0x4f')](handleError(_0x413015,null));};exports['getHopperHistories']=function(_0x38fbef,_0x250e26,_0x289dd9){var _0x4368a6={'raw':!![],'where':{}};var _0x150700={};var _0x49533c={'count':0x0,'rows':[]};return db[_0xfed1('0x48')][_0xfed1('0x62')]({'where':{'id':_0x38fbef[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x250e26,null))[_0xfed1('0x25')](function(_0x45e8ef){if(_0x45e8ef){_0x150700[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db['CmHopperHistory'][_0xfed1('0x5a')]);_0x150700[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x38fbef[_0xfed1('0x37')]);_0x150700[_0xfed1('0x39')]=_[_0xfed1('0x3a')](_0x150700['model'],_0x150700['query']);_0x4368a6[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x150700['model'],qs[_0xfed1('0x3d')](_0x38fbef[_0xfed1('0x37')]['fields']));_0x4368a6[_0xfed1('0x3c')]=_0x4368a6[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x4368a6[_0xfed1('0x3c')]:_0x150700[_0xfed1('0x3b')];if(!_0x38fbef['query'][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x4368a6[_0xfed1('0x1f')]=qs[_0xfed1('0x1f')](_0x38fbef[_0xfed1('0x37')]['limit']);_0x4368a6['offset']=qs['offset'](_0x38fbef[_0xfed1('0x37')]['offset']);}_0x4368a6['order']=qs[_0xfed1('0x42')](_0x38fbef[_0xfed1('0x37')][_0xfed1('0x42')]);_0x4368a6[_0xfed1('0x44')]=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x38fbef['query'],_0x150700[_0xfed1('0x39')]));_0x4368a6[_0xfed1('0x44')][_0xfed1('0x63')]=_0x45e8ef['id'];if(_0x38fbef[_0xfed1('0x37')]['filter']){_0x4368a6[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x4368a6[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x4368a6[_0xfed1('0x3c')],function(_0xd9642b){var _0x4232a6={};_0x4232a6[_0xd9642b]={'$like':'%'+_0x38fbef['query'][_0xfed1('0x2a')]+'%'};return _0x4232a6;})});}_0x4368a6=_[_0xfed1('0x45')]({},_0x4368a6,_0x38fbef[_0xfed1('0x47')]);return db['CmHopperHistory'][_0xfed1('0x20')]({'where':_0x4368a6[_0xfed1('0x44')]})[_0xfed1('0x25')](function(_0x2d78c0){_0x49533c[_0xfed1('0x20')]=_0x2d78c0;if(_0x38fbef[_0xfed1('0x37')][_0xfed1('0x49')]){_0x4368a6[_0xfed1('0x4a')]=[{'all':!![]}];}return db[_0xfed1('0x64')]['findAll'](_0x4368a6);})[_0xfed1('0x25')](function(_0x288e90){_0x49533c[_0xfed1('0x4c')]=_0x288e90;return _0x49533c;});}})[_0xfed1('0x25')](respondWithFilteredResult(_0x250e26,_0x4368a6))[_0xfed1('0x4f')](handleError(_0x250e26,null));};exports[_0xfed1('0x65')]=function(_0x32fef4,_0x1a5536,_0x49d4d2){var _0x1e2145={'raw':!![],'where':{}};var _0x56c3ce={};var _0x331192={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfed1('0x62')]({'where':{'id':_0x32fef4[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x1a5536,null))[_0xfed1('0x25')](function(_0x595f2f){if(_0x595f2f){_0x56c3ce[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db[_0xfed1('0x66')][_0xfed1('0x5a')]);_0x56c3ce[_0xfed1('0x37')]=_['keys'](_0x32fef4[_0xfed1('0x37')]);_0x56c3ce[_0xfed1('0x39')]=_['intersection'](_0x56c3ce[_0xfed1('0x3b')],_0x56c3ce[_0xfed1('0x37')]);_0x1e2145[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x56c3ce['model'],qs[_0xfed1('0x3d')](_0x32fef4[_0xfed1('0x37')]['fields']));_0x1e2145[_0xfed1('0x3c')]=_0x1e2145[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x1e2145[_0xfed1('0x3c')]:_0x56c3ce['model'];if(!_0x32fef4['query'][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x1e2145['limit']=qs[_0xfed1('0x1f')](_0x32fef4[_0xfed1('0x37')][_0xfed1('0x1f')]);_0x1e2145[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x32fef4[_0xfed1('0x37')][_0xfed1('0x1d')]);}_0x1e2145['order']=qs[_0xfed1('0x42')](_0x32fef4[_0xfed1('0x37')][_0xfed1('0x42')]);_0x1e2145[_0xfed1('0x44')]=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x32fef4[_0xfed1('0x37')],_0x56c3ce['filters']));_0x1e2145[_0xfed1('0x44')]['VoiceQueueId']=_0x595f2f['id'];if(_0x32fef4[_0xfed1('0x37')]['filter']){_0x1e2145[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x1e2145[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x1e2145[_0xfed1('0x3c')],function(_0x536503){var _0x1167a2={};_0x1167a2[_0x536503]={'$like':'%'+_0x32fef4[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x1167a2;})});}_0x1e2145=_[_0xfed1('0x45')]({},_0x1e2145,_0x32fef4[_0xfed1('0x47')]);return db['CmHopperFinal'][_0xfed1('0x20')]({'where':_0x1e2145[_0xfed1('0x44')]})[_0xfed1('0x25')](function(_0x5634a3){_0x331192[_0xfed1('0x20')]=_0x5634a3;if(_0x32fef4[_0xfed1('0x37')]['includeAll']){_0x1e2145['include']=[{'all':!![]}];}return db[_0xfed1('0x66')][_0xfed1('0x4b')](_0x1e2145);})[_0xfed1('0x25')](function(_0x4a79ff){_0x331192['rows']=_0x4a79ff;return _0x331192;});}})[_0xfed1('0x25')](respondWithFilteredResult(_0x1a5536,_0x1e2145))[_0xfed1('0x4f')](handleError(_0x1a5536,null));};exports['getHopperBlacks']=function(_0x2af81a,_0x4ad0f5,_0x41dfdc){var _0x2d169d={'raw':!![],'where':{}};var _0x826736={};var _0x1fb8f9={'count':0x0,'rows':[]};return db[_0xfed1('0x48')][_0xfed1('0x62')]({'where':{'id':_0x2af81a[_0xfed1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4ad0f5,null))['then'](function(_0x57bd44){if(_0x57bd44){_0x826736[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db[_0xfed1('0x67')][_0xfed1('0x5a')]);_0x826736[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x2af81a[_0xfed1('0x37')]);_0x826736['filters']=_[_0xfed1('0x3a')](_0x826736[_0xfed1('0x3b')],_0x826736[_0xfed1('0x37')]);_0x2d169d[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x826736[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x2af81a[_0xfed1('0x37')][_0xfed1('0x3d')]));_0x2d169d[_0xfed1('0x3c')]=_0x2d169d[_0xfed1('0x3c')]['length']?_0x2d169d['attributes']:_0x826736[_0xfed1('0x3b')];if(!_0x2af81a[_0xfed1('0x37')]['hasOwnProperty'](_0xfed1('0x40'))){_0x2d169d[_0xfed1('0x1f')]=qs[_0xfed1('0x1f')](_0x2af81a['query'][_0xfed1('0x1f')]);_0x2d169d[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x2af81a[_0xfed1('0x37')][_0xfed1('0x1d')]);}_0x2d169d[_0xfed1('0x41')]=qs[_0xfed1('0x42')](_0x2af81a[_0xfed1('0x37')]['sort']);_0x2d169d['where']=qs['filters'](_[_0xfed1('0x43')](_0x2af81a['query'],_0x826736[_0xfed1('0x39')]));_0x2d169d['where'][_0xfed1('0x63')]=_0x57bd44['id'];if(_0x2af81a['query']['filter']){_0x2d169d['where']=_['merge'](_0x2d169d[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x2d169d['attributes'],function(_0x305a19){var _0x138e27={};_0x138e27[_0x305a19]={'$like':'%'+_0x2af81a[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x138e27;})});}_0x2d169d=_[_0xfed1('0x45')]({},_0x2d169d,_0x2af81a[_0xfed1('0x47')]);return db[_0xfed1('0x67')][_0xfed1('0x20')]({'where':_0x2d169d['where']})[_0xfed1('0x25')](function(_0x1b56e0){_0x1fb8f9['count']=_0x1b56e0;if(_0x2af81a[_0xfed1('0x37')][_0xfed1('0x49')]){_0x2d169d[_0xfed1('0x4a')]=[{'all':!![]}];}return db[_0xfed1('0x67')]['findAll'](_0x2d169d);})[_0xfed1('0x25')](function(_0x50202a){_0x1fb8f9['rows']=_0x50202a;return _0x1fb8f9;});}})[_0xfed1('0x25')](respondWithFilteredResult(_0x4ad0f5,_0x2d169d))[_0xfed1('0x4f')](handleError(_0x4ad0f5,null));};exports['getTeams']=function(_0x292b5b,_0x117529,_0x5d06cd){var _0x2c45a8={};var _0x30ed26={};var _0x51cee9;var _0x1bcb72;return db[_0xfed1('0x48')][_0xfed1('0x62')]({'where':{'id':_0x292b5b[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x117529,null))[_0xfed1('0x25')](function(_0x42f870){if(_0x42f870){_0x51cee9=_0x42f870;_0x30ed26[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db['Team'][_0xfed1('0x5a')]);_0x30ed26[_0xfed1('0x37')]=_['keys'](_0x292b5b[_0xfed1('0x37')]);_0x30ed26['filters']=_[_0xfed1('0x3a')](_0x30ed26[_0xfed1('0x3b')],_0x30ed26[_0xfed1('0x37')]);_0x2c45a8['attributes']=_[_0xfed1('0x3a')](_0x30ed26[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x292b5b[_0xfed1('0x37')]['fields']));_0x2c45a8[_0xfed1('0x3c')]=_0x2c45a8[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x2c45a8['attributes']:_0x30ed26[_0xfed1('0x3b')];_0x2c45a8['order']=qs['sort'](_0x292b5b[_0xfed1('0x37')][_0xfed1('0x42')]);_0x2c45a8[_0xfed1('0x44')]=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x292b5b[_0xfed1('0x37')],_0x30ed26[_0xfed1('0x39')]));if(_0x292b5b[_0xfed1('0x37')][_0xfed1('0x2a')]){_0x2c45a8[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x2c45a8['where'],{'$or':_['map'](_0x2c45a8['attributes'],function(_0x51a78c){var _0x43decf={};_0x43decf[_0x51a78c]={'$like':'%'+_0x292b5b[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x43decf;})});}_0x2c45a8=_[_0xfed1('0x45')]({},_0x2c45a8,_0x292b5b['options']);return _0x51cee9[_0xfed1('0x68')](_0x2c45a8);}})[_0xfed1('0x25')](function(_0x22f108){if(_0x22f108){_0x1bcb72=_0x22f108[_0xfed1('0x3e')];if(!_0x292b5b[_0xfed1('0x37')][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x2c45a8['limit']=qs[_0xfed1('0x1f')](_0x292b5b[_0xfed1('0x37')][_0xfed1('0x1f')]);_0x2c45a8[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x292b5b[_0xfed1('0x37')]['offset']);}return _0x51cee9[_0xfed1('0x68')](_0x2c45a8);}})['then'](function(_0x4413f4){if(_0x4413f4){return _0x4413f4?{'count':_0x1bcb72,'rows':_0x4413f4}:null;}})[_0xfed1('0x25')](respondWithResult(_0x117529,null))['catch'](handleError(_0x117529,null));};exports['addTeams']=function(_0x6d1fa,_0x94ca38,_0x313b03){var _0x190825=_0x6d1fa['body']['teams'];var _0x11ce3f=_[_0xfed1('0x2c')](_0x190825,'id');return db[_0xfed1('0x69')][_0xfed1('0x4b')]({'where':{'id':_0x11ce3f},'attributes':['id'],'include':[{'model':db[_0xfed1('0x6a')],'as':_0xfed1('0x6b'),'attributes':['id',_0xfed1('0x2f'),'online',_0xfed1('0x6c'),_0xfed1('0x6d')],'raw':!![]}]})['then'](function(_0x10a7eb){if(_0x10a7eb){var _0x2d508d=_[_0xfed1('0x6e')](_0x10a7eb,function(_0x5b05f0){var _0x297889=_0x5b05f0[_0xfed1('0x26')]({'plain':!![]});_0x297889[_0xfed1('0x6b')][_0xfed1('0x6f')](function(_0x440b02){_0x440b02['penalty']=_[_0xfed1('0x4e')](_0x190825,{'id':_0x297889['id']})[_0xfed1('0x70')];});return _0x297889[_0xfed1('0x6b')];});return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x6d1fa[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](function(_0x4bd489){return db['sequelize']['transaction'](function(_0x4238d6){return _0x4bd489[_0xfed1('0x71')](_0x11ce3f,{'transaction':_0x4238d6})['then'](function(){return BPromise[_0xfed1('0x72')](_0x190825,function(_0x8e6f38){return db[_0xfed1('0x73')][_0xfed1('0x74')]({'TeamId':_0x8e6f38['id'],'VoiceQueueId':_0x6d1fa['params']['id'],'penalty':_0x8e6f38['penalty']},{'transaction':_0x4238d6});});})[_0xfed1('0x25')](function(){return BPromise['each'](_0x2d508d,function(_0x3fced4){return db[_0xfed1('0x75')][_0xfed1('0x76')]({'where':{'UserId':_0x3fced4['id'],'VoiceQueueId':_0x6d1fa[_0xfed1('0x4d')]['id']},'defaults':{'penalty':_0x3fced4[_0xfed1('0x70')]},'transaction':_0x4238d6});});})[_0xfed1('0x25')](function(){return BPromise[_0xfed1('0x72')](_[_0xfed1('0x2a')](_0x2d508d,{'online':!![]}),function(_0xbb5885){return db[_0xfed1('0x77')][_0xfed1('0x74')]({'membername':_0xbb5885[_0xfed1('0x2f')],'UserId':_0xbb5885['id'],'queue_name':_0x4bd489[_0xfed1('0x2f')],'VoiceQueueId':_0x4bd489['id'],'interface':_[_0xfed1('0x78')](_0xbb5885['interface'])?util['format']('SIP/%s',_0xbb5885['name']):_0xbb5885['interface'],'paused':_0xbb5885[_0xfed1('0x6c')]||![],'penalty':_0xbb5885[_0xfed1('0x70')]},{'transaction':_0x4238d6});});})[_0xfed1('0x25')](function(){_0x2d508d[_0xfed1('0x6f')](function(_0x597e12){socket[_0xfed1('0x79')](_0xfed1('0x7a'),{'UserId':_0x597e12['id'],'VoiceQueueId':_0x4bd489['id']});});});});});}})[_0xfed1('0x25')](respondWithStatusCode(_0x94ca38,null))[_0xfed1('0x4f')](handleError(_0x94ca38,null));};exports['removeTeams']=function(_0x50c62d,_0x56c47e,_0x3ffd6c){return db[_0xfed1('0x69')]['findAll']({'where':{'id':_0x50c62d[_0xfed1('0x37')][_0xfed1('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xfed1('0x6a')],'as':_0xfed1('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x56c47e,null))['then'](function(_0x27a71f){var _0x169e28=_[_0xfed1('0x2c')](_0x27a71f,'id');var _0x113e4c=[];var _0x41bcd0=[];var _0x4cffa7=squel[_0xfed1('0x7c')]();_0x4cffa7['field'](_0xfed1('0x7d'))[_0xfed1('0x7e')](_0xfed1('0x7f'),'tq')[_0xfed1('0x80')](_0xfed1('0x81'),'ut',_0xfed1('0x82'))['where']('VoiceQueueId\x20=\x20?',_0x50c62d[_0xfed1('0x4d')]['id']);for(var _0x50fbe0=0x0;_0x50fbe0<_0x27a71f['length'];_0x50fbe0+=0x1){let _0x4a648c=_0x27a71f[_0x50fbe0];for(var _0x15726d=0x0;_0x15726d<_0x4a648c['Agents'][_0xfed1('0x3e')];_0x15726d+=0x1){let _0x10e4b5=_0x4a648c[_0xfed1('0x6b')][_0x15726d];var _0x22aad7=_0x4cffa7[_0xfed1('0x59')]();_0x22aad7[_0xfed1('0x44')]('ut.UserId\x20=\x20?',_0x10e4b5['id']);_0x41bcd0[_0xfed1('0x83')](db[_0xfed1('0x84')][_0xfed1('0x37')](_0x22aad7[_0xfed1('0x85')](),{'type':db[_0xfed1('0x84')][_0xfed1('0x86')]['SELECT']})[_0xfed1('0x25')](function(_0x3427fb){if(_0x3427fb['length']===0x1){return _0x10e4b5['id'];}else{var _0x1a94aa=_[_0xfed1('0x87')](_['map'](_0x3427fb,'TeamId'),function(_0x2a67a9){return _[_0xfed1('0x88')](_0x169e28,_0x2a67a9);});if(_0x1a94aa){return _0x10e4b5['id'];}}}));}}return BPromise[_0xfed1('0x89')](_0x41bcd0)['then'](function(_0x17edf3){_0x113e4c=_(_0x113e4c)['union'](_0x17edf3)[_0xfed1('0x8a')]()[_0xfed1('0x2d')]();return db['VoiceQueue'][_0xfed1('0x4e')]({'where':{'id':_0x50c62d[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](function(_0x111c86){return db[_0xfed1('0x84')][_0xfed1('0x8b')](function(_0x22076d){return _0x111c86[_0xfed1('0x8c')](_0x50c62d[_0xfed1('0x37')][_0xfed1('0x7b')],{'transaction':_0x22076d})[_0xfed1('0x25')](function(){if(!_[_0xfed1('0x8d')](_0x113e4c)){return _0x111c86[_0xfed1('0x8e')](_0x113e4c,{'transaction':_0x22076d})[_0xfed1('0x25')](function(){return db['UserVoiceQueueRt'][_0xfed1('0x30')]({'where':{'VoiceQueueId':_0x50c62d[_0xfed1('0x4d')]['id'],'UserId':_0x113e4c},'transaction':_0x22076d});});}})[_0xfed1('0x25')](function(){_0x113e4c[_0xfed1('0x6f')](function(_0x5f233d){socket[_0xfed1('0x79')](_0xfed1('0x8f'),{'UserId':_0x5f233d,'VoiceQueueId':_0x111c86['id']});});});});});});})[_0xfed1('0x25')](respondWithStatusCode(_0x56c47e,null))['catch'](handleError(_0x56c47e,null));};exports['addAgents']=function(_0x49bf25,_0xfea5e6,_0x11e5e4){var _0x51193d,_0x2d3676;return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x49bf25['params']['id']}})['then'](handleEntityNotFound(_0xfea5e6,null))[_0xfed1('0x25')](function(_0x3a64ee){if(_0x3a64ee){_0x2d3676=_0x3a64ee;return _0x3a64ee[_0xfed1('0x90')](_0x49bf25['body'][_0xfed1('0x7b')],_[_0xfed1('0x5b')](_0x49bf25[_0xfed1('0x51')],[_0xfed1('0x7b'),'id'])||{})['spread'](function(_0x37c4ac){for(var _0x27053f=0x0;_0x27053f<_0x49bf25[_0xfed1('0x51')][_0xfed1('0x7b')]['length'];_0x27053f+=0x1){socket[_0xfed1('0x79')](_0xfed1('0x7a'),{'UserId':Number(_0x49bf25['body'][_0xfed1('0x7b')][_0x27053f]),'VoiceQueueId':Number(_0x49bf25['params']['id'])});}return _0x37c4ac;});}})[_0xfed1('0x25')](function(_0x2ba009){_0x51193d=_0x2ba009||[];if(_0x2d3676){return db[_0xfed1('0x6a')]['findAll']({'where':{'id':_0x49bf25[_0xfed1('0x51')]['ids']},'attributes':['id','name','online','voicePause','interface'],'raw':!![]});}})[_0xfed1('0x25')](function(_0x562953){if(!_[_0xfed1('0x8d')](_0x562953)){var _0x7534a7=[];for(var _0x13583e=0x0;_0x13583e<_0x562953['length'];_0x13583e++){if(_0x562953[_0x13583e][_0xfed1('0x91')]){_0x7534a7['push'](db[_0xfed1('0x77')][_0xfed1('0x74')]({'membername':_0x562953[_0x13583e]['name'],'UserId':_0x562953[_0x13583e]['id'],'queue_name':_0x2d3676[_0xfed1('0x2f')],'VoiceQueueId':_0x2d3676['id'],'interface':_[_0xfed1('0x78')](_0x562953[_0x13583e][_0xfed1('0x6d')])?util[_0xfed1('0x92')](_0xfed1('0x93'),_0x562953[_0x13583e][_0xfed1('0x2f')]):_0x562953[_0x13583e][_0xfed1('0x6d')],'paused':_0x562953[_0x13583e]['voicePause']||![],'penalty':_0x49bf25[_0xfed1('0x51')]['penalty']||0x0}));}}return BPromise['all'](_0x7534a7);}})[_0xfed1('0x25')](function(){return _0x51193d;})['then'](respondWithResult(_0xfea5e6,null))[_0xfed1('0x4f')](handleError(_0xfea5e6,null));};exports['removeAgents']=function(_0x45b4fe,_0x3e12e5,_0x168c59){return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x45b4fe[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x3e12e5,null))[_0xfed1('0x25')](function(_0x1e8339){if(_0x1e8339){return _0x1e8339['removeAgents'](_0x45b4fe[_0xfed1('0x37')][_0xfed1('0x7b')])[_0xfed1('0x25')](function(){if(_['isArray'](_0x45b4fe[_0xfed1('0x37')][_0xfed1('0x7b')])){for(var _0x5cd8ee=0x0;_0x5cd8ee<_0x45b4fe[_0xfed1('0x37')][_0xfed1('0x7b')][_0xfed1('0x3e')];_0x5cd8ee+=0x1){socket[_0xfed1('0x79')](_0xfed1('0x8f'),{'UserId':Number(_0x45b4fe['query'][_0xfed1('0x7b')][_0x5cd8ee]),'VoiceQueueId':Number(_0x45b4fe[_0xfed1('0x4d')]['id'])});}}else{socket[_0xfed1('0x79')](_0xfed1('0x8f'),{'UserId':Number(_0x45b4fe[_0xfed1('0x37')][_0xfed1('0x7b')]),'VoiceQueueId':Number(_0x45b4fe['params']['id'])});}});}})[_0xfed1('0x25')](function(_0x494b21){return db[_0xfed1('0x77')][_0xfed1('0x30')]({'where':{'VoiceQueueId':_0x45b4fe['params']['id'],'UserId':_0x45b4fe['query'][_0xfed1('0x7b')]}})['then'](function(){return _0x494b21;});})['then'](respondWithStatusCode(_0x3e12e5,null))[_0xfed1('0x4f')](handleError(_0x3e12e5,null));};exports[_0xfed1('0x94')]=function(_0x49b054,_0xb2bb63,_0x220183){var _0x38465c={};var _0x43f9f9={};var _0x58221d;var _0x23255c;return db[_0xfed1('0x48')][_0xfed1('0x62')]({'where':{'id':_0x49b054['params']['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0xb2bb63,null))['then'](function(_0x495d72){if(_0x495d72){_0x58221d=_0x495d72;_0x43f9f9[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db['User'][_0xfed1('0x5a')]);_0x43f9f9[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x49b054[_0xfed1('0x37')]);_0x43f9f9['filters']=_['intersection'](_0x43f9f9['model'],_0x43f9f9[_0xfed1('0x37')]);_0x38465c[_0xfed1('0x3c')]=_['intersection'](_0x43f9f9[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x49b054[_0xfed1('0x37')][_0xfed1('0x3d')]));_0x38465c[_0xfed1('0x3c')]=_0x38465c['attributes'][_0xfed1('0x3e')]?_0x38465c[_0xfed1('0x3c')]:_0x43f9f9[_0xfed1('0x3b')];_0x38465c['order']=qs['sort'](_0x49b054[_0xfed1('0x37')][_0xfed1('0x42')]);_0x38465c[_0xfed1('0x44')]=qs[_0xfed1('0x39')](_[_0xfed1('0x43')](_0x49b054['query'],_0x43f9f9[_0xfed1('0x39')]));if(_0x49b054[_0xfed1('0x37')]['filter']){_0x38465c[_0xfed1('0x44')]=_[_0xfed1('0x45')](_0x38465c[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x38465c[_0xfed1('0x3c')],function(_0x342273){var _0x57da2d={};_0x57da2d[_0x342273]={'$like':'%'+_0x49b054[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x57da2d;})});}_0x38465c=_[_0xfed1('0x45')]({},_0x38465c,_0x49b054[_0xfed1('0x47')]);return _0x58221d[_0xfed1('0x94')](_0x38465c);}})['then'](function(_0x404772){if(_0x404772){_0x23255c=_0x404772[_0xfed1('0x3e')];if(!_0x49b054[_0xfed1('0x37')][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x38465c['limit']=qs[_0xfed1('0x1f')](_0x49b054[_0xfed1('0x37')]['limit']);_0x38465c[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x49b054[_0xfed1('0x37')][_0xfed1('0x1d')]);}return _0x58221d['getAgents'](_0x38465c);}})['then'](function(_0x2091c3){if(_0x2091c3){return _0x2091c3?{'count':_0x23255c,'rows':_0x2091c3}:null;}})[_0xfed1('0x25')](respondWithResult(_0xb2bb63,null))[_0xfed1('0x4f')](handleError(_0xb2bb63,null));};exports[_0xfed1('0x95')]=function(_0x1038fc,_0x3136d6,_0x841583){var _0x4215af={};var _0x3b8fe6={};var _0x1ef784;var _0x566427;return db['VoiceQueue'][_0xfed1('0x62')]({'where':{'id':_0x1038fc[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x3136d6,null))[_0xfed1('0x25')](function(_0x2cc45f){if(_0x2cc45f){_0x1ef784=_0x2cc45f;_0x3b8fe6['model']=_[_0xfed1('0x38')](db[_0xfed1('0x77')][_0xfed1('0x5a')]);_0x3b8fe6[_0xfed1('0x37')]=_[_0xfed1('0x38')](_0x1038fc[_0xfed1('0x37')]);_0x3b8fe6[_0xfed1('0x39')]=_['intersection'](_0x3b8fe6[_0xfed1('0x3b')],_0x3b8fe6[_0xfed1('0x37')]);_0x4215af[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x3b8fe6[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x1038fc[_0xfed1('0x37')]['fields']));_0x4215af[_0xfed1('0x3c')]=_0x4215af['attributes'][_0xfed1('0x3e')]?_0x4215af[_0xfed1('0x3c')]:_0x3b8fe6[_0xfed1('0x3b')];_0x4215af[_0xfed1('0x41')]=qs[_0xfed1('0x42')](_0x1038fc[_0xfed1('0x37')]['sort']);_0x4215af[_0xfed1('0x44')]=qs[_0xfed1('0x39')](_['pick'](_0x1038fc[_0xfed1('0x37')],_0x3b8fe6['filters']));if(_0x1038fc[_0xfed1('0x37')][_0xfed1('0x2a')]){_0x4215af['where']=_['merge'](_0x4215af['where'],{'$or':_[_0xfed1('0x2c')](_0x4215af[_0xfed1('0x3c')],function(_0x3716dd){var _0x30d883={};_0x30d883[_0x3716dd]={'$like':'%'+_0x1038fc['query'][_0xfed1('0x2a')]+'%'};return _0x30d883;})});}_0x4215af=_[_0xfed1('0x45')]({},_0x4215af,_0x1038fc[_0xfed1('0x47')]);return _0x1ef784[_0xfed1('0x95')](_0x4215af);}})[_0xfed1('0x25')](function(_0x479681){if(_0x479681){_0x566427=_0x479681[_0xfed1('0x3e')];if(!_0x1038fc[_0xfed1('0x37')][_0xfed1('0x3f')](_0xfed1('0x40'))){_0x4215af[_0xfed1('0x1f')]=qs['limit'](_0x1038fc[_0xfed1('0x37')][_0xfed1('0x1f')]);_0x4215af[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x1038fc[_0xfed1('0x37')][_0xfed1('0x1d')]);}return _0x1ef784[_0xfed1('0x95')](_0x4215af);}})[_0xfed1('0x25')](function(_0x5ee3e1){return _0x5ee3e1?{'count':_0x566427,'rows':_0x5ee3e1}:null;})[_0xfed1('0x25')](respondWithResult(_0x3136d6,null))[_0xfed1('0x4f')](handleError(_0x3136d6,null));};exports[_0xfed1('0x96')]=function(_0xafa796,_0x40457a,_0x55dcc9){var _0x35e29b={};var _0x2cfa17={};var _0x1417a3;var _0x221400;return db['VoiceQueue'][_0xfed1('0x62')]({'where':{'id':_0xafa796[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x40457a,null))['then'](function(_0x49dc47){if(_0x49dc47){_0x1417a3=_0x49dc47;_0x2cfa17[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db[_0xfed1('0x97')][_0xfed1('0x5a')]);_0x2cfa17['query']=_[_0xfed1('0x38')](_0xafa796[_0xfed1('0x37')]);_0x2cfa17['filters']=_[_0xfed1('0x3a')](_0x2cfa17[_0xfed1('0x3b')],_0x2cfa17[_0xfed1('0x37')]);_0x35e29b[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x2cfa17[_0xfed1('0x3b')],qs['fields'](_0xafa796[_0xfed1('0x37')][_0xfed1('0x3d')]));_0x35e29b[_0xfed1('0x3c')]=_0x35e29b[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x35e29b[_0xfed1('0x3c')]:_0x2cfa17[_0xfed1('0x3b')];_0x35e29b[_0xfed1('0x41')]=qs[_0xfed1('0x42')](_0xafa796['query'][_0xfed1('0x42')]);_0x35e29b['where']=qs[_0xfed1('0x39')](_['pick'](_0xafa796[_0xfed1('0x37')],_0x2cfa17[_0xfed1('0x39')]));if(_0xafa796[_0xfed1('0x37')][_0xfed1('0x2a')]){_0x35e29b[_0xfed1('0x44')]=_['merge'](_0x35e29b[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x35e29b[_0xfed1('0x3c')],function(_0x2adeb0){var _0x331ae3={};_0x331ae3[_0x2adeb0]={'$like':'%'+_0xafa796[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x331ae3;})});}_0x35e29b=_[_0xfed1('0x45')]({},_0x35e29b,_0xafa796[_0xfed1('0x47')]);return _0x1417a3['getLists'](_0x35e29b);}})[_0xfed1('0x25')](function(_0x4cdf40){if(_0x4cdf40){_0x221400=_0x4cdf40[_0xfed1('0x3e')];if(!_0xafa796[_0xfed1('0x37')]['hasOwnProperty'](_0xfed1('0x40'))){_0x35e29b[_0xfed1('0x1f')]=qs['limit'](_0xafa796[_0xfed1('0x37')][_0xfed1('0x1f')]);_0x35e29b['offset']=qs[_0xfed1('0x1d')](_0xafa796[_0xfed1('0x37')][_0xfed1('0x1d')]);}return _0x1417a3['getLists'](_0x35e29b);}})['then'](function(_0xe8b1b5){if(_0xe8b1b5){return _0xe8b1b5?{'count':_0x221400,'rows':_0xe8b1b5}:null;}})[_0xfed1('0x25')](respondWithResult(_0x40457a,null))[_0xfed1('0x4f')](handleError(_0x40457a,null));};exports[_0xfed1('0x98')]=function(_0x4b1841,_0x5b35fe,_0x592acc){var _0x63248f=moment()[_0xfed1('0x92')](_0xfed1('0x99'));var _0x5af4a3,_0xf2462c;return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x4b1841['params']['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x5b35fe,null))[_0xfed1('0x25')](function(_0x496e37){if(_0x496e37){_0xf2462c=_0x496e37;return _0x496e37[_0xfed1('0x98')](_0x4b1841[_0xfed1('0x51')]['ids'],_['omit'](_0x4b1841[_0xfed1('0x51')],[_0xfed1('0x7b'),'id'])||{});}return null;})[_0xfed1('0x9a')](function(_0x24da73){var _0x2b69da;_0x5af4a3=_0x24da73||[];var _0x8ec773=[];if(_0x24da73){for(var _0x10ccc5=0x0;_0x10ccc5<_0x24da73['length'];_0x10ccc5+=0x1){var _0x44b3bf=_0x24da73[_0x10ccc5][_0xfed1('0x26')]({'plain':!![]});_0xf2462c[_0xfed1('0x9b')]=_0x4b1841[_0xfed1('0x51')]['dialCheckDuplicateType']?_0x4b1841[_0xfed1('0x51')][_0xfed1('0x9b')]:_0xf2462c[_0xfed1('0x9b')];switch(_0xf2462c[_0xfed1('0x9b')]){case _0xfed1('0x9c'):_0x2b69da=squel[_0xfed1('0x9d')]()[_0xfed1('0x9e')](_0xfed1('0x9f'))[_0xfed1('0xa0')](['phone',_0xfed1('0xa1'),_0xfed1('0xa2'),_0xfed1('0xa3'),_0xfed1('0x63'),_0xfed1('0x5c'),_0xfed1('0x5d')],squel['select']()[_0xfed1('0xa4')](_0xfed1('0xa5'),'phone')[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0xa1'))[_0xfed1('0xa4')]('id',_0xfed1('0xa2'))[_0xfed1('0xa4')](_0x44b3bf['CmListId'][_0xfed1('0x85')](),_0xfed1('0xa3'))['field'](_0x4b1841[_0xfed1('0x4d')]['id'][_0xfed1('0x85')](),_0xfed1('0x63'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5c'))['field']('\x27'+_0x63248f+'\x27',_0xfed1('0x5d'))[_0xfed1('0x7e')](_0xfed1('0xa6'))['where'](_0xfed1('0xa7'))['where'](_0xfed1('0xa8'),_0x44b3bf[_0xfed1('0xa9')][_0xfed1('0x85')]())['where'](_0xfed1('0xaa'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xfed1('0x7c')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xfed1('0x7e')](_0xfed1('0xab'))[_0xfed1('0x44')](_0xfed1('0xac'),_0x4b1841[_0xfed1('0x4d')]['id']['toString']()))[_0xfed1('0x44')](_0xfed1('0xad'),squel[_0xfed1('0x7c')]()[_0xfed1('0xa4')](_0xfed1('0xae'))[_0xfed1('0x7e')](_0xfed1('0x9f'))['where']('VoiceQueueId\x20=\x20?',_0x4b1841[_0xfed1('0x4d')]['id'][_0xfed1('0x85')]())))[_0xfed1('0x85')]();break;case _0xfed1('0xaf'):_0x2b69da=squel[_0xfed1('0x9d')]()[_0xfed1('0x9e')](_0xfed1('0x9f'))[_0xfed1('0xa0')]([_0xfed1('0xa5'),_0xfed1('0xa1'),_0xfed1('0xa2'),_0xfed1('0xa3'),_0xfed1('0x63'),'createdAt',_0xfed1('0x5d')],squel[_0xfed1('0x7c')]()[_0xfed1('0xa4')]('phone',_0xfed1('0xa5'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0xa1'))[_0xfed1('0xa4')]('id',_0xfed1('0xa2'))[_0xfed1('0xa4')](_0x44b3bf[_0xfed1('0xa9')][_0xfed1('0x85')](),_0xfed1('0xa3'))['field'](_0x4b1841[_0xfed1('0x4d')]['id'][_0xfed1('0x85')](),_0xfed1('0x63'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5c'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5d'))[_0xfed1('0x7e')](_0xfed1('0xa6'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xfed1('0xa8'),_0x44b3bf[_0xfed1('0xa9')][_0xfed1('0x85')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xfed1('0xad'),squel[_0xfed1('0x7c')]()['field'](_0xfed1('0xae'))[_0xfed1('0x7e')](_0xfed1('0x9f'))['where'](_0xfed1('0xac'),_0x4b1841['params']['id'][_0xfed1('0x85')]())))[_0xfed1('0x85')]();break;default:_0x2b69da=squel['insert']()[_0xfed1('0x9e')]('cm_hopper')[_0xfed1('0xa0')]([_0xfed1('0xa5'),_0xfed1('0xa1'),_0xfed1('0xa2'),_0xfed1('0xa3'),_0xfed1('0x63'),_0xfed1('0x5c'),_0xfed1('0x5d')],squel[_0xfed1('0x7c')]()['field']('phone','phone')['field']('\x27'+_0x63248f+'\x27',_0xfed1('0xa1'))[_0xfed1('0xa4')]('id',_0xfed1('0xa2'))[_0xfed1('0xa4')](_0x44b3bf[_0xfed1('0xa9')][_0xfed1('0x85')](),_0xfed1('0xa3'))['field'](_0x4b1841[_0xfed1('0x4d')]['id'][_0xfed1('0x85')](),'VoiceQueueId')[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5c'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5d'))['from'](_0xfed1('0xa6'))[_0xfed1('0x44')](_0xfed1('0xa7'))[_0xfed1('0x44')](_0xfed1('0xa8'),_0x44b3bf[_0xfed1('0xa9')]['toString']())[_0xfed1('0x44')](_0xfed1('0xaa')))[_0xfed1('0x85')]();}_0x8ec773['push'](db[_0xfed1('0x84')][_0xfed1('0x37')](_0x2b69da));}return BPromise[_0xfed1('0x89')](_0x8ec773);}})[_0xfed1('0x25')](function(){var _0x915e9b=[];var _0x3e8fb5=squel['insert']()[_0xfed1('0x9e')](_0xfed1('0xb0'))[_0xfed1('0xa0')]([_0xfed1('0xb1'),_0xfed1('0xa5'),_0xfed1('0xb2'),_0xfed1('0x5c'),_0xfed1('0x5d')],squel[_0xfed1('0x7c')]()[_0xfed1('0xa4')](_0xfed1('0xb3'))[_0xfed1('0xa4')](_0xfed1('0xb4'))[_0xfed1('0xa4')](_0xfed1('0xb5'))[_0xfed1('0xa4')]('\x27'+_0x63248f+'\x27',_0xfed1('0x5c'))['field']('\x27'+_0x63248f+'\x27',_0xfed1('0x5d'))[_0xfed1('0x7e')](_0xfed1('0xb6'),'ci')[_0xfed1('0x80')](_0xfed1('0x9f'),'h','h.ContactId=ci.CmContactId')[_0xfed1('0x44')](_0xfed1('0xb7'),_0x63248f)[_0xfed1('0x44')](_0xfed1('0xb8'),_0xfed1('0xb9')))[_0xfed1('0x85')]();_0x915e9b[_0xfed1('0x83')](db[_0xfed1('0x84')]['query'](_0x3e8fb5));return BPromise[_0xfed1('0x89')](_0x915e9b);})[_0xfed1('0x25')](function(){return _0x5af4a3;})[_0xfed1('0x25')](respondWithResult(_0x5b35fe,null))['catch'](handleError(_0x5b35fe,null));};exports[_0xfed1('0xba')]=function(_0x3ca296,_0x325c78,_0x3b9553){return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x3ca296[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x325c78,null))[_0xfed1('0x25')](function(_0x44328f){if(_0x44328f){return _0x44328f[_0xfed1('0xba')](_0x3ca296['query'][_0xfed1('0x7b')]);}})[_0xfed1('0x25')](function(_0x1fb4a1){if(_0x1fb4a1){return db[_0xfed1('0x61')][_0xfed1('0x30')]({'where':{'ListId':_0x3ca296[_0xfed1('0x37')]['ids'],'VoiceQueueId':_0x3ca296[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](function(){return _0x1fb4a1;});}})[_0xfed1('0x25')](respondWithStatusCode(_0x325c78,null))[_0xfed1('0x4f')](handleError(_0x325c78,null));};exports[_0xfed1('0xbb')]=function(_0x5478a6,_0x44e5d6,_0x43a44c){var _0x523607={};var _0x4739ba={};var _0x2a034b;var _0x13d905;return db[_0xfed1('0x48')][_0xfed1('0x62')]({'where':{'id':_0x5478a6['params']['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x44e5d6,null))[_0xfed1('0x25')](function(_0xbe8774){if(_0xbe8774){_0x2a034b=_0xbe8774;_0x4739ba[_0xfed1('0x3b')]=_[_0xfed1('0x38')](db[_0xfed1('0x97')]['rawAttributes']);_0x4739ba[_0xfed1('0x37')]=_['keys'](_0x5478a6[_0xfed1('0x37')]);_0x4739ba[_0xfed1('0x39')]=_[_0xfed1('0x3a')](_0x4739ba[_0xfed1('0x3b')],_0x4739ba['query']);_0x523607[_0xfed1('0x3c')]=_[_0xfed1('0x3a')](_0x4739ba[_0xfed1('0x3b')],qs[_0xfed1('0x3d')](_0x5478a6[_0xfed1('0x37')][_0xfed1('0x3d')]));_0x523607['attributes']=_0x523607[_0xfed1('0x3c')][_0xfed1('0x3e')]?_0x523607[_0xfed1('0x3c')]:_0x4739ba[_0xfed1('0x3b')];_0x523607['order']=qs[_0xfed1('0x42')](_0x5478a6['query']['sort']);_0x523607['where']=qs['filters'](_['pick'](_0x5478a6[_0xfed1('0x37')],_0x4739ba[_0xfed1('0x39')]));if(_0x5478a6[_0xfed1('0x37')][_0xfed1('0x2a')]){_0x523607['where']=_[_0xfed1('0x45')](_0x523607[_0xfed1('0x44')],{'$or':_[_0xfed1('0x2c')](_0x523607[_0xfed1('0x3c')],function(_0x51343d){var _0x128ff5={};_0x128ff5[_0x51343d]={'$like':'%'+_0x5478a6[_0xfed1('0x37')][_0xfed1('0x2a')]+'%'};return _0x128ff5;})});}_0x523607=_[_0xfed1('0x45')]({},_0x523607,_0x5478a6[_0xfed1('0x47')]);return _0x2a034b[_0xfed1('0xbb')](_0x523607);}})[_0xfed1('0x25')](function(_0x54ad18){if(_0x54ad18){_0x13d905=_0x54ad18[_0xfed1('0x3e')];if(!_0x5478a6[_0xfed1('0x37')][_0xfed1('0x3f')]('nolimit')){_0x523607[_0xfed1('0x1f')]=qs[_0xfed1('0x1f')](_0x5478a6[_0xfed1('0x37')][_0xfed1('0x1f')]);_0x523607[_0xfed1('0x1d')]=qs[_0xfed1('0x1d')](_0x5478a6[_0xfed1('0x37')][_0xfed1('0x1d')]);}return _0x2a034b[_0xfed1('0xbb')](_0x523607);}})[_0xfed1('0x25')](function(_0x411926){if(_0x411926){return _0x411926?{'count':_0x13d905,'rows':_0x411926}:null;}})[_0xfed1('0x25')](respondWithResult(_0x44e5d6,null))['catch'](handleError(_0x44e5d6,null));};exports['addBlackLists']=function(_0x77cf3a,_0x4aed7a,_0x417f92){var _0x317c83,_0x12fffa;return db[_0xfed1('0x48')][_0xfed1('0x4e')]({'where':{'id':_0x77cf3a[_0xfed1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4aed7a,null))[_0xfed1('0x25')](function(_0x3e7552){if(_0x3e7552){_0x12fffa=_0x3e7552;return _0x3e7552[_0xfed1('0xbc')](_0x77cf3a[_0xfed1('0x51')][_0xfed1('0x7b')],_[_0xfed1('0x5b')](_0x77cf3a['body'],[_0xfed1('0x7b'),'id'])||{});}return null;})[_0xfed1('0x9a')](function(_0x3d02b1){var _0x7624fc;_0x317c83=_0x3d02b1||[];var _0x23ac02=[];if(_0x3d02b1){for(var _0x4aceaa=0x0;_0x4aceaa<_0x3d02b1[_0xfed1('0x3e')];_0x4aceaa+=0x1){var _0x4dd4c0=_0x3d02b1[_0x4aceaa][_0xfed1('0x26')]({'plain':!![]});_0x7624fc=squel[_0xfed1('0x9d')]()[_0xfed1('0x9e')](_0xfed1('0xbd'))['fromQuery']([_0xfed1('0xa5'),_0xfed1('0xa2'),'ListId',_0xfed1('0x63'),'createdAt','updatedAt'],squel[_0xfed1('0x7c')]()[_0xfed1('0xa4')](_0xfed1('0xa5'),'phone')[_0xfed1('0xa4')]('id','ContactId')[_0xfed1('0xa4')](_0x4dd4c0[_0xfed1('0xa9')]['toString'](),'ListId')[_0xfed1('0xa4')](_0x77cf3a[_0xfed1('0x4d')]['id'][_0xfed1('0x85')](),_0xfed1('0x63'))[_0xfed1('0xa4')](_0xfed1('0xbe'),_0xfed1('0x5c'))[_0xfed1('0xa4')](_0xfed1('0xbe'),_0xfed1('0x5d'))['from'](_0xfed1('0xa6'))[_0xfed1('0x44')]('deletedAt\x20IS\x20NULL')[_0xfed1('0x44')]('ListId\x20=\x20?',_0x4dd4c0[_0xfed1('0xa9')][_0xfed1('0x85')]())['where'](_0xfed1('0xaa')))['toString']();_0x23ac02[_0xfed1('0x83')](db[_0xfed1('0x84')][_0xfed1('0x37')](_0x7624fc));}return BPromise[_0xfed1('0x89')](_0x23ac02);}})[_0xfed1('0x25')](function(){return _0x317c83;})[_0xfed1('0x25')](respondWithResult(_0x4aed7a,null))[_0xfed1('0x4f')](handleError(_0x4aed7a,null));};exports['removeBlackLists']=function(_0x474987,_0x45c91e,_0x3d6058){return db['VoiceQueue'][_0xfed1('0x4e')]({'where':{'id':_0x474987[_0xfed1('0x4d')]['id']}})[_0xfed1('0x25')](handleEntityNotFound(_0x45c91e,null))[_0xfed1('0x25')](function(_0x2d2278){if(_0x2d2278){return _0x2d2278['removeBlackLists'](_0x474987[_0xfed1('0x37')]['ids']);}})[_0xfed1('0x25')](function(_0x2af01a){if(_0x2af01a){return db[_0xfed1('0x67')][_0xfed1('0x30')]({'where':{'ListId':_0x474987['query']['ids'],'VoiceQueueId':_0x474987[_0xfed1('0x4d')]['id']}})['then'](function(){return _0x2af01a;});}})[_0xfed1('0x25')](respondWithStatusCode(_0x45c91e,null))[_0xfed1('0x4f')](handleError(_0x45c91e,null));};
\ No newline at end of file
+var _0x90b1=['userVoiceQueue:save','removeTeams','field','tq.TeamId','from','join','user_has_teams','ut.UserId\x20=\x20?','push','sequelize','SELECT','TeamId','all','union','compact','ids','isEmpty','userVoiceQueue:remove','addAgents','spread','online','removeAgents','getAgents','getMembers','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','dialCheckDuplicateType','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','cm_hopper_additional_phones','CmHopperId','h.id','ci.OrderBy+1','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','get','VoiceQueues','inbound','outbound','filter','value','includes','type','find','UserProfileResource','then','name','send','index','VoiceQueue','rawAttributes','key','model','query','filters','attributes','fields','length','nolimit','order','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','intersection','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','error','clone','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','sort','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','map','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','teams','Team','User','Agents','voicePause','interface','transaction','addTeams','each','TeamVoiceQueue','upsert','penalty','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit'];(function(_0x30c7c8,_0x306d2e){var _0x152bb4=function(_0x2808de){while(--_0x2808de){_0x30c7c8['push'](_0x30c7c8['shift']());}};_0x152bb4(++_0x306d2e);}(_0x90b1,0x1bb));var _0x190b=function(_0x2b07a1,_0x25c79a){_0x2b07a1=_0x2b07a1-0x0;var _0x4bb96b=_0x90b1[_0x2b07a1];return _0x4bb96b;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));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 Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];config[_0x190b('0x18')]=_[_0x190b('0x19')](config[_0x190b('0x18')],{'host':_0x190b('0x1a'),'port':0x18eb});var socket=require(_0x190b('0x1b'))(new Redis(config[_0x190b('0x18')]));require(_0x190b('0x1c'))[_0x190b('0x1d')](socket);function respondWithStatusCode(_0x1ff180,_0x441e58){_0x441e58=_0x441e58||0xcc;return function(_0x186941){if(_0x186941){return _0x1ff180[_0x190b('0x1e')](_0x441e58);}return _0x1ff180[_0x190b('0x1f')](_0x441e58)[_0x190b('0x20')]();};}function respondWithResult(_0x3fbfc3,_0x121867){_0x121867=_0x121867||0xc8;return function(_0x1b4f4c){if(_0x1b4f4c){return _0x3fbfc3['status'](_0x121867)[_0x190b('0x21')](_0x1b4f4c);}};}function respondWithFilteredResult(_0x5efbed,_0x2a9323){return function(_0x21e458){if(_0x21e458){var _0x56d07a=typeof _0x2a9323[_0x190b('0x22')]==='undefined'&&typeof _0x2a9323[_0x190b('0x23')]===_0x190b('0x24');var _0x441a2b=_0x21e458[_0x190b('0x25')];var _0x1b5427=_0x56d07a?0x0:_0x2a9323[_0x190b('0x22')];var _0x47d704=_0x56d07a?_0x21e458[_0x190b('0x25')]:_0x2a9323[_0x190b('0x22')]+_0x2a9323['limit'];var _0xb4c32b;if(_0x47d704>=_0x441a2b){_0x47d704=_0x441a2b;_0xb4c32b=0xc8;}else{_0xb4c32b=0xce;}_0x5efbed['status'](_0xb4c32b);return _0x5efbed['set'](_0x190b('0x26'),_0x1b5427+'-'+_0x47d704+'/'+_0x441a2b)[_0x190b('0x21')](_0x21e458);}return null;};}function patchUpdates(_0x332006){return function(_0x4c0b6e){try{jsonpatch[_0x190b('0x27')](_0x4c0b6e,_0x332006,!![]);}catch(_0x2e633e){return BPromise[_0x190b('0x28')](_0x2e633e);}return _0x4c0b6e[_0x190b('0x29')]();};}function saveUpdates(_0x3b8c74,_0x3ad3a5){return function(_0x1bce97){if(_0x1bce97){return _0x1bce97['update'](_0x3b8c74)['then'](function(_0x262a63){return _0x262a63;});}return null;};}function removeEntity(_0x1a5f86,_0x50605b){return function(_0x526822){if(_0x526822){return _0x526822[_0x190b('0x2a')]()['then'](function(){var _0x328e5e=_0x526822[_0x190b('0x2b')]({'plain':!![]});var _0x51f8b4=[{'name':_0x190b('0x2c'),'value':_0x190b('0x2d'),'ignore':![]},{'name':'QueueCampaigns','value':_0x190b('0x2e'),'ignore':![]}];var _0x2c47ae=_(_0x51f8b4)[_0x190b('0x2f')]('ignore')['map'](_0x190b('0x30'))['value']();if(_[_0x190b('0x31')](_0x2c47ae,_0x328e5e[_0x190b('0x32')])){return;}var _0x5b9cb6=_[_0x190b('0x33')](_0x51f8b4,['value',_0x328e5e[_0x190b('0x32')]])['name'];return db[_0x190b('0x34')]['destroy']({'where':{'type':_0x5b9cb6,'resourceId':_0x328e5e['id']}})[_0x190b('0x35')](function(){return _0x526822;});})[_0x190b('0x35')](function(){_0x1a5f86['status'](0xcc)[_0x190b('0x20')]();});}};}function handleEntityNotFound(_0x15fed4,_0x107b6f){return function(_0x1dcb8b){if(!_0x1dcb8b){_0x15fed4[_0x190b('0x1e')](0x194);}return _0x1dcb8b;};}function handleError(_0x360d04,_0x309065){_0x309065=_0x309065||0x1f4;return function(_0x248919){logger['error'](_0x248919['stack']);if(_0x248919[_0x190b('0x36')]){delete _0x248919[_0x190b('0x36')];}_0x360d04['status'](_0x309065)[_0x190b('0x37')](_0x248919);};}exports[_0x190b('0x38')]=function(_0x3e4dd8,_0x3fbba1){var _0x3b6f3f={},_0x228c73={},_0x5bda80={'count':0x0,'rows':[]};var _0x5492b0=_['map'](db[_0x190b('0x39')][_0x190b('0x3a')],function(_0x1a950d){return{'name':_0x1a950d['fieldName'],'type':_0x1a950d[_0x190b('0x32')][_0x190b('0x3b')]};});_0x228c73[_0x190b('0x3c')]=_['map'](_0x5492b0,_0x190b('0x36'));_0x228c73['query']=_['keys'](_0x3e4dd8[_0x190b('0x3d')]);_0x228c73[_0x190b('0x3e')]=_['intersection'](_0x228c73[_0x190b('0x3c')],_0x228c73[_0x190b('0x3d')]);_0x3b6f3f[_0x190b('0x3f')]=_['intersection'](_0x228c73[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x3e4dd8['query']['fields']));_0x3b6f3f[_0x190b('0x3f')]=_0x3b6f3f['attributes'][_0x190b('0x41')]?_0x3b6f3f[_0x190b('0x3f')]:_0x228c73[_0x190b('0x3c')];if(!_0x3e4dd8[_0x190b('0x3d')]['hasOwnProperty'](_0x190b('0x42'))){_0x3b6f3f['limit']=qs[_0x190b('0x23')](_0x3e4dd8[_0x190b('0x3d')]['limit']);_0x3b6f3f[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x3e4dd8[_0x190b('0x3d')]['offset']);}_0x3b6f3f[_0x190b('0x43')]=qs['sort'](_0x3e4dd8['query']['sort']);_0x3b6f3f[_0x190b('0x44')]=qs[_0x190b('0x3e')](_[_0x190b('0x45')](_0x3e4dd8[_0x190b('0x3d')],_0x228c73['filters']),_0x5492b0);if(_0x3e4dd8['query'][_0x190b('0x2f')]){_0x3b6f3f['where']=_[_0x190b('0x46')](_0x3b6f3f[_0x190b('0x44')],{'$or':_['map'](_0x5492b0,function(_0x2e25e3){if(_0x2e25e3[_0x190b('0x32')]!==_0x190b('0x47')){var _0x47e414={};_0x47e414[_0x2e25e3[_0x190b('0x36')]]={'$like':'%'+_0x3e4dd8[_0x190b('0x3d')]['filter']+'%'};return _0x47e414;}})});}_0x3b6f3f=_[_0x190b('0x46')]({},_0x3b6f3f,_0x3e4dd8['options']);var _0x1b8d35={'where':_0x3b6f3f[_0x190b('0x44')]};return db[_0x190b('0x39')]['count'](_0x1b8d35)[_0x190b('0x35')](function(_0x58e006){_0x5bda80[_0x190b('0x25')]=_0x58e006;if(_0x3e4dd8[_0x190b('0x3d')][_0x190b('0x48')]){_0x3b6f3f[_0x190b('0x49')]=[{'all':!![]}];}return db[_0x190b('0x39')][_0x190b('0x4a')](_0x3b6f3f);})[_0x190b('0x35')](function(_0x5deb30){_0x5bda80[_0x190b('0x4b')]=_0x5deb30;return _0x5bda80;})[_0x190b('0x35')](respondWithFilteredResult(_0x3fbba1,_0x3b6f3f))[_0x190b('0x4c')](handleError(_0x3fbba1,null));};exports['show']=function(_0x1b71d5,_0x27314f){var _0x51af04={'raw':![],'where':{'id':_0x1b71d5[_0x190b('0x4d')]['id']}},_0x576660={};_0x576660['model']=_[_0x190b('0x4e')](db[_0x190b('0x39')][_0x190b('0x3a')]);_0x576660['query']=_[_0x190b('0x4e')](_0x1b71d5[_0x190b('0x3d')]);_0x576660[_0x190b('0x3e')]=_['intersection'](_0x576660['model'],_0x576660[_0x190b('0x3d')]);_0x51af04[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x576660[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x1b71d5[_0x190b('0x3d')]['fields']));_0x51af04[_0x190b('0x3f')]=_0x51af04[_0x190b('0x3f')][_0x190b('0x41')]?_0x51af04['attributes']:_0x576660[_0x190b('0x3c')];if(_0x1b71d5[_0x190b('0x3d')][_0x190b('0x48')]){_0x51af04['include']=[{'all':!![]}];}_0x51af04=_[_0x190b('0x46')]({},_0x51af04,_0x1b71d5[_0x190b('0x50')]);return db[_0x190b('0x39')][_0x190b('0x33')](_0x51af04)[_0x190b('0x35')](handleEntityNotFound(_0x27314f,null))[_0x190b('0x35')](respondWithResult(_0x27314f,null))[_0x190b('0x4c')](handleError(_0x27314f,null));};exports[_0x190b('0x51')]=function(_0x3a9087,_0x1f7ec2){return db[_0x190b('0x39')]['create'](_0x3a9087[_0x190b('0x52')],{})['then'](function(_0x1141c6){var _0x18f361=_0x3a9087['user'][_0x190b('0x2b')]({'plain':!![]});if(!_0x18f361)throw new Error(_0x190b('0x53'));if(_0x18f361[_0x190b('0x54')]===_0x190b('0x55')){var _0x21b1c3=_0x1141c6[_0x190b('0x2b')]({'plain':!![]});var _0x618748=[{'name':_0x190b('0x2c'),'value':'inbound'},{'name':_0x190b('0x56'),'value':_0x190b('0x2e')}];var _0x300730=_['find'](_0x618748,[_0x190b('0x30'),_0x21b1c3['type']])['name'];return db[_0x190b('0x57')][_0x190b('0x33')]({'where':{'name':_0x300730,'userProfileId':_0x18f361[_0x190b('0x58')]},'raw':!![]})[_0x190b('0x35')](function(_0x38e63f){if(_0x38e63f&&_0x38e63f[_0x190b('0x59')]===0x0){return db[_0x190b('0x34')][_0x190b('0x51')]({'name':_0x21b1c3[_0x190b('0x36')],'resourceId':_0x21b1c3['id'],'type':_0x38e63f[_0x190b('0x36')],'sectionId':_0x38e63f['id']},{})[_0x190b('0x35')](function(){return _0x1141c6;});}else{return _0x1141c6;}})[_0x190b('0x4c')](function(_0x2f8775){logger[_0x190b('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f8775);throw _0x2f8775;});}return _0x1141c6;})[_0x190b('0x35')](respondWithResult(_0x1f7ec2,0xc9))[_0x190b('0x4c')](handleError(_0x1f7ec2,null));};exports[_0x190b('0x5b')]=function(_0x219aa8,_0x53d740){var _0x50f9f7={'where':{'id':_0x219aa8[_0x190b('0x4d')]['id']}},_0x487783={};_0x487783['model']=_[_0x190b('0x4e')](db['VoiceQueue'][_0x190b('0x3a')]);_0x50f9f7[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x487783['model'],qs[_0x190b('0x40')](_0x219aa8[_0x190b('0x3d')][_0x190b('0x40')]));_0x50f9f7[_0x190b('0x3f')]=_0x50f9f7[_0x190b('0x3f')][_0x190b('0x41')]?_0x50f9f7[_0x190b('0x3f')]:_0x487783[_0x190b('0x3c')];if(_0x219aa8[_0x190b('0x3d')]['includeAll']){_0x50f9f7['include']=[{'all':!![]}];}_0x50f9f7=_[_0x190b('0x46')]({},_0x50f9f7,_0x219aa8[_0x190b('0x50')]);return db[_0x190b('0x39')][_0x190b('0x33')](_0x50f9f7)['then'](handleEntityNotFound(_0x53d740,null))[_0x190b('0x35')](function(_0x43003f){if(_0x43003f){var _0x481862=_0x43003f[_0x190b('0x2b')]({'plain':!![]});_0x481862=qs[_0x190b('0x5c')](_0x481862,['id',_0x190b('0x5d'),_0x190b('0x5e')]);_0x219aa8[_0x190b('0x52')]=_[_0x190b('0x5c')](_0x219aa8[_0x190b('0x52')],['id',_0x190b('0x5d'),'updatedAt']);return db[_0x190b('0x39')]['create'](_['merge'](_0x481862,_0x219aa8[_0x190b('0x52')]),{'include':_0x219aa8[_0x190b('0x3d')][_0x190b('0x48')]?[{'all':!![]}]:undefined})['then'](function(_0x4da603){var _0x1d1a72=_0x219aa8[_0x190b('0x55')][_0x190b('0x2b')]({'plain':!![]});if(!_0x1d1a72)throw new Error(_0x190b('0x53'));if(_0x1d1a72[_0x190b('0x54')]===_0x190b('0x55')){var _0xf3a6d0=_0x4da603[_0x190b('0x2b')]({'plain':!![]});var _0x534541=[{'name':_0x190b('0x2c'),'value':_0x190b('0x2d')},{'name':_0x190b('0x56'),'value':_0x190b('0x2e')}];var _0x172f19=_['find'](_0x534541,[_0x190b('0x30'),_0xf3a6d0[_0x190b('0x32')]])[_0x190b('0x36')];return db['UserProfileSection'][_0x190b('0x33')]({'where':{'name':_0x172f19,'userProfileId':_0x1d1a72[_0x190b('0x58')]},'raw':!![]})[_0x190b('0x35')](function(_0x2b0362){if(_0x2b0362&&_0x2b0362['autoAssociation']===0x0){return db[_0x190b('0x34')][_0x190b('0x51')]({'name':_0xf3a6d0[_0x190b('0x36')],'resourceId':_0xf3a6d0['id'],'type':_0x2b0362[_0x190b('0x36')],'sectionId':_0x2b0362['id']},{})['then'](function(){return _0x4da603;});}else{return _0x4da603;}})[_0x190b('0x4c')](function(_0x5c2afd){logger[_0x190b('0x5a')](_0x190b('0x5f'),_0x5c2afd);throw _0x5c2afd;});}return _0x4da603;});}})[_0x190b('0x35')](respondWithResult(_0x53d740,0xc9))[_0x190b('0x4c')](handleError(_0x53d740,null));};exports['update']=function(_0x2a36b3,_0x52fa63){if(_0x2a36b3[_0x190b('0x52')]['id']){delete _0x2a36b3['body']['id'];}return db['VoiceQueue'][_0x190b('0x33')]({'where':{'id':_0x2a36b3['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x52fa63,null))[_0x190b('0x35')](saveUpdates(_0x2a36b3[_0x190b('0x52')],null))[_0x190b('0x35')](respondWithResult(_0x52fa63,null))[_0x190b('0x4c')](handleError(_0x52fa63,null));};exports['destroy']=function(_0x2f9922,_0xa26f18){return db[_0x190b('0x39')]['find']({'where':{'id':_0x2f9922[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0xa26f18,null))['then'](removeEntity(_0xa26f18,null))[_0x190b('0x4c')](handleError(_0xa26f18,null));};exports[_0x190b('0x60')]=function(_0xca14ca,_0x4a1289,_0x1446a4){var _0x26be58={'raw':![],'where':{}};var _0x4030ba={};var _0x36d258={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x190b('0x61')]({'where':{'id':_0xca14ca[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x4a1289,null))['then'](function(_0x1bc4f0){if(_0x1bc4f0){_0x4030ba[_0x190b('0x3c')]=_[_0x190b('0x4e')](db['CmHopper'][_0x190b('0x3a')]);_0x4030ba[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0xca14ca[_0x190b('0x3d')]);_0x4030ba[_0x190b('0x3e')]=_['intersection'](_0x4030ba['model'],_0x4030ba[_0x190b('0x3d')]);_0x26be58[_0x190b('0x3f')]=_['intersection'](_0x4030ba[_0x190b('0x3c')],qs[_0x190b('0x40')](_0xca14ca['query']['fields']));_0x26be58[_0x190b('0x3f')]=_0x26be58[_0x190b('0x3f')]['length']?_0x26be58['attributes']:_0x4030ba[_0x190b('0x3c')];if(!_0xca14ca[_0x190b('0x3d')][_0x190b('0x62')](_0x190b('0x42'))){_0x26be58[_0x190b('0x23')]=qs['limit'](_0xca14ca['query'][_0x190b('0x23')]);_0x26be58['offset']=qs[_0x190b('0x22')](_0xca14ca[_0x190b('0x3d')][_0x190b('0x22')]);}_0x26be58[_0x190b('0x43')]=qs[_0x190b('0x63')](_0xca14ca[_0x190b('0x3d')][_0x190b('0x63')]);_0x26be58[_0x190b('0x44')]=qs[_0x190b('0x3e')](_[_0x190b('0x45')](_0xca14ca[_0x190b('0x3d')],_0x4030ba['filters']));_0x26be58[_0x190b('0x44')][_0x190b('0x64')]=_0x1bc4f0['id'];if(_0xca14ca[_0x190b('0x3d')]['filter']){_0x26be58['where']=_[_0x190b('0x46')](_0x26be58[_0x190b('0x44')],{'$or':_['map'](_0x26be58[_0x190b('0x3f')],function(_0x18c5f4){var _0x31adc9={};_0x31adc9[_0x18c5f4]={'$like':'%'+_0xca14ca['query'][_0x190b('0x2f')]+'%'};return _0x31adc9;})});}_0x26be58=_[_0x190b('0x46')]({},_0x26be58,_0xca14ca['options']);return db[_0x190b('0x65')][_0x190b('0x25')]({'where':_0x26be58['where']})[_0x190b('0x35')](function(_0x4a8049){_0x36d258['count']=_0x4a8049;if(_0xca14ca['query']['includeAll']){_0x26be58[_0x190b('0x49')]=[{'all':!![]}];}return db[_0x190b('0x65')]['findAll'](_0x26be58);})[_0x190b('0x35')](function(_0x469085){_0x36d258['rows']=_0x469085;return _0x36d258;});}})[_0x190b('0x35')](respondWithFilteredResult(_0x4a1289,_0x26be58))[_0x190b('0x4c')](handleError(_0x4a1289,null));};exports[_0x190b('0x66')]=function(_0x9bd5ac,_0x74036e,_0x3d5f12){var _0x1c1228={'raw':!![],'where':{}};var _0x29e335={};var _0xc3610b={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x190b('0x61')]({'where':{'id':_0x9bd5ac['params']['id']}})['then'](handleEntityNotFound(_0x74036e,null))[_0x190b('0x35')](function(_0x27769c){if(_0x27769c){_0x29e335[_0x190b('0x3c')]=_[_0x190b('0x4e')](db[_0x190b('0x67')][_0x190b('0x3a')]);_0x29e335[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0x9bd5ac[_0x190b('0x3d')]);_0x29e335[_0x190b('0x3e')]=_[_0x190b('0x4f')](_0x29e335[_0x190b('0x3c')],_0x29e335['query']);_0x1c1228[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x29e335[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x40')]));_0x1c1228[_0x190b('0x3f')]=_0x1c1228[_0x190b('0x3f')][_0x190b('0x41')]?_0x1c1228['attributes']:_0x29e335[_0x190b('0x3c')];if(!_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x62')]('nolimit')){_0x1c1228[_0x190b('0x23')]=qs[_0x190b('0x23')](_0x9bd5ac['query']['limit']);_0x1c1228[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x22')]);}_0x1c1228[_0x190b('0x43')]=qs[_0x190b('0x63')](_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x63')]);_0x1c1228[_0x190b('0x44')]=qs[_0x190b('0x3e')](_['pick'](_0x9bd5ac[_0x190b('0x3d')],_0x29e335[_0x190b('0x3e')]));_0x1c1228[_0x190b('0x44')]['VoiceQueueId']=_0x27769c['id'];if(_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x2f')]){_0x1c1228[_0x190b('0x44')]=_[_0x190b('0x46')](_0x1c1228[_0x190b('0x44')],{'$or':_[_0x190b('0x68')](_0x1c1228['attributes'],function(_0x476c86){var _0x298824={};_0x298824[_0x476c86]={'$like':'%'+_0x9bd5ac['query'][_0x190b('0x2f')]+'%'};return _0x298824;})});}_0x1c1228=_[_0x190b('0x46')]({},_0x1c1228,_0x9bd5ac[_0x190b('0x50')]);return db[_0x190b('0x67')][_0x190b('0x25')]({'where':_0x1c1228[_0x190b('0x44')]})[_0x190b('0x35')](function(_0x3ef868){_0xc3610b['count']=_0x3ef868;if(_0x9bd5ac[_0x190b('0x3d')][_0x190b('0x48')]){_0x1c1228[_0x190b('0x49')]=[{'all':!![]}];}return db[_0x190b('0x67')]['findAll'](_0x1c1228);})[_0x190b('0x35')](function(_0x1936f6){_0xc3610b['rows']=_0x1936f6;return _0xc3610b;});}})[_0x190b('0x35')](respondWithFilteredResult(_0x74036e,_0x1c1228))[_0x190b('0x4c')](handleError(_0x74036e,null));};exports[_0x190b('0x69')]=function(_0x252490,_0x3835d7,_0x256cb7){var _0x30d48e={'raw':!![],'where':{}};var _0x496c32={};var _0x46f330={'count':0x0,'rows':[]};return db[_0x190b('0x39')][_0x190b('0x61')]({'where':{'id':_0x252490['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x3835d7,null))['then'](function(_0x199981){if(_0x199981){_0x496c32[_0x190b('0x3c')]=_[_0x190b('0x4e')](db[_0x190b('0x6a')][_0x190b('0x3a')]);_0x496c32[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0x252490['query']);_0x496c32[_0x190b('0x3e')]=_['intersection'](_0x496c32['model'],_0x496c32['query']);_0x30d48e[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x496c32['model'],qs[_0x190b('0x40')](_0x252490[_0x190b('0x3d')][_0x190b('0x40')]));_0x30d48e[_0x190b('0x3f')]=_0x30d48e[_0x190b('0x3f')]['length']?_0x30d48e['attributes']:_0x496c32['model'];if(!_0x252490[_0x190b('0x3d')][_0x190b('0x62')](_0x190b('0x42'))){_0x30d48e['limit']=qs[_0x190b('0x23')](_0x252490[_0x190b('0x3d')][_0x190b('0x23')]);_0x30d48e[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x252490['query'][_0x190b('0x22')]);}_0x30d48e['order']=qs[_0x190b('0x63')](_0x252490[_0x190b('0x3d')][_0x190b('0x63')]);_0x30d48e['where']=qs['filters'](_[_0x190b('0x45')](_0x252490['query'],_0x496c32[_0x190b('0x3e')]));_0x30d48e[_0x190b('0x44')][_0x190b('0x64')]=_0x199981['id'];if(_0x252490[_0x190b('0x3d')][_0x190b('0x2f')]){_0x30d48e[_0x190b('0x44')]=_[_0x190b('0x46')](_0x30d48e[_0x190b('0x44')],{'$or':_[_0x190b('0x68')](_0x30d48e[_0x190b('0x3f')],function(_0x178767){var _0x11d133={};_0x11d133[_0x178767]={'$like':'%'+_0x252490[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x11d133;})});}_0x30d48e=_[_0x190b('0x46')]({},_0x30d48e,_0x252490[_0x190b('0x50')]);return db['CmHopperFinal'][_0x190b('0x25')]({'where':_0x30d48e[_0x190b('0x44')]})['then'](function(_0x437c17){_0x46f330[_0x190b('0x25')]=_0x437c17;if(_0x252490['query']['includeAll']){_0x30d48e['include']=[{'all':!![]}];}return db[_0x190b('0x6a')][_0x190b('0x4a')](_0x30d48e);})[_0x190b('0x35')](function(_0x9cecf4){_0x46f330['rows']=_0x9cecf4;return _0x46f330;});}})[_0x190b('0x35')](respondWithFilteredResult(_0x3835d7,_0x30d48e))[_0x190b('0x4c')](handleError(_0x3835d7,null));};exports[_0x190b('0x6b')]=function(_0xc8a7f4,_0x4b9292,_0xf22ff7){var _0x3ab704={'raw':!![],'where':{}};var _0x1171f3={};var _0x44f13a={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xc8a7f4[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x4b9292,null))[_0x190b('0x35')](function(_0x35d135){if(_0x35d135){_0x1171f3[_0x190b('0x3c')]=_['keys'](db[_0x190b('0x6c')][_0x190b('0x3a')]);_0x1171f3[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0xc8a7f4['query']);_0x1171f3['filters']=_['intersection'](_0x1171f3[_0x190b('0x3c')],_0x1171f3['query']);_0x3ab704[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x1171f3[_0x190b('0x3c')],qs['fields'](_0xc8a7f4[_0x190b('0x3d')]['fields']));_0x3ab704[_0x190b('0x3f')]=_0x3ab704[_0x190b('0x3f')][_0x190b('0x41')]?_0x3ab704['attributes']:_0x1171f3['model'];if(!_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x62')](_0x190b('0x42'))){_0x3ab704[_0x190b('0x23')]=qs['limit'](_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x23')]);_0x3ab704[_0x190b('0x22')]=qs[_0x190b('0x22')](_0xc8a7f4[_0x190b('0x3d')]['offset']);}_0x3ab704['order']=qs[_0x190b('0x63')](_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x63')]);_0x3ab704[_0x190b('0x44')]=qs[_0x190b('0x3e')](_[_0x190b('0x45')](_0xc8a7f4[_0x190b('0x3d')],_0x1171f3[_0x190b('0x3e')]));_0x3ab704['where'][_0x190b('0x64')]=_0x35d135['id'];if(_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x2f')]){_0x3ab704[_0x190b('0x44')]=_[_0x190b('0x46')](_0x3ab704[_0x190b('0x44')],{'$or':_[_0x190b('0x68')](_0x3ab704[_0x190b('0x3f')],function(_0x417e1e){var _0x138786={};_0x138786[_0x417e1e]={'$like':'%'+_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x138786;})});}_0x3ab704=_[_0x190b('0x46')]({},_0x3ab704,_0xc8a7f4[_0x190b('0x50')]);return db['CmHopperBlack']['count']({'where':_0x3ab704[_0x190b('0x44')]})[_0x190b('0x35')](function(_0x116e91){_0x44f13a[_0x190b('0x25')]=_0x116e91;if(_0xc8a7f4[_0x190b('0x3d')][_0x190b('0x48')]){_0x3ab704[_0x190b('0x49')]=[{'all':!![]}];}return db[_0x190b('0x6c')][_0x190b('0x4a')](_0x3ab704);})[_0x190b('0x35')](function(_0x5f14a1){_0x44f13a[_0x190b('0x4b')]=_0x5f14a1;return _0x44f13a;});}})[_0x190b('0x35')](respondWithFilteredResult(_0x4b9292,_0x3ab704))['catch'](handleError(_0x4b9292,null));};exports[_0x190b('0x6d')]=function(_0x5d10ec,_0x54795a,_0x1cd670){var _0x86f02d={};var _0x9f01d2={};var _0x27aa2b;var _0xc09854;return db['VoiceQueue'][_0x190b('0x61')]({'where':{'id':_0x5d10ec[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x54795a,null))['then'](function(_0x221a63){if(_0x221a63){_0x27aa2b=_0x221a63;_0x9f01d2[_0x190b('0x3c')]=_[_0x190b('0x4e')](db['Team'][_0x190b('0x3a')]);_0x9f01d2[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0x5d10ec[_0x190b('0x3d')]);_0x9f01d2[_0x190b('0x3e')]=_[_0x190b('0x4f')](_0x9f01d2[_0x190b('0x3c')],_0x9f01d2['query']);_0x86f02d['attributes']=_[_0x190b('0x4f')](_0x9f01d2[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x5d10ec[_0x190b('0x3d')][_0x190b('0x40')]));_0x86f02d[_0x190b('0x3f')]=_0x86f02d[_0x190b('0x3f')][_0x190b('0x41')]?_0x86f02d['attributes']:_0x9f01d2[_0x190b('0x3c')];_0x86f02d[_0x190b('0x43')]=qs[_0x190b('0x63')](_0x5d10ec[_0x190b('0x3d')][_0x190b('0x63')]);_0x86f02d[_0x190b('0x44')]=qs['filters'](_['pick'](_0x5d10ec[_0x190b('0x3d')],_0x9f01d2[_0x190b('0x3e')]));if(_0x5d10ec[_0x190b('0x3d')]['filter']){_0x86f02d[_0x190b('0x44')]=_[_0x190b('0x46')](_0x86f02d[_0x190b('0x44')],{'$or':_['map'](_0x86f02d[_0x190b('0x3f')],function(_0x3335a0){var _0x4d6ee0={};_0x4d6ee0[_0x3335a0]={'$like':'%'+_0x5d10ec[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x4d6ee0;})});}_0x86f02d=_[_0x190b('0x46')]({},_0x86f02d,_0x5d10ec[_0x190b('0x50')]);return _0x27aa2b[_0x190b('0x6d')](_0x86f02d);}})[_0x190b('0x35')](function(_0x1b7399){if(_0x1b7399){_0xc09854=_0x1b7399[_0x190b('0x41')];if(!_0x5d10ec[_0x190b('0x3d')][_0x190b('0x62')]('nolimit')){_0x86f02d[_0x190b('0x23')]=qs[_0x190b('0x23')](_0x5d10ec[_0x190b('0x3d')][_0x190b('0x23')]);_0x86f02d[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x5d10ec[_0x190b('0x3d')][_0x190b('0x22')]);}return _0x27aa2b[_0x190b('0x6d')](_0x86f02d);}})['then'](function(_0x555541){if(_0x555541){return _0x555541?{'count':_0xc09854,'rows':_0x555541}:null;}})[_0x190b('0x35')](respondWithResult(_0x54795a,null))[_0x190b('0x4c')](handleError(_0x54795a,null));};exports['addTeams']=function(_0x5235ea,_0x31324b,_0x1efeb8){var _0xf0c9c4=_0x5235ea[_0x190b('0x52')][_0x190b('0x6e')];var _0x318e34=_[_0x190b('0x68')](_0xf0c9c4,'id');return db[_0x190b('0x6f')][_0x190b('0x4a')]({'where':{'id':_0x318e34},'attributes':['id'],'include':[{'model':db[_0x190b('0x70')],'as':_0x190b('0x71'),'attributes':['id','name','online',_0x190b('0x72'),_0x190b('0x73')],'raw':!![]}]})[_0x190b('0x35')](function(_0x4e0d11){if(_0x4e0d11){var _0x334951=_['flatMap'](_0x4e0d11,function(_0x184392){var _0x24dc4b=_0x184392[_0x190b('0x2b')]({'plain':!![]});_0x24dc4b[_0x190b('0x71')]['forEach'](function(_0x1daa73){_0x1daa73['penalty']=_[_0x190b('0x33')](_0xf0c9c4,{'id':_0x24dc4b['id']})['penalty'];});return _0x24dc4b[_0x190b('0x71')];});return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x5235ea['params']['id']}})[_0x190b('0x35')](function(_0x1778fa){return db['sequelize'][_0x190b('0x74')](function(_0x4f1298){return _0x1778fa[_0x190b('0x75')](_0x318e34,{'transaction':_0x4f1298})[_0x190b('0x35')](function(){return BPromise[_0x190b('0x76')](_0xf0c9c4,function(_0x1f8c4d){return db[_0x190b('0x77')][_0x190b('0x78')]({'TeamId':_0x1f8c4d['id'],'VoiceQueueId':_0x5235ea[_0x190b('0x4d')]['id'],'penalty':_0x1f8c4d[_0x190b('0x79')]},{'transaction':_0x4f1298});});})['then'](function(){return BPromise[_0x190b('0x76')](_0x334951,function(_0x1f5d0e){return db[_0x190b('0x7a')][_0x190b('0x7b')]({'where':{'UserId':_0x1f5d0e['id'],'VoiceQueueId':_0x5235ea[_0x190b('0x4d')]['id']},'defaults':{'penalty':_0x1f5d0e[_0x190b('0x79')]},'transaction':_0x4f1298});});})[_0x190b('0x35')](function(){return BPromise[_0x190b('0x76')](_[_0x190b('0x2f')](_0x334951,{'online':!![]}),function(_0xcade4f){return db[_0x190b('0x7c')][_0x190b('0x78')]({'membername':_0xcade4f[_0x190b('0x36')],'UserId':_0xcade4f['id'],'queue_name':_0x1778fa[_0x190b('0x36')],'VoiceQueueId':_0x1778fa['id'],'interface':_[_0x190b('0x7d')](_0xcade4f[_0x190b('0x73')])?util[_0x190b('0x7e')](_0x190b('0x7f'),_0xcade4f[_0x190b('0x36')]):_0xcade4f[_0x190b('0x73')],'paused':_0xcade4f[_0x190b('0x72')]||![],'penalty':_0xcade4f[_0x190b('0x79')]},{'transaction':_0x4f1298});});})['then'](function(){_0x334951[_0x190b('0x80')](function(_0x5a898c){socket[_0x190b('0x81')](_0x190b('0x82'),{'UserId':_0x5a898c['id'],'VoiceQueueId':_0x1778fa['id']});});});});});}})[_0x190b('0x35')](respondWithStatusCode(_0x31324b,null))[_0x190b('0x4c')](handleError(_0x31324b,null));};exports[_0x190b('0x83')]=function(_0x392b97,_0x2608b4,_0x516d1f){return db[_0x190b('0x6f')]['findAll']({'where':{'id':_0x392b97[_0x190b('0x3d')]['ids']},'attributes':['id'],'include':[{'model':db[_0x190b('0x70')],'as':_0x190b('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2608b4,null))['then'](function(_0x17d900){var _0x460e5e=_['map'](_0x17d900,'id');var _0x342d34=[];var _0x285f32=[];var _0x1e4eff=squel['select']();_0x1e4eff[_0x190b('0x84')](_0x190b('0x85'))[_0x190b('0x86')]('team_has_voice_queues','tq')[_0x190b('0x87')](_0x190b('0x88'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x190b('0x44')]('VoiceQueueId\x20=\x20?',_0x392b97[_0x190b('0x4d')]['id']);for(var _0xdbb770=0x0;_0xdbb770<_0x17d900['length'];_0xdbb770+=0x1){let _0x486a3d=_0x17d900[_0xdbb770];for(var _0x4fa226=0x0;_0x4fa226<_0x486a3d['Agents'][_0x190b('0x41')];_0x4fa226+=0x1){let _0x1e3f49=_0x486a3d[_0x190b('0x71')][_0x4fa226];var _0x513686=_0x1e4eff[_0x190b('0x5b')]();_0x513686[_0x190b('0x44')](_0x190b('0x89'),_0x1e3f49['id']);_0x285f32[_0x190b('0x8a')](db['sequelize'][_0x190b('0x3d')](_0x513686['toString'](),{'type':db[_0x190b('0x8b')]['QueryTypes'][_0x190b('0x8c')]})['then'](function(_0x5e208d){if(_0x5e208d['length']===0x1){return _0x1e3f49['id'];}else{var _0x43b875=_['every'](_[_0x190b('0x68')](_0x5e208d,_0x190b('0x8d')),function(_0xd7f0b){return _[_0x190b('0x31')](_0x460e5e,_0xd7f0b);});if(_0x43b875){return _0x1e3f49['id'];}}}));}}return BPromise[_0x190b('0x8e')](_0x285f32)[_0x190b('0x35')](function(_0xee7a47){_0x342d34=_(_0x342d34)[_0x190b('0x8f')](_0xee7a47)[_0x190b('0x90')]()[_0x190b('0x30')]();return db['VoiceQueue'][_0x190b('0x33')]({'where':{'id':_0x392b97[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](function(_0x58c6bb){return db[_0x190b('0x8b')][_0x190b('0x74')](function(_0x2ef95d){return _0x58c6bb[_0x190b('0x83')](_0x392b97[_0x190b('0x3d')][_0x190b('0x91')],{'transaction':_0x2ef95d})[_0x190b('0x35')](function(){if(!_[_0x190b('0x92')](_0x342d34)){return _0x58c6bb['removeAgents'](_0x342d34,{'transaction':_0x2ef95d})[_0x190b('0x35')](function(){return db[_0x190b('0x7c')][_0x190b('0x2a')]({'where':{'VoiceQueueId':_0x392b97['params']['id'],'UserId':_0x342d34},'transaction':_0x2ef95d});});}})[_0x190b('0x35')](function(){_0x342d34['forEach'](function(_0x33f1b7){socket[_0x190b('0x81')](_0x190b('0x93'),{'UserId':_0x33f1b7,'VoiceQueueId':_0x58c6bb['id']});});});});});});})[_0x190b('0x35')](respondWithStatusCode(_0x2608b4,null))[_0x190b('0x4c')](handleError(_0x2608b4,null));};exports[_0x190b('0x94')]=function(_0x175aa0,_0xddfcc6,_0x26315c){var _0x540607,_0xc9b571;return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x175aa0['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0xddfcc6,null))[_0x190b('0x35')](function(_0x22ab63){if(_0x22ab63){_0xc9b571=_0x22ab63;return _0x22ab63[_0x190b('0x94')](_0x175aa0['body'][_0x190b('0x91')],_[_0x190b('0x5c')](_0x175aa0[_0x190b('0x52')],['ids','id'])||{})[_0x190b('0x95')](function(_0x29a224){for(var _0x4456a4=0x0;_0x4456a4<_0x175aa0[_0x190b('0x52')][_0x190b('0x91')][_0x190b('0x41')];_0x4456a4+=0x1){socket['emit'](_0x190b('0x82'),{'UserId':Number(_0x175aa0[_0x190b('0x52')][_0x190b('0x91')][_0x4456a4]),'VoiceQueueId':Number(_0x175aa0[_0x190b('0x4d')]['id'])});}return _0x29a224;});}})[_0x190b('0x35')](function(_0x3cf04b){_0x540607=_0x3cf04b||[];if(_0xc9b571){return db[_0x190b('0x70')][_0x190b('0x4a')]({'where':{'id':_0x175aa0[_0x190b('0x52')][_0x190b('0x91')]},'attributes':['id',_0x190b('0x36'),_0x190b('0x96'),_0x190b('0x72'),_0x190b('0x73')],'raw':!![]});}})[_0x190b('0x35')](function(_0x54d464){if(!_[_0x190b('0x92')](_0x54d464)){var _0xfa9e7c=[];for(var _0x51b729=0x0;_0x51b729<_0x54d464['length'];_0x51b729++){if(_0x54d464[_0x51b729][_0x190b('0x96')]){_0xfa9e7c[_0x190b('0x8a')](db[_0x190b('0x7c')][_0x190b('0x78')]({'membername':_0x54d464[_0x51b729][_0x190b('0x36')],'UserId':_0x54d464[_0x51b729]['id'],'queue_name':_0xc9b571['name'],'VoiceQueueId':_0xc9b571['id'],'interface':_['isNil'](_0x54d464[_0x51b729][_0x190b('0x73')])?util['format'](_0x190b('0x7f'),_0x54d464[_0x51b729]['name']):_0x54d464[_0x51b729][_0x190b('0x73')],'paused':_0x54d464[_0x51b729][_0x190b('0x72')]||![],'penalty':_0x175aa0['body'][_0x190b('0x79')]||0x0}));}}return BPromise[_0x190b('0x8e')](_0xfa9e7c);}})[_0x190b('0x35')](function(){return _0x540607;})[_0x190b('0x35')](respondWithResult(_0xddfcc6,null))[_0x190b('0x4c')](handleError(_0xddfcc6,null));};exports['removeAgents']=function(_0x33b427,_0x523599,_0x5ce0a9){return db['VoiceQueue']['find']({'where':{'id':_0x33b427[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x523599,null))[_0x190b('0x35')](function(_0x221a9a){if(_0x221a9a){return _0x221a9a[_0x190b('0x97')](_0x33b427['query'][_0x190b('0x91')])['then'](function(){if(_['isArray'](_0x33b427[_0x190b('0x3d')][_0x190b('0x91')])){for(var _0x19e1f4=0x0;_0x19e1f4<_0x33b427[_0x190b('0x3d')][_0x190b('0x91')][_0x190b('0x41')];_0x19e1f4+=0x1){socket[_0x190b('0x81')](_0x190b('0x93'),{'UserId':Number(_0x33b427[_0x190b('0x3d')]['ids'][_0x19e1f4]),'VoiceQueueId':Number(_0x33b427['params']['id'])});}}else{socket[_0x190b('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x33b427[_0x190b('0x3d')]['ids']),'VoiceQueueId':Number(_0x33b427[_0x190b('0x4d')]['id'])});}});}})[_0x190b('0x35')](function(_0x912e45){return db[_0x190b('0x7c')]['destroy']({'where':{'VoiceQueueId':_0x33b427['params']['id'],'UserId':_0x33b427['query']['ids']}})['then'](function(){return _0x912e45;});})[_0x190b('0x35')](respondWithStatusCode(_0x523599,null))[_0x190b('0x4c')](handleError(_0x523599,null));};exports[_0x190b('0x98')]=function(_0x48d8c5,_0x40d764,_0xf56c0f){var _0x480b38={};var _0x14ea6e={};var _0x2e997e;var _0x18e528;return db[_0x190b('0x39')][_0x190b('0x61')]({'where':{'id':_0x48d8c5['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x40d764,null))[_0x190b('0x35')](function(_0x23cd43){if(_0x23cd43){_0x2e997e=_0x23cd43;_0x14ea6e[_0x190b('0x3c')]=_[_0x190b('0x4e')](db[_0x190b('0x70')][_0x190b('0x3a')]);_0x14ea6e[_0x190b('0x3d')]=_[_0x190b('0x4e')](_0x48d8c5[_0x190b('0x3d')]);_0x14ea6e[_0x190b('0x3e')]=_['intersection'](_0x14ea6e[_0x190b('0x3c')],_0x14ea6e[_0x190b('0x3d')]);_0x480b38[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x14ea6e[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x48d8c5[_0x190b('0x3d')][_0x190b('0x40')]));_0x480b38[_0x190b('0x3f')]=_0x480b38['attributes'][_0x190b('0x41')]?_0x480b38['attributes']:_0x14ea6e[_0x190b('0x3c')];_0x480b38['order']=qs[_0x190b('0x63')](_0x48d8c5['query']['sort']);_0x480b38[_0x190b('0x44')]=qs[_0x190b('0x3e')](_['pick'](_0x48d8c5[_0x190b('0x3d')],_0x14ea6e['filters']));if(_0x48d8c5['query'][_0x190b('0x2f')]){_0x480b38[_0x190b('0x44')]=_[_0x190b('0x46')](_0x480b38[_0x190b('0x44')],{'$or':_['map'](_0x480b38[_0x190b('0x3f')],function(_0x28ab42){var _0x3cc31c={};_0x3cc31c[_0x28ab42]={'$like':'%'+_0x48d8c5[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x3cc31c;})});}_0x480b38=_[_0x190b('0x46')]({},_0x480b38,_0x48d8c5[_0x190b('0x50')]);return _0x2e997e[_0x190b('0x98')](_0x480b38);}})[_0x190b('0x35')](function(_0x3a33f8){if(_0x3a33f8){_0x18e528=_0x3a33f8[_0x190b('0x41')];if(!_0x48d8c5[_0x190b('0x3d')]['hasOwnProperty']('nolimit')){_0x480b38['limit']=qs[_0x190b('0x23')](_0x48d8c5[_0x190b('0x3d')][_0x190b('0x23')]);_0x480b38[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x48d8c5[_0x190b('0x3d')][_0x190b('0x22')]);}return _0x2e997e[_0x190b('0x98')](_0x480b38);}})[_0x190b('0x35')](function(_0x1ef815){if(_0x1ef815){return _0x1ef815?{'count':_0x18e528,'rows':_0x1ef815}:null;}})[_0x190b('0x35')](respondWithResult(_0x40d764,null))['catch'](handleError(_0x40d764,null));};exports[_0x190b('0x99')]=function(_0x10caf8,_0x2a0434,_0x6b4608){var _0x2f6a03={};var _0x2f3007={};var _0x203bd2;var _0x3adcb5;return db[_0x190b('0x39')][_0x190b('0x61')]({'where':{'id':_0x10caf8['params']['id']}})['then'](handleEntityNotFound(_0x2a0434,null))['then'](function(_0x19c595){if(_0x19c595){_0x203bd2=_0x19c595;_0x2f3007[_0x190b('0x3c')]=_['keys'](db[_0x190b('0x7c')][_0x190b('0x3a')]);_0x2f3007[_0x190b('0x3d')]=_['keys'](_0x10caf8['query']);_0x2f3007['filters']=_[_0x190b('0x4f')](_0x2f3007[_0x190b('0x3c')],_0x2f3007['query']);_0x2f6a03[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x2f3007[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x10caf8[_0x190b('0x3d')][_0x190b('0x40')]));_0x2f6a03[_0x190b('0x3f')]=_0x2f6a03['attributes'][_0x190b('0x41')]?_0x2f6a03[_0x190b('0x3f')]:_0x2f3007[_0x190b('0x3c')];_0x2f6a03[_0x190b('0x43')]=qs[_0x190b('0x63')](_0x10caf8[_0x190b('0x3d')][_0x190b('0x63')]);_0x2f6a03['where']=qs[_0x190b('0x3e')](_['pick'](_0x10caf8['query'],_0x2f3007['filters']));if(_0x10caf8[_0x190b('0x3d')][_0x190b('0x2f')]){_0x2f6a03[_0x190b('0x44')]=_[_0x190b('0x46')](_0x2f6a03[_0x190b('0x44')],{'$or':_[_0x190b('0x68')](_0x2f6a03[_0x190b('0x3f')],function(_0x4be962){var _0x25fc8a={};_0x25fc8a[_0x4be962]={'$like':'%'+_0x10caf8[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x25fc8a;})});}_0x2f6a03=_[_0x190b('0x46')]({},_0x2f6a03,_0x10caf8[_0x190b('0x50')]);return _0x203bd2[_0x190b('0x99')](_0x2f6a03);}})[_0x190b('0x35')](function(_0x3e81b6){if(_0x3e81b6){_0x3adcb5=_0x3e81b6[_0x190b('0x41')];if(!_0x10caf8[_0x190b('0x3d')][_0x190b('0x62')](_0x190b('0x42'))){_0x2f6a03[_0x190b('0x23')]=qs['limit'](_0x10caf8[_0x190b('0x3d')][_0x190b('0x23')]);_0x2f6a03[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x10caf8[_0x190b('0x3d')][_0x190b('0x22')]);}return _0x203bd2[_0x190b('0x99')](_0x2f6a03);}})[_0x190b('0x35')](function(_0x51ea35){return _0x51ea35?{'count':_0x3adcb5,'rows':_0x51ea35}:null;})[_0x190b('0x35')](respondWithResult(_0x2a0434,null))[_0x190b('0x4c')](handleError(_0x2a0434,null));};exports[_0x190b('0x9a')]=function(_0x28db86,_0xb4194f,_0x2651f8){var _0x1f2611={};var _0x30873={};var _0xdd86c8;var _0x233011;return db[_0x190b('0x39')][_0x190b('0x61')]({'where':{'id':_0x28db86['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0xb4194f,null))[_0x190b('0x35')](function(_0x14d30b){if(_0x14d30b){_0xdd86c8=_0x14d30b;_0x30873[_0x190b('0x3c')]=_['keys'](db[_0x190b('0x9b')]['rawAttributes']);_0x30873['query']=_[_0x190b('0x4e')](_0x28db86['query']);_0x30873['filters']=_['intersection'](_0x30873[_0x190b('0x3c')],_0x30873['query']);_0x1f2611[_0x190b('0x3f')]=_[_0x190b('0x4f')](_0x30873[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x28db86[_0x190b('0x3d')][_0x190b('0x40')]));_0x1f2611[_0x190b('0x3f')]=_0x1f2611['attributes'][_0x190b('0x41')]?_0x1f2611['attributes']:_0x30873[_0x190b('0x3c')];_0x1f2611[_0x190b('0x43')]=qs[_0x190b('0x63')](_0x28db86[_0x190b('0x3d')]['sort']);_0x1f2611[_0x190b('0x44')]=qs[_0x190b('0x3e')](_[_0x190b('0x45')](_0x28db86[_0x190b('0x3d')],_0x30873[_0x190b('0x3e')]));if(_0x28db86[_0x190b('0x3d')][_0x190b('0x2f')]){_0x1f2611[_0x190b('0x44')]=_[_0x190b('0x46')](_0x1f2611['where'],{'$or':_[_0x190b('0x68')](_0x1f2611['attributes'],function(_0x3ee3a0){var _0x3cc438={};_0x3cc438[_0x3ee3a0]={'$like':'%'+_0x28db86[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x3cc438;})});}_0x1f2611=_[_0x190b('0x46')]({},_0x1f2611,_0x28db86[_0x190b('0x50')]);return _0xdd86c8[_0x190b('0x9a')](_0x1f2611);}})[_0x190b('0x35')](function(_0x4222ff){if(_0x4222ff){_0x233011=_0x4222ff['length'];if(!_0x28db86[_0x190b('0x3d')][_0x190b('0x62')](_0x190b('0x42'))){_0x1f2611['limit']=qs[_0x190b('0x23')](_0x28db86[_0x190b('0x3d')][_0x190b('0x23')]);_0x1f2611[_0x190b('0x22')]=qs['offset'](_0x28db86['query'][_0x190b('0x22')]);}return _0xdd86c8['getLists'](_0x1f2611);}})['then'](function(_0x39422b){if(_0x39422b){return _0x39422b?{'count':_0x233011,'rows':_0x39422b}:null;}})['then'](respondWithResult(_0xb4194f,null))['catch'](handleError(_0xb4194f,null));};exports[_0x190b('0x9c')]=function(_0x1fdda7,_0x8d6539,_0x3c2992){var _0x37b80d=moment()[_0x190b('0x7e')](_0x190b('0x9d'));var _0xf7fed4,_0x5e6d36;return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x1fdda7[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x8d6539,null))[_0x190b('0x35')](function(_0x7e09bc){if(_0x7e09bc){_0x5e6d36=_0x7e09bc;return _0x7e09bc[_0x190b('0x9c')](_0x1fdda7[_0x190b('0x52')]['ids'],_[_0x190b('0x5c')](_0x1fdda7[_0x190b('0x52')],[_0x190b('0x91'),'id'])||{});}return null;})['spread'](function(_0x4d05de){var _0x16ea9f;_0xf7fed4=_0x4d05de||[];var _0x5b710e=[];if(_0x4d05de){for(var _0x35e2cd=0x0;_0x35e2cd<_0x4d05de[_0x190b('0x41')];_0x35e2cd+=0x1){var _0x102e37=_0x4d05de[_0x35e2cd][_0x190b('0x2b')]({'plain':!![]});_0x5e6d36[_0x190b('0x9e')]=_0x1fdda7[_0x190b('0x52')][_0x190b('0x9e')]?_0x1fdda7['body'][_0x190b('0x9e')]:_0x5e6d36[_0x190b('0x9e')];switch(_0x5e6d36[_0x190b('0x9e')]){case'always':_0x16ea9f=squel[_0x190b('0x9f')]()[_0x190b('0xa0')]('cm_hopper')[_0x190b('0xa1')]([_0x190b('0xa2'),_0x190b('0xa3'),_0x190b('0xa4'),_0x190b('0xa5'),_0x190b('0x64'),'createdAt',_0x190b('0x5e')],squel[_0x190b('0xa6')]()[_0x190b('0x84')]('phone',_0x190b('0xa2'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0xa3'))[_0x190b('0x84')]('id','ContactId')[_0x190b('0x84')](_0x102e37['CmListId'][_0x190b('0xa7')](),_0x190b('0xa5'))[_0x190b('0x84')](_0x1fdda7['params']['id'][_0x190b('0xa7')](),'VoiceQueueId')[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5d'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27','updatedAt')[_0x190b('0x86')](_0x190b('0xa8'))[_0x190b('0x44')](_0x190b('0xa9'))[_0x190b('0x44')](_0x190b('0xaa'),_0x102e37[_0x190b('0xab')][_0x190b('0xa7')]())['where'](_0x190b('0xac'))[_0x190b('0x44')](_0x190b('0xad'),squel[_0x190b('0xa6')]()[_0x190b('0x84')](_0x190b('0xae'))[_0x190b('0x86')](_0x190b('0xaf'))[_0x190b('0x44')](_0x190b('0xb0'),_0x1fdda7[_0x190b('0x4d')]['id'][_0x190b('0xa7')]()))[_0x190b('0x44')](_0x190b('0xad'),squel['select']()['field'](_0x190b('0xb1'))[_0x190b('0x86')]('cm_hopper')[_0x190b('0x44')](_0x190b('0xb0'),_0x1fdda7[_0x190b('0x4d')]['id'][_0x190b('0xa7')]())))[_0x190b('0xa7')]();break;case _0x190b('0xb2'):_0x16ea9f=squel[_0x190b('0x9f')]()[_0x190b('0xa0')]('cm_hopper')[_0x190b('0xa1')]([_0x190b('0xa2'),_0x190b('0xa3'),_0x190b('0xa4'),'ListId',_0x190b('0x64'),_0x190b('0x5d'),_0x190b('0x5e')],squel[_0x190b('0xa6')]()[_0x190b('0x84')]('phone',_0x190b('0xa2'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27','scheduledAt')['field']('id',_0x190b('0xa4'))['field'](_0x102e37['CmListId'][_0x190b('0xa7')](),_0x190b('0xa5'))[_0x190b('0x84')](_0x1fdda7['params']['id'][_0x190b('0xa7')](),'VoiceQueueId')[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5d'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5e'))[_0x190b('0x86')](_0x190b('0xa8'))['where'](_0x190b('0xa9'))[_0x190b('0x44')](_0x190b('0xaa'),_0x102e37['CmListId'][_0x190b('0xa7')]())['where'](_0x190b('0xac'))[_0x190b('0x44')](_0x190b('0xad'),squel['select']()[_0x190b('0x84')](_0x190b('0xb1'))[_0x190b('0x86')]('cm_hopper')[_0x190b('0x44')](_0x190b('0xb0'),_0x1fdda7['params']['id'][_0x190b('0xa7')]())))[_0x190b('0xa7')]();break;default:_0x16ea9f=squel[_0x190b('0x9f')]()[_0x190b('0xa0')](_0x190b('0xb3'))[_0x190b('0xa1')](['phone','scheduledAt','ContactId',_0x190b('0xa5'),_0x190b('0x64'),_0x190b('0x5d'),_0x190b('0x5e')],squel['select']()[_0x190b('0x84')](_0x190b('0xa2'),_0x190b('0xa2'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0xa3'))[_0x190b('0x84')]('id','ContactId')[_0x190b('0x84')](_0x102e37['CmListId']['toString'](),_0x190b('0xa5'))[_0x190b('0x84')](_0x1fdda7[_0x190b('0x4d')]['id'][_0x190b('0xa7')](),_0x190b('0x64'))['field']('\x27'+_0x37b80d+'\x27',_0x190b('0x5d'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5e'))[_0x190b('0x86')](_0x190b('0xa8'))[_0x190b('0x44')]('deletedAt\x20IS\x20NULL')['where'](_0x190b('0xaa'),_0x102e37['CmListId'][_0x190b('0xa7')]())[_0x190b('0x44')](_0x190b('0xac')))[_0x190b('0xa7')]();}_0x5b710e[_0x190b('0x8a')](db[_0x190b('0x8b')]['query'](_0x16ea9f));}return BPromise[_0x190b('0x8e')](_0x5b710e);}})['then'](function(){var _0x11f5a4=[];var _0x261183=squel['insert']()[_0x190b('0xa0')](_0x190b('0xb4'))['fromQuery']([_0x190b('0xb5'),_0x190b('0xa2'),'OrderBy',_0x190b('0x5d'),_0x190b('0x5e')],squel[_0x190b('0xa6')]()[_0x190b('0x84')](_0x190b('0xb6'))[_0x190b('0x84')]('ci.item')[_0x190b('0x84')](_0x190b('0xb7'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5d'))[_0x190b('0x84')]('\x27'+_0x37b80d+'\x27',_0x190b('0x5e'))[_0x190b('0x86')]('cm_contact_has_items','ci')[_0x190b('0x87')](_0x190b('0xb3'),'h','h.ContactId=ci.CmContactId')[_0x190b('0x44')](_0x190b('0xb8'),_0x37b80d)[_0x190b('0x44')](_0x190b('0xb9'),_0x190b('0xba')))[_0x190b('0xa7')]();_0x11f5a4['push'](db[_0x190b('0x8b')][_0x190b('0x3d')](_0x261183));return BPromise[_0x190b('0x8e')](_0x11f5a4);})[_0x190b('0x35')](function(){return _0xf7fed4;})[_0x190b('0x35')](respondWithResult(_0x8d6539,null))[_0x190b('0x4c')](handleError(_0x8d6539,null));};exports[_0x190b('0xbb')]=function(_0xa0c218,_0x1e7340,_0xde3a51){return db[_0x190b('0x39')]['find']({'where':{'id':_0xa0c218['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x1e7340,null))[_0x190b('0x35')](function(_0x5926e0){if(_0x5926e0){return _0x5926e0['removeLists'](_0xa0c218['query'][_0x190b('0x91')]);}})['then'](function(_0x483182){if(_0x483182){return db[_0x190b('0x65')]['destroy']({'where':{'ListId':_0xa0c218[_0x190b('0x3d')][_0x190b('0x91')],'VoiceQueueId':_0xa0c218[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](function(){return _0x483182;});}})['then'](respondWithStatusCode(_0x1e7340,null))[_0x190b('0x4c')](handleError(_0x1e7340,null));};exports[_0x190b('0xbc')]=function(_0x265e92,_0x5c5cf8,_0x4a3604){var _0x5be950={};var _0x1c2cfb={};var _0x53181d;var _0x15a0c8;return db[_0x190b('0x39')][_0x190b('0x61')]({'where':{'id':_0x265e92[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x5c5cf8,null))[_0x190b('0x35')](function(_0x249dc2){if(_0x249dc2){_0x53181d=_0x249dc2;_0x1c2cfb[_0x190b('0x3c')]=_[_0x190b('0x4e')](db['CmList']['rawAttributes']);_0x1c2cfb[_0x190b('0x3d')]=_['keys'](_0x265e92[_0x190b('0x3d')]);_0x1c2cfb[_0x190b('0x3e')]=_[_0x190b('0x4f')](_0x1c2cfb[_0x190b('0x3c')],_0x1c2cfb['query']);_0x5be950['attributes']=_[_0x190b('0x4f')](_0x1c2cfb[_0x190b('0x3c')],qs[_0x190b('0x40')](_0x265e92['query']['fields']));_0x5be950[_0x190b('0x3f')]=_0x5be950[_0x190b('0x3f')][_0x190b('0x41')]?_0x5be950[_0x190b('0x3f')]:_0x1c2cfb[_0x190b('0x3c')];_0x5be950[_0x190b('0x43')]=qs[_0x190b('0x63')](_0x265e92[_0x190b('0x3d')][_0x190b('0x63')]);_0x5be950['where']=qs[_0x190b('0x3e')](_[_0x190b('0x45')](_0x265e92['query'],_0x1c2cfb[_0x190b('0x3e')]));if(_0x265e92[_0x190b('0x3d')][_0x190b('0x2f')]){_0x5be950[_0x190b('0x44')]=_[_0x190b('0x46')](_0x5be950['where'],{'$or':_[_0x190b('0x68')](_0x5be950['attributes'],function(_0x4336b7){var _0x1b4773={};_0x1b4773[_0x4336b7]={'$like':'%'+_0x265e92[_0x190b('0x3d')][_0x190b('0x2f')]+'%'};return _0x1b4773;})});}_0x5be950=_[_0x190b('0x46')]({},_0x5be950,_0x265e92['options']);return _0x53181d[_0x190b('0xbc')](_0x5be950);}})[_0x190b('0x35')](function(_0x13ef86){if(_0x13ef86){_0x15a0c8=_0x13ef86[_0x190b('0x41')];if(!_0x265e92['query'][_0x190b('0x62')](_0x190b('0x42'))){_0x5be950[_0x190b('0x23')]=qs[_0x190b('0x23')](_0x265e92[_0x190b('0x3d')][_0x190b('0x23')]);_0x5be950[_0x190b('0x22')]=qs[_0x190b('0x22')](_0x265e92[_0x190b('0x3d')][_0x190b('0x22')]);}return _0x53181d[_0x190b('0xbc')](_0x5be950);}})[_0x190b('0x35')](function(_0x222dd7){if(_0x222dd7){return _0x222dd7?{'count':_0x15a0c8,'rows':_0x222dd7}:null;}})[_0x190b('0x35')](respondWithResult(_0x5c5cf8,null))['catch'](handleError(_0x5c5cf8,null));};exports[_0x190b('0xbd')]=function(_0x180c45,_0x53e4d4,_0x97a80f){var _0xa8c2bb,_0x139176;return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x180c45[_0x190b('0x4d')]['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x53e4d4,null))[_0x190b('0x35')](function(_0x43a1e4){if(_0x43a1e4){_0x139176=_0x43a1e4;return _0x43a1e4[_0x190b('0xbd')](_0x180c45['body']['ids'],_[_0x190b('0x5c')](_0x180c45[_0x190b('0x52')],[_0x190b('0x91'),'id'])||{});}return null;})['spread'](function(_0x2ad5ee){var _0xaea189;_0xa8c2bb=_0x2ad5ee||[];var _0xc0bdd8=[];if(_0x2ad5ee){for(var _0xaee543=0x0;_0xaee543<_0x2ad5ee[_0x190b('0x41')];_0xaee543+=0x1){var _0x21dd05=_0x2ad5ee[_0xaee543][_0x190b('0x2b')]({'plain':!![]});_0xaea189=squel[_0x190b('0x9f')]()[_0x190b('0xa0')]('cm_hopper_black')[_0x190b('0xa1')](['phone','ContactId',_0x190b('0xa5'),_0x190b('0x64'),_0x190b('0x5d'),_0x190b('0x5e')],squel['select']()[_0x190b('0x84')](_0x190b('0xa2'),_0x190b('0xa2'))['field']('id',_0x190b('0xa4'))['field'](_0x21dd05[_0x190b('0xab')]['toString'](),_0x190b('0xa5'))[_0x190b('0x84')](_0x180c45[_0x190b('0x4d')]['id']['toString'](),'VoiceQueueId')[_0x190b('0x84')](_0x190b('0xbe'),_0x190b('0x5d'))['field'](_0x190b('0xbe'),_0x190b('0x5e'))['from'](_0x190b('0xa8'))[_0x190b('0x44')](_0x190b('0xa9'))[_0x190b('0x44')](_0x190b('0xaa'),_0x21dd05[_0x190b('0xab')][_0x190b('0xa7')]())['where'](_0x190b('0xac')))[_0x190b('0xa7')]();_0xc0bdd8[_0x190b('0x8a')](db[_0x190b('0x8b')][_0x190b('0x3d')](_0xaea189));}return BPromise['all'](_0xc0bdd8);}})[_0x190b('0x35')](function(){return _0xa8c2bb;})[_0x190b('0x35')](respondWithResult(_0x53e4d4,null))['catch'](handleError(_0x53e4d4,null));};exports['removeBlackLists']=function(_0x1f81a9,_0x12ba00,_0x5926a6){return db[_0x190b('0x39')][_0x190b('0x33')]({'where':{'id':_0x1f81a9['params']['id']}})[_0x190b('0x35')](handleEntityNotFound(_0x12ba00,null))[_0x190b('0x35')](function(_0x1c1e49){if(_0x1c1e49){return _0x1c1e49['removeBlackLists'](_0x1f81a9[_0x190b('0x3d')]['ids']);}})[_0x190b('0x35')](function(_0xcb9112){if(_0xcb9112){return db[_0x190b('0x6c')][_0x190b('0x2a')]({'where':{'ListId':_0x1f81a9[_0x190b('0x3d')][_0x190b('0x91')],'VoiceQueueId':_0x1f81a9[_0x190b('0x4d')]['id']}})['then'](function(){return _0xcb9112;});}})[_0x190b('0x35')](respondWithStatusCode(_0x12ba00,null))['catch'](handleError(_0x12ba00,null));};
\ No newline at end of file
index 4fbdfef..fc32aac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc62a=['events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc62a,0x1e4));var _0xac62=function(_0xdb0de9,_0x93eee6){_0xdb0de9=_0xdb0de9-0x0;var _0x3eede2=_0xc62a[_0xdb0de9];return _0x3eede2;};'use strict';var EventEmitter=require(_0xac62('0x0'));var VoiceQueue=require(_0xac62('0x1'))['db'][_0xac62('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xac62('0x3')](0x0);var events={'afterCreate':_0xac62('0x4'),'afterUpdate':_0xac62('0x5'),'afterDestroy':_0xac62('0x6')};function emitEvent(_0x265310){return function(_0x3041f9,_0x567d9a,_0x11905e){VoiceQueueEvents['emit'](_0x265310+':'+_0x3041f9['id'],_0x3041f9);VoiceQueueEvents[_0xac62('0x7')](_0x265310,_0x3041f9);_0x11905e(null);};}for(var e in events){if(events[_0xac62('0x8')](e)){var event=events[e];VoiceQueue[_0xac62('0x9')](e,emitEvent(event));}}module[_0xac62('0xa')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xa91d=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','hasOwnProperty'];(function(_0x312e3b,_0x3afd66){var _0x28a470=function(_0x3bdc23){while(--_0x3bdc23){_0x312e3b['push'](_0x312e3b['shift']());}};_0x28a470(++_0x3afd66);}(_0xa91d,0x162));var _0xda91=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa91d[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xda91('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xda91('0x1')](0x0);var events={'afterCreate':_0xda91('0x2'),'afterUpdate':_0xda91('0x3'),'afterDestroy':_0xda91('0x4')};function emitEvent(_0x247ec0){return function(_0x5d6976,_0x5a01bf,_0x258a54){VoiceQueueEvents['emit'](_0x247ec0+':'+_0x5d6976['id'],_0x5d6976);VoiceQueueEvents['emit'](_0x247ec0,_0x5d6976);_0x258a54(null);};}for(var e in events){if(events[_0xda91('0x5')](e)){var event=events[e];VoiceQueue[_0xda91('0x6')](e,emitEvent(event));}}module[_0xda91('0x7')]=VoiceQueueEvents;
\ No newline at end of file
index 1538025..99e7058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x41642e,_0x97f901){var _0x39ec15=function(_0x2056b9){while(--_0x2056b9){_0x41642e['push'](_0x41642e['shift']());}};_0x39ec15(++_0x97f901);}(_0x70e0,0x17b));var _0x070e=function(_0x2f0cd7,_0x377139){_0x2f0cd7=_0x2f0cd7-0x0;var _0x5a9998=_0x70e0[_0x2f0cd7];return _0x5a9998;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x008c,0x188));var _0xc008=function(_0x47f395,_0x18a997){_0x47f395=_0x47f395-0x0;var _0x577a61=_0x008c[_0x47f395];return _0x577a61;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f4b01e7..7143feb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf191=['error','message','info','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','ShowVoiceQueue','find','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5ec599,_0x412c4b){var _0x4e2cd7=function(_0x157503){while(--_0x157503){_0x5ec599['push'](_0x5ec599['shift']());}};_0x4e2cd7(++_0x412c4b);}(_0xf191,0x179));var _0x1f19=function(_0x564e9f,_0x225a15){_0x564e9f=_0x564e9f-0x0;var _0x3a9f3e=_0xf191[_0x564e9f];return _0x3a9f3e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f19('0x0'));var BPromise=require(_0x1f19('0x1'));var rs=require(_0x1f19('0x2'));var fs=require('fs');var Redis=require(_0x1f19('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f19('0x4'));var logger=require('../../config/logger')(_0x1f19('0x5'));var config=require(_0x1f19('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1f19('0x7')][_0x1f19('0x8')]({'port':0x232a});config[_0x1f19('0x9')]=_['defaults'](config[_0x1f19('0x9')],{'host':_0x1f19('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1f19('0xb'))[_0x1f19('0xc')](socket);function respondWithRpcPromise(_0x5e6e78,_0xd069c4,_0x388298){return new BPromise(function(_0x18f2a7,_0x3281a5){return client['request'](_0x5e6e78,_0x388298)[_0x1f19('0xd')](function(_0x41ff60){logger['info'](_0x1f19('0xe'),_0xd069c4,_0x1f19('0xf'));logger[_0x1f19('0x10')](_0x1f19('0x11'),_0xd069c4,_0x1f19('0xf'),JSON[_0x1f19('0x12')](_0x41ff60));if(_0x41ff60['error']){if(_0x41ff60['error']['code']===0x1f4){logger['error'](_0x1f19('0xe'),_0xd069c4,_0x41ff60[_0x1f19('0x13')]['message']);return _0x3281a5(_0x41ff60[_0x1f19('0x13')][_0x1f19('0x14')]);}logger[_0x1f19('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xd069c4,_0x41ff60['error'][_0x1f19('0x14')]);return _0x18f2a7(_0x41ff60[_0x1f19('0x13')][_0x1f19('0x14')]);}else{logger[_0x1f19('0x15')]('VoiceQueue,\x20%s,\x20%s',_0xd069c4,_0x1f19('0xf'));_0x18f2a7(_0x41ff60[_0x1f19('0x16')]['message']);}})[_0x1f19('0x17')](function(_0x148d93){logger[_0x1f19('0x13')]('VoiceQueue,\x20%s,\x20%s',_0xd069c4,_0x148d93);_0x3281a5(_0x148d93);});});}exports[_0x1f19('0x18')]=function(_0x556436){var _0x3b4633=this;return new Promise(function(_0x3fe67b,_0x500f57){return db[_0x1f19('0x19')]['findAll']({'raw':_0x556436[_0x1f19('0x1a')]?_0x556436[_0x1f19('0x1a')][_0x1f19('0x1b')]===undefined?!![]:![]:!![],'where':_0x556436['options']?_0x556436[_0x1f19('0x1a')][_0x1f19('0x1c')]||null:null,'attributes':_0x556436[_0x1f19('0x1a')]?_0x556436['options'][_0x1f19('0x1d')]||null:null,'limit':_0x556436[_0x1f19('0x1a')]?_0x556436['options'][_0x1f19('0x1e')]||null:null,'include':_0x556436['options']?_0x556436[_0x1f19('0x1a')][_0x1f19('0x1f')]?_[_0x1f19('0x20')](_0x556436[_0x1f19('0x1a')][_0x1f19('0x1f')],function(_0x519170){return{'model':db[_0x519170[_0x1f19('0x21')]],'as':_0x519170['as'],'attributes':_0x519170['attributes'],'include':_0x519170[_0x1f19('0x1f')]?_[_0x1f19('0x20')](_0x519170[_0x1f19('0x1f')],function(_0x23971b){return{'model':db[_0x23971b[_0x1f19('0x21')]],'as':_0x23971b['as'],'attributes':_0x23971b['attributes'],'include':_0x23971b[_0x1f19('0x1f')]?_[_0x1f19('0x20')](_0x23971b[_0x1f19('0x1f')],function(_0x569dbd){return{'model':db[_0x569dbd[_0x1f19('0x21')]],'as':_0x569dbd['as'],'attributes':_0x569dbd['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f19('0xd')](function(_0x3a4f78){logger[_0x1f19('0x15')](_0x1f19('0x18'),_0x556436);logger[_0x1f19('0x10')]('GetVoiceQueue',_0x556436,JSON['stringify'](_0x3a4f78));_0x3fe67b(_0x3a4f78);})['catch'](function(_0x2a99dd){logger[_0x1f19('0x13')](_0x1f19('0x18'),_0x2a99dd[_0x1f19('0x14')],_0x556436);_0x500f57(_0x3b4633['error'](0x1f4,_0x2a99dd[_0x1f19('0x14')]));});});};exports[_0x1f19('0x22')]=function(_0x476d06){var _0x471f0a=this;return new Promise(function(_0x1271f0,_0x5e7f8b){return db[_0x1f19('0x19')][_0x1f19('0x23')]({'raw':_0x476d06[_0x1f19('0x1a')]?_0x476d06['options'][_0x1f19('0x1b')]===undefined?!![]:![]:!![],'where':_0x476d06[_0x1f19('0x1a')]?_0x476d06['options'][_0x1f19('0x1c')]||null:null,'attributes':_0x476d06[_0x1f19('0x1a')]?_0x476d06[_0x1f19('0x1a')]['attributes']||null:null,'include':_0x476d06[_0x1f19('0x1a')]?_0x476d06[_0x1f19('0x1a')][_0x1f19('0x1f')]?_['map'](_0x476d06[_0x1f19('0x1a')][_0x1f19('0x1f')],function(_0x239464){return{'model':db[_0x239464['model']],'as':_0x239464['as'],'attributes':_0x239464['attributes'],'include':_0x239464[_0x1f19('0x1f')]?_['map'](_0x239464['include'],function(_0x47c2a5){return{'model':db[_0x47c2a5[_0x1f19('0x21')]],'as':_0x47c2a5['as'],'attributes':_0x47c2a5['attributes'],'include':_0x47c2a5[_0x1f19('0x1f')]?_[_0x1f19('0x20')](_0x47c2a5[_0x1f19('0x1f')],function(_0x4e6712){return{'model':db[_0x4e6712[_0x1f19('0x21')]],'as':_0x4e6712['as'],'attributes':_0x4e6712['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f19('0xd')](function(_0x5b954a){logger['info']('ShowVoiceQueue',_0x476d06);logger['debug'](_0x1f19('0x22'),_0x476d06,JSON[_0x1f19('0x12')](_0x5b954a));_0x1271f0(_0x5b954a);})['catch'](function(_0x3d7fa7){logger['error'](_0x1f19('0x22'),_0x3d7fa7[_0x1f19('0x14')],_0x476d06);_0x5e7f8b(_0x471f0a['error'](0x1f4,_0x3d7fa7[_0x1f19('0x14')]));});});};
\ No newline at end of file
+var _0x34a9=['debug','stringify','error','code','message','catch','GetVoiceQueue','findAll','options','where','attributes','limit','include','model','then','ShowVoiceQueue','VoiceQueue','map','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','request','info','VoiceQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x230e39,_0x5341){var _0xa804e=function(_0xe14796){while(--_0xe14796){_0x230e39['push'](_0x230e39['shift']());}};_0xa804e(++_0x5341);}(_0x34a9,0x144));var _0x934a=function(_0x4a9077,_0xe03e4){_0x4a9077=_0x4a9077-0x0;var _0x2395d0=_0x34a9[_0x4a9077];return _0x2395d0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x934a('0x0'));var BPromise=require(_0x934a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x934a('0x2'))['db'];var utils=require(_0x934a('0x3'));var logger=require(_0x934a('0x4'))('rpc');var config=require(_0x934a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x934a('0x6')][_0x934a('0x7')]({'port':0x232a});config[_0x934a('0x8')]=_[_0x934a('0x9')](config[_0x934a('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x934a('0xa'))(new Redis(config[_0x934a('0x8')]));require(_0x934a('0xb'))['register'](socket);function respondWithRpcPromise(_0x52087d,_0x52be11,_0x3680a8){return new BPromise(function(_0x142250,_0x2df4ea){return client[_0x934a('0xc')](_0x52087d,_0x3680a8)['then'](function(_0x28e08e){logger[_0x934a('0xd')](_0x934a('0xe'),_0x52be11,_0x934a('0xf'));logger[_0x934a('0x10')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x52be11,_0x934a('0xf'),JSON[_0x934a('0x11')](_0x28e08e));if(_0x28e08e['error']){if(_0x28e08e[_0x934a('0x12')][_0x934a('0x13')]===0x1f4){logger[_0x934a('0x12')](_0x934a('0xe'),_0x52be11,_0x28e08e[_0x934a('0x12')]['message']);return _0x2df4ea(_0x28e08e['error'][_0x934a('0x14')]);}logger[_0x934a('0x12')](_0x934a('0xe'),_0x52be11,_0x28e08e['error'][_0x934a('0x14')]);return _0x142250(_0x28e08e[_0x934a('0x12')]['message']);}else{logger[_0x934a('0xd')]('VoiceQueue,\x20%s,\x20%s',_0x52be11,'request\x20sent');_0x142250(_0x28e08e['result'][_0x934a('0x14')]);}})[_0x934a('0x15')](function(_0x51c25d){logger['error'](_0x934a('0xe'),_0x52be11,_0x51c25d);_0x2df4ea(_0x51c25d);});});}exports[_0x934a('0x16')]=function(_0x49208a){var _0x52c597=this;return new Promise(function(_0x37981b,_0x478a7e){return db['VoiceQueue'][_0x934a('0x17')]({'raw':_0x49208a['options']?_0x49208a['options']['raw']===undefined?!![]:![]:!![],'where':_0x49208a[_0x934a('0x18')]?_0x49208a[_0x934a('0x18')][_0x934a('0x19')]||null:null,'attributes':_0x49208a['options']?_0x49208a[_0x934a('0x18')][_0x934a('0x1a')]||null:null,'limit':_0x49208a[_0x934a('0x18')]?_0x49208a[_0x934a('0x18')][_0x934a('0x1b')]||null:null,'include':_0x49208a['options']?_0x49208a[_0x934a('0x18')]['include']?_['map'](_0x49208a[_0x934a('0x18')][_0x934a('0x1c')],function(_0x548d00){return{'model':db[_0x548d00[_0x934a('0x1d')]],'as':_0x548d00['as'],'attributes':_0x548d00[_0x934a('0x1a')],'include':_0x548d00['include']?_['map'](_0x548d00['include'],function(_0x2b815c){return{'model':db[_0x2b815c[_0x934a('0x1d')]],'as':_0x2b815c['as'],'attributes':_0x2b815c[_0x934a('0x1a')],'include':_0x2b815c['include']?_['map'](_0x2b815c[_0x934a('0x1c')],function(_0x58e9ec){return{'model':db[_0x58e9ec[_0x934a('0x1d')]],'as':_0x58e9ec['as'],'attributes':_0x58e9ec[_0x934a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x934a('0x1e')](function(_0x159c78){logger['info'](_0x934a('0x16'),_0x49208a);logger[_0x934a('0x10')](_0x934a('0x16'),_0x49208a,JSON[_0x934a('0x11')](_0x159c78));_0x37981b(_0x159c78);})[_0x934a('0x15')](function(_0x1f39d1){logger['error'](_0x934a('0x16'),_0x1f39d1['message'],_0x49208a);_0x478a7e(_0x52c597[_0x934a('0x12')](0x1f4,_0x1f39d1[_0x934a('0x14')]));});});};exports[_0x934a('0x1f')]=function(_0x1a4b19){var _0x47e733=this;return new Promise(function(_0x2fee6c,_0x2ef9d8){return db[_0x934a('0x20')]['find']({'raw':_0x1a4b19[_0x934a('0x18')]?_0x1a4b19[_0x934a('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1a4b19['options']?_0x1a4b19[_0x934a('0x18')][_0x934a('0x19')]||null:null,'attributes':_0x1a4b19[_0x934a('0x18')]?_0x1a4b19['options'][_0x934a('0x1a')]||null:null,'include':_0x1a4b19[_0x934a('0x18')]?_0x1a4b19[_0x934a('0x18')][_0x934a('0x1c')]?_['map'](_0x1a4b19[_0x934a('0x18')]['include'],function(_0x578063){return{'model':db[_0x578063[_0x934a('0x1d')]],'as':_0x578063['as'],'attributes':_0x578063[_0x934a('0x1a')],'include':_0x578063['include']?_[_0x934a('0x21')](_0x578063[_0x934a('0x1c')],function(_0x2d9768){return{'model':db[_0x2d9768['model']],'as':_0x2d9768['as'],'attributes':_0x2d9768[_0x934a('0x1a')],'include':_0x2d9768['include']?_['map'](_0x2d9768[_0x934a('0x1c')],function(_0x461e0f){return{'model':db[_0x461e0f[_0x934a('0x1d')]],'as':_0x461e0f['as'],'attributes':_0x461e0f[_0x934a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x934a('0x1e')](function(_0x36ec87){logger[_0x934a('0xd')](_0x934a('0x1f'),_0x1a4b19);logger[_0x934a('0x10')](_0x934a('0x1f'),_0x1a4b19,JSON['stringify'](_0x36ec87));_0x2fee6c(_0x36ec87);})[_0x934a('0x15')](function(_0x6ccae4){logger[_0x934a('0x12')](_0x934a('0x1f'),_0x6ccae4['message'],_0x1a4b19);_0x2ef9d8(_0x47e733[_0x934a('0x12')](0x1f4,_0x6ccae4[_0x934a('0x14')]));});});};
\ No newline at end of file
index 83c8d53..62e9633 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa348=['save','remove','update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events'];(function(_0x3c007e,_0x2e6adc){var _0x851f31=function(_0x12bf84){while(--_0x12bf84){_0x3c007e['push'](_0x3c007e['shift']());}};_0x851f31(++_0x2e6adc);}(_0xa348,0x1d3));var _0x8a34=function(_0x514dbb,_0x37a75f){_0x514dbb=_0x514dbb-0x0;var _0x1bed97=_0xa348[_0x514dbb];return _0x1bed97;};'use strict';var VoiceQueueEvents=require(_0x8a34('0x0'));var events=[_0x8a34('0x1'),_0x8a34('0x2'),_0x8a34('0x3')];function createListener(_0x3bbeb8,_0x39bd0e){return function(_0x5d8124){_0x39bd0e[_0x8a34('0x4')](_0x3bbeb8,_0x5d8124);};}function removeListener(_0xaf12b2,_0x1fc932){return function(){VoiceQueueEvents[_0x8a34('0x5')](_0xaf12b2,_0x1fc932);};}exports[_0x8a34('0x6')]=function(_0x3a57d0){for(var _0x39dc84=0x0,_0x244a1f=events[_0x8a34('0x7')];_0x39dc84<_0x244a1f;_0x39dc84++){var _0x4a3eba=events[_0x39dc84];var _0x14b00b=createListener(_0x8a34('0x8')+_0x4a3eba,_0x3a57d0);VoiceQueueEvents['on'](_0x4a3eba,_0x14b00b);}};
\ No newline at end of file
+var _0xd5a1=['length','voiceQueue:','./voiceQueue.events','update','emit','removeListener','register'];(function(_0x277208,_0x57ab06){var _0x3e2c03=function(_0x22d743){while(--_0x22d743){_0x277208['push'](_0x277208['shift']());}};_0x3e2c03(++_0x57ab06);}(_0xd5a1,0x1d7));var _0x1d5a=function(_0x48f7cc,_0x24d0e8){_0x48f7cc=_0x48f7cc-0x0;var _0x16c9a0=_0xd5a1[_0x48f7cc];return _0x16c9a0;};'use strict';var VoiceQueueEvents=require(_0x1d5a('0x0'));var events=['save','remove',_0x1d5a('0x1')];function createListener(_0x561d83,_0x6fc4d5){return function(_0xe74aaa){_0x6fc4d5[_0x1d5a('0x2')](_0x561d83,_0xe74aaa);};}function removeListener(_0x5dddc5,_0x687652){return function(){VoiceQueueEvents[_0x1d5a('0x3')](_0x5dddc5,_0x687652);};}exports[_0x1d5a('0x4')]=function(_0x42162f){for(var _0x23b355=0x0,_0x2b3abf=events[_0x1d5a('0x5')];_0x23b355<_0x2b3abf;_0x23b355++){var _0x37310a=events[_0x23b355];var _0x13b8b8=createListener(_0x1d5a('0x6')+_0x37310a,_0x42162f);VoiceQueueEvents['on'](_0x37310a,_0x13b8b8);}};
\ No newline at end of file
index 13180fd..e069be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe423=['isAuthenticated','/describe','describe','/index','getVoiceQueuesReport','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get'];(function(_0x1d7599,_0x49929f){var _0x55da12=function(_0x3f7a5f){while(--_0x3f7a5f){_0x1d7599['push'](_0x1d7599['shift']());}};_0x55da12(++_0x49929f);}(_0xe423,0x140));var _0x3e42=function(_0x482740,_0x1876d4){_0x482740=_0x482740-0x0;var _0x137ad3=_0xe423[_0x482740];return _0x137ad3;};'use strict';var multer=require(_0x3e42('0x0'));var util=require(_0x3e42('0x1'));var path=require('path');var timeout=require(_0x3e42('0x2'));var express=require('express');var router=express[_0x3e42('0x3')]();var fs_extra=require(_0x3e42('0x4'));var auth=require(_0x3e42('0x5'));var interaction=require(_0x3e42('0x6'));var config=require(_0x3e42('0x7'));var controller=require(_0x3e42('0x8'));router[_0x3e42('0x9')]('/',auth[_0x3e42('0xa')](),controller['index']);router[_0x3e42('0x9')](_0x3e42('0xb'),auth[_0x3e42('0xa')](),controller[_0x3e42('0xc')]);router[_0x3e42('0x9')](_0x3e42('0xd'),auth['isAuthenticated'](),controller[_0x3e42('0xe')]);router[_0x3e42('0x9')]('/:id',auth[_0x3e42('0xa')](),controller[_0x3e42('0xf')]);router[_0x3e42('0x10')]('/',auth[_0x3e42('0xa')](),controller[_0x3e42('0x11')]);router['put']('/:id',auth[_0x3e42('0xa')](),controller[_0x3e42('0x12')]);router[_0x3e42('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3e42('0x14')]);module[_0x3e42('0x15')]=router;
\ No newline at end of file
+var _0xbb96=['index','/describe','/index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0xbb96,0xf2));var _0x6bb9=function(_0x36d8d9,_0x17b58a){_0x36d8d9=_0x36d8d9-0x0;var _0x1ac3a2=_0xbb96[_0x36d8d9];return _0x1ac3a2;};'use strict';var multer=require(_0x6bb9('0x0'));var util=require('util');var path=require(_0x6bb9('0x1'));var timeout=require('connect-timeout');var express=require(_0x6bb9('0x2'));var router=express[_0x6bb9('0x3')]();var fs_extra=require(_0x6bb9('0x4'));var auth=require(_0x6bb9('0x5'));var interaction=require(_0x6bb9('0x6'));var config=require(_0x6bb9('0x7'));var controller=require(_0x6bb9('0x8'));router[_0x6bb9('0x9')]('/',auth[_0x6bb9('0xa')](),controller[_0x6bb9('0xb')]);router[_0x6bb9('0x9')](_0x6bb9('0xc'),auth[_0x6bb9('0xa')](),controller['describe']);router[_0x6bb9('0x9')](_0x6bb9('0xd'),auth[_0x6bb9('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x6bb9('0xe'),auth[_0x6bb9('0xa')](),controller[_0x6bb9('0xf')]);router[_0x6bb9('0x10')]('/',auth['isAuthenticated'](),controller[_0x6bb9('0x11')]);router[_0x6bb9('0x12')](_0x6bb9('0xe'),auth[_0x6bb9('0xa')](),controller[_0x6bb9('0x13')]);router[_0x6bb9('0x14')]('/:id',auth[_0x6bb9('0xa')](),controller[_0x6bb9('0x15')]);module[_0x6bb9('0x16')]=router;
\ No newline at end of file
index ca1cda8..c61f3cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4974=['getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','DATE','BOOLEAN','sequelize','moment','STRING'];(function(_0x2c3a8f,_0x374e56){var _0x189412=function(_0x560055){while(--_0x560055){_0x2c3a8f['push'](_0x2c3a8f['shift']());}};_0x189412(++_0x374e56);}(_0x4974,0x131));var _0x4497=function(_0xaaf2e2,_0x19d28a){_0xaaf2e2=_0xaaf2e2-0x0;var _0x28bc36=_0x4974[_0xaaf2e2];return _0x28bc36;};'use strict';var Sequelize=require(_0x4497('0x0'));var moment=require(_0x4497('0x1'));module['exports']={'type':{'type':Sequelize[_0x4497('0x2')]},'uniqueid':{'type':Sequelize[_0x4497('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x4497('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x151597){var _0x410744=moment(_0x151597);var _0x32f969=moment(this[_0x4497('0x3')](_0x4497('0x4')))['format'](_0x4497('0x5'));var _0x4ef3ce=_0x410744[_0x4497('0x6')](_0x32f969,_0x4497('0x7'));this[_0x4497('0x8')](_0x4497('0x9'),_0x151597);this['setDataValue'](_0x4497('0xa'),_0x4ef3ce||null);}},'position':{'type':Sequelize[_0x4497('0xb')]},'count':{'type':Sequelize[_0x4497('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4497('0xc')]},'queuecallercomplete':{'type':Sequelize[_0x4497('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4497('0xc')]},'queuecallerexit':{'type':Sequelize[_0x4497('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4497('0xc')]},'queuecallerexitreason':{'type':Sequelize[_0x4497('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x4497('0xb')]},'channel':{'type':Sequelize[_0x4497('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4497('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x4497('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize[_0x4497('0xb')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4497('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4497('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x4497('0x2')]},'transferuniqueid':{'type':Sequelize[_0x4497('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4497('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x4497('0xb')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xc314=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','DATE','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0xd6aad,_0x3fd78e){var _0x1109e6=function(_0x37f59c){while(--_0x37f59c){_0xd6aad['push'](_0xd6aad['shift']());}};_0x1109e6(++_0x3fd78e);}(_0xc314,0xb1));var _0x4c31=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc314[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x4c31('0x0'));var moment=require('moment');module[_0x4c31('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4c31('0x2')]},'calleridname':{'type':Sequelize[_0x4c31('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x2afbc9){var _0x4653bd=moment(_0x2afbc9);var _0x39bb1d=moment(this[_0x4c31('0x3')](_0x4c31('0x4')))[_0x4c31('0x5')](_0x4c31('0x6'));var _0x379d86=_0x4653bd[_0x4c31('0x7')](_0x39bb1d,'seconds');this[_0x4c31('0x8')](_0x4c31('0x9'),_0x2afbc9);this[_0x4c31('0x8')]('holdtime',_0x379d86||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x4c31('0xa')]},'queuecallerabandon':{'type':Sequelize[_0x4c31('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4c31('0xc')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4c31('0xc')]},'queuecallerexit':{'type':Sequelize[_0x4c31('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x4c31('0xc')]},'queuecallerexitreason':{'type':Sequelize[_0x4c31('0x2')],'comment':_0x4c31('0xd')},'originalposition':{'type':Sequelize[_0x4c31('0xa')]},'channel':{'type':Sequelize[_0x4c31('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x4c31('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4c31('0x2')]},'exten':{'type':Sequelize[_0x4c31('0x2')]},'priority':{'type':Sequelize[_0x4c31('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4c31('0x2')]},'transfer':{'type':Sequelize[_0x4c31('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4c31('0x2')],'comment':_0x4c31('0xe')},'transferexten':{'type':Sequelize[_0x4c31('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4c31('0x2')]},'thirdDisposition':{'type':Sequelize[_0x4c31('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x4c31('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 29ac50a..4914fa6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f7e=['moment','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','describe','getVoiceQueuesReport','keys','eml-format','fast-json-patch','request-promise'];(function(_0x16fc46,_0x55190d){var _0x20b456=function(_0x194068){while(--_0x194068){_0x16fc46['push'](_0x16fc46['shift']());}};_0x20b456(++_0x55190d);}(_0x0f7e,0x18d));var _0xe0f7=function(_0x14236b,_0x4b5cf1){_0x14236b=_0x14236b-0x0;var _0x159e96=_0x0f7e[_0x14236b];return _0x159e96;};'use strict';var emlformat=require(_0xe0f7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe0f7('0x1'));var rp=require(_0xe0f7('0x2'));var moment=require(_0xe0f7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe0f7('0x4'));var path=require(_0xe0f7('0x5'));var sox=require(_0xe0f7('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0f7('0x7'));var squel=require(_0xe0f7('0x8'));var crypto=require(_0xe0f7('0x9'));var jsforce=require(_0xe0f7('0xa'));var deskjs=require(_0xe0f7('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe0f7('0xc'));var Papa=require(_0xe0f7('0xd'));var Redis=require(_0xe0f7('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe0f7('0xf'));var hardwareService=require(_0xe0f7('0x10'));var logger=require(_0xe0f7('0x11'))(_0xe0f7('0x12'));var utils=require(_0xe0f7('0x13'));var config=require(_0xe0f7('0x14'));var licenseUtil=require(_0xe0f7('0x15'));var db=require(_0xe0f7('0x16'))['db'];config[_0xe0f7('0x17')]=_[_0xe0f7('0x18')](config[_0xe0f7('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0f7('0x19'))(new Redis(config[_0xe0f7('0x17')]));require(_0xe0f7('0x1a'))[_0xe0f7('0x1b')](socket);function respondWithStatusCode(_0x3c2c23,_0x1d941d){_0x1d941d=_0x1d941d||0xcc;return function(_0x1061a5){if(_0x1061a5){return _0x3c2c23['sendStatus'](_0x1d941d);}return _0x3c2c23[_0xe0f7('0x1c')](_0x1d941d)['end']();};}function respondWithResult(_0x440075,_0x44e071){_0x44e071=_0x44e071||0xc8;return function(_0x273b02){if(_0x273b02){return _0x440075['status'](_0x44e071)[_0xe0f7('0x1d')](_0x273b02);}};}function respondWithFilteredResult(_0x5e62be,_0x4038ca){return function(_0x25fe2e){if(_0x25fe2e){var _0x3ed335=typeof _0x4038ca['offset']===_0xe0f7('0x1e')&&typeof _0x4038ca['limit']===_0xe0f7('0x1e');var _0x5da17b=_0x25fe2e[_0xe0f7('0x1f')];var _0x59507f=_0x3ed335?0x0:_0x4038ca[_0xe0f7('0x20')];var _0x361062=_0x3ed335?_0x25fe2e[_0xe0f7('0x1f')]:_0x4038ca['offset']+_0x4038ca['limit'];var _0x4591b1;if(_0x361062>=_0x5da17b){_0x361062=_0x5da17b;_0x4591b1=0xc8;}else{_0x4591b1=0xce;}_0x5e62be[_0xe0f7('0x1c')](_0x4591b1);return _0x5e62be[_0xe0f7('0x21')](_0xe0f7('0x22'),_0x59507f+'-'+_0x361062+'/'+_0x5da17b)[_0xe0f7('0x1d')](_0x25fe2e);}return null;};}function patchUpdates(_0x2bed8d){return function(_0x3ba348){try{jsonpatch[_0xe0f7('0x23')](_0x3ba348,_0x2bed8d,!![]);}catch(_0x30f571){return BPromise[_0xe0f7('0x24')](_0x30f571);}return _0x3ba348['save']();};}function saveUpdates(_0x196713,_0x2a6337){return function(_0x3bd3c4){if(_0x3bd3c4){return _0x3bd3c4[_0xe0f7('0x25')](_0x196713)[_0xe0f7('0x26')](function(_0x14ec63){return _0x14ec63;});}return null;};}function removeEntity(_0x430f1c,_0x4eb774){return function(_0x417a80){if(_0x417a80){return _0x417a80[_0xe0f7('0x27')]()['then'](function(){_0x430f1c[_0xe0f7('0x1c')](0xcc)[_0xe0f7('0x28')]();});}};}function handleEntityNotFound(_0x16b247,_0x2021cb){return function(_0x2fb6f1){if(!_0x2fb6f1){_0x16b247[_0xe0f7('0x29')](0x194);}return _0x2fb6f1;};}function handleError(_0x57d223,_0x2e70f1){_0x2e70f1=_0x2e70f1||0x1f4;return function(_0x479150){logger['error'](_0x479150['stack']);if(_0x479150[_0xe0f7('0x2a')]){delete _0x479150[_0xe0f7('0x2a')];}_0x57d223['status'](_0x2e70f1)[_0xe0f7('0x2b')](_0x479150);};}exports[_0xe0f7('0x2c')]=function(_0x3d6fdb,_0x378083){var _0x2e47bc={},_0x2bc6a9={},_0x45bfe8={'count':0x0,'rows':[]};var _0x41764d=_[_0xe0f7('0x2d')](db[_0xe0f7('0x2e')][_0xe0f7('0x2f')],function(_0x16acfa){return{'name':_0x16acfa[_0xe0f7('0x30')],'type':_0x16acfa[_0xe0f7('0x31')]['key']};});_0x2bc6a9[_0xe0f7('0x32')]=_[_0xe0f7('0x2d')](_0x41764d,_0xe0f7('0x2a'));_0x2bc6a9[_0xe0f7('0x33')]=_['keys'](_0x3d6fdb[_0xe0f7('0x33')]);_0x2bc6a9[_0xe0f7('0x34')]=_[_0xe0f7('0x35')](_0x2bc6a9[_0xe0f7('0x32')],_0x2bc6a9[_0xe0f7('0x33')]);_0x2e47bc['attributes']=_[_0xe0f7('0x35')](_0x2bc6a9['model'],qs[_0xe0f7('0x36')](_0x3d6fdb[_0xe0f7('0x33')]['fields']));_0x2e47bc['attributes']=_0x2e47bc[_0xe0f7('0x37')][_0xe0f7('0x38')]?_0x2e47bc['attributes']:_0x2bc6a9[_0xe0f7('0x32')];if(!_0x3d6fdb[_0xe0f7('0x33')][_0xe0f7('0x39')](_0xe0f7('0x3a'))){_0x2e47bc[_0xe0f7('0x3b')]=qs[_0xe0f7('0x3b')](_0x3d6fdb[_0xe0f7('0x33')][_0xe0f7('0x3b')]);_0x2e47bc['offset']=qs[_0xe0f7('0x20')](_0x3d6fdb[_0xe0f7('0x33')]['offset']);}_0x2e47bc[_0xe0f7('0x3c')]=qs[_0xe0f7('0x3d')](_0x3d6fdb['query'][_0xe0f7('0x3d')]);_0x2e47bc['where']=qs[_0xe0f7('0x34')](_[_0xe0f7('0x3e')](_0x3d6fdb[_0xe0f7('0x33')],_0x2bc6a9[_0xe0f7('0x34')]),_0x41764d);if(_0x3d6fdb[_0xe0f7('0x33')][_0xe0f7('0x3f')]){_0x2e47bc[_0xe0f7('0x40')]=_[_0xe0f7('0x41')](_0x2e47bc[_0xe0f7('0x40')],{'$or':_[_0xe0f7('0x2d')](_0x41764d,function(_0x5d3d91){if(_0x5d3d91[_0xe0f7('0x31')]!==_0xe0f7('0x42')){var _0x127241={};_0x127241[_0x5d3d91['name']]={'$like':'%'+_0x3d6fdb[_0xe0f7('0x33')]['filter']+'%'};return _0x127241;}})});}_0x2e47bc=_[_0xe0f7('0x41')]({},_0x2e47bc,_0x3d6fdb[_0xe0f7('0x43')]);var _0x224380={'where':_0x2e47bc[_0xe0f7('0x40')]};return db[_0xe0f7('0x2e')][_0xe0f7('0x1f')](_0x224380)[_0xe0f7('0x26')](function(_0x58e3f7){_0x45bfe8['count']=_0x58e3f7;if(_0x3d6fdb[_0xe0f7('0x33')][_0xe0f7('0x44')]){_0x2e47bc[_0xe0f7('0x45')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xe0f7('0x46')](_0x2e47bc);})[_0xe0f7('0x26')](function(_0x141ae7){_0x45bfe8[_0xe0f7('0x47')]=_0x141ae7;return _0x45bfe8;})[_0xe0f7('0x26')](respondWithFilteredResult(_0x378083,_0x2e47bc))[_0xe0f7('0x48')](handleError(_0x378083,null));};exports[_0xe0f7('0x49')]=function(_0x397901,_0x4e49c4){var _0x2585d1={'raw':![],'where':{'id':_0x397901['params']['id']}},_0x357fb0={};_0x357fb0[_0xe0f7('0x32')]=_['keys'](db['VoiceQueueReport'][_0xe0f7('0x2f')]);_0x357fb0[_0xe0f7('0x33')]=_['keys'](_0x397901[_0xe0f7('0x33')]);_0x357fb0[_0xe0f7('0x34')]=_[_0xe0f7('0x35')](_0x357fb0[_0xe0f7('0x32')],_0x357fb0[_0xe0f7('0x33')]);_0x2585d1[_0xe0f7('0x37')]=_[_0xe0f7('0x35')](_0x357fb0[_0xe0f7('0x32')],qs['fields'](_0x397901[_0xe0f7('0x33')][_0xe0f7('0x36')]));_0x2585d1[_0xe0f7('0x37')]=_0x2585d1['attributes'][_0xe0f7('0x38')]?_0x2585d1[_0xe0f7('0x37')]:_0x357fb0[_0xe0f7('0x32')];if(_0x397901[_0xe0f7('0x33')][_0xe0f7('0x44')]){_0x2585d1['include']=[{'all':!![]}];}_0x2585d1=_['merge']({},_0x2585d1,_0x397901[_0xe0f7('0x43')]);return db[_0xe0f7('0x2e')]['find'](_0x2585d1)[_0xe0f7('0x26')](handleEntityNotFound(_0x4e49c4,null))['then'](respondWithResult(_0x4e49c4,null))['catch'](handleError(_0x4e49c4,null));};exports[_0xe0f7('0x4a')]=function(_0x530f19,_0xa02ed1){return db[_0xe0f7('0x2e')][_0xe0f7('0x4a')](_0x530f19[_0xe0f7('0x4b')],{})['then'](respondWithResult(_0xa02ed1,0xc9))['catch'](handleError(_0xa02ed1,null));};exports[_0xe0f7('0x25')]=function(_0x3b2fc2,_0x51ee7f){if(_0x3b2fc2['body']['id']){delete _0x3b2fc2[_0xe0f7('0x4b')]['id'];}return db[_0xe0f7('0x2e')][_0xe0f7('0x4c')]({'where':{'id':_0x3b2fc2['params']['id']}})[_0xe0f7('0x26')](handleEntityNotFound(_0x51ee7f,null))['then'](saveUpdates(_0x3b2fc2[_0xe0f7('0x4b')],null))[_0xe0f7('0x26')](respondWithResult(_0x51ee7f,null))[_0xe0f7('0x48')](handleError(_0x51ee7f,null));};exports[_0xe0f7('0x27')]=function(_0xf9f5ad,_0x235d4c){return db['VoiceQueueReport'][_0xe0f7('0x4c')]({'where':{'id':_0xf9f5ad['params']['id']}})['then'](handleEntityNotFound(_0x235d4c,null))['then'](removeEntity(_0x235d4c,null))[_0xe0f7('0x48')](handleError(_0x235d4c,null));};exports[_0xe0f7('0x4d')]=function(_0x521e38,_0x548735){return db[_0xe0f7('0x2e')][_0xe0f7('0x4d')]()['then'](respondWithResult(_0x548735,null))[_0xe0f7('0x48')](handleError(_0x548735,null));};exports[_0xe0f7('0x4e')]=function(_0x570f70,_0x3c7f03){var _0x3c00e5={},_0x24420e={},_0x2234e0={'count':0x0,'rows':[]};_0x24420e[_0xe0f7('0x32')]=_[_0xe0f7('0x4f')](db['VoiceQueueReport'][_0xe0f7('0x2f')]);_0x24420e[_0xe0f7('0x33')]=_[_0xe0f7('0x4f')](_0x570f70[_0xe0f7('0x33')]);_0x24420e[_0xe0f7('0x34')]=_[_0xe0f7('0x35')](_0x24420e[_0xe0f7('0x32')],_0x24420e[_0xe0f7('0x33')]);_0x3c00e5[_0xe0f7('0x37')]=_[_0xe0f7('0x35')](_0x24420e[_0xe0f7('0x32')],qs[_0xe0f7('0x36')](_0x570f70['query'][_0xe0f7('0x36')]));_0x3c00e5[_0xe0f7('0x37')]=_0x3c00e5[_0xe0f7('0x37')]['length']?_0x3c00e5[_0xe0f7('0x37')]:_0x24420e[_0xe0f7('0x32')];if(!_0x570f70[_0xe0f7('0x33')][_0xe0f7('0x39')](_0xe0f7('0x3a'))){_0x3c00e5[_0xe0f7('0x3b')]=qs[_0xe0f7('0x3b')](_0x570f70['query'][_0xe0f7('0x3b')]);_0x3c00e5[_0xe0f7('0x20')]=qs[_0xe0f7('0x20')](_0x570f70['query']['offset']);}_0x3c00e5['order']=qs[_0xe0f7('0x3d')](_0x570f70[_0xe0f7('0x33')][_0xe0f7('0x3d')]);_0x3c00e5[_0xe0f7('0x40')]=qs[_0xe0f7('0x34')](_[_0xe0f7('0x3e')](_0x570f70['query'],_0x24420e[_0xe0f7('0x34')]));if(_0x570f70['query'][_0xe0f7('0x3f')]){_0x3c00e5['where']=_[_0xe0f7('0x41')](_0x3c00e5[_0xe0f7('0x40')],{'$or':_[_0xe0f7('0x2d')](_0x3c00e5[_0xe0f7('0x37')],function(_0x1b22dd){var _0x13ce0f={};_0x13ce0f[_0x1b22dd]={'$like':'%'+_0x570f70[_0xe0f7('0x33')][_0xe0f7('0x3f')]+'%'};return _0x13ce0f;})});}_0x3c00e5=_[_0xe0f7('0x41')]({},_0x3c00e5,_0x570f70[_0xe0f7('0x43')]);var _0x1758fa={'where':_0x3c00e5[_0xe0f7('0x40')]};return db[_0xe0f7('0x2e')]['count'](_0x1758fa)['then'](function(_0xbe5ae5){_0x2234e0[_0xe0f7('0x1f')]=_0xbe5ae5;if(_0x570f70['query']['includeAll']){_0x3c00e5[_0xe0f7('0x45')]=[{'all':!![]}];}return db[_0xe0f7('0x2e')]['findAll'](_0x3c00e5);})[_0xe0f7('0x26')](function(_0x5a7549){_0x2234e0['rows']=_0x5a7549;return _0x2234e0;})[_0xe0f7('0x26')](respondWithFilteredResult(_0x3c7f03,_0x3c00e5,_0xe0f7('0x4e')))[_0xe0f7('0x48')](handleError(_0x3c7f03,null,_0xe0f7('0x4e')));};
\ No newline at end of file
+var _0xa5d0=['sort','findAll','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./voiceQueueReport.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','then','destroy','end','error','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','rows','show','params','includeAll','include','catch','create','body','find','describe','getVoiceQueuesReport'];(function(_0xbb44ef,_0x404777){var _0x625b60=function(_0x13a57b){while(--_0x13a57b){_0xbb44ef['push'](_0xbb44ef['shift']());}};_0x625b60(++_0x404777);}(_0xa5d0,0x1d6));var _0x0a5d=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0xa5d0[_0x53cf8e];return _0x459197;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a5d('0x0'));var rp=require(_0x0a5d('0x1'));var moment=require('moment');var BPromise=require(_0x0a5d('0x2'));var Mustache=require(_0x0a5d('0x3'));var util=require('util');var path=require(_0x0a5d('0x4'));var sox=require('sox');var csv=require(_0x0a5d('0x5'));var ejs=require(_0x0a5d('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a5d('0x7'));var squel=require(_0x0a5d('0x8'));var crypto=require(_0x0a5d('0x9'));var jsforce=require(_0x0a5d('0xa'));var deskjs=require(_0x0a5d('0xb'));var toCsv=require(_0x0a5d('0x5'));var querystring=require('querystring');var Papa=require(_0x0a5d('0xc'));var Redis=require(_0x0a5d('0xd'));var authService=require(_0x0a5d('0xe'));var qs=require(_0x0a5d('0xf'));var as=require(_0x0a5d('0x10'));var hardwareService=require(_0x0a5d('0x11'));var logger=require(_0x0a5d('0x12'))(_0x0a5d('0x13'));var utils=require(_0x0a5d('0x14'));var config=require(_0x0a5d('0x15'));var licenseUtil=require(_0x0a5d('0x16'));var db=require('../../mysqldb')['db'];config[_0x0a5d('0x17')]=_[_0x0a5d('0x18')](config[_0x0a5d('0x17')],{'host':_0x0a5d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0a5d('0x17')]));require(_0x0a5d('0x1a'))[_0x0a5d('0x1b')](socket);function respondWithStatusCode(_0x545faa,_0x102a35){_0x102a35=_0x102a35||0xcc;return function(_0x16840a){if(_0x16840a){return _0x545faa[_0x0a5d('0x1c')](_0x102a35);}return _0x545faa[_0x0a5d('0x1d')](_0x102a35)['end']();};}function respondWithResult(_0x143cb6,_0x4f5d03){_0x4f5d03=_0x4f5d03||0xc8;return function(_0x12bfdc){if(_0x12bfdc){return _0x143cb6[_0x0a5d('0x1d')](_0x4f5d03)[_0x0a5d('0x1e')](_0x12bfdc);}};}function respondWithFilteredResult(_0x13a90e,_0x1f5c7a){return function(_0x432b0e){if(_0x432b0e){var _0x4b4af7=typeof _0x1f5c7a['offset']===_0x0a5d('0x1f')&&typeof _0x1f5c7a[_0x0a5d('0x20')]==='undefined';var _0x507f05=_0x432b0e[_0x0a5d('0x21')];var _0x228b96=_0x4b4af7?0x0:_0x1f5c7a['offset'];var _0x401b6a=_0x4b4af7?_0x432b0e['count']:_0x1f5c7a[_0x0a5d('0x22')]+_0x1f5c7a[_0x0a5d('0x20')];var _0x584365;if(_0x401b6a>=_0x507f05){_0x401b6a=_0x507f05;_0x584365=0xc8;}else{_0x584365=0xce;}_0x13a90e['status'](_0x584365);return _0x13a90e['set'](_0x0a5d('0x23'),_0x228b96+'-'+_0x401b6a+'/'+_0x507f05)[_0x0a5d('0x1e')](_0x432b0e);}return null;};}function patchUpdates(_0x49a49a){return function(_0x4be148){try{jsonpatch[_0x0a5d('0x24')](_0x4be148,_0x49a49a,!![]);}catch(_0x5d2415){return BPromise['reject'](_0x5d2415);}return _0x4be148['save']();};}function saveUpdates(_0x5d0559,_0x24a088){return function(_0x1eeb17){if(_0x1eeb17){return _0x1eeb17['update'](_0x5d0559)[_0x0a5d('0x25')](function(_0x32767b){return _0x32767b;});}return null;};}function removeEntity(_0x1af2cb,_0x2b8f9b){return function(_0x190182){if(_0x190182){return _0x190182[_0x0a5d('0x26')]()['then'](function(){_0x1af2cb[_0x0a5d('0x1d')](0xcc)[_0x0a5d('0x27')]();});}};}function handleEntityNotFound(_0x4f44d6,_0x3734b6){return function(_0x5b568c){if(!_0x5b568c){_0x4f44d6['sendStatus'](0x194);}return _0x5b568c;};}function handleError(_0x295ab2,_0x41042b){_0x41042b=_0x41042b||0x1f4;return function(_0x5a0fbe){logger[_0x0a5d('0x28')](_0x5a0fbe['stack']);if(_0x5a0fbe['name']){delete _0x5a0fbe[_0x0a5d('0x29')];}_0x295ab2['status'](_0x41042b)['send'](_0x5a0fbe);};}exports[_0x0a5d('0x2a')]=function(_0x432be8,_0x30b9e8){var _0x25f7cb={},_0x103c06={},_0x2e2c44={'count':0x0,'rows':[]};var _0x12f5d0=_[_0x0a5d('0x2b')](db[_0x0a5d('0x2c')][_0x0a5d('0x2d')],function(_0xb34ab2){return{'name':_0xb34ab2[_0x0a5d('0x2e')],'type':_0xb34ab2[_0x0a5d('0x2f')][_0x0a5d('0x30')]};});_0x103c06[_0x0a5d('0x31')]=_[_0x0a5d('0x2b')](_0x12f5d0,_0x0a5d('0x29'));_0x103c06[_0x0a5d('0x32')]=_[_0x0a5d('0x33')](_0x432be8[_0x0a5d('0x32')]);_0x103c06[_0x0a5d('0x34')]=_[_0x0a5d('0x35')](_0x103c06['model'],_0x103c06[_0x0a5d('0x32')]);_0x25f7cb[_0x0a5d('0x36')]=_['intersection'](_0x103c06[_0x0a5d('0x31')],qs[_0x0a5d('0x37')](_0x432be8[_0x0a5d('0x32')][_0x0a5d('0x37')]));_0x25f7cb[_0x0a5d('0x36')]=_0x25f7cb[_0x0a5d('0x36')][_0x0a5d('0x38')]?_0x25f7cb['attributes']:_0x103c06[_0x0a5d('0x31')];if(!_0x432be8[_0x0a5d('0x32')][_0x0a5d('0x39')](_0x0a5d('0x3a'))){_0x25f7cb[_0x0a5d('0x20')]=qs[_0x0a5d('0x20')](_0x432be8[_0x0a5d('0x32')][_0x0a5d('0x20')]);_0x25f7cb[_0x0a5d('0x22')]=qs['offset'](_0x432be8['query'][_0x0a5d('0x22')]);}_0x25f7cb[_0x0a5d('0x3b')]=qs['sort'](_0x432be8['query']['sort']);_0x25f7cb[_0x0a5d('0x3c')]=qs[_0x0a5d('0x34')](_[_0x0a5d('0x3d')](_0x432be8[_0x0a5d('0x32')],_0x103c06[_0x0a5d('0x34')]),_0x12f5d0);if(_0x432be8[_0x0a5d('0x32')][_0x0a5d('0x3e')]){_0x25f7cb[_0x0a5d('0x3c')]=_['merge'](_0x25f7cb['where'],{'$or':_[_0x0a5d('0x2b')](_0x12f5d0,function(_0x39072a){if(_0x39072a[_0x0a5d('0x2f')]!=='VIRTUAL'){var _0x452cab={};_0x452cab[_0x39072a['name']]={'$like':'%'+_0x432be8['query'][_0x0a5d('0x3e')]+'%'};return _0x452cab;}})});}_0x25f7cb=_[_0x0a5d('0x3f')]({},_0x25f7cb,_0x432be8[_0x0a5d('0x40')]);var _0x3f5344={'where':_0x25f7cb[_0x0a5d('0x3c')]};return db['VoiceQueueReport']['count'](_0x3f5344)[_0x0a5d('0x25')](function(_0x1ad189){_0x2e2c44[_0x0a5d('0x21')]=_0x1ad189;if(_0x432be8[_0x0a5d('0x32')]['includeAll']){_0x25f7cb['include']=[{'all':!![]}];}return db[_0x0a5d('0x2c')]['findAll'](_0x25f7cb);})[_0x0a5d('0x25')](function(_0x838041){_0x2e2c44[_0x0a5d('0x41')]=_0x838041;return _0x2e2c44;})['then'](respondWithFilteredResult(_0x30b9e8,_0x25f7cb))['catch'](handleError(_0x30b9e8,null));};exports[_0x0a5d('0x42')]=function(_0x1c7cc0,_0x19d0de){var _0x467f43={'raw':![],'where':{'id':_0x1c7cc0[_0x0a5d('0x43')]['id']}},_0x47ee2f={};_0x47ee2f['model']=_[_0x0a5d('0x33')](db[_0x0a5d('0x2c')][_0x0a5d('0x2d')]);_0x47ee2f[_0x0a5d('0x32')]=_[_0x0a5d('0x33')](_0x1c7cc0[_0x0a5d('0x32')]);_0x47ee2f[_0x0a5d('0x34')]=_[_0x0a5d('0x35')](_0x47ee2f[_0x0a5d('0x31')],_0x47ee2f[_0x0a5d('0x32')]);_0x467f43[_0x0a5d('0x36')]=_['intersection'](_0x47ee2f[_0x0a5d('0x31')],qs[_0x0a5d('0x37')](_0x1c7cc0[_0x0a5d('0x32')][_0x0a5d('0x37')]));_0x467f43[_0x0a5d('0x36')]=_0x467f43[_0x0a5d('0x36')][_0x0a5d('0x38')]?_0x467f43[_0x0a5d('0x36')]:_0x47ee2f[_0x0a5d('0x31')];if(_0x1c7cc0['query'][_0x0a5d('0x44')]){_0x467f43[_0x0a5d('0x45')]=[{'all':!![]}];}_0x467f43=_[_0x0a5d('0x3f')]({},_0x467f43,_0x1c7cc0[_0x0a5d('0x40')]);return db[_0x0a5d('0x2c')]['find'](_0x467f43)[_0x0a5d('0x25')](handleEntityNotFound(_0x19d0de,null))['then'](respondWithResult(_0x19d0de,null))[_0x0a5d('0x46')](handleError(_0x19d0de,null));};exports['create']=function(_0x159083,_0x373446){return db[_0x0a5d('0x2c')][_0x0a5d('0x47')](_0x159083[_0x0a5d('0x48')],{})['then'](respondWithResult(_0x373446,0xc9))[_0x0a5d('0x46')](handleError(_0x373446,null));};exports['update']=function(_0x515779,_0x282981){if(_0x515779[_0x0a5d('0x48')]['id']){delete _0x515779['body']['id'];}return db[_0x0a5d('0x2c')][_0x0a5d('0x49')]({'where':{'id':_0x515779[_0x0a5d('0x43')]['id']}})[_0x0a5d('0x25')](handleEntityNotFound(_0x282981,null))[_0x0a5d('0x25')](saveUpdates(_0x515779[_0x0a5d('0x48')],null))[_0x0a5d('0x25')](respondWithResult(_0x282981,null))['catch'](handleError(_0x282981,null));};exports['destroy']=function(_0x581846,_0x817975){return db[_0x0a5d('0x2c')][_0x0a5d('0x49')]({'where':{'id':_0x581846[_0x0a5d('0x43')]['id']}})[_0x0a5d('0x25')](handleEntityNotFound(_0x817975,null))[_0x0a5d('0x25')](removeEntity(_0x817975,null))[_0x0a5d('0x46')](handleError(_0x817975,null));};exports[_0x0a5d('0x4a')]=function(_0x563d5c,_0x4a7797){return db['VoiceQueueReport']['describe']()[_0x0a5d('0x25')](respondWithResult(_0x4a7797,null))['catch'](handleError(_0x4a7797,null));};exports[_0x0a5d('0x4b')]=function(_0x5622ae,_0xa25aa4){var _0x21455c={},_0x239b12={},_0x5ce79d={'count':0x0,'rows':[]};_0x239b12[_0x0a5d('0x31')]=_[_0x0a5d('0x33')](db[_0x0a5d('0x2c')][_0x0a5d('0x2d')]);_0x239b12[_0x0a5d('0x32')]=_[_0x0a5d('0x33')](_0x5622ae[_0x0a5d('0x32')]);_0x239b12[_0x0a5d('0x34')]=_[_0x0a5d('0x35')](_0x239b12[_0x0a5d('0x31')],_0x239b12[_0x0a5d('0x32')]);_0x21455c[_0x0a5d('0x36')]=_[_0x0a5d('0x35')](_0x239b12[_0x0a5d('0x31')],qs[_0x0a5d('0x37')](_0x5622ae['query'][_0x0a5d('0x37')]));_0x21455c[_0x0a5d('0x36')]=_0x21455c[_0x0a5d('0x36')][_0x0a5d('0x38')]?_0x21455c[_0x0a5d('0x36')]:_0x239b12['model'];if(!_0x5622ae[_0x0a5d('0x32')][_0x0a5d('0x39')](_0x0a5d('0x3a'))){_0x21455c['limit']=qs[_0x0a5d('0x20')](_0x5622ae['query'][_0x0a5d('0x20')]);_0x21455c['offset']=qs[_0x0a5d('0x22')](_0x5622ae[_0x0a5d('0x32')][_0x0a5d('0x22')]);}_0x21455c['order']=qs[_0x0a5d('0x4c')](_0x5622ae[_0x0a5d('0x32')][_0x0a5d('0x4c')]);_0x21455c[_0x0a5d('0x3c')]=qs[_0x0a5d('0x34')](_[_0x0a5d('0x3d')](_0x5622ae[_0x0a5d('0x32')],_0x239b12[_0x0a5d('0x34')]));if(_0x5622ae[_0x0a5d('0x32')][_0x0a5d('0x3e')]){_0x21455c['where']=_[_0x0a5d('0x3f')](_0x21455c[_0x0a5d('0x3c')],{'$or':_[_0x0a5d('0x2b')](_0x21455c['attributes'],function(_0x577db2){var _0x43c840={};_0x43c840[_0x577db2]={'$like':'%'+_0x5622ae['query'][_0x0a5d('0x3e')]+'%'};return _0x43c840;})});}_0x21455c=_['merge']({},_0x21455c,_0x5622ae['options']);var _0x29a31a={'where':_0x21455c[_0x0a5d('0x3c')]};return db[_0x0a5d('0x2c')]['count'](_0x29a31a)[_0x0a5d('0x25')](function(_0x55e704){_0x5ce79d[_0x0a5d('0x21')]=_0x55e704;if(_0x5622ae[_0x0a5d('0x32')][_0x0a5d('0x44')]){_0x21455c[_0x0a5d('0x45')]=[{'all':!![]}];}return db[_0x0a5d('0x2c')][_0x0a5d('0x4d')](_0x21455c);})[_0x0a5d('0x25')](function(_0x363d4a){_0x5ce79d[_0x0a5d('0x41')]=_0x363d4a;return _0x5ce79d;})['then'](respondWithFilteredResult(_0xa25aa4,_0x21455c,_0x0a5d('0x4b')))[_0x0a5d('0x46')](handleError(_0xa25aa4,null,_0x0a5d('0x4b')));};
\ No newline at end of file
index 446c0be..6a4892f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff88=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xff88,0x19a));var _0x8ff8=function(_0x84947b,_0x10a67b){_0x84947b=_0x84947b-0x0;var _0x1e7391=_0xff88[_0x84947b];return _0x1e7391;};'use strict';var EventEmitter=require(_0x8ff8('0x0'));var VoiceQueueReport=require(_0x8ff8('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x8ff8('0x2')](0x0);var events={'afterCreate':_0x8ff8('0x3'),'afterUpdate':_0x8ff8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6741cd){return function(_0x4932f9,_0x3e7114,_0x4733ce){VoiceQueueReportEvents['emit'](_0x6741cd+':'+_0x4932f9['id'],_0x4932f9);VoiceQueueReportEvents[_0x8ff8('0x5')](_0x6741cd,_0x4932f9);_0x4733ce(null);};}for(var e in events){if(events[_0x8ff8('0x6')](e)){var event=events[e];VoiceQueueReport[_0x8ff8('0x7')](e,emitEvent(event));}}module[_0x8ff8('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0x59f4=['VoiceQueueReport','setMaxListeners','save','hook','events','../../mysqldb'];(function(_0x31d231,_0x962378){var _0x3827c8=function(_0x2ffe99){while(--_0x2ffe99){_0x31d231['push'](_0x31d231['shift']());}};_0x3827c8(++_0x962378);}(_0x59f4,0x1f0));var _0x459f=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0x59f4[_0x2678d6];return _0x475503;};'use strict';var EventEmitter=require(_0x459f('0x0'));var VoiceQueueReport=require(_0x459f('0x1'))['db'][_0x459f('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x459f('0x3')](0x0);var events={'afterCreate':_0x459f('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1e57d9){return function(_0x55eb2c,_0x264ad5,_0x7f3773){VoiceQueueReportEvents['emit'](_0x1e57d9+':'+_0x55eb2c['id'],_0x55eb2c);VoiceQueueReportEvents['emit'](_0x1e57d9,_0x55eb2c);_0x7f3773(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x459f('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents;
\ No newline at end of file
index 63c20d2..adfd15d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5243=['report_queue','uniqueid','calleridnum','lodash','api','moment','path','rimraf','./voiceQueueReport.attributes','define','VoiceQueueReport'];(function(_0x85fcc7,_0x4960ee){var _0x6aeafb=function(_0xbf5c6b){while(--_0xbf5c6b){_0x85fcc7['push'](_0x85fcc7['shift']());}};_0x6aeafb(++_0x4960ee);}(_0x5243,0x71));var _0x3524=function(_0x240e62,_0x5c9f16){_0x240e62=_0x240e62-0x0;var _0x48d813=_0x5243[_0x240e62];return _0x48d813;};'use strict';var _=require(_0x3524('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3524('0x1'));var moment=require(_0x3524('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3524('0x3'));var rimraf=require(_0x3524('0x4'));var config=require('../../config/environment');var attributes=require(_0x3524('0x5'));module['exports']=function(_0x2d8995,_0x564239){return _0x2d8995[_0x3524('0x6')](_0x3524('0x7'),attributes,{'tableName':_0x3524('0x8'),'paranoid':![],'indexes':[{'fields':[_0x3524('0x9')]},{'fields':[_0x3524('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x661e=['report_queue','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x661e,0x113));var _0xe661=function(_0x5be4b0,_0x58ed9f){_0x5be4b0=_0x5be4b0-0x0;var _0x153ac5=_0x661e[_0x5be4b0];return _0x153ac5;};'use strict';var _=require(_0xe661('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe661('0x1'));var moment=require(_0xe661('0x2'));var BPromise=require(_0xe661('0x3'));var rp=require(_0xe661('0x4'));var fs=require('fs');var path=require(_0xe661('0x5'));var rimraf=require(_0xe661('0x6'));var config=require(_0xe661('0x7'));var attributes=require(_0xe661('0x8'));module[_0xe661('0x9')]=function(_0x3277df,_0x2a7cb4){return _0x3277df['define'](_0xe661('0xa'),attributes,{'tableName':_0xe661('0xb'),'paranoid':![],'indexes':[{'fields':[_0xe661('0xc')]},{'fields':['calleridnum']}],'timestamps':!![]});};
\ No newline at end of file
index 5a26351..ea4c9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a5=['client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','findAll','options','raw','attributes','limit','include','map','model','VoiceQueueReport','create','CreateVoiceQueueReport','update','where','UpdateVoiceQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x957a2e,_0x460342){var _0x53952f=function(_0x6f355e){while(--_0x6f355e){_0x957a2e['push'](_0x957a2e['shift']());}};_0x53952f(++_0x460342);}(_0xd5a5,0x1b8));var _0x5d5a=function(_0x36721b,_0x217181){_0x36721b=_0x36721b-0x0;var _0x133b7d=_0xd5a5[_0x36721b];return _0x133b7d;};'use strict';var _=require(_0x5d5a('0x0'));var util=require(_0x5d5a('0x1'));var moment=require(_0x5d5a('0x2'));var BPromise=require('bluebird');var rs=require(_0x5d5a('0x3'));var fs=require('fs');var Redis=require(_0x5d5a('0x4'));var db=require(_0x5d5a('0x5'))['db'];var utils=require(_0x5d5a('0x6'));var logger=require(_0x5d5a('0x7'))(_0x5d5a('0x8'));var config=require(_0x5d5a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5d5a('0xa')][_0x5d5a('0xb')]({'port':0x232a});config[_0x5d5a('0xc')]=_[_0x5d5a('0xd')](config['redis'],{'host':_0x5d5a('0xe'),'port':0x18eb});var socket=require(_0x5d5a('0xf'))(new Redis(config[_0x5d5a('0xc')]));require(_0x5d5a('0x10'))[_0x5d5a('0x11')](socket);function respondWithRpcPromise(_0x58a976,_0x548560,_0x49046e){return new BPromise(function(_0x2c7346,_0x4f8547){return client[_0x5d5a('0x12')](_0x58a976,_0x49046e)[_0x5d5a('0x13')](function(_0x4c91f4){logger[_0x5d5a('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x548560,_0x5d5a('0x15'));logger[_0x5d5a('0x16')](_0x5d5a('0x17'),_0x548560,'request\x20sent',JSON[_0x5d5a('0x18')](_0x4c91f4));if(_0x4c91f4['error']){if(_0x4c91f4[_0x5d5a('0x19')]['code']===0x1f4){logger[_0x5d5a('0x19')](_0x5d5a('0x1a'),_0x548560,_0x4c91f4['error'][_0x5d5a('0x1b')]);return _0x4f8547(_0x4c91f4[_0x5d5a('0x19')][_0x5d5a('0x1b')]);}logger[_0x5d5a('0x19')](_0x5d5a('0x1a'),_0x548560,_0x4c91f4[_0x5d5a('0x19')][_0x5d5a('0x1b')]);return _0x2c7346(_0x4c91f4[_0x5d5a('0x19')][_0x5d5a('0x1b')]);}else{logger[_0x5d5a('0x14')](_0x5d5a('0x1a'),_0x548560,_0x5d5a('0x15'));_0x2c7346(_0x4c91f4[_0x5d5a('0x1c')][_0x5d5a('0x1b')]);}})[_0x5d5a('0x1d')](function(_0x4b51d5){logger[_0x5d5a('0x19')](_0x5d5a('0x1a'),_0x548560,_0x4b51d5);_0x4f8547(_0x4b51d5);});});}exports[_0x5d5a('0x1e')]=function(_0x172665){var _0x3512e1=this;return new Promise(function(_0x20b6d1,_0x5e0617){return db['VoiceQueueReport'][_0x5d5a('0x1f')]({'raw':_0x172665[_0x5d5a('0x20')]?_0x172665['options'][_0x5d5a('0x21')]===undefined?!![]:![]:!![],'where':_0x172665['options']?_0x172665[_0x5d5a('0x20')]['where']||null:null,'attributes':_0x172665[_0x5d5a('0x20')]?_0x172665[_0x5d5a('0x20')][_0x5d5a('0x22')]||null:null,'limit':_0x172665[_0x5d5a('0x20')]?_0x172665[_0x5d5a('0x20')][_0x5d5a('0x23')]||null:null,'include':_0x172665[_0x5d5a('0x20')]?_0x172665[_0x5d5a('0x20')][_0x5d5a('0x24')]?_[_0x5d5a('0x25')](_0x172665['options'][_0x5d5a('0x24')],function(_0x2fc222){return{'model':db[_0x2fc222['model']],'as':_0x2fc222['as'],'attributes':_0x2fc222[_0x5d5a('0x22')],'include':_0x2fc222[_0x5d5a('0x24')]?_['map'](_0x2fc222[_0x5d5a('0x24')],function(_0x4c30e8){return{'model':db[_0x4c30e8[_0x5d5a('0x26')]],'as':_0x4c30e8['as'],'attributes':_0x4c30e8[_0x5d5a('0x22')],'include':_0x4c30e8[_0x5d5a('0x24')]?_[_0x5d5a('0x25')](_0x4c30e8[_0x5d5a('0x24')],function(_0x170564){return{'model':db[_0x170564[_0x5d5a('0x26')]],'as':_0x170564['as'],'attributes':_0x170564['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6e9a0c){logger[_0x5d5a('0x14')](_0x5d5a('0x1e'),_0x172665);logger['debug'](_0x5d5a('0x1e'),_0x172665,JSON['stringify'](_0x6e9a0c));_0x20b6d1(_0x6e9a0c);})[_0x5d5a('0x1d')](function(_0x176d76){logger[_0x5d5a('0x19')](_0x5d5a('0x1e'),_0x176d76[_0x5d5a('0x1b')],_0x172665);_0x5e0617(_0x3512e1[_0x5d5a('0x19')](0x1f4,_0x176d76[_0x5d5a('0x1b')]));});});};exports['CreateVoiceQueueReport']=function(_0x16beda){var _0x45b65d=this;return new Promise(function(_0x46a95a,_0xd1d79e){return db[_0x5d5a('0x27')][_0x5d5a('0x28')](_0x16beda['body'],{'raw':_0x16beda[_0x5d5a('0x20')]?_0x16beda['options'][_0x5d5a('0x21')]===undefined?!![]:![]:!![]})[_0x5d5a('0x13')](function(_0x1bd510){logger[_0x5d5a('0x14')](_0x5d5a('0x29'),_0x16beda);logger[_0x5d5a('0x16')]('CreateVoiceQueueReport',_0x16beda,JSON[_0x5d5a('0x18')](_0x1bd510));_0x46a95a(_0x1bd510);})[_0x5d5a('0x1d')](function(_0x59481b){logger[_0x5d5a('0x19')](_0x5d5a('0x29'),_0x59481b[_0x5d5a('0x1b')],_0x16beda);_0xd1d79e(_0x45b65d['error'](0x1f4,_0x59481b[_0x5d5a('0x1b')]));});});};exports['UpdateVoiceQueueReport']=function(_0x43f84f){var _0x2f2f55=this;return new Promise(function(_0x13e55d,_0x3641ef){return db[_0x5d5a('0x27')][_0x5d5a('0x2a')](_0x43f84f['body'],{'raw':_0x43f84f[_0x5d5a('0x20')]?_0x43f84f[_0x5d5a('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43f84f['options']?_0x43f84f[_0x5d5a('0x20')][_0x5d5a('0x2b')]||null:null,'attributes':_0x43f84f[_0x5d5a('0x20')]?_0x43f84f['options'][_0x5d5a('0x22')]||null:null,'limit':_0x43f84f[_0x5d5a('0x20')]?_0x43f84f[_0x5d5a('0x20')][_0x5d5a('0x23')]||null:null})[_0x5d5a('0x13')](function(_0x32030b){logger['info'](_0x5d5a('0x2c'),_0x43f84f);logger[_0x5d5a('0x16')](_0x5d5a('0x2c'),_0x43f84f,JSON[_0x5d5a('0x18')](_0x32030b));_0x13e55d(_0x32030b);})['catch'](function(_0x4c2d59){logger['error'](_0x5d5a('0x2c'),_0x4c2d59[_0x5d5a('0x1b')],_0x43f84f);_0x3641ef(_0x2f2f55['error'](0x1f4,_0x4c2d59[_0x5d5a('0x1b')]));});});};
\ No newline at end of file
+var _0x43e3=['model','map','debug','CreateVoiceQueueReport','VoiceQueueReport','create','update','body','UpdateVoiceQueueReport','util','moment','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVoiceQueueReport','options','raw','where','attributes','limit','include'];(function(_0x309f56,_0x600614){var _0x5f4e92=function(_0x3dd028){while(--_0x3dd028){_0x309f56['push'](_0x309f56['shift']());}};_0x5f4e92(++_0x600614);}(_0x43e3,0x1b6));var _0x343e=function(_0x4e1991,_0xeb727c){_0x4e1991=_0x4e1991-0x0;var _0x318050=_0x43e3[_0x4e1991];return _0x318050;};'use strict';var _=require('lodash');var util=require(_0x343e('0x0'));var moment=require(_0x343e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x343e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x343e('0x3'));var config=require(_0x343e('0x4'));var jayson=require(_0x343e('0x5'));var client=jayson[_0x343e('0x6')][_0x343e('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x343e('0x8')],{'host':_0x343e('0x9'),'port':0x18eb});var socket=require(_0x343e('0xa'))(new Redis(config['redis']));require(_0x343e('0xb'))[_0x343e('0xc')](socket);function respondWithRpcPromise(_0x5559aa,_0x424343,_0x4d0caf){return new BPromise(function(_0x4abfe1,_0x26310d){return client[_0x343e('0xd')](_0x5559aa,_0x4d0caf)[_0x343e('0xe')](function(_0x5afdda){logger[_0x343e('0xf')](_0x343e('0x10'),_0x424343,_0x343e('0x11'));logger['debug'](_0x343e('0x12'),_0x424343,_0x343e('0x11'),JSON[_0x343e('0x13')](_0x5afdda));if(_0x5afdda[_0x343e('0x14')]){if(_0x5afdda['error']['code']===0x1f4){logger[_0x343e('0x14')](_0x343e('0x10'),_0x424343,_0x5afdda[_0x343e('0x14')][_0x343e('0x15')]);return _0x26310d(_0x5afdda[_0x343e('0x14')][_0x343e('0x15')]);}logger[_0x343e('0x14')](_0x343e('0x10'),_0x424343,_0x5afdda[_0x343e('0x14')][_0x343e('0x15')]);return _0x4abfe1(_0x5afdda['error'][_0x343e('0x15')]);}else{logger[_0x343e('0xf')](_0x343e('0x10'),_0x424343,_0x343e('0x11'));_0x4abfe1(_0x5afdda['result'][_0x343e('0x15')]);}})[_0x343e('0x16')](function(_0x4e5f71){logger[_0x343e('0x14')](_0x343e('0x10'),_0x424343,_0x4e5f71);_0x26310d(_0x4e5f71);});});}exports[_0x343e('0x17')]=function(_0x11bf91){var _0x20ca92=this;return new Promise(function(_0x517906,_0x3e0147){return db['VoiceQueueReport']['findAll']({'raw':_0x11bf91['options']?_0x11bf91[_0x343e('0x18')][_0x343e('0x19')]===undefined?!![]:![]:!![],'where':_0x11bf91[_0x343e('0x18')]?_0x11bf91[_0x343e('0x18')][_0x343e('0x1a')]||null:null,'attributes':_0x11bf91[_0x343e('0x18')]?_0x11bf91['options'][_0x343e('0x1b')]||null:null,'limit':_0x11bf91[_0x343e('0x18')]?_0x11bf91['options'][_0x343e('0x1c')]||null:null,'include':_0x11bf91[_0x343e('0x18')]?_0x11bf91['options']['include']?_['map'](_0x11bf91['options'][_0x343e('0x1d')],function(_0x19a485){return{'model':db[_0x19a485[_0x343e('0x1e')]],'as':_0x19a485['as'],'attributes':_0x19a485[_0x343e('0x1b')],'include':_0x19a485[_0x343e('0x1d')]?_['map'](_0x19a485[_0x343e('0x1d')],function(_0x120ad6){return{'model':db[_0x120ad6[_0x343e('0x1e')]],'as':_0x120ad6['as'],'attributes':_0x120ad6['attributes'],'include':_0x120ad6[_0x343e('0x1d')]?_[_0x343e('0x1f')](_0x120ad6[_0x343e('0x1d')],function(_0x3d31c6){return{'model':db[_0x3d31c6[_0x343e('0x1e')]],'as':_0x3d31c6['as'],'attributes':_0x3d31c6[_0x343e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x343e('0xe')](function(_0x25ee23){logger[_0x343e('0xf')](_0x343e('0x17'),_0x11bf91);logger[_0x343e('0x20')](_0x343e('0x17'),_0x11bf91,JSON[_0x343e('0x13')](_0x25ee23));_0x517906(_0x25ee23);})['catch'](function(_0x37cc02){logger[_0x343e('0x14')](_0x343e('0x17'),_0x37cc02[_0x343e('0x15')],_0x11bf91);_0x3e0147(_0x20ca92['error'](0x1f4,_0x37cc02[_0x343e('0x15')]));});});};exports[_0x343e('0x21')]=function(_0x1f588b){var _0x46cbba=this;return new Promise(function(_0x186af0,_0x303154){return db[_0x343e('0x22')][_0x343e('0x23')](_0x1f588b['body'],{'raw':_0x1f588b[_0x343e('0x18')]?_0x1f588b['options'][_0x343e('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5beea6){logger[_0x343e('0xf')]('CreateVoiceQueueReport',_0x1f588b);logger[_0x343e('0x20')]('CreateVoiceQueueReport',_0x1f588b,JSON[_0x343e('0x13')](_0x5beea6));_0x186af0(_0x5beea6);})['catch'](function(_0x193f3e){logger[_0x343e('0x14')]('CreateVoiceQueueReport',_0x193f3e[_0x343e('0x15')],_0x1f588b);_0x303154(_0x46cbba['error'](0x1f4,_0x193f3e[_0x343e('0x15')]));});});};exports['UpdateVoiceQueueReport']=function(_0x2f1442){var _0x4b273a=this;return new Promise(function(_0x4310fc,_0x107ed3){return db[_0x343e('0x22')][_0x343e('0x24')](_0x2f1442[_0x343e('0x25')],{'raw':_0x2f1442[_0x343e('0x18')]?_0x2f1442['options'][_0x343e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f1442[_0x343e('0x18')]?_0x2f1442[_0x343e('0x18')]['where']||null:null,'attributes':_0x2f1442['options']?_0x2f1442[_0x343e('0x18')]['attributes']||null:null,'limit':_0x2f1442[_0x343e('0x18')]?_0x2f1442[_0x343e('0x18')]['limit']||null:null})[_0x343e('0xe')](function(_0x1c05aa){logger['info'](_0x343e('0x26'),_0x2f1442);logger['debug'](_0x343e('0x26'),_0x2f1442,JSON['stringify'](_0x1c05aa));_0x4310fc(_0x1c05aa);})['catch'](function(_0x3b1c2d){logger[_0x343e('0x14')](_0x343e('0x26'),_0x3b1c2d['message'],_0x2f1442);_0x107ed3(_0x4b273a[_0x343e('0x14')](0x1f4,_0x3b1c2d[_0x343e('0x15')]));});});};
\ No newline at end of file
index e018ac9..12a99da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef39=['length','voiceQueueReport:','save','remove','update','emit','removeListener','register'];(function(_0x4d256d,_0x315b10){var _0x15f877=function(_0x668c93){while(--_0x668c93){_0x4d256d['push'](_0x4d256d['shift']());}};_0x15f877(++_0x315b10);}(_0xef39,0x92));var _0x9ef3=function(_0xf880b7,_0x4bfc62){_0xf880b7=_0xf880b7-0x0;var _0x28365a=_0xef39[_0xf880b7];return _0x28365a;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x9ef3('0x0'),_0x9ef3('0x1'),_0x9ef3('0x2')];function createListener(_0x1b0836,_0x27d008){return function(_0xd297b1){_0x27d008[_0x9ef3('0x3')](_0x1b0836,_0xd297b1);};}function removeListener(_0x162196,_0x2c4541){return function(){VoiceQueueReportEvents[_0x9ef3('0x4')](_0x162196,_0x2c4541);};}exports[_0x9ef3('0x5')]=function(_0x42911f){for(var _0x50b950=0x0,_0x1b8488=events[_0x9ef3('0x6')];_0x50b950<_0x1b8488;_0x50b950++){var _0x290ffd=events[_0x50b950];var _0x27cfaa=createListener(_0x9ef3('0x7')+_0x290ffd,_0x42911f);VoiceQueueReportEvents['on'](_0x290ffd,_0x27cfaa);}};
\ No newline at end of file
+var _0x2d17=['update','emit','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x585997,_0x14e13b){var _0x303868=function(_0x345e64){while(--_0x345e64){_0x585997['push'](_0x585997['shift']());}};_0x303868(++_0x14e13b);}(_0x2d17,0x17e));var _0x72d1=function(_0x579350,_0x1a6ff8){_0x579350=_0x579350-0x0;var _0x2973cb=_0x2d17[_0x579350];return _0x2973cb;};'use strict';var VoiceQueueReportEvents=require(_0x72d1('0x0'));var events=[_0x72d1('0x1'),'remove',_0x72d1('0x2')];function createListener(_0x4727f9,_0x531f4e){return function(_0x3687bc){_0x531f4e[_0x72d1('0x3')](_0x4727f9,_0x3687bc);};}function removeListener(_0x55b722,_0x1dd6d8){return function(){VoiceQueueReportEvents['removeListener'](_0x55b722,_0x1dd6d8);};}exports[_0x72d1('0x4')]=function(_0x50f551){for(var _0x139ba0=0x0,_0x239d1f=events['length'];_0x139ba0<_0x239d1f;_0x139ba0++){var _0x477264=events[_0x139ba0];var _0x422f5a=createListener(_0x72d1('0x5')+_0x477264,_0x50f551);VoiceQueueReportEvents['on'](_0x477264,_0x422f5a);}};
\ No newline at end of file
index e56aa10..2b0d30a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd34e=['Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x508b99,_0x29aaa4){var _0x1fa435=function(_0x2e26af){while(--_0x2e26af){_0x508b99['push'](_0x508b99['shift']());}};_0x1fa435(++_0x29aaa4);}(_0xd34e,0x1d6));var _0xed34=function(_0x3235cd,_0x4f5260){_0x3235cd=_0x3235cd-0x0;var _0x201d59=_0xd34e[_0x3235cd];return _0x201d59;};'use strict';var multer=require(_0xed34('0x0'));var util=require(_0xed34('0x1'));var path=require(_0xed34('0x2'));var timeout=require(_0xed34('0x3'));var express=require(_0xed34('0x4'));var router=express[_0xed34('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xed34('0x6'));var interaction=require(_0xed34('0x7'));var config=require('../../config/environment');var controller=require(_0xed34('0x8'));router[_0xed34('0x9')]('/',auth[_0xed34('0xa')](),controller[_0xed34('0xb')]);router[_0xed34('0x9')]('/:id',auth[_0xed34('0xa')](),controller[_0xed34('0xc')]);router['post']('/',auth[_0xed34('0xa')](),controller[_0xed34('0xd')]);router['put'](_0xed34('0xe'),auth[_0xed34('0xa')](),controller[_0xed34('0xf')]);router[_0xed34('0x10')](_0xed34('0xe'),auth[_0xed34('0xa')](),controller[_0xed34('0x11')]);module[_0xed34('0x12')]=router;
\ No newline at end of file
+var _0x9b9b=['show','post','update','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id'];(function(_0x3ca08f,_0x47d44d){var _0xdd4afb=function(_0x25dcad){while(--_0x25dcad){_0x3ca08f['push'](_0x3ca08f['shift']());}};_0xdd4afb(++_0x47d44d);}(_0x9b9b,0x114));var _0xb9b9=function(_0x50e703,_0x127370){_0x50e703=_0x50e703-0x0;var _0xf1840c=_0x9b9b[_0x50e703];return _0xf1840c;};'use strict';var multer=require('multer');var util=require(_0xb9b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9b9('0x1'));var router=express[_0xb9b9('0x2')]();var fs_extra=require(_0xb9b9('0x3'));var auth=require(_0xb9b9('0x4'));var interaction=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var controller=require(_0xb9b9('0x7'));router[_0xb9b9('0x8')]('/',auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xa')]);router[_0xb9b9('0x8')](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xc')]);router[_0xb9b9('0xd')]('/',auth[_0xb9b9('0x9')](),controller['create']);router['put'](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xe')]);router['delete'](_0xb9b9('0xb'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xf')]);module['exports']=router;
\ No newline at end of file
index 17a25c8..dfc1729 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a1=['moment','exports','STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x4b8890,_0x49ab18){var _0x3bfbf1=function(_0x658cc4){while(--_0x658cc4){_0x4b8890['push'](_0x4b8890['shift']());}};_0x3bfbf1(++_0x49ab18);}(_0x23a1,0x19c));var _0x123a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x23a1[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x123a('0x0'));var moment=require(_0x123a('0x1'));module[_0x123a('0x2')]={'time':{'type':Sequelize[_0x123a('0x3')]},'callid':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x123a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x123a('0x4')],'allowNull':![],'defaultValue':moment()[_0x123a('0x5')](_0x123a('0x6'))}};
\ No newline at end of file
+var _0x7313=['moment','exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x313118,_0x112646){var _0x14052d=function(_0x5b7870){while(--_0x5b7870){_0x313118['push'](_0x313118['shift']());}};_0x14052d(++_0x112646);}(_0x7313,0x1f1));var _0x3731=function(_0x266618,_0x18f637){_0x266618=_0x266618-0x0;var _0x54dbf5=_0x7313[_0x266618];return _0x54dbf5;};'use strict';var Sequelize=require(_0x3731('0x0'));var moment=require(_0x3731('0x1'));module[_0x3731('0x2')]={'time':{'type':Sequelize[_0x3731('0x3')]},'callid':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x3731('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x3731('0x4')](_0x3731('0x5'))}};
\ No newline at end of file
index e1c5b7b..21ce0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8555=['options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge'];(function(_0x3b5f8f,_0x36a95a){var _0x22e45c=function(_0x148a53){while(--_0x148a53){_0x3b5f8f['push'](_0x3b5f8f['shift']());}};_0x22e45c(++_0x36a95a);}(_0x8555,0xee));var _0x5855=function(_0x27c7da,_0x3ce7d1){_0x27c7da=_0x27c7da-0x0;var _0x490c5e=_0x8555[_0x27c7da];return _0x490c5e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5855('0x0'));var rp=require(_0x5855('0x1'));var moment=require(_0x5855('0x2'));var BPromise=require(_0x5855('0x3'));var Mustache=require(_0x5855('0x4'));var util=require(_0x5855('0x5'));var path=require('path');var sox=require(_0x5855('0x6'));var csv=require(_0x5855('0x7'));var ejs=require(_0x5855('0x8'));var fs=require('fs');var fs_extra=require(_0x5855('0x9'));var _=require('lodash');var squel=require(_0x5855('0xa'));var crypto=require(_0x5855('0xb'));var jsforce=require(_0x5855('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5855('0x7'));var querystring=require(_0x5855('0xd'));var Papa=require(_0x5855('0xe'));var Redis=require(_0x5855('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5855('0x10'));var as=require(_0x5855('0x11'));var hardwareService=require(_0x5855('0x12'));var logger=require(_0x5855('0x13'))(_0x5855('0x14'));var utils=require(_0x5855('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5855('0x16'));var db=require(_0x5855('0x17'))['db'];function respondWithStatusCode(_0x1550cd,_0x1a1fda){_0x1a1fda=_0x1a1fda||0xcc;return function(_0x230a9c){if(_0x230a9c){return _0x1550cd[_0x5855('0x18')](_0x1a1fda);}return _0x1550cd[_0x5855('0x19')](_0x1a1fda)[_0x5855('0x1a')]();};}function respondWithResult(_0x419261,_0x57eee1){_0x57eee1=_0x57eee1||0xc8;return function(_0x56652a){if(_0x56652a){return _0x419261['status'](_0x57eee1)[_0x5855('0x1b')](_0x56652a);}};}function respondWithFilteredResult(_0x898e8f,_0x2c9b31){return function(_0xe12c91){if(_0xe12c91){var _0x4997ca=typeof _0x2c9b31[_0x5855('0x1c')]===_0x5855('0x1d')&&typeof _0x2c9b31[_0x5855('0x1e')]===_0x5855('0x1d');var _0x22bd02=_0xe12c91[_0x5855('0x1f')];var _0x478524=_0x4997ca?0x0:_0x2c9b31[_0x5855('0x1c')];var _0x213b83=_0x4997ca?_0xe12c91['count']:_0x2c9b31[_0x5855('0x1c')]+_0x2c9b31[_0x5855('0x1e')];var _0x2f8d0b;if(_0x213b83>=_0x22bd02){_0x213b83=_0x22bd02;_0x2f8d0b=0xc8;}else{_0x2f8d0b=0xce;}_0x898e8f['status'](_0x2f8d0b);return _0x898e8f[_0x5855('0x20')](_0x5855('0x21'),_0x478524+'-'+_0x213b83+'/'+_0x22bd02)[_0x5855('0x1b')](_0xe12c91);}return null;};}function patchUpdates(_0x43d570){return function(_0x52b956){try{jsonpatch[_0x5855('0x22')](_0x52b956,_0x43d570,!![]);}catch(_0x44811f){return BPromise[_0x5855('0x23')](_0x44811f);}return _0x52b956['save']();};}function saveUpdates(_0x262165,_0x1b94d2){return function(_0x40dbf8){if(_0x40dbf8){return _0x40dbf8[_0x5855('0x24')](_0x262165)[_0x5855('0x25')](function(_0x35fe30){return _0x35fe30;});}return null;};}function removeEntity(_0x4dffc7,_0x117d9b){return function(_0x1f8ee8){if(_0x1f8ee8){return _0x1f8ee8['destroy']()[_0x5855('0x25')](function(){_0x4dffc7['status'](0xcc)[_0x5855('0x1a')]();});}};}function handleEntityNotFound(_0x337c50,_0x260f07){return function(_0x36184f){if(!_0x36184f){_0x337c50[_0x5855('0x18')](0x194);}return _0x36184f;};}function handleError(_0x522b87,_0x447cd7){_0x447cd7=_0x447cd7||0x1f4;return function(_0x515335){logger[_0x5855('0x26')](_0x515335[_0x5855('0x27')]);if(_0x515335[_0x5855('0x28')]){delete _0x515335[_0x5855('0x28')];}_0x522b87[_0x5855('0x19')](_0x447cd7)['send'](_0x515335);};}exports['index']=function(_0x42107a,_0x55317b){var _0x1c5244={},_0x2c683a={},_0x5692b4={'count':0x0,'rows':[]};var _0x4362bd=_[_0x5855('0x29')](db[_0x5855('0x2a')][_0x5855('0x2b')],function(_0x167af5){return{'name':_0x167af5[_0x5855('0x2c')],'type':_0x167af5[_0x5855('0x2d')][_0x5855('0x2e')]};});_0x2c683a[_0x5855('0x2f')]=_[_0x5855('0x29')](_0x4362bd,'name');_0x2c683a[_0x5855('0x30')]=_[_0x5855('0x31')](_0x42107a[_0x5855('0x30')]);_0x2c683a['filters']=_[_0x5855('0x32')](_0x2c683a[_0x5855('0x2f')],_0x2c683a[_0x5855('0x30')]);_0x1c5244[_0x5855('0x33')]=_[_0x5855('0x32')](_0x2c683a['model'],qs[_0x5855('0x34')](_0x42107a[_0x5855('0x30')]['fields']));_0x1c5244[_0x5855('0x33')]=_0x1c5244[_0x5855('0x33')]['length']?_0x1c5244[_0x5855('0x33')]:_0x2c683a[_0x5855('0x2f')];if(!_0x42107a[_0x5855('0x30')][_0x5855('0x35')](_0x5855('0x36'))){_0x1c5244[_0x5855('0x1e')]=qs[_0x5855('0x1e')](_0x42107a[_0x5855('0x30')][_0x5855('0x1e')]);_0x1c5244[_0x5855('0x1c')]=qs[_0x5855('0x1c')](_0x42107a[_0x5855('0x30')][_0x5855('0x1c')]);}_0x1c5244[_0x5855('0x37')]=qs[_0x5855('0x38')](_0x42107a[_0x5855('0x30')][_0x5855('0x38')]);_0x1c5244[_0x5855('0x39')]=qs[_0x5855('0x3a')](_[_0x5855('0x3b')](_0x42107a[_0x5855('0x30')],_0x2c683a[_0x5855('0x3a')]),_0x4362bd);if(_0x42107a[_0x5855('0x30')][_0x5855('0x3c')]){_0x1c5244[_0x5855('0x39')]=_[_0x5855('0x3d')](_0x1c5244[_0x5855('0x39')],{'$or':_[_0x5855('0x29')](_0x4362bd,function(_0x5911bd){if(_0x5911bd['type']!=='VIRTUAL'){var _0x4f7646={};_0x4f7646[_0x5911bd['name']]={'$like':'%'+_0x42107a[_0x5855('0x30')][_0x5855('0x3c')]+'%'};return _0x4f7646;}})});}_0x1c5244=_[_0x5855('0x3d')]({},_0x1c5244,_0x42107a[_0x5855('0x3e')]);var _0x38ec02={'where':_0x1c5244[_0x5855('0x39')]};return db[_0x5855('0x2a')][_0x5855('0x1f')](_0x38ec02)[_0x5855('0x25')](function(_0x5b6e9e){_0x5692b4[_0x5855('0x1f')]=_0x5b6e9e;if(_0x42107a[_0x5855('0x30')][_0x5855('0x3f')]){_0x1c5244[_0x5855('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x5855('0x41')](_0x1c5244);})[_0x5855('0x25')](function(_0x5a88a0){_0x5692b4[_0x5855('0x42')]=_0x5a88a0;return _0x5692b4;})[_0x5855('0x25')](respondWithFilteredResult(_0x55317b,_0x1c5244))[_0x5855('0x43')](handleError(_0x55317b,null));};exports[_0x5855('0x44')]=function(_0x35ae78,_0x1ce8cf){var _0x26f720={'raw':!![],'where':{'id':_0x35ae78[_0x5855('0x45')]['id']}},_0x245ce6={};_0x245ce6['model']=_[_0x5855('0x31')](db[_0x5855('0x2a')][_0x5855('0x2b')]);_0x245ce6[_0x5855('0x30')]=_[_0x5855('0x31')](_0x35ae78[_0x5855('0x30')]);_0x245ce6[_0x5855('0x3a')]=_[_0x5855('0x32')](_0x245ce6[_0x5855('0x2f')],_0x245ce6[_0x5855('0x30')]);_0x26f720[_0x5855('0x33')]=_['intersection'](_0x245ce6[_0x5855('0x2f')],qs[_0x5855('0x34')](_0x35ae78[_0x5855('0x30')][_0x5855('0x34')]));_0x26f720[_0x5855('0x33')]=_0x26f720['attributes'][_0x5855('0x46')]?_0x26f720[_0x5855('0x33')]:_0x245ce6['model'];if(_0x35ae78[_0x5855('0x30')][_0x5855('0x3f')]){_0x26f720[_0x5855('0x40')]=[{'all':!![]}];}_0x26f720=_[_0x5855('0x3d')]({},_0x26f720,_0x35ae78[_0x5855('0x3e')]);return db[_0x5855('0x2a')][_0x5855('0x47')](_0x26f720)['then'](handleEntityNotFound(_0x1ce8cf,null))[_0x5855('0x25')](respondWithResult(_0x1ce8cf,null))['catch'](handleError(_0x1ce8cf,null));};exports['create']=function(_0xa2e888,_0xbbf4b7){return db['VoiceQueuesLog'][_0x5855('0x48')](_0xa2e888[_0x5855('0x49')],{})[_0x5855('0x25')](respondWithResult(_0xbbf4b7,0xc9))['catch'](handleError(_0xbbf4b7,null));};exports['update']=function(_0x402d30,_0x2d7ff1){if(_0x402d30['body']['id']){delete _0x402d30[_0x5855('0x49')]['id'];}return db[_0x5855('0x2a')][_0x5855('0x47')]({'where':{'id':_0x402d30[_0x5855('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d7ff1,null))[_0x5855('0x25')](saveUpdates(_0x402d30[_0x5855('0x49')],null))['then'](respondWithResult(_0x2d7ff1,null))[_0x5855('0x43')](handleError(_0x2d7ff1,null));};exports[_0x5855('0x4a')]=function(_0x22aef6,_0x31c2f4){return db['VoiceQueuesLog']['find']({'where':{'id':_0x22aef6[_0x5855('0x45')]['id']}})[_0x5855('0x25')](handleEntityNotFound(_0x31c2f4,null))[_0x5855('0x25')](removeEntity(_0x31c2f4,null))[_0x5855('0x43')](handleError(_0x31c2f4,null));};
\ No newline at end of file
+var _0x8e12=['destroy','error','name','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','VoiceQueuesLog','findAll','rows','catch','show','params','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8e12,0x6b));var _0x28e1=function(_0xdc41ca,_0x134994){_0xdc41ca=_0xdc41ca-0x0;var _0xf3bdc3=_0x8e12[_0xdc41ca];return _0xf3bdc3;};'use strict';var emlformat=require(_0x28e1('0x0'));var rimraf=require(_0x28e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x28e1('0x2'));var rp=require(_0x28e1('0x3'));var moment=require(_0x28e1('0x4'));var BPromise=require(_0x28e1('0x5'));var Mustache=require(_0x28e1('0x6'));var util=require('util');var path=require(_0x28e1('0x7'));var sox=require('sox');var csv=require(_0x28e1('0x8'));var ejs=require(_0x28e1('0x9'));var fs=require('fs');var fs_extra=require(_0x28e1('0xa'));var _=require(_0x28e1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x28e1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x28e1('0x8'));var querystring=require('querystring');var Papa=require(_0x28e1('0xd'));var Redis=require(_0x28e1('0xe'));var authService=require(_0x28e1('0xf'));var qs=require(_0x28e1('0x10'));var as=require(_0x28e1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x28e1('0x12'));var utils=require(_0x28e1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x28e1('0x14'));var db=require(_0x28e1('0x15'))['db'];function respondWithStatusCode(_0x580fbc,_0x55b9e2){_0x55b9e2=_0x55b9e2||0xcc;return function(_0x574352){if(_0x574352){return _0x580fbc[_0x28e1('0x16')](_0x55b9e2);}return _0x580fbc['status'](_0x55b9e2)[_0x28e1('0x17')]();};}function respondWithResult(_0x2d8414,_0x3dcc56){_0x3dcc56=_0x3dcc56||0xc8;return function(_0x25f59a){if(_0x25f59a){return _0x2d8414[_0x28e1('0x18')](_0x3dcc56)['json'](_0x25f59a);}};}function respondWithFilteredResult(_0x114fc5,_0x1566f0){return function(_0x27af04){if(_0x27af04){var _0x1e32e8=typeof _0x1566f0[_0x28e1('0x19')]===_0x28e1('0x1a')&&typeof _0x1566f0[_0x28e1('0x1b')]===_0x28e1('0x1a');var _0x574c8d=_0x27af04[_0x28e1('0x1c')];var _0x3bd5d1=_0x1e32e8?0x0:_0x1566f0[_0x28e1('0x19')];var _0x2ab1d1=_0x1e32e8?_0x27af04[_0x28e1('0x1c')]:_0x1566f0['offset']+_0x1566f0['limit'];var _0x3c8995;if(_0x2ab1d1>=_0x574c8d){_0x2ab1d1=_0x574c8d;_0x3c8995=0xc8;}else{_0x3c8995=0xce;}_0x114fc5['status'](_0x3c8995);return _0x114fc5[_0x28e1('0x1d')](_0x28e1('0x1e'),_0x3bd5d1+'-'+_0x2ab1d1+'/'+_0x574c8d)[_0x28e1('0x1f')](_0x27af04);}return null;};}function patchUpdates(_0x50e33b){return function(_0x2b31e9){try{jsonpatch[_0x28e1('0x20')](_0x2b31e9,_0x50e33b,!![]);}catch(_0x2938d1){return BPromise[_0x28e1('0x21')](_0x2938d1);}return _0x2b31e9[_0x28e1('0x22')]();};}function saveUpdates(_0x2e821a,_0x4383f3){return function(_0x3d8071){if(_0x3d8071){return _0x3d8071[_0x28e1('0x23')](_0x2e821a)[_0x28e1('0x24')](function(_0x3f9192){return _0x3f9192;});}return null;};}function removeEntity(_0x230264,_0x2c692c){return function(_0x233e73){if(_0x233e73){return _0x233e73[_0x28e1('0x25')]()['then'](function(){_0x230264[_0x28e1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5167ef,_0x4e7947){return function(_0x245536){if(!_0x245536){_0x5167ef[_0x28e1('0x16')](0x194);}return _0x245536;};}function handleError(_0x35e259,_0x317e44){_0x317e44=_0x317e44||0x1f4;return function(_0x465274){logger[_0x28e1('0x26')](_0x465274['stack']);if(_0x465274['name']){delete _0x465274[_0x28e1('0x27')];}_0x35e259[_0x28e1('0x18')](_0x317e44)['send'](_0x465274);};}exports['index']=function(_0x191140,_0x331775){var _0x355407={},_0x555d59={},_0x4b6f14={'count':0x0,'rows':[]};var _0x565498=_['map'](db['VoiceQueuesLog'][_0x28e1('0x28')],function(_0x2ccb84){return{'name':_0x2ccb84[_0x28e1('0x29')],'type':_0x2ccb84[_0x28e1('0x2a')][_0x28e1('0x2b')]};});_0x555d59[_0x28e1('0x2c')]=_[_0x28e1('0x2d')](_0x565498,_0x28e1('0x27'));_0x555d59[_0x28e1('0x2e')]=_[_0x28e1('0x2f')](_0x191140[_0x28e1('0x2e')]);_0x555d59[_0x28e1('0x30')]=_['intersection'](_0x555d59[_0x28e1('0x2c')],_0x555d59[_0x28e1('0x2e')]);_0x355407[_0x28e1('0x31')]=_[_0x28e1('0x32')](_0x555d59[_0x28e1('0x2c')],qs['fields'](_0x191140[_0x28e1('0x2e')][_0x28e1('0x33')]));_0x355407[_0x28e1('0x31')]=_0x355407['attributes']['length']?_0x355407[_0x28e1('0x31')]:_0x555d59[_0x28e1('0x2c')];if(!_0x191140[_0x28e1('0x2e')][_0x28e1('0x34')](_0x28e1('0x35'))){_0x355407[_0x28e1('0x1b')]=qs[_0x28e1('0x1b')](_0x191140[_0x28e1('0x2e')]['limit']);_0x355407[_0x28e1('0x19')]=qs[_0x28e1('0x19')](_0x191140[_0x28e1('0x2e')]['offset']);}_0x355407[_0x28e1('0x36')]=qs[_0x28e1('0x37')](_0x191140['query'][_0x28e1('0x37')]);_0x355407['where']=qs[_0x28e1('0x30')](_[_0x28e1('0x38')](_0x191140[_0x28e1('0x2e')],_0x555d59[_0x28e1('0x30')]),_0x565498);if(_0x191140[_0x28e1('0x2e')][_0x28e1('0x39')]){_0x355407[_0x28e1('0x3a')]=_[_0x28e1('0x3b')](_0x355407[_0x28e1('0x3a')],{'$or':_[_0x28e1('0x2d')](_0x565498,function(_0xe24da6){if(_0xe24da6[_0x28e1('0x2a')]!=='VIRTUAL'){var _0x5a4a6a={};_0x5a4a6a[_0xe24da6[_0x28e1('0x27')]]={'$like':'%'+_0x191140[_0x28e1('0x2e')]['filter']+'%'};return _0x5a4a6a;}})});}_0x355407=_[_0x28e1('0x3b')]({},_0x355407,_0x191140['options']);var _0x51c370={'where':_0x355407['where']};return db['VoiceQueuesLog']['count'](_0x51c370)[_0x28e1('0x24')](function(_0x198fc0){_0x4b6f14[_0x28e1('0x1c')]=_0x198fc0;if(_0x191140[_0x28e1('0x2e')][_0x28e1('0x3c')]){_0x355407[_0x28e1('0x3d')]=[{'all':!![]}];}return db[_0x28e1('0x3e')][_0x28e1('0x3f')](_0x355407);})[_0x28e1('0x24')](function(_0x51d3b2){_0x4b6f14[_0x28e1('0x40')]=_0x51d3b2;return _0x4b6f14;})[_0x28e1('0x24')](respondWithFilteredResult(_0x331775,_0x355407))[_0x28e1('0x41')](handleError(_0x331775,null));};exports[_0x28e1('0x42')]=function(_0x349bf7,_0x3a3465){var _0x1d9fea={'raw':!![],'where':{'id':_0x349bf7[_0x28e1('0x43')]['id']}},_0x319515={};_0x319515['model']=_[_0x28e1('0x2f')](db[_0x28e1('0x3e')][_0x28e1('0x28')]);_0x319515[_0x28e1('0x2e')]=_['keys'](_0x349bf7[_0x28e1('0x2e')]);_0x319515[_0x28e1('0x30')]=_['intersection'](_0x319515['model'],_0x319515[_0x28e1('0x2e')]);_0x1d9fea['attributes']=_[_0x28e1('0x32')](_0x319515[_0x28e1('0x2c')],qs[_0x28e1('0x33')](_0x349bf7[_0x28e1('0x2e')][_0x28e1('0x33')]));_0x1d9fea[_0x28e1('0x31')]=_0x1d9fea['attributes']['length']?_0x1d9fea[_0x28e1('0x31')]:_0x319515['model'];if(_0x349bf7[_0x28e1('0x2e')][_0x28e1('0x3c')]){_0x1d9fea[_0x28e1('0x3d')]=[{'all':!![]}];}_0x1d9fea=_[_0x28e1('0x3b')]({},_0x1d9fea,_0x349bf7[_0x28e1('0x44')]);return db[_0x28e1('0x3e')][_0x28e1('0x45')](_0x1d9fea)[_0x28e1('0x24')](handleEntityNotFound(_0x3a3465,null))[_0x28e1('0x24')](respondWithResult(_0x3a3465,null))[_0x28e1('0x41')](handleError(_0x3a3465,null));};exports[_0x28e1('0x46')]=function(_0x199ab9,_0x27bc53){return db[_0x28e1('0x3e')][_0x28e1('0x46')](_0x199ab9[_0x28e1('0x47')],{})[_0x28e1('0x24')](respondWithResult(_0x27bc53,0xc9))[_0x28e1('0x41')](handleError(_0x27bc53,null));};exports['update']=function(_0x1efe14,_0xc0907f){if(_0x1efe14[_0x28e1('0x47')]['id']){delete _0x1efe14[_0x28e1('0x47')]['id'];}return db['VoiceQueuesLog'][_0x28e1('0x45')]({'where':{'id':_0x1efe14['params']['id']}})[_0x28e1('0x24')](handleEntityNotFound(_0xc0907f,null))[_0x28e1('0x24')](saveUpdates(_0x1efe14[_0x28e1('0x47')],null))[_0x28e1('0x24')](respondWithResult(_0xc0907f,null))['catch'](handleError(_0xc0907f,null));};exports[_0x28e1('0x25')]=function(_0x3a6bd9,_0x35e0e5){return db[_0x28e1('0x3e')][_0x28e1('0x45')]({'where':{'id':_0x3a6bd9[_0x28e1('0x43')]['id']}})[_0x28e1('0x24')](handleEntityNotFound(_0x35e0e5,null))[_0x28e1('0x24')](removeEntity(_0x35e0e5,null))[_0x28e1('0x41')](handleError(_0x35e0e5,null));};
\ No newline at end of file
index bafaa55..bba4cdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5eb=['util','../../config/logger','api','request-promise','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0xb5eb,0xd1));var _0xbb5e=function(_0x5e1e58,_0x299204){_0x5e1e58=_0x5e1e58-0x0;var _0x65f79e=_0xb5eb[_0x5e1e58];return _0x65f79e;};'use strict';var _=require('lodash');var util=require(_0xbb5e('0x0'));var logger=require(_0xbb5e('0x1'))(_0xbb5e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbb5e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb5e('0x4'));var config=require('../../config/environment');var attributes=require(_0xbb5e('0x5'));module[_0xbb5e('0x6')]=function(_0x40bbf8,_0x34f25e){return _0x40bbf8[_0xbb5e('0x7')](_0xbb5e('0x8'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xbb5e('0x9'),'fields':[_0xbb5e('0xa'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0x94c4=['event','dtm','lodash','util','moment','request-promise','path','rimraf','VoiceQueuesLog','event_dtm'];(function(_0x38e177,_0x59ec9f){var _0x1faf15=function(_0x4cf149){while(--_0x4cf149){_0x38e177['push'](_0x38e177['shift']());}};_0x1faf15(++_0x59ec9f);}(_0x94c4,0x11a));var _0x494c=function(_0xd0c502,_0x20ac2f){_0xd0c502=_0xd0c502-0x0;var _0x42cb91=_0x94c4[_0xd0c502];return _0x42cb91;};'use strict';var _=require(_0x494c('0x0'));var util=require(_0x494c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x494c('0x2'));var BPromise=require('bluebird');var rp=require(_0x494c('0x3'));var fs=require('fs');var path=require(_0x494c('0x4'));var rimraf=require(_0x494c('0x5'));var config=require('../../config/environment');var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x11d81c,_0xdffa8a){return _0x11d81c['define'](_0x494c('0x6'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x494c('0x7'),'fields':[_0x494c('0x8'),_0x494c('0x9')]}],'timestamps':![]});};
\ No newline at end of file
index 4f5f9ef..e002349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32e5=['../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3fda3d,_0x27a816){var _0x391ea8=function(_0x4bdc6a){while(--_0x4bdc6a){_0x3fda3d['push'](_0x3fda3d['shift']());}};_0x391ea8(++_0x27a816);}(_0x32e5,0x149));var _0x532e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x32e5[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x532e('0x0'));var util=require(_0x532e('0x1'));var moment=require(_0x532e('0x2'));var BPromise=require('bluebird');var rs=require(_0x532e('0x3'));var fs=require('fs');var Redis=require(_0x532e('0x4'));var db=require(_0x532e('0x5'))['db'];var utils=require(_0x532e('0x6'));var logger=require(_0x532e('0x7'))(_0x532e('0x8'));var config=require(_0x532e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x532e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e3a5c,_0x43cb4d,_0x182b56){return new BPromise(function(_0x485312,_0x55778e){return client[_0x532e('0xb')](_0x4e3a5c,_0x182b56)[_0x532e('0xc')](function(_0xbc09a1){logger[_0x532e('0xd')](_0x532e('0xe'),_0x43cb4d,_0x532e('0xf'));logger[_0x532e('0x10')](_0x532e('0x11'),_0x43cb4d,'request\x20sent',JSON[_0x532e('0x12')](_0xbc09a1));if(_0xbc09a1[_0x532e('0x13')]){if(_0xbc09a1[_0x532e('0x13')][_0x532e('0x14')]===0x1f4){logger[_0x532e('0x13')](_0x532e('0xe'),_0x43cb4d,_0xbc09a1[_0x532e('0x13')]['message']);return _0x55778e(_0xbc09a1['error'][_0x532e('0x15')]);}logger['error'](_0x532e('0xe'),_0x43cb4d,_0xbc09a1[_0x532e('0x13')][_0x532e('0x15')]);return _0x485312(_0xbc09a1[_0x532e('0x13')]['message']);}else{logger[_0x532e('0xd')](_0x532e('0xe'),_0x43cb4d,_0x532e('0xf'));_0x485312(_0xbc09a1[_0x532e('0x16')][_0x532e('0x15')]);}})[_0x532e('0x17')](function(_0x68caa4){logger[_0x532e('0x13')](_0x532e('0xe'),_0x43cb4d,_0x68caa4);_0x55778e(_0x68caa4);});});}
\ No newline at end of file
+var _0x1060=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x17bc68,_0x200a0a){var _0x8848f5=function(_0x193f25){while(--_0x193f25){_0x17bc68['push'](_0x17bc68['shift']());}};_0x8848f5(++_0x200a0a);}(_0x1060,0x147));var _0x0106=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x1060[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x0106('0x0'));var util=require(_0x0106('0x1'));var moment=require(_0x0106('0x2'));var BPromise=require(_0x0106('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0106('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0106('0x5'));var logger=require(_0x0106('0x6'))(_0x0106('0x7'));var config=require(_0x0106('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0106('0x9')][_0x0106('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x848c04,_0x2b3b68,_0x1951a1){return new BPromise(function(_0x2bf569,_0x319434){return client[_0x0106('0xb')](_0x848c04,_0x1951a1)[_0x0106('0xc')](function(_0xda9991){logger['info'](_0x0106('0xd'),_0x2b3b68,_0x0106('0xe'));logger['debug'](_0x0106('0xf'),_0x2b3b68,_0x0106('0xe'),JSON[_0x0106('0x10')](_0xda9991));if(_0xda9991[_0x0106('0x11')]){if(_0xda9991['error'][_0x0106('0x12')]===0x1f4){logger[_0x0106('0x11')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2b3b68,_0xda9991['error']['message']);return _0x319434(_0xda9991[_0x0106('0x11')][_0x0106('0x13')]);}logger[_0x0106('0x11')](_0x0106('0xd'),_0x2b3b68,_0xda9991[_0x0106('0x11')]['message']);return _0x2bf569(_0xda9991[_0x0106('0x11')][_0x0106('0x13')]);}else{logger['info'](_0x0106('0xd'),_0x2b3b68,_0x0106('0xe'));_0x2bf569(_0xda9991[_0x0106('0x14')][_0x0106('0x13')]);}})[_0x0106('0x15')](function(_0x37a6c5){logger[_0x0106('0x11')](_0x0106('0xd'),_0x2b3b68,_0x37a6c5);_0x319434(_0x37a6c5);});});}
\ No newline at end of file
index 82ae726..28a034e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c65=['post','runTranscribe','put','update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','download','/:id/downloads','downloads','/:id/transcribe'];(function(_0x409c8b,_0x4892d4){var _0x430500=function(_0x386132){while(--_0x386132){_0x409c8b['push'](_0x409c8b['shift']());}};_0x430500(++_0x4892d4);}(_0x8c65,0xa7));var _0x58c6=function(_0x1e909d,_0x4a8f3d){_0x1e909d=_0x1e909d-0x0;var _0x4762cd=_0x8c65[_0x1e909d];return _0x4762cd;};'use strict';var multer=require(_0x58c6('0x0'));var util=require(_0x58c6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x58c6('0x2')]();var fs_extra=require(_0x58c6('0x3'));var auth=require(_0x58c6('0x4'));var interaction=require(_0x58c6('0x5'));var config=require(_0x58c6('0x6'));var controller=require('./voiceRecording.controller');router[_0x58c6('0x7')]('/',auth[_0x58c6('0x8')](),controller['index']);router[_0x58c6('0x7')](_0x58c6('0x9'),auth[_0x58c6('0x8')](),controller[_0x58c6('0xa')]);router[_0x58c6('0x7')](_0x58c6('0xb'),auth[_0x58c6('0x8')](),controller[_0x58c6('0xc')]);router['get']('/:id/download',auth[_0x58c6('0x8')](),controller[_0x58c6('0xd')]);router['get'](_0x58c6('0xe'),controller[_0x58c6('0xf')]);router[_0x58c6('0x7')](_0x58c6('0x10'),auth[_0x58c6('0x8')](),controller['downloadTranscribe']);router[_0x58c6('0x11')]('/',auth[_0x58c6('0x8')](),controller['create']);router[_0x58c6('0x11')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x58c6('0x12')]);router[_0x58c6('0x13')](_0x58c6('0xb'),auth[_0x58c6('0x8')](),controller[_0x58c6('0x14')]);router[_0x58c6('0x15')](_0x58c6('0xb'),auth[_0x58c6('0x8')](),controller[_0x58c6('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x1b7b=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','describe','show','download','/:id/downloads','downloads','downloadTranscribe','create','/:id/transcribe','/:id','update','delete','destroy','exports'];(function(_0x5cb4ce,_0x14635a){var _0x4b626f=function(_0x19121c){while(--_0x19121c){_0x5cb4ce['push'](_0x5cb4ce['shift']());}};_0x4b626f(++_0x14635a);}(_0x1b7b,0x142));var _0xb1b7=function(_0x3f989c,_0x3bc8b0){_0x3f989c=_0x3f989c-0x0;var _0x1ec962=_0x1b7b[_0x3f989c];return _0x1ec962;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb1b7('0x0'));var timeout=require(_0xb1b7('0x1'));var express=require('express');var router=express[_0xb1b7('0x2')]();var fs_extra=require(_0xb1b7('0x3'));var auth=require(_0xb1b7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb1b7('0x5'));var controller=require(_0xb1b7('0x6'));router[_0xb1b7('0x7')]('/',auth[_0xb1b7('0x8')](),controller[_0xb1b7('0x9')]);router[_0xb1b7('0x7')]('/describe',auth[_0xb1b7('0x8')](),controller[_0xb1b7('0xa')]);router[_0xb1b7('0x7')]('/:id',auth[_0xb1b7('0x8')](),controller[_0xb1b7('0xb')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xb1b7('0xc')]);router[_0xb1b7('0x7')](_0xb1b7('0xd'),controller[_0xb1b7('0xe')]);router['get']('/:id/transcribe',auth[_0xb1b7('0x8')](),controller[_0xb1b7('0xf')]);router['post']('/',auth[_0xb1b7('0x8')](),controller[_0xb1b7('0x10')]);router['post'](_0xb1b7('0x11'),auth[_0xb1b7('0x8')](),controller['runTranscribe']);router['put'](_0xb1b7('0x12'),auth['isAuthenticated'](),controller[_0xb1b7('0x13')]);router[_0xb1b7('0x14')](_0xb1b7('0x12'),auth[_0xb1b7('0x8')](),controller[_0xb1b7('0x15')]);module[_0xb1b7('0x16')]=router;
\ No newline at end of file
index 560d6d9..d5001a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 80c1d79..30f4e75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8116=['[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','secrets','Setting','findOne','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','data1','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','sendStatus','stack','name','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','downloads','../../components/encryptor','sequelize','MD5','col','token','$and','push','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','end','createBucket','upload','TranscribeService','startTranscriptionJob'];(function(_0x3a73bc,_0x550aef){var _0x32891b=function(_0x20b4cb){while(--_0x20b4cb){_0x3a73bc['push'](_0x3a73bc['shift']());}};_0x32891b(++_0x550aef);}(_0x8116,0x1f1));var _0x6811=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8116[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x6811('0x0'));var rimraf=require(_0x6811('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6811('0x2'));var moment=require(_0x6811('0x3'));var BPromise=require(_0x6811('0x4'));var Mustache=require(_0x6811('0x5'));var util=require('util');var path=require(_0x6811('0x6'));var sox=require(_0x6811('0x7'));var csv=require(_0x6811('0x8'));var ejs=require(_0x6811('0x9'));var fs=require('fs');var fs_extra=require(_0x6811('0xa'));var _=require(_0x6811('0xb'));var squel=require(_0x6811('0xc'));var crypto=require('crypto');var jsforce=require(_0x6811('0xd'));var deskjs=require(_0x6811('0xe'));var toCsv=require(_0x6811('0x8'));var querystring=require(_0x6811('0xf'));var Papa=require(_0x6811('0x10'));var AWS=require(_0x6811('0x11'));var uuidv4=require(_0x6811('0x12'));var Redis=require('ioredis');var authService=require(_0x6811('0x13'));var qs=require(_0x6811('0x14'));var as=require(_0x6811('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6811('0x16'))(_0x6811('0x17'));var utils=require('../../config/utils');var config=require(_0x6811('0x18'));var licenseUtil=require(_0x6811('0x19'));var db=require(_0x6811('0x1a'))['db'];function respondWithStatusCode(_0x165d39,_0x5c8f41){_0x5c8f41=_0x5c8f41||0xcc;return function(_0x561dc0){if(_0x561dc0){return _0x165d39['sendStatus'](_0x5c8f41);}return _0x165d39[_0x6811('0x1b')](_0x5c8f41)['end']();};}function respondWithResult(_0x3fd8e6,_0x4d9c95){_0x4d9c95=_0x4d9c95||0xc8;return function(_0x2728b9){if(_0x2728b9){return _0x3fd8e6[_0x6811('0x1b')](_0x4d9c95)['json'](_0x2728b9);}};}function respondWithFilteredResult(_0x3e85c7,_0x10e86d){return function(_0xe31c6a){if(_0xe31c6a){var _0x495533=typeof _0x10e86d[_0x6811('0x1c')]===_0x6811('0x1d')&&typeof _0x10e86d['limit']===_0x6811('0x1d');var _0x3c8a4b=_0xe31c6a[_0x6811('0x1e')];var _0x19fcc0=_0x495533?0x0:_0x10e86d[_0x6811('0x1c')];var _0x3310f6=_0x495533?_0xe31c6a[_0x6811('0x1e')]:_0x10e86d[_0x6811('0x1c')]+_0x10e86d[_0x6811('0x1f')];var _0x15c377;if(_0x3310f6>=_0x3c8a4b){_0x3310f6=_0x3c8a4b;_0x15c377=0xc8;}else{_0x15c377=0xce;}_0x3e85c7[_0x6811('0x1b')](_0x15c377);return _0x3e85c7[_0x6811('0x20')](_0x6811('0x21'),_0x19fcc0+'-'+_0x3310f6+'/'+_0x3c8a4b)[_0x6811('0x22')](_0xe31c6a);}return null;};}function patchUpdates(_0x1a7f49){return function(_0x286427){try{jsonpatch['apply'](_0x286427,_0x1a7f49,!![]);}catch(_0x251c1a){return BPromise['reject'](_0x251c1a);}return _0x286427[_0x6811('0x23')]();};}function saveUpdates(_0x377513,_0x84f05a){return function(_0xc21e45){if(_0xc21e45){return _0xc21e45[_0x6811('0x24')](_0x377513)[_0x6811('0x25')](function(_0x125575){return _0x125575;});}return null;};}function removeEntity(_0x1c32ce,_0x3fcf8d){return function(_0x235749){if(_0x235749){return _0x235749[_0x6811('0x26')]()[_0x6811('0x25')](function(){_0x1c32ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dfafa,_0x550723){return function(_0x31b2c5){if(!_0x31b2c5){_0x2dfafa[_0x6811('0x27')](0x194);}return _0x31b2c5;};}function handleError(_0x4103a6,_0x1fb258){_0x1fb258=_0x1fb258||0x1f4;return function(_0x4eccac){logger['error'](_0x4eccac[_0x6811('0x28')]);if(_0x4eccac['name']){delete _0x4eccac[_0x6811('0x29')];}_0x4103a6[_0x6811('0x1b')](_0x1fb258)['send'](_0x4eccac);};}exports['index']=function(_0x5ce575,_0x157212){var _0x352c6c={},_0x21ec35={},_0x1dd9b0={'count':0x0,'rows':[]};var _0x31a954=_[_0x6811('0x2a')](db[_0x6811('0x2b')]['rawAttributes'],function(_0x3e683b){return{'name':_0x3e683b[_0x6811('0x2c')],'type':_0x3e683b[_0x6811('0x2d')][_0x6811('0x2e')]};});_0x21ec35[_0x6811('0x2f')]=_[_0x6811('0x30')](_[_0x6811('0x2a')](_0x31a954,_0x6811('0x29')),[_0x6811('0x31')]);_0x21ec35['query']=_[_0x6811('0x32')](_0x5ce575[_0x6811('0x33')]);_0x21ec35[_0x6811('0x34')]=_[_0x6811('0x35')](_0x21ec35[_0x6811('0x2f')],_0x21ec35[_0x6811('0x33')]);_0x352c6c[_0x6811('0x36')]=_[_0x6811('0x35')](_0x21ec35[_0x6811('0x2f')],qs[_0x6811('0x37')](_0x5ce575[_0x6811('0x33')][_0x6811('0x37')]));_0x352c6c['attributes']=_0x352c6c[_0x6811('0x36')][_0x6811('0x38')]?_0x352c6c[_0x6811('0x36')]:_0x21ec35[_0x6811('0x2f')];if(!_0x5ce575[_0x6811('0x33')][_0x6811('0x39')](_0x6811('0x3a'))){_0x352c6c['limit']=qs['limit'](_0x5ce575['query'][_0x6811('0x1f')]);_0x352c6c['offset']=qs[_0x6811('0x1c')](_0x5ce575[_0x6811('0x33')][_0x6811('0x1c')]);}_0x352c6c[_0x6811('0x3b')]=qs[_0x6811('0x3c')](_0x5ce575['query'][_0x6811('0x3c')]);_0x352c6c[_0x6811('0x3d')]=qs[_0x6811('0x34')](_[_0x6811('0x3e')](_0x5ce575[_0x6811('0x33')],_0x21ec35[_0x6811('0x34')]),_0x31a954);if(_0x5ce575[_0x6811('0x33')]['filter']){_0x352c6c[_0x6811('0x3d')]=_[_0x6811('0x3f')](_0x352c6c['where'],{'$or':_[_0x6811('0x2a')](_0x31a954,function(_0x5813f1){if(_0x5813f1[_0x6811('0x2d')]!=='VIRTUAL'){var _0x404efe={};_0x404efe[_0x5813f1[_0x6811('0x29')]]={'$like':'%'+_0x5ce575[_0x6811('0x33')][_0x6811('0x40')]+'%'};return _0x404efe;}})});}_0x352c6c=_[_0x6811('0x3f')]({},_0x352c6c,_0x5ce575[_0x6811('0x41')]);var _0x141d54={'where':_0x352c6c[_0x6811('0x3d')]};return db[_0x6811('0x2b')]['count'](_0x141d54)[_0x6811('0x25')](function(_0x2937d9){_0x1dd9b0[_0x6811('0x1e')]=_0x2937d9;if(_0x5ce575[_0x6811('0x33')][_0x6811('0x42')]){_0x352c6c[_0x6811('0x43')]=[{'all':!![]}];}return db[_0x6811('0x2b')][_0x6811('0x44')](_0x352c6c);})[_0x6811('0x25')](function(_0x3607fb){_0x1dd9b0[_0x6811('0x45')]=_0x3607fb;return _0x1dd9b0;})[_0x6811('0x25')](respondWithFilteredResult(_0x157212,_0x352c6c))[_0x6811('0x46')](handleError(_0x157212,null));};exports[_0x6811('0x47')]=function(_0x27262c,_0x1c1ce6){var _0x3474cc={'raw':![],'where':{'id':_0x27262c['params']['id']}},_0x432f56={};_0x432f56[_0x6811('0x2f')]=_['keys'](db['VoiceRecording']['rawAttributes']);_0x432f56[_0x6811('0x33')]=_['keys'](_0x27262c[_0x6811('0x33')]);_0x432f56[_0x6811('0x34')]=_[_0x6811('0x35')](_0x432f56[_0x6811('0x2f')],_0x432f56[_0x6811('0x33')]);_0x3474cc['attributes']=_[_0x6811('0x35')](_0x432f56[_0x6811('0x2f')],qs['fields'](_0x27262c['query']['fields']));_0x3474cc[_0x6811('0x36')]=_0x3474cc['attributes']['length']?_0x3474cc[_0x6811('0x36')]:_0x432f56['model'];if(_0x27262c[_0x6811('0x33')][_0x6811('0x42')]){_0x3474cc[_0x6811('0x43')]=[{'all':!![]}];}_0x3474cc=_[_0x6811('0x3f')]({},_0x3474cc,_0x27262c[_0x6811('0x41')]);return db[_0x6811('0x2b')]['find'](_0x3474cc)['then'](handleEntityNotFound(_0x1c1ce6,null))[_0x6811('0x25')](respondWithResult(_0x1c1ce6,null))[_0x6811('0x46')](handleError(_0x1c1ce6,null));};exports[_0x6811('0x48')]=function(_0x53154e,_0x5b3ad0){return db[_0x6811('0x2b')][_0x6811('0x48')](_0x53154e[_0x6811('0x49')],{})['then'](respondWithResult(_0x5b3ad0,0xc9))['catch'](handleError(_0x5b3ad0,null));};exports['update']=function(_0x5f549e,_0x62d7c7){if(_0x5f549e['body']['id']){delete _0x5f549e[_0x6811('0x49')]['id'];}return db[_0x6811('0x2b')][_0x6811('0x4a')]({'where':{'id':_0x5f549e[_0x6811('0x4b')]['id']}})[_0x6811('0x25')](handleEntityNotFound(_0x62d7c7,null))[_0x6811('0x25')](saveUpdates(_0x5f549e[_0x6811('0x49')],null))['then'](respondWithResult(_0x62d7c7,null))[_0x6811('0x46')](handleError(_0x62d7c7,null));};exports[_0x6811('0x4c')]=function(_0x519fd5,_0x10c6ed){return db[_0x6811('0x2b')][_0x6811('0x4c')]()[_0x6811('0x25')](respondWithResult(_0x10c6ed,null))[_0x6811('0x46')](handleError(_0x10c6ed,null));};exports[_0x6811('0x4d')]=function(_0x149983,_0x104655,_0x594473){var _0x32f539=require('../../components/encryptor');var _0x59d182=![];var _0x1dee34={};if(_0x149983[_0x6811('0x33')][_0x6811('0x2d')]&&_0x149983[_0x6811('0x33')][_0x6811('0x2d')]==='uniqueid'){_0x1dee34[_0x6811('0x4e')]=_0x149983[_0x6811('0x4b')]['id'];}else{_0x1dee34['id']=_0x149983[_0x6811('0x4b')]['id'];}return db[_0x6811('0x2b')][_0x6811('0x4a')]({'where':_0x1dee34,'attributes':['id',_0x6811('0x4f')],'raw':!![]})[_0x6811('0x25')](handleEntityNotFound(_0x104655,null))[_0x6811('0x25')](function(_0x19b4b1){if(_0x19b4b1){var _0x56e5b7=_0x19b4b1[_0x6811('0x4f')];var _0x3bbd71=util[_0x6811('0x31')](_0x6811('0x50'),_0x56e5b7);if(fs[_0x6811('0x51')](_0x3bbd71)){_0x59d182=!![];return _0x32f539[_0x6811('0x52')](_0x3bbd71,_0x56e5b7,config['secrets'][_0x6811('0x53')])[_0x6811('0x25')](function(){return _0x19b4b1;});}return _0x19b4b1;}})[_0x6811('0x25')](function(_0xb6c53f){if(_0xb6c53f){var _0x304330=_0xb6c53f[_0x6811('0x4f')];if(!fs[_0x6811('0x51')](_0x304330)){throw new db[(_0x6811('0x54'))][(_0x6811('0x55'))](_0x6811('0x56'));}if(_0xb6c53f['filename']){return _0x104655[_0x6811('0x4d')](_0x304330,_0xb6c53f[_0x6811('0x57')]+path[_0x6811('0x58')](_0x304330),function(){if(_0x59d182){fs['unlink'](_0x304330);}});}else{return _0x104655[_0x6811('0x4d')](_0x304330,function(_0x1f6f1a){if(_0x59d182){fs[_0x6811('0x59')](_0x304330);}});}}})[_0x6811('0x46')](function(_0x421cd0){if(_0x421cd0['message']===_0x6811('0x56')){_0x104655[_0x6811('0x1b')](0x194)[_0x6811('0x5a')](_0x6811('0x5b'));}else{return handleError(_0x104655,null);}});};exports[_0x6811('0x5c')]=function(_0x29f653,_0x3a2a8f,_0x20d9b5){var _0x74a95a=require(_0x6811('0x5d'));var _0x153637=![];var _0x33f5b4={'$and':[db['sequelize']['where'](db[_0x6811('0x5e')]['fn'](_0x6811('0x5f'),db[_0x6811('0x5e')][_0x6811('0x60')](_0x6811('0x4e'))),_0x29f653[_0x6811('0x33')][_0x6811('0x61')])]};if(_0x29f653[_0x6811('0x33')][_0x6811('0x2d')]&&_0x29f653[_0x6811('0x33')][_0x6811('0x2d')]==='uniqueid'){_0x33f5b4[_0x6811('0x62')][_0x6811('0x63')]({'uniqueid':_0x29f653[_0x6811('0x4b')]['id']});}else{_0x33f5b4[_0x6811('0x62')]['push']({'id':_0x29f653[_0x6811('0x4b')]['id']});}return db[_0x6811('0x2b')][_0x6811('0x4a')]({'where':_0x33f5b4,'attributes':['id',_0x6811('0x4f')],'raw':!![]})[_0x6811('0x25')](handleEntityNotFound(_0x3a2a8f,null))[_0x6811('0x25')](function(_0x57cb1e){if(_0x57cb1e){var _0x940577=util[_0x6811('0x31')]('%s.cypher',_0x57cb1e['value']);if(fs[_0x6811('0x51')](_0x940577)){_0x153637=!![];return _0x74a95a[_0x6811('0x52')](_0x940577,_0x57cb1e[_0x6811('0x4f')],config['secrets'][_0x6811('0x53')])[_0x6811('0x25')](function(){return _0x57cb1e;});}return _0x57cb1e;}})[_0x6811('0x25')](function(_0x57072d){if(_0x57072d){if(!fs['existsSync'](_0x57072d[_0x6811('0x4f')])){throw new db['Sequelize'][(_0x6811('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x57072d[_0x6811('0x57')]){return _0x3a2a8f[_0x6811('0x4d')](_0x57072d[_0x6811('0x4f')],_0x57072d[_0x6811('0x57')]+path['extname'](_0x57072d[_0x6811('0x4f')]),function(){if(_0x153637){fs['unlink'](_0x57072d['value']);}});}else{return _0x3a2a8f[_0x6811('0x4d')](_0x57072d[_0x6811('0x4f')],function(_0xe152bb){if(_0x153637){fs[_0x6811('0x59')](_0x57072d[_0x6811('0x4f')]);}});}}})[_0x6811('0x46')](handleError(_0x3a2a8f,null));};exports[_0x6811('0x26')]=function(_0x8759a7,_0x43230f){return db[_0x6811('0x2b')]['find']({'where':{'id':_0x8759a7[_0x6811('0x4b')]['id']}})[_0x6811('0x25')](function(_0x31fdcf){if(_[_0x6811('0x64')](_0x31fdcf)){throw new ReferenceError(_0x6811('0x65'));}return _0x31fdcf;})[_0x6811('0x25')](function(_0x1b2fe7){var _0x75316d=_0x1b2fe7[_0x6811('0x4f')];logger[_0x6811('0x66')]('cancellazione\x20fisica\x20documento\x20%s',_0x75316d);if(!_[_0x6811('0x64')](_0x1b2fe7[_0x6811('0x4f')])&&fs['existsSync'](_0x75316d)){logger[_0x6811('0x66')](_0x6811('0x67')+_0x75316d+_0x6811('0x68'));fs[_0x6811('0x69')](_0x75316d);}_0x75316d=_0x75316d+'.cypher';if(!_[_0x6811('0x64')](_0x1b2fe7[_0x6811('0x4f')])&&fs[_0x6811('0x51')](_0x75316d)){logger[_0x6811('0x66')]('File:\x20\x22'+_0x75316d+_0x6811('0x68'));fs[_0x6811('0x69')](_0x75316d);}return _0x1b2fe7;})[_0x6811('0x25')](function(_0x11153c){if(!_0x11153c)throw new InternalError();return _0x11153c['destroy']();})[_0x6811('0x25')](function(){_0x43230f[_0x6811('0x1b')](0xcc)[_0x6811('0x6a')]();})[_0x6811('0x46')](handleError(_0x43230f,null));};function getBucketslist(_0x2473d8,_0x14b1e9,_0x48e652){return new Promise(function(_0x213bd7,_0x561eb1){var _0x43a262=new AWS['S3']({'accessKeyId':_0x14b1e9,'secretAccessKey':_0x2473d8,'region':_0x48e652});_0x43a262['listBuckets']({},function(_0x2c1df7,_0x5e302f){if(_0x2c1df7){return _0x561eb1(_0x2c1df7);}else{return _0x213bd7(_0x5e302f);}});});}function createBucket(_0x4a3a43,_0x52b85a,_0x40cd59,_0x1be5be){return new Promise(function(_0x4ce35d,_0x44d4ad){var _0xa18b0e=new AWS['S3']({'accessKeyId':_0x52b85a,'secretAccessKey':_0x4a3a43,'region':_0x40cd59});_0xa18b0e[_0x6811('0x6b')]({'Bucket':_0x1be5be},function(_0x1baacf,_0x3a26f3){if(_0x1baacf){return _0x44d4ad(_0x1baacf);}else{return _0x4ce35d(_0x3a26f3);}});});}function uploadFile(_0x34fb1a,_0x4f6669,_0x2f0f68,_0x3031db,_0xd61939,_0x74eaf8){return new Promise(function(_0x5af583,_0x25f885){var _0x35a665=new AWS['S3']({'accessKeyId':_0x4f6669,'secretAccessKey':_0x34fb1a,'region':_0x2f0f68});_0x35a665[_0x6811('0x6c')]({'Bucket':_0x3031db,'Key':_0xd61939,'Body':_0x74eaf8},function(_0x14eff8,_0x4e7aa4){if(_0x14eff8){return _0x25f885(_0x14eff8);}else{return _0x5af583(_0x4e7aa4);}});});}function startTranscribe(_0x1c0276,_0x25ba36,_0x2e8a1e,_0x301a48,_0x55ebda,_0x177621){return new Promise(function(_0xf4c0df,_0x5f1d6e){var _0x5e2ce0=new AWS[(_0x6811('0x6d'))]({'accessKeyId':_0x25ba36,'secretAccessKey':_0x1c0276,'region':_0x2e8a1e});_0x5e2ce0[_0x6811('0x6e')]({'TranscriptionJobName':_0x301a48,'LanguageCode':_0x55ebda,'Media':{'MediaFileUri':_0x177621}},function(_0x2a2883,_0x53cbea){if(_0x2a2883){return _0x5f1d6e(_0x2a2883);}else{return _0xf4c0df(_0x53cbea);}});});}function transcribe(_0x3882a8,_0x392744,_0x20d053,_0x768609,_0x5656b0,_0xd8134c,_0x32087b){return new Promise(function(_0x5c3b88,_0x184e82){var _0x5aeb08={};logger['info'](util[_0x6811('0x31')](_0x6811('0x6f'),_0x3882a8,_0x5656b0));return uploadFile(_0x392744,_0x20d053,_0x768609,_0x5656b0,path[_0x6811('0x70')](_0xd8134c),fs['readFileSync'](_0xd8134c))['then'](function(_0x624727){logger[_0x6811('0x66')](util[_0x6811('0x31')](_0x6811('0x71'),_0x3882a8,_0x5656b0,_0x624727[_0x6811('0x72')]));_0x5aeb08[_0x6811('0x73')]=_0x624727[_0x6811('0x74')];_0x5aeb08[_0x6811('0x75')]=_0x624727['Location'];logger[_0x6811('0x66')](util[_0x6811('0x31')](_0x6811('0x76'),_0x3882a8));return startTranscribe(_0x392744,_0x20d053,_0x768609,uuidv4(),_0x32087b,_0x624727[_0x6811('0x72')]);})[_0x6811('0x25')](function(_0xe74552){logger[_0x6811('0x66')](util[_0x6811('0x31')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x3882a8,_0xe74552[_0x6811('0x77')]['TranscriptionJobName']));_0x5aeb08[_0x6811('0x78')]=_0xe74552[_0x6811('0x77')][_0x6811('0x79')];_0x5aeb08[_0x6811('0x7a')]=_0xe74552[_0x6811('0x77')][_0x6811('0x7b')];return _0x5c3b88(_0x5aeb08);})[_0x6811('0x46')](function(_0x377d8c){return _0x184e82(_0x377d8c);});});}exports['runTranscribe']=function(_0x411adb,_0x7fb20e,_0x48c04b){var _0x382056;var _0x48a5e1;var _0x2557a0;var _0x316e20=require(_0x6811('0x5d'));return db[_0x6811('0x2b')]['findOne']({'where':{'id':_0x411adb['params']['id']}})[_0x6811('0x25')](function(_0x4630d1){if(_0x4630d1){var _0x5e25de=util[_0x6811('0x31')]('%s.cypher',_0x4630d1[_0x6811('0x4f')]);if(fs[_0x6811('0x51')](_0x5e25de)){cypher=!![];return _0x316e20[_0x6811('0x52')](_0x5e25de,_0x4630d1[_0x6811('0x4f')],config[_0x6811('0x7c')]['recording'])[_0x6811('0x25')](function(){return _0x4630d1;});}return _0x4630d1;}})[_0x6811('0x25')](function(_0x1f7335){if(!_0x1f7335){throw new db[(_0x6811('0x54'))][(_0x6811('0x55'))]('Voice\x20Recording\x20not\x20found');}_0x48a5e1=_0x1f7335;return db[_0x6811('0x7d')][_0x6811('0x7e')]({'where':{'id':0x1}});})[_0x6811('0x25')](handleEntityNotFound(_0x7fb20e,null))[_0x6811('0x25')](function(_0x1a810a){if(_0x1a810a){_0x382056=_0x1a810a;if(!_0x382056['transcribe']||!_0x382056[_0x6811('0x7f')]||!_0x382056[_0x6811('0x80')]||!_0x382056[_0x6811('0x81')]||!_0x382056[_0x6811('0x73')]){throw new db[(_0x6811('0x54'))][(_0x6811('0x55'))](_0x6811('0x82'));}if(_0x411adb['body'][_0x6811('0x83')]&&(!_0x382056['sentiment']||!_0x382056[_0x6811('0x84')]||!_0x382056['sentimentRegion']||!_0x382056[_0x6811('0x81')]||!_0x382056[_0x6811('0x73')])){throw new db[(_0x6811('0x54'))]['ValidationError'](_0x6811('0x85'));}return db[_0x6811('0x86')][_0x6811('0x7e')]({'where':{'id':_0x382056[_0x6811('0x7f')]}});}})['then'](function(_0x2f9977){if(!_0x2f9977){throw new db[(_0x6811('0x54'))][(_0x6811('0x55'))](_0x6811('0x87'));}if(!_0x2f9977['data1']||!_0x2f9977['data2']){throw new db[(_0x6811('0x54'))][(_0x6811('0x55'))](_0x6811('0x88'));}_0x2557a0=_0x2f9977;return getBucketslist(_0x2557a0['data1'],_0x2557a0[_0x6811('0x89')],_0x382056['transcribeRegion']);})['then'](function(_0x1f0592){if(_0x1f0592&&_0x1f0592['Buckets']){var _0xc500f=_['find'](_0x1f0592[_0x6811('0x8a')],function(_0x846552){return _0x846552[_0x6811('0x8b')]===_0x382056[_0x6811('0x73')];});if(!_0xc500f){logger[_0x6811('0x66')](util[_0x6811('0x31')](_0x6811('0x8c'),_0x411adb['params']['id'],_0x382056[_0x6811('0x73')]));return createBucket(_0x2557a0[_0x6811('0x8d')],_0x2557a0['data2'],_0x382056[_0x6811('0x80')],_0x382056['bucket']);}logger[_0x6811('0x66')](util[_0x6811('0x31')](_0x6811('0x8e'),_0x411adb[_0x6811('0x4b')]['id'],_0x382056['bucket']));return;}})[_0x6811('0x25')](function(_0x22da41){if(_0x48a5e1['transcribeStatus']===_0x6811('0x8f')){return transcribe(_0x411adb['params']['id'],_0x2557a0['data1'],_0x2557a0[_0x6811('0x89')],_0x382056[_0x6811('0x80')],_0x382056[_0x6811('0x73')],_0x48a5e1[_0x6811('0x4f')],_0x382056[_0x6811('0x81')]);}else{logger[_0x6811('0x66')](util[_0x6811('0x31')](_0x6811('0x90'),_0x411adb[_0x6811('0x4b')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x6811('0x25')](function(_0x18f412){if(_0x18f412){_0x18f412[_0x6811('0x91')]=_0x411adb[_0x6811('0x49')][_0x6811('0x83')];return _0x48a5e1[_0x6811('0x92')](_0x18f412);}})[_0x6811('0x25')](respondWithResult(_0x7fb20e,null))[_0x6811('0x46')](handleError(_0x7fb20e,null));};function writeFile(_0x216cae,_0x2ec330){return new Promise(function(_0x3c7704,_0x3f45eb){fs[_0x6811('0x93')](_0x2ec330,_0x216cae,function(_0x552e0c,_0x11ee3a){if(_0x552e0c){return _0x3f45eb(_0x552e0c);}else{return _0x3c7704(_0x11ee3a);}});});}exports['downloadTranscribe']=function(_0xacafda,_0x3e1afa,_0x46310c){return db[_0x6811('0x2b')][_0x6811('0x7e')]({'where':{'id':_0xacafda[_0x6811('0x4b')]['id']}})[_0x6811('0x25')](handleEntityNotFound(_0x3e1afa))['then'](function(_0x551650){if(_0x551650&&_0x551650[_0x6811('0x94')]){var _0x344564=_0x551650[_0x6811('0x94')];var _0x5354cc=config[_0x6811('0x95')]+_0x6811('0x96')+_0x551650['id']+'.txt';if(fs[_0x6811('0x51')](_0x5354cc)){return _0x5354cc;}return writeFile(_0x344564,_0x5354cc)[_0x6811('0x25')](function(){return _0x5354cc;});}else{throw new db['Sequelize']['ValidationError'](_0x6811('0x97'));}})[_0x6811('0x25')](function(_0x342b79){return _0x3e1afa[_0x6811('0x4d')](_0x342b79);})[_0x6811('0x46')](handleError(_0x3e1afa));};
\ No newline at end of file
+var _0xac86=['\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','transcribeName','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','Setting','findOne','transcribe','transcribeAccountId','transcribeRegion','language','runSentiment','sentiment','sentimentAccountId','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','show','params','intersection','find','catch','body','update','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','downloads','sequelize','MD5','col','$and','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22'];(function(_0x4ae6e4,_0x187347){var _0x1b2c1f=function(_0x1d8722){while(--_0x1d8722){_0x4ae6e4['push'](_0x4ae6e4['shift']());}};_0x1b2c1f(++_0x187347);}(_0xac86,0x161));var _0x6ac8=function(_0x20445a,_0x3cbc5c){_0x20445a=_0x20445a-0x0;var _0x254c45=_0xac86[_0x20445a];return _0x254c45;};'use strict';var emlformat=require(_0x6ac8('0x0'));var rimraf=require(_0x6ac8('0x1'));var zipdir=require(_0x6ac8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6ac8('0x3'));var BPromise=require(_0x6ac8('0x4'));var Mustache=require(_0x6ac8('0x5'));var util=require('util');var path=require(_0x6ac8('0x6'));var sox=require(_0x6ac8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6ac8('0x8'));var _=require(_0x6ac8('0x9'));var squel=require('squel');var crypto=require(_0x6ac8('0xa'));var jsforce=require(_0x6ac8('0xb'));var deskjs=require(_0x6ac8('0xc'));var toCsv=require(_0x6ac8('0xd'));var querystring=require(_0x6ac8('0xe'));var Papa=require(_0x6ac8('0xf'));var AWS=require(_0x6ac8('0x10'));var uuidv4=require(_0x6ac8('0x11'));var Redis=require(_0x6ac8('0x12'));var authService=require(_0x6ac8('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6ac8('0x14'));var hardwareService=require(_0x6ac8('0x15'));var logger=require(_0x6ac8('0x16'))(_0x6ac8('0x17'));var utils=require('../../config/utils');var config=require(_0x6ac8('0x18'));var licenseUtil=require(_0x6ac8('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ecf39,_0x1cf2c0){_0x1cf2c0=_0x1cf2c0||0xcc;return function(_0x13f73c){if(_0x13f73c){return _0x3ecf39[_0x6ac8('0x1a')](_0x1cf2c0);}return _0x3ecf39[_0x6ac8('0x1b')](_0x1cf2c0)[_0x6ac8('0x1c')]();};}function respondWithResult(_0x24f774,_0x586a26){_0x586a26=_0x586a26||0xc8;return function(_0x4e8319){if(_0x4e8319){return _0x24f774[_0x6ac8('0x1b')](_0x586a26)[_0x6ac8('0x1d')](_0x4e8319);}};}function respondWithFilteredResult(_0x323232,_0x21e824){return function(_0x3f31a3){if(_0x3f31a3){var _0x3206f6=typeof _0x21e824[_0x6ac8('0x1e')]===_0x6ac8('0x1f')&&typeof _0x21e824[_0x6ac8('0x20')]===_0x6ac8('0x1f');var _0x5b42c2=_0x3f31a3['count'];var _0x4981cd=_0x3206f6?0x0:_0x21e824[_0x6ac8('0x1e')];var _0x385c4a=_0x3206f6?_0x3f31a3[_0x6ac8('0x21')]:_0x21e824['offset']+_0x21e824[_0x6ac8('0x20')];var _0x550035;if(_0x385c4a>=_0x5b42c2){_0x385c4a=_0x5b42c2;_0x550035=0xc8;}else{_0x550035=0xce;}_0x323232[_0x6ac8('0x1b')](_0x550035);return _0x323232[_0x6ac8('0x22')](_0x6ac8('0x23'),_0x4981cd+'-'+_0x385c4a+'/'+_0x5b42c2)['json'](_0x3f31a3);}return null;};}function patchUpdates(_0x393e62){return function(_0x4f9ac){try{jsonpatch[_0x6ac8('0x24')](_0x4f9ac,_0x393e62,!![]);}catch(_0x2fadfb){return BPromise[_0x6ac8('0x25')](_0x2fadfb);}return _0x4f9ac[_0x6ac8('0x26')]();};}function saveUpdates(_0x27bdb5,_0x223f07){return function(_0x2b341b){if(_0x2b341b){return _0x2b341b['update'](_0x27bdb5)[_0x6ac8('0x27')](function(_0x37e081){return _0x37e081;});}return null;};}function removeEntity(_0x5bd4cb,_0x5a57ee){return function(_0x2f8a4e){if(_0x2f8a4e){return _0x2f8a4e[_0x6ac8('0x28')]()[_0x6ac8('0x27')](function(){_0x5bd4cb['status'](0xcc)[_0x6ac8('0x1c')]();});}};}function handleEntityNotFound(_0x539828,_0x2515dd){return function(_0x50a79b){if(!_0x50a79b){_0x539828[_0x6ac8('0x1a')](0x194);}return _0x50a79b;};}function handleError(_0x5cb4e8,_0x534a40){_0x534a40=_0x534a40||0x1f4;return function(_0x27bb9d){logger[_0x6ac8('0x29')](_0x27bb9d[_0x6ac8('0x2a')]);if(_0x27bb9d[_0x6ac8('0x2b')]){delete _0x27bb9d[_0x6ac8('0x2b')];}_0x5cb4e8[_0x6ac8('0x1b')](_0x534a40)[_0x6ac8('0x2c')](_0x27bb9d);};}exports[_0x6ac8('0x2d')]=function(_0x2d9cbf,_0x35d253){var _0x9aa48={},_0x896b92={},_0x22dced={'count':0x0,'rows':[]};var _0x1a0eff=_[_0x6ac8('0x2e')](db[_0x6ac8('0x2f')][_0x6ac8('0x30')],function(_0x3422b6){return{'name':_0x3422b6['fieldName'],'type':_0x3422b6[_0x6ac8('0x31')][_0x6ac8('0x32')]};});_0x896b92[_0x6ac8('0x33')]=_[_0x6ac8('0x34')](_[_0x6ac8('0x2e')](_0x1a0eff,_0x6ac8('0x2b')),['format']);_0x896b92[_0x6ac8('0x35')]=_[_0x6ac8('0x36')](_0x2d9cbf[_0x6ac8('0x35')]);_0x896b92[_0x6ac8('0x37')]=_['intersection'](_0x896b92[_0x6ac8('0x33')],_0x896b92[_0x6ac8('0x35')]);_0x9aa48[_0x6ac8('0x38')]=_['intersection'](_0x896b92[_0x6ac8('0x33')],qs[_0x6ac8('0x39')](_0x2d9cbf[_0x6ac8('0x35')]['fields']));_0x9aa48[_0x6ac8('0x38')]=_0x9aa48[_0x6ac8('0x38')][_0x6ac8('0x3a')]?_0x9aa48[_0x6ac8('0x38')]:_0x896b92[_0x6ac8('0x33')];if(!_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x3b')](_0x6ac8('0x3c'))){_0x9aa48['limit']=qs[_0x6ac8('0x20')](_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x20')]);_0x9aa48[_0x6ac8('0x1e')]=qs['offset'](_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x1e')]);}_0x9aa48[_0x6ac8('0x3d')]=qs[_0x6ac8('0x3e')](_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x3e')]);_0x9aa48[_0x6ac8('0x3f')]=qs[_0x6ac8('0x37')](_[_0x6ac8('0x40')](_0x2d9cbf[_0x6ac8('0x35')],_0x896b92['filters']),_0x1a0eff);if(_0x2d9cbf['query']['filter']){_0x9aa48[_0x6ac8('0x3f')]=_['merge'](_0x9aa48[_0x6ac8('0x3f')],{'$or':_[_0x6ac8('0x2e')](_0x1a0eff,function(_0x21b034){if(_0x21b034[_0x6ac8('0x31')]!==_0x6ac8('0x41')){var _0x3341de={};_0x3341de[_0x21b034[_0x6ac8('0x2b')]]={'$like':'%'+_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x42')]+'%'};return _0x3341de;}})});}_0x9aa48=_[_0x6ac8('0x43')]({},_0x9aa48,_0x2d9cbf[_0x6ac8('0x44')]);var _0x4617f3={'where':_0x9aa48['where']};return db[_0x6ac8('0x2f')][_0x6ac8('0x21')](_0x4617f3)['then'](function(_0x5d5ee0){_0x22dced[_0x6ac8('0x21')]=_0x5d5ee0;if(_0x2d9cbf[_0x6ac8('0x35')][_0x6ac8('0x45')]){_0x9aa48[_0x6ac8('0x46')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x9aa48);})[_0x6ac8('0x27')](function(_0x709be4){_0x22dced['rows']=_0x709be4;return _0x22dced;})[_0x6ac8('0x27')](respondWithFilteredResult(_0x35d253,_0x9aa48))['catch'](handleError(_0x35d253,null));};exports[_0x6ac8('0x47')]=function(_0x106b84,_0x33535c){var _0x146b1c={'raw':![],'where':{'id':_0x106b84[_0x6ac8('0x48')]['id']}},_0x33fad6={};_0x33fad6[_0x6ac8('0x33')]=_[_0x6ac8('0x36')](db[_0x6ac8('0x2f')][_0x6ac8('0x30')]);_0x33fad6['query']=_[_0x6ac8('0x36')](_0x106b84[_0x6ac8('0x35')]);_0x33fad6[_0x6ac8('0x37')]=_[_0x6ac8('0x49')](_0x33fad6[_0x6ac8('0x33')],_0x33fad6[_0x6ac8('0x35')]);_0x146b1c[_0x6ac8('0x38')]=_[_0x6ac8('0x49')](_0x33fad6[_0x6ac8('0x33')],qs['fields'](_0x106b84[_0x6ac8('0x35')][_0x6ac8('0x39')]));_0x146b1c[_0x6ac8('0x38')]=_0x146b1c['attributes']['length']?_0x146b1c[_0x6ac8('0x38')]:_0x33fad6['model'];if(_0x106b84[_0x6ac8('0x35')]['includeAll']){_0x146b1c[_0x6ac8('0x46')]=[{'all':!![]}];}_0x146b1c=_[_0x6ac8('0x43')]({},_0x146b1c,_0x106b84[_0x6ac8('0x44')]);return db['VoiceRecording'][_0x6ac8('0x4a')](_0x146b1c)['then'](handleEntityNotFound(_0x33535c,null))[_0x6ac8('0x27')](respondWithResult(_0x33535c,null))[_0x6ac8('0x4b')](handleError(_0x33535c,null));};exports['create']=function(_0x31e7bf,_0x2f20a2){return db['VoiceRecording']['create'](_0x31e7bf[_0x6ac8('0x4c')],{})[_0x6ac8('0x27')](respondWithResult(_0x2f20a2,0xc9))[_0x6ac8('0x4b')](handleError(_0x2f20a2,null));};exports[_0x6ac8('0x4d')]=function(_0x5437e9,_0x2c033f){if(_0x5437e9[_0x6ac8('0x4c')]['id']){delete _0x5437e9[_0x6ac8('0x4c')]['id'];}return db[_0x6ac8('0x2f')][_0x6ac8('0x4a')]({'where':{'id':_0x5437e9[_0x6ac8('0x48')]['id']}})[_0x6ac8('0x27')](handleEntityNotFound(_0x2c033f,null))['then'](saveUpdates(_0x5437e9[_0x6ac8('0x4c')],null))['then'](respondWithResult(_0x2c033f,null))['catch'](handleError(_0x2c033f,null));};exports[_0x6ac8('0x4e')]=function(_0x327b24,_0x4e9e9c){return db[_0x6ac8('0x2f')][_0x6ac8('0x4e')]()['then'](respondWithResult(_0x4e9e9c,null))[_0x6ac8('0x4b')](handleError(_0x4e9e9c,null));};exports[_0x6ac8('0x4f')]=function(_0x3d7573,_0x18bad9,_0x4d155b){var _0x419652=require(_0x6ac8('0x50'));var _0x49aad4=![];var _0x5f09e2={};if(_0x3d7573[_0x6ac8('0x35')][_0x6ac8('0x31')]&&_0x3d7573[_0x6ac8('0x35')][_0x6ac8('0x31')]===_0x6ac8('0x51')){_0x5f09e2[_0x6ac8('0x51')]=_0x3d7573[_0x6ac8('0x48')]['id'];}else{_0x5f09e2['id']=_0x3d7573[_0x6ac8('0x48')]['id'];}return db[_0x6ac8('0x2f')][_0x6ac8('0x4a')]({'where':_0x5f09e2,'attributes':['id',_0x6ac8('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x18bad9,null))[_0x6ac8('0x27')](function(_0x54ece0){if(_0x54ece0){var _0x24ac7a=_0x54ece0[_0x6ac8('0x52')];var _0x47d36f=util[_0x6ac8('0x53')](_0x6ac8('0x54'),_0x24ac7a);if(fs[_0x6ac8('0x55')](_0x47d36f)){_0x49aad4=!![];return _0x419652[_0x6ac8('0x56')](_0x47d36f,_0x24ac7a,config[_0x6ac8('0x57')][_0x6ac8('0x58')])[_0x6ac8('0x27')](function(){return _0x54ece0;});}return _0x54ece0;}})[_0x6ac8('0x27')](function(_0x2338a8){if(_0x2338a8){var _0x210250=_0x2338a8[_0x6ac8('0x52')];if(!fs[_0x6ac8('0x55')](_0x210250)){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x5b'));}if(_0x2338a8[_0x6ac8('0x5c')]){return _0x18bad9['download'](_0x210250,_0x2338a8[_0x6ac8('0x5c')]+path[_0x6ac8('0x5d')](_0x210250),function(){if(_0x49aad4){fs[_0x6ac8('0x5e')](_0x210250);}});}else{return _0x18bad9[_0x6ac8('0x4f')](_0x210250,function(_0x25fc7b){if(_0x49aad4){fs[_0x6ac8('0x5e')](_0x210250);}});}}})[_0x6ac8('0x4b')](function(_0xfbe0f8){if(_0xfbe0f8['message']===_0x6ac8('0x5b')){_0x18bad9[_0x6ac8('0x1b')](0x194)['send'](_0x6ac8('0x5f'));}else{return handleError(_0x18bad9,null);}});};exports[_0x6ac8('0x60')]=function(_0x3b5f17,_0x3fa458,_0x529ce6){var _0x22d514=require(_0x6ac8('0x50'));var _0x2d74c4=![];var _0x3709a6={'$and':[db['sequelize'][_0x6ac8('0x3f')](db[_0x6ac8('0x61')]['fn'](_0x6ac8('0x62'),db[_0x6ac8('0x61')][_0x6ac8('0x63')](_0x6ac8('0x51'))),_0x3b5f17[_0x6ac8('0x35')]['token'])]};if(_0x3b5f17[_0x6ac8('0x35')][_0x6ac8('0x31')]&&_0x3b5f17[_0x6ac8('0x35')][_0x6ac8('0x31')]===_0x6ac8('0x51')){_0x3709a6[_0x6ac8('0x64')]['push']({'uniqueid':_0x3b5f17['params']['id']});}else{_0x3709a6['$and']['push']({'id':_0x3b5f17[_0x6ac8('0x48')]['id']});}return db[_0x6ac8('0x2f')][_0x6ac8('0x4a')]({'where':_0x3709a6,'attributes':['id',_0x6ac8('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x3fa458,null))[_0x6ac8('0x27')](function(_0x1bad12){if(_0x1bad12){var _0x510894=util[_0x6ac8('0x53')](_0x6ac8('0x54'),_0x1bad12['value']);if(fs[_0x6ac8('0x55')](_0x510894)){_0x2d74c4=!![];return _0x22d514[_0x6ac8('0x56')](_0x510894,_0x1bad12[_0x6ac8('0x52')],config['secrets'][_0x6ac8('0x58')])[_0x6ac8('0x27')](function(){return _0x1bad12;});}return _0x1bad12;}})[_0x6ac8('0x27')](function(_0x2c3e76){if(_0x2c3e76){if(!fs[_0x6ac8('0x55')](_0x2c3e76[_0x6ac8('0x52')])){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x5b'));}if(_0x2c3e76[_0x6ac8('0x5c')]){return _0x3fa458[_0x6ac8('0x4f')](_0x2c3e76[_0x6ac8('0x52')],_0x2c3e76[_0x6ac8('0x5c')]+path[_0x6ac8('0x5d')](_0x2c3e76[_0x6ac8('0x52')]),function(){if(_0x2d74c4){fs[_0x6ac8('0x5e')](_0x2c3e76[_0x6ac8('0x52')]);}});}else{return _0x3fa458[_0x6ac8('0x4f')](_0x2c3e76[_0x6ac8('0x52')],function(_0x49101a){if(_0x2d74c4){fs[_0x6ac8('0x5e')](_0x2c3e76[_0x6ac8('0x52')]);}});}}})[_0x6ac8('0x4b')](handleError(_0x3fa458,null));};exports['destroy']=function(_0xabf0ca,_0x46f368){return db['VoiceRecording']['find']({'where':{'id':_0xabf0ca[_0x6ac8('0x48')]['id']}})[_0x6ac8('0x27')](function(_0x5006c3){if(_[_0x6ac8('0x65')](_0x5006c3)){throw new ReferenceError(_0x6ac8('0x66'));}return _0x5006c3;})[_0x6ac8('0x27')](function(_0x320488){var _0xce404a=_0x320488['value'];logger[_0x6ac8('0x67')](_0x6ac8('0x68'),_0xce404a);if(!_[_0x6ac8('0x65')](_0x320488['value'])&&fs[_0x6ac8('0x55')](_0xce404a)){logger['info'](_0x6ac8('0x69')+_0xce404a+_0x6ac8('0x6a'));fs[_0x6ac8('0x6b')](_0xce404a);}_0xce404a=_0xce404a+_0x6ac8('0x6c');if(!_['isNil'](_0x320488[_0x6ac8('0x52')])&&fs[_0x6ac8('0x55')](_0xce404a)){logger['info'](_0x6ac8('0x69')+_0xce404a+_0x6ac8('0x6a'));fs[_0x6ac8('0x6b')](_0xce404a);}return _0x320488;})[_0x6ac8('0x27')](function(_0x2ea62b){if(!_0x2ea62b)throw new InternalError();return _0x2ea62b[_0x6ac8('0x28')]();})['then'](function(){_0x46f368['status'](0xcc)['end']();})['catch'](handleError(_0x46f368,null));};function getBucketslist(_0x336a86,_0x512b00,_0x3497b3){return new Promise(function(_0x1bfde9,_0x16ce0d){var _0x5c2227=new AWS['S3']({'accessKeyId':_0x512b00,'secretAccessKey':_0x336a86,'region':_0x3497b3});_0x5c2227[_0x6ac8('0x6d')]({},function(_0x401086,_0x43aa2c){if(_0x401086){return _0x16ce0d(_0x401086);}else{return _0x1bfde9(_0x43aa2c);}});});}function createBucket(_0x3f2436,_0x562bae,_0x5e0d86,_0xd09641){return new Promise(function(_0x179a40,_0x3fe42e){var _0x326690=new AWS['S3']({'accessKeyId':_0x562bae,'secretAccessKey':_0x3f2436,'region':_0x5e0d86});_0x326690[_0x6ac8('0x6e')]({'Bucket':_0xd09641},function(_0x1f8cac,_0x19ea0f){if(_0x1f8cac){return _0x3fe42e(_0x1f8cac);}else{return _0x179a40(_0x19ea0f);}});});}function uploadFile(_0x2fef05,_0x47a1d8,_0x438050,_0x5b77d0,_0x1faffb,_0xb6fbfe){return new Promise(function(_0x35ee0f,_0x128a25){var _0x4126dd=new AWS['S3']({'accessKeyId':_0x47a1d8,'secretAccessKey':_0x2fef05,'region':_0x438050});_0x4126dd[_0x6ac8('0x6f')]({'Bucket':_0x5b77d0,'Key':_0x1faffb,'Body':_0xb6fbfe},function(_0x720ba8,_0x58424e){if(_0x720ba8){return _0x128a25(_0x720ba8);}else{return _0x35ee0f(_0x58424e);}});});}function startTranscribe(_0x4d8d06,_0x51a0fd,_0x12d8b9,_0x12da84,_0x590527,_0x11ce62){return new Promise(function(_0x882e9e,_0x48473c){var _0x3a998a=new AWS['TranscribeService']({'accessKeyId':_0x51a0fd,'secretAccessKey':_0x4d8d06,'region':_0x12d8b9});_0x3a998a[_0x6ac8('0x70')]({'TranscriptionJobName':_0x12da84,'LanguageCode':_0x590527,'Media':{'MediaFileUri':_0x11ce62}},function(_0x43b0b3,_0x3d56e0){if(_0x43b0b3){return _0x48473c(_0x43b0b3);}else{return _0x882e9e(_0x3d56e0);}});});}function transcribe(_0x5dc417,_0x1fcc28,_0x13a9a9,_0x27c7da,_0x398833,_0x3820d4,_0x277a97){return new Promise(function(_0x2b7d3f,_0x3a432d){var _0x305be7={};logger[_0x6ac8('0x67')](util[_0x6ac8('0x53')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5dc417,_0x398833));return uploadFile(_0x1fcc28,_0x13a9a9,_0x27c7da,_0x398833,path[_0x6ac8('0x71')](_0x3820d4),fs[_0x6ac8('0x72')](_0x3820d4))[_0x6ac8('0x27')](function(_0xc8126d){logger[_0x6ac8('0x67')](util[_0x6ac8('0x53')](_0x6ac8('0x73'),_0x5dc417,_0x398833,_0xc8126d[_0x6ac8('0x74')]));_0x305be7[_0x6ac8('0x75')]=_0xc8126d[_0x6ac8('0x76')];_0x305be7[_0x6ac8('0x77')]=_0xc8126d[_0x6ac8('0x74')];logger['info'](util[_0x6ac8('0x53')](_0x6ac8('0x78'),_0x5dc417));return startTranscribe(_0x1fcc28,_0x13a9a9,_0x27c7da,uuidv4(),_0x277a97,_0xc8126d[_0x6ac8('0x74')]);})['then'](function(_0x1ca2ab){logger['info'](util[_0x6ac8('0x53')](_0x6ac8('0x79'),_0x5dc417,_0x1ca2ab['TranscriptionJob']['TranscriptionJobName']));_0x305be7[_0x6ac8('0x7a')]=_0x1ca2ab[_0x6ac8('0x7b')][_0x6ac8('0x7c')];_0x305be7[_0x6ac8('0x7d')]=_0x1ca2ab[_0x6ac8('0x7b')][_0x6ac8('0x7e')];return _0x2b7d3f(_0x305be7);})[_0x6ac8('0x4b')](function(_0x38fe16){return _0x3a432d(_0x38fe16);});});}exports[_0x6ac8('0x7f')]=function(_0x196484,_0x2063d3,_0x4e8881){var _0x5e9312;var _0x4e64d1;var _0x19052a;var _0x8a8dec=require(_0x6ac8('0x50'));return db[_0x6ac8('0x2f')]['findOne']({'where':{'id':_0x196484[_0x6ac8('0x48')]['id']}})['then'](function(_0x451ff8){if(_0x451ff8){var _0x1646e4=util[_0x6ac8('0x53')](_0x6ac8('0x54'),_0x451ff8[_0x6ac8('0x52')]);if(fs[_0x6ac8('0x55')](_0x1646e4)){cypher=!![];return _0x8a8dec[_0x6ac8('0x56')](_0x1646e4,_0x451ff8[_0x6ac8('0x52')],config[_0x6ac8('0x57')][_0x6ac8('0x58')])[_0x6ac8('0x27')](function(){return _0x451ff8;});}return _0x451ff8;}})[_0x6ac8('0x27')](function(_0x45c1f6){if(!_0x45c1f6){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))]('Voice\x20Recording\x20not\x20found');}_0x4e64d1=_0x45c1f6;return db[_0x6ac8('0x80')][_0x6ac8('0x81')]({'where':{'id':0x1}});})[_0x6ac8('0x27')](handleEntityNotFound(_0x2063d3,null))[_0x6ac8('0x27')](function(_0x38e5b5){if(_0x38e5b5){_0x5e9312=_0x38e5b5;if(!_0x5e9312[_0x6ac8('0x82')]||!_0x5e9312[_0x6ac8('0x83')]||!_0x5e9312[_0x6ac8('0x84')]||!_0x5e9312[_0x6ac8('0x85')]||!_0x5e9312[_0x6ac8('0x75')]){throw new db['Sequelize'][(_0x6ac8('0x5a'))]('Transcribe\x20not\x20configured');}if(_0x196484['body'][_0x6ac8('0x86')]&&(!_0x5e9312[_0x6ac8('0x87')]||!_0x5e9312[_0x6ac8('0x88')]||!_0x5e9312['sentimentRegion']||!_0x5e9312[_0x6ac8('0x85')]||!_0x5e9312[_0x6ac8('0x75')])){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x89'));}return db['CloudProvider'][_0x6ac8('0x81')]({'where':{'id':_0x5e9312['transcribeAccountId']}});}})[_0x6ac8('0x27')](function(_0x58fda7){if(!_0x58fda7){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x8a'));}if(!_0x58fda7[_0x6ac8('0x8b')]||!_0x58fda7[_0x6ac8('0x8c')]){throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x8d'));}_0x19052a=_0x58fda7;return getBucketslist(_0x19052a[_0x6ac8('0x8b')],_0x19052a[_0x6ac8('0x8c')],_0x5e9312[_0x6ac8('0x84')]);})[_0x6ac8('0x27')](function(_0x3e7320){if(_0x3e7320&&_0x3e7320[_0x6ac8('0x8e')]){var _0x310da4=_[_0x6ac8('0x4a')](_0x3e7320['Buckets'],function(_0x3d296d){return _0x3d296d[_0x6ac8('0x8f')]===_0x5e9312[_0x6ac8('0x75')];});if(!_0x310da4){logger[_0x6ac8('0x67')](util[_0x6ac8('0x53')](_0x6ac8('0x90'),_0x196484[_0x6ac8('0x48')]['id'],_0x5e9312[_0x6ac8('0x75')]));return createBucket(_0x19052a['data1'],_0x19052a[_0x6ac8('0x8c')],_0x5e9312[_0x6ac8('0x84')],_0x5e9312[_0x6ac8('0x75')]);}logger[_0x6ac8('0x67')](util[_0x6ac8('0x53')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x196484[_0x6ac8('0x48')]['id'],_0x5e9312[_0x6ac8('0x75')]));return;}})['then'](function(_0x116244){if(_0x4e64d1['transcribeStatus']===_0x6ac8('0x91')){return transcribe(_0x196484[_0x6ac8('0x48')]['id'],_0x19052a['data1'],_0x19052a[_0x6ac8('0x8c')],_0x5e9312['transcribeRegion'],_0x5e9312[_0x6ac8('0x75')],_0x4e64d1[_0x6ac8('0x52')],_0x5e9312[_0x6ac8('0x85')]);}else{logger['info'](util[_0x6ac8('0x53')](_0x6ac8('0x92'),_0x196484['params']['id']));return{'transcribeStatus':_0x6ac8('0x93')};}})['then'](function(_0x2fd76f){if(_0x2fd76f){_0x2fd76f['tempSentiment']=_0x196484[_0x6ac8('0x4c')][_0x6ac8('0x86')];return _0x4e64d1['updateAttributes'](_0x2fd76f);}})[_0x6ac8('0x27')](respondWithResult(_0x2063d3,null))['catch'](handleError(_0x2063d3,null));};function writeFile(_0x15d03b,_0x268433){return new Promise(function(_0x5725a3,_0x5dd650){fs[_0x6ac8('0x94')](_0x268433,_0x15d03b,function(_0x258288,_0x5c3744){if(_0x258288){return _0x5dd650(_0x258288);}else{return _0x5725a3(_0x5c3744);}});});}exports[_0x6ac8('0x95')]=function(_0x506bb9,_0x3ce364,_0x305aa8){return db[_0x6ac8('0x2f')][_0x6ac8('0x81')]({'where':{'id':_0x506bb9['params']['id']}})[_0x6ac8('0x27')](handleEntityNotFound(_0x3ce364))['then'](function(_0x68eaaf){if(_0x68eaaf&&_0x68eaaf[_0x6ac8('0x96')]){var _0x2fdb52=_0x68eaaf[_0x6ac8('0x96')];var _0xa6da26=config['root']+_0x6ac8('0x97')+_0x68eaaf['id']+'.txt';if(fs[_0x6ac8('0x55')](_0xa6da26)){return _0xa6da26;}return writeFile(_0x2fdb52,_0xa6da26)['then'](function(){return _0xa6da26;});}else{throw new db[(_0x6ac8('0x59'))][(_0x6ac8('0x5a'))](_0x6ac8('0x98'));}})[_0x6ac8('0x27')](function(_0x2a6688){return _0x3ce364['download'](_0x2a6688);})[_0x6ac8('0x4b')](handleError(_0x3ce364));};
\ No newline at end of file
index 4321b0a..f2a53e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf14b=['VoiceRecording','voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define'];(function(_0x2c5340,_0x5c86e5){var _0x3c505e=function(_0x1089d9){while(--_0x1089d9){_0x2c5340['push'](_0x2c5340['shift']());}};_0x3c505e(++_0x5c86e5);}(_0xf14b,0xdd));var _0xbf14=function(_0x1c5ad6,_0x47b206){_0x1c5ad6=_0x1c5ad6-0x0;var _0x1d5829=_0xf14b[_0x1c5ad6];return _0x1d5829;};'use strict';var attributes=require(_0xbf14('0x0'));module[_0xbf14('0x1')]=function(_0x331ed9,_0x1d0b20){return _0x331ed9[_0xbf14('0x2')](_0xbf14('0x3'),attributes,{'tableName':_0xbf14('0x4'),'paranoid':![],'indexes':[{'name':_0xbf14('0x5'),'fields':[_0xbf14('0x5')]},{'name':_0xbf14('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3657=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3657,0x183));var _0x7365=function(_0x23884b,_0x50c307){_0x23884b=_0x23884b-0x0;var _0x28113b=_0x3657[_0x23884b];return _0x28113b;};'use strict';var attributes=require(_0x7365('0x0'));module[_0x7365('0x1')]=function(_0x363ec1,_0x51f5a0){return _0x363ec1[_0x7365('0x2')](_0x7365('0x3'),attributes,{'tableName':_0x7365('0x4'),'paranoid':![],'indexes':[{'name':_0x7365('0x5'),'fields':['uniqueid']},{'name':_0x7365('0x6'),'fields':[_0x7365('0x6')]}],'timestamps':!![]});};
\ No newline at end of file
index b916b94..c628861 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68b3=['../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','CreateVoiceRecording'];(function(_0x1eec3a,_0x168828){var _0x133cf7=function(_0x1a0c97){while(--_0x1a0c97){_0x1eec3a['push'](_0x1eec3a['shift']());}};_0x133cf7(++_0x168828);}(_0x68b3,0x1d8));var _0x368b=function(_0x4484fe,_0x348574){_0x4484fe=_0x4484fe-0x0;var _0xcf5920=_0x68b3[_0x4484fe];return _0xcf5920;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require(_0x368b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require('../../config/environment');var jayson=require(_0x368b('0x9'));var client=jayson[_0x368b('0xa')][_0x368b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23584a,_0x4406c8,_0x127c1e){return new BPromise(function(_0x2dec1c,_0x142d05){return client[_0x368b('0xc')](_0x23584a,_0x127c1e)[_0x368b('0xd')](function(_0x2a7b9f){logger['info'](_0x368b('0xe'),_0x4406c8,_0x368b('0xf'));logger[_0x368b('0x10')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x4406c8,_0x368b('0xf'),JSON[_0x368b('0x11')](_0x2a7b9f));if(_0x2a7b9f[_0x368b('0x12')]){if(_0x2a7b9f['error'][_0x368b('0x13')]===0x1f4){logger[_0x368b('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x142d05(_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);}logger[_0x368b('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x4406c8,_0x2a7b9f[_0x368b('0x12')][_0x368b('0x14')]);return _0x2dec1c(_0x2a7b9f['error'][_0x368b('0x14')]);}else{logger[_0x368b('0x15')](_0x368b('0xe'),_0x4406c8,'request\x20sent');_0x2dec1c(_0x2a7b9f[_0x368b('0x16')][_0x368b('0x14')]);}})[_0x368b('0x17')](function(_0x4d6d9d){logger[_0x368b('0x12')](_0x368b('0xe'),_0x4406c8,_0x4d6d9d);_0x142d05(_0x4d6d9d);});});}exports[_0x368b('0x18')]=function(_0x540f57){var _0x5d543e=this;return new Promise(function(_0x3e2e9f,_0x27d2a0){return db[_0x368b('0x19')][_0x368b('0x1a')](_0x540f57[_0x368b('0x1b')],{'raw':_0x540f57['options']?_0x540f57[_0x368b('0x1c')][_0x368b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540f57[_0x368b('0x1c')]?_0x540f57[_0x368b('0x1c')][_0x368b('0x1e')]||null:null,'attributes':_0x540f57[_0x368b('0x1c')]?_0x540f57[_0x368b('0x1c')][_0x368b('0x1f')]||null:null,'limit':_0x540f57['options']?_0x540f57[_0x368b('0x1c')][_0x368b('0x20')]||null:null})[_0x368b('0xd')](function(_0xc0f7af){logger[_0x368b('0x15')]('UpdateVoiceRecording',_0x540f57);logger[_0x368b('0x10')](_0x368b('0x18'),_0x540f57,JSON[_0x368b('0x11')](_0xc0f7af));_0x3e2e9f(_0xc0f7af);})[_0x368b('0x17')](function(_0x77a269){logger[_0x368b('0x12')](_0x368b('0x18'),_0x77a269[_0x368b('0x14')],_0x540f57);_0x27d2a0(_0x5d543e[_0x368b('0x12')](0x1f4,_0x77a269[_0x368b('0x14')]));});});};exports[_0x368b('0x21')]=function(_0x344d8a){var _0xceec4b=this;return new Promise(function(_0x376e61,_0x4636f4){var _0x23a83a=require(_0x368b('0x22'));var _0x9f192e;return db[_0x368b('0x23')][_0x368b('0x24')]({'attributes':['id',_0x368b('0x25')],'where':{'id':0x1},'raw':!![]})[_0x368b('0xd')](function(_0x107d2f){_0x9f192e=_0x107d2f;return db[_0x368b('0x19')]['create'](_0x344d8a['body']);})[_0x368b('0xd')](function(_0x2f1d52){if(_0x9f192e[_0x368b('0x25')]&&fs[_0x368b('0x26')](_0x2f1d52['value'])){var _0x12ae59=util[_0x368b('0x27')](_0x368b('0x28'),_0x2f1d52[_0x368b('0x29')]);return _0x23a83a[_0x368b('0x2a')](_0x2f1d52['value'],_0x12ae59,config[_0x368b('0x2b')][_0x368b('0x2c')])[_0x368b('0xd')](function(){fs[_0x368b('0x2d')](_0x2f1d52['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2f1d52;});}return _0x2f1d52;})[_0x368b('0xd')](function(_0x2bc363){logger[_0x368b('0x15')](_0x368b('0x21'),_0x344d8a);logger[_0x368b('0x10')]('CreateVoiceRecording',_0x344d8a,JSON[_0x368b('0x11')](_0x2bc363));_0x376e61(_0x2bc363);})[_0x368b('0x17')](function(_0x54e7e5){logger[_0x368b('0x12')](_0x368b('0x21'),_0x54e7e5['message'],_0x344d8a);_0x4636f4(_0xceec4b[_0x368b('0x12')](0x1f4,_0x54e7e5[_0x368b('0x14')]));});});};
\ No newline at end of file
+var _0xa30a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceRecording,\x20%s,\x20%s','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','UpdateVoiceRecording','update','body','options','where','limit','debug','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x144c0c,_0x14f453){var _0x7cc668=function(_0x5d7b5e){while(--_0x5d7b5e){_0x144c0c['push'](_0x144c0c['shift']());}};_0x7cc668(++_0x14f453);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var moment=require(_0xaa30('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa30('0x3'));var fs=require('fs');var Redis=require(_0xaa30('0x4'));var db=require(_0xaa30('0x5'))['db'];var utils=require(_0xaa30('0x6'));var logger=require(_0xaa30('0x7'))(_0xaa30('0x8'));var config=require(_0xaa30('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa30('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8af448,_0x14fe09,_0x42dc22){return new BPromise(function(_0x5d076a,_0xedbc45){return client[_0xaa30('0xb')](_0x8af448,_0x42dc22)[_0xaa30('0xc')](function(_0x59d028){logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,'request\x20sent');logger['debug'](_0xaa30('0xf'),_0x14fe09,'request\x20sent',JSON[_0xaa30('0x10')](_0x59d028));if(_0x59d028[_0xaa30('0x11')]){if(_0x59d028[_0xaa30('0x11')][_0xaa30('0x12')]===0x1f4){logger['error'](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0xedbc45(_0x59d028['error'][_0xaa30('0x13')]);}logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);return _0x5d076a(_0x59d028[_0xaa30('0x11')][_0xaa30('0x13')]);}else{logger[_0xaa30('0xd')](_0xaa30('0xe'),_0x14fe09,_0xaa30('0x14'));_0x5d076a(_0x59d028['result'][_0xaa30('0x13')]);}})['catch'](function(_0x5eb356){logger[_0xaa30('0x11')](_0xaa30('0xe'),_0x14fe09,_0x5eb356);_0xedbc45(_0x5eb356);});});}exports[_0xaa30('0x15')]=function(_0x540e36){var _0x54fa49=this;return new Promise(function(_0x53f9fd,_0x23ad3b){return db['VoiceRecording'][_0xaa30('0x16')](_0x540e36[_0xaa30('0x17')],{'raw':_0x540e36['options']?_0x540e36['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x19')]||null:null,'attributes':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')]['attributes']||null:null,'limit':_0x540e36[_0xaa30('0x18')]?_0x540e36[_0xaa30('0x18')][_0xaa30('0x1a')]||null:null})[_0xaa30('0xc')](function(_0x1ff442){logger['info'](_0xaa30('0x15'),_0x540e36);logger[_0xaa30('0x1b')](_0xaa30('0x15'),_0x540e36,JSON[_0xaa30('0x10')](_0x1ff442));_0x53f9fd(_0x1ff442);})['catch'](function(_0x14d7fa){logger[_0xaa30('0x11')](_0xaa30('0x15'),_0x14d7fa[_0xaa30('0x13')],_0x540e36);_0x23ad3b(_0x54fa49[_0xaa30('0x11')](0x1f4,_0x14d7fa[_0xaa30('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x467850){var _0x465701=this;return new Promise(function(_0x5d4da8,_0xb043e4){var _0x5b3efb=require(_0xaa30('0x1c'));var _0x33a0c9;return db[_0xaa30('0x1d')][_0xaa30('0x1e')]({'attributes':['id',_0xaa30('0x1f')],'where':{'id':0x1},'raw':!![]})[_0xaa30('0xc')](function(_0x6ff09a){_0x33a0c9=_0x6ff09a;return db[_0xaa30('0x20')][_0xaa30('0x21')](_0x467850[_0xaa30('0x17')]);})[_0xaa30('0xc')](function(_0x43003f){if(_0x33a0c9[_0xaa30('0x1f')]&&fs[_0xaa30('0x22')](_0x43003f[_0xaa30('0x23')])){var _0x1a3f64=util[_0xaa30('0x24')](_0xaa30('0x25'),_0x43003f['value']);return _0x5b3efb[_0xaa30('0x26')](_0x43003f[_0xaa30('0x23')],_0x1a3f64,config[_0xaa30('0x27')][_0xaa30('0x28')])[_0xaa30('0xc')](function(){fs[_0xaa30('0x29')](_0x43003f['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x43003f;});}return _0x43003f;})[_0xaa30('0xc')](function(_0x407090){logger[_0xaa30('0xd')](_0xaa30('0x2a'),_0x467850);logger[_0xaa30('0x1b')]('CreateVoiceRecording',_0x467850,JSON['stringify'](_0x407090));_0x5d4da8(_0x407090);})[_0xaa30('0x2b')](function(_0x2d26fb){logger['error'](_0xaa30('0x2a'),_0x2d26fb['message'],_0x467850);_0xb043e4(_0x465701[_0xaa30('0x11')](0x1f4,_0x2d26fb['message']));});});};
\ No newline at end of file
index e3bb739..25b6fcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bf5=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','describe','/:id','post','isAuthenticated','put','update','delete','destroy','multer','util'];(function(_0x56a7d2,_0x1758ae){var _0xaf51c2=function(_0xd2742a){while(--_0xd2742a){_0x56a7d2['push'](_0x56a7d2['shift']());}};_0xaf51c2(++_0x1758ae);}(_0x7bf5,0x82));var _0x57bf=function(_0x4a1772,_0x50c0f5){_0x4a1772=_0x4a1772-0x0;var _0x1f19d2=_0x7bf5[_0x4a1772];return _0x1f19d2;};'use strict';var multer=require(_0x57bf('0x0'));var util=require(_0x57bf('0x1'));var path=require(_0x57bf('0x2'));var timeout=require(_0x57bf('0x3'));var express=require(_0x57bf('0x4'));var router=express[_0x57bf('0x5')]();var fs_extra=require(_0x57bf('0x6'));var auth=require(_0x57bf('0x7'));var interaction=require(_0x57bf('0x8'));var config=require(_0x57bf('0x9'));var controller=require(_0x57bf('0xa'));router[_0x57bf('0xb')]('/',auth['isAuthenticated'](),controller[_0x57bf('0xc')]);router[_0x57bf('0xb')](_0x57bf('0xd'),auth['isAuthenticated'](),controller[_0x57bf('0xe')]);router['get'](_0x57bf('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x57bf('0x10')]('/',auth[_0x57bf('0x11')](),controller['create']);router[_0x57bf('0x12')](_0x57bf('0xf'),auth[_0x57bf('0x11')](),controller[_0x57bf('0x13')]);router[_0x57bf('0x14')]('/:id',auth[_0x57bf('0x11')](),controller[_0x57bf('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0x3955=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceTransferReport.controller'];(function(_0x325539,_0x36ad8f){var _0x47401d=function(_0x7ed46c){while(--_0x7ed46c){_0x325539['push'](_0x325539['shift']());}};_0x47401d(++_0x36ad8f);}(_0x3955,0xb4));var _0x5395=function(_0x5d5364,_0x13e28a){_0x5d5364=_0x5d5364-0x0;var _0x442b6e=_0x3955[_0x5d5364];return _0x442b6e;};'use strict';var multer=require(_0x5395('0x0'));var util=require(_0x5395('0x1'));var path=require(_0x5395('0x2'));var timeout=require(_0x5395('0x3'));var express=require(_0x5395('0x4'));var router=express[_0x5395('0x5')]();var fs_extra=require(_0x5395('0x6'));var auth=require(_0x5395('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5395('0x8'));router[_0x5395('0x9')]('/',auth[_0x5395('0xa')](),controller[_0x5395('0xb')]);router[_0x5395('0x9')](_0x5395('0xc'),auth['isAuthenticated'](),controller[_0x5395('0xd')]);router[_0x5395('0x9')](_0x5395('0xe'),auth[_0x5395('0xa')](),controller[_0x5395('0xf')]);router[_0x5395('0x10')]('/',auth[_0x5395('0xa')](),controller[_0x5395('0x11')]);router['put'](_0x5395('0xe'),auth[_0x5395('0xa')](),controller[_0x5395('0x12')]);router['delete'](_0x5395('0xe'),auth[_0x5395('0xa')](),controller[_0x5395('0x13')]);module[_0x5395('0x14')]=router;
\ No newline at end of file
index cf554e7..7dd2704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1251=['exports','ENUM','blind','attended','STRING'];(function(_0x381af4,_0x2a5ea5){var _0x28f41c=function(_0x297976){while(--_0x297976){_0x381af4['push'](_0x381af4['shift']());}};_0x28f41c(++_0x2a5ea5);}(_0x1251,0x91));var _0x1125=function(_0x421079,_0x11c3be){_0x421079=_0x421079-0x0;var _0x1f3158=_0x1251[_0x421079];return _0x1f3158;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1125('0x0')]={'type':{'type':Sequelize[_0x1125('0x1')](_0x1125('0x2'),_0x1125('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x1125('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x1125('0x4')]},'transferercalleridname':{'type':Sequelize[_0x1125('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1125('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x1125('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1125('0x4')]},'transfererexten':{'type':Sequelize[_0x1125('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x1125('0x4')]},'transfereechannel':{'type':Sequelize[_0x1125('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x1125('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x1125('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1125('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1125('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x1125('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1125('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x1125('0x4')]},'isexternal':{'type':Sequelize[_0x1125('0x1')]('Yes','No')},'context':{'type':Sequelize[_0x1125('0x4')]},'extension':{'type':Sequelize[_0x1125('0x4')]}};
\ No newline at end of file
+var _0xc5ec=['exports','ENUM','blind','attended','STRING','Yes','sequelize','moment'];(function(_0x45221d,_0x1c9bdb){var _0x2d127a=function(_0x320f0a){while(--_0x320f0a){_0x45221d['push'](_0x45221d['shift']());}};_0x2d127a(++_0x1c9bdb);}(_0xc5ec,0x17e));var _0xcc5e=function(_0x5307c6,_0x23637f){_0x5307c6=_0x5307c6-0x0;var _0x533297=_0xc5ec[_0x5307c6];return _0x533297;};'use strict';var Sequelize=require(_0xcc5e('0x0'));var moment=require(_0xcc5e('0x1'));module[_0xcc5e('0x2')]={'type':{'type':Sequelize[_0xcc5e('0x3')](_0xcc5e('0x4'),_0xcc5e('0x5'))},'result':{'type':Sequelize[_0xcc5e('0x6')]},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xcc5e('0x6')]},'transfereraccountcode':{'type':Sequelize[_0xcc5e('0x6')]},'transferercontext':{'type':Sequelize[_0xcc5e('0x6')]},'transfererexten':{'type':Sequelize[_0xcc5e('0x6')]},'transfererlinkedid':{'type':Sequelize[_0xcc5e('0x6')]},'transfereechannel':{'type':Sequelize[_0xcc5e('0x6')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xcc5e('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcc5e('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0xcc5e('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0xcc5e('0x6')]},'transfereecontext':{'type':Sequelize[_0xcc5e('0x6')]},'transfereeexten':{'type':Sequelize[_0xcc5e('0x6')]},'transfereelinkedid':{'type':Sequelize[_0xcc5e('0x6')]},'isexternal':{'type':Sequelize[_0xcc5e('0x3')](_0xcc5e('0x7'),'No')},'context':{'type':Sequelize[_0xcc5e('0x6')]},'extension':{'type':Sequelize[_0xcc5e('0x6')]}};
\ No newline at end of file
index b4e099b..d999a8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e7=['lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','include','findAll','rows','catch','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x70e7,0x8e));var _0x770e=function(_0x442d00,_0x3f7f37){_0x442d00=_0x442d00-0x0;var _0x3bf583=_0x70e7[_0x442d00];return _0x3bf583;};'use strict';var emlformat=require(_0x770e('0x0'));var rimraf=require(_0x770e('0x1'));var zipdir=require(_0x770e('0x2'));var jsonpatch=require(_0x770e('0x3'));var rp=require(_0x770e('0x4'));var moment=require(_0x770e('0x5'));var BPromise=require(_0x770e('0x6'));var Mustache=require(_0x770e('0x7'));var util=require('util');var path=require(_0x770e('0x8'));var sox=require(_0x770e('0x9'));var csv=require('to-csv');var ejs=require(_0x770e('0xa'));var fs=require('fs');var fs_extra=require(_0x770e('0xb'));var _=require(_0x770e('0xc'));var squel=require('squel');var crypto=require(_0x770e('0xd'));var jsforce=require(_0x770e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x770e('0xf'));var querystring=require(_0x770e('0x10'));var Papa=require('papaparse');var Redis=require(_0x770e('0x11'));var authService=require(_0x770e('0x12'));var qs=require(_0x770e('0x13'));var as=require(_0x770e('0x14'));var hardwareService=require(_0x770e('0x15'));var logger=require(_0x770e('0x16'))(_0x770e('0x17'));var utils=require(_0x770e('0x18'));var config=require(_0x770e('0x19'));var licenseUtil=require(_0x770e('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30e0eb,_0x7a432c){_0x7a432c=_0x7a432c||0xcc;return function(_0x6a002){if(_0x6a002){return _0x30e0eb['sendStatus'](_0x7a432c);}return _0x30e0eb[_0x770e('0x1b')](_0x7a432c)[_0x770e('0x1c')]();};}function respondWithResult(_0x4a39c8,_0x43c15a){_0x43c15a=_0x43c15a||0xc8;return function(_0xea5421){if(_0xea5421){return _0x4a39c8[_0x770e('0x1b')](_0x43c15a)[_0x770e('0x1d')](_0xea5421);}};}function respondWithFilteredResult(_0x271cd9,_0x3ae596){return function(_0x477fad){if(_0x477fad){var _0x126d83=typeof _0x3ae596[_0x770e('0x1e')]===_0x770e('0x1f')&&typeof _0x3ae596[_0x770e('0x20')]===_0x770e('0x1f');var _0x2b61f5=_0x477fad[_0x770e('0x21')];var _0x412087=_0x126d83?0x0:_0x3ae596[_0x770e('0x1e')];var _0x208a67=_0x126d83?_0x477fad[_0x770e('0x21')]:_0x3ae596[_0x770e('0x1e')]+_0x3ae596['limit'];var _0x132c5e;if(_0x208a67>=_0x2b61f5){_0x208a67=_0x2b61f5;_0x132c5e=0xc8;}else{_0x132c5e=0xce;}_0x271cd9[_0x770e('0x1b')](_0x132c5e);return _0x271cd9['set'](_0x770e('0x22'),_0x412087+'-'+_0x208a67+'/'+_0x2b61f5)[_0x770e('0x1d')](_0x477fad);}return null;};}function patchUpdates(_0x555a0d){return function(_0x157579){try{jsonpatch['apply'](_0x157579,_0x555a0d,!![]);}catch(_0x1b4b40){return BPromise[_0x770e('0x23')](_0x1b4b40);}return _0x157579[_0x770e('0x24')]();};}function saveUpdates(_0x4a67c5,_0x47ba11){return function(_0x3e2db9){if(_0x3e2db9){return _0x3e2db9[_0x770e('0x25')](_0x4a67c5)[_0x770e('0x26')](function(_0x32cef8){return _0x32cef8;});}return null;};}function removeEntity(_0x2e57aa,_0x344655){return function(_0x8e04a4){if(_0x8e04a4){return _0x8e04a4['destroy']()[_0x770e('0x26')](function(){_0x2e57aa[_0x770e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f7d69,_0x16ddca){return function(_0x315b00){if(!_0x315b00){_0x2f7d69[_0x770e('0x27')](0x194);}return _0x315b00;};}function handleError(_0x210473,_0x1b2bad){_0x1b2bad=_0x1b2bad||0x1f4;return function(_0x23a881){logger['error'](_0x23a881['stack']);if(_0x23a881['name']){delete _0x23a881[_0x770e('0x28')];}_0x210473['status'](_0x1b2bad)[_0x770e('0x29')](_0x23a881);};}exports[_0x770e('0x2a')]=function(_0x58bd08,_0x459219){var _0x5e7e3c={},_0x48ebf9={},_0x1e943e={'count':0x0,'rows':[]};var _0x3a2ebb=_[_0x770e('0x2b')](db[_0x770e('0x2c')][_0x770e('0x2d')],function(_0x29f95a){return{'name':_0x29f95a[_0x770e('0x2e')],'type':_0x29f95a['type'][_0x770e('0x2f')]};});_0x48ebf9['model']=_[_0x770e('0x2b')](_0x3a2ebb,'name');_0x48ebf9[_0x770e('0x30')]=_[_0x770e('0x31')](_0x58bd08[_0x770e('0x30')]);_0x48ebf9[_0x770e('0x32')]=_[_0x770e('0x33')](_0x48ebf9[_0x770e('0x34')],_0x48ebf9[_0x770e('0x30')]);_0x5e7e3c[_0x770e('0x35')]=_[_0x770e('0x33')](_0x48ebf9[_0x770e('0x34')],qs['fields'](_0x58bd08[_0x770e('0x30')][_0x770e('0x36')]));_0x5e7e3c[_0x770e('0x35')]=_0x5e7e3c[_0x770e('0x35')][_0x770e('0x37')]?_0x5e7e3c[_0x770e('0x35')]:_0x48ebf9[_0x770e('0x34')];if(!_0x58bd08[_0x770e('0x30')][_0x770e('0x38')](_0x770e('0x39'))){_0x5e7e3c[_0x770e('0x20')]=qs[_0x770e('0x20')](_0x58bd08['query'][_0x770e('0x20')]);_0x5e7e3c['offset']=qs['offset'](_0x58bd08[_0x770e('0x30')][_0x770e('0x1e')]);}_0x5e7e3c[_0x770e('0x3a')]=qs[_0x770e('0x3b')](_0x58bd08[_0x770e('0x30')][_0x770e('0x3b')]);_0x5e7e3c[_0x770e('0x3c')]=qs[_0x770e('0x32')](_[_0x770e('0x3d')](_0x58bd08[_0x770e('0x30')],_0x48ebf9[_0x770e('0x32')]),_0x3a2ebb);if(_0x58bd08[_0x770e('0x30')]['filter']){_0x5e7e3c[_0x770e('0x3c')]=_[_0x770e('0x3e')](_0x5e7e3c['where'],{'$or':_['map'](_0x3a2ebb,function(_0x2e93e5){if(_0x2e93e5[_0x770e('0x3f')]!==_0x770e('0x40')){var _0x5a4309={};_0x5a4309[_0x2e93e5[_0x770e('0x28')]]={'$like':'%'+_0x58bd08[_0x770e('0x30')][_0x770e('0x41')]+'%'};return _0x5a4309;}})});}_0x5e7e3c=_['merge']({},_0x5e7e3c,_0x58bd08['options']);var _0x35ac11={'where':_0x5e7e3c[_0x770e('0x3c')]};return db['VoiceTransferReport'][_0x770e('0x21')](_0x35ac11)[_0x770e('0x26')](function(_0x208f5d){_0x1e943e[_0x770e('0x21')]=_0x208f5d;if(_0x58bd08[_0x770e('0x30')]['includeAll']){_0x5e7e3c[_0x770e('0x42')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x770e('0x43')](_0x5e7e3c);})[_0x770e('0x26')](function(_0xebe8d9){_0x1e943e[_0x770e('0x44')]=_0xebe8d9;return _0x1e943e;})['then'](respondWithFilteredResult(_0x459219,_0x5e7e3c))[_0x770e('0x45')](handleError(_0x459219,null));};exports['show']=function(_0x59071d,_0x34b136){var _0x4be628={'raw':!![],'where':{'id':_0x59071d[_0x770e('0x46')]['id']}},_0x118db2={};_0x118db2[_0x770e('0x34')]=_[_0x770e('0x31')](db[_0x770e('0x2c')][_0x770e('0x2d')]);_0x118db2[_0x770e('0x30')]=_[_0x770e('0x31')](_0x59071d['query']);_0x118db2['filters']=_[_0x770e('0x33')](_0x118db2['model'],_0x118db2['query']);_0x4be628[_0x770e('0x35')]=_[_0x770e('0x33')](_0x118db2[_0x770e('0x34')],qs['fields'](_0x59071d[_0x770e('0x30')][_0x770e('0x36')]));_0x4be628[_0x770e('0x35')]=_0x4be628[_0x770e('0x35')][_0x770e('0x37')]?_0x4be628[_0x770e('0x35')]:_0x118db2[_0x770e('0x34')];if(_0x59071d[_0x770e('0x30')][_0x770e('0x47')]){_0x4be628[_0x770e('0x42')]=[{'all':!![]}];}_0x4be628=_[_0x770e('0x3e')]({},_0x4be628,_0x59071d[_0x770e('0x48')]);return db[_0x770e('0x2c')][_0x770e('0x49')](_0x4be628)[_0x770e('0x26')](handleEntityNotFound(_0x34b136,null))[_0x770e('0x26')](respondWithResult(_0x34b136,null))[_0x770e('0x45')](handleError(_0x34b136,null));};exports[_0x770e('0x4a')]=function(_0x45cdd6,_0x2a5c60){return db[_0x770e('0x2c')][_0x770e('0x4a')](_0x45cdd6[_0x770e('0x4b')],{})[_0x770e('0x26')](respondWithResult(_0x2a5c60,0xc9))[_0x770e('0x45')](handleError(_0x2a5c60,null));};exports[_0x770e('0x25')]=function(_0x326e57,_0x50f732){if(_0x326e57[_0x770e('0x4b')]['id']){delete _0x326e57[_0x770e('0x4b')]['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x326e57[_0x770e('0x46')]['id']}})['then'](handleEntityNotFound(_0x50f732,null))['then'](saveUpdates(_0x326e57[_0x770e('0x4b')],null))[_0x770e('0x26')](respondWithResult(_0x50f732,null))['catch'](handleError(_0x50f732,null));};exports['destroy']=function(_0x327612,_0x1db8c3){return db[_0x770e('0x2c')]['find']({'where':{'id':_0x327612[_0x770e('0x46')]['id']}})[_0x770e('0x26')](handleEntityNotFound(_0x1db8c3,null))[_0x770e('0x26')](removeEntity(_0x1db8c3,null))[_0x770e('0x45')](handleError(_0x1db8c3,null));};exports['describe']=function(_0xc58c12,_0x472ab5){return db['VoiceTransferReport'][_0x770e('0x4c')]()[_0x770e('0x26')](respondWithResult(_0x472ab5,null))[_0x770e('0x45')](handleError(_0x472ab5,null));};
\ No newline at end of file
+var _0xcc4e=['request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','then','sendStatus','index','map','rawAttributes','type','key','name','keys','query','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','VoiceTransferReport','count','includeAll','include','rows','show','find','create','catch','update','body','params','destroy','describe','eml-format','zip-dir','fast-json-patch'];(function(_0x460f81,_0x553431){var _0x423f0d=function(_0x267a6b){while(--_0x267a6b){_0x460f81['push'](_0x460f81['shift']());}};_0x423f0d(++_0x553431);}(_0xcc4e,0xd8));var _0xecc4=function(_0xfdf7a4,_0x37da46){_0xfdf7a4=_0xfdf7a4-0x0;var _0x59ec89=_0xcc4e[_0xfdf7a4];return _0x59ec89;};'use strict';var emlformat=require(_0xecc4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xecc4('0x1'));var jsonpatch=require(_0xecc4('0x2'));var rp=require(_0xecc4('0x3'));var moment=require(_0xecc4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xecc4('0x5'));var util=require(_0xecc4('0x6'));var path=require(_0xecc4('0x7'));var sox=require(_0xecc4('0x8'));var csv=require(_0xecc4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xecc4('0xa'));var _=require('lodash');var squel=require(_0xecc4('0xb'));var crypto=require(_0xecc4('0xc'));var jsforce=require(_0xecc4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xecc4('0x9'));var querystring=require(_0xecc4('0xe'));var Papa=require('papaparse');var Redis=require(_0xecc4('0xf'));var authService=require(_0xecc4('0x10'));var qs=require(_0xecc4('0x11'));var as=require(_0xecc4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xecc4('0x13'));var utils=require(_0xecc4('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xecc4('0x15'));var db=require(_0xecc4('0x16'))['db'];function respondWithStatusCode(_0x2f1849,_0x1bbf5f){_0x1bbf5f=_0x1bbf5f||0xcc;return function(_0x866a4b){if(_0x866a4b){return _0x2f1849['sendStatus'](_0x1bbf5f);}return _0x2f1849[_0xecc4('0x17')](_0x1bbf5f)[_0xecc4('0x18')]();};}function respondWithResult(_0x23023f,_0x40db95){_0x40db95=_0x40db95||0xc8;return function(_0x225cac){if(_0x225cac){return _0x23023f[_0xecc4('0x17')](_0x40db95)[_0xecc4('0x19')](_0x225cac);}};}function respondWithFilteredResult(_0x103577,_0x3e8e6e){return function(_0x3c08c6){if(_0x3c08c6){var _0x5c25d4=typeof _0x3e8e6e['offset']===_0xecc4('0x1a')&&typeof _0x3e8e6e[_0xecc4('0x1b')]===_0xecc4('0x1a');var _0x4c3ad7=_0x3c08c6['count'];var _0x2cbc3c=_0x5c25d4?0x0:_0x3e8e6e[_0xecc4('0x1c')];var _0x7efa2d=_0x5c25d4?_0x3c08c6['count']:_0x3e8e6e[_0xecc4('0x1c')]+_0x3e8e6e[_0xecc4('0x1b')];var _0x145922;if(_0x7efa2d>=_0x4c3ad7){_0x7efa2d=_0x4c3ad7;_0x145922=0xc8;}else{_0x145922=0xce;}_0x103577[_0xecc4('0x17')](_0x145922);return _0x103577[_0xecc4('0x1d')](_0xecc4('0x1e'),_0x2cbc3c+'-'+_0x7efa2d+'/'+_0x4c3ad7)[_0xecc4('0x19')](_0x3c08c6);}return null;};}function patchUpdates(_0x2db82a){return function(_0x5295dd){try{jsonpatch[_0xecc4('0x1f')](_0x5295dd,_0x2db82a,!![]);}catch(_0x3c94ae){return BPromise[_0xecc4('0x20')](_0x3c94ae);}return _0x5295dd[_0xecc4('0x21')]();};}function saveUpdates(_0x3c76b8,_0x34ca39){return function(_0x4aa3a8){if(_0x4aa3a8){return _0x4aa3a8['update'](_0x3c76b8)[_0xecc4('0x22')](function(_0x585da5){return _0x585da5;});}return null;};}function removeEntity(_0x33dc08,_0x3cad33){return function(_0x1671d0){if(_0x1671d0){return _0x1671d0['destroy']()[_0xecc4('0x22')](function(){_0x33dc08['status'](0xcc)[_0xecc4('0x18')]();});}};}function handleEntityNotFound(_0x1c7839,_0x5c3b15){return function(_0x51f81a){if(!_0x51f81a){_0x1c7839[_0xecc4('0x23')](0x194);}return _0x51f81a;};}function handleError(_0x21c50c,_0xff4caf){_0xff4caf=_0xff4caf||0x1f4;return function(_0x53ec09){logger['error'](_0x53ec09['stack']);if(_0x53ec09['name']){delete _0x53ec09['name'];}_0x21c50c['status'](_0xff4caf)['send'](_0x53ec09);};}exports[_0xecc4('0x24')]=function(_0x266549,_0x362fb2){var _0x49f8b1={},_0x4107c9={},_0x549e96={'count':0x0,'rows':[]};var _0x5ad858=_[_0xecc4('0x25')](db['VoiceTransferReport'][_0xecc4('0x26')],function(_0x544fa8){return{'name':_0x544fa8['fieldName'],'type':_0x544fa8[_0xecc4('0x27')][_0xecc4('0x28')]};});_0x4107c9['model']=_['map'](_0x5ad858,_0xecc4('0x29'));_0x4107c9['query']=_[_0xecc4('0x2a')](_0x266549[_0xecc4('0x2b')]);_0x4107c9['filters']=_['intersection'](_0x4107c9[_0xecc4('0x2c')],_0x4107c9[_0xecc4('0x2b')]);_0x49f8b1['attributes']=_[_0xecc4('0x2d')](_0x4107c9[_0xecc4('0x2c')],qs[_0xecc4('0x2e')](_0x266549[_0xecc4('0x2b')][_0xecc4('0x2e')]));_0x49f8b1[_0xecc4('0x2f')]=_0x49f8b1[_0xecc4('0x2f')][_0xecc4('0x30')]?_0x49f8b1[_0xecc4('0x2f')]:_0x4107c9[_0xecc4('0x2c')];if(!_0x266549[_0xecc4('0x2b')][_0xecc4('0x31')]('nolimit')){_0x49f8b1[_0xecc4('0x1b')]=qs['limit'](_0x266549[_0xecc4('0x2b')][_0xecc4('0x1b')]);_0x49f8b1['offset']=qs[_0xecc4('0x1c')](_0x266549[_0xecc4('0x2b')][_0xecc4('0x1c')]);}_0x49f8b1[_0xecc4('0x32')]=qs[_0xecc4('0x33')](_0x266549[_0xecc4('0x2b')][_0xecc4('0x33')]);_0x49f8b1[_0xecc4('0x34')]=qs[_0xecc4('0x35')](_[_0xecc4('0x36')](_0x266549['query'],_0x4107c9[_0xecc4('0x35')]),_0x5ad858);if(_0x266549[_0xecc4('0x2b')]['filter']){_0x49f8b1['where']=_[_0xecc4('0x37')](_0x49f8b1[_0xecc4('0x34')],{'$or':_[_0xecc4('0x25')](_0x5ad858,function(_0x23b7e6){if(_0x23b7e6['type']!==_0xecc4('0x38')){var _0x44f7d8={};_0x44f7d8[_0x23b7e6[_0xecc4('0x29')]]={'$like':'%'+_0x266549[_0xecc4('0x2b')][_0xecc4('0x39')]+'%'};return _0x44f7d8;}})});}_0x49f8b1=_[_0xecc4('0x37')]({},_0x49f8b1,_0x266549[_0xecc4('0x3a')]);var _0x4a09e4={'where':_0x49f8b1['where']};return db[_0xecc4('0x3b')]['count'](_0x4a09e4)[_0xecc4('0x22')](function(_0x3f59b6){_0x549e96[_0xecc4('0x3c')]=_0x3f59b6;if(_0x266549[_0xecc4('0x2b')][_0xecc4('0x3d')]){_0x49f8b1[_0xecc4('0x3e')]=[{'all':!![]}];}return db[_0xecc4('0x3b')]['findAll'](_0x49f8b1);})[_0xecc4('0x22')](function(_0x2dd01f){_0x549e96[_0xecc4('0x3f')]=_0x2dd01f;return _0x549e96;})[_0xecc4('0x22')](respondWithFilteredResult(_0x362fb2,_0x49f8b1))['catch'](handleError(_0x362fb2,null));};exports[_0xecc4('0x40')]=function(_0x15fbe5,_0x245a80){var _0x1f98aa={'raw':!![],'where':{'id':_0x15fbe5['params']['id']}},_0x186156={};_0x186156['model']=_[_0xecc4('0x2a')](db[_0xecc4('0x3b')][_0xecc4('0x26')]);_0x186156['query']=_[_0xecc4('0x2a')](_0x15fbe5[_0xecc4('0x2b')]);_0x186156['filters']=_[_0xecc4('0x2d')](_0x186156['model'],_0x186156[_0xecc4('0x2b')]);_0x1f98aa['attributes']=_[_0xecc4('0x2d')](_0x186156[_0xecc4('0x2c')],qs[_0xecc4('0x2e')](_0x15fbe5[_0xecc4('0x2b')]['fields']));_0x1f98aa['attributes']=_0x1f98aa['attributes']['length']?_0x1f98aa[_0xecc4('0x2f')]:_0x186156[_0xecc4('0x2c')];if(_0x15fbe5[_0xecc4('0x2b')][_0xecc4('0x3d')]){_0x1f98aa['include']=[{'all':!![]}];}_0x1f98aa=_[_0xecc4('0x37')]({},_0x1f98aa,_0x15fbe5['options']);return db[_0xecc4('0x3b')][_0xecc4('0x41')](_0x1f98aa)[_0xecc4('0x22')](handleEntityNotFound(_0x245a80,null))[_0xecc4('0x22')](respondWithResult(_0x245a80,null))['catch'](handleError(_0x245a80,null));};exports['create']=function(_0x5eb8f4,_0x4e4bc5){return db[_0xecc4('0x3b')][_0xecc4('0x42')](_0x5eb8f4['body'],{})[_0xecc4('0x22')](respondWithResult(_0x4e4bc5,0xc9))[_0xecc4('0x43')](handleError(_0x4e4bc5,null));};exports[_0xecc4('0x44')]=function(_0x3df05d,_0xde6229){if(_0x3df05d[_0xecc4('0x45')]['id']){delete _0x3df05d[_0xecc4('0x45')]['id'];}return db['VoiceTransferReport'][_0xecc4('0x41')]({'where':{'id':_0x3df05d[_0xecc4('0x46')]['id']}})['then'](handleEntityNotFound(_0xde6229,null))[_0xecc4('0x22')](saveUpdates(_0x3df05d[_0xecc4('0x45')],null))[_0xecc4('0x22')](respondWithResult(_0xde6229,null))[_0xecc4('0x43')](handleError(_0xde6229,null));};exports[_0xecc4('0x47')]=function(_0x200b26,_0x16cd16){return db[_0xecc4('0x3b')][_0xecc4('0x41')]({'where':{'id':_0x200b26['params']['id']}})['then'](handleEntityNotFound(_0x16cd16,null))[_0xecc4('0x22')](removeEntity(_0x16cd16,null))['catch'](handleError(_0x16cd16,null));};exports[_0xecc4('0x48')]=function(_0x4b19a8,_0x4df9e2){return db[_0xecc4('0x3b')][_0xecc4('0x48')]()['then'](respondWithResult(_0x4df9e2,null))[_0xecc4('0x43')](handleError(_0x4df9e2,null));};
\ No newline at end of file
index 64d5fa9..aecc160 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x901c=['../../config/environment','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x2a8cb7,_0x314d29){var _0x183a1f=function(_0x7f65bc){while(--_0x7f65bc){_0x2a8cb7['push'](_0x2a8cb7['shift']());}};_0x183a1f(++_0x314d29);}(_0x901c,0x1c7));var _0xc901=function(_0x37b140,_0x1d997b){_0x37b140=_0x37b140-0x0;var _0x31acda=_0x901c[_0x37b140];return _0x31acda;};'use strict';var _=require(_0xc901('0x0'));var util=require(_0xc901('0x1'));var logger=require(_0xc901('0x2'))(_0xc901('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc901('0x4'));var fs=require('fs');var path=require(_0xc901('0x5'));var rimraf=require(_0xc901('0x6'));var config=require(_0xc901('0x7'));var attributes=require('./voiceTransferReport.attributes');module['exports']=function(_0x28d0f5,_0x57779f){return _0x28d0f5[_0xc901('0x8')](_0xc901('0x9'),attributes,{'tableName':_0xc901('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e8b=['moment','bluebird','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x39c559,_0xb1ece5){var _0x1b213f=function(_0x5d83f9){while(--_0x5d83f9){_0x39c559['push'](_0x39c559['shift']());}};_0x1b213f(++_0xb1ece5);}(_0x4e8b,0x8b));var _0xb4e8=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0x4e8b[_0x4bb66f];return _0xf2772f;};'use strict';var _=require(_0xb4e8('0x0'));var util=require(_0xb4e8('0x1'));var logger=require(_0xb4e8('0x2'))(_0xb4e8('0x3'));var moment=require(_0xb4e8('0x4'));var BPromise=require(_0xb4e8('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb4e8('0x6'));var attributes=require('./voiceTransferReport.attributes');module[_0xb4e8('0x7')]=function(_0x38c1bc,_0x323a2c){return _0x38c1bc[_0xb4e8('0x8')](_0xb4e8('0x9'),attributes,{'tableName':_0xb4e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7666c59..f0023e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8be2=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug'];(function(_0x1bd201,_0x1cb1bd){var _0x2c7d90=function(_0xf57607){while(--_0xf57607){_0x1bd201['push'](_0x1bd201['shift']());}};_0x2c7d90(++_0x1cb1bd);}(_0x8be2,0x1d0));var _0x28be=function(_0xa76f70,_0x115a75){_0xa76f70=_0xa76f70-0x0;var _0x24459b=_0x8be2[_0xa76f70];return _0x24459b;};'use strict';var _=require(_0x28be('0x0'));var util=require(_0x28be('0x1'));var moment=require(_0x28be('0x2'));var BPromise=require(_0x28be('0x3'));var rs=require(_0x28be('0x4'));var fs=require('fs');var Redis=require(_0x28be('0x5'));var db=require(_0x28be('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x28be('0x7'));var config=require(_0x28be('0x8'));var jayson=require(_0x28be('0x9'));var client=jayson[_0x28be('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd533,_0x4b439f,_0x55ebaa){return new BPromise(function(_0x2144fe,_0x173ce9){return client[_0x28be('0xb')](_0x1dd533,_0x55ebaa)[_0x28be('0xc')](function(_0x1b49ac){logger['info'](_0x28be('0xd'),_0x4b439f,_0x28be('0xe'));logger['debug'](_0x28be('0xf'),_0x4b439f,_0x28be('0xe'),JSON[_0x28be('0x10')](_0x1b49ac));if(_0x1b49ac['error']){if(_0x1b49ac[_0x28be('0x11')][_0x28be('0x12')]===0x1f4){logger[_0x28be('0x11')](_0x28be('0xd'),_0x4b439f,_0x1b49ac[_0x28be('0x11')][_0x28be('0x13')]);return _0x173ce9(_0x1b49ac[_0x28be('0x11')]['message']);}logger[_0x28be('0x11')](_0x28be('0xd'),_0x4b439f,_0x1b49ac[_0x28be('0x11')][_0x28be('0x13')]);return _0x2144fe(_0x1b49ac[_0x28be('0x11')][_0x28be('0x13')]);}else{logger[_0x28be('0x14')](_0x28be('0xd'),_0x4b439f,'request\x20sent');_0x2144fe(_0x1b49ac[_0x28be('0x15')][_0x28be('0x13')]);}})['catch'](function(_0x568c5e){logger[_0x28be('0x11')](_0x28be('0xd'),_0x4b439f,_0x568c5e);_0x173ce9(_0x568c5e);});});}exports[_0x28be('0x16')]=function(_0x3aa4b5){var _0x3ad6d4=this;return new Promise(function(_0x458e17,_0x5b314c){return db[_0x28be('0x17')][_0x28be('0x18')](_0x3aa4b5[_0x28be('0x19')],{'raw':_0x3aa4b5[_0x28be('0x1a')]?_0x3aa4b5[_0x28be('0x1a')][_0x28be('0x1b')]===undefined?!![]:![]:!![]})[_0x28be('0xc')](function(_0x3a1109){logger[_0x28be('0x14')]('CreateVoiceTransferReport',_0x3aa4b5);logger[_0x28be('0x1c')](_0x28be('0x16'),_0x3aa4b5,JSON[_0x28be('0x10')](_0x3a1109));_0x458e17(_0x3a1109);})['catch'](function(_0x3120a0){logger[_0x28be('0x11')]('CreateVoiceTransferReport',_0x3120a0['message'],_0x3aa4b5);_0x5b314c(_0x3ad6d4[_0x28be('0x11')](0x1f4,_0x3120a0[_0x28be('0x13')]));});});};
\ No newline at end of file
+var _0x83ba=['error','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x3366c2,_0x41ea58){var _0x1a0776=function(_0xaedcff){while(--_0xaedcff){_0x3366c2['push'](_0x3366c2['shift']());}};_0x1a0776(++_0x41ea58);}(_0x83ba,0x134));var _0xa83b=function(_0x4cd2be,_0x1f81eb){_0x4cd2be=_0x4cd2be-0x0;var _0x531df4=_0x83ba[_0x4cd2be];return _0x531df4;};'use strict';var _=require(_0xa83b('0x0'));var util=require(_0xa83b('0x1'));var moment=require(_0xa83b('0x2'));var BPromise=require('bluebird');var rs=require(_0xa83b('0x3'));var fs=require('fs');var Redis=require(_0xa83b('0x4'));var db=require(_0xa83b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa83b('0x6'))(_0xa83b('0x7'));var config=require(_0xa83b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa83b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5524b4,_0x1839c4,_0x29de7c){return new BPromise(function(_0x5161b0,_0x119246){return client[_0xa83b('0xa')](_0x5524b4,_0x29de7c)[_0xa83b('0xb')](function(_0x3bb926){logger[_0xa83b('0xc')](_0xa83b('0xd'),_0x1839c4,_0xa83b('0xe'));logger[_0xa83b('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x1839c4,'request\x20sent',JSON[_0xa83b('0x10')](_0x3bb926));if(_0x3bb926[_0xa83b('0x11')]){if(_0x3bb926[_0xa83b('0x11')]['code']===0x1f4){logger[_0xa83b('0x11')](_0xa83b('0xd'),_0x1839c4,_0x3bb926[_0xa83b('0x11')]['message']);return _0x119246(_0x3bb926[_0xa83b('0x11')]['message']);}logger[_0xa83b('0x11')](_0xa83b('0xd'),_0x1839c4,_0x3bb926[_0xa83b('0x11')][_0xa83b('0x12')]);return _0x5161b0(_0x3bb926[_0xa83b('0x11')][_0xa83b('0x12')]);}else{logger[_0xa83b('0xc')](_0xa83b('0xd'),_0x1839c4,_0xa83b('0xe'));_0x5161b0(_0x3bb926[_0xa83b('0x13')][_0xa83b('0x12')]);}})['catch'](function(_0x1b8588){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1839c4,_0x1b8588);_0x119246(_0x1b8588);});});}exports[_0xa83b('0x14')]=function(_0x4894d7){var _0x4ec39d=this;return new Promise(function(_0x56d87f,_0x5e7dc8){return db[_0xa83b('0x15')][_0xa83b('0x16')](_0x4894d7[_0xa83b('0x17')],{'raw':_0x4894d7[_0xa83b('0x18')]?_0x4894d7[_0xa83b('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1c6f48){logger['info'](_0xa83b('0x14'),_0x4894d7);logger[_0xa83b('0xf')](_0xa83b('0x14'),_0x4894d7,JSON[_0xa83b('0x10')](_0x1c6f48));_0x56d87f(_0x1c6f48);})['catch'](function(_0x1ad152){logger[_0xa83b('0x11')](_0xa83b('0x14'),_0x1ad152['message'],_0x4894d7);_0x5e7dc8(_0x4ec39d[_0xa83b('0x11')](0x1f4,_0x1ad152[_0xa83b('0x12')]));});});};
\ No newline at end of file
index 86d5dbe..8791eb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x451d3b,_0x232a29){var _0x4e5499=function(_0x3c0479){while(--_0x3c0479){_0x451d3b['push'](_0x451d3b['shift']());}};_0x4e5499(++_0x232a29);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xb4e6[_0x288f5e];return _0x476cc9;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router;
\ No newline at end of file
+var _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb43b,0x1b2));var _0xbb43=function(_0x20e2f2,_0x31cbbd){_0x20e2f2=_0x20e2f2-0x0;var _0x5c6e20=_0xb43b[_0x20e2f2];return _0x5c6e20;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router;
\ No newline at end of file
index 61d5843..ec3220a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callerId','callbackUrl','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','format','user:%s','webbar:hangup','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','send','status','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter'];(function(_0x5322e3,_0x20d04c){var _0x31b51b=function(_0x4b975b){while(--_0x4b975b){_0x5322e3['push'](_0x5322e3['shift']());}};_0x31b51b(++_0x20d04c);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x4e64('0x0'));var fs=require('fs');var _=require(_0x4e64('0x1'));var db=require(_0x4e64('0x2'))['db'];var config=require(_0x4e64('0x3'));var util=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x4e64('0x6')][_0x4e64('0x7')]({'port':0x232a});var logger=require(_0x4e64('0x8'))(_0x4e64('0x9'));var Redis=require(_0x4e64('0xa'));config[_0x4e64('0xb')]=_['defaults'](config[_0x4e64('0xb')],{'host':_0x4e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x4e64('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4e64('0xe'),'required':[!![],_0x4e64('0xf')]},'callerId':{'type':_0x4e64('0xe')},'callbackUrl':{'type':_0x4e64('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x4e64('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x4e64('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4e64('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]}});function emit(_0x5b35b0,_0x3b885a,_0x3677f9){logger[_0x4e64('0x14')](_0x5b35b0,_0x3b885a,JSON[_0x4e64('0x15')](_0x3677f9));io['to'](_0x5b35b0)[_0x4e64('0x16')](_0x3b885a,_0x3677f9);}function handleError(_0x2a60ad){return function(_0x135ffb){console[_0x4e64('0x17')](_0x4e64('0x18'),_0x135ffb,_0x135ffb instanceof RangeError);logger[_0x4e64('0x19')](_0x135ffb['stack']);if(_0x135ffb instanceof RangeError){if(_0x135ffb[_0x4e64('0x1a')]){delete _0x135ffb[_0x4e64('0x1a')];}_0x2a60ad['status'](0x194)[_0x4e64('0x1b')](_0x135ffb);}else{if(_0x135ffb['name']){delete _0x135ffb['name'];}_0x2a60ad[_0x4e64('0x1c')](0x1f4)[_0x4e64('0x1b')](_0x135ffb);}};}function checkError(){return function(_0x227d64){if(!_0x227d64){throw new RangeError('NotFound');}return _0x227d64;};}function respondWithRpcPromise(_0x4a5c6d,_0x4a9957){return new BPromise(function(_0x30e356,_0x336c53){var _0x2df7a0=amiClient;return _0x2df7a0['request'](_0x4a5c6d,_0x4a9957)[_0x4e64('0x1d')](function(_0x58ea85){if(_0x58ea85[_0x4e64('0x19')]){if(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1e')]===0x1f4){return _0x336c53(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1f')]);}return _0x30e356(_0x58ea85['error'][_0x4e64('0x1f')]);}else{_0x30e356(_0x58ea85[_0x4e64('0x20')]);}})[_0x4e64('0x21')](function(_0x4afb9c){_0x336c53(_0x4afb9c);});});}function getAgent(_0x786ba9){return db[_0x4e64('0x22')][_0x4e64('0x23')]({'where':{'id':_0x786ba9,'role':_0x4e64('0x24')}})[_0x4e64('0x1d')](checkError());}function getAgentCheckSession(_0x5f0d42,_0x3185ba){return new BPromise(function(_0x2b1f2b,_0x45953f){var _0x194f33=respondWithRpcPromise(_0x4e64('0x25'));var _0x1057d0=getAgent(_0x5f0d42);Promise[_0x4e64('0x26')]([_0x194f33,_0x1057d0])[_0x4e64('0x1d')](function(_0x5467a5){var _0x371035=_0x5467a5[0x0];var _0xb17ca7=_0x5467a5[0x1];var _0x45ef44=_[_0x4e64('0x27')](_0x371035[_0x4e64('0x28')],function(_0x3b1f16){return _0x3b1f16[_0x4e64('0x29')]==_0xb17ca7['id']&&_0x3b1f16['sessionId']==_0x3185ba;});if(_0x45ef44[_0x4e64('0x2a')]==0x1){_0x2b1f2b(_0xb17ca7);}else{_0x45953f(new RangeError(_0x4e64('0x2b')+_0x3185ba+_0x4e64('0x2c')));}});});}exports[_0x4e64('0x2d')]=function(_0x3d8042,_0x3d6cec){logger[_0x4e64('0x14')]('originate\x20fired:',_0x3d8042[_0x4e64('0x2e')]);var _0x317c07=originateValidation[_0x4e64('0xd')](_0x3d8042['body']);if(_0x317c07[_0x4e64('0x2a')]>0x0){return _0x3d6cec['status'](0x190)[_0x4e64('0x2f')](_0x317c07);}var _0x37cde0=_0x3d8042['body']['userId'];var _0x5417ad=_0x3d8042[_0x4e64('0x2e')]['callNumber'];var _0x2c2397=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x30')];var _0x18ca6c=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x31')];return getAgent(_0x37cde0)[_0x4e64('0x1d')](function(_0x50b8d5){logger[_0x4e64('0x14')]('entityFound:',_0x50b8d5[_0x4e64('0x1a')]);emit(util['format']('user:%s',_0x50b8d5['name']),_0x4e64('0x32'),{'callNumber':_0x5417ad,'callerId':_0x2c2397,'callbackUrl':_0x18ca6c});return _0x3d6cec['status'](0xc8)['json']({'error':![],'message':_0x4e64('0x33')});})[_0x4e64('0x21')](handleError(_0x3d6cec));};exports[_0x4e64('0x34')]=function(_0x189769,_0x1757a2){logger[_0x4e64('0x14')](_0x4e64('0x35'),_0x189769['body']);var _0x5a03a8=hangupValidation['validate'](_0x189769[_0x4e64('0x2e')]);if(_0x5a03a8[_0x4e64('0x2a')]>0x0){return _0x1757a2[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x5a03a8);}var _0x5bf847=_0x189769[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x11c373=_0x189769[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x5bf847)['then'](function(_0x4faf59){logger[_0x4e64('0x14')]('entityFound:',_0x4faf59[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x4faf59[_0x4e64('0x1a')]),_0x4e64('0x3a'),{'sessionId':_0x11c373});return _0x1757a2[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x4e64('0x21')](handleError(_0x1757a2));};exports[_0x4e64('0x3b')]=function(_0x460d66,_0x2e6684){logger[_0x4e64('0x14')](_0x4e64('0x3c'),_0x460d66[_0x4e64('0x2e')]);var _0x21e835=answerValidation['validate'](_0x460d66[_0x4e64('0x2e')]);if(_0x21e835[_0x4e64('0x2a')]>0x0){return _0x2e6684['status'](0x190)[_0x4e64('0x2f')](_0x21e835);}var _0x306b4d=_0x460d66['body'][_0x4e64('0x36')];var _0x1ddcf2=_0x460d66[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x306b4d)[_0x4e64('0x1d')](function(_0x5bc523){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x5bc523[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x5bc523[_0x4e64('0x1a')]),_0x4e64('0x3e'),{'sessionId':_0x1ddcf2});return _0x2e6684[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x4e64('0x21')](handleError(_0x2e6684));};exports[_0x4e64('0x3f')]=function(_0x3cf687,_0x5861d7){logger[_0x4e64('0x14')](_0x4e64('0x40'),_0x3cf687[_0x4e64('0x2e')]);var _0x19a71b=holdValidation[_0x4e64('0xd')](_0x3cf687['body']);if(_0x19a71b[_0x4e64('0x2a')]>0x0){return _0x5861d7['status'](0x190)[_0x4e64('0x2f')](_0x19a71b);}var _0x3a5fad=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x4cfac3=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x3a5fad)[_0x4e64('0x1d')](function(_0x38a885){logger[_0x4e64('0x14')]('entityFound:',_0x38a885[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x38a885[_0x4e64('0x1a')]),_0x4e64('0x41'),{'sessionId':_0x4cfac3});return _0x5861d7[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x42')});})[_0x4e64('0x21')](handleError(_0x5861d7));};exports[_0x4e64('0x43')]=function(_0x4c2948,_0x44946b){logger[_0x4e64('0x14')]('unhold\x20fired:',_0x4c2948[_0x4e64('0x2e')]);var _0x5cedc6=unholdValidation[_0x4e64('0xd')](_0x4c2948['body']);if(_0x5cedc6[_0x4e64('0x2a')]>0x0){return _0x44946b['status'](0x190)[_0x4e64('0x2f')](_0x5cedc6);}var _0xb2c2c7=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x33933a=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0xb2c2c7)['then'](function(_0x471be1){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x471be1['name']);emit(util['format'](_0x4e64('0x39'),_0x471be1['name']),_0x4e64('0x44'),{'sessionId':_0x33933a});return _0x44946b[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':_0x4e64('0x45')});})[_0x4e64('0x21')](handleError(_0x44946b));};exports['calls']=function(_0x562f53,_0x339e39){logger[_0x4e64('0x14')](_0x4e64('0x46'),_0x339e39[_0x4e64('0x2e')]);var _0x3def87=callsValidation[_0x4e64('0xd')](_0x562f53[_0x4e64('0x2e')]);if(_0x3def87[_0x4e64('0x2a')]>0x0){return _0x339e39['status'](0x190)[_0x4e64('0x2f')](_0x3def87);}var _0x3251a3=_0x562f53[_0x4e64('0x2e')]['userId'];var _0xa277da=respondWithRpcPromise(_0x4e64('0x25'));var _0x502640=getAgent(_0x3251a3);return Promise[_0x4e64('0x26')]([_0xa277da,_0x502640])[_0x4e64('0x1d')](function(_0xb1ef5f){var _0x377da8=_0xb1ef5f[0x0];var _0x82dcde=_0xb1ef5f[0x1];var _0x10d2ac=_['filter'](_0x377da8[_0x4e64('0x28')],function(_0x12bf29){return _0x12bf29[_0x4e64('0x29')]==_0x82dcde['id'];});return _0x339e39['status'](0xc8)[_0x4e64('0x2f')]({'count':_0x10d2ac[_0x4e64('0x2a')],'rows':_0x10d2ac});})[_0x4e64('0x21')](handleError(_0x339e39));};exports[_0x4e64('0x47')]=function(_0x5d3789,_0x1914bf){logger[_0x4e64('0x14')]('conference\x20fired:',_0x5d3789[_0x4e64('0x2e')]);var _0xafc845=conferenceValidation[_0x4e64('0xd')](_0x5d3789[_0x4e64('0x2e')]);if(_0xafc845[_0x4e64('0x2a')]>0x0){return _0x1914bf[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0xafc845);}var _0x40873c=_0x5d3789['body'][_0x4e64('0x36')];return getAgent(_0x40873c)[_0x4e64('0x1d')](function(_0x489a34){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x489a34[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x489a34['name']),_0x4e64('0x48'));return _0x1914bf[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x49')});})[_0x4e64('0x21')](handleError(_0x1914bf));};exports[_0x4e64('0x4a')]=function(_0x44c368,_0xf9c4e0){logger[_0x4e64('0x14')]('transfer\x20fired:',_0x44c368[_0x4e64('0x2e')]);var _0x291fe8=transferValidation[_0x4e64('0xd')](_0x44c368['body']);if(_0x291fe8[_0x4e64('0x2a')]>0x0){return _0xf9c4e0[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x291fe8);}var _0x5ed23f=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x5761c9=_0x44c368['body']['sessionId'];var _0x3f2a81=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x4b')];return getAgent(_0x5ed23f)[_0x4e64('0x1d')](function(_0x27db3f){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x27db3f[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x27db3f[_0x4e64('0x1a')]),_0x4e64('0x4c'),{'sessionId':_0x5761c9,'transferNumber':_0x3f2a81});return _0xf9c4e0[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0xf9c4e0));};
\ No newline at end of file
+var _0x00bb=['hangup\x20fired:','webbar:hangup','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','all','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','util','jayson/promise','client','../../config/logger','webbarapi','redis','localhost','socket.io-emitter','validate','number','callNumber\x20is\x20required','string','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','handleError:','stack','name','status','send','NotFound','request','error','code','message','result','catch','User','VoiceChannels','then','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','json','body','userId','callNumber','callbackUrl','entityFound:','format','user:%s','webbar:originate'];(function(_0x57d5bb,_0x40844e){var _0x196962=function(_0x213b86){while(--_0x213b86){_0x57d5bb['push'](_0x57d5bb['shift']());}};_0x196962(++_0x40844e);}(_0x00bb,0x1d8));var _0xb00b=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x00bb[_0xc6be3a];return _0x56a310;};'use strict';var path=require(_0xb00b('0x0'));var fs=require('fs');var _=require(_0xb00b('0x1'));var db=require(_0xb00b('0x2'))['db'];var config=require('../../config/environment');var util=require(_0xb00b('0x3'));var BPromise=require('bluebird');var jayson=require(_0xb00b('0x4'));var amiClient=jayson[_0xb00b('0x5')]['http']({'port':0x232a});var logger=require(_0xb00b('0x6'))(_0xb00b('0x7'));var Redis=require('ioredis');config['redis']=_['defaults'](config[_0xb00b('0x8')],{'host':_0xb00b('0x9'),'port':0x18eb});var io=require(_0xb00b('0xa'))(new Redis(config[_0xb00b('0x8')]));var Schema=require(_0xb00b('0xb'));var originateValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':'string','required':[!![],_0xb00b('0xd')]},'callerId':{'type':_0xb00b('0xe')},'callbackUrl':{'type':_0xb00b('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],_0xb00b('0xf')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]},'sessionId':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x10')]},'transferNumber':{'type':_0xb00b('0xe'),'required':[!![],_0xb00b('0x11')]}});var holdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xb00b('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xb00b('0xc'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xb00b('0xf')]}});function emit(_0x4dcd45,_0x51d136,_0x1f9c78){logger[_0xb00b('0x12')](_0x4dcd45,_0x51d136,JSON[_0xb00b('0x13')](_0x1f9c78));io['to'](_0x4dcd45)[_0xb00b('0x14')](_0x51d136,_0x1f9c78);}function handleError(_0x58d65f){return function(_0x2a7231){console['log'](_0xb00b('0x15'),_0x2a7231,_0x2a7231 instanceof RangeError);logger['error'](_0x2a7231[_0xb00b('0x16')]);if(_0x2a7231 instanceof RangeError){if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f[_0xb00b('0x18')](0x194)['send'](_0x2a7231);}else{if(_0x2a7231['name']){delete _0x2a7231[_0xb00b('0x17')];}_0x58d65f['status'](0x1f4)[_0xb00b('0x19')](_0x2a7231);}};}function checkError(){return function(_0x43da66){if(!_0x43da66){throw new RangeError(_0xb00b('0x1a'));}return _0x43da66;};}function respondWithRpcPromise(_0x3501af,_0x56c189){return new BPromise(function(_0x362ee0,_0x4df284){var _0x25a973=amiClient;return _0x25a973[_0xb00b('0x1b')](_0x3501af,_0x56c189)['then'](function(_0x231293){if(_0x231293[_0xb00b('0x1c')]){if(_0x231293['error'][_0xb00b('0x1d')]===0x1f4){return _0x4df284(_0x231293[_0xb00b('0x1c')]['message']);}return _0x362ee0(_0x231293[_0xb00b('0x1c')][_0xb00b('0x1e')]);}else{_0x362ee0(_0x231293[_0xb00b('0x1f')]);}})[_0xb00b('0x20')](function(_0x520e55){_0x4df284(_0x520e55);});});}function getAgent(_0x50be6c){return db[_0xb00b('0x21')]['findOne']({'where':{'id':_0x50be6c,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x16ac55,_0x73b6b0){return new BPromise(function(_0x2592cf,_0x3825af){var _0x1f14fa=respondWithRpcPromise(_0xb00b('0x22'));var _0x15d3b9=getAgent(_0x16ac55);Promise['all']([_0x1f14fa,_0x15d3b9])[_0xb00b('0x23')](function(_0x503c9c){var _0x450129=_0x503c9c[0x0];var _0x348165=_0x503c9c[0x1];var _0x5424ca=_['filter'](_0x450129[_0xb00b('0x24')],function(_0x280ed3){return _0x280ed3[_0xb00b('0x25')]==_0x348165['id']&&_0x280ed3[_0xb00b('0x26')]==_0x73b6b0;});if(_0x5424ca[_0xb00b('0x27')]==0x1){_0x2592cf(_0x348165);}else{_0x3825af(new RangeError(_0xb00b('0x28')+_0x73b6b0+_0xb00b('0x29')));}});});}exports[_0xb00b('0x2a')]=function(_0x149c1a,_0x54e247){logger[_0xb00b('0x12')](_0xb00b('0x2b'),_0x149c1a['body']);var _0x593659=originateValidation[_0xb00b('0xb')](_0x149c1a['body']);if(_0x593659[_0xb00b('0x27')]>0x0){return _0x54e247['status'](0x190)[_0xb00b('0x2c')](_0x593659);}var _0x4117f2=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x338864=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x2f')];var _0x594840=_0x149c1a['body']['callerId'];var _0x347e73=_0x149c1a[_0xb00b('0x2d')][_0xb00b('0x30')];return getAgent(_0x4117f2)[_0xb00b('0x23')](function(_0x5cfa60){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x5cfa60[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x5cfa60[_0xb00b('0x17')]),_0xb00b('0x34'),{'callNumber':_0x338864,'callerId':_0x594840,'callbackUrl':_0x347e73});return _0x54e247[_0xb00b('0x18')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})[_0xb00b('0x20')](handleError(_0x54e247));};exports['hangup']=function(_0x1c8258,_0x1c5400){logger[_0xb00b('0x12')](_0xb00b('0x35'),_0x1c8258[_0xb00b('0x2d')]);var _0x142cdd=hangupValidation[_0xb00b('0xb')](_0x1c8258['body']);if(_0x142cdd[_0xb00b('0x27')]>0x0){return _0x1c5400[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x142cdd);}var _0xd9c03f=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x59fb00=_0x1c8258[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0xd9c03f)['then'](function(_0x17ff34){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x17ff34[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x17ff34[_0xb00b('0x17')]),_0xb00b('0x36'),{'sessionId':_0x59fb00});return _0x1c5400[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':'hangup\x20executed!'});})['catch'](handleError(_0x1c5400));};exports[_0xb00b('0x37')]=function(_0xf6ae0c,_0x10a348){logger[_0xb00b('0x12')](_0xb00b('0x38'),_0xf6ae0c[_0xb00b('0x2d')]);var _0x275664=answerValidation['validate'](_0xf6ae0c[_0xb00b('0x2d')]);if(_0x275664[_0xb00b('0x27')]>0x0){return _0x10a348[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x275664);}var _0x302ded=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x974a29=_0xf6ae0c[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x302ded)[_0xb00b('0x23')](function(_0x419113){logger['info'](_0xb00b('0x31'),_0x419113[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x419113[_0xb00b('0x17')]),_0xb00b('0x39'),{'sessionId':_0x974a29});return _0x10a348[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3a')});})[_0xb00b('0x20')](handleError(_0x10a348));};exports[_0xb00b('0x3b')]=function(_0x3b3031,_0x5dbe00){logger['info']('hold\x20fired:',_0x3b3031[_0xb00b('0x2d')]);var _0x23d858=holdValidation['validate'](_0x3b3031[_0xb00b('0x2d')]);if(_0x23d858[_0xb00b('0x27')]>0x0){return _0x5dbe00[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x23d858);}var _0x4b62b3=_0x3b3031['body'][_0xb00b('0x2e')];var _0x40c2fd=_0x3b3031['body']['sessionId'];return getAgent(_0x4b62b3)[_0xb00b('0x23')](function(_0x3a205d){logger['info'](_0xb00b('0x31'),_0x3a205d['name']);emit(util['format']('user:%s',_0x3a205d[_0xb00b('0x17')]),'webbar:hold',{'sessionId':_0x40c2fd});return _0x5dbe00[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x3c')});})[_0xb00b('0x20')](handleError(_0x5dbe00));};exports[_0xb00b('0x3d')]=function(_0xda60ca,_0x4846c9){logger['info'](_0xb00b('0x3e'),_0xda60ca[_0xb00b('0x2d')]);var _0x559357=unholdValidation[_0xb00b('0xb')](_0xda60ca[_0xb00b('0x2d')]);if(_0x559357['length']>0x0){return _0x4846c9[_0xb00b('0x18')](0x190)[_0xb00b('0x2c')](_0x559357);}var _0x3b5d82=_0xda60ca['body']['userId'];var _0x19f907=_0xda60ca[_0xb00b('0x2d')][_0xb00b('0x26')];return getAgent(_0x3b5d82)[_0xb00b('0x23')](function(_0x489b49){logger[_0xb00b('0x12')](_0xb00b('0x31'),_0x489b49['name']);emit(util['format'](_0xb00b('0x33'),_0x489b49['name']),_0xb00b('0x3f'),{'sessionId':_0x19f907});return _0x4846c9[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x40')});})[_0xb00b('0x20')](handleError(_0x4846c9));};exports[_0xb00b('0x41')]=function(_0x5a3b85,_0x5d52a5){logger['info'](_0xb00b('0x42'),_0x5d52a5[_0xb00b('0x2d')]);var _0x4129ba=callsValidation['validate'](_0x5a3b85[_0xb00b('0x2d')]);if(_0x4129ba[_0xb00b('0x27')]>0x0){return _0x5d52a5[_0xb00b('0x18')](0x190)['json'](_0x4129ba);}var _0x24e826=_0x5a3b85[_0xb00b('0x2d')][_0xb00b('0x2e')];var _0x385029=respondWithRpcPromise(_0xb00b('0x22'));var _0x279467=getAgent(_0x24e826);return Promise[_0xb00b('0x43')]([_0x385029,_0x279467])[_0xb00b('0x23')](function(_0x4c3067){var _0x153551=_0x4c3067[0x0];var _0x2cbe80=_0x4c3067[0x1];var _0x1b4860=_['filter'](_0x153551[_0xb00b('0x24')],function(_0x24a8a2){return _0x24a8a2[_0xb00b('0x25')]==_0x2cbe80['id'];});return _0x5d52a5[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'count':_0x1b4860['length'],'rows':_0x1b4860});})[_0xb00b('0x20')](handleError(_0x5d52a5));};exports[_0xb00b('0x44')]=function(_0x2e3c56,_0x1cad79){logger['info'](_0xb00b('0x45'),_0x2e3c56[_0xb00b('0x2d')]);var _0x2c93db=conferenceValidation[_0xb00b('0xb')](_0x2e3c56[_0xb00b('0x2d')]);if(_0x2c93db[_0xb00b('0x27')]>0x0){return _0x1cad79[_0xb00b('0x18')](0x190)['json'](_0x2c93db);}var _0x2b090a=_0x2e3c56['body'][_0xb00b('0x2e')];return getAgent(_0x2b090a)['then'](function(_0x3b3272){logger['info'](_0xb00b('0x31'),_0x3b3272['name']);emit(util[_0xb00b('0x32')](_0xb00b('0x33'),_0x3b3272[_0xb00b('0x17')]),'webbar:conference');return _0x1cad79['status'](0xc8)['json']({'error':![],'message':_0xb00b('0x46')});})[_0xb00b('0x20')](handleError(_0x1cad79));};exports[_0xb00b('0x47')]=function(_0x49246b,_0x311f49){logger[_0xb00b('0x12')](_0xb00b('0x48'),_0x49246b[_0xb00b('0x2d')]);var _0x1f4a96=transferValidation['validate'](_0x49246b[_0xb00b('0x2d')]);if(_0x1f4a96[_0xb00b('0x27')]>0x0){return _0x311f49['status'](0x190)[_0xb00b('0x2c')](_0x1f4a96);}var _0x36ac5a=_0x49246b[_0xb00b('0x2d')]['userId'];var _0x4e8b85=_0x49246b[_0xb00b('0x2d')][_0xb00b('0x26')];var _0x23762e=_0x49246b['body']['transferNumber'];return getAgent(_0x36ac5a)['then'](function(_0x5e9677){logger[_0xb00b('0x12')]('entityFound:',_0x5e9677[_0xb00b('0x17')]);emit(util[_0xb00b('0x32')]('user:%s',_0x5e9677[_0xb00b('0x17')]),_0xb00b('0x49'),{'sessionId':_0x4e8b85,'transferNumber':_0x23762e});return _0x311f49[_0xb00b('0x18')](0xc8)[_0xb00b('0x2c')]({'error':![],'message':_0xb00b('0x4a')});})['catch'](handleError(_0x311f49));};
\ No newline at end of file
index d2d85e1..48302bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4888=['/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','getApplications','addDisposition','post','addAnswer','addAgents','/:id/applications','addApplications','/:id/notify','notify','/:id/send','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4888,0x198));var _0x8488=function(_0x173f13,_0x4ea3cf){_0x173f13=_0x173f13-0x0;var _0x585942=_0x4888[_0x173f13];return _0x585942;};'use strict';var multer=require('multer');var util=require(_0x8488('0x0'));var path=require(_0x8488('0x1'));var timeout=require(_0x8488('0x2'));var express=require(_0x8488('0x3'));var router=express[_0x8488('0x4')]();var fs_extra=require(_0x8488('0x5'));var auth=require(_0x8488('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8488('0x7'));var controller=require(_0x8488('0x8'));router[_0x8488('0x9')]('/',auth[_0x8488('0xa')](),controller[_0x8488('0xb')]);router[_0x8488('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller['show']);router[_0x8488('0x9')](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0xe')]);router['get'](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x10')]);router[_0x8488('0x9')](_0x8488('0x11'),auth['isAuthenticated'](),controller[_0x8488('0x12')]);router[_0x8488('0x9')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8488('0x13')]);router['post']('/',auth[_0x8488('0xa')](),controller['create']);router['post'](_0x8488('0xd'),auth[_0x8488('0xa')](),controller[_0x8488('0x14')]);router[_0x8488('0x15')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x16')]);router['post'](_0x8488('0x11'),auth[_0x8488('0xa')](),controller[_0x8488('0x17')]);router[_0x8488('0x15')](_0x8488('0x18'),auth[_0x8488('0xa')](),controller[_0x8488('0x19')]);router[_0x8488('0x15')](_0x8488('0x1a'),controller[_0x8488('0x1b')]);router[_0x8488('0x15')](_0x8488('0x1c'),auth[_0x8488('0xa')](),controller['send']);router['put'](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1d')]);router[_0x8488('0x1e')](_0x8488('0xc'),auth[_0x8488('0xa')](),controller[_0x8488('0x1f')]);router[_0x8488('0x1e')](_0x8488('0xd'),auth['isAuthenticated'](),controller[_0x8488('0x20')]);router[_0x8488('0x1e')](_0x8488('0xf'),auth[_0x8488('0xa')](),controller[_0x8488('0x21')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x8488('0x22')]=router;
\ No newline at end of file
+var _0xd4a2=['../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','connect-timeout','Router'];(function(_0x2c079f,_0x48e2c5){var _0x3f5b2a=function(_0x261a47){while(--_0x261a47){_0x2c079f['push'](_0x2c079f['shift']());}};_0x3f5b2a(++_0x48e2c5);}(_0xd4a2,0x173));var _0x2d4a=function(_0x2c44f1,_0xfb4ebd){_0x2c44f1=_0x2c44f1-0x0;var _0x3b6a11=_0xd4a2[_0x2c44f1];return _0x3b6a11;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['get'](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x11')]);router[_0x2d4a('0x6')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x13')]);router[_0x2d4a('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d4a('0x14')]('/:id/dispositions',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x14')](_0x2d4a('0x16'),auth['isAuthenticated'](),controller[_0x2d4a('0x17')]);router['post'](_0x2d4a('0x10'),auth['isAuthenticated'](),controller[_0x2d4a('0x18')]);router[_0x2d4a('0x14')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2d4a('0x19')]);router[_0x2d4a('0x14')](_0x2d4a('0x1a'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1b')]);router[_0x2d4a('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x2d4a('0x1d')]);router[_0x2d4a('0x1e')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1f')]);router[_0x2d4a('0x1e')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller['removeDispositions']);router[_0x2d4a('0x1e')](_0x2d4a('0x16'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x20')]);router[_0x2d4a('0x1e')](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x21')]);module['exports']=router;
\ No newline at end of file
index 2bc84af..5fd93df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e64=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT'];(function(_0x438ca9,_0x4809b3){var _0x8912ad=function(_0x573aa8){while(--_0x573aa8){_0x438ca9['push'](_0x438ca9['shift']());}};_0x8912ad(++_0x4809b3);}(_0x9e64,0x1d2));var _0x49e6=function(_0x4373cc,_0x39c034){_0x4373cc=_0x4373cc-0x0;var _0x285030=_0x9e64[_0x4373cc];return _0x285030;};'use strict';var Sequelize=require(_0x49e6('0x0'));var rs=require(_0x49e6('0x1'));module[_0x49e6('0x2')]={'name':{'type':Sequelize[_0x49e6('0x3')],'unique':_0x49e6('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x49e6('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x49e6('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x49e6('0x3')],'defaultValue':function(){return rs[_0x49e6('0x5')]();}},'phone':{'type':Sequelize[_0x49e6('0x3')]},'type':{'type':Sequelize[_0x49e6('0x6')](_0x49e6('0x7'),_0x49e6('0x8'))},'accountSid':{'type':Sequelize[_0x49e6('0x3')]},'baseUrl':{'type':Sequelize[_0x49e6('0x3')]},'authToken':{'type':Sequelize[_0x49e6('0x3')]},'notificationTemplate':{'type':Sequelize[_0x49e6('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x49e6('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x49e6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49e6('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49e6('0xb')],'comment':_0x49e6('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x49e6('0xa')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2017ab){if(!_0x2017ab){this['setDataValue']('mandatoryDispositionPauseId',null);}this[_0x49e6('0xd')]('mandatoryDisposition',_0x2017ab);}},'description':{'type':Sequelize[_0x49e6('0x3')]}};
\ No newline at end of file
+var _0xd100=['name','generate','ENUM','sinch','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING'];(function(_0x2ee56d,_0x38826a){var _0x177a6b=function(_0x3ec98b){while(--_0x3ec98b){_0x2ee56d['push'](_0x2ee56d['shift']());}};_0x177a6b(++_0x38826a);}(_0xd100,0x1a5));var _0x0d10=function(_0x498911,_0x1cfe9c){_0x498911=_0x498911-0x0;var _0x21ce43=_0xd100[_0x498911];return _0x21ce43;};'use strict';var Sequelize=require(_0x0d10('0x0'));var rs=require(_0x0d10('0x1'));module[_0x0d10('0x2')]={'name':{'type':Sequelize[_0x0d10('0x3')],'unique':_0x0d10('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x0d10('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x0d10('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x0d10('0x3')],'defaultValue':function(){return rs[_0x0d10('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x0d10('0x6')]('twilio',_0x0d10('0x7'))},'accountSid':{'type':Sequelize[_0x0d10('0x3')]},'baseUrl':{'type':Sequelize[_0x0d10('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x0d10('0x8')],'defaultValue':function(){return _0x0d10('0x9');}},'notificationSound':{'type':Sequelize[_0x0d10('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0d10('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0d10('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0d10('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0d10('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0d10('0xb')],'comment':_0x0d10('0xc')},'mandatoryDisposition':{'type':Sequelize[_0x0d10('0xa')],'defaultValue':![],'comment':_0x0d10('0xd'),'set':function(_0x25d42c){if(!_0x25d42c){this[_0x0d10('0xe')](_0x0d10('0xf'),null);}this['setDataValue'](_0x0d10('0x10'),_0x25d42c);}},'description':{'type':Sequelize[_0x0d10('0x3')]}};
\ No newline at end of file
index 011d2eb..21c2bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x306f=['ids','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','message_id','applications','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','messageId','MessageSid','notifications','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','ListId','Contacts','DESC','list','contact','WhatsappInteraction','interaction','autoclose','close','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','CmList','List','Messages','dataValues','push','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','destroy','UserProfileResource','stack','name','send','index','map','WhatsappAccount','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','pick','filters','merge','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','create','body','user','get','role','WhatsappAccounts','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','mandatoryDispositionPause','describe','WhatsappAccountId','Disposition','getDispositions','findOne','sort','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x306f,0x1df));var _0xf306=function(_0x517c2e,_0x3d4bf3){_0x517c2e=_0x517c2e-0x0;var _0x5d4029=_0x306f[_0x517c2e];return _0x5d4029;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf306('0x0'));var jsonpatch=require(_0xf306('0x1'));var rp=require(_0xf306('0x2'));var moment=require(_0xf306('0x3'));var BPromise=require(_0xf306('0x4'));var Mustache=require(_0xf306('0x5'));var util=require('util');var path=require(_0xf306('0x6'));var sox=require(_0xf306('0x7'));var csv=require(_0xf306('0x8'));var ejs=require(_0xf306('0x9'));var fs=require('fs');var fs_extra=require(_0xf306('0xa'));var _=require(_0xf306('0xb'));var squel=require(_0xf306('0xc'));var crypto=require(_0xf306('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf306('0xe'));var toCsv=require(_0xf306('0x8'));var querystring=require(_0xf306('0xf'));var Papa=require(_0xf306('0x10'));var Redis=require(_0xf306('0x11'));var authService=require(_0xf306('0x12'));var qs=require(_0xf306('0x13'));var as=require(_0xf306('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf306('0x15'));var utils=require(_0xf306('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf306('0x17'));var db=require(_0xf306('0x18'))['db'];config['redis']=_[_0xf306('0x19')](config[_0xf306('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf306('0x1a')]));require(_0xf306('0x1b'))[_0xf306('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf306('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x45efc5,_0x4a39f1,_0x23a038,_0x3029c2){return new BPromise(function(_0x462987,_0x47b15a){var _0x3db68b=_0x3029c2||client;return _0x3db68b[_0xf306('0x1e')](_0x45efc5,_0x23a038)[_0xf306('0x1f')](function(_0x12d03b){logger[_0xf306('0x20')](_0xf306('0x21'),_0x4a39f1,_0xf306('0x22'));logger[_0xf306('0x23')](_0xf306('0x24'),_0x4a39f1,_0xf306('0x22'),JSON[_0xf306('0x25')](_0x12d03b));if(_0x12d03b[_0xf306('0x26')]){if(_0x12d03b[_0xf306('0x26')][_0xf306('0x27')]===0x1f4){logger['error'](_0xf306('0x21'),_0x4a39f1,_0x12d03b[_0xf306('0x26')][_0xf306('0x28')]);return _0x47b15a(_0x12d03b[_0xf306('0x26')][_0xf306('0x28')]);}logger[_0xf306('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4a39f1,_0x12d03b['error'][_0xf306('0x28')]);return _0x462987(_0x12d03b['error'][_0xf306('0x28')]);}else{logger[_0xf306('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x4a39f1,'request\x20sent');_0x462987(_0x12d03b[_0xf306('0x29')][_0xf306('0x28')]);}})[_0xf306('0x2a')](function(_0x48b833){logger[_0xf306('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x4a39f1,_0x48b833);_0x47b15a(_0x48b833);});});}function respondWithStatusCode(_0xfd7497,_0x3b22f6){_0x3b22f6=_0x3b22f6||0xcc;return function(_0x96045d){if(_0x96045d){return _0xfd7497[_0xf306('0x2b')](_0x3b22f6);}return _0xfd7497[_0xf306('0x2c')](_0x3b22f6)[_0xf306('0x2d')]();};}function respondWithResult(_0x24db1d,_0x262f73){_0x262f73=_0x262f73||0xc8;return function(_0x9eca5e){if(_0x9eca5e){return _0x24db1d[_0xf306('0x2c')](_0x262f73)[_0xf306('0x2e')](_0x9eca5e);}};}function respondWithFilteredResult(_0x4adf10,_0x58d0b7){return function(_0x31177e){if(_0x31177e){var _0x4ff39c=typeof _0x58d0b7[_0xf306('0x2f')]===_0xf306('0x30')&&typeof _0x58d0b7['limit']===_0xf306('0x30');var _0x360206=_0x31177e[_0xf306('0x31')];var _0x438089=_0x4ff39c?0x0:_0x58d0b7['offset'];var _0x529881=_0x4ff39c?_0x31177e[_0xf306('0x31')]:_0x58d0b7['offset']+_0x58d0b7['limit'];var _0x35c5b6;if(_0x529881>=_0x360206){_0x529881=_0x360206;_0x35c5b6=0xc8;}else{_0x35c5b6=0xce;}_0x4adf10['status'](_0x35c5b6);return _0x4adf10[_0xf306('0x32')]('Content-Range',_0x438089+'-'+_0x529881+'/'+_0x360206)[_0xf306('0x2e')](_0x31177e);}return null;};}function patchUpdates(_0xa15074){return function(_0x5dc32d){try{jsonpatch[_0xf306('0x33')](_0x5dc32d,_0xa15074,!![]);}catch(_0x372351){return BPromise[_0xf306('0x34')](_0x372351);}return _0x5dc32d[_0xf306('0x35')]();};}function saveUpdates(_0x6e4f0d,_0x14b61e){return function(_0x545f63){if(_0x545f63){return _0x545f63['update'](_0x6e4f0d)[_0xf306('0x1f')](function(_0x626d1d){return _0x626d1d;});}return null;};}function removeEntity(_0x230248,_0x2c7027){return function(_0x10bc7b){if(_0x10bc7b){return _0x10bc7b[_0xf306('0x36')]()[_0xf306('0x1f')](function(){var _0x3368e4=_0x10bc7b['get']({'plain':!![]});var _0xea0048='WhatsappAccounts';return db[_0xf306('0x37')][_0xf306('0x36')]({'where':{'type':_0xea0048,'resourceId':_0x3368e4['id']}})[_0xf306('0x1f')](function(){return _0x10bc7b;});})['then'](function(){_0x230248[_0xf306('0x2c')](0xcc)[_0xf306('0x2d')]();});}};}function handleEntityNotFound(_0x4aae72,_0xec43ff){return function(_0x56f53f){if(!_0x56f53f){_0x4aae72[_0xf306('0x2b')](0x194);}return _0x56f53f;};}function handleError(_0x344b22,_0x2efd00){_0x2efd00=_0x2efd00||0x1f4;return function(_0x4b1b40){logger[_0xf306('0x26')](_0x4b1b40[_0xf306('0x38')]);if(_0x4b1b40[_0xf306('0x39')]){delete _0x4b1b40[_0xf306('0x39')];}_0x344b22[_0xf306('0x2c')](_0x2efd00)[_0xf306('0x3a')](_0x4b1b40);};}exports[_0xf306('0x3b')]=function(_0x3d66ca,_0x407639){var _0x2e8cd9={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x44bd43={},_0x5d1fac={'count':0x0,'rows':[]};var _0x3bf096=_[_0xf306('0x3c')](db[_0xf306('0x3d')]['rawAttributes'],function(_0x33abf1){return{'name':_0x33abf1[_0xf306('0x3e')],'type':_0x33abf1[_0xf306('0x3f')]['key']};});_0x44bd43[_0xf306('0x40')]=_[_0xf306('0x3c')](_0x3bf096,'name');_0x44bd43[_0xf306('0x41')]=_[_0xf306('0x42')](_0x3d66ca[_0xf306('0x41')]);_0x44bd43['filters']=_[_0xf306('0x43')](_0x44bd43[_0xf306('0x40')],_0x44bd43[_0xf306('0x41')]);_0x2e8cd9['attributes']=_['intersection'](_0x44bd43['model'],qs['fields'](_0x3d66ca[_0xf306('0x41')][_0xf306('0x44')]));_0x2e8cd9[_0xf306('0x45')]=_0x2e8cd9[_0xf306('0x45')][_0xf306('0x46')]?_0x2e8cd9[_0xf306('0x45')]:_0x44bd43[_0xf306('0x40')];if(!_0x3d66ca[_0xf306('0x41')][_0xf306('0x47')](_0xf306('0x48'))){_0x2e8cd9[_0xf306('0x49')]=qs[_0xf306('0x49')](_0x3d66ca[_0xf306('0x41')][_0xf306('0x49')]);_0x2e8cd9[_0xf306('0x2f')]=qs[_0xf306('0x2f')](_0x3d66ca['query'][_0xf306('0x2f')]);}_0x2e8cd9[_0xf306('0x4a')]=qs['sort'](_0x3d66ca[_0xf306('0x41')]['sort']);_0x2e8cd9[_0xf306('0x4b')]=qs['filters'](_[_0xf306('0x4c')](_0x3d66ca['query'],_0x44bd43[_0xf306('0x4d')]),_0x3bf096);if(_0x3d66ca[_0xf306('0x41')]['filter']){_0x2e8cd9[_0xf306('0x4b')]=_[_0xf306('0x4e')](_0x2e8cd9['where'],{'$or':_[_0xf306('0x3c')](_0x3bf096,function(_0x3b985d){if(_0x3b985d[_0xf306('0x3f')]!=='VIRTUAL'){var _0x26d510={};_0x26d510[_0x3b985d['name']]={'$like':'%'+_0x3d66ca['query'][_0xf306('0x4f')]+'%'};return _0x26d510;}})});}_0x2e8cd9=_[_0xf306('0x4e')]({},_0x2e8cd9,_0x3d66ca[_0xf306('0x50')]);var _0x39d573={'where':_0x2e8cd9[_0xf306('0x4b')]};return db[_0xf306('0x3d')]['count'](_0x39d573)[_0xf306('0x1f')](function(_0x53cb6b){_0x5d1fac['count']=_0x53cb6b;if(_0x3d66ca[_0xf306('0x41')][_0xf306('0x51')]){_0x2e8cd9['include']=[{'all':!![]}];}return db[_0xf306('0x3d')][_0xf306('0x52')](_0x2e8cd9);})[_0xf306('0x1f')](function(_0xce91fb){_0x5d1fac[_0xf306('0x53')]=_0xce91fb;return _0x5d1fac;})[_0xf306('0x1f')](respondWithFilteredResult(_0x407639,_0x2e8cd9))[_0xf306('0x2a')](handleError(_0x407639,null));};exports[_0xf306('0x54')]=function(_0x8fc1b8,_0x90cb11){var _0x3cea41={'raw':![],'where':{'id':_0x8fc1b8[_0xf306('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2128f1={};_0x2128f1['model']=_[_0xf306('0x42')](db[_0xf306('0x3d')][_0xf306('0x56')]);_0x2128f1['query']=_['keys'](_0x8fc1b8[_0xf306('0x41')]);_0x2128f1['filters']=_[_0xf306('0x43')](_0x2128f1[_0xf306('0x40')],_0x2128f1[_0xf306('0x41')]);_0x3cea41[_0xf306('0x45')]=_[_0xf306('0x43')](_0x2128f1[_0xf306('0x40')],qs[_0xf306('0x44')](_0x8fc1b8[_0xf306('0x41')][_0xf306('0x44')]));_0x3cea41[_0xf306('0x45')]=_0x3cea41[_0xf306('0x45')][_0xf306('0x46')]?_0x3cea41[_0xf306('0x45')]:_0x2128f1[_0xf306('0x40')];if(_0x8fc1b8['query'][_0xf306('0x51')]){_0x3cea41[_0xf306('0x57')]=[{'all':!![]}];}_0x3cea41=_[_0xf306('0x4e')]({},_0x3cea41,_0x8fc1b8[_0xf306('0x50')]);return db[_0xf306('0x3d')]['find'](_0x3cea41)['then'](handleEntityNotFound(_0x90cb11,null))[_0xf306('0x1f')](respondWithResult(_0x90cb11,null))[_0xf306('0x2a')](handleError(_0x90cb11,null));};exports[_0xf306('0x58')]=function(_0x309f86,_0x29eb3c){return db[_0xf306('0x3d')]['create'](_0x309f86[_0xf306('0x59')],{})[_0xf306('0x1f')](function(_0x1a09da){var _0x2a541f=_0x309f86[_0xf306('0x5a')][_0xf306('0x5b')]({'plain':!![]});if(!_0x2a541f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a541f[_0xf306('0x5c')]===_0xf306('0x5a')){var _0x3e2705=_0x1a09da[_0xf306('0x5b')]({'plain':!![]});var _0x525d88=_0xf306('0x5d');return db['UserProfileSection'][_0xf306('0x5e')]({'where':{'name':_0x525d88,'userProfileId':_0x2a541f[_0xf306('0x5f')]},'raw':!![]})['then'](function(_0x1e3507){if(_0x1e3507&&_0x1e3507[_0xf306('0x60')]===0x0){return db['UserProfileResource'][_0xf306('0x58')]({'name':_0x3e2705[_0xf306('0x39')],'resourceId':_0x3e2705['id'],'type':_0x1e3507[_0xf306('0x39')],'sectionId':_0x1e3507['id']},{})['then'](function(){return _0x1a09da;});}else{return _0x1a09da;}})[_0xf306('0x2a')](function(_0x5eed0b){logger[_0xf306('0x26')](_0xf306('0x61'),_0x5eed0b);throw _0x5eed0b;});}return _0x1a09da;})[_0xf306('0x1f')](respondWithResult(_0x29eb3c,0xc9))['catch'](handleError(_0x29eb3c,null));};exports[_0xf306('0x62')]=function(_0x3135bc,_0x49b799){if(_0x3135bc['body']['id']){delete _0x3135bc[_0xf306('0x59')]['id'];}return db[_0xf306('0x3d')]['find']({'where':{'id':_0x3135bc['params']['id']},'include':[{'model':db[_0xf306('0x63')],'as':_0xf306('0x64')}]})[_0xf306('0x1f')](handleEntityNotFound(_0x49b799,null))['then'](saveUpdates(_0x3135bc['body'],null))[_0xf306('0x1f')](respondWithResult(_0x49b799,null))[_0xf306('0x2a')](handleError(_0x49b799,null));};exports[_0xf306('0x36')]=function(_0x266a3a,_0x3819ca){return db[_0xf306('0x3d')][_0xf306('0x5e')]({'where':{'id':_0x266a3a['params']['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x3819ca,null))[_0xf306('0x1f')](removeEntity(_0x3819ca,null))['catch'](handleError(_0x3819ca,null));};exports[_0xf306('0x65')]=function(_0x3d6155,_0x2f2ffa){return db[_0xf306('0x3d')][_0xf306('0x65')]()['then'](respondWithResult(_0x2f2ffa,null))['catch'](handleError(_0x2f2ffa,null));};exports['addDisposition']=function(_0x46d734,_0xb0e6f4,_0x5397dd){if(_0x46d734['body']['id']){delete _0x46d734[_0xf306('0x59')]['id'];}return db[_0xf306('0x3d')][_0xf306('0x5e')]({'where':{'id':_0x46d734[_0xf306('0x55')]['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0xb0e6f4,null))['then'](function(_0x28dc6e){if(_0x28dc6e){_0x46d734['body'][_0xf306('0x66')]=_0x28dc6e['id'];return db[_0xf306('0x67')][_0xf306('0x58')](_0x46d734[_0xf306('0x59')]);}})[_0xf306('0x1f')](respondWithResult(_0xb0e6f4,null))[_0xf306('0x2a')](handleError(_0xb0e6f4,null));};exports[_0xf306('0x68')]=function(_0x2bc18d,_0x554cd3,_0x468b06){var _0x3644c5={'raw':![],'where':{}};var _0x35d5d3={};var _0x3f400f={'count':0x0,'rows':[]};return db[_0xf306('0x3d')][_0xf306('0x69')]({'where':{'id':_0x2bc18d[_0xf306('0x55')]['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x554cd3,null))['then'](function(_0x445fa5){if(_0x445fa5){_0x35d5d3[_0xf306('0x40')]=_[_0xf306('0x42')](db['Disposition'][_0xf306('0x56')]);_0x35d5d3[_0xf306('0x41')]=_['keys'](_0x2bc18d[_0xf306('0x41')]);_0x35d5d3[_0xf306('0x4d')]=_['intersection'](_0x35d5d3[_0xf306('0x40')],_0x35d5d3[_0xf306('0x41')]);_0x3644c5[_0xf306('0x45')]=_[_0xf306('0x43')](_0x35d5d3[_0xf306('0x40')],qs[_0xf306('0x44')](_0x2bc18d[_0xf306('0x41')][_0xf306('0x44')]));_0x3644c5[_0xf306('0x45')]=_0x3644c5['attributes'][_0xf306('0x46')]?_0x3644c5[_0xf306('0x45')]:_0x35d5d3[_0xf306('0x40')];if(!_0x2bc18d[_0xf306('0x41')]['hasOwnProperty']('nolimit')){_0x3644c5[_0xf306('0x49')]=qs[_0xf306('0x49')](_0x2bc18d['query']['limit']);_0x3644c5[_0xf306('0x2f')]=qs[_0xf306('0x2f')](_0x2bc18d['query'][_0xf306('0x2f')]);}_0x3644c5[_0xf306('0x4a')]=qs[_0xf306('0x6a')](_0x2bc18d[_0xf306('0x41')]['sort']);_0x3644c5[_0xf306('0x4b')]=qs[_0xf306('0x4d')](_[_0xf306('0x4c')](_0x2bc18d[_0xf306('0x41')],_0x35d5d3[_0xf306('0x4d')]));_0x3644c5[_0xf306('0x4b')]['WhatsappAccountId']=_0x445fa5['id'];if(_0x2bc18d[_0xf306('0x41')][_0xf306('0x4f')]){_0x3644c5[_0xf306('0x4b')]=_[_0xf306('0x4e')](_0x3644c5[_0xf306('0x4b')],{'$or':_[_0xf306('0x3c')](_0x3644c5[_0xf306('0x45')],function(_0x19a1e3){var _0x564758={};_0x564758[_0x19a1e3]={'$like':'%'+_0x2bc18d[_0xf306('0x41')][_0xf306('0x4f')]+'%'};return _0x564758;})});}_0x3644c5=_['merge']({},_0x3644c5,_0x2bc18d[_0xf306('0x50')]);return db[_0xf306('0x67')][_0xf306('0x31')]({'where':_0x3644c5['where']})['then'](function(_0x301241){_0x3f400f['count']=_0x301241;if(_0x2bc18d[_0xf306('0x41')][_0xf306('0x51')]){_0x3644c5[_0xf306('0x57')]=[{'all':!![]}];}return db[_0xf306('0x67')][_0xf306('0x52')](_0x3644c5);})[_0xf306('0x1f')](function(_0x3ff591){_0x3f400f[_0xf306('0x53')]=_0x3ff591;return _0x3f400f;});}})[_0xf306('0x1f')](respondWithFilteredResult(_0x554cd3,_0x3644c5))[_0xf306('0x2a')](handleError(_0x554cd3,null));};exports[_0xf306('0x6b')]=function(_0x11fc14,_0x29a9e1,_0x5c2d80){return db['WhatsappAccount']['find']({'where':{'id':_0x11fc14[_0xf306('0x55')]['id']}})['then'](handleEntityNotFound(_0x29a9e1,null))['then'](function(_0x4453d5){if(_0x4453d5){return _0x4453d5[_0xf306('0x6b')](_0x11fc14[_0xf306('0x41')]['ids']);}})[_0xf306('0x1f')](respondWithStatusCode(_0x29a9e1,null))[_0xf306('0x2a')](handleError(_0x29a9e1,null));};exports[_0xf306('0x6c')]=function(_0x18cf07,_0x3a721f,_0xd411ca){if(_0x18cf07[_0xf306('0x59')]['id']){delete _0x18cf07[_0xf306('0x59')]['id'];}return db['WhatsappAccount'][_0xf306('0x5e')]({'where':{'id':_0x18cf07['params']['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x3a721f,null))[_0xf306('0x1f')](function(_0xae070){if(_0xae070){_0x18cf07[_0xf306('0x59')][_0xf306('0x66')]=_0xae070['id'];return db[_0xf306('0x6d')][_0xf306('0x58')](_0x18cf07[_0xf306('0x59')]);}})[_0xf306('0x1f')](respondWithResult(_0x3a721f,null))['catch'](handleError(_0x3a721f,null));};exports[_0xf306('0x6e')]=function(_0x278565,_0x3422e1,_0x4ad3b7){var _0x29d781={'raw':![],'where':{}};var _0x2bd2e6={};var _0x85aba5={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x278565['params']['id']}})['then'](handleEntityNotFound(_0x3422e1,null))[_0xf306('0x1f')](function(_0x5839a3){if(_0x5839a3){_0x2bd2e6['model']=_[_0xf306('0x42')](db[_0xf306('0x6d')][_0xf306('0x56')]);_0x2bd2e6['query']=_[_0xf306('0x42')](_0x278565[_0xf306('0x41')]);_0x2bd2e6[_0xf306('0x4d')]=_[_0xf306('0x43')](_0x2bd2e6[_0xf306('0x40')],_0x2bd2e6[_0xf306('0x41')]);_0x29d781[_0xf306('0x45')]=_[_0xf306('0x43')](_0x2bd2e6[_0xf306('0x40')],qs['fields'](_0x278565[_0xf306('0x41')][_0xf306('0x44')]));_0x29d781['attributes']=_0x29d781[_0xf306('0x45')][_0xf306('0x46')]?_0x29d781[_0xf306('0x45')]:_0x2bd2e6[_0xf306('0x40')];if(!_0x278565[_0xf306('0x41')][_0xf306('0x47')]('nolimit')){_0x29d781[_0xf306('0x49')]=qs[_0xf306('0x49')](_0x278565[_0xf306('0x41')]['limit']);_0x29d781[_0xf306('0x2f')]=qs[_0xf306('0x2f')](_0x278565[_0xf306('0x41')][_0xf306('0x2f')]);}_0x29d781['order']=qs['sort'](_0x278565[_0xf306('0x41')][_0xf306('0x6a')]);_0x29d781[_0xf306('0x4b')]=qs[_0xf306('0x4d')](_[_0xf306('0x4c')](_0x278565['query'],_0x2bd2e6[_0xf306('0x4d')]));_0x29d781[_0xf306('0x4b')]['WhatsappAccountId']=_0x5839a3['id'];if(_0x278565[_0xf306('0x41')]['filter']){_0x29d781[_0xf306('0x4b')]=_['merge'](_0x29d781[_0xf306('0x4b')],{'$or':_[_0xf306('0x3c')](_0x29d781[_0xf306('0x45')],function(_0x27203a){var _0x219b68={};_0x219b68[_0x27203a]={'$like':'%'+_0x278565['query'][_0xf306('0x4f')]+'%'};return _0x219b68;})});}_0x29d781=_[_0xf306('0x4e')]({},_0x29d781,_0x278565['options']);return db[_0xf306('0x6d')][_0xf306('0x31')]({'where':_0x29d781['where']})['then'](function(_0x38100e){_0x85aba5['count']=_0x38100e;if(_0x278565['query']['includeAll']){_0x29d781[_0xf306('0x57')]=[{'all':!![]}];}return db[_0xf306('0x6d')][_0xf306('0x52')](_0x29d781);})[_0xf306('0x1f')](function(_0x15e417){_0x85aba5[_0xf306('0x53')]=_0x15e417;return _0x85aba5;});}})[_0xf306('0x1f')](respondWithFilteredResult(_0x3422e1,_0x29d781))[_0xf306('0x2a')](handleError(_0x3422e1,null));};exports[_0xf306('0x6f')]=function(_0x525ff2,_0x104f7f,_0x763074){return db['WhatsappAccount'][_0xf306('0x5e')]({'where':{'id':_0x525ff2[_0xf306('0x55')]['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x104f7f,null))[_0xf306('0x1f')](function(_0x34c439){if(_0x34c439){return _0x34c439[_0xf306('0x6f')](_0x525ff2[_0xf306('0x41')][_0xf306('0x70')]);}})[_0xf306('0x1f')](respondWithStatusCode(_0x104f7f,null))['catch'](handleError(_0x104f7f,null));};exports[_0xf306('0x71')]=function(_0xa429b0,_0x1e2636,_0xcc42e){return db[_0xf306('0x3d')][_0xf306('0x5e')]({'where':{'id':_0xa429b0[_0xf306('0x55')]['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x1e2636,null))[_0xf306('0x1f')](function(_0xbec0bd){if(_0xbec0bd){return _0xbec0bd[_0xf306('0x71')](_0xa429b0['body'][_0xf306('0x70')],_[_0xf306('0x72')](_0xa429b0[_0xf306('0x59')],['ids','id'])||{})[_0xf306('0x73')](function(_0x24a856){for(var _0x3dcce4=0x0;_0x3dcce4<_0xa429b0['body'][_0xf306('0x70')][_0xf306('0x46')];_0x3dcce4+=0x1){socket[_0xf306('0x74')](_0xf306('0x75'),{'UserId':Number(_0xa429b0[_0xf306('0x59')][_0xf306('0x70')][_0x3dcce4]),'WhatsappAccountId':Number(_0xa429b0['params']['id'])});}return _0x24a856;});}})[_0xf306('0x1f')](respondWithResult(_0x1e2636,null))[_0xf306('0x2a')](handleError(_0x1e2636,null));};exports[_0xf306('0x76')]=function(_0x58b111,_0x4cd648,_0x48aad6){return db['WhatsappAccount']['find']({'where':{'id':_0x58b111[_0xf306('0x55')]['id']}})['then'](handleEntityNotFound(_0x4cd648,null))['then'](function(_0x2975b7){if(_0x2975b7){return _0x2975b7['removeAgents'](_0x58b111[_0xf306('0x41')]['ids'])[_0xf306('0x1f')](function(){if(_[_0xf306('0x77')](_0x58b111['query'][_0xf306('0x70')])){for(var _0x124da6=0x0;_0x124da6<_0x58b111[_0xf306('0x41')]['ids'][_0xf306('0x46')];_0x124da6+=0x1){socket[_0xf306('0x74')](_0xf306('0x78'),{'UserId':Number(_0x58b111[_0xf306('0x41')][_0xf306('0x70')][_0x124da6]),'WhatsappAccountId':Number(_0x58b111[_0xf306('0x55')]['id'])});}}else{socket[_0xf306('0x74')](_0xf306('0x78'),{'UserId':Number(_0x58b111[_0xf306('0x41')][_0xf306('0x70')]),'WhatsappAccountId':Number(_0x58b111['params']['id'])});}});}})[_0xf306('0x1f')](respondWithStatusCode(_0x4cd648,null))[_0xf306('0x2a')](handleError(_0x4cd648,null));};exports[_0xf306('0x79')]=function(_0x1a122d,_0x42dc0a,_0x33c467){var _0x356e97={};var _0x44912f={};var _0x4f8348;var _0x1e258f;return db[_0xf306('0x3d')][_0xf306('0x69')]({'where':{'id':_0x1a122d['params']['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x42dc0a,null))[_0xf306('0x1f')](function(_0xe8b9cd){if(_0xe8b9cd){_0x4f8348=_0xe8b9cd;_0x44912f[_0xf306('0x40')]=_[_0xf306('0x42')](db[_0xf306('0x7a')][_0xf306('0x56')]);_0x44912f[_0xf306('0x41')]=_['keys'](_0x1a122d['query']);_0x44912f[_0xf306('0x4d')]=_[_0xf306('0x43')](_0x44912f[_0xf306('0x40')],_0x44912f[_0xf306('0x41')]);_0x356e97['attributes']=_[_0xf306('0x43')](_0x44912f[_0xf306('0x40')],qs[_0xf306('0x44')](_0x1a122d[_0xf306('0x41')][_0xf306('0x44')]));_0x356e97[_0xf306('0x45')]=_0x356e97[_0xf306('0x45')][_0xf306('0x46')]?_0x356e97[_0xf306('0x45')]:_0x44912f[_0xf306('0x40')];_0x356e97[_0xf306('0x4a')]=qs[_0xf306('0x6a')](_0x1a122d[_0xf306('0x41')]['sort']);_0x356e97[_0xf306('0x4b')]=qs[_0xf306('0x4d')](_[_0xf306('0x4c')](_0x1a122d[_0xf306('0x41')],_0x44912f[_0xf306('0x4d')]));if(_0x1a122d[_0xf306('0x41')][_0xf306('0x4f')]){_0x356e97[_0xf306('0x4b')]=_[_0xf306('0x4e')](_0x356e97[_0xf306('0x4b')],{'$or':_[_0xf306('0x3c')](_0x356e97[_0xf306('0x45')],function(_0x153956){var _0x2be1ad={};_0x2be1ad[_0x153956]={'$like':'%'+_0x1a122d[_0xf306('0x41')][_0xf306('0x4f')]+'%'};return _0x2be1ad;})});}_0x356e97=_[_0xf306('0x4e')]({},_0x356e97,_0x1a122d[_0xf306('0x50')]);return _0x4f8348[_0xf306('0x79')](_0x356e97);}})[_0xf306('0x1f')](function(_0x5d96df){if(_0x5d96df){_0x1e258f=_0x5d96df[_0xf306('0x46')];if(!_0x1a122d['query'][_0xf306('0x47')](_0xf306('0x48'))){_0x356e97[_0xf306('0x49')]=qs[_0xf306('0x49')](_0x1a122d[_0xf306('0x41')][_0xf306('0x49')]);_0x356e97[_0xf306('0x2f')]=qs['offset'](_0x1a122d[_0xf306('0x41')]['offset']);}return _0x4f8348[_0xf306('0x79')](_0x356e97);}})[_0xf306('0x1f')](function(_0x3fd6c6){if(_0x3fd6c6){return _0x3fd6c6?{'count':_0x1e258f,'rows':_0x3fd6c6}:null;}})[_0xf306('0x1f')](respondWithResult(_0x42dc0a,null))[_0xf306('0x2a')](handleError(_0x42dc0a,null));};exports[_0xf306('0x7b')]=function(_0x36d98e,_0x1f205c){var _0x2d64f2=_0x36d98e[_0xf306('0x55')]['id'];var _0x318fa4=_0x36d98e[_0xf306('0x59')];var _0x222b05=0xc8;var _0x2f7b33=null;return db[_0xf306('0x7c')]['transaction']({'isolationLevel':db['sequelize'][_0xf306('0x7d')][_0xf306('0x7e')][_0xf306('0x7f')]},function(_0x177485){return db[_0xf306('0x3d')][_0xf306('0x69')]({'where':{'id':_0x2d64f2},'transaction':_0x177485})[_0xf306('0x1f')](function(_0xc9d6ab){if(_0xc9d6ab){return db[_0xf306('0x80')][_0xf306('0x36')]({'where':{'WhatsappAccountId':_0x2d64f2},'transaction':_0x177485})[_0xf306('0x1f')](function(){var _0x408458=_['map'](_0x318fa4,function(_0x407efb){_0x407efb[_0xf306('0x66')]=_0x2d64f2;return _0x407efb;});return db[_0xf306('0x80')][_0xf306('0x81')](_0x408458,{'transaction':_0x177485});});}else{_0x222b05=0x194;_0x2f7b33=[];}});})['then'](function(){if(_0x222b05!==0x194){return db[_0xf306('0x80')][_0xf306('0x82')]({'where':{'WhatsappAccountId':_0x2d64f2},'order':_0xf306('0x83')})[_0xf306('0x1f')](function(_0xb24522){_0x2f7b33=_0xb24522;});}})[_0xf306('0x2a')](function(_0x2b7cc6){_0x222b05=0x1f4;logger['error'](_0x2b7cc6[_0xf306('0x38')]);if(_0x2b7cc6[_0xf306('0x39')]){delete _0x2b7cc6[_0xf306('0x39')];}_0x2f7b33=_0x2b7cc6;})['finally'](function(){if(_0x2f7b33===null){_0x1f205c[_0xf306('0x2b')](_0x222b05);}else{if(_0x222b05===0x1f4){_0x1f205c[_0xf306('0x2c')](_0x222b05)[_0xf306('0x3a')](_0x2f7b33);}else{_0x1f205c[_0xf306('0x2c')](_0x222b05)[_0xf306('0x2e')](_0x2f7b33);}}});};exports[_0xf306('0x84')]=function(_0x13fbde,_0x2b62ae,_0x44b896){var _0xbf16fd={};var _0x16c056={};var _0x54377f;var _0x5c27ed;return db[_0xf306('0x3d')]['findOne']({'where':{'id':_0x13fbde[_0xf306('0x55')]['id']}})[_0xf306('0x1f')](handleEntityNotFound(_0x2b62ae,null))['then'](function(_0x1ea779){if(_0x1ea779){_0x54377f=_0x1ea779;_0x16c056[_0xf306('0x40')]=_[_0xf306('0x42')](db[_0xf306('0x80')][_0xf306('0x56')]);_0x16c056[_0xf306('0x41')]=_[_0xf306('0x42')](_0x13fbde[_0xf306('0x41')]);_0x16c056[_0xf306('0x4d')]=_[_0xf306('0x43')](_0x16c056[_0xf306('0x40')],_0x16c056[_0xf306('0x41')]);_0xbf16fd[_0xf306('0x45')]=_[_0xf306('0x43')](_0x16c056[_0xf306('0x40')],qs[_0xf306('0x44')](_0x13fbde[_0xf306('0x41')][_0xf306('0x44')]));_0xbf16fd[_0xf306('0x45')]=_0xbf16fd[_0xf306('0x45')][_0xf306('0x46')]?_0xbf16fd[_0xf306('0x45')]:_0x16c056[_0xf306('0x40')];_0xbf16fd['order']=qs[_0xf306('0x6a')](_0x13fbde['query'][_0xf306('0x6a')]);_0xbf16fd['where']=qs['filters'](_[_0xf306('0x4c')](_0x13fbde[_0xf306('0x41')],_0x16c056[_0xf306('0x4d')]));if(_0x13fbde[_0xf306('0x41')][_0xf306('0x4f')]){_0xbf16fd[_0xf306('0x4b')]=_[_0xf306('0x4e')](_0xbf16fd['where'],{'$or':_['map'](_0xbf16fd[_0xf306('0x45')],function(_0x1ef001){var _0x458a57={};_0x458a57[_0x1ef001]={'$like':'%'+_0x13fbde[_0xf306('0x41')]['filter']+'%'};return _0x458a57;})});}_0xbf16fd=_['merge']({},_0xbf16fd,_0x13fbde[_0xf306('0x50')]);return _0x54377f[_0xf306('0x84')](_0xbf16fd);}})[_0xf306('0x1f')](function(_0x14e57e){if(_0x14e57e){_0x5c27ed=_0x14e57e[_0xf306('0x46')];if(!_0x13fbde[_0xf306('0x41')][_0xf306('0x47')]('nolimit')){_0xbf16fd[_0xf306('0x49')]=qs['limit'](_0x13fbde[_0xf306('0x41')]['limit']);_0xbf16fd[_0xf306('0x2f')]=qs[_0xf306('0x2f')](_0x13fbde['query'][_0xf306('0x2f')]);}return _0x54377f[_0xf306('0x84')](_0xbf16fd);}})[_0xf306('0x1f')](function(_0xf9289f){if(_0xf9289f){return _0xf9289f?{'count':_0x5c27ed,'rows':_0xf9289f}:null;}})[_0xf306('0x1f')](respondWithResult(_0x2b62ae,null))[_0xf306('0x2a')](handleError(_0x2b62ae,null));};exports[_0xf306('0x85')]=function(_0x1d2207,_0x17c843,_0x496ddc){var _0x59e1d6={'channel':_0xf306('0x86')};var _0x5a4b4d=[];var _0x1446ae=[];var _0x576287={};return db[_0xf306('0x3d')][_0xf306('0x5e')]({'where':{'id':_0x1d2207[_0xf306('0x55')]['id']},'include':[{'model':db[_0xf306('0x80')],'as':_0xf306('0x87')}]})[_0xf306('0x1f')](handleEntityNotFound(_0x17c843,null))[_0xf306('0x1f')](function(_0x151241){_0x59e1d6[_0xf306('0x88')]=_0x151241;if(_0x59e1d6[_0xf306('0x88')]&&_0x59e1d6['account'][_0xf306('0x3f')]===_0xf306('0x89')&&_0x1d2207[_0xf306('0x59')]['statuses']){if(_0x1d2207[_0xf306('0x59')][_0xf306('0x8a')][_0xf306('0x46')]===0x0)return;if(_0x1d2207[_0xf306('0x59')][_0xf306('0x8a')][0x0]['state']!==_0xf306('0x8b'))return;return db[_0xf306('0x8c')]['update']({'read':!![],'readAt':_0x1d2207[_0xf306('0x59')][_0xf306('0x8a')][0x0]['timestamp']},{'where':{'messageId':_0x1d2207[_0xf306('0x59')][_0xf306('0x8a')][0x0][_0xf306('0x8d')]},'individualHooks':!![]})[_0xf306('0x1f')](function(_0x4a09eb){return _0x17c843[_0xf306('0x2c')](0xc8)[_0xf306('0x2e')](_0x4a09eb);});}_0x59e1d6[_0xf306('0x8e')]=_['orderBy'](_0x151241[_0xf306('0x87')],[_0xf306('0x83')],['asc']);if(_0x59e1d6[_0xf306('0x88')]['Applications']){delete _0x59e1d6[_0xf306('0x88')][_0xf306('0x87')];}return db[_0xf306('0x8f')][_0xf306('0x65')]()[_0xf306('0x1f')](function(_0x2c2f80){if(!_0x2c2f80){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))](_0xf306('0x92'));}_0x5a4b4d=_[_0xf306('0x93')](_[_0xf306('0x42')](_0x2c2f80),['createdAt',_0xf306('0x94')]);_0x1446ae=_[_0xf306('0x93')](_[_0xf306('0x42')](_0x2c2f80),[_0xf306('0x95'),_0xf306('0x94'),_0xf306('0x96'),'ListId']);_0x59e1d6['body']={'mapKey':_0xf306('0x97')};if(_0x59e1d6['account']&&_0x59e1d6[_0xf306('0x88')][_0xf306('0x3f')]===_0xf306('0x98')){_0x59e1d6[_0xf306('0x59')][_0xf306('0x99')]=_0x1d2207[_0xf306('0x59')][_0xf306('0x9a')][_0xf306('0x9b')](_0xf306('0x9c'),'');_0x59e1d6[_0xf306('0x59')][_0xf306('0x59')]=_0x1d2207[_0xf306('0x59')]['Body'];_0x59e1d6[_0xf306('0x59')][_0xf306('0x9d')]=_0x1d2207[_0xf306('0x59')][_0xf306('0x9e')];}if(_0x59e1d6[_0xf306('0x88')]&&_0x59e1d6[_0xf306('0x88')][_0xf306('0x3f')]===_0xf306('0x89')){_0x59e1d6[_0xf306('0x59')][_0xf306('0x99')]=_0x1d2207['body']['notifications'][0x0][_0xf306('0x99')];_0x59e1d6[_0xf306('0x59')][_0xf306('0x59')]=_0x1d2207[_0xf306('0x59')][_0xf306('0x9f')][0x0][_0xf306('0x28')][_0xf306('0x59')];_0x59e1d6[_0xf306('0x59')][_0xf306('0x9d')]=_0x1d2207[_0xf306('0x59')][_0xf306('0x9f')][0x0][_0xf306('0x8d')];}if(_0x59e1d6[_0xf306('0x59')]['id']){delete _0x59e1d6[_0xf306('0x59')]['id'];}if(_[_0xf306('0xa0')](_0x59e1d6[_0xf306('0x59')][_0xf306('0x99')])){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))](_0xf306('0xa1'));}if(_[_0xf306('0xa0')](_0x59e1d6['body'][_0xf306('0x59')])||_0x59e1d6[_0xf306('0x59')]['body']===''){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))](_0xf306('0xa2'));}if(_['isNil'](_0x59e1d6[_0xf306('0x59')][_0xf306('0xa3')])){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))](_0xf306('0xa4')+_0x1446ae);}if(!_[_0xf306('0xa5')](_0x1446ae,_0x59e1d6[_0xf306('0x59')][_0xf306('0xa3')])){throw new db['Sequelize'][(_0xf306('0x91'))](_0xf306('0xa6')+_0x1446ae);}_0x576287[_0x59e1d6['body']['mapKey']]=_0x59e1d6['body'][_0xf306('0x99')];return db['CmList']['find']({'where':{'id':_0x59e1d6[_0xf306('0x88')][_0xf306('0xa7')]},'include':[{'model':db[_0xf306('0x8f')],'as':_0xf306('0xa8'),'where':_0x576287,'limit':0x1,'order':[[_0xf306('0x94'),_0xf306('0xa9')]]}]});})[_0xf306('0x1f')](handleEntityNotFound(_0x17c843,null))[_0xf306('0x1f')](function(_0x598d12){if(_0x598d12){_0x59e1d6[_0xf306('0xaa')]=_[_0xf306('0x72')](_0x598d12,['Contacts']);if(_0x598d12[_0xf306('0xa8')]['length']){return _0x598d12[_0xf306('0xa8')][0x0];}var _0x27622d=_[_0xf306('0x19')](_0x59e1d6[_0xf306('0x59')],{'firstName':_0x59e1d6['body']['from'],'ListId':_0x598d12['id']});_0x27622d[_0x59e1d6[_0xf306('0x59')][_0xf306('0xa3')]]=_0x59e1d6['body'][_0xf306('0x99')];return db[_0xf306('0x8f')][_0xf306('0x58')](_0x27622d,{'fields':_0x5a4b4d,'raw':!![]});}})[_0xf306('0x1f')](handleEntityNotFound(_0x17c843,null))['then'](function(_0x3cfb70){if(_0x3cfb70){_0x59e1d6[_0xf306('0xab')]=_0x3cfb70;var _0x443d59={'ContactId':_0x3cfb70['id'],'phone':_0x59e1d6[_0xf306('0x59')][_0xf306('0x99')],'WhatsappAccountId':_0x1d2207[_0xf306('0x55')]['id']};var _0x1870d8={'ContactId':_0x3cfb70['id'],'WhatsappAccountId':_0x1d2207[_0xf306('0x55')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xf306('0x5e')]({'where':_0x1870d8})['then'](function(_0x4fa8aa){if(_0x4fa8aa){return[_0x4fa8aa,![]];}return db[_0xf306('0xac')][_0xf306('0x58')](_0x443d59)[_0xf306('0x1f')](function(_0x57581e){return[_0x57581e,!![]];});});}})[_0xf306('0x73')](function(_0x1d4db3,_0x1b594b){_0x59e1d6['interaction']=_0x1d4db3[_0xf306('0x5b')]({'plain':!![]});_0x59e1d6[_0xf306('0xad')]['created']=![];if(_0x1b594b){if(_0x59e1d6[_0xf306('0x88')][_0xf306('0xae')]){_0x59e1d6[_0xf306('0x8e')]['push']({'id':0x0,'priority':_0x59e1d6['applications'][_0xf306('0x46')]+0x1,'app':_0xf306('0xaf'),'appdata':_0xf306('0xb0'),'interval':_0xf306('0xb1')});}_0x59e1d6['interaction'][_0xf306('0xb2')]=!![];}return db[_0xf306('0x8c')]['create']({'phone':_0x59e1d6[_0xf306('0x59')]['from'],'messageId':_0x59e1d6[_0xf306('0x59')][_0xf306('0x9d')],'body':_0x59e1d6[_0xf306('0x59')][_0xf306('0x59')],'WhatsappAccountId':_0x1d2207[_0xf306('0x55')]['id'],'WhatsappInteractionId':_0x1d4db3['id'],'direction':'in','ContactId':_0x1d4db3[_0xf306('0xb3')],'AttachmentId':_0x59e1d6['body'][_0xf306('0xb4')]});})[_0xf306('0x1f')](function(_0x509843){_0x59e1d6[_0xf306('0x28')]=_0x509843;if(_0x59e1d6[_0xf306('0xad')][_0xf306('0xb5')]){return db[_0xf306('0x7a')][_0xf306('0x5e')]({'attributes':['id','name'],'where':{'id':_0x59e1d6['interaction'][_0xf306('0xb5')]}})['then'](function(_0x527dbe){if(_0x527dbe){_0x59e1d6[_0xf306('0x8e')][_0xf306('0xb6')]({'id':0x0,'priority':0x0,'app':_0xf306('0xb7'),'appdata':_0x527dbe['name']+','+(_0x59e1d6[_0xf306('0x88')][_0xf306('0xb8')]||0xa),'interval':_0xf306('0xb1')});}return respondWithRpcPromise('Start','startRouting',_0x59e1d6);});}return respondWithRpcPromise(_0xf306('0xb9'),_0xf306('0xba'),_0x59e1d6);})['then'](function(_0x4a2c23){if(_0x4a2c23){var _0x2368ca=0xc8;var _0x4af6d3=_0xf306('0xbb');logger[_0xf306('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4af6d3,_0x2368ca,'entity\x20found');logger[_0xf306('0x23')](_0xf306('0xbc'),_0x4af6d3,_0x2368ca,'entity\x20found',JSON[_0xf306('0x25')](_0x4a2c23));if(_0x59e1d6['account']['type']===_0xf306('0x98')){return _0x17c843['status'](_0x2368ca)['set'](_0xf306('0xbd'),_0xf306('0xbe'))[_0xf306('0x3a')](_0xf306('0xbf'));}else{return _0x17c843[_0xf306('0x2c')](_0x2368ca)[_0xf306('0x2e')](_0x4a2c23);}}});})[_0xf306('0x2a')](handleError(_0x17c843,null));};exports['send']=function(_0x4084cd,_0x2080b9,_0x5ca7f0){var _0x5c972b,_0x4c4ad9,_0x130b6a;if(_['isNil'](_0x4084cd[_0xf306('0x59')]['body'])||_0x4084cd['body'][_0xf306('0x59')]===''){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf306('0xa0')](_0x4084cd[_0xf306('0x59')]['to'])){throw new db[(_0xf306('0x90'))][(_0xf306('0x91'))]('to\x20is\x20mandatory');}_0x5c972b=_0x4084cd[_0xf306('0x59')]['to'];return db[_0xf306('0x3d')][_0xf306('0x5e')]({'where':{'id':_0x4084cd[_0xf306('0x55')]['id']},'include':[{'model':db[_0xf306('0xc0')],'as':'List','include':[{'model':db[_0xf306('0x8f')],'as':_0xf306('0xa8'),'where':{'mobile':_0x5c972b},'limit':0x1,'order':[[_0xf306('0x94'),_0xf306('0xa9')]]}]}]})[_0xf306('0x1f')](handleEntityNotFound(_0x2080b9,null))['then'](function(_0x1acbfb){if(_0x1acbfb&&_0x1acbfb['List']){_0x4c4ad9=_0x1acbfb[_0xf306('0x5b')]({'plain':!![]});if(_0x4c4ad9[_0xf306('0xc1')]&&_0x4c4ad9[_0xf306('0xc1')][_0xf306('0xa8')][_0xf306('0x46')]){return _0x4c4ad9['List'][_0xf306('0xa8')][0x0];}return db['CmContact']['create'](_[_0xf306('0x19')](_0x4084cd[_0xf306('0x59')],{'firstName':_0x5c972b,'mobile':_0x5c972b,'phone':_0x5c972b,'ListId':_0x4c4ad9[_0xf306('0xa7')]}));}})[_0xf306('0x1f')](handleEntityNotFound(_0x2080b9,null))['then'](function(_0x3ca610){if(_0x3ca610){_0x130b6a=_0x3ca610;return db['WhatsappInteraction'][_0xf306('0x5e')]({'where':{'ContactId':_0x130b6a['id'],'closed':![],'WhatsappAccountId':_0x4c4ad9['id']}})['then'](function(_0xaf1b2d){if(_0xaf1b2d){return[_0xaf1b2d,![]];}return db[_0xf306('0xac')][_0xf306('0x58')]({'UserId':_0x4084cd['user']['id'],'ContactId':_0x130b6a['id'],'WhatsappAccountId':_0x4c4ad9['id'],'phone':_0x5c972b,'firstMsgDirection':'out','Messages':[_[_0xf306('0x4e')](_0x4084cd[_0xf306('0x59')],{'read':![],'body':_0x4084cd[_0xf306('0x59')][_0xf306('0x59')],'phone':_0x5c972b,'WhatsappAccountId':_0x4c4ad9['id'],'UserId':_0x4084cd[_0xf306('0x5a')]['id'],'ContactId':_0x130b6a['id']})]},{'include':[{'model':db[_0xf306('0x8c')],'as':_0xf306('0xc2')}]})['then'](function(_0x1eb6ef){return[_0x1eb6ef,!![]];});});}})[_0xf306('0x73')](function(_0x24547b,_0xdf1182){if(_0xdf1182){return _0x24547b;}return db[_0xf306('0x8c')][_0xf306('0x58')](_[_0xf306('0x4e')](_0x4084cd[_0xf306('0x59')],{'read':![],'body':_0x4084cd[_0xf306('0x59')][_0xf306('0x59')],'phone':_0x5c972b,'WhatsappAccountId':_0x4c4ad9['id'],'WhatsappInteractionId':_0x24547b['id'],'UserId':_0x4084cd['user']['id'],'ContactId':_0x130b6a['id']}))[_0xf306('0x1f')](function(_0x12c662){_0x24547b[_0xf306('0xc3')][_0xf306('0xc2')]=[];_0x24547b[_0xf306('0xc3')][_0xf306('0xc2')][_0xf306('0xc4')](_0x12c662[_0xf306('0xc3')]);return _0x24547b;});})[_0xf306('0x1f')](respondWithResult(_0x2080b9,null))[_0xf306('0x2a')](handleError(_0x2080b9,null));};
\ No newline at end of file
+var _0x0690=['unshift','agent','Start','startRouting','receiveMessage','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','List','WhatsappInteraction','out','WhatsappMessage','dataValues','Messages','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','./whatsappAccount.socket','client','http','request','then','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','undefined','count','offset','limit','set','apply','reject','save','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappAccounts','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','order','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','addAgents','spread','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','sendStatus','getApplications','notify','whatsapp','account','statuses','read','message_id','applications','orderBy','Applications','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','twilio','from','From','replace','Body','messageId','MessageSid','sinch','notifications','isNil','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','interaction','created','autoclose','push','close','*,*,*,*','AttachmentId','UserId'];(function(_0x2fa626,_0x315b5b){var _0xabfe84=function(_0x5a409a){while(--_0x5a409a){_0x2fa626['push'](_0x2fa626['shift']());}};_0xabfe84(++_0x315b5b);}(_0x0690,0x18c));var _0x0069=function(_0x28a6c7,_0x1ab95e){_0x28a6c7=_0x28a6c7-0x0;var _0x1a2a7d=_0x0690[_0x28a6c7];return _0x1a2a7d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0069('0x0'));var zipdir=require(_0x0069('0x1'));var jsonpatch=require(_0x0069('0x2'));var rp=require(_0x0069('0x3'));var moment=require('moment');var BPromise=require(_0x0069('0x4'));var Mustache=require(_0x0069('0x5'));var util=require(_0x0069('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0069('0x7'));var ejs=require(_0x0069('0x8'));var fs=require('fs');var fs_extra=require(_0x0069('0x9'));var _=require(_0x0069('0xa'));var squel=require('squel');var crypto=require(_0x0069('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0069('0xc'));var toCsv=require(_0x0069('0x7'));var querystring=require('querystring');var Papa=require(_0x0069('0xd'));var Redis=require(_0x0069('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0069('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0069('0x10'));var logger=require('../../config/logger')(_0x0069('0x11'));var utils=require(_0x0069('0x12'));var config=require(_0x0069('0x13'));var licenseUtil=require(_0x0069('0x14'));var db=require(_0x0069('0x15'))['db'];config['redis']=_[_0x0069('0x16')](config['redis'],{'host':_0x0069('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0069('0x18'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x0069('0x19')][_0x0069('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x2e147a,_0x3712b3,_0x2287a1,_0x4480c2){return new BPromise(function(_0x3c7c7e,_0x440358){var _0x48909c=_0x4480c2||client;return _0x48909c[_0x0069('0x1b')](_0x2e147a,_0x2287a1)[_0x0069('0x1c')](function(_0x211ede){logger['info'](_0x0069('0x1d'),_0x3712b3,_0x0069('0x1e'));logger['debug'](_0x0069('0x1f'),_0x3712b3,_0x0069('0x1e'),JSON[_0x0069('0x20')](_0x211ede));if(_0x211ede[_0x0069('0x21')]){if(_0x211ede[_0x0069('0x21')][_0x0069('0x22')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3712b3,_0x211ede[_0x0069('0x21')]['message']);return _0x440358(_0x211ede['error'][_0x0069('0x23')]);}logger[_0x0069('0x21')](_0x0069('0x1d'),_0x3712b3,_0x211ede[_0x0069('0x21')][_0x0069('0x23')]);return _0x3c7c7e(_0x211ede[_0x0069('0x21')][_0x0069('0x23')]);}else{logger['info'](_0x0069('0x1d'),_0x3712b3,_0x0069('0x1e'));_0x3c7c7e(_0x211ede['result'][_0x0069('0x23')]);}})[_0x0069('0x24')](function(_0x34d57c){logger[_0x0069('0x21')](_0x0069('0x1d'),_0x3712b3,_0x34d57c);_0x440358(_0x34d57c);});});}function respondWithStatusCode(_0x19de70,_0x4bd8dd){_0x4bd8dd=_0x4bd8dd||0xcc;return function(_0x272ef7){if(_0x272ef7){return _0x19de70['sendStatus'](_0x4bd8dd);}return _0x19de70[_0x0069('0x25')](_0x4bd8dd)[_0x0069('0x26')]();};}function respondWithResult(_0x1d36bf,_0x392288){_0x392288=_0x392288||0xc8;return function(_0x24493f){if(_0x24493f){return _0x1d36bf[_0x0069('0x25')](_0x392288)[_0x0069('0x27')](_0x24493f);}};}function respondWithFilteredResult(_0x318048,_0x186022){return function(_0x58bd90){if(_0x58bd90){var _0x4c377a=typeof _0x186022['offset']===_0x0069('0x28')&&typeof _0x186022['limit']==='undefined';var _0x529d02=_0x58bd90[_0x0069('0x29')];var _0x5712f9=_0x4c377a?0x0:_0x186022[_0x0069('0x2a')];var _0x363682=_0x4c377a?_0x58bd90[_0x0069('0x29')]:_0x186022[_0x0069('0x2a')]+_0x186022[_0x0069('0x2b')];var _0x301a2c;if(_0x363682>=_0x529d02){_0x363682=_0x529d02;_0x301a2c=0xc8;}else{_0x301a2c=0xce;}_0x318048[_0x0069('0x25')](_0x301a2c);return _0x318048[_0x0069('0x2c')]('Content-Range',_0x5712f9+'-'+_0x363682+'/'+_0x529d02)['json'](_0x58bd90);}return null;};}function patchUpdates(_0xba27ba){return function(_0x38507c){try{jsonpatch[_0x0069('0x2d')](_0x38507c,_0xba27ba,!![]);}catch(_0x373a3a){return BPromise[_0x0069('0x2e')](_0x373a3a);}return _0x38507c[_0x0069('0x2f')]();};}function saveUpdates(_0x3b9ec7,_0x24b778){return function(_0x201047){if(_0x201047){return _0x201047['update'](_0x3b9ec7)[_0x0069('0x1c')](function(_0x4a4c05){return _0x4a4c05;});}return null;};}function removeEntity(_0x4528b2,_0x41c0c0){return function(_0x22517b){if(_0x22517b){return _0x22517b[_0x0069('0x30')]()[_0x0069('0x1c')](function(){var _0x30f121=_0x22517b[_0x0069('0x31')]({'plain':!![]});var _0x59dfea='WhatsappAccounts';return db[_0x0069('0x32')]['destroy']({'where':{'type':_0x59dfea,'resourceId':_0x30f121['id']}})[_0x0069('0x1c')](function(){return _0x22517b;});})['then'](function(){_0x4528b2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7cc3,_0xf3531d){return function(_0x409fde){if(!_0x409fde){_0x2d7cc3['sendStatus'](0x194);}return _0x409fde;};}function handleError(_0xcb0658,_0x3bc5ca){_0x3bc5ca=_0x3bc5ca||0x1f4;return function(_0x5206ff){logger[_0x0069('0x21')](_0x5206ff[_0x0069('0x33')]);if(_0x5206ff[_0x0069('0x34')]){delete _0x5206ff['name'];}_0xcb0658[_0x0069('0x25')](_0x3bc5ca)[_0x0069('0x35')](_0x5206ff);};}exports[_0x0069('0x36')]=function(_0x29c013,_0x57800f){var _0x4c2c9b={'include':[{'model':db[_0x0069('0x37')],'as':_0x0069('0x38')}]},_0x32a459={},_0x5cc226={'count':0x0,'rows':[]};var _0x2e1375=_[_0x0069('0x39')](db[_0x0069('0x3a')][_0x0069('0x3b')],function(_0x969ab){return{'name':_0x969ab[_0x0069('0x3c')],'type':_0x969ab['type'][_0x0069('0x3d')]};});_0x32a459[_0x0069('0x3e')]=_[_0x0069('0x39')](_0x2e1375,_0x0069('0x34'));_0x32a459['query']=_[_0x0069('0x3f')](_0x29c013[_0x0069('0x40')]);_0x32a459[_0x0069('0x41')]=_['intersection'](_0x32a459[_0x0069('0x3e')],_0x32a459[_0x0069('0x40')]);_0x4c2c9b['attributes']=_[_0x0069('0x42')](_0x32a459[_0x0069('0x3e')],qs[_0x0069('0x43')](_0x29c013[_0x0069('0x40')][_0x0069('0x43')]));_0x4c2c9b[_0x0069('0x44')]=_0x4c2c9b[_0x0069('0x44')][_0x0069('0x45')]?_0x4c2c9b[_0x0069('0x44')]:_0x32a459[_0x0069('0x3e')];if(!_0x29c013[_0x0069('0x40')][_0x0069('0x46')]('nolimit')){_0x4c2c9b[_0x0069('0x2b')]=qs[_0x0069('0x2b')](_0x29c013['query'][_0x0069('0x2b')]);_0x4c2c9b['offset']=qs[_0x0069('0x2a')](_0x29c013['query'][_0x0069('0x2a')]);}_0x4c2c9b['order']=qs[_0x0069('0x47')](_0x29c013['query'][_0x0069('0x47')]);_0x4c2c9b[_0x0069('0x48')]=qs[_0x0069('0x41')](_[_0x0069('0x49')](_0x29c013['query'],_0x32a459[_0x0069('0x41')]),_0x2e1375);if(_0x29c013[_0x0069('0x40')][_0x0069('0x4a')]){_0x4c2c9b[_0x0069('0x48')]=_[_0x0069('0x4b')](_0x4c2c9b[_0x0069('0x48')],{'$or':_[_0x0069('0x39')](_0x2e1375,function(_0xd1e97f){if(_0xd1e97f[_0x0069('0x4c')]!==_0x0069('0x4d')){var _0x20d5f8={};_0x20d5f8[_0xd1e97f[_0x0069('0x34')]]={'$like':'%'+_0x29c013[_0x0069('0x40')][_0x0069('0x4a')]+'%'};return _0x20d5f8;}})});}_0x4c2c9b=_['merge']({},_0x4c2c9b,_0x29c013[_0x0069('0x4e')]);var _0x8d2e60={'where':_0x4c2c9b['where']};return db[_0x0069('0x3a')][_0x0069('0x29')](_0x8d2e60)['then'](function(_0x25f366){_0x5cc226[_0x0069('0x29')]=_0x25f366;if(_0x29c013[_0x0069('0x40')]['includeAll']){_0x4c2c9b[_0x0069('0x4f')]=[{'all':!![]}];}return db[_0x0069('0x3a')][_0x0069('0x50')](_0x4c2c9b);})[_0x0069('0x1c')](function(_0x475de1){_0x5cc226['rows']=_0x475de1;return _0x5cc226;})[_0x0069('0x1c')](respondWithFilteredResult(_0x57800f,_0x4c2c9b))[_0x0069('0x24')](handleError(_0x57800f,null));};exports[_0x0069('0x51')]=function(_0x1bb399,_0x471851){var _0x49fc15={'raw':![],'where':{'id':_0x1bb399[_0x0069('0x52')]['id']},'include':[{'model':db[_0x0069('0x37')],'as':'mandatoryDispositionPause'}]},_0x5c4fe4={};_0x5c4fe4[_0x0069('0x3e')]=_[_0x0069('0x3f')](db[_0x0069('0x3a')]['rawAttributes']);_0x5c4fe4[_0x0069('0x40')]=_['keys'](_0x1bb399['query']);_0x5c4fe4['filters']=_[_0x0069('0x42')](_0x5c4fe4[_0x0069('0x3e')],_0x5c4fe4[_0x0069('0x40')]);_0x49fc15[_0x0069('0x44')]=_[_0x0069('0x42')](_0x5c4fe4['model'],qs[_0x0069('0x43')](_0x1bb399['query'][_0x0069('0x43')]));_0x49fc15[_0x0069('0x44')]=_0x49fc15[_0x0069('0x44')]['length']?_0x49fc15['attributes']:_0x5c4fe4[_0x0069('0x3e')];if(_0x1bb399[_0x0069('0x40')]['includeAll']){_0x49fc15[_0x0069('0x4f')]=[{'all':!![]}];}_0x49fc15=_[_0x0069('0x4b')]({},_0x49fc15,_0x1bb399[_0x0069('0x4e')]);return db[_0x0069('0x3a')][_0x0069('0x53')](_0x49fc15)[_0x0069('0x1c')](handleEntityNotFound(_0x471851,null))[_0x0069('0x1c')](respondWithResult(_0x471851,null))[_0x0069('0x24')](handleError(_0x471851,null));};exports[_0x0069('0x54')]=function(_0x51890a,_0xc12cfd){return db[_0x0069('0x3a')][_0x0069('0x54')](_0x51890a[_0x0069('0x55')],{})['then'](function(_0xd2602d){var _0x544428=_0x51890a['user']['get']({'plain':!![]});if(!_0x544428)throw new Error(_0x0069('0x56'));if(_0x544428[_0x0069('0x57')]===_0x0069('0x58')){var _0x467d00=_0xd2602d[_0x0069('0x31')]({'plain':!![]});var _0x1ba86b=_0x0069('0x59');return db['UserProfileSection'][_0x0069('0x53')]({'where':{'name':_0x1ba86b,'userProfileId':_0x544428['userProfileId']},'raw':!![]})[_0x0069('0x1c')](function(_0x4a4087){if(_0x4a4087&&_0x4a4087['autoAssociation']===0x0){return db[_0x0069('0x32')]['create']({'name':_0x467d00['name'],'resourceId':_0x467d00['id'],'type':_0x4a4087[_0x0069('0x34')],'sectionId':_0x4a4087['id']},{})[_0x0069('0x1c')](function(){return _0xd2602d;});}else{return _0xd2602d;}})[_0x0069('0x24')](function(_0x1df23c){logger[_0x0069('0x21')](_0x0069('0x5a'),_0x1df23c);throw _0x1df23c;});}return _0xd2602d;})[_0x0069('0x1c')](respondWithResult(_0xc12cfd,0xc9))[_0x0069('0x24')](handleError(_0xc12cfd,null));};exports[_0x0069('0x5b')]=function(_0x4c5cdc,_0x1b4553){if(_0x4c5cdc['body']['id']){delete _0x4c5cdc[_0x0069('0x55')]['id'];}return db['WhatsappAccount'][_0x0069('0x53')]({'where':{'id':_0x4c5cdc['params']['id']},'include':[{'model':db[_0x0069('0x37')],'as':'mandatoryDispositionPause'}]})[_0x0069('0x1c')](handleEntityNotFound(_0x1b4553,null))['then'](saveUpdates(_0x4c5cdc['body'],null))[_0x0069('0x1c')](respondWithResult(_0x1b4553,null))[_0x0069('0x24')](handleError(_0x1b4553,null));};exports['destroy']=function(_0x261a84,_0x2bd1b3){return db[_0x0069('0x3a')][_0x0069('0x53')]({'where':{'id':_0x261a84[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x2bd1b3,null))[_0x0069('0x1c')](removeEntity(_0x2bd1b3,null))[_0x0069('0x24')](handleError(_0x2bd1b3,null));};exports[_0x0069('0x5c')]=function(_0x2d50b5,_0x4c0ef3){return db[_0x0069('0x3a')][_0x0069('0x5c')]()[_0x0069('0x1c')](respondWithResult(_0x4c0ef3,null))[_0x0069('0x24')](handleError(_0x4c0ef3,null));};exports[_0x0069('0x5d')]=function(_0xb215ab,_0x4117bd,_0x28e873){if(_0xb215ab[_0x0069('0x55')]['id']){delete _0xb215ab[_0x0069('0x55')]['id'];}return db[_0x0069('0x3a')][_0x0069('0x53')]({'where':{'id':_0xb215ab[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x4117bd,null))[_0x0069('0x1c')](function(_0x2f2851){if(_0x2f2851){_0xb215ab[_0x0069('0x55')][_0x0069('0x5e')]=_0x2f2851['id'];return db[_0x0069('0x5f')]['create'](_0xb215ab[_0x0069('0x55')]);}})[_0x0069('0x1c')](respondWithResult(_0x4117bd,null))[_0x0069('0x24')](handleError(_0x4117bd,null));};exports[_0x0069('0x60')]=function(_0x3d7578,_0x1118f4,_0x56d7f2){var _0x413d63={'raw':![],'where':{}};var _0x5aaf59={};var _0x3e2390={'count':0x0,'rows':[]};return db[_0x0069('0x3a')]['findOne']({'where':{'id':_0x3d7578[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x1118f4,null))[_0x0069('0x1c')](function(_0x316e20){if(_0x316e20){_0x5aaf59['model']=_[_0x0069('0x3f')](db[_0x0069('0x5f')]['rawAttributes']);_0x5aaf59[_0x0069('0x40')]=_['keys'](_0x3d7578['query']);_0x5aaf59[_0x0069('0x41')]=_[_0x0069('0x42')](_0x5aaf59[_0x0069('0x3e')],_0x5aaf59['query']);_0x413d63[_0x0069('0x44')]=_['intersection'](_0x5aaf59[_0x0069('0x3e')],qs['fields'](_0x3d7578['query'][_0x0069('0x43')]));_0x413d63[_0x0069('0x44')]=_0x413d63['attributes'][_0x0069('0x45')]?_0x413d63['attributes']:_0x5aaf59['model'];if(!_0x3d7578['query'][_0x0069('0x46')]('nolimit')){_0x413d63[_0x0069('0x2b')]=qs[_0x0069('0x2b')](_0x3d7578[_0x0069('0x40')][_0x0069('0x2b')]);_0x413d63['offset']=qs[_0x0069('0x2a')](_0x3d7578[_0x0069('0x40')]['offset']);}_0x413d63[_0x0069('0x61')]=qs[_0x0069('0x47')](_0x3d7578['query'][_0x0069('0x47')]);_0x413d63[_0x0069('0x48')]=qs[_0x0069('0x41')](_[_0x0069('0x49')](_0x3d7578[_0x0069('0x40')],_0x5aaf59[_0x0069('0x41')]));_0x413d63[_0x0069('0x48')][_0x0069('0x5e')]=_0x316e20['id'];if(_0x3d7578[_0x0069('0x40')][_0x0069('0x4a')]){_0x413d63[_0x0069('0x48')]=_[_0x0069('0x4b')](_0x413d63[_0x0069('0x48')],{'$or':_[_0x0069('0x39')](_0x413d63[_0x0069('0x44')],function(_0x4a3c63){var _0x3135e4={};_0x3135e4[_0x4a3c63]={'$like':'%'+_0x3d7578[_0x0069('0x40')][_0x0069('0x4a')]+'%'};return _0x3135e4;})});}_0x413d63=_[_0x0069('0x4b')]({},_0x413d63,_0x3d7578[_0x0069('0x4e')]);return db['Disposition'][_0x0069('0x29')]({'where':_0x413d63[_0x0069('0x48')]})['then'](function(_0x15c86d){_0x3e2390['count']=_0x15c86d;if(_0x3d7578['query'][_0x0069('0x62')]){_0x413d63[_0x0069('0x4f')]=[{'all':!![]}];}return db[_0x0069('0x5f')]['findAll'](_0x413d63);})['then'](function(_0x3a7787){_0x3e2390['rows']=_0x3a7787;return _0x3e2390;});}})['then'](respondWithFilteredResult(_0x1118f4,_0x413d63))[_0x0069('0x24')](handleError(_0x1118f4,null));};exports[_0x0069('0x63')]=function(_0x506b55,_0x29a132,_0x4a6672){return db[_0x0069('0x3a')]['find']({'where':{'id':_0x506b55[_0x0069('0x52')]['id']}})['then'](handleEntityNotFound(_0x29a132,null))[_0x0069('0x1c')](function(_0x4cfcdb){if(_0x4cfcdb){return _0x4cfcdb[_0x0069('0x63')](_0x506b55[_0x0069('0x40')][_0x0069('0x64')]);}})['then'](respondWithStatusCode(_0x29a132,null))[_0x0069('0x24')](handleError(_0x29a132,null));};exports[_0x0069('0x65')]=function(_0x1ec528,_0x11e963,_0x451e10){if(_0x1ec528[_0x0069('0x55')]['id']){delete _0x1ec528[_0x0069('0x55')]['id'];}return db['WhatsappAccount'][_0x0069('0x53')]({'where':{'id':_0x1ec528['params']['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x11e963,null))['then'](function(_0x3032f5){if(_0x3032f5){_0x1ec528[_0x0069('0x55')]['WhatsappAccountId']=_0x3032f5['id'];return db[_0x0069('0x66')]['create'](_0x1ec528['body']);}})[_0x0069('0x1c')](respondWithResult(_0x11e963,null))[_0x0069('0x24')](handleError(_0x11e963,null));};exports[_0x0069('0x67')]=function(_0x3517c2,_0x33c99a,_0x2e9dce){var _0x3f1ea3={'raw':![],'where':{}};var _0x3a72f8={};var _0x27dbfb={'count':0x0,'rows':[]};return db[_0x0069('0x3a')][_0x0069('0x68')]({'where':{'id':_0x3517c2[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x33c99a,null))[_0x0069('0x1c')](function(_0x1736ac){if(_0x1736ac){_0x3a72f8[_0x0069('0x3e')]=_[_0x0069('0x3f')](db[_0x0069('0x66')][_0x0069('0x3b')]);_0x3a72f8[_0x0069('0x40')]=_['keys'](_0x3517c2[_0x0069('0x40')]);_0x3a72f8[_0x0069('0x41')]=_[_0x0069('0x42')](_0x3a72f8[_0x0069('0x3e')],_0x3a72f8[_0x0069('0x40')]);_0x3f1ea3[_0x0069('0x44')]=_[_0x0069('0x42')](_0x3a72f8['model'],qs[_0x0069('0x43')](_0x3517c2['query'][_0x0069('0x43')]));_0x3f1ea3[_0x0069('0x44')]=_0x3f1ea3[_0x0069('0x44')][_0x0069('0x45')]?_0x3f1ea3[_0x0069('0x44')]:_0x3a72f8[_0x0069('0x3e')];if(!_0x3517c2[_0x0069('0x40')]['hasOwnProperty']('nolimit')){_0x3f1ea3[_0x0069('0x2b')]=qs[_0x0069('0x2b')](_0x3517c2['query']['limit']);_0x3f1ea3[_0x0069('0x2a')]=qs[_0x0069('0x2a')](_0x3517c2[_0x0069('0x40')][_0x0069('0x2a')]);}_0x3f1ea3[_0x0069('0x61')]=qs[_0x0069('0x47')](_0x3517c2[_0x0069('0x40')][_0x0069('0x47')]);_0x3f1ea3[_0x0069('0x48')]=qs['filters'](_['pick'](_0x3517c2['query'],_0x3a72f8[_0x0069('0x41')]));_0x3f1ea3[_0x0069('0x48')][_0x0069('0x5e')]=_0x1736ac['id'];if(_0x3517c2['query'][_0x0069('0x4a')]){_0x3f1ea3['where']=_['merge'](_0x3f1ea3[_0x0069('0x48')],{'$or':_[_0x0069('0x39')](_0x3f1ea3[_0x0069('0x44')],function(_0x9dd61){var _0x3bfea0={};_0x3bfea0[_0x9dd61]={'$like':'%'+_0x3517c2[_0x0069('0x40')][_0x0069('0x4a')]+'%'};return _0x3bfea0;})});}_0x3f1ea3=_[_0x0069('0x4b')]({},_0x3f1ea3,_0x3517c2[_0x0069('0x4e')]);return db['CannedAnswer'][_0x0069('0x29')]({'where':_0x3f1ea3['where']})[_0x0069('0x1c')](function(_0xfe0f10){_0x27dbfb[_0x0069('0x29')]=_0xfe0f10;if(_0x3517c2[_0x0069('0x40')][_0x0069('0x62')]){_0x3f1ea3[_0x0069('0x4f')]=[{'all':!![]}];}return db[_0x0069('0x66')][_0x0069('0x50')](_0x3f1ea3);})[_0x0069('0x1c')](function(_0x38bcba){_0x27dbfb[_0x0069('0x69')]=_0x38bcba;return _0x27dbfb;});}})[_0x0069('0x1c')](respondWithFilteredResult(_0x33c99a,_0x3f1ea3))[_0x0069('0x24')](handleError(_0x33c99a,null));};exports[_0x0069('0x6a')]=function(_0x1aa159,_0x73bdc2,_0x2c2393){return db[_0x0069('0x3a')]['find']({'where':{'id':_0x1aa159[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x73bdc2,null))['then'](function(_0x412341){if(_0x412341){return _0x412341[_0x0069('0x6a')](_0x1aa159[_0x0069('0x40')][_0x0069('0x64')]);}})[_0x0069('0x1c')](respondWithStatusCode(_0x73bdc2,null))[_0x0069('0x24')](handleError(_0x73bdc2,null));};exports[_0x0069('0x6b')]=function(_0x5f26fd,_0x22c54f,_0x30a9f5){return db['WhatsappAccount']['find']({'where':{'id':_0x5f26fd[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x22c54f,null))[_0x0069('0x1c')](function(_0x7d1b6f){if(_0x7d1b6f){return _0x7d1b6f[_0x0069('0x6b')](_0x5f26fd[_0x0069('0x55')][_0x0069('0x64')],_['omit'](_0x5f26fd[_0x0069('0x55')],['ids','id'])||{})[_0x0069('0x6c')](function(_0x229f8f){for(var _0x15c9e3=0x0;_0x15c9e3<_0x5f26fd[_0x0069('0x55')][_0x0069('0x64')][_0x0069('0x45')];_0x15c9e3+=0x1){socket['emit'](_0x0069('0x6d'),{'UserId':Number(_0x5f26fd[_0x0069('0x55')]['ids'][_0x15c9e3]),'WhatsappAccountId':Number(_0x5f26fd[_0x0069('0x52')]['id'])});}return _0x229f8f;});}})['then'](respondWithResult(_0x22c54f,null))['catch'](handleError(_0x22c54f,null));};exports[_0x0069('0x6e')]=function(_0x310d21,_0x2e3e7b,_0x1d2856){return db[_0x0069('0x3a')]['find']({'where':{'id':_0x310d21[_0x0069('0x52')]['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x2e3e7b,null))[_0x0069('0x1c')](function(_0xd99276){if(_0xd99276){return _0xd99276['removeAgents'](_0x310d21[_0x0069('0x40')][_0x0069('0x64')])[_0x0069('0x1c')](function(){if(_[_0x0069('0x6f')](_0x310d21[_0x0069('0x40')][_0x0069('0x64')])){for(var _0x1004a8=0x0;_0x1004a8<_0x310d21[_0x0069('0x40')][_0x0069('0x64')][_0x0069('0x45')];_0x1004a8+=0x1){socket['emit']('userWhatsappAccount:remove',{'UserId':Number(_0x310d21['query'][_0x0069('0x64')][_0x1004a8]),'WhatsappAccountId':Number(_0x310d21[_0x0069('0x52')]['id'])});}}else{socket[_0x0069('0x70')](_0x0069('0x71'),{'UserId':Number(_0x310d21[_0x0069('0x40')]['ids']),'WhatsappAccountId':Number(_0x310d21[_0x0069('0x52')]['id'])});}});}})['then'](respondWithStatusCode(_0x2e3e7b,null))[_0x0069('0x24')](handleError(_0x2e3e7b,null));};exports[_0x0069('0x72')]=function(_0x335e53,_0x46a88a,_0x5c2df2){var _0x30a2fe={};var _0x2d6171={};var _0x7a86ec;var _0x212156;return db['WhatsappAccount'][_0x0069('0x68')]({'where':{'id':_0x335e53[_0x0069('0x52')]['id']}})['then'](handleEntityNotFound(_0x46a88a,null))[_0x0069('0x1c')](function(_0x5dd243){if(_0x5dd243){_0x7a86ec=_0x5dd243;_0x2d6171[_0x0069('0x3e')]=_[_0x0069('0x3f')](db[_0x0069('0x73')][_0x0069('0x3b')]);_0x2d6171[_0x0069('0x40')]=_[_0x0069('0x3f')](_0x335e53['query']);_0x2d6171[_0x0069('0x41')]=_[_0x0069('0x42')](_0x2d6171[_0x0069('0x3e')],_0x2d6171['query']);_0x30a2fe['attributes']=_[_0x0069('0x42')](_0x2d6171[_0x0069('0x3e')],qs['fields'](_0x335e53['query'][_0x0069('0x43')]));_0x30a2fe[_0x0069('0x44')]=_0x30a2fe[_0x0069('0x44')]['length']?_0x30a2fe[_0x0069('0x44')]:_0x2d6171[_0x0069('0x3e')];_0x30a2fe[_0x0069('0x61')]=qs['sort'](_0x335e53['query']['sort']);_0x30a2fe[_0x0069('0x48')]=qs['filters'](_[_0x0069('0x49')](_0x335e53[_0x0069('0x40')],_0x2d6171[_0x0069('0x41')]));if(_0x335e53[_0x0069('0x40')]['filter']){_0x30a2fe[_0x0069('0x48')]=_[_0x0069('0x4b')](_0x30a2fe[_0x0069('0x48')],{'$or':_[_0x0069('0x39')](_0x30a2fe[_0x0069('0x44')],function(_0x4f96b1){var _0x46a230={};_0x46a230[_0x4f96b1]={'$like':'%'+_0x335e53[_0x0069('0x40')]['filter']+'%'};return _0x46a230;})});}_0x30a2fe=_['merge']({},_0x30a2fe,_0x335e53[_0x0069('0x4e')]);return _0x7a86ec[_0x0069('0x72')](_0x30a2fe);}})[_0x0069('0x1c')](function(_0x54f2ca){if(_0x54f2ca){_0x212156=_0x54f2ca['length'];if(!_0x335e53[_0x0069('0x40')][_0x0069('0x46')]('nolimit')){_0x30a2fe[_0x0069('0x2b')]=qs['limit'](_0x335e53[_0x0069('0x40')][_0x0069('0x2b')]);_0x30a2fe[_0x0069('0x2a')]=qs[_0x0069('0x2a')](_0x335e53[_0x0069('0x40')][_0x0069('0x2a')]);}return _0x7a86ec[_0x0069('0x72')](_0x30a2fe);}})[_0x0069('0x1c')](function(_0x291b0a){if(_0x291b0a){return _0x291b0a?{'count':_0x212156,'rows':_0x291b0a}:null;}})['then'](respondWithResult(_0x46a88a,null))['catch'](handleError(_0x46a88a,null));};exports[_0x0069('0x74')]=function(_0x46dd86,_0x60ca1d){var _0x44dacf=_0x46dd86['params']['id'];var _0x46d6cc=_0x46dd86[_0x0069('0x55')];var _0x13f4e4=0xc8;var _0x8ce818=null;return db['sequelize'][_0x0069('0x75')]({'isolationLevel':db[_0x0069('0x76')]['Transaction'][_0x0069('0x77')][_0x0069('0x78')]},function(_0x4a44ed){return db['WhatsappAccount'][_0x0069('0x68')]({'where':{'id':_0x44dacf},'transaction':_0x4a44ed})[_0x0069('0x1c')](function(_0x43ed68){if(_0x43ed68){return db[_0x0069('0x79')][_0x0069('0x30')]({'where':{'WhatsappAccountId':_0x44dacf},'transaction':_0x4a44ed})[_0x0069('0x1c')](function(){var _0x1f49d1=_['map'](_0x46d6cc,function(_0x316b50){_0x316b50['WhatsappAccountId']=_0x44dacf;return _0x316b50;});return db[_0x0069('0x79')][_0x0069('0x7a')](_0x1f49d1,{'transaction':_0x4a44ed});});}else{_0x13f4e4=0x194;_0x8ce818=[];}});})[_0x0069('0x1c')](function(){if(_0x13f4e4!==0x194){return db[_0x0069('0x79')][_0x0069('0x7b')]({'where':{'WhatsappAccountId':_0x44dacf},'order':_0x0069('0x7c')})[_0x0069('0x1c')](function(_0x45ddd4){_0x8ce818=_0x45ddd4;});}})['catch'](function(_0x384c4b){_0x13f4e4=0x1f4;logger[_0x0069('0x21')](_0x384c4b[_0x0069('0x33')]);if(_0x384c4b[_0x0069('0x34')]){delete _0x384c4b[_0x0069('0x34')];}_0x8ce818=_0x384c4b;})[_0x0069('0x7d')](function(){if(_0x8ce818===null){_0x60ca1d[_0x0069('0x7e')](_0x13f4e4);}else{if(_0x13f4e4===0x1f4){_0x60ca1d['status'](_0x13f4e4)[_0x0069('0x35')](_0x8ce818);}else{_0x60ca1d[_0x0069('0x25')](_0x13f4e4)[_0x0069('0x27')](_0x8ce818);}}});};exports[_0x0069('0x7f')]=function(_0x1b7f1b,_0x1d6269,_0x296ae1){var _0x363d1c={};var _0x793500={};var _0x383be6;var _0x14b406;return db[_0x0069('0x3a')][_0x0069('0x68')]({'where':{'id':_0x1b7f1b['params']['id']}})[_0x0069('0x1c')](handleEntityNotFound(_0x1d6269,null))[_0x0069('0x1c')](function(_0xf9f493){if(_0xf9f493){_0x383be6=_0xf9f493;_0x793500[_0x0069('0x3e')]=_[_0x0069('0x3f')](db[_0x0069('0x79')][_0x0069('0x3b')]);_0x793500[_0x0069('0x40')]=_[_0x0069('0x3f')](_0x1b7f1b[_0x0069('0x40')]);_0x793500[_0x0069('0x41')]=_['intersection'](_0x793500[_0x0069('0x3e')],_0x793500['query']);_0x363d1c[_0x0069('0x44')]=_['intersection'](_0x793500['model'],qs[_0x0069('0x43')](_0x1b7f1b[_0x0069('0x40')]['fields']));_0x363d1c[_0x0069('0x44')]=_0x363d1c['attributes'][_0x0069('0x45')]?_0x363d1c[_0x0069('0x44')]:_0x793500[_0x0069('0x3e')];_0x363d1c[_0x0069('0x61')]=qs[_0x0069('0x47')](_0x1b7f1b[_0x0069('0x40')][_0x0069('0x47')]);_0x363d1c[_0x0069('0x48')]=qs[_0x0069('0x41')](_[_0x0069('0x49')](_0x1b7f1b['query'],_0x793500[_0x0069('0x41')]));if(_0x1b7f1b[_0x0069('0x40')]['filter']){_0x363d1c[_0x0069('0x48')]=_['merge'](_0x363d1c[_0x0069('0x48')],{'$or':_[_0x0069('0x39')](_0x363d1c['attributes'],function(_0x13db08){var _0x27d008={};_0x27d008[_0x13db08]={'$like':'%'+_0x1b7f1b[_0x0069('0x40')][_0x0069('0x4a')]+'%'};return _0x27d008;})});}_0x363d1c=_['merge']({},_0x363d1c,_0x1b7f1b[_0x0069('0x4e')]);return _0x383be6[_0x0069('0x7f')](_0x363d1c);}})[_0x0069('0x1c')](function(_0x5905d2){if(_0x5905d2){_0x14b406=_0x5905d2[_0x0069('0x45')];if(!_0x1b7f1b[_0x0069('0x40')]['hasOwnProperty']('nolimit')){_0x363d1c[_0x0069('0x2b')]=qs[_0x0069('0x2b')](_0x1b7f1b[_0x0069('0x40')][_0x0069('0x2b')]);_0x363d1c[_0x0069('0x2a')]=qs[_0x0069('0x2a')](_0x1b7f1b['query'][_0x0069('0x2a')]);}return _0x383be6[_0x0069('0x7f')](_0x363d1c);}})[_0x0069('0x1c')](function(_0x18dfbc){if(_0x18dfbc){return _0x18dfbc?{'count':_0x14b406,'rows':_0x18dfbc}:null;}})[_0x0069('0x1c')](respondWithResult(_0x1d6269,null))[_0x0069('0x24')](handleError(_0x1d6269,null));};exports[_0x0069('0x80')]=function(_0x5ea9aa,_0x3b3564,_0x12c0f3){var _0x38ac96={'channel':_0x0069('0x81')};var _0x5ce39c=[];var _0x582df8=[];var _0x3d200a={};return db['WhatsappAccount'][_0x0069('0x53')]({'where':{'id':_0x5ea9aa['params']['id']},'include':[{'model':db[_0x0069('0x79')],'as':'Applications'}]})[_0x0069('0x1c')](handleEntityNotFound(_0x3b3564,null))[_0x0069('0x1c')](function(_0x39a109){_0x38ac96[_0x0069('0x82')]=_0x39a109;if(_0x38ac96[_0x0069('0x82')]&&_0x38ac96[_0x0069('0x82')]['type']==='sinch'&&_0x5ea9aa[_0x0069('0x55')]['statuses']){if(_0x5ea9aa[_0x0069('0x55')][_0x0069('0x83')][_0x0069('0x45')]===0x0)return;if(_0x5ea9aa[_0x0069('0x55')][_0x0069('0x83')][0x0]['state']!==_0x0069('0x84'))return;return db['WhatsappMessage'][_0x0069('0x5b')]({'read':!![],'readAt':_0x5ea9aa['body'][_0x0069('0x83')][0x0]['timestamp']},{'where':{'messageId':_0x5ea9aa[_0x0069('0x55')]['statuses'][0x0][_0x0069('0x85')]},'individualHooks':!![]})[_0x0069('0x1c')](function(_0x5a7560){return _0x3b3564[_0x0069('0x25')](0xc8)[_0x0069('0x27')](_0x5a7560);});}_0x38ac96[_0x0069('0x86')]=_[_0x0069('0x87')](_0x39a109[_0x0069('0x88')],['priority'],[_0x0069('0x89')]);if(_0x38ac96[_0x0069('0x82')][_0x0069('0x88')]){delete _0x38ac96[_0x0069('0x82')][_0x0069('0x88')];}return db[_0x0069('0x8a')][_0x0069('0x5c')]()[_0x0069('0x1c')](function(_0x28ffde){if(!_0x28ffde){throw new db['Sequelize'][(_0x0069('0x8b'))](_0x0069('0x8c'));}_0x5ce39c=_[_0x0069('0x8d')](_[_0x0069('0x3f')](_0x28ffde),['createdAt','updatedAt']);_0x582df8=_[_0x0069('0x8d')](_[_0x0069('0x3f')](_0x28ffde),[_0x0069('0x8e'),_0x0069('0x8f'),'CompanyId',_0x0069('0x90')]);_0x38ac96[_0x0069('0x55')]={'mapKey':'mobile'};if(_0x38ac96[_0x0069('0x82')]&&_0x38ac96[_0x0069('0x82')][_0x0069('0x4c')]===_0x0069('0x91')){_0x38ac96[_0x0069('0x55')][_0x0069('0x92')]=_0x5ea9aa[_0x0069('0x55')][_0x0069('0x93')][_0x0069('0x94')]('whatsapp:','');_0x38ac96[_0x0069('0x55')][_0x0069('0x55')]=_0x5ea9aa[_0x0069('0x55')][_0x0069('0x95')];_0x38ac96[_0x0069('0x55')][_0x0069('0x96')]=_0x5ea9aa[_0x0069('0x55')][_0x0069('0x97')];}if(_0x38ac96[_0x0069('0x82')]&&_0x38ac96[_0x0069('0x82')][_0x0069('0x4c')]===_0x0069('0x98')){_0x38ac96['body'][_0x0069('0x92')]=_0x5ea9aa[_0x0069('0x55')]['notifications'][0x0][_0x0069('0x92')];_0x38ac96[_0x0069('0x55')][_0x0069('0x55')]=_0x5ea9aa['body'][_0x0069('0x99')][0x0][_0x0069('0x23')][_0x0069('0x55')];_0x38ac96[_0x0069('0x55')][_0x0069('0x96')]=_0x5ea9aa[_0x0069('0x55')]['notifications'][0x0][_0x0069('0x85')];}if(_0x38ac96[_0x0069('0x55')]['id']){delete _0x38ac96['body']['id'];}if(_[_0x0069('0x9a')](_0x38ac96[_0x0069('0x55')][_0x0069('0x92')])){throw new db[(_0x0069('0x9b'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0x0069('0x9a')](_0x38ac96[_0x0069('0x55')]['body'])||_0x38ac96['body']['body']===''){throw new db[(_0x0069('0x9b'))][(_0x0069('0x8b'))](_0x0069('0x9c'));}if(_[_0x0069('0x9a')](_0x38ac96[_0x0069('0x55')][_0x0069('0x9d')])){throw new db[(_0x0069('0x9b'))]['ValidationError'](_0x0069('0x9e')+_0x582df8);}if(!_[_0x0069('0x9f')](_0x582df8,_0x38ac96['body'][_0x0069('0x9d')])){throw new db[(_0x0069('0x9b'))][(_0x0069('0x8b'))](_0x0069('0xa0')+_0x582df8);}_0x3d200a[_0x38ac96[_0x0069('0x55')][_0x0069('0x9d')]]=_0x38ac96[_0x0069('0x55')][_0x0069('0x92')];return db[_0x0069('0xa1')][_0x0069('0x53')]({'where':{'id':_0x38ac96[_0x0069('0x82')]['ListId']},'include':[{'model':db[_0x0069('0x8a')],'as':_0x0069('0xa2'),'where':_0x3d200a,'limit':0x1,'order':[['updatedAt',_0x0069('0xa3')]]}]});})['then'](handleEntityNotFound(_0x3b3564,null))[_0x0069('0x1c')](function(_0x578148){if(_0x578148){_0x38ac96['list']=_[_0x0069('0xa4')](_0x578148,[_0x0069('0xa2')]);if(_0x578148[_0x0069('0xa2')][_0x0069('0x45')]){return _0x578148[_0x0069('0xa2')][0x0];}var _0x5902cf=_[_0x0069('0x16')](_0x38ac96[_0x0069('0x55')],{'firstName':_0x38ac96[_0x0069('0x55')][_0x0069('0x92')],'ListId':_0x578148['id']});_0x5902cf[_0x38ac96['body'][_0x0069('0x9d')]]=_0x38ac96['body'][_0x0069('0x92')];return db[_0x0069('0x8a')]['create'](_0x5902cf,{'fields':_0x5ce39c,'raw':!![]});}})[_0x0069('0x1c')](handleEntityNotFound(_0x3b3564,null))[_0x0069('0x1c')](function(_0x49f9ab){if(_0x49f9ab){_0x38ac96[_0x0069('0xa5')]=_0x49f9ab;var _0x1673de={'ContactId':_0x49f9ab['id'],'phone':_0x38ac96[_0x0069('0x55')]['from'],'WhatsappAccountId':_0x5ea9aa[_0x0069('0x52')]['id']};var _0x3b3189={'ContactId':_0x49f9ab['id'],'WhatsappAccountId':_0x5ea9aa[_0x0069('0x52')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x0069('0x53')]({'where':_0x3b3189})[_0x0069('0x1c')](function(_0x1af1d4){if(_0x1af1d4){return[_0x1af1d4,![]];}return db['WhatsappInteraction'][_0x0069('0x54')](_0x1673de)[_0x0069('0x1c')](function(_0x1cc267){return[_0x1cc267,!![]];});});}})['spread'](function(_0x2440ee,_0x3baa56){_0x38ac96[_0x0069('0xa6')]=_0x2440ee['get']({'plain':!![]});_0x38ac96[_0x0069('0xa6')][_0x0069('0xa7')]=![];if(_0x3baa56){if(_0x38ac96['account'][_0x0069('0xa8')]){_0x38ac96[_0x0069('0x86')][_0x0069('0xa9')]({'id':0x0,'priority':_0x38ac96[_0x0069('0x86')][_0x0069('0x45')]+0x1,'app':_0x0069('0xaa'),'appdata':'unmanaged','interval':_0x0069('0xab')});}_0x38ac96[_0x0069('0xa6')][_0x0069('0xa7')]=!![];}return db['WhatsappMessage'][_0x0069('0x54')]({'phone':_0x38ac96['body'][_0x0069('0x92')],'messageId':_0x38ac96[_0x0069('0x55')]['messageId'],'body':_0x38ac96['body'][_0x0069('0x55')],'WhatsappAccountId':_0x5ea9aa[_0x0069('0x52')]['id'],'WhatsappInteractionId':_0x2440ee['id'],'direction':'in','ContactId':_0x2440ee['ContactId'],'AttachmentId':_0x38ac96[_0x0069('0x55')][_0x0069('0xac')]});})[_0x0069('0x1c')](function(_0x4368c7){_0x38ac96[_0x0069('0x23')]=_0x4368c7;if(_0x38ac96[_0x0069('0xa6')][_0x0069('0xad')]){return db[_0x0069('0x73')][_0x0069('0x53')]({'attributes':['id',_0x0069('0x34')],'where':{'id':_0x38ac96[_0x0069('0xa6')][_0x0069('0xad')]}})[_0x0069('0x1c')](function(_0xc44b0a){if(_0xc44b0a){_0x38ac96[_0x0069('0x86')][_0x0069('0xae')]({'id':0x0,'priority':0x0,'app':_0x0069('0xaf'),'appdata':_0xc44b0a[_0x0069('0x34')]+','+(_0x38ac96[_0x0069('0x82')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x0069('0xb0'),_0x0069('0xb1'),_0x38ac96);});}return respondWithRpcPromise(_0x0069('0xb0'),'startRouting',_0x38ac96);})['then'](function(_0x923024){if(_0x923024){var _0x4e44df=0xc8;var _0x8ddb26=_0x0069('0xb2');logger['info'](_0x0069('0x1f'),_0x8ddb26,_0x4e44df,_0x0069('0xb3'));logger[_0x0069('0xb4')](_0x0069('0xb5'),_0x8ddb26,_0x4e44df,_0x0069('0xb3'),JSON[_0x0069('0x20')](_0x923024));if(_0x38ac96[_0x0069('0x82')]['type']===_0x0069('0x91')){return _0x3b3564[_0x0069('0x25')](_0x4e44df)[_0x0069('0x2c')](_0x0069('0xb6'),_0x0069('0xb7'))['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x3b3564[_0x0069('0x25')](_0x4e44df)['json'](_0x923024);}}});})[_0x0069('0x24')](handleError(_0x3b3564,null));};exports[_0x0069('0x35')]=function(_0x21505a,_0xd1ba30,_0x249a9b){var _0x2cd51e,_0x19bc74,_0x20182c;if(_['isNil'](_0x21505a[_0x0069('0x55')][_0x0069('0x55')])||_0x21505a[_0x0069('0x55')]['body']===''){throw new db[(_0x0069('0x9b'))][(_0x0069('0x8b'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0069('0x9a')](_0x21505a[_0x0069('0x55')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x2cd51e=_0x21505a[_0x0069('0x55')]['to'];return db['WhatsappAccount']['find']({'where':{'id':_0x21505a[_0x0069('0x52')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0069('0x8a')],'as':'Contacts','where':{'mobile':_0x2cd51e},'limit':0x1,'order':[[_0x0069('0x8f'),'DESC']]}]}]})[_0x0069('0x1c')](handleEntityNotFound(_0xd1ba30,null))['then'](function(_0x960494){if(_0x960494&&_0x960494['List']){_0x19bc74=_0x960494[_0x0069('0x31')]({'plain':!![]});if(_0x19bc74[_0x0069('0xb8')]&&_0x19bc74['List']['Contacts'][_0x0069('0x45')]){return _0x19bc74[_0x0069('0xb8')]['Contacts'][0x0];}return db[_0x0069('0x8a')][_0x0069('0x54')](_['defaults'](_0x21505a[_0x0069('0x55')],{'firstName':_0x2cd51e,'mobile':_0x2cd51e,'phone':_0x2cd51e,'ListId':_0x19bc74[_0x0069('0x90')]}));}})[_0x0069('0x1c')](handleEntityNotFound(_0xd1ba30,null))[_0x0069('0x1c')](function(_0x32bc52){if(_0x32bc52){_0x20182c=_0x32bc52;return db[_0x0069('0xb9')]['find']({'where':{'ContactId':_0x20182c['id'],'closed':![],'WhatsappAccountId':_0x19bc74['id']}})[_0x0069('0x1c')](function(_0xc4fe63){if(_0xc4fe63){return[_0xc4fe63,![]];}return db[_0x0069('0xb9')][_0x0069('0x54')]({'UserId':_0x21505a[_0x0069('0x58')]['id'],'ContactId':_0x20182c['id'],'WhatsappAccountId':_0x19bc74['id'],'phone':_0x2cd51e,'firstMsgDirection':_0x0069('0xba'),'Messages':[_[_0x0069('0x4b')](_0x21505a[_0x0069('0x55')],{'read':![],'body':_0x21505a[_0x0069('0x55')][_0x0069('0x55')],'phone':_0x2cd51e,'WhatsappAccountId':_0x19bc74['id'],'UserId':_0x21505a['user']['id'],'ContactId':_0x20182c['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})[_0x0069('0x1c')](function(_0x124ffc){return[_0x124ffc,!![]];});});}})[_0x0069('0x6c')](function(_0x326b4e,_0x2dea01){if(_0x2dea01){return _0x326b4e;}return db[_0x0069('0xbb')][_0x0069('0x54')](_[_0x0069('0x4b')](_0x21505a['body'],{'read':![],'body':_0x21505a['body'][_0x0069('0x55')],'phone':_0x2cd51e,'WhatsappAccountId':_0x19bc74['id'],'WhatsappInteractionId':_0x326b4e['id'],'UserId':_0x21505a[_0x0069('0x58')]['id'],'ContactId':_0x20182c['id']}))[_0x0069('0x1c')](function(_0x359c22){_0x326b4e[_0x0069('0xbc')][_0x0069('0xbd')]=[];_0x326b4e[_0x0069('0xbc')]['Messages'][_0x0069('0xa9')](_0x359c22['dataValues']);return _0x326b4e;});})['then'](respondWithResult(_0xd1ba30,null))[_0x0069('0x24')](handleError(_0xd1ba30,null));};
\ No newline at end of file
index 60b7590..01879b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab3c=['update','remove','emit','hasOwnProperty','hook','events','WhatsappAccount','setMaxListeners'];(function(_0x464fe5,_0xc616c7){var _0x4500d6=function(_0x2676d3){while(--_0x2676d3){_0x464fe5['push'](_0x464fe5['shift']());}};_0x4500d6(++_0xc616c7);}(_0xab3c,0x10d));var _0xcab3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab3c[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xcab3('0x0'));var WhatsappAccount=require('../../mysqldb')['db'][_0xcab3('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xcab3('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcab3('0x3'),'afterDestroy':_0xcab3('0x4')};function emitEvent(_0x2386da){return function(_0x4762c6,_0x5fa086,_0x332a31){WhatsappAccountEvents[_0xcab3('0x5')](_0x2386da+':'+_0x4762c6['id'],_0x4762c6);WhatsappAccountEvents['emit'](_0x2386da,_0x4762c6);_0x332a31(null);};}for(var e in events){if(events[_0xcab3('0x6')](e)){var event=events[e];WhatsappAccount[_0xcab3('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents;
\ No newline at end of file
+var _0x8adf=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','save'];(function(_0x42b4de,_0x29cfc2){var _0x2f168b=function(_0x214141){while(--_0x214141){_0x42b4de['push'](_0x42b4de['shift']());}};_0x2f168b(++_0x29cfc2);}(_0x8adf,0x12d));var _0xf8ad=function(_0x157e8f,_0x4ec808){_0x157e8f=_0x157e8f-0x0;var _0x23857d=_0x8adf[_0x157e8f];return _0x23857d;};'use strict';var EventEmitter=require(_0xf8ad('0x0'));var WhatsappAccount=require(_0xf8ad('0x1'))['db']['WhatsappAccount'];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf8ad('0x2'),'afterUpdate':_0xf8ad('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2f39f9){return function(_0x54224d,_0x4460e7,_0x22cbde){WhatsappAccountEvents[_0xf8ad('0x4')](_0x2f39f9+':'+_0x54224d['id'],_0x54224d);WhatsappAccountEvents[_0xf8ad('0x4')](_0x2f39f9,_0x54224d);_0x22cbde(null);};}for(var e in events){if(events[_0xf8ad('0x5')](e)){var event=events[e];WhatsappAccount[_0xf8ad('0x6')](e,emitEvent(event));}}module[_0xf8ad('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index b1dc56e..de428fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf0f=['moment','bluebird','request-promise','path','../../config/environment','./whatsappAccount.attributes','define','lodash','util','../../config/logger'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xdf0f,0x6b));var _0xfdf0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xdf0f[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xfdf0('0x0'));var util=require(_0xfdf0('0x1'));var logger=require(_0xfdf0('0x2'))('api');var moment=require(_0xfdf0('0x3'));var BPromise=require(_0xfdf0('0x4'));var rp=require(_0xfdf0('0x5'));var fs=require('fs');var path=require(_0xfdf0('0x6'));var rimraf=require('rimraf');var config=require(_0xfdf0('0x7'));var attributes=require(_0xfdf0('0x8'));module['exports']=function(_0xc46a61,_0x4be9d5){return _0xc46a61[_0xfdf0('0x9')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e7b=['request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount','lodash','util','../../config/logger','api'];(function(_0x660a6b,_0xaad94f){var _0x3f5d7d=function(_0x4164ea){while(--_0x4164ea){_0x660a6b['push'](_0x660a6b['shift']());}};_0x3f5d7d(++_0xaad94f);}(_0x4e7b,0xbc));var _0xb4e7=function(_0x52b08f,_0x3944a7){_0x52b08f=_0x52b08f-0x0;var _0xa3263f=_0x4e7b[_0x52b08f];return _0xa3263f;};'use strict';var _=require(_0xb4e7('0x0'));var util=require(_0xb4e7('0x1'));var logger=require(_0xb4e7('0x2'))(_0xb4e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb4e7('0x4'));var fs=require('fs');var path=require(_0xb4e7('0x5'));var rimraf=require(_0xb4e7('0x6'));var config=require(_0xb4e7('0x7'));var attributes=require(_0xb4e7('0x8'));module[_0xb4e7('0x9')]=function(_0x16f801,_0x5ae495){return _0x16f801[_0xb4e7('0xa')](_0xb4e7('0xb'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0cbb0e8..ca239e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4111=['catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappAccount.socket','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4cc492,_0x162c85){var _0x1f36b9=function(_0xce4b2){while(--_0xce4b2){_0x4cc492['push'](_0x4cc492['shift']());}};_0x1f36b9(++_0x162c85);}(_0x4111,0x188));var _0x1411=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4111[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x1411('0x0'));var util=require(_0x1411('0x1'));var moment=require(_0x1411('0x2'));var BPromise=require(_0x1411('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1411('0x4'));var db=require(_0x1411('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1411('0x6'))(_0x1411('0x7'));var config=require(_0x1411('0x8'));var jayson=require(_0x1411('0x9'));var client=jayson[_0x1411('0xa')][_0x1411('0xb')]({'port':0x232a});config[_0x1411('0xc')]=_['defaults'](config[_0x1411('0xc')],{'host':_0x1411('0xd'),'port':0x18eb});var socket=require(_0x1411('0xe'))(new Redis(config[_0x1411('0xc')]));require(_0x1411('0xf'))['register'](socket);function respondWithRpcPromise(_0x46e214,_0xe73695,_0x3baa3b){return new BPromise(function(_0x3990dd,_0x3543cd){return client['request'](_0x46e214,_0x3baa3b)['then'](function(_0x92d607){logger[_0x1411('0x10')](_0x1411('0x11'),_0xe73695,_0x1411('0x12'));logger[_0x1411('0x13')](_0x1411('0x14'),_0xe73695,'request\x20sent',JSON[_0x1411('0x15')](_0x92d607));if(_0x92d607[_0x1411('0x16')]){if(_0x92d607[_0x1411('0x16')][_0x1411('0x17')]===0x1f4){logger[_0x1411('0x16')](_0x1411('0x11'),_0xe73695,_0x92d607[_0x1411('0x16')][_0x1411('0x18')]);return _0x3543cd(_0x92d607[_0x1411('0x16')]['message']);}logger[_0x1411('0x16')]('WhatsappAccount,\x20%s,\x20%s',_0xe73695,_0x92d607[_0x1411('0x16')]['message']);return _0x3990dd(_0x92d607[_0x1411('0x16')][_0x1411('0x18')]);}else{logger[_0x1411('0x10')](_0x1411('0x11'),_0xe73695,_0x1411('0x12'));_0x3990dd(_0x92d607[_0x1411('0x19')][_0x1411('0x18')]);}})[_0x1411('0x1a')](function(_0x517a95){logger[_0x1411('0x16')](_0x1411('0x11'),_0xe73695,_0x517a95);_0x3543cd(_0x517a95);});});}exports[_0x1411('0x1b')]=function(_0x1b4d9d){var _0xfccf28=this;return new Promise(function(_0x4fe6f9,_0x53b35d){return db[_0x1411('0x1c')][_0x1411('0x1d')]({'raw':_0x1b4d9d['options']?_0x1b4d9d[_0x1411('0x1e')][_0x1411('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b4d9d['options']?_0x1b4d9d[_0x1411('0x1e')][_0x1411('0x20')]||null:null,'attributes':_0x1b4d9d[_0x1411('0x1e')]?_0x1b4d9d[_0x1411('0x1e')][_0x1411('0x21')]||null:null,'include':_0x1b4d9d[_0x1411('0x1e')]?_0x1b4d9d[_0x1411('0x1e')][_0x1411('0x22')]?_[_0x1411('0x23')](_0x1b4d9d[_0x1411('0x1e')]['include'],function(_0x410ecc){return{'model':db[_0x410ecc[_0x1411('0x24')]],'as':_0x410ecc['as'],'attributes':_0x410ecc[_0x1411('0x21')],'include':_0x410ecc['include']?_[_0x1411('0x23')](_0x410ecc['include'],function(_0x2ed3a0){return{'model':db[_0x2ed3a0[_0x1411('0x24')]],'as':_0x2ed3a0['as'],'attributes':_0x2ed3a0[_0x1411('0x21')],'include':_0x2ed3a0[_0x1411('0x22')]?_[_0x1411('0x23')](_0x2ed3a0[_0x1411('0x22')],function(_0x2741eb){return{'model':db[_0x2741eb[_0x1411('0x24')]],'as':_0x2741eb['as'],'attributes':_0x2741eb['attributes']};}):[]};}):[]};}):[]:[]})[_0x1411('0x25')](function(_0x4e60fc){logger['info']('ShowWhatsappAccount',_0x1b4d9d);logger[_0x1411('0x13')](_0x1411('0x1b'),_0x1b4d9d,JSON[_0x1411('0x15')](_0x4e60fc));_0x4fe6f9(_0x4e60fc);})[_0x1411('0x1a')](function(_0x36e8aa){logger[_0x1411('0x16')](_0x1411('0x1b'),_0x36e8aa[_0x1411('0x18')],_0x1b4d9d);_0x53b35d(_0xfccf28[_0x1411('0x16')](0x1f4,_0x36e8aa[_0x1411('0x18')]));});});};
\ No newline at end of file
+var _0x9724=['jayson/promise','http','defaults','redis','localhost','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3c2666,_0x15fd23){var _0x10c814=function(_0x4660c0){while(--_0x4660c0){_0x3c2666['push'](_0x3c2666['shift']());}};_0x10c814(++_0x15fd23);}(_0x9724,0x1f1));var _0x4972=function(_0x15eab3,_0x442535){_0x15eab3=_0x15eab3-0x0;var _0x3e7fd1=_0x9724[_0x15eab3];return _0x3e7fd1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4972('0x0'));var BPromise=require(_0x4972('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4972('0x2'));var db=require(_0x4972('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4972('0x4'))(_0x4972('0x5'));var config=require(_0x4972('0x6'));var jayson=require(_0x4972('0x7'));var client=jayson['client'][_0x4972('0x8')]({'port':0x232a});config['redis']=_[_0x4972('0x9')](config[_0x4972('0xa')],{'host':_0x4972('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4972('0xc'))[_0x4972('0xd')](socket);function respondWithRpcPromise(_0x704ca6,_0x9920f6,_0xb57c66){return new BPromise(function(_0x58222f,_0x46458e){return client[_0x4972('0xe')](_0x704ca6,_0xb57c66)[_0x4972('0xf')](function(_0x13203b){logger[_0x4972('0x10')](_0x4972('0x11'),_0x9920f6,_0x4972('0x12'));logger[_0x4972('0x13')](_0x4972('0x14'),_0x9920f6,'request\x20sent',JSON[_0x4972('0x15')](_0x13203b));if(_0x13203b[_0x4972('0x16')]){if(_0x13203b[_0x4972('0x16')][_0x4972('0x17')]===0x1f4){logger['error'](_0x4972('0x11'),_0x9920f6,_0x13203b[_0x4972('0x16')]['message']);return _0x46458e(_0x13203b[_0x4972('0x16')][_0x4972('0x18')]);}logger[_0x4972('0x16')](_0x4972('0x11'),_0x9920f6,_0x13203b[_0x4972('0x16')][_0x4972('0x18')]);return _0x58222f(_0x13203b[_0x4972('0x16')]['message']);}else{logger['info'](_0x4972('0x11'),_0x9920f6,'request\x20sent');_0x58222f(_0x13203b[_0x4972('0x19')][_0x4972('0x18')]);}})[_0x4972('0x1a')](function(_0x4bd6e7){logger[_0x4972('0x16')](_0x4972('0x11'),_0x9920f6,_0x4bd6e7);_0x46458e(_0x4bd6e7);});});}exports[_0x4972('0x1b')]=function(_0x306a22){var _0x168cc0=this;return new Promise(function(_0x1fefc8,_0x13469b){return db[_0x4972('0x1c')][_0x4972('0x1d')]({'raw':_0x306a22[_0x4972('0x1e')]?_0x306a22[_0x4972('0x1e')][_0x4972('0x1f')]===undefined?!![]:![]:!![],'where':_0x306a22[_0x4972('0x1e')]?_0x306a22['options']['where']||null:null,'attributes':_0x306a22[_0x4972('0x1e')]?_0x306a22[_0x4972('0x1e')][_0x4972('0x20')]||null:null,'include':_0x306a22[_0x4972('0x1e')]?_0x306a22[_0x4972('0x1e')][_0x4972('0x21')]?_[_0x4972('0x22')](_0x306a22[_0x4972('0x1e')]['include'],function(_0x135519){return{'model':db[_0x135519[_0x4972('0x23')]],'as':_0x135519['as'],'attributes':_0x135519[_0x4972('0x20')],'include':_0x135519[_0x4972('0x21')]?_[_0x4972('0x22')](_0x135519[_0x4972('0x21')],function(_0x13261b){return{'model':db[_0x13261b[_0x4972('0x23')]],'as':_0x13261b['as'],'attributes':_0x13261b['attributes'],'include':_0x13261b[_0x4972('0x21')]?_[_0x4972('0x22')](_0x13261b['include'],function(_0xceac73){return{'model':db[_0xceac73[_0x4972('0x23')]],'as':_0xceac73['as'],'attributes':_0xceac73['attributes']};}):[]};}):[]};}):[]:[]})[_0x4972('0xf')](function(_0x556853){logger[_0x4972('0x10')](_0x4972('0x1b'),_0x306a22);logger[_0x4972('0x13')](_0x4972('0x1b'),_0x306a22,JSON[_0x4972('0x15')](_0x556853));_0x1fefc8(_0x556853);})[_0x4972('0x1a')](function(_0x47cc80){logger[_0x4972('0x16')](_0x4972('0x1b'),_0x47cc80[_0x4972('0x18')],_0x306a22);_0x13469b(_0x168cc0[_0x4972('0x16')](0x1f4,_0x47cc80['message']));});});};
\ No newline at end of file
index 0c1e4c0..e995c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e61=['length','./whatsappAccount.events','save','remove','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e61,0x18d));var _0x16e6=function(_0x117c49,_0x5756fa){_0x117c49=_0x117c49-0x0;var _0x4edd43=_0x6e61[_0x117c49];return _0x4edd43;};'use strict';var WhatsappAccountEvents=require(_0x16e6('0x0'));var events=[_0x16e6('0x1'),_0x16e6('0x2'),'update'];function createListener(_0x4c975d,_0x2e92e2){return function(_0x1e7a1e){_0x2e92e2['emit'](_0x4c975d,_0x1e7a1e);};}function removeListener(_0xd651d1,_0x3d2858){return function(){WhatsappAccountEvents[_0x16e6('0x3')](_0xd651d1,_0x3d2858);};}exports[_0x16e6('0x4')]=function(_0xb9553e){for(var _0x57fce3=0x0,_0x39dbd0=events[_0x16e6('0x5')];_0x57fce3<_0x39dbd0;_0x57fce3++){var _0x1289b3=events[_0x57fce3];var _0x3bb27b=createListener('whatsappAccount:'+_0x1289b3,_0xb9553e);WhatsappAccountEvents['on'](_0x1289b3,_0x3bb27b);}};
\ No newline at end of file
+var _0x5514=['./whatsappAccount.events','save','remove','update','emit','removeListener','register','length','whatsappAccount:'];(function(_0x21321b,_0x34eabd){var _0x2e7d0c=function(_0xa185a9){while(--_0xa185a9){_0x21321b['push'](_0x21321b['shift']());}};_0x2e7d0c(++_0x34eabd);}(_0x5514,0x1b0));var _0x4551=function(_0x173f10,_0x35db61){_0x173f10=_0x173f10-0x0;var _0x53142d=_0x5514[_0x173f10];return _0x53142d;};'use strict';var WhatsappAccountEvents=require(_0x4551('0x0'));var events=[_0x4551('0x1'),_0x4551('0x2'),_0x4551('0x3')];function createListener(_0x5aa6d5,_0x1a3d54){return function(_0x1d026c){_0x1a3d54[_0x4551('0x4')](_0x5aa6d5,_0x1d026c);};}function removeListener(_0x534ce2,_0x314358){return function(){WhatsappAccountEvents[_0x4551('0x5')](_0x534ce2,_0x314358);};}exports[_0x4551('0x6')]=function(_0x5cc3d4){for(var _0x273397=0x0,_0x4b96c5=events[_0x4551('0x7')];_0x273397<_0x4b96c5;_0x273397++){var _0x3a2cbf=events[_0x273397];var _0x1b815e=createListener(_0x4551('0x8')+_0x3a2cbf,_0x5cc3d4);WhatsappAccountEvents['on'](_0x3a2cbf,_0x1b815e);}};
\ No newline at end of file
index cb88ec9..a5b84c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x169d=['delete','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','index','get','/:id','show','post','put','update'];(function(_0x5c4990,_0x5c7ee8){var _0x1462a7=function(_0xfb12a6){while(--_0xfb12a6){_0x5c4990['push'](_0x5c4990['shift']());}};_0x1462a7(++_0x5c7ee8);}(_0x169d,0xf8));var _0xd169=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x169d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xd169('0x0'));var path=require(_0xd169('0x1'));var timeout=require(_0xd169('0x2'));var express=require(_0xd169('0x3'));var router=express[_0xd169('0x4')]();var fs_extra=require(_0xd169('0x5'));var auth=require(_0xd169('0x6'));var interaction=require(_0xd169('0x7'));var config=require(_0xd169('0x8'));var controller=require(_0xd169('0x9'));router['get']('/',auth[_0xd169('0xa')](),controller[_0xd169('0xb')]);router[_0xd169('0xc')](_0xd169('0xd'),auth[_0xd169('0xa')](),controller[_0xd169('0xe')]);router[_0xd169('0xf')]('/',auth[_0xd169('0xa')](),controller['create']);router[_0xd169('0x10')](_0xd169('0xd'),auth[_0xd169('0xa')](),controller[_0xd169('0x11')]);router[_0xd169('0x12')]('/:id',auth[_0xd169('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4c41=['get','index','/:id','isAuthenticated','show','post','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x4c41,0x1a8));var _0x14c4=function(_0x2c5c2a,_0x13ab64){_0x2c5c2a=_0x2c5c2a-0x0;var _0x16df15=_0x4c41[_0x2c5c2a];return _0x16df15;};'use strict';var multer=require(_0x14c4('0x0'));var util=require(_0x14c4('0x1'));var path=require('path');var timeout=require(_0x14c4('0x2'));var express=require('express');var router=express[_0x14c4('0x3')]();var fs_extra=require(_0x14c4('0x4'));var auth=require(_0x14c4('0x5'));var interaction=require(_0x14c4('0x6'));var config=require(_0x14c4('0x7'));var controller=require('./whatsappApplication.controller');router[_0x14c4('0x8')]('/',auth['isAuthenticated'](),controller[_0x14c4('0x9')]);router[_0x14c4('0x8')](_0x14c4('0xa'),auth[_0x14c4('0xb')](),controller[_0x14c4('0xc')]);router[_0x14c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x14c4('0xa'),auth[_0x14c4('0xb')](),controller[_0x14c4('0xe')]);router[_0x14c4('0xf')](_0x14c4('0xa'),auth[_0x14c4('0xb')](),controller[_0x14c4('0x10')]);module[_0x14c4('0x11')]=router;
\ No newline at end of file
index af12fb3..bc0a0a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8c8=['*,*,*,*','sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x5b474c,_0xea57c2){var _0x42b8c7=function(_0x5016b6){while(--_0x5016b6){_0x5b474c['push'](_0x5b474c['shift']());}};_0x42b8c7(++_0xea57c2);}(_0xf8c8,0x1cf));var _0x8f8c=function(_0x4ea92e,_0xc578ef){_0x4ea92e=_0x4ea92e-0x0;var _0x53f10e=_0xf8c8[_0x4ea92e];return _0x53f10e;};'use strict';var Sequelize=require(_0x8f8c('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8f8c('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8f8c('0x2')],'allowNull':![],'defaultValue':_0x8f8c('0x3')},'appdata':{'type':Sequelize[_0x8f8c('0x4')]()},'description':{'type':Sequelize[_0x8f8c('0x2')]},'interval':{'type':Sequelize[_0x8f8c('0x2')],'defaultValue':_0x8f8c('0x5')}};
\ No newline at end of file
+var _0xa0ab=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x2bc09e,_0x1ae747){var _0x3f7c75=function(_0x49bed4){while(--_0x49bed4){_0x2bc09e['push'](_0x2bc09e['shift']());}};_0x3f7c75(++_0x1ae747);}(_0xa0ab,0x8c));var _0xba0a=function(_0x3c096e,_0xeb521f){_0x3c096e=_0x3c096e-0x0;var _0x3d627d=_0xa0ab[_0x3c096e];return _0x3d627d;};'use strict';var Sequelize=require(_0xba0a('0x0'));module[_0xba0a('0x1')]={'priority':{'type':Sequelize[_0xba0a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xba0a('0x3')},'appdata':{'type':Sequelize[_0xba0a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xba0a('0x5')],'defaultValue':_0xba0a('0x6')}};
\ No newline at end of file
index d2e896d..98a0cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['fs-extra','lodash','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x5b44ca,_0x2ddfd5){var _0x4e4ed6=function(_0x3066e7){while(--_0x3066e7){_0x5b44ca['push'](_0x5b44ca['shift']());}};_0x4e4ed6(++_0x2ddfd5);}(_0x5fdc,0x127));var _0xc5fd=function(_0x350e74,_0x36d2dc){_0x350e74=_0x350e74-0x0;var _0x13cfa0=_0x5fdc[_0x350e74];return _0x13cfa0;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));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('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x19')](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('0x1a')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=_[_0xc5fd('0x2b')](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x38db1d){return{'name':_0x38db1d[_0xc5fd('0x2e')],'type':_0x38db1d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x412ef7[_0xc5fd('0x31')]=_['map'](_0x4859f7,_0xc5fd('0x28'));_0x412ef7[_0xc5fd('0x32')]=_[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x32')]);_0x412ef7[_0xc5fd('0x34')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],_0x412ef7[_0xc5fd('0x32')]);_0x541c12[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]));_0x541c12[_0xc5fd('0x36')]=_0x541c12[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x541c12[_0xc5fd('0x36')]:_0x412ef7[_0xc5fd('0x31')];if(!_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x541c12['limit']=qs[_0xc5fd('0x3b')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3b')]);_0x541c12[_0xc5fd('0x1e')]=qs[_0xc5fd('0x1e')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x1e')]);}_0x541c12['order']=qs[_0xc5fd('0x3c')](_0x19df33[_0xc5fd('0x32')]['sort']);_0x541c12[_0xc5fd('0x3d')]=qs['filters'](_[_0xc5fd('0x3e')](_0x19df33[_0xc5fd('0x32')],_0x412ef7[_0xc5fd('0x34')]),_0x4859f7);if(_0x19df33['query'][_0xc5fd('0x3f')]){_0x541c12[_0xc5fd('0x3d')]=_['merge'](_0x541c12[_0xc5fd('0x3d')],{'$or':_[_0xc5fd('0x2b')](_0x4859f7,function(_0x31b457){if(_0x31b457[_0xc5fd('0x2f')]!==_0xc5fd('0x40')){var _0x33f669={};_0x33f669[_0x31b457['name']]={'$like':'%'+_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3f')]+'%'};return _0x33f669;}})});}_0x541c12=_[_0xc5fd('0x41')]({},_0x541c12,_0x19df33[_0xc5fd('0x42')]);var _0x5d3fce={'where':_0x541c12['where']};return db['WhatsappApplication'][_0xc5fd('0x1d')](_0x5d3fce)[_0xc5fd('0x24')](function(_0x2dd4ca){_0x5d4f70[_0xc5fd('0x1d')]=_0x2dd4ca;if(_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')][_0xc5fd('0x45')](_0x541c12);})['then'](function(_0x5a2199){_0x5d4f70[_0xc5fd('0x46')]=_0x5a2199;return _0x5d4f70;})['then'](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports[_0xc5fd('0x48')]=function(_0x2259e4,_0x57fd81){var _0x6ebcbf={'raw':!![],'where':{'id':_0x2259e4['params']['id']}},_0x350753={};_0x350753[_0xc5fd('0x31')]=_[_0xc5fd('0x33')](db['WhatsappApplication'][_0xc5fd('0x2d')]);_0x350753['query']=_[_0xc5fd('0x33')](_0x2259e4[_0xc5fd('0x32')]);_0x350753['filters']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],_0x350753[_0xc5fd('0x32')]);_0x6ebcbf['attributes']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],qs['fields'](_0x2259e4['query'][_0xc5fd('0x37')]));_0x6ebcbf['attributes']=_0x6ebcbf['attributes']['length']?_0x6ebcbf[_0xc5fd('0x36')]:_0x350753[_0xc5fd('0x31')];if(_0x2259e4[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x6ebcbf[_0xc5fd('0x44')]=[{'all':!![]}];}_0x6ebcbf=_[_0xc5fd('0x41')]({},_0x6ebcbf,_0x2259e4['options']);return db['WhatsappApplication']['find'](_0x6ebcbf)[_0xc5fd('0x24')](handleEntityNotFound(_0x57fd81,null))[_0xc5fd('0x24')](respondWithResult(_0x57fd81,null))[_0xc5fd('0x47')](handleError(_0x57fd81,null));};exports['create']=function(_0x1a2200,_0x51641b){return db[_0xc5fd('0x2c')][_0xc5fd('0x49')](_0x1a2200[_0xc5fd('0x4a')],{})[_0xc5fd('0x24')](respondWithResult(_0x51641b,0xc9))[_0xc5fd('0x47')](handleError(_0x51641b,null));};exports[_0xc5fd('0x23')]=function(_0x54d86c,_0x6b2f77){if(_0x54d86c[_0xc5fd('0x4a')]['id']){delete _0x54d86c['body']['id'];}return db['WhatsappApplication'][_0xc5fd('0x4b')]({'where':{'id':_0x54d86c['params']['id']}})['then'](handleEntityNotFound(_0x6b2f77,null))[_0xc5fd('0x24')](saveUpdates(_0x54d86c[_0xc5fd('0x4a')],null))['then'](respondWithResult(_0x6b2f77,null))[_0xc5fd('0x47')](handleError(_0x6b2f77,null));};exports[_0xc5fd('0x25')]=function(_0x5c49e7,_0x21d418){return db[_0xc5fd('0x2c')][_0xc5fd('0x4b')]({'where':{'id':_0x5c49e7[_0xc5fd('0x4c')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x21d418,null))[_0xc5fd('0x24')](removeEntity(_0x21d418,null))[_0xc5fd('0x47')](handleError(_0x21d418,null));};
\ No newline at end of file
+var _0x66fa=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','map','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','includeAll','include','WhatsappApplication','findAll','rows','catch','merge','options','find','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x66fa,0x117));var _0xa66f=function(_0x3e66fe,_0x317084){_0x3e66fe=_0x3e66fe-0x0;var _0x120698=_0x66fa[_0x3e66fe];return _0x120698;};'use strict';var emlformat=require(_0xa66f('0x0'));var rimraf=require(_0xa66f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66f('0x2'));var rp=require(_0xa66f('0x3'));var moment=require(_0xa66f('0x4'));var BPromise=require(_0xa66f('0x5'));var Mustache=require(_0xa66f('0x6'));var util=require(_0xa66f('0x7'));var path=require(_0xa66f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa66f('0x9'));var fs=require('fs');var fs_extra=require(_0xa66f('0xa'));var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa66f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251189,_0x14af70){_0x14af70=_0x14af70||0xcc;return function(_0xca12f8){if(_0xca12f8){return _0x251189['sendStatus'](_0x14af70);}return _0x251189['status'](_0x14af70)[_0xa66f('0x15')]();};}function respondWithResult(_0x4e09cf,_0x528427){_0x528427=_0x528427||0xc8;return function(_0x5a7b16){if(_0x5a7b16){return _0x4e09cf[_0xa66f('0x16')](_0x528427)[_0xa66f('0x17')](_0x5a7b16);}};}function respondWithFilteredResult(_0x267129,_0x236d64){return function(_0xd348f9){if(_0xd348f9){var _0x567d4f=typeof _0x236d64['offset']===_0xa66f('0x18')&&typeof _0x236d64[_0xa66f('0x19')]===_0xa66f('0x18');var _0x403f4d=_0xd348f9['count'];var _0x1cbe64=_0x567d4f?0x0:_0x236d64['offset'];var _0x4a28d4=_0x567d4f?_0xd348f9[_0xa66f('0x1a')]:_0x236d64[_0xa66f('0x1b')]+_0x236d64[_0xa66f('0x19')];var _0x355ddc;if(_0x4a28d4>=_0x403f4d){_0x4a28d4=_0x403f4d;_0x355ddc=0xc8;}else{_0x355ddc=0xce;}_0x267129[_0xa66f('0x16')](_0x355ddc);return _0x267129[_0xa66f('0x1c')](_0xa66f('0x1d'),_0x1cbe64+'-'+_0x4a28d4+'/'+_0x403f4d)[_0xa66f('0x17')](_0xd348f9);}return null;};}function patchUpdates(_0x2033a4){return function(_0x2d9602){try{jsonpatch[_0xa66f('0x1e')](_0x2d9602,_0x2033a4,!![]);}catch(_0xbba376){return BPromise[_0xa66f('0x1f')](_0xbba376);}return _0x2d9602[_0xa66f('0x20')]();};}function saveUpdates(_0x82924d,_0x5cd613){return function(_0x27f570){if(_0x27f570){return _0x27f570[_0xa66f('0x21')](_0x82924d)[_0xa66f('0x22')](function(_0x37ee13){return _0x37ee13;});}return null;};}function removeEntity(_0x5cbd82,_0x337602){return function(_0x473822){if(_0x473822){return _0x473822[_0xa66f('0x23')]()[_0xa66f('0x22')](function(){_0x5cbd82['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xed98b9,_0x598942){return function(_0x3a3e4f){if(!_0x3a3e4f){_0xed98b9[_0xa66f('0x24')](0x194);}return _0x3a3e4f;};}function handleError(_0x384164,_0x57da7f){_0x57da7f=_0x57da7f||0x1f4;return function(_0x4683c7){logger[_0xa66f('0x25')](_0x4683c7[_0xa66f('0x26')]);if(_0x4683c7[_0xa66f('0x27')]){delete _0x4683c7[_0xa66f('0x27')];}_0x384164[_0xa66f('0x16')](_0x57da7f)[_0xa66f('0x28')](_0x4683c7);};}exports[_0xa66f('0x29')]=function(_0x20ee67,_0x117d03){var _0x45f71c={},_0x63650b={},_0x42b966={'count':0x0,'rows':[]};var _0xeeb22e=_['map'](db['WhatsappApplication'][_0xa66f('0x2a')],function(_0x27ceae){return{'name':_0x27ceae['fieldName'],'type':_0x27ceae[_0xa66f('0x2b')][_0xa66f('0x2c')]};});_0x63650b['model']=_[_0xa66f('0x2d')](_0xeeb22e,_0xa66f('0x27'));_0x63650b[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x20ee67[_0xa66f('0x2e')]);_0x63650b['filters']=_[_0xa66f('0x30')](_0x63650b['model'],_0x63650b[_0xa66f('0x2e')]);_0x45f71c[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x63650b['model'],qs[_0xa66f('0x32')](_0x20ee67[_0xa66f('0x2e')]['fields']));_0x45f71c[_0xa66f('0x31')]=_0x45f71c[_0xa66f('0x31')][_0xa66f('0x33')]?_0x45f71c[_0xa66f('0x31')]:_0x63650b[_0xa66f('0x34')];if(!_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x35')](_0xa66f('0x36'))){_0x45f71c[_0xa66f('0x19')]=qs[_0xa66f('0x19')](_0x20ee67['query'][_0xa66f('0x19')]);_0x45f71c['offset']=qs[_0xa66f('0x1b')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x1b')]);}_0x45f71c[_0xa66f('0x37')]=qs[_0xa66f('0x38')](_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x38')]);_0x45f71c[_0xa66f('0x39')]=qs['filters'](_[_0xa66f('0x3a')](_0x20ee67['query'],_0x63650b[_0xa66f('0x3b')]),_0xeeb22e);if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3c')]){_0x45f71c['where']=_['merge'](_0x45f71c[_0xa66f('0x39')],{'$or':_[_0xa66f('0x2d')](_0xeeb22e,function(_0x20b07e){if(_0x20b07e[_0xa66f('0x2b')]!==_0xa66f('0x3d')){var _0x581dca={};_0x581dca[_0x20b07e['name']]={'$like':'%'+_0x20ee67['query'][_0xa66f('0x3c')]+'%'};return _0x581dca;}})});}_0x45f71c=_['merge']({},_0x45f71c,_0x20ee67['options']);var _0x5bf856={'where':_0x45f71c[_0xa66f('0x39')]};return db['WhatsappApplication'][_0xa66f('0x1a')](_0x5bf856)[_0xa66f('0x22')](function(_0x23a546){_0x42b966[_0xa66f('0x1a')]=_0x23a546;if(_0x20ee67[_0xa66f('0x2e')][_0xa66f('0x3e')]){_0x45f71c[_0xa66f('0x3f')]=[{'all':!![]}];}return db[_0xa66f('0x40')][_0xa66f('0x41')](_0x45f71c);})[_0xa66f('0x22')](function(_0x3a7929){_0x42b966[_0xa66f('0x42')]=_0x3a7929;return _0x42b966;})[_0xa66f('0x22')](respondWithFilteredResult(_0x117d03,_0x45f71c))[_0xa66f('0x43')](handleError(_0x117d03,null));};exports['show']=function(_0x36037c,_0x25c2cb){var _0x58c1f2={'raw':!![],'where':{'id':_0x36037c['params']['id']}},_0x248587={};_0x248587[_0xa66f('0x34')]=_[_0xa66f('0x2f')](db['WhatsappApplication'][_0xa66f('0x2a')]);_0x248587[_0xa66f('0x2e')]=_[_0xa66f('0x2f')](_0x36037c['query']);_0x248587[_0xa66f('0x3b')]=_['intersection'](_0x248587[_0xa66f('0x34')],_0x248587[_0xa66f('0x2e')]);_0x58c1f2[_0xa66f('0x31')]=_[_0xa66f('0x30')](_0x248587[_0xa66f('0x34')],qs[_0xa66f('0x32')](_0x36037c[_0xa66f('0x2e')]['fields']));_0x58c1f2[_0xa66f('0x31')]=_0x58c1f2[_0xa66f('0x31')][_0xa66f('0x33')]?_0x58c1f2[_0xa66f('0x31')]:_0x248587[_0xa66f('0x34')];if(_0x36037c['query']['includeAll']){_0x58c1f2[_0xa66f('0x3f')]=[{'all':!![]}];}_0x58c1f2=_[_0xa66f('0x44')]({},_0x58c1f2,_0x36037c[_0xa66f('0x45')]);return db[_0xa66f('0x40')][_0xa66f('0x46')](_0x58c1f2)[_0xa66f('0x22')](handleEntityNotFound(_0x25c2cb,null))['then'](respondWithResult(_0x25c2cb,null))[_0xa66f('0x43')](handleError(_0x25c2cb,null));};exports[_0xa66f('0x47')]=function(_0x3f9cdd,_0x5651e9){return db['WhatsappApplication'][_0xa66f('0x47')](_0x3f9cdd[_0xa66f('0x48')],{})[_0xa66f('0x22')](respondWithResult(_0x5651e9,0xc9))['catch'](handleError(_0x5651e9,null));};exports['update']=function(_0x52054e,_0x19e7ce){if(_0x52054e[_0xa66f('0x48')]['id']){delete _0x52054e[_0xa66f('0x48')]['id'];}return db[_0xa66f('0x40')][_0xa66f('0x46')]({'where':{'id':_0x52054e[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x19e7ce,null))[_0xa66f('0x22')](saveUpdates(_0x52054e['body'],null))[_0xa66f('0x22')](respondWithResult(_0x19e7ce,null))[_0xa66f('0x43')](handleError(_0x19e7ce,null));};exports[_0xa66f('0x23')]=function(_0x393755,_0x11597b){return db[_0xa66f('0x40')]['find']({'where':{'id':_0x393755[_0xa66f('0x49')]['id']}})[_0xa66f('0x22')](handleEntityNotFound(_0x11597b,null))[_0xa66f('0x22')](removeEntity(_0x11597b,null))[_0xa66f('0x43')](handleError(_0x11597b,null));};
\ No newline at end of file
index bf08d88..95397b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf021=['moment','request-promise','rimraf','../../config/environment','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4b185e,_0x31c299){var _0x558b84=function(_0x5aa4d5){while(--_0x5aa4d5){_0x4b185e['push'](_0x4b185e['shift']());}};_0x558b84(++_0x31c299);}(_0xf021,0x18f));var _0x1f02=function(_0x23ac30,_0x2a1d00){_0x23ac30=_0x23ac30-0x0;var _0x208fec=_0xf021[_0x23ac30];return _0x208fec;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var logger=require(_0x1f02('0x2'))(_0x1f02('0x3'));var moment=require(_0x1f02('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f02('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f02('0x6'));var config=require(_0x1f02('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x84a8f0,_0x56b275){return _0x84a8f0[_0x1f02('0x8')](_0x1f02('0x9'),attributes,{'tableName':_0x1f02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f02('0xb'),'collate':_0x1f02('0xc')});};
\ No newline at end of file
+var _0x00b3=['../../config/environment','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment','path','rimraf'];(function(_0x4b8b5c,_0x306f16){var _0x4ef46c=function(_0x1f2148){while(--_0x1f2148){_0x4b8b5c['push'](_0x4b8b5c['shift']());}};_0x4ef46c(++_0x306f16);}(_0x00b3,0x97));var _0x300b=function(_0x23189a,_0x56e1aa){_0x23189a=_0x23189a-0x0;var _0x1d48ca=_0x00b3[_0x23189a];return _0x1d48ca;};'use strict';var _=require(_0x300b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x300b('0x1'));var moment=require(_0x300b('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x300b('0x3'));var rimraf=require(_0x300b('0x4'));var config=require(_0x300b('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0x300b('0x6')]=function(_0xbceeb8,_0x34a5cd){return _0xbceeb8[_0x300b('0x7')](_0x300b('0x8'),attributes,{'tableName':_0x300b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x300b('0xa'),'collate':_0x300b('0xb')});};
\ No newline at end of file
index 894e55c..74e284e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea3=['WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappApplication,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ea3,0x70));var _0x34ea=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4ea3[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x34ea('0x0'));var util=require(_0x34ea('0x1'));var moment=require(_0x34ea('0x2'));var BPromise=require(_0x34ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x34ea('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x34ea('0x6'));var jayson=require(_0x34ea('0x7'));var client=jayson[_0x34ea('0x8')][_0x34ea('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40434e,_0x18b461,_0x22b09e){return new BPromise(function(_0x5bec7c,_0x341727){return client[_0x34ea('0xa')](_0x40434e,_0x22b09e)[_0x34ea('0xb')](function(_0x5132c4){logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,'request\x20sent');logger['debug'](_0x34ea('0xe'),_0x18b461,_0x34ea('0xf'),JSON[_0x34ea('0x10')](_0x5132c4));if(_0x5132c4['error']){if(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x12')]===0x1f4){logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);return _0x341727(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}logger[_0x34ea('0x11')](_0x34ea('0xd'),_0x18b461,_0x5132c4[_0x34ea('0x11')]['message']);return _0x5bec7c(_0x5132c4[_0x34ea('0x11')][_0x34ea('0x13')]);}else{logger[_0x34ea('0xc')](_0x34ea('0xd'),_0x18b461,_0x34ea('0xf'));_0x5bec7c(_0x5132c4['result'][_0x34ea('0x13')]);}})[_0x34ea('0x14')](function(_0x3fa3b0){logger[_0x34ea('0x11')]('WhatsappApplication,\x20%s,\x20%s',_0x18b461,_0x3fa3b0);_0x341727(_0x3fa3b0);});});}
\ No newline at end of file
+var _0x2d17=['WhatsappApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x602a10,_0x1e0c32){var _0x3d6837=function(_0x413e1c){while(--_0x413e1c){_0x602a10['push'](_0x602a10['shift']());}};_0x3d6837(++_0x1e0c32);}(_0x2d17,0x17e));var _0x72d1=function(_0x3359fb,_0x43cb6b){_0x3359fb=_0x3359fb-0x0;var _0xd5a55=_0x2d17[_0x3359fb];return _0xd5a55;};'use strict';var _=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var moment=require('moment');var BPromise=require(_0x72d1('0x2'));var rs=require(_0x72d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72d1('0x4'))['db'];var utils=require(_0x72d1('0x5'));var logger=require('../../config/logger')(_0x72d1('0x6'));var config=require('../../config/environment');var jayson=require(_0x72d1('0x7'));var client=jayson['client'][_0x72d1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){return client['request'](_0x239d1f,_0x477264)[_0x72d1('0x9')](function(_0x288362){logger[_0x72d1('0xa')]('WhatsappApplication,\x20%s,\x20%s',_0x5b40a9,_0x72d1('0xb'));logger[_0x72d1('0xc')](_0x72d1('0xd'),_0x5b40a9,_0x72d1('0xb'),JSON[_0x72d1('0xe')](_0x288362));if(_0x288362[_0x72d1('0xf')]){if(_0x288362[_0x72d1('0xf')][_0x72d1('0x10')]===0x1f4){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362['error'][_0x72d1('0x12')]);return _0x19e248(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);return _0x422f5a(_0x288362[_0x72d1('0xf')][_0x72d1('0x12')]);}else{logger[_0x72d1('0xa')](_0x72d1('0x11'),_0x5b40a9,_0x72d1('0xb'));_0x422f5a(_0x288362[_0x72d1('0x13')]['message']);}})[_0x72d1('0x14')](function(_0x5262b0){logger[_0x72d1('0xf')](_0x72d1('0x11'),_0x5b40a9,_0x5262b0);_0x19e248(_0x5262b0);});});}
\ No newline at end of file
index 9aaef04..2046cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc03e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','whatsappinteraction:addtags','addTags','put','tracked','whatsapp','whatsappinteraction:update','delete','removeTags','multer','connect-timeout'];(function(_0x329bf2,_0x4325f1){var _0x1da227=function(_0x4bf680){while(--_0x4bf680){_0x329bf2['push'](_0x329bf2['shift']());}};_0x1da227(++_0x4325f1);}(_0xc03e,0x15a));var _0xec03=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xc03e[_0x39106e];return _0x892aec;};'use strict';var multer=require(_0xec03('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xec03('0x1'));var express=require('express');var router=express[_0xec03('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xec03('0x3'));var interaction=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var controller=require(_0xec03('0x6'));router[_0xec03('0x7')]('/',auth[_0xec03('0x8')](),controller[_0xec03('0x9')]);router[_0xec03('0x7')](_0xec03('0xa'),auth['isAuthenticated'](),controller[_0xec03('0xb')]);router[_0xec03('0x7')](_0xec03('0xc'),auth[_0xec03('0x8')](),controller['show']);router[_0xec03('0x7')](_0xec03('0xd'),auth[_0xec03('0x8')](),controller[_0xec03('0xe')]);router[_0xec03('0x7')](_0xec03('0xf'),auth[_0xec03('0x8')](),controller[_0xec03('0x10')]);router['post']('/',auth[_0xec03('0x8')](),controller[_0xec03('0x11')]);router[_0xec03('0x12')](_0xec03('0xd'),auth[_0xec03('0x8')](),controller[_0xec03('0x13')]);router[_0xec03('0x12')](_0xec03('0x14'),auth['isAuthenticated'](),interaction['tracked']('whatsapp',_0xec03('0x15')),controller[_0xec03('0x16')]);router[_0xec03('0x17')](_0xec03('0xc'),auth[_0xec03('0x8')](),interaction[_0xec03('0x18')](_0xec03('0x19'),_0xec03('0x1a')),controller['update']);router[_0xec03('0x1b')]('/:id',auth[_0xec03('0x8')](),interaction['tracked'](_0xec03('0x19'),'whatsappinteraction:destroy'),controller['destroy']);router[_0xec03('0x1b')](_0xec03('0x14'),auth[_0xec03('0x8')](),controller[_0xec03('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0xc6ac=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','exports','multer','util','path'];(function(_0x16e22c,_0x3508bb){var _0x3a3e86=function(_0x2bfc66){while(--_0x2bfc66){_0x16e22c['push'](_0x16e22c['shift']());}};_0x3a3e86(++_0x3508bb);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x46bf35,_0x566164){_0x46bf35=_0x46bf35-0x0;var _0x3f4969=_0xc6ac[_0x46bf35];return _0x3f4969;};'use strict';var multer=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var path=require(_0xcc6a('0x2'));var timeout=require(_0xcc6a('0x3'));var express=require(_0xcc6a('0x4'));var router=express[_0xcc6a('0x5')]();var fs_extra=require(_0xcc6a('0x6'));var auth=require(_0xcc6a('0x7'));var interaction=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var controller=require(_0xcc6a('0xa'));router[_0xcc6a('0xb')]('/',auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xd')]);router['get'](_0xcc6a('0xe'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0xf')]);router['get'](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x11')]);router[_0xcc6a('0xb')](_0xcc6a('0x12'),auth['isAuthenticated'](),controller[_0xcc6a('0x13')]);router[_0xcc6a('0xb')](_0xcc6a('0x14'),auth['isAuthenticated'](),controller[_0xcc6a('0x15')]);router[_0xcc6a('0x16')]('/',auth[_0xcc6a('0xc')](),controller['create']);router['post'](_0xcc6a('0x12'),auth[_0xcc6a('0xc')](),controller[_0xcc6a('0x17')]);router['post']('/:id/tags',auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1a')),controller[_0xcc6a('0x1b')]);router[_0xcc6a('0x1c')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction['tracked']('whatsapp','whatsappinteraction:update'),controller[_0xcc6a('0x1d')]);router[_0xcc6a('0x1e')](_0xcc6a('0x10'),auth[_0xcc6a('0xc')](),interaction[_0xcc6a('0x18')](_0xcc6a('0x19'),_0xcc6a('0x1f')),controller[_0xcc6a('0x20')]);router[_0xcc6a('0x1e')](_0xcc6a('0x21'),auth[_0xcc6a('0xc')](),controller['removeTags']);module[_0xcc6a('0x22')]=router;
\ No newline at end of file
index dba649a..21a73d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe314=['BOOLEAN','DATE','STRING','ENUM','out','moment','exports'];(function(_0x5b4077,_0x47aab1){var _0x458d65=function(_0x33bfd5){while(--_0x33bfd5){_0x5b4077['push'](_0x5b4077['shift']());}};_0x458d65(++_0x47aab1);}(_0xe314,0x7c));var _0x4e31=function(_0x544172,_0x54f578){_0x544172=_0x544172-0x0;var _0x5a5bb4=_0xe314[_0x544172];return _0x5a5bb4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4e31('0x0'));module[_0x4e31('0x1')]={'closed':{'type':Sequelize[_0x4e31('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4e31('0x3')]},'disposition':{'type':Sequelize[_0x4e31('0x4')]},'secondDisposition':{'type':Sequelize[_0x4e31('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4e31('0x4')]},'note':{'type':Sequelize[_0x4e31('0x4')]},'phone':{'type':Sequelize[_0x4e31('0x4')]},'read1stAt':{'type':Sequelize[_0x4e31('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4e31('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4e31('0x5')]('in',_0x4e31('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4e31('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xf23b=['STRING','ENUM','out','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x25be4f,_0x571326){var _0x5450aa=function(_0x486903){while(--_0x486903){_0x25be4f['push'](_0x25be4f['shift']());}};_0x5450aa(++_0x571326);}(_0xf23b,0x133));var _0xbf23=function(_0x1839b7,_0x355b07){_0x1839b7=_0x1839b7-0x0;var _0x27a287=_0xf23b[_0x1839b7];return _0x27a287;};'use strict';var Sequelize=require(_0xbf23('0x0'));var moment=require(_0xbf23('0x1'));module[_0xbf23('0x2')]={'closed':{'type':Sequelize[_0xbf23('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbf23('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbf23('0x5')]},'thirdDisposition':{'type':Sequelize[_0xbf23('0x5')]},'note':{'type':Sequelize[_0xbf23('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xbf23('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbf23('0x6')]('in',_0xbf23('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbf23('0x4')]},'lastMsgDirection':{'type':Sequelize[_0xbf23('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index f4fab33..60458b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x682a=['create','body','find','WhatsappMessage','addMessage','ids','getMessages','findOne','hasOwnProperty','order','sort','where','WhatsappInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','omit','Tag','color','emit','whatsappInteractionTags:save','removeTags','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','Contact','firstName','Attachment','Messages','createdAt','direction','secret','WhatsappAccount','Account','fullname','get','mkdirSync','Whatsapp','Owner','N.A.','closed','closedAt','existsSync','createReadStream','pipe','basename','out','lastName','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','download','log','err','unlinkSync','sendStatus','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','register','status','json','undefined','limit','offset','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','user','show','params','keys','WhatsappInteraction','query','filters','model','attributes','intersection','fields','length','include','merge','options','catch'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x682a,0x148));var _0xa682=function(_0x34c099,_0x566620){_0x34c099=_0x34c099-0x0;var _0x4eb31d=_0x682a[_0x34c099];return _0x4eb31d;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xa682('0x0'));var moment=require(_0xa682('0x1'));var BPromise=require(_0xa682('0x2'));var util=require(_0xa682('0x3'));var path=require(_0xa682('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa682('0x5'));var Redis=require('ioredis');var interaction=require(_0xa682('0x6'));var qs=require(_0xa682('0x7'));var pdf=require(_0xa682('0x8'));var logger=require(_0xa682('0x9'))('api');var config=require(_0xa682('0xa'));var db=require(_0xa682('0xb'))['db'];config[_0xa682('0xc')]=_[_0xa682('0xd')](config[_0xa682('0xc')],{'host':_0xa682('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa682('0xc')]));require(_0xa682('0xf'))[_0xa682('0x10')](socket);function respondWithStatusCode(_0x3f5628,_0xb8f51c){_0xb8f51c=_0xb8f51c||0xcc;return function(_0x5930b1){if(_0x5930b1){return _0x3f5628['sendStatus'](_0xb8f51c);}return _0x3f5628['status'](_0xb8f51c)['end']();};}function respondWithResult(_0x1395fa,_0x9022d1){_0x9022d1=_0x9022d1||0xc8;return function(_0xa4b123){if(_0xa4b123){return _0x1395fa[_0xa682('0x11')](_0x9022d1)[_0xa682('0x12')](_0xa4b123);}};}function respondWithFilteredResult(_0x79ff9c,_0x5bf069){return function(_0x2c8fbd){if(_0x2c8fbd){var _0x591ff9=typeof _0x5bf069['offset']===_0xa682('0x13')&&typeof _0x5bf069[_0xa682('0x14')]===_0xa682('0x13');var _0x5a5613=_0x2c8fbd['count'];var _0x4e8ad2=_0x591ff9?0x0:_0x5bf069[_0xa682('0x15')];var _0x3739e5=_0x591ff9?_0x2c8fbd[_0xa682('0x16')]:_0x5bf069['offset']+_0x5bf069[_0xa682('0x14')];var _0x294bbe;if(_0x3739e5>=_0x5a5613){_0x3739e5=_0x5a5613;_0x294bbe=0xc8;}else{_0x294bbe=0xce;}_0x79ff9c[_0xa682('0x11')](_0x294bbe);return _0x79ff9c[_0xa682('0x17')](_0xa682('0x18'),_0x4e8ad2+'-'+_0x3739e5+'/'+_0x5a5613)[_0xa682('0x12')](_0x2c8fbd);}return null;};}function saveUpdates(_0x5da3b8){return function(_0x50d491){if(_0x50d491){return _0x50d491[_0xa682('0x19')](_0x5da3b8)[_0xa682('0x1a')](function(_0x3220a9){return _0x3220a9;});}return null;};}function removeEntity(_0x4eafbc){return function(_0x4fcb71){if(_0x4fcb71){return _0x4fcb71[_0xa682('0x1b')]()[_0xa682('0x1a')](function(){_0x4eafbc[_0xa682('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x379869){return function(_0x363f6c){if(!_0x363f6c){_0x379869['sendStatus'](0x194);}return _0x363f6c;};}function handleError(_0x2d07c8,_0x27773d){_0x27773d=_0x27773d||0x1f4;return function(_0x5833f3){logger[_0xa682('0x1c')](_0x5833f3[_0xa682('0x1d')]);if(_0x5833f3[_0xa682('0x1e')]){delete _0x5833f3[_0xa682('0x1e')];}_0x2d07c8[_0xa682('0x11')](_0x27773d)[_0xa682('0x1f')](_0x5833f3);};}exports[_0xa682('0x20')]=function(_0x1be52e,_0x1473e0){var _0x2b8fe4={};var _0x273ca3=_[_0xa682('0x21')](db['WhatsappInteraction'][_0xa682('0x22')],function(_0x1c3fd1){return{'name':_0x1c3fd1[_0xa682('0x23')],'type':_0x1c3fd1[_0xa682('0x24')][_0xa682('0x25')]};});_0x2b8fe4=qs[_0xa682('0x26')](_0x273ca3,_0x1be52e);return interaction[_0xa682('0x27')]('whatsapp',_0x1be52e['query'],_0x1be52e[_0xa682('0x28')],_0x2b8fe4,_0x273ca3)['then'](respondWithFilteredResult(_0x1473e0,_0x2b8fe4))['catch'](handleError(_0x1473e0,null));};exports[_0xa682('0x29')]=function(_0x212a74,_0x111676){var _0xca02ea={'raw':![],'where':{'id':_0x212a74[_0xa682('0x2a')]['id']}},_0x515199={};_0x515199['model']=_[_0xa682('0x2b')](db[_0xa682('0x2c')][_0xa682('0x22')]);_0x515199[_0xa682('0x2d')]=_[_0xa682('0x2b')](_0x212a74[_0xa682('0x2d')]);_0x515199[_0xa682('0x2e')]=_['intersection'](_0x515199[_0xa682('0x2f')],_0x515199[_0xa682('0x2d')]);_0xca02ea[_0xa682('0x30')]=_[_0xa682('0x31')](_0x515199[_0xa682('0x2f')],qs[_0xa682('0x32')](_0x212a74[_0xa682('0x2d')][_0xa682('0x32')]));_0xca02ea['attributes']=_0xca02ea[_0xa682('0x30')][_0xa682('0x33')]?_0xca02ea['attributes']:_0x515199[_0xa682('0x2f')];if(_0x212a74[_0xa682('0x2d')]['includeAll']){_0xca02ea[_0xa682('0x34')]=[{'all':!![]}];}_0xca02ea=_[_0xa682('0x35')]({},_0xca02ea,_0x212a74[_0xa682('0x36')]);return db[_0xa682('0x2c')]['find'](_0xca02ea)[_0xa682('0x1a')](handleEntityNotFound(_0x111676,null))[_0xa682('0x1a')](respondWithResult(_0x111676,null))[_0xa682('0x37')](handleError(_0x111676,null));};exports['create']=function(_0x597f19,_0x514441){return db[_0xa682('0x2c')][_0xa682('0x38')](_0x597f19['body'],{})['then'](respondWithResult(_0x514441,0xc9))[_0xa682('0x37')](handleError(_0x514441,null));};exports[_0xa682('0x19')]=function(_0x40739f,_0x5f2152){if(_0x40739f[_0xa682('0x39')]['id']){delete _0x40739f[_0xa682('0x39')]['id'];}return db[_0xa682('0x2c')][_0xa682('0x3a')]({'where':{'id':_0x40739f[_0xa682('0x2a')]['id']}})[_0xa682('0x1a')](handleEntityNotFound(_0x5f2152,null))[_0xa682('0x1a')](saveUpdates(_0x40739f[_0xa682('0x39')],null))[_0xa682('0x1a')](respondWithResult(_0x5f2152,null))[_0xa682('0x37')](handleError(_0x5f2152,null));};exports[_0xa682('0x1b')]=function(_0x27d7bf,_0x4b6360){return db['WhatsappInteraction']['find']({'where':{'id':_0x27d7bf[_0xa682('0x2a')]['id']}})['then'](handleEntityNotFound(_0x4b6360,null))[_0xa682('0x1a')](removeEntity(_0x4b6360,null))['catch'](handleError(_0x4b6360,null));};exports['describe']=function(_0x5450e2,_0x1b20f1){return db[_0xa682('0x2c')]['describe']()['then'](respondWithResult(_0x1b20f1,null))[_0xa682('0x37')](handleError(_0x1b20f1,null));};exports['addMessage']=function(_0x5b095c,_0x35536a){return db[_0xa682('0x3b')][_0xa682('0x3a')]({'where':{'id':_0x5b095c[_0xa682('0x2a')]['id']}})[_0xa682('0x1a')](handleEntityNotFound(_0x35536a,null))['then'](function(_0x25635e){if(_0x25635e){return _0x25635e[_0xa682('0x3c')](_0x5b095c[_0xa682('0x39')]['ids'],_['omit'](_0x5b095c[_0xa682('0x39')],[_0xa682('0x3d'),'id'])||{});}})['then'](respondWithResult(_0x35536a,null))[_0xa682('0x37')](handleError(_0x35536a,null));};exports[_0xa682('0x3e')]=function(_0x2ee361,_0x12ae68){var _0xdea4b2={'raw':![],'where':{}};var _0x4a0cc4={};var _0x23e06b={'count':0x0,'rows':[]};return db[_0xa682('0x2c')][_0xa682('0x3f')]({'where':{'id':_0x2ee361[_0xa682('0x2a')]['id']}})[_0xa682('0x1a')](handleEntityNotFound(_0x12ae68,null))[_0xa682('0x1a')](function(_0x467ad2){if(_0x467ad2){_0x4a0cc4['model']=_['keys'](db[_0xa682('0x3b')][_0xa682('0x22')]);_0x4a0cc4[_0xa682('0x2d')]=_[_0xa682('0x2b')](_0x2ee361['query']);_0x4a0cc4['filters']=_[_0xa682('0x31')](_0x4a0cc4[_0xa682('0x2f')],_0x4a0cc4[_0xa682('0x2d')]);_0xdea4b2['attributes']=_['intersection'](_0x4a0cc4[_0xa682('0x2f')],qs['fields'](_0x2ee361['query'][_0xa682('0x32')]));_0xdea4b2[_0xa682('0x30')]=_0xdea4b2[_0xa682('0x30')]['length']?_0xdea4b2['attributes']:_0x4a0cc4[_0xa682('0x2f')];if(!_0x2ee361['query'][_0xa682('0x40')]('nolimit')){_0xdea4b2[_0xa682('0x14')]=qs['limit'](_0x2ee361[_0xa682('0x2d')][_0xa682('0x14')]);_0xdea4b2['offset']=qs['offset'](_0x2ee361[_0xa682('0x2d')][_0xa682('0x15')]);}_0xdea4b2[_0xa682('0x41')]=qs[_0xa682('0x42')](_0x2ee361['query'][_0xa682('0x42')]);_0xdea4b2[_0xa682('0x43')]=qs[_0xa682('0x2e')](_['pick'](_0x2ee361['query'],_0x4a0cc4[_0xa682('0x2e')]));_0xdea4b2['where'][_0xa682('0x44')]=_0x467ad2['id'];if(_0x2ee361[_0xa682('0x2d')][_0xa682('0x45')]){_0xdea4b2[_0xa682('0x43')]=_[_0xa682('0x35')](_0xdea4b2[_0xa682('0x43')],{'$or':_[_0xa682('0x21')](_0xdea4b2[_0xa682('0x30')],function(_0x3ae446){var _0x54d959={};_0x54d959[_0x3ae446]={'$like':'%'+_0x2ee361[_0xa682('0x2d')][_0xa682('0x45')]+'%'};return _0x54d959;})});}if(_0x2ee361[_0xa682('0x2d')]['$gte']){var _0x134f64=_0x2ee361[_0xa682('0x2d')][_0xa682('0x46')][_0xa682('0x47')](',');var _0x8b6d68={};_0x8b6d68[_0x134f64[0x0]]={'$gte':moment(_0x134f64[0x1])[_0xa682('0x48')](_0xa682('0x49'))};_0xdea4b2[_0xa682('0x43')]=_[_0xa682('0x35')](_0xdea4b2[_0xa682('0x43')],_0x8b6d68);}_0xdea4b2=_[_0xa682('0x35')]({},_0xdea4b2,_0x2ee361[_0xa682('0x36')]);return db['WhatsappMessage'][_0xa682('0x16')]({'where':_0xdea4b2[_0xa682('0x43')]})['then'](function(_0x36b5fc){_0x23e06b[_0xa682('0x16')]=_0x36b5fc;if(_0x2ee361[_0xa682('0x2d')][_0xa682('0x4a')]){_0xdea4b2[_0xa682('0x34')]=[{'all':!![]}];}return db[_0xa682('0x3b')]['findAll'](_0xdea4b2);})[_0xa682('0x1a')](function(_0x14baab){_0x23e06b['rows']=_0x14baab;return _0x23e06b;});}})['then'](respondWithFilteredResult(_0x12ae68,_0xdea4b2))[_0xa682('0x37')](handleError(_0x12ae68,null));};exports[_0xa682('0x4b')]=function(_0x274602,_0x515a1b){return db[_0xa682('0x2c')][_0xa682('0x3a')]({'where':{'id':_0x274602[_0xa682('0x2a')]['id']}})['then'](handleEntityNotFound(_0x515a1b,null))['then'](function(_0x58f1b3){if(_0x58f1b3){return _0x58f1b3[_0xa682('0x4c')](_0x274602[_0xa682('0x39')][_0xa682('0x3d')],_[_0xa682('0x4d')](_0x274602[_0xa682('0x39')],['ids','id'])||{})['spread'](function(){return db[_0xa682('0x4e')][_0xa682('0x27')]({'attributes':['id',_0xa682('0x1e'),_0xa682('0x4f')],'where':{'id':_0x274602['body'][_0xa682('0x3d')]}});})[_0xa682('0x1a')](function(_0x23ec6c){socket[_0xa682('0x50')](_0xa682('0x51'),{'id':Number(_0x274602['params']['id']),'tags':_0x23ec6c||[]});return{'id':Number(_0x274602[_0xa682('0x2a')]['id']),'tags':_0x23ec6c||[]};});}})[_0xa682('0x1a')](respondWithResult(_0x515a1b,null))[_0xa682('0x37')](handleError(_0x515a1b,null));};exports[_0xa682('0x52')]=function(_0x4beea6,_0x23cf0d){return db['WhatsappInteraction'][_0xa682('0x3a')]({'where':{'id':_0x4beea6['params']['id']}})[_0xa682('0x1a')](handleEntityNotFound(_0x23cf0d,null))[_0xa682('0x1a')](function(_0x429ef1){if(_0x429ef1){return _0x429ef1['removeTags'](_0x4beea6[_0xa682('0x2d')]['ids']);}})['then'](respondWithStatusCode(_0x23cf0d,null))[_0xa682('0x37')](handleError(_0x23cf0d,null));};exports['download']=function(_0x41824c,_0xf8a952){var _0x524ed7=moment()['unix']()[_0xa682('0x53')]();var _0x36764d=path[_0xa682('0x54')](config[_0xa682('0x55')],_0xa682('0x56'),'files',_0xa682('0x57'));var _0x36c9e2=path['join'](config[_0xa682('0x55')],'server',_0xa682('0x58'),_0xa682('0x59'));var _0x4dcb60=path[_0xa682('0x54')](_0x36764d,_0x524ed7);var _0x3c28e0=util[_0xa682('0x48')](_0xa682('0x5a'),_0x41824c['params']['id'],_0x524ed7);var _0xfad96a=path['join'](_0x36764d,_0x3c28e0);var _0x2c3201=[];_0x2c3201[_0xa682('0x5b')]({'model':db['User'],'as':_0xa682('0x5c'),'attributes':['id','fullname'],'raw':!![]});_0x2c3201['push']({'model':db['CmContact'],'as':_0xa682('0x5d'),'attributes':['id',_0xa682('0x5e'),'lastName'],'raw':!![]});if(_0x41824c[_0xa682('0x2d')]['attachments']){_0x2c3201[_0xa682('0x5b')]({'model':db[_0xa682('0x5f')],'as':_0xa682('0x5f'),'raw':!![]});}var _0x2f4ec6=[{'model':db[_0xa682('0x3b')],'as':_0xa682('0x60'),'attributes':['id',_0xa682('0x39'),_0xa682('0x61'),_0xa682('0x62'),_0xa682('0x63'),'read'],'include':_0x2c3201}];_0x2f4ec6[_0xa682('0x5b')]({'model':db[_0xa682('0x64')],'as':_0xa682('0x65'),'attributes':['id','name']});_0x2f4ec6['push']({'model':db[_0xa682('0x5c')],'as':'Owner','attributes':['id',_0xa682('0x66')]});return db[_0xa682('0x2c')][_0xa682('0x3a')]({'where':{'id':_0x41824c[_0xa682('0x2a')]['id']},'include':_0x2f4ec6})[_0xa682('0x1a')](handleEntityNotFound(_0xf8a952,null))[_0xa682('0x1a')](function(_0x138726){if(_0x138726){var _0x4a7568=_0x138726[_0xa682('0x67')]({'plain':!![]});fs[_0xa682('0x68')](_0x4dcb60);var _0x277285={'channel':_0xa682('0x69'),'account':_0x4a7568[_0xa682('0x65')][_0xa682('0x1e')],'agent':_0x4a7568[_0xa682('0x6a')]?_0x4a7568[_0xa682('0x6a')]['fullname']:_0xa682('0x6b'),'createdAt':moment(_0x4a7568[_0xa682('0x61')])[_0xa682('0x48')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa682('0x53')](),'closedAt':_0x4a7568[_0xa682('0x6c')]?moment(_0x4a7568[_0xa682('0x6d')])[_0xa682('0x48')](_0xa682('0x49'))[_0xa682('0x53')]():'','disposition':_0x4a7568['disposition'],'messages':_(_0x4a7568[_0xa682('0x60')])[_0xa682('0x45')]({'secret':![]})[_0xa682('0x21')](function(_0xbf0fdc){if(_0xbf0fdc[_0xa682('0x5f')]){var _0x40fa73=path['join'](_0x36c9e2,_0xbf0fdc[_0xa682('0x5f')]['basename']);if(fs[_0xa682('0x6e')](_0x40fa73)){fs[_0xa682('0x6f')](_0x40fa73)[_0xa682('0x70')](fs['createWriteStream'](path[_0xa682('0x54')](_0x4dcb60,_0xbf0fdc['Attachment'][_0xa682('0x71')])));}}return{'date':moment(_0xbf0fdc[_0xa682('0x61')])['format'](_0xa682('0x49'))[_0xa682('0x53')](),'sender':_0xbf0fdc[_0xa682('0x62')]===_0xa682('0x72')?_0xbf0fdc[_0xa682('0x5c')]?_0xbf0fdc[_0xa682('0x5c')][_0xa682('0x66')]:'System':_0xbf0fdc[_0xa682('0x5d')][_0xa682('0x5e')]+(_0xbf0fdc['Contact']['lastName']?'\x20'+_0xbf0fdc[_0xa682('0x5d')][_0xa682('0x73')]:''),'body':_0xbf0fdc[_0xa682('0x5f')]?_0xbf0fdc[_0xa682('0x5f')][_0xa682('0x71')]:_0xbf0fdc[_0xa682('0x39')],'direction':_0xbf0fdc[_0xa682('0x62')]==='out'?'A':'C','secret':_0xbf0fdc[_0xa682('0x63')],'read':_0xbf0fdc[_0xa682('0x74')],'attachment':_0xbf0fdc[_0xa682('0x5f')]};})[_0xa682('0x75')]()};return ejs[_0xa682('0x76')](path[_0xa682('0x54')](config[_0xa682('0x55')],_0xa682('0x56'),_0xa682('0x77'),_0xa682('0x78')),{'interaction':_0x277285})[_0xa682('0x1a')](function(_0x2134d8){var _0x516036=path['join'](_0x4dcb60,_0xa682('0x79')+_0x4a7568['id']+'-'+_0x524ed7+_0xa682('0x7a'));var _0x32562e={'path':_0x516036,'channel':_0xa682('0x69'),'interactionId':_0x4a7568['id']};return pdf['createPdfFromHTML'](_0x2134d8,_0x32562e);})['then'](function(){return new BPromise(function(_0x47d80a,_0x552513){zipdir(_0x4dcb60,{'saveTo':_0xfad96a},function(_0x142c10,_0x991830){if(_0x142c10)return _0x552513(_0x142c10);return _0x47d80a(_0x991830);});})[_0xa682('0x1a')](function(){return new BPromise(function(_0x3ff3f1,_0x3f6d35){rimraf(_0x4dcb60,function(_0xfc05d6){if(_0xfc05d6)_0x3f6d35(_0xfc05d6);return _0x3ff3f1();});});})[_0xa682('0x1a')](function(){return _0xf8a952[_0xa682('0x7b')](_0xfad96a,_0x3c28e0,function(_0x277c31){if(_0x277c31){console[_0xa682('0x7c')](_0xa682('0x7d'),_0x277c31);}else{fs[_0xa682('0x7e')](_0xfad96a);}});});});}else{return _0xf8a952[_0xa682('0x7f')](0xc8);}})[_0xa682('0x37')](handleError(_0xf8a952,null));};
\ No newline at end of file
+var _0xf2bd=['push','Attachment','Messages','createdAt','direction','secret','read','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','existsSync','pipe','createWriteStream','out','System','lastName','basename','value','server','views','downloadInteraction.ejs','transcript-','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','whatsapp','query','user','catch','show','params','model','keys','WhatsappInteraction','fields','attributes','length','includeAll','include','merge','options','find','create','body','addMessage','WhatsappMessage','ids','omit','findOne','intersection','hasOwnProperty','nolimit','order','sort','where','filters','WhatsappInteractionId','filter','$gte','split','rows','spread','removeTags','download','toString','root','files','join','attachments','format','transcript-%d-%s.zip','User','fullname','CmContact','Contact','firstName'];(function(_0x965817,_0x4fe0d4){var _0x1fdbe6=function(_0x966903){while(--_0x966903){_0x965817['push'](_0x965817['shift']());}};_0x1fdbe6(++_0x4fe0d4);}(_0xf2bd,0x118));var _0xdf2b=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xf2bd[_0x138adb];return _0x1b27f2;};'use strict';var rimraf=require(_0xdf2b('0x0'));var zipdir=require(_0xdf2b('0x1'));var moment=require(_0xdf2b('0x2'));var BPromise=require(_0xdf2b('0x3'));var util=require(_0xdf2b('0x4'));var path=require('path');var ejs=require(_0xdf2b('0x5'));var fs=require('fs');var _=require(_0xdf2b('0x6'));var Redis=require(_0xdf2b('0x7'));var interaction=require(_0xdf2b('0x8'));var qs=require(_0xdf2b('0x9'));var pdf=require(_0xdf2b('0xa'));var logger=require(_0xdf2b('0xb'))('api');var config=require(_0xdf2b('0xc'));var db=require('../../mysqldb')['db'];config[_0xdf2b('0xd')]=_[_0xdf2b('0xe')](config['redis'],{'host':_0xdf2b('0xf'),'port':0x18eb});var socket=require(_0xdf2b('0x10'))(new Redis(config[_0xdf2b('0xd')]));require(_0xdf2b('0x11'))['register'](socket);function respondWithStatusCode(_0x390eff,_0x213713){_0x213713=_0x213713||0xcc;return function(_0x2ca645){if(_0x2ca645){return _0x390eff[_0xdf2b('0x12')](_0x213713);}return _0x390eff[_0xdf2b('0x13')](_0x213713)[_0xdf2b('0x14')]();};}function respondWithResult(_0x42d164,_0x499987){_0x499987=_0x499987||0xc8;return function(_0x4da377){if(_0x4da377){return _0x42d164['status'](_0x499987)[_0xdf2b('0x15')](_0x4da377);}};}function respondWithFilteredResult(_0x42cc56,_0x5773bd){return function(_0x77371){if(_0x77371){var _0x3906eb=typeof _0x5773bd[_0xdf2b('0x16')]===_0xdf2b('0x17')&&typeof _0x5773bd[_0xdf2b('0x18')]===_0xdf2b('0x17');var _0x5cb3f4=_0x77371[_0xdf2b('0x19')];var _0x543ede=_0x3906eb?0x0:_0x5773bd['offset'];var _0x1e35f9=_0x3906eb?_0x77371[_0xdf2b('0x19')]:_0x5773bd['offset']+_0x5773bd[_0xdf2b('0x18')];var _0x3db618;if(_0x1e35f9>=_0x5cb3f4){_0x1e35f9=_0x5cb3f4;_0x3db618=0xc8;}else{_0x3db618=0xce;}_0x42cc56['status'](_0x3db618);return _0x42cc56['set'](_0xdf2b('0x1a'),_0x543ede+'-'+_0x1e35f9+'/'+_0x5cb3f4)[_0xdf2b('0x15')](_0x77371);}return null;};}function saveUpdates(_0x8e2903){return function(_0x17fd12){if(_0x17fd12){return _0x17fd12[_0xdf2b('0x1b')](_0x8e2903)[_0xdf2b('0x1c')](function(_0x50f78b){return _0x50f78b;});}return null;};}function removeEntity(_0x3aaf31){return function(_0x3cf3a5){if(_0x3cf3a5){return _0x3cf3a5[_0xdf2b('0x1d')]()[_0xdf2b('0x1c')](function(){_0x3aaf31[_0xdf2b('0x13')](0xcc)[_0xdf2b('0x14')]();});}};}function handleEntityNotFound(_0x4271a1){return function(_0x17ce3a){if(!_0x17ce3a){_0x4271a1[_0xdf2b('0x12')](0x194);}return _0x17ce3a;};}function handleError(_0x42ff18,_0x5bfde2){_0x5bfde2=_0x5bfde2||0x1f4;return function(_0x5e1777){logger[_0xdf2b('0x1e')](_0x5e1777[_0xdf2b('0x1f')]);if(_0x5e1777[_0xdf2b('0x20')]){delete _0x5e1777[_0xdf2b('0x20')];}_0x42ff18['status'](_0x5bfde2)['send'](_0x5e1777);};}exports[_0xdf2b('0x21')]=function(_0x1cd19a,_0x55c97a){var _0x259a1a={};var _0x3ee421=_[_0xdf2b('0x22')](db['WhatsappInteraction'][_0xdf2b('0x23')],function(_0x222dc9){return{'name':_0x222dc9[_0xdf2b('0x24')],'type':_0x222dc9[_0xdf2b('0x25')][_0xdf2b('0x26')]};});_0x259a1a=qs[_0xdf2b('0x27')](_0x3ee421,_0x1cd19a);return interaction[_0xdf2b('0x28')](_0xdf2b('0x29'),_0x1cd19a[_0xdf2b('0x2a')],_0x1cd19a[_0xdf2b('0x2b')],_0x259a1a,_0x3ee421)[_0xdf2b('0x1c')](respondWithFilteredResult(_0x55c97a,_0x259a1a))[_0xdf2b('0x2c')](handleError(_0x55c97a,null));};exports[_0xdf2b('0x2d')]=function(_0x5956a0,_0x28f357){var _0x719eb8={'raw':![],'where':{'id':_0x5956a0[_0xdf2b('0x2e')]['id']}},_0xd469c={};_0xd469c[_0xdf2b('0x2f')]=_[_0xdf2b('0x30')](db[_0xdf2b('0x31')][_0xdf2b('0x23')]);_0xd469c[_0xdf2b('0x2a')]=_[_0xdf2b('0x30')](_0x5956a0['query']);_0xd469c['filters']=_['intersection'](_0xd469c['model'],_0xd469c[_0xdf2b('0x2a')]);_0x719eb8['attributes']=_['intersection'](_0xd469c[_0xdf2b('0x2f')],qs[_0xdf2b('0x32')](_0x5956a0[_0xdf2b('0x2a')][_0xdf2b('0x32')]));_0x719eb8['attributes']=_0x719eb8[_0xdf2b('0x33')][_0xdf2b('0x34')]?_0x719eb8[_0xdf2b('0x33')]:_0xd469c[_0xdf2b('0x2f')];if(_0x5956a0['query'][_0xdf2b('0x35')]){_0x719eb8[_0xdf2b('0x36')]=[{'all':!![]}];}_0x719eb8=_[_0xdf2b('0x37')]({},_0x719eb8,_0x5956a0[_0xdf2b('0x38')]);return db[_0xdf2b('0x31')][_0xdf2b('0x39')](_0x719eb8)[_0xdf2b('0x1c')](handleEntityNotFound(_0x28f357,null))[_0xdf2b('0x1c')](respondWithResult(_0x28f357,null))[_0xdf2b('0x2c')](handleError(_0x28f357,null));};exports[_0xdf2b('0x3a')]=function(_0x586847,_0x3b02ac){return db[_0xdf2b('0x31')]['create'](_0x586847[_0xdf2b('0x3b')],{})[_0xdf2b('0x1c')](respondWithResult(_0x3b02ac,0xc9))[_0xdf2b('0x2c')](handleError(_0x3b02ac,null));};exports[_0xdf2b('0x1b')]=function(_0x1923a7,_0x881647){if(_0x1923a7['body']['id']){delete _0x1923a7[_0xdf2b('0x3b')]['id'];}return db[_0xdf2b('0x31')][_0xdf2b('0x39')]({'where':{'id':_0x1923a7[_0xdf2b('0x2e')]['id']}})['then'](handleEntityNotFound(_0x881647,null))['then'](saveUpdates(_0x1923a7['body'],null))[_0xdf2b('0x1c')](respondWithResult(_0x881647,null))['catch'](handleError(_0x881647,null));};exports[_0xdf2b('0x1d')]=function(_0x513c74,_0x4f24e2){return db[_0xdf2b('0x31')]['find']({'where':{'id':_0x513c74[_0xdf2b('0x2e')]['id']}})[_0xdf2b('0x1c')](handleEntityNotFound(_0x4f24e2,null))[_0xdf2b('0x1c')](removeEntity(_0x4f24e2,null))[_0xdf2b('0x2c')](handleError(_0x4f24e2,null));};exports['describe']=function(_0x433ce3,_0x304c31){return db[_0xdf2b('0x31')]['describe']()[_0xdf2b('0x1c')](respondWithResult(_0x304c31,null))[_0xdf2b('0x2c')](handleError(_0x304c31,null));};exports[_0xdf2b('0x3c')]=function(_0x4712cc,_0x7d7dbf){return db[_0xdf2b('0x3d')]['find']({'where':{'id':_0x4712cc[_0xdf2b('0x2e')]['id']}})[_0xdf2b('0x1c')](handleEntityNotFound(_0x7d7dbf,null))[_0xdf2b('0x1c')](function(_0x24a0bf){if(_0x24a0bf){return _0x24a0bf[_0xdf2b('0x3c')](_0x4712cc['body'][_0xdf2b('0x3e')],_[_0xdf2b('0x3f')](_0x4712cc[_0xdf2b('0x3b')],[_0xdf2b('0x3e'),'id'])||{});}})[_0xdf2b('0x1c')](respondWithResult(_0x7d7dbf,null))[_0xdf2b('0x2c')](handleError(_0x7d7dbf,null));};exports['getMessages']=function(_0x1eb3ed,_0x210a3c){var _0x46266d={'raw':![],'where':{}};var _0x2f8416={};var _0x30b254={'count':0x0,'rows':[]};return db[_0xdf2b('0x31')][_0xdf2b('0x40')]({'where':{'id':_0x1eb3ed[_0xdf2b('0x2e')]['id']}})[_0xdf2b('0x1c')](handleEntityNotFound(_0x210a3c,null))['then'](function(_0x59a827){if(_0x59a827){_0x2f8416['model']=_[_0xdf2b('0x30')](db[_0xdf2b('0x3d')]['rawAttributes']);_0x2f8416[_0xdf2b('0x2a')]=_[_0xdf2b('0x30')](_0x1eb3ed[_0xdf2b('0x2a')]);_0x2f8416['filters']=_[_0xdf2b('0x41')](_0x2f8416['model'],_0x2f8416['query']);_0x46266d[_0xdf2b('0x33')]=_['intersection'](_0x2f8416[_0xdf2b('0x2f')],qs['fields'](_0x1eb3ed[_0xdf2b('0x2a')]['fields']));_0x46266d[_0xdf2b('0x33')]=_0x46266d[_0xdf2b('0x33')]['length']?_0x46266d['attributes']:_0x2f8416[_0xdf2b('0x2f')];if(!_0x1eb3ed[_0xdf2b('0x2a')][_0xdf2b('0x42')](_0xdf2b('0x43'))){_0x46266d['limit']=qs[_0xdf2b('0x18')](_0x1eb3ed['query']['limit']);_0x46266d[_0xdf2b('0x16')]=qs['offset'](_0x1eb3ed[_0xdf2b('0x2a')][_0xdf2b('0x16')]);}_0x46266d[_0xdf2b('0x44')]=qs[_0xdf2b('0x45')](_0x1eb3ed[_0xdf2b('0x2a')]['sort']);_0x46266d[_0xdf2b('0x46')]=qs[_0xdf2b('0x47')](_['pick'](_0x1eb3ed[_0xdf2b('0x2a')],_0x2f8416[_0xdf2b('0x47')]));_0x46266d[_0xdf2b('0x46')][_0xdf2b('0x48')]=_0x59a827['id'];if(_0x1eb3ed[_0xdf2b('0x2a')][_0xdf2b('0x49')]){_0x46266d[_0xdf2b('0x46')]=_[_0xdf2b('0x37')](_0x46266d[_0xdf2b('0x46')],{'$or':_[_0xdf2b('0x22')](_0x46266d[_0xdf2b('0x33')],function(_0x1874f3){var _0x46a0f0={};_0x46a0f0[_0x1874f3]={'$like':'%'+_0x1eb3ed[_0xdf2b('0x2a')][_0xdf2b('0x49')]+'%'};return _0x46a0f0;})});}if(_0x1eb3ed[_0xdf2b('0x2a')]['$gte']){var _0x3f388c=_0x1eb3ed[_0xdf2b('0x2a')][_0xdf2b('0x4a')][_0xdf2b('0x4b')](',');var _0x412749={};_0x412749[_0x3f388c[0x0]]={'$gte':moment(_0x3f388c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x46266d[_0xdf2b('0x46')]=_[_0xdf2b('0x37')](_0x46266d[_0xdf2b('0x46')],_0x412749);}_0x46266d=_[_0xdf2b('0x37')]({},_0x46266d,_0x1eb3ed[_0xdf2b('0x38')]);return db['WhatsappMessage'][_0xdf2b('0x19')]({'where':_0x46266d[_0xdf2b('0x46')]})[_0xdf2b('0x1c')](function(_0x59ac83){_0x30b254[_0xdf2b('0x19')]=_0x59ac83;if(_0x1eb3ed[_0xdf2b('0x2a')]['includeAll']){_0x46266d[_0xdf2b('0x36')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xdf2b('0x28')](_0x46266d);})[_0xdf2b('0x1c')](function(_0x38c94e){_0x30b254[_0xdf2b('0x4c')]=_0x38c94e;return _0x30b254;});}})['then'](respondWithFilteredResult(_0x210a3c,_0x46266d))[_0xdf2b('0x2c')](handleError(_0x210a3c,null));};exports['addTags']=function(_0x2a4dca,_0x5e17c8){return db[_0xdf2b('0x31')][_0xdf2b('0x39')]({'where':{'id':_0x2a4dca['params']['id']}})[_0xdf2b('0x1c')](handleEntityNotFound(_0x5e17c8,null))['then'](function(_0x440897){if(_0x440897){return _0x440897['setTags'](_0x2a4dca[_0xdf2b('0x3b')][_0xdf2b('0x3e')],_['omit'](_0x2a4dca[_0xdf2b('0x3b')],[_0xdf2b('0x3e'),'id'])||{})[_0xdf2b('0x4d')](function(){return db['Tag'][_0xdf2b('0x28')]({'attributes':['id',_0xdf2b('0x20'),'color'],'where':{'id':_0x2a4dca[_0xdf2b('0x3b')]['ids']}});})[_0xdf2b('0x1c')](function(_0x33d010){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x2a4dca['params']['id']),'tags':_0x33d010||[]});return{'id':Number(_0x2a4dca['params']['id']),'tags':_0x33d010||[]};});}})[_0xdf2b('0x1c')](respondWithResult(_0x5e17c8,null))[_0xdf2b('0x2c')](handleError(_0x5e17c8,null));};exports[_0xdf2b('0x4e')]=function(_0x167fbc,_0x308b33){return db[_0xdf2b('0x31')]['find']({'where':{'id':_0x167fbc['params']['id']}})[_0xdf2b('0x1c')](handleEntityNotFound(_0x308b33,null))['then'](function(_0x1be2bb){if(_0x1be2bb){return _0x1be2bb[_0xdf2b('0x4e')](_0x167fbc[_0xdf2b('0x2a')]['ids']);}})[_0xdf2b('0x1c')](respondWithStatusCode(_0x308b33,null))[_0xdf2b('0x2c')](handleError(_0x308b33,null));};exports[_0xdf2b('0x4f')]=function(_0x1ac506,_0x574cef){var _0x31f6f1=moment()['unix']()[_0xdf2b('0x50')]();var _0x4a5d12=path['join'](config[_0xdf2b('0x51')],'server',_0xdf2b('0x52'),'tmp');var _0x1217e1=path[_0xdf2b('0x53')](config[_0xdf2b('0x51')],'server',_0xdf2b('0x52'),_0xdf2b('0x54'));var _0x7a3859=path[_0xdf2b('0x53')](_0x4a5d12,_0x31f6f1);var _0x2b4ea7=util[_0xdf2b('0x55')](_0xdf2b('0x56'),_0x1ac506[_0xdf2b('0x2e')]['id'],_0x31f6f1);var _0x145ad8=path[_0xdf2b('0x53')](_0x4a5d12,_0x2b4ea7);var _0x27c916=[];_0x27c916['push']({'model':db['User'],'as':_0xdf2b('0x57'),'attributes':['id',_0xdf2b('0x58')],'raw':!![]});_0x27c916['push']({'model':db[_0xdf2b('0x59')],'as':_0xdf2b('0x5a'),'attributes':['id',_0xdf2b('0x5b'),'lastName'],'raw':!![]});if(_0x1ac506[_0xdf2b('0x2a')][_0xdf2b('0x54')]){_0x27c916[_0xdf2b('0x5c')]({'model':db[_0xdf2b('0x5d')],'as':_0xdf2b('0x5d'),'raw':!![]});}var _0x3febd7=[{'model':db[_0xdf2b('0x3d')],'as':_0xdf2b('0x5e'),'attributes':['id',_0xdf2b('0x3b'),_0xdf2b('0x5f'),_0xdf2b('0x60'),_0xdf2b('0x61'),_0xdf2b('0x62')],'include':_0x27c916}];_0x3febd7[_0xdf2b('0x5c')]({'model':db['WhatsappAccount'],'as':_0xdf2b('0x63'),'attributes':['id',_0xdf2b('0x20')]});_0x3febd7[_0xdf2b('0x5c')]({'model':db['User'],'as':_0xdf2b('0x64'),'attributes':['id',_0xdf2b('0x58')]});return db[_0xdf2b('0x31')][_0xdf2b('0x39')]({'where':{'id':_0x1ac506['params']['id']},'include':_0x3febd7})[_0xdf2b('0x1c')](handleEntityNotFound(_0x574cef,null))[_0xdf2b('0x1c')](function(_0x386cd4){if(_0x386cd4){var _0x52f181=_0x386cd4[_0xdf2b('0x65')]({'plain':!![]});fs[_0xdf2b('0x66')](_0x7a3859);var _0x40c421={'channel':_0xdf2b('0x67'),'account':_0x52f181[_0xdf2b('0x63')][_0xdf2b('0x20')],'agent':_0x52f181[_0xdf2b('0x64')]?_0x52f181['Owner'][_0xdf2b('0x58')]:_0xdf2b('0x68'),'createdAt':moment(_0x52f181['createdAt'])[_0xdf2b('0x55')](_0xdf2b('0x69'))[_0xdf2b('0x50')](),'closedAt':_0x52f181[_0xdf2b('0x6a')]?moment(_0x52f181[_0xdf2b('0x6b')])[_0xdf2b('0x55')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdf2b('0x50')]():'','disposition':_0x52f181[_0xdf2b('0x6c')],'messages':_(_0x52f181[_0xdf2b('0x5e')])[_0xdf2b('0x49')]({'secret':![]})[_0xdf2b('0x22')](function(_0x1684d4){if(_0x1684d4[_0xdf2b('0x5d')]){var _0x109da4=path[_0xdf2b('0x53')](_0x1217e1,_0x1684d4[_0xdf2b('0x5d')]['basename']);if(fs[_0xdf2b('0x6d')](_0x109da4)){fs['createReadStream'](_0x109da4)[_0xdf2b('0x6e')](fs[_0xdf2b('0x6f')](path[_0xdf2b('0x53')](_0x7a3859,_0x1684d4[_0xdf2b('0x5d')]['basename'])));}}return{'date':moment(_0x1684d4[_0xdf2b('0x5f')])['format'](_0xdf2b('0x69'))[_0xdf2b('0x50')](),'sender':_0x1684d4[_0xdf2b('0x60')]===_0xdf2b('0x70')?_0x1684d4['User']?_0x1684d4[_0xdf2b('0x57')][_0xdf2b('0x58')]:_0xdf2b('0x71'):_0x1684d4['Contact'][_0xdf2b('0x5b')]+(_0x1684d4[_0xdf2b('0x5a')][_0xdf2b('0x72')]?'\x20'+_0x1684d4['Contact'][_0xdf2b('0x72')]:''),'body':_0x1684d4[_0xdf2b('0x5d')]?_0x1684d4['Attachment'][_0xdf2b('0x73')]:_0x1684d4[_0xdf2b('0x3b')],'direction':_0x1684d4[_0xdf2b('0x60')]===_0xdf2b('0x70')?'A':'C','secret':_0x1684d4[_0xdf2b('0x61')],'read':_0x1684d4[_0xdf2b('0x62')],'attachment':_0x1684d4['Attachment']};})[_0xdf2b('0x74')]()};return ejs['renderFile'](path[_0xdf2b('0x53')](config[_0xdf2b('0x51')],_0xdf2b('0x75'),_0xdf2b('0x76'),_0xdf2b('0x77')),{'interaction':_0x40c421})[_0xdf2b('0x1c')](function(_0x19dbb0){var _0x4c5cd1=path[_0xdf2b('0x53')](_0x7a3859,_0xdf2b('0x78')+_0x52f181['id']+'-'+_0x31f6f1+'.pdf');var _0x4657fb={'path':_0x4c5cd1,'channel':_0xdf2b('0x67'),'interactionId':_0x52f181['id']};return pdf['createPdfFromHTML'](_0x19dbb0,_0x4657fb);})[_0xdf2b('0x1c')](function(){return new BPromise(function(_0x102663,_0x4c67e3){zipdir(_0x7a3859,{'saveTo':_0x145ad8},function(_0x1363a7,_0x2b8fba){if(_0x1363a7)return _0x4c67e3(_0x1363a7);return _0x102663(_0x2b8fba);});})[_0xdf2b('0x1c')](function(){return new BPromise(function(_0x4231c0,_0x263342){rimraf(_0x7a3859,function(_0x4895bf){if(_0x4895bf)_0x263342(_0x4895bf);return _0x4231c0();});});})['then'](function(){return _0x574cef[_0xdf2b('0x4f')](_0x145ad8,_0x2b4ea7,function(_0x5114b1){if(_0x5114b1){console[_0xdf2b('0x79')](_0xdf2b('0x7a'),_0x5114b1);}else{fs[_0xdf2b('0x7b')](_0x145ad8);}});});});}else{return _0x574cef['sendStatus'](0xc8);}})['catch'](handleError(_0x574cef,null));};
\ No newline at end of file
index b08bf13..02f6bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ea=['remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7ea,0x171));var _0xac7e=function(_0x4652f7,_0x4fa36f){_0x4652f7=_0x4652f7-0x0;var _0x12c928=_0xc7ea[_0x4652f7];return _0x12c928;};'use strict';var EventEmitter=require(_0xac7e('0x0'));var WhatsappInteraction=require(_0xac7e('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xac7e('0x1'))['db'][_0xac7e('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xac7e('0x3')](0x0);var events={'afterCreate':_0xac7e('0x4'),'afterUpdate':'update','afterDestroy':_0xac7e('0x5')};function emitEvent(_0x39bf60){return function(_0x1c15cf,_0x3ca05f,_0x26b1c5){_0x1c15cf[_0xac7e('0x6')]({'attributes':['id'],'raw':!![]})[_0xac7e('0x7')](function(_0x1aca29){_0x1c15cf[_0xac7e('0x8')](_0xac7e('0x9'),_0x1aca29['map'](function(_0x114e82){return{'id':_0x114e82['id']};}));return WhatsappMessage[_0xac7e('0xa')]({'where':{'WhatsappInteractionId':_0x1c15cf['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac7e('0x7')](function(_0x173b59){_0x1c15cf[_0xac7e('0x8')](_0xac7e('0xb'),_0x173b59[_0xac7e('0xc')]);WhatsappInteractionEvents[_0xac7e('0xd')](_0x39bf60+':'+_0x1c15cf['id'],_0x1c15cf);WhatsappInteractionEvents[_0xac7e('0xd')](_0x39bf60,_0x1c15cf);_0x26b1c5(null);})[_0xac7e('0xe')](_0x26b1c5(null));};}for(var e in events){if(events[_0xac7e('0xf')](e)){var event=events[e];WhatsappInteraction[_0xac7e('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xb74d=['hook','exports','events','WhatsappInteraction','WhatsappMessage','save','update','remove','Users','map','findAll','setDataValue','length','emit'];(function(_0x445fbc,_0x1a17f9){var _0x5762a9=function(_0xdb41b8){while(--_0xdb41b8){_0x445fbc['push'](_0x445fbc['shift']());}};_0x5762a9(++_0x1a17f9);}(_0xb74d,0x16e));var _0xdb74=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xb74d[_0x1fdb40];return _0x281f93;};'use strict';var EventEmitter=require(_0xdb74('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0xdb74('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0xdb74('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xdb74('0x3'),'afterUpdate':_0xdb74('0x4'),'afterDestroy':_0xdb74('0x5')};function emitEvent(_0x4b3b06){return function(_0x124167,_0x19b211,_0xd2d2f0){_0x124167['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xfc6f47){_0x124167['setDataValue'](_0xdb74('0x6'),_0xfc6f47[_0xdb74('0x7')](function(_0x47c4d6){return{'id':_0x47c4d6['id']};}));return WhatsappMessage[_0xdb74('0x8')]({'where':{'WhatsappInteractionId':_0x124167['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x1b7936){_0x124167[_0xdb74('0x9')]('unreadMessages',_0x1b7936[_0xdb74('0xa')]);WhatsappInteractionEvents[_0xdb74('0xb')](_0x4b3b06+':'+_0x124167['id'],_0x124167);WhatsappInteractionEvents[_0xdb74('0xb')](_0x4b3b06,_0x124167);_0xd2d2f0(null);})['catch'](_0xd2d2f0(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xdb74('0xc')](e,emitEvent(event));}}module[_0xdb74('0xd')]=WhatsappInteractionEvents;
\ No newline at end of file
index 4f1b43f..e64c60c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x929b=['format','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt'];(function(_0x4a8dca,_0x3c71dd){var _0x19f3a9=function(_0x5652ea){while(--_0x5652ea){_0x4a8dca['push'](_0x4a8dca['shift']());}};_0x19f3a9(++_0x3c71dd);}(_0x929b,0x1f2));var _0xb929=function(_0x2e9ded,_0x235e2b){_0x2e9ded=_0x2e9ded-0x0;var _0xc88a61=_0x929b[_0x2e9ded];return _0xc88a61;};'use strict';var _=require('lodash');var util=require(_0xb929('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb929('0x1'));var BPromise=require(_0xb929('0x2'));var rp=require(_0xb929('0x3'));var fs=require('fs');var path=require(_0xb929('0x4'));var rimraf=require(_0xb929('0x5'));var config=require(_0xb929('0x6'));var attributes=require(_0xb929('0x7'));module[_0xb929('0x8')]=function(_0x28d21f,_0x1b2c99){return _0x28d21f[_0xb929('0x9')](_0xb929('0xa'),attributes,{'tableName':_0xb929('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2d7dee,_0x4e5132,_0xd4ea98){if(_0x2d7dee[_0xb929('0xc')]('closed')){_0x2d7dee[_0xb929('0xd')]=moment()[_0xb929('0xe')](_0xb929('0xf'));}_0xd4ea98(null,_0x2d7dee);}}});};
\ No newline at end of file
+var _0x3134=['api','moment','bluebird','request-promise','path','./whatsappInteraction.attributes','exports','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0xa7ac78,_0x4305c2){var _0x450b5=function(_0x1ac832){while(--_0x1ac832){_0xa7ac78['push'](_0xa7ac78['shift']());}};_0x450b5(++_0x4305c2);}(_0x3134,0xdf));var _0x4313=function(_0x1332cd,_0x2ca797){_0x1332cd=_0x1332cd-0x0;var _0x4879b4=_0x3134[_0x1332cd];return _0x4879b4;};'use strict';var _=require(_0x4313('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4313('0x1'));var moment=require(_0x4313('0x2'));var BPromise=require(_0x4313('0x3'));var rp=require(_0x4313('0x4'));var fs=require('fs');var path=require(_0x4313('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4313('0x6'));module[_0x4313('0x7')]=function(_0x5045c9,_0x85b15c){return _0x5045c9['define']('WhatsappInteraction',attributes,{'tableName':_0x4313('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28a46d,_0x2a13ab,_0x16b5e7){if(_0x28a46d[_0x4313('0x9')](_0x4313('0xa'))){_0x28a46d[_0x4313('0xb')]=moment()[_0x4313('0xc')](_0x4313('0xd'));}_0x16b5e7(null,_0x28a46d);}}});};
\ No newline at end of file
index 1d42652..2150d39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x273e=['addTags','ids','omit','body','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./whatsappInteraction.socket','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','update','options','raw','where','attributes','limit','find'];(function(_0x82129b,_0x484ae9){var _0x2ae5dc=function(_0x299e34){while(--_0x299e34){_0x82129b['push'](_0x82129b['shift']());}};_0x2ae5dc(++_0x484ae9);}(_0x273e,0x1f1));var _0xe273=function(_0x556444,_0x324580){_0x556444=_0x556444-0x0;var _0x29c117=_0x273e[_0x556444];return _0x29c117;};'use strict';var _=require(_0xe273('0x0'));var util=require(_0xe273('0x1'));var moment=require(_0xe273('0x2'));var BPromise=require(_0xe273('0x3'));var rs=require(_0xe273('0x4'));var fs=require('fs');var Redis=require(_0xe273('0x5'));var db=require(_0xe273('0x6'))['db'];var utils=require(_0xe273('0x7'));var logger=require(_0xe273('0x8'))(_0xe273('0x9'));var config=require(_0xe273('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xe273('0xb')][_0xe273('0xc')]({'port':0x232a});config[_0xe273('0xd')]=_['defaults'](config['redis'],{'host':_0xe273('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe273('0xf'))['register'](socket);function respondWithRpcPromise(_0x5853d5,_0x4d04f8,_0x11470f){return new BPromise(function(_0x5d2975,_0x47b136){return client['request'](_0x5853d5,_0x11470f)[_0xe273('0x10')](function(_0x5bf61d){logger[_0xe273('0x11')](_0xe273('0x12'),_0x4d04f8,_0xe273('0x13'));logger[_0xe273('0x14')](_0xe273('0x15'),_0x4d04f8,_0xe273('0x13'),JSON[_0xe273('0x16')](_0x5bf61d));if(_0x5bf61d[_0xe273('0x17')]){if(_0x5bf61d[_0xe273('0x17')][_0xe273('0x18')]===0x1f4){logger[_0xe273('0x17')](_0xe273('0x12'),_0x4d04f8,_0x5bf61d['error'][_0xe273('0x19')]);return _0x47b136(_0x5bf61d[_0xe273('0x17')][_0xe273('0x19')]);}logger[_0xe273('0x17')]('WhatsappInteraction,\x20%s,\x20%s',_0x4d04f8,_0x5bf61d[_0xe273('0x17')]['message']);return _0x5d2975(_0x5bf61d[_0xe273('0x17')][_0xe273('0x19')]);}else{logger[_0xe273('0x11')](_0xe273('0x12'),_0x4d04f8,_0xe273('0x13'));_0x5d2975(_0x5bf61d[_0xe273('0x1a')]['message']);}})[_0xe273('0x1b')](function(_0x2a4f7d){logger['error'](_0xe273('0x12'),_0x4d04f8,_0x2a4f7d);_0x47b136(_0x2a4f7d);});});}exports[_0xe273('0x1c')]=function(_0x1b71a1){var _0x159779=this;return new Promise(function(_0x20a994,_0x48a0f2){return db['WhatsappInteraction'][_0xe273('0x1d')](_0x1b71a1['body'],{'raw':_0x1b71a1['options']?_0x1b71a1[_0xe273('0x1e')][_0xe273('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b71a1['options']?_0x1b71a1[_0xe273('0x1e')][_0xe273('0x20')]||null:null,'attributes':_0x1b71a1[_0xe273('0x1e')]?_0x1b71a1[_0xe273('0x1e')][_0xe273('0x21')]||null:null,'limit':_0x1b71a1[_0xe273('0x1e')]?_0x1b71a1[_0xe273('0x1e')][_0xe273('0x22')]||null:null})[_0xe273('0x10')](function(_0x366242){logger['info'](_0xe273('0x1c'),_0x1b71a1);logger['debug']('UpdateWhatsappInteraction',_0x1b71a1,JSON[_0xe273('0x16')](_0x366242));_0x20a994(_0x366242);})['catch'](function(_0x2e5d65){logger[_0xe273('0x17')]('UpdateWhatsappInteraction',_0x2e5d65[_0xe273('0x19')],_0x1b71a1);_0x48a0f2(_0x159779[_0xe273('0x17')](0x1f4,_0x2e5d65[_0xe273('0x19')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x51cb0c){return new Promise(function(_0x1d1f93,_0x26ed84){return db['WhatsappInteraction'][_0xe273('0x23')]({'where':_0x51cb0c['options']?_0x51cb0c[_0xe273('0x1e')][_0xe273('0x20')]||null:null})['then'](function(_0x336f67){if(_0x336f67){return _0x336f67[_0xe273('0x24')](_0x51cb0c['body'][_0xe273('0x25')],_[_0xe273('0x26')](_0x51cb0c[_0xe273('0x27')],[_0xe273('0x25'),'id'])||{});}})['spread'](function(_0x56b232){logger[_0xe273('0x11')](_0xe273('0x28'),_0x51cb0c);logger['debug']('AddTags',_0x51cb0c,JSON[_0xe273('0x16')](_0x56b232));_0x1d1f93(_0x56b232);})[_0xe273('0x1b')](function(_0x1f2c0a){logger['error']('AddTags',_0x1f2c0a[_0xe273('0x19')],_0x51cb0c);_0x26ed84(_this[_0xe273('0x17')](0x1f4,_0x1f2c0a[_0xe273('0x19')]));});});};
\ No newline at end of file
+var _0x5a9c=['WhatsappInteraction,\x20%s,\x20%s','message','result','catch','update','body','options','raw','where','attributes','limit','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','WhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./whatsappInteraction.socket','request','then','info','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1bf809,_0x536f55){var _0x1caa4e=function(_0x9f9636){while(--_0x9f9636){_0x1bf809['push'](_0x1bf809['shift']());}};_0x1caa4e(++_0x536f55);}(_0x5a9c,0xe6));var _0xc5a9=function(_0x3e8d32,_0x5258b7){_0x3e8d32=_0x3e8d32-0x0;var _0x163132=_0x5a9c[_0x3e8d32];return _0x163132;};'use strict';var _=require(_0xc5a9('0x0'));var util=require('util');var moment=require(_0xc5a9('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5a9('0x2'));var fs=require('fs');var Redis=require(_0xc5a9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc5a9('0x4'));var logger=require(_0xc5a9('0x5'))(_0xc5a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a9('0x7'));var client=jayson[_0xc5a9('0x8')][_0xc5a9('0x9')]({'port':0x232a});config[_0xc5a9('0xa')]=_[_0xc5a9('0xb')](config[_0xc5a9('0xa')],{'host':_0xc5a9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5a9('0xa')]));require(_0xc5a9('0xd'))['register'](socket);function respondWithRpcPromise(_0x542241,_0x363576,_0x2d3e60){return new BPromise(function(_0x591e9e,_0x42433d){return client[_0xc5a9('0xe')](_0x542241,_0x2d3e60)[_0xc5a9('0xf')](function(_0x434b1d){logger[_0xc5a9('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x363576,_0xc5a9('0x11'));logger[_0xc5a9('0x12')](_0xc5a9('0x13'),_0x363576,_0xc5a9('0x11'),JSON[_0xc5a9('0x14')](_0x434b1d));if(_0x434b1d[_0xc5a9('0x15')]){if(_0x434b1d[_0xc5a9('0x15')]['code']===0x1f4){logger[_0xc5a9('0x15')](_0xc5a9('0x16'),_0x363576,_0x434b1d[_0xc5a9('0x15')][_0xc5a9('0x17')]);return _0x42433d(_0x434b1d[_0xc5a9('0x15')][_0xc5a9('0x17')]);}logger['error'](_0xc5a9('0x16'),_0x363576,_0x434b1d[_0xc5a9('0x15')][_0xc5a9('0x17')]);return _0x591e9e(_0x434b1d[_0xc5a9('0x15')][_0xc5a9('0x17')]);}else{logger[_0xc5a9('0x10')](_0xc5a9('0x16'),_0x363576,_0xc5a9('0x11'));_0x591e9e(_0x434b1d[_0xc5a9('0x18')][_0xc5a9('0x17')]);}})[_0xc5a9('0x19')](function(_0x2fea99){logger[_0xc5a9('0x15')](_0xc5a9('0x16'),_0x363576,_0x2fea99);_0x42433d(_0x2fea99);});});}exports['UpdateWhatsappInteraction']=function(_0x42c9ae){var _0x3ce09d=this;return new Promise(function(_0x18adb7,_0x202115){return db['WhatsappInteraction'][_0xc5a9('0x1a')](_0x42c9ae[_0xc5a9('0x1b')],{'raw':_0x42c9ae['options']?_0x42c9ae[_0xc5a9('0x1c')][_0xc5a9('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42c9ae[_0xc5a9('0x1c')]?_0x42c9ae[_0xc5a9('0x1c')][_0xc5a9('0x1e')]||null:null,'attributes':_0x42c9ae[_0xc5a9('0x1c')]?_0x42c9ae[_0xc5a9('0x1c')][_0xc5a9('0x1f')]||null:null,'limit':_0x42c9ae[_0xc5a9('0x1c')]?_0x42c9ae[_0xc5a9('0x1c')][_0xc5a9('0x20')]||null:null})[_0xc5a9('0xf')](function(_0x206478){logger[_0xc5a9('0x10')](_0xc5a9('0x21'),_0x42c9ae);logger['debug'](_0xc5a9('0x21'),_0x42c9ae,JSON[_0xc5a9('0x14')](_0x206478));_0x18adb7(_0x206478);})[_0xc5a9('0x19')](function(_0x5b394e){logger[_0xc5a9('0x15')](_0xc5a9('0x21'),_0x5b394e[_0xc5a9('0x17')],_0x42c9ae);_0x202115(_0x3ce09d['error'](0x1f4,_0x5b394e['message']));});});};exports[_0xc5a9('0x22')]=function(_0x13a368){return new Promise(function(_0x3aedfd,_0x2ebf76){return db[_0xc5a9('0x23')][_0xc5a9('0x24')]({'where':_0x13a368[_0xc5a9('0x1c')]?_0x13a368[_0xc5a9('0x1c')]['where']||null:null})[_0xc5a9('0xf')](function(_0x26bdfc){if(_0x26bdfc){return _0x26bdfc[_0xc5a9('0x25')](_0x13a368[_0xc5a9('0x1b')][_0xc5a9('0x26')],_[_0xc5a9('0x27')](_0x13a368[_0xc5a9('0x1b')],['ids','id'])||{});}})[_0xc5a9('0x28')](function(_0x1ac8eb){logger[_0xc5a9('0x10')](_0xc5a9('0x29'),_0x13a368);logger['debug']('AddTags',_0x13a368,JSON[_0xc5a9('0x14')](_0x1ac8eb));_0x3aedfd(_0x1ac8eb);})[_0xc5a9('0x19')](function(_0x52e086){logger[_0xc5a9('0x15')](_0xc5a9('0x29'),_0x52e086[_0xc5a9('0x17')],_0x13a368);_0x2ebf76(_this[_0xc5a9('0x15')](0x1f4,_0x52e086[_0xc5a9('0x17')]));});});};
\ No newline at end of file
index 58e025c..25a6cbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73c0=['update','emit','length','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x2738b8,_0x36063e){var _0x26210f=function(_0x1b13c9){while(--_0x1b13c9){_0x2738b8['push'](_0x2738b8['shift']());}};_0x26210f(++_0x36063e);}(_0x73c0,0x7b));var _0x073c=function(_0x322ee5,_0x3a1c91){_0x322ee5=_0x322ee5-0x0;var _0x4f9773=_0x73c0[_0x322ee5];return _0x4f9773;};'use strict';var WhatsappInteractionEvents=require(_0x073c('0x0'));var events=[_0x073c('0x1'),_0x073c('0x2'),_0x073c('0x3')];function createListener(_0xafbc20,_0x18fa9e){return function(_0x38fb4d){_0x18fa9e[_0x073c('0x4')](_0xafbc20,_0x38fb4d);};}function removeListener(_0x47f3a1,_0x181984){return function(){WhatsappInteractionEvents['removeListener'](_0x47f3a1,_0x181984);};}exports['register']=function(_0x58c1a4){for(var _0x515ff5=0x0,_0x3219f4=events[_0x073c('0x5')];_0x515ff5<_0x3219f4;_0x515ff5++){var _0x5123c0=events[_0x515ff5];var _0x4a291f=createListener(_0x073c('0x6')+_0x5123c0,_0x58c1a4);WhatsappInteractionEvents['on'](_0x5123c0,_0x4a291f);}};
\ No newline at end of file
+var _0x2c2a=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','remove'];(function(_0x4cdcdc,_0x34eac7){var _0x4704ce=function(_0x1de4ed){while(--_0x1de4ed){_0x4cdcdc['push'](_0x4cdcdc['shift']());}};_0x4704ce(++_0x34eac7);}(_0x2c2a,0x1ae));var _0xa2c2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2c2a[_0x6c993a];return _0x27f547;};'use strict';var WhatsappInteractionEvents=require(_0xa2c2('0x0'));var events=['save',_0xa2c2('0x1'),'update'];function createListener(_0x2b19d4,_0x71f53){return function(_0x523384){_0x71f53['emit'](_0x2b19d4,_0x523384);};}function removeListener(_0x35cca7,_0x8334cc){return function(){WhatsappInteractionEvents[_0xa2c2('0x2')](_0x35cca7,_0x8334cc);};}exports[_0xa2c2('0x3')]=function(_0x5c59d1){for(var _0x2eaa43=0x0,_0x4e9885=events[_0xa2c2('0x4')];_0x2eaa43<_0x4e9885;_0x2eaa43++){var _0x34d4e4=events[_0x2eaa43];var _0x9e8653=createListener(_0xa2c2('0x5')+_0x34d4e4,_0x5c59d1);WhatsappInteractionEvents['on'](_0x34d4e4,_0x9e8653);}};
\ No newline at end of file
index 6d23d23..5b18254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac72=['get','isAuthenticated','index','/describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','put','update','accept','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappMessage.controller'];(function(_0x2a98b1,_0x43fd4f){var _0x2c0e7f=function(_0x25e5cb){while(--_0x25e5cb){_0x2a98b1['push'](_0x2a98b1['shift']());}};_0x2c0e7f(++_0x43fd4f);}(_0xac72,0x124));var _0x2ac7=function(_0xe4bfb5,_0x1baca7){_0xe4bfb5=_0xe4bfb5-0x0;var _0x548af2=_0xac72[_0xe4bfb5];return _0x548af2;};'use strict';var multer=require(_0x2ac7('0x0'));var util=require(_0x2ac7('0x1'));var path=require('path');var timeout=require(_0x2ac7('0x2'));var express=require('express');var router=express[_0x2ac7('0x3')]();var fs_extra=require(_0x2ac7('0x4'));var auth=require(_0x2ac7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2ac7('0x6'));var controller=require(_0x2ac7('0x7'));router[_0x2ac7('0x8')]('/',auth[_0x2ac7('0x9')](),controller[_0x2ac7('0xa')]);router[_0x2ac7('0x8')](_0x2ac7('0xb'),auth[_0x2ac7('0x9')](),controller['describe']);router[_0x2ac7('0x8')](_0x2ac7('0xc'),auth[_0x2ac7('0x9')](),controller[_0x2ac7('0xd')]);router[_0x2ac7('0xe')]('/',auth[_0x2ac7('0x9')](),interaction[_0x2ac7('0xf')](_0x2ac7('0x10'),_0x2ac7('0x11')),controller[_0x2ac7('0x12')]);router[_0x2ac7('0xe')](_0x2ac7('0x13'),controller['status']);router[_0x2ac7('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x2ac7('0x15')]);router[_0x2ac7('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0x2ac7('0x16')]);router['put']('/:id/reject',auth[_0x2ac7('0x9')](),controller['reject']);router['delete']('/:id',auth[_0x2ac7('0x9')](),controller[_0x2ac7('0x17')]);module[_0x2ac7('0x18')]=router;
\ No newline at end of file
+var _0x6431=['post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put','/:id','/:id/accept','reject','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','isAuthenticated','/describe','describe','get','show'];(function(_0x422db0,_0x33be5b){var _0x355e09=function(_0x2b00a4){while(--_0x2b00a4){_0x422db0['push'](_0x422db0['shift']());}};_0x355e09(++_0x33be5b);}(_0x6431,0xb5));var _0x1643=function(_0x220474,_0x2aba1d){_0x220474=_0x220474-0x0;var _0x2af91a=_0x6431[_0x220474];return _0x2af91a;};'use strict';var multer=require('multer');var util=require(_0x1643('0x0'));var path=require(_0x1643('0x1'));var timeout=require(_0x1643('0x2'));var express=require(_0x1643('0x3'));var router=express[_0x1643('0x4')]();var fs_extra=require(_0x1643('0x5'));var auth=require(_0x1643('0x6'));var interaction=require(_0x1643('0x7'));var config=require(_0x1643('0x8'));var controller=require(_0x1643('0x9'));router['get']('/',auth[_0x1643('0xa')](),controller['index']);router['get'](_0x1643('0xb'),auth[_0x1643('0xa')](),controller[_0x1643('0xc')]);router[_0x1643('0xd')]('/:id',auth[_0x1643('0xa')](),controller[_0x1643('0xe')]);router[_0x1643('0xf')]('/',auth[_0x1643('0xa')](),interaction[_0x1643('0x10')](_0x1643('0x11'),_0x1643('0x12')),controller[_0x1643('0x13')]);router[_0x1643('0xf')](_0x1643('0x14'),controller[_0x1643('0x15')]);router[_0x1643('0x16')](_0x1643('0x17'),auth[_0x1643('0xa')](),controller['update']);router[_0x1643('0x16')](_0x1643('0x18'),auth[_0x1643('0xa')](),controller['accept']);router[_0x1643('0x16')]('/:id/reject',auth['isAuthenticated'](),controller[_0x1643('0x19')]);router[_0x1643('0x1a')](_0x1643('0x17'),auth[_0x1643('0xa')](),controller[_0x1643('0x1b')]);module['exports']=router;
\ No newline at end of file
index 85b0653..a05798d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc507=['ENUM','out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x1e4f2f,_0x35edfa){var _0xccea89=function(_0x164386){while(--_0x164386){_0x1e4f2f['push'](_0x1e4f2f['shift']());}};_0xccea89(++_0x35edfa);}(_0xc507,0x73));var _0x7c50=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xc507[_0x2525f1];return _0x13c1b5;};'use strict';var Sequelize=require(_0x7c50('0x0'));module[_0x7c50('0x1')]={'body':{'type':Sequelize[_0x7c50('0x2')](_0x7c50('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7c50('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7c50('0x5')]('in',_0x7c50('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7c50('0x7')](0xbe)},'phone':{'type':Sequelize[_0x7c50('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x7c50('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7c50('0x7')]},'providerResponse':{'type':Sequelize[_0x7c50('0x2')]}};
\ No newline at end of file
+var _0xbc4b=['sequelize','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0xaa66c2,_0x54085a){var _0x2ffde0=function(_0x34b1ea){while(--_0x34b1ea){_0xaa66c2['push'](_0xaa66c2['shift']());}};_0x2ffde0(++_0x54085a);}(_0xbc4b,0x17a));var _0xbbc4=function(_0x3e8080,_0x26aa38){_0x3e8080=_0x3e8080-0x0;var _0x54dd20=_0xbc4b[_0x3e8080];return _0x54dd20;};'use strict';var Sequelize=require(_0xbbc4('0x0'));module['exports']={'body':{'type':Sequelize[_0xbbc4('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbbc4('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbbc4('0x3')]('in',_0xbbc4('0x4')),'defaultValue':_0xbbc4('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbbc4('0x5')](0xbe)},'phone':{'type':Sequelize[_0xbbc4('0x5')]},'readAt':{'type':Sequelize[_0xbbc4('0x6')]},'secret':{'type':Sequelize[_0xbbc4('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbbc4('0x5')]},'providerResponse':{'type':Sequelize[_0xbbc4('0x1')]}};
\ No newline at end of file
index a53988b..566de5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07dd=['json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','stack','name','send','index','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','pick','filter','where','VIRTUAL','merge','WhatsappMessage','includeAll','include','findAll','show','params','options','body','find','destroy','describe','whatsapp-interactions','accept','whatsapp','format','YYYY-MM-DD\x20HH:mm:ss','UserId','WhatsappInteractionId','isNil','read1stAt','interaction','get','user','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','SIP/%s','channel','event','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','rejectMessage','ContactId','User','interface','motionChannel','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status'];(function(_0x9a3e0f,_0x2f796d){var _0x3d2a9a=function(_0x3aeb03){while(--_0x3aeb03){_0x9a3e0f['push'](_0x9a3e0f['shift']());}};_0x3d2a9a(++_0x2f796d);}(_0x07dd,0x1f3));var _0xd07d=function(_0x2f2dba,_0x451d2e){_0x2f2dba=_0x2f2dba-0x0;var _0x27e85e=_0x07dd[_0x2f2dba];return _0x27e85e;};'use strict';var emlformat=require(_0xd07d('0x0'));var rimraf=require(_0xd07d('0x1'));var zipdir=require(_0xd07d('0x2'));var jsonpatch=require(_0xd07d('0x3'));var rp=require(_0xd07d('0x4'));var moment=require(_0xd07d('0x5'));var BPromise=require(_0xd07d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd07d('0x7'));var sox=require(_0xd07d('0x8'));var csv=require(_0xd07d('0x9'));var ejs=require(_0xd07d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd07d('0xb'));var squel=require('squel');var crypto=require(_0xd07d('0xc'));var jsforce=require(_0xd07d('0xd'));var deskjs=require(_0xd07d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd07d('0xf'));var Papa=require(_0xd07d('0x10'));var Redis=require(_0xd07d('0x11'));var authService=require(_0xd07d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd07d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd07d('0x14'))('api');var utils=require(_0xd07d('0x15'));var config=require(_0xd07d('0x16'));var licenseUtil=require(_0xd07d('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd07d('0x18')](config[_0xd07d('0x19')],{'host':_0xd07d('0x1a'),'port':0x18eb});var socket=require(_0xd07d('0x1b'))(new Redis(config['redis']));require('./whatsappMessage.socket')[_0xd07d('0x1c')](socket);var jayson=require(_0xd07d('0x1d'));var client=jayson[_0xd07d('0x1e')][_0xd07d('0x1f')]({'port':0x232c});var client9002=jayson[_0xd07d('0x1e')][_0xd07d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5465da,_0x43ca01,_0x1ad054,_0x34e7e3){return new BPromise(function(_0x28d238,_0x405e34){var _0x1fb12a=_0x34e7e3||client;return _0x1fb12a['request'](_0x5465da,_0x1ad054)[_0xd07d('0x20')](function(_0x4a0792){logger[_0xd07d('0x21')](_0xd07d('0x22'),_0x43ca01,_0xd07d('0x23'));logger[_0xd07d('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x43ca01,_0xd07d('0x23'),JSON[_0xd07d('0x25')](_0x4a0792));if(_0x4a0792[_0xd07d('0x26')]){if(_0x4a0792['error'][_0xd07d('0x27')]===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x43ca01,_0x4a0792[_0xd07d('0x26')][_0xd07d('0x28')]);return _0x405e34(_0x4a0792[_0xd07d('0x26')][_0xd07d('0x28')]);}logger['error'](_0xd07d('0x22'),_0x43ca01,_0x4a0792[_0xd07d('0x26')][_0xd07d('0x28')]);return _0x28d238(_0x4a0792[_0xd07d('0x26')][_0xd07d('0x28')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x43ca01,_0xd07d('0x23'));_0x28d238(_0x4a0792[_0xd07d('0x29')][_0xd07d('0x28')]);}})[_0xd07d('0x2a')](function(_0x7b715a){logger[_0xd07d('0x26')](_0xd07d('0x22'),_0x43ca01,_0x7b715a);_0x405e34(_0x7b715a);});});}function respondWithStatusCode(_0x4685bd,_0x36a130){_0x36a130=_0x36a130||0xcc;return function(_0x5ed6ae){if(_0x5ed6ae){return _0x4685bd['sendStatus'](_0x36a130);}return _0x4685bd['status'](_0x36a130)[_0xd07d('0x2b')]();};}function respondWithResult(_0x29c39f,_0x5a0b55){_0x5a0b55=_0x5a0b55||0xc8;return function(_0x8fe78e){if(_0x8fe78e){return _0x29c39f[_0xd07d('0x2c')](_0x5a0b55)[_0xd07d('0x2d')](_0x8fe78e);}};}function respondWithFilteredResult(_0x17217a,_0x3e8657){return function(_0x4c7cd8){if(_0x4c7cd8){var _0x55ec6c=typeof _0x3e8657['offset']==='undefined'&&typeof _0x3e8657[_0xd07d('0x2e')]===_0xd07d('0x2f');var _0x8e9eaa=_0x4c7cd8[_0xd07d('0x30')];var _0x3e858d=_0x55ec6c?0x0:_0x3e8657[_0xd07d('0x31')];var _0x4702bc=_0x55ec6c?_0x4c7cd8[_0xd07d('0x30')]:_0x3e8657[_0xd07d('0x31')]+_0x3e8657['limit'];var _0x5ed501;if(_0x4702bc>=_0x8e9eaa){_0x4702bc=_0x8e9eaa;_0x5ed501=0xc8;}else{_0x5ed501=0xce;}_0x17217a['status'](_0x5ed501);return _0x17217a['set'](_0xd07d('0x32'),_0x3e858d+'-'+_0x4702bc+'/'+_0x8e9eaa)['json'](_0x4c7cd8);}return null;};}function patchUpdates(_0xf10cad){return function(_0x5a3d1b){try{jsonpatch[_0xd07d('0x33')](_0x5a3d1b,_0xf10cad,!![]);}catch(_0x54ff0b){return BPromise[_0xd07d('0x34')](_0x54ff0b);}return _0x5a3d1b[_0xd07d('0x35')]();};}function saveUpdates(_0x29fa0a,_0xa82c9c){return function(_0x38ccea){if(_0x38ccea){return _0x38ccea[_0xd07d('0x36')](_0x29fa0a)['then'](function(_0x2f1132){return _0x2f1132;});}return null;};}function removeEntity(_0x4cc465,_0xa8fd88){return function(_0x2e2abb){if(_0x2e2abb){return _0x2e2abb['destroy']()['then'](function(){_0x4cc465['status'](0xcc)[_0xd07d('0x2b')]();});}};}function handleEntityNotFound(_0x516db4,_0x293bb4){return function(_0x3df288){if(!_0x3df288){_0x516db4['sendStatus'](0x194);}return _0x3df288;};}function handleError(_0xd6e196,_0x426eb8){_0x426eb8=_0x426eb8||0x1f4;return function(_0x397d98){logger[_0xd07d('0x26')](_0x397d98[_0xd07d('0x37')]);if(_0x397d98[_0xd07d('0x38')]){delete _0x397d98[_0xd07d('0x38')];}_0xd6e196[_0xd07d('0x2c')](_0x426eb8)[_0xd07d('0x39')](_0x397d98);};}exports[_0xd07d('0x3a')]=function(_0x3f3988,_0x3517ad){var _0x40a1e4={},_0x5781f6={},_0xc5ac99={'count':0x0,'rows':[]};var _0x2e1403=_['map'](db['WhatsappMessage'][_0xd07d('0x3b')],function(_0x34eb78){return{'name':_0x34eb78['fieldName'],'type':_0x34eb78[_0xd07d('0x3c')][_0xd07d('0x3d')]};});_0x5781f6[_0xd07d('0x3e')]=_['map'](_0x2e1403,_0xd07d('0x38'));_0x5781f6[_0xd07d('0x3f')]=_[_0xd07d('0x40')](_0x3f3988[_0xd07d('0x3f')]);_0x5781f6['filters']=_[_0xd07d('0x41')](_0x5781f6[_0xd07d('0x3e')],_0x5781f6[_0xd07d('0x3f')]);_0x40a1e4[_0xd07d('0x42')]=_[_0xd07d('0x41')](_0x5781f6['model'],qs[_0xd07d('0x43')](_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x43')]));_0x40a1e4[_0xd07d('0x42')]=_0x40a1e4[_0xd07d('0x42')][_0xd07d('0x44')]?_0x40a1e4[_0xd07d('0x42')]:_0x5781f6[_0xd07d('0x3e')];if(!_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x45')](_0xd07d('0x46'))){_0x40a1e4[_0xd07d('0x2e')]=qs[_0xd07d('0x2e')](_0x3f3988[_0xd07d('0x3f')]['limit']);_0x40a1e4['offset']=qs['offset'](_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x31')]);}_0x40a1e4['order']=qs['sort'](_0x3f3988['query']['sort']);_0x40a1e4['where']=qs[_0xd07d('0x47')](_[_0xd07d('0x48')](_0x3f3988['query'],_0x5781f6[_0xd07d('0x47')]),_0x2e1403);if(_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x49')]){_0x40a1e4[_0xd07d('0x4a')]=_['merge'](_0x40a1e4[_0xd07d('0x4a')],{'$or':_['map'](_0x2e1403,function(_0x302a56){if(_0x302a56[_0xd07d('0x3c')]!==_0xd07d('0x4b')){var _0x945be={};_0x945be[_0x302a56['name']]={'$like':'%'+_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x49')]+'%'};return _0x945be;}})});}_0x40a1e4=_[_0xd07d('0x4c')]({},_0x40a1e4,_0x3f3988['options']);var _0x15e2eb={'where':_0x40a1e4[_0xd07d('0x4a')]};return db[_0xd07d('0x4d')][_0xd07d('0x30')](_0x15e2eb)[_0xd07d('0x20')](function(_0x364040){_0xc5ac99[_0xd07d('0x30')]=_0x364040;if(_0x3f3988[_0xd07d('0x3f')][_0xd07d('0x4e')]){_0x40a1e4[_0xd07d('0x4f')]=[{'all':!![]}];}return db[_0xd07d('0x4d')][_0xd07d('0x50')](_0x40a1e4);})['then'](function(_0x4aca95){_0xc5ac99['rows']=_0x4aca95;return _0xc5ac99;})[_0xd07d('0x20')](respondWithFilteredResult(_0x3517ad,_0x40a1e4))[_0xd07d('0x2a')](handleError(_0x3517ad,null));};exports[_0xd07d('0x51')]=function(_0x4a88b3,_0x5c2e06){var _0x162253={'raw':!![],'where':{'id':_0x4a88b3[_0xd07d('0x52')]['id']}},_0x4c4d49={};_0x4c4d49['model']=_[_0xd07d('0x40')](db[_0xd07d('0x4d')]['rawAttributes']);_0x4c4d49['query']=_[_0xd07d('0x40')](_0x4a88b3[_0xd07d('0x3f')]);_0x4c4d49[_0xd07d('0x47')]=_[_0xd07d('0x41')](_0x4c4d49[_0xd07d('0x3e')],_0x4c4d49[_0xd07d('0x3f')]);_0x162253[_0xd07d('0x42')]=_[_0xd07d('0x41')](_0x4c4d49[_0xd07d('0x3e')],qs[_0xd07d('0x43')](_0x4a88b3['query']['fields']));_0x162253[_0xd07d('0x42')]=_0x162253[_0xd07d('0x42')]['length']?_0x162253[_0xd07d('0x42')]:_0x4c4d49[_0xd07d('0x3e')];if(_0x4a88b3[_0xd07d('0x3f')][_0xd07d('0x4e')]){_0x162253['include']=[{'all':!![]}];}_0x162253=_['merge']({},_0x162253,_0x4a88b3[_0xd07d('0x53')]);return db[_0xd07d('0x4d')]['find'](_0x162253)[_0xd07d('0x20')](handleEntityNotFound(_0x5c2e06,null))[_0xd07d('0x20')](respondWithResult(_0x5c2e06,null))[_0xd07d('0x2a')](handleError(_0x5c2e06,null));};exports['create']=function(_0x4515e7,_0x291737){return db[_0xd07d('0x4d')]['create'](_0x4515e7[_0xd07d('0x54')],{})['then'](respondWithResult(_0x291737,0xc9))[_0xd07d('0x2a')](handleError(_0x291737,null));};exports['update']=function(_0x3f0aa5,_0xf5ebf3){if(_0x3f0aa5[_0xd07d('0x54')]['id']){delete _0x3f0aa5['body']['id'];}return db[_0xd07d('0x4d')][_0xd07d('0x55')]({'where':{'id':_0x3f0aa5['params']['id']}})['then'](handleEntityNotFound(_0xf5ebf3,null))[_0xd07d('0x20')](saveUpdates(_0x3f0aa5['body'],null))[_0xd07d('0x20')](respondWithResult(_0xf5ebf3,null))['catch'](handleError(_0xf5ebf3,null));};exports[_0xd07d('0x56')]=function(_0x5762b8,_0x1bad99){return db[_0xd07d('0x4d')][_0xd07d('0x55')]({'where':{'id':_0x5762b8['params']['id']}})[_0xd07d('0x20')](handleEntityNotFound(_0x1bad99,null))['then'](removeEntity(_0x1bad99,null))[_0xd07d('0x2a')](handleError(_0x1bad99,null));};exports[_0xd07d('0x57')]=function(_0x2c24f6,_0x4fda9e){return db[_0xd07d('0x4d')]['describe']()[_0xd07d('0x20')](respondWithResult(_0x4fda9e,null))['catch'](handleError(_0x4fda9e,null));};var interaction_log=require(_0xd07d('0x14'))(_0xd07d('0x58'));exports[_0xd07d('0x59')]=function(_0x4ed52d,_0x4e757d,_0x48ff8a){var _0x26f804={'agent':{},'channel':_0xd07d('0x5a')};if(_0x4ed52d['body']['id']){delete _0x4ed52d[_0xd07d('0x54')]['id'];}_0x4ed52d[_0xd07d('0x54')]['read']=!![];_0x4ed52d[_0xd07d('0x54')]['readAt']=moment()[_0xd07d('0x5b')](_0xd07d('0x5c'));_0x4ed52d[_0xd07d('0x54')][_0xd07d('0x5d')]=_0x4ed52d[_0xd07d('0x54')][_0xd07d('0x5d')]||_0x4ed52d['user']['id'];_0x26f804['agent']['id']=_0x4ed52d[_0xd07d('0x54')][_0xd07d('0x5d')];return db[_0xd07d('0x4d')][_0xd07d('0x55')]({'where':{'id':_0x4ed52d[_0xd07d('0x52')]['id'],'UserId':null}})[_0xd07d('0x20')](handleEntityNotFound(_0x4e757d,null))[_0xd07d('0x20')](saveUpdates(_0x4ed52d['body'],null))[_0xd07d('0x20')](function(_0x9174a2){if(_0x9174a2){_0x26f804['message']=_0x9174a2['get']({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x9174a2[_0xd07d('0x5e')]}});}return null;})[_0xd07d('0x20')](handleEntityNotFound(_0x4e757d,null))[_0xd07d('0x20')](function(_0x5912e1){if(_0x5912e1){return _0x5912e1[_0xd07d('0x36')]({'UserId':_0x4ed52d['body']['UserId'],'read1stAt':_[_0xd07d('0x5f')](_0x5912e1[_0xd07d('0x60')])?moment()[_0xd07d('0x5b')](_0xd07d('0x5c')):undefined});}return null;})[_0xd07d('0x20')](function(_0x1bc36a){if(_0x1bc36a){_0x26f804[_0xd07d('0x61')]=_0x1bc36a[_0xd07d('0x62')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4ed52d[_0xd07d('0x63')]['id'],_0x4ed52d[_0xd07d('0x63')][_0xd07d('0x38')],_0x4ed52d['user'][_0xd07d('0x64')],_0x26f804[_0xd07d('0x61')]['id'],_0x4ed52d[_0xd07d('0x54')]?JSON[_0xd07d('0x25')](_0x4ed52d[_0xd07d('0x54')]):'null');return respondWithRpcPromise('AcceptMessage',_0xd07d('0x65'),_0x26f804);}return null;})[_0xd07d('0x20')](function(_0x2b62db){var _0x272066=_0xd07d('0x66')+_0x2b62db[_0xd07d('0x28')]['ContactId'];return db[_0xd07d('0x67')]['query'](_0x272066,{'type':db[_0xd07d('0x68')][_0xd07d('0x69')][_0xd07d('0x6a')],'raw':!![]})[_0xd07d('0x20')](function(_0x54e310){return _0x54e310;});})[_0xd07d('0x20')](function(_0x549633){if(_0x549633){_0x26f804[_0xd07d('0x28')][_0xd07d('0x6b')]=_0x549633[0x0];if(!_0x4ed52d[_0xd07d('0x54')][_0xd07d('0x5d')])return;return db['User']['find']({'where':{'id':_0x4ed52d[_0xd07d('0x54')]['UserId'],'role':_0xd07d('0x6c')},'attributes':['id',_0xd07d('0x38'),_0xd07d('0x6d'),_0xd07d('0x6e'),_0xd07d('0x6f')],'raw':!![]});}return null;})['then'](function(_0x3972bc){if(!_0x3972bc)return null;_0x26f804[_0xd07d('0x28')][_0xd07d('0x6c')]=_0x3972bc;return _0x26f804;})[_0xd07d('0x20')](function(_0x598cbe){if(_0x598cbe){if(_0x4ed52d[_0xd07d('0x54')]['manual']){_0x26f804[_0xd07d('0x28')]['interface']=util['format'](_0xd07d('0x70'),_0x4ed52d[_0xd07d('0x63')]['name']);_0x26f804[_0xd07d('0x28')]['channel']=_0x26f804[_0xd07d('0x71')];_0x26f804[_0xd07d('0x28')]['motionChannel']=_0x26f804[_0xd07d('0x71')];_0x26f804[_0xd07d('0x28')][_0xd07d('0x72')]='accept';return respondWithRpcPromise('EventManager',_0xd07d('0x73'),{'event':'acceptmessage','message':_0x26f804[_0xd07d('0x28')]},client9002)[_0xd07d('0x20')](function(){return _0x26f804;});}return _0x26f804;}return null;})[_0xd07d('0x20')](respondWithResult(_0x4e757d,null))[_0xd07d('0x2a')](handleError(_0x4e757d,null));};var interaction_log=require(_0xd07d('0x14'))('whatsapp-interactions');exports[_0xd07d('0x34')]=function(_0x52c259,_0x50ee74,_0x1ce8bf){var _0x4002e8={'agent':{},'channel':'whatsapp'};if(_0x52c259['body']['id']){delete _0x52c259[_0xd07d('0x54')]['id'];}_0x52c259[_0xd07d('0x54')][_0xd07d('0x5d')]=_0x52c259['body'][_0xd07d('0x5d')]||_0x52c259['user']['id'];_0x4002e8['agent']['id']=_0x52c259[_0xd07d('0x54')][_0xd07d('0x5d')];return db[_0xd07d('0x4d')][_0xd07d('0x55')]({'where':{'id':_0x52c259['params']['id'],'UserId':null}})[_0xd07d('0x20')](handleEntityNotFound(_0x50ee74,null))[_0xd07d('0x20')](function(_0x21a806){if(_0x21a806){_0x4002e8[_0xd07d('0x28')]=_0x21a806[_0xd07d('0x62')]({'plain':!![]});return db[_0xd07d('0x74')][_0xd07d('0x55')]({'where':{'id':_0x21a806['WhatsappInteractionId']}});}return null;})[_0xd07d('0x20')](handleEntityNotFound(_0x50ee74,null))['then'](function(_0x59d11f){if(_0x59d11f){_0x4002e8[_0xd07d('0x61')]=_0x59d11f[_0xd07d('0x62')]({'plain':!![]});interaction_log[_0xd07d('0x21')](_0xd07d('0x75'),_0x52c259[_0xd07d('0x63')]['id'],_0x52c259[_0xd07d('0x63')]['name'],_0x52c259['user'][_0xd07d('0x64')],_0x4002e8['interaction']['id'],_0x52c259['body']?JSON['stringify'](_0x52c259[_0xd07d('0x54')]):_0xd07d('0x76'));return respondWithRpcPromise('RejectMessage',_0xd07d('0x77'),_0x4002e8);}return null;})[_0xd07d('0x20')](function(_0x4a9159){var _0x44f4ea=_0xd07d('0x66')+_0x4a9159[_0xd07d('0x28')][_0xd07d('0x78')];return db[_0xd07d('0x67')][_0xd07d('0x3f')](_0x44f4ea,{'type':db['Sequelize'][_0xd07d('0x69')][_0xd07d('0x6a')],'raw':!![]})[_0xd07d('0x20')](function(_0x42457a){return _0x42457a;});})[_0xd07d('0x20')](function(_0x410acd){if(_0x410acd){_0x4002e8['message']['contact']=_0x410acd[0x0];if(!_0x52c259[_0xd07d('0x54')][_0xd07d('0x5d')])return;return db[_0xd07d('0x79')]['find']({'where':{'id':_0x52c259[_0xd07d('0x54')][_0xd07d('0x5d')],'role':_0xd07d('0x6c')},'attributes':['id',_0xd07d('0x38'),_0xd07d('0x6d'),_0xd07d('0x6e'),_0xd07d('0x6f')],'raw':!![]});}return null;})[_0xd07d('0x20')](function(_0xf86775){if(!_0xf86775)return null;_0x4002e8[_0xd07d('0x28')][_0xd07d('0x6c')]=_0xf86775;return _0x4002e8;})['then'](function(_0x2b3a88){if(_0x2b3a88){_0x2b3a88[_0xd07d('0x28')][_0xd07d('0x7a')]=util[_0xd07d('0x5b')](_0xd07d('0x70'),_0x52c259[_0xd07d('0x63')][_0xd07d('0x38')]);_0x2b3a88[_0xd07d('0x28')]['channel']=_0x4002e8[_0xd07d('0x71')];_0x2b3a88['message'][_0xd07d('0x7b')]=_0x4002e8[_0xd07d('0x71')];_0x2b3a88[_0xd07d('0x28')][_0xd07d('0x72')]=_0xd07d('0x34');respondWithRpcPromise(_0xd07d('0x73'),'EventManager',{'event':_0xd07d('0x7c'),'message':_0x2b3a88[_0xd07d('0x28')]},client9002);return _0x4002e8;}return null;})[_0xd07d('0x20')](respondWithResult(_0x50ee74,null))['catch'](handleError(_0x50ee74,null));};exports[_0xd07d('0x2c')]=function(_0x31a7de,_0x3ade19,_0x209098){if(_0x31a7de[_0xd07d('0x54')]['id']){delete _0x31a7de[_0xd07d('0x54')]['id'];}var _0x23a6d5;return db[_0xd07d('0x4d')]['find']({'where':{'id':_0x31a7de[_0xd07d('0x52')]['id']}})[_0xd07d('0x20')](handleEntityNotFound(_0x3ade19,null))[_0xd07d('0x20')](function(_0x571202){if(_0x571202){_0x23a6d5=_0x571202;return db[_0xd07d('0x7d')][_0xd07d('0x55')]({'where':{'id':_0x571202[_0xd07d('0x7e')]}});}})[_0xd07d('0x20')](handleEntityNotFound(_0x3ade19,null))['then'](function(_0x2dcddb){if(_0x2dcddb){logger[_0xd07d('0x24')](_0xd07d('0x7f'),_0xd07d('0x2c'),_0xd07d('0x80'),_0x2dcddb['type'],util[_0xd07d('0x81')](_0x31a7de[_0xd07d('0x54')],{'showHidden':![],'depth':null}));switch(_0x2dcddb['type']){case _0xd07d('0x82'):if(_0x31a7de['body'][_0xd07d('0x83')]&&_0x31a7de['body'][_0xd07d('0x83')]===_0x23a6d5[_0xd07d('0x84')]&&_0x31a7de[_0xd07d('0x54')]['MessageStatus']&&_0x31a7de[_0xd07d('0x54')][_0xd07d('0x85')]===_0xd07d('0x86')){return _0x23a6d5[_0xd07d('0x36')]({'read':!![]});}else{logger['error'](_0xd07d('0x87'),_0xd07d('0x2c'),_0xd07d('0x82'),util[_0xd07d('0x81')](_0x31a7de[_0xd07d('0x54')],{'showHidden':![],'depth':null}));}break;}return _0x23a6d5;}})['then'](respondWithResult(_0x3ade19,null))[_0xd07d('0x2a')](handleError(_0x3ade19,null));};
\ No newline at end of file
+var _0xf28b=['inspect','twilio','MessageSid','MessageStatus','eml-format','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','sendStatus','status','json','limit','count','offset','set','Content-Range','reject','save','destroy','stack','name','send','index','map','WhatsappMessage','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','motionChannel','event','EventManager','acceptmessage','whatsapp','RejectMessage','rejectMessage','ContactId','sequelize','fullname','channel','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s'];(function(_0x5e709a,_0x1d7975){var _0x57401a=function(_0x27eab5){while(--_0x27eab5){_0x5e709a['push'](_0x5e709a['shift']());}};_0x57401a(++_0x1d7975);}(_0xf28b,0x11a));var _0xbf28=function(_0x483f19,_0x2d9aa0){_0x483f19=_0x483f19-0x0;var _0x406d1d=_0xf28b[_0x483f19];return _0x406d1d;};'use strict';var emlformat=require(_0xbf28('0x0'));var rimraf=require(_0xbf28('0x1'));var zipdir=require(_0xbf28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf28('0x3'));var BPromise=require(_0xbf28('0x4'));var Mustache=require(_0xbf28('0x5'));var util=require('util');var path=require('path');var sox=require(_0xbf28('0x6'));var csv=require('to-csv');var ejs=require(_0xbf28('0x7'));var fs=require('fs');var fs_extra=require(_0xbf28('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbf28('0x9'));var jsforce=require(_0xbf28('0xa'));var deskjs=require(_0xbf28('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbf28('0xc'));var Papa=require(_0xbf28('0xd'));var Redis=require(_0xbf28('0xe'));var authService=require(_0xbf28('0xf'));var qs=require(_0xbf28('0x10'));var as=require(_0xbf28('0x11'));var hardwareService=require(_0xbf28('0x12'));var logger=require('../../config/logger')(_0xbf28('0x13'));var utils=require(_0xbf28('0x14'));var config=require(_0xbf28('0x15'));var licenseUtil=require(_0xbf28('0x16'));var db=require(_0xbf28('0x17'))['db'];config[_0xbf28('0x18')]=_[_0xbf28('0x19')](config[_0xbf28('0x18')],{'host':_0xbf28('0x1a'),'port':0x18eb});var socket=require(_0xbf28('0x1b'))(new Redis(config['redis']));require(_0xbf28('0x1c'))[_0xbf28('0x1d')](socket);var jayson=require(_0xbf28('0x1e'));var client=jayson['client'][_0xbf28('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xbf28('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x50f7ca,_0x19f808,_0x4698f,_0x3997e6){return new BPromise(function(_0x547cdc,_0x5a7593){var _0x52dc6d=_0x3997e6||client;return _0x52dc6d['request'](_0x50f7ca,_0x4698f)[_0xbf28('0x20')](function(_0x845ef1){logger['info'](_0xbf28('0x21'),_0x19f808,_0xbf28('0x22'));logger[_0xbf28('0x23')](_0xbf28('0x24'),_0x19f808,_0xbf28('0x22'),JSON['stringify'](_0x845ef1));if(_0x845ef1[_0xbf28('0x25')]){if(_0x845ef1[_0xbf28('0x25')]['code']===0x1f4){logger[_0xbf28('0x25')](_0xbf28('0x21'),_0x19f808,_0x845ef1[_0xbf28('0x25')][_0xbf28('0x26')]);return _0x5a7593(_0x845ef1[_0xbf28('0x25')][_0xbf28('0x26')]);}logger[_0xbf28('0x25')](_0xbf28('0x21'),_0x19f808,_0x845ef1[_0xbf28('0x25')][_0xbf28('0x26')]);return _0x547cdc(_0x845ef1['error'][_0xbf28('0x26')]);}else{logger[_0xbf28('0x27')](_0xbf28('0x21'),_0x19f808,_0xbf28('0x22'));_0x547cdc(_0x845ef1[_0xbf28('0x28')][_0xbf28('0x26')]);}})['catch'](function(_0x12ebbe){logger[_0xbf28('0x25')](_0xbf28('0x21'),_0x19f808,_0x12ebbe);_0x5a7593(_0x12ebbe);});});}function respondWithStatusCode(_0x5a53dc,_0x567cfd){_0x567cfd=_0x567cfd||0xcc;return function(_0x11adbf){if(_0x11adbf){return _0x5a53dc[_0xbf28('0x29')](_0x567cfd);}return _0x5a53dc[_0xbf28('0x2a')](_0x567cfd)['end']();};}function respondWithResult(_0xf044ec,_0x2eb5e3){_0x2eb5e3=_0x2eb5e3||0xc8;return function(_0x57bf69){if(_0x57bf69){return _0xf044ec[_0xbf28('0x2a')](_0x2eb5e3)[_0xbf28('0x2b')](_0x57bf69);}};}function respondWithFilteredResult(_0xca1e27,_0x97331e){return function(_0xdd9661){if(_0xdd9661){var _0x22f558=typeof _0x97331e['offset']==='undefined'&&typeof _0x97331e[_0xbf28('0x2c')]==='undefined';var _0x54b36b=_0xdd9661[_0xbf28('0x2d')];var _0x3c3fc4=_0x22f558?0x0:_0x97331e[_0xbf28('0x2e')];var _0x21f8e5=_0x22f558?_0xdd9661[_0xbf28('0x2d')]:_0x97331e[_0xbf28('0x2e')]+_0x97331e['limit'];var _0x2b5888;if(_0x21f8e5>=_0x54b36b){_0x21f8e5=_0x54b36b;_0x2b5888=0xc8;}else{_0x2b5888=0xce;}_0xca1e27[_0xbf28('0x2a')](_0x2b5888);return _0xca1e27[_0xbf28('0x2f')](_0xbf28('0x30'),_0x3c3fc4+'-'+_0x21f8e5+'/'+_0x54b36b)[_0xbf28('0x2b')](_0xdd9661);}return null;};}function patchUpdates(_0x56645b){return function(_0x495a5a){try{jsonpatch['apply'](_0x495a5a,_0x56645b,!![]);}catch(_0x31241d){return BPromise[_0xbf28('0x31')](_0x31241d);}return _0x495a5a[_0xbf28('0x32')]();};}function saveUpdates(_0x19dbcb,_0x28003c){return function(_0x257444){if(_0x257444){return _0x257444['update'](_0x19dbcb)[_0xbf28('0x20')](function(_0x4c2eb0){return _0x4c2eb0;});}return null;};}function removeEntity(_0x9634c,_0x1467a6){return function(_0x5887eb){if(_0x5887eb){return _0x5887eb[_0xbf28('0x33')]()[_0xbf28('0x20')](function(){_0x9634c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9623cd,_0x42372a){return function(_0x20d15d){if(!_0x20d15d){_0x9623cd[_0xbf28('0x29')](0x194);}return _0x20d15d;};}function handleError(_0x3775ef,_0x50eab2){_0x50eab2=_0x50eab2||0x1f4;return function(_0x2da0c0){logger[_0xbf28('0x25')](_0x2da0c0[_0xbf28('0x34')]);if(_0x2da0c0[_0xbf28('0x35')]){delete _0x2da0c0[_0xbf28('0x35')];}_0x3775ef[_0xbf28('0x2a')](_0x50eab2)[_0xbf28('0x36')](_0x2da0c0);};}exports[_0xbf28('0x37')]=function(_0x43355b,_0x3a70c1){var _0x36587e={},_0x2b905b={},_0x57297e={'count':0x0,'rows':[]};var _0x59d164=_[_0xbf28('0x38')](db[_0xbf28('0x39')]['rawAttributes'],function(_0x1644d3){return{'name':_0x1644d3[_0xbf28('0x3a')],'type':_0x1644d3['type'][_0xbf28('0x3b')]};});_0x2b905b[_0xbf28('0x3c')]=_[_0xbf28('0x38')](_0x59d164,'name');_0x2b905b['query']=_['keys'](_0x43355b[_0xbf28('0x3d')]);_0x2b905b[_0xbf28('0x3e')]=_[_0xbf28('0x3f')](_0x2b905b[_0xbf28('0x3c')],_0x2b905b['query']);_0x36587e[_0xbf28('0x40')]=_['intersection'](_0x2b905b['model'],qs[_0xbf28('0x41')](_0x43355b['query']['fields']));_0x36587e[_0xbf28('0x40')]=_0x36587e['attributes'][_0xbf28('0x42')]?_0x36587e[_0xbf28('0x40')]:_0x2b905b['model'];if(!_0x43355b[_0xbf28('0x3d')][_0xbf28('0x43')](_0xbf28('0x44'))){_0x36587e['limit']=qs['limit'](_0x43355b[_0xbf28('0x3d')]['limit']);_0x36587e[_0xbf28('0x2e')]=qs['offset'](_0x43355b[_0xbf28('0x3d')][_0xbf28('0x2e')]);}_0x36587e['order']=qs[_0xbf28('0x45')](_0x43355b[_0xbf28('0x3d')][_0xbf28('0x45')]);_0x36587e[_0xbf28('0x46')]=qs[_0xbf28('0x3e')](_[_0xbf28('0x47')](_0x43355b['query'],_0x2b905b['filters']),_0x59d164);if(_0x43355b[_0xbf28('0x3d')]['filter']){_0x36587e[_0xbf28('0x46')]=_['merge'](_0x36587e['where'],{'$or':_[_0xbf28('0x38')](_0x59d164,function(_0x5c9074){if(_0x5c9074[_0xbf28('0x48')]!==_0xbf28('0x49')){var _0x2e433b={};_0x2e433b[_0x5c9074[_0xbf28('0x35')]]={'$like':'%'+_0x43355b[_0xbf28('0x3d')][_0xbf28('0x4a')]+'%'};return _0x2e433b;}})});}_0x36587e=_[_0xbf28('0x4b')]({},_0x36587e,_0x43355b[_0xbf28('0x4c')]);var _0x1fceee={'where':_0x36587e[_0xbf28('0x46')]};return db[_0xbf28('0x39')][_0xbf28('0x2d')](_0x1fceee)[_0xbf28('0x20')](function(_0x4fa59b){_0x57297e[_0xbf28('0x2d')]=_0x4fa59b;if(_0x43355b[_0xbf28('0x3d')][_0xbf28('0x4d')]){_0x36587e['include']=[{'all':!![]}];}return db['WhatsappMessage'][_0xbf28('0x4e')](_0x36587e);})[_0xbf28('0x20')](function(_0x58e467){_0x57297e[_0xbf28('0x4f')]=_0x58e467;return _0x57297e;})[_0xbf28('0x20')](respondWithFilteredResult(_0x3a70c1,_0x36587e))[_0xbf28('0x50')](handleError(_0x3a70c1,null));};exports[_0xbf28('0x51')]=function(_0x5e1532,_0x1ef6b6){var _0x186763={'raw':!![],'where':{'id':_0x5e1532[_0xbf28('0x52')]['id']}},_0x41499b={};_0x41499b['model']=_[_0xbf28('0x53')](db[_0xbf28('0x39')][_0xbf28('0x54')]);_0x41499b[_0xbf28('0x3d')]=_[_0xbf28('0x53')](_0x5e1532[_0xbf28('0x3d')]);_0x41499b[_0xbf28('0x3e')]=_[_0xbf28('0x3f')](_0x41499b['model'],_0x41499b[_0xbf28('0x3d')]);_0x186763[_0xbf28('0x40')]=_[_0xbf28('0x3f')](_0x41499b[_0xbf28('0x3c')],qs[_0xbf28('0x41')](_0x5e1532[_0xbf28('0x3d')][_0xbf28('0x41')]));_0x186763[_0xbf28('0x40')]=_0x186763[_0xbf28('0x40')]['length']?_0x186763[_0xbf28('0x40')]:_0x41499b[_0xbf28('0x3c')];if(_0x5e1532[_0xbf28('0x3d')][_0xbf28('0x4d')]){_0x186763[_0xbf28('0x55')]=[{'all':!![]}];}_0x186763=_[_0xbf28('0x4b')]({},_0x186763,_0x5e1532[_0xbf28('0x4c')]);return db[_0xbf28('0x39')][_0xbf28('0x56')](_0x186763)[_0xbf28('0x20')](handleEntityNotFound(_0x1ef6b6,null))[_0xbf28('0x20')](respondWithResult(_0x1ef6b6,null))[_0xbf28('0x50')](handleError(_0x1ef6b6,null));};exports[_0xbf28('0x57')]=function(_0x16bec2,_0x4fbe8f){return db['WhatsappMessage']['create'](_0x16bec2[_0xbf28('0x58')],{})[_0xbf28('0x20')](respondWithResult(_0x4fbe8f,0xc9))[_0xbf28('0x50')](handleError(_0x4fbe8f,null));};exports['update']=function(_0x4d3480,_0x36f763){if(_0x4d3480[_0xbf28('0x58')]['id']){delete _0x4d3480[_0xbf28('0x58')]['id'];}return db[_0xbf28('0x39')][_0xbf28('0x56')]({'where':{'id':_0x4d3480['params']['id']}})[_0xbf28('0x20')](handleEntityNotFound(_0x36f763,null))[_0xbf28('0x20')](saveUpdates(_0x4d3480['body'],null))[_0xbf28('0x20')](respondWithResult(_0x36f763,null))['catch'](handleError(_0x36f763,null));};exports[_0xbf28('0x33')]=function(_0x4a963c,_0x466780){return db[_0xbf28('0x39')][_0xbf28('0x56')]({'where':{'id':_0x4a963c[_0xbf28('0x52')]['id']}})[_0xbf28('0x20')](handleEntityNotFound(_0x466780,null))[_0xbf28('0x20')](removeEntity(_0x466780,null))[_0xbf28('0x50')](handleError(_0x466780,null));};exports[_0xbf28('0x59')]=function(_0xe521ab,_0x14006c){return db[_0xbf28('0x39')][_0xbf28('0x59')]()[_0xbf28('0x20')](respondWithResult(_0x14006c,null))[_0xbf28('0x50')](handleError(_0x14006c,null));};var interaction_log=require(_0xbf28('0x5a'))(_0xbf28('0x5b'));exports[_0xbf28('0x5c')]=function(_0x49e529,_0x17f360,_0x2bebf2){var _0x503a7e={'agent':{},'channel':'whatsapp'};if(_0x49e529[_0xbf28('0x58')]['id']){delete _0x49e529[_0xbf28('0x58')]['id'];}_0x49e529[_0xbf28('0x58')][_0xbf28('0x5d')]=!![];_0x49e529[_0xbf28('0x58')][_0xbf28('0x5e')]=moment()[_0xbf28('0x5f')](_0xbf28('0x60'));_0x49e529[_0xbf28('0x58')][_0xbf28('0x61')]=_0x49e529[_0xbf28('0x58')]['UserId']||_0x49e529['user']['id'];_0x503a7e[_0xbf28('0x62')]['id']=_0x49e529['body'][_0xbf28('0x61')];return db[_0xbf28('0x39')][_0xbf28('0x56')]({'where':{'id':_0x49e529[_0xbf28('0x52')]['id'],'UserId':null}})[_0xbf28('0x20')](handleEntityNotFound(_0x17f360,null))[_0xbf28('0x20')](saveUpdates(_0x49e529['body'],null))[_0xbf28('0x20')](function(_0x3be172){if(_0x3be172){_0x503a7e[_0xbf28('0x26')]=_0x3be172[_0xbf28('0x63')]({'plain':!![]});return db[_0xbf28('0x64')][_0xbf28('0x56')]({'where':{'id':_0x3be172[_0xbf28('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x17f360,null))[_0xbf28('0x20')](function(_0x1b514d){if(_0x1b514d){return _0x1b514d['update']({'UserId':_0x49e529[_0xbf28('0x58')][_0xbf28('0x61')],'read1stAt':_['isNil'](_0x1b514d[_0xbf28('0x66')])?moment()['format'](_0xbf28('0x60')):undefined});}return null;})['then'](function(_0x39e689){if(_0x39e689){_0x503a7e['interaction']=_0x39e689[_0xbf28('0x63')]({'plain':!![]});interaction_log[_0xbf28('0x27')](_0xbf28('0x67'),_0x49e529[_0xbf28('0x68')]['id'],_0x49e529[_0xbf28('0x68')][_0xbf28('0x35')],_0x49e529['user'][_0xbf28('0x69')],_0x503a7e[_0xbf28('0x6a')]['id'],_0x49e529[_0xbf28('0x58')]?JSON[_0xbf28('0x6b')](_0x49e529[_0xbf28('0x58')]):_0xbf28('0x6c'));return respondWithRpcPromise(_0xbf28('0x6d'),_0xbf28('0x6e'),_0x503a7e);}return null;})['then'](function(_0x164d09){var _0x12a764=_0xbf28('0x6f')+_0x164d09[_0xbf28('0x26')]['ContactId'];return db['sequelize'][_0xbf28('0x3d')](_0x12a764,{'type':db[_0xbf28('0x70')][_0xbf28('0x71')][_0xbf28('0x72')],'raw':!![]})[_0xbf28('0x20')](function(_0x1c992b){return _0x1c992b;});})[_0xbf28('0x20')](function(_0x26c3d7){if(_0x26c3d7){_0x503a7e[_0xbf28('0x26')][_0xbf28('0x73')]=_0x26c3d7[0x0];if(!_0x49e529[_0xbf28('0x58')][_0xbf28('0x61')])return;return db['User']['find']({'where':{'id':_0x49e529['body'][_0xbf28('0x61')],'role':_0xbf28('0x62')},'attributes':['id',_0xbf28('0x35'),'fullname',_0xbf28('0x74'),_0xbf28('0x75')],'raw':!![]});}return null;})[_0xbf28('0x20')](function(_0x4b7299){if(!_0x4b7299)return null;_0x503a7e['message'][_0xbf28('0x62')]=_0x4b7299;return _0x503a7e;})[_0xbf28('0x20')](function(_0x1379f0){if(_0x1379f0){if(_0x49e529[_0xbf28('0x58')][_0xbf28('0x76')]){_0x503a7e[_0xbf28('0x26')][_0xbf28('0x77')]=util[_0xbf28('0x5f')](_0xbf28('0x78'),_0x49e529[_0xbf28('0x68')][_0xbf28('0x35')]);_0x503a7e[_0xbf28('0x26')]['channel']=_0x503a7e['channel'];_0x503a7e[_0xbf28('0x26')][_0xbf28('0x79')]=_0x503a7e['channel'];_0x503a7e[_0xbf28('0x26')][_0xbf28('0x7a')]=_0xbf28('0x5c');return respondWithRpcPromise(_0xbf28('0x7b'),_0xbf28('0x7b'),{'event':_0xbf28('0x7c'),'message':_0x503a7e[_0xbf28('0x26')]},client9002)['then'](function(){return _0x503a7e;});}return _0x503a7e;}return null;})[_0xbf28('0x20')](respondWithResult(_0x17f360,null))[_0xbf28('0x50')](handleError(_0x17f360,null));};var interaction_log=require(_0xbf28('0x5a'))(_0xbf28('0x5b'));exports[_0xbf28('0x31')]=function(_0xda89df,_0x5bb47b,_0x25a681){var _0x568671={'agent':{},'channel':_0xbf28('0x7d')};if(_0xda89df[_0xbf28('0x58')]['id']){delete _0xda89df[_0xbf28('0x58')]['id'];}_0xda89df[_0xbf28('0x58')][_0xbf28('0x61')]=_0xda89df[_0xbf28('0x58')][_0xbf28('0x61')]||_0xda89df[_0xbf28('0x68')]['id'];_0x568671['agent']['id']=_0xda89df[_0xbf28('0x58')][_0xbf28('0x61')];return db[_0xbf28('0x39')][_0xbf28('0x56')]({'where':{'id':_0xda89df[_0xbf28('0x52')]['id'],'UserId':null}})[_0xbf28('0x20')](handleEntityNotFound(_0x5bb47b,null))[_0xbf28('0x20')](function(_0x38b28b){if(_0x38b28b){_0x568671['message']=_0x38b28b['get']({'plain':!![]});return db['WhatsappInteraction'][_0xbf28('0x56')]({'where':{'id':_0x38b28b[_0xbf28('0x65')]}});}return null;})[_0xbf28('0x20')](handleEntityNotFound(_0x5bb47b,null))[_0xbf28('0x20')](function(_0x10ecb7){if(_0x10ecb7){_0x568671[_0xbf28('0x6a')]=_0x10ecb7[_0xbf28('0x63')]({'plain':!![]});interaction_log[_0xbf28('0x27')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xda89df[_0xbf28('0x68')]['id'],_0xda89df[_0xbf28('0x68')][_0xbf28('0x35')],_0xda89df[_0xbf28('0x68')]['role'],_0x568671[_0xbf28('0x6a')]['id'],_0xda89df['body']?JSON[_0xbf28('0x6b')](_0xda89df[_0xbf28('0x58')]):_0xbf28('0x6c'));return respondWithRpcPromise(_0xbf28('0x7e'),_0xbf28('0x7f'),_0x568671);}return null;})[_0xbf28('0x20')](function(_0xd8b203){var _0x369d3a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd8b203['message'][_0xbf28('0x80')];return db[_0xbf28('0x81')][_0xbf28('0x3d')](_0x369d3a,{'type':db[_0xbf28('0x70')][_0xbf28('0x71')]['SELECT'],'raw':!![]})[_0xbf28('0x20')](function(_0x138fbc){return _0x138fbc;});})[_0xbf28('0x20')](function(_0x9123d8){if(_0x9123d8){_0x568671[_0xbf28('0x26')][_0xbf28('0x73')]=_0x9123d8[0x0];if(!_0xda89df[_0xbf28('0x58')][_0xbf28('0x61')])return;return db['User'][_0xbf28('0x56')]({'where':{'id':_0xda89df[_0xbf28('0x58')][_0xbf28('0x61')],'role':'agent'},'attributes':['id',_0xbf28('0x35'),_0xbf28('0x82'),_0xbf28('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x9e033c){if(!_0x9e033c)return null;_0x568671['message']['agent']=_0x9e033c;return _0x568671;})[_0xbf28('0x20')](function(_0x5182fe){if(_0x5182fe){_0x5182fe['message'][_0xbf28('0x77')]=util['format'](_0xbf28('0x78'),_0xda89df[_0xbf28('0x68')][_0xbf28('0x35')]);_0x5182fe['message']['channel']=_0x568671[_0xbf28('0x83')];_0x5182fe[_0xbf28('0x26')][_0xbf28('0x79')]=_0x568671[_0xbf28('0x83')];_0x5182fe[_0xbf28('0x26')][_0xbf28('0x7a')]=_0xbf28('0x31');respondWithRpcPromise(_0xbf28('0x7b'),_0xbf28('0x7b'),{'event':_0xbf28('0x84'),'message':_0x5182fe[_0xbf28('0x26')]},client9002);return _0x568671;}return null;})['then'](respondWithResult(_0x5bb47b,null))[_0xbf28('0x50')](handleError(_0x5bb47b,null));};exports[_0xbf28('0x2a')]=function(_0x5e0df8,_0x1a972e,_0x590cdf){if(_0x5e0df8[_0xbf28('0x58')]['id']){delete _0x5e0df8[_0xbf28('0x58')]['id'];}var _0x3cc68e;return db[_0xbf28('0x39')][_0xbf28('0x56')]({'where':{'id':_0x5e0df8[_0xbf28('0x52')]['id']}})[_0xbf28('0x20')](handleEntityNotFound(_0x1a972e,null))[_0xbf28('0x20')](function(_0x180f61){if(_0x180f61){_0x3cc68e=_0x180f61;return db[_0xbf28('0x85')][_0xbf28('0x56')]({'where':{'id':_0x180f61['WhatsappAccountId']}});}})[_0xbf28('0x20')](handleEntityNotFound(_0x1a972e,null))[_0xbf28('0x20')](function(_0x42f2b2){if(_0x42f2b2){logger['debug'](_0xbf28('0x86'),_0xbf28('0x2a'),'received\x20delivery\x20report\x20from',_0x42f2b2[_0xbf28('0x48')],util[_0xbf28('0x87')](_0x5e0df8[_0xbf28('0x58')],{'showHidden':![],'depth':null}));switch(_0x42f2b2[_0xbf28('0x48')]){case _0xbf28('0x88'):if(_0x5e0df8[_0xbf28('0x58')][_0xbf28('0x89')]&&_0x5e0df8[_0xbf28('0x58')][_0xbf28('0x89')]===_0x3cc68e['messageId']&&_0x5e0df8['body'][_0xbf28('0x8a')]&&_0x5e0df8['body'][_0xbf28('0x8a')]===_0xbf28('0x5d')){return _0x3cc68e['update']({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xbf28('0x2a'),_0xbf28('0x88'),util['inspect'](_0x5e0df8[_0xbf28('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x3cc68e;}})['then'](respondWithResult(_0x1a972e,null))[_0xbf28('0x50')](handleError(_0x1a972e,null));};
\ No newline at end of file
index b9fc44b..1d233e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5423=['hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5423,0xe3));var _0x3542=function(_0x26eeb7,_0x11054b){_0x26eeb7=_0x26eeb7-0x0;var _0x31090=_0x5423[_0x26eeb7];return _0x31090;};'use strict';var EventEmitter=require(_0x3542('0x0'));var WhatsappMessage=require(_0x3542('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x3542('0x2')](0x0);var events={'afterCreate':_0x3542('0x3'),'afterUpdate':'update','afterDestroy':_0x3542('0x4')};function emitEvent(_0x1202d5){return function(_0xf0835,_0x2a1864,_0x54ea2f){WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5+':'+_0xf0835['id'],_0xf0835);WhatsappMessageEvents[_0x3542('0x5')](_0x1202d5,_0xf0835);_0x54ea2f(null);};}for(var e in events){if(events[_0x3542('0x6')](e)){var event=events[e];WhatsappMessage[_0x3542('0x7')](e,emitEvent(event));}}module[_0x3542('0x8')]=WhatsappMessageEvents;
\ No newline at end of file
+var _0x1ba2=['remove','emit','hasOwnProperty','exports','events','WhatsappMessage','save','update'];(function(_0x49472a,_0x516ce3){var _0x64fbcc=function(_0x1a8c79){while(--_0x1a8c79){_0x49472a['push'](_0x49472a['shift']());}};_0x64fbcc(++_0x516ce3);}(_0x1ba2,0xb4));var _0x21ba=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1ba2[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x21ba('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x21ba('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x21ba('0x2'),'afterUpdate':_0x21ba('0x3'),'afterDestroy':_0x21ba('0x4')};function emitEvent(_0xface0a){return function(_0x3661dd,_0x527ad5,_0x36e207){WhatsappMessageEvents[_0x21ba('0x5')](_0xface0a+':'+_0x3661dd['id'],_0x3661dd);WhatsappMessageEvents['emit'](_0xface0a,_0x3661dd);_0x36e207(null);};}for(var e in events){if(events[_0x21ba('0x6')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0x21ba('0x7')]=WhatsappMessageEvents;
\ No newline at end of file
index 27f3be0..b47ec53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7639=['accountSid','authToken','phone','messages','create','body','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/messages/','text','POST','Bearer\x20','statuses','message_id','err','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','WhatsappAccountId','twilio'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x7639,0x14b));var _0x9763=function(_0xe1f3b6,_0x3c23d7){_0xe1f3b6=_0xe1f3b6-0x0;var _0x5ff84a=_0x7639[_0xe1f3b6];return _0x5ff84a;};'use strict';var _=require(_0x9763('0x0'));var util=require('util');var logger=require(_0x9763('0x1'))(_0x9763('0x2'));var moment=require(_0x9763('0x3'));var BPromise=require(_0x9763('0x4'));var rp=require(_0x9763('0x5'));var fetch=require(_0x9763('0x6'));var fs=require('fs');var path=require(_0x9763('0x7'));var rimraf=require(_0x9763('0x8'));var config=require(_0x9763('0x9'));var attributes=require(_0x9763('0xa'));module[_0x9763('0xb')]=function(_0x15dd4b,_0x400cc9){return _0x15dd4b[_0x9763('0xc')](_0x9763('0xd'),attributes,{'tableName':_0x9763('0xe'),'paranoid':![],'indexes':[{'name':_0x9763('0xf'),'fields':['messageId']},{'name':_0x9763('0x10'),'fields':['body'],'type':_0x9763('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b57e2,_0x2d34b7,_0x2d9090){var _0x220ff6=_0x15dd4b[_0x9763('0x12')];var _0x5a5409=_0x5b57e2['get']({'plain':!![]});if(_0x5a5409[_0x9763('0x13')][_0x9763('0x14')]()==='in'||_0x5a5409[_0x9763('0x13')][_0x9763('0x14')]()===_0x9763('0x15')&&!_0x5a5409[_0x9763('0x16')]&&!_[_0x9763('0x17')](_0x5a5409[_0x9763('0x18')])){_0x220ff6[_0x9763('0x19')][_0x9763('0x1a')]({'where':{'id':_0x5a5409[_0x9763('0x1b')]}})[_0x9763('0x1c')](function(_0x3b32a0){if(_0x3b32a0){_0x3b32a0[_0x9763('0x1d')]({'lastMsgAt':_0x5a5409[_0x9763('0x1e')],'lastMsgDirection':_0x5a5409[_0x9763('0x13')][_0x9763('0x14')]()});}})[_0x9763('0x1f')](function(_0x46b462){console[_0x9763('0x20')](_0x46b462);});}if(_0x5a5409[_0x9763('0x13')]===_0x9763('0x15')&&!_0x5a5409[_0x9763('0x16')]){var _0x3e401e;_0x220ff6['WhatsappAccount']['find']({'where':{'id':_0x5a5409[_0x9763('0x21')]},'raw':!![]})[_0x9763('0x1c')](function(_0x1dba3a){_0x3e401e=_0x1dba3a;if(_0x3e401e&&_0x3e401e['type']){switch(_0x3e401e['type']){case _0x9763('0x22'):var _0x3e17a7=require(_0x9763('0x22'));if(_0x3e401e[_0x9763('0x23')]&&_0x3e401e[_0x9763('0x24')]&&_0x3e401e[_0x9763('0x25')]){var _0x2a0839=new _0x3e17a7(_0x3e401e[_0x9763('0x23')],_0x3e401e[_0x9763('0x24')]);_0x2a0839[_0x9763('0x26')][_0x9763('0x27')]({'body':_0x5a5409[_0x9763('0x28')],'to':_0x9763('0x29')+_0x5a5409['phone'],'from':_0x9763('0x29')+_0x3e401e[_0x9763('0x25')],'statusCallback':_0x3e401e[_0x9763('0x2a')]+_0x9763('0x2b')+_0x5a5409['id']+_0x9763('0x2c')+_0x3e401e[_0x9763('0x2d')]})[_0x9763('0x1c')](function(_0x56c125){if(_0x56c125[_0x9763('0x2e')]){return _0x5b57e2['update']({'messageId':_0x56c125[_0x9763('0x2e')]});}})[_0x9763('0x1f')](function(_0x2e13e0){logger[_0x9763('0x20')](_0x9763('0x2f'),_0x9763('0x30'),_0x9763('0x22'),util['inspect'](_0x2e13e0,{'showHidden':![],'depth':null}));});}else{logger[_0x9763('0x20')](_0x9763('0x2f'),_0x9763('0x30'),_0x9763('0x22'),_0x9763('0x31'));}break;case _0x9763('0x32'):var _0xa7b0b2=_0x3e401e[_0x9763('0x23')];var _0x4768f6=_0x3e401e['authToken'];var _0x21c282=_0x3e401e[_0x9763('0x33')]+'/whatsapp/v1/'+_0xa7b0b2+_0x9763('0x34');var _0x568d1e={'to':[_0x5a5409[_0x9763('0x25')]],'message':{'type':_0x9763('0x35'),'text':_0x5a5409[_0x9763('0x28')]}};var _0x267f76={'method':_0x9763('0x36'),'uri':_0x21c282,'headers':{'Authorization':_0x9763('0x37')+_0x4768f6,'Content-Type':'application/json'},'body':_0x568d1e,'json':!![]};rp(_0x267f76)[_0x9763('0x1c')](function(_0x2b6de7){if(_0x2b6de7[_0x9763('0x38')][0x0]['message_id']){return _0x5b57e2[_0x9763('0x1d')]({'messageId':_0x2b6de7['statuses'][0x0][_0x9763('0x39')]});}})['catch'](function(_0x4e03a1){logger[_0x9763('0x3a')]('WhatsappMessage,\x20%s',_0x4e03a1);});break;}}})[_0x9763('0x3b')](function(){_0x2d9090();});}else{_0x2d9090();}}},'charset':_0x9763('0x3c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x16c2=['text','POST','Bearer\x20','statuses','message_id','err','WhatsappMessage,\x20%s','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl'];(function(_0x4ba939,_0x3e193a){var _0xea269b=function(_0x4c76ce){while(--_0x4c76ce){_0x4ba939['push'](_0x4ba939['shift']());}};_0xea269b(++_0x3e193a);}(_0x16c2,0x19e));var _0x216c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16c2[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x216c('0x0'));var util=require(_0x216c('0x1'));var logger=require(_0x216c('0x2'))(_0x216c('0x3'));var moment=require(_0x216c('0x4'));var BPromise=require('bluebird');var rp=require(_0x216c('0x5'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0x216c('0x6'));var rimraf=require('rimraf');var config=require(_0x216c('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0x216c('0x8')]=function(_0x2c9b60,_0xa734e5){return _0x2c9b60[_0x216c('0x9')](_0x216c('0xa'),attributes,{'tableName':_0x216c('0xb'),'paranoid':![],'indexes':[{'name':_0x216c('0xc'),'fields':['messageId']},{'name':_0x216c('0xd'),'fields':[_0x216c('0xe')],'type':_0x216c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1aca0f,_0x54e867,_0x1d80cb){var _0x9af2bf=_0x2c9b60[_0x216c('0x10')];var _0x26d693=_0x1aca0f[_0x216c('0x11')]({'plain':!![]});if(_0x26d693[_0x216c('0x12')][_0x216c('0x13')]()==='in'||_0x26d693[_0x216c('0x12')][_0x216c('0x13')]()===_0x216c('0x14')&&!_0x26d693['secret']&&!_[_0x216c('0x15')](_0x26d693['UserId'])){_0x9af2bf[_0x216c('0x16')][_0x216c('0x17')]({'where':{'id':_0x26d693[_0x216c('0x18')]}})[_0x216c('0x19')](function(_0x3e5048){if(_0x3e5048){_0x3e5048[_0x216c('0x1a')]({'lastMsgAt':_0x26d693[_0x216c('0x1b')],'lastMsgDirection':_0x26d693['direction']['toLowerCase']()});}})[_0x216c('0x1c')](function(_0x59e32f){console[_0x216c('0x1d')](_0x59e32f);});}if(_0x26d693['direction']===_0x216c('0x14')&&!_0x26d693[_0x216c('0x1e')]){var _0x473c55;_0x9af2bf[_0x216c('0x1f')]['find']({'where':{'id':_0x26d693[_0x216c('0x20')]},'raw':!![]})[_0x216c('0x19')](function(_0x22b9b4){_0x473c55=_0x22b9b4;if(_0x473c55&&_0x473c55[_0x216c('0x21')]){switch(_0x473c55[_0x216c('0x21')]){case _0x216c('0x22'):var _0x2c4267=require(_0x216c('0x22'));if(_0x473c55[_0x216c('0x23')]&&_0x473c55[_0x216c('0x24')]&&_0x473c55[_0x216c('0x25')]){var _0x489f9b=new _0x2c4267(_0x473c55[_0x216c('0x23')],_0x473c55[_0x216c('0x24')]);_0x489f9b['messages'][_0x216c('0x26')]({'body':_0x26d693[_0x216c('0xe')],'to':_0x216c('0x27')+_0x26d693['phone'],'from':_0x216c('0x27')+_0x473c55[_0x216c('0x25')],'statusCallback':_0x473c55[_0x216c('0x28')]+_0x216c('0x29')+_0x26d693['id']+_0x216c('0x2a')+_0x473c55[_0x216c('0x2b')]})['then'](function(_0x4dd457){if(_0x4dd457['sid']){return _0x1aca0f[_0x216c('0x1a')]({'messageId':_0x4dd457[_0x216c('0x2c')]});}})[_0x216c('0x1c')](function(_0xa79e96){logger[_0x216c('0x1d')](_0x216c('0x2d'),_0x216c('0x2e'),_0x216c('0x22'),util[_0x216c('0x2f')](_0xa79e96,{'showHidden':![],'depth':null}));});}else{logger[_0x216c('0x1d')](_0x216c('0x2d'),_0x216c('0x2e'),'twilio',_0x216c('0x30'));}break;case'sinch':var _0x5207ab=_0x473c55[_0x216c('0x23')];var _0x2f319e=_0x473c55[_0x216c('0x24')];var _0x3ff60f=_0x473c55[_0x216c('0x31')]+'/whatsapp/v1/'+_0x5207ab+'/messages/';var _0x1d28b0={'to':[_0x26d693[_0x216c('0x25')]],'message':{'type':_0x216c('0x32'),'text':_0x26d693[_0x216c('0xe')]}};var _0x3d3ef9={'method':_0x216c('0x33'),'uri':_0x3ff60f,'headers':{'Authorization':_0x216c('0x34')+_0x2f319e,'Content-Type':'application/json'},'body':_0x1d28b0,'json':!![]};rp(_0x3d3ef9)['then'](function(_0x519577){if(_0x519577['statuses'][0x0]['message_id']){return _0x1aca0f['update']({'messageId':_0x519577[_0x216c('0x35')][0x0][_0x216c('0x36')]});}})[_0x216c('0x1c')](function(_0x1e43fa){logger[_0x216c('0x37')](_0x216c('0x38'),_0x1e43fa);});break;}}})['finally'](function(){_0x1d80cb();});}else{_0x1d80cb();}}},'charset':'utf8mb4','collate':_0x216c('0x39')});};
\ No newline at end of file
index dcd8b69..5341d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb00=['./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','stringify','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeb00,0x14e));var _0x0eb0=function(_0x4103bc,_0x533ffc){_0x4103bc=_0x4103bc-0x0;var _0xe9dcce=_0xeb00[_0x4103bc];return _0xe9dcce;};'use strict';var _=require('lodash');var util=require(_0x0eb0('0x0'));var moment=require('moment');var BPromise=require(_0x0eb0('0x1'));var rs=require(_0x0eb0('0x2'));var fs=require('fs');var Redis=require(_0x0eb0('0x3'));var db=require(_0x0eb0('0x4'))['db'];var utils=require(_0x0eb0('0x5'));var logger=require(_0x0eb0('0x6'))(_0x0eb0('0x7'));var config=require(_0x0eb0('0x8'));var jayson=require(_0x0eb0('0x9'));var client=jayson[_0x0eb0('0xa')][_0x0eb0('0xb')]({'port':0x232a});config['redis']=_[_0x0eb0('0xc')](config[_0x0eb0('0xd')],{'host':_0x0eb0('0xe'),'port':0x18eb});var socket=require(_0x0eb0('0xf'))(new Redis(config[_0x0eb0('0xd')]));require(_0x0eb0('0x10'))[_0x0eb0('0x11')](socket);function respondWithRpcPromise(_0x3c560f,_0x249761,_0x25efa3){return new BPromise(function(_0x94a6c5,_0x51f3f6){return client['request'](_0x3c560f,_0x25efa3)[_0x0eb0('0x12')](function(_0x159a02){logger[_0x0eb0('0x13')](_0x0eb0('0x14'),_0x249761,'request\x20sent');logger[_0x0eb0('0x15')](_0x0eb0('0x16'),_0x249761,'request\x20sent',JSON['stringify'](_0x159a02));if(_0x159a02[_0x0eb0('0x17')]){if(_0x159a02['error'][_0x0eb0('0x18')]===0x1f4){logger['error'](_0x0eb0('0x14'),_0x249761,_0x159a02[_0x0eb0('0x17')]['message']);return _0x51f3f6(_0x159a02[_0x0eb0('0x17')][_0x0eb0('0x19')]);}logger[_0x0eb0('0x17')](_0x0eb0('0x14'),_0x249761,_0x159a02[_0x0eb0('0x17')][_0x0eb0('0x19')]);return _0x94a6c5(_0x159a02[_0x0eb0('0x17')]['message']);}else{logger[_0x0eb0('0x13')](_0x0eb0('0x14'),_0x249761,_0x0eb0('0x1a'));_0x94a6c5(_0x159a02['result'][_0x0eb0('0x19')]);}})['catch'](function(_0x3dd036){logger[_0x0eb0('0x17')]('WhatsappMessage,\x20%s,\x20%s',_0x249761,_0x3dd036);_0x51f3f6(_0x3dd036);});});}exports[_0x0eb0('0x1b')]=function(_0x31f5bc){var _0x3a4fc9=this;return new Promise(function(_0x5de365,_0x3d4e97){return db[_0x0eb0('0x1c')][_0x0eb0('0x1d')](_0x31f5bc[_0x0eb0('0x1e')],{'raw':_0x31f5bc[_0x0eb0('0x1f')]?_0x31f5bc[_0x0eb0('0x1f')][_0x0eb0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x61950e){logger[_0x0eb0('0x13')]('CreateWhatsappMessage',_0x31f5bc);logger[_0x0eb0('0x15')]('CreateWhatsappMessage',_0x31f5bc,JSON[_0x0eb0('0x21')](_0x61950e));_0x5de365(_0x61950e);})[_0x0eb0('0x22')](function(_0x186a10){logger[_0x0eb0('0x17')](_0x0eb0('0x1b'),_0x186a10[_0x0eb0('0x19')],_0x31f5bc);_0x3d4e97(_0x3a4fc9['error'](0x1f4,_0x186a10[_0x0eb0('0x19')]));});});};
\ No newline at end of file
+var _0x2605=['../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x2605,0x1ae));var _0x5260=function(_0x3932eb,_0x43b210){_0x3932eb=_0x3932eb-0x0;var _0x5316e5=_0x2605[_0x3932eb];return _0x5316e5;};'use strict';var _=require('lodash');var util=require(_0x5260('0x0'));var moment=require('moment');var BPromise=require(_0x5260('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5260('0x2'));var db=require(_0x5260('0x3'))['db'];var utils=require(_0x5260('0x4'));var logger=require('../../config/logger')(_0x5260('0x5'));var config=require(_0x5260('0x6'));var jayson=require(_0x5260('0x7'));var client=jayson[_0x5260('0x8')]['http']({'port':0x232a});config[_0x5260('0x9')]=_[_0x5260('0xa')](config[_0x5260('0x9')],{'host':_0x5260('0xb'),'port':0x18eb});var socket=require(_0x5260('0xc'))(new Redis(config['redis']));require(_0x5260('0xd'))[_0x5260('0xe')](socket);function respondWithRpcPromise(_0x40332f,_0xd9a5a7,_0x53f359){return new BPromise(function(_0xa92d6c,_0x238e21){return client[_0x5260('0xf')](_0x40332f,_0x53f359)[_0x5260('0x10')](function(_0x2dd655){logger[_0x5260('0x11')](_0x5260('0x12'),_0xd9a5a7,_0x5260('0x13'));logger[_0x5260('0x14')](_0x5260('0x15'),_0xd9a5a7,_0x5260('0x13'),JSON[_0x5260('0x16')](_0x2dd655));if(_0x2dd655['error']){if(_0x2dd655[_0x5260('0x17')]['code']===0x1f4){logger[_0x5260('0x17')](_0x5260('0x12'),_0xd9a5a7,_0x2dd655[_0x5260('0x17')][_0x5260('0x18')]);return _0x238e21(_0x2dd655[_0x5260('0x17')][_0x5260('0x18')]);}logger[_0x5260('0x17')](_0x5260('0x12'),_0xd9a5a7,_0x2dd655['error'][_0x5260('0x18')]);return _0xa92d6c(_0x2dd655[_0x5260('0x17')][_0x5260('0x18')]);}else{logger[_0x5260('0x11')](_0x5260('0x12'),_0xd9a5a7,_0x5260('0x13'));_0xa92d6c(_0x2dd655[_0x5260('0x19')][_0x5260('0x18')]);}})[_0x5260('0x1a')](function(_0x1e77d5){logger[_0x5260('0x17')](_0x5260('0x12'),_0xd9a5a7,_0x1e77d5);_0x238e21(_0x1e77d5);});});}exports[_0x5260('0x1b')]=function(_0x20ea5f){var _0x56092c=this;return new Promise(function(_0x5f4d8c,_0x538cd2){return db['WhatsappMessage']['create'](_0x20ea5f[_0x5260('0x1c')],{'raw':_0x20ea5f[_0x5260('0x1d')]?_0x20ea5f[_0x5260('0x1d')][_0x5260('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x5a005f){logger['info'](_0x5260('0x1b'),_0x20ea5f);logger[_0x5260('0x14')]('CreateWhatsappMessage',_0x20ea5f,JSON[_0x5260('0x16')](_0x5a005f));_0x5f4d8c(_0x5a005f);})[_0x5260('0x1a')](function(_0xf3da3d){logger[_0x5260('0x17')](_0x5260('0x1b'),_0xf3da3d['message'],_0x20ea5f);_0x538cd2(_0x56092c[_0x5260('0x17')](0x1f4,_0xf3da3d[_0x5260('0x18')]));});});};
\ No newline at end of file
index 9c08444..29c7f1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4da9=['whatsappMessage:','./whatsappMessage.events','save','remove','register'];(function(_0x102b62,_0x10d6c3){var _0x1e9d02=function(_0xc30f6f){while(--_0xc30f6f){_0x102b62['push'](_0x102b62['shift']());}};_0x1e9d02(++_0x10d6c3);}(_0x4da9,0x8d));var _0x94da=function(_0x13a0aa,_0x4da927){_0x13a0aa=_0x13a0aa-0x0;var _0x4e9c98=_0x4da9[_0x13a0aa];return _0x4e9c98;};'use strict';var WhatsappMessageEvents=require(_0x94da('0x0'));var events=[_0x94da('0x1'),_0x94da('0x2'),'update'];function createListener(_0xe46538,_0x1d0e1b){return function(_0x463aa2){_0x1d0e1b['emit'](_0xe46538,_0x463aa2);};}function removeListener(_0x1ebf60,_0x258abe){return function(){WhatsappMessageEvents['removeListener'](_0x1ebf60,_0x258abe);};}exports[_0x94da('0x3')]=function(_0x48600a){for(var _0x20a72b=0x0,_0xb117c5=events['length'];_0x20a72b<_0xb117c5;_0x20a72b++){var _0x6154c6=events[_0x20a72b];var _0x2a3136=createListener(_0x94da('0x4')+_0x6154c6,_0x48600a);WhatsappMessageEvents['on'](_0x6154c6,_0x2a3136);}};
\ No newline at end of file
+var _0xd1ee=['./whatsappMessage.events','save','remove','update','emit','removeListener','register','whatsappMessage:'];(function(_0x46dc0e,_0x2a27e9){var _0x3b5f28=function(_0x42457e){while(--_0x42457e){_0x46dc0e['push'](_0x46dc0e['shift']());}};_0x3b5f28(++_0x2a27e9);}(_0xd1ee,0xe8));var _0xed1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd1ee[_0x3dd15e];return _0x231fd0;};'use strict';var WhatsappMessageEvents=require(_0xed1e('0x0'));var events=[_0xed1e('0x1'),_0xed1e('0x2'),_0xed1e('0x3')];function createListener(_0x18c34a,_0xcbdd3){return function(_0x2927fe){_0xcbdd3[_0xed1e('0x4')](_0x18c34a,_0x2927fe);};}function removeListener(_0x438ba3,_0x595637){return function(){WhatsappMessageEvents[_0xed1e('0x5')](_0x438ba3,_0x595637);};}exports[_0xed1e('0x6')]=function(_0xee53f9){for(var _0x35189c=0x0,_0x4235f3=events['length'];_0x35189c<_0x4235f3;_0x35189c++){var _0x56c4b0=events[_0x35189c];var _0x7aad08=createListener(_0xed1e('0x7')+_0x56c4b0,_0xee53f9);WhatsappMessageEvents['on'](_0x56c4b0,_0x7aad08);}};
\ No newline at end of file
index ea8d616..637b766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f4=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x4cd8a0,_0x49df82){var _0x30e1d1=function(_0x4eb3d1){while(--_0x4eb3d1){_0x4cd8a0['push'](_0x4cd8a0['shift']());}};_0x30e1d1(++_0x49df82);}(_0x93f4,0x72));var _0x493f=function(_0x205727,_0x406832){_0x205727=_0x205727-0x0;var _0x7fe36f=_0x93f4[_0x205727];return _0x7fe36f;};'use strict';var multer=require(_0x493f('0x0'));var util=require(_0x493f('0x1'));var path=require(_0x493f('0x2'));var timeout=require(_0x493f('0x3'));var express=require(_0x493f('0x4'));var router=express['Router']();var fs_extra=require(_0x493f('0x5'));var auth=require(_0x493f('0x6'));var interaction=require(_0x493f('0x7'));var config=require(_0x493f('0x8'));var controller=require(_0x493f('0x9'));router[_0x493f('0xa')]('/',auth[_0x493f('0xb')](),controller[_0x493f('0xc')]);router[_0x493f('0xa')](_0x493f('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x493f('0xa')](_0x493f('0xe'),auth[_0x493f('0xb')](),controller[_0x493f('0xf')]);router['get'](_0x493f('0x10'),auth[_0x493f('0xb')](),controller[_0x493f('0x11')]);router[_0x493f('0xa')](_0x493f('0x12'),auth['isAuthenticated'](),controller[_0x493f('0x13')]);router[_0x493f('0xa')](_0x493f('0x14'),auth[_0x493f('0xb')](),controller[_0x493f('0x15')]);router[_0x493f('0x16')]('/',auth[_0x493f('0xb')](),controller[_0x493f('0x17')]);router[_0x493f('0x16')](_0x493f('0x12'),auth[_0x493f('0xb')](),controller[_0x493f('0x18')]);router[_0x493f('0x16')]('/:id/users',auth[_0x493f('0xb')](),controller[_0x493f('0x19')]);router[_0x493f('0x1a')](_0x493f('0xe'),auth[_0x493f('0xb')](),controller[_0x493f('0x1b')]);router[_0x493f('0x1c')](_0x493f('0xe'),auth[_0x493f('0xb')](),controller[_0x493f('0x1d')]);router[_0x493f('0x1c')](_0x493f('0x12'),auth[_0x493f('0xb')](),controller['removeTeams']);router[_0x493f('0x1c')](_0x493f('0x14'),auth[_0x493f('0xb')](),controller[_0x493f('0x1e')]);module[_0x493f('0x1f')]=router;
\ No newline at end of file
+var _0xad97=['/:id/users','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','show','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams'];(function(_0x382b77,_0x33803a){var _0x78205d=function(_0x4783fa){while(--_0x4783fa){_0x382b77['push'](_0x382b77['shift']());}};_0x78205d(++_0x33803a);}(_0xad97,0xdc));var _0x7ad9=function(_0x3b57d2,_0x440aa9){_0x3b57d2=_0x3b57d2-0x0;var _0x5a133f=_0xad97[_0x3b57d2];return _0x5a133f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7ad9('0x0'));var timeout=require('connect-timeout');var express=require(_0x7ad9('0x1'));var router=express[_0x7ad9('0x2')]();var fs_extra=require(_0x7ad9('0x3'));var auth=require(_0x7ad9('0x4'));var interaction=require(_0x7ad9('0x5'));var config=require(_0x7ad9('0x6'));var controller=require('./whatsappQueue.controller');router['get']('/',auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x8')]);router[_0x7ad9('0x9')](_0x7ad9('0xa'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0xb')]);router['get']('/:id',auth[_0x7ad9('0x7')](),controller[_0x7ad9('0xc')]);router[_0x7ad9('0x9')]('/:id/members',auth[_0x7ad9('0x7')](),controller[_0x7ad9('0xd')]);router['get'](_0x7ad9('0xe'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0xf')]);router[_0x7ad9('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x7ad9('0x10')]);router[_0x7ad9('0x11')]('/',auth['isAuthenticated'](),controller[_0x7ad9('0x12')]);router[_0x7ad9('0x11')](_0x7ad9('0xe'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x13')]);router[_0x7ad9('0x11')](_0x7ad9('0x14'),auth['isAuthenticated'](),controller[_0x7ad9('0x15')]);router[_0x7ad9('0x16')](_0x7ad9('0x17'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x18')]);router[_0x7ad9('0x19')](_0x7ad9('0x17'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x1a')]);router[_0x7ad9('0x19')](_0x7ad9('0xe'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x1b')]);router[_0x7ad9('0x19')](_0x7ad9('0x14'),auth[_0x7ad9('0x7')](),controller[_0x7ad9('0x1c')]);module[_0x7ad9('0x1d')]=router;
\ No newline at end of file
index deb2821..0a9d505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bc=['ENUM','rrmemory','beepall','roundrobin','exports','STRING','INTEGER'];(function(_0x2a2be6,_0x3ece79){var _0x596764=function(_0x443366){while(--_0x443366){_0x2a2be6['push'](_0x2a2be6['shift']());}};_0x596764(++_0x3ece79);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xca0b('0x0')]={'name':{'type':Sequelize[_0xca0b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xca0b('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xca0b('0x3')](_0xca0b('0x4'),_0xca0b('0x5'),_0xca0b('0x6'))},'description':{'type':Sequelize[_0xca0b('0x1')]}};
\ No newline at end of file
+var _0x9bb4=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x54a946,_0x30a84e){var _0x4484af=function(_0x104920){while(--_0x104920){_0x54a946['push'](_0x54a946['shift']());}};_0x4484af(++_0x30a84e);}(_0x9bb4,0xd5));var _0x49bb=function(_0x1ebf43,_0x1de1f6){_0x1ebf43=_0x1ebf43-0x0;var _0x5a50d7=_0x9bb4[_0x1ebf43];return _0x5a50d7;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'name':{'type':Sequelize[_0x49bb('0x2')],'unique':_0x49bb('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x49bb('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x49bb('0x5')](_0x49bb('0x6'),_0x49bb('0x7'),_0x49bb('0x8'))},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 8eebb41..abba4ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bfe=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','get','WhatsappQueues','UserProfileResource','stack','name','send','map','WhatsappQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','params','options','find','create','body','user','role','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','hasOwnProperty','WhatsappQueueId','findAll','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','getTeams','findOne','Team','addTeams','ids','Agents','online','flatMap','sequelize','transaction','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x52ac9e,_0x27b8e6){var _0x2c035d=function(_0x2516c2){while(--_0x2516c2){_0x52ac9e['push'](_0x52ac9e['shift']());}};_0x2c035d(++_0x27b8e6);}(_0x6bfe,0x6f));var _0xe6bf=function(_0x4e1446,_0x294968){_0x4e1446=_0x4e1446-0x0;var _0x54f052=_0x6bfe[_0x4e1446];return _0x54f052;};'use strict';var emlformat=require(_0xe6bf('0x0'));var rimraf=require(_0xe6bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe6bf('0x2'));var rp=require(_0xe6bf('0x3'));var moment=require(_0xe6bf('0x4'));var BPromise=require(_0xe6bf('0x5'));var Mustache=require(_0xe6bf('0x6'));var util=require(_0xe6bf('0x7'));var path=require('path');var sox=require(_0xe6bf('0x8'));var csv=require(_0xe6bf('0x9'));var ejs=require(_0xe6bf('0xa'));var fs=require('fs');var fs_extra=require(_0xe6bf('0xb'));var _=require('lodash');var squel=require(_0xe6bf('0xc'));var crypto=require(_0xe6bf('0xd'));var jsforce=require(_0xe6bf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe6bf('0x9'));var querystring=require(_0xe6bf('0xf'));var Papa=require(_0xe6bf('0x10'));var Redis=require(_0xe6bf('0x11'));var authService=require(_0xe6bf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xe6bf('0x13'));var hardwareService=require(_0xe6bf('0x14'));var logger=require(_0xe6bf('0x15'))(_0xe6bf('0x16'));var utils=require(_0xe6bf('0x17'));var config=require(_0xe6bf('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe6bf('0x19'))['db'];config[_0xe6bf('0x1a')]=_[_0xe6bf('0x1b')](config[_0xe6bf('0x1a')],{'host':_0xe6bf('0x1c'),'port':0x18eb});var socket=require(_0xe6bf('0x1d'))(new Redis(config[_0xe6bf('0x1a')]));require('./whatsappQueue.socket')[_0xe6bf('0x1e')](socket);function respondWithStatusCode(_0x173eb1,_0x23ef37){_0x23ef37=_0x23ef37||0xcc;return function(_0x4a9be8){if(_0x4a9be8){return _0x173eb1[_0xe6bf('0x1f')](_0x23ef37);}return _0x173eb1[_0xe6bf('0x20')](_0x23ef37)[_0xe6bf('0x21')]();};}function respondWithResult(_0x5960cf,_0x3ec6c2){_0x3ec6c2=_0x3ec6c2||0xc8;return function(_0x221d12){if(_0x221d12){return _0x5960cf['status'](_0x3ec6c2)[_0xe6bf('0x22')](_0x221d12);}};}function respondWithFilteredResult(_0x5ae4aa,_0x366745){return function(_0x111bb9){if(_0x111bb9){var _0x930a82=typeof _0x366745[_0xe6bf('0x23')]===_0xe6bf('0x24')&&typeof _0x366745[_0xe6bf('0x25')]==='undefined';var _0x517978=_0x111bb9[_0xe6bf('0x26')];var _0x3a993f=_0x930a82?0x0:_0x366745['offset'];var _0x3b6b4a=_0x930a82?_0x111bb9['count']:_0x366745[_0xe6bf('0x23')]+_0x366745[_0xe6bf('0x25')];var _0x92a1fa;if(_0x3b6b4a>=_0x517978){_0x3b6b4a=_0x517978;_0x92a1fa=0xc8;}else{_0x92a1fa=0xce;}_0x5ae4aa[_0xe6bf('0x20')](_0x92a1fa);return _0x5ae4aa['set'](_0xe6bf('0x27'),_0x3a993f+'-'+_0x3b6b4a+'/'+_0x517978)[_0xe6bf('0x22')](_0x111bb9);}return null;};}function patchUpdates(_0x487115){return function(_0x309898){try{jsonpatch['apply'](_0x309898,_0x487115,!![]);}catch(_0x5918a8){return BPromise[_0xe6bf('0x28')](_0x5918a8);}return _0x309898[_0xe6bf('0x29')]();};}function saveUpdates(_0x3fe45f,_0x3c258d){return function(_0x28e6fc){if(_0x28e6fc){return _0x28e6fc[_0xe6bf('0x2a')](_0x3fe45f)['then'](function(_0x1b8f6a){return _0x1b8f6a;});}return null;};}function removeEntity(_0x466adc,_0x44dc68){return function(_0x4f2726){if(_0x4f2726){return _0x4f2726[_0xe6bf('0x2b')]()[_0xe6bf('0x2c')](function(){var _0x384f1e=_0x4f2726[_0xe6bf('0x2d')]({'plain':!![]});var _0x4f8ca4=_0xe6bf('0x2e');return db[_0xe6bf('0x2f')][_0xe6bf('0x2b')]({'where':{'type':_0x4f8ca4,'resourceId':_0x384f1e['id']}})[_0xe6bf('0x2c')](function(){return _0x4f2726;});})[_0xe6bf('0x2c')](function(){_0x466adc[_0xe6bf('0x20')](0xcc)[_0xe6bf('0x21')]();});}};}function handleEntityNotFound(_0x8bdc67,_0x5920b1){return function(_0x152882){if(!_0x152882){_0x8bdc67[_0xe6bf('0x1f')](0x194);}return _0x152882;};}function handleError(_0x123017,_0xa93918){_0xa93918=_0xa93918||0x1f4;return function(_0x4e9158){logger['error'](_0x4e9158[_0xe6bf('0x30')]);if(_0x4e9158[_0xe6bf('0x31')]){delete _0x4e9158['name'];}_0x123017[_0xe6bf('0x20')](_0xa93918)[_0xe6bf('0x32')](_0x4e9158);};}exports['index']=function(_0x445ade,_0x2c596a){var _0x2adfc5={},_0x23b049={},_0x48ac26={'count':0x0,'rows':[]};var _0x48d338=_[_0xe6bf('0x33')](db[_0xe6bf('0x34')][_0xe6bf('0x35')],function(_0x5ef14c){return{'name':_0x5ef14c[_0xe6bf('0x36')],'type':_0x5ef14c[_0xe6bf('0x37')][_0xe6bf('0x38')]};});_0x23b049[_0xe6bf('0x39')]=_[_0xe6bf('0x33')](_0x48d338,_0xe6bf('0x31'));_0x23b049[_0xe6bf('0x3a')]=_[_0xe6bf('0x3b')](_0x445ade['query']);_0x23b049[_0xe6bf('0x3c')]=_[_0xe6bf('0x3d')](_0x23b049[_0xe6bf('0x39')],_0x23b049[_0xe6bf('0x3a')]);_0x2adfc5[_0xe6bf('0x3e')]=_[_0xe6bf('0x3d')](_0x23b049[_0xe6bf('0x39')],qs[_0xe6bf('0x3f')](_0x445ade[_0xe6bf('0x3a')][_0xe6bf('0x3f')]));_0x2adfc5[_0xe6bf('0x3e')]=_0x2adfc5[_0xe6bf('0x3e')][_0xe6bf('0x40')]?_0x2adfc5[_0xe6bf('0x3e')]:_0x23b049[_0xe6bf('0x39')];if(!_0x445ade[_0xe6bf('0x3a')]['hasOwnProperty'](_0xe6bf('0x41'))){_0x2adfc5[_0xe6bf('0x25')]=qs['limit'](_0x445ade[_0xe6bf('0x3a')][_0xe6bf('0x25')]);_0x2adfc5[_0xe6bf('0x23')]=qs[_0xe6bf('0x23')](_0x445ade[_0xe6bf('0x3a')][_0xe6bf('0x23')]);}_0x2adfc5[_0xe6bf('0x42')]=qs[_0xe6bf('0x43')](_0x445ade['query'][_0xe6bf('0x43')]);_0x2adfc5[_0xe6bf('0x44')]=qs[_0xe6bf('0x3c')](_[_0xe6bf('0x45')](_0x445ade[_0xe6bf('0x3a')],_0x23b049[_0xe6bf('0x3c')]),_0x48d338);if(_0x445ade['query'][_0xe6bf('0x46')]){_0x2adfc5[_0xe6bf('0x44')]=_[_0xe6bf('0x47')](_0x2adfc5[_0xe6bf('0x44')],{'$or':_[_0xe6bf('0x33')](_0x48d338,function(_0x4d9194){if(_0x4d9194['type']!==_0xe6bf('0x48')){var _0x336ff4={};_0x336ff4[_0x4d9194[_0xe6bf('0x31')]]={'$like':'%'+_0x445ade[_0xe6bf('0x3a')][_0xe6bf('0x46')]+'%'};return _0x336ff4;}})});}_0x2adfc5=_['merge']({},_0x2adfc5,_0x445ade['options']);var _0x513caa={'where':_0x2adfc5[_0xe6bf('0x44')]};return db['WhatsappQueue'][_0xe6bf('0x26')](_0x513caa)[_0xe6bf('0x2c')](function(_0x519739){_0x48ac26[_0xe6bf('0x26')]=_0x519739;if(_0x445ade['query'][_0xe6bf('0x49')]){_0x2adfc5[_0xe6bf('0x4a')]=[{'all':!![]}];}return db[_0xe6bf('0x34')]['findAll'](_0x2adfc5);})['then'](function(_0x368297){_0x48ac26[_0xe6bf('0x4b')]=_0x368297;return _0x48ac26;})['then'](respondWithFilteredResult(_0x2c596a,_0x2adfc5))['catch'](handleError(_0x2c596a,null));};exports['show']=function(_0x1131a6,_0x2fa679){var _0xc371b={'raw':!![],'where':{'id':_0x1131a6[_0xe6bf('0x4c')]['id']}},_0x4d1a0d={};_0x4d1a0d[_0xe6bf('0x39')]=_[_0xe6bf('0x3b')](db[_0xe6bf('0x34')][_0xe6bf('0x35')]);_0x4d1a0d[_0xe6bf('0x3a')]=_['keys'](_0x1131a6['query']);_0x4d1a0d[_0xe6bf('0x3c')]=_[_0xe6bf('0x3d')](_0x4d1a0d['model'],_0x4d1a0d[_0xe6bf('0x3a')]);_0xc371b['attributes']=_[_0xe6bf('0x3d')](_0x4d1a0d[_0xe6bf('0x39')],qs[_0xe6bf('0x3f')](_0x1131a6['query'][_0xe6bf('0x3f')]));_0xc371b[_0xe6bf('0x3e')]=_0xc371b[_0xe6bf('0x3e')][_0xe6bf('0x40')]?_0xc371b[_0xe6bf('0x3e')]:_0x4d1a0d[_0xe6bf('0x39')];if(_0x1131a6[_0xe6bf('0x3a')]['includeAll']){_0xc371b[_0xe6bf('0x4a')]=[{'all':!![]}];}_0xc371b=_[_0xe6bf('0x47')]({},_0xc371b,_0x1131a6[_0xe6bf('0x4d')]);return db[_0xe6bf('0x34')][_0xe6bf('0x4e')](_0xc371b)[_0xe6bf('0x2c')](handleEntityNotFound(_0x2fa679,null))[_0xe6bf('0x2c')](respondWithResult(_0x2fa679,null))['catch'](handleError(_0x2fa679,null));};exports[_0xe6bf('0x4f')]=function(_0x274eb7,_0x4a14a1){return db[_0xe6bf('0x34')]['create'](_0x274eb7[_0xe6bf('0x50')],{})['then'](function(_0x1f6e62){var _0x5676f5=_0x274eb7[_0xe6bf('0x51')]['get']({'plain':!![]});if(!_0x5676f5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5676f5[_0xe6bf('0x52')]===_0xe6bf('0x51')){var _0x227af6=_0x1f6e62['get']({'plain':!![]});var _0x2be0e3='WhatsappQueues';return db['UserProfileSection']['find']({'where':{'name':_0x2be0e3,'userProfileId':_0x5676f5['userProfileId']},'raw':!![]})[_0xe6bf('0x2c')](function(_0x102bdd){if(_0x102bdd&&_0x102bdd[_0xe6bf('0x53')]===0x0){return db[_0xe6bf('0x2f')][_0xe6bf('0x4f')]({'name':_0x227af6[_0xe6bf('0x31')],'resourceId':_0x227af6['id'],'type':_0x102bdd['name'],'sectionId':_0x102bdd['id']},{})[_0xe6bf('0x2c')](function(){return _0x1f6e62;});}else{return _0x1f6e62;}})[_0xe6bf('0x54')](function(_0x53e89e){logger['error'](_0xe6bf('0x55'),_0x53e89e);throw _0x53e89e;});}return _0x1f6e62;})[_0xe6bf('0x2c')](respondWithResult(_0x4a14a1,0xc9))['catch'](handleError(_0x4a14a1,null));};exports['update']=function(_0x597678,_0x488a0d){if(_0x597678[_0xe6bf('0x50')]['id']){delete _0x597678['body']['id'];}return db[_0xe6bf('0x34')][_0xe6bf('0x4e')]({'where':{'id':_0x597678[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x488a0d,null))['then'](saveUpdates(_0x597678[_0xe6bf('0x50')],null))[_0xe6bf('0x2c')](respondWithResult(_0x488a0d,null))[_0xe6bf('0x54')](handleError(_0x488a0d,null));};exports[_0xe6bf('0x2b')]=function(_0x5ea4e5,_0x31558d){return db[_0xe6bf('0x34')][_0xe6bf('0x4e')]({'where':{'id':_0x5ea4e5[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x31558d,null))[_0xe6bf('0x2c')](removeEntity(_0x31558d,null))['catch'](handleError(_0x31558d,null));};exports['describe']=function(_0x24d207,_0xbbde6e){return db[_0xe6bf('0x34')][_0xe6bf('0x56')]()['then'](respondWithResult(_0xbbde6e,null))[_0xe6bf('0x54')](handleError(_0xbbde6e,null));};exports[_0xe6bf('0x57')]=function(_0x481e2a,_0x3de03f,_0x27ea8d){var _0x2a8259={'raw':!![],'where':{}},_0x18667d={},_0x14f539;return db[_0xe6bf('0x34')]['findOne']({'where':{'id':_0x481e2a[_0xe6bf('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3de03f,null))[_0xe6bf('0x2c')](function(_0x4bd5d3){if(_0x4bd5d3){_0x14f539=_0x4bd5d3[_0xe6bf('0x2d')]({'plain':!![]});_0x18667d[_0xe6bf('0x39')]=_[_0xe6bf('0x3b')](db[_0xe6bf('0x58')][_0xe6bf('0x35')]);_0x18667d[_0xe6bf('0x3a')]=_[_0xe6bf('0x3b')](_0x481e2a[_0xe6bf('0x3a')]);_0x18667d[_0xe6bf('0x3c')]=_['intersection'](_0x18667d['model'],_0x18667d[_0xe6bf('0x3a')]);_0x2a8259[_0xe6bf('0x3e')]=_['intersection'](_0x18667d['model'],qs[_0xe6bf('0x3f')](_0x481e2a[_0xe6bf('0x3a')][_0xe6bf('0x3f')]));_0x2a8259[_0xe6bf('0x3e')]=_0x2a8259[_0xe6bf('0x3e')][_0xe6bf('0x40')]?_0x2a8259[_0xe6bf('0x3e')]:_0x18667d['model'];if(!_0x481e2a[_0xe6bf('0x3a')][_0xe6bf('0x59')]('nolimit')){_0x2a8259[_0xe6bf('0x25')]=qs[_0xe6bf('0x25')](_0x481e2a[_0xe6bf('0x3a')][_0xe6bf('0x25')]);_0x2a8259[_0xe6bf('0x23')]=qs[_0xe6bf('0x23')](_0x481e2a[_0xe6bf('0x3a')]['offset']);}_0x2a8259[_0xe6bf('0x42')]=qs[_0xe6bf('0x43')](_0x481e2a[_0xe6bf('0x3a')][_0xe6bf('0x43')]);_0x2a8259['where']=qs[_0xe6bf('0x3c')](_[_0xe6bf('0x45')](_0x481e2a[_0xe6bf('0x3a')],_0x18667d[_0xe6bf('0x3c')]));_0x2a8259[_0xe6bf('0x44')][_0xe6bf('0x5a')]=_0x4bd5d3['id'];if(_0x481e2a[_0xe6bf('0x3a')][_0xe6bf('0x46')]){_0x2a8259[_0xe6bf('0x44')]=_[_0xe6bf('0x47')](_0x2a8259[_0xe6bf('0x44')],{'$or':_['map'](_0x2a8259[_0xe6bf('0x3e')],function(_0x357da7){var _0x6ea4a8={};_0x6ea4a8[_0x357da7]={'$like':'%'+_0x481e2a['query'][_0xe6bf('0x46')]+'%'};return _0x6ea4a8;})});}_0x2a8259=_[_0xe6bf('0x47')]({},_0x2a8259,_0x481e2a[_0xe6bf('0x4d')]);return db[_0xe6bf('0x58')][_0xe6bf('0x5b')](_0x2a8259);}})[_0xe6bf('0x2c')](function(_0x5188dd){if(_0x5188dd){return db[_0xe6bf('0x5c')][_0xe6bf('0x5d')]({'where':{'id':_['map'](_0x5188dd,'UserId'),'role':_0xe6bf('0x5e')},'attributes':['id','name',_0xe6bf('0x5f'),_0xe6bf('0x60'),_0xe6bf('0x61')]});}})[_0xe6bf('0x2c')](function(_0x100ef6){if(_0x100ef6){return{'count':_0x100ef6[_0xe6bf('0x26')],'rows':_['map'](_0x100ef6['rows'],function(_0x2334c4){return{'membername':_0x2334c4[_0xe6bf('0x31')],'UserId':_0x2334c4['id'],'queue_name':_0x14f539[_0xe6bf('0x31')],'WhatsappQueueId':_0x14f539['id'],'interface':util[_0xe6bf('0x62')]('%s/%s','SIP',_0x2334c4[_0xe6bf('0x31')]),'penalty':0x0,'paused':_0x2334c4[_0xe6bf('0x5f')],'createdAt':_0x2334c4[_0xe6bf('0x61')],'updatedAt':_0x2334c4['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x3de03f,_0x2a8259))[_0xe6bf('0x54')](handleError(_0x3de03f,null));};exports[_0xe6bf('0x63')]=function(_0x29a2da,_0x1c12d5,_0x1dd6d1){var _0x56f707={};var _0x4501f5={};var _0xf9b19d;var _0x2b3d37;return db['WhatsappQueue'][_0xe6bf('0x64')]({'where':{'id':_0x29a2da[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x1c12d5,null))[_0xe6bf('0x2c')](function(_0x292bf7){if(_0x292bf7){_0xf9b19d=_0x292bf7;_0x4501f5['model']=_[_0xe6bf('0x3b')](db[_0xe6bf('0x65')][_0xe6bf('0x35')]);_0x4501f5[_0xe6bf('0x3a')]=_[_0xe6bf('0x3b')](_0x29a2da[_0xe6bf('0x3a')]);_0x4501f5[_0xe6bf('0x3c')]=_[_0xe6bf('0x3d')](_0x4501f5['model'],_0x4501f5['query']);_0x56f707[_0xe6bf('0x3e')]=_[_0xe6bf('0x3d')](_0x4501f5[_0xe6bf('0x39')],qs[_0xe6bf('0x3f')](_0x29a2da[_0xe6bf('0x3a')]['fields']));_0x56f707[_0xe6bf('0x3e')]=_0x56f707[_0xe6bf('0x3e')][_0xe6bf('0x40')]?_0x56f707[_0xe6bf('0x3e')]:_0x4501f5[_0xe6bf('0x39')];_0x56f707[_0xe6bf('0x42')]=qs['sort'](_0x29a2da[_0xe6bf('0x3a')][_0xe6bf('0x43')]);_0x56f707[_0xe6bf('0x44')]=qs[_0xe6bf('0x3c')](_[_0xe6bf('0x45')](_0x29a2da[_0xe6bf('0x3a')],_0x4501f5[_0xe6bf('0x3c')]));if(_0x29a2da[_0xe6bf('0x3a')][_0xe6bf('0x46')]){_0x56f707[_0xe6bf('0x44')]=_[_0xe6bf('0x47')](_0x56f707[_0xe6bf('0x44')],{'$or':_[_0xe6bf('0x33')](_0x56f707['attributes'],function(_0x48b12e){var _0x507e0e={};_0x507e0e[_0x48b12e]={'$like':'%'+_0x29a2da[_0xe6bf('0x3a')]['filter']+'%'};return _0x507e0e;})});}_0x56f707=_[_0xe6bf('0x47')]({},_0x56f707,_0x29a2da[_0xe6bf('0x4d')]);return _0xf9b19d[_0xe6bf('0x63')](_0x56f707);}})[_0xe6bf('0x2c')](function(_0x3c4111){if(_0x3c4111){_0x2b3d37=_0x3c4111[_0xe6bf('0x40')];if(!_0x29a2da[_0xe6bf('0x3a')][_0xe6bf('0x59')]('nolimit')){_0x56f707[_0xe6bf('0x25')]=qs[_0xe6bf('0x25')](_0x29a2da['query']['limit']);_0x56f707[_0xe6bf('0x23')]=qs['offset'](_0x29a2da[_0xe6bf('0x3a')][_0xe6bf('0x23')]);}return _0xf9b19d[_0xe6bf('0x63')](_0x56f707);}})['then'](function(_0x43c0ca){if(_0x43c0ca){return _0x43c0ca?{'count':_0x2b3d37,'rows':_0x43c0ca}:null;}})[_0xe6bf('0x2c')](respondWithResult(_0x1c12d5,null))[_0xe6bf('0x54')](handleError(_0x1c12d5,null));};exports[_0xe6bf('0x66')]=function(_0x2b781c,_0x3cee7e,_0x2d13f3){var _0x93e354=_0x2b781c[_0xe6bf('0x50')][_0xe6bf('0x67')];return db[_0xe6bf('0x65')]['findAll']({'where':{'id':_0x93e354},'attributes':['id'],'include':[{'model':db[_0xe6bf('0x5c')],'as':_0xe6bf('0x68'),'attributes':['id','name',_0xe6bf('0x69'),'voicePause','interface'],'raw':!![]}]})[_0xe6bf('0x2c')](function(_0x3dd3b6){if(_0x3dd3b6){var _0x3993fb=_[_0xe6bf('0x6a')](_0x3dd3b6,function(_0x43739b){var _0x3ab7f3=_0x43739b[_0xe6bf('0x2d')]({'plain':!![]});return _0x3ab7f3[_0xe6bf('0x68')];});return db[_0xe6bf('0x34')][_0xe6bf('0x4e')]({'where':{'id':_0x2b781c[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](function(_0x470f5c){return db[_0xe6bf('0x6b')][_0xe6bf('0x6c')](function(_0x56c415){return _0x470f5c['addTeams'](_0x93e354,{'transaction':_0x56c415})[_0xe6bf('0x2c')](function(){return BPromise['each'](_0x3993fb,function(_0xb2a1d8){return db[_0xe6bf('0x58')][_0xe6bf('0x6d')]({'where':{'UserId':_0xb2a1d8['id'],'WhatsappQueueId':_0x2b781c[_0xe6bf('0x4c')]['id']},'transaction':_0x56c415});});})[_0xe6bf('0x2c')](function(){_0x3993fb[_0xe6bf('0x6e')](function(_0x3bd357){socket[_0xe6bf('0x6f')](_0xe6bf('0x70'),{'UserId':_0x3bd357['id'],'WhatsappQueueId':_0x470f5c['id']});});});});});}})['then'](respondWithStatusCode(_0x3cee7e,null))[_0xe6bf('0x54')](handleError(_0x3cee7e,null));};exports[_0xe6bf('0x71')]=function(_0x2b69e0,_0x42b802,_0x35354b){return db['Team']['findAll']({'where':{'id':_0x2b69e0[_0xe6bf('0x3a')][_0xe6bf('0x67')]},'attributes':['id'],'include':[{'model':db[_0xe6bf('0x5c')],'as':_0xe6bf('0x68'),'attributes':['id'],'raw':!![]}]})[_0xe6bf('0x2c')](handleEntityNotFound(_0x42b802,null))['then'](function(_0x49a435){var _0x230c18=_[_0xe6bf('0x33')](_0x49a435,'id');var _0xea0fc6=[];var _0x2ceb3c=[];var _0xc4225=squel[_0xe6bf('0x72')]();_0xc4225[_0xe6bf('0x73')](_0xe6bf('0x74'))[_0xe6bf('0x75')](_0xe6bf('0x76'),'tq')[_0xe6bf('0x77')](_0xe6bf('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xe6bf('0x44')](_0xe6bf('0x79'),_0x2b69e0[_0xe6bf('0x4c')]['id']);for(var _0x36c228=0x0;_0x36c228<_0x49a435['length'];_0x36c228+=0x1){let _0x1b478f=_0x49a435[_0x36c228];for(var _0x202e38=0x0;_0x202e38<_0x1b478f[_0xe6bf('0x68')][_0xe6bf('0x40')];_0x202e38+=0x1){let _0x1a1a01=_0x1b478f[_0xe6bf('0x68')][_0x202e38];var _0xf90d6e=_0xc4225['clone']();_0xf90d6e[_0xe6bf('0x44')](_0xe6bf('0x7a'),_0x1a1a01['id']);_0x2ceb3c[_0xe6bf('0x7b')](db[_0xe6bf('0x6b')][_0xe6bf('0x3a')](_0xf90d6e[_0xe6bf('0x7c')](),{'type':db[_0xe6bf('0x6b')]['QueryTypes'][_0xe6bf('0x7d')]})[_0xe6bf('0x2c')](function(_0x1e8c96){if(_0x1e8c96[_0xe6bf('0x40')]===0x1){return _0x1a1a01['id'];}else{var _0xac8155=_[_0xe6bf('0x7e')](_[_0xe6bf('0x33')](_0x1e8c96,_0xe6bf('0x7f')),function(_0x1081bb){return _[_0xe6bf('0x80')](_0x230c18,_0x1081bb);});if(_0xac8155){return _0x1a1a01['id'];}}}));}}return BPromise[_0xe6bf('0x81')](_0x2ceb3c)[_0xe6bf('0x2c')](function(_0x579789){_0xea0fc6=_(_0xea0fc6)[_0xe6bf('0x82')](_0x579789)['compact']()['value']();return db[_0xe6bf('0x34')]['find']({'where':{'id':_0x2b69e0[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](function(_0x132b27){return db['sequelize'][_0xe6bf('0x6c')](function(_0x364adc){return _0x132b27[_0xe6bf('0x71')](_0x2b69e0['query'][_0xe6bf('0x67')],{'transaction':_0x364adc})[_0xe6bf('0x2c')](function(){if(!_['isEmpty'](_0xea0fc6)){return _0x132b27[_0xe6bf('0x83')](_0xea0fc6,{'transaction':_0x364adc});}})[_0xe6bf('0x2c')](function(){_0xea0fc6[_0xe6bf('0x6e')](function(_0x148749){socket['emit'](_0xe6bf('0x84'),{'UserId':_0x148749,'WhatsappQueueId':_0x132b27['id']});});});});});});})[_0xe6bf('0x2c')](respondWithStatusCode(_0x42b802,null))[_0xe6bf('0x54')](handleError(_0x42b802,null));};exports[_0xe6bf('0x85')]=function(_0x13e6d3,_0x335865,_0x51a25f){return db[_0xe6bf('0x34')][_0xe6bf('0x4e')]({'where':{'id':_0x13e6d3[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x335865,null))[_0xe6bf('0x2c')](function(_0x2a2889){if(_0x2a2889){return _0x2a2889[_0xe6bf('0x85')](_0x13e6d3[_0xe6bf('0x50')]['ids'],_['omit'](_0x13e6d3[_0xe6bf('0x50')],[_0xe6bf('0x67'),'id'])||{})[_0xe6bf('0x86')](function(_0x2322fd){for(var _0x441f1d=0x0;_0x441f1d<_0x13e6d3[_0xe6bf('0x50')][_0xe6bf('0x67')][_0xe6bf('0x40')];_0x441f1d+=0x1){socket[_0xe6bf('0x6f')]('userWhatsappQueue:save',{'UserId':Number(_0x13e6d3[_0xe6bf('0x50')]['ids'][_0x441f1d]),'WhatsappQueueId':Number(_0x13e6d3[_0xe6bf('0x4c')]['id'])});}return _0x2322fd;});}})[_0xe6bf('0x2c')](respondWithResult(_0x335865,null))[_0xe6bf('0x54')](handleError(_0x335865,null));};exports[_0xe6bf('0x83')]=function(_0x45c997,_0x360e97,_0x13c195){return db[_0xe6bf('0x34')][_0xe6bf('0x4e')]({'where':{'id':_0x45c997[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x360e97,null))[_0xe6bf('0x2c')](function(_0x27e0a2){if(_0x27e0a2){return _0x27e0a2[_0xe6bf('0x83')](_0x45c997['query']['ids'])[_0xe6bf('0x2c')](function(){if(_[_0xe6bf('0x87')](_0x45c997[_0xe6bf('0x3a')]['ids'])){for(var _0x342fdf=0x0;_0x342fdf<_0x45c997['query'][_0xe6bf('0x67')][_0xe6bf('0x40')];_0x342fdf+=0x1){socket[_0xe6bf('0x6f')](_0xe6bf('0x84'),{'UserId':Number(_0x45c997[_0xe6bf('0x3a')]['ids'][_0x342fdf]),'WhatsappQueueId':Number(_0x45c997['params']['id'])});}}else{socket[_0xe6bf('0x6f')](_0xe6bf('0x84'),{'UserId':Number(_0x45c997[_0xe6bf('0x3a')][_0xe6bf('0x67')]),'WhatsappQueueId':Number(_0x45c997['params']['id'])});}});}})[_0xe6bf('0x2c')](respondWithStatusCode(_0x360e97,null))[_0xe6bf('0x54')](handleError(_0x360e97,null));};exports['getAgents']=function(_0x3fe025,_0x2e30e6,_0x252541){var _0x56c7c6={};var _0x29baa2={};var _0x522cab;var _0x1db39f;return db[_0xe6bf('0x34')][_0xe6bf('0x64')]({'where':{'id':_0x3fe025[_0xe6bf('0x4c')]['id']}})[_0xe6bf('0x2c')](handleEntityNotFound(_0x2e30e6,null))[_0xe6bf('0x2c')](function(_0x1197f9){if(_0x1197f9){_0x522cab=_0x1197f9;_0x29baa2[_0xe6bf('0x39')]=_['keys'](db[_0xe6bf('0x5c')][_0xe6bf('0x35')]);_0x29baa2[_0xe6bf('0x3a')]=_[_0xe6bf('0x3b')](_0x3fe025[_0xe6bf('0x3a')]);_0x29baa2['filters']=_['intersection'](_0x29baa2['model'],_0x29baa2[_0xe6bf('0x3a')]);_0x56c7c6[_0xe6bf('0x3e')]=_[_0xe6bf('0x3d')](_0x29baa2['model'],qs[_0xe6bf('0x3f')](_0x3fe025['query'][_0xe6bf('0x3f')]));_0x56c7c6['attributes']=_0x56c7c6[_0xe6bf('0x3e')][_0xe6bf('0x40')]?_0x56c7c6[_0xe6bf('0x3e')]:_0x29baa2[_0xe6bf('0x39')];_0x56c7c6['order']=qs[_0xe6bf('0x43')](_0x3fe025[_0xe6bf('0x3a')][_0xe6bf('0x43')]);_0x56c7c6[_0xe6bf('0x44')]=qs[_0xe6bf('0x3c')](_[_0xe6bf('0x45')](_0x3fe025['query'],_0x29baa2[_0xe6bf('0x3c')]));if(_0x3fe025[_0xe6bf('0x3a')][_0xe6bf('0x46')]){_0x56c7c6[_0xe6bf('0x44')]=_[_0xe6bf('0x47')](_0x56c7c6['where'],{'$or':_[_0xe6bf('0x33')](_0x56c7c6[_0xe6bf('0x3e')],function(_0x4c570c){var _0x3287d5={};_0x3287d5[_0x4c570c]={'$like':'%'+_0x3fe025[_0xe6bf('0x3a')][_0xe6bf('0x46')]+'%'};return _0x3287d5;})});}_0x56c7c6=_[_0xe6bf('0x47')]({},_0x56c7c6,_0x3fe025[_0xe6bf('0x4d')]);return _0x522cab['getAgents'](_0x56c7c6);}})[_0xe6bf('0x2c')](function(_0x3d31fb){if(_0x3d31fb){_0x1db39f=_0x3d31fb[_0xe6bf('0x40')];if(!_0x3fe025['query']['hasOwnProperty'](_0xe6bf('0x41'))){_0x56c7c6['limit']=qs['limit'](_0x3fe025[_0xe6bf('0x3a')]['limit']);_0x56c7c6[_0xe6bf('0x23')]=qs[_0xe6bf('0x23')](_0x3fe025['query']['offset']);}return _0x522cab[_0xe6bf('0x88')](_0x56c7c6);}})[_0xe6bf('0x2c')](function(_0x552cd0){if(_0x552cd0){return _0x552cd0?{'count':_0x1db39f,'rows':_0x552cd0}:null;}})[_0xe6bf('0x2c')](respondWithResult(_0x2e30e6,null))[_0xe6bf('0x54')](handleError(_0x2e30e6,null));};
\ No newline at end of file
+var _0x36b9=['voicePause','sequelize','transaction','each','findOrCreate','forEach','emit','select','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','WhatsappQueues','UserProfileResource','end','error','name','send','index','map','WhatsappQueue','key','model','query','keys','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','rawAttributes','filters','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','hasOwnProperty','order','UserWhatsappQueue','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0x36b9,0xb2));var _0x936b=function(_0x2e335f,_0xd65cbe){_0x2e335f=_0x2e335f-0x0;var _0x547559=_0x36b9[_0x2e335f];return _0x547559;};'use strict';var emlformat=require(_0x936b('0x0'));var rimraf=require(_0x936b('0x1'));var zipdir=require(_0x936b('0x2'));var jsonpatch=require(_0x936b('0x3'));var rp=require('request-promise');var moment=require(_0x936b('0x4'));var BPromise=require(_0x936b('0x5'));var Mustache=require(_0x936b('0x6'));var util=require('util');var path=require(_0x936b('0x7'));var sox=require(_0x936b('0x8'));var csv=require('to-csv');var ejs=require(_0x936b('0x9'));var fs=require('fs');var fs_extra=require(_0x936b('0xa'));var _=require(_0x936b('0xb'));var squel=require('squel');var crypto=require(_0x936b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x936b('0xd'));var toCsv=require(_0x936b('0xe'));var querystring=require(_0x936b('0xf'));var Papa=require('papaparse');var Redis=require(_0x936b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x936b('0x11'));var as=require(_0x936b('0x12'));var hardwareService=require(_0x936b('0x13'));var logger=require('../../config/logger')(_0x936b('0x14'));var utils=require(_0x936b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x936b('0x16'));var db=require(_0x936b('0x17'))['db'];config['redis']=_[_0x936b('0x18')](config[_0x936b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x936b('0x1a'))(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x936b('0x1b')](socket);function respondWithStatusCode(_0x4fd69e,_0xe7b78f){_0xe7b78f=_0xe7b78f||0xcc;return function(_0x2fef38){if(_0x2fef38){return _0x4fd69e[_0x936b('0x1c')](_0xe7b78f);}return _0x4fd69e[_0x936b('0x1d')](_0xe7b78f)['end']();};}function respondWithResult(_0x4cc6c4,_0x184f08){_0x184f08=_0x184f08||0xc8;return function(_0x23ab95){if(_0x23ab95){return _0x4cc6c4[_0x936b('0x1d')](_0x184f08)[_0x936b('0x1e')](_0x23ab95);}};}function respondWithFilteredResult(_0x2330a8,_0x500793){return function(_0x400bac){if(_0x400bac){var _0x1bc0fe=typeof _0x500793[_0x936b('0x1f')]===_0x936b('0x20')&&typeof _0x500793[_0x936b('0x21')]===_0x936b('0x20');var _0x1c78af=_0x400bac[_0x936b('0x22')];var _0x168597=_0x1bc0fe?0x0:_0x500793[_0x936b('0x1f')];var _0x27df00=_0x1bc0fe?_0x400bac['count']:_0x500793['offset']+_0x500793[_0x936b('0x21')];var _0x192924;if(_0x27df00>=_0x1c78af){_0x27df00=_0x1c78af;_0x192924=0xc8;}else{_0x192924=0xce;}_0x2330a8['status'](_0x192924);return _0x2330a8['set'](_0x936b('0x23'),_0x168597+'-'+_0x27df00+'/'+_0x1c78af)['json'](_0x400bac);}return null;};}function patchUpdates(_0x298afd){return function(_0x816738){try{jsonpatch[_0x936b('0x24')](_0x816738,_0x298afd,!![]);}catch(_0x163070){return BPromise[_0x936b('0x25')](_0x163070);}return _0x816738['save']();};}function saveUpdates(_0x3974a6,_0x26dab5){return function(_0x1b870c){if(_0x1b870c){return _0x1b870c[_0x936b('0x26')](_0x3974a6)['then'](function(_0x280446){return _0x280446;});}return null;};}function removeEntity(_0x4789ee,_0x2fde3d){return function(_0x2d50ef){if(_0x2d50ef){return _0x2d50ef[_0x936b('0x27')]()[_0x936b('0x28')](function(){var _0x201122=_0x2d50ef['get']({'plain':!![]});var _0x33cd56=_0x936b('0x29');return db[_0x936b('0x2a')]['destroy']({'where':{'type':_0x33cd56,'resourceId':_0x201122['id']}})[_0x936b('0x28')](function(){return _0x2d50ef;});})[_0x936b('0x28')](function(){_0x4789ee[_0x936b('0x1d')](0xcc)[_0x936b('0x2b')]();});}};}function handleEntityNotFound(_0x4d7e8a,_0x494511){return function(_0x3635a0){if(!_0x3635a0){_0x4d7e8a[_0x936b('0x1c')](0x194);}return _0x3635a0;};}function handleError(_0x7de756,_0x416bf1){_0x416bf1=_0x416bf1||0x1f4;return function(_0x105565){logger[_0x936b('0x2c')](_0x105565['stack']);if(_0x105565[_0x936b('0x2d')]){delete _0x105565['name'];}_0x7de756[_0x936b('0x1d')](_0x416bf1)[_0x936b('0x2e')](_0x105565);};}exports[_0x936b('0x2f')]=function(_0x89c9cc,_0x48a084){var _0x3fd4dc={},_0x4c3b58={},_0x68578b={'count':0x0,'rows':[]};var _0x2dfe28=_[_0x936b('0x30')](db[_0x936b('0x31')]['rawAttributes'],function(_0x5e40df){return{'name':_0x5e40df['fieldName'],'type':_0x5e40df['type'][_0x936b('0x32')]};});_0x4c3b58[_0x936b('0x33')]=_[_0x936b('0x30')](_0x2dfe28,_0x936b('0x2d'));_0x4c3b58[_0x936b('0x34')]=_[_0x936b('0x35')](_0x89c9cc[_0x936b('0x34')]);_0x4c3b58['filters']=_['intersection'](_0x4c3b58[_0x936b('0x33')],_0x4c3b58[_0x936b('0x34')]);_0x3fd4dc[_0x936b('0x36')]=_[_0x936b('0x37')](_0x4c3b58[_0x936b('0x33')],qs[_0x936b('0x38')](_0x89c9cc[_0x936b('0x34')][_0x936b('0x38')]));_0x3fd4dc[_0x936b('0x36')]=_0x3fd4dc[_0x936b('0x36')][_0x936b('0x39')]?_0x3fd4dc[_0x936b('0x36')]:_0x4c3b58['model'];if(!_0x89c9cc[_0x936b('0x34')]['hasOwnProperty'](_0x936b('0x3a'))){_0x3fd4dc[_0x936b('0x21')]=qs[_0x936b('0x21')](_0x89c9cc[_0x936b('0x34')][_0x936b('0x21')]);_0x3fd4dc['offset']=qs[_0x936b('0x1f')](_0x89c9cc[_0x936b('0x34')][_0x936b('0x1f')]);}_0x3fd4dc['order']=qs[_0x936b('0x3b')](_0x89c9cc['query']['sort']);_0x3fd4dc[_0x936b('0x3c')]=qs['filters'](_[_0x936b('0x3d')](_0x89c9cc[_0x936b('0x34')],_0x4c3b58['filters']),_0x2dfe28);if(_0x89c9cc['query'][_0x936b('0x3e')]){_0x3fd4dc['where']=_[_0x936b('0x3f')](_0x3fd4dc[_0x936b('0x3c')],{'$or':_[_0x936b('0x30')](_0x2dfe28,function(_0x2c4450){if(_0x2c4450['type']!==_0x936b('0x40')){var _0x2ff184={};_0x2ff184[_0x2c4450[_0x936b('0x2d')]]={'$like':'%'+_0x89c9cc['query'][_0x936b('0x3e')]+'%'};return _0x2ff184;}})});}_0x3fd4dc=_['merge']({},_0x3fd4dc,_0x89c9cc[_0x936b('0x41')]);var _0x370067={'where':_0x3fd4dc[_0x936b('0x3c')]};return db['WhatsappQueue'][_0x936b('0x22')](_0x370067)['then'](function(_0x330595){_0x68578b['count']=_0x330595;if(_0x89c9cc[_0x936b('0x34')][_0x936b('0x42')]){_0x3fd4dc['include']=[{'all':!![]}];}return db[_0x936b('0x31')][_0x936b('0x43')](_0x3fd4dc);})['then'](function(_0xb8857f){_0x68578b['rows']=_0xb8857f;return _0x68578b;})[_0x936b('0x28')](respondWithFilteredResult(_0x48a084,_0x3fd4dc))[_0x936b('0x44')](handleError(_0x48a084,null));};exports[_0x936b('0x45')]=function(_0x5033f9,_0x437812){var _0x38fa74={'raw':!![],'where':{'id':_0x5033f9['params']['id']}},_0x398bd7={};_0x398bd7[_0x936b('0x33')]=_[_0x936b('0x35')](db[_0x936b('0x31')][_0x936b('0x46')]);_0x398bd7[_0x936b('0x34')]=_[_0x936b('0x35')](_0x5033f9[_0x936b('0x34')]);_0x398bd7[_0x936b('0x47')]=_[_0x936b('0x37')](_0x398bd7[_0x936b('0x33')],_0x398bd7[_0x936b('0x34')]);_0x38fa74[_0x936b('0x36')]=_['intersection'](_0x398bd7[_0x936b('0x33')],qs[_0x936b('0x38')](_0x5033f9[_0x936b('0x34')][_0x936b('0x38')]));_0x38fa74['attributes']=_0x38fa74[_0x936b('0x36')][_0x936b('0x39')]?_0x38fa74['attributes']:_0x398bd7[_0x936b('0x33')];if(_0x5033f9[_0x936b('0x34')]['includeAll']){_0x38fa74[_0x936b('0x48')]=[{'all':!![]}];}_0x38fa74=_['merge']({},_0x38fa74,_0x5033f9[_0x936b('0x41')]);return db['WhatsappQueue'][_0x936b('0x49')](_0x38fa74)[_0x936b('0x28')](handleEntityNotFound(_0x437812,null))['then'](respondWithResult(_0x437812,null))[_0x936b('0x44')](handleError(_0x437812,null));};exports[_0x936b('0x4a')]=function(_0x23155d,_0x1876fd){return db[_0x936b('0x31')][_0x936b('0x4a')](_0x23155d[_0x936b('0x4b')],{})['then'](function(_0x197399){var _0x221511=_0x23155d[_0x936b('0x4c')][_0x936b('0x4d')]({'plain':!![]});if(!_0x221511)throw new Error(_0x936b('0x4e'));if(_0x221511[_0x936b('0x4f')]==='user'){var _0x36a9b6=_0x197399[_0x936b('0x4d')]({'plain':!![]});var _0x529812='WhatsappQueues';return db[_0x936b('0x50')]['find']({'where':{'name':_0x529812,'userProfileId':_0x221511['userProfileId']},'raw':!![]})[_0x936b('0x28')](function(_0x328258){if(_0x328258&&_0x328258['autoAssociation']===0x0){return db[_0x936b('0x2a')][_0x936b('0x4a')]({'name':_0x36a9b6['name'],'resourceId':_0x36a9b6['id'],'type':_0x328258[_0x936b('0x2d')],'sectionId':_0x328258['id']},{})['then'](function(){return _0x197399;});}else{return _0x197399;}})[_0x936b('0x44')](function(_0x171631){logger['error'](_0x936b('0x51'),_0x171631);throw _0x171631;});}return _0x197399;})['then'](respondWithResult(_0x1876fd,0xc9))[_0x936b('0x44')](handleError(_0x1876fd,null));};exports['update']=function(_0x5c8442,_0x50d399){if(_0x5c8442[_0x936b('0x4b')]['id']){delete _0x5c8442[_0x936b('0x4b')]['id'];}return db[_0x936b('0x31')][_0x936b('0x49')]({'where':{'id':_0x5c8442['params']['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x50d399,null))[_0x936b('0x28')](saveUpdates(_0x5c8442[_0x936b('0x4b')],null))[_0x936b('0x28')](respondWithResult(_0x50d399,null))[_0x936b('0x44')](handleError(_0x50d399,null));};exports[_0x936b('0x27')]=function(_0x2141cd,_0x50c99e){return db[_0x936b('0x31')]['find']({'where':{'id':_0x2141cd[_0x936b('0x52')]['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x50c99e,null))[_0x936b('0x28')](removeEntity(_0x50c99e,null))[_0x936b('0x44')](handleError(_0x50c99e,null));};exports[_0x936b('0x53')]=function(_0x530291,_0x49f2db){return db[_0x936b('0x31')]['describe']()[_0x936b('0x28')](respondWithResult(_0x49f2db,null))[_0x936b('0x44')](handleError(_0x49f2db,null));};exports[_0x936b('0x54')]=function(_0x3e19e6,_0x2eb250,_0x4b6890){var _0x34abef={'raw':!![],'where':{}},_0x460a3f={},_0x229f93;return db['WhatsappQueue'][_0x936b('0x55')]({'where':{'id':_0x3e19e6['params']['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x2eb250,null))[_0x936b('0x28')](function(_0x42c0b4){if(_0x42c0b4){_0x229f93=_0x42c0b4[_0x936b('0x4d')]({'plain':!![]});_0x460a3f[_0x936b('0x33')]=_[_0x936b('0x35')](db['UserWhatsappQueue'][_0x936b('0x46')]);_0x460a3f[_0x936b('0x34')]=_[_0x936b('0x35')](_0x3e19e6[_0x936b('0x34')]);_0x460a3f['filters']=_['intersection'](_0x460a3f['model'],_0x460a3f[_0x936b('0x34')]);_0x34abef['attributes']=_[_0x936b('0x37')](_0x460a3f[_0x936b('0x33')],qs['fields'](_0x3e19e6[_0x936b('0x34')][_0x936b('0x38')]));_0x34abef[_0x936b('0x36')]=_0x34abef[_0x936b('0x36')][_0x936b('0x39')]?_0x34abef[_0x936b('0x36')]:_0x460a3f[_0x936b('0x33')];if(!_0x3e19e6[_0x936b('0x34')][_0x936b('0x56')](_0x936b('0x3a'))){_0x34abef[_0x936b('0x21')]=qs[_0x936b('0x21')](_0x3e19e6[_0x936b('0x34')][_0x936b('0x21')]);_0x34abef[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0x3e19e6[_0x936b('0x34')]['offset']);}_0x34abef[_0x936b('0x57')]=qs[_0x936b('0x3b')](_0x3e19e6['query'][_0x936b('0x3b')]);_0x34abef[_0x936b('0x3c')]=qs[_0x936b('0x47')](_[_0x936b('0x3d')](_0x3e19e6['query'],_0x460a3f[_0x936b('0x47')]));_0x34abef[_0x936b('0x3c')]['WhatsappQueueId']=_0x42c0b4['id'];if(_0x3e19e6[_0x936b('0x34')]['filter']){_0x34abef['where']=_[_0x936b('0x3f')](_0x34abef[_0x936b('0x3c')],{'$or':_[_0x936b('0x30')](_0x34abef[_0x936b('0x36')],function(_0x423e84){var _0x21d8fd={};_0x21d8fd[_0x423e84]={'$like':'%'+_0x3e19e6[_0x936b('0x34')]['filter']+'%'};return _0x21d8fd;})});}_0x34abef=_[_0x936b('0x3f')]({},_0x34abef,_0x3e19e6[_0x936b('0x41')]);return db[_0x936b('0x58')][_0x936b('0x43')](_0x34abef);}})[_0x936b('0x28')](function(_0x5d5899){if(_0x5d5899){return db[_0x936b('0x59')][_0x936b('0x5a')]({'where':{'id':_[_0x936b('0x30')](_0x5d5899,_0x936b('0x5b')),'role':_0x936b('0x5c')},'attributes':['id',_0x936b('0x2d'),_0x936b('0x5d'),_0x936b('0x5e'),'createdAt']});}})['then'](function(_0x4767d5){if(_0x4767d5){return{'count':_0x4767d5[_0x936b('0x22')],'rows':_[_0x936b('0x30')](_0x4767d5[_0x936b('0x5f')],function(_0x4514b7){return{'membername':_0x4514b7[_0x936b('0x2d')],'UserId':_0x4514b7['id'],'queue_name':_0x229f93[_0x936b('0x2d')],'WhatsappQueueId':_0x229f93['id'],'interface':util[_0x936b('0x60')](_0x936b('0x61'),'SIP',_0x4514b7[_0x936b('0x2d')]),'penalty':0x0,'paused':_0x4514b7[_0x936b('0x5d')],'createdAt':_0x4514b7[_0x936b('0x62')],'updatedAt':_0x4514b7[_0x936b('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2eb250,_0x34abef))[_0x936b('0x44')](handleError(_0x2eb250,null));};exports[_0x936b('0x63')]=function(_0x2c7d9c,_0x242913,_0x305b4b){var _0x445153={};var _0x40ae5b={};var _0x5502b3;var _0x350848;return db['WhatsappQueue'][_0x936b('0x55')]({'where':{'id':_0x2c7d9c[_0x936b('0x52')]['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x242913,null))['then'](function(_0x4814ca){if(_0x4814ca){_0x5502b3=_0x4814ca;_0x40ae5b[_0x936b('0x33')]=_[_0x936b('0x35')](db[_0x936b('0x64')][_0x936b('0x46')]);_0x40ae5b[_0x936b('0x34')]=_[_0x936b('0x35')](_0x2c7d9c[_0x936b('0x34')]);_0x40ae5b[_0x936b('0x47')]=_[_0x936b('0x37')](_0x40ae5b[_0x936b('0x33')],_0x40ae5b[_0x936b('0x34')]);_0x445153[_0x936b('0x36')]=_['intersection'](_0x40ae5b[_0x936b('0x33')],qs[_0x936b('0x38')](_0x2c7d9c[_0x936b('0x34')]['fields']));_0x445153[_0x936b('0x36')]=_0x445153[_0x936b('0x36')]['length']?_0x445153[_0x936b('0x36')]:_0x40ae5b[_0x936b('0x33')];_0x445153[_0x936b('0x57')]=qs[_0x936b('0x3b')](_0x2c7d9c[_0x936b('0x34')][_0x936b('0x3b')]);_0x445153[_0x936b('0x3c')]=qs[_0x936b('0x47')](_[_0x936b('0x3d')](_0x2c7d9c['query'],_0x40ae5b[_0x936b('0x47')]));if(_0x2c7d9c['query']['filter']){_0x445153[_0x936b('0x3c')]=_[_0x936b('0x3f')](_0x445153[_0x936b('0x3c')],{'$or':_[_0x936b('0x30')](_0x445153['attributes'],function(_0x59406b){var _0x2d0006={};_0x2d0006[_0x59406b]={'$like':'%'+_0x2c7d9c['query'][_0x936b('0x3e')]+'%'};return _0x2d0006;})});}_0x445153=_[_0x936b('0x3f')]({},_0x445153,_0x2c7d9c[_0x936b('0x41')]);return _0x5502b3[_0x936b('0x63')](_0x445153);}})[_0x936b('0x28')](function(_0x56ea50){if(_0x56ea50){_0x350848=_0x56ea50[_0x936b('0x39')];if(!_0x2c7d9c[_0x936b('0x34')][_0x936b('0x56')](_0x936b('0x3a'))){_0x445153['limit']=qs[_0x936b('0x21')](_0x2c7d9c['query'][_0x936b('0x21')]);_0x445153[_0x936b('0x1f')]=qs[_0x936b('0x1f')](_0x2c7d9c[_0x936b('0x34')][_0x936b('0x1f')]);}return _0x5502b3[_0x936b('0x63')](_0x445153);}})[_0x936b('0x28')](function(_0x4ae366){if(_0x4ae366){return _0x4ae366?{'count':_0x350848,'rows':_0x4ae366}:null;}})[_0x936b('0x28')](respondWithResult(_0x242913,null))['catch'](handleError(_0x242913,null));};exports[_0x936b('0x65')]=function(_0x2325f4,_0x364308,_0x402b96){var _0x56926a=_0x2325f4[_0x936b('0x4b')][_0x936b('0x66')];return db[_0x936b('0x64')][_0x936b('0x43')]({'where':{'id':_0x56926a},'attributes':['id'],'include':[{'model':db[_0x936b('0x59')],'as':_0x936b('0x67'),'attributes':['id',_0x936b('0x2d'),'online',_0x936b('0x68'),'interface'],'raw':!![]}]})['then'](function(_0xcfdc5){if(_0xcfdc5){var _0x4662ac=_['flatMap'](_0xcfdc5,function(_0x2a4564){var _0x2028b1=_0x2a4564[_0x936b('0x4d')]({'plain':!![]});return _0x2028b1[_0x936b('0x67')];});return db[_0x936b('0x31')][_0x936b('0x49')]({'where':{'id':_0x2325f4['params']['id']}})['then'](function(_0x32d365){return db[_0x936b('0x69')][_0x936b('0x6a')](function(_0x4043aa){return _0x32d365[_0x936b('0x65')](_0x56926a,{'transaction':_0x4043aa})[_0x936b('0x28')](function(){return BPromise[_0x936b('0x6b')](_0x4662ac,function(_0x67f24d){return db[_0x936b('0x58')][_0x936b('0x6c')]({'where':{'UserId':_0x67f24d['id'],'WhatsappQueueId':_0x2325f4['params']['id']},'transaction':_0x4043aa});});})[_0x936b('0x28')](function(){_0x4662ac[_0x936b('0x6d')](function(_0x466001){socket[_0x936b('0x6e')]('userWhatsappQueue:save',{'UserId':_0x466001['id'],'WhatsappQueueId':_0x32d365['id']});});});});});}})[_0x936b('0x28')](respondWithStatusCode(_0x364308,null))[_0x936b('0x44')](handleError(_0x364308,null));};exports['removeTeams']=function(_0xcb086c,_0x454fe9,_0x5a09da){return db['Team']['findAll']({'where':{'id':_0xcb086c[_0x936b('0x34')]['ids']},'attributes':['id'],'include':[{'model':db[_0x936b('0x59')],'as':_0x936b('0x67'),'attributes':['id'],'raw':!![]}]})[_0x936b('0x28')](handleEntityNotFound(_0x454fe9,null))[_0x936b('0x28')](function(_0x2432ef){var _0x78d3fb=_['map'](_0x2432ef,'id');var _0x26d77c=[];var _0x10ee2c=[];var _0x338f27=squel[_0x936b('0x6f')]();_0x338f27['field'](_0x936b('0x70'))[_0x936b('0x71')](_0x936b('0x72'),'tq')[_0x936b('0x73')](_0x936b('0x74'),'ut',_0x936b('0x75'))[_0x936b('0x3c')](_0x936b('0x76'),_0xcb086c[_0x936b('0x52')]['id']);for(var _0x32946c=0x0;_0x32946c<_0x2432ef[_0x936b('0x39')];_0x32946c+=0x1){let _0x17d818=_0x2432ef[_0x32946c];for(var _0x4387a5=0x0;_0x4387a5<_0x17d818['Agents'][_0x936b('0x39')];_0x4387a5+=0x1){let _0x1d13b9=_0x17d818[_0x936b('0x67')][_0x4387a5];var _0x2232ad=_0x338f27[_0x936b('0x77')]();_0x2232ad[_0x936b('0x3c')]('ut.UserId\x20=\x20?',_0x1d13b9['id']);_0x10ee2c[_0x936b('0x78')](db[_0x936b('0x69')][_0x936b('0x34')](_0x2232ad[_0x936b('0x79')](),{'type':db[_0x936b('0x69')][_0x936b('0x7a')][_0x936b('0x7b')]})[_0x936b('0x28')](function(_0x5685e0){if(_0x5685e0[_0x936b('0x39')]===0x1){return _0x1d13b9['id'];}else{var _0x12ecae=_[_0x936b('0x7c')](_['map'](_0x5685e0,_0x936b('0x7d')),function(_0xff63d4){return _[_0x936b('0x7e')](_0x78d3fb,_0xff63d4);});if(_0x12ecae){return _0x1d13b9['id'];}}}));}}return BPromise[_0x936b('0x7f')](_0x10ee2c)['then'](function(_0x1870a0){_0x26d77c=_(_0x26d77c)[_0x936b('0x80')](_0x1870a0)[_0x936b('0x81')]()[_0x936b('0x82')]();return db[_0x936b('0x31')]['find']({'where':{'id':_0xcb086c['params']['id']}})['then'](function(_0x22b9d1){return db[_0x936b('0x69')][_0x936b('0x6a')](function(_0x855bc4){return _0x22b9d1[_0x936b('0x83')](_0xcb086c[_0x936b('0x34')][_0x936b('0x66')],{'transaction':_0x855bc4})['then'](function(){if(!_[_0x936b('0x84')](_0x26d77c)){return _0x22b9d1[_0x936b('0x85')](_0x26d77c,{'transaction':_0x855bc4});}})[_0x936b('0x28')](function(){_0x26d77c[_0x936b('0x6d')](function(_0x3db03d){socket[_0x936b('0x6e')](_0x936b('0x86'),{'UserId':_0x3db03d,'WhatsappQueueId':_0x22b9d1['id']});});});});});});})[_0x936b('0x28')](respondWithStatusCode(_0x454fe9,null))['catch'](handleError(_0x454fe9,null));};exports[_0x936b('0x87')]=function(_0x54e58f,_0x1500eb,_0x50b459){return db['WhatsappQueue'][_0x936b('0x49')]({'where':{'id':_0x54e58f['params']['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x1500eb,null))['then'](function(_0x31536c){if(_0x31536c){return _0x31536c[_0x936b('0x87')](_0x54e58f[_0x936b('0x4b')]['ids'],_[_0x936b('0x88')](_0x54e58f[_0x936b('0x4b')],[_0x936b('0x66'),'id'])||{})[_0x936b('0x89')](function(_0x2c44fa){for(var _0x46d1e8=0x0;_0x46d1e8<_0x54e58f['body']['ids'][_0x936b('0x39')];_0x46d1e8+=0x1){socket[_0x936b('0x6e')](_0x936b('0x8a'),{'UserId':Number(_0x54e58f[_0x936b('0x4b')][_0x936b('0x66')][_0x46d1e8]),'WhatsappQueueId':Number(_0x54e58f[_0x936b('0x52')]['id'])});}return _0x2c44fa;});}})['then'](respondWithResult(_0x1500eb,null))[_0x936b('0x44')](handleError(_0x1500eb,null));};exports['removeAgents']=function(_0x514a5f,_0x81b320,_0x2d564c){return db[_0x936b('0x31')][_0x936b('0x49')]({'where':{'id':_0x514a5f[_0x936b('0x52')]['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x81b320,null))[_0x936b('0x28')](function(_0x467089){if(_0x467089){return _0x467089[_0x936b('0x85')](_0x514a5f['query'][_0x936b('0x66')])['then'](function(){if(_[_0x936b('0x8b')](_0x514a5f[_0x936b('0x34')][_0x936b('0x66')])){for(var _0xc2be5e=0x0;_0xc2be5e<_0x514a5f[_0x936b('0x34')][_0x936b('0x66')][_0x936b('0x39')];_0xc2be5e+=0x1){socket['emit'](_0x936b('0x86'),{'UserId':Number(_0x514a5f[_0x936b('0x34')][_0x936b('0x66')][_0xc2be5e]),'WhatsappQueueId':Number(_0x514a5f[_0x936b('0x52')]['id'])});}}else{socket[_0x936b('0x6e')](_0x936b('0x86'),{'UserId':Number(_0x514a5f[_0x936b('0x34')][_0x936b('0x66')]),'WhatsappQueueId':Number(_0x514a5f['params']['id'])});}});}})[_0x936b('0x28')](respondWithStatusCode(_0x81b320,null))[_0x936b('0x44')](handleError(_0x81b320,null));};exports['getAgents']=function(_0x1b4ead,_0x6509ef,_0x2e1561){var _0x1c4030={};var _0x465606={};var _0x35864d;var _0x3fc024;return db[_0x936b('0x31')]['findOne']({'where':{'id':_0x1b4ead['params']['id']}})[_0x936b('0x28')](handleEntityNotFound(_0x6509ef,null))[_0x936b('0x28')](function(_0x36b7d9){if(_0x36b7d9){_0x35864d=_0x36b7d9;_0x465606[_0x936b('0x33')]=_[_0x936b('0x35')](db[_0x936b('0x59')][_0x936b('0x46')]);_0x465606[_0x936b('0x34')]=_['keys'](_0x1b4ead[_0x936b('0x34')]);_0x465606[_0x936b('0x47')]=_[_0x936b('0x37')](_0x465606[_0x936b('0x33')],_0x465606['query']);_0x1c4030[_0x936b('0x36')]=_[_0x936b('0x37')](_0x465606['model'],qs['fields'](_0x1b4ead['query'][_0x936b('0x38')]));_0x1c4030[_0x936b('0x36')]=_0x1c4030[_0x936b('0x36')][_0x936b('0x39')]?_0x1c4030[_0x936b('0x36')]:_0x465606['model'];_0x1c4030[_0x936b('0x57')]=qs[_0x936b('0x3b')](_0x1b4ead[_0x936b('0x34')][_0x936b('0x3b')]);_0x1c4030[_0x936b('0x3c')]=qs['filters'](_[_0x936b('0x3d')](_0x1b4ead[_0x936b('0x34')],_0x465606[_0x936b('0x47')]));if(_0x1b4ead[_0x936b('0x34')][_0x936b('0x3e')]){_0x1c4030[_0x936b('0x3c')]=_[_0x936b('0x3f')](_0x1c4030[_0x936b('0x3c')],{'$or':_[_0x936b('0x30')](_0x1c4030[_0x936b('0x36')],function(_0x35e31c){var _0x5c9f0a={};_0x5c9f0a[_0x35e31c]={'$like':'%'+_0x1b4ead[_0x936b('0x34')][_0x936b('0x3e')]+'%'};return _0x5c9f0a;})});}_0x1c4030=_[_0x936b('0x3f')]({},_0x1c4030,_0x1b4ead[_0x936b('0x41')]);return _0x35864d[_0x936b('0x8c')](_0x1c4030);}})[_0x936b('0x28')](function(_0x432ede){if(_0x432ede){_0x3fc024=_0x432ede[_0x936b('0x39')];if(!_0x1b4ead[_0x936b('0x34')]['hasOwnProperty'](_0x936b('0x3a'))){_0x1c4030['limit']=qs[_0x936b('0x21')](_0x1b4ead[_0x936b('0x34')][_0x936b('0x21')]);_0x1c4030['offset']=qs[_0x936b('0x1f')](_0x1b4ead[_0x936b('0x34')][_0x936b('0x1f')]);}return _0x35864d[_0x936b('0x8c')](_0x1c4030);}})[_0x936b('0x28')](function(_0x47ba95){if(_0x47ba95){return _0x47ba95?{'count':_0x3fc024,'rows':_0x47ba95}:null;}})[_0x936b('0x28')](respondWithResult(_0x6509ef,null))['catch'](handleError(_0x6509ef,null));};
\ No newline at end of file
index 8140a7e..f3f99f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80f0=['save','update','remove','emit','hasOwnProperty','exports','../../mysqldb','WhatsappQueue','setMaxListeners'];(function(_0x15734d,_0x39f330){var _0x5b48db=function(_0x3d32a2){while(--_0x3d32a2){_0x15734d['push'](_0x15734d['shift']());}};_0x5b48db(++_0x39f330);}(_0x80f0,0x102));var _0x080f=function(_0x22656a,_0x570103){_0x22656a=_0x22656a-0x0;var _0x8d3201=_0x80f0[_0x22656a];return _0x8d3201;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x080f('0x0'))['db'][_0x080f('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x080f('0x2')](0x0);var events={'afterCreate':_0x080f('0x3'),'afterUpdate':_0x080f('0x4'),'afterDestroy':_0x080f('0x5')};function emitEvent(_0x48d53e){return function(_0x500a79,_0x2746fc,_0xf9ac69){WhatsappQueueEvents['emit'](_0x48d53e+':'+_0x500a79['id'],_0x500a79);WhatsappQueueEvents[_0x080f('0x6')](_0x48d53e,_0x500a79);_0xf9ac69(null);};}for(var e in events){if(events[_0x080f('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x080f('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x9093=['events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x335446,_0x164e8a){var _0x36b120=function(_0x50f89d){while(--_0x50f89d){_0x335446['push'](_0x335446['shift']());}};_0x36b120(++_0x164e8a);}(_0x9093,0x1d6));var _0x3909=function(_0x2f75eb,_0x34a124){_0x2f75eb=_0x2f75eb-0x0;var _0x1ac05b=_0x9093[_0x2f75eb];return _0x1ac05b;};'use strict';var EventEmitter=require(_0x3909('0x0'));var WhatsappQueue=require(_0x3909('0x1'))['db'][_0x3909('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x3909('0x3')](0x0);var events={'afterCreate':_0x3909('0x4'),'afterUpdate':_0x3909('0x5'),'afterDestroy':_0x3909('0x6')};function emitEvent(_0x56453b){return function(_0x8c39b1,_0x2ec987,_0x319952){WhatsappQueueEvents[_0x3909('0x7')](_0x56453b+':'+_0x8c39b1['id'],_0x8c39b1);WhatsappQueueEvents['emit'](_0x56453b,_0x8c39b1);_0x319952(null);};}for(var e in events){if(events[_0x3909('0x8')](e)){var event=events[e];WhatsappQueue[_0x3909('0x9')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents;
\ No newline at end of file
index 23001c0..b17e4d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe877=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','whatsapp_queues'];(function(_0x17158c,_0x58cb92){var _0x734f31=function(_0x2a7a84){while(--_0x2a7a84){_0x17158c['push'](_0x17158c['shift']());}};_0x734f31(++_0x58cb92);}(_0xe877,0x15f));var _0x7e87=function(_0x504a01,_0x43e4b4){_0x504a01=_0x504a01-0x0;var _0x4efec4=_0xe877[_0x504a01];return _0x4efec4;};'use strict';var _=require(_0x7e87('0x0'));var util=require(_0x7e87('0x1'));var logger=require('../../config/logger')(_0x7e87('0x2'));var moment=require(_0x7e87('0x3'));var BPromise=require(_0x7e87('0x4'));var rp=require(_0x7e87('0x5'));var fs=require('fs');var path=require(_0x7e87('0x6'));var rimraf=require(_0x7e87('0x7'));var config=require(_0x7e87('0x8'));var attributes=require(_0x7e87('0x9'));module[_0x7e87('0xa')]=function(_0x3ecb9a,_0x1ba394){return _0x3ecb9a[_0x7e87('0xb')]('WhatsappQueue',attributes,{'tableName':_0x7e87('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1990=['./whatsappQueue.attributes','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b7567,_0x412715){var _0x2522dc=function(_0x242d85){while(--_0x242d85){_0x2b7567['push'](_0x2b7567['shift']());}};_0x2522dc(++_0x412715);}(_0x1990,0x86));var _0x0199=function(_0xb0a88c,_0x86630e){_0xb0a88c=_0xb0a88c-0x0;var _0x2dd79b=_0x1990[_0xb0a88c];return _0x2dd79b;};'use strict';var _=require('lodash');var util=require(_0x0199('0x0'));var logger=require(_0x0199('0x1'))(_0x0199('0x2'));var moment=require(_0x0199('0x3'));var BPromise=require(_0x0199('0x4'));var rp=require(_0x0199('0x5'));var fs=require('fs');var path=require(_0x0199('0x6'));var rimraf=require(_0x0199('0x7'));var config=require(_0x0199('0x8'));var attributes=require(_0x0199('0x9'));module['exports']=function(_0x34e69c,_0x5f4899){return _0x34e69c[_0x0199('0xa')](_0x0199('0xb'),attributes,{'tableName':_0x0199('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 28420cd..e4ec101 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdca8=['error','message','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','then','GetWhatsappQueue','stringify','ShowWhatsappQueue','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./whatsappQueue.socket','register','request','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code'];(function(_0x574628,_0x30610e){var _0xee1aed=function(_0x295e6a){while(--_0x295e6a){_0x574628['push'](_0x574628['shift']());}};_0xee1aed(++_0x30610e);}(_0xdca8,0x1e1));var _0x8dca=function(_0x12d37d,_0x1eeaa8){_0x12d37d=_0x12d37d-0x0;var _0x163cea=_0xdca8[_0x12d37d];return _0x163cea;};'use strict';var _=require('lodash');var util=require(_0x8dca('0x0'));var moment=require(_0x8dca('0x1'));var BPromise=require(_0x8dca('0x2'));var rs=require(_0x8dca('0x3'));var fs=require('fs');var Redis=require(_0x8dca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8dca('0x5'));var logger=require(_0x8dca('0x6'))(_0x8dca('0x7'));var config=require(_0x8dca('0x8'));var jayson=require(_0x8dca('0x9'));var client=jayson['client'][_0x8dca('0xa')]({'port':0x232a});config[_0x8dca('0xb')]=_[_0x8dca('0xc')](config[_0x8dca('0xb')],{'host':_0x8dca('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8dca('0xb')]));require(_0x8dca('0xe'))[_0x8dca('0xf')](socket);function respondWithRpcPromise(_0xa5bab1,_0x3f6ae2,_0x22c197){return new BPromise(function(_0x5284b3,_0x574225){return client[_0x8dca('0x10')](_0xa5bab1,_0x22c197)['then'](function(_0x491997){logger[_0x8dca('0x11')](_0x8dca('0x12'),_0x3f6ae2,'request\x20sent');logger[_0x8dca('0x13')](_0x8dca('0x14'),_0x3f6ae2,_0x8dca('0x15'),JSON['stringify'](_0x491997));if(_0x491997['error']){if(_0x491997['error'][_0x8dca('0x16')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x3f6ae2,_0x491997[_0x8dca('0x17')]['message']);return _0x574225(_0x491997[_0x8dca('0x17')][_0x8dca('0x18')]);}logger['error'](_0x8dca('0x12'),_0x3f6ae2,_0x491997['error']['message']);return _0x5284b3(_0x491997[_0x8dca('0x17')]['message']);}else{logger['info'](_0x8dca('0x12'),_0x3f6ae2,_0x8dca('0x15'));_0x5284b3(_0x491997[_0x8dca('0x19')][_0x8dca('0x18')]);}})[_0x8dca('0x1a')](function(_0xb8cc65){logger['error'](_0x8dca('0x12'),_0x3f6ae2,_0xb8cc65);_0x574225(_0xb8cc65);});});}exports['GetWhatsappQueue']=function(_0x3d0d08){var _0x567550=this;return new Promise(function(_0x12c2ad,_0x245e46){return db[_0x8dca('0x1b')][_0x8dca('0x1c')]({'raw':_0x3d0d08[_0x8dca('0x1d')]?_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x1e')]===undefined?!![]:![]:!![],'where':_0x3d0d08[_0x8dca('0x1d')]?_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x1f')]||null:null,'attributes':_0x3d0d08[_0x8dca('0x1d')]?_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x20')]||null:null,'limit':_0x3d0d08[_0x8dca('0x1d')]?_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x21')]||null:null,'include':_0x3d0d08[_0x8dca('0x1d')]?_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x22')]?_[_0x8dca('0x23')](_0x3d0d08[_0x8dca('0x1d')][_0x8dca('0x22')],function(_0x157f94){return{'model':db[_0x157f94[_0x8dca('0x24')]],'as':_0x157f94['as'],'attributes':_0x157f94[_0x8dca('0x20')],'include':_0x157f94['include']?_['map'](_0x157f94['include'],function(_0x49f250){return{'model':db[_0x49f250['model']],'as':_0x49f250['as'],'attributes':_0x49f250['attributes'],'include':_0x49f250[_0x8dca('0x22')]?_[_0x8dca('0x23')](_0x49f250[_0x8dca('0x22')],function(_0x5ed7a0){return{'model':db[_0x5ed7a0[_0x8dca('0x24')]],'as':_0x5ed7a0['as'],'attributes':_0x5ed7a0[_0x8dca('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8dca('0x25')](function(_0x587d24){logger[_0x8dca('0x11')](_0x8dca('0x26'),_0x3d0d08);logger[_0x8dca('0x13')](_0x8dca('0x26'),_0x3d0d08,JSON[_0x8dca('0x27')](_0x587d24));_0x12c2ad(_0x587d24);})[_0x8dca('0x1a')](function(_0x6939c2){logger[_0x8dca('0x17')](_0x8dca('0x26'),_0x6939c2[_0x8dca('0x18')],_0x3d0d08);_0x245e46(_0x567550[_0x8dca('0x17')](0x1f4,_0x6939c2['message']));});});};exports[_0x8dca('0x28')]=function(_0x1887bf){var _0x46aa0e=this;return new Promise(function(_0x522ba2,_0x5b7815){return db['WhatsappQueue'][_0x8dca('0x29')]({'raw':_0x1887bf['options']?_0x1887bf[_0x8dca('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x1887bf[_0x8dca('0x1d')]?_0x1887bf[_0x8dca('0x1d')]['where']||null:null,'attributes':_0x1887bf[_0x8dca('0x1d')]?_0x1887bf[_0x8dca('0x1d')][_0x8dca('0x20')]||null:null,'include':_0x1887bf[_0x8dca('0x1d')]?_0x1887bf[_0x8dca('0x1d')][_0x8dca('0x22')]?_[_0x8dca('0x23')](_0x1887bf[_0x8dca('0x1d')][_0x8dca('0x22')],function(_0x3592d4){return{'model':db[_0x3592d4[_0x8dca('0x24')]],'as':_0x3592d4['as'],'attributes':_0x3592d4[_0x8dca('0x20')],'include':_0x3592d4[_0x8dca('0x22')]?_[_0x8dca('0x23')](_0x3592d4[_0x8dca('0x22')],function(_0x250c94){return{'model':db[_0x250c94['model']],'as':_0x250c94['as'],'attributes':_0x250c94['attributes'],'include':_0x250c94['include']?_[_0x8dca('0x23')](_0x250c94[_0x8dca('0x22')],function(_0x1dc03c){return{'model':db[_0x1dc03c[_0x8dca('0x24')]],'as':_0x1dc03c['as'],'attributes':_0x1dc03c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e3358){logger['info'](_0x8dca('0x28'),_0x1887bf);logger['debug'](_0x8dca('0x28'),_0x1887bf,JSON[_0x8dca('0x27')](_0x5e3358));_0x522ba2(_0x5e3358);})[_0x8dca('0x1a')](function(_0x29c5ff){logger[_0x8dca('0x17')](_0x8dca('0x28'),_0x29c5ff[_0x8dca('0x18')],_0x1887bf);_0x5b7815(_0x46aa0e[_0x8dca('0x17')](0x1f4,_0x29c5ff[_0x8dca('0x18')]));});});};
\ No newline at end of file
+var _0xa1fc=['socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetWhatsappQueue','WhatsappQueue','findAll','options','limit','map','include','model','attributes','then','catch','ShowWhatsappQueue','find','raw','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x38fd18,_0x42dc59){var _0xb1c6e9=function(_0x252e9c){while(--_0x252e9c){_0x38fd18['push'](_0x38fd18['shift']());}};_0xb1c6e9(++_0x42dc59);}(_0xa1fc,0x1b5));var _0xca1f=function(_0x1d772e,_0x160013){_0x1d772e=_0x1d772e-0x0;var _0x4b0718=_0xa1fc[_0x1d772e];return _0x4b0718;};'use strict';var _=require(_0xca1f('0x0'));var util=require('util');var moment=require(_0xca1f('0x1'));var BPromise=require(_0xca1f('0x2'));var rs=require(_0xca1f('0x3'));var fs=require('fs');var Redis=require(_0xca1f('0x4'));var db=require(_0xca1f('0x5'))['db'];var utils=require(_0xca1f('0x6'));var logger=require(_0xca1f('0x7'))('rpc');var config=require(_0xca1f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xca1f('0x9')][_0xca1f('0xa')]({'port':0x232a});config[_0xca1f('0xb')]=_[_0xca1f('0xc')](config['redis'],{'host':_0xca1f('0xd'),'port':0x18eb});var socket=require(_0xca1f('0xe'))(new Redis(config[_0xca1f('0xb')]));require(_0xca1f('0xf'))[_0xca1f('0x10')](socket);function respondWithRpcPromise(_0x2e3b92,_0x58603e,_0x3fc0ce){return new BPromise(function(_0x255f51,_0x453574){return client['request'](_0x2e3b92,_0x3fc0ce)['then'](function(_0x25b3a1){logger[_0xca1f('0x11')](_0xca1f('0x12'),_0x58603e,_0xca1f('0x13'));logger[_0xca1f('0x14')](_0xca1f('0x15'),_0x58603e,_0xca1f('0x13'),JSON[_0xca1f('0x16')](_0x25b3a1));if(_0x25b3a1[_0xca1f('0x17')]){if(_0x25b3a1[_0xca1f('0x17')][_0xca1f('0x18')]===0x1f4){logger['error']('WhatsappQueue,\x20%s,\x20%s',_0x58603e,_0x25b3a1[_0xca1f('0x17')][_0xca1f('0x19')]);return _0x453574(_0x25b3a1[_0xca1f('0x17')][_0xca1f('0x19')]);}logger[_0xca1f('0x17')](_0xca1f('0x12'),_0x58603e,_0x25b3a1['error'][_0xca1f('0x19')]);return _0x255f51(_0x25b3a1[_0xca1f('0x17')][_0xca1f('0x19')]);}else{logger[_0xca1f('0x11')](_0xca1f('0x12'),_0x58603e,'request\x20sent');_0x255f51(_0x25b3a1['result'][_0xca1f('0x19')]);}})['catch'](function(_0x5c2db6){logger[_0xca1f('0x17')](_0xca1f('0x12'),_0x58603e,_0x5c2db6);_0x453574(_0x5c2db6);});});}exports[_0xca1f('0x1a')]=function(_0x101bc0){var _0x199ded=this;return new Promise(function(_0x56bb30,_0x5b95f5){return db[_0xca1f('0x1b')][_0xca1f('0x1c')]({'raw':_0x101bc0[_0xca1f('0x1d')]?_0x101bc0[_0xca1f('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x101bc0[_0xca1f('0x1d')]?_0x101bc0[_0xca1f('0x1d')]['where']||null:null,'attributes':_0x101bc0[_0xca1f('0x1d')]?_0x101bc0[_0xca1f('0x1d')]['attributes']||null:null,'limit':_0x101bc0['options']?_0x101bc0['options'][_0xca1f('0x1e')]||null:null,'include':_0x101bc0[_0xca1f('0x1d')]?_0x101bc0['options']['include']?_[_0xca1f('0x1f')](_0x101bc0[_0xca1f('0x1d')][_0xca1f('0x20')],function(_0x7718b7){return{'model':db[_0x7718b7[_0xca1f('0x21')]],'as':_0x7718b7['as'],'attributes':_0x7718b7[_0xca1f('0x22')],'include':_0x7718b7[_0xca1f('0x20')]?_[_0xca1f('0x1f')](_0x7718b7['include'],function(_0x35281a){return{'model':db[_0x35281a[_0xca1f('0x21')]],'as':_0x35281a['as'],'attributes':_0x35281a[_0xca1f('0x22')],'include':_0x35281a['include']?_[_0xca1f('0x1f')](_0x35281a[_0xca1f('0x20')],function(_0x4b28e1){return{'model':db[_0x4b28e1[_0xca1f('0x21')]],'as':_0x4b28e1['as'],'attributes':_0x4b28e1['attributes']};}):[]};}):[]};}):[]:[]})[_0xca1f('0x23')](function(_0x44e69c){logger['info'](_0xca1f('0x1a'),_0x101bc0);logger[_0xca1f('0x14')](_0xca1f('0x1a'),_0x101bc0,JSON['stringify'](_0x44e69c));_0x56bb30(_0x44e69c);})[_0xca1f('0x24')](function(_0x273629){logger[_0xca1f('0x17')](_0xca1f('0x1a'),_0x273629[_0xca1f('0x19')],_0x101bc0);_0x5b95f5(_0x199ded[_0xca1f('0x17')](0x1f4,_0x273629['message']));});});};exports[_0xca1f('0x25')]=function(_0x114fdb){var _0xa429b4=this;return new Promise(function(_0x21c650,_0x1fe4e7){return db['WhatsappQueue'][_0xca1f('0x26')]({'raw':_0x114fdb[_0xca1f('0x1d')]?_0x114fdb[_0xca1f('0x1d')][_0xca1f('0x27')]===undefined?!![]:![]:!![],'where':_0x114fdb['options']?_0x114fdb[_0xca1f('0x1d')][_0xca1f('0x28')]||null:null,'attributes':_0x114fdb[_0xca1f('0x1d')]?_0x114fdb[_0xca1f('0x1d')][_0xca1f('0x22')]||null:null,'include':_0x114fdb[_0xca1f('0x1d')]?_0x114fdb[_0xca1f('0x1d')]['include']?_[_0xca1f('0x1f')](_0x114fdb[_0xca1f('0x1d')][_0xca1f('0x20')],function(_0xa7fea1){return{'model':db[_0xa7fea1[_0xca1f('0x21')]],'as':_0xa7fea1['as'],'attributes':_0xa7fea1['attributes'],'include':_0xa7fea1[_0xca1f('0x20')]?_[_0xca1f('0x1f')](_0xa7fea1['include'],function(_0x56c72b){return{'model':db[_0x56c72b[_0xca1f('0x21')]],'as':_0x56c72b['as'],'attributes':_0x56c72b[_0xca1f('0x22')],'include':_0x56c72b['include']?_[_0xca1f('0x1f')](_0x56c72b[_0xca1f('0x20')],function(_0x1b35c8){return{'model':db[_0x1b35c8[_0xca1f('0x21')]],'as':_0x1b35c8['as'],'attributes':_0x1b35c8[_0xca1f('0x22')]};}):[]};}):[]};}):[]:[]})[_0xca1f('0x23')](function(_0x28827e){logger[_0xca1f('0x11')](_0xca1f('0x25'),_0x114fdb);logger['debug']('ShowWhatsappQueue',_0x114fdb,JSON['stringify'](_0x28827e));_0x21c650(_0x28827e);})[_0xca1f('0x24')](function(_0x720346){logger[_0xca1f('0x17')](_0xca1f('0x25'),_0x720346[_0xca1f('0x19')],_0x114fdb);_0x1fe4e7(_0xa429b4[_0xca1f('0x17')](0x1f4,_0x720346[_0xca1f('0x19')]));});});};
\ No newline at end of file
index 6806b35..ed94683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0dd4=['whatsappQueue:','./whatsappQueue.events','save','update','emit','removeListener','register','length'];(function(_0x92c4d9,_0x2d31f2){var _0x149629=function(_0xc3de64){while(--_0xc3de64){_0x92c4d9['push'](_0x92c4d9['shift']());}};_0x149629(++_0x2d31f2);}(_0x0dd4,0xc1));var _0x40dd=function(_0x4b76dc,_0x14fdf2){_0x4b76dc=_0x4b76dc-0x0;var _0x3266b7=_0x0dd4[_0x4b76dc];return _0x3266b7;};'use strict';var WhatsappQueueEvents=require(_0x40dd('0x0'));var events=[_0x40dd('0x1'),'remove',_0x40dd('0x2')];function createListener(_0x1ffa9d,_0xf455b6){return function(_0x228653){_0xf455b6[_0x40dd('0x3')](_0x1ffa9d,_0x228653);};}function removeListener(_0x21d0e0,_0x263f2e){return function(){WhatsappQueueEvents[_0x40dd('0x4')](_0x21d0e0,_0x263f2e);};}exports[_0x40dd('0x5')]=function(_0x579feb){for(var _0x493256=0x0,_0x23fbe7=events[_0x40dd('0x6')];_0x493256<_0x23fbe7;_0x493256++){var _0x20e687=events[_0x493256];var _0x3a41df=createListener(_0x40dd('0x7')+_0x20e687,_0x579feb);WhatsappQueueEvents['on'](_0x20e687,_0x3a41df);}};
\ No newline at end of file
+var _0x5a14=['whatsappQueue:','save','remove','update','emit','register'];(function(_0x5b831c,_0xad00b6){var _0x5a4a27=function(_0x55c213){while(--_0x55c213){_0x5b831c['push'](_0x5b831c['shift']());}};_0x5a4a27(++_0xad00b6);}(_0x5a14,0x109));var _0x45a1=function(_0x55e865,_0x443a60){_0x55e865=_0x55e865-0x0;var _0x326afc=_0x5a14[_0x55e865];return _0x326afc;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x45a1('0x0'),_0x45a1('0x1'),_0x45a1('0x2')];function createListener(_0x4e60ba,_0x3f81e7){return function(_0x50772a){_0x3f81e7[_0x45a1('0x3')](_0x4e60ba,_0x50772a);};}function removeListener(_0x1c0423,_0x26120e){return function(){WhatsappQueueEvents['removeListener'](_0x1c0423,_0x26120e);};}exports[_0x45a1('0x4')]=function(_0x214480){for(var _0x2bb35a=0x0,_0x4eb9fe=events['length'];_0x2bb35a<_0x4eb9fe;_0x2bb35a++){var _0x55de86=events[_0x2bb35a];var _0x52106c=createListener(_0x45a1('0x5')+_0x55de86,_0x214480);WhatsappQueueEvents['on'](_0x55de86,_0x52106c);}};
\ No newline at end of file
index 75e99d2..8fea548 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb214=['post','create','put','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x47a40b,_0x443ecf){var _0x19610c=function(_0x4b8ce1){while(--_0x4b8ce1){_0x47a40b['push'](_0x47a40b['shift']());}};_0x19610c(++_0x443ecf);}(_0xb214,0x11d));var _0x4b21=function(_0x363aa8,_0x2b7dd5){_0x363aa8=_0x363aa8-0x0;var _0x50ba45=_0xb214[_0x363aa8];return _0x50ba45;};'use strict';var multer=require(_0x4b21('0x0'));var util=require(_0x4b21('0x1'));var path=require('path');var timeout=require(_0x4b21('0x2'));var express=require(_0x4b21('0x3'));var router=express['Router']();var fs_extra=require(_0x4b21('0x4'));var auth=require(_0x4b21('0x5'));var interaction=require(_0x4b21('0x6'));var config=require(_0x4b21('0x7'));var controller=require(_0x4b21('0x8'));router['get']('/',auth[_0x4b21('0x9')](),controller[_0x4b21('0xa')]);router[_0x4b21('0xb')](_0x4b21('0xc'),auth[_0x4b21('0x9')](),controller['describe']);router[_0x4b21('0xb')](_0x4b21('0xd'),auth['isAuthenticated'](),controller[_0x4b21('0xe')]);router[_0x4b21('0xf')]('/',auth[_0x4b21('0x9')](),controller[_0x4b21('0x10')]);router[_0x4b21('0x11')](_0x4b21('0xd'),auth[_0x4b21('0x9')](),controller[_0x4b21('0x12')]);router['delete'](_0x4b21('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4b21('0x13')]=router;
\ No newline at end of file
+var _0x4d16=['show','post','create','put','destroy','exports','multer','util','path','connect-timeout','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x1c926e,_0x1f40ef){var _0x2570a2=function(_0x440e02){while(--_0x440e02){_0x1c926e['push'](_0x1c926e['shift']());}};_0x2570a2(++_0x1f40ef);}(_0x4d16,0x84));var _0x64d1=function(_0x30644c,_0x5279e7){_0x30644c=_0x30644c-0x0;var _0x4946c0=_0x4d16[_0x30644c];return _0x4946c0;};'use strict';var multer=require(_0x64d1('0x0'));var util=require(_0x64d1('0x1'));var path=require(_0x64d1('0x2'));var timeout=require(_0x64d1('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x64d1('0x4'));var controller=require(_0x64d1('0x5'));router[_0x64d1('0x6')]('/',auth[_0x64d1('0x7')](),controller[_0x64d1('0x8')]);router['get'](_0x64d1('0x9'),auth[_0x64d1('0x7')](),controller[_0x64d1('0xa')]);router['get'](_0x64d1('0xb'),auth[_0x64d1('0x7')](),controller[_0x64d1('0xc')]);router[_0x64d1('0xd')]('/',auth[_0x64d1('0x7')](),controller[_0x64d1('0xe')]);router[_0x64d1('0xf')](_0x64d1('0xb'),auth[_0x64d1('0x7')](),controller['update']);router['delete'](_0x64d1('0xb'),auth['isAuthenticated'](),controller[_0x64d1('0x10')]);module[_0x64d1('0x11')]=router;
\ No newline at end of file
index 445a532..bab4a8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5c9eb5,_0x321fe2){var _0x41619d=function(_0x1a20c9){while(--_0x1a20c9){_0x5c9eb5['push'](_0x5c9eb5['shift']());}};_0x41619d(++_0x321fe2);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x3f5f09,_0x233623){var _0x42d12f=function(_0x5f00cb){while(--_0x5f00cb){_0x3f5f09['push'](_0x3f5f09['shift']());}};_0x42d12f(++_0x233623);}(_0x7a54,0x106));var _0x47a5=function(_0x5ade7d,_0x4032ca){_0x5ade7d=_0x5ade7d-0x0;var _0x3dee20=_0x7a54[_0x5ade7d];return _0x3dee20;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index ca86be0..cdff9cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','end','error','name','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x56da37,_0x2026d0){var _0x390cdb=function(_0x27a47d){while(--_0x27a47d){_0x56da37['push'](_0x56da37['shift']());}};_0x390cdb(++_0x2026d0);}(_0xa571,0x107));var _0x1a57=function(_0x2208e2,_0x500060){_0x2208e2=_0x2208e2-0x0;var _0x492b02=_0xa571[_0x2208e2];return _0x492b02;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));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('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x2f9454,_0x182649){return function(_0x25c1e9){if(!_0x25c1e9){_0x2f9454[_0x1a57('0x18')](0x194);}return _0x25c1e9;};}function handleError(_0x27cfe1,_0xf6ffef){_0xf6ffef=_0xf6ffef||0x1f4;return function(_0x26584b){logger[_0x1a57('0x24')](_0x26584b['stack']);if(_0x26584b['name']){delete _0x26584b[_0x1a57('0x25')];}_0x27cfe1[_0x1a57('0x19')](_0xf6ffef)['send'](_0x26584b);};}exports[_0x1a57('0x26')]=function(_0x54f6a5,_0x2d8738){var _0x4a2901={},_0x53bf6e={},_0x8179a4={'count':0x0,'rows':[]};var _0x274fe6=_[_0x1a57('0x27')](db[_0x1a57('0x28')]['rawAttributes'],function(_0x366d5f){return{'name':_0x366d5f[_0x1a57('0x29')],'type':_0x366d5f[_0x1a57('0x2a')][_0x1a57('0x2b')]};});_0x53bf6e['model']=_[_0x1a57('0x27')](_0x274fe6,_0x1a57('0x25'));_0x53bf6e[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x54f6a5[_0x1a57('0x2c')]);_0x53bf6e[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],_0x53bf6e[_0x1a57('0x2c')]);_0x4a2901['attributes']=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],qs['fields'](_0x54f6a5['query'][_0x1a57('0x31')]));_0x4a2901[_0x1a57('0x32')]=_0x4a2901[_0x1a57('0x32')][_0x1a57('0x33')]?_0x4a2901[_0x1a57('0x32')]:_0x53bf6e[_0x1a57('0x30')];if(!_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x34')](_0x1a57('0x35'))){_0x4a2901[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x4a2901[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1e')]);}_0x4a2901[_0x1a57('0x36')]=qs['sort'](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x37')]);_0x4a2901[_0x1a57('0x38')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x39')](_0x54f6a5[_0x1a57('0x2c')],_0x53bf6e[_0x1a57('0x2e')]),_0x274fe6);if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]){_0x4a2901['where']=_['merge'](_0x4a2901['where'],{'$or':_['map'](_0x274fe6,function(_0x333b32){if(_0x333b32[_0x1a57('0x2a')]!==_0x1a57('0x3b')){var _0x4d6e1e={};_0x4d6e1e[_0x333b32[_0x1a57('0x25')]]={'$like':'%'+_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]+'%'};return _0x4d6e1e;}})});}_0x4a2901=_[_0x1a57('0x3c')]({},_0x4a2901,_0x54f6a5['options']);var _0x1be254={'where':_0x4a2901['where']};return db[_0x1a57('0x28')][_0x1a57('0x1d')](_0x1be254)[_0x1a57('0x21')](function(_0x534a9a){_0x8179a4[_0x1a57('0x1d')]=_0x534a9a;if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x4a2901[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x28')]['findAll'](_0x4a2901);})[_0x1a57('0x21')](function(_0x47e998){_0x8179a4['rows']=_0x47e998;return _0x8179a4;})[_0x1a57('0x21')](respondWithFilteredResult(_0x2d8738,_0x4a2901))['catch'](handleError(_0x2d8738,null));};exports[_0x1a57('0x3f')]=function(_0x398c59,_0x3fbae1){var _0x59abb1={'raw':!![],'where':{'id':_0x398c59[_0x1a57('0x40')]['id']}},_0x188a50={};_0x188a50[_0x1a57('0x30')]=_[_0x1a57('0x2d')](db['WhatsappQueueReport'][_0x1a57('0x41')]);_0x188a50[_0x1a57('0x2c')]=_['keys'](_0x398c59[_0x1a57('0x2c')]);_0x188a50['filters']=_['intersection'](_0x188a50[_0x1a57('0x30')],_0x188a50[_0x1a57('0x2c')]);_0x59abb1[_0x1a57('0x32')]=_[_0x1a57('0x2f')](_0x188a50['model'],qs[_0x1a57('0x31')](_0x398c59[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x59abb1[_0x1a57('0x32')]=_0x59abb1[_0x1a57('0x32')]['length']?_0x59abb1[_0x1a57('0x32')]:_0x188a50[_0x1a57('0x30')];if(_0x398c59[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x59abb1['include']=[{'all':!![]}];}_0x59abb1=_[_0x1a57('0x3c')]({},_0x59abb1,_0x398c59['options']);return db[_0x1a57('0x28')][_0x1a57('0x42')](_0x59abb1)[_0x1a57('0x21')](handleEntityNotFound(_0x3fbae1,null))[_0x1a57('0x21')](respondWithResult(_0x3fbae1,null))[_0x1a57('0x43')](handleError(_0x3fbae1,null));};exports[_0x1a57('0x44')]=function(_0x28f629,_0x401285){return db[_0x1a57('0x28')][_0x1a57('0x44')](_0x28f629[_0x1a57('0x45')],{})[_0x1a57('0x21')](respondWithResult(_0x401285,0xc9))[_0x1a57('0x43')](handleError(_0x401285,null));};exports['update']=function(_0xf4d056,_0x480aff){if(_0xf4d056[_0x1a57('0x45')]['id']){delete _0xf4d056[_0x1a57('0x45')]['id'];}return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0xf4d056[_0x1a57('0x40')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x480aff,null))[_0x1a57('0x21')](saveUpdates(_0xf4d056[_0x1a57('0x45')],null))[_0x1a57('0x21')](respondWithResult(_0x480aff,null))['catch'](handleError(_0x480aff,null));};exports[_0x1a57('0x22')]=function(_0x439a42,_0x51651d){return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0x439a42['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x51651d,null))[_0x1a57('0x21')](removeEntity(_0x51651d,null))['catch'](handleError(_0x51651d,null));};exports['describe']=function(_0x5b0563,_0x2c1bac){return db[_0x1a57('0x28')]['describe']()[_0x1a57('0x21')](respondWithResult(_0x2c1bac,null))[_0x1a57('0x43')](handleError(_0x2c1bac,null));};
\ No newline at end of file
+var _0x0fd9=['includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','WhatsappQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x30008e,_0x265a6d){var _0x2e35e3=function(_0x3b97e7){while(--_0x3b97e7){_0x30008e['push'](_0x30008e['shift']());}};_0x2e35e3(++_0x265a6d);}(_0x0fd9,0xa3));var _0x90fd=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x0fd9[_0x1809c5];return _0x5254a4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['WhatsappQueueReport']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['WhatsappQueueReport'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};exports[_0x90fd('0x4b')]=function(_0xb8a2af,_0x13c428){return db[_0x90fd('0x2b')][_0x90fd('0x4b')]()['then'](respondWithResult(_0x13c428,null))['catch'](handleError(_0x13c428,null));};
\ No newline at end of file
index 9489d2b..4ac9d99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0485=['api','moment','bluebird','rimraf','../../config/environment','./whatsappQueueReport.attributes','define','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x31ad90,_0x2119f9){var _0x20278a=function(_0x36699c){while(--_0x36699c){_0x31ad90['push'](_0x31ad90['shift']());}};_0x20278a(++_0x2119f9);}(_0x0485,0x195));var _0x5048=function(_0x596284,_0x1cd02b){_0x596284=_0x596284-0x0;var _0x5313c6=_0x0485[_0x596284];return _0x5313c6;};'use strict';var _=require(_0x5048('0x0'));var util=require(_0x5048('0x1'));var logger=require(_0x5048('0x2'))(_0x5048('0x3'));var moment=require(_0x5048('0x4'));var BPromise=require(_0x5048('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5048('0x6'));var config=require(_0x5048('0x7'));var attributes=require(_0x5048('0x8'));module['exports']=function(_0x4ba01e,_0x14cf52){return _0x4ba01e[_0x5048('0x9')]('WhatsappQueueReport',attributes,{'tableName':_0x5048('0xa'),'paranoid':![],'indexes':[{'name':_0x5048('0xb'),'fields':[_0x5048('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x30e2=['WhatsappQueueReport','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','define'];(function(_0x1f88d4,_0x3f2a9c){var _0x31970d=function(_0x439a8a){while(--_0x439a8a){_0x1f88d4['push'](_0x1f88d4['shift']());}};_0x31970d(++_0x3f2a9c);}(_0x30e2,0xbd));var _0x230e=function(_0x172a1a,_0x36108a){_0x172a1a=_0x172a1a-0x0;var _0x41acee=_0x30e2[_0x172a1a];return _0x41acee;};'use strict';var _=require('lodash');var util=require(_0x230e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x230e('0x1'));var BPromise=require(_0x230e('0x2'));var rp=require(_0x230e('0x3'));var fs=require('fs');var path=require(_0x230e('0x4'));var rimraf=require(_0x230e('0x5'));var config=require(_0x230e('0x6'));var attributes=require(_0x230e('0x7'));module['exports']=function(_0x1db4af,_0x329c4c){return _0x1db4af[_0x230e('0x8')](_0x230e('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x230e('0xa'),'fields':[_0x230e('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 2bb65b3..64c63bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf10=['http','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','CreateWhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport','update','where','attributes','limit','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcf10,0x1d6));var _0x0cf1=function(_0x5533b1,_0x7f4a9a){_0x5533b1=_0x5533b1-0x0;var _0x1009f3=_0xcf10[_0x5533b1];return _0x1009f3;};'use strict';var _=require('lodash');var util=require(_0x0cf1('0x0'));var moment=require(_0x0cf1('0x1'));var BPromise=require(_0x0cf1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0cf1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cf1('0x4'));var logger=require(_0x0cf1('0x5'))(_0x0cf1('0x6'));var config=require(_0x0cf1('0x7'));var jayson=require(_0x0cf1('0x8'));var client=jayson[_0x0cf1('0x9')][_0x0cf1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1dbc19,_0x4addd1,_0x16ddd5){return new BPromise(function(_0x357da5,_0xd5fd9){return client['request'](_0x1dbc19,_0x16ddd5)[_0x0cf1('0xb')](function(_0x306139){logger['info'](_0x0cf1('0xc'),_0x4addd1,_0x0cf1('0xd'));logger[_0x0cf1('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x4addd1,'request\x20sent',JSON[_0x0cf1('0xf')](_0x306139));if(_0x306139[_0x0cf1('0x10')]){if(_0x306139[_0x0cf1('0x10')][_0x0cf1('0x11')]===0x1f4){logger[_0x0cf1('0x10')](_0x0cf1('0xc'),_0x4addd1,_0x306139['error'][_0x0cf1('0x12')]);return _0xd5fd9(_0x306139[_0x0cf1('0x10')][_0x0cf1('0x12')]);}logger[_0x0cf1('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x4addd1,_0x306139[_0x0cf1('0x10')][_0x0cf1('0x12')]);return _0x357da5(_0x306139['error'][_0x0cf1('0x12')]);}else{logger[_0x0cf1('0x13')](_0x0cf1('0xc'),_0x4addd1,_0x0cf1('0xd'));_0x357da5(_0x306139[_0x0cf1('0x14')]['message']);}})[_0x0cf1('0x15')](function(_0x40ac45){logger[_0x0cf1('0x10')](_0x0cf1('0xc'),_0x4addd1,_0x40ac45);_0xd5fd9(_0x40ac45);});});}exports[_0x0cf1('0x16')]=function(_0x41c595){var _0x1553ef=this;return new Promise(function(_0x3d9dee,_0x34e6e2){return db['WhatsappQueueReport'][_0x0cf1('0x17')](_0x41c595[_0x0cf1('0x18')],{'raw':_0x41c595[_0x0cf1('0x19')]?_0x41c595[_0x0cf1('0x19')][_0x0cf1('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x4cffc6){logger[_0x0cf1('0x13')](_0x0cf1('0x16'),_0x41c595);logger[_0x0cf1('0xe')](_0x0cf1('0x16'),_0x41c595,JSON['stringify'](_0x4cffc6));_0x3d9dee(_0x4cffc6);})[_0x0cf1('0x15')](function(_0x3b420e){logger[_0x0cf1('0x10')]('CreateWhatsappQueueReport',_0x3b420e[_0x0cf1('0x12')],_0x41c595);_0x34e6e2(_0x1553ef[_0x0cf1('0x10')](0x1f4,_0x3b420e[_0x0cf1('0x12')]));});});};exports[_0x0cf1('0x1b')]=function(_0x9f4ad7){var _0x491ddb=this;return new Promise(function(_0xe98ae9,_0x16fdcb){return db['WhatsappQueueReport'][_0x0cf1('0x1c')](_0x9f4ad7[_0x0cf1('0x18')],{'raw':_0x9f4ad7[_0x0cf1('0x19')]?_0x9f4ad7[_0x0cf1('0x19')][_0x0cf1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9f4ad7[_0x0cf1('0x19')]?_0x9f4ad7['options'][_0x0cf1('0x1d')]||null:null,'attributes':_0x9f4ad7[_0x0cf1('0x19')]?_0x9f4ad7[_0x0cf1('0x19')][_0x0cf1('0x1e')]||null:null,'limit':_0x9f4ad7[_0x0cf1('0x19')]?_0x9f4ad7[_0x0cf1('0x19')][_0x0cf1('0x1f')]||null:null})[_0x0cf1('0xb')](function(_0x1f137e){logger[_0x0cf1('0x13')](_0x0cf1('0x1b'),_0x9f4ad7);logger['debug']('UpdateWhatsappQueueReport',_0x9f4ad7,JSON['stringify'](_0x1f137e));_0xe98ae9(_0x1f137e);})[_0x0cf1('0x15')](function(_0x359f8e){logger['error'](_0x0cf1('0x1b'),_0x359f8e[_0x0cf1('0x12')],_0x9f4ad7);_0x16fdcb(_0x491ddb[_0x0cf1('0x10')](0x1f4,_0x359f8e[_0x0cf1('0x12')]));});});};
\ No newline at end of file
+var _0x7aee=['rpc','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateWhatsappQueueReport','create','body','options','raw','debug','UpdateWhatsappQueueReport','update','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x5cc8cd,_0x3f10fa){var _0x363ce5=function(_0xb89057){while(--_0xb89057){_0x5cc8cd['push'](_0x5cc8cd['shift']());}};_0x363ce5(++_0x3f10fa);}(_0x7aee,0x155));var _0xe7ae=function(_0x2b2436,_0x4d4840){_0x2b2436=_0x2b2436-0x0;var _0x18f365=_0x7aee[_0x2b2436];return _0x18f365;};'use strict';var _=require(_0xe7ae('0x0'));var util=require(_0xe7ae('0x1'));var moment=require(_0xe7ae('0x2'));var BPromise=require(_0xe7ae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7ae('0x4'));var db=require(_0xe7ae('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7ae('0x6'))(_0xe7ae('0x7'));var config=require(_0xe7ae('0x8'));var jayson=require(_0xe7ae('0x9'));var client=jayson['client'][_0xe7ae('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43302f,_0x46c33f,_0x28a8d6){return new BPromise(function(_0x2c384f,_0x4e4584){return client[_0xe7ae('0xb')](_0x43302f,_0x28a8d6)[_0xe7ae('0xc')](function(_0x2702a9){logger[_0xe7ae('0xd')](_0xe7ae('0xe'),_0x46c33f,'request\x20sent');logger['debug'](_0xe7ae('0xf'),_0x46c33f,'request\x20sent',JSON[_0xe7ae('0x10')](_0x2702a9));if(_0x2702a9[_0xe7ae('0x11')]){if(_0x2702a9[_0xe7ae('0x11')]['code']===0x1f4){logger[_0xe7ae('0x11')](_0xe7ae('0xe'),_0x46c33f,_0x2702a9[_0xe7ae('0x11')][_0xe7ae('0x12')]);return _0x4e4584(_0x2702a9[_0xe7ae('0x11')]['message']);}logger[_0xe7ae('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x46c33f,_0x2702a9[_0xe7ae('0x11')]['message']);return _0x2c384f(_0x2702a9['error'][_0xe7ae('0x12')]);}else{logger['info'](_0xe7ae('0xe'),_0x46c33f,'request\x20sent');_0x2c384f(_0x2702a9['result']['message']);}})[_0xe7ae('0x13')](function(_0x4a0554){logger[_0xe7ae('0x11')](_0xe7ae('0xe'),_0x46c33f,_0x4a0554);_0x4e4584(_0x4a0554);});});}exports[_0xe7ae('0x14')]=function(_0x448d14){var _0x30a49c=this;return new Promise(function(_0x4a86b9,_0x2074bb){return db['WhatsappQueueReport'][_0xe7ae('0x15')](_0x448d14[_0xe7ae('0x16')],{'raw':_0x448d14[_0xe7ae('0x17')]?_0x448d14[_0xe7ae('0x17')][_0xe7ae('0x18')]===undefined?!![]:![]:!![]})[_0xe7ae('0xc')](function(_0xa5135f){logger[_0xe7ae('0xd')](_0xe7ae('0x14'),_0x448d14);logger[_0xe7ae('0x19')](_0xe7ae('0x14'),_0x448d14,JSON[_0xe7ae('0x10')](_0xa5135f));_0x4a86b9(_0xa5135f);})[_0xe7ae('0x13')](function(_0x5a0c98){logger[_0xe7ae('0x11')](_0xe7ae('0x14'),_0x5a0c98[_0xe7ae('0x12')],_0x448d14);_0x2074bb(_0x30a49c[_0xe7ae('0x11')](0x1f4,_0x5a0c98[_0xe7ae('0x12')]));});});};exports[_0xe7ae('0x1a')]=function(_0x33f01e){var _0x558954=this;return new Promise(function(_0x24bafc,_0x279780){return db['WhatsappQueueReport'][_0xe7ae('0x1b')](_0x33f01e[_0xe7ae('0x16')],{'raw':_0x33f01e['options']?_0x33f01e[_0xe7ae('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33f01e[_0xe7ae('0x17')]?_0x33f01e[_0xe7ae('0x17')]['where']||null:null,'attributes':_0x33f01e['options']?_0x33f01e[_0xe7ae('0x17')][_0xe7ae('0x1c')]||null:null,'limit':_0x33f01e[_0xe7ae('0x17')]?_0x33f01e[_0xe7ae('0x17')]['limit']||null:null})['then'](function(_0x1158fd){logger[_0xe7ae('0xd')](_0xe7ae('0x1a'),_0x33f01e);logger['debug'](_0xe7ae('0x1a'),_0x33f01e,JSON[_0xe7ae('0x10')](_0x1158fd));_0x24bafc(_0x1158fd);})[_0xe7ae('0x13')](function(_0x1d311f){logger[_0xe7ae('0x11')](_0xe7ae('0x1a'),_0x1d311f[_0xe7ae('0x12')],_0x33f01e);_0x279780(_0x558954[_0xe7ae('0x11')](0x1f4,_0x1d311f[_0xe7ae('0x12')]));});});};
\ No newline at end of file
index c738f59..543d95d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ed7=['path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x14c5a2,_0x280314){var _0x2c45d7=function(_0x4e4b4f){while(--_0x4e4b4f){_0x14c5a2['push'](_0x14c5a2['shift']());}};_0x2c45d7(++_0x280314);}(_0x9ed7,0x18d));var _0x79ed=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0x9ed7[_0xfc0976];return _0x23579f;};'use strict';var multer=require(_0x79ed('0x0'));var util=require(_0x79ed('0x1'));var path=require(_0x79ed('0x2'));var timeout=require('connect-timeout');var express=require(_0x79ed('0x3'));var router=express[_0x79ed('0x4')]();var fs_extra=require(_0x79ed('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x79ed('0x6'));var controller=require('./whatsappTransferReport.controller');router[_0x79ed('0x7')]('/',auth[_0x79ed('0x8')](),controller[_0x79ed('0x9')]);router[_0x79ed('0x7')](_0x79ed('0xa'),auth[_0x79ed('0x8')](),controller[_0x79ed('0xb')]);router[_0x79ed('0x7')](_0x79ed('0xc'),auth['isAuthenticated'](),controller[_0x79ed('0xd')]);router[_0x79ed('0xe')]('/',auth[_0x79ed('0x8')](),controller[_0x79ed('0xf')]);router[_0x79ed('0x10')](_0x79ed('0xc'),auth[_0x79ed('0x8')](),controller[_0x79ed('0x11')]);router[_0x79ed('0x12')](_0x79ed('0xc'),auth[_0x79ed('0x8')](),controller[_0x79ed('0x13')]);module[_0x79ed('0x14')]=router;
\ No newline at end of file
+var _0xce0c=['update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','get','/describe','describe','show','post','create','put','/:id'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0xce0c,0x18e));var _0xcce0=function(_0x2b85d5,_0x3115b7){_0x2b85d5=_0x2b85d5-0x0;var _0xe8c96f=_0xce0c[_0x2b85d5];return _0xe8c96f;};'use strict';var multer=require(_0xcce0('0x0'));var util=require(_0xcce0('0x1'));var path=require(_0xcce0('0x2'));var timeout=require(_0xcce0('0x3'));var express=require(_0xcce0('0x4'));var router=express[_0xcce0('0x5')]();var fs_extra=require(_0xcce0('0x6'));var auth=require(_0xcce0('0x7'));var interaction=require(_0xcce0('0x8'));var config=require(_0xcce0('0x9'));var controller=require(_0xcce0('0xa'));router['get']('/',auth[_0xcce0('0xb')](),controller['index']);router[_0xcce0('0xc')](_0xcce0('0xd'),auth[_0xcce0('0xb')](),controller[_0xcce0('0xe')]);router[_0xcce0('0xc')]('/:id',auth[_0xcce0('0xb')](),controller[_0xcce0('0xf')]);router[_0xcce0('0x10')]('/',auth[_0xcce0('0xb')](),controller[_0xcce0('0x11')]);router[_0xcce0('0x12')](_0xcce0('0x13'),auth[_0xcce0('0xb')](),controller[_0xcce0('0x14')]);router[_0xcce0('0x15')]('/:id',auth[_0xcce0('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index bdb1bf9..1645e4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b08=['DATE','sequelize','STRING','ENUM','account','queue'];(function(_0x13f5be,_0x176364){var _0x31dfad=function(_0x586b7c){while(--_0x586b7c){_0x13f5be['push'](_0x13f5be['shift']());}};_0x31dfad(++_0x176364);}(_0x7b08,0x163));var _0x87b0=function(_0x487fb7,_0x33cbef){_0x487fb7=_0x487fb7-0x0;var _0x110c88=_0x7b08[_0x487fb7];return _0x110c88;};'use strict';var Sequelize=require(_0x87b0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x87b0('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x87b0('0x2')](_0x87b0('0x3'),'agent',_0x87b0('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x87b0('0x5')]}};
\ No newline at end of file
+var _0x1f81=['account','queue','DATE','sequelize','exports','ENUM'];(function(_0x23122f,_0x4f17cd){var _0x5964a1=function(_0x5b88e3){while(--_0x5b88e3){_0x23122f['push'](_0x23122f['shift']());}};_0x5964a1(++_0x4f17cd);}(_0x1f81,0xab));var _0x11f8=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0x1f81[_0x95942];return _0x6d7f81;};'use strict';var Sequelize=require(_0x11f8('0x0'));module[_0x11f8('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x11f8('0x2')](_0x11f8('0x3'),'agent',_0x11f8('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x11f8('0x5')]}};
\ No newline at end of file
index 270412b..a5bfd38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c16=['sendStatus','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','where','type','merge','includeAll','include','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then'];(function(_0x960339,_0x53a0cc){var _0x176cee=function(_0x4b3929){while(--_0x4b3929){_0x960339['push'](_0x960339['shift']());}};_0x176cee(++_0x53a0cc);}(_0x2c16,0xf0));var _0x62c1=function(_0x1ecb8d,_0xa7c601){_0x1ecb8d=_0x1ecb8d-0x0;var _0x425742=_0x2c16[_0x1ecb8d];return _0x425742;};'use strict';var emlformat=require(_0x62c1('0x0'));var rimraf=require(_0x62c1('0x1'));var zipdir=require(_0x62c1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x62c1('0x3'));var moment=require(_0x62c1('0x4'));var BPromise=require(_0x62c1('0x5'));var Mustache=require(_0x62c1('0x6'));var util=require(_0x62c1('0x7'));var path=require(_0x62c1('0x8'));var sox=require(_0x62c1('0x9'));var csv=require(_0x62c1('0xa'));var ejs=require(_0x62c1('0xb'));var fs=require('fs');var fs_extra=require(_0x62c1('0xc'));var _=require('lodash');var squel=require(_0x62c1('0xd'));var crypto=require(_0x62c1('0xe'));var jsforce=require(_0x62c1('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x62c1('0xa'));var querystring=require('querystring');var Papa=require(_0x62c1('0x10'));var Redis=require(_0x62c1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x62c1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62c1('0x13'));var logger=require(_0x62c1('0x14'))(_0x62c1('0x15'));var utils=require(_0x62c1('0x16'));var config=require(_0x62c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34228,_0x25bcbd){_0x25bcbd=_0x25bcbd||0xcc;return function(_0x521795){if(_0x521795){return _0x34228['sendStatus'](_0x25bcbd);}return _0x34228[_0x62c1('0x18')](_0x25bcbd)[_0x62c1('0x19')]();};}function respondWithResult(_0x54c85a,_0x1b6728){_0x1b6728=_0x1b6728||0xc8;return function(_0x45357f){if(_0x45357f){return _0x54c85a[_0x62c1('0x18')](_0x1b6728)[_0x62c1('0x1a')](_0x45357f);}};}function respondWithFilteredResult(_0x2ebd95,_0x49b237){return function(_0x26f1d0){if(_0x26f1d0){var _0x54199e=typeof _0x49b237[_0x62c1('0x1b')]===_0x62c1('0x1c')&&typeof _0x49b237[_0x62c1('0x1d')]===_0x62c1('0x1c');var _0xeb9fbb=_0x26f1d0[_0x62c1('0x1e')];var _0x45a551=_0x54199e?0x0:_0x49b237[_0x62c1('0x1b')];var _0x11ae3a=_0x54199e?_0x26f1d0[_0x62c1('0x1e')]:_0x49b237[_0x62c1('0x1b')]+_0x49b237[_0x62c1('0x1d')];var _0x474f67;if(_0x11ae3a>=_0xeb9fbb){_0x11ae3a=_0xeb9fbb;_0x474f67=0xc8;}else{_0x474f67=0xce;}_0x2ebd95['status'](_0x474f67);return _0x2ebd95[_0x62c1('0x1f')](_0x62c1('0x20'),_0x45a551+'-'+_0x11ae3a+'/'+_0xeb9fbb)['json'](_0x26f1d0);}return null;};}function patchUpdates(_0x560614){return function(_0x39541d){try{jsonpatch['apply'](_0x39541d,_0x560614,!![]);}catch(_0x4c0261){return BPromise['reject'](_0x4c0261);}return _0x39541d[_0x62c1('0x21')]();};}function saveUpdates(_0xb06305,_0x4335d5){return function(_0x116cdd){if(_0x116cdd){return _0x116cdd[_0x62c1('0x22')](_0xb06305)[_0x62c1('0x23')](function(_0x39d2db){return _0x39d2db;});}return null;};}function removeEntity(_0xab8b0f,_0x1fc354){return function(_0x383088){if(_0x383088){return _0x383088['destroy']()[_0x62c1('0x23')](function(){_0xab8b0f[_0x62c1('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f2a8b,_0x4963b5){return function(_0x151fba){if(!_0x151fba){_0x2f2a8b[_0x62c1('0x24')](0x194);}return _0x151fba;};}function handleError(_0x3d2682,_0x5e54cd){_0x5e54cd=_0x5e54cd||0x1f4;return function(_0x518dd1){logger['error'](_0x518dd1['stack']);if(_0x518dd1[_0x62c1('0x25')]){delete _0x518dd1[_0x62c1('0x25')];}_0x3d2682[_0x62c1('0x18')](_0x5e54cd)['send'](_0x518dd1);};}exports[_0x62c1('0x26')]=function(_0x397c74,_0x3cc34d){var _0x333164={},_0x58589e={},_0x45b8ad={'count':0x0,'rows':[]};var _0x356a4d=_[_0x62c1('0x27')](db[_0x62c1('0x28')][_0x62c1('0x29')],function(_0x44c6bb){return{'name':_0x44c6bb[_0x62c1('0x2a')],'type':_0x44c6bb['type']['key']};});_0x58589e[_0x62c1('0x2b')]=_['map'](_0x356a4d,_0x62c1('0x25'));_0x58589e[_0x62c1('0x2c')]=_[_0x62c1('0x2d')](_0x397c74[_0x62c1('0x2c')]);_0x58589e[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x58589e[_0x62c1('0x2b')],_0x58589e[_0x62c1('0x2c')]);_0x333164[_0x62c1('0x30')]=_['intersection'](_0x58589e['model'],qs['fields'](_0x397c74['query'][_0x62c1('0x31')]));_0x333164[_0x62c1('0x30')]=_0x333164[_0x62c1('0x30')][_0x62c1('0x32')]?_0x333164['attributes']:_0x58589e[_0x62c1('0x2b')];if(!_0x397c74[_0x62c1('0x2c')]['hasOwnProperty']('nolimit')){_0x333164['limit']=qs['limit'](_0x397c74[_0x62c1('0x2c')][_0x62c1('0x1d')]);_0x333164[_0x62c1('0x1b')]=qs[_0x62c1('0x1b')](_0x397c74[_0x62c1('0x2c')][_0x62c1('0x1b')]);}_0x333164['order']=qs[_0x62c1('0x33')](_0x397c74['query'][_0x62c1('0x33')]);_0x333164['where']=qs['filters'](_[_0x62c1('0x34')](_0x397c74[_0x62c1('0x2c')],_0x58589e[_0x62c1('0x2e')]),_0x356a4d);if(_0x397c74[_0x62c1('0x2c')][_0x62c1('0x35')]){_0x333164[_0x62c1('0x36')]=_['merge'](_0x333164[_0x62c1('0x36')],{'$or':_[_0x62c1('0x27')](_0x356a4d,function(_0x3effcf){if(_0x3effcf[_0x62c1('0x37')]!=='VIRTUAL'){var _0x3e930c={};_0x3e930c[_0x3effcf[_0x62c1('0x25')]]={'$like':'%'+_0x397c74[_0x62c1('0x2c')][_0x62c1('0x35')]+'%'};return _0x3e930c;}})});}_0x333164=_[_0x62c1('0x38')]({},_0x333164,_0x397c74['options']);var _0x335c62={'where':_0x333164[_0x62c1('0x36')]};return db[_0x62c1('0x28')][_0x62c1('0x1e')](_0x335c62)[_0x62c1('0x23')](function(_0x4ca971){_0x45b8ad[_0x62c1('0x1e')]=_0x4ca971;if(_0x397c74[_0x62c1('0x2c')][_0x62c1('0x39')]){_0x333164[_0x62c1('0x3a')]=[{'all':!![]}];}return db['WhatsappTransferReport']['findAll'](_0x333164);})[_0x62c1('0x23')](function(_0x5a4af9){_0x45b8ad[_0x62c1('0x3b')]=_0x5a4af9;return _0x45b8ad;})[_0x62c1('0x23')](respondWithFilteredResult(_0x3cc34d,_0x333164))[_0x62c1('0x3c')](handleError(_0x3cc34d,null));};exports[_0x62c1('0x3d')]=function(_0x178406,_0x577ed9){var _0x5cddec={'raw':!![],'where':{'id':_0x178406[_0x62c1('0x3e')]['id']}},_0x5730ea={};_0x5730ea[_0x62c1('0x2b')]=_[_0x62c1('0x2d')](db[_0x62c1('0x28')][_0x62c1('0x29')]);_0x5730ea['query']=_[_0x62c1('0x2d')](_0x178406[_0x62c1('0x2c')]);_0x5730ea[_0x62c1('0x2e')]=_[_0x62c1('0x2f')](_0x5730ea[_0x62c1('0x2b')],_0x5730ea[_0x62c1('0x2c')]);_0x5cddec[_0x62c1('0x30')]=_[_0x62c1('0x2f')](_0x5730ea[_0x62c1('0x2b')],qs[_0x62c1('0x31')](_0x178406[_0x62c1('0x2c')][_0x62c1('0x31')]));_0x5cddec['attributes']=_0x5cddec[_0x62c1('0x30')]['length']?_0x5cddec[_0x62c1('0x30')]:_0x5730ea[_0x62c1('0x2b')];if(_0x178406[_0x62c1('0x2c')][_0x62c1('0x39')]){_0x5cddec[_0x62c1('0x3a')]=[{'all':!![]}];}_0x5cddec=_['merge']({},_0x5cddec,_0x178406[_0x62c1('0x3f')]);return db['WhatsappTransferReport'][_0x62c1('0x40')](_0x5cddec)['then'](handleEntityNotFound(_0x577ed9,null))['then'](respondWithResult(_0x577ed9,null))[_0x62c1('0x3c')](handleError(_0x577ed9,null));};exports[_0x62c1('0x41')]=function(_0x1098cc,_0x50a36f){return db[_0x62c1('0x28')][_0x62c1('0x41')](_0x1098cc['body'],{})[_0x62c1('0x23')](respondWithResult(_0x50a36f,0xc9))[_0x62c1('0x3c')](handleError(_0x50a36f,null));};exports[_0x62c1('0x22')]=function(_0x54fe04,_0x5137de){if(_0x54fe04[_0x62c1('0x42')]['id']){delete _0x54fe04[_0x62c1('0x42')]['id'];}return db[_0x62c1('0x28')][_0x62c1('0x40')]({'where':{'id':_0x54fe04['params']['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x5137de,null))[_0x62c1('0x23')](saveUpdates(_0x54fe04[_0x62c1('0x42')],null))[_0x62c1('0x23')](respondWithResult(_0x5137de,null))[_0x62c1('0x3c')](handleError(_0x5137de,null));};exports[_0x62c1('0x43')]=function(_0x50b02f,_0x2b3ee0){return db[_0x62c1('0x28')][_0x62c1('0x40')]({'where':{'id':_0x50b02f['params']['id']}})[_0x62c1('0x23')](handleEntityNotFound(_0x2b3ee0,null))['then'](removeEntity(_0x2b3ee0,null))[_0x62c1('0x3c')](handleError(_0x2b3ee0,null));};exports[_0x62c1('0x44')]=function(_0x5345c8,_0x2c123f){return db['WhatsappTransferReport'][_0x62c1('0x44')]()['then'](respondWithResult(_0x2c123f,null))[_0x62c1('0x3c')](handleError(_0x2c123f,null));};
\ No newline at end of file
+var _0xdd72=['type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','WhatsappTransferReport','includeAll','include','findAll','rows','show','keys','catch','create','body','destroy','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','name','send','map','rawAttributes','fieldName'];(function(_0x96d980,_0x25a9d0){var _0xe021ab=function(_0x55115a){while(--_0x55115a){_0x96d980['push'](_0x96d980['shift']());}};_0xe021ab(++_0x25a9d0);}(_0xdd72,0xb4));var _0x2dd7=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xdd72[_0xe4d6c6];return _0x3a8935;};'use strict';var emlformat=require(_0x2dd7('0x0'));var rimraf=require(_0x2dd7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2dd7('0x2'));var rp=require(_0x2dd7('0x3'));var moment=require(_0x2dd7('0x4'));var BPromise=require(_0x2dd7('0x5'));var Mustache=require(_0x2dd7('0x6'));var util=require(_0x2dd7('0x7'));var path=require(_0x2dd7('0x8'));var sox=require('sox');var csv=require(_0x2dd7('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2dd7('0xa'));var _=require(_0x2dd7('0xb'));var squel=require(_0x2dd7('0xc'));var crypto=require(_0x2dd7('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2dd7('0x9'));var querystring=require(_0x2dd7('0xe'));var Papa=require(_0x2dd7('0xf'));var Redis=require(_0x2dd7('0x10'));var authService=require(_0x2dd7('0x11'));var qs=require(_0x2dd7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dd7('0x13'));var logger=require(_0x2dd7('0x14'))(_0x2dd7('0x15'));var utils=require(_0x2dd7('0x16'));var config=require(_0x2dd7('0x17'));var licenseUtil=require(_0x2dd7('0x18'));var db=require(_0x2dd7('0x19'))['db'];function respondWithStatusCode(_0x3b1113,_0x2a3f73){_0x2a3f73=_0x2a3f73||0xcc;return function(_0x2850ea){if(_0x2850ea){return _0x3b1113[_0x2dd7('0x1a')](_0x2a3f73);}return _0x3b1113['status'](_0x2a3f73)[_0x2dd7('0x1b')]();};}function respondWithResult(_0x22538f,_0x27e3ca){_0x27e3ca=_0x27e3ca||0xc8;return function(_0x436586){if(_0x436586){return _0x22538f[_0x2dd7('0x1c')](_0x27e3ca)[_0x2dd7('0x1d')](_0x436586);}};}function respondWithFilteredResult(_0x496860,_0x562a62){return function(_0x5aeff9){if(_0x5aeff9){var _0x506df0=typeof _0x562a62[_0x2dd7('0x1e')]==='undefined'&&typeof _0x562a62[_0x2dd7('0x1f')]===_0x2dd7('0x20');var _0xe6f5a4=_0x5aeff9[_0x2dd7('0x21')];var _0x1b2bf3=_0x506df0?0x0:_0x562a62[_0x2dd7('0x1e')];var _0x9f4654=_0x506df0?_0x5aeff9[_0x2dd7('0x21')]:_0x562a62[_0x2dd7('0x1e')]+_0x562a62[_0x2dd7('0x1f')];var _0x11672c;if(_0x9f4654>=_0xe6f5a4){_0x9f4654=_0xe6f5a4;_0x11672c=0xc8;}else{_0x11672c=0xce;}_0x496860[_0x2dd7('0x1c')](_0x11672c);return _0x496860[_0x2dd7('0x22')]('Content-Range',_0x1b2bf3+'-'+_0x9f4654+'/'+_0xe6f5a4)['json'](_0x5aeff9);}return null;};}function patchUpdates(_0xf2d674){return function(_0x2e15ce){try{jsonpatch[_0x2dd7('0x23')](_0x2e15ce,_0xf2d674,!![]);}catch(_0x56334f){return BPromise[_0x2dd7('0x24')](_0x56334f);}return _0x2e15ce[_0x2dd7('0x25')]();};}function saveUpdates(_0x14a2cd,_0x1705eb){return function(_0x5bc277){if(_0x5bc277){return _0x5bc277[_0x2dd7('0x26')](_0x14a2cd)['then'](function(_0x45098c){return _0x45098c;});}return null;};}function removeEntity(_0x5202ba,_0x49c9e2){return function(_0x307eb9){if(_0x307eb9){return _0x307eb9['destroy']()[_0x2dd7('0x27')](function(){_0x5202ba[_0x2dd7('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x165eb6,_0x26119d){return function(_0xa6b1a1){if(!_0xa6b1a1){_0x165eb6[_0x2dd7('0x1a')](0x194);}return _0xa6b1a1;};}function handleError(_0xfcab1b,_0x5b5a4f){_0x5b5a4f=_0x5b5a4f||0x1f4;return function(_0x207dd1){logger['error'](_0x207dd1['stack']);if(_0x207dd1[_0x2dd7('0x28')]){delete _0x207dd1[_0x2dd7('0x28')];}_0xfcab1b[_0x2dd7('0x1c')](_0x5b5a4f)[_0x2dd7('0x29')](_0x207dd1);};}exports['index']=function(_0xcb5c02,_0x57506f){var _0x1a3654={},_0x10f083={},_0x89205e={'count':0x0,'rows':[]};var _0x17df3e=_[_0x2dd7('0x2a')](db['WhatsappTransferReport'][_0x2dd7('0x2b')],function(_0x48cf5e){return{'name':_0x48cf5e[_0x2dd7('0x2c')],'type':_0x48cf5e[_0x2dd7('0x2d')]['key']};});_0x10f083[_0x2dd7('0x2e')]=_[_0x2dd7('0x2a')](_0x17df3e,_0x2dd7('0x28'));_0x10f083[_0x2dd7('0x2f')]=_['keys'](_0xcb5c02['query']);_0x10f083[_0x2dd7('0x30')]=_[_0x2dd7('0x31')](_0x10f083[_0x2dd7('0x2e')],_0x10f083[_0x2dd7('0x2f')]);_0x1a3654[_0x2dd7('0x32')]=_['intersection'](_0x10f083['model'],qs[_0x2dd7('0x33')](_0xcb5c02[_0x2dd7('0x2f')]['fields']));_0x1a3654['attributes']=_0x1a3654[_0x2dd7('0x32')][_0x2dd7('0x34')]?_0x1a3654['attributes']:_0x10f083['model'];if(!_0xcb5c02[_0x2dd7('0x2f')][_0x2dd7('0x35')]('nolimit')){_0x1a3654[_0x2dd7('0x1f')]=qs['limit'](_0xcb5c02[_0x2dd7('0x2f')][_0x2dd7('0x1f')]);_0x1a3654[_0x2dd7('0x1e')]=qs[_0x2dd7('0x1e')](_0xcb5c02['query'][_0x2dd7('0x1e')]);}_0x1a3654[_0x2dd7('0x36')]=qs[_0x2dd7('0x37')](_0xcb5c02['query'][_0x2dd7('0x37')]);_0x1a3654[_0x2dd7('0x38')]=qs[_0x2dd7('0x30')](_[_0x2dd7('0x39')](_0xcb5c02['query'],_0x10f083[_0x2dd7('0x30')]),_0x17df3e);if(_0xcb5c02['query'][_0x2dd7('0x3a')]){_0x1a3654['where']=_[_0x2dd7('0x3b')](_0x1a3654[_0x2dd7('0x38')],{'$or':_['map'](_0x17df3e,function(_0x3d3a0f){if(_0x3d3a0f['type']!=='VIRTUAL'){var _0x145845={};_0x145845[_0x3d3a0f[_0x2dd7('0x28')]]={'$like':'%'+_0xcb5c02[_0x2dd7('0x2f')][_0x2dd7('0x3a')]+'%'};return _0x145845;}})});}_0x1a3654=_[_0x2dd7('0x3b')]({},_0x1a3654,_0xcb5c02[_0x2dd7('0x3c')]);var _0x25712e={'where':_0x1a3654[_0x2dd7('0x38')]};return db[_0x2dd7('0x3d')][_0x2dd7('0x21')](_0x25712e)[_0x2dd7('0x27')](function(_0x1389ce){_0x89205e[_0x2dd7('0x21')]=_0x1389ce;if(_0xcb5c02[_0x2dd7('0x2f')][_0x2dd7('0x3e')]){_0x1a3654[_0x2dd7('0x3f')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x2dd7('0x40')](_0x1a3654);})[_0x2dd7('0x27')](function(_0x130f91){_0x89205e[_0x2dd7('0x41')]=_0x130f91;return _0x89205e;})[_0x2dd7('0x27')](respondWithFilteredResult(_0x57506f,_0x1a3654))['catch'](handleError(_0x57506f,null));};exports[_0x2dd7('0x42')]=function(_0x3b14f3,_0x5dedbb){var _0x175815={'raw':!![],'where':{'id':_0x3b14f3['params']['id']}},_0x5a8de1={};_0x5a8de1['model']=_[_0x2dd7('0x43')](db['WhatsappTransferReport'][_0x2dd7('0x2b')]);_0x5a8de1[_0x2dd7('0x2f')]=_[_0x2dd7('0x43')](_0x3b14f3[_0x2dd7('0x2f')]);_0x5a8de1[_0x2dd7('0x30')]=_[_0x2dd7('0x31')](_0x5a8de1[_0x2dd7('0x2e')],_0x5a8de1[_0x2dd7('0x2f')]);_0x175815[_0x2dd7('0x32')]=_[_0x2dd7('0x31')](_0x5a8de1['model'],qs[_0x2dd7('0x33')](_0x3b14f3[_0x2dd7('0x2f')]['fields']));_0x175815[_0x2dd7('0x32')]=_0x175815['attributes'][_0x2dd7('0x34')]?_0x175815[_0x2dd7('0x32')]:_0x5a8de1['model'];if(_0x3b14f3[_0x2dd7('0x2f')][_0x2dd7('0x3e')]){_0x175815[_0x2dd7('0x3f')]=[{'all':!![]}];}_0x175815=_[_0x2dd7('0x3b')]({},_0x175815,_0x3b14f3[_0x2dd7('0x3c')]);return db[_0x2dd7('0x3d')]['find'](_0x175815)['then'](handleEntityNotFound(_0x5dedbb,null))[_0x2dd7('0x27')](respondWithResult(_0x5dedbb,null))[_0x2dd7('0x44')](handleError(_0x5dedbb,null));};exports[_0x2dd7('0x45')]=function(_0x140138,_0x4b82f0){return db['WhatsappTransferReport'][_0x2dd7('0x45')](_0x140138[_0x2dd7('0x46')],{})[_0x2dd7('0x27')](respondWithResult(_0x4b82f0,0xc9))[_0x2dd7('0x44')](handleError(_0x4b82f0,null));};exports[_0x2dd7('0x26')]=function(_0x457d7b,_0x122983){if(_0x457d7b[_0x2dd7('0x46')]['id']){delete _0x457d7b[_0x2dd7('0x46')]['id'];}return db[_0x2dd7('0x3d')]['find']({'where':{'id':_0x457d7b['params']['id']}})[_0x2dd7('0x27')](handleEntityNotFound(_0x122983,null))[_0x2dd7('0x27')](saveUpdates(_0x457d7b[_0x2dd7('0x46')],null))[_0x2dd7('0x27')](respondWithResult(_0x122983,null))[_0x2dd7('0x44')](handleError(_0x122983,null));};exports[_0x2dd7('0x47')]=function(_0x5b61a7,_0x1af138){return db[_0x2dd7('0x3d')][_0x2dd7('0x48')]({'where':{'id':_0x5b61a7[_0x2dd7('0x49')]['id']}})[_0x2dd7('0x27')](handleEntityNotFound(_0x1af138,null))[_0x2dd7('0x27')](removeEntity(_0x1af138,null))[_0x2dd7('0x44')](handleError(_0x1af138,null));};exports[_0x2dd7('0x4a')]=function(_0x5784fb,_0xa813c8){return db['WhatsappTransferReport'][_0x2dd7('0x4a')]()[_0x2dd7('0x27')](respondWithResult(_0xa813c8,null))[_0x2dd7('0x44')](handleError(_0xa813c8,null));};
\ No newline at end of file
index 639f75a..775b168 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab9e=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xdfe901,_0x52ea7d){var _0x47483e=function(_0x6c2dbf){while(--_0x6c2dbf){_0xdfe901['push'](_0xdfe901['shift']());}};_0x47483e(++_0x52ea7d);}(_0xab9e,0x81));var _0xeab9=function(_0x2d848f,_0x4dd225){_0x2d848f=_0x2d848f-0x0;var _0x20146d=_0xab9e[_0x2d848f];return _0x20146d;};'use strict';var _=require(_0xeab9('0x0'));var util=require(_0xeab9('0x1'));var logger=require(_0xeab9('0x2'))(_0xeab9('0x3'));var moment=require(_0xeab9('0x4'));var BPromise=require(_0xeab9('0x5'));var rp=require(_0xeab9('0x6'));var fs=require('fs');var path=require(_0xeab9('0x7'));var rimraf=require(_0xeab9('0x8'));var config=require(_0xeab9('0x9'));var attributes=require(_0xeab9('0xa'));module[_0xeab9('0xb')]=function(_0x3c7ea,_0x185073){return _0x3c7ea['define'](_0xeab9('0xc'),attributes,{'tableName':_0xeab9('0xd'),'paranoid':![],'indexes':[{'name':_0xeab9('0xe'),'fields':[_0xeab9('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4f6d=['util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','uniqueid','lodash'];(function(_0x227980,_0x338d5b){var _0x496770=function(_0xd354d){while(--_0xd354d){_0x227980['push'](_0x227980['shift']());}};_0x496770(++_0x338d5b);}(_0x4f6d,0x15e));var _0xd4f6=function(_0x4a2936,_0x42d86c){_0x4a2936=_0x4a2936-0x0;var _0x15ffb4=_0x4f6d[_0x4a2936];return _0x15ffb4;};'use strict';var _=require(_0xd4f6('0x0'));var util=require(_0xd4f6('0x1'));var logger=require(_0xd4f6('0x2'))(_0xd4f6('0x3'));var moment=require(_0xd4f6('0x4'));var BPromise=require(_0xd4f6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd4f6('0x6'));var config=require(_0xd4f6('0x7'));var attributes=require(_0xd4f6('0x8'));module[_0xd4f6('0x9')]=function(_0x5bf50f,_0xf58ec5){return _0x5bf50f[_0xd4f6('0xa')](_0xd4f6('0xb'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xd4f6('0xc'),'fields':[_0xd4f6('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 3205b91..533632b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4eaa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x3a34f2,_0x16d340){var _0x42847b=function(_0x3b4213){while(--_0x3b4213){_0x3a34f2['push'](_0x3a34f2['shift']());}};_0x42847b(++_0x16d340);}(_0x4eaa,0x15c));var _0xa4ea=function(_0x20c390,_0x3fe3f0){_0x20c390=_0x20c390-0x0;var _0x5d2c3b=_0x4eaa[_0x20c390];return _0x5d2c3b;};'use strict';var _=require(_0xa4ea('0x0'));var util=require(_0xa4ea('0x1'));var moment=require(_0xa4ea('0x2'));var BPromise=require(_0xa4ea('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa4ea('0x4'));var db=require(_0xa4ea('0x5'))['db'];var utils=require(_0xa4ea('0x6'));var logger=require(_0xa4ea('0x7'))(_0xa4ea('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa4ea('0x9')][_0xa4ea('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43187d,_0x3af02e,_0x2c5b34){return new BPromise(function(_0x1f4078,_0x341748){return client[_0xa4ea('0xb')](_0x43187d,_0x2c5b34)[_0xa4ea('0xc')](function(_0x317928){logger['info'](_0xa4ea('0xd'),_0x3af02e,'request\x20sent');logger[_0xa4ea('0xe')](_0xa4ea('0xf'),_0x3af02e,_0xa4ea('0x10'),JSON['stringify'](_0x317928));if(_0x317928[_0xa4ea('0x11')]){if(_0x317928[_0xa4ea('0x11')]['code']===0x1f4){logger[_0xa4ea('0x11')](_0xa4ea('0xd'),_0x3af02e,_0x317928[_0xa4ea('0x11')][_0xa4ea('0x12')]);return _0x341748(_0x317928['error'][_0xa4ea('0x12')]);}logger[_0xa4ea('0x11')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3af02e,_0x317928[_0xa4ea('0x11')][_0xa4ea('0x12')]);return _0x1f4078(_0x317928[_0xa4ea('0x11')][_0xa4ea('0x12')]);}else{logger[_0xa4ea('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x3af02e,_0xa4ea('0x10'));_0x1f4078(_0x317928[_0xa4ea('0x14')]['message']);}})[_0xa4ea('0x15')](function(_0x394c04){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3af02e,_0x394c04);_0x341748(_0x394c04);});});}
\ No newline at end of file
+var _0x269b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird'];(function(_0x28cae4,_0x444da3){var _0x2d8c20=function(_0x25fbb2){while(--_0x25fbb2){_0x28cae4['push'](_0x28cae4['shift']());}};_0x2d8c20(++_0x444da3);}(_0x269b,0xb5));var _0xb269=function(_0x4d646c,_0x3e6875){_0x4d646c=_0x4d646c-0x0;var _0x2e4fa7=_0x269b[_0x4d646c];return _0x2e4fa7;};'use strict';var _=require('lodash');var util=require(_0xb269('0x0'));var moment=require(_0xb269('0x1'));var BPromise=require(_0xb269('0x2'));var rs=require(_0xb269('0x3'));var fs=require('fs');var Redis=require(_0xb269('0x4'));var db=require(_0xb269('0x5'))['db'];var utils=require(_0xb269('0x6'));var logger=require(_0xb269('0x7'))(_0xb269('0x8'));var config=require('../../config/environment');var jayson=require(_0xb269('0x9'));var client=jayson[_0xb269('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c52de,_0x27ddf9,_0x1ce8eb){return new BPromise(function(_0x47c1e4,_0x3b4e72){return client[_0xb269('0xb')](_0x2c52de,_0x1ce8eb)[_0xb269('0xc')](function(_0x19d6fc){logger[_0xb269('0xd')](_0xb269('0xe'),_0x27ddf9,_0xb269('0xf'));logger['debug'](_0xb269('0x10'),_0x27ddf9,_0xb269('0xf'),JSON[_0xb269('0x11')](_0x19d6fc));if(_0x19d6fc['error']){if(_0x19d6fc['error'][_0xb269('0x12')]===0x1f4){logger[_0xb269('0x13')](_0xb269('0xe'),_0x27ddf9,_0x19d6fc[_0xb269('0x13')][_0xb269('0x14')]);return _0x3b4e72(_0x19d6fc[_0xb269('0x13')]['message']);}logger[_0xb269('0x13')](_0xb269('0xe'),_0x27ddf9,_0x19d6fc['error']['message']);return _0x47c1e4(_0x19d6fc[_0xb269('0x13')][_0xb269('0x14')]);}else{logger[_0xb269('0xd')](_0xb269('0xe'),_0x27ddf9,_0xb269('0xf'));_0x47c1e4(_0x19d6fc[_0xb269('0x15')][_0xb269('0x14')]);}})[_0xb269('0x16')](function(_0x48c549){logger[_0xb269('0x13')]('WhatsappTransferReport,\x20%s,\x20%s',_0x27ddf9,_0x48c549);_0x3b4e72(_0x48c549);});});}
\ No newline at end of file
index 3ec309e..4f535ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5900=['default','start','filter','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','join','info','online','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB'];(function(_0x482b44,_0x4c73cb){var _0x2ce406=function(_0xb7f32a){while(--_0xb7f32a){_0x482b44['push'](_0x482b44['shift']());}};_0x2ce406(++_0x4c73cb);}(_0x5900,0xd2));var _0x0590=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x5900[_0x1a9204];return _0x17ca68;};'use strict';var _=require('lodash');var db=require(_0x0590('0x0'))['db'];var seedDb=require(_0x0590('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x0590('0x2'));var config=require(_0x0590('0x3'));var logger=require(_0x0590('0x4'))('app');var pm2=require(_0x0590('0x5'));var pm2Config=require(_0x0590('0x6'));var schedule=require('./config/schedule');var chat=require(_0x0590('0x7'));var whatsapp=require(_0x0590('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x0590('0x9'));function main(){return db[_0x0590('0xa')][_0x0590('0xb')]()[_0x0590('0xc')](function(){if(config[_0x0590('0xd')]){return seedDb[_0x0590('0xe')]();}})[_0x0590('0xc')](function(){return checkLicense[_0x0590('0xe')]();})[_0x0590('0xc')](function(){return rpc['listen']();})[_0x0590('0xc')](function(_0x42bfba){logger['info'](_0x42bfba);return chat[_0x0590('0xf')]();})[_0x0590('0xc')](function(){return whatsapp['start']();})['then'](function(){return schedule[_0x0590('0xf')]();})['then'](function(){return transcribe[_0x0590('0xf')]();})[_0x0590('0xc')](function(){return provider[_0x0590('0xf')]();})[_0x0590('0xc')](function(_0x15d0a3){logger['info'](_0x15d0a3);return pm2[_0x0590('0xf')](pm2Config);})[_0x0590('0xc')](function(_0x50e005){var _0x2c006e=_0x50e005[_0x0590('0x10')](function(_0x9568fb){return typeof _0x9568fb['exitCode']===_0x0590('0x11')&&_0x9568fb['exitCode']>=0x0;});if(_0x2c006e[_0x0590('0x12')]>0x0){throw new Error(_0x2c006e[_0x0590('0x12')]+_0x0590('0x13')+_[_0x0590('0x14')](_0x2c006e,function(_0x4b1bf2){return'\x22'+_0x4b1bf2[_0x0590('0x15')][_0x0590('0x16')]+'\x22';}));}logger['info']('Online\x20apps:',_[_0x0590('0x14')](_[_0x0590('0x10')](_0x50e005,{'status':'online'}),_0x0590('0x16'))[_0x0590('0x17')]());logger[_0x0590('0x18')]('Offline\x20apps:',_['map'](_[_0x0590('0x10')](_0x50e005,function(_0x5779bb){return _0x5779bb['status']!==_0x0590('0x19');}),_0x0590('0x16'))[_0x0590('0x17')]()||'None');console['log'](_0x0590('0x1a'));})[_0x0590('0x1b')](function(_0x3f35da){console['log'](_0x0590('0x1c'),_0x3f35da);logger[_0x0590('0x1d')](_0x0590('0x1e'),_0x3f35da);process[_0x0590('0x1f')](0x1);});}main();
\ No newline at end of file
+var _0x0be3=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','info','Online\x20apps:','filter','online','join','Offline\x20apps:','status','None','catch','log','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./config/seedDB','./config/license','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','start','exitCode'];(function(_0xebe7f3,_0x1ee7e6){var _0x592902=function(_0x9570bb){while(--_0x9570bb){_0xebe7f3['push'](_0xebe7f3['shift']());}};_0x592902(++_0x1ee7e6);}(_0x0be3,0x9a));var _0x30be=function(_0x4ad90a,_0x1130ce){_0x4ad90a=_0x4ad90a-0x0;var _0x3c1570=_0x0be3[_0x4ad90a];return _0x3c1570;};'use strict';var _=require('lodash');var db=require('./mysqldb')['db'];var seedDb=require(_0x30be('0x0'));var checkLicense=require(_0x30be('0x1'));var rpc=require(_0x30be('0x2'));var config=require('./config/environment');var logger=require(_0x30be('0x3'))('app');var pm2=require(_0x30be('0x4'));var pm2Config=require(_0x30be('0x5'));var schedule=require(_0x30be('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x30be('0x7'));var provider=require(_0x30be('0x8'));function main(){return db['sequelize'][_0x30be('0x9')]()[_0x30be('0xa')](function(){if(config[_0x30be('0xb')]){return seedDb['default']();}})[_0x30be('0xa')](function(){return checkLicense[_0x30be('0xc')]();})[_0x30be('0xa')](function(){return rpc[_0x30be('0xd')]();})['then'](function(_0x4e90cb){logger['info'](_0x4e90cb);return chat[_0x30be('0xe')]();})['then'](function(){return whatsapp[_0x30be('0xe')]();})[_0x30be('0xa')](function(){return schedule[_0x30be('0xe')]();})[_0x30be('0xa')](function(){return transcribe[_0x30be('0xe')]();})[_0x30be('0xa')](function(){return provider[_0x30be('0xe')]();})[_0x30be('0xa')](function(_0x6043f7){logger['info'](_0x6043f7);return pm2[_0x30be('0xe')](pm2Config);})['then'](function(_0x779c45){var _0x44f51b=_0x779c45['filter'](function(_0x108972){return typeof _0x108972[_0x30be('0xf')]==='number'&&_0x108972[_0x30be('0xf')]>=0x0;});if(_0x44f51b[_0x30be('0x10')]>0x0){throw new Error(_0x44f51b[_0x30be('0x10')]+_0x30be('0x11')+_[_0x30be('0x12')](_0x44f51b,function(_0x3538ba){return'\x22'+_0x3538ba[_0x30be('0x13')][_0x30be('0x14')]+'\x22';}));}logger[_0x30be('0x15')](_0x30be('0x16'),_['map'](_[_0x30be('0x17')](_0x779c45,{'status':_0x30be('0x18')}),_0x30be('0x14'))[_0x30be('0x19')]());logger[_0x30be('0x15')](_0x30be('0x1a'),_[_0x30be('0x12')](_[_0x30be('0x17')](_0x779c45,function(_0x323940){return _0x323940[_0x30be('0x1b')]!==_0x30be('0x18');}),_0x30be('0x14'))[_0x30be('0x19')]()||_0x30be('0x1c'));console['log']('App\x20Ready!');})[_0x30be('0x1d')](function(_0x4f59c9){console[_0x30be('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x4f59c9);logger[_0x30be('0x1f')](_0x30be('0x20'),_0x4f59c9);process[_0x30be('0x21')](0x1);});}main();
\ No newline at end of file
index 49e3daa..d02090e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['crypto','bluebird','util','moment','session','fullname','name','internal','email','permissions','voicePause','chatPause','faxPause','smsPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','selectRecallMeCampaign','chatAutoanswer','emailAutoanswerDelay','smsAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','closed','disposition','then','unmanaged','json','Unmanaged.','authorization','startsWith','headers','Basic','User','find','authenticate','pass','status','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','split','unshift','join','promisify','secrets','payload','verify','hex','toString','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','composable-middleware'];(function(_0x2d1436,_0x270a8f){var _0x56c9ab=function(_0xc48b64){while(--_0xc48b64){_0x2d1436['push'](_0x2d1436['shift']());}};_0x56c9ab(++_0x270a8f);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c80bc,_0x3f61db){_0x4c80bc=_0x4c80bc-0x0;var _0x510faf=_0xedd9[_0x4c80bc];return _0x510faf;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x9edd('0x0'));var hardwareConf=require(_0x9edd('0x1'));var licenseUtil=require(_0x9edd('0x2'));var encryptor=require(_0x9edd('0x3'));var _=require(_0x9edd('0x4'));var jwt=require(_0x9edd('0x5'));var expressJwt=require(_0x9edd('0x6'));var compose=require(_0x9edd('0x7'));var basicAuth=require('basic-auth');var crypto=require(_0x9edd('0x8'));var BPromise=require(_0x9edd('0x9'));var util=require(_0x9edd('0xa'));var moment=require(_0x9edd('0xb'));var validateJwt=expressJwt({'secret':config['secrets'][_0x9edd('0xc')]});var userAttributes=['id','role',_0x9edd('0xd'),_0x9edd('0xe'),_0x9edd('0xf'),_0x9edd('0x10'),'userpic',_0x9edd('0x11'),'md5secret',_0x9edd('0x12'),_0x9edd('0x13'),'mailPause',_0x9edd('0x14'),_0x9edd('0x15'),'openchannelPause',_0x9edd('0x16'),_0x9edd('0x17'),_0x9edd('0x18'),_0x9edd('0x19'),_0x9edd('0x1a'),_0x9edd('0x1b'),_0x9edd('0x1c'),_0x9edd('0x1d'),'phoneBarAutoAnswer',_0x9edd('0x1e'),_0x9edd('0x1f'),_0x9edd('0x20'),_0x9edd('0x21'),_0x9edd('0x22'),_0x9edd('0x23'),_0x9edd('0x24'),_0x9edd('0x25'),'phoneBarRemoteControlPort',_0x9edd('0x26'),_0x9edd('0x27'),_0x9edd('0x28'),'privacyEnabled',_0x9edd('0x29'),_0x9edd('0x2a'),_0x9edd('0x2b'),'downloadOmnichannelInteractions',_0x9edd('0x2c'),'ignorePauseForPreviewCalls',_0x9edd('0x2d'),_0x9edd('0x2e'),'chatAutoanswerDelay','emailAutoanswer',_0x9edd('0x2f'),'smsAutoanswer',_0x9edd('0x30'),'openchannelAutoanswer','openchannelAutoanswerDelay',_0x9edd('0x31'),_0x9edd('0x32'),'whatsappAutoanswer','whatsappAutoanswerDelay'];exports[_0x9edd('0x33')]=function(){return this[_0x9edd('0x34')](!![])[_0x9edd('0x35')](function(_0x542172,_0x3741c8,_0x1dca43){if(_0x542172[_0x9edd('0x36')]){_0x1dca43();}else{return db[_0x9edd('0x37')][_0x9edd('0x38')]({'where':{'id':_0x542172['params']['id']},'attributes':['id',_0x9edd('0x39'),_0x9edd('0x3a')],'raw':!![]})[_0x9edd('0x3b')](function(_0x2f9f86){if(_0x2f9f86&&_0x2f9f86[_0x9edd('0x39')]){return _0x3741c8['status'](_0x2f9f86['disposition']===_0x9edd('0x3c')?0x195:0x193)[_0x9edd('0x3d')]({'message':_0x2f9f86[_0x9edd('0x3a')]===_0x9edd('0x3c')?_0x9edd('0x3e'):'Forbidden.'});}else{_0x1dca43();}})['catch'](function(_0x214d0a){_0x1dca43(_0x214d0a);});}});};exports[_0x9edd('0x34')]=function isAuthenticated(_0x1c762c){return compose()['use'](function(_0x238b22,_0x28cfae,_0x2ae8dd){var _0x41af53;if(_0x238b22['headers'][_0x9edd('0x3f')]){if(_[_0x9edd('0x40')](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x42'))){var _0x42e664=basicAuth(_0x238b22);db[_0x9edd('0x43')][_0x9edd('0x44')]({'where':{'name':_0x42e664[_0x9edd('0xe')]}})[_0x9edd('0x3b')](function(_0x4fd03f){if(!_0x4fd03f||!_0x4fd03f[_0x9edd('0x45')](_0x42e664[_0x9edd('0x46')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':'Wrong\x20credentials.'});}_0x238b22[_0x9edd('0x36')]={'id':_0x4fd03f['id']};_0x2ae8dd();})[_0x9edd('0x48')](function(_0x267c74){_0x2ae8dd(_0x267c74);});}else if(_['startsWith'](_0x238b22[_0x9edd('0x41')][_0x9edd('0x3f')],_0x9edd('0x49'))){validateJwt(_0x238b22,_0x28cfae,_0x2ae8dd);}else{if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':_0x9edd('0x4a')});}}}else if(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')]){try{var _0xd0fd74={'audience':hardwareConf[_0x9edd('0x4d')](),'issuer':hardwareConf[_0x9edd('0x4d')]()};verifyJwt(_0x238b22[_0x9edd('0x4b')][_0x9edd('0x4c')],_0xd0fd74)[_0x9edd('0x3b')](function(_0x5757fc){return db[_0x9edd('0x43')]['find']({'where':{'id':_0x5757fc[_0x9edd('0x4e')]}})[_0x9edd('0x3b')](function(_0x10d6fd){_0x41af53=_0x10d6fd;return db[_0x9edd('0x4f')][_0x9edd('0x38')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x9edd('0x50')],'raw':!![]});})[_0x9edd('0x3b')](function(_0x2b3469){if(!_0x41af53||!_[_0x9edd('0x51')](_0x41af53[_0x9edd('0x52')],_0x5757fc[_0x9edd('0x53')])){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x54')});}if(_0x41af53[_0x9edd('0x55')]){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x41af53[_0x9edd('0x56')]){if(_0x2b3469['blockDuration']>0x0){if(moment(_0x41af53[_0x9edd('0x57')])[_0x9edd('0x58')](_0x2b3469[_0x9edd('0x50')],'minutes')>moment()){return _0x28cfae[_0x9edd('0x47')](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});}}else{return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}}_0x238b22[_0x9edd('0x36')]={'id':_0x41af53['id']};_0x2ae8dd();});})[_0x9edd('0x48')](function(){return _0x28cfae['status'](0x191)[_0x9edd('0x3d')]({'message':_0x9edd('0x59')});});}catch(_0x389f51){_0x2ae8dd(_0x389f51);}}else if(_0x1c762c){_0x2ae8dd();}else{return _0x28cfae[_0x9edd('0x47')](0x193)['json']({'message':_0x9edd('0x4a')});}})['use'](function(_0x2bdb3f,_0xc1e657,_0x587d74){if(_0x2bdb3f[_0x9edd('0x36')]){db['User']['find']({'where':{'id':_0x2bdb3f[_0x9edd('0x36')]['id']},'attributes':userAttributes})[_0x9edd('0x3b')](function(_0x1f276b){if(!_0x1f276b){return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5a')});}_0x2bdb3f[_0x9edd('0x36')]=_0x1f276b;_0x587d74();})[_0x9edd('0x48')](function(_0x18c149){_0x587d74(_0x18c149);});}else if(_0x1c762c){_0x587d74();}else{return _0xc1e657[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x5b')});}});};exports[_0x9edd('0x5c')]=function canUpdate(){return compose()[_0x9edd('0x35')](function(_0x46e9f4,_0x5416f8,_0x13197d){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x1e5805){if(_0x1e5805[_0x9edd('0x5e')]){_0x13197d();}else{return _0x5416f8[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})['catch'](function(_0x4bc7a1){_0x13197d(_0x4bc7a1);});});};exports[_0x9edd('0x5f')]=function isWebrtcLicence(){return compose()['use'](function(_0x8b1fdb,_0x19b56b,_0x2b06d3){return licenseUtil[_0x9edd('0x5d')]()[_0x9edd('0x3b')](function(_0x53005b){if(_0x53005b[_0x9edd('0x60')]){_0x2b06d3();}else{return _0x19b56b[_0x9edd('0x47')](0x193)[_0x9edd('0x3d')]({'message':'Forbidden'});}})[_0x9edd('0x48')](function(_0xfd7bd1){_0x2b06d3(_0xfd7bd1);});});};exports[_0x9edd('0x61')]=function(_0x293b03,_0x1d78c4,_0x35bdec){_0x293b03['isMiddleware']=!![];return _0x35bdec();};exports[_0x9edd('0x62')]=function signToken(_0x237e91){return signJwt(_0x237e91);};exports['setTokenCookie']=function(_0xb93816,_0x8d8701){if(!_0xb93816['user']){return _0x8d8701[_0x9edd('0x47')](0x194)[_0x9edd('0x3d')]({'message':_0x9edd('0x63')});}var _0x5215b0={'payload':{'id':_0xb93816[_0x9edd('0x36')]['id'],'role':_0xb93816[_0x9edd('0x36')][_0x9edd('0x64')]},'options':{'expiresIn':0x15180}};return signJwt(_0x5215b0)[_0x9edd('0x3b')](function(_0x53f6e3){_0x8d8701[_0x9edd('0x65')](_0x9edd('0x66'),_0x53f6e3);_0x8d8701[_0x9edd('0x67')]('/dashboards/general');})[_0x9edd('0x48')](function(_0x21f6ce){return _0x8d8701['status'](0x1f4)[_0x9edd('0x68')](_0x21f6ce);});};exports['retrieveApiKey']=function(_0x336494){if(_[_0x9edd('0x69')](_0x336494[_0x9edd('0x52')])||_[_0x9edd('0x69')](_0x336494[_0x9edd('0x6a')])){return null;}else{return createJwt(_0x336494);}};exports[_0x9edd('0x6b')]=function(_0x2334d4){_0x2334d4[_0x9edd('0x52')]=generateNonce();_0x2334d4[_0x9edd('0x6a')]=generateIssuedAt();return createJwt(_0x2334d4);};exports[_0x9edd('0x6c')]=function(_0x31272d,_0x5a3b1d){var _0x161bea=_0x31272d[_0x9edd('0x4b')][_0x9edd('0x4c')];if(_0x161bea){var _0x58fe29={'nonce':_0x5a3b1d[_0x9edd('0x52')],'iat':_0x5a3b1d['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x161bea,_0x58fe29)[_0x9edd('0x3b')](function(){return generateApiKey(_0x5a3b1d);});}else{throw{'message':_0x9edd('0x6d')};}};exports[_0x9edd('0x6e')]=function(_0x35ddb3){var _0x48a900=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x48a900['test'](_0x35ddb3))throw new db['Sequelize'][(_0x9edd('0x6f'))](_0x9edd('0x70'));return;};exports[_0x9edd('0x71')]=function(_0x1091ff,_0x2e2920,_0x41ec97){var _0x25906c=encryptor[_0x9edd('0x72')](_0x2e2920)['split'](',');for(var _0x16dfdc=0x0;_0x16dfdc<_0x41ec97;_0x16dfdc++){if(!_0x25906c[_0x16dfdc])break;if(_0x1091ff['toLowerCase']()===_0x25906c[_0x16dfdc][_0x9edd('0x73')]()){var _0x6a1cfc=util['format'](_0x9edd('0x74'),_0x41ec97);if(_0x41ec97===0x1){_0x6a1cfc=_0x9edd('0x75');}throw new db[(_0x9edd('0x76'))]['ValidationError'](_0x6a1cfc);}}return;};exports[_0x9edd('0x77')]=function(_0x2e1ce3,_0x430eb4){var _0x15ebfa=_0x430eb4?encryptor[_0x9edd('0x72')](_0x430eb4)[_0x9edd('0x78')](','):[];if(_0x15ebfa['length']===0x5){_0x15ebfa['splice'](-0x1,0x1);}_0x15ebfa[_0x9edd('0x79')](_0x2e1ce3);return encryptor['encryptString'](_0x15ebfa[_0x9edd('0x7a')](','));};function signJwt(_0x3e9a3e){var _0x439083=BPromise[_0x9edd('0x7b')](jwt['sign'],{'context':jwt});var _0x21ead2=_0x3e9a3e['secret']||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0xc6bde6,_0x5ca123){_0x439083(_0x3e9a3e[_0x9edd('0x7d')],_0x21ead2,_0x3e9a3e['options'])[_0x9edd('0x3b')](function(_0x4e1eda){_0xc6bde6(_0x4e1eda);})['catch'](function(_0x236b82){_0x5ca123(_0x236b82);});});}function verifyJwt(_0x4a72d0,_0x141137,_0x134c9c){var _0x307a61=BPromise['promisify'](jwt[_0x9edd('0x7e')],{'context':jwt});var _0x321485=_0x134c9c||config[_0x9edd('0x7c')][_0x9edd('0xc')];return new BPromise(function(_0x467512,_0x4d8fbb){_0x307a61(_0x4a72d0,_0x321485,_0x141137)['then'](function(_0x2e1a96){_0x467512(_0x2e1a96);})[_0x9edd('0x48')](function(_0x5516c4){_0x4d8fbb(_0x5516c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0x9edd('0x7f'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0x9edd('0x80')]();}function createJwt(_0x32ff46){var _0x589348={'payload':{'iat':_0x32ff46[_0x9edd('0x6a')],'nonce':_0x32ff46[_0x9edd('0x52')]},'options':{'algorithm':_0x9edd('0x81'),'subject':_0x32ff46['id']['toString'](),'issuer':hardwareConf[_0x9edd('0x4d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x589348)[_0x9edd('0x3b')](function(_0x18d1a0){return{'iat':_0x32ff46['apiKeyIat'],'nonce':_0x32ff46[_0x9edd('0x52')],'token':_0x18d1a0};});}
\ No newline at end of file
+var _0xa9e0=['role','redirect','/dashboards/general','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','apiKeyNonce','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','ValidationError','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','decryptString','length','unshift','encryptString','promisify','payload','options','verify','randomBytes','toString','hex','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','name','userpic','permissions','md5secret','voicePause','chatPause','mailPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','settingsEnabled','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswerDelay','use','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','catch','isAuthenticated','headers','startsWith','authorization','Basic','User','find','authenticate','pass','status','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blockedAt','add','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isWebrtcLicence','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'];(function(_0x450780,_0x3c31ea){var _0x4c33dd=function(_0x368215){while(--_0x368215){_0x450780['push'](_0x450780['shift']());}};_0x4c33dd(++_0x3c31ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var db=require(_0x0a9e('0x0'))['db'];var config=require(_0x0a9e('0x1'));var hardwareConf=require(_0x0a9e('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0x0a9e('0x3'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x0a9e('0x4'));var compose=require(_0x0a9e('0x5'));var basicAuth=require(_0x0a9e('0x6'));var crypto=require(_0x0a9e('0x7'));var BPromise=require(_0x0a9e('0x8'));var util=require('util');var moment=require(_0x0a9e('0x9'));var validateJwt=expressJwt({'secret':config[_0x0a9e('0xa')][_0x0a9e('0xb')]});var userAttributes=['id','role','fullname',_0x0a9e('0xc'),'internal','email',_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),_0x0a9e('0x11'),_0x0a9e('0x12'),'faxPause','smsPause','openchannelPause','pauseType',_0x0a9e('0x13'),_0x0a9e('0x14'),_0x0a9e('0x15'),_0x0a9e('0x16'),_0x0a9e('0x17'),_0x0a9e('0x18'),'alias',_0x0a9e('0x19'),_0x0a9e('0x1a'),_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'phoneBarExpires',_0x0a9e('0x1f'),'phoneBarRemoteControl',_0x0a9e('0x20'),'hotdesk',_0x0a9e('0x21'),_0x0a9e('0x22'),'privacyEnabled',_0x0a9e('0x23'),'wssPort',_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28'),_0x0a9e('0x29'),_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x0a9e('0x2c'),_0x0a9e('0x2d'),_0x0a9e('0x2e'),_0x0a9e('0x2f'),'openchannelAutoanswerDelay',_0x0a9e('0x30'),_0x0a9e('0x31'),'whatsappAutoanswer',_0x0a9e('0x32')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x0a9e('0x33')](function(_0x432e56,_0x38e7c4,_0x30bae6){if(_0x432e56['user']){_0x30bae6();}else{return db[_0x0a9e('0x34')][_0x0a9e('0x35')]({'where':{'id':_0x432e56[_0x0a9e('0x36')]['id']},'attributes':['id',_0x0a9e('0x37'),_0x0a9e('0x38')],'raw':!![]})[_0x0a9e('0x39')](function(_0x16b1ca){if(_0x16b1ca&&_0x16b1ca['closed']){return _0x38e7c4['status'](_0x16b1ca[_0x0a9e('0x38')]===_0x0a9e('0x3a')?0x195:0x193)[_0x0a9e('0x3b')]({'message':_0x16b1ca[_0x0a9e('0x38')]==='unmanaged'?_0x0a9e('0x3c'):'Forbidden.'});}else{_0x30bae6();}})[_0x0a9e('0x3d')](function(_0x5bfb33){_0x30bae6(_0x5bfb33);});}});};exports[_0x0a9e('0x3e')]=function isAuthenticated(_0x34dc65){return compose()[_0x0a9e('0x33')](function(_0x14433c,_0x140511,_0x1538a4){var _0x11c3b6;if(_0x14433c[_0x0a9e('0x3f')]['authorization']){if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x42'))){var _0x5c877d=basicAuth(_0x14433c);db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'name':_0x5c877d[_0x0a9e('0xc')]}})[_0x0a9e('0x39')](function(_0x58b06f){if(!_0x58b06f||!_0x58b06f[_0x0a9e('0x45')](_0x5c877d[_0x0a9e('0x46')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Wrong\x20credentials.'});}_0x14433c[_0x0a9e('0x48')]={'id':_0x58b06f['id']};_0x1538a4();})['catch'](function(_0x2407f9){_0x1538a4(_0x2407f9);});}else if(_[_0x0a9e('0x40')](_0x14433c[_0x0a9e('0x3f')][_0x0a9e('0x41')],_0x0a9e('0x49'))){validateJwt(_0x14433c,_0x140511,_0x1538a4);}else{if(_0x34dc65){_0x1538a4();}else{return _0x140511['status'](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}}}else if(_0x14433c[_0x0a9e('0x4b')][_0x0a9e('0x4c')]){try{var _0x2b45ea={'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf[_0x0a9e('0x4d')]()};verifyJwt(_0x14433c[_0x0a9e('0x4b')]['apikey'],_0x2b45ea)[_0x0a9e('0x39')](function(_0x5e7238){return db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x5e7238[_0x0a9e('0x4e')]}})[_0x0a9e('0x39')](function(_0x567193){_0x11c3b6=_0x567193;return db[_0x0a9e('0x4f')][_0x0a9e('0x35')]({'where':{'id':0x1},'attributes':[_0x0a9e('0x50'),_0x0a9e('0x51')],'raw':!![]});})['then'](function(_0x54135e){if(!_0x11c3b6||!_[_0x0a9e('0x52')](_0x11c3b6['apiKeyNonce'],_0x5e7238[_0x0a9e('0x53')])){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x54')});}if(_0x11c3b6['disabled']){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}if(_0x11c3b6['blocked']){if(_0x54135e[_0x0a9e('0x51')]>0x0){if(moment(_0x11c3b6[_0x0a9e('0x56')])[_0x0a9e('0x57')](_0x54135e['blockDuration'],'minutes')>moment()){return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x140511[_0x0a9e('0x47')](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});}}_0x14433c[_0x0a9e('0x48')]={'id':_0x11c3b6['id']};_0x1538a4();});})['catch'](function(){return _0x140511['status'](0x191)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x55')});});}catch(_0x53f3ee){_0x1538a4(_0x53f3ee);}}else if(_0x34dc65){_0x1538a4();}else{return _0x140511[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x4a')});}})['use'](function(_0x316c8f,_0x2cfea9,_0x274e8e){if(_0x316c8f[_0x0a9e('0x48')]){db[_0x0a9e('0x43')][_0x0a9e('0x44')]({'where':{'id':_0x316c8f[_0x0a9e('0x48')]['id']},'attributes':userAttributes})[_0x0a9e('0x39')](function(_0x23b089){if(!_0x23b089){return _0x2cfea9[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x58')});}_0x316c8f[_0x0a9e('0x48')]=_0x23b089;_0x274e8e();})[_0x0a9e('0x3d')](function(_0x37f6cc){_0x274e8e(_0x37f6cc);});}else if(_0x34dc65){_0x274e8e();}else{return _0x2cfea9['status'](0x194)['json']({'message':_0x0a9e('0x59')});}});};exports[_0x0a9e('0x5a')]=function canUpdate(){return compose()[_0x0a9e('0x33')](function(_0x315881,_0x1a69dd,_0xc9a702){return licenseUtil[_0x0a9e('0x5b')]()[_0x0a9e('0x39')](function(_0x432fcc){if(_0x432fcc[_0x0a9e('0x5c')]){_0xc9a702();}else{return _0x1a69dd[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':'Forbidden'});}})[_0x0a9e('0x3d')](function(_0x138b8b){_0xc9a702(_0x138b8b);});});};exports[_0x0a9e('0x5d')]=function isWebrtcLicence(){return compose()[_0x0a9e('0x33')](function(_0x2e8caf,_0xbe9d19,_0x21eb86){return licenseUtil[_0x0a9e('0x5b')]()['then'](function(_0x2e9d90){if(_0x2e9d90['webrtc']){_0x21eb86();}else{return _0xbe9d19[_0x0a9e('0x47')](0x193)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x5e')});}})['catch'](function(_0x14bec2){_0x21eb86(_0x14bec2);});});};exports[_0x0a9e('0x5f')]=function(_0x4774f4,_0x34aa5a,_0x45c845){_0x4774f4[_0x0a9e('0x5f')]=!![];return _0x45c845();};exports[_0x0a9e('0x60')]=function signToken(_0x5bbcde){return signJwt(_0x5bbcde);};exports[_0x0a9e('0x61')]=function(_0x1bde3c,_0x1b5e80){if(!_0x1bde3c[_0x0a9e('0x48')]){return _0x1b5e80[_0x0a9e('0x47')](0x194)[_0x0a9e('0x3b')]({'message':_0x0a9e('0x62')});}var _0x19383e={'payload':{'id':_0x1bde3c[_0x0a9e('0x48')]['id'],'role':_0x1bde3c['user'][_0x0a9e('0x63')]},'options':{'expiresIn':0x15180}};return signJwt(_0x19383e)[_0x0a9e('0x39')](function(_0x4f7240){_0x1b5e80['cookie']('motion.token',_0x4f7240);_0x1b5e80[_0x0a9e('0x64')](_0x0a9e('0x65'));})[_0x0a9e('0x3d')](function(_0x11545a){return _0x1b5e80[_0x0a9e('0x47')](0x1f4)[_0x0a9e('0x66')](_0x11545a);});};exports[_0x0a9e('0x67')]=function(_0x375c18){if(_['isNil'](_0x375c18['apiKeyNonce'])||_['isNil'](_0x375c18[_0x0a9e('0x68')])){return null;}else{return createJwt(_0x375c18);}};exports[_0x0a9e('0x69')]=function(_0x14d602){_0x14d602['apiKeyNonce']=generateNonce();_0x14d602[_0x0a9e('0x68')]=generateIssuedAt();return createJwt(_0x14d602);};exports[_0x0a9e('0x6a')]=function(_0x53d113,_0x5a88da){var _0x2ef381=_0x53d113['query'][_0x0a9e('0x4c')];if(_0x2ef381){var _0x4c3845={'nonce':_0x5a88da[_0x0a9e('0x6b')],'iat':_0x5a88da[_0x0a9e('0x68')],'audience':hardwareConf[_0x0a9e('0x4d')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x2ef381,_0x4c3845)[_0x0a9e('0x39')](function(){return generateApiKey(_0x5a88da);});}else{throw{'message':_0x0a9e('0x6c')};}};exports['validatePasswordPattern']=function(_0x50f687){var _0x128aa6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x128aa6[_0x0a9e('0x6d')](_0x50f687))throw new db['Sequelize'][(_0x0a9e('0x6e'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports[_0x0a9e('0x6f')]=function(_0x523cd2,_0xe22ccc,_0x4a6deb){var _0x5da27d=encryptor['decryptString'](_0xe22ccc)[_0x0a9e('0x70')](',');for(var _0x47de4c=0x0;_0x47de4c<_0x4a6deb;_0x47de4c++){if(!_0x5da27d[_0x47de4c])break;if(_0x523cd2[_0x0a9e('0x71')]()===_0x5da27d[_0x47de4c][_0x0a9e('0x71')]()){var _0x3cfd00=util[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x4a6deb);if(_0x4a6deb===0x1){_0x3cfd00=_0x0a9e('0x74');}throw new db[(_0x0a9e('0x75'))][(_0x0a9e('0x6e'))](_0x3cfd00);}}return;};exports['updatePasswordsHistory']=function(_0x1c693e,_0x121cef){var _0x2642bb=_0x121cef?encryptor[_0x0a9e('0x76')](_0x121cef)[_0x0a9e('0x70')](','):[];if(_0x2642bb[_0x0a9e('0x77')]===0x5){_0x2642bb['splice'](-0x1,0x1);}_0x2642bb[_0x0a9e('0x78')](_0x1c693e);return encryptor[_0x0a9e('0x79')](_0x2642bb['join'](','));};function signJwt(_0x3649cc){var _0x5cc8fb=BPromise[_0x0a9e('0x7a')](jwt['sign'],{'context':jwt});var _0x4b3c1a=_0x3649cc['secret']||config[_0x0a9e('0xa')]['session'];return new BPromise(function(_0x2244d6,_0x1fc70e){_0x5cc8fb(_0x3649cc[_0x0a9e('0x7b')],_0x4b3c1a,_0x3649cc[_0x0a9e('0x7c')])[_0x0a9e('0x39')](function(_0x26d7db){_0x2244d6(_0x26d7db);})['catch'](function(_0x1627a7){_0x1fc70e(_0x1627a7);});});}function verifyJwt(_0x5854cc,_0xca4ade,_0x1f07cb){var _0x51aaf7=BPromise['promisify'](jwt[_0x0a9e('0x7d')],{'context':jwt});var _0x156f1c=_0x1f07cb||config[_0x0a9e('0xa')][_0x0a9e('0xb')];return new BPromise(function(_0x497d91,_0x1d0dc8){_0x51aaf7(_0x5854cc,_0x156f1c,_0xca4ade)[_0x0a9e('0x39')](function(_0x54327c){_0x497d91(_0x54327c);})[_0x0a9e('0x3d')](function(_0x17e88c){_0x1d0dc8(_0x17e88c);});});}function generateNonce(){return crypto[_0x0a9e('0x7e')](0x10)[_0x0a9e('0x7f')](_0x0a9e('0x80'));}function generateIssuedAt(){return Math['floor'](Date[_0x0a9e('0x81')]()/0x3e8)[_0x0a9e('0x7f')]();}function createJwt(_0x281c7d){var _0x47bb43={'payload':{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x281c7d['id'][_0x0a9e('0x7f')](),'issuer':hardwareConf[_0x0a9e('0x4d')](),'audience':hardwareConf[_0x0a9e('0x4d')]()}};return signJwt(_0x47bb43)[_0x0a9e('0x39')](function(_0x186f39){return{'iat':_0x281c7d[_0x0a9e('0x68')],'nonce':_0x281c7d[_0x0a9e('0x6b')],'token':_0x186f39};});}
\ No newline at end of file
index 07e5957..1a6d886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x2f5033,_0x3b434d){var _0x2186bf=function(_0x54169b){while(--_0x54169b){_0x2f5033['push'](_0x2f5033['shift']());}};_0x2186bf(++_0x3b434d);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});};
\ No newline at end of file
+var _0x5f66=['buildContactsQuery','getFilteredContacts','catch','CmContact','keys','filter','cf_','CmCustomField','slice','all','length','./sql-utils','findAll','resolve','then','search','parseAdvancedSearchFilter','where','default','fields','clause','user','skip','checkListsRestrictions','ids','tag','count'];(function(_0x3a8e23,_0x31e9f4){var _0x458a60=function(_0x48b8c4){while(--_0x48b8c4){_0x3a8e23['push'](_0x3a8e23['shift']());}};_0x458a60(++_0x31e9f4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var sqlUtils=require(_0x65f6('0x0'));var db=require('../../mysqldb')['db'];exports[_0x65f6('0x1')]=function(_0x2f06ae,_0x3461cd,_0xbce843,_0x1a330c){var _0x5eb9ad={'count':0x0,'rows':[]};var _0x3c5029=sqlUtils['skipContactsQuery'](_0x3461cd,_0x2f06ae);if(_0x3c5029){return Promise[_0x65f6('0x2')](_0x5eb9ad);}var _0x22b017=sqlUtils['getContactsSubquery']();var _0x4ed98f={};var _0x1c0e12=![];var _0x2c6571=![];return Promise[_0x65f6('0x2')]()[_0x65f6('0x3')](function(){if(_0x2f06ae[_0x65f6('0x4')]){return sqlUtils[_0x65f6('0x5')](_0x2f06ae['search'],_0x1a330c);}else{return sqlUtils['parseQueryParameters'](_0x2f06ae,_0x1a330c);}})[_0x65f6('0x3')](function(_0x2f6d5b){_0x22b017[_0x65f6('0x6')](_0x2f6d5b[_0x65f6('0x7')]);_0x22b017['where'](_0x2f6d5b[_0x65f6('0x8')]);_0x22b017['where'](_0x2f6d5b['filter']);_0x22b017[_0x65f6('0x6')](_0x2f6d5b['user'][_0x65f6('0x9')]);_0x4ed98f=_0x2f6d5b['tags'];_0x2c6571=_0x2f6d5b[_0x65f6('0xa')][_0x65f6('0xb')];return sqlUtils[_0x65f6('0xc')](_0x3461cd,_0x2f06ae,_0x2c6571);})[_0x65f6('0x3')](function(_0x369f96){_0x22b017[_0x65f6('0x6')](_0x369f96);var _0x44144b=_0x2f06ae[_0x65f6('0x4')]?_0x4ed98f[_0x65f6('0xd')]:_0x2f06ae[_0x65f6('0xe')];_0x1c0e12=_0x44144b?!![]:![];return sqlUtils['countFilteredContacts'](_0x22b017,_0x44144b);})[_0x65f6('0x3')](function(_0x49a913){_0x5eb9ad['count']=_0x49a913;if(_0x5eb9ad[_0x65f6('0xf')]===0x0){return;}return sqlUtils[_0x65f6('0x10')](_0x22b017,_0x2f06ae[_0x65f6('0x8')],_0xbce843,_0x1c0e12,_0x4ed98f[_0x65f6('0x9')],_0x2c6571);})[_0x65f6('0x3')](function(_0x1f974c){if(!_0x1f974c){return[];}return sqlUtils[_0x65f6('0x11')](_0x1f974c,_0x2f06ae,_0xbce843);})[_0x65f6('0x3')](function(_0x495dd6){_0x5eb9ad['rows']=_0x495dd6;return _0x5eb9ad;})[_0x65f6('0x12')](function(_0x5b4055){throw _0x5b4055;});};exports['describe']=function(){var _0x5c5b91={};var _0x365159=[];return db[_0x65f6('0x13')]['describe']()[_0x65f6('0x3')](function(_0x270893){_0x5c5b91=_0x270893;var _0xbee6a4=Object[_0x65f6('0x14')](_0x5c5b91)[_0x65f6('0x15')](function(_0xc139c2){return _['startsWith'](_0xc139c2,_0x65f6('0x16'))?_0xc139c2:undefined;});var _0x4bb39e=_0xbee6a4['map'](function(_0x212247){return db[_0x65f6('0x17')]['findOne']({'where':{'id':_0x212247[_0x65f6('0x18')](0x3)},'raw':!![]});});return Promise[_0x65f6('0x19')](_0x4bb39e);})[_0x65f6('0x3')](function(_0x2774a1){for(var _0x4f5a69=0x0;_0x4f5a69<_0x2774a1[_0x65f6('0x1a')];_0x4f5a69++){if(_0x2774a1[_0x4f5a69]){var _0x59ea32=_0x65f6('0x16')+_0x2774a1[_0x4f5a69]['id'];_0x5c5b91[_0x59ea32]['fieldType']=_0x2774a1[_0x4f5a69]['type'];}}_0x365159=_['map'](Object[_0x65f6('0x14')](_0x5c5b91),function(_0x16cde8){return{'name':_0x16cde8,'type':_0x5c5b91[_0x16cde8]['type']};});return _0x365159;})[_0x65f6('0x12')](function(_0x28f710){throw _0x28f710;});};
\ No newline at end of file
index e699b7b..ddd9907 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3451=['CompanyId','createdAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','sqlOperator','conditions','length','find','fieldType','datetime','castTo','DATE','buildExpression','type','default','text','value','start','end','Tag','map','tags','and','User','user','uc.UserId\x20=\x20?','skip','some','name','compact','Contact','concat','\x20=\x20?','resolve','then','fields','tag','clause','filter','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','limit','offset','order','DESC','subqry.','findAll','keyBy','Sequelize','QueryTypes','CmContact','query','toString','Tags','push','clone','COUNT(*)','c.id','isEmpty','where','SELECT','sequelize','exports','lodash','squel','../parsers/qs','../interaction/utils','../../mysqldb','role','agent','search','ListId','autocomplete','true','from','cm_contacts','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20','.id','tools_tags','subqry','firstName','lastName','phone','mobile','fax','email'];(function(_0x42f83c,_0xa75a3b){var _0x40a37a=function(_0x5f52b3){while(--_0x5f52b3){_0x42f83c['push'](_0x42f83c['shift']());}};_0x40a37a(++_0xa75a3b);}(_0x3451,0x19a));var _0x1345=function(_0x15da16,_0x587a7d){_0x15da16=_0x15da16-0x0;var _0x57c90a=_0x3451[_0x15da16];return _0x57c90a;};'use strict';var _=require(_0x1345('0x0'));var squel=require(_0x1345('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x1345('0x2'));var utils=require(_0x1345('0x3'));var db=require(_0x1345('0x4'))['db'];function skipContactsQuery(_0x379f69,_0x24d48e){var _0xb90830=![];if(_0x379f69[_0x1345('0x5')]===_0x1345('0x6')&&!_0x24d48e[_0x1345('0x7')]&&!_0x24d48e[_0x1345('0x8')]&&_0x24d48e[_0x1345('0x9')]!==_0x1345('0xa')){_0xb90830=!![];}return _0xb90830;}function getContactsSubquery(){return squel['select']()[_0x1345('0xb')](_0x1345('0xc'),'c')['where'](_0x1345('0xd'));}function applyJoinClauses(_0x5b9ed7,_0x4b9de8){var _0x3e04bc=_0x4b9de8?'c':'subqry';_0x5b9ed7[_0x1345('0xe')](_0x1345('0xf'),'uc','uc.CmContactId\x20=\x20'+_0x3e04bc+'.id')[_0x1345('0xe')]('cm_contact_has_tags','ct',_0x1345('0x10')+_0x3e04bc+_0x1345('0x11'))[_0x1345('0xe')](_0x1345('0x12'),'t','t.id\x20=\x20ct.TagId');return _0x5b9ed7;}function addFieldsToQuery(_0x3fdff0,_0x2cf05d,_0x19c7e9,_0x45c525,_0x4ea08a){var _0x181a2b=_0x4ea08a?'c':_0x1345('0x13');if(!_0x2cf05d){_0x2cf05d=['id',_0x1345('0x14'),_0x1345('0x15'),_0x1345('0x16'),_0x1345('0x17'),_0x1345('0x18'),_0x1345('0x19'),_0x1345('0x8'),_0x1345('0x1a'),_0x1345('0x1b'),'updatedAt','deletedAt',_0x1345('0x1c')];}var _0x1afc89=_0x19c7e9&&_0x4ea08a||!_0x19c7e9&&!_0x4ea08a;if(_0x45c525){_0x1afc89=_0x45c525&&_0x4ea08a||!_0x45c525&&!_0x4ea08a;}_0x2cf05d[_0x1345('0x1d')](function(_0x1db636){if(_0x1db636==='TagIds'){if(_0x1afc89){_0x3fdff0[_0x1345('0x1e')](_0x1345('0x1f'),_0x1db636);}else if(_0x19c7e9||_0x45c525){_0x3fdff0[_0x1345('0x1e')](_0x181a2b+'.'+_0x1db636);}}else{_0x3fdff0[_0x1345('0x1e')](_0x181a2b+'.'+_0x1db636);}});return _0x3fdff0;}function getSqlClauses(){var _0x36b291={'default':squel[_0x1345('0x20')](),'fields':squel[_0x1345('0x20')](),'filter':squel[_0x1345('0x20')](),'tags':{'clause':squel[_0x1345('0x20')](),'ids':null},'user':{'clause':squel[_0x1345('0x20')](),'skip':![]}};return _0x36b291;}function parseTagParameter(_0x265ea8){var _0x4f2314=squel[_0x1345('0x20')]();if(_0x265ea8){var _0x4855d7=utils[_0x1345('0x21')](_0x265ea8);_0x4855d7[_0x1345('0x1d')](function(_0x2ddf5c){_0x4f2314['or'](_0x1345('0x22'),'%,'+_0x2ddf5c+',%');});}return _0x4f2314;}function parseSearchFilter(_0x422dd9){var _0x2fd7ca=squel[_0x1345('0x20')]();if(_0x422dd9){var _0x339ea9=_0x422dd9[_0x1345('0x23')]('\x5c','\x5c\x5c')[_0x1345('0x23')](/'/g,'\x27\x27');if(_0x339ea9[_0x1345('0x24')]('\x20')['length']>0x1){_0x2fd7ca['or'](_0x1345('0x25'),qs['getFullTextValue'](_0x339ea9),null);}else{if(qs[_0x1345('0x26')](_0x339ea9)){_0x2fd7ca['or'](_0x1345('0x27'),_0x339ea9+'%');_0x2fd7ca['or'](_0x1345('0x28'),_0x339ea9+'%');_0x2fd7ca['or'](_0x1345('0x29'),_0x339ea9+'%');_0x2fd7ca['or'](_0x1345('0x2a'),_0x339ea9+'%');}else if(qs[_0x1345('0x2b')](_0x339ea9)){_0x2fd7ca['or'](_0x1345('0x2c'),_0x339ea9+'%');}else{_0x2fd7ca['or'](_0x1345('0x2d'),'%'+_0x339ea9+'%');_0x2fd7ca['or'](_0x1345('0x2e'),'%'+_0x339ea9+'%');_0x2fd7ca['or'](_0x1345('0x2c'),'%'+_0x339ea9+'%');}}}return _0x2fd7ca;}function parseAdvancedSearchFilter(_0x3d06b5,_0x2817f0){var _0x483e75=getSqlClauses();var _0x3ffbdc=as['parseSearch'](_0x3d06b5);var _0x5ac56d=_0x3ffbdc[_0x1345('0x2f')];for(var _0x2e2b94=0x0;_0x2e2b94<_0x3ffbdc[_0x1345('0x30')][_0x1345('0x31')];_0x2e2b94++){var _0x44bbba=_0x3ffbdc['conditions'][_0x2e2b94];var _0x389e94='c';var _0x2b2be4=_[_0x1345('0x32')](_0x2817f0,['name',_0x44bbba[_0x1345('0x1e')]]);if(_0x2b2be4){if(_0x44bbba['field']==='dateOfBirth'||_0x2b2be4[_0x1345('0x33')]===_0x1345('0x34')){_0x44bbba[_0x1345('0x35')]=_0x1345('0x36');}var _0x526ed1=as[_0x1345('0x37')](_0x389e94,_0x2b2be4[_0x1345('0x38')],_0x44bbba);_0x483e75[_0x1345('0x39')][_0x5ac56d](_0x526ed1[_0x1345('0x3a')],_0x526ed1[_0x1345('0x3b')][_0x1345('0x3c')],_0x526ed1[_0x1345('0x3b')][_0x1345('0x3d')]);}else{if(_0x44bbba[_0x1345('0x1e')]===_0x1345('0x3e')){var _0x57ecf9=_0x44bbba['value'][_0x1345('0x24')](',')[_0x1345('0x3f')](function(_0x2d382e){return Number(_0x2d382e);});var _0x2ee5fe=parseTagParameter(_0x57ecf9);_0x483e75[_0x1345('0x40')]['clause'][_0x1345('0x41')](_0x2ee5fe);_0x483e75['tags']['ids']=_0x57ecf9;}else if(_0x44bbba[_0x1345('0x1e')]===_0x1345('0x42')){_0x483e75[_0x1345('0x43')]['clause'][_0x1345('0x41')](_0x1345('0x44'),_0x44bbba[_0x1345('0x3b')]);_0x483e75[_0x1345('0x43')][_0x1345('0x45')]=!![];}}}return _0x483e75;}function parseModelFields(_0x358e97,_0x7ca9c8){var _0x58d30f=squel['expr']();var _0x546805=_(_0x358e97)['keys']()['map'](function(_0x30baac){return _[_0x1345('0x46')](_0x7ca9c8,[_0x1345('0x47'),_0x30baac])?_0x30baac:undefined;})[_0x1345('0x48')]()[_0x1345('0x3b')]();if(_0x358e97['Contact']){_0x546805['push'](_0x1345('0x49'));}if(_0x546805[_0x1345('0x31')]>0x0){_0x546805[_0x1345('0x1d')](function(_0x3b1578){if(_0x3b1578===_0x1345('0x8')){_0x58d30f[_0x1345('0x41')]('c.ListId\x20IN\x20?',[][_0x1345('0x4a')](_0x358e97[_0x3b1578]));}else if(_0x3b1578===_0x1345('0x49')){var _0x293774='%'+_0x358e97[_0x3b1578]+'%';_0x58d30f[_0x1345('0x41')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x293774);}else{_0x58d30f[_0x1345('0x41')]('c.'+_0x3b1578+_0x1345('0x4b'),_0x358e97[_0x3b1578]);}});}return _0x58d30f;}function parseQueryParameters(_0xdcc00c,_0x53a4ab){var _0x10f67b=getSqlClauses();return Promise[_0x1345('0x4c')]()[_0x1345('0x4d')](function(){return parseModelFields(_0xdcc00c,_0x53a4ab);})['then'](function(_0x353040){_0x10f67b[_0x1345('0x4e')][_0x1345('0x41')](_0x353040);return parseTagParameter(_0xdcc00c[_0x1345('0x4f')]);})[_0x1345('0x4d')](function(_0x4f1d80){_0x10f67b[_0x1345('0x40')][_0x1345('0x50')][_0x1345('0x41')](_0x4f1d80);return parseSearchFilter(_0xdcc00c[_0x1345('0x51')]);})['then'](function(_0x183132){_0x10f67b[_0x1345('0x51')]=_0x183132;return _0x10f67b;});}function checkListsRestrictions(_0x321336,_0x230266,_0x337f0d){var _0x1c7694=squel[_0x1345('0x20')]();return Promise[_0x1345('0x4c')]()[_0x1345('0x4d')](function(){if(_0x230266[_0x1345('0x7')]&&_0x321336[_0x1345('0x5')]===_0x1345('0x6')&&!_0x337f0d){return _0x321336[_0x1345('0x52')]({'attributes':['id'],'raw':!![]});}})[_0x1345('0x4d')](function(_0x413c9e){if(_0x413c9e){if(_0x413c9e[_0x1345('0x31')]===0x0){_0x1c7694['and'](_0x1345('0x53'));}else{_0x1c7694[_0x1345('0x41')](_0x1345('0x54'),_[_0x1345('0x3f')](_0x413c9e,'id'));}}})[_0x1345('0x4d')](function(){return _0x1c7694;});}function buildContactsQuery(_0xbabb30,_0x3f3dd3,_0x179c04,_0x1ba019,_0xb2bd0f,_0xd664e5){if(_0x3f3dd3){_0x3f3dd3=_0x179c04[_0x1345('0x55')];}_0xbabb30=addFieldsToQuery(_0xbabb30,_0x3f3dd3,_0x1ba019,_0xd664e5,!![]);var _0x1753bc=squel['select']();_0x1753bc=addFieldsToQuery(_0x1753bc,_0x3f3dd3,_0x1ba019,_0xd664e5,![]);if(_0x1ba019||_0xd664e5){_0xbabb30=applyJoinClauses(_0xbabb30,!![]);_0xbabb30[_0x1345('0x56')]('c.id');if(_0x179c04[_0x1345('0x57')]){_0x1753bc[_0x1345('0x57')](_0x179c04['limit']);}if(_0x179c04[_0x1345('0x58')]){_0x1753bc[_0x1345('0x58')](_0x179c04[_0x1345('0x58')]);}}else{_0x1753bc=applyJoinClauses(_0x1753bc,![]);_0x1753bc['group']('subqry.id');if(_0x179c04['limit']){_0xbabb30[_0x1345('0x57')](_0x179c04[_0x1345('0x57')]);}if(_0x179c04['offset']){_0xbabb30[_0x1345('0x58')](_0x179c04[_0x1345('0x58')]);}}_0x1753bc['having'](_0xb2bd0f);if(_0x179c04[_0x1345('0x59')]){_0x179c04['order'][_0x1345('0x1d')](function(_0x5aab90){_0xbabb30[_0x1345('0x59')]('c.'+_0x5aab90[0x0],_0x5aab90[0x1]===_0x1345('0x5a')?![]:!![]);_0x1753bc['order'](_0x1345('0x5b')+_0x5aab90[0x0],_0x5aab90[0x1]===_0x1345('0x5a')?![]:!![]);});}_0x1753bc['from'](_0xbabb30,'subqry');return _0x1753bc;}function getFilteredContacts(_0x30428e){var _0x4cf3d0=[];return db[_0x1345('0x3e')][_0x1345('0x5c')]({'attributes':['id',_0x1345('0x47'),'color'],'raw':!![]})['then'](function(_0x5b3c3b){_0x4cf3d0=_[_0x1345('0x5d')](_0x5b3c3b,'id');var _0x2e01bc={'type':db[_0x1345('0x5e')][_0x1345('0x5f')]['SELECT'],'model':db[_0x1345('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x1345('0x61')](_0x30428e[_0x1345('0x62')](),_0x2e01bc);})[_0x1345('0x4d')](function(_0x79f14){_0x79f14[_0x1345('0x1d')](function(_0x17857f){if(_0x17857f[_0x1345('0x1c')]){_0x17857f[_0x1345('0x63')]=[];_0x17857f[_0x1345('0x1c')][_0x1345('0x24')](',')['forEach'](function(_0x37201e){_0x17857f[_0x1345('0x63')][_0x1345('0x64')](_0x4cf3d0[_0x37201e]);});}delete _0x17857f[_0x1345('0x1c')];});return _0x79f14;});}function countFilteredContacts(_0x29729b,_0x16616a){var _0x1058be=_0x29729b[_0x1345('0x65')]();_0x1058be[_0x1345('0x1e')](_0x1345('0x66'));_0x1058be=applyJoinClauses(_0x1058be,!![]);_0x29729b[_0x1345('0x56')](_0x1345('0x67'));var _0xe895c3=utils[_0x1345('0x21')](_0x16616a);if(!_[_0x1345('0x68')](_0xe895c3)){_0x1058be[_0x1345('0x69')]('t.id\x20IN\x20?',_0xe895c3);}var _0x4224f7={'type':db[_0x1345('0x5e')]['QueryTypes'][_0x1345('0x6a')],'raw':!![]};return db[_0x1345('0x6b')][_0x1345('0x61')](_0x1058be['toString'](),_0x4224f7)[_0x1345('0x4d')](function(_0x4316c6){return _0x4316c6[0x0][_0x1345('0x66')];});}module[_0x1345('0x6c')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
+var _0x74b1=['field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','type','default','text','value','end','Tag','clause','and','tags','ids','user','uc.UserId\x20=\x20?','skip','keys','map','some','Contact','\x20=\x20?','resolve','then','fields','tag','filter','role','agent','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','attributes','group','c.id','limit','subqry.id','offset','having','order','DESC','subqry.','findAll','color','keyBy','QueryTypes','sequelize','query','toString','Tags','clone','isEmpty','where','t.id\x20IN\x20?','Sequelize','SELECT','exports','lodash','squel','../parsers/qs','../interaction/utils','search','ListId','autocomplete','select','from','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','t.id\x20=\x20ct.TagId','subqry','firstName','phone','mobile','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds'];(function(_0x4f2aeb,_0x53fd2f){var _0x14e478=function(_0x51d939){while(--_0x51d939){_0x4f2aeb['push'](_0x4f2aeb['shift']());}};_0x14e478(++_0x53fd2f);}(_0x74b1,0xb5));var _0x174b=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x74b1[_0x301c34];return _0x1a8c5a;};'use strict';var _=require(_0x174b('0x0'));var squel=require(_0x174b('0x1'));var as=require('../parsers/advancedSearch');var qs=require(_0x174b('0x2'));var utils=require(_0x174b('0x3'));var db=require('../../mysqldb')['db'];function skipContactsQuery(_0x1371f4,_0x43a4e2){var _0x4ee1cc=![];if(_0x1371f4['role']==='agent'&&!_0x43a4e2[_0x174b('0x4')]&&!_0x43a4e2[_0x174b('0x5')]&&_0x43a4e2[_0x174b('0x6')]!=='true'){_0x4ee1cc=!![];}return _0x4ee1cc;}function getContactsSubquery(){return squel[_0x174b('0x7')]()[_0x174b('0x8')]('cm_contacts','c')['where'](_0x174b('0x9'));}function applyJoinClauses(_0x497971,_0x907686){var _0x58582a=_0x907686?'c':'subqry';_0x497971[_0x174b('0xa')](_0x174b('0xb'),'uc',_0x174b('0xc')+_0x58582a+_0x174b('0xd'))[_0x174b('0xa')](_0x174b('0xe'),'ct',_0x174b('0xf')+_0x58582a+_0x174b('0xd'))[_0x174b('0xa')]('tools_tags','t',_0x174b('0x10'));return _0x497971;}function addFieldsToQuery(_0xc996e,_0x213ba1,_0x2ffb6f,_0x1fe1f8,_0x44b778){var _0xe9c224=_0x44b778?'c':_0x174b('0x11');if(!_0x213ba1){_0x213ba1=['id',_0x174b('0x12'),'lastName',_0x174b('0x13'),_0x174b('0x14'),_0x174b('0x15'),'email','ListId',_0x174b('0x16'),_0x174b('0x17'),_0x174b('0x18'),_0x174b('0x19'),_0x174b('0x1a')];}var _0x31f801=_0x2ffb6f&&_0x44b778||!_0x2ffb6f&&!_0x44b778;if(_0x1fe1f8){_0x31f801=_0x1fe1f8&&_0x44b778||!_0x1fe1f8&&!_0x44b778;}_0x213ba1['forEach'](function(_0x1049dc){if(_0x1049dc===_0x174b('0x1a')){if(_0x31f801){_0xc996e[_0x174b('0x1b')](_0x174b('0x1c'),_0x1049dc);}else if(_0x2ffb6f||_0x1fe1f8){_0xc996e[_0x174b('0x1b')](_0xe9c224+'.'+_0x1049dc);}}else{_0xc996e[_0x174b('0x1b')](_0xe9c224+'.'+_0x1049dc);}});return _0xc996e;}function getSqlClauses(){var _0x443972={'default':squel[_0x174b('0x1d')](),'fields':squel[_0x174b('0x1d')](),'filter':squel[_0x174b('0x1d')](),'tags':{'clause':squel['expr'](),'ids':null},'user':{'clause':squel[_0x174b('0x1d')](),'skip':![]}};return _0x443972;}function parseTagParameter(_0x49d32e){var _0x584b74=squel[_0x174b('0x1d')]();if(_0x49d32e){var _0x568b3f=utils['getSelectedTags'](_0x49d32e);_0x568b3f[_0x174b('0x1e')](function(_0x70200f){_0x584b74['or'](_0x174b('0x1f'),'%,'+_0x70200f+',%');});}return _0x584b74;}function parseSearchFilter(_0x55f2ac){var _0x150304=squel['expr']();if(_0x55f2ac){var _0x3b57c5=_0x55f2ac[_0x174b('0x20')]('\x5c','\x5c\x5c')[_0x174b('0x20')](/'/g,'\x27\x27');if(_0x3b57c5[_0x174b('0x21')]('\x20')[_0x174b('0x22')]>0x1){_0x150304['or'](_0x174b('0x23'),qs['getFullTextValue'](_0x3b57c5),null);}else{if(qs['isNumeric'](_0x3b57c5)){_0x150304['or'](_0x174b('0x24'),_0x3b57c5+'%');_0x150304['or'](_0x174b('0x25'),_0x3b57c5+'%');_0x150304['or'](_0x174b('0x26'),_0x3b57c5+'%');_0x150304['or'](_0x174b('0x27'),_0x3b57c5+'%');}else if(qs['isEmail'](_0x3b57c5)){_0x150304['or'](_0x174b('0x28'),_0x3b57c5+'%');}else{_0x150304['or'](_0x174b('0x29'),'%'+_0x3b57c5+'%');_0x150304['or']('c.lastName\x20LIKE\x20?','%'+_0x3b57c5+'%');_0x150304['or'](_0x174b('0x28'),'%'+_0x3b57c5+'%');}}}return _0x150304;}function parseAdvancedSearchFilter(_0x2eb1cb,_0x17a237){var _0x50f947=getSqlClauses();var _0x28ffef=as[_0x174b('0x2a')](_0x2eb1cb);var _0x557d62=_0x28ffef[_0x174b('0x2b')];for(var _0x555dc1=0x0;_0x555dc1<_0x28ffef[_0x174b('0x2c')][_0x174b('0x22')];_0x555dc1++){var _0x220206=_0x28ffef[_0x174b('0x2c')][_0x555dc1];var _0x2a7ec2='c';var _0x580731=_[_0x174b('0x2d')](_0x17a237,[_0x174b('0x2e'),_0x220206[_0x174b('0x1b')]]);if(_0x580731){if(_0x220206['field']===_0x174b('0x2f')||_0x580731[_0x174b('0x30')]===_0x174b('0x31')){_0x220206['castTo']=_0x174b('0x32');}var _0x4ba6e1=as['buildExpression'](_0x2a7ec2,_0x580731[_0x174b('0x33')],_0x220206);_0x50f947[_0x174b('0x34')][_0x557d62](_0x4ba6e1[_0x174b('0x35')],_0x4ba6e1[_0x174b('0x36')]['start'],_0x4ba6e1[_0x174b('0x36')][_0x174b('0x37')]);}else{if(_0x220206[_0x174b('0x1b')]===_0x174b('0x38')){var _0x2ebac0=_0x220206[_0x174b('0x36')][_0x174b('0x21')](',')['map'](function(_0xc7a60b){return Number(_0xc7a60b);});var _0x5ebc95=parseTagParameter(_0x2ebac0);_0x50f947['tags'][_0x174b('0x39')][_0x174b('0x3a')](_0x5ebc95);_0x50f947[_0x174b('0x3b')][_0x174b('0x3c')]=_0x2ebac0;}else if(_0x220206[_0x174b('0x1b')]==='User'){_0x50f947[_0x174b('0x3d')][_0x174b('0x39')][_0x174b('0x3a')](_0x174b('0x3e'),_0x220206[_0x174b('0x36')]);_0x50f947[_0x174b('0x3d')][_0x174b('0x3f')]=!![];}}}return _0x50f947;}function parseModelFields(_0x448ab0,_0x40898f){var _0x5c4880=squel['expr']();var _0x296765=_(_0x448ab0)[_0x174b('0x40')]()[_0x174b('0x41')](function(_0x4178e5){return _[_0x174b('0x42')](_0x40898f,['name',_0x4178e5])?_0x4178e5:undefined;})['compact']()[_0x174b('0x36')]();if(_0x448ab0[_0x174b('0x43')]){_0x296765['push'](_0x174b('0x43'));}if(_0x296765[_0x174b('0x22')]>0x0){_0x296765[_0x174b('0x1e')](function(_0x3a5aaf){if(_0x3a5aaf===_0x174b('0x5')){_0x5c4880[_0x174b('0x3a')]('c.ListId\x20IN\x20?',[]['concat'](_0x448ab0[_0x3a5aaf]));}else if(_0x3a5aaf===_0x174b('0x43')){var _0x657f74='%'+_0x448ab0[_0x3a5aaf]+'%';_0x5c4880[_0x174b('0x3a')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x657f74);}else{_0x5c4880[_0x174b('0x3a')]('c.'+_0x3a5aaf+_0x174b('0x44'),_0x448ab0[_0x3a5aaf]);}});}return _0x5c4880;}function parseQueryParameters(_0xd4b9c7,_0x3b0cb6){var _0x1d1d2b=getSqlClauses();return Promise[_0x174b('0x45')]()[_0x174b('0x46')](function(){return parseModelFields(_0xd4b9c7,_0x3b0cb6);})[_0x174b('0x46')](function(_0x5b2da2){_0x1d1d2b[_0x174b('0x47')]['and'](_0x5b2da2);return parseTagParameter(_0xd4b9c7[_0x174b('0x48')]);})[_0x174b('0x46')](function(_0x59dd67){_0x1d1d2b[_0x174b('0x3b')]['clause'][_0x174b('0x3a')](_0x59dd67);return parseSearchFilter(_0xd4b9c7[_0x174b('0x49')]);})[_0x174b('0x46')](function(_0x4c9cb4){_0x1d1d2b[_0x174b('0x49')]=_0x4c9cb4;return _0x1d1d2b;});}function checkListsRestrictions(_0xa92df,_0x595d5e,_0x56c8f7){var _0x1aadaa=squel[_0x174b('0x1d')]();return Promise['resolve']()['then'](function(){if(_0x595d5e[_0x174b('0x4')]&&_0xa92df[_0x174b('0x4a')]===_0x174b('0x4b')&&!_0x56c8f7){return _0xa92df[_0x174b('0x4c')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x2c8221){if(_0x2c8221){if(_0x2c8221['length']===0x0){_0x1aadaa['and'](_0x174b('0x4d'));}else{_0x1aadaa[_0x174b('0x3a')](_0x174b('0x4e'),_['map'](_0x2c8221,'id'));}}})[_0x174b('0x46')](function(){return _0x1aadaa;});}function buildContactsQuery(_0x483b93,_0x5e249b,_0x1c901b,_0x431bd3,_0x580beb,_0x3cbb51){if(_0x5e249b){_0x5e249b=_0x1c901b[_0x174b('0x4f')];}_0x483b93=addFieldsToQuery(_0x483b93,_0x5e249b,_0x431bd3,_0x3cbb51,!![]);var _0x3cd6f4=squel[_0x174b('0x7')]();_0x3cd6f4=addFieldsToQuery(_0x3cd6f4,_0x5e249b,_0x431bd3,_0x3cbb51,![]);if(_0x431bd3||_0x3cbb51){_0x483b93=applyJoinClauses(_0x483b93,!![]);_0x483b93[_0x174b('0x50')](_0x174b('0x51'));if(_0x1c901b[_0x174b('0x52')]){_0x3cd6f4[_0x174b('0x52')](_0x1c901b[_0x174b('0x52')]);}if(_0x1c901b['offset']){_0x3cd6f4['offset'](_0x1c901b['offset']);}}else{_0x3cd6f4=applyJoinClauses(_0x3cd6f4,![]);_0x3cd6f4[_0x174b('0x50')](_0x174b('0x53'));if(_0x1c901b[_0x174b('0x52')]){_0x483b93[_0x174b('0x52')](_0x1c901b[_0x174b('0x52')]);}if(_0x1c901b[_0x174b('0x54')]){_0x483b93['offset'](_0x1c901b['offset']);}}_0x3cd6f4[_0x174b('0x55')](_0x580beb);if(_0x1c901b[_0x174b('0x56')]){_0x1c901b[_0x174b('0x56')][_0x174b('0x1e')](function(_0xd27c7d){_0x483b93[_0x174b('0x56')]('c.'+_0xd27c7d[0x0],_0xd27c7d[0x1]===_0x174b('0x57')?![]:!![]);_0x3cd6f4[_0x174b('0x56')](_0x174b('0x58')+_0xd27c7d[0x0],_0xd27c7d[0x1]==='DESC'?![]:!![]);});}_0x3cd6f4[_0x174b('0x8')](_0x483b93,_0x174b('0x11'));return _0x3cd6f4;}function getFilteredContacts(_0x6e217a){var _0x3598ea=[];return db[_0x174b('0x38')][_0x174b('0x59')]({'attributes':['id',_0x174b('0x2e'),_0x174b('0x5a')],'raw':!![]})[_0x174b('0x46')](function(_0x5d1dd0){_0x3598ea=_[_0x174b('0x5b')](_0x5d1dd0,'id');var _0x567b81={'type':db['Sequelize'][_0x174b('0x5c')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x174b('0x5d')][_0x174b('0x5e')](_0x6e217a[_0x174b('0x5f')](),_0x567b81);})[_0x174b('0x46')](function(_0x2f0bfc){_0x2f0bfc[_0x174b('0x1e')](function(_0x4b7233){if(_0x4b7233[_0x174b('0x1a')]){_0x4b7233[_0x174b('0x60')]=[];_0x4b7233['TagIds'][_0x174b('0x21')](',')[_0x174b('0x1e')](function(_0x201869){_0x4b7233['Tags']['push'](_0x3598ea[_0x201869]);});}delete _0x4b7233[_0x174b('0x1a')];});return _0x2f0bfc;});}function countFilteredContacts(_0x5ae285,_0x519c14){var _0x2342fa=_0x5ae285[_0x174b('0x61')]();_0x2342fa['field']('COUNT(*)');_0x2342fa=applyJoinClauses(_0x2342fa,!![]);_0x5ae285[_0x174b('0x50')](_0x174b('0x51'));var _0x45a6d6=utils['getSelectedTags'](_0x519c14);if(!_[_0x174b('0x62')](_0x45a6d6)){_0x2342fa[_0x174b('0x63')](_0x174b('0x64'),_0x45a6d6);}var _0x56432a={'type':db[_0x174b('0x65')][_0x174b('0x5c')][_0x174b('0x66')],'raw':!![]};return db[_0x174b('0x5d')][_0x174b('0x5e')](_0x2342fa[_0x174b('0x5f')](),_0x56432a)[_0x174b('0x46')](function(_0x64844e){return _0x64844e[0x0]['COUNT(*)'];});}module[_0x174b('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery};
\ No newline at end of file
index e53ca23..2a19c6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce51=['close','unlink','decryptFile','createWriteStream','createDecipher','encryptString','utf8','base64','decryptString','secret','crypto','bluebird','lodash','../../config/environment','../../config/logger','secrets','session','aes-256-ctr','encrypt','algorithm','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createCipher','data','update','write','end','final','binary'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xce51,0xb4));var _0x1ce5=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0xce51[_0x1db831];return _0x39ba56;};'use strict';var crypto=require(_0x1ce5('0x0'));var fs=require('fs');var BPromise=require(_0x1ce5('0x1'));var _=require(_0x1ce5('0x2'));var config=require(_0x1ce5('0x3'));var logger=require(_0x1ce5('0x4'))('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x1ce5('0x5')][_0x1ce5('0x6')],'algorithm':_0x1ce5('0x7')};const fileOptions={'algorithm':'aes192'};if(config[_0x1ce5('0x8')]&&config['encrypt'][_0x1ce5('0x9')]){var isSupported=isAlgorithmSupported(config[_0x1ce5('0x8')][_0x1ce5('0x9')]);if(isSupported){fileOptions['algorithm']=config[_0x1ce5('0x8')][_0x1ce5('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x1ce5('0xa')](config[_0x1ce5('0x8')][_0x1ce5('0x9')],_0x1ce5('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0xf18a3c){return AES_SUPPORTED_RX['test'](_0xf18a3c);}function getSupportedCiphers(){return crypto[_0x1ce5('0xc')]()[_0x1ce5('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x1f8e7e){return getSupportedCiphers()['indexOf'](_0x1f8e7e)>-0x1;}function combineOptions(_0x474ceb){var _0x36feae={};for(var _0x5e1aa8 in fileOptions){if(fileOptions[_0x1ce5('0xe')](_0x5e1aa8)){_0x36feae[_0x5e1aa8]=fileOptions[_0x5e1aa8];}}if(_0x474ceb){for(var _0x2b7300 in _0x474ceb){if(_0x474ceb['hasOwnProperty'](_0x2b7300)){_0x36feae[_0x2b7300]=_0x474ceb[_0x2b7300];}}}return _0x36feae;}exports[_0x1ce5('0xf')]=function(_0x316efc,_0x44e16f,_0x3e7b45,_0x234988){return new BPromise(function(_0x213bb8,_0x1171f0){_0x234988=combineOptions(_0x234988);var _0x545890=new Buffer(_0x3e7b45);var _0xdc2af8=fs[_0x1ce5('0x10')](_0x316efc);var _0x49ce80=fs['createWriteStream'](_0x44e16f);var _0x53aee7=crypto[_0x1ce5('0x11')](_0x234988['algorithm'],_0x545890);_0xdc2af8['on'](_0x1ce5('0x12'),function(_0x55cbba){var _0x11917f=new Buffer(_0x53aee7[_0x1ce5('0x13')](_0x55cbba),'binary');_0x49ce80[_0x1ce5('0x14')](_0x11917f);});_0xdc2af8['on'](_0x1ce5('0x15'),function(){try{var _0x46b5ac=new Buffer(_0x53aee7[_0x1ce5('0x16')](_0x1ce5('0x17')),_0x1ce5('0x17'));_0x49ce80['write'](_0x46b5ac);_0x49ce80['end']();_0x49ce80['on'](_0x1ce5('0x18'),function(){return _0x213bb8(_0x44e16f);});}catch(_0x2d2123){fs[_0x1ce5('0x19')](_0x44e16f);return _0x1171f0(_0x2d2123);}});});};exports[_0x1ce5('0x1a')]=function(_0x4644f7,_0x2e5094,_0x2e5b8f,_0x3b0b66){return new BPromise(function(_0x1bebee,_0x25828f){_0x3b0b66=combineOptions(_0x3b0b66);var _0x10f0d2=new Buffer(_0x2e5b8f);var _0x300823=fs[_0x1ce5('0x10')](_0x4644f7);var _0x4dae7a=fs[_0x1ce5('0x1b')](_0x2e5094);var _0x474a5c=crypto[_0x1ce5('0x1c')](_0x3b0b66[_0x1ce5('0x9')],_0x10f0d2);_0x300823['on'](_0x1ce5('0x12'),function(_0x4a46c6){var _0x161ae1=new Buffer(_0x474a5c['update'](_0x4a46c6),_0x1ce5('0x17'));_0x4dae7a[_0x1ce5('0x14')](_0x161ae1);});_0x300823['on'](_0x1ce5('0x15'),function(){try{var _0x41554c=new Buffer(_0x474a5c[_0x1ce5('0x16')](_0x1ce5('0x17')),_0x1ce5('0x17'));_0x4dae7a[_0x1ce5('0x14')](_0x41554c);_0x4dae7a[_0x1ce5('0x15')]();_0x4dae7a['on']('close',function(){return _0x1bebee(_0x2e5094);});}catch(_0x267ae7){fs[_0x1ce5('0x19')](_0x2e5094);return _0x25828f(_0x267ae7);}});});};exports[_0x1ce5('0x1d')]=function(_0x285122,_0x121b4a,_0x23a053){var _0x463ccc=_0x23a053||stringOptions[_0x1ce5('0x9')];var _0x1351a9=_0x121b4a||stringOptions['secret'];var _0x1a6a93=crypto['createCipher'](_0x463ccc,_0x1351a9);var _0x2957ce=_0x1a6a93[_0x1ce5('0x13')](_0x285122,_0x1ce5('0x1e'),_0x1ce5('0x1f'));_0x2957ce+=_0x1a6a93[_0x1ce5('0x16')](_0x1ce5('0x1f'));return _0x2957ce;};exports[_0x1ce5('0x20')]=function(_0x51980c,_0x232fc4,_0x24e7bc){var _0x1e8605=_0x24e7bc||stringOptions[_0x1ce5('0x9')];var _0x5903d4=_0x232fc4||stringOptions[_0x1ce5('0x21')];var _0x38a6d2=crypto[_0x1ce5('0x1c')](_0x1e8605,_0x5903d4);var _0x124683=_0x38a6d2['update'](_0x51980c,_0x1ce5('0x1f'),'utf8');_0x124683+=_0x38a6d2['final'](_0x1ce5('0x1e'));return _0x124683;};
\ No newline at end of file
+var _0x57a4=['close','decryptFile','createDecipher','final','unlink','encryptString','secret','base64','decryptString','utf8','bluebird','lodash','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','write','end','binary'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x57a4,0x16a));var _0x457a=function(_0xb053a9,_0x169782){_0xb053a9=_0xb053a9-0x0;var _0x4a9fe3=_0x57a4[_0xb053a9];return _0x4a9fe3;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x457a('0x0'));var _=require(_0x457a('0x1'));var config=require('../../config/environment');var logger=require(_0x457a('0x2'))(_0x457a('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x457a('0x4')][_0x457a('0x5')],'algorithm':_0x457a('0x6')};const fileOptions={'algorithm':'aes192'};if(config['encrypt']&&config[_0x457a('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config['encrypt'][_0x457a('0x8')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x457a('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x457a('0x9')](',\x20');logger['error'](config['encrypt'][_0x457a('0x8')],_0x457a('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x4a35a1){return AES_SUPPORTED_RX['test'](_0x4a35a1);}function getSupportedCiphers(){return crypto[_0x457a('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x464b3c){return getSupportedCiphers()[_0x457a('0xc')](_0x464b3c)>-0x1;}function combineOptions(_0x3e82e6){var _0x51c0f2={};for(var _0x4f016b in fileOptions){if(fileOptions[_0x457a('0xd')](_0x4f016b)){_0x51c0f2[_0x4f016b]=fileOptions[_0x4f016b];}}if(_0x3e82e6){for(var _0x3d9687 in _0x3e82e6){if(_0x3e82e6[_0x457a('0xd')](_0x3d9687)){_0x51c0f2[_0x3d9687]=_0x3e82e6[_0x3d9687];}}}return _0x51c0f2;}exports['encryptFile']=function(_0x412898,_0x290066,_0x1c1f21,_0x118cc2){return new BPromise(function(_0x4bb6cd,_0x2e7da8){_0x118cc2=combineOptions(_0x118cc2);var _0x5452cf=new Buffer(_0x1c1f21);var _0x22c2e8=fs[_0x457a('0xe')](_0x412898);var _0x39d6a4=fs[_0x457a('0xf')](_0x290066);var _0x2b04a8=crypto[_0x457a('0x10')](_0x118cc2[_0x457a('0x8')],_0x5452cf);_0x22c2e8['on'](_0x457a('0x11'),function(_0x3813ff){var _0x580b44=new Buffer(_0x2b04a8[_0x457a('0x12')](_0x3813ff),'binary');_0x39d6a4[_0x457a('0x13')](_0x580b44);});_0x22c2e8['on'](_0x457a('0x14'),function(){try{var _0x5d2ce6=new Buffer(_0x2b04a8['final'](_0x457a('0x15')),_0x457a('0x15'));_0x39d6a4[_0x457a('0x13')](_0x5d2ce6);_0x39d6a4[_0x457a('0x14')]();_0x39d6a4['on'](_0x457a('0x16'),function(){return _0x4bb6cd(_0x290066);});}catch(_0x373100){fs['unlink'](_0x290066);return _0x2e7da8(_0x373100);}});});};exports[_0x457a('0x17')]=function(_0x27de0f,_0x3024f9,_0x2550f7,_0x4c1f59){return new BPromise(function(_0x562079,_0x4cec5d){_0x4c1f59=combineOptions(_0x4c1f59);var _0x352e75=new Buffer(_0x2550f7);var _0x5c5e36=fs[_0x457a('0xe')](_0x27de0f);var _0x5f1283=fs['createWriteStream'](_0x3024f9);var _0x3403ea=crypto[_0x457a('0x18')](_0x4c1f59['algorithm'],_0x352e75);_0x5c5e36['on']('data',function(_0x55cbad){var _0x437bdd=new Buffer(_0x3403ea['update'](_0x55cbad),_0x457a('0x15'));_0x5f1283[_0x457a('0x13')](_0x437bdd);});_0x5c5e36['on'](_0x457a('0x14'),function(){try{var _0x43aa58=new Buffer(_0x3403ea[_0x457a('0x19')](_0x457a('0x15')),_0x457a('0x15'));_0x5f1283['write'](_0x43aa58);_0x5f1283[_0x457a('0x14')]();_0x5f1283['on'](_0x457a('0x16'),function(){return _0x562079(_0x3024f9);});}catch(_0x4b3e8f){fs[_0x457a('0x1a')](_0x3024f9);return _0x4cec5d(_0x4b3e8f);}});});};exports[_0x457a('0x1b')]=function(_0x47b666,_0x118edc,_0x23e100){var _0x5cd9dc=_0x23e100||stringOptions[_0x457a('0x8')];var _0xecabc1=_0x118edc||stringOptions[_0x457a('0x1c')];var _0xd8e061=crypto[_0x457a('0x10')](_0x5cd9dc,_0xecabc1);var _0x39f008=_0xd8e061[_0x457a('0x12')](_0x47b666,'utf8','base64');_0x39f008+=_0xd8e061[_0x457a('0x19')](_0x457a('0x1d'));return _0x39f008;};exports[_0x457a('0x1e')]=function(_0x35c340,_0x2dd177,_0x49b21f){var _0x5cbc73=_0x49b21f||stringOptions[_0x457a('0x8')];var _0x5330e8=_0x2dd177||stringOptions[_0x457a('0x1c')];var _0x2a0a2c=crypto['createDecipher'](_0x5cbc73,_0x5330e8);var _0x3c8a56=_0x2a0a2c[_0x457a('0x12')](_0x35c340,_0x457a('0x1d'),'utf8');_0x3c8a56+=_0x2a0a2c[_0x457a('0x19')](_0x457a('0x1f'));return _0x3c8a56;};
\ No newline at end of file
index faf5ccf..5aa9436 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa8e=['finally','exit','util','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','Empty','split','length','range','num','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed'];(function(_0x5abf14,_0x105613){var _0x35d1b3=function(_0x4f916e){while(--_0x4f916e){_0x5abf14['push'](_0x5abf14['shift']());}};_0x35d1b3(++_0x105613);}(_0xaa8e,0xf2));var _0xeaa8=function(_0x4ca7ab,_0x20e306){_0x4ca7ab=_0x4ca7ab-0x0;var _0x11a81f=_0xaa8e[_0x4ca7ab];return _0x11a81f;};'use strict';var util=require(_0xeaa8('0x0'));var path=require(_0xeaa8('0x1'));var _=require('lodash');var csv=require(_0xeaa8('0x2'));var fs=require('fs');var BPromise=require(_0xeaa8('0x3'));var zipdir=require(_0xeaa8('0x4'));var rimraf=require(_0xeaa8('0x5'));var db=require(_0xeaa8('0x6'))['db'];var dbH=require(_0xeaa8('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xeaa8('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c967a,_0xc4dc99){var _0x2918ad={'status':_0x4c967a};var _0x827b71={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc4dc99){_0x2918ad[_0xeaa8('0x8')]=_0xc4dc99;}return db['AnalyticExtractedReport'][_0xeaa8('0x9')](_0x2918ad,_0x827b71);}function main(){var _0x5848c8=0x1388;var _0x159ae6;logger['info'](util[_0xeaa8('0xa')](_0xeaa8('0xb'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0xeaa8('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xeaa8('0xd')]})[_0xeaa8('0xe')](function(_0x5546fc){if(_0x5546fc){_0x159ae6=_0x5546fc;_0x5848c8=_0x159ae6[_0xeaa8('0xd')]||0x1388;}})[_0xeaa8('0xe')](function(){return dbH[_0xeaa8('0xf')]['query'](util[_0xeaa8('0xa')](_0xeaa8('0x10'),QUERY),{'type':dbH[_0xeaa8('0xf')][_0xeaa8('0x11')]['SELECT']});})['then'](function(_0x40bf32){if(!_0x40bf32[0x0]['num']){return analyticExtractedReport(_0xeaa8('0x12'));}var _0x5b3dd9=[];var _0x54d537=0x0;if(_0x159ae6[_0xeaa8('0x13')]){if(_0x40bf32&&_0x40bf32[_0xeaa8('0x14')]){var _0x23ae0a=_[_0xeaa8('0x15')](_0x40bf32[0x0][_0xeaa8('0x16')]/_0x5848c8);var _0x4ab09d=Number[_0xeaa8('0x17')](_0x40bf32[0x0]['num']/_0x5848c8)?_0x40bf32[0x0][_0xeaa8('0x16')]%_0x5848c8:0x0;_0x23ae0a['forEach'](function(_0x5158d2){if(_0x5158d2>0x0){_0x54d537+=_0x5848c8;}_0x5b3dd9[_0xeaa8('0x18')](dbH[_0xeaa8('0xf')][_0xeaa8('0x19')](util['format'](_0xeaa8('0x1a'),QUERY,_0x5848c8,_0x54d537),{'type':dbH['sequelize'][_0xeaa8('0x11')]['SELECT']}));});if(_0x4ab09d>0x0){_0x54d537+=_0x5848c8;_0x5b3dd9[_0xeaa8('0x18')](dbH[_0xeaa8('0xf')][_0xeaa8('0x19')](util[_0xeaa8('0xa')](_0xeaa8('0x1a'),QUERY,_0x4ab09d,_0x54d537),{'type':dbH[_0xeaa8('0xf')][_0xeaa8('0x11')][_0xeaa8('0x1b')]}));}}}else{_0x5b3dd9[_0xeaa8('0x18')](dbH['sequelize'][_0xeaa8('0x19')](QUERY,{'type':dbH[_0xeaa8('0xf')][_0xeaa8('0x11')][_0xeaa8('0x1b')]}));}var _0x5dc056=path[_0xeaa8('0x1c')](PATH);var _0x4d1637=path[_0xeaa8('0x1d')](PATH,_0xeaa8('0x1e'));var _0x56d5ac=_0x159ae6['split']&&_0x5b3dd9[_0xeaa8('0x14')]>0x1;var _0x38b358=[];if(!fs[_0xeaa8('0x1f')](path[_0xeaa8('0x20')](_0x5dc056,_0x4d1637))&&_0x56d5ac){fs[_0xeaa8('0x21')](path[_0xeaa8('0x20')](_0x5dc056,_0x4d1637));}return BPromise[_0xeaa8('0x22')](_0x5b3dd9,function(_0x315a7f){_0x38b358[_0xeaa8('0x18')](_0x315a7f);})[_0xeaa8('0xe')](function(){for(var _0xc63278=0x0;_0xc63278<_0x38b358[_0xeaa8('0x14')];_0xc63278+=0x1){var _0x1bcd30;var _0x52a63e=_0x38b358[_0xc63278];if(_0x56d5ac){_0x1bcd30=path[_0xeaa8('0x20')](_0x5dc056,_0x4d1637,util[_0xeaa8('0xa')](_0xeaa8('0x23'),_0x4d1637,_0xc63278,_0xeaa8('0x24')));}else{_0x1bcd30=path[_0xeaa8('0x20')](_0x5dc056,util[_0xeaa8('0xa')](_0xeaa8('0x25'),_0x4d1637,_0xeaa8('0x24')));}fs[_0xeaa8('0x26')](_0x1bcd30,csv(_0x52a63e));}})[_0xeaa8('0xe')](function(){if(_0x56d5ac){return new Promise(function(_0x3f0520){zipdir(path[_0xeaa8('0x20')](_0x5dc056,_0x4d1637),{'saveTo':path[_0xeaa8('0x20')](_0x5dc056,util[_0xeaa8('0xa')](_0xeaa8('0x25'),_0x4d1637,'zip'))},function(_0x3a792e,_0x8f0766){rimraf(path[_0xeaa8('0x20')](_0x5dc056,_0x4d1637),function(){});_0x3f0520(_0xeaa8('0x27'));});});}})[_0xeaa8('0xe')](function(){logger[_0xeaa8('0x28')](util['format'](_0xeaa8('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x56d5ac?util[_0xeaa8('0xa')](_0xeaa8('0x25'),_0x4d1637,_0x56d5ac?_0xeaa8('0x2a'):'csv'):null);});})['catch'](function(_0x590033){logger['info'](util[_0xeaa8('0xa')](_0xeaa8('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util[_0xeaa8('0x2c')](_0x590033,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xeaa8('0x2d'));})[_0xeaa8('0x2e')](function(){process[_0xeaa8('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x6ad9=['dirname','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','writeFileSync','zip','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d'];(function(_0xc815e0,_0x1a5f75){var _0x30d552=function(_0x43963e){while(--_0x43963e){_0xc815e0['push'](_0xc815e0['shift']());}};_0x30d552(++_0x1a5f75);}(_0x6ad9,0x1f0));var _0x96ad=function(_0x1b0a4e,_0x552d7f){_0x1b0a4e=_0x1b0a4e-0x0;var _0x4223df=_0x6ad9[_0x1b0a4e];return _0x4223df;};'use strict';var util=require(_0x96ad('0x0'));var path=require(_0x96ad('0x1'));var _=require(_0x96ad('0x2'));var csv=require(_0x96ad('0x3'));var fs=require('fs');var BPromise=require(_0x96ad('0x4'));var zipdir=require('zip-dir');var rimraf=require(_0x96ad('0x5'));var db=require(_0x96ad('0x6'))['db'];var dbH=require(_0x96ad('0x6'))[_0x96ad('0x7')];var logger=require('../../config/logger')(_0x96ad('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x96ad('0x9')][0x2]);var QUERY=process[_0x96ad('0x9')][0x3];var PATH=process[_0x96ad('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3fb09e,_0x4bd648){var _0x28348a={'status':_0x3fb09e};var _0x477549={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4bd648){_0x28348a[_0x96ad('0xa')]=_0x4bd648;}return db[_0x96ad('0xb')][_0x96ad('0xc')](_0x28348a,_0x477549);}function main(){var _0x22d3d8=0x1388;var _0x36d6c8;logger['info'](util[_0x96ad('0xd')](_0x96ad('0xe'),EXTRACTED_REPORT_ID,_0x96ad('0xf')));return db[_0x96ad('0x10')][_0x96ad('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x96ad('0x12'),'splitSizeCsv']})['then'](function(_0x4a0f96){if(_0x4a0f96){_0x36d6c8=_0x4a0f96;_0x22d3d8=_0x36d6c8['splitSizeCsv']||0x1388;}})[_0x96ad('0x13')](function(){return dbH['sequelize']['query'](util[_0x96ad('0xd')](_0x96ad('0x14'),QUERY),{'type':dbH[_0x96ad('0x15')][_0x96ad('0x16')][_0x96ad('0x17')]});})[_0x96ad('0x13')](function(_0x3cc57f){if(!_0x3cc57f[0x0][_0x96ad('0x18')]){return analyticExtractedReport('Empty');}var _0x53ef2b=[];var _0x4aa8b1=0x0;if(_0x36d6c8['split']){if(_0x3cc57f&&_0x3cc57f[_0x96ad('0x19')]){var _0x36758e=_[_0x96ad('0x1a')](_0x3cc57f[0x0][_0x96ad('0x18')]/_0x22d3d8);var _0x3fd941=Number[_0x96ad('0x1b')](_0x3cc57f[0x0][_0x96ad('0x18')]/_0x22d3d8)?_0x3cc57f[0x0][_0x96ad('0x18')]%_0x22d3d8:0x0;_0x36758e[_0x96ad('0x1c')](function(_0x447745){if(_0x447745>0x0){_0x4aa8b1+=_0x22d3d8;}_0x53ef2b[_0x96ad('0x1d')](dbH[_0x96ad('0x15')][_0x96ad('0x1e')](util[_0x96ad('0xd')](_0x96ad('0x1f'),QUERY,_0x22d3d8,_0x4aa8b1),{'type':dbH[_0x96ad('0x15')][_0x96ad('0x16')][_0x96ad('0x17')]}));});if(_0x3fd941>0x0){_0x4aa8b1+=_0x22d3d8;_0x53ef2b[_0x96ad('0x1d')](dbH[_0x96ad('0x15')]['query'](util['format'](_0x96ad('0x1f'),QUERY,_0x3fd941,_0x4aa8b1),{'type':dbH[_0x96ad('0x15')][_0x96ad('0x16')][_0x96ad('0x17')]}));}}}else{_0x53ef2b[_0x96ad('0x1d')](dbH[_0x96ad('0x15')]['query'](QUERY,{'type':dbH[_0x96ad('0x15')][_0x96ad('0x16')][_0x96ad('0x17')]}));}var _0x26fbcd=path[_0x96ad('0x20')](PATH);var _0x132b23=path['basename'](PATH,_0x96ad('0x21'));var _0x291b8f=_0x36d6c8[_0x96ad('0x12')]&&_0x53ef2b[_0x96ad('0x19')]>0x1;var _0x595a52=[];if(!fs[_0x96ad('0x22')](path[_0x96ad('0x23')](_0x26fbcd,_0x132b23))&&_0x291b8f){fs[_0x96ad('0x24')](path['join'](_0x26fbcd,_0x132b23));}return BPromise[_0x96ad('0x25')](_0x53ef2b,function(_0x45a06f){_0x595a52[_0x96ad('0x1d')](_0x45a06f);})['then'](function(){for(var _0x301355=0x0;_0x301355<_0x595a52['length'];_0x301355+=0x1){var _0x347114;var _0x376342=_0x595a52[_0x301355];if(_0x291b8f){_0x347114=path[_0x96ad('0x23')](_0x26fbcd,_0x132b23,util['format']('%s%d.%s',_0x132b23,_0x301355,_0x96ad('0x26')));}else{_0x347114=path['join'](_0x26fbcd,util[_0x96ad('0xd')](_0x96ad('0x27'),_0x132b23,_0x96ad('0x26')));}fs[_0x96ad('0x28')](_0x347114,csv(_0x376342));}})['then'](function(){if(_0x291b8f){return new Promise(function(_0x507454){zipdir(path[_0x96ad('0x23')](_0x26fbcd,_0x132b23),{'saveTo':path[_0x96ad('0x23')](_0x26fbcd,util[_0x96ad('0xd')]('%s.%s',_0x132b23,_0x96ad('0x29')))},function(_0x402b76,_0x3a67cf){rimraf(path[_0x96ad('0x23')](_0x26fbcd,_0x132b23),function(){});_0x507454('zip\x20finished');});});}})[_0x96ad('0x13')](function(){logger[_0x96ad('0x2a')](util[_0x96ad('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x96ad('0xf')));return analyticExtractedReport('Completed',_0x291b8f?util[_0x96ad('0xd')](_0x96ad('0x27'),_0x132b23,_0x291b8f?'zip':_0x96ad('0x26')):null);});})['catch'](function(_0x1948d2){logger[_0x96ad('0x2a')](util[_0x96ad('0xd')](_0x96ad('0x2b'),EXTRACTED_REPORT_ID,'CSV'),util[_0x96ad('0x2c')](_0x1948d2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x96ad('0x2d'));})[_0x96ad('0x2e')](function(){process[_0x96ad('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 93c7700..d451e5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0e5=['channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','footer','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','push','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','Arial','black','right','num','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','QueryTypes','SELECT','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf'];(function(_0x4b8f47,_0x409b2c){var _0x2b168a=function(_0x3274aa){while(--_0x3274aa){_0x4b8f47['push'](_0x4b8f47['shift']());}};_0x2b168a(++_0x409b2c);}(_0xe0e5,0x1dd));var _0x5e0e=function(_0x4851ff,_0x1c9a8d){_0x4851ff=_0x4851ff-0x0;var _0x26773b=_0xe0e5[_0x4851ff];return _0x26773b;};'use strict';var _=require(_0x5e0e('0x0'));var fs=require('fs');var util=require(_0x5e0e('0x1'));var path=require(_0x5e0e('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x5e0e('0x3'));var zipdir=require(_0x5e0e('0x4'));var rimraf=require(_0x5e0e('0x5'));var JSDOM=require(_0x5e0e('0x6'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x5e0e('0x7'));var db=require(_0x5e0e('0x8'))['db'];var dbH=require(_0x5e0e('0x8'))[_0x5e0e('0x9')];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x5e0e('0xa')][0x2]);var QUERY=process[_0x5e0e('0xa')][0x3];var PATH=process[_0x5e0e('0xa')][0x4];var NAME=process[_0x5e0e('0xa')][0x5];var FORMAT=_0x5e0e('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x47b115,_0xb159a7){var _0x552d40={'status':_0x47b115};var _0x268773={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xb159a7){_0x552d40[_0x5e0e('0xc')]=_0xb159a7;}return db[_0x5e0e('0xd')]['update'](_0x552d40,_0x268773);}function getHeaders(_0x456523){return _[_0x5e0e('0xe')](_0x456523,function(_0x4d8a6f){return{'text':_0x4d8a6f,'style':_0x5e0e('0xf')};});}function getRows(_0x17fa25,_0x4d5049){return _[_0x5e0e('0xe')](_0x4d5049,function(_0x13045e){return _(_0x13045e)[_0x5e0e('0x10')](_0x17fa25)['map'](function(_0x1f301f){return _0x1f301f?_[_0x5e0e('0x11')](_0x1f301f):'';})[_0x5e0e('0x12')]();});}function createTable(_0xc1ef6d,_0x2e1e28){var _0x1b1b0a={'widths':_[_0x5e0e('0x13')](Array(_0xc1ef6d[_0x5e0e('0x14')]),0x91),'heights':function(_0x4cd209){return _0x4cd209===0x0?_0x5e0e('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x263a68=getHeaders(_0xc1ef6d);_0x1b1b0a[_0x5e0e('0x16')][_0x5e0e('0x17')](_0x263a68);var _0x4235ec=getRows(_0xc1ef6d,_0x2e1e28);_0x1b1b0a[_0x5e0e('0x16')]=_0x1b1b0a['body'][_0x5e0e('0x18')](_0x4235ec);return _0x1b1b0a;}function createTables(_0x4ff974){var _0x248844=[];var _0x1083cf=_[_0x5e0e('0x19')](Object[_0x5e0e('0x1a')](_0x4ff974[0x0]),0x5);_0x1083cf[_0x5e0e('0x1b')](function(_0x558752){_0x248844[_0x5e0e('0x17')](createTable(_0x558752,_0x4ff974));});return _0x248844;}function getPDFDocDefinition(_0x46ad9e){var _0x5d38a6=util[_0x5e0e('0x1c')](_0x5e0e('0x1d'),NAME,EXTRACTED_REPORT[_0x5e0e('0x1e')],moment(EXTRACTED_REPORT[_0x5e0e('0x1f')])[_0x5e0e('0x1c')](FORMAT),moment(EXTRACTED_REPORT[_0x5e0e('0x20')])['format'](FORMAT));var _0x1b5219=[];for(var _0x1c7ef4=0x0;_0x1c7ef4<_0x46ad9e['length'];_0x1c7ef4++){var _0x4f8855=[];if(_0x1c7ef4===0x0){_0x4f8855[_0x5e0e('0x17')]({'text':_0x5d38a6,'style':_0x5e0e('0x21')});}var _0x4fc409={'table':_0x46ad9e[_0x1c7ef4]};if(_0x1c7ef4>0x0){_0x4fc409[_0x5e0e('0x22')]=_0x5e0e('0x23');_0x4fc409[_0x5e0e('0x24')]=[0x0,0x46,0x0,0x0];}_0x4f8855[_0x5e0e('0x17')](_0x4fc409);_0x1b5219[_0x5e0e('0x17')](_0x4f8855);}return{'pageSize':'A4','pageOrientation':_0x5e0e('0x25'),'content':_0x1b5219,'footer':function(_0x5d2490,_0x511b87){return{'text':_0x5d2490[_0x5e0e('0x11')]()+_0x5e0e('0x26')+_0x511b87,'style':'footer'};},'defaultStyle':{'font':_0x5e0e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x5e0e('0x28')},'footer':{'alignment':_0x5e0e('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x88a590){var _0x5f1451=0x1388;var _0x5543f7;if(!_0x88a590[0x0][_0x5e0e('0x2a')]){return analyticExtractedReport('Empty');}return db[_0x5e0e('0x2b')][_0x5e0e('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x5e0e('0x2d')]})['then'](function(_0x3c1629){if(_0x3c1629){_0x5543f7=_0x3c1629;_0x5f1451=_0x5543f7[_0x5e0e('0x2d')]||0x3e8;}})[_0x5e0e('0x2e')](function(){var _0x52f975=[];var _0x4231f7=0x0;if(_0x5543f7[_0x5e0e('0x2f')]){if(_0x88a590&&_0x88a590[_0x5e0e('0x14')]){var _0x281ce4=_[_0x5e0e('0x30')](_0x88a590[0x0][_0x5e0e('0x2a')]/_0x5f1451);var _0x3ba7ee=Number[_0x5e0e('0x31')](_0x88a590[0x0][_0x5e0e('0x2a')]/_0x5f1451)?_0x88a590[0x0][_0x5e0e('0x2a')]%_0x5f1451:0x0;_0x281ce4[_0x5e0e('0x1b')](function(_0x295c55){if(_0x295c55>0x0){_0x4231f7+=_0x5f1451;}_0x52f975[_0x5e0e('0x17')](dbH[_0x5e0e('0x32')][_0x5e0e('0x33')](util[_0x5e0e('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5f1451,_0x4231f7),{'type':dbH[_0x5e0e('0x32')]['QueryTypes']['SELECT']}));});if(_0x3ba7ee>0x0){_0x4231f7+=_0x5f1451;_0x52f975[_0x5e0e('0x17')](dbH[_0x5e0e('0x32')][_0x5e0e('0x33')](util[_0x5e0e('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3ba7ee,_0x4231f7),{'type':dbH[_0x5e0e('0x32')][_0x5e0e('0x34')][_0x5e0e('0x35')]}));}}}else{_0x52f975['push'](dbH[_0x5e0e('0x32')][_0x5e0e('0x33')](QUERY,{'type':dbH[_0x5e0e('0x32')][_0x5e0e('0x34')][_0x5e0e('0x35')]}));}var _0x3baeb8=path[_0x5e0e('0x36')](PATH);var _0x38d17d=path['basename'](PATH,_0x5e0e('0x37'));var _0x2052da=_0x5543f7[_0x5e0e('0x2f')]&&_0x52f975[_0x5e0e('0x14')]>0x1;var _0x56e53a=[];if(!fs[_0x5e0e('0x38')](path[_0x5e0e('0x39')](_0x3baeb8,_0x38d17d))&&_0x2052da){fs[_0x5e0e('0x3a')](path[_0x5e0e('0x39')](_0x3baeb8,_0x38d17d));}return BPromise[_0x5e0e('0x3b')](_0x52f975,function(_0x54f516){_0x56e53a[_0x5e0e('0x17')](_0x54f516);})[_0x5e0e('0x2e')](function(){var _0x1da75b=[];for(var _0x3a6b56=0x0;_0x3a6b56<_0x56e53a[_0x5e0e('0x14')];_0x3a6b56+=0x1){var _0x1baafb=_0x56e53a[_0x3a6b56];var _0x2a32c4=createTables(_[_0x5e0e('0x3c')](_0x1baafb));var _0x9a16d3;var _0x2d0c4e=getPDFDocDefinition(_0x2a32c4);var _0x55b867=getPDFPrinter();var _0x32a241=_0x55b867[_0x5e0e('0x3d')](_0x2d0c4e);if(_0x2052da){_0x9a16d3=path['join'](_0x3baeb8,_0x38d17d,util[_0x5e0e('0x1c')](_0x5e0e('0x3e'),_0x38d17d,_0x3a6b56,_0x5e0e('0x3f')));}else{_0x9a16d3=path[_0x5e0e('0x39')](_0x3baeb8,util[_0x5e0e('0x1c')](_0x5e0e('0x40'),_0x38d17d,_0x5e0e('0x3f')));}_0x1da75b[_0x5e0e('0x17')](writePDFDocument(_0x32a241,_0x9a16d3));}return Promise[_0x5e0e('0x41')](_0x1da75b);})[_0x5e0e('0x2e')](function(){if(_0x2052da){return new Promise(function(_0x677369){zipdir(path['join'](_0x3baeb8,_0x38d17d),{'saveTo':path['join'](_0x3baeb8,util[_0x5e0e('0x1c')]('%s.%s',_0x38d17d,_0x5e0e('0x42')))},function(){rimraf(path[_0x5e0e('0x39')](_0x3baeb8,_0x38d17d),function(){});_0x677369(_0x5e0e('0x43'));});});}})[_0x5e0e('0x2e')](function(){if(!_0x2052da)return;rimraf(path[_0x5e0e('0x39')](_0x3baeb8,_0x38d17d),function(){});})[_0x5e0e('0x2e')](function(){logger['info'](util['format'](_0x5e0e('0x44'),EXTRACTED_REPORT_ID,_0x5e0e('0x45')));return analyticExtractedReport('Completed',_0x2052da?util['format']('%s.%s',_0x38d17d,_0x2052da?_0x5e0e('0x42'):_0x5e0e('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x5e0e('0x46')](util['format'](_0x5e0e('0x47'),EXTRACTED_REPORT_ID,_0x5e0e('0x45')));return db['AnalyticExtractedReport'][_0x5e0e('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x5e0e('0x2e')](function(_0x71f92c){EXTRACTED_REPORT=_0x71f92c;return dbH['sequelize'][_0x5e0e('0x33')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH['sequelize'][_0x5e0e('0x34')][_0x5e0e('0x35')]});})[_0x5e0e('0x2e')](extractReport)[_0x5e0e('0x49')](function(_0x519d00){logger[_0x5e0e('0x46')](util[_0x5e0e('0x1c')](_0x5e0e('0x4a'),EXTRACTED_REPORT_ID,_0x5e0e('0x45')),util['inspect'](_0x519d00,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5e0e('0x4b'));})[_0x5e0e('0x4c')](function(){process[_0x5e0e('0x4d')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5f1d52=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x5e0e('0x4e'),'italics':__dirname+_0x5e0e('0x4f'),'bolditalics':__dirname+_0x5e0e('0x50')}});return _0x5f1d52;}function getPDFDocDefinitionFromHTML(_0xb01100,_0x20b7f5){var _0x10963c=util['format']('%s\x20#%d',_0x20b7f5[_0x5e0e('0x51')],_0x20b7f5[_0x5e0e('0x52')]);var _0x3e5c3f=moment()[_0x5e0e('0x1c')](_0x5e0e('0x53'))[_0x5e0e('0x11')]();var _0x5a4a24=htmlToPdfmake(_0xb01100,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5a4a24],'defaultStyle':{'font':_0x5e0e('0x27')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x5e0e('0x54')}},'header':function(){return[{'text':_0x5e0e('0x55'),'style':_0x5e0e('0x21')}];},'footer':function(_0x5834c2,_0x180659){return[{'text':util[_0x5e0e('0x1c')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x10963c,_0x5834c2,_0x180659,_0x3e5c3f),'style':_0x5e0e('0x56')}];}};}function writePDFDocument(_0x8b65af,_0x4412ac){return new Promise(function(_0x465edf,_0x10e028){var _0x598f5c=_0x8b65af[_0x5e0e('0x57')](fs[_0x5e0e('0x58')](_0x4412ac));_0x598f5c['on'](_0x5e0e('0x59'),function(){_0x465edf(_0x5e0e('0x59'));});_0x598f5c['on'](_0x5e0e('0x5a'),function(_0x511bed){_0x10e028(_0x511bed);});_0x8b65af[_0x5e0e('0x5b')]();});}exports[_0x5e0e('0x5c')]=function(_0x16c76f,_0x1ee885){var _0xeece22=getPDFPrinter();var _0x179077=getPDFDocDefinitionFromHTML(_0x16c76f,_0x1ee885);var _0x7a35d1=_0xeece22[_0x5e0e('0x3d')](_0x179077);return writePDFDocument(_0x7a35d1,_0x1ee885[_0x5e0e('0x2')])[_0x5e0e('0x49')](function(_0x2b4d20){throw _0x2b4d20;});};
\ No newline at end of file
+var _0x5016=['zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','toString','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','bluebird','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','length','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','landscape','\x20/\x20','footer','black','right','num','Empty','Setting','find','splitSizePdf','then','split','range','query','sequelize','QueryTypes','SELECT','dirname','basename','mkdirSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all'];(function(_0x1f3131,_0x2f0bee){var _0x2adacf=function(_0x1ee998){while(--_0x1ee998){_0x1f3131['push'](_0x1f3131['shift']());}};_0x2adacf(++_0x2f0bee);}(_0x5016,0x195));var _0x6501=function(_0x5e3a45,_0x45f0c5){_0x5e3a45=_0x5e3a45-0x0;var _0x13419f=_0x5016[_0x5e3a45];return _0x13419f;};'use strict';var _=require(_0x6501('0x0'));var fs=require('fs');var util=require(_0x6501('0x1'));var path=require(_0x6501('0x2'));var moment=require(_0x6501('0x3'));var htmlToPdfmake=require(_0x6501('0x4'));var PdfPrinter=require(_0x6501('0x5'));var zipdir=require(_0x6501('0x6'));var rimraf=require(_0x6501('0x7'));var JSDOM=require(_0x6501('0x8'))['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x6501('0x9'));var db=require(_0x6501('0xa'))['db'];var dbH=require(_0x6501('0xa'))[_0x6501('0xb')];var logger=require(_0x6501('0xc'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x6501('0xd')][0x2]);var QUERY=process[_0x6501('0xd')][0x3];var PATH=process[_0x6501('0xd')][0x4];var NAME=process[_0x6501('0xd')][0x5];var FORMAT=_0x6501('0xe');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x414da1,_0x1f52a7){var _0x4cd32b={'status':_0x414da1};var _0x185cbe={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1f52a7){_0x4cd32b[_0x6501('0xf')]=_0x1f52a7;}return db['AnalyticExtractedReport'][_0x6501('0x10')](_0x4cd32b,_0x185cbe);}function getHeaders(_0x5cd68f){return _[_0x6501('0x11')](_0x5cd68f,function(_0x37610e){return{'text':_0x37610e,'style':'tableHeader'};});}function getRows(_0x471f23,_0x7b4705){return _[_0x6501('0x11')](_0x7b4705,function(_0x318914){return _(_0x318914)[_0x6501('0x12')](_0x471f23)[_0x6501('0x11')](function(_0x4a8d88){return _0x4a8d88?_['toString'](_0x4a8d88):'';})['value']();});}function createTable(_0x37c484,_0x522f0d){var _0x4cde4d={'widths':_['fill'](Array(_0x37c484[_0x6501('0x13')]),0x91),'heights':function(_0xf3a85e){return _0xf3a85e===0x0?_0x6501('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xd0260f=getHeaders(_0x37c484);_0x4cde4d['body']['push'](_0xd0260f);var _0x46d1c7=getRows(_0x37c484,_0x522f0d);_0x4cde4d[_0x6501('0x15')]=_0x4cde4d[_0x6501('0x15')]['concat'](_0x46d1c7);return _0x4cde4d;}function createTables(_0xca5c5c){var _0x34ed89=[];var _0x3a9177=_['chunk'](Object[_0x6501('0x16')](_0xca5c5c[0x0]),0x5);_0x3a9177[_0x6501('0x17')](function(_0x2656ed){_0x34ed89[_0x6501('0x18')](createTable(_0x2656ed,_0xca5c5c));});return _0x34ed89;}function getPDFDocDefinition(_0xc4871d){var _0x50e25b=util[_0x6501('0x19')](_0x6501('0x1a'),NAME,EXTRACTED_REPORT[_0x6501('0x1b')],moment(EXTRACTED_REPORT[_0x6501('0x1c')])[_0x6501('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0x6501('0x1d')])['format'](FORMAT));var _0x48906e=[];for(var _0x956c77=0x0;_0x956c77<_0xc4871d[_0x6501('0x13')];_0x956c77++){var _0x10bf98=[];if(_0x956c77===0x0){_0x10bf98['push']({'text':_0x50e25b,'style':_0x6501('0x1e')});}var _0x1ea68b={'table':_0xc4871d[_0x956c77]};if(_0x956c77>0x0){_0x1ea68b[_0x6501('0x1f')]=_0x6501('0x20');_0x1ea68b['margin']=[0x0,0x46,0x0,0x0];}_0x10bf98[_0x6501('0x18')](_0x1ea68b);_0x48906e[_0x6501('0x18')](_0x10bf98);}return{'pageSize':'A4','pageOrientation':_0x6501('0x21'),'content':_0x48906e,'footer':function(_0x318d6e,_0x4f8f66){return{'text':_0x318d6e['toString']()+_0x6501('0x22')+_0x4f8f66,'style':_0x6501('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x6501('0x24')},'footer':{'alignment':_0x6501('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x32a18c){var _0x38c3c5=0x1388;var _0x1ffc69;if(!_0x32a18c[0x0][_0x6501('0x26')]){return analyticExtractedReport(_0x6501('0x27'));}return db[_0x6501('0x28')][_0x6501('0x29')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x6501('0x2a')]})['then'](function(_0x321a11){if(_0x321a11){_0x1ffc69=_0x321a11;_0x38c3c5=_0x1ffc69[_0x6501('0x2a')]||0x3e8;}})[_0x6501('0x2b')](function(){var _0x57f3a7=[];var _0x239a45=0x0;if(_0x1ffc69[_0x6501('0x2c')]){if(_0x32a18c&&_0x32a18c[_0x6501('0x13')]){var _0x35b733=_[_0x6501('0x2d')](_0x32a18c[0x0]['num']/_0x38c3c5);var _0x40af6d=Number['isInteger'](_0x32a18c[0x0]['num']/_0x38c3c5)?_0x32a18c[0x0]['num']%_0x38c3c5:0x0;_0x35b733[_0x6501('0x17')](function(_0x35a194){if(_0x35a194>0x0){_0x239a45+=_0x38c3c5;}_0x57f3a7[_0x6501('0x18')](dbH['sequelize'][_0x6501('0x2e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x38c3c5,_0x239a45),{'type':dbH[_0x6501('0x2f')][_0x6501('0x30')][_0x6501('0x31')]}));});if(_0x40af6d>0x0){_0x239a45+=_0x38c3c5;_0x57f3a7['push'](dbH[_0x6501('0x2f')][_0x6501('0x2e')](util[_0x6501('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x40af6d,_0x239a45),{'type':dbH[_0x6501('0x2f')][_0x6501('0x30')]['SELECT']}));}}}else{_0x57f3a7['push'](dbH[_0x6501('0x2f')]['query'](QUERY,{'type':dbH[_0x6501('0x2f')][_0x6501('0x30')]['SELECT']}));}var _0x5eb12b=path[_0x6501('0x32')](PATH);var _0x168a32=path[_0x6501('0x33')](PATH,'.pdf');var _0x24d0bb=_0x1ffc69[_0x6501('0x2c')]&&_0x57f3a7[_0x6501('0x13')]>0x1;var _0x11b367=[];if(!fs['existsSync'](path['join'](_0x5eb12b,_0x168a32))&&_0x24d0bb){fs[_0x6501('0x34')](path[_0x6501('0x35')](_0x5eb12b,_0x168a32));}return BPromise['each'](_0x57f3a7,function(_0x448e61){_0x11b367[_0x6501('0x18')](_0x448e61);})[_0x6501('0x2b')](function(){var _0x599478=[];for(var _0x1bd6f4=0x0;_0x1bd6f4<_0x11b367[_0x6501('0x13')];_0x1bd6f4+=0x1){var _0x14337d=_0x11b367[_0x1bd6f4];var _0x234e8f=createTables(_[_0x6501('0x36')](_0x14337d));var _0x2e9860;var _0x3a2b8e=getPDFDocDefinition(_0x234e8f);var _0xab82e=getPDFPrinter();var _0x1aae21=_0xab82e[_0x6501('0x37')](_0x3a2b8e);if(_0x24d0bb){_0x2e9860=path[_0x6501('0x35')](_0x5eb12b,_0x168a32,util['format'](_0x6501('0x38'),_0x168a32,_0x1bd6f4,_0x6501('0x39')));}else{_0x2e9860=path[_0x6501('0x35')](_0x5eb12b,util[_0x6501('0x19')](_0x6501('0x3a'),_0x168a32,_0x6501('0x39')));}_0x599478['push'](writePDFDocument(_0x1aae21,_0x2e9860));}return Promise[_0x6501('0x3b')](_0x599478);})['then'](function(){if(_0x24d0bb){return new Promise(function(_0x5c7e1d){zipdir(path[_0x6501('0x35')](_0x5eb12b,_0x168a32),{'saveTo':path[_0x6501('0x35')](_0x5eb12b,util['format'](_0x6501('0x3a'),_0x168a32,_0x6501('0x3c')))},function(){rimraf(path[_0x6501('0x35')](_0x5eb12b,_0x168a32),function(){});_0x5c7e1d('zip\x20finished');});});}})[_0x6501('0x2b')](function(){if(!_0x24d0bb)return;rimraf(path[_0x6501('0x35')](_0x5eb12b,_0x168a32),function(){});})['then'](function(){logger['info'](util[_0x6501('0x19')](_0x6501('0x3d'),EXTRACTED_REPORT_ID,_0x6501('0x3e')));return analyticExtractedReport(_0x6501('0x3f'),_0x24d0bb?util[_0x6501('0x19')](_0x6501('0x3a'),_0x168a32,_0x24d0bb?_0x6501('0x3c'):_0x6501('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6501('0x40')](util[_0x6501('0x19')](_0x6501('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x6501('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4e59aa){EXTRACTED_REPORT=_0x4e59aa;return dbH[_0x6501('0x2f')][_0x6501('0x2e')](util[_0x6501('0x19')](_0x6501('0x43'),QUERY),{'type':dbH[_0x6501('0x2f')][_0x6501('0x30')][_0x6501('0x31')]});})['then'](extractReport)[_0x6501('0x44')](function(_0x42f50f){logger[_0x6501('0x40')](util['format'](_0x6501('0x45'),EXTRACTED_REPORT_ID,_0x6501('0x3e')),util[_0x6501('0x46')](_0x42f50f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6501('0x47'));})[_0x6501('0x48')](function(){process[_0x6501('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x312fca=new PdfPrinter({'Arial':{'normal':__dirname+_0x6501('0x4a'),'bold':__dirname+_0x6501('0x4b'),'italics':__dirname+_0x6501('0x4c'),'bolditalics':__dirname+_0x6501('0x4d')}});return _0x312fca;}function getPDFDocDefinitionFromHTML(_0x54f578,_0x553d21){var _0x300755=util[_0x6501('0x19')](_0x6501('0x4e'),_0x553d21[_0x6501('0x4f')],_0x553d21[_0x6501('0x50')]);var _0x25ff26=moment()[_0x6501('0x19')](_0x6501('0x51'))[_0x6501('0x52')]();var _0x4a55de=htmlToPdfmake(_0x54f578,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4a55de],'defaultStyle':{'font':_0x6501('0x53')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x6501('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x6501('0x54')}},'header':function(){return[{'text':_0x6501('0x55'),'style':_0x6501('0x1e')}];},'footer':function(_0x42ad6a,_0x38ca49){return[{'text':util[_0x6501('0x19')](_0x6501('0x56'),_0x300755,_0x42ad6a,_0x38ca49,_0x25ff26),'style':_0x6501('0x23')}];}};}function writePDFDocument(_0x584541,_0x2aa421){return new Promise(function(_0x1c44bb,_0x4daa8a){var _0x608a=_0x584541[_0x6501('0x57')](fs[_0x6501('0x58')](_0x2aa421));_0x608a['on'](_0x6501('0x59'),function(){_0x1c44bb(_0x6501('0x59'));});_0x608a['on'](_0x6501('0x5a'),function(_0x166e63){_0x4daa8a(_0x166e63);});_0x584541[_0x6501('0x5b')]();});}exports[_0x6501('0x5c')]=function(_0x33f90d,_0x25c978){var _0x5156db=getPDFPrinter();var _0x2c61ba=getPDFDocDefinitionFromHTML(_0x33f90d,_0x25c978);var _0x37b3e3=_0x5156db[_0x6501('0x37')](_0x2c61ba);return writePDFDocument(_0x37b3e3,_0x25c978[_0x6501('0x2')])['catch'](function(_0x3d78c1){throw _0x3d78c1;});};
\ No newline at end of file
index ede7546..098bbd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1319=['Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','split','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x1e3c2a,_0x33acf3){var _0x10fa0c=function(_0x798e09){while(--_0x798e09){_0x1e3c2a['push'](_0x1e3c2a['shift']());}};_0x10fa0c(++_0x33acf3);}(_0x1319,0x143));var _0x9131=function(_0x2134b7,_0x1eb5e2){_0x2134b7=_0x2134b7-0x0;var _0x6c5914=_0x1319[_0x2134b7];return _0x6c5914;};'use strict';var util=require(_0x9131('0x0'));var path=require(_0x9131('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x9131('0x2'));var BPromise=require(_0x9131('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x9131('0x4'));var db=require(_0x9131('0x5'))['db'];var dbH=require(_0x9131('0x5'))[_0x9131('0x6')];var logger=require(_0x9131('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x9131('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x138ea0,_0x42ee68){var _0x5eb0b6={'status':_0x138ea0};var _0x1a5785={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x42ee68){_0x5eb0b6[_0x9131('0x9')]=_0x42ee68;}return db[_0x9131('0xa')][_0x9131('0xb')](_0x5eb0b6,_0x1a5785);}function main(){var _0x5f5752=0x1388;var _0x3ea797;logger[_0x9131('0xc')](util['format'](_0x9131('0xd'),EXTRACTED_REPORT_ID,_0x9131('0xe')));return db[_0x9131('0xf')][_0x9131('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x9131('0x11')](function(_0x4210ca){if(_0x4210ca){_0x3ea797=_0x4210ca;_0x5f5752=_0x3ea797['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH['sequelize'][_0x9131('0x12')](util[_0x9131('0x13')](_0x9131('0x14'),QUERY),{'type':dbH[_0x9131('0x15')][_0x9131('0x16')][_0x9131('0x17')]});})[_0x9131('0x11')](function(_0x1390e7){if(!_0x1390e7[0x0][_0x9131('0x18')]){return analyticExtractedReport('Empty');}var _0x2c8d7b=[];var _0x5d811c=0x0;if(_0x3ea797['split']){if(_0x1390e7&&_0x1390e7[_0x9131('0x19')]){var _0x55aff7=_['range'](_0x1390e7[0x0][_0x9131('0x18')]/_0x5f5752);var _0x4c8dcd=Number[_0x9131('0x1a')](_0x1390e7[0x0]['num']/_0x5f5752)?_0x1390e7[0x0]['num']%_0x5f5752:0x0;_0x55aff7['forEach'](function(_0x17b640){if(_0x17b640>0x0){_0x5d811c+=_0x5f5752;}_0x2c8d7b[_0x9131('0x1b')](dbH[_0x9131('0x15')][_0x9131('0x12')](util[_0x9131('0x13')](_0x9131('0x1c'),QUERY,_0x5f5752,_0x5d811c),{'type':dbH[_0x9131('0x15')][_0x9131('0x16')]['SELECT']}));});if(_0x4c8dcd>0x0){_0x5d811c+=_0x5f5752;_0x2c8d7b[_0x9131('0x1b')](dbH[_0x9131('0x15')][_0x9131('0x12')](util['format'](_0x9131('0x1c'),QUERY,_0x4c8dcd,_0x5d811c),{'type':dbH[_0x9131('0x15')][_0x9131('0x16')][_0x9131('0x17')]}));}}}else{_0x2c8d7b[_0x9131('0x1b')](dbH[_0x9131('0x15')][_0x9131('0x12')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0x9131('0x17')]}));}var _0x108dac=path['dirname'](PATH);var _0x3d7bcb=path[_0x9131('0x1d')](PATH,'.xlsx');var _0x50a229=_0x3ea797[_0x9131('0x1e')]&&_0x2c8d7b[_0x9131('0x19')]>0x1;var _0x4c4806=[];if(!fs['existsSync'](path[_0x9131('0x1f')](_0x108dac,_0x3d7bcb))&&_0x50a229){fs[_0x9131('0x20')](path[_0x9131('0x1f')](_0x108dac,_0x3d7bcb));}return BPromise[_0x9131('0x21')](_0x2c8d7b,function(_0x73607e){_0x4c4806[_0x9131('0x1b')](_0x73607e);})['then'](function(){for(var _0x14b3e0=0x0;_0x14b3e0<_0x4c4806['length'];_0x14b3e0+=0x1){var _0x1f7b6e;var _0x278d05=_0x4c4806[_0x14b3e0];if(_0x50a229){_0x1f7b6e=path[_0x9131('0x1f')](_0x108dac,_0x3d7bcb,util[_0x9131('0x13')](_0x9131('0x22'),_0x3d7bcb,_0x14b3e0,_0x9131('0x23')));}else{_0x1f7b6e=path['join'](_0x108dac,util[_0x9131('0x13')](_0x9131('0x24'),_0x3d7bcb,_0x9131('0x23')));}fs['writeFileSync'](_0x1f7b6e,json2xls(_0x278d05),_0x9131('0x25'));}})[_0x9131('0x11')](function(){if(_0x50a229){return new Promise(function(_0x3650be){zipdir(path[_0x9131('0x1f')](_0x108dac,_0x3d7bcb),{'saveTo':path[_0x9131('0x1f')](_0x108dac,util[_0x9131('0x13')]('%s.%s',_0x3d7bcb,_0x9131('0x26')))},function(_0x1edfc4,_0x56a8e8){rimraf(path[_0x9131('0x1f')](_0x108dac,_0x3d7bcb),function(){});_0x3650be(_0x9131('0x27'));});});}})[_0x9131('0x11')](function(){logger[_0x9131('0xc')](util['format'](_0x9131('0x28'),EXTRACTED_REPORT_ID,_0x9131('0xe')));return analyticExtractedReport(_0x9131('0x29'),_0x50a229?util[_0x9131('0x13')](_0x9131('0x24'),_0x3d7bcb,_0x50a229?_0x9131('0x26'):'xlsx'):null);});})[_0x9131('0x2a')](function(_0x123fd0){logger[_0x9131('0xc')](util[_0x9131('0x13')](_0x9131('0x2b'),EXTRACTED_REPORT_ID,_0x9131('0xe')),util[_0x9131('0x2c')](_0x123fd0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9131('0x2d'));})[_0x9131('0x2e')](function(){process[_0x9131('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x6f0b=['inspect','Failed','finally','exit','lodash','json2xls','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','length','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x37b999,_0x10aa46){var _0x20db5d=function(_0x392571){while(--_0x392571){_0x37b999['push'](_0x37b999['shift']());}};_0x20db5d(++_0x10aa46);}(_0x6f0b,0xf4));var _0xb6f0=function(_0x42baa8,_0x3a25dd){_0x42baa8=_0x42baa8-0x0;var _0x3d3cdb=_0x6f0b[_0x42baa8];return _0x3d3cdb;};'use strict';var util=require('util');var path=require('path');var _=require(_0xb6f0('0x0'));var fs=require('fs');var json2xls=require(_0xb6f0('0x1'));var BPromise=require('bluebird');var zipdir=require(_0xb6f0('0x2'));var rimraf=require(_0xb6f0('0x3'));var db=require(_0xb6f0('0x4'))['db'];var dbH=require(_0xb6f0('0x4'))[_0xb6f0('0x5')];var logger=require(_0xb6f0('0x6'))(_0xb6f0('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xb6f0('0x8')][0x2]);var QUERY=process[_0xb6f0('0x8')][0x3];var PATH=process[_0xb6f0('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x263695,_0xbf4ca6){var _0x1e6f11={'status':_0x263695};var _0x2ef98a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xbf4ca6){_0x1e6f11['savename']=_0xbf4ca6;}return db[_0xb6f0('0x9')][_0xb6f0('0xa')](_0x1e6f11,_0x2ef98a);}function main(){var _0x34eed9=0x1388;var _0x1b94df;logger[_0xb6f0('0xb')](util[_0xb6f0('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb6f0('0xd')));return db['Setting'][_0xb6f0('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb6f0('0xf'),_0xb6f0('0x10')]})[_0xb6f0('0x11')](function(_0xcdfa87){if(_0xcdfa87){_0x1b94df=_0xcdfa87;_0x34eed9=_0x1b94df[_0xb6f0('0x10')]||0x1388;}})[_0xb6f0('0x11')](function(){return dbH[_0xb6f0('0x12')][_0xb6f0('0x13')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xb6f0('0x12')][_0xb6f0('0x14')][_0xb6f0('0x15')]});})[_0xb6f0('0x11')](function(_0x5808d0){if(!_0x5808d0[0x0][_0xb6f0('0x16')]){return analyticExtractedReport(_0xb6f0('0x17'));}var _0x2a02e5=[];var _0x58bae5=0x0;if(_0x1b94df[_0xb6f0('0xf')]){if(_0x5808d0&&_0x5808d0['length']){var _0xf2d506=_[_0xb6f0('0x18')](_0x5808d0[0x0][_0xb6f0('0x16')]/_0x34eed9);var _0x3a03b3=Number['isInteger'](_0x5808d0[0x0][_0xb6f0('0x16')]/_0x34eed9)?_0x5808d0[0x0][_0xb6f0('0x16')]%_0x34eed9:0x0;_0xf2d506[_0xb6f0('0x19')](function(_0x5b2e1e){if(_0x5b2e1e>0x0){_0x58bae5+=_0x34eed9;}_0x2a02e5[_0xb6f0('0x1a')](dbH[_0xb6f0('0x12')][_0xb6f0('0x13')](util[_0xb6f0('0xc')](_0xb6f0('0x1b'),QUERY,_0x34eed9,_0x58bae5),{'type':dbH[_0xb6f0('0x12')][_0xb6f0('0x14')][_0xb6f0('0x15')]}));});if(_0x3a03b3>0x0){_0x58bae5+=_0x34eed9;_0x2a02e5[_0xb6f0('0x1a')](dbH['sequelize'][_0xb6f0('0x13')](util[_0xb6f0('0xc')](_0xb6f0('0x1b'),QUERY,_0x3a03b3,_0x58bae5),{'type':dbH[_0xb6f0('0x12')][_0xb6f0('0x14')][_0xb6f0('0x15')]}));}}}else{_0x2a02e5[_0xb6f0('0x1a')](dbH[_0xb6f0('0x12')]['query'](QUERY,{'type':dbH['sequelize'][_0xb6f0('0x14')][_0xb6f0('0x15')]}));}var _0x19be7b=path[_0xb6f0('0x1c')](PATH);var _0x31dbb4=path[_0xb6f0('0x1d')](PATH,'.xlsx');var _0x5e4a95=_0x1b94df[_0xb6f0('0xf')]&&_0x2a02e5[_0xb6f0('0x1e')]>0x1;var _0x1db1a8=[];if(!fs['existsSync'](path[_0xb6f0('0x1f')](_0x19be7b,_0x31dbb4))&&_0x5e4a95){fs[_0xb6f0('0x20')](path['join'](_0x19be7b,_0x31dbb4));}return BPromise[_0xb6f0('0x21')](_0x2a02e5,function(_0x5a977f){_0x1db1a8['push'](_0x5a977f);})[_0xb6f0('0x11')](function(){for(var _0x16d8b3=0x0;_0x16d8b3<_0x1db1a8[_0xb6f0('0x1e')];_0x16d8b3+=0x1){var _0x4d57d9;var _0x380610=_0x1db1a8[_0x16d8b3];if(_0x5e4a95){_0x4d57d9=path[_0xb6f0('0x1f')](_0x19be7b,_0x31dbb4,util['format'](_0xb6f0('0x22'),_0x31dbb4,_0x16d8b3,_0xb6f0('0x23')));}else{_0x4d57d9=path[_0xb6f0('0x1f')](_0x19be7b,util[_0xb6f0('0xc')](_0xb6f0('0x24'),_0x31dbb4,_0xb6f0('0x23')));}fs[_0xb6f0('0x25')](_0x4d57d9,json2xls(_0x380610),_0xb6f0('0x26'));}})[_0xb6f0('0x11')](function(){if(_0x5e4a95){return new Promise(function(_0x107c3b){zipdir(path['join'](_0x19be7b,_0x31dbb4),{'saveTo':path[_0xb6f0('0x1f')](_0x19be7b,util[_0xb6f0('0xc')](_0xb6f0('0x24'),_0x31dbb4,_0xb6f0('0x27')))},function(_0x2fee15,_0x6dc18){rimraf(path['join'](_0x19be7b,_0x31dbb4),function(){});_0x107c3b('zip\x20finished');});});}})[_0xb6f0('0x11')](function(){logger['info'](util[_0xb6f0('0xc')](_0xb6f0('0x28'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xb6f0('0x29'),_0x5e4a95?util['format'](_0xb6f0('0x24'),_0x31dbb4,_0x5e4a95?_0xb6f0('0x27'):'xlsx'):null);});})[_0xb6f0('0x2a')](function(_0x50be41){logger['info'](util[_0xb6f0('0xc')](_0xb6f0('0x2b'),EXTRACTED_REPORT_ID,_0xb6f0('0xd')),util[_0xb6f0('0x2c')](_0x50be41,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb6f0('0x2d'));})[_0xb6f0('0x2e')](function(){process[_0xb6f0('0x2f')](EXIT_CODE);});}main();
\ No newline at end of file
index 9b58fe7..c344c58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e5=['sortBy','error','rewrite','lodash','models','Interval','findAll','then','intervals','IntervalId','VoiceExtension','uniq','map','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(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','app','appType','custom','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','concat','bulkCreate'];(function(_0x1f37e1,_0x1b42ea){var _0x329f45=function(_0x1fa98c){while(--_0x1fa98c){_0x1f37e1['push'](_0x1f37e1['shift']());}};_0x329f45(++_0x1b42ea);}(_0xb6e5,0x15c));var _0x5b6e=function(_0x597d03,_0x5e9180){_0x597d03=_0x597d03-0x0;var _0x4ead92=_0xb6e5[_0x597d03];return _0x4ead92;};'use strict';var _=require(_0x5b6e('0x0'));var util=require('util');function rewrite(_0x5884d5,_0x267f2b){var _0x3e2d97=this;return _0x5884d5[_0x5b6e('0x1')][_0x5b6e('0x2')][_0x5b6e('0x3')]({'raw':!![]})[_0x5b6e('0x4')](function(_0x4c9c28){_0x3e2d97[_0x5b6e('0x5')]=_0x4c9c28;return _0x5884d5[_0x5b6e('0x1')]['VoiceExtension'][_0x5b6e('0x3')]({'where':{'IntervalId':_0x267f2b[_0x5b6e('0x6')]},'raw':!![]});})[_0x5b6e('0x4')](function(_0x5519e9){return _0x5884d5[_0x5b6e('0x1')][_0x5b6e('0x7')]['findAll']({'where':{'exten':{'$in':_[_0x5b6e('0x8')](_[_0x5b6e('0x9')](_0x5519e9,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x256faf){var _0x5e5475=_[_0x5b6e('0xa')](_0x256faf,{'priority':'1'});var _0x121cd9=_[_0x5b6e('0xa')](_0x256faf,{'isApp':0x1});var _0x24508a=_[_0x5b6e('0xb')](_0x121cd9,_0x5b6e('0xc'));var _0x14fb3c=[_0x5b6e('0xd'),_0x5b6e('0xe')];var _0x3358bc=[];var _0x3ff474=[];for(var _0x228cd6 in _0x24508a){if(_0x24508a[_0x5b6e('0xf')](_0x228cd6)){_0x3e2d97[_0x5b6e('0x10')]=0x2;_0x3e2d97[_0x5b6e('0x11')]=[];_0x3e2d97[_0x5b6e('0x12')]=_[_0x5b6e('0x13')](_0x5e5475,{'exten':_0x24508a[_0x228cd6][0x0]['exten']});_0x3e2d97['extensions'][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0]['type'],'app':_0x5b6e('0x15'),'appdata':util[_0x5b6e('0x16')](_0x5b6e('0x17'),_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')]),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});if(_0x24508a[_0x228cd6][0x0]['type']===_0x5b6e('0x1b')){_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0]['type'],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x1c')+_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')],'context':_0x24508a[_0x228cd6][0x0]['context'],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97['priority']++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});}else if(_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')]===_0x5b6e('0x1d')){if(_0x3e2d97['extension']){_0x3e2d97['extensions'][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x1e')+(_0x3e2d97['extension']['cutdigits']?_0x5b6e('0x1f')+_0x3e2d97[_0x5b6e('0x12')][_0x5b6e('0x20')]+'}':'${EXTEN}'),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});}_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':'Set','appdata':_0x5b6e('0x1c')+_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')],'context':_0x24508a[_0x228cd6][0x0]['context'],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97['priority']++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});var _0x16183d=_0x3e2d97[_0x5b6e('0x10')]++;_0x3e2d97['extensions'][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x21'),'appdata':_0x5b6e('0x22')+(_0x16183d+0x2)+_0x5b6e('0x23')+(_0x16183d+0x1)+')','context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x16183d,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});if(_0x3e2d97['extension']){_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x3e2d97[_0x5b6e('0x12')]['cutdigits']?_0x5b6e('0x24')+_0x3e2d97['extension'][_0x5b6e('0x20')]+'}':_0x5b6e('0x25'),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97['priority']++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0]['VoiceExtensionId']});}_0x3e2d97[_0x5b6e('0x11')]['push']({'type':_0x24508a[_0x228cd6][0x0]['type'],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x26')+_0x24508a[_0x228cd6][0x0]['VoiceExtensionId'],'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0]['VoiceExtensionId']});if(_0x3e2d97['extension']&&_0x3e2d97[_0x5b6e('0x12')]['hasOwnProperty'](_0x5b6e('0x27'))&&_0x3e2d97[_0x5b6e('0x12')][_0x5b6e('0x27')]!==_0x5b6e('0x28')){_0x3e2d97[_0x5b6e('0x11')]['push']({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x29'),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});_0x3e2d97[_0x5b6e('0x11')]['push']({'type':_0x24508a[_0x228cd6][0x0]['type'],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x2a')+_0x3e2d97[_0x5b6e('0x12')][_0x5b6e('0x27')]||_0x5b6e('0x2b'),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});}}_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x3e2d97['priority']++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0]['exten'],'priority':_0x3e2d97[_0x5b6e('0x10')]++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0]['VoiceExtensionId']});_0x3e2d97[_0x5b6e('0x11')]['push']({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x2c'),'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'priority':_0x3e2d97['priority']++,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0]['VoiceExtensionId']});for(var _0x28b087=0x0,_0x160850=0x0;_0x28b087<_0x24508a[_0x228cd6]['length'];_0x28b087+=0x1,_0x160850=0x0){var _0x521734=_0x24508a[_0x228cd6][_0x28b087];if(_0x521734[_0x5b6e('0x18')]){_0x521734['type']=_0x521734[_0x5b6e('0x18')][_0x5b6e('0x2d')]();}var _0x11013c=[];var _0x20c0b6=[];delete _0x521734['id'];delete _0x521734[_0x5b6e('0x2e')];delete _0x521734[_0x5b6e('0x2f')];var _0x1fb10b=_0x521734[_0x5b6e('0x30')]!==_0x5b6e('0x31')?[_0x521734[_0x5b6e('0x30')]]:_0x521734[_0x5b6e('0x6')]?_[_0x5b6e('0x9')](_[_0x5b6e('0xa')](_0x3e2d97['intervals'],{'IntervalId':_0x521734[_0x5b6e('0x6')]}),_0x5b6e('0x30')):[];if(_0x521734[_0x5b6e('0xf')](_0x5b6e('0x32'))){if(_0x521734[_0x5b6e('0x32')]&&_0x521734[_0x5b6e('0x32')]!=='--'){_0x11013c['push']({'type':_0x521734[_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x33')+_0x521734[_0x5b6e('0x32')],'context':_0x521734[_0x5b6e('0x19')],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97[_0x5b6e('0x10')]+_0x160850++,'VoiceExtensionId':_0x521734['VoiceExtensionId']});}}if(_0x521734[_0x5b6e('0x18')]===_0x5b6e('0x1d')&&_0x521734[_0x5b6e('0xf')](_0x5b6e('0x35'))){if(_0x521734[_0x5b6e('0x35')]){_0x11013c[_0x5b6e('0x14')]({'type':_0x521734['type'],'app':_0x5b6e('0x21'),'appdata':_0x5b6e('0x36')+_0x521734[_0x5b6e('0x35')]+')','context':_0x521734[_0x5b6e('0x19')],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97[_0x5b6e('0x10')]+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});}else{_0x11013c[_0x5b6e('0x14')]({'type':_0x521734[_0x5b6e('0x18')],'app':_0x5b6e('0x21'),'appdata':_0x5b6e('0x37'),'context':_0x521734[_0x5b6e('0x19')],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97[_0x5b6e('0x10')]+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});}}if(_0x521734[_0x5b6e('0xf')](_0x5b6e('0x38'))){if(_0x14fb3c['indexOf'](_0x521734[_0x5b6e('0x39')][_0x5b6e('0x2d')]())>=0x0&&_0x521734[_0x5b6e('0x3a')]!==_0x5b6e('0x3b')){if(_0x521734['answer']){_0x11013c['push']({'type':_0x521734[_0x5b6e('0x18')],'app':_0x5b6e('0x21'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x521734['context'],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97[_0x5b6e('0x10')]+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});_0x11013c[_0x5b6e('0x14')]({'type':_0x521734[_0x5b6e('0x18')],'app':'Set','appdata':_0x5b6e('0x3c'),'context':_0x521734['context'],'exten':_0x521734['exten'],'priority':_0x1fb10b['length']+_0x3e2d97['priority']+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});}else{_0x11013c[_0x5b6e('0x14')]({'type':_0x521734[_0x5b6e('0x18')],'app':_0x5b6e('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x521734[_0x5b6e('0x19')],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97['priority']+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});_0x11013c[_0x5b6e('0x14')]({'type':_0x521734[_0x5b6e('0x18')],'app':_0x5b6e('0x15'),'appdata':_0x5b6e('0x3d'),'context':_0x521734[_0x5b6e('0x19')],'exten':_0x521734[_0x5b6e('0xc')],'priority':_0x1fb10b[_0x5b6e('0x34')]+_0x3e2d97[_0x5b6e('0x10')]+_0x160850++,'VoiceExtensionId':_0x521734[_0x5b6e('0x1a')]});}}}for(var _0x17d8cf=0x0;_0x17d8cf<_0x1fb10b[_0x5b6e('0x34')];_0x17d8cf+=0x1){var _0x48944f=_0x3e2d97['priority']+_0x1fb10b['length'];var _0x36c33d=_0x17d8cf===_0x1fb10b[_0x5b6e('0x34')]-0x1?_0x3e2d97[_0x5b6e('0x10')]+_0x11013c['length']+_0x20c0b6[_0x5b6e('0x34')]+0x2:_0x3e2d97[_0x5b6e('0x10')]+_0x17d8cf+0x1;_0x11013c[_0x5b6e('0x3e')](_0x17d8cf,0x0,{'type':_0x521734['type'],'app':'GotoIfTime','appdata':_0x1fb10b[_0x17d8cf]+'?'+_0x521734[_0x5b6e('0x19')]+_0x5b6e('0x3f')+_0x48944f+':'+_0x521734['context']+_0x5b6e('0x3f')+_0x36c33d,'exten':_0x521734[_0x5b6e('0xc')],'context':_0x521734['context'],'priority':_0x3e2d97[_0x5b6e('0x10')]+_0x17d8cf,'VoiceExtensionId':_0x24508a[_0x228cd6][0x0]['VoiceExtensionId']});}_0x521734[_0x5b6e('0x10')]=_0x11013c[_0x5b6e('0x34')]?_['last'](_0x11013c)[_0x5b6e('0x10')]+0x1:_0x3e2d97[_0x5b6e('0x10')];_0x3e2d97[_0x5b6e('0x10')]=(_0x20c0b6[_0x5b6e('0x34')]?_['last'](_0x20c0b6)['priority']:_0x521734[_0x5b6e('0x10')])+0x1;_0x3e2d97[_0x5b6e('0x11')]=_[_0x5b6e('0x40')](_0x3e2d97['extensions'],_0x11013c,[_0x521734],_0x20c0b6);}_0x3e2d97[_0x5b6e('0x11')][_0x5b6e('0x14')]({'type':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x18')],'app':'Hangup','exten':_0x24508a[_0x228cd6][0x0][_0x5b6e('0xc')],'context':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x19')],'priority':_0x3e2d97[_0x5b6e('0x10')],'VoiceExtensionId':_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]});_0x3358bc[_0x5b6e('0x14')](_0x24508a[_0x228cd6][0x0][_0x5b6e('0x1a')]);_0x3ff474=_['concat'](_0x3ff474,_0x3e2d97[_0x5b6e('0x11')]);}}return _0x5884d5['transaction'](function(_0x784b4e){return _0x5884d5[_0x5b6e('0x1')][_0x5b6e('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x3358bc}},'transaction':_0x784b4e})[_0x5b6e('0x4')](function(_0xebf8d7){return _0x5884d5[_0x5b6e('0x1')][_0x5b6e('0x7')][_0x5b6e('0x41')](_[_0x5b6e('0x42')](_0x3ff474,'priority'),{'transaction':_0x784b4e});});});})['catch'](function(_0x30d67d){console[_0x5b6e('0x43')](_0x30d67d);});}exports[_0x5b6e('0x44')]=rewrite;
\ No newline at end of file
+var _0x59ea=['XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','groupBy','hasOwnProperty','extensions','find','push','type','Set','context','priority','inbound','VoiceExtensionId','outbound','extension','CDR(destination)=','cutdigits','${EXTEN}','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','IntervalId','intervals','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x23f948,_0x528caf){var _0x1ca643=function(_0x14e9d8){while(--_0x14e9d8){_0x23f948['push'](_0x23f948['shift']());}};_0x1ca643(++_0x528caf);}(_0x59ea,0x12a));var _0xa59e=function(_0x14d526,_0x5aae50){_0x14d526=_0x14d526-0x0;var _0xe4bdf3=_0x59ea[_0x14d526];return _0xe4bdf3;};'use strict';var _=require(_0xa59e('0x0'));var util=require(_0xa59e('0x1'));function rewrite(_0x108310,_0x472282){var _0x5c2092=this;return _0x108310[_0xa59e('0x2')][_0xa59e('0x3')][_0xa59e('0x4')]({'raw':!![]})[_0xa59e('0x5')](function(_0x83cfa8){_0x5c2092['intervals']=_0x83cfa8;return _0x108310[_0xa59e('0x2')]['VoiceExtension'][_0xa59e('0x4')]({'where':{'IntervalId':_0x472282['IntervalId']},'raw':!![]});})[_0xa59e('0x5')](function(_0x1563e4){return _0x108310[_0xa59e('0x2')][_0xa59e('0x6')][_0xa59e('0x4')]({'where':{'exten':{'$in':_[_0xa59e('0x7')](_[_0xa59e('0x8')](_0x1563e4,_0xa59e('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xa59e('0x5')](function(_0x332307){var _0x184f03=_[_0xa59e('0xa')](_0x332307,{'priority':'1'});var _0x2256a3=_[_0xa59e('0xa')](_0x332307,{'isApp':0x1});var _0x1dd374=_[_0xa59e('0xb')](_0x2256a3,'exten');var _0x1811a0=['queue','playback'];var _0x25e42b=[];var _0x697b34=[];for(var _0x43c3e1 in _0x1dd374){if(_0x1dd374[_0xa59e('0xc')](_0x43c3e1)){_0x5c2092['priority']=0x2;_0x5c2092[_0xa59e('0xd')]=[];_0x5c2092['extension']=_[_0xa59e('0xe')](_0x184f03,{'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')]});_0x5c2092['extensions'][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':util['format']('CDR(type)=%s',_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')]),'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0]['VoiceExtensionId']});if(_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')]===_0xa59e('0x14')){_0x5c2092[_0xa59e('0xd')]['push']({'type':_0x1dd374[_0x43c3e1][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x1dd374[_0x43c3e1][0x0]['VoiceExtensionId'],'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0]['exten'],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});}else if(_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')]===_0xa59e('0x16')){if(_0x5c2092[_0xa59e('0x17')]){_0x5c2092[_0xa59e('0xd')]['push']({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x18')+(_0x5c2092[_0xa59e('0x17')][_0xa59e('0x19')]?'${EXTEN:'+_0x5c2092[_0xa59e('0x17')][_0xa59e('0x19')]+'}':_0xa59e('0x1a')),'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});}_0x5c2092['extensions']['push']({'type':_0x1dd374[_0x43c3e1][0x0]['type'],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x1b')+_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')],'context':_0x1dd374[_0x43c3e1][0x0]['context'],'exten':_0x1dd374[_0x43c3e1][0x0]['exten'],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});var _0x432abe=_0x5c2092[_0xa59e('0x13')]++;_0x5c2092[_0xa59e('0xd')]['push']({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x1c'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x432abe+0x2)+_0xa59e('0x1d')+(_0x432abe+0x1)+')','context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0]['exten'],'priority':_0x432abe,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});if(_0x5c2092[_0xa59e('0x17')]){_0x5c2092[_0xa59e('0xd')][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':_0x5c2092['extension'][_0xa59e('0x19')]?_0xa59e('0x1e')+_0x5c2092['extension'][_0xa59e('0x19')]+'}':_0xa59e('0x1f'),'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});}_0x5c2092[_0xa59e('0xd')][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0]['type'],'app':'Set','appdata':_0xa59e('0x20')+_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')],'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});if(_0x5c2092[_0xa59e('0x17')]&&_0x5c2092[_0xa59e('0x17')][_0xa59e('0xc')]('recordingFormat')&&_0x5c2092[_0xa59e('0x17')][_0xa59e('0x21')]!==_0xa59e('0x22')){_0x5c2092[_0xa59e('0xd')]['push']({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':'Set','appdata':_0xa59e('0x23'),'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092['priority']++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});_0x5c2092[_0xa59e('0xd')][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0]['type'],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x24')+_0x5c2092[_0xa59e('0x17')]['recordingFormat']||_0xa59e('0x25'),'context':_0x1dd374[_0x43c3e1][0x0]['context'],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});}}_0x5c2092[_0xa59e('0xd')][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x26'),'context':_0x1dd374[_0x43c3e1][0x0]['context'],'exten':_0x1dd374[_0x43c3e1][0x0]['exten'],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});_0x5c2092['extensions'][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x27'),'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092[_0xa59e('0x13')]++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0]['VoiceExtensionId']});_0x5c2092[_0xa59e('0xd')][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'priority':_0x5c2092['priority']++,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});for(var _0x5eabbb=0x0,_0x2bacd9=0x0;_0x5eabbb<_0x1dd374[_0x43c3e1][_0xa59e('0x28')];_0x5eabbb+=0x1,_0x2bacd9=0x0){var _0x28395e=_0x1dd374[_0x43c3e1][_0x5eabbb];if(_0x28395e['type']){_0x28395e[_0xa59e('0x10')]=_0x28395e['type'][_0xa59e('0x29')]();}var _0xbc89f3=[];var _0x1cb6ff=[];delete _0x28395e['id'];delete _0x28395e[_0xa59e('0x2a')];delete _0x28395e[_0xa59e('0x2b')];var _0x1651de=_0x28395e[_0xa59e('0x2c')]!=='*,*,*,*'?[_0x28395e[_0xa59e('0x2c')]]:_0x28395e[_0xa59e('0x2d')]?_[_0xa59e('0x8')](_[_0xa59e('0xa')](_0x5c2092[_0xa59e('0x2e')],{'IntervalId':_0x28395e[_0xa59e('0x2d')]}),_0xa59e('0x2c')):[];if(_0x28395e[_0xa59e('0xc')](_0xa59e('0x2f'))){if(_0x28395e['tag']&&_0x28395e[_0xa59e('0x2f')]!=='--'){_0xbc89f3['push']({'type':_0x28395e[_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':'CDR(tag)='+_0x28395e['tag'],'context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de[_0xa59e('0x28')]+_0x5c2092['priority']+_0x2bacd9++,'VoiceExtensionId':_0x28395e[_0xa59e('0x15')]});}}if(_0x28395e['type']===_0xa59e('0x16')&&_0x28395e[_0xa59e('0xc')]('callerID')){if(_0x28395e[_0xa59e('0x30')]){_0xbc89f3['push']({'type':_0x28395e['type'],'app':_0xa59e('0x1c'),'appdata':_0xa59e('0x31')+_0x28395e['callerID']+')','context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de[_0xa59e('0x28')]+_0x5c2092['priority']+_0x2bacd9++,'VoiceExtensionId':_0x28395e[_0xa59e('0x15')]});}else{_0xbc89f3['push']({'type':_0x28395e[_0xa59e('0x10')],'app':_0xa59e('0x1c'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de[_0xa59e('0x28')]+_0x5c2092['priority']+_0x2bacd9++,'VoiceExtensionId':_0x28395e['VoiceExtensionId']});}}if(_0x28395e['hasOwnProperty']('answer')){if(_0x1811a0[_0xa59e('0x32')](_0x28395e[_0xa59e('0x33')]['toLowerCase']())>=0x0&&_0x28395e[_0xa59e('0x34')]!==_0xa59e('0x35')){if(_0x28395e[_0xa59e('0x36')]){_0xbc89f3[_0xa59e('0xf')]({'type':_0x28395e[_0xa59e('0x10')],'app':_0xa59e('0x1c'),'appdata':_0xa59e('0x37'),'context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de['length']+_0x5c2092[_0xa59e('0x13')]+_0x2bacd9++,'VoiceExtensionId':_0x28395e[_0xa59e('0x15')]});_0xbc89f3[_0xa59e('0xf')]({'type':_0x28395e[_0xa59e('0x10')],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x38'),'context':_0x28395e['context'],'exten':_0x28395e['exten'],'priority':_0x1651de['length']+_0x5c2092[_0xa59e('0x13')]+_0x2bacd9++,'VoiceExtensionId':_0x28395e[_0xa59e('0x15')]});}else{_0xbc89f3['push']({'type':_0x28395e['type'],'app':_0xa59e('0x1c'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de[_0xa59e('0x28')]+_0x5c2092[_0xa59e('0x13')]+_0x2bacd9++,'VoiceExtensionId':_0x28395e[_0xa59e('0x15')]});_0xbc89f3[_0xa59e('0xf')]({'type':_0x28395e['type'],'app':_0xa59e('0x11'),'appdata':_0xa59e('0x39'),'context':_0x28395e[_0xa59e('0x12')],'exten':_0x28395e[_0xa59e('0x9')],'priority':_0x1651de[_0xa59e('0x28')]+_0x5c2092[_0xa59e('0x13')]+_0x2bacd9++,'VoiceExtensionId':_0x28395e['VoiceExtensionId']});}}}for(var _0x53fa2e=0x0;_0x53fa2e<_0x1651de[_0xa59e('0x28')];_0x53fa2e+=0x1){var _0x2e1813=_0x5c2092['priority']+_0x1651de[_0xa59e('0x28')];var _0x6fe3f=_0x53fa2e===_0x1651de[_0xa59e('0x28')]-0x1?_0x5c2092['priority']+_0xbc89f3[_0xa59e('0x28')]+_0x1cb6ff[_0xa59e('0x28')]+0x2:_0x5c2092[_0xa59e('0x13')]+_0x53fa2e+0x1;_0xbc89f3[_0xa59e('0x3a')](_0x53fa2e,0x0,{'type':_0x28395e[_0xa59e('0x10')],'app':_0xa59e('0x3b'),'appdata':_0x1651de[_0x53fa2e]+'?'+_0x28395e['context']+_0xa59e('0x3c')+_0x2e1813+':'+_0x28395e['context']+_0xa59e('0x3c')+_0x6fe3f,'exten':_0x28395e[_0xa59e('0x9')],'context':_0x28395e['context'],'priority':_0x5c2092[_0xa59e('0x13')]+_0x53fa2e,'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x15')]});}_0x28395e[_0xa59e('0x13')]=_0xbc89f3[_0xa59e('0x28')]?_[_0xa59e('0x3d')](_0xbc89f3)[_0xa59e('0x13')]+0x1:_0x5c2092[_0xa59e('0x13')];_0x5c2092[_0xa59e('0x13')]=(_0x1cb6ff[_0xa59e('0x28')]?_[_0xa59e('0x3d')](_0x1cb6ff)[_0xa59e('0x13')]:_0x28395e[_0xa59e('0x13')])+0x1;_0x5c2092['extensions']=_[_0xa59e('0x3e')](_0x5c2092['extensions'],_0xbc89f3,[_0x28395e],_0x1cb6ff);}_0x5c2092['extensions'][_0xa59e('0xf')]({'type':_0x1dd374[_0x43c3e1][0x0]['type'],'app':_0xa59e('0x3f'),'exten':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x9')],'context':_0x1dd374[_0x43c3e1][0x0][_0xa59e('0x12')],'priority':_0x5c2092[_0xa59e('0x13')],'VoiceExtensionId':_0x1dd374[_0x43c3e1][0x0]['VoiceExtensionId']});_0x25e42b[_0xa59e('0xf')](_0x1dd374[_0x43c3e1][0x0]['VoiceExtensionId']);_0x697b34=_['concat'](_0x697b34,_0x5c2092[_0xa59e('0xd')]);}}return _0x108310[_0xa59e('0x40')](function(_0x25657a){return _0x108310[_0xa59e('0x2')][_0xa59e('0x6')][_0xa59e('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x25e42b}},'transaction':_0x25657a})['then'](function(_0x4a3420){return _0x108310['models'][_0xa59e('0x6')][_0xa59e('0x42')](_[_0xa59e('0x43')](_0x697b34,'priority'),{'transaction':_0x25657a});});});})[_0xa59e('0x44')](function(_0x9b6271){console[_0xa59e('0x45')](_0x9b6271);});}exports[_0xa59e('0x46')]=rewrite;
\ No newline at end of file
index 292b9c2..7151ebe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcead=['outbound','BlackLists','all','Campaign','dialCheckDuplicateType','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','split','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','undefined','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','data','firstName','birthDate','YYYY-MM-DD','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','phone','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','id\x20IN\x20?','str','cm_hopper_final','insert','findAll','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch'];(function(_0x4f05fb,_0x11ec49){var _0x5de9d0=function(_0x135435){while(--_0x135435){_0x4f05fb['push'](_0x4f05fb['shift']());}};_0x5de9d0(++_0x11ec49);}(_0xcead,0xf9));var _0xdcea=function(_0xffebf5,_0x208592){_0xffebf5=_0xffebf5-0x0;var _0x1bfa09=_0xcead[_0xffebf5];return _0x1bfa09;};'use strict';var BPromise=require(_0xdcea('0x0'));var util=require(_0xdcea('0x1'));var _=require(_0xdcea('0x2'));var fs=require('fs');var squel=require(_0xdcea('0x3'));var Papa=require(_0xdcea('0x4'));var Redis=require(_0xdcea('0x5'));var db=require(_0xdcea('0x6'))['db'];var config=require(_0xdcea('0x7'));var logger=require(_0xdcea('0x8'))('api');config[_0xdcea('0x9')]=_[_0xdcea('0xa')](config[_0xdcea('0x9')],{'host':_0xdcea('0xb'),'port':0x18eb});var socket=require(_0xdcea('0xc'))(new Redis(config['redis']));require(_0xdcea('0xd'))[_0xdcea('0xe')](socket);try{if(!process[_0xdcea('0xf')][0x2]||process[_0xdcea('0xf')][0x2]==='undefined'||process[_0xdcea('0xf')][0x2]===_0xdcea('0x10')){throw new Error(_0xdcea('0x11'));}var FILEPATH=process['argv'][0x2];if(!process[_0xdcea('0xf')][0x3]||process[_0xdcea('0xf')][0x3]==='undefined'||process[_0xdcea('0xf')][0x3]===_0xdcea('0x10')||!process[_0xdcea('0xf')][0x4]||process[_0xdcea('0xf')][0x4]==='undefined'||process[_0xdcea('0xf')][0x4]==='null'){throw new Error(_0xdcea('0x12'));}var FIELDS=_[_0xdcea('0x13')](process[_0xdcea('0xf')][0x3]['split'](','),process[_0xdcea('0xf')][0x4]['split'](','));if(!process[_0xdcea('0xf')][0x5]||process[_0xdcea('0xf')][0x5]===_0xdcea('0x14')||process['argv'][0x5]===_0xdcea('0x10')){throw new Error(_0xdcea('0x15'));}var LISTID=process[_0xdcea('0xf')][0x5];var COMPANYID=process[_0xdcea('0xf')][0x6]&&process[_0xdcea('0xf')][0x6]!==_0xdcea('0x14')&&process[_0xdcea('0xf')][0x6]!==_0xdcea('0x10')?process[_0xdcea('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0xdcea('0x14')&&process[_0xdcea('0xf')][0x7]!==_0xdcea('0x10')?process[_0xdcea('0xf')][0x7]:null;if(!process[_0xdcea('0xf')][0x8]||process[_0xdcea('0xf')][0x8]===_0xdcea('0x14')||process['argv'][0x8]===_0xdcea('0x10')){throw new Error(_0xdcea('0x16'));}var SOCKET_TIMESTAMP=process[_0xdcea('0xf')][0x8];}catch(_0x498391){logger[_0xdcea('0x17')](_0x498391);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(_0x2c17b7,_0x3776ac,_0x2a9c64,_0x587481){var _0x4ed41b={'message':_0x3776ac};_0x4ed41b[_0x2c17b7]=!![];if(_0x2a9c64){_0x4ed41b[_0xdcea('0x18')]=_0x2a9c64;}if(_0x587481){_0x4ed41b['index']=_0x587481;}return _0x4ed41b;}function isEmail(_0x2e6ea0){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))*$/[_0xdcea('0x19')](_0x2e6ea0);}function checkRow(_0x18a99d,_0x2013a7,_0x4991a6){return new BPromise(function(_0x75be9c,_0x4270d7){if(_['isNil'](_0x18a99d)){return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),_0xdcea('0x1a'),null,_0x4991a6));}if(_0x18a99d['errors']&&_0x18a99d[_0xdcea('0x1b')][_0xdcea('0x1c')]){var _0xe61059=_[_0xdcea('0x1d')](_0x18a99d[_0xdcea('0x1b')],_0xdcea('0x1e'))['join'](';');return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),_0xe61059,null,_0x4991a6));}var _0x4bb502={};for(var _0x5e364a in FIELDS){if(FIELDS['hasOwnProperty'](_0x5e364a)&&FIELDS[_0x5e364a]){_0x4bb502[_0x5e364a]=_0x18a99d[_0xdcea('0x1f')][0x0][FIELDS[_0x5e364a]]||_0x18a99d[_0xdcea('0x1f')][0x0]['\ufeff'+FIELDS[_0x5e364a]];}}if(!_0x4bb502[_0xdcea('0x20')]){return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),'firstName\x20not\x20specified!',null,_0x4991a6));}if(!_0x4bb502['phone']){return _0x4270d7(handleCheckRowError('error','phone\x20not\x20specified!',null,_0x4991a6));}if(_0x4bb502[_0xdcea('0x21')]){var _0x4e6d49=moment(_0x4bb502[_0xdcea('0x21')],_0xdcea('0x22'));if(!_0x4e6d49['isValid']()){return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4991a6));}}if(_0x4bb502['email']){if(!isEmail(_0x4bb502[_0xdcea('0x23')])){return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),_0xdcea('0x24'),null,_0x4991a6));}}_0x4bb502['ListId']=LISTID;_0x4bb502[_0xdcea('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2013a7){var _0x3f4d30={};for(var _0x52bc6e=0x0,_0x3dcc6c=DUPLICATES[_0xdcea('0x1c')];_0x52bc6e<_0x3dcc6c;_0x52bc6e+=0x1){_0x3f4d30[DUPLICATES[_0x52bc6e]]=_0x4bb502[DUPLICATES[_0x52bc6e]];}var _0x56a2b1=_[_0xdcea('0x26')](_0x2013a7,_0x3f4d30);if(_0x56a2b1){return _0x4270d7(handleCheckRowError(_0xdcea('0x27'),_0xdcea('0x28'),_0x56a2b1,_0x4991a6));}}return db[_0xdcea('0x29')][_0xdcea('0x2a')](_0x4bb502,{'raw':!![],'hooks':![],'fields':_[_0xdcea('0x2b')](_0x4bb502)})[_0xdcea('0x2c')](function(_0x37e587){if(DUPLICATES&&DUPLICATES[_0xdcea('0x1c')]&&_0x2013a7){_0x2013a7[_0xdcea('0x2d')](_[_0xdcea('0x2e')](_0x4bb502,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x37e587['id'];return _0x75be9c();})['catch'](function(_0x644719){return _0x4270d7(handleCheckRowError(_0xdcea('0x17'),_0xdcea('0x2f')+(_0x644719['message']||JSON[_0xdcea('0x30')](_0x644719)),null,_0x4991a6));});});}function checkHopper(){function _0x264d07(){return function(_0x24c395){logger[_0xdcea('0x17')](_0xdcea('0x31'),_0xdcea('0x32'),util[_0xdcea('0x33')](_0x24c395,{'showHidden':![],'depth':null}));};}var _0x1a878d=function(_0x2be8f6,_0x57d018){var _0x4885bc=squel['insert']()[_0xdcea('0x34')](_0xdcea('0x35'))[_0xdcea('0x36')](['phone',_0xdcea('0x37'),_0xdcea('0x38'),_0xdcea('0x39'),_0x57d018,_0xdcea('0x3a'),_0xdcea('0x3b')],squel['select']()[_0xdcea('0x3c')]('phone',_0xdcea('0x3d'))[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x37'))[_0xdcea('0x3c')]('id',_0xdcea('0x38'))[_0xdcea('0x3c')](LISTID[_0xdcea('0x3f')](),_0xdcea('0x39'))[_0xdcea('0x3c')](_0x2be8f6['id']['toString'](),_0x57d018)[_0xdcea('0x3c')](_0xdcea('0x3e'),'createdAt')[_0xdcea('0x3c')](_0xdcea('0x3e'),'updatedAt')[_0xdcea('0x40')](_0xdcea('0x41'))[_0xdcea('0x42')](_0xdcea('0x43'))[_0xdcea('0x42')](_0xdcea('0x44'),LISTID[_0xdcea('0x3f')]())[_0xdcea('0x42')](_0xdcea('0x45'))[_0xdcea('0x42')](_0xdcea('0x46'),squel[_0xdcea('0x47')]()[_0xdcea('0x3c')](_0xdcea('0x3d'))[_0xdcea('0x40')]('cm_hopper')['where'](_0x57d018+_0xdcea('0x48'),_0x2be8f6['id'][_0xdcea('0x3f')]())))[_0xdcea('0x3f')]();return _0x4885bc;};var _0x5ce398=function(_0x3b6432,_0x5b314c){var _0x68e907=squel['insert']()['into'](_0xdcea('0x35'))[_0xdcea('0x36')]([_0xdcea('0x3d'),_0xdcea('0x37'),_0xdcea('0x38'),_0xdcea('0x39'),_0x5b314c,'createdAt',_0xdcea('0x3b')],squel[_0xdcea('0x47')]()['field'](_0xdcea('0x3d'),_0xdcea('0x3d'))['field'](_0xdcea('0x3e'),'scheduledAt')[_0xdcea('0x3c')]('id','ContactId')['field'](LISTID[_0xdcea('0x3f')](),'ListId')[_0xdcea('0x3c')](_0x3b6432['id'][_0xdcea('0x3f')](),_0x5b314c)[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x3a'))['field'](_0xdcea('0x3e'),_0xdcea('0x3b'))[_0xdcea('0x40')](_0xdcea('0x41'))[_0xdcea('0x42')](_0xdcea('0x43'))[_0xdcea('0x42')](_0xdcea('0x44'),LISTID[_0xdcea('0x3f')]())[_0xdcea('0x42')](_0xdcea('0x49'),squel[_0xdcea('0x4a')](hopperContacts))['where'](_0xdcea('0x45'))[_0xdcea('0x42')](_0xdcea('0x46'),squel[_0xdcea('0x47')]()[_0xdcea('0x3c')]('calleridnum')[_0xdcea('0x40')](_0xdcea('0x4b'))[_0xdcea('0x42')](_0x5b314c+'\x20=\x20?',_0x3b6432['id'][_0xdcea('0x3f')]()))[_0xdcea('0x42')](_0xdcea('0x46'),squel[_0xdcea('0x47')]()[_0xdcea('0x3c')](_0xdcea('0x3d'))['from'](_0xdcea('0x35'))[_0xdcea('0x42')](_0x5b314c+_0xdcea('0x48'),_0x3b6432['id'][_0xdcea('0x3f')]())))[_0xdcea('0x3f')]();return _0x68e907;};function _0x1927ec(_0xa96186,_0x1420be){var _0x461f2e=squel[_0xdcea('0x4c')]()['into'](_0xdcea('0x35'))[_0xdcea('0x36')]([_0xdcea('0x3d'),_0xdcea('0x37'),'ContactId',_0xdcea('0x39'),_0x1420be,_0xdcea('0x3a'),_0xdcea('0x3b')],squel['select']()[_0xdcea('0x3c')](_0xdcea('0x3d'),'phone')[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x37'))[_0xdcea('0x3c')]('id',_0xdcea('0x38'))[_0xdcea('0x3c')](LISTID[_0xdcea('0x3f')](),_0xdcea('0x39'))[_0xdcea('0x3c')](_0xa96186['id'][_0xdcea('0x3f')](),_0x1420be)[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x3a'))[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x3b'))[_0xdcea('0x40')]('cm_contacts')[_0xdcea('0x42')](_0xdcea('0x43'))[_0xdcea('0x42')](_0xdcea('0x44'),LISTID[_0xdcea('0x3f')]())[_0xdcea('0x42')](_0xdcea('0x49'),squel[_0xdcea('0x4a')](hopperContacts))[_0xdcea('0x42')](_0xdcea('0x45')))['toString']();return _0x461f2e;}function _0x544331(_0x1e66a6,_0x29896f){var _0x32548a=squel[_0xdcea('0x4c')]()[_0xdcea('0x34')]('cm_hopper_black')[_0xdcea('0x36')]([_0xdcea('0x3d'),_0xdcea('0x38'),_0xdcea('0x39'),_0x29896f,_0xdcea('0x3a'),'updatedAt'],squel['select']()[_0xdcea('0x3c')](_0xdcea('0x3d'),_0xdcea('0x3d'))['field']('id',_0xdcea('0x38'))[_0xdcea('0x3c')](LISTID[_0xdcea('0x3f')](),_0xdcea('0x39'))[_0xdcea('0x3c')](_0x1e66a6['id'][_0xdcea('0x3f')](),_0x29896f)[_0xdcea('0x3c')](_0xdcea('0x3e'),_0xdcea('0x3a'))[_0xdcea('0x3c')]('NOW()','updatedAt')[_0xdcea('0x40')](_0xdcea('0x41'))[_0xdcea('0x42')](_0xdcea('0x43'))[_0xdcea('0x42')](_0xdcea('0x44'),LISTID[_0xdcea('0x3f')]())[_0xdcea('0x42')](_0xdcea('0x49'),squel[_0xdcea('0x4a')](hopperContacts))['where'](_0xdcea('0x45')))[_0xdcea('0x3f')]();return _0x32548a;}return db['VoiceQueue'][_0xdcea('0x4d')]({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xdcea('0x4e')],'as':_0xdcea('0x4f'),'where':{'id':LISTID}}]})[_0xdcea('0x2c')](function(_0x384d37){var _0x1ee52c=[];if(_0x384d37){var _0x500cf6;for(var _0x2f1858=0x0,_0xe12c1e;_0x2f1858<_0x384d37[_0xdcea('0x1c')];_0x2f1858+=0x1){_0xe12c1e=_0x384d37[_0x2f1858][_0xdcea('0x50')]({'plain':!![]});switch(_0xe12c1e['dialCheckDuplicateType']){case _0xdcea('0x51'):_0x1ee52c['push'](db[_0xdcea('0x52')][_0xdcea('0x53')](_0x5ce398(_0xe12c1e,_0xdcea('0x54')))['then'](function(){})['catch'](_0x264d07()));break;case _0xdcea('0x55'):_0x1ee52c[_0xdcea('0x2d')](db[_0xdcea('0x52')][_0xdcea('0x53')](_0x1a878d(_0xe12c1e,'VoiceQueueId'))[_0xdcea('0x2c')](function(){})[_0xdcea('0x56')](_0x264d07()));break;default:_0x1ee52c[_0xdcea('0x2d')](db[_0xdcea('0x52')][_0xdcea('0x53')](_0x1927ec(_0xe12c1e,_0xdcea('0x54')))[_0xdcea('0x2c')](function(){})[_0xdcea('0x56')](_0x264d07()));}}}return _0x1ee52c;})['all']()['then'](function(){return db['VoiceQueue']['findAll']({'where':{'type':_0xdcea('0x57')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xdcea('0x58'),'where':{'id':LISTID}}]})[_0xdcea('0x2c')](function(_0x5867f8){var _0x47a9b5=[];if(_0x5867f8){var _0x19c3d6;for(var _0x46032a=0x0,_0x4e8925;_0x46032a<_0x5867f8[_0xdcea('0x1c')];_0x46032a+=0x1){_0x4e8925=_0x5867f8[_0x46032a]['get']({'plain':!![]});_0x47a9b5['push'](db['sequelize']['query'](_0x544331(_0x4e8925,_0xdcea('0x54')))[_0xdcea('0x2c')](function(){})[_0xdcea('0x56')](_0x264d07()));}}return _0x47a9b5;})[_0xdcea('0x59')]();})[_0xdcea('0x2c')](function(){return db[_0xdcea('0x5a')][_0xdcea('0x4d')]({'attributes':['id',_0xdcea('0x5b')],'include':[{'model':db[_0xdcea('0x4e')],'as':_0xdcea('0x4f'),'where':{'id':LISTID}}]})[_0xdcea('0x2c')](function(_0x33ed0f){var _0x49e71b=[];if(_0x33ed0f){for(var _0x3a980a=0x0,_0x465c70;_0x3a980a<_0x33ed0f[_0xdcea('0x1c')];_0x3a980a+=0x1){_0x465c70=_0x33ed0f[_0x3a980a]['get']({'plain':!![]});switch(_0x465c70[_0xdcea('0x5b')]){case _0xdcea('0x51'):_0x49e71b[_0xdcea('0x2d')](db[_0xdcea('0x52')][_0xdcea('0x53')](_0x5ce398(_0x465c70,_0xdcea('0x5c')))['then'](function(){})[_0xdcea('0x56')](_0x264d07()));break;case _0xdcea('0x55'):_0x49e71b[_0xdcea('0x2d')](db['sequelize']['query'](_0x1a878d(_0x465c70,'CampaignId'))['then'](function(){})['catch'](_0x264d07()));break;default:_0x49e71b['push'](db['sequelize']['query'](_0x1927ec(_0x465c70,_0xdcea('0x5c')))[_0xdcea('0x2c')](function(){})[_0xdcea('0x56')](_0x264d07()));}}}return _0x49e71b;})['all']();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id'],'include':[{'model':db[_0xdcea('0x4e')],'as':_0xdcea('0x58'),'where':{'id':LISTID}}]})[_0xdcea('0x2c')](function(_0x43134a){var _0x86d53a=[];if(_0x43134a){for(var _0x2d2290=0x0,_0x55ee51;_0x2d2290<_0x43134a[_0xdcea('0x1c')];_0x2d2290+=0x1){_0x55ee51=_0x43134a[_0x2d2290][_0xdcea('0x50')]({'plain':!![]});_0x86d53a['push'](db[_0xdcea('0x52')][_0xdcea('0x53')](_0x544331(_0x55ee51,_0xdcea('0x5c')))[_0xdcea('0x2c')](function(){})[_0xdcea('0x56')](_0x264d07()));}}return _0x86d53a;})[_0xdcea('0x59')]();})[_0xdcea('0x56')](function(_0x2939f7){logger[_0xdcea('0x17')](_0xdcea('0x5d'),_0xdcea('0x5e'),_0x2939f7['message']);});}var processPromises=function(_0x5b7e6c){return BPromise[_0xdcea('0x59')](promises)[_0xdcea('0x2c')](function(_0x15b724){})[_0xdcea('0x56')](function(_0x199582){logger['error'](_0xdcea('0x5f'),JSON[_0xdcea('0x30')](_0x199582));})[_0xdcea('0x60')](function(){socket[_0xdcea('0x61')](_0xdcea('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5b7e6c){return _0x5b7e6c[_0xdcea('0x63')]();}});};var endCsv=function(){return BPromise[_0xdcea('0x64')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0xdcea('0x2c')](function(){socket[_0xdcea('0x61')](_0xdcea('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdcea('0x65')](FILEPATH);}catch(_0x45d76c){logger[_0xdcea('0x17')](_0xdcea('0x66'),JSON['stringify'](_0x45d76c));}finally{process[_0xdcea('0x67')](0x0);}});};process['on'](_0xdcea('0x68'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xdcea('0x69')](',');return db['CmContact'][_0xdcea('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xdcea('0x2c')](function(_0xc5ad34){var _0x4785d5=fs[_0xdcea('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdcea('0x6b')](_0x4785d5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4ccd1d,_0xd4340d){total+=0x1;var _0x2d12c8=total;promises['push'](checkRow(_0x4ccd1d,_0xc5ad34,_0x2d12c8)['then'](function(){success+=0x1;})[_0xdcea('0x56')](function(_0x49d8be){if(_0x49d8be[_0xdcea('0x17')]){errors+=0x1;delete _0x49d8be[_0xdcea('0x17')];}else if(_0x49d8be[_0xdcea('0x27')]){duplicates+=0x1;delete _0x49d8be[_0xdcea('0x27')];}rows[_0xdcea('0x2d')](_0x49d8be);}));if(total%0xc8===0x0){_0xd4340d[_0xdcea('0x6c')]();return processPromises(_0xd4340d);}},'complete':function(){return processPromises()[_0xdcea('0x2c')](function(){logger[_0xdcea('0x6d')](_0xdcea('0x6e'));endCsv();});},'error':function(_0x3e64d6,_0x1426a2){logger['info']('CSV\x20parse\x20error',JSON['stringify'](_0x3e64d6));endCsv();}});})[_0xdcea('0x56')](function(_0x1c054a){logger[_0xdcea('0x17')](_0xdcea('0x6f'),JSON[_0xdcea('0x30')](_0x1c054a));});}main();
\ No newline at end of file
+var _0x9679=['calleridnum','cm_hopper_final','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','always','push','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','get','all','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','resume','emit','contact:csv_','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','duplicate','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','util','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','find','Duplicate\x20Contact','CmContact','create','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL'];(function(_0x20d400,_0x161a51){var _0x5c545d=function(_0x1f61e0){while(--_0x1f61e0){_0x20d400['push'](_0x20d400['shift']());}};_0x5c545d(++_0x161a51);}(_0x9679,0x8b));var _0x9967=function(_0x545d99,_0x3fc2c7){_0x545d99=_0x545d99-0x0;var _0x27d31d=_0x9679[_0x545d99];return _0x27d31d;};'use strict';var BPromise=require('bluebird');var util=require(_0x9967('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x9967('0x1'));var Papa=require('papaparse');var Redis=require(_0x9967('0x2'));var db=require(_0x9967('0x3'))['db'];var config=require(_0x9967('0x4'));var logger=require(_0x9967('0x5'))(_0x9967('0x6'));config['redis']=_[_0x9967('0x7')](config[_0x9967('0x8')],{'host':_0x9967('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9967('0x8')]));require(_0x9967('0xa'))[_0x9967('0xb')](socket);try{if(!process[_0x9967('0xc')][0x2]||process[_0x9967('0xc')][0x2]===_0x9967('0xd')||process[_0x9967('0xc')][0x2]===_0x9967('0xe')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x9967('0xc')][0x2];if(!process[_0x9967('0xc')][0x3]||process[_0x9967('0xc')][0x3]==='undefined'||process[_0x9967('0xc')][0x3]===_0x9967('0xe')||!process[_0x9967('0xc')][0x4]||process[_0x9967('0xc')][0x4]==='undefined'||process[_0x9967('0xc')][0x4]===_0x9967('0xe')){throw new Error(_0x9967('0xf'));}var FIELDS=_[_0x9967('0x10')](process[_0x9967('0xc')][0x3]['split'](','),process['argv'][0x4][_0x9967('0x11')](','));if(!process[_0x9967('0xc')][0x5]||process[_0x9967('0xc')][0x5]==='undefined'||process[_0x9967('0xc')][0x5]===_0x9967('0xe')){throw new Error(_0x9967('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x9967('0xc')][0x6]&&process[_0x9967('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0x9967('0xe')?process['argv'][0x6]:null;var DUPLICATES=process[_0x9967('0xc')][0x7]&&process[_0x9967('0xc')][0x7]!==_0x9967('0xd')&&process[_0x9967('0xc')][0x7]!==_0x9967('0xe')?process[_0x9967('0xc')][0x7]:null;if(!process['argv'][0x8]||process[_0x9967('0xc')][0x8]==='undefined'||process['argv'][0x8]===_0x9967('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x17cfe2){logger[_0x9967('0x13')](_0x17cfe2);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(_0x461308,_0x1bdf5f,_0x417636,_0xd88d7f){var _0x30c180={'message':_0x1bdf5f};_0x30c180[_0x461308]=!![];if(_0x417636){_0x30c180['contact']=_0x417636;}if(_0xd88d7f){_0x30c180[_0x9967('0x14')]=_0xd88d7f;}return _0x30c180;}function isEmail(_0x4dfb2d){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))*$/[_0x9967('0x15')](_0x4dfb2d);}function checkRow(_0x4d2d0c,_0x3f1a40,_0x5bd3c5){return new BPromise(function(_0x31ac33,_0x135aa){if(_[_0x9967('0x16')](_0x4d2d0c)){return _0x135aa(handleCheckRowError(_0x9967('0x13'),_0x9967('0x17'),null,_0x5bd3c5));}if(_0x4d2d0c['errors']&&_0x4d2d0c['errors'][_0x9967('0x18')]){var _0x5f2e2b=_[_0x9967('0x19')](_0x4d2d0c[_0x9967('0x1a')],_0x9967('0x1b'))[_0x9967('0x1c')](';');return _0x135aa(handleCheckRowError(_0x9967('0x13'),_0x5f2e2b,null,_0x5bd3c5));}var _0x374a3f={};for(var _0xd225c3 in FIELDS){if(FIELDS[_0x9967('0x1d')](_0xd225c3)&&FIELDS[_0xd225c3]){_0x374a3f[_0xd225c3]=_0x4d2d0c['data'][0x0][FIELDS[_0xd225c3]]||_0x4d2d0c[_0x9967('0x1e')][0x0]['\ufeff'+FIELDS[_0xd225c3]];}}if(!_0x374a3f[_0x9967('0x1f')]){return _0x135aa(handleCheckRowError(_0x9967('0x13'),_0x9967('0x20'),null,_0x5bd3c5));}if(!_0x374a3f[_0x9967('0x21')]){return _0x135aa(handleCheckRowError(_0x9967('0x13'),_0x9967('0x22'),null,_0x5bd3c5));}if(_0x374a3f['birthDate']){var _0x50e35f=moment(_0x374a3f[_0x9967('0x23')],_0x9967('0x24'));if(!_0x50e35f[_0x9967('0x25')]()){return _0x135aa(handleCheckRowError(_0x9967('0x13'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x5bd3c5));}}if(_0x374a3f[_0x9967('0x26')]){if(!isEmail(_0x374a3f[_0x9967('0x26')])){return _0x135aa(handleCheckRowError('error',_0x9967('0x27'),null,_0x5bd3c5));}}_0x374a3f[_0x9967('0x28')]=LISTID;_0x374a3f['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9967('0x18')]&&_0x3f1a40){var _0x2e966b={};for(var _0xd285a=0x0,_0x7d2006=DUPLICATES[_0x9967('0x18')];_0xd285a<_0x7d2006;_0xd285a+=0x1){_0x2e966b[DUPLICATES[_0xd285a]]=_0x374a3f[DUPLICATES[_0xd285a]];}var _0x184606=_[_0x9967('0x29')](_0x3f1a40,_0x2e966b);if(_0x184606){return _0x135aa(handleCheckRowError('duplicate',_0x9967('0x2a'),_0x184606,_0x5bd3c5));}}return db[_0x9967('0x2b')][_0x9967('0x2c')](_0x374a3f,{'raw':!![],'hooks':![],'fields':_['keys'](_0x374a3f)})['then'](function(_0x4b3ba0){if(DUPLICATES&&DUPLICATES[_0x9967('0x18')]&&_0x3f1a40){_0x3f1a40['push'](_[_0x9967('0x2d')](_0x374a3f,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x4b3ba0['id'];return _0x31ac33();})[_0x9967('0x2e')](function(_0xfd1891){return _0x135aa(handleCheckRowError(_0x9967('0x13'),_0x9967('0x2f')+(_0xfd1891[_0x9967('0x1b')]||JSON['stringify'](_0xfd1891)),null,_0x5bd3c5));});});}function checkHopper(){function _0xffb419(){return function(_0x118294){logger[_0x9967('0x13')](_0x9967('0x30'),'checkHopper',util['inspect'](_0x118294,{'showHidden':![],'depth':null}));};}var _0x3bddb3=function(_0x57af62,_0x538ac4){var _0x37a88f=squel['insert']()[_0x9967('0x31')](_0x9967('0x32'))[_0x9967('0x33')]([_0x9967('0x21'),_0x9967('0x34'),_0x9967('0x35'),'ListId',_0x538ac4,_0x9967('0x36'),_0x9967('0x37')],squel[_0x9967('0x38')]()[_0x9967('0x39')]('phone',_0x9967('0x21'))['field'](_0x9967('0x3a'),_0x9967('0x34'))[_0x9967('0x39')]('id',_0x9967('0x35'))[_0x9967('0x39')](LISTID[_0x9967('0x3b')](),_0x9967('0x28'))['field'](_0x57af62['id'][_0x9967('0x3b')](),_0x538ac4)[_0x9967('0x39')]('NOW()','createdAt')[_0x9967('0x39')]('NOW()',_0x9967('0x37'))[_0x9967('0x3c')](_0x9967('0x3d'))[_0x9967('0x3e')](_0x9967('0x3f'))[_0x9967('0x3e')](_0x9967('0x40'),LISTID[_0x9967('0x3b')]())[_0x9967('0x3e')]('phone\x20IS\x20NOT\x20NULL')[_0x9967('0x3e')](_0x9967('0x41'),squel[_0x9967('0x38')]()[_0x9967('0x39')](_0x9967('0x21'))[_0x9967('0x3c')](_0x9967('0x32'))['where'](_0x538ac4+_0x9967('0x42'),_0x57af62['id'][_0x9967('0x3b')]())))[_0x9967('0x3b')]();return _0x37a88f;};var _0x73f462=function(_0x354c42,_0x41a1d1){var _0x14365a=squel[_0x9967('0x43')]()[_0x9967('0x31')](_0x9967('0x32'))[_0x9967('0x33')]([_0x9967('0x21'),_0x9967('0x34'),_0x9967('0x35'),'ListId',_0x41a1d1,_0x9967('0x36'),_0x9967('0x37')],squel[_0x9967('0x38')]()['field'](_0x9967('0x21'),'phone')[_0x9967('0x39')](_0x9967('0x3a'),_0x9967('0x34'))[_0x9967('0x39')]('id',_0x9967('0x35'))[_0x9967('0x39')](LISTID[_0x9967('0x3b')](),'ListId')['field'](_0x354c42['id'][_0x9967('0x3b')](),_0x41a1d1)['field'](_0x9967('0x3a'),_0x9967('0x36'))[_0x9967('0x39')](_0x9967('0x3a'),'updatedAt')[_0x9967('0x3c')](_0x9967('0x3d'))[_0x9967('0x3e')](_0x9967('0x3f'))['where']('ListId\x20=\x20?',LISTID['toString']())[_0x9967('0x3e')](_0x9967('0x44'),squel[_0x9967('0x45')](hopperContacts))[_0x9967('0x3e')](_0x9967('0x46'))[_0x9967('0x3e')](_0x9967('0x41'),squel[_0x9967('0x38')]()[_0x9967('0x39')](_0x9967('0x47'))['from'](_0x9967('0x48'))[_0x9967('0x3e')](_0x41a1d1+_0x9967('0x42'),_0x354c42['id'][_0x9967('0x3b')]()))[_0x9967('0x3e')](_0x9967('0x41'),squel[_0x9967('0x38')]()['field'](_0x9967('0x21'))[_0x9967('0x3c')]('cm_hopper')[_0x9967('0x3e')](_0x41a1d1+_0x9967('0x42'),_0x354c42['id'][_0x9967('0x3b')]())))['toString']();return _0x14365a;};function _0x3af0c4(_0x104f90,_0x33741a){var _0x56e6ea=squel[_0x9967('0x43')]()[_0x9967('0x31')](_0x9967('0x32'))[_0x9967('0x33')]([_0x9967('0x21'),_0x9967('0x34'),'ContactId',_0x9967('0x28'),_0x33741a,_0x9967('0x36'),_0x9967('0x37')],squel[_0x9967('0x38')]()[_0x9967('0x39')]('phone',_0x9967('0x21'))[_0x9967('0x39')](_0x9967('0x3a'),_0x9967('0x34'))[_0x9967('0x39')]('id',_0x9967('0x35'))[_0x9967('0x39')](LISTID[_0x9967('0x3b')](),_0x9967('0x28'))[_0x9967('0x39')](_0x104f90['id']['toString'](),_0x33741a)[_0x9967('0x39')](_0x9967('0x3a'),'createdAt')[_0x9967('0x39')](_0x9967('0x3a'),_0x9967('0x37'))[_0x9967('0x3c')](_0x9967('0x3d'))[_0x9967('0x3e')](_0x9967('0x3f'))[_0x9967('0x3e')](_0x9967('0x40'),LISTID['toString']())['where'](_0x9967('0x44'),squel[_0x9967('0x45')](hopperContacts))[_0x9967('0x3e')](_0x9967('0x46')))[_0x9967('0x3b')]();return _0x56e6ea;}function _0x319ed1(_0x4275f6,_0x2102b9){var _0x172c47=squel[_0x9967('0x43')]()[_0x9967('0x31')]('cm_hopper_black')['fromQuery']([_0x9967('0x21'),_0x9967('0x35'),_0x9967('0x28'),_0x2102b9,_0x9967('0x36'),_0x9967('0x37')],squel[_0x9967('0x38')]()['field']('phone',_0x9967('0x21'))[_0x9967('0x39')]('id',_0x9967('0x35'))[_0x9967('0x39')](LISTID[_0x9967('0x3b')](),'ListId')['field'](_0x4275f6['id'][_0x9967('0x3b')](),_0x2102b9)[_0x9967('0x39')](_0x9967('0x3a'),'createdAt')['field']('NOW()',_0x9967('0x37'))[_0x9967('0x3c')]('cm_contacts')[_0x9967('0x3e')](_0x9967('0x3f'))[_0x9967('0x3e')](_0x9967('0x40'),LISTID[_0x9967('0x3b')]())[_0x9967('0x3e')](_0x9967('0x44'),squel[_0x9967('0x45')](hopperContacts))['where'](_0x9967('0x46')))[_0x9967('0x3b')]();return _0x172c47;}return db['VoiceQueue'][_0x9967('0x49')]({'where':{'type':_0x9967('0x4a')},'attributes':['id',_0x9967('0x4b')],'include':[{'model':db[_0x9967('0x4c')],'as':_0x9967('0x4d'),'where':{'id':LISTID}}]})[_0x9967('0x4e')](function(_0x570d60){var _0x2ecd64=[];if(_0x570d60){var _0xe8092f;for(var _0x336665=0x0,_0x4a6a63;_0x336665<_0x570d60[_0x9967('0x18')];_0x336665+=0x1){_0x4a6a63=_0x570d60[_0x336665]['get']({'plain':!![]});switch(_0x4a6a63[_0x9967('0x4b')]){case _0x9967('0x4f'):_0x2ecd64[_0x9967('0x50')](db[_0x9967('0x51')][_0x9967('0x52')](_0x73f462(_0x4a6a63,_0x9967('0x53')))[_0x9967('0x4e')](function(){})[_0x9967('0x2e')](_0xffb419()));break;case _0x9967('0x54'):_0x2ecd64['push'](db[_0x9967('0x51')][_0x9967('0x52')](_0x3bddb3(_0x4a6a63,_0x9967('0x53')))['then'](function(){})[_0x9967('0x2e')](_0xffb419()));break;default:_0x2ecd64[_0x9967('0x50')](db[_0x9967('0x51')][_0x9967('0x52')](_0x3af0c4(_0x4a6a63,_0x9967('0x53')))['then'](function(){})['catch'](_0xffb419()));}}}return _0x2ecd64;})['all']()[_0x9967('0x4e')](function(){return db['VoiceQueue'][_0x9967('0x49')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x9967('0x55'),'where':{'id':LISTID}}]})['then'](function(_0x5e8b53){var _0x556a6d=[];if(_0x5e8b53){var _0x4e5ff6;for(var _0x14db87=0x0,_0x37b17c;_0x14db87<_0x5e8b53[_0x9967('0x18')];_0x14db87+=0x1){_0x37b17c=_0x5e8b53[_0x14db87][_0x9967('0x56')]({'plain':!![]});_0x556a6d[_0x9967('0x50')](db[_0x9967('0x51')][_0x9967('0x52')](_0x319ed1(_0x37b17c,_0x9967('0x53')))[_0x9967('0x4e')](function(){})[_0x9967('0x2e')](_0xffb419()));}}return _0x556a6d;})[_0x9967('0x57')]();})['then'](function(){return db[_0x9967('0x58')]['findAll']({'attributes':['id',_0x9967('0x4b')],'include':[{'model':db[_0x9967('0x4c')],'as':_0x9967('0x4d'),'where':{'id':LISTID}}]})[_0x9967('0x4e')](function(_0x5ec65e){var _0x326de9=[];if(_0x5ec65e){for(var _0x4e0041=0x0,_0xefb38d;_0x4e0041<_0x5ec65e[_0x9967('0x18')];_0x4e0041+=0x1){_0xefb38d=_0x5ec65e[_0x4e0041]['get']({'plain':!![]});switch(_0xefb38d[_0x9967('0x4b')]){case'always':_0x326de9[_0x9967('0x50')](db[_0x9967('0x51')]['query'](_0x73f462(_0xefb38d,_0x9967('0x59')))[_0x9967('0x4e')](function(){})['catch'](_0xffb419()));break;case _0x9967('0x54'):_0x326de9[_0x9967('0x50')](db[_0x9967('0x51')][_0x9967('0x52')](_0x3bddb3(_0xefb38d,_0x9967('0x59')))['then'](function(){})[_0x9967('0x2e')](_0xffb419()));break;default:_0x326de9[_0x9967('0x50')](db['sequelize'][_0x9967('0x52')](_0x3af0c4(_0xefb38d,_0x9967('0x59')))[_0x9967('0x4e')](function(){})[_0x9967('0x2e')](_0xffb419()));}}}return _0x326de9;})[_0x9967('0x57')]();})[_0x9967('0x4e')](function(){return db['Campaign'][_0x9967('0x49')]({'attributes':['id'],'include':[{'model':db[_0x9967('0x4c')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x9967('0x4e')](function(_0x4c5c90){var _0x476622=[];if(_0x4c5c90){for(var _0x1948ac=0x0,_0x5f1bfa;_0x1948ac<_0x4c5c90[_0x9967('0x18')];_0x1948ac+=0x1){_0x5f1bfa=_0x4c5c90[_0x1948ac][_0x9967('0x56')]({'plain':!![]});_0x476622[_0x9967('0x50')](db[_0x9967('0x51')][_0x9967('0x52')](_0x319ed1(_0x5f1bfa,_0x9967('0x59')))[_0x9967('0x4e')](function(){})[_0x9967('0x2e')](_0xffb419()));}}return _0x476622;})[_0x9967('0x57')]();})[_0x9967('0x2e')](function(_0x16d1c4){logger[_0x9967('0x13')](_0x9967('0x5a'),_0x9967('0x5b'),_0x16d1c4[_0x9967('0x1b')]);});}var processPromises=function(_0x3b9c9f){return BPromise[_0x9967('0x57')](promises)[_0x9967('0x4e')](function(_0x3cf473){})[_0x9967('0x2e')](function(_0x2a8a91){logger[_0x9967('0x13')](_0x9967('0x5c'),JSON[_0x9967('0x5d')](_0x2a8a91));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3b9c9f){return _0x3b9c9f[_0x9967('0x5e')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9967('0x4e')](function(){if(hopperContacts){return checkHopper();}})[_0x9967('0x4e')](function(){socket[_0x9967('0x5f')](_0x9967('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x45cf98){logger[_0x9967('0x13')](_0x9967('0x61'),JSON['stringify'](_0x45cf98));}finally{process[_0x9967('0x62')](0x0);}});};process['on'](_0x9967('0x63'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x9967('0x2b')][_0x9967('0x49')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9967('0x4e')](function(_0x504460){var _0x55bed9=fs[_0x9967('0x64')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x55bed9,{'header':!![],'skipEmptyLines':!![],'step':function(_0x24553e,_0x173f5f){total+=0x1;var _0x2422bf=total;promises[_0x9967('0x50')](checkRow(_0x24553e,_0x504460,_0x2422bf)[_0x9967('0x4e')](function(){success+=0x1;})[_0x9967('0x2e')](function(_0x2521cd){if(_0x2521cd['error']){errors+=0x1;delete _0x2521cd[_0x9967('0x13')];}else if(_0x2521cd[_0x9967('0x65')]){duplicates+=0x1;delete _0x2521cd['duplicate'];}rows[_0x9967('0x50')](_0x2521cd);}));if(total%0xc8===0x0){_0x173f5f['pause']();return processPromises(_0x173f5f);}},'complete':function(){return processPromises()[_0x9967('0x4e')](function(){logger[_0x9967('0x66')](_0x9967('0x67'));endCsv();});},'error':function(_0x5305a5,_0x3c5977){logger['info'](_0x9967('0x68'),JSON[_0x9967('0x5d')](_0x5305a5));endCsv();}});})[_0x9967('0x2e')](function(_0x2d638a){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x9967('0x5d')](_0x2d638a));});}main();
\ No newline at end of file
index d44aeec..517ac3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6215=['cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.createdAt','cm_contacts.updatedAt','cm_hopper_black','fields','cm_contacts.phone\x20NOT\x20IN\x20(?)','ListId\x20=\x20?','\x20=\x20','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.priority','recallme','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','error','message','exit','errors','code','sequelize','query','spread','catch','campaigns','campaigns_has_cm_lists','campaigns_has_cm_lists.CmListId=','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','utcOffset','set','offset','dialTimezone','main','stringify','start','binding','clone','socket_timestamp','server/files/tmp','.csv','includes','keys','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','description','appendFileSync','contact:import:','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','CompanyId',',\x20scheduledAt\x20=\x20NOW()','duplicates','contactId','contactTypeId','orderBy','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','affectedRows','emit','unlink','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','uncaughtException','path','lodash','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','where','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','length','all','split','push','isNil','CmContactHasItem','findOne','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','cm_contacts'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x6215,0x13f));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require(_0x5621('0x0'));var _=require(_0x5621('0x1'));var Papa=require('papaparse');var util=require(_0x5621('0x2'));var BPromise=require(_0x5621('0x3'));var moment=require(_0x5621('0x4'));var squel=require('squel');var Redis=require(_0x5621('0x5'));var db=require(_0x5621('0x6'))['db'];var config=require(_0x5621('0x7'));var shared=require(_0x5621('0x8'));var logger=require(_0x5621('0x9'))(_0x5621('0xa'));config[_0x5621('0xb')]=_[_0x5621('0xc')](config[_0x5621('0xb')],{'host':_0x5621('0xd'),'port':0x18eb});var socket=require(_0x5621('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x5621('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x5621('0xf')](_0x5621('0x10'));function isEmail(_0x166252){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))*$/[_0x5621('0x11')](_0x166252);}function selectNotIn(_0x3c71f6,_0x2c1b08,_0x294827,_0xab8bc5,_0x1325c7){return squel[_0x5621('0x12')]()[_0x5621('0x13')](_0x5621('0x14'))[_0x5621('0x15')](_0xab8bc5)['join'](_0x2c1b08,null,_0x2c1b08+'.id\x20=\x20'+_0xab8bc5+'.'+_0x294827)[_0x5621('0x16')](_0xab8bc5+'.'+_0x294827+'\x20=\x20'+_0x3c71f6+'.'+_0x294827)[_0x5621('0x16')](_0x2c1b08+_0x5621('0x17')+_0x1325c7[_0x5621('0x18')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5ef204,_0x48aab7){promisesAdditionalPhones=[];return db[_0x5621('0x19')][_0x5621('0x1a')]({'raw':!![],'attributes':['id',_0x5621('0x1b')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x5621('0x1c')](function(_0x4e9c13){if(_0x4e9c13!==null){var _0x12c25e=[];for(var _0x226395=0x0;_0x226395<_0x4e9c13[_0x5621('0x1d')];_0x226395++){var _0x793e87=_0x4e9c13[_0x226395];_0x12c25e['push'](insertAdditionalPhones(_0x793e87));}}Promise[_0x5621('0x1e')](_0x12c25e)[_0x5621('0x1c')](function(){_0x5ef204({'val':0x1});});});});}function insertAdditionalPhones(_0x15f428){return new Promise(function(_0x323a0d,_0x378568){var _0x29a4be=_0x15f428[_0x5621('0x1b')];var _0x2972ec=_0x29a4be[_0x5621('0x1f')](';');var _0x24107c=[];orderBy=0x0;for(var _0x428690=0x0;_0x428690<_0x2972ec['length'];_0x428690++){_0x24107c[_0x5621('0x20')](splitAdditionalPhone(_0x15f428['id'],_0x2972ec[_0x428690]));}Promise['all'](_0x24107c)[_0x5621('0x1c')](function(){_0x323a0d({'val':_0x2972ec['length']});});});}function splitAdditionalPhone(_0x1e028e,_0x85cdf){return new Promise(function(_0x31272f,_0x10ed77){var _0x1eaa8d=_0x85cdf[_0x5621('0x1f')](':');var _0x3a0580=_0x1eaa8d[0x0];var _0x4cc694=_0x1eaa8d[0x1];if(!_[_0x5621('0x21')](_0x4cc694)){var _0x3560d5=_0x4cc694[_0x5621('0x1f')]('|');var _0x28793c=[];for(var _0x1ea61a=0x0;_0x1ea61a<_0x3560d5[_0x5621('0x1d')];_0x1ea61a++){if(_0x3560d5[_0x1ea61a]!==''){var _0x444f59=_['filter'](promisesAdditionalPhones,{'contactId':_0x1e028e,'phone':_0x3560d5[_0x1ea61a]});if(_0x444f59[_0x5621('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0x5621('0x20')]({'contactId':_0x1e028e,'contactTypeId':_0x3a0580,'phone':_0x3560d5[_0x1ea61a],'orderBy':orderBy});}}}_0x31272f({'ok':0x1});}else _0x31272f({'res':0x0});});}function createAdditionalPhone(_0x5e0e16,_0x3511b2,_0x1ba34c,_0x347702){var _0x3e0343='';var _0x11b374='';var _0x54bece=_0x1ba34c['split']('§');_0x3e0343=_0x54bece[0x0];if(_0x54bece[_0x5621('0x1d')]==0x2)_0x11b374=_0x54bece[0x1];return new Promise(function(_0x264264,_0x212ae5){return db[_0x5621('0x22')][_0x5621('0x23')]({'where':{'CmContactId':_0x5e0e16,'item':_0x3e0343}})['then'](function(_0x238e93){if(_0x238e93){return db[_0x5621('0x22')][_0x5621('0x24')]({'ItemTypeId':_0x3511b2,'description':_0x11b374,'OrderBy':_0x347702},{'where':{'CmContactId':_0x5e0e16,'item':_0x3e0343}})[_0x5621('0x1c')](function(_0x32b889){_0x264264({'res':_0x5621('0x25')});});}else{return db[_0x5621('0x22')]['create']({'CmContactId':_0x5e0e16,'item':_0x3e0343,'description':_0x11b374,'ItemTypeId':_0x3511b2,'OrderBy':_0x347702,'ItemClass':_0x5621('0x26')})[_0x5621('0x1c')](function(_0x18ca47){_0x264264({'res':_0x5621('0x27')});});}});});}function insertCmHopper(_0x4b68af,_0x5b2aab,_0x284cdc,_0x6e1cd4,_0x10ff34){var _0x1f7b41=[_0x5621('0x28'),_0x5621('0x29'),_0x5621('0x2a'),_0x5621('0x2b'),_0x5b2aab+'.'+_0x6e1cd4,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x5621('0x2c'),'\x22'+_0x10ff34+'\x22'];return squel[_0x5621('0x2d')]()[_0x5621('0x2e')](_0x5621('0x2f'))[_0x5621('0x30')]([_0x5621('0x14'),_0x5621('0x31'),_0x5621('0x32'),_0x5621('0x33'),_0x6e1cd4,_0x5621('0x34'),_0x5621('0x35'),_0x5621('0x36'),_0x5621('0x37'),'recallme'],squel['select']()['fields'](_0x1f7b41)[_0x5621('0x15')](_0x5b2aab)[_0x5621('0x18')](_0x5621('0x38'),null,_0x5621('0x39')+_0x5b2aab+_0x5621('0x3a'))[_0x5621('0x18')](_0x284cdc,null,_0x284cdc+_0x5621('0x3b')+_0x5b2aab+'.'+_0x6e1cd4)[_0x5621('0x16')](_0x5b2aab+_0x5621('0x3c'),_0x4b68af)[_0x5621('0x16')](_0x5621('0x3d'),NOW)[_0x5621('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5b2aab,_0x284cdc,_0x6e1cd4,_0x5621('0x2f'),[_0x5621('0x3e'),_0x5621('0x3f')]))[_0x5621('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x5b2aab,_0x284cdc,_0x6e1cd4,_0x5621('0x2f'),[_0x5621('0x3e')])))[_0x5621('0x40')]();}function insertCmHopperBlack(_0x135975,_0x28d6a1,_0x13ae81,_0x7afc93){var _0x2ea801=[_0x5621('0x28'),_0x5621('0x2a'),_0x5621('0x2b'),_0x28d6a1+'.'+_0x7afc93,_0x5621('0x41'),_0x5621('0x42')];return squel[_0x5621('0x2d')]()[_0x5621('0x2e')](_0x5621('0x43'))[_0x5621('0x30')]([_0x5621('0x14'),_0x5621('0x32'),_0x5621('0x33'),_0x7afc93,_0x5621('0x34'),_0x5621('0x35')],squel[_0x5621('0x12')]()[_0x5621('0x44')](_0x2ea801)['from'](_0x28d6a1)[_0x5621('0x18')]('cm_contacts',null,_0x5621('0x39')+_0x28d6a1+_0x5621('0x3a'))[_0x5621('0x18')](_0x13ae81,null,_0x13ae81+_0x5621('0x3b')+_0x28d6a1+'.'+_0x7afc93)[_0x5621('0x16')](_0x28d6a1+_0x5621('0x3c'),_0x135975)[_0x5621('0x16')](_0x5621('0x3d'),NOW)[_0x5621('0x16')](_0x5621('0x45'),squel[_0x5621('0x12')]()[_0x5621('0x13')]('phone')[_0x5621('0x15')]('cm_hopper_black')[_0x5621('0x16')](_0x5621('0x46'),_0x135975)[_0x5621('0x16')](_0x7afc93+_0x5621('0x47')+_0x28d6a1+'.'+_0x7afc93)))[_0x5621('0x40')]();}function insertTzCmHopper(_0x182b6b,_0x3fe42d,_0x50e62c,_0x4e4f79,_0x599fbc,_0x12b704){var _0x142e91=[_0x5621('0x28'),_0x5621('0x48')+_0x12b704+_0x5621('0x49'),_0x5621('0x2a'),_0x5621('0x2b'),_0x3fe42d+'.'+_0x4e4f79,_0x5621('0x41'),_0x5621('0x42'),_0x5621('0x4a'),_0x5621('0x2c'),'\x22'+_0x599fbc+'\x22'];var _0x5b0e47=squel[_0x5621('0x2d')]()[_0x5621('0x2e')]('cm_hopper')['fromQuery']([_0x5621('0x14'),_0x5621('0x31'),'ContactId','ListId',_0x4e4f79,_0x5621('0x34'),_0x5621('0x35'),_0x5621('0x36'),_0x5621('0x37'),_0x5621('0x4b')],squel[_0x5621('0x12')]()[_0x5621('0x44')](_0x142e91)['from'](_0x3fe42d)[_0x5621('0x18')](_0x5621('0x38'),null,_0x5621('0x39')+_0x3fe42d+_0x5621('0x3a'))[_0x5621('0x18')](_0x50e62c,null,_0x50e62c+_0x5621('0x3b')+_0x3fe42d+'.'+_0x4e4f79)[_0x5621('0x18')](_0x12b704,null,_0x12b704+_0x5621('0x3b')+_0x3fe42d+'.'+_0x4e4f79)[_0x5621('0x16')](_0x3fe42d+_0x5621('0x3c'),_0x182b6b)[_0x5621('0x16')](_0x5621('0x3d'),NOW)[_0x5621('0x16')](_0x5621('0x45'),selectNotIn(_0x3fe42d,_0x50e62c,_0x4e4f79,_0x5621('0x2f'),[_0x5621('0x3e'),'\x22onlyIfOpen\x22']))['where'](_0x5621('0x45'),selectNotIn(_0x3fe42d,_0x50e62c,_0x4e4f79,_0x5621('0x2f'),[_0x5621('0x3e')])))[_0x5621('0x40')]();return _0x5b0e47;}function insertTzCmHopperBlack(_0x194b7d,_0x184698,_0x2047fd,_0x2471f0){var _0x18329f=[_0x5621('0x28'),_0x5621('0x2a'),_0x5621('0x2b'),_0x184698+'.'+_0x2471f0,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0x5621('0x2e')](_0x5621('0x43'))[_0x5621('0x30')]([_0x5621('0x14'),_0x5621('0x32'),_0x5621('0x33'),_0x2471f0,_0x5621('0x34'),'updatedAt'],squel[_0x5621('0x12')]()[_0x5621('0x44')](_0x18329f)[_0x5621('0x15')](_0x184698)['join'](_0x5621('0x38'),null,_0x5621('0x39')+_0x184698+_0x5621('0x3a'))[_0x5621('0x18')](_0x2047fd,null,_0x2047fd+_0x5621('0x3b')+_0x184698+'.'+_0x2471f0)[_0x5621('0x16')](_0x184698+_0x5621('0x3c'),_0x194b7d)[_0x5621('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5621('0x16')](_0x5621('0x45'),squel['select']()[_0x5621('0x13')](_0x5621('0x14'))[_0x5621('0x15')](_0x5621('0x43'))[_0x5621('0x16')]('ListId\x20=\x20?',_0x194b7d)[_0x5621('0x16')](_0x2471f0+_0x5621('0x47')+_0x184698+'.'+_0x2471f0)))[_0x5621('0x40')]();}function insertCmHopperAdditionalPhones(_0x4afa6f){var _0x58cce0=[_0x5621('0x4c'),_0x5621('0x4d'),_0x5621('0x4e'),_0x5621('0x4f'),_0x5621('0x50')];return squel[_0x5621('0x2d')]()['into'](_0x5621('0x51'))[_0x5621('0x30')]([_0x5621('0x52'),_0x5621('0x14'),_0x5621('0x53'),_0x5621('0x34'),_0x5621('0x35')],squel[_0x5621('0x12')]()['fields'](_0x58cce0)[_0x5621('0x15')](_0x5621('0x2f'))[_0x5621('0x18')](_0x5621('0x38'),null,_0x5621('0x54'))[_0x5621('0x18')](_0x5621('0x55'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x5621('0x16')](_0x5621('0x56'),_0x4afa6f)[_0x5621('0x16')](_0x5621('0x3d'),NOW))[_0x5621('0x40')]();}function insertCmContact(_0x1d87ec,_0x16c0cc,_0x6cf996,_0x198d34){var _0xcdd49b=_[_0x5621('0x57')](_['keys'](_0x198d34),['ListId','CompanyId','createdAt',_0x5621('0x35')]);return squel[_0x5621('0x2d')]()['into'](_0x5621('0x38'))['fromQuery'](_0xcdd49b,squel[_0x5621('0x12')]()['fields'](_0xcdd49b)[_0x5621('0x15')](_0x16c0cc)[_0x5621('0x16')]('('+_0x6cf996[_0x5621('0x18')](',')+_0x5621('0x58'),squel[_0x5621('0x12')]()[_0x5621('0x44')](_0x6cf996)[_0x5621('0x15')](_0x5621('0x38'))[_0x5621('0x16')](_0x5621('0x46'),_0x1d87ec)[_0x5621('0x16')](_0x5621('0x59')))['where'](_0x5621('0x5a'),squel['select']()[_0x5621('0x13')](_0x5621('0x5b'),_0x5621('0x5c'))[_0x5621('0x15')](_0x16c0cc)['group'](_0x6cf996[_0x5621('0x18')](','))))[_0x5621('0x40')]();}function handleStop(){logger[_0x5621('0x5d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x34aedb){logger[_0x5621('0x5e')](_0x34aedb[_0x5621('0x5f')]);process[_0x5621('0x60')](0x1);}function handleError(_0x5429de,_0x1fbe38){stats[_0x5621('0x61')][_0x5621('0x20')]({'name':_0x1fbe38[_0x5621('0x62')],'message':_0x1fbe38[_0x5621('0x5f')],'row':_0x5429de});}function handleQuery(_0x57c7a1){logger['info'](_0x57c7a1);return db[_0x5621('0x63')][_0x5621('0x64')](_0x57c7a1)[_0x5621('0x65')](function(_0x44f061){results['push'](_0x44f061);})[_0x5621('0x66')](function(_0xdb5a8f){logger[_0x5621('0x5e')](_0xdb5a8f[_0x5621('0x5f')]);});}function updateTzCampaigns(_0x639fc){return new Promise(function(_0x480fa9,_0x4ba8b5){var _0x4ad47e=squel['select']()['fields'](['campaigns.id','campaigns.dialTimezone'])[_0x5621('0x15')](_0x5621('0x67'))['join'](_0x5621('0x68'),null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x5621('0x16')](_0x5621('0x69')+_0x639fc);db['sequelize'][_0x5621('0x64')](_0x4ad47e[_0x5621('0x40')]())['spread'](function(_0x39e55a){var _0x3de859=[];for(var _0x4eba3b=0x0;_0x4eba3b<_0x39e55a[_0x5621('0x1d')];_0x4eba3b++){_0x3de859[_0x5621('0x20')](getTimezoneData(_0x39e55a[_0x4eba3b],tmp_campaigns));}BPromise[_0x5621('0x1e')](_0x3de859)[_0x5621('0x1c')](function(){_0x480fa9({'val':0x1});});})[_0x5621('0x66')](function(_0x5dea66){logger['error'](_0x5dea66['message']);_0x480fa9({'val':0x0});});});}function updateTzVoiceQueues(_0xa615f9){return new Promise(function(_0x201245,_0x2d70c4){var _0x1232ab=squel[_0x5621('0x12')]()[_0x5621('0x44')](['voice_queues.id','voice_queues.dialTimezone'])[_0x5621('0x15')]('voice_queues')['join'](_0x5621('0x6a'),null,_0x5621('0x6b'))[_0x5621('0x16')](_0x5621('0x6c')+_0xa615f9);db[_0x5621('0x63')][_0x5621('0x64')](_0x1232ab[_0x5621('0x40')]())['spread'](function(_0x176f4a){var _0xd643bf=[];for(var _0xb7df18=0x0;_0xb7df18<_0x176f4a['length'];_0xb7df18++){_0xd643bf['push'](getTimezoneData(_0x176f4a[_0xb7df18],tmp_voice_queues));}BPromise['all'](_0xd643bf)[_0x5621('0x1c')](function(){_0x201245({'val':0x1});});})[_0x5621('0x66')](function(_0x595ac4){logger[_0x5621('0x5e')](_0x595ac4[_0x5621('0x5f')]);_0x201245({'val':0x0});});});}function getTimezoneData(_0x5b5ec1,_0x386640){return new Promise(function(_0x598dd5,_0x299d78){var _0x1b4f63=shared[_0x5621('0x6d')];var _0x5e7101=_0x1b4f63[_0x5b5ec1['dialTimezone']];if(_[_0x5621('0x21')](_0x5e7101)){_0x598dd5({'ret':0x1});}else{var _0x15e8f4=_0x5e7101[_0x5621('0x6e')];var _0x12a3bc=squel[_0x5621('0x2d')]()[_0x5621('0x2e')](_0x386640)[_0x5621('0x6f')]('id',_0x5b5ec1['id'])[_0x5621('0x6f')](_0x5621('0x70'),_0x15e8f4)[_0x5621('0x6f')](_0x5621('0x71'),_0x5b5ec1[_0x5621('0x71')])[_0x5621('0x40')]();return db[_0x5621('0x63')][_0x5621('0x64')](_0x12a3bc)[_0x5621('0x65')](function(_0x44af60){_0x598dd5({'ret':0x1});})[_0x5621('0x66')](function(_0x584346){logger[_0x5621('0x5e')](_0x584346[_0x5621('0x5f')]);_0x299d78({'ret':0x1});});}});}function handleTZQuery(_0x267963){logger[_0x5621('0x5d')](_0x267963);return db['sequelize']['query'](_0x267963)[_0x5621('0x65')](function(_0x4a567d){})[_0x5621('0x66')](function(_0x3daaa9){logger[_0x5621('0x5e')](_0x3daaa9[_0x5621('0x5f')]);});}function main(_0x2cd36c,_0x160de5,_0x48702f,_0x5aff0b){logger[_0x5621('0x5d')](_0x5621('0x72'),_0x2cd36c,JSON[_0x5621('0x73')](_0x160de5));process['send'](_0x5621('0x74'));var _0x2eaff8=_0x160de5[_0x5621('0x75')];var _0x1ff183=_[_0x5621('0x76')](_0x2eaff8);var _0xa3a60d=_0x160de5[_0x5621('0x77')];var _0x2af999=path['join'](config['root'],_0x5621('0x78'),_0xa3a60d+_0x5621('0x79'));hasTZ=_['keys'](_0x2eaff8)[_0x5621('0x7a')]('dialTimezone');var _0x1bb13d=_[_0x5621('0x7b')](_0x2eaff8)[_0x5621('0x18')]();logger[_0x5621('0x5d')](_0x5621('0x7c'),_0x1bb13d);db[_0x5621('0x7d')][_0x5621('0x1a')]({'raw':!![],'attributes':['id',_0x5621('0x7e')]})['then'](function(_0x3fbcef){for(var _0x157bd2=0x0;_0x157bd2<_0x3fbcef['length'];_0x157bd2++){if(_0x3fbcef[_0x157bd2][_0x5621('0x7e')]in _0x2eaff8){contactItemTypes[_0x5621('0x20')](_0x3fbcef[_0x157bd2]);delete _0x1ff183[_0x3fbcef[_0x157bd2][_0x5621('0x7e')]];hasAdditionalPhones=!![];}for(var _0x5bf06d in _0x2eaff8){if(_0x3fbcef[_0x157bd2][_0x5621('0x7e')]+_0x5621('0x7f')===_0x5bf06d){phoneDescriptions['push']({'itemTypeId':_0x3fbcef[_0x157bd2]['id'],'description':_0x5bf06d});delete _0x1ff183[_0x5bf06d];}}}if(hasAdditionalPhones)_0x1ff183['AdditionalPhones']='';var _0x411fb5=_[_0x5621('0x7b')](_0x1ff183)[_0x5621('0x18')]();logger[_0x5621('0x5d')](_0x5621('0x7c'),_0x411fb5);fs[_0x5621('0x80')](_0x2af999,_0x411fb5+'\x0a');Papa[_0x5621('0x81')](fs[_0x5621('0x82')](_0x2cd36c),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3a4871,_0x523012){try{for(var _0x563672=0x0,_0x3e2066=[];_0x563672<_0x3a4871[_0x5621('0x83')][_0x5621('0x1d')];_0x563672++){stats[_0x5621('0x84')]+=0x1;if(_0x3a4871['errors'][_0x563672]){handleError(_0x3a4871[_0x5621('0x83')][_0x563672],_0x3a4871[_0x5621('0x61')][_0x563672]);}else{var _0x4c3574=[];var _0x34093a=[];var _0x54da4a={};for(var _0x2fb012 in _0x2eaff8){let _0x4c0109=contactItemTypes[_0x5621('0x85')](_0x527af2=>_0x527af2[_0x5621('0x7e')]===_0x2fb012);let _0x25723e=contactItemTypes[_0x5621('0x85')](_0x469742=>_0x469742[_0x5621('0x7e')]+_0x5621('0x7f')===_0x2fb012);if(_[_0x5621('0x21')](_0x4c0109)&&_[_0x5621('0x21')](_0x25723e)){if(_0x2eaff8[_0x5621('0x86')](_0x2fb012)){if(_0x3a4871[_0x5621('0x83')][_0x563672][_0x2eaff8[_0x2fb012]]){var _0x34825c=_[_0x5621('0x87')](_0x3a4871['data'][_0x563672][_0x2eaff8[_0x2fb012]][_0x5621('0x88')](/"/g,'\x27'));switch(_0x2fb012){case _0x5621('0x31'):var _0x2ace53=moment(_0x34825c,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2ace53[_0x5621('0x89')]()){_0x3e2066['push']('\x22'+_0x34825c+'\x22');}else{_0x4c3574[_0x5621('0x20')](_0x5621('0x8a'));}break;case _0x5621('0x36'):var _0x1c2830=parseInt(_0x34825c);_0x34825c=_[_0x5621('0x8b')](_0x1c2830)||_0x1c2830<0x0||_0x1c2830>0x4?_0x5aff0b?0x3:0x2:_0x1c2830;_0x3e2066['push']('\x22'+_0x34825c+'\x22');break;case _0x5621('0x37'):var _0x3efe8d=parseInt(_0x34825c);if(_['isNumber'](_0x3efe8d)&&_[_0x5621('0x7a')](_0x48702f,_0x3efe8d)){_0x3e2066['push']('\x22'+_0x3efe8d+'\x22');}else{_0x4c3574[_0x5621('0x20')](_0x5621('0x8c'));}break;case _0x5621('0x8d'):if(isEmail(_0x34825c)){_0x3e2066['push']('\x22'+_0x34825c+'\x22');}else{_0x4c3574['push'](_0x5621('0x8e'));}break;case'dateOfBirth':var _0x334317=moment(_0x34825c,_0x5621('0x8f'),!![]);if(_0x334317[_0x5621('0x89')]()){_0x3e2066[_0x5621('0x20')]('\x22'+_0x34825c+'\x22');}else{_0x4c3574['push'](_0x5621('0x90'));}break;case _0x5621('0x71'):var _0x1d7616=shared[_0x5621('0x6d')];var _0x372a3e=_0x1d7616[_0x34825c];if(!_['isNil'](_0x372a3e)){var _0x27c7f8=_0x372a3e[_0x5621('0x6e')];_0x3e2066[_0x5621('0x20')]('\x22'+_0x34825c+'\x22');_0x3e2066['push']('\x22'+_0x27c7f8+'\x22');}break;default:_0x3e2066[_0x5621('0x20')]('\x22'+_0x34825c+'\x22');}}else{switch(_0x2fb012){case'firstName':case _0x5621('0x14'):_0x4c3574['push'](_0x2fb012+_0x5621('0x91'));break;default:_0x3e2066[_0x5621('0x20')]('\x22\x22');}}}}else{var _0x22c018='';if(!_['isNil'](_0x4c0109)){if(!_0x54da4a['hasOwnProperty'](_0x4c0109['id'])){if(!_['isNil'](_0x3a4871[_0x5621('0x83')][_0x563672][_0x2eaff8[_0x2fb012]])){var _0x34825c=_[_0x5621('0x87')](_0x3a4871[_0x5621('0x83')][_0x563672][_0x2eaff8[_0x2fb012]]['replace'](/"/g,'\x27'));var _0x33c18c=phoneDescriptions[_0x5621('0x85')](_0x21531d=>_0x21531d['itemTypeId']===_0x4c0109['id']);if(!_[_0x5621('0x21')](_0x33c18c)){var _0x417c4c=_[_0x5621('0x87')](_0x3a4871[_0x5621('0x83')][_0x563672][_0x2eaff8[_0x33c18c[_0x5621('0x92')]]]['replace'](/"/g,'\x27'));if(!_['isNil'](_0x417c4c))_0x34825c=_0x34825c+'§'+_0x417c4c;}if(_0x22c018=='')_0x22c018=_0x34825c;else _0x22c018+='|'+_0x34825c;}_0x34093a[_0x5621('0x20')](_0x4c0109['id']+':'+_0x22c018);_0x54da4a[_0x4c0109['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3e2066[_0x5621('0x20')]('\x22'+_0x34093a['join'](';')+'\x22');}if(_0x4c3574[_0x5621('0x1d')]){handleError(_0x3a4871[_0x5621('0x83')][_0x563672],{'code':'SystemRow','message':_0x4c3574[_0x5621('0x18')]()});}else{fs[_0x5621('0x93')](_0x2af999,_0x3e2066[_0x5621('0x18')]()+'\x0a');}_0x3e2066=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0x5621('0x94')+_0xa3a60d,stats);stats['errors']=[];}}if(stopped){logger[_0x5621('0x5d')]('Abort\x20parser');_0x523012[_0x5621('0x95')]();}}catch(_0x43db2c){handleError(_0x3a4871[_0x5621('0x83')][_0x563672],{'code':_0x5621('0x96'),'message':_0x43db2c['message']});logger[_0x5621('0x5e')](_0x5621('0x97'),_0x43db2c[_0x5621('0x5f')]);}},'complete':function(){try{var _0x1542d5=[];var _0x5eaa00=[];var _0x1b1f1a=_0x5621('0x38');if(_0x160de5['duplicates']&&_0x160de5['duplicates'][_0x5621('0x1d')]){_0x1b1f1a=_0x5621('0x98')+_0xa3a60d;_0x1542d5[_0x5621('0x20')](_0x5621('0x99')+_0x1b1f1a+_0x5621('0x9a'));}tmp_campaigns=_0x5621('0x9b')+_0xa3a60d;tmp_voice_queues=_0x5621('0x9c')+_0xa3a60d;_0x5eaa00[_0x5621('0x20')](_0x5621('0x99')+tmp_campaigns+_0x5621('0x9d'));_0x5eaa00['push'](_0x5621('0x99')+tmp_voice_queues+_0x5621('0x9d'));BPromise[_0x5621('0x9e')](_0x5eaa00,handleTZQuery)[_0x5621('0x1c')](function(_0x116646){updateTzCampaigns(_0x160de5[_0x5621('0x33')])[_0x5621('0x1c')](function(_0x47f911){updateTzVoiceQueues(_0x160de5[_0x5621('0x33')])[_0x5621('0x1c')](function(_0x14a4aa){if(hasTZ)_0x411fb5=_0x411fb5['replace'](_0x5621('0x71'),'dialTimezone,utcOffset');var _0x33fca7=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x2af999,_0x1b1f1a,_0x411fb5,_0x160de5[_0x5621('0x33')],_0x160de5[_0x5621('0x9f')]||null,NOW,NOW);if(_[_0x5621('0x21')](_0x2eaff8['scheduledat'])){_0x33fca7+=_0x5621('0xa0');}_0x1542d5['push'](_0x33fca7);if(_0x160de5[_0x5621('0xa1')]&&_0x160de5[_0x5621('0xa1')]['length']){_0x1542d5[_0x5621('0x20')](insertCmContact(_0x160de5[_0x5621('0x33')],_0x1b1f1a,_0x160de5[_0x5621('0xa1')],_0x2eaff8));_0x1542d5[_0x5621('0x20')]('DROP\x20TABLE\x20'+_0x1b1f1a+';');}BPromise[_0x5621('0x9e')](_0x1542d5,handleQuery)['then'](function(_0x36bca8){BPromise[_0x5621('0x1e')]([handleAdditionalPhones()])[_0x5621('0x1c')](function(){_0x1542d5=[];for(var _0x13dd79=0x0;_0x13dd79<promisesAdditionalPhones[_0x5621('0x1d')];_0x13dd79++){if(promisesAdditionalPhones[_0x13dd79]['phone']!='§'){_0x1542d5['push'](createAdditionalPhone(promisesAdditionalPhones[_0x13dd79][_0x5621('0xa2')],promisesAdditionalPhones[_0x13dd79][_0x5621('0xa3')],promisesAdditionalPhones[_0x13dd79][_0x5621('0x14')],promisesAdditionalPhones[_0x13dd79][_0x5621('0xa4')]));}}BPromise[_0x5621('0x1e')](_0x1542d5)[_0x5621('0x1c')](function(){_0x1542d5=[];if(hasTZ){_0x1542d5[_0x5621('0x20')](insertTzCmHopper(_0x160de5[_0x5621('0x33')],_0x5621('0x6a'),_0x5621('0xa5'),'VoiceQueueId',_0x5aff0b,tmp_voice_queues));_0x1542d5[_0x5621('0x20')](insertTzCmHopperBlack(_0x160de5['ListId'],_0x5621('0xa6'),_0x5621('0xa5'),_0x5621('0xa7')));_0x1542d5[_0x5621('0x20')](insertTzCmHopper(_0x160de5[_0x5621('0x33')],_0x5621('0x68'),_0x5621('0x67'),_0x5621('0xa8'),_0x5aff0b,tmp_campaigns));_0x1542d5['push'](insertTzCmHopperBlack(_0x160de5[_0x5621('0x33')],'campaigns_has_cm_blacklists',_0x5621('0x67'),_0x5621('0xa8')));_0x1542d5['push'](insertCmHopperAdditionalPhones(_0x160de5[_0x5621('0x33')]));}else{_0x1542d5[_0x5621('0x20')](insertCmHopper(_0x160de5[_0x5621('0x33')],'voice_queues_has_cm_lists',_0x5621('0xa5'),_0x5621('0xa7'),_0x5aff0b));_0x1542d5[_0x5621('0x20')](insertCmHopperBlack(_0x160de5[_0x5621('0x33')],_0x5621('0xa6'),_0x5621('0xa5'),_0x5621('0xa7')));_0x1542d5['push'](insertCmHopper(_0x160de5[_0x5621('0x33')],_0x5621('0x68'),'campaigns',_0x5621('0xa8'),_0x5aff0b));_0x1542d5[_0x5621('0x20')](insertCmHopperBlack(_0x160de5[_0x5621('0x33')],_0x5621('0xa9'),_0x5621('0x67'),_0x5621('0xa8')));_0x1542d5[_0x5621('0x20')](insertCmHopperAdditionalPhones(_0x160de5[_0x5621('0x33')]));}_0x1542d5['push'](_0x5621('0xaa')+tmp_campaigns+';');_0x1542d5['push'](_0x5621('0xaa')+tmp_voice_queues+';');BPromise[_0x5621('0x9e')](_0x1542d5,handleQuery)['then'](function(_0x2ff3b9){stats[_0x5621('0xab')]=!![];stats[_0x5621('0xac')]=_0x160de5[_0x5621('0xa1')]&&_0x160de5[_0x5621('0xa1')][_0x5621('0x1d')]?results[0x2][_0x5621('0xac')]:results[0x0][_0x5621('0xac')];socket[_0x5621('0xad')](_0x5621('0x94')+_0xa3a60d,stats);fs['unlink'](_0x2cd36c);fs[_0x5621('0xae')](_0x2af999);process['exit'](0x0);})[_0x5621('0x66')](function(_0x2b0c0f){logger[_0x5621('0x5e')](_0x2b0c0f[_0x5621('0x5f')]);process[_0x5621('0x60')](0x1);});});});})[_0x5621('0x66')](function(_0x23570b){logger['error'](_0x23570b['message']);process[_0x5621('0x60')](0x1);});});});});}catch(_0x2b3aac){logger[_0x5621('0x5e')]('complete',_0x2b3aac['message']);process[_0x5621('0x60')](0x1);}},'error':function(_0x54c8e2,_0x42cbf7,_0x2ed555,_0x22f879){throw new Error(_0x22f879);}});});}function validate(){if(process[_0x5621('0xaf')]&&process[_0x5621('0xaf')][_0x5621('0x1d')]<0x4){throw new Error(_0x5621('0xb0'));}var _0x115003=path[_0x5621('0x18')](config[_0x5621('0xb1')],_0x5621('0x78'),process['argv'][0x2]);if(!fs[_0x5621('0xb2')](_0x115003)){throw new Error(_0x5621('0xb3'));}var _0x5f2281={};try{_0x5f2281=JSON['parse'](process[_0x5621('0xaf')][0x3]);if(!_0x5f2281[_0x5621('0x75')]){throw new Error(_0x5621('0xb4'));}if(!_0x5f2281[_0x5621('0x75')][_0x5621('0x14')]){throw new Error(_0x5621('0xb5'));}if(!_0x5f2281['binding'][_0x5621('0xb6')]){throw new Error(_0x5621('0xb7'));}var _0x58b6ba=0x0;if(_0x5f2281[_0x5621('0x75')][_0x5621('0x37')]){_0x58b6ba=0x1;}if(!_0x5f2281[_0x5621('0x33')]){throw new Error(_0x5621('0xb8'));}}catch(_0x29cbb4){throw new Error(_0x5621('0xb9'));}var _0x1f76bc=[];try{_0x1f76bc=_[_0x5621('0xba')](JSON[_0x5621('0x81')](process[_0x5621('0xaf')][0x4]),'id');}catch(_0x461d89){logger[_0x5621('0x5d')]('No\x20agent\x20available');}main(_0x115003,_0x5f2281,_0x1f76bc,_0x58b6ba);}validate();process['on']('SIGINT',handleStop);process['on'](_0x5621('0xbb'),handleUncaughtException);
\ No newline at end of file
+var _0xc3c2=['main','start','binding','clone','root','includes','ContactItemType','name','_description','header','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','UserId','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','description','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','contact:import:','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','phone','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','findAll','AdditionalPhones','push','all','length','then','split','isNil','CmContactHasItem','update','updated','create','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','recallme','select','fields','cm_contacts','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId\x20=\x20','cm_contacts.phone\x20NOT\x20IN\x20(?)','field','from','cm_hopper_black','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','updatedAt','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','spread','catch','message','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','sequelize','query','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','utcOffset','set','offset','dialTimezone'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc3c2,0x1bc));var _0x2c3c=function(_0x5758f1,_0x3c7c0a){_0x5758f1=_0x5758f1-0x0;var _0x933a6b=_0xc3c2[_0x5758f1];return _0x933a6b;};'use strict';var fs=require('fs');var path=require(_0x2c3c('0x0'));var _=require(_0x2c3c('0x1'));var Papa=require('papaparse');var util=require(_0x2c3c('0x2'));var BPromise=require(_0x2c3c('0x3'));var moment=require(_0x2c3c('0x4'));var squel=require(_0x2c3c('0x5'));var Redis=require(_0x2c3c('0x6'));var db=require(_0x2c3c('0x7'))['db'];var config=require('../../../config/environment');var shared=require(_0x2c3c('0x8'));var logger=require(_0x2c3c('0x9'))(_0x2c3c('0xa'));config['redis']=_[_0x2c3c('0xb')](config[_0x2c3c('0xc')],{'host':_0x2c3c('0xd'),'port':0x18eb});var socket=require(_0x2c3c('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x2c3c('0xf')](_0x2c3c('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x2c3c('0xf')](_0x2c3c('0x10'));function isEmail(_0x3407fc){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3407fc);}function selectNotIn(_0x191b04,_0x24aaa4,_0x196efe,_0x1a04dd,_0x429896){return squel['select']()['field'](_0x2c3c('0x11'))['from'](_0x1a04dd)['join'](_0x24aaa4,null,_0x24aaa4+_0x2c3c('0x12')+_0x1a04dd+'.'+_0x196efe)[_0x2c3c('0x13')](_0x1a04dd+'.'+_0x196efe+_0x2c3c('0x14')+_0x191b04+'.'+_0x196efe)[_0x2c3c('0x13')](_0x24aaa4+_0x2c3c('0x15')+_0x429896[_0x2c3c('0x16')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x34dbfe,_0xa1b852){promisesAdditionalPhones=[];return db['CmContact'][_0x2c3c('0x17')]({'raw':!![],'attributes':['id',_0x2c3c('0x18')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x4ea0cc){if(_0x4ea0cc!==null){var _0x57210f=[];for(var _0x361c2b=0x0;_0x361c2b<_0x4ea0cc['length'];_0x361c2b++){var _0x511969=_0x4ea0cc[_0x361c2b];_0x57210f[_0x2c3c('0x19')](insertAdditionalPhones(_0x511969));}}Promise[_0x2c3c('0x1a')](_0x57210f)['then'](function(){_0x34dbfe({'val':0x1});});});});}function insertAdditionalPhones(_0x259e45){return new Promise(function(_0x33fb36,_0x28ca56){var _0x36eb95=_0x259e45['AdditionalPhones'];var _0x41ab03=_0x36eb95['split'](';');var _0x34444b=[];orderBy=0x0;for(var _0x36294d=0x0;_0x36294d<_0x41ab03[_0x2c3c('0x1b')];_0x36294d++){_0x34444b[_0x2c3c('0x19')](splitAdditionalPhone(_0x259e45['id'],_0x41ab03[_0x36294d]));}Promise[_0x2c3c('0x1a')](_0x34444b)[_0x2c3c('0x1c')](function(){_0x33fb36({'val':_0x41ab03[_0x2c3c('0x1b')]});});});}function splitAdditionalPhone(_0x5ecefb,_0x770c6b){return new Promise(function(_0x3ada8d,_0x20bb03){var _0x2d83fd=_0x770c6b[_0x2c3c('0x1d')](':');var _0x32d060=_0x2d83fd[0x0];var _0x1b47db=_0x2d83fd[0x1];if(!_[_0x2c3c('0x1e')](_0x1b47db)){var _0x328c87=_0x1b47db[_0x2c3c('0x1d')]('|');var _0x30f37a=[];for(var _0x11a395=0x0;_0x11a395<_0x328c87[_0x2c3c('0x1b')];_0x11a395++){if(_0x328c87[_0x11a395]!==''){var _0x5984f9=_['filter'](promisesAdditionalPhones,{'contactId':_0x5ecefb,'phone':_0x328c87[_0x11a395]});if(_0x5984f9[_0x2c3c('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x2c3c('0x19')]({'contactId':_0x5ecefb,'contactTypeId':_0x32d060,'phone':_0x328c87[_0x11a395],'orderBy':orderBy});}}}_0x3ada8d({'ok':0x1});}else _0x3ada8d({'res':0x0});});}function createAdditionalPhone(_0x4317cc,_0x5a8211,_0x5f26d8,_0x13de2c){var _0xf49c5a='';var _0x4b5111='';var _0x566a2d=_0x5f26d8[_0x2c3c('0x1d')]('§');_0xf49c5a=_0x566a2d[0x0];if(_0x566a2d[_0x2c3c('0x1b')]==0x2)_0x4b5111=_0x566a2d[0x1];return new Promise(function(_0x10729d,_0x4f48b8){return db[_0x2c3c('0x1f')]['findOne']({'where':{'CmContactId':_0x4317cc,'item':_0xf49c5a}})[_0x2c3c('0x1c')](function(_0x385aa9){if(_0x385aa9){return db[_0x2c3c('0x1f')][_0x2c3c('0x20')]({'ItemTypeId':_0x5a8211,'description':_0x4b5111,'OrderBy':_0x13de2c},{'where':{'CmContactId':_0x4317cc,'item':_0xf49c5a}})[_0x2c3c('0x1c')](function(_0x3ecbe2){_0x10729d({'res':_0x2c3c('0x21')});});}else{return db[_0x2c3c('0x1f')][_0x2c3c('0x22')]({'CmContactId':_0x4317cc,'item':_0xf49c5a,'description':_0x4b5111,'ItemTypeId':_0x5a8211,'OrderBy':_0x13de2c,'ItemClass':'PHONE'})[_0x2c3c('0x1c')](function(_0x49080d){_0x10729d({'res':_0x2c3c('0x23')});});}});});}function insertCmHopper(_0x5e35ff,_0x1815aa,_0xee9486,_0x32fa98,_0x2824ca){var _0x5805b9=[_0x2c3c('0x24'),_0x2c3c('0x25'),_0x2c3c('0x26'),_0x2c3c('0x27'),_0x1815aa+'.'+_0x32fa98,_0x2c3c('0x28'),_0x2c3c('0x29'),_0x2c3c('0x2a'),_0x2c3c('0x2b'),'\x22'+_0x2824ca+'\x22'];return squel[_0x2c3c('0x2c')]()[_0x2c3c('0x2d')](_0x2c3c('0x2e'))[_0x2c3c('0x2f')](['phone',_0x2c3c('0x30'),_0x2c3c('0x31'),_0x2c3c('0x32'),_0x32fa98,_0x2c3c('0x33'),'updatedAt','priority','UserId',_0x2c3c('0x34')],squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x5805b9)['from'](_0x1815aa)['join'](_0x2c3c('0x37'),null,'cm_contacts.ListId\x20=\x20'+_0x1815aa+_0x2c3c('0x38'))[_0x2c3c('0x16')](_0xee9486,null,_0xee9486+'.id\x20=\x20'+_0x1815aa+'.'+_0x32fa98)[_0x2c3c('0x13')](_0x1815aa+_0x2c3c('0x39'),_0x5e35ff)[_0x2c3c('0x13')](_0x2c3c('0x3a'),NOW)[_0x2c3c('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1815aa,_0xee9486,_0x32fa98,'cm_hopper',[_0x2c3c('0x3b'),_0x2c3c('0x3c')]))[_0x2c3c('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1815aa,_0xee9486,_0x32fa98,_0x2c3c('0x2e'),[_0x2c3c('0x3b')])))[_0x2c3c('0x3d')]();}function insertCmHopperBlack(_0x3635a4,_0x109337,_0xb2554,_0x448086){var _0x2b7613=[_0x2c3c('0x24'),'cm_contacts.id',_0x2c3c('0x27'),_0x109337+'.'+_0x448086,_0x2c3c('0x28'),_0x2c3c('0x29')];return squel['insert']()[_0x2c3c('0x2d')]('cm_hopper_black')[_0x2c3c('0x2f')]([_0x2c3c('0x11'),_0x2c3c('0x31'),_0x2c3c('0x32'),_0x448086,_0x2c3c('0x33'),'updatedAt'],squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x2b7613)['from'](_0x109337)[_0x2c3c('0x16')](_0x2c3c('0x37'),null,_0x2c3c('0x3e')+_0x109337+_0x2c3c('0x38'))[_0x2c3c('0x16')](_0xb2554,null,_0xb2554+'.id\x20=\x20'+_0x109337+'.'+_0x448086)[_0x2c3c('0x13')](_0x109337+_0x2c3c('0x39'),_0x3635a4)[_0x2c3c('0x13')](_0x2c3c('0x3a'),NOW)[_0x2c3c('0x13')](_0x2c3c('0x3f'),squel[_0x2c3c('0x35')]()[_0x2c3c('0x40')](_0x2c3c('0x11'))[_0x2c3c('0x41')](_0x2c3c('0x42'))[_0x2c3c('0x13')]('ListId\x20=\x20?',_0x3635a4)[_0x2c3c('0x13')](_0x448086+_0x2c3c('0x14')+_0x109337+'.'+_0x448086)))[_0x2c3c('0x3d')]();}function insertTzCmHopper(_0x46273a,_0x15e9c6,_0x3bf724,_0x30faaf,_0x2d5ac0,_0x63d97b){var _0x320a87=[_0x2c3c('0x24'),_0x2c3c('0x43')+_0x63d97b+_0x2c3c('0x44'),_0x2c3c('0x26'),_0x2c3c('0x27'),_0x15e9c6+'.'+_0x30faaf,_0x2c3c('0x28'),'cm_contacts.updatedAt','cm_contacts.priority',_0x2c3c('0x2b'),'\x22'+_0x2d5ac0+'\x22'];var _0x27ce1f=squel['insert']()[_0x2c3c('0x2d')](_0x2c3c('0x2e'))[_0x2c3c('0x2f')](['phone',_0x2c3c('0x30'),_0x2c3c('0x31'),_0x2c3c('0x32'),_0x30faaf,_0x2c3c('0x33'),_0x2c3c('0x45'),'priority','UserId',_0x2c3c('0x34')],squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x320a87)[_0x2c3c('0x41')](_0x15e9c6)['join'](_0x2c3c('0x37'),null,_0x2c3c('0x3e')+_0x15e9c6+_0x2c3c('0x38'))[_0x2c3c('0x16')](_0x3bf724,null,_0x3bf724+_0x2c3c('0x12')+_0x15e9c6+'.'+_0x30faaf)['join'](_0x63d97b,null,_0x63d97b+'.id\x20=\x20'+_0x15e9c6+'.'+_0x30faaf)['where'](_0x15e9c6+_0x2c3c('0x39'),_0x46273a)[_0x2c3c('0x13')](_0x2c3c('0x3a'),NOW)[_0x2c3c('0x13')](_0x2c3c('0x3f'),selectNotIn(_0x15e9c6,_0x3bf724,_0x30faaf,_0x2c3c('0x2e'),[_0x2c3c('0x3b'),_0x2c3c('0x3c')]))[_0x2c3c('0x13')](_0x2c3c('0x3f'),selectNotIn(_0x15e9c6,_0x3bf724,_0x30faaf,_0x2c3c('0x2e'),[_0x2c3c('0x3b')])))[_0x2c3c('0x3d')]();return _0x27ce1f;}function insertTzCmHopperBlack(_0x1bb4b9,_0x85f3ee,_0x429244,_0x371d05){var _0x5c0025=[_0x2c3c('0x24'),_0x2c3c('0x26'),_0x2c3c('0x27'),_0x85f3ee+'.'+_0x371d05,_0x2c3c('0x28'),_0x2c3c('0x29')];return squel[_0x2c3c('0x2c')]()[_0x2c3c('0x2d')](_0x2c3c('0x42'))[_0x2c3c('0x2f')](['phone','ContactId',_0x2c3c('0x32'),_0x371d05,_0x2c3c('0x33'),_0x2c3c('0x45')],squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x5c0025)[_0x2c3c('0x41')](_0x85f3ee)['join'](_0x2c3c('0x37'),null,_0x2c3c('0x3e')+_0x85f3ee+'.CmListId')[_0x2c3c('0x16')](_0x429244,null,_0x429244+'.id\x20=\x20'+_0x85f3ee+'.'+_0x371d05)['where'](_0x85f3ee+_0x2c3c('0x39'),_0x1bb4b9)[_0x2c3c('0x13')](_0x2c3c('0x3a'),NOW)[_0x2c3c('0x13')](_0x2c3c('0x3f'),squel['select']()[_0x2c3c('0x40')]('phone')[_0x2c3c('0x41')](_0x2c3c('0x42'))[_0x2c3c('0x13')]('ListId\x20=\x20?',_0x1bb4b9)[_0x2c3c('0x13')](_0x371d05+_0x2c3c('0x14')+_0x85f3ee+'.'+_0x371d05)))['toString']();}function insertCmHopperAdditionalPhones(_0x2f9e47){var _0x1d7e24=[_0x2c3c('0x46'),_0x2c3c('0x47'),_0x2c3c('0x48'),_0x2c3c('0x49'),_0x2c3c('0x4a')];return squel['insert']()[_0x2c3c('0x2d')](_0x2c3c('0x4b'))[_0x2c3c('0x2f')]([_0x2c3c('0x4c'),'phone','OrderBy','createdAt',_0x2c3c('0x45')],squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x1d7e24)[_0x2c3c('0x41')](_0x2c3c('0x2e'))['join'](_0x2c3c('0x37'),null,_0x2c3c('0x4d'))[_0x2c3c('0x16')](_0x2c3c('0x4e'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x2c3c('0x13')](_0x2c3c('0x4f'),_0x2f9e47)[_0x2c3c('0x13')](_0x2c3c('0x3a'),NOW))[_0x2c3c('0x3d')]();}function insertCmContact(_0x2476c6,_0xc25d8c,_0x2b744c,_0x4a5cd0){var _0x396d28=_[_0x2c3c('0x50')](_[_0x2c3c('0x51')](_0x4a5cd0),[_0x2c3c('0x32'),_0x2c3c('0x52'),_0x2c3c('0x33'),_0x2c3c('0x45')]);return squel[_0x2c3c('0x2c')]()[_0x2c3c('0x2d')](_0x2c3c('0x37'))[_0x2c3c('0x2f')](_0x396d28,squel[_0x2c3c('0x35')]()[_0x2c3c('0x36')](_0x396d28)[_0x2c3c('0x41')](_0xc25d8c)[_0x2c3c('0x13')]('('+_0x2b744c[_0x2c3c('0x16')](',')+_0x2c3c('0x53'),squel['select']()[_0x2c3c('0x36')](_0x2b744c)[_0x2c3c('0x41')](_0x2c3c('0x37'))[_0x2c3c('0x13')](_0x2c3c('0x54'),_0x2476c6)[_0x2c3c('0x13')](_0x2c3c('0x55')))[_0x2c3c('0x13')](_0x2c3c('0x56'),squel[_0x2c3c('0x35')]()['field'](_0x2c3c('0x57'),_0x2c3c('0x58'))[_0x2c3c('0x41')](_0xc25d8c)[_0x2c3c('0x59')](_0x2b744c[_0x2c3c('0x16')](','))))[_0x2c3c('0x3d')]();}function handleStop(){logger[_0x2c3c('0x5a')](_0x2c3c('0x5b'));stopped=!![];}function handleUncaughtException(_0x37a112){logger[_0x2c3c('0x5c')](_0x37a112['message']);process[_0x2c3c('0x5d')](0x1);}function handleError(_0x3cd696,_0x2f6618){stats[_0x2c3c('0x5e')]['push']({'name':_0x2f6618[_0x2c3c('0x5f')],'message':_0x2f6618['message'],'row':_0x3cd696});}function handleQuery(_0x348391){logger['info'](_0x348391);return db['sequelize']['query'](_0x348391)[_0x2c3c('0x60')](function(_0x1f4bc5){results[_0x2c3c('0x19')](_0x1f4bc5);})[_0x2c3c('0x61')](function(_0x32d978){logger[_0x2c3c('0x5c')](_0x32d978[_0x2c3c('0x62')]);});}function updateTzCampaigns(_0x5b9a4d){return new Promise(function(_0x57f4c4,_0x4a80de){var _0x5682cd=squel['select']()[_0x2c3c('0x36')]([_0x2c3c('0x63'),_0x2c3c('0x64')])[_0x2c3c('0x41')]('campaigns')[_0x2c3c('0x16')](_0x2c3c('0x65'),null,_0x2c3c('0x66'))[_0x2c3c('0x13')](_0x2c3c('0x67')+_0x5b9a4d);db[_0x2c3c('0x68')][_0x2c3c('0x69')](_0x5682cd[_0x2c3c('0x3d')]())['spread'](function(_0x5c363f){var _0x489e9c=[];for(var _0x2fa38f=0x0;_0x2fa38f<_0x5c363f[_0x2c3c('0x1b')];_0x2fa38f++){_0x489e9c[_0x2c3c('0x19')](getTimezoneData(_0x5c363f[_0x2fa38f],tmp_campaigns));}BPromise[_0x2c3c('0x1a')](_0x489e9c)[_0x2c3c('0x1c')](function(){_0x57f4c4({'val':0x1});});})['catch'](function(_0x58bd1e){logger[_0x2c3c('0x5c')](_0x58bd1e[_0x2c3c('0x62')]);_0x57f4c4({'val':0x0});});});}function updateTzVoiceQueues(_0x555a58){return new Promise(function(_0x4f932e,_0x4061a7){var _0x24057e=squel[_0x2c3c('0x35')]()['fields']([_0x2c3c('0x6a'),'voice_queues.dialTimezone'])['from'](_0x2c3c('0x6b'))[_0x2c3c('0x16')](_0x2c3c('0x6c'),null,_0x2c3c('0x6d'))[_0x2c3c('0x13')]('voice_queues_has_cm_lists.CmListId='+_0x555a58);db[_0x2c3c('0x68')][_0x2c3c('0x69')](_0x24057e['toString']())['spread'](function(_0x568267){var _0x68b684=[];for(var _0x39dc99=0x0;_0x39dc99<_0x568267[_0x2c3c('0x1b')];_0x39dc99++){_0x68b684[_0x2c3c('0x19')](getTimezoneData(_0x568267[_0x39dc99],tmp_voice_queues));}BPromise[_0x2c3c('0x1a')](_0x68b684)[_0x2c3c('0x1c')](function(){_0x4f932e({'val':0x1});});})[_0x2c3c('0x61')](function(_0x5d24a5){logger[_0x2c3c('0x5c')](_0x5d24a5[_0x2c3c('0x62')]);_0x4f932e({'val':0x0});});});}function getTimezoneData(_0x447744,_0xe8c89d){return new Promise(function(_0xb0949f,_0x1438c9){var _0x5deeea=shared['timezones'];var _0x19faec=_0x5deeea[_0x447744['dialTimezone']];if(_[_0x2c3c('0x1e')](_0x19faec)){_0xb0949f({'ret':0x1});}else{var _0x625a86=_0x19faec[_0x2c3c('0x6e')];var _0x3bc4ba=squel['insert']()[_0x2c3c('0x2d')](_0xe8c89d)[_0x2c3c('0x6f')]('id',_0x447744['id'])['set'](_0x2c3c('0x70'),_0x625a86)[_0x2c3c('0x6f')](_0x2c3c('0x71'),_0x447744[_0x2c3c('0x71')])['toString']();return db[_0x2c3c('0x68')]['query'](_0x3bc4ba)[_0x2c3c('0x60')](function(_0x510c1b){_0xb0949f({'ret':0x1});})[_0x2c3c('0x61')](function(_0x2d39f2){logger[_0x2c3c('0x5c')](_0x2d39f2['message']);_0x1438c9({'ret':0x1});});}});}function handleTZQuery(_0x24d0db){logger[_0x2c3c('0x5a')](_0x24d0db);return db[_0x2c3c('0x68')][_0x2c3c('0x69')](_0x24d0db)[_0x2c3c('0x60')](function(_0x1ad525){})[_0x2c3c('0x61')](function(_0xa57619){logger['error'](_0xa57619[_0x2c3c('0x62')]);});}function main(_0x32e9ec,_0x5aaff5,_0x2f668c,_0x3c7b29){logger['info'](_0x2c3c('0x72'),_0x32e9ec,JSON['stringify'](_0x5aaff5));process['send'](_0x2c3c('0x73'));var _0x309c25=_0x5aaff5[_0x2c3c('0x74')];var _0x2c3d73=_[_0x2c3c('0x75')](_0x309c25);var _0x40c1ab=_0x5aaff5['socket_timestamp'];var _0x44b2f3=path[_0x2c3c('0x16')](config[_0x2c3c('0x76')],'server/files/tmp',_0x40c1ab+'.csv');hasTZ=_[_0x2c3c('0x51')](_0x309c25)[_0x2c3c('0x77')]('dialTimezone');var _0x5070ed=_[_0x2c3c('0x51')](_0x309c25)['join']();logger[_0x2c3c('0x5a')]('header',_0x5070ed);db[_0x2c3c('0x78')]['findAll']({'raw':!![],'attributes':['id','name']})[_0x2c3c('0x1c')](function(_0x17d9aa){for(var _0x2793c5=0x0;_0x2793c5<_0x17d9aa['length'];_0x2793c5++){if(_0x17d9aa[_0x2793c5][_0x2c3c('0x79')]in _0x309c25){contactItemTypes[_0x2c3c('0x19')](_0x17d9aa[_0x2793c5]);delete _0x2c3d73[_0x17d9aa[_0x2793c5][_0x2c3c('0x79')]];hasAdditionalPhones=!![];}for(var _0x4b4c95 in _0x309c25){if(_0x17d9aa[_0x2793c5][_0x2c3c('0x79')]+_0x2c3c('0x7a')===_0x4b4c95){phoneDescriptions[_0x2c3c('0x19')]({'itemTypeId':_0x17d9aa[_0x2793c5]['id'],'description':_0x4b4c95});delete _0x2c3d73[_0x4b4c95];}}}if(hasAdditionalPhones)_0x2c3d73['AdditionalPhones']='';var _0x49dd07=_[_0x2c3c('0x51')](_0x2c3d73)[_0x2c3c('0x16')]();logger[_0x2c3c('0x5a')](_0x2c3c('0x7b'),_0x49dd07);fs['writeFileSync'](_0x44b2f3,_0x49dd07+'\x0a');Papa[_0x2c3c('0x7c')](fs[_0x2c3c('0x7d')](_0x32e9ec),{'header':!![],'skipEmptyLines':!![],'step':function(_0x216068,_0xfbb94a){try{for(var _0x3b5d3c=0x0,_0x3bdb37=[];_0x3b5d3c<_0x216068[_0x2c3c('0x7e')][_0x2c3c('0x1b')];_0x3b5d3c++){stats[_0x2c3c('0x7f')]+=0x1;if(_0x216068['errors'][_0x3b5d3c]){handleError(_0x216068[_0x2c3c('0x7e')][_0x3b5d3c],_0x216068[_0x2c3c('0x5e')][_0x3b5d3c]);}else{var _0x347fb9=[];var _0x55af59=[];var _0x5e0219={};for(var _0x27c985 in _0x309c25){let _0x1faf3c=contactItemTypes[_0x2c3c('0x80')](_0x56ac2c=>_0x56ac2c[_0x2c3c('0x79')]===_0x27c985);let _0x4a37de=contactItemTypes[_0x2c3c('0x80')](_0x44fdf5=>_0x44fdf5[_0x2c3c('0x79')]+_0x2c3c('0x7a')===_0x27c985);if(_[_0x2c3c('0x1e')](_0x1faf3c)&&_['isNil'](_0x4a37de)){if(_0x309c25[_0x2c3c('0x81')](_0x27c985)){if(_0x216068[_0x2c3c('0x7e')][_0x3b5d3c][_0x309c25[_0x27c985]]){var _0xb969f2=_[_0x2c3c('0x82')](_0x216068[_0x2c3c('0x7e')][_0x3b5d3c][_0x309c25[_0x27c985]][_0x2c3c('0x83')](/"/g,'\x27'));switch(_0x27c985){case _0x2c3c('0x30'):var _0x1d5081=moment(_0xb969f2,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1d5081[_0x2c3c('0x84')]()){_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');}else{_0x347fb9[_0x2c3c('0x19')](_0x2c3c('0x85'));}break;case _0x2c3c('0x86'):var _0x17474b=parseInt(_0xb969f2);_0xb969f2=_[_0x2c3c('0x87')](_0x17474b)||_0x17474b<0x0||_0x17474b>0x4?_0x3c7b29?0x3:0x2:_0x17474b;_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');break;case _0x2c3c('0x88'):var _0x5f127b=parseInt(_0xb969f2);if(_['isNumber'](_0x5f127b)&&_[_0x2c3c('0x77')](_0x2f668c,_0x5f127b)){_0x3bdb37['push']('\x22'+_0x5f127b+'\x22');}else{_0x347fb9[_0x2c3c('0x19')](_0x2c3c('0x89'));}break;case'email':if(isEmail(_0xb969f2)){_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');}else{_0x347fb9[_0x2c3c('0x19')](_0x2c3c('0x8a'));}break;case _0x2c3c('0x8b'):var _0x4a743b=moment(_0xb969f2,'YYYY-MM-DD',!![]);if(_0x4a743b[_0x2c3c('0x84')]()){_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');}else{_0x347fb9[_0x2c3c('0x19')](_0x2c3c('0x8c'));}break;case _0x2c3c('0x71'):var _0xc2ac65=shared['timezones'];var _0x50ef50=_0xc2ac65[_0xb969f2];if(!_[_0x2c3c('0x1e')](_0x50ef50)){var _0x279d03=_0x50ef50[_0x2c3c('0x6e')];_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0x279d03+'\x22');}break;default:_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0xb969f2+'\x22');}}else{switch(_0x27c985){case _0x2c3c('0x8d'):case _0x2c3c('0x11'):_0x347fb9[_0x2c3c('0x19')](_0x27c985+_0x2c3c('0x8e'));break;default:_0x3bdb37[_0x2c3c('0x19')]('\x22\x22');}}}}else{var _0x2cfe8b='';if(!_['isNil'](_0x1faf3c)){if(!_0x5e0219['hasOwnProperty'](_0x1faf3c['id'])){if(!_[_0x2c3c('0x1e')](_0x216068[_0x2c3c('0x7e')][_0x3b5d3c][_0x309c25[_0x27c985]])){var _0xb969f2=_[_0x2c3c('0x82')](_0x216068[_0x2c3c('0x7e')][_0x3b5d3c][_0x309c25[_0x27c985]]['replace'](/"/g,'\x27'));var _0x47aa02=phoneDescriptions[_0x2c3c('0x80')](_0x3f8cda=>_0x3f8cda['itemTypeId']===_0x1faf3c['id']);if(!_[_0x2c3c('0x1e')](_0x47aa02)){var _0x4ae31d=_['trim'](_0x216068[_0x2c3c('0x7e')][_0x3b5d3c][_0x309c25[_0x47aa02[_0x2c3c('0x8f')]]]['replace'](/"/g,'\x27'));if(!_[_0x2c3c('0x1e')](_0x4ae31d))_0xb969f2=_0xb969f2+'§'+_0x4ae31d;}if(_0x2cfe8b=='')_0x2cfe8b=_0xb969f2;else _0x2cfe8b+='|'+_0xb969f2;}_0x55af59[_0x2c3c('0x19')](_0x1faf3c['id']+':'+_0x2cfe8b);_0x5e0219[_0x1faf3c['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3bdb37[_0x2c3c('0x19')]('\x22'+_0x55af59[_0x2c3c('0x16')](';')+'\x22');}if(_0x347fb9[_0x2c3c('0x1b')]){handleError(_0x216068[_0x2c3c('0x7e')][_0x3b5d3c],{'code':_0x2c3c('0x90'),'message':_0x347fb9['join']()});}else{fs[_0x2c3c('0x91')](_0x44b2f3,_0x3bdb37[_0x2c3c('0x16')]()+'\x0a');}_0x3bdb37=[];}if(!(stats[_0x2c3c('0x7f')]%0xc8)){socket[_0x2c3c('0x92')]('contact:import:'+_0x40c1ab,stats);stats[_0x2c3c('0x5e')]=[];}}if(stopped){logger[_0x2c3c('0x5a')](_0x2c3c('0x93'));_0xfbb94a[_0x2c3c('0x94')]();}}catch(_0x4e8dfe){handleError(_0x216068['data'][_0x3b5d3c],{'code':_0x2c3c('0x95'),'message':_0x4e8dfe[_0x2c3c('0x62')]});logger[_0x2c3c('0x5c')](_0x2c3c('0x96'),_0x4e8dfe['message']);}},'complete':function(){try{var _0x586d78=[];var _0x1e4851=[];var _0x55bcc6=_0x2c3c('0x37');if(_0x5aaff5[_0x2c3c('0x97')]&&_0x5aaff5[_0x2c3c('0x97')][_0x2c3c('0x1b')]){_0x55bcc6=_0x2c3c('0x98')+_0x40c1ab;_0x586d78[_0x2c3c('0x19')](_0x2c3c('0x99')+_0x55bcc6+_0x2c3c('0x9a'));}tmp_campaigns=_0x2c3c('0x9b')+_0x40c1ab;tmp_voice_queues=_0x2c3c('0x9c')+_0x40c1ab;_0x1e4851[_0x2c3c('0x19')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x2c3c('0x9d'));_0x1e4851[_0x2c3c('0x19')](_0x2c3c('0x99')+tmp_voice_queues+_0x2c3c('0x9d'));BPromise[_0x2c3c('0x9e')](_0x1e4851,handleTZQuery)[_0x2c3c('0x1c')](function(_0x347abe){updateTzCampaigns(_0x5aaff5[_0x2c3c('0x32')])[_0x2c3c('0x1c')](function(_0x7e4b64){updateTzVoiceQueues(_0x5aaff5['ListId'])[_0x2c3c('0x1c')](function(_0x5ad2d1){if(hasTZ)_0x49dd07=_0x49dd07['replace'](_0x2c3c('0x71'),'dialTimezone,utcOffset');var _0x1a7539=util[_0x2c3c('0xf')]('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',_0x44b2f3,_0x55bcc6,_0x49dd07,_0x5aaff5[_0x2c3c('0x32')],_0x5aaff5[_0x2c3c('0x52')]||null,NOW,NOW);if(_[_0x2c3c('0x1e')](_0x309c25[_0x2c3c('0x30')])){_0x1a7539+=_0x2c3c('0x9f');}_0x586d78['push'](_0x1a7539);if(_0x5aaff5[_0x2c3c('0x97')]&&_0x5aaff5[_0x2c3c('0x97')]['length']){_0x586d78[_0x2c3c('0x19')](insertCmContact(_0x5aaff5[_0x2c3c('0x32')],_0x55bcc6,_0x5aaff5[_0x2c3c('0x97')],_0x309c25));_0x586d78[_0x2c3c('0x19')](_0x2c3c('0xa0')+_0x55bcc6+';');}BPromise[_0x2c3c('0x9e')](_0x586d78,handleQuery)[_0x2c3c('0x1c')](function(_0x26038a){BPromise[_0x2c3c('0x1a')]([handleAdditionalPhones()])['then'](function(){_0x586d78=[];for(var _0x34cb9d=0x0;_0x34cb9d<promisesAdditionalPhones[_0x2c3c('0x1b')];_0x34cb9d++){if(promisesAdditionalPhones[_0x34cb9d][_0x2c3c('0x11')]!='§'){_0x586d78['push'](createAdditionalPhone(promisesAdditionalPhones[_0x34cb9d][_0x2c3c('0xa1')],promisesAdditionalPhones[_0x34cb9d][_0x2c3c('0xa2')],promisesAdditionalPhones[_0x34cb9d]['phone'],promisesAdditionalPhones[_0x34cb9d][_0x2c3c('0xa3')]));}}BPromise[_0x2c3c('0x1a')](_0x586d78)[_0x2c3c('0x1c')](function(){_0x586d78=[];if(hasTZ){_0x586d78['push'](insertTzCmHopper(_0x5aaff5[_0x2c3c('0x32')],'voice_queues_has_cm_lists',_0x2c3c('0x6b'),_0x2c3c('0xa4'),_0x3c7b29,tmp_voice_queues));_0x586d78['push'](insertTzCmHopperBlack(_0x5aaff5[_0x2c3c('0x32')],_0x2c3c('0xa5'),_0x2c3c('0x6b'),_0x2c3c('0xa4')));_0x586d78['push'](insertTzCmHopper(_0x5aaff5[_0x2c3c('0x32')],'campaigns_has_cm_lists',_0x2c3c('0xa6'),_0x2c3c('0xa7'),_0x3c7b29,tmp_campaigns));_0x586d78[_0x2c3c('0x19')](insertTzCmHopperBlack(_0x5aaff5[_0x2c3c('0x32')],'campaigns_has_cm_blacklists','campaigns',_0x2c3c('0xa7')));_0x586d78[_0x2c3c('0x19')](insertCmHopperAdditionalPhones(_0x5aaff5[_0x2c3c('0x32')]));}else{_0x586d78[_0x2c3c('0x19')](insertCmHopper(_0x5aaff5[_0x2c3c('0x32')],_0x2c3c('0x6c'),_0x2c3c('0x6b'),_0x2c3c('0xa4'),_0x3c7b29));_0x586d78[_0x2c3c('0x19')](insertCmHopperBlack(_0x5aaff5[_0x2c3c('0x32')],_0x2c3c('0xa5'),_0x2c3c('0x6b'),_0x2c3c('0xa4')));_0x586d78['push'](insertCmHopper(_0x5aaff5[_0x2c3c('0x32')],'campaigns_has_cm_lists',_0x2c3c('0xa6'),'CampaignId',_0x3c7b29));_0x586d78[_0x2c3c('0x19')](insertCmHopperBlack(_0x5aaff5[_0x2c3c('0x32')],_0x2c3c('0xa8'),_0x2c3c('0xa6'),'CampaignId'));_0x586d78[_0x2c3c('0x19')](insertCmHopperAdditionalPhones(_0x5aaff5[_0x2c3c('0x32')]));}_0x586d78['push'](_0x2c3c('0xa0')+tmp_campaigns+';');_0x586d78[_0x2c3c('0x19')](_0x2c3c('0xa0')+tmp_voice_queues+';');BPromise['each'](_0x586d78,handleQuery)[_0x2c3c('0x1c')](function(_0x5e42f9){stats[_0x2c3c('0xa9')]=!![];stats[_0x2c3c('0xaa')]=_0x5aaff5[_0x2c3c('0x97')]&&_0x5aaff5[_0x2c3c('0x97')][_0x2c3c('0x1b')]?results[0x2][_0x2c3c('0xaa')]:results[0x0][_0x2c3c('0xaa')];socket[_0x2c3c('0x92')](_0x2c3c('0xab')+_0x40c1ab,stats);fs[_0x2c3c('0xac')](_0x32e9ec);fs[_0x2c3c('0xac')](_0x44b2f3);process[_0x2c3c('0x5d')](0x0);})[_0x2c3c('0x61')](function(_0xa2c872){logger[_0x2c3c('0x5c')](_0xa2c872[_0x2c3c('0x62')]);process['exit'](0x1);});});});})['catch'](function(_0x562eab){logger[_0x2c3c('0x5c')](_0x562eab[_0x2c3c('0x62')]);process[_0x2c3c('0x5d')](0x1);});});});});}catch(_0x18ee1d){logger[_0x2c3c('0x5c')](_0x2c3c('0xad'),_0x18ee1d[_0x2c3c('0x62')]);process['exit'](0x1);}},'error':function(_0x5d423b,_0x310904,_0x4be3b2,_0x1613f2){throw new Error(_0x1613f2);}});});}function validate(){if(process[_0x2c3c('0xae')]&&process[_0x2c3c('0xae')][_0x2c3c('0x1b')]<0x4){throw new Error(_0x2c3c('0xaf'));}var _0xfea13b=path[_0x2c3c('0x16')](config[_0x2c3c('0x76')],_0x2c3c('0xb0'),process[_0x2c3c('0xae')][0x2]);if(!fs[_0x2c3c('0xb1')](_0xfea13b)){throw new Error(_0x2c3c('0xb2'));}var _0x12c7f3={};try{_0x12c7f3=JSON[_0x2c3c('0x7c')](process[_0x2c3c('0xae')][0x3]);if(!_0x12c7f3[_0x2c3c('0x74')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x12c7f3[_0x2c3c('0x74')][_0x2c3c('0x11')]){throw new Error(_0x2c3c('0xb3'));}if(!_0x12c7f3[_0x2c3c('0x74')][_0x2c3c('0x8d')]){throw new Error(_0x2c3c('0xb4'));}var _0x5d05e6=0x0;if(_0x12c7f3[_0x2c3c('0x74')][_0x2c3c('0x88')]){_0x5d05e6=0x1;}if(!_0x12c7f3[_0x2c3c('0x32')]){throw new Error(_0x2c3c('0xb5'));}}catch(_0x140ba2){throw new Error('body\x20id\x20mandatory');}var _0x56d13f=[];try{_0x56d13f=_[_0x2c3c('0xb6')](JSON[_0x2c3c('0x7c')](process[_0x2c3c('0xae')][0x4]),'id');}catch(_0x4046c4){logger[_0x2c3c('0x5a')](_0x2c3c('0xb7'));}main(_0xfea13b,_0x12c7f3,_0x56d13f,_0x5d05e6);}validate();process['on'](_0x2c3c('0xb8'),handleStop);process['on'](_0x2c3c('0xb9'),handleUncaughtException);
\ No newline at end of file
index 392b9ba..6967f7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe35d=['socket_timestamp','root','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','parse','data','find','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','trim','itemTypeId','description','SystemRow','rows','emit','contact:import:','abort','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','contact','contactId','contactTypeId','orderBy','DROP\x20TABLE\x20','each','finish','affectedRows','unlink','complete','argv','server/files/tmp','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','select','phone','where','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','push','catch','error','message','AdditionalPhones','all','split','filter','CmContactHasItem','findOne','then','update','updated','create','inserted','CmContact','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','join','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_hopper_black','from','field','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','cm_contact_has_items','cm_hopper.ListId\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','exit','errors','code','main','send','start','binding','clone'];(function(_0x15ee41,_0x9275d8){var _0x2b2846=function(_0x88d0a4){while(--_0x88d0a4){_0x15ee41['push'](_0x15ee41['shift']());}};_0x2b2846(++_0x9275d8);}(_0xe35d,0xd5));var _0xde35=function(_0x4884ba,_0x476151){_0x4884ba=_0x4884ba-0x0;var _0x53bef4=_0xe35d[_0x4884ba];return _0x53bef4;};'use strict';var fs=require('fs');var path=require(_0xde35('0x0'));var _=require(_0xde35('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xde35('0x2'));var moment=require(_0xde35('0x3'));var squel=require(_0xde35('0x4'));var Redis=require(_0xde35('0x5'));var db=require(_0xde35('0x6'))['db'];var config=require(_0xde35('0x7'));var logger=require(_0xde35('0x8'))(_0xde35('0x9'));config[_0xde35('0xa')]=_[_0xde35('0xb')](config['redis'],{'host':_0xde35('0xc'),'port':0x18eb});var socket=require(_0xde35('0xd'))(new Redis(config[_0xde35('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xde35('0xe')](_0xde35('0xf'));var tempTableName='cm_contacts_temp_'+moment()[_0xde35('0xe')](_0xde35('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x37bcfc){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x37bcfc);}function selectNotIn(_0x382863,_0x2cbb1d,_0x5dfc41,_0x10e21e,_0x5c3db0){return squel[_0xde35('0x11')]()['field'](_0xde35('0x12'))['from'](_0x10e21e)['join'](_0x2cbb1d,null,_0x2cbb1d+'.id\x20=\x20'+_0x10e21e+'.'+_0x5dfc41)['where'](_0x10e21e+'.'+_0x5dfc41+'\x20=\x20'+_0x382863+'.'+_0x5dfc41)[_0xde35('0x13')](_0x2cbb1d+_0xde35('0x14')+_0x5c3db0['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x560d70,_0x8c9864){promisesAdditionalPhones=[];promisesContact=[];return db[_0xde35('0x15')][_0xde35('0x16')](_0xde35('0x17')+tempTableName)[_0xde35('0x18')](function(_0x5d8c6e){if(_0x5d8c6e!==null){var _0x1c87c6=[];for(var _0x16956e=0x0;_0x16956e<_0x5d8c6e[_0xde35('0x19')];_0x16956e++){var _0x3c1c74=_0x5d8c6e[_0x16956e];if(!_[_0xde35('0x1a')](_0x3c1c74[_0xde35('0x12')])){if(!_[_0xde35('0x1a')](_0x3c1c74['AdditionalPhones']))_0x1c87c6[_0xde35('0x1b')](insertAdditionalPhones(_0x3c1c74));promisesContact['push']({'contact':_0x3c1c74});}}}Promise['all'](_0x1c87c6)['then'](function(){_0x560d70({'val':0x1});});})[_0xde35('0x1c')](function(_0x487422){logger[_0xde35('0x1d')](_0x487422[_0xde35('0x1e')]);});});}function insertAdditionalPhones(_0x73c782){return new Promise(function(_0x3d66d6,_0x104a3b){var _0x5f387f=_0x73c782[_0xde35('0x1f')];if(_[_0xde35('0x1a')](_0x5f387f))_0x104a3b({'val':0x0});else{var _0x190ccd=_0x5f387f['split'](';');var _0x48c253=[];orderBy=0x0;for(var _0x560c11=0x0;_0x560c11<_0x190ccd['length'];_0x560c11++){_0x48c253[_0xde35('0x1b')](splitAdditionalPhone(_0x73c782['id'],_0x190ccd[_0x560c11]));}Promise[_0xde35('0x20')](_0x48c253)['then'](function(){_0x3d66d6({'val':_0x190ccd[_0xde35('0x19')]});});}});}function splitAdditionalPhone(_0x126248,_0xbbb922){return new Promise(function(_0x560f3a,_0x9ea752){var _0x304e52=_0xbbb922[_0xde35('0x21')](':');var _0x3af90d=_0x304e52[0x0];var _0x256277=_0x304e52[0x1];if(_0x256277!==''){var _0x1b3a37=_0x256277[_0xde35('0x21')]('|');var _0x4a29a2=[];for(var _0x31a61d=0x0;_0x31a61d<_0x1b3a37['length'];_0x31a61d++){if(_0x1b3a37[_0x31a61d]!==''){var _0x2ff922=_[_0xde35('0x22')](promisesAdditionalPhones,{'contactId':_0x126248,'phone':_0x1b3a37[_0x31a61d]});if(_0x2ff922[_0xde35('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xde35('0x1b')]({'contactId':_0x126248,'contactTypeId':_0x3af90d,'phone':_0x1b3a37[_0x31a61d],'orderBy':orderBy});}}}_0x560f3a({'ok':0x1});}else _0x560f3a({'res':0x0});});}function createAdditionalPhone(_0x52a08a,_0x17f62d,_0x2fcc94,_0x10533a){var _0x17da4e='';var _0x459d29='';var _0x45ca01=_0x2fcc94[_0xde35('0x21')]('§');_0x17da4e=_0x45ca01[0x0];if(_0x45ca01['length']==0x2)_0x459d29=_0x45ca01[0x1];return new Promise(function(_0x15fa11,_0x2ddfe1){return db[_0xde35('0x23')][_0xde35('0x24')]({'where':{'CmContactId':_0x52a08a,'item':_0x17da4e}})[_0xde35('0x25')](function(_0x3f8609){if(_0x3f8609){return db[_0xde35('0x23')][_0xde35('0x26')]({'ItemTypeId':_0x17f62d,'description':_0x459d29,'OrderBy':_0x10533a},{'where':{'CmContactId':_0x52a08a,'item':_0x17da4e}})['then'](function(_0x32ed0d){_0x15fa11({'res':_0xde35('0x27')});});}else{return db[_0xde35('0x23')][_0xde35('0x28')]({'CmContactId':_0x52a08a,'item':_0x17da4e,'ItemTypeId':_0x17f62d,'description':_0x459d29,'OrderBy':_0x10533a,'ItemClass':'PHONE'})['then'](function(_0x31634f){_0x15fa11({'res':_0xde35('0x29')});});}});});}function updateContact(_0x1a5175){return new Promise(function(_0x4ee0b3,_0x3946cd){var _0x27be6e=_0x1a5175['id'];delete _0x1a5175['id'];return db[_0xde35('0x2a')][_0xde35('0x26')](_0x1a5175,{'where':{'id':_0x27be6e}})[_0xde35('0x25')](function(_0x5de9d2){updatedRows+=0x1;return db[_0xde35('0x2b')][_0xde35('0x26')]({'phone':_0x1a5175['phone']},{'where':{'ContactId':_0x27be6e}})[_0xde35('0x25')](function(_0x253f51){_0x4ee0b3({'ret':'OK'});});});});}function insertCmHopper(_0x33ae79,_0x26b8d4,_0x27916d,_0x47aaa,_0x5a8d94){var _0x4f3a61=[_0xde35('0x2c'),_0xde35('0x2d'),_0xde35('0x2e'),'cm_contacts.ListId',_0x26b8d4+'.'+_0x47aaa,_0xde35('0x2f'),_0xde35('0x30'),'cm_contacts.priority',_0xde35('0x31'),'\x22'+_0x5a8d94+'\x22'];return squel[_0xde35('0x32')]()[_0xde35('0x33')]('cm_hopper')[_0xde35('0x34')]([_0xde35('0x12'),_0xde35('0x35'),_0xde35('0x36'),_0xde35('0x37'),_0x47aaa,_0xde35('0x38'),_0xde35('0x39'),'priority',_0xde35('0x3a'),_0xde35('0x3b')],squel[_0xde35('0x11')]()[_0xde35('0x3c')](_0x4f3a61)['from'](_0x26b8d4)[_0xde35('0x3d')](_0xde35('0x3e'),null,_0xde35('0x3f')+_0x26b8d4+_0xde35('0x40'))['join'](_0x27916d,null,_0x27916d+_0xde35('0x41')+_0x26b8d4+'.'+_0x47aaa)[_0xde35('0x13')](_0x26b8d4+_0xde35('0x42'),_0x33ae79)[_0xde35('0x13')](_0xde35('0x43'),NOW)['where'](_0xde35('0x44'),selectNotIn(_0x26b8d4,_0x27916d,_0x47aaa,_0xde35('0x45'),[_0xde35('0x46'),_0xde35('0x47')]))[_0xde35('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x26b8d4,_0x27916d,_0x47aaa,'cm_hopper',['\x22always\x22'])))[_0xde35('0x48')]();}function insertCmHopperBlack(_0x4792d0,_0x13c077,_0x298eaf,_0x4adfbf){var _0x1e04c0=[_0xde35('0x2c'),_0xde35('0x2e'),'cm_contacts.ListId',_0x13c077+'.'+_0x4adfbf,_0xde35('0x2f'),_0xde35('0x30')];return squel[_0xde35('0x32')]()[_0xde35('0x33')](_0xde35('0x49'))[_0xde35('0x34')]([_0xde35('0x12'),_0xde35('0x36'),_0xde35('0x37'),_0x4adfbf,_0xde35('0x38'),_0xde35('0x39')],squel[_0xde35('0x11')]()['fields'](_0x1e04c0)[_0xde35('0x4a')](_0x13c077)[_0xde35('0x3d')](_0xde35('0x3e'),null,_0xde35('0x3f')+_0x13c077+_0xde35('0x40'))[_0xde35('0x3d')](_0x298eaf,null,_0x298eaf+'.id\x20=\x20'+_0x13c077+'.'+_0x4adfbf)[_0xde35('0x13')](_0x13c077+'.CmListId\x20=\x20?',_0x4792d0)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0xde35('0x13')](_0xde35('0x44'),squel[_0xde35('0x11')]()[_0xde35('0x4b')](_0xde35('0x12'))[_0xde35('0x4a')](_0xde35('0x49'))[_0xde35('0x13')](_0xde35('0x4c'),_0x4792d0)[_0xde35('0x13')](_0x4adfbf+'\x20=\x20?',_0x13c077+'.'+_0x4adfbf)))[_0xde35('0x48')]();}function insertCmHopperAdditionalPhones(_0x2ff917){var _0x57d37c=[_0xde35('0x4d'),'cm_contact_has_items.item',_0xde35('0x4e'),_0xde35('0x4f'),_0xde35('0x50')];return squel[_0xde35('0x32')]()['into'](_0xde35('0x51'))[_0xde35('0x34')](['CmHopperId',_0xde35('0x12'),_0xde35('0x52'),_0xde35('0x38'),_0xde35('0x39')],squel[_0xde35('0x11')]()['fields'](_0x57d37c)['from'](_0xde35('0x45'))[_0xde35('0x3d')](_0xde35('0x3e'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0xde35('0x3d')](_0xde35('0x53'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0xde35('0x13')](_0xde35('0x54'),_0x2ff917)[_0xde35('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW))[_0xde35('0x48')]();}function insertCmContact(_0x108bec,_0x5e8cd7,_0x1a9b20,_0x297564){var _0x5964e7=_[_0xde35('0x55')](_[_0xde35('0x56')](_0x297564),[_0xde35('0x37'),_0xde35('0x57'),_0xde35('0x38'),_0xde35('0x39')]);return squel[_0xde35('0x32')]()[_0xde35('0x33')]('cm_contacts')['fromQuery'](_0x5964e7,squel['select']()[_0xde35('0x3c')](_0x5964e7)['from'](_0x5e8cd7)[_0xde35('0x13')]('('+_0x1a9b20['join'](',')+')\x20NOT\x20IN\x20?',squel[_0xde35('0x11')]()[_0xde35('0x3c')](_0x1a9b20)[_0xde35('0x4a')]('cm_contacts')[_0xde35('0x13')](_0xde35('0x4c'),_0x108bec))[_0xde35('0x13')](_0xde35('0x58'),squel['select']()[_0xde35('0x4b')](_0xde35('0x59'),_0xde35('0x5a'))[_0xde35('0x4a')](_0x5e8cd7)[_0xde35('0x5b')](_0x1a9b20[_0xde35('0x3d')](','))))[_0xde35('0x48')]();}function handleStop(){logger[_0xde35('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x56e93b){logger[_0xde35('0x1d')](_0x56e93b[_0xde35('0x1e')]);process[_0xde35('0x5d')](0x1);}function handleError(_0x2bfa37,_0x5dff29){stats[_0xde35('0x5e')][_0xde35('0x1b')]({'name':_0x5dff29[_0xde35('0x5f')],'message':_0x5dff29[_0xde35('0x1e')],'row':_0x2bfa37});}function handleQuery(_0x75a47d){logger[_0xde35('0x5c')](_0x75a47d);return db[_0xde35('0x15')][_0xde35('0x16')](_0x75a47d)[_0xde35('0x18')](function(_0x253248){results[_0xde35('0x1b')](_0x253248);})[_0xde35('0x1c')](function(_0x326504){logger['error'](_0x326504[_0xde35('0x1e')]);});}function main(_0x38333e,_0x59bfaf,_0x30e2e5,_0x4322ce){logger[_0xde35('0x5c')](_0xde35('0x60'),_0x38333e,JSON['stringify'](_0x59bfaf));process[_0xde35('0x61')](_0xde35('0x62'));var _0x17e806=_0x59bfaf[_0xde35('0x63')];var _0x381674=_[_0xde35('0x64')](_0x17e806);var _0x48b880=_0x59bfaf[_0xde35('0x65')];var _0x784b38=path['join'](config[_0xde35('0x66')],'server/files/tmp',_0x48b880+_0xde35('0x67'));logger['info'](_0xde35('0x68'),_0x59bfaf);db[_0xde35('0x69')][_0xde35('0x6a')]({'raw':!![],'attributes':['id',_0xde35('0x6b')]})[_0xde35('0x25')](function(_0x2464af){for(var _0xd547ae=0x0;_0xd547ae<_0x2464af[_0xde35('0x19')];_0xd547ae++){if(_0x2464af[_0xd547ae][_0xde35('0x6b')]in _0x17e806){contactItemTypes[_0xde35('0x1b')](_0x2464af[_0xd547ae]);delete _0x381674[_0x2464af[_0xd547ae][_0xde35('0x6b')]];hasAdditionalPhones=!![];}for(var _0x102d27 in _0x17e806){if(_0x2464af[_0xd547ae]['name']+_0xde35('0x6c')===_0x102d27){phoneDescriptions[_0xde35('0x1b')]({'itemTypeId':_0x2464af[_0xd547ae]['id'],'description':_0x102d27});delete _0x381674[_0x102d27];}}}if(hasAdditionalPhones)_0x381674[_0xde35('0x1f')]='';var _0x109243=_[_0xde35('0x56')](_0x381674)[_0xde35('0x3d')]();logger[_0xde35('0x5c')](_0xde35('0x6d'),_0x109243);fs[_0xde35('0x6e')](_0x784b38,_0x109243+'\x0a');Papa[_0xde35('0x6f')](fs['createReadStream'](_0x38333e),{'header':!![],'skipEmptyLines':!![],'step':function(_0x57a8c9,_0x3573ad){try{for(var _0x4b777c=0x0,_0x24832d=[];_0x4b777c<_0x57a8c9[_0xde35('0x70')][_0xde35('0x19')];_0x4b777c++){stats['rows']+=0x1;if(_0x57a8c9[_0xde35('0x5e')][_0x4b777c]){handleError(_0x57a8c9[_0xde35('0x70')][_0x4b777c],_0x57a8c9['errors'][_0x4b777c]);}else{var _0x4f37a4=[];var _0x38602e=[];var _0x53dbbe={};for(var _0x492e05 in _0x17e806){let _0x350540=contactItemTypes['find'](_0x4c99a6=>_0x4c99a6[_0xde35('0x6b')]===_0x492e05);let _0x324806=contactItemTypes[_0xde35('0x71')](_0x105047=>_0x105047['name']+_0xde35('0x6c')===_0x492e05);if(_[_0xde35('0x1a')](_0x350540)&&_[_0xde35('0x1a')](_0x324806)){if(_0x17e806[_0xde35('0x72')](_0x492e05)){if(_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]]){var _0x434022=_['trim'](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05]][_0xde35('0x73')](/"/g,'\x27'));switch(_0x492e05){case _0xde35('0x35'):var _0x56775f=moment(_0x434022,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x56775f[_0xde35('0x74')]()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4['push'](_0xde35('0x75'));}break;case _0xde35('0x76'):var _0x15e768=parseInt(_0x434022);_0x434022=_['isNaN'](_0x15e768)||_0x15e768<0x0||_0x15e768>0x4?_0x4322ce?0x3:0x2:_0x15e768;_0x24832d['push']('\x22'+_0x434022+'\x22');break;case _0xde35('0x3a'):var _0x3d8a79=parseInt(_0x434022);if(_[_0xde35('0x77')](_0x3d8a79)&&_[_0xde35('0x78')](_0x30e2e5,_0x3d8a79)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x3d8a79+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('agent\x20not\x20exists');}break;case _0xde35('0x79'):if(isEmail(_0x434022)){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')](_0xde35('0x7a'));}break;case _0xde35('0x7b'):var _0xd0e970=moment(_0x434022,_0xde35('0x7c'),!![]);if(_0xd0e970['isValid']()){_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}else{_0x4f37a4[_0xde35('0x1b')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x24832d[_0xde35('0x1b')]('\x22'+_0x434022+'\x22');}}else{switch(_0x492e05){case _0xde35('0x7d'):case _0xde35('0x12'):_0x4f37a4[_0xde35('0x1b')](_0x492e05+_0xde35('0x7e'));break;default:_0x24832d[_0xde35('0x1b')]('\x22\x22');}}}}else{var _0x2f4913='';if(!_[_0xde35('0x1a')](_0x350540)){if(!_0x53dbbe['hasOwnProperty'](_0x350540['id'])){for(var _0x32e8f9=0x0;_0x32e8f9<_0x17e806[_0x492e05]['length'];_0x32e8f9++){var _0x434022=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x492e05][_0x32e8f9]][_0xde35('0x73')](/"/g,'\x27'));var _0x25bdf1=phoneDescriptions[_0xde35('0x71')](_0x4585ea=>_0x4585ea[_0xde35('0x80')]===_0x350540['id']);if(!_[_0xde35('0x1a')](_0x25bdf1)){var _0x221f48=_[_0xde35('0x7f')](_0x57a8c9[_0xde35('0x70')][_0x4b777c][_0x17e806[_0x25bdf1[_0xde35('0x81')]][0x0]][_0xde35('0x73')](/"/g,'\x27'));if(!_['isNil'](_0x221f48))_0x434022=_0x434022+'§'+_0x221f48;}if(_0x2f4913=='')_0x2f4913=_0x434022;else _0x2f4913+='|'+_0x434022;}_0x38602e[_0xde35('0x1b')](_0x350540['id']+':'+_0x2f4913);_0x53dbbe[_0x350540['id']]=0x1;}}}}if(hasAdditionalPhones){_0x24832d[_0xde35('0x1b')]('\x22'+_0x38602e[_0xde35('0x3d')](';')+'\x22');}if(_0x4f37a4[_0xde35('0x19')]){handleError(_0x57a8c9[_0xde35('0x70')][_0x4b777c],{'code':_0xde35('0x82'),'message':_0x4f37a4[_0xde35('0x3d')]()});}else{fs['appendFileSync'](_0x784b38,_0x24832d['join']()+'\x0a');}_0x24832d=[];}if(!(stats[_0xde35('0x83')]%0xc8)){socket[_0xde35('0x84')](_0xde35('0x85')+_0x48b880,stats);stats[_0xde35('0x5e')]=[];}}if(stopped){logger[_0xde35('0x5c')]('Abort\x20parser');_0x3573ad[_0xde35('0x86')]();}}catch(_0x5df20d){handleError(_0x57a8c9['data'][_0x4b777c],{'code':'SystemError','message':_0x5df20d[_0xde35('0x1e')]});logger[_0xde35('0x1d')](_0xde35('0x87'),_0x5df20d[_0xde35('0x1e')]);}},'complete':function(){try{var _0x1d04ae=[];var _0xbb9987=tempTableName;_0x1d04ae[_0xde35('0x1b')](_0xde35('0x88')+_0xbb9987+'\x20LIKE\x20cm_contacts;');logger[_0xde35('0x5c')](_0xde35('0x89'),contactItemTypes['length']);var _0x5b87b2=util['format'](_0xde35('0x8a'),_0x784b38,_0xbb9987,_0x109243,_0x59bfaf[_0xde35('0x37')],_0x59bfaf[_0xde35('0x57')]||null,NOW,NOW);if(_[_0xde35('0x1a')](_0x17e806[_0xde35('0x35')])){_0x5b87b2+=_0xde35('0x8b');}_0x1d04ae[_0xde35('0x1b')](_0x5b87b2);BPromise['each'](_0x1d04ae,handleQuery)[_0xde35('0x25')](function(_0x5824e6){BPromise[_0xde35('0x20')]([handleAdditionalPhones()])[_0xde35('0x25')](function(){_0x1d04ae=[];for(var _0xa7a044=0x0;_0xa7a044<promisesContact[_0xde35('0x19')];_0xa7a044++){_0x1d04ae['push'](updateContact(promisesContact[_0xa7a044][_0xde35('0x8c')]));}BPromise[_0xde35('0x20')](_0x1d04ae)[_0xde35('0x25')](function(){_0x1d04ae=[];for(var _0xf1a3fd=0x0;_0xf1a3fd<promisesAdditionalPhones[_0xde35('0x19')];_0xf1a3fd++){_0x1d04ae[_0xde35('0x1b')](createAdditionalPhone(promisesAdditionalPhones[_0xf1a3fd][_0xde35('0x8d')],promisesAdditionalPhones[_0xf1a3fd][_0xde35('0x8e')],promisesAdditionalPhones[_0xf1a3fd]['phone'],promisesAdditionalPhones[_0xf1a3fd][_0xde35('0x8f')]));}BPromise[_0xde35('0x20')](_0x1d04ae)[_0xde35('0x25')](function(){_0x1d04ae=[];_0x1d04ae['push'](insertCmHopperAdditionalPhones(_0x59bfaf[_0xde35('0x37')]));_0x1d04ae[_0xde35('0x1b')](_0xde35('0x90')+_0xbb9987+';');BPromise[_0xde35('0x91')](_0x1d04ae,handleQuery)[_0xde35('0x25')](function(_0x1a6cb9){stats[_0xde35('0x92')]=!![];stats[_0xde35('0x93')]=updatedRows;socket['emit'](_0xde35('0x85')+_0x48b880,stats);fs[_0xde35('0x94')](_0x38333e);fs[_0xde35('0x94')](_0x784b38);process[_0xde35('0x5d')](0x0);})[_0xde35('0x1c')](function(_0x214070){logger[_0xde35('0x1d')](_0x214070[_0xde35('0x1e')]);process[_0xde35('0x5d')](0x1);});});});});})[_0xde35('0x1c')](function(_0xb294d9){logger[_0xde35('0x1d')](_0xb294d9[_0xde35('0x1e')]);process[_0xde35('0x5d')](0x1);});}catch(_0x20eab8){logger[_0xde35('0x1d')](_0xde35('0x95'),_0x20eab8[_0xde35('0x1e')]);process[_0xde35('0x5d')](0x1);}},'error':function(_0x469dc6,_0x569646,_0x4acf51,_0xd02bc9){throw new Error(_0xd02bc9);}});});}function validate(){if(process[_0xde35('0x96')]&&process['argv'][_0xde35('0x19')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x141b57=path[_0xde35('0x3d')](config[_0xde35('0x66')],_0xde35('0x97'),process[_0xde35('0x96')][0x2]);if(!fs['existsSync'](_0x141b57)){throw new Error(_0xde35('0x98'));}var _0x2a0747={};try{_0x2a0747=JSON[_0xde35('0x6f')](process['argv'][0x3]);if(!_0x2a0747['binding']){throw new Error(_0xde35('0x99'));}var _0xca36d3=0x0;if(_0x2a0747['binding']['UserId']){_0xca36d3=0x1;}if(!_0x2a0747['ListId']){throw new Error(_0xde35('0x9a'));}}catch(_0x211b6a){throw new Error('body\x20id\x20mandatory');}var _0x1b9314=[];try{_0x1b9314=_['map'](JSON[_0xde35('0x6f')](process[_0xde35('0x96')][0x4]),'id');}catch(_0x48f994){logger['info'](_0xde35('0x9b'));}main(_0x141b57,_0x2a0747,_0x1b9314,_0xca36d3);}validate();process['on']('SIGINT',handleStop);process['on'](_0xde35('0x9c'),handleUncaughtException);
\ No newline at end of file
+var _0x20d8=['cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','query','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','body','ContactItemType','findAll','name','_description','header','createReadStream','rows','data','find','hasOwnProperty','replace','scheduledat','isValid','isNaN','includes','agent\x20not\x20exists','email','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','trim','itemTypeId','description','appendFileSync','emit','contact:import:','Abort\x20parser','step','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','each','contact','contactTypeId','orderBy','DROP\x20TABLE\x20','finish','affectedRows','unlink','complete','argv','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','map','uncaughtException','path','lodash','papaparse','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','format','test','select','field','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','sequelize','select\x20*\x20from\x20','spread','length','isNil','phone','AdditionalPhones','push','all','then','catch','error','message','split','filter','findOne','CmContactHasItem','update','updated','inserted','CmContact','CmHopper','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','into','cm_hopper','fromQuery','ContactId','ListId','priority','UserId','recallme','fields','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','insert','cm_hopper_black','createdAt','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy'];(function(_0x33665e,_0x472edf){var _0x4c7e18=function(_0x9a6fad){while(--_0x9a6fad){_0x33665e['push'](_0x33665e['shift']());}};_0x4c7e18(++_0x472edf);}(_0x20d8,0xee));var _0x820d=function(_0x17bd7b,_0x9124d){_0x17bd7b=_0x17bd7b-0x0;var _0x2e52b6=_0x20d8[_0x17bd7b];return _0x2e52b6;};'use strict';var fs=require('fs');var path=require(_0x820d('0x0'));var _=require(_0x820d('0x1'));var Papa=require(_0x820d('0x2'));var util=require('util');var BPromise=require('bluebird');var moment=require(_0x820d('0x3'));var squel=require(_0x820d('0x4'));var Redis=require(_0x820d('0x5'));var db=require(_0x820d('0x6'))['db'];var config=require(_0x820d('0x7'));var logger=require('../../../config/logger')(_0x820d('0x8'));config[_0x820d('0x9')]=_[_0x820d('0xa')](config['redis'],{'host':_0x820d('0xb'),'port':0x18eb});var socket=require(_0x820d('0xc'))(new Redis(config[_0x820d('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x820d('0xd'));var tempTableName='cm_contacts_temp_'+moment()[_0x820d('0xe')]('YYYYMMDDHHmmss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x5d1607){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))*$/[_0x820d('0xf')](_0x5d1607);}function selectNotIn(_0x55c06f,_0x3af4e4,_0x20b65c,_0x1305b3,_0x5724e9){return squel[_0x820d('0x10')]()[_0x820d('0x11')]('phone')[_0x820d('0x12')](_0x1305b3)['join'](_0x3af4e4,null,_0x3af4e4+_0x820d('0x13')+_0x1305b3+'.'+_0x20b65c)[_0x820d('0x14')](_0x1305b3+'.'+_0x20b65c+_0x820d('0x15')+_0x55c06f+'.'+_0x20b65c)[_0x820d('0x14')](_0x3af4e4+_0x820d('0x16')+_0x5724e9[_0x820d('0x17')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x56b600,_0x528ccc){promisesAdditionalPhones=[];promisesContact=[];return db[_0x820d('0x18')]['query'](_0x820d('0x19')+tempTableName)[_0x820d('0x1a')](function(_0x455bfb){if(_0x455bfb!==null){var _0x5b5c83=[];for(var _0x41549b=0x0;_0x41549b<_0x455bfb[_0x820d('0x1b')];_0x41549b++){var _0x381cf0=_0x455bfb[_0x41549b];if(!_[_0x820d('0x1c')](_0x381cf0[_0x820d('0x1d')])){if(!_[_0x820d('0x1c')](_0x381cf0[_0x820d('0x1e')]))_0x5b5c83[_0x820d('0x1f')](insertAdditionalPhones(_0x381cf0));promisesContact[_0x820d('0x1f')]({'contact':_0x381cf0});}}}Promise[_0x820d('0x20')](_0x5b5c83)[_0x820d('0x21')](function(){_0x56b600({'val':0x1});});})[_0x820d('0x22')](function(_0x2679b4){logger[_0x820d('0x23')](_0x2679b4[_0x820d('0x24')]);});});}function insertAdditionalPhones(_0x27d50d){return new Promise(function(_0x30ec53,_0x241aa2){var _0x17a981=_0x27d50d['AdditionalPhones'];if(_[_0x820d('0x1c')](_0x17a981))_0x241aa2({'val':0x0});else{var _0x37a3bd=_0x17a981['split'](';');var _0x32563e=[];orderBy=0x0;for(var _0x2de355=0x0;_0x2de355<_0x37a3bd[_0x820d('0x1b')];_0x2de355++){_0x32563e[_0x820d('0x1f')](splitAdditionalPhone(_0x27d50d['id'],_0x37a3bd[_0x2de355]));}Promise[_0x820d('0x20')](_0x32563e)[_0x820d('0x21')](function(){_0x30ec53({'val':_0x37a3bd[_0x820d('0x1b')]});});}});}function splitAdditionalPhone(_0x2beae7,_0x4650d0){return new Promise(function(_0xc01843,_0x575b07){var _0xfadfa6=_0x4650d0['split'](':');var _0xa3bce=_0xfadfa6[0x0];var _0x16fbf0=_0xfadfa6[0x1];if(_0x16fbf0!==''){var _0xa9fc92=_0x16fbf0[_0x820d('0x25')]('|');var _0x3fecb0=[];for(var _0x31fef6=0x0;_0x31fef6<_0xa9fc92[_0x820d('0x1b')];_0x31fef6++){if(_0xa9fc92[_0x31fef6]!==''){var _0x582010=_[_0x820d('0x26')](promisesAdditionalPhones,{'contactId':_0x2beae7,'phone':_0xa9fc92[_0x31fef6]});if(_0x582010[_0x820d('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x820d('0x1f')]({'contactId':_0x2beae7,'contactTypeId':_0xa3bce,'phone':_0xa9fc92[_0x31fef6],'orderBy':orderBy});}}}_0xc01843({'ok':0x1});}else _0xc01843({'res':0x0});});}function createAdditionalPhone(_0x537823,_0x42c235,_0x5a0697,_0xa00e24){var _0x17b6b5='';var _0x367299='';var _0x4e8f59=_0x5a0697['split']('§');_0x17b6b5=_0x4e8f59[0x0];if(_0x4e8f59[_0x820d('0x1b')]==0x2)_0x367299=_0x4e8f59[0x1];return new Promise(function(_0x2b7b16,_0x4fab38){return db['CmContactHasItem'][_0x820d('0x27')]({'where':{'CmContactId':_0x537823,'item':_0x17b6b5}})[_0x820d('0x21')](function(_0x4cc5da){if(_0x4cc5da){return db[_0x820d('0x28')][_0x820d('0x29')]({'ItemTypeId':_0x42c235,'description':_0x367299,'OrderBy':_0xa00e24},{'where':{'CmContactId':_0x537823,'item':_0x17b6b5}})[_0x820d('0x21')](function(_0x4c3cd1){_0x2b7b16({'res':_0x820d('0x2a')});});}else{return db['CmContactHasItem']['create']({'CmContactId':_0x537823,'item':_0x17b6b5,'ItemTypeId':_0x42c235,'description':_0x367299,'OrderBy':_0xa00e24,'ItemClass':'PHONE'})[_0x820d('0x21')](function(_0x2b1797){_0x2b7b16({'res':_0x820d('0x2b')});});}});});}function updateContact(_0x481e15){return new Promise(function(_0x2a8a6b,_0x46fc80){var _0x481094=_0x481e15['id'];delete _0x481e15['id'];return db[_0x820d('0x2c')]['update'](_0x481e15,{'where':{'id':_0x481094}})[_0x820d('0x21')](function(_0x154c3a){updatedRows+=0x1;return db[_0x820d('0x2d')]['update']({'phone':_0x481e15[_0x820d('0x1d')]},{'where':{'ContactId':_0x481094}})['then'](function(_0x125c8a){_0x2a8a6b({'ret':'OK'});});});});}function insertCmHopper(_0x1c0489,_0x264400,_0x17a216,_0x38753c,_0x490313){var _0x45c6d9=['cm_contacts.phone',_0x820d('0x2e'),_0x820d('0x2f'),'cm_contacts.ListId',_0x264400+'.'+_0x38753c,_0x820d('0x30'),'cm_contacts.updatedAt',_0x820d('0x31'),'cm_contacts.UserId','\x22'+_0x490313+'\x22'];return squel['insert']()[_0x820d('0x32')](_0x820d('0x33'))[_0x820d('0x34')]([_0x820d('0x1d'),'scheduledat',_0x820d('0x35'),_0x820d('0x36'),_0x38753c,'createdAt','updatedAt',_0x820d('0x37'),_0x820d('0x38'),_0x820d('0x39')],squel[_0x820d('0x10')]()[_0x820d('0x3a')](_0x45c6d9)[_0x820d('0x12')](_0x264400)[_0x820d('0x17')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x264400+_0x820d('0x3b'))[_0x820d('0x17')](_0x17a216,null,_0x17a216+_0x820d('0x13')+_0x264400+'.'+_0x38753c)[_0x820d('0x14')](_0x264400+'.CmListId\x20=\x20?',_0x1c0489)[_0x820d('0x14')](_0x820d('0x3c'),NOW)[_0x820d('0x14')](_0x820d('0x3d'),selectNotIn(_0x264400,_0x17a216,_0x38753c,_0x820d('0x33'),[_0x820d('0x3e'),'\x22onlyIfOpen\x22']))[_0x820d('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x264400,_0x17a216,_0x38753c,_0x820d('0x33'),['\x22always\x22'])))[_0x820d('0x3f')]();}function insertCmHopperBlack(_0x26ab6f,_0x1f5b22,_0x568d1b,_0x14fc29){var _0x25ab01=['cm_contacts.phone','cm_contacts.id',_0x820d('0x40'),_0x1f5b22+'.'+_0x14fc29,'cm_contacts.createdAt',_0x820d('0x41')];return squel[_0x820d('0x42')]()['into'](_0x820d('0x43'))[_0x820d('0x34')]([_0x820d('0x1d'),_0x820d('0x35'),_0x820d('0x36'),_0x14fc29,_0x820d('0x44'),'updatedAt'],squel[_0x820d('0x10')]()[_0x820d('0x3a')](_0x25ab01)[_0x820d('0x12')](_0x1f5b22)['join'](_0x820d('0x45'),null,_0x820d('0x46')+_0x1f5b22+_0x820d('0x3b'))['join'](_0x568d1b,null,_0x568d1b+_0x820d('0x13')+_0x1f5b22+'.'+_0x14fc29)[_0x820d('0x14')](_0x1f5b22+_0x820d('0x47'),_0x26ab6f)[_0x820d('0x14')](_0x820d('0x3c'),NOW)['where'](_0x820d('0x3d'),squel[_0x820d('0x10')]()[_0x820d('0x11')](_0x820d('0x1d'))[_0x820d('0x12')](_0x820d('0x43'))['where'](_0x820d('0x48'),_0x26ab6f)[_0x820d('0x14')](_0x14fc29+_0x820d('0x49'),_0x1f5b22+'.'+_0x14fc29)))[_0x820d('0x3f')]();}function insertCmHopperAdditionalPhones(_0x3a4be5){var _0x2e1af2=['cm_hopper.id',_0x820d('0x4a'),_0x820d('0x4b'),_0x820d('0x4c'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0x820d('0x32')](_0x820d('0x4d'))[_0x820d('0x34')]([_0x820d('0x4e'),'phone',_0x820d('0x4f'),_0x820d('0x44'),_0x820d('0x50')],squel[_0x820d('0x10')]()[_0x820d('0x3a')](_0x2e1af2)[_0x820d('0x12')]('cm_hopper')[_0x820d('0x17')](_0x820d('0x45'),null,_0x820d('0x51'))['join'](_0x820d('0x52'),null,_0x820d('0x53'))['where']('cm_hopper.ListId\x20=\x20?',_0x3a4be5)['where'](_0x820d('0x3c'),NOW))[_0x820d('0x3f')]();}function insertCmContact(_0x62f8e7,_0x44f192,_0x531da8,_0x53ac84){var _0x1a4940=_[_0x820d('0x54')](_[_0x820d('0x55')](_0x53ac84),[_0x820d('0x36'),_0x820d('0x56'),'createdAt',_0x820d('0x50')]);return squel[_0x820d('0x42')]()[_0x820d('0x32')]('cm_contacts')[_0x820d('0x34')](_0x1a4940,squel['select']()[_0x820d('0x3a')](_0x1a4940)[_0x820d('0x12')](_0x44f192)[_0x820d('0x14')]('('+_0x531da8[_0x820d('0x17')](',')+_0x820d('0x57'),squel[_0x820d('0x10')]()[_0x820d('0x3a')](_0x531da8)[_0x820d('0x12')]('cm_contacts')[_0x820d('0x14')]('ListId\x20=\x20?',_0x62f8e7))[_0x820d('0x14')](_0x820d('0x58'),squel['select']()[_0x820d('0x11')](_0x820d('0x59'),_0x820d('0x5a'))['from'](_0x44f192)['group'](_0x531da8[_0x820d('0x17')](','))))[_0x820d('0x3f')]();}function handleStop(){logger[_0x820d('0x5b')](_0x820d('0x5c'));stopped=!![];}function handleUncaughtException(_0x4beacc){logger[_0x820d('0x23')](_0x4beacc[_0x820d('0x24')]);process[_0x820d('0x5d')](0x1);}function handleError(_0x4f5afb,_0x2fc480){stats[_0x820d('0x5e')][_0x820d('0x1f')]({'name':_0x2fc480[_0x820d('0x5f')],'message':_0x2fc480['message'],'row':_0x4f5afb});}function handleQuery(_0x555c35){logger[_0x820d('0x5b')](_0x555c35);return db[_0x820d('0x18')][_0x820d('0x60')](_0x555c35)[_0x820d('0x1a')](function(_0x331a6a){results[_0x820d('0x1f')](_0x331a6a);})[_0x820d('0x22')](function(_0x26df31){logger[_0x820d('0x23')](_0x26df31[_0x820d('0x24')]);});}function main(_0x1a93c1,_0x73ec48,_0x3de430,_0x37c9f8){logger[_0x820d('0x5b')](_0x820d('0x61'),_0x1a93c1,JSON[_0x820d('0x62')](_0x73ec48));process[_0x820d('0x63')](_0x820d('0x64'));var _0x33660=_0x73ec48[_0x820d('0x65')];var _0x404627=_['clone'](_0x33660);var _0x37b7b5=_0x73ec48[_0x820d('0x66')];var _0x44fbec=path[_0x820d('0x17')](config[_0x820d('0x67')],_0x820d('0x68'),_0x37b7b5+_0x820d('0x69'));logger[_0x820d('0x5b')](_0x820d('0x6a'),_0x73ec48);db[_0x820d('0x6b')][_0x820d('0x6c')]({'raw':!![],'attributes':['id',_0x820d('0x6d')]})['then'](function(_0x3b7181){for(var _0x106790=0x0;_0x106790<_0x3b7181[_0x820d('0x1b')];_0x106790++){if(_0x3b7181[_0x106790][_0x820d('0x6d')]in _0x33660){contactItemTypes['push'](_0x3b7181[_0x106790]);delete _0x404627[_0x3b7181[_0x106790][_0x820d('0x6d')]];hasAdditionalPhones=!![];}for(var _0x143cd6 in _0x33660){if(_0x3b7181[_0x106790]['name']+_0x820d('0x6e')===_0x143cd6){phoneDescriptions['push']({'itemTypeId':_0x3b7181[_0x106790]['id'],'description':_0x143cd6});delete _0x404627[_0x143cd6];}}}if(hasAdditionalPhones)_0x404627[_0x820d('0x1e')]='';var _0x23c8f6=_[_0x820d('0x55')](_0x404627)[_0x820d('0x17')]();logger[_0x820d('0x5b')](_0x820d('0x6f'),_0x23c8f6);fs['writeFileSync'](_0x44fbec,_0x23c8f6+'\x0a');Papa['parse'](fs[_0x820d('0x70')](_0x1a93c1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x47e645,_0x2d54be){try{for(var _0x40ff80=0x0,_0x44f0a5=[];_0x40ff80<_0x47e645['data'][_0x820d('0x1b')];_0x40ff80++){stats[_0x820d('0x71')]+=0x1;if(_0x47e645[_0x820d('0x5e')][_0x40ff80]){handleError(_0x47e645[_0x820d('0x72')][_0x40ff80],_0x47e645[_0x820d('0x5e')][_0x40ff80]);}else{var _0xabc02a=[];var _0x138f4c=[];var _0x15eed0={};for(var _0xe31c20 in _0x33660){let _0x5ef918=contactItemTypes[_0x820d('0x73')](_0x2e9f66=>_0x2e9f66['name']===_0xe31c20);let _0x5c72b2=contactItemTypes[_0x820d('0x73')](_0x3b2b4e=>_0x3b2b4e[_0x820d('0x6d')]+_0x820d('0x6e')===_0xe31c20);if(_[_0x820d('0x1c')](_0x5ef918)&&_['isNil'](_0x5c72b2)){if(_0x33660[_0x820d('0x74')](_0xe31c20)){if(_0x47e645[_0x820d('0x72')][_0x40ff80][_0x33660[_0xe31c20]]){var _0x362aa5=_['trim'](_0x47e645[_0x820d('0x72')][_0x40ff80][_0x33660[_0xe31c20]][_0x820d('0x75')](/"/g,'\x27'));switch(_0xe31c20){case _0x820d('0x76'):var _0x37bec6=moment(_0x362aa5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x37bec6[_0x820d('0x77')]()){_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x362aa5+'\x22');}else{_0xabc02a[_0x820d('0x1f')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x820d('0x37'):var _0x1ac1fa=parseInt(_0x362aa5);_0x362aa5=_[_0x820d('0x78')](_0x1ac1fa)||_0x1ac1fa<0x0||_0x1ac1fa>0x4?_0x37c9f8?0x3:0x2:_0x1ac1fa;_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x362aa5+'\x22');break;case _0x820d('0x38'):var _0x3c0f60=parseInt(_0x362aa5);if(_['isNumber'](_0x3c0f60)&&_[_0x820d('0x79')](_0x3de430,_0x3c0f60)){_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x3c0f60+'\x22');}else{_0xabc02a[_0x820d('0x1f')](_0x820d('0x7a'));}break;case _0x820d('0x7b'):if(isEmail(_0x362aa5)){_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x362aa5+'\x22');}else{_0xabc02a['push']('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x46d3d5=moment(_0x362aa5,_0x820d('0x7c'),!![]);if(_0x46d3d5['isValid']()){_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x362aa5+'\x22');}else{_0xabc02a[_0x820d('0x1f')](_0x820d('0x7d'));}break;default:_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x362aa5+'\x22');}}else{switch(_0xe31c20){case _0x820d('0x7e'):case'phone':_0xabc02a[_0x820d('0x1f')](_0xe31c20+_0x820d('0x7f'));break;default:_0x44f0a5['push']('\x22\x22');}}}}else{var _0x41201e='';if(!_[_0x820d('0x1c')](_0x5ef918)){if(!_0x15eed0['hasOwnProperty'](_0x5ef918['id'])){for(var _0x2ebcdf=0x0;_0x2ebcdf<_0x33660[_0xe31c20][_0x820d('0x1b')];_0x2ebcdf++){var _0x362aa5=_[_0x820d('0x80')](_0x47e645[_0x820d('0x72')][_0x40ff80][_0x33660[_0xe31c20][_0x2ebcdf]]['replace'](/"/g,'\x27'));var _0x566ce3=phoneDescriptions[_0x820d('0x73')](_0xb73c3d=>_0xb73c3d[_0x820d('0x81')]===_0x5ef918['id']);if(!_[_0x820d('0x1c')](_0x566ce3)){var _0x16aad5=_['trim'](_0x47e645[_0x820d('0x72')][_0x40ff80][_0x33660[_0x566ce3[_0x820d('0x82')]][0x0]][_0x820d('0x75')](/"/g,'\x27'));if(!_['isNil'](_0x16aad5))_0x362aa5=_0x362aa5+'§'+_0x16aad5;}if(_0x41201e=='')_0x41201e=_0x362aa5;else _0x41201e+='|'+_0x362aa5;}_0x138f4c[_0x820d('0x1f')](_0x5ef918['id']+':'+_0x41201e);_0x15eed0[_0x5ef918['id']]=0x1;}}}}if(hasAdditionalPhones){_0x44f0a5[_0x820d('0x1f')]('\x22'+_0x138f4c[_0x820d('0x17')](';')+'\x22');}if(_0xabc02a['length']){handleError(_0x47e645[_0x820d('0x72')][_0x40ff80],{'code':'SystemRow','message':_0xabc02a['join']()});}else{fs[_0x820d('0x83')](_0x44fbec,_0x44f0a5[_0x820d('0x17')]()+'\x0a');}_0x44f0a5=[];}if(!(stats[_0x820d('0x71')]%0xc8)){socket[_0x820d('0x84')](_0x820d('0x85')+_0x37b7b5,stats);stats[_0x820d('0x5e')]=[];}}if(stopped){logger['info'](_0x820d('0x86'));_0x2d54be['abort']();}}catch(_0x1c8c32){handleError(_0x47e645['data'][_0x40ff80],{'code':'SystemError','message':_0x1c8c32[_0x820d('0x24')]});logger[_0x820d('0x23')](_0x820d('0x87'),_0x1c8c32[_0x820d('0x24')]);}},'complete':function(){try{var _0x34179a=[];var _0x4d29db=tempTableName;_0x34179a[_0x820d('0x1f')](_0x820d('0x88')+_0x4d29db+_0x820d('0x89'));logger[_0x820d('0x5b')]('CIS\x20len',contactItemTypes[_0x820d('0x1b')]);var _0x248361=util[_0x820d('0xe')](_0x820d('0x8a'),_0x44fbec,_0x4d29db,_0x23c8f6,_0x73ec48[_0x820d('0x36')],_0x73ec48[_0x820d('0x56')]||null,NOW,NOW);if(_[_0x820d('0x1c')](_0x33660[_0x820d('0x76')])){_0x248361+=_0x820d('0x8b');}_0x34179a[_0x820d('0x1f')](_0x248361);BPromise[_0x820d('0x8c')](_0x34179a,handleQuery)['then'](function(_0x1f93da){BPromise[_0x820d('0x20')]([handleAdditionalPhones()])[_0x820d('0x21')](function(){_0x34179a=[];for(var _0x4cb3e7=0x0;_0x4cb3e7<promisesContact['length'];_0x4cb3e7++){_0x34179a[_0x820d('0x1f')](updateContact(promisesContact[_0x4cb3e7][_0x820d('0x8d')]));}BPromise[_0x820d('0x20')](_0x34179a)[_0x820d('0x21')](function(){_0x34179a=[];for(var _0x4e5865=0x0;_0x4e5865<promisesAdditionalPhones[_0x820d('0x1b')];_0x4e5865++){_0x34179a[_0x820d('0x1f')](createAdditionalPhone(promisesAdditionalPhones[_0x4e5865]['contactId'],promisesAdditionalPhones[_0x4e5865][_0x820d('0x8e')],promisesAdditionalPhones[_0x4e5865][_0x820d('0x1d')],promisesAdditionalPhones[_0x4e5865][_0x820d('0x8f')]));}BPromise[_0x820d('0x20')](_0x34179a)[_0x820d('0x21')](function(){_0x34179a=[];_0x34179a[_0x820d('0x1f')](insertCmHopperAdditionalPhones(_0x73ec48[_0x820d('0x36')]));_0x34179a[_0x820d('0x1f')](_0x820d('0x90')+_0x4d29db+';');BPromise[_0x820d('0x8c')](_0x34179a,handleQuery)[_0x820d('0x21')](function(_0x5a7537){stats[_0x820d('0x91')]=!![];stats[_0x820d('0x92')]=updatedRows;socket['emit']('contact:import:'+_0x37b7b5,stats);fs[_0x820d('0x93')](_0x1a93c1);fs['unlink'](_0x44fbec);process[_0x820d('0x5d')](0x0);})[_0x820d('0x22')](function(_0x2b7aa1){logger[_0x820d('0x23')](_0x2b7aa1[_0x820d('0x24')]);process[_0x820d('0x5d')](0x1);});});});});})[_0x820d('0x22')](function(_0x37d4e6){logger['error'](_0x37d4e6[_0x820d('0x24')]);process[_0x820d('0x5d')](0x1);});}catch(_0x144394){logger['error'](_0x820d('0x94'),_0x144394['message']);process[_0x820d('0x5d')](0x1);}},'error':function(_0x2d50b6,_0x44f6a3,_0x3849d2,_0x331a89){throw new Error(_0x331a89);}});});}function validate(){if(process[_0x820d('0x95')]&&process[_0x820d('0x95')][_0x820d('0x1b')]<0x4){throw new Error('arguments\x20<filename>\x20<parameters>\x20<agents>');}var _0x3affaa=path[_0x820d('0x17')](config['root'],_0x820d('0x68'),process['argv'][0x2]);if(!fs[_0x820d('0x96')](_0x3affaa)){throw new Error(_0x820d('0x97'));}var _0x5e4746={};try{_0x5e4746=JSON[_0x820d('0x98')](process['argv'][0x3]);if(!_0x5e4746[_0x820d('0x65')]){throw new Error(_0x820d('0x99'));}var _0x23098c=0x0;if(_0x5e4746[_0x820d('0x65')][_0x820d('0x38')]){_0x23098c=0x1;}if(!_0x5e4746['ListId']){throw new Error(_0x820d('0x9a'));}}catch(_0x15cafe){throw new Error('body\x20id\x20mandatory');}var _0x287e1e=[];try{_0x287e1e=_[_0x820d('0x9b')](JSON[_0x820d('0x98')](process[_0x820d('0x95')][0x4]),'id');}catch(_0x1a3eef){logger[_0x820d('0x5b')]('No\x20agent\x20available');}main(_0x3affaa,_0x5e4746,_0x287e1e,_0x23098c);}validate();process['on']('SIGINT',handleStop);process['on'](_0x820d('0x9c'),handleUncaughtException);
\ No newline at end of file
index 936b50a..5f04a39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda72=['Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','answertime','Complete\x20Time','endtime','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','Outbound\x20Call','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','UniqueId'];(function(_0x1ce1e2,_0x50159c){var _0x233fb7=function(_0x270030){while(--_0x270030){_0x1ce1e2['push'](_0x1ce1e2['shift']());}};_0x233fb7(++_0x50159c);}(_0xda72,0x1ac));var _0x2da7=function(_0x32f759,_0x48656b){_0x32f759=_0x32f759-0x0;var _0x429ff6=_0xda72[_0x32f759];return _0x429ff6;};'use strict';exports['getSubjects']=function(_0x30a4f0,_0xdaae2b){var _0xeb8ddf=[{'type':_0x2da7('0x0'),'content':_0x2da7('0x1'),'variableName':null}];switch(_0x30a4f0[_0x2da7('0x2')]()){case _0x2da7('0x3'):switch(_0xdaae2b[_0x2da7('0x2')]()){case _0x2da7('0x4'):_0xeb8ddf[_0x2da7('0x5')]({'type':_0x2da7('0x6'),'content':'','variableName':_0x2da7('0x7')});_0xeb8ddf['push']({'type':'variable','content':'','variableName':'calleridnum'});break;case _0x2da7('0x8'):_0xeb8ddf['push']({'type':_0x2da7('0x0'),'content':_0x2da7('0x9'),'variableName':null});_0xeb8ddf[_0x2da7('0x5')]({'type':_0x2da7('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0xeb8ddf;};exports['getDescriptions']=function(_0x18bfd8,_0x50911b){var _0x20593e=[];switch(_0x18bfd8[_0x2da7('0x2')]()){case _0x2da7('0x3'):switch(_0x50911b[_0x2da7('0x2')]()){case'inbound':_0x20593e=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0xb'),'keyType':'variable','variableName':'calleridnum'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0xc'),'keyType':_0x2da7('0x6'),'variableName':_0x2da7('0xd')},{'type':_0x2da7('0xa'),'content':'','key':'Call\x20To','keyType':'variable','variableName':_0x2da7('0xe')},{'type':_0x2da7('0xa'),'content':'','key':'Queue','keyType':_0x2da7('0x6'),'variableName':_0x2da7('0x7')},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0xf'),'keyType':_0x2da7('0x6'),'variableName':'uniqueid'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x10'),'keyType':'variable','variableName':_0x2da7('0x11')},{'type':_0x2da7('0x0'),'content':_0x2da7('0x12'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x2da7('0x13'),'keyType':_0x2da7('0x6'),'variableName':'destcalleridname'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x14'),'keyType':'variable','variableName':_0x2da7('0x15')},{'type':_0x2da7('0x0'),'content':_0x2da7('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x17'),'keyType':_0x2da7('0x6'),'variableName':_0x2da7('0x11')},{'type':'keyValue','content':'','key':_0x2da7('0x18'),'keyType':_0x2da7('0x6'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x2da7('0x6'),'variableName':_0x2da7('0x19')},{'type':'keyValue','content':'','key':_0x2da7('0x1a'),'keyType':_0x2da7('0x6'),'variableName':_0x2da7('0x1b')},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x1c'),'keyType':_0x2da7('0x6'),'variableName':_0x2da7('0x1d')}];break;case'outbound':_0x20593e=[{'type':_0x2da7('0x0'),'content':_0x2da7('0x1e'),'variableName':null},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x1f'),'keyType':'variable','keyContent':'','variableName':'destcalleridnum'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x20'),'keyType':_0x2da7('0x6'),'keyContent':'','variableName':'membername'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0xf'),'keyType':_0x2da7('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x10'),'keyType':_0x2da7('0x6'),'keyContent':'','variableName':'starttime'},{'type':_0x2da7('0x0'),'content':_0x2da7('0x16')},{'type':_0x2da7('0xa'),'content':'','key':'Answer\x20Time','keyType':_0x2da7('0x6'),'keyContent':'','variableName':_0x2da7('0x21')},{'type':_0x2da7('0xa'),'content':'','key':_0x2da7('0x22'),'keyType':'variable','keyContent':'','variableName':_0x2da7('0x23')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0x2da7('0x6'),'keyContent':'','variableName':_0x2da7('0x24')}];break;}}return _0x20593e;};
\ No newline at end of file
+var _0x2e17=['holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','answertime','Complete\x20Time','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt'];(function(_0x55bf49,_0x30534f){var _0x3aeaf0=function(_0x471b33){while(--_0x471b33){_0x55bf49['push'](_0x55bf49['shift']());}};_0x3aeaf0(++_0x30534f);}(_0x2e17,0x138));var _0x72e1=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x2e17[_0x341e0f];return _0x59555a;};'use strict';exports[_0x72e1('0x0')]=function(_0x35adb5,_0x3c491c){var _0x4ab5b9=[{'type':_0x72e1('0x1'),'content':_0x72e1('0x2'),'variableName':null}];switch(_0x35adb5[_0x72e1('0x3')]()){case _0x72e1('0x4'):switch(_0x3c491c['toLowerCase']()){case _0x72e1('0x5'):_0x4ab5b9[_0x72e1('0x6')]({'type':_0x72e1('0x7'),'content':'','variableName':_0x72e1('0x8')});_0x4ab5b9['push']({'type':_0x72e1('0x7'),'content':'','variableName':_0x72e1('0x9')});break;case _0x72e1('0xa'):_0x4ab5b9[_0x72e1('0x6')]({'type':_0x72e1('0x1'),'content':_0x72e1('0xb'),'variableName':null});_0x4ab5b9[_0x72e1('0x6')]({'type':_0x72e1('0x7'),'content':'','variableName':_0x72e1('0xc')});break;}}return _0x4ab5b9;};exports[_0x72e1('0xd')]=function(_0x4ad5d0,_0x40f75a){var _0x338cae=[];switch(_0x4ad5d0['toLowerCase']()){case _0x72e1('0x4'):switch(_0x40f75a[_0x72e1('0x3')]()){case _0x72e1('0x5'):_0x338cae=[{'type':'string','content':_0x72e1('0xe'),'key':null,'keyType':null,'variableName':null},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x10'),'keyType':'variable','variableName':_0x72e1('0x9')},{'type':'keyValue','content':'','key':_0x72e1('0x11'),'keyType':_0x72e1('0x7'),'variableName':'calleridname'},{'type':'keyValue','content':'','key':_0x72e1('0x12'),'keyType':'variable','variableName':'destexten'},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x13'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x8')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x14'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x15')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x16'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x17')},{'type':_0x72e1('0x1'),'content':_0x72e1('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0x72e1('0xf'),'content':'','key':'Agent\x20Name','keyType':_0x72e1('0x7'),'variableName':'destcalleridname'},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x19'),'keyType':'variable','variableName':_0x72e1('0xc')},{'type':_0x72e1('0x1'),'content':_0x72e1('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x72e1('0x1b'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x17')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x1c'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x1d')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x1e'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x1f')},{'type':_0x72e1('0xf'),'content':'','key':'Hold\x20Time','keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x20')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x21'),'keyType':_0x72e1('0x7'),'variableName':_0x72e1('0x22')}];break;case _0x72e1('0xa'):_0x338cae=[{'type':_0x72e1('0x1'),'content':_0x72e1('0xe'),'variableName':null},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x23'),'keyType':_0x72e1('0x7'),'keyContent':'','variableName':_0x72e1('0xc')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x24'),'keyType':_0x72e1('0x7'),'keyContent':'','variableName':_0x72e1('0x25')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x14'),'keyType':_0x72e1('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x16'),'keyType':'variable','keyContent':'','variableName':_0x72e1('0x26')},{'type':'string','content':_0x72e1('0x1a')},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0x72e1('0x27')},{'type':_0x72e1('0xf'),'content':'','key':_0x72e1('0x28'),'keyType':_0x72e1('0x7'),'keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x72e1('0x29')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0x72e1('0x2a')}];break;}}return _0x338cae;};
\ No newline at end of file
index 2e4de6d..dc897e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3935=['omit','phone','mobile','lodash','./sql-utils','./utils','skipInteractionsQuery','resolve','getInteractionsQuery','then','search','parseAdvancedSearchFilter','where','body','contact','default','fields','user','having','read','tags','checkAccountsRestrictions','group','i.id','ids','tag','countFilteredInteractions','count','clause','order','forEach','contactName','DESC','closed','getFilteredInteractions','rows','catch','tracked','query','clone'];(function(_0x216494,_0x21a0b4){var _0x3fce22=function(_0x510bbd){while(--_0x510bbd){_0x216494['push'](_0x216494['shift']());}};_0x3fce22(++_0x21a0b4);}(_0x3935,0x193));var _0x5393=function(_0x4b5409,_0x472b71){_0x4b5409=_0x4b5409-0x0;var _0x90b623=_0x3935[_0x4b5409];return _0x90b623;};'use strict';var _=require(_0x5393('0x0'));var sqlUtils=require(_0x5393('0x1'));var utils=require(_0x5393('0x2'));exports['findAll']=function(_0x198ec7,_0x316ada,_0x7911d4,_0x578991,_0x373826){var _0x4e42d9={'count':0x0,'rows':[]};var _0x29c826=sqlUtils[_0x5393('0x3')](_0x198ec7,_0x7911d4,_0x316ada);if(_0x29c826){return Promise[_0x5393('0x4')](_0x4e42d9);}var _0x19109d=sqlUtils[_0x5393('0x5')](_0x198ec7);var _0x1dd8d9={};return Promise[_0x5393('0x4')]()[_0x5393('0x6')](function(){if(_0x316ada[_0x5393('0x7')]){return sqlUtils[_0x5393('0x8')](_0x316ada[_0x5393('0x7')],_0x373826);}else{return sqlUtils['parseQueryParameters'](_0x198ec7,_0x316ada,_0x373826);}})[_0x5393('0x6')](function(_0x585450){_0x19109d[_0x5393('0x9')](_0x585450[_0x5393('0xa')]);_0x19109d[_0x5393('0x9')](_0x585450[_0x5393('0xb')]);_0x19109d[_0x5393('0x9')](_0x585450[_0x5393('0xc')]);_0x19109d['where'](_0x585450[_0x5393('0xd')]);_0x19109d['where'](_0x585450['filter']);_0x19109d[_0x5393('0x9')](_0x585450[_0x5393('0xe')]);_0x19109d[_0x5393('0xf')](_0x585450[_0x5393('0x10')]);_0x1dd8d9=_0x585450[_0x5393('0x11')];return sqlUtils[_0x5393('0x12')](_0x198ec7,_0x7911d4,_0x316ada);})[_0x5393('0x6')](function(_0x119576){_0x19109d[_0x5393('0x9')](_0x119576);_0x19109d[_0x5393('0x13')](_0x5393('0x14'));var _0x357af2=_0x316ada['search']?_0x1dd8d9[_0x5393('0x15')]:_0x316ada[_0x5393('0x16')];return sqlUtils[_0x5393('0x17')](_0x19109d,_0x357af2);})['then'](function(_0x22f74a){_0x4e42d9[_0x5393('0x18')]=_0x22f74a['length'];if(_0x4e42d9[_0x5393('0x18')]===0x0){return[];}_0x19109d[_0x5393('0xf')](_0x1dd8d9[_0x5393('0x19')]);if(_0x578991[_0x5393('0x1a')]){_0x578991[_0x5393('0x1a')][_0x5393('0x1b')](function(_0x324031){var _0x53685d=_0x324031[0x0]===_0x5393('0x1c')?_0x324031[0x0]:'i.'+_0x324031[0x0];_0x19109d[_0x5393('0x1a')](_0x53685d,_0x324031[0x1]===_0x5393('0x1d')?![]:!![]);if(_0x324031[0x0]===_0x5393('0x1e')){var _0x6b82b3=sqlUtils['getClosedOrderClause'](_0x198ec7,_0x316ada);_0x19109d[_0x5393('0x1a')](_0x6b82b3,_0x324031[0x1]===_0x5393('0x1d')?![]:!![]);}});}return sqlUtils[_0x5393('0x1f')](_0x198ec7,_0x19109d,_0x316ada,_0x578991);})['then'](function(_0x3d0343){_0x4e42d9[_0x5393('0x20')]=_0x3d0343;return _0x4e42d9;})[_0x5393('0x21')](function(_0x19f2c1){throw _0x19f2c1;});};exports[_0x5393('0x22')]=function(_0x54c48c,_0x2a84ea){return function(_0x4626f,_0x3244b3,_0x575bfb){var _0x449beb=_0x4626f[_0x5393('0xe')];var _0x1a184b={};var _0x5d71b4=_0x4626f[_0x5393('0x23')];if(_0x1a184b){_0x1a184b=_[_0x5393('0x24')](_0x4626f['body']);_0x1a184b=_[_0x5393('0x25')](_0x1a184b,['body','html',_0x5393('0x26'),'fax',_0x5393('0x27')]);}utils['updateUser'](_0x449beb,_0x1a184b,_0x5d71b4,_0x54c48c,_0x2a84ea);_0x575bfb(null);};};
\ No newline at end of file
+var _0x4bbb=['count','having','clause','order','contactName','closed','DESC','getFilteredInteractions','rows','catch','user','query','omit','html','phone','fax','mobile','updateUser','lodash','./sql-utils','./utils','resolve','search','parseAdvancedSearchFilter','then','body','where','contact','default','fields','filter','checkAccountsRestrictions','group','ids','tag','countFilteredInteractions','length'];(function(_0x37de50,_0x27f82a){var _0x2c37dc=function(_0x325186){while(--_0x325186){_0x37de50['push'](_0x37de50['shift']());}};_0x2c37dc(++_0x27f82a);}(_0x4bbb,0xa6));var _0xb4bb=function(_0x42d513,_0x162663){_0x42d513=_0x42d513-0x0;var _0x35e558=_0x4bbb[_0x42d513];return _0x35e558;};'use strict';var _=require(_0xb4bb('0x0'));var sqlUtils=require(_0xb4bb('0x1'));var utils=require(_0xb4bb('0x2'));exports['findAll']=function(_0x3c4bed,_0x24f13f,_0x5e95f3,_0x1d6ad2,_0x6de984){var _0x264ebc={'count':0x0,'rows':[]};var _0x3745f1=sqlUtils['skipInteractionsQuery'](_0x3c4bed,_0x5e95f3,_0x24f13f);if(_0x3745f1){return Promise[_0xb4bb('0x3')](_0x264ebc);}var _0xadd85e=sqlUtils['getInteractionsQuery'](_0x3c4bed);var _0x8f21f5={};return Promise['resolve']()['then'](function(){if(_0x24f13f[_0xb4bb('0x4')]){return sqlUtils[_0xb4bb('0x5')](_0x24f13f[_0xb4bb('0x4')],_0x6de984);}else{return sqlUtils['parseQueryParameters'](_0x3c4bed,_0x24f13f,_0x6de984);}})[_0xb4bb('0x6')](function(_0x754e7d){_0xadd85e['where'](_0x754e7d[_0xb4bb('0x7')]);_0xadd85e[_0xb4bb('0x8')](_0x754e7d[_0xb4bb('0x9')]);_0xadd85e[_0xb4bb('0x8')](_0x754e7d[_0xb4bb('0xa')]);_0xadd85e[_0xb4bb('0x8')](_0x754e7d[_0xb4bb('0xb')]);_0xadd85e[_0xb4bb('0x8')](_0x754e7d[_0xb4bb('0xc')]);_0xadd85e['where'](_0x754e7d['user']);_0xadd85e['having'](_0x754e7d['read']);_0x8f21f5=_0x754e7d['tags'];return sqlUtils[_0xb4bb('0xd')](_0x3c4bed,_0x5e95f3,_0x24f13f);})[_0xb4bb('0x6')](function(_0x366d56){_0xadd85e[_0xb4bb('0x8')](_0x366d56);_0xadd85e[_0xb4bb('0xe')]('i.id');var _0x8ce2b0=_0x24f13f['search']?_0x8f21f5[_0xb4bb('0xf')]:_0x24f13f[_0xb4bb('0x10')];return sqlUtils[_0xb4bb('0x11')](_0xadd85e,_0x8ce2b0);})[_0xb4bb('0x6')](function(_0x32413b){_0x264ebc['count']=_0x32413b[_0xb4bb('0x12')];if(_0x264ebc[_0xb4bb('0x13')]===0x0){return[];}_0xadd85e[_0xb4bb('0x14')](_0x8f21f5[_0xb4bb('0x15')]);if(_0x1d6ad2[_0xb4bb('0x16')]){_0x1d6ad2[_0xb4bb('0x16')]['forEach'](function(_0x3fdd63){var _0x4676dd=_0x3fdd63[0x0]===_0xb4bb('0x17')?_0x3fdd63[0x0]:'i.'+_0x3fdd63[0x0];_0xadd85e[_0xb4bb('0x16')](_0x4676dd,_0x3fdd63[0x1]==='DESC'?![]:!![]);if(_0x3fdd63[0x0]===_0xb4bb('0x18')){var _0x278f28=sqlUtils['getClosedOrderClause'](_0x3c4bed,_0x24f13f);_0xadd85e['order'](_0x278f28,_0x3fdd63[0x1]===_0xb4bb('0x19')?![]:!![]);}});}return sqlUtils[_0xb4bb('0x1a')](_0x3c4bed,_0xadd85e,_0x24f13f,_0x1d6ad2);})[_0xb4bb('0x6')](function(_0x1eb9cc){_0x264ebc[_0xb4bb('0x1b')]=_0x1eb9cc;return _0x264ebc;})[_0xb4bb('0x1c')](function(_0x571443){throw _0x571443;});};exports['tracked']=function(_0x3790cf,_0x267813){return function(_0x5d4634,_0x33426b,_0x166a54){var _0x2c7274=_0x5d4634[_0xb4bb('0x1d')];var _0x324c15={};var _0x1b1c1c=_0x5d4634[_0xb4bb('0x1e')];if(_0x324c15){_0x324c15=_['clone'](_0x5d4634[_0xb4bb('0x7')]);_0x324c15=_[_0xb4bb('0x1f')](_0x324c15,[_0xb4bb('0x7'),_0xb4bb('0x20'),_0xb4bb('0x21'),_0xb4bb('0x22'),_0xb4bb('0x23')]);}utils[_0xb4bb('0x24')](_0x2c7274,_0x324c15,_0x1b1c1c,_0x3790cf,_0x267813);_0x166a54(null);};};
\ No newline at end of file
index 8a2ce1c..79c5c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fdb=['../../mysqldb','agent','search','select','name','field','color','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','where','\x20IN\x20?','map','getInteractionsTables','getAccountFK','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','\x20=\x20i.id','interactionsTags','expr','getSelectedTags','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','i.id\x20LIKE\x20?','sms','whatsapp','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','sqlOperator','conditions','find','buildExpression','default','text','value','end','unreadMessages','and','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','contact','ContactId','type','start','Tag','tags','clause','ids','User','operator','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','plainBody','keys','some','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','then','read','filter','get','chat','Websites','Accounts','resolve','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','merge','fields','forEach','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.updatedAt','i.subject','i.ContactId','i.UserId','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','COUNT(*)','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils'];(function(_0x31b35c,_0x125bd2){var _0x47c048=function(_0x264c71){while(--_0x264c71){_0x31b35c['push'](_0x31b35c['shift']());}};_0x47c048(++_0x125bd2);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x2cdeff,_0x25d0b1){_0x2cdeff=_0x2cdeff-0x0;var _0x280300=_0x4fdb[_0x2cdeff];return _0x280300;};'use strict';var _=require(_0xb4fd('0x0'));var squel=require(_0xb4fd('0x1'));var as=require(_0xb4fd('0x2'));var qs=require(_0xb4fd('0x3'));var updateInteraction=require(_0xb4fd('0x4'))[_0xb4fd('0x5')];var utils=require(_0xb4fd('0x6'));var db=require(_0xb4fd('0x7'))['db'];function skipInteractionsQuery(_0x1c0b08,_0x5b73bb,_0x308de6){var _0x5c07c5=![];var _0x14052b=utils['getAccountFK'](_0x1c0b08);if(_0x5b73bb['role']===_0xb4fd('0x8')&&!_0x308de6[_0xb4fd('0x9')]&&!_0x308de6[_0x14052b]){_0x5c07c5=!![];}return _0x5c07c5;}function getTagsQuery(){return squel[_0xb4fd('0xa')]()['field']('id')['field'](_0xb4fd('0xb'))[_0xb4fd('0xc')](_0xb4fd('0xd'))['from'](_0xb4fd('0xe'));}function getUsersQuery(_0x17ac4b,_0x2148db){var _0x23b08f=utils[_0xb4fd('0xf')](_0x17ac4b);var _0x502379=_0xb4fd('0x10')+_0x17ac4b+_0xb4fd('0x11');var _0x2e8ee1=squel[_0xb4fd('0xa')]()['field'](_0xb4fd('0x12'))[_0xb4fd('0xc')](_0xb4fd('0x13'))['field'](_0xb4fd('0x14')+_0x23b08f)[_0xb4fd('0x15')](_0x502379,'ui')[_0xb4fd('0x16')](_0xb4fd('0x17'),'u',_0xb4fd('0x18'));if(_0x2148db[_0xb4fd('0x19')]>0x0){_0x2e8ee1[_0xb4fd('0x1a')]('ui.'+_0x23b08f+_0xb4fd('0x1b'),_[_0xb4fd('0x1c')](_0x2148db,'id'));}return _0x2e8ee1;}function getInteractionsQuery(_0x2e92b5){var _0x2d4701=utils[_0xb4fd('0x1d')](_0x2e92b5);var _0x137e51=utils[_0xb4fd('0x1e')](_0x2e92b5);var _0x44f0f0=utils[_0xb4fd('0xf')](_0x2e92b5);return squel[_0xb4fd('0xa')]()[_0xb4fd('0x15')](_0x2d4701['interactions'],'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb4fd('0x16')](_0xb4fd('0x17'),'o',_0xb4fd('0x1f'))[_0xb4fd('0x16')](_0x2d4701[_0xb4fd('0x20')],'a',_0xb4fd('0x21')+_0x137e51)[_0xb4fd('0x16')](_0x2d4701['messages'],'me','me.'+_0x44f0f0+_0xb4fd('0x22'))[_0xb4fd('0x16')](_0x2d4701[_0xb4fd('0x23')],'it','it.'+_0x44f0f0+_0xb4fd('0x22'))['left_join'](_0xb4fd('0xe'),'t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x2a9c8c={'body':squel[_0xb4fd('0x24')](),'contact':squel[_0xb4fd('0x24')](),'default':squel[_0xb4fd('0x24')](),'fields':squel[_0xb4fd('0x24')](),'filter':squel[_0xb4fd('0x24')](),'read':squel[_0xb4fd('0x24')](),'tags':{'clause':squel[_0xb4fd('0x24')](),'ids':null},'user':squel['expr']()};return _0x2a9c8c;}function parseTagParameter(_0x498761){var _0x4baf02=squel[_0xb4fd('0x24')]();if(_0x498761){var _0x4bad85=utils[_0xb4fd('0x25')](_0x498761);_0x4bad85['forEach'](function(_0x5738c2){_0x4baf02['or'](_0xb4fd('0x26'),'%,'+_0x5738c2+',%');});}return _0x4baf02;}function parseReadParameter(_0x7c5313){var _0xda5ea8='';if(_0x7c5313){_0xda5ea8='unreadMessages\x20{OPERATOR}\x200';if(_0x7c5313==='1'){_0xda5ea8=_0xda5ea8[_0xb4fd('0x27')](_0xb4fd('0x28'),'=');}else{_0xda5ea8=_0xda5ea8[_0xb4fd('0x27')](_0xb4fd('0x28'),'>');}}return _0xda5ea8;}function parseSearchFilter(_0x5d5606,_0xd72bc3){var _0x263d6f=squel['expr']();if(_0xd72bc3){var _0x3e5060=_0xd72bc3[_0xb4fd('0x27')]('\x5c','\x5c\x5c')[_0xb4fd('0x27')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3e5060)){_0x263d6f['or'](_0xb4fd('0x29'),_0x3e5060+'%');if([_0xb4fd('0x2a'),_0xb4fd('0x2b')]['includes'](_0x5d5606)){_0x263d6f['or']('i.phone\x20LIKE\x20?',_0x3e5060+'%');}else if(_0x5d5606==='fax'){_0x263d6f['or']('i.fax\x20LIKE\x20?',_0x3e5060+'%');}else if(_0x5d5606===_0xb4fd('0x2c')){_0x263d6f['or'](_0xb4fd('0x2d'),_0x3e5060+'%');}}else if(_0x5d5606===_0xb4fd('0x2e')&&qs[_0xb4fd('0x2f')](_0x3e5060)){_0x263d6f['or'](_0xb4fd('0x30'),_0x3e5060+'%');}else{if(_0x5d5606===_0xb4fd('0x2e')){_0x263d6f['or'](_0xb4fd('0x31'),qs[_0xb4fd('0x32')](_0x3e5060))['or'](_0xb4fd('0x33'),qs[_0xb4fd('0x32')](_0x3e5060));}else{if(_0x5d5606!==_0xb4fd('0x34')){_0x263d6f['or'](_0xb4fd('0x35'),qs[_0xb4fd('0x32')](_0x3e5060));}_0x263d6f['or'](_0xb4fd('0x36'),_0x3e5060+'%');}}}return _0x263d6f;}function parseAdvancedSearchFilter(_0x32d561,_0x36b269){var _0x373b2e=getSqlClauses();var _0x194c14=as['parseSearch'](_0x32d561);var _0x4fadd4=_0x194c14[_0xb4fd('0x37')];for(var _0xca8c59=0x0;_0xca8c59<_0x194c14[_0xb4fd('0x38')][_0xb4fd('0x19')];_0xca8c59++){var _0x1a9d19=_0x194c14['conditions'][_0xca8c59];var _0x2e09d6='i';var _0x265634=_[_0xb4fd('0x39')](_0x36b269,[_0xb4fd('0xb'),_0x1a9d19[_0xb4fd('0xc')]]);if(_0x265634){var _0x5502e4=as[_0xb4fd('0x3a')](_0x2e09d6,_0x265634['type'],_0x1a9d19);_0x373b2e[_0xb4fd('0x3b')][_0x4fadd4](_0x5502e4[_0xb4fd('0x3c')],_0x5502e4['value']['start'],_0x5502e4[_0xb4fd('0x3d')][_0xb4fd('0x3e')]);}else{switch(_0x1a9d19[_0xb4fd('0xc')]){case _0xb4fd('0x3f'):var _0x28487b=parseReadParameter(_0x1a9d19[_0xb4fd('0x3d')]);_0x373b2e['read'][_0xb4fd('0x40')](_0x28487b);break;case _0xb4fd('0x41'):if(_0x1a9d19['operator']===_0xb4fd('0x42')){if(_0x1a9d19[_0xb4fd('0x3d')][_0xb4fd('0x43')]('\x20')[_0xb4fd('0x19')]>0x1){_0x373b2e['contact'][_0x4fadd4](_0xb4fd('0x44'),qs[_0xb4fd('0x32')](_0x1a9d19[_0xb4fd('0x3d')]),null);}else{var _0x2ab6bd='%'+_0x1a9d19[_0xb4fd('0x3d')]+'%';_0x373b2e[_0xb4fd('0x45')][_0x4fadd4]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2ab6bd,_0x2ab6bd,_0x2ab6bd);}}else{_0x265634=_[_0xb4fd('0x39')](_0x36b269,[_0xb4fd('0xb'),'ContactId']);_0x1a9d19[_0xb4fd('0xc')]=_0xb4fd('0x46');_0x5502e4=as[_0xb4fd('0x3a')](_0x2e09d6,_0x265634[_0xb4fd('0x47')],_0x1a9d19);_0x373b2e[_0xb4fd('0x45')][_0x4fadd4](_0x5502e4['text'],_0x5502e4[_0xb4fd('0x3d')][_0xb4fd('0x48')],_0x5502e4[_0xb4fd('0x3d')]['end']);}break;case _0xb4fd('0x49'):var _0x5102d4=_0x1a9d19[_0xb4fd('0x3d')][_0xb4fd('0x43')](',')['map'](function(_0x563366){return Number(_0x563366);});var _0x4fbc36=parseTagParameter(_0x5102d4);_0x373b2e[_0xb4fd('0x4a')][_0xb4fd('0x4b')][_0xb4fd('0x40')](_0x4fbc36);_0x373b2e['tags'][_0xb4fd('0x4c')]=_0x5102d4;break;case _0xb4fd('0x4d'):if(_0x1a9d19[_0xb4fd('0x4e')]===_0xb4fd('0x42')){_0x373b2e[_0xb4fd('0x4f')][_0x4fadd4](_0xb4fd('0x50'),'%'+_0x1a9d19[_0xb4fd('0x3d')]+'%',null);}else{_0x265634=_['find'](_0x36b269,['name',_0xb4fd('0x51')]);_0x1a9d19[_0xb4fd('0xc')]=_0xb4fd('0x51');_0x5502e4=as[_0xb4fd('0x3a')](_0x2e09d6,_0x265634['type'],_0x1a9d19);_0x373b2e[_0xb4fd('0x4f')][_0x4fadd4](_0x5502e4['text'],_0x5502e4['value'][_0xb4fd('0x48')],_0x5502e4[_0xb4fd('0x3d')]['end']);}break;case _0xb4fd('0x52'):case _0xb4fd('0x53'):_0x5502e4=as['buildExpression']('me',null,_0x1a9d19);_0x373b2e[_0xb4fd('0x52')][_0x4fadd4](_0x5502e4[_0xb4fd('0x3c')],_0x5502e4[_0xb4fd('0x3d')]['start'],_0x5502e4['value'][_0xb4fd('0x3e')]);break;}}}return _0x373b2e;}function parseModelFields(_0x1b5f2d,_0x17fbc7,_0x339990){var _0x47ebff=utils[_0xb4fd('0x1e')](_0x1b5f2d);var _0x308e7e=squel['expr']();var _0x126225=_(_0x17fbc7)[_0xb4fd('0x54')]()[_0xb4fd('0x1c')](function(_0x4bc6b2){return _[_0xb4fd('0x55')](_0x339990,[_0xb4fd('0xb'),_0x4bc6b2])?_0x4bc6b2:undefined;})['compact']()[_0xb4fd('0x3d')]();if(_0x126225['length']>0x0){_0x126225['forEach'](function(_0x320bdf){if(_0x320bdf===_0x47ebff){_0x308e7e[_0xb4fd('0x40')]('i.'+_0x47ebff+_0xb4fd('0x1b'),[][_0xb4fd('0x56')](_0x17fbc7[_0x320bdf]));}else if(_0x320bdf===_0xb4fd('0x57')){var _0x409e41=JSON[_0xb4fd('0x58')](_0x17fbc7[_0x320bdf])[_0xb4fd('0x59')];var _0x44d43d=JSON[_0xb4fd('0x58')](_0x17fbc7[_0x320bdf])[_0xb4fd('0x5a')];_0x308e7e[_0xb4fd('0x40')](_0xb4fd('0x5b'),_0x409e41,_0x44d43d);}else{if(_0x17fbc7[_0x320bdf]===_0xb4fd('0x5c')){_0x308e7e[_0xb4fd('0x40')]('i.'+_0x320bdf+'\x20IS\x20NULL');}else{_0x308e7e['and']('i.'+_0x320bdf+_0xb4fd('0x5d'),_0x17fbc7[_0x320bdf]);}}});}return _0x308e7e;}function parseQueryParameters(_0x7c85e8,_0x39b994,_0x2bf347){var _0x21c1ba=getSqlClauses();return Promise['resolve']()['then'](function(){return parseModelFields(_0x7c85e8,_0x39b994,_0x2bf347);})[_0xb4fd('0x5e')](function(_0x95ad2a){_0x21c1ba['fields']['and'](_0x95ad2a);return parseReadParameter(_0x39b994['read']);})[_0xb4fd('0x5e')](function(_0x2a17ad){_0x21c1ba[_0xb4fd('0x5f')][_0xb4fd('0x40')](_0x2a17ad);return parseTagParameter(_0x39b994['tag']);})['then'](function(_0x380638){_0x21c1ba[_0xb4fd('0x4a')][_0xb4fd('0x4b')]['and'](_0x380638);return parseSearchFilter(_0x7c85e8,_0x39b994[_0xb4fd('0x60')]);})[_0xb4fd('0x5e')](function(_0x135d0f){_0x21c1ba[_0xb4fd('0x60')]=_0x135d0f;return _0x21c1ba;});}function checkAccountsRestrictions(_0x566b7c,_0x423112,_0x16c8e6){var _0x5758ae=utils[_0xb4fd('0x1e')](_0x566b7c);var _0x49efc4=_0xb4fd('0x61')+_['capitalize'](_0x566b7c)+(_0x566b7c===_0xb4fd('0x62')?_0xb4fd('0x63'):_0xb4fd('0x64'));var _0x12e51e=squel[_0xb4fd('0x24')]();return Promise[_0xb4fd('0x65')]()[_0xb4fd('0x5e')](function(){if(_0x16c8e6[_0xb4fd('0x9')]&&_0x423112[_0xb4fd('0x66')]===_0xb4fd('0x8')){return _0x423112[_0x49efc4]({'attributes':['id'],'raw':!![]});}})[_0xb4fd('0x5e')](function(_0x40882b){if(_0x40882b){if(_0x40882b[_0xb4fd('0x19')]===0x0){_0x12e51e[_0xb4fd('0x40')]('i.'+_0x5758ae+'\x20IS\x20NULL');}else{_0x12e51e[_0xb4fd('0x40')]('i.'+_0x5758ae+'\x20IN\x20?',_[_0xb4fd('0x1c')](_0x40882b,'id'));}}else if(!_0x16c8e6[_0x5758ae]){_0x12e51e['and']('i.'+_0x5758ae+_0xb4fd('0x67'));}})[_0xb4fd('0x5e')](function(){return _0x12e51e;});}function getClosedOrderClause(_0x39769a,_0x4486ea){var _0x58f430='';var _0x5df9f0=[_0xb4fd('0x68'),'i.secondDisposition',_0xb4fd('0x69')];if(_0x39769a===_0xb4fd('0x2e')){_0x5df9f0[_0xb4fd('0x6a')]('i.substatus');}if(_0x4486ea[_0xb4fd('0x6b')]==='0'&&_0x39769a==='mail'){_0x58f430=_0xb4fd('0x6c');}else{if(_0x4486ea[_0xb4fd('0x6b')]==='1'){_0x5df9f0[_0xb4fd('0x6d')]();}_0x58f430=_0xb4fd('0x6e')+_0x5df9f0['join'](',\x20')+')';}return _0x58f430;}function getFilteredInteractions(_0x65661a,_0x483dfd,_0x38bac8,_0x3c573a){var _0x28a12c=utils['getInteractionFK'](_0x65661a);var _0x5dccc0=_['capitalize'](_0x65661a)+_0xb4fd('0x6f');var _0x5ce30c=[];var _0x3fac26=getTagsQuery();var _0x5042ce={'type':db[_0xb4fd('0x70')][_0xb4fd('0x71')][_0xb4fd('0x72')],'raw':!![]};var _0x16a3e0=[];var _0x47a474=[];return db[_0xb4fd('0x73')][_0xb4fd('0x74')](_0x3fac26[_0xb4fd('0x75')](),_0x5042ce)[_0xb4fd('0x5e')](function(_0x139004){_0x5ce30c=_['keyBy'](_0x139004,'id');_0x5042ce=_[_0xb4fd('0x76')](_0x5042ce,{'model':db[_0x5dccc0],'mapToModel':!![],'nest':!![]});if(_0x38bac8[_0xb4fd('0x77')]){_0x3c573a['attributes'][_0xb4fd('0x78')](function(_0x26788b){_0x483dfd[_0xb4fd('0xc')]('i.'+_0x26788b);});}else{_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x79'),_0xb4fd('0x3f'));_0x483dfd['field'](_0xb4fd('0x7a'),_0xb4fd('0x7b'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x7c'),_0xb4fd('0x7d'));if(_0x65661a===_0xb4fd('0x2e')){_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x7e'),_0xb4fd('0x7f'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x80'),_0xb4fd('0x81'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x82'));_0x483dfd[_0xb4fd('0xc')]('i.createdAt');_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x83'));_0x483dfd[_0xb4fd('0xc')]('i.closed');_0x483dfd[_0xb4fd('0xc')]('i.closedAt');_0x483dfd[_0xb4fd('0xc')]('i.attach');_0x483dfd['field']('i.lastMsgAt');_0x483dfd[_0xb4fd('0xc')]('i.lastMsgDirection');_0x483dfd['field'](_0xb4fd('0x84'));_0x483dfd['field']('i.disposition');_0x483dfd[_0xb4fd('0xc')]('i.secondDisposition');_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x68'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x6c'));_0x483dfd[_0xb4fd('0xc')]('i.to');_0x483dfd['field'](_0xb4fd('0x85'));_0x483dfd[_0xb4fd('0xc')]('i.MailAccountId');_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x86'));}else if(_0x65661a===_0xb4fd('0x2c')){_0x483dfd[_0xb4fd('0xc')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xb4fd('0x81'));}else{_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x87'),'contactName');}if(_0x65661a!==_0xb4fd('0x2e')){_0x483dfd[_0xb4fd('0xc')]('i.*');}_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x88'),_0xb4fd('0x89'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x8a'),_0xb4fd('0x8b'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x8c'),_0xb4fd('0x8d'));_0x483dfd[_0xb4fd('0xc')]('c.phone',_0xb4fd('0x8e'));_0x483dfd['field'](_0xb4fd('0x8f'),_0xb4fd('0x90'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x91'),_0xb4fd('0x92'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x93'),_0xb4fd('0x94'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x95'),_0xb4fd('0x96'));_0x483dfd[_0xb4fd('0xc')](_0xb4fd('0x97'),_0xb4fd('0x98'));}if(_0x3c573a['limit']){_0x483dfd[_0xb4fd('0x99')](_0x3c573a['limit']);}if(_0x3c573a[_0xb4fd('0x9a')]){_0x483dfd['offset'](_0x3c573a[_0xb4fd('0x9a')]);}return db['sequelize'][_0xb4fd('0x74')](_0x483dfd['toString'](),_0x5042ce);})[_0xb4fd('0x5e')](function(_0x550775){_0x16a3e0=_0x550775;var _0x5e91d9=getUsersQuery(_0x65661a,_0x16a3e0);return db[_0xb4fd('0x73')][_0xb4fd('0x74')](_0x5e91d9[_0xb4fd('0x75')](),_0x5042ce);})[_0xb4fd('0x5e')](function(_0xdeaf57){_0x47a474=_[_0xb4fd('0x9b')](_0xdeaf57,_0x28a12c);if(_0x65661a===_0xb4fd('0x2e')){return db[_0xb4fd('0x9c')][_0xb4fd('0x9d')]({'attributes':[_0xb4fd('0x9e')],'raw':!![]});}})['then'](function(_0x14be3e){var _0x138e1f=_0x14be3e?_0x14be3e[_0xb4fd('0x9e')]:undefined;var _0xab5dc8=_0x16a3e0['map'](function(_0x3829b6){return updateInteraction(_0x3829b6,_0x5ce30c,_0x47a474,_0x138e1f);});return Promise[_0xb4fd('0x9f')](_0xab5dc8);});}function countFilteredInteractions(_0x228d40,_0x57ce81){var _0x5e83ca=_0x228d40['clone']();_0x5e83ca['field'](_0xb4fd('0xa0'));_0x5e83ca[_0xb4fd('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb4fd('0x3f'));var _0x21fe18=utils[_0xb4fd('0x25')](_0x57ce81);if(!_['isEmpty'](_0x21fe18)){_0x5e83ca[_0xb4fd('0x1a')](_0xb4fd('0xa1'),_0x21fe18);}var _0x2efa1a={'type':db[_0xb4fd('0x70')][_0xb4fd('0x71')][_0xb4fd('0x72')],'raw':!![]};return db['sequelize'][_0xb4fd('0x74')](_0x5e83ca[_0xb4fd('0x75')](),_0x2efa1a);}module[_0xb4fd('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
+var _0x2dae=['c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','limit','offset','groupBy','Setting','findOne','enableEmailPreview','all','clone','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','t.id\x20IN\x20?','exports','lodash','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','getAccountFK','role','agent','search','select','field','name','from','tools_tags','getInteractionFK','user_has_','u.id','u.fullname','ui.','users','where','\x20IN\x20?','getInteractionsTables','interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','accounts','a.id\x20=\x20i.','me.','interactionsTags','it.','\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','{OPERATOR}','replace','isNumeric','i.id\x20LIKE\x20?','sms','whatsapp','includes','i.fax\x20LIKE\x20?','openchannel','i.from\x20LIKE\x20?','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','fax','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','buildExpression','type','default','value','end','unreadMessages','read','and','split','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','map','tags','ids','User','operator','$substring','user','UserId','keys','some','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','tag','clause','filter','get','capitalize','chat','Websites','Accounts','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Sequelize','QueryTypes','SELECT','sequelize','query','toString','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','Contact.firstName'];(function(_0x4ed2b4,_0x389c06){var _0x461831=function(_0x4a561a){while(--_0x4a561a){_0x4ed2b4['push'](_0x4ed2b4['shift']());}};_0x461831(++_0x389c06);}(_0x2dae,0xc3));var _0xe2da=function(_0x1ee351,_0x54261b){_0x1ee351=_0x1ee351-0x0;var _0x245aaf=_0x2dae[_0x1ee351];return _0x245aaf;};'use strict';var _=require(_0xe2da('0x0'));var squel=require('squel');var as=require(_0xe2da('0x1'));var qs=require(_0xe2da('0x2'));var updateInteraction=require(_0xe2da('0x3'))[_0xe2da('0x4')];var utils=require(_0xe2da('0x5'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x25b9f2,_0x439b5d,_0x77e45e){var _0x28cf6b=![];var _0x523c60=utils[_0xe2da('0x6')](_0x25b9f2);if(_0x439b5d[_0xe2da('0x7')]===_0xe2da('0x8')&&!_0x77e45e[_0xe2da('0x9')]&&!_0x77e45e[_0x523c60]){_0x28cf6b=!![];}return _0x28cf6b;}function getTagsQuery(){return squel[_0xe2da('0xa')]()[_0xe2da('0xb')]('id')[_0xe2da('0xb')](_0xe2da('0xc'))[_0xe2da('0xb')]('color')[_0xe2da('0xd')](_0xe2da('0xe'));}function getUsersQuery(_0x104fb3,_0x17086c){var _0x3c1309=utils[_0xe2da('0xf')](_0x104fb3);var _0x1a29b9=_0xe2da('0x10')+_0x104fb3+'_interactions';var _0xb98909=squel['select']()[_0xe2da('0xb')](_0xe2da('0x11'))[_0xe2da('0xb')](_0xe2da('0x12'))[_0xe2da('0xb')](_0xe2da('0x13')+_0x3c1309)[_0xe2da('0xd')](_0x1a29b9,'ui')['left_join'](_0xe2da('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x17086c['length']>0x0){_0xb98909[_0xe2da('0x15')](_0xe2da('0x13')+_0x3c1309+_0xe2da('0x16'),_['map'](_0x17086c,'id'));}return _0xb98909;}function getInteractionsQuery(_0x25d4fa){var _0x2c0353=utils[_0xe2da('0x17')](_0x25d4fa);var _0x33568f=utils['getAccountFK'](_0x25d4fa);var _0x45bb92=utils[_0xe2da('0xf')](_0x25d4fa);return squel[_0xe2da('0xa')]()[_0xe2da('0xd')](_0x2c0353[_0xe2da('0x18')],'i')['left_join'](_0xe2da('0x19'),'c',_0xe2da('0x1a'))['left_join'](_0xe2da('0x14'),'o',_0xe2da('0x1b'))[_0xe2da('0x1c')](_0x2c0353[_0xe2da('0x1d')],'a',_0xe2da('0x1e')+_0x33568f)[_0xe2da('0x1c')](_0x2c0353['messages'],'me',_0xe2da('0x1f')+_0x45bb92+'\x20=\x20i.id')[_0xe2da('0x1c')](_0x2c0353[_0xe2da('0x20')],'it',_0xe2da('0x21')+_0x45bb92+_0xe2da('0x22'))[_0xe2da('0x1c')](_0xe2da('0xe'),'t',_0xe2da('0x23'));}function getSqlClauses(){var _0x221e98={'body':squel['expr'](),'contact':squel[_0xe2da('0x24')](),'default':squel[_0xe2da('0x24')](),'fields':squel[_0xe2da('0x24')](),'filter':squel[_0xe2da('0x24')](),'read':squel[_0xe2da('0x24')](),'tags':{'clause':squel[_0xe2da('0x24')](),'ids':null},'user':squel[_0xe2da('0x24')]()};return _0x221e98;}function parseTagParameter(_0x56c37e){var _0x2adc49=squel[_0xe2da('0x24')]();if(_0x56c37e){var _0x1dc228=utils[_0xe2da('0x25')](_0x56c37e);_0x1dc228[_0xe2da('0x26')](function(_0x2b6c9e){_0x2adc49['or'](_0xe2da('0x27'),'%,'+_0x2b6c9e+',%');});}return _0x2adc49;}function parseReadParameter(_0x39f60e){var _0x516f42='';if(_0x39f60e){_0x516f42='unreadMessages\x20{OPERATOR}\x200';if(_0x39f60e==='1'){_0x516f42=_0x516f42['replace'](_0xe2da('0x28'),'=');}else{_0x516f42=_0x516f42[_0xe2da('0x29')](_0xe2da('0x28'),'>');}}return _0x516f42;}function parseSearchFilter(_0x1ab91a,_0x5de7fb){var _0x490794=squel[_0xe2da('0x24')]();if(_0x5de7fb){var _0x1ec8ca=_0x5de7fb[_0xe2da('0x29')]('\x5c','\x5c\x5c')[_0xe2da('0x29')](/'/g,'\x27\x27');if(qs[_0xe2da('0x2a')](_0x1ec8ca)){_0x490794['or'](_0xe2da('0x2b'),_0x1ec8ca+'%');if([_0xe2da('0x2c'),_0xe2da('0x2d')][_0xe2da('0x2e')](_0x1ab91a)){_0x490794['or']('i.phone\x20LIKE\x20?',_0x1ec8ca+'%');}else if(_0x1ab91a==='fax'){_0x490794['or'](_0xe2da('0x2f'),_0x1ec8ca+'%');}else if(_0x1ab91a===_0xe2da('0x30')){_0x490794['or'](_0xe2da('0x31'),_0x1ec8ca+'%');}}else if(_0x1ab91a===_0xe2da('0x32')&&qs[_0xe2da('0x33')](_0x1ec8ca)){_0x490794['or'](_0xe2da('0x34'),_0x1ec8ca+'%');}else{if(_0x1ab91a===_0xe2da('0x32')){_0x490794['or'](_0xe2da('0x35'),qs[_0xe2da('0x36')](_0x1ec8ca))['or'](_0xe2da('0x37'),qs[_0xe2da('0x36')](_0x1ec8ca));}else{if(_0x1ab91a!==_0xe2da('0x38')){_0x490794['or'](_0xe2da('0x39'),qs[_0xe2da('0x36')](_0x1ec8ca));}_0x490794['or'](_0xe2da('0x3a'),_0x1ec8ca+'%');}}}return _0x490794;}function parseAdvancedSearchFilter(_0x2618a1,_0x109d51){var _0x3a6f08=getSqlClauses();var _0x5a078e=as[_0xe2da('0x3b')](_0x2618a1);var _0x8bd0fc=_0x5a078e[_0xe2da('0x3c')];for(var _0x5e1f39=0x0;_0x5e1f39<_0x5a078e[_0xe2da('0x3d')][_0xe2da('0x3e')];_0x5e1f39++){var _0x262bf8=_0x5a078e['conditions'][_0x5e1f39];var _0x4d0963='i';var _0x156deb=_[_0xe2da('0x3f')](_0x109d51,['name',_0x262bf8[_0xe2da('0xb')]]);if(_0x156deb){var _0x15df09=as[_0xe2da('0x40')](_0x4d0963,_0x156deb[_0xe2da('0x41')],_0x262bf8);_0x3a6f08[_0xe2da('0x42')][_0x8bd0fc](_0x15df09['text'],_0x15df09[_0xe2da('0x43')]['start'],_0x15df09['value'][_0xe2da('0x44')]);}else{switch(_0x262bf8['field']){case _0xe2da('0x45'):var _0x27435b=parseReadParameter(_0x262bf8['value']);_0x3a6f08[_0xe2da('0x46')][_0xe2da('0x47')](_0x27435b);break;case'Contact':if(_0x262bf8['operator']==='$substring'){if(_0x262bf8[_0xe2da('0x43')][_0xe2da('0x48')]('\x20')[_0xe2da('0x3e')]>0x1){_0x3a6f08[_0xe2da('0x49')][_0x8bd0fc](_0xe2da('0x4a'),qs[_0xe2da('0x36')](_0x262bf8[_0xe2da('0x43')]),null);}else{var _0x4d4e90='%'+_0x262bf8[_0xe2da('0x43')]+'%';_0x3a6f08[_0xe2da('0x49')][_0x8bd0fc](_0xe2da('0x4b'),_0x4d4e90,_0x4d4e90,_0x4d4e90);}}else{_0x156deb=_[_0xe2da('0x3f')](_0x109d51,[_0xe2da('0xc'),'ContactId']);_0x262bf8[_0xe2da('0xb')]=_0xe2da('0x4c');_0x15df09=as[_0xe2da('0x40')](_0x4d0963,_0x156deb['type'],_0x262bf8);_0x3a6f08[_0xe2da('0x49')][_0x8bd0fc](_0x15df09[_0xe2da('0x4d')],_0x15df09[_0xe2da('0x43')][_0xe2da('0x4e')],_0x15df09[_0xe2da('0x43')][_0xe2da('0x44')]);}break;case _0xe2da('0x4f'):var _0x29ec1a=_0x262bf8['value'][_0xe2da('0x48')](',')[_0xe2da('0x50')](function(_0x2113e8){return Number(_0x2113e8);});var _0x3f970c=parseTagParameter(_0x29ec1a);_0x3a6f08[_0xe2da('0x51')]['clause'][_0xe2da('0x47')](_0x3f970c);_0x3a6f08[_0xe2da('0x51')][_0xe2da('0x52')]=_0x29ec1a;break;case _0xe2da('0x53'):if(_0x262bf8[_0xe2da('0x54')]===_0xe2da('0x55')){_0x3a6f08[_0xe2da('0x56')][_0x8bd0fc]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x262bf8[_0xe2da('0x43')]+'%',null);}else{_0x156deb=_['find'](_0x109d51,[_0xe2da('0xc'),_0xe2da('0x57')]);_0x262bf8[_0xe2da('0xb')]='UserId';_0x15df09=as[_0xe2da('0x40')](_0x4d0963,_0x156deb[_0xe2da('0x41')],_0x262bf8);_0x3a6f08['user'][_0x8bd0fc](_0x15df09[_0xe2da('0x4d')],_0x15df09[_0xe2da('0x43')][_0xe2da('0x4e')],_0x15df09['value'][_0xe2da('0x44')]);}break;case'body':case'plainBody':_0x15df09=as[_0xe2da('0x40')]('me',null,_0x262bf8);_0x3a6f08['body'][_0x8bd0fc](_0x15df09[_0xe2da('0x4d')],_0x15df09[_0xe2da('0x43')]['start'],_0x15df09[_0xe2da('0x43')][_0xe2da('0x44')]);break;}}}return _0x3a6f08;}function parseModelFields(_0x482547,_0x4a6d80,_0x101a46){var _0x49eb90=utils[_0xe2da('0x6')](_0x482547);var _0x448e06=squel[_0xe2da('0x24')]();var _0x1c17f1=_(_0x4a6d80)[_0xe2da('0x58')]()[_0xe2da('0x50')](function(_0x421467){return _[_0xe2da('0x59')](_0x101a46,[_0xe2da('0xc'),_0x421467])?_0x421467:undefined;})['compact']()[_0xe2da('0x43')]();if(_0x1c17f1[_0xe2da('0x3e')]>0x0){_0x1c17f1[_0xe2da('0x26')](function(_0x50c260){if(_0x50c260===_0x49eb90){_0x448e06[_0xe2da('0x47')]('i.'+_0x49eb90+_0xe2da('0x16'),[][_0xe2da('0x5a')](_0x4a6d80[_0x50c260]));}else if(_0x50c260===_0xe2da('0x5b')){var _0x242049=JSON[_0xe2da('0x5c')](_0x4a6d80[_0x50c260])[_0xe2da('0x5d')];var _0x563d1f=JSON['parse'](_0x4a6d80[_0x50c260])[_0xe2da('0x5e')];_0x448e06[_0xe2da('0x47')](_0xe2da('0x5f'),_0x242049,_0x563d1f);}else{if(_0x4a6d80[_0x50c260]==='null'){_0x448e06['and']('i.'+_0x50c260+_0xe2da('0x60'));}else{_0x448e06['and']('i.'+_0x50c260+_0xe2da('0x61'),_0x4a6d80[_0x50c260]);}}});}return _0x448e06;}function parseQueryParameters(_0x153749,_0x8e78b9,_0x3099aa){var _0x9b2155=getSqlClauses();return Promise[_0xe2da('0x62')]()[_0xe2da('0x63')](function(){return parseModelFields(_0x153749,_0x8e78b9,_0x3099aa);})[_0xe2da('0x63')](function(_0x21a19e){_0x9b2155['fields'][_0xe2da('0x47')](_0x21a19e);return parseReadParameter(_0x8e78b9[_0xe2da('0x46')]);})[_0xe2da('0x63')](function(_0x3d1dac){_0x9b2155['read'][_0xe2da('0x47')](_0x3d1dac);return parseTagParameter(_0x8e78b9[_0xe2da('0x64')]);})[_0xe2da('0x63')](function(_0x56f4b0){_0x9b2155[_0xe2da('0x51')][_0xe2da('0x65')][_0xe2da('0x47')](_0x56f4b0);return parseSearchFilter(_0x153749,_0x8e78b9[_0xe2da('0x66')]);})[_0xe2da('0x63')](function(_0x22a571){_0x9b2155[_0xe2da('0x66')]=_0x22a571;return _0x9b2155;});}function checkAccountsRestrictions(_0x377db9,_0x2cbe1c,_0x1d6077){var _0x154877=utils[_0xe2da('0x6')](_0x377db9);var _0x505c24=_0xe2da('0x67')+_[_0xe2da('0x68')](_0x377db9)+(_0x377db9===_0xe2da('0x69')?_0xe2da('0x6a'):_0xe2da('0x6b'));var _0x277e8c=squel[_0xe2da('0x24')]();return Promise['resolve']()[_0xe2da('0x63')](function(){if(_0x1d6077['search']&&_0x2cbe1c[_0xe2da('0x7')]===_0xe2da('0x8')){return _0x2cbe1c[_0x505c24]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x4e6c52){if(_0x4e6c52){if(_0x4e6c52[_0xe2da('0x3e')]===0x0){_0x277e8c['and']('i.'+_0x154877+_0xe2da('0x60'));}else{_0x277e8c['and']('i.'+_0x154877+_0xe2da('0x16'),_[_0xe2da('0x50')](_0x4e6c52,'id'));}}else if(!_0x1d6077[_0x154877]){_0x277e8c[_0xe2da('0x47')]('i.'+_0x154877+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x277e8c;});}function getClosedOrderClause(_0x5f280f,_0x3ef7c7){var _0x1fa149='';var _0x104f47=[_0xe2da('0x6c'),'i.secondDisposition',_0xe2da('0x6d')];if(_0x5f280f===_0xe2da('0x32')){_0x104f47[_0xe2da('0x6e')](_0xe2da('0x6f'));}if(_0x3ef7c7[_0xe2da('0x70')]==='0'&&_0x5f280f===_0xe2da('0x32')){_0x1fa149=_0xe2da('0x6f');}else{if(_0x3ef7c7['closed']==='1'){_0x104f47[_0xe2da('0x71')]();}_0x1fa149=_0xe2da('0x72')+_0x104f47[_0xe2da('0x73')](',\x20')+')';}return _0x1fa149;}function getFilteredInteractions(_0x1bff50,_0x16537b,_0x4cf58d,_0x841de3){var _0x56c488=utils[_0xe2da('0xf')](_0x1bff50);var _0x4d5997=_[_0xe2da('0x68')](_0x1bff50)+'Interaction';var _0x58f9db=[];var _0x12b911=getTagsQuery();var _0x405743={'type':db[_0xe2da('0x74')][_0xe2da('0x75')][_0xe2da('0x76')],'raw':!![]};var _0x44b96e=[];var _0x1d10a1=[];return db[_0xe2da('0x77')][_0xe2da('0x78')](_0x12b911[_0xe2da('0x79')](),_0x405743)['then'](function(_0x430a65){_0x58f9db=_[_0xe2da('0x7a')](_0x430a65,'id');_0x405743=_[_0xe2da('0x7b')](_0x405743,{'model':db[_0x4d5997],'mapToModel':!![],'nest':!![]});if(_0x4cf58d[_0xe2da('0x7c')]){_0x841de3['attributes'][_0xe2da('0x26')](function(_0x9877c2){_0x16537b[_0xe2da('0xb')]('i.'+_0x9877c2);});}else{_0x16537b[_0xe2da('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xe2da('0x45'));_0x16537b['field'](_0xe2da('0x7d'),_0xe2da('0x7e'));_0x16537b['field'](_0xe2da('0x7f'),_0xe2da('0x80'));if(_0x1bff50===_0xe2da('0x32')){_0x16537b[_0xe2da('0xb')](_0xe2da('0x81'),'Account.email');_0x16537b[_0xe2da('0xb')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x16537b['field']('i.id');_0x16537b[_0xe2da('0xb')](_0xe2da('0x82'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x83'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x84'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x85'));_0x16537b[_0xe2da('0xb')]('i.attach');_0x16537b[_0xe2da('0xb')](_0xe2da('0x86'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x87'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x88'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x6d'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x89'));_0x16537b['field'](_0xe2da('0x6c'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x6f'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x8a'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x8b'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x8c'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x8d'));}else if(_0x1bff50===_0xe2da('0x30')){_0x16537b['field'](_0xe2da('0x8e'),'contactName');}else{_0x16537b[_0xe2da('0xb')](_0xe2da('0x8f'),_0xe2da('0x90'));}if(_0x1bff50!==_0xe2da('0x32')){_0x16537b[_0xe2da('0xb')](_0xe2da('0x91'));}_0x16537b[_0xe2da('0xb')]('c.firstName',_0xe2da('0x92'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x93'),_0xe2da('0x94'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x95'),'Contact.email');_0x16537b[_0xe2da('0xb')](_0xe2da('0x96'),_0xe2da('0x97'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x98'),_0xe2da('0x99'));_0x16537b[_0xe2da('0xb')]('c.fax',_0xe2da('0x9a'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x9b'),_0xe2da('0x9c'));_0x16537b[_0xe2da('0xb')](_0xe2da('0x9d'),'Owner.internal');_0x16537b[_0xe2da('0xb')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x841de3[_0xe2da('0x9e')]){_0x16537b[_0xe2da('0x9e')](_0x841de3[_0xe2da('0x9e')]);}if(_0x841de3['offset']){_0x16537b[_0xe2da('0x9f')](_0x841de3[_0xe2da('0x9f')]);}return db[_0xe2da('0x77')][_0xe2da('0x78')](_0x16537b['toString'](),_0x405743);})[_0xe2da('0x63')](function(_0x4e2325){_0x44b96e=_0x4e2325;var _0x4ccff8=getUsersQuery(_0x1bff50,_0x44b96e);return db[_0xe2da('0x77')][_0xe2da('0x78')](_0x4ccff8[_0xe2da('0x79')](),_0x405743);})[_0xe2da('0x63')](function(_0x317dc9){_0x1d10a1=_[_0xe2da('0xa0')](_0x317dc9,_0x56c488);if(_0x1bff50==='mail'){return db[_0xe2da('0xa1')][_0xe2da('0xa2')]({'attributes':[_0xe2da('0xa3')],'raw':!![]});}})['then'](function(_0x3a4104){var _0xfe78a1=_0x3a4104?_0x3a4104[_0xe2da('0xa3')]:undefined;var _0x4af523=_0x44b96e[_0xe2da('0x50')](function(_0x12667e){return updateInteraction(_0x12667e,_0x58f9db,_0x1d10a1,_0xfe78a1);});return Promise[_0xe2da('0xa4')](_0x4af523);});}function countFilteredInteractions(_0x2f4c3a,_0x283fb4){var _0x52fadf=_0x2f4c3a[_0xe2da('0xa5')]();_0x52fadf[_0xe2da('0xb')](_0xe2da('0xa6'));_0x52fadf[_0xe2da('0xb')](_0xe2da('0xa7'),_0xe2da('0x45'));var _0x1fff3f=utils[_0xe2da('0x25')](_0x283fb4);if(!_[_0xe2da('0xa8')](_0x1fff3f)){_0x52fadf['where'](_0xe2da('0xa9'),_0x1fff3f);}var _0x38fc64={'type':db['Sequelize'][_0xe2da('0x75')]['SELECT'],'raw':!![]};return db['sequelize']['query'](_0x52fadf[_0xe2da('0x79')](),_0x38fc64);}module[_0xe2da('0xaa')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery};
\ No newline at end of file
index f39cacd..56cb9fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1966=['-id','then','lastMsgText','trimStart','catch','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','unmanaged','abandoned','UserId','answered','disposition','total','MailMessage','out','plainBody'];(function(_0x262417,_0x9b9f85){var _0x4404f7=function(_0x13354f){while(--_0x13354f){_0x262417['push'](_0x262417['shift']());}};_0x4404f7(++_0x9b9f85);}(_0x1966,0x1c2));var _0x6196=function(_0x452bac,_0x31d22a){_0x452bac=_0x452bac-0x0;var _0x2ff58c=_0x1966[_0x452bac];return _0x2ff58c;};'use strict';var _=require(_0x6196('0x0'));var db=require(_0x6196('0x1'))['db'];function getInteractionUsers(_0x52c616,_0x23073f){return new Promise(function(_0x3b0c10,_0x31e9e8){try{var _0x39ca12=[];if(_0x23073f[_0x52c616]){_0x39ca12=_0x23073f[_0x52c616][_0x6196('0x2')](function(_0x2f8162){return{'id':_0x2f8162['id'],'fullname':_0x2f8162[_0x6196('0x3')]};});}return _0x3b0c10(_0x39ca12);}catch(_0xbdd4b9){_0x31e9e8(_0xbdd4b9);}});}function getInteractionTags(_0x9ae482,_0x1cfd15){var _0x154614=[];if(_0x9ae482){_0x9ae482[_0x6196('0x4')](',')[_0x6196('0x5')](function(_0x2d8bd2){_0x154614[_0x6196('0x6')](_0x1cfd15[_0x2d8bd2]);});}return _0x154614;}function updateWaitingCounter(_0x20ae8e){if(_0x20ae8e[_0x6196('0x7')]){_0x20ae8e[_0x6196('0x7')]-=0x1;}}function updateInteractionCounters(_0x5bca15){_0x5bca15['waiting']=0x0;_0x5bca15[_0x6196('0x8')]=0x0;_0x5bca15['answered']=0x0;_0x5bca15[_0x6196('0x9')]=0x0;_0x5bca15['abandoned']=0x0;_0x5bca15['total']=0x0;if(_0x5bca15['closed']){if(_0x5bca15['disposition']===_0x6196('0xa')){_0x5bca15[_0x6196('0xa')]+=0x1;updateWaitingCounter(_0x5bca15);}if(_0x5bca15[_0x6196('0xb')]){_0x5bca15[_0x6196('0xc')]+=0x1;if(_0x5bca15['talking']){_0x5bca15[_0x6196('0x8')]-=0x1;}}else{if(_0x5bca15[_0x6196('0xd')]){_0x5bca15[_0x6196('0x9')]+=0x1;updateWaitingCounter(_0x5bca15);}}}else{if(!_0x5bca15[_0x6196('0xb')]){_0x5bca15['waiting']+=0x1;}if(_0x5bca15[_0x6196('0xb')]){_0x5bca15[_0x6196('0x8')]+=0x1;updateWaitingCounter(_0x5bca15);}}_0x5bca15[_0x6196('0xe')]+=0x1;return _0x5bca15;}function getLastMessageText(_0x31d043){return db[_0x6196('0xf')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x31d043['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x6196('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x6196('0x11')],'order':_0x6196('0x12'),'raw':!![]})[_0x6196('0x13')](function(_0x15f886){if(_0x15f886&&_0x15f886[_0x6196('0x11')]){_0x31d043[_0x6196('0x14')]=_[_0x6196('0x15')](_0x15f886['plainBody']);}return _0x31d043;})[_0x6196('0x16')](function(_0x1db96e){throw _0x1db96e;});}exports['updateInteraction']=function(_0x19d1b8,_0x815dfe,_0x4d3413,_0xd4aa10){return new Promise(function(_0x4b788f,_0x47bb9c){return getInteractionUsers(_0x19d1b8['id'],_0x4d3413)[_0x6196('0x13')](function(_0x1c45ac){_0x19d1b8[_0x6196('0x17')]=_0x1c45ac;return getInteractionTags(_0x19d1b8[_0x6196('0x18')],_0x815dfe);})['then'](function(_0x393a71){_0x19d1b8[_0x6196('0x19')]=_0x393a71;delete _0x19d1b8[_0x6196('0x18')];return updateInteractionCounters(_0x19d1b8);})[_0x6196('0x13')](function(_0x471c43){if(_0xd4aa10){return getLastMessageText(_0x471c43);}else{return _0x471c43;}})[_0x6196('0x13')](function(_0x30dc11){_0x4b788f(_0x30dc11);})[_0x6196('0x16')](function(_0x1fd119){_0x47bb9c(_0x1fd119);});});};
\ No newline at end of file
+var _0x445b=['waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId','findOne','out','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','lodash','../../mysqldb','fullname','split','forEach','push'];(function(_0x1282a0,_0x58b2f9){var _0x18af0c=function(_0x5ac73f){while(--_0x5ac73f){_0x1282a0['push'](_0x1282a0['shift']());}};_0x18af0c(++_0x58b2f9);}(_0x445b,0x1a3));var _0xb445=function(_0x14cdc0,_0x1da846){_0x14cdc0=_0x14cdc0-0x0;var _0x5d03b6=_0x445b[_0x14cdc0];return _0x5d03b6;};'use strict';var _=require(_0xb445('0x0'));var db=require(_0xb445('0x1'))['db'];function getInteractionUsers(_0x1b42bf,_0x35c161){return new Promise(function(_0x1d5029,_0x6890b3){try{var _0x159f1d=[];if(_0x35c161[_0x1b42bf]){_0x159f1d=_0x35c161[_0x1b42bf]['map'](function(_0x5dba28){return{'id':_0x5dba28['id'],'fullname':_0x5dba28[_0xb445('0x2')]};});}return _0x1d5029(_0x159f1d);}catch(_0xfa8155){_0x6890b3(_0xfa8155);}});}function getInteractionTags(_0x30715b,_0x29e695){var _0x312738=[];if(_0x30715b){_0x30715b[_0xb445('0x3')](',')[_0xb445('0x4')](function(_0x235a05){_0x312738[_0xb445('0x5')](_0x29e695[_0x235a05]);});}return _0x312738;}function updateWaitingCounter(_0x296bfe){if(_0x296bfe['waiting']){_0x296bfe[_0xb445('0x6')]-=0x1;}}function updateInteractionCounters(_0xa41a1c){_0xa41a1c[_0xb445('0x6')]=0x0;_0xa41a1c[_0xb445('0x7')]=0x0;_0xa41a1c[_0xb445('0x8')]=0x0;_0xa41a1c[_0xb445('0x9')]=0x0;_0xa41a1c[_0xb445('0xa')]=0x0;_0xa41a1c[_0xb445('0xb')]=0x0;if(_0xa41a1c[_0xb445('0xc')]){if(_0xa41a1c[_0xb445('0xd')]===_0xb445('0xa')){_0xa41a1c[_0xb445('0xa')]+=0x1;updateWaitingCounter(_0xa41a1c);}if(_0xa41a1c[_0xb445('0xe')]){_0xa41a1c[_0xb445('0x8')]+=0x1;if(_0xa41a1c[_0xb445('0x7')]){_0xa41a1c['talking']-=0x1;}}else{if(_0xa41a1c[_0xb445('0xd')]){_0xa41a1c[_0xb445('0x9')]+=0x1;updateWaitingCounter(_0xa41a1c);}}}else{if(!_0xa41a1c[_0xb445('0xe')]){_0xa41a1c['waiting']+=0x1;}if(_0xa41a1c[_0xb445('0xe')]){_0xa41a1c[_0xb445('0x7')]+=0x1;updateWaitingCounter(_0xa41a1c);}}_0xa41a1c[_0xb445('0xb')]+=0x1;return _0xa41a1c;}function getLastMessageText(_0x3bfc4f){return db['MailMessage'][_0xb445('0xf')]({'where':{'$and':[{'MailInteractionId':_0x3bfc4f['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb445('0x10')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xb445('0x11')],'order':_0xb445('0x12'),'raw':!![]})[_0xb445('0x13')](function(_0x478c5e){if(_0x478c5e&&_0x478c5e['plainBody']){_0x3bfc4f[_0xb445('0x14')]=_[_0xb445('0x15')](_0x478c5e[_0xb445('0x11')]);}return _0x3bfc4f;})[_0xb445('0x16')](function(_0x4e1c3c){throw _0x4e1c3c;});}exports[_0xb445('0x17')]=function(_0x51b5b4,_0x2b3893,_0x52785e,_0x37591e){return new Promise(function(_0x85cd5a,_0x38f571){return getInteractionUsers(_0x51b5b4['id'],_0x52785e)[_0xb445('0x13')](function(_0x129b63){_0x51b5b4[_0xb445('0x18')]=_0x129b63;return getInteractionTags(_0x51b5b4['TagIds'],_0x2b3893);})[_0xb445('0x13')](function(_0x146ff1){_0x51b5b4['Tags']=_0x146ff1;delete _0x51b5b4['TagIds'];return updateInteractionCounters(_0x51b5b4);})[_0xb445('0x13')](function(_0x5d2757){if(_0x37591e){return getLastMessageText(_0x5d2757);}else{return _0x5d2757;}})[_0xb445('0x13')](function(_0x5e4058){_0x85cd5a(_0x5e4058);})[_0xb445('0x16')](function(_0x5087ce){_0x38f571(_0x5087ce);});});};
\ No newline at end of file
index 9890510..436ba67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x781f=['error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','capitalize','Website','Account','InteractionId','upperFirst','chat','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toUpperCase','name','role','Interaction','findOne','then','info','catch'];(function(_0x334478,_0xbf9236){var _0x3f4b5f=function(_0x14ca74){while(--_0x14ca74){_0x334478['push'](_0x334478['shift']());}};_0x3f4b5f(++_0xbf9236);}(_0x781f,0xcd));var _0xf781=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x781f[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xf781('0x0'));var db=require(_0xf781('0x1'))['db'];var loggers={'openchannel':require(_0xf781('0x2'))(_0xf781('0x3')),'mail':require(_0xf781('0x2'))('mail-interactions'),'fax':require(_0xf781('0x2'))(_0xf781('0x4')),'sms':require(_0xf781('0x2'))(_0xf781('0x5')),'chat':require(_0xf781('0x2'))(_0xf781('0x6')),'whatsapp':require(_0xf781('0x2'))('whatsapp-interactions')};function getAccountFK(_0x208f6a){return _[_0xf781('0x7')](_0x208f6a)+(_0x208f6a==='chat'?_0xf781('0x8'):_0xf781('0x9'))+'Id';}function getInteractionFK(_0x3269f6){return _[_0xf781('0x7')](_0x3269f6)+_0xf781('0xa');}function getInteractionId(_0x5a14e9,_0x60ef26,_0x164921){if(_0x5a14e9&&_0x5a14e9[_['upperFirst'](_0x164921)+_0xf781('0xa')]){return _0x5a14e9[_[_0xf781('0xb')](_0x164921)+_0xf781('0xa')];}else if(_0x5a14e9&&_0x5a14e9['id']){return _0x5a14e9['id'];}else if(_0x60ef26&&_0x60ef26['id']){return _0x60ef26['id'];}else{return'unknown';}}function getInteractionsTables(_0x350cc6){return{'accounts':_0x350cc6+'_'+(_0x350cc6===_0xf781('0xc')?'websites':_0xf781('0xd')),'interactions':_0x350cc6+_0xf781('0xe'),'interactionsTags':_0x350cc6+_0xf781('0xf'),'messages':_0x350cc6+_0xf781('0x10'),'userInteractions':_0xf781('0x11')+_0x350cc6+_0xf781('0xe')};}function getSelectedTags(_0x41226a){var _0x20e0d0=[];if(_0x41226a){_0x20e0d0=Array[_0xf781('0x12')](_0x41226a)?_0x41226a:[_0x41226a];}return _0x20e0d0;}function log(_0x388867,_0x19b117,_0x465d2f,_0x6312f9,_0x415f38,_0x31280a){loggers[_0x415f38['toLowerCase']()][_0x388867]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31280a[_0xf781('0x13')](),_0x19b117?_0x19b117['id']:null,_0x19b117?_0x19b117[_0xf781('0x14')]:null,_0x19b117?_0x19b117[_0xf781('0x15')]:null,getInteractionId(_0x465d2f,_0x6312f9,_0x415f38),_0x465d2f?JSON['stringify'](_0x465d2f):'null');}function updateUser(_0x118a6a,_0x1311e9,_0x113434,_0x111637,_0x10a2e0){db[_[_0xf781('0xb')](_0x111637)+_0xf781('0x16')][_0xf781('0x17')]({'where':{'id':getInteractionId(_0x1311e9,_0x113434,_0x111637)}})[_0xf781('0x18')](function(_0x3a11f7){if(_0x3a11f7){return _0x3a11f7['update']({'UserId':_0x118a6a?_0x118a6a['id']:null});}})[_0xf781('0x18')](function(_0x1a9a52){if(_0x1a9a52){log(_0xf781('0x19'),_0x118a6a,_0x1311e9,_0x113434,_0x111637,_0x10a2e0);}})[_0xf781('0x1a')](function(){log(_0xf781('0x1b'),_0x118a6a,_0x1311e9,_0x113434,_0x111637,_0x10a2e0);});}module[_0xf781('0x1c')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
+var _0x9bbf=['capitalize','chat','Account','InteractionId','upperFirst','_interaction_has_tags','_messages','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','update','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','whatsapp-interactions'];(function(_0x46b7e1,_0x44a2de){var _0x4daf0d=function(_0x574398){while(--_0x574398){_0x46b7e1['push'](_0x46b7e1['shift']());}};_0x4daf0d(++_0x44a2de);}(_0x9bbf,0x19e));var _0xf9bb=function(_0x5d588c,_0x3232a0){_0x5d588c=_0x5d588c-0x0;var _0x148140=_0x9bbf[_0x5d588c];return _0x148140;};'use strict';var _=require(_0xf9bb('0x0'));var db=require(_0xf9bb('0x1'))['db'];var loggers={'openchannel':require(_0xf9bb('0x2'))(_0xf9bb('0x3')),'mail':require(_0xf9bb('0x2'))('mail-interactions'),'fax':require(_0xf9bb('0x2'))(_0xf9bb('0x4')),'sms':require(_0xf9bb('0x2'))('sms-interactions'),'chat':require('../../config/logger')('chat-interactions'),'whatsapp':require(_0xf9bb('0x2'))(_0xf9bb('0x5'))};function getAccountFK(_0x20b6e3){return _[_0xf9bb('0x6')](_0x20b6e3)+(_0x20b6e3===_0xf9bb('0x7')?'Website':_0xf9bb('0x8'))+'Id';}function getInteractionFK(_0x43f28b){return _[_0xf9bb('0x6')](_0x43f28b)+'InteractionId';}function getInteractionId(_0x45d79f,_0x1ec2bc,_0x110bda){if(_0x45d79f&&_0x45d79f[_['upperFirst'](_0x110bda)+_0xf9bb('0x9')]){return _0x45d79f[_[_0xf9bb('0xa')](_0x110bda)+_0xf9bb('0x9')];}else if(_0x45d79f&&_0x45d79f['id']){return _0x45d79f['id'];}else if(_0x1ec2bc&&_0x1ec2bc['id']){return _0x1ec2bc['id'];}else{return'unknown';}}function getInteractionsTables(_0x48e700){return{'accounts':_0x48e700+'_'+(_0x48e700===_0xf9bb('0x7')?'websites':'accounts'),'interactions':_0x48e700+'_interactions','interactionsTags':_0x48e700+_0xf9bb('0xb'),'messages':_0x48e700+_0xf9bb('0xc'),'userInteractions':'user_has_'+_0x48e700+_0xf9bb('0xd')};}function getSelectedTags(_0x16dd0d){var _0x529045=[];if(_0x16dd0d){_0x529045=Array[_0xf9bb('0xe')](_0x16dd0d)?_0x16dd0d:[_0x16dd0d];}return _0x529045;}function log(_0x33f6ba,_0x203523,_0x223634,_0x4cbc2a,_0x52387e,_0x4884a5){loggers[_0x52387e[_0xf9bb('0xf')]()][_0x33f6ba](_0xf9bb('0x10'),_0x4884a5[_0xf9bb('0x11')](),_0x203523?_0x203523['id']:null,_0x203523?_0x203523[_0xf9bb('0x12')]:null,_0x203523?_0x203523[_0xf9bb('0x13')]:null,getInteractionId(_0x223634,_0x4cbc2a,_0x52387e),_0x223634?JSON['stringify'](_0x223634):_0xf9bb('0x14'));}function updateUser(_0x45520d,_0xcb7096,_0x5c8d53,_0x33205d,_0x54b9a1){db[_[_0xf9bb('0xa')](_0x33205d)+_0xf9bb('0x15')][_0xf9bb('0x16')]({'where':{'id':getInteractionId(_0xcb7096,_0x5c8d53,_0x33205d)}})[_0xf9bb('0x17')](function(_0x522fc2){if(_0x522fc2){return _0x522fc2[_0xf9bb('0x18')]({'UserId':_0x45520d?_0x45520d['id']:null});}})[_0xf9bb('0x17')](function(_0x7039ba){if(_0x7039ba){log('info',_0x45520d,_0xcb7096,_0x5c8d53,_0x33205d,_0x54b9a1);}})[_0xf9bb('0x19')](function(){log(_0xf9bb('0x1a'),_0x45520d,_0xcb7096,_0x5c8d53,_0x33205d,_0x54b9a1);});}module[_0xf9bb('0x1b')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser};
\ No newline at end of file
index 88ef913..9d3389e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa50=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','License','findOne','then','count','status','json'];(function(_0x10e840,_0x5b3935){var _0x405caa=function(_0x46b707){while(--_0x46b707){_0x10e840['push'](_0x10e840['shift']());}};_0x405caa(++_0x5b3935);}(_0xfa50,0x180));var _0x0fa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa50[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require(_0x0fa5('0x0'));var util=require(_0x0fa5('0x1'));var compose=require('composable-middleware');var db=require(_0x0fa5('0x2'))['db'];var config=require(_0x0fa5('0x3'));function getValueFromLicense(_0x14639c,_0x3d6868){if(_0x14639c&&_0x3d6868){if(_0x3d6868[_0x0fa5('0x4')]&&_0x3d6868['license']){var _0x22f465=_0x3d6868[_0x0fa5('0x4')];var _0x294b23=_0x3d6868[_0x0fa5('0x5')];var _0xd81941=_0x22f465[_0x0fa5('0x6')]('-')[0x4];var _0x2e7b2a=_0x22f465[_0x0fa5('0x6')]('-')[0x0];var _0x3eb611=crypto['createDecipher'](_0x0fa5('0x7'),util[_0x0fa5('0x8')](_0x0fa5('0x9'),_0xd81941,_0x22f465,_0x2e7b2a));var _0x5ef977=_0x3eb611['update'](_0x294b23,_0x0fa5('0xa'),_0x0fa5('0xb'));_0x5ef977+=_0x3eb611[_0x0fa5('0xc')](_0x0fa5('0xb'));var _0x3bd829=JSON[_0x0fa5('0xd')](_0x5ef977);return _0x3bd829[_0x0fa5('0xe')](_0x14639c)?_0x3bd829[_0x14639c]:null;}}return null;}function isLimit(_0x1a03fd,_0x1f9a12,_0x2af243,_0x1ff6bd){var _0x3b6a07=_0x1f9a12;return compose()['use'](function(_0x291190,_0x1ae7bd,_0x13e6b1){return db[_0x0fa5('0xf')][_0x0fa5('0x10')]({'where':{'id':0x1},'raw':!![]})[_0x0fa5('0x11')](function(_0x15f95d){var _0x2e8dd0=getValueFromLicense(_0x1a03fd,_0x15f95d);return _0x2e8dd0?_0x2e8dd0:_0x3b6a07;})[_0x0fa5('0x11')](function(_0x19850b){_0x3b6a07=_0x19850b;return _0x2af243[_0x0fa5('0x12')](_0x1ff6bd);})[_0x0fa5('0x11')](function(_0x51332a){if(_0x51332a>=_0x3b6a07){return _0x1ae7bd[_0x0fa5('0x13')](0x193)[_0x0fa5('0x14')]({'message':util[_0x0fa5('0x8')](_0x0fa5('0x15'),_0x1a03fd)});}_0x13e6b1();})[_0x0fa5('0x16')](function(_0x5e460a){_0x13e6b1(_0x5e460a);});});}function isUserLimit(){return isLimit(_0x0fa5('0x17'),0x1,db['User'],{'where':{'$or':[{'role':_0x0fa5('0x18')},{'role':_0x0fa5('0x19')}]}});}exports[_0x0fa5('0x1a')]=isUserLimit;
\ No newline at end of file
+var _0xf318=['%s:%s:%s','update','utf8','final','parse','hasOwnProperty','License','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr'];(function(_0x13bd48,_0x108337){var _0x198031=function(_0xc9cb78){while(--_0xc9cb78){_0x13bd48['push'](_0x13bd48['shift']());}};_0x198031(++_0x108337);}(_0xf318,0x146));var _0x8f31=function(_0x5a7bf9,_0x17ed3e){_0x5a7bf9=_0x5a7bf9-0x0;var _0x33fbd3=_0xf318[_0x5a7bf9];return _0x33fbd3;};'use strict';var crypto=require(_0x8f31('0x0'));var util=require(_0x8f31('0x1'));var compose=require(_0x8f31('0x2'));var db=require(_0x8f31('0x3'))['db'];var config=require(_0x8f31('0x4'));function getValueFromLicense(_0x207bfa,_0x581f45){if(_0x207bfa&&_0x581f45){if(_0x581f45[_0x8f31('0x5')]&&_0x581f45['license']){var _0x31227a=_0x581f45['data1'];var _0x2f9c93=_0x581f45[_0x8f31('0x6')];var _0x5d20db=_0x31227a[_0x8f31('0x7')]('-')[0x4];var _0x10b2c3=_0x31227a[_0x8f31('0x7')]('-')[0x0];var _0x2ac433=crypto[_0x8f31('0x8')](_0x8f31('0x9'),util['format'](_0x8f31('0xa'),_0x5d20db,_0x31227a,_0x10b2c3));var _0x581ac6=_0x2ac433[_0x8f31('0xb')](_0x2f9c93,'base64',_0x8f31('0xc'));_0x581ac6+=_0x2ac433[_0x8f31('0xd')](_0x8f31('0xc'));var _0x4ca9c2=JSON[_0x8f31('0xe')](_0x581ac6);return _0x4ca9c2[_0x8f31('0xf')](_0x207bfa)?_0x4ca9c2[_0x207bfa]:null;}}return null;}function isLimit(_0x4fcd89,_0x5c29ed,_0xa547d8,_0x45d917){var _0x357f57=_0x5c29ed;return compose()['use'](function(_0x583eb1,_0x408316,_0x52dd01){return db[_0x8f31('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3052a6){var _0x395f1c=getValueFromLicense(_0x4fcd89,_0x3052a6);return _0x395f1c?_0x395f1c:_0x357f57;})[_0x8f31('0x11')](function(_0x4cf5f3){_0x357f57=_0x4cf5f3;return _0xa547d8[_0x8f31('0x12')](_0x45d917);})['then'](function(_0xdd9519){if(_0xdd9519>=_0x357f57){return _0x408316[_0x8f31('0x13')](0x193)[_0x8f31('0x14')]({'message':util['format'](_0x8f31('0x15'),_0x4fcd89)});}_0x52dd01();})[_0x8f31('0x16')](function(_0x11c357){_0x52dd01(_0x11c357);});});}function isUserLimit(){return isLimit(_0x8f31('0x17'),0x1,db[_0x8f31('0x18')],{'where':{'$or':[{'role':_0x8f31('0x19')},{'role':_0x8f31('0x1a')}]}});}exports[_0x8f31('0x1b')]=isUserLimit;
\ No newline at end of file
index dbc8c05..a9eeb1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce56=['$in','start','pop','hours','minutes','seconds','lodash','parseSearch','startsWith','[$and]','replace','split','length','slice','forEach','shift','match','filter','conditions','push','buildExpression','DATE','operator','$between','value','$gt','add','days','format','YYYY-MM-DD','castTo','\x20AS\x20','text','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','$lte','<=\x20?','$gte','>=\x20?'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xce56,0xd6));var _0x6ce5=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xce56[_0x261e29];return _0x25ef43;};'use strict';var _=require(_0x6ce5('0x0'));var moment=require('moment');exports[_0x6ce5('0x1')]=function(_0x167412){var _0xa6725c={'conditions':[]};_0xa6725c['sqlOperator']=_[_0x6ce5('0x2')](_0x167412,'[$or]')?'or':'and';var _0x285f30=_0x167412['replace'](_0x6ce5('0x3'),'')[_0x6ce5('0x4')]('[$or]','')[_0x6ce5('0x5')]('||');for(var _0x3a810e=0x0;_0x3a810e<_0x285f30[_0x6ce5('0x6')];_0x3a810e++){var _0x23d018=_0x285f30[_0x3a810e]['split'](':=');var _0x2792c7=_0x23d018[0x0];var _0x22470b=_0x23d018[_0x6ce5('0x7')](0x1);_0x22470b[_0x6ce5('0x8')](function(_0x41ddb3){var _0x32a8c8=_0x41ddb3[_0x6ce5('0x5')]('[')[_0x6ce5('0x9')]();var _0x1a23b0=_0x41ddb3[_0x6ce5('0xa')](/\[(.*?)\]/g);_0x1a23b0[_0x6ce5('0x8')](function(_0x1296e4){var _0x4b44a9=_0x1296e4[_0x6ce5('0x5')]('[')[_0x6ce5('0xb')](function(_0x5f43ba){return _0x5f43ba['indexOf'](']')>-0x1;})['map'](function(_0x565120){return _0x565120['split'](']')[0x0];})[0x0];_0xa6725c[_0x6ce5('0xc')][_0x6ce5('0xd')]({'field':_0x2792c7,'operator':_0x32a8c8,'value':_0x4b44a9});});});}return _0xa6725c;};exports[_0x6ce5('0xe')]=function(_0x2239ec,_0x338925,_0x140eef){var _0x36785b={};if(_0x338925===_0x6ce5('0xf')){if(_0x140eef[_0x6ce5('0x10')]==='$eq'){_0x140eef[_0x6ce5('0x10')]=_0x6ce5('0x11');_0x140eef[_0x6ce5('0x12')]+=','+_0x140eef['value'];}else if(_['includes']([_0x6ce5('0x13'),'$lte'],_0x140eef['operator'])){_0x140eef[_0x6ce5('0x12')]=moment(_0x140eef['value'])[_0x6ce5('0x14')](0x1,_0x6ce5('0x15'))[_0x6ce5('0x16')](_0x6ce5('0x17'));}}if(_0x140eef[_0x6ce5('0x18')]){_0x338925=_0x140eef[_0x6ce5('0x18')];_0x36785b['text']='CAST('+_0x2239ec+'.'+_0x140eef['field']+_0x6ce5('0x19')+_0x140eef['castTo']+')\x20'+parseOperator(_0x140eef[_0x6ce5('0x10')]);}else{_0x36785b[_0x6ce5('0x1a')]=_0x2239ec+'.'+_0x140eef[_0x6ce5('0x1b')]+'\x20'+parseOperator(_0x140eef[_0x6ce5('0x10')]);}if(_[_0x6ce5('0x1c')]([_0x6ce5('0x1d'),_0x6ce5('0x1e')],_0x140eef[_0x6ce5('0x10')]))_0x36785b[_0x6ce5('0x1a')]='('+_0x36785b['text']+_0x6ce5('0x1f')+_0x2239ec+'.'+_0x140eef['field']+_0x6ce5('0x20');_0x36785b[_0x6ce5('0x12')]=parseValue(_0x338925,_0x140eef['operator'],_0x140eef[_0x6ce5('0x12')]);return _0x36785b;};function parseOperator(_0x382b61){var _0x398d75;switch(_0x382b61){case'$in':_0x398d75='IN\x20?';break;case _0x6ce5('0x1e'):_0x398d75=_0x6ce5('0x21');break;case _0x6ce5('0x22'):_0x398d75=_0x6ce5('0x23');break;case _0x6ce5('0x1d'):_0x398d75=_0x6ce5('0x24');break;case _0x6ce5('0x25'):case _0x6ce5('0x26'):case _0x6ce5('0x27'):_0x398d75=_0x6ce5('0x28');break;case _0x6ce5('0x29'):_0x398d75='<\x20?';break;case _0x6ce5('0x13'):_0x398d75='>\x20?';break;case _0x6ce5('0x2a'):_0x398d75=_0x6ce5('0x2b');break;case _0x6ce5('0x2c'):_0x398d75=_0x6ce5('0x2d');break;case _0x6ce5('0x11'):_0x398d75='BETWEEN\x20?\x20AND\x20?';break;}return _0x398d75;}function parseValue(_0x490827,_0xe9908b,_0x1fc9cc){var _0x32d820={'start':undefined,'end':undefined};switch(_0xe9908b){case _0x6ce5('0x2e'):case'$notIn':_0x32d820['start']=_0x1fc9cc['split'](',');break;case _0x6ce5('0x25'):_0x32d820[_0x6ce5('0x2f')]='%'+_0x1fc9cc+'%';break;case _0x6ce5('0x26'):_0x32d820['start']=_0x1fc9cc+'%';break;case'$endsWith':_0x32d820['start']='%'+_0x1fc9cc;break;case _0x6ce5('0x11'):var _0x33c3ec=_0x1fc9cc['split'](',');var _0x1fc9cc=_0x33c3ec[_0x6ce5('0x9')]();var _0x3562b9=_0x33c3ec[_0x6ce5('0x30')]();if(_0x490827===_0x6ce5('0xf')){_0x1fc9cc=moment(_0x1fc9cc)['utcOffset'](0x0,!![])[_0x6ce5('0x16')]();_0x3562b9=moment(_0x3562b9)['utcOffset'](0x0,!![])['add'](0x17,_0x6ce5('0x31'))[_0x6ce5('0x14')](0x3b,_0x6ce5('0x32'))[_0x6ce5('0x14')](0x3b,_0x6ce5('0x33'))[_0x6ce5('0x16')]();}_0x32d820={'start':_0x1fc9cc,'end':_0x3562b9};break;default:_0x32d820[_0x6ce5('0x2f')]=_0x1fc9cc;break;}return _0x32d820;}
\ No newline at end of file
+var _0xe798=['and','[$and]','split','length','shift','match','forEach','filter','indexOf','conditions','push','buildExpression','DATE','operator','$between','includes','$lte','value','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','$notIn','\x20IS\x20NULL)','NOT\x20IN\x20?','$eq','<>\x20?','$substring','$startsWith','$lt','<\x20?','$gt','<=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start','$endsWith','utcOffset','add','hours','seconds','lodash','moment','startsWith'];(function(_0x5a0f26,_0x4bee1f){var _0x1f42b2=function(_0x198d0a){while(--_0x198d0a){_0x5a0f26['push'](_0x5a0f26['shift']());}};_0x1f42b2(++_0x4bee1f);}(_0xe798,0x17d));var _0x8e79=function(_0x2b2941,_0x3b9b44){_0x2b2941=_0x2b2941-0x0;var _0x2560e6=_0xe798[_0x2b2941];return _0x2560e6;};'use strict';var _=require(_0x8e79('0x0'));var moment=require(_0x8e79('0x1'));exports['parseSearch']=function(_0x28dd78){var _0x1a487d={'conditions':[]};_0x1a487d['sqlOperator']=_[_0x8e79('0x2')](_0x28dd78,'[$or]')?'or':_0x8e79('0x3');var _0x30a223=_0x28dd78['replace'](_0x8e79('0x4'),'')['replace']('[$or]','')[_0x8e79('0x5')]('||');for(var _0xfcdcec=0x0;_0xfcdcec<_0x30a223[_0x8e79('0x6')];_0xfcdcec++){var _0x5ab9cc=_0x30a223[_0xfcdcec][_0x8e79('0x5')](':=');var _0x540abc=_0x5ab9cc[0x0];var _0x24e270=_0x5ab9cc['slice'](0x1);_0x24e270['forEach'](function(_0x463eb9){var _0x44c4f5=_0x463eb9[_0x8e79('0x5')]('[')[_0x8e79('0x7')]();var _0x29fe7d=_0x463eb9[_0x8e79('0x8')](/\[(.*?)\]/g);_0x29fe7d[_0x8e79('0x9')](function(_0x1059cb){var _0x3ab4c6=_0x1059cb[_0x8e79('0x5')]('[')[_0x8e79('0xa')](function(_0xcf24ce){return _0xcf24ce[_0x8e79('0xb')](']')>-0x1;})['map'](function(_0xed3615){return _0xed3615['split'](']')[0x0];})[0x0];_0x1a487d[_0x8e79('0xc')][_0x8e79('0xd')]({'field':_0x540abc,'operator':_0x44c4f5,'value':_0x3ab4c6});});});}return _0x1a487d;};exports[_0x8e79('0xe')]=function(_0x2e82d5,_0x479fb5,_0x3518b9){var _0x6aaea5={};if(_0x479fb5===_0x8e79('0xf')){if(_0x3518b9[_0x8e79('0x10')]==='$eq'){_0x3518b9[_0x8e79('0x10')]=_0x8e79('0x11');_0x3518b9['value']+=','+_0x3518b9['value'];}else if(_[_0x8e79('0x12')](['$gt',_0x8e79('0x13')],_0x3518b9[_0x8e79('0x10')])){_0x3518b9[_0x8e79('0x14')]=moment(_0x3518b9[_0x8e79('0x14')])['add'](0x1,'days')[_0x8e79('0x15')](_0x8e79('0x16'));}}if(_0x3518b9[_0x8e79('0x17')]){_0x479fb5=_0x3518b9[_0x8e79('0x17')];_0x6aaea5[_0x8e79('0x18')]=_0x8e79('0x19')+_0x2e82d5+'.'+_0x3518b9[_0x8e79('0x1a')]+_0x8e79('0x1b')+_0x3518b9[_0x8e79('0x17')]+')\x20'+parseOperator(_0x3518b9['operator']);}else{_0x6aaea5[_0x8e79('0x18')]=_0x2e82d5+'.'+_0x3518b9[_0x8e79('0x1a')]+'\x20'+parseOperator(_0x3518b9['operator']);}if(_['includes']([_0x8e79('0x1c'),_0x8e79('0x1d')],_0x3518b9[_0x8e79('0x10')]))_0x6aaea5[_0x8e79('0x18')]='('+_0x6aaea5[_0x8e79('0x18')]+'\x20OR\x20'+_0x2e82d5+'.'+_0x3518b9[_0x8e79('0x1a')]+_0x8e79('0x1e');_0x6aaea5[_0x8e79('0x14')]=parseValue(_0x479fb5,_0x3518b9['operator'],_0x3518b9[_0x8e79('0x14')]);return _0x6aaea5;};function parseOperator(_0x128160){var _0x2da08d;switch(_0x128160){case'$in':_0x2da08d='IN\x20?';break;case _0x8e79('0x1d'):_0x2da08d=_0x8e79('0x1f');break;case _0x8e79('0x20'):_0x2da08d='=\x20?';break;case'$ne':_0x2da08d=_0x8e79('0x21');break;case _0x8e79('0x22'):case _0x8e79('0x23'):case'$endsWith':_0x2da08d='LIKE\x20?';break;case _0x8e79('0x24'):_0x2da08d=_0x8e79('0x25');break;case _0x8e79('0x26'):_0x2da08d='>\x20?';break;case _0x8e79('0x13'):_0x2da08d=_0x8e79('0x27');break;case'$gte':_0x2da08d='>=\x20?';break;case _0x8e79('0x11'):_0x2da08d=_0x8e79('0x28');break;}return _0x2da08d;}function parseValue(_0x8466d0,_0x325eef,_0x1b2c44){var _0x2287dd={'start':undefined,'end':undefined};switch(_0x325eef){case _0x8e79('0x29'):case _0x8e79('0x1d'):_0x2287dd['start']=_0x1b2c44['split'](',');break;case'$substring':_0x2287dd['start']='%'+_0x1b2c44+'%';break;case _0x8e79('0x23'):_0x2287dd[_0x8e79('0x2a')]=_0x1b2c44+'%';break;case _0x8e79('0x2b'):_0x2287dd[_0x8e79('0x2a')]='%'+_0x1b2c44;break;case _0x8e79('0x11'):var _0xb8b73a=_0x1b2c44[_0x8e79('0x5')](',');var _0x1b2c44=_0xb8b73a[_0x8e79('0x7')]();var _0x272f5d=_0xb8b73a['pop']();if(_0x8466d0===_0x8e79('0xf')){_0x1b2c44=moment(_0x1b2c44)[_0x8e79('0x2c')](0x0,!![])[_0x8e79('0x15')]();_0x272f5d=moment(_0x272f5d)[_0x8e79('0x2c')](0x0,!![])[_0x8e79('0x2d')](0x17,_0x8e79('0x2e'))[_0x8e79('0x2d')](0x3b,'minutes')[_0x8e79('0x2d')](0x3b,_0x8e79('0x2f'))['format']();}_0x2287dd={'start':_0x1b2c44,'end':_0x272f5d};break;default:_0x2287dd[_0x8e79('0x2a')]=_0x1b2c44;break;}return _0x2287dd;}
\ No newline at end of file
index 057754b..7969b5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0309=['ASC','omit','isEmpty','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','push','join','getOptions','query','$id','model','intersection','attributes','fields','nolimit','order','filters','pick','filter','object','columns','name','value','where','VIRTUAL','lower','col','merge','options','lodash','moment','parse','keys','includes','split','forOwn','find','type','DATE','$gte','YYYY-MM-DD','utc','format','$lte','subtract','uniqueid','isArray','limit','offset','sort','map','priority','cast','unsigned','substr','DESC'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0309,0x165));var _0x9030=function(_0x40acd8,_0x1a4031){_0x40acd8=_0x40acd8-0x0;var _0x300d7a=_0x0309[_0x40acd8];return _0x300d7a;};'use strict';var _=require(_0x9030('0x0'));var sequelize=require('sequelize');var moment=require(_0x9030('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4875db){var _0x5b1a40=['ne'];try{var _0x352a94=JSON[_0x9030('0x2')](_0x4875db);var _0x4236be=Object[_0x9030('0x3')](_0x352a94)[0x0];return _0x5b1a40[_0x9030('0x4')](_0x4236be);}catch(_0xcbbe57){return![];}}function getOperatorValue(_0x482786){var _0x5a3334=JSON[_0x9030('0x2')](_0x482786);var _0x105c15=Object['keys'](_0x5a3334)[0x0];var _0xb53eb4=_0x5a3334[_0x105c15];return{['$'+_0x105c15]:_0xb53eb4};}exports['fields']=function(_0x1e2360){var _0x32d47d=null;if(_0x1e2360){_0x32d47d=_0x1e2360[_0x9030('0x5')](',');}return _0x32d47d;};exports['filters']=function(_0xe2c28b,_0x1da9ec){var _0x337b86={};if(!_['isEmpty'](_0xe2c28b)){_[_0x9030('0x6')](_0xe2c28b,function(_0x21bc06,_0x24d0f4){try{if(_0x1da9ec){var _0x11a539=_[_0x9030('0x7')](_0x1da9ec,{'name':_0x24d0f4})||{};if(hasSequelizeOperator(_0x21bc06)){_0x337b86[_0x24d0f4]=getOperatorValue(_0x21bc06);}else if(_0x11a539[_0x9030('0x8')]===_0x9030('0x9')&&_['isPlainObject'](_0x21bc06)){var _0x45e28a=JSON[_0x9030('0x2')](_0x21bc06);var _0x1e5bc9={'$gte':moment(moment(_0x45e28a[_0x9030('0xa')])['format'](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xd')](),'$lte':moment(moment(_0x45e28a[_0x9030('0xe')])[_0x9030('0xd')](_0x9030('0xb')))[_0x9030('0xc')]()[_0x9030('0xf')](0x1,'s')[_0x9030('0xd')]()};_0x337b86[_0x24d0f4]=_0x1e5bc9;}else if(_0x11a539['name']===_0x9030('0x10')){_0x337b86[_0x24d0f4]=_0x21bc06;}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}else{_0x337b86[_0x24d0f4]=_[_0x9030('0x11')](_0x21bc06)?_0x21bc06:JSON[_0x9030('0x2')](_0x21bc06);}}catch(_0x1327ec){_0x337b86[_0x24d0f4]=_0x21bc06[_0x9030('0x5')](',');}});}return _0x337b86;};exports[_0x9030('0x12')]=function(_0x1f5474){_0x1f5474=parseInt(_0x1f5474,0xa);if(!_0x1f5474||_0x1f5474<0x0){_0x1f5474=LIMIT_VALUE;}return _0x1f5474;};exports[_0x9030('0x13')]=function(_0x164c88){_0x164c88=parseInt(_0x164c88,0xa);if(!_0x164c88||_0x164c88<0x0){_0x164c88=0x0;}return _0x164c88;};exports[_0x9030('0x14')]=function(_0x372716){var _0x243e7d,_0x1e5988=null;if(_0x372716){_0x243e7d=_0x372716[_0x9030('0x5')](',');_0x1e5988=_[_0x9030('0x15')](_0x243e7d,function(_0x4b0792){if(_0x4b0792['indexOf']('-')===0x0){return[_0x4b0792===_0x9030('0x16')?sequelize[_0x9030('0x17')](sequelize['col'](_0x9030('0x16')),_0x9030('0x18')):_0x4b0792[_0x9030('0x19')](0x1),_0x9030('0x1a')];}else{return[_0x4b0792==='priority'?sequelize[_0x9030('0x17')](sequelize['col']('priority'),_0x9030('0x18')):_0x4b0792,_0x9030('0x1b')];}});}return _0x1e5988;};exports[_0x9030('0x1c')]=function(_0x539bb7,_0x36a98a){if(_[_0x9030('0x1d')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x11')](_0x539bb7)){for(var _0xce2840=0x0;_0xce2840<_0x539bb7[_0x9030('0x1e')];_0xce2840+=0x1){_0x539bb7[_0xce2840]=this['omit'](_0x539bb7[_0xce2840],_0x36a98a);}return _0x539bb7;}if(!_[_0x9030('0x1f')](_0x539bb7)){return _0x539bb7;}if(_[_0x9030('0x20')](_0x36a98a)){_0x36a98a=[_0x36a98a];}if(!_[_0x9030('0x11')](_0x36a98a)){return _0x539bb7;}for(var _0x463dda=0x0;_0x463dda<_0x36a98a[_0x9030('0x1e')];_0x463dda+=0x1){_[_0x9030('0x21')](_0x539bb7,_0x36a98a[_0x463dda]);}for(var _0x155b8c in _0x539bb7){if(_0x539bb7[_0x9030('0x22')](_0x155b8c)){_0x539bb7[_0x155b8c]=this[_0x9030('0x1c')](_0x539bb7[_0x155b8c],_0x36a98a);}}return _0x539bb7;};exports[_0x9030('0x23')]=function(_0x3be936){return _0x3be936[_0x9030('0x24')](RegExp(_0x9030('0x25')))?!![]:![];};exports[_0x9030('0x26')]=function(_0x584013){return _0x584013[_0x9030('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x43a31b){var _0x5b745a=[];_0x43a31b[_0x9030('0x5')](/[ ,]+/)[_0x9030('0x27')](function(_0x1bbad0){_0x1bbad0=_0x1bbad0['replace'](/([^:]")"+/g,'$1');_0x1bbad0='+'+_0x1bbad0+'*';var _0x432a50=/[ `!@#$%^&*()_\-?~]/;if(_0x1bbad0[_0x9030('0x24')](_0x432a50))_0x1bbad0='\x22'+_0x1bbad0+'\x22';_0x5b745a[_0x9030('0x28')](_0x1bbad0);});return _0x5b745a[_0x9030('0x29')]('\x20');};exports[_0x9030('0x2a')]=function(_0x14619b,_0x754e00,_0x12b9b8){var _0x134260={},_0x3400db={};if(_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')]){_0x754e00[_0x9030('0x2b')]['id']=_0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];delete _0x754e00[_0x9030('0x2b')][_0x9030('0x2c')];}_0x134260[_0x9030('0x2d')]=_['map'](_0x14619b,'name');_0x134260[_0x9030('0x2b')]=_[_0x9030('0x3')](_0x754e00['query']);_0x134260['filters']=_[_0x9030('0x2e')](_0x134260[_0x9030('0x2d')],_0x134260[_0x9030('0x2b')]);_0x3400db[_0x9030('0x2f')]=_['intersection'](_0x134260[_0x9030('0x2d')],this['fields'](_0x754e00[_0x9030('0x2b')][_0x9030('0x30')]));_0x3400db['attributes']=_0x3400db[_0x9030('0x2f')][_0x9030('0x1e')]?_0x3400db[_0x9030('0x2f')]:_0x134260['model'];if(!_0x754e00[_0x9030('0x2b')]['hasOwnProperty'](_0x9030('0x31'))){_0x3400db['limit']=this[_0x9030('0x12')](_0x754e00['query'][_0x9030('0x12')]);_0x3400db[_0x9030('0x13')]=this[_0x9030('0x13')](_0x754e00[_0x9030('0x2b')][_0x9030('0x13')]);}_0x3400db[_0x9030('0x32')]=this[_0x9030('0x14')](_0x754e00[_0x9030('0x2b')][_0x9030('0x14')]);_0x3400db['where']=this[_0x9030('0x33')](_[_0x9030('0x34')](_0x754e00[_0x9030('0x2b')],_0x134260['filters']),_0x14619b);if(_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]){var _0x3ebb74=_0x14619b;var _0x1a9ee5=_0x754e00['query'][_0x9030('0x35')];if(typeof _0x1a9ee5===_0x9030('0x36')){_0x3ebb74=_[_0x9030('0x35')](_0x14619b,function(_0x4ba687){return _[_0x9030('0x4')](_0x1a9ee5[_0x9030('0x37')],_0x4ba687[_0x9030('0x38')]);});_0x1a9ee5=_0x1a9ee5[_0x9030('0x39')];}_0x3400db[_0x9030('0x3a')]=_['merge'](_0x3400db[_0x9030('0x3a')],{'$or':_['map'](_0x3ebb74,function(_0x2b596c){if(_0x2b596c[_0x9030('0x8')]!==_0x9030('0x3b')){if(_0x12b9b8){return sequelize[_0x9030('0x3a')](sequelize['fn'](_0x9030('0x3c'),sequelize[_0x9030('0x3d')](_0x2b596c[_0x9030('0x38')])),{'$like':sequelize['fn'](_0x9030('0x3c'),'%'+_0x754e00['query'][_0x9030('0x35')]+'%')});}else{var _0x19d2d3={};_0x19d2d3[_0x2b596c[_0x9030('0x38')]]={'$like':'%'+_0x754e00[_0x9030('0x2b')][_0x9030('0x35')]+'%'};return _0x19d2d3;}}})});}_0x3400db=_[_0x9030('0x3e')]({},_0x3400db,_0x754e00[_0x9030('0x3f')]);return _0x3400db;};
\ No newline at end of file
+var _0x9b67=['lower','options','lodash','sequelize','moment','parse','keys','split','filters','isEmpty','forOwn','find','type','DATE','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','limit','offset','sort','indexOf','priority','col','DESC','cast','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','join','getOptions','query','$id','map','intersection','model','fields','attributes','where','pick','filter','object','includes','value','merge','VIRTUAL'];(function(_0x52ed6e,_0x10a030){var _0x582f08=function(_0x3168d7){while(--_0x3168d7){_0x52ed6e['push'](_0x52ed6e['shift']());}};_0x582f08(++_0x10a030);}(_0x9b67,0xf6));var _0x79b6=function(_0xbac34f,_0x1e1090){_0xbac34f=_0xbac34f-0x0;var _0x141ba2=_0x9b67[_0xbac34f];return _0x141ba2;};'use strict';var _=require(_0x79b6('0x0'));var sequelize=require(_0x79b6('0x1'));var moment=require(_0x79b6('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1f4b0b){var _0x29728d=['ne'];try{var _0x5523a1=JSON[_0x79b6('0x3')](_0x1f4b0b);var _0x1aeb24=Object['keys'](_0x5523a1)[0x0];return _0x29728d['includes'](_0x1aeb24);}catch(_0x38479d){return![];}}function getOperatorValue(_0x174768){var _0x258103=JSON[_0x79b6('0x3')](_0x174768);var _0xfa6a05=Object[_0x79b6('0x4')](_0x258103)[0x0];var _0x34adbe=_0x258103[_0xfa6a05];return{['$'+_0xfa6a05]:_0x34adbe};}exports['fields']=function(_0x1270a7){var _0x107e4b=null;if(_0x1270a7){_0x107e4b=_0x1270a7[_0x79b6('0x5')](',');}return _0x107e4b;};exports[_0x79b6('0x6')]=function(_0x1222a0,_0x52600c){var _0x3dd86d={};if(!_[_0x79b6('0x7')](_0x1222a0)){_[_0x79b6('0x8')](_0x1222a0,function(_0x301f13,_0x58a98b){try{if(_0x52600c){var _0x566c99=_[_0x79b6('0x9')](_0x52600c,{'name':_0x58a98b})||{};if(hasSequelizeOperator(_0x301f13)){_0x3dd86d[_0x58a98b]=getOperatorValue(_0x301f13);}else if(_0x566c99[_0x79b6('0xa')]===_0x79b6('0xb')&&_['isPlainObject'](_0x301f13)){var _0xc05a77=JSON[_0x79b6('0x3')](_0x301f13);var _0x365d23={'$gte':moment(moment(_0xc05a77[_0x79b6('0xc')])[_0x79b6('0xd')](_0x79b6('0xe')))[_0x79b6('0xf')]()[_0x79b6('0xd')](),'$lte':moment(moment(_0xc05a77[_0x79b6('0x10')])[_0x79b6('0xd')](_0x79b6('0xe')))[_0x79b6('0xf')]()[_0x79b6('0x11')](0x1,'s')['format']()};_0x3dd86d[_0x58a98b]=_0x365d23;}else if(_0x566c99[_0x79b6('0x12')]===_0x79b6('0x13')){_0x3dd86d[_0x58a98b]=_0x301f13;}else{_0x3dd86d[_0x58a98b]=_[_0x79b6('0x14')](_0x301f13)?_0x301f13:JSON[_0x79b6('0x3')](_0x301f13);}}else{_0x3dd86d[_0x58a98b]=_[_0x79b6('0x14')](_0x301f13)?_0x301f13:JSON[_0x79b6('0x3')](_0x301f13);}}catch(_0x131bc5){_0x3dd86d[_0x58a98b]=_0x301f13[_0x79b6('0x5')](',');}});}return _0x3dd86d;};exports[_0x79b6('0x15')]=function(_0x16b3ef){_0x16b3ef=parseInt(_0x16b3ef,0xa);if(!_0x16b3ef||_0x16b3ef<0x0){_0x16b3ef=LIMIT_VALUE;}return _0x16b3ef;};exports[_0x79b6('0x16')]=function(_0xa1a29a){_0xa1a29a=parseInt(_0xa1a29a,0xa);if(!_0xa1a29a||_0xa1a29a<0x0){_0xa1a29a=0x0;}return _0xa1a29a;};exports[_0x79b6('0x17')]=function(_0x52a70f){var _0x12ee6b,_0x4b42ef=null;if(_0x52a70f){_0x12ee6b=_0x52a70f[_0x79b6('0x5')](',');_0x4b42ef=_['map'](_0x12ee6b,function(_0x28b9c2){if(_0x28b9c2[_0x79b6('0x18')]('-')===0x0){return[_0x28b9c2===_0x79b6('0x19')?sequelize['cast'](sequelize[_0x79b6('0x1a')](_0x79b6('0x19')),'unsigned'):_0x28b9c2['substr'](0x1),_0x79b6('0x1b')];}else{return[_0x28b9c2===_0x79b6('0x19')?sequelize[_0x79b6('0x1c')](sequelize[_0x79b6('0x1a')](_0x79b6('0x19')),'unsigned'):_0x28b9c2,_0x79b6('0x1d')];}});}return _0x4b42ef;};exports[_0x79b6('0x1e')]=function(_0x17eff4,_0x26dd86){if(_['isEmpty'](_0x17eff4)){return _0x17eff4;}if(_['isArray'](_0x17eff4)){for(var _0x40ef76=0x0;_0x40ef76<_0x17eff4[_0x79b6('0x1f')];_0x40ef76+=0x1){_0x17eff4[_0x40ef76]=this[_0x79b6('0x1e')](_0x17eff4[_0x40ef76],_0x26dd86);}return _0x17eff4;}if(!_[_0x79b6('0x20')](_0x17eff4)){return _0x17eff4;}if(_['isString'](_0x26dd86)){_0x26dd86=[_0x26dd86];}if(!_[_0x79b6('0x14')](_0x26dd86)){return _0x17eff4;}for(var _0x52574b=0x0;_0x52574b<_0x26dd86[_0x79b6('0x1f')];_0x52574b+=0x1){_[_0x79b6('0x21')](_0x17eff4,_0x26dd86[_0x52574b]);}for(var _0x302596 in _0x17eff4){if(_0x17eff4[_0x79b6('0x22')](_0x302596)){_0x17eff4[_0x302596]=this['omit'](_0x17eff4[_0x302596],_0x26dd86);}}return _0x17eff4;};exports[_0x79b6('0x23')]=function(_0x310832){return _0x310832['match'](RegExp(_0x79b6('0x24')))?!![]:![];};exports[_0x79b6('0x25')]=function(_0x1b1f2b){return _0x1b1f2b[_0x79b6('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x79b6('0x27')]=function(_0x4716e1){var _0x53b2f5=[];_0x4716e1[_0x79b6('0x5')](/[ ,]+/)[_0x79b6('0x28')](function(_0x27f680){_0x27f680=_0x27f680[_0x79b6('0x29')](/([^:]")"+/g,'$1');_0x27f680='+'+_0x27f680+'*';var _0x135a13=/[ `!@#$%^&*()_\-?~]/;if(_0x27f680[_0x79b6('0x26')](_0x135a13))_0x27f680='\x22'+_0x27f680+'\x22';_0x53b2f5['push'](_0x27f680);});return _0x53b2f5[_0x79b6('0x2a')]('\x20');};exports[_0x79b6('0x2b')]=function(_0x34c1fd,_0x489962,_0x533a43){var _0x1f6b8e={},_0x1985bd={};if(_0x489962[_0x79b6('0x2c')][_0x79b6('0x2d')]){_0x489962[_0x79b6('0x2c')]['id']=_0x489962[_0x79b6('0x2c')]['$id'];delete _0x489962['query'][_0x79b6('0x2d')];}_0x1f6b8e['model']=_[_0x79b6('0x2e')](_0x34c1fd,'name');_0x1f6b8e[_0x79b6('0x2c')]=_[_0x79b6('0x4')](_0x489962['query']);_0x1f6b8e[_0x79b6('0x6')]=_[_0x79b6('0x2f')](_0x1f6b8e['model'],_0x1f6b8e[_0x79b6('0x2c')]);_0x1985bd['attributes']=_[_0x79b6('0x2f')](_0x1f6b8e[_0x79b6('0x30')],this[_0x79b6('0x31')](_0x489962[_0x79b6('0x2c')][_0x79b6('0x31')]));_0x1985bd[_0x79b6('0x32')]=_0x1985bd[_0x79b6('0x32')][_0x79b6('0x1f')]?_0x1985bd[_0x79b6('0x32')]:_0x1f6b8e[_0x79b6('0x30')];if(!_0x489962['query']['hasOwnProperty']('nolimit')){_0x1985bd[_0x79b6('0x15')]=this[_0x79b6('0x15')](_0x489962['query'][_0x79b6('0x15')]);_0x1985bd['offset']=this[_0x79b6('0x16')](_0x489962[_0x79b6('0x2c')][_0x79b6('0x16')]);}_0x1985bd['order']=this[_0x79b6('0x17')](_0x489962['query'][_0x79b6('0x17')]);_0x1985bd[_0x79b6('0x33')]=this[_0x79b6('0x6')](_[_0x79b6('0x34')](_0x489962[_0x79b6('0x2c')],_0x1f6b8e['filters']),_0x34c1fd);if(_0x489962['query'][_0x79b6('0x35')]){var _0x48ae49=_0x34c1fd;var _0x4037c8=_0x489962[_0x79b6('0x2c')][_0x79b6('0x35')];if(typeof _0x4037c8===_0x79b6('0x36')){_0x48ae49=_[_0x79b6('0x35')](_0x34c1fd,function(_0x376eb2){return _[_0x79b6('0x37')](_0x4037c8['columns'],_0x376eb2[_0x79b6('0x12')]);});_0x4037c8=_0x4037c8[_0x79b6('0x38')];}_0x1985bd[_0x79b6('0x33')]=_[_0x79b6('0x39')](_0x1985bd['where'],{'$or':_[_0x79b6('0x2e')](_0x48ae49,function(_0x4f803c){if(_0x4f803c['type']!==_0x79b6('0x3a')){if(_0x533a43){return sequelize[_0x79b6('0x33')](sequelize['fn'](_0x79b6('0x3b'),sequelize[_0x79b6('0x1a')](_0x4f803c[_0x79b6('0x12')])),{'$like':sequelize['fn'](_0x79b6('0x3b'),'%'+_0x489962[_0x79b6('0x2c')][_0x79b6('0x35')]+'%')});}else{var _0x5e01b4={};_0x5e01b4[_0x4f803c[_0x79b6('0x12')]]={'$like':'%'+_0x489962['query']['filter']+'%'};return _0x5e01b4;}}})});}_0x1985bd=_[_0x79b6('0x39')]({},_0x1985bd,_0x489962[_0x79b6('0x3c')]);return _0x1985bd;};
\ No newline at end of file
index 67ea3af..996e290 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe420=['result','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','getRealtimeAgents','*pause','getAgentStatus','startCase','Queue','findOne','getAgents','all','uniq','value','getAgentIdsByQueues','includes','map','getAgentIdsByStatus','resolve','User','name','fullname','chatPause','smsPause','pauseType','find','merge','globalStatus','catch','split','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','sort','toLowerCase','sortAgentsByStatus','userpic','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','whatsappCapacity','chatCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','online','filterAgentAttributes','lodash','jayson/promise','client','http','faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','ringing','voiceStatus','pause','faxStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','error'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe420,0xa1));var _0x0e42=function(_0x508d35,_0x25bce6){_0x508d35=_0x508d35-0x0;var _0x537eeb=_0xe420[_0x508d35];return _0x537eeb;};'use strict';var _=require(_0x0e42('0x0'));var jayson=require(_0x0e42('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x0e42('0x2')][_0x0e42('0x3')]({'port':0x232a});var routingClient=jayson['client'][_0x0e42('0x3')]({'port':0x232c});function isAgentPaused(_0x5e1ed5,_0x557af2){var _0x562bcd=[_0x5e1ed5['chatPause'],_0x5e1ed5[_0x0e42('0x4')],_0x5e1ed5[_0x0e42('0x5')],_0x5e1ed5[_0x0e42('0x6')],_0x5e1ed5['smsPause'],_0x5e1ed5[_0x0e42('0x7')],_0x5e1ed5[_0x0e42('0x8')]];if(!_0x557af2)return _[_0x0e42('0x9')](_0x562bcd);var _0x354b50=_[_0x0e42('0xa')](_0x562bcd);return _0x354b50[_0x0e42('0xb')]>0x0&&_0x354b50[_0x0e42('0xb')]<_0x562bcd['length']?!![]:![];}function isIdle(_0x44a811){return _0x44a811===_0x0e42('0xc')||_0x44a811===_0x0e42('0xd')||_0x44a811===_0x0e42('0xe')||_0x44a811===_0x0e42('0xf')||_['isNil'](_0x44a811);}function isAgentIdle(_0x3edfbc){if(_0x3edfbc[_0x0e42('0x10')]!==_0x0e42('0xc')&&_0x3edfbc['voicePause']){_0x3edfbc['voiceStatus']=_0x0e42('0x11');return![];}return _[_0x0e42('0x9')]([_0x3edfbc['chatStatus'],_0x3edfbc[_0x0e42('0x12')],_0x3edfbc[_0x0e42('0x13')],_0x3edfbc[_0x0e42('0x14')],_0x3edfbc[_0x0e42('0x15')],_0x3edfbc[_0x0e42('0x10')],_0x3edfbc[_0x0e42('0x16')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x0e42('0x17')]('Agents',{})['then'](function(_0xc788b4){if(_0xc788b4[_0x0e42('0x18')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x32141f=_0xc788b4[_0x0e42('0x19')];return routingClient[_0x0e42('0x17')](_0x0e42('0x1a'),{})[_0x0e42('0x1b')](function(_0x335920){if(_0x335920[_0x0e42('0x18')]){throw new Error(_0x0e42('0x1c'));}var _0x51f96e=_0x335920['result'];return _['merge']({},_0x32141f,_0x51f96e);});})['catch'](function(_0x3c3d54){throw _0x3c3d54;});}exports[_0x0e42('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x1bd6d1){var _0x129814=_0x0e42('0xd');if(isAgentPaused(_0x1bd6d1))_0x129814=_0x0e42('0x11');else if(isAgentPaused(_0x1bd6d1,!![]))_0x129814=_0x0e42('0x1e');else if(isAgentIdle(_0x1bd6d1))_0x129814=_0x0e42('0xc');else _0x129814='busy';return _0x129814;}exports[_0x0e42('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x49ec77,_0x43be12){var _0x41d026=_['isArray'](_0x49ec77)?_0x49ec77:[_0x49ec77];var _0x30f514=_[_0x0e42('0x20')](_0x43be12)+_0x0e42('0x21');var _0x2268b6=_['map'](_0x41d026,function(_0x5e26f2){return db[_0x30f514][_0x0e42('0x22')]({'where':{'id':_0x5e26f2}})[_0x0e42('0x1b')](function(_0x31c980){if(!_0x31c980)return[];return _0x31c980[_0x0e42('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x0e42('0x24')](_0x2268b6)['then'](function(_0x1dd166){var _0x51bc9b=_(_0x1dd166)['flatten']()['map']('id')[_0x0e42('0x25')]()[_0x0e42('0x26')]();return _0x51bc9b;});}exports[_0x0e42('0x27')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3d547b,_0x491e0,_0x524f13){try{if(_0x491e0[_0x0e42('0xb')]>0x0){_0x3d547b=_0x3d547b[_0x0e42('0xa')](function(_0x1ac60d){return _0x491e0[_0x0e42('0x28')](_0x1ac60d['id']);});}var _0x28d385=_0x3d547b[_0x0e42('0xa')](function(_0x4a2033){var _0x1f6494='busy';if(isAgentIdle(_0x4a2033)){_0x1f6494='idle';}return _0x1f6494===_0x524f13;});return _[_0x0e42('0x29')](_0x28d385,'id');}catch(_0x203bfd){throw _0x203bfd;}}exports[_0x0e42('0x2a')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x211579,_0x449507,_0x45e8eb){return Promise[_0x0e42('0x2b')]()[_0x0e42('0x1b')](function(){if(_0x449507['length']>0x0){_0x211579=_0x211579[_0x0e42('0xa')](function(_0x3047e9){return _0x449507['includes'](_0x3047e9['id']);});}return _0x211579;})['then'](function(){return db[_0x0e42('0x2c')]['findAll']({'attributes':['id',_0x0e42('0x2d'),_0x0e42('0x2e'),_0x0e42('0x2f'),'faxPause',_0x0e42('0x5'),_0x0e42('0x6'),_0x0e42('0x30'),_0x0e42('0x7'),_0x0e42('0x8'),_0x0e42('0x31')],'where':{'id':{'$in':_['map'](_0x211579,'id')}},'raw':!![]});})['then'](function(_0x383f13){return _0x383f13['map'](function(_0x1c3d5a){var _0x2874d1=_[_0x0e42('0x32')](_0x211579,['id',_0x1c3d5a['id']]);var _0x3ee3d7=filterAgentAttributes(_0x2874d1);_[_0x0e42('0x33')](_0x1c3d5a,_0x3ee3d7);_0x1c3d5a[_0x0e42('0x34')]=getAgentStatus(_0x1c3d5a);return _0x1c3d5a;});})[_0x0e42('0x1b')](function(_0x1c8a3c){var _0x12cbcb=sortAgentsByStatus(_0x1c8a3c,_0x45e8eb);return _[_0x0e42('0x29')](_0x12cbcb,'id');})[_0x0e42('0x35')](function(_0x3ca832){throw _0x3ca832;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x29c738){var _0x56a87a={'fields':[],'order':null};var _0x6cfd40=_0x29c738[_0x0e42('0x36')](',');_0x56a87a['fields']=_[_0x0e42('0xa')](_0x6cfd40,function(_0x31ed5c){if(!_0x31ed5c['includes']('globalStatus')){return!![];}_0x56a87a[_0x0e42('0x37')]=_[_0x0e42('0x38')](_0x31ed5c,'-')?_0x0e42('0x39'):_0x0e42('0x3a');return![];});return _0x56a87a;}exports[_0x0e42('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x5be5ad){if(_0x5be5ad[_0x0e42('0x28')](_0x0e42('0x2e'))&&!_0x5be5ad[_0x0e42('0x28')](_0x0e42('0x3c'))){var _0x12041f=_0x5be5ad[_0x0e42('0x3d')](0x0,_0x5be5ad[_0x0e42('0x3e')](_0x0e42('0x2e')));_0x5be5ad+=','+_0x12041f+'internal';}return _0x5be5ad;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x5059c6,_0x3b7c00){var _0x5ab1ea=_0x5059c6[_0x0e42('0x3f')](function(_0x1e931,_0x481c14){if(_0x1e931[_0x0e42('0x34')]===_0x481c14[_0x0e42('0x34')]){if(_0x1e931['globalStatus']===_0x0e42('0x11')){if(_0x3b7c00===_0x0e42('0x39')){return(_0x1e931['pauseType']||'')<(_0x481c14[_0x0e42('0x31')]||'')||_0x1e931[_0x0e42('0x2e')][_0x0e42('0x40')]()>_0x481c14[_0x0e42('0x2e')][_0x0e42('0x40')]()?0x1:-0x1;}else{return(_0x1e931[_0x0e42('0x31')]||'')<(_0x481c14['pauseType']||'')||_0x1e931[_0x0e42('0x2e')][_0x0e42('0x40')]()>_0x481c14['fullname']['toLowerCase']()?-0x1:0x1;}}else{if(_0x3b7c00===_0x0e42('0x39')){return _0x1e931[_0x0e42('0x2e')][_0x0e42('0x40')]()<_0x481c14['fullname']['toLowerCase']()?0x1:-0x1;}else{return _0x1e931[_0x0e42('0x2e')][_0x0e42('0x40')]()<_0x481c14['fullname'][_0x0e42('0x40')]()?-0x1:0x1;}}}else{if(_0x3b7c00==='DESC'){return _0x1e931['globalStatus']<_0x481c14[_0x0e42('0x34')]?0x1:-0x1;}else{return _0x1e931[_0x0e42('0x34')]<_0x481c14['globalStatus']?-0x1:0x1;}}});return _0x5ab1ea;}exports[_0x0e42('0x41')]=sortAgentsByStatus;function filterAgentAttributes(_0x2d8377){var _0x24fb76=[_0x0e42('0x42'),'online',_0x0e42('0x43'),'lastPauseAt','pauseType',_0x0e42('0x44'),'internal',_0x0e42('0x45'),'chatPause',_0x0e42('0x6'),'mailPause',_0x0e42('0x30'),_0x0e42('0x8'),_0x0e42('0x4'),'voicePause',_0x0e42('0x46'),_0x0e42('0x47'),_0x0e42('0x48'),'smsCapacity',_0x0e42('0x49'),'faxCapacity',_0x0e42('0x4a'),'openchannelCurrentCapacity','mailCurrentCapacity',_0x0e42('0x4b'),_0x0e42('0x4c'),_0x0e42('0x4d'),_0x0e42('0x4e'),'openchannelStatus',_0x0e42('0x13'),'smsStatus',_0x0e42('0x16'),_0x0e42('0x12'),_0x0e42('0x10'),_0x0e42('0x4f'),_0x0e42('0x50'),'mailStatusTime',_0x0e42('0x51'),_0x0e42('0x52'),_0x0e42('0x53'),_0x0e42('0x54'),_0x0e42('0x55'),_0x0e42('0x56'),_0x0e42('0x57'),_0x0e42('0x58'),_0x0e42('0x59'),_0x0e42('0x5a')];var _0x525ceb=[_0x0e42('0x2f'),_0x0e42('0x6'),'mailPause',_0x0e42('0x30'),_0x0e42('0x8'),'faxPause',_0x0e42('0x7'),_0x0e42('0x5b')];var _0x546661=_(_0x2d8377)['omit'](_0x525ceb)['pick'](_0x24fb76)[_0x0e42('0x26')]();return _0x546661;}exports[_0x0e42('0x5c')]=filterAgentAttributes;
\ No newline at end of file
+var _0x3f18=['openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxStatus','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableAutomaticScreenRecording','omit','pick','lodash','jayson/promise','http','client','chatPause','faxPause','openchannelPause','smsPause','voicePause','whatsappPause','filter','length','unavailable','ringing','isNil','idle','voiceStatus','every','mailStatus','openchannelStatus','smsStatus','whatsappStatus','Agents','error','result','request','then','merge','catch','getRealtimeAgents','unknown','pause','*pause','busy','isArray','startCase','map','findOne','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','fullname','mailPause','pauseType','find','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','toLowerCase','userpic','online','lastLoginAt','lastPauseAt','address'];(function(_0x3c0d9d,_0x17130e){var _0x5667ed=function(_0x301a5d){while(--_0x301a5d){_0x3c0d9d['push'](_0x3c0d9d['shift']());}};_0x5667ed(++_0x17130e);}(_0x3f18,0x1d0));var _0x83f1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3f18[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x83f1('0x0'));var jayson=require(_0x83f1('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x83f1('0x2')]({'port':0x232a});var routingClient=jayson[_0x83f1('0x3')][_0x83f1('0x2')]({'port':0x232c});function isAgentPaused(_0x129ba9,_0x594cb0){var _0x191150=[_0x129ba9[_0x83f1('0x4')],_0x129ba9[_0x83f1('0x5')],_0x129ba9['mailPause'],_0x129ba9[_0x83f1('0x6')],_0x129ba9[_0x83f1('0x7')],_0x129ba9[_0x83f1('0x8')],_0x129ba9[_0x83f1('0x9')]];if(!_0x594cb0)return _['every'](_0x191150);var _0x3d88b4=_[_0x83f1('0xa')](_0x191150);return _0x3d88b4[_0x83f1('0xb')]>0x0&&_0x3d88b4[_0x83f1('0xb')]<_0x191150[_0x83f1('0xb')]?!![]:![];}function isIdle(_0x1465ba){return _0x1465ba==='idle'||_0x1465ba==='unknown'||_0x1465ba===_0x83f1('0xc')||_0x1465ba===_0x83f1('0xd')||_[_0x83f1('0xe')](_0x1465ba);}function isAgentIdle(_0x1ad515){if(_0x1ad515['voiceStatus']!==_0x83f1('0xf')&&_0x1ad515[_0x83f1('0x8')]){_0x1ad515[_0x83f1('0x10')]='pause';return![];}return _[_0x83f1('0x11')]([_0x1ad515['chatStatus'],_0x1ad515['faxStatus'],_0x1ad515[_0x83f1('0x12')],_0x1ad515[_0x83f1('0x13')],_0x1ad515[_0x83f1('0x14')],_0x1ad515[_0x83f1('0x10')],_0x1ad515[_0x83f1('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x83f1('0x16'),{})['then'](function(_0x2552c1){if(_0x2552c1[_0x83f1('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x13925d=_0x2552c1[_0x83f1('0x18')];return routingClient[_0x83f1('0x19')](_0x83f1('0x16'),{})[_0x83f1('0x1a')](function(_0x56293b){if(_0x56293b[_0x83f1('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x259802=_0x56293b[_0x83f1('0x18')];return _[_0x83f1('0x1b')]({},_0x13925d,_0x259802);});})[_0x83f1('0x1c')](function(_0x132ea1){throw _0x132ea1;});}exports[_0x83f1('0x1d')]=getRealtimeAgents;function getAgentStatus(_0x2e0018){var _0x4f1b31=_0x83f1('0x1e');if(isAgentPaused(_0x2e0018))_0x4f1b31=_0x83f1('0x1f');else if(isAgentPaused(_0x2e0018,!![]))_0x4f1b31=_0x83f1('0x20');else if(isAgentIdle(_0x2e0018))_0x4f1b31=_0x83f1('0xf');else _0x4f1b31=_0x83f1('0x21');return _0x4f1b31;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x5117a3,_0x1a5842){var _0x7ef55f=_[_0x83f1('0x22')](_0x5117a3)?_0x5117a3:[_0x5117a3];var _0x363b7d=_[_0x83f1('0x23')](_0x1a5842)+'Queue';var _0x4788cb=_[_0x83f1('0x24')](_0x7ef55f,function(_0x4f94e8){return db[_0x363b7d][_0x83f1('0x25')]({'where':{'id':_0x4f94e8}})[_0x83f1('0x1a')](function(_0x27655c){if(!_0x27655c)return[];return _0x27655c['getAgents']({'attributes':['id'],'raw':!![]});});});return Promise[_0x83f1('0x26')](_0x4788cb)['then'](function(_0x5b329d){var _0x25d63b=_(_0x5b329d)[_0x83f1('0x27')]()[_0x83f1('0x24')]('id')[_0x83f1('0x28')]()[_0x83f1('0x29')]();return _0x25d63b;});}exports[_0x83f1('0x2a')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0xc58a3f,_0x54fc62,_0x593917){try{if(_0x54fc62[_0x83f1('0xb')]>0x0){_0xc58a3f=_0xc58a3f['filter'](function(_0x3e1191){return _0x54fc62[_0x83f1('0x2b')](_0x3e1191['id']);});}var _0xb5a4a2=_0xc58a3f[_0x83f1('0xa')](function(_0x2f9088){var _0x4374ff=_0x83f1('0x21');if(isAgentIdle(_0x2f9088)){_0x4374ff=_0x83f1('0xf');}return _0x4374ff===_0x593917;});return _[_0x83f1('0x24')](_0xb5a4a2,'id');}catch(_0x2bb46b){throw _0x2bb46b;}}exports[_0x83f1('0x2c')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x1a4d9d,_0x3558f2,_0x1de8f1){return Promise[_0x83f1('0x2d')]()['then'](function(){if(_0x3558f2[_0x83f1('0xb')]>0x0){_0x1a4d9d=_0x1a4d9d[_0x83f1('0xa')](function(_0x3f7800){return _0x3558f2[_0x83f1('0x2b')](_0x3f7800['id']);});}return _0x1a4d9d;})['then'](function(){return db[_0x83f1('0x2e')]['findAll']({'attributes':['id','name',_0x83f1('0x2f'),'chatPause',_0x83f1('0x5'),_0x83f1('0x30'),'openchannelPause','smsPause',_0x83f1('0x8'),_0x83f1('0x9'),_0x83f1('0x31')],'where':{'id':{'$in':_[_0x83f1('0x24')](_0x1a4d9d,'id')}},'raw':!![]});})['then'](function(_0x511b21){return _0x511b21[_0x83f1('0x24')](function(_0x2e3485){var _0x3a12f2=_[_0x83f1('0x32')](_0x1a4d9d,['id',_0x2e3485['id']]);var _0x31459d=filterAgentAttributes(_0x3a12f2);_['merge'](_0x2e3485,_0x31459d);_0x2e3485[_0x83f1('0x33')]=getAgentStatus(_0x2e3485);return _0x2e3485;});})[_0x83f1('0x1a')](function(_0x4e2d37){var _0x2d5d00=sortAgentsByStatus(_0x4e2d37,_0x1de8f1);return _[_0x83f1('0x24')](_0x2d5d00,'id');})[_0x83f1('0x1c')](function(_0x405394){throw _0x405394;});}exports[_0x83f1('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x456927){var _0x5d96ef={'fields':[],'order':null};var _0x3353f2=_0x456927[_0x83f1('0x35')](',');_0x5d96ef[_0x83f1('0x36')]=_[_0x83f1('0xa')](_0x3353f2,function(_0x2ac725){if(!_0x2ac725[_0x83f1('0x2b')](_0x83f1('0x33'))){return!![];}_0x5d96ef[_0x83f1('0x37')]=_[_0x83f1('0x38')](_0x2ac725,'-')?_0x83f1('0x39'):'ASC';return![];});return _0x5d96ef;}exports[_0x83f1('0x3a')]=getUpdatedSortOptions;function validateSortParameter(_0x4a33f8){if(_0x4a33f8['includes']('fullname')&&!_0x4a33f8[_0x83f1('0x2b')](_0x83f1('0x3b'))){var _0x50cc7c=_0x4a33f8[_0x83f1('0x3c')](0x0,_0x4a33f8[_0x83f1('0x3d')](_0x83f1('0x2f')));_0x4a33f8+=','+_0x50cc7c+_0x83f1('0x3b');}return _0x4a33f8;}exports[_0x83f1('0x3e')]=validateSortParameter;function sortAgentsByStatus(_0x3d0001,_0x368201){var _0x99b909=_0x3d0001[_0x83f1('0x3f')](function(_0x2b1fe8,_0x154542){if(_0x2b1fe8[_0x83f1('0x33')]===_0x154542[_0x83f1('0x33')]){if(_0x2b1fe8['globalStatus']===_0x83f1('0x1f')){if(_0x368201===_0x83f1('0x39')){return(_0x2b1fe8[_0x83f1('0x31')]||'')<(_0x154542[_0x83f1('0x31')]||'')||_0x2b1fe8[_0x83f1('0x2f')][_0x83f1('0x40')]()>_0x154542[_0x83f1('0x2f')][_0x83f1('0x40')]()?0x1:-0x1;}else{return(_0x2b1fe8[_0x83f1('0x31')]||'')<(_0x154542[_0x83f1('0x31')]||'')||_0x2b1fe8[_0x83f1('0x2f')]['toLowerCase']()>_0x154542[_0x83f1('0x2f')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x368201===_0x83f1('0x39')){return _0x2b1fe8[_0x83f1('0x2f')][_0x83f1('0x40')]()<_0x154542['fullname'][_0x83f1('0x40')]()?0x1:-0x1;}else{return _0x2b1fe8[_0x83f1('0x2f')][_0x83f1('0x40')]()<_0x154542['fullname'][_0x83f1('0x40')]()?-0x1:0x1;}}}else{if(_0x368201===_0x83f1('0x39')){return _0x2b1fe8[_0x83f1('0x33')]<_0x154542[_0x83f1('0x33')]?0x1:-0x1;}else{return _0x2b1fe8[_0x83f1('0x33')]<_0x154542['globalStatus']?-0x1:0x1;}}});return _0x99b909;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x108b8a){var _0x24fcba=[_0x83f1('0x41'),_0x83f1('0x42'),_0x83f1('0x43'),'lastPauseAt',_0x83f1('0x31'),_0x83f1('0x44'),_0x83f1('0x3b'),_0x83f1('0x45'),_0x83f1('0x4'),'openchannelPause',_0x83f1('0x30'),_0x83f1('0x7'),_0x83f1('0x9'),_0x83f1('0x5'),_0x83f1('0x8'),'chatCapacity',_0x83f1('0x46'),_0x83f1('0x47'),_0x83f1('0x48'),_0x83f1('0x49'),'faxCapacity',_0x83f1('0x4a'),_0x83f1('0x4b'),_0x83f1('0x4c'),_0x83f1('0x4d'),'whatsappCurrentCapacity','faxCurrentCapacity','chatStatus',_0x83f1('0x13'),'mailStatus',_0x83f1('0x14'),_0x83f1('0x15'),_0x83f1('0x4e'),_0x83f1('0x10'),'chatStatusTime','openchannelStatusTime','mailStatusTime',_0x83f1('0x4f'),_0x83f1('0x50'),_0x83f1('0x51'),_0x83f1('0x52'),_0x83f1('0x53'),_0x83f1('0x54'),_0x83f1('0x55'),'phoneBarEnableScreenRecordingByAgent',_0x83f1('0x56'),'routealias'];var _0x297d52=['chatPause','openchannelPause',_0x83f1('0x30'),'smsPause',_0x83f1('0x9'),_0x83f1('0x5'),_0x83f1('0x8'),_0x83f1('0x42')];var _0x5afb8f=_(_0x108b8a)[_0x83f1('0x57')](_0x297d52)[_0x83f1('0x58')](_0x24fcba)[_0x83f1('0x29')]();return _0x5afb8f;}exports['filterAgentAttributes']=filterAgentAttributes;
\ No newline at end of file
index 827bf14..04b7be3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x4cc5c6,_0x406b79){var _0x2ae5e8=function(_0x5442b8){while(--_0x5442b8){_0x4cc5c6['push'](_0x4cc5c6['shift']());}};_0x2ae5e8(++_0x406b79);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());};
\ No newline at end of file
+var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x16a637,_0x5eb627){var _0x25126d=function(_0x54e016){while(--_0x54e016){_0x16a637['push'](_0x16a637['shift']());}};_0x25126d(++_0x5eb627);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());};
\ No newline at end of file
index 5e47b92..a0e7644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf23=['hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','macAddress','ipAddress','createHash','substring','lodash','crypto','child_process','networkInterfaces','keys','length','filter','IPv4','internal','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','md5','update'];(function(_0x31ceea,_0x246692){var _0xa6fd01=function(_0x42cfd1){while(--_0x42cfd1){_0x31ceea['push'](_0x31ceea['shift']());}};_0xa6fd01(++_0x246692);}(_0xaf23,0x142));var _0x3af2=function(_0x105aaa,_0x358e95){_0x105aaa=_0x105aaa-0x0;var _0xe4b1fa=_0xaf23[_0x105aaa];return _0xe4b1fa;};'use strict';var _=require(_0x3af2('0x0'));var os=require('os');var crypto=require(_0x3af2('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x3af2('0x2'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x1086df=[];var _0x44ebb3=os[_0x3af2('0x3')]();var _0xbf88d7=_['orderBy'](_[_0x3af2('0x4')](_0x44ebb3));for(var _0x26d532=0x0;_0x26d532<_0xbf88d7[_0x3af2('0x5')];_0x26d532++){var _0x41fbd4=_0x44ebb3[_0xbf88d7[_0x26d532]][_0x3af2('0x6')](function(_0x2a415e){return _0x2a415e['family']===_0x3af2('0x7')&&_0x2a415e[_0x3af2('0x8')]===![];});_0x1086df=_0x1086df['concat'](_0x41fbd4);}return _0x1086df;}function getFirstInterface(){var _0x1bc17b=_['head'](getInterfaces());return{'macAddress':_0x1bc17b&&_0x1bc17b['mac']?_0x1bc17b[_0x3af2('0x9')]:_0x3af2('0xa'),'ipAddress':_0x1bc17b&&_0x1bc17b['address']?_0x1bc17b[_0x3af2('0xb')]:_0x3af2('0xc')};}exports[_0x3af2('0xd')]=getFirstInterface;function getCPUhash(){var _0x4b5a34=_['orderBy'](os[_0x3af2('0xe')]()['map'](function(_0x54ce64){return _0x54ce64[_0x3af2('0xf')];}))[_0x3af2('0x10')](':');return crypto['createHash'](_0x3af2('0x11'))[_0x3af2('0x12')](_0x4b5a34)['digest'](_0x3af2('0x13'));}exports[_0x3af2('0x14')]=function(){var _0x49147d=os[_0x3af2('0x15')]();var _0x389ca8=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x389ca8[_0x3af2('0x16')](config[_0x3af2('0x17')])){return config[_0x3af2('0x17')];}else if(_0x49147d===_0x3af2('0x18')){return exec(_0x3af2('0x19'),{'encoding':_0x3af2('0x1a')})['replace']('\x0d\x0a','');}else{var _0xaaa05b=getFirstInterface();var _0x28cffa=getCPUhash();var _0x6ac4ec=_0x28cffa+'|'+os['hostname']()+'|'+_0xaaa05b[_0x3af2('0x1b')]+'|'+_0xaaa05b[_0x3af2('0x1c')];var _0x59360c=crypto[_0x3af2('0x1d')](_0x3af2('0x11'))[_0x3af2('0x12')](_0x6ac4ec)['digest'](_0x3af2('0x13'));return _0x59360c[_0x3af2('0x1e')](0x0,0x8)+'-'+_0x59360c[_0x3af2('0x1e')](0x8,0xc)+'-'+_0x59360c['substring'](0xc,0x10)+'-'+_0x59360c['substring'](0x10,0x14)+'-'+_0x59360c[_0x3af2('0x1e')](0x14);}};
\ No newline at end of file
+var _0x143a=['orderBy','keys','length','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','digest','hex','getUuid','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','update','substring','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0x143a,0x1db));var _0xa143=function(_0xf96c59,_0x4a1f47){_0xf96c59=_0xf96c59-0x0;var _0x7cf1c4=_0x143a[_0xf96c59];return _0x7cf1c4;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xa143('0x0'));var machine=require(_0xa143('0x1'));var exec=require(_0xa143('0x2'))[_0xa143('0x3')];var config=require(_0xa143('0x4'));function getInterfaces(){var _0x295d33=[];var _0x19f779=os[_0xa143('0x5')]();var _0x1fbc96=_[_0xa143('0x6')](_[_0xa143('0x7')](_0x19f779));for(var _0x2cbd85=0x0;_0x2cbd85<_0x1fbc96[_0xa143('0x8')];_0x2cbd85++){var _0x1eede9=_0x19f779[_0x1fbc96[_0x2cbd85]][_0xa143('0x9')](function(_0x24eb56){return _0x24eb56[_0xa143('0xa')]===_0xa143('0xb')&&_0x24eb56[_0xa143('0xc')]===![];});_0x295d33=_0x295d33['concat'](_0x1eede9);}return _0x295d33;}function getFirstInterface(){var _0x8d55fb=_[_0xa143('0xd')](getInterfaces());return{'macAddress':_0x8d55fb&&_0x8d55fb['mac']?_0x8d55fb[_0xa143('0xe')]:_0xa143('0xf'),'ipAddress':_0x8d55fb&&_0x8d55fb[_0xa143('0x10')]?_0x8d55fb[_0xa143('0x10')]:_0xa143('0x11')};}exports[_0xa143('0x12')]=getFirstInterface;function getCPUhash(){var _0x268188=_[_0xa143('0x6')](os[_0xa143('0x13')]()[_0xa143('0x14')](function(_0x9d268e){return _0x9d268e[_0xa143('0x15')];}))['join'](':');return crypto[_0xa143('0x16')](_0xa143('0x17'))['update'](_0x268188)[_0xa143('0x18')](_0xa143('0x19'));}exports[_0xa143('0x1a')]=function(){var _0x88075a=os['platform']();var _0x4f6ef3=/[0-9a-f-]{36}/;if(config[_0xa143('0x1b')]&&_0x4f6ef3[_0xa143('0x1c')](config[_0xa143('0x1b')])){return config[_0xa143('0x1b')];}else if(_0x88075a===_0xa143('0x1d')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xa143('0x1e')})[_0xa143('0x1f')]('\x0d\x0a','');}else{var _0x48b730=getFirstInterface();var _0x1ee6fb=getCPUhash();var _0x530c75=_0x1ee6fb+'|'+os[_0xa143('0x20')]()+'|'+_0x48b730[_0xa143('0x21')]+'|'+_0x48b730[_0xa143('0x22')];var _0x5c1d36=crypto[_0xa143('0x16')](_0xa143('0x17'))[_0xa143('0x23')](_0x530c75)['digest'](_0xa143('0x19'));return _0x5c1d36[_0xa143('0x24')](0x0,0x8)+'-'+_0x5c1d36['substring'](0x8,0xc)+'-'+_0x5c1d36['substring'](0xc,0x10)+'-'+_0x5c1d36[_0xa143('0x24')](0x10,0x14)+'-'+_0x5c1d36[_0xa143('0x24')](0x14);}};
\ No newline at end of file
index 2d574d4..7899439 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x898e=['../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','active','info','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','data1','Disabled','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','message','finally','getUuid','findOrCreate','util','moment','request-promise','bluebird','pkginfo','version'];(function(_0x42f7cb,_0x35d8ac){var _0x2b693f=function(_0x5b842e){while(--_0x5b842e){_0x42f7cb['push'](_0x42f7cb['shift']());}};_0x2b693f(++_0x35d8ac);}(_0x898e,0x1c1));var _0xe898=function(_0x1c2192,_0x1aa4d){_0x1c2192=_0x1c2192-0x0;var _0x1d02ea=_0x898e[_0x1c2192];return _0x1d02ea;};'use strict';var util=require(_0xe898('0x0'));var moment=require(_0xe898('0x1'));var rp=require(_0xe898('0x2'));var BPromise=require(_0xe898('0x3'));var pkginfo=require(_0xe898('0x4'))(module,_0xe898('0x5'));var db=require(_0xe898('0x6'))['db'];var encryptor=require(_0xe898('0x7'));var hardware=require(_0xe898('0x8'));var logger=require(_0xe898('0x9'))(_0xe898('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x489ca2){return new BPromise(function(_0x1ce9e3,_0x22c125){var _0x2235f7=util[_0xe898('0xb')](_0xe898('0xc'),HOST,_0x489ca2,module['exports'][_0xe898('0x5')]);if(oldToken){_0x2235f7=util[_0xe898('0xb')](_0xe898('0xd'),HOST,_0x489ca2,module['exports']['version'],oldToken);}var _0x1ce81b={'uri':_0x2235f7,'method':_0xe898('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x1ce81b)[_0xe898('0xf')](function(_0x1ecc50){_0x1ce9e3(_0x1ecc50);})[_0xe898('0x10')](function(_0x2c8fca){_0x22c125(_0x2c8fca);});});}function manageLicense(_0x1731dc,_0x956dd1){var _0x4b9c7c=_0x956dd1['get']({'plain':!![]});if(!isOldTokenSent&&_0x4b9c7c['data1']!==_0x1731dc&&!_0x4b9c7c['data2']){oldToken=_0x4b9c7c['data1'];}httpRequest(_0x1731dc)[_0xe898('0xf')](function(_0x355908){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x355908[_0xe898('0x11')]){isOldTokenSent=![];if(!_0x4b9c7c[_0xe898('0xa')]&&_0x4b9c7c['license']!=_0x355908['license']||_0x4b9c7c['license']&&_0x4b9c7c['data2']){logger[_0xe898('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x4b9c7c[_0xe898('0xa')]&&!_0x4b9c7c[_0xe898('0x13')]&&_0x4b9c7c['license']!=_0x355908['license']){logger[_0xe898('0x12')](_0xe898('0x14'));}if(_0x4b9c7c[_0xe898('0xa')]&&!_0x4b9c7c[_0xe898('0x13')]&&_0x4b9c7c[_0xe898('0xa')]==_0x355908[_0xe898('0xa')]){return _0x956dd1;}return _0x956dd1[_0xe898('0x15')]({'data1':_0x1731dc,'data2':null,'license':_0x355908[_0xe898('0xa')]});}else{if(_0x355908[_0xe898('0xa')]||_0x4b9c7c[_0xe898('0xa')]){if(!_0x4b9c7c[_0xe898('0x13')]){if(_0x4b9c7c[_0xe898('0x16')]==_0x1731dc){GRAY_PERIOD_REASON=_0xe898('0x17');logger[_0xe898('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0xe898('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4b9c7c['data1'],_0x1731dc);}logger[_0xe898('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xe898('0x18')](),moment()[_0xe898('0xb')](_0xe898('0x19')));return _0x956dd1[_0xe898('0x15')]({'data2':encryptor['encryptString'](moment()['format'](_0xe898('0x19')))});}else{if(moment()[_0xe898('0x1a')](encryptor['decryptString'](_0x4b9c7c[_0xe898('0x13')]),_0xe898('0x1b'))>DAYS){logger[_0xe898('0x12')](_0xe898('0x1c'),moment()[_0xe898('0xb')](_0xe898('0x19')));isOldTokenSent=![];return _0x956dd1['update']({'data1':_0x1731dc,'data2':null,'license':null});}}}else{if(_0x4b9c7c['data1']!=_0x1731dc){logger[_0xe898('0x12')](_0xe898('0x1d'),_0x4b9c7c[_0xe898('0x16')],_0x1731dc);return _0x956dd1[_0xe898('0x15')]({'data1':_0x1731dc,'data2':null,'license':null});}}}return _0x956dd1;})[_0xe898('0xf')](function(_0x53fc0b){_0x956dd1=_0x53fc0b;})['catch'](function(_0xdd64fc){logger[_0xe898('0x1e')](_0xdd64fc[_0xe898('0x1f')]);})[_0xe898('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xe898('0x21')](),_0x956dd1);},TIME);});}function defaultLicense(){var _0x513374=hardware[_0xe898('0x21')]();if(_0x513374){return db['License'][_0xe898('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x513374}})['spread'](function(_0x340092,_0x3f3338){logger[_0xe898('0x12')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x513374);manageLicense(_0x513374,_0x340092);})[_0xe898('0x10')](function(_0x2cecf8){logger[_0xe898('0x1e')](_0x2cecf8[_0xe898('0x1f')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x4d95=['license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','version','then','catch','get','data2','data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','update','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','request-promise','../../components/encryptor','./hardware','../logger'];(function(_0x1d6a82,_0x37c315){var _0x5834ac=function(_0x2402ba){while(--_0x2402ba){_0x1d6a82['push'](_0x1d6a82['shift']());}};_0x5834ac(++_0x37c315);}(_0x4d95,0xfd));var _0x54d9=function(_0x11af61,_0x2d2b4d){_0x11af61=_0x11af61-0x0;var _0x3e8e5e=_0x4d95[_0x11af61];return _0x3e8e5e;};'use strict';var util=require(_0x54d9('0x0'));var moment=require(_0x54d9('0x1'));var rp=require(_0x54d9('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require(_0x54d9('0x3'));var hardware=require(_0x54d9('0x4'));var logger=require(_0x54d9('0x5'))(_0x54d9('0x6'));var HOST=_0x54d9('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x15aa9b){return new BPromise(function(_0x37d57c,_0x11e9e4){var _0x3ba668=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x15aa9b,module['exports']['version']);if(oldToken){_0x3ba668=util[_0x54d9('0x8')](_0x54d9('0x9'),HOST,_0x15aa9b,module[_0x54d9('0xa')][_0x54d9('0xb')],oldToken);}var _0x2719f8={'uri':_0x3ba668,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x2719f8)[_0x54d9('0xc')](function(_0x8e7af3){_0x37d57c(_0x8e7af3);})[_0x54d9('0xd')](function(_0x3cc6a2){_0x11e9e4(_0x3cc6a2);});});}function manageLicense(_0x3512ce,_0xa670ad){var _0x3bc66d=_0xa670ad[_0x54d9('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3bc66d['data1']!==_0x3512ce&&!_0x3bc66d[_0x54d9('0xf')]){oldToken=_0x3bc66d[_0x54d9('0x10')];}httpRequest(_0x3512ce)['then'](function(_0xa2ba34){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0xa2ba34[_0x54d9('0x11')]){isOldTokenSent=![];if(!_0x3bc66d[_0x54d9('0x6')]&&_0x3bc66d['license']!=_0xa2ba34[_0x54d9('0x6')]||_0x3bc66d[_0x54d9('0x6')]&&_0x3bc66d[_0x54d9('0xf')]){logger[_0x54d9('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3bc66d[_0x54d9('0x6')]&&!_0x3bc66d[_0x54d9('0xf')]&&_0x3bc66d['license']!=_0xa2ba34[_0x54d9('0x6')]){logger[_0x54d9('0x12')](_0x54d9('0x13'));}if(_0x3bc66d[_0x54d9('0x6')]&&!_0x3bc66d[_0x54d9('0xf')]&&_0x3bc66d['license']==_0xa2ba34[_0x54d9('0x6')]){return _0xa670ad;}return _0xa670ad['update']({'data1':_0x3512ce,'data2':null,'license':_0xa2ba34[_0x54d9('0x6')]});}else{if(_0xa2ba34[_0x54d9('0x6')]||_0x3bc66d['license']){if(!_0x3bc66d['data2']){if(_0x3bc66d[_0x54d9('0x10')]==_0x3512ce){GRAY_PERIOD_REASON=_0x54d9('0x14');logger[_0x54d9('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON='Changed';logger[_0x54d9('0x12')](_0x54d9('0x15'),_0x3bc66d[_0x54d9('0x10')],_0x3512ce);}logger[_0x54d9('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x54d9('0x16')](),moment()[_0x54d9('0x8')]('YYYY-MM-DD\x20HH:mm'));return _0xa670ad[_0x54d9('0x17')]({'data2':encryptor[_0x54d9('0x18')](moment()[_0x54d9('0x8')](_0x54d9('0x19')))});}else{if(moment()[_0x54d9('0x1a')](encryptor[_0x54d9('0x1b')](_0x3bc66d['data2']),_0x54d9('0x1c'))>DAYS){logger['info'](_0x54d9('0x1d'),moment()[_0x54d9('0x8')](_0x54d9('0x19')));isOldTokenSent=![];return _0xa670ad['update']({'data1':_0x3512ce,'data2':null,'license':null});}}}else{if(_0x3bc66d['data1']!=_0x3512ce){logger[_0x54d9('0x12')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3bc66d[_0x54d9('0x10')],_0x3512ce);return _0xa670ad['update']({'data1':_0x3512ce,'data2':null,'license':null});}}}return _0xa670ad;})['then'](function(_0x16182c){_0xa670ad=_0x16182c;})[_0x54d9('0xd')](function(_0x4dd5c0){logger[_0x54d9('0x1e')](_0x4dd5c0[_0x54d9('0x1f')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x54d9('0x20')](),_0xa670ad);},TIME);});}function defaultLicense(){var _0x357e39=hardware[_0x54d9('0x20')]();if(_0x357e39){return db[_0x54d9('0x21')][_0x54d9('0x22')]({'where':{'id':0x1},'defaults':{'data1':_0x357e39}})[_0x54d9('0x23')](function(_0x776e18,_0x1e9524){logger[_0x54d9('0x12')](_0x54d9('0x24'),_0x357e39);manageLicense(_0x357e39,_0x776e18);})[_0x54d9('0xd')](function(_0x306384){logger['error'](_0x306384[_0x54d9('0x1f')]);});}}exports['default']=defaultLicense;
\ No newline at end of file
index 6cbb236..5cca305 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ae0=['sequelize','COUNT','col','admin','user','telephone','users','telephones','forEach','pick','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','License','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','getUuid','deadline','add','days','grayReason','changed','disabled','message','User','role'];(function(_0x2fb561,_0x579dbf){var _0x2b7be3=function(_0x578df4){while(--_0x578df4){_0x2fb561['push'](_0x2fb561['shift']());}};_0x2b7be3(++_0x579dbf);}(_0x0ae0,0xf2));var _0x00ae=function(_0x12af35,_0x2921f2){_0x12af35=_0x12af35-0x0;var _0x3e3665=_0x0ae0[_0x12af35];return _0x3e3665;};'use strict';var util=require('util');var _=require(_0x00ae('0x0'));var moment=require(_0x00ae('0x1'));var BPromise=require(_0x00ae('0x2'));var hardware=require(_0x00ae('0x3'));var encryptor=require(_0x00ae('0x4'));var db=require(_0x00ae('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x00ae('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x00ae('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x00ae('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x337a94){return new BPromise(function(_0x2d996c,_0x399de6){return db[_0x00ae('0x8')]['find'](_[_0x00ae('0x9')](_0x337a94,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x49ba74){return checkLicense(_0x49ba74,null);})[_0x00ae('0xa')](function(_0x53dcc2){_0x2d996c(_0x53dcc2);return;})[_0x00ae('0xb')](function(_0x3d7baf){_0x399de6(_0x3d7baf);});});}function checkLicense(_0x8ab6d8,_0xc9f06){if(!_0x8ab6d8){demoLicense[_0x00ae('0xc')]=_0x8ab6d8[_0x00ae('0xd')];return demoLicense;}try{var _0x4b2d5e=_0xc9f06||_0x8ab6d8[_0x00ae('0xe')];if(_[_0x00ae('0xf')](_0x4b2d5e)){throw new Error(_0x00ae('0x10'));}var _0x1763a1=_0x8ab6d8[_0x00ae('0xd')];var _0x27a672=_0x8ab6d8[_0x00ae('0x11')];var _0x3af2ae=_0x1763a1[_0x00ae('0x12')]('-')[0x4];var _0x26c869=_0x1763a1[_0x00ae('0x12')]('-')[0x0];var _0x293fb8=encryptor[_0x00ae('0x13')](_0x4b2d5e,util[_0x00ae('0x14')](_0x00ae('0x15'),_0x3af2ae,_0x1763a1,_0x26c869));var _0x213295=JSON[_0x00ae('0x16')](_0x293fb8);_0x213295[_0x00ae('0x17')]=![];_0x213295['uuid']=_0x1763a1;_0x213295['machineUuid']=hardware[_0x00ae('0x18')]();if(_0x27a672){var _0x17aa1f=encryptor[_0x00ae('0x13')](_0x27a672);_0x213295['gray']=_0x17aa1f;_0x213295[_0x00ae('0x19')]=moment(_0x17aa1f)[_0x00ae('0x1a')](0x7,_0x00ae('0x1b'))[_0x00ae('0x14')]();_0x213295[_0x00ae('0x1c')]=_0x213295[_0x00ae('0xc')]!=_0x213295['machineUuid']?_0x00ae('0x1d'):_0x00ae('0x1e');}return _0x213295;}catch(_0x2e80ab){breakingLicense[_0x00ae('0xc')]=_0x8ab6d8[_0x00ae('0xd')];breakingLicense[_0x00ae('0x1f')]=_0x2e80ab[_0x00ae('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xc0c967,_0x25d70d){getLicense()[_0x00ae('0xa')](function(_0x53b592){return db[_0x00ae('0x20')]['findAll']({'attributes':[_0x00ae('0x21'),[db[_0x00ae('0x22')]['fn'](_0x00ae('0x23'),db[_0x00ae('0x22')][_0x00ae('0x24')]('role')),'count']],'group':_0x00ae('0x21'),'where':{'role':{'$or':[_0x00ae('0x25'),_0x00ae('0x26'),_0x00ae('0x27')]}},'raw':!![]})[_0x00ae('0xa')](function(_0x4bbf90){var _0x1770f0={'user':_0x53b592[_0x00ae('0x28')]||0x0,'telephone':_0x53b592[_0x00ae('0x29')]||0x0};_0x4bbf90[_0x00ae('0x2a')](function(_0x535b76){var _0x545485=_0x535b76[_0x00ae('0x21')]===_0x00ae('0x25')?_0x00ae('0x26'):_0x535b76['role'];_0x1770f0[_0x545485]-=_0x535b76['count'];if(_0x1770f0[_0x545485]<0x0)_0x1770f0[_0x545485]=0x0;});_0xc0c967(_0x1770f0);return;});})[_0x00ae('0xb')](function(_0x25e5ed){_0x25d70d(_0x25e5ed);});});}function checkUserLimits(_0x37c837){return new BPromise(function(_0x4c7bb8,_0xc15fc6){getLimits()[_0x00ae('0xa')](function(_0x5b3fa3){var _0x4807a1=_[_0x00ae('0x2b')](_['countBy'](_0x37c837,_0x00ae('0x21')),[_0x00ae('0x25'),_0x00ae('0x26'),_0x00ae('0x27')]);var _0xe3a3e8=(_0x4807a1['admin']||0x0)+(_0x4807a1['user']||0x0);var _0x5822bf=_0x4807a1[_0x00ae('0x27')]||0x0;if(_0xe3a3e8>_0x5b3fa3['user'])return _0xc15fc6(_0x00ae('0x2c'));if(_0x5822bf>_0x5b3fa3[_0x00ae('0x27')])return _0xc15fc6('License\x20limit\x20reached\x20for\x20telephones');return _0x4c7bb8();})[_0x00ae('0xb')](function(_0x418b15){_0xc15fc6(_0x418b15);});});}module[_0x00ae('0x2d')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xa8db=['then','license','data1','split','decryptString','format','parse','demo','uuid','gray','deadline','days','grayReason','changed','message','User','findAll','sequelize','COUNT','col','role','admin','telephone','users','telephones','forEach','user','count','catch','pick','License\x20limit\x20reached\x20for\x20users','exports','moment','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xa8db,0x168));var _0xba8d=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xa8db[_0x5b8b97];return _0x1fdf84;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xba8d('0x0'));var BPromise=require(_0xba8d('0x1'));var hardware=require(_0xba8d('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xba8d('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xba8d('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xba8d('0x5'),'machineUuid':hardware[_0xba8d('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xba8d('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xba8d('0x7'),'machineUuid':hardware[_0xba8d('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x302df2){return new BPromise(function(_0x5b23d2,_0x54cc0d){return db[_0xba8d('0x8')]['find'](_['defaults'](_0x302df2,{'raw':!![],'where':{'id':0x1}}))[_0xba8d('0x9')](function(_0x1cb7f8){return checkLicense(_0x1cb7f8,null);})[_0xba8d('0x9')](function(_0x2a67a9){_0x5b23d2(_0x2a67a9);return;})['catch'](function(_0x1b15d5){_0x54cc0d(_0x1b15d5);});});}function checkLicense(_0x55c700,_0x6d4c6a){if(!_0x55c700){demoLicense['uuid']=_0x55c700['data1'];return demoLicense;}try{var _0x16a567=_0x6d4c6a||_0x55c700[_0xba8d('0xa')];if(_['isEmpty'](_0x16a567)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1c4dbc=_0x55c700[_0xba8d('0xb')];var _0x6645bf=_0x55c700['data2'];var _0x111544=_0x1c4dbc[_0xba8d('0xc')]('-')[0x4];var _0x599806=_0x1c4dbc[_0xba8d('0xc')]('-')[0x0];var _0x5e8288=encryptor[_0xba8d('0xd')](_0x16a567,util[_0xba8d('0xe')]('%s:%s:%s',_0x111544,_0x1c4dbc,_0x599806));var _0x3e30b7=JSON[_0xba8d('0xf')](_0x5e8288);_0x3e30b7[_0xba8d('0x10')]=![];_0x3e30b7[_0xba8d('0x11')]=_0x1c4dbc;_0x3e30b7['machineUuid']=hardware[_0xba8d('0x6')]();if(_0x6645bf){var _0x1b064a=encryptor[_0xba8d('0xd')](_0x6645bf);_0x3e30b7[_0xba8d('0x12')]=_0x1b064a;_0x3e30b7[_0xba8d('0x13')]=moment(_0x1b064a)['add'](0x7,_0xba8d('0x14'))[_0xba8d('0xe')]();_0x3e30b7[_0xba8d('0x15')]=_0x3e30b7[_0xba8d('0x11')]!=_0x3e30b7['machineUuid']?_0xba8d('0x16'):'disabled';}return _0x3e30b7;}catch(_0x2d088e){breakingLicense[_0xba8d('0x11')]=_0x55c700[_0xba8d('0xb')];breakingLicense['message']=_0x2d088e[_0xba8d('0x17')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x541890,_0x2be68d){getLicense()[_0xba8d('0x9')](function(_0x211e63){return db[_0xba8d('0x18')][_0xba8d('0x19')]({'attributes':['role',[db[_0xba8d('0x1a')]['fn'](_0xba8d('0x1b'),db[_0xba8d('0x1a')][_0xba8d('0x1c')](_0xba8d('0x1d'))),'count']],'group':_0xba8d('0x1d'),'where':{'role':{'$or':[_0xba8d('0x1e'),'user',_0xba8d('0x1f')]}},'raw':!![]})[_0xba8d('0x9')](function(_0x229372){var _0x4fcdea={'user':_0x211e63[_0xba8d('0x20')]||0x0,'telephone':_0x211e63[_0xba8d('0x21')]||0x0};_0x229372[_0xba8d('0x22')](function(_0x269967){var _0x2f6faf=_0x269967[_0xba8d('0x1d')]===_0xba8d('0x1e')?_0xba8d('0x23'):_0x269967[_0xba8d('0x1d')];_0x4fcdea[_0x2f6faf]-=_0x269967[_0xba8d('0x24')];if(_0x4fcdea[_0x2f6faf]<0x0)_0x4fcdea[_0x2f6faf]=0x0;});_0x541890(_0x4fcdea);return;});})[_0xba8d('0x25')](function(_0x28bfca){_0x2be68d(_0x28bfca);});});}function checkUserLimits(_0x27705a){return new BPromise(function(_0x19049e,_0x29ce68){getLimits()['then'](function(_0x1b2f90){var _0x4b0796=_[_0xba8d('0x26')](_['countBy'](_0x27705a,_0xba8d('0x1d')),['admin',_0xba8d('0x23'),'telephone']);var _0x3f7632=(_0x4b0796[_0xba8d('0x1e')]||0x0)+(_0x4b0796['user']||0x0);var _0x5e0576=_0x4b0796[_0xba8d('0x1f')]||0x0;if(_0x3f7632>_0x1b2f90[_0xba8d('0x23')])return _0x29ce68(_0xba8d('0x27'));if(_0x5e0576>_0x1b2f90[_0xba8d('0x1f')])return _0x29ce68('License\x20limit\x20reached\x20for\x20telephones');return _0x19049e();})[_0xba8d('0x25')](function(_0x52f100){_0x29ce68(_0x52f100);});});}module[_0xba8d('0x28')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index 3b70925..998e72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd4f=['exports','secret'];(function(_0x4762f3,_0x3e4dcb){var _0x5c237e=function(_0x312753){while(--_0x312753){_0x4762f3['push'](_0x4762f3['shift']());}};_0x5c237e(++_0x3e4dcb);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x34b260,_0x300f52){_0x34b260=_0x34b260-0x0;var _0x4ecadf=_0xdd4f[_0x34b260];return _0x4ecadf;};'use strict';module[_0xfdd4('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfdd4('0x1'),'DEBUG':''};
\ No newline at end of file
+var _0xbbbc=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x18bf2f,_0x39604b){var _0x3528db=function(_0x2ebaec){while(--_0x2ebaec){_0x18bf2f['push'](_0x18bf2f['shift']());}};_0x3528db(++_0x39604b);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x5dac60,_0x2a3533){_0x5dac60=_0x5dac60-0x0;var _0x4ffd5c=_0xbbbc[_0x5dac60];return _0x4ffd5c;};'use strict';module[_0xcbbb('0x0')]={'DOMAIN':_0xcbbb('0x1'),'SESSION_SECRET':_0xcbbb('0x2'),'GOOGLE_ID':_0xcbbb('0x3'),'GOOGLE_SECRET':_0xcbbb('0x4'),'DEBUG':''};
\ No newline at end of file
index 165db6c..0a6ad06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3164=['../utils/loggers','exports'];(function(_0x211d4a,_0x9d4244){var _0x208576=function(_0x24a891){while(--_0x24a891){_0x211d4a['push'](_0x211d4a['shift']());}};_0x208576(++_0x9d4244);}(_0x3164,0x144));var _0x4316=function(_0x49516f,_0x13b9b1){_0x49516f=_0x49516f-0x0;var _0x450152=_0x3164[_0x49516f];return _0x450152;};'use strict';var fileLogger=require(_0x4316('0x0'))['fileLogger'];module[_0x4316('0x1')]=fileLogger;
\ No newline at end of file
+var _0x978e=['fileLogger','exports','../utils/loggers'];(function(_0x57b432,_0x1589a0){var _0x2edf2a=function(_0x20edfc){while(--_0x20edfc){_0x57b432['push'](_0x57b432['shift']());}};_0x2edf2a(++_0x1589a0);}(_0x978e,0x12b));var _0xe978=function(_0x4c38af,_0x55a605){_0x4c38af=_0x4c38af-0x0;var _0xf94a80=_0x978e[_0x4c38af];return _0xf94a80;};'use strict';var fileLogger=require(_0xe978('0x0'))[_0xe978('0x1')];module[_0xe978('0x2')]=fileLogger;
\ No newline at end of file
index c2cf863..a15fafd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6da=['../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email'];(function(_0x252040,_0x282b34){var _0x2c9984=function(_0x3299f2){while(--_0x3299f2){_0x252040['push'](_0x252040['shift']());}};_0x2c9984(++_0x282b34);}(_0xf6da,0x131));var _0xaf6d=function(_0x2e745d,_0x18baff){_0x2e745d=_0x2e745d-0x0;var _0x1c47ae=_0xf6da[_0x2e745d];return _0x1c47ae;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xaf6d('0x0'),'script':path[_0xaf6d('0x1')](__dirname,'../../services/express/index.js')},{'name':_0xaf6d('0x2'),'script':path['join'](__dirname,_0xaf6d('0x3'))},{'name':_0xaf6d('0x4'),'script':path[_0xaf6d('0x1')](__dirname,_0xaf6d('0x5'))},{'name':_0xaf6d('0x6'),'script':path[_0xaf6d('0x1')](__dirname,_0xaf6d('0x7'))},{'name':_0xaf6d('0x8'),'script':path['join'](__dirname,_0xaf6d('0x9'))},{'name':_0xaf6d('0xa'),'script':path[_0xaf6d('0x1')](__dirname,_0xaf6d('0xb'))}]};module[_0xaf6d('0xc')]=config;
\ No newline at end of file
+var _0x5f2e=['email','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join','ami','agi','../../services/agi/index.js'];(function(_0x222b02,_0x213020){var _0x33d769=function(_0x4014ff){while(--_0x4014ff){_0x222b02['push'](_0x222b02['shift']());}};_0x33d769(++_0x213020);}(_0x5f2e,0xd2));var _0xe5f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5f2e[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0xe5f2('0x0'));var os=require('os');var config={'apps':[{'name':_0xe5f2('0x1'),'script':path[_0xe5f2('0x2')](__dirname,'../../services/express/index.js')},{'name':_0xe5f2('0x3'),'script':path[_0xe5f2('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0xe5f2('0x4'),'script':path[_0xe5f2('0x2')](__dirname,_0xe5f2('0x5'))},{'name':_0xe5f2('0x6'),'script':path[_0xe5f2('0x2')](__dirname,_0xe5f2('0x7'))},{'name':_0xe5f2('0x8'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0xe5f2('0x9'),'script':path[_0xe5f2('0x2')](__dirname,_0xe5f2('0xa'))}]};module[_0xe5f2('0xb')]=config;
\ No newline at end of file
index 4095525..1091a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76c1=['then','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','disconnect','stop'];(function(_0x404dc4,_0x13cc13){var _0x574739=function(_0x29e484){while(--_0x29e484){_0x404dc4['push'](_0x404dc4['shift']());}};_0x574739(++_0x13cc13);}(_0x76c1,0x1c9));var _0x176c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x76c1[_0x19950b];return _0x3c6b41;};'use strict';var pm2=require(_0x176c('0x0'));var BPromise=require(_0x176c('0x1'));var config=require(_0x176c('0x2'));function connect(){return new BPromise(function(_0x4917e7,_0xcb1a17){return pm2[_0x176c('0x3')](function(_0x277810){if(_0x277810){return _0xcb1a17(_0x277810);}return _0x4917e7(_0x176c('0x4'));});});};exports[_0x176c('0x5')]=function(_0x1efe94){return connect()['then'](function(){return new BPromise(function(_0x5e76a8,_0x1b314a){return pm2[_0x176c('0x5')](_0x1efe94,function(_0x17c617,_0x510e49){if(_0x17c617){return _0x1b314a(_0x17c617);}pm2[_0x176c('0x6')]();return _0x5e76a8(_0x510e49);});});});};exports[_0x176c('0x7')]=function(_0x326f23){return connect()[_0x176c('0x8')](function(){return new BPromise(function(_0x77a450,_0x3d272c){return pm2[_0x176c('0x7')](_0x326f23,function(_0x1789ec,_0x54f7f3){if(_0x1789ec){return _0x3d272c(_0x1789ec);}pm2[_0x176c('0x6')]();return _0x77a450(_0x54f7f3);});});});};exports[_0x176c('0x9')]=function(_0x508575){return connect()[_0x176c('0x8')](function(){return new BPromise(function(_0x414127,_0x27d58b){return pm2[_0x176c('0x9')](_0x508575,function(_0x735e47,_0x19f202){if(_0x735e47){return _0x27d58b(_0x735e47);}pm2[_0x176c('0x6')]();return _0x414127(_0x19f202);});});});};exports[_0x176c('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x41ba16,_0x406abe){return pm2[_0x176c('0xa')](function(_0xe140aa,_0x330f8c){if(_0xe140aa){return _0x406abe(_0xe140aa);}pm2['disconnect']();return _0x41ba16(_0x330f8c);});});});};exports['describe']=function(_0x1360e8){return connect()['then'](function(){return new BPromise(function(_0x5e6743,_0x2a343a){return pm2[_0x176c('0xb')](_0x1360e8,function(_0x128f88,_0x32537d){if(_0x128f88){return _0x2a343a(_0x128f88);}pm2['disconnect']();return _0x5e6743(_0x32537d);});});});};exports[_0x176c('0xc')]=function(_0x3c2f5a){return connect()[_0x176c('0x8')](function(){return new BPromise(function(_0x462ec3,_0x38d15e){return pm2['delete'](_0x3c2f5a,function(_0x3bcd18,_0xda5374){if(_0x3bcd18){return _0x38d15e(_0x3bcd18);}pm2['disconnect']();return _0x462ec3(_0xda5374);});});});};exports[_0x176c('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x23934c,_0x52914f){return pm2['dump'](function(_0x2617bd){if(_0x2617bd){return _0x52914f(_0x2617bd);}return _0x23934c(_0x176c('0xe'));});});});};
\ No newline at end of file
+var _0xf361=['dump','pm2','bluebird','connect','then','start','disconnect','stop','restart','list','describe','delete'];(function(_0x5edd05,_0x8ac1d3){var _0x19b62e=function(_0x2a25d5){while(--_0x2a25d5){_0x5edd05['push'](_0x5edd05['shift']());}};_0x19b62e(++_0x8ac1d3);}(_0xf361,0xc1));var _0x1f36=function(_0x51b510,_0x481f0b){_0x51b510=_0x51b510-0x0;var _0x2c4c56=_0xf361[_0x51b510];return _0x2c4c56;};'use strict';var pm2=require(_0x1f36('0x0'));var BPromise=require(_0x1f36('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x17e5e7,_0x1f31ae){return pm2[_0x1f36('0x2')](function(_0x36faa5){if(_0x36faa5){return _0x1f31ae(_0x36faa5);}return _0x17e5e7('connected');});});};exports['start']=function(_0x2b9d0c){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0x125fcd,_0xa8c8ac){return pm2[_0x1f36('0x4')](_0x2b9d0c,function(_0x4d35f5,_0x5a5db9){if(_0x4d35f5){return _0xa8c8ac(_0x4d35f5);}pm2[_0x1f36('0x5')]();return _0x125fcd(_0x5a5db9);});});});};exports[_0x1f36('0x6')]=function(_0x1f2b0e){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0x57eab9,_0x3372fd){return pm2[_0x1f36('0x6')](_0x1f2b0e,function(_0x389589,_0x39df07){if(_0x389589){return _0x3372fd(_0x389589);}pm2[_0x1f36('0x5')]();return _0x57eab9(_0x39df07);});});});};exports[_0x1f36('0x7')]=function(_0x2775de){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0x3a1ff6,_0x4fce25){return pm2['restart'](_0x2775de,function(_0x408fb2,_0x5d7842){if(_0x408fb2){return _0x4fce25(_0x408fb2);}pm2[_0x1f36('0x5')]();return _0x3a1ff6(_0x5d7842);});});});};exports[_0x1f36('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2b9550,_0x1263e6){return pm2[_0x1f36('0x8')](function(_0x2ae922,_0x5d505c){if(_0x2ae922){return _0x1263e6(_0x2ae922);}pm2[_0x1f36('0x5')]();return _0x2b9550(_0x5d505c);});});});};exports[_0x1f36('0x9')]=function(_0x47b8d2){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0x2f83bc,_0x3eae27){return pm2[_0x1f36('0x9')](_0x47b8d2,function(_0x5ba750,_0x73ca15){if(_0x5ba750){return _0x3eae27(_0x5ba750);}pm2[_0x1f36('0x5')]();return _0x2f83bc(_0x73ca15);});});});};exports[_0x1f36('0xa')]=function(_0x2d94ff){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0x10bc48,_0x32cd07){return pm2['delete'](_0x2d94ff,function(_0x1d9fbb,_0x4d8127){if(_0x1d9fbb){return _0x32cd07(_0x1d9fbb);}pm2[_0x1f36('0x5')]();return _0x10bc48(_0x4d8127);});});});};exports['dump']=function(){return connect()[_0x1f36('0x3')](function(){return new BPromise(function(_0xa8e7b2,_0x49fdf9){return pm2[_0x1f36('0xb')](function(_0x2421ae){if(_0x2421ae){return _0x49fdf9(_0x2421ae);}return _0xa8e7b2('saved');});});});};
\ No newline at end of file
index 1615e77..37318c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fa4=['../../config/environment','../../mysqldb','../logger','schedule','redis','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','start','lodash','moment','ioredis'];(function(_0x5bbb30,_0x55d430){var _0x1e4c75=function(_0x2bd4b4){while(--_0x2bd4b4){_0x5bbb30['push'](_0x5bbb30['shift']());}};_0x1e4c75(++_0x55d430);}(_0x6fa4,0x131));var _0x46fa=function(_0x4c8e8f,_0x3c6e6f){_0x4c8e8f=_0x4c8e8f-0x0;var _0x17877a=_0x6fa4[_0x4c8e8f];return _0x17877a;};'use strict';var _=require(_0x46fa('0x0'));var moment=require(_0x46fa('0x1'));var Redis=require(_0x46fa('0x2'));var util=require('util');var config=require(_0x46fa('0x3'));var db=require(_0x46fa('0x4'))['db'];var logger=require(_0x46fa('0x5'))(_0x46fa('0x6'));config[_0x46fa('0x7')]=_['defaults'](config[_0x46fa('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x46fa('0x7')]));function closeInteractions(){var _0x365ab6=0x0;var _0x37455e=[];return db[_0x46fa('0x8')][_0x46fa('0x9')]({'raw':!![],'attributes':['id',_0x46fa('0xa')],'where':{'id':0x1}})['then'](function(_0x44aa3a){_0x365ab6=_0x44aa3a['chatTimeout'];if(_0x365ab6){return db[_0x46fa('0xb')][_0x46fa('0xc')]({'raw':!![],'attributes':['id',_0x46fa('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x46fa('0xe')](_0x44aa3a[_0x46fa('0xa')],'minutes')}}});}else{return[];}})[_0x46fa('0xf')](function(_0x48ed92){if(_0x48ed92&&_0x48ed92[_0x46fa('0x10')]){_0x37455e=_[_0x46fa('0x11')](_0x48ed92||[],'id');logger[_0x46fa('0x12')](_0x46fa('0x13'),_0x37455e[_0x46fa('0x14')]());return db[_0x46fa('0xb')]['update']({'closeReason':_0x46fa('0x15'),'disposition':_0x46fa('0x16'),'closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x37455e}});}})['then'](function(){if(_0x37455e&&_0x37455e[_0x46fa('0x10')]){logger['info'](_0x46fa('0x17'),_0x37455e['join']());for(var _0x5d07ff=0x0;_0x5d07ff<_0x37455e['length'];_0x5d07ff++){io[_0x46fa('0x18')]('chatInteraction:update',{'id':_0x37455e[_0x5d07ff],'closed':!![]});}}})['catch'](function(_0x8e0262){logger[_0x46fa('0x19')]('[CHAT]\x20Error\x20closing\x20interactions',_0x8e0262?util[_0x46fa('0x1a')](_0x8e0262,{'showHidden':![],'depth':null}):'');});}exports[_0x46fa('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x1727=['../../config/environment','../../mysqldb','../logger','schedule','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','inspect','moment','ioredis','util'];(function(_0x1c972a,_0x370005){var _0x50bf54=function(_0x5bc5e2){while(--_0x5bc5e2){_0x1c972a['push'](_0x1c972a['shift']());}};_0x50bf54(++_0x370005);}(_0x1727,0x102));var _0x7172=function(_0x24a60b,_0x1fdb50){_0x24a60b=_0x24a60b-0x0;var _0x23ac95=_0x1727[_0x24a60b];return _0x23ac95;};'use strict';var _=require('lodash');var moment=require(_0x7172('0x0'));var Redis=require(_0x7172('0x1'));var util=require(_0x7172('0x2'));var config=require(_0x7172('0x3'));var db=require(_0x7172('0x4'))['db'];var logger=require(_0x7172('0x5'))(_0x7172('0x6'));config['redis']=_['defaults'](config['redis'],{'host':_0x7172('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x637fdb=0x0;var _0x3d7ef0=[];return db[_0x7172('0x8')][_0x7172('0x9')]({'raw':!![],'attributes':['id',_0x7172('0xa')],'where':{'id':0x1}})[_0x7172('0xb')](function(_0x422a07){_0x637fdb=_0x422a07['chatTimeout'];if(_0x637fdb){return db[_0x7172('0xc')][_0x7172('0xd')]({'raw':!![],'attributes':['id',_0x7172('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x422a07[_0x7172('0xa')],_0x7172('0xf'))}}});}else{return[];}})[_0x7172('0xb')](function(_0x2ee132){if(_0x2ee132&&_0x2ee132['length']){_0x3d7ef0=_[_0x7172('0x10')](_0x2ee132||[],'id');logger[_0x7172('0x11')](_0x7172('0x12'),_0x3d7ef0[_0x7172('0x13')]());return db[_0x7172('0xc')][_0x7172('0x14')]({'closeReason':'system','disposition':_0x7172('0x15'),'closed':!![],'closedAt':moment()[_0x7172('0x16')](_0x7172('0x17'))},{'where':{'id':_0x3d7ef0}});}})[_0x7172('0xb')](function(){if(_0x3d7ef0&&_0x3d7ef0[_0x7172('0x18')]){logger[_0x7172('0x11')](_0x7172('0x19'),_0x3d7ef0[_0x7172('0x13')]());for(var _0x2345d4=0x0;_0x2345d4<_0x3d7ef0[_0x7172('0x18')];_0x2345d4++){io['emit'](_0x7172('0x1a'),{'id':_0x3d7ef0[_0x2345d4],'closed':!![]});}}})[_0x7172('0x1b')](function(_0x655994){logger['error']('[CHAT]\x20Error\x20closing\x20interactions',_0x655994?util[_0x7172('0x1c')](_0x655994,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index bca58b0..7af0419 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0458=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x4775c6,_0x2d9d4d){var _0x2e8afa=function(_0x2a4e9a){while(--_0x2a4e9a){_0x4775c6['push'](_0x4775c6['shift']());}};_0x2e8afa(++_0x2d9d4d);}(_0x0458,0xf5));var _0x8045=function(_0x3f0fc9,_0x4403e6){_0x3f0fc9=_0x3f0fc9-0x0;var _0x2b7d19=_0x0458[_0x3f0fc9];return _0x2b7d19;};'use strict';function start(){var _0xce2da8=require(_0x8045('0x0'));return _0xce2da8['startAllRefreshIntervals']();}module[_0x8045('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
+var _0x0d39=['exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x38cf85,_0x234c29){var _0x5a4c10=function(_0xcfabf2){while(--_0xcfabf2){_0x38cf85['push'](_0x38cf85['shift']());}};_0x5a4c10(++_0x234c29);}(_0x0d39,0xff));var _0x90d3=function(_0x500c79,_0x208242){_0x500c79=_0x500c79-0x0;var _0x26ad65=_0x0d39[_0x500c79];return _0x26ad65;};'use strict';function start(){var _0x2f7eab=require(_0x90d3('0x0'));return _0x2f7eab['startAllRefreshIntervals']();}module[_0x90d3('0x1')]={'intervals':{},'start':start};
\ No newline at end of file
index e9f4b30..36e3d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27f5=['stop','stop\x20cron','active','isBetween','update','run','start','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','savename','%s.%s','extname','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','error\x20mail','stringify','info','email\x20sent','data','Smtp','isNil','subtractNumber','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','toString','keyBy','difference','intersection','exists','deleteJob','delete\x20cron','length','index','resolve','run\x20job','cron','add\x20cron'];(function(_0x42f49d,_0x136249){var _0x3b8281=function(_0xe38e44){while(--_0xe38e44){_0x42f49d['push'](_0x42f49d['shift']());}};_0x3b8281(++_0x136249);}(_0x27f5,0x1f3));var _0x527f=function(_0x34b5ca,_0x594010){_0x34b5ca=_0x34b5ca-0x0;var _0x2d72c0=_0x27f5[_0x34b5ca];return _0x2d72c0;};'use strict';var fs=require('fs');var util=require(_0x527f('0x0'));var path=require(_0x527f('0x1'));var _=require(_0x527f('0x2'));var moment=require(_0x527f('0x3'));var CronJobManager=require(_0x527f('0x4'));var jayson=require(_0x527f('0x5'));var BPromise=require(_0x527f('0x6'));var logger=require(_0x527f('0x7'))(_0x527f('0x8'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x527f('0x9'));var analyticDefaultReportController=require(_0x527f('0xa'));var client=jayson['client'][_0x527f('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1b8e7a,_0x209807){return function(){logger['info'](_0x527f('0xc'),_0x1b8e7a[_0x527f('0xd')]);var _0x33ab32=!![];var _0x411f4a=_0x1b8e7a[_0x527f('0xe')][_0x527f('0xf')]();var _0x488609={'account':_0x411f4a,'message':{'from':util[_0x527f('0x10')](_0x527f('0x11'),_0x1b8e7a[_0x527f('0xe')][_0x527f('0x12')],_0x1b8e7a[_0x527f('0xe')]['email']||_0x1b8e7a[_0x527f('0xe')]['Smtp'][_0x527f('0x13')]),'to':_0x1b8e7a[_0x527f('0xd')],'cc':_0x1b8e7a['cc'],'bcc':_0x1b8e7a[_0x527f('0x14')],'subject':util[_0x527f('0x10')](_0x527f('0x15'),_0x209807['name'],_0x1b8e7a['subtractNumber'],_0x1b8e7a[_0x527f('0x16')])}};var _0x4213cd=path[_0x527f('0x17')](__dirname,'../../files/reports');var _0x5a6bc6=_0x209807[_0x527f('0x18')];var _0x55c544=util[_0x527f('0x10')](_0x527f('0x19'),path['basename'](_0x209807[_0x527f('0x18')],path[_0x527f('0x1a')](_0x209807[_0x527f('0x18')])),'zip');var _0x151531=path[_0x527f('0x17')](_0x4213cd,_0x5a6bc6);var _0x9a73e8=path[_0x527f('0x17')](_0x4213cd,_0x55c544);if(fs[_0x527f('0x1b')](_0x151531)){_0x209807[_0x527f('0x1c')]=_0x527f('0x1d');_0x488609[_0x527f('0x1e')]['attachments']=[{'filename':_0x5a6bc6,'path':_0x151531}];_0x488609[_0x527f('0x1e')][_0x527f('0x1f')]=util[_0x527f('0x10')](_0x527f('0x20'),JSON['stringify'](_0x209807,null,0x2));}else if(fs['existsSync'](_0x9a73e8)){_0x209807[_0x527f('0x1c')]=_0x527f('0x1d');_0x488609['message'][_0x527f('0x21')]=[{'filename':_0x55c544,'path':_0x9a73e8}];}else{_0x488609[_0x527f('0x1e')][_0x527f('0x1f')]=_0x527f('0x22');if(!_0x1b8e7a[_0x527f('0x23')]){_0x33ab32=![];logger['info']('empty\x20file,\x20email\x20not\x20sent');}}if(_0x33ab32){return client[_0x527f('0x24')]('SendMail',_0x488609)[_0x527f('0x25')](function(_0x1a79ee){if(_0x1a79ee['error']){return logger[_0x527f('0x26')](_0x527f('0x27'),JSON[_0x527f('0x28')](_0x1a79ee));}return logger[_0x527f('0x29')](_0x527f('0x2a'));})['catch'](function(_0x3ccc85){return logger[_0x527f('0x26')]('error\x20mail',JSON['stringify'](_0x3ccc85));});}};}function handleError(){return function(_0x2faab7){return logger[_0x527f('0x26')](JSON['stringify'](_0x2faab7));};}function handleResult(_0x20d992){return function(_0x50ca9e){logger['info'](_0x527f('0x2b'),JSON[_0x527f('0x28')](_0x50ca9e));if(_0x20d992[_0x527f('0xe')]&&_0x20d992['MailAccount'][_0x527f('0x2c')]&&!_[_0x527f('0x2d')](_0x20d992[_0x527f('0xd')])){setTimeout(handleSendEmail(_0x20d992,_0x50ca9e),0x3c*0x3e8);}};}function handleJob(_0x3a32ac){return function(){try{if(_[_0x527f('0x2d')](_0x3a32ac[_0x527f('0x2e')])){return logger[_0x527f('0x29')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x527f('0x2d')](_0x3a32ac[_0x527f('0x16')])){return logger[_0x527f('0x29')]('subtractUnit\x20null\x20or\x20undefined');}var _0x14af3c={'startDate':moment()[_0x527f('0x2f')](_0x3a32ac['subtractNumber'],_0x3a32ac['subtractUnit'])[_0x527f('0x10')](_0x527f('0x30')),'endDate':moment()[_0x527f('0x10')](_0x527f('0x30')),'type':_0x527f('0x31'),'output':_0x3a32ac[_0x527f('0x32')],'name':_0x3a32ac[_0x527f('0x12')]};if(!_[_0x527f('0x2d')](_0x3a32ac[_0x527f('0x33')])){logger[_0x527f('0x29')](_0x527f('0x34'),_0x3a32ac['DefaultReportId']);return analyticDefaultReportController[_0x527f('0x35')]({'id':_0x3a32ac[_0x527f('0x33')]},_0x14af3c)[_0x527f('0x25')](handleResult(_0x3a32ac))[_0x527f('0x36')](handleError());}if(!_['isNil'](_0x3a32ac[_0x527f('0x37')])){logger[_0x527f('0x29')](_0x527f('0x38'),_0x3a32ac['CustomReportId']);return analyticCustomReportController[_0x527f('0x35')]({'id':_0x3a32ac[_0x527f('0x37')]},_0x14af3c)['then'](handleResult(_0x3a32ac))['catch'](handleError());}}catch(_0x15ea8a){logger[_0x527f('0x26')](JSON['stringify'](_0x15ea8a));}return logger[_0x527f('0x29')](_0x527f('0x39'));};}function getJobs(_0x3a7587){var _0x1f9183={};if(_0x3a7587){_0x1f9183['id']=_0x3a7587;}return db[_0x527f('0x3a')]['findAll']({'where':_0x1f9183,'include':[{'model':db[_0x527f('0xe')],'attributes':['id',_0x527f('0x12'),_0x527f('0xd')],'include':[{'model':db[_0x527f('0x3b')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':'CloudProvider'}]}]}]})[_0x527f('0x25')](function(_0xa3b5b9){var _0x5d8a77=_[_0x527f('0x3c')](manager[_0x527f('0x3d')]);var _0xd318de=_['map'](_0xa3b5b9,function(_0xfbc6aa){return _0xfbc6aa['id'][_0x527f('0x3e')]();});var _0x3b1461=_[_0x527f('0x3f')](_0xa3b5b9,function(_0x2ed983){return _0x2ed983['id'][_0x527f('0x3e')]();});var _0x2e2734=_0x3a7587?_0xd318de:_[_0x527f('0x40')](_0xd318de,_0x5d8a77);var _0x1c7682=_[_0x527f('0x41')](_0xd318de,_0x5d8a77);var _0x211a81=_['difference'](_0x5d8a77,_0xd318de);var _0x17227a;var _0x15be96;for(_0x17227a=0x0;_0x17227a<_0x211a81['length']&&!_0x3a7587;_0x17227a+=0x1){_0x15be96=_0x211a81[_0x17227a][_0x527f('0x3e')]();if(manager[_0x527f('0x42')](_0x15be96)){manager['stop'](_0x15be96);manager[_0x527f('0x43')](_0x15be96);logger['info'](_0x527f('0x44'),_0x15be96);}}logger[_0x527f('0x29')]('toRun',JSON['stringify'](_0x2e2734));for(_0x17227a=0x0;_0x17227a<_0x2e2734[_0x527f('0x45')];_0x17227a+=0x1){_0x15be96=_0x2e2734[_0x17227a][_0x527f('0x3e')]();logger['info'](_0x527f('0x46'),_0x15be96);if(_0x3a7587){logger['info']('my\x20id',_0x3a7587);logger[_0x527f('0x29')](JSON[_0x527f('0x28')](_0x3b1461[_0x15be96]));BPromise[_0x527f('0x47')]()[_0x527f('0x25')](handleJob(_0x3b1461[_0x15be96]));logger['info'](_0x527f('0x48'),_0x3b1461[_0x15be96][_0x527f('0x12')],_0x3b1461[_0x15be96][_0x527f('0x49')]);}else if(_0x3b1461[_0x15be96][_0x527f('0x49')]&&_0x3b1461[_0x15be96]['active']&&moment()['isBetween'](_0x3b1461[_0x15be96]['startAt'],_0x3b1461[_0x15be96]['endAt'])){manager['add'](_0x15be96,_0x3b1461[_0x15be96][_0x527f('0x49')],handleJob(_0x3b1461[_0x15be96]));manager['start'](_0x15be96);logger[_0x527f('0x29')](_0x527f('0x4a'),_0x3b1461[_0x15be96][_0x527f('0x12')],_0x3b1461[_0x15be96][_0x527f('0x49')]);}else if(manager[_0x527f('0x42')](_0x15be96)){manager[_0x527f('0x4b')](_0x15be96);manager[_0x527f('0x43')](_0x15be96);logger[_0x527f('0x29')](_0x527f('0x4c'),_0x3b1461[_0x15be96][_0x527f('0x12')],_0x3b1461[_0x15be96][_0x527f('0x49')]);}}for(_0x17227a=0x0,_0x15be96;_0x17227a<_0x1c7682['length']&&!_0x3a7587;_0x17227a+=0x1){_0x15be96=_0x1c7682[_0x17227a][_0x527f('0x3e')]();if(manager[_0x527f('0x42')](_0x15be96)){if(_0x3b1461[_0x15be96]['cron']&&_0x3b1461[_0x15be96][_0x527f('0x4d')]&&moment()[_0x527f('0x4e')](_0x3b1461[_0x15be96]['startAt'],_0x3b1461[_0x15be96]['endAt'])){manager[_0x527f('0x4f')](_0x15be96,_0x3b1461[_0x15be96]['cron'],handleJob(_0x3b1461[_0x15be96]));logger['info']('update\x20cron',_0x3b1461[_0x15be96]['name'],_0x3b1461[_0x15be96][_0x527f('0x49')]);}else{manager['stop'](_0x15be96);manager[_0x527f('0x43')](_0x15be96);logger[_0x527f('0x29')]('stop\x20cron',_0x3b1461[_0x15be96][_0x527f('0x12')],_0x3b1461[_0x15be96][_0x527f('0x49')]);}}}})[_0x527f('0x36')](function(_0x4728fa){logger[_0x527f('0x26')](JSON[_0x527f('0x28')](_0x4728fa));});}exports[_0x527f('0x50')]=function(_0x4cf277){return getJobs(_0x4cf277);};exports[_0x527f('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x44d7=['stop\x20cron','startAt','update','run','start','util','path','lodash','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','format','\x22%s\x22\x20<%s>','name','email','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','extname','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','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','CloudProvider','map','toString','keyBy','difference','intersection','length','exists','deleteJob','toRun','index','my\x20id','resolve','cron','active','isBetween','endAt','add','add\x20cron','stop'];(function(_0x57deb6,_0x478ded){var _0x32b7f7=function(_0x33b996){while(--_0x33b996){_0x57deb6['push'](_0x57deb6['shift']());}};_0x32b7f7(++_0x478ded);}(_0x44d7,0x151));var _0x744d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x44d7[_0x33032e];return _0x13316b;};'use strict';var fs=require('fs');var util=require(_0x744d('0x0'));var path=require(_0x744d('0x1'));var _=require(_0x744d('0x2'));var moment=require('moment');var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x744d('0x3'));var logger=require(_0x744d('0x4'))(_0x744d('0x5'));var db=require(_0x744d('0x6'))['db'];var analyticCustomReportController=require(_0x744d('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x744d('0x8')][_0x744d('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x50ef56,_0x369f7c){return function(){logger[_0x744d('0xa')](_0x744d('0xb'),_0x50ef56['email']);var _0x30a1d6=!![];var _0x488ab6=_0x50ef56[_0x744d('0xc')]['getSmtpOptions']();var _0x39c0b6={'account':_0x488ab6,'message':{'from':util[_0x744d('0xd')](_0x744d('0xe'),_0x50ef56['MailAccount'][_0x744d('0xf')],_0x50ef56[_0x744d('0xc')][_0x744d('0x10')]||_0x50ef56[_0x744d('0xc')][_0x744d('0x11')]['user']),'to':_0x50ef56[_0x744d('0x10')],'cc':_0x50ef56['cc'],'bcc':_0x50ef56[_0x744d('0x12')],'subject':util['format'](_0x744d('0x13'),_0x369f7c['name'],_0x50ef56['subtractNumber'],_0x50ef56[_0x744d('0x14')])}};var _0x5713a8=path[_0x744d('0x15')](__dirname,_0x744d('0x16'));var _0x2ca4f9=_0x369f7c[_0x744d('0x17')];var _0x50a098=util['format'](_0x744d('0x18'),path['basename'](_0x369f7c[_0x744d('0x17')],path[_0x744d('0x19')](_0x369f7c[_0x744d('0x17')])),'zip');var _0x17d1f1=path[_0x744d('0x15')](_0x5713a8,_0x2ca4f9);var _0x45b4e2=path['join'](_0x5713a8,_0x50a098);if(fs['existsSync'](_0x17d1f1)){_0x369f7c[_0x744d('0x1a')]=_0x744d('0x1b');_0x39c0b6[_0x744d('0x1c')][_0x744d('0x1d')]=[{'filename':_0x2ca4f9,'path':_0x17d1f1}];_0x39c0b6[_0x744d('0x1c')][_0x744d('0x1e')]=util[_0x744d('0xd')](_0x744d('0x1f'),JSON[_0x744d('0x20')](_0x369f7c,null,0x2));}else if(fs[_0x744d('0x21')](_0x45b4e2)){_0x369f7c[_0x744d('0x1a')]=_0x744d('0x1b');_0x39c0b6[_0x744d('0x1c')][_0x744d('0x1d')]=[{'filename':_0x50a098,'path':_0x45b4e2}];}else{_0x39c0b6[_0x744d('0x1c')][_0x744d('0x1e')]=_0x744d('0x22');if(!_0x50ef56[_0x744d('0x23')]){_0x30a1d6=![];logger[_0x744d('0xa')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x30a1d6){return client[_0x744d('0x24')](_0x744d('0x25'),_0x39c0b6)[_0x744d('0x26')](function(_0x29da14){if(_0x29da14[_0x744d('0x27')]){return logger[_0x744d('0x27')](_0x744d('0x28'),JSON[_0x744d('0x20')](_0x29da14));}return logger[_0x744d('0xa')](_0x744d('0x29'));})[_0x744d('0x2a')](function(_0x12f6d8){return logger[_0x744d('0x27')](_0x744d('0x28'),JSON[_0x744d('0x20')](_0x12f6d8));});}};}function handleError(){return function(_0x5cc33c){return logger[_0x744d('0x27')](JSON[_0x744d('0x20')](_0x5cc33c));};}function handleResult(_0x2eca3c){return function(_0x27871a){logger[_0x744d('0xa')](_0x744d('0x2b'),JSON[_0x744d('0x20')](_0x27871a));if(_0x2eca3c[_0x744d('0xc')]&&_0x2eca3c['MailAccount'][_0x744d('0x11')]&&!_[_0x744d('0x2c')](_0x2eca3c[_0x744d('0x10')])){setTimeout(handleSendEmail(_0x2eca3c,_0x27871a),0x3c*0x3e8);}};}function handleJob(_0x55a8d4){return function(){try{if(_[_0x744d('0x2c')](_0x55a8d4[_0x744d('0x2d')])){return logger['info'](_0x744d('0x2e'));}if(_['isNil'](_0x55a8d4[_0x744d('0x14')])){return logger[_0x744d('0xa')](_0x744d('0x2f'));}var _0x4ff64c={'startDate':moment()[_0x744d('0x30')](_0x55a8d4[_0x744d('0x2d')],_0x55a8d4[_0x744d('0x14')])[_0x744d('0xd')](_0x744d('0x31')),'endDate':moment()[_0x744d('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x744d('0x32'),'output':_0x55a8d4[_0x744d('0x33')],'name':_0x55a8d4[_0x744d('0xf')]};if(!_[_0x744d('0x2c')](_0x55a8d4[_0x744d('0x34')])){logger[_0x744d('0xa')]('exec\x20defaul\x20report\x20id:%s',_0x55a8d4[_0x744d('0x34')]);return analyticDefaultReportController[_0x744d('0x35')]({'id':_0x55a8d4['DefaultReportId']},_0x4ff64c)[_0x744d('0x26')](handleResult(_0x55a8d4))[_0x744d('0x2a')](handleError());}if(!_[_0x744d('0x2c')](_0x55a8d4['CustomReportId'])){logger[_0x744d('0xa')]('exec\x20custom\x20report\x20id:%s',_0x55a8d4[_0x744d('0x36')]);return analyticCustomReportController[_0x744d('0x35')]({'id':_0x55a8d4[_0x744d('0x36')]},_0x4ff64c)[_0x744d('0x26')](handleResult(_0x55a8d4))[_0x744d('0x2a')](handleError());}}catch(_0x3ca143){logger[_0x744d('0x27')](JSON['stringify'](_0x3ca143));}return logger[_0x744d('0xa')](_0x744d('0x37'));};}function getJobs(_0x22d8f4){var _0xa73a9e={};if(_0x22d8f4){_0xa73a9e['id']=_0x22d8f4;}return db[_0x744d('0x38')][_0x744d('0x39')]({'where':_0xa73a9e,'include':[{'model':db[_0x744d('0xc')],'attributes':['id',_0x744d('0xf'),_0x744d('0x10')],'include':[{'model':db['MailServerOut'],'as':_0x744d('0x11'),'include':[{'model':db[_0x744d('0x3a')],'as':_0x744d('0x3a')}]}]}]})[_0x744d('0x26')](function(_0x53ea1a){var _0x1f1807=_['keys'](manager['jobs']);var _0x1635ec=_[_0x744d('0x3b')](_0x53ea1a,function(_0x486ea0){return _0x486ea0['id'][_0x744d('0x3c')]();});var _0x3110a6=_[_0x744d('0x3d')](_0x53ea1a,function(_0x49a562){return _0x49a562['id'][_0x744d('0x3c')]();});var _0x5e17d8=_0x22d8f4?_0x1635ec:_[_0x744d('0x3e')](_0x1635ec,_0x1f1807);var _0x436ced=_[_0x744d('0x3f')](_0x1635ec,_0x1f1807);var _0x8b7113=_[_0x744d('0x3e')](_0x1f1807,_0x1635ec);var _0x16629;var _0x21c8f6;for(_0x16629=0x0;_0x16629<_0x8b7113[_0x744d('0x40')]&&!_0x22d8f4;_0x16629+=0x1){_0x21c8f6=_0x8b7113[_0x16629][_0x744d('0x3c')]();if(manager[_0x744d('0x41')](_0x21c8f6)){manager['stop'](_0x21c8f6);manager[_0x744d('0x42')](_0x21c8f6);logger[_0x744d('0xa')]('delete\x20cron',_0x21c8f6);}}logger['info'](_0x744d('0x43'),JSON[_0x744d('0x20')](_0x5e17d8));for(_0x16629=0x0;_0x16629<_0x5e17d8['length'];_0x16629+=0x1){_0x21c8f6=_0x5e17d8[_0x16629]['toString']();logger[_0x744d('0xa')](_0x744d('0x44'),_0x21c8f6);if(_0x22d8f4){logger[_0x744d('0xa')](_0x744d('0x45'),_0x22d8f4);logger[_0x744d('0xa')](JSON['stringify'](_0x3110a6[_0x21c8f6]));BPromise[_0x744d('0x46')]()[_0x744d('0x26')](handleJob(_0x3110a6[_0x21c8f6]));logger[_0x744d('0xa')]('run\x20job',_0x3110a6[_0x21c8f6]['name'],_0x3110a6[_0x21c8f6][_0x744d('0x47')]);}else if(_0x3110a6[_0x21c8f6]['cron']&&_0x3110a6[_0x21c8f6][_0x744d('0x48')]&&moment()[_0x744d('0x49')](_0x3110a6[_0x21c8f6]['startAt'],_0x3110a6[_0x21c8f6][_0x744d('0x4a')])){manager[_0x744d('0x4b')](_0x21c8f6,_0x3110a6[_0x21c8f6][_0x744d('0x47')],handleJob(_0x3110a6[_0x21c8f6]));manager['start'](_0x21c8f6);logger[_0x744d('0xa')](_0x744d('0x4c'),_0x3110a6[_0x21c8f6][_0x744d('0xf')],_0x3110a6[_0x21c8f6][_0x744d('0x47')]);}else if(manager['exists'](_0x21c8f6)){manager[_0x744d('0x4d')](_0x21c8f6);manager['deleteJob'](_0x21c8f6);logger[_0x744d('0xa')](_0x744d('0x4e'),_0x3110a6[_0x21c8f6]['name'],_0x3110a6[_0x21c8f6][_0x744d('0x47')]);}}for(_0x16629=0x0,_0x21c8f6;_0x16629<_0x436ced[_0x744d('0x40')]&&!_0x22d8f4;_0x16629+=0x1){_0x21c8f6=_0x436ced[_0x16629][_0x744d('0x3c')]();if(manager[_0x744d('0x41')](_0x21c8f6)){if(_0x3110a6[_0x21c8f6]['cron']&&_0x3110a6[_0x21c8f6][_0x744d('0x48')]&&moment()[_0x744d('0x49')](_0x3110a6[_0x21c8f6][_0x744d('0x4f')],_0x3110a6[_0x21c8f6][_0x744d('0x4a')])){manager[_0x744d('0x50')](_0x21c8f6,_0x3110a6[_0x21c8f6][_0x744d('0x47')],handleJob(_0x3110a6[_0x21c8f6]));logger[_0x744d('0xa')]('update\x20cron',_0x3110a6[_0x21c8f6]['name'],_0x3110a6[_0x21c8f6][_0x744d('0x47')]);}else{manager['stop'](_0x21c8f6);manager['deleteJob'](_0x21c8f6);logger[_0x744d('0xa')](_0x744d('0x4e'),_0x3110a6[_0x21c8f6][_0x744d('0xf')],_0x3110a6[_0x21c8f6][_0x744d('0x47')]);}}}})[_0x744d('0x2a')](function(_0x537907){logger[_0x744d('0x27')](JSON[_0x744d('0x20')](_0x537907));});}exports[_0x744d('0x51')]=function(_0x417b76){return getJobs(_0x417b76);};exports[_0x744d('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 8465c70..d702296 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0472=['transcribeRegion','transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','results','transcripts','length','update','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','transcribeAccountId','forEach','push','all','start','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','getTranscriptionJob','Comprehend','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data1','data2'];(function(_0x285627,_0x19081e){var _0x557233=function(_0x321506){while(--_0x321506){_0x285627['push'](_0x285627['shift']());}};_0x557233(++_0x19081e);}(_0x0472,0x197));var _0x2047=function(_0x3e0de5,_0x1f5a41){_0x3e0de5=_0x3e0de5-0x0;var _0x4378c2=_0x0472[_0x3e0de5];return _0x4378c2;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0x2047('0x0'));var util=require('util');var BPromise=require(_0x2047('0x1'));var db=require(_0x2047('0x2'))['db'];var logger=require(_0x2047('0x3'))(_0x2047('0x4'));function getTranscriptionJob(_0x4e0ce1,_0x1c05af,_0x5814a9,_0x27b09d){return new Promise(function(_0x1a6fc2,_0x140727){var _0x14bf92=new AWS['TranscribeService']({'accessKeyId':_0x1c05af,'secretAccessKey':_0x4e0ce1,'region':_0x5814a9});_0x14bf92[_0x2047('0x5')]({'TranscriptionJobName':_0x27b09d},function(_0x29f752,_0x236708){if(_0x29f752){return _0x140727(_0x29f752);}else{return _0x1a6fc2(_0x236708);}});});}function sentiment(_0x3af258,_0xa1c75d,_0xfaf294,_0x223c89,_0x3f3bb1){return new Promise(function(_0x25c437,_0x5e6bf2){var _0x17f863=new AWS[(_0x2047('0x6'))]({'accessKeyId':_0xa1c75d,'secretAccessKey':_0x3af258,'region':_0xfaf294});_0x17f863['detectSentiment']({'Text':_0x223c89,'LanguageCode':_0x3f3bb1[_0x2047('0x7')](0x0,0x2)},function(_0x3b11a8,_0x40ceda){if(_0x3b11a8){return _0x5e6bf2(_0x3b11a8);}else{return _0x25c437(_0x40ceda);}});});}function checkTranscribeJob(_0x346fb2,_0x1c4ac0,_0xfddff9){var _0x842ea7;return new BPromise(function(_0x4180f7,_0xe066fd){logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0xa'),_0x346fb2['id'],_0x346fb2['transcribeName']));return getTranscriptionJob(_0xfddff9[_0x2047('0xb')],_0xfddff9[_0x2047('0xc')],_0x1c4ac0[_0x2047('0xd')],_0x346fb2[_0x2047('0xe')])[_0x2047('0xf')](function(_0x5bfe06){logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0x10'),_0x346fb2['id'],_0x346fb2[_0x2047('0xe')],_0x5bfe06[_0x2047('0x11')][_0x2047('0x12')]));if(!_0x346fb2[_0x2047('0x13')]){switch(_0x5bfe06['TranscriptionJob']['TranscriptionJobStatus']){case _0x2047('0x14'):var _0x115741={'transcribeStatus':_0x5bfe06[_0x2047('0x11')]['TranscriptionJobStatus'],'fileUri':_0x5bfe06[_0x2047('0x11')][_0x2047('0x15')]['TranscriptFileUri']};logger['info'](util[_0x2047('0x9')](_0x2047('0x16'),_0x346fb2['id']));return rp({'uri':_0x5bfe06['TranscriptionJob'][_0x2047('0x15')][_0x2047('0x17')],'json':!![]})[_0x2047('0xf')](function(_0x4f2fc9){logger['info'](util[_0x2047('0x9')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x346fb2['id']));if(_0x4f2fc9&&_0x4f2fc9['results']&&_0x4f2fc9[_0x2047('0x18')][_0x2047('0x19')]&&_0x4f2fc9[_0x2047('0x18')][_0x2047('0x19')][_0x2047('0x1a')]){_0x115741['fileText']='';for(var _0xa3b9a9=0x0;_0xa3b9a9<_0x4f2fc9[_0x2047('0x18')][_0x2047('0x19')][_0x2047('0x1a')];_0xa3b9a9++){_0x115741[_0x2047('0x13')]+=_0x4f2fc9[_0x2047('0x18')][_0x2047('0x19')][_0xa3b9a9]['transcript']+'';}}return _0x346fb2[_0x2047('0x1b')](_0x115741);})[_0x2047('0xf')](function(){logger[_0x2047('0x8')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x346fb2['id']));if(!_0x346fb2['tempSentiment']){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x1e'));}if(!_0x1c4ac0[_0x2047('0x1f')]||!_0x1c4ac0['sentimentAccountId']||!_0x1c4ac0[_0x2047('0x20')]||!_0x1c4ac0[_0x2047('0x21')]||!_0x1c4ac0[_0x2047('0x22')]){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x23'));}if(!_0x115741[_0x2047('0x13')]){throw new Error(_0x2047('0x24'));}if(_0x1c4ac0[_0x2047('0x25')]===_0xfddff9['id']){return _0xfddff9;}else{return db['CloudProvider'][_0x2047('0x26')]({'where':{'id':_settings[_0x2047('0x25')]}});}})[_0x2047('0xf')](function(_0x195298){if(!_0x195298){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x27'));}if(!_0x195298[_0x2047('0xb')]||!_0x195298[_0x2047('0xc')]){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x28'));}_0x842ea7=_0x195298;logger[_0x2047('0x8')](util[_0x2047('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x346fb2['id']));return sentiment(_0x842ea7[_0x2047('0xb')],_0x842ea7[_0x2047('0xc')],_0x1c4ac0[_0x2047('0x20')],_0x115741[_0x2047('0x13')],_0x1c4ac0[_0x2047('0x21')]);})[_0x2047('0xf')](function(_0x387869){logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0x29'),_0x346fb2['id']));return _0x346fb2[_0x2047('0x1b')]({'sentiment':_0x387869[_0x2047('0x2a')],'sPositive':_0x387869[_0x2047('0x2b')][_0x2047('0x2c')],'sNegative':_0x387869['SentimentScore']['Negative'],'sMixed':_0x387869[_0x2047('0x2b')][_0x2047('0x2d')],'sNeutral':_0x387869[_0x2047('0x2b')][_0x2047('0x2e')]});})[_0x2047('0xf')](function(){logger['info'](util['format'](_0x2047('0x2f'),_0x346fb2['id']));_0x4180f7();});case _0x2047('0x30'):return _0x346fb2['update']({'transcribeStatus':'FAILED','failureReason':_0x5bfe06[_0x2047('0x11')][_0x2047('0x31')]})['then'](function(){logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0x2f'),_0x346fb2['id']));_0x4180f7();});default:logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0x32'),_0x346fb2['id']));break;}}else{return BPromise[_0x2047('0x33')]()[_0x2047('0xf')](function(){if(!_0x346fb2['tempSentiment']){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x1e'));}if(!_0x1c4ac0['sentiment']||!_0x1c4ac0['sentimentAccountId']||!_0x1c4ac0[_0x2047('0x20')]||!_0x1c4ac0['language']||!_0x1c4ac0[_0x2047('0x22')]){throw new db['Sequelize'][(_0x2047('0x1d'))](_0x2047('0x23'));}if(!_0x346fb2[_0x2047('0x13')]){throw new Error(_0x2047('0x24'));}if(_0x1c4ac0[_0x2047('0x25')]===_0xfddff9['id']){return _0xfddff9;}else{return db[_0x2047('0x34')][_0x2047('0x26')]({'where':{'id':_settings[_0x2047('0x25')]}});}})[_0x2047('0xf')](function(_0x580f66){if(!_0x580f66){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x27'));}if(!_0x580f66['data1']||!_0x580f66[_0x2047('0xc')]){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))](_0x2047('0x28'));}_0x842ea7=_0x580f66;logger[_0x2047('0x8')](util[_0x2047('0x9')](_0x2047('0x35'),_0x346fb2['id']));return sentiment(_0x842ea7['data1'],_0x842ea7[_0x2047('0xc')],_0x1c4ac0[_0x2047('0x20')],_0x346fb2[_0x2047('0x13')],_0x1c4ac0[_0x2047('0x21')]);})[_0x2047('0xf')](function(_0x1fa5d7){logger[_0x2047('0x8')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x346fb2['id']));return _0x346fb2['update']({'sentiment':_0x1fa5d7[_0x2047('0x2a')],'sPositive':_0x1fa5d7[_0x2047('0x2b')][_0x2047('0x2c')],'sNegative':_0x1fa5d7[_0x2047('0x2b')][_0x2047('0x36')],'sMixed':_0x1fa5d7[_0x2047('0x2b')][_0x2047('0x2d')],'sNeutral':_0x1fa5d7[_0x2047('0x2b')][_0x2047('0x2e')],'transcribeStatus':_0x2047('0x14')});})['then'](function(){logger[_0x2047('0x8')](util[_0x2047('0x9')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x346fb2['id']));_0x4180f7();});}})[_0x2047('0x37')](function(_0x3560a0){if(_0x3560a0){if(!_0x3560a0[_0x2047('0x38')]||_0x3560a0['name']!==_0x2047('0x39')){logger[_0x2047('0x3a')](util[_0x2047('0x9')](_0x2047('0x3b'),_0x346fb2['id']),util[_0x2047('0x3c')](_0x3560a0,{'showHidden':![],'depth':null}));}}_0x4180f7();});});}function checkTranscribe(){var _0xbcbbf;var _0x379a93;var _0x278b2a;return db[_0x2047('0x3d')][_0x2047('0x3e')]({'where':{'transcribeStatus':_0x2047('0x3f')}})[_0x2047('0xf')](function(_0x178a91){if(!_0x178a91||!_0x178a91[_0x2047('0x1a')]){throw new db[(_0x2047('0x1c'))]['ValidationError'](_0x2047('0x40'));}_0xbcbbf=_0x178a91;return db['Setting'][_0x2047('0x26')]({'where':{'id':0x1}});})[_0x2047('0xf')](function(_0x7f5853){if(!_0x7f5853){throw new db[(_0x2047('0x1c'))][(_0x2047('0x1d'))]('Settings\x20not\x20available');}_0x379a93=_0x7f5853;if(!_0x379a93[_0x2047('0x4')]||!_0x379a93[_0x2047('0x41')]||!_0x379a93[_0x2047('0xd')]||!_0x379a93['language']||!_0x379a93[_0x2047('0x22')]){throw new db[(_0x2047('0x1c'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x2047('0x34')]['findOne']({'where':{'id':_0x379a93['transcribeAccountId']}});})[_0x2047('0xf')](function(_0x40f428){if(!_0x40f428){throw new db['Sequelize'][(_0x2047('0x1d'))](_0x2047('0x27'));}if(!_0x40f428['data1']||!_0x40f428['data2']){throw new db['Sequelize']['ValidationError'](_0x2047('0x28'));}_0x278b2a=_0x40f428;var _0x22b043=[];_0xbcbbf[_0x2047('0x42')](function(_0x5eaf1f){_0x22b043[_0x2047('0x43')](checkTranscribeJob(_0x5eaf1f,_0x379a93,_0x278b2a));});return BPromise[_0x2047('0x44')](_0x22b043);})['catch'](function(_0x5394c6){if(_0x5394c6){if(!_0x5394c6['name']||_0x5394c6['name']!==_0x2047('0x39')){logger['error'](util['inspect'](_0x5394c6,{'showHidden':![],'depth':null}));}}});}exports[_0x2047('0x45')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0xcaa3=['transcribeName','data2','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','Sequelize','ValidationError','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','data1','Cloud\x20Provider\x20not\x20configured','Positive','SentimentScore','Negative','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','findOne','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Mixed','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','transcribeRegion','transcribeAccountId','all','inspect','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)'];(function(_0x4c13f0,_0x957607){var _0x27c469=function(_0x37857f){while(--_0x37857f){_0x4c13f0['push'](_0x4c13f0['shift']());}};_0x27c469(++_0x957607);}(_0xcaa3,0xcb));var _0x3caa=function(_0x595604,_0x2cc998){_0x595604=_0x595604-0x0;var _0x1466f3=_0xcaa3[_0x595604];return _0x1466f3;};var _=require(_0x3caa('0x0'));var AWS=require(_0x3caa('0x1'));var rp=require(_0x3caa('0x2'));var util=require(_0x3caa('0x3'));var BPromise=require(_0x3caa('0x4'));var db=require(_0x3caa('0x5'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0x447f38,_0x597afa,_0x2484a9,_0x44c37b){return new Promise(function(_0x171c56,_0x54ba79){var _0x3b2a1a=new AWS[(_0x3caa('0x6'))]({'accessKeyId':_0x597afa,'secretAccessKey':_0x447f38,'region':_0x2484a9});_0x3b2a1a[_0x3caa('0x7')]({'TranscriptionJobName':_0x44c37b},function(_0x4c7b84,_0x1f1661){if(_0x4c7b84){return _0x54ba79(_0x4c7b84);}else{return _0x171c56(_0x1f1661);}});});}function sentiment(_0x175d16,_0x5cff82,_0x1a8ee8,_0x453164,_0x169ece){return new Promise(function(_0x2bae6e,_0xf003a7){var _0x2d051a=new AWS[(_0x3caa('0x8'))]({'accessKeyId':_0x5cff82,'secretAccessKey':_0x175d16,'region':_0x1a8ee8});_0x2d051a[_0x3caa('0x9')]({'Text':_0x453164,'LanguageCode':_0x169ece[_0x3caa('0xa')](0x0,0x2)},function(_0x554ca4,_0x5c5a23){if(_0x554ca4){return _0xf003a7(_0x554ca4);}else{return _0x2bae6e(_0x5c5a23);}});});}function checkTranscribeJob(_0x256f6e,_0xe1df65,_0x47da19){var _0x1ec89c;return new BPromise(function(_0x4b4cc3,_0x263a5a){logger['info'](util[_0x3caa('0xb')](_0x3caa('0xc'),_0x256f6e['id'],_0x256f6e[_0x3caa('0xd')]));return getTranscriptionJob(_0x47da19['data1'],_0x47da19[_0x3caa('0xe')],_0xe1df65['transcribeRegion'],_0x256f6e[_0x3caa('0xd')])[_0x3caa('0xf')](function(_0x563cdd){logger[_0x3caa('0x10')](util[_0x3caa('0xb')](_0x3caa('0x11'),_0x256f6e['id'],_0x256f6e['transcribeName'],_0x563cdd[_0x3caa('0x12')][_0x3caa('0x13')]));if(!_0x256f6e[_0x3caa('0x14')]){switch(_0x563cdd[_0x3caa('0x12')][_0x3caa('0x13')]){case _0x3caa('0x15'):var _0x220862={'transcribeStatus':_0x563cdd['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x563cdd[_0x3caa('0x12')][_0x3caa('0x16')][_0x3caa('0x17')]};logger['info'](util[_0x3caa('0xb')](_0x3caa('0x18'),_0x256f6e['id']));return rp({'uri':_0x563cdd[_0x3caa('0x12')][_0x3caa('0x16')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x3d7dec){logger[_0x3caa('0x10')](util[_0x3caa('0xb')](_0x3caa('0x19'),_0x256f6e['id']));if(_0x3d7dec&&_0x3d7dec['results']&&_0x3d7dec[_0x3caa('0x1a')]['transcripts']&&_0x3d7dec['results'][_0x3caa('0x1b')][_0x3caa('0x1c')]){_0x220862[_0x3caa('0x14')]='';for(var _0xbe7769=0x0;_0xbe7769<_0x3d7dec[_0x3caa('0x1a')][_0x3caa('0x1b')][_0x3caa('0x1c')];_0xbe7769++){_0x220862['fileText']+=_0x3d7dec[_0x3caa('0x1a')][_0x3caa('0x1b')][_0xbe7769][_0x3caa('0x1d')]+'';}}return _0x256f6e[_0x3caa('0x1e')](_0x220862);})[_0x3caa('0xf')](function(){logger[_0x3caa('0x10')](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x256f6e['id']));if(!_0x256f6e['tempSentiment']){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0xe1df65[_0x3caa('0x21')]||!_0xe1df65[_0x3caa('0x22')]||!_0xe1df65['sentimentRegion']||!_0xe1df65[_0x3caa('0x23')]||!_0xe1df65[_0x3caa('0x24')]){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))](_0x3caa('0x25'));}if(!_0x220862[_0x3caa('0x14')]){throw new Error(_0x3caa('0x26'));}if(_0xe1df65[_0x3caa('0x22')]===_0x47da19['id']){return _0x47da19;}else{return db[_0x3caa('0x27')]['findOne']({'where':{'id':_settings[_0x3caa('0x22')]}});}})['then'](function(_0x2f3a2c){if(!_0x2f3a2c){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x2f3a2c[_0x3caa('0x28')]||!_0x2f3a2c[_0x3caa('0xe')]){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))](_0x3caa('0x29'));}_0x1ec89c=_0x2f3a2c;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x256f6e['id']));return sentiment(_0x1ec89c[_0x3caa('0x28')],_0x1ec89c[_0x3caa('0xe')],_0xe1df65['sentimentRegion'],_0x220862['fileText'],_0xe1df65['language']);})['then'](function(_0x5d9c99){logger[_0x3caa('0x10')](util[_0x3caa('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x256f6e['id']));return _0x256f6e['update']({'sentiment':_0x5d9c99['Sentiment'],'sPositive':_0x5d9c99['SentimentScore'][_0x3caa('0x2a')],'sNegative':_0x5d9c99[_0x3caa('0x2b')][_0x3caa('0x2c')],'sMixed':_0x5d9c99['SentimentScore']['Mixed'],'sNeutral':_0x5d9c99['SentimentScore'][_0x3caa('0x2d')]});})[_0x3caa('0xf')](function(){logger[_0x3caa('0x10')](util[_0x3caa('0xb')](_0x3caa('0x2e'),_0x256f6e['id']));_0x4b4cc3();});case _0x3caa('0x2f'):return _0x256f6e[_0x3caa('0x1e')]({'transcribeStatus':_0x3caa('0x2f'),'failureReason':_0x563cdd[_0x3caa('0x12')]['FailureReason']})[_0x3caa('0xf')](function(){logger['info'](util[_0x3caa('0xb')](_0x3caa('0x2e'),_0x256f6e['id']));_0x4b4cc3();});default:logger[_0x3caa('0x10')](util[_0x3caa('0xb')](_0x3caa('0x30'),_0x256f6e['id']));break;}}else{return BPromise[_0x3caa('0x31')]()[_0x3caa('0xf')](function(){if(!_0x256f6e['tempSentiment']){throw new db['Sequelize']['ValidationError'](_0x3caa('0x32'));}if(!_0xe1df65[_0x3caa('0x21')]||!_0xe1df65['sentimentAccountId']||!_0xe1df65['sentimentRegion']||!_0xe1df65[_0x3caa('0x23')]||!_0xe1df65[_0x3caa('0x24')]){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x256f6e['fileText']){throw new Error(_0x3caa('0x26'));}if(_0xe1df65['sentimentAccountId']===_0x47da19['id']){return _0x47da19;}else{return db[_0x3caa('0x27')][_0x3caa('0x33')]({'where':{'id':_settings[_0x3caa('0x22')]}});}})[_0x3caa('0xf')](function(_0x4ae7dc){if(!_0x4ae7dc){throw new db['Sequelize'][(_0x3caa('0x20'))](_0x3caa('0x34'));}if(!_0x4ae7dc[_0x3caa('0x28')]||!_0x4ae7dc[_0x3caa('0xe')]){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))](_0x3caa('0x29'));}_0x1ec89c=_0x4ae7dc;logger[_0x3caa('0x10')](util['format'](_0x3caa('0x35'),_0x256f6e['id']));return sentiment(_0x1ec89c['data1'],_0x1ec89c[_0x3caa('0xe')],_0xe1df65['sentimentRegion'],_0x256f6e[_0x3caa('0x14')],_0xe1df65[_0x3caa('0x23')]);})[_0x3caa('0xf')](function(_0x1fa362){logger[_0x3caa('0x10')](util[_0x3caa('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x256f6e['id']));return _0x256f6e[_0x3caa('0x1e')]({'sentiment':_0x1fa362[_0x3caa('0x36')],'sPositive':_0x1fa362['SentimentScore'][_0x3caa('0x2a')],'sNegative':_0x1fa362[_0x3caa('0x2b')]['Negative'],'sMixed':_0x1fa362['SentimentScore'][_0x3caa('0x37')],'sNeutral':_0x1fa362[_0x3caa('0x2b')][_0x3caa('0x2d')],'transcribeStatus':_0x3caa('0x15')});})['then'](function(){logger[_0x3caa('0x10')](util['format'](_0x3caa('0x2e'),_0x256f6e['id']));_0x4b4cc3();});}})['catch'](function(_0xac416c){if(_0xac416c){if(!_0xac416c[_0x3caa('0x38')]||_0xac416c[_0x3caa('0x38')]!==_0x3caa('0x39')){logger[_0x3caa('0x3a')](util[_0x3caa('0xb')](_0x3caa('0x3b'),_0x256f6e['id']),util['inspect'](_0xac416c,{'showHidden':![],'depth':null}));}}_0x4b4cc3();});});}function checkTranscribe(){var _0x1c9b28;var _0x111a2f;var _0x54ed45;return db[_0x3caa('0x3c')][_0x3caa('0x3d')]({'where':{'transcribeStatus':_0x3caa('0x3e')}})[_0x3caa('0xf')](function(_0x2888c8){if(!_0x2888c8||!_0x2888c8[_0x3caa('0x1c')]){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))](_0x3caa('0x3f'));}_0x1c9b28=_0x2888c8;return db[_0x3caa('0x40')][_0x3caa('0x33')]({'where':{'id':0x1}});})[_0x3caa('0xf')](function(_0x5ab4f1){if(!_0x5ab4f1){throw new db[(_0x3caa('0x1f'))]['ValidationError'](_0x3caa('0x41'));}_0x111a2f=_0x5ab4f1;if(!_0x111a2f[_0x3caa('0x42')]||!_0x111a2f['transcribeAccountId']||!_0x111a2f[_0x3caa('0x43')]||!_0x111a2f[_0x3caa('0x23')]||!_0x111a2f[_0x3caa('0x24')]){throw new db[(_0x3caa('0x1f'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x3caa('0x27')][_0x3caa('0x33')]({'where':{'id':_0x111a2f[_0x3caa('0x44')]}});})[_0x3caa('0xf')](function(_0x4a79f3){if(!_0x4a79f3){throw new db[(_0x3caa('0x1f'))][(_0x3caa('0x20'))](_0x3caa('0x34'));}if(!_0x4a79f3[_0x3caa('0x28')]||!_0x4a79f3['data2']){throw new db['Sequelize']['ValidationError'](_0x3caa('0x29'));}_0x54ed45=_0x4a79f3;var _0x3b68c2=[];_0x1c9b28['forEach'](function(_0x1c59e0){_0x3b68c2['push'](checkTranscribeJob(_0x1c59e0,_0x111a2f,_0x54ed45));});return BPromise[_0x3caa('0x45')](_0x3b68c2);})['catch'](function(_0x5d38f6){if(_0x5d38f6){if(!_0x5d38f6[_0x3caa('0x38')]||_0x5d38f6[_0x3caa('0x38')]!==_0x3caa('0x39')){logger[_0x3caa('0x3a')](util[_0x3caa('0x46')](_0x5d38f6,{'showHidden':![],'depth':null}));}}});}exports[_0x3caa('0x47')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 31954b5..9e4497b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6020=['emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','findAll','lastMsgAt','subtract','hours','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','timeout','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join'];(function(_0x18b34c,_0x1e6efe){var _0x476c43=function(_0x3e6516){while(--_0x3e6516){_0x18b34c['push'](_0x18b34c['shift']());}};_0x476c43(++_0x1e6efe);}(_0x6020,0x15b));var _0x0602=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x6020[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x0602('0x0'));var moment=require(_0x0602('0x1'));var Redis=require('ioredis');var util=require(_0x0602('0x2'));var config=require(_0x0602('0x3'));var db=require(_0x0602('0x4'))['db'];var logger=require(_0x0602('0x5'))(_0x0602('0x6'));config[_0x0602('0x7')]=_[_0x0602('0x8')](config[_0x0602('0x7')],{'host':_0x0602('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0602('0x7')]));function closeInteractions(){var _0x58cb7f=[];return db['WhatsappInteraction'][_0x0602('0xa')]({'raw':!![],'attributes':['id',_0x0602('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x0602('0xc')](0x18,_0x0602('0xd'))}}})['then'](function(_0x462e44){if(_0x462e44&&_0x462e44[_0x0602('0xe')]){_0x58cb7f=_[_0x0602('0xf')](_0x462e44||[],'id');logger[_0x0602('0x10')](_0x0602('0x11'),_0x58cb7f['join']());return db[_0x0602('0x12')][_0x0602('0x13')]({'closeReason':'system','disposition':_0x0602('0x14'),'closed':!![],'closedAt':moment()['format'](_0x0602('0x15'))},{'where':{'id':_0x58cb7f}});}})[_0x0602('0x16')](function(){if(_0x58cb7f&&_0x58cb7f['length']){logger[_0x0602('0x10')](_0x0602('0x17'),_0x58cb7f[_0x0602('0x18')]());for(var _0x125626=0x0;_0x125626<_0x58cb7f[_0x0602('0xe')];_0x125626++){io[_0x0602('0x19')]('whatsappInteraction:update',{'id':_0x58cb7f[_0x125626],'closed':!![]});}}})[_0x0602('0x1a')](function(_0x482054){logger[_0x0602('0x1b')](_0x0602('0x1c'),_0x482054?util[_0x0602('0x1d')](_0x482054,{'showHidden':![],'depth':null}):'');});}exports[_0x0602('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xb24d=['util','../logger','schedule','redis','defaults','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','format','YYYY-MM-DD\x20HH:mm:ss','emit','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start'];(function(_0x105007,_0x1714d5){var _0x280710=function(_0x3d7407){while(--_0x3d7407){_0x105007['push'](_0x105007['shift']());}};_0x280710(++_0x1714d5);}(_0xb24d,0x19e));var _0xdb24=function(_0x5a02dd,_0x410094){_0x5a02dd=_0x5a02dd-0x0;var _0x44604e=_0xb24d[_0x5a02dd];return _0x44604e;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xdb24('0x0'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require(_0xdb24('0x1'))(_0xdb24('0x2'));config[_0xdb24('0x3')]=_[_0xdb24('0x4')](config[_0xdb24('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xdb24('0x5'))(new Redis(config[_0xdb24('0x3')]));function closeInteractions(){var _0x22b99a=[];return db[_0xdb24('0x6')][_0xdb24('0x7')]({'raw':!![],'attributes':['id',_0xdb24('0x8')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xdb24('0x9')](0x18,_0xdb24('0xa'))}}})[_0xdb24('0xb')](function(_0x4d6fa8){if(_0x4d6fa8&&_0x4d6fa8[_0xdb24('0xc')]){_0x22b99a=_[_0xdb24('0xd')](_0x4d6fa8||[],'id');logger[_0xdb24('0xe')](_0xdb24('0xf'),_0x22b99a[_0xdb24('0x10')]());return db[_0xdb24('0x6')]['update']({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0xdb24('0x11')](_0xdb24('0x12'))},{'where':{'id':_0x22b99a}});}})[_0xdb24('0xb')](function(){if(_0x22b99a&&_0x22b99a[_0xdb24('0xc')]){logger[_0xdb24('0xe')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x22b99a['join']());for(var _0x5226e8=0x0;_0x5226e8<_0x22b99a[_0xdb24('0xc')];_0x5226e8++){io[_0xdb24('0x13')]('whatsappInteraction:update',{'id':_0x22b99a[_0x5226e8],'closed':!![]});}}})['catch'](function(_0x4a1e14){logger['error'](_0xdb24('0x14'),_0x4a1e14?util[_0xdb24('0x15')](_0x4a1e14,{'showHidden':![],'depth':null}):'');});}exports[_0xdb24('0x16')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 14a0246..121b9b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24f2=['contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1'];(function(_0x7c0032,_0x9b832d){var _0x225fb5=function(_0xf6b8d){while(--_0xf6b8d){_0x7c0032['push'](_0x7c0032['shift']());}};_0x225fb5(++_0x9b832d);}(_0x24f2,0x1cf));var _0x224f=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x24f2[_0x48b5e0];return _0x4287ea;};'use strict';var util=require(_0x224f('0x0'));var db=require(_0x224f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x224f('0x2')]({'id':i,'firstName':_0x224f('0x3')+i,'lastName':_0x224f('0x4')+i,'phone':0xf879fb460+i,'email':_0x224f('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x224f('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x224f('0x4')+i,'phone':0xf879fb460+i,'email':_0x224f('0x5')+i+_0x224f('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x224f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x224f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x224f('0x6')](),'updatedAt':Date[_0x224f('0x6')]()});}db[_0x224f('0x8')][_0x224f('0x9')]({'where':{}})[_0x224f('0xa')](function(){return db['CmContact'][_0x224f('0xb')](contacts);})[_0x224f('0xa')](function(){console[_0x224f('0xc')](_0x224f('0xd'),_0x224f('0xe'));return db[_0x224f('0xf')][_0x224f('0x9')]({'where':{}});})['then'](function(){return db[_0x224f('0xf')][_0x224f('0xb')](hopper);})[_0x224f('0xa')](function(){console[_0x224f('0xc')](_0x224f('0xd'),_0x224f('0x10'));return db[_0x224f('0x8')][_0x224f('0xb')](contacts2);})[_0x224f('0xa')](function(){console[_0x224f('0xc')](_0x224f('0xd'),_0x224f('0x11'));return db[_0x224f('0xf')][_0x224f('0xb')](hopper2);})[_0x224f('0xa')](function(){console[_0x224f('0xc')](_0x224f('0xd'),_0x224f('0x12'));})[_0x224f('0x13')](function(_0x38477b){console[_0x224f('0xc')](_0x38477b);});
\ No newline at end of file
+var _0xd4f6=['CmHopper','destroy','bulkCreate','contacts2','hopper2','catch','util','Biondo','innocenzo.biondo','now','push','Innocenzo','@xcally.com','then','CmContact','log','finished\x20populating'];(function(_0x4fd703,_0x2d3431){var _0x476cdb=function(_0x30f377){while(--_0x30f377){_0x4fd703['push'](_0x4fd703['shift']());}};_0x476cdb(++_0x2d3431);}(_0xd4f6,0x7d));var _0x6d4f=function(_0x5d1566,_0x3fed4b){_0x5d1566=_0x5d1566-0x0;var _0x3441a2=_0xd4f6[_0x5d1566];return _0x3441a2;};'use strict';var util=require(_0x6d4f('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x6d4f('0x1')+i,'phone':0xf879fb460+i,'email':_0x6d4f('0x2')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x6d4f('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x6d4f('0x3')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x6d4f('0x4')]({'id':i,'firstName':_0x6d4f('0x5')+i,'lastName':_0x6d4f('0x1')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x6d4f('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x6d4f('0x4')]({'id':i,'active':![],'scheduledat':Date[_0x6d4f('0x3')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x6d4f('0x3')](),'updatedAt':Date[_0x6d4f('0x3')]()});}db['CmContact']['destroy']({'where':{}})[_0x6d4f('0x7')](function(){return db[_0x6d4f('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x6d4f('0x9')](_0x6d4f('0xa'),'contacts1');return db[_0x6d4f('0xb')][_0x6d4f('0xc')]({'where':{}});})[_0x6d4f('0x7')](function(){return db[_0x6d4f('0xb')][_0x6d4f('0xd')](hopper);})[_0x6d4f('0x7')](function(){console['log'](_0x6d4f('0xa'),'hopper1');return db[_0x6d4f('0x8')]['bulkCreate'](contacts2);})[_0x6d4f('0x7')](function(){console[_0x6d4f('0x9')](_0x6d4f('0xa'),_0x6d4f('0xe'));return db[_0x6d4f('0xb')]['bulkCreate'](hopper2);})['then'](function(){console[_0x6d4f('0x9')](_0x6d4f('0xa'),_0x6d4f('0xf'));})[_0x6d4f('0x10')](function(_0x87478b){console[_0x6d4f('0x9')](_0x87478b);});
\ No newline at end of file
index 6cf7932..596dd29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1de8=['%s%s@xcally.com','password','friend','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','agent','format','%s%s'];(function(_0xe4a947,_0x59c7b5){var _0x2e6af2=function(_0x519fe1){while(--_0x519fe1){_0xe4a947['push'](_0xe4a947['shift']());}};_0x2e6af2(++_0x59c7b5);}(_0x1de8,0x1dc));var _0x81de=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0x1de8[_0x4b4638];return _0x59e92b;};'use strict';var util=require('util');var db=require(_0x81de('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x81de('0x1'),i),'fullname':util[_0x81de('0x2')](_0x81de('0x3'),_0x81de('0x1'),i),'email':util[_0x81de('0x2')](_0x81de('0x4'),_0x81de('0x1'),i),'role':'agent','password':_0x81de('0x5'),'internal':0xfa0+i,'type':_0x81de('0x6'),'transport':['udp','ws',_0x81de('0x7')],'disallow':['all'],'allow':[_0x81de('0x8')],'defaultuser':util[_0x81de('0x2')](_0x81de('0x3'),_0x81de('0x1'),i),'encryption':_0x81de('0x9'),'avpf':'yes','force_avp':_0x81de('0x9'),'icesupport':_0x81de('0x9'),'dtlsenable':_0x81de('0x9'),'dtlsverify':'no','dtlscertfile':_0x81de('0xa'),'dtlsprivatekey':_0x81de('0xb'),'dtlssetup':_0x81de('0xc'),'callerid':util[_0x81de('0x2')](_0x81de('0xd'),util['format']('%s%s',_0x81de('0x1'),i),0xfa0+i)});}db[_0x81de('0xe')][_0x81de('0xf')](users)[_0x81de('0x10')](function(){console[_0x81de('0x11')](_0x81de('0x12'));})[_0x81de('0x13')](function(_0x2f91fe){console[_0x81de('0x11')](_0x2f91fe);});
\ No newline at end of file
+var _0x073a=['User','log','add\x20user','catch','util','push','format','agent','%s%s','%s%s@xcally.com','friend','udp','all','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>'];(function(_0x22a57a,_0x9a9e9f){var _0x1150fc=function(_0x2d1582){while(--_0x2d1582){_0x22a57a['push'](_0x22a57a['shift']());}};_0x1150fc(++_0x9a9e9f);}(_0x073a,0xd0));var _0xa073=function(_0x2e7906,_0x41415c){_0x2e7906=_0x2e7906-0x0;var _0x518b56=_0x073a[_0x2e7906];return _0x518b56;};'use strict';var util=require(_0xa073('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa073('0x1')]({'name':util[_0xa073('0x2')]('%s%s',_0xa073('0x3'),i),'fullname':util[_0xa073('0x2')](_0xa073('0x4'),'agent',i),'email':util[_0xa073('0x2')](_0xa073('0x5'),_0xa073('0x3'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xa073('0x6'),'transport':[_0xa073('0x7'),'ws','wss'],'disallow':[_0xa073('0x8')],'allow':['ulaw'],'defaultuser':util[_0xa073('0x2')](_0xa073('0x4'),_0xa073('0x3'),i),'encryption':_0xa073('0x9'),'avpf':_0xa073('0x9'),'force_avp':_0xa073('0x9'),'icesupport':_0xa073('0x9'),'dtlsenable':_0xa073('0x9'),'dtlsverify':'no','dtlscertfile':_0xa073('0xa'),'dtlsprivatekey':_0xa073('0xb'),'dtlssetup':'actpass','callerid':util[_0xa073('0x2')](_0xa073('0xc'),util[_0xa073('0x2')](_0xa073('0x4'),_0xa073('0x3'),i),0xfa0+i)});}db[_0xa073('0xd')]['bulkCreate'](users)['then'](function(){console[_0xa073('0xe')](_0xa073('0xf'));})[_0xa073('0x10')](function(_0x31c968){console[_0xa073('0xe')](_0x31c968);});
\ No newline at end of file
index 4675809..f3bb353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6075=['request','connectedAt','log','SocketIO\x20','nsp','disconnect','lodash','bluebird','../mysqldb','name','Agents','User','role','agent','telephone','type','ivr','UserProfileSection','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','where','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','user','voice:outbound','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','telephone:%s','campaign:%s:%s','emit','leave','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','connection','setMaxListeners','address'];(function(_0x1cb97d,_0x308c88){var _0x5bf9da=function(_0x48f0f5){while(--_0x48f0f5){_0x1cb97d['push'](_0x1cb97d['shift']());}};_0x5bf9da(++_0x308c88);}(_0x6075,0x126));var _0x5607=function(_0x5b69d0,_0x35c608){_0x5b69d0=_0x5b69d0-0x0;var _0x5b6a11=_0x6075[_0x5b69d0];return _0x5b6a11;};'use strict';var _=require(_0x5607('0x0'));var util=require('util');var BPromise=require(_0x5607('0x1'));var db=require(_0x5607('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x5607('0x3')],'include':[{'as':_0x5607('0x4'),'model':db[_0x5607('0x5')],'attributes':['id',_0x5607('0x3'),_0x5607('0x6')],'raw':!![],'where':{'role':_0x5607('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5607('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5607('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x5607('0x3')],'where':{'role':_0x5607('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5607('0x3'),_0x5607('0x9')],'where':{'type':_0x5607('0xa')}};function getAssociatedResources(_0x104e28,_0x478abf,_0x4188c7){return db[_0x5607('0xb')]['findOne']({'where':{'name':_0x104e28,'userProfileId':_0x478abf},'raw':!![]})[_0x5607('0xc')](function(_0xddea57){if(_0xddea57){if(_0xddea57['autoAssociation']){switch(_0x104e28){case _0x5607('0xd'):case _0x5607('0xe'):case _0x5607('0xf'):case _0x5607('0x10'):case _0x5607('0x11'):case _0x5607('0x12'):case _0x5607('0x13'):return db[_0x4188c7][_0x5607('0x14')](queryQueues);case _0x5607('0x15'):return db[_0x4188c7][_0x5607('0x14')](queryTelephones);case _0x5607('0x16'):return db[_0x4188c7][_0x5607('0x14')](queryTrunks);case _0x5607('0x17'):return db[_0x4188c7]['findAll'](queryCampaigns);}}else{return db[_0x5607('0x18')]['findAll']({'attributes':[_0x5607('0x19')],'where':{'sectionId':_0xddea57['id']},'raw':!![]})[_0x5607('0xc')](function(_0x274829){if(_0x274829){var _0x423507={'where':{'id':_[_0x5607('0x1a')](_0x274829,'resourceId')},'raw':!![]};switch(_0x4188c7){case _0x5607('0x5'):_0x423507[_0x5607('0x1b')][_0x5607('0x6')]=_0x5607('0x8');break;case'Campaign':_0x423507[_0x5607('0x1b')]['type']='ivr';break;}return db[_0x4188c7][_0x5607('0x14')](_0x423507);}else{return[];}});}}else{return[];}})['then'](function(_0x30a04b){return _0x30a04b;});}function joinOrLeaveQueues(_0x14862a,_0x596fab,_0x342703,_0x4d2d88){_0x14862a[_0x596fab](util[_0x5607('0x1c')](_0x5607('0x1d'),_0x342703,_0x4d2d88[_0x5607('0x3')]));if(_0x4d2d88['Agents']){for(var _0xd136ca=0x0;_0xd136ca<_0x4d2d88[_0x5607('0x4')][_0x5607('0x1e')];_0xd136ca+=0x1){_0x14862a[_0x596fab](util['format'](_0x5607('0x1f'),_0x4d2d88[_0x5607('0x4')][_0xd136ca][_0x5607('0x3')]));}}}function joinOrLeave(_0x3d2af8,_0x2570fd,_0x63e5a3){var _0x5a913a;if(_0x3d2af8[_0x5607('0x20')][_0x5607('0x21')]['id']){db[_0x5607('0x5')]['find']({'attributes':['id',_0x5607('0x3'),_0x5607('0x6'),_0x5607('0x22')],'where':{'id':_0x3d2af8[_0x5607('0x20')][_0x5607('0x21')]['id']},'include':[{'model':db[_0x5607('0x23')],'as':_0x5607('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x5607('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5607('0x26')],'as':_0x5607('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5607('0x28')],'as':_0x5607('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x5607('0x2a')],'as':_0x5607('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0x5607('0x2c')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x395c18){if(_0x395c18){_0x5a913a=_0x395c18;_0x3d2af8[_0x2570fd](util['format'](_0x5607('0x1f'),_0x395c18[_0x5607('0x3')]));var _0x1da75e=[];switch(_0x395c18[_0x5607('0x6')]){case _0x5607('0x2d'):_0x3d2af8[_0x2570fd](_0x5607('0x2e'));_0x3d2af8[_0x2570fd]('voice:outbound');if(queryQueues[_0x5607('0x2f')](_0x5607('0x30'))){delete queryQueues[_0x5607('0x30')];}_0x1da75e[_0x5607('0x31')](db[_0x5607('0x32')][_0x5607('0x14')](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x33')]['findAll'](queryQueues));_0x1da75e[_0x5607('0x31')](db['FaxQueue']['findAll'](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x34')][_0x5607('0x14')](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x35')]['findAll'](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x36')][_0x5607('0x14')](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x37')]['findAll'](queryQueues));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x5')][_0x5607('0x14')](queryTelephones));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x38')][_0x5607('0x14')](queryTrunks));_0x1da75e['push'](db[_0x5607('0x39')][_0x5607('0x14')](queryCampaigns));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x5')]['findAll'](queryAgents));break;case _0x5607('0x3a'):_0x3d2af8[_0x2570fd](_0x5607('0x2e'));_0x3d2af8[_0x2570fd]('voice:outbound');_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0xd'),_0x395c18[_0x5607('0x22')],_0x5607('0x32')));_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0xe'),_0x395c18[_0x5607('0x22')],_0x5607('0x33')));_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0xf'),_0x395c18[_0x5607('0x22')],'FaxQueue'));_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0x10'),_0x395c18[_0x5607('0x22')],_0x5607('0x34')));_0x1da75e['push'](getAssociatedResources('MailQueues',_0x395c18[_0x5607('0x22')],'MailQueue'));_0x1da75e['push'](getAssociatedResources(_0x5607('0x12'),_0x395c18[_0x5607('0x22')],_0x5607('0x36')));_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0x13'),_0x395c18[_0x5607('0x22')],_0x5607('0x37')));_0x1da75e[_0x5607('0x31')](getAssociatedResources(_0x5607('0x15'),_0x395c18[_0x5607('0x22')],_0x5607('0x5')));_0x1da75e[_0x5607('0x31')](getAssociatedResources('Trunks',_0x395c18[_0x5607('0x22')],_0x5607('0x38')));_0x1da75e[_0x5607('0x31')](getAssociatedResources('IvrCampaigns',_0x395c18['userProfileId'],'Campaign'));_0x1da75e[_0x5607('0x31')](db[_0x5607('0x5')][_0x5607('0x14')](queryAgents));break;case _0x5607('0x7'):_0x3d2af8[_0x2570fd]('voice:inbound');_0x3d2af8[_0x2570fd](_0x5607('0x3b'));_0x1da75e['push'](_0x395c18['getVoiceQueues']({'attributes':['id',_0x5607('0x3')]}));_0x1da75e[_0x5607('0x31')](_0x395c18['getChatQueues']({'attributes':['id','name']}));_0x1da75e['push'](_0x395c18[_0x5607('0x3c')]({'attributes':['id',_0x5607('0x3')]}));_0x1da75e['push'](_0x395c18[_0x5607('0x3d')]({'attributes':['id',_0x5607('0x3')]}));_0x1da75e[_0x5607('0x31')](_0x395c18[_0x5607('0x3e')]({'attributes':['id',_0x5607('0x3')]}));_0x1da75e[_0x5607('0x31')](_0x395c18['getOpenchannelQueues']({'attributes':['id',_0x5607('0x3')]}));_0x1da75e[_0x5607('0x31')](_0x395c18[_0x5607('0x3f')]({'attributes':['id',_0x5607('0x3')]}));break;}return BPromise[_0x5607('0x40')](_0x1da75e);}})[_0x5607('0xc')](function(_0x47fa9f){if(_0x47fa9f&&_0x47fa9f[_0x5607('0x1e')]){for(var _0x4ebe30=0x0;_0x4ebe30<_0x47fa9f[_0x5607('0x1e')];_0x4ebe30+=0x1){for(var _0x132665=0x0;_0x132665<_0x47fa9f[_0x4ebe30][_0x5607('0x1e')];_0x132665+=0x1){switch(_0x4ebe30){case 0x0:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,_0x5607('0x41'),_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x1:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,_0x5607('0x42'),_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x2:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,_0x5607('0x43'),_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x3:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,_0x5607('0x44'),_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x4:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,'mail',_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x5:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,_0x5607('0x45'),_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x6:joinOrLeaveQueues(_0x3d2af8,_0x2570fd,'whatsapp',_0x47fa9f[_0x4ebe30][_0x132665]);break;case 0x7:if(_0x5a913a[_0x5607('0x6')]!==_0x5607('0x7'))_0x3d2af8[_0x2570fd](util[_0x5607('0x1c')](_0x5607('0x46'),_0x47fa9f[_0x4ebe30][_0x132665][_0x5607('0x3')]));break;case 0x8:if(_0x5a913a[_0x5607('0x6')]!=='agent')_0x3d2af8[_0x2570fd](util[_0x5607('0x1c')]('trunk:%s',_0x47fa9f[_0x4ebe30][_0x132665][_0x5607('0x3')]));break;case 0x9:if(_0x5a913a[_0x5607('0x6')]!==_0x5607('0x7'))_0x3d2af8[_0x2570fd](util[_0x5607('0x1c')](_0x5607('0x47'),_0x47fa9f[_0x4ebe30][_0x132665][_0x5607('0x9')],_0x47fa9f[_0x4ebe30][_0x132665][_0x5607('0x3')]));break;case 0xa:_0x3d2af8[_0x2570fd](util[_0x5607('0x1c')](_0x5607('0x1f'),_0x47fa9f[_0x4ebe30][_0x132665][_0x5607('0x3')]));break;}}}}})[_0x5607('0xc')](function(){if(_0x2570fd==='leave'){var _0x209d21=_[_0x5607('0x1a')](_0x5a913a[_0x5607('0x24')],'id');return _0x5a913a['removeChatInteractions'](_0x209d21)[_0x5607('0xc')](function(){for(var _0x506d96=0x0;_0x506d96<_0x209d21[_0x5607('0x1e')];_0x506d96+=0x1){_0x63e5a3[_0x5607('0x48')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x209d21[_0x506d96]),'UserId':Number(_0x5a913a['id'])});}});}})['then'](function(){if(_0x2570fd===_0x5607('0x49')){var _0x64874f=_[_0x5607('0x1a')](_0x5a913a[_0x5607('0x25')],'id');return _0x5a913a[_0x5607('0x4a')](_0x64874f)[_0x5607('0xc')](function(){for(var _0x7a1b90=0x0;_0x7a1b90<_0x64874f[_0x5607('0x1e')];_0x7a1b90+=0x1){_0x63e5a3[_0x5607('0x48')](_0x5607('0x4b'),{'MailInteractionId':Number(_0x64874f[_0x7a1b90]),'UserId':Number(_0x5a913a['id'])});}});}})[_0x5607('0xc')](function(){if(_0x2570fd===_0x5607('0x49')){var _0x15fa31=_['map'](_0x5a913a[_0x5607('0x27')],'id');return _0x5a913a[_0x5607('0x4c')](_0x15fa31)[_0x5607('0xc')](function(){for(var _0x38c7bf=0x0;_0x38c7bf<_0x15fa31[_0x5607('0x1e')];_0x38c7bf+=0x1){_0x63e5a3[_0x5607('0x48')](_0x5607('0x4d'),{'FaxInteractionId':Number(_0x15fa31[_0x38c7bf]),'UserId':Number(_0x5a913a['id'])});}});}})[_0x5607('0xc')](function(){if(_0x2570fd==='leave'){var _0x485ca8=_[_0x5607('0x1a')](_0x5a913a['SmsInteractions'],'id');return _0x5a913a[_0x5607('0x4e')](_0x485ca8)[_0x5607('0xc')](function(){for(var _0x42571d=0x0;_0x42571d<_0x485ca8[_0x5607('0x1e')];_0x42571d+=0x1){_0x63e5a3['emit'](_0x5607('0x4f'),{'SmsInteractionId':Number(_0x485ca8[_0x42571d]),'UserId':Number(_0x5a913a['id'])});}});}})[_0x5607('0xc')](function(){if(_0x2570fd==='leave'){var _0x131cc8=_[_0x5607('0x1a')](_0x5a913a['OpenchannelInteractions'],'id');return _0x5a913a[_0x5607('0x50')](_0x131cc8)['then'](function(){for(var _0x2afdb7=0x0;_0x2afdb7<_0x131cc8[_0x5607('0x1e')];_0x2afdb7+=0x1){_0x63e5a3['emit'](_0x5607('0x51'),{'OpenchannelInteractionId':Number(_0x131cc8[_0x2afdb7]),'UserId':Number(_0x5a913a['id'])});}});}})['then'](function(){if(_0x2570fd===_0x5607('0x49')){var _0x43e1a2=_[_0x5607('0x1a')](_0x5a913a[_0x5607('0x52')],'id');return _0x5a913a[_0x5607('0x53')](_0x43e1a2)['then'](function(){for(var _0x4a9130=0x0;_0x4a9130<_0x43e1a2[_0x5607('0x1e')];_0x4a9130+=0x1){_0x63e5a3[_0x5607('0x48')](_0x5607('0x54'),{'WhatsappInteractionId':Number(_0x43e1a2[_0x4a9130]),'UserId':Number(_0x5a913a['id'])});}});}})[_0x5607('0x55')](function(_0x195c3b){_0x3d2af8['log'](_0x195c3b);});}}function onDisconnect(_0x1cfdcd,_0x4e63d7){joinOrLeave(_0x1cfdcd,_0x5607('0x49'),_0x4e63d7);}function onConnect(_0x26b0b7){joinOrLeave(_0x26b0b7,_0x5607('0x56'));}exports['default']=function(_0x5f25d4){_0x5f25d4['on'](_0x5607('0x57'),function(_0xe3e3c9){_0xe3e3c9[_0x5607('0x58')](0x0);_0xe3e3c9[_0x5607('0x59')]=_0xe3e3c9[_0x5607('0x5a')][_0x5607('0x57')]['remoteAddress']+':'+_0xe3e3c9[_0x5607('0x5a')][_0x5607('0x57')]['remotePort'];_0xe3e3c9[_0x5607('0x5b')]=new Date();_0xe3e3c9['log']=function(_0x3631d2){console[_0x5607('0x5c')](_0x5607('0x5d')+_0xe3e3c9[_0x5607('0x5e')][_0x5607('0x3')]+'['+_0xe3e3c9[_0x5607('0x59')]+']',_0x3631d2);};_0xe3e3c9['on'](_0x5607('0x5f'),function(){onDisconnect(_0xe3e3c9,_0x5f25d4);_0xe3e3c9[_0x5607('0x5c')]('DISCONNECTED');});onConnect(_0xe3e3c9);_0xe3e3c9[_0x5607('0x5c')]('CONNECTED');});};
\ No newline at end of file
+var _0x383b=['WhatsappQueue','Trunk','user','SmsQueues','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','emit','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','lodash','bluebird','../mysqldb','./environment','Agents','name','role','agent','telephone','type','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','then','map','User','Campaign','where','ivr','format','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue'];(function(_0x478b1c,_0x3ef197){var _0x31439a=function(_0x4a327a){while(--_0x4a327a){_0x478b1c['push'](_0x478b1c['shift']());}};_0x31439a(++_0x3ef197);}(_0x383b,0x89));var _0xb383=function(_0xd8d138,_0x2c83ec){_0xd8d138=_0xd8d138-0x0;var _0x1a618b=_0x383b[_0xd8d138];return _0x1a618b;};'use strict';var _=require(_0xb383('0x0'));var util=require('util');var BPromise=require(_0xb383('0x1'));var db=require(_0xb383('0x2'))['db'];var config=require(_0xb383('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0xb383('0x4'),'model':db['User'],'attributes':['id',_0xb383('0x5'),_0xb383('0x6')],'raw':!![],'where':{'role':_0xb383('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xb383('0x5')],'where':{'role':_0xb383('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb383('0x5')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb383('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xb383('0x5'),_0xb383('0x9')],'where':{'type':'ivr'}};function getAssociatedResources(_0x4ae00a,_0x440e29,_0x236a19){return db[_0xb383('0xa')][_0xb383('0xb')]({'where':{'name':_0x4ae00a,'userProfileId':_0x440e29},'raw':!![]})['then'](function(_0xd10156){if(_0xd10156){if(_0xd10156[_0xb383('0xc')]){switch(_0x4ae00a){case _0xb383('0xd'):case _0xb383('0xe'):case _0xb383('0xf'):case'SmsQueues':case _0xb383('0x10'):case _0xb383('0x11'):case'WhatsappQueues':return db[_0x236a19][_0xb383('0x12')](queryQueues);case _0xb383('0x13'):return db[_0x236a19][_0xb383('0x12')](queryTelephones);case _0xb383('0x14'):return db[_0x236a19][_0xb383('0x12')](queryTrunks);case _0xb383('0x15'):return db[_0x236a19][_0xb383('0x12')](queryCampaigns);}}else{return db[_0xb383('0x16')][_0xb383('0x12')]({'attributes':[_0xb383('0x17')],'where':{'sectionId':_0xd10156['id']},'raw':!![]})[_0xb383('0x18')](function(_0xfbc68f){if(_0xfbc68f){var _0x4b3cb5={'where':{'id':_[_0xb383('0x19')](_0xfbc68f,_0xb383('0x17'))},'raw':!![]};switch(_0x236a19){case _0xb383('0x1a'):_0x4b3cb5['where'][_0xb383('0x6')]=_0xb383('0x8');break;case _0xb383('0x1b'):_0x4b3cb5[_0xb383('0x1c')][_0xb383('0x9')]=_0xb383('0x1d');break;}return db[_0x236a19]['findAll'](_0x4b3cb5);}else{return[];}});}}else{return[];}})[_0xb383('0x18')](function(_0x48292a){return _0x48292a;});}function joinOrLeaveQueues(_0x151642,_0xc69241,_0x2597ed,_0x160889){_0x151642[_0xc69241](util[_0xb383('0x1e')]('%s:queue:%s',_0x2597ed,_0x160889[_0xb383('0x5')]));if(_0x160889[_0xb383('0x4')]){for(var _0x1c0246=0x0;_0x1c0246<_0x160889['Agents'][_0xb383('0x1f')];_0x1c0246+=0x1){_0x151642[_0xc69241](util[_0xb383('0x1e')](_0xb383('0x20'),_0x160889['Agents'][_0x1c0246]['name']));}}}function joinOrLeave(_0xbc2784,_0x127d1b,_0x306dd7){var _0x38d029;if(_0xbc2784[_0xb383('0x21')][_0xb383('0x22')]['id']){db[_0xb383('0x1a')][_0xb383('0x23')]({'attributes':['id',_0xb383('0x5'),'role',_0xb383('0x24')],'where':{'id':_0xbc2784['handshake'][_0xb383('0x22')]['id']},'include':[{'model':db[_0xb383('0x25')],'as':_0xb383('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0xb383('0x27')],'as':_0xb383('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xb383('0x29')],'as':_0xb383('0x2a'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xb383('0x2b'),'attributes':['id'],'raw':!![]},{'model':db[_0xb383('0x2c')],'as':_0xb383('0x2d'),'attributes':['id'],'raw':!![]},{'model':db[_0xb383('0x2e')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xb383('0x18')](function(_0x10ea31){if(_0x10ea31){_0x38d029=_0x10ea31;_0xbc2784[_0x127d1b](util['format'](_0xb383('0x20'),_0x10ea31[_0xb383('0x5')]));var _0xd73712=[];switch(_0x10ea31[_0xb383('0x6')]){case'admin':_0xbc2784[_0x127d1b](_0xb383('0x2f'));_0xbc2784[_0x127d1b](_0xb383('0x30'));if(queryQueues['hasOwnProperty'](_0xb383('0x31'))){delete queryQueues[_0xb383('0x31')];}_0xd73712[_0xb383('0x32')](db[_0xb383('0x33')][_0xb383('0x12')](queryQueues));_0xd73712[_0xb383('0x32')](db['ChatQueue'][_0xb383('0x12')](queryQueues));_0xd73712[_0xb383('0x32')](db[_0xb383('0x34')][_0xb383('0x12')](queryQueues));_0xd73712[_0xb383('0x32')](db[_0xb383('0x35')][_0xb383('0x12')](queryQueues));_0xd73712[_0xb383('0x32')](db['MailQueue'][_0xb383('0x12')](queryQueues));_0xd73712[_0xb383('0x32')](db[_0xb383('0x36')]['findAll'](queryQueues));_0xd73712[_0xb383('0x32')](db[_0xb383('0x37')]['findAll'](queryQueues));_0xd73712[_0xb383('0x32')](db[_0xb383('0x1a')][_0xb383('0x12')](queryTelephones));_0xd73712['push'](db[_0xb383('0x38')][_0xb383('0x12')](queryTrunks));_0xd73712[_0xb383('0x32')](db[_0xb383('0x1b')][_0xb383('0x12')](queryCampaigns));_0xd73712[_0xb383('0x32')](db['User'][_0xb383('0x12')](queryAgents));break;case _0xb383('0x39'):_0xbc2784[_0x127d1b](_0xb383('0x2f'));_0xbc2784[_0x127d1b]('voice:outbound');_0xd73712[_0xb383('0x32')](getAssociatedResources(_0xb383('0xd'),_0x10ea31[_0xb383('0x24')],_0xb383('0x33')));_0xd73712[_0xb383('0x32')](getAssociatedResources(_0xb383('0xe'),_0x10ea31[_0xb383('0x24')],'ChatQueue'));_0xd73712['push'](getAssociatedResources(_0xb383('0xf'),_0x10ea31[_0xb383('0x24')],_0xb383('0x34')));_0xd73712[_0xb383('0x32')](getAssociatedResources(_0xb383('0x3a'),_0x10ea31[_0xb383('0x24')],_0xb383('0x35')));_0xd73712[_0xb383('0x32')](getAssociatedResources('MailQueues',_0x10ea31[_0xb383('0x24')],_0xb383('0x3b')));_0xd73712[_0xb383('0x32')](getAssociatedResources(_0xb383('0x11'),_0x10ea31['userProfileId'],_0xb383('0x36')));_0xd73712[_0xb383('0x32')](getAssociatedResources('WhatsappQueues',_0x10ea31[_0xb383('0x24')],'WhatsappQueue'));_0xd73712[_0xb383('0x32')](getAssociatedResources(_0xb383('0x13'),_0x10ea31[_0xb383('0x24')],_0xb383('0x1a')));_0xd73712['push'](getAssociatedResources(_0xb383('0x14'),_0x10ea31['userProfileId'],_0xb383('0x38')));_0xd73712['push'](getAssociatedResources(_0xb383('0x15'),_0x10ea31[_0xb383('0x24')],_0xb383('0x1b')));_0xd73712[_0xb383('0x32')](db[_0xb383('0x1a')][_0xb383('0x12')](queryAgents));break;case _0xb383('0x7'):_0xbc2784[_0x127d1b](_0xb383('0x2f'));_0xbc2784[_0x127d1b](_0xb383('0x30'));_0xd73712[_0xb383('0x32')](_0x10ea31[_0xb383('0x3c')]({'attributes':['id','name']}));_0xd73712[_0xb383('0x32')](_0x10ea31[_0xb383('0x3d')]({'attributes':['id',_0xb383('0x5')]}));_0xd73712['push'](_0x10ea31[_0xb383('0x3e')]({'attributes':['id',_0xb383('0x5')]}));_0xd73712[_0xb383('0x32')](_0x10ea31['getSmsQueues']({'attributes':['id','name']}));_0xd73712[_0xb383('0x32')](_0x10ea31[_0xb383('0x3f')]({'attributes':['id','name']}));_0xd73712[_0xb383('0x32')](_0x10ea31[_0xb383('0x40')]({'attributes':['id',_0xb383('0x5')]}));_0xd73712[_0xb383('0x32')](_0x10ea31[_0xb383('0x41')]({'attributes':['id',_0xb383('0x5')]}));break;}return BPromise['all'](_0xd73712);}})[_0xb383('0x18')](function(_0x380707){if(_0x380707&&_0x380707['length']){for(var _0x54ce6d=0x0;_0x54ce6d<_0x380707[_0xb383('0x1f')];_0x54ce6d+=0x1){for(var _0x5636f6=0x0;_0x5636f6<_0x380707[_0x54ce6d][_0xb383('0x1f')];_0x5636f6+=0x1){switch(_0x54ce6d){case 0x0:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x42'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x1:joinOrLeaveQueues(_0xbc2784,_0x127d1b,'chat',_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x2:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x43'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x3:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x44'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x4:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x45'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x5:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x46'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x6:joinOrLeaveQueues(_0xbc2784,_0x127d1b,_0xb383('0x47'),_0x380707[_0x54ce6d][_0x5636f6]);break;case 0x7:if(_0x38d029[_0xb383('0x6')]!=='agent')_0xbc2784[_0x127d1b](util['format'](_0xb383('0x48'),_0x380707[_0x54ce6d][_0x5636f6]['name']));break;case 0x8:if(_0x38d029[_0xb383('0x6')]!==_0xb383('0x7'))_0xbc2784[_0x127d1b](util['format'](_0xb383('0x49'),_0x380707[_0x54ce6d][_0x5636f6]['name']));break;case 0x9:if(_0x38d029['role']!=='agent')_0xbc2784[_0x127d1b](util[_0xb383('0x1e')]('campaign:%s:%s',_0x380707[_0x54ce6d][_0x5636f6][_0xb383('0x9')],_0x380707[_0x54ce6d][_0x5636f6]['name']));break;case 0xa:_0xbc2784[_0x127d1b](util[_0xb383('0x1e')](_0xb383('0x20'),_0x380707[_0x54ce6d][_0x5636f6]['name']));break;}}}}})['then'](function(){if(_0x127d1b===_0xb383('0x4a')){var _0x492614=_[_0xb383('0x19')](_0x38d029[_0xb383('0x26')],'id');return _0x38d029['removeChatInteractions'](_0x492614)[_0xb383('0x18')](function(){for(var _0x304fd0=0x0;_0x304fd0<_0x492614[_0xb383('0x1f')];_0x304fd0+=0x1){_0x306dd7[_0xb383('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x492614[_0x304fd0]),'UserId':Number(_0x38d029['id'])});}});}})[_0xb383('0x18')](function(){if(_0x127d1b===_0xb383('0x4a')){var _0x2124d5=_['map'](_0x38d029[_0xb383('0x28')],'id');return _0x38d029[_0xb383('0x4c')](_0x2124d5)['then'](function(){for(var _0x5b00d0=0x0;_0x5b00d0<_0x2124d5[_0xb383('0x1f')];_0x5b00d0+=0x1){_0x306dd7[_0xb383('0x4b')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x2124d5[_0x5b00d0]),'UserId':Number(_0x38d029['id'])});}});}})[_0xb383('0x18')](function(){if(_0x127d1b===_0xb383('0x4a')){var _0x17fd52=_[_0xb383('0x19')](_0x38d029[_0xb383('0x2a')],'id');return _0x38d029[_0xb383('0x4d')](_0x17fd52)[_0xb383('0x18')](function(){for(var _0x57a70b=0x0;_0x57a70b<_0x17fd52[_0xb383('0x1f')];_0x57a70b+=0x1){_0x306dd7[_0xb383('0x4b')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x17fd52[_0x57a70b]),'UserId':Number(_0x38d029['id'])});}});}})['then'](function(){if(_0x127d1b===_0xb383('0x4a')){var _0x1288b6=_[_0xb383('0x19')](_0x38d029[_0xb383('0x2b')],'id');return _0x38d029[_0xb383('0x4e')](_0x1288b6)[_0xb383('0x18')](function(){for(var _0x269b1b=0x0;_0x269b1b<_0x1288b6[_0xb383('0x1f')];_0x269b1b+=0x1){_0x306dd7[_0xb383('0x4b')](_0xb383('0x4f'),{'SmsInteractionId':Number(_0x1288b6[_0x269b1b]),'UserId':Number(_0x38d029['id'])});}});}})[_0xb383('0x18')](function(){if(_0x127d1b==='leave'){var _0x434f68=_['map'](_0x38d029[_0xb383('0x2d')],'id');return _0x38d029[_0xb383('0x50')](_0x434f68)[_0xb383('0x18')](function(){for(var _0x396e56=0x0;_0x396e56<_0x434f68[_0xb383('0x1f')];_0x396e56+=0x1){_0x306dd7[_0xb383('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x434f68[_0x396e56]),'UserId':Number(_0x38d029['id'])});}});}})[_0xb383('0x18')](function(){if(_0x127d1b===_0xb383('0x4a')){var _0x3ce501=_[_0xb383('0x19')](_0x38d029['WhatsappInteractions'],'id');return _0x38d029[_0xb383('0x51')](_0x3ce501)[_0xb383('0x18')](function(){for(var _0xf9d15b=0x0;_0xf9d15b<_0x3ce501[_0xb383('0x1f')];_0xf9d15b+=0x1){_0x306dd7[_0xb383('0x4b')](_0xb383('0x52'),{'WhatsappInteractionId':Number(_0x3ce501[_0xf9d15b]),'UserId':Number(_0x38d029['id'])});}});}})[_0xb383('0x53')](function(_0x32c1f6){_0xbc2784[_0xb383('0x54')](_0x32c1f6);});}}function onDisconnect(_0x5ded6b,_0x2decf4){joinOrLeave(_0x5ded6b,_0xb383('0x4a'),_0x2decf4);}function onConnect(_0x1115c4){joinOrLeave(_0x1115c4,_0xb383('0x55'));}exports[_0xb383('0x56')]=function(_0x410273){_0x410273['on'](_0xb383('0x57'),function(_0x5e7280){_0x5e7280[_0xb383('0x58')](0x0);_0x5e7280[_0xb383('0x59')]=_0x5e7280[_0xb383('0x5a')][_0xb383('0x57')][_0xb383('0x5b')]+':'+_0x5e7280['request'][_0xb383('0x57')][_0xb383('0x5c')];_0x5e7280[_0xb383('0x5d')]=new Date();_0x5e7280[_0xb383('0x54')]=function(_0x66f6a5){console[_0xb383('0x54')](_0xb383('0x5e')+_0x5e7280['nsp'][_0xb383('0x5')]+'['+_0x5e7280[_0xb383('0x59')]+']',_0x66f6a5);};_0x5e7280['on'](_0xb383('0x5f'),function(){onDisconnect(_0x5e7280,_0x410273);_0x5e7280['log']('DISCONNECTED');});onConnect(_0x5e7280);_0x5e7280[_0xb383('0x54')]('CONNECTED');});};
\ No newline at end of file
index d6bd86d..6b2da9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c83=['OpenchannelInteraction','EventManager','then','info','Trigger,\x20%s','error','get','channel','motionChannel','event','direction','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize','SELECT','UserId','interface','format','name','agent','outgoingmessage','catch','AfterCreateMessage','offlineMessage','opened','contact','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','internal','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','client','ChatInteraction','afterCreate','afterUpdate','closedinteraction','Chat','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','newinteraction','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel'];(function(_0x369c34,_0x52b12c){var _0x3f951f=function(_0x32644f){while(--_0x32644f){_0x369c34['push'](_0x369c34['shift']());}};_0x3f951f(++_0x52b12c);}(_0x3c83,0x157));var _0x33c8=function(_0xd2cea9,_0x1f95c3){_0xd2cea9=_0xd2cea9-0x0;var _0xb5943e=_0x3c83[_0xd2cea9];return _0xb5943e;};'use strict';var util=require('util');var db=require(_0x33c8('0x0'))['db'];var jayson=require(_0x33c8('0x1'));var logger=require(_0x33c8('0x2'))(_0x33c8('0x3'));var client=jayson[_0x33c8('0x4')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x33c8('0x5'),'event':_0x33c8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':'Chat','model':_0x33c8('0x5'),'event':_0x33c8('0x7'),'condition':_0x33c8('0x8'),'callback':afterUpdate},{'channel':_0x33c8('0x9'),'model':_0x33c8('0xa'),'event':_0x33c8('0x6'),'condition':_0x33c8('0xb'),'callback':afterCreateMessage},{'channel':_0x33c8('0x9'),'model':_0x33c8('0xc'),'event':_0x33c8('0x6'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0x33c8('0xd'),'model':_0x33c8('0xe'),'event':_0x33c8('0x6'),'condition':_0x33c8('0xf'),'callback':afterCreate},{'channel':'Sms','model':_0x33c8('0xe'),'event':_0x33c8('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x33c8('0x10'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x33c8('0x11'),'model':_0x33c8('0x12'),'event':_0x33c8('0x6'),'condition':_0x33c8('0xf'),'callback':afterCreate},{'channel':_0x33c8('0x11'),'model':'WhatsappInteraction','event':_0x33c8('0x7'),'condition':_0x33c8('0x8'),'callback':afterUpdate},{'channel':_0x33c8('0x11'),'model':_0x33c8('0x13'),'event':_0x33c8('0x6'),'condition':_0x33c8('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0x33c8('0x6'),'condition':_0x33c8('0xf'),'callback':afterCreate},{'channel':_0x33c8('0x14'),'model':_0x33c8('0x15'),'event':_0x33c8('0x7'),'condition':_0x33c8('0x8'),'callback':afterUpdate},{'channel':_0x33c8('0x14'),'model':_0x33c8('0x16'),'event':_0x33c8('0x6'),'condition':_0x33c8('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':_0x33c8('0x17'),'event':_0x33c8('0x6'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x33c8('0x18'),'model':_0x33c8('0x17'),'event':_0x33c8('0x7'),'condition':_0x33c8('0x8'),'callback':afterUpdate},{'channel':'Mail','model':_0x33c8('0x19'),'event':_0x33c8('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x33c8('0x1a'),'model':'OpenchannelInteraction','event':_0x33c8('0x6'),'condition':_0x33c8('0xf'),'callback':afterCreate},{'channel':_0x33c8('0x1a'),'model':_0x33c8('0x1b'),'event':_0x33c8('0x7'),'condition':_0x33c8('0x8'),'callback':afterUpdate},{'channel':_0x33c8('0x1a'),'model':'OpenchannelMessage','event':_0x33c8('0x6'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x594157){return client['request'](_0x33c8('0x1c'),_0x594157)[_0x33c8('0x1d')](function(_0x1eaf51){logger[_0x33c8('0x1e')](_0x33c8('0x1f'),'EventManager',_0x1eaf51);if(_0x1eaf51[_0x33c8('0x20')]){if(_0x1eaf51[_0x33c8('0x20')]['code']===0x1f4){logger[_0x33c8('0x20')](_0x33c8('0x1f'),_0x33c8('0x1c'),_0x1eaf51[_0x33c8('0x20')]);}}})['catch'](function(_0x1b46f2){logger[_0x33c8('0x20')]('Trigger,\x20%s',_0x33c8('0x1c'),_0x1b46f2);});}function afterCreateMessage(_0x12081d){return function(_0x2ab519){_0x2ab519=_0x2ab519[_0x33c8('0x21')]({'plain':!![]});_0x2ab519[_0x33c8('0x22')]=_0x12081d;_0x2ab519[_0x33c8('0x23')]=_0x12081d;_0x2ab519[_0x33c8('0x24')]=_0x2ab519[_0x33c8('0x25')];Promise['resolve']()[_0x33c8('0x1d')](function(){if(typeof _0x2ab519[_0x33c8('0x26')]===_0x33c8('0x27'))return null;var _0x2ef6a4=_0x33c8('0x28')+_0x2ab519[_0x33c8('0x26')];return db[_0x33c8('0x29')][_0x33c8('0x2a')](_0x2ef6a4,{'type':db[_0x33c8('0x2b')]['QueryTypes'][_0x33c8('0x2c')],'raw':!![]});})[_0x33c8('0x1d')](function(_0x249740){if(_0x249740){_0x2ab519['contact']=_0x249740[0x0];}if(typeof _0x2ab519[_0x33c8('0x2d')]===_0x33c8('0x27'))return;return getAgent(_0x2ab519[_0x33c8('0x2d')]);})[_0x33c8('0x1d')](function(_0xd477b0){if(_0xd477b0){_0x2ab519[_0x33c8('0x2e')]=util[_0x33c8('0x2f')]('SIP/%s',_0xd477b0[_0x33c8('0x30')]);_0x2ab519[_0x33c8('0x31')]=_0xd477b0;_0x2ab519['channel']=_0x12081d;return request({'event':'incomingmessage','message':_0x2ab519});}else{return request({'event':_0x33c8('0x32'),'message':_0x2ab519});}})[_0x33c8('0x33')](function(_0x59312b){logger['error'](_0x33c8('0x1f'),_0x33c8('0x34'),_0x59312b);});};}function afterCreateOfflineMessage(_0x3d5a9e){return function(_0x166306){_0x166306=_0x166306[_0x33c8('0x21')]({'plain':!![]});_0x166306[_0x33c8('0x22')]=_0x3d5a9e;_0x166306['motionChannel']=_0x3d5a9e;_0x166306['event']=_0x33c8('0x35');return request({'event':_0x166306[_0x33c8('0x24')],'message':_0x166306});};}function afterCreate(_0x1c2f9e,_0x4294f4){return function(_0x2bf8b5){_0x2bf8b5=_0x2bf8b5[_0x33c8('0x21')]({'plain':!![]});_0x2bf8b5[_0x33c8('0x22')]=_0x1c2f9e;_0x2bf8b5['motionChannel']=_0x1c2f9e;_0x2bf8b5[_0x33c8('0x24')]=_0x33c8('0x36');Promise['resolve']()[_0x33c8('0x1d')](function(){var _0x2f0e87=_0x33c8('0x28')+_0x2bf8b5[_0x33c8('0x26')];return db[_0x33c8('0x29')][_0x33c8('0x2a')](_0x2f0e87,{'type':db[_0x33c8('0x2b')]['QueryTypes'][_0x33c8('0x2c')],'raw':!![]});})[_0x33c8('0x1d')](function(_0x17ac06){if(_0x17ac06){_0x2bf8b5[_0x33c8('0x37')]=_0x17ac06[0x0];}if(typeof _0x2bf8b5['UserId']===_0x33c8('0x27'))return;return getAgent(_0x2bf8b5[_0x33c8('0x2d')]);})[_0x33c8('0x1d')](function(_0x44fcfd){if(_0x44fcfd){_0x2bf8b5[_0x33c8('0x2e')]=util[_0x33c8('0x2f')](_0x33c8('0x38'),_0x44fcfd[_0x33c8('0x30')]);_0x2bf8b5[_0x33c8('0x31')]=_0x44fcfd;}return request({'event':_0x4294f4,'message':_0x2bf8b5});})[_0x33c8('0x33')](function(_0x459a52){logger[_0x33c8('0x20')]('Trigger,\x20%s',_0x33c8('0x39'),_0x459a52);});};}function afterUpdate(_0x417e39){return function(_0x45ebbb){var _0x455d07=_0x45ebbb[_0x33c8('0x3a')](_0x33c8('0x3b'))&&_0x45ebbb[_0x33c8('0x3b')];var _0x64b14a=_0x45ebbb['changed'](_0x33c8('0x3c'));if(_0x455d07||_0x64b14a){var _0x206e65=_0x455d07?_0x33c8('0x8'):'substatus';var _0x312b37=_0x45ebbb[_0x33c8('0x21')]({'plain':!![]});_0x312b37[_0x33c8('0x22')]=_0x417e39;_0x312b37[_0x33c8('0x23')]=_0x417e39;_0x312b37['event']=_0x455d07?'closed':_0x33c8('0x3c');var _0x3397cc='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x312b37[_0x33c8('0x26')];return db[_0x33c8('0x29')][_0x33c8('0x2a')](_0x3397cc,{'type':db[_0x33c8('0x2b')]['QueryTypes'][_0x33c8('0x2c')],'raw':!![]})[_0x33c8('0x1d')](function(_0x3f4ee4){if(_0x3f4ee4){_0x312b37['contact']=_0x3f4ee4[0x0];}if(typeof _0x312b37[_0x33c8('0x2d')]===_0x33c8('0x27'))return;return getAgent(_0x312b37[_0x33c8('0x2d')]);})[_0x33c8('0x1d')](function(_0x40c9c3){if(_0x40c9c3){_0x312b37[_0x33c8('0x2e')]=util[_0x33c8('0x2f')](_0x33c8('0x38'),_0x40c9c3[_0x33c8('0x30')]);_0x312b37[_0x33c8('0x31')]=_0x40c9c3;}return request({'event':_0x206e65,'message':_0x312b37});})[_0x33c8('0x33')](function(_0x3fa3ed){logger['error']('Trigger,\x20%s',_0x33c8('0x3d'),_0x3fa3ed);});}};}function getAgent(_0x1cb34b){return db[_0x33c8('0x3e')][_0x33c8('0x3f')]({'where':{'id':_0x1cb34b},'attributes':['id',_0x33c8('0x30'),_0x33c8('0x40'),_0x33c8('0x41'),_0x33c8('0x42')],'raw':!![]})[_0x33c8('0x1d')](function(_0x32f224){return _0x32f224;});}exports['default']=function(){for(var _0x247c75=0x0;_0x247c75<triggers[_0x33c8('0x43')];_0x247c75+=0x1){if(db[_0x33c8('0x44')](triggers[_0x247c75][_0x33c8('0x45')])){db[triggers[_0x247c75][_0x33c8('0x45')]][_0x33c8('0x46')](triggers[_0x247c75][_0x33c8('0x24')],triggers[_0x247c75][_0x33c8('0x47')](triggers[_0x247c75]['channel'][_0x33c8('0x48')](),triggers[_0x247c75][_0x33c8('0x49')]));}}};
\ No newline at end of file
+var _0x5c3a=['newmessage','SmsInteraction','Sms','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','OpenchannelInteraction','OpenchannelMessage','request','then','info','EventManager','error','code','Trigger,\x20%s','catch','get','channel','event','direction','resolve','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','UserId','format','SIP/%s','name','incomingmessage','outgoingmessage','AfterCreateMessage','motionChannel','offlineMessage','opened','sequelize','query','Sequelize','undefined','interface','agent','closed','substatus','AfterUpdate','User','find','fullname','length','model','toLowerCase','util','../../mysqldb','jayson/promise','../logger','triggers','http','ChatInteraction','afterCreate','newinteraction','Chat','afterUpdate','closedinteraction','ChatMessage','ChatOfflineMessage'];(function(_0x5c8e2a,_0x51f588){var _0x2f4011=function(_0x591117){while(--_0x591117){_0x5c8e2a['push'](_0x5c8e2a['shift']());}};_0x2f4011(++_0x51f588);}(_0x5c3a,0xc4));var _0xa5c3=function(_0x390a3c,_0x4c9fd5){_0x390a3c=_0x390a3c-0x0;var _0x46fdbe=_0x5c3a[_0x390a3c];return _0x46fdbe;};'use strict';var util=require(_0xa5c3('0x0'));var db=require(_0xa5c3('0x1'))['db'];var jayson=require(_0xa5c3('0x2'));var logger=require(_0xa5c3('0x3'))(_0xa5c3('0x4'));var client=jayson['client'][_0xa5c3('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xa5c3('0x6'),'event':_0xa5c3('0x7'),'condition':_0xa5c3('0x8'),'callback':afterCreate},{'channel':_0xa5c3('0x9'),'model':_0xa5c3('0x6'),'event':_0xa5c3('0xa'),'condition':_0xa5c3('0xb'),'callback':afterUpdate},{'channel':_0xa5c3('0x9'),'model':_0xa5c3('0xc'),'event':_0xa5c3('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Chat','model':_0xa5c3('0xd'),'event':_0xa5c3('0x7'),'condition':_0xa5c3('0xe'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0xa5c3('0xf'),'event':_0xa5c3('0x7'),'condition':_0xa5c3('0x8'),'callback':afterCreate},{'channel':'Sms','model':_0xa5c3('0xf'),'event':_0xa5c3('0xa'),'condition':_0xa5c3('0xb'),'callback':afterUpdate},{'channel':_0xa5c3('0x10'),'model':'SmsMessage','event':_0xa5c3('0x7'),'condition':_0xa5c3('0xe'),'callback':afterCreateMessage},{'channel':_0xa5c3('0x11'),'model':_0xa5c3('0x12'),'event':_0xa5c3('0x7'),'condition':_0xa5c3('0x8'),'callback':afterCreate},{'channel':_0xa5c3('0x11'),'model':_0xa5c3('0x12'),'event':'afterUpdate','condition':_0xa5c3('0xb'),'callback':afterUpdate},{'channel':_0xa5c3('0x11'),'model':'WhatsappMessage','event':_0xa5c3('0x7'),'condition':_0xa5c3('0xe'),'callback':afterCreateMessage},{'channel':_0xa5c3('0x13'),'model':'FaxInteraction','event':'afterCreate','condition':_0xa5c3('0x8'),'callback':afterCreate},{'channel':_0xa5c3('0x13'),'model':_0xa5c3('0x14'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0xa5c3('0x15'),'event':'afterCreate','condition':_0xa5c3('0xe'),'callback':afterCreateMessage},{'channel':'Mail','model':_0xa5c3('0x16'),'event':_0xa5c3('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa5c3('0x17'),'model':'MailInteraction','event':'afterUpdate','condition':_0xa5c3('0xb'),'callback':afterUpdate},{'channel':_0xa5c3('0x17'),'model':_0xa5c3('0x18'),'event':_0xa5c3('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterCreate','condition':_0xa5c3('0x8'),'callback':afterCreate},{'channel':'Openchannel','model':_0xa5c3('0x19'),'event':_0xa5c3('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xa5c3('0x1a'),'event':_0xa5c3('0x7'),'condition':_0xa5c3('0xe'),'callback':afterCreateMessage}];function request(_0x2ae727){return client[_0xa5c3('0x1b')]('EventManager',_0x2ae727)[_0xa5c3('0x1c')](function(_0x5c5f16){logger[_0xa5c3('0x1d')]('Trigger,\x20%s',_0xa5c3('0x1e'),_0x5c5f16);if(_0x5c5f16[_0xa5c3('0x1f')]){if(_0x5c5f16[_0xa5c3('0x1f')][_0xa5c3('0x20')]===0x1f4){logger['error'](_0xa5c3('0x21'),_0xa5c3('0x1e'),_0x5c5f16[_0xa5c3('0x1f')]);}}})[_0xa5c3('0x22')](function(_0x115e94){logger[_0xa5c3('0x1f')]('Trigger,\x20%s',_0xa5c3('0x1e'),_0x115e94);});}function afterCreateMessage(_0x260c65){return function(_0x17f498){_0x17f498=_0x17f498[_0xa5c3('0x23')]({'plain':!![]});_0x17f498[_0xa5c3('0x24')]=_0x260c65;_0x17f498['motionChannel']=_0x260c65;_0x17f498[_0xa5c3('0x25')]=_0x17f498[_0xa5c3('0x26')];Promise[_0xa5c3('0x27')]()[_0xa5c3('0x1c')](function(){if(typeof _0x17f498['ContactId']==='undefined')return null;var _0x33f9c5=_0xa5c3('0x28')+_0x17f498[_0xa5c3('0x29')];return db['sequelize']['query'](_0x33f9c5,{'type':db['Sequelize'][_0xa5c3('0x2a')][_0xa5c3('0x2b')],'raw':!![]});})[_0xa5c3('0x1c')](function(_0x3f21a1){if(_0x3f21a1){_0x17f498[_0xa5c3('0x2c')]=_0x3f21a1[0x0];}if(typeof _0x17f498[_0xa5c3('0x2d')]==='undefined')return;return getAgent(_0x17f498[_0xa5c3('0x2d')]);})['then'](function(_0x19adc5){if(_0x19adc5){_0x17f498['interface']=util[_0xa5c3('0x2e')](_0xa5c3('0x2f'),_0x19adc5[_0xa5c3('0x30')]);_0x17f498['agent']=_0x19adc5;_0x17f498[_0xa5c3('0x24')]=_0x260c65;return request({'event':_0xa5c3('0x31'),'message':_0x17f498});}else{return request({'event':_0xa5c3('0x32'),'message':_0x17f498});}})[_0xa5c3('0x22')](function(_0x52b08f){logger[_0xa5c3('0x1f')](_0xa5c3('0x21'),_0xa5c3('0x33'),_0x52b08f);});};}function afterCreateOfflineMessage(_0xfe6a15){return function(_0x505e8b){_0x505e8b=_0x505e8b[_0xa5c3('0x23')]({'plain':!![]});_0x505e8b[_0xa5c3('0x24')]=_0xfe6a15;_0x505e8b[_0xa5c3('0x34')]=_0xfe6a15;_0x505e8b[_0xa5c3('0x25')]=_0xa5c3('0x35');return request({'event':_0x505e8b[_0xa5c3('0x25')],'message':_0x505e8b});};}function afterCreate(_0x1cdd5a,_0x1d61c5){return function(_0x121467){_0x121467=_0x121467['get']({'plain':!![]});_0x121467['channel']=_0x1cdd5a;_0x121467['motionChannel']=_0x1cdd5a;_0x121467[_0xa5c3('0x25')]=_0xa5c3('0x36');Promise['resolve']()[_0xa5c3('0x1c')](function(){var _0x2e9fb2=_0xa5c3('0x28')+_0x121467[_0xa5c3('0x29')];return db[_0xa5c3('0x37')][_0xa5c3('0x38')](_0x2e9fb2,{'type':db[_0xa5c3('0x39')]['QueryTypes'][_0xa5c3('0x2b')],'raw':!![]});})[_0xa5c3('0x1c')](function(_0x434042){if(_0x434042){_0x121467[_0xa5c3('0x2c')]=_0x434042[0x0];}if(typeof _0x121467[_0xa5c3('0x2d')]===_0xa5c3('0x3a'))return;return getAgent(_0x121467[_0xa5c3('0x2d')]);})['then'](function(_0x57c160){if(_0x57c160){_0x121467[_0xa5c3('0x3b')]=util[_0xa5c3('0x2e')]('SIP/%s',_0x57c160[_0xa5c3('0x30')]);_0x121467[_0xa5c3('0x3c')]=_0x57c160;}return request({'event':_0x1d61c5,'message':_0x121467});})['catch'](function(_0x33c6a2){logger[_0xa5c3('0x1f')](_0xa5c3('0x21'),'AfterCreate',_0x33c6a2);});};}function afterUpdate(_0x383142){return function(_0x1fed17){var _0x237184=_0x1fed17['changed'](_0xa5c3('0x3d'))&&_0x1fed17[_0xa5c3('0x3d')];var _0x502f93=_0x1fed17['changed'](_0xa5c3('0x3e'));if(_0x237184||_0x502f93){var _0x3007da=_0x237184?_0xa5c3('0xb'):_0xa5c3('0x3e');var _0x24cacd=_0x1fed17[_0xa5c3('0x23')]({'plain':!![]});_0x24cacd[_0xa5c3('0x24')]=_0x383142;_0x24cacd[_0xa5c3('0x34')]=_0x383142;_0x24cacd[_0xa5c3('0x25')]=_0x237184?_0xa5c3('0x3d'):_0xa5c3('0x3e');var _0x17494b=_0xa5c3('0x28')+_0x24cacd[_0xa5c3('0x29')];return db[_0xa5c3('0x37')][_0xa5c3('0x38')](_0x17494b,{'type':db[_0xa5c3('0x39')][_0xa5c3('0x2a')][_0xa5c3('0x2b')],'raw':!![]})['then'](function(_0x3acea9){if(_0x3acea9){_0x24cacd[_0xa5c3('0x2c')]=_0x3acea9[0x0];}if(typeof _0x24cacd[_0xa5c3('0x2d')]===_0xa5c3('0x3a'))return;return getAgent(_0x24cacd[_0xa5c3('0x2d')]);})[_0xa5c3('0x1c')](function(_0x195de3){if(_0x195de3){_0x24cacd[_0xa5c3('0x3b')]=util[_0xa5c3('0x2e')]('SIP/%s',_0x195de3[_0xa5c3('0x30')]);_0x24cacd['agent']=_0x195de3;}return request({'event':_0x3007da,'message':_0x24cacd});})[_0xa5c3('0x22')](function(_0x26e619){logger['error']('Trigger,\x20%s',_0xa5c3('0x3f'),_0x26e619);});}};}function getAgent(_0x350660){return db[_0xa5c3('0x40')][_0xa5c3('0x41')]({'where':{'id':_0x350660},'attributes':['id',_0xa5c3('0x30'),_0xa5c3('0x42'),'email','internal'],'raw':!![]})[_0xa5c3('0x1c')](function(_0x23b1df){return _0x23b1df;});}exports['default']=function(){for(var _0x4dbe06=0x0;_0x4dbe06<triggers[_0xa5c3('0x43')];_0x4dbe06+=0x1){if(db['hasOwnProperty'](triggers[_0x4dbe06][_0xa5c3('0x44')])){db[triggers[_0x4dbe06][_0xa5c3('0x44')]]['hook'](triggers[_0x4dbe06][_0xa5c3('0x25')],triggers[_0x4dbe06]['callback'](triggers[_0x4dbe06][_0xa5c3('0x24')][_0xa5c3('0x45')](),triggers[_0x4dbe06]['condition']));}}};
\ No newline at end of file
index 5d129ef..87cfb8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8552=['getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','../mysqldb','./license/util','voice','chat','sms','whatsapp','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes'];(function(_0x1e8f35,_0x3db390){var _0x446c13=function(_0xa1e11e){while(--_0xa1e11e){_0x1e8f35['push'](_0x1e8f35['shift']());}};_0x446c13(++_0x3db390);}(_0x8552,0xfb));var _0x2855=function(_0x5449e6,_0x5f4d60){_0x5449e6=_0x5449e6-0x0;var _0x3d12e8=_0x8552[_0x5449e6];return _0x3d12e8;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x2855('0x0'))['db'];var util=require(_0x2855('0x1'));var channels=[_0x2855('0x2'),'mail',_0x2855('0x3'),'fax',_0x2855('0x4'),_0x2855('0x5'),'openchannel'];exports[_0x2855('0x6')]=function(){return channels;};exports['isValidChannel']=function(_0x18de86){_0x18de86=_0x18de86[_0x2855('0x7')]();return _[_0x2855('0x8')](channels,_0x18de86);};exports[_0x2855('0x9')]=function(_0x1a6304,_0x34f19c,_0x3f03be,_0x3548cb){var _0x7dd345={'loginAttempts':_0x34f19c,'blocked':_0x3f03be};if(!_[_0x2855('0xa')](_0x3548cb)){_0x7dd345[_0x2855('0xb')]=_0x3548cb;}return _0x1a6304[_0x2855('0xc')](_0x7dd345);};exports[_0x2855('0xd')]=function(_0x4ba0aa){return new BPromise(function(_0x4181e2,_0x4816ed){var _0x4e2c6b=0x0;if(_0x4ba0aa[_0x2855('0xe')]!=='agent'){_0x4181e2(_0x4ba0aa);}db[_0x2855('0xf')][_0x2855('0x10')]({'where':{'role':_0x2855('0x11'),'online':!![],'id':{'$ne':_0x4ba0aa['id']}}})[_0x2855('0x12')](function(_0x587d06){_0x4e2c6b=_0x587d06;return util[_0x2855('0xd')]();})[_0x2855('0x12')](function(_0xd0027a){if(_0xd0027a&&_0xd0027a[_0x2855('0x13')]&&_0x4e2c6b>=_0xd0027a[_0x2855('0x13')]){throw Error(_0x2855('0x14'));}_0x4181e2(_0x4ba0aa);})[_0x2855('0x15')](function(_0x40d478){_0x4816ed(_0x40d478);});});};
\ No newline at end of file
+var _0xf823=['agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','fax','whatsapp','getChannels','isValidChannel','includes','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','then'];(function(_0x36b053,_0x3bbcde){var _0x2844db=function(_0x178957){while(--_0x178957){_0x36b053['push'](_0x36b053['shift']());}};_0x2844db(++_0x3bbcde);}(_0xf823,0xa2));var _0x3f82=function(_0x5170b4,_0x5a3dcf){_0x5170b4=_0x5170b4-0x0;var _0x5f45ee=_0xf823[_0x5170b4];return _0x5f45ee;};'use strict';var _=require(_0x3f82('0x0'));var BPromise=require(_0x3f82('0x1'));var db=require(_0x3f82('0x2'))['db'];var util=require(_0x3f82('0x3'));var channels=[_0x3f82('0x4'),'mail','chat',_0x3f82('0x5'),'sms',_0x3f82('0x6'),'openchannel'];exports[_0x3f82('0x7')]=function(){return channels;};exports[_0x3f82('0x8')]=function(_0x547a4f){_0x547a4f=_0x547a4f['toLowerCase']();return _[_0x3f82('0x9')](channels,_0x547a4f);};exports['clearBlockUser']=function(_0xd68358,_0x3f1ad3,_0x54b618,_0x2dcb62){var _0x54bcb5={'loginAttempts':_0x3f1ad3,'blocked':_0x54b618};if(!_[_0x3f82('0xa')](_0x2dcb62)){_0x54bcb5[_0x3f82('0xb')]=_0x2dcb62;}return _0xd68358[_0x3f82('0xc')](_0x54bcb5);};exports[_0x3f82('0xd')]=function(_0x21ca23){return new BPromise(function(_0x5bb727,_0x5ad54c){var _0x5ac623=0x0;if(_0x21ca23[_0x3f82('0xe')]!==_0x3f82('0xf')){_0x5bb727(_0x21ca23);}db[_0x3f82('0x10')]['count']({'where':{'role':_0x3f82('0xf'),'online':!![],'id':{'$ne':_0x21ca23['id']}}})[_0x3f82('0x11')](function(_0x1fcae0){_0x5ac623=_0x1fcae0;return util[_0x3f82('0xd')]();})[_0x3f82('0x11')](function(_0x580f9b){if(_0x580f9b&&_0x580f9b['agents']&&_0x5ac623>=_0x580f9b[_0x3f82('0x12')]){throw Error(_0x3f82('0x13'));}_0x5bb727(_0x21ca23);})['catch'](function(_0x4b3488){_0x5ad54c(_0x4b3488);});});};
\ No newline at end of file
index 94137fb..d21e215 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['Not\x20Found','error','stack','send','exports','api','message','name','Error','Bad\x20Request','Forbidden','OutOfInterval'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a7112,_0x1f9492){_0x5a7112=_0x5a7112-0x0;var _0x3147f7=_0xcb91[_0x5a7112];return _0x3147f7;};'use strict';var util=require('util');var logger=require('../config/logger')(_0x1cb9('0x0'));var APIError=function(_0xe4a5bf,_0x17d4ec){this[_0x1cb9('0x1')]=_0xe4a5bf||'Internal\x20Server\x20Error';this[_0x1cb9('0x2')]=_0x17d4ec||_0x1cb9('0x3');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x13d5fd){this[_0x1cb9('0x1')]=_0x13d5fd||'Bad\x20Request';this[_0x1cb9('0x2')]=_0x1cb9('0x4');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x38737d){this[_0x1cb9('0x1')]=_0x38737d||'Entity\x20not\x20found';this[_0x1cb9('0x2')]='Not\x20Found';util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x45a12f){switch(_0x45a12f){case _0x1cb9('0x4'):return 0x190;case _0x1cb9('0x5'),_0x1cb9('0x6'):return 0x193;case _0x1cb9('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x50ce71){return function(_0x9b58f1){logger[_0x1cb9('0x8')](_0x9b58f1[_0x1cb9('0x9')]);var _0x3fdd83=getStatusCode(_0x9b58f1[_0x1cb9('0x2')]);if(_0x9b58f1['name'])delete _0x9b58f1['name'];return _0x50ce71['status'](_0x3fdd83)[_0x1cb9('0xa')](_0x9b58f1);};}module[_0x1cb9('0xb')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
+var _0xb688=['status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','inherits','name','Entity\x20not\x20found','Not\x20Found','Bad\x20Request','Forbidden','OutOfInterval','error','stack'];(function(_0x582ccd,_0xa9ab43){var _0x11545d=function(_0x4010fa){while(--_0x4010fa){_0x582ccd['push'](_0x582ccd['shift']());}};_0x11545d(++_0xa9ab43);}(_0xb688,0xcf));var _0x8b68=function(_0x49776c,_0x2e6c6d){_0x49776c=_0x49776c-0x0;var _0x20c2ef=_0xb688[_0x49776c];return _0x20c2ef;};'use strict';var util=require('util');var logger=require(_0x8b68('0x0'))(_0x8b68('0x1'));var APIError=function(_0x266285,_0x1080e8){this[_0x8b68('0x2')]=_0x266285||_0x8b68('0x3');this['name']=_0x1080e8||_0x8b68('0x4');util[_0x8b68('0x5')](APIError,Error);};var APIBadRequestError=function(_0x30f33d){this[_0x8b68('0x2')]=_0x30f33d||'Bad\x20Request';this[_0x8b68('0x6')]='Bad\x20Request';util[_0x8b68('0x5')](APIBadRequestError,APIError);};var APINotFoundError=function(_0x2bbffd){this[_0x8b68('0x2')]=_0x2bbffd||_0x8b68('0x7');this[_0x8b68('0x6')]=_0x8b68('0x8');util[_0x8b68('0x5')](APINotFoundError,APIError);};function getStatusCode(_0x21d944){switch(_0x21d944){case _0x8b68('0x9'):return 0x190;case _0x8b68('0xa'),_0x8b68('0xb'):return 0x193;case _0x8b68('0x8'):return 0x194;default:return 0x1f4;}}function handleError(_0x2a852a){return function(_0x502727){logger[_0x8b68('0xc')](_0x502727[_0x8b68('0xd')]);var _0x5e76c=getStatusCode(_0x502727[_0x8b68('0x6')]);if(_0x502727[_0x8b68('0x6')])delete _0x502727[_0x8b68('0x6')];return _0x2a852a[_0x8b68('0xe')](_0x5e76c)[_0x8b68('0xf')](_0x502727);};}module[_0x8b68('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError};
\ No newline at end of file
index 370d4e5..570813b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1a9=['render','json','exports','404','status'];(function(_0x2cbfcc,_0x41c929){var _0x46dd12=function(_0x519978){while(--_0x519978){_0x2cbfcc['push'](_0x2cbfcc['shift']());}};_0x46dd12(++_0x41c929);}(_0xc1a9,0x16f));var _0x9c1a=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0xc1a9[_0x2ee790];return _0x5a54a5;};'use strict';module[_0x9c1a('0x0')][0x194]=function pageNotFound(_0x541c65,_0x531b71){var _0x3c9a9c=_0x9c1a('0x1');var _0x4f9c9a=0x194;var _0x42360e={'status':_0x4f9c9a};_0x531b71[_0x9c1a('0x2')](_0x42360e[_0x9c1a('0x2')]);_0x531b71[_0x9c1a('0x3')](_0x3c9a9c,{},function(_0xcfa60c,_0x336b07){if(_0xcfa60c){return _0x531b71[_0x9c1a('0x2')](_0x42360e[_0x9c1a('0x2')])[_0x9c1a('0x4')](_0x42360e);}_0x531b71['send'](_0x336b07);});};
\ No newline at end of file
+var _0x30c7=['send','exports','404','status'];(function(_0x57d5d4,_0x448276){var _0x5aae82=function(_0xd8064c){while(--_0xd8064c){_0x57d5d4['push'](_0x57d5d4['shift']());}};_0x5aae82(++_0x448276);}(_0x30c7,0x111));var _0x730c=function(_0x123a40,_0xd62943){_0x123a40=_0x123a40-0x0;var _0x51c366=_0x30c7[_0x123a40];return _0x51c366;};'use strict';module[_0x730c('0x0')][0x194]=function pageNotFound(_0x4db7df,_0x5008dc){var _0x2c82eb=_0x730c('0x1');var _0x5aa43a=0x194;var _0x47601e={'status':_0x5aa43a};_0x5008dc[_0x730c('0x2')](_0x47601e['status']);_0x5008dc['render'](_0x2c82eb,{},function(_0x4cf801,_0x5dc866){if(_0x4cf801){return _0x5008dc[_0x730c('0x2')](_0x47601e[_0x730c('0x2')])['json'](_0x47601e);}_0x5008dc[_0x730c('0x3')](_0x5dc866);});};
\ No newline at end of file
index cbcbf28..0ddee71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x742e=['../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','Variable','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','SmsTransferReport','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','UserId','UserSetting','userSetting','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','Extensions','HopperFinals','SmsInteractions','FaxInteraction','FaxInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','UserProfile','userProfileId','belongsToMany','ChatGroup','CmContact','Contacts','cm_user_has_contacts','CmList','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_fax_interactions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueue','MailQueues','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueues','FaxAccounts','user_has_fax_accounts','MailAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','SquareProject','SpiedAgents','cascade','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','VoiceQueue','Members','VoiceQueueId','CmHopper','Hoppers','CmHopperBlack','HopperBlacks','JscriptySessionReport','TrunkBackup','TrunkBackupId','mandatoryDispositionPauseId','Lists','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','Imap','Dispositions','Interactions','MailApplication','List','ListId','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','Agents','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','IntervalId','TagId','MailQueueReport','Items','FaxAccountId','Answers','Exntensions','fax_interaction_has_tags','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccount','SmsAccountId','SmsApplication','SmsInteractionId','Owner','sms_interaction_has_tags','UserSmsQueue','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelApplication','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','Interaction','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','chat_group_has_users','CmCompany','CompanyId','Phones','HopperHistories','JscriptySessions','Company','cm_contact_has_tags','AdditionalPhones','CmHopperId','CampaignId','OwnerId','All','AutomationAllId','Automation','Any','OneAny','AutomationAnyId','AutomationId','ParentId','Intervals','MailApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmContactHasItem','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','Actions','TriggerId','Fields','MetricId','Configurations','Subjects','SubjectId','SalesforceField','FieldId','AccountId','Subject','Description','DescriptionId','VariableId','SugarcrmField','Field','DeskAccount','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','ZendeskAccount','Descriptions','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerAccount','ChatQueueReport','FromId','ToId','SessionId','ProjectId','user_has_square_projects','WhatsappQueue','team_has_whatsapp_queues','TrunkId','SquareProjectId','campaigns_has_cm_lists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','Smtp','exports','sequelize','lodash','jstz','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerOut','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage'];(function(_0x321bbb,_0x1a8578){var _0x358e82=function(_0x55a2b0){while(--_0x55a2b0){_0x321bbb['push'](_0x321bbb['shift']());}};_0x358e82(++_0x1a8578);}(_0x742e,0x1b9));var _0xe742=function(_0x39a63b,_0x575649){_0x39a63b=_0x39a63b-0x0;var _0x28f200=_0x742e[_0x39a63b];return _0x28f200;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xe742('0x0'));var _=require(_0xe742('0x1'));var jstz=require(_0xe742('0x2'));var timezone=jstz['determine']();config['sequelize']=_[_0xe742('0x3')](config[_0xe742('0x0')],{'database':_0xe742('0x4'),'username':_0xe742('0x5'),'password':_0xe742('0x6'),'options':{'host':_0xe742('0x7'),'port':0xcea,'dialect':_0xe742('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe742('0x9')](),'define':{'charset':_0xe742('0xa'),'collate':_0xe742('0xb')}}});config['sequelizeHistory']=_[_0xe742('0x3')](config[_0xe742('0xc')],{'database':'motion2','username':_0xe742('0x5'),'password':_0xe742('0x6'),'options':{'host':_0xe742('0x7'),'port':0xcea,'dialect':_0xe742('0x8'),'dialectOptions':{'charset':_0xe742('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xe742('0xa'),'collate':_0xe742('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe742('0x0')][_0xe742('0xe')],config['sequelize'][_0xe742('0xf')],config['sequelize'][_0xe742('0x10')],config['sequelize'][_0xe742('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe742('0xc')][_0xe742('0xe')],config[_0xe742('0xc')][_0xe742('0xf')],config[_0xe742('0xc')]['password'],config[_0xe742('0xc')][_0xe742('0x11')])};db[_0xe742('0x12')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x14'));db['VoiceChanSpy']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xe742('0x15')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x16'));db[_0xe742('0x17')]=db[_0xe742('0x0')]['import'](_0xe742('0x18'));db['VoiceMusicOnHold']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db['sequelize'][_0xe742('0x13')]('../api/voiceQueue/voiceQueue.model');db['VoiceRecording']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0xe742('0x19')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x1a'));db[_0xe742('0x1b')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/voiceMail/voiceMail.model');db[_0xe742('0x1c')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x1d'));db[_0xe742('0x1e')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0xe742('0x1f')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x20'));db[_0xe742('0x21')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x22'));db[_0xe742('0x23')]=db['sequelize']['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0xe742('0x24')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x25'));db[_0xe742('0x26')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x27'));db['VoiceTransferReport']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x28'));db[_0xe742('0x29')]=db[_0xe742('0x0')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xe742('0x2a')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x2b'));db[_0xe742('0x2c')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x2d'));db[_0xe742('0x2e')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x2f'));db['UserFaxQueue']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x30'));db['UserSmsQueue']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x31'));db[_0xe742('0x32')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x33'));db[_0xe742('0x34')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x35'));db['MailServerIn']=db[_0xe742('0x0')]['import']('../api/mailServerIn/mailServerIn.model');db[_0xe742('0x36')]=db['sequelize'][_0xe742('0x13')]('../api/mailServerOut/mailServerOut.model');db['MailAccount']=db['sequelize'][_0xe742('0x13')](_0xe742('0x37'));db['MailQueue']=db['sequelize'][_0xe742('0x13')]('../api/mailQueue/mailQueue.model');db[_0xe742('0x38')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x39'));db['MailInteraction']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xe742('0x3a')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x3b'));db['MailApplication']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x3c'));db['MailQueueReport']=db['sequelize'][_0xe742('0x13')](_0xe742('0x3d'));db['Dashboard']=db['sequelize'][_0xe742('0x13')]('../api/dashboard/dashboard.model');db[_0xe742('0x3e')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x3f'));db[_0xe742('0x40')]=db[_0xe742('0x0')]['import'](_0xe742('0x41'));db[_0xe742('0x42')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x43'));db['FaxInteraction']=db['sequelize'][_0xe742('0x13')](_0xe742('0x44'));db[_0xe742('0x45')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x46'));db[_0xe742('0x47')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x48'));db[_0xe742('0x49')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x4a'));db['SmsApplication']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x4b'));db[_0xe742('0x4c')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x4d'));db[_0xe742('0x4e')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x4f'));db[_0xe742('0x50')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x51'));db[_0xe742('0x52')]=db[_0xe742('0x0')]['import'](_0xe742('0x53'));db['OpenchannelApplication']=db['sequelize'][_0xe742('0x13')]('../api/openchannelApplication/openchannelApplication.model');db[_0xe742('0x54')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0xe742('0x55')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x56'));db['OpenchannelQueue']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x57'));db[_0xe742('0x58')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x59'));db[_0xe742('0x5a')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x5b'));db[_0xe742('0x5c')]=db[_0xe742('0x0')]['import'](_0xe742('0x5d'));db[_0xe742('0x5e')]=db[_0xe742('0x0')]['import'](_0xe742('0x5f'));db[_0xe742('0x60')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/chatMessage/chatMessage.model');db[_0xe742('0x61')]=db[_0xe742('0x0')]['import'](_0xe742('0x62'));db[_0xe742('0x63')]=db[_0xe742('0x0')]['import'](_0xe742('0x64'));db['ChatGroup']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/chatGroup/chatGroup.model');db[_0xe742('0x65')]=db[_0xe742('0x0')]['import'](_0xe742('0x66'));db['CmCompany']=db[_0xe742('0x0')]['import'](_0xe742('0x67'));db['CmContact']=db['sequelize'][_0xe742('0x13')](_0xe742('0x68'));db['CmHopper']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db['sequelize'][_0xe742('0x13')](_0xe742('0x69'));db[_0xe742('0x6a')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x6b'));db[_0xe742('0x6c')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x6d'));db[_0xe742('0x6e')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xe742('0x6f')]=db[_0xe742('0x0')]['import'](_0xe742('0x70'));db[_0xe742('0x71')]=db[_0xe742('0x0')]['import'](_0xe742('0x72'));db['Automation']=db['sequelize']['import'](_0xe742('0x73'));db[_0xe742('0x74')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x75'));db[_0xe742('0x76')]=db['sequelize']['import'](_0xe742('0x77'));db[_0xe742('0x78')]=db[_0xe742('0x0')]['import']('../api/condition/condition.model');db[_0xe742('0x79')]=db['sequelize'][_0xe742('0x13')]('../api/interval/interval.model');db[_0xe742('0x7a')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/pause/pause.model');db[_0xe742('0x7b')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x7c'));db[_0xe742('0x7d')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x7e'));db[_0xe742('0x7f')]=db[_0xe742('0x0')]['import'](_0xe742('0x80'));db[_0xe742('0x81')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x82'));db[_0xe742('0x83')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x84'));db[_0xe742('0x85')]=db[_0xe742('0x0')]['import'](_0xe742('0x86'));db['CmContactHasItem']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x87'));db[_0xe742('0x88')]=db['sequelize']['import'](_0xe742('0x89'));db[_0xe742('0x8a')]=db['sequelize']['import']('../api/template/template.model');db[_0xe742('0x8b')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/trigger/trigger.model');db[_0xe742('0x8c')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/variable/variable.model');db[_0xe742('0x8d')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x8e'));db[_0xe742('0x8f')]=db[_0xe742('0x0')]['import']('../api/integrationReport/integrationReport.model');db[_0xe742('0x90')]=db['sequelize'][_0xe742('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0xe742('0x91')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x92'));db[_0xe742('0x93')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xe742('0x94')]=db['sequelize']['import'](_0xe742('0x95'));db[_0xe742('0x96')]=db[_0xe742('0x0')]['import'](_0xe742('0x97'));db[_0xe742('0x98')]=db['sequelize'][_0xe742('0x13')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe742('0x99')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x9a'));db[_0xe742('0x9b')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x9c'));db['SalesforceField']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x9d'));db[_0xe742('0x9e')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x9f'));db[_0xe742('0xa0')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xa1'));db['SugarcrmField']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xa2'));db['DeskAccount']=db['sequelize'][_0xe742('0x13')](_0xe742('0xa3'));db['DeskConfiguration']=db['sequelize'][_0xe742('0x13')](_0xe742('0xa4'));db[_0xe742('0xa5')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/intDeskField/intDeskField.model');db[_0xe742('0xa6')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xa7'));db['ZohoConfiguration']=db['sequelize'][_0xe742('0x13')](_0xe742('0xa8'));db['ZohoField']=db['sequelize']['import'](_0xe742('0xa9'));db['ZendeskAccount']=db[_0xe742('0x0')]['import'](_0xe742('0xaa'));db[_0xe742('0xab')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xac'));db[_0xe742('0xad')]=db[_0xe742('0x0')]['import'](_0xe742('0xae'));db[_0xe742('0xaf')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xb0'));db[_0xe742('0xb1')]=db['sequelize'][_0xe742('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xe742('0xb2')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xb3'));db['VtigerAccount']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xb4'));db[_0xe742('0xb5')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xb6'));db[_0xe742('0xb7')]=db['sequelize']['import'](_0xe742('0xb8'));db[_0xe742('0xb9')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xe742('0xba')]=db['sequelize'][_0xe742('0x13')](_0xe742('0xbb'));db[_0xe742('0xbc')]=db[_0xe742('0x0')]['import'](_0xe742('0xbd'));db[_0xe742('0xbe')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xbf'));db[_0xe742('0xc0')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xc1'));db[_0xe742('0xc2')]=db['sequelize'][_0xe742('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xe742('0xc3')]=db['sequelize'][_0xe742('0x13')](_0xe742('0xc4'));db[_0xe742('0xc5')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xc6'));db[_0xe742('0xc7')]=db[_0xe742('0x0')]['import'](_0xe742('0xc8'));db[_0xe742('0x8d')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/integration/integration.model');db['Network']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xc9'));db['ChatQueueReport']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xca'));db[_0xe742('0xcb')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xcc'));db[_0xe742('0xcd')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xe742('0xce')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xcf'));db['JscriptySessionReport']=db[_0xe742('0x0')]['import'](_0xe742('0xd0'));db[_0xe742('0xd1')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xd2'));db[_0xe742('0xd3')]=db[_0xe742('0x0')]['import'](_0xe742('0xd4'));db[_0xe742('0xd5')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xd6'));db[_0xe742('0xd7')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0xe742('0x0')]['import']('../api/setting/setting.model');db[_0xe742('0xd8')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xd9'));db['SquareProject']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xda'));db['SquareRecording']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xdb'));db[_0xe742('0xdc')]=db[_0xe742('0x0')]['import'](_0xe742('0xdd'));db['Team']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xde'));db['License']=db['sequelize'][_0xe742('0x13')](_0xe742('0xdf'));db[_0xe742('0xe0')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xe1'));db[_0xe742('0xe2')]=db['sequelize']['import'](_0xe742('0xe3'));db[_0xe742('0xe4')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xe5'));db['Plugin']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xe6'));db[_0xe742('0xe7')]=db['sequelize'][_0xe742('0x13')](_0xe742('0xe8'));db[_0xe742('0xe9')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xea'));db['FaxTransferReport']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe742('0xeb')]=db['sequelize']['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xe742('0xec')]=db[_0xe742('0x0')][_0xe742('0x13')]('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xe742('0x0')]['import'](_0xe742('0xed'));db[_0xe742('0xee')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xef'));db['UserProfile']=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xf0'));db[_0xe742('0xf1')]=db['sequelize'][_0xe742('0x13')]('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0xe742('0x0')]['import'](_0xe742('0xf2'));db[_0xe742('0xf3')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xf4'));db[_0xe742('0xf5')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xf6'));db[_0xe742('0xf7')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xf8'));db[_0xe742('0xf9')]=db['sequelize'][_0xe742('0x13')](_0xe742('0xfa'));db[_0xe742('0xfb')]=db[_0xe742('0x0')]['import'](_0xe742('0xfc'));db[_0xe742('0xfd')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0xfe'));db[_0xe742('0xff')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x100'));db['WhatsappQueue']=db[_0xe742('0x0')][_0xe742('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xe742('0x101')]=db[_0xe742('0x0')]['import'](_0xe742('0x102'));db[_0xe742('0x103')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x104'));db[_0xe742('0x105')]=db['sequelize'][_0xe742('0x13')](_0xe742('0x106'));db[_0xe742('0x107')]=db[_0xe742('0x0')][_0xe742('0x13')](_0xe742('0x108'));db['UserSetting']=db['sequelize'][_0xe742('0x13')](_0xe742('0x109'));db[_0xe742('0x12')][_0xe742('0x10a')](db['VoiceMail'],{'as':_0xe742('0x1b'),'onDelete':'cascade','foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')][_0xe742('0x10a')](db[_0xe742('0x10c')],{'as':_0xe742('0x10d'),'onDelete':'cascade','foreignKey':'UserId'});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0x10f')],{'as':_0xe742('0x110'),'foreignKey':'UserId'});db['User'][_0xe742('0x10e')](db['UserVoiceQueueRt'],{'as':_0xe742('0x111'),'foreignKey':'UserId'});db[_0xe742('0x12')]['hasMany'](db[_0xe742('0x17')],{'as':_0xe742('0x112'),'onDelete':'cascade','hooks':!![]});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0x6a')],{'as':_0xe742('0x113'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')]['hasMany'](db[_0xe742('0x6c')],{'as':'HopperHistory','foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')][_0xe742('0x10e')](db['ReportAgentPreview'],{'as':_0xe742('0x6e'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0x54')],{'as':'OpenchannelInteractions','foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')][_0xe742('0x10e')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')]['hasMany'](db['SmsInteraction'],{'as':_0xe742('0x114'),'foreignKey':'UserId'});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0x115')],{'as':_0xe742('0x116'),'foreignKey':'UserId'});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0x117')],{'as':_0xe742('0x118'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')]['hasMany'](db[_0xe742('0xf9')],{'as':_0xe742('0x119'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x12')][_0xe742('0x10e')](db[_0xe742('0xf3')],{'as':_0xe742('0x11a'),'foreignKey':_0xe742('0x11b')});db['User'][_0xe742('0x11c')](db[_0xe742('0x11d')],{'as':_0xe742('0x11d'),'foreignKey':_0xe742('0x11e')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x120')],{'as':'Groups','through':'chat_group_has_users'});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x121')],{'as':_0xe742('0x122'),'through':_0xe742('0x123')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x124')],{'as':'Lists','through':_0xe742('0x125')});db[_0xe742('0x12')]['belongsToMany'](db[_0xe742('0x126')],{'through':_0xe742('0x127')});db[_0xe742('0x12')]['belongsToMany'](db[_0xe742('0x117')],{'as':_0xe742('0x118'),'through':_0xe742('0x128')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x5e')],{'as':_0xe742('0x129'),'through':'user_has_chat_interactions'});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x115')],{'as':_0xe742('0x116'),'through':_0xe742('0x12a')});db[_0xe742('0x12')][_0xe742('0x11f')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xe742('0x12b')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x54')],{'as':_0xe742('0x12c'),'through':_0xe742('0x12d')});db['User'][_0xe742('0x11f')](db[_0xe742('0xf9')],{'as':'WhatsappInteractions','through':_0xe742('0x12e')});db[_0xe742('0x12')][_0xe742('0x11f')](db['VoiceQueue'],{'as':_0xe742('0x12f'),'through':_0xe742('0x2a'),'required':![]});db['User'][_0xe742('0x11f')](db[_0xe742('0xee')],{'as':_0xe742('0x130'),'through':'UserVoicePrefix','required':![]});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x131')],{'as':_0xe742('0x132'),'through':_0xe742('0x2e'),'required':![]});db['User'][_0xe742('0x11f')](db[_0xe742('0x63')],{'as':_0xe742('0x133'),'through':_0xe742('0x2c'),'required':![],'hooks':!![]});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x47')],{'as':_0xe742('0x134'),'through':_0xe742('0x135'),'required':![]});db['User']['belongsToMany'](db['SmsQueue'],{'as':_0xe742('0x136'),'through':'UserSmsQueue','required':![]});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x137')],{'as':_0xe742('0x138'),'through':'UserOpenchannelQueue','required':![]});db[_0xe742('0x12')][_0xe742('0x11f')](db['WhatsappQueue'],{'as':_0xe742('0x139'),'through':'UserWhatsappQueue','required':![]});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x124')],{'through':'cm_user_has_lists'});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x58')],{'as':'ChatWebsites','through':'user_has_chat_websites'});db['User'][_0xe742('0x11f')](db[_0xe742('0x40')],{'as':_0xe742('0x13a'),'through':_0xe742('0x13b')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x13c')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x52')],{'as':_0xe742('0x13d'),'through':_0xe742('0x13e')});db[_0xe742('0x12')][_0xe742('0x11f')](db['SmsAccount'],{'as':_0xe742('0x13f'),'through':_0xe742('0x140')});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0xf5')],{'as':_0xe742('0x141'),'through':'user_has_whatsapp_accounts'});db[_0xe742('0x12')][_0xe742('0x11f')](db[_0xe742('0x142')],{'as':'SquareProjects','through':'user_has_square_projects'});db['VoiceChanSpy'][_0xe742('0x10e')](db[_0xe742('0x17')],{'as':_0xe742('0x143'),'onDelete':_0xe742('0x144'),'foreignKey':'ChanSpyId'});db[_0xe742('0x15')]['hasMany'](db[_0xe742('0x17')],{'onDelete':_0xe742('0x144')});db[_0xe742('0x17')]['hasMany'](db[_0xe742('0x17')],{'as':_0xe742('0x145'),'onDelete':'cascade'});db[_0xe742('0x146')][_0xe742('0x11f')](db[_0xe742('0x81')],{'as':_0xe742('0x147'),'through':_0xe742('0x148')});db[_0xe742('0x149')][_0xe742('0x10e')](db[_0xe742('0x29')],{'as':_0xe742('0x14a'),'foreignKey':_0xe742('0x14b')});db['VoiceQueue'][_0xe742('0x10e')](db[_0xe742('0x14c')],{'as':_0xe742('0x14d'),'foreignKey':_0xe742('0x14b')});db[_0xe742('0x149')][_0xe742('0x10e')](db[_0xe742('0x6a')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0xe742('0x149')][_0xe742('0x10e')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe742('0x14b')});db[_0xe742('0x149')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xe742('0x14b')});db[_0xe742('0x149')][_0xe742('0x10e')](db[_0xe742('0x14e')],{'as':_0xe742('0x14f'),'foreignKey':_0xe742('0x14b')});db[_0xe742('0x149')]['hasMany'](db[_0xe742('0x150')],{'as':'JscriptySessions','foreignKey':_0xe742('0x14b')});db['VoiceQueue']['belongsTo'](db[_0xe742('0x26')],{'as':_0xe742('0x26'),'foreignKey':'TrunkId'});db[_0xe742('0x149')]['belongsTo'](db[_0xe742('0x26')],{'as':_0xe742('0x151'),'foreignKey':_0xe742('0x152')});db['VoiceQueue'][_0xe742('0x11c')](db[_0xe742('0x79')],{'as':_0xe742('0x79'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xe742('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe742('0x153')});db[_0xe742('0x149')][_0xe742('0x11f')](db['CmList'],{'as':_0xe742('0x154'),'through':'voice_queues_has_cm_lists'});db[_0xe742('0x149')][_0xe742('0x11f')](db['User'],{'as':'Agents','through':_0xe742('0x2a')});db[_0xe742('0x149')][_0xe742('0x11f')](db[_0xe742('0x126')],{'as':_0xe742('0x155'),'through':_0xe742('0x103')});db[_0xe742('0x149')][_0xe742('0x11f')](db[_0xe742('0x124')],{'as':_0xe742('0x156'),'through':_0xe742('0x157')});db['VoiceRecording'][_0xe742('0x11c')](db['User'],{'as':_0xe742('0x12'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x19')]['belongsTo'](db[_0xe742('0x12')],{'as':_0xe742('0x12'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x1b')][_0xe742('0x10e')](db[_0xe742('0x1c')],{'as':_0xe742('0x158'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x159'),'sourceKey':_0xe742('0x15a')});db[_0xe742('0x1c')][_0xe742('0x11c')](db[_0xe742('0x1b')],{'foreignKey':_0xe742('0x159'),'targetKey':_0xe742('0x15a')});db[_0xe742('0x1e')]['hasMany'](db['VoiceQueueReport'],{'as':_0xe742('0x15b'),'foreignKey':_0xe742('0x15c'),'constraints':![]});db[_0xe742('0x1e')][_0xe742('0x10e')](db[_0xe742('0x21')],{'as':_0xe742('0x15d'),'foreignKey':_0xe742('0x15c'),'constraints':![]});db[_0xe742('0x1e')]['belongsTo'](db[_0xe742('0x12')],{'as':_0xe742('0x12'),'foreignKey':'UserId'});db[_0xe742('0x1e')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x160')]['belongsTo'](db[_0xe742('0x13c')],{'as':'MailAccount','foreignKey':_0xe742('0x161')});db[_0xe742('0x160')][_0xe742('0x11c')](db[_0xe742('0x101')],{'as':_0xe742('0x101'),'foreignKey':_0xe742('0x162'),'onDelete':'restrict'});db[_0xe742('0x36')]['belongsTo'](db[_0xe742('0x13c')],{'as':_0xe742('0x13c'),'foreignKey':'MailAccountId'});db[_0xe742('0x36')][_0xe742('0x11c')](db[_0xe742('0x101')],{'as':_0xe742('0x101'),'foreignKey':'CloudProviderId','onDelete':_0xe742('0x163')});db[_0xe742('0x13c')]['hasOne'](db[_0xe742('0x160')],{'as':_0xe742('0x164'),'onDelete':_0xe742('0x144')});db['MailAccount'][_0xe742('0x10a')](db[_0xe742('0x36')],{'as':'Smtp','onDelete':_0xe742('0x144')});db[_0xe742('0x13c')][_0xe742('0x10e')](db['Disposition'],{'as':_0xe742('0x165'),'foreignKey':_0xe742('0x161'),'onDelete':_0xe742('0x144')});db['MailAccount'][_0xe742('0x10e')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xe742('0x161')});db['MailAccount']['hasMany'](db['MailMessage'],{'as':_0xe742('0x158'),'foreignKey':_0xe742('0x161')});db[_0xe742('0x13c')]['hasMany'](db[_0xe742('0x117')],{'as':_0xe742('0x166')});db[_0xe742('0x13c')][_0xe742('0x10e')](db[_0xe742('0x167')],{'as':_0xe742('0x145')});db['MailAccount'][_0xe742('0x11c')](db['CmList'],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x13c')][_0xe742('0x11c')](db[_0xe742('0x8a')],{'as':'Template','foreignKey':_0xe742('0x16a')});db[_0xe742('0x13c')]['belongsTo'](db['Pause'],{'as':_0xe742('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe742('0x13c')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Agents','through':_0xe742('0x16c')});db[_0xe742('0x131')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x2e')});db[_0xe742('0x131')][_0xe742('0x11f')](db[_0xe742('0x126')],{'through':_0xe742('0x16e'),'as':'Teams'});db[_0xe742('0x117')][_0xe742('0x10e')](db[_0xe742('0x3a')],{'as':_0xe742('0x158'),'onDelete':'cascade','foreignKey':_0xe742('0x16f')});db['MailInteraction']['belongsTo'](db[_0xe742('0x13c')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x161')});db[_0xe742('0x117')][_0xe742('0x11c')](db['CmContact'],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x117')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':'Owner','foreignKey':_0xe742('0x10b')});db['MailInteraction'][_0xe742('0x11f')](db['Tag'],{'through':_0xe742('0x171'),'as':_0xe742('0x172')});db[_0xe742('0x117')]['belongsToMany'](db[_0xe742('0x83')],{'through':'mail_interaction_has_tags','as':_0xe742('0x173')});db[_0xe742('0x117')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x174'),'through':'user_has_mail_interactions','foreignKey':_0xe742('0x16f')});db[_0xe742('0x3a')][_0xe742('0x10e')](db[_0xe742('0xe4')],{'as':_0xe742('0x175'),'onDelete':_0xe742('0x144')});db[_0xe742('0x3a')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':'User'});db[_0xe742('0x3a')]['belongsTo'](db[_0xe742('0x121')],{'onDelete':'cascade','as':_0xe742('0x15e')});db[_0xe742('0x3a')][_0xe742('0x11c')](db['MailInteraction'],{'as':'Interaction','foreignKey':_0xe742('0x16f')});db[_0xe742('0x3a')][_0xe742('0x11c')](db[_0xe742('0x13c')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x161')});db['MailMessage'][_0xe742('0x11c')](db[_0xe742('0x58')],{'as':_0xe742('0x58'),'foreignKey':_0xe742('0x176')});db[_0xe742('0x3a')][_0xe742('0x11c')](db['ChatOfflineMessage'],{'as':_0xe742('0x61'),'foreignKey':'ChatOfflineMessageId'});db[_0xe742('0x167')]['belongsTo'](db[_0xe742('0x12')],{'onDelete':'restrict'});db[_0xe742('0x167')][_0xe742('0x11c')](db[_0xe742('0x131')],{'onDelete':_0xe742('0x163')});db['MailApplication'][_0xe742('0x11c')](db[_0xe742('0x13c')],{'onDelete':_0xe742('0x163')});db[_0xe742('0x167')][_0xe742('0x11c')](db[_0xe742('0x79')],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x177')});db['MailApplication']['belongsTo'](db['Tag'],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x178')});db[_0xe742('0x179')][_0xe742('0x11c')](db[_0xe742('0x13c')],{});db[_0xe742('0x179')][_0xe742('0x11c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xe742('0x179')][_0xe742('0x11c')](db['CmContact'],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x179')][_0xe742('0x11c')](db[_0xe742('0x117')],{});db[_0xe742('0x179')]['belongsTo'](db[_0xe742('0x3a')],{});db[_0xe742('0x179')]['belongsTo'](db[_0xe742('0x12')],{});db[_0xe742('0x179')][_0xe742('0x11c')](db['MailQueue'],{});db['Dashboard'][_0xe742('0x10e')](db[_0xe742('0x3e')],{'as':_0xe742('0x17a'),'onDelete':_0xe742('0x144')});db[_0xe742('0x40')][_0xe742('0x10e')](db['Disposition'],{'as':_0xe742('0x165'),'foreignKey':_0xe742('0x17b'),'onDelete':_0xe742('0x144')});db['FaxAccount']['hasMany'](db[_0xe742('0x74')],{'as':_0xe742('0x17c'),'foreignKey':_0xe742('0x17b')});db['FaxAccount'][_0xe742('0x10e')](db['FaxInteraction'],{'as':_0xe742('0x166')});db[_0xe742('0x40')][_0xe742('0x10e')](db[_0xe742('0x42')],{'as':_0xe742('0x145')});db[_0xe742('0x40')][_0xe742('0x10e')](db[_0xe742('0x17')],{'as':_0xe742('0x17d'),'onDelete':_0xe742('0x144')});db['FaxAccount'][_0xe742('0x10e')](db['FaxMessage'],{'as':'Messages'});db[_0xe742('0x40')]['belongsTo'](db[_0xe742('0x26')],{'as':_0xe742('0x26')});db[_0xe742('0x40')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x40')][_0xe742('0x11c')](db['Pause'],{'as':_0xe742('0x16b'),'foreignKey':_0xe742('0x153')});db['FaxAccount']['belongsToMany'](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x13b')});db['FaxApplication'][_0xe742('0x11c')](db['User'],{'onDelete':_0xe742('0x163')});db[_0xe742('0x42')][_0xe742('0x11c')](db['FaxQueue'],{'onDelete':_0xe742('0x163')});db['FaxApplication'][_0xe742('0x11c')](db[_0xe742('0x40')],{'onDelete':'restrict'});db[_0xe742('0x42')]['belongsTo'](db[_0xe742('0x83')],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x178')});db['FaxInteraction'][_0xe742('0x10e')](db[_0xe742('0x45')],{'as':_0xe742('0x158'),'onDelete':_0xe742('0x144'),'foreignKey':'FaxInteractionId'});db[_0xe742('0x115')][_0xe742('0x11c')](db[_0xe742('0x40')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x17b')});db[_0xe742('0x115')]['belongsTo'](db['CmContact'],{'as':_0xe742('0x15e'),'foreignKey':'ContactId'});db[_0xe742('0x115')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':'Owner','foreignKey':'UserId'});db[_0xe742('0x115')][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x17e'),'as':_0xe742('0x172')});db['FaxInteraction'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x17e'),'as':_0xe742('0x173')});db[_0xe742('0x115')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Users','through':_0xe742('0x12a'),'foreignKey':_0xe742('0x17f')});db[_0xe742('0x45')][_0xe742('0x11c')](db[_0xe742('0x12')],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x12')});db[_0xe742('0x45')][_0xe742('0x11c')](db['FaxInteraction'],{'as':'Interaction','foreignKey':_0xe742('0x17f')});db[_0xe742('0x45')][_0xe742('0x11c')](db['CmContact'],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x15e')});db[_0xe742('0x45')][_0xe742('0x11c')](db['Attachment'],{'as':_0xe742('0xe4'),'foreignKey':_0xe742('0x180')});db[_0xe742('0x45')][_0xe742('0x11c')](db[_0xe742('0x40')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xe742('0x47')]['belongsToMany'](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x135')});db[_0xe742('0x47')]['belongsToMany'](db['Team'],{'through':_0xe742('0x181'),'as':_0xe742('0x155')});db[_0xe742('0x49')][_0xe742('0x11c')](db[_0xe742('0x40')],{});db['FaxQueueReport'][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':'ListId'});db[_0xe742('0x49')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x49')][_0xe742('0x11c')](db[_0xe742('0x115')],{});db[_0xe742('0x49')][_0xe742('0x11c')](db[_0xe742('0x45')],{});db['FaxQueueReport'][_0xe742('0x11c')](db[_0xe742('0x12')],{});db[_0xe742('0x49')]['belongsTo'](db[_0xe742('0x47')],{});db[_0xe742('0x182')]['hasMany'](db[_0xe742('0x76')],{'as':_0xe742('0x165'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db[_0xe742('0x182')]['hasMany'](db[_0xe742('0x74')],{'as':_0xe742('0x17c'),'foreignKey':_0xe742('0x183')});db[_0xe742('0x182')][_0xe742('0x10e')](db[_0xe742('0x4e')],{'as':'Messages','foreignKey':_0xe742('0x183')});db[_0xe742('0x182')][_0xe742('0x10e')](db[_0xe742('0x4c')],{'as':_0xe742('0x166')});db['SmsAccount']['hasMany'](db[_0xe742('0x184')],{'as':_0xe742('0x145')});db[_0xe742('0x182')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':'List','foreignKey':_0xe742('0x169')});db[_0xe742('0x182')][_0xe742('0x11c')](db[_0xe742('0x7a')],{'as':_0xe742('0x16b'),'foreignKey':_0xe742('0x153')});db[_0xe742('0x182')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Agents','through':_0xe742('0x140')});db[_0xe742('0x184')][_0xe742('0x11c')](db[_0xe742('0x12')],{'onDelete':_0xe742('0x163')});db[_0xe742('0x184')]['belongsTo'](db[_0xe742('0x50')],{'onDelete':_0xe742('0x163')});db[_0xe742('0x184')][_0xe742('0x11c')](db['SmsAccount'],{'onDelete':_0xe742('0x163')});db[_0xe742('0x184')]['belongsTo'](db[_0xe742('0x79')],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x177')});db['SmsApplication'][_0xe742('0x11c')](db['Tag'],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x178')});db[_0xe742('0x4c')][_0xe742('0x10e')](db[_0xe742('0x4e')],{'as':_0xe742('0x158'),'onDelete':'cascade','foreignKey':_0xe742('0x185')});db[_0xe742('0x4c')]['belongsTo'](db[_0xe742('0x182')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x183')});db['SmsInteraction']['belongsTo'](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x4c')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':_0xe742('0x186'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x4c')][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x187'),'as':_0xe742('0x172')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x174'),'through':_0xe742('0x12b'),'foreignKey':_0xe742('0x185')});db[_0xe742('0x4e')]['belongsTo'](db[_0xe742('0x12')],{'as':_0xe742('0x12')});db['SmsMessage'][_0xe742('0x11c')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0xe742('0x4e')]['belongsTo'](db[_0xe742('0x4c')],{'onDelete':_0xe742('0x144'),'as':'Interaction','foreignKey':_0xe742('0x185')});db[_0xe742('0x4e')][_0xe742('0x11c')](db[_0xe742('0x182')],{'as':_0xe742('0x170'),'foreignKey':'SmsAccountId'});db[_0xe742('0x50')]['belongsToMany'](db['User'],{'as':_0xe742('0x16d'),'through':_0xe742('0x188'),'foreignKey':_0xe742('0x189')});db[_0xe742('0x50')][_0xe742('0x11f')](db[_0xe742('0x126')],{'through':_0xe742('0x18a'),'as':_0xe742('0x155')});db['OpenchannelAccount']['hasMany'](db[_0xe742('0x76')],{'as':'Dispositions','foreignKey':_0xe742('0x18b'),'onDelete':_0xe742('0x144')});db[_0xe742('0x52')][_0xe742('0x10e')](db[_0xe742('0x74')],{'as':_0xe742('0x17c'),'foreignKey':_0xe742('0x18b')});db['OpenchannelAccount'][_0xe742('0x10e')](db['OpenchannelInteraction'],{'as':_0xe742('0x166'),'foreignKey':_0xe742('0x18b')});db[_0xe742('0x52')][_0xe742('0x10e')](db['OpenchannelMessage'],{'as':_0xe742('0x158'),'foreignKey':_0xe742('0x18b')});db[_0xe742('0x52')][_0xe742('0x10e')](db['OpenchannelApplication'],{'as':_0xe742('0x145'),'foreignKey':_0xe742('0x18b')});db[_0xe742('0x52')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':'ListId'});db[_0xe742('0x52')][_0xe742('0x11c')](db[_0xe742('0x7a')],{'as':_0xe742('0x16b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xe742('0x52')][_0xe742('0x11f')](db['User'],{'as':_0xe742('0x16d'),'through':'user_has_openchannel_accounts'});db[_0xe742('0x18c')][_0xe742('0x11c')](db[_0xe742('0x12')],{'onDelete':_0xe742('0x163')});db['OpenchannelApplication'][_0xe742('0x11c')](db['OpenchannelQueue'],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x18d')});db[_0xe742('0x18c')][_0xe742('0x11c')](db['OpenchannelAccount'],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x18b')});db[_0xe742('0x18c')][_0xe742('0x11c')](db['Interval'],{'onDelete':_0xe742('0x163'),'foreignKey':'IntervalId'});db[_0xe742('0x18c')][_0xe742('0x11c')](db[_0xe742('0x83')],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x178')});db[_0xe742('0x54')][_0xe742('0x10e')](db[_0xe742('0x55')],{'as':_0xe742('0x158'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x18e')});db[_0xe742('0x54')][_0xe742('0x11c')](db[_0xe742('0x52')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x18b')});db['OpenchannelInteraction'][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x54')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xe742('0x54')][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':'openchannel_interaction_has_tags','as':_0xe742('0x172')});db['OpenchannelInteraction'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x18f'),'as':'ThroughTags'});db[_0xe742('0x54')][_0xe742('0x11f')](db['User'],{'as':_0xe742('0x174'),'through':'user_has_openchannel_interactions','foreignKey':_0xe742('0x18e')});db[_0xe742('0x55')][_0xe742('0x11c')](db[_0xe742('0x12')],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x12')});db[_0xe742('0x55')][_0xe742('0x11c')](db[_0xe742('0x121')],{'onDelete':_0xe742('0x144'),'as':'Contact'});db['OpenchannelMessage']['belongsTo'](db[_0xe742('0x54')],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x190'),'foreignKey':_0xe742('0x18e')});db[_0xe742('0x55')][_0xe742('0x11c')](db[_0xe742('0xe4')],{'as':_0xe742('0xe4'),'foreignKey':_0xe742('0x180')});db[_0xe742('0x55')][_0xe742('0x11c')](db[_0xe742('0x52')],{'as':'Account','foreignKey':_0xe742('0x18b')});db['OpenchannelQueue'][_0xe742('0x11f')](db['User'],{'as':_0xe742('0x16d'),'through':_0xe742('0x32'),'foreignKey':_0xe742('0x18d')});db['OpenchannelQueue'][_0xe742('0x11f')](db[_0xe742('0x126')],{'through':_0xe742('0x191'),'as':_0xe742('0x155')});db[_0xe742('0x58')][_0xe742('0x10e')](db['Disposition'],{'as':_0xe742('0x165'),'foreignKey':_0xe742('0x176'),'onDelete':_0xe742('0x144')});db[_0xe742('0x58')]['hasMany'](db[_0xe742('0x74')],{'as':'Answers','foreignKey':_0xe742('0x176')});db[_0xe742('0x58')][_0xe742('0x10e')](db[_0xe742('0x65')],{'as':_0xe742('0x192')});db[_0xe742('0x58')][_0xe742('0x10e')](db[_0xe742('0x5e')],{'as':_0xe742('0x166')});db[_0xe742('0x58')][_0xe742('0x10e')](db[_0xe742('0x5c')],{'as':_0xe742('0x145')});db['ChatWebsite']['hasMany'](db['ChatMessage'],{'as':_0xe742('0x158')});db[_0xe742('0x58')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x58')]['belongsTo'](db[_0xe742('0x79')],{'as':_0xe742('0x79'),'foreignKey':'IntervalId'});db[_0xe742('0x58')][_0xe742('0x11c')](db[_0xe742('0x13c')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xe742('0x58')][_0xe742('0x11c')](db[_0xe742('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':_0xe742('0x153')});db[_0xe742('0x58')]['belongsToMany'](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':'user_has_chat_websites'});db[_0xe742('0x5a')][_0xe742('0x11c')](db['OpenchannelAccount'],{});db[_0xe742('0x5a')][_0xe742('0x11c')](db['CmList'],{'as':'List','foreignKey':_0xe742('0x169')});db[_0xe742('0x5a')]['belongsTo'](db['CmContact'],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db['OpenchannelQueueReport']['belongsTo'](db[_0xe742('0x54')],{});db[_0xe742('0x5a')][_0xe742('0x11c')](db[_0xe742('0x55')],{});db[_0xe742('0x5a')][_0xe742('0x11c')](db[_0xe742('0x12')],{});db[_0xe742('0x5a')][_0xe742('0x11c')](db['OpenchannelQueue'],{});db[_0xe742('0x5c')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':_0xe742('0x193'),'foreignKey':_0xe742('0x10b'),'onDelete':_0xe742('0x163')});db[_0xe742('0x5c')][_0xe742('0x11c')](db['ChatQueue'],{'as':_0xe742('0x194'),'foreignKey':_0xe742('0x195'),'onDelete':_0xe742('0x163')});db[_0xe742('0x5c')][_0xe742('0x11c')](db[_0xe742('0x58')],{'as':_0xe742('0x196'),'foreignKey':'ChatWebsiteId','onDelete':_0xe742('0x163')});db[_0xe742('0x5c')]['belongsTo'](db['Tag'],{'onDelete':_0xe742('0x163'),'foreignKey':_0xe742('0x178')});db['ChatInteraction'][_0xe742('0x10e')](db['ChatMessage'],{'as':_0xe742('0x158'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x197')});db[_0xe742('0x5e')][_0xe742('0x11c')](db[_0xe742('0x58')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x176')});db[_0xe742('0x5e')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db['ChatInteraction'][_0xe742('0x11c')](db['User'],{'as':_0xe742('0x186'),'foreignKey':_0xe742('0x10b')});db['ChatInteraction']['belongsToMany'](db[_0xe742('0x83')],{'through':'chat_interaction_has_tags','as':_0xe742('0x172')});db[_0xe742('0x5e')][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x198'),'as':'ThroughTags'});db[_0xe742('0x5e')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Users','through':_0xe742('0x199'),'foreignKey':_0xe742('0x197')});db[_0xe742('0x60')][_0xe742('0x11c')](db[_0xe742('0x12')],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x12')});db['ChatMessage'][_0xe742('0x11c')](db['CmContact'],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x60')]['belongsTo'](db['ChatInteraction'],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x190'),'foreignKey':'ChatInteractionId'});db['ChatMessage']['belongsTo'](db[_0xe742('0xe4')],{'as':_0xe742('0xe4'),'foreignKey':'AttachmentId'});db['ChatMessage'][_0xe742('0x11c')](db['ChatWebsite'],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x176')});db[_0xe742('0x61')][_0xe742('0x10e')](db[_0xe742('0xe4')],{'as':_0xe742('0x175'),'foreignKey':_0xe742('0x19a'),'onDelete':_0xe742('0x144'),'hooks':!![]});db[_0xe742('0x61')][_0xe742('0x11c')](db[_0xe742('0x121')],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x61')][_0xe742('0x11c')](db[_0xe742('0x58')],{'as':'Account','foreignKey':_0xe742('0x176')});db[_0xe742('0x63')]['belongsToMany'](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0xe742('0x126')],{'through':_0xe742('0x19b'),'as':_0xe742('0x155')});db[_0xe742('0x120')][_0xe742('0x10e')](db[_0xe742('0xcb')],{'as':_0xe742('0x158'),'foreignKey':_0xe742('0x19c'),'onDelete':_0xe742('0x144')});db[_0xe742('0x120')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Members','through':_0xe742('0x19d')});db[_0xe742('0x65')][_0xe742('0x11c')](db[_0xe742('0x58')],{'as':_0xe742('0x196'),'foreignKey':_0xe742('0x176')});db[_0xe742('0x19e')]['hasMany'](db['CmContact'],{'as':'Contacts','foreignKey':_0xe742('0x19f')});db['CmContact'][_0xe742('0x10e')](db['CmContactHasItem'],{'as':_0xe742('0x1a0'),'foreignKey':'CmContactId'});db[_0xe742('0x121')][_0xe742('0x10e')](db['CmHopper'],{'as':_0xe742('0x14d'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x121')][_0xe742('0x10e')](db[_0xe742('0x6a')],{'as':_0xe742('0x113'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x121')]['hasMany'](db['CmHopperHistory'],{'as':_0xe742('0x1a1'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x121')][_0xe742('0x10e')](db[_0xe742('0x6e')],{'as':_0xe742('0x6e'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0xe742('0x150')],{'as':_0xe742('0x1a2'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0x121')][_0xe742('0x10e')](db[_0xe742('0x54')],{'as':_0xe742('0x12c'),'foreignKey':_0xe742('0x15f'),'onDelete':_0xe742('0x163')});db['CmContact'][_0xe742('0x10e')](db[_0xe742('0x5e')],{'as':'ChatInteractions','foreignKey':_0xe742('0x15f'),'onDelete':'restrict'});db['CmContact'][_0xe742('0x10e')](db[_0xe742('0x4c')],{'as':_0xe742('0x114'),'foreignKey':_0xe742('0x15f'),'onDelete':_0xe742('0x163')});db[_0xe742('0x121')][_0xe742('0x10e')](db[_0xe742('0x115')],{'as':_0xe742('0x116'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xe742('0x121')][_0xe742('0x10e')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0xe742('0x15f'),'onDelete':_0xe742('0x163')});db['CmContact'][_0xe742('0x11c')](db[_0xe742('0x19e')],{'as':_0xe742('0x1a3'),'foreignKey':_0xe742('0x19f')});db[_0xe742('0x121')]['belongsTo'](db['CmList'],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169'),'onDelete':_0xe742('0x144')});db['CmContact'][_0xe742('0x11f')](db['User'],{'as':'Users','through':_0xe742('0x123')});db[_0xe742('0x121')]['belongsToMany'](db['Tag'],{'as':_0xe742('0x172'),'through':_0xe742('0x1a4')});db['CmContact'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db['CmHopper'][_0xe742('0x10e')](db['CmHopperAdditionalPhone'],{'as':_0xe742('0x1a5'),'foreignKey':_0xe742('0x1a6')});db[_0xe742('0x14c')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':'Contact','foreignKey':_0xe742('0x15f'),'onDelete':_0xe742('0x144')});db[_0xe742('0x14c')][_0xe742('0x11c')](db['CmList'],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169'),'onDelete':_0xe742('0x144')});db[_0xe742('0x14c')][_0xe742('0x11c')](db['User'],{'as':_0xe742('0x193'),'foreignKey':_0xe742('0x10b')});db[_0xe742('0x14c')][_0xe742('0x11c')](db['VoiceQueue'],{'as':_0xe742('0x194'),'foreignKey':'VoiceQueueId','onDelete':_0xe742('0x144')});db[_0xe742('0x14c')]['belongsTo'](db[_0xe742('0xe0')],{'as':_0xe742('0xe0'),'foreignKey':_0xe742('0x1a7'),'onDelete':_0xe742('0x144')});db[_0xe742('0x14c')][_0xe742('0x11c')](db['User'],{'as':_0xe742('0x186'),'foreignKey':_0xe742('0x1a8')});db[_0xe742('0x14e')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db[_0xe742('0x14e')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':'ListId','onDelete':_0xe742('0x144')});db[_0xe742('0x14e')]['belongsTo'](db[_0xe742('0x149')],{'as':_0xe742('0x194'),'foreignKey':'VoiceQueueId','onDelete':_0xe742('0x144')});db[_0xe742('0x14e')][_0xe742('0x11c')](db[_0xe742('0xe0')],{'as':_0xe742('0xe0'),'foreignKey':_0xe742('0x1a7'),'onDelete':'cascade'});db['Automation'][_0xe742('0x10e')](db[_0xe742('0x78')],{'as':{'plural':_0xe742('0x1a9'),'singular':'OneAll'},'foreignKey':_0xe742('0x1aa'),'onDelete':_0xe742('0x144'),'hooks':!![]});db[_0xe742('0x1ab')][_0xe742('0x10e')](db[_0xe742('0x78')],{'as':{'plural':_0xe742('0x1ac'),'singular':_0xe742('0x1ad')},'foreignKey':_0xe742('0x1ae'),'onDelete':_0xe742('0x144'),'hooks':!![]});db['Automation'][_0xe742('0x10e')](db[_0xe742('0x71')],{'as':'Actions','foreignKey':_0xe742('0x1af'),'onDelete':'cascade','hooks':!![]});db[_0xe742('0x76')]['hasMany'](db[_0xe742('0x76')],{'as':_0xe742('0x165'),'foreignKey':_0xe742('0x1b0'),'onDelete':_0xe742('0x144')});db[_0xe742('0x79')]['hasMany'](db[_0xe742('0x79')],{'as':_0xe742('0x1b1'),'foreignKey':_0xe742('0x177'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xe742('0x79')]['hasMany'](db[_0xe742('0x17')],{'as':_0xe742('0x112'),'foreignKey':_0xe742('0x177'),'onDelete':_0xe742('0x163')});db[_0xe742('0x79')][_0xe742('0x10e')](db[_0xe742('0x167')],{'as':_0xe742('0x1b2'),'foreignKey':'IntervalId'});db[_0xe742('0x79')][_0xe742('0x10e')](db[_0xe742('0x5c')],{'as':'ChatApplications','foreignKey':_0xe742('0x177')});db[_0xe742('0x79')][_0xe742('0x10e')](db[_0xe742('0x42')],{'as':_0xe742('0x1b3'),'foreignKey':_0xe742('0x177')});db[_0xe742('0x79')][_0xe742('0x10e')](db[_0xe742('0x184')],{'as':'SmsApplications','foreignKey':_0xe742('0x177')});db[_0xe742('0x7f')][_0xe742('0x11c')](db[_0xe742('0x13c')],{});db[_0xe742('0x7f')][_0xe742('0x11c')](db[_0xe742('0x91')],{'foreignKey':_0xe742('0x1b4')});db['Schedule'][_0xe742('0x11c')](db[_0xe742('0x90')],{'foreignKey':_0xe742('0x1b5')});db[_0xe742('0x81')][_0xe742('0x11f')](db[_0xe742('0x146')],{'as':_0xe742('0x1b6'),'through':_0xe742('0x148'),'onDelete':'restrict'});db['Tag'][_0xe742('0x11f')](db[_0xe742('0x121')],{'through':'cm_contact_has_tags'});db[_0xe742('0x83')][_0xe742('0x11f')](db[_0xe742('0x5e')],{'through':_0xe742('0x198')});db['Tag'][_0xe742('0x11f')](db[_0xe742('0x117')],{'through':'mail_interaction_has_tags'});db[_0xe742('0x83')][_0xe742('0x11f')](db[_0xe742('0x4c')],{'through':_0xe742('0x187')});db[_0xe742('0x83')][_0xe742('0x11f')](db[_0xe742('0x115')],{'through':_0xe742('0x17e')});db[_0xe742('0x83')][_0xe742('0x11f')](db[_0xe742('0x54')],{'through':_0xe742('0x18f')});db[_0xe742('0x83')][_0xe742('0x11f')](db[_0xe742('0xf9')],{'through':_0xe742('0x1b7')});db['CmContactHasItem'][_0xe742('0x11c')](db[_0xe742('0x85')],{'as':_0xe742('0x1b8'),'foreignKey':_0xe742('0x1b9')});db['CmHopperAdditionalPhone'][_0xe742('0x11c')](db['CmHopper'],{'as':_0xe742('0x1ba'),'foreignKey':_0xe742('0x1a6')});db[_0xe742('0x1bb')]['belongsTo'](db[_0xe742('0x121')],{'as':'Contact','foreignKey':_0xe742('0x1bc')});db[_0xe742('0x8b')][_0xe742('0x10e')](db[_0xe742('0x78')],{'as':{'plural':_0xe742('0x1bd'),'singular':_0xe742('0x1be')},'foreignKey':_0xe742('0x1bf'),'onDelete':_0xe742('0x144'),'hooks':!![]});db['Trigger'][_0xe742('0x10e')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xe742('0x1c0')},'foreignKey':_0xe742('0x1c1'),'onDelete':_0xe742('0x144'),'hooks':!![]});db[_0xe742('0x8b')][_0xe742('0x10e')](db['Action'],{'as':_0xe742('0x1c2'),'foreignKey':_0xe742('0x1c3'),'onDelete':_0xe742('0x144'),'hooks':!![]});db[_0xe742('0x90')][_0xe742('0x10e')](db[_0xe742('0x96')],{'as':_0xe742('0x1c4'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1b5'),'hooks':!![]});db['AnalyticDefaultReport']['hasMany'](db[_0xe742('0x96')],{'as':_0xe742('0x1c4'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1b4')});db[_0xe742('0x94')][_0xe742('0x10e')](db[_0xe742('0x96')],{'as':_0xe742('0x1c4'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1c5')});db['AnalyticFieldReport']['belongsTo'](db[_0xe742('0x94')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0xe742('0x10e')](db[_0xe742('0x9b')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':'AccountId'});db['SalesforceConfiguration'][_0xe742('0x10e')](db['SalesforceField'],{'as':_0xe742('0x1c7'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0x9b')][_0xe742('0x10e')](db[_0xe742('0x1c9')],{'as':'Descriptions','onDelete':_0xe742('0x144'),'foreignKey':'DescriptionId'});db['SalesforceConfiguration']['hasMany'](db[_0xe742('0x1c9')],{'as':_0xe742('0x1c4'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0x9b')][_0xe742('0x11c')](db[_0xe742('0x99')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x1cb')});db[_0xe742('0x1c9')]['hasMany'](db['SalesforceField'],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0x1c9')]['hasMany'](db[_0xe742('0x1c9')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0x1c9')][_0xe742('0x10e')](db[_0xe742('0x1c9')],{'as':'Field','foreignKey':_0xe742('0x1ca')});db[_0xe742('0x1c9')][_0xe742('0x11c')](db['Variable'],{'as':'Variable','foreignKey':_0xe742('0x1cf')});db['SugarcrmAccount'][_0xe742('0x10e')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xe742('0x144'),'foreignKey':'AccountId'});db['SugarcrmConfiguration'][_0xe742('0x10e')](db[_0xe742('0x1d0')],{'as':_0xe742('0x1c7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xe742('0xa0')][_0xe742('0x10e')](db[_0xe742('0x1d0')],{'as':'Descriptions','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xa0')]['hasMany'](db[_0xe742('0x1d0')],{'as':'Fields','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0xa0')][_0xe742('0x11c')](db[_0xe742('0x9e')],{'as':_0xe742('0x170'),'foreignKey':'AccountId'});db[_0xe742('0x1d0')]['hasMany'](db[_0xe742('0x1d0')],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0x1d0')][_0xe742('0x10e')](db[_0xe742('0x1d0')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db['SugarcrmField'][_0xe742('0x10e')](db['SugarcrmField'],{'as':_0xe742('0x1d1'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0x1d0')][_0xe742('0x11c')](db[_0xe742('0x8c')],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0x1d2')][_0xe742('0x10e')](db[_0xe742('0x1d3')],{'as':_0xe742('0x1c6'),'onDelete':'cascade','foreignKey':_0xe742('0x1cb')});db[_0xe742('0x1d3')][_0xe742('0x10e')](db[_0xe742('0xa5')],{'as':_0xe742('0x1c7'),'onDelete':'cascade','foreignKey':_0xe742('0x1c8')});db[_0xe742('0x1d3')][_0xe742('0x10e')](db['DeskField'],{'as':'Descriptions','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0x1d3')][_0xe742('0x10e')](db[_0xe742('0xa5')],{'as':_0xe742('0x1c4'),'onDelete':'cascade','foreignKey':_0xe742('0x1ca')});db['DeskConfiguration'][_0xe742('0x11c')](db[_0xe742('0x1d2')],{'as':'Account','foreignKey':'AccountId'});db['DeskConfiguration'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x1d4')});db['DeskField']['hasMany'](db[_0xe742('0xa5')],{'as':_0xe742('0x1cc'),'foreignKey':'SubjectId'});db['DeskField'][_0xe742('0x10e')](db['DeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0xe742('0xa5')][_0xe742('0x10e')](db[_0xe742('0xa5')],{'as':_0xe742('0x1d1'),'foreignKey':'FieldId'});db[_0xe742('0xa5')]['belongsTo'](db['Variable'],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0xa6')][_0xe742('0x10e')](db[_0xe742('0x1d5')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1cb')});db['ZohoConfiguration'][_0xe742('0x10e')](db[_0xe742('0x1d6')],{'as':_0xe742('0x1c7'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1c8')});db['ZohoConfiguration'][_0xe742('0x10e')](db[_0xe742('0x1d6')],{'as':'Descriptions','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0x1d5')][_0xe742('0x10e')](db[_0xe742('0x1d6')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xe742('0x1ca')});db[_0xe742('0x1d5')][_0xe742('0x11c')](db['ZohoAccount'],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x1cb')});db['ZohoField'][_0xe742('0x10e')](db['ZohoField'],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db['ZohoField'][_0xe742('0x10e')](db['ZohoField'],{'as':_0xe742('0x1cd'),'foreignKey':'DescriptionId'});db[_0xe742('0x1d6')][_0xe742('0x10e')](db['ZohoField'],{'as':_0xe742('0x1d1'),'foreignKey':'FieldId'});db[_0xe742('0x1d6')][_0xe742('0x11c')](db['Variable'],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0x1d7')][_0xe742('0x10e')](db[_0xe742('0xab')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1cb')});db[_0xe742('0xab')][_0xe742('0x10e')](db[_0xe742('0xad')],{'as':_0xe742('0x1c7'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xab')][_0xe742('0x10e')](db[_0xe742('0xad')],{'as':_0xe742('0x1d8'),'foreignKey':'DescriptionId'});db[_0xe742('0xab')]['hasMany'](db[_0xe742('0xad')],{'as':'Fields','foreignKey':_0xe742('0x1ca')});db['ZendeskConfiguration']['belongsTo'](db[_0xe742('0x1d7')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x1cb')});db[_0xe742('0xab')][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x1d9')});db[_0xe742('0xad')][_0xe742('0x10e')](db['ZendeskField'],{'as':'Subject','foreignKey':_0xe742('0x1c8')});db[_0xe742('0xad')][_0xe742('0x10e')](db[_0xe742('0xad')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xad')][_0xe742('0x10e')](db[_0xe742('0xad')],{'as':'Field','foreignKey':_0xe742('0x1ca')});db['ZendeskField'][_0xe742('0x11c')](db[_0xe742('0x8c')],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0xaf')][_0xe742('0x10e')](db[_0xe742('0xb1')],{'as':_0xe742('0x1c6'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0xe742('0xb2')],{'as':_0xe742('0x1c7'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xb1')][_0xe742('0x10e')](db[_0xe742('0xb2')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xe742('0xb1')]['hasMany'](db[_0xe742('0xb2')],{'as':_0xe742('0x1c4'),'onDelete':'cascade','foreignKey':_0xe742('0x1ca')});db[_0xe742('0xb1')]['belongsTo'](db[_0xe742('0xaf')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x1cb')});db['FreshdeskConfiguration'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x1da')});db[_0xe742('0xb2')][_0xe742('0x10e')](db[_0xe742('0xb2')],{'as':_0xe742('0x1cc'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xe742('0x10e')](db[_0xe742('0xb2')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xb2')][_0xe742('0x10e')](db[_0xe742('0xb2')],{'as':_0xe742('0x1d1'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0xb2')][_0xe742('0x11c')](db[_0xe742('0x8c')],{'as':'Variable','foreignKey':_0xe742('0x1cf')});db['VtigerAccount'][_0xe742('0x10e')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1cb')});db[_0xe742('0xb5')][_0xe742('0x10e')](db[_0xe742('0xb7')],{'as':_0xe742('0x1c7'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xb5')][_0xe742('0x10e')](db[_0xe742('0xb7')],{'as':_0xe742('0x1d8'),'foreignKey':_0xe742('0x1ce')});db['VtigerConfiguration'][_0xe742('0x10e')](db['VtigerField'],{'as':_0xe742('0x1c4'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0xb5')]['belongsTo'](db[_0xe742('0x1db')],{'as':'Account','foreignKey':'AccountId'});db[_0xe742('0xb7')]['hasMany'](db['VtigerField'],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xb7')][_0xe742('0x10e')](db[_0xe742('0xb7')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xb7')][_0xe742('0x10e')](db['VtigerField'],{'as':_0xe742('0x1d1'),'foreignKey':'FieldId'});db[_0xe742('0xb7')][_0xe742('0x11c')](db[_0xe742('0x8c')],{'as':'Variable','foreignKey':_0xe742('0x1cf')});db[_0xe742('0xb9')][_0xe742('0x10e')](db[_0xe742('0xba')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1cb')});db['ServicenowConfiguration'][_0xe742('0x10e')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xe742('0x1c8')});db['ServicenowConfiguration'][_0xe742('0x10e')](db[_0xe742('0xbc')],{'as':_0xe742('0x1d8'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration'][_0xe742('0x10e')](db[_0xe742('0xbc')],{'as':_0xe742('0x1c4'),'foreignKey':'FieldId'});db[_0xe742('0xba')][_0xe742('0x11c')](db[_0xe742('0xb9')],{'as':_0xe742('0x170'),'foreignKey':'AccountId'});db[_0xe742('0xbc')][_0xe742('0x10e')](db[_0xe742('0xbc')],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xbc')][_0xe742('0x10e')](db[_0xe742('0xbc')],{'as':_0xe742('0x1cd'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xbc')][_0xe742('0x10e')](db['ServicenowField'],{'as':_0xe742('0x1d1'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0xbc')][_0xe742('0x11c')](db[_0xe742('0x8c')],{'as':'Variable','foreignKey':_0xe742('0x1cf')});db[_0xe742('0xbe')][_0xe742('0x10e')](db[_0xe742('0xc0')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1cb')});db['Dynamics365Account']['belongsTo'](db['CloudProvider'],{'as':_0xe742('0x101'),'foreignKey':'CloudProviderId'});db['Dynamics365Configuration'][_0xe742('0x10e')](db[_0xe742('0xc2')],{'as':'Subjects','onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xc0')][_0xe742('0x10e')](db[_0xe742('0xc2')],{'as':_0xe742('0x1d8'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1ce')});db[_0xe742('0xc0')][_0xe742('0x10e')](db['Dynamics365Field'],{'as':_0xe742('0x1c4'),'onDelete':_0xe742('0x144'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xe742('0x11c')](db[_0xe742('0xbe')],{'as':'Account','foreignKey':_0xe742('0x1cb')});db[_0xe742('0xc2')][_0xe742('0x10e')](db['Dynamics365Field'],{'as':_0xe742('0x1cc'),'foreignKey':'SubjectId'});db[_0xe742('0xc2')][_0xe742('0x10e')](db[_0xe742('0xc2')],{'as':'Description','foreignKey':_0xe742('0x1ce')});db['Dynamics365Field'][_0xe742('0x10e')](db[_0xe742('0xc2')],{'as':_0xe742('0x1d1'),'foreignKey':_0xe742('0x1ca')});db[_0xe742('0xc2')]['belongsTo'](db['Variable'],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0xc3')][_0xe742('0x10e')](db[_0xe742('0xc5')],{'as':_0xe742('0x1c6'),'onDelete':_0xe742('0x144'),'foreignKey':'AccountId'});db[_0xe742('0xc5')][_0xe742('0x10e')](db[_0xe742('0xc7')],{'as':_0xe742('0x1c7'),'foreignKey':_0xe742('0x1c8')});db['FreshsalesConfiguration'][_0xe742('0x10e')](db[_0xe742('0xc7')],{'as':'Descriptions','foreignKey':_0xe742('0x1ce')});db[_0xe742('0xc5')][_0xe742('0x10e')](db[_0xe742('0xc7')],{'as':'Fields','foreignKey':_0xe742('0x1ca')});db[_0xe742('0xc5')]['belongsTo'](db[_0xe742('0xc3')],{'as':_0xe742('0x170'),'foreignKey':_0xe742('0x1cb')});db[_0xe742('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0xe742('0x1cc'),'foreignKey':_0xe742('0x1c8')});db[_0xe742('0xc7')][_0xe742('0x10e')](db[_0xe742('0xc7')],{'as':'Description','foreignKey':_0xe742('0x1ce')});db[_0xe742('0xc7')][_0xe742('0x10e')](db[_0xe742('0xc7')],{'as':_0xe742('0x1d1'),'foreignKey':'FieldId'});db[_0xe742('0xc7')]['belongsTo'](db[_0xe742('0x8c')],{'as':_0xe742('0x8c'),'foreignKey':_0xe742('0x1cf')});db[_0xe742('0x1dc')][_0xe742('0x11c')](db['ChatWebsite'],{});db[_0xe742('0x1dc')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x1dc')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':'ContactId'});db[_0xe742('0x1dc')][_0xe742('0x11c')](db[_0xe742('0x5e')],{});db[_0xe742('0x1dc')][_0xe742('0x11c')](db[_0xe742('0x60')],{});db[_0xe742('0x1dc')]['belongsTo'](db[_0xe742('0x12')],{});db[_0xe742('0x1dc')][_0xe742('0x11c')](db[_0xe742('0x63')],{});db[_0xe742('0xcb')]['belongsTo'](db[_0xe742('0x12')],{'onDelete':'cascade','foreignKey':_0xe742('0x1dd')});db['ChatInternalMessage']['belongsTo'](db['User'],{'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x1de')});db['JscriptySessionReport'][_0xe742('0x10e')](db[_0xe742('0xce')],{'foreignKey':_0xe742('0x1df'),'onDelete':_0xe742('0x144')});db[_0xe742('0x150')]['hasMany'](db[_0xe742('0xcd')],{'foreignKey':_0xe742('0x1df'),'onDelete':_0xe742('0x144')});db[_0xe742('0xd1')][_0xe742('0x11c')](db[_0xe742('0x182')],{});db[_0xe742('0xd1')][_0xe742('0x11c')](db['CmList'],{'as':_0xe742('0x168'),'foreignKey':_0xe742('0x169')});db[_0xe742('0xd1')]['belongsTo'](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0xd1')]['belongsTo'](db[_0xe742('0x4c')],{});db[_0xe742('0xd1')]['belongsTo'](db[_0xe742('0x4e')],{});db[_0xe742('0xd1')]['belongsTo'](db['User'],{});db['SmsQueueReport'][_0xe742('0x11c')](db[_0xe742('0x50')],{});db[_0xe742('0xd7')][_0xe742('0x10e')](db[_0xe742('0x150')],{'foreignKey':_0xe742('0x1e0')});db['JscriptyProject']['hasMany'](db[_0xe742('0xce')],{'foreignKey':_0xe742('0x1e0')});db[_0xe742('0xd7')]['hasMany'](db[_0xe742('0xcd')],{'foreignKey':'ProjectId'});db['SquareProject'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x174'),'through':_0xe742('0x1e1')});db['Team'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':'Agents','through':'user_has_teams'});db[_0xe742('0x126')]['belongsToMany'](db[_0xe742('0x149')],{'through':'TeamVoiceQueue','as':'VoiceQueues'});db[_0xe742('0x126')][_0xe742('0x11f')](db[_0xe742('0x131')],{'through':_0xe742('0x16e'),'as':'MailQueues'});db['Team'][_0xe742('0x11f')](db[_0xe742('0x63')],{'through':_0xe742('0x19b'),'as':_0xe742('0x133')});db[_0xe742('0x126')][_0xe742('0x11f')](db[_0xe742('0x47')],{'through':_0xe742('0x181'),'as':_0xe742('0x134')});db[_0xe742('0x126')][_0xe742('0x11f')](db[_0xe742('0x50')],{'through':_0xe742('0x18a'),'as':'SmsQueues'});db[_0xe742('0x126')]['belongsToMany'](db[_0xe742('0x137')],{'through':_0xe742('0x191'),'as':'OpenchannelQueues'});db['Team'][_0xe742('0x11f')](db[_0xe742('0x1e2')],{'through':_0xe742('0x1e3'),'as':_0xe742('0x139')});db[_0xe742('0x126')][_0xe742('0x11f')](db[_0xe742('0xee')],{'through':_0xe742('0x105'),'as':'VoicePrefixes'});db['Campaign'][_0xe742('0x10e')](db[_0xe742('0x14c')],{'as':_0xe742('0x14d'),'foreignKey':_0xe742('0x1a7')});db[_0xe742('0xe0')][_0xe742('0x10e')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xe742('0x1a7')});db[_0xe742('0xe0')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xe742('0x1a7')});db[_0xe742('0xe0')][_0xe742('0x10e')](db[_0xe742('0x14e')],{'as':_0xe742('0x14f'),'foreignKey':_0xe742('0x1a7')});db[_0xe742('0xe0')][_0xe742('0x11c')](db['Trunk'],{'as':_0xe742('0x26'),'foreignKey':_0xe742('0x1e4')});db['Campaign'][_0xe742('0x11c')](db[_0xe742('0x26')],{'as':_0xe742('0x151'),'foreignKey':_0xe742('0x152')});db['Campaign']['belongsTo'](db[_0xe742('0x79')],{'as':'Interval','foreignKey':_0xe742('0x177')});db[_0xe742('0xe0')]['belongsTo'](db[_0xe742('0x142')],{'as':_0xe742('0x142'),'foreignKey':_0xe742('0x1e5')});db['Campaign'][_0xe742('0x11f')](db[_0xe742('0x124')],{'as':_0xe742('0x154'),'through':_0xe742('0x1e6')});db[_0xe742('0xe0')]['belongsToMany'](db[_0xe742('0x124')],{'as':_0xe742('0x156'),'through':'campaigns_has_cm_blacklists'});db[_0xe742('0xe4')][_0xe742('0x11c')](db[_0xe742('0x61')],{'as':_0xe742('0x61'),'foreignKey':_0xe742('0x19a')});db['MailTransferReport'][_0xe742('0x11c')](db[_0xe742('0x3a')],{});db[_0xe742('0xe7')][_0xe742('0x11c')](db[_0xe742('0x117')],{});db[_0xe742('0xe7')][_0xe742('0x11c')](db[_0xe742('0x13c')],{'foreignKey':_0xe742('0x1e7'),'as':_0xe742('0x1e8')});db[_0xe742('0xe7')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':_0xe742('0x1ea')});db[_0xe742('0xe7')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db[_0xe742('0xe7')]['belongsTo'](db[_0xe742('0x131')],{'foreignKey':_0xe742('0x1ed'),'as':_0xe742('0x1ee')});db[_0xe742('0xe7')][_0xe742('0x11c')](db[_0xe742('0x13c')],{'foreignKey':'ToMailAccountId','as':_0xe742('0x1ef')});db[_0xe742('0xe9')][_0xe742('0x11c')](db['ChatMessage'],{});db[_0xe742('0xe9')]['belongsTo'](db[_0xe742('0x5e')],{});db[_0xe742('0xe9')][_0xe742('0x11c')](db[_0xe742('0x58')],{'foreignKey':_0xe742('0x1f0'),'as':'FromAccount'});db['ChatTransferReport']['belongsTo'](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':_0xe742('0x1ea')});db['ChatTransferReport'][_0xe742('0x11c')](db['User'],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db[_0xe742('0xe9')]['belongsTo'](db[_0xe742('0x63')],{'foreignKey':_0xe742('0x1f1'),'as':_0xe742('0x1ee')});db['ChatTransferReport']['belongsTo'](db[_0xe742('0x58')],{'foreignKey':_0xe742('0x1f2'),'as':_0xe742('0x1ef')});db[_0xe742('0x1f3')]['belongsTo'](db[_0xe742('0x45')],{});db['FaxTransferReport'][_0xe742('0x11c')](db[_0xe742('0x115')],{});db['FaxTransferReport'][_0xe742('0x11c')](db[_0xe742('0x40')],{'foreignKey':'FromFaxAccountId','as':_0xe742('0x1e8')});db[_0xe742('0x1f3')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':_0xe742('0x1ea')});db['FaxTransferReport'][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db['FaxTransferReport']['belongsTo'](db[_0xe742('0x47')],{'foreignKey':_0xe742('0x1f4'),'as':'ToQueue'});db[_0xe742('0x1f3')]['belongsTo'](db[_0xe742('0x40')],{'foreignKey':_0xe742('0x1f5'),'as':_0xe742('0x1ef')});db[_0xe742('0xeb')][_0xe742('0x11c')](db[_0xe742('0x55')],{});db[_0xe742('0xeb')][_0xe742('0x11c')](db[_0xe742('0x54')],{});db[_0xe742('0xeb')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'FromOpenchannelAccountId','as':_0xe742('0x1e8')});db[_0xe742('0xeb')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':'FromAgent'});db['OpenchannelTransferReport'][_0xe742('0x11c')](db['User'],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db['OpenchannelTransferReport'][_0xe742('0x11c')](db[_0xe742('0x137')],{'foreignKey':_0xe742('0x1f6'),'as':'ToQueue'});db[_0xe742('0xeb')][_0xe742('0x11c')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db['SmsTransferReport'][_0xe742('0x11c')](db['SmsMessage'],{});db['SmsTransferReport'][_0xe742('0x11c')](db[_0xe742('0x4c')],{});db[_0xe742('0xec')][_0xe742('0x11c')](db[_0xe742('0x182')],{'foreignKey':'FromSmsAccountId','as':_0xe742('0x1e8')});db[_0xe742('0xec')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':_0xe742('0x1ea')});db[_0xe742('0xec')]['belongsTo'](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db['SmsTransferReport'][_0xe742('0x11c')](db[_0xe742('0x50')],{'foreignKey':_0xe742('0x1f7'),'as':_0xe742('0x1ee')});db[_0xe742('0xec')][_0xe742('0x11c')](db[_0xe742('0x182')],{'foreignKey':_0xe742('0x1f8'),'as':'ToAccount'});db[_0xe742('0x124')][_0xe742('0x10e')](db[_0xe742('0x76')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0xe742('0x144')});db[_0xe742('0x124')][_0xe742('0x10e')](db[_0xe742('0x6f')],{'as':_0xe742('0x1f9'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x124')][_0xe742('0x10e')](db[_0xe742('0x121')],{'as':_0xe742('0x122'),'onDelete':'cascade','foreignKey':_0xe742('0x169')});db[_0xe742('0x124')][_0xe742('0x10e')](db[_0xe742('0x6a')],{'as':_0xe742('0x113'),'foreignKey':_0xe742('0x169')});db[_0xe742('0x124')][_0xe742('0x10e')](db[_0xe742('0x6c')],{'as':'HopperHistory','foreignKey':_0xe742('0x169')});db[_0xe742('0x124')]['hasMany'](db[_0xe742('0x6e')],{'as':_0xe742('0x6e'),'foreignKey':'ListId'});db[_0xe742('0x124')][_0xe742('0x11f')](db[_0xe742('0x149')],{'as':_0xe742('0x1fa'),'through':_0xe742('0x1fb')});db['CmList'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x125')});db['VoicePrefix'][_0xe742('0x10e')](db[_0xe742('0x17')],{'as':'Extensions','onDelete':'cascade'});db['VoicePrefix'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x107')});db['VoicePrefix']['belongsToMany'](db[_0xe742('0x126')],{'through':'TeamVoicePrefix','as':_0xe742('0x155')});db[_0xe742('0x11d')][_0xe742('0x10e')](db['User'],{'as':'Users','foreignKey':_0xe742('0x11e')});db[_0xe742('0x11d')][_0xe742('0x10e')](db[_0xe742('0xf1')],{'as':_0xe742('0x1fc'),'foreignKey':_0xe742('0x11e'),'onDelete':'cascade'});db['UserProfileSection'][_0xe742('0x10e')](db['UserProfileResource'],{'as':_0xe742('0x1fd'),'foreignKey':_0xe742('0x1fe'),'onDelete':_0xe742('0x144')});db[_0xe742('0xf5')][_0xe742('0x10e')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe742('0x1ff'),'onDelete':_0xe742('0x144')});db[_0xe742('0xf5')][_0xe742('0x10e')](db[_0xe742('0x74')],{'as':_0xe742('0x17c'),'foreignKey':_0xe742('0x1ff')});db[_0xe742('0xf5')][_0xe742('0x10e')](db['WhatsappMessage'],{'as':_0xe742('0x158'),'foreignKey':_0xe742('0x1ff')});db['WhatsappAccount'][_0xe742('0x10e')](db[_0xe742('0xf9')],{'as':_0xe742('0x166')});db[_0xe742('0xf5')][_0xe742('0x10e')](db['WhatsappApplication'],{'as':_0xe742('0x145')});db[_0xe742('0xf5')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':_0xe742('0x168'),'foreignKey':'ListId'});db[_0xe742('0xf5')][_0xe742('0x11c')](db[_0xe742('0x7a')],{'as':_0xe742('0x16b'),'foreignKey':_0xe742('0x153')});db[_0xe742('0xf5')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':'user_has_whatsapp_accounts'});db['WhatsappApplication']['belongsTo'](db['User'],{'onDelete':_0xe742('0x163')});db['WhatsappApplication'][_0xe742('0x11c')](db[_0xe742('0x1e2')],{'onDelete':_0xe742('0x163')});db[_0xe742('0xf7')][_0xe742('0x11c')](db[_0xe742('0xf5')],{'onDelete':'restrict'});db[_0xe742('0xf7')]['belongsTo'](db[_0xe742('0x79')],{'onDelete':_0xe742('0x163'),'foreignKey':'IntervalId'});db[_0xe742('0xf7')][_0xe742('0x11c')](db[_0xe742('0x83')],{'onDelete':_0xe742('0x163'),'foreignKey':'TagId'});db[_0xe742('0xf9')][_0xe742('0x10e')](db[_0xe742('0xfb')],{'as':_0xe742('0x158'),'onDelete':_0xe742('0x144'),'foreignKey':_0xe742('0x200')});db[_0xe742('0xf9')]['belongsTo'](db['WhatsappAccount'],{'as':_0xe742('0x170'),'foreignKey':'WhatsappAccountId'});db[_0xe742('0xf9')][_0xe742('0x11c')](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':'ContactId'});db[_0xe742('0xf9')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':_0xe742('0x186'),'foreignKey':'UserId'});db['WhatsappInteraction'][_0xe742('0x11f')](db[_0xe742('0x83')],{'through':_0xe742('0x1b7'),'as':_0xe742('0x172')});db[_0xe742('0xf9')][_0xe742('0x11f')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xe742('0xf9')][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x174'),'through':_0xe742('0x12e'),'foreignKey':_0xe742('0x200')});db[_0xe742('0xfb')]['belongsTo'](db['User'],{'as':'User'});db[_0xe742('0xfb')]['belongsTo'](db['CmContact'],{'onDelete':_0xe742('0x144'),'as':_0xe742('0x15e')});db[_0xe742('0xfb')][_0xe742('0x11c')](db[_0xe742('0xf9')],{'onDelete':'cascade','as':_0xe742('0x190'),'foreignKey':_0xe742('0x200')});db[_0xe742('0xfb')][_0xe742('0x11c')](db[_0xe742('0xf5')],{'as':'Account','foreignKey':_0xe742('0x1ff')});db['WhatsappQueueReport'][_0xe742('0x11c')](db[_0xe742('0xf5')],{});db[_0xe742('0xfd')][_0xe742('0x11c')](db[_0xe742('0x124')],{'as':'List','foreignKey':_0xe742('0x169')});db[_0xe742('0xfd')]['belongsTo'](db[_0xe742('0x121')],{'as':_0xe742('0x15e'),'foreignKey':_0xe742('0x15f')});db[_0xe742('0xfd')][_0xe742('0x11c')](db[_0xe742('0xf9')],{});db[_0xe742('0xfd')][_0xe742('0x11c')](db[_0xe742('0x1e2')],{});db['WhatsappQueueReport'][_0xe742('0x11c')](db[_0xe742('0xfb')],{});db[_0xe742('0xfd')]['belongsTo'](db[_0xe742('0x12')],{});db['WhatsappTransferReport']['belongsTo'](db[_0xe742('0xfb')],{});db[_0xe742('0xff')]['belongsTo'](db[_0xe742('0xf9')],{});db[_0xe742('0xff')][_0xe742('0x11c')](db[_0xe742('0xf5')],{'foreignKey':_0xe742('0x201'),'as':_0xe742('0x1e8')});db[_0xe742('0xff')][_0xe742('0x11c')](db[_0xe742('0xf5')],{'foreignKey':_0xe742('0x202'),'as':_0xe742('0x1ef')});db[_0xe742('0xff')][_0xe742('0x11c')](db[_0xe742('0x1e2')],{'foreignKey':_0xe742('0x203'),'as':_0xe742('0x1ee')});db[_0xe742('0xff')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1e9'),'as':_0xe742('0x1ea')});db[_0xe742('0xff')][_0xe742('0x11c')](db[_0xe742('0x12')],{'foreignKey':_0xe742('0x1eb'),'as':_0xe742('0x1ec')});db['WhatsappQueue'][_0xe742('0x11f')](db[_0xe742('0x12')],{'as':_0xe742('0x16d'),'through':_0xe742('0x34'),'foreignKey':_0xe742('0x204')});db['WhatsappQueue'][_0xe742('0x11f')](db[_0xe742('0x126')],{'through':'team_has_whatsapp_queues','as':_0xe742('0x155')});db[_0xe742('0x10c')][_0xe742('0x11c')](db[_0xe742('0x12')],{'as':_0xe742('0x205'),'foreignKey':_0xe742('0x10b'),'onDelete':'cascade','hooks':!![]});db[_0xe742('0x101')][_0xe742('0x10a')](db[_0xe742('0xbe')],{'as':'Dynamics365Account','onDelete':_0xe742('0x163')});db['CloudProvider'][_0xe742('0x10a')](db[_0xe742('0x160')],{'as':_0xe742('0x164'),'onDelete':_0xe742('0x163')});db[_0xe742('0x101')]['hasOne'](db[_0xe742('0x36')],{'as':_0xe742('0x206'),'onDelete':'restrict'});module[_0xe742('0x207')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0x8171=['IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/user-setting/user-setting.model','hasOne','cascade','UserSetting','userSetting','UserId','User','hasMany','Recordings','VoiceQueuesRt','HopperFinals','OpenchannelInteractions','ChatInteractions','SmsInteraction','SmsInteractions','FaxInteractions','WhatsappInteraction','WhatsappInteractions','UserNotification','UserNotifications','SenderId','belongsTo','UserProfile','ChatGroup','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProject','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','Agents','Teams','TeamVoiceQueue','BlackLists','VoiceMailMessage','Messages','mailbox','VoiceQueueReport','QueueCalls','VoiceAgentReport','AgentReports','uniqueid','CmContact','Contact','MailAccountId','restrict','MailServerOut','CloudProviderId','Imap','Dispositions','Answers','MailMessage','Interactions','TemplateId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','Account','ChatOfflineMessageId','TagId','MailQueueReport','ContactId','FaxAccountId','FaxAccount','Exntensions','List','ListId','mandatoryDispositionPauseId','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','SmsMessage','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelMessage','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','ChatMessage','Agent','ChatQueue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','ChatGroupId','CompanyId','Phones','MailInteractions','Company','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','Queue','Campaign','CampaignId','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','Mohs','moh_has_sounds','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','CmHopperId','CmContactId','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmConfiguration','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','FreshdeskConfiguration','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerConfiguration','VtigerField','ServicenowField','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_chat_queues','VoicePrefix','VoicePrefixes','HopperBlacks','TrunkId','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','voice_queues_has_cm_lists','userProfileId','UserProfileSections','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','Smtp','exports','../config/environment','lodash','jstz','sequelize','defaultsDeep','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','motion2','xcall','xC@LL1234','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatInteraction','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration'];(function(_0x468ec1,_0x5715b6){var _0x2cf63a=function(_0x32b4db){while(--_0x32b4db){_0x468ec1['push'](_0x468ec1['shift']());}};_0x2cf63a(++_0x5715b6);}(_0x8171,0x16b));var _0x1817=function(_0x2bd69a,_0x5b7873){_0x2bd69a=_0x2bd69a-0x0;var _0x135734=_0x8171[_0x2bd69a];return _0x135734;};'use strict';var config=require(_0x1817('0x0'));var Sequelize=require('sequelize');var _=require(_0x1817('0x1'));var jstz=require(_0x1817('0x2'));var timezone=jstz['determine']();config[_0x1817('0x3')]=_[_0x1817('0x4')](config[_0x1817('0x3')],{'database':'motion2','username':'xcall','password':'xC@LL1234','options':{'host':_0x1817('0x5'),'port':0xcea,'dialect':_0x1817('0x6'),'dialectOptions':{'charset':_0x1817('0x7')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x1817('0x8'),'collate':_0x1817('0x9')}}});config[_0x1817('0xa')]=_[_0x1817('0x4')](config[_0x1817('0xa')],{'database':_0x1817('0xb'),'username':_0x1817('0xc'),'password':_0x1817('0xd'),'options':{'host':_0x1817('0x5'),'port':0xcea,'dialect':_0x1817('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x1817('0x8'),'collate':_0x1817('0x9')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1817('0x3')][_0x1817('0xe')],config[_0x1817('0x3')][_0x1817('0xf')],config['sequelize'][_0x1817('0x10')],config[_0x1817('0x3')][_0x1817('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x1817('0xa')][_0x1817('0xe')],config[_0x1817('0xa')][_0x1817('0xf')],config[_0x1817('0xa')]['password'],config[_0x1817('0xa')]['options'])};db['User']=db[_0x1817('0x3')]['import'](_0x1817('0x12'));db[_0x1817('0x13')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x15'));db[_0x1817('0x16')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/voiceContext/voiceContext.model');db[_0x1817('0x17')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x18'));db[_0x1817('0x19')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x1a'));db[_0x1817('0x1b')]=db['sequelize'][_0x1817('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x1817('0x1c')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x1d'));db['ScreenRecording']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x1e'));db[_0x1817('0x1f')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x20'));db['VoiceMailMessage']=db['sequelize'][_0x1817('0x14')](_0x1817('0x21'));db[_0x1817('0x22')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x23'));db[_0x1817('0x24')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x25'));db['VoiceQueueReport']=db['sequelize']['import'](_0x1817('0x26'));db[_0x1817('0x27')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x28'));db[_0x1817('0x29')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x2a'));db[_0x1817('0x2b')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x2c'));db[_0x1817('0x2d')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x2e'));db['UserVoiceQueue']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x2f'));db[_0x1817('0x30')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x31'));db[_0x1817('0x32')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x33'));db[_0x1817('0x34')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x35'));db[_0x1817('0x36')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/userSmsQueue/userSmsQueue.model');db[_0x1817('0x37')]=db[_0x1817('0x3')]['import'](_0x1817('0x38'));db[_0x1817('0x39')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x3a'));db[_0x1817('0x3b')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0x1817('0x3')]['import'](_0x1817('0x3c'));db['MailAccount']=db[_0x1817('0x3')]['import'](_0x1817('0x3d'));db[_0x1817('0x3e')]=db[_0x1817('0x3')]['import']('../api/mailQueue/mailQueue.model');db[_0x1817('0x3f')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x40'));db[_0x1817('0x41')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x42'));db['MailMessage']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x43'));db[_0x1817('0x44')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x45'));db['MailQueueReport']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x46'));db[_0x1817('0x47')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x48'));db['DashboardItem']=db[_0x1817('0x3')]['import'](_0x1817('0x49'));db['FaxAccount']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x4a'));db[_0x1817('0x4b')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/faxApplication/faxApplication.model');db[_0x1817('0x4c')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x4d'));db[_0x1817('0x4e')]=db[_0x1817('0x3')]['import'](_0x1817('0x4f'));db[_0x1817('0x50')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/faxQueue/faxQueue.model');db[_0x1817('0x51')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x1817('0x52')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x53'));db[_0x1817('0x54')]=db[_0x1817('0x3')]['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db['sequelize'][_0x1817('0x14')](_0x1817('0x55'));db['SmsMessage']=db['sequelize'][_0x1817('0x14')]('../api/smsMessage/smsMessage.model');db[_0x1817('0x56')]=db[_0x1817('0x3')]['import'](_0x1817('0x57'));db[_0x1817('0x58')]=db[_0x1817('0x3')]['import'](_0x1817('0x59'));db[_0x1817('0x5a')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/openchannelApplication/openchannelApplication.model');db[_0x1817('0x5b')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x5c'));db['OpenchannelMessage']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x5d'));db[_0x1817('0x5e')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x5f'));db['ChatWebsite']=db['sequelize'][_0x1817('0x14')](_0x1817('0x60'));db[_0x1817('0x61')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x62'));db['ChatApplication']=db[_0x1817('0x3')]['import']('../api/chatApplication/chatApplication.model');db[_0x1817('0x63')]=db['sequelize']['import']('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db['sequelize'][_0x1817('0x14')]('../api/chatMessage/chatMessage.model');db[_0x1817('0x64')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x65'));db['ChatQueue']=db[_0x1817('0x3')]['import']('../api/chatQueue/chatQueue.model');db['ChatGroup']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x66'));db[_0x1817('0x67')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x68'));db[_0x1817('0x69')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x6a'));db['CmContact']=db['sequelize'][_0x1817('0x14')](_0x1817('0x6b'));db[_0x1817('0x6c')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/cmHopper/cmHopper.model');db[_0x1817('0x6d')]=db['sequelize']['import'](_0x1817('0x6e'));db[_0x1817('0x6f')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x70'));db[_0x1817('0x71')]=db[_0x1817('0x3')]['import'](_0x1817('0x72'));db[_0x1817('0x73')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x74'));db[_0x1817('0x75')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x76'));db[_0x1817('0x77')]=db[_0x1817('0x3')]['import'](_0x1817('0x78'));db[_0x1817('0x79')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x7a'));db[_0x1817('0x7b')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x7c'));db[_0x1817('0x7d')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x7e'));db[_0x1817('0x7f')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/condition/condition.model');db[_0x1817('0x80')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x81'));db[_0x1817('0x82')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x83'));db['Cdr']=db[_0x1817('0x3')]['import'](_0x1817('0x84'));db[_0x1817('0x85')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x86'));db[_0x1817('0x87')]=db[_0x1817('0x3')]['import'](_0x1817('0x88'));db[_0x1817('0x89')]=db[_0x1817('0x3')]['import'](_0x1817('0x8a'));db[_0x1817('0x8b')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/tag/tag.model');db[_0x1817('0x8c')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x8d'));db[_0x1817('0x8e')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x8f'));db['CmHopperAdditionalPhone']=db[_0x1817('0x3')]['import']('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0x1817('0x90')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x91'));db[_0x1817('0x92')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/trigger/trigger.model');db[_0x1817('0x93')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x94'));db[_0x1817('0x95')]=db['sequelize'][_0x1817('0x14')]('../api/integration/integration.model');db[_0x1817('0x96')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x97'));db[_0x1817('0x98')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x99'));db[_0x1817('0x9a')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x9b'));db['AnalyticExtractedReport']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/analyticMetric/analyticMetric.model');db[_0x1817('0x9c')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x1817('0x9d')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x9e'));db[_0x1817('0x9f')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xa0'));db[_0x1817('0xa1')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xa2'));db[_0x1817('0xa3')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xa4'));db[_0x1817('0xa5')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xa6'));db['SugarcrmConfiguration']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xa7'));db[_0x1817('0xa8')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xa9'));db[_0x1817('0xaa')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0x1817('0xab')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xac'));db[_0x1817('0xad')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xae'));db[_0x1817('0xaf')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xb0'));db[_0x1817('0xb1')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xb2'));db[_0x1817('0xb3')]=db[_0x1817('0x3')]['import']('../api/intZohoField/intZohoField.model');db[_0x1817('0xb4')]=db[_0x1817('0x3')]['import']('../api/intZendeskAccount/intZendeskAccount.model');db[_0x1817('0xb5')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x1817('0xb6')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x1817('0x3')]['import'](_0x1817('0xb7'));db['FreshdeskConfiguration']=db[_0x1817('0x3')]['import'](_0x1817('0xb8'));db[_0x1817('0xb9')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xba'));db[_0x1817('0xbb')]=db[_0x1817('0x3')]['import'](_0x1817('0xbc'));db['VtigerConfiguration']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xbd'));db['VtigerField']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xbe'));db[_0x1817('0xbf')]=db['sequelize']['import'](_0x1817('0xc0'));db[_0x1817('0xc1')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db['ServicenowField']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xc2'));db[_0x1817('0xc3')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xc4'));db[_0x1817('0xc5')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xc6'));db[_0x1817('0xc7')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xc8'));db[_0x1817('0xc9')]=db['sequelize'][_0x1817('0x14')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x1817('0xca')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xcb'));db[_0x1817('0xcc')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xcd'));db[_0x1817('0x95')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/integration/integration.model');db[_0x1817('0xce')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xcf'));db[_0x1817('0xd0')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/chatQueueReport/chatQueueReport.model');db[_0x1817('0xd1')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0x1817('0xd2')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xd3'));db[_0x1817('0xd4')]=db[_0x1817('0x3')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0x1817('0xd5')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xd6'));db[_0x1817('0xd7')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xd8'));db['SquareReport']=db['sequelize']['import'](_0x1817('0xd9'));db[_0x1817('0xda')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xdb'));db['JscriptyProject']=db[_0x1817('0x3')]['import'](_0x1817('0xdc'));db[_0x1817('0xdd')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xde'));db[_0x1817('0xdf')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xe0'));db['SquareProject']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/squareProject/squareProject.model');db['SquareRecording']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xe1'));db[_0x1817('0xe2')]=db[_0x1817('0x3')]['import'](_0x1817('0xe3'));db[_0x1817('0xe4')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xe5'));db[_0x1817('0xe6')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xe7'));db['Campaign']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xe8'));db[_0x1817('0xe9')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xea'));db[_0x1817('0xeb')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/attachment/attachment.model');db[_0x1817('0xec')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xed'));db[_0x1817('0xee')]=db['sequelize'][_0x1817('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x1817('0xef')]=db[_0x1817('0x3')][_0x1817('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x1817('0xf0')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xf1'));db[_0x1817('0xf2')]=db[_0x1817('0x3')]['import'](_0x1817('0xf3'));db[_0x1817('0xf4')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xf5'));db[_0x1817('0xf6')]=db['sequelize']['import'](_0x1817('0xf7'));db['VoicePrefix']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xf8'));db[_0x1817('0xf9')]=db['sequelize'][_0x1817('0x14')]('../api/userProfileResource/userProfileResource.model');db['UserNotification']=db[_0x1817('0x3')][_0x1817('0x14')]('../api/userNotification/userNotification.model');db[_0x1817('0xfa')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xfb'));db['WhatsappApplication']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0xfc'));db['WhatsappInteraction']=db['sequelize'][_0x1817('0x14')](_0x1817('0xfd'));db[_0x1817('0xfe')]=db['sequelize'][_0x1817('0x14')](_0x1817('0xff'));db[_0x1817('0x100')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x101'));db[_0x1817('0x102')]=db[_0x1817('0x3')]['import']('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x1817('0x103')]=db['sequelize'][_0x1817('0x14')](_0x1817('0x104'));db[_0x1817('0x105')]=db[_0x1817('0x3')]['import'](_0x1817('0x106'));db['TeamVoiceQueue']=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x107'));db[_0x1817('0x108')]=db[_0x1817('0x3')][_0x1817('0x14')](_0x1817('0x109'));db['UserVoicePrefix']=db['sequelize']['import']('../api/userVoicePrefix/userVoicePrefix.model');db['UserSetting']=db['sequelize']['import'](_0x1817('0x10a'));db['User'][_0x1817('0x10b')](db['VoiceMail'],{'as':'VoiceMail','onDelete':_0x1817('0x10c'),'foreignKey':'UserId'});db['User'][_0x1817('0x10b')](db[_0x1817('0x10d')],{'as':_0x1817('0x10e'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')][_0x1817('0x111')](db[_0x1817('0x1c')],{'as':_0x1817('0x112'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x1817('0x113'),'foreignKey':'UserId'});db[_0x1817('0x110')][_0x1817('0x111')](db[_0x1817('0x17')],{'as':'Extensions','onDelete':_0x1817('0x10c'),'hooks':!![]});db[_0x1817('0x110')][_0x1817('0x111')](db['CmHopperFinal'],{'as':_0x1817('0x114'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')]['hasMany'](db[_0x1817('0x71')],{'as':'HopperHistory','foreignKey':_0x1817('0x10f')});db['User'][_0x1817('0x111')](db[_0x1817('0x73')],{'as':_0x1817('0x73'),'foreignKey':'UserId'});db[_0x1817('0x110')]['hasMany'](db[_0x1817('0x5b')],{'as':_0x1817('0x115'),'foreignKey':_0x1817('0x10f')});db['User'][_0x1817('0x111')](db['ChatInteraction'],{'as':_0x1817('0x116'),'foreignKey':'UserId'});db['User'][_0x1817('0x111')](db[_0x1817('0x117')],{'as':_0x1817('0x118'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')]['hasMany'](db[_0x1817('0x4c')],{'as':_0x1817('0x119'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')][_0x1817('0x111')](db[_0x1817('0x41')],{'as':'MailInteractions','foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')]['hasMany'](db[_0x1817('0x11a')],{'as':_0x1817('0x11b'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x110')][_0x1817('0x111')](db[_0x1817('0x11c')],{'as':_0x1817('0x11d'),'foreignKey':_0x1817('0x11e')});db[_0x1817('0x110')][_0x1817('0x11f')](db['UserProfile'],{'as':_0x1817('0x120'),'foreignKey':'userProfileId'});db[_0x1817('0x110')]['belongsToMany'](db[_0x1817('0x121')],{'as':'Groups','through':_0x1817('0x122')});db[_0x1817('0x110')][_0x1817('0x123')](db['CmContact'],{'as':_0x1817('0x124'),'through':_0x1817('0x125')});db['User'][_0x1817('0x123')](db[_0x1817('0xf6')],{'as':_0x1817('0x126'),'through':_0x1817('0x127')});db[_0x1817('0x110')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0x1817('0x110')]['belongsToMany'](db[_0x1817('0x41')],{'as':'MailInteractions','through':_0x1817('0x128')});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x63')],{'as':_0x1817('0x116'),'through':'user_has_chat_interactions'});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x4c')],{'as':_0x1817('0x119'),'through':'user_has_fax_interactions'});db['User'][_0x1817('0x123')](db[_0x1817('0x117')],{'as':_0x1817('0x118'),'through':_0x1817('0x129')});db['User'][_0x1817('0x123')](db['OpenchannelInteraction'],{'as':_0x1817('0x115'),'through':_0x1817('0x12a')});db[_0x1817('0x110')][_0x1817('0x123')](db['WhatsappInteraction'],{'as':_0x1817('0x11b'),'through':_0x1817('0x12b')});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x1b')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0x1817('0x110')]['belongsToMany'](db['VoicePrefix'],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x3e')],{'as':_0x1817('0x12c'),'through':_0x1817('0x32'),'required':![]});db[_0x1817('0x110')]['belongsToMany'](db['ChatQueue'],{'as':_0x1817('0x12d'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x1817('0x123')](db['FaxQueue'],{'as':_0x1817('0x12e'),'through':_0x1817('0x34'),'required':![]});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x56')],{'as':_0x1817('0x12f'),'through':'UserSmsQueue','required':![]});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x5e')],{'as':_0x1817('0x130'),'through':_0x1817('0x37'),'required':![]});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x103')],{'as':_0x1817('0x131'),'through':_0x1817('0x39'),'required':![]});db[_0x1817('0x110')][_0x1817('0x123')](db['CmList'],{'through':_0x1817('0x127')});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x132')],{'as':_0x1817('0x133'),'through':_0x1817('0x134')});db[_0x1817('0x110')][_0x1817('0x123')](db['FaxAccount'],{'as':_0x1817('0x135'),'through':_0x1817('0x136')});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x137')],{'as':_0x1817('0x138'),'through':'user_has_mail_accounts'});db[_0x1817('0x110')]['belongsToMany'](db[_0x1817('0x58')],{'as':_0x1817('0x139'),'through':_0x1817('0x13a')});db[_0x1817('0x110')][_0x1817('0x123')](db['SmsAccount'],{'as':_0x1817('0x13b'),'through':_0x1817('0x13c')});db['User'][_0x1817('0x123')](db[_0x1817('0xfa')],{'as':_0x1817('0x13d'),'through':_0x1817('0x13e')});db[_0x1817('0x110')][_0x1817('0x123')](db[_0x1817('0x13f')],{'as':_0x1817('0x140'),'through':_0x1817('0x141')});db['VoiceChanSpy'][_0x1817('0x111')](db[_0x1817('0x17')],{'as':_0x1817('0x142'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x143')});db[_0x1817('0x16')][_0x1817('0x111')](db[_0x1817('0x17')],{'onDelete':_0x1817('0x10c')});db[_0x1817('0x17')][_0x1817('0x111')](db[_0x1817('0x17')],{'as':_0x1817('0x144'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x19')][_0x1817('0x123')](db[_0x1817('0x89')],{'as':_0x1817('0x145'),'through':'moh_has_sounds'});db[_0x1817('0x1b')][_0x1817('0x111')](db[_0x1817('0x2d')],{'as':_0x1817('0x146'),'foreignKey':_0x1817('0x147')});db[_0x1817('0x1b')]['hasMany'](db['CmHopper'],{'as':_0x1817('0x148'),'foreignKey':'VoiceQueueId'});db[_0x1817('0x1b')]['hasMany'](db[_0x1817('0x6f')],{'as':_0x1817('0x114'),'foreignKey':_0x1817('0x147')});db['VoiceQueue'][_0x1817('0x111')](db['CmHopperHistory'],{'as':_0x1817('0x149'),'foreignKey':_0x1817('0x147')});db[_0x1817('0x1b')][_0x1817('0x111')](db[_0x1817('0x73')],{'as':_0x1817('0x73'),'foreignKey':_0x1817('0x147')});db[_0x1817('0x1b')][_0x1817('0x111')](db[_0x1817('0x6d')],{'as':'HopperBlacks','foreignKey':_0x1817('0x147')});db['VoiceQueue'][_0x1817('0x111')](db[_0x1817('0xd5')],{'as':_0x1817('0x14a'),'foreignKey':_0x1817('0x147')});db[_0x1817('0x1b')][_0x1817('0x11f')](db[_0x1817('0x29')],{'as':_0x1817('0x29'),'foreignKey':'TrunkId'});db[_0x1817('0x1b')][_0x1817('0x11f')](db[_0x1817('0x29')],{'as':_0x1817('0x14b'),'foreignKey':_0x1817('0x14c')});db[_0x1817('0x1b')]['belongsTo'](db[_0x1817('0x80')],{'as':'Interval','foreignKey':_0x1817('0x14d')});db[_0x1817('0x1b')][_0x1817('0x11f')](db[_0x1817('0x82')],{'as':_0x1817('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1817('0x1b')][_0x1817('0x123')](db[_0x1817('0xf6')],{'as':_0x1817('0x126'),'through':'voice_queues_has_cm_lists'});db[_0x1817('0x1b')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':'UserVoiceQueue'});db[_0x1817('0x1b')][_0x1817('0x123')](db[_0x1817('0xe4')],{'as':_0x1817('0x150'),'through':_0x1817('0x151')});db[_0x1817('0x1b')][_0x1817('0x123')](db[_0x1817('0xf6')],{'as':_0x1817('0x152'),'through':'voice_queues_has_cm_blacklists'});db[_0x1817('0x1c')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x110'),'foreignKey':_0x1817('0x10f')});db['ScreenRecording']['belongsTo'](db[_0x1817('0x110')],{'as':_0x1817('0x110'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x1f')][_0x1817('0x111')](db[_0x1817('0x153')],{'as':_0x1817('0x154'),'onDelete':_0x1817('0x10c'),'foreignKey':'mailboxuser','sourceKey':_0x1817('0x155')});db['VoiceMailMessage'][_0x1817('0x11f')](db[_0x1817('0x1f')],{'foreignKey':'mailboxuser','targetKey':_0x1817('0x155')});db['VoiceCallReport']['hasMany'](db[_0x1817('0x156')],{'as':_0x1817('0x157'),'foreignKey':'uniqueid','constraints':![]});db[_0x1817('0x22')]['hasMany'](db[_0x1817('0x158')],{'as':_0x1817('0x159'),'foreignKey':_0x1817('0x15a'),'constraints':![]});db[_0x1817('0x22')]['belongsTo'](db[_0x1817('0x110')],{'as':_0x1817('0x110'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x22')]['belongsTo'](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':'ContactId'});db[_0x1817('0x3b')]['belongsTo'](db[_0x1817('0x137')],{'as':_0x1817('0x137'),'foreignKey':_0x1817('0x15d')});db[_0x1817('0x3b')][_0x1817('0x11f')](db[_0x1817('0x105')],{'as':_0x1817('0x105'),'foreignKey':'CloudProviderId','onDelete':_0x1817('0x15e')});db[_0x1817('0x15f')][_0x1817('0x11f')](db[_0x1817('0x137')],{'as':_0x1817('0x137'),'foreignKey':_0x1817('0x15d')});db[_0x1817('0x15f')][_0x1817('0x11f')](db[_0x1817('0x105')],{'as':_0x1817('0x105'),'foreignKey':_0x1817('0x160'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x137')][_0x1817('0x10b')](db[_0x1817('0x3b')],{'as':_0x1817('0x161'),'onDelete':_0x1817('0x10c')});db['MailAccount']['hasOne'](db['MailServerOut'],{'as':'Smtp','onDelete':_0x1817('0x10c')});db[_0x1817('0x137')][_0x1817('0x111')](db[_0x1817('0x7d')],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x15d'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x137')][_0x1817('0x111')](db['CannedAnswer'],{'as':_0x1817('0x163'),'foreignKey':_0x1817('0x15d')});db[_0x1817('0x137')]['hasMany'](db[_0x1817('0x164')],{'as':'Messages','foreignKey':_0x1817('0x15d')});db[_0x1817('0x137')]['hasMany'](db[_0x1817('0x41')],{'as':_0x1817('0x165')});db[_0x1817('0x137')][_0x1817('0x111')](db['MailApplication'],{'as':'Applications'});db[_0x1817('0x137')]['belongsTo'](db[_0x1817('0xf6')],{'as':'List','foreignKey':'ListId'});db[_0x1817('0x137')]['belongsTo'](db[_0x1817('0x90')],{'as':_0x1817('0x90'),'foreignKey':_0x1817('0x166')});db[_0x1817('0x137')][_0x1817('0x11f')](db[_0x1817('0x82')],{'as':_0x1817('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1817('0x137')][_0x1817('0x123')](db['User'],{'as':_0x1817('0x14f'),'through':_0x1817('0x167')});db[_0x1817('0x3e')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':'Agents','through':_0x1817('0x32')});db[_0x1817('0x3e')][_0x1817('0x123')](db[_0x1817('0xe4')],{'through':_0x1817('0x168'),'as':_0x1817('0x150')});db[_0x1817('0x41')][_0x1817('0x111')](db[_0x1817('0x164')],{'as':_0x1817('0x154'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x169')});db['MailInteraction']['belongsTo'](db[_0x1817('0x137')],{'as':'Account','foreignKey':_0x1817('0x15d')});db['MailInteraction']['belongsTo'](db[_0x1817('0x15b')],{'as':'Contact','foreignKey':'ContactId'});db[_0x1817('0x41')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x16a'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x41')]['belongsToMany'](db[_0x1817('0x8b')],{'through':_0x1817('0x16b'),'as':_0x1817('0x16c')});db['MailInteraction'][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x16b'),'as':_0x1817('0x16d')});db['MailInteraction']['belongsToMany'](db['User'],{'as':_0x1817('0x16e'),'through':_0x1817('0x128'),'foreignKey':'MailInteractionId'});db[_0x1817('0x164')][_0x1817('0x111')](db[_0x1817('0xeb')],{'as':_0x1817('0x16f'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x164')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x110')});db[_0x1817('0x164')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':'Contact'});db['MailMessage'][_0x1817('0x11f')](db[_0x1817('0x41')],{'as':_0x1817('0x170'),'foreignKey':_0x1817('0x169')});db[_0x1817('0x164')][_0x1817('0x11f')](db['MailAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x15d')});db[_0x1817('0x164')][_0x1817('0x11f')](db[_0x1817('0x132')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db[_0x1817('0x164')][_0x1817('0x11f')](db['ChatOfflineMessage'],{'as':_0x1817('0x64'),'foreignKey':_0x1817('0x172')});db[_0x1817('0x44')][_0x1817('0x11f')](db['User'],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x44')][_0x1817('0x11f')](db[_0x1817('0x3e')],{'onDelete':'restrict'});db[_0x1817('0x44')]['belongsTo'](db['MailAccount'],{'onDelete':_0x1817('0x15e')});db['MailApplication'][_0x1817('0x11f')](db['Interval'],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x14d')});db['MailApplication']['belongsTo'](db[_0x1817('0x8b')],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x173')});db[_0x1817('0x174')][_0x1817('0x11f')](db['MailAccount'],{});db['MailQueueReport'][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':'List','foreignKey':'ListId'});db['MailQueueReport']['belongsTo'](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x174')][_0x1817('0x11f')](db[_0x1817('0x41')],{});db[_0x1817('0x174')]['belongsTo'](db[_0x1817('0x164')],{});db['MailQueueReport'][_0x1817('0x11f')](db[_0x1817('0x110')],{});db[_0x1817('0x174')][_0x1817('0x11f')](db[_0x1817('0x3e')],{});db['Dashboard'][_0x1817('0x111')](db['DashboardItem'],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0x1817('0x111')](db[_0x1817('0x7d')],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x176'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x177')][_0x1817('0x111')](db['CannedAnswer'],{'as':_0x1817('0x163'),'foreignKey':'FaxAccountId'});db[_0x1817('0x177')][_0x1817('0x111')](db[_0x1817('0x4c')],{'as':_0x1817('0x165')});db[_0x1817('0x177')][_0x1817('0x111')](db[_0x1817('0x4b')],{'as':_0x1817('0x144')});db['FaxAccount'][_0x1817('0x111')](db[_0x1817('0x17')],{'as':_0x1817('0x178'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x177')][_0x1817('0x111')](db['FaxMessage'],{'as':'Messages'});db['FaxAccount'][_0x1817('0x11f')](db[_0x1817('0x29')],{'as':'Trunk'});db[_0x1817('0x177')][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0x177')][_0x1817('0x11f')](db[_0x1817('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x1817('0x17b')});db[_0x1817('0x177')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':'Agents','through':_0x1817('0x136')});db['FaxApplication'][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x15e')});db['FaxApplication'][_0x1817('0x11f')](db[_0x1817('0x50')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x4b')][_0x1817('0x11f')](db['FaxAccount'],{'onDelete':'restrict'});db['FaxApplication'][_0x1817('0x11f')](db[_0x1817('0x8b')],{'onDelete':_0x1817('0x15e'),'foreignKey':'TagId'});db[_0x1817('0x4c')][_0x1817('0x111')](db[_0x1817('0x4e')],{'as':_0x1817('0x154'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x17c')});db[_0x1817('0x4c')][_0x1817('0x11f')](db[_0x1817('0x177')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x176')});db[_0x1817('0x4c')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x4c')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':'Owner','foreignKey':'UserId'});db[_0x1817('0x4c')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x17d'),'as':_0x1817('0x16c')});db[_0x1817('0x4c')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x17d'),'as':_0x1817('0x16d')});db[_0x1817('0x4c')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x16e'),'through':'user_has_fax_interactions','foreignKey':_0x1817('0x17c')});db['FaxMessage'][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x110')});db['FaxMessage'][_0x1817('0x11f')](db['FaxInteraction'],{'as':_0x1817('0x170'),'foreignKey':_0x1817('0x17c')});db[_0x1817('0x4e')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x15c')});db[_0x1817('0x4e')]['belongsTo'](db[_0x1817('0xeb')],{'as':_0x1817('0xeb'),'foreignKey':'AttachmentId'});db[_0x1817('0x4e')][_0x1817('0x11f')](db[_0x1817('0x177')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x176')});db[_0x1817('0x50')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':'Agents','through':'UserFaxQueue'});db[_0x1817('0x50')][_0x1817('0x123')](db[_0x1817('0xe4')],{'through':_0x1817('0x17e'),'as':_0x1817('0x150')});db[_0x1817('0x51')][_0x1817('0x11f')](db['FaxAccount'],{});db[_0x1817('0x51')][_0x1817('0x11f')](db['CmList'],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0x51')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':'ContactId'});db[_0x1817('0x51')][_0x1817('0x11f')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x1817('0x11f')](db[_0x1817('0x4e')],{});db[_0x1817('0x51')][_0x1817('0x11f')](db[_0x1817('0x110')],{});db['FaxQueueReport'][_0x1817('0x11f')](db[_0x1817('0x50')],{});db[_0x1817('0x52')]['hasMany'](db[_0x1817('0x7d')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0x1817('0x10c')});db[_0x1817('0x52')][_0x1817('0x111')](db[_0x1817('0x7b')],{'as':_0x1817('0x163'),'foreignKey':'SmsAccountId'});db[_0x1817('0x52')][_0x1817('0x111')](db['SmsMessage'],{'as':_0x1817('0x154'),'foreignKey':'SmsAccountId'});db[_0x1817('0x52')]['hasMany'](db[_0x1817('0x117')],{'as':_0x1817('0x165')});db['SmsAccount'][_0x1817('0x111')](db['SmsApplication'],{'as':'Applications'});db[_0x1817('0x52')]['belongsTo'](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':'ListId'});db[_0x1817('0x52')]['belongsTo'](db['Pause'],{'as':_0x1817('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1817('0x52')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':_0x1817('0x13c')});db['SmsApplication'][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x54')][_0x1817('0x11f')](db[_0x1817('0x56')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x54')][_0x1817('0x11f')](db[_0x1817('0x52')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x54')][_0x1817('0x11f')](db['Interval'],{'onDelete':_0x1817('0x15e'),'foreignKey':'IntervalId'});db[_0x1817('0x54')]['belongsTo'](db[_0x1817('0x8b')],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x173')});db['SmsInteraction'][_0x1817('0x111')](db[_0x1817('0x17f')],{'as':_0x1817('0x154'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x1817('0x117')][_0x1817('0x11f')](db[_0x1817('0x52')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x180')});db[_0x1817('0x117')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x117')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x16a'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x117')][_0x1817('0x123')](db['Tag'],{'through':_0x1817('0x181'),'as':_0x1817('0x16c')});db[_0x1817('0x117')]['belongsToMany'](db[_0x1817('0x8b')],{'through':_0x1817('0x181'),'as':'ThroughTags'});db[_0x1817('0x117')][_0x1817('0x123')](db['User'],{'as':_0x1817('0x16e'),'through':'user_has_sms_interactions','foreignKey':_0x1817('0x182')});db[_0x1817('0x17f')]['belongsTo'](db['User'],{'as':'User'});db[_0x1817('0x17f')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x15c')});db['SmsMessage'][_0x1817('0x11f')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x1817('0x170'),'foreignKey':_0x1817('0x182')});db[_0x1817('0x17f')][_0x1817('0x11f')](db[_0x1817('0x52')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x180')});db['SmsQueue']['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':_0x1817('0x36'),'foreignKey':_0x1817('0x183')});db['SmsQueue']['belongsToMany'](db[_0x1817('0xe4')],{'through':_0x1817('0x184'),'as':'Teams'});db[_0x1817('0x58')][_0x1817('0x111')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x1817('0x185'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x58')][_0x1817('0x111')](db[_0x1817('0x7b')],{'as':_0x1817('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0x1817('0x58')][_0x1817('0x111')](db['OpenchannelInteraction'],{'as':_0x1817('0x165'),'foreignKey':_0x1817('0x185')});db[_0x1817('0x58')][_0x1817('0x111')](db['OpenchannelMessage'],{'as':_0x1817('0x154'),'foreignKey':_0x1817('0x185')});db[_0x1817('0x58')]['hasMany'](db[_0x1817('0x5a')],{'as':_0x1817('0x144'),'foreignKey':_0x1817('0x185')});db[_0x1817('0x58')][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0x58')][_0x1817('0x11f')](db[_0x1817('0x82')],{'as':_0x1817('0x14e'),'foreignKey':_0x1817('0x17b')});db['OpenchannelAccount']['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':'user_has_openchannel_accounts'});db[_0x1817('0x5a')][_0x1817('0x11f')](db['User'],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x5a')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x1817('0x186')});db[_0x1817('0x5a')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x185')});db[_0x1817('0x5a')][_0x1817('0x11f')](db['Interval'],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x14d')});db[_0x1817('0x5a')][_0x1817('0x11f')](db['Tag'],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x173')});db[_0x1817('0x5b')]['hasMany'](db[_0x1817('0x187')],{'as':'Messages','onDelete':_0x1817('0x10c'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction']['belongsTo'](db[_0x1817('0x58')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x185')});db[_0x1817('0x5b')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x5b')]['belongsTo'](db['User'],{'as':_0x1817('0x16a'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x5b')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x188'),'as':_0x1817('0x16c')});db[_0x1817('0x5b')][_0x1817('0x123')](db['Tag'],{'through':_0x1817('0x188'),'as':_0x1817('0x16d')});db[_0x1817('0x5b')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x16e'),'through':_0x1817('0x12a'),'foreignKey':_0x1817('0x189')});db[_0x1817('0x187')][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x110')});db[_0x1817('0x187')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':'cascade','as':_0x1817('0x15c')});db[_0x1817('0x187')][_0x1817('0x11f')](db['OpenchannelInteraction'],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x170'),'foreignKey':'OpenchannelInteractionId'});db[_0x1817('0x187')][_0x1817('0x11f')](db['Attachment'],{'as':'Attachment','foreignKey':_0x1817('0x18a')});db[_0x1817('0x187')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x185')});db['OpenchannelQueue'][_0x1817('0x123')](db[_0x1817('0x110')],{'as':'Agents','through':_0x1817('0x37'),'foreignKey':_0x1817('0x186')});db[_0x1817('0x5e')][_0x1817('0x123')](db[_0x1817('0xe4')],{'through':_0x1817('0x18b'),'as':'Teams'});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x7d')],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x18c'),'onDelete':'cascade'});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x7b')],{'as':_0x1817('0x163'),'foreignKey':_0x1817('0x18c')});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x67')],{'as':_0x1817('0x18d')});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x63')],{'as':_0x1817('0x165')});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x18e')],{'as':_0x1817('0x144')});db[_0x1817('0x132')][_0x1817('0x111')](db[_0x1817('0x18f')],{'as':_0x1817('0x154')});db[_0x1817('0x132')]['belongsTo'](db['CmList'],{'as':_0x1817('0x179'),'foreignKey':'ListId'});db[_0x1817('0x132')]['belongsTo'](db['Interval'],{'as':_0x1817('0x80'),'foreignKey':_0x1817('0x14d')});db[_0x1817('0x132')][_0x1817('0x11f')](db[_0x1817('0x137')],{'as':'MailAccount','foreignKey':_0x1817('0x15d')});db['ChatWebsite']['belongsTo'](db[_0x1817('0x82')],{'as':_0x1817('0x14e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x1817('0x132')]['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x1817('0x11f')](db[_0x1817('0x58')],{});db[_0x1817('0x61')][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':'List','foreignKey':_0x1817('0x17a')});db[_0x1817('0x61')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x1817('0x175')});db['OpenchannelQueueReport'][_0x1817('0x11f')](db[_0x1817('0x5b')],{});db[_0x1817('0x61')][_0x1817('0x11f')](db[_0x1817('0x187')],{});db['OpenchannelQueueReport'][_0x1817('0x11f')](db[_0x1817('0x110')],{});db[_0x1817('0x61')]['belongsTo'](db['OpenchannelQueue'],{});db[_0x1817('0x18e')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x190'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0x1817('0x11f')](db[_0x1817('0x191')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':'restrict'});db[_0x1817('0x18e')]['belongsTo'](db[_0x1817('0x132')],{'as':_0x1817('0x192'),'foreignKey':_0x1817('0x18c'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x18e')]['belongsTo'](db['Tag'],{'onDelete':_0x1817('0x15e'),'foreignKey':'TagId'});db[_0x1817('0x63')]['hasMany'](db['ChatMessage'],{'as':_0x1817('0x154'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x193')});db['ChatInteraction']['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x1817('0x18c')});db['ChatInteraction'][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':'ContactId'});db[_0x1817('0x63')][_0x1817('0x11f')](db['User'],{'as':_0x1817('0x16a'),'foreignKey':'UserId'});db[_0x1817('0x63')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x194'),'as':_0x1817('0x16c')});db[_0x1817('0x63')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x194'),'as':_0x1817('0x16d')});db[_0x1817('0x63')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':'Users','through':_0x1817('0x195'),'foreignKey':_0x1817('0x193')});db[_0x1817('0x18f')][_0x1817('0x11f')](db['User'],{'onDelete':'cascade','as':_0x1817('0x110')});db[_0x1817('0x18f')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':'Contact','foreignKey':_0x1817('0x175')});db[_0x1817('0x18f')][_0x1817('0x11f')](db['ChatInteraction'],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x170'),'foreignKey':_0x1817('0x193')});db[_0x1817('0x18f')][_0x1817('0x11f')](db['Attachment'],{'as':_0x1817('0xeb'),'foreignKey':'AttachmentId'});db[_0x1817('0x18f')][_0x1817('0x11f')](db['ChatWebsite'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x18c')});db[_0x1817('0x64')][_0x1817('0x111')](db['Attachment'],{'as':_0x1817('0x16f'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x1817('0x10c'),'hooks':!![]});db[_0x1817('0x64')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x64')][_0x1817('0x11f')](db[_0x1817('0x132')],{'as':'Account','foreignKey':_0x1817('0x18c')});db[_0x1817('0x191')][_0x1817('0x123')](db['User'],{'as':_0x1817('0x14f'),'through':'UserChatQueue','hooks':!![]});db[_0x1817('0x191')]['belongsToMany'](db[_0x1817('0xe4')],{'through':'team_has_chat_queues','as':_0x1817('0x150')});db[_0x1817('0x121')]['hasMany'](db['ChatInternalMessage'],{'as':_0x1817('0x154'),'foreignKey':_0x1817('0x196'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x121')]['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x146'),'through':'chat_group_has_users'});db[_0x1817('0x67')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x1817('0x18c')});db[_0x1817('0x69')][_0x1817('0x111')](db['CmContact'],{'as':_0x1817('0x124'),'foreignKey':_0x1817('0x197')});db[_0x1817('0x15b')][_0x1817('0x111')](db[_0x1817('0x8e')],{'as':_0x1817('0x198'),'foreignKey':'CmContactId'});db[_0x1817('0x15b')][_0x1817('0x111')](db[_0x1817('0x6c')],{'as':_0x1817('0x148'),'foreignKey':_0x1817('0x175')});db['CmContact'][_0x1817('0x111')](db[_0x1817('0x6f')],{'as':_0x1817('0x114'),'foreignKey':'ContactId'});db[_0x1817('0x15b')]['hasMany'](db[_0x1817('0x71')],{'as':_0x1817('0x149'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x15b')][_0x1817('0x111')](db[_0x1817('0x73')],{'as':_0x1817('0x73'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x15b')]['hasMany'](db[_0x1817('0xd5')],{'as':'JscriptySessions','foreignKey':_0x1817('0x175')});db[_0x1817('0x15b')]['hasMany'](db[_0x1817('0x5b')],{'as':_0x1817('0x115'),'foreignKey':_0x1817('0x175'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x15b')][_0x1817('0x111')](db[_0x1817('0x63')],{'as':_0x1817('0x116'),'foreignKey':_0x1817('0x175'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x15b')][_0x1817('0x111')](db['SmsInteraction'],{'as':_0x1817('0x118'),'foreignKey':_0x1817('0x175'),'onDelete':'restrict'});db[_0x1817('0x15b')][_0x1817('0x111')](db[_0x1817('0x4c')],{'as':'FaxInteractions','foreignKey':_0x1817('0x175'),'onDelete':_0x1817('0x15e')});db['CmContact']['hasMany'](db[_0x1817('0x41')],{'as':_0x1817('0x199'),'foreignKey':_0x1817('0x175'),'onDelete':'restrict'});db['CmContact']['belongsTo'](db[_0x1817('0x69')],{'as':_0x1817('0x19a'),'foreignKey':_0x1817('0x197')});db[_0x1817('0x15b')][_0x1817('0x11f')](db['CmList'],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a'),'onDelete':'cascade'});db[_0x1817('0x15b')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x16e'),'through':_0x1817('0x125')});db['CmContact'][_0x1817('0x123')](db[_0x1817('0x8b')],{'as':_0x1817('0x16c'),'through':_0x1817('0x19b')});db[_0x1817('0x15b')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x19b'),'as':_0x1817('0x16d')});db[_0x1817('0x6c')][_0x1817('0x111')](db[_0x1817('0x19c')],{'as':_0x1817('0x19d'),'foreignKey':'CmHopperId'});db[_0x1817('0x6c')]['belongsTo'](db['CmContact'],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x6c')]['belongsTo'](db['CmList'],{'as':'List','foreignKey':_0x1817('0x17a'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x6c')][_0x1817('0x11f')](db['User'],{'as':_0x1817('0x190'),'foreignKey':'UserId'});db[_0x1817('0x6c')]['belongsTo'](db['VoiceQueue'],{'as':_0x1817('0x19e'),'foreignKey':_0x1817('0x147'),'onDelete':_0x1817('0x10c')});db['CmHopper'][_0x1817('0x11f')](db[_0x1817('0x19f')],{'as':_0x1817('0x19f'),'foreignKey':_0x1817('0x1a0'),'onDelete':_0x1817('0x10c')});db['CmHopper'][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x16a'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':'ContactId','onDelete':_0x1817('0x10c')});db['CmHopperBlack'][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a'),'onDelete':_0x1817('0x10c')});db['CmHopperBlack'][_0x1817('0x11f')](db[_0x1817('0x1b')],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x1817('0x10c')});db[_0x1817('0x6d')][_0x1817('0x11f')](db[_0x1817('0x19f')],{'as':'Campaign','foreignKey':_0x1817('0x1a0'),'onDelete':'cascade'});db[_0x1817('0x79')][_0x1817('0x111')](db[_0x1817('0x7f')],{'as':{'plural':_0x1817('0x1a1'),'singular':_0x1817('0x1a2')},'foreignKey':_0x1817('0x1a3'),'onDelete':_0x1817('0x10c'),'hooks':!![]});db[_0x1817('0x79')][_0x1817('0x111')](db['Condition'],{'as':{'plural':'Any','singular':_0x1817('0x1a4')},'foreignKey':_0x1817('0x1a5'),'onDelete':'cascade','hooks':!![]});db['Automation'][_0x1817('0x111')](db[_0x1817('0x77')],{'as':_0x1817('0x1a6'),'foreignKey':_0x1817('0x1a7'),'onDelete':'cascade','hooks':!![]});db[_0x1817('0x7d')][_0x1817('0x111')](db[_0x1817('0x7d')],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x1a8'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x80')][_0x1817('0x111')](db[_0x1817('0x80')],{'as':_0x1817('0x1a9'),'foreignKey':'IntervalId','onDelete':_0x1817('0x10c'),'hooks':!![],'required':![]});db[_0x1817('0x80')][_0x1817('0x111')](db[_0x1817('0x17')],{'as':_0x1817('0x1aa'),'foreignKey':_0x1817('0x14d'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x80')][_0x1817('0x111')](db['MailApplication'],{'as':_0x1817('0x1ab'),'foreignKey':'IntervalId'});db[_0x1817('0x80')][_0x1817('0x111')](db[_0x1817('0x18e')],{'as':'ChatApplications','foreignKey':'IntervalId'});db['Interval'][_0x1817('0x111')](db['FaxApplication'],{'as':_0x1817('0x1ac'),'foreignKey':_0x1817('0x14d')});db[_0x1817('0x80')]['hasMany'](db[_0x1817('0x54')],{'as':'SmsApplications','foreignKey':_0x1817('0x14d')});db[_0x1817('0x87')][_0x1817('0x11f')](db[_0x1817('0x137')],{});db[_0x1817('0x87')]['belongsTo'](db[_0x1817('0x9a')],{'foreignKey':'DefaultReportId'});db[_0x1817('0x87')]['belongsTo'](db[_0x1817('0x98')],{'foreignKey':'CustomReportId'});db['Sound'][_0x1817('0x123')](db['VoiceMusicOnHold'],{'as':_0x1817('0x1ad'),'through':_0x1817('0x1ae'),'onDelete':_0x1817('0x15e')});db[_0x1817('0x8b')]['belongsToMany'](db[_0x1817('0x15b')],{'through':_0x1817('0x19b')});db['Tag'][_0x1817('0x123')](db[_0x1817('0x63')],{'through':'chat_interaction_has_tags'});db[_0x1817('0x8b')][_0x1817('0x123')](db['MailInteraction'],{'through':_0x1817('0x16b')});db[_0x1817('0x8b')][_0x1817('0x123')](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x1817('0x8b')]['belongsToMany'](db[_0x1817('0x4c')],{'through':_0x1817('0x17d')});db[_0x1817('0x8b')]['belongsToMany'](db[_0x1817('0x5b')],{'through':'openchannel_interaction_has_tags'});db['Tag'][_0x1817('0x123')](db['WhatsappInteraction'],{'through':_0x1817('0x1af')});db[_0x1817('0x8e')][_0x1817('0x11f')](db[_0x1817('0x8c')],{'as':_0x1817('0x1b0'),'foreignKey':_0x1817('0x1b1')});db['CmHopperAdditionalPhone'][_0x1817('0x11f')](db[_0x1817('0x6c')],{'as':_0x1817('0x1b2'),'foreignKey':_0x1817('0x1b3')});db['CmContactHasItem'][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':'Contact','foreignKey':_0x1817('0x1b4')});db['Trigger'][_0x1817('0x111')](db[_0x1817('0x7f')],{'as':{'plural':_0x1817('0x1b5'),'singular':_0x1817('0x1b6')},'foreignKey':_0x1817('0x1b7'),'onDelete':_0x1817('0x10c'),'hooks':!![]});db[_0x1817('0x92')]['hasMany'](db[_0x1817('0x7f')],{'as':{'plural':_0x1817('0x1b8'),'singular':_0x1817('0x1b9')},'foreignKey':_0x1817('0x1ba'),'onDelete':'cascade','hooks':!![]});db[_0x1817('0x92')][_0x1817('0x111')](db[_0x1817('0x77')],{'as':_0x1817('0x1a6'),'foreignKey':'TriggerId','onDelete':_0x1817('0x10c'),'hooks':!![]});db['AnalyticCustomReport'][_0x1817('0x111')](db[_0x1817('0x9c')],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x1817('0x9a')][_0x1817('0x111')](db[_0x1817('0x9c')],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':'DefaultReportId'});db[_0x1817('0x1bc')][_0x1817('0x111')](db['AnalyticFieldReport'],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bd')});db[_0x1817('0x9c')][_0x1817('0x11f')](db[_0x1817('0x1bc')],{'foreignKey':'MetricId'});db['SalesforceAccount'][_0x1817('0x111')](db[_0x1817('0xa1')],{'as':_0x1817('0x1be'),'onDelete':'cascade','foreignKey':_0x1817('0x1bf')});db['SalesforceConfiguration'][_0x1817('0x111')](db['SalesforceField'],{'as':_0x1817('0x1c0'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xa1')][_0x1817('0x111')](db['SalesforceField'],{'as':_0x1817('0x1c2'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0xa1')][_0x1817('0x111')](db[_0x1817('0xa3')],{'as':'Fields','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xa1')][_0x1817('0x11f')](db['SalesforceAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xa3')][_0x1817('0x111')](db[_0x1817('0xa3')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xa3')][_0x1817('0x111')](db[_0x1817('0xa3')],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0xa3')][_0x1817('0x111')](db[_0x1817('0xa3')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db['SalesforceField'][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':_0x1817('0x1be'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0x1c9')][_0x1817('0x111')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0x1c9')][_0x1817('0x111')](db[_0x1817('0xa8')],{'as':'Descriptions','onDelete':_0x1817('0x10c'),'foreignKey':'DescriptionId'});db['SugarcrmConfiguration'][_0x1817('0x111')](db[_0x1817('0xa8')],{'as':_0x1817('0x1bb'),'onDelete':'cascade','foreignKey':_0x1817('0x1c4')});db[_0x1817('0x1c9')]['belongsTo'](db[_0x1817('0xa5')],{'as':'Account','foreignKey':_0x1817('0x1bf')});db[_0x1817('0xa8')][_0x1817('0x111')](db[_0x1817('0xa8')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':'Description','foreignKey':_0x1817('0x1c3')});db[_0x1817('0xa8')][_0x1817('0x111')](db[_0x1817('0xa8')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xa8')][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db['DeskAccount'][_0x1817('0x111')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xab')]['hasMany'](db[_0x1817('0xad')],{'as':_0x1817('0x1c0'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xab')]['hasMany'](db[_0x1817('0xad')],{'as':_0x1817('0x1c2'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c3')});db['DeskConfiguration']['hasMany'](db['DeskField'],{'as':'Fields','onDelete':_0x1817('0x10c'),'foreignKey':'FieldId'});db[_0x1817('0xab')][_0x1817('0x11f')](db[_0x1817('0xaa')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db['DeskConfiguration'][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x1ca')});db['DeskField'][_0x1817('0x111')](db[_0x1817('0xad')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db['DeskField'][_0x1817('0x111')](db[_0x1817('0xad')],{'as':_0x1817('0x1c6'),'foreignKey':'DescriptionId'});db['DeskField'][_0x1817('0x111')](db['DeskField'],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xad')][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db[_0x1817('0xaf')][_0x1817('0x111')](db[_0x1817('0xb1')],{'as':_0x1817('0x1be'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db['ZohoConfiguration']['hasMany'](db[_0x1817('0xb3')],{'as':_0x1817('0x1c0'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xb1')][_0x1817('0x111')](db[_0x1817('0xb3')],{'as':_0x1817('0x1c2'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c3')});db['ZohoConfiguration']['hasMany'](db[_0x1817('0xb3')],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xb1')][_0x1817('0x11f')](db['ZohoAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xb3')][_0x1817('0x111')](db['ZohoField'],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xb3')][_0x1817('0x111')](db['ZohoField'],{'as':'Description','foreignKey':_0x1817('0x1c3')});db[_0x1817('0xb3')][_0x1817('0x111')](db[_0x1817('0xb3')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xb3')]['belongsTo'](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db[_0x1817('0xb4')][_0x1817('0x111')](db[_0x1817('0xb5')],{'as':'Configurations','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xb5')][_0x1817('0x111')](db[_0x1817('0xb6')],{'as':_0x1817('0x1c0'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xb5')][_0x1817('0x111')](db[_0x1817('0xb6')],{'as':'Descriptions','foreignKey':_0x1817('0x1c3')});db[_0x1817('0xb5')][_0x1817('0x111')](db[_0x1817('0xb6')],{'as':'Fields','foreignKey':_0x1817('0x1c4')});db[_0x1817('0xb5')][_0x1817('0x11f')](db[_0x1817('0xb4')],{'as':_0x1817('0x171'),'foreignKey':'AccountId'});db['ZendeskConfiguration'][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x1cb')});db[_0x1817('0xb6')][_0x1817('0x111')](db['ZendeskField'],{'as':'Subject','foreignKey':_0x1817('0x1c1')});db[_0x1817('0xb6')][_0x1817('0x111')](db['ZendeskField'],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db['ZendeskField']['hasMany'](db[_0x1817('0xb6')],{'as':'Field','foreignKey':_0x1817('0x1c4')});db['ZendeskField'][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db['FreshdeskAccount'][_0x1817('0x111')](db[_0x1817('0x1cc')],{'as':_0x1817('0x1be'),'onDelete':_0x1817('0x10c'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x1817('0x111')](db[_0x1817('0xb9')],{'as':'Subjects','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0x1cc')][_0x1817('0x111')](db['FreshdeskField'],{'as':_0x1817('0x1c2'),'onDelete':_0x1817('0x10c'),'foreignKey':'DescriptionId'});db[_0x1817('0x1cc')][_0x1817('0x111')](db[_0x1817('0xb9')],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0x1cc')][_0x1817('0x11f')](db[_0x1817('0x1cd')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0x1cc')]['belongsToMany'](db['Tag'],{'through':_0x1817('0x1ce')});db[_0x1817('0xb9')]['hasMany'](db[_0x1817('0xb9')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xb9')]['hasMany'](db[_0x1817('0xb9')],{'as':_0x1817('0x1c6'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0x1817('0x111')](db[_0x1817('0xb9')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xb9')][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':'Variable','foreignKey':_0x1817('0x1c8')});db['VtigerAccount']['hasMany'](db[_0x1817('0x1cf')],{'as':_0x1817('0x1be'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0x1cf')][_0x1817('0x111')](db['VtigerField'],{'as':_0x1817('0x1c0'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0x1cf')]['hasMany'](db[_0x1817('0x1d0')],{'as':_0x1817('0x1c2'),'foreignKey':_0x1817('0x1c3')});db['VtigerConfiguration'][_0x1817('0x111')](db[_0x1817('0x1d0')],{'as':'Fields','foreignKey':'FieldId'});db[_0x1817('0x1cf')][_0x1817('0x11f')](db[_0x1817('0xbb')],{'as':_0x1817('0x171'),'foreignKey':'AccountId'});db[_0x1817('0x1d0')][_0x1817('0x111')](db['VtigerField'],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0x1d0')][_0x1817('0x111')](db[_0x1817('0x1d0')],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0x1d0')][_0x1817('0x111')](db[_0x1817('0x1d0')],{'as':_0x1817('0x1c7'),'foreignKey':'FieldId'});db['VtigerField'][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':'Variable','foreignKey':_0x1817('0x1c8')});db[_0x1817('0xbf')][_0x1817('0x111')](db[_0x1817('0xc1')],{'as':'Configurations','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xc1')]['hasMany'](db[_0x1817('0x1d1')],{'as':_0x1817('0x1c0'),'foreignKey':_0x1817('0x1c1')});db['ServicenowConfiguration'][_0x1817('0x111')](db[_0x1817('0x1d1')],{'as':'Descriptions','foreignKey':_0x1817('0x1c3')});db['ServicenowConfiguration'][_0x1817('0x111')](db[_0x1817('0x1d1')],{'as':_0x1817('0x1bb'),'foreignKey':_0x1817('0x1c4')});db['ServicenowConfiguration'][_0x1817('0x11f')](db['ServicenowAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0x1d1')][_0x1817('0x111')](db[_0x1817('0x1d1')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0x1d1')][_0x1817('0x111')](db['ServicenowField'],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0x1d1')][_0x1817('0x111')](db[_0x1817('0x1d1')],{'as':_0x1817('0x1c7'),'foreignKey':'FieldId'});db[_0x1817('0x1d1')][_0x1817('0x11f')](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db['Dynamics365Account'][_0x1817('0x111')](db[_0x1817('0xc5')],{'as':_0x1817('0x1be'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xc3')][_0x1817('0x11f')](db['CloudProvider'],{'as':_0x1817('0x105'),'foreignKey':_0x1817('0x160')});db['Dynamics365Configuration'][_0x1817('0x111')](db['Dynamics365Field'],{'as':_0x1817('0x1c0'),'onDelete':'cascade','foreignKey':_0x1817('0x1c1')});db[_0x1817('0xc5')]['hasMany'](db[_0x1817('0xc7')],{'as':'Descriptions','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0xc5')]['hasMany'](db[_0x1817('0xc7')],{'as':_0x1817('0x1bb'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xc5')][_0x1817('0x11f')](db[_0x1817('0xc3')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xc7')][_0x1817('0x111')](db[_0x1817('0xc7')],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xc7')][_0x1817('0x111')](db[_0x1817('0xc7')],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0xc7')][_0x1817('0x111')](db[_0x1817('0xc7')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db[_0x1817('0xc7')]['belongsTo'](db[_0x1817('0x93')],{'as':_0x1817('0x93'),'foreignKey':_0x1817('0x1c8')});db[_0x1817('0xc9')]['hasMany'](db[_0x1817('0xca')],{'as':'Configurations','onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xca')]['hasMany'](db[_0x1817('0xcc')],{'as':_0x1817('0x1c0'),'foreignKey':'SubjectId'});db[_0x1817('0xca')][_0x1817('0x111')](db[_0x1817('0xcc')],{'as':_0x1817('0x1c2'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0x1817('0x111')](db[_0x1817('0xcc')],{'as':'Fields','foreignKey':'FieldId'});db[_0x1817('0xca')][_0x1817('0x11f')](db[_0x1817('0xc9')],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1bf')});db[_0x1817('0xcc')][_0x1817('0x111')](db['FreshsalesField'],{'as':_0x1817('0x1c5'),'foreignKey':_0x1817('0x1c1')});db[_0x1817('0xcc')][_0x1817('0x111')](db[_0x1817('0xcc')],{'as':_0x1817('0x1c6'),'foreignKey':_0x1817('0x1c3')});db[_0x1817('0xcc')]['hasMany'](db[_0x1817('0xcc')],{'as':_0x1817('0x1c7'),'foreignKey':_0x1817('0x1c4')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x1817('0xd0')]['belongsTo'](db['ChatWebsite'],{});db[_0x1817('0xd0')][_0x1817('0x11f')](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xd0')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0x1817('0x175')});db[_0x1817('0xd0')][_0x1817('0x11f')](db[_0x1817('0x63')],{});db[_0x1817('0xd0')]['belongsTo'](db[_0x1817('0x18f')],{});db[_0x1817('0xd0')][_0x1817('0x11f')](db[_0x1817('0x110')],{});db[_0x1817('0xd0')][_0x1817('0x11f')](db[_0x1817('0x191')],{});db[_0x1817('0xd1')][_0x1817('0x11f')](db['User'],{'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1d2')});db[_0x1817('0xd1')][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1d3')});db['JscriptySessionReport'][_0x1817('0x111')](db[_0x1817('0xd4')],{'foreignKey':_0x1817('0x1d4'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x1817('0x111')](db[_0x1817('0xd2')],{'foreignKey':_0x1817('0x1d4'),'onDelete':'cascade'});db[_0x1817('0xd7')][_0x1817('0x11f')](db[_0x1817('0x52')],{});db[_0x1817('0xd7')]['belongsTo'](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xd7')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db['SmsQueueReport'][_0x1817('0x11f')](db[_0x1817('0x117')],{});db[_0x1817('0xd7')][_0x1817('0x11f')](db[_0x1817('0x17f')],{});db[_0x1817('0xd7')][_0x1817('0x11f')](db[_0x1817('0x110')],{});db[_0x1817('0xd7')]['belongsTo'](db['SmsQueue'],{});db[_0x1817('0x1d5')][_0x1817('0x111')](db[_0x1817('0xd5')],{'foreignKey':'ProjectId'});db['JscriptyProject']['hasMany'](db[_0x1817('0xd4')],{'foreignKey':_0x1817('0x1d6')});db['JscriptyProject']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x1817('0x1d6')});db['SquareProject']['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x16e'),'through':'user_has_square_projects'});db['Team']['belongsToMany'](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':'user_has_teams'});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x1b')],{'through':_0x1817('0x151'),'as':'VoiceQueues'});db[_0x1817('0xe4')]['belongsToMany'](db['MailQueue'],{'through':_0x1817('0x168'),'as':_0x1817('0x12c')});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x191')],{'through':_0x1817('0x1d7'),'as':'ChatQueues'});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x50')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x56')],{'through':'team_has_sms_queues','as':_0x1817('0x12f')});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x5e')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team'][_0x1817('0x123')](db[_0x1817('0x103')],{'through':'team_has_whatsapp_queues','as':_0x1817('0x131')});db[_0x1817('0xe4')][_0x1817('0x123')](db[_0x1817('0x1d8')],{'through':'TeamVoicePrefix','as':_0x1817('0x1d9')});db[_0x1817('0x19f')]['hasMany'](db[_0x1817('0x6c')],{'as':_0x1817('0x148'),'foreignKey':_0x1817('0x1a0')});db[_0x1817('0x19f')][_0x1817('0x111')](db['CmHopperFinal'],{'as':_0x1817('0x114'),'foreignKey':'CampaignId'});db[_0x1817('0x19f')][_0x1817('0x111')](db[_0x1817('0x71')],{'as':_0x1817('0x149'),'foreignKey':_0x1817('0x1a0')});db['Campaign'][_0x1817('0x111')](db[_0x1817('0x6d')],{'as':_0x1817('0x1da'),'foreignKey':_0x1817('0x1a0')});db[_0x1817('0x19f')][_0x1817('0x11f')](db[_0x1817('0x29')],{'as':_0x1817('0x29'),'foreignKey':_0x1817('0x1db')});db[_0x1817('0x19f')][_0x1817('0x11f')](db[_0x1817('0x29')],{'as':'TrunkBackup','foreignKey':_0x1817('0x14c')});db[_0x1817('0x19f')][_0x1817('0x11f')](db['Interval'],{'as':_0x1817('0x80'),'foreignKey':_0x1817('0x14d')});db['Campaign'][_0x1817('0x11f')](db[_0x1817('0x13f')],{'as':_0x1817('0x13f'),'foreignKey':'SquareProjectId'});db[_0x1817('0x19f')][_0x1817('0x123')](db[_0x1817('0xf6')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0x1817('0x19f')][_0x1817('0x123')](db[_0x1817('0xf6')],{'as':_0x1817('0x152'),'through':_0x1817('0x1dc')});db[_0x1817('0xeb')][_0x1817('0x11f')](db['ChatOfflineMessage'],{'as':_0x1817('0x64'),'foreignKey':_0x1817('0x172')});db[_0x1817('0xee')][_0x1817('0x11f')](db['MailMessage'],{});db[_0x1817('0xee')][_0x1817('0x11f')](db['MailInteraction'],{});db[_0x1817('0xee')][_0x1817('0x11f')](db[_0x1817('0x137')],{'foreignKey':'FromMailAccountId','as':_0x1817('0x1dd')});db[_0x1817('0xee')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db[_0x1817('0xee')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1e0'),'as':_0x1817('0x1e1')});db[_0x1817('0xee')][_0x1817('0x11f')](db[_0x1817('0x3e')],{'foreignKey':_0x1817('0x1e2'),'as':_0x1817('0x1e3')});db[_0x1817('0xee')][_0x1817('0x11f')](db['MailAccount'],{'foreignKey':_0x1817('0x1e4'),'as':_0x1817('0x1e5')});db[_0x1817('0xef')]['belongsTo'](db[_0x1817('0x18f')],{});db[_0x1817('0xef')][_0x1817('0x11f')](db[_0x1817('0x63')],{});db[_0x1817('0xef')][_0x1817('0x11f')](db['ChatWebsite'],{'foreignKey':_0x1817('0x1e6'),'as':'FromAccount'});db['ChatTransferReport'][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db[_0x1817('0xef')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x1817('0xef')]['belongsTo'](db[_0x1817('0x191')],{'foreignKey':'ToChatQueueId','as':_0x1817('0x1e3')});db[_0x1817('0xef')][_0x1817('0x11f')](db['ChatWebsite'],{'foreignKey':_0x1817('0x1e7'),'as':'ToAccount'});db['FaxTransferReport'][_0x1817('0x11f')](db[_0x1817('0x4e')],{});db[_0x1817('0xf0')][_0x1817('0x11f')](db[_0x1817('0x4c')],{});db[_0x1817('0xf0')]['belongsTo'](db[_0x1817('0x177')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0x1817('0xf0')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db[_0x1817('0xf0')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1e0'),'as':_0x1817('0x1e1')});db[_0x1817('0xf0')]['belongsTo'](db[_0x1817('0x50')],{'foreignKey':_0x1817('0x1e8'),'as':_0x1817('0x1e3')});db[_0x1817('0xf0')][_0x1817('0x11f')](db[_0x1817('0x177')],{'foreignKey':_0x1817('0x1e9'),'as':'ToAccount'});db[_0x1817('0xf2')][_0x1817('0x11f')](db[_0x1817('0x187')],{});db[_0x1817('0xf2')][_0x1817('0x11f')](db['OpenchannelInteraction'],{});db[_0x1817('0xf2')][_0x1817('0x11f')](db[_0x1817('0x58')],{'foreignKey':_0x1817('0x1ea'),'as':_0x1817('0x1dd')});db[_0x1817('0xf2')][_0x1817('0x11f')](db['User'],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db['OpenchannelTransferReport']['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x1817('0x1e1')});db['OpenchannelTransferReport'][_0x1817('0x11f')](db[_0x1817('0x5e')],{'foreignKey':_0x1817('0x1eb'),'as':_0x1817('0x1e3')});db[_0x1817('0xf2')][_0x1817('0x11f')](db[_0x1817('0x58')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x1817('0xf4')][_0x1817('0x11f')](db[_0x1817('0x17f')],{});db[_0x1817('0xf4')][_0x1817('0x11f')](db[_0x1817('0x117')],{});db[_0x1817('0xf4')][_0x1817('0x11f')](db[_0x1817('0x52')],{'foreignKey':_0x1817('0x1ec'),'as':_0x1817('0x1dd')});db[_0x1817('0xf4')][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db[_0x1817('0xf4')]['belongsTo'](db[_0x1817('0x110')],{'foreignKey':'ToUserId','as':_0x1817('0x1e1')});db['SmsTransferReport'][_0x1817('0x11f')](db[_0x1817('0x56')],{'foreignKey':_0x1817('0x1ed'),'as':'ToQueue'});db[_0x1817('0xf4')]['belongsTo'](db[_0x1817('0x52')],{'foreignKey':_0x1817('0x1ee'),'as':'ToAccount'});db[_0x1817('0xf6')][_0x1817('0x111')](db[_0x1817('0x7d')],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x17a'),'onDelete':_0x1817('0x10c')});db[_0x1817('0xf6')][_0x1817('0x111')](db['CmCustomField'],{'as':_0x1817('0x1ef'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xf6')][_0x1817('0x111')](db[_0x1817('0x15b')],{'as':_0x1817('0x124'),'onDelete':_0x1817('0x10c'),'foreignKey':'ListId'});db[_0x1817('0xf6')][_0x1817('0x111')](db['CmHopperFinal'],{'as':_0x1817('0x114'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xf6')][_0x1817('0x111')](db[_0x1817('0x71')],{'as':_0x1817('0x1f0'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xf6')][_0x1817('0x111')](db[_0x1817('0x73')],{'as':_0x1817('0x73'),'foreignKey':_0x1817('0x17a')});db[_0x1817('0xf6')][_0x1817('0x123')](db[_0x1817('0x1b')],{'as':'Queues','through':_0x1817('0x1f1')});db[_0x1817('0xf6')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':_0x1817('0x127')});db[_0x1817('0x1d8')][_0x1817('0x111')](db[_0x1817('0x17')],{'as':_0x1817('0x1aa'),'onDelete':'cascade'});db[_0x1817('0x1d8')][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':'UserVoicePrefix'});db[_0x1817('0x1d8')]['belongsToMany'](db[_0x1817('0xe4')],{'through':_0x1817('0x108'),'as':_0x1817('0x150')});db['UserProfile'][_0x1817('0x111')](db[_0x1817('0x110')],{'as':_0x1817('0x16e'),'foreignKey':_0x1817('0x1f2')});db[_0x1817('0x120')][_0x1817('0x111')](db['UserProfileSection'],{'as':_0x1817('0x1f3'),'foreignKey':_0x1817('0x1f2'),'onDelete':_0x1817('0x10c')});db[_0x1817('0x1f4')][_0x1817('0x111')](db['UserProfileResource'],{'as':_0x1817('0x1f5'),'foreignKey':_0x1817('0x1f6'),'onDelete':_0x1817('0x10c')});db['WhatsappAccount'][_0x1817('0x111')](db['Disposition'],{'as':_0x1817('0x162'),'foreignKey':_0x1817('0x1f7'),'onDelete':_0x1817('0x10c')});db[_0x1817('0xfa')]['hasMany'](db[_0x1817('0x7b')],{'as':_0x1817('0x163'),'foreignKey':_0x1817('0x1f7')});db[_0x1817('0xfa')][_0x1817('0x111')](db[_0x1817('0xfe')],{'as':_0x1817('0x154'),'foreignKey':'WhatsappAccountId'});db['WhatsappAccount'][_0x1817('0x111')](db[_0x1817('0x11a')],{'as':_0x1817('0x165')});db[_0x1817('0xfa')]['hasMany'](db[_0x1817('0x1f8')],{'as':_0x1817('0x144')});db[_0x1817('0xfa')]['belongsTo'](db[_0x1817('0xf6')],{'as':'List','foreignKey':_0x1817('0x17a')});db[_0x1817('0xfa')][_0x1817('0x11f')](db[_0x1817('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0x1817('0x17b')});db[_0x1817('0xfa')][_0x1817('0x123')](db['User'],{'as':_0x1817('0x14f'),'through':_0x1817('0x13e')});db[_0x1817('0x1f8')][_0x1817('0x11f')](db[_0x1817('0x110')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x1f8')][_0x1817('0x11f')](db[_0x1817('0x103')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x1f8')][_0x1817('0x11f')](db[_0x1817('0xfa')],{'onDelete':_0x1817('0x15e')});db[_0x1817('0x1f8')]['belongsTo'](db[_0x1817('0x80')],{'onDelete':_0x1817('0x15e'),'foreignKey':'IntervalId'});db[_0x1817('0x1f8')][_0x1817('0x11f')](db[_0x1817('0x8b')],{'onDelete':_0x1817('0x15e'),'foreignKey':_0x1817('0x173')});db[_0x1817('0x11a')][_0x1817('0x111')](db[_0x1817('0xfe')],{'as':_0x1817('0x154'),'onDelete':_0x1817('0x10c'),'foreignKey':_0x1817('0x1f9')});db[_0x1817('0x11a')][_0x1817('0x11f')](db['WhatsappAccount'],{'as':_0x1817('0x171'),'foreignKey':_0x1817('0x1f7')});db[_0x1817('0x11a')][_0x1817('0x11f')](db[_0x1817('0x15b')],{'as':_0x1817('0x15c'),'foreignKey':_0x1817('0x175')});db[_0x1817('0x11a')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x16a'),'foreignKey':_0x1817('0x10f')});db[_0x1817('0x11a')][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':_0x1817('0x1af'),'as':_0x1817('0x16c')});db['WhatsappInteraction'][_0x1817('0x123')](db[_0x1817('0x8b')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0x1817('0x11a')][_0x1817('0x123')](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':_0x1817('0x1f9')});db[_0x1817('0xfe')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':_0x1817('0x110')});db['WhatsappMessage']['belongsTo'](db[_0x1817('0x15b')],{'onDelete':_0x1817('0x10c'),'as':'Contact'});db[_0x1817('0xfe')][_0x1817('0x11f')](db[_0x1817('0x11a')],{'onDelete':'cascade','as':_0x1817('0x170'),'foreignKey':'WhatsappInteractionId'});db[_0x1817('0xfe')][_0x1817('0x11f')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0x1817('0x1f7')});db[_0x1817('0x100')][_0x1817('0x11f')](db[_0x1817('0xfa')],{});db[_0x1817('0x100')]['belongsTo'](db[_0x1817('0xf6')],{'as':_0x1817('0x179'),'foreignKey':'ListId'});db[_0x1817('0x100')]['belongsTo'](db[_0x1817('0x15b')],{'as':'Contact','foreignKey':_0x1817('0x175')});db[_0x1817('0x100')][_0x1817('0x11f')](db['WhatsappInteraction'],{});db['WhatsappQueueReport'][_0x1817('0x11f')](db['WhatsappQueue'],{});db[_0x1817('0x100')][_0x1817('0x11f')](db[_0x1817('0xfe')],{});db[_0x1817('0x100')][_0x1817('0x11f')](db[_0x1817('0x110')],{});db['WhatsappTransferReport'][_0x1817('0x11f')](db[_0x1817('0xfe')],{});db[_0x1817('0x102')]['belongsTo'](db['WhatsappInteraction'],{});db['WhatsappTransferReport'][_0x1817('0x11f')](db[_0x1817('0xfa')],{'foreignKey':_0x1817('0x1fa'),'as':_0x1817('0x1dd')});db[_0x1817('0x102')][_0x1817('0x11f')](db[_0x1817('0xfa')],{'foreignKey':_0x1817('0x1fb'),'as':_0x1817('0x1e5')});db[_0x1817('0x102')][_0x1817('0x11f')](db[_0x1817('0x103')],{'foreignKey':_0x1817('0x1fc'),'as':_0x1817('0x1e3')});db['WhatsappTransferReport'][_0x1817('0x11f')](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1de'),'as':_0x1817('0x1df')});db['WhatsappTransferReport']['belongsTo'](db[_0x1817('0x110')],{'foreignKey':_0x1817('0x1e0'),'as':_0x1817('0x1e1')});db['WhatsappQueue'][_0x1817('0x123')](db[_0x1817('0x110')],{'as':_0x1817('0x14f'),'through':_0x1817('0x39'),'foreignKey':_0x1817('0x1fd')});db[_0x1817('0x103')]['belongsToMany'](db[_0x1817('0xe4')],{'through':_0x1817('0x1fe'),'as':'Teams'});db[_0x1817('0x10d')][_0x1817('0x11f')](db[_0x1817('0x110')],{'as':'user','foreignKey':'UserId','onDelete':_0x1817('0x10c'),'hooks':!![]});db[_0x1817('0x105')]['hasOne'](db[_0x1817('0xc3')],{'as':'Dynamics365Account','onDelete':_0x1817('0x15e')});db[_0x1817('0x105')][_0x1817('0x10b')](db[_0x1817('0x3b')],{'as':_0x1817('0x161'),'onDelete':'restrict'});db[_0x1817('0x105')][_0x1817('0x10b')](db[_0x1817('0x15f')],{'as':_0x1817('0x1ff'),'onDelete':_0x1817('0x15e')});module[_0x1817('0x200')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 5c657b0..9eed47b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ade=['./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','/api/whatsapp/applications','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/pm2','./api/pm2','./api/webbar','/apidoc','static','root','/www','join','/demo','snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/cmCompany','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','./api/cdr','/api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/contact_item_types','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','./api/integration','./api/integrationReport'];(function(_0x5c891f,_0x3c0231){var _0x4a3d27=function(_0x1694f1){while(--_0x1694f1){_0x5c891f['push'](_0x5c891f['shift']());}};_0x4a3d27(++_0x3c0231);}(_0x9ade,0x95));var _0xe9ad=function(_0x25ba6a,_0x4422d6){_0x25ba6a=_0x25ba6a-0x0;var _0x1be09a=_0x9ade[_0x25ba6a];return _0x1be09a;};'use strict';var path=require(_0xe9ad('0x0'));var express=require(_0xe9ad('0x1'));var errors=require(_0xe9ad('0x2'));var config=require(_0xe9ad('0x3'));var setupLoggers=require(_0xe9ad('0x4'))[_0xe9ad('0x5')];var clientSideLogs=require(_0xe9ad('0x6'));exports[_0xe9ad('0x7')]=function(_0x95b1d1){return setupLoggers(_0x95b1d1)[_0xe9ad('0x8')](function(){_0x95b1d1[_0xe9ad('0x9')]('/api/users',require(_0xe9ad('0xa')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xb'),require('./api/voiceChanSpy'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc'),require(_0xe9ad('0xd')));_0x95b1d1['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe'),require(_0xe9ad('0xf')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x10'),require(_0xe9ad('0x11')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x12'),require(_0xe9ad('0x13')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x14'),require(_0xe9ad('0x15')));_0x95b1d1['use'](_0xe9ad('0x16'),require(_0xe9ad('0x17')));_0x95b1d1['use'](_0xe9ad('0x18'),require(_0xe9ad('0x19')));_0x95b1d1['use'](_0xe9ad('0x1a'),require(_0xe9ad('0x1b')));_0x95b1d1['use'](_0xe9ad('0x1c'),require(_0xe9ad('0x1d')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x1e'),require(_0xe9ad('0x1f')));_0x95b1d1[_0xe9ad('0x9')]('/api/voice/queues/reports',require(_0xe9ad('0x20')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x21'),require(_0xe9ad('0x22')));_0x95b1d1[_0xe9ad('0x9')]('/api/trunks',require(_0xe9ad('0x23')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x24'),require(_0xe9ad('0x25')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x26'),require('./api/mailServerOut'));_0x95b1d1[_0xe9ad('0x9')]('/api/mail/accounts',require(_0xe9ad('0x27')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x28'),require(_0xe9ad('0x29')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x2a'),require('./api/mailSubstatus'));_0x95b1d1['use']('/api/mail/interactions',require('./api/mailInteraction'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x2b'),require(_0xe9ad('0x2c')));_0x95b1d1['use'](_0xe9ad('0x2d'),require(_0xe9ad('0x2e')));_0x95b1d1[_0xe9ad('0x9')]('/api/mail/reports/queue',require(_0xe9ad('0x2f')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x30'),require('./api/dashboard'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x31'),require('./api/dashboardItem'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x32'),require(_0xe9ad('0x33')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x34'),require(_0xe9ad('0x35')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x36'),require(_0xe9ad('0x37')));_0x95b1d1['use']('/api/fax/messages',require(_0xe9ad('0x38')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x39'),require(_0xe9ad('0x3a')));_0x95b1d1['use'](_0xe9ad('0x3b'),require('./api/faxQueueReport'));_0x95b1d1[_0xe9ad('0x9')]('/api/sms/accounts',require('./api/smsAccount'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x3c'),require(_0xe9ad('0x3d')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x3e'),require(_0xe9ad('0x3f')));_0x95b1d1['use'](_0xe9ad('0x40'),require('./api/smsMessage'));_0x95b1d1['use'](_0xe9ad('0x41'),require('./api/smsQueue'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x42'),require(_0xe9ad('0x43')));_0x95b1d1['use']('/api/openchannel/applications',require(_0xe9ad('0x44')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x45'),require('./api/openchannelInteraction'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x46'),require('./api/openchannelMessage'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x47'),require(_0xe9ad('0x48')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x49'),require(_0xe9ad('0x4a')));_0x95b1d1['use'](_0xe9ad('0x4b'),require(_0xe9ad('0x4c')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x4d'),require(_0xe9ad('0x4e')));_0x95b1d1['use'](_0xe9ad('0x4f'),require('./api/chatInteraction'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x50'),require('./api/chatMessage'));_0x95b1d1['use'](_0xe9ad('0x51'),require(_0xe9ad('0x52')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x53'),require(_0xe9ad('0x54')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x55'),require('./api/chatGroup'));_0x95b1d1['use']('/api/chat/proactive_actions',require('./api/chatProactiveAction'));_0x95b1d1['use']('/api/cm/companies',require(_0xe9ad('0x56')));_0x95b1d1[_0xe9ad('0x9')]('/api/cm/contacts',require('./api/cmContact'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x57'),require('./api/cmHopper'));_0x95b1d1['use'](_0xe9ad('0x58'),require(_0xe9ad('0x59')));_0x95b1d1[_0xe9ad('0x9')]('/api/cm/hopper_final',require(_0xe9ad('0x5a')));_0x95b1d1[_0xe9ad('0x9')]('/api/cm/hopper_history',require(_0xe9ad('0x5b')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x5c'),require(_0xe9ad('0x5d')));_0x95b1d1[_0xe9ad('0x9')]('/api/actions',require(_0xe9ad('0x5e')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x5f'),require(_0xe9ad('0x60')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x61'),require(_0xe9ad('0x62')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x63'),require(_0xe9ad('0x64')));_0x95b1d1[_0xe9ad('0x9')]('/api/conditions',require(_0xe9ad('0x65')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x66'),require(_0xe9ad('0x67')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x68'),require(_0xe9ad('0x69')));_0x95b1d1['use']('/api/cdr',require(_0xe9ad('0x6a')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x6b'),require('./api/voiceQueuesLog'));_0x95b1d1[_0xe9ad('0x9')]('/api/schedules',require(_0xe9ad('0x6c')));_0x95b1d1['use'](_0xe9ad('0x6d'),require(_0xe9ad('0x6e')));_0x95b1d1[_0xe9ad('0x9')]('/api/tags',require('./api/tag'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x6f'),require('./api/contactItemType'));_0x95b1d1['use'](_0xe9ad('0x70'),require('./api/cmContactHasItem'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x71'),require(_0xe9ad('0x72')));_0x95b1d1[_0xe9ad('0x9')]('/api/templates',require(_0xe9ad('0x73')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x74'),require(_0xe9ad('0x75')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x76'),require('./api/variable'));_0x95b1d1[_0xe9ad('0x9')]('/api/integrations',require(_0xe9ad('0x77')));_0x95b1d1['use']('/api/integrations/reports',require(_0xe9ad('0x78')));_0x95b1d1[_0xe9ad('0x9')]('/api/analytics/custom_reports',require(_0xe9ad('0x79')));_0x95b1d1['use']('/api/analytics/default_reports',require(_0xe9ad('0x7a')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x7b'),require(_0xe9ad('0x7c')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x7d'),require(_0xe9ad('0x7e')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x7f'),require('./api/analyticFieldReport'));_0x95b1d1[_0xe9ad('0x9')]('/api/analytics/tree_reports',require(_0xe9ad('0x80')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x81'),require('./api/intSalesforceAccount'));_0x95b1d1['use'](_0xe9ad('0x82'),require(_0xe9ad('0x83')));_0x95b1d1[_0xe9ad('0x9')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x84'),require(_0xe9ad('0x85')));_0x95b1d1['use'](_0xe9ad('0x86'),require('./api/intSugarcrmConfiguration'));_0x95b1d1['use'](_0xe9ad('0x87'),require(_0xe9ad('0x88')));_0x95b1d1['use'](_0xe9ad('0x89'),require(_0xe9ad('0x8a')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x8b'),require(_0xe9ad('0x8c')));_0x95b1d1['use'](_0xe9ad('0x8d'),require(_0xe9ad('0x8e')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x8f'),require(_0xe9ad('0x90')));_0x95b1d1['use'](_0xe9ad('0x91'),require(_0xe9ad('0x92')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x93'),require(_0xe9ad('0x94')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x95'),require(_0xe9ad('0x96')));_0x95b1d1['use'](_0xe9ad('0x97'),require(_0xe9ad('0x98')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x99'),require(_0xe9ad('0x9a')));_0x95b1d1[_0xe9ad('0x9')]('/api/integrations/freshdesk/accounts',require(_0xe9ad('0x9b')));_0x95b1d1['use']('/api/integrations/freshdesk/configurations',require(_0xe9ad('0x9c')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x9d'),require('./api/intFreshdeskField'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x9e'),require(_0xe9ad('0x9f')));_0x95b1d1['use'](_0xe9ad('0xa0'),require('./api/intVtigerConfiguration'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xa1'),require(_0xe9ad('0xa2')));_0x95b1d1['use'](_0xe9ad('0xa3'),require('./api/intServicenowAccount'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xa4'),require(_0xe9ad('0xa5')));_0x95b1d1['use'](_0xe9ad('0xa6'),require('./api/intServicenowField'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xa7'),require(_0xe9ad('0xa8')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xa9'),require('./api/intDynamics365Configuration'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xaa'),require(_0xe9ad('0xab')));_0x95b1d1[_0xe9ad('0x9')]('/api/integrations/freshsales/accounts',require(_0xe9ad('0xac')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xad'),require(_0xe9ad('0xae')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xaf'),require('./api/intFreshsalesField'));_0x95b1d1['use'](_0xe9ad('0xb0'),require(_0xe9ad('0xb1')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xb2'),require(_0xe9ad('0xb3')));_0x95b1d1['use'](_0xe9ad('0xb4'),require(_0xe9ad('0xb5')));_0x95b1d1[_0xe9ad('0x9')]('/api/jscripty/answers/reports',require('./api/jscriptyAnswerReport'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xb6'),require('./api/jscriptyQuestionReport'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xb7'),require(_0xe9ad('0xb8')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xb9'),require(_0xe9ad('0xba')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xbb'),require(_0xe9ad('0xbc')));_0x95b1d1['use'](_0xe9ad('0xbd'),require(_0xe9ad('0xbe')));_0x95b1d1['use'](_0xe9ad('0xbf'),require(_0xe9ad('0xc0')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc1'),require(_0xe9ad('0xc2')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc3'),require(_0xe9ad('0xc4')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc5'),require('./api/squareProject'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc6'),require(_0xe9ad('0xc7')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xc8'),require(_0xe9ad('0xc9')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xca'),require(_0xe9ad('0xcb')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xcc'),require(_0xe9ad('0xcd')));_0x95b1d1['use'](_0xe9ad('0xce'),require(_0xe9ad('0xcf')));_0x95b1d1['use'](_0xe9ad('0xd0'),require('./api/migration'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xd1'),require(_0xe9ad('0xd2')));_0x95b1d1['use']('/api/plugins',require('./api/plugin'));_0x95b1d1['use'](_0xe9ad('0xd3'),require('./api/mailTransferReport'));_0x95b1d1['use'](_0xe9ad('0xd4'),require('./api/chatTransferReport'));_0x95b1d1['use']('/api/fax/reports/transfer',require(_0xe9ad('0xd5')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xd6'),require(_0xe9ad('0xd7')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xd8'),require('./api/smsTransferReport'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xd9'),require(_0xe9ad('0xda')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xdb'),require(_0xe9ad('0xdc')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xdd'),require(_0xe9ad('0xde')));_0x95b1d1[_0xe9ad('0x9')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x95b1d1['use'](_0xe9ad('0xdf'),require(_0xe9ad('0xe0')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe1'),require(_0xe9ad('0xe2')));_0x95b1d1['use'](_0xe9ad('0xe3'),require('./api/whatsappAccount'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe4'),require('./api/whatsappApplication'));_0x95b1d1['use'](_0xe9ad('0xe5'),require('./api/whatsappInteraction'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe6'),require(_0xe9ad('0xe7')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe8'),require('./api/whatsappQueueReport'));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xe9'),require(_0xe9ad('0xea')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xeb'),require(_0xe9ad('0xec')));_0x95b1d1['use']('/api/cloudProviders',require(_0xe9ad('0xed')));_0x95b1d1[_0xe9ad('0x9')]('/api/realtime',require(_0xe9ad('0xee')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xef'),require(_0xe9ad('0xf0')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xf1'),require(_0xe9ad('0xf2')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xf3'),require(_0xe9ad('0xf4')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xf5'),require(_0xe9ad('0xf6')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xf7'),require(_0xe9ad('0xf8')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xf9'),require(_0xe9ad('0xfa')));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0xfb'),require(_0xe9ad('0xfc')));_0x95b1d1[_0xe9ad('0x9')]('/api/system',require('./api/system'));_0x95b1d1['use'](_0xe9ad('0xfd'),require(_0xe9ad('0xfe')));_0x95b1d1['use']('/api/webbar',require(_0xe9ad('0xff')));_0x95b1d1[_0xe9ad('0x9')]('/api/logs',clientSideLogs);_0x95b1d1['use'](_0xe9ad('0x100'),express[_0xe9ad('0x101')](path['join'](config[_0xe9ad('0x102')],_0xe9ad('0x100'))));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x103'),express[_0xe9ad('0x101')](path[_0xe9ad('0x104')](config[_0xe9ad('0x102')],_0xe9ad('0x103'))));_0x95b1d1[_0xe9ad('0x9')](_0xe9ad('0x105'),express[_0xe9ad('0x101')](path[_0xe9ad('0x104')](config[_0xe9ad('0x102')],'/demo')));_0x95b1d1['use']('/snippet',express[_0xe9ad('0x101')](path[_0xe9ad('0x104')](config[_0xe9ad('0x102')],_0xe9ad('0x106'),_0xe9ad('0x107'))));_0x95b1d1['use']('/plugins',express[_0xe9ad('0x101')](path[_0xe9ad('0x104')](config[_0xe9ad('0x102')],_0xe9ad('0x108'))));_0x95b1d1[_0xe9ad('0x109')](_0xe9ad('0x10a'))[_0xe9ad('0x10b')](errors[0x194]);_0x95b1d1[_0xe9ad('0x109')]('/*')[_0xe9ad('0x10b')](function(_0x188675,_0x2a3396){_0x2a3396[_0xe9ad('0x10c')](path['resolve'](_0x95b1d1['get'](_0xe9ad('0x10d'))+'/index.html'));});return _0x95b1d1;});};
\ No newline at end of file
+var _0xe7c2=['./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','./api/cdr','/api/schedules','/api/sounds','./api/sound','./api/tag','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','./api/user-setting','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','root','/www','/snippet','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','/api/users','use','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','./api/mailSubstatus','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions'];(function(_0x3c1f30,_0x397168){var _0x3988e9=function(_0x5d66b9){while(--_0x5d66b9){_0x3c1f30['push'](_0x3c1f30['shift']());}};_0x3988e9(++_0x397168);}(_0xe7c2,0xc8));var _0x2e7c=function(_0x2cecf2,_0x3ecedd){_0x2cecf2=_0x2cecf2-0x0;var _0x66f04e=_0xe7c2[_0x2cecf2];return _0x66f04e;};'use strict';var path=require(_0x2e7c('0x0'));var express=require(_0x2e7c('0x1'));var errors=require(_0x2e7c('0x2'));var config=require(_0x2e7c('0x3'));var setupLoggers=require(_0x2e7c('0x4'))[_0x2e7c('0x5')];var clientSideLogs=require(_0x2e7c('0x6'));exports[_0x2e7c('0x7')]=function(_0x93c4a9){return setupLoggers(_0x93c4a9)['then'](function(){_0x93c4a9['use'](_0x2e7c('0x8'),require('./api/user'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa'),require(_0x2e7c('0xb')));_0x93c4a9['use'](_0x2e7c('0xc'),require(_0x2e7c('0xd')));_0x93c4a9['use'](_0x2e7c('0xe'),require('./api/voiceExtension'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xf'),require(_0x2e7c('0x10')));_0x93c4a9['use'](_0x2e7c('0x11'),require(_0x2e7c('0x12')));_0x93c4a9['use'](_0x2e7c('0x13'),require(_0x2e7c('0x14')));_0x93c4a9['use'](_0x2e7c('0x15'),require(_0x2e7c('0x16')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x17'),require(_0x2e7c('0x18')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x19'),require(_0x2e7c('0x1a')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x1b'),require('./api/voiceCallReport'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x1c'),require('./api/voiceDialReport'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x1d'),require(_0x2e7c('0x1e')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x1f'),require(_0x2e7c('0x20')));_0x93c4a9['use']('/api/members/reports',require(_0x2e7c('0x21')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x22'),require(_0x2e7c('0x23')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x24'),require('./api/voiceTransferReport'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x25'),require(_0x2e7c('0x26')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x27'),require(_0x2e7c('0x28')));_0x93c4a9[_0x2e7c('0x9')]('/api/mail/queues',require(_0x2e7c('0x29')));_0x93c4a9['use']('/api/mail/substatuses',require(_0x2e7c('0x2a')));_0x93c4a9[_0x2e7c('0x9')]('/api/mail/interactions',require('./api/mailInteraction'));_0x93c4a9['use'](_0x2e7c('0x2b'),require(_0x2e7c('0x2c')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x2d'),require(_0x2e7c('0x2e')));_0x93c4a9[_0x2e7c('0x9')]('/api/mail/reports/queue',require(_0x2e7c('0x2f')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x30'),require(_0x2e7c('0x31')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x32'),require(_0x2e7c('0x33')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x34'),require(_0x2e7c('0x35')));_0x93c4a9['use'](_0x2e7c('0x36'),require('./api/faxApplication'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x37'),require('./api/faxInteraction'));_0x93c4a9['use']('/api/fax/messages',require(_0x2e7c('0x38')));_0x93c4a9[_0x2e7c('0x9')]('/api/fax/queues',require(_0x2e7c('0x39')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x3a'),require(_0x2e7c('0x3b')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x3c'),require('./api/smsAccount'));_0x93c4a9[_0x2e7c('0x9')]('/api/sms/applications',require(_0x2e7c('0x3d')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x3e'),require('./api/smsInteraction'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x3f'),require(_0x2e7c('0x40')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x41'),require('./api/smsQueue'));_0x93c4a9[_0x2e7c('0x9')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0x93c4a9[_0x2e7c('0x9')]('/api/openchannel/applications',require(_0x2e7c('0x42')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x43'),require(_0x2e7c('0x44')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x45'),require('./api/openchannelMessage'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x46'),require(_0x2e7c('0x47')));_0x93c4a9[_0x2e7c('0x9')]('/api/chat/websites',require(_0x2e7c('0x48')));_0x93c4a9[_0x2e7c('0x9')]('/api/openchannel/reports/queue',require(_0x2e7c('0x49')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x4a'),require(_0x2e7c('0x4b')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x4c'),require(_0x2e7c('0x4d')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x4e'),require(_0x2e7c('0x4f')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x50'),require(_0x2e7c('0x51')));_0x93c4a9[_0x2e7c('0x9')]('/api/chat/queues',require(_0x2e7c('0x52')));_0x93c4a9['use'](_0x2e7c('0x53'),require(_0x2e7c('0x54')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x55'),require(_0x2e7c('0x56')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x57'),require(_0x2e7c('0x58')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x59'),require(_0x2e7c('0x5a')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x5b'),require(_0x2e7c('0x5c')));_0x93c4a9['use']('/api/cm/hopper_black',require(_0x2e7c('0x5d')));_0x93c4a9[_0x2e7c('0x9')]('/api/cm/hopper_final',require(_0x2e7c('0x5e')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x5f'),require(_0x2e7c('0x60')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x61'),require(_0x2e7c('0x62')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x63'),require('./api/action'));_0x93c4a9[_0x2e7c('0x9')]('/api/automations',require('./api/automation'));_0x93c4a9['use']('/api/canned_answers',require(_0x2e7c('0x64')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x65'),require(_0x2e7c('0x66')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x67'),require(_0x2e7c('0x68')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x69'),require(_0x2e7c('0x6a')));_0x93c4a9[_0x2e7c('0x9')]('/api/pauses',require(_0x2e7c('0x6b')));_0x93c4a9['use'](_0x2e7c('0x6c'),require(_0x2e7c('0x6d')));_0x93c4a9['use']('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x6e'),require('./api/schedule'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x6f'),require(_0x2e7c('0x70')));_0x93c4a9[_0x2e7c('0x9')]('/api/tags',require(_0x2e7c('0x71')));_0x93c4a9[_0x2e7c('0x9')]('/api/contact_item_types',require('./api/contactItemType'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x72'),require('./api/cmContactHasItem'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x73'),require(_0x2e7c('0x74')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x75'),require(_0x2e7c('0x76')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x77'),require(_0x2e7c('0x78')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x79'),require('./api/variable'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x7a'),require(_0x2e7c('0x7b')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x7c'),require(_0x2e7c('0x7d')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x7e'),require(_0x2e7c('0x7f')));_0x93c4a9['use'](_0x2e7c('0x80'),require(_0x2e7c('0x81')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x82'),require(_0x2e7c('0x83')));_0x93c4a9['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x93c4a9['use']('/api/analytics/field_reports',require(_0x2e7c('0x84')));_0x93c4a9['use']('/api/analytics/tree_reports',require(_0x2e7c('0x85')));_0x93c4a9[_0x2e7c('0x9')]('/api/integrations/salesforce/accounts',require(_0x2e7c('0x86')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x87'),require(_0x2e7c('0x88')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x89'),require(_0x2e7c('0x8a')));_0x93c4a9['use'](_0x2e7c('0x8b'),require('./api/intSugarcrmAccount'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x8c'),require(_0x2e7c('0x8d')));_0x93c4a9[_0x2e7c('0x9')]('/api/integrations/sugarcrm/fields',require(_0x2e7c('0x8e')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x8f'),require(_0x2e7c('0x90')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x91'),require(_0x2e7c('0x92')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x93'),require(_0x2e7c('0x94')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x95'),require(_0x2e7c('0x96')));_0x93c4a9['use'](_0x2e7c('0x97'),require(_0x2e7c('0x98')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x99'),require(_0x2e7c('0x9a')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x9b'),require('./api/intZendeskAccount'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x9c'),require(_0x2e7c('0x9d')));_0x93c4a9['use'](_0x2e7c('0x9e'),require(_0x2e7c('0x9f')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa0'),require(_0x2e7c('0xa1')));_0x93c4a9[_0x2e7c('0x9')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa2'),require(_0x2e7c('0xa3')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa4'),require(_0x2e7c('0xa5')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa6'),require('./api/intVtigerConfiguration'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa7'),require('./api/intVtigerField'));_0x93c4a9[_0x2e7c('0x9')]('/api/integrations/servicenow/accounts',require(_0x2e7c('0xa8')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xa9'),require('./api/intServicenowConfiguration'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xaa'),require(_0x2e7c('0xab')));_0x93c4a9['use'](_0x2e7c('0xac'),require(_0x2e7c('0xad')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xae'),require(_0x2e7c('0xaf')));_0x93c4a9['use'](_0x2e7c('0xb0'),require(_0x2e7c('0xb1')));_0x93c4a9['use'](_0x2e7c('0xb2'),require(_0x2e7c('0xb3')));_0x93c4a9['use']('/api/integrations/freshsales/configurations',require(_0x2e7c('0xb4')));_0x93c4a9['use'](_0x2e7c('0xb5'),require(_0x2e7c('0xb6')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xb7'),require(_0x2e7c('0xb8')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xb9'),require(_0x2e7c('0xba')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xbb'),require(_0x2e7c('0xbc')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xbd'),require(_0x2e7c('0xbe')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xbf'),require('./api/jscriptyQuestionReport'));_0x93c4a9['use']('/api/jscripty/sessions/reports',require(_0x2e7c('0xc0')));_0x93c4a9[_0x2e7c('0x9')]('/api/sms/reports/queue',require(_0x2e7c('0xc1')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xc2'),require(_0x2e7c('0xc3')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xc4'),require(_0x2e7c('0xc5')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xc6'),require(_0x2e7c('0xc7')));_0x93c4a9[_0x2e7c('0x9')]('/api/settings',require(_0x2e7c('0xc8')));_0x93c4a9[_0x2e7c('0x9')]('/api/square/odbc',require(_0x2e7c('0xc9')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xca'),require('./api/squareProject'));_0x93c4a9['use']('/api/square/recordings',require(_0x2e7c('0xcb')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xcc'),require(_0x2e7c('0xcd')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xce'),require('./api/team'));_0x93c4a9[_0x2e7c('0x9')]('/api/license',require('./api/license'));_0x93c4a9['use'](_0x2e7c('0xcf'),require(_0x2e7c('0xd0')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xd1'),require(_0x2e7c('0xd2')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xd3'),require(_0x2e7c('0xd4')));_0x93c4a9['use'](_0x2e7c('0xd5'),require('./api/plugin'));_0x93c4a9['use']('/api/mail/reports/transfer',require(_0x2e7c('0xd6')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xd7'),require('./api/chatTransferReport'));_0x93c4a9['use'](_0x2e7c('0xd8'),require(_0x2e7c('0xd9')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xda'),require(_0x2e7c('0xdb')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xdc'),require('./api/smsTransferReport'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xdd'),require(_0x2e7c('0xde')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xdf'),require(_0x2e7c('0xe0')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xe1'),require(_0x2e7c('0xe2')));_0x93c4a9['use']('/api/userProfile/sections',require(_0x2e7c('0xe3')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xe4'),require(_0x2e7c('0xe5')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xe6'),require(_0x2e7c('0xe7')));_0x93c4a9['use'](_0x2e7c('0xe8'),require(_0x2e7c('0xe9')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xea'),require('./api/whatsappApplication'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xeb'),require(_0x2e7c('0xec')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xed'),require('./api/whatsappMessage'));_0x93c4a9[_0x2e7c('0x9')]('/api/whatsapp/reports/queue',require(_0x2e7c('0xee')));_0x93c4a9['use'](_0x2e7c('0xef'),require('./api/whatsappTransferReport'));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xf0'),require(_0x2e7c('0xf1')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xf2'),require(_0x2e7c('0xf3')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xf4'),require(_0x2e7c('0xf5')));_0x93c4a9['use']('/api/user-settings',require(_0x2e7c('0xf6')));_0x93c4a9[_0x2e7c('0x9')]('/api/auth/local',require(_0x2e7c('0xf7')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xf8'),require(_0x2e7c('0xf9')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xfa'),require('./api/authActiveDirectory'));_0x93c4a9['use'](_0x2e7c('0xfb'),require('./api/jira'));_0x93c4a9['use'](_0x2e7c('0xfc'),require(_0x2e7c('0xfd')));_0x93c4a9['use']('/api/version',require(_0x2e7c('0xfe')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0xff'),require(_0x2e7c('0x100')));_0x93c4a9['use'](_0x2e7c('0x101'),require(_0x2e7c('0x102')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x103'),require(_0x2e7c('0x104')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x105'),clientSideLogs);_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x106'),express[_0x2e7c('0x107')](path[_0x2e7c('0x108')](config[_0x2e7c('0x109')],'/apidoc')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x10a'),express['static'](path['join'](config[_0x2e7c('0x109')],_0x2e7c('0x10a'))));_0x93c4a9[_0x2e7c('0x9')]('/demo',express['static'](path[_0x2e7c('0x108')](config[_0x2e7c('0x109')],'/demo')));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x10b'),express['static'](path[_0x2e7c('0x108')](config[_0x2e7c('0x109')],_0x2e7c('0x10c'),_0x2e7c('0x10d'))));_0x93c4a9[_0x2e7c('0x9')](_0x2e7c('0x10e'),express[_0x2e7c('0x107')](path[_0x2e7c('0x108')](config[_0x2e7c('0x109')],_0x2e7c('0x10f'))));_0x93c4a9[_0x2e7c('0x110')](_0x2e7c('0x111'))[_0x2e7c('0x112')](errors[0x194]);_0x93c4a9[_0x2e7c('0x110')]('/*')[_0x2e7c('0x112')](function(_0x6f9964,_0x1678cf){_0x1678cf[_0x2e7c('0x113')](path['resolve'](_0x93c4a9[_0x2e7c('0x112')](_0x2e7c('0x114'))+'/index.html'));});return _0x93c4a9;});};
\ No newline at end of file
index 1c23074..3ac8051 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50df=['../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x50df,0x168));var _0xf50d=function(_0x4d3187,_0x91de00){_0x4d3187=_0x4d3187-0x0;var _0x3c2a8a=_0x50df[_0x4d3187];return _0x3c2a8a;};'use strict';var jayson=require(_0xf50d('0x0'));var _=require('lodash');var config=require(_0xf50d('0x1'));exports[_0xf50d('0x2')]=function(){return new Promise(function(_0x3e5a05,_0x3f24ea){var _0x126b98={};_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x4')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/voiceExtension/voiceExtension.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x5')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x6')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x7')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x8')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x9')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0xa')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0xb')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0xc')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0xd')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/mailServerIn/mailServerIn.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/mailAccount/mailAccount.rpc'));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0xe')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/mailInteraction/mailInteraction.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0xf')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x10')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x11')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x12')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/faxApplication/faxApplication.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x13')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x14')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x15')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x16')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x17')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x18')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x19')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1a')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1b')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/chatInteraction/chatInteraction.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1c')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1d')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1e')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x1f')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x20')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x21')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x22')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/pause/pause.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x23')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x24')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x25')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x26')));_0x126b98=_['merge'](_0x126b98,require('../api/variable/variable.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x27')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x28')));_0x126b98=_['merge'](_0x126b98,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x29')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x2a')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x2b')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x2c')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x2d')));_0x126b98=_['merge'](_0x126b98,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x2e')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x2f')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x30')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/squareReport/squareReport.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x31')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/setting/setting.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x32')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x33')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/squareRecording/squareRecording.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x34')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x35')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x36')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x37')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x38')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x39')));_0x126b98=_[_0xf50d('0x3')](_0x126b98,require(_0xf50d('0x3a')));_0x126b98=_['merge'](_0x126b98,require(_0xf50d('0x3b')));var _0x4ef93a=jayson['server'](_0x126b98)[_0xf50d('0x3c')]();var _0x49fc86=config[_0xf50d('0x3d')][_0xf50d('0x3e')]||config['port']+0x1;var _0x57b058=config[_0xf50d('0x3d')]['ip']||'localhost';_0x4ef93a['on'](_0xf50d('0x3f'),function(_0x4ba755){return _0x3f24ea(_0x4ba755);});_0x4ef93a['listen'](_0x49fc86,_0x57b058,function(){console[_0xf50d('0x40')](_0xf50d('0x41'),_0x57b058,_0x49fc86);require(_0xf50d('0x42'))[_0xf50d('0x43')]();return _0x3e5a05(_0xf50d('0x44')+_0x57b058+':'+_0x49fc86);});});};
\ No newline at end of file
+var _0xede7=['../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc'];(function(_0x54c077,_0x522fd2){var _0x581adb=function(_0x2dd367){while(--_0x2dd367){_0x54c077['push'](_0x54c077['shift']());}};_0x581adb(++_0x522fd2);}(_0xede7,0x11e));var _0x7ede=function(_0xca5256,_0x578467){_0xca5256=_0xca5256-0x0;var _0x1fe79d=_0xede7[_0xca5256];return _0x1fe79d;};'use strict';var jayson=require(_0x7ede('0x0'));var _=require(_0x7ede('0x1'));var config=require(_0x7ede('0x2'));exports[_0x7ede('0x3')]=function(){return new Promise(function(_0x4d29bd,_0x14d0d2){var _0x52fc33={};_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x5')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x6')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x7')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x8')));_0x52fc33=_['merge'](_0x52fc33,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x9')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0xa')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0xb')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/memberReport/memberReport.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0xc')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0xd')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0xe')));_0x52fc33=_['merge'](_0x52fc33,require('../api/mailServerIn/mailServerIn.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/mailAccount/mailAccount.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0xf')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x10')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x11')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x12')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x13')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x14')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x15')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x16')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x17')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x18')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x19')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/smsAccount/smsAccount.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x1a')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x1b')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x1c')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x1d')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x1e')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x52fc33=_['merge'](_0x52fc33,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x1f')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x20')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x21')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x22')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x23')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x24')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x25')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x26')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x27')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x28')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/pause/pause.rpc'));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x29')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x2a')));_0x52fc33=_['merge'](_0x52fc33,require('../api/template/template.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/trigger/trigger.rpc'));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x2b')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x2c')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x2d')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x2e')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x2f')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x30')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x31')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x32')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x33')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x34')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x35')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x36')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x37')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x38')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x39')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/squareProject/squareProject.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/squareRecording/squareRecording.rpc'));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x3a')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x3b')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x3c')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/plugin/plugin.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x3d')));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x52fc33=_[_0x7ede('0x4')](_0x52fc33,require(_0x7ede('0x3e')));_0x52fc33=_['merge'](_0x52fc33,require(_0x7ede('0x3f')));var _0x998787=jayson[_0x7ede('0x40')](_0x52fc33)[_0x7ede('0x41')]();var _0x50803a=config[_0x7ede('0x42')]['port']||config[_0x7ede('0x43')]+0x1;var _0x338ec9=config[_0x7ede('0x42')]['ip']||_0x7ede('0x44');_0x998787['on'](_0x7ede('0x45'),function(_0x12bfde){return _0x14d0d2(_0x12bfde);});_0x998787[_0x7ede('0x3')](_0x50803a,_0x338ec9,function(){console['log'](_0x7ede('0x46'),_0x338ec9,_0x50803a);require(_0x7ede('0x47'))[_0x7ede('0x48')]();return _0x4d29bd(_0x7ede('0x49')+_0x338ec9+':'+_0x50803a);});});};
\ No newline at end of file
index 8ef3cc7..241ae7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf8=['format','exec','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','setVariable','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','emit','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','substr','startsWith','split','length','error','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','write','close','destroy','inherits','prototype','command','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','sendRequest'];(function(_0xf87d29,_0x29a687){var _0x31a224=function(_0x8e30b9){while(--_0x8e30b9){_0xf87d29['push'](_0xf87d29['shift']());}};_0x31a224(++_0x29a687);}(_0xddf8,0x1d4));var _0x8ddf=function(_0x48b63e,_0x50e7e6){_0x48b63e=_0x48b63e-0x0;var _0xfe4195=_0xddf8[_0x48b63e];return _0xfe4195;};'use strict';var util=require(_0x8ddf('0x0'));var _=require('lodash');var EventEmitter=require(_0x8ddf('0x1'))[_0x8ddf('0x2')];var AGIReply=require(_0x8ddf('0x3'));var AGIError=require(_0x8ddf('0x4'));function AGIChannel(_0x1e28fe){var _0x47609e=this,_0x29ae92=new AGIReply(),_0x3a823f=![],_0x3f09c7={};EventEmitter[_0x8ddf('0x5')](_0x47609e);_0x1e28fe[_0x8ddf('0x6')](_0x8ddf('0x7'));_0x1e28fe[_0x8ddf('0x8')](0x8*0x3c*0x3c*0x3e8);_0x29ae92[_0x8ddf('0x6')](_0x8ddf('0x7'));_0x29ae92['on'](_0x8ddf('0x9'),function(_0x5b2d1c){for(var _0x3e0ef9 in _0x5b2d1c){_0x47609e[_0x3e0ef9]=_0x5b2d1c[_0x3e0ef9];}_0x47609e['emit'](_0x8ddf('0xa'));});_0x29ae92['on'](_0x8ddf('0xb'),function(_0x3f142c){if(_0x3f142c[_0x8ddf('0xc')]()=='hangup'){_0x47609e[_0x8ddf('0xd')](_0x8ddf('0xe'));return;}if(_0x3f142c['substring'](0x0,0xb)==_0x8ddf('0xf')){_0x3a823f=!![];}if(_0x3a823f){_0x3f09c7['rx']+=_0x3f142c+'\x0a';if(_0x3f142c[_0x8ddf('0x10')](_0x8ddf('0x11'))!=-0x1){_0x3a823f=![];}}else{_0x3f09c7['rx']=_0x3f142c;}if(_0x3a823f){return;}if(typeof _0x3f09c7['cb']==_0x8ddf('0x12')){var _0x3a6ba3=_0x3f09c7['rx'][_0x8ddf('0x13')](0x0,0x3),_0x17ae84=null,_0x38667c=null;_0x3a6ba3=parseInt(_0x3a6ba3);if(isNaN(_0x3a6ba3)){_0x3f09c7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8ddf('0x14')});return;}if(_0x3a6ba3!=0xc8){_0x3f09c7['cb'](null,{'code':_0x3a6ba3,'result':-0x1,'extra':'KO'});return;}_0x17ae84=_0x3f09c7['rx']['substring'](0x4)[_0x8ddf('0x15')]('result=','');if(_0x17ae84['indexOf']('\x20')!=-0x1){_0x17ae84=_0x17ae84[_0x8ddf('0x16')](0x0,_0x17ae84['indexOf']('\x20'));}if(_[_0x8ddf('0x17')](_0x17ae84,'-1')){_0x17ae84=parseInt(_0x17ae84);}_0x38667c=_0x3f09c7['rx'][_0x8ddf('0x18')]('\x20');if(_0x38667c['length']==0x3){_0x38667c=_0x38667c[0x2][_0x8ddf('0x13')](0x1,_0x38667c[0x2][_0x8ddf('0x19')]-0x1);}else if(_0x38667c[_0x8ddf('0x19')]>0x3){var _0x5c8d0b=/\((.+)\)/;var _0x371435=_0x3f09c7['rx']['match'](_0x5c8d0b);if(_0x371435){_0x38667c=_0x371435[0x1];}else{_0x38667c=null;}}else{_0x38667c=null;}_0x3f09c7['cb'](null,{'code':_0x3a6ba3,'result':_0x17ae84,'extra':_0x38667c});}});_0x1e28fe['on'](_0x8ddf('0x1a'),function(_0x292c3a){_0x47609e[_0x8ddf('0xd')](_0x8ddf('0x1a'),new AGIError('E_AGI_SOCKET_ERROR',_0x292c3a[_0x8ddf('0x1b')]));});_0x1e28fe['on']('close',function(){_0x47609e[_0x8ddf('0xd')]('close',new AGIError(_0x8ddf('0x1c')));});_0x1e28fe['on'](_0x8ddf('0x1d'),function(){_0x47609e[_0x8ddf('0xd')](_0x8ddf('0x1d'),new AGIError(_0x8ddf('0x1e')));_0x1e28fe['destroy']();});_0x1e28fe['pipe'](_0x29ae92);this['command']=function(_0x2d039b,_0x577d33){var _0x2d039b=_0x2d039b||'',_0x577d33=typeof _0x577d33==_0x8ddf('0x12')?_0x577d33:new Function();_0x3f09c7={'tx':_0x2d039b,'rx':'','cb':_0x577d33};_0x1e28fe[_0x8ddf('0x1f')](_0x2d039b+'\x0a');},this[_0x8ddf('0x20')]=function(){_0x1e28fe[_0x8ddf('0x21')]();};}util[_0x8ddf('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x8ddf('0x23')]['sendRequest']=function(_0x23a20b){return this[_0x8ddf('0x24')]['sync'](this,_0x23a20b);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x8ddf('0x25'));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x26')]=function(_0x349c3f,_0x5f5cc5,_0x1c932b){_0x349c3f=_0x349c3f===undefined?_0x8ddf('0x27'):_0x349c3f;_0x5f5cc5=_0x5f5cc5===undefined?'5':_0x5f5cc5;_0x1c932b=_0x1c932b===undefined?'1':_0x1c932b;return this['sendRequest'](util['format'](_0x8ddf('0x28'),_0x349c3f,_0x5f5cc5*0x3e8,_0x1c932b));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x29')]=function(_0x37effc){_0x37effc=_0x37effc||'NO\x20MESSAGE';return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')]('VERBOSE\x20\x22%s\x22',_0x37effc));};AGIChannel['prototype'][_0x8ddf('0x2c')]=function(_0x3c7033,_0x2982fc){if(_[_0x8ddf('0x2d')](_0x2982fc)){return this[_0x8ddf('0x2a')](util['format']('EXEC\x20%s\x20%s',_0x3c7033,_0x2982fc['join'](',')));}return this['sendRequest'](util['format'](_0x8ddf('0x2e'),_0x3c7033,_0x2982fc));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x2f')]=function(_0x4d98a7){return this[_0x8ddf('0x2a')](util['format'](_0x8ddf('0x30'),_0x4d98a7));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x31')]=function(_0x322ae8){return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')](_0x8ddf('0x32'),_0x322ae8));};AGIChannel[_0x8ddf('0x23')]['setPriority']=function(_0x321361){return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')](_0x8ddf('0x33'),_0x321361));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0xe')]=function(){return this[_0x8ddf('0x2a')]('HANGUP');};AGIChannel['prototype'][_0x8ddf('0x34')]=function(_0xd13c05,_0x197988){var _0x22c22e=_['isBoolean'](_0x197988)||_['isNumber'](_0x197988)?_0x197988[_0x8ddf('0x35')]():_0x197988;return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')](_0x8ddf('0x36'),_0xd13c05,_0x22c22e?_0x22c22e['toString']()[_0x8ddf('0x15')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x37')]=function(_0x4fe419,_0x4b4dc7){return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')](_0x8ddf('0x38'),_0x4fe419,_0x4b4dc7));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x39')]=function(_0xfdd5df,_0x446605){return this[_0x8ddf('0x2a')](util['format'](_0x8ddf('0x3a'),_0xfdd5df,_0x446605));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x3b')]=function(_0x538bf5,_0x11b723){return this['sendRequest'](util[_0x8ddf('0x2b')](_0x8ddf('0x3c'),_0x538bf5,_0x11b723));};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x3d')]=function(_0x3efb2b,_0x537c55,_0x4a59f8){_0x537c55=_0x537c55||this[_0x8ddf('0x3e')];_0x4a59f8=_0x4a59f8||0x1;this['setContext'](_0x3efb2b);this[_0x8ddf('0x31')](_0x537c55);this[_0x8ddf('0x3f')](_0x4a59f8);return this[_0x8ddf('0x29')](util[_0x8ddf('0x2b')](_0x8ddf('0x40'),_0x3efb2b,_0x537c55,_0x4a59f8));};AGIChannel['prototype']['getVariable']=function(_0x38054d){return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')](_0x8ddf('0x41'),_0x38054d));};AGIChannel[_0x8ddf('0x23')]['recordFile']=function(_0x5f3107,_0x56d713,_0x5b2179,_0x657845,_0x10e4d9,_0x37e615){_0x56d713=_0x56d713||'wav';_0x5b2179=_0x5b2179||'';_0x657845=_0x657845===undefined?-0x1:_0x657845==='-1'?-0x1:_0x657845*0x3e8;_0x10e4d9=_0x10e4d9===undefined?'':'s='+_0x10e4d9;_0x37e615=_0x37e615?'BEEP':'';return this[_0x8ddf('0x2a')](util[_0x8ddf('0x2b')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x5f3107,_0x56d713,_0x5b2179,_0x657845,_0x37e615,_0x10e4d9));};AGIChannel['prototype'][_0x8ddf('0x42')]=function(_0xebfc16,_0x4b11a0){_0x4b11a0=_0x4b11a0||'';return this[_0x8ddf('0x2a')](util['format'](_0x8ddf('0x43'),_0xebfc16,_0x4b11a0));};AGIChannel[_0x8ddf('0x23')]['agi']=function(_0x3a4e24){return this[_0x8ddf('0x2c')](_0x8ddf('0x44'),_0x3a4e24);};AGIChannel[_0x8ddf('0x23')][_0x8ddf('0x45')]=function(_0x25c5bc){return this[_0x8ddf('0x2c')](_0x8ddf('0x46'),_0x25c5bc);};AGIChannel[_0x8ddf('0x23')]['error']=function(_0x18d8fa,_0x647a86){this[_0x8ddf('0x29')](util[_0x8ddf('0x2b')](_0x8ddf('0x47'),_0x18d8fa['id'],_0x18d8fa['label'],_0x647a86));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8ddf('0x48')]=AGIChannel;
\ No newline at end of file
+var _0x4049=['match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','sendRequest','sync','answer','ANSWER','prototype','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','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','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','exec','AGI','wait','label','util','lodash','events','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','search','520\x20End\x20of\x20proper','function','no\x20code','substring','replace','result=','indexOf','substr','startsWith','length'];(function(_0xbc89e5,_0x19ce43){var _0x555b08=function(_0x22d51f){while(--_0x22d51f){_0xbc89e5['push'](_0xbc89e5['shift']());}};_0x555b08(++_0x19ce43);}(_0x4049,0x177));var _0x9404=function(_0x10fc8b,_0xb7fca){_0x10fc8b=_0x10fc8b-0x0;var _0x4b8c84=_0x4049[_0x10fc8b];return _0x4b8c84;};'use strict';var util=require(_0x9404('0x0'));var _=require(_0x9404('0x1'));var EventEmitter=require(_0x9404('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x9404('0x3'));function AGIChannel(_0xbbd3a3){var _0x50eef1=this,_0x47ccda=new AGIReply(),_0x2eb0a0=![],_0x4de300={};EventEmitter[_0x9404('0x4')](_0x50eef1);_0xbbd3a3[_0x9404('0x5')](_0x9404('0x6'));_0xbbd3a3[_0x9404('0x7')](0x8*0x3c*0x3c*0x3e8);_0x47ccda[_0x9404('0x5')](_0x9404('0x6'));_0x47ccda['on'](_0x9404('0x8'),function(_0x3d15a6){for(var _0x3b93a1 in _0x3d15a6){_0x50eef1[_0x3b93a1]=_0x3d15a6[_0x3b93a1];}_0x50eef1[_0x9404('0x9')](_0x9404('0xa'));});_0x47ccda['on'](_0x9404('0xb'),function(_0x15481c){if(_0x15481c[_0x9404('0xc')]()==_0x9404('0xd')){_0x50eef1[_0x9404('0x9')](_0x9404('0xd'));return;}if(_0x15481c['substring'](0x0,0xb)=='520-Invalid'){_0x2eb0a0=!![];}if(_0x2eb0a0){_0x4de300['rx']+=_0x15481c+'\x0a';if(_0x15481c[_0x9404('0xe')](_0x9404('0xf'))!=-0x1){_0x2eb0a0=![];}}else{_0x4de300['rx']=_0x15481c;}if(_0x2eb0a0){return;}if(typeof _0x4de300['cb']==_0x9404('0x10')){var _0x3398bd=_0x4de300['rx']['substring'](0x0,0x3),_0x34f5a0=null,_0x567bcc=null;_0x3398bd=parseInt(_0x3398bd);if(isNaN(_0x3398bd)){_0x4de300['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x9404('0x11')});return;}if(_0x3398bd!=0xc8){_0x4de300['cb'](null,{'code':_0x3398bd,'result':-0x1,'extra':'KO'});return;}_0x34f5a0=_0x4de300['rx'][_0x9404('0x12')](0x4)[_0x9404('0x13')](_0x9404('0x14'),'');if(_0x34f5a0[_0x9404('0x15')]('\x20')!=-0x1){_0x34f5a0=_0x34f5a0[_0x9404('0x16')](0x0,_0x34f5a0['indexOf']('\x20'));}if(_[_0x9404('0x17')](_0x34f5a0,'-1')){_0x34f5a0=parseInt(_0x34f5a0);}_0x567bcc=_0x4de300['rx']['split']('\x20');if(_0x567bcc[_0x9404('0x18')]==0x3){_0x567bcc=_0x567bcc[0x2]['substring'](0x1,_0x567bcc[0x2]['length']-0x1);}else if(_0x567bcc[_0x9404('0x18')]>0x3){var _0x49c0f3=/\((.+)\)/;var _0x585504=_0x4de300['rx'][_0x9404('0x19')](_0x49c0f3);if(_0x585504){_0x567bcc=_0x585504[0x1];}else{_0x567bcc=null;}}else{_0x567bcc=null;}_0x4de300['cb'](null,{'code':_0x3398bd,'result':_0x34f5a0,'extra':_0x567bcc});}});_0xbbd3a3['on'](_0x9404('0x1a'),function(_0x29f018){_0x50eef1[_0x9404('0x9')](_0x9404('0x1a'),new AGIError(_0x9404('0x1b'),_0x29f018[_0x9404('0x1c')]));});_0xbbd3a3['on'](_0x9404('0x1d'),function(){_0x50eef1[_0x9404('0x9')]('close',new AGIError(_0x9404('0x1e')));});_0xbbd3a3['on'](_0x9404('0x1f'),function(){_0x50eef1[_0x9404('0x9')](_0x9404('0x1f'),new AGIError(_0x9404('0x20')));_0xbbd3a3[_0x9404('0x21')]();});_0xbbd3a3[_0x9404('0x22')](_0x47ccda);this[_0x9404('0x23')]=function(_0x4faf2f,_0x3ea676){var _0x4faf2f=_0x4faf2f||'',_0x3ea676=typeof _0x3ea676=='function'?_0x3ea676:new Function();_0x4de300={'tx':_0x4faf2f,'rx':'','cb':_0x3ea676};_0xbbd3a3[_0x9404('0x24')](_0x4faf2f+'\x0a');},this['close']=function(){_0xbbd3a3['destroy']();};}util[_0x9404('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x9404('0x26')]=function(_0x5c0e93){return this[_0x9404('0x23')][_0x9404('0x27')](this,_0x5c0e93);};AGIChannel['prototype'][_0x9404('0x28')]=function(){return this[_0x9404('0x26')](_0x9404('0x29'));};AGIChannel[_0x9404('0x2a')][_0x9404('0x2b')]=function(_0x419221,_0x411bab,_0x504e8b){_0x419221=_0x419221===undefined?_0x9404('0x2c'):_0x419221;_0x411bab=_0x411bab===undefined?'5':_0x411bab;_0x504e8b=_0x504e8b===undefined?'1':_0x504e8b;return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x2e'),_0x419221,_0x411bab*0x3e8,_0x504e8b));};AGIChannel['prototype'][_0x9404('0x2f')]=function(_0x4a600a){_0x4a600a=_0x4a600a||'NO\x20MESSAGE';return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x30'),_0x4a600a));};AGIChannel['prototype']['exec']=function(_0x543c4c,_0x26a2a8){if(_[_0x9404('0x31')](_0x26a2a8)){return this[_0x9404('0x26')](util['format'](_0x9404('0x32'),_0x543c4c,_0x26a2a8['join'](',')));}return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x32'),_0x543c4c,_0x26a2a8));};AGIChannel[_0x9404('0x2a')][_0x9404('0x33')]=function(_0x53038c){return this[_0x9404('0x26')](util['format'](_0x9404('0x34'),_0x53038c));};AGIChannel[_0x9404('0x2a')][_0x9404('0x35')]=function(_0x393981){return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x36'),_0x393981));};AGIChannel[_0x9404('0x2a')][_0x9404('0x37')]=function(_0x295c3a){return this['sendRequest'](util[_0x9404('0x2d')](_0x9404('0x38'),_0x295c3a));};AGIChannel[_0x9404('0x2a')][_0x9404('0xd')]=function(){return this['sendRequest'](_0x9404('0x39'));};AGIChannel[_0x9404('0x2a')]['setVariable']=function(_0x1825a0,_0x11b6ef){var _0xd8dbb2=_[_0x9404('0x3a')](_0x11b6ef)||_[_0x9404('0x3b')](_0x11b6ef)?_0x11b6ef['toString']():_0x11b6ef;return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x3c'),_0x1825a0,_0xd8dbb2?_0xd8dbb2[_0x9404('0x3d')]()[_0x9404('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x9404('0x3e')]=function(_0xf6179f,_0x17f0fb){return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x3f'),_0xf6179f,_0x17f0fb));};AGIChannel[_0x9404('0x2a')][_0x9404('0x40')]=function(_0x387420,_0x2558ca){return this[_0x9404('0x26')](util['format'](_0x9404('0x41'),_0x387420,_0x2558ca));};AGIChannel[_0x9404('0x2a')][_0x9404('0x42')]=function(_0x35c313,_0x8b5549){return this['sendRequest'](util[_0x9404('0x2d')](_0x9404('0x43'),_0x35c313,_0x8b5549));};AGIChannel[_0x9404('0x2a')][_0x9404('0x44')]=function(_0x26cf07,_0x13cc5b,_0x34c4dd){_0x13cc5b=_0x13cc5b||this[_0x9404('0x45')];_0x34c4dd=_0x34c4dd||0x1;this[_0x9404('0x33')](_0x26cf07);this['setExtension'](_0x13cc5b);this[_0x9404('0x37')](_0x34c4dd);return this[_0x9404('0x2f')](util['format'](_0x9404('0x46'),_0x26cf07,_0x13cc5b,_0x34c4dd));};AGIChannel[_0x9404('0x2a')]['getVariable']=function(_0x351c96){return this[_0x9404('0x26')](util[_0x9404('0x2d')](_0x9404('0x47'),_0x351c96));};AGIChannel[_0x9404('0x2a')][_0x9404('0x48')]=function(_0x50e59d,_0x17afe3,_0x1d460f,_0x167b6b,_0x32bff3,_0x223962){_0x17afe3=_0x17afe3||'wav';_0x1d460f=_0x1d460f||'';_0x167b6b=_0x167b6b===undefined?-0x1:_0x167b6b==='-1'?-0x1:_0x167b6b*0x3e8;_0x32bff3=_0x32bff3===undefined?'':'s='+_0x32bff3;_0x223962=_0x223962?_0x9404('0x49'):'';return this[_0x9404('0x26')](util[_0x9404('0x2d')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x50e59d,_0x17afe3,_0x1d460f,_0x167b6b,_0x223962,_0x32bff3));};AGIChannel['prototype'][_0x9404('0x4a')]=function(_0x3433e2,_0x428f1d){_0x428f1d=_0x428f1d||'';return this[_0x9404('0x26')](util['format'](_0x9404('0x4b'),_0x3433e2,_0x428f1d));};AGIChannel[_0x9404('0x2a')]['agi']=function(_0x24ce97){return this[_0x9404('0x4c')](_0x9404('0x4d'),_0x24ce97);};AGIChannel[_0x9404('0x2a')][_0x9404('0x4e')]=function(_0x3449e9){return this[_0x9404('0x4c')]('WAIT',_0x3449e9);};AGIChannel['prototype'][_0x9404('0x1a')]=function(_0x5b8d9f,_0x501a3d){this[_0x9404('0x2f')](util[_0x9404('0x2d')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x5b8d9f['id'],_0x5b8d9f[_0x9404('0x4f')],_0x501a3d));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel;
\ No newline at end of file
index 9bce996..58655b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcfdf=['Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply','message','exports','util','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x4ff689,_0x25a73e){var _0xea616f=function(_0xcc1991){while(--_0xcc1991){_0x4ff689['push'](_0x4ff689['shift']());}};_0xea616f(++_0x25a73e);}(_0xcfdf,0x1c3));var _0xfcfd=function(_0x70920d,_0x5d0c31){_0x70920d=_0x70920d-0x0;var _0x573495=_0xcfdf[_0x70920d];return _0x573495;};'use strict';var util=require(_0xfcfd('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xfcfd('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0xfcfd('0x2'),'E_AGI_SERVER_VOICE_DISABLED':_0xfcfd('0x3'),'E_AGI_SOCKET_ERROR':_0xfcfd('0x4'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xfcfd('0x5'),'E_AGI_COMMAND_EMPTY':_0xfcfd('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xfcfd('0x7'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x59ccc0){var _0x59ccc0=_0x59ccc0||null,_0x20f8c8=_0x20f8c8||[],_0x411439=0x1,_0x33a567='';if(!error[_0x59ccc0]){_0x59ccc0=_0xfcfd('0x8');}_0x20f8c8[_0xfcfd('0x9')](error[_0x59ccc0]);while(arguments[_0x411439]){_0x20f8c8[_0xfcfd('0x9')](arguments[_0x411439]);_0x411439++;}_0x33a567=util['format'][_0xfcfd('0xa')](util,_0x20f8c8);this[_0xfcfd('0xb')]=_0x33a567;this['name']=_0x59ccc0;}module[_0xfcfd('0xc')]=AGIError;
\ No newline at end of file
+var _0x24fc=['Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.'];(function(_0x5f5399,_0x4928ca){var _0x5e5647=function(_0x55f02e){while(--_0x55f02e){_0x5f5399['push'](_0x5f5399['shift']());}};_0x5e5647(++_0x4928ca);}(_0x24fc,0x199));var _0xc24f=function(_0x345c37,_0xea69ee){_0x345c37=_0x345c37-0x0;var _0x501580=_0x24fc[_0x345c37];return _0x501580;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xc24f('0x0'),'E_AGI_ARGUMENT_PORT':_0xc24f('0x1'),'E_AGI_SERVER_ERROR':_0xc24f('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xc24f('0x3'),'E_AGI_SOCKET_CLOSE':_0xc24f('0x4'),'E_AGI_SOCKET_TIMEOUT':_0xc24f('0x5'),'E_AGI_COMMAND_EMPTY':_0xc24f('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc24f('0x7'),'E_AGI_IVR_ENTRY':_0xc24f('0x8')};function AGIError(_0x4702e5){var _0x4702e5=_0x4702e5||null,_0x2f92e8=_0x2f92e8||[],_0xd897d0=0x1,_0x2197d1='';if(!error[_0x4702e5]){_0x4702e5=_0xc24f('0x9');}_0x2f92e8[_0xc24f('0xa')](error[_0x4702e5]);while(arguments[_0xd897d0]){_0x2f92e8[_0xc24f('0xa')](arguments[_0xd897d0]);_0xd897d0++;}_0x2197d1=util[_0xc24f('0xb')]['apply'](util,_0x2f92e8);this['message']=_0x2197d1;this[_0xc24f('0xc')]=_0x4702e5;}module['exports']=AGIError;
\ No newline at end of file
index 89b90c7..4f2ac13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1be0=['localhost','subscribe','agi','error','message','emit','projectUpdate','lodash','events','EventEmitter','ioredis','./error','../../config/environment','redis','defaults'];(function(_0x400a3d,_0x376549){var _0x25fb8a=function(_0x4c8013){while(--_0x4c8013){_0x400a3d['push'](_0x400a3d['shift']());}};_0x25fb8a(++_0x376549);}(_0x1be0,0x19c));var _0x01be=function(_0x1b4e42,_0x2ad689){_0x1b4e42=_0x1b4e42-0x0;var _0x10a9aa=_0x1be0[_0x1b4e42];return _0x10a9aa;};'use strict';var _=require(_0x01be('0x0'));var EventEmitter=require(_0x01be('0x1'))[_0x01be('0x2')];var Redis=require(_0x01be('0x3'));var AGIError=require(_0x01be('0x4'));var config=require(_0x01be('0x5'));config[_0x01be('0x6')]=_[_0x01be('0x7')](config[_0x01be('0x6')],{'host':_0x01be('0x8'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x01be('0x6')]);sub[_0x01be('0x9')](_0x01be('0xa'),function(_0x4c756b){if(_0x4c756b)return eventEmitter['emit'](_0x01be('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x4c756b));});sub['on'](_0x01be('0xc'),function(_0x4ba58a,_0x30ec90){if(_0x4ba58a!==_0x01be('0xa'))return;try{var _0x4cd342=JSON['parse'](_0x30ec90);eventEmitter[_0x01be('0xd')](_0x01be('0xe'),_0x4cd342);}catch(_0x2384af){eventEmitter['emit'](_0x01be('0xb'),new AGIError('E_AGI_SERVER_ERROR',_0x2384af));}});module['exports']={'EventEmitter':eventEmitter};
\ No newline at end of file
+var _0x20fc=['emit','error','message','projectUpdate','exports','lodash','EventEmitter','ioredis','../../config/environment','defaults','redis','subscribe','agi'];(function(_0x17ebab,_0xe57a3b){var _0x4bef45=function(_0x11c395){while(--_0x11c395){_0x17ebab['push'](_0x17ebab['shift']());}};_0x4bef45(++_0xe57a3b);}(_0x20fc,0xae));var _0xc20f=function(_0x12254f,_0x100cfe){_0x12254f=_0x12254f-0x0;var _0x3a4fa2=_0x20fc[_0x12254f];return _0x3a4fa2;};'use strict';var _=require(_0xc20f('0x0'));var EventEmitter=require('events')[_0xc20f('0x1')];var Redis=require(_0xc20f('0x2'));var AGIError=require('./error');var config=require(_0xc20f('0x3'));config['redis']=_[_0xc20f('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0xc20f('0x5')]);sub[_0xc20f('0x6')](_0xc20f('0x7'),function(_0x153538){if(_0x153538)return eventEmitter[_0xc20f('0x8')](_0xc20f('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x153538));});sub['on'](_0xc20f('0xa'),function(_0x4e6981,_0x4e0b8a){if(_0x4e6981!==_0xc20f('0x7'))return;try{var _0x535a48=JSON['parse'](_0x4e0b8a);eventEmitter[_0xc20f('0x8')](_0xc20f('0xb'),_0x535a48);}catch(_0x323d17){eventEmitter[_0xc20f('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x323d17));}});module[_0xc20f('0xc')]={'EventEmitter':eventEmitter};
\ No newline at end of file
index ef534aa..09d8ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee7f=['vertices','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','condition','split','agicommand','vswitch','target','default','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','agi','menu','getdigits','getsecretdigits','edges','numberOfEdges','prototype','addVertex'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xee7f,0xc3));var _0xfee7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee7f[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')(_0xfee7('0x0'));var verticesWithRetry=[_0xfee7('0x1'),_0xfee7('0x2'),_0xfee7('0x3')];var Graph=function(){this['vertices']={};this[_0xfee7('0x4')]={};this[_0xfee7('0x5')]=0x0;};Graph[_0xfee7('0x6')][_0xfee7('0x7')]=function(_0x27885b){this[_0xfee7('0x8')][_0x27885b['id']]=_0x27885b;this[_0xfee7('0x4')][_0x27885b['id']]=[];};Graph['prototype'][_0xfee7('0x9')]=function(_0x216bfe,_0x481f0e,_0x326255){this[_0xfee7('0x4')][_0x216bfe][_0xfee7('0xa')]({'target':_0x481f0e,'condition':_0x326255});this[_0xfee7('0x5')]+=0x1;};Graph[_0xfee7('0x6')][_0xfee7('0xb')]=function(){return _[_0xfee7('0xb')](this[_0xfee7('0x8')]);};Graph[_0xfee7('0x6')][_0xfee7('0xc')]=function(){return this[_0xfee7('0x5')];};Graph['prototype'][_0xfee7('0xd')]=function(_0x399a89){return this[_0xfee7('0x8')][_0x399a89];};Graph[_0xfee7('0x6')][_0xfee7('0xe')]=function(_0x2b1c6a,_0x26124a){if(!this['vertices'][_0x2b1c6a]){return logger['info'](_0xfee7('0xf'));}var _0x5e84d8=_0x26124a(this[_0xfee7('0x8')][_0x2b1c6a]);if(!_0x5e84d8){return logger[_0xfee7('0x10')](_0xfee7('0x11'));}if(this[_0xfee7('0x4')][_0x2b1c6a][_0xfee7('0x12')]===0x0){return logger[_0xfee7('0x10')]('no\x20edge/s\x20available');}for(var _0x192185=0x0,_0x24862f=[],_0x374fc0=![];_0x192185<this['edges'][_0x2b1c6a]['length'];_0x192185+=0x1){if(this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x13')]){_0x24862f=this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x13')][_0xfee7('0x14')](',');for(var _0x521b05=0x0;_0x521b05<_0x24862f['length'];_0x521b05+=0x1){if(this[_0xfee7('0x8')][_0x2b1c6a][_0xfee7('0x15')]===_0xfee7('0x16')&&_0x24862f[_0x521b05]==='-'){_0x374fc0=this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x17')];logger['info'](_0xfee7('0x18'),_0x24862f[_0x521b05],this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x17')]);}else if(this[_0xfee7('0x8')][_0x2b1c6a]['agicommand']===_0xfee7('0x1')&&_0x24862f[_0x521b05]==='i'){_0x374fc0=this['edges'][_0x2b1c6a][_0x192185][_0xfee7('0x17')];logger[_0xfee7('0x10')]('invalid',_0x24862f[_0x521b05],this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x17')]);}if(_0x24862f[_0x521b05]===_0x5e84d8){return this['traverseBFS'](this[_0xfee7('0x4')][_0x2b1c6a][_0x192185][_0xfee7('0x17')],_0x26124a);}}}else{return this[_0xfee7('0xe')](this[_0xfee7('0x4')][_0x2b1c6a][_0x192185]['target'],_0x26124a);}}if(_0x24862f[_0xfee7('0x12')]){if(this[_0xfee7('0x8')][_0x2b1c6a][_0xfee7('0x15')]==='vswitch'){if(_0x374fc0){return this['traverseBFS'](_0x374fc0,_0x26124a);}return logger[_0xfee7('0x10')](_0xfee7('0x19'));}else if(_[_0xfee7('0x1a')](verticesWithRetry,this[_0xfee7('0x8')][_0x2b1c6a][_0xfee7('0x15')])){if(_0x5e84d8==='-'){return logger[_0xfee7('0x10')]('max\x20retry\x20reach');}if(_0x374fc0&&_0x5e84d8!=='t'){return this[_0xfee7('0xe')](_0x374fc0,_0x26124a);}return this[_0xfee7('0xe')](_0x2b1c6a,_0x26124a);}return logger['info'](_0xfee7('0x1b'));}};module[_0xfee7('0x1c')]=Graph;
\ No newline at end of file
+var _0xb3eb=['vertices','edges','numberOfEdges','prototype','addVertex','addEdge','push','size','relations','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','default','target','invalid','traverseBFS','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits'];(function(_0x8b3e2d,_0x58935a){var _0x58ab87=function(_0x37b9c7){while(--_0x37b9c7){_0x8b3e2d['push'](_0x8b3e2d['shift']());}};_0x58ab87(++_0x58935a);}(_0xb3eb,0x96));var _0xbb3e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbb3e('0x0'));var logger=require(_0xbb3e('0x1'))(_0xbb3e('0x2'));var verticesWithRetry=[_0xbb3e('0x3'),_0xbb3e('0x4'),'getsecretdigits'];var Graph=function(){this[_0xbb3e('0x5')]={};this[_0xbb3e('0x6')]={};this[_0xbb3e('0x7')]=0x0;};Graph[_0xbb3e('0x8')][_0xbb3e('0x9')]=function(_0x7cd0fc){this[_0xbb3e('0x5')][_0x7cd0fc['id']]=_0x7cd0fc;this['edges'][_0x7cd0fc['id']]=[];};Graph[_0xbb3e('0x8')][_0xbb3e('0xa')]=function(_0x5b99fd,_0x55643e,_0x220534){this[_0xbb3e('0x6')][_0x5b99fd][_0xbb3e('0xb')]({'target':_0x55643e,'condition':_0x220534});this[_0xbb3e('0x7')]+=0x1;};Graph[_0xbb3e('0x8')][_0xbb3e('0xc')]=function(){return _[_0xbb3e('0xc')](this[_0xbb3e('0x5')]);};Graph['prototype'][_0xbb3e('0xd')]=function(){return this[_0xbb3e('0x7')];};Graph[_0xbb3e('0x8')][_0xbb3e('0xe')]=function(_0x5cd895){return this[_0xbb3e('0x5')][_0x5cd895];};Graph[_0xbb3e('0x8')]['traverseBFS']=function(_0x214744,_0x535f3f){if(!this[_0xbb3e('0x5')][_0x214744]){return logger[_0xbb3e('0xf')](_0xbb3e('0x10'));}var _0x5917b9=_0x535f3f(this['vertices'][_0x214744]);if(!_0x5917b9){return logger[_0xbb3e('0xf')](_0xbb3e('0x11'));}if(this['edges'][_0x214744][_0xbb3e('0x12')]===0x0){return logger[_0xbb3e('0xf')](_0xbb3e('0x13'));}for(var _0x42f9ff=0x0,_0x205103=[],_0x4b9281=![];_0x42f9ff<this[_0xbb3e('0x6')][_0x214744][_0xbb3e('0x12')];_0x42f9ff+=0x1){if(this['edges'][_0x214744][_0x42f9ff][_0xbb3e('0x14')]){_0x205103=this[_0xbb3e('0x6')][_0x214744][_0x42f9ff][_0xbb3e('0x14')][_0xbb3e('0x15')](',');for(var _0x208c8a=0x0;_0x208c8a<_0x205103['length'];_0x208c8a+=0x1){if(this[_0xbb3e('0x5')][_0x214744][_0xbb3e('0x16')]===_0xbb3e('0x17')&&_0x205103[_0x208c8a]==='-'){_0x4b9281=this[_0xbb3e('0x6')][_0x214744][_0x42f9ff]['target'];logger[_0xbb3e('0xf')](_0xbb3e('0x18'),_0x205103[_0x208c8a],this[_0xbb3e('0x6')][_0x214744][_0x42f9ff][_0xbb3e('0x19')]);}else if(this['vertices'][_0x214744][_0xbb3e('0x16')]===_0xbb3e('0x3')&&_0x205103[_0x208c8a]==='i'){_0x4b9281=this[_0xbb3e('0x6')][_0x214744][_0x42f9ff]['target'];logger[_0xbb3e('0xf')](_0xbb3e('0x1a'),_0x205103[_0x208c8a],this['edges'][_0x214744][_0x42f9ff][_0xbb3e('0x19')]);}if(_0x205103[_0x208c8a]===_0x5917b9){return this[_0xbb3e('0x1b')](this[_0xbb3e('0x6')][_0x214744][_0x42f9ff][_0xbb3e('0x19')],_0x535f3f);}}}else{return this[_0xbb3e('0x1b')](this[_0xbb3e('0x6')][_0x214744][_0x42f9ff]['target'],_0x535f3f);}}if(_0x205103['length']){if(this['vertices'][_0x214744][_0xbb3e('0x16')]===_0xbb3e('0x17')){if(_0x4b9281){return this[_0xbb3e('0x1b')](_0x4b9281,_0x535f3f);}return logger[_0xbb3e('0xf')]('default\x20on\x20switch\x20not\x20found');}else if(_['includes'](verticesWithRetry,this['vertices'][_0x214744][_0xbb3e('0x16')])){if(_0x5917b9==='-'){return logger[_0xbb3e('0xf')](_0xbb3e('0x1c'));}if(_0x4b9281&&_0x5917b9!=='t'){return this[_0xbb3e('0x1b')](_0x4b9281,_0x535f3f);}return this[_0xbb3e('0x1b')](_0x214744,_0x535f3f);}return logger[_0xbb3e('0xf')](_0xbb3e('0x1d'));}};module[_0xbb3e('0x1e')]=Graph;
\ No newline at end of file
index 329004e..7221150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50d4=['[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','agi_','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','name','handleNotFound','production','handleUnpublished','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','port','listening','connection','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./project','EventEmitter','127.0.0.1','projectUpdate','nextTick','error','stack','deleted','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','format','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','info'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x50d4,0x16d));var _0x450d=function(_0x16ba80,_0x344701){_0x16ba80=_0x16ba80-0x0;var _0x3fd0d1=_0x50d4[_0x16ba80];return _0x3fd0d1;};'use strict';var _=require('lodash');var syncho=require('syncho');var util=require('util');var config=require(_0x450d('0x0'));var logger=require(_0x450d('0x1'))(_0x450d('0x2'));var utilLicense=require(_0x450d('0x3'));var rpc=require(_0x450d('0x4'));var Project=require(_0x450d('0x5'));var AGIEmitter=require('./events')[_0x450d('0x6')];var projects=[];config[_0x450d('0x2')]=_['defaults'](config[_0x450d('0x2')],{'ip':_0x450d('0x7'),'port':0x11dd});AGIEmitter['on'](_0x450d('0x8'),projectUpdateHandler);function connectionHandler(_0x277836){process[_0x450d('0x9')](function(){syncho(function(){try{setChannelVariables(_0x277836);agiHandler(_0x277836);}catch(_0x481aa7){logger[_0x450d('0xa')](_0x481aa7[_0x450d('0xb')]);}});});}function projectUpdateHandler(_0x492339){try{var _0x436967=_['findIndex'](projects,['id',_0x492339['id']]);if(_0x436967>-0x1){if(_0x492339[_0x450d('0xc')]===!![]){projects[_0x450d('0xd')](_0x436967,0x1);}else{projects[_0x436967]=_0x492339;}}else{projects[_0x450d('0xe')](_0x492339);}}catch(_0x57ee01){logger[_0x450d('0xa')](_0x57ee01['stack']);}}function listeningHandler(){console['log'](_0x450d('0xf'),config[_0x450d('0x2')]['port']);logger['info'](util[_0x450d('0x10')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x450d('0x2')]['ip'],config[_0x450d('0x2')]['port']));}function errorHandler(_0x24939b){if(_0x24939b&&_0x24939b['name']&&_0x24939b['message']){logger['error'](util[_0x450d('0x10')](_0x450d('0x11'),_0x24939b['name'],_0x24939b[_0x450d('0x12')]));}else{logger[_0x450d('0xa')](util['format'](_0x450d('0x13'),_0x24939b['stack']));}}function closeHandler(){logger['info'](util[_0x450d('0x10')](_0x450d('0x14'),this[_0x450d('0x15')],this[_0x450d('0x16')],this[_0x450d('0x17')],this[_0x450d('0x18')],this[_0x450d('0x19')]));try{createSquareReport(this);}catch(_0x3ad068){logger[_0x450d('0xa')](_0x3ad068['stack']);}}function timeoutHandler(){logger[_0x450d('0x1a')](util[_0x450d('0x10')](_0x450d('0x1b'),this[_0x450d('0x15')],this[_0x450d('0x16')],this['callerid'],this[_0x450d('0x18')],this[_0x450d('0x19')]));}function hangupHandler(){logger[_0x450d('0x1a')](util[_0x450d('0x10')](_0x450d('0x1c'),this['arg_1'],this[_0x450d('0x16')],this[_0x450d('0x17')],this[_0x450d('0x18')],this[_0x450d('0x19')]));this[_0x450d('0x1d')]=!![];}function createSquareReport(_0x2bd8aa,_0x3298ba){rpc[_0x450d('0x1e')](_0x2bd8aa)[_0x450d('0x1f')](function(_0x428d97){if(_0x3298ba){_0x3298ba(null,_0x428d97);}})[_0x450d('0x20')](function(_0x3d440b){if(_0x3298ba){_0x3298ba(null,_0x3d440b);}});}function setChannelVariables(_0x5f44e2){for(var _0x2248e7 in _0x5f44e2){if(_0x5f44e2[_0x450d('0x21')](_0x2248e7)){if(_0x2248e7['indexOf'](_0x450d('0x22'))===0x0){_0x5f44e2[_0x2248e7['substring'](0x4)]=_0x5f44e2[_0x2248e7];delete _0x5f44e2[_0x2248e7];}}}}function agiHandler(_0x2473c6){logger['debug']('variables',JSON[_0x450d('0x23')](_0x2473c6,null,0x2));logger[_0x450d('0x1a')](util['format'](_0x450d('0x24'),_0x2473c6['arg_1'],_0x2473c6[_0x450d('0x16')],_0x2473c6['callerid'],_0x2473c6[_0x450d('0x18')],_0x2473c6[_0x450d('0x19')]));_0x2473c6['on'](_0x450d('0xa'),errorHandler);_0x2473c6['on'](_0x450d('0x25'),closeHandler);_0x2473c6['on'](_0x450d('0x26'),timeoutHandler);_0x2473c6[_0x450d('0x1d')]=![];_0x2473c6['on'](_0x450d('0x27'),hangupHandler);var _0x9c94f7=_['find'](projects,[_0x450d('0x28'),_0x2473c6[_0x450d('0x15')]]);if(!_0x9c94f7)return Project[_0x450d('0x29')](_0x2473c6);if(!_0x9c94f7[_0x450d('0x2a')])return Project[_0x450d('0x2b')](_0x2473c6);return Project['initialize'](_0x9c94f7,_0x2473c6);}function main(){var _0x1c2f77;return utilLicense[_0x450d('0x2c')]()[_0x450d('0x1f')](function(_0x523b99){if(!_0x523b99)return;if(_0x523b99[_0x450d('0x2d')]){if(_0x523b99[_0x450d('0x2e')]&&_0x523b99[_0x450d('0x2e')]>0x0){logger[_0x450d('0x1a')](util[_0x450d('0x10')](_0x450d('0x2f'),_0x523b99['callysquare']));_0x1c2f77=_0x523b99[_0x450d('0x2e')];}else{logger[_0x450d('0x1a')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x450d('0x1a')](_0x450d('0x30'));_0x1c2f77=-0x1;}})[_0x450d('0x1f')](function(){return Project[_0x450d('0x31')]();})['then'](function(_0x2a5f57){projects=_0x2a5f57;return;})['catch'](function(_0x12cf52){logger[_0x450d('0xa')](_0x450d('0x32'),_0x12cf52['stack']);})[_0x450d('0x33')](function(){var _0x36dfb1=require(_0x450d('0x34'))(config['agi'][_0x450d('0x35')],config['agi']['ip'],_0x1c2f77);_0x36dfb1['on'](_0x450d('0xa'),errorHandler);_0x36dfb1['on'](_0x450d('0x36'),listeningHandler);_0x36dfb1['on'](_0x450d('0x37'),connectionHandler);_0x36dfb1['on'](_0x450d('0x25'),closeHandler);});}main();
\ No newline at end of file
+var _0xb534=['find','name','handleNotFound','production','handleUnpublished','initialize','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','finally','./server','listening','connection','syncho','util','../../config/environment','../../config/logger','../../config/license/util','./rpc','./project','EventEmitter','defaults','agi','127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','push','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','createSquareReport','then','catch','indexOf','substring','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup'];(function(_0x4fa0e8,_0x26b636){var _0x19cadd=function(_0x4cda62){while(--_0x4cda62){_0x4fa0e8['push'](_0x4fa0e8['shift']());}};_0x19cadd(++_0x26b636);}(_0xb534,0x104));var _0x4b53=function(_0x36e057,_0x3f988d){_0x36e057=_0x36e057-0x0;var _0x2a8a12=_0xb534[_0x36e057];return _0x2a8a12;};'use strict';var _=require('lodash');var syncho=require(_0x4b53('0x0'));var util=require(_0x4b53('0x1'));var config=require(_0x4b53('0x2'));var logger=require(_0x4b53('0x3'))('agi');var utilLicense=require(_0x4b53('0x4'));var rpc=require(_0x4b53('0x5'));var Project=require(_0x4b53('0x6'));var AGIEmitter=require('./events')[_0x4b53('0x7')];var projects=[];config['agi']=_[_0x4b53('0x8')](config[_0x4b53('0x9')],{'ip':_0x4b53('0xa'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x5c639c){process[_0x4b53('0xb')](function(){syncho(function(){try{setChannelVariables(_0x5c639c);agiHandler(_0x5c639c);}catch(_0xe0e57){logger[_0x4b53('0xc')](_0xe0e57[_0x4b53('0xd')]);}});});}function projectUpdateHandler(_0xdd8fdb){try{var _0x88756e=_[_0x4b53('0xe')](projects,['id',_0xdd8fdb['id']]);if(_0x88756e>-0x1){if(_0xdd8fdb[_0x4b53('0xf')]===!![]){projects[_0x4b53('0x10')](_0x88756e,0x1);}else{projects[_0x88756e]=_0xdd8fdb;}}else{projects[_0x4b53('0x11')](_0xdd8fdb);}}catch(_0x4f399c){logger['error'](_0x4f399c[_0x4b53('0xd')]);}}function listeningHandler(){console['log'](_0x4b53('0x12'),config[_0x4b53('0x9')][_0x4b53('0x13')]);logger[_0x4b53('0x14')](util[_0x4b53('0x15')](_0x4b53('0x16'),config[_0x4b53('0x9')]['ip'],config[_0x4b53('0x9')][_0x4b53('0x13')]));}function errorHandler(_0x129aa7){if(_0x129aa7&&_0x129aa7['name']&&_0x129aa7[_0x4b53('0x17')]){logger[_0x4b53('0xc')](util[_0x4b53('0x15')](_0x4b53('0x18'),_0x129aa7['name'],_0x129aa7[_0x4b53('0x17')]));}else{logger['error'](util[_0x4b53('0x15')]('[ERROR]\x20%s',_0x129aa7['stack']));}}function closeHandler(){logger[_0x4b53('0x14')](util[_0x4b53('0x15')](_0x4b53('0x19'),this[_0x4b53('0x1a')],this[_0x4b53('0x1b')],this[_0x4b53('0x1c')],this['dnid'],this[_0x4b53('0x1d')]));try{createSquareReport(this);}catch(_0x3f5c19){logger[_0x4b53('0xc')](_0x3f5c19[_0x4b53('0xd')]);}}function timeoutHandler(){logger[_0x4b53('0x14')](util['format'](_0x4b53('0x1e'),this['arg_1'],this[_0x4b53('0x1b')],this['callerid'],this[_0x4b53('0x1f')],this[_0x4b53('0x1d')]));}function hangupHandler(){logger[_0x4b53('0x14')](util[_0x4b53('0x15')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x4b53('0x1a')],this[_0x4b53('0x1b')],this['callerid'],this[_0x4b53('0x1f')],this['uniqueid']));this['evtHangup']=!![];}function createSquareReport(_0x1109f5,_0x307f67){rpc[_0x4b53('0x20')](_0x1109f5)[_0x4b53('0x21')](function(_0x5f4423){if(_0x307f67){_0x307f67(null,_0x5f4423);}})[_0x4b53('0x22')](function(_0x1c1e23){if(_0x307f67){_0x307f67(null,_0x1c1e23);}});}function setChannelVariables(_0x216f5f){for(var _0x2b5050 in _0x216f5f){if(_0x216f5f['hasOwnProperty'](_0x2b5050)){if(_0x2b5050[_0x4b53('0x23')]('agi_')===0x0){_0x216f5f[_0x2b5050[_0x4b53('0x24')](0x4)]=_0x216f5f[_0x2b5050];delete _0x216f5f[_0x2b5050];}}}}function agiHandler(_0x18d45c){logger[_0x4b53('0x25')](_0x4b53('0x26'),JSON[_0x4b53('0x27')](_0x18d45c,null,0x2));logger[_0x4b53('0x14')](util[_0x4b53('0x15')](_0x4b53('0x28'),_0x18d45c[_0x4b53('0x1a')],_0x18d45c[_0x4b53('0x1b')],_0x18d45c[_0x4b53('0x1c')],_0x18d45c['dnid'],_0x18d45c[_0x4b53('0x1d')]));_0x18d45c['on'](_0x4b53('0xc'),errorHandler);_0x18d45c['on'](_0x4b53('0x29'),closeHandler);_0x18d45c['on'](_0x4b53('0x2a'),timeoutHandler);_0x18d45c[_0x4b53('0x2b')]=![];_0x18d45c['on'](_0x4b53('0x2c'),hangupHandler);var _0x3a09f1=_[_0x4b53('0x2d')](projects,[_0x4b53('0x2e'),_0x18d45c['arg_1']]);if(!_0x3a09f1)return Project[_0x4b53('0x2f')](_0x18d45c);if(!_0x3a09f1[_0x4b53('0x30')])return Project[_0x4b53('0x31')](_0x18d45c);return Project[_0x4b53('0x32')](_0x3a09f1,_0x18d45c);}function main(){var _0x3e362d;return utilLicense[_0x4b53('0x33')]()['then'](function(_0x56c02b){if(!_0x56c02b)return;if(_0x56c02b['voice']){if(_0x56c02b[_0x4b53('0x34')]&&_0x56c02b[_0x4b53('0x34')]>0x0){logger[_0x4b53('0x14')](util[_0x4b53('0x15')](_0x4b53('0x35'),_0x56c02b[_0x4b53('0x34')]));_0x3e362d=_0x56c02b[_0x4b53('0x34')];}else{logger[_0x4b53('0x14')](_0x4b53('0x36'));}}else{logger['info'](_0x4b53('0x37'));_0x3e362d=-0x1;}})[_0x4b53('0x21')](function(){return Project['getAll']();})[_0x4b53('0x21')](function(_0x348dc0){projects=_0x348dc0;return;})[_0x4b53('0x22')](function(_0x407796){logger['error'](_0x4b53('0x38'),_0x407796[_0x4b53('0xd')]);})[_0x4b53('0x39')](function(){var _0x26b26d=require(_0x4b53('0x3a'))(config[_0x4b53('0x9')]['port'],config[_0x4b53('0x9')]['ip'],_0x3e362d);_0x26b26d['on'](_0x4b53('0xc'),errorHandler);_0x26b26d['on'](_0x4b53('0x3b'),listeningHandler);_0x26b26d['on'](_0x4b53('0x3c'),connectionHandler);_0x26b26d['on'](_0x4b53('0x29'),closeHandler);});}main();
\ No newline at end of file
index 9f00d58..06ca751 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd21c=['catch','sendMailMessage','bluebird','jayson/promise','client','request','error','message'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xd21c,0xea));var _0xcd21=function(_0x2188ec,_0x56d5e6){_0x2188ec=_0x2188ec-0x0;var _0x2f6258=_0xd21c[_0x2188ec];return _0x2f6258;};'use strict';var BPromise=require(_0xcd21('0x0'));var jayson=require(_0xcd21('0x1'));var client=jayson[_0xcd21('0x2')]['http']({'port':0x232b});function request(_0x3d49b9,_0x265f3a){return new BPromise(function(_0x214d99,_0x341bcc){return client[_0xcd21('0x3')](_0x3d49b9,_0x265f3a)['then'](function(_0x45a1eb){if(_0x45a1eb[_0xcd21('0x4')]){return _0x341bcc(_0x45a1eb[_0xcd21('0x4')][_0xcd21('0x5')]);}else{return _0x214d99(_0x45a1eb['result']);}})[_0xcd21('0x6')](function(_0x533128){return _0x341bcc(_0x533128);});});}exports[_0xcd21('0x7')]=function(_0x447d63,_0x4487de){return request('SendMail',{'account':_0x447d63,'message':_0x4487de});};
\ No newline at end of file
+var _0x0bd1=['http','request','error','message','result','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x108d5f,_0x33f82d){var _0x456ea3=function(_0x228200){while(--_0x228200){_0x108d5f['push'](_0x108d5f['shift']());}};_0x456ea3(++_0x33f82d);}(_0x0bd1,0x133));var _0x10bd=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x0bd1[_0x5da0d9];return _0x4b6d2f;};'use strict';var BPromise=require(_0x10bd('0x0'));var jayson=require(_0x10bd('0x1'));var client=jayson[_0x10bd('0x2')][_0x10bd('0x3')]({'port':0x232b});function request(_0x10373c,_0x191978){return new BPromise(function(_0x1fd82a,_0x9c1ed5){return client[_0x10bd('0x4')](_0x10373c,_0x191978)['then'](function(_0x595c36){if(_0x595c36[_0x10bd('0x5')]){return _0x9c1ed5(_0x595c36[_0x10bd('0x5')][_0x10bd('0x6')]);}else{return _0x1fd82a(_0x595c36[_0x10bd('0x7')]);}})['catch'](function(_0x14867c){return _0x9c1ed5(_0x14867c);});});}exports[_0x10bd('0x8')]=function(_0x2124f4,_0x304a6e){return request(_0x10bd('0x9'),{'account':_0x2124f4,'message':_0x304a6e});};
\ No newline at end of file
index d0220de..068940a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa081=['omit','mxCell','length','source','target','addEdge','toJson','mxGraphModel','root','inspect','joinAt','info','arg_1','calleridname','callerid','dnid','uniqueid','traverseBFS','clear','debug','vertex','stringify','gotoc','context','extension','priority','response','result','evtHangup','toString','agicommand\x20not\x20found','finally','format','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','[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','close','continueAt','Project\x20%s\x20not\x20published','exports','moment','xml2json','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex'];(function(_0x4628c2,_0x397734){var _0x2baccf=function(_0xbf59e2){while(--_0xbf59e2){_0x4628c2['push'](_0x4628c2['shift']());}};_0x2baccf(++_0x397734);}(_0xa081,0x9f));var _0x1a08=function(_0x228996,_0x451ccc){_0x228996=_0x228996-0x0;var _0x4c5ded=_0xa081[_0x228996];return _0x4c5ded;};'use strict';var _=require('lodash');var moment=require(_0x1a08('0x0'));var parser=require(_0x1a08('0x1'));var util=require('util');var logger=require(_0x1a08('0x2'))(_0x1a08('0x3'));var rpc=require(_0x1a08('0x4'));var mailRpc=require(_0x1a08('0x5'));var Graph=require(_0x1a08('0x6'));var Vertices=require(_0x1a08('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x1a08('0x8')]()[_0x1a08('0x9')](function(_0x15d650){logger[_0x1a08('0xa')](_0x1a08('0xb'),_0x15d650[_0x1a08('0xc')]);return[];});}function addVertex(_0x184afb,_0x385e6d,_0x3be3ad){_0x385e6d[_0x1a08('0xd')]=_0x3be3ad;if(_0x385e6d[_0x1a08('0xe')](_0x1a08('0xf'))){_0x385e6d[_0x1a08('0x10')]=parseInt(_0x385e6d[_0x1a08('0xf')],0xa);}_0x184afb[_0x1a08('0x11')](_[_0x1a08('0x12')](_0x385e6d,_0x1a08('0x13')));}function initGraph(_0x5dc7bd,_0x4a0f04){var _0x5c4b6e=new Graph();for(var _0x2df2a8 in _0x5dc7bd){if(_0x5dc7bd[_0x1a08('0xe')](_0x2df2a8)){if(_['isArray'](_0x5dc7bd[_0x2df2a8])){for(var _0x2c893c=0x0;_0x2c893c<_0x5dc7bd[_0x2df2a8][_0x1a08('0x14')];_0x2c893c+=0x1){addVertex(_0x5c4b6e,_0x5dc7bd[_0x2df2a8][_0x2c893c],_0x2df2a8);}}else{addVertex(_0x5c4b6e,_0x5dc7bd[_0x2df2a8],_0x2df2a8);}}}for(var _0x59c855=0x0;_0x59c855<_0x4a0f04['length'];_0x59c855+=0x1){if(_0x4a0f04[_0x59c855][_0x1a08('0x15')]&&_0x4a0f04[_0x59c855][_0x1a08('0x16')]){_0x5c4b6e[_0x1a08('0x17')](_0x4a0f04[_0x59c855][_0x1a08('0x15')],_0x4a0f04[_0x59c855]['target'],_0x4a0f04[_0x59c855]['value']);}}return _0x5c4b6e;}function getRoot(_0x520874){return parser[_0x1a08('0x18')](_0x520874,{'object':!![]})[_0x1a08('0x19')][_0x1a08('0x1a')];}function inspect(_0x4dd750){return util[_0x1a08('0x1b')](_0x4dd750,{'showHidden':![],'depth':null});}function initialize(_0x402163,_0x218b91){var _0x30f81e=getRoot(_0x402163['production']);if(!_0x30f81e||!_0x30f81e['start'])return;var _0x4a36cf,_0xdd10a,_0x53823d;logger['debug'](_0x1a08('0x1a'),JSON['stringify'](_0x30f81e,null,0x2));_0x218b91[_0x1a08('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4a36cf=initGraph(_[_0x1a08('0x12')](_0x30f81e,_0x1a08('0x13')),_0x30f81e[_0x1a08('0x13')]);_0xdd10a=new Vertices(_0x218b91,rpc,mailRpc);logger[_0x1a08('0x1d')](util['format']('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x218b91[_0x1a08('0x1e')],_0x218b91[_0x1a08('0x1f')],_0x218b91[_0x1a08('0x20')],_0x218b91[_0x1a08('0x21')],_0x218b91[_0x1a08('0x22')]));_0x4a36cf[_0x1a08('0x23')](_0x30f81e['start']['id'],function(_0xc3702e){try{_0xc3702e=_0xdd10a[_0x1a08('0x24')](_0xc3702e);logger[_0x1a08('0x25')](_0x1a08('0x26'),JSON[_0x1a08('0x27')](_0xc3702e,null,0x2));if(_0xc3702e[_0x1a08('0xd')]===_0x1a08('0x28')){logger[_0x1a08('0x1d')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x218b91['context']=_0xc3702e[_0x1a08('0x29')]||_0x218b91[_0x1a08('0x29')];_0x218b91[_0x1a08('0x2a')]=_0xc3702e[_0x1a08('0x2a')];_0x218b91[_0x1a08('0x2b')]=_0xc3702e[_0x1a08('0x2b')]?_0xc3702e[_0x1a08('0x2b')]-0x1:0x1;return null;}else if(_0xc3702e&&_0xdd10a[_0xc3702e['agicommand']]){_0x53823d=_0xdd10a[_0xc3702e[_0x1a08('0xd')]](_0xc3702e);logger['info'](_0x1a08('0x2c'),JSON[_0x1a08('0x27')](_0x53823d,null,0x2));if(_0x53823d&&_0x53823d['code']===AGI_CODE_SUCCESS&&_0x53823d[_0x1a08('0x2d')]!==AGI_RESULT_ERROR&&!_0x218b91[_0x1a08('0x2e')]){logger['debug'](_0x1a08('0x2c'),inspect(_0x53823d));return _['isUndefined'](_0x53823d[_0x1a08('0x2d')])?null:_0x53823d[_0x1a08('0x2d')][_0x1a08('0x2f')]();}else{logger['error'](_0x1a08('0x2c'),inspect(_0x53823d));return null;}}else{logger[_0x1a08('0xa')](_0x1a08('0x30'));return null;}}catch(_0x3fea97){logger[_0x1a08('0xa')](_0x3fea97[_0x1a08('0xc')]);return null;}});if(_0x30f81e[_0x1a08('0x31')]){logger[_0x1a08('0x1d')](util[_0x1a08('0x32')](_0x1a08('0x33'),_0x218b91['arg_1'],_0x218b91[_0x1a08('0x1f')],_0x218b91[_0x1a08('0x20')],_0x218b91[_0x1a08('0x21')],_0x218b91[_0x1a08('0x22')]));_0x4a36cf[_0x1a08('0x23')](_0x30f81e[_0x1a08('0x31')]['id'],function(_0x1813ff){try{_0x1813ff=_0xdd10a['clear'](_0x1813ff);logger['debug']('vertex',JSON[_0x1a08('0x27')](_0x1813ff,null,0x2));if(_0x1813ff&&_0xdd10a[_0x1813ff[_0x1a08('0xd')]]){_0x53823d=_0xdd10a[_0x1813ff[_0x1a08('0xd')]](_0x1813ff);if(_0x53823d){logger[_0x1a08('0x25')](_0x1a08('0x2c'),inspect(_0x53823d));return _[_0x1a08('0x34')](_0x53823d['result'])?null:_0x53823d['result'][_0x1a08('0x2f')]();}else{logger['error']('response',inspect(_0x53823d));return null;}}else{logger[_0x1a08('0xa')](_0x1a08('0x30'));return null;}}catch(_0x523303){logger['error'](_0x523303['stack']);return null;}});}logger[_0x1a08('0x1d')](util[_0x1a08('0x32')](_0x1a08('0x35'),_0x218b91[_0x1a08('0x1e')],_0x218b91[_0x1a08('0x1f')],_0x218b91[_0x1a08('0x20')],_0x218b91['dnid'],_0x218b91['uniqueid']));logger[_0x1a08('0x1d')](util[_0x1a08('0x32')](_0x1a08('0x36'),_0x218b91['context'],_0x218b91[_0x1a08('0x2a')],parseInt(_0x218b91[_0x1a08('0x2b')],0xa)+0x1));_0x218b91['continueAt'](_0x218b91[_0x1a08('0x29')],_0x218b91[_0x1a08('0x2a')],parseInt(_0x218b91['priority'],0xa)+0x1);_0x218b91[_0x1a08('0x37')]();}function handleNotFound(_0x2724be){logger[_0x1a08('0xa')](util[_0x1a08('0x32')]('Project\x20%s\x20not\x20found',_0x2724be[_0x1a08('0x1e')]));_0x2724be[_0x1a08('0x38')](_0x2724be['context'],_0x2724be[_0x1a08('0x2a')],parseInt(_0x2724be[_0x1a08('0x2b')],0xa)+0x1);_0x2724be[_0x1a08('0x37')]();}function handleUnpublished(_0x6f643d){logger[_0x1a08('0xa')](util[_0x1a08('0x32')](_0x1a08('0x39'),_0x6f643d['arg_1']));_0x6f643d[_0x1a08('0x38')](_0x6f643d[_0x1a08('0x29')],_0x6f643d[_0x1a08('0x2a')],parseInt(_0x6f643d[_0x1a08('0x2b')],0xa)+0x1);_0x6f643d[_0x1a08('0x37')]();}module[_0x1a08('0x3a')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
+var _0xc60b=['xml2json','util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','addEdge','value','toJson','mxGraphModel','root','production','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','traverseBFS','start','debug','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','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','callerid','uniqueid','clear','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','close','exports','lodash'];(function(_0x591636,_0x2d58a2){var _0x369044=function(_0x5aa59c){while(--_0x5aa59c){_0x591636['push'](_0x591636['shift']());}};_0x369044(++_0x2d58a2);}(_0xc60b,0x7d));var _0xbc60=function(_0x14d81c,_0x5e080f){_0x14d81c=_0x14d81c-0x0;var _0x757ad4=_0xc60b[_0x14d81c];return _0x757ad4;};'use strict';var _=require(_0xbc60('0x0'));var moment=require('moment');var parser=require(_0xbc60('0x1'));var util=require(_0xbc60('0x2'));var logger=require(_0xbc60('0x3'))('agi');var rpc=require(_0xbc60('0x4'));var mailRpc=require(_0xbc60('0x5'));var Graph=require(_0xbc60('0x6'));var Vertices=require(_0xbc60('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xbc60('0x8')]()[_0xbc60('0x9')](function(_0x4ff984){logger[_0xbc60('0xa')](_0xbc60('0xb'),_0x4ff984[_0xbc60('0xc')]);return[];});}function addVertex(_0x3ca24c,_0x309235,_0x2b2735){_0x309235[_0xbc60('0xd')]=_0x2b2735;if(_0x309235[_0xbc60('0xe')](_0xbc60('0xf'))){_0x309235[_0xbc60('0x10')]=parseInt(_0x309235[_0xbc60('0xf')],0xa);}_0x3ca24c[_0xbc60('0x11')](_[_0xbc60('0x12')](_0x309235,'mxCell'));}function initGraph(_0x32f1cb,_0x3f6ad6){var _0x50e12a=new Graph();for(var _0x22f97a in _0x32f1cb){if(_0x32f1cb[_0xbc60('0xe')](_0x22f97a)){if(_['isArray'](_0x32f1cb[_0x22f97a])){for(var _0x3fc710=0x0;_0x3fc710<_0x32f1cb[_0x22f97a]['length'];_0x3fc710+=0x1){addVertex(_0x50e12a,_0x32f1cb[_0x22f97a][_0x3fc710],_0x22f97a);}}else{addVertex(_0x50e12a,_0x32f1cb[_0x22f97a],_0x22f97a);}}}for(var _0x5a397f=0x0;_0x5a397f<_0x3f6ad6[_0xbc60('0x13')];_0x5a397f+=0x1){if(_0x3f6ad6[_0x5a397f][_0xbc60('0x14')]&&_0x3f6ad6[_0x5a397f][_0xbc60('0x15')]){_0x50e12a[_0xbc60('0x16')](_0x3f6ad6[_0x5a397f]['source'],_0x3f6ad6[_0x5a397f]['target'],_0x3f6ad6[_0x5a397f][_0xbc60('0x17')]);}}return _0x50e12a;}function getRoot(_0x3ffa0a){return parser[_0xbc60('0x18')](_0x3ffa0a,{'object':!![]})[_0xbc60('0x19')][_0xbc60('0x1a')];}function inspect(_0x2cc296){return util['inspect'](_0x2cc296,{'showHidden':![],'depth':null});}function initialize(_0x36c754,_0x5452ce){var _0xd08fc3=getRoot(_0x36c754[_0xbc60('0x1b')]);if(!_0xd08fc3||!_0xd08fc3['start'])return;var _0x36eb27,_0x56b6e3,_0x121908;logger['debug'](_0xbc60('0x1a'),JSON[_0xbc60('0x1c')](_0xd08fc3,null,0x2));_0x5452ce[_0xbc60('0x1d')]=moment()[_0xbc60('0x1e')](_0xbc60('0x1f'));_0x36eb27=initGraph(_['omit'](_0xd08fc3,_0xbc60('0x20')),_0xd08fc3['mxCell']);_0x56b6e3=new Vertices(_0x5452ce,rpc,mailRpc);logger[_0xbc60('0x21')](util[_0xbc60('0x1e')](_0xbc60('0x22'),_0x5452ce[_0xbc60('0x23')],_0x5452ce[_0xbc60('0x24')],_0x5452ce['callerid'],_0x5452ce[_0xbc60('0x25')],_0x5452ce['uniqueid']));_0x36eb27[_0xbc60('0x26')](_0xd08fc3[_0xbc60('0x27')]['id'],function(_0x4048de){try{_0x4048de=_0x56b6e3['clear'](_0x4048de);logger[_0xbc60('0x28')](_0xbc60('0x29'),JSON[_0xbc60('0x1c')](_0x4048de,null,0x2));if(_0x4048de[_0xbc60('0xd')]===_0xbc60('0x2a')){logger[_0xbc60('0x21')](_0xbc60('0x2b'));_0x5452ce['context']=_0x4048de[_0xbc60('0x2c')]||_0x5452ce[_0xbc60('0x2c')];_0x5452ce[_0xbc60('0x2d')]=_0x4048de[_0xbc60('0x2d')];_0x5452ce[_0xbc60('0x2e')]=_0x4048de[_0xbc60('0x2e')]?_0x4048de[_0xbc60('0x2e')]-0x1:0x1;return null;}else if(_0x4048de&&_0x56b6e3[_0x4048de[_0xbc60('0xd')]]){_0x121908=_0x56b6e3[_0x4048de[_0xbc60('0xd')]](_0x4048de);logger['info'](_0xbc60('0x2f'),JSON[_0xbc60('0x1c')](_0x121908,null,0x2));if(_0x121908&&_0x121908['code']===AGI_CODE_SUCCESS&&_0x121908[_0xbc60('0x30')]!==AGI_RESULT_ERROR&&!_0x5452ce['evtHangup']){logger[_0xbc60('0x28')](_0xbc60('0x2f'),inspect(_0x121908));return _['isUndefined'](_0x121908[_0xbc60('0x30')])?null:_0x121908[_0xbc60('0x30')][_0xbc60('0x31')]();}else{logger['error'](_0xbc60('0x2f'),inspect(_0x121908));return null;}}else{logger[_0xbc60('0xa')](_0xbc60('0x32'));return null;}}catch(_0x4ef7fb){logger['error'](_0x4ef7fb[_0xbc60('0xc')]);return null;}});if(_0xd08fc3[_0xbc60('0x33')]){logger[_0xbc60('0x21')](util[_0xbc60('0x1e')](_0xbc60('0x34'),_0x5452ce[_0xbc60('0x23')],_0x5452ce[_0xbc60('0x24')],_0x5452ce[_0xbc60('0x35')],_0x5452ce[_0xbc60('0x25')],_0x5452ce[_0xbc60('0x36')]));_0x36eb27['traverseBFS'](_0xd08fc3['finally']['id'],function(_0xa58b95){try{_0xa58b95=_0x56b6e3[_0xbc60('0x37')](_0xa58b95);logger[_0xbc60('0x28')]('vertex',JSON[_0xbc60('0x1c')](_0xa58b95,null,0x2));if(_0xa58b95&&_0x56b6e3[_0xa58b95['agicommand']]){_0x121908=_0x56b6e3[_0xa58b95[_0xbc60('0xd')]](_0xa58b95);if(_0x121908){logger[_0xbc60('0x28')](_0xbc60('0x2f'),inspect(_0x121908));return _[_0xbc60('0x38')](_0x121908[_0xbc60('0x30')])?null:_0x121908['result'][_0xbc60('0x31')]();}else{logger['error']('response',inspect(_0x121908));return null;}}else{logger['error'](_0xbc60('0x32'));return null;}}catch(_0x3527fa){logger['error'](_0x3527fa['stack']);return null;}});}logger['info'](util[_0xbc60('0x1e')](_0xbc60('0x39'),_0x5452ce[_0xbc60('0x23')],_0x5452ce[_0xbc60('0x24')],_0x5452ce[_0xbc60('0x35')],_0x5452ce[_0xbc60('0x25')],_0x5452ce[_0xbc60('0x36')]));logger[_0xbc60('0x21')](util[_0xbc60('0x1e')](_0xbc60('0x3a'),_0x5452ce[_0xbc60('0x2c')],_0x5452ce[_0xbc60('0x2d')],parseInt(_0x5452ce['priority'],0xa)+0x1));_0x5452ce[_0xbc60('0x3b')](_0x5452ce[_0xbc60('0x2c')],_0x5452ce[_0xbc60('0x2d')],parseInt(_0x5452ce['priority'],0xa)+0x1);_0x5452ce['close']();}function handleNotFound(_0x15550f){logger['error'](util[_0xbc60('0x1e')](_0xbc60('0x3c'),_0x15550f[_0xbc60('0x23')]));_0x15550f['continueAt'](_0x15550f['context'],_0x15550f['extension'],parseInt(_0x15550f[_0xbc60('0x2e')],0xa)+0x1);_0x15550f[_0xbc60('0x3d')]();}function handleUnpublished(_0x19fab9){logger[_0xbc60('0xa')](util[_0xbc60('0x1e')]('Project\x20%s\x20not\x20published',_0x19fab9[_0xbc60('0x23')]));_0x19fab9[_0xbc60('0x3b')](_0x19fab9[_0xbc60('0x2c')],_0x19fab9[_0xbc60('0x2d')],parseInt(_0x19fab9[_0xbc60('0x2e')],0xa)+0x1);_0x19fab9[_0xbc60('0x3d')]();}module[_0xbc60('0x3e')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize};
\ No newline at end of file
index 78b7938..79741e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x364e=['_localBuffer','indexOf','substring','length','split','slice','trim','emit','exports','util','stream','Transform','call','_inBody','inherits','_transform','\x0d\x0a\x0d\x0a','toString'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x364e,0x99));var _0xe364=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0x364e[_0x4ae625];return _0x31accf;};'use strict';var util=require(_0xe364('0x0'));var Transform=require(_0xe364('0x1'))[_0xe364('0x2')];function AGIReply(_0x31327e){Transform[_0xe364('0x3')](this,_0x31327e);this['_localBuffer']='';this[_0xe364('0x4')]=![];}util[_0xe364('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xe364('0x6')]=function(_0xdb11b8,_0x2611ef,_0x2c08fb){var _0x1f39e8='\x0a',_0x4772df=['\x0a\x0a',_0xe364('0x7')],_0x5b2219=-0x1,_0x564981=-0x1,_0x3a54d4='',_0x17975f=0x0,_0x397a0a='',_0x25df60='';this['_localBuffer']+=_0xdb11b8[_0xe364('0x8')]();_0x397a0a=this[_0xe364('0x9')];if(!this[_0xe364('0x4')]){_0x17975f=0x0;while(_0x4772df[_0x17975f]){while((_0x564981=_0x397a0a[_0xe364('0xa')](_0x4772df[_0x17975f]))!=-0x1){_0x3a54d4=_0x4772df[_0x17975f];_0x25df60=_0x397a0a['substring'](0x0,_0x564981);_0x397a0a=_0x397a0a[_0xe364('0xb')](_0x564981+_0x3a54d4[_0xe364('0xc')]);var _0xdf321=_0x25df60[_0xe364('0xd')](_0x1f39e8),_0x2e8dee=0x0,_0x24d95f={},_0x24321e='',_0x34f18e='',_0x7d5154=-0x1;while(_0xdf321[_0x2e8dee]){_0x7d5154=_0xdf321[_0x2e8dee][_0xe364('0xa')](':');if(_0x7d5154!=-0x1){_0x24321e=_0xdf321[_0x2e8dee][_0xe364('0xe')](0x0,_0x7d5154)['trim']();_0x34f18e=_0xdf321[_0x2e8dee][_0xe364('0xe')](_0x7d5154+0x1)[_0xe364('0xf')]();if(_0x24321e[_0xe364('0xc')]>0x0){_0x24d95f[_0x24321e]=_0x34f18e;}}else{}_0x2e8dee++;}this[_0xe364('0x10')]('headers',_0x24d95f);this[_0xe364('0x4')]=!![];}_0x17975f++;}this[_0xe364('0x9')]=_0x397a0a;}else{while((_0x5b2219=_0x397a0a['indexOf'](_0x1f39e8))!=-0x1){_0x25df60=_0x397a0a[_0xe364('0xb')](0x0,_0x5b2219);this[_0xe364('0x10')]('line',_0x25df60);_0x397a0a=_0x397a0a[_0xe364('0xb')](_0x5b2219+_0x1f39e8[_0xe364('0xc')]);}this[_0xe364('0x9')]=_0x397a0a;}_0x2c08fb();};module[_0xe364('0x11')]=AGIReply;
\ No newline at end of file
+var _0x0e89=['indexOf','substring','length','split','slice','trim','emit','headers','exports','util','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a'];(function(_0xb7c9d1,_0x376ba4){var _0x29de38=function(_0x3ab8fe){while(--_0x3ab8fe){_0xb7c9d1['push'](_0xb7c9d1['shift']());}};_0x29de38(++_0x376ba4);}(_0x0e89,0x69));var _0x90e8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0e89[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x90e8('0x0'));var Transform=require('stream')[_0x90e8('0x1')];function AGIReply(_0x47b535){Transform[_0x90e8('0x2')](this,_0x47b535);this[_0x90e8('0x3')]='';this[_0x90e8('0x4')]=![];}util[_0x90e8('0x5')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x3f7d16,_0x46c911,_0x5e609d){var _0x55cb57='\x0a',_0x2c0813=['\x0a\x0a',_0x90e8('0x6')],_0xe75bc3=-0x1,_0x47a2e7=-0x1,_0x165d7e='',_0x3357ef=0x0,_0x5afea9='',_0x249e5d='';this[_0x90e8('0x3')]+=_0x3f7d16['toString']();_0x5afea9=this[_0x90e8('0x3')];if(!this[_0x90e8('0x4')]){_0x3357ef=0x0;while(_0x2c0813[_0x3357ef]){while((_0x47a2e7=_0x5afea9[_0x90e8('0x7')](_0x2c0813[_0x3357ef]))!=-0x1){_0x165d7e=_0x2c0813[_0x3357ef];_0x249e5d=_0x5afea9[_0x90e8('0x8')](0x0,_0x47a2e7);_0x5afea9=_0x5afea9[_0x90e8('0x8')](_0x47a2e7+_0x165d7e[_0x90e8('0x9')]);var _0x524b34=_0x249e5d[_0x90e8('0xa')](_0x55cb57),_0x180e1e=0x0,_0x3c8271={},_0x275497='',_0x407c17='',_0x255d39=-0x1;while(_0x524b34[_0x180e1e]){_0x255d39=_0x524b34[_0x180e1e][_0x90e8('0x7')](':');if(_0x255d39!=-0x1){_0x275497=_0x524b34[_0x180e1e][_0x90e8('0xb')](0x0,_0x255d39)[_0x90e8('0xc')]();_0x407c17=_0x524b34[_0x180e1e]['slice'](_0x255d39+0x1)[_0x90e8('0xc')]();if(_0x275497[_0x90e8('0x9')]>0x0){_0x3c8271[_0x275497]=_0x407c17;}}else{}_0x180e1e++;}this[_0x90e8('0xd')](_0x90e8('0xe'),_0x3c8271);this['_inBody']=!![];}_0x3357ef++;}this[_0x90e8('0x3')]=_0x5afea9;}else{while((_0xe75bc3=_0x5afea9[_0x90e8('0x7')](_0x55cb57))!=-0x1){_0x249e5d=_0x5afea9[_0x90e8('0x8')](0x0,_0xe75bc3);this['emit']('line',_0x249e5d);_0x5afea9=_0x5afea9['substring'](_0xe75bc3+_0x55cb57['length']);}this['_localBuffer']=_0x5afea9;}_0x5e609d();};module[_0x90e8('0xf')]=AGIReply;
\ No newline at end of file
index 9b048de..50fc50a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eb8=['then','error','message','result','catch','GetSquareProjects','getSquareProject','ShowMailAccount','Smtp','CloudProvider','name','getSquareProjectById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','getContactByPhone','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','moment','jayson/promise','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eb8,0x1d1));var _0x85eb=function(_0x8ce506,_0x517f30){_0x8ce506=_0x8ce506-0x0;var _0x23c8e5=_0x5eb8[_0x8ce506];return _0x23c8e5;};'use strict';var _=require('lodash');var moment=require(_0x85eb('0x0'));var jayson=require(_0x85eb('0x1'));var client=jayson['client']['http']({'port':0x2329});function request(_0x963724,_0x2e57e9){return new Promise(function(_0x4aa372,_0x41b11e){return client[_0x85eb('0x2')](_0x963724,_0x2e57e9)[_0x85eb('0x3')](function(_0x16e8d4){if(_0x16e8d4['error']){return _0x41b11e(_0x16e8d4[_0x85eb('0x4')][_0x85eb('0x5')]);}else{return _0x4aa372(_0x16e8d4[_0x85eb('0x6')]);}})[_0x85eb('0x7')](function(_0x2a5cef){return _0x41b11e(_0x2a5cef);});});}exports['getSquareProjects']=function(){return request(_0x85eb('0x8'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0x85eb('0x9')]=function(_0x228157){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x228157},'attributes':['production']}});};exports['getMailAccountById']=function(_0x559cc7){return request(_0x85eb('0xa'),{'options':{'raw':![],'where':{'id':_0x559cc7},'include':[{'model':'MailServerOut','as':_0x85eb('0xb'),'include':[{'model':_0x85eb('0xc'),'as':_0x85eb('0xc')}]}],'attributes':['id',_0x85eb('0xd'),'email'],'smtp':!![]}});};exports[_0x85eb('0xe')]=function(_0x453029){return request('ShowSquareProject',{'options':{'where':{'id':_0x453029},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x52b86b){return request(_0x85eb('0xf'),{'options':{'where':{'id':_0x52b86b},'attributes':['name']}});};exports['getVariableById']=function(_0x4cec4e){return request(_0x85eb('0x10'),{'options':{'where':{'id':_0x4cec4e},'attributes':[_0x85eb('0xd')]}});};exports[_0x85eb('0x11')]=function(_0x5010ef){return request(_0x85eb('0x12'),{'options':{'where':{'id':_0x5010ef},'attributes':['dsn']}});};exports[_0x85eb('0x13')]=function(_0x50aa0d){return request('ShowUser',{'options':{'where':{'id':_0x50aa0d},'attributes':[_0x85eb('0xd')]}});};exports[_0x85eb('0x14')]=function(_0x263682){return request('GetContactByPhone',{'options':{'where':{'phone':_0x263682['phone']},'attributes':['id']}});};exports[_0x85eb('0x15')]=function(_0x26b8f8){return request(_0x85eb('0x16'),{'options':{'where':{'id':_0x26b8f8},'attributes':['name']}});};exports[_0x85eb('0x17')]=function(_0x710d0e){return request(_0x85eb('0x18'),{'options':{'where':{'id':_0x710d0e},'attributes':[_0x85eb('0x19')]}});};exports['getIntervalById']=function(_0x49fc03){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x49fc03},'include':[{'model':_0x85eb('0x1a'),'as':_0x85eb('0x1b')}]}});};exports[_0x85eb('0x1c')]=function(_0x4ecaa1){return request('ShowSmsAccount',{'options':{'where':{'id':_0x4ecaa1},'attributes':['id',_0x85eb('0xd')]}});};exports[_0x85eb('0x1d')]=function(_0x4f9366){return request(_0x85eb('0x1e'),{'body':_0x4f9366});};exports[_0x85eb('0x1f')]=function(_0x3522d6){return request('CreateSquareDetailsReport',{'body':_0x3522d6});};exports[_0x85eb('0x20')]=function(_0x58278){return request(_0x85eb('0x21'),{'body':_[_0x85eb('0x22')](_0x58278,{'project_name':_0x58278[_0x85eb('0x23')],'prev_project_name':_0x58278[_0x85eb('0x24')]||'','is_subproject':_0x58278[_0x85eb('0x24')]?!![]:![],'leaveAt':moment()['format'](_0x85eb('0x25'))})});};exports['createSquareRecording']=function(_0xf8b47c){return request(_0x85eb('0x26'),{'body':_0xf8b47c});};exports[_0x85eb('0x27')]=function(_0x55f01e){return request(_0x85eb('0x28'),{'body':_0x55f01e});};exports[_0x85eb('0x29')]=function(_0x4433e8){return request(_0x85eb('0x2a'),{'options':{'raw':![],'where':{'phone':_0x4433e8[_0x85eb('0x2b')],'ListId':_0x4433e8[_0x85eb('0x2c')]}}})[_0x85eb('0x3')](function(_0x3f9f2c){if(_0x3f9f2c){return _0x3f9f2c;}return request('CreateCmContact',{'body':_0x4433e8});});};exports[_0x85eb('0x2d')]=function(_0x3c3bfc){return request(_0x85eb('0x2e'),{'options':{'where':{'id':_0x3c3bfc},'attributes':[_0x85eb('0xd')]}});};exports[_0x85eb('0x2f')]=function(_0x353a42,_0x5d7fc6){return request('LoginUser',{'body':{'interface':_0x5d7fc6},'options':{'where':_0x353a42}});};exports['agentPause']=function(_0xd73c66,_0x46c5c9,_0x12d5d5){return request(_0x85eb('0x30'),{'body':{'type':_0x46c5c9,'uniqueid':_0x12d5d5},'options':{'where':_0xd73c66}});};exports[_0x85eb('0x31')]=function(_0x50e694){return request(_0x85eb('0x32'),{'body':{},'options':{'where':_0x50e694}});};exports[_0x85eb('0x33')]=function(_0x1ccd32){return request('LogoutUser',{'body':{},'options':{'where':_0x1ccd32}});};
\ No newline at end of file
+var _0xa1fd=['LogoutUser','lodash','moment','jayson/promise','client','request','error','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','getMailAccountById','ShowMailAccount','CloudProvider','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','dsn','ShowUser','GetContactByPhone','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','ListId','CreateCmContact','getPauseById','agentLogin','PauseUser','UnpauseUser','agentLogout'];(function(_0x5303b9,_0x5c548){var _0x455125=function(_0x24ad74){while(--_0x24ad74){_0x5303b9['push'](_0x5303b9['shift']());}};_0x455125(++_0x5c548);}(_0xa1fd,0x1b9));var _0xda1f=function(_0x23d50e,_0x378059){_0x23d50e=_0x23d50e-0x0;var _0x1ce88f=_0xa1fd[_0x23d50e];return _0x1ce88f;};'use strict';var _=require(_0xda1f('0x0'));var moment=require(_0xda1f('0x1'));var jayson=require(_0xda1f('0x2'));var client=jayson[_0xda1f('0x3')]['http']({'port':0x2329});function request(_0x221036,_0xafa72c){return new Promise(function(_0x2ce9f4,_0x46b451){return client[_0xda1f('0x4')](_0x221036,_0xafa72c)['then'](function(_0x470569){if(_0x470569[_0xda1f('0x5')]){return _0x46b451(_0x470569[_0xda1f('0x5')]['message']);}else{return _0x2ce9f4(_0x470569[_0xda1f('0x6')]);}})[_0xda1f('0x7')](function(_0x199a8d){return _0x46b451(_0x199a8d);});});}exports[_0xda1f('0x8')]=function(){return request(_0xda1f('0x9'),{'options':{'raw':![],'attributes':['id',_0xda1f('0xa'),_0xda1f('0xb')]}});};exports[_0xda1f('0xc')]=function(_0x13467c){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x13467c},'attributes':[_0xda1f('0xb')]}});};exports[_0xda1f('0xd')]=function(_0x20ab8b){return request(_0xda1f('0xe'),{'options':{'raw':![],'where':{'id':_0x20ab8b},'include':[{'model':'MailServerOut','as':'Smtp','include':[{'model':_0xda1f('0xf'),'as':_0xda1f('0xf')}]}],'attributes':['id',_0xda1f('0xa'),_0xda1f('0x10')],'smtp':!![]}});};exports[_0xda1f('0x11')]=function(_0x4ee57d){return request(_0xda1f('0x12'),{'options':{'where':{'id':_0x4ee57d},'attributes':[_0xda1f('0xa')]}});};exports[_0xda1f('0x13')]=function(_0x306184){return request(_0xda1f('0x14'),{'options':{'where':{'id':_0x306184},'attributes':[_0xda1f('0xa')]}});};exports['getVariableById']=function(_0x77da5b){return request(_0xda1f('0x15'),{'options':{'where':{'id':_0x77da5b},'attributes':[_0xda1f('0xa')]}});};exports[_0xda1f('0x16')]=function(_0x48f5d0){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x48f5d0},'attributes':[_0xda1f('0x17')]}});};exports['getUserById']=function(_0x3424a1){return request(_0xda1f('0x18'),{'options':{'where':{'id':_0x3424a1},'attributes':[_0xda1f('0xa')]}});};exports['getContactByPhone']=function(_0xe81fc2){return request(_0xda1f('0x19'),{'options':{'where':{'phone':_0xe81fc2['phone']},'attributes':['id']}});};exports[_0xda1f('0x1a')]=function(_0x31cbba){return request('ShowTrunk',{'options':{'where':{'id':_0x31cbba},'attributes':[_0xda1f('0xa')]}});};exports[_0xda1f('0x1b')]=function(_0x3977cf){return request(_0xda1f('0x1c'),{'options':{'where':{'id':_0x3977cf},'attributes':[_0xda1f('0x1d')]}});};exports[_0xda1f('0x1e')]=function(_0x1f6958){return request(_0xda1f('0x1f'),{'options':{'raw':![],'where':{'id':_0x1f6958},'include':[{'model':_0xda1f('0x20'),'as':_0xda1f('0x21')}]}});};exports[_0xda1f('0x22')]=function(_0xc76888){return request('ShowSmsAccount',{'options':{'where':{'id':_0xc76888},'attributes':['id',_0xda1f('0xa')]}});};exports['createSmsMessage']=function(_0x443fa1){return request('CreateSmsMessage',{'body':_0x443fa1});};exports[_0xda1f('0x23')]=function(_0x2d209d){return request('CreateSquareDetailsReport',{'body':_0x2d209d});};exports[_0xda1f('0x24')]=function(_0x146390){return request(_0xda1f('0x25'),{'body':_[_0xda1f('0x26')](_0x146390,{'project_name':_0x146390[_0xda1f('0x27')],'prev_project_name':_0x146390['arg_2']||'','is_subproject':_0x146390[_0xda1f('0x28')]?!![]:![],'leaveAt':moment()[_0xda1f('0x29')](_0xda1f('0x2a'))})});};exports[_0xda1f('0x2b')]=function(_0x54203a){return request(_0xda1f('0x2c'),{'body':_0x54203a});};exports[_0xda1f('0x2d')]=function(_0x4a994f){return request(_0xda1f('0x2e'),{'body':_0x4a994f});};exports['createCmContact']=function(_0x34459d){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x34459d['phone'],'ListId':_0x34459d[_0xda1f('0x2f')]}}})['then'](function(_0x4d5bb0){if(_0x4d5bb0){return _0x4d5bb0;}return request(_0xda1f('0x30'),{'body':_0x34459d});});};exports[_0xda1f('0x31')]=function(_0x2188d9){return request('ShowPause',{'options':{'where':{'id':_0x2188d9},'attributes':[_0xda1f('0xa')]}});};exports[_0xda1f('0x32')]=function(_0x5359a7,_0x1c8cfc){return request('LoginUser',{'body':{'interface':_0x1c8cfc},'options':{'where':_0x5359a7}});};exports['agentPause']=function(_0x4850d3,_0x90a7a3,_0x7f3b78){return request(_0xda1f('0x33'),{'body':{'type':_0x90a7a3,'uniqueid':_0x7f3b78},'options':{'where':_0x4850d3}});};exports['agentUnpause']=function(_0x30b8cf){return request(_0xda1f('0x34'),{'body':{},'options':{'where':_0x30b8cf}});};exports[_0xda1f('0x35')]=function(_0x481dc5){return request(_0xda1f('0x36'),{'body':{},'options':{'where':_0x481dc5}});};
\ No newline at end of file
index ac96242..48ea204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa49e=['exports','./polly','./lex'];(function(_0x18ecae,_0x2bf366){var _0x2fe95b=function(_0x5143a5){while(--_0x5143a5){_0x18ecae['push'](_0x18ecae['shift']());}};_0x2fe95b(++_0x2bf366);}(_0xa49e,0x1de));var _0xea49=function(_0x48b2cb,_0x5da5e7){_0x48b2cb=_0x48b2cb-0x0;var _0x3ad90f=_0xa49e[_0x48b2cb];return _0x3ad90f;};var polly=require(_0xea49('0x0'));var lex=require(_0xea49('0x1'));module[_0xea49('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0xafb9=['./lex','exports','./polly'];(function(_0x5b077b,_0x50b707){var _0x16faf7=function(_0x41ba83){while(--_0x41ba83){_0x5b077b['push'](_0x5b077b['shift']());}};_0x16faf7(++_0x50b707);}(_0xafb9,0x68));var _0x9afb=function(_0x5032f7,_0x23d457){_0x5032f7=_0x5032f7-0x0;var _0x25179c=_0xafb9[_0x5032f7];return _0x25179c;};var polly=require(_0x9afb('0x0'));var lex=require(_0x9afb('0x1'));module[_0x9afb('0x2')]={'polly':polly,'lex':lex};
\ No newline at end of file
index 3247f9f..0bf131d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb688=['exports'];(function(_0x26a5bc,_0x61a47a){var _0x117c0f=function(_0x45713c){while(--_0x45713c){_0x26a5bc['push'](_0x26a5bc['shift']());}};_0x117c0f(++_0x61a47a);}(_0xb688,0xcf));var _0x8b68=function(_0x4c56d0,_0x39f0b7){_0x4c56d0=_0x4c56d0-0x0;var _0xf6d1a=_0xb688[_0x4c56d0];return _0xf6d1a;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);};
\ No newline at end of file
+var _0x2750=['./lib/api'];(function(_0x39ea42,_0x3c1f50){var _0x33f5b7=function(_0x5d8e73){while(--_0x5d8e73){_0x39ea42['push'](_0x39ea42['shift']());}};_0x33f5b7(++_0x3c1f50);}(_0x2750,0x13b));var _0x0275=function(_0x508970,_0x49efb1){_0x508970=_0x508970-0x0;var _0x1f64c4=_0x2750[_0x508970];return _0x1f64c4;};'use strict';var lex=require(_0x0275('0x0'));module['exports']=function(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06){return lex(_0xf4568,_0xf2ae71,_0x372744,_0x429a37,_0x101b26,_0x41ec06);};
\ No newline at end of file
index b82e900..0e7cd3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x1aec0e,_0x325a67){var _0x4525b7=function(_0x49063b){while(--_0x49063b){_0x1aec0e['push'](_0x1aec0e['shift']());}};_0x4525b7(++_0x325a67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x467fa9,_0x3b1b3c){var _0x210252=function(_0x2a8474){while(--_0x2a8474){_0x467fa9['push'](_0x467fa9['shift']());}};_0x210252(++_0x3b1b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index 823da4a..b71e187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd826=['./lib/api','exports'];(function(_0x45d6bb,_0x5b5a4a){var _0x1f8d24=function(_0x1822dc){while(--_0x1822dc){_0x45d6bb['push'](_0x45d6bb['shift']());}};_0x1f8d24(++_0x5b5a4a);}(_0xd826,0x6c));var _0x6d82=function(_0x3a93e2,_0x423ece){_0x3a93e2=_0x3a93e2-0x0;var _0x395a9d=_0xd826[_0x3a93e2];return _0x395a9d;};'use strict';var polly=require(_0x6d82('0x0'));module[_0x6d82('0x1')]=function(_0x47a3c2,_0x3aceac,_0x2e4dac,_0x4199cf,_0x4da2d6,_0x4c470a,_0x3cba23){return polly(_0x47a3c2,_0x3aceac,_0x2e4dac,_0x4199cf,_0x4da2d6,_0x4c470a,_0x3cba23);};
\ No newline at end of file
+var _0x5287=['exports'];(function(_0x142b76,_0x2c62a2){var _0x31780f=function(_0x5335de){while(--_0x5335de){_0x142b76['push'](_0x142b76['shift']());}};_0x31780f(++_0x2c62a2);}(_0x5287,0x198));var _0x7528=function(_0x24be66,_0x58187c){_0x24be66=_0x24be66-0x0;var _0x4145e1=_0x5287[_0x24be66];return _0x4145e1;};'use strict';var polly=require('./lib/api');module[_0x7528('0x0')]=function(_0x40669a,_0x46ff89,_0xfe4a67,_0x1152d7,_0xcb0174,_0x22e885,_0x5cb0d4){return polly(_0x40669a,_0x46ff89,_0xfe4a67,_0x1152d7,_0xcb0174,_0x22e885,_0x5cb0d4);};
\ No newline at end of file
index 058f25c..d7f7683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeac5=['writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x168af2,_0x3d2814){var _0x3dca4d=function(_0x4cc7b4){while(--_0x4cc7b4){_0x168af2['push'](_0x168af2['shift']());}};_0x3dca4d(++_0x3d2814);}(_0xeac5,0x1bd));var _0x5eac=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xeac5[_0x4a7631];return _0x1a5a6f;};'use strict';var fs=require('fs');var path=require(_0x5eac('0x0'));var BPromise=require(_0x5eac('0x1'));var rs=require(_0x5eac('0x2'));var AWS=require(_0x5eac('0x3'));function pollyResult(_0x40d162,_0xeed123,_0x25e6b8){return new BPromise(function(_0x2f8e35,_0x51b647){_0x40d162[_0x5eac('0x4')](_0xeed123,function(_0x584103,_0x580d36){if(_0x584103){_0x51b647(_0x584103);}else if(_0x580d36){if(_0x580d36[_0x5eac('0x5')]instanceof Buffer){fs[_0x5eac('0x6')](_0x25e6b8,_0x580d36[_0x5eac('0x5')],function(_0x2cfc71){if(_0x2cfc71){_0x51b647(_0x2cfc71);}else{_0x2f8e35();}});}else{_0x51b647(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x51b647(new Error(_0x5eac('0x7')));}});});}module['exports']=function(_0x16a604,_0x4d4778,_0x29f099,_0x363b9a,_0xfb3595,_0x290b03,_0x3619e8){var _0x42f6a4=new AWS[(_0x5eac('0x8'))]({'accessKeyId':_0x16a604,'secretAccessKey':_0x4d4778,'region':_0x29f099});var _0x50ce67={'Text':_0xfb3595,'TextType':_0x290b03||_0x5eac('0x9'),'OutputFormat':_0x5eac('0xa'),'VoiceId':_0x363b9a};return pollyResult(_0x42f6a4,_0x50ce67,_0x3619e8);};
\ No newline at end of file
+var _0xb1b1=['randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path'];(function(_0x56cd48,_0x1f71e6){var _0x41933f=function(_0x5d351f){while(--_0x5d351f){_0x56cd48['push'](_0x56cd48['shift']());}};_0x41933f(++_0x1f71e6);}(_0xb1b1,0xcf));var _0x1b1b=function(_0x97aa0a,_0x2d5197){_0x97aa0a=_0x97aa0a-0x0;var _0x2ef2d6=_0xb1b1[_0x97aa0a];return _0x2ef2d6;};'use strict';var fs=require('fs');var path=require(_0x1b1b('0x0'));var BPromise=require('bluebird');var rs=require(_0x1b1b('0x1'));var AWS=require(_0x1b1b('0x2'));function pollyResult(_0x5e356e,_0x2c2d0f,_0xb15359){return new BPromise(function(_0x20fcd6,_0x7ec822){_0x5e356e['synthesizeSpeech'](_0x2c2d0f,function(_0x4cdacd,_0x4ca287){if(_0x4cdacd){_0x7ec822(_0x4cdacd);}else if(_0x4ca287){if(_0x4ca287[_0x1b1b('0x3')]instanceof Buffer){fs[_0x1b1b('0x4')](_0xb15359,_0x4ca287[_0x1b1b('0x3')],function(_0x38546e){if(_0x38546e){_0x7ec822(_0x38546e);}else{_0x20fcd6();}});}else{_0x7ec822(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x7ec822(new Error(_0x1b1b('0x5')));}});});}module['exports']=function(_0x3e9ddf,_0x7ed391,_0x53e4b8,_0x49d321,_0x43c127,_0xfff39d,_0x1d2f3d){var _0x52b8d0=new AWS['Polly']({'accessKeyId':_0x3e9ddf,'secretAccessKey':_0x7ed391,'region':_0x53e4b8});var _0x3ad167={'Text':_0x43c127,'TextType':_0xfff39d||_0x1b1b('0x6'),'OutputFormat':_0x1b1b('0x7'),'VoiceId':_0x49d321};return pollyResult(_0x52b8d0,_0x3ad167,_0x1d2f3d);};
\ No newline at end of file
index 705d1e3..a53fb68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5aa=['./lib/api','exports'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xc5aa,0x1e6));var _0xac5a=function(_0x159670,_0x55aa84){_0x159670=_0x159670-0x0;var _0x3a2519=_0xc5aa[_0x159670];return _0x3a2519;};'use strict';var asr=require(_0xac5a('0x0'));module[_0xac5a('0x1')]=function(_0x359e04,_0xd57191,_0x1f2d91,_0xca5439){return asr(_0x359e04,_0xd57191,_0x1f2d91);};
\ No newline at end of file
+var _0x82da=['./lib/api','exports'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0x82da,0x1c2));var _0xa82d=function(_0x409353,_0xe9f04d){_0x409353=_0x409353-0x0;var _0x4f4b59=_0x82da[_0x409353];return _0x4f4b59;};'use strict';var asr=require(_0xa82d('0x0'));module[_0xa82d('0x1')]=function(_0x28fdf9,_0x24e11,_0x3b06f2,_0x590720){return asr(_0x28fdf9,_0x24e11,_0x3b06f2);};
\ No newline at end of file
index 813f568..7671dfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf53f=['https://speech.googleapis.com','exports','string','length','undefined','toString','POST','LINEAR16','8000','url','bluebird'];(function(_0x4de94d,_0xdd6680){var _0x5a74f5=function(_0x3e7181){while(--_0x3e7181){_0x4de94d['push'](_0x4de94d['shift']());}};_0x5a74f5(++_0xdd6680);}(_0xf53f,0x8d));var _0xff53=function(_0x54d167,_0x459756){_0x54d167=_0x54d167-0x0;var _0x34d5bb=_0xf53f[_0x54d167];return _0x34d5bb;};'use strict';var url=require(_0xff53('0x0'));var BPromise=require(_0xff53('0x1'));var fs=require('fs');var host=_0xff53('0x2');module[_0xff53('0x3')]=function(_0x3b48fc,_0x4afcd,_0x492e12){return new BPromise(function(_0x32529d,_0x18b504){var _0x2077b9;if(typeof _0x3b48fc!==_0xff53('0x4')||_0x3b48fc[_0xff53('0x5')]===0x0){return _0x18b504('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x4afcd!=='string'||_0x4afcd[_0xff53('0x5')]===0x0){return _0x18b504('key\x20should\x20be\x20a\x20string');}if(typeof _0x492e12!==_0xff53('0x6')&&(typeof _0x492e12!==_0xff53('0x4')||_0x492e12[_0xff53('0x5')]===0x0)){return _0x18b504('lang\x20should\x20be\x20a\x20string');}try{_0x2077b9=fs['readFileSync'](_0x3b48fc)[_0xff53('0x7')]('base64');}catch(_0x130576){return _0x18b504(_0x130576);}return _0x32529d({'method':_0xff53('0x8'),'uri':host+'/v1/speech:recognize?key='+_0x4afcd,'body':{'config':{'encoding':_0xff53('0x9'),'sampleRateHertz':_0xff53('0xa'),'languageCode':_0x492e12},'audio':{'content':_0x2077b9}},'json':!![]});});};
\ No newline at end of file
+var _0x5c37=['8000','url','bluebird','https://speech.googleapis.com','exports','length','filepath\x20should\x20be\x20a\x20string','string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0xf38e05,_0x1c0d43){var _0x44efcd=function(_0x3c249a){while(--_0x3c249a){_0xf38e05['push'](_0xf38e05['shift']());}};_0x44efcd(++_0x1c0d43);}(_0x5c37,0x11e));var _0x75c3=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x5c37[_0x1f83a5];return _0x45edf0;};'use strict';var url=require(_0x75c3('0x0'));var BPromise=require(_0x75c3('0x1'));var fs=require('fs');var host=_0x75c3('0x2');module[_0x75c3('0x3')]=function(_0x2a3a11,_0x79e9a5,_0x524eee){return new BPromise(function(_0x1f0ee1,_0x2e1094){var _0x207698;if(typeof _0x2a3a11!=='string'||_0x2a3a11[_0x75c3('0x4')]===0x0){return _0x2e1094(_0x75c3('0x5'));}if(typeof _0x79e9a5!==_0x75c3('0x6')||_0x79e9a5[_0x75c3('0x4')]===0x0){return _0x2e1094('key\x20should\x20be\x20a\x20string');}if(typeof _0x524eee!==_0x75c3('0x7')&&(typeof _0x524eee!=='string'||_0x524eee['length']===0x0)){return _0x2e1094(_0x75c3('0x8'));}try{_0x207698=fs[_0x75c3('0x9')](_0x2a3a11)['toString'](_0x75c3('0xa'));}catch(_0xdd2a35){return _0x2e1094(_0xdd2a35);}return _0x1f0ee1({'method':_0x75c3('0xb'),'uri':host+_0x75c3('0xc')+_0x79e9a5,'body':{'config':{'encoding':_0x75c3('0xd'),'sampleRateHertz':_0x75c3('0xe'),'languageCode':_0x524eee},'audio':{'content':_0x207698}},'json':!![]});});};
\ No newline at end of file
index b76938f..325bfde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd65=['uri','results','map','alternatives','transcript','join','googleASR\x20transcription','googleASR\x20confidence','catch','message','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','intent','name','displayName','isFallback','responseId','intentDetectionConfidence','fulfillmentText','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','awsPolly','polly','awsLex','lex','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','createWriteStream','info','finish\x20download\x20file','close','unlink','end','\x20failed,\x20status\x20code\x20=\x20','data','wav','error\x20convert','finish\x20to\x20convert','resolve','tmp','generate','.wav','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','POST','then','.mp3','audioContent','writeFile','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','\x22\x20might\x20not\x20exist'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcd65,0x144));var _0x5cd6=function(_0x59fc33,_0x2e182d){_0x59fc33=_0x59fc33-0x0;var _0x39066f=_0xcd65[_0x59fc33];return _0x39066f;};'use strict';var apiai=require(_0x5cd6('0x0'));var BPromise=require(_0x5cd6('0x1'));var dialogflow=require(_0x5cd6('0x2'));var fs=require('fs');var http=require(_0x5cd6('0x3'));var https=require(_0x5cd6('0x4'));var md5=require(_0x5cd6('0x5'));var path=require(_0x5cd6('0x6'));var querystring=require(_0x5cd6('0x7'));var rp=require(_0x5cd6('0x8'));var rs=require(_0x5cd6('0x9'));var sox=require(_0x5cd6('0xa'));var tts=require('google-tts-api');var urlParse=require(_0x5cd6('0xb'))[_0x5cd6('0xc')];var util=require(_0x5cd6('0xd'));var aws=require(_0x5cd6('0xe'));var google=require(_0x5cd6('0xf'));var sestek=require(_0x5cd6('0x10'));var tilde=require(_0x5cd6('0x11'));var logger=require(_0x5cd6('0x12'))(_0x5cd6('0x13'));var ISPEECH_API=_0x5cd6('0x14');function downloadFile(_0x501d5c,_0x10bce3){return new BPromise(function(_0x48407c,_0x5a8cd9){var _0x2e6c53=urlParse(_0x501d5c);var _0x47d3ba=_0x2e6c53[_0x5cd6('0x15')]===_0x5cd6('0x16')?https:http;var _0x38a6c0={'host':_0x2e6c53[_0x5cd6('0x17')],'path':_0x2e6c53['path'],'headers':{'user-agent':_0x5cd6('0x18')}};_0x47d3ba[_0x5cd6('0x19')](_0x38a6c0,function(_0x315d1b){if(_0x315d1b[_0x5cd6('0x1a')]!==0xc8){logger[_0x5cd6('0x1b')](_0x5cd6('0x1c')+_0x501d5c+'\x20failed,\x20status\x20code\x20=\x20'+_0x315d1b['statusCode']+'\x20('+_0x315d1b[_0x5cd6('0x1d')]+')');_0x5a8cd9(new Error(_0x5cd6('0x1c')+_0x501d5c+'\x20failed,\x20status\x20code\x20=\x20'+_0x315d1b[_0x5cd6('0x1a')]+'\x20('+_0x315d1b[_0x5cd6('0x1d')]+')'));return;}var _0x2ca586=fs[_0x5cd6('0x1e')](_0x10bce3);_0x2ca586['on']('finish',function(){logger[_0x5cd6('0x1f')](_0x5cd6('0x20'));_0x2ca586[_0x5cd6('0x21')](_0x48407c);});_0x2ca586['on'](_0x5cd6('0x1b'),function(_0x472036){fs[_0x5cd6('0x22')](_0x10bce3);logger[_0x5cd6('0x1b')]('download\x20error',_0x472036);_0x5a8cd9(_0x472036);});_0x315d1b['pipe'](_0x2ca586);})['on']('error',function(_0x46739d){logger[_0x5cd6('0x1b')](_0x46739d);_0x5a8cd9(_0x46739d);})[_0x5cd6('0x23')]();});}function uploadFile(_0x5838b2){return new BPromise(function(_0x336380,_0x47c87d){var _0x418c0=urlParse(_0x5838b2);var _0x250441=_0x418c0[_0x5cd6('0x15')]===_0x5cd6('0x16')?https:http;var _0x15329b={'host':_0x418c0[_0x5cd6('0x17')],'path':_0x418c0['path'],'headers':{'user-agent':_0x5cd6('0x18')}};_0x250441['get'](_0x15329b,function(_0x533dc7){if(_0x533dc7['statusCode']!==0xc8){_0x47c87d(new Error(_0x5cd6('0x1c')+_0x5838b2+_0x5cd6('0x24')+_0x533dc7[_0x5cd6('0x1a')]+'\x20('+_0x533dc7[_0x5cd6('0x1d')]+')'));return;}var _0x28705e='';_0x533dc7['on'](_0x5cd6('0x25'),function(_0x1e99f2){_0x28705e+=_0x1e99f2;});_0x533dc7['on'](_0x5cd6('0x23'),function(){_0x336380(_0x28705e);});})['on'](_0x5cd6('0x1b'),function(_0x37fb43){_0x47c87d(_0x37fb43);})[_0x5cd6('0x23')]();});}function convertFile(_0xb10c2e,_0x207d98){return new BPromise(function(_0x19f482,_0x2686a6){var _0x3ebc6d=sox['transcode'](_0xb10c2e,_0x207d98,{'sampleRate':0x1f40,'format':_0x5cd6('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3ebc6d['on'](_0x5cd6('0x1b'),function(_0x4112e7){logger[_0x5cd6('0x1b')](_0x5cd6('0x27'),_0x4112e7);_0x2686a6(_0x4112e7);});_0x3ebc6d['on'](_0x5cd6('0x23'),function(){logger[_0x5cd6('0x1f')](_0x5cd6('0x28'));_0x19f482();});_0x3ebc6d['start']();});}function base64Decode(_0x1e8f4e,_0x595bba){var _0x473e3e=path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x2c'));fs[_0x5cd6('0x2d')](_0x473e3e,_0x1e8f4e,_0x5cd6('0x2e'));return convertFile(_0x473e3e,_0x595bba)['then'](function(){try{fs[_0x5cd6('0x22')](_0x473e3e);fs[_0x5cd6('0x2f')](_0x595bba,_0x5cd6('0x30'));}catch(_0x3baea3){logger[_0x5cd6('0x1b')](_0x3baea3);}return _0x595bba[_0x5cd6('0x31')]('.')[0x0];});}function base64Encode(_0x589170){var _0x30024f=fs[_0x5cd6('0x32')](_0x589170);return new Buffer(_0x30024f)[_0x5cd6('0x33')](_0x5cd6('0x2e'));}exports[_0x5cd6('0x34')]=function(_0x9158f3,_0x56f8e4,_0x42941d,_0x2c9089,_0x3fab25,_0x2d6510){var _0x3080c5,_0x251107;var _0x3c09c0=_0x5cd6('0x35');var _0x32eb11=_0x5cd6('0x36')+_0x9158f3;var _0x408128={};if(_0x56f8e4===_0x5cd6('0x37')){_0x408128[_0x5cd6('0x38')]={'ssml':_0x42941d};}else{_0x408128[_0x5cd6('0x38')]={'text':_0x42941d};};_0x408128[_0x5cd6('0x39')]={'languageCode':_0x2c9089,'ssmlGender':_0x3fab25};_0x408128['audioConfig']={'audioEncoding':_0x5cd6('0x3a'),'sampleRateHertz':0x1f40};var _0x5a5b28={'url':_0x3c09c0+'text:synthesize'+_0x32eb11,'method':_0x5cd6('0x3b'),'json':!![],'body':_0x408128};return rp(_0x5a5b28)[_0x5cd6('0x3c')](function(_0x12268c){return new BPromise(function(_0x21219a,_0x40c75b){_0x3080c5=path[_0x5cd6('0x29')](__dirname,'tmp',rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x3d'));var _0x445ae4=Buffer['from'](_0x12268c[_0x5cd6('0x3e')],_0x5cd6('0x2e'));return fs[_0x5cd6('0x3f')](_0x3080c5,_0x445ae4,function(_0x20d5e7){_0x40c75b(_0x20d5e7);},function(_0x316a1a){fs[_0x5cd6('0x2f')](_0x3080c5,_0x5cd6('0x30'));_0x21219a(_0x316a1a);});});})[_0x5cd6('0x3c')](function(_0x4a12e1){_0x251107=path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x2c'));return convertFile(_0x3080c5,_0x251107);})['then'](function(){try{fs['unlink'](_0x3080c5);fs['chmodSync'](_0x251107,_0x5cd6('0x30'));}catch(_0x1a1695){logger['error'](_0x1a1695);}logger[_0x5cd6('0x1f')]('googleCloudTTS\x20path',_0x251107[_0x5cd6('0x31')]('.')[0x0]);return _0x251107[_0x5cd6('0x31')]('.')[0x0];});};exports[_0x5cd6('0x40')]=function(_0x440039,_0x3b55d2){var _0x418cff='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x105d36,_0x439a4c;var _0x2385de;var _0x5c71b4={'encoding':_0x5cd6('0x41'),'method':'POST','timeout':0x2710,'url':_0x418cff,'headers':{'Content-Type':_0x5cd6('0x42')},'body':_0x5cd6('0x43')+encodeURIComponent(JSON[_0x5cd6('0x44')]([[[_0x5cd6('0x45'),JSON[_0x5cd6('0x44')]([_0x440039,_0x3b55d2||'en',![],'null']),null,_0x5cd6('0x46')]]]))};return rp(_0x5c71b4)['then'](function(_0x4e7c5a){try{_0x2385de=eval(_0x4e7c5a[_0x5cd6('0x47')](0x5))[0x0][0x2];}catch(_0x2d64c6){throw new Error(_0x5cd6('0x48')+_0x4e7c5a[_0x5cd6('0x25')]);}if(!_0x2385de){if(_0x440039[_0x5cd6('0x49')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x3b55d2+_0x5cd6('0x4a'));}}try{_0x2385de=eval(_0x2385de)[0x0];}catch(_0x1e6a38){throw new Error(_0x5cd6('0x48')+res[_0x5cd6('0x25')]);}const _0x257a1c=_0x2385de;_0x105d36=path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs[_0x5cd6('0x2b')](0x4)+'.mp3');fs[_0x5cd6('0x2d')](_0x105d36,_0x2385de,{'encoding':_0x5cd6('0x2e')});_0x439a4c=path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs['generate'](0x4)+_0x5cd6('0x2c'));return convertFile(_0x105d36,_0x439a4c);})['then'](function(){try{fs[_0x5cd6('0x22')](_0x105d36);fs[_0x5cd6('0x2f')](_0x439a4c,_0x5cd6('0x30'));}catch(_0x3f61e8){logger[_0x5cd6('0x1b')](_0x3f61e8);}logger[_0x5cd6('0x1f')]('goggleTTS\x20path',_0x439a4c[_0x5cd6('0x31')]('.')[0x0]);return _0x439a4c[_0x5cd6('0x31')]('.')[0x0];});};exports['googleASR']=function(_0xd5e36c,_0x5982cc,_0x1c921b){return google['asr'](_0xd5e36c,_0x5982cc,_0x1c921b)[_0x5cd6('0x3c')](function(_0x4082c0){logger[_0x5cd6('0x1f')](_0x4082c0[_0x5cd6('0x4b')]);return rp(_0x4082c0);})[_0x5cd6('0x3c')](function(_0xedfe9c){var _0x250d89='';var _0x342f62=0x0;try{fs['unlink'](_0xd5e36c);}catch(_0x61a0fd){logger['error'](_0x61a0fd);}if(_0xedfe9c&&_0xedfe9c[_0x5cd6('0x4c')]){_0x250d89=_0xedfe9c[_0x5cd6('0x4c')][_0x5cd6('0x4d')](function(_0x5872f1){return _0x5872f1&&_0x5872f1[_0x5cd6('0x4e')][0x0]&&_0x5872f1[_0x5cd6('0x4e')][0x0][_0x5cd6('0x4f')]?_0x5872f1['alternatives'][0x0][_0x5cd6('0x4f')]:'';})[_0x5cd6('0x50')]('\x0a');_0x342f62=_0xedfe9c['results'][_0x5cd6('0x4d')](function(_0x366b7d){return _0x366b7d&&_0x366b7d[_0x5cd6('0x4e')][0x0]&&_0x366b7d[_0x5cd6('0x4e')][0x0]['confidence']?_0x366b7d[_0x5cd6('0x4e')][0x0]['confidence']:0x0;})[_0x5cd6('0x50')]('\x0a');}logger[_0x5cd6('0x1f')](_0x5cd6('0x51'),_0x250d89);logger[_0x5cd6('0x1f')](_0x5cd6('0x52'),_0x342f62);return{'transcript':_0x250d89,'confidence':_0x342f62};})[_0x5cd6('0x53')](function(_0x292067){logger[_0x5cd6('0x1b')]('[%s]\x20%s:%s',_0x292067[_0x5cd6('0x1a')],_0x292067['name'],_0x292067[_0x5cd6('0x54')]);});};exports['googleDialogflow']=function(_0x5b5f97,_0x335c96,_0x240eb6,_0x5fe5d0){var _0x3cb1bb=apiai(_0x335c96,{'language':_0x5fe5d0||'en'});return _0x3cb1bb[_0x5cd6('0x55')](_0x240eb6,{'sessionId':md5(_0x5b5f97)})['then'](function(_0x35160c){logger['info'](JSON[_0x5cd6('0x44')](_0x35160c));return{'source':_0x35160c[_0x5cd6('0x56')]['source'],'resolvedQuery':_0x35160c['result'][_0x5cd6('0x57')],'action':_0x35160c[_0x5cd6('0x56')][_0x5cd6('0x58')],'actionIncomplete':_0x35160c[_0x5cd6('0x56')][_0x5cd6('0x59')],'speech':_0x35160c['result'][_0x5cd6('0x5a')]['speech'],'score':_0x35160c['result'][_0x5cd6('0x5b')],'statusCode':_0x35160c[_0x5cd6('0x5c')][_0x5cd6('0x5d')],'endConversation':_0x35160c[_0x5cd6('0x56')][_0x5cd6('0x5e')][_0x5cd6('0x5f')]||![],'isFallbackIntent':_0x35160c['result'][_0x5cd6('0x5e')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x5eeb8d,_0x1f989e,_0x270c0e,_0x23d1ae,_0x4ba718,_0x4e6c64){var _0x110c8d=_0x23d1ae['replace'](/\\n/g,'\x0a');var _0x59fefa={'credentials':{'private_key':_0x110c8d,'client_email':_0x270c0e}};var _0x28ebcc=new dialogflow[(_0x5cd6('0x60'))](_0x59fefa);var _0x153e5d=_0x28ebcc[_0x5cd6('0x61')](_0x1f989e,md5(_0x5eeb8d));var _0x544bf7={'session':_0x153e5d,'queryInput':{'text':{'text':_0x4ba718,'languageCode':_0x4e6c64}}};return _0x28ebcc[_0x5cd6('0x62')](_0x544bf7)['then'](function(_0x1f33fb){if(_0x1f33fb&&_0x1f33fb[_0x5cd6('0x49')]){logger['info'](_0x5cd6('0x63'),JSON[_0x5cd6('0x44')](_0x1f33fb));var _0x165573=_0x1f33fb[0x0];if(_0x165573){var _0x10ad76={'action':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x58')],'allRequiredParamsPresent':_0x165573[_0x5cd6('0x64')]['allRequiredParamsPresent'],'endConversation':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x65')]&&_0x165573[_0x5cd6('0x64')]['diagnosticInfo'][_0x5cd6('0x66')]?_0x165573[_0x5cd6('0x64')]['diagnosticInfo'][_0x5cd6('0x66')]['end_conversation'][_0x5cd6('0x67')]:![],'fulfillmentText':_0x165573['queryResult']['fulfillmentText'],'intentName':_0x165573['queryResult'][_0x5cd6('0x68')][_0x5cd6('0x69')],'intentDisplayName':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x68')][_0x5cd6('0x6a')],'isFallbackIntent':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x68')][_0x5cd6('0x6b')],'languageCode':_0x165573[_0x5cd6('0x64')]['languageCode'],'queryText':_0x165573[_0x5cd6('0x64')]['queryText'],'responseId':_0x165573[_0x5cd6('0x6c')],'score':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x6d')],'speech':_0x165573[_0x5cd6('0x64')][_0x5cd6('0x6e')],'providerResponse':JSON[_0x5cd6('0x44')](_0x1f33fb)};return _0x10ad76;}}});};exports['tildeASR']=function(_0x95b8f8,_0x2040a7,_0xeb2089,_0x2ccc01){return tilde[_0x5cd6('0x6f')](_0x95b8f8,_0x2040a7,_0xeb2089,_0x2ccc01)[_0x5cd6('0x3c')](function(_0x46987c){try{fs['unlink'](_0x95b8f8);}catch(_0x57a3d4){logger[_0x5cd6('0x1b')](_0x57a3d4);}logger[_0x5cd6('0x1f')](_0x5cd6('0x70'),_0x46987c[_0x5cd6('0x4f')]);logger[_0x5cd6('0x1f')](_0x5cd6('0x71'),_0x46987c[_0x5cd6('0x72')]);return _0x46987c;});};exports[_0x5cd6('0x73')]=function(_0x121e69,_0x576a9d,_0x5746bb,_0x35fc75,_0x54a822,_0x373923){var _0x1dbe66=path['resolve'](__dirname,'tmp',rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x3d'));var _0x384c84;return aws[_0x5cd6('0x74')](_0x121e69,_0x576a9d,_0x5746bb,_0x35fc75,_0x54a822,_0x373923,_0x1dbe66)[_0x5cd6('0x3c')](function(){_0x384c84=path['resolve'](__dirname,_0x5cd6('0x2a'),rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x2c'));return convertFile(_0x1dbe66,_0x384c84);})[_0x5cd6('0x3c')](function(){try{fs['unlink'](_0x1dbe66);fs[_0x5cd6('0x2f')](_0x384c84,_0x5cd6('0x30'));}catch(_0x329e73){logger[_0x5cd6('0x1b')](_0x329e73);}return _0x384c84['split']('.')[0x0];});};exports[_0x5cd6('0x75')]=function(_0x2962c2,_0x11d2b5,_0x579534,_0x19db94,_0x1104b1,_0x55e13d){return aws[_0x5cd6('0x76')](_0x2962c2,_0x11d2b5,_0x579534,_0x19db94,_0x1104b1,_0x55e13d)[_0x5cd6('0x3c')](function(_0x259139){logger[_0x5cd6('0x1f')](JSON[_0x5cd6('0x44')](_0x259139));return _0x259139;});};exports['ispeechTTS']=function(_0x360baa,_0x1597d7,_0x5d6584,_0x2d3886){var _0x2a798b=util['format'](_0x5cd6('0x77'),ISPEECH_API,_0x360baa,encodeURIComponent(_0x1597d7),_0x5d6584,_0x2d3886);var _0x14a38b=path['resolve'](__dirname,_0x5cd6('0x2a'),rs['generate'](0x4)+'.mp3');var _0x4797f1;return downloadFile(_0x2a798b,_0x14a38b)[_0x5cd6('0x3c')](function(){_0x4797f1=path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs['generate'](0x4)+_0x5cd6('0x2c'));return convertFile(_0x14a38b,_0x4797f1);})[_0x5cd6('0x3c')](function(){try{fs[_0x5cd6('0x22')](_0x14a38b);fs[_0x5cd6('0x2f')](_0x4797f1,_0x5cd6('0x30'));}catch(_0x2d4898){logger[_0x5cd6('0x1b')](_0x2d4898);}return _0x4797f1[_0x5cd6('0x31')]('.')[0x0];});};exports['ispeechASR']=function(_0x5a2a11,_0x20119b,_0x206bdc,_0x4a3de5){var _0x3e7eb6=util[_0x5cd6('0x78')](_0x5cd6('0x79'),ISPEECH_API,_0x20119b,_0x206bdc,base64Encode(_0x5a2a11),_0x4a3de5?util[_0x5cd6('0x78')](_0x5cd6('0x7a'),encodeURIComponent(_0x4a3de5)):_0x5cd6('0x7b'));return uploadFile(_0x3e7eb6)['then'](function(_0x50e0ea){return querystring[_0x5cd6('0xc')](_0x50e0ea);});};exports[_0x5cd6('0x7c')]=function(_0x4fa4e3,_0x59c36e){return sestek[_0x5cd6('0x7d')](_0x4fa4e3,_0x59c36e)[_0x5cd6('0x3c')](function(_0x56307a){logger[_0x5cd6('0x1f')](JSON[_0x5cd6('0x44')](_0x56307a));var _0x24ba09={'speech':_0x56307a[_0x5cd6('0x7e')],'action':_0x56307a[_0x5cd6('0x7f')]?_0x56307a[_0x5cd6('0x7f')]['CustomAction']:undefined,'actiondata':_0x56307a[_0x5cd6('0x7f')]?_0x56307a[_0x5cd6('0x7f')][_0x5cd6('0x80')]:undefined};if(_0x56307a[_0x5cd6('0x7f')]&&_0x56307a[_0x5cd6('0x7f')]['AudioFromTts']){return base64Decode(_0x56307a[_0x5cd6('0x7f')][_0x5cd6('0x81')][_0x5cd6('0x82')],path[_0x5cd6('0x29')](__dirname,_0x5cd6('0x2a'),rs[_0x5cd6('0x2b')](0x4)+_0x5cd6('0x2c')))[_0x5cd6('0x3c')](function(_0x29e7f8){_0x24ba09[_0x5cd6('0x83')]=_0x29e7f8;return _0x24ba09;});}return _0x24ba09;});};exports[_0x5cd6('0x84')]=function(){return __dirname;};
\ No newline at end of file
+var _0x2d6e=['WHAT_EVER','get','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','base64','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','then','from','writeFile','.wav','info','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','\x22\x20might\x20not\x20exist','writeFileSync','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','[%s]\x20%s:%s','message','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','awsPolly','.mp3','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','nda','text','channelData','CustomActionData','AudioFromTts','Data','audiofile','bluebird','dialogflow','http','https','path','querystring','request-promise','randomstring','parse','util','./aws','./google','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','unlink','download\x20error','pipe','end'];(function(_0x27304a,_0x7b9399){var _0x14757c=function(_0x1babab){while(--_0x1babab){_0x27304a['push'](_0x27304a['shift']());}};_0x14757c(++_0x7b9399);}(_0x2d6e,0xed));var _0xe2d6=function(_0x4883c8,_0x1281a3){_0x4883c8=_0x4883c8-0x0;var _0x3a404b=_0x2d6e[_0x4883c8];return _0x3a404b;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xe2d6('0x0'));var dialogflow=require(_0xe2d6('0x1'));var fs=require('fs');var http=require(_0xe2d6('0x2'));var https=require(_0xe2d6('0x3'));var md5=require('md5');var path=require(_0xe2d6('0x4'));var querystring=require(_0xe2d6('0x5'));var rp=require(_0xe2d6('0x6'));var rs=require(_0xe2d6('0x7'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require('url')[_0xe2d6('0x8')];var util=require(_0xe2d6('0x9'));var aws=require(_0xe2d6('0xa'));var google=require(_0xe2d6('0xb'));var sestek=require('./sestek');var tilde=require('./tilde');var logger=require(_0xe2d6('0xc'))(_0xe2d6('0xd'));var ISPEECH_API=_0xe2d6('0xe');function downloadFile(_0x38add9,_0x346877){return new BPromise(function(_0x3c0b10,_0x3d1f99){var _0x466ce6=urlParse(_0x38add9);var _0x330603=_0x466ce6[_0xe2d6('0xf')]==='https:'?https:http;var _0xb47b3a={'host':_0x466ce6[_0xe2d6('0x10')],'path':_0x466ce6[_0xe2d6('0x4')],'headers':{'user-agent':'WHAT_EVER'}};_0x330603['get'](_0xb47b3a,function(_0x924a7f){if(_0x924a7f[_0xe2d6('0x11')]!==0xc8){logger[_0xe2d6('0x12')](_0xe2d6('0x13')+_0x38add9+'\x20failed,\x20status\x20code\x20=\x20'+_0x924a7f[_0xe2d6('0x11')]+'\x20('+_0x924a7f['statusMessage']+')');_0x3d1f99(new Error(_0xe2d6('0x13')+_0x38add9+_0xe2d6('0x14')+_0x924a7f['statusCode']+'\x20('+_0x924a7f[_0xe2d6('0x15')]+')'));return;}var _0x1aef85=fs['createWriteStream'](_0x346877);_0x1aef85['on'](_0xe2d6('0x16'),function(){logger['info']('finish\x20download\x20file');_0x1aef85['close'](_0x3c0b10);});_0x1aef85['on']('error',function(_0xe9083c){fs[_0xe2d6('0x17')](_0x346877);logger[_0xe2d6('0x12')](_0xe2d6('0x18'),_0xe9083c);_0x3d1f99(_0xe9083c);});_0x924a7f[_0xe2d6('0x19')](_0x1aef85);})['on']('error',function(_0x515506){logger[_0xe2d6('0x12')](_0x515506);_0x3d1f99(_0x515506);})[_0xe2d6('0x1a')]();});}function uploadFile(_0x4b39c0){return new BPromise(function(_0x3cc51c,_0x2c2f0f){var _0x5e1c12=urlParse(_0x4b39c0);var _0x9473e7=_0x5e1c12[_0xe2d6('0xf')]==='https:'?https:http;var _0x368471={'host':_0x5e1c12[_0xe2d6('0x10')],'path':_0x5e1c12[_0xe2d6('0x4')],'headers':{'user-agent':_0xe2d6('0x1b')}};_0x9473e7[_0xe2d6('0x1c')](_0x368471,function(_0x210a64){if(_0x210a64[_0xe2d6('0x11')]!==0xc8){_0x2c2f0f(new Error('request\x20to\x20'+_0x4b39c0+_0xe2d6('0x14')+_0x210a64[_0xe2d6('0x11')]+'\x20('+_0x210a64[_0xe2d6('0x15')]+')'));return;}var _0x4499c9='';_0x210a64['on']('data',function(_0x29b5e0){_0x4499c9+=_0x29b5e0;});_0x210a64['on']('end',function(){_0x3cc51c(_0x4499c9);});})['on'](_0xe2d6('0x12'),function(_0x5df967){_0x2c2f0f(_0x5df967);})[_0xe2d6('0x1a')]();});}function convertFile(_0x2fb499,_0x19c252){return new BPromise(function(_0x16160f,_0x59d745){var _0x1be767=sox[_0xe2d6('0x1d')](_0x2fb499,_0x19c252,{'sampleRate':0x1f40,'format':_0xe2d6('0x1e'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1be767['on']('error',function(_0x553e4f){logger[_0xe2d6('0x12')](_0xe2d6('0x1f'),_0x553e4f);_0x59d745(_0x553e4f);});_0x1be767['on'](_0xe2d6('0x1a'),function(){logger['info'](_0xe2d6('0x20'));_0x16160f();});_0x1be767[_0xe2d6('0x21')]();});}function base64Decode(_0x3a8231,_0x5184f2){var _0x48e200=path[_0xe2d6('0x22')](__dirname,_0xe2d6('0x23'),rs[_0xe2d6('0x24')](0x4)+'.wav');fs['writeFileSync'](_0x48e200,_0x3a8231,_0xe2d6('0x25'));return convertFile(_0x48e200,_0x5184f2)['then'](function(){try{fs[_0xe2d6('0x17')](_0x48e200);fs[_0xe2d6('0x26')](_0x5184f2,_0xe2d6('0x27'));}catch(_0x32aa07){logger['error'](_0x32aa07);}return _0x5184f2[_0xe2d6('0x28')]('.')[0x0];});}function base64Encode(_0x1e6253){var _0x2e3aa1=fs[_0xe2d6('0x29')](_0x1e6253);return new Buffer(_0x2e3aa1)[_0xe2d6('0x2a')]('base64');}exports[_0xe2d6('0x2b')]=function(_0x2c763b,_0x3d8005,_0x540d98,_0x16c537,_0x5e80c2,_0x1460eb){var _0x13d3f7,_0x35358d;var _0x241bc3=_0xe2d6('0x2c');var _0x522213=_0xe2d6('0x2d')+_0x2c763b;var _0x4d012={};if(_0x3d8005===_0xe2d6('0x2e')){_0x4d012[_0xe2d6('0x2f')]={'ssml':_0x540d98};}else{_0x4d012[_0xe2d6('0x2f')]={'text':_0x540d98};};_0x4d012[_0xe2d6('0x30')]={'languageCode':_0x16c537,'ssmlGender':_0x5e80c2};_0x4d012['audioConfig']={'audioEncoding':_0xe2d6('0x31'),'sampleRateHertz':0x1f40};var _0x21eedb={'url':_0x241bc3+_0xe2d6('0x32')+_0x522213,'method':_0xe2d6('0x33'),'json':!![],'body':_0x4d012};return rp(_0x21eedb)[_0xe2d6('0x34')](function(_0x1cac32){return new BPromise(function(_0x2c1e82,_0x895935){_0x13d3f7=path[_0xe2d6('0x22')](__dirname,_0xe2d6('0x23'),rs[_0xe2d6('0x24')](0x4)+'.mp3');var _0x1eb1a3=Buffer[_0xe2d6('0x35')](_0x1cac32['audioContent'],_0xe2d6('0x25'));return fs[_0xe2d6('0x36')](_0x13d3f7,_0x1eb1a3,function(_0x2fc6b3){_0x895935(_0x2fc6b3);},function(_0x32824f){fs[_0xe2d6('0x26')](_0x13d3f7,_0xe2d6('0x27'));_0x2c1e82(_0x32824f);});});})[_0xe2d6('0x34')](function(_0x57f887){_0x35358d=path[_0xe2d6('0x22')](__dirname,_0xe2d6('0x23'),rs[_0xe2d6('0x24')](0x4)+_0xe2d6('0x37'));return convertFile(_0x13d3f7,_0x35358d);})['then'](function(){try{fs['unlink'](_0x13d3f7);fs[_0xe2d6('0x26')](_0x35358d,_0xe2d6('0x27'));}catch(_0x5874f2){logger[_0xe2d6('0x12')](_0x5874f2);}logger[_0xe2d6('0x38')](_0xe2d6('0x39'),_0x35358d['split']('.')[0x0]);return _0x35358d[_0xe2d6('0x28')]('.')[0x0];});};exports[_0xe2d6('0x3a')]=function(_0x390f8d,_0x284bb5){var _0x196200=_0xe2d6('0x3b');var _0x28a883,_0x3d02a2;var _0x5cde5a;var _0x2af1b3={'encoding':'utf8','method':_0xe2d6('0x33'),'timeout':0x2710,'url':_0x196200,'headers':{'Content-Type':_0xe2d6('0x3c')},'body':'f.req='+encodeURIComponent(JSON[_0xe2d6('0x3d')]([[[_0xe2d6('0x3e'),JSON[_0xe2d6('0x3d')]([_0x390f8d,_0x284bb5||'en',![],'null']),null,_0xe2d6('0x3f')]]]))};return rp(_0x2af1b3)[_0xe2d6('0x34')](function(_0x1c1b76){try{_0x5cde5a=eval(_0x1c1b76[_0xe2d6('0x40')](0x5))[0x0][0x2];}catch(_0x3db835){throw new Error(_0xe2d6('0x41')+_0x1c1b76[_0xe2d6('0x42')]);}if(!_0x5cde5a){if(_0x390f8d[_0xe2d6('0x43')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x284bb5+_0xe2d6('0x44'));}}try{_0x5cde5a=eval(_0x5cde5a)[0x0];}catch(_0x1a672b){throw new Error(_0xe2d6('0x41')+res[_0xe2d6('0x42')]);}const _0x5d9f42=_0x5cde5a;_0x28a883=path['resolve'](__dirname,_0xe2d6('0x23'),rs['generate'](0x4)+'.mp3');fs[_0xe2d6('0x45')](_0x28a883,_0x5cde5a,{'encoding':_0xe2d6('0x25')});_0x3d02a2=path[_0xe2d6('0x22')](__dirname,'tmp',rs[_0xe2d6('0x24')](0x4)+_0xe2d6('0x37'));return convertFile(_0x28a883,_0x3d02a2);})[_0xe2d6('0x34')](function(){try{fs[_0xe2d6('0x17')](_0x28a883);fs[_0xe2d6('0x26')](_0x3d02a2,_0xe2d6('0x27'));}catch(_0x1cef17){logger[_0xe2d6('0x12')](_0x1cef17);}logger['info']('goggleTTS\x20path',_0x3d02a2[_0xe2d6('0x28')]('.')[0x0]);return _0x3d02a2['split']('.')[0x0];});};exports[_0xe2d6('0x46')]=function(_0x180b44,_0x13a19d,_0xbeb035){return google[_0xe2d6('0x47')](_0x180b44,_0x13a19d,_0xbeb035)[_0xe2d6('0x34')](function(_0x55b296){logger[_0xe2d6('0x38')](_0x55b296[_0xe2d6('0x48')]);return rp(_0x55b296);})['then'](function(_0x153b6b){var _0x2e9256='';var _0x2d6240=0x0;try{fs[_0xe2d6('0x17')](_0x180b44);}catch(_0x54d9ef){logger[_0xe2d6('0x12')](_0x54d9ef);}if(_0x153b6b&&_0x153b6b[_0xe2d6('0x49')]){_0x2e9256=_0x153b6b[_0xe2d6('0x49')]['map'](function(_0x37d66e){return _0x37d66e&&_0x37d66e[_0xe2d6('0x4a')][0x0]&&_0x37d66e['alternatives'][0x0][_0xe2d6('0x4b')]?_0x37d66e[_0xe2d6('0x4a')][0x0][_0xe2d6('0x4b')]:'';})[_0xe2d6('0x4c')]('\x0a');_0x2d6240=_0x153b6b['results'][_0xe2d6('0x4d')](function(_0x5bee77){return _0x5bee77&&_0x5bee77[_0xe2d6('0x4a')][0x0]&&_0x5bee77[_0xe2d6('0x4a')][0x0]['confidence']?_0x5bee77[_0xe2d6('0x4a')][0x0][_0xe2d6('0x4e')]:0x0;})[_0xe2d6('0x4c')]('\x0a');}logger[_0xe2d6('0x38')]('googleASR\x20transcription',_0x2e9256);logger[_0xe2d6('0x38')]('googleASR\x20confidence',_0x2d6240);return{'transcript':_0x2e9256,'confidence':_0x2d6240};})['catch'](function(_0x3b9a0a){logger[_0xe2d6('0x12')](_0xe2d6('0x4f'),_0x3b9a0a[_0xe2d6('0x11')],_0x3b9a0a['name'],_0x3b9a0a[_0xe2d6('0x50')]);});};exports['googleDialogflow']=function(_0x4c4be3,_0x57077a,_0x47773d,_0x3c57bc){var _0x18a1df=apiai(_0x57077a,{'language':_0x3c57bc||'en'});return _0x18a1df['textRequest'](_0x47773d,{'sessionId':md5(_0x4c4be3)})[_0xe2d6('0x34')](function(_0x49114b){logger['info'](JSON[_0xe2d6('0x3d')](_0x49114b));return{'source':_0x49114b[_0xe2d6('0x51')][_0xe2d6('0x52')],'resolvedQuery':_0x49114b[_0xe2d6('0x51')][_0xe2d6('0x53')],'action':_0x49114b['result'][_0xe2d6('0x54')],'actionIncomplete':_0x49114b[_0xe2d6('0x51')][_0xe2d6('0x55')],'speech':_0x49114b['result'][_0xe2d6('0x56')][_0xe2d6('0x57')],'score':_0x49114b[_0xe2d6('0x51')][_0xe2d6('0x58')],'statusCode':_0x49114b[_0xe2d6('0x59')][_0xe2d6('0x5a')],'endConversation':_0x49114b[_0xe2d6('0x51')][_0xe2d6('0x5b')][_0xe2d6('0x5c')]||![],'isFallbackIntent':_0x49114b[_0xe2d6('0x51')]['metadata'][_0xe2d6('0x5d')]};});};exports['googleDialogflowV2']=function(_0x5dff33,_0x459e46,_0x230c14,_0x41f2fd,_0x25c857,_0x3928e8){var _0x5b98af=_0x41f2fd[_0xe2d6('0x5e')](/\\n/g,'\x0a');var _0x876ec6={'credentials':{'private_key':_0x5b98af,'client_email':_0x230c14}};var _0x2c528c=new dialogflow[(_0xe2d6('0x5f'))](_0x876ec6);var _0x1fa43a=_0x2c528c[_0xe2d6('0x60')](_0x459e46,md5(_0x5dff33));var _0x446f3e={'session':_0x1fa43a,'queryInput':{'text':{'text':_0x25c857,'languageCode':_0x3928e8}}};return _0x2c528c[_0xe2d6('0x61')](_0x446f3e)[_0xe2d6('0x34')](function(_0x48c476){if(_0x48c476&&_0x48c476['length']){logger[_0xe2d6('0x38')](_0xe2d6('0x62'),JSON[_0xe2d6('0x3d')](_0x48c476));var _0x2a8871=_0x48c476[0x0];if(_0x2a8871){var _0x1c6760={'action':_0x2a8871['queryResult'][_0xe2d6('0x54')],'allRequiredParamsPresent':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x64')],'endConversation':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x65')]&&_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x65')][_0xe2d6('0x66')]?_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x65')][_0xe2d6('0x66')][_0xe2d6('0x67')][_0xe2d6('0x68')]:![],'fulfillmentText':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x69')],'intentName':_0x2a8871['queryResult'][_0xe2d6('0x6a')][_0xe2d6('0x6b')],'intentDisplayName':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x6a')][_0xe2d6('0x6c')],'isFallbackIntent':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x6a')][_0xe2d6('0x6d')],'languageCode':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x6e')],'queryText':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x6f')],'responseId':_0x2a8871[_0xe2d6('0x70')],'score':_0x2a8871[_0xe2d6('0x63')][_0xe2d6('0x71')],'speech':_0x2a8871['queryResult'][_0xe2d6('0x69')],'providerResponse':JSON['stringify'](_0x48c476)};return _0x1c6760;}}});};exports[_0xe2d6('0x72')]=function(_0x37fc6d,_0x228be3,_0x1d53e1,_0x3e9e5b){return tilde[_0xe2d6('0x47')](_0x37fc6d,_0x228be3,_0x1d53e1,_0x3e9e5b)[_0xe2d6('0x34')](function(_0x1e277a){try{fs[_0xe2d6('0x17')](_0x37fc6d);}catch(_0x365c18){logger[_0xe2d6('0x12')](_0x365c18);}logger[_0xe2d6('0x38')]('Tilde\x20ASR\x20transcription',_0x1e277a[_0xe2d6('0x4b')]);logger[_0xe2d6('0x38')]('Tilde\x20ASR\x20confidence',_0x1e277a[_0xe2d6('0x4e')]);return _0x1e277a;});};exports[_0xe2d6('0x73')]=function(_0x15d8a0,_0x3c7e95,_0x5d1959,_0x2a3358,_0x59c274,_0x1959af){var _0x59cd31=path['resolve'](__dirname,'tmp',rs[_0xe2d6('0x24')](0x4)+_0xe2d6('0x74'));var _0x34b59a;return aws[_0xe2d6('0x75')](_0x15d8a0,_0x3c7e95,_0x5d1959,_0x2a3358,_0x59c274,_0x1959af,_0x59cd31)[_0xe2d6('0x34')](function(){_0x34b59a=path[_0xe2d6('0x22')](__dirname,'tmp',rs[_0xe2d6('0x24')](0x4)+_0xe2d6('0x37'));return convertFile(_0x59cd31,_0x34b59a);})[_0xe2d6('0x34')](function(){try{fs[_0xe2d6('0x17')](_0x59cd31);fs[_0xe2d6('0x26')](_0x34b59a,_0xe2d6('0x27'));}catch(_0xb1786e){logger[_0xe2d6('0x12')](_0xb1786e);}return _0x34b59a['split']('.')[0x0];});};exports[_0xe2d6('0x76')]=function(_0x161b9d,_0x3baa39,_0x20432d,_0x24548f,_0x103383,_0x1c9f36){return aws[_0xe2d6('0x77')](_0x161b9d,_0x3baa39,_0x20432d,_0x24548f,_0x103383,_0x1c9f36)[_0xe2d6('0x34')](function(_0x23cdf5){logger['info'](JSON[_0xe2d6('0x3d')](_0x23cdf5));return _0x23cdf5;});};exports[_0xe2d6('0x78')]=function(_0x281b3d,_0x464632,_0xc29040,_0x39ecdf){var _0x3be250=util[_0xe2d6('0x79')](_0xe2d6('0x7a'),ISPEECH_API,_0x281b3d,encodeURIComponent(_0x464632),_0xc29040,_0x39ecdf);var _0x22d740=path[_0xe2d6('0x22')](__dirname,'tmp',rs['generate'](0x4)+_0xe2d6('0x74'));var _0x578622;return downloadFile(_0x3be250,_0x22d740)[_0xe2d6('0x34')](function(){_0x578622=path[_0xe2d6('0x22')](__dirname,_0xe2d6('0x23'),rs['generate'](0x4)+_0xe2d6('0x37'));return convertFile(_0x22d740,_0x578622);})[_0xe2d6('0x34')](function(){try{fs[_0xe2d6('0x17')](_0x22d740);fs[_0xe2d6('0x26')](_0x578622,_0xe2d6('0x27'));}catch(_0x10aec3){logger[_0xe2d6('0x12')](_0x10aec3);}return _0x578622[_0xe2d6('0x28')]('.')[0x0];});};exports[_0xe2d6('0x7b')]=function(_0x497d91,_0x5a4923,_0x1040cc,_0x5eb5ba){var _0x2ec6e0=util[_0xe2d6('0x79')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x5a4923,_0x1040cc,base64Encode(_0x497d91),_0x5eb5ba?util[_0xe2d6('0x79')](_0xe2d6('0x7c'),encodeURIComponent(_0x5eb5ba)):'freeform=3');return uploadFile(_0x2ec6e0)[_0xe2d6('0x34')](function(_0x1d5c4b){return querystring[_0xe2d6('0x8')](_0x1d5c4b);});};exports['sestekNDA']=function(_0x78cf9d,_0x1568b7){return sestek[_0xe2d6('0x7d')](_0x78cf9d,_0x1568b7)[_0xe2d6('0x34')](function(_0x142c38){logger['info'](JSON[_0xe2d6('0x3d')](_0x142c38));var _0x43114a={'speech':_0x142c38[_0xe2d6('0x7e')],'action':_0x142c38[_0xe2d6('0x7f')]?_0x142c38[_0xe2d6('0x7f')]['CustomAction']:undefined,'actiondata':_0x142c38[_0xe2d6('0x7f')]?_0x142c38[_0xe2d6('0x7f')][_0xe2d6('0x80')]:undefined};if(_0x142c38['channelData']&&_0x142c38[_0xe2d6('0x7f')][_0xe2d6('0x81')]){return base64Decode(_0x142c38[_0xe2d6('0x7f')]['AudioFromTts'][_0xe2d6('0x82')],path['resolve'](__dirname,_0xe2d6('0x23'),rs['generate'](0x4)+_0xe2d6('0x37')))['then'](function(_0x5681c4){_0x43114a[_0xe2d6('0x83')]=_0x5681c4;return _0x43114a;});}return _0x43114a;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index ad34c14..00ac6f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44ee=['exports','./nda'];(function(_0x2cb5c4,_0x114ab1){var _0x524247=function(_0x4739c7){while(--_0x4739c7){_0x2cb5c4['push'](_0x2cb5c4['shift']());}};_0x524247(++_0x114ab1);}(_0x44ee,0x19f));var _0xe44e=function(_0x519fda,_0x3abd93){_0x519fda=_0x519fda-0x0;var _0x1ae06d=_0x44ee[_0x519fda];return _0x1ae06d;};var nda=require(_0xe44e('0x0'));module[_0xe44e('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x4bd2=['exports','./nda'];(function(_0x3a74b6,_0x43866e){var _0x1d20fb=function(_0x1f65f1){while(--_0x1f65f1){_0x3a74b6['push'](_0x3a74b6['shift']());}};_0x1d20fb(++_0x43866e);}(_0x4bd2,0xa9));var _0x24bd=function(_0x574fdb,_0x4db3fe){_0x574fdb=_0x574fdb-0x0;var _0x2e06e1=_0x4bd2[_0x574fdb];return _0x2e06e1;};var nda=require(_0x24bd('0x0'));module[_0x24bd('0x1')]={'nda':nda};
\ No newline at end of file
index 2a7d9fd..eec1b7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd52a=['info','stringify','url','agi','exports','POST','resolve','ndauth_url','password','/api/NaturalDialogAssistant/v1/Run','message','uniqueid','callerid','calleridname','dnid','access_token','project','body','channelData','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','custom_action_data'];(function(_0xe8b781,_0x183daa){var _0x55d314=function(_0x57c2ef){while(--_0x57c2ef){_0xe8b781['push'](_0xe8b781['shift']());}};_0x55d314(++_0x183daa);}(_0xd52a,0xca));var _0xad52=function(_0x394cee,_0x51b573){_0x394cee=_0x394cee-0x0;var _0x4b8255=_0xd52a[_0x394cee];return _0x4b8255;};'use strict';var rp=require('request-promise');var url=require(_0xad52('0x0'));var logger=require('../../../../../config/logger')(_0xad52('0x1'));module[_0xad52('0x2')]=function(_0x30b335,_0x572592){var _0x3f4207={'method':_0xad52('0x3'),'uri':url[_0xad52('0x4')](_0x572592[_0xad52('0x5')],'/token'),'form':{'grant_type':'password','username':_0x572592['username'],'password':_0x572592[_0xad52('0x6')]},'json':!![]};return rp(_0x3f4207)['then'](function(_0x23fc23){var _0x4bbff0={'method':_0xad52('0x3'),'uri':url[_0xad52('0x4')](_0x572592['ndassistant_url'],_0xad52('0x7')),'body':{'type':_0x572592['ndaactivity_type']||_0xad52('0x8'),'channelId':'Nda','conversation':{'id':_0x30b335[_0xad52('0x9')]},'from':{'id':_0x30b335[_0xad52('0xa')],'name':_0x30b335[_0xad52('0xb')]},'recipient':{'id':_0x30b335[_0xad52('0xc')],'name':_0x30b335['extension']},'text':_0x572592['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x23fc23[_0xad52('0xd')]},'json':!![]};if(_0x572592[_0xad52('0xe')]){_0x4bbff0[_0xad52('0xf')][_0xad52('0x10')][_0xad52('0x11')]=_0x572592[_0xad52('0xe')];}if(_0x572592[_0xad52('0x12')]=='1'){_0x4bbff0[_0xad52('0xf')][_0xad52('0x10')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xad52('0x13')};}if(_0x572592[_0xad52('0x14')]){_0x4bbff0[_0xad52('0xf')][_0xad52('0x10')][_0xad52('0x15')]=_0x572592[_0xad52('0x14')];if(_0x572592[_0xad52('0x16')]){_0x4bbff0[_0xad52('0xf')][_0xad52('0x10')]['CustomActionData']=_0x572592['custom_action_data'];}}logger[_0xad52('0x17')](JSON[_0xad52('0x18')](_0x4bbff0));return rp(_0x4bbff0);});};
\ No newline at end of file
+var _0x6c50=['then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','text','access_token','project','body','ProjectName','ndagenerate_audio','audio/wav','custom_action','CustomAction','channelData','CustomActionData','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','password','username'];(function(_0x3ca20e,_0x2c0d05){var _0x223408=function(_0x2b1af3){while(--_0x2b1af3){_0x3ca20e['push'](_0x3ca20e['shift']());}};_0x223408(++_0x2c0d05);}(_0x6c50,0xa4));var _0x06c5=function(_0x406766,_0x518bde){_0x406766=_0x406766-0x0;var _0x2cbc11=_0x6c50[_0x406766];return _0x2cbc11;};'use strict';var rp=require(_0x06c5('0x0'));var url=require(_0x06c5('0x1'));var logger=require(_0x06c5('0x2'))(_0x06c5('0x3'));module['exports']=function(_0xd66539,_0x494494){var _0x4271d1={'method':_0x06c5('0x4'),'uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0x6')],_0x06c5('0x7')),'form':{'grant_type':_0x06c5('0x8'),'username':_0x494494[_0x06c5('0x9')],'password':_0x494494[_0x06c5('0x8')]},'json':!![]};return rp(_0x4271d1)[_0x06c5('0xa')](function(_0x17c636){var _0x154b0a={'method':'POST','uri':url[_0x06c5('0x5')](_0x494494[_0x06c5('0xb')],_0x06c5('0xc')),'body':{'type':_0x494494[_0x06c5('0xd')]||'message','channelId':'Nda','conversation':{'id':_0xd66539['uniqueid']},'from':{'id':_0xd66539[_0x06c5('0xe')],'name':_0xd66539['calleridname']},'recipient':{'id':_0xd66539['dnid'],'name':_0xd66539['extension']},'text':_0x494494[_0x06c5('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x17c636[_0x06c5('0x10')]},'json':!![]};if(_0x494494[_0x06c5('0x11')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x13')]=_0x494494[_0x06c5('0x11')];}if(_0x494494[_0x06c5('0x14')]=='1'){_0x154b0a[_0x06c5('0x12')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x06c5('0x15')};}if(_0x494494[_0x06c5('0x16')]){_0x154b0a[_0x06c5('0x12')]['channelData'][_0x06c5('0x17')]=_0x494494[_0x06c5('0x16')];if(_0x494494['custom_action_data']){_0x154b0a[_0x06c5('0x12')][_0x06c5('0x18')][_0x06c5('0x19')]=_0x494494[_0x06c5('0x1a')];}}logger[_0x06c5('0x1b')](JSON[_0x06c5('0x1c')](_0x154b0a));return rp(_0x154b0a);});};
\ No newline at end of file
index 4b3cda0..a508bcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4379=['exports','./lib/api'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4379,0x1ad));var _0x9437=function(_0x279adb,_0x135c2c){_0x279adb=_0x279adb-0x0;var _0x28be9c=_0x4379[_0x279adb];return _0x28be9c;};'use strict';var asr=require(_0x9437('0x0'));module[_0x9437('0x1')]=function(_0xd201ae,_0x207a8a,_0x16bdfd,_0x5c5321){return asr(_0xd201ae,_0x207a8a,_0x16bdfd,_0x5c5321);};
\ No newline at end of file
+var _0xe86a=['./lib/api','exports'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0xe86a,0x82));var _0xae86=function(_0x44efe7,_0x31909f){_0x44efe7=_0x44efe7-0x0;var _0x1b2716=_0xe86a[_0x44efe7];return _0x1b2716;};'use strict';var asr=require(_0xae86('0x0'));module[_0xae86('0x1')]=function(_0x367752,_0x4a2eb1,_0x2dacdd,_0x3b771d){return asr(_0x367752,_0x4a2eb1,_0x2dacdd,_0x3b771d);};
\ No newline at end of file
index 62dfd58..8d6cc7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed3c=['crypto','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','lodash'];(function(_0xbb36a0,_0x1cb1e4){var _0x306db2=function(_0xc63ad3){while(--_0xc63ad3){_0xbb36a0['push'](_0xbb36a0['shift']());}};_0x306db2(++_0x1cb1e4);}(_0xed3c,0x13a));var _0xced3=function(_0x5dbb2,_0x1e3317){_0x5dbb2=_0x5dbb2-0x0;var _0x4ba922=_0xed3c[_0x5dbb2];return _0x4ba922;};'use strict';var BPromise=require('bluebird');var _=require(_0xced3('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xced3('0x1'));var logger=require('../../../../../../config/logger')('agi');module['exports']=function(_0x4cb513,_0x38ff8e,_0x3346c8,_0x2d8235){return new BPromise(function(_0x2ccd9a,_0x594fdd){logger[_0xced3('0x2')](_0xced3('0x3'),_0x2d8235||_0xced3('0x4'));var _0x33a56c=new WebSocket(_0x2d8235||_0xced3('0x4'),{'perMessageDeflate':![]});var _0x3dde0f='';var _0x5137d3='0';var _0x47b84c='1';var _0xea209b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x41a3e8(_0x49a275){var _0x59a01c=crypto['createHash']('sha1');_0x59a01c[_0xced3('0x5')](_0x49a275);return _0x59a01c[_0xced3('0x6')]('hex');}function _0x294309(){try{logger[_0xced3('0x2')](_0xced3('0x7'));var _0x34e167=moment()[_0xced3('0x8')]();var _0x3c06c4=_0x41a3e8(_0x34e167+_0x38ff8e+_0x3346c8);_0x33a56c[_0xced3('0x9')](JSON[_0xced3('0xa')]({'appID':_0x38ff8e,'timestamp':_0x34e167,'appKey':_0x3c06c4}));var _0x399632=fs[_0xced3('0xb')](_0x4cb513);_0x399632['on'](_0xced3('0xc'),function(_0xcab2d4){_0x33a56c[_0xced3('0x9')](_0xcab2d4);});_0x399632['on'](_0xced3('0xd'),function(){_0x33a56c[_0xced3('0x9')](_0xced3('0xe'));});}catch(_0x11c99d){logger[_0xced3('0xf')](_0xced3('0x10'),JSON[_0xced3('0xa')](_0x11c99d));_0x33a56c[_0xced3('0x11')]();}}function _0x3745f9(_0x259fa2){try{if(_0x259fa2){var _0x291ff1=JSON[_0xced3('0x12')](_0x259fa2);switch(_0x291ff1[_0xced3('0x13')]){case 0x0:if(_0x291ff1['result']){if(_0x291ff1[_0xced3('0x14')][_0xced3('0x15')]){logger[_0xced3('0x2')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0x291ff1[_0xced3('0x14')][_0xced3('0x16')]));_0x3dde0f=_0x291ff1['result'][_0xced3('0x16')][0x0][_0xced3('0x17')];_0x5137d3=_0x291ff1[_0xced3('0x14')]['hypotheses'][0x0][_0xced3('0x18')];_0x47b84c='0';_0xea209b=_0xced3('0x19');_0x33a56c['terminate']();}}break;case 0x1:logger[_0xced3('0x2')](_0xced3('0x1a'));_0x47b84c='1';_0xea209b=_0xced3('0x1a');break;case 0x2:logger[_0xced3('0x2')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x47b84c='2';_0xea209b=_0xced3('0x1b');break;case 0x9:logger[_0xced3('0x2')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x47b84c='9';_0xea209b='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xced3('0x1c'));_0x47b84c='10';_0xea209b=_0xced3('0x1c');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x47b84c='11';_0xea209b='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x1f6843){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xced3('0xa')](_0x1f6843));_0x33a56c[_0xced3('0x11')]();}}function _0x3ae47a(){logger[_0xced3('0x2')](_0xced3('0x1d'));_0x2ccd9a({'transcript':_0x3dde0f,'confidence':_0x5137d3,'status':_0x47b84c,'status_message':_0xea209b});}function _0x4c190c(_0xad3a06){logger['error'](_0xced3('0x1e'));if(!_[_0xced3('0x1f')](_0xad3a06)){logger[_0xced3('0xf')](_[_0xced3('0x20')](_0xad3a06)?JSON[_0xced3('0xa')](_0xad3a06):_0xad3a06);}}_0x33a56c['on'](_0xced3('0x21'),_0x294309);_0x33a56c['on'](_0xced3('0x22'),_0x3745f9);_0x33a56c['on'](_0xced3('0xd'),_0x3ae47a);_0x33a56c['on'](_0xced3('0xf'),_0x4c190c);});};
\ No newline at end of file
+var _0x39bc=['data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','status','result','final','transcript','hypotheses','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','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','sha1','update','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream'];(function(_0x2e4de6,_0x14e66f){var _0x25a586=function(_0x49dc7f){while(--_0x49dc7f){_0x2e4de6['push'](_0x2e4de6['shift']());}};_0x25a586(++_0x14e66f);}(_0x39bc,0x1ab));var _0xc39b=function(_0x23fe6a,_0x29ccaf){_0x23fe6a=_0x23fe6a-0x0;var _0x39ff31=_0x39bc[_0x23fe6a];return _0x39ff31;};'use strict';var BPromise=require(_0xc39b('0x0'));var _=require(_0xc39b('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xc39b('0x2'));var logger=require('../../../../../../config/logger')(_0xc39b('0x3'));module['exports']=function(_0x17ab7b,_0x3f8b9a,_0x1609d8,_0x53e790){return new BPromise(function(_0x490856,_0x652eaa){logger[_0xc39b('0x4')](_0xc39b('0x5'),_0x53e790||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x80ecb9=new WebSocket(_0x53e790||_0xc39b('0x6'),{'perMessageDeflate':![]});var _0x229d66='';var _0x2e84c5='0';var _0x2c108f='1';var _0x568ed9=_0xc39b('0x7');function _0x31112f(_0x31fba4){var _0x408088=crypto[_0xc39b('0x8')](_0xc39b('0x9'));_0x408088[_0xc39b('0xa')](_0x31fba4);return _0x408088['digest'](_0xc39b('0xb'));}function _0xcecdbe(){try{logger[_0xc39b('0x4')](_0xc39b('0xc'));var _0x1d45f9=moment()[_0xc39b('0xd')]();var _0x576645=_0x31112f(_0x1d45f9+_0x3f8b9a+_0x1609d8);_0x80ecb9[_0xc39b('0xe')](JSON[_0xc39b('0xf')]({'appID':_0x3f8b9a,'timestamp':_0x1d45f9,'appKey':_0x576645}));var _0x192e7d=fs[_0xc39b('0x10')](_0x17ab7b);_0x192e7d['on'](_0xc39b('0x11'),function(_0x44d87b){_0x80ecb9[_0xc39b('0xe')](_0x44d87b);});_0x192e7d['on'](_0xc39b('0x12'),function(){_0x80ecb9[_0xc39b('0xe')](_0xc39b('0x13'));});}catch(_0x386e04){logger[_0xc39b('0x14')](_0xc39b('0x15'),JSON[_0xc39b('0xf')](_0x386e04));_0x80ecb9[_0xc39b('0x16')]();}}function _0x139f76(_0x5203b3){try{if(_0x5203b3){var _0x55dd94=JSON['parse'](_0x5203b3);switch(_0x55dd94[_0xc39b('0x17')]){case 0x0:if(_0x55dd94[_0xc39b('0x18')]){if(_0x55dd94[_0xc39b('0x18')][_0xc39b('0x19')]){logger[_0xc39b('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0xc39b('0xf')](_0x55dd94[_0xc39b('0x18')]['hypotheses']));_0x229d66=_0x55dd94[_0xc39b('0x18')]['hypotheses'][0x0][_0xc39b('0x1a')];_0x2e84c5=_0x55dd94[_0xc39b('0x18')][_0xc39b('0x1b')][0x0][_0xc39b('0x1c')];_0x2c108f='0';_0x568ed9='Success.';_0x80ecb9[_0xc39b('0x16')]();}}break;case 0x1:logger[_0xc39b('0x4')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2c108f='1';_0x568ed9='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xc39b('0x4')](_0xc39b('0x1d'));_0x2c108f='2';_0x568ed9='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xc39b('0x4')](_0xc39b('0x1e'));_0x2c108f='9';_0x568ed9=_0xc39b('0x1e');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2c108f='10';_0x568ed9='Authentication\x20failed.';break;case 0xb:logger['info'](_0xc39b('0x1f'));_0x2c108f='11';_0x568ed9=_0xc39b('0x1f');}}}catch(_0xc2dc55){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xc39b('0xf')](_0xc2dc55));_0x80ecb9['terminate']();}}function _0x255805(){logger['info'](_0xc39b('0x20'));_0x490856({'transcript':_0x229d66,'confidence':_0x2e84c5,'status':_0x2c108f,'status_message':_0x568ed9});}function _0x391a15(_0x4d49c9){logger[_0xc39b('0x14')](_0xc39b('0x21'));if(!_['isNil'](_0x4d49c9)){logger[_0xc39b('0x14')](_[_0xc39b('0x22')](_0x4d49c9)?JSON['stringify'](_0x4d49c9):_0x4d49c9);}}_0x80ecb9['on'](_0xc39b('0x23'),_0xcecdbe);_0x80ecb9['on'](_0xc39b('0x24'),_0x139f76);_0x80ecb9['on'](_0xc39b('0x12'),_0x255805);_0x80ecb9['on']('error',_0x391a15);});};
\ No newline at end of file
index e2397eb..bca1ce3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a7a=['exports'];(function(_0x180ae3,_0x2d25d4){var _0x49f977=function(_0x386bf1){while(--_0x386bf1){_0x180ae3['push'](_0x180ae3['shift']());}};_0x49f977(++_0x2d25d4);}(_0x2a7a,0x1b5));var _0xa2a7=function(_0x515e00,_0x2c8dcd){_0x515e00=_0x515e00-0x0;var _0x5431ab=_0x2a7a[_0x515e00];return _0x5431ab;};var asr=require('./asr');module[_0xa2a7('0x0')]={'asr':asr};
\ No newline at end of file
+var _0xcf70=['exports','./asr'];(function(_0x4269ae,_0xbee855){var _0x43cbe8=function(_0xbeb349){while(--_0xbeb349){_0x4269ae['push'](_0x4269ae['shift']());}};_0x43cbe8(++_0xbee855);}(_0xcf70,0x6f));var _0x0cf7=function(_0x492a9b,_0x27ab67){_0x492a9b=_0x492a9b-0x0;var _0x47ae48=_0xcf70[_0x492a9b];return _0x47ae48;};var asr=require(_0x0cf7('0x0'));module[_0x0cf7('0x1')]={'asr':asr};
\ No newline at end of file
index 06cb90e..07fd54b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x3015f9,_0x6eeb0d){var _0x3390b6=function(_0x4cff57){while(--_0x4cff57){_0x3015f9['push'](_0x3015f9['shift']());}};_0x3390b6(++_0x6eeb0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);};
\ No newline at end of file
+var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x5545f7,_0x570414){var _0x52a979=function(_0x28eb97){while(--_0x28eb97){_0x5545f7['push'](_0x5545f7['shift']());}};_0x52a979(++_0x570414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);};
\ No newline at end of file
index 1ebcb9a..38e58f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3da6=['no\x20trunk\x20selected','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','maxdigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','streamFile','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','context','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','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\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment/shared','/var/opt/motion2/server/files','rawBody','menu','getdigits','getsecretdigits','rpc','prototype','getVariable','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getSound','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','mailRpc','getIntervalById','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agent','agentPause','agentUnpause','agentLogout','format','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','includes','POST','PUT','body','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','en-US','speed','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','hasOwnProperty','%s.%s','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','retry','mrcpsynth','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','googleDialogflow','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','unlink','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name'];(function(_0x5aff40,_0x27fbbb){var _0x2497cd=function(_0x29d6b2){while(--_0x29d6b2){_0x5aff40['push'](_0x5aff40['shift']());}};_0x2497cd(++_0x27fbbb);}(_0x3da6,0xc1));var _0x63da=function(_0x4fb993,_0x4fd8ef){_0x4fb993=_0x4fb993-0x0;var _0x348c09=_0x3da6[_0x4fb993];return _0x348c09;};'use strict';var fs=require('fs');var util=require(_0x63da('0x0'));var _=require(_0x63da('0x1'));var sh=require(_0x63da('0x2'));var odbc=require(_0x63da('0x3'))();var rs=require(_0x63da('0x4'));var moment=require(_0x63da('0x5'));var Mustache=require(_0x63da('0x6'));var rp=require('request-promise');var logger=require(_0x63da('0x7'))(_0x63da('0x8'));var config=require('../../config/environment');var shared=require(_0x63da('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x63da('0xa');var recursiveMapAttributes=['rawHeaders',_0x63da('0xb')];var verticesWithRetry=[_0x63da('0xc'),_0x63da('0xd'),_0x63da('0xe')];var AGIVertices=function(_0x48c470,_0x352ed2,_0xdc10c4){this['channel']=_0x48c470;this[_0x63da('0xf')]=_0x352ed2;this['mailRpc']=_0xdc10c4;};AGIVertices[_0x63da('0x10')][_0x63da('0x11')]=function(_0x1f545a,_0xbfba58){this[_0x63da('0xf')]['getVariableById'](_0x1f545a)[_0x63da('0x12')](function(_0x576ea2){_0xbfba58(null,_0x576ea2?_0x576ea2[_0x63da('0x13')]:![]);})[_0x63da('0x14')](function(_0x30d1bd){_0xbfba58(_0x30d1bd);});};AGIVertices[_0x63da('0x10')][_0x63da('0x15')]=function(_0x1d0330,_0x40c5cf){this[_0x63da('0xf')][_0x63da('0x16')](_0x1d0330)[_0x63da('0x12')](function(_0x3f141c){_0x40c5cf(null,_0x3f141c?_0x3f141c[_0x63da('0x13')]:![]);})[_0x63da('0x14')](function(_0x4e6084){_0x40c5cf(_0x4e6084);});};AGIVertices['prototype'][_0x63da('0x17')]=function(_0x5cf63d,_0x1f2f88){this[_0x63da('0xf')][_0x63da('0x18')](_0x5cf63d)[_0x63da('0x12')](function(_0xaf41cb){_0x1f2f88(null,_0xaf41cb?_0xaf41cb['name']:![]);})[_0x63da('0x14')](function(_0x562ca8){_0x1f2f88(_0x562ca8);});};AGIVertices['prototype'][_0x63da('0x19')]=function(_0x4a4cca,_0x18e457){this[_0x63da('0xf')][_0x63da('0x1a')](_0x4a4cca)['then'](function(_0xdeeb40){_0x18e457(null,_0xdeeb40?_0xdeeb40[_0x63da('0x1b')]:![]);})['catch'](function(_0x30d5ef){_0x18e457(_0x30d5ef);});};AGIVertices[_0x63da('0x10')][_0x63da('0x1c')]=function(_0x24ae30,_0x1e777b){this[_0x63da('0xf')][_0x63da('0x1d')](_0x24ae30)[_0x63da('0x12')](function(_0x430b35){_0x1e777b(null,_0x430b35?_0x430b35['name']:![]);})['catch'](function(_0xef0017){_0x1e777b(_0xef0017);});};AGIVertices[_0x63da('0x10')][_0x63da('0x1e')]=function(_0x45a021,_0x2eb31d){this[_0x63da('0xf')]['getTrunkById'](_0x45a021)[_0x63da('0x12')](function(_0x15d548){_0x2eb31d(null,_0x15d548?_0x15d548[_0x63da('0x13')]:![]);})[_0x63da('0x14')](function(_0x54acd0){_0x2eb31d(_0x54acd0);});};AGIVertices[_0x63da('0x10')][_0x63da('0x1f')]=function(_0x441337,_0x3505b0){var _0x8ed71e=this;this[_0x63da('0xf')][_0x63da('0x20')](_0x441337)['then'](function(_0x5a4628){_0x3505b0(null,_0x5a4628?_0x8ed71e[_0x63da('0x21')](_0x5a4628[_0x63da('0x22')]):![]);})[_0x63da('0x14')](function(_0xdcf3cb){_0x3505b0(_0xdcf3cb);});};AGIVertices[_0x63da('0x10')][_0x63da('0x23')]=function(_0x21530d,_0x152655){this['rpc']['getMailAccountById'](_0x21530d)[_0x63da('0x12')](function(_0x56e957){_0x152655(null,_0x56e957?_0x56e957:![]);})[_0x63da('0x14')](function(_0x2e2ec5){_0x152655(_0x2e2ec5);});};AGIVertices[_0x63da('0x10')][_0x63da('0x24')]=function(_0x347f24,_0x21f3fc,_0x1aa8ec){this[_0x63da('0x25')]['sendMailMessage'](_0x347f24,_0x21f3fc)['then'](function(){_0x1aa8ec(null);})['catch'](function(_0x373135){_0x1aa8ec(_0x373135);});};AGIVertices['prototype']['getIntervals']=function(_0x6bd77d,_0x1cb9e4){this[_0x63da('0xf')][_0x63da('0x26')](_0x6bd77d)[_0x63da('0x12')](function(_0x4ed257){if(_0x4ed257){if(_0x4ed257['IntervalId']){_0x1cb9e4(null,[_0x4ed257[_0x63da('0x27')]]);}else{_0x1cb9e4(null,_['map'](_0x4ed257[_0x63da('0x28')],_0x63da('0x27')));}}else{_0x1cb9e4(null,![]);}})[_0x63da('0x14')](function(_0x3a8bf6){_0x1cb9e4(_0x3a8bf6);});};AGIVertices[_0x63da('0x10')]['getSoundPath']=function(_0x57af0b){return util['format'](_0x63da('0x29'),FILES_PATH,_0x57af0b);};AGIVertices[_0x63da('0x10')][_0x63da('0x2a')]=function(_0x350fac,_0x4eeb0e,_0x5efe12){odbc[_0x63da('0x2b')](_0x350fac,function(_0x1f9515){if(_0x1f9515){logger[_0x63da('0x2c')](_0x63da('0x2d'),_0x1f9515);_0x5efe12(_0x1f9515);}else{logger[_0x63da('0x2e')](_0x63da('0x2f'));odbc[_0x63da('0x30')](_0x4eeb0e,function(_0x51c950,_0x5de2ad){if(_0x51c950){logger[_0x63da('0x2e')](_0x63da('0x31'),_0x4eeb0e);_0x5efe12(_0x51c950);}else{logger[_0x63da('0x2e')](_0x63da('0x32'),_0x4eeb0e);odbc[_0x63da('0x33')](function(_0x4caf77){if(_0x4caf77){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x4caf77);}_0x5efe12(null,_0x5de2ad);});}});}});};AGIVertices['prototype'][_0x63da('0x34')]=function(_0x52504f,_0xf439c6){this['rpc'][_0x63da('0x35')](_0x52504f)[_0x63da('0x12')](function(_0x576ca8){_0xf439c6(null,_0x576ca8?_0x576ca8:![]);})[_0x63da('0x14')](function(_0x5b08c8){_0xf439c6(_0x5b08c8);});};AGIVertices[_0x63da('0x10')]['createSmsMessage']=function(_0x50e6fa,_0xc175a4){this['rpc'][_0x63da('0x36')](_0x50e6fa)['then'](function(_0x4c8908){_0xc175a4(null,_0x4c8908);})['catch'](function(_0x31c35c){_0xc175a4(_0x31c35c);});};AGIVertices[_0x63da('0x10')]['createSquareDetailsReport']=function(_0x5b999c,_0x21481f,_0x262ec2){this[_0x63da('0xf')][_0x63da('0x37')]({'uniqueid':this[_0x63da('0x38')][_0x63da('0x39')],'node':_0x5b999c[_0x63da('0x3a')],'application':_0x5b999c[_0x63da('0x3b')],'data':_0x21481f||null,'project_name':this[_0x63da('0x38')][_0x63da('0x3c')],'callerid':this[_0x63da('0x38')][_0x63da('0x3d')]})['then'](function(_0x5783af){if(_0x262ec2){_0x262ec2(null,_0x5783af);}})['catch'](function(_0x30dbb2){if(_0x262ec2){_0x262ec2(_0x30dbb2);}});};AGIVertices['prototype'][_0x63da('0x3e')]=function(_0x3e301f,_0x168c4b,_0xa33243,_0x46d1e9){this[_0x63da('0xf')][_0x63da('0x3e')]({'uniqueid':this[_0x63da('0x38')]['uniqueid'],'callerid':this['channel']['callerid'],'calleridname':this[_0x63da('0x38')][_0x63da('0x3f')],'context':this[_0x63da('0x38')]['context'],'extension':this[_0x63da('0x38')][_0x63da('0x40')],'priority':this[_0x63da('0x38')][_0x63da('0x41')],'accountcode':this[_0x63da('0x38')][_0x63da('0x42')],'dnid':this['channel'][_0x63da('0x43')],'projectName':this[_0x63da('0x38')]['arg_1'],'saveName':_0x168c4b,'filename':_0x3e301f[_0x63da('0x44')]||_0x168c4b,'savePath':_0xa33243})[_0x63da('0x12')](function(_0x778284){_0x46d1e9(null,_0x778284);})[_0x63da('0x14')](function(_0x850a8){_0x46d1e9(_0x850a8);});};AGIVertices[_0x63da('0x10')]['createSquareMessage']=function(_0x8bb803,_0x55d9ed,_0xb11b7,_0x4e7c3d,_0x4ad7f0){this[_0x63da('0xf')][_0x63da('0x45')]({'uniqueid':this['channel'][_0x63da('0x39')],'body':_0x8bb803,'direction':_0x55d9ed,'providerName':_0xb11b7,'providerResponse':_0x4e7c3d})['then'](function(_0x4c7f48){if(_0x4ad7f0){_0x4ad7f0(null,_0x4c7f48);}})[_0x63da('0x14')](function(_0x529886){if(_0x4ad7f0){_0x4ad7f0(_0x529886);}});};AGIVertices['prototype'][_0x63da('0x46')]=function(_0x2fa3de,_0x1c5a4a){this[_0x63da('0xf')][_0x63da('0x46')]({'firstName':_[_0x63da('0x47')](_0x2fa3de[_0x63da('0x13')])||_[_0x63da('0x48')](_0x2fa3de[_0x63da('0x13')])?_0x63da('0x49')+Math['random']():_0x2fa3de[_0x63da('0x13')],'lastName':_[_0x63da('0x47')](_0x2fa3de[_0x63da('0x4a')])||_[_0x63da('0x48')](_0x2fa3de[_0x63da('0x4a')])?null:_0x2fa3de[_0x63da('0x4a')],'phone':_0x2fa3de[_0x63da('0x4b')],'ListId':_0x2fa3de[_0x63da('0x4c')],'scheduledat':_0x2fa3de[_0x63da('0x4d')],'callbackUniqueid':this[_0x63da('0x38')]['uniqueid'],'tags':_0x63da('0x4e'),'description':_0x63da('0x4f')+_0x2fa3de['scheduledAt'][_0x63da('0x50')](),'priority':_0x2fa3de[_0x63da('0x51')]})[_0x63da('0x12')](function(_0x2af76c){_0x1c5a4a(null,_0x2af76c);})[_0x63da('0x14')](function(_0xa5e7c){_0x1c5a4a(_0xa5e7c);});};AGIVertices[_0x63da('0x10')][_0x63da('0x52')]=function(_0x44fb23,_0x4c7427){this[_0x63da('0xf')][_0x63da('0x53')](_0x44fb23)[_0x63da('0x12')](function(_0x2908cb){_0x4c7427(null,_0x2908cb?_0x2908cb[_0x63da('0x13')]:![]);})[_0x63da('0x14')](function(_0x11bf43){_0x4c7427(_0x11bf43);});};AGIVertices[_0x63da('0x10')]['agentPause']=function(_0x93a6a3,_0x1e7a4a,_0x2bf285){var _0x215060={'role':_0x63da('0x54')};_0x215060[_0x93a6a3]=this['channel'][_0x63da('0x3d')];this['rpc'][_0x63da('0x55')](_0x215060,_0x1e7a4a,this[_0x63da('0x38')][_0x63da('0x39')])[_0x63da('0x12')](function(_0x2cce8e){_0x2bf285(null,_['isNil'](_0x2cce8e)?![]:!![]);})[_0x63da('0x14')](function(_0x2cdc3e){logger[_0x63da('0x2c')](_0x2cdc3e);_0x2bf285(null,![]);});};AGIVertices[_0x63da('0x10')]['agentUnpause']=function(_0x1738f9,_0x1573f9){var _0x2b3d94={'role':'agent'};_0x2b3d94[_0x1738f9]=this[_0x63da('0x38')][_0x63da('0x3d')];this['rpc'][_0x63da('0x56')](_0x2b3d94)[_0x63da('0x12')](function(_0x5b5a5c){_0x1573f9(null,_[_0x63da('0x48')](_0x5b5a5c)?![]:!![]);})[_0x63da('0x14')](function(_0x39a654){logger[_0x63da('0x2c')](_0x39a654);_0x1573f9(null,![]);});};AGIVertices[_0x63da('0x10')]['agentLogout']=function(_0x6b338b,_0x13cc1f){var _0x3a1921={'role':_0x63da('0x54')};_0x3a1921[_0x6b338b]=this[_0x63da('0x38')][_0x63da('0x3d')];this[_0x63da('0xf')][_0x63da('0x57')](_0x3a1921)[_0x63da('0x12')](function(_0x413d8b){_0x13cc1f(null,_[_0x63da('0x48')](_0x413d8b)?![]:!![]);})[_0x63da('0x14')](function(_0x5e7743){logger[_0x63da('0x2c')](_0x5e7743);_0x13cc1f(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x5a9005,_0x40b56f){var _0x1bd05a={'role':_0x63da('0x54')};_0x1bd05a[_0x5a9005]=this[_0x63da('0x38')][_0x63da('0x3d')];var _0x40e097=_0x5a9005!='internal'?util[_0x63da('0x58')]('%s/%s@from-sip/n',_0x63da('0x59'),this['channel']['callerid']):undefined;this[_0x63da('0xf')][_0x63da('0x5a')](_0x1bd05a,_0x40e097)[_0x63da('0x12')](function(_0x590e8a){_0x40b56f(null,_[_0x63da('0x48')](_0x590e8a)?![]:!![]);})[_0x63da('0x14')](function(_0x4158c2){logger[_0x63da('0x2c')](_0x4158c2);_0x40b56f(null,![]);});};AGIVertices[_0x63da('0x10')][_0x63da('0x5b')]=function(_0x5c04c1,_0x302459){sh[_0x63da('0x5c')](_[_0x63da('0x5d')](_0x5c04c1),function(_0x284510,_0x433346){var _0x500d00=_0x433346[_0x63da('0x5e')](/(\r\n|\n|\r)/gm,'');_0x302459(null,_0x500d00);});};AGIVertices[_0x63da('0x10')][_0x63da('0x5f')]=function(_0x2fc88c,_0x2cd400){scripts[_0x63da('0x5f')](_0x2fc88c[_0x63da('0x60')],_0x2fc88c[_0x63da('0x61')]||_0x63da('0x62'),_0x2fc88c[_0x63da('0x62')],_0x2fc88c['languageCode']||'en-US',_0x2fc88c[_0x63da('0x63')]||_0x63da('0x64'),_0x2fc88c[_0x63da('0x65')]||_0x63da('0x66'))[_0x63da('0x12')](function(_0x1620a2){_0x2cd400(null,_0x1620a2);})[_0x63da('0x14')](function(_0x548a50){_0x2cd400(_0x548a50);});};AGIVertices[_0x63da('0x10')]['googleTTS']=function(_0x31ef88,_0x1964e2){scripts[_0x63da('0x67')](_0x31ef88[_0x63da('0x62')],_0x31ef88[_0x63da('0x68')]||'en',0x1)['then'](function(_0x578913){_0x1964e2(null,_0x578913);})[_0x63da('0x14')](function(_0xc4678b){_0x1964e2(_0xc4678b);});};AGIVertices['prototype'][_0x63da('0x69')]=function(_0x4819a0,_0x2be19f){var _0x3d823f={'uri':_0x4819a0[_0x63da('0x6a')],'method':_0x4819a0[_0x63da('0x6b')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x4819a0['timeout'])==='number'&&parseInt(_0x4819a0['timeout'])>=0x1?parseInt(_0x4819a0[_0x63da('0x6c')])*0x3e8:0x5*0x3e8};if(_[_0x63da('0x6d')]([_0x63da('0x6e'),_0x63da('0x6f')],_0x3d823f[_0x63da('0x6b')]['toUpperCase']())){try{_0x3d823f[_0x63da('0x70')]=_0x4819a0[_0x63da('0xb')]?JSON[_0x63da('0x71')](_0x4819a0[_0x63da('0xb')]):{};}catch(_0x448a91){logger[_0x63da('0x2c')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x448a91);}}try{_0x3d823f[_0x63da('0x72')]=_0x4819a0[_0x63da('0x73')]?JSON[_0x63da('0x71')](_0x4819a0[_0x63da('0x73')]):{};}catch(_0x4f3934){logger['error'](_0x63da('0x74'),_0x4f3934);}if(_0x4819a0[_0x63da('0x75')]){try{var _0x4c85b6=require(_0x4819a0[_0x63da('0x75')])[_0x63da('0x76')](this,_0x3d823f);_0x3d823f[_0x63da('0x77')]=Mustache[_0x63da('0x78')](_0x4819a0[_0x63da('0x6a')],_0x4c85b6,{},['$$','$$']);if(_0x3d823f['headers']){_0x3d823f[_0x63da('0x72')]=JSON[_0x63da('0x71')](Mustache[_0x63da('0x78')](JSON[_0x63da('0x79')](_0x3d823f[_0x63da('0x72')]),_0x4c85b6,{},['$$','$$']));}if(_0x3d823f[_0x63da('0x70')]){_0x3d823f[_0x63da('0x70')]=JSON[_0x63da('0x71')](Mustache[_0x63da('0x78')](JSON[_0x63da('0x79')](_0x3d823f[_0x63da('0x70')]),_0x4c85b6,{},['$$','$$']));}}catch(_0x3520c2){logger[_0x63da('0x2c')](_0x63da('0x7a'),_0x3520c2);}}rp(_0x3d823f)[_0x63da('0x12')](function(_0x460cc2){var _0x2c74d6={'statusCode':_0x460cc2[_0x63da('0x7b')]||0xc8,'statusMessage':_0x460cc2[_0x63da('0x7c')]||'OK','headers':_0x460cc2[_0x63da('0x72')]||{},'body':_0x460cc2[_0x63da('0x70')]||{}};_0x2be19f(null,_0x2c74d6);})['catch'](function(_0xd066d3){var _0x34ef1b={'statusCode':_0xd066d3[_0x63da('0x7b')]||0x1f4,'statusMessage':_0xd066d3[_0x63da('0x7d')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0xd066d3['options'][_0x63da('0x72')]||{},'body':_0xd066d3[_0x63da('0x7e')][_0x63da('0x70')]||{}};_0x2be19f(null,_0x34ef1b);});};AGIVertices[_0x63da('0x10')]['googleDialogflow']=function(_0x24586b,_0x3cc2da){scripts['googleDialogflow'](this['channel']['uniqueid'],_0x24586b[_0x63da('0x7f')],_0x24586b[_0x63da('0x62')],_0x24586b[_0x63da('0x80')]||'en')[_0x63da('0x12')](function(_0x1118f1){_0x3cc2da(null,_0x1118f1);})[_0x63da('0x14')](function(_0x289d18){_0x3cc2da(_0x289d18);});};AGIVertices['prototype'][_0x63da('0x81')]=function(_0x232d59,_0x1d55d7){scripts[_0x63da('0x81')](this['channel'][_0x63da('0x39')],_0x232d59[_0x63da('0x82')],_0x232d59[_0x63da('0x83')],_0x232d59[_0x63da('0x84')],_0x232d59[_0x63da('0x62')],_0x232d59[_0x63da('0x85')]||'en')[_0x63da('0x12')](function(_0x1a2f84){_0x1d55d7(null,_0x1a2f84);})['catch'](function(_0x47ac2a){_0x1d55d7(_0x47ac2a);});};AGIVertices[_0x63da('0x10')][_0x63da('0x86')]=function(_0x3dd6fe,_0x386d83){scripts[_0x63da('0x86')](this[_0x63da('0x38')],_0x3dd6fe)[_0x63da('0x12')](function(_0x4c261f){_0x386d83(null,_0x4c261f);})[_0x63da('0x14')](function(_0x45ab7d){_0x386d83(_0x45ab7d);});};AGIVertices['prototype'][_0x63da('0x87')]=function(_0x46a2d7,_0x280076){scripts['ispeechTTS'](_0x46a2d7[_0x63da('0x7f')],_0x46a2d7[_0x63da('0x62')],_0x46a2d7[_0x63da('0x88')]||_0x63da('0x89'),_0x46a2d7[_0x63da('0x8a')])[_0x63da('0x12')](function(_0x53e0af){_0x280076(null,_0x53e0af);})['catch'](function(_0x5df7b2){_0x280076(_0x5df7b2);});};AGIVertices['prototype']['ispeechASR']=function(_0x3ae92a,_0x426893,_0x319f68){scripts['ispeechASR'](_0x426893,_0x3ae92a[_0x63da('0x7f')],_0x3ae92a[_0x63da('0x8b')]||_0x63da('0x89'),this[_0x63da('0x8c')](_0x3ae92a[_0x63da('0x8d')])?_0x3ae92a[_0x63da('0x8d')]:undefined)[_0x63da('0x12')](function(_0x5e10c4){_0x319f68(null,_0x5e10c4);})[_0x63da('0x14')](function(_0x548ae5){_0x319f68(_0x548ae5);});};AGIVertices[_0x63da('0x10')][_0x63da('0x8e')]=function(_0x3f682c,_0x3028e8){scripts[_0x63da('0x8e')](_0x3f682c[_0x63da('0x8f')],_0x3f682c[_0x63da('0x90')],_0x3f682c['aws_polly_region'],_0x3f682c[_0x63da('0x91')]||_0x63da('0x92'),_0x3f682c[_0x63da('0x62')],_0x3f682c[_0x63da('0x93')]||'text')[_0x63da('0x12')](function(_0x376391){_0x3028e8(null,_0x376391);})[_0x63da('0x14')](function(_0x23837d){_0x3028e8(_0x23837d);});};AGIVertices[_0x63da('0x10')][_0x63da('0x94')]=function(_0x48a820,_0x2582c9){scripts[_0x63da('0x94')](this['channel'][_0x63da('0x39')],_0x48a820[_0x63da('0x8f')],_0x48a820[_0x63da('0x90')],_0x48a820[_0x63da('0x95')],_0x48a820[_0x63da('0x62')],_0x48a820[_0x63da('0x96')])['then'](function(_0x548b03){_0x2582c9(null,_0x548b03);})[_0x63da('0x14')](function(_0x4e7638){_0x2582c9(_0x4e7638);});};AGIVertices[_0x63da('0x10')][_0x63da('0x97')]=function(_0x24021f,_0x4e4f1e,_0x46a5e2){scripts[_0x63da('0x97')](_0x4e4f1e,_0x24021f[_0x63da('0x7f')],_0x24021f[_0x63da('0x98')]||_0x63da('0x89'))[_0x63da('0x12')](function(_0x3901b1){_0x46a5e2(null,_0x3901b1);})[_0x63da('0x14')](function(_0x2020dd){_0x46a5e2(_0x2020dd);});};AGIVertices[_0x63da('0x10')][_0x63da('0x99')]=function(_0x254f9b,_0x45bfba,_0x4f63c1){scripts[_0x63da('0x99')](_0x45bfba,_0x254f9b[_0x63da('0x9a')],_0x254f9b['appsecret'],_0x254f9b[_0x63da('0x77')])[_0x63da('0x12')](function(_0x33b566){_0x4f63c1(null,_0x33b566);})[_0x63da('0x14')](function(_0x20e53a){_0x4f63c1(_0x20e53a);});};AGIVertices[_0x63da('0x10')][_0x63da('0x9b')]=function(_0x13077b){var _0x245658=_[_0x63da('0x6d')](verticesWithRetry,_0x13077b[_0x63da('0x3b')])?_0x13077b:_['clone'](_0x13077b);for(var _0x481d3f in _0x245658){if(_0x245658['hasOwnProperty'](_0x481d3f)){if(_0x245658[_0x481d3f]&&_['isString'](_0x245658[_0x481d3f])){if(_[_0x63da('0x6d')](recursiveMapAttributes,_0x481d3f)){_0x245658[_0x481d3f]=this['replaceObjectAllVariables'](_0x245658[_0x481d3f]);}else{_0x245658[_0x481d3f]=this[_0x63da('0x9c')](_0x245658[_0x481d3f]);}}}}return _0x245658;};AGIVertices[_0x63da('0x10')][_0x63da('0x9d')]=function(_0x1345c6){for(var _0x4d189d in _0x1345c6){if(_0x1345c6['hasOwnProperty'](_0x4d189d)){if(_[_0x63da('0x9e')](_0x1345c6[_0x4d189d])){this[_0x63da('0x9d')](_0x1345c6[_0x4d189d]);}else if(_[_0x63da('0x9f')](_0x1345c6[_0x4d189d])){for(var _0x1f54a8=0x0;_0x1f54a8<_0x1345c6[_0x4d189d][_0x63da('0xa0')];_0x1f54a8++){this[_0x63da('0x9d')](_0x1345c6[_0x4d189d][_0x1f54a8]);}}else if(_[_0x63da('0xa1')](_0x1345c6[_0x4d189d])){_0x1345c6[_0x4d189d]=this[_0x63da('0x9c')](_0x1345c6[_0x4d189d]);}}}};AGIVertices[_0x63da('0x10')][_0x63da('0xa2')]=function(_0x4d50d2,_0x2f4007){for(var _0x2cfe83 in _0x4d50d2){if(_0x4d50d2[_0x63da('0xa3')](_0x2cfe83)){if(_[_0x63da('0x9e')](_0x4d50d2[_0x2cfe83])){if(!_[_0x63da('0x47')](_0x4d50d2[_0x2cfe83])){this[_0x63da('0xa2')](_0x4d50d2[_0x2cfe83],util[_0x63da('0x58')](_0x63da('0xa4'),_0x2f4007,_0x2cfe83));}}else if(_['isArray'](_0x4d50d2[_0x2cfe83])){for(var _0x28ddc0=0x0;_0x28ddc0<_0x4d50d2[_0x2cfe83]['length'];_0x28ddc0++){this[_0x63da('0xa2')](_0x4d50d2[_0x2cfe83][_0x28ddc0],util[_0x63da('0x58')](_0x63da('0xa4'),_0x2f4007,_0x2cfe83+'['+_0x28ddc0+']'));}}else{if(!_['isNil'](_0x4d50d2[_0x2cfe83])){this[_0x63da('0x38')]['setVariable'](util[_0x63da('0x58')]('%s.%s',_0x2f4007,_0x2cfe83),_0x4d50d2[_0x2cfe83]);}}}}};AGIVertices[_0x63da('0x10')]['replaceObjectAllVariables']=function(_0x2fb628){try{var _0x46efca=JSON[_0x63da('0x71')](_0x2fb628);this['recursiveNodeIndex'](_0x46efca);return JSON[_0x63da('0x79')](_0x46efca);}catch(_0x38c72b){return this[_0x63da('0x9c')](_0x2fb628);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x2c690e){var _0x3db2d2=_0x2c690e['split']('{');for(var _0x2217bf=0x1;_0x2217bf<_0x3db2d2[_0x63da('0xa0')];_0x2217bf+=0x1){var _0x25f499=_0x3db2d2[_0x2217bf][_0x63da('0xa5')]('}');if(_0x25f499[_0x63da('0xa0')]>0x1){_0x2c690e=_0x2c690e[_0x63da('0xa6')]('{'+_0x25f499[0x0]+'}',this[_0x63da('0x38')][_0x63da('0x11')](_0x25f499[0x0])[_0x63da('0xa7')]||_0x25f499[0x0]);}}if(_0x3db2d2[_0x63da('0xa0')]===0x1){return _0x2c690e['toString']();}return this[_0x63da('0x9c')](_0x2c690e);};AGIVertices[_0x63da('0x10')][_0x63da('0xa8')]=function(_0x1305a5,_0x1c1bb2){var _0x5e4b66=this[_0x63da('0x38')][_0x63da('0x11')](_0x1305a5);if(_0x5e4b66[_0x63da('0xa9')]===-0x1){return _0x5e4b66;}logger['info'](util['format'](_0x63da('0xaa'),_0x1c1bb2,_0x5e4b66[_0x63da('0xa7')]));return this[_0x63da('0x38')][_0x63da('0xab')](_0x1c1bb2,_0x5e4b66['extra']);};AGIVertices[_0x63da('0x10')]['isConfigured']=function(_0x40992e){return _0x40992e&&_0x40992e!=='0'&&_0x40992e!=='-1'&&_0x40992e!=='';};AGIVertices['prototype'][_0x63da('0xac')]=function(_0xd0f241){this[_0x63da('0x37')][_0x63da('0x76')](this,_0xd0f241,'-');_0xd0f241[_0x63da('0xad')]=_0xd0f241[_0x63da('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x63da('0x10')][_0x63da('0xae')]=function(_0x2f9908){logger[_0x63da('0x2e')](util[_0x63da('0x58')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x2f9908[_0x63da('0x3a')]));if(!this['isConfigured'](_0x2f9908[_0x63da('0x62')])){return this[_0x63da('0x38')][_0x63da('0xaf')]('no\x20text\x20configured');}var _0x4a6d67='\x22'+_0x2f9908[_0x63da('0x62')]+'\x22';if(this[_0x63da('0x8c')](_0x2f9908[_0x63da('0x7e')])){_0x4a6d67+=','+_0x2f9908['options'];}var _0x2c639f=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xb0'),_0x4a6d67);if(_0x2c639f['result']===-0x1){return _0x2c639f;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x4a6d67));};AGIVertices[_0x63da('0x10')][_0x63da('0xb1')]=function(_0x169e34){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xb2'),_0x169e34[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x169e34[_0x63da('0xb3')])){return this['channel'][_0x63da('0xaf')](_0x63da('0xb4'));}var _0x29348b=_0x169e34[_0x63da('0xb3')];if(this[_0x63da('0x8c')](_0x169e34[_0x63da('0x7e')])){_0x29348b+=','+_0x169e34['options'];}var _0x42e36d=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xb5'),_0x29348b);if(_0x42e36d[_0x63da('0xa9')]===-0x1){return _0x42e36d;}var _0x27e51a=this[_0x63da('0xa8')](_0x63da('0xb6'),'MRCP_RECOG_CONFIDENCE');if(_0x27e51a['result']===-0x1){return _0x27e51a;}var _0x2cbbbb=this[_0x63da('0xa8')](_0x63da('0xb7'),_0x63da('0xb8'));if(_0x2cbbbb[_0x63da('0xa9')]===-0x1){return _0x2cbbbb;}var _0xfd8c3b=this[_0x63da('0xa8')](_0x63da('0xb9'),'MRCP_RECOG_INSTANCE');if(_0xfd8c3b[_0x63da('0xa9')]===-0x1){return _0xfd8c3b;}return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')]('Executed\x20command\x20MRCPRecog\x20%s',_0x29348b));};AGIVertices[_0x63da('0x10')]['agi']=function(_0x52eda0){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xba'),_0x52eda0[_0x63da('0x3a')]));return this[_0x63da('0x38')][_0x63da('0x8')]([_0x52eda0[_0x63da('0xbb')],_0x52eda0[_0x63da('0xbc')]]);};AGIVertices[_0x63da('0x10')]['answer']=function(_0x248a5b){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xbd'),_0x248a5b['label']));if(this[_0x63da('0x8c')](_0x248a5b[_0x63da('0x6c')])){logger[_0x63da('0x2e')](util['format'](_0x63da('0xbe'),_0x248a5b[_0x63da('0x6c')]));var _0x32f708=this['channel'][_0x63da('0xbf')](_0x248a5b[_0x63da('0x6c')]);if(_0x32f708[_0x63da('0xa9')]===-0x1){return _0x32f708;}}return this['channel'][_0x63da('0xc0')]();};AGIVertices[_0x63da('0x10')][_0x63da('0x4e')]=function(_0x12db47){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x12db47[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x12db47[_0x63da('0x4c')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x12db47,'no\x20list\x20selected');}_0x12db47['scheduledAt']=moment();if(this[_0x63da('0x8c')](_0x12db47['delay'])){_0x12db47[_0x63da('0x4d')]=moment()['add'](_0x12db47[_0x63da('0xc1')],_0x63da('0xc2'));}if(!this['isConfigured'](_0x12db47[_0x63da('0x51')])){_0x12db47[_0x63da('0x51')]=0x2;}this[_0x63da('0x46')][_0x63da('0x76')](this,_0x12db47);return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xc3'),_0x12db47[_0x63da('0x4b')],_0x12db47[_0x63da('0x4c')],_0x12db47[_0x63da('0x4d')]));};AGIVertices[_0x63da('0x10')][_0x63da('0xc4')]=function(_0x4723d5){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xc5'),_0x4723d5[_0x63da('0x3a')]));var _0x38cc0f=this[_0x63da('0x38')][_0x63da('0x5c')](_0x4723d5[_0x63da('0xc6')],_0x4723d5['options']);if(_0x38cc0f[_0x63da('0xa9')]===-0x1){return _0x38cc0f;}return this[_0x63da('0x38')][_0x63da('0xaf')](util['format'](_0x63da('0xc7'),_0x4723d5[_0x63da('0xc6')],_0x4723d5[_0x63da('0x7e')]));};AGIVertices[_0x63da('0x10')][_0x63da('0xc8')]=function(_0x18d492){logger[_0x63da('0x2e')](util['format'](_0x63da('0xc9'),_0x18d492[_0x63da('0x3a')]));if(!this['isConfigured'](_0x18d492[_0x63da('0x62')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x405c69='\x22'+_0x18d492[_0x63da('0x62')]+'\x22';if(this[_0x63da('0x8c')](_0x18d492[_0x63da('0x7e')])){_0x405c69+=','+_0x18d492[_0x63da('0x7e')];}var _0x3ac473=this[_0x63da('0x38')]['exec']('MRCPSynth',_0x405c69);if(_0x3ac473['result']===-0x1){return _0x3ac473;}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xca'),_0x405c69));};AGIVertices[_0x63da('0x10')][_0x63da('0xcb')]=function(_0x25f4bd){logger[_0x63da('0x2e')](util['format'](_0x63da('0xcc'),_0x25f4bd['label']));if(!this[_0x63da('0x8c')](_0x25f4bd[_0x63da('0x62')])){return this['channel'][_0x63da('0xaf')](_0x63da('0xcd'));}var _0x229442='\x22'+_0x25f4bd['text']+'\x22';if(this[_0x63da('0x8c')](_0x25f4bd[_0x63da('0x7e')])){_0x229442+=','+_0x25f4bd[_0x63da('0x7e')];}var _0x23e855=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xb0'),_0x229442);if(_0x23e855['result']===-0x1){return _0x23e855;}return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0xca'),_0x229442));};AGIVertices['prototype']['lumenvoxasr']=function(_0x4595cc){logger[_0x63da('0x2e')](util[_0x63da('0x58')]('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x4595cc[_0x63da('0x3a')]));if(!this['isConfigured'](_0x4595cc[_0x63da('0xb3')])){return this['channel'][_0x63da('0xaf')](_0x63da('0xb4'));}var _0x208d5e=_0x4595cc['grammar'];if(this['isConfigured'](_0x4595cc[_0x63da('0x7e')])){_0x208d5e+=','+_0x4595cc[_0x63da('0x7e')];}var _0x508bbf=this[_0x63da('0x38')][_0x63da('0x5c')]('MRCPRecog',_0x208d5e);if(_0x508bbf[_0x63da('0xa9')]===-0x1){return _0x508bbf;}var _0x47878d=this[_0x63da('0xa8')](_0x63da('0xb6'),_0x63da('0xce'));if(_0x47878d[_0x63da('0xa9')]===-0x1){return _0x47878d;}var _0x4df925=this[_0x63da('0xa8')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x4df925[_0x63da('0xa9')]===-0x1){return _0x4df925;}var _0x25e61d=this[_0x63da('0xa8')](_0x63da('0xb9'),_0x63da('0xcf'));if(_0x25e61d[_0x63da('0xa9')]===-0x1){return _0x25e61d;}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xd0'),_0x208d5e));};AGIVertices[_0x63da('0x10')][_0x63da('0xd1')]=function(_0x43d0cb){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xd2'),_0x43d0cb['label']));if(!this[_0x63da('0x8c')](_0x43d0cb[_0x63da('0xb3')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xb4'));}var _0x3f2a56=_0x43d0cb['grammar'];if(this[_0x63da('0x8c')](_0x43d0cb[_0x63da('0x7e')])){_0x3f2a56+=','+_0x43d0cb[_0x63da('0x7e')];}var _0x26b276=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xb5'),_0x3f2a56);if(_0x26b276[_0x63da('0xa9')]===-0x1){return _0x26b276;}var _0x1227ca=this[_0x63da('0xa8')](_0x63da('0xb6'),_0x63da('0xd3'));if(_0x1227ca['result']===-0x1){return _0x1227ca;}var _0x205817=this[_0x63da('0xa8')](_0x63da('0xb7'),'SESTEK_ASR_TRANSCRIPT');if(_0x205817[_0x63da('0xa9')]===-0x1){return _0x205817;}var _0x1de78d=this[_0x63da('0xa8')](_0x63da('0xb9'),_0x63da('0xd4'));if(_0x1de78d['result']===-0x1){return _0x1de78d;}return this[_0x63da('0x38')][_0x63da('0xaf')](util['format'](_0x63da('0xd0'),_0x3f2a56));};AGIVertices[_0x63da('0x10')][_0x63da('0xd5')]=function(_0x5e38e0){logger[_0x63da('0x2e')](util[_0x63da('0x58')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5e38e0[_0x63da('0x3a')]));if(!this['isConfigured'](_0x5e38e0[_0x63da('0xd6')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x5e38e0,_0x63da('0xd7'));}var _0x542811=this[_0x63da('0x19')][_0x63da('0x76')](this,_0x5e38e0[_0x63da('0xd6')]);if(!_0x542811){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x5e38e0,'no\x20odbc\x20database\x20found');}if(!this[_0x63da('0x8c')](_0x5e38e0[_0x63da('0x30')])){return this[_0x63da('0x38')]['error'](_0x5e38e0,'no\x20query\x20configured');}var _0x1b1870=_0x5e38e0[_0x63da('0x30')][_0x63da('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this[_0x63da('0x38')][_0x63da('0xaf')](util['format'](_0x63da('0xd8'),_0x1b1870));var _0x347b37=this[_0x63da('0x2a')][_0x63da('0x76')](this,_0x542811,_0x1b1870);this['createSquareDetailsReport'][_0x63da('0x76')](this,_0x5e38e0,_0x1b1870);if(!this['isConfigured'](_0x5e38e0[_0x63da('0xd9')])){return this['channel']['noop'](_0x63da('0xda'));}var _0x239c4b=this[_0x63da('0x11')][_0x63da('0x76')](this,_0x5e38e0[_0x63da('0xd9')]);if(!_0x239c4b){return this[_0x63da('0x38')]['error'](_0x5e38e0,'no\x20variable\x20found');}var _0x46d1ca=this;_0x347b37[_0x63da('0xdb')](function(_0x495e8f,_0x3d2d40){Object['keys'](_0x495e8f)['forEach'](function(_0x4c754e){_0x46d1ca['channel'][_0x63da('0xab')](util[_0x63da('0x58')]('%s[%s][%s]',_0x239c4b,_0x3d2d40,_0x4c754e),_0x495e8f[_0x4c754e]);});});this[_0x63da('0x38')]['setVariable'](util[_0x63da('0x58')](_0x63da('0xdc'),_0x239c4b),_0x347b37[_0x63da('0xa0')]);return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xdd'),_0x239c4b));};AGIVertices[_0x63da('0x10')][_0x63da('0xde')]=function(_0x193909){logger[_0x63da('0xdf')](util[_0x63da('0x58')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x193909[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x193909[_0x63da('0xe0')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x193909,'no\x20user\x20selected');}var _0x26e864=this[_0x63da('0x1c')][_0x63da('0x76')](this,_0x193909[_0x63da('0xe0')]);if(!_0x26e864){return this[_0x63da('0x38')]['error'](_0x193909,_0x63da('0xe1'));}var _0x2cdcf6=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xe2'),[util['format'](_0x63da('0xe3'),_0x26e864),_0x193909[_0x63da('0x6c')],_0x193909[_0x63da('0xe4')],_0x193909[_0x63da('0x6a')]]);if(_0x2cdcf6[_0x63da('0xa9')]===-0x1){return _0x2cdcf6;}return this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')]('Executed\x20command\x20%s',_0x63da('0xe2')));};AGIVertices[_0x63da('0x10')][_0x63da('0xe5')]=function(_0x586c3a){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xe6'),_0x586c3a[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x586c3a[_0x63da('0x7f')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xe7'));}if(!this['isConfigured'](_0x586c3a[_0x63da('0x62')])){return this[_0x63da('0x38')][_0x63da('0xaf')]('no\x20text\x20configured');}this[_0x63da('0x38')]['bot']=!![];this[_0x63da('0x37')](_0x586c3a);this[_0x63da('0x45')](_0x586c3a[_0x63da('0x62')],'in','','');this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xe8'),_0x586c3a[_0x63da('0x62')]));var _0x4a9f20=this[_0x63da('0xe9')][_0x63da('0x76')](this,_0x586c3a);if(_0x4a9f20){for(var _0x5cbd4b in _0x4a9f20){if(_0x4a9f20[_0x63da('0xa3')](_0x5cbd4b)){this[_0x63da('0x38')][_0x63da('0xab')](util[_0x63da('0x58')](_0x63da('0xea'),_0x5cbd4b[_0x63da('0xeb')]()),_0x4a9f20[_0x5cbd4b]);}}this[_0x63da('0x45')](_0x4a9f20[_0x63da('0xec')],_0x63da('0xed'),_0x63da('0xe5'),'');return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xee'),_0x4a9f20['speech']));}return this[_0x63da('0x38')]['error'](_0x586c3a,_0x63da('0xef'));};AGIVertices[_0x63da('0x10')]['dialogflowV2']=function(_0x457e08){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0xf0'),_0x457e08[_0x63da('0x3a')]));if(!this['isConfigured'](_0x457e08[_0x63da('0x82')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xf1'));}if(!this[_0x63da('0x8c')](_0x457e08[_0x63da('0x83')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xf2'));}if(!this['isConfigured'](_0x457e08[_0x63da('0x84')])){return this[_0x63da('0x38')]['noop'](_0x63da('0xf3'));}if(!this[_0x63da('0x8c')](_0x457e08[_0x63da('0x85')])){return this['channel'][_0x63da('0xaf')]('no\x20anguage\x20configured');}if(!this[_0x63da('0x8c')](_0x457e08['text'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xcd'));}this[_0x63da('0x38')][_0x63da('0xf4')]=!![];this[_0x63da('0x37')](_0x457e08);this[_0x63da('0x45')](_0x457e08[_0x63da('0x62')],'in','','');this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xf5'),_0x457e08[_0x63da('0x62')]));var _0x55faa5=this[_0x63da('0x81')][_0x63da('0x76')](this,_0x457e08);if(_0x55faa5){for(var _0x3868d9 in _0x55faa5){if(_0x55faa5[_0x63da('0xa3')](_0x3868d9)){if(_0x3868d9!==_0x63da('0xf6')){this[_0x63da('0x38')][_0x63da('0xab')](util['format'](_0x63da('0xea'),_0x3868d9[_0x63da('0xeb')]()),_0x55faa5[_0x3868d9]);}}}this[_0x63da('0x45')](_0x55faa5[_0x63da('0xec')],_0x63da('0xed'),_0x63da('0xf7'),_0x55faa5[_0x63da('0xf6')]);return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0xf8'),_0x55faa5[_0x63da('0xec')]));}return this[_0x63da('0x38')][_0x63da('0x2c')](_0x457e08,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x63da('0x10')][_0x63da('0xf9')]=function(_0xce4144){logger['info'](util[_0x63da('0x58')](_0x63da('0xfa'),_0xce4144['label']));if(!this[_0x63da('0x8c')](_0xce4144['ndauth_url'])){return this[_0x63da('0x38')]['noop'](_0x63da('0xfb'));}if(!this['isConfigured'](_0xce4144[_0x63da('0xfc')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xfd'));}if(!this[_0x63da('0x8c')](_0xce4144['password'])){return this['channel'][_0x63da('0xaf')](_0x63da('0xfe'));}if(!this[_0x63da('0x8c')](_0xce4144[_0x63da('0xff')])){return this[_0x63da('0x38')]['noop'](_0x63da('0xcd'));}this[_0x63da('0x38')]['bot']=!![];this[_0x63da('0x37')](_0xce4144);this[_0x63da('0x45')](_0xce4144['text'],'in','','');this[_0x63da('0x38')][_0x63da('0xaf')](util['format']('Trying\x20SestekNDA:\x20%s',_0xce4144[_0x63da('0x62')]));var _0x259f8e=this[_0x63da('0x86')]['sync'](this,_0xce4144);if(_0x259f8e){for(var _0x453671 in _0x259f8e){if(_0x259f8e[_0x63da('0xa3')](_0x453671)){this[_0x63da('0x38')][_0x63da('0xab')](util[_0x63da('0x58')](_0x63da('0x100'),_0x453671['toUpperCase']()),_0x259f8e[_0x453671]);}}this['createSquareMessage'](_0x259f8e[_0x63da('0xec')],_0x63da('0xed'),_0x63da('0xf9'),'');if(_0x259f8e['audiofile']){this[_0x63da('0x38')][_0x63da('0xaf')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x259f8e['audiofile']));var _0x2f3a6e=this[_0x63da('0x38')]['streamFile'](_0x259f8e[_0x63da('0x101')]);try{fs[_0x63da('0x102')](_0x259f8e[_0x63da('0x101')]+'.wav');}catch(_0x2aaf77){logger['error'](_0x2aaf77);}return _0x2f3a6e;}else{return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0x103'),_0x259f8e[_0x63da('0xec')]));}}return this[_0x63da('0x38')][_0x63da('0x2c')](_0xce4144,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0x63da('0x10')][_0x63da('0x104')]=function(_0x8c7471){logger['info'](util[_0x63da('0x58')](_0x63da('0x105'),_0x8c7471[_0x63da('0x3a')]));return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x104'));};AGIVertices[_0x63da('0x10')]['ext_dial']=function(_0xb89b9a){logger[_0x63da('0x2e')](util['format'](_0x63da('0x106'),_0xb89b9a[_0x63da('0x3a')]));var _0x570b49='';if(_0xb89b9a[_0x63da('0x107')]){if(!this[_0x63da('0x8c')](_0xb89b9a[_0x63da('0x107')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0xb89b9a,'no\x20trunk\x20selected');}else{var _0x59b7d4=parseInt(_0xb89b9a[_0x63da('0x107')],0xa);if(isNaN(_0x59b7d4)){_0x570b49=_0xb89b9a[_0x63da('0x107')];}else{_0x570b49=this[_0x63da('0x1e')][_0x63da('0x76')](this,_0xb89b9a[_0x63da('0x107')]);if(!_0x570b49){return this[_0x63da('0x38')][_0x63da('0x2c')](_0xb89b9a,_0x63da('0x108'));}}}}else if(_0xb89b9a['trunk_name']){_0x570b49=_0xb89b9a[_0x63da('0x109')];}else{return this[_0x63da('0x38')]['error'](_0xb89b9a,_0x63da('0x10a'));}var _0x299c41=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0xe2'),[util[_0x63da('0x58')](_0x63da('0x10b'),_0x570b49,_0xb89b9a['phone']),_0xb89b9a[_0x63da('0x6c')],_0xb89b9a[_0x63da('0xe4')],_0xb89b9a[_0x63da('0x6a')]]);if(_0x299c41[_0x63da('0xa9')]===-0x1){return _0x299c41;}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x10c'),_0x63da('0xe2')));};AGIVertices[_0x63da('0x10')][_0x63da('0x10d')]=function(_0x3100c7){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x10e'),_0x3100c7[_0x63da('0x3a')]));return this['channel'][_0x63da('0xaf')](_0x63da('0x10d'));};AGIVertices[_0x63da('0x10')][_0x63da('0xd')]=function(_0x42d205){logger[_0x63da('0x2e')](util['format'](_0x63da('0x10f'),_0x42d205[_0x63da('0x3a')]));if(_0x42d205[_0x63da('0xad')]===0x0){return this[_0x63da('0xac')](_0x42d205);}_0x42d205[_0x63da('0xad')]-=0x1;if(!this[_0x63da('0x8c')](_0x42d205[_0x63da('0x110')])){return this[_0x63da('0x38')]['error'](_0x42d205,_0x63da('0x111'));}var _0x5dd838=this['getSound']['sync'](this,_0x42d205['file_id']);if(!_0x5dd838){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x42d205,'no\x20file\x20audio\x20found');}if(!this[_0x63da('0x8c')](_0x42d205['variable_id'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x63da('0xda'));}var _0x2b86be=this[_0x63da('0x38')][_0x63da('0x112')](_0x5dd838,_0x42d205[_0x63da('0x113')],_0x42d205['maxdigit']);var _0x1907a3=_0x2b86be[_0x63da('0xa9')]?_0x2b86be[_0x63da('0xa9')][_0x63da('0x50')]():'';logger[_0x63da('0x2e')](_0x63da('0x114'),JSON['stringify'](_0x2b86be));if(_0x2b86be[_0x63da('0xa9')]===-0x1){this['createSquareDetailsReport'][_0x63da('0x76')](this,_0x42d205,_0x1907a3);return _0x2b86be;}else if(_0x2b86be[_0x63da('0xa7')]===_0x63da('0x6c')){_0x2b86be['result']=_0x1907a3['length']>=parseInt(_0x42d205['mindigit'])?'x':'i';}else{_0x2b86be['result']=_0x1907a3['length']>=parseInt(_0x42d205[_0x63da('0x115')])&&_0x1907a3[_0x63da('0xa0')]<=parseInt(_0x42d205[_0x63da('0x116')])?'x':'i';}var _0x59e9ae=this[_0x63da('0x11')]['sync'](this,_0x42d205['variable_id']);if(!_0x59e9ae){return this[_0x63da('0x38')]['error'](_0x42d205,_0x63da('0x117'));}this[_0x63da('0x38')]['setVariable'](_0x59e9ae,_0x1907a3);if(this[_0x63da('0x8c')](_0x42d205[_0x63da('0x118')])){var _0x4dec05=parseInt(_0x42d205[_0x63da('0x118')],0xa);var _0x412619=rs[_0x63da('0x119')]({'charset':'*','length':_0x4dec05});var _0x3d5c1f=_0x1907a3['length'];if(_0x3d5c1f>0x0){if(_0x3d5c1f>_0x4dec05){this[_0x63da('0x37')][_0x63da('0x76')](this,_0x42d205,_0x42d205[_0x63da('0x11a')]===_0x63da('0x11b')?_0x412619+_0x1907a3[_0x63da('0x11c')](_0x4dec05):_0x1907a3['substr'](0x0,_0x3d5c1f-_0x4dec05)+_0x412619);}else{this[_0x63da('0x37')]['sync'](this,_0x42d205,rs['generate']({'charset':'*','length':_0x3d5c1f}));}}else{this[_0x63da('0x37')][_0x63da('0x76')](this,_0x42d205,'');}}else{this[_0x63da('0x37')][_0x63da('0x76')](this,_0x42d205,_0x1907a3);}return _0x2b86be;};AGIVertices[_0x63da('0x10')][_0x63da('0xe')]=function(_0x1797e5){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x11d'),_0x1797e5[_0x63da('0x3a')]));return this[_0x63da('0xd')](_0x1797e5);};AGIVertices[_0x63da('0x10')]['goal']=function(_0x1382f5){logger[_0x63da('0x2e')](util['format'](_0x63da('0x11e'),_0x1382f5['label']));this[_0x63da('0x37')][_0x63da('0x76')](this,_0x1382f5,_0x1382f5[_0x63da('0x11f')]);return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x120'),_0x1382f5[_0x63da('0x11f')]));};AGIVertices[_0x63da('0x10')][_0x63da('0x121')]=function(_0xd55ddb){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x122'),_0xd55ddb[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0xd55ddb[_0x63da('0x8f')])||!this['isConfigured'](_0xd55ddb[_0x63da('0x90')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x123'));}if(!this[_0x63da('0x8c')](_0xd55ddb['text'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xcd'));}this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0x124'),_0xd55ddb[_0x63da('0x62')]));var _0x5edcc9=this[_0x63da('0x8e')]['sync'](this,_0xd55ddb);if(_0x5edcc9){this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x125'),_0x5edcc9));var _0x607f71=this[_0x63da('0x38')][_0x63da('0x126')](_0x5edcc9);try{fs[_0x63da('0x102')](_0x5edcc9+_0x63da('0x127'));}catch(_0x3da0ac){logger[_0x63da('0x2c')](_0x3da0ac);}return _0x607f71;}return this[_0x63da('0x38')][_0x63da('0x2c')](_0xd55ddb,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0x63da('0x128')]=function(_0x3ab3a9){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x129'),_0x3ab3a9[_0x63da('0x3a')]));if(!this['isConfigured'](_0x3ab3a9['aws_access_key_id'])||!this[_0x63da('0x8c')](_0x3ab3a9[_0x63da('0x90')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x123'));}if(!this[_0x63da('0x8c')](_0x3ab3a9[_0x63da('0x96')])){return this['channel'][_0x63da('0xaf')](_0x63da('0x12a'));}if(!this[_0x63da('0x8c')](_0x3ab3a9[_0x63da('0x62')])){return this[_0x63da('0x38')][_0x63da('0xaf')]('no\x20text\x20configured');}this[_0x63da('0x38')][_0x63da('0xf4')]=!![];this[_0x63da('0x37')](_0x3ab3a9);this[_0x63da('0x45')](_0x3ab3a9[_0x63da('0x62')],'in','','');this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0x12b'),_0x3ab3a9[_0x63da('0x62')]));var _0x230e70=this[_0x63da('0x94')][_0x63da('0x76')](this,_0x3ab3a9);if(_0x230e70){for(var _0x18b2bd in _0x230e70){if(_0x230e70[_0x63da('0xa3')](_0x18b2bd)&&_['isString'](_0x230e70[_0x18b2bd])){this[_0x63da('0x38')][_0x63da('0xab')](util[_0x63da('0x58')](_0x63da('0x12c'),_0x18b2bd[_0x63da('0xeb')]()),_0x230e70[_0x18b2bd]);}}if(_[_0x63da('0x48')](_0x230e70[_0x63da('0x7d')])){return this[_0x63da('0x38')]['noop'](_0x63da('0x12d'));}else{this[_0x63da('0x45')](_0x230e70['message'],'out',_0x63da('0x12e'),'');return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x12f'),_0x230e70['message']));}}return this[_0x63da('0x38')]['error'](_0x3ab3a9,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices['prototype'][_0x63da('0x130')]=function(_0x8d4442){logger[_0x63da('0x2e')](util['format'](_0x63da('0x131'),_0x8d4442[_0x63da('0x3a')],_0x8d4442[_0x63da('0x6c')]));if(!this[_0x63da('0x8c')](_0x8d4442[_0x63da('0x7f')])){return this['channel'][_0x63da('0xaf')](_0x63da('0xe7'));}var _0x53a3db=_0x63da('0x132');var _0x1f7fe9=util['format'](_0x63da('0x133'),FILES_PATH,rs['generate'](0x4));var _0x4ecf21=util['format'](_0x63da('0xa4'),_0x1f7fe9,_0x53a3db);var _0x6822b8=!![];if(_0x8d4442[_0x63da('0x134')]==='NOBEEP'){_0x6822b8=![];}var _0xc4750b=this[_0x63da('0x38')][_0x63da('0x135')](_0x1f7fe9,_0x53a3db,_0x8d4442[_0x63da('0x136')],_0x8d4442['timeout'],undefined,_0x6822b8);if(_0xc4750b[_0x63da('0xa9')]!==-0x1){this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0x137'),_0x4ecf21));var _0x52cd82=this[_0x63da('0x97')][_0x63da('0x76')](this,_0x8d4442,_0x4ecf21);if(_0x52cd82){for(var _0x5312e4 in _0x52cd82){if(_0x52cd82[_0x63da('0xa3')](_0x5312e4)){this[_0x63da('0x38')]['setVariable'](util['format'](_0x63da('0x138'),_0x5312e4[_0x63da('0xeb')]()),_0x52cd82[_0x5312e4]);}}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x139'),JSON[_0x63da('0x79')](_0x52cd82)));}}return _0xc4750b;};AGIVertices[_0x63da('0x10')][_0x63da('0x13a')]=function(_0x3530cc){logger[_0x63da('0x2e')](util['format'](_0x63da('0x13b'),_0x3530cc['label']));if(!this[_0x63da('0x8c')](_0x3530cc[_0x63da('0x9a')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x13c'));}if(!this[_0x63da('0x8c')](_0x3530cc['appsecret'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x13d'));}var _0x118509=_0x63da('0x132');var _0x23323c=util['format'](_0x63da('0x133'),FILES_PATH,rs[_0x63da('0x119')](0x4));var _0xe96841=util['format'](_0x63da('0xa4'),_0x23323c,_0x118509);var _0x432f1f=!![];if(_0x3530cc[_0x63da('0x134')]==='NOBEEP'){_0x432f1f=![];}var _0x4e62a1=this[_0x63da('0x38')][_0x63da('0x135')](_0x23323c,_0x118509,_0x3530cc[_0x63da('0x136')],_0x3530cc['timeout'],undefined,_0x432f1f);if(_0x4e62a1['result']!==-0x1){this['channel'][_0x63da('0xaf')](util['format']('tilde\x20%s\x20file\x20created',_0xe96841));var _0x56cad2=this[_0x63da('0x99')][_0x63da('0x76')](this,_0x3530cc,_0xe96841);if(_0x56cad2){for(var _0x952b4b in _0x56cad2){if(_0x56cad2[_0x63da('0xa3')](_0x952b4b)){this['channel'][_0x63da('0xab')](util[_0x63da('0x58')]('TILDE_ASR_%s',_0x952b4b[_0x63da('0xeb')]()),_0x56cad2[_0x952b4b]);}}return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0x13e'),JSON[_0x63da('0x79')](_0x56cad2)));}}return _0x4e62a1;};AGIVertices['prototype'][_0x63da('0x13f')]=function(_0x4a3d85){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x140'),_0x4a3d85['label']));return this['channel']['continueAt'](_0x4a3d85[_0x63da('0x141')],_0x4a3d85['extension'],_0x4a3d85['priority']);};AGIVertices[_0x63da('0x10')]['gotoif']=function(_0xbf113d){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x142'),_0xbf113d[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0xbf113d['condition'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0xbf113d,_0x63da('0x143'));}try{var _0x4b2142=eval(_0xbf113d[_0x63da('0x144')])?_0x63da('0x145'):_0x63da('0x146');this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x147'),_0xbf113d[_0x63da('0x144')],_0x4b2142));return{'code':0xc8,'result':_0x4b2142};}catch(_0x5175b7){return{'code':0xc8,'result':_0x63da('0x146')};}};AGIVertices['prototype']['gotoiftime']=function(_0x4f8bf9){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x148'),_0x4f8bf9[_0x63da('0x3a')]));if(!this['isConfigured'](_0x4f8bf9[_0x63da('0x149')])){return this['channel'][_0x63da('0x2c')](_0x4f8bf9,_0x63da('0x14a'));}var _0x5d27f4=this[_0x63da('0x14b')][_0x63da('0x76')](this,_0x4f8bf9[_0x63da('0x149')]);if(!_0x5d27f4){return this['channel'][_0x63da('0x2c')](_0x4f8bf9,_0x63da('0x14c'));}for(var _0x64c319=0x0;_0x64c319<_0x5d27f4[_0x63da('0xa0')];_0x64c319+=0x1){var _0x2cd44d=this['channel'][_0x63da('0x11')](util['format']('IFTIME(%s?true:false)',_0x5d27f4[_0x64c319]));if(_0x2cd44d[_0x63da('0xa9')]===-0x1){return _0x2cd44d;}logger['info'](util[_0x63da('0x58')](_0x63da('0x14d'),_0x5d27f4[_0x64c319],_0x2cd44d[_0x63da('0xa7')]));if(_0x2cd44d['extra']==='true'){logger['info'](util['format']('IFTIME\x20%s\x20%s',_0x5d27f4[_0x64c319],'true'));this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('IFTIME\x20%s\x20%s',_0x5d27f4[_0x64c319],_0x63da('0x145')));return{'code':0xc8,'result':_0x63da('0x145')};}else{logger['info'](util[_0x63da('0x58')]('IFTIME\x20%s\x20%s',_0x5d27f4[_0x64c319],_0x63da('0x146')));this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('IFTIME\x20%s\x20%s',_0x5d27f4[_0x64c319],_0x63da('0x146')));}}return{'code':0xc8,'result':_0x63da('0x146')};};AGIVertices[_0x63da('0x10')][_0x63da('0x14e')]=function(_0x24a0cf){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x14f'),_0x24a0cf[_0x63da('0x3a')]));return this[_0x63da('0x38')][_0x63da('0x14e')]();};AGIVertices['prototype'][_0x63da('0x150')]=function(_0x41bf2a){logger[_0x63da('0x2e')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x41bf2a['label']));if(!this[_0x63da('0x8c')](_0x41bf2a['key'])){return this[_0x63da('0x38')]['noop'](_0x63da('0xe7'));}var _0x2d618d=_0x63da('0x132');var _0x44536c=util[_0x63da('0x58')](_0x63da('0x133'),FILES_PATH,rs[_0x63da('0x119')](0x4));var _0x17f1d8=util['format']('%s.%s',_0x44536c,_0x2d618d);var _0x2bd14d=!![];if(_0x41bf2a['beep']==='NOBEEP'){_0x2bd14d=![];}var _0x51da67=this[_0x63da('0x38')][_0x63da('0x135')](_0x44536c,_0x2d618d,_0x41bf2a[_0x63da('0x136')],_0x41bf2a[_0x63da('0x6c')],undefined,_0x2bd14d);if(_0x51da67[_0x63da('0xa9')]!==-0x1){this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('ispeech\x20%s\x20file\x20created',_0x17f1d8));var _0x346872=this['ispeechASR'][_0x63da('0x76')](this,_0x41bf2a,_0x17f1d8);if(_0x346872){for(var _0x1ce74a in _0x346872){if(_0x346872[_0x63da('0xa3')](_0x1ce74a)){this[_0x63da('0x38')][_0x63da('0xab')](util[_0x63da('0x58')](_0x63da('0x151'),_0x1ce74a['toUpperCase']()),_0x346872[_0x1ce74a]);}}return this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')]('IspeechASR\x20Result\x20%s',JSON['stringify'](_0x346872)));}}return _0x51da67;};AGIVertices[_0x63da('0x10')][_0x63da('0x152')]=function(_0x5477a2){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x153'),_0x5477a2[_0x63da('0x3a')]));if(!this['isConfigured'](_0x5477a2['key'])){return this[_0x63da('0x38')]['noop'](_0x63da('0xe7'));}if(!this[_0x63da('0x8c')](_0x5477a2['text'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xcd'));}this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('Trying\x20ispeech\x20TTS\x20%s',_0x5477a2[_0x63da('0x62')]));var _0x8270e=this['ispeechTTS'][_0x63da('0x76')](this,_0x5477a2);if(_0x8270e){this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x154'),_0x8270e));var _0x57acb2=this[_0x63da('0x38')]['streamFile'](_0x8270e,_0x5477a2[_0x63da('0x136')]);try{fs[_0x63da('0x102')](_0x8270e+_0x63da('0x127'));}catch(_0x1a1462){logger[_0x63da('0x2c')](_0x1a1462);}return _0x57acb2;}return this[_0x63da('0x38')][_0x63da('0x2c')](_0x5477a2,_0x63da('0x155'));};AGIVertices[_0x63da('0x10')][_0x63da('0x156')]=function(_0x3399b1){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x157'),_0x3399b1[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x3399b1['findBy'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3399b1,_0x63da('0x158'));}logger['info'](util[_0x63da('0x58')](_0x63da('0x159'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x3399b1[_0x63da('0x15a')]));var _0x468ee5=this[_0x63da('0x5a')]['sync'](this,_0x3399b1['findBy']);if(_0x468ee5){logger['info'](util['format'](_0x63da('0x15b'),this['channel'][_0x63da('0x3d')],_0x3399b1[_0x63da('0x15a')]));this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x15b'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x3399b1[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15c')};}else{logger[_0x63da('0x2e')](util['format'](_0x63da('0x15d'),this[_0x63da('0x38')]['callerid'],_0x3399b1['findBy']));this['channel']['noop'](util[_0x63da('0x58')](_0x63da('0x15d'),this['channel']['callerid'],_0x3399b1[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15e')};}};AGIVertices[_0x63da('0x10')][_0x63da('0x15f')]=function(_0x80db53){logger['info'](util['format'](_0x63da('0x160'),_0x80db53[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x80db53['findBy'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x80db53,_0x63da('0x158'));}logger[_0x63da('0x2e')](util['format'](_0x63da('0x159'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x80db53[_0x63da('0x15a')]));var _0x402474=this[_0x63da('0x57')][_0x63da('0x76')](this,_0x80db53[_0x63da('0x15a')]);if(_0x402474){logger['info'](util[_0x63da('0x58')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x63da('0x38')][_0x63da('0x3d')],_0x80db53[_0x63da('0x15a')]));this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x15b'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x80db53[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15c')};}else{logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x15d'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x80db53['findBy']));this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x15d'),this['channel'][_0x63da('0x3d')],_0x80db53[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15e')};}};AGIVertices[_0x63da('0x10')][_0x63da('0x161')]=function(_0x450864){logger['info'](util['format'](_0x63da('0x162'),_0x450864[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x450864[_0x63da('0x163')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x450864,_0x63da('0x164'));}this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x165'),_0x450864['operation']));var _0x343b4a=eval(_0x450864[_0x63da('0x163')]);if(!this[_0x63da('0x8c')](_0x450864[_0x63da('0xd9')])){return this[_0x63da('0x38')][_0x63da('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x186cdf=this['getVariable'][_0x63da('0x76')](this,_0x450864['variable_id']);if(!_0x186cdf){return this[_0x63da('0x38')]['error'](_0x450864,_0x63da('0x117'));}if(_[_0x63da('0x9f')](_0x343b4a)){var _0x53bd92=this;_0x343b4a['forEach'](function(_0x451c3b,_0x48fbb6){_0x53bd92[_0x63da('0x38')][_0x63da('0xab')](util[_0x63da('0x58')](_0x63da('0x166'),_0x186cdf,_0x48fbb6),_0x451c3b);});return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('variable\x20%s[key]\x20set',_0x186cdf));}else{return this['channel']['setVariable'](_0x186cdf,_0x343b4a);}};AGIVertices['prototype'][_0x63da('0xc')]=function(_0x1fc9b1){logger['info'](util[_0x63da('0x58')](_0x63da('0x167'),_0x1fc9b1[_0x63da('0x3a')]));if(_0x1fc9b1[_0x63da('0xad')]===0x0){return this[_0x63da('0xac')](_0x1fc9b1);}_0x1fc9b1[_0x63da('0xad')]-=0x1;if(!this['isConfigured'](_0x1fc9b1[_0x63da('0x110')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x1fc9b1,_0x63da('0x111'));}var _0x47de8a=this[_0x63da('0x1f')][_0x63da('0x76')](this,_0x1fc9b1[_0x63da('0x110')]);if(!_0x47de8a){return this[_0x63da('0x38')]['error'](_0x1fc9b1,_0x63da('0x168'));}var _0x301d7a=this[_0x63da('0x38')]['getData'](_0x47de8a,_0x1fc9b1[_0x63da('0x113')],_0x1fc9b1[_0x63da('0x169')]);var _0x419b2b=_0x301d7a['result'];if(_0x301d7a[_0x63da('0xa9')]===-0x1){this[_0x63da('0x37')][_0x63da('0x76')](this,_0x1fc9b1,'-1');return _0x301d7a;}else if(_0x301d7a[_0x63da('0xa7')]===_0x63da('0x6c')){_0x301d7a[_0x63da('0xa9')]=_0x301d7a[_0x63da('0xa9')][_0x63da('0xa0')]>0x0?_0x301d7a[_0x63da('0xa9')]:'t';}else if(_[_0x63da('0x47')](_0x301d7a[_0x63da('0xa9')])){_0x301d7a[_0x63da('0xa9')]='#';_0x419b2b='#';}if(!this[_0x63da('0x8c')](_0x1fc9b1[_0x63da('0xd9')])){this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xda'));}else{var _0x1b59f7=this[_0x63da('0x11')][_0x63da('0x76')](this,_0x1fc9b1['variable_id']);if(!_0x1b59f7){return this[_0x63da('0x38')]['error'](_0x1fc9b1,_0x63da('0x117'));}this['channel'][_0x63da('0xab')](_0x1b59f7,_0x419b2b);}this[_0x63da('0x37')][_0x63da('0x76')](this,_0x1fc9b1,_0x419b2b);return _0x301d7a;};AGIVertices[_0x63da('0x10')][_0x63da('0xaf')]=function(_0x53b817){logger['info'](util[_0x63da('0x58')](_0x63da('0x16a'),_0x53b817[_0x63da('0x3a')]));return this['channel'][_0x63da('0xaf')](_0x53b817[_0x63da('0x16b')]||_0x53b817[_0x63da('0x3a')]);};AGIVertices[_0x63da('0x10')][_0x63da('0x16c')]=function(_0x599251){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x16d'),_0x599251[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x599251[_0x63da('0x15a')])){return this['channel'][_0x63da('0x2c')](_0x599251,_0x63da('0x158'));}logger[_0x63da('0x2e')](util[_0x63da('0x58')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x63da('0x38')][_0x63da('0x3d')],_0x599251['findBy']));var _0x3f7a2c=this['getPause'][_0x63da('0x76')](this,_0x599251[_0x63da('0x16e')]);var _0x185911=this[_0x63da('0x55')][_0x63da('0x76')](this,_0x599251[_0x63da('0x15a')],_0x3f7a2c);if(_0x185911){logger[_0x63da('0x2e')](util['format'](_0x63da('0x15b'),this[_0x63da('0x38')]['callerid'],_0x599251[_0x63da('0x15a')]));this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x15b'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x599251[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15c')};}else{logger[_0x63da('0x2e')](util[_0x63da('0x58')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x63da('0x38')][_0x63da('0x3d')],_0x599251[_0x63da('0x15a')]));this[_0x63da('0x38')][_0x63da('0xaf')](util['format'](_0x63da('0x15b'),this['channel']['callerid'],_0x599251[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15e')};}};AGIVertices[_0x63da('0x10')][_0x63da('0x16f')]=function(_0x4067c7){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x170'),_0x4067c7['label']));if(!this['isConfigured'](_0x4067c7[_0x63da('0x110')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x4067c7,_0x63da('0x111'));}var _0x53a28d=this[_0x63da('0x1f')]['sync'](this,_0x4067c7[_0x63da('0x110')]);if(!_0x53a28d){return this['channel'][_0x63da('0x2c')](_0x4067c7,_0x63da('0x168'));}var _0x2777c8=this[_0x63da('0x38')]['exec'](_0x63da('0x171'),[_0x53a28d,_0x4067c7[_0x63da('0xe4')]]);if(_0x2777c8[_0x63da('0xa9')]===-0x1){return _0x2777c8;}return this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xc7'),_0x63da('0x171'),_0x53a28d));};AGIVertices['prototype'][_0x63da('0x172')]=function(_0x3abc64){logger[_0x63da('0x2e')](util[_0x63da('0x58')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x3abc64['label']));if(!this[_0x63da('0x8c')](_0x3abc64[_0x63da('0x173')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3abc64,'no\x20queue\x20selected');}var _0x2070dc='';var _0x46dde0=parseInt(_0x3abc64[_0x63da('0x173')],0xa);if(isNaN(_0x46dde0)){_0x2070dc=_0x3abc64['queue_id'];}else{_0x2070dc=this[_0x63da('0x15')][_0x63da('0x76')](this,_0x3abc64[_0x63da('0x173')]);if(!_0x2070dc){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3abc64,_0x63da('0x174'));}}var _0x40eab2='';if(this['isConfigured'](_0x3abc64[_0x63da('0x110')])){var _0x511bd9=this[_0x63da('0x1f')][_0x63da('0x76')](this,_0x3abc64[_0x63da('0x110')]);if(_0x511bd9){_0x40eab2=_0x511bd9;}}this[_0x63da('0x37')][_0x63da('0x76')](this,_0x3abc64,_0x2070dc);if(_0x3abc64[_0x63da('0xe4')][_0x63da('0x175')]('x')<0x0){_0x3abc64[_0x63da('0xe4')]+='x';}if(_0x3abc64[_0x63da('0xe4')]['indexOf']('X')<0x0){_0x3abc64[_0x63da('0xe4')]+='X';}this['channel'][_0x63da('0xab')](_0x63da('0x176'),_0x2070dc?_0x2070dc[_0x63da('0x177')]():'');var _0x45f279=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0x178'),[_0x2070dc,_0x3abc64[_0x63da('0xe4')],_0x3abc64[_0x63da('0x6a')],_0x40eab2,_0x3abc64['timeout'],_0x3abc64[_0x63da('0x8')],_0x3abc64['macro'],_0x3abc64[_0x63da('0x179')],'',_0x3abc64[_0x63da('0x17a')]]);if(_0x45f279['result']===-0x1){return _0x45f279;}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xc7'),'QUEUE',_0x2070dc));};AGIVertices['prototype'][_0x63da('0x17b')]=function(_0x554947){logger[_0x63da('0x2e')](util['format'](_0x63da('0x17c'),_0x554947[_0x63da('0x3a')]));var _0x1c19ed=_0x554947[_0x63da('0x17d')]||'wav';var _0x1d4348=util['format'](_0x63da('0x17e'),this[_0x63da('0x38')]['uniqueid'],rs[_0x63da('0x119')](0x5));var _0xbe125d=util[_0x63da('0x58')](_0x63da('0x17f'),FILES_PATH,_0x1d4348,_0x1c19ed);var _0x3ca5fa=util[_0x63da('0x58')](_0x63da('0x133'),FILES_PATH,_0x1d4348);this[_0x63da('0x3e')][_0x63da('0x76')](this,_0x554947,_0x1d4348,_0xbe125d);this[_0x63da('0x38')]['setVariable'](_0x63da('0x180'),_0x1d4348);logger[_0x63da('0x2e')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3ca5fa,_0x1c19ed,_0x554947[_0x63da('0x181')],_0x554947[_0x63da('0x6c')]);return this['channel'][_0x63da('0x135')](_0x3ca5fa,_0x1c19ed,_0x554947[_0x63da('0x181')],_0x554947[_0x63da('0x6c')],undefined,!![]);};AGIVertices[_0x63da('0x10')][_0x63da('0x182')]=function(_0x52c6a5){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x183'),_0x52c6a5[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x52c6a5[_0x63da('0x6a')])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x184'));}var _0x55eb7f=this[_0x63da('0x69')][_0x63da('0x76')](this,_0x52c6a5);logger[_0x63da('0x2e')](util[_0x63da('0x58')]('Response:',util[_0x63da('0x185')](_0x55eb7f,{'showHidden':![],'depth':null})));if(!this[_0x63da('0x8c')](_0x52c6a5[_0x63da('0xd9')])){return this[_0x63da('0x38')]['noop'](_0x63da('0x186'));}var _0x21bcb6=this['getVariable'][_0x63da('0x76')](this,_0x52c6a5[_0x63da('0xd9')]);if(!_0x21bcb6){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x52c6a5,_0x63da('0x117'));}this[_0x63da('0x38')]['setVariable'](util[_0x63da('0x58')](_0x63da('0x187'),_0x21bcb6),_0x55eb7f[_0x63da('0x7b')]?_0x55eb7f[_0x63da('0x7b')]:_0x63da('0x188'));this['channel']['setVariable'](util['format'](_0x63da('0x189'),_0x21bcb6),_0x55eb7f[_0x63da('0x7c')]?_0x55eb7f[_0x63da('0x7c')]:'OK');if(_0x55eb7f[_0x63da('0x70')]){try{this[_0x63da('0xa2')](_0x55eb7f[_0x63da('0x70')],_0x21bcb6);}catch(_0x2cce15){logger[_0x63da('0x2c')](util[_0x63da('0x58')](_0x63da('0x18a'),_0x21bcb6));}}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xdd'),_0x21bcb6));};AGIVertices[_0x63da('0x10')]['saydigits']=function(_0x5e81aa){logger[_0x63da('0x2e')](util['format'](_0x63da('0x18b'),_0x5e81aa[_0x63da('0x3a')]));return this[_0x63da('0x38')]['sayDigits'](_0x5e81aa[_0x63da('0x18c')][_0x63da('0x5e')](/\s+/g,''),_0x5e81aa[_0x63da('0x181')]);};AGIVertices[_0x63da('0x10')][_0x63da('0x18d')]=function(_0x5596ec){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x18e'),_0x5596ec[_0x63da('0x3a')]));return this[_0x63da('0x38')]['sayNumber'](_0x5596ec[_0x63da('0x18f')][_0x63da('0x5e')](/\s+/g,''),_0x5596ec[_0x63da('0x181')]);};AGIVertices[_0x63da('0x10')]['sayphonetic']=function(_0x3f498b){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x190'),_0x3f498b['label']));return this[_0x63da('0x38')][_0x63da('0x191')](_0x3f498b[_0x63da('0x62')],_0x3f498b[_0x63da('0x181')]);};AGIVertices[_0x63da('0x10')][_0x63da('0x192')]=function(_0x45bdb8){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x193'),_0x45bdb8['label']));if(!this[_0x63da('0x8c')](_0x45bdb8[_0x63da('0x194')])){return this[_0x63da('0x38')]['noop'](_0x63da('0x195'));}var _0xf721fc=this[_0x63da('0x23')]['sync'](this,_0x45bdb8[_0x63da('0x194')]);if(!_0xf721fc||!_0xf721fc[_0x63da('0x196')]){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x45bdb8,_0x63da('0x197'));}var _0x2e7ce6={'from':util[_0x63da('0x58')](_0x63da('0x198'),_0xf721fc[_0x63da('0x13')],_0xf721fc[_0x63da('0x199')]||_0xf721fc['Smtp']['user']),'to':_0x45bdb8['to']||'','cc':_0x45bdb8['cc']||'','bcc':_0x45bdb8[_0x63da('0x19a')]||'','subject':_0x45bdb8[_0x63da('0x19b')],'html':_0x45bdb8[_0x63da('0x62')],'text':_0x45bdb8['text']};if(this['isConfigured'](_0x45bdb8['template_id'])){}logger['debug'](_0x63da('0x19c'),JSON[_0x63da('0x79')](_0x2e7ce6));this['createSquareDetailsReport'][_0x63da('0x76')](this,_0x45bdb8,_0x45bdb8['account_id']);this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')]('Trying\x20SendMail\x20with\x20account\x20%s',_0xf721fc[_0x63da('0x13')]));this['sendMailMessage'][_0x63da('0x76')](this,_0xf721fc['smtpOptions'],_0x2e7ce6);return this[_0x63da('0x38')]['noop'](_0x63da('0x19d'));};AGIVertices[_0x63da('0x10')]['sendFax']=function(_0x38740c){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x19e'),_0x38740c[_0x63da('0x3a')]));return this['channel'][_0x63da('0xaf')](_0x63da('0x19f'));};AGIVertices[_0x63da('0x10')][_0x63da('0x1a0')]=function(_0x9420f4){logger['info'](util[_0x63da('0x58')](_0x63da('0x1a1'),_0x9420f4[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x9420f4[_0x63da('0x1a2')])){return this[_0x63da('0x38')][_0x63da('0xaf')]('no\x20sms\x20account\x20configured');}var _0x5522b2=this['getSmsAccount'][_0x63da('0x76')](this,_0x9420f4['sms_account_id']);if(!_0x5522b2){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x9420f4,_0x63da('0x1a3'));}var _0x4b1530={'body':_0x9420f4[_0x63da('0x1a4')],'phone':_0x9420f4['to']||'','SmsAccountId':_0x5522b2['id']};logger[_0x63da('0xdf')]('sendSMS\x20message',JSON[_0x63da('0x79')](_0x4b1530));this[_0x63da('0x37')]['sync'](this,_0x9420f4,_0x9420f4['sms_account_id']);this['channel'][_0x63da('0xaf')](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x5522b2[_0x63da('0x13')]));this['createSmsMessage']['sync'](this,_0x4b1530);return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x1a5'));};AGIVertices[_0x63da('0x10')][_0x63da('0x1a6')]=function(_0x295bde){logger[_0x63da('0x2e')](util['format'](_0x63da('0x1a7'),_0x295bde[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x295bde['variable_id'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x295bde,'no\x20variable\x20selected');}var _0x9239c4=this[_0x63da('0x11')][_0x63da('0x76')](this,_0x295bde[_0x63da('0xd9')]);if(!_0x9239c4){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x295bde,_0x63da('0x117'));}return this[_0x63da('0x38')][_0x63da('0xab')](_0x9239c4,_0x295bde[_0x63da('0x1a8')]);};AGIVertices[_0x63da('0x10')][_0x63da('0x1a9')]=function(_0x4109aa){logger['info'](util['format'](_0x63da('0x1aa'),_0x4109aa['label']));this['channel'][_0x63da('0xaf')](_0x63da('0x1ab'));if(_0x4109aa['answer']===_0x63da('0x1ac')){this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x1ad'));return this['channel']['answer']();}return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x1ae'));};AGIVertices['prototype']['subproject']=function(_0x3f2868){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x1af'),_0x3f2868[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x3f2868[_0x63da('0x1b0')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3f2868,_0x63da('0x1b1'));}var _0x4d06a2=this[_0x63da('0x17')][_0x63da('0x76')](this,_0x3f2868[_0x63da('0x1b0')]);if(!this[_0x63da('0x8c')](_0x4d06a2)){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3f2868,util['format'](_0x63da('0x1b2'),_0x3f2868['project_id']));}if(_0x4d06a2===this[_0x63da('0x38')]['arg_1']){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x3f2868,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport']['sync'](this,_0x3f2868,_0x4d06a2);var _0x5c325b=this[_0x63da('0x38')][_0x63da('0x5c')](_0x63da('0x1b3'),util['format'](_0x63da('0x1b4'),config[_0x63da('0x8')][_0x63da('0x1b5')]||_0x63da('0x1b6'),_0x4d06a2,this[_0x63da('0x38')]['arg_1']));if(_0x5c325b['result']===-0x1){return _0x5c325b;}return this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')](_0x63da('0xc7'),'AGI',_0x4d06a2));};AGIVertices[_0x63da('0x10')][_0x63da('0x1b7')]=function(_0x5cc3b1){logger['info'](util[_0x63da('0x58')](_0x63da('0x1b8'),_0x5cc3b1[_0x63da('0x3a')]));var _0xcd1877=this['shellCommand'][_0x63da('0x76')](this,_0x5cc3b1['command']);this[_0x63da('0x37')][_0x63da('0x76')](this,_0x5cc3b1,_0x5cc3b1[_0x63da('0xbb')]);if(this[_0x63da('0x8c')](_0x5cc3b1['variable_id'])){var _0x598ffc=this[_0x63da('0x11')][_0x63da('0x76')](this,_0x5cc3b1[_0x63da('0xd9')]);if(_0x598ffc){this[_0x63da('0x38')][_0x63da('0xab')](_0x598ffc,_0xcd1877);return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x1b9'),_0x5cc3b1[_0x63da('0xbb')],_0x598ffc));}}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x1ba'),_0x5cc3b1[_0x63da('0xbb')]));};AGIVertices[_0x63da('0x10')]['google_cloud_tts']=function(_0x1e8850){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x1bb'),_0x1e8850[_0x63da('0x3a')]));_0x1e8850['text']=_0x1e8850[_0x63da('0x62')][_0x63da('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x63da('0x8c')](_0x1e8850['apiKey'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0x1bc'));}if(!this['isConfigured'](_0x1e8850['text'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xcd'));}this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x1bd'),_0x1e8850[_0x63da('0x62')]));var _0x279676=this[_0x63da('0x5f')][_0x63da('0x76')](this,_0x1e8850);if(_0x279676){this[_0x63da('0x38')]['noop'](util[_0x63da('0x58')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x279676));var _0x54e5d5=this['channel'][_0x63da('0x126')](_0x279676);try{fs[_0x63da('0x102')](_0x279676+_0x63da('0x127'));}catch(_0x17131e){logger['error'](_0x17131e);}return _0x54e5d5;}return this[_0x63da('0x38')][_0x63da('0x2c')](_0x1e8850,_0x63da('0x1be'));};AGIVertices['prototype']['tts']=function(_0x538c3f){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x1bf'),_0x538c3f['label']));_0x538c3f[_0x63da('0x62')]=_0x538c3f[_0x63da('0x62')][_0x63da('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x63da('0x8c')](_0x538c3f['text'])){return this[_0x63da('0x38')][_0x63da('0xaf')](_0x63da('0xcd'));}this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x1c0'),_0x538c3f[_0x63da('0x62')]));var _0x192e24=this['googleTTS']['sync'](this,_0x538c3f);if(_0x192e24){this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x1c1'),_0x192e24));var _0x1d7b3=this[_0x63da('0x38')][_0x63da('0x126')](_0x192e24);try{fs['unlink'](_0x192e24+_0x63da('0x127'));}catch(_0x5362f0){logger[_0x63da('0x2c')](_0x5362f0);}return _0x1d7b3;}return this[_0x63da('0x38')][_0x63da('0x2c')](_0x538c3f,_0x63da('0x1c2'));};AGIVertices[_0x63da('0x10')]['unpause']=function(_0x316faf){logger[_0x63da('0x2e')](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x316faf[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x316faf['findBy'])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x316faf,_0x63da('0x158'));}logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x159'),this[_0x63da('0x38')]['callerid'],_0x316faf[_0x63da('0x15a')]));var _0x34eacf=this[_0x63da('0x56')][_0x63da('0x76')](this,_0x316faf[_0x63da('0x15a')]);if(_0x34eacf){logger[_0x63da('0x2e')](util['format'](_0x63da('0x15b'),this['channel'][_0x63da('0x3d')],_0x316faf['findBy']));this[_0x63da('0x38')]['noop'](util['format'](_0x63da('0x15b'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x316faf[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15c')};}else{logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x15d'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x316faf[_0x63da('0x15a')]));this['channel'][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0x15d'),this[_0x63da('0x38')][_0x63da('0x3d')],_0x316faf[_0x63da('0x15a')]));return{'code':0xc8,'result':_0x63da('0x15e')};}};AGIVertices['prototype']['voicemail']=function(_0x4c93c1){logger[_0x63da('0x2e')](util[_0x63da('0x58')](_0x63da('0x1c3'),_0x4c93c1[_0x63da('0x3a')]));var _0x3e6049=this['channel'][_0x63da('0x5c')]('VOICEMAIL',[_0x4c93c1['mailbox'],_0x4c93c1['options']]);if(_0x3e6049[_0x63da('0xa9')]===-0x1){return _0x3e6049;}return this[_0x63da('0x38')][_0x63da('0xaf')](util[_0x63da('0x58')](_0x63da('0xc7'),_0x63da('0x1c4'),_0x4c93c1[_0x63da('0x1c5')]));};AGIVertices['prototype'][_0x63da('0x1c6')]=function(_0x5c0d7e){logger[_0x63da('0x2e')](util['format'](_0x63da('0x1c7'),_0x5c0d7e[_0x63da('0x3a')]));if(!this[_0x63da('0x8c')](_0x5c0d7e[_0x63da('0xd9')])){return this[_0x63da('0x38')][_0x63da('0x2c')](_0x5c0d7e,_0x63da('0x1c8'));}var _0x2693af=this[_0x63da('0x11')]['sync'](this,_0x5c0d7e['variable_id']);if(!_0x2693af){return this['channel'][_0x63da('0x2c')](_0x5c0d7e,_0x63da('0x117'));}var _0x431e5c=this[_0x63da('0x38')][_0x63da('0x11')](_0x2693af);return{'code':0xc8,'result':_0x431e5c[_0x63da('0xa7')]?_0x431e5c[_0x63da('0xa7')]:'-'};};String[_0x63da('0x10')][_0x63da('0xa6')]=function(_0x578e45,_0x360607){return this['split'](_0x578e45)[_0x63da('0x1c9')](_0x360607);};module[_0x63da('0x1ca')]=AGIVertices;
\ No newline at end of file
+var _0x3c81=['Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','password','no\x20password\x20configured','ndassistant_url','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','no\x20trunk\x20found','trunk_name','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','getsecretdigits','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','message','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','wav','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','gotoif','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','math','math\x20%s','operation','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','bcc','subject','template_id','sendMail\x20message','smtpOptions','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','googleCloudTTS','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','failure','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','util','lodash','odbc','randomstring','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','getUser','getUserById','getSoundPath','save_name','getMailAccount','sendMailMessage','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','createSquareRecording','uniqueid','callerid','context','extension','priority','accountcode','dnid','file','createSquareMessage','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','uri','render','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','googleDialogflowV2','private_key','sestekNDA','ispeechTTS','speed','ispeechASR','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','awsLex','googleASR','tildeASR','appid','clear','hasOwnProperty','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult','%s.%s','setVariable','stringify','replaceAllVariables','split','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','sync','retry','no\x20text\x20configured','MRCPSynth','result','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','createCmContact','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts'];(function(_0x3d8b36,_0x2ef5be){var _0x39ac49=function(_0x257a5e){while(--_0x257a5e){_0x3d8b36['push'](_0x3d8b36['shift']());}};_0x39ac49(++_0x2ef5be);}(_0x3c81,0x102));var _0x13c8=function(_0x9e66aa,_0x4683e0){_0x9e66aa=_0x9e66aa-0x0;var _0x113c30=_0x3c81[_0x9e66aa];return _0x113c30;};'use strict';var fs=require('fs');var util=require(_0x13c8('0x0'));var _=require(_0x13c8('0x1'));var sh=require('shelljs');var odbc=require(_0x13c8('0x2'))();var rs=require(_0x13c8('0x3'));var moment=require('moment');var Mustache=require('mustache');var rp=require('request-promise');var logger=require('../../config/logger')(_0x13c8('0x4'));var config=require(_0x13c8('0x5'));var shared=require(_0x13c8('0x6'));var scripts=require(_0x13c8('0x7'));var FILES_PATH=_0x13c8('0x8');var recursiveMapAttributes=[_0x13c8('0x9'),_0x13c8('0xa')];var verticesWithRetry=['menu',_0x13c8('0xb'),'getsecretdigits'];var AGIVertices=function(_0x380aed,_0x296463,_0x189ce6){this[_0x13c8('0xc')]=_0x380aed;this[_0x13c8('0xd')]=_0x296463;this[_0x13c8('0xe')]=_0x189ce6;};AGIVertices[_0x13c8('0xf')][_0x13c8('0x10')]=function(_0x26e7d9,_0x3db68a){this[_0x13c8('0xd')][_0x13c8('0x11')](_0x26e7d9)[_0x13c8('0x12')](function(_0x48c171){_0x3db68a(null,_0x48c171?_0x48c171['name']:![]);})[_0x13c8('0x13')](function(_0x7b6da8){_0x3db68a(_0x7b6da8);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x14')]=function(_0x4a077c,_0x42955d){this['rpc']['getVoiceQueueById'](_0x4a077c)['then'](function(_0x126359){_0x42955d(null,_0x126359?_0x126359['name']:![]);})[_0x13c8('0x13')](function(_0x17a3c1){_0x42955d(_0x17a3c1);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x15')]=function(_0x5d7906,_0x13a9e1){this[_0x13c8('0xd')][_0x13c8('0x16')](_0x5d7906)[_0x13c8('0x12')](function(_0xce1ad2){_0x13a9e1(null,_0xce1ad2?_0xce1ad2[_0x13c8('0x17')]:![]);})[_0x13c8('0x13')](function(_0x251c38){_0x13a9e1(_0x251c38);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x18')]=function(_0xe9386a,_0x5ac776){this[_0x13c8('0xd')][_0x13c8('0x19')](_0xe9386a)[_0x13c8('0x12')](function(_0x313ea3){_0x5ac776(null,_0x313ea3?_0x313ea3['dsn']:![]);})[_0x13c8('0x13')](function(_0x3c4603){_0x5ac776(_0x3c4603);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1a')]=function(_0x436d5d,_0x2fc123){this['rpc'][_0x13c8('0x1b')](_0x436d5d)[_0x13c8('0x12')](function(_0x315d6c){_0x2fc123(null,_0x315d6c?_0x315d6c[_0x13c8('0x17')]:![]);})['catch'](function(_0x1770e5){_0x2fc123(_0x1770e5);});};AGIVertices[_0x13c8('0xf')]['getTrunk']=function(_0x49b552,_0x3b4fd8){this[_0x13c8('0xd')]['getTrunkById'](_0x49b552)['then'](function(_0x288c3c){_0x3b4fd8(null,_0x288c3c?_0x288c3c[_0x13c8('0x17')]:![]);})['catch'](function(_0x4df077){_0x3b4fd8(_0x4df077);});};AGIVertices[_0x13c8('0xf')]['getSound']=function(_0x545b47,_0x1c7dc4){var _0x6c2dc8=this;this[_0x13c8('0xd')]['getSoundById'](_0x545b47)['then'](function(_0x277a89){_0x1c7dc4(null,_0x277a89?_0x6c2dc8[_0x13c8('0x1c')](_0x277a89[_0x13c8('0x1d')]):![]);})[_0x13c8('0x13')](function(_0x138017){_0x1c7dc4(_0x138017);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1e')]=function(_0x4a1b9c,_0x109cb8){this[_0x13c8('0xd')]['getMailAccountById'](_0x4a1b9c)['then'](function(_0x23a725){_0x109cb8(null,_0x23a725?_0x23a725:![]);})[_0x13c8('0x13')](function(_0x50bb89){_0x109cb8(_0x50bb89);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1f')]=function(_0x47e0f8,_0x21224a,_0x238b19){this[_0x13c8('0xe')][_0x13c8('0x1f')](_0x47e0f8,_0x21224a)[_0x13c8('0x12')](function(){_0x238b19(null);})[_0x13c8('0x13')](function(_0x1a9298){_0x238b19(_0x1a9298);});};AGIVertices[_0x13c8('0xf')]['getIntervals']=function(_0x4d9277,_0x1e03b8){this[_0x13c8('0xd')]['getIntervalById'](_0x4d9277)[_0x13c8('0x12')](function(_0x5bc5d2){if(_0x5bc5d2){if(_0x5bc5d2[_0x13c8('0x20')]){_0x1e03b8(null,[_0x5bc5d2['interval']]);}else{_0x1e03b8(null,_[_0x13c8('0x21')](_0x5bc5d2[_0x13c8('0x22')],_0x13c8('0x23')));}}else{_0x1e03b8(null,![]);}})[_0x13c8('0x13')](function(_0x2039e7){_0x1e03b8(_0x2039e7);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1c')]=function(_0x5287f2){return util[_0x13c8('0x24')](_0x13c8('0x25'),FILES_PATH,_0x5287f2);};AGIVertices['prototype'][_0x13c8('0x26')]=function(_0x8ae2e5,_0x2bfbf4,_0x479399){odbc['open'](_0x8ae2e5,function(_0x5b4b1e){if(_0x5b4b1e){logger[_0x13c8('0x27')](_0x13c8('0x28'),_0x5b4b1e);_0x479399(_0x5b4b1e);}else{logger[_0x13c8('0x29')](_0x13c8('0x2a'));odbc[_0x13c8('0x2b')](_0x2bfbf4,function(_0x412428,_0x3c8176){if(_0x412428){logger[_0x13c8('0x29')](_0x13c8('0x2c'),_0x2bfbf4);_0x479399(_0x412428);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x2bfbf4);odbc[_0x13c8('0x2d')](function(_0x405fce){if(_0x405fce){logger[_0x13c8('0x27')](_0x13c8('0x2e'),_0x405fce);}_0x479399(null,_0x3c8176);});}});}});};AGIVertices['prototype'][_0x13c8('0x2f')]=function(_0x4bd627,_0x343dba){this[_0x13c8('0xd')][_0x13c8('0x30')](_0x4bd627)[_0x13c8('0x12')](function(_0xbb1d49){_0x343dba(null,_0xbb1d49?_0xbb1d49:![]);})[_0x13c8('0x13')](function(_0xb272c0){_0x343dba(_0xb272c0);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x31')]=function(_0x6ee38b,_0x32d5a5){this[_0x13c8('0xd')][_0x13c8('0x31')](_0x6ee38b)[_0x13c8('0x12')](function(_0x32250a){_0x32d5a5(null,_0x32250a);})[_0x13c8('0x13')](function(_0x1b2ada){_0x32d5a5(_0x1b2ada);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x32')]=function(_0x1cff99,_0x3622d6,_0x1c655f){this[_0x13c8('0xd')][_0x13c8('0x32')]({'uniqueid':this[_0x13c8('0xc')]['uniqueid'],'node':_0x1cff99[_0x13c8('0x33')],'application':_0x1cff99[_0x13c8('0x34')],'data':_0x3622d6||null,'project_name':this[_0x13c8('0xc')][_0x13c8('0x35')],'callerid':this[_0x13c8('0xc')]['callerid']})['then'](function(_0x25606f){if(_0x1c655f){_0x1c655f(null,_0x25606f);}})[_0x13c8('0x13')](function(_0x141abe){if(_0x1c655f){_0x1c655f(_0x141abe);}});};AGIVertices['prototype']['createSquareRecording']=function(_0x4d783c,_0x2a1ced,_0x49ca05,_0x32a6f4){this['rpc'][_0x13c8('0x36')]({'uniqueid':this[_0x13c8('0xc')][_0x13c8('0x37')],'callerid':this[_0x13c8('0xc')][_0x13c8('0x38')],'calleridname':this[_0x13c8('0xc')]['calleridname'],'context':this[_0x13c8('0xc')][_0x13c8('0x39')],'extension':this['channel'][_0x13c8('0x3a')],'priority':this[_0x13c8('0xc')][_0x13c8('0x3b')],'accountcode':this[_0x13c8('0xc')][_0x13c8('0x3c')],'dnid':this['channel'][_0x13c8('0x3d')],'projectName':this[_0x13c8('0xc')][_0x13c8('0x35')],'saveName':_0x2a1ced,'filename':_0x4d783c[_0x13c8('0x3e')]||_0x2a1ced,'savePath':_0x49ca05})[_0x13c8('0x12')](function(_0x59ec9f){_0x32a6f4(null,_0x59ec9f);})[_0x13c8('0x13')](function(_0x2c90a1){_0x32a6f4(_0x2c90a1);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x3f')]=function(_0x2d4f87,_0x19bc65,_0x1d0ecf,_0xa1596b,_0x30fa7c){this[_0x13c8('0xd')][_0x13c8('0x3f')]({'uniqueid':this['channel'][_0x13c8('0x37')],'body':_0x2d4f87,'direction':_0x19bc65,'providerName':_0x1d0ecf,'providerResponse':_0xa1596b})[_0x13c8('0x12')](function(_0x47d862){if(_0x30fa7c){_0x30fa7c(null,_0x47d862);}})[_0x13c8('0x13')](function(_0x340fbe){if(_0x30fa7c){_0x30fa7c(_0x340fbe);}});};AGIVertices[_0x13c8('0xf')]['createCmContact']=function(_0x341fd3,_0x416e4f){this[_0x13c8('0xd')]['createCmContact']({'firstName':_['isEmpty'](_0x341fd3[_0x13c8('0x17')])||_[_0x13c8('0x40')](_0x341fd3['name'])?_0x13c8('0x41')+Math[_0x13c8('0x42')]():_0x341fd3['name'],'lastName':_[_0x13c8('0x43')](_0x341fd3['lastName'])||_[_0x13c8('0x40')](_0x341fd3[_0x13c8('0x44')])?null:_0x341fd3[_0x13c8('0x44')],'phone':_0x341fd3['phone'],'ListId':_0x341fd3[_0x13c8('0x45')],'scheduledat':_0x341fd3[_0x13c8('0x46')],'callbackUniqueid':this['channel'][_0x13c8('0x37')],'tags':'callback','description':_0x13c8('0x47')+_0x341fd3[_0x13c8('0x46')][_0x13c8('0x48')](),'priority':_0x341fd3[_0x13c8('0x49')]})[_0x13c8('0x12')](function(_0x5f4884){_0x416e4f(null,_0x5f4884);})[_0x13c8('0x13')](function(_0x597543){_0x416e4f(_0x597543);});};AGIVertices['prototype']['getPause']=function(_0x53c8f5,_0x539c84){this[_0x13c8('0xd')][_0x13c8('0x4a')](_0x53c8f5)[_0x13c8('0x12')](function(_0x1f383f){_0x539c84(null,_0x1f383f?_0x1f383f[_0x13c8('0x17')]:![]);})[_0x13c8('0x13')](function(_0x3b0a65){_0x539c84(_0x3b0a65);});};AGIVertices['prototype']['agentPause']=function(_0x41f9d7,_0x30e3e4,_0x27760b){var _0x11b3ba={'role':_0x13c8('0x4b')};_0x11b3ba[_0x41f9d7]=this[_0x13c8('0xc')][_0x13c8('0x38')];this[_0x13c8('0xd')]['agentPause'](_0x11b3ba,_0x30e3e4,this[_0x13c8('0xc')][_0x13c8('0x37')])['then'](function(_0x11f96c){_0x27760b(null,_[_0x13c8('0x40')](_0x11f96c)?![]:!![]);})[_0x13c8('0x13')](function(_0x286a23){logger[_0x13c8('0x27')](_0x286a23);_0x27760b(null,![]);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x4c')]=function(_0x3c590c,_0x2ba0cd){var _0x15af00={'role':_0x13c8('0x4b')};_0x15af00[_0x3c590c]=this[_0x13c8('0xc')][_0x13c8('0x38')];this[_0x13c8('0xd')][_0x13c8('0x4c')](_0x15af00)[_0x13c8('0x12')](function(_0x4bb2c6){_0x2ba0cd(null,_[_0x13c8('0x40')](_0x4bb2c6)?![]:!![]);})['catch'](function(_0x3eafbd){logger[_0x13c8('0x27')](_0x3eafbd);_0x2ba0cd(null,![]);});};AGIVertices['prototype'][_0x13c8('0x4d')]=function(_0x32a824,_0x5539e8){var _0x38fd82={'role':_0x13c8('0x4b')};_0x38fd82[_0x32a824]=this[_0x13c8('0xc')][_0x13c8('0x38')];this[_0x13c8('0xd')][_0x13c8('0x4d')](_0x38fd82)[_0x13c8('0x12')](function(_0x1f5bc7){_0x5539e8(null,_[_0x13c8('0x40')](_0x1f5bc7)?![]:!![]);})[_0x13c8('0x13')](function(_0x3bee19){logger['error'](_0x3bee19);_0x5539e8(null,![]);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x4e')]=function(_0x223cfd,_0x2445c1){var _0x372ae4={'role':_0x13c8('0x4b')};_0x372ae4[_0x223cfd]=this['channel'][_0x13c8('0x38')];var _0x370005=_0x223cfd!=_0x13c8('0x4f')?util['format'](_0x13c8('0x50'),_0x13c8('0x51'),this[_0x13c8('0xc')][_0x13c8('0x38')]):undefined;this[_0x13c8('0xd')][_0x13c8('0x4e')](_0x372ae4,_0x370005)['then'](function(_0xcc921){_0x2445c1(null,_[_0x13c8('0x40')](_0xcc921)?![]:!![]);})[_0x13c8('0x13')](function(_0x19317a){logger['error'](_0x19317a);_0x2445c1(null,![]);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x52')]=function(_0x258447,_0x308482){sh[_0x13c8('0x53')](_[_0x13c8('0x54')](_0x258447),function(_0xaa4763,_0x4b3579){var _0x45f0ba=_0x4b3579[_0x13c8('0x55')](/(\r\n|\n|\r)/gm,'');_0x308482(null,_0x45f0ba);});};AGIVertices[_0x13c8('0xf')]['googleCloudTTS']=function(_0x1fc721,_0x34cf4a){scripts['googleCloudTTS'](_0x1fc721['apiKey'],_0x1fc721[_0x13c8('0x56')]||'text',_0x1fc721[_0x13c8('0x57')],_0x1fc721['languageCode']||_0x13c8('0x58'),_0x1fc721[_0x13c8('0x59')]||_0x13c8('0x5a'),_0x1fc721[_0x13c8('0x5b')]||_0x13c8('0x5c'))['then'](function(_0x1577e0){_0x34cf4a(null,_0x1577e0);})[_0x13c8('0x13')](function(_0x51a683){_0x34cf4a(_0x51a683);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x5d')]=function(_0x2737c6,_0x34e21a){scripts[_0x13c8('0x5d')](_0x2737c6[_0x13c8('0x57')],_0x2737c6[_0x13c8('0x5e')]||'en',0x1)[_0x13c8('0x12')](function(_0x1d8c27){_0x34e21a(null,_0x1d8c27);})[_0x13c8('0x13')](function(_0x5464fd){_0x34e21a(_0x5464fd);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x5f')]=function(_0x5f48fc,_0x58d5b2){var _0x363406={'uri':_0x5f48fc[_0x13c8('0x60')],'method':_0x5f48fc[_0x13c8('0x61')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5f48fc[_0x13c8('0x62')])===_0x13c8('0x63')&&parseInt(_0x5f48fc[_0x13c8('0x62')])>=0x1?parseInt(_0x5f48fc['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x13c8('0x64')]([_0x13c8('0x65'),_0x13c8('0x66')],_0x363406[_0x13c8('0x61')][_0x13c8('0x67')]())){try{_0x363406['body']=_0x5f48fc[_0x13c8('0xa')]?JSON[_0x13c8('0x68')](_0x5f48fc['rawBody']):{};}catch(_0x1fc0a9){logger[_0x13c8('0x27')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x1fc0a9);}}try{_0x363406[_0x13c8('0x69')]=_0x5f48fc['rawHeaders']?JSON[_0x13c8('0x68')](_0x5f48fc['rawHeaders']):{};}catch(_0x43089e){logger[_0x13c8('0x27')](_0x13c8('0x6a'),_0x43089e);}if(_0x5f48fc['computedVariables']){try{var _0x22100e=require(_0x5f48fc['computedVariables'])['sync'](this,_0x363406);_0x363406[_0x13c8('0x6b')]=Mustache[_0x13c8('0x6c')](_0x5f48fc[_0x13c8('0x60')],_0x22100e,{},['$$','$$']);if(_0x363406[_0x13c8('0x69')]){_0x363406['headers']=JSON['parse'](Mustache[_0x13c8('0x6c')](JSON['stringify'](_0x363406['headers']),_0x22100e,{},['$$','$$']));}if(_0x363406[_0x13c8('0x6d')]){_0x363406[_0x13c8('0x6d')]=JSON[_0x13c8('0x68')](Mustache[_0x13c8('0x6c')](JSON['stringify'](_0x363406[_0x13c8('0x6d')]),_0x22100e,{},['$$','$$']));}}catch(_0x48cb34){logger['error'](_0x13c8('0x6e'),_0x48cb34);}}rp(_0x363406)[_0x13c8('0x12')](function(_0xdccedc){var _0x2ab240={'statusCode':_0xdccedc[_0x13c8('0x6f')]||0xc8,'statusMessage':_0xdccedc['statusMessage']||'OK','headers':_0xdccedc[_0x13c8('0x69')]||{},'body':_0xdccedc['body']||{}};_0x58d5b2(null,_0x2ab240);})[_0x13c8('0x13')](function(_0x4f56ef){var _0x5277a2={'statusCode':_0x4f56ef[_0x13c8('0x6f')]||0x1f4,'statusMessage':_0x4f56ef['message']||_0x13c8('0x70'),'headers':_0x4f56ef[_0x13c8('0x71')]['headers']||{},'body':_0x4f56ef[_0x13c8('0x71')][_0x13c8('0x6d')]||{}};_0x58d5b2(null,_0x5277a2);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x72')]=function(_0x4fbc85,_0x5d70ce){scripts[_0x13c8('0x72')](this[_0x13c8('0xc')][_0x13c8('0x37')],_0x4fbc85[_0x13c8('0x73')],_0x4fbc85[_0x13c8('0x57')],_0x4fbc85['dialogflow_language']||'en')['then'](function(_0x1db05a){_0x5d70ce(null,_0x1db05a);})[_0x13c8('0x13')](function(_0x285aee){_0x5d70ce(_0x285aee);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x74')]=function(_0xf0bd9,_0xeb7971){scripts[_0x13c8('0x74')](this[_0x13c8('0xc')][_0x13c8('0x37')],_0xf0bd9['dialogflowV2_project_id'],_0xf0bd9['client_email'],_0xf0bd9[_0x13c8('0x75')],_0xf0bd9[_0x13c8('0x57')],_0xf0bd9['dialogflowV2_language']||'en')[_0x13c8('0x12')](function(_0x462db2){_0xeb7971(null,_0x462db2);})[_0x13c8('0x13')](function(_0x1089ce){_0xeb7971(_0x1089ce);});};AGIVertices['prototype'][_0x13c8('0x76')]=function(_0x23a989,_0x3b6df0){scripts['sestekNDA'](this[_0x13c8('0xc')],_0x23a989)[_0x13c8('0x12')](function(_0x14df84){_0x3b6df0(null,_0x14df84);})['catch'](function(_0x3c6150){_0x3b6df0(_0x3c6150);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x77')]=function(_0x348e69,_0xcb9546){scripts[_0x13c8('0x77')](_0x348e69['key'],_0x348e69['text'],_0x348e69['ispeech_tts_language']||'en-US',_0x348e69[_0x13c8('0x78')])[_0x13c8('0x12')](function(_0x35f718){_0xcb9546(null,_0x35f718);})[_0x13c8('0x13')](function(_0x2a7836){_0xcb9546(_0x2a7836);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x79')]=function(_0x126fa4,_0x2180a9,_0x87dc49){scripts[_0x13c8('0x79')](_0x2180a9,_0x126fa4['key'],_0x126fa4['ispeech_asr_language']||_0x13c8('0x58'),this[_0x13c8('0x7a')](_0x126fa4[_0x13c8('0x7b')])?_0x126fa4[_0x13c8('0x7b')]:undefined)['then'](function(_0x3282b1){_0x87dc49(null,_0x3282b1);})[_0x13c8('0x13')](function(_0x1f13f8){_0x87dc49(_0x1f13f8);});};AGIVertices['prototype']['awsPolly']=function(_0x58a670,_0x360e04){scripts[_0x13c8('0x7c')](_0x58a670[_0x13c8('0x7d')],_0x58a670[_0x13c8('0x7e')],_0x58a670[_0x13c8('0x7f')],_0x58a670[_0x13c8('0x80')]||_0x13c8('0x81'),_0x58a670[_0x13c8('0x57')],_0x58a670['aws_text_type']||_0x13c8('0x57'))['then'](function(_0x4a1818){_0x360e04(null,_0x4a1818);})[_0x13c8('0x13')](function(_0x1c43fd){_0x360e04(_0x1c43fd);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x82')]=function(_0x50fafe,_0x19d48b){scripts['awsLex'](this[_0x13c8('0xc')][_0x13c8('0x37')],_0x50fafe[_0x13c8('0x7d')],_0x50fafe[_0x13c8('0x7e')],_0x50fafe['aws_lex_region'],_0x50fafe[_0x13c8('0x57')],_0x50fafe['aws_bot_name'])[_0x13c8('0x12')](function(_0x23c48f){_0x19d48b(null,_0x23c48f);})['catch'](function(_0x561cf9){_0x19d48b(_0x561cf9);});};AGIVertices['prototype'][_0x13c8('0x83')]=function(_0x1cda57,_0x5048e4,_0x1d88fd){scripts[_0x13c8('0x83')](_0x5048e4,_0x1cda57[_0x13c8('0x73')],_0x1cda57['google_asr_language']||_0x13c8('0x58'))['then'](function(_0x4dc047){_0x1d88fd(null,_0x4dc047);})['catch'](function(_0x430884){_0x1d88fd(_0x430884);});};AGIVertices[_0x13c8('0xf')][_0x13c8('0x84')]=function(_0x34a333,_0x1b682e,_0x18343f){scripts['tildeASR'](_0x1b682e,_0x34a333[_0x13c8('0x85')],_0x34a333['appsecret'],_0x34a333['uri'])[_0x13c8('0x12')](function(_0x55bd1a){_0x18343f(null,_0x55bd1a);})[_0x13c8('0x13')](function(_0x3a701b){_0x18343f(_0x3a701b);});};AGIVertices['prototype'][_0x13c8('0x86')]=function(_0x58271b){var _0x2d0e63=_['includes'](verticesWithRetry,_0x58271b[_0x13c8('0x34')])?_0x58271b:_['clone'](_0x58271b);for(var _0xf0241f in _0x2d0e63){if(_0x2d0e63[_0x13c8('0x87')](_0xf0241f)){if(_0x2d0e63[_0xf0241f]&&_['isString'](_0x2d0e63[_0xf0241f])){if(_[_0x13c8('0x64')](recursiveMapAttributes,_0xf0241f)){_0x2d0e63[_0xf0241f]=this['replaceObjectAllVariables'](_0x2d0e63[_0xf0241f]);}else{_0x2d0e63[_0xf0241f]=this['replaceAllVariables'](_0x2d0e63[_0xf0241f]);}}}}return _0x2d0e63;};AGIVertices[_0x13c8('0xf')][_0x13c8('0x88')]=function(_0x11ca14){for(var _0x54f7bb in _0x11ca14){if(_0x11ca14[_0x13c8('0x87')](_0x54f7bb)){if(_[_0x13c8('0x89')](_0x11ca14[_0x54f7bb])){this[_0x13c8('0x88')](_0x11ca14[_0x54f7bb]);}else if(_[_0x13c8('0x8a')](_0x11ca14[_0x54f7bb])){for(var _0x42ae84=0x0;_0x42ae84<_0x11ca14[_0x54f7bb][_0x13c8('0x8b')];_0x42ae84++){this['recursiveNodeIndex'](_0x11ca14[_0x54f7bb][_0x42ae84]);}}else if(_[_0x13c8('0x8c')](_0x11ca14[_0x54f7bb])){_0x11ca14[_0x54f7bb]=this['replaceAllVariables'](_0x11ca14[_0x54f7bb]);}}}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x8d')]=function(_0x47d833,_0x3eb735){for(var _0x1ec45a in _0x47d833){if(_0x47d833['hasOwnProperty'](_0x1ec45a)){if(_['isPlainObject'](_0x47d833[_0x1ec45a])){if(!_[_0x13c8('0x43')](_0x47d833[_0x1ec45a])){this[_0x13c8('0x8d')](_0x47d833[_0x1ec45a],util[_0x13c8('0x24')]('%s.%s',_0x3eb735,_0x1ec45a));}}else if(_['isArray'](_0x47d833[_0x1ec45a])){for(var _0x117f33=0x0;_0x117f33<_0x47d833[_0x1ec45a]['length'];_0x117f33++){this['saveRestApiResult'](_0x47d833[_0x1ec45a][_0x117f33],util['format'](_0x13c8('0x8e'),_0x3eb735,_0x1ec45a+'['+_0x117f33+']'));}}else{if(!_[_0x13c8('0x40')](_0x47d833[_0x1ec45a])){this[_0x13c8('0xc')][_0x13c8('0x8f')](util[_0x13c8('0x24')](_0x13c8('0x8e'),_0x3eb735,_0x1ec45a),_0x47d833[_0x1ec45a]);}}}}};AGIVertices[_0x13c8('0xf')]['replaceObjectAllVariables']=function(_0x52e2e3){try{var _0x322670=JSON[_0x13c8('0x68')](_0x52e2e3);this[_0x13c8('0x88')](_0x322670);return JSON[_0x13c8('0x90')](_0x322670);}catch(_0x116c90){return this[_0x13c8('0x91')](_0x52e2e3);}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x91')]=function(_0x3d57ea){var _0x4efc83=_0x3d57ea[_0x13c8('0x92')]('{');for(var _0x2fd927=0x1;_0x2fd927<_0x4efc83[_0x13c8('0x8b')];_0x2fd927+=0x1){var _0x56261a=_0x4efc83[_0x2fd927][_0x13c8('0x92')]('}');if(_0x56261a[_0x13c8('0x8b')]>0x1){_0x3d57ea=_0x3d57ea['replaceAll']('{'+_0x56261a[0x0]+'}',this[_0x13c8('0xc')]['getVariable'](_0x56261a[0x0])['extra']||_0x56261a[0x0]);}}if(_0x4efc83['length']===0x1){return _0x3d57ea['toString']();}return this[_0x13c8('0x91')](_0x3d57ea);};AGIVertices['prototype'][_0x13c8('0x93')]=function(_0x2ecd16,_0x1102b7){var _0x379b49=this['channel'][_0x13c8('0x10')](_0x2ecd16);if(_0x379b49['result']===-0x1){return _0x379b49;}logger['info'](util['format'](_0x13c8('0x94'),_0x1102b7,_0x379b49['extra']));return this[_0x13c8('0xc')]['setVariable'](_0x1102b7,_0x379b49[_0x13c8('0x95')]);};AGIVertices[_0x13c8('0xf')]['isConfigured']=function(_0x1462e8){return _0x1462e8&&_0x1462e8!=='0'&&_0x1462e8!=='-1'&&_0x1462e8!=='';};AGIVertices[_0x13c8('0xf')][_0x13c8('0x96')]=function(_0x3e58ee){this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x3e58ee,'-');_0x3e58ee[_0x13c8('0x98')]=_0x3e58ee[_0x13c8('0x96')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x13c8('0xf')]['mrcpsynth']=function(_0x196d1d){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x196d1d[_0x13c8('0x33')]));if(!this['isConfigured'](_0x196d1d[_0x13c8('0x57')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x99'));}var _0x27bfb0='\x22'+_0x196d1d['text']+'\x22';if(this[_0x13c8('0x7a')](_0x196d1d[_0x13c8('0x71')])){_0x27bfb0+=','+_0x196d1d['options'];}var _0x182a2a=this[_0x13c8('0xc')]['exec'](_0x13c8('0x9a'),_0x27bfb0);if(_0x182a2a[_0x13c8('0x9b')]===-0x1){return _0x182a2a;}return this[_0x13c8('0xc')]['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x27bfb0));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x9c')]=function(_0x47847a){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x9d'),_0x47847a[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x47847a[_0x13c8('0x9e')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xa0'));}var _0x12c566=_0x47847a[_0x13c8('0x9e')];if(this['isConfigured'](_0x47847a['options'])){_0x12c566+=','+_0x47847a[_0x13c8('0x71')];}var _0x475d5a=this[_0x13c8('0xc')][_0x13c8('0x53')](_0x13c8('0xa1'),_0x12c566);if(_0x475d5a[_0x13c8('0x9b')]===-0x1){return _0x475d5a;}var _0x115a5e=this['getAndSetVariable'](_0x13c8('0xa2'),_0x13c8('0xa3'));if(_0x115a5e[_0x13c8('0x9b')]===-0x1){return _0x115a5e;}var _0x5b2a1e=this[_0x13c8('0x93')](_0x13c8('0xa4'),_0x13c8('0xa5'));if(_0x5b2a1e[_0x13c8('0x9b')]===-0x1){return _0x5b2a1e;}var _0x4f96e6=this[_0x13c8('0x93')](_0x13c8('0xa6'),_0x13c8('0xa7'));if(_0x4f96e6[_0x13c8('0x9b')]===-0x1){return _0x4f96e6;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x12c566));};AGIVertices['prototype']['agi']=function(_0x4790ed){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xa8'),_0x4790ed['label']));return this['channel']['agi']([_0x4790ed[_0x13c8('0xa9')],_0x4790ed['args']]);};AGIVertices['prototype'][_0x13c8('0xaa')]=function(_0x4b3d22){logger['info'](util['format'](_0x13c8('0xab'),_0x4b3d22[_0x13c8('0x33')]));if(this['isConfigured'](_0x4b3d22[_0x13c8('0x62')])){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xac'),_0x4b3d22[_0x13c8('0x62')]));var _0x2e761b=this[_0x13c8('0xc')]['wait'](_0x4b3d22[_0x13c8('0x62')]);if(_0x2e761b[_0x13c8('0x9b')]===-0x1){return _0x2e761b;}}return this[_0x13c8('0xc')][_0x13c8('0xaa')]();};AGIVertices[_0x13c8('0xf')][_0x13c8('0xad')]=function(_0x46408a){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xae'),_0x46408a[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x46408a[_0x13c8('0x45')])){return this['channel'][_0x13c8('0x27')](_0x46408a,_0x13c8('0xaf'));}_0x46408a[_0x13c8('0x46')]=moment();if(this['isConfigured'](_0x46408a['delay'])){_0x46408a[_0x13c8('0x46')]=moment()['add'](_0x46408a[_0x13c8('0xb0')],_0x13c8('0xb1'));}if(!this[_0x13c8('0x7a')](_0x46408a[_0x13c8('0x49')])){_0x46408a['callback_priority']=0x2;}this[_0x13c8('0xb2')][_0x13c8('0x97')](this,_0x46408a);return this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0xb3'),_0x46408a[_0x13c8('0xb4')],_0x46408a[_0x13c8('0x45')],_0x46408a[_0x13c8('0x46')]));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xb5')]=function(_0x4e9b63){logger[_0x13c8('0x29')](util['format'](_0x13c8('0xb6'),_0x4e9b63['label']));var _0x2f1227=this['channel'][_0x13c8('0x53')](_0x4e9b63[_0x13c8('0xb7')],_0x4e9b63[_0x13c8('0x71')]);if(_0x2f1227['result']===-0x1){return _0x2f1227;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Executed\x20command\x20%s\x20%s',_0x4e9b63[_0x13c8('0xb7')],_0x4e9b63[_0x13c8('0x71')]));};AGIVertices['prototype'][_0x13c8('0xb8')]=function(_0x3e3409){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xb9'),_0x3e3409[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x3e3409[_0x13c8('0x57')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x99'));}var _0x342d9d='\x22'+_0x3e3409[_0x13c8('0x57')]+'\x22';if(this[_0x13c8('0x7a')](_0x3e3409['options'])){_0x342d9d+=','+_0x3e3409[_0x13c8('0x71')];}var _0x35f511=this[_0x13c8('0xc')]['exec'](_0x13c8('0x9a'),_0x342d9d);if(_0x35f511[_0x13c8('0x9b')]===-0x1){return _0x35f511;}return this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xba'),_0x342d9d));};AGIVertices['prototype'][_0x13c8('0xbb')]=function(_0x5219d1){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x5219d1[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x5219d1[_0x13c8('0x57')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}var _0x5a9f85='\x22'+_0x5219d1['text']+'\x22';if(this[_0x13c8('0x7a')](_0x5219d1[_0x13c8('0x71')])){_0x5a9f85+=','+_0x5219d1['options'];}var _0x489a77=this[_0x13c8('0xc')][_0x13c8('0x53')](_0x13c8('0x9a'),_0x5a9f85);if(_0x489a77[_0x13c8('0x9b')]===-0x1){return _0x489a77;}return this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xba'),_0x5a9f85));};AGIVertices[_0x13c8('0xf')]['lumenvoxasr']=function(_0x13ac26){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xbc'),_0x13ac26[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x13ac26[_0x13c8('0x9e')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xa0'));}var _0x4b965a=_0x13ac26[_0x13c8('0x9e')];if(this['isConfigured'](_0x13ac26[_0x13c8('0x71')])){_0x4b965a+=','+_0x13ac26[_0x13c8('0x71')];}var _0x127303=this[_0x13c8('0xc')][_0x13c8('0x53')]('MRCPRecog',_0x4b965a);if(_0x127303[_0x13c8('0x9b')]===-0x1){return _0x127303;}var _0x8aca1a=this[_0x13c8('0x93')]('RECOG_CONFIDENCE()',_0x13c8('0xbd'));if(_0x8aca1a[_0x13c8('0x9b')]===-0x1){return _0x8aca1a;}var _0x56389e=this[_0x13c8('0x93')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x56389e['result']===-0x1){return _0x56389e;}var _0x1fb2e2=this[_0x13c8('0x93')]('RECOG_INSTANCE()',_0x13c8('0xbe'));if(_0x1fb2e2[_0x13c8('0x9b')]===-0x1){return _0x1fb2e2;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x4b965a));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xbf')]=function(_0x5cfad3){logger['info'](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x5cfad3[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x5cfad3[_0x13c8('0x9e')])){return this['channel'][_0x13c8('0x9f')]('no\x20grammar\x20configured');}var _0x26aade=_0x5cfad3[_0x13c8('0x9e')];if(this[_0x13c8('0x7a')](_0x5cfad3['options'])){_0x26aade+=','+_0x5cfad3[_0x13c8('0x71')];}var _0x4b5426=this[_0x13c8('0xc')]['exec'](_0x13c8('0xa1'),_0x26aade);if(_0x4b5426[_0x13c8('0x9b')]===-0x1){return _0x4b5426;}var _0x59f404=this[_0x13c8('0x93')]('RECOG_CONFIDENCE()',_0x13c8('0xc0'));if(_0x59f404[_0x13c8('0x9b')]===-0x1){return _0x59f404;}var _0x9f36df=this[_0x13c8('0x93')](_0x13c8('0xa4'),_0x13c8('0xc1'));if(_0x9f36df[_0x13c8('0x9b')]===-0x1){return _0x9f36df;}var _0x2e6fb2=this[_0x13c8('0x93')]('RECOG_INSTANCE()',_0x13c8('0xc2'));if(_0x2e6fb2[_0x13c8('0x9b')]===-0x1){return _0x2e6fb2;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xc3'),_0x26aade));};AGIVertices['prototype'][_0x13c8('0xc4')]=function(_0x5e2137){logger['info'](util['format']('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5e2137[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x5e2137[_0x13c8('0xc5')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5e2137,_0x13c8('0xc6'));}var _0x5a127c=this[_0x13c8('0x18')]['sync'](this,_0x5e2137['odbc_id']);if(!_0x5a127c){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5e2137,_0x13c8('0xc7'));}if(!this['isConfigured'](_0x5e2137[_0x13c8('0x2b')])){return this[_0x13c8('0xc')]['error'](_0x5e2137,_0x13c8('0xc8'));}var _0xbac293=_0x5e2137[_0x13c8('0x2b')][_0x13c8('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xc9'),_0xbac293));var _0x5f344c=this[_0x13c8('0x26')][_0x13c8('0x97')](this,_0x5a127c,_0xbac293);this['createSquareDetailsReport'][_0x13c8('0x97')](this,_0x5e2137,_0xbac293);if(!this['isConfigured'](_0x5e2137['variable_id'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xca'));}var _0x3fdc69=this[_0x13c8('0x10')][_0x13c8('0x97')](this,_0x5e2137[_0x13c8('0xcb')]);if(!_0x3fdc69){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5e2137,_0x13c8('0xcc'));}var _0x83bdf5=this;_0x5f344c[_0x13c8('0xcd')](function(_0x5a9169,_0x114bbf){Object['keys'](_0x5a9169)[_0x13c8('0xcd')](function(_0x20240b){_0x83bdf5[_0x13c8('0xc')]['setVariable'](util[_0x13c8('0x24')](_0x13c8('0xce'),_0x3fdc69,_0x114bbf,_0x20240b),_0x5a9169[_0x20240b]);});});this['channel'][_0x13c8('0x8f')](util['format'](_0x13c8('0xcf'),_0x3fdc69),_0x5f344c[_0x13c8('0x8b')]);return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xd0'),_0x3fdc69));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xd1')]=function(_0x2a6201){logger[_0x13c8('0xd2')](util[_0x13c8('0x24')](_0x13c8('0xd3'),_0x2a6201[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x2a6201['sip_id'])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x2a6201,_0x13c8('0xd4'));}var _0x16dd2b=this[_0x13c8('0x1a')]['sync'](this,_0x2a6201['sip_id']);if(!_0x16dd2b){return this['channel'][_0x13c8('0x27')](_0x2a6201,_0x13c8('0xd5'));}var _0x2e81bc=this[_0x13c8('0xc')][_0x13c8('0x53')]('DIAL',[util['format']('SIP/%s',_0x16dd2b),_0x2a6201[_0x13c8('0x62')],_0x2a6201['opts'],_0x2a6201[_0x13c8('0x60')]]);if(_0x2e81bc['result']===-0x1){return _0x2e81bc;}return this[_0x13c8('0xc')]['noop'](util['format'](_0x13c8('0xd6'),_0x13c8('0xd7')));};AGIVertices['prototype'][_0x13c8('0xd8')]=function(_0x3da91c){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xd9'),_0x3da91c['label']));if(!this[_0x13c8('0x7a')](_0x3da91c[_0x13c8('0x73')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xda'));}if(!this['isConfigured'](_0x3da91c[_0x13c8('0x57')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}this[_0x13c8('0xc')]['bot']=!![];this[_0x13c8('0x32')](_0x3da91c);this[_0x13c8('0x3f')](_0x3da91c[_0x13c8('0x57')],'in','','');this['channel']['noop'](util['format'](_0x13c8('0xdb'),_0x3da91c['text']));var _0x242aa0=this[_0x13c8('0x72')][_0x13c8('0x97')](this,_0x3da91c);if(_0x242aa0){for(var _0x3d1730 in _0x242aa0){if(_0x242aa0[_0x13c8('0x87')](_0x3d1730)){this[_0x13c8('0xc')]['setVariable'](util[_0x13c8('0x24')](_0x13c8('0xdc'),_0x3d1730[_0x13c8('0x67')]()),_0x242aa0[_0x3d1730]);}}this[_0x13c8('0x3f')](_0x242aa0[_0x13c8('0xdd')],_0x13c8('0xde'),_0x13c8('0xd8'),'');return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Dialogflow\x20Result\x20%s',_0x242aa0['speech']));}return this['channel']['error'](_0x3da91c,'Dialogflow\x20is\x20unreachable');};AGIVertices[_0x13c8('0xf')][_0x13c8('0xdf')]=function(_0x19efae){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xe0'),_0x19efae[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x19efae['dialogflowV2_project_id'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xe1'));}if(!this['isConfigured'](_0x19efae['client_email'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xe2'));}if(!this[_0x13c8('0x7a')](_0x19efae[_0x13c8('0x75')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0xe3'));}if(!this['isConfigured'](_0x19efae[_0x13c8('0xe4')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20anguage\x20configured');}if(!this[_0x13c8('0x7a')](_0x19efae['text'])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}this[_0x13c8('0xc')][_0x13c8('0xe5')]=!![];this[_0x13c8('0x32')](_0x19efae);this[_0x13c8('0x3f')](_0x19efae[_0x13c8('0x57')],'in','','');this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xe6'),_0x19efae[_0x13c8('0x57')]));var _0x3a8efc=this[_0x13c8('0x74')][_0x13c8('0x97')](this,_0x19efae);if(_0x3a8efc){for(var _0x4be373 in _0x3a8efc){if(_0x3a8efc[_0x13c8('0x87')](_0x4be373)){if(_0x4be373!==_0x13c8('0xe7')){this['channel']['setVariable'](util[_0x13c8('0x24')](_0x13c8('0xdc'),_0x4be373[_0x13c8('0x67')]()),_0x3a8efc[_0x4be373]);}}}this[_0x13c8('0x3f')](_0x3a8efc[_0x13c8('0xdd')],_0x13c8('0xde'),_0x13c8('0xdf'),_0x3a8efc[_0x13c8('0xe7')]);return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0xe8'),_0x3a8efc[_0x13c8('0xdd')]));}return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x19efae,_0x13c8('0xe9'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xea')]=function(_0x15e028){logger[_0x13c8('0x29')](util['format'](_0x13c8('0xeb'),_0x15e028[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x15e028[_0x13c8('0xec')])){return this['channel'][_0x13c8('0x9f')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x13c8('0x7a')](_0x15e028[_0x13c8('0xed')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20username\x20configured');}if(!this[_0x13c8('0x7a')](_0x15e028[_0x13c8('0xee')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0xef'));}if(!this[_0x13c8('0x7a')](_0x15e028[_0x13c8('0xf0')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}this[_0x13c8('0xc')][_0x13c8('0xe5')]=!![];this[_0x13c8('0x32')](_0x15e028);this[_0x13c8('0x3f')](_0x15e028['text'],'in','','');this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')]('Trying\x20SestekNDA:\x20%s',_0x15e028[_0x13c8('0x57')]));var _0x88e78b=this['sestekNDA'][_0x13c8('0x97')](this,_0x15e028);if(_0x88e78b){for(var _0xcc9230 in _0x88e78b){if(_0x88e78b['hasOwnProperty'](_0xcc9230)){this[_0x13c8('0xc')][_0x13c8('0x8f')](util[_0x13c8('0x24')]('SESTEK_NDA_%s',_0xcc9230[_0x13c8('0x67')]()),_0x88e78b[_0xcc9230]);}}this[_0x13c8('0x3f')](_0x88e78b[_0x13c8('0xdd')],_0x13c8('0xde'),'sesteknda','');if(_0x88e78b[_0x13c8('0xf1')]){this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0xf2'),_0x88e78b[_0x13c8('0xf1')]));var _0x3f4ff2=this['channel'][_0x13c8('0xf3')](_0x88e78b[_0x13c8('0xf1')]);try{fs['unlink'](_0x88e78b['audiofile']+'.wav');}catch(_0x408b77){logger['error'](_0x408b77);}return _0x3f4ff2;}else{return this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')]('SestekNDA\x20Result\x20%s',_0x88e78b[_0x13c8('0xdd')]));}}return this[_0x13c8('0xc')]['error'](_0x15e028,_0x13c8('0xf4'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xf5')]=function(_0x224d33){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xf6'),_0x224d33['label']));return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xf5'));};AGIVertices['prototype']['ext_dial']=function(_0x339380){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0xf7'),_0x339380[_0x13c8('0x33')]));var _0x37bc9c='';if(_0x339380[_0x13c8('0xf8')]){if(!this[_0x13c8('0x7a')](_0x339380[_0x13c8('0xf8')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x339380,_0x13c8('0xf9'));}else{var _0x1353bf=parseInt(_0x339380[_0x13c8('0xf8')],0xa);if(isNaN(_0x1353bf)){_0x37bc9c=_0x339380[_0x13c8('0xf8')];}else{_0x37bc9c=this[_0x13c8('0xfa')][_0x13c8('0x97')](this,_0x339380[_0x13c8('0xf8')]);if(!_0x37bc9c){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x339380,_0x13c8('0xfb'));}}}}else if(_0x339380[_0x13c8('0xfc')]){_0x37bc9c=_0x339380['trunk_name'];}else{return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x339380,_0x13c8('0xf9'));}var _0x17d5f2=this[_0x13c8('0xc')][_0x13c8('0x53')]('DIAL',[util[_0x13c8('0x24')](_0x13c8('0xfd'),_0x37bc9c,_0x339380[_0x13c8('0xb4')]),_0x339380['timeout'],_0x339380[_0x13c8('0xfe')],_0x339380[_0x13c8('0x60')]]);if(_0x17d5f2[_0x13c8('0x9b')]===-0x1){return _0x17d5f2;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0xd6'),_0x13c8('0xd7')));};AGIVertices[_0x13c8('0xf')][_0x13c8('0xff')]=function(_0x450955){logger['info'](util[_0x13c8('0x24')](_0x13c8('0x100'),_0x450955[_0x13c8('0x33')]));return this[_0x13c8('0xc')]['noop'](_0x13c8('0xff'));};AGIVertices[_0x13c8('0xf')]['getdigits']=function(_0x5a6769){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x101'),_0x5a6769[_0x13c8('0x33')]));if(_0x5a6769[_0x13c8('0x98')]===0x0){return this[_0x13c8('0x96')](_0x5a6769);}_0x5a6769[_0x13c8('0x98')]-=0x1;if(!this[_0x13c8('0x7a')](_0x5a6769[_0x13c8('0x102')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5a6769,_0x13c8('0x103'));}var _0x432584=this[_0x13c8('0x104')][_0x13c8('0x97')](this,_0x5a6769[_0x13c8('0x102')]);if(!_0x432584){return this['channel'][_0x13c8('0x27')](_0x5a6769,_0x13c8('0x105'));}if(!this[_0x13c8('0x7a')](_0x5a6769[_0x13c8('0xcb')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x13c8('0xca'));}var _0x3976a1=this[_0x13c8('0xc')][_0x13c8('0x106')](_0x432584,_0x5a6769[_0x13c8('0x107')],_0x5a6769[_0x13c8('0x108')]);var _0x52aca7=_0x3976a1[_0x13c8('0x9b')]?_0x3976a1[_0x13c8('0x9b')][_0x13c8('0x48')]():'';logger[_0x13c8('0x29')](_0x13c8('0x109'),JSON['stringify'](_0x3976a1));if(_0x3976a1[_0x13c8('0x9b')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x5a6769,_0x52aca7);return _0x3976a1;}else if(_0x3976a1[_0x13c8('0x95')]===_0x13c8('0x62')){_0x3976a1[_0x13c8('0x9b')]=_0x52aca7[_0x13c8('0x8b')]>=parseInt(_0x5a6769[_0x13c8('0x10a')])?'x':'i';}else{_0x3976a1[_0x13c8('0x9b')]=_0x52aca7[_0x13c8('0x8b')]>=parseInt(_0x5a6769[_0x13c8('0x10a')])&&_0x52aca7[_0x13c8('0x8b')]<=parseInt(_0x5a6769[_0x13c8('0x108')])?'x':'i';}var _0x2804c1=this['getVariable'][_0x13c8('0x97')](this,_0x5a6769[_0x13c8('0xcb')]);if(!_0x2804c1){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5a6769,'no\x20variable\x20found');}this[_0x13c8('0xc')][_0x13c8('0x8f')](_0x2804c1,_0x52aca7);if(this[_0x13c8('0x7a')](_0x5a6769[_0x13c8('0x10b')])){var _0x497ba8=parseInt(_0x5a6769['hiddendigitsnum'],0xa);var _0x430c52=rs[_0x13c8('0x10c')]({'charset':'*','length':_0x497ba8});var _0x5e3bcc=_0x52aca7[_0x13c8('0x8b')];if(_0x5e3bcc>0x0){if(_0x5e3bcc>_0x497ba8){this['createSquareDetailsReport']['sync'](this,_0x5a6769,_0x5a6769['hiddendigitspos']===_0x13c8('0x10d')?_0x430c52+_0x52aca7['substr'](_0x497ba8):_0x52aca7[_0x13c8('0x10e')](0x0,_0x5e3bcc-_0x497ba8)+_0x430c52);}else{this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x5a6769,rs['generate']({'charset':'*','length':_0x5e3bcc}));}}else{this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x5a6769,'');}}else{this[_0x13c8('0x32')]['sync'](this,_0x5a6769,_0x52aca7);}return _0x3976a1;};AGIVertices[_0x13c8('0xf')][_0x13c8('0x10f')]=function(_0x303862){logger[_0x13c8('0x29')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x303862['label']));return this['getdigits'](_0x303862);};AGIVertices[_0x13c8('0xf')][_0x13c8('0x110')]=function(_0xa29d8f){logger['info'](util[_0x13c8('0x24')](_0x13c8('0x111'),_0xa29d8f['label']));this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0xa29d8f,_0xa29d8f['goalname']);return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x112'),_0xa29d8f[_0x13c8('0x113')]));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x114')]=function(_0x59c29b){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x115'),_0x59c29b['label']));if(!this['isConfigured'](_0x59c29b['aws_access_key_id'])||!this['isConfigured'](_0x59c29b['aws_secret_access_key'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x116'));}if(!this[_0x13c8('0x7a')](_0x59c29b[_0x13c8('0x57')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x99'));}this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x117'),_0x59c29b[_0x13c8('0x57')]));var _0x5c9bc4=this[_0x13c8('0x7c')]['sync'](this,_0x59c29b);if(_0x5c9bc4){this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0x118'),_0x5c9bc4));var _0x54b45=this['channel'][_0x13c8('0xf3')](_0x5c9bc4);try{fs[_0x13c8('0x119')](_0x5c9bc4+_0x13c8('0x11a'));}catch(_0x4a285c){logger['error'](_0x4a285c);}return _0x54b45;}return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x59c29b,_0x13c8('0x11b'));};AGIVertices['prototype'][_0x13c8('0x11c')]=function(_0x1d8318){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x11d'),_0x1d8318[_0x13c8('0x33')]));if(!this['isConfigured'](_0x1d8318[_0x13c8('0x7d')])||!this[_0x13c8('0x7a')](_0x1d8318[_0x13c8('0x7e')])){return this[_0x13c8('0xc')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x13c8('0x7a')](_0x1d8318['aws_bot_name'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20bot\x20name\x20configured');}if(!this['isConfigured'](_0x1d8318['text'])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x99'));}this[_0x13c8('0xc')][_0x13c8('0xe5')]=!![];this[_0x13c8('0x32')](_0x1d8318);this[_0x13c8('0x3f')](_0x1d8318[_0x13c8('0x57')],'in','','');this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Trying\x20Amazon\x20Lex:\x20%s',_0x1d8318['text']));var _0x45ba1d=this[_0x13c8('0x82')]['sync'](this,_0x1d8318);if(_0x45ba1d){for(var _0xf246d2 in _0x45ba1d){if(_0x45ba1d[_0x13c8('0x87')](_0xf246d2)&&_[_0x13c8('0x8c')](_0x45ba1d[_0xf246d2])){this[_0x13c8('0xc')][_0x13c8('0x8f')](util[_0x13c8('0x24')](_0x13c8('0x11e'),_0xf246d2[_0x13c8('0x67')]()),_0x45ba1d[_0xf246d2]);}}if(_[_0x13c8('0x40')](_0x45ba1d['message'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x11f'));}else{this[_0x13c8('0x3f')](_0x45ba1d['message'],_0x13c8('0xde'),'amazonlex','');return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x120'),_0x45ba1d[_0x13c8('0x121')]));}}return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x1d8318,_0x13c8('0x122'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x123')]=function(_0x21f6e9){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x124'),_0x21f6e9[_0x13c8('0x33')],_0x21f6e9[_0x13c8('0x62')]));if(!this['isConfigured'](_0x21f6e9[_0x13c8('0x73')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0xda'));}var _0x29b169='wav';var _0xc5ea47=util[_0x13c8('0x24')](_0x13c8('0x125'),FILES_PATH,rs[_0x13c8('0x10c')](0x4));var _0x245a6c=util[_0x13c8('0x24')](_0x13c8('0x8e'),_0xc5ea47,_0x29b169);var _0x1dc368=!![];if(_0x21f6e9[_0x13c8('0x126')]===_0x13c8('0x127')){_0x1dc368=![];}var _0x4e2d8a=this[_0x13c8('0xc')][_0x13c8('0x128')](_0xc5ea47,_0x29b169,_0x21f6e9[_0x13c8('0x129')],_0x21f6e9['timeout'],undefined,_0x1dc368);if(_0x4e2d8a[_0x13c8('0x9b')]!==-0x1){this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x12a'),_0x245a6c));var _0x38a0c=this[_0x13c8('0x83')]['sync'](this,_0x21f6e9,_0x245a6c);if(_0x38a0c){for(var _0x562c46 in _0x38a0c){if(_0x38a0c['hasOwnProperty'](_0x562c46)){this[_0x13c8('0xc')][_0x13c8('0x8f')](util['format'](_0x13c8('0x12b'),_0x562c46[_0x13c8('0x67')]()),_0x38a0c[_0x562c46]);}}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0x12c'),JSON[_0x13c8('0x90')](_0x38a0c)));}}return _0x4e2d8a;};AGIVertices[_0x13c8('0xf')]['tildeasr']=function(_0x16979c){logger['info'](util[_0x13c8('0x24')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x16979c[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x16979c[_0x13c8('0x85')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20appid\x20configured');}if(!this[_0x13c8('0x7a')](_0x16979c['appsecret'])){return this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20appsecret\x20configured');}var _0x5a731b=_0x13c8('0x12d');var _0x4e707f=util[_0x13c8('0x24')](_0x13c8('0x125'),FILES_PATH,rs[_0x13c8('0x10c')](0x4));var _0x4c9976=util[_0x13c8('0x24')](_0x13c8('0x8e'),_0x4e707f,_0x5a731b);var _0x3eba71=!![];if(_0x16979c['beep']===_0x13c8('0x127')){_0x3eba71=![];}var _0x7e9938=this[_0x13c8('0xc')][_0x13c8('0x128')](_0x4e707f,_0x5a731b,_0x16979c['intKey'],_0x16979c[_0x13c8('0x62')],undefined,_0x3eba71);if(_0x7e9938['result']!==-0x1){this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format']('tilde\x20%s\x20file\x20created',_0x4c9976));var _0x2c568c=this[_0x13c8('0x84')][_0x13c8('0x97')](this,_0x16979c,_0x4c9976);if(_0x2c568c){for(var _0x55aef2 in _0x2c568c){if(_0x2c568c['hasOwnProperty'](_0x55aef2)){this['channel'][_0x13c8('0x8f')](util[_0x13c8('0x24')](_0x13c8('0x12e'),_0x55aef2[_0x13c8('0x67')]()),_0x2c568c[_0x55aef2]);}}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x12f'),JSON['stringify'](_0x2c568c)));}}return _0x7e9938;};AGIVertices[_0x13c8('0xf')][_0x13c8('0x130')]=function(_0x1394b9){logger['info'](util[_0x13c8('0x24')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1394b9[_0x13c8('0x33')]));return this['channel'][_0x13c8('0x131')](_0x1394b9['context'],_0x1394b9[_0x13c8('0x3a')],_0x1394b9[_0x13c8('0x3b')]);};AGIVertices[_0x13c8('0xf')][_0x13c8('0x132')]=function(_0x276b95){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x276b95[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x276b95[_0x13c8('0x133')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x276b95,_0x13c8('0x134'));}try{var _0x457c43=eval(_0x276b95[_0x13c8('0x133')])?_0x13c8('0x135'):'false';this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')](_0x13c8('0x136'),_0x276b95[_0x13c8('0x133')],_0x457c43));return{'code':0xc8,'result':_0x457c43};}catch(_0x515cb4){return{'code':0xc8,'result':_0x13c8('0x137')};}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x138')]=function(_0x3bb615){logger['info'](util['format'](_0x13c8('0x139'),_0x3bb615['label']));if(!this[_0x13c8('0x7a')](_0x3bb615[_0x13c8('0x13a')])){return this['channel']['error'](_0x3bb615,'no\x20interval\x20configured');}var _0x3db291=this[_0x13c8('0x13b')][_0x13c8('0x97')](this,_0x3bb615['interval_id']);if(!_0x3db291){return this['channel'][_0x13c8('0x27')](_0x3bb615,_0x13c8('0x13c'));}for(var _0x294f16=0x0;_0x294f16<_0x3db291[_0x13c8('0x8b')];_0x294f16+=0x1){var _0x1c260b=this['channel'][_0x13c8('0x10')](util[_0x13c8('0x24')](_0x13c8('0x13d'),_0x3db291[_0x294f16]));if(_0x1c260b[_0x13c8('0x9b')]===-0x1){return _0x1c260b;}logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('IFTIME\x20%s\x20%s',_0x3db291[_0x294f16],_0x1c260b[_0x13c8('0x95')]));if(_0x1c260b['extra']===_0x13c8('0x135')){logger['info'](util['format'](_0x13c8('0x13e'),_0x3db291[_0x294f16],_0x13c8('0x135')));this['channel']['noop'](util[_0x13c8('0x24')](_0x13c8('0x13e'),_0x3db291[_0x294f16],'true'));return{'code':0xc8,'result':_0x13c8('0x135')};}else{logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x13e'),_0x3db291[_0x294f16],'false'));this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0x13e'),_0x3db291[_0x294f16],_0x13c8('0x137')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x13c8('0xf')][_0x13c8('0x13f')]=function(_0xdf7e8f){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x140'),_0xdf7e8f['label']));return this[_0x13c8('0xc')][_0x13c8('0x13f')]();};AGIVertices[_0x13c8('0xf')][_0x13c8('0x141')]=function(_0x4cecb7){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4cecb7['label']));if(!this['isConfigured'](_0x4cecb7[_0x13c8('0x73')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xda'));}var _0x25cb85=_0x13c8('0x12d');var _0x3c6a8f=util[_0x13c8('0x24')](_0x13c8('0x125'),FILES_PATH,rs['generate'](0x4));var _0x511a31=util[_0x13c8('0x24')](_0x13c8('0x8e'),_0x3c6a8f,_0x25cb85);var _0x42cbef=!![];if(_0x4cecb7[_0x13c8('0x126')]===_0x13c8('0x127')){_0x42cbef=![];}var _0x3933fd=this['channel'][_0x13c8('0x128')](_0x3c6a8f,_0x25cb85,_0x4cecb7['intKey'],_0x4cecb7[_0x13c8('0x62')],undefined,_0x42cbef);if(_0x3933fd[_0x13c8('0x9b')]!==-0x1){this['channel']['noop'](util[_0x13c8('0x24')](_0x13c8('0x142'),_0x511a31));var _0x579429=this[_0x13c8('0x79')][_0x13c8('0x97')](this,_0x4cecb7,_0x511a31);if(_0x579429){for(var _0x36cd0e in _0x579429){if(_0x579429[_0x13c8('0x87')](_0x36cd0e)){this['channel'][_0x13c8('0x8f')](util[_0x13c8('0x24')]('ISPEECH_ASR_%s',_0x36cd0e['toUpperCase']()),_0x579429[_0x36cd0e]);}}return this[_0x13c8('0xc')]['noop'](util['format'](_0x13c8('0x143'),JSON[_0x13c8('0x90')](_0x579429)));}}return _0x3933fd;};AGIVertices['prototype'][_0x13c8('0x144')]=function(_0x31e768){logger['info'](util[_0x13c8('0x24')](_0x13c8('0x145'),_0x31e768['label']));if(!this['isConfigured'](_0x31e768[_0x13c8('0x73')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0xda'));}if(!this[_0x13c8('0x7a')](_0x31e768[_0x13c8('0x57')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')](_0x13c8('0x146'),_0x31e768[_0x13c8('0x57')]));var _0x4c5fd6=this[_0x13c8('0x77')][_0x13c8('0x97')](this,_0x31e768);if(_0x4c5fd6){this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')](_0x13c8('0x142'),_0x4c5fd6));var _0x2c97ae=this[_0x13c8('0xc')][_0x13c8('0xf3')](_0x4c5fd6,_0x31e768[_0x13c8('0x129')]);try{fs['unlink'](_0x4c5fd6+_0x13c8('0x11a'));}catch(_0x37ea14){logger[_0x13c8('0x27')](_0x37ea14);}return _0x2c97ae;}return this['channel'][_0x13c8('0x27')](_0x31e768,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x13c8('0xf')][_0x13c8('0x147')]=function(_0x536065){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x148'),_0x536065[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x536065['findBy'])){return this['channel'][_0x13c8('0x27')](_0x536065,_0x13c8('0x149'));}logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x13c8('0xc')][_0x13c8('0x38')],_0x536065[_0x13c8('0x14a')]));var _0x9aa6c1=this['agentLogin'][_0x13c8('0x97')](this,_0x536065[_0x13c8('0x14a')]);if(_0x9aa6c1){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x14b'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x536065[_0x13c8('0x14a')]));this['channel'][_0x13c8('0x9f')](util['format'](_0x13c8('0x14b'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x536065[_0x13c8('0x14a')]));return{'code':0xc8,'result':_0x13c8('0x14c')};}else{logger['info'](util['format'](_0x13c8('0x14d'),this['channel'][_0x13c8('0x38')],_0x536065[_0x13c8('0x14a')]));this['channel'][_0x13c8('0x9f')](util['format'](_0x13c8('0x14d'),this['channel'][_0x13c8('0x38')],_0x536065['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x14e')]=function(_0x34af92){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x14f'),_0x34af92['label']));if(!this[_0x13c8('0x7a')](_0x34af92['findBy'])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x34af92,_0x13c8('0x149'));}logger[_0x13c8('0x29')](util['format'](_0x13c8('0x150'),this[_0x13c8('0xc')]['callerid'],_0x34af92[_0x13c8('0x14a')]));var _0x41901d=this['agentLogout']['sync'](this,_0x34af92[_0x13c8('0x14a')]);if(_0x41901d){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x14b'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x34af92[_0x13c8('0x14a')]));this['channel'][_0x13c8('0x9f')](util[_0x13c8('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x34af92[_0x13c8('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x14d'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x34af92[_0x13c8('0x14a')]));this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x14d'),this['channel'][_0x13c8('0x38')],_0x34af92[_0x13c8('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x13c8('0x151')]=function(_0x2d4468){logger['info'](util[_0x13c8('0x24')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x2d4468[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x2d4468['operation'])){return this['channel']['error'](_0x2d4468,'no\x20operation\x20configured');}this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')](_0x13c8('0x152'),_0x2d4468[_0x13c8('0x153')]));var _0x597788=eval(_0x2d4468[_0x13c8('0x153')]);if(!this[_0x13c8('0x7a')](_0x2d4468[_0x13c8('0xcb')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0xca'));}var _0x57235d=this[_0x13c8('0x10')][_0x13c8('0x97')](this,_0x2d4468[_0x13c8('0xcb')]);if(!_0x57235d){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x2d4468,'no\x20variable\x20found');}if(_[_0x13c8('0x8a')](_0x597788)){var _0x601ba7=this;_0x597788['forEach'](function(_0x5bb6f5,_0x4ea4c8){_0x601ba7[_0x13c8('0xc')][_0x13c8('0x8f')](util[_0x13c8('0x24')](_0x13c8('0x154'),_0x57235d,_0x4ea4c8),_0x5bb6f5);});return this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format'](_0x13c8('0x155'),_0x57235d));}else{return this['channel'][_0x13c8('0x8f')](_0x57235d,_0x597788);}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x156')]=function(_0x46b438){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x157'),_0x46b438[_0x13c8('0x33')]));if(_0x46b438[_0x13c8('0x98')]===0x0){return this['maxRetry'](_0x46b438);}_0x46b438[_0x13c8('0x98')]-=0x1;if(!this[_0x13c8('0x7a')](_0x46b438['file_id'])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x46b438,'no\x20file\x20audio\x20selected');}var _0x33edb7=this[_0x13c8('0x104')]['sync'](this,_0x46b438[_0x13c8('0x102')]);if(!_0x33edb7){return this[_0x13c8('0xc')]['error'](_0x46b438,'no\x20file\x20audio\x20found');}var _0x1ba49f=this[_0x13c8('0xc')][_0x13c8('0x106')](_0x33edb7,_0x46b438[_0x13c8('0x107')],_0x46b438[_0x13c8('0x158')]);var _0x28f37d=_0x1ba49f[_0x13c8('0x9b')];if(_0x1ba49f['result']===-0x1){this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x46b438,'-1');return _0x1ba49f;}else if(_0x1ba49f[_0x13c8('0x95')]===_0x13c8('0x62')){_0x1ba49f['result']=_0x1ba49f['result'][_0x13c8('0x8b')]>0x0?_0x1ba49f[_0x13c8('0x9b')]:'t';}else if(_[_0x13c8('0x43')](_0x1ba49f[_0x13c8('0x9b')])){_0x1ba49f['result']='#';_0x28f37d='#';}if(!this[_0x13c8('0x7a')](_0x46b438[_0x13c8('0xcb')])){this[_0x13c8('0xc')][_0x13c8('0x9f')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x4035b9=this[_0x13c8('0x10')][_0x13c8('0x97')](this,_0x46b438[_0x13c8('0xcb')]);if(!_0x4035b9){return this['channel']['error'](_0x46b438,'no\x20variable\x20found');}this['channel'][_0x13c8('0x8f')](_0x4035b9,_0x28f37d);}this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x46b438,_0x28f37d);return _0x1ba49f;};AGIVertices['prototype'][_0x13c8('0x9f')]=function(_0x24ae43){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x24ae43[_0x13c8('0x33')]));return this[_0x13c8('0xc')]['noop'](_0x24ae43[_0x13c8('0x159')]||_0x24ae43[_0x13c8('0x33')]);};AGIVertices[_0x13c8('0xf')][_0x13c8('0x15a')]=function(_0x3d93e7){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x15b'),_0x3d93e7[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x3d93e7[_0x13c8('0x14a')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x3d93e7,'no\x20find\x20by\x20configured');}logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x150'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x3d93e7[_0x13c8('0x14a')]));var _0x23525f=this['getPause'][_0x13c8('0x97')](this,_0x3d93e7[_0x13c8('0x15c')]);var _0x13af90=this[_0x13c8('0x15d')][_0x13c8('0x97')](this,_0x3d93e7['findBy'],_0x23525f);if(_0x13af90){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x14b'),this[_0x13c8('0xc')]['callerid'],_0x3d93e7[_0x13c8('0x14a')]));this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x14b'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x3d93e7[_0x13c8('0x14a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x13c8('0x29')](util['format'](_0x13c8('0x14d'),this['channel']['callerid'],_0x3d93e7[_0x13c8('0x14a')]));this['channel']['noop'](util[_0x13c8('0x24')](_0x13c8('0x14b'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x3d93e7[_0x13c8('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x15e')]=function(_0x2de387){logger['info'](util['format'](_0x13c8('0x15f'),_0x2de387[_0x13c8('0x33')]));if(!this['isConfigured'](_0x2de387[_0x13c8('0x102')])){return this['channel'][_0x13c8('0x27')](_0x2de387,_0x13c8('0x103'));}var _0x34b1be=this[_0x13c8('0x104')][_0x13c8('0x97')](this,_0x2de387[_0x13c8('0x102')]);if(!_0x34b1be){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x2de387,_0x13c8('0x105'));}var _0x10423a=this['channel'][_0x13c8('0x53')]('PLAYBACK',[_0x34b1be,_0x2de387[_0x13c8('0xfe')]]);if(_0x10423a[_0x13c8('0x9b')]===-0x1){return _0x10423a;}return this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')](_0x13c8('0x160'),'PLAYBACK',_0x34b1be));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x161')]=function(_0x50b6e6){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x162'),_0x50b6e6[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x50b6e6[_0x13c8('0x163')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x50b6e6,'no\x20queue\x20selected');}var _0x42eb4f='';var _0x489f7d=parseInt(_0x50b6e6[_0x13c8('0x163')],0xa);if(isNaN(_0x489f7d)){_0x42eb4f=_0x50b6e6[_0x13c8('0x163')];}else{_0x42eb4f=this[_0x13c8('0x14')]['sync'](this,_0x50b6e6[_0x13c8('0x163')]);if(!_0x42eb4f){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x50b6e6,_0x13c8('0x164'));}}var _0xdf3f36='';if(this['isConfigured'](_0x50b6e6[_0x13c8('0x102')])){var _0x2a6e4a=this[_0x13c8('0x104')][_0x13c8('0x97')](this,_0x50b6e6[_0x13c8('0x102')]);if(_0x2a6e4a){_0xdf3f36=_0x2a6e4a;}}this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x50b6e6,_0x42eb4f);if(_0x50b6e6['opts']['indexOf']('x')<0x0){_0x50b6e6['opts']+='x';}if(_0x50b6e6[_0x13c8('0xfe')][_0x13c8('0x165')]('X')<0x0){_0x50b6e6['opts']+='X';}this['channel'][_0x13c8('0x8f')](_0x13c8('0x166'),_0x42eb4f?_0x42eb4f[_0x13c8('0x167')]():'');var _0x1586e4=this[_0x13c8('0xc')][_0x13c8('0x53')](_0x13c8('0x168'),[_0x42eb4f,_0x50b6e6[_0x13c8('0xfe')],_0x50b6e6[_0x13c8('0x60')],_0xdf3f36,_0x50b6e6[_0x13c8('0x62')],_0x50b6e6[_0x13c8('0x4')],_0x50b6e6['macro'],_0x50b6e6['gosub'],'',_0x50b6e6[_0x13c8('0x169')]]);if(_0x1586e4[_0x13c8('0x9b')]===-0x1){return _0x1586e4;}return this['channel']['noop'](util[_0x13c8('0x24')](_0x13c8('0x160'),_0x13c8('0x168'),_0x42eb4f));};AGIVertices['prototype'][_0x13c8('0x16a')]=function(_0x453d25){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x16b'),_0x453d25[_0x13c8('0x33')]));var _0x462c5f=_0x453d25[_0x13c8('0x16c')]||_0x13c8('0x12d');var _0x430032=util[_0x13c8('0x24')]('%s_%s',this[_0x13c8('0xc')][_0x13c8('0x37')],rs[_0x13c8('0x10c')](0x5));var _0x57b92a=util['format'](_0x13c8('0x16d'),FILES_PATH,_0x430032,_0x462c5f);var _0x3b2e92=util['format']('%s/recordings/%s',FILES_PATH,_0x430032);this[_0x13c8('0x36')][_0x13c8('0x97')](this,_0x453d25,_0x430032,_0x57b92a);this[_0x13c8('0xc')][_0x13c8('0x8f')](_0x13c8('0x16e'),_0x430032);logger[_0x13c8('0x29')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x3b2e92,_0x462c5f,_0x453d25[_0x13c8('0x16f')],_0x453d25[_0x13c8('0x62')]);return this[_0x13c8('0xc')][_0x13c8('0x128')](_0x3b2e92,_0x462c5f,_0x453d25[_0x13c8('0x16f')],_0x453d25[_0x13c8('0x62')],undefined,!![]);};AGIVertices['prototype'][_0x13c8('0x170')]=function(_0x44d436){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x171'),_0x44d436[_0x13c8('0x33')]));if(!this['isConfigured'](_0x44d436[_0x13c8('0x60')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x172'));}var _0x315f20=this[_0x13c8('0x5f')][_0x13c8('0x97')](this,_0x44d436);logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x173'),util['inspect'](_0x315f20,{'showHidden':![],'depth':null})));if(!this[_0x13c8('0x7a')](_0x44d436[_0x13c8('0xcb')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x174'));}var _0x484283=this[_0x13c8('0x10')][_0x13c8('0x97')](this,_0x44d436['variable_id']);if(!_0x484283){return this['channel']['error'](_0x44d436,'no\x20variable\x20found');}this[_0x13c8('0xc')][_0x13c8('0x8f')](util[_0x13c8('0x24')]('%s_STATUS_CODE',_0x484283),_0x315f20[_0x13c8('0x6f')]?_0x315f20[_0x13c8('0x6f')]:_0x13c8('0x175'));this[_0x13c8('0xc')][_0x13c8('0x8f')](util['format'](_0x13c8('0x176'),_0x484283),_0x315f20[_0x13c8('0x177')]?_0x315f20[_0x13c8('0x177')]:'OK');if(_0x315f20[_0x13c8('0x6d')]){try{this[_0x13c8('0x8d')](_0x315f20['body'],_0x484283);}catch(_0xf48c37){logger[_0x13c8('0x27')](util[_0x13c8('0x24')](_0x13c8('0x178'),_0x484283));}}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('variable\x20%s\x20set',_0x484283));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x179')]=function(_0x198f3d){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x17a'),_0x198f3d[_0x13c8('0x33')]));return this[_0x13c8('0xc')][_0x13c8('0x17b')](_0x198f3d['digits'][_0x13c8('0x55')](/\s+/g,''),_0x198f3d[_0x13c8('0x16f')]);};AGIVertices['prototype'][_0x13c8('0x17c')]=function(_0x180a93){logger['info'](util[_0x13c8('0x24')](_0x13c8('0x17d'),_0x180a93[_0x13c8('0x33')]));return this[_0x13c8('0xc')]['sayNumber'](_0x180a93['number'][_0x13c8('0x55')](/\s+/g,''),_0x180a93[_0x13c8('0x16f')]);};AGIVertices['prototype']['sayphonetic']=function(_0x1dfa47){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x17e'),_0x1dfa47[_0x13c8('0x33')]));return this[_0x13c8('0xc')][_0x13c8('0x17f')](_0x1dfa47[_0x13c8('0x57')],_0x1dfa47['escape_digits']);};AGIVertices[_0x13c8('0xf')][_0x13c8('0x180')]=function(_0x5f5654){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x181'),_0x5f5654[_0x13c8('0x33')]));if(!this['isConfigured'](_0x5f5654[_0x13c8('0x182')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x183'));}var _0x3d6211=this['getMailAccount']['sync'](this,_0x5f5654[_0x13c8('0x182')]);if(!_0x3d6211||!_0x3d6211[_0x13c8('0x184')]){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x5f5654,_0x13c8('0x185'));}var _0x1cb811={'from':util[_0x13c8('0x24')](_0x13c8('0x186'),_0x3d6211[_0x13c8('0x17')],_0x3d6211['email']||_0x3d6211[_0x13c8('0x184')][_0x13c8('0x187')]),'to':_0x5f5654['to']||'','cc':_0x5f5654['cc']||'','bcc':_0x5f5654[_0x13c8('0x188')]||'','subject':_0x5f5654[_0x13c8('0x189')],'html':_0x5f5654['text'],'text':_0x5f5654[_0x13c8('0x57')]};if(this['isConfigured'](_0x5f5654[_0x13c8('0x18a')])){}logger[_0x13c8('0xd2')](_0x13c8('0x18b'),JSON['stringify'](_0x1cb811));this[_0x13c8('0x32')]['sync'](this,_0x5f5654,_0x5f5654[_0x13c8('0x182')]);this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x3d6211[_0x13c8('0x17')]));this[_0x13c8('0x1f')][_0x13c8('0x97')](this,_0x3d6211[_0x13c8('0x18c')],_0x1cb811);return this[_0x13c8('0xc')][_0x13c8('0x9f')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x13c8('0xf')]['sendFax']=function(_0x67deff){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x67deff['label']));return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x18d'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x18e')]=function(_0x2722df){logger[_0x13c8('0x29')](util[_0x13c8('0x24')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x2722df['label']));if(!this[_0x13c8('0x7a')](_0x2722df[_0x13c8('0x18f')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x190'));}var _0x10317d=this['getSmsAccount']['sync'](this,_0x2722df[_0x13c8('0x18f')]);if(!_0x10317d){return this[_0x13c8('0xc')]['error'](_0x2722df,'no\x20sms\x20account\x20found');}var _0x59bdf1={'body':_0x2722df['sms_text'],'phone':_0x2722df['to']||'','SmsAccountId':_0x10317d['id']};logger['debug'](_0x13c8('0x191'),JSON['stringify'](_0x59bdf1));this[_0x13c8('0x32')]['sync'](this,_0x2722df,_0x2722df['sms_account_id']);this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x192'),_0x10317d[_0x13c8('0x17')]));this[_0x13c8('0x31')][_0x13c8('0x97')](this,_0x59bdf1);return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x193'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x194')]=function(_0x88071a){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x195'),_0x88071a[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x88071a[_0x13c8('0xcb')])){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x88071a,_0x13c8('0x196'));}var _0x4b045c=this[_0x13c8('0x10')]['sync'](this,_0x88071a[_0x13c8('0xcb')]);if(!_0x4b045c){return this[_0x13c8('0xc')]['error'](_0x88071a,'no\x20variable\x20found');}return this['channel'][_0x13c8('0x8f')](_0x4b045c,_0x88071a[_0x13c8('0x197')]);};AGIVertices[_0x13c8('0xf')][_0x13c8('0x198')]=function(_0x294b46){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x199'),_0x294b46['label']));this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x19a'));if(_0x294b46[_0x13c8('0xaa')]===_0x13c8('0x19b')){this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x19c'));return this['channel'][_0x13c8('0xaa')]();}return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x19d'));};AGIVertices['prototype'][_0x13c8('0x19e')]=function(_0xa509c8){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x19f'),_0xa509c8[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0xa509c8[_0x13c8('0x1a0')])){return this[_0x13c8('0xc')]['error'](_0xa509c8,'no\x20subproject\x20selected');}var _0x4f176b=this[_0x13c8('0x15')][_0x13c8('0x97')](this,_0xa509c8[_0x13c8('0x1a0')]);if(!this['isConfigured'](_0x4f176b)){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0xa509c8,util[_0x13c8('0x24')](_0x13c8('0x1a1'),_0xa509c8[_0x13c8('0x1a0')]));}if(_0x4f176b===this['channel']['arg_1']){return this[_0x13c8('0xc')][_0x13c8('0x27')](_0xa509c8,_0x13c8('0x1a2'));}this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0xa509c8,_0x4f176b);var _0x5a1ee4=this[_0x13c8('0xc')][_0x13c8('0x53')](_0x13c8('0x1a3'),util[_0x13c8('0x24')](_0x13c8('0x1a4'),config[_0x13c8('0x4')][_0x13c8('0x1a5')]||_0x13c8('0x1a6'),_0x4f176b,this[_0x13c8('0xc')][_0x13c8('0x35')]));if(_0x5a1ee4[_0x13c8('0x9b')]===-0x1){return _0x5a1ee4;}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x160'),_0x13c8('0x1a3'),_0x4f176b));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1a7')]=function(_0x1e35da){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x1a8'),_0x1e35da['label']));var _0x4b7031=this[_0x13c8('0x52')][_0x13c8('0x97')](this,_0x1e35da[_0x13c8('0xa9')]);this[_0x13c8('0x32')][_0x13c8('0x97')](this,_0x1e35da,_0x1e35da['command']);if(this[_0x13c8('0x7a')](_0x1e35da['variable_id'])){var _0x158792=this[_0x13c8('0x10')][_0x13c8('0x97')](this,_0x1e35da[_0x13c8('0xcb')]);if(_0x158792){this[_0x13c8('0xc')][_0x13c8('0x8f')](_0x158792,_0x4b7031);return this['channel']['noop'](util[_0x13c8('0x24')](_0x13c8('0x1a9'),_0x1e35da['command'],_0x158792));}}return this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x1aa'),_0x1e35da[_0x13c8('0xa9')]));};AGIVertices['prototype'][_0x13c8('0x1ab')]=function(_0x22de76){logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x1ac'),_0x22de76[_0x13c8('0x33')]));_0x22de76['text']=_0x22de76[_0x13c8('0x57')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x13c8('0x7a')](_0x22de76[_0x13c8('0x1ad')])){return this[_0x13c8('0xc')][_0x13c8('0x9f')](_0x13c8('0x1ae'));}if(!this[_0x13c8('0x7a')](_0x22de76[_0x13c8('0x57')])){return this[_0x13c8('0xc')]['noop'](_0x13c8('0x99'));}this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x1af'),_0x22de76[_0x13c8('0x57')]));var _0x2544dd=this[_0x13c8('0x1b0')][_0x13c8('0x97')](this,_0x22de76);if(_0x2544dd){this[_0x13c8('0xc')][_0x13c8('0x9f')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2544dd));var _0x1fa523=this[_0x13c8('0xc')][_0x13c8('0xf3')](_0x2544dd);try{fs[_0x13c8('0x119')](_0x2544dd+_0x13c8('0x11a'));}catch(_0x499c30){logger[_0x13c8('0x27')](_0x499c30);}return _0x1fa523;}return this[_0x13c8('0xc')][_0x13c8('0x27')](_0x22de76,_0x13c8('0x1b1'));};AGIVertices['prototype'][_0x13c8('0x1b2')]=function(_0x3c2706){logger['info'](util[_0x13c8('0x24')](_0x13c8('0x1b3'),_0x3c2706[_0x13c8('0x33')]));_0x3c2706[_0x13c8('0x57')]=_0x3c2706['text']['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3c2706[_0x13c8('0x57')])){return this['channel'][_0x13c8('0x9f')](_0x13c8('0x99'));}this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')]('Trying\x20Google\x20TTS\x20%s',_0x3c2706[_0x13c8('0x57')]));var _0x177478=this['googleTTS'][_0x13c8('0x97')](this,_0x3c2706);if(_0x177478){this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x1b4'),_0x177478));var _0x39a598=this[_0x13c8('0xc')][_0x13c8('0xf3')](_0x177478);try{fs[_0x13c8('0x119')](_0x177478+_0x13c8('0x11a'));}catch(_0x196723){logger[_0x13c8('0x27')](_0x196723);}return _0x39a598;}return this[_0x13c8('0xc')]['error'](_0x3c2706,_0x13c8('0x1b5'));};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1b6')]=function(_0x12fb78){logger['info'](util[_0x13c8('0x24')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x12fb78[_0x13c8('0x33')]));if(!this[_0x13c8('0x7a')](_0x12fb78[_0x13c8('0x14a')])){return this['channel']['error'](_0x12fb78,'no\x20find\x20by\x20configured');}logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x150'),this[_0x13c8('0xc')]['callerid'],_0x12fb78[_0x13c8('0x14a')]));var _0x14af3e=this[_0x13c8('0x4c')][_0x13c8('0x97')](this,_0x12fb78[_0x13c8('0x14a')]);if(_0x14af3e){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x13c8('0xc')][_0x13c8('0x38')],_0x12fb78['findBy']));this[_0x13c8('0xc')][_0x13c8('0x9f')](util[_0x13c8('0x24')](_0x13c8('0x14b'),this['channel'][_0x13c8('0x38')],_0x12fb78['findBy']));return{'code':0xc8,'result':_0x13c8('0x14c')};}else{logger[_0x13c8('0x29')](util[_0x13c8('0x24')](_0x13c8('0x14d'),this[_0x13c8('0xc')][_0x13c8('0x38')],_0x12fb78['findBy']));this[_0x13c8('0xc')]['noop'](util[_0x13c8('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x12fb78[_0x13c8('0x14a')]));return{'code':0xc8,'result':_0x13c8('0x1b7')};}};AGIVertices[_0x13c8('0xf')][_0x13c8('0x1b8')]=function(_0x5b073e){logger['info'](util['format'](_0x13c8('0x1b9'),_0x5b073e[_0x13c8('0x33')]));var _0x581043=this[_0x13c8('0xc')][_0x13c8('0x53')]('VOICEMAIL',[_0x5b073e[_0x13c8('0x1ba')],_0x5b073e[_0x13c8('0x71')]]);if(_0x581043[_0x13c8('0x9b')]===-0x1){return _0x581043;}return this[_0x13c8('0xc')]['noop'](util['format'](_0x13c8('0x160'),'VOICEMAIL',_0x5b073e[_0x13c8('0x1ba')]));};AGIVertices[_0x13c8('0xf')]['vswitch']=function(_0x1fa03c){logger[_0x13c8('0x29')](util['format'](_0x13c8('0x1bb'),_0x1fa03c[_0x13c8('0x33')]));if(!this['isConfigured'](_0x1fa03c['variable_id'])){return this[_0x13c8('0xc')]['error'](_0x1fa03c,'no\x20variable\x20selected');}var _0x3f44eb=this[_0x13c8('0x10')]['sync'](this,_0x1fa03c[_0x13c8('0xcb')]);if(!_0x3f44eb){return this[_0x13c8('0xc')]['error'](_0x1fa03c,_0x13c8('0xcc'));}var _0x246d13=this[_0x13c8('0xc')][_0x13c8('0x10')](_0x3f44eb);return{'code':0xc8,'result':_0x246d13[_0x13c8('0x95')]?_0x246d13[_0x13c8('0x95')]:'-'};};String[_0x13c8('0xf')][_0x13c8('0x1bc')]=function(_0x35bc85,_0x596e44){return this[_0x13c8('0x92')](_0x35bc85)[_0x13c8('0x1bd')](_0x596e44);};module['exports']=AGIVertices;
\ No newline at end of file
index cd9b3ab..a4a461c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e11=['[ACW][syncBlindTransfer]\x20%s','autopause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','moment','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','custom:agentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid'];(function(_0x516091,_0x251d48){var _0x18738d=function(_0x586cce){while(--_0x586cce){_0x516091['push'](_0x516091['shift']());}};_0x18738d(++_0x251d48);}(_0x7e11,0x199));var _0x17e1=function(_0x4828e7,_0x48b588){_0x4828e7=_0x4828e7-0x0;var _0x5069e9=_0x7e11[_0x4828e7];return _0x5069e9;};'use strict';var util=require(_0x17e1('0x0'));var _=require('lodash');var moment=require(_0x17e1('0x1'));var ami=require('../ami');var logger=require(_0x17e1('0x2'))(_0x17e1('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x17e1('0x4'));function Acw(_0x1c17c5){this[_0x17e1('0x5')]=_0x1c17c5[_0x17e1('0x5')];this[_0x17e1('0x6')]=_0x1c17c5[_0x17e1('0x6')];this[_0x17e1('0x7')]=_0x1c17c5[_0x17e1('0x7')];this[_0x17e1('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x17e1('0x9')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x17e1('0x9')](this));ami['on'](_0x17e1('0xa'),this[_0x17e1('0xb')][_0x17e1('0x9')](this));ami['on'](_0x17e1('0xc'),this[_0x17e1('0xd')][_0x17e1('0x9')](this));ami['on'](_0x17e1('0xe'),this[_0x17e1('0xf')][_0x17e1('0x9')](this));ami['on'](_0x17e1('0x10'),this['syncBlindTransfer'][_0x17e1('0x9')](this));ami['on'](_0x17e1('0x11'),this['syncAgentConnectPreview'][_0x17e1('0x9')](this));}function getDiff(_0x33e3e8){var _0x145ce7=moment()[_0x17e1('0x12')](0x0);var _0x1c1b38=moment(_0x33e3e8)['milliseconds'](0x0);return _0x145ce7[_0x17e1('0x13')](_0x1c1b38,_0x17e1('0x14'));}Acw['prototype']['startAcw']=function(_0x2ac426){try{var _0x1d20b9=this;var _0x1c6d68=this[_0x17e1('0x8')][_0x2ac426][_0x17e1('0x15')];var _0x3ba698=this[_0x17e1('0x8')][_0x2ac426][_0x17e1('0x16')];var _0x50177a=this[_0x17e1('0x5')][_0x3ba698];var _0x23c040=![];var _0x6dead3=_0x17e1('0x17');if(_0x50177a[_0x17e1('0x18')]){if(_0x50177a[_0x17e1('0x19')]['name']){_0x23c040=!![];_0x6dead3=_0x50177a[_0x17e1('0x19')]['name'];}}ami[_0x17e1('0x1a')]({'action':_0x17e1('0x1b'),'interface':_0x1c6d68,'paused':!![],'reason':_0x6dead3})['then'](function(_0x28f862){if(_0x1d20b9[_0x17e1('0x6')][_0x1c6d68]){return RpcUser[_0x17e1('0x1c')](_0x1d20b9['agents'][_0x1c6d68]['id'])[_0x17e1('0x1d')](function(_0x1b5558){if(_0x1b5558&&!_0x1b5558[_0x17e1('0x1e')]){logger[_0x17e1('0x1f')](_0x17e1('0x20'),_0x2ac426,_0x1c6d68,_0x3ba698);var _0x16c4a2=_0x1d20b9[_0x17e1('0x8')][_0x2ac426][_0x17e1('0x21')]&&_0x1d20b9[_0x17e1('0x8')][_0x2ac426][_0x17e1('0x22')]?_0x1d20b9[_0x17e1('0x8')][_0x2ac426][_0x17e1('0x22')]:_0x2ac426;return RpcUser[_0x17e1('0x23')](_0x1d20b9['agents'][_0x1c6d68],_0x6dead3,_0x16c4a2)[_0x17e1('0x1d')](function(_0x2fd054){if(!_0x23c040){_0x1d20b9[_0x17e1('0x7')][_0x1c6d68]={};logger[_0x17e1('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x2ac426,_0x1d20b9['voiceQueues'][_0x3ba698][_0x17e1('0x24')],_0x1c6d68,_0x3ba698);_0x1d20b9['timers'][_0x1c6d68][_0x17e1('0x25')]=setTimeout(_0x1d20b9[_0x17e1('0x26')]['bind'](_0x1d20b9,_0x1c6d68),_0x1d20b9[_0x17e1('0x5')][_0x3ba698]['acwTimeout']*0x3e8);_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x27')]=moment()['format'](_0x17e1('0x28'));_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x29')]=_0x2ac426;_0x1d20b9[_0x17e1('0x7')][_0x1c6d68]['queue']=_0x3ba698;_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x2a')]=function(){var _0x212d80=getDiff(_0x1d20b9[_0x17e1('0x7')][_0x1c6d68]['lastPauseAt']);clearTimeout(_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x25')]);_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x25')]=![];RpcVoiceAgentReport[_0x17e1('0x2b')]({'acwtime':_0x212d80},_0x1d20b9[_0x17e1('0x7')][_0x1c6d68][_0x17e1('0x29')],_0x1c6d68)[_0x17e1('0x1d')](function(_0x42a149){logger[_0x17e1('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x2ac426,_0x212d80,_0x42a149);})[_0x17e1('0x2c')](function(_0x389f65){logger['error'](_0x17e1('0x2d'),_0x2ac426,_0x389f65);});delete _0x1d20b9[_0x17e1('0x7')][_0x1c6d68];};}});}else{logger[_0x17e1('0x1f')](_0x17e1('0x2e'),_0x2ac426,_0x1c6d68,_0x3ba698);}});}})[_0x17e1('0x2c')](function(_0x24fcb7){logger['error'](_0x17e1('0x2f'),_0x2ac426,_0x1d20b9[_0x17e1('0x5')][_0x3ba698][_0x17e1('0x24')],_0x1c6d68,_0x3ba698);})[_0x17e1('0x30')](function(){delete _0x1d20b9[_0x17e1('0x8')][_0x2ac426];});}catch(_0x4ab174){logger[_0x17e1('0x31')](_0x17e1('0x32'),_0x4ab174[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')][_0x17e1('0x26')]=function(_0x5bb2a0){try{var _0xa60fac=this;if(_0xa60fac['timers'][_0x5bb2a0]){_0xa60fac[_0x17e1('0x7')][_0x5bb2a0][_0x17e1('0x25')]=![];var _0x2d5b2c=_0xa60fac[_0x17e1('0x7')][_0x5bb2a0]['uniqueid'];var _0x7fa658=_0xa60fac[_0x17e1('0x7')][_0x5bb2a0]['queue'];var _0x48aad2=_0xa60fac[_0x17e1('0x5')][_0x7fa658]['acwTimeout'];logger[_0x17e1('0x1f')](_0x17e1('0x35'),_0x2d5b2c,_0x5bb2a0);RpcUser['saveUnpause'](this[_0x17e1('0x6')][_0x5bb2a0]);RpcVoiceAgentReport[_0x17e1('0x2b')]({'acwtime':_0x48aad2,'agentacw':!![]},_0x2d5b2c,_0x5bb2a0)['then'](function(_0x54d95d){logger[_0x17e1('0x1f')](_0x17e1('0x36'),_0x2d5b2c,_0x48aad2,_0x54d95d);})[_0x17e1('0x2c')](function(_0x2cc7b9){logger[_0x17e1('0x31')](_0x17e1('0x2d'),_0x2d5b2c,_0x2cc7b9);});}else{logger[_0x17e1('0x31')](_0x17e1('0x37'),_0x5bb2a0);if(_0xa60fac[_0x17e1('0x7')]){logger[_0x17e1('0x1f')]('[ACW][TIMERS]',JSON[_0x17e1('0x38')](_0xa60fac[_0x17e1('0x7')]));}}}catch(_0x27decf){logger[_0x17e1('0x31')](_0x17e1('0x39'),_0x27decf[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')][_0x17e1('0x3a')]=function(_0x12d252){try{if(this[_0x17e1('0x5')][_0x12d252[_0x17e1('0x16')]]&&(this[_0x17e1('0x5')][_0x12d252['queue']][_0x17e1('0x3')]||this[_0x17e1('0x5')][_0x12d252[_0x17e1('0x16')]]['mandatoryDisposition'])){if(this[_0x17e1('0x6')][_0x12d252['interface']]){this[_0x17e1('0x8')][_0x12d252[_0x17e1('0x29')]]={'queue':_0x12d252[_0x17e1('0x16')],'interface':_0x12d252[_0x17e1('0x15')],'destlinkedid':_0x12d252['destlinkedid']};}}}catch(_0x1842d1){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x1842d1[_0x17e1('0x33')]);}};Acw['prototype'][_0x17e1('0x3b')]=function(_0x48a5cb){try{if(this[_0x17e1('0x5')][_0x48a5cb[_0x17e1('0x16')]]&&(this[_0x17e1('0x5')][_0x48a5cb['queue']]['acw']||this[_0x17e1('0x5')][_0x48a5cb[_0x17e1('0x16')]][_0x17e1('0x18')])){if(this[_0x17e1('0x6')][_0x48a5cb[_0x17e1('0x15')]]){this[_0x17e1('0x8')][_0x48a5cb[_0x17e1('0x29')]]={'queue':_0x48a5cb[_0x17e1('0x16')],'interface':_0x48a5cb[_0x17e1('0x15')]};}}}catch(_0x4b9ef2){logger[_0x17e1('0x31')](_0x17e1('0x3c'),_0x4b9ef2[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')][_0x17e1('0x3d')]=function(_0x13ae83){try{if(this[_0x17e1('0x8')][_0x13ae83['uniqueid']]&&_['isUndefined'](this[_0x17e1('0x8')][_0x13ae83[_0x17e1('0x29')]]['attended'])){logger[_0x17e1('0x1f')]('[%s][HANGUP:UNIQUEID]',_0x13ae83[_0x17e1('0x29')]);this[_0x17e1('0x3e')](_0x13ae83[_0x17e1('0x29')]);}else if(this['channels'][_0x13ae83[_0x17e1('0x3f')]]&&_[_0x17e1('0x40')](this[_0x17e1('0x8')][_0x13ae83['linkedid']][_0x17e1('0x21')])){logger[_0x17e1('0x1f')](_0x17e1('0x41'),_0x13ae83['linkedid']);this[_0x17e1('0x3e')](_0x13ae83[_0x17e1('0x3f')]);}}catch(_0x3c701d){logger[_0x17e1('0x31')]('[ACW][syncHangupRequest]\x20%s',_0x3c701d[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')]['syncHangup']=function(_0x16bdfe){try{if(this[_0x17e1('0x8')][_0x16bdfe[_0x17e1('0x29')]]&&this[_0x17e1('0x8')][_0x16bdfe[_0x17e1('0x29')]][_0x17e1('0x21')]){logger[_0x17e1('0x1f')](_0x17e1('0x42'),_0x16bdfe['uniqueid']);this[_0x17e1('0x3e')](_0x16bdfe[_0x17e1('0x29')]);}else if(this[_0x17e1('0x8')][_0x16bdfe[_0x17e1('0x3f')]]&&this[_0x17e1('0x8')][_0x16bdfe[_0x17e1('0x3f')]][_0x17e1('0x21')]){logger[_0x17e1('0x1f')](_0x17e1('0x43'),_0x16bdfe[_0x17e1('0x3f')]);this[_0x17e1('0x3e')](_0x16bdfe[_0x17e1('0x3f')]);}}catch(_0x2f1f9f){logger[_0x17e1('0x31')]('[ACW][syncHangup]\x20%s',_0x2f1f9f[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')][_0x17e1('0xf')]=function(_0x15f367){try{if(!_[_0x17e1('0x44')](this[_0x17e1('0x8')][_0x15f367[_0x17e1('0x45')]])){this[_0x17e1('0x3e')](_0x15f367['transfereeuniqueid']);if(this['channels'][_0x15f367['secondtransfereruniqueid']]){this[_0x17e1('0x8')][_0x15f367[_0x17e1('0x46')]][_0x17e1('0x21')]=!![];this['channels'][_0x15f367[_0x17e1('0x47')]]=this['channels'][_0x15f367[_0x17e1('0x46')]];delete this[_0x17e1('0x8')][_0x15f367['secondtransfereruniqueid']];}}else if(!_[_0x17e1('0x44')](this[_0x17e1('0x8')][_0x15f367['transfertargetuniqueid']])){this[_0x17e1('0x3e')](_0x15f367['transfertargetuniqueid']);if(this[_0x17e1('0x8')][_0x15f367['origtransfereruniqueid']]){this[_0x17e1('0x8')][_0x15f367['origtransfereruniqueid']][_0x17e1('0x21')]=!![];this['channels'][_0x15f367['transfereeuniqueid']]=this[_0x17e1('0x8')][_0x15f367[_0x17e1('0x48')]];delete this[_0x17e1('0x8')][_0x15f367[_0x17e1('0x48')]];}}}catch(_0x2fad6b){logger[_0x17e1('0x31')](_0x17e1('0x49'),_0x2fad6b[_0x17e1('0x33')]);}};Acw[_0x17e1('0x34')]['syncBlindTransfer']=function(_0x22e0cb){try{if(this[_0x17e1('0x8')][_0x22e0cb[_0x17e1('0x4a')]]){logger[_0x17e1('0x1f')](_0x17e1('0x4b'),JSON['stringify'](_0x22e0cb[_0x17e1('0x4a')]));this[_0x17e1('0x3e')](_0x22e0cb[_0x17e1('0x4a')]);}else if(this[_0x17e1('0x8')][_0x22e0cb['transfererlinkedid']]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x17e1('0x38')](_0x22e0cb['transfererlinkedid']));this['startAcw'](_0x22e0cb[_0x17e1('0x4c')]);}}catch(_0x5ece57){logger[_0x17e1('0x31')](_0x17e1('0x4d'),_0x5ece57['message']);}};Acw[_0x17e1('0x34')][_0x17e1('0xd')]=function(_0x4d2583){try{if(this[_0x17e1('0x5')][_0x4d2583[_0x17e1('0x16')]]&&this[_0x17e1('0x5')][_0x4d2583['queue']][_0x17e1('0x4e')]==='all'){if(this[_0x17e1('0x6')][_0x4d2583[_0x17e1('0x15')]]){logger[_0x17e1('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x4d2583[_0x17e1('0x29')],_0x4d2583[_0x17e1('0x15')],_0x4d2583['queue']);return RpcUser[_0x17e1('0x23')](this[_0x17e1('0x6')][_0x4d2583[_0x17e1('0x15')]],_0x17e1('0x4f'),_0x4d2583['uniqueid']);}}}catch(_0x45bd00){logger[_0x17e1('0x31')](_0x17e1('0x50'),_0x45bd00[_0x17e1('0x33')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0xb766=['destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ERRORS:%s]','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb766,0xe2));var _0x6b76=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb766[_0x465028];return _0xb783d4;};'use strict';var util=require('util');var _=require(_0x6b76('0x0'));var moment=require(_0x6b76('0x1'));var ami=require(_0x6b76('0x2'));var logger=require(_0x6b76('0x3'))(_0x6b76('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x6b76('0x5'));function Acw(_0x556ad9){this[_0x6b76('0x6')]=_0x556ad9[_0x6b76('0x6')];this[_0x6b76('0x7')]=_0x556ad9[_0x6b76('0x7')];this[_0x6b76('0x8')]=_0x556ad9[_0x6b76('0x8')];this[_0x6b76('0x9')]={};ami['on'](_0x6b76('0xa'),this[_0x6b76('0xb')][_0x6b76('0xc')](this));ami['on'](_0x6b76('0xd'),this[_0x6b76('0xe')][_0x6b76('0xc')](this));ami['on']('hangup',this[_0x6b76('0xf')][_0x6b76('0xc')](this));ami['on'](_0x6b76('0x10'),this['syncAgentRingNoAnswer'][_0x6b76('0xc')](this));ami['on'](_0x6b76('0x11'),this[_0x6b76('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x6b76('0x13')][_0x6b76('0xc')](this));ami['on'](_0x6b76('0x14'),this[_0x6b76('0x15')][_0x6b76('0xc')](this));}function getDiff(_0xd003af){var _0xa8f595=moment()[_0x6b76('0x16')](0x0);var _0x29912f=moment(_0xd003af)[_0x6b76('0x16')](0x0);return _0xa8f595['diff'](_0x29912f,_0x6b76('0x17'));}Acw[_0x6b76('0x18')][_0x6b76('0x19')]=function(_0x1630d4){try{var _0x1d981d=this;var _0x36061c=this['channels'][_0x1630d4][_0x6b76('0x1a')];var _0x5e3c64=this[_0x6b76('0x9')][_0x1630d4][_0x6b76('0x1b')];var _0x5339c0=this['voiceQueues'][_0x5e3c64];var _0xedbbd5=![];var _0x7e48f1=_0x6b76('0x1c');if(_0x5339c0[_0x6b76('0x1d')]){if(_0x5339c0['mandatoryDispositionPause']['name']){_0xedbbd5=!![];_0x7e48f1=_0x5339c0[_0x6b76('0x1e')][_0x6b76('0x1f')];}}ami[_0x6b76('0x20')]({'action':_0x6b76('0x21'),'interface':_0x36061c,'paused':!![],'reason':_0x7e48f1})[_0x6b76('0x22')](function(_0x505ac8){if(_0x1d981d['agents'][_0x36061c]){return RpcUser[_0x6b76('0x23')](_0x1d981d[_0x6b76('0x7')][_0x36061c]['id'])[_0x6b76('0x22')](function(_0x5e239b){if(_0x5e239b&&!_0x5e239b[_0x6b76('0x24')]){logger['info'](_0x6b76('0x25'),_0x1630d4,_0x36061c,_0x5e3c64);var _0x5172fd=_0x1d981d['channels'][_0x1630d4]['attended']&&_0x1d981d[_0x6b76('0x9')][_0x1630d4][_0x6b76('0x26')]?_0x1d981d['channels'][_0x1630d4]['destlinkedid']:_0x1630d4;return RpcUser[_0x6b76('0x27')](_0x1d981d['agents'][_0x36061c],_0x7e48f1,_0x5172fd)[_0x6b76('0x22')](function(_0x41f9ff){if(!_0xedbbd5){_0x1d981d[_0x6b76('0x8')][_0x36061c]={};logger['info'](_0x6b76('0x28'),_0x1630d4,_0x1d981d[_0x6b76('0x6')][_0x5e3c64][_0x6b76('0x29')],_0x36061c,_0x5e3c64);_0x1d981d[_0x6b76('0x8')][_0x36061c][_0x6b76('0x2a')]=setTimeout(_0x1d981d[_0x6b76('0x2b')][_0x6b76('0xc')](_0x1d981d,_0x36061c),_0x1d981d[_0x6b76('0x6')][_0x5e3c64]['acwTimeout']*0x3e8);_0x1d981d[_0x6b76('0x8')][_0x36061c]['lastPauseAt']=moment()['format'](_0x6b76('0x2c'));_0x1d981d[_0x6b76('0x8')][_0x36061c][_0x6b76('0x2d')]=_0x1630d4;_0x1d981d[_0x6b76('0x8')][_0x36061c]['queue']=_0x5e3c64;_0x1d981d[_0x6b76('0x8')][_0x36061c][_0x6b76('0x2e')]=function(){var _0x4dfe99=getDiff(_0x1d981d[_0x6b76('0x8')][_0x36061c]['lastPauseAt']);clearTimeout(_0x1d981d[_0x6b76('0x8')][_0x36061c][_0x6b76('0x2a')]);_0x1d981d['timers'][_0x36061c][_0x6b76('0x2a')]=![];RpcVoiceAgentReport[_0x6b76('0x2f')]({'acwtime':_0x4dfe99},_0x1d981d[_0x6b76('0x8')][_0x36061c][_0x6b76('0x2d')],_0x36061c)[_0x6b76('0x22')](function(_0x1fba89){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x1630d4,_0x4dfe99,_0x1fba89);})['catch'](function(_0x312341){logger['error'](_0x6b76('0x30'),_0x1630d4,_0x312341);});delete _0x1d981d[_0x6b76('0x8')][_0x36061c];};}});}else{logger[_0x6b76('0x31')](_0x6b76('0x32'),_0x1630d4,_0x36061c,_0x5e3c64);}});}})[_0x6b76('0x33')](function(_0x10755a){logger[_0x6b76('0x34')](_0x6b76('0x28'),_0x1630d4,_0x1d981d[_0x6b76('0x6')][_0x5e3c64][_0x6b76('0x29')],_0x36061c,_0x5e3c64);})[_0x6b76('0x35')](function(){delete _0x1d981d[_0x6b76('0x9')][_0x1630d4];});}catch(_0xcdbb10){logger[_0x6b76('0x34')](_0x6b76('0x36'),_0xcdbb10[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0x2b')]=function(_0x4db0ec){try{var _0x2dc1d4=this;if(_0x2dc1d4['timers'][_0x4db0ec]){_0x2dc1d4[_0x6b76('0x8')][_0x4db0ec][_0x6b76('0x2a')]=![];var _0x313f70=_0x2dc1d4[_0x6b76('0x8')][_0x4db0ec]['uniqueid'];var _0x3e521e=_0x2dc1d4[_0x6b76('0x8')][_0x4db0ec]['queue'];var _0x4fe8fd=_0x2dc1d4[_0x6b76('0x6')][_0x3e521e][_0x6b76('0x29')];logger['info'](_0x6b76('0x38'),_0x313f70,_0x4db0ec);RpcUser[_0x6b76('0x39')](this[_0x6b76('0x7')][_0x4db0ec]);RpcVoiceAgentReport[_0x6b76('0x2f')]({'acwtime':_0x4fe8fd,'agentacw':!![]},_0x313f70,_0x4db0ec)[_0x6b76('0x22')](function(_0x8441e2){logger[_0x6b76('0x31')]('[%s][UPDATE][ACWTIME:%s]',_0x313f70,_0x4fe8fd,_0x8441e2);})[_0x6b76('0x33')](function(_0x3291fd){logger[_0x6b76('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x313f70,_0x3291fd);});}else{logger[_0x6b76('0x34')](_0x6b76('0x3a'),_0x4db0ec);if(_0x2dc1d4[_0x6b76('0x8')]){logger[_0x6b76('0x31')](_0x6b76('0x3b'),JSON[_0x6b76('0x3c')](_0x2dc1d4[_0x6b76('0x8')]));}}}catch(_0x580ecc){logger[_0x6b76('0x34')](_0x6b76('0x3d'),_0x580ecc[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0xb')]=function(_0x4ecaf3){try{if(this[_0x6b76('0x6')][_0x4ecaf3['queue']]&&(this[_0x6b76('0x6')][_0x4ecaf3[_0x6b76('0x1b')]][_0x6b76('0x4')]||this[_0x6b76('0x6')][_0x4ecaf3[_0x6b76('0x1b')]]['mandatoryDisposition'])){if(this['agents'][_0x4ecaf3[_0x6b76('0x1a')]]){this[_0x6b76('0x9')][_0x4ecaf3['uniqueid']]={'queue':_0x4ecaf3[_0x6b76('0x1b')],'interface':_0x4ecaf3[_0x6b76('0x1a')],'destlinkedid':_0x4ecaf3[_0x6b76('0x26')]};}}}catch(_0x2727cb){logger[_0x6b76('0x34')](_0x6b76('0x3e'),_0x2727cb[_0x6b76('0x37')]);}};Acw['prototype'][_0x6b76('0x15')]=function(_0x47e65c){try{if(this['voiceQueues'][_0x47e65c['queue']]&&(this[_0x6b76('0x6')][_0x47e65c['queue']][_0x6b76('0x4')]||this[_0x6b76('0x6')][_0x47e65c[_0x6b76('0x1b')]][_0x6b76('0x1d')])){if(this[_0x6b76('0x7')][_0x47e65c['interface']]){this['channels'][_0x47e65c[_0x6b76('0x2d')]]={'queue':_0x47e65c['queue'],'interface':_0x47e65c[_0x6b76('0x1a')]};}}}catch(_0x294148){logger[_0x6b76('0x34')](_0x6b76('0x3f'),_0x294148[_0x6b76('0x37')]);}};Acw['prototype'][_0x6b76('0xe')]=function(_0xd2d7c8){try{if(this[_0x6b76('0x9')][_0xd2d7c8[_0x6b76('0x2d')]]&&_[_0x6b76('0x40')](this[_0x6b76('0x9')][_0xd2d7c8['uniqueid']][_0x6b76('0x41')])){logger[_0x6b76('0x31')](_0x6b76('0x42'),_0xd2d7c8['uniqueid']);this[_0x6b76('0x19')](_0xd2d7c8[_0x6b76('0x2d')]);}else if(this[_0x6b76('0x9')][_0xd2d7c8[_0x6b76('0x43')]]&&_[_0x6b76('0x40')](this['channels'][_0xd2d7c8[_0x6b76('0x43')]][_0x6b76('0x41')])){logger[_0x6b76('0x31')](_0x6b76('0x44'),_0xd2d7c8[_0x6b76('0x43')]);this[_0x6b76('0x19')](_0xd2d7c8[_0x6b76('0x43')]);}}catch(_0x258405){logger[_0x6b76('0x34')]('[ACW][syncHangupRequest]\x20%s',_0x258405[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0xf')]=function(_0x1cb71f){try{if(this['channels'][_0x1cb71f[_0x6b76('0x2d')]]&&this[_0x6b76('0x9')][_0x1cb71f[_0x6b76('0x2d')]]['attended']){logger[_0x6b76('0x31')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x1cb71f[_0x6b76('0x2d')]);this[_0x6b76('0x19')](_0x1cb71f['uniqueid']);}else if(this[_0x6b76('0x9')][_0x1cb71f[_0x6b76('0x43')]]&&this[_0x6b76('0x9')][_0x1cb71f['linkedid']]['attended']){logger['info'](_0x6b76('0x45'),_0x1cb71f[_0x6b76('0x43')]);this['startAcw'](_0x1cb71f[_0x6b76('0x43')]);}}catch(_0x162fea){logger[_0x6b76('0x34')](_0x6b76('0x46'),_0x162fea[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0x12')]=function(_0x556f5b){try{if(!_['isNil'](this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x47')]])){this[_0x6b76('0x19')](_0x556f5b[_0x6b76('0x47')]);if(this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x48')]]){this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x48')]][_0x6b76('0x41')]=!![];this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x49')]]=this[_0x6b76('0x9')][_0x556f5b['secondtransfereruniqueid']];delete this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x48')]];}}else if(!_[_0x6b76('0x4a')](this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x49')]])){this[_0x6b76('0x19')](_0x556f5b[_0x6b76('0x49')]);if(this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x4b')]]){this[_0x6b76('0x9')][_0x556f5b[_0x6b76('0x4b')]][_0x6b76('0x41')]=!![];this['channels'][_0x556f5b[_0x6b76('0x47')]]=this['channels'][_0x556f5b[_0x6b76('0x4b')]];delete this[_0x6b76('0x9')][_0x556f5b['origtransfereruniqueid']];}}}catch(_0x15abc5){logger[_0x6b76('0x34')](_0x6b76('0x4c'),_0x15abc5[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0x13')]=function(_0x3ba4b9){try{if(this[_0x6b76('0x9')][_0x3ba4b9[_0x6b76('0x4d')]]){logger[_0x6b76('0x31')](_0x6b76('0x4e'),JSON[_0x6b76('0x3c')](_0x3ba4b9[_0x6b76('0x4d')]));this[_0x6b76('0x19')](_0x3ba4b9[_0x6b76('0x4d')]);}else if(this['channels'][_0x3ba4b9[_0x6b76('0x4f')]]){logger[_0x6b76('0x31')](_0x6b76('0x50'),JSON[_0x6b76('0x3c')](_0x3ba4b9[_0x6b76('0x4f')]));this[_0x6b76('0x19')](_0x3ba4b9['transfererlinkedid']);}}catch(_0x3f801d){logger['error'](_0x6b76('0x51'),_0x3f801d[_0x6b76('0x37')]);}};Acw[_0x6b76('0x18')][_0x6b76('0x52')]=function(_0x3c8452){try{if(this[_0x6b76('0x6')][_0x3c8452[_0x6b76('0x1b')]]&&this[_0x6b76('0x6')][_0x3c8452['queue']][_0x6b76('0x53')]==='all'){if(this['agents'][_0x3c8452[_0x6b76('0x1a')]]){logger['info'](_0x6b76('0x54'),_0x3c8452[_0x6b76('0x2d')],_0x3c8452[_0x6b76('0x1a')],_0x3c8452['queue']);return RpcUser[_0x6b76('0x27')](this[_0x6b76('0x7')][_0x3c8452[_0x6b76('0x1a')]],_0x6b76('0x55'),_0x3c8452['uniqueid']);}}}catch(_0x32f2b0){logger['error'](_0x6b76('0x56'),_0x32f2b0[_0x6b76('0x37')]);}};module[_0x6b76('0x57')]=Acw;
\ No newline at end of file
index 2acda7a..1ee0cf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2032,0xd9));var _0x2203=function(_0x461009,_0x1f9c98){_0x461009=_0x461009-0x0;var _0x2c741a=_0x2032[_0x461009];return _0x2c741a;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var util=require(_0x2203('0x2'));var _=require('lodash');var logger=require(_0x2203('0x3'))(_0x2203('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x2203('0x5')][_0x2203('0x6')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')][_0x2203('0x8')],!![]);ami[_0x2203('0x9')]();ami[_0x2203('0xa')]=BPromise[_0x2203('0xb')](ami[_0x2203('0xc')]);function error(_0x5ecf9e){logger['error'](util[_0x2203('0xd')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x5ecf9e,![],null)));}function close(){logger[_0x2203('0xe')](util['format'](_0x2203('0xf'),config[_0x2203('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x2203('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x10')});};};ami[_0x2203('0x11')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x12')});};};ami[_0x2203('0x13')]=function(){return function(){return ami[_0x2203('0xa')]({'action':_0x2203('0x14')});};};ami[_0x2203('0x15')]=function(){return function(){return ami[_0x2203('0xa')]({'action':'coreshowchannels'});};};function connect(_0x280eda){logger[_0x2203('0x16')](util['format'](_0x2203('0x17'),config[_0x2203('0x5')]['username'],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')]));ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')](_0x2203('0x19'),close);}ami['on'](_0x2203('0x1a'),connect);ami['on']('shutdown',function(_0x13d3f7){logger['info'](util['format'](_0x2203('0x1b'),config['asterisk'][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config['asterisk'][_0x2203('0x6')],util['inspect'](_0x13d3f7,![],null)));});ami['on']('fullybooted',function(_0x226374){logger[_0x2203('0x16')](util[_0x2203('0xd')](_0x2203('0x1c'),config[_0x2203('0x5')][_0x2203('0x7')],config[_0x2203('0x5')]['ip'],config[_0x2203('0x5')]['port']));return BPromise[_0x2203('0x1d')]()[_0x2203('0x1e')](ami[_0x2203('0x1f')]())['then'](ami[_0x2203('0x20')]())[_0x2203('0x1e')](ami['actionSipPeerStatus']())[_0x2203('0x1e')](ami[_0x2203('0x13')]())[_0x2203('0x1e')](ami[_0x2203('0x15')]())[_0x2203('0x21')](function(_0x1df508){logger[_0x2203('0xe')]('[ami.js][fullybooted]',util[_0x2203('0x22')](_0x1df508,{'showHidden':![],'depth':null}));});});ami[_0x2203('0x18')](_0x2203('0xe'),error);ami[_0x2203('0x18')]('close',close);module[_0x2203('0x23')]=ami;
\ No newline at end of file
+var _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x28287e,_0x1b25c3){var _0xc8df58=function(_0x55eeef){while(--_0x55eeef){_0x28287e['push'](_0x28287e['shift']());}};_0xc8df58(++_0x1b25c3);}(_0x757a,0xde));var _0xa757=function(_0x494837,_0x3b5640){_0x494837=_0x494837-0x0;var _0x25ef62=_0x757a[_0x494837];return _0x25ef62;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami;
\ No newline at end of file
index 1aed028..60c0b93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa88=['bluebird','../../config/logger','ami','http','Request','rpc','memberReport','error','message','result','catch','jayson/promise'];(function(_0x355065,_0x1c0032){var _0x23743f=function(_0x460910){while(--_0x460910){_0x355065['push'](_0x355065['shift']());}};_0x23743f(++_0x1c0032);}(_0xaa88,0x137));var _0x8aa8=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xaa88[_0x1f9f37];return _0x21c080;};'use strict';var jayson=require(_0x8aa8('0x0'));var BPromise=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var client=jayson['client'][_0x8aa8('0x4')]({'port':0x2329});client[_0x8aa8('0x5')]=function(_0x43f7e4,_0x3b2c88){return new BPromise(function(_0x3e3b70,_0x350e8b){return client['request'](_0x43f7e4,_0x3b2c88)['then'](function(_0x460042){logger['debug'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x3b2c88,_0x460042);if(_0x460042[_0x8aa8('0x8')]){logger[_0x8aa8('0x8')]('rpc',_0x8aa8('0x7'),_0x43f7e4,_0x460042[_0x8aa8('0x8')][_0x8aa8('0x9')],_0x3b2c88);return _0x350e8b(_0x460042['error'][_0x8aa8('0x9')]);}else{return _0x3e3b70(_0x460042[_0x8aa8('0xa')]);}})[_0x8aa8('0xb')](function(_0x33cc5c){logger['error'](_0x8aa8('0x6'),_0x8aa8('0x7'),_0x43f7e4,_0x33cc5c,_0x3b2c88);return _0x350e8b(_0x33cc5c);});});};module['exports']=client;
\ No newline at end of file
+var _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x49b73b,_0x49456b){var _0x391e11=function(_0x111b67){while(--_0x111b67){_0x49b73b['push'](_0x49b73b['shift']());}};_0x391e11(++_0x49456b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client;
\ No newline at end of file
index 9e40277..de0df80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf6b=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','number','prototype','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','lastName','queue','active','type','dialQueueTimeout','scheduledat'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdf6b,0xa4));var _0xbdf6=function(_0x1d3aee,_0x3bb72c){_0x1d3aee=_0x1d3aee-0x0;var _0xccb463=_0xdf6b[_0x1d3aee];return _0xccb463;};'use strict';var util=require(_0xbdf6('0x0'));var _=require(_0xbdf6('0x1'));var moment=require(_0xbdf6('0x2'));function checkNameSurname(_0x238fd6,_0x1e89da,_0x1fb139){var _0x5f14a7='';if(!_[_0xbdf6('0x3')](_0x1e89da)&&_0xbdf6('0x4')===typeof _0x1e89da){_0x5f14a7+=_0x1e89da;}if(!_[_0xbdf6('0x3')](_0x1fb139)&&_0xbdf6('0x4')===typeof _0x1fb139){_0x5f14a7+='\x20'+_0x1fb139;}if(_0x5f14a7!==''){return _0x5f14a7;}return _0x238fd6;}function Action(_0x116cf7,_0x4ad9fd,_0x270b7e){this[_0xbdf6('0x5')]=_0x116cf7;this[_0xbdf6('0x6')]=_0x270b7e||undefined;this[_0xbdf6('0x7')]=checkNameSurname(_0x4ad9fd[_0xbdf6('0x8')][_0xbdf6('0x9')],_0x4ad9fd[_0xbdf6('0x8')]['firstName'],_0x4ad9fd[_0xbdf6('0x8')][_0xbdf6('0xa')]);this['number']=_0x4ad9fd['phone'];this[_0xbdf6('0xb')]=_0x116cf7[_0xbdf6('0x7')];this[_0xbdf6('0xc')]=_0x4ad9fd[_0xbdf6('0xc')]||![];this[_0xbdf6('0xd')]=_0x116cf7[_0xbdf6('0xd')];this[_0xbdf6('0xe')]=_0x116cf7[_0xbdf6('0xe')]||0x3;this[_0xbdf6('0xf')]=_0x4ad9fd['scheduledat'];this[_0xbdf6('0x10')]=_0x4ad9fd[_0xbdf6('0x10')];this[_0xbdf6('0x11')]=_0x4ad9fd[_0xbdf6('0x11')];this[_0xbdf6('0x12')]=_0x4ad9fd[_0xbdf6('0x12')];this[_0xbdf6('0x13')]=_0x4ad9fd['countnosuchnumberretry'];this[_0xbdf6('0x14')]=_0x4ad9fd[_0xbdf6('0x14')];this[_0xbdf6('0x15')]=_0x4ad9fd[_0xbdf6('0x15')];this[_0xbdf6('0x16')]=_0x4ad9fd[_0xbdf6('0x16')];this[_0xbdf6('0x17')]=_0x4ad9fd['countagentrejectretry'];this[_0xbdf6('0x18')]=_0x4ad9fd['ContactId'];this[_0xbdf6('0x19')]=_0x4ad9fd[_0xbdf6('0x19')];this[_0xbdf6('0x1a')]=_0x4ad9fd[_0xbdf6('0x1a')];this[_0xbdf6('0x1b')]=_0x4ad9fd[_0xbdf6('0x1b')];this[_0xbdf6('0x1c')]=_0x4ad9fd[_0xbdf6('0x1c')];this[_0xbdf6('0x1d')]=_0x4ad9fd['id'];this['ContactFirstName']=_0x4ad9fd[_0xbdf6('0x8')][_0xbdf6('0x1e')]||'';this[_0xbdf6('0x1f')]=moment()[_0xbdf6('0x20')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xbdf6('0x21')]=_0x4ad9fd[_0xbdf6('0x21')];this[_0xbdf6('0x22')]=_0x4ad9fd[_0xbdf6('0x22')];this[_0xbdf6('0x23')]=_0x4ad9fd['callbackat'];this[_0xbdf6('0x24')]=_0x4ad9fd[_0xbdf6('0x24')];this['originatecalleridnum']='';this[_0xbdf6('0x25')]='';}Action['prototype'][_0xbdf6('0x26')]=function(){return util[_0xbdf6('0x20')](_0xbdf6('0x27'),this[_0xbdf6('0x7')],this[_0xbdf6('0x5')]['dialCutDigit']>0x0?this['number'][_0xbdf6('0x28')](this[_0xbdf6('0x5')][_0xbdf6('0x29')]):this[_0xbdf6('0x2a')]);};Action[_0xbdf6('0x2b')]['getQueue']=function(){return this[_0xbdf6('0xb')];};module[_0xbdf6('0x2c')]=Action;
\ No newline at end of file
+var _0x65a0=['countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','number','substring','exports','util','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3164dc,_0x1d033c){var _0x11b247=function(_0x577ae4){while(--_0x577ae4){_0x3164dc['push'](_0x3164dc['shift']());}};_0x11b247(++_0x1d033c);}(_0x65a0,0x150));var _0x065a=function(_0x11e221,_0x4eeecf){_0x11e221=_0x11e221-0x0;var _0x4c1103=_0x65a0[_0x11e221];return _0x4c1103;};'use strict';var util=require(_0x065a('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x26bf17,_0x5bc95c,_0x2dc7b7){var _0x392f6a='';if(!_[_0x065a('0x1')](_0x5bc95c)&&_0x065a('0x2')===typeof _0x5bc95c){_0x392f6a+=_0x5bc95c;}if(!_['isNil'](_0x2dc7b7)&&'string'===typeof _0x2dc7b7){_0x392f6a+='\x20'+_0x2dc7b7;}if(_0x392f6a!==''){return _0x392f6a;}return _0x26bf17;}function Action(_0x53ae3e,_0x234554,_0xe657bd){this['voiceQueue']=_0x53ae3e;this[_0x065a('0x3')]=_0xe657bd||undefined;this[_0x065a('0x4')]=checkNameSurname(_0x234554[_0x065a('0x5')][_0x065a('0x6')],_0x234554[_0x065a('0x5')][_0x065a('0x7')],_0x234554[_0x065a('0x5')][_0x065a('0x8')]);this['number']=_0x234554['phone'];this['queue']=_0x53ae3e[_0x065a('0x4')];this[_0x065a('0x9')]=_0x234554['active']||![];this[_0x065a('0xa')]=_0x53ae3e[_0x065a('0xa')];this[_0x065a('0xb')]=_0x53ae3e[_0x065a('0xb')]||0x3;this['scheduledat']=_0x234554[_0x065a('0xc')];this[_0x065a('0xd')]=_0x234554[_0x065a('0xd')];this['countcongestionretry']=_0x234554[_0x065a('0xe')];this[_0x065a('0xf')]=_0x234554[_0x065a('0xf')];this[_0x065a('0x10')]=_0x234554[_0x065a('0x10')];this[_0x065a('0x11')]=_0x234554['countdropretry'];this[_0x065a('0x12')]=_0x234554[_0x065a('0x12')];this[_0x065a('0x13')]=_0x234554[_0x065a('0x13')];this[_0x065a('0x14')]=_0x234554[_0x065a('0x14')];this[_0x065a('0x15')]=_0x234554[_0x065a('0x15')];this[_0x065a('0x16')]=_0x234554[_0x065a('0x16')];this['UserId']=_0x234554[_0x065a('0x17')];this['VoiceQueueId']=_0x234554[_0x065a('0x18')];this['CampaignId']=_0x234554[_0x065a('0x19')];this['idHopper']=_0x234554['id'];this[_0x065a('0x1a')]=_0x234554[_0x065a('0x5')][_0x065a('0x7')]||'';this[_0x065a('0x1b')]=moment()['format'](_0x065a('0x1c'));this[_0x065a('0x1d')]=_0x234554[_0x065a('0x1d')];this[_0x065a('0x1e')]=_0x234554['callbackuniqueid'];this[_0x065a('0x1f')]=_0x234554[_0x065a('0x1f')];this[_0x065a('0x20')]=_0x234554[_0x065a('0x20')];this[_0x065a('0x21')]='';this[_0x065a('0x22')]='';}Action[_0x065a('0x23')][_0x065a('0x24')]=function(){return util[_0x065a('0x25')](_0x065a('0x26'),this[_0x065a('0x4')],this[_0x065a('0x27')][_0x065a('0x28')]>0x0?this[_0x065a('0x29')][_0x065a('0x2a')](this['voiceQueue'][_0x065a('0x28')]):this[_0x065a('0x29')]);};Action[_0x065a('0x23')]['getQueue']=function(){return this['queue'];};module[_0x065a('0x2b')]=Action;
\ No newline at end of file
index d4217d2..68e3b59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa753=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x197272,_0x1deba3){var _0x16da9d=function(_0x5b4bdc){while(--_0x5b4bdc){_0x197272['push'](_0x197272['shift']());}};_0x16da9d(++_0x1deba3);}(_0xa753,0xa6));var _0x3a75=function(_0x503995,_0x2cb63c){_0x503995=_0x503995-0x0;var _0x47e372=_0xa753[_0x503995];return _0x47e372;};'use strict';var util=require(_0x3a75('0x0'));var _=require(_0x3a75('0x1'));var moment=require(_0x3a75('0x2'));function getSeconds(_0x4f7ca6,_0x15b81d){var _0x3b74ce=moment(_0x4f7ca6)[_0x3a75('0x3')](0x0);var _0x2b24d6=moment(_0x15b81d)['milliseconds'](0x0);return _0x3b74ce['diff'](_0x2b24d6,_0x3a75('0x4'));}function AgentComplete(_0x2daa3a,_0x516726){this[_0x3a75('0x5')]=0x4;this[_0x3a75('0x6')]='Answer';this[_0x3a75('0x7')]=_0x2daa3a['scheduledat'];this[_0x3a75('0x8')]=_0x2daa3a[_0x3a75('0x8')];this[_0x3a75('0x9')]=_0x2daa3a[_0x3a75('0x8')]===_0x3a75('0xa')?_0x3a75('0xb'):_0x2daa3a[_0x3a75('0x8')];this['countbusyretry']=_0x2daa3a[_0x3a75('0xc')];this[_0x3a75('0xd')]=_0x2daa3a[_0x3a75('0xd')];this['countnoanswerretry']=_0x2daa3a[_0x3a75('0xe')];this[_0x3a75('0xf')]=_0x2daa3a[_0x3a75('0xc')]+_0x2daa3a['countcongestionretry']+_0x2daa3a['countnoanswerretry']+_0x2daa3a['countnosuchnumberretry']+_0x2daa3a['countdropretry']+_0x2daa3a[_0x3a75('0x10')]+_0x2daa3a['countmachineretry']+_0x2daa3a[_0x3a75('0x11')];this[_0x3a75('0x12')]=_0x2daa3a['countnosuchnumberretry'];this[_0x3a75('0x13')]=_0x2daa3a[_0x3a75('0x13')];this[_0x3a75('0x10')]=_0x2daa3a[_0x3a75('0x10')];this[_0x3a75('0x14')]=_0x2daa3a[_0x3a75('0x14')];this[_0x3a75('0x11')]=_0x2daa3a[_0x3a75('0x11')];this[_0x3a75('0x15')]=_0x516726[_0x3a75('0x15')];this[_0x3a75('0x16')]=_0x2daa3a[_0x3a75('0x17')];this[_0x3a75('0x18')]=_0x2daa3a[_0x3a75('0x19')];this[_0x3a75('0x1a')]=_0x2daa3a[_0x3a75('0x1a')];this[_0x3a75('0x1b')]=_0x2daa3a[_0x3a75('0x1b')];this[_0x3a75('0x1c')]=_0x2daa3a[_0x3a75('0x1c')];this[_0x3a75('0x1d')]=moment()[_0x3a75('0x1e')](_0x3a75('0x1f'));this['ringtime']=getSeconds(_0x2daa3a['responsetime'],_0x2daa3a[_0x3a75('0x1a')]);this[_0x3a75('0x20')]=getSeconds(_0x2daa3a[_0x3a75('0x1c')],_0x2daa3a[_0x3a75('0x1b')]);this[_0x3a75('0x21')]=getSeconds(this['endtime'],_0x2daa3a[_0x3a75('0x1c')]);this['queue']=_0x516726['queue'];this[_0x3a75('0x22')]=_0x516726['membername'];this[_0x3a75('0x23')]=_0x516726[_0x3a75('0x23')];this[_0x3a75('0x24')]=_0x2daa3a['callback'];this[_0x3a75('0x25')]=_0x2daa3a['callbackuniqueid'];this[_0x3a75('0x26')]=_0x2daa3a['callbackat'];this[_0x3a75('0x27')]=_0x2daa3a['recallme'];this[_0x3a75('0x28')]=_0x2daa3a['ContactId'];this[_0x3a75('0x29')]=_0x2daa3a[_0x3a75('0x29')];this['UserId']=_0x2daa3a[_0x3a75('0x2a')];this[_0x3a75('0x2b')]=_0x2daa3a[_0x3a75('0x2b')];this[_0x3a75('0x2c')]=_0x2daa3a['CampaignId'];this['originatecalleridnum']=_0x2daa3a[_0x3a75('0x2d')]||'';this[_0x3a75('0x2e')]=_0x2daa3a['originatecalleridname']||'';}module[_0x3a75('0x2f')]=AgentComplete;
\ No newline at end of file
+var _0x3140=['outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','starttime','responsetime','answertime','endtime','format','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype'];(function(_0x146c18,_0xb46e91){var _0x26038c=function(_0x2d0cbe){while(--_0x2d0cbe){_0x146c18['push'](_0x146c18['shift']());}};_0x26038c(++_0xb46e91);}(_0x3140,0x76));var _0x0314=function(_0x2a97f7,_0x465e0c){_0x2a97f7=_0x2a97f7-0x0;var _0x13c258=_0x3140[_0x2a97f7];return _0x13c258;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0314('0x0'));function getSeconds(_0x483cc5,_0x1450ca){var _0x124f15=moment(_0x483cc5)[_0x0314('0x1')](0x0);var _0x56981c=moment(_0x1450ca)[_0x0314('0x1')](0x0);return _0x124f15[_0x0314('0x2')](_0x56981c,_0x0314('0x3'));}function AgentComplete(_0x468969,_0x4eecc8){this['state']=0x4;this['statedesc']=_0x0314('0x4');this[_0x0314('0x5')]=_0x468969[_0x0314('0x5')];this[_0x0314('0x6')]=_0x468969[_0x0314('0x6')];this[_0x0314('0x7')]=_0x468969[_0x0314('0x6')]===_0x0314('0x8')?_0x0314('0x9'):_0x468969[_0x0314('0x6')];this[_0x0314('0xa')]=_0x468969[_0x0314('0xa')];this[_0x0314('0xb')]=_0x468969['countcongestionretry'];this['countnoanswerretry']=_0x468969[_0x0314('0xc')];this[_0x0314('0xd')]=_0x468969[_0x0314('0xa')]+_0x468969['countcongestionretry']+_0x468969['countnoanswerretry']+_0x468969[_0x0314('0xe')]+_0x468969[_0x0314('0xf')]+_0x468969['countabandonedretry']+_0x468969[_0x0314('0x10')]+_0x468969[_0x0314('0x11')];this['countnosuchnumberretry']=_0x468969[_0x0314('0xe')];this[_0x0314('0xf')]=_0x468969['countdropretry'];this[_0x0314('0x12')]=_0x468969[_0x0314('0x12')];this[_0x0314('0x10')]=_0x468969[_0x0314('0x10')];this['countagentrejectretry']=_0x468969[_0x0314('0x11')];this['uniqueid']=_0x4eecc8[_0x0314('0x13')];this['calleridname']=_0x468969[_0x0314('0x14')];this['calleridnum']=_0x468969['number'];this['starttime']=_0x468969[_0x0314('0x15')];this[_0x0314('0x16')]=_0x468969['responsetime'];this[_0x0314('0x17')]=_0x468969[_0x0314('0x17')];this[_0x0314('0x18')]=moment()[_0x0314('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x0314('0x1a')]=getSeconds(_0x468969['responsetime'],_0x468969['starttime']);this[_0x0314('0x1b')]=getSeconds(_0x468969[_0x0314('0x17')],_0x468969[_0x0314('0x16')]);this[_0x0314('0x1c')]=getSeconds(this[_0x0314('0x18')],_0x468969[_0x0314('0x17')]);this['queue']=_0x4eecc8['queue'];this[_0x0314('0x1d')]=_0x4eecc8[_0x0314('0x1d')];this[_0x0314('0x1e')]=_0x4eecc8[_0x0314('0x1e')];this['callback']=_0x468969[_0x0314('0x1f')];this['callbackuniqueid']=_0x468969[_0x0314('0x20')];this[_0x0314('0x21')]=_0x468969[_0x0314('0x21')];this[_0x0314('0x22')]=_0x468969['recallme'];this['ContactId']=_0x468969['ContactId'];this['ListId']=_0x468969[_0x0314('0x23')];this[_0x0314('0x24')]=_0x468969[_0x0314('0x24')];this['VoiceQueueId']=_0x468969[_0x0314('0x25')];this['CampaignId']=_0x468969[_0x0314('0x26')];this[_0x0314('0x27')]=_0x468969[_0x0314('0x27')]||'';this['originatecalleridname']=_0x468969[_0x0314('0x28')]||'';}module[_0x0314('0x29')]=AgentComplete;
\ No newline at end of file
index dec7492..7c9b0a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname'];(function(_0x73cf31,_0x4310b1){var _0x35aea0=function(_0x5b7cd2){while(--_0x5b7cd2){_0x73cf31['push'](_0x73cf31['shift']());}};_0x35aea0(++_0x4310b1);}(_0xabce,0x103));var _0xeabc=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xabce[_0x40bffc];return _0x3007e9;};'use strict';var util=require(_0xeabc('0x0'));var _=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));function getSeconds(_0x572221,_0x49dbcc){var _0x5bd1a4=moment(_0x572221)['milliseconds'](0x0);var _0x2e01eb=moment(_0x49dbcc)[_0xeabc('0x3')](0x0);return _0x5bd1a4[_0xeabc('0x4')](_0x2e01eb,'seconds');}function Final(_0x54e4a8){this[_0xeabc('0x5')]=_0x54e4a8['uniqueid'];this[_0xeabc('0x6')]=_0x54e4a8['scheduledat'];this[_0xeabc('0x7')]=_0x54e4a8[_0xeabc('0x7')];this[_0xeabc('0x8')]=_0x54e4a8['type']===_0xeabc('0x9')?_0xeabc('0xa'):_0x54e4a8[_0xeabc('0x7')];this[_0xeabc('0xb')]=_0x54e4a8[_0xeabc('0xb')];this[_0xeabc('0xc')]=_0x54e4a8[_0xeabc('0xc')];this[_0xeabc('0xd')]=_0x54e4a8[_0xeabc('0xd')];this[_0xeabc('0xe')]=_0x54e4a8[_0xeabc('0xb')]+_0x54e4a8[_0xeabc('0xc')]+_0x54e4a8[_0xeabc('0xd')]+_0x54e4a8[_0xeabc('0xf')]+_0x54e4a8[_0xeabc('0x10')]+_0x54e4a8[_0xeabc('0x11')]+_0x54e4a8['countmachineretry']+_0x54e4a8[_0xeabc('0x12')];this[_0xeabc('0xf')]=_0x54e4a8[_0xeabc('0xf')];this['countdropretry']=_0x54e4a8['countdropretry'];this[_0xeabc('0x11')]=_0x54e4a8[_0xeabc('0x11')];this[_0xeabc('0x13')]=_0x54e4a8['countmachineretry'];this[_0xeabc('0x12')]=_0x54e4a8[_0xeabc('0x12')];this['queue']=_0x54e4a8['queue'];this[_0xeabc('0x14')]=_0x54e4a8['calleridname'];this[_0xeabc('0x15')]=_0x54e4a8[_0xeabc('0x15')];this[_0xeabc('0x16')]=_0x54e4a8[_0xeabc('0x16')];this[_0xeabc('0x17')]=_0x54e4a8[_0xeabc('0x17')];this[_0xeabc('0x18')]=_0x54e4a8[_0xeabc('0x17')];this['ringtime']=_0x54e4a8[_0xeabc('0x19')]||0x0;this['holdtime']=_0x54e4a8[_0xeabc('0x1a')]||0x0;this[_0xeabc('0x1b')]=_0x54e4a8['talktime']||0x0;this[_0xeabc('0x1c')]=_0x54e4a8[_0xeabc('0x1c')];this[_0xeabc('0x1d')]=_0x54e4a8[_0xeabc('0x1d')];this[_0xeabc('0x1e')]=_0x54e4a8['callbackat'];this[_0xeabc('0x1f')]=_0x54e4a8[_0xeabc('0x1f')];this[_0xeabc('0x20')]=_0x54e4a8['ContactId'];this[_0xeabc('0x21')]=_0x54e4a8[_0xeabc('0x21')];this[_0xeabc('0x22')]=_0x54e4a8[_0xeabc('0x22')];this['VoiceQueueId']=_0x54e4a8[_0xeabc('0x23')];this['CampaignId']=_0x54e4a8[_0xeabc('0x24')];this['originatecalleridnum']=_0x54e4a8[_0xeabc('0x25')]||'';this[_0xeabc('0x26')]=_0x54e4a8[_0xeabc('0x26')]||'';}module[_0xeabc('0x27')]=Final;
\ No newline at end of file
+var _0xac95=['holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime'];(function(_0x393b7b,_0x377499){var _0x48d826=function(_0x5b18bb){while(--_0x5b18bb){_0x393b7b['push'](_0x393b7b['shift']());}};_0x48d826(++_0x377499);}(_0xac95,0xa8));var _0x5ac9=function(_0x49246f,_0x2fe0df){_0x49246f=_0x49246f-0x0;var _0x50b07f=_0xac95[_0x49246f];return _0x50b07f;};'use strict';var util=require(_0x5ac9('0x0'));var _=require(_0x5ac9('0x1'));var moment=require(_0x5ac9('0x2'));function getSeconds(_0x471ff6,_0x4c14a3){var _0x57ca1c=moment(_0x471ff6)[_0x5ac9('0x3')](0x0);var _0x1ebdea=moment(_0x4c14a3)['milliseconds'](0x0);return _0x57ca1c[_0x5ac9('0x4')](_0x1ebdea,_0x5ac9('0x5'));}function Final(_0x5b445a){this[_0x5ac9('0x6')]=_0x5b445a[_0x5ac9('0x6')];this[_0x5ac9('0x7')]=_0x5b445a['scheduledat'];this['type']=_0x5b445a[_0x5ac9('0x8')];this[_0x5ac9('0x9')]=_0x5b445a[_0x5ac9('0x8')]===_0x5ac9('0xa')?_0x5ac9('0xb'):_0x5b445a[_0x5ac9('0x8')];this['countbusyretry']=_0x5b445a[_0x5ac9('0xc')];this[_0x5ac9('0xd')]=_0x5b445a['countcongestionretry'];this[_0x5ac9('0xe')]=_0x5b445a['countnoanswerretry'];this[_0x5ac9('0xf')]=_0x5b445a['countbusyretry']+_0x5b445a[_0x5ac9('0xd')]+_0x5b445a[_0x5ac9('0xe')]+_0x5b445a[_0x5ac9('0x10')]+_0x5b445a[_0x5ac9('0x11')]+_0x5b445a['countabandonedretry']+_0x5b445a['countmachineretry']+_0x5b445a[_0x5ac9('0x12')];this['countnosuchnumberretry']=_0x5b445a[_0x5ac9('0x10')];this[_0x5ac9('0x11')]=_0x5b445a['countdropretry'];this[_0x5ac9('0x13')]=_0x5b445a[_0x5ac9('0x13')];this[_0x5ac9('0x14')]=_0x5b445a[_0x5ac9('0x14')];this[_0x5ac9('0x12')]=_0x5b445a[_0x5ac9('0x12')];this[_0x5ac9('0xb')]=_0x5b445a[_0x5ac9('0xb')];this[_0x5ac9('0x15')]=_0x5b445a['calleridname'];this['calleridnum']=_0x5b445a[_0x5ac9('0x16')];this[_0x5ac9('0x17')]=_0x5b445a[_0x5ac9('0x17')];this[_0x5ac9('0x18')]=_0x5b445a[_0x5ac9('0x18')];this[_0x5ac9('0x19')]=_0x5b445a[_0x5ac9('0x18')];this[_0x5ac9('0x1a')]=_0x5b445a[_0x5ac9('0x1a')]||0x0;this[_0x5ac9('0x1b')]=_0x5b445a[_0x5ac9('0x1b')]||0x0;this[_0x5ac9('0x1c')]=_0x5b445a[_0x5ac9('0x1c')]||0x0;this['callback']=_0x5b445a[_0x5ac9('0x1d')];this[_0x5ac9('0x1e')]=_0x5b445a[_0x5ac9('0x1e')];this[_0x5ac9('0x1f')]=_0x5b445a[_0x5ac9('0x1f')];this['recallme']=_0x5b445a[_0x5ac9('0x20')];this[_0x5ac9('0x21')]=_0x5b445a['ContactId'];this['ListId']=_0x5b445a['ListId'];this[_0x5ac9('0x22')]=_0x5b445a[_0x5ac9('0x22')];this['VoiceQueueId']=_0x5b445a['VoiceQueueId'];this[_0x5ac9('0x23')]=_0x5b445a['CampaignId'];this['originatecalleridnum']=_0x5b445a[_0x5ac9('0x24')]||'';this['originatecalleridname']=_0x5b445a[_0x5ac9('0x25')]||'';}module[_0x5ac9('0x26')]=Final;
\ No newline at end of file
index 80947ad..8e278e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa968=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','cause-txt'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa968,0x162));var _0x8a96=function(_0x1acdf6,_0x578f82){_0x1acdf6=_0x1acdf6-0x0;var _0xbe5ce4=_0xa968[_0x1acdf6];return _0xbe5ce4;};'use strict';var util=require(_0x8a96('0x0'));var _=require('lodash');var moment=require(_0x8a96('0x1'));function getSeconds(_0x407424,_0x3554ed){var _0x211bb8=moment(_0x407424)[_0x8a96('0x2')](0x0);var _0x5ba04f=moment(_0x3554ed)[_0x8a96('0x2')](0x0);return _0x211bb8[_0x8a96('0x3')](_0x5ba04f,'seconds');}function Hangup(_0xb44409,_0x437fc9){this[_0x8a96('0x4')]=0x4;this[_0x8a96('0x5')]=_0x8a96('0x6');this[_0x8a96('0x7')]=_0xb44409[_0x8a96('0x7')];this['type']=_0xb44409[_0x8a96('0x8')];this[_0x8a96('0x9')]=_0xb44409['type']==='outbound'?_0x8a96('0xa'):_0xb44409[_0x8a96('0x8')];this[_0x8a96('0xb')]=_0xb44409[_0x8a96('0xb')];this[_0x8a96('0xc')]=_0xb44409['countcongestionretry'];this[_0x8a96('0xd')]=_0xb44409[_0x8a96('0xd')];this[_0x8a96('0xe')]=_0xb44409[_0x8a96('0xb')]+_0xb44409[_0x8a96('0xc')]+_0xb44409[_0x8a96('0xd')]+_0xb44409['countnosuchnumberretry']+_0xb44409[_0x8a96('0xf')]+_0xb44409[_0x8a96('0x10')]+_0xb44409[_0x8a96('0x11')]+_0xb44409[_0x8a96('0x12')];this['countnosuchnumberretry']=_0xb44409[_0x8a96('0x13')];this['countdropretry']=_0xb44409[_0x8a96('0xf')];this[_0x8a96('0x10')]=_0xb44409[_0x8a96('0x10')];this[_0x8a96('0x11')]=_0xb44409['countmachineretry'];this['countagentrejectretry']=_0xb44409[_0x8a96('0x12')];this[_0x8a96('0x14')]=_0x437fc9[_0x8a96('0x14')];this['calleridname']=_0xb44409['name'];this[_0x8a96('0x15')]=_0xb44409[_0x8a96('0x16')];this[_0x8a96('0x17')]=_0xb44409[_0x8a96('0x17')];this[_0x8a96('0x18')]=_0xb44409[_0x8a96('0x18')];this[_0x8a96('0x19')]=moment()[_0x8a96('0x1a')](_0x8a96('0x1b'));this[_0x8a96('0x1c')]=getSeconds(_0xb44409[_0x8a96('0x18')],_0xb44409['starttime']);this[_0x8a96('0x1d')]=0x0;this['talktime']=getSeconds(this[_0x8a96('0x19')],_0xb44409[_0x8a96('0x18')]);this['queue']=_0xb44409[_0x8a96('0xa')];this[_0x8a96('0x1e')]='IVR';this[_0x8a96('0x1f')]=_0x437fc9[_0x8a96('0x20')];this[_0x8a96('0x21')]=_0xb44409[_0x8a96('0x21')];this[_0x8a96('0x22')]=_0xb44409[_0x8a96('0x22')];this[_0x8a96('0x23')]=_0xb44409[_0x8a96('0x23')];this[_0x8a96('0x24')]=_0xb44409[_0x8a96('0x24')];this[_0x8a96('0x25')]=_0xb44409[_0x8a96('0x25')];this[_0x8a96('0x26')]=_0xb44409[_0x8a96('0x26')];this[_0x8a96('0x27')]=_0xb44409[_0x8a96('0x27')];this[_0x8a96('0x28')]=_0xb44409[_0x8a96('0x28')];this['CampaignId']=_0xb44409[_0x8a96('0x29')];}module[_0x8a96('0x2a')]=Hangup;
\ No newline at end of file
+var _0xb92d=['diff','seconds','state','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds'];(function(_0xb364d4,_0x70819e){var _0x1718be=function(_0x2ca436){while(--_0x2ca436){_0xb364d4['push'](_0xb364d4['shift']());}};_0x1718be(++_0x70819e);}(_0xb92d,0x15c));var _0xdb92=function(_0x4cb272,_0x52c0e9){_0x4cb272=_0x4cb272-0x0;var _0x57b4aa=_0xb92d[_0x4cb272];return _0x57b4aa;};'use strict';var util=require(_0xdb92('0x0'));var _=require(_0xdb92('0x1'));var moment=require(_0xdb92('0x2'));function getSeconds(_0x248784,_0x26cbec){var _0xc6e191=moment(_0x248784)[_0xdb92('0x3')](0x0);var _0xbfb603=moment(_0x26cbec)['milliseconds'](0x0);return _0xc6e191[_0xdb92('0x4')](_0xbfb603,_0xdb92('0x5'));}function Hangup(_0x17f4fe,_0x192fb1){this[_0xdb92('0x6')]=0x4;this[_0xdb92('0x7')]=_0xdb92('0x8');this[_0xdb92('0x9')]=_0x17f4fe[_0xdb92('0x9')];this[_0xdb92('0xa')]=_0x17f4fe[_0xdb92('0xa')];this['campaigntype']=_0x17f4fe[_0xdb92('0xa')]==='outbound'?_0xdb92('0xb'):_0x17f4fe['type'];this[_0xdb92('0xc')]=_0x17f4fe[_0xdb92('0xc')];this['countcongestionretry']=_0x17f4fe[_0xdb92('0xd')];this[_0xdb92('0xe')]=_0x17f4fe[_0xdb92('0xe')];this[_0xdb92('0xf')]=_0x17f4fe[_0xdb92('0xc')]+_0x17f4fe['countcongestionretry']+_0x17f4fe[_0xdb92('0xe')]+_0x17f4fe['countnosuchnumberretry']+_0x17f4fe[_0xdb92('0x10')]+_0x17f4fe[_0xdb92('0x11')]+_0x17f4fe['countmachineretry']+_0x17f4fe['countagentrejectretry'];this[_0xdb92('0x12')]=_0x17f4fe[_0xdb92('0x12')];this[_0xdb92('0x10')]=_0x17f4fe[_0xdb92('0x10')];this[_0xdb92('0x11')]=_0x17f4fe['countabandonedretry'];this[_0xdb92('0x13')]=_0x17f4fe[_0xdb92('0x13')];this['countagentrejectretry']=_0x17f4fe['countagentrejectretry'];this[_0xdb92('0x14')]=_0x192fb1[_0xdb92('0x14')];this[_0xdb92('0x15')]=_0x17f4fe[_0xdb92('0x16')];this['calleridnum']=_0x17f4fe['number'];this['starttime']=_0x17f4fe[_0xdb92('0x17')];this[_0xdb92('0x18')]=_0x17f4fe['responsetime'];this[_0xdb92('0x19')]=moment()[_0xdb92('0x1a')](_0xdb92('0x1b'));this[_0xdb92('0x1c')]=getSeconds(_0x17f4fe[_0xdb92('0x18')],_0x17f4fe[_0xdb92('0x17')]);this[_0xdb92('0x1d')]=0x0;this[_0xdb92('0x1e')]=getSeconds(this[_0xdb92('0x19')],_0x17f4fe['responsetime']);this['queue']=_0x17f4fe[_0xdb92('0xb')];this[_0xdb92('0x1f')]='IVR';this[_0xdb92('0x20')]=_0x192fb1[_0xdb92('0x21')];this[_0xdb92('0x22')]=_0x17f4fe['callback'];this[_0xdb92('0x23')]=_0x17f4fe['callbackuniqueid'];this[_0xdb92('0x24')]=_0x17f4fe[_0xdb92('0x24')];this[_0xdb92('0x25')]=_0x17f4fe[_0xdb92('0x25')];this['ContactId']=_0x17f4fe[_0xdb92('0x26')];this[_0xdb92('0x27')]=_0x17f4fe[_0xdb92('0x27')];this['UserId']=_0x17f4fe[_0xdb92('0x28')];this[_0xdb92('0x29')]=_0x17f4fe[_0xdb92('0x29')];this[_0xdb92('0x2a')]=_0x17f4fe[_0xdb92('0x2a')];}module[_0xdb92('0x2b')]=Hangup;
\ No newline at end of file
index 2ffe489..a2b53cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x144e=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','talktime','callbackuniqueid'];(function(_0x48c784,_0x52b6fc){var _0x4634d9=function(_0x5c4f16){while(--_0x5c4f16){_0x48c784['push'](_0x48c784['shift']());}};_0x4634d9(++_0x52b6fc);}(_0x144e,0x1c5));var _0xe144=function(_0x938e4d,_0x523611){_0x938e4d=_0x938e4d-0x0;var _0x3b3c82=_0x144e[_0x938e4d];return _0x3b3c82;};'use strict';var util=require(_0xe144('0x0'));var _=require('lodash');var moment=require(_0xe144('0x1'));function getSeconds(_0x3b5315,_0x82f159){var _0x4dc098=moment(_0x3b5315)[_0xe144('0x2')](0x0);var _0x4c8144=moment(_0x82f159)[_0xe144('0x2')](0x0);return _0x4dc098[_0xe144('0x3')](_0x4c8144,_0xe144('0x4'));}function History(_0x24a53a){this['uniqueid']=_0x24a53a['uniqueid'];this[_0xe144('0x5')]=_0x24a53a[_0xe144('0x5')]||undefined;this[_0xe144('0x6')]=_0x24a53a['type'];this[_0xe144('0x7')]=_0x24a53a[_0xe144('0x6')]===_0xe144('0x8')?'queue':_0x24a53a['type'];this['countbusyretry']=_0x24a53a[_0xe144('0x9')];this[_0xe144('0xa')]=_0x24a53a[_0xe144('0xa')];this['countnoanswerretry']=_0x24a53a['countnoanswerretry'];this[_0xe144('0xb')]=_0x24a53a['countbusyretry']+_0x24a53a[_0xe144('0xa')]+_0x24a53a[_0xe144('0xc')]+_0x24a53a[_0xe144('0xd')]+_0x24a53a['countdropretry']+_0x24a53a[_0xe144('0xe')]+_0x24a53a[_0xe144('0xf')]+_0x24a53a[_0xe144('0x10')];this[_0xe144('0xd')]=_0x24a53a[_0xe144('0xd')];this['countdropretry']=_0x24a53a['countdropretry'];this[_0xe144('0xe')]=_0x24a53a['countabandonedretry'];this[_0xe144('0xf')]=_0x24a53a['countmachineretry'];this[_0xe144('0x10')]=_0x24a53a[_0xe144('0x10')];this[_0xe144('0x11')]=_0x24a53a[_0xe144('0x11')];this[_0xe144('0x12')]=_0x24a53a[_0xe144('0x13')];this[_0xe144('0x14')]=_0x24a53a[_0xe144('0x15')];this[_0xe144('0x16')]=_0x24a53a[_0xe144('0x16')];this['responsetime']=_0x24a53a[_0xe144('0x17')];this[_0xe144('0x18')]=_0x24a53a[_0xe144('0x17')];this[_0xe144('0x19')]=getSeconds(_0x24a53a[_0xe144('0x17')],_0x24a53a[_0xe144('0x16')]);this['holdtime']=0x0;this[_0xe144('0x1a')]=0x0;this['callback']=_0x24a53a['callback'];this[_0xe144('0x1b')]=_0x24a53a[_0xe144('0x1b')];this[_0xe144('0x1c')]=_0x24a53a[_0xe144('0x1c')];this[_0xe144('0x1d')]=_0x24a53a['recallme'];this[_0xe144('0x1e')]=_0x24a53a[_0xe144('0x1e')];this[_0xe144('0x1f')]=_0x24a53a[_0xe144('0x1f')];this[_0xe144('0x20')]=_0x24a53a[_0xe144('0x20')];this[_0xe144('0x21')]=_0x24a53a['VoiceQueueId'];this[_0xe144('0x22')]=_0x24a53a[_0xe144('0x22')];this[_0xe144('0x23')]=_0x24a53a[_0xe144('0x23')]||'';this[_0xe144('0x24')]=_0x24a53a[_0xe144('0x24')]||'';}module['exports']=History;
\ No newline at end of file
+var _0xa79c=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','holdtime'];(function(_0x155ad9,_0x5e5d8b){var _0x3667a1=function(_0x3a0100){while(--_0x3a0100){_0x155ad9['push'](_0x155ad9['shift']());}};_0x3667a1(++_0x5e5d8b);}(_0xa79c,0x1a2));var _0xca79=function(_0x34591b,_0x4eaeb4){_0x34591b=_0x34591b-0x0;var _0x5d6409=_0xa79c[_0x34591b];return _0x5d6409;};'use strict';var util=require(_0xca79('0x0'));var _=require(_0xca79('0x1'));var moment=require('moment');function getSeconds(_0x1bd2b0,_0x1c1c11){var _0x4af7fa=moment(_0x1bd2b0)[_0xca79('0x2')](0x0);var _0x4eef99=moment(_0x1c1c11)[_0xca79('0x2')](0x0);return _0x4af7fa[_0xca79('0x3')](_0x4eef99,_0xca79('0x4'));}function History(_0x2c9641){this['uniqueid']=_0x2c9641[_0xca79('0x5')];this[_0xca79('0x6')]=_0x2c9641[_0xca79('0x6')]||undefined;this['type']=_0x2c9641[_0xca79('0x7')];this[_0xca79('0x8')]=_0x2c9641[_0xca79('0x7')]==='outbound'?'queue':_0x2c9641[_0xca79('0x7')];this[_0xca79('0x9')]=_0x2c9641[_0xca79('0x9')];this[_0xca79('0xa')]=_0x2c9641[_0xca79('0xa')];this['countnoanswerretry']=_0x2c9641[_0xca79('0xb')];this[_0xca79('0xc')]=_0x2c9641[_0xca79('0x9')]+_0x2c9641[_0xca79('0xa')]+_0x2c9641['countnoanswerretry']+_0x2c9641['countnosuchnumberretry']+_0x2c9641['countdropretry']+_0x2c9641[_0xca79('0xd')]+_0x2c9641['countmachineretry']+_0x2c9641['countagentrejectretry'];this[_0xca79('0xe')]=_0x2c9641[_0xca79('0xe')];this['countdropretry']=_0x2c9641[_0xca79('0xf')];this[_0xca79('0xd')]=_0x2c9641['countabandonedretry'];this[_0xca79('0x10')]=_0x2c9641[_0xca79('0x10')];this[_0xca79('0x11')]=_0x2c9641[_0xca79('0x11')];this['queue']=_0x2c9641['queue'];this[_0xca79('0x12')]=_0x2c9641[_0xca79('0x13')];this[_0xca79('0x14')]=_0x2c9641[_0xca79('0x15')];this[_0xca79('0x16')]=_0x2c9641[_0xca79('0x16')];this[_0xca79('0x17')]=_0x2c9641['responsetime'];this[_0xca79('0x18')]=_0x2c9641['responsetime'];this['ringtime']=getSeconds(_0x2c9641[_0xca79('0x17')],_0x2c9641[_0xca79('0x16')]);this[_0xca79('0x19')]=0x0;this['talktime']=0x0;this[_0xca79('0x1a')]=_0x2c9641['callback'];this[_0xca79('0x1b')]=_0x2c9641[_0xca79('0x1b')];this[_0xca79('0x1c')]=_0x2c9641[_0xca79('0x1c')];this[_0xca79('0x1d')]=_0x2c9641['recallme'];this[_0xca79('0x1e')]=_0x2c9641[_0xca79('0x1e')];this[_0xca79('0x1f')]=_0x2c9641[_0xca79('0x1f')];this[_0xca79('0x20')]=_0x2c9641[_0xca79('0x20')];this[_0xca79('0x21')]=_0x2c9641[_0xca79('0x21')];this['CampaignId']=_0x2c9641['CampaignId'];this[_0xca79('0x22')]=_0x2c9641[_0xca79('0x22')]||'';this[_0xca79('0x23')]=_0x2c9641[_0xca79('0x23')]||'';}module[_0xca79('0x24')]=History;
\ No newline at end of file
index e4b194a..8eeb8c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe004=['calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','push','idHopper','[unlockQueueStatus][undefined]','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','checkPreviewRecallReminder','handlePreviewRecallNotifications','user:%s','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','throttle','filter','online','map','Agent','user:dialPreviewRecallReminder','dialGlobalInterval','checkIfTimeIntervals','[syncCampaigns]','pow','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','XMD-','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','UserId','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','limitCalls','RUNNING','ivrTotalCallsDays','[getContactCampaign2]','dialLimitQueue','not_inuse','[countReScheduled]\x20','[actionOriginate]\x20','[handlePredictive][limitChannel]','tryOriginatePredictive','dialOrderByScheduledAt','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','lodash','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','voice:queue:%s','ivr','format','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','available','debug','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','actions','[actions]','sequence','Action','catch','No\x20such\x20channel','updateOriginated','queue','resolve','countReScheduled','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','[emptyContact][createHistory]','[emptyContact]','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','state','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','MACHINE','Machine','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','countmachineretry','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countnoanswerretry','countnosuchnumberretry','dialMachineMaxRetry','ivrAnswerCallsDay','AGI','[syncHangupIvr][createHistory]','[syncHangupIvr]','cause-txt','Unknow','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','droptime','dialQueueTimeout','Drop','dropreason','TIMEOUT','callAdditionalPhoneAfterMin','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname'];(function(_0x3a223a,_0x303433){var _0xb6ac7d=function(_0x4a076d){while(--_0x4a076d){_0x3a223a['push'](_0x3a223a['shift']());}};_0xb6ac7d(++_0x303433);}(_0xe004,0x10b));var _0x4e00=function(_0x5a5409,_0x220ee6){_0x5a5409=_0x5a5409-0x0;var _0x13a280=_0xe004[_0x5a5409];return _0x13a280;};'use strict';var util=require(_0x4e00('0x0'));var _=require(_0x4e00('0x1'));var uuid=require('uuid');var moment=require('moment');var rr=require('rr');var md5=require(_0x4e00('0x2'));var Redis=require(_0x4e00('0x3'));var ut=require('../preview/util/util');var config=require(_0x4e00('0x4'));var logger=require(_0x4e00('0x5'))(_0x4e00('0x6'));var loggerBooked=require('../../../config/logger')(_0x4e00('0x7'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x4e00('0x5'))(_0x4e00('0x8'));var loggerSyncQueueSummary=require(_0x4e00('0x5'))(_0x4e00('0x9'));var ami=require('../ami');config[_0x4e00('0xa')]=_[_0x4e00('0xb')](config[_0x4e00('0xa')],{'host':_0x4e00('0xc'),'port':0x18eb});var io=require(_0x4e00('0xd'))(new Redis(config[_0x4e00('0xa')]));var cmHopper=require(_0x4e00('0xe'));var cmHopperHistory=require(_0x4e00('0xf'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x4e00('0x10'));var voiceQueueRt=require(_0x4e00('0x11'));var RpcSetting=require('../rpc/setting');var Action=require(_0x4e00('0x12'));var History=require(_0x4e00('0x13'));var Final=require(_0x4e00('0x14'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x4e00('0x15'));var Hangup=require(_0x4e00('0x16'));var ipAgi=process['env'][_0x4e00('0x17')]||_0x4e00('0x18');var strategy={'rrmemory':_0x4e00('0x19'),'roundrobin':_0x4e00('0x1a')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x4e00('0x1b')][_0x4e00('0x1c')]=function(_0x17d322){this['tail']=this[_0x4e00('0x1d')]?this[_0x4e00('0x1d')][_0x4e00('0x1e')](_0x17d322):_0x17d322();};function Dialer(_0x4b5553,_0x3fc10d){this['sequence']=new Sequence();this[_0x4e00('0x1f')]=_0x3fc10d;this[_0x4e00('0x20')]=_0x4b5553[_0x4e00('0x20')];this[_0x4e00('0x21')]=_0x4b5553[_0x4e00('0x21')];this[_0x4e00('0x22')]=_0x4b5553[_0x4e00('0x22')];this[_0x4e00('0x23')]=_0x4b5553[_0x4e00('0x23')];this[_0x4e00('0x24')]=config['maxNumberOriginate']||0x2;this[_0x4e00('0x25')]={};this['actions']={};this[_0x4e00('0x26')]={};this[_0x4e00('0x27')]={};this['optionPredictive']={};this[_0x4e00('0x28')]={};this[_0x4e00('0x29')]={};this[_0x4e00('0x2a')]={};this[_0x4e00('0x2b')]={};this['queueBookedRR']={};ami['on'](_0x4e00('0x2c'),this[_0x4e00('0x2d')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x2f'),this[_0x4e00('0x30')]['bind'](this));ami['on'](_0x4e00('0x31'),this[_0x4e00('0x32')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x33'),this['syncAgentComplete'][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x34'),this[_0x4e00('0x9')]['bind'](this));ami['on'](_0x4e00('0x35'),this[_0x4e00('0x36')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x37'),this[_0x4e00('0x38')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x39'),this[_0x4e00('0x3a')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x3b'),this[_0x4e00('0x3c')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x3d'),this[_0x4e00('0x3e')][_0x4e00('0x2e')](this));ami['on'](_0x4e00('0x3f'),this[_0x4e00('0x40')][_0x4e00('0x2e')](this));this[_0x4e00('0x41')]();this[_0x4e00('0x42')]();RpcSetting['getSettings']()[_0x4e00('0x43')](function(_0x418fc9){previewRecallmeReminderInterval=_0x418fc9[_0x4e00('0x44')];});}function isNotNull(_0x4a150e){return _0x4a150e!==null&&!_[_0x4e00('0x45')](_0x4a150e);}function checkIsLoggedIn(_0x34b67a,_0xf46b7){return function(){if(_0xf46b7<=0x0){_0x34b67a[_0x4e00('0x46')]=_0x4e00('0x47');throw _0x34b67a[_0x4e00('0x48')]+_0x4e00('0x49');}};}function isActive(_0x586091){return _0x586091;}function checkIsActive(_0x5de59f,_0x31325a){return function(){if(!isActive(_0x31325a)){_0x5de59f[_0x4e00('0x46')]=_0x4e00('0x4a');throw _0x5de59f[_0x4e00('0x48')]+_0x4e00('0x4b');}};}function checkInterval(_0x264184){return function(){if(!isNotNull(_0x264184[_0x4e00('0x4c')])){_0x264184[_0x4e00('0x46')]=_0x4e00('0x4d');throw _0x264184[_0x4e00('0x48')]+_0x4e00('0x4e');}if(!isNotNull(_0x264184[_0x4e00('0x4c')][_0x4e00('0x4f')])){_0x264184[_0x4e00('0x46')]=_0x4e00('0x4d');throw _0x264184['name']+_0x4e00('0x4e');}if(!isNotNull(_['isEmpty'](_0x264184[_0x4e00('0x4c')][_0x4e00('0x4f')]))){_0x264184[_0x4e00('0x46')]=_0x4e00('0x4d');throw _0x264184['name']+_0x4e00('0x4e');}};}function msgResponse(_0x1b6b4f,_0x5c9523,_0x2cc5e7){return{'action':_0x1b6b4f,'response':_0x5c9523,'message':_0x2cc5e7,'stack':_0x2cc5e7};}function myreject(_0x36318c){return function(_0x4a92d5){return _0x36318c(msgResponse(_0x4e00('0x50'),_0x4e00('0x51'),JSON[_0x4e00('0x52')](_0x4a92d5)));};}function getSeconds(_0xa33ed0,_0xf83fb){var _0x138093=moment(_0xa33ed0)[_0x4e00('0x53')](0x0);var _0x2e8b30=moment(_0xf83fb)[_0x4e00('0x53')](0x0);return _0x138093[_0x4e00('0x54')](_0x2e8b30,'seconds');}function emit(_0x3f06d8,_0x458b23,_0x4a8ea4){io['to'](_0x3f06d8)[_0x4e00('0x55')](_0x458b23,_0x4a8ea4);}function emitVoiceQueueSummary(_0x32f9e3){if(_0x32f9e3[_0x4e00('0x56')]===_0x4e00('0x57')){var _0x3ee7a9={'id':_0x32f9e3['id'],'name':_0x32f9e3[_0x4e00('0x48')],'strategy':_0x32f9e3[_0x4e00('0x58')],'answered':_0x32f9e3[_0x4e00('0x59')],'available':_0x32f9e3['available'],'loggedIn':_0x32f9e3[_0x4e00('0x5a')],'pTalking':_0x32f9e3[_0x4e00('0x5b')],'sumBillable':_0x32f9e3[_0x4e00('0x5c')],'sumDuration':_0x32f9e3['sumDuration'],'sumHoldTime':_0x32f9e3[_0x4e00('0x5d')]||0x0,'talking':_0x32f9e3[_0x4e00('0x5e')],'total':_0x32f9e3['total'],'type':_0x32f9e3[_0x4e00('0x56')],'unmanaged':_0x32f9e3[_0x4e00('0x5f')],'abandoned':_0x32f9e3[_0x4e00('0x60')],'waiting':_0x32f9e3[_0x4e00('0x61')],'loggedInDb':_0x32f9e3['loggedInDb'],'dialActive':_0x32f9e3[_0x4e00('0x62')],'dialMethod':_0x32f9e3[_0x4e00('0x63')],'dialOriginateCallerIdName':_0x32f9e3['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x32f9e3[_0x4e00('0x64')],'dialOriginateTimeout':_0x32f9e3[_0x4e00('0x65')],'dialPrefix':_0x32f9e3['dialPrefix'],'outboundAnswerAgiCallsDay':_0x32f9e3[_0x4e00('0x66')],'outboundAnswerCallsDay':_0x32f9e3[_0x4e00('0x67')],'outboundBlacklistCallsDay':_0x32f9e3[_0x4e00('0x68')],'outboundBusyCallsDay':_0x32f9e3['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x32f9e3[_0x4e00('0x69')],'outboundDropCallsDayACS':_0x32f9e3[_0x4e00('0x6a')],'outboundDropCallsDayCallersExit':_0x32f9e3['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x32f9e3[_0x4e00('0x6b')],'outboundNoAnswerCallsDay':_0x32f9e3[_0x4e00('0x6c')],'outboundNoSuchCallsDay':_0x32f9e3[_0x4e00('0x6d')],'outboundOriginateFailureCallsDay':_0x32f9e3[_0x4e00('0x6e')],'outboundReCallsDay':_0x32f9e3[_0x4e00('0x6f')],'outboundRejectCallsDay':_0x32f9e3[_0x4e00('0x70')],'outboundUnknownCallsDay':_0x32f9e3[_0x4e00('0x71')],'predictiveIntervalAnsweredCalls':_0x32f9e3[_0x4e00('0x72')],'predictiveIntervalAvgHoldtime':_0x32f9e3[_0x4e00('0x73')],'predictiveIntervalAvgTalktime':_0x32f9e3[_0x4e00('0x74')],'predictiveIntervalDroppedCallsCallersExit':_0x32f9e3[_0x4e00('0x75')],'predictiveIntervalDroppedCallsTimeout':_0x32f9e3['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x32f9e3['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x32f9e3[_0x4e00('0x76')],'predictiveIntervalHitRate':_0x32f9e3[_0x4e00('0x77')],'predictiveIntervalMultiplicativeFactor':_0x32f9e3[_0x4e00('0x78')],'predictiveIntervalPauses':_0x32f9e3['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x32f9e3[_0x4e00('0x79')],'predictiveIntervalTotalCalls':_0x32f9e3[_0x4e00('0x7a')],'message':_0x32f9e3[_0x4e00('0x46')],'originated':_0x32f9e3['originated'],'erlangCalls':_0x32f9e3[_0x4e00('0x7b')],'erlangCallToSecond':_0x32f9e3['erlangCallToSecond'],'erlangAbandonmentRate':_0x32f9e3[_0x4e00('0x7c')],'erlangBusyFactor':_0x32f9e3[_0x4e00('0x7d')],'startPredictive':_0x32f9e3[_0x4e00('0x28')],'startProgressive':_0x32f9e3[_0x4e00('0x29')]};if(_0x32f9e3[_0x4e00('0x7e')]){_0x3ee7a9[_0x4e00('0x7e')]={'id':_0x32f9e3[_0x4e00('0x7e')]['id'],'name':_0x32f9e3[_0x4e00('0x7e')]['name'],'active':_0x32f9e3[_0x4e00('0x7e')][_0x4e00('0x7f')],'callerid':_0x32f9e3['Trunk'][_0x4e00('0x80')]};}if(_0x32f9e3[_0x4e00('0x4c')]){_0x3ee7a9[_0x4e00('0x4c')]={'id':_0x32f9e3['Interval']['id'],'name':_0x32f9e3['Interval']['name']};}var _0x552a4e=md5(JSON[_0x4e00('0x52')](_0x3ee7a9));if(_0x32f9e3['md5']!==_0x552a4e){_0x32f9e3['md5']=_0x552a4e;emit(util['format'](_0x4e00('0x81'),_0x3ee7a9[_0x4e00('0x48')]),'voice_queue:save',_0x3ee7a9);}}}function emitCampaignSummary(_0x253916){if(_0x253916[_0x4e00('0x56')]===_0x4e00('0x82')){emit(util[_0x4e00('0x83')]('campaign:ivr:%s',_0x253916['name']),'campaign:save',_0x253916);}}function checkGetDataPredictive(_0x10cc95){if(isNotNull(_0x10cc95)&&!_[_0x4e00('0x84')](_0x10cc95)){loggerPredictive[_0x4e00('0x85')](_0x4e00('0x86'));loggerPredictive['info'](_0x4e00('0x87'),_0x10cc95[_0x4e00('0x7a')]);loggerPredictive['info'](_0x4e00('0x88'),_0x10cc95[_0x4e00('0x72')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x89'),_0x10cc95[_0x4e00('0x8a')]);loggerPredictive[_0x4e00('0x85')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10cc95[_0x4e00('0x75')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8b'),_0x10cc95[_0x4e00('0x73')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8c'),_0x10cc95['predictiveIntervalAvgTalktime']);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8d'));if(_0x10cc95['predictiveIntervalTotalCalls']>0x0){if(!_[_0x4e00('0x45')](_0x10cc95[_0x4e00('0x74')])&&_0x10cc95['predictiveIntervalAvgTalktime']>0x0){return!![];}loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8e'));if(!_[_0x4e00('0x45')](_0x10cc95[_0x4e00('0x73')])&&_0x10cc95[_0x4e00('0x73')]>0x0){return!![];}loggerPredictive[_0x4e00('0x85')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8f'));}}else{loggerPredictive['info'](_0x4e00('0x90'));}return![];}function mergeDataErlangB(_0x4821cd){return function(_0x16367b){loggerPredictive[_0x4e00('0x85')](_0x4e00('0x91'));loggerPredictive[_0x4e00('0x85')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16367b[_0x4e00('0x7b')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x92'),_0x16367b[_0x4e00('0x93')]);loggerPredictive[_0x4e00('0x85')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x16367b[_0x4e00('0x7c')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x94'),_0x16367b[_0x4e00('0x7d')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x95'),_0x16367b[_0x4e00('0x7c')]);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8d'));_[_0x4e00('0x96')](_0x4821cd,_0x16367b);};}function getDiff(_0x52a416){var _0x442873=moment()['milliseconds'](0x0);var _0x3f84ce=moment(_0x52a416)[_0x4e00('0x53')](0x0);return _0x442873[_0x4e00('0x54')](_0x3f84ce,_0x4e00('0x97'));}function ifInterval(_0x592c32,_0x6541d9){if(_[_0x4e00('0x45')](_0x6541d9)){return![];}return getDiff(_0x6541d9)<_0x592c32*0x3c;}function freeVariablesPredictive(_0x1ad420){if(isNotNull(_0x1ad420)){if(!_['isUndefined'](_0x1ad420[_0x4e00('0x29')])){_0x1ad420[_0x4e00('0x29')]=undefined;loggerPredictive[_0x4e00('0x85')](_0x1ad420['name'],_0x4e00('0x98'));}if(!_[_0x4e00('0x45')](_0x1ad420[_0x4e00('0x28')])){_0x1ad420[_0x4e00('0x28')]=undefined;loggerPredictive[_0x4e00('0x85')](_0x1ad420[_0x4e00('0x48')],_0x4e00('0x99'));}if(!_[_0x4e00('0x45')](_0x1ad420[_0x4e00('0x9a')])){clearInterval(_0x1ad420['handlePredictive']);_0x1ad420[_0x4e00('0x9a')]=undefined;loggerPredictive[_0x4e00('0x85')](_0x1ad420[_0x4e00('0x48')],_0x4e00('0x9b'));}}}function erlangb(_0x3f7a51,_0x1e6671){if(_0x1e6671===0x0){return 0x0;}var _0x2b2fd2=0x1;for(var _0x1cd057=0x1;_0x1cd057<=_0x1e6671;_0x1cd057+=0x1){_0x2b2fd2=0x1+_0x2b2fd2*_0x1cd057/_0x3f7a51;}return 0x1/_0x2b2fd2;}function isVoiceQueueOutbound(_0x424246){return _0x424246==='outbound';}function isNotPreview(_0x5849d4){return _0x5849d4!==_0x4e00('0x1f');}function isCampaignIvr(_0x41527c){return _0x41527c===_0x4e00('0x82');}function getCallerId(_0x30bcf8,_0x24964c,_0x321cbc){if(!_['isUndefined'](_0x321cbc)&&typeof _0x321cbc===_0x4e00('0x9c')&&!_[_0x4e00('0x84')](_0x321cbc)){if(!_['isUndefined'](_0x24964c)&&typeof _0x24964c===_0x4e00('0x9c')&&!_[_0x4e00('0x84')](_0x24964c)){return util[_0x4e00('0x83')](_0x4e00('0x9d'),_0x24964c,_0x321cbc);}return util[_0x4e00('0x83')](_0x4e00('0x9d'),_0x321cbc,_0x321cbc);}if(!_['isUndefined'](_0x30bcf8)&&typeof _0x30bcf8===_0x4e00('0x9c')&&!_[_0x4e00('0x84')](_0x30bcf8)){return _0x30bcf8;}return _0x4e00('0x9e');}function loggerCatchQueueSummary(_0xbd91a1,_0x23b55a){return function(_0x3fede2){freeVariablesPredictive(_0x23b55a);emitVoiceQueueSummary(_0x23b55a);emitCampaignSummary(_0x23b55a);loggerSyncQueueSummary['debug'](_0xbd91a1,util[_0x4e00('0x9f')](_0x3fede2,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1fd308,_0xfbcc0a){return function(_0x429fae){loggerPredictive[_0x4e00('0xa0')](_0xfbcc0a['name'],_0x1fd308);loggerPredictive[_0x4e00('0xa0')](_0x429fae[_0x4e00('0xa1')]);freeVariablesPredictive(_0xfbcc0a);};}function loggerCatch(_0x572912){return function(_0x5ea52c){logger[_0x4e00('0xa0')](_0x572912,util[_0x4e00('0x9f')](_0x5ea52c,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x241e81){return _0x241e81&&!_[_0x4e00('0x45')](_0x241e81)&&_0x241e81[_0x4e00('0xa2')]>0x0;}function decremetOriginate(_0xa7959c){if(!_[_0x4e00('0x45')](_0xa7959c)&&_0xa7959c!==null){if(typeof _0xa7959c[_0x4e00('0xa3')]!==_0x4e00('0xa4')){if(_0xa7959c[_0x4e00('0xa3')]>0x0){_0xa7959c['originated']-=0x1;}else{logger[_0x4e00('0xa0')](_0x4e00('0xa5'));}}}else{logger[_0x4e00('0xa0')](_0x4e00('0xa6'));}}function checkContactLowerLimitOriginate(_0x79c7a2,_0x1b87c5,_0x4a96a6){if(_0x1b87c5>_0x4a96a6){for(var _0x52857b=0x0;_0x52857b<_0x1b87c5-_0x4a96a6;_0x52857b+=0x1){decremetOriginate(_0x79c7a2);}}}function loggerGetContactDialer(_0x5c84c7,_0x25a29a,_0x301ffd){return function(_0x278032){checkContactLowerLimitOriginate(_0x25a29a,_0x301ffd,0x0);logger[_0x4e00('0xa0')](_0x5c84c7,util[_0x4e00('0x9f')](_0x278032,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x475fa9){return function(_0x340118){if(isNotNull(_0x340118)&&isNotNull(_0x340118[0x0])){if(_0x340118[0x0][_0x4e00('0xa7')]>0x0){_0x475fa9[_0x4e00('0x46')]=_0x4e00('0xa8');logger[_0x4e00('0x85')](_0x4e00('0xa9')+_0x475fa9[_0x4e00('0x48')],_0x340118[0x0][_0x4e00('0xa7')],'contacts');}else{_0x475fa9['message']=_0x4e00('0xaa');logger[_0x4e00('0x85')]('[getContactDialer2][Empty]'+_0x475fa9[_0x4e00('0x48')]);}}};}function notSendMessagesQueue(_0x202813){if(_0x202813[_0x4e00('0xab')]){freeVariablesPredictive(_0x202813);if(_0x202813[_0x4e00('0xa3')]===0x0&&_0x202813['talking']===0x0&&_0x202813[_0x4e00('0x61')]===0x0&&(_0x202813[_0x4e00('0x5b')]||0x0)===0x0){_0x202813[_0x4e00('0xab')]=![];_0x202813[_0x4e00('0xac')]=0x0;_0x202813[_0x4e00('0x46')]=_0x4e00('0x4a');loggerSyncQueueSummary[_0x4e00('0xad')](_0x4e00('0xae'),_0x202813[_0x4e00('0x48')],_0x4e00('0xaf'));}else{_0x202813[_0x4e00('0x46')]=_0x4e00('0xb0');loggerSyncQueueSummary['debug'](_0x4e00('0xae'),_0x202813[_0x4e00('0x48')],'is\x20disactive');}emitVoiceQueueSummary(_0x202813);}}function notSendMessagesCampaign(_0x39e8c1){if(_0x39e8c1['sendMessageOneNotActive']){if(_0x39e8c1[_0x4e00('0xa3')]===0x0){_0x39e8c1['sendMessageOneNotActive']=![];_0x39e8c1[_0x4e00('0x46')]=_0x4e00('0x4a');loggerSyncQueueSummary[_0x4e00('0xad')](_0x4e00('0xb1'),_0x39e8c1[_0x4e00('0x48')],'is\x20not\x20active');}else{_0x39e8c1['message']=_0x4e00('0xb0');loggerSyncQueueSummary[_0x4e00('0xad')](_0x4e00('0xb1'),_0x39e8c1[_0x4e00('0x48')],_0x4e00('0xb2'));}emitCampaignSummary(_0x39e8c1);}}function createObjHistory(_0x3f4fa2,_0x3468ce,_0x7139f2,_0x59a273,_0x104351){_0x3f4fa2[_0x4e00('0x46')]=_0x7139f2;var _0x1ce26e=new Action(_0x3f4fa2,_0x3468ce);var _0x412be2=new History(_0x1ce26e);_0x412be2['state']=_0x59a273;_0x412be2[_0x4e00('0xb3')]=_0x104351;_0x412be2[_0x4e00('0xb4')]=_0x1ce26e[_0x4e00('0xb5')];return _0x412be2;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x5d5d72=this;setInterval(function(){_0x5d5d72[_0x4e00('0xb6')](_0x5d5d72[_0x4e00('0x27')],_0x4e00('0xb7'));_0x5d5d72[_0x4e00('0xb6')](_0x5d5d72[_0x4e00('0xb8')],_0x4e00('0xb9'));},0x32c8);};Dialer[_0x4e00('0x1b')][_0x4e00('0xb6')]=function(_0x2050a9,_0x5dbb62){var _0x15f97e=this;for(var _0x23bda9 in _0x2050a9){if(typeof _0x2050a9[_0x23bda9]!==_0x4e00('0xa4')){this[_0x4e00('0xba')]['enqueue'](function(){if(!_['isNil'](_0x2050a9[_0x23bda9])){return ami[_0x4e00('0xbb')]({'action':'status','channel':_0x2050a9[_0x23bda9]['channel']})[_0x4e00('0xbc')](function(_0x26ae52){if(_0x26ae52[_0x4e00('0x46')]===_0x4e00('0xbd')){setTimeout(function(){if(_0x2050a9[_0x23bda9]&&_0x2050a9[_0x23bda9][_0x4e00('0x56')]!==_0x4e00('0x82')){_0x15f97e[_0x4e00('0xbe')](_0x15f97e[_0x4e00('0x20')][_0x2050a9[_0x23bda9][_0x4e00('0xbf')]]);logger[_0x4e00('0xa0')]('[Dialer][checkChannel]',_0x5dbb62,_0x23bda9,_0x2050a9[_0x23bda9][_0x4e00('0xbf')]);delete _0x2050a9[_0x23bda9];}if(_0x2050a9[_0x23bda9]&&_0x2050a9[_0x23bda9][_0x4e00('0x56')]===_0x4e00('0x82')){_0x15f97e[_0x4e00('0xbe')](_0x15f97e[_0x4e00('0x21')][_0x2050a9[_0x23bda9][_0x4e00('0xbf')]]);logger[_0x4e00('0xa0')]('[Dialer][checkChannel][ivr]',_0x5dbb62,_0x23bda9,_0x2050a9[_0x23bda9]['queue']);delete _0x2050a9[_0x23bda9];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x712975){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopper[_0x4e00('0xc1')](_0x712975))[_0x4e00('0xbc')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xc2')]=function(_0x4873b1){return Promise['resolve']()[_0x4e00('0x43')](cmHopperBlack[_0x4e00('0xc2')](_0x4873b1))[_0x4e00('0xbc')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xc3')]=function(_0x25d08a,_0x41f75c,_0x2d426a){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x25d08a,_0x41f75c,_0x2d426a))['catch'](loggerCatch(_0x4e00('0xc4')));};Dialer[_0x4e00('0x1b')][_0x4e00('0xc5')]=function(_0xdaf1d4,_0x155e26,_0x4a3885){return Promise[_0x4e00('0xc0')]()['then'](cmHopperAdditionalPhone[_0x4e00('0xc5')](_0xdaf1d4,_0x155e26,_0x4a3885))['catch'](loggerCatch(_0x4e00('0xc6')));};Dialer[_0x4e00('0x1b')][_0x4e00('0xc7')]=function(_0x3c8f34){return Promise[_0x4e00('0xc0')]()['then'](cmHopperBlack[_0x4e00('0xc7')](_0x3c8f34))['catch'](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xc8')]=function(_0x212e9b){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopperHistory[_0x4e00('0xc9')](_0x212e9b))[_0x4e00('0xbc')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x4e00('0x1b')]['rescheduleContact']=function(_0x155fc2){return Promise[_0x4e00('0xc0')]()['then'](cmHopper[_0x4e00('0xca')](_0x155fc2))[_0x4e00('0xbc')](loggerCatch(_0x4e00('0xcb')));};Dialer[_0x4e00('0x1b')][_0x4e00('0xcc')]=function(_0x3a5710,_0x184670,_0x21eded){return Promise[_0x4e00('0xc0')]()['then'](cmHopper['unlockContact'](_0x3a5710,_0x184670,_0x21eded))[_0x4e00('0xbc')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xcd')]=function(_0x4080ec,_0x2b34dd,_0x5cca2c,_0x37841b,_0x569609){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopper['getContactDialer'](_0x4080ec,_0x2b34dd,_0x5cca2c,_0x37841b))[_0x4e00('0xbc')](function(_0x351663){_0x569609['temp']-=_0x5cca2c;_0x569609[_0x4e00('0xce')]=_0x569609[_0x4e00('0xce')]>0x0?_0x569609[_0x4e00('0xce')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x351663);});};Dialer[_0x4e00('0x1b')]['getContactDialerIvr']=function(_0x474020,_0x5c3785,_0x170af3,_0x1f29f2){return Promise['resolve']()['then'](cmHopper[_0x4e00('0xcf')](_0x474020,_0x5c3785,_0x170af3))['catch'](function(_0x494171){_0x1f29f2[_0x4e00('0xce')]-=_0x5c3785;_0x1f29f2[_0x4e00('0xce')]=_0x1f29f2[_0x4e00('0xce')]>0x0?_0x1f29f2['temp']:0x0;loggerCatch(_0x4e00('0xd0'))(_0x494171);});};Dialer[_0x4e00('0x1b')][_0x4e00('0xd1')]=function(_0x18d0e0){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](voiceQueueRt['getVoiceQueueRtPauses'](_0x18d0e0))[_0x4e00('0xbc')](loggerCatch(_0x4e00('0xd2')));};Dialer[_0x4e00('0x1b')][_0x4e00('0xd3')]=function(_0x2f0c61){return Promise['resolve']()['then'](cmHopper[_0x4e00('0xd3')](_0x2f0c61))[_0x4e00('0xbc')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xd4')]=function(_0x4f67de){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopperHistory[_0x4e00('0xd4')](_0x4f67de))[_0x4e00('0xbc')](loggerCatch(_0x4e00('0xd5')));};Dialer[_0x4e00('0x1b')][_0x4e00('0xbe')]=function(_0x36e411){if(!_[_0x4e00('0x45')](_0x36e411)&&_0x36e411!==null){if(typeof _0x36e411['originated']!==_0x4e00('0xa4')){if(_0x36e411['originated']>0x0){_0x36e411[_0x4e00('0xa3')]-=0x1;}else{logger[_0x4e00('0xa0')](_0x4e00('0xd6'));}}}else{logger[_0x4e00('0xa0')](_0x4e00('0xd7'));}};Dialer[_0x4e00('0x1b')][_0x4e00('0xd8')]=function(_0x2cd683,_0x1ee89f){var _0x264b1b=this;return function(_0x31f634){_0x264b1b[_0x4e00('0xbe')](_0x1ee89f);logger['error'](_0x2cd683,util['inspect'](_0x31f634,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x4e00('0xd9')]=function(_0x62215f,_0x5495db,_0x3a281f){var _0x4ba4c4={'state':0x19,'statedesc':_0x4e00('0xda')};this['updateOriginated'](_0x5495db);this[_0x4e00('0xdb')](_[_0x4e00('0x96')](_0x4ba4c4,_[_0x4e00('0xdc')](_0x3a281f,[_0x4e00('0xdd'),_0x4e00('0xde'),'UserId',_0x4e00('0xdf'),'CampaignId'])),_0x4e00('0xe0'),_0x4e00('0xe1'));logger[_0x4e00('0xa0')](_0x62215f);};Dialer['prototype']['isSuccess']=function(_0x532396){return _0x532396===_0x4e00('0xe2');};Dialer[_0x4e00('0x1b')][_0x4e00('0xe3')]=function(_0x2644fe){return!_['isUndefined'](_0x2644fe)&&_0x2644fe&&!_[_0x4e00('0x45')](_0x2644fe[_0x4e00('0x48')])&&!_[_0x4e00('0x45')](_0x2644fe['active'])&&_0x2644fe[_0x4e00('0x7f')]&&(this[_0x4e00('0x23')][util[_0x4e00('0x83')](_0x4e00('0xe4'),_0x2644fe[_0x4e00('0x48')])][_0x4e00('0xe5')]===_0x4e00('0xe6')||this[_0x4e00('0x23')][util[_0x4e00('0x83')](_0x4e00('0xe4'),_0x2644fe['name'])][_0x4e00('0xe5')]===_0x4e00('0xe7'));};Dialer[_0x4e00('0x1b')][_0x4e00('0xdb')]=function(_0x28e914,_0x4123fc,_0x53d44d){this[_0x4e00('0xd4')](_0x28e914)[_0x4e00('0xbc')](loggerCatch(_0x4123fc));this[_0x4e00('0xd3')](_0x28e914)['catch'](loggerCatch(_0x53d44d));};Dialer[_0x4e00('0x1b')][_0x4e00('0x3c')]=function(_0x55bb94){var _0x47ecb4=this;var _0x2f3004=this[_0x4e00('0x27')][_0x55bb94['uniqueid']];var _0x510f53;if(!_['isNil'](_0x55bb94)&&!_[_0x4e00('0xe8')](_0x55bb94[_0x4e00('0xe9')])&&!_[_0x4e00('0xe8')](_0x55bb94[_0x4e00('0xe9')][_0x4e00('0xea')])&&_0x55bb94[_0x4e00('0xeb')]===_0x4e00('0xec')&&_0x2f3004){if(_0x2f3004[_0x4e00('0x56')]!==_0x4e00('0x82')&&this[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0xed')]&&_0x55bb94[_0x4e00('0xee')]===_0x4e00('0xef')){delete this[_0x4e00('0x27')][_0x55bb94[_0x4e00('0xf0')]];this[_0x4e00('0xbe')](this['voiceQueues'][_0x2f3004['queue']]);this['voiceQueues'][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0x67')]+=0x1;this[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0x66')]+=0x1;_0x510f53=new Hangup(_0x2f3004,_0x55bb94);_0x510f53[_0x4e00('0xf1')]=0x12;_0x510f53['statedesc']=_0x4e00('0xf2');_0x510f53[_0x4e00('0xf3')]=_0x4e00('0xf4');ami[_0x4e00('0x55')](_0x4e00('0xf5'),ut[_0x4e00('0xf6')](_0x510f53,_0x4e00('0xf7')));this[_0x4e00('0xdb')](_0x510f53,_0x4e00('0xf8'),'[syncHangupInAMD]');}if(_0x2f3004[_0x4e00('0x56')]!==_0x4e00('0x82')&&this[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0xed')]&&_0x55bb94[_0x4e00('0xee')]===_0x4e00('0xf9')){return new Promise(function(_0x43772f,_0x1116f6){delete _0x47ecb4[_0x4e00('0x27')][_0x55bb94[_0x4e00('0xf0')]];_0x47ecb4[_0x4e00('0xbe')](_0x47ecb4[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]]);_0x47ecb4['voiceQueues'][_0x2f3004[_0x4e00('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x47ecb4[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0x66')]+=0x1;var _0x40a88f=_0x47ecb4[_0x4e00('0x20')][_0x2f3004[_0x4e00('0xbf')]];var _0x5b2e85=new Hangup(_0x2f3004,_0x55bb94);_0x5b2e85['state']=0x13;_0x5b2e85[_0x4e00('0xb3')]=_0x4e00('0xfa');_0x5b2e85[_0x4e00('0xf3')]=_0x4e00('0xf4');_0x5b2e85['countmachineretry']+=0x1;_0x5b2e85[_0x4e00('0xfb')]+=0x1;_0x5b2e85[_0x4e00('0xf7')]=!![];ami[_0x4e00('0x55')](_0x4e00('0xf5'),ut['buildObj'](_0x5b2e85,_0x4e00('0xf7')));_0x47ecb4[_0x4e00('0xd4')](_0x5b2e85)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0xfc')));if(_0x5b2e85[_0x4e00('0xfd')]+_0x5b2e85[_0x4e00('0xfe')]+_0x5b2e85['countnoanswerretry']+_0x5b2e85['countnosuchnumberretry']+_0x5b2e85[_0x4e00('0xff')]+_0x5b2e85[_0x4e00('0x100')]+_0x5b2e85['countmachineretry']+_0x5b2e85[_0x4e00('0x101')]>=_0x40a88f[_0x4e00('0x102')]){_0x47ecb4[_0x4e00('0x103')](_0x5b2e85,_0x43772f,_0x1116f6,_0x4e00('0x104'));}else{if(_0x5b2e85[_0x4e00('0x105')]>=_0x40a88f['dialMachineMaxRetry']){_0x47ecb4[_0x4e00('0x106')](_0x5b2e85,_0x43772f,_0x1116f6,_0x4e00('0x107'));}else{_0x47ecb4[_0x4e00('0xca')]({'active':![],'countmachineretry':_0x5b2e85['countmachineretry'],'scheduledat':moment()[_0x4e00('0x108')](_0x40a88f[_0x4e00('0x109')],_0x4e00('0x10a'))[_0x4e00('0x83')](_0x4e00('0x10b')),'ContactId':_0x5b2e85[_0x4e00('0xdd')],'ListId':_0x5b2e85['ListId'],'VoiceQueueId':_0x5b2e85[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b2e85[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x10d')));_0x43772f({'reschedule':0x1});}}});}if(_0x2f3004['type']===_0x4e00('0x82')&&this['campaigns'][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0xed')]&&_0x55bb94[_0x4e00('0xee')]===_0x4e00('0xef')){delete this['uniqueId'][_0x55bb94['uniqueid']];this[_0x4e00('0xbe')](this['campaigns'][_0x2f3004['queue']]);_0x510f53=new Hangup(_0x2f3004,_0x55bb94);_0x510f53['state']=0x12;_0x510f53[_0x4e00('0xb3')]=_0x4e00('0xf2');_0x510f53[_0x4e00('0xf3')]=_0x4e00('0xf4');ami['emit'](_0x4e00('0xf5'),ut['buildObj'](_0x510f53,_0x4e00('0xf7')));this[_0x4e00('0xdb')](_0x510f53,_0x4e00('0x10e'),_0x4e00('0x10f'));}if(_0x2f3004[_0x4e00('0x56')]===_0x4e00('0x82')&&this[_0x4e00('0x21')][_0x2f3004[_0x4e00('0xbf')]]['dialAMDActive']&&_0x55bb94[_0x4e00('0xee')]===_0x4e00('0xf9')){return new Promise(function(_0x5e73c1,_0xfafe06){delete _0x47ecb4[_0x4e00('0x27')][_0x55bb94[_0x4e00('0xf0')]];_0x47ecb4[_0x4e00('0xbe')](_0x47ecb4[_0x4e00('0x21')][_0x2f3004['queue']]);_0x47ecb4[_0x4e00('0x21')][_0x2f3004[_0x4e00('0xbf')]][_0x4e00('0x67')]+=0x1;_0x47ecb4[_0x4e00('0x21')][_0x2f3004['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x47a6f3=_0x47ecb4[_0x4e00('0x21')][_0x2f3004['queue']];var _0x5c9a4c=new Hangup(_0x2f3004,_0x55bb94);_0x5c9a4c['state']=0x13;_0x5c9a4c[_0x4e00('0xb3')]='Machine';_0x5c9a4c[_0x4e00('0xf3')]=_0x4e00('0xf4');_0x5c9a4c[_0x4e00('0x105')]+=0x1;_0x5c9a4c['countglobal']+=0x1;_0x5c9a4c[_0x4e00('0xf7')]=!![];ami[_0x4e00('0x55')](_0x4e00('0xf5'),ut[_0x4e00('0xf6')](_0x5c9a4c,'amd'));_0x47ecb4['createHistory'](_0x5c9a4c)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5c9a4c[_0x4e00('0xfd')]+_0x5c9a4c[_0x4e00('0xfe')]+_0x5c9a4c[_0x4e00('0x110')]+_0x5c9a4c[_0x4e00('0x111')]+_0x5c9a4c[_0x4e00('0xff')]+_0x5c9a4c[_0x4e00('0x100')]+_0x5c9a4c[_0x4e00('0x105')]+_0x5c9a4c[_0x4e00('0x101')]>=_0x47a6f3[_0x4e00('0x102')]){_0x47ecb4['stateGlobal'](_0x5c9a4c,_0x5e73c1,_0xfafe06,_0x4e00('0x104'));}else{if(_0x5c9a4c[_0x4e00('0x105')]>=_0x47a6f3[_0x4e00('0x112')]){_0x47ecb4['createStateFinal'](_0x5c9a4c,_0x5e73c1,_0xfafe06,_0x4e00('0x107'));}else{_0x47ecb4['rescheduleContact']({'active':![],'countmachineretry':_0x5c9a4c['countmachineretry'],'scheduledat':moment()[_0x4e00('0x108')](_0x47a6f3[_0x4e00('0x109')],_0x4e00('0x10a'))[_0x4e00('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5c9a4c[_0x4e00('0xdd')],'ListId':_0x5c9a4c[_0x4e00('0xde')],'VoiceQueueId':_0x5c9a4c[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5c9a4c[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch('[rescheduleContact][Machine]'));_0x5e73c1({'reschedule':0x1});}}});}}};Dialer[_0x4e00('0x1b')]['syncHangup']=function(_0x81c1a4){var _0x218220=this['uniqueId'][_0x81c1a4[_0x4e00('0xf0')]];var _0x2279c2;if(_0x218220&&_0x218220[_0x4e00('0x56')]===_0x4e00('0x82')){delete this['uniqueId'][_0x81c1a4['uniqueid']];this['updateOriginated'](this['campaigns'][_0x218220[_0x4e00('0xbf')]]);this[_0x4e00('0x21')][_0x218220[_0x4e00('0xbf')]][_0x4e00('0x113')]+=0x1;_0x2279c2=new Hangup(_0x218220,_0x81c1a4);this[_0x4e00('0xd4')](_0x2279c2)[_0x4e00('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x4e00('0xd3')](_0x2279c2)[_0x4e00('0xbc')](loggerCatch('[syncHangupIvr]'));}if(_0x218220&&_0x218220[_0x4e00('0x56')]!=='ivr'&&isNotNull(this[_0x4e00('0x20')][_0x218220['queue']]['dialQueueProject'])){delete this[_0x4e00('0x27')][_0x81c1a4['uniqueid']];this[_0x4e00('0xbe')](this[_0x4e00('0x20')][_0x218220[_0x4e00('0xbf')]]);this[_0x4e00('0x20')][_0x218220[_0x4e00('0xbf')]]['outboundAnswerCallsDay']+=0x1;this[_0x4e00('0x20')][_0x218220[_0x4e00('0xbf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x2279c2=new Hangup(_0x218220,_0x81c1a4);_0x2279c2[_0x4e00('0xf1')]=0x10;_0x2279c2['statedesc']='AnswerAGI';_0x2279c2[_0x4e00('0xf3')]=_0x4e00('0x114');this[_0x4e00('0xd4')](_0x2279c2)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x115')));this[_0x4e00('0xd3')](_0x2279c2)['catch'](loggerCatch(_0x4e00('0x116')));}if(_0x218220&&_0x218220['type']!==_0x4e00('0x82')&&!isNotNull(this['voiceQueues'][_0x218220[_0x4e00('0xbf')]]['dialQueueProject'])){delete this[_0x4e00('0x27')][_0x81c1a4[_0x4e00('0xf0')]];this[_0x4e00('0xbe')](this[_0x4e00('0x20')][_0x218220[_0x4e00('0xbf')]]);this[_0x4e00('0x20')][_0x218220[_0x4e00('0xbf')]][_0x4e00('0x71')]+=0x1;_0x2279c2=new Hangup(_0x218220,_0x81c1a4);_0x2279c2['state']=0xc;_0x2279c2[_0x4e00('0xb3')]=_0x81c1a4[_0x4e00('0x117')];_0x2279c2[_0x4e00('0xf3')]=_0x4e00('0x118');this[_0x4e00('0xd4')](_0x2279c2)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x115')));this[_0x4e00('0xd3')](_0x2279c2)['catch'](loggerCatch(_0x4e00('0x116')));}};Dialer[_0x4e00('0x1b')]['syncAgentComplete']=function(_0x3af2a6){var _0x4551d6=this['uniqueId'][_0x3af2a6[_0x4e00('0xf0')]];if(this['voiceQueues'][_0x3af2a6[_0x4e00('0xbf')]]){if(_0x4551d6&&_0x4551d6[_0x4e00('0x56')]!=='ivr'){delete this['uniqueId'][_0x3af2a6[_0x4e00('0xf0')]];this[_0x4e00('0x20')][_0x3af2a6[_0x4e00('0xbf')]]['outboundAnswerCallsDay']+=0x1;var _0x42e376=new AgentComplete(_0x4551d6,_0x3af2a6);if(_0x3af2a6['reason']===_0x4e00('0x119')){_0x42e376[_0x4e00('0x11a')]=this[_0x4e00('0x20')][_0x3af2a6[_0x4e00('0xbf')]][_0x4e00('0x11b')]&&this[_0x4e00('0x20')][_0x3af2a6[_0x4e00('0xbf')]][_0x4e00('0x11c')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x4e00('0xd4')](_0x42e376)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x11d')));this[_0x4e00('0xd3')](_0x42e376)[_0x4e00('0xbc')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x4e00('0x1b')][_0x4e00('0x2d')]=function(_0x3541e9){if(this[_0x4e00('0x20')][_0x3541e9[_0x4e00('0xbf')]]){if(this[_0x4e00('0x27')][_0x3541e9[_0x4e00('0xf0')]]&&this[_0x4e00('0x27')][_0x3541e9[_0x4e00('0xf0')]][_0x4e00('0x56')]!==_0x4e00('0x82')){this[_0x4e00('0xbe')](this[_0x4e00('0x20')][_0x3541e9[_0x4e00('0xbf')]]);this[_0x4e00('0x27')][_0x3541e9[_0x4e00('0xf0')]][_0x4e00('0x11e')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x35bc95,_0x4cfa49){this['createHistory'](_0x35bc95)[_0x4e00('0xbc')](loggerCatch('[syncAgentComplete][createHistory]'));if(_0x4cfa49==0x0){this['moveContactManagedDialer'](_0x35bc95)[_0x4e00('0xbc')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x4e00('0x1b')][_0x4e00('0x30')]=function(_0x4fd05a){var _0x2b9e3c=this['uniqueId'][_0x4fd05a[_0x4e00('0xf0')]];var _0x53f56b=this;var _0x18e993=![];var _0x39e036;var _0x2589ab;if(this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]]){if(_0x2b9e3c&&_0x2b9e3c[_0x4e00('0x56')]!=='ivr'){delete this['uniqueId'][_0x4fd05a['uniqueid']];this[_0x4e00('0xbe')](this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]]);_0x2b9e3c['droptime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x53d8a9=new QueueCallerAbandon(_0x2b9e3c,_0x4fd05a);if(getSeconds(_0x2b9e3c[_0x4e00('0x11f')],_0x2b9e3c['responsetime'])>=_0x2b9e3c[_0x4e00('0x120')]){this[_0x4e00('0x20')][_0x4fd05a['queue']][_0x4e00('0x8a')]+=0x1;this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x6b')]+=0x1;this[_0x4e00('0x20')][_0x4fd05a['queue']][_0x4e00('0x76')]+=0x1;_0x53d8a9[_0x4e00('0xf1')]=0xa;_0x53d8a9[_0x4e00('0xb3')]=_0x4e00('0x121');_0x53d8a9[_0x4e00('0x122')]=_0x4e00('0x123');_0x53d8a9['agiafterat']=this[_0x4e00('0x20')][_0x4fd05a['queue']][_0x4e00('0x11b')]?moment()[_0x4e00('0x83')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x53d8a9[_0x4e00('0xff')]+=0x1;_0x53d8a9[_0x4e00('0xfb')]+=0x1;_0x39e036=this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]]['dialDropRetryFrequency'];_0x2589ab=this['voiceQueues'][_0x4fd05a['queue']][_0x4e00('0x124')];_0x53f56b['verifyAdditionalPhones'](_0x53d8a9,_0x53d8a9['state'],_0x2b9e3c[_0x4e00('0x125')])[_0x4e00('0x43')](function(_0x5ae303){_0x18e993=_0x5ae303[_0x4e00('0x126')]==0x1;if(_0x53d8a9[_0x4e00('0xff')]>=_0x53f56b[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x127')]){_0x53f56b[_0x4e00('0x128')](_0x53d8a9,_0x5ae303[_0x4e00('0x126')]);}else{_0x53f56b[_0x4e00('0xca')]({'active':![],'countdropretry':_0x53d8a9[_0x4e00('0xff')],'scheduledat':moment()[_0x4e00('0x108')](_0x53f56b[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x129')],'minutes')['format'](_0x4e00('0x10b')),'ContactId':_0x2b9e3c[_0x4e00('0xdd')],'ListId':_0x2b9e3c[_0x4e00('0xde')],'VoiceQueueId':_0x2b9e3c[_0x4e00('0xdf')]||undefined,'CampaignId':_0x2b9e3c[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x12a')));var _0x3bfd29=new History(_0x53d8a9);_0x3bfd29['state']=0xa;_0x3bfd29['statedesc']=_0x4e00('0x121');_0x3bfd29[_0x4e00('0xb5')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));_0x3bfd29[_0x4e00('0xb4')]=_0x3bfd29[_0x4e00('0xb5')];_0x3bfd29[_0x4e00('0x12b')]=_0x53d8a9[_0x4e00('0x12b')];_0x3bfd29[_0x4e00('0x12c')]=_0x53d8a9['calleridnum'];_0x53f56b[_0x4e00('0xd4')](_0x3bfd29)[_0x4e00('0xbc')](loggerCatch('[syncAgentComplete][createHistory][10]'));}})[_0x4e00('0x43')](function(){if(_0x18e993)_0x53f56b[_0x4e00('0xc5')](_0x53d8a9,_0x39e036,_0x2589ab)['then'](function(){return 0x1;});});}else{this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x75')]+=0x1;this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x12d')]+=0x1;_0x53d8a9['state']=0xb;_0x53d8a9[_0x4e00('0xb3')]=_0x4e00('0x12e');_0x53d8a9['dropreason']=_0x4e00('0x12f');_0x53d8a9['countabandonedretry']+=0x1;_0x53d8a9[_0x4e00('0xfb')]+=0x1;_0x39e036=this[_0x4e00('0x20')][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x130')];_0x2589ab=this['voiceQueues'][_0x4fd05a[_0x4e00('0xbf')]][_0x4e00('0x124')];_0x53f56b[_0x4e00('0xc3')](_0x53d8a9,_0x53d8a9[_0x4e00('0xf1')],_0x2b9e3c['voiceQueue'])['then'](function(_0x255238){if(_0x53d8a9[_0x4e00('0x100')]>=_0x53f56b['voiceQueues'][_0x4fd05a['queue']][_0x4e00('0x131')]){_0x53f56b['queueCallerAbandonCreateState'](_0x53d8a9,_0x255238[_0x4e00('0x126')]);}else{_0x53f56b[_0x4e00('0xca')]({'active':![],'countabandonedretry':_0x53d8a9['countabandonedretry'],'scheduledat':moment()[_0x4e00('0x108')](_0x53f56b[_0x4e00('0x20')][_0x4fd05a['queue']][_0x4e00('0x130')],_0x4e00('0x10a'))[_0x4e00('0x83')](_0x4e00('0x10b')),'ContactId':_0x2b9e3c['ContactId'],'ListId':_0x2b9e3c['ListId'],'VoiceQueueId':_0x2b9e3c[_0x4e00('0xdf')]||undefined,'CampaignId':_0x2b9e3c[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x132')));var _0x887085=new History(_0x53d8a9);_0x887085[_0x4e00('0xf1')]=0xb;_0x887085[_0x4e00('0xb3')]='Abandoned';_0x887085[_0x4e00('0xb5')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));_0x887085['endtime']=_0x887085[_0x4e00('0xb5')];_0x887085[_0x4e00('0x12b')]=_0x53d8a9[_0x4e00('0x12b')];_0x887085[_0x4e00('0x12c')]=_0x53d8a9[_0x4e00('0x12c')];_0x53f56b[_0x4e00('0xd4')](_0x887085)['catch'](loggerCatch(_0x4e00('0x133')));}})[_0x4e00('0x43')](function(){if(_0x18e993)_0x53f56b['swapAdditionalPhones'](_0x53d8a9,_0x39e036,_0x2589ab)['then'](function(){return 0x1;});});}}}};Dialer[_0x4e00('0x1b')][_0x4e00('0x3a')]=function(_0x1df243){if(this['actions'][_0x1df243[_0x4e00('0xf0')]]){this['actions'][_0x1df243['uniqueid']]['channel']=_0x1df243[_0x4e00('0x134')];}if(this[_0x4e00('0x27')][_0x1df243[_0x4e00('0xf0')]]){this['uniqueId'][_0x1df243['uniqueid']]['channel']=_0x1df243[_0x4e00('0x134')];}};Dialer[_0x4e00('0x1b')]['syncQueueMember']=function(_0x2ed038){if(strategy[this[_0x4e00('0x20')][this[_0x4e00('0xb8')][_0x2ed038['actionid']][_0x4e00('0xbf')]][_0x4e00('0x58')]]==='roundrobin'){if(this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]]&&_[_0x4e00('0xe8')](this['actions'][_0x2ed038['actionid']][_0x4e00('0x136')])&&_0x2ed038['status']==='1'&&_0x2ed038[_0x4e00('0x137')]==='0'){if(this['agents'][_0x2ed038[_0x4e00('0x138')]]){if(!this[_0x4e00('0x22')][_0x2ed038[_0x4e00('0x138')]][_0x4e00('0x136')]){this[_0x4e00('0x22')][_0x2ed038[_0x4e00('0x138')]][_0x4e00('0x136')]=!![];this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]][_0x4e00('0x136')]=!![];this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]][_0x4e00('0x138')]=_0x2ed038['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x58')]]||'rrmemory')==='rrmemory'){if(this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]]){if(this[_0x4e00('0x22')][_0x2ed038[_0x4e00('0x138')]]){this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]][_0x4e00('0x138')]=_0x2ed038[_0x4e00('0x138')];if(_['isNil'](this[_0x4e00('0x2b')][this['actions'][_0x2ed038[_0x4e00('0x135')]]['queue']])){this[_0x4e00('0x2b')][this[_0x4e00('0xb8')][_0x2ed038['actionid']][_0x4e00('0xbf')]]=[];}this[_0x4e00('0x2b')][this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x139')](_[_0x4e00('0x96')](_[_0x4e00('0xdc')](this[_0x4e00('0xb8')][_0x2ed038[_0x4e00('0x135')]],[_0x4e00('0x13a'),_0x4e00('0x138')]),{'status':_0x2ed038['status'],'paused':_0x2ed038['paused']}));}}}};function unlockQueueStatus(_0x5b2e88,_0x3c71c3){setTimeout(function(){if(_[_0x4e00('0x45')](_0x5b2e88['queueStatusComplete'])){loggerBooked[_0x4e00('0xa0')](_0x4e00('0x13b'),_0x3c71c3);}_0x5b2e88[_0x4e00('0x13c')]=!![];loggerBooked[_0x4e00('0x85')](_0x4e00('0x13d'),_0x3c71c3,JSON[_0x4e00('0x52')](_[_0x4e00('0xdc')](_0x5b2e88,[_0x4e00('0x48'),'queueStatusComplete'])));},0x1f3);}Dialer[_0x4e00('0x1b')][_0x4e00('0x40')]=function(_0x1beb83){var _0x41374e=this;var _0x315769=_0x41374e[_0x4e00('0x20')][_0x41374e['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]];if(strategy[this['voiceQueues'][this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x58')]]===_0x4e00('0x1a')){if(this['actions'][_0x1beb83[_0x4e00('0x135')]]&&this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x138')]){this['preview'][_0x4e00('0x13e')](this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x13a')],this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]['stateinterface'])[_0x4e00('0xbc')](function(_0x25bcd3){logger[_0x4e00('0xa0')](_0x4e00('0x13f'),util[_0x4e00('0x9f')](_0x25bcd3,{'showHidden':![],'depth':null}));})[_0x4e00('0x1e')](function(){_0x41374e['updateOriginated'](_0x41374e[_0x4e00('0x20')][_0x41374e[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xbf')]]);_0x41374e[_0x4e00('0x22')][_0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x138')]]['locked']=![];delete _0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769);});}else{this[_0x4e00('0xbe')](this[_0x4e00('0x20')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]);this[_0x4e00('0xca')]({'active':![],'ContactId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]['ContactId'],'ListId':this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xde')],'VoiceQueueId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xdf')]||undefined,'CampaignId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x10c')]||undefined})['catch'](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769);}}else if((strategy[this[_0x4e00('0x20')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x58')]]||_0x4e00('0x19'))==='rrmemory'){var _0x5b5080;if(this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]&&!_[_0x4e00('0x84')](this[_0x4e00('0x2b')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]])){if(this['queueBookedRR'][_0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]){this[_0x4e00('0x140')][_0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]=this[_0x4e00('0x140')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]?this[_0x4e00('0x140')][this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xbf')]]:this[_0x4e00('0x2b')][this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xbf')]]?this['queueBooked'][this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x141')]||0x0:0x0;}this[_0x4e00('0x2b')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]][_0x4e00('0x141')]=this[_0x4e00('0x140')][this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]];for(var _0x51be13=0x0;_0x51be13<this['queueBooked'][this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xbf')]][_0x4e00('0xa2')];_0x51be13+=0x1){_0x5b5080=rr(this[_0x4e00('0x2b')][this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]);this[_0x4e00('0x140')][_0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]=this[_0x4e00('0x2b')][this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]['_rr'];if(_0x5b5080[_0x4e00('0xe5')]==='1'&&_0x5b5080[_0x4e00('0x137')]==='0'){break;}}if(!_[_0x4e00('0xe8')](_0x5b5080)){this[_0x4e00('0x22')][_0x5b5080[_0x4e00('0x138')]][_0x4e00('0x142')]=_[_0x4e00('0x45')](this[_0x4e00('0x22')][_0x5b5080['stateinterface']][_0x4e00('0x142')])?!![]:this[_0x4e00('0x22')][_0x5b5080['stateinterface']][_0x4e00('0x142')];}loggerBooked[_0x4e00('0x85')](_0x4e00('0x143'),_0x1beb83[_0x4e00('0x135')],_0x4e00('0x144'),JSON[_0x4e00('0x52')](_[_0x4e00('0xdc')](this[_0x4e00('0x22')][_0x5b5080[_0x4e00('0x138')]],[_0x4e00('0x48'),_0x4e00('0x142')])),_0x4e00('0x145'),JSON[_0x4e00('0x52')](_0x5b5080['idHopper']));if(!_[_0x4e00('0xe8')](_0x5b5080)&&_0x5b5080[_0x4e00('0xe5')]==='1'&&_0x5b5080['paused']==='0'&&this[_0x4e00('0x22')][_0x5b5080['stateinterface']][_0x4e00('0x142')]){this[_0x4e00('0x22')][_0x5b5080[_0x4e00('0x138')]][_0x4e00('0x142')]=![];this[_0x4e00('0x2b')][_0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]['queue']]=[];this[_0x4e00('0x1f')][_0x4e00('0x13e')](_0x5b5080[_0x4e00('0x13a')],_0x5b5080[_0x4e00('0x138')])[_0x4e00('0xbc')](function(_0x2fbf93){logger[_0x4e00('0xa0')](_0x4e00('0x13f'),util[_0x4e00('0x9f')](_0x2fbf93,{'showHidden':![],'depth':null}));})[_0x4e00('0x1e')](function(){_0x41374e[_0x4e00('0xbe')](_0x41374e['voiceQueues'][_0x41374e['actions'][_0x1beb83['actionid']][_0x4e00('0xbf')]]);setTimeout(function(){_0x41374e[_0x4e00('0x22')][_0x5b5080['stateinterface']]['unlockRR']=!![];loggerBooked[_0x4e00('0x85')](_0x4e00('0x146'),_0x1beb83[_0x4e00('0x135')],_0x4e00('0x144'),JSON['stringify'](_[_0x4e00('0xdc')](_0x41374e[_0x4e00('0x22')][_0x5b5080[_0x4e00('0x138')]],[_0x4e00('0x48'),_0x4e00('0x142')])),_0x4e00('0x145'),JSON[_0x4e00('0x52')](_0x5b5080['idHopper']));},0xc7);delete _0x41374e[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769,_0x1beb83[_0x4e00('0x135')]);});}else{loggerBooked[_0x4e00('0x85')](_0x4e00('0x147'));this[_0x4e00('0xbe')](this[_0x4e00('0x20')][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1beb83[_0x4e00('0x135')]]['ContactId'],'ListId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]]['ListId'],'VoiceQueueId':this['actions'][_0x1beb83['actionid']][_0x4e00('0xdf')]||undefined,'CampaignId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x148')));delete this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769);}}else{loggerBooked[_0x4e00('0x85')](_0x4e00('0x149'));this['updateOriginated'](this[_0x4e00('0x20')][this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xbf')]]);this[_0x4e00('0xca')]({'active':![],'ContactId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xdd')],'ListId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xde')],'VoiceQueueId':this[_0x4e00('0xb8')][_0x1beb83['actionid']][_0x4e00('0xdf')]||undefined,'CampaignId':this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x10c')]||undefined})['catch'](loggerCatch(_0x4e00('0x14a')));delete this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769);}}else{loggerBooked[_0x4e00('0x85')](_0x4e00('0x14b'));this[_0x4e00('0xbe')](this['voiceQueues'][this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xbf')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xdd')],'ListId':this['actions'][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xde')],'VoiceQueueId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0xdf')]||undefined,'CampaignId':this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]][_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x14c')));delete this[_0x4e00('0xb8')][_0x1beb83[_0x4e00('0x135')]];unlockQueueStatus(_0x315769);}};Dialer[_0x4e00('0x1b')][_0x4e00('0x41')]=function(){var _0x3eb4bc=this;return Promise['resolve']()['then'](cmHopper['resetActiveCalls']({'active':!![]}))['then'](function(){setInterval(function(){_0x3eb4bc[_0x4e00('0x14d')]();},0x3e8);});};Dialer[_0x4e00('0x1b')][_0x4e00('0x14e')]=function(_0x27ce75){var _0x113945=this;return function(){if(!_0x113945[_0x4e00('0xe3')](_0x27ce75[_0x4e00('0x7e')])){if(!_0x113945[_0x4e00('0xe3')](_0x27ce75[_0x4e00('0x14f')])){_0x27ce75['message']=_0x4e00('0x150');throw _0x27ce75[_0x4e00('0x48')]+_0x4e00('0x151');}}};};Dialer[_0x4e00('0x1b')][_0x4e00('0x152')]=function(_0x316a3a,_0x3f0ffe,_0x19bb3e,_0x33b0a9){var _0x45ed21=this;return function(){var _0x509b77=!![];return _0x45ed21[_0x4e00('0x153')](_0x316a3a,_0x3f0ffe,_0x19bb3e,_0x33b0a9,_0x509b77);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x1a0cbb,_0x1d57bf,_0x995eed,_0x1c48d8){var _0x8458d5=this;return function(){var _0x4de56d=![];return _0x8458d5[_0x4e00('0x153')](_0x1a0cbb[_0x4e00('0x4f')],_0x1d57bf,_0x995eed,_0x1c48d8,_0x4de56d);};};Dialer[_0x4e00('0x1b')]['ifTime']=function(_0x1224c9,_0x5869a9,_0xf83f5,_0x2d25df,_0x17e44f){var _0x3069d4=[];return new Promise(function(_0x58a707,_0x240395){if(!isNotNull(_0x1224c9)){_0x2d25df['message']=_0x4e00('0x4d');return _0x240395(msgResponse(_0x4e00('0x153'),_0x4e00('0x154'),_0xf83f5+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x4e00('0x84')](_0x1224c9)){_0x2d25df[_0x4e00('0x46')]='INTERVAL_IS_EMPTY';return _0x240395(msgResponse(_0x4e00('0x153'),'Failure',_0xf83f5+_0x4e00('0x155')));}if(_0x5869a9&&_[_0x4e00('0x45')](config[_0x4e00('0x156')][_0x5869a9])){_0x2d25df[_0x4e00('0x46')]=_0x4e00('0x157');return _0x240395(msgResponse('ifTime',_0x4e00('0x154'),_0xf83f5+_0x4e00('0x158')+_0x5869a9));}if(_[_0x4e00('0x159')](_0x1224c9)){for(var _0x586884=0x0;_0x586884<_0x1224c9['length'];_0x586884+=0x1){_0x3069d4[_0x4e00('0x139')](ami[_0x4e00('0xbb')]({'action':_0x4e00('0x15a'),'command':util[_0x4e00('0x83')](_0x4e00('0x15b'),_0x1224c9[_0x586884][_0x4e00('0x15c')],!_['isUndefined'](config[_0x4e00('0x156')][_0x5869a9])?_0x5869a9:'')})[_0x4e00('0x43')](function(_0x26fa34){return _0x26fa34[_0x4e00('0x15d')][_0x4e00('0x15e')](_0x4e00('0x15f'))>=0x0;})['catch'](myreject(_0x240395)));}}else{_0x3069d4['push'](ami[_0x4e00('0xbb')]({'action':_0x4e00('0x15a'),'command':util['format']('iftime\x20%s,%s',_0x1224c9,!_[_0x4e00('0x45')](config[_0x4e00('0x156')][_0x5869a9])?_0x5869a9:'')})[_0x4e00('0x43')](function(_0x2a86ca){return _0x2a86ca[_0x4e00('0x15d')][_0x4e00('0x15e')]('true')>=0x0;})[_0x4e00('0xbc')](myreject(_0x240395)));}Promise[_0x4e00('0x160')](_0x3069d4)[_0x4e00('0x43')](function(_0xda6ab0){var _0x568622=_[_0x4e00('0x161')](_0xda6ab0);if(_0x568622){return _0x58a707(_0x568622);}else{_0x2d25df['message']=_0x17e44f?_0x4e00('0x162'):_0x4e00('0x163');return _0x240395(msgResponse(_0x4e00('0x164'),'Failure',_0x4e00('0x165')+_0x17e44f+'\x20'+_0xf83f5+_0x4e00('0x166')+util[_0x4e00('0x9f')](_0x1224c9,{'showHidden':![],'depth':null})+_0x4e00('0x167')+_0x5869a9));}})['catch'](function(_0x577f64){return _0x240395(msgResponse(_0x4e00('0x153'),_0x4e00('0x154'),JSON[_0x4e00('0x52')](_0x577f64)));});});};Dialer[_0x4e00('0x1b')][_0x4e00('0x168')]=function(_0x5e286f){var _0x3d745f=this;return function(){switch(_0x5e286f[_0x4e00('0x63')]){case _0x4e00('0x169'):freeVariablesPredictive(_0x5e286f);_0x3d745f[_0x4e00('0x16a')](_0x5e286f,0x1);break;case _0x4e00('0x16b'):freeVariablesPredictive(_0x5e286f);_0x3d745f[_0x4e00('0x16a')](_0x5e286f,_0x5e286f[_0x4e00('0x16c')]);break;case _0x4e00('0x16d'):_0x3d745f['predictive'](_0x5e286f);break;case _0x4e00('0x7'):freeVariablesPredictive(_0x5e286f);_0x3d745f['handlePower'](_0x5e286f,0x1);break;default:freeVariablesPredictive(_0x5e286f);logger['error'](_0x4e00('0x16e'),_0x5e286f[_0x4e00('0x48')],_0x4e00('0x16f'));}};};Dialer[_0x4e00('0x1b')][_0x4e00('0x170')]=function(_0x1c067f){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopper[_0x4e00('0x171')](_0x1c067f['id'],previewRecallmeReminderInterval))[_0x4e00('0x43')](function(_0x8eebf0){for(var _0x39a660=0x0;_0x39a660<_0x8eebf0[_0x4e00('0xa2')];_0x39a660++){var _0x2f1ea4=_0x8eebf0[_0x39a660]['Agent'][_0x4e00('0x48')];if(_0x2f1ea4)io['to'](util[_0x4e00('0x83')](_0x4e00('0x172'),_0x2f1ea4))[_0x4e00('0x55')]('user:dialPreviewRecallReminder',{'hopper':_0x8eebf0[_0x39a660]});}})['catch'](function(){});};Dialer[_0x4e00('0x1b')][_0x4e00('0x173')]=function(_0x5a104c){var _0xaddf80=this;return function(){_0xaddf80[_0x4e00('0x174')](_0x5a104c);};};Dialer[_0x4e00('0x1b')]['syncQueueSummary']=function(_0x3f17f5){var _0x415455=this;if(isNotPreview(_0x3f17f5[_0x4e00('0x63')])){if(isVoiceQueueOutbound(_0x3f17f5[_0x4e00('0x56')])&&isActive(_0x3f17f5[_0x4e00('0x62')])){_0x3f17f5[_0x4e00('0xab')]=!![];Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](checkIsLoggedIn(_0x3f17f5,_0x3f17f5['loggedIn']))[_0x4e00('0x43')](checkIsActive(_0x3f17f5,_0x3f17f5[_0x4e00('0x62')]))[_0x4e00('0x43')](checkInterval(_0x3f17f5))[_0x4e00('0x43')](_0x415455[_0x4e00('0x14e')](_0x3f17f5))[_0x4e00('0x43')](_0x415455['checkIfTime'](_0x3f17f5['dialGlobalInterval'],_0x3f17f5[_0x4e00('0x175')],_0x3f17f5[_0x4e00('0x48')],_0x3f17f5))[_0x4e00('0x43')](_0x415455['checkIfTimeIntervals'](_0x3f17f5[_0x4e00('0x4c')],_0x3f17f5[_0x4e00('0x175')],_0x3f17f5[_0x4e00('0x48')],_0x3f17f5))[_0x4e00('0x43')](_0x415455[_0x4e00('0x168')](_0x3f17f5))['catch'](loggerCatchQueueSummary(_0x4e00('0x176'),_0x3f17f5));}else{notSendMessagesQueue(_0x3f17f5);}}else{freeVariablesPredictive(_0x3f17f5);}};Dialer[_0x4e00('0x1b')][_0x4e00('0x36')]=_[_0x4e00('0x177')](function(){var _0x4001d3=_[_0x4e00('0x178')](this[_0x4e00('0x20')],function(_0x1f38c3){return _0x1f38c3['dialPreviewRecallmeReminder'];});var _0xa00324=_[_0x4e00('0x178')](this[_0x4e00('0x22')],function(_0x534cf2){return _0x534cf2[_0x4e00('0x179')]&&_0x534cf2[_0x4e00('0xe5')]==='reachable';});if(_0x4001d3[_0x4e00('0xa2')]>0x0&&_0xa00324[_0x4e00('0xa2')]>0x0){return Promise[_0x4e00('0xc0')]()[_0x4e00('0x43')](cmHopper[_0x4e00('0x171')](_[_0x4e00('0x17a')](_0x4001d3,'id'),previewRecallmeReminderInterval,_[_0x4e00('0x17a')](_0xa00324,'id')))[_0x4e00('0x43')](function(_0x113fc2){for(var _0x302e1d=0x0;_0x302e1d<_0x113fc2[_0x4e00('0xa2')];_0x302e1d++){var _0x235da8=_0x113fc2[_0x302e1d][_0x4e00('0x17b')][_0x4e00('0x48')];if(_0x235da8)io['to'](util[_0x4e00('0x83')](_0x4e00('0x172'),_0x235da8))['emit'](_0x4e00('0x17c'),{'hopper':_0x113fc2[_0x302e1d]});}})[_0x4e00('0xbc')](function(_0x4d5baf){logger[_0x4e00('0xa0')](_0x4e00('0x170'),_0x4d5baf);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x4e00('0x14d')]=function(){var _0x461117=this;var _0x56db50;for(var _0x10ecae in this['campaigns']){if(typeof this['campaigns'][_0x10ecae]!==_0x4e00('0xa4')){_0x56db50=this[_0x4e00('0x21')][_0x10ecae];if(isCampaignIvr(_0x56db50['type'])&&isActive(_0x56db50[_0x4e00('0x7f')])){_0x56db50[_0x4e00('0xab')]=!![];Promise[_0x4e00('0xc0')]()['then'](checkIsActive(_0x56db50,_0x56db50[_0x4e00('0x7f')]))['then'](checkInterval(_0x56db50))['then'](_0x461117[_0x4e00('0x14e')](_0x56db50))[_0x4e00('0x43')](_0x461117['checkIfTime'](_0x56db50[_0x4e00('0x17d')],_0x56db50[_0x4e00('0x175')],_0x56db50[_0x4e00('0x48')],_0x56db50))[_0x4e00('0x43')](_0x461117[_0x4e00('0x17e')](_0x56db50[_0x4e00('0x4c')],_0x56db50[_0x4e00('0x175')],_0x56db50[_0x4e00('0x48')],_0x56db50))[_0x4e00('0x43')](_0x461117[_0x4e00('0x173')](_0x56db50))[_0x4e00('0xbc')](loggerCatchQueueSummary(_0x4e00('0x17f'),_0x56db50));}else{notSendMessagesCampaign(_0x56db50);}}}};function getCallerIdRandom(_0x12f87f,_0x43d4bb){var _0x353069;var _0x27b9f4;var _0xa688d7;if(_0x43d4bb<=0x0){_0x43d4bb=0x1;}_0x353069=new RegExp('\x5cw{0,'+_0x43d4bb+'}$');_0x27b9f4=Math[_0x4e00('0x180')](0xa,_0x43d4bb-0x1);_0xa688d7=Math[_0x4e00('0x180')](0xa,_0x43d4bb)-0x1;return util[_0x4e00('0x83')]('%s',_['replace'](_0x12f87f,_0x353069,_['random'](_0x27b9f4,_0xa688d7)));}function extractCalleridName(_0x451e88){var _0x41ff9e=_0x451e88[_0x4e00('0x181')](/"(.*?)"/);return _0x41ff9e?_0x41ff9e[0x1]:_0x451e88;}Dialer[_0x4e00('0x1b')][_0x4e00('0x182')]=function(_0x80c28b,_0x125b96){var _0x1af5f8=this;var _0x185888=uuid['v4']();this[_0x4e00('0xb8')][_0x185888]=new Action(_0x80c28b,_0x125b96,_0x185888);return new Promise(function(_0x4e9607,_0x4b6a00){if(_['isUndefined'](_0x80c28b)&&typeof _0x80c28b!==_0x4e00('0x183')){return _0x4b6a00(msgResponse(_0x4e00('0x184'),'Failure',_0x4e00('0x185')));}if(_[_0x4e00('0x45')](_0x125b96[_0x4e00('0x186')])||_0x125b96[_0x4e00('0x186')]===null){return _0x4b6a00(msgResponse(_0x4e00('0x184'),_0x4e00('0x154'),_0x4e00('0x187')));}var _0x363a40={'XMD-CALLERID':_0x1af5f8[_0x4e00('0xb8')][_0x185888][_0x4e00('0x188')](),'XMD-AGI':_0x80c28b[_0x4e00('0x189')]?util[_0x4e00('0x83')](_0x4e00('0x18a'),ipAgi,_0x80c28b[_0x4e00('0x189')]):_0x4e00('0x18b'),'XMD-AGIAFTER':_0x80c28b[_0x4e00('0x11b')]?util['format'](_0x4e00('0x18a'),ipAgi,_0x80c28b[_0x4e00('0x11b')]):_0x4e00('0x18b'),'XMD-QUEUE':_0x80c28b[_0x4e00('0x56')]===_0x4e00('0x57')?util[_0x4e00('0x83')](_0x4e00('0x18c'),_0x80c28b[_0x4e00('0x48')],_0x80c28b['dialQueueOptions']||'',_0x80c28b[_0x4e00('0x11c')]?'c':'',_0x80c28b['dialQueueTimeout']||0x3):_0x4e00('0x18b'),'XMD-CONTACTID':_0x125b96[_0x4e00('0xdd')],'XMD-CDRTYPE':_0x4e00('0x6'),'CALLERID(all)':_0x1af5f8[_0x4e00('0xb8')][_0x185888][_0x4e00('0x188')](),'XMD-AMD':_0x80c28b['dialAMDActive']?_0x4e00('0x18d'):_0x4e00('0x18b'),'XMD-DESTINATION':_0x4e00('0xec')};if(_0x80c28b[_0x4e00('0xed')]){_0x363a40[_0x4e00('0x18e')]=_0x80c28b[_0x4e00('0x18f')]||0x9c4;_0x363a40[_0x4e00('0x190')]=_0x80c28b[_0x4e00('0x191')]||0x5dc;_0x363a40['XMD-AMDAFTERGREETINGSILENCE']=_0x80c28b[_0x4e00('0x192')]||0x320;_0x363a40[_0x4e00('0x193')]=_0x80c28b['dialAMDTotalAnalysisTime']||0x1388;_0x363a40[_0x4e00('0x194')]=_0x80c28b[_0x4e00('0x195')]||0x64;_0x363a40[_0x4e00('0x196')]=_0x80c28b[_0x4e00('0x197')]||0x32;_0x363a40[_0x4e00('0x198')]=_0x80c28b[_0x4e00('0x199')]||0x3;_0x363a40[_0x4e00('0x19a')]=_0x80c28b[_0x4e00('0x19b')]||0x100;_0x363a40[_0x4e00('0x19c')]=_0x80c28b['dialAMDMaximumWordLength']||0x1388;}if(_0x80c28b['type']===_0x4e00('0x57')){_0x363a40[_0x4e00('0x19d')]=_0x125b96[_0x4e00('0xdf')];}else{_0x363a40[_0x4e00('0x19e')]=_0x125b96[_0x4e00('0x10c')];}for(var _0x55bc58 in _0x125b96[_0x4e00('0x19f')]){if(typeof _0x125b96['Contact'][_0x55bc58]!=='undefined'){if(isNotNull(_0x125b96[_0x4e00('0x19f')][_0x55bc58])&&_0x55bc58!=='id'&&_0x55bc58!==_0x4e00('0x1a0')&&_0x55bc58!==_0x4e00('0x1a1')&&_0x55bc58!==_0x4e00('0x1a2')){_0x363a40[util[_0x4e00('0x83')]('%s%s',_0x4e00('0x1a3'),_['toUpper'](_0x55bc58))]=_0x125b96[_0x4e00('0x19f')][_0x55bc58];}}}var _0x42f2e5=_0x1af5f8['isTrunkReachable'](_0x80c28b[_0x4e00('0x7e')])?getCallerId(_0x80c28b[_0x4e00('0x7e')]['callerid'],_0x80c28b['dialOriginateCallerIdName'],_0x80c28b[_0x4e00('0x1a4')]>0x0?getCallerIdRandom(_0x80c28b['dialOriginateCallerIdNumber'],_0x80c28b['dialRandomLastDigitCallerIdNumber']):_0x80c28b[_0x4e00('0x64')]):getCallerId(_[_0x4e00('0xe8')](_0x80c28b[_0x4e00('0x14f')])?_0x80c28b[_0x4e00('0x7e')]['callerid']:_0x80c28b[_0x4e00('0x14f')]['callerid'],_0x80c28b[_0x4e00('0x1a5')],_0x80c28b[_0x4e00('0x1a4')]>0x0?getCallerIdRandom(_0x80c28b[_0x4e00('0x64')],_0x80c28b[_0x4e00('0x1a4')]):_0x80c28b['dialOriginateCallerIdNumber']);if(_0x42f2e5){_0x363a40['XMD-ORIGINATECALLERIDNAME']=_0x1af5f8[_0x4e00('0xb8')][_0x185888][_0x4e00('0x1a6')]=extractCalleridName(_0x42f2e5);_0x363a40[_0x4e00('0x1a7')]=_0x125b96[_0x4e00('0x186')];}_0x80c28b[_0x4e00('0x1a8')]=_0x363a40;return ami[_0x4e00('0xbb')]({'actionid':_0x185888,'action':_0x4e00('0x184'),'channel':_0x1af5f8['isTrunkReachable'](_0x80c28b[_0x4e00('0x7e')])?util[_0x4e00('0x83')](_0x4e00('0x1a9'),_0x80c28b['Trunk'][_0x4e00('0x48')],isNotNull(_0x80c28b[_0x4e00('0x1aa')])?_0x80c28b['dialPrefix']['trim']()||'':'',_0x80c28b[_0x4e00('0x1ab')]>0x0?_0x125b96[_0x4e00('0x186')][_0x4e00('0x1ac')](_0x80c28b[_0x4e00('0x1ab')]):_0x125b96[_0x4e00('0x186')]):util[_0x4e00('0x83')]('SIP/%s/%s%s',_[_0x4e00('0xe8')](_0x80c28b[_0x4e00('0x14f')])?_0x80c28b[_0x4e00('0x7e')][_0x4e00('0x48')]:_0x80c28b[_0x4e00('0x14f')]['name'],isNotNull(_0x80c28b['dialPrefix'])?_0x80c28b[_0x4e00('0x1aa')][_0x4e00('0x1ad')]()||'':'',_0x80c28b[_0x4e00('0x1ab')]>0x0?_0x125b96[_0x4e00('0x186')][_0x4e00('0x1ac')](_0x80c28b[_0x4e00('0x1ab')]):_0x125b96['phone']),'callerid':_0x42f2e5,'Exten':'xcally-motion-dialer','Context':_0x4e00('0x1ae'),'Priority':'1','variable':_0x363a40,'timeout':(_0x80c28b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x185888})[_0x4e00('0x43')](function(_0x236a5d){return _0x4e9607(_0x236a5d);})[_0x4e00('0xbc')](function(_0x4465ac){_0x80c28b['outboundOriginateFailureCallsDay']+=0x1;var _0xeafb0b=new History(_0x1af5f8['actions'][_0x185888]);logger[_0x4e00('0xa0')](util[_0x4e00('0x83')](_0x4e00('0x1af'),JSON[_0x4e00('0x52')](_0x4465ac)));_0xeafb0b[_0x4e00('0xf1')]=0xe;_0xeafb0b[_0x4e00('0xb3')]=_0x4e00('0x1b0');_0xeafb0b[_0x4e00('0xb5')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));_0xeafb0b['endtime']=_0xeafb0b[_0x4e00('0xb5')];_0x1af5f8[_0x4e00('0xd4')](_0xeafb0b)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1b1')));_0x1af5f8['moveContactManagedDialer'](_0xeafb0b)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1b1')))['finally'](function(){delete _0x1af5f8['actions'][_0x185888];return _0x4b6a00(msgResponse(_0x4e00('0x184'),_0x4e00('0x51'),_0x4e00('0x1b2')));});});});};Dialer[_0x4e00('0x1b')]['syncOriginateResponse']=function(_0xb1100c){var _0x332776=this[_0x4e00('0xb8')][_0xb1100c[_0x4e00('0x135')]];if(_0x332776){delete this[_0x4e00('0xb8')][_0xb1100c[_0x4e00('0x135')]];_0x332776[_0x4e00('0x1b3')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));var _0x13a683=_0x332776[_0x4e00('0x56')]===_0x4e00('0x82')?this[_0x4e00('0x21')][_0x332776[_0x4e00('0xbf')]]:this[_0x4e00('0x20')][_0x332776['getQueue']()];if(!this[_0x4e00('0x1b4')](_0xb1100c[_0x4e00('0x1b5')])){this[_0x4e00('0xbe')](_0x13a683);return this['callProgressDetecting'](_0x332776,_0x13a683,_0xb1100c)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1b6')));}this['uniqueId'][_0xb1100c[_0x4e00('0xf0')]]=_0x332776;}};Dialer[_0x4e00('0x1b')][_0x4e00('0x1b7')]=function(_0x316379,_0x4fe612,_0x26bdad){var _0x5b55db=new History(_0x4fe612);if(_0x5b55db[_0x4e00('0xfd')]+_0x5b55db['countcongestionretry']+_0x5b55db[_0x4e00('0x110')]+_0x5b55db[_0x4e00('0x111')]+_0x5b55db[_0x4e00('0xff')]+_0x5b55db[_0x4e00('0x100')]+_0x5b55db[_0x4e00('0x105')]+_0x5b55db[_0x4e00('0x101')]>=_0x26bdad['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x316379){case 0x3:if(_0x5b55db[_0x4e00('0x110')]>=_0x26bdad['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x5b55db['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad[_0x4e00('0x1b8')],'minutes')[_0x4e00('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db['ListId'],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})['catch'](loggerCatch(_0x4e00('0x1b9')));break;case 0x5:if(_0x5b55db[_0x4e00('0xfd')]>=_0x26bdad[_0x4e00('0x1ba')]-0x1){return!![];}this[_0x4e00('0xca')]({'active':![],'countbusyretry':_0x5b55db[_0x4e00('0xfd')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad[_0x4e00('0x1bb')],_0x4e00('0x10a'))[_0x4e00('0x83')](_0x4e00('0x10b')),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db['VoiceQueueId']||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1bc')));break;case 0x8:if(_0x5b55db[_0x4e00('0xfe')]>=_0x26bdad[_0x4e00('0x1bd')]-0x1){return!![];}this[_0x4e00('0xca')]({'active':![],'countcongestionretry':_0x5b55db[_0x4e00('0xfe')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad['dialCongestionRetryFrequency'],_0x4e00('0x10a'))['format'](_0x4e00('0x10b')),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db['VoiceQueueId']||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1be')));break;case 0x0:if(_0x5b55db[_0x4e00('0x111')]>=_0x26bdad[_0x4e00('0x1bf')]-0x1){return!![];}else{this[_0x4e00('0xca')]({'active':![],'countnosuchnumberretry':_0x5b55db[_0x4e00('0x111')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad[_0x4e00('0x1c0')],_0x4e00('0x10a'))[_0x4e00('0x83')](_0x4e00('0x10b')),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1c1')));}break;case 0xa:if(_0x5b55db['countdropretry']>=_0x26bdad['dialDropMaxRetry']-0x1){return!![];}this[_0x4e00('0xca')]({'active':![],'countdropretry':_0x5b55db[_0x4e00('0xff')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad[_0x4e00('0x129')],_0x4e00('0x10a'))['format'](_0x4e00('0x10b')),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db['CampaignId']||undefined})[_0x4e00('0xbc')](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x5b55db['countabandonedretry']>=_0x26bdad['dialAbandonedMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x5b55db[_0x4e00('0x100')]+=0x1,'scheduledat':moment()['add'](_0x26bdad[_0x4e00('0x130')],_0x4e00('0x10a'))[_0x4e00('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b55db['ContactId'],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x132')));break;case 0x13:if(_0x5b55db[_0x4e00('0x105')]>=_0x26bdad[_0x4e00('0x112')]-0x1){return!![];}this[_0x4e00('0xca')]({'active':![],'countmachineretry':_0x5b55db[_0x4e00('0x105')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad['dialMachineRetryFrequency'],_0x4e00('0x10a'))[_0x4e00('0x83')](_0x4e00('0x10b')),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x10d')));break;case 0x14:if(_0x5b55db[_0x4e00('0x101')]>=_0x26bdad[_0x4e00('0x1c2')]-0x1){return!![];}this[_0x4e00('0xca')]({'active':![],'countagentrejectretry':_0x5b55db[_0x4e00('0x101')]+=0x1,'scheduledat':moment()[_0x4e00('0x108')](_0x26bdad[_0x4e00('0x1c3')],_0x4e00('0x10a'))[_0x4e00('0x83')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5b55db[_0x4e00('0xdd')],'ListId':_0x5b55db[_0x4e00('0xde')],'VoiceQueueId':_0x5b55db[_0x4e00('0xdf')]||undefined,'CampaignId':_0x5b55db[_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1c4')));break;default:return!![];}};Dialer[_0x4e00('0x1b')]['callProgressDetecting']=function(_0x5a8ea1,_0x457975,_0x32daff){var _0x448b6f=this;var _0x14e12e=new History(_0x5a8ea1);var _0x34815d=![];var _0x29fbe1;var _0x370b02;return new Promise(function(_0x304565,_0x498023){if(_['isUndefined'](_0x457975)&&typeof _0x457975!=='object'){return _0x498023(msgResponse(_0x4e00('0x1c5'),_0x4e00('0x154'),_0x4e00('0x1c6')));}if(_['isUndefined'](_0x32daff)&&typeof _0x32daff!=='object'){return _0x498023(msgResponse(_0x4e00('0x1c5'),_0x4e00('0x154'),_0x4e00('0x1c7')));}_0x448b6f['verifyAdditionalPhones'](_0x14e12e,_0x32daff[_0x4e00('0x1c8')],_0x457975)[_0x4e00('0x43')](function(_0x59ae7e){if(_0x59ae7e[_0x4e00('0x126')]==0x1)_0x34815d=!![];switch(_0x32daff[_0x4e00('0x1c8')]){case'0':_0x457975[_0x4e00('0x6d')]+=0x1;_0x14e12e[_0x4e00('0xf1')]=0x0;_0x14e12e['statedesc']=_0x4e00('0x1c9');_0x14e12e['countnosuchnumberretry']+=0x1;_0x14e12e['countglobal']+=0x1;ami[_0x4e00('0x55')](_0x4e00('0x1ca'),ut[_0x4e00('0xf6')](_0x5a8ea1,'nosuchnumber'));_0x29fbe1=_0x457975[_0x4e00('0x1c0')];_0x370b02=_0x457975[_0x4e00('0x124')];_0x448b6f['createHistory'](_0x14e12e)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0xfc')));if(_0x448b6f[_0x4e00('0x1b7')](0x0,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e['countnosuchnumberretry']>=_0x457975['dialNoSuchNumberMaxRetry']){_0x448b6f['createStateFinal'](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1cb'));}else{_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1cb'));}}break;case'3':_0x457975[_0x4e00('0x6c')]+=0x1;_0x14e12e[_0x4e00('0xf1')]=0x3;_0x14e12e[_0x4e00('0xb3')]=_0x4e00('0x1cc');_0x14e12e['countnoanswerretry']+=0x1;_0x14e12e[_0x4e00('0xfb')]+=0x1;var _0x38e627=ut['buildNoAnswerEventPayload'](_0x5a8ea1,_0x457975);ami[_0x4e00('0x55')](_0x4e00('0x1cd'),_0x38e627);_0x29fbe1=_0x457975[_0x4e00('0x1b8')];_0x370b02=_0x457975['callAdditionalPhoneAfterMin'];_0x448b6f[_0x4e00('0xd4')](_0x14e12e)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1ce')));if(_0x448b6f[_0x4e00('0x1b7')](0x3,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e[_0x4e00('0x110')]>=_0x457975[_0x4e00('0x1cf')]){_0x448b6f['createStateFinal'](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1d0'));}else{_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x457975[_0x4e00('0x1d1')]+=0x1;_0x14e12e[_0x4e00('0xf1')]=0x5;_0x14e12e['statedesc']='Busy';_0x14e12e['countbusyretry']+=0x1;_0x14e12e['countglobal']+=0x1;ami[_0x4e00('0x55')](_0x4e00('0x1d2'),ut[_0x4e00('0xf6')](_0x5a8ea1,_0x4e00('0x1d3')));_0x29fbe1=_0x457975[_0x4e00('0x1bb')];_0x370b02=_0x457975['callAdditionalPhoneAfterMin'];_0x448b6f['createHistory'](_0x14e12e)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1d4')));if(_0x448b6f[_0x4e00('0x1b7')](0x5,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e[_0x4e00('0xfd')]>=_0x457975['dialBusyMaxRetry']){_0x448b6f[_0x4e00('0x106')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1d5'));}else{_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,'reason\x205\x20busy');}}break;case'8':_0x457975[_0x4e00('0x69')]+=0x1;_0x14e12e[_0x4e00('0xf1')]=0x8;_0x14e12e[_0x4e00('0xb3')]=_0x4e00('0x1d6');_0x14e12e['countcongestionretry']+=0x1;_0x14e12e[_0x4e00('0xfb')]+=0x1;_0x29fbe1=_0x457975[_0x4e00('0x1d7')];_0x370b02=_0x457975[_0x4e00('0x124')];ami[_0x4e00('0x55')](_0x4e00('0x1d8'),ut['buildObj'](_0x5a8ea1,_0x4e00('0x1d9')));_0x448b6f[_0x4e00('0xd4')](_0x14e12e)[_0x4e00('0xbc')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x448b6f[_0x4e00('0x1b7')](0x8,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e[_0x4e00('0xfe')]>=_0x457975[_0x4e00('0x1bd')]){_0x448b6f['createStateFinal'](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1da'));}else{_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1da'));}}break;case'11':_0x457975['outboundAbandonedCallsDay']+=0x1;_0x14e12e[_0x4e00('0xf1')]=0xb;_0x14e12e[_0x4e00('0xb3')]=_0x4e00('0x12e');_0x14e12e[_0x4e00('0x100')]+=0x1;_0x14e12e[_0x4e00('0xfb')]+=0x1;_0x29fbe1=_0x457975[_0x4e00('0x130')];_0x370b02=_0x457975[_0x4e00('0x124')];_0x448b6f[_0x4e00('0xd4')](_0x14e12e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x448b6f['checkRetriveMax'](0xb,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e[_0x4e00('0x100')]>=_0x457975[_0x4e00('0x131')]){_0x448b6f[_0x4e00('0x106')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1db'));}else{_0x448b6f['stateGlobal'](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1db'));}}break;case'20':_0x457975[_0x4e00('0x70')]+=0x1;_0x14e12e[_0x4e00('0xf1')]=0x14;_0x14e12e[_0x4e00('0xb3')]='AgentReject';_0x14e12e[_0x4e00('0x101')]+=0x1;_0x14e12e[_0x4e00('0xfb')]+=0x1;_0x29fbe1=_0x457975['dialAgentRejectRetryFrequency'];_0x370b02=_0x457975[_0x4e00('0x124')];ami['emit'](_0x4e00('0x1dc'),ut[_0x4e00('0xf6')](_0x5a8ea1,_0x4e00('0x1dd')));_0x448b6f['createHistory'](_0x14e12e)['catch'](loggerCatch(_0x4e00('0x1de')));if(_0x448b6f['checkRetriveMax'](0x14,_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e[_0x4e00('0x101')]>=_0x457975['dialAgentRejectMaxRetry']){_0x448b6f[_0x4e00('0x106')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1df'));}else{_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,_0x4e00('0x1df'));}}break;default:_0x457975[_0x4e00('0x71')]+=0x1;_0x14e12e['state']=0xc;_0x14e12e['statedesc']=_0x32daff['reason'];_0x29fbe1=_0x457975[_0x4e00('0x1c3')];_0x370b02=_0x457975[_0x4e00('0x124')];_0x448b6f[_0x4e00('0xd4')](_0x14e12e)[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x1e0')));if(_0x448b6f['checkRetriveMax'](_0x32daff[_0x4e00('0x1c8')],_0x5a8ea1,_0x457975)&&!_0x34815d){if(_0x14e12e['countbusyretry']+_0x14e12e['countcongestionretry']+_0x14e12e[_0x4e00('0x110')]+_0x14e12e[_0x4e00('0x111')]+_0x14e12e[_0x4e00('0xff')]+_0x14e12e['countabandonedretry']+_0x14e12e[_0x4e00('0x105')]+_0x14e12e[_0x4e00('0x101')]>=_0x457975['dialGlobalMaxRetry']){_0x448b6f[_0x4e00('0x103')](_0x14e12e,_0x304565,_0x498023,_0x32daff[_0x4e00('0x1c8')]);}else{_0x448b6f[_0x4e00('0x106')](_0x14e12e,_0x304565,_0x498023,_0x32daff[_0x4e00('0x1c8')]);}}}})[_0x4e00('0x43')](function(){if(_0x34815d){_0x448b6f['swapAdditionalPhones'](_0x14e12e,_0x29fbe1,_0x370b02)['then'](function(){return _0x304565(0x1);});}});});};Dialer['prototype'][_0x4e00('0x103')]=function(_0xa856c4,_0x3891bb,_0x28e3b6,_0x1a195a){var _0x35cf2b=new Final(_0xa856c4);_0x35cf2b[_0x4e00('0xf1')]=0xf;_0x35cf2b[_0x4e00('0xb3')]=_0x4e00('0x1e1');this[_0x4e00('0x106')](_0x35cf2b,_0x3891bb,_0x28e3b6,_0x1a195a);};Dialer[_0x4e00('0x1b')][_0x4e00('0x106')]=function(_0x3c68ca,_0x83e813,_0x31453b,_0x38531a){this[_0x4e00('0xd3')](_0x3c68ca)['then'](function(){return _0x83e813(msgResponse(_0x4e00('0x1c5'),_0x4e00('0xe2'),_0x38531a));})['catch'](function(){return _0x31453b(msgResponse(_0x4e00('0x1e2'),_0x4e00('0x154'),_0x4e00('0x1e3')));});};Dialer[_0x4e00('0x1b')][_0x4e00('0x16d')]=function(_0x259b9b){var _0x1bf9dc=_0x259b9b[_0x4e00('0x1e4')]/0x64;var _0x1bd781=_0x259b9b[_0x4e00('0x6b')]/(_0x259b9b[_0x4e00('0x6b')]+_0x259b9b[_0x4e00('0x67')]);var _0xe2cd9c=Math['round'](_0x259b9b['predictiveIntervalAvailable']*(_0x259b9b['predictiveIntervalMaxThreshold']/0x64));var _0x4e68a7=Math[_0x4e00('0x1e5')](_0x259b9b[_0x4e00('0x79')]*(_0x259b9b[_0x4e00('0x1e6')]/0x64));var _0x1ca7db=_0x259b9b[_0x4e00('0xac')]+_0x259b9b[_0x4e00('0x5e')];var _0x47a5a1=Math[_0x4e00('0x1e7')](_0x259b9b[_0x4e00('0x7b')]*_0x259b9b[_0x4e00('0x7c')]*_0x259b9b[_0x4e00('0x77')]*_0x259b9b['predictiveIntervalMultiplicativeFactor']);if(_[_0x4e00('0x45')](_0x259b9b[_0x4e00('0x29')])){if(!_[_0x4e00('0x45')](_0x259b9b[_0x4e00('0x28')])){_0x259b9b[_0x4e00('0x28')]=undefined;loggerPredictive['error']('[startMethodPredictive][StartProgressive]',_0x4e00('0x1e8'));}if(!_[_0x4e00('0x45')](_0x259b9b[_0x4e00('0x9a')])){loggerPredictive[_0x4e00('0xa0')](_0x4e00('0x1e9'),_0x4e00('0x1ea'));clearInterval(_0x259b9b[_0x4e00('0x9a')]);_0x259b9b[_0x4e00('0x9a')]=undefined;}_0x259b9b[_0x4e00('0x29')]=moment()[_0x4e00('0x83')](_0x4e00('0x10b'));loggerPredictive[_0x4e00('0x85')](_0x259b9b['name'],'collection\x20data\x20in\x20progressive\x20at',_0x259b9b[_0x4e00('0x29')]);this[_0x4e00('0x16a')](_0x259b9b,0x1);}else if(ifInterval(_0x259b9b[_0x4e00('0x1eb')],_0x259b9b[_0x4e00('0x29')])){this[_0x4e00('0x16a')](_0x259b9b,0x1);loggerPredictiveCalls[_0x4e00('0x85')]('[startMethodPredictive][StartProgressive][Loop]',_0x259b9b[_0x4e00('0x29')],_0x259b9b['name']);_0x259b9b['erlangCalls']=0x0;_0x259b9b[_0x4e00('0x76')]=0x0;}else if(_0x1bf9dc<_0x1bd781&&_0x259b9b[_0x4e00('0x1ec')]===_0x4e00('0x1ed')){freeVariablesPredictive(_0x259b9b);loggerPredictive['info'](_0x4e00('0x1ee'),'Dropped\x20calls\x20day',_0x1bd781,_0x4e00('0x29'),_0x259b9b['name']);}else if(_0x47a5a1<_0x259b9b[_0x4e00('0x76')]&&_0x259b9b[_0x4e00('0x1ec')]===_0x4e00('0x1ed')){freeVariablesPredictive(_0x259b9b);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x1ef'),_0x4e00('0x1f0'),_0x47a5a1,_0x4e00('0x1f1'),_0x259b9b[_0x4e00('0x76')],_0x4e00('0x29'),_0x259b9b[_0x4e00('0x48')]);}else if(!ifInterval(_0x259b9b[_0x4e00('0x1eb')],_0x259b9b[_0x4e00('0x29')])&&_['isUndefined'](_0x259b9b[_0x4e00('0x28')])&&!_['isUndefined'](_0x259b9b[_0x4e00('0x29')])){_0x259b9b[_0x4e00('0x28')]=moment()['format'](_0x4e00('0x10b'));loggerPredictive[_0x4e00('0x85')](_0x259b9b[_0x4e00('0x48')],_0x4e00('0x1f2'),_0x259b9b[_0x4e00('0x28')]);this[_0x4e00('0xc8')](_0x259b9b[_0x4e00('0x1eb')])[_0x4e00('0x43')](this[_0x4e00('0x1f3')](_0x259b9b))[_0x4e00('0x43')](mergeDataErlangB(_0x259b9b))[_0x4e00('0x43')](this[_0x4e00('0x1f4')](_0x259b9b))['catch'](loggerCatchPredictive(_0x4e00('0x1f5'),_0x259b9b));}else if(!ifInterval(_0x259b9b[_0x4e00('0x1eb')],_0x259b9b[_0x4e00('0x28')])){_0x259b9b['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x259b9b[_0x4e00('0x28')]=moment()['format'](_0x4e00('0x10b'));loggerPredictive[_0x4e00('0x85')](_0x259b9b['name'],_0x4e00('0x1f6'),_0x259b9b[_0x4e00('0x28')]);clearInterval(_0x259b9b[_0x4e00('0x9a')]);_0x259b9b[_0x4e00('0x9a')]=undefined;this[_0x4e00('0xc8')](_0x259b9b[_0x4e00('0x1eb')])[_0x4e00('0x43')](this[_0x4e00('0x1f3')](_0x259b9b))['then'](mergeDataErlangB(_0x259b9b))[_0x4e00('0x43')](this[_0x4e00('0x1f4')](_0x259b9b))[_0x4e00('0xbc')](loggerCatchPredictive(_0x4e00('0x1f7'),_0x259b9b));}else if(_0x259b9b[_0x4e00('0x79')]&&_0x1ca7db<_0x259b9b[_0x4e00('0x79')]-_0x4e68a7){freeVariablesPredictive(_0x259b9b);loggerPredictive[_0x4e00('0x85')](_0x259b9b['name'],_0x4e00('0x1f8'),_0x1ca7db,_0x4e00('0x1f9'),_0x259b9b[_0x4e00('0x79')],'-',_0x4e68a7,'=',_0x259b9b[_0x4e00('0x79')]-_0x4e68a7,')');}else if(_0x259b9b[_0x4e00('0x79')]&&_0x1ca7db>_0x259b9b['predictiveIntervalAvailable']+_0xe2cd9c){freeVariablesPredictive(_0x259b9b);loggerPredictive['info'](_0x259b9b['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x1ca7db,_0x4e00('0x1fa'),_0x259b9b[_0x4e00('0x79')],'+',_0xe2cd9c,'=',_0x259b9b[_0x4e00('0x79')]+_0xe2cd9c,')');}};Dialer[_0x4e00('0x1b')][_0x4e00('0x1f3')]=function(_0x18d4c9){var _0x3ed85d=this;return function(_0x5a5459){return new Promise(function(_0x55a29b,_0x2b7158){_['merge'](_0x18d4c9,_0x5a5459[0x0]);if(checkGetDataPredictive(_0x5a5459[0x0])){var _0x28fd5a=_0x18d4c9[_0x4e00('0x79')]=_0x18d4c9[_0x4e00('0x5e')]+_0x18d4c9[_0x4e00('0xac')];var _0x1fa8e3=_0x18d4c9[_0x4e00('0x1eb')]*0x3c;var _0x44c831=_0x5a5459[0x0][_0x4e00('0x74')]+_0x5a5459[0x0]['predictiveIntervalAvgHoldtime'];var _0x4ac92b=(_0x5a5459[0x0][_0x4e00('0x72')]+_0x5a5459[0x0][_0x4e00('0x8a')]+_0x5a5459[0x0][_0x4e00('0x75')])/_0x5a5459[0x0][_0x4e00('0x7a')];_0x18d4c9[_0x4e00('0x77')]=_0x4ac92b>0x0?_0x4ac92b:0x1;switch(_0x18d4c9['dialPredictiveOptimization']){case _0x4e00('0x1ed'):var _0x463eec=_0x18d4c9['dialPredictiveOptimizationPercentage']/0x64;return _0x3ed85d[_0x4e00('0x1fb')](_0x28fd5a,_0x1fa8e3,_0x44c831,_0x4ac92b,_0x463eec)[_0x4e00('0x43')](function(_0x35a2fe){return _0x55a29b(_0x35a2fe);});case _0x4e00('0x1fc'):var _0x81b3f3=_0x18d4c9[_0x4e00('0x1e4')]/0x64;return _0x3ed85d[_0x4e00('0x1fd')](_0x28fd5a,_0x1fa8e3,_0x44c831,_0x4ac92b,_0x81b3f3)[_0x4e00('0x43')](function(_0x31ddae){return _0x55a29b(_0x31ddae);});default:return _0x2b7158(msgResponse('[getDataPredictive]',_0x4e00('0x154'),_0x4e00('0x1fe')));}}else{return _0x2b7158(msgResponse(_0x4e00('0x1ff'),_0x4e00('0x154'),_0x4e00('0x200')));}});};};Dialer[_0x4e00('0x1b')][_0x4e00('0x201')]=function(_0x1ac732){var _0x395575=this;return function(_0x4d3892){return new Promise(function(_0x303599,_0xba2dc5){_[_0x4e00('0x96')](_0x1ac732,_0x4d3892[0x0]);if(checkGetDataPredictive(_0x4d3892[0x0])){loggerPredictive[_0x4e00('0x85')](JSON[_0x4e00('0x52')](_0x4d3892[0x0]));if(_0x1ac732[_0x4e00('0x1ec')]===_0x4e00('0x1ed')){return _0x395575[_0x4e00('0xd1')](_0x1ac732['id'])['then'](function(_0x112450){var _0xfb865=_0x1ac732[_0x4e00('0x5a')]-_0x112450[0x0][_0x4e00('0x202')];var _0x1ec8d1=_0x1ac732[_0x4e00('0x1eb')]*0x3c;var _0x727707=_0x4d3892[0x0][_0x4e00('0x74')]+_0x4d3892[0x0][_0x4e00('0x73')];var _0xd37af=(_0x4d3892[0x0][_0x4e00('0x72')]+_0x4d3892[0x0][_0x4e00('0x8a')]+_0x4d3892[0x0][_0x4e00('0x75')])/_0x4d3892[0x0][_0x4e00('0x7a')];var _0x1c203c=_0x1ac732[_0x4e00('0x1e4')]/0x64;_0x1ac732[_0x4e00('0x203')]=_0x112450[0x0]['outboundQueuePauses']||0x0;_0x1ac732['predictiveIntervalHitRate']=_0xd37af>0x0?_0xd37af:0x1;return _0x395575['abandonmentRate'](_0xfb865,_0x1ec8d1,_0x727707,_0xd37af,_0x1c203c);})[_0x4e00('0x43')](function(_0x1227f2){return _0x303599(_0x1227f2);})[_0x4e00('0xbc')](function(_0x1b85b9){return _0xba2dc5(msgResponse(_0x4e00('0x204'),_0x4e00('0x154'),JSON[_0x4e00('0x52')](_0x1b85b9)));});}if(_0x1ac732[_0x4e00('0x1ec')]===_0x4e00('0x1fc')){return _0x395575[_0x4e00('0xd1')](_0x1ac732['id'])[_0x4e00('0x43')](function(_0x54e3f5){var _0x30293a=_0x1ac732[_0x4e00('0x5a')]-_0x54e3f5[0x0][_0x4e00('0x202')];var _0x9fe3be=_0x1ac732[_0x4e00('0x1eb')]*0x3c;var _0x1638f8=_0x4d3892[0x0][_0x4e00('0x74')]+_0x4d3892[0x0][_0x4e00('0x73')];var _0xa51db5=(_0x4d3892[0x0][_0x4e00('0x72')]+_0x4d3892[0x0][_0x4e00('0x8a')]+_0x4d3892[0x0][_0x4e00('0x75')])/_0x4d3892[0x0][_0x4e00('0x7a')];var _0x26617b=_0x1ac732[_0x4e00('0x1e4')]/0x64;_0x1ac732['predictiveIntervalPauses']=_0x54e3f5[0x0][_0x4e00('0x202')]||0x0;_0x1ac732[_0x4e00('0x77')]=_0xa51db5>0x0?_0xa51db5:0x1;return _0x395575[_0x4e00('0x1fd')](_0x30293a,_0x9fe3be,_0x1638f8,_0xa51db5,_0x26617b);})[_0x4e00('0x43')](function(_0x1cf498){return _0x303599(_0x1cf498);})[_0x4e00('0xbc')](function(_0x23d803){return _0xba2dc5(msgResponse(_0x4e00('0x204'),_0x4e00('0x154'),JSON[_0x4e00('0x52')](_0x23d803)));});}}else{return _0xba2dc5(msgResponse('[getDataPredictive]',_0x4e00('0x154'),_0x4e00('0x200')));}});};};Dialer[_0x4e00('0x1b')][_0x4e00('0x1f4')]=function(_0x676dc6){var _0x3deaa8=this;return function(){var _0xc900a9=0x0;var _0x5768cf=Math[_0x4e00('0x1e7')](_0x676dc6[_0x4e00('0x93')]*0x3e8);if(_0x5768cf>0x0){_0x5768cf=_0x5768cf<0x64?0x64:_0x5768cf;loggerPredictive[_0x4e00('0x85')](_0x676dc6[_0x4e00('0x48')],'one\x20call\x20every:',_0x5768cf,_0x4e00('0x53'));_0x676dc6[_0x4e00('0x9a')]=setInterval(function(){_0x3deaa8['handlePredictive'](_0x676dc6);loggerPredictiveCalls[_0x4e00('0x85')](_0x4e00('0x205'),_0xc900a9+=0x1);},_0x5768cf);}else{loggerPredictive['info'](_0x676dc6[_0x4e00('0x48')],_0x4e00('0x206'));}};};Dialer[_0x4e00('0x1b')][_0x4e00('0x207')]=function(_0x49997d,_0xb95a01){var _0x2031fe=this;return function(_0x464da7){if(_[_0x4e00('0x84')](_0x464da7)){if(_[_0x4e00('0xe8')](_0xb95a01[_0x4e00('0x208')])||!_0xb95a01['recallme']){if(_0x49997d[_0x4e00('0x63')]===_0x4e00('0x7')){_0x49997d[_0x4e00('0x13c')]=_[_0x4e00('0x45')](_0x49997d[_0x4e00('0x13c')])?!![]:_0x49997d[_0x4e00('0x13c')];var _0x14ed8e=uuid['v4']();_0x2031fe[_0x4e00('0xb8')][_0x14ed8e]=new Action(_0x49997d,_0xb95a01,_0x14ed8e);loggerBooked[_0x4e00('0x85')](_0x4e00('0x209'),_0x14ed8e,_0x4e00('0x20a'),JSON[_0x4e00('0x52')](_0x49997d[_0x4e00('0x13c')]),_0x4e00('0x20b'),_0x49997d[_0x4e00('0x48')]);if(_0x49997d[_0x4e00('0x13c')]){_0x49997d[_0x4e00('0x13c')]=![];_0x2031fe[_0x4e00('0x2b')][_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0xbf')]]=[];ami[_0x4e00('0xbb')]({'actionid':_0x14ed8e,'action':'queuestatus','queue':_0x49997d['name']})[_0x4e00('0xbc')](function(){_0x2031fe[_0x4e00('0xbe')](_0x49997d);_0x2031fe[_0x4e00('0xca')]({'active':![],'ContactId':_0x2031fe['actions'][_0x14ed8e][_0x4e00('0xdd')],'ListId':_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0xde')],'VoiceQueueId':_0x2031fe['actions'][_0x14ed8e]['VoiceQueueId']||undefined,'CampaignId':_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x20c')));delete _0x2031fe[_0x4e00('0xb8')][_0x14ed8e];});}else{loggerBooked['info'](_0x4e00('0x20d'),JSON[_0x4e00('0x52')](_0x49997d[_0x4e00('0x13c')]),_0x4e00('0x20b'),_0x49997d[_0x4e00('0x48')]);_0x2031fe['updateOriginated'](_0x49997d);_0x2031fe[_0x4e00('0xca')]({'active':![],'ContactId':_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0xdd')],'ListId':_0x2031fe['actions'][_0x14ed8e][_0x4e00('0xde')],'VoiceQueueId':_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0xdf')]||undefined,'CampaignId':_0x2031fe[_0x4e00('0xb8')][_0x14ed8e][_0x4e00('0x10c')]||undefined})[_0x4e00('0xbc')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2031fe[_0x4e00('0xb8')][_0x14ed8e];}}else{return _0x2031fe[_0x4e00('0x182')](_0x49997d,_0xb95a01);}}else{if(getDiff(_0xb95a01[_0x4e00('0x20e')])<_0x49997d['dialRecallMeTimeout']*0x3c){if(_0xb95a01[_0x4e00('0x17b')]&&!_0xb95a01[_0x4e00('0x17b')][_0x4e00('0x20f')]){_0x2031fe[_0x4e00('0x1f')]['run'](_0xb95a01['id'])['finally'](function(){_0x2031fe[_0x4e00('0xbe')](_0x49997d);});}else{_0x2031fe[_0x4e00('0xcc')]({'active':![]},_0xb95a01['id'],0x1)[_0x4e00('0x1e')](function(){_0x2031fe[_0x4e00('0xbe')](_0x49997d);});}}else{_0x49997d[_0x4e00('0x6f')]+=0x1;_0x2031fe['updateOriginated'](_0x49997d);if(_0x49997d[_0x4e00('0x210')]){_0x2031fe['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0xb95a01[_0x4e00('0xdd')],'ListId':_0xb95a01['ListId'],'VoiceQueueId':_0xb95a01[_0x4e00('0xdf')]||undefined,'CampaignId':_0xb95a01[_0x4e00('0x10c')]||undefined})['catch'](loggerCatch(_0x4e00('0x211')));_0x2031fe[_0x4e00('0xd4')](createObjHistory(_0x49997d,_0xb95a01,'RECALLINQUEUE',0x17,_0x4e00('0x212')))[_0x4e00('0xbc')](loggerCatch(_0x4e00('0x213')));}else{_0x2031fe[_0x4e00('0xdb')](createObjHistory(_0x49997d,_0xb95a01,_0x4e00('0x214'),0x16,_0x4e00('0x215')),_0x4e00('0x216'),_0x4e00('0x217'));}}}}else{_0x49997d[_0x4e00('0x68')]+=0x1;_0x2031fe[_0x4e00('0xdb')](createObjHistory(_0x49997d,_0xb95a01,_0x4e00('0x218'),0xd,_0x4e00('0x219')),_0x4e00('0x21a'),_0x4e00('0x21b'));throw'inBlackList';}};};Dialer[_0x4e00('0x1b')]['handleIvr']=function(_0x21ef82){var _0x3c71aa=this;var _0x4e58cb=_0x21ef82[_0x4e00('0x21c')]-_0x21ef82[_0x4e00('0xa3')]-_0x21ef82['temp'];emitCampaignSummary(_0x21ef82);if(_0x4e58cb>0x0){if(_0x4e58cb>this[_0x4e00('0x24')]){_0x4e58cb=this[_0x4e00('0x24')];}_0x21ef82[_0x4e00('0xce')]+=_0x4e58cb;this[_0x4e00('0xcf')](_0x21ef82['id'],_0x4e58cb,_0x21ef82['dialOrderByScheduledAt'],_0x21ef82)[_0x4e00('0x43')](function(_0x3ac6fc){_0x21ef82['temp']-=_0x4e58cb;_0x21ef82[_0x4e00('0xce')]=_0x21ef82['temp']>0x0?_0x21ef82['temp']:0x0;if(!checkContactEmpty(_0x3ac6fc)){_0x21ef82[_0x4e00('0x46')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x4e00('0x85')]('[getContactCampaign2][Empty]'+_0x21ef82['name']);}else{_0x21ef82[_0x4e00('0xa3')]+=_0x3ac6fc[_0x4e00('0xa2')];_0x21ef82[_0x4e00('0x46')]=_0x4e00('0x21d');for(var _0x447235=0x0;_0x447235<_0x3ac6fc['length'];_0x447235+=0x1){_0x21ef82[_0x4e00('0x21e')]+=0x1;if(_[_0x4e00('0xe8')](_0x3ac6fc[_0x447235])||_['isNil'](_0x3ac6fc[_0x447235][_0x4e00('0x19f')])||_[_0x4e00('0xe8')](_0x3ac6fc[_0x447235][_0x4e00('0x186')])){_0x3c71aa[_0x4e00('0xd9')]('[actionOriginate]\x20',_0x21ef82,_0x3ac6fc[_0x447235]);}else{_0x3c71aa[_0x4e00('0xc7')](_['pick'](_0x3ac6fc[_0x447235],['CampaignId',_0x4e00('0x186')]))[_0x4e00('0x43')](_0x3c71aa[_0x4e00('0x207')](_0x21ef82,_0x3ac6fc[_0x447235]))['catch'](_0x3c71aa[_0x4e00('0xd8')]('[actionOriginateIvr]\x20',_0x21ef82));}}}})[_0x4e00('0xbc')](loggerGetContactDialer(_0x4e00('0x21f'),_0x21ef82,_0x4e58cb));}};Dialer['prototype'][_0x4e00('0x16a')]=function(_0x1ceb1f,_0x5239d8){var _0x575d16=this;var _0x343ba4=[];var _0x387f49=_0x5239d8>=0x1?_0x5239d8:0x1;if(_0x1ceb1f[_0x4e00('0x63')]===_0x4e00('0x7')){_0x387f49=0x1;}var _0x2bbd7d=Math[_0x4e00('0x1e7')](_0x1ceb1f[_0x4e00('0xac')]*_0x387f49)-_0x1ceb1f[_0x4e00('0xa3')]-_0x1ceb1f[_0x4e00('0xce')];emitVoiceQueueSummary(_0x1ceb1f);if(_0x1ceb1f[_0x4e00('0x220')]>0x0){var _0x3f7ea7=_0x1ceb1f[_0x4e00('0x220')]-_0x1ceb1f['originated']-_0x1ceb1f[_0x4e00('0x5e')]-_0x1ceb1f[_0x4e00('0xce')]-_0x1ceb1f[_0x4e00('0x5b')];if(_0x2bbd7d>_0x3f7ea7){_0x2bbd7d=_0x3f7ea7;}}if(_0x2bbd7d>0x0){if(_0x1ceb1f[_0x4e00('0x63')]===_0x4e00('0x7')){_0x2bbd7d=0x1;}if(_0x2bbd7d>this[_0x4e00('0x24')]){_0x2bbd7d=this[_0x4e00('0x24')];}_0x1ceb1f[_0x4e00('0xce')]+=_0x2bbd7d;for(var _0x27f1d8 in this['agents']){if(typeof this[_0x4e00('0x22')][_0x27f1d8]!==_0x4e00('0xa4')){if(this[_0x4e00('0x22')][_0x27f1d8][_0x4e00('0xf1')]===_0x4e00('0x221')&&this['agents'][_0x27f1d8][_0x4e00('0xe5')]===_0x4e00('0xe6')){_0x343ba4[_0x4e00('0x139')](this[_0x4e00('0x22')][_0x27f1d8]['id']);}}}this[_0x4e00('0xcd')](_0x1ceb1f['id'],_0x343ba4,_0x2bbd7d,_0x1ceb1f['dialOrderByScheduledAt'],_0x1ceb1f)[_0x4e00('0x43')](function(_0x51ce3e){_0x1ceb1f['temp']-=_0x2bbd7d;_0x1ceb1f['temp']=_0x1ceb1f['temp']>0x0?_0x1ceb1f[_0x4e00('0xce')]:0x0;if(!checkContactEmpty(_0x51ce3e)){_0x575d16['countReScheduled'](_0x1ceb1f)['then'](sendMessageReschedule(_0x1ceb1f))['catch'](loggerCatch(_0x4e00('0x222')));}else{_0x1ceb1f[_0x4e00('0xa3')]+=_0x51ce3e[_0x4e00('0xa2')];_0x1ceb1f[_0x4e00('0x46')]=_0x1ceb1f['dialMethod']===_0x4e00('0x7')?_0x4e00('0x18d'):'RUNNING';for(var _0xe2a36f=0x0;_0xe2a36f<_0x51ce3e[_0x4e00('0xa2')];_0xe2a36f+=0x1){if(_[_0x4e00('0xe8')](_0x51ce3e[_0xe2a36f])||_['isNil'](_0x51ce3e[_0xe2a36f][_0x4e00('0x19f')])||_[_0x4e00('0xe8')](_0x51ce3e[_0xe2a36f][_0x4e00('0x186')])){_0x575d16[_0x4e00('0xd9')](_0x4e00('0x223'),_0x1ceb1f,_0x51ce3e[_0xe2a36f]);}else{_0x575d16['checkIsBlackList'](_[_0x4e00('0xdc')](_0x51ce3e[_0xe2a36f],['VoiceQueueId',_0x4e00('0x186')]))[_0x4e00('0x43')](_0x575d16[_0x4e00('0x207')](_0x1ceb1f,_0x51ce3e[_0xe2a36f]))['catch'](_0x575d16['loggerHandler'](_0x4e00('0x223'),_0x1ceb1f));}}}})[_0x4e00('0xbc')](loggerGetContactDialer('[getContactDialer2]',_0x1ceb1f,_0x2bbd7d));}};Dialer[_0x4e00('0x1b')][_0x4e00('0x9a')]=function(_0x335f4b){if(_0x335f4b[_0x4e00('0x220')]>0x0){var _0x491244=_0x335f4b[_0x4e00('0x220')]-_0x335f4b[_0x4e00('0xa3')]-_0x335f4b['talking'];if(_0x491244>0x0){this['tryOriginatePredictive'](_0x335f4b);}else{loggerPredictiveCalls[_0x4e00('0x85')](_0x4e00('0x224'));}}else{this['tryOriginatePredictive'](_0x335f4b);}};Dialer[_0x4e00('0x1b')][_0x4e00('0x225')]=function(_0x411ed9){var _0x180760=this;var _0x170a2c=[];_0x411ed9['originated']+=0x1;for(var _0x39382a in this['agents']){if(typeof this[_0x4e00('0x22')][_0x39382a]!=='undefined'){if(this['agents'][_0x39382a][_0x4e00('0xf1')]===_0x4e00('0x221')&&this[_0x4e00('0x22')][_0x39382a][_0x4e00('0xe5')]===_0x4e00('0xe6')){_0x170a2c[_0x4e00('0x139')](this[_0x4e00('0x22')][_0x39382a]['id']);}}}this[_0x4e00('0xcd')](_0x411ed9['id'],_0x170a2c,0x1,_0x411ed9[_0x4e00('0x226')],_0x411ed9)[_0x4e00('0x43')](function(_0x1208ca){if(!checkContactEmpty(_0x1208ca)){checkContactLowerLimitOriginate(_0x411ed9,0x1,0x0);_0x180760[_0x4e00('0xc1')](_0x411ed9)[_0x4e00('0x43')](sendMessageReschedule(_0x411ed9))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x411ed9[_0x4e00('0x46')]=_0x4e00('0x21d');if(_[_0x4e00('0xe8')](_0x1208ca[0x0])||_['isNil'](_0x1208ca[0x0][_0x4e00('0x19f')])||_[_0x4e00('0xe8')](_0x1208ca[0x0][_0x4e00('0x186')])){_0x180760['emptyContact']('[actionOriginate]\x20',_0x411ed9,_0x1208ca[0x0]);}else{_0x180760['checkIsBlackList'](_['pick'](_0x1208ca[0x0],['VoiceQueueId',_0x4e00('0x186')]))['then'](_0x180760[_0x4e00('0x207')](_0x411ed9,_0x1208ca[0x0]))[_0x4e00('0xbc')](_0x180760[_0x4e00('0xd8')]('[actionOriginatePredictive]\x20',_0x411ed9));}}})[_0x4e00('0xbc')](loggerGetContactDialer(_0x4e00('0x227'),_0x411ed9,0x1));emitVoiceQueueSummary(_0x411ed9);};Dialer[_0x4e00('0x1b')][_0x4e00('0x1fb')]=function(_0x4718b2,_0x5e33c2,_0x5dffa1,_0x1d47b0,_0x47e94f,_0x24c016){loggerPredictive[_0x4e00('0x85')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x4e00('0x85')](_0x4e00('0x228'),_0x4718b2);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x229'),_0x5e33c2);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x22a'),_0x5dffa1);loggerPredictive[_0x4e00('0x85')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1d47b0);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x22b'),_0x47e94f);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8d'));return new Promise(function(_0x27aa6e,_0x333904){if(_0x4718b2<=0x0||isNaN(_0x4718b2)){return _0x333904(msgResponse(_0x4e00('0x22c'),_0x4e00('0x51'),_0x4e00('0x22d')+_0x4718b2));}if(_0x5dffa1<=0x0||isNaN(_0x5dffa1)){return _0x333904(msgResponse(_0x4e00('0x22c'),_0x4e00('0x51'),_0x4e00('0x22e')+_0x5dffa1));}if(_0x1d47b0<=0x0||isNaN(_0x1d47b0)){return _0x333904(msgResponse('[abandonmentRate]',_0x4e00('0x51'),_0x4e00('0x22f')+_0x1d47b0));}if(_0x5e33c2<=0x0||isNaN(_0x5e33c2)){return _0x333904(msgResponse(_0x4e00('0x22c'),_0x4e00('0x51'),_0x4e00('0x230')+_0x5e33c2));}if(_0x47e94f<=0x0||isNaN(_0x47e94f)){return _0x333904(msgResponse(_0x4e00('0x22c'),_0x4e00('0x51'),_0x4e00('0x231')+_0x47e94f));}_0x24c016=_0x24c016||0x0;var _0x14c3f1=0x1/_0x5dffa1;var _0x89e55d=0x0;var _0x3acdff=0x0;var _0x4fd2bc=0x0;var _0xdb87bd=0x0;for(var _0x319058=0x0;_0x4fd2bc<_0x47e94f;_0x319058+=0x1){_0x3acdff=_0x319058/_0x5e33c2;_0x89e55d=(_0x1d47b0*_0x3acdff+_0x24c016)/_0x14c3f1;_0x4fd2bc=erlangb(_0x89e55d,_0x4718b2);_0xdb87bd=_0x89e55d/_0x4718b2*(0x1-erlangb(_0x89e55d,_0x4718b2));}return _0x27aa6e({'erlangCalls':_0x319058,'erlangCallToSecond':_0x5e33c2/_0x319058,'erlangAbandonmentRate':_0x4fd2bc,'erlangBusyFactor':_0xdb87bd});});};Dialer[_0x4e00('0x1b')][_0x4e00('0x1fd')]=function(_0x5b60e2,_0x57dd1f,_0x23b077,_0x4865e1,_0x10416c,_0x3a1148){loggerPredictive[_0x4e00('0x85')](_0x4e00('0x232'));loggerPredictive[_0x4e00('0x85')](_0x4e00('0x228'),_0x5b60e2);loggerPredictive[_0x4e00('0x85')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x57dd1f);loggerPredictive['info'](_0x4e00('0x22a'),_0x23b077);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4865e1);loggerPredictive['info'](_0x4e00('0x233'),_0x10416c);loggerPredictive[_0x4e00('0x85')](_0x4e00('0x8d'));return new Promise(function(_0x6c3cfc,_0x899534){if(_0x5b60e2<=0x0||isNaN(_0x5b60e2)){return _0x899534(msgResponse(_0x4e00('0x234'),'Error',_0x4e00('0x22d')+_0x5b60e2));}if(_0x23b077<=0x0||isNaN(_0x23b077)){return _0x899534(msgResponse(_0x4e00('0x234'),_0x4e00('0x51'),_0x4e00('0x22e')+_0x23b077));}if(_0x4865e1<=0x0||isNaN(_0x4865e1)){return _0x899534(msgResponse('[busyFactor]',_0x4e00('0x51'),_0x4e00('0x22f')+_0x4865e1));}if(_0x57dd1f<=0x0||isNaN(_0x57dd1f)){return _0x899534(msgResponse(_0x4e00('0x234'),_0x4e00('0x51'),_0x4e00('0x230')+_0x57dd1f));}if(_0x10416c<=0x0||isNaN(_0x10416c)){return _0x899534(msgResponse(_0x4e00('0x234'),'Error',_0x4e00('0x235')+_0x10416c));}_0x3a1148=_0x3a1148||0x0;var _0x44b6e2=0x1/_0x23b077;var _0x35171c=0x0;var _0x3606e0=0x0;var _0x5dbbb8=0x0;var _0x2a44bf=0x0;for(var _0x49360b=0x0;_0x2a44bf<_0x10416c;_0x49360b+=0x1){_0x3606e0=_0x49360b/_0x57dd1f;_0x35171c=(_0x4865e1*_0x3606e0+_0x3a1148)/_0x44b6e2;_0x5dbbb8=erlangb(_0x35171c,_0x5b60e2);_0x2a44bf=_0x35171c/_0x5b60e2*(0x1-erlangb(_0x35171c,_0x5b60e2));}return _0x6c3cfc({'erlangCalls':_0x49360b,'erlangCallToSecond':_0x57dd1f/_0x49360b,'erlangAbandonmentRate':_0x5dbbb8,'erlangBusyFactor':_0x2a44bf});});};module[_0x4e00('0x236')]=Dialer;
\ No newline at end of file
+var _0x867c=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','debug','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','endtime','clearZombieChannels','[uniqueid]','actions','[actions]','enqueue','isNil','Action','channel','catch','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','verifyAdditionalPhones','[verifyAdditionalPhone]\x20','swapAdditionalPhones','[swapAdditionalPhone]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','pick','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','status','unmonitored','saveInDb','syncVarSet','variable','exten','xcally-motion-dialer','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','uniqueid','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','add','minutes','ContactId','ListId','[rescheduleContact][Machine]','dialAMDActive','value','statedesc','amd','[syncHangupInAMDIvr]','outboundAnswerCallsDay','countnoanswerretry','dialMachineMaxRetry','createStateFinal','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','Unknow','reason','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','voiceQueue','additional','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','CALLEREXIT','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','Abandoned','actionid','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','loopCampaigns','resetActiveCalls','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','isArray','iftime\x20%s,%s','interval','timezones','content','indexOf','true','command','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','checkPreviewRecallReminder','handlePreviewRecallNotifications','Agent','user:%s','launchHandleIvr','checkIfTime','dialGlobalInterval','dialTimezone','syncQueueSummaryComplete','throttle','filter','dialPreviewRecallmeReminder','online','map','user:dialPreviewRecallReminder','syncCampaigns','[syncCampaigns]','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','dialQueueProject2','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','variables','trim','dialCutDigit','substring','SIP/%s/%s%s','[originateError]:\x20%s','[originate][error]','Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMinThreshold','talking','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','dialPredictiveInterval','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','averageHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','check\x20failure','startMethodPredictive','floor','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','voicePause','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','ACTIVE','RUNNING','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','lodash','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','redis','defaults','socket.io-emitter','../rpc/cmHopperAdditionalPhone','./action','./history','./final','./agentComplete','./queueCallerAbandon','env','127.0.0.1','rrmemory','roundrobin','prototype','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','hangup','syncHangup','newexten','syncNewExten','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','then','previewRecallmeReminderInterval','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit'];(function(_0x1beb25,_0x52432e){var _0x4ce3c8=function(_0x2296e4){while(--_0x2296e4){_0x1beb25['push'](_0x1beb25['shift']());}};_0x4ce3c8(++_0x52432e);}(_0x867c,0x1ca));var _0xc867=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x867c[_0x1ca9e9];return _0x309f3c;};'use strict';var util=require('util');var _=require(_0xc867('0x0'));var uuid=require(_0xc867('0x1'));var moment=require(_0xc867('0x2'));var rr=require('rr');var md5=require(_0xc867('0x3'));var Redis=require(_0xc867('0x4'));var ut=require(_0xc867('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xc867('0x6'));var loggerBooked=require('../../../config/logger')(_0xc867('0x7'));var loggerPredictive=require(_0xc867('0x8'))(_0xc867('0x9'));var loggerPredictiveCalls=require(_0xc867('0x8'))(_0xc867('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc867('0xb'));var ami=require('../ami');config[_0xc867('0xc')]=_[_0xc867('0xd')](config[_0xc867('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0xc867('0xe'))(new Redis(config[_0xc867('0xc')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperAdditionalPhone=require(_0xc867('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var RpcSetting=require('../rpc/setting');var Action=require(_0xc867('0x10'));var History=require(_0xc867('0x11'));var Final=require(_0xc867('0x12'));var AgentComplete=require(_0xc867('0x13'));var QueueCallerAbandon=require(_0xc867('0x14'));var Hangup=require('./hangup');var ipAgi=process[_0xc867('0x15')]['XCALLY_IP_AGI']||_0xc867('0x16');var strategy={'rrmemory':_0xc867('0x17'),'roundrobin':_0xc867('0x18')};var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0xc867('0x19')]['enqueue']=function(_0xce0f7d){this[_0xc867('0x1a')]=this[_0xc867('0x1a')]?this['tail']['finally'](_0xce0f7d):_0xce0f7d();};function Dialer(_0x480da6,_0x223a80){this[_0xc867('0x1b')]=new Sequence();this[_0xc867('0x1c')]=_0x223a80;this[_0xc867('0x1d')]=_0x480da6[_0xc867('0x1d')];this[_0xc867('0x1e')]=_0x480da6[_0xc867('0x1e')];this[_0xc867('0x1f')]=_0x480da6[_0xc867('0x1f')];this[_0xc867('0x20')]=_0x480da6['trunks'];this[_0xc867('0x21')]=config['maxNumberOriginate']||0x2;this[_0xc867('0x22')]={};this['actions']={};this[_0xc867('0x23')]={};this[_0xc867('0x24')]={};this[_0xc867('0x25')]={};this[_0xc867('0x26')]={};this[_0xc867('0x27')]={};this[_0xc867('0x28')]={};this['queueBooked']={};this[_0xc867('0x29')]={};ami['on'](_0xc867('0x2a'),this['syncAgentConnect'][_0xc867('0x2b')](this));ami['on'](_0xc867('0x2c'),this[_0xc867('0x2d')][_0xc867('0x2b')](this));ami['on'](_0xc867('0x2e'),this[_0xc867('0x2f')][_0xc867('0x2b')](this));ami['on']('agentcomplete',this[_0xc867('0x30')]['bind'](this));ami['on'](_0xc867('0x31'),this[_0xc867('0xb')][_0xc867('0x2b')](this));ami['on'](_0xc867('0x32'),this['syncQueueSummaryComplete'][_0xc867('0x2b')](this));ami['on'](_0xc867('0x33'),this[_0xc867('0x34')]['bind'](this));ami['on'](_0xc867('0x35'),this[_0xc867('0x36')][_0xc867('0x2b')](this));ami['on']('varset',this['syncVarSet'][_0xc867('0x2b')](this));ami['on']('queuemember',this[_0xc867('0x37')][_0xc867('0x2b')](this));ami['on'](_0xc867('0x38'),this[_0xc867('0x39')][_0xc867('0x2b')](this));this['loopCampaigns']();this[_0xc867('0x3a')]();RpcSetting['getSettings']()[_0xc867('0x3b')](function(_0x3fc0c1){previewRecallmeReminderInterval=_0x3fc0c1[_0xc867('0x3c')];});}function isNotNull(_0x5206ed){return _0x5206ed!==null&&!_[_0xc867('0x3d')](_0x5206ed);}function checkIsLoggedIn(_0x358514,_0x78c88e){return function(){if(_0x78c88e<=0x0){_0x358514[_0xc867('0x3e')]=_0xc867('0x3f');throw _0x358514[_0xc867('0x40')]+_0xc867('0x41');}};}function isActive(_0x28a2c5){return _0x28a2c5;}function checkIsActive(_0x4e2e10,_0x34d9c7){return function(){if(!isActive(_0x34d9c7)){_0x4e2e10['message']=_0xc867('0x42');throw _0x4e2e10['name']+'\x20NOT\x20Active';}};}function checkInterval(_0x464c5c){return function(){if(!isNotNull(_0x464c5c[_0xc867('0x43')])){_0x464c5c[_0xc867('0x3e')]=_0xc867('0x44');throw _0x464c5c['name']+_0xc867('0x45');}if(!isNotNull(_0x464c5c['Interval'][_0xc867('0x46')])){_0x464c5c[_0xc867('0x3e')]='INTERVAL_IS_NULL';throw _0x464c5c[_0xc867('0x40')]+_0xc867('0x45');}if(!isNotNull(_['isEmpty'](_0x464c5c[_0xc867('0x43')][_0xc867('0x46')]))){_0x464c5c[_0xc867('0x3e')]='INTERVAL_IS_NULL';throw _0x464c5c[_0xc867('0x40')]+_0xc867('0x45');}};}function msgResponse(_0x22b400,_0x5aabb7,_0xb8dfa3){return{'action':_0x22b400,'response':_0x5aabb7,'message':_0xb8dfa3,'stack':_0xb8dfa3};}function myreject(_0x5b6787){return function(_0x506866){return _0x5b6787(msgResponse('[ifTime][Action]','Error',JSON['stringify'](_0x506866)));};}function getSeconds(_0x508402,_0x279ef5){var _0x454374=moment(_0x508402)[_0xc867('0x47')](0x0);var _0x33a05d=moment(_0x279ef5)['milliseconds'](0x0);return _0x454374[_0xc867('0x48')](_0x33a05d,_0xc867('0x49'));}function emit(_0x1f0793,_0x40d1a7,_0x2aa8b2){io['to'](_0x1f0793)[_0xc867('0x4a')](_0x40d1a7,_0x2aa8b2);}function emitVoiceQueueSummary(_0x1d2c8e){if(_0x1d2c8e[_0xc867('0x4b')]===_0xc867('0x4c')){var _0x36d31b={'id':_0x1d2c8e['id'],'name':_0x1d2c8e[_0xc867('0x40')],'strategy':_0x1d2c8e[_0xc867('0x4d')],'answered':_0x1d2c8e[_0xc867('0x4e')],'available':_0x1d2c8e[_0xc867('0x4f')],'loggedIn':_0x1d2c8e[_0xc867('0x50')],'pTalking':_0x1d2c8e[_0xc867('0x51')],'sumBillable':_0x1d2c8e[_0xc867('0x52')],'sumDuration':_0x1d2c8e[_0xc867('0x53')],'sumHoldTime':_0x1d2c8e[_0xc867('0x54')]||0x0,'talking':_0x1d2c8e['talking'],'total':_0x1d2c8e['total'],'type':_0x1d2c8e[_0xc867('0x4b')],'unmanaged':_0x1d2c8e['unmanaged'],'abandoned':_0x1d2c8e[_0xc867('0x55')],'waiting':_0x1d2c8e[_0xc867('0x56')],'loggedInDb':_0x1d2c8e[_0xc867('0x57')],'dialActive':_0x1d2c8e[_0xc867('0x58')],'dialMethod':_0x1d2c8e[_0xc867('0x59')],'dialOriginateCallerIdName':_0x1d2c8e['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1d2c8e['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1d2c8e['dialOriginateTimeout'],'dialPrefix':_0x1d2c8e[_0xc867('0x5a')],'outboundAnswerAgiCallsDay':_0x1d2c8e[_0xc867('0x5b')],'outboundAnswerCallsDay':_0x1d2c8e['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1d2c8e[_0xc867('0x5c')],'outboundBusyCallsDay':_0x1d2c8e['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1d2c8e[_0xc867('0x5d')],'outboundDropCallsDayACS':_0x1d2c8e['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1d2c8e[_0xc867('0x5e')],'outboundDropCallsDayTimeout':_0x1d2c8e[_0xc867('0x5f')],'outboundNoAnswerCallsDay':_0x1d2c8e[_0xc867('0x60')],'outboundNoSuchCallsDay':_0x1d2c8e[_0xc867('0x61')],'outboundOriginateFailureCallsDay':_0x1d2c8e[_0xc867('0x62')],'outboundReCallsDay':_0x1d2c8e[_0xc867('0x63')],'outboundRejectCallsDay':_0x1d2c8e['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1d2c8e[_0xc867('0x64')],'predictiveIntervalAnsweredCalls':_0x1d2c8e['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1d2c8e[_0xc867('0x65')],'predictiveIntervalAvgTalktime':_0x1d2c8e[_0xc867('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x1d2c8e['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x1d2c8e[_0xc867('0x67')],'predictiveIntervalErlangCalls':_0x1d2c8e[_0xc867('0x68')],'predictiveIntervalErlangCallsDroppedCalls':_0x1d2c8e[_0xc867('0x69')],'predictiveIntervalHitRate':_0x1d2c8e[_0xc867('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x1d2c8e['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1d2c8e[_0xc867('0x6b')],'predictiveIntervalAvailable':_0x1d2c8e[_0xc867('0x6c')],'predictiveIntervalTotalCalls':_0x1d2c8e[_0xc867('0x6d')],'message':_0x1d2c8e['message'],'originated':_0x1d2c8e['originated'],'erlangCalls':_0x1d2c8e['erlangCalls'],'erlangCallToSecond':_0x1d2c8e['erlangCallToSecond'],'erlangAbandonmentRate':_0x1d2c8e[_0xc867('0x6e')],'erlangBusyFactor':_0x1d2c8e[_0xc867('0x6f')],'startPredictive':_0x1d2c8e[_0xc867('0x26')],'startProgressive':_0x1d2c8e[_0xc867('0x27')]};if(_0x1d2c8e[_0xc867('0x70')]){_0x36d31b[_0xc867('0x70')]={'id':_0x1d2c8e[_0xc867('0x70')]['id'],'name':_0x1d2c8e['Trunk'][_0xc867('0x40')],'active':_0x1d2c8e[_0xc867('0x70')][_0xc867('0x71')],'callerid':_0x1d2c8e[_0xc867('0x70')][_0xc867('0x72')]};}if(_0x1d2c8e[_0xc867('0x43')]){_0x36d31b[_0xc867('0x43')]={'id':_0x1d2c8e[_0xc867('0x43')]['id'],'name':_0x1d2c8e[_0xc867('0x43')][_0xc867('0x40')]};}var _0x22ad4b=md5(JSON[_0xc867('0x73')](_0x36d31b));if(_0x1d2c8e[_0xc867('0x3')]!==_0x22ad4b){_0x1d2c8e['md5']=_0x22ad4b;emit(util[_0xc867('0x74')](_0xc867('0x75'),_0x36d31b['name']),'voice_queue:save',_0x36d31b);}}}function emitCampaignSummary(_0x4baacf){if(_0x4baacf[_0xc867('0x4b')]===_0xc867('0x76')){emit(util[_0xc867('0x74')](_0xc867('0x77'),_0x4baacf['name']),_0xc867('0x78'),_0x4baacf);}}function checkGetDataPredictive(_0x5d1b14){if(isNotNull(_0x5d1b14)&&!_['isEmpty'](_0x5d1b14)){loggerPredictive[_0xc867('0x79')](_0xc867('0x7a'));loggerPredictive[_0xc867('0x79')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d1b14['predictiveIntervalTotalCalls']);loggerPredictive[_0xc867('0x79')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d1b14[_0xc867('0x7b')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x7c'),_0x5d1b14[_0xc867('0x67')]);loggerPredictive['info'](_0xc867('0x7d'),_0x5d1b14[_0xc867('0x7e')]);loggerPredictive['info'](_0xc867('0x7f'),_0x5d1b14[_0xc867('0x65')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x80'),_0x5d1b14[_0xc867('0x66')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x81'));if(_0x5d1b14[_0xc867('0x6d')]>0x0){if(!_[_0xc867('0x3d')](_0x5d1b14[_0xc867('0x66')])&&_0x5d1b14[_0xc867('0x66')]>0x0){return!![];}loggerPredictive[_0xc867('0x79')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_['isUndefined'](_0x5d1b14[_0xc867('0x65')])&&_0x5d1b14['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0xc867('0x79')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0xc867('0x82'));}}else{loggerPredictive[_0xc867('0x79')](_0xc867('0x83'));}return![];}function mergeDataErlangB(_0x28e85e){return function(_0x521581){loggerPredictive[_0xc867('0x79')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc867('0x79')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x521581[_0xc867('0x84')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x85'),_0x521581[_0xc867('0x86')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x87'),_0x521581[_0xc867('0x6e')]);loggerPredictive[_0xc867('0x79')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x521581[_0xc867('0x6f')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x87'),_0x521581[_0xc867('0x6e')]);loggerPredictive[_0xc867('0x79')](_0xc867('0x81'));_[_0xc867('0x88')](_0x28e85e,_0x521581);};}function getDiff(_0x13a38f){var _0xb7da56=moment()[_0xc867('0x47')](0x0);var _0x3e3933=moment(_0x13a38f)['milliseconds'](0x0);return _0xb7da56['diff'](_0x3e3933,'seconds');}function ifInterval(_0x159478,_0x3da03e){if(_[_0xc867('0x3d')](_0x3da03e)){return![];}return getDiff(_0x3da03e)<_0x159478*0x3c;}function freeVariablesPredictive(_0x403499){if(isNotNull(_0x403499)){if(!_[_0xc867('0x3d')](_0x403499[_0xc867('0x27')])){_0x403499[_0xc867('0x27')]=undefined;loggerPredictive[_0xc867('0x79')](_0x403499[_0xc867('0x40')],_0xc867('0x89'));}if(!_[_0xc867('0x3d')](_0x403499['startPredictive'])){_0x403499[_0xc867('0x26')]=undefined;loggerPredictive[_0xc867('0x79')](_0x403499[_0xc867('0x40')],_0xc867('0x8a'));}if(!_[_0xc867('0x3d')](_0x403499[_0xc867('0x8b')])){clearInterval(_0x403499[_0xc867('0x8b')]);_0x403499[_0xc867('0x8b')]=undefined;loggerPredictive[_0xc867('0x79')](_0x403499[_0xc867('0x40')],_0xc867('0x8c'));}}}function erlangb(_0x23cd77,_0x16be7c){if(_0x16be7c===0x0){return 0x0;}var _0x58218c=0x1;for(var _0x1f01e3=0x1;_0x1f01e3<=_0x16be7c;_0x1f01e3+=0x1){_0x58218c=0x1+_0x58218c*_0x1f01e3/_0x23cd77;}return 0x1/_0x58218c;}function isVoiceQueueOutbound(_0x53eddf){return _0x53eddf==='outbound';}function isNotPreview(_0x294b5e){return _0x294b5e!=='preview';}function isCampaignIvr(_0x160808){return _0x160808===_0xc867('0x76');}function getCallerId(_0x5c4d32,_0x2ad3c6,_0x11dd06){if(!_[_0xc867('0x3d')](_0x11dd06)&&typeof _0x11dd06===_0xc867('0x8d')&&!_[_0xc867('0x8e')](_0x11dd06)){if(!_[_0xc867('0x3d')](_0x2ad3c6)&&typeof _0x2ad3c6===_0xc867('0x8d')&&!_[_0xc867('0x8e')](_0x2ad3c6)){return util['format'](_0xc867('0x8f'),_0x2ad3c6,_0x11dd06);}return util[_0xc867('0x74')](_0xc867('0x8f'),_0x11dd06,_0x11dd06);}if(!_['isUndefined'](_0x5c4d32)&&typeof _0x5c4d32===_0xc867('0x8d')&&!_['isEmpty'](_0x5c4d32)){return _0x5c4d32;}return _0xc867('0x90');}function loggerCatchQueueSummary(_0x450d72,_0x154487){return function(_0x46aee6){freeVariablesPredictive(_0x154487);emitVoiceQueueSummary(_0x154487);emitCampaignSummary(_0x154487);loggerSyncQueueSummary['debug'](_0x450d72,util[_0xc867('0x91')](_0x46aee6,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2c43b1,_0x5053d0){return function(_0x192c01){loggerPredictive[_0xc867('0x92')](_0x5053d0[_0xc867('0x40')],_0x2c43b1);loggerPredictive['error'](_0x192c01[_0xc867('0x93')]);freeVariablesPredictive(_0x5053d0);};}function loggerCatch(_0x1a3b2e){return function(_0x240a25){logger[_0xc867('0x92')](_0x1a3b2e,util[_0xc867('0x91')](_0x240a25,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5d8dd0){return _0x5d8dd0&&!_[_0xc867('0x3d')](_0x5d8dd0)&&_0x5d8dd0[_0xc867('0x94')]>0x0;}function decremetOriginate(_0x2e881c){if(!_[_0xc867('0x3d')](_0x2e881c)&&_0x2e881c!==null){if(typeof _0x2e881c[_0xc867('0x95')]!==_0xc867('0x96')){if(_0x2e881c[_0xc867('0x95')]>0x0){_0x2e881c['originated']-=0x1;}else{logger[_0xc867('0x92')](_0xc867('0x97'));}}}else{logger['error'](_0xc867('0x98'));}}function checkContactLowerLimitOriginate(_0x94cbe4,_0xe872b5,_0xd6d34f){if(_0xe872b5>_0xd6d34f){for(var _0x48ac57=0x0;_0x48ac57<_0xe872b5-_0xd6d34f;_0x48ac57+=0x1){decremetOriginate(_0x94cbe4);}}}function loggerGetContactDialer(_0x5e1f26,_0x486911,_0x524a57){return function(_0x3fc292){checkContactLowerLimitOriginate(_0x486911,_0x524a57,0x0);logger[_0xc867('0x92')](_0x5e1f26,util[_0xc867('0x91')](_0x3fc292,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0xd3f67e){return function(_0x352b63){if(isNotNull(_0x352b63)&&isNotNull(_0x352b63[0x0])){if(_0x352b63[0x0][_0xc867('0x99')]>0x0){_0xd3f67e['message']=_0xc867('0x9a');logger['info'](_0xc867('0x9b')+_0xd3f67e[_0xc867('0x40')],_0x352b63[0x0][_0xc867('0x99')],_0xc867('0x9c'));}else{_0xd3f67e[_0xc867('0x3e')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0xc867('0x9d')+_0xd3f67e[_0xc867('0x40')]);}}};}function notSendMessagesQueue(_0x4a0174){if(_0x4a0174[_0xc867('0x9e')]){freeVariablesPredictive(_0x4a0174);if(_0x4a0174[_0xc867('0x95')]===0x0&&_0x4a0174['talking']===0x0&&_0x4a0174[_0xc867('0x56')]===0x0&&(_0x4a0174[_0xc867('0x51')]||0x0)===0x0){_0x4a0174[_0xc867('0x9e')]=![];_0x4a0174[_0xc867('0x4f')]=0x0;_0x4a0174[_0xc867('0x3e')]=_0xc867('0x42');loggerSyncQueueSummary[_0xc867('0x9f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x4a0174[_0xc867('0x40')],_0xc867('0xa0'));}else{_0x4a0174[_0xc867('0x3e')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc867('0x9f')](_0xc867('0xa1'),_0x4a0174['name'],_0xc867('0xa2'));}emitVoiceQueueSummary(_0x4a0174);}}function notSendMessagesCampaign(_0x2ec649){if(_0x2ec649[_0xc867('0x9e')]){if(_0x2ec649[_0xc867('0x95')]===0x0){_0x2ec649[_0xc867('0x9e')]=![];_0x2ec649[_0xc867('0x3e')]=_0xc867('0x42');loggerSyncQueueSummary[_0xc867('0x9f')](_0xc867('0xa3'),_0x2ec649[_0xc867('0x40')],_0xc867('0xa0'));}else{_0x2ec649[_0xc867('0x3e')]=_0xc867('0xa4');loggerSyncQueueSummary[_0xc867('0x9f')](_0xc867('0xa3'),_0x2ec649[_0xc867('0x40')],_0xc867('0xa2'));}emitCampaignSummary(_0x2ec649);}}function createObjHistory(_0x3e1dd9,_0xb0cdd,_0x19e9df,_0xee3aab,_0x5bbcf6){_0x3e1dd9[_0xc867('0x3e')]=_0x19e9df;var _0x3ec2f2=new Action(_0x3e1dd9,_0xb0cdd);var _0x3cd34a=new History(_0x3ec2f2);_0x3cd34a[_0xc867('0xa5')]=_0xee3aab;_0x3cd34a['statedesc']=_0x5bbcf6;_0x3cd34a[_0xc867('0xa6')]=_0x3ec2f2['starttime'];return _0x3cd34a;}Dialer[_0xc867('0x19')]['loopClearZombieChannels']=function(){var _0x792d6=this;setInterval(function(){_0x792d6[_0xc867('0xa7')](_0x792d6[_0xc867('0x24')],_0xc867('0xa8'));_0x792d6[_0xc867('0xa7')](_0x792d6[_0xc867('0xa9')],_0xc867('0xaa'));},0x32c8);};Dialer[_0xc867('0x19')][_0xc867('0xa7')]=function(_0x29a7fd,_0x589f68){var _0x1d35af=this;for(var _0x372c24 in _0x29a7fd){if(typeof _0x29a7fd[_0x372c24]!==_0xc867('0x96')){this[_0xc867('0x1b')][_0xc867('0xab')](function(){if(!_[_0xc867('0xac')](_0x29a7fd[_0x372c24])){return ami[_0xc867('0xad')]({'action':'status','channel':_0x29a7fd[_0x372c24][_0xc867('0xae')]})[_0xc867('0xaf')](function(_0x2fa07d){if(_0x2fa07d[_0xc867('0x3e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x29a7fd[_0x372c24]&&_0x29a7fd[_0x372c24][_0xc867('0x4b')]!=='ivr'){_0x1d35af[_0xc867('0xb0')](_0x1d35af['voiceQueues'][_0x29a7fd[_0x372c24][_0xc867('0xb1')]]);logger[_0xc867('0x92')](_0xc867('0xb2'),_0x589f68,_0x372c24,_0x29a7fd[_0x372c24][_0xc867('0xb1')]);delete _0x29a7fd[_0x372c24];}if(_0x29a7fd[_0x372c24]&&_0x29a7fd[_0x372c24][_0xc867('0x4b')]==='ivr'){_0x1d35af['updateOriginated'](_0x1d35af[_0xc867('0x1e')][_0x29a7fd[_0x372c24][_0xc867('0xb1')]]);logger[_0xc867('0x92')](_0xc867('0xb3'),_0x589f68,_0x372c24,_0x29a7fd[_0x372c24][_0xc867('0xb1')]);delete _0x29a7fd[_0x372c24];}},0x2328);}});}});}}};Dialer['prototype'][_0xc867('0xb4')]=function(_0x5d128d){return Promise[_0xc867('0xb5')]()['then'](cmHopper['countReScheduled'](_0x5d128d))['catch'](loggerCatch(_0xc867('0xb6')));};Dialer[_0xc867('0x19')][_0xc867('0xb7')]=function(_0x5b27f5){return Promise['resolve']()[_0xc867('0x3b')](cmHopperBlack[_0xc867('0xb7')](_0x5b27f5))['catch'](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0xc867('0x19')][_0xc867('0xb8')]=function(_0x319408,_0x6ea257,_0x2110a2){return Promise['resolve']()[_0xc867('0x3b')](cmHopperAdditionalPhone[_0xc867('0xb8')](_0x319408,_0x6ea257,_0x2110a2))[_0xc867('0xaf')](loggerCatch(_0xc867('0xb9')));};Dialer['prototype'][_0xc867('0xba')]=function(_0x1e2f18,_0x2e8a1d,_0x2a733f){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopperAdditionalPhone[_0xc867('0xba')](_0x1e2f18,_0x2e8a1d,_0x2a733f))[_0xc867('0xaf')](loggerCatch(_0xc867('0xbb')));};Dialer[_0xc867('0x19')]['checkIsBlackListIvr']=function(_0x4dde67){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopperBlack[_0xc867('0xbc')](_0x4dde67))['catch'](loggerCatch(_0xc867('0xbd')));};Dialer['prototype']['averageHandleTime']=function(_0x5eba41){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopperHistory['avgHandleTime'](_0x5eba41))['catch'](loggerCatch(_0xc867('0xbe')));};Dialer[_0xc867('0x19')][_0xc867('0xbf')]=function(_0x157617){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper['rescheduleContact'](_0x157617))[_0xc867('0xaf')](loggerCatch(_0xc867('0xc0')));};Dialer[_0xc867('0x19')]['unlockContact']=function(_0x2e1f83,_0x2dd7f6,_0x50f9d1){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper[_0xc867('0xc1')](_0x2e1f83,_0x2dd7f6,_0x50f9d1))[_0xc867('0xaf')](loggerCatch('[unlockContact]\x20'));};Dialer['prototype'][_0xc867('0xc2')]=function(_0x57a45c,_0x15a4fa,_0x1d3f75,_0xace2cf,_0x97f92b){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper[_0xc867('0xc2')](_0x57a45c,_0x15a4fa,_0x1d3f75,_0xace2cf))[_0xc867('0xaf')](function(_0x2213f9){_0x97f92b[_0xc867('0xc3')]-=_0x1d3f75;_0x97f92b[_0xc867('0xc3')]=_0x97f92b[_0xc867('0xc3')]>0x0?_0x97f92b[_0xc867('0xc3')]:0x0;loggerCatch(_0xc867('0xc4'))(_0x2213f9);});};Dialer[_0xc867('0x19')][_0xc867('0xc5')]=function(_0x20e645,_0x2230fd,_0x5c86ed,_0x2323bc){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper[_0xc867('0xc5')](_0x20e645,_0x2230fd,_0x5c86ed))[_0xc867('0xaf')](function(_0x39e240){_0x2323bc[_0xc867('0xc3')]-=_0x2230fd;_0x2323bc['temp']=_0x2323bc[_0xc867('0xc3')]>0x0?_0x2323bc[_0xc867('0xc3')]:0x0;loggerCatch(_0xc867('0xc6'))(_0x39e240);});};Dialer[_0xc867('0x19')][_0xc867('0xc7')]=function(_0x218d12){return Promise['resolve']()[_0xc867('0x3b')](voiceQueueRt[_0xc867('0xc7')](_0x218d12))[_0xc867('0xaf')](loggerCatch(_0xc867('0xc8')));};Dialer[_0xc867('0x19')][_0xc867('0xc9')]=function(_0x23bc2b){return Promise['resolve']()[_0xc867('0x3b')](cmHopper['moveContactManagedDialer'](_0x23bc2b))[_0xc867('0xaf')](loggerCatch(_0xc867('0xca')));};Dialer[_0xc867('0x19')][_0xc867('0xcb')]=function(_0x3a8d11){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopperHistory['createHistory'](_0x3a8d11))[_0xc867('0xaf')](loggerCatch(_0xc867('0xcc')));};Dialer['prototype']['updateOriginated']=function(_0x1b66d7){if(!_[_0xc867('0x3d')](_0x1b66d7)&&_0x1b66d7!==null){if(typeof _0x1b66d7[_0xc867('0x95')]!=='undefined'){if(_0x1b66d7[_0xc867('0x95')]>0x0){_0x1b66d7[_0xc867('0x95')]-=0x1;}else{logger[_0xc867('0x92')](_0xc867('0xcd'));}}}else{logger[_0xc867('0x92')](_0xc867('0xce'));}};Dialer['prototype'][_0xc867('0xcf')]=function(_0x2263a6,_0x5db0d9){var _0x1eccff=this;return function(_0x4bf5e0){_0x1eccff['updateOriginated'](_0x5db0d9);logger[_0xc867('0x92')](_0x2263a6,util[_0xc867('0x91')](_0x4bf5e0,{'showHidden':![],'depth':null}));};};Dialer[_0xc867('0x19')][_0xc867('0xd0')]=function(_0x5e822a,_0x4655d5,_0x1b08cc){var _0x2c70f3={'state':0x19,'statedesc':_0xc867('0xd1')};this[_0xc867('0xb0')](_0x4655d5);this['saveInDb'](_[_0xc867('0x88')](_0x2c70f3,_[_0xc867('0xd2')](_0x1b08cc,['ContactId','ListId',_0xc867('0xd3'),_0xc867('0xd4'),_0xc867('0xd5')])),_0xc867('0xd6'),_0xc867('0xd7'));logger[_0xc867('0x92')](_0x5e822a);};Dialer[_0xc867('0x19')][_0xc867('0xd8')]=function(_0x3720ee){return _0x3720ee===_0xc867('0xd9');};Dialer[_0xc867('0x19')][_0xc867('0xda')]=function(_0x185da0){return!_[_0xc867('0x3d')](_0x185da0)&&_0x185da0&&!_['isUndefined'](_0x185da0[_0xc867('0x40')])&&!_[_0xc867('0x3d')](_0x185da0[_0xc867('0x71')])&&_0x185da0['active']&&(this['trunks'][util[_0xc867('0x74')](_0xc867('0xdb'),_0x185da0[_0xc867('0x40')])]['status']===_0xc867('0xdc')||this[_0xc867('0x20')][util[_0xc867('0x74')](_0xc867('0xdb'),_0x185da0['name'])][_0xc867('0xdd')]===_0xc867('0xde'));};Dialer[_0xc867('0x19')][_0xc867('0xdf')]=function(_0x443430,_0x4be0a6,_0x5a8071){this[_0xc867('0xcb')](_0x443430)['catch'](loggerCatch(_0x4be0a6));this['moveContactManagedDialer'](_0x443430)[_0xc867('0xaf')](loggerCatch(_0x5a8071));};Dialer['prototype'][_0xc867('0xe0')]=function(_0x679331){var _0x4b0f8a=this;var _0x287d5f=this[_0xc867('0x24')][_0x679331['uniqueid']];var _0x3436dd;if(!_[_0xc867('0xac')](_0x679331)&&!_[_0xc867('0xac')](_0x679331[_0xc867('0xe1')])&&!_[_0xc867('0xac')](_0x679331[_0xc867('0xe1')]['amdstatus'])&&_0x679331[_0xc867('0xe2')]===_0xc867('0xe3')&&_0x287d5f){if(_0x287d5f[_0xc867('0x4b')]!==_0xc867('0x76')&&this[_0xc867('0x1d')][_0x287d5f['queue']]['dialAMDActive']&&_0x679331['value']===_0xc867('0xe4')){delete this[_0xc867('0x24')][_0x679331['uniqueid']];this[_0xc867('0xb0')](this[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]]);this[_0xc867('0x1d')][_0x287d5f['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]][_0xc867('0x5b')]+=0x1;_0x3436dd=new Hangup(_0x287d5f,_0x679331);_0x3436dd[_0xc867('0xa5')]=0x12;_0x3436dd['statedesc']=_0xc867('0xe5');_0x3436dd[_0xc867('0xe6')]=_0xc867('0xe7');ami[_0xc867('0x4a')](_0xc867('0xe8'),ut[_0xc867('0xe9')](_0x3436dd,'amd'));this[_0xc867('0xdf')](_0x3436dd,_0xc867('0xea'),_0xc867('0xeb'));}if(_0x287d5f[_0xc867('0x4b')]!==_0xc867('0x76')&&this[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]]['dialAMDActive']&&_0x679331['value']===_0xc867('0xec')){return new Promise(function(_0x3e1761,_0x468e74){delete _0x4b0f8a[_0xc867('0x24')][_0x679331[_0xc867('0xed')]];_0x4b0f8a[_0xc867('0xb0')](_0x4b0f8a[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]]);_0x4b0f8a[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]]['outboundAnswerCallsDay']+=0x1;_0x4b0f8a[_0xc867('0x1d')][_0x287d5f[_0xc867('0xb1')]][_0xc867('0x5b')]+=0x1;var _0x34df44=_0x4b0f8a['voiceQueues'][_0x287d5f[_0xc867('0xb1')]];var _0x561356=new Hangup(_0x287d5f,_0x679331);_0x561356[_0xc867('0xa5')]=0x13;_0x561356['statedesc']=_0xc867('0xee');_0x561356[_0xc867('0xe6')]=_0xc867('0xe7');_0x561356[_0xc867('0xef')]+=0x1;_0x561356[_0xc867('0xf0')]+=0x1;_0x561356['amd']=!![];ami[_0xc867('0x4a')](_0xc867('0xe8'),ut[_0xc867('0xe9')](_0x561356,'amd'));_0x4b0f8a[_0xc867('0xcb')](_0x561356)['catch'](loggerCatch(_0xc867('0xf1')));if(_0x561356[_0xc867('0xf2')]+_0x561356[_0xc867('0xf3')]+_0x561356['countnoanswerretry']+_0x561356[_0xc867('0xf4')]+_0x561356[_0xc867('0xf5')]+_0x561356[_0xc867('0xf6')]+_0x561356[_0xc867('0xef')]+_0x561356[_0xc867('0xf7')]>=_0x34df44[_0xc867('0xf8')]){_0x4b0f8a[_0xc867('0xf9')](_0x561356,_0x3e1761,_0x468e74,_0xc867('0xfa'));}else{if(_0x561356[_0xc867('0xef')]>=_0x34df44['dialMachineMaxRetry']){_0x4b0f8a['createStateFinal'](_0x561356,_0x3e1761,_0x468e74,_0xc867('0xfb'));}else{_0x4b0f8a[_0xc867('0xbf')]({'active':![],'countmachineretry':_0x561356[_0xc867('0xef')],'scheduledat':moment()[_0xc867('0xfc')](_0x34df44['dialMachineRetryFrequency'],_0xc867('0xfd'))[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x561356[_0xc867('0xfe')],'ListId':_0x561356[_0xc867('0xff')],'VoiceQueueId':_0x561356['VoiceQueueId']||undefined,'CampaignId':_0x561356[_0xc867('0xd5')]||undefined})['catch'](loggerCatch(_0xc867('0x100')));_0x3e1761({'reschedule':0x1});}}});}if(_0x287d5f[_0xc867('0x4b')]===_0xc867('0x76')&&this[_0xc867('0x1e')][_0x287d5f['queue']][_0xc867('0x101')]&&_0x679331[_0xc867('0x102')]===_0xc867('0xe4')){delete this[_0xc867('0x24')][_0x679331[_0xc867('0xed')]];this[_0xc867('0xb0')](this['campaigns'][_0x287d5f['queue']]);_0x3436dd=new Hangup(_0x287d5f,_0x679331);_0x3436dd['state']=0x12;_0x3436dd[_0xc867('0x103')]=_0xc867('0xe5');_0x3436dd[_0xc867('0xe6')]=_0xc867('0xe7');ami['emit'](_0xc867('0xe8'),ut[_0xc867('0xe9')](_0x3436dd,_0xc867('0x104')));this[_0xc867('0xdf')](_0x3436dd,'[syncHangupInAMDIvr][createHistory]',_0xc867('0x105'));}if(_0x287d5f[_0xc867('0x4b')]==='ivr'&&this[_0xc867('0x1e')][_0x287d5f[_0xc867('0xb1')]][_0xc867('0x101')]&&_0x679331[_0xc867('0x102')]===_0xc867('0xec')){return new Promise(function(_0x40fb52,_0x15f4d3){delete _0x4b0f8a[_0xc867('0x24')][_0x679331[_0xc867('0xed')]];_0x4b0f8a['updateOriginated'](_0x4b0f8a[_0xc867('0x1e')][_0x287d5f[_0xc867('0xb1')]]);_0x4b0f8a[_0xc867('0x1e')][_0x287d5f[_0xc867('0xb1')]][_0xc867('0x106')]+=0x1;_0x4b0f8a[_0xc867('0x1e')][_0x287d5f[_0xc867('0xb1')]][_0xc867('0x5b')]+=0x1;var _0x6f912a=_0x4b0f8a[_0xc867('0x1e')][_0x287d5f['queue']];var _0x73bb3c=new Hangup(_0x287d5f,_0x679331);_0x73bb3c['state']=0x13;_0x73bb3c['statedesc']=_0xc867('0xee');_0x73bb3c[_0xc867('0xe6')]='AMD';_0x73bb3c['countmachineretry']+=0x1;_0x73bb3c[_0xc867('0xf0')]+=0x1;_0x73bb3c[_0xc867('0x104')]=!![];ami[_0xc867('0x4a')]('custom:amd',ut[_0xc867('0xe9')](_0x73bb3c,'amd'));_0x4b0f8a[_0xc867('0xcb')](_0x73bb3c)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x73bb3c[_0xc867('0xf2')]+_0x73bb3c[_0xc867('0xf3')]+_0x73bb3c[_0xc867('0x107')]+_0x73bb3c['countnosuchnumberretry']+_0x73bb3c[_0xc867('0xf5')]+_0x73bb3c[_0xc867('0xf6')]+_0x73bb3c[_0xc867('0xef')]+_0x73bb3c[_0xc867('0xf7')]>=_0x6f912a[_0xc867('0xf8')]){_0x4b0f8a[_0xc867('0xf9')](_0x73bb3c,_0x40fb52,_0x15f4d3,_0xc867('0xfa'));}else{if(_0x73bb3c[_0xc867('0xef')]>=_0x6f912a[_0xc867('0x108')]){_0x4b0f8a[_0xc867('0x109')](_0x73bb3c,_0x40fb52,_0x15f4d3,'reason\x2019\x20machine....');}else{_0x4b0f8a[_0xc867('0xbf')]({'active':![],'countmachineretry':_0x73bb3c['countmachineretry'],'scheduledat':moment()['add'](_0x6f912a[_0xc867('0x10a')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x73bb3c[_0xc867('0xfe')],'ListId':_0x73bb3c['ListId'],'VoiceQueueId':_0x73bb3c[_0xc867('0xd4')]||undefined,'CampaignId':_0x73bb3c['CampaignId']||undefined})['catch'](loggerCatch(_0xc867('0x100')));_0x40fb52({'reschedule':0x1});}}});}}};Dialer[_0xc867('0x19')][_0xc867('0x34')]=function(_0x5e865a){var _0x5eed05=this[_0xc867('0x24')][_0x5e865a[_0xc867('0xed')]];var _0x28daad;if(_0x5eed05&&_0x5eed05[_0xc867('0x4b')]===_0xc867('0x76')){delete this[_0xc867('0x24')][_0x5e865a[_0xc867('0xed')]];this[_0xc867('0xb0')](this['campaigns'][_0x5eed05[_0xc867('0xb1')]]);this[_0xc867('0x1e')][_0x5eed05[_0xc867('0xb1')]][_0xc867('0x10c')]+=0x1;_0x28daad=new Hangup(_0x5eed05,_0x5e865a);this[_0xc867('0xcb')](_0x28daad)[_0xc867('0xaf')](loggerCatch(_0xc867('0x10d')));this[_0xc867('0xc9')](_0x28daad)[_0xc867('0xaf')](loggerCatch(_0xc867('0x10e')));}if(_0x5eed05&&_0x5eed05[_0xc867('0x4b')]!==_0xc867('0x76')&&isNotNull(this['voiceQueues'][_0x5eed05[_0xc867('0xb1')]][_0xc867('0x10f')])){delete this['uniqueId'][_0x5e865a[_0xc867('0xed')]];this[_0xc867('0xb0')](this['voiceQueues'][_0x5eed05[_0xc867('0xb1')]]);this[_0xc867('0x1d')][_0x5eed05[_0xc867('0xb1')]]['outboundAnswerCallsDay']+=0x1;this[_0xc867('0x1d')][_0x5eed05[_0xc867('0xb1')]][_0xc867('0x5b')]+=0x1;_0x28daad=new Hangup(_0x5eed05,_0x5e865a);_0x28daad[_0xc867('0xa5')]=0x10;_0x28daad[_0xc867('0x103')]='AnswerAGI';_0x28daad[_0xc867('0xe6')]=_0xc867('0x110');this['createHistory'](_0x28daad)[_0xc867('0xaf')](loggerCatch(_0xc867('0x10d')));this[_0xc867('0xc9')](_0x28daad)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5eed05&&_0x5eed05['type']!=='ivr'&&!isNotNull(this[_0xc867('0x1d')][_0x5eed05[_0xc867('0xb1')]][_0xc867('0x10f')])){delete this[_0xc867('0x24')][_0x5e865a[_0xc867('0xed')]];this[_0xc867('0xb0')](this[_0xc867('0x1d')][_0x5eed05[_0xc867('0xb1')]]);this['voiceQueues'][_0x5eed05[_0xc867('0xb1')]][_0xc867('0x64')]+=0x1;_0x28daad=new Hangup(_0x5eed05,_0x5e865a);_0x28daad[_0xc867('0xa5')]=0xc;_0x28daad['statedesc']=_0x5e865a['cause-txt'];_0x28daad[_0xc867('0xe6')]=_0xc867('0x111');this[_0xc867('0xcb')](_0x28daad)[_0xc867('0xaf')](loggerCatch('[syncHangupIvr][createHistory]'));this['moveContactManagedDialer'](_0x28daad)['catch'](loggerCatch(_0xc867('0x10e')));}};Dialer[_0xc867('0x19')][_0xc867('0x30')]=function(_0x23ae37){var _0x4816e9=this[_0xc867('0x24')][_0x23ae37['uniqueid']];if(this[_0xc867('0x1d')][_0x23ae37[_0xc867('0xb1')]]){if(_0x4816e9&&_0x4816e9['type']!==_0xc867('0x76')){delete this[_0xc867('0x24')][_0x23ae37[_0xc867('0xed')]];this['voiceQueues'][_0x23ae37[_0xc867('0xb1')]][_0xc867('0x106')]+=0x1;var _0x4b2adc=new AgentComplete(_0x4816e9,_0x23ae37);if(_0x23ae37[_0xc867('0x112')]==='agent'){_0x4b2adc[_0xc867('0x113')]=this['voiceQueues'][_0x23ae37['queue']]['dialQueueProject2']&&this[_0xc867('0x1d')][_0x23ae37[_0xc867('0xb1')]][_0xc867('0x114')]?moment()[_0xc867('0x74')](_0xc867('0x10b')):undefined;}this['createHistory'](_0x4b2adc)['catch'](loggerCatch(_0xc867('0x115')));this[_0xc867('0xc9')](_0x4b2adc)[_0xc867('0xaf')](loggerCatch(_0xc867('0x116')));}}};Dialer[_0xc867('0x19')][_0xc867('0x117')]=function(_0x126aa1){if(this[_0xc867('0x1d')][_0x126aa1[_0xc867('0xb1')]]){if(this[_0xc867('0x24')][_0x126aa1[_0xc867('0xed')]]&&this[_0xc867('0x24')][_0x126aa1[_0xc867('0xed')]]['type']!==_0xc867('0x76')){this[_0xc867('0xb0')](this[_0xc867('0x1d')][_0x126aa1['queue']]);this[_0xc867('0x24')][_0x126aa1[_0xc867('0xed')]]['answertime']=moment()[_0xc867('0x74')](_0xc867('0x10b'));}}};Dialer['prototype'][_0xc867('0x118')]=function(_0x23a4f5,_0x58212d){this['createHistory'](_0x23a4f5)['catch'](loggerCatch(_0xc867('0x115')));if(_0x58212d==0x0){this['moveContactManagedDialer'](_0x23a4f5)[_0xc867('0xaf')](loggerCatch(_0xc867('0x119')));}};Dialer[_0xc867('0x19')]['syncQueueCallerAbandon']=function(_0x516e12){var _0x5998f1=this[_0xc867('0x24')][_0x516e12[_0xc867('0xed')]];var _0x4d01ee=this;var _0x59b278=![];var _0x10523d;var _0x31459e;if(this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]){if(_0x5998f1&&_0x5998f1['type']!==_0xc867('0x76')){delete this['uniqueId'][_0x516e12[_0xc867('0xed')]];this[_0xc867('0xb0')](this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]);_0x5998f1['droptime']=moment()[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3c6638=new QueueCallerAbandon(_0x5998f1,_0x516e12);if(getSeconds(_0x5998f1[_0xc867('0x11a')],_0x5998f1[_0xc867('0x11b')])>=_0x5998f1[_0xc867('0x11c')]){this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]][_0xc867('0x67')]+=0x1;this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]][_0xc867('0x5f')]+=0x1;this['voiceQueues'][_0x516e12['queue']][_0xc867('0x69')]+=0x1;_0x3c6638[_0xc867('0xa5')]=0xa;_0x3c6638[_0xc867('0x103')]=_0xc867('0x11d');_0x3c6638[_0xc867('0x11e')]=_0xc867('0x11f');_0x3c6638[_0xc867('0x113')]=this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]['dialQueueProject2']?moment()[_0xc867('0x74')](_0xc867('0x10b')):undefined;_0x3c6638[_0xc867('0xf5')]+=0x1;_0x3c6638[_0xc867('0xf0')]+=0x1;_0x10523d=this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]][_0xc867('0x120')];_0x31459e=this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]['callAdditionalPhoneAfterMin'];_0x4d01ee[_0xc867('0xb8')](_0x3c6638,_0x3c6638[_0xc867('0xa5')],_0x5998f1[_0xc867('0x121')])['then'](function(_0x25700f){_0x59b278=_0x25700f[_0xc867('0x122')]==0x1;if(_0x3c6638[_0xc867('0xf5')]>=_0x4d01ee[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]['dialDropMaxRetry']){_0x4d01ee[_0xc867('0x118')](_0x3c6638,_0x25700f['additional']);}else{_0x4d01ee[_0xc867('0xbf')]({'active':![],'countdropretry':_0x3c6638[_0xc867('0xf5')],'scheduledat':moment()['add'](_0x4d01ee['voiceQueues'][_0x516e12['queue']][_0xc867('0x120')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x5998f1[_0xc867('0xfe')],'ListId':_0x5998f1['ListId'],'VoiceQueueId':_0x5998f1[_0xc867('0xd4')]||undefined,'CampaignId':_0x5998f1['CampaignId']||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x123')));var _0x3ab32b=new History(_0x3c6638);_0x3ab32b[_0xc867('0xa5')]=0xa;_0x3ab32b[_0xc867('0x103')]='Drop';_0x3ab32b['starttime']=moment()[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ab32b['endtime']=_0x3ab32b[_0xc867('0x124')];_0x3ab32b[_0xc867('0x125')]=_0x3c6638[_0xc867('0x125')];_0x3ab32b[_0xc867('0x126')]=_0x3c6638[_0xc867('0x126')];_0x4d01ee['createHistory'](_0x3ab32b)[_0xc867('0xaf')](loggerCatch(_0xc867('0x127')));}})[_0xc867('0x3b')](function(){if(_0x59b278)_0x4d01ee[_0xc867('0xba')](_0x3c6638,_0x10523d,_0x31459e)[_0xc867('0x3b')](function(){return 0x1;});});}else{this[_0xc867('0x1d')][_0x516e12['queue']][_0xc867('0x7e')]+=0x1;this['voiceQueues'][_0x516e12[_0xc867('0xb1')]]['outboundDropCallsDayCallersExit']+=0x1;_0x3c6638[_0xc867('0xa5')]=0xb;_0x3c6638['statedesc']='Abandoned';_0x3c6638[_0xc867('0x11e')]=_0xc867('0x128');_0x3c6638['countabandonedretry']+=0x1;_0x3c6638[_0xc867('0xf0')]+=0x1;_0x10523d=this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]][_0xc867('0x129')];_0x31459e=this[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]]['callAdditionalPhoneAfterMin'];_0x4d01ee[_0xc867('0xb8')](_0x3c6638,_0x3c6638['state'],_0x5998f1[_0xc867('0x121')])[_0xc867('0x3b')](function(_0x11216e){if(_0x3c6638[_0xc867('0xf6')]>=_0x4d01ee['voiceQueues'][_0x516e12['queue']][_0xc867('0x12a')]){_0x4d01ee[_0xc867('0x118')](_0x3c6638,_0x11216e[_0xc867('0x122')]);}else{_0x4d01ee[_0xc867('0xbf')]({'active':![],'countabandonedretry':_0x3c6638[_0xc867('0xf6')],'scheduledat':moment()[_0xc867('0xfc')](_0x4d01ee[_0xc867('0x1d')][_0x516e12[_0xc867('0xb1')]][_0xc867('0x129')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x5998f1[_0xc867('0xfe')],'ListId':_0x5998f1[_0xc867('0xff')],'VoiceQueueId':_0x5998f1['VoiceQueueId']||undefined,'CampaignId':_0x5998f1[_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x12b')));var _0x3979ac=new History(_0x3c6638);_0x3979ac[_0xc867('0xa5')]=0xb;_0x3979ac['statedesc']=_0xc867('0x12c');_0x3979ac[_0xc867('0x124')]=moment()[_0xc867('0x74')](_0xc867('0x10b'));_0x3979ac[_0xc867('0xa6')]=_0x3979ac[_0xc867('0x124')];_0x3979ac[_0xc867('0x125')]=_0x3c6638['calleridname'];_0x3979ac[_0xc867('0x126')]=_0x3c6638[_0xc867('0x126')];_0x4d01ee[_0xc867('0xcb')](_0x3979ac)[_0xc867('0xaf')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})['then'](function(){if(_0x59b278)_0x4d01ee['swapAdditionalPhones'](_0x3c6638,_0x10523d,_0x31459e)[_0xc867('0x3b')](function(){return 0x1;});});}}}};Dialer['prototype']['syncNewExten']=function(_0x1163ab){if(this[_0xc867('0xa9')][_0x1163ab[_0xc867('0xed')]]){this[_0xc867('0xa9')][_0x1163ab[_0xc867('0xed')]][_0xc867('0xae')]=_0x1163ab['channel'];}if(this[_0xc867('0x24')][_0x1163ab[_0xc867('0xed')]]){this[_0xc867('0x24')][_0x1163ab[_0xc867('0xed')]][_0xc867('0xae')]=_0x1163ab['channel'];}};Dialer[_0xc867('0x19')][_0xc867('0x37')]=function(_0x22d3ca){if(strategy[this['voiceQueues'][this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]]['queue']][_0xc867('0x4d')]]===_0xc867('0x18')){if(this[_0xc867('0xa9')][_0x22d3ca['actionid']]&&_[_0xc867('0xac')](this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0x12e')])&&_0x22d3ca[_0xc867('0xdd')]==='1'&&_0x22d3ca[_0xc867('0x12f')]==='0'){if(this[_0xc867('0x1f')][_0x22d3ca['stateinterface']]){if(!this[_0xc867('0x1f')][_0x22d3ca[_0xc867('0x130')]][_0xc867('0x12e')]){this['agents'][_0x22d3ca[_0xc867('0x130')]][_0xc867('0x12e')]=!![];this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0x12e')]=!![];this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0x130')]=_0x22d3ca[_0xc867('0x130')];}}}}else if((strategy[this['voiceQueues'][this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0xb1')]][_0xc867('0x4d')]]||_0xc867('0x17'))==='rrmemory'){if(this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]]){if(this[_0xc867('0x1f')][_0x22d3ca['stateinterface']]){this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0x130')]=_0x22d3ca[_0xc867('0x130')];if(_[_0xc867('0xac')](this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x22d3ca['actionid']][_0xc867('0xb1')]])){this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]]['queue']]=[];}this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]][_0xc867('0xb1')]][_0xc867('0x132')](_[_0xc867('0x88')](_['pick'](this[_0xc867('0xa9')][_0x22d3ca[_0xc867('0x12d')]],[_0xc867('0x133'),_0xc867('0x130')]),{'status':_0x22d3ca['status'],'paused':_0x22d3ca[_0xc867('0x12f')]}));}}}};function unlockQueueStatus(_0x18e49f,_0x1bc99e){setTimeout(function(){if(_[_0xc867('0x3d')](_0x18e49f[_0xc867('0x134')])){loggerBooked[_0xc867('0x92')](_0xc867('0x135'),_0x1bc99e);}_0x18e49f[_0xc867('0x134')]=!![];loggerBooked[_0xc867('0x79')]('[booked][unlockQueueStatus]',_0x1bc99e,JSON['stringify'](_[_0xc867('0xd2')](_0x18e49f,[_0xc867('0x40'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xc867('0x19')]['syncQueueStatusComplete']=function(_0x2a52b7){var _0x1aa99b=this;var _0x4c53dd=_0x1aa99b[_0xc867('0x1d')][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]];if(strategy[this['voiceQueues'][this['actions'][_0x2a52b7[_0xc867('0x12d')]]['queue']][_0xc867('0x4d')]]===_0xc867('0x18')){if(this[_0xc867('0xa9')][_0x2a52b7['actionid']]&&this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0x130')]){this[_0xc867('0x1c')][_0xc867('0x136')](this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0x133')],this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0x130')])[_0xc867('0xaf')](function(_0x22f981){logger[_0xc867('0x92')]('[Catch][Preview][syncQueueStatusComplete]',util[_0xc867('0x91')](_0x22f981,{'showHidden':![],'depth':null}));})[_0xc867('0x137')](function(){_0x1aa99b[_0xc867('0xb0')](_0x1aa99b['voiceQueues'][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]);_0x1aa99b[_0xc867('0x1f')][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]]['stateinterface']][_0xc867('0x12e')]=![];delete _0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]];unlockQueueStatus(_0x4c53dd);});}else{this['updateOriginated'](this['voiceQueues'][this[_0xc867('0xa9')][_0x2a52b7['actionid']][_0xc867('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]]['ContactId'],'ListId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xff')],'VoiceQueueId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xd4')]||undefined,'CampaignId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x138')));delete this[_0xc867('0xa9')][_0x2a52b7['actionid']];unlockQueueStatus(_0x4c53dd);}}else if((strategy[this['voiceQueues'][this['actions'][_0x2a52b7['actionid']][_0xc867('0xb1')]][_0xc867('0x4d')]]||'rrmemory')===_0xc867('0x17')){var _0x46e981;if(this[_0xc867('0xa9')][_0x2a52b7['actionid']]&&!_[_0xc867('0x8e')](this[_0xc867('0x131')][this['actions'][_0x2a52b7[_0xc867('0x12d')]]['queue']])){if(this['queueBookedRR'][_0x1aa99b['actions'][_0x2a52b7[_0xc867('0x12d')]]['queue']]){this[_0xc867('0x29')][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]=this[_0xc867('0x29')][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]]['queue']]?this[_0xc867('0x29')][this['actions'][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]:this['queueBooked'][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]?this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]][_0xc867('0x139')]||0x0:0x0;}this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x2a52b7['actionid']]['queue']]['_rr']=this[_0xc867('0x29')][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]];for(var _0x30f100=0x0;_0x30f100<this[_0xc867('0x131')][this['actions'][_0x2a52b7['actionid']][_0xc867('0xb1')]][_0xc867('0x94')];_0x30f100+=0x1){_0x46e981=rr(this[_0xc867('0x131')][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]);this[_0xc867('0x29')][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]=this[_0xc867('0x131')][this['actions'][_0x2a52b7['actionid']][_0xc867('0xb1')]][_0xc867('0x139')];if(_0x46e981[_0xc867('0xdd')]==='1'&&_0x46e981[_0xc867('0x12f')]==='0'){break;}}if(!_['isNil'](_0x46e981)){this['agents'][_0x46e981['stateinterface']][_0xc867('0x13a')]=_[_0xc867('0x3d')](this['agents'][_0x46e981[_0xc867('0x130')]]['unlockRR'])?!![]:this[_0xc867('0x1f')][_0x46e981['stateinterface']][_0xc867('0x13a')];}loggerBooked[_0xc867('0x79')]('[booked][RR]',_0x2a52b7[_0xc867('0x12d')],_0xc867('0x13b'),JSON['stringify'](_[_0xc867('0xd2')](this[_0xc867('0x1f')][_0x46e981[_0xc867('0x130')]],[_0xc867('0x40'),_0xc867('0x13a')])),_0xc867('0x13c'),JSON['stringify'](_0x46e981[_0xc867('0x133')]));if(!_[_0xc867('0xac')](_0x46e981)&&_0x46e981[_0xc867('0xdd')]==='1'&&_0x46e981[_0xc867('0x12f')]==='0'&&this[_0xc867('0x1f')][_0x46e981[_0xc867('0x130')]][_0xc867('0x13a')]){this['agents'][_0x46e981[_0xc867('0x130')]][_0xc867('0x13a')]=![];this[_0xc867('0x131')][_0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]=[];this[_0xc867('0x1c')][_0xc867('0x136')](_0x46e981['idHopper'],_0x46e981[_0xc867('0x130')])['catch'](function(_0x1f782e){logger['error'](_0xc867('0x13d'),util[_0xc867('0x91')](_0x1f782e,{'showHidden':![],'depth':null}));})[_0xc867('0x137')](function(){_0x1aa99b['updateOriginated'](_0x1aa99b[_0xc867('0x1d')][_0x1aa99b['actions'][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]);setTimeout(function(){_0x1aa99b[_0xc867('0x1f')][_0x46e981['stateinterface']][_0xc867('0x13a')]=!![];loggerBooked[_0xc867('0x79')](_0xc867('0x13e'),_0x2a52b7[_0xc867('0x12d')],'Agent:\x20',JSON['stringify'](_['pick'](_0x1aa99b[_0xc867('0x1f')][_0x46e981['stateinterface']],[_0xc867('0x40'),_0xc867('0x13a')])),_0xc867('0x13c'),JSON[_0xc867('0x73')](_0x46e981[_0xc867('0x133')]));},0xc7);delete _0x1aa99b[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]];unlockQueueStatus(_0x4c53dd,_0x2a52b7[_0xc867('0x12d')]);});}else{loggerBooked[_0xc867('0x79')](_0xc867('0x13f'));this['updateOriginated'](this['voiceQueues'][this['actions'][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xc867('0xa9')][_0x2a52b7['actionid']][_0xc867('0xfe')],'ListId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xff')],'VoiceQueueId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xd4')]||undefined,'CampaignId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]]['CampaignId']||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x138')));delete this['actions'][_0x2a52b7[_0xc867('0x12d')]];unlockQueueStatus(_0x4c53dd);}}else{loggerBooked[_0xc867('0x79')](_0xc867('0x140'));this['updateOriginated'](this[_0xc867('0x1d')][this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xb1')]]);this[_0xc867('0xbf')]({'active':![],'ContactId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xfe')],'ListId':this[_0xc867('0xa9')][_0x2a52b7['actionid']][_0xc867('0xff')],'VoiceQueueId':this['actions'][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xd4')]||undefined,'CampaignId':this[_0xc867('0xa9')][_0x2a52b7['actionid']][_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x141')));delete this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]];unlockQueueStatus(_0x4c53dd);}}else{loggerBooked['info'](_0xc867('0x142'));this['updateOriginated'](this['voiceQueues'][this[_0xc867('0xa9')][_0x2a52b7['actionid']][_0xc867('0xb1')]]);this[_0xc867('0xbf')]({'active':![],'ContactId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xfe')],'ListId':this['actions'][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xff')],'VoiceQueueId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]][_0xc867('0xd4')]||undefined,'CampaignId':this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]]['CampaignId']||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x143')));delete this[_0xc867('0xa9')][_0x2a52b7[_0xc867('0x12d')]];unlockQueueStatus(_0x4c53dd);}};Dialer['prototype'][_0xc867('0x144')]=function(){var _0x52c698=this;return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper[_0xc867('0x145')]({'active':!![]}))['then'](function(){setInterval(function(){_0x52c698['syncCampaigns']();},0x3e8);});};Dialer['prototype'][_0xc867('0x146')]=function(_0x235a1c){var _0x380c01=this;return function(){if(!_0x380c01[_0xc867('0xda')](_0x235a1c['Trunk'])){if(!_0x380c01[_0xc867('0xda')](_0x235a1c[_0xc867('0x147')])){_0x235a1c[_0xc867('0x3e')]=_0xc867('0x148');throw _0x235a1c['name']+_0xc867('0x149');}}};};Dialer[_0xc867('0x19')]['checkIfTime']=function(_0x5098af,_0x4757e3,_0x1cc9c7,_0x4c6ffa){var _0x444299=this;return function(){var _0x24fe9a=!![];return _0x444299[_0xc867('0x14a')](_0x5098af,_0x4757e3,_0x1cc9c7,_0x4c6ffa,_0x24fe9a);};};Dialer[_0xc867('0x19')][_0xc867('0x14b')]=function(_0x5c506e,_0x335f9b,_0x1f99d1,_0x31fe8f){var _0x50f003=this;return function(){var _0x34161d=![];return _0x50f003[_0xc867('0x14a')](_0x5c506e['Intervals'],_0x335f9b,_0x1f99d1,_0x31fe8f,_0x34161d);};};Dialer['prototype'][_0xc867('0x14a')]=function(_0x5b7b0b,_0x3c0593,_0x4f5d9e,_0x55ef3d,_0x575baf){var _0x7def14=[];return new Promise(function(_0x4998a3,_0xf67074){if(!isNotNull(_0x5b7b0b)){_0x55ef3d[_0xc867('0x3e')]=_0xc867('0x44');return _0xf67074(msgResponse(_0xc867('0x14a'),'Failure',_0x4f5d9e+_0xc867('0x14c')));}if(_[_0xc867('0x8e')](_0x5b7b0b)){_0x55ef3d[_0xc867('0x3e')]=_0xc867('0x14d');return _0xf67074(msgResponse('ifTime',_0xc867('0x14e'),_0x4f5d9e+_0xc867('0x14f')));}if(_0x3c0593&&_[_0xc867('0x3d')](config['timezones'][_0x3c0593])){_0x55ef3d['message']='TIMEZONE_UNKNOW';return _0xf67074(msgResponse(_0xc867('0x14a'),_0xc867('0x14e'),_0x4f5d9e+'\x20Timezone\x20unknow\x20'+_0x3c0593));}if(_[_0xc867('0x150')](_0x5b7b0b)){for(var _0x2f86ec=0x0;_0x2f86ec<_0x5b7b0b[_0xc867('0x94')];_0x2f86ec+=0x1){_0x7def14[_0xc867('0x132')](ami[_0xc867('0xad')]({'action':'command','command':util['format'](_0xc867('0x151'),_0x5b7b0b[_0x2f86ec][_0xc867('0x152')],!_['isUndefined'](config[_0xc867('0x153')][_0x3c0593])?_0x3c0593:'')})[_0xc867('0x3b')](function(_0xe09f44){return _0xe09f44[_0xc867('0x154')][_0xc867('0x155')](_0xc867('0x156'))>=0x0;})[_0xc867('0xaf')](myreject(_0xf67074)));}}else{_0x7def14[_0xc867('0x132')](ami[_0xc867('0xad')]({'action':_0xc867('0x157'),'command':util[_0xc867('0x74')]('iftime\x20%s,%s',_0x5b7b0b,!_[_0xc867('0x3d')](config[_0xc867('0x153')][_0x3c0593])?_0x3c0593:'')})[_0xc867('0x3b')](function(_0x1d7df1){return _0x1d7df1[_0xc867('0x154')][_0xc867('0x155')](_0xc867('0x156'))>=0x0;})[_0xc867('0xaf')](myreject(_0xf67074)));}Promise[_0xc867('0x158')](_0x7def14)['then'](function(_0x3815ff){var _0x1859d0=_[_0xc867('0x159')](_0x3815ff);if(_0x1859d0){return _0x4998a3(_0x1859d0);}else{_0x55ef3d[_0xc867('0x3e')]=_0x575baf?_0xc867('0x15a'):'INTERVAL_IS_OVERTIME';return _0xf67074(msgResponse(_0xc867('0x15b'),'Failure','Global:\x20'+_0x575baf+'\x20'+_0x4f5d9e+'\x20Interval\x20is\x20overtime:\x20'+util[_0xc867('0x91')](_0x5b7b0b,{'showHidden':![],'depth':null})+_0xc867('0x15c')+_0x3c0593));}})['catch'](function(_0x201943){return _0xf67074(msgResponse(_0xc867('0x14a'),_0xc867('0x14e'),JSON['stringify'](_0x201943)));});});};Dialer['prototype'][_0xc867('0x15d')]=function(_0x497fff){var _0x53004f=this;return function(){switch(_0x497fff[_0xc867('0x59')]){case _0xc867('0x15e'):freeVariablesPredictive(_0x497fff);_0x53004f[_0xc867('0x15f')](_0x497fff,0x1);break;case _0xc867('0x160'):freeVariablesPredictive(_0x497fff);_0x53004f[_0xc867('0x15f')](_0x497fff,_0x497fff[_0xc867('0x161')]);break;case _0xc867('0x9'):_0x53004f[_0xc867('0x9')](_0x497fff);break;case _0xc867('0x7'):freeVariablesPredictive(_0x497fff);_0x53004f[_0xc867('0x15f')](_0x497fff,0x1);break;default:freeVariablesPredictive(_0x497fff);logger[_0xc867('0x92')](_0xc867('0x162'),_0x497fff[_0xc867('0x40')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0xc867('0x163')]=function(_0x315fa8){return Promise['resolve']()[_0xc867('0x3b')](cmHopper[_0xc867('0x164')](_0x315fa8['id'],previewRecallmeReminderInterval))[_0xc867('0x3b')](function(_0x98a6db){for(var _0x4e311f=0x0;_0x4e311f<_0x98a6db['length'];_0x4e311f++){var _0x3ea1d3=_0x98a6db[_0x4e311f][_0xc867('0x165')][_0xc867('0x40')];if(_0x3ea1d3)io['to'](util[_0xc867('0x74')](_0xc867('0x166'),_0x3ea1d3))[_0xc867('0x4a')]('user:dialPreviewRecallReminder',{'hopper':_0x98a6db[_0x4e311f]});}})[_0xc867('0xaf')](function(){});};Dialer[_0xc867('0x19')][_0xc867('0x167')]=function(_0x4ff7e1){var _0x309ae1=this;return function(){_0x309ae1['handleIvr'](_0x4ff7e1);};};Dialer[_0xc867('0x19')]['syncQueueSummary']=function(_0x34ebc6){var _0x254184=this;if(isNotPreview(_0x34ebc6[_0xc867('0x59')])){if(isVoiceQueueOutbound(_0x34ebc6[_0xc867('0x4b')])&&isActive(_0x34ebc6[_0xc867('0x58')])){_0x34ebc6[_0xc867('0x9e')]=!![];Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](checkIsLoggedIn(_0x34ebc6,_0x34ebc6['loggedIn']))[_0xc867('0x3b')](checkIsActive(_0x34ebc6,_0x34ebc6[_0xc867('0x58')]))['then'](checkInterval(_0x34ebc6))[_0xc867('0x3b')](_0x254184[_0xc867('0x146')](_0x34ebc6))[_0xc867('0x3b')](_0x254184[_0xc867('0x168')](_0x34ebc6[_0xc867('0x169')],_0x34ebc6[_0xc867('0x16a')],_0x34ebc6[_0xc867('0x40')],_0x34ebc6))[_0xc867('0x3b')](_0x254184['checkIfTimeIntervals'](_0x34ebc6[_0xc867('0x43')],_0x34ebc6[_0xc867('0x16a')],_0x34ebc6[_0xc867('0x40')],_0x34ebc6))['then'](_0x254184[_0xc867('0x15d')](_0x34ebc6))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x34ebc6));}else{notSendMessagesQueue(_0x34ebc6);}}else{freeVariablesPredictive(_0x34ebc6);}};Dialer[_0xc867('0x19')][_0xc867('0x16b')]=_[_0xc867('0x16c')](function(){var _0x65fc65=_[_0xc867('0x16d')](this[_0xc867('0x1d')],function(_0x4d59ec){return _0x4d59ec[_0xc867('0x16e')];});var _0x15a5f2=_[_0xc867('0x16d')](this['agents'],function(_0x18c38b){return _0x18c38b[_0xc867('0x16f')]&&_0x18c38b[_0xc867('0xdd')]===_0xc867('0xdc');});if(_0x65fc65['length']>0x0&&_0x15a5f2['length']>0x0){return Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](cmHopper[_0xc867('0x164')](_[_0xc867('0x170')](_0x65fc65,'id'),previewRecallmeReminderInterval,_['map'](_0x15a5f2,'id')))[_0xc867('0x3b')](function(_0x1b1dea){for(var _0x13a641=0x0;_0x13a641<_0x1b1dea['length'];_0x13a641++){var _0x30d367=_0x1b1dea[_0x13a641][_0xc867('0x165')]['name'];if(_0x30d367)io['to'](util['format'](_0xc867('0x166'),_0x30d367))[_0xc867('0x4a')](_0xc867('0x171'),{'hopper':_0x1b1dea[_0x13a641]});}})[_0xc867('0xaf')](function(_0x375819){logger[_0xc867('0x92')](_0xc867('0x163'),_0x375819);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xc867('0x19')][_0xc867('0x172')]=function(){var _0x287f13=this;var _0x5cead7;for(var _0x5283ed in this[_0xc867('0x1e')]){if(typeof this[_0xc867('0x1e')][_0x5283ed]!==_0xc867('0x96')){_0x5cead7=this[_0xc867('0x1e')][_0x5283ed];if(isCampaignIvr(_0x5cead7['type'])&&isActive(_0x5cead7[_0xc867('0x71')])){_0x5cead7[_0xc867('0x9e')]=!![];Promise[_0xc867('0xb5')]()[_0xc867('0x3b')](checkIsActive(_0x5cead7,_0x5cead7['active']))[_0xc867('0x3b')](checkInterval(_0x5cead7))[_0xc867('0x3b')](_0x287f13[_0xc867('0x146')](_0x5cead7))[_0xc867('0x3b')](_0x287f13[_0xc867('0x168')](_0x5cead7[_0xc867('0x169')],_0x5cead7[_0xc867('0x16a')],_0x5cead7['name'],_0x5cead7))[_0xc867('0x3b')](_0x287f13[_0xc867('0x14b')](_0x5cead7[_0xc867('0x43')],_0x5cead7[_0xc867('0x16a')],_0x5cead7[_0xc867('0x40')],_0x5cead7))[_0xc867('0x3b')](_0x287f13[_0xc867('0x167')](_0x5cead7))[_0xc867('0xaf')](loggerCatchQueueSummary(_0xc867('0x173'),_0x5cead7));}else{notSendMessagesCampaign(_0x5cead7);}}}};function getCallerIdRandom(_0x17545a,_0x2cb167){var _0x188385;var _0x59ef56;var _0x28122e;if(_0x2cb167<=0x0){_0x2cb167=0x1;}_0x188385=new RegExp('\x5cw{0,'+_0x2cb167+'}$');_0x59ef56=Math[_0xc867('0x174')](0xa,_0x2cb167-0x1);_0x28122e=Math[_0xc867('0x174')](0xa,_0x2cb167)-0x1;return util[_0xc867('0x74')]('%s',_[_0xc867('0x175')](_0x17545a,_0x188385,_[_0xc867('0x176')](_0x59ef56,_0x28122e)));}function extractCalleridName(_0x41afba){var _0x417705=_0x41afba[_0xc867('0x177')](/"(.*?)"/);return _0x417705?_0x417705[0x1]:_0x41afba;}Dialer['prototype']['actionOriginate']=function(_0x5d62eb,_0x2c1333){var _0x33af67=this;var _0x410336=uuid['v4']();this[_0xc867('0xa9')][_0x410336]=new Action(_0x5d62eb,_0x2c1333,_0x410336);return new Promise(function(_0x5e28fb,_0x3ddc47){if(_[_0xc867('0x3d')](_0x5d62eb)&&typeof _0x5d62eb!==_0xc867('0x178')){return _0x3ddc47(msgResponse(_0xc867('0x179'),_0xc867('0x14e'),_0xc867('0x17a')));}if(_[_0xc867('0x3d')](_0x2c1333[_0xc867('0x17b')])||_0x2c1333['phone']===null){return _0x3ddc47(msgResponse(_0xc867('0x179'),'Failure',_0xc867('0x17c')));}var _0x49792c={'XMD-CALLERID':_0x33af67[_0xc867('0xa9')][_0x410336][_0xc867('0x17d')](),'XMD-AGI':_0x5d62eb[_0xc867('0x10f')]?util['format'](_0xc867('0x17e'),ipAgi,_0x5d62eb[_0xc867('0x10f')]):'NONE','XMD-AGIAFTER':_0x5d62eb[_0xc867('0x17f')]?util['format'](_0xc867('0x17e'),ipAgi,_0x5d62eb[_0xc867('0x17f')]):_0xc867('0x180'),'XMD-QUEUE':_0x5d62eb[_0xc867('0x4b')]==='outbound'?util[_0xc867('0x74')](_0xc867('0x181'),_0x5d62eb[_0xc867('0x40')],_0x5d62eb[_0xc867('0x182')]||'',_0x5d62eb[_0xc867('0x114')]?'c':'',_0x5d62eb[_0xc867('0x11c')]||0x3):_0xc867('0x180'),'XMD-CONTACTID':_0x2c1333[_0xc867('0xfe')],'XMD-CDRTYPE':_0xc867('0x6'),'CALLERID(all)':_0x33af67[_0xc867('0xa9')][_0x410336]['getCaller'](),'XMD-AMD':_0x5d62eb['dialAMDActive']?'ACTIVE':_0xc867('0x180'),'XMD-DESTINATION':_0xc867('0xe3')};if(_0x5d62eb[_0xc867('0x101')]){_0x49792c['XMD-AMDINITIALSILENCE']=_0x5d62eb[_0xc867('0x183')]||0x9c4;_0x49792c['XMD-AMDGREETING']=_0x5d62eb[_0xc867('0x184')]||0x5dc;_0x49792c[_0xc867('0x185')]=_0x5d62eb[_0xc867('0x186')]||0x320;_0x49792c['XMD-AMDTOTALANALYSISTIME']=_0x5d62eb[_0xc867('0x187')]||0x1388;_0x49792c[_0xc867('0x188')]=_0x5d62eb[_0xc867('0x189')]||0x64;_0x49792c[_0xc867('0x18a')]=_0x5d62eb['dialAMDBetweenWordsSilence']||0x32;_0x49792c[_0xc867('0x18b')]=_0x5d62eb['dialAMDMaximumNumberOfWords']||0x3;_0x49792c['XMD-AMDSILENCETHRESHOLD']=_0x5d62eb['dialAMDSilenceThreshold']||0x100;_0x49792c[_0xc867('0x18c')]=_0x5d62eb[_0xc867('0x18d')]||0x1388;}if(_0x5d62eb[_0xc867('0x4b')]===_0xc867('0x4c')){_0x49792c[_0xc867('0x18e')]=_0x2c1333['VoiceQueueId'];}else{_0x49792c[_0xc867('0x18f')]=_0x2c1333[_0xc867('0xd5')];}for(var _0x28a095 in _0x2c1333[_0xc867('0x190')]){if(typeof _0x2c1333['Contact'][_0x28a095]!=='undefined'){if(isNotNull(_0x2c1333[_0xc867('0x190')][_0x28a095])&&_0x28a095!=='id'&&_0x28a095!==_0xc867('0x191')&&_0x28a095!==_0xc867('0x192')&&_0x28a095!==_0xc867('0x193')){_0x49792c[util[_0xc867('0x74')](_0xc867('0x194'),'XMD-',_[_0xc867('0x195')](_0x28a095))]=_0x2c1333[_0xc867('0x190')][_0x28a095];}}}var _0x126b58=_0x33af67[_0xc867('0xda')](_0x5d62eb['Trunk'])?getCallerId(_0x5d62eb[_0xc867('0x70')]['callerid'],_0x5d62eb[_0xc867('0x196')],_0x5d62eb[_0xc867('0x197')]>0x0?getCallerIdRandom(_0x5d62eb[_0xc867('0x198')],_0x5d62eb['dialRandomLastDigitCallerIdNumber']):_0x5d62eb[_0xc867('0x198')]):getCallerId(_['isNil'](_0x5d62eb[_0xc867('0x147')])?_0x5d62eb[_0xc867('0x70')]['callerid']:_0x5d62eb['TrunkBackup'][_0xc867('0x72')],_0x5d62eb[_0xc867('0x196')],_0x5d62eb[_0xc867('0x197')]>0x0?getCallerIdRandom(_0x5d62eb['dialOriginateCallerIdNumber'],_0x5d62eb[_0xc867('0x197')]):_0x5d62eb['dialOriginateCallerIdNumber']);if(_0x126b58){_0x49792c[_0xc867('0x199')]=_0x33af67['actions'][_0x410336][_0xc867('0x19a')]=extractCalleridName(_0x126b58);_0x49792c[_0xc867('0x19b')]=_0x2c1333['phone'];}_0x5d62eb[_0xc867('0x19c')]=_0x49792c;return ami[_0xc867('0xad')]({'actionid':_0x410336,'action':_0xc867('0x179'),'channel':_0x33af67['isTrunkReachable'](_0x5d62eb[_0xc867('0x70')])?util[_0xc867('0x74')]('SIP/%s/%s%s',_0x5d62eb[_0xc867('0x70')][_0xc867('0x40')],isNotNull(_0x5d62eb[_0xc867('0x5a')])?_0x5d62eb[_0xc867('0x5a')][_0xc867('0x19d')]()||'':'',_0x5d62eb[_0xc867('0x19e')]>0x0?_0x2c1333['phone'][_0xc867('0x19f')](_0x5d62eb[_0xc867('0x19e')]):_0x2c1333[_0xc867('0x17b')]):util['format'](_0xc867('0x1a0'),_[_0xc867('0xac')](_0x5d62eb[_0xc867('0x147')])?_0x5d62eb['Trunk'][_0xc867('0x40')]:_0x5d62eb[_0xc867('0x147')][_0xc867('0x40')],isNotNull(_0x5d62eb['dialPrefix'])?_0x5d62eb[_0xc867('0x5a')][_0xc867('0x19d')]()||'':'',_0x5d62eb[_0xc867('0x19e')]>0x0?_0x2c1333[_0xc867('0x17b')][_0xc867('0x19f')](_0x5d62eb[_0xc867('0x19e')]):_0x2c1333[_0xc867('0x17b')]),'callerid':_0x126b58,'Exten':'xcally-motion-dialer','Context':'from-sip','Priority':'1','variable':_0x49792c,'timeout':(_0x5d62eb['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x410336})[_0xc867('0x3b')](function(_0x1c5288){return _0x5e28fb(_0x1c5288);})[_0xc867('0xaf')](function(_0x44d463){_0x5d62eb[_0xc867('0x62')]+=0x1;var _0x59ab4b=new History(_0x33af67['actions'][_0x410336]);logger['error'](util['format'](_0xc867('0x1a1'),JSON[_0xc867('0x73')](_0x44d463)));_0x59ab4b[_0xc867('0xa5')]=0xe;_0x59ab4b['statedesc']='OriginateError';_0x59ab4b['starttime']=moment()[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss');_0x59ab4b['endtime']=_0x59ab4b['starttime'];_0x33af67[_0xc867('0xcb')](_0x59ab4b)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1a2')));_0x33af67[_0xc867('0xc9')](_0x59ab4b)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1a2')))['finally'](function(){delete _0x33af67[_0xc867('0xa9')][_0x410336];return _0x3ddc47(msgResponse('originate',_0xc867('0x1a3'),'originate\x20action\x20Error'));});});});};Dialer[_0xc867('0x19')][_0xc867('0x2f')]=function(_0x564fca){var _0x3453d7=this[_0xc867('0xa9')][_0x564fca['actionid']];if(_0x3453d7){delete this['actions'][_0x564fca['actionid']];_0x3453d7[_0xc867('0x11b')]=moment()[_0xc867('0x74')](_0xc867('0x10b'));var _0x1de276=_0x3453d7[_0xc867('0x4b')]==='ivr'?this[_0xc867('0x1e')][_0x3453d7[_0xc867('0xb1')]]:this[_0xc867('0x1d')][_0x3453d7[_0xc867('0x1a4')]()];if(!this[_0xc867('0xd8')](_0x564fca[_0xc867('0x1a5')])){this[_0xc867('0xb0')](_0x1de276);return this[_0xc867('0x1a6')](_0x3453d7,_0x1de276,_0x564fca)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1a7')));}this[_0xc867('0x24')][_0x564fca[_0xc867('0xed')]]=_0x3453d7;}};Dialer['prototype'][_0xc867('0x1a8')]=function(_0x296f60,_0x2b19f1,_0x12f5ae){var _0x4b170=new History(_0x2b19f1);if(_0x4b170[_0xc867('0xf2')]+_0x4b170[_0xc867('0xf3')]+_0x4b170[_0xc867('0x107')]+_0x4b170[_0xc867('0xf4')]+_0x4b170[_0xc867('0xf5')]+_0x4b170[_0xc867('0xf6')]+_0x4b170['countmachineretry']+_0x4b170[_0xc867('0xf7')]>=_0x12f5ae['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x296f60){case 0x3:if(_0x4b170[_0xc867('0x107')]>=_0x12f5ae[_0xc867('0x1a9')]-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countnoanswerretry':_0x4b170[_0xc867('0x107')]+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x1aa')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x4b170['ContactId'],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170[_0xc867('0xd4')]||undefined,'CampaignId':_0x4b170[_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x4b170[_0xc867('0xf2')]>=_0x12f5ae['dialBusyMaxRetry']-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countbusyretry':_0x4b170[_0xc867('0xf2')]+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x1ab')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170['VoiceQueueId']||undefined,'CampaignId':_0x4b170[_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x1ac')));break;case 0x8:if(_0x4b170[_0xc867('0xf3')]>=_0x12f5ae[_0xc867('0x1ad')]-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countcongestionretry':_0x4b170[_0xc867('0xf3')]+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x1ae')],_0xc867('0xfd'))[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170[_0xc867('0xd4')]||undefined,'CampaignId':_0x4b170['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x4b170['countnosuchnumberretry']>=_0x12f5ae[_0xc867('0x1af')]-0x1){return!![];}else{this[_0xc867('0xbf')]({'active':![],'countnosuchnumberretry':_0x4b170['countnosuchnumberretry']+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x1b0')],_0xc867('0xfd'))[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170['VoiceQueueId']||undefined,'CampaignId':_0x4b170['CampaignId']||undefined})['catch'](loggerCatch(_0xc867('0x1b1')));}break;case 0xa:if(_0x4b170[_0xc867('0xf5')]>=_0x12f5ae[_0xc867('0x1b2')]-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countdropretry':_0x4b170[_0xc867('0xf5')]+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x120')],_0xc867('0xfd'))['format'](_0xc867('0x10b')),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170[_0xc867('0xd4')]||undefined,'CampaignId':_0x4b170[_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x123')));break;case 0xb:if(_0x4b170[_0xc867('0xf6')]>=_0x12f5ae[_0xc867('0x12a')]-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countabandonedretry':_0x4b170['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x12f5ae[_0xc867('0x129')],'minutes')[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170['VoiceQueueId']||undefined,'CampaignId':_0x4b170['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x4b170[_0xc867('0xef')]>=_0x12f5ae[_0xc867('0x108')]-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countmachineretry':_0x4b170['countmachineretry']+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x10a')],_0xc867('0xfd'))['format'](_0xc867('0x10b')),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170['VoiceQueueId']||undefined,'CampaignId':_0x4b170[_0xc867('0xd5')]||undefined})['catch'](loggerCatch(_0xc867('0x100')));break;case 0x14:if(_0x4b170[_0xc867('0xf7')]>=_0x12f5ae['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0xc867('0xbf')]({'active':![],'countagentrejectretry':_0x4b170[_0xc867('0xf7')]+=0x1,'scheduledat':moment()[_0xc867('0xfc')](_0x12f5ae[_0xc867('0x1b3')],'minutes')[_0xc867('0x74')](_0xc867('0x10b')),'ContactId':_0x4b170[_0xc867('0xfe')],'ListId':_0x4b170[_0xc867('0xff')],'VoiceQueueId':_0x4b170[_0xc867('0xd4')]||undefined,'CampaignId':_0x4b170[_0xc867('0xd5')]||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x1b4')));break;default:return!![];}};Dialer[_0xc867('0x19')][_0xc867('0x1a6')]=function(_0x59214d,_0x26c471,_0x500fa8){var _0x5a7b2d=this;var _0xb4f713=new History(_0x59214d);var _0x46317f=![];var _0x5f829e;var _0x29dd65;return new Promise(function(_0x56b789,_0x1a9549){if(_[_0xc867('0x3d')](_0x26c471)&&typeof _0x26c471!=='object'){return _0x1a9549(msgResponse(_0xc867('0x1b5'),_0xc867('0x14e'),_0xc867('0x1b6')));}if(_[_0xc867('0x3d')](_0x500fa8)&&typeof _0x500fa8!==_0xc867('0x178')){return _0x1a9549(msgResponse(_0xc867('0x1b5'),_0xc867('0x14e'),'evt\x20is\x20undefine'));}_0x5a7b2d[_0xc867('0xb8')](_0xb4f713,_0x500fa8[_0xc867('0x112')],_0x26c471)[_0xc867('0x3b')](function(_0x410ec2){if(_0x410ec2[_0xc867('0x122')]==0x1)_0x46317f=!![];switch(_0x500fa8['reason']){case'0':_0x26c471[_0xc867('0x61')]+=0x1;_0xb4f713[_0xc867('0xa5')]=0x0;_0xb4f713[_0xc867('0x103')]=_0xc867('0x1b7');_0xb4f713[_0xc867('0xf4')]+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;ami['emit'](_0xc867('0x1b8'),ut[_0xc867('0xe9')](_0x59214d,_0xc867('0x1b9')));_0x5f829e=_0x26c471[_0xc867('0x1b0')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];_0x5a7b2d['createHistory'](_0xb4f713)[_0xc867('0xaf')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5a7b2d[_0xc867('0x1a8')](0x0,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0xf4')]>=_0x26c471[_0xc867('0x1af')]){_0x5a7b2d[_0xc867('0x109')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1bb'));}else{_0x5a7b2d[_0xc867('0xf9')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1bb'));}}break;case'3':_0x26c471[_0xc867('0x60')]+=0x1;_0xb4f713[_0xc867('0xa5')]=0x3;_0xb4f713[_0xc867('0x103')]=_0xc867('0x1bc');_0xb4f713['countnoanswerretry']+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;var _0x1c9f40=ut['buildNoAnswerEventPayload'](_0x59214d,_0x26c471);ami['emit']('custom:agentnoanswer',_0x1c9f40);_0x5f829e=_0x26c471[_0xc867('0x1aa')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];_0x5a7b2d['createHistory'](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1bd')));if(_0x5a7b2d['checkRetriveMax'](0x3,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0x107')]>=_0x26c471['dialNoAnswerMaxRetry']){_0x5a7b2d[_0xc867('0x109')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1be'));}else{_0x5a7b2d['stateGlobal'](_0xb4f713,_0x56b789,_0x1a9549,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x26c471[_0xc867('0x1bf')]+=0x1;_0xb4f713[_0xc867('0xa5')]=0x5;_0xb4f713[_0xc867('0x103')]=_0xc867('0x1c0');_0xb4f713[_0xc867('0xf2')]+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;ami[_0xc867('0x4a')](_0xc867('0x1c1'),ut[_0xc867('0xe9')](_0x59214d,_0xc867('0x1c2')));_0x5f829e=_0x26c471[_0xc867('0x1ab')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];_0x5a7b2d[_0xc867('0xcb')](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1c3')));if(_0x5a7b2d[_0xc867('0x1a8')](0x5,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0xf2')]>=_0x26c471[_0xc867('0x1c4')]){_0x5a7b2d['createStateFinal'](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1c5'));}else{_0x5a7b2d['stateGlobal'](_0xb4f713,_0x56b789,_0x1a9549,'reason\x205\x20busy');}}break;case'8':_0x26c471[_0xc867('0x5d')]+=0x1;_0xb4f713['state']=0x8;_0xb4f713[_0xc867('0x103')]='Congestion';_0xb4f713[_0xc867('0xf3')]+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;_0x5f829e=_0x26c471[_0xc867('0x1ae')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];ami['emit'](_0xc867('0x1c6'),ut[_0xc867('0xe9')](_0x59214d,_0xc867('0x1c7')));_0x5a7b2d[_0xc867('0xcb')](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1c8')));if(_0x5a7b2d[_0xc867('0x1a8')](0x8,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713['countcongestionretry']>=_0x26c471[_0xc867('0x1ad')]){_0x5a7b2d['createStateFinal'](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1c9'));}else{_0x5a7b2d[_0xc867('0xf9')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1c9'));}}break;case'11':_0x26c471['outboundAbandonedCallsDay']+=0x1;_0xb4f713[_0xc867('0xa5')]=0xb;_0xb4f713[_0xc867('0x103')]=_0xc867('0x12c');_0xb4f713[_0xc867('0xf6')]+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;_0x5f829e=_0x26c471[_0xc867('0x129')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];_0x5a7b2d['createHistory'](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1ca')));if(_0x5a7b2d[_0xc867('0x1a8')](0xb,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0xf6')]>=_0x26c471['dialAbandonedMaxRetry']){_0x5a7b2d['createStateFinal'](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1cb'));}else{_0x5a7b2d[_0xc867('0xf9')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1cb'));}}break;case'20':_0x26c471[_0xc867('0x1cc')]+=0x1;_0xb4f713[_0xc867('0xa5')]=0x14;_0xb4f713['statedesc']=_0xc867('0x1cd');_0xb4f713[_0xc867('0xf7')]+=0x1;_0xb4f713[_0xc867('0xf0')]+=0x1;_0x5f829e=_0x26c471[_0xc867('0x1b3')];_0x29dd65=_0x26c471[_0xc867('0x1ba')];ami[_0xc867('0x4a')](_0xc867('0x1ce'),ut['buildObj'](_0x59214d,_0xc867('0x1cf')));_0x5a7b2d[_0xc867('0xcb')](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1d0')));if(_0x5a7b2d[_0xc867('0x1a8')](0x14,_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0xf7')]>=_0x26c471[_0xc867('0x1d1')]){_0x5a7b2d['createStateFinal'](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1d2'));}else{_0x5a7b2d[_0xc867('0xf9')](_0xb4f713,_0x56b789,_0x1a9549,_0xc867('0x1d2'));}}break;default:_0x26c471[_0xc867('0x64')]+=0x1;_0xb4f713['state']=0xc;_0xb4f713['statedesc']=_0x500fa8['reason'];_0x5f829e=_0x26c471['dialAgentRejectRetryFrequency'];_0x29dd65=_0x26c471['callAdditionalPhoneAfterMin'];_0x5a7b2d[_0xc867('0xcb')](_0xb4f713)[_0xc867('0xaf')](loggerCatch(_0xc867('0x1d3')));if(_0x5a7b2d[_0xc867('0x1a8')](_0x500fa8[_0xc867('0x112')],_0x59214d,_0x26c471)&&!_0x46317f){if(_0xb4f713[_0xc867('0xf2')]+_0xb4f713[_0xc867('0xf3')]+_0xb4f713['countnoanswerretry']+_0xb4f713[_0xc867('0xf4')]+_0xb4f713['countdropretry']+_0xb4f713[_0xc867('0xf6')]+_0xb4f713[_0xc867('0xef')]+_0xb4f713['countagentrejectretry']>=_0x26c471[_0xc867('0xf8')]){_0x5a7b2d['stateGlobal'](_0xb4f713,_0x56b789,_0x1a9549,_0x500fa8[_0xc867('0x112')]);}else{_0x5a7b2d[_0xc867('0x109')](_0xb4f713,_0x56b789,_0x1a9549,_0x500fa8[_0xc867('0x112')]);}}}})[_0xc867('0x3b')](function(){if(_0x46317f){_0x5a7b2d[_0xc867('0xba')](_0xb4f713,_0x5f829e,_0x29dd65)[_0xc867('0x3b')](function(){return _0x56b789(0x1);});}});});};Dialer['prototype'][_0xc867('0xf9')]=function(_0x551ac1,_0x3654be,_0x446fef,_0x41a7ab){var _0x538ca1=new Final(_0x551ac1);_0x538ca1[_0xc867('0xa5')]=0xf;_0x538ca1['statedesc']=_0xc867('0x1d4');this[_0xc867('0x109')](_0x538ca1,_0x3654be,_0x446fef,_0x41a7ab);};Dialer[_0xc867('0x19')][_0xc867('0x109')]=function(_0x19bbcb,_0x3482c6,_0x55ded3,_0x2ee08d){this[_0xc867('0xc9')](_0x19bbcb)['then'](function(){return _0x3482c6(msgResponse(_0xc867('0x1b5'),'Success',_0x2ee08d));})[_0xc867('0xaf')](function(){return _0x55ded3(msgResponse(_0xc867('0x1d5'),_0xc867('0x14e'),'contact\x20not\x20moved'));});};Dialer[_0xc867('0x19')]['predictive']=function(_0x265c26){var _0x2d566a=_0x265c26[_0xc867('0x1d6')]/0x64;var _0x48f025=_0x265c26[_0xc867('0x5f')]/(_0x265c26[_0xc867('0x5f')]+_0x265c26['outboundAnswerCallsDay']);var _0x5d91f4=Math[_0xc867('0x1d7')](_0x265c26[_0xc867('0x6c')]*(_0x265c26['predictiveIntervalMaxThreshold']/0x64));var _0x45ec66=Math['round'](_0x265c26[_0xc867('0x6c')]*(_0x265c26[_0xc867('0x1d8')]/0x64));var _0x3fe753=_0x265c26[_0xc867('0x4f')]+_0x265c26[_0xc867('0x1d9')];var _0x4acb8b=Math['floor'](_0x265c26[_0xc867('0x84')]*_0x265c26[_0xc867('0x6e')]*_0x265c26['predictiveIntervalHitRate']*_0x265c26['predictiveIntervalMultiplicativeFactor']);if(_[_0xc867('0x3d')](_0x265c26['startProgressive'])){if(!_[_0xc867('0x3d')](_0x265c26[_0xc867('0x26')])){_0x265c26[_0xc867('0x26')]=undefined;loggerPredictive['error'](_0xc867('0x1da'),_0xc867('0x1db'));}if(!_[_0xc867('0x3d')](_0x265c26[_0xc867('0x8b')])){loggerPredictive[_0xc867('0x92')](_0xc867('0x1da'),_0xc867('0x1dc'));clearInterval(_0x265c26['handlePredictive']);_0x265c26[_0xc867('0x8b')]=undefined;}_0x265c26[_0xc867('0x27')]=moment()[_0xc867('0x74')](_0xc867('0x10b'));loggerPredictive[_0xc867('0x79')](_0x265c26[_0xc867('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x265c26[_0xc867('0x27')]);this[_0xc867('0x15f')](_0x265c26,0x1);}else if(ifInterval(_0x265c26['dialPredictiveInterval'],_0x265c26[_0xc867('0x27')])){this[_0xc867('0x15f')](_0x265c26,0x1);loggerPredictiveCalls[_0xc867('0x79')]('[startMethodPredictive][StartProgressive][Loop]',_0x265c26['startProgressive'],_0x265c26['name']);_0x265c26[_0xc867('0x84')]=0x0;_0x265c26[_0xc867('0x69')]=0x0;}else if(_0x2d566a<_0x48f025&&_0x265c26[_0xc867('0x1dd')]===_0xc867('0x1de')){freeVariablesPredictive(_0x265c26);loggerPredictive[_0xc867('0x79')](_0xc867('0x1df'),_0xc867('0x1e0'),_0x48f025,_0xc867('0x27'),_0x265c26[_0xc867('0x40')]);}else if(_0x4acb8b<_0x265c26[_0xc867('0x69')]&&_0x265c26[_0xc867('0x1dd')]===_0xc867('0x1de')){freeVariablesPredictive(_0x265c26);loggerPredictive[_0xc867('0x79')](_0xc867('0x1e1'),_0xc867('0x1e2'),_0x4acb8b,_0xc867('0x1e3'),_0x265c26[_0xc867('0x69')],_0xc867('0x27'),_0x265c26[_0xc867('0x40')]);}else if(!ifInterval(_0x265c26['dialPredictiveInterval'],_0x265c26[_0xc867('0x27')])&&_[_0xc867('0x3d')](_0x265c26[_0xc867('0x26')])&&!_['isUndefined'](_0x265c26[_0xc867('0x27')])){_0x265c26[_0xc867('0x26')]=moment()[_0xc867('0x74')](_0xc867('0x10b'));loggerPredictive[_0xc867('0x79')](_0x265c26[_0xc867('0x40')],_0xc867('0x1e4'),_0x265c26[_0xc867('0x26')]);this['averageHandleTime'](_0x265c26[_0xc867('0x1e5')])[_0xc867('0x3b')](this[_0xc867('0x1e6')](_0x265c26))[_0xc867('0x3b')](mergeDataErlangB(_0x265c26))[_0xc867('0x3b')](this['startMethodPredictive'](_0x265c26))[_0xc867('0xaf')](loggerCatchPredictive(_0xc867('0x1e7'),_0x265c26));}else if(!ifInterval(_0x265c26[_0xc867('0x1e5')],_0x265c26[_0xc867('0x26')])){_0x265c26[_0xc867('0x69')]=0x0;_0x265c26[_0xc867('0x26')]=moment()[_0xc867('0x74')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc867('0x79')](_0x265c26[_0xc867('0x40')],_0xc867('0x1e8'),_0x265c26[_0xc867('0x26')]);clearInterval(_0x265c26[_0xc867('0x8b')]);_0x265c26[_0xc867('0x8b')]=undefined;this[_0xc867('0x1e9')](_0x265c26[_0xc867('0x1e5')])[_0xc867('0x3b')](this[_0xc867('0x1e6')](_0x265c26))[_0xc867('0x3b')](mergeDataErlangB(_0x265c26))[_0xc867('0x3b')](this['startMethodPredictive'](_0x265c26))[_0xc867('0xaf')](loggerCatchPredictive(_0xc867('0x1ea'),_0x265c26));}else if(_0x265c26['predictiveIntervalAvailable']&&_0x3fe753<_0x265c26['predictiveIntervalAvailable']-_0x45ec66){freeVariablesPredictive(_0x265c26);loggerPredictive[_0xc867('0x79')](_0x265c26[_0xc867('0x40')],_0xc867('0x1eb'),_0x3fe753,_0xc867('0x1ec'),_0x265c26[_0xc867('0x6c')],'-',_0x45ec66,'=',_0x265c26[_0xc867('0x6c')]-_0x45ec66,')');}else if(_0x265c26[_0xc867('0x6c')]&&_0x3fe753>_0x265c26['predictiveIntervalAvailable']+_0x5d91f4){freeVariablesPredictive(_0x265c26);loggerPredictive[_0xc867('0x79')](_0x265c26[_0xc867('0x40')],_0xc867('0x1eb'),_0x3fe753,')\x20are\x20more\x20than\x20threshold\x20(',_0x265c26['predictiveIntervalAvailable'],'+',_0x5d91f4,'=',_0x265c26[_0xc867('0x6c')]+_0x5d91f4,')');}};Dialer[_0xc867('0x19')][_0xc867('0x1e6')]=function(_0x4592f7){var _0x48e250=this;return function(_0x5f186d){return new Promise(function(_0x226073,_0x414120){_[_0xc867('0x88')](_0x4592f7,_0x5f186d[0x0]);if(checkGetDataPredictive(_0x5f186d[0x0])){var _0x2478f9=_0x4592f7[_0xc867('0x6c')]=_0x4592f7[_0xc867('0x1d9')]+_0x4592f7[_0xc867('0x4f')];var _0x146708=_0x4592f7[_0xc867('0x1e5')]*0x3c;var _0x4d36b4=_0x5f186d[0x0][_0xc867('0x66')]+_0x5f186d[0x0]['predictiveIntervalAvgHoldtime'];var _0xa94888=(_0x5f186d[0x0][_0xc867('0x7b')]+_0x5f186d[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5f186d[0x0][_0xc867('0x7e')])/_0x5f186d[0x0][_0xc867('0x6d')];_0x4592f7[_0xc867('0x6a')]=_0xa94888>0x0?_0xa94888:0x1;switch(_0x4592f7[_0xc867('0x1dd')]){case _0xc867('0x1de'):var _0x3b5637=_0x4592f7[_0xc867('0x1d6')]/0x64;return _0x48e250[_0xc867('0x1ed')](_0x2478f9,_0x146708,_0x4d36b4,_0xa94888,_0x3b5637)[_0xc867('0x3b')](function(_0x55ae2a){return _0x226073(_0x55ae2a);});case _0xc867('0x1ee'):var _0x12cc28=_0x4592f7['dialPredictiveOptimizationPercentage']/0x64;return _0x48e250[_0xc867('0x1ef')](_0x2478f9,_0x146708,_0x4d36b4,_0xa94888,_0x12cc28)[_0xc867('0x3b')](function(_0x403591){return _0x226073(_0x403591);});default:return _0x414120(msgResponse(_0xc867('0x1f0'),_0xc867('0x14e'),'Unknown\x20Predictive'));}}else{return _0x414120(msgResponse('[getDataPredictive]',_0xc867('0x14e'),'check\x20failure'));}});};};Dialer[_0xc867('0x19')][_0xc867('0x1f1')]=function(_0x4aa4e1){var _0x59f217=this;return function(_0x4133a7){return new Promise(function(_0x35615a,_0x58ffa3){_[_0xc867('0x88')](_0x4aa4e1,_0x4133a7[0x0]);if(checkGetDataPredictive(_0x4133a7[0x0])){loggerPredictive[_0xc867('0x79')](JSON[_0xc867('0x73')](_0x4133a7[0x0]));if(_0x4aa4e1[_0xc867('0x1dd')]===_0xc867('0x1de')){return _0x59f217[_0xc867('0xc7')](_0x4aa4e1['id'])['then'](function(_0x5d207b){var _0x483c2e=_0x4aa4e1['loggedIn']-_0x5d207b[0x0][_0xc867('0x1f2')];var _0xe659e2=_0x4aa4e1[_0xc867('0x1e5')]*0x3c;var _0x429a6c=_0x4133a7[0x0][_0xc867('0x66')]+_0x4133a7[0x0][_0xc867('0x65')];var _0x1739b6=(_0x4133a7[0x0][_0xc867('0x7b')]+_0x4133a7[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4133a7[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4133a7[0x0]['predictiveIntervalTotalCalls'];var _0x1db136=_0x4aa4e1[_0xc867('0x1d6')]/0x64;_0x4aa4e1['predictiveIntervalPauses']=_0x5d207b[0x0][_0xc867('0x1f2')]||0x0;_0x4aa4e1[_0xc867('0x6a')]=_0x1739b6>0x0?_0x1739b6:0x1;return _0x59f217['abandonmentRate'](_0x483c2e,_0xe659e2,_0x429a6c,_0x1739b6,_0x1db136);})[_0xc867('0x3b')](function(_0x299357){return _0x35615a(_0x299357);})[_0xc867('0xaf')](function(_0x58708c){return _0x58ffa3(msgResponse(_0xc867('0x1f3'),_0xc867('0x14e'),JSON[_0xc867('0x73')](_0x58708c)));});}if(_0x4aa4e1[_0xc867('0x1dd')]===_0xc867('0x1ee')){return _0x59f217[_0xc867('0xc7')](_0x4aa4e1['id'])[_0xc867('0x3b')](function(_0x5b21db){var _0xfe2090=_0x4aa4e1['loggedIn']-_0x5b21db[0x0][_0xc867('0x1f2')];var _0x207a11=_0x4aa4e1[_0xc867('0x1e5')]*0x3c;var _0x1bd820=_0x4133a7[0x0][_0xc867('0x66')]+_0x4133a7[0x0][_0xc867('0x65')];var _0x208a63=(_0x4133a7[0x0][_0xc867('0x7b')]+_0x4133a7[0x0][_0xc867('0x67')]+_0x4133a7[0x0][_0xc867('0x7e')])/_0x4133a7[0x0][_0xc867('0x6d')];var _0x337ca9=_0x4aa4e1['dialPredictiveOptimizationPercentage']/0x64;_0x4aa4e1[_0xc867('0x6b')]=_0x5b21db[0x0][_0xc867('0x1f2')]||0x0;_0x4aa4e1[_0xc867('0x6a')]=_0x208a63>0x0?_0x208a63:0x1;return _0x59f217[_0xc867('0x1ef')](_0xfe2090,_0x207a11,_0x1bd820,_0x208a63,_0x337ca9);})['then'](function(_0x201d14){return _0x35615a(_0x201d14);})[_0xc867('0xaf')](function(_0x14be6c){return _0x58ffa3(msgResponse(_0xc867('0x1f3'),_0xc867('0x14e'),JSON[_0xc867('0x73')](_0x14be6c)));});}}else{return _0x58ffa3(msgResponse(_0xc867('0x1f0'),_0xc867('0x14e'),_0xc867('0x1f4')));}});};};Dialer[_0xc867('0x19')][_0xc867('0x1f5')]=function(_0x3ff7c0){var _0x200efd=this;return function(){var _0x2388e3=0x0;var _0x1ecdce=Math[_0xc867('0x1f6')](_0x3ff7c0[_0xc867('0x86')]*0x3e8);if(_0x1ecdce>0x0){_0x1ecdce=_0x1ecdce<0x64?0x64:_0x1ecdce;loggerPredictive['info'](_0x3ff7c0[_0xc867('0x40')],'one\x20call\x20every:',_0x1ecdce,_0xc867('0x47'));_0x3ff7c0[_0xc867('0x8b')]=setInterval(function(){_0x200efd[_0xc867('0x8b')](_0x3ff7c0);loggerPredictiveCalls['info']('[handlePredictive]',_0x2388e3+=0x1);},_0x1ecdce);}else{loggerPredictive[_0xc867('0x79')](_0x3ff7c0[_0xc867('0x40')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc867('0x19')][_0xc867('0x1f7')]=function(_0x478dc9,_0x5da3e2){var _0x594c5d=this;return function(_0x3ec36d){if(_['isEmpty'](_0x3ec36d)){if(_[_0xc867('0xac')](_0x5da3e2[_0xc867('0xd3')])||!_0x5da3e2[_0xc867('0x1f8')]){if(_0x478dc9[_0xc867('0x59')]===_0xc867('0x7')){_0x478dc9[_0xc867('0x134')]=_['isUndefined'](_0x478dc9[_0xc867('0x134')])?!![]:_0x478dc9[_0xc867('0x134')];var _0xd381fe=uuid['v4']();_0x594c5d[_0xc867('0xa9')][_0xd381fe]=new Action(_0x478dc9,_0x5da3e2,_0xd381fe);loggerBooked[_0xc867('0x79')](_0xc867('0x1f9'),_0xd381fe,_0xc867('0x1fa'),JSON[_0xc867('0x73')](_0x478dc9['queueStatusComplete']),'Queue:\x20',_0x478dc9[_0xc867('0x40')]);if(_0x478dc9[_0xc867('0x134')]){_0x478dc9[_0xc867('0x134')]=![];_0x594c5d['queueBooked'][_0x594c5d['actions'][_0xd381fe][_0xc867('0xb1')]]=[];ami[_0xc867('0xad')]({'actionid':_0xd381fe,'action':_0xc867('0x1fb'),'queue':_0x478dc9[_0xc867('0x40')]})[_0xc867('0xaf')](function(){_0x594c5d['updateOriginated'](_0x478dc9);_0x594c5d['rescheduleContact']({'active':![],'ContactId':_0x594c5d['actions'][_0xd381fe][_0xc867('0xfe')],'ListId':_0x594c5d['actions'][_0xd381fe][_0xc867('0xff')],'VoiceQueueId':_0x594c5d[_0xc867('0xa9')][_0xd381fe][_0xc867('0xd4')]||undefined,'CampaignId':_0x594c5d[_0xc867('0xa9')][_0xd381fe]['CampaignId']||undefined})['catch'](loggerCatch(_0xc867('0x1fc')));delete _0x594c5d['actions'][_0xd381fe];});}else{loggerBooked[_0xc867('0x79')](_0xc867('0x1fd'),JSON[_0xc867('0x73')](_0x478dc9[_0xc867('0x134')]),_0xc867('0x1fe'),_0x478dc9[_0xc867('0x40')]);_0x594c5d[_0xc867('0xb0')](_0x478dc9);_0x594c5d[_0xc867('0xbf')]({'active':![],'ContactId':_0x594c5d['actions'][_0xd381fe][_0xc867('0xfe')],'ListId':_0x594c5d['actions'][_0xd381fe]['ListId'],'VoiceQueueId':_0x594c5d['actions'][_0xd381fe][_0xc867('0xd4')]||undefined,'CampaignId':_0x594c5d[_0xc867('0xa9')][_0xd381fe]['CampaignId']||undefined})['catch'](loggerCatch(_0xc867('0x1fc')));delete _0x594c5d[_0xc867('0xa9')][_0xd381fe];}}else{return _0x594c5d['actionOriginate'](_0x478dc9,_0x5da3e2);}}else{if(getDiff(_0x5da3e2[_0xc867('0x1ff')])<_0x478dc9[_0xc867('0x200')]*0x3c){if(_0x5da3e2['Agent']&&!_0x5da3e2[_0xc867('0x165')][_0xc867('0x201')]){_0x594c5d[_0xc867('0x1c')][_0xc867('0x136')](_0x5da3e2['id'])['finally'](function(){_0x594c5d[_0xc867('0xb0')](_0x478dc9);});}else{_0x594c5d[_0xc867('0xc1')]({'active':![]},_0x5da3e2['id'],0x1)[_0xc867('0x137')](function(){_0x594c5d[_0xc867('0xb0')](_0x478dc9);});}}else{_0x478dc9[_0xc867('0x63')]+=0x1;_0x594c5d[_0xc867('0xb0')](_0x478dc9);if(_0x478dc9['dialRecallInQueue']){_0x594c5d[_0xc867('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5da3e2[_0xc867('0xfe')],'ListId':_0x5da3e2[_0xc867('0xff')],'VoiceQueueId':_0x5da3e2['VoiceQueueId']||undefined,'CampaignId':_0x5da3e2['CampaignId']||undefined})[_0xc867('0xaf')](loggerCatch(_0xc867('0x202')));_0x594c5d[_0xc867('0xcb')](createObjHistory(_0x478dc9,_0x5da3e2,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xc867('0xaf')](loggerCatch(_0xc867('0x203')));}else{_0x594c5d[_0xc867('0xdf')](createObjHistory(_0x478dc9,_0x5da3e2,'RECALLFAILEDTIMEOUT',0x16,'RecallFailedTimeout'),_0xc867('0x204'),_0xc867('0x205'));}}}}else{_0x478dc9['outboundBlacklistCallsDay']+=0x1;_0x594c5d[_0xc867('0xdf')](createObjHistory(_0x478dc9,_0x5da3e2,'BLACKLIST',0xd,_0xc867('0x206')),_0xc867('0x207'),_0xc867('0x208'));throw _0xc867('0x209');}};};Dialer[_0xc867('0x19')][_0xc867('0x20a')]=function(_0x53e312){var _0x52ed10=this;var _0xeaa0d7=_0x53e312[_0xc867('0x20b')]-_0x53e312[_0xc867('0x95')]-_0x53e312['temp'];emitCampaignSummary(_0x53e312);if(_0xeaa0d7>0x0){if(_0xeaa0d7>this[_0xc867('0x21')]){_0xeaa0d7=this[_0xc867('0x21')];}_0x53e312['temp']+=_0xeaa0d7;this[_0xc867('0xc5')](_0x53e312['id'],_0xeaa0d7,_0x53e312[_0xc867('0x20c')],_0x53e312)[_0xc867('0x3b')](function(_0x19e773){_0x53e312[_0xc867('0xc3')]-=_0xeaa0d7;_0x53e312[_0xc867('0xc3')]=_0x53e312[_0xc867('0xc3')]>0x0?_0x53e312[_0xc867('0xc3')]:0x0;if(!checkContactEmpty(_0x19e773)){_0x53e312['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xc867('0x79')](_0xc867('0x20d')+_0x53e312[_0xc867('0x40')]);}else{_0x53e312[_0xc867('0x95')]+=_0x19e773[_0xc867('0x94')];_0x53e312[_0xc867('0x3e')]='RUNNING';for(var _0x3a387d=0x0;_0x3a387d<_0x19e773['length'];_0x3a387d+=0x1){_0x53e312[_0xc867('0x20e')]+=0x1;if(_['isNil'](_0x19e773[_0x3a387d])||_['isNil'](_0x19e773[_0x3a387d][_0xc867('0x190')])||_[_0xc867('0xac')](_0x19e773[_0x3a387d][_0xc867('0x17b')])){_0x52ed10[_0xc867('0xd0')](_0xc867('0x20f'),_0x53e312,_0x19e773[_0x3a387d]);}else{_0x52ed10['checkIsBlackListIvr'](_['pick'](_0x19e773[_0x3a387d],[_0xc867('0xd5'),'phone']))[_0xc867('0x3b')](_0x52ed10['checkContactBlack'](_0x53e312,_0x19e773[_0x3a387d]))[_0xc867('0xaf')](_0x52ed10[_0xc867('0xcf')](_0xc867('0x210'),_0x53e312));}}}})[_0xc867('0xaf')](loggerGetContactDialer('[getContactCampaign2]',_0x53e312,_0xeaa0d7));}};Dialer[_0xc867('0x19')]['handlePower']=function(_0x3381e4,_0x1c4e31){var _0x231462=this;var _0x4ab9f1=[];var _0x386b2f=_0x1c4e31>=0x1?_0x1c4e31:0x1;if(_0x3381e4[_0xc867('0x59')]===_0xc867('0x7')){_0x386b2f=0x1;}var _0x161663=Math[_0xc867('0x1f6')](_0x3381e4['available']*_0x386b2f)-_0x3381e4[_0xc867('0x95')]-_0x3381e4[_0xc867('0xc3')];emitVoiceQueueSummary(_0x3381e4);if(_0x3381e4[_0xc867('0x211')]>0x0){var _0x38094e=_0x3381e4[_0xc867('0x211')]-_0x3381e4[_0xc867('0x95')]-_0x3381e4[_0xc867('0x1d9')]-_0x3381e4[_0xc867('0xc3')]-_0x3381e4[_0xc867('0x51')];if(_0x161663>_0x38094e){_0x161663=_0x38094e;}}if(_0x161663>0x0){if(_0x3381e4[_0xc867('0x59')]==='booked'){_0x161663=0x1;}if(_0x161663>this[_0xc867('0x21')]){_0x161663=this['maxNumberOriginate'];}_0x3381e4[_0xc867('0xc3')]+=_0x161663;for(var _0xbe57c9 in this[_0xc867('0x1f')]){if(typeof this[_0xc867('0x1f')][_0xbe57c9]!==_0xc867('0x96')){if(this[_0xc867('0x1f')][_0xbe57c9]['state']===_0xc867('0x212')&&this['agents'][_0xbe57c9][_0xc867('0xdd')]===_0xc867('0xdc')){_0x4ab9f1[_0xc867('0x132')](this[_0xc867('0x1f')][_0xbe57c9]['id']);}}}this['getContactDialer'](_0x3381e4['id'],_0x4ab9f1,_0x161663,_0x3381e4[_0xc867('0x20c')],_0x3381e4)[_0xc867('0x3b')](function(_0x2f4f25){_0x3381e4[_0xc867('0xc3')]-=_0x161663;_0x3381e4['temp']=_0x3381e4[_0xc867('0xc3')]>0x0?_0x3381e4['temp']:0x0;if(!checkContactEmpty(_0x2f4f25)){_0x231462[_0xc867('0xb4')](_0x3381e4)[_0xc867('0x3b')](sendMessageReschedule(_0x3381e4))[_0xc867('0xaf')](loggerCatch('[countReScheduled]\x20'));}else{_0x3381e4[_0xc867('0x95')]+=_0x2f4f25[_0xc867('0x94')];_0x3381e4[_0xc867('0x3e')]=_0x3381e4['dialMethod']===_0xc867('0x7')?_0xc867('0x213'):_0xc867('0x214');for(var _0xe1cf6b=0x0;_0xe1cf6b<_0x2f4f25[_0xc867('0x94')];_0xe1cf6b+=0x1){if(_[_0xc867('0xac')](_0x2f4f25[_0xe1cf6b])||_['isNil'](_0x2f4f25[_0xe1cf6b][_0xc867('0x190')])||_['isNil'](_0x2f4f25[_0xe1cf6b][_0xc867('0x17b')])){_0x231462[_0xc867('0xd0')](_0xc867('0x20f'),_0x3381e4,_0x2f4f25[_0xe1cf6b]);}else{_0x231462[_0xc867('0xb7')](_[_0xc867('0xd2')](_0x2f4f25[_0xe1cf6b],[_0xc867('0xd4'),'phone']))[_0xc867('0x3b')](_0x231462['checkContactBlack'](_0x3381e4,_0x2f4f25[_0xe1cf6b]))[_0xc867('0xaf')](_0x231462[_0xc867('0xcf')](_0xc867('0x20f'),_0x3381e4));}}}})[_0xc867('0xaf')](loggerGetContactDialer(_0xc867('0x215'),_0x3381e4,_0x161663));}};Dialer[_0xc867('0x19')]['handlePredictive']=function(_0x18bc29){if(_0x18bc29[_0xc867('0x211')]>0x0){var _0xdd0c89=_0x18bc29[_0xc867('0x211')]-_0x18bc29[_0xc867('0x95')]-_0x18bc29[_0xc867('0x1d9')];if(_0xdd0c89>0x0){this[_0xc867('0x216')](_0x18bc29);}else{loggerPredictiveCalls[_0xc867('0x79')](_0xc867('0x217'));}}else{this['tryOriginatePredictive'](_0x18bc29);}};Dialer[_0xc867('0x19')][_0xc867('0x216')]=function(_0x5c256e){var _0x22ccc1=this;var _0x5501d4=[];_0x5c256e[_0xc867('0x95')]+=0x1;for(var _0x5e317a in this['agents']){if(typeof this[_0xc867('0x1f')][_0x5e317a]!==_0xc867('0x96')){if(this[_0xc867('0x1f')][_0x5e317a][_0xc867('0xa5')]===_0xc867('0x212')&&this[_0xc867('0x1f')][_0x5e317a][_0xc867('0xdd')]===_0xc867('0xdc')){_0x5501d4[_0xc867('0x132')](this[_0xc867('0x1f')][_0x5e317a]['id']);}}}this[_0xc867('0xc2')](_0x5c256e['id'],_0x5501d4,0x1,_0x5c256e['dialOrderByScheduledAt'],_0x5c256e)[_0xc867('0x3b')](function(_0x1a3dd2){if(!checkContactEmpty(_0x1a3dd2)){checkContactLowerLimitOriginate(_0x5c256e,0x1,0x0);_0x22ccc1[_0xc867('0xb4')](_0x5c256e)[_0xc867('0x3b')](sendMessageReschedule(_0x5c256e))[_0xc867('0xaf')](loggerCatch(_0xc867('0xb6')));}else{_0x5c256e[_0xc867('0x3e')]=_0xc867('0x214');if(_[_0xc867('0xac')](_0x1a3dd2[0x0])||_[_0xc867('0xac')](_0x1a3dd2[0x0][_0xc867('0x190')])||_['isNil'](_0x1a3dd2[0x0][_0xc867('0x17b')])){_0x22ccc1[_0xc867('0xd0')](_0xc867('0x20f'),_0x5c256e,_0x1a3dd2[0x0]);}else{_0x22ccc1['checkIsBlackList'](_[_0xc867('0xd2')](_0x1a3dd2[0x0],[_0xc867('0xd4'),'phone']))['then'](_0x22ccc1[_0xc867('0x1f7')](_0x5c256e,_0x1a3dd2[0x0]))[_0xc867('0xaf')](_0x22ccc1['loggerHandler'](_0xc867('0x218'),_0x5c256e));}}})[_0xc867('0xaf')](loggerGetContactDialer(_0xc867('0x219'),_0x5c256e,0x1));emitVoiceQueueSummary(_0x5c256e);};Dialer[_0xc867('0x19')][_0xc867('0x1ed')]=function(_0x4ad2bb,_0x134265,_0x414808,_0x1d5855,_0xfc4626,_0xda12a2){loggerPredictive[_0xc867('0x79')](_0xc867('0x21a'));loggerPredictive[_0xc867('0x79')](_0xc867('0x21b'),_0x4ad2bb);loggerPredictive[_0xc867('0x79')](_0xc867('0x21c'),_0x134265);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x414808);loggerPredictive[_0xc867('0x79')](_0xc867('0x21d'),_0x1d5855);loggerPredictive[_0xc867('0x79')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xfc4626);loggerPredictive[_0xc867('0x79')](_0xc867('0x81'));return new Promise(function(_0x2e03da,_0x35dc6d){if(_0x4ad2bb<=0x0||isNaN(_0x4ad2bb)){return _0x35dc6d(msgResponse(_0xc867('0x21e'),_0xc867('0x1a3'),'m\x20=\x20'+_0x4ad2bb));}if(_0x414808<=0x0||isNaN(_0x414808)){return _0x35dc6d(msgResponse(_0xc867('0x21e'),_0xc867('0x1a3'),_0xc867('0x21f')+_0x414808));}if(_0x1d5855<=0x0||isNaN(_0x1d5855)){return _0x35dc6d(msgResponse(_0xc867('0x21e'),'Error',_0xc867('0x220')+_0x1d5855));}if(_0x134265<=0x0||isNaN(_0x134265)){return _0x35dc6d(msgResponse(_0xc867('0x21e'),'Error',_0xc867('0x221')+_0x134265));}if(_0xfc4626<=0x0||isNaN(_0xfc4626)){return _0x35dc6d(msgResponse(_0xc867('0x21e'),_0xc867('0x1a3'),_0xc867('0x222')+_0xfc4626));}_0xda12a2=_0xda12a2||0x0;var _0x391832=0x1/_0x414808;var _0x528f2d=0x0;var _0x2e5167=0x0;var _0x575813=0x0;var _0x4ffa77=0x0;for(var _0x3b0976=0x0;_0x575813<_0xfc4626;_0x3b0976+=0x1){_0x2e5167=_0x3b0976/_0x134265;_0x528f2d=(_0x1d5855*_0x2e5167+_0xda12a2)/_0x391832;_0x575813=erlangb(_0x528f2d,_0x4ad2bb);_0x4ffa77=_0x528f2d/_0x4ad2bb*(0x1-erlangb(_0x528f2d,_0x4ad2bb));}return _0x2e03da({'erlangCalls':_0x3b0976,'erlangCallToSecond':_0x134265/_0x3b0976,'erlangAbandonmentRate':_0x575813,'erlangBusyFactor':_0x4ffa77});});};Dialer[_0xc867('0x19')][_0xc867('0x1ef')]=function(_0x1e25db,_0x3fb99e,_0x42f196,_0x553871,_0xa20a74,_0x9f76ae){loggerPredictive[_0xc867('0x79')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e25db);loggerPredictive[_0xc867('0x79')](_0xc867('0x21c'),_0x3fb99e);loggerPredictive[_0xc867('0x79')](_0xc867('0x223'),_0x42f196);loggerPredictive['info'](_0xc867('0x21d'),_0x553871);loggerPredictive[_0xc867('0x79')](_0xc867('0x224'),_0xa20a74);loggerPredictive[_0xc867('0x79')](_0xc867('0x81'));return new Promise(function(_0x5c1ed4,_0x20ef3d){if(_0x1e25db<=0x0||isNaN(_0x1e25db)){return _0x20ef3d(msgResponse(_0xc867('0x225'),'Error',_0xc867('0x226')+_0x1e25db));}if(_0x42f196<=0x0||isNaN(_0x42f196)){return _0x20ef3d(msgResponse('[busyFactor]',_0xc867('0x1a3'),_0xc867('0x21f')+_0x42f196));}if(_0x553871<=0x0||isNaN(_0x553871)){return _0x20ef3d(msgResponse('[busyFactor]','Error',_0xc867('0x220')+_0x553871));}if(_0x3fb99e<=0x0||isNaN(_0x3fb99e)){return _0x20ef3d(msgResponse('[busyFactor]','Error',_0xc867('0x221')+_0x3fb99e));}if(_0xa20a74<=0x0||isNaN(_0xa20a74)){return _0x20ef3d(msgResponse(_0xc867('0x225'),_0xc867('0x1a3'),_0xc867('0x227')+_0xa20a74));}_0x9f76ae=_0x9f76ae||0x0;var _0x3119d9=0x1/_0x42f196;var _0x4863ab=0x0;var _0x5eb7ba=0x0;var _0x185d1a=0x0;var _0x35aea5=0x0;for(var _0xafd30b=0x0;_0x35aea5<_0xa20a74;_0xafd30b+=0x1){_0x5eb7ba=_0xafd30b/_0x3fb99e;_0x4863ab=(_0x553871*_0x5eb7ba+_0x9f76ae)/_0x3119d9;_0x185d1a=erlangb(_0x4863ab,_0x1e25db);_0x35aea5=_0x4863ab/_0x1e25db*(0x1-erlangb(_0x4863ab,_0x1e25db));}return _0x5c1ed4({'erlangCalls':_0xafd30b,'erlangCallToSecond':_0x3fb99e/_0xafd30b,'erlangAbandonmentRate':_0x185d1a,'erlangBusyFactor':_0x35aea5});});};module[_0xc867('0x228')]=Dialer;
\ No newline at end of file
index 6abe850..3ad5f1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95f4=['countnoanswerretry','countnosuchnumberretry','countagentrejectretry','countdropretry','countabandonedretry','countmachineretry','uniqueid','starttime','responsetime','droptime','endtime','ringtime','holdtime','queue','membername','reason','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','seconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry'];(function(_0x4d99f7,_0x3db232){var _0x293ee3=function(_0x3450e6){while(--_0x3450e6){_0x4d99f7['push'](_0x4d99f7['shift']());}};_0x293ee3(++_0x3db232);}(_0x95f4,0x19b));var _0x495f=function(_0x257166,_0x76b05d){_0x257166=_0x257166-0x0;var _0x3b8401=_0x95f4[_0x257166];return _0x3b8401;};'use strict';var util=require('util');var _=require(_0x495f('0x0'));var moment=require('moment');function getSeconds(_0x238d5e,_0x1e7c86){var _0x583723=moment(_0x238d5e)[_0x495f('0x1')](0x0);var _0x1c5af9=moment(_0x1e7c86)[_0x495f('0x1')](0x0);return _0x583723[_0x495f('0x2')](_0x1c5af9,_0x495f('0x3'));}function QueueCallerAbandon(_0x18ade9,_0x52dea1){this[_0x495f('0x4')]=_0x18ade9['scheduledat'];this[_0x495f('0x5')]=_0x18ade9[_0x495f('0x5')];this[_0x495f('0x6')]=_0x18ade9[_0x495f('0x5')]==='outbound'?'queue':_0x18ade9[_0x495f('0x5')];this[_0x495f('0x7')]=_0x18ade9[_0x495f('0x7')];this['countcongestionretry']=_0x18ade9[_0x495f('0x8')];this[_0x495f('0x9')]=_0x18ade9['countnoanswerretry'];this['countglobal']=_0x18ade9['countbusyretry']+_0x18ade9[_0x495f('0x8')]+_0x18ade9['countnoanswerretry']+_0x18ade9[_0x495f('0xa')]+_0x18ade9['countdropretry']+_0x18ade9['countabandonedretry']+_0x18ade9['countmachineretry']+_0x18ade9[_0x495f('0xb')];this[_0x495f('0xa')]=_0x18ade9[_0x495f('0xa')];this[_0x495f('0xc')]=_0x18ade9[_0x495f('0xc')];this[_0x495f('0xd')]=_0x18ade9[_0x495f('0xd')];this[_0x495f('0xe')]=_0x18ade9[_0x495f('0xe')];this[_0x495f('0xb')]=_0x18ade9['countagentrejectretry'];this['uniqueid']=_0x52dea1[_0x495f('0xf')];this['calleridname']=_0x18ade9['name'];this['calleridnum']=_0x18ade9['number'];this[_0x495f('0x10')]=_0x18ade9[_0x495f('0x10')];this[_0x495f('0x11')]=_0x18ade9['responsetime'];this['droptime']=_0x18ade9[_0x495f('0x12')];this[_0x495f('0x13')]=this[_0x495f('0x12')];this[_0x495f('0x14')]=getSeconds(_0x18ade9[_0x495f('0x11')],_0x18ade9[_0x495f('0x10')]);this[_0x495f('0x15')]=getSeconds(this[_0x495f('0x12')],_0x18ade9['responsetime']);this['talktime']=0x0;this[_0x495f('0x16')]=_0x52dea1['queue'];this[_0x495f('0x17')]=_0x52dea1['connectedlinename'];this[_0x495f('0x18')]=_0x52dea1[_0x495f('0x18')];this['callback']=_0x18ade9['callback'];this['callbackuniqueid']=_0x18ade9['callbackuniqueid'];this[_0x495f('0x19')]=_0x18ade9[_0x495f('0x19')];this['recallme']=_0x18ade9[_0x495f('0x1a')];this[_0x495f('0x1b')]=_0x18ade9[_0x495f('0x1b')];this[_0x495f('0x1c')]=_0x18ade9[_0x495f('0x1c')];this[_0x495f('0x1d')]=_0x18ade9[_0x495f('0x1d')];this[_0x495f('0x1e')]=_0x18ade9[_0x495f('0x1e')];this[_0x495f('0x1f')]=_0x18ade9[_0x495f('0x1f')];this[_0x495f('0x20')]=_0x18ade9[_0x495f('0x20')]||'';this[_0x495f('0x21')]=_0x18ade9[_0x495f('0x21')]||'';}module[_0x495f('0x22')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x0842=['uniqueid','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry'];(function(_0x509dad,_0x1f995f){var _0x21e122=function(_0x2a9b90){while(--_0x2a9b90){_0x509dad['push'](_0x509dad['shift']());}};_0x21e122(++_0x1f995f);}(_0x0842,0xeb));var _0x2084=function(_0xafff94,_0x4f2efc){_0xafff94=_0xafff94-0x0;var _0xe841dc=_0x0842[_0xafff94];return _0xe841dc;};'use strict';var util=require(_0x2084('0x0'));var _=require('lodash');var moment=require(_0x2084('0x1'));function getSeconds(_0x3579b8,_0x514f0c){var _0x5bf5e0=moment(_0x3579b8)[_0x2084('0x2')](0x0);var _0x289089=moment(_0x514f0c)[_0x2084('0x2')](0x0);return _0x5bf5e0['diff'](_0x289089,_0x2084('0x3'));}function QueueCallerAbandon(_0xb17275,_0x42e7a6){this[_0x2084('0x4')]=_0xb17275[_0x2084('0x4')];this[_0x2084('0x5')]=_0xb17275[_0x2084('0x5')];this[_0x2084('0x6')]=_0xb17275[_0x2084('0x5')]===_0x2084('0x7')?_0x2084('0x8'):_0xb17275[_0x2084('0x5')];this[_0x2084('0x9')]=_0xb17275[_0x2084('0x9')];this[_0x2084('0xa')]=_0xb17275['countcongestionretry'];this['countnoanswerretry']=_0xb17275[_0x2084('0xb')];this['countglobal']=_0xb17275['countbusyretry']+_0xb17275[_0x2084('0xa')]+_0xb17275[_0x2084('0xb')]+_0xb17275[_0x2084('0xc')]+_0xb17275['countdropretry']+_0xb17275[_0x2084('0xd')]+_0xb17275[_0x2084('0xe')]+_0xb17275[_0x2084('0xf')];this[_0x2084('0xc')]=_0xb17275[_0x2084('0xc')];this[_0x2084('0x10')]=_0xb17275[_0x2084('0x10')];this[_0x2084('0xd')]=_0xb17275[_0x2084('0xd')];this[_0x2084('0xe')]=_0xb17275[_0x2084('0xe')];this['countagentrejectretry']=_0xb17275[_0x2084('0xf')];this[_0x2084('0x11')]=_0x42e7a6['uniqueid'];this['calleridname']=_0xb17275[_0x2084('0x12')];this['calleridnum']=_0xb17275[_0x2084('0x13')];this[_0x2084('0x14')]=_0xb17275[_0x2084('0x14')];this[_0x2084('0x15')]=_0xb17275[_0x2084('0x15')];this[_0x2084('0x16')]=_0xb17275[_0x2084('0x16')];this[_0x2084('0x17')]=this[_0x2084('0x16')];this[_0x2084('0x18')]=getSeconds(_0xb17275[_0x2084('0x15')],_0xb17275['starttime']);this[_0x2084('0x19')]=getSeconds(this[_0x2084('0x16')],_0xb17275[_0x2084('0x15')]);this[_0x2084('0x1a')]=0x0;this[_0x2084('0x8')]=_0x42e7a6['queue'];this[_0x2084('0x1b')]=_0x42e7a6[_0x2084('0x1c')];this[_0x2084('0x1d')]=_0x42e7a6[_0x2084('0x1d')];this[_0x2084('0x1e')]=_0xb17275[_0x2084('0x1e')];this[_0x2084('0x1f')]=_0xb17275[_0x2084('0x1f')];this[_0x2084('0x20')]=_0xb17275[_0x2084('0x20')];this[_0x2084('0x21')]=_0xb17275[_0x2084('0x21')];this[_0x2084('0x22')]=_0xb17275[_0x2084('0x22')];this[_0x2084('0x23')]=_0xb17275['ListId'];this[_0x2084('0x24')]=_0xb17275[_0x2084('0x24')];this[_0x2084('0x25')]=_0xb17275[_0x2084('0x25')];this[_0x2084('0x26')]=_0xb17275[_0x2084('0x26')];this[_0x2084('0x27')]=_0xb17275[_0x2084('0x27')]||'';this[_0x2084('0x28')]=_0xb17275[_0x2084('0x28')]||'';}module[_0x2084('0x29')]=QueueCallerAbandon;
\ No newline at end of file
index cb6a86e..b545d1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x15e349,_0x494535){var _0x313381=function(_0x4c00c7){while(--_0x4c00c7){_0x15e349['push'](_0x15e349['shift']());}};_0x313381(++_0x494535);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3c1247,_0x2584e6){var _0x14a1b0=function(_0x3d2bc2){while(--_0x3d2bc2){_0x3c1247['push'](_0x3c1247['shift']());}};_0x14a1b0(++_0x2584e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 0fa6dae..967f555 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1568=['Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','trunks','actions','newchannel','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','.pdf','application/pdf','then','notify','\x20notify\x20','stringify','catch','\x20receiveFax\x20','pick','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','Trunk','message'];(function(_0x34391a,_0x4d3116){var _0x21606a=function(_0x1f61ad){while(--_0x1f61ad){_0x34391a['push'](_0x34391a['shift']());}};_0x21606a(++_0x4d3116);}(_0x1568,0x100));var _0x8156=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1568[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x8156('0x0'));var _=require(_0x8156('0x1'));var BPromise=require(_0x8156('0x2'));var uuid=require(_0x8156('0x3'));var moment=require(_0x8156('0x4'));var path=require(_0x8156('0x5'));var tiff2pdf=require(_0x8156('0x6'));var gs=require('./util/gs');var logger=require(_0x8156('0x7'))(_0x8156('0x8'));var ami=require(_0x8156('0x9'));var rpcDb=require(_0x8156('0xa'));var Channel=require(_0x8156('0xb'));var ut=require(_0x8156('0xc'));var Action=require(_0x8156('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x8156('0xe'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x2b25a9){this['channels']={};this['faxAccounts']=_0x2b25a9['faxAccounts'];this[_0x8156('0xf')]=_0x2b25a9[_0x8156('0xf')];this[_0x8156('0x10')]={};ami['on'](_0x8156('0x11'),this[_0x8156('0x12')]['bind'](this));ami['on'](_0x8156('0x13'),this[_0x8156('0x14')][_0x8156('0x15')](this));ami['on'](_0x8156('0x16'),this[_0x8156('0x17')][_0x8156('0x15')](this));ami['on'](_0x8156('0x18'),this['syncNewExten'][_0x8156('0x15')](this));ami['on'](_0x8156('0x19'),this[_0x8156('0x1a')][_0x8156('0x15')](this));ami['on'](_0x8156('0x1b'),this[_0x8156('0x1c')][_0x8156('0x15')](this));ami['on']('hangup',this[_0x8156('0x1d')][_0x8156('0x15')](this));ami['on'](_0x8156('0x1e'),this[_0x8156('0x1f')]['bind'](this));}Fax[_0x8156('0x20')][_0x8156('0x12')]=function(_0x321c49){if(_0x321c49[_0x8156('0x21')]===_0x8156('0x22')){for(var _0x583caf in this[_0x8156('0x23')]){if(this['faxAccounts'][_0x8156('0x24')](_0x583caf)){if(_0x321c49[_0x8156('0x25')]===this[_0x8156('0x23')][_0x583caf][_0x8156('0x26')]){this[_0x8156('0x27')][_0x321c49[_0x8156('0x28')]]={};this[_0x8156('0x27')][_0x321c49[_0x8156('0x28')]][_0x8156('0x29')]=_0x321c49[_0x8156('0x29')];this[_0x8156('0x27')][_0x321c49[_0x8156('0x28')]]['id']=this[_0x8156('0x23')][_0x583caf]['id'];this[_0x8156('0x27')][_0x321c49[_0x8156('0x28')]]['name']=this[_0x8156('0x23')][_0x583caf][_0x8156('0x2a')];logger[_0x8156('0x2b')](_0x321c49[_0x8156('0x28')],_0x8156('0x2c'));}}}}if(this[_0x8156('0x10')][_0x321c49[_0x8156('0x28')]]){this[_0x8156('0x27')][_0x321c49[_0x8156('0x28')]]={};this['channels'][_0x321c49[_0x8156('0x28')]][_0x8156('0x29')]=_0x321c49['channel'];logger[_0x8156('0x2b')](_0x321c49[_0x8156('0x28')],_0x8156('0x2c'));}};Fax[_0x8156('0x20')]['syncVarSet']=function(_0x5ad137){if(this[_0x8156('0x27')][_0x5ad137[_0x8156('0x28')]]){for(var _0x37a168 in _0x5ad137[_0x8156('0x2d')]){if(_0x5ad137[_0x8156('0x2d')][_0x8156('0x24')](_0x37a168)){this['channels'][_0x5ad137[_0x8156('0x28')]][_0x37a168]=_0x5ad137[_0x8156('0x2e')];}}}};Fax[_0x8156('0x20')]['syncNewState']=function(_0x5d3f6d){if(this[_0x8156('0x27')][_0x5d3f6d[_0x8156('0x28')]]){this[_0x8156('0x27')][_0x5d3f6d[_0x8156('0x28')]][_0x8156('0x2f')]=_0x5d3f6d[_0x8156('0x2f')];this[_0x8156('0x27')][_0x5d3f6d[_0x8156('0x28')]][_0x8156('0x30')]=_0x5d3f6d[_0x8156('0x30')];}};Fax['prototype'][_0x8156('0x31')]=function(_0x204d2f){if(this[_0x8156('0x27')][_0x204d2f[_0x8156('0x28')]]){for(var _0x1994c5 in _0x204d2f[_0x8156('0x2d')]){if(_0x204d2f['variable'][_0x8156('0x24')](_0x1994c5)){this[_0x8156('0x27')][_0x204d2f[_0x8156('0x28')]][_0x1994c5]=_0x204d2f[_0x8156('0x2e')];}}}};Fax[_0x8156('0x20')][_0x8156('0x1a')]=function(_0x666cd2){if(this['channels'][_0x666cd2[_0x8156('0x28')]]){this[_0x8156('0x27')][_0x666cd2[_0x8156('0x28')]][_0x8156('0x32')]=_0x666cd2[_0x8156('0x32')];this[_0x8156('0x27')][_0x666cd2[_0x8156('0x28')]][_0x8156('0x33')]=_0x666cd2[_0x8156('0x33')];this['channels'][_0x666cd2['uniqueid']]['localstationid']=_0x666cd2[_0x8156('0x26')];this[_0x8156('0x27')][_0x666cd2[_0x8156('0x28')]][_0x8156('0x34')]=_0x666cd2['filename'];logger[_0x8156('0x2b')](_0x666cd2['uniqueid'],'\x20syncFaxStatus\x20');}};Fax[_0x8156('0x20')][_0x8156('0x1c')]=function(_0x3a1dfd){var _0x123a95=this;if(this[_0x8156('0x27')][_0x3a1dfd['uniqueid']]){var _0x3ee1ee=this[_0x8156('0x27')][_0x3a1dfd['uniqueid']]['id'];this[_0x8156('0x27')][_0x3a1dfd[_0x8156('0x28')]]['remotestationid']=_0x3a1dfd[_0x8156('0x35')];this['channels'][_0x3a1dfd[_0x8156('0x28')]][_0x8156('0x36')]=_0x3a1dfd['pagestransferred'];this[_0x8156('0x27')][_0x3a1dfd[_0x8156('0x28')]][_0x8156('0x26')]=_0x3a1dfd[_0x8156('0x26')];this[_0x8156('0x27')][_0x3a1dfd['uniqueid']][_0x8156('0x37')]=_0x3a1dfd[_0x8156('0x37')];this[_0x8156('0x27')][_0x3a1dfd['uniqueid']][_0x8156('0x38')]=_0x3a1dfd[_0x8156('0x38')];this['channels'][_0x3a1dfd[_0x8156('0x28')]][_0x8156('0x34')]=_0x3a1dfd[_0x8156('0x34')];this[_0x8156('0x27')][_0x3a1dfd[_0x8156('0x28')]][_0x8156('0x39')]=_0x3a1dfd[_0x8156('0x39')];if(this[_0x8156('0x27')][_0x3a1dfd[_0x8156('0x28')]]['pagestransferred']>0x0){tiff2pdf(_0x3a1dfd[_0x8156('0x34')],_0x8156('0x3a'),function(_0x2449d2){logger['info'](_0x3a1dfd[_0x8156('0x28')],_0x8156('0x3b'),_0x2449d2['message']);attachment[_0x8156('0x3c')]({'name':path[_0x8156('0x3d')](_0x3a1dfd['filename'])[_0x8156('0x2a')],'basename':path[_0x8156('0x3d')](_0x3a1dfd['filename'])['name']+_0x8156('0x3e'),'type':_0x8156('0x3f')})[_0x8156('0x40')](function(_0x1c954c){faxAccount[_0x8156('0x41')](_0x3ee1ee,{'from':_0x3a1dfd[_0x8156('0x39')],'mapKey':_0x8156('0x8'),'body':path['parse'](_0x3a1dfd[_0x8156('0x34')])[_0x8156('0x2a')]+_0x8156('0x3e'),'AttachmentId':_0x1c954c['id']})['catch'](function(_0x41ca4b){logger['error'](_0x3a1dfd[_0x8156('0x28')],_0x8156('0x42'),JSON[_0x8156('0x43')](_0x41ca4b));});})[_0x8156('0x44')](function(_0x51d8a0){logger['error'](_0x3a1dfd[_0x8156('0x28')],_0x8156('0x45'),JSON[_0x8156('0x43')](_0x51d8a0));});});}logger[_0x8156('0x2b')](_0x3a1dfd[_0x8156('0x28')],_0x8156('0x45'));}};Fax['prototype'][_0x8156('0x1f')]=function(_0x457682){if(this['actions'][_0x457682[_0x8156('0x28')]]){_['merge'](this[_0x8156('0x27')][_0x457682['uniqueid']],_[_0x8156('0x46')](_0x457682,['response',_0x8156('0x47')]));}};function updateStatus(_0x5a86d3){if(_0x5a86d3[_0x8156('0x48')]){faxMessage[_0x8156('0x49')](_0x5a86d3[_0x8156('0x48')],{'failMessage':_0x8156('0x4a')})[_0x8156('0x40')](function(_0xe25537){ut['logger']('[Fax][Message][Error][Updated]',_0xe25537);})[_0x8156('0x44')](function(_0x2b03ff){ut[_0x8156('0x4b')]('[Fax][Message][Error][NoUpdate1]',_0x2b03ff);});}else{ut['logger'](_0x8156('0x4c'));}}Fax[_0x8156('0x20')][_0x8156('0x4d')]=function(_0x5ba93b,_0x107099,_0x5d7e00){var _0xebef3b=this;var _0xf544a8={};if(_0x107099){_0xf544a8={'read':_0x107099};}else{_0xf544a8={'failMessage':_0x5d7e00};}if(this['actions'][_0x5ba93b][_0x8156('0x48')]){faxMessage[_0x8156('0x49')](this['actions'][_0x5ba93b][_0x8156('0x48')],_0xf544a8)['then'](function(_0x5945f8){ut[_0x8156('0x4b')](_0x8156('0x4e'),_0x5945f8);})[_0x8156('0x44')](function(_0x297c45){ut[_0x8156('0x4b')](_0x8156('0x4f'),_0x297c45);})['finally'](function(){delete _0xebef3b[_0x8156('0x27')][_0x5ba93b];delete _0xebef3b[_0x8156('0x10')][_0x5ba93b];});}else{ut[_0x8156('0x4b')](_0x8156('0x50'));delete this[_0x8156('0x27')][_0x5ba93b];delete this[_0x8156('0x10')][_0x5ba93b];}};Fax[_0x8156('0x20')][_0x8156('0x1d')]=function(_0x17d831){var _0x1c8389=this;if(this['channels'][_0x17d831[_0x8156('0x28')]]){if(this[_0x8156('0x10')][_0x17d831[_0x8156('0x28')]]){this['channels'][_0x17d831['uniqueid']]['id']=this['actions'][_0x17d831[_0x8156('0x28')]]['id'];this[_0x8156('0x27')][_0x17d831[_0x8156('0x28')]]['name']=this[_0x8156('0x10')][_0x17d831[_0x8156('0x28')]][_0x8156('0x2a')];}logger[_0x8156('0x2b')](_0x17d831[_0x8156('0x28')],this[_0x8156('0x10')][_0x17d831[_0x8156('0x28')]]?'\x20hangup\x20sendFile\x20':_0x8156('0x51'),JSON[_0x8156('0x43')](this[_0x8156('0x27')][_0x17d831['uniqueid']]));if(this[_0x8156('0x10')][_0x17d831['uniqueid']]){if(this[_0x8156('0x27')][_0x17d831[_0x8156('0x28')]][_0x8156('0x52')]>0x0&&this[_0x8156('0x27')][_0x17d831[_0x8156('0x28')]]['faxstatus']===_0x8156('0x53')){this['updateStatus'](_0x17d831[_0x8156('0x28')],!![]);}else{this[_0x8156('0x4d')](_0x17d831['uniqueid'],![],this['channels'][_0x17d831[_0x8156('0x28')]][_0x8156('0x54')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x17d831['uniqueid']][_0x8156('0x54')]:'SENDING\x20FAILED');}}}};Fax[_0x8156('0x20')][_0x8156('0x55')]=function(_0x1a45f9){var _0x100d5=this;return new BPromise(function(_0x4c7f7e,_0x52f186){_0x100d5[_0x8156('0x56')](_0x1a45f9,_0x100d5[_0x8156('0x23')][_0x1a45f9['FaxAccountId']])['then'](function(_0xebffa5){ut[_0x8156('0x4b')](_0x8156('0x57'),_0xebffa5);_0x4c7f7e(ut['message'](_0x8156('0x58')));})['catch'](function(_0x1e5704){ut[_0x8156('0x4b')](_0x8156('0x59'),_0x1e5704);updateStatus(_0x1a45f9);_0x52f186(ut['message'](_0x8156('0x5a')));});});};Fax[_0x8156('0x20')]['checkAfterSend']=function(_0x23c0eb){var _0x3ef48d=this;return new BPromise(function(_0x3b7cb5,_0x2cec22){var _0xa44d73=_0x3ef48d[_0x8156('0x5b')](_0x3ef48d[_0x8156('0x23')][_0x23c0eb[_0x8156('0x5c')]][_0x8156('0x5d')],_0x23c0eb);if(_0xa44d73['isValid']){_0x3b7cb5(ut[_0x8156('0x5e')](_0x8156('0x5f')));}else{_0x2cec22(ut['message'](_0xa44d73['message']));}});};function originate(_0x202ed5,_0x56174c,_0x2e8034){return new BPromise(function(_0x1e2a3c,_0x2fb104){if(_0x2e8034){var _0x4f228a=util[_0x8156('0x60')](_0x8156('0x61'),path[_0x8156('0x3d')](_0x202ed5[_0x8156('0x5')])[_0x8156('0x2a')],_0x202ed5[_0x8156('0x5')]);gs[_0x8156('0x62')](_0x4f228a)[_0x8156('0x40')](function(){_0x202ed5[_0x8156('0x5')]=util[_0x8156('0x60')](_0x8156('0x63'),path[_0x8156('0x3d')](_0x202ed5[_0x8156('0x5')])[_0x8156('0x64')],path['parse'](_0x202ed5['path'])['name']);_0x56174c[_0x8156('0x65')]=_0x202ed5[_0x8156('0x5')];ut[_0x8156('0x4b')](_0x8156('0x66'),'');ami['Action'](ut[_0x8156('0x67')](_0x202ed5,_0x56174c))[_0x8156('0x40')](function(_0x53ab5d){_0x1e2a3c(_0x53ab5d);})[_0x8156('0x44')](function(_0xf9f727){_0x2fb104(_0xf9f727);});})[_0x8156('0x44')](function(_0x16cd4a){_0x2fb104(_0x16cd4a);});}else{ami[_0x8156('0x68')](ut[_0x8156('0x67')](_0x202ed5,_0x56174c))[_0x8156('0x40')](function(_0x2068d9){_0x1e2a3c(_0x2068d9);})[_0x8156('0x44')](function(_0x31f7e1){_0x2fb104(_0x31f7e1);});}});}Fax[_0x8156('0x20')][_0x8156('0x56')]=function(_0x31dfa0,_0x18b901){var _0x584868=this;return new BPromise(function(_0x3543de,_0x175678){var _0x223a6f=uuid['v4']();var _0x25200f=ut[_0x8156('0x69')](_0x31dfa0,_0x18b901);_0x584868['actions'][_0x223a6f]=new Action(_0x223a6f,_0x18b901,_0x31dfa0);var _0x32aa43=_0x584868[_0x8156('0x10')][_0x223a6f];if(path['parse'](_0x31dfa0[_0x8156('0x5')])[_0x8156('0x6a')]===_0x8156('0x3e')){originate(_0x32aa43,_0x25200f,!![])['then'](function(_0x362b0b){_0x3543de(_0x362b0b);})[_0x8156('0x44')](function(_0x5c2025){_0x175678(_0x5c2025);});}else{originate(_0x32aa43,_0x25200f,![])[_0x8156('0x40')](function(_0x410923){_0x3543de(_0x410923);})[_0x8156('0x44')](function(_0x38eb77){_0x175678(_0x38eb77);});}});};Fax[_0x8156('0x20')][_0x8156('0x6b')]=function(_0x10cdd5){return!_['isNil'](_0x10cdd5)&&!_[_0x8156('0x6c')](_0x10cdd5[_0x8156('0x2a')])&&!_['isNil'](_0x10cdd5[_0x8156('0x6d')])&&_0x10cdd5['active']&&!_[_0x8156('0x6c')](this['trunks'][util[_0x8156('0x60')](_0x8156('0x6e'),_0x10cdd5[_0x8156('0x2a')])])&&!_[_0x8156('0x6c')](this[_0x8156('0xf')][util[_0x8156('0x60')]('SIP/%s',_0x10cdd5['name'])]['status'])&&(this[_0x8156('0xf')][util[_0x8156('0x60')](_0x8156('0x6e'),_0x10cdd5[_0x8156('0x2a')])][_0x8156('0x33')]===_0x8156('0x6f')||this['trunks'][util[_0x8156('0x60')](_0x8156('0x6e'),_0x10cdd5['name'])][_0x8156('0x33')]===_0x8156('0x70'));};Fax[_0x8156('0x20')]['checkTrunk']=function(_0x43428e,_0xe14564){if(!this[_0x8156('0x6b')](_0x43428e)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x8156('0x6c')](_0x43428e)?'':_0x43428e[_0x8156('0x2a')]+_0x8156('0x71'));return{'isValid':![],'message':_0x8156('0x72')};}if(_[_0x8156('0x6c')](_0xe14564[_0x8156('0x8')])){ut[_0x8156('0x4b')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0xe14564));return{'isValid':![],'message':_0x8156('0x73')};}if(_[_0x8156('0x6c')](_0xe14564[_0x8156('0x5')])){ut[_0x8156('0x4b')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0xe14564));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x8156('0x74')]=Fax;
\ No newline at end of file
+var _0x1fe9=['faxAccounts','trunks','bind','varset','syncVarSet','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','channels','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','message','create','parse','.pdf','notify','error','\x20receiveFax\x20','stringify','actions','merge','pick','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','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','execute','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','exports','util','lodash','bluebird','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage'];(function(_0x5d9c81,_0x3c6b4e){var _0x570295=function(_0xdaaa4f){while(--_0xdaaa4f){_0x5d9c81['push'](_0x5d9c81['shift']());}};_0x570295(++_0x3c6b4e);}(_0x1fe9,0x64));var _0x91fe=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x1fe9[_0x46e363];return _0x3fb059;};'use strict';var util=require(_0x91fe('0x0'));var _=require(_0x91fe('0x1'));var BPromise=require(_0x91fe('0x2'));var uuid=require('uuid');var moment=require(_0x91fe('0x3'));var path=require(_0x91fe('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x91fe('0x5'));var logger=require(_0x91fe('0x6'))(_0x91fe('0x7'));var ami=require('../ami');var rpcDb=require(_0x91fe('0x8'));var Channel=require('./channel');var ut=require(_0x91fe('0x9'));var Action=require(_0x91fe('0xa'));var faxAccount=require(_0x91fe('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x91fe('0xc'));function Fax(_0x2797cd){this['channels']={};this[_0x91fe('0xd')]=_0x2797cd[_0x91fe('0xd')];this[_0x91fe('0xe')]=_0x2797cd[_0x91fe('0xe')];this['actions']={};ami['on']('newchannel',this['syncNewchannel'][_0x91fe('0xf')](this));ami['on'](_0x91fe('0x10'),this[_0x91fe('0x11')][_0x91fe('0xf')](this));ami['on']('newstate',this[_0x91fe('0x12')][_0x91fe('0xf')](this));ami['on']('newexten',this[_0x91fe('0x13')]['bind'](this));ami['on'](_0x91fe('0x14'),this[_0x91fe('0x15')][_0x91fe('0xf')](this));ami['on'](_0x91fe('0x16'),this[_0x91fe('0x17')][_0x91fe('0xf')](this));ami['on']('hangup',this['syncHangup'][_0x91fe('0xf')](this));ami['on'](_0x91fe('0x18'),this[_0x91fe('0x19')][_0x91fe('0xf')](this));}Fax[_0x91fe('0x1a')][_0x91fe('0x1b')]=function(_0x2430be){if(_0x2430be[_0x91fe('0x1c')]==='from-voip-provider'){for(var _0x3094b8 in this[_0x91fe('0xd')]){if(this[_0x91fe('0xd')][_0x91fe('0x1d')](_0x3094b8)){if(_0x2430be[_0x91fe('0x1e')]===this['faxAccounts'][_0x3094b8][_0x91fe('0x1f')]){this['channels'][_0x2430be['uniqueid']]={};this[_0x91fe('0x20')][_0x2430be['uniqueid']][_0x91fe('0x21')]=_0x2430be[_0x91fe('0x21')];this['channels'][_0x2430be['uniqueid']]['id']=this[_0x91fe('0xd')][_0x3094b8]['id'];this[_0x91fe('0x20')][_0x2430be[_0x91fe('0x22')]][_0x91fe('0x23')]=this[_0x91fe('0xd')][_0x3094b8][_0x91fe('0x23')];logger[_0x91fe('0x24')](_0x2430be[_0x91fe('0x22')],_0x91fe('0x25'));}}}}if(this['actions'][_0x2430be[_0x91fe('0x22')]]){this[_0x91fe('0x20')][_0x2430be[_0x91fe('0x22')]]={};this[_0x91fe('0x20')][_0x2430be[_0x91fe('0x22')]][_0x91fe('0x21')]=_0x2430be[_0x91fe('0x21')];logger['info'](_0x2430be[_0x91fe('0x22')],_0x91fe('0x25'));}};Fax['prototype'][_0x91fe('0x11')]=function(_0xf3476d){if(this[_0x91fe('0x20')][_0xf3476d[_0x91fe('0x22')]]){for(var _0x3cc265 in _0xf3476d[_0x91fe('0x26')]){if(_0xf3476d[_0x91fe('0x26')]['hasOwnProperty'](_0x3cc265)){this[_0x91fe('0x20')][_0xf3476d[_0x91fe('0x22')]][_0x3cc265]=_0xf3476d['value'];}}}};Fax['prototype'][_0x91fe('0x12')]=function(_0x98a5c1){if(this[_0x91fe('0x20')][_0x98a5c1[_0x91fe('0x22')]]){this['channels'][_0x98a5c1[_0x91fe('0x22')]][_0x91fe('0x27')]=_0x98a5c1['channelstate'];this[_0x91fe('0x20')][_0x98a5c1[_0x91fe('0x22')]][_0x91fe('0x28')]=_0x98a5c1[_0x91fe('0x28')];}};Fax['prototype'][_0x91fe('0x13')]=function(_0x5a1ca3){if(this['channels'][_0x5a1ca3[_0x91fe('0x22')]]){for(var _0x338e8d in _0x5a1ca3[_0x91fe('0x26')]){if(_0x5a1ca3[_0x91fe('0x26')][_0x91fe('0x1d')](_0x338e8d)){this[_0x91fe('0x20')][_0x5a1ca3['uniqueid']][_0x338e8d]=_0x5a1ca3[_0x91fe('0x29')];}}}};Fax['prototype'][_0x91fe('0x15')]=function(_0x5714b0){if(this[_0x91fe('0x20')][_0x5714b0[_0x91fe('0x22')]]){this[_0x91fe('0x20')][_0x5714b0[_0x91fe('0x22')]][_0x91fe('0x2a')]=_0x5714b0['operation'];this[_0x91fe('0x20')][_0x5714b0[_0x91fe('0x22')]][_0x91fe('0x2b')]=_0x5714b0[_0x91fe('0x2b')];this[_0x91fe('0x20')][_0x5714b0[_0x91fe('0x22')]][_0x91fe('0x1f')]=_0x5714b0[_0x91fe('0x1f')];this['channels'][_0x5714b0[_0x91fe('0x22')]]['filename']=_0x5714b0[_0x91fe('0x2c')];logger[_0x91fe('0x24')](_0x5714b0[_0x91fe('0x22')],_0x91fe('0x2d'));}};Fax[_0x91fe('0x1a')][_0x91fe('0x17')]=function(_0x44072b){var _0x192101=this;if(this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]]){var _0x23a72e=this[_0x91fe('0x20')][_0x44072b['uniqueid']]['id'];this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x2e')]=_0x44072b[_0x91fe('0x2e')];this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x2f')]=_0x44072b[_0x91fe('0x2f')];this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x1f')]=_0x44072b[_0x91fe('0x1f')];this['channels'][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x30')]=_0x44072b['resolution'];this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]]['transferrate']=_0x44072b[_0x91fe('0x31')];this[_0x91fe('0x20')][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x2c')]=_0x44072b[_0x91fe('0x2c')];this['channels'][_0x44072b[_0x91fe('0x22')]][_0x91fe('0x32')]=_0x44072b['calleridnum'];if(this[_0x91fe('0x20')][_0x44072b['uniqueid']][_0x91fe('0x2f')]>0x0){tiff2pdf(_0x44072b['filename'],_0x91fe('0x33'),function(_0x588f5f){logger[_0x91fe('0x24')](_0x44072b['uniqueid'],_0x91fe('0x34'),_0x588f5f[_0x91fe('0x35')]);attachment[_0x91fe('0x36')]({'name':path['parse'](_0x44072b[_0x91fe('0x2c')])[_0x91fe('0x23')],'basename':path[_0x91fe('0x37')](_0x44072b[_0x91fe('0x2c')])[_0x91fe('0x23')]+_0x91fe('0x38'),'type':'application/pdf'})['then'](function(_0x1d3268){faxAccount[_0x91fe('0x39')](_0x23a72e,{'from':_0x44072b[_0x91fe('0x32')],'mapKey':_0x91fe('0x7'),'body':path[_0x91fe('0x37')](_0x44072b['filename'])[_0x91fe('0x23')]+_0x91fe('0x38'),'AttachmentId':_0x1d3268['id']})['catch'](function(_0xc2c6be){logger[_0x91fe('0x3a')](_0x44072b['uniqueid'],'\x20notify\x20',JSON['stringify'](_0xc2c6be));});})['catch'](function(_0x29fa25){logger['error'](_0x44072b[_0x91fe('0x22')],_0x91fe('0x3b'),JSON[_0x91fe('0x3c')](_0x29fa25));});});}logger[_0x91fe('0x24')](_0x44072b['uniqueid'],_0x91fe('0x3b'));}};Fax['prototype'][_0x91fe('0x19')]=function(_0x5f09d6){if(this[_0x91fe('0x3d')][_0x5f09d6[_0x91fe('0x22')]]){_[_0x91fe('0x3e')](this[_0x91fe('0x20')][_0x5f09d6[_0x91fe('0x22')]],_[_0x91fe('0x3f')](_0x5f09d6,['response','reason']));}};function updateStatus(_0x12a757){if(_0x12a757[_0x91fe('0x40')]){faxMessage[_0x91fe('0x41')](_0x12a757[_0x91fe('0x40')],{'failMessage':_0x91fe('0x42')})[_0x91fe('0x43')](function(_0x241d2d){ut[_0x91fe('0x44')]('[Fax][Message][Error][Updated]',_0x241d2d);})[_0x91fe('0x45')](function(_0x8d1e9e){ut[_0x91fe('0x44')](_0x91fe('0x46'),_0x8d1e9e);});}else{ut[_0x91fe('0x44')](_0x91fe('0x47'));}}Fax[_0x91fe('0x1a')][_0x91fe('0x48')]=function(_0x4a80ac,_0x43e81d,_0x505bab){var _0x1edd6d=this;var _0xb98c52={};if(_0x43e81d){_0xb98c52={'read':_0x43e81d};}else{_0xb98c52={'failMessage':_0x505bab};}if(this['actions'][_0x4a80ac]['AttachmentId']){faxMessage[_0x91fe('0x41')](this['actions'][_0x4a80ac]['AttachmentId'],_0xb98c52)[_0x91fe('0x43')](function(_0x5b48f4){ut['logger'](_0x91fe('0x49'),_0x5b48f4);})['catch'](function(_0x5ec941){ut[_0x91fe('0x44')](_0x91fe('0x4a'),_0x5ec941);})[_0x91fe('0x4b')](function(){delete _0x1edd6d['channels'][_0x4a80ac];delete _0x1edd6d[_0x91fe('0x3d')][_0x4a80ac];});}else{ut['logger'](_0x91fe('0x4c'));delete this[_0x91fe('0x20')][_0x4a80ac];delete this[_0x91fe('0x3d')][_0x4a80ac];}};Fax[_0x91fe('0x1a')]['syncHangup']=function(_0x38ac24){var _0x18e3b0=this;if(this['channels'][_0x38ac24['uniqueid']]){if(this[_0x91fe('0x3d')][_0x38ac24['uniqueid']]){this['channels'][_0x38ac24[_0x91fe('0x22')]]['id']=this[_0x91fe('0x3d')][_0x38ac24[_0x91fe('0x22')]]['id'];this[_0x91fe('0x20')][_0x38ac24['uniqueid']][_0x91fe('0x23')]=this[_0x91fe('0x3d')][_0x38ac24['uniqueid']][_0x91fe('0x23')];}logger[_0x91fe('0x24')](_0x38ac24[_0x91fe('0x22')],this[_0x91fe('0x3d')][_0x38ac24[_0x91fe('0x22')]]?'\x20hangup\x20sendFile\x20':_0x91fe('0x4d'),JSON[_0x91fe('0x3c')](this[_0x91fe('0x20')][_0x38ac24[_0x91fe('0x22')]]));if(this[_0x91fe('0x3d')][_0x38ac24[_0x91fe('0x22')]]){if(this[_0x91fe('0x20')][_0x38ac24[_0x91fe('0x22')]][_0x91fe('0x4e')]>0x0&&this[_0x91fe('0x20')][_0x38ac24[_0x91fe('0x22')]][_0x91fe('0x14')]===_0x91fe('0x4f')){this[_0x91fe('0x48')](_0x38ac24[_0x91fe('0x22')],!![]);}else{this[_0x91fe('0x48')](_0x38ac24['uniqueid'],![],this[_0x91fe('0x20')][_0x38ac24[_0x91fe('0x22')]][_0x91fe('0x50')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x38ac24[_0x91fe('0x22')]][_0x91fe('0x50')]:_0x91fe('0x51'));}}}};Fax[_0x91fe('0x1a')][_0x91fe('0x52')]=function(_0x2db2c4){var _0x2f9dcf=this;return new BPromise(function(_0x472a90,_0x1ed376){_0x2f9dcf[_0x91fe('0x53')](_0x2db2c4,_0x2f9dcf['faxAccounts'][_0x2db2c4['FaxAccountId']])[_0x91fe('0x43')](function(_0x2f1067){ut[_0x91fe('0x44')](_0x91fe('0x54'),_0x2f1067);_0x472a90(ut[_0x91fe('0x35')](_0x91fe('0x55')));})[_0x91fe('0x45')](function(_0x580510){ut[_0x91fe('0x44')](_0x91fe('0x56'),_0x580510);updateStatus(_0x2db2c4);_0x1ed376(ut['message'](_0x91fe('0x57')));});});};Fax[_0x91fe('0x1a')][_0x91fe('0x58')]=function(_0x2762a5){var _0x4418cc=this;return new BPromise(function(_0x386886,_0x496797){var _0x43d738=_0x4418cc['checkTrunk'](_0x4418cc[_0x91fe('0xd')][_0x2762a5[_0x91fe('0x59')]][_0x91fe('0x5a')],_0x2762a5);if(_0x43d738[_0x91fe('0x5b')]){_0x386886(ut[_0x91fe('0x35')]('Trunk\x20Reachable'));}else{_0x496797(ut[_0x91fe('0x35')](_0x43d738['message']));}});};function originate(_0x27258e,_0x343cb8,_0x247d52){return new BPromise(function(_0x45ccd2,_0x477232){if(_0x247d52){var _0x19cbc3=util[_0x91fe('0x5c')](_0x91fe('0x5d'),path[_0x91fe('0x37')](_0x27258e[_0x91fe('0x4')])[_0x91fe('0x23')],_0x27258e[_0x91fe('0x4')]);gs[_0x91fe('0x5e')](_0x19cbc3)['then'](function(){_0x27258e[_0x91fe('0x4')]=util[_0x91fe('0x5c')](_0x91fe('0x5f'),path[_0x91fe('0x37')](_0x27258e[_0x91fe('0x4')])['dir'],path[_0x91fe('0x37')](_0x27258e[_0x91fe('0x4')])[_0x91fe('0x23')]);_0x343cb8['XMF-PATH']=_0x27258e[_0x91fe('0x4')];ut[_0x91fe('0x44')](_0x91fe('0x60'),'');ami[_0x91fe('0x61')](ut[_0x91fe('0x62')](_0x27258e,_0x343cb8))[_0x91fe('0x43')](function(_0x365f0a){_0x45ccd2(_0x365f0a);})[_0x91fe('0x45')](function(_0x25732b){_0x477232(_0x25732b);});})['catch'](function(_0xccdc46){_0x477232(_0xccdc46);});}else{ami[_0x91fe('0x61')](ut[_0x91fe('0x62')](_0x27258e,_0x343cb8))[_0x91fe('0x43')](function(_0x514ec6){_0x45ccd2(_0x514ec6);})['catch'](function(_0x1540c3){_0x477232(_0x1540c3);});}});}Fax[_0x91fe('0x1a')][_0x91fe('0x53')]=function(_0x1efab7,_0x18452a){var _0x559430=this;return new BPromise(function(_0x3e1360,_0x3f35a3){var _0x8b61a6=uuid['v4']();var _0x23f9e5=ut['addVariables'](_0x1efab7,_0x18452a);_0x559430['actions'][_0x8b61a6]=new Action(_0x8b61a6,_0x18452a,_0x1efab7);var _0x59870b=_0x559430[_0x91fe('0x3d')][_0x8b61a6];if(path[_0x91fe('0x37')](_0x1efab7[_0x91fe('0x4')])[_0x91fe('0x63')]===_0x91fe('0x38')){originate(_0x59870b,_0x23f9e5,!![])['then'](function(_0x3ab274){_0x3e1360(_0x3ab274);})[_0x91fe('0x45')](function(_0x11af4b){_0x3f35a3(_0x11af4b);});}else{originate(_0x59870b,_0x23f9e5,![])[_0x91fe('0x43')](function(_0x5e9ec6){_0x3e1360(_0x5e9ec6);})[_0x91fe('0x45')](function(_0x5a9424){_0x3f35a3(_0x5a9424);});}});};Fax['prototype'][_0x91fe('0x64')]=function(_0x20247d){return!_[_0x91fe('0x65')](_0x20247d)&&!_[_0x91fe('0x65')](_0x20247d[_0x91fe('0x23')])&&!_[_0x91fe('0x65')](_0x20247d[_0x91fe('0x66')])&&_0x20247d[_0x91fe('0x66')]&&!_[_0x91fe('0x65')](this[_0x91fe('0xe')][util[_0x91fe('0x5c')](_0x91fe('0x67'),_0x20247d[_0x91fe('0x23')])])&&!_[_0x91fe('0x65')](this[_0x91fe('0xe')][util[_0x91fe('0x5c')](_0x91fe('0x67'),_0x20247d['name'])][_0x91fe('0x2b')])&&(this[_0x91fe('0xe')][util[_0x91fe('0x5c')]('SIP/%s',_0x20247d[_0x91fe('0x23')])]['status']===_0x91fe('0x68')||this[_0x91fe('0xe')][util[_0x91fe('0x5c')](_0x91fe('0x67'),_0x20247d['name'])][_0x91fe('0x2b')]==='unmonitored');};Fax[_0x91fe('0x1a')][_0x91fe('0x69')]=function(_0x15a588,_0x4adc93){if(!this[_0x91fe('0x64')](_0x15a588)){ut[_0x91fe('0x44')](_0x91fe('0x6a'),_[_0x91fe('0x65')](_0x15a588)?'':_0x15a588['name']+_0x91fe('0x6b'));return{'isValid':![],'message':_0x91fe('0x6c')};}if(_[_0x91fe('0x65')](_0x4adc93[_0x91fe('0x7')])){ut[_0x91fe('0x44')](_0x91fe('0x6d'),JSON['stringify'](_0x4adc93));return{'isValid':![],'message':_0x91fe('0x6e')};}if(_['isNil'](_0x4adc93['path'])){ut[_0x91fe('0x44')](_0x91fe('0x6f'),JSON[_0x91fe('0x3c')](_0x4adc93));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x91fe('0x70')]=Fax;
\ No newline at end of file
index 97bf19c..c9c04f6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ea7=['notify','resolve','then','catch','[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','error'];(function(_0x4f3f29,_0x433b65){var _0x1929fd=function(_0x1c1cd5){while(--_0x1c1cd5){_0x4f3f29['push'](_0x4f3f29['shift']());}};_0x1929fd(++_0x433b65);}(_0x5ea7,0x1bd));var _0x75ea=function(_0x562faa,_0x23adc7){_0x562faa=_0x562faa-0x0;var _0xc70f59=_0x5ea7[_0x562faa];return _0xc70f59;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x75ea('0x0'))(_0x75ea('0x1'));var _=require(_0x75ea('0x2'));var faxAccount=require(_0x75ea('0x3'));function loggerCatch(_0x3cdfa6){return function(_0x587b10){logger[_0x75ea('0x4')](_0x3cdfa6,util['inspect'](_0x587b10,{'showHidden':![],'depth':null}));};}exports[_0x75ea('0x5')]=function(_0x2c7164,_0x227999){return BPromise[_0x75ea('0x6')]()[_0x75ea('0x7')](faxAccount[_0x75ea('0x5')](_0x2c7164,_0x227999))[_0x75ea('0x8')](loggerCatch(_0x75ea('0x9')));};
\ No newline at end of file
+var _0xdcb4=['resolve','catch','[Notify]\x20','../../../config/logger','preview','notify'];(function(_0x1bd3ad,_0x4dd641){var _0x3213f8=function(_0x45a045){while(--_0x45a045){_0x1bd3ad['push'](_0x1bd3ad['shift']());}};_0x3213f8(++_0x4dd641);}(_0xdcb4,0xc9));var _0x4dcb=function(_0x26216a,_0x58b303){_0x26216a=_0x26216a-0x0;var _0x854f08=_0xdcb4[_0x26216a];return _0x854f08;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x4dcb('0x0'))(_0x4dcb('0x1'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x1e3e24){return function(_0xb77413){logger['error'](_0x1e3e24,util['inspect'](_0xb77413,{'showHidden':![],'depth':null}));};}exports[_0x4dcb('0x2')]=function(_0x30fd60,_0x1dcb3e){return BPromise[_0x4dcb('0x3')]()['then'](faxAccount[_0x4dcb('0x2')](_0x30fd60,_0x1dcb3e))[_0x4dcb('0x4')](loggerCatch(_0x4dcb('0x5')));};
\ No newline at end of file
index 14b7537..e6ca949 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc83a=['inspect','util','../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x1967f9,_0x317e7b){var _0xd6b947=function(_0x57fe62){while(--_0x57fe62){_0x1967f9['push'](_0x1967f9['shift']());}};_0xd6b947(++_0x317e7b);}(_0xc83a,0xfb));var _0xac83=function(_0x24068b,_0x5b53d9){_0x24068b=_0x24068b-0x0;var _0x5d5319=_0xc83a[_0x24068b];return _0x5d5319;};'use strict';var util=require(_0xac83('0x0'));var logger=require(_0xac83('0x1'))(_0xac83('0x2'));var BPromise=require(_0xac83('0x3'));var exec=require(_0xac83('0x4'))[_0xac83('0x5')];exports['execute']=function(_0x50d31d){return new BPromise(function(_0x42b92e,_0x37438e){exec(_0x50d31d,function(_0x43880c,_0x5ad31c,_0x313cce){logger[_0xac83('0x6')](_0xac83('0x7'),_0x5ad31c);if(_0x43880c){logger[_0xac83('0x6')]('Exec\x20gs',_0xac83('0x8'),util[_0xac83('0x9')](_0x43880c,{'showHidden':![],'depth':null}),_0x5ad31c,_0x313cce);_0x37438e(_0x43880c);}_0x42b92e(_0x5ad31c);});});};
\ No newline at end of file
+var _0xc058=['util','../../../../config/logger','fax','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','inspect'];(function(_0x4fbe91,_0x1cc42e){var _0x43be41=function(_0x4d4812){while(--_0x4d4812){_0x4fbe91['push'](_0x4fbe91['shift']());}};_0x43be41(++_0x1cc42e);}(_0xc058,0x1f4));var _0x8c05=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xc058[_0x3ab9ee];return _0x82ee88;};'use strict';var util=require(_0x8c05('0x0'));var logger=require(_0x8c05('0x1'))(_0x8c05('0x2'));var BPromise=require(_0x8c05('0x3'));var exec=require(_0x8c05('0x4'))[_0x8c05('0x5')];exports['execute']=function(_0x40c51a){return new BPromise(function(_0x1de524,_0x4bd11f){exec(_0x40c51a,function(_0x4b8872,_0x30c04f,_0x345af7){logger[_0x8c05('0x6')](_0x8c05('0x7'),_0x30c04f);if(_0x4b8872){logger[_0x8c05('0x6')](_0x8c05('0x7'),_0x8c05('0x8'),util[_0x8c05('0x9')](_0x4b8872,{'showHidden':![],'depth':null}),_0x30c04f,_0x345af7);_0x4bd11f(_0x4b8872);}_0x1de524(_0x30c04f);});});};
\ No newline at end of file
index afc25d1..5bfa7b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72a9=['from-sip','format','headerinfo','localstationid','util','lodash','moment','fax','message','logger','info','inspect','ecm','maxrate','gateway','faxdetect','t38timeout','variablesAction','uniqueid','originate','xcally-motion-fax'];(function(_0x26f667,_0x3c80dc){var _0x5006c=function(_0x39c6e6){while(--_0x39c6e6){_0x26f667['push'](_0x26f667['shift']());}};_0x5006c(++_0x3c80dc);}(_0x72a9,0x12a));var _0x972a=function(_0x8998d0,_0x3e2894){_0x8998d0=_0x8998d0-0x0;var _0x567477=_0x72a9[_0x8998d0];return _0x567477;};'use strict';var util=require(_0x972a('0x0'));var _=require(_0x972a('0x1'));var moment=require(_0x972a('0x2'));var logger=require('../../../../config/logger')(_0x972a('0x3'));exports[_0x972a('0x4')]=function(_0x23c3ad){return{'message':_0x23c3ad};};exports[_0x972a('0x5')]=function(_0x24b82b,_0x4e8698){logger[_0x972a('0x6')](_0x24b82b,util[_0x972a('0x7')](_0x4e8698,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x4c1640,_0x415e01){var _0x51b3ef={'XMF-ECM':_0x415e01[_0x972a('0x8')],'XMF-HEADERINFO':_0x415e01['headerinfo'],'XMF-MINRATE':_0x415e01['minrate'],'XMF-MAXRATE':_0x415e01[_0x972a('0x9')],'XMF-MODEM':util['format']('\x22%s\x22',_0x415e01['modem']),'XMF-GATEWAY':_0x415e01[_0x972a('0xa')],'XMF-FAXDETECT':_0x415e01[_0x972a('0xb')],'XMF-T38TIMEOUT':_0x415e01[_0x972a('0xc')],'XMF-LOCALSTATIONID':_0x415e01['localstationid'],'XMF-PATH':_0x4c1640['path']};return _0x51b3ef;};exports[_0x972a('0xd')]=function(_0x55ede7,_0x188af8){return{'actionid':_0x55ede7[_0x972a('0xe')],'action':_0x972a('0xf'),'channel':_0x55ede7['channel'],'Exten':_0x972a('0x10'),'Context':_0x972a('0x11'),'Priority':'1','callerid':util[_0x972a('0x12')]('\x22%s\x22\x20<%s>',_0x55ede7[_0x972a('0x13')]?_0x55ede7[_0x972a('0x13')]:'',_0x55ede7[_0x972a('0x14')]),'variable':_0x188af8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x55ede7[_0x972a('0xe')]};};
\ No newline at end of file
+var _0xe5e3=['modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','headerinfo','maxrate'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xe5e3,0x13a));var _0x3e5e=function(_0x29ad6f,_0x2e6a29){_0x29ad6f=_0x29ad6f-0x0;var _0x4f7625=_0xe5e3[_0x29ad6f];return _0x4f7625;};'use strict';var util=require(_0x3e5e('0x0'));var _=require('lodash');var moment=require(_0x3e5e('0x1'));var logger=require(_0x3e5e('0x2'))(_0x3e5e('0x3'));exports[_0x3e5e('0x4')]=function(_0x344b93){return{'message':_0x344b93};};exports['logger']=function(_0x4409a4,_0x20a8c8){logger[_0x3e5e('0x5')](_0x4409a4,util[_0x3e5e('0x6')](_0x20a8c8,{'showHidden':![],'depth':null}));};exports[_0x3e5e('0x7')]=function(_0x31ece2,_0x437cdf){var _0x55f267={'XMF-ECM':_0x437cdf[_0x3e5e('0x8')],'XMF-HEADERINFO':_0x437cdf[_0x3e5e('0x9')],'XMF-MINRATE':_0x437cdf['minrate'],'XMF-MAXRATE':_0x437cdf[_0x3e5e('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x437cdf[_0x3e5e('0xb')]),'XMF-GATEWAY':_0x437cdf[_0x3e5e('0xc')],'XMF-FAXDETECT':_0x437cdf[_0x3e5e('0xd')],'XMF-T38TIMEOUT':_0x437cdf[_0x3e5e('0xe')],'XMF-LOCALSTATIONID':_0x437cdf[_0x3e5e('0xf')],'XMF-PATH':_0x31ece2[_0x3e5e('0x10')]};return _0x55f267;};exports[_0x3e5e('0x11')]=function(_0x5d07f9,_0x35be6c){return{'actionid':_0x5d07f9[_0x3e5e('0x12')],'action':_0x3e5e('0x13'),'channel':_0x5d07f9[_0x3e5e('0x14')],'Exten':_0x3e5e('0x15'),'Context':_0x3e5e('0x16'),'Priority':'1','callerid':util[_0x3e5e('0x17')](_0x3e5e('0x18'),_0x5d07f9['headerinfo']?_0x5d07f9['headerinfo']:'',_0x5d07f9['localstationid']),'variable':_0x35be6c,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5d07f9['uniqueid']};};
\ No newline at end of file
index a71e025..0f3fd96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2165=['initTelephones','initTrunks','getVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','resolve','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','inspect','listen','sync','[index.js][main]','util','./realtime','./report','./acw','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','then','getAgents','getTelephones'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x2165,0x13c));var _0x5216=function(_0x384076,_0x491e1c){_0x384076=_0x384076-0x0;var _0x1d8f5d=_0x2165[_0x384076];return _0x1d8f5d;};'use strict';var BPromise=require('bluebird');var util=require(_0x5216('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require(_0x5216('0x1'));var Report=require(_0x5216('0x2'));var Acw=require(_0x5216('0x3'));var Trigger=require('./trigger');var Dialer=require('./dialer');var Preview=require(_0x5216('0x4'));var Fax=require(_0x5216('0x5'));var user=require(_0x5216('0x6'));var voiceQueue=require(_0x5216('0x7'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5216('0x8'));var trunk=require(_0x5216('0x9'));var trigger=require(_0x5216('0xa'));var template=require(_0x5216('0xb'));var cmHopperHistory=require(_0x5216('0xc'));var campaign=require(_0x5216('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x5216('0xe'));var zendesk=require(_0x5216('0xf'));var salesforce=require(_0x5216('0x10'));var sugarcrm=require(_0x5216('0x11'));var freshdesk=require(_0x5216('0x12'));var desk=require(_0x5216('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x5216('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x5216('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x5216('0x16'))(_0x5216('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5216('0x18')](_0x5216('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5216('0x18')](_0x5216('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x5216('0x1a')](user[_0x5216('0x1b')]())[_0x5216('0x1a')](realtime['initAgents']())[_0x5216('0x1a')](user[_0x5216('0x1c')]())[_0x5216('0x1a')](realtime[_0x5216('0x1d')]())[_0x5216('0x1a')](trunk['getTrunks']())[_0x5216('0x1a')](realtime[_0x5216('0x1e')]())['then'](voiceQueue[_0x5216('0x1f')]())[_0x5216('0x1a')](realtime['initVoiceQueues']())['then'](trigger[_0x5216('0x20')]())[_0x5216('0x1a')](realtime[_0x5216('0x21')]())[_0x5216('0x1a')](template['getTemplates']())[_0x5216('0x1a')](realtime[_0x5216('0x22')]())[_0x5216('0x1a')](zendesk['getZendeskAccounts']())[_0x5216('0x1a')](realtime[_0x5216('0x23')]())[_0x5216('0x1a')](salesforce[_0x5216('0x24')]())[_0x5216('0x1a')](realtime['initSalesforceAccounts']())[_0x5216('0x1a')](sugarcrm[_0x5216('0x25')]())[_0x5216('0x1a')](realtime[_0x5216('0x26')]())[_0x5216('0x1a')](freshdesk[_0x5216('0x27')]())[_0x5216('0x1a')](realtime[_0x5216('0x28')]())[_0x5216('0x1a')](desk['getDeskAccounts']())['then'](realtime[_0x5216('0x29')]())[_0x5216('0x1a')](zoho[_0x5216('0x2a')]())[_0x5216('0x1a')](realtime[_0x5216('0x2b')]())[_0x5216('0x1a')](vtiger[_0x5216('0x2c')]())[_0x5216('0x1a')](realtime[_0x5216('0x2d')]())['then'](freshsales[_0x5216('0x2e')]())[_0x5216('0x1a')](realtime[_0x5216('0x2f')]())[_0x5216('0x1a')](servicenow[_0x5216('0x30')]())[_0x5216('0x1a')](realtime[_0x5216('0x31')]())['then'](dynamics365['getDynamics365Accounts']())[_0x5216('0x1a')](realtime[_0x5216('0x32')]())[_0x5216('0x1a')](campaign[_0x5216('0x33')]())[_0x5216('0x1a')](realtime[_0x5216('0x34')]())[_0x5216('0x1a')](voiceExtension[_0x5216('0x35')]())[_0x5216('0x1a')](realtime[_0x5216('0x36')]())[_0x5216('0x1a')](faxAccount[_0x5216('0x37')]())[_0x5216('0x1a')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x5216('0x38')]()[_0x5216('0x1a')](voiceQueueReport[_0x5216('0x39')]())[_0x5216('0x1a')](realtime['initVoiceQueueReports']())[_0x5216('0x1a')](cmHopperHistory[_0x5216('0x3a')]())[_0x5216('0x1a')](realtime[_0x5216('0x3b')]())[_0x5216('0x1a')](cmHopperHistory[_0x5216('0x3c')]())[_0x5216('0x1a')](realtime[_0x5216('0x3d')]())[_0x5216('0x1a')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x5216('0x3e')]())[_0x5216('0x3f')](function(_0x32062c){logger[_0x5216('0x40')]('[index.js][initParams]',util[_0x5216('0x41')](_0x32062c,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5216('0x42')](realtime,preview,fax)[_0x5216('0x1a')](function(_0x55e120){return initRealtime();})[_0x5216('0x1a')](function(){return initParams();})['then'](function(){report[_0x5216('0x43')]();setInterval(initRealtime,0x1388);})[_0x5216('0x3f')](function(_0x491dff){logger['error'](_0x5216('0x44'),util[_0x5216('0x41')](_0x491dff,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
+var _0xa59c=['getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts'];(function(_0x572c0d,_0x178632){var _0x39e800=function(_0x373a8d){while(--_0x373a8d){_0x572c0d['push'](_0x572c0d['shift']());}};_0x39e800(++_0x178632);}(_0xa59c,0x65));var _0xca59=function(_0x225060,_0x1262f9){_0x225060=_0x225060-0x0;var _0x9cb45e=_0xa59c[_0x225060];return _0x9cb45e;};'use strict';var BPromise=require(_0xca59('0x0'));var util=require(_0xca59('0x1'));var moment=require(_0xca59('0x2'));var server=require(_0xca59('0x3'));var Realtime=require(_0xca59('0x4'));var Report=require(_0xca59('0x5'));var Acw=require(_0xca59('0x6'));var Trigger=require(_0xca59('0x7'));var Dialer=require('./dialer');var Preview=require(_0xca59('0x8'));var Fax=require(_0xca59('0x9'));var user=require(_0xca59('0xa'));var voiceQueue=require(_0xca59('0xb'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xca59('0xc'));var trigger=require(_0xca59('0xd'));var template=require(_0xca59('0xe'));var cmHopperHistory=require(_0xca59('0xf'));var campaign=require(_0xca59('0x10'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xca59('0x11'));var salesforce=require(_0xca59('0x12'));var sugarcrm=require(_0xca59('0x13'));var freshdesk=require(_0xca59('0x14'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xca59('0x15'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require(_0xca59('0x16'));var dynamics365=require(_0xca59('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require('../../config/logger')('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xca59('0x18')](_0xca59('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xca59('0x1a')]()[_0xca59('0x1b')](user[_0xca59('0x1c')]())[_0xca59('0x1b')](realtime[_0xca59('0x1d')]())[_0xca59('0x1b')](user[_0xca59('0x1e')]())[_0xca59('0x1b')](realtime['initTelephones']())[_0xca59('0x1b')](trunk[_0xca59('0x1f')]())[_0xca59('0x1b')](realtime['initTrunks']())[_0xca59('0x1b')](voiceQueue[_0xca59('0x20')]())[_0xca59('0x1b')](realtime[_0xca59('0x21')]())[_0xca59('0x1b')](trigger[_0xca59('0x22')]())[_0xca59('0x1b')](realtime[_0xca59('0x23')]())[_0xca59('0x1b')](template[_0xca59('0x24')]())[_0xca59('0x1b')](realtime[_0xca59('0x25')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())[_0xca59('0x1b')](salesforce[_0xca59('0x26')]())[_0xca59('0x1b')](realtime['initSalesforceAccounts']())[_0xca59('0x1b')](sugarcrm[_0xca59('0x27')]())['then'](realtime[_0xca59('0x28')]())[_0xca59('0x1b')](freshdesk[_0xca59('0x29')]())['then'](realtime[_0xca59('0x2a')]())[_0xca59('0x1b')](desk['getDeskAccounts']())['then'](realtime[_0xca59('0x2b')]())[_0xca59('0x1b')](zoho[_0xca59('0x2c')]())[_0xca59('0x1b')](realtime[_0xca59('0x2d')]())[_0xca59('0x1b')](vtiger[_0xca59('0x2e')]())[_0xca59('0x1b')](realtime['initVtigerAccounts']())[_0xca59('0x1b')](freshsales['getFreshsalesAccounts']())['then'](realtime[_0xca59('0x2f')]())[_0xca59('0x1b')](servicenow[_0xca59('0x30')]())[_0xca59('0x1b')](realtime[_0xca59('0x31')]())[_0xca59('0x1b')](dynamics365[_0xca59('0x32')]())[_0xca59('0x1b')](realtime[_0xca59('0x33')]())[_0xca59('0x1b')](campaign[_0xca59('0x34')]())[_0xca59('0x1b')](realtime[_0xca59('0x35')]())['then'](voiceExtension[_0xca59('0x36')]())[_0xca59('0x1b')](realtime[_0xca59('0x37')]())['then'](faxAccount[_0xca59('0x38')]())[_0xca59('0x1b')](realtime[_0xca59('0x39')]())[_0xca59('0x1b')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xca59('0x1b')](voiceQueueReport[_0xca59('0x3a')]())[_0xca59('0x1b')](realtime[_0xca59('0x3b')]())[_0xca59('0x1b')](cmHopperHistory[_0xca59('0x3c')]())['then'](realtime[_0xca59('0x3d')]())[_0xca59('0x1b')](cmHopperHistory[_0xca59('0x3e')]())[_0xca59('0x1b')](realtime[_0xca59('0x3f')]())[_0xca59('0x1b')](voiceCallReport[_0xca59('0x40')]())[_0xca59('0x1b')](realtime['initVoiceCallReports']())[_0xca59('0x41')](function(_0x5af411){logger[_0xca59('0x42')](_0xca59('0x43'),util[_0xca59('0x44')](_0x5af411,{'showHidden':![],'depth':null}));});}function main(){return server[_0xca59('0x45')](realtime,preview,fax)[_0xca59('0x1b')](function(_0x1ea3c5){return initRealtime();})[_0xca59('0x1b')](function(){return initParams();})[_0xca59('0x1b')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xca59('0x41')](function(_0x561ae8){logger[_0xca59('0x42')](_0xca59('0x46'),util['inspect'](_0x561ae8,{'showHidden':![],'depth':null}));});}main();
\ No newline at end of file
index 521be18..3f8920c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['stateTime','status','address','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','md5','prototype','updateStatusRealtime','not_inuse','inuse','talking','statePause','toNumber','format','fullname','stringify','user:%s','emit','user:save','user:presence','exports','lodash','util','moment','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','email','accountcode','state','unknown'];(function(_0x29632e,_0x5ecba4){var _0x426e04=function(_0x4eb357){while(--_0x4eb357){_0x29632e['push'](_0x29632e['shift']());}};_0x426e04(++_0x5ecba4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));config['redis']=_[_0x0a9e('0x4')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x6'),'port':0x18eb});var io=require(_0x0a9e('0x7'))(new Redis(config[_0x0a9e('0x5')]));function Agent(_0x57b080){this['id']=_0x57b080['id']||0x0;this[_0x0a9e('0x8')]=_0x57b080[_0x0a9e('0x8')]||'';this[_0x0a9e('0x9')]=_0x57b080['email']||'';this['accountcode']=_0x57b080[_0x0a9e('0xa')]||'';this['fullname']=_0x57b080['fullname']||'';this[_0x0a9e('0xb')]=_0x0a9e('0xc');this[_0x0a9e('0xd')]=0x0;this[_0x0a9e('0xe')]=_0x0a9e('0xc');this[_0x0a9e('0xf')]='';this['phone']='';this['mobile']='';this['interface']='';this['online']=_0x57b080[_0x0a9e('0x10')]||![];this[_0x0a9e('0x11')]=_0x0a9e('0xc');this[_0x0a9e('0x12')]=0x0;this[_0x0a9e('0x13')]='';this[_0x0a9e('0x14')]='';this['onhold']=![];this[_0x0a9e('0x15')]=![];this[_0x0a9e('0x16')]='';}Agent[_0x0a9e('0x17')][_0x0a9e('0x18')]=function(_0x44dcfd){var _0x4d5611;if(_0x44dcfd&&_0x44dcfd['state']){_0x4d5611=_0x44dcfd[_0x0a9e('0xb')]['toLowerCase']();switch(_0x4d5611){case _0x0a9e('0x19'):_0x4d5611='idle';break;case _0x0a9e('0x1a'):_0x4d5611=_0x0a9e('0x1b');break;}}if(_0x4d5611&&this['voiceStatus']!==_0x4d5611||_0x44dcfd[_0x0a9e('0x1c')]){this['voiceStatusTime']=_[_0x0a9e('0x1d')](moment()[_0x0a9e('0x1e')]('x'));}if(_0x4d5611){this[_0x0a9e('0x11')]=_0x4d5611;}var _0x205fd6={'id':this['id'],'name':this[_0x0a9e('0x8')],'email':this[_0x0a9e('0x9')],'accountcode':this[_0x0a9e('0xa')],'fullname':this[_0x0a9e('0x1f')],'state':this[_0x0a9e('0xb')],'stateTime':this[_0x0a9e('0xd')],'status':this[_0x0a9e('0xe')],'address':this[_0x0a9e('0xf')],'online':this['online'],'voiceStatus':this[_0x0a9e('0x11')],'voiceStatusTime':this[_0x0a9e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x0a9e('0x14')],'interface':this['interface'],'onhold':this['onhold']};var _0x3a02e1=md5(JSON[_0x0a9e('0x20')](_0x205fd6));if(this[_0x0a9e('0x16')]!==_0x3a02e1){this[_0x0a9e('0x16')]=_0x3a02e1;io['to'](util['format'](_0x0a9e('0x21'),_0x205fd6[_0x0a9e('0x8')]))[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x205fd6);io[_0x0a9e('0x22')](_0x0a9e('0x24'),_0x205fd6);}};module[_0x0a9e('0x25')]=Agent;
\ No newline at end of file
+var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x937b4c,_0x23bbf7){var _0x43bc05=function(_0x4f83d4){while(--_0x4f83d4){_0x937b4c['push'](_0x937b4c['shift']());}};_0x43bc05(++_0x23bbf7);}(_0xe706,0xa3));var _0x6e70=function(_0x34c825,_0x44cad4){_0x34c825=_0x34c825-0x0;var _0x2fde13=_0xe706[_0x34c825];return _0x2fde13;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent;
\ No newline at end of file
index adca470..2f10f8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3adf=['dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence'];(function(_0x49cc33,_0x46e6a5){var _0xe9171c=function(_0x2a1acc){while(--_0x2a1acc){_0x49cc33['push'](_0x49cc33['shift']());}};_0xe9171c(++_0x46e6a5);}(_0x3adf,0xf3));var _0xf3ad=function(_0x150bbe,_0x412085){_0x150bbe=_0x150bbe-0x0;var _0x3418d5=_0x3adf[_0x150bbe];return _0x3418d5;};'use strict';function Campaign(_0x48e112){this['id']=_0x48e112['id']||0x0;this[_0xf3ad('0x0')]=_0x48e112[_0xf3ad('0x0')]||'';this['type']=_0x48e112[_0xf3ad('0x1')]||_0xf3ad('0x2');this['originated']=0x0;this[_0xf3ad('0x3')]=0x0;this[_0xf3ad('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this[_0xf3ad('0x5')]=_0x48e112[_0xf3ad('0x5')];this[_0xf3ad('0x6')]=_0x48e112[_0xf3ad('0x6')];this[_0xf3ad('0x7')]=_0x48e112[_0xf3ad('0x7')]||null;this[_0xf3ad('0x8')]=_0x48e112[_0xf3ad('0x8')]?_0x48e112['dialGlobalInterval']:null;this[_0xf3ad('0x9')]=_0x48e112[_0xf3ad('0x9')];this['dialOriginateCallerIdNumber']=_0x48e112[_0xf3ad('0xa')];this[_0xf3ad('0xb')]=_0x48e112[_0xf3ad('0xb')]||0x1e;this[_0xf3ad('0xc')]=_0x48e112[_0xf3ad('0xc')];this[_0xf3ad('0xd')]=_0x48e112[_0xf3ad('0xd')];this[_0xf3ad('0xe')]=_0x48e112[_0xf3ad('0xe')];this['dialBusyRetryFrequency']=_0x48e112[_0xf3ad('0xf')];this[_0xf3ad('0x10')]=_0x48e112[_0xf3ad('0x10')];this[_0xf3ad('0x11')]=_0x48e112[_0xf3ad('0x11')];this[_0xf3ad('0x12')]=_0x48e112[_0xf3ad('0x12')];this[_0xf3ad('0x13')]=_0x48e112['dialNoSuchNumberMaxRetry']||0x3;this[_0xf3ad('0x14')]=_0x48e112[_0xf3ad('0x14')]||0x96;this[_0xf3ad('0x15')]=_0x48e112[_0xf3ad('0x15')]||0x3;this[_0xf3ad('0x16')]=_0x48e112[_0xf3ad('0x16')]||0x96;this[_0xf3ad('0x17')]=_0x48e112['dialAbandonedMaxRetry']||0x3;this[_0xf3ad('0x18')]=_0x48e112[_0xf3ad('0x18')]||0x96;this[_0xf3ad('0x19')]=_0x48e112[_0xf3ad('0x19')]||0x3;this[_0xf3ad('0x1a')]=_0x48e112[_0xf3ad('0x1a')]||0x96;this[_0xf3ad('0x1b')]=_0x48e112[_0xf3ad('0x1b')]||0x3;this[_0xf3ad('0x1c')]=_0x48e112[_0xf3ad('0x1c')]||0x96;this[_0xf3ad('0x1d')]=_0x48e112[_0xf3ad('0x1d')]||_0xf3ad('0x1e');this['dialPrefix']=_0x48e112['dialPrefix']||undefined;this[_0xf3ad('0x1f')]=_0x48e112[_0xf3ad('0x1f')]||undefined;this['dialCutDigit']=_0x48e112[_0xf3ad('0x20')]||undefined;this[_0xf3ad('0x21')]=_0x48e112[_0xf3ad('0x21')]?_0x48e112[_0xf3ad('0x21')]:undefined;this[_0xf3ad('0x22')]=_0x48e112[_0xf3ad('0x22')]?_0x48e112[_0xf3ad('0x22')]:undefined;this['Interval']=_0x48e112[_0xf3ad('0x23')]?_0x48e112[_0xf3ad('0x23')]:undefined;this[_0xf3ad('0x24')]=_0x48e112[_0xf3ad('0x24')]?_0x48e112[_0xf3ad('0x24')]:undefined;this[_0xf3ad('0x25')]=_0x48e112['SquareProject']?_0x48e112[_0xf3ad('0x24')][_0xf3ad('0x0')]:undefined;this[_0xf3ad('0x26')]=_0x48e112[_0xf3ad('0x26')]||![];this[_0xf3ad('0x27')]=_0x48e112[_0xf3ad('0x27')];this[_0xf3ad('0x28')]=_0x48e112[_0xf3ad('0x28')];this[_0xf3ad('0x29')]=_0x48e112[_0xf3ad('0x29')];this['dialAMDTotalAnalysisTime']=_0x48e112[_0xf3ad('0x2a')];this['dialAMDMinWordLength']=_0x48e112[_0xf3ad('0x2b')];this['dialAMDBetweenWordsSilence']=_0x48e112[_0xf3ad('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x48e112[_0xf3ad('0x2d')];this[_0xf3ad('0x2e')]=_0x48e112[_0xf3ad('0x2e')];this['dialAMDMaximumWordLength']=_0x48e112[_0xf3ad('0x2f')];}module['exports']=Campaign;
\ No newline at end of file
+var _0xbff1=['DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrTotalCallsDays','message','sendMessageOneNotActive','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt'];(function(_0x29a248,_0x436996){var _0x36338c=function(_0x537a0e){while(--_0x537a0e){_0x29a248['push'](_0x29a248['shift']());}};_0x36338c(++_0x436996);}(_0xbff1,0x1f3));var _0x1bff=function(_0x1aaa57,_0x3b0b60){_0x1aaa57=_0x1aaa57-0x0;var _0x1e33ec=_0xbff1[_0x1aaa57];return _0x1e33ec;};'use strict';function Campaign(_0xb03817){this['id']=_0xb03817['id']||0x0;this[_0x1bff('0x0')]=_0xb03817[_0x1bff('0x0')]||'';this['type']=_0xb03817[_0x1bff('0x1')]||'campaign';this[_0x1bff('0x2')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0x1bff('0x3')]=0x0;this[_0x1bff('0x4')]='';this[_0x1bff('0x5')]=!![];this['active']=_0xb03817['active'];this[_0x1bff('0x6')]=_0xb03817[_0x1bff('0x6')];this[_0x1bff('0x7')]=_0xb03817[_0x1bff('0x7')]||null;this[_0x1bff('0x8')]=_0xb03817[_0x1bff('0x8')]?_0xb03817[_0x1bff('0x8')]:null;this[_0x1bff('0x9')]=_0xb03817[_0x1bff('0x9')];this[_0x1bff('0xa')]=_0xb03817['dialOriginateCallerIdNumber'];this[_0x1bff('0xb')]=_0xb03817[_0x1bff('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0xb03817[_0x1bff('0xc')];this[_0x1bff('0xd')]=_0xb03817[_0x1bff('0xd')];this[_0x1bff('0xe')]=_0xb03817[_0x1bff('0xe')];this[_0x1bff('0xf')]=_0xb03817[_0x1bff('0xf')];this['dialNoAnswerMaxRetry']=_0xb03817[_0x1bff('0x10')];this['dialNoAnswerRetryFrequency']=_0xb03817['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0xb03817[_0x1bff('0x11')];this['dialNoSuchNumberMaxRetry']=_0xb03817[_0x1bff('0x12')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0xb03817[_0x1bff('0x13')]||0x96;this['dialDropMaxRetry']=_0xb03817[_0x1bff('0x14')]||0x3;this[_0x1bff('0x15')]=_0xb03817['dialDropRetryFrequency']||0x96;this[_0x1bff('0x16')]=_0xb03817[_0x1bff('0x16')]||0x3;this['dialAbandonedRetryFrequency']=_0xb03817[_0x1bff('0x17')]||0x96;this[_0x1bff('0x18')]=_0xb03817[_0x1bff('0x18')]||0x3;this[_0x1bff('0x19')]=_0xb03817[_0x1bff('0x19')]||0x96;this[_0x1bff('0x1a')]=_0xb03817[_0x1bff('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0xb03817[_0x1bff('0x1b')]||0x96;this[_0x1bff('0x1c')]=_0xb03817['dialOrderByScheduledAt']||_0x1bff('0x1d');this[_0x1bff('0x1e')]=_0xb03817[_0x1bff('0x1e')]||undefined;this[_0x1bff('0x1f')]=_0xb03817['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x1bff('0x20')]=_0xb03817[_0x1bff('0x20')]||undefined;this[_0x1bff('0x21')]=_0xb03817['TrunkBackup']?_0xb03817[_0x1bff('0x21')]:undefined;this[_0x1bff('0x22')]=_0xb03817[_0x1bff('0x22')]?_0xb03817[_0x1bff('0x22')]:undefined;this[_0x1bff('0x23')]=_0xb03817[_0x1bff('0x23')]?_0xb03817[_0x1bff('0x23')]:undefined;this[_0x1bff('0x24')]=_0xb03817[_0x1bff('0x24')]?_0xb03817['SquareProject']:undefined;this[_0x1bff('0x25')]=_0xb03817[_0x1bff('0x24')]?_0xb03817[_0x1bff('0x24')]['name']:undefined;this[_0x1bff('0x26')]=_0xb03817[_0x1bff('0x26')]||![];this['dialAMDInitialSilence']=_0xb03817[_0x1bff('0x27')];this[_0x1bff('0x28')]=_0xb03817[_0x1bff('0x28')];this['dialAMDAfterGreetingSilence']=_0xb03817[_0x1bff('0x29')];this[_0x1bff('0x2a')]=_0xb03817[_0x1bff('0x2a')];this['dialAMDMinWordLength']=_0xb03817[_0x1bff('0x2b')];this[_0x1bff('0x2c')]=_0xb03817[_0x1bff('0x2c')];this[_0x1bff('0x2d')]=_0xb03817[_0x1bff('0x2d')];this[_0x1bff('0x2e')]=_0xb03817[_0x1bff('0x2e')];this[_0x1bff('0x2f')]=_0xb03817[_0x1bff('0x2f')];}module['exports']=Campaign;
\ No newline at end of file
index 6398b67..b405604 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8286=['connectedlinename','accountcode','context','uniqueid','linkedid','answered','answertime','unmanaged','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x8286,0x66));var _0x6828=function(_0x21b9d2,_0x19f1a6){_0x21b9d2=_0x21b9d2-0x0;var _0x4c8c7b=_0x8286[_0x21b9d2];return _0x4c8c7b;};'use strict';function Channel(){this[_0x6828('0x0')]=null;this[_0x6828('0x1')]='';this[_0x6828('0x2')]='';this[_0x6828('0x3')]=0x0;this[_0x6828('0x4')]='';this[_0x6828('0x5')]=undefined;this[_0x6828('0x6')]=undefined;this[_0x6828('0x7')]=0x0;this[_0x6828('0x8')]='';this[_0x6828('0x9')]=0x0;this[_0x6828('0xa')]=0x0;this['exten']=0x0;this[_0x6828('0xb')]=![];this[_0x6828('0xc')]=null;this['endtime']=null;this[_0x6828('0xd')]=![];this[_0x6828('0xe')]=![];this[_0x6828('0xf')]='';this['lastdata']='';this[_0x6828('0x10')]=0x0;this[_0x6828('0x11')]=0x0;this[_0x6828('0x12')]=0x0;this[_0x6828('0x13')]=null;this[_0x6828('0x14')]=null;this[_0x6828('0x15')]=null;this[_0x6828('0x16')]=![];this[_0x6828('0x17')]=null;this[_0x6828('0x18')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x6828('0x19')]=undefined;this['transferType']=undefined;this[_0x6828('0x1a')]=0x0;}module['exports']=Channel;
\ No newline at end of file
+var _0x078f=['lastapplication','lastdata','billableseconds','type','tag','disposition','monitor','queue','transfercalleridnum','transferconnectedlinenum','transferType','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','endtime','unmanaged','abandoned'];(function(_0x3fcfbe,_0x192506){var _0x421faf=function(_0x1e935b){while(--_0x1e935b){_0x3fcfbe['push'](_0x3fcfbe['shift']());}};_0x421faf(++_0x192506);}(_0x078f,0x1b4));var _0xf078=function(_0xb3a872,_0x59d333){_0xb3a872=_0xb3a872-0x0;var _0x1991a9=_0x078f[_0xb3a872];return _0x1991a9;};'use strict';function Channel(){this['starttime']=null;this[_0xf078('0x0')]='';this[_0xf078('0x1')]='';this['calleridnum']=0x0;this[_0xf078('0x2')]='';this[_0xf078('0x3')]=undefined;this[_0xf078('0x4')]=undefined;this[_0xf078('0x5')]=0x0;this['context']='';this[_0xf078('0x6')]=0x0;this[_0xf078('0x7')]=0x0;this[_0xf078('0x8')]=0x0;this[_0xf078('0x9')]=![];this[_0xf078('0xa')]=null;this[_0xf078('0xb')]=null;this[_0xf078('0xc')]=![];this[_0xf078('0xd')]=![];this[_0xf078('0xe')]='';this[_0xf078('0xf')]='';this['duration']=0x0;this[_0xf078('0x10')]=0x0;this['holdtime']=0x0;this[_0xf078('0x11')]=null;this[_0xf078('0x12')]=null;this[_0xf078('0x13')]=null;this[_0xf078('0x14')]=![];this['monitorFilename']=null;this[_0xf078('0x15')]=null;this['monitors']=[];this[_0xf078('0x16')]=undefined;this[_0xf078('0x17')]=undefined;this[_0xf078('0x18')]=undefined;this['mohtime']=0x0;}module['exports']=Channel;
\ No newline at end of file
index 8f8d2d3..204e064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x200c=['tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x4f484c,_0x9bccb4){var _0x276e95=function(_0x32e002){while(--_0x32e002){_0x4f484c['push'](_0x4f484c['shift']());}};_0x276e95(++_0x9bccb4);}(_0x200c,0x1b2));var _0xc200=function(_0x3662c3,_0x4ad4c3){_0x3662c3=_0x3662c3-0x0;var _0x40c539=_0x200c[_0x3662c3];return _0x40c539;};'use strict';function DeskAccount(_0x4a5038){this['id']=_0x4a5038['id']||0x0;this[_0xc200('0x0')]=_0x4a5038['name']||'';this[_0xc200('0x1')]=_0x4a5038['username']||'';this['remoteUri']=_0x4a5038[_0xc200('0x2')]||'';this[_0xc200('0x3')]=_0x4a5038[_0xc200('0x3')]||'';this['password']=_0x4a5038[_0xc200('0x4')]||'';this['consumerKey']=_0x4a5038[_0xc200('0x5')]||'';this[_0xc200('0x6')]=_0x4a5038['consumerSecret']||'';this[_0xc200('0x7')]=_0x4a5038[_0xc200('0x7')]||'';this[_0xc200('0x8')]=_0x4a5038['tokenSecret']||'';this[_0xc200('0x9')]=_0x4a5038['type']||'';this[_0xc200('0xa')]=_0x4a5038[_0xc200('0xa')]||'';this[_0xc200('0xb')]=_0x4a5038[_0xc200('0xb')]||{};}module[_0xc200('0xc')]=DeskAccount;
\ No newline at end of file
+var _0xd20f=['consumerKey','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri','authType','password'];(function(_0x5d7661,_0x206fa2){var _0x17c054=function(_0x3a44ec){while(--_0x3a44ec){_0x5d7661['push'](_0x5d7661['shift']());}};_0x17c054(++_0x206fa2);}(_0xd20f,0xf8));var _0xfd20=function(_0x4fa467,_0x342598){_0x4fa467=_0x4fa467-0x0;var _0x5e3bb3=_0xd20f[_0x4fa467];return _0x5e3bb3;};'use strict';function DeskAccount(_0x2687ad){this['id']=_0x2687ad['id']||0x0;this[_0xfd20('0x0')]=_0x2687ad[_0xfd20('0x0')]||'';this[_0xfd20('0x1')]=_0x2687ad[_0xfd20('0x1')]||'';this[_0xfd20('0x2')]=_0x2687ad[_0xfd20('0x2')]||'';this[_0xfd20('0x3')]=_0x2687ad[_0xfd20('0x3')]||'';this[_0xfd20('0x4')]=_0x2687ad[_0xfd20('0x4')]||'';this[_0xfd20('0x5')]=_0x2687ad['consumerKey']||'';this['consumerSecret']=_0x2687ad['consumerSecret']||'';this[_0xfd20('0x6')]=_0x2687ad['token']||'';this[_0xfd20('0x7')]=_0x2687ad[_0xfd20('0x7')]||'';this[_0xfd20('0x8')]=_0x2687ad[_0xfd20('0x8')]||'';this[_0xfd20('0x9')]=_0x2687ad[_0xfd20('0x9')]||'';this[_0xfd20('0xa')]=_0x2687ad[_0xfd20('0xa')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
index 5fbcae7..e2c4ddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc05f=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x4601f2,_0x5ec5c7){var _0x39406a=function(_0x10426c){while(--_0x10426c){_0x4601f2['push'](_0x4601f2['shift']());}};_0x39406a(++_0x5ec5c7);}(_0xc05f,0x149));var _0xfc05=function(_0x5df36f,_0x4beff8){_0x5df36f=_0x5df36f-0x0;var _0x3fc782=_0xc05f[_0x5df36f];return _0x3fc782;};'use strict';function Dynamics365Account(_0x6f0074){this['id']=_0x6f0074['id']||0x0;this[_0xfc05('0x0')]=_0x6f0074[_0xfc05('0x0')]||'';this[_0xfc05('0x1')]=_0x6f0074[_0xfc05('0x1')]||'';this[_0xfc05('0x2')]=_0x6f0074[_0xfc05('0x2')]||'';this[_0xfc05('0x3')]=_0x6f0074['remoteUri']||'';this[_0xfc05('0x4')]=_0x6f0074['tenantId']||'';this[_0xfc05('0x5')]=_0x6f0074[_0xfc05('0x5')]||'';this[_0xfc05('0x6')]=_0x6f0074[_0xfc05('0x6')]||{};this['serverUrl']=_0x6f0074[_0xfc05('0x7')]||'';this[_0xfc05('0x8')]=_0x6f0074['modernAuthentication']||![];this[_0xfc05('0x9')]=_0x6f0074[_0xfc05('0x9')]||{};this['CloudProvider']=_0x6f0074[_0xfc05('0xa')]||{};}module[_0xfc05('0xb')]=Dynamics365Account;
\ No newline at end of file
+var _0xcaec=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xcaec,0xd7));var _0xccae=function(_0x4dbe90,_0x1518fd){_0x4dbe90=_0x4dbe90-0x0;var _0x1c9f64=_0xcaec[_0x4dbe90];return _0x1c9f64;};'use strict';function Dynamics365Account(_0x109e9c){this['id']=_0x109e9c['id']||0x0;this[_0xccae('0x0')]=_0x109e9c[_0xccae('0x0')]||'';this[_0xccae('0x1')]=_0x109e9c[_0xccae('0x1')]||'';this[_0xccae('0x2')]=_0x109e9c[_0xccae('0x2')]||'';this[_0xccae('0x3')]=_0x109e9c[_0xccae('0x3')]||'';this[_0xccae('0x4')]=_0x109e9c[_0xccae('0x4')]||'';this[_0xccae('0x5')]=_0x109e9c[_0xccae('0x5')]||'';this[_0xccae('0x6')]=_0x109e9c[_0xccae('0x6')]||{};this[_0xccae('0x7')]=_0x109e9c[_0xccae('0x7')]||'';this[_0xccae('0x8')]=_0x109e9c[_0xccae('0x8')]||![];this[_0xccae('0x9')]=_0x109e9c[_0xccae('0x9')]||{};this[_0xccae('0xa')]=_0x109e9c[_0xccae('0xa')]||{};}module[_0xccae('0xb')]=Dynamics365Account;
\ No newline at end of file
index 921a6dc..d0990f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5460=['headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm'];(function(_0x474d89,_0x545f8d){var _0x552228=function(_0x15fffc){while(--_0x15fffc){_0x474d89['push'](_0x474d89['shift']());}};_0x552228(++_0x545f8d);}(_0x5460,0xb8));var _0x0546=function(_0x324f20,_0x43674f){_0x324f20=_0x324f20-0x0;var _0x59f97d=_0x5460[_0x324f20];return _0x59f97d;};'use strict';function FaxAccount(_0x41d069){this['id']=_0x41d069['id']||0x0;this[_0x0546('0x0')]=_0x41d069[_0x0546('0x0')]||'';this[_0x0546('0x1')]=_0x41d069[_0x0546('0x1')];this[_0x0546('0x2')]=_0x41d069[_0x0546('0x2')];this[_0x0546('0x3')]=_0x41d069[_0x0546('0x3')];this[_0x0546('0x4')]=_0x41d069[_0x0546('0x4')];this[_0x0546('0x5')]=_0x41d069['minrate']||0x960;this[_0x0546('0x6')]=_0x41d069[_0x0546('0x6')]||0x3840;this[_0x0546('0x7')]=_0x41d069['modem']||_0x0546('0x8');this[_0x0546('0x9')]=_0x41d069[_0x0546('0x9')]||'no';this['faxdetect']=_0x41d069[_0x0546('0xa')]||'no';this[_0x0546('0xb')]=_0x41d069[_0x0546('0xb')]||0x1388;this[_0x0546('0xc')]=_0x41d069['tech']||_0x0546('0xd');this[_0x0546('0xe')]=_0x41d069['Trunk']?_0x41d069[_0x0546('0xe')]:undefined;this[_0x0546('0xf')]=_0x41d069[_0x0546('0xf')];this[_0x0546('0x10')]=_0x41d069['key'];}module['exports']=FaxAccount;
\ No newline at end of file
+var _0x6d3f=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x580eaf,_0x177fe9){var _0x1360bb=function(_0x5d7172){while(--_0x5d7172){_0x580eaf['push'](_0x580eaf['shift']());}};_0x1360bb(++_0x177fe9);}(_0x6d3f,0xe6));var _0xf6d3=function(_0x373533,_0x43aeb8){_0x373533=_0x373533-0x0;var _0x8c0b60=_0x6d3f[_0x373533];return _0x8c0b60;};'use strict';function FaxAccount(_0x37ed4e){this['id']=_0x37ed4e['id']||0x0;this[_0xf6d3('0x0')]=_0x37ed4e[_0xf6d3('0x0')]||'';this[_0xf6d3('0x1')]=_0x37ed4e[_0xf6d3('0x1')];this[_0xf6d3('0x2')]=_0x37ed4e['ecm'];this[_0xf6d3('0x3')]=_0x37ed4e[_0xf6d3('0x3')];this[_0xf6d3('0x4')]=_0x37ed4e[_0xf6d3('0x4')];this[_0xf6d3('0x5')]=_0x37ed4e[_0xf6d3('0x5')]||0x960;this['maxrate']=_0x37ed4e[_0xf6d3('0x6')]||0x3840;this['modem']=_0x37ed4e[_0xf6d3('0x7')]||_0xf6d3('0x8');this[_0xf6d3('0x9')]=_0x37ed4e['gateway']||'no';this[_0xf6d3('0xa')]=_0x37ed4e[_0xf6d3('0xa')]||'no';this[_0xf6d3('0xb')]=_0x37ed4e[_0xf6d3('0xb')]||0x1388;this[_0xf6d3('0xc')]=_0x37ed4e[_0xf6d3('0xc')]||'SIP';this[_0xf6d3('0xd')]=_0x37ed4e[_0xf6d3('0xd')]?_0x37ed4e[_0xf6d3('0xd')]:undefined;this['ListId']=_0x37ed4e[_0xf6d3('0xe')];this[_0xf6d3('0xf')]=_0x37ed4e[_0xf6d3('0xf')];}module[_0xf6d3('0x10')]=FaxAccount;
\ No newline at end of file
index 59a9e33..2d1f483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0f4=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0f4,0x13d));var _0x4c0f=function(_0x138989,_0x195291){_0x138989=_0x138989-0x0;var _0x1a451e=_0xc0f4[_0x138989];return _0x1a451e;};'use strict';function FreshdeskAccount(_0x43b218){this['id']=_0x43b218['id']||0x0;this[_0x4c0f('0x0')]=_0x43b218[_0x4c0f('0x0')]||'';this[_0x4c0f('0x1')]=_0x43b218['username']||'';this[_0x4c0f('0x2')]=_0x43b218[_0x4c0f('0x3')]||'';this[_0x4c0f('0x4')]=_0x43b218[_0x4c0f('0x4')]||'';this[_0x4c0f('0x5')]=_0x43b218[_0x4c0f('0x5')]||'';this[_0x4c0f('0x6')]=_0x43b218[_0x4c0f('0x6')]||{};}module[_0x4c0f('0x7')]=FreshdeskAccount;
\ No newline at end of file
+var _0xce5f=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x465f75,_0x4b9141){var _0x53f44a=function(_0x38d339){while(--_0x38d339){_0x465f75['push'](_0x465f75['shift']());}};_0x53f44a(++_0x4b9141);}(_0xce5f,0x1ad));var _0xfce5=function(_0x1f36bb,_0x3f5c03){_0x1f36bb=_0x1f36bb-0x0;var _0x1cdce9=_0xce5f[_0x1f36bb];return _0x1cdce9;};'use strict';function FreshdeskAccount(_0x26923c){this['id']=_0x26923c['id']||0x0;this[_0xfce5('0x0')]=_0x26923c[_0xfce5('0x0')]||'';this['username']=_0x26923c[_0xfce5('0x1')]||'';this[_0xfce5('0x2')]=_0x26923c[_0xfce5('0x3')]||'';this[_0xfce5('0x4')]=_0x26923c[_0xfce5('0x4')]||'';this[_0xfce5('0x5')]=_0x26923c[_0xfce5('0x5')]||'';this['Configurations']=_0x26923c[_0xfce5('0x6')]||{};}module[_0xfce5('0x7')]=FreshdeskAccount;
\ No newline at end of file
index 9c93664..357a86a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x815b=['name','username','token','serverUrl','Configurations','exports'];(function(_0x219696,_0x257678){var _0x1b581b=function(_0x23a622){while(--_0x23a622){_0x219696['push'](_0x219696['shift']());}};_0x1b581b(++_0x257678);}(_0x815b,0xb4));var _0xb815=function(_0x262560,_0xed4104){_0x262560=_0x262560-0x0;var _0x42e824=_0x815b[_0x262560];return _0x42e824;};'use strict';function FreshsalesAccount(_0x210c09){this['id']=_0x210c09['id']||0x0;this[_0xb815('0x0')]=_0x210c09[_0xb815('0x0')]||'';this[_0xb815('0x1')]=_0x210c09[_0xb815('0x1')]||'';this['apiKey']=_0x210c09[_0xb815('0x2')]||'';this['remoteUri']=_0x210c09['remoteUri']||'';this[_0xb815('0x3')]=_0x210c09[_0xb815('0x3')]||'';this[_0xb815('0x4')]=_0x210c09['Configurations']||{};}module[_0xb815('0x5')]=FreshsalesAccount;
\ No newline at end of file
+var _0xf8b2=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x19c8a7,_0x26d125){var _0x3a9d24=function(_0x3c316b){while(--_0x3c316b){_0x19c8a7['push'](_0x19c8a7['shift']());}};_0x3a9d24(++_0x26d125);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x551805,_0x5e0874){_0x551805=_0x551805-0x0;var _0x1a99e5=_0xf8b2[_0x551805];return _0x1a99e5;};'use strict';function FreshsalesAccount(_0x521bf7){this['id']=_0x521bf7['id']||0x0;this[_0x2f8b('0x0')]=_0x521bf7[_0x2f8b('0x0')]||'';this[_0x2f8b('0x1')]=_0x521bf7[_0x2f8b('0x1')]||'';this[_0x2f8b('0x2')]=_0x521bf7[_0x2f8b('0x3')]||'';this[_0x2f8b('0x4')]=_0x521bf7['remoteUri']||'';this['serverUrl']=_0x521bf7[_0x2f8b('0x5')]||'';this[_0x2f8b('0x6')]=_0x521bf7[_0x2f8b('0x6')]||{};}module[_0x2f8b('0x7')]=FreshsalesAccount;
\ No newline at end of file
index 9b249e3..14c2433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5844=['priority','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','type','uniqueid','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel'];(function(_0x3a0614,_0x4b6627){var _0x12bba7=function(_0x5ad138){while(--_0x5ad138){_0x3a0614['push'](_0x3a0614['shift']());}};_0x12bba7(++_0x4b6627);}(_0x5844,0xeb));var _0x4584=function(_0x4c7562,_0x261bec){_0x4c7562=_0x4c7562-0x0;var _0x407f32=_0x5844[_0x4c7562];return _0x407f32;};'use strict';function QueueReport(){this[_0x4584('0x0')]='inbound';this[_0x4584('0x1')]='';this['calleridnum']='';this['calleridname']='';this['queue']='';this[_0x4584('0x2')]=null;this[_0x4584('0x3')]=null;this[_0x4584('0x4')]=0x1;this['count']=0x1;this[_0x4584('0x5')]=![];this[_0x4584('0x6')]=null;this[_0x4584('0x7')]=![];this[_0x4584('0x8')]=null;this['queuecallerexit']=![];this[_0x4584('0x9')]=null;this[_0x4584('0xa')]=0x1;this[_0x4584('0xb')]='';this['connectedlinenum']='';this['connectedlinename']='';this['accountcode']='';this['context']='';this['exten']='';this[_0x4584('0xc')]='';this[_0x4584('0xd')]=0x0;this[_0x4584('0xe')]=![];this[_0x4584('0xf')]='';this['motionChannel']=_0x4584('0x10');this[_0x4584('0x11')]=0x0;this[_0x4584('0x12')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0xc89b=['calleridname','queue','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','holdtime','lastAssignedTo','voice','exports','type','calleridnum'];(function(_0x4d517b,_0x3a3431){var _0x2e7364=function(_0x19abe1){while(--_0x19abe1){_0x4d517b['push'](_0x4d517b['shift']());}};_0x2e7364(++_0x3a3431);}(_0xc89b,0x96));var _0xbc89=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xc89b[_0x18a79d];return _0x4f8848;};'use strict';function QueueReport(){this[_0xbc89('0x0')]='inbound';this['uniqueid']='';this[_0xbc89('0x1')]='';this[_0xbc89('0x2')]='';this[_0xbc89('0x3')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this['position']=0x1;this[_0xbc89('0x4')]=0x1;this['queuecallerabandon']=![];this[_0xbc89('0x5')]=null;this[_0xbc89('0x6')]=![];this[_0xbc89('0x7')]=null;this['queuecallerexit']=![];this[_0xbc89('0x8')]=null;this[_0xbc89('0x9')]=0x1;this[_0xbc89('0xa')]='';this[_0xbc89('0xb')]='';this[_0xbc89('0xc')]='';this[_0xbc89('0xd')]='';this['context']='';this[_0xbc89('0xe')]='';this['priority']='';this[_0xbc89('0xf')]=0x0;this['assigned']=![];this[_0xbc89('0x10')]='';this['motionChannel']=_0xbc89('0x11');this['mohtime']=0x0;this['variables']={};}module[_0xbc89('0x12')]=QueueReport;
\ No newline at end of file
index 187123f..91d8abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a02=['remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username'];(function(_0x1406ae,_0x292395){var _0x23a076=function(_0x5e147a){while(--_0x5e147a){_0x1406ae['push'](_0x1406ae['shift']());}};_0x23a076(++_0x292395);}(_0x7a02,0x1ba));var _0x27a0=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0x7a02[_0x2adbeb];return _0x5e18a6;};'use strict';function SalesforceAccount(_0x527689){this['id']=_0x527689['id']||0x0;this[_0x27a0('0x0')]=_0x527689[_0x27a0('0x0')]||'';this[_0x27a0('0x1')]=_0x527689[_0x27a0('0x1')]||'';this[_0x27a0('0x2')]=_0x527689['remoteUri']||'';this[_0x27a0('0x3')]=_0x527689[_0x27a0('0x3')]||'';this[_0x27a0('0x4')]=_0x527689[_0x27a0('0x4')]||'';this[_0x27a0('0x5')]=_0x527689[_0x27a0('0x5')]||'';this[_0x27a0('0x6')]=_0x527689[_0x27a0('0x6')]||'';this[_0x27a0('0x7')]=_0x527689[_0x27a0('0x7')]||_0x27a0('0x8');this[_0x27a0('0x9')]=_0x527689[_0x27a0('0x9')]||'';this['Configurations']=_0x527689[_0x27a0('0xa')]||{};}module[_0x27a0('0xb')]=SalesforceAccount;
\ No newline at end of file
+var _0x8738=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x47b18d,_0x1e4b5a){var _0x240560=function(_0x3a52e7){while(--_0x3a52e7){_0x47b18d['push'](_0x47b18d['shift']());}};_0x240560(++_0x1e4b5a);}(_0x8738,0x1aa));var _0x8873=function(_0x4a8e88,_0x1da7ae){_0x4a8e88=_0x4a8e88-0x0;var _0x5d3cc7=_0x8738[_0x4a8e88];return _0x5d3cc7;};'use strict';function SalesforceAccount(_0x5e642b){this['id']=_0x5e642b['id']||0x0;this['name']=_0x5e642b[_0x8873('0x0')]||'';this[_0x8873('0x1')]=_0x5e642b[_0x8873('0x1')]||'';this[_0x8873('0x2')]=_0x5e642b[_0x8873('0x2')]||'';this[_0x8873('0x3')]=_0x5e642b['password']||'';this[_0x8873('0x4')]=_0x5e642b['clientId']||'';this[_0x8873('0x5')]=_0x5e642b[_0x8873('0x5')]||'';this['securityToken']=_0x5e642b[_0x8873('0x6')]||'';this[_0x8873('0x7')]=_0x5e642b[_0x8873('0x7')]||'integrationTab';this[_0x8873('0x8')]=_0x5e642b[_0x8873('0x8')]||'';this[_0x8873('0x9')]=_0x5e642b['Configurations']||{};}module[_0x8873('0xa')]=SalesforceAccount;
\ No newline at end of file
index 3f909e1..d054526 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4610=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x4d33c5,_0x5d1b72){var _0x2dfbc5=function(_0x46d846){while(--_0x46d846){_0x4d33c5['push'](_0x4d33c5['shift']());}};_0x2dfbc5(++_0x5d1b72);}(_0x4610,0xa7));var _0x0461=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0x4610[_0x52ea08];return _0x28d546;};'use strict';function ServicenowAccount(_0x116600){this['id']=_0x116600['id']||0x0;this[_0x0461('0x0')]=_0x116600[_0x0461('0x0')]||'';this[_0x0461('0x1')]=_0x116600[_0x0461('0x1')]||'';this[_0x0461('0x2')]=_0x116600[_0x0461('0x2')]||'';this[_0x0461('0x3')]=_0x116600[_0x0461('0x3')]||'';this[_0x0461('0x4')]=_0x116600[_0x0461('0x4')]||'';this[_0x0461('0x5')]=_0x116600[_0x0461('0x5')]||{};}module[_0x0461('0x6')]=ServicenowAccount;
\ No newline at end of file
+var _0x6bfb=['remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x583c0d,_0x50d22a){var _0x41ffd6=function(_0x197689){while(--_0x197689){_0x583c0d['push'](_0x583c0d['shift']());}};_0x41ffd6(++_0x50d22a);}(_0x6bfb,0x100));var _0xb6bf=function(_0x41cb4b,_0x200468){_0x41cb4b=_0x41cb4b-0x0;var _0x1719c1=_0x6bfb[_0x41cb4b];return _0x1719c1;};'use strict';function ServicenowAccount(_0x226d67){this['id']=_0x226d67['id']||0x0;this[_0xb6bf('0x0')]=_0x226d67[_0xb6bf('0x0')]||'';this[_0xb6bf('0x1')]=_0x226d67[_0xb6bf('0x1')]||'';this['password']=_0x226d67['password']||'';this['remoteUri']=_0x226d67[_0xb6bf('0x2')]||'';this[_0xb6bf('0x3')]=_0x226d67[_0xb6bf('0x3')]||'';this[_0xb6bf('0x4')]=_0x226d67[_0xb6bf('0x4')]||{};}module[_0xb6bf('0x5')]=ServicenowAccount;
\ No newline at end of file
index 4445452..13ce085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85dc=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1f0acd,_0x33fdd8){var _0x547700=function(_0x1f4a38){while(--_0x1f4a38){_0x1f0acd['push'](_0x1f0acd['shift']());}};_0x547700(++_0x33fdd8);}(_0x85dc,0x16d));var _0xc85d=function(_0x4af3ec,_0x308a9b){_0x4af3ec=_0x4af3ec-0x0;var _0x431f8e=_0x85dc[_0x4af3ec];return _0x431f8e;};'use strict';function SugarcrmAccount(_0x1b8c82){this['id']=_0x1b8c82['id']||0x0;this[_0xc85d('0x0')]=_0x1b8c82[_0xc85d('0x0')]||'';this[_0xc85d('0x1')]=_0x1b8c82['username']||'';this[_0xc85d('0x2')]=_0x1b8c82[_0xc85d('0x2')]||'';this[_0xc85d('0x3')]=_0x1b8c82[_0xc85d('0x3')]||'';this['serverUrl']=_0x1b8c82[_0xc85d('0x4')]||'';this[_0xc85d('0x5')]=_0x1b8c82[_0xc85d('0x5')]||{};}module[_0xc85d('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x7a79=['exports','name','username','password','remoteUri','serverUrl'];(function(_0x11712d,_0x1f2294){var _0x4e923f=function(_0x289b9e){while(--_0x289b9e){_0x11712d['push'](_0x11712d['shift']());}};_0x4e923f(++_0x1f2294);}(_0x7a79,0x187));var _0x97a7=function(_0x5e8fc,_0x1ccc06){_0x5e8fc=_0x5e8fc-0x0;var _0x41c58c=_0x7a79[_0x5e8fc];return _0x41c58c;};'use strict';function SugarcrmAccount(_0x445e8e){this['id']=_0x445e8e['id']||0x0;this[_0x97a7('0x0')]=_0x445e8e['name']||'';this[_0x97a7('0x1')]=_0x445e8e[_0x97a7('0x1')]||'';this['password']=_0x445e8e[_0x97a7('0x2')]||'';this[_0x97a7('0x3')]=_0x445e8e['remoteUri']||'';this[_0x97a7('0x4')]=_0x445e8e[_0x97a7('0x4')]||'';this['Configurations']=_0x445e8e['Configurations']||{};}module[_0x97a7('0x5')]=SugarcrmAccount;
\ No newline at end of file
index fc3c3a5..4e97761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe40a=['accountcode','unknown','stateTime','address','exports','name'];(function(_0x373377,_0xf76d95){var _0x119500=function(_0x49ed8f){while(--_0x49ed8f){_0x373377['push'](_0x373377['shift']());}};_0x119500(++_0xf76d95);}(_0xe40a,0x7d));var _0xae40=function(_0x3cb59c,_0x76e565){_0x3cb59c=_0x3cb59c-0x0;var _0x4c5c85=_0xe40a[_0x3cb59c];return _0x4c5c85;};'use strict';function Telephone(_0x534875){this['id']=_0x534875['id']||0x0;this[_0xae40('0x0')]=_0x534875[_0xae40('0x0')]||'';this['accountcode']=_0x534875[_0xae40('0x1')]||'';this['state']=_0xae40('0x2');this[_0xae40('0x3')]=0x0;this['status']=_0xae40('0x2');this[_0xae40('0x4')]='';}module[_0xae40('0x5')]=Telephone;
\ No newline at end of file
+var _0x4503=['name','accountcode','state','unknown','stateTime','address','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4503,0x111));var _0x3450=function(_0xeb5895,_0x13081f){_0xeb5895=_0xeb5895-0x0;var _0x27b194=_0x4503[_0xeb5895];return _0x27b194;};'use strict';function Telephone(_0xe25f2e){this['id']=_0xe25f2e['id']||0x0;this[_0x3450('0x0')]=_0xe25f2e[_0x3450('0x0')]||'';this[_0x3450('0x1')]=_0xe25f2e['accountcode']||'';this[_0x3450('0x2')]=_0x3450('0x3');this[_0x3450('0x4')]=0x0;this['status']=_0x3450('0x3');this[_0x3450('0x5')]='';}module[_0x3450('0x6')]=Telephone;
\ No newline at end of file
index 8c02fb2..1e056be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','html'];(function(_0x595ca2,_0xaae5e1){var _0x5d4c02=function(_0x2a18f6){while(--_0x2a18f6){_0x595ca2['push'](_0x595ca2['shift']());}};_0x5d4c02(++_0xaae5e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x6a10fa,_0x1712fe){_0x6a10fa=_0x6a10fa-0x0;var _0x3b703a=_0xb10b[_0x6a10fa];return _0x3b703a;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x7cbdb,_0x35efd5){var _0x304b4f=function(_0x20a5cb){while(--_0x20a5cb){_0x7cbdb['push'](_0x7cbdb['shift']());}};_0x304b4f(++_0x35efd5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 292520a..ea6bc03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x542746,_0x397a90){var _0x4a8a6f=function(_0x4171cc){while(--_0x4171cc){_0x542746['push'](_0x542746['shift']());}};_0x4a8a6f(++_0x397a90);}(_0x8603,0x190));var _0x3860=function(_0x588a9c,_0x434e22){_0x588a9c=_0x588a9c-0x0;var _0x32ab03=_0x8603[_0x588a9c];return _0x32ab03;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1f9fb7,_0x2b4728){var _0xff307b=function(_0x4746d1){while(--_0x4746d1){_0x1f9fb7['push'](_0x1f9fb7['shift']());}};_0xff307b(++_0x2b4728);}(_0x2032,0xd9));var _0x2203=function(_0x43c84b,_0x458a0c){_0x43c84b=_0x43c84b-0x0;var _0x1bd2a1=_0x2032[_0x43c84b];return _0x1bd2a1;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
index ae89c1e..f965e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf596=['registrationtime','address','defaultuser','exports','active','status','unknown','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x4a78af,_0x268061){var _0x525ff8=function(_0x144662){while(--_0x144662){_0x4a78af['push'](_0x4a78af['shift']());}};_0x525ff8(++_0x268061);}(_0xf596,0x1d4));var _0x6f59=function(_0x25dc18,_0x5f147c){_0x25dc18=_0x25dc18-0x0;var _0x5d9317=_0xf596[_0x25dc18];return _0x5d9317;};'use strict';function Trunk(_0x58b7de){this['id']=_0x58b7de['id']||0x0;this[_0x6f59('0x0')]=_0x58b7de[_0x6f59('0x0')]||![];this['name']=_0x58b7de['name']||'';this['state']='unknown';this['stateTime']=0x0;this[_0x6f59('0x1')]=_0x6f59('0x2');this[_0x6f59('0x3')]=_0x58b7de[_0x6f59('0x3')]&&_0x58b7de['registry'][_0x6f59('0x4')](':')?_0x58b7de['registry'][_0x6f59('0x5')](':')[0x0]:'';this[_0x6f59('0x6')]='';this[_0x6f59('0x7')]='';this[_0x6f59('0x8')]='';this[_0x6f59('0x9')]='';this[_0x6f59('0xa')]='';this[_0x6f59('0xb')]=_0x6f59('0x2');this[_0x6f59('0xc')]='';this[_0x6f59('0xd')]='';this[_0x6f59('0xe')]=_0x58b7de['defaultuser']||'';}module[_0x6f59('0xf')]=Trunk;
\ No newline at end of file
+var _0x4c36=['indexOf','split','host','port','domain','refresh','stateRegistry','registrationtime','address','defaultuser','exports','active','name','unknown','registry'];(function(_0x50b295,_0x420eaf){var _0x230324=function(_0x2c015d){while(--_0x2c015d){_0x50b295['push'](_0x50b295['shift']());}};_0x230324(++_0x420eaf);}(_0x4c36,0x155));var _0x64c3=function(_0x5acc14,_0x2f3058){_0x5acc14=_0x5acc14-0x0;var _0x58e2b1=_0x4c36[_0x5acc14];return _0x58e2b1;};'use strict';function Trunk(_0x3e7dc4){this['id']=_0x3e7dc4['id']||0x0;this[_0x64c3('0x0')]=_0x3e7dc4[_0x64c3('0x0')]||![];this[_0x64c3('0x1')]=_0x3e7dc4['name']||'';this['state']=_0x64c3('0x2');this['stateTime']=0x0;this['status']='unknown';this[_0x64c3('0x3')]=_0x3e7dc4['registry']&&_0x3e7dc4[_0x64c3('0x3')][_0x64c3('0x4')](':')?_0x3e7dc4[_0x64c3('0x3')][_0x64c3('0x5')](':')[0x0]:'';this[_0x64c3('0x6')]='';this[_0x64c3('0x7')]='';this[_0x64c3('0x8')]='';this['domainport']='';this[_0x64c3('0x9')]='';this[_0x64c3('0xa')]=_0x64c3('0x2');this[_0x64c3('0xb')]='';this[_0x64c3('0xc')]='';this['defaultuser']=_0x3e7dc4[_0x64c3('0xd')]||'';}module[_0x64c3('0xe')]=Trunk;
\ No newline at end of file
index e996d95..e316e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12f7=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x5e6067,_0x5e4bb){var _0x52ea16=function(_0x1c5b45){while(--_0x1c5b45){_0x5e6067['push'](_0x5e6067['shift']());}};_0x52ea16(++_0x5e4bb);}(_0x12f7,0x12a));var _0x712f=function(_0x3da23a,_0x14614b){_0x3da23a=_0x3da23a-0x0;var _0x53e450=_0x12f7[_0x3da23a];return _0x53e450;};'use strict';function voiceExtension(_0x49dc06){this['id']=_0x49dc06['id']||0x0;this['exten']=_0x49dc06[_0x712f('0x0')]||'';this[_0x712f('0x1')]=_0x49dc06[_0x712f('0x1')]||_0x712f('0x2');this['mandatoryDisposition']=_0x49dc06[_0x712f('0x3')]||![];}module[_0x712f('0x4')]=voiceExtension;
\ No newline at end of file
+var _0x82e7=['exports','exten','recordingFormat'];(function(_0x58ee3b,_0x5b9ad4){var _0x25c6ce=function(_0x2f62ab){while(--_0x2f62ab){_0x58ee3b['push'](_0x58ee3b['shift']());}};_0x25c6ce(++_0x5b9ad4);}(_0x82e7,0x181));var _0x782e=function(_0x16dda6,_0x540e04){_0x16dda6=_0x16dda6-0x0;var _0x4d35a0=_0x82e7[_0x16dda6];return _0x4d35a0;};'use strict';function voiceExtension(_0x46e676){this['id']=_0x46e676['id']||0x0;this[_0x782e('0x0')]=_0x46e676['exten']||'';this[_0x782e('0x1')]=_0x46e676['recordingFormat']||'none';this['mandatoryDisposition']=_0x46e676['mandatoryDisposition']||![];}module[_0x782e('0x2')]=voiceExtension;
\ No newline at end of file
index 19d5b06..57592ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba54=['dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0xba54,0xc8));var _0x4ba5=function(_0x3d350a,_0x44de1a){_0x3d350a=_0x3d350a-0x0;var _0x576d26=_0xba54[_0x3d350a];return _0x576d26;};'use strict';var statusDesc=['unknown',_0x4ba5('0x0'),_0x4ba5('0x1'),_0x4ba5('0x2'),_0x4ba5('0x3'),'unavailable',_0x4ba5('0x4'),_0x4ba5('0x5'),_0x4ba5('0x6')];var monitorFormat={'wav':_0x4ba5('0x7'),'wav49':_0x4ba5('0x8'),'gsm':_0x4ba5('0x9')};var strategy={'rrmemory':_0x4ba5('0xa'),'roundrobin':_0x4ba5('0xb')};function VoiceQueue(_0x50d1d2){this['id']=_0x50d1d2['id']||0x0;this[_0x4ba5('0xc')]=_0x50d1d2['name']||'';this[_0x4ba5('0xd')]=_0x50d1d2[_0x4ba5('0xd')]||'';this['type']=_0x50d1d2[_0x4ba5('0xe')]||_0x4ba5('0xf');this[_0x4ba5('0x10')]=0x0;this[_0x4ba5('0x11')]=0x0;this[_0x4ba5('0x12')]=0x0;this[_0x4ba5('0x13')]=0x0;this[_0x4ba5('0x14')]=0x0;this['sumHoldTime']=0x0;this[_0x4ba5('0x15')]=0x0;this[_0x4ba5('0x16')]=0x0;this[_0x4ba5('0x17')]=0x0;this[_0x4ba5('0x18')]=0x0;this[_0x4ba5('0x19')]=0x0;this['acw']=_0x50d1d2[_0x4ba5('0x1a')]||![];this[_0x4ba5('0x1b')]=_0x50d1d2[_0x4ba5('0x1b')]||0xa;this[_0x4ba5('0x1c')]=_0x50d1d2[_0x4ba5('0x1c')]||'no';this['sendMessageOneNotActive']=!![];this[_0x4ba5('0x1d')]='';this[_0x4ba5('0x1e')]=0x0;this[_0x4ba5('0x1f')]=0x0;this['dialTimezone']=_0x50d1d2[_0x4ba5('0x20')]||null;this[_0x4ba5('0x21')]=_0x50d1d2[_0x4ba5('0x21')]?_0x50d1d2[_0x4ba5('0x21')]:null;this[_0x4ba5('0x22')]=_0x50d1d2[_0x4ba5('0x22')];this[_0x4ba5('0x23')]=_0x50d1d2['dialMethod']||_0x4ba5('0x24');this['dialLimitChannel']=_0x50d1d2['dialLimitChannel']||0x0;this[_0x4ba5('0x25')]=_0x50d1d2['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x50d1d2[_0x4ba5('0x26')]||0x1;this[_0x4ba5('0x27')]=_0x50d1d2['dialPredictiveOptimization']||_0x4ba5('0x28');this[_0x4ba5('0x29')]=_0x50d1d2[_0x4ba5('0x29')]||0.03;this['dialPredictiveInterval']=_0x50d1d2[_0x4ba5('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x50d1d2[_0x4ba5('0x2b')]||_0x4ba5('0x2c');this['dialOriginateCallerIdNumber']=_0x50d1d2['dialOriginateCallerIdNumber']||_0x4ba5('0x2c');this[_0x4ba5('0x2d')]=_0x50d1d2['dialOriginateTimeout']||0x1e;this[_0x4ba5('0x2e')]=_0x50d1d2['dialQueueOptions']||'tTxX';this[_0x4ba5('0x2f')]=_0x50d1d2[_0x4ba5('0x2f')]||0x3;this[_0x4ba5('0x30')]=_0x50d1d2[_0x4ba5('0x30')]||undefined;this[_0x4ba5('0x31')]=_0x50d1d2[_0x4ba5('0x31')]||0x3;this[_0x4ba5('0x32')]=_0x50d1d2[_0x4ba5('0x32')]||0x96;this[_0x4ba5('0x33')]=_0x50d1d2[_0x4ba5('0x33')]||0x3;this[_0x4ba5('0x34')]=_0x50d1d2[_0x4ba5('0x34')]||0x96;this[_0x4ba5('0x35')]=_0x50d1d2['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x50d1d2[_0x4ba5('0x36')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x50d1d2[_0x4ba5('0x37')]||0x3;this[_0x4ba5('0x38')]=_0x50d1d2[_0x4ba5('0x38')]||0x96;this[_0x4ba5('0x39')]=_0x50d1d2[_0x4ba5('0x39')]||0x3;this[_0x4ba5('0x3a')]=_0x50d1d2[_0x4ba5('0x3a')]||0x96;this[_0x4ba5('0x3b')]=_0x50d1d2[_0x4ba5('0x3b')]||0x3;this['dialAbandonedRetryFrequency']=_0x50d1d2[_0x4ba5('0x3c')]||0x96;this['dialMachineMaxRetry']=_0x50d1d2[_0x4ba5('0x3d')]||0x3;this[_0x4ba5('0x3e')]=_0x50d1d2['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x50d1d2[_0x4ba5('0x3f')]||0x3;this[_0x4ba5('0x40')]=_0x50d1d2['dialAgentRejectRetryFrequency']||0x96;this[_0x4ba5('0x41')]=_0x50d1d2[_0x4ba5('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x50d1d2[_0x4ba5('0x42')]||0x4;this[_0x4ba5('0x43')]=_0x50d1d2[_0x4ba5('0x43')]?_0x50d1d2['Trunk']:undefined;this[_0x4ba5('0x44')]=_0x50d1d2[_0x4ba5('0x44')]?_0x50d1d2[_0x4ba5('0x44')]:undefined;this['dialPrefix']=_0x50d1d2[_0x4ba5('0x45')]||undefined;this[_0x4ba5('0x46')]=_0x50d1d2[_0x4ba5('0x46')]?_0x50d1d2['Interval']:undefined;this[_0x4ba5('0x47')]=_0x50d1d2[_0x4ba5('0x47')]||_0x4ba5('0x48');this[_0x4ba5('0x49')]=_0x50d1d2[_0x4ba5('0x49')]||undefined;this[_0x4ba5('0x4a')]=_0x50d1d2[_0x4ba5('0x4a')]||undefined;this[_0x4ba5('0x4b')]=strategy[_0x50d1d2[_0x4ba5('0x4b')]]||'rrmemory';this[_0x4ba5('0x4c')]=!![];this[_0x4ba5('0x4d')]=_0x50d1d2[_0x4ba5('0x4d')]||![];this[_0x4ba5('0x4e')]=_0x50d1d2[_0x4ba5('0x4e')];this[_0x4ba5('0x4f')]=_0x50d1d2['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x50d1d2[_0x4ba5('0x50')];this['dialAMDTotalAnalysisTime']=_0x50d1d2[_0x4ba5('0x51')];this['dialAMDMinWordLength']=_0x50d1d2['dialAMDMinWordLength'];this[_0x4ba5('0x52')]=_0x50d1d2[_0x4ba5('0x52')];this[_0x4ba5('0x53')]=_0x50d1d2[_0x4ba5('0x53')];this[_0x4ba5('0x54')]=_0x50d1d2[_0x4ba5('0x54')];this['dialAMDMaximumWordLength']=_0x50d1d2['dialAMDMaximumWordLength'];this[_0x4ba5('0x55')]=0x0;this[_0x4ba5('0x56')]=0x0;this['timeout']=_0x50d1d2['timeout'];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x4ba5('0x57')]=0x0;this[_0x4ba5('0x58')]=0x0;this[_0x4ba5('0x59')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x4ba5('0x5a')]=0x0;this[_0x4ba5('0x5b')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x4ba5('0x5c')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0x4ba5('0x5d')]=0x0;this[_0x4ba5('0x5e')]=undefined;this[_0x4ba5('0x5f')]=undefined;this['handlePredictive']=undefined;this[_0x4ba5('0x60')]=1.05;this[_0x4ba5('0x61')]=0x0;this[_0x4ba5('0x62')]=0x0;this[_0x4ba5('0x63')]=0x0;this[_0x4ba5('0x64')]=0x0;this[_0x4ba5('0x65')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x4ba5('0x66')]=0x0;this[_0x4ba5('0x67')]=_0x50d1d2[_0x4ba5('0x68')]||0x14;this[_0x4ba5('0x69')]=_0x50d1d2[_0x4ba5('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x4ba5('0x6a')]=0x1;this[_0x4ba5('0x6b')]=0x0;this[_0x4ba5('0x6c')]=0x0;this[_0x4ba5('0x6d')]=0x0;this[_0x4ba5('0x6e')]=0x0;this[_0x4ba5('0x6f')]=_0x50d1d2[_0x4ba5('0x6f')]||0x1e;this[_0x4ba5('0x70')]=_0x50d1d2[_0x4ba5('0x70')]||![];this[_0x4ba5('0x71')]=!!_0x50d1d2[_0x4ba5('0x71')]||![];this[_0x4ba5('0x72')]=!!_0x50d1d2[_0x4ba5('0x72')]||![];this[_0x4ba5('0x73')]=_0x50d1d2['dialQueueProject2']||undefined;this[_0x4ba5('0x74')]=_0x50d1d2[_0x4ba5('0x74')]||![];this[_0x4ba5('0x75')]=_0x50d1d2[_0x4ba5('0x75')]||![];this[_0x4ba5('0xd')]=monitorFormat[_0x50d1d2[_0x4ba5('0xd')]]?monitorFormat[_0x50d1d2['monitor_format']]:undefined;this[_0x4ba5('0x76')]=_0x50d1d2[_0x4ba5('0x76')]||![];this[_0x4ba5('0x77')]=_0x50d1d2['mandatoryDispositionPause']?_0x50d1d2['mandatoryDispositionPause']:undefined;}module[_0x4ba5('0x78')]=VoiceQueue;
\ No newline at end of file
+var _0x3484=['name','monitor_format','type','talking','sumHoldTime','unmanaged','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','onhold','wav','wav49','gsm','rrmemory','roundrobin'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3484,0x162));var _0x4348=function(_0x1d2cb7,_0x53f068){_0x1d2cb7=_0x1d2cb7-0x0;var _0x513ee5=_0x3484[_0x1d2cb7];return _0x513ee5;};'use strict';var statusDesc=[_0x4348('0x0'),_0x4348('0x1'),_0x4348('0x2'),_0x4348('0x3'),_0x4348('0x4'),_0x4348('0x5'),'ringing','ringinuse',_0x4348('0x6')];var monitorFormat={'wav':_0x4348('0x7'),'wav49':_0x4348('0x8'),'gsm':_0x4348('0x9')};var strategy={'rrmemory':_0x4348('0xa'),'roundrobin':_0x4348('0xb')};function VoiceQueue(_0x137a6e){this['id']=_0x137a6e['id']||0x0;this[_0x4348('0xc')]=_0x137a6e[_0x4348('0xc')]||'';this['monitor_format']=_0x137a6e[_0x4348('0xd')]||'';this[_0x4348('0xe')]=_0x137a6e['type']||'inbound';this['waiting']=0x0;this[_0x4348('0xf')]=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x4348('0x10')]=0x0;this['sumBillable']=0x0;this[_0x4348('0x11')]=0x0;this['abandoned']=0x0;this[_0x4348('0x12')]=0x0;this[_0x4348('0x13')]=0x0;this[_0x4348('0x14')]=_0x137a6e[_0x4348('0x14')]||![];this[_0x4348('0x15')]=_0x137a6e[_0x4348('0x15')]||0xa;this[_0x4348('0x16')]=_0x137a6e['autopause']||'no';this[_0x4348('0x17')]=!![];this[_0x4348('0x18')]='';this['originated']=0x0;this[_0x4348('0x19')]=0x0;this[_0x4348('0x1a')]=_0x137a6e[_0x4348('0x1a')]||null;this[_0x4348('0x1b')]=_0x137a6e[_0x4348('0x1b')]?_0x137a6e[_0x4348('0x1b')]:null;this[_0x4348('0x1c')]=_0x137a6e[_0x4348('0x1c')];this['dialMethod']=_0x137a6e[_0x4348('0x1d')]||_0x4348('0x1e');this[_0x4348('0x1f')]=_0x137a6e[_0x4348('0x1f')]||0x0;this[_0x4348('0x20')]=_0x137a6e['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x137a6e['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x137a6e[_0x4348('0x21')]||'dropRate';this[_0x4348('0x22')]=_0x137a6e[_0x4348('0x22')]||0.03;this[_0x4348('0x23')]=_0x137a6e[_0x4348('0x23')]||0x258;this[_0x4348('0x24')]=_0x137a6e[_0x4348('0x24')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x137a6e[_0x4348('0x25')]||_0x4348('0x26');this[_0x4348('0x27')]=_0x137a6e[_0x4348('0x27')]||0x1e;this[_0x4348('0x28')]=_0x137a6e['dialQueueOptions']||_0x4348('0x29');this[_0x4348('0x2a')]=_0x137a6e[_0x4348('0x2a')]||0x3;this[_0x4348('0x2b')]=_0x137a6e[_0x4348('0x2b')]||undefined;this[_0x4348('0x2c')]=_0x137a6e['dialCongestionMaxRetry']||0x3;this[_0x4348('0x2d')]=_0x137a6e[_0x4348('0x2d')]||0x96;this[_0x4348('0x2e')]=_0x137a6e[_0x4348('0x2e')]||0x3;this['dialBusyRetryFrequency']=_0x137a6e[_0x4348('0x2f')]||0x96;this[_0x4348('0x30')]=_0x137a6e[_0x4348('0x30')]||0x3;this['dialNoAnswerRetryFrequency']=_0x137a6e[_0x4348('0x31')]||0x96;this[_0x4348('0x32')]=_0x137a6e[_0x4348('0x32')]||0x3;this[_0x4348('0x33')]=_0x137a6e[_0x4348('0x33')]||0x96;this[_0x4348('0x34')]=_0x137a6e['dialDropMaxRetry']||0x3;this[_0x4348('0x35')]=_0x137a6e[_0x4348('0x35')]||0x96;this[_0x4348('0x36')]=_0x137a6e[_0x4348('0x36')]||0x3;this[_0x4348('0x37')]=_0x137a6e['dialAbandonedRetryFrequency']||0x96;this[_0x4348('0x38')]=_0x137a6e[_0x4348('0x38')]||0x3;this[_0x4348('0x39')]=_0x137a6e['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x137a6e['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x137a6e[_0x4348('0x3a')]||0x96;this['callAdditionalPhoneAfterMin']=_0x137a6e[_0x4348('0x3b')]||0x3;this[_0x4348('0x3c')]=_0x137a6e[_0x4348('0x3c')]||0x4;this['Trunk']=_0x137a6e[_0x4348('0x3d')]?_0x137a6e['Trunk']:undefined;this[_0x4348('0x3e')]=_0x137a6e[_0x4348('0x3e')]?_0x137a6e['TrunkBackup']:undefined;this[_0x4348('0x3f')]=_0x137a6e['dialPrefix']||undefined;this[_0x4348('0x40')]=_0x137a6e[_0x4348('0x40')]?_0x137a6e[_0x4348('0x40')]:undefined;this[_0x4348('0x41')]=_0x137a6e[_0x4348('0x41')]||_0x4348('0x42');this['dialRandomLastDigitCallerIdNumber']=_0x137a6e[_0x4348('0x43')]||undefined;this[_0x4348('0x44')]=_0x137a6e[_0x4348('0x44')]||undefined;this['strategy']=strategy[_0x137a6e[_0x4348('0x45')]]||_0x4348('0xa');this[_0x4348('0x46')]=!![];this[_0x4348('0x47')]=_0x137a6e[_0x4348('0x47')]||![];this[_0x4348('0x48')]=_0x137a6e[_0x4348('0x48')];this[_0x4348('0x49')]=_0x137a6e[_0x4348('0x49')];this[_0x4348('0x4a')]=_0x137a6e['dialAMDAfterGreetingSilence'];this[_0x4348('0x4b')]=_0x137a6e[_0x4348('0x4b')];this[_0x4348('0x4c')]=_0x137a6e[_0x4348('0x4c')];this[_0x4348('0x4d')]=_0x137a6e['dialAMDBetweenWordsSilence'];this[_0x4348('0x4e')]=_0x137a6e[_0x4348('0x4e')];this[_0x4348('0x4f')]=_0x137a6e[_0x4348('0x4f')];this[_0x4348('0x50')]=_0x137a6e[_0x4348('0x50')];this[_0x4348('0x51')]=0x0;this[_0x4348('0x52')]=0x0;this[_0x4348('0x53')]=_0x137a6e['timeout'];this[_0x4348('0x54')]=0x0;this[_0x4348('0x55')]=0x0;this[_0x4348('0x56')]=0x0;this[_0x4348('0x57')]=0x0;this[_0x4348('0x58')]=0x0;this[_0x4348('0x59')]=0x0;this[_0x4348('0x5a')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x4348('0x5b')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x4348('0x5c')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x4348('0x5d')]=0x0;this[_0x4348('0x5e')]=0x0;this[_0x4348('0x5f')]=undefined;this[_0x4348('0x60')]=undefined;this[_0x4348('0x61')]=undefined;this[_0x4348('0x62')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x4348('0x63')]=0x0;this[_0x4348('0x64')]=0x0;this[_0x4348('0x65')]=0x0;this[_0x4348('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x4348('0x67')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0x4348('0x68')]=_0x137a6e[_0x4348('0x69')]||0x14;this[_0x4348('0x6a')]=_0x137a6e[_0x4348('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x4348('0x6b')]=0x0;this[_0x4348('0x6c')]=0x1;this['erlangCalls']=0x0;this[_0x4348('0x6d')]=0x0;this[_0x4348('0x6e')]=0x0;this[_0x4348('0x6f')]=0x0;this[_0x4348('0x70')]=_0x137a6e[_0x4348('0x70')]||0x1e;this['dialRecallInQueue']=_0x137a6e[_0x4348('0x71')]||![];this[_0x4348('0x72')]=!!_0x137a6e['dialPreviewAutoRecallMe']||![];this[_0x4348('0x73')]=!!_0x137a6e[_0x4348('0x73')]||![];this[_0x4348('0x74')]=_0x137a6e[_0x4348('0x74')]||undefined;this[_0x4348('0x75')]=_0x137a6e[_0x4348('0x75')]||![];this[_0x4348('0x76')]=_0x137a6e[_0x4348('0x76')]||![];this['monitor_format']=monitorFormat[_0x137a6e[_0x4348('0xd')]]?monitorFormat[_0x137a6e[_0x4348('0xd')]]:undefined;this[_0x4348('0x77')]=_0x137a6e[_0x4348('0x77')]||![];this[_0x4348('0x78')]=_0x137a6e[_0x4348('0x78')]?_0x137a6e[_0x4348('0x78')]:undefined;}module[_0x4348('0x79')]=VoiceQueue;
\ No newline at end of file
index 9e9020a..3dc96ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff60=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x4e21ba,_0x18097f){var _0x55b94b=function(_0x3b9add){while(--_0x3b9add){_0x4e21ba['push'](_0x4e21ba['shift']());}};_0x55b94b(++_0x18097f);}(_0xff60,0x1e0));var _0x0ff6=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xff60[_0x543084];return _0x306a57;};'use strict';function VtigerAccount(_0x3d0049){this['id']=_0x3d0049['id']||0x0;this[_0x0ff6('0x0')]=_0x3d0049['name']||'';this['username']=_0x3d0049[_0x0ff6('0x1')]||'';this[_0x0ff6('0x2')]=_0x3d0049[_0x0ff6('0x2')]||'';this[_0x0ff6('0x3')]=_0x3d0049[_0x0ff6('0x3')]||'';this[_0x0ff6('0x4')]=_0x3d0049[_0x0ff6('0x4')]||'';this[_0x0ff6('0x5')]=_0x3d0049['Configurations']||{};}module[_0x0ff6('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x2c92=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x9eb3d4,_0x5415f6){var _0x340f20=function(_0x882fdc){while(--_0x882fdc){_0x9eb3d4['push'](_0x9eb3d4['shift']());}};_0x340f20(++_0x5415f6);}(_0x2c92,0x93));var _0x22c9=function(_0x1bb58c,_0x2c8a4d){_0x1bb58c=_0x1bb58c-0x0;var _0x277586=_0x2c92[_0x1bb58c];return _0x277586;};'use strict';function VtigerAccount(_0x59b51e){this['id']=_0x59b51e['id']||0x0;this[_0x22c9('0x0')]=_0x59b51e[_0x22c9('0x0')]||'';this[_0x22c9('0x1')]=_0x59b51e[_0x22c9('0x1')]||'';this[_0x22c9('0x2')]=_0x59b51e[_0x22c9('0x2')]||'';this[_0x22c9('0x3')]=_0x59b51e['remoteUri']||'';this[_0x22c9('0x4')]=_0x59b51e[_0x22c9('0x4')]||'';this[_0x22c9('0x5')]=_0x59b51e[_0x22c9('0x5')]||{};}module[_0x22c9('0x6')]=VtigerAccount;
\ No newline at end of file
index 144a46b..a73be21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbde9=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','username','password','token'];(function(_0xbc8f08,_0x4cec87){var _0x580933=function(_0x8460d4){while(--_0x8460d4){_0xbc8f08['push'](_0xbc8f08['shift']());}};_0x580933(++_0x4cec87);}(_0xbde9,0x147));var _0x9bde=function(_0x6a7421,_0x20b4f5){_0x6a7421=_0x6a7421-0x0;var _0x33f5d1=_0xbde9[_0x6a7421];return _0x33f5d1;};'use strict';function ZendeskAccount(_0xaf736b){this['id']=_0xaf736b['id']||0x0;this['name']=_0xaf736b['name']||'';this[_0x9bde('0x0')]=_0xaf736b[_0x9bde('0x0')]||'';this[_0x9bde('0x1')]=_0xaf736b[_0x9bde('0x1')]||'';this[_0x9bde('0x2')]=_0xaf736b['token']||'';this[_0x9bde('0x3')]=_0xaf736b[_0x9bde('0x3')]||'';this[_0x9bde('0x4')]=_0xaf736b[_0x9bde('0x4')]||'';this['type']=_0xaf736b[_0x9bde('0x5')]||_0x9bde('0x6');this[_0x9bde('0x7')]=_0xaf736b[_0x9bde('0x7')]||'';this[_0x9bde('0x8')]=_0xaf736b['Configurations']||{};}module[_0x9bde('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xf7e5=['type','integrationTab','serverUrl','Configurations','exports','name','username','token','remoteUri','authType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf7e5,0x7d));var _0x5f7e=function(_0x58fae8,_0x104d38){_0x58fae8=_0x58fae8-0x0;var _0x18f808=_0xf7e5[_0x58fae8];return _0x18f808;};'use strict';function ZendeskAccount(_0x5e8115){this['id']=_0x5e8115['id']||0x0;this[_0x5f7e('0x0')]=_0x5e8115[_0x5f7e('0x0')]||'';this['username']=_0x5e8115[_0x5f7e('0x1')]||'';this['password']=_0x5e8115['password']||'';this[_0x5f7e('0x2')]=_0x5e8115[_0x5f7e('0x2')]||'';this[_0x5f7e('0x3')]=_0x5e8115[_0x5f7e('0x3')]||'';this[_0x5f7e('0x4')]=_0x5e8115[_0x5f7e('0x4')]||'';this[_0x5f7e('0x5')]=_0x5e8115['type']||_0x5f7e('0x6');this[_0x5f7e('0x7')]=_0x5e8115[_0x5f7e('0x7')]||'';this['Configurations']=_0x5e8115[_0x5f7e('0x8')]||{};}module[_0x5f7e('0x9')]=ZendeskAccount;
\ No newline at end of file
index ed2e3f7..18e91cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1602=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x5313ea,_0x435e38){var _0x4d4dfa=function(_0x3487e3){while(--_0x3487e3){_0x5313ea['push'](_0x5313ea['shift']());}};_0x4d4dfa(++_0x435e38);}(_0x1602,0x101));var _0x2160=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x1602[_0x5b644e];return _0x49c6bf;};'use strict';function ZohoAccount(_0x116d21){this['id']=_0x116d21['id']||0x0;this[_0x2160('0x0')]=_0x116d21[_0x2160('0x0')]||'';this[_0x2160('0x1')]=_0x116d21[_0x2160('0x1')]||'';this[_0x2160('0x2')]=_0x116d21['host']||'';this[_0x2160('0x3')]=_0x116d21[_0x2160('0x3')]||'';this[_0x2160('0x4')]=_0x116d21['clientId']||'';this[_0x2160('0x5')]=_0x116d21[_0x2160('0x5')]||'';this[_0x2160('0x6')]=_0x116d21[_0x2160('0x6')]||'';this[_0x2160('0x7')]=_0x116d21['code']||'';this['refreshToken']=_0x116d21[_0x2160('0x8')]||'';this[_0x2160('0x9')]=_0x116d21['Configurations']||{};}module[_0x2160('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x71b2=['description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name'];(function(_0x55f10d,_0x41204d){var _0x40b9ba=function(_0x1aca6b){while(--_0x1aca6b){_0x55f10d['push'](_0x55f10d['shift']());}};_0x40b9ba(++_0x41204d);}(_0x71b2,0xba));var _0x271b=function(_0xbc2d9e,_0x40ef4f){_0xbc2d9e=_0xbc2d9e-0x0;var _0x2e315c=_0x71b2[_0xbc2d9e];return _0x2e315c;};'use strict';function ZohoAccount(_0x13aa76){this['id']=_0x13aa76['id']||0x0;this[_0x271b('0x0')]=_0x13aa76[_0x271b('0x0')]||'';this[_0x271b('0x1')]=_0x13aa76['description']||'';this[_0x271b('0x2')]=_0x13aa76['host']||'';this[_0x271b('0x3')]=_0x13aa76[_0x271b('0x3')]||'';this[_0x271b('0x4')]=_0x13aa76[_0x271b('0x4')]||'';this[_0x271b('0x5')]=_0x13aa76[_0x271b('0x5')]||'';this[_0x271b('0x6')]=_0x13aa76[_0x271b('0x6')]||'';this['code']=_0x13aa76[_0x271b('0x7')]||'';this[_0x271b('0x8')]=_0x13aa76[_0x271b('0x8')]||'';this[_0x271b('0x9')]=_0x13aa76[_0x271b('0x9')]||{};}module[_0x271b('0xa')]=ZohoAccount;
\ No newline at end of file
index a530f83..b82d513 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3de3=['Agent','channelAgent','format','SIP/%s','calleridname','Contact','firstName','lastName','active','calleridnum','phone','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','moment','isNil','string','uniqueid','idContact','name','type','queue','dialAnswer','membername'];(function(_0xb97a8c,_0x550935){var _0x4d53a9=function(_0xb769c2){while(--_0xb769c2){_0xb97a8c['push'](_0xb97a8c['shift']());}};_0x4d53a9(++_0x550935);}(_0x3de3,0x1ce));var _0x33de=function(_0x257edf,_0x8c6923){_0x257edf=_0x257edf-0x0;var _0x2c7ab8=_0x3de3[_0x257edf];return _0x2c7ab8;};'use strict';var util=require(_0x33de('0x0'));var _=require('lodash');var moment=require(_0x33de('0x1'));function checkNameSurname(_0x100783,_0x4dc03f,_0x328455){var _0x44644b='';if(!_[_0x33de('0x2')](_0x4dc03f)&&_0x33de('0x3')===typeof _0x4dc03f){_0x44644b+=_0x4dc03f;}if(!_['isNil'](_0x328455)&&_0x33de('0x3')===typeof _0x328455){_0x44644b+='\x20'+_0x328455;}if(_0x44644b!==''){return _0x44644b;}return _0x100783;}function Action(_0x9382cb,_0x558f98,_0x142716,_0x587be8,_0x13afea){this[_0x33de('0x4')]=_0x142716||undefined;this[_0x33de('0x5')]=_0x9382cb['id'];this['queue']=_0x558f98[_0x33de('0x6')];this[_0x33de('0x7')]=_0x558f98[_0x33de('0x7')];this['campaigntype']=_0x33de('0x8');this[_0x33de('0x9')]=![];this[_0x33de('0xa')]=_[_0x33de('0x2')](_0x9382cb[_0x33de('0xb')])?undefined:_0x9382cb[_0x33de('0xb')][_0x33de('0x6')];this[_0x33de('0xc')]=this[_0x33de('0xa')]?util[_0x33de('0xd')](_0x33de('0xe'),this['membername']):_0x587be8||undefined;this[_0x33de('0xf')]=checkNameSurname(_0x9382cb[_0x33de('0x10')]['phone'],_0x9382cb['Contact'][_0x33de('0x11')],_0x9382cb[_0x33de('0x10')][_0x33de('0x12')]);this[_0x33de('0x13')]=_0x9382cb['active']||![];this[_0x33de('0x14')]=_0x9382cb[_0x33de('0x15')];this['scheduledat']=_0x9382cb['scheduledat'];this[_0x33de('0x16')]=_0x9382cb[_0x33de('0x16')]||0x0;this[_0x33de('0x17')]=_0x9382cb['countcongestionretry']||0x0;this[_0x33de('0x18')]=_0x9382cb[_0x33de('0x18')]||0x0;this['countglobal']=(_0x9382cb[_0x33de('0x16')]||0x0)+(_0x9382cb[_0x33de('0x17')]||0x0)+(_0x9382cb['countnoanswerretry']||0x0)+(_0x9382cb['countnosuchnumberretry']||0x0)+(_0x9382cb[_0x33de('0x19')]||0x0)+(_0x9382cb['countabandonedretry']||0x0)+(_0x9382cb[_0x33de('0x1a')]||0x0)+(_0x9382cb[_0x33de('0x1b')]||0x0);this[_0x33de('0x1c')]=_0x9382cb[_0x33de('0x1c')]||0x0;this[_0x33de('0x19')]=_0x9382cb[_0x33de('0x19')]||0x0;this[_0x33de('0x1d')]=_0x9382cb['countabandonedretry']||0x0;this['countmachineretry']=_0x9382cb[_0x33de('0x1a')]||0x0;this['countagentrejectretry']=_0x9382cb[_0x33de('0x1b')]||0x0;this['callback']=_0x9382cb[_0x33de('0x1e')];this[_0x33de('0x1f')]=_0x9382cb['callbackuniqueid'];this[_0x33de('0x20')]=_0x9382cb['callbackat'];this[_0x33de('0x21')]=_0x9382cb['recallme'];this[_0x33de('0x22')]=_0x9382cb[_0x33de('0x22')];this[_0x33de('0x23')]=_0x9382cb['ListId'];this[_0x33de('0x24')]=_[_0x33de('0x2')](_0x9382cb[_0x33de('0xb')])?_0x9382cb['UserId']:_0x9382cb[_0x33de('0xb')]['id'];this['VoiceQueueId']=_0x9382cb['VoiceQueueId'];this[_0x33de('0x25')]='';this[_0x33de('0x26')]='';}Action[_0x33de('0x27')][_0x33de('0x28')]=function(){return util[_0x33de('0xd')](_0x33de('0x29'),this[_0x33de('0xf')],this[_0x33de('0x2a')]);};module['exports']=Action;
\ No newline at end of file
+var _0x5fdc=['number','util','lodash','moment','isNil','string','queue','name','type','dialAnswer','membername','Agent','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countnoanswerretry','countglobal','countbusyretry','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','format','\x22%s\x22\x20<%s>'];(function(_0x32522a,_0x392ce6){var _0x18e502=function(_0x1b604b){while(--_0x1b604b){_0x32522a['push'](_0x32522a['shift']());}};_0x18e502(++_0x392ce6);}(_0x5fdc,0x127));var _0xc5fd=function(_0x21b103,_0x41be28){_0x21b103=_0x21b103-0x0;var _0x2b991e=_0x5fdc[_0x21b103];return _0x2b991e;};'use strict';var util=require(_0xc5fd('0x0'));var _=require(_0xc5fd('0x1'));var moment=require(_0xc5fd('0x2'));function checkNameSurname(_0x1d01cf,_0x36e895,_0x341db9){var _0x3be451='';if(!_[_0xc5fd('0x3')](_0x36e895)&&_0xc5fd('0x4')===typeof _0x36e895){_0x3be451+=_0x36e895;}if(!_[_0xc5fd('0x3')](_0x341db9)&&_0xc5fd('0x4')===typeof _0x341db9){_0x3be451+='\x20'+_0x341db9;}if(_0x3be451!==''){return _0x3be451;}return _0x1d01cf;}function Action(_0xea5748,_0x44722b,_0x216902,_0x15ffe7,_0x5a2eb4){this['uniqueid']=_0x216902||undefined;this['idContact']=_0xea5748['id'];this[_0xc5fd('0x5')]=_0x44722b[_0xc5fd('0x6')];this[_0xc5fd('0x7')]=_0x44722b[_0xc5fd('0x7')];this['campaigntype']='queue';this[_0xc5fd('0x8')]=![];this[_0xc5fd('0x9')]=_[_0xc5fd('0x3')](_0xea5748[_0xc5fd('0xa')])?undefined:_0xea5748[_0xc5fd('0xa')][_0xc5fd('0x6')];this['channelAgent']=this[_0xc5fd('0x9')]?util['format']('SIP/%s',this[_0xc5fd('0x9')]):_0x15ffe7||undefined;this[_0xc5fd('0xb')]=checkNameSurname(_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xd')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xe')],_0xea5748[_0xc5fd('0xc')][_0xc5fd('0xf')]);this['active']=_0xea5748[_0xc5fd('0x10')]||![];this[_0xc5fd('0x11')]=_0xea5748[_0xc5fd('0xd')];this[_0xc5fd('0x12')]=_0xea5748['scheduledat'];this['countbusyretry']=_0xea5748['countbusyretry']||0x0;this['countcongestionretry']=_0xea5748['countcongestionretry']||0x0;this[_0xc5fd('0x13')]=_0xea5748[_0xc5fd('0x13')]||0x0;this[_0xc5fd('0x14')]=(_0xea5748[_0xc5fd('0x15')]||0x0)+(_0xea5748[_0xc5fd('0x16')]||0x0)+(_0xea5748[_0xc5fd('0x13')]||0x0)+(_0xea5748[_0xc5fd('0x17')]||0x0)+(_0xea5748['countdropretry']||0x0)+(_0xea5748[_0xc5fd('0x18')]||0x0)+(_0xea5748[_0xc5fd('0x19')]||0x0)+(_0xea5748[_0xc5fd('0x1a')]||0x0);this[_0xc5fd('0x17')]=_0xea5748[_0xc5fd('0x17')]||0x0;this['countdropretry']=_0xea5748[_0xc5fd('0x1b')]||0x0;this[_0xc5fd('0x18')]=_0xea5748[_0xc5fd('0x18')]||0x0;this[_0xc5fd('0x19')]=_0xea5748['countmachineretry']||0x0;this['countagentrejectretry']=_0xea5748[_0xc5fd('0x1a')]||0x0;this[_0xc5fd('0x1c')]=_0xea5748[_0xc5fd('0x1c')];this[_0xc5fd('0x1d')]=_0xea5748[_0xc5fd('0x1d')];this[_0xc5fd('0x1e')]=_0xea5748['callbackat'];this[_0xc5fd('0x1f')]=_0xea5748[_0xc5fd('0x1f')];this[_0xc5fd('0x20')]=_0xea5748[_0xc5fd('0x20')];this[_0xc5fd('0x21')]=_0xea5748[_0xc5fd('0x21')];this[_0xc5fd('0x22')]=_['isNil'](_0xea5748[_0xc5fd('0xa')])?_0xea5748['UserId']:_0xea5748[_0xc5fd('0xa')]['id'];this[_0xc5fd('0x23')]=_0xea5748[_0xc5fd('0x23')];this[_0xc5fd('0x24')]='';this['originatecalleridname']='';}Action[_0xc5fd('0x25')][_0xc5fd('0x26')]=function(){return util[_0xc5fd('0x27')](_0xc5fd('0x28'),this[_0xc5fd('0xb')],this[_0xc5fd('0x29')]);};module['exports']=Action;
\ No newline at end of file
index 647f082..f8d574f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b6e=['Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unlock','unlockContact','execRun','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialCutDigit','substring','SIP/%s/%s%s','dialRandomLastDigitCallerIdNumber','getCallerId','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','variables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','transfer','[syncHangup][talking][cause]','syncDialEnd','destlinkedid','destuniqueid','addVariable','filterKey','keys','variable','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','moment','md5','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','campaignsPreview','emit','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','DEACTIVATED','loopCampaigns','syncCampaigns','hasOwnProperty','outbound','clearZombieChannels','type','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\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]','[action]','size','getContactRecallMe','agentReadyId','getDiff','scheduledat','dialRecallMeTimeout','Agent','run','then','logger2','[RecallMe]','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','activeContact','linkedid','actioncountonusuch','idContact','incrementPreviewCounters','ANSWER','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','acw','buildAcw','complete','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','swapAdditionalPhones','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','unlockAgent','CONGESTION','Congestion','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','countcongestionretry','dialCongestionMaxRetry','CANCEL','dialAgentRejectRetryFrequency','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','resolve','[verifyAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack'];(function(_0x22cb1b,_0x3cd6ac){var _0x999132=function(_0x593cde){while(--_0x593cde){_0x22cb1b['push'](_0x22cb1b['shift']());}};_0x999132(++_0x3cd6ac);}(_0x1b6e,0x1a7));var _0xe1b6=function(_0x25cbde,_0xc31026){_0x25cbde=_0x25cbde-0x0;var _0x4cd79b=_0x1b6e[_0x25cbde];return _0x4cd79b;};'use strict';var util=require(_0xe1b6('0x0'));var _=require(_0xe1b6('0x1'));var uuid=require('uuid');var moment=require(_0xe1b6('0x2'));var md5=require(_0xe1b6('0x3'));var Redis=require('ioredis');var config=require(_0xe1b6('0x4'));var logger=require(_0xe1b6('0x5'))(_0xe1b6('0x6'));var loggerAction=require(_0xe1b6('0x5'))('actionPreview');var ami=require(_0xe1b6('0x7'));var rpcDb=require(_0xe1b6('0x8'));var cmHopperAdditionalPhone=require(_0xe1b6('0x9'));var Action=require(_0xe1b6('0xa'));var ut=require(_0xe1b6('0xb'));config[_0xe1b6('0xc')]=_[_0xe1b6('0xd')](config[_0xe1b6('0xc')],{'host':_0xe1b6('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe1b6('0xc')]));var Sequence=function(){};Sequence[_0xe1b6('0xf')][_0xe1b6('0x10')]=function(_0x3dbf5b){this[_0xe1b6('0x11')]=this[_0xe1b6('0x11')]?this['tail']['finally'](_0x3dbf5b):_0x3dbf5b();};function Preview(_0x48a160){this[_0xe1b6('0x12')]=new Sequence();this['campaignsPreview']=_0x48a160[_0xe1b6('0x13')];this['trunks']=_0x48a160[_0xe1b6('0x14')];this[_0xe1b6('0x15')]={};this[_0xe1b6('0x16')]=_0x48a160[_0xe1b6('0x16')];this[_0xe1b6('0x17')]=0x0;ami['on'](_0xe1b6('0x18'),this[_0xe1b6('0x19')][_0xe1b6('0x1a')](this));ami['on'](_0xe1b6('0x1b'),this[_0xe1b6('0x1c')][_0xe1b6('0x1a')](this));ami['on'](_0xe1b6('0x1d'),this[_0xe1b6('0x1e')][_0xe1b6('0x1a')](this));ami['on'](_0xe1b6('0x1f'),this['syncDialEnd']['bind'](this));ami['on'](_0xe1b6('0x20'),this[_0xe1b6('0x21')]['bind'](this));ami['on'](_0xe1b6('0x22'),this[_0xe1b6('0x23')]['bind'](this));ami['on'](_0xe1b6('0x24'),this[_0xe1b6('0x25')][_0xe1b6('0x1a')](this));ami['on'](_0xe1b6('0x26'),this[_0xe1b6('0x27')][_0xe1b6('0x1a')](this));this['loopCampaigns'](this[_0xe1b6('0x28')]);}function emit(_0x4943b6,_0xb4de11,_0x1fcee6){io['to'](_0x4943b6)[_0xe1b6('0x29')](_0xb4de11,_0x1fcee6);}function emitCampaignPreview(_0x1fe844){if(_0x1fe844['type']==='outbound'){var _0x894916={'id':_0x1fe844['id'],'name':_0x1fe844[_0xe1b6('0x2a')],'strategy':_0x1fe844[_0xe1b6('0x2b')],'answered':_0x1fe844[_0xe1b6('0x2c')],'available':_0x1fe844[_0xe1b6('0x2d')],'loggedIn':_0x1fe844[_0xe1b6('0x2e')],'pTalking':_0x1fe844[_0xe1b6('0x2f')],'sumBillable':_0x1fe844[_0xe1b6('0x30')],'sumDuration':_0x1fe844[_0xe1b6('0x31')],'sumHoldTime':_0x1fe844[_0xe1b6('0x32')]||0x0,'talking':_0x1fe844[_0xe1b6('0x33')],'total':_0x1fe844[_0xe1b6('0x34')],'type':_0x1fe844['type'],'unmanaged':_0x1fe844['unmanaged'],'abandoned':_0x1fe844['abandoned'],'waiting':_0x1fe844['waiting'],'loggedInDb':_0x1fe844['loggedInDb'],'dialActive':_0x1fe844[_0xe1b6('0x35')],'dialMethod':_0x1fe844[_0xe1b6('0x36')],'dialOriginateCallerIdName':_0x1fe844[_0xe1b6('0x37')],'dialOriginateCallerIdNumber':_0x1fe844[_0xe1b6('0x38')],'dialOriginateTimeout':_0x1fe844['dialOriginateTimeout'],'dialPrefix':_0x1fe844[_0xe1b6('0x39')],'outboundAnswerAgiCallsDay':_0x1fe844[_0xe1b6('0x3a')],'outboundAnswerCallsDay':_0x1fe844[_0xe1b6('0x3b')],'outboundBlacklistCallsDay':_0x1fe844[_0xe1b6('0x3c')],'outboundBusyCallsDay':_0x1fe844['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x1fe844[_0xe1b6('0x3d')],'outboundDropCallsDayACS':_0x1fe844['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x1fe844['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1fe844[_0xe1b6('0x3e')],'outboundNoAnswerCallsDay':_0x1fe844['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1fe844[_0xe1b6('0x3f')],'outboundOriginateFailureCallsDay':_0x1fe844[_0xe1b6('0x40')],'outboundReCallsDay':_0x1fe844[_0xe1b6('0x41')],'outboundRejectCallsDay':_0x1fe844[_0xe1b6('0x42')],'outboundUnknownCallsDay':_0x1fe844['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x1fe844['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x1fe844[_0xe1b6('0x43')],'predictiveIntervalAvgHoldtime':_0x1fe844[_0xe1b6('0x44')],'predictiveIntervalAvgTalktime':_0x1fe844['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1fe844[_0xe1b6('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x1fe844[_0xe1b6('0x46')],'predictiveIntervalErlangCalls':_0x1fe844[_0xe1b6('0x47')],'predictiveIntervalErlangCallsDroppedCalls':_0x1fe844[_0xe1b6('0x48')],'predictiveIntervalHitRate':_0x1fe844[_0xe1b6('0x49')],'predictiveIntervalMultiplicativeFactor':_0x1fe844[_0xe1b6('0x4a')],'predictiveIntervalPauses':_0x1fe844['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1fe844[_0xe1b6('0x4b')],'predictiveIntervalTotalCalls':_0x1fe844[_0xe1b6('0x4c')],'message':_0x1fe844['message'],'originated':_0x1fe844['originated'],'erlangCalls':_0x1fe844[_0xe1b6('0x4d')],'erlangCallToSecond':_0x1fe844[_0xe1b6('0x4e')],'erlangAbandonmentRate':_0x1fe844[_0xe1b6('0x4f')],'erlangBusyFactor':_0x1fe844[_0xe1b6('0x50')],'startPredictive':_0x1fe844['startPredictive'],'startProgressive':_0x1fe844[_0xe1b6('0x51')]};if(_0x1fe844[_0xe1b6('0x52')]){_0x894916[_0xe1b6('0x52')]={'id':_0x1fe844[_0xe1b6('0x52')]['id'],'name':_0x1fe844[_0xe1b6('0x52')][_0xe1b6('0x2a')],'active':_0x1fe844['Trunk'][_0xe1b6('0x53')],'callerid':_0x1fe844[_0xe1b6('0x52')]['callerid']};}if(_0x1fe844[_0xe1b6('0x54')]){_0x894916['Interval']={'id':_0x1fe844[_0xe1b6('0x54')]['id'],'name':_0x1fe844[_0xe1b6('0x54')]['name']};}var _0x241008=md5(JSON['stringify'](_0x894916));if(_0x1fe844['md5']!==_0x241008){_0x1fe844['md5']=_0x241008;emit(util[_0xe1b6('0x55')](_0xe1b6('0x56'),_0x894916[_0xe1b6('0x2a')]),_0xe1b6('0x57'),_0x894916);}}}function emitVoiceQueueChannelRemove(_0x31b8b6){logger[_0xe1b6('0x58')](_0xe1b6('0x59'),JSON[_0xe1b6('0x5a')](_0x31b8b6));emit(util[_0xe1b6('0x55')]('voice:queue:%s',_0x31b8b6[_0xe1b6('0x2a')]),_0xe1b6('0x5b'),_0x31b8b6);io[_0xe1b6('0x29')](_0xe1b6('0x5c'),_0x31b8b6);}function notSendMessagesQueue(_0x236684){if(_0x236684['sendMessageOneNotActive']){if(_0x236684['originated']===0x0&&_0x236684[_0xe1b6('0x2f')]===0x0){_0x236684[_0xe1b6('0x5d')]=![];_0x236684[_0xe1b6('0x2d')]=0x0;_0x236684[_0xe1b6('0x5e')]=0x0;_0x236684[_0xe1b6('0x5f')]=_0xe1b6('0x60');ut[_0xe1b6('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x236684[_0xe1b6('0x2a')]+'\x20is\x20not\x20active');}else{_0x236684[_0xe1b6('0x5f')]=_0xe1b6('0x62');ut[_0xe1b6('0x61')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x236684[_0xe1b6('0x2a')]+'\x20is\x20deactivated');}emitCampaignPreview(_0x236684);}}Preview['prototype'][_0xe1b6('0x63')]=function(){var _0x21054a=this;setInterval(function(){_0x21054a[_0xe1b6('0x64')]();},0x7cf);};Preview[_0xe1b6('0xf')][_0xe1b6('0x64')]=function(){var _0x5600c0=this[_0xe1b6('0x28')];this[_0xe1b6('0x17')]+=0x1;for(var _0x23068b in _0x5600c0){if(_0x5600c0[_0xe1b6('0x65')](_0x23068b)&&(_0x5600c0[_0x23068b][_0xe1b6('0x36')]===_0xe1b6('0x6')||_0x5600c0[_0x23068b][_0xe1b6('0x36')]==='booked')&&_0x5600c0[_0x23068b]['type']===_0xe1b6('0x66')){if(this[_0xe1b6('0x17')]>0x7){this[_0xe1b6('0x17')]=0x0;this[_0xe1b6('0x67')]();}}if(_0x5600c0[_0xe1b6('0x65')](_0x23068b)&&_0x5600c0[_0x23068b][_0xe1b6('0x36')]==='preview'&&_0x5600c0[_0x23068b][_0xe1b6('0x68')]==='outbound'){if(_0x5600c0[_0x23068b][_0xe1b6('0x35')]){this[_0xe1b6('0x69')](_0x5600c0[_0x23068b]);if(_0x5600c0[_0x23068b][_0xe1b6('0x6a')])this[_0xe1b6('0x6b')](_0x5600c0[_0x23068b]);}else{notSendMessagesQueue(_0x5600c0[_0x23068b]);}}}};Preview[_0xe1b6('0xf')][_0xe1b6('0x6c')]=function(_0x43dc9f){var _0x45aceb=this;this[_0xe1b6('0x12')][_0xe1b6('0x10')](function(){if(!_[_0xe1b6('0x6d')](_0x45aceb[_0xe1b6('0x15')][_0x43dc9f])){loggerAction[_0xe1b6('0x58')](_0xe1b6('0x6e'),_0x43dc9f,_0xe1b6('0x6f'),_0x45aceb['actions'][_0x43dc9f][_0xe1b6('0x70')],_0xe1b6('0x71'),JSON['stringify'](_0x45aceb['campaignsPreview'][_0x45aceb[_0xe1b6('0x15')][_0x43dc9f][_0xe1b6('0x70')]][_0xe1b6('0x72')]),_0xe1b6('0x73'),JSON[_0xe1b6('0x5a')](_0x45aceb[_0xe1b6('0x28')][_0x45aceb[_0xe1b6('0x15')][_0x43dc9f][_0xe1b6('0x70')]][_0xe1b6('0x2f')]),JSON[_0xe1b6('0x5a')](_0x45aceb['actions'][_0x43dc9f]['dialAnswer']),JSON[_0xe1b6('0x5a')](_[_0xe1b6('0x74')](_0x45aceb[_0xe1b6('0x15')][_0x43dc9f],[_0xe1b6('0x75'),_0xe1b6('0x76'),_0xe1b6('0x77'),_0xe1b6('0x78')])));return ami[_0xe1b6('0x79')]({'action':_0xe1b6('0x7a'),'channel':_0x45aceb[_0xe1b6('0x15')][_0x43dc9f][_0xe1b6('0x7b')]})[_0xe1b6('0x7c')](function(_0x427a48){if(_0x427a48[_0xe1b6('0x5f')]===_0xe1b6('0x7d')){setTimeout(function(){if(_0x45aceb[_0xe1b6('0x15')][_0x43dc9f]){ut[_0xe1b6('0x7e')](_0x45aceb[_0xe1b6('0x28')][_0x45aceb[_0xe1b6('0x15')][_0x43dc9f]['queue']],_0xe1b6('0x7f'));if(_0x45aceb[_0xe1b6('0x15')][_0x43dc9f][_0xe1b6('0x80')]===!![]){ut[_0xe1b6('0x81')](_0x45aceb[_0xe1b6('0x28')][_0x45aceb['actions'][_0x43dc9f]['queue']],_0xe1b6('0x7f'));ut[_0xe1b6('0x82')](_0xe1b6('0x83')+_0x43dc9f,_0x45aceb[_0xe1b6('0x15')][_0x43dc9f][_0xe1b6('0x70')]);}ut[_0xe1b6('0x82')](_0xe1b6('0x84')+_0x43dc9f,_0x45aceb[_0xe1b6('0x15')][_0x43dc9f]['queue']);delete _0x45aceb['actions'][_0x43dc9f];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0xd597e1=this;loggerAction[_0xe1b6('0x58')](_0xe1b6('0x85'),_[_0xe1b6('0x86')](this['actions']));for(var _0x11fd28 in this[_0xe1b6('0x15')]){if(_0xd597e1[_0xe1b6('0x15')]['hasOwnProperty'](_0x11fd28)){_0xd597e1[_0xe1b6('0x6c')](_0x11fd28);}}};Preview[_0xe1b6('0xf')][_0xe1b6('0x6b')]=function(_0xdf10ff){var _0x10fdec=this;rpcDb[_0xe1b6('0x87')](_0xdf10ff['id'],ut[_0xe1b6('0x88')](this[_0xe1b6('0x16')]))['then'](function(_0x109522){if(!_[_0xe1b6('0x6d')](_0x109522)){for(var _0x5c707d=0x0;_0x5c707d<_0x109522['length'];_0x5c707d+=0x1){if(ut[_0xe1b6('0x89')](_0x109522[_0x5c707d][_0xe1b6('0x8a')])<_0xdf10ff[_0xe1b6('0x8b')]*0x3c){if(_0x109522[_0x5c707d][_0xe1b6('0x8c')]&&!_0x109522[_0x5c707d][_0xe1b6('0x8c')]['voicePause']){_0x10fdec[_0xe1b6('0x8d')](_0x109522[_0x5c707d]['id'])[_0xe1b6('0x8e')](ut[_0xe1b6('0x8f')]('[RecallMe]'))[_0xe1b6('0x7c')](ut[_0xe1b6('0x8f')](_0xe1b6('0x90')));}else{rpcDb[_0xe1b6('0x91')](_0x109522[_0x5c707d]['id']);}}else{var _0xae8918=new Action(_0x109522[_0x5c707d],_0xdf10ff);_0xae8918['starttime']=moment()['format'](_0xe1b6('0x92'));_0xdf10ff[_0xe1b6('0x41')]+=0x1;ut[_0xe1b6('0x93')](_0xae8918,0x17,_0xe1b6('0x94'));if(_0xdf10ff['dialRecallInQueue']){rpcDb[_0xe1b6('0x95')](ut['createBody'](_0x109522[_0x5c707d]));rpcDb[_0xe1b6('0x96')](_0xae8918,_0xe1b6('0x97'));}else{ut['logCustomer'](_0xae8918,0x16,_0xe1b6('0x98'));rpcDb[_0xe1b6('0x96')](_0xae8918,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0xae8918,'[HistoryRecallClose]');}}}}})['catch'](ut['logger2']('[getContactRecallMe]'));};Preview[_0xe1b6('0xf')][_0xe1b6('0x69')]=function(_0x146df9){_0x146df9[_0xe1b6('0x5d')]=!![];if(ut[_0xe1b6('0x99')](_0x146df9[_0xe1b6('0x2e')])){_0x146df9[_0xe1b6('0x5f')]=_0xe1b6('0x9a');}else if(!ut[_0xe1b6('0x9b')](_0x146df9['dialActive'])){_0x146df9[_0xe1b6('0x5f')]=_0xe1b6('0x60');}else if(!this[_0xe1b6('0x9c')](_0x146df9['Trunk'])){if(!this[_0xe1b6('0x9c')](_0x146df9[_0xe1b6('0x9d')])){_0x146df9['message']='TRUNK_IS_NOT_REACHABLE';}else{_0x146df9[_0xe1b6('0x5f')]=_0xe1b6('0x9e');}}else{_0x146df9[_0xe1b6('0x5f')]=_0xe1b6('0x9e');}emitCampaignPreview(_0x146df9);};Preview[_0xe1b6('0xf')][_0xe1b6('0x9f')]=function(_0x15d809,_0x4f3bc8,_0x3d222b){var _0x3ca2c1=this;var _0x3193b5=this[_0xe1b6('0x15')][_0x4f3bc8];var _0x53c31f=this[_0xe1b6('0x28')][_0x3193b5['queue']];var _0xd8e5bf;var _0x219450=![];var _0x1c1e97=0x2;var _0x1d5335=0x3;if(_0x53c31f){switch(_0x3d222b){case'1':_0x53c31f[_0xe1b6('0x3f')]+=0x1;_0x3193b5[_0xe1b6('0xa0')]+=0x1;_0x3193b5['countglobal']=ut[_0xe1b6('0xa1')](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x0,_0xe1b6('0xa2'));ami['emit'](_0xe1b6('0xa3'),ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xa5')));rpcDb[_0xe1b6('0x96')](_0x3193b5,'[callProgressDetectingCustomer][logNoSuch]');_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'0',_0x53c31f)[_0xe1b6('0x8e')](function(_0x388247){_0x219450=_0x388247[_0xe1b6('0xa7')]==0x1;_0x1c1e97=_0x53c31f['dialNoSuchNumberRetryFrequency'];_0x1d5335=_0x53c31f[_0xe1b6('0xa8')];if(!_0x219450){if(ut['totalGlobal'](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut['cloneAction'](_0x3193b5,0xf,_0xe1b6('0xaa'));rpcDb[_0xe1b6('0xab')](_0xd8e5bf,_0xe1b6('0xac'));}else{if(_0x3193b5[_0xe1b6('0xa0')]>=_0x53c31f[_0xe1b6('0xad')]){rpcDb[_0xe1b6('0xab')](_0x3193b5,_0xe1b6('0xac'));}else{rpcDb[_0xe1b6('0xae')](ut[_0xe1b6('0xaf')](_0x3193b5,_0xe1b6('0xa0'),_0x53c31f[_0xe1b6('0xb0')]),_0x3193b5['unlockAgent'],_0x3193b5[_0xe1b6('0xb1')]);}}delete this['actions'][_0x15d809[_0xe1b6('0xb2')]];}else{_0x3193b5['countnosuchnumberretry']++;logger[_0xe1b6('0x58')](_0xe1b6('0xb3'),_0x3193b5[_0xe1b6('0xa0')]);logger['info']('id',_0x3193b5[_0xe1b6('0xb4')]);_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnosuchnumberretry':_0x3193b5[_0xe1b6('0xa0')]}})[_0xe1b6('0x8e')](function(){_0x3ca2c1['swapAdditionalPhones'](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case _0xe1b6('0xb6'):var _0x4a0b1d=moment()[_0xe1b6('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x3193b5['responsetime']=_0x4a0b1d;_0x3193b5['answertime']=_0x4a0b1d;_0x3193b5[_0xe1b6('0x80')]=!![];_0x53c31f[_0xe1b6('0x2f')]+=0x1;logger[_0xe1b6('0x58')](_0xe1b6('0xb7'),_0x3193b5[_0xe1b6('0xb8')],_0xe1b6('0xb9'),_0x53c31f['name'],_0xe1b6('0x73'),_0x53c31f['pTalking']);ami[_0xe1b6('0x29')](_0xe1b6('0xba'),ut[_0xe1b6('0xa4')](_0x3193b5,'connect',this[_0xe1b6('0x28')][_0x3193b5[_0xe1b6('0x70')]]));if(_0x53c31f[_0xe1b6('0xbb')]){ami[_0xe1b6('0x29')]('custom:agentConnectPreview',ut[_0xe1b6('0xbc')](_0x3193b5));}break;case'16':ami[_0xe1b6('0x29')]('custom:agentcomplete',ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xbd'),this['campaignsPreview'][_0x3193b5[_0xe1b6('0x70')]]));emitVoiceQueueChannelRemove(ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xbd')));_0x53c31f['outboundAnswerCallsDay']+=0x1;_0x53c31f[_0xe1b6('0x34')]+=0x1;_0x53c31f['answered']+=0x1;ut[_0xe1b6('0x81')](_0x53c31f,_0xe1b6('0xbe'));_0x3193b5[_0xe1b6('0xbf')]=ut['totalGlobal'](_0x3193b5);ut['logCustomer'](_0x3193b5,0x4,_0xe1b6('0xc0'));rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xc1'));rpcDb['createCustomerFinal'](_0x3193b5,_0xe1b6('0xc2'));rpcDb['crateCustomerReportQueue'](_0x3193b5);_0x53c31f['sumDuration']+=_0x3193b5[_0xe1b6('0xc3')];_0x53c31f['sumBillable']+=_0x3193b5[_0xe1b6('0xc3')];logger['info']('[syncHangup][talking][decrement]',_0x3193b5['uniqueid'],_0xe1b6('0xb9'),_0x53c31f[_0xe1b6('0x2a')],_0xe1b6('0x73'),_0x53c31f[_0xe1b6('0x2f')]);delete this['actions'][_0x15d809[_0xe1b6('0xb2')]];break;case _0xe1b6('0xc4'):_0x53c31f['outboundBusyCallsDay']+=0x1;_0x3193b5[_0xe1b6('0xc5')]+=0x1;_0x3193b5['countglobal']=ut['totalGlobal'](_0x3193b5);ut['logCustomer'](_0x3193b5,0x5,_0xe1b6('0xc6'));_0x1c1e97=_0x53c31f[_0xe1b6('0xc7')];_0x1d5335=_0x53c31f['callAdditionalPhoneAfterMin'];ami[_0xe1b6('0x29')](_0xe1b6('0xc8'),ut[_0xe1b6('0xa4')](_0x3193b5,'busy'));rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xc9'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'5',_0x53c31f)[_0xe1b6('0x8e')](function(_0x1cd70a){_0x219450=_0x1cd70a[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut[_0xe1b6('0xa1')](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut['cloneAction'](_0x3193b5,0xf,'Global');rpcDb[_0xe1b6('0xab')](_0xd8e5bf,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3193b5[_0xe1b6('0xc5')]>=_0x53c31f[_0xe1b6('0xca')]){rpcDb['createCustomerFinal'](_0x3193b5,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xe1b6('0xae')](ut[_0xe1b6('0xaf')](_0x3193b5,'countbusyretry',_0x53c31f[_0xe1b6('0xc7')]),_0x3193b5['unlockAgent'],_0x3193b5[_0xe1b6('0xb1')]);}}}else{_0x3193b5[_0xe1b6('0xc5')]++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countbusyretry':_0x3193b5[_0xe1b6('0xc5')]}})[_0xe1b6('0x8e')](function(){_0x3ca2c1[_0xe1b6('0xcb')](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case _0xe1b6('0xcc'):_0x53c31f[_0xe1b6('0xcd')]+=0x1;_0x3193b5[_0xe1b6('0xce')]+=0x1;_0x3193b5['countglobal']=ut['totalGlobal'](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x3,_0xe1b6('0xcf'));_0x1c1e97=_0x53c31f[_0xe1b6('0xd0')];_0x1d5335=_0x53c31f['callAdditionalPhoneAfterMin'];var _0x753491=ut[_0xe1b6('0xd1')](_0x3193b5,_0x53c31f);ami[_0xe1b6('0x29')](_0xe1b6('0xd2'),_0x753491);rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xd3'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'3',_0x53c31f)[_0xe1b6('0x8e')](function(_0x5ecd80){_0x219450=_0x5ecd80[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut[_0xe1b6('0xa1')](_0x3193b5)>=_0x53c31f['dialGlobalMaxRetry']){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0xf,_0xe1b6('0xaa'));rpcDb[_0xe1b6('0xab')](_0xd8e5bf,_0xe1b6('0xd5'));}else{if(_0x3193b5['countnoanswerretry']>=_0x53c31f[_0xe1b6('0xd6')]){rpcDb[_0xe1b6('0xab')](_0x3193b5,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xe1b6('0xae')](ut[_0xe1b6('0xaf')](_0x3193b5,'countnoanswerretry',_0x53c31f[_0xe1b6('0xd0')]),_0x3193b5[_0xe1b6('0xd7')],_0x3193b5[_0xe1b6('0xb1')]);}}}else{_0x3193b5[_0xe1b6('0xce')]++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnoanswerretry':_0x3193b5[_0xe1b6('0xce')]}})[_0xe1b6('0x8e')](function(){_0x3ca2c1[_0xe1b6('0xcb')](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case _0xe1b6('0xd8'):_0x53c31f[_0xe1b6('0x3d')]+=0x1;_0x3193b5['countcongestionretry']+=0x1;_0x3193b5[_0xe1b6('0xbf')]=ut[_0xe1b6('0xa1')](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x8,_0xe1b6('0xd9'));_0x1c1e97=_0x53c31f[_0xe1b6('0xda')];_0x1d5335=_0x53c31f['callAdditionalPhoneAfterMin'];ami['emit'](_0xe1b6('0xdb'),ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xdc')));rpcDb['createCustomerHistory'](_0x3193b5,_0xe1b6('0xdd'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'8',_0x53c31f)[_0xe1b6('0x8e')](function(_0x2d2178){_0x219450=_0x2d2178[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut[_0xe1b6('0xa1')](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0xf,'Global');rpcDb['createCustomerFinal'](_0xd8e5bf,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x3193b5[_0xe1b6('0xde')]>=_0x53c31f[_0xe1b6('0xdf')]){rpcDb[_0xe1b6('0xab')](_0x3193b5,_0xe1b6('0xdd'));}else{rpcDb[_0xe1b6('0xae')](ut[_0xe1b6('0xaf')](_0x3193b5,_0xe1b6('0xde'),_0x53c31f['dialBusyRetryFrequency']),_0x3193b5[_0xe1b6('0xd7')],_0x3193b5[_0xe1b6('0xb1')]);}}}else{_0x3193b5['countcongestionretry']++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countcongestionretry':_0x3193b5['countcongestionretry']}})['then'](function(){_0x3ca2c1[_0xe1b6('0xcb')](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case _0xe1b6('0xe0'):_0x53c31f[_0xe1b6('0x42')]+=0x1;_0x3193b5['countagentrejectretry']+=0x1;_0x3193b5['countglobal']=ut['totalGlobal'](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x14,'AgentReject');_0x1c1e97=_0x53c31f[_0xe1b6('0xe1')];_0x1d5335=_0x53c31f['callAdditionalPhoneAfterMin'];ami[_0xe1b6('0x29')]('custom:agentreject',ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xe2')));rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xe3'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'20',_0x53c31f)[_0xe1b6('0x8e')](function(_0x5eb396){_0x219450=_0x5eb396['additional']==0x1;if(!_0x219450){if(ut['totalGlobal'](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0x14,_0xe1b6('0xe4'));rpcDb[_0xe1b6('0xab')](_0xd8e5bf,_0xe1b6('0xe5'));}else{if(_0x3193b5[_0xe1b6('0xe6')]>=_0x53c31f[_0xe1b6('0xe7')]){rpcDb['createCustomerFinal'](_0x3193b5,_0xe1b6('0xe5'));}else{rpcDb[_0xe1b6('0xae')](ut['scheduledAt'](_0x3193b5,_0xe1b6('0xe6'),_0x53c31f['dialAgentRejectRetryFrequency']),_0x3193b5[_0xe1b6('0xd7')],_0x3193b5[_0xe1b6('0xb1')]);}}}else{_0x3193b5[_0xe1b6('0xce')]++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnoanswerretry':_0x3193b5[_0xe1b6('0xce')]}})[_0xe1b6('0x8e')](function(){_0x3ca2c1['swapAdditionalPhones'](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case'ABANDONED':_0x53c31f[_0xe1b6('0xe8')]+=0x1;_0x3193b5[_0xe1b6('0xe9')]+=0x1;_0x3193b5[_0xe1b6('0xbf')]=ut[_0xe1b6('0xa1')](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0xb,_0xe1b6('0xea'));rpcDb[_0xe1b6('0x96')](_0x3193b5,'[callProgressDetectingCustomer][logAbandoned]');_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'11',_0x53c31f)[_0xe1b6('0x8e')](function(_0x2478be){_0x219450=_0x2478be[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut[_0xe1b6('0xa1')](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0xf,'Global');rpcDb[_0xe1b6('0xab')](_0xd8e5bf,_0xe1b6('0xeb'));}else{if(_0x3193b5[_0xe1b6('0xec')]>=_0x53c31f['dialAbandonedMaxRety']){rpcDb[_0xe1b6('0xab')](_0x3193b5,_0xe1b6('0xeb'));}else{rpcDb[_0xe1b6('0xae')](ut[_0xe1b6('0xaf')](_0x3193b5,_0xe1b6('0xe9'),_0x53c31f[_0xe1b6('0xed')]),_0x3193b5[_0xe1b6('0xd7')],_0x3193b5['activeContact']);}}}else{_0x3193b5[_0xe1b6('0xce')]++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnoanswerretry':_0x3193b5[_0xe1b6('0xce')]}})['then'](function(){_0x3ca2c1['swapAdditionalPhones'](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});break;case'18':_0x53c31f[_0xe1b6('0xee')]+=0x1;_0x3193b5[_0xe1b6('0xef')]+=0x1;_0x3193b5[_0xe1b6('0xbf')]=ut[_0xe1b6('0xa1')](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x12,_0x15d809[_0xe1b6('0xf0')]||_0x15d809[_0xe1b6('0xf1')]);ami[_0xe1b6('0x29')](_0xe1b6('0xf2'),ut['buildObj'](_0x3193b5,_0xe1b6('0xf3')));rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xf4'));_0x3ca2c1['verifyAdditionalPhones'](_0x3193b5,'18',_0x53c31f)[_0xe1b6('0x8e')](function(_0x2590de){_0x219450=_0x2590de[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut['totalGlobal'](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0x12,_0xe1b6('0xaa'));rpcDb['createCustomerFinal'](_0xd8e5bf,_0xe1b6('0xf4'));}else{rpcDb[_0xe1b6('0xab')](_0x3193b5,_0xe1b6('0xf4'));}}else{_0x3193b5['countnoanswerretry']++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnoanswerretry':_0x3193b5[_0xe1b6('0xce')]}})['then'](function(){_0x3ca2c1['swapAdditionalPhones'](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});delete this[_0xe1b6('0x15')][_0x15d809[_0xe1b6('0xb2')]];break;case'19':_0x53c31f[_0xe1b6('0xee')]+=0x1;_0x3193b5[_0xe1b6('0xbf')]=ut['totalGlobal'](_0x3193b5);ut[_0xe1b6('0x93')](_0x3193b5,0x13,_0x15d809['cause-txt']||_0x15d809[_0xe1b6('0xf1')]);ami[_0xe1b6('0x29')](_0xe1b6('0xf2'),ut[_0xe1b6('0xa4')](_0x3193b5,_0xe1b6('0xf3')));rpcDb[_0xe1b6('0x96')](_0x3193b5,_0xe1b6('0xf5'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'18',_0x53c31f)['then'](function(_0x29f466){_0x219450=_0x29f466['additional']==0x1;if(!_0x219450){if(ut['totalGlobal'](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0xf,_0xe1b6('0xaa'));rpcDb[_0xe1b6('0xab')](_0xd8e5bf,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x3193b5,_0xe1b6('0xf5'));}}else{_0x3193b5['countnoanswerretry']++;_0x3ca2c1[_0xe1b6('0xb5')]({'id':_0x3193b5[_0xe1b6('0xb4')],'field':{'countnoanswerretry':_0x3193b5['countnoanswerretry']}})['then'](function(){_0x3ca2c1[_0xe1b6('0xcb')](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});});}});delete this['actions'][_0x15d809[_0xe1b6('0xb2')]];break;default:if(_0x3193b5[_0xe1b6('0x80')]){ut[_0xe1b6('0x81')](_0x53c31f,_0xe1b6('0xf6'));ut[_0xe1b6('0x82')](_0xe1b6('0xf7')+_0x53c31f['name'],_0x15d809);}_0x53c31f['outboundUnknownCallsDay']+=0x1;_0x3193b5[_0xe1b6('0xbf')]=ut[_0xe1b6('0xa1')](_0x3193b5);ut['logCustomer'](_0x3193b5,0xc,_0x15d809['cause-txt']||_0x15d809[_0xe1b6('0xf1')]);_0x1c1e97=_0x53c31f[_0xe1b6('0xe1')];_0x1d5335=_0x53c31f[_0xe1b6('0xa8')];rpcDb['createCustomerHistory'](_0x3193b5,_0xe1b6('0xf8'));_0x3ca2c1[_0xe1b6('0xa6')](_0x3193b5,'20',_0x53c31f)['then'](function(_0x6ca47e){_0x219450=_0x6ca47e[_0xe1b6('0xa7')]==0x1;if(!_0x219450){if(ut[_0xe1b6('0xa1')](_0x3193b5)>=_0x53c31f[_0xe1b6('0xa9')]){_0xd8e5bf=ut[_0xe1b6('0xd4')](_0x3193b5,0xf,_0xe1b6('0xaa'));rpcDb[_0xe1b6('0xab')](_0xd8e5bf,_0xe1b6('0xf9'));}else{rpcDb['createCustomerFinal'](_0x3193b5,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xe1b6('0x15')][_0x15d809['linkedid']];}else{_0x3ca2c1['swapAdditionalPhones'](_0x3193b5,_0x1c1e97,_0x1d5335)[_0xe1b6('0x8e')](function(){});}});}if(!(_0x3193b5[_0xe1b6('0x80')]&&_0x3d222b==='16')){ut['updateOriginated'](_0x53c31f,_0xe1b6('0xfa'));logger['info'](_0xe1b6('0xfb'),_0x3193b5[_0xe1b6('0xb8')],_0xe1b6('0xb9'),_0x53c31f[_0xe1b6('0x2a')],_0xe1b6('0x71'),_0x53c31f[_0xe1b6('0x72')]);}if(_0x3d222b!==_0xe1b6('0xb6')){delete this[_0xe1b6('0x15')][_0x15d809[_0xe1b6('0xb2')]];delete this[_0xe1b6('0x15')][_0x15d809['destlinkedid']];}}};Preview[_0xe1b6('0xf')][_0xe1b6('0xfc')]=function(_0xaa4aeb,_0xc43e4a,_0x4d29b1){if(_[_0xe1b6('0xfd')](_0xc43e4a)&&_0xe1b6('0xfe')!==typeof _0xc43e4a){return;}if(_['isUndefined'](_0x4d29b1)&&_0xe1b6('0xfe')!==typeof _0x4d29b1){return;}switch(_0x4d29b1[_0xe1b6('0xff')]){case'0':ut[_0xe1b6('0x100')](_0xaa4aeb,0x0,_0xe1b6('0xa2'));rpcDb[_0xe1b6('0x101')](_0xaa4aeb,_0xe1b6('0x102'));break;case'3':ut[_0xe1b6('0x100')](_0xaa4aeb,0x3,_0xe1b6('0xcf'));rpcDb[_0xe1b6('0x101')](_0xaa4aeb,_0xe1b6('0x103'));break;case'5':ut['logAgent'](_0xaa4aeb,0x5,'Busy');rpcDb[_0xe1b6('0x101')](_0xaa4aeb,_0xe1b6('0x104'));break;case'8':ut[_0xe1b6('0x100')](_0xaa4aeb,0x8,_0xe1b6('0xd9'));rpcDb[_0xe1b6('0x101')](_0xaa4aeb,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0xe1b6('0x100')](_0xaa4aeb,0x16,'AnswerAGI');rpcDb[_0xe1b6('0x101')](_0xaa4aeb,_0xe1b6('0x105'));break;default:ut[_0xe1b6('0x100')](_0xaa4aeb,0xc,_0x4d29b1[_0xe1b6('0xff')]);rpcDb[_0xe1b6('0x101')](_0xaa4aeb,_0xe1b6('0x106'));}ut[_0xe1b6('0x7e')](_0xc43e4a,_0xe1b6('0x107'));logger[_0xe1b6('0x58')](_0xe1b6('0x108'),_0xaa4aeb[_0xe1b6('0xb8')],'\x20Queue',_0xc43e4a[_0xe1b6('0x2a')],_0xe1b6('0x71'),_0xc43e4a[_0xe1b6('0x72')]);delete this[_0xe1b6('0x15')][_0xaa4aeb[_0xe1b6('0xb8')]];};Preview[_0xe1b6('0xf')]['verifyAdditionalPhones']=function(_0xed8cd0,_0x479dd4,_0x39fe19){return Promise[_0xe1b6('0x109')]()[_0xe1b6('0x8e')](cmHopperAdditionalPhone[_0xe1b6('0xa6')](_0xed8cd0,_0x479dd4,_0x39fe19))['catch'](logger[_0xe1b6('0x58')](_0xe1b6('0x10a')));};Preview[_0xe1b6('0xf')][_0xe1b6('0xcb')]=function(_0x4a732e,_0x370543,_0x15f42c){return Promise[_0xe1b6('0x109')]()[_0xe1b6('0x8e')](cmHopperAdditionalPhone[_0xe1b6('0xcb')](_0x4a732e,_0x370543,_0x15f42c))[_0xe1b6('0x7c')](logger['info']('[swapAdditionalPhone]\x20'));};Preview['prototype'][_0xe1b6('0xb5')]=function(_0x42593b){return Promise[_0xe1b6('0x109')]()['then'](cmHopperAdditionalPhone[_0xe1b6('0xb5')](_0x42593b))[_0xe1b6('0x7c')](logger[_0xe1b6('0x58')](_0xe1b6('0x10b')));};Preview[_0xe1b6('0xf')][_0xe1b6('0x10c')]=function(_0x2c0561,_0x16b6dd,_0x34e46d,_0x4f8820,_0x588fc9){var _0x5ceb67=this;return new Promise(function(_0x449ddc,_0x2da939){if(_[_0xe1b6('0x6d')](_0x16b6dd)||_[_0xe1b6('0x6d')](_0x16b6dd[_0xe1b6('0x10d')])||_['isNil'](_0x16b6dd[_0xe1b6('0x10e')])||_[_0xe1b6('0x6d')](_0x16b6dd['VoiceQueueId'])){_0x2da939(ut[_0xe1b6('0x5f')](_0xe1b6('0x10f'),_0x4f8820,_0x588fc9));return;}var _0x2bfef5=uuid['v4']();var _0x1ab25d=_0x5ceb67[_0xe1b6('0x28')][_0x16b6dd[_0xe1b6('0x6f')][_0xe1b6('0x2a')]];var _0x122726=_0x34e46d?_0x5ceb67[_0xe1b6('0x16')][_0x34e46d]['id']:undefined;_0x5ceb67[_0xe1b6('0x15')][_0x2bfef5]=new Action(_0x16b6dd,_0x1ab25d,_0x2bfef5,_0x34e46d,_0x122726);var _0x9391e5=_0x5ceb67[_0xe1b6('0x15')][_0x2bfef5];_0x9391e5[_0xe1b6('0xd7')]=_0x4f8820;_0x9391e5[_0xe1b6('0xb1')]=_0x588fc9;_0x9391e5[_0xe1b6('0x110')]=_0x34e46d;if(_[_0xe1b6('0x111')](_0x2c0561)){_0x5ceb67[_0xe1b6('0x112')](_0x9391e5,_0x1ab25d,_0x16b6dd,_0x34e46d)[_0xe1b6('0x8e')](function(_0x13218b){logger['info'](_0xe1b6('0x113'),_0xe1b6('0x114')+_0x9391e5['queue']+'\x20IdHopper:\x20'+_0x9391e5[_0xe1b6('0xb4')],JSON[_0xe1b6('0x5a')](_0x13218b));ami[_0xe1b6('0x29')](_0xe1b6('0x115'),ut[_0xe1b6('0xa4')](_0x9391e5,_0xe1b6('0x116'),_0x5ceb67[_0xe1b6('0x28')][_0x9391e5[_0xe1b6('0x70')]]));_0x449ddc(ut[_0xe1b6('0x5f')](_0xe1b6('0x117')));})[_0xe1b6('0x7c')](function(_0xd213a1){ut[_0xe1b6('0x61')]('[Preview][execCall][failure]',_0xd213a1);_0x2da939(ut['message'](_0xe1b6('0x118'),_0x4f8820,_0x588fc9));});}else{_0x1ab25d['outboundBlacklistCallsDay']+=0x1;ut[_0xe1b6('0x119')](_0x9391e5);rpcDb[_0xe1b6('0x11a')](_0x9391e5,_0xe1b6('0x11b'));delete _0x5ceb67[_0xe1b6('0x15')][_0x2bfef5];_0x2da939(ut[_0xe1b6('0x5f')](_0xe1b6('0x11c'),_0x4f8820,_0x588fc9));}});};Preview[_0xe1b6('0xf')][_0xe1b6('0x9c')]=function(_0x87cb51){return!_[_0xe1b6('0x6d')](_0x87cb51)&&!_[_0xe1b6('0x6d')](_0x87cb51['name'])&&!_[_0xe1b6('0x6d')](_0x87cb51[_0xe1b6('0x53')])&&_0x87cb51[_0xe1b6('0x53')]&&!_[_0xe1b6('0x6d')](this[_0xe1b6('0x14')][util['format'](_0xe1b6('0x11d'),_0x87cb51[_0xe1b6('0x2a')])])&&!_[_0xe1b6('0x6d')](this['trunks'][util[_0xe1b6('0x55')](_0xe1b6('0x11d'),_0x87cb51[_0xe1b6('0x2a')])]['status'])&&(this[_0xe1b6('0x14')][util[_0xe1b6('0x55')]('SIP/%s',_0x87cb51[_0xe1b6('0x2a')])]['status']===_0xe1b6('0x11e')||this['trunks'][util[_0xe1b6('0x55')](_0xe1b6('0x11d'),_0x87cb51[_0xe1b6('0x2a')])]['status']==='unmonitored');};Preview[_0xe1b6('0xf')][_0xe1b6('0x8d')]=function(_0x67d22e,_0x5a507b){var _0x1d4600=this;return new Promise(function(_0x42254d,_0x5f2f67){_0x1d4600['execRun'](_0x67d22e,_0x5a507b)[_0xe1b6('0x8e')](function(_0x5aa8b9){_0x42254d(_[_0xe1b6('0x74')](_0x5aa8b9,[_0xe1b6('0x5f')]));})[_0xe1b6('0x7c')](function(_0x25804c){if(_0x25804c[_0xe1b6('0x11f')]){rpcDb[_0xe1b6('0x120')](_0x67d22e);}if(_0x25804c[_0xe1b6('0x53')]){rpcDb[_0xe1b6('0x91')](_0x67d22e);}_0x5f2f67(_[_0xe1b6('0x74')](_0x25804c,[_0xe1b6('0x5f')]));});});};Preview[_0xe1b6('0xf')][_0xe1b6('0x121')]=function(_0x590901,_0x4bdb5e){var _0x16f2fe=this;return new Promise(function(_0x11e935,_0x1a2532){var _0x4f4cfa,_0x599319;rpcDb['getContactPreview'](_0x590901)[_0xe1b6('0x8e')](function(_0x4eb6b4){if(!_[_0xe1b6('0x6d')](_0x4eb6b4[0x0])){_0x599319=_0x4eb6b4[0x0][_0xe1b6('0x122')]?![]:!![];_0x4f4cfa=_0x4eb6b4[0x0]['recallme']?!![]:![];_0x4f4cfa=_0x4bdb5e?!![]:_0x4f4cfa;}var _0x1ad6ed=_0x16f2fe[_0xe1b6('0x123')](_0x4eb6b4);if(_0x1ad6ed[_0xe1b6('0x124')]){rpcDb[_0xe1b6('0x125')](_[_0xe1b6('0x74')](_0x4eb6b4[0x0],[_0xe1b6('0x77'),_0xe1b6('0x10e')]))[_0xe1b6('0x8e')](function(_0x329027){_0x16f2fe[_0xe1b6('0x10c')](_0x329027,_0x4eb6b4[0x0],_0x4bdb5e,_0x599319,_0x4f4cfa)[_0xe1b6('0x8e')](function(_0x45b4e4){_0x11e935(_0x45b4e4);})[_0xe1b6('0x7c')](function(_0x47f23a){_0x1a2532(_0x47f23a);});})[_0xe1b6('0x7c')](function(_0x2f88fd){ut[_0xe1b6('0x61')]('[Preview][checkIsBlackList]',_0x2f88fd);_0x1a2532(ut[_0xe1b6('0x5f')](_0xe1b6('0x126'),_0x599319,_0x4f4cfa));});}else{_0x1a2532(ut['message'](_0x1ad6ed[_0xe1b6('0x5f')],_0x599319,_0x4f4cfa));}})[_0xe1b6('0x7c')](function(_0x53e76a){ut[_0xe1b6('0x61')]('[Preview][getContactPreview]',_0x53e76a);_0x1a2532(ut['message'](_0xe1b6('0x126'),![],!![]));});});};Preview[_0xe1b6('0xf')]['validateContact']=function(_0x594ada){if(_['isNil'](_0x594ada)||_['isEmpty'](_0x594ada)||!_[_0xe1b6('0x6d')](_0x594ada[0x0][_0xe1b6('0x8c')])&&_[_0xe1b6('0x6d')](_0x594ada[0x0][_0xe1b6('0x8c')]['name'])){ut[_0xe1b6('0x61')](_0xe1b6('0x127'),_0x594ada);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x375985=this['campaignsPreview'][_0x594ada[0x0]['Queue'][_0xe1b6('0x2a')]];_0x375985[_0xe1b6('0x5f')]=_0xe1b6('0x9e');if(_[_0xe1b6('0x6d')](_0x375985)){ut[_0xe1b6('0x61')](_0xe1b6('0x128'),_0x375985);return{'isValid':![],'message':_0xe1b6('0x129')};}if(!this['isTrunkReachable'](_0x375985[_0xe1b6('0x52')])){ut[_0xe1b6('0x61')](_0xe1b6('0x12a'),_0xe1b6('0x12b')+_0x375985[_0xe1b6('0x2a')]+_0xe1b6('0x12c'));if(!this[_0xe1b6('0x9c')](_0x375985[_0xe1b6('0x9d')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x375985[_0xe1b6('0x2a')]+_0xe1b6('0x12d'));return{'isValid':![],'message':_0xe1b6('0x12e')};}}if(!ut[_0xe1b6('0x9b')](_0x375985[_0xe1b6('0x35')])){ut['logger'](_0xe1b6('0x12f'),_0x375985['name']+_0xe1b6('0x130'));return{'isValid':![],'message':_0xe1b6('0x12b')+_0x375985[_0xe1b6('0x2a')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype']['execCall']=function(_0x2ebc1b,_0x919a31,_0x4012b2,_0x2ace58){var _0x5d13f1=this;return new Promise(function(_0x50350e,_0x3a7215){var _0x459d78=_0x2ebc1b[_0xe1b6('0xb8')];var _0x5c5da2=_0x5d13f1[_0xe1b6('0x9c')](_0x919a31[_0xe1b6('0x52')])?util['format']('SIP/%s/%s%s',_0x919a31[_0xe1b6('0x52')][_0xe1b6('0x2a')],_['isNil'](_0x919a31[_0xe1b6('0x39')])?'':_0x919a31[_0xe1b6('0x39')]['trim']()||'',_0x919a31[_0xe1b6('0x131')]>0x0?_0x4012b2[_0xe1b6('0x10e')][_0xe1b6('0x132')](_0x919a31[_0xe1b6('0x131')]):_0x4012b2[_0xe1b6('0x10e')]):util[_0xe1b6('0x55')](_0xe1b6('0x133'),_[_0xe1b6('0x6d')](_0x919a31[_0xe1b6('0x9d')])?_0x919a31[_0xe1b6('0x52')][_0xe1b6('0x2a')]:_0x919a31[_0xe1b6('0x9d')][_0xe1b6('0x2a')],_[_0xe1b6('0x6d')](_0x919a31['dialPrefix'])?'':_0x919a31[_0xe1b6('0x39')]['trim']()||'',_0x919a31[_0xe1b6('0x131')]>0x0?_0x4012b2['phone']['substring'](_0x919a31[_0xe1b6('0x131')]):_0x4012b2[_0xe1b6('0x10e')]);var _0x2b0db4=_0x5d13f1['isTrunkReachable'](_0x919a31[_0xe1b6('0x52')])?ut['getCallerId'](_0x919a31[_0xe1b6('0x52')]['callerid'],_0x919a31[_0xe1b6('0x37')],_0x919a31[_0xe1b6('0x134')]>0x0?ut['getCallerIdRandom'](_0x919a31[_0xe1b6('0x38')],_0x919a31[_0xe1b6('0x134')]):_0x919a31[_0xe1b6('0x38')]):ut[_0xe1b6('0x135')](_['isNil'](_0x919a31[_0xe1b6('0x9d')])?_0x919a31[_0xe1b6('0x52')]['callerid']:_0x919a31['TrunkBackup']['callerid'],_0x919a31[_0xe1b6('0x37')],_0x919a31[_0xe1b6('0x134')]>0x0?ut[_0xe1b6('0x136')](_0x919a31[_0xe1b6('0x38')],_0x919a31[_0xe1b6('0x134')]):_0x919a31[_0xe1b6('0x38')]);if(_0x2b0db4){_0x2ebc1b[_0xe1b6('0x137')]=ut[_0xe1b6('0x138')](_0x2b0db4);_0x2ebc1b['originatecalleridnum']=ut[_0xe1b6('0x139')](_0x2b0db4);}var _0x278c44=ut[_0xe1b6('0x13a')](_0x919a31,_0x4012b2,_0x5c5da2,_0x2b0db4,_0x459d78,_0x2ebc1b);_[_0xe1b6('0x13b')](_0x2ebc1b,ut[_0xe1b6('0x13c')](_0x278c44));_0x2ebc1b[_0xe1b6('0x13d')]=moment()[_0xe1b6('0x55')](_0xe1b6('0x92'));_0x919a31[_0xe1b6('0x13e')]=_0x278c44;ami[_0xe1b6('0x79')](ut[_0xe1b6('0x13f')](_0x2ebc1b,_0x919a31,_0x278c44,_0x2ebc1b[_0xe1b6('0xb1')],_0x2ace58))[_0xe1b6('0x8e')](function(_0x472f00){_0x919a31[_0xe1b6('0x72')]+=0x1;logger[_0xe1b6('0x58')](_0xe1b6('0x140'),_0x459d78,_0xe1b6('0xb9'),_0x919a31['name'],_0xe1b6('0x71'),_0x919a31['originated']);_0x50350e(_0x472f00);})[_0xe1b6('0x7c')](function(_0x227141){ut[_0xe1b6('0x100')](_0x2ebc1b,0xe,_0xe1b6('0x141'));rpcDb['createAgentHistory'](_0x2ebc1b,_0xe1b6('0x142'));_0x3a7215(_0x227141);});});};Preview[_0xe1b6('0xf')][_0xe1b6('0x21')]=function(_0x35bbe8){if(this[_0xe1b6('0x15')][_0x35bbe8[_0xe1b6('0xb2')]]){this[_0xe1b6('0x15')][_0x35bbe8[_0xe1b6('0xb2')]]['channel']=_0x35bbe8[_0xe1b6('0x7b')];}};Preview[_0xe1b6('0xf')]['syncOriginateResponse']=function(_0x45a7fb){var _0x8b0560=this;var _0x275bcd=this[_0xe1b6('0x15')][_0x45a7fb['actionid']];if(_0x275bcd){if(_0x275bcd[_0xe1b6('0x110')]&&this['agents'][_0x275bcd[_0xe1b6('0x110')]]){ut[_0xe1b6('0x143')](_0x275bcd,this[_0xe1b6('0x16')][_0x275bcd[_0xe1b6('0x110')]][_0xe1b6('0x2a')],this[_0xe1b6('0x16')][_0x275bcd[_0xe1b6('0x110')]]['id']);}var _0x529f52=_[_0xe1b6('0x144')](_0x275bcd);_0x529f52[_0xe1b6('0x145')]=moment()[_0xe1b6('0x55')](_0xe1b6('0x92'));var _0x29607d=_0x8b0560[_0xe1b6('0x28')][_0x275bcd[_0xe1b6('0x70')]];if(ut[_0xe1b6('0x146')](_0x45a7fb[_0xe1b6('0x147')])){if(_0x275bcd[_0xe1b6('0xd7')]){rpcDb['unlockContact'](_0x275bcd[_0xe1b6('0xb4')]);}if(_0x275bcd[_0xe1b6('0xb1')]){rpcDb[_0xe1b6('0x91')](_0x275bcd[_0xe1b6('0xb4')]);}ami[_0xe1b6('0x29')](_0xe1b6('0x148'),ut[_0xe1b6('0xa4')](_0x275bcd,'rejected',this[_0xe1b6('0x28')][_0x275bcd['queue']]));this[_0xe1b6('0xfc')](_0x529f52,_0x29607d,_0x45a7fb);}else{_0x275bcd[_0xe1b6('0x13d')]=moment()[_0xe1b6('0x55')](_0xe1b6('0x92'));ut[_0xe1b6('0x100')](_0x529f52,0x4,_0xe1b6('0xc0'));rpcDb[_0xe1b6('0x101')](_0x529f52,_0xe1b6('0x149'));}}};Preview[_0xe1b6('0xf')]['syncHangup']=function(_0x1a2612){var _0x1b9633=this[_0xe1b6('0x15')][_0x1a2612['linkedid']];var _0x267d77;if(_0x1b9633){_0x267d77=this[_0xe1b6('0x28')][_0x1b9633['queue']];logger[_0xe1b6('0x58')](_0xe1b6('0x14a'),_0x1a2612['linkedid'],_0xe1b6('0xb9'),_0x267d77[_0xe1b6('0x2a')],_0xe1b6('0x73'),_0x267d77[_0xe1b6('0x2f')]);}if(this['actions'][_0x1a2612['linkedid']]&&_0x1a2612['linkedid']!==_0x1a2612[_0xe1b6('0xb8')]){if(_0x1a2612['cause']==='16'&&this[_0xe1b6('0x15')][_0x1a2612[_0xe1b6('0xb2')]][_0xe1b6('0x80')]){this[_0xe1b6('0x9f')](_0x1a2612,_0x1a2612[_0xe1b6('0xb2')],_0x1a2612[_0xe1b6('0x14b')]);}else if(this[_0xe1b6('0x15')][_0x1a2612[_0xe1b6('0xb2')]][_0xe1b6('0x80')]){logger[_0xe1b6('0x58')]('[syncHangup][talking][cause]',_0x1a2612['linkedid'],_0x1a2612[_0xe1b6('0x14b')],'\x20Queue',_0x267d77[_0xe1b6('0x2a')],_0xe1b6('0x73'),_0x267d77['pTalking']);this['callProgressDetectingCustomer'](_0x1a2612,_0x1a2612[_0xe1b6('0xb2')],_0x1a2612[_0xe1b6('0x14b')]);}}else if(_0x1b9633&&_[_0xe1b6('0x6d')](_0x1b9633['statedesc'])&&_0x267d77['dialQueueProject']&&_0x1a2612[_0xe1b6('0xb2')]===_0x1a2612[_0xe1b6('0xb8')]&&_['isNil'](_0x1a2612['reason'])&&_0x1a2612[_0xe1b6('0x14b')]==='16'&&_0x1a2612['channelstate']==='6'&&_['isUndefined'](_0x1b9633['transfer'])){if(_0x1b9633[_0xe1b6('0xd7')]){rpcDb['unlockContact'](_0x1b9633[_0xe1b6('0xb4')]);}if(_0x1b9633[_0xe1b6('0xb1')]){rpcDb['disableContact'](_0x1b9633[_0xe1b6('0xb4')]);}_0x1a2612['reason']='22';this[_0xe1b6('0xfc')](_0x1b9633,_0x267d77,_0x1a2612);}else if(_0x1b9633&&_0x1b9633[_0xe1b6('0x14c')]){if(_0x1a2612[_0xe1b6('0x14b')]==='16'&&this[_0xe1b6('0x15')][_0x1a2612['linkedid']][_0xe1b6('0x80')]){logger[_0xe1b6('0x58')]('[syncHangup][talking][transfer]',_0x1a2612['linkedid'],_0x1a2612[_0xe1b6('0x14b')],_0xe1b6('0xb9'),_0x267d77[_0xe1b6('0x2a')],_0xe1b6('0x73'),_0x267d77[_0xe1b6('0x2f')]);this[_0xe1b6('0x9f')](_0x1a2612,_0x1a2612[_0xe1b6('0xb2')],_0x1a2612[_0xe1b6('0x14b')]);}else if(this[_0xe1b6('0x15')][_0x1a2612[_0xe1b6('0xb2')]][_0xe1b6('0x80')]){logger[_0xe1b6('0x58')](_0xe1b6('0x14d'),_0x1a2612[_0xe1b6('0xb2')],_0x1a2612[_0xe1b6('0x14b')],'\x20Queue',_0x267d77[_0xe1b6('0x2a')],_0xe1b6('0x73'),_0x267d77[_0xe1b6('0x2f')]);this[_0xe1b6('0x9f')](_0x1a2612,_0x1a2612[_0xe1b6('0xb2')],_0x1a2612[_0xe1b6('0x14b')]);}}};Preview['prototype'][_0xe1b6('0x14e')]=function(_0x4f486d){if(this[_0xe1b6('0x15')][_0x4f486d[_0xe1b6('0x14f')]]&&_0x4f486d[_0xe1b6('0x14f')]!==_0x4f486d[_0xe1b6('0x150')]){this[_0xe1b6('0x9f')](_0x4f486d,_0x4f486d[_0xe1b6('0x14f')],_0x4f486d['dialstatus']);}};Preview[_0xe1b6('0xf')][_0xe1b6('0x1e')]=function(_0x543643){if(this[_0xe1b6('0x15')][_0x543643[_0xe1b6('0xb2')]]&&_0x543643[_0xe1b6('0xb2')]!==_0x543643[_0xe1b6('0xb8')]&&!this[_0xe1b6('0x15')][_0x543643[_0xe1b6('0xb2')]][_0xe1b6('0x80')]){if(_0x543643[_0xe1b6('0x14b')]==='1'){this[_0xe1b6('0x9f')](_0x543643,_0x543643['linkedid'],_0x543643['cause']);}}};Preview['prototype'][_0xe1b6('0x151')]=function(_0x2c8b25,_0x451a0e,_0x4e4eff){if(this['actions'][_0x2c8b25]){if(_['isNil'](this[_0xe1b6('0x15')][_0x2c8b25]['variables'])){this[_0xe1b6('0x15')][_0x2c8b25][_0xe1b6('0x13e')]={};}this[_0xe1b6('0x15')][_0x2c8b25]['variables'][_0x451a0e]=_0x4e4eff;}};Preview[_0xe1b6('0xf')][_0xe1b6('0x23')]=function(_0x2050e3){try{if(!_[_0xe1b6('0x6d')](_0x2050e3)){if(ut[_0xe1b6('0x152')](_[_0xe1b6('0x153')](_0x2050e3[_0xe1b6('0x154')])[0x0])){this[_0xe1b6('0x151')](_0x2050e3['uniqueid'],_[_0xe1b6('0x153')](_0x2050e3[_0xe1b6('0x154')])[0x0],_0x2050e3['value']);}}}catch(_0x4b31ab){logger['error'](_0xe1b6('0x155'),util[_0xe1b6('0x156')](_0x4b31ab,{'showHidden':![],'depth':null}));}};Preview[_0xe1b6('0xf')][_0xe1b6('0x25')]=function(_0x484f8a){if(_0x484f8a){if(this['actions'][_0x484f8a[_0xe1b6('0x157')]]){this[_0xe1b6('0x15')][_0x484f8a[_0xe1b6('0x157')]]['transfer']=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x56ef75){if(_0x56ef75){if(this['actions'][_0x56ef75[_0xe1b6('0x158')]]){this[_0xe1b6('0x15')][_0x56ef75[_0xe1b6('0x158')]]['transfer']=!![];}}};module[_0xe1b6('0x159')]=Preview;
\ No newline at end of file
+var _0x3853=['cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','createAgentHistory','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','updateOriginated','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','originated:\x20','resolve','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','run','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','variables','variablesAction','[originateFailure][logOriginateFailure]','channel','actionid','clone','isFailure','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','[syncHangup][talking][cause]','cause','statedesc','channelstate','transfer','syncDialEnd','destuniqueid','addVariable','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','message','NOT_ACTIVE','logger','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','hasOwnProperty','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','sequence','isNil','[clearZombieChannels][talking]','Queue','queue','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','recallMe','getContactRecallMe','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','dialActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','logCustomer','NoSuchNumber','buildObj','[callProgressDetectingCustomer][logNoSuch]','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','linkedid','countnosuchnumberretry','idContact','swapAdditionalPhones','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','answered','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','verifyAdditionalPhones','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','activeContact','incrementPreviewCounters','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','dialCongestionRetryFrequency','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countagentrejectretry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency'];(function(_0xbc13e1,_0x14d88b){var _0xa87f5a=function(_0x11ea58){while(--_0x11ea58){_0xbc13e1['push'](_0xbc13e1['shift']());}};_0xa87f5a(++_0x14d88b);}(_0x3853,0x1db));var _0x3385=function(_0x54cb55,_0x18d9df){_0x54cb55=_0x54cb55-0x0;var _0x14eadd=_0x3853[_0x54cb55];return _0x14eadd;};'use strict';var util=require(_0x3385('0x0'));var _=require(_0x3385('0x1'));var uuid=require(_0x3385('0x2'));var moment=require(_0x3385('0x3'));var md5=require('md5');var Redis=require(_0x3385('0x4'));var config=require(_0x3385('0x5'));var logger=require(_0x3385('0x6'))(_0x3385('0x7'));var loggerAction=require(_0x3385('0x6'))('actionPreview');var ami=require(_0x3385('0x8'));var rpcDb=require(_0x3385('0x9'));var cmHopperAdditionalPhone=require(_0x3385('0xa'));var Action=require(_0x3385('0xb'));var ut=require(_0x3385('0xc'));config[_0x3385('0xd')]=_[_0x3385('0xe')](config[_0x3385('0xd')],{'host':_0x3385('0xf'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3385('0xd')]));var Sequence=function(){};Sequence[_0x3385('0x10')][_0x3385('0x11')]=function(_0x512e0f){this['tail']=this['tail']?this[_0x3385('0x12')]['finally'](_0x512e0f):_0x512e0f();};function Preview(_0x3cf468){this['sequence']=new Sequence();this[_0x3385('0x13')]=_0x3cf468[_0x3385('0x14')];this[_0x3385('0x15')]=_0x3cf468[_0x3385('0x15')];this[_0x3385('0x16')]={};this[_0x3385('0x17')]=_0x3cf468[_0x3385('0x17')];this[_0x3385('0x18')]=0x0;ami['on'](_0x3385('0x19'),this[_0x3385('0x1a')][_0x3385('0x1b')](this));ami['on'](_0x3385('0x1c'),this['syncHangup'][_0x3385('0x1b')](this));ami['on'](_0x3385('0x1d'),this[_0x3385('0x1e')]['bind'](this));ami['on'](_0x3385('0x1f'),this['syncDialEnd'][_0x3385('0x1b')](this));ami['on'](_0x3385('0x20'),this[_0x3385('0x21')][_0x3385('0x1b')](this));ami['on'](_0x3385('0x22'),this[_0x3385('0x23')][_0x3385('0x1b')](this));ami['on']('attendedtransfer',this[_0x3385('0x24')][_0x3385('0x1b')](this));ami['on'](_0x3385('0x25'),this[_0x3385('0x26')][_0x3385('0x1b')](this));this['loopCampaigns'](this[_0x3385('0x13')]);}function emit(_0x461ae8,_0x30e20f,_0x5f1d50){io['to'](_0x461ae8)[_0x3385('0x27')](_0x30e20f,_0x5f1d50);}function emitCampaignPreview(_0xacc698){if(_0xacc698[_0x3385('0x28')]===_0x3385('0x29')){var _0xdee1b6={'id':_0xacc698['id'],'name':_0xacc698[_0x3385('0x2a')],'strategy':_0xacc698[_0x3385('0x2b')],'answered':_0xacc698['answered'],'available':_0xacc698[_0x3385('0x2c')],'loggedIn':_0xacc698[_0x3385('0x2d')],'pTalking':_0xacc698[_0x3385('0x2e')],'sumBillable':_0xacc698[_0x3385('0x2f')],'sumDuration':_0xacc698[_0x3385('0x30')],'sumHoldTime':_0xacc698[_0x3385('0x31')]||0x0,'talking':_0xacc698['talking'],'total':_0xacc698[_0x3385('0x32')],'type':_0xacc698[_0x3385('0x28')],'unmanaged':_0xacc698['unmanaged'],'abandoned':_0xacc698['abandoned'],'waiting':_0xacc698[_0x3385('0x33')],'loggedInDb':_0xacc698['loggedInDb'],'dialActive':_0xacc698['dialActive'],'dialMethod':_0xacc698[_0x3385('0x34')],'dialOriginateCallerIdName':_0xacc698[_0x3385('0x35')],'dialOriginateCallerIdNumber':_0xacc698[_0x3385('0x36')],'dialOriginateTimeout':_0xacc698['dialOriginateTimeout'],'dialPrefix':_0xacc698[_0x3385('0x37')],'outboundAnswerAgiCallsDay':_0xacc698[_0x3385('0x38')],'outboundAnswerCallsDay':_0xacc698[_0x3385('0x39')],'outboundBlacklistCallsDay':_0xacc698[_0x3385('0x3a')],'outboundBusyCallsDay':_0xacc698[_0x3385('0x3b')],'outboundCongestionCallsDay':_0xacc698['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0xacc698[_0x3385('0x3c')],'outboundDropCallsDayCallersExit':_0xacc698[_0x3385('0x3d')],'outboundDropCallsDayTimeout':_0xacc698[_0x3385('0x3e')],'outboundNoAnswerCallsDay':_0xacc698[_0x3385('0x3f')],'outboundNoSuchCallsDay':_0xacc698[_0x3385('0x40')],'outboundOriginateFailureCallsDay':_0xacc698[_0x3385('0x41')],'outboundReCallsDay':_0xacc698['outboundReCallsDay'],'outboundRejectCallsDay':_0xacc698[_0x3385('0x42')],'outboundUnknownCallsDay':_0xacc698[_0x3385('0x43')],'outboundAbandonedCallsDay':_0xacc698[_0x3385('0x44')],'predictiveIntervalAnsweredCalls':_0xacc698[_0x3385('0x45')],'predictiveIntervalAvgHoldtime':_0xacc698['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xacc698['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0xacc698[_0x3385('0x46')],'predictiveIntervalDroppedCallsTimeout':_0xacc698[_0x3385('0x47')],'predictiveIntervalErlangCalls':_0xacc698[_0x3385('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0xacc698['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0xacc698[_0x3385('0x49')],'predictiveIntervalMultiplicativeFactor':_0xacc698[_0x3385('0x4a')],'predictiveIntervalPauses':_0xacc698['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xacc698[_0x3385('0x4b')],'predictiveIntervalTotalCalls':_0xacc698[_0x3385('0x4c')],'message':_0xacc698['message'],'originated':_0xacc698['originated'],'erlangCalls':_0xacc698[_0x3385('0x4d')],'erlangCallToSecond':_0xacc698[_0x3385('0x4e')],'erlangAbandonmentRate':_0xacc698[_0x3385('0x4f')],'erlangBusyFactor':_0xacc698[_0x3385('0x50')],'startPredictive':_0xacc698['startPredictive'],'startProgressive':_0xacc698[_0x3385('0x51')]};if(_0xacc698['Trunk']){_0xdee1b6[_0x3385('0x52')]={'id':_0xacc698[_0x3385('0x52')]['id'],'name':_0xacc698['Trunk'][_0x3385('0x2a')],'active':_0xacc698[_0x3385('0x52')][_0x3385('0x53')],'callerid':_0xacc698['Trunk'][_0x3385('0x54')]};}if(_0xacc698[_0x3385('0x55')]){_0xdee1b6['Interval']={'id':_0xacc698[_0x3385('0x55')]['id'],'name':_0xacc698['Interval'][_0x3385('0x2a')]};}var _0x392dd0=md5(JSON[_0x3385('0x56')](_0xdee1b6));if(_0xacc698['md5']!==_0x392dd0){_0xacc698[_0x3385('0x57')]=_0x392dd0;emit(util[_0x3385('0x58')]('voice:queue:%s',_0xdee1b6[_0x3385('0x2a')]),_0x3385('0x59'),_0xdee1b6);}}}function emitVoiceQueueChannelRemove(_0xae3787){logger[_0x3385('0x5a')](_0x3385('0x5b'),JSON[_0x3385('0x56')](_0xae3787));emit(util['format'](_0x3385('0x5c'),_0xae3787[_0x3385('0x2a')]),_0x3385('0x5d'),_0xae3787);io['emit'](_0x3385('0x5e'),_0xae3787);}function notSendMessagesQueue(_0xcbd25b){if(_0xcbd25b[_0x3385('0x5f')]){if(_0xcbd25b[_0x3385('0x60')]===0x0&&_0xcbd25b[_0x3385('0x2e')]===0x0){_0xcbd25b[_0x3385('0x5f')]=![];_0xcbd25b[_0x3385('0x2c')]=0x0;_0xcbd25b[_0x3385('0x61')]=0x0;_0xcbd25b[_0x3385('0x62')]=_0x3385('0x63');ut[_0x3385('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xcbd25b[_0x3385('0x2a')]+_0x3385('0x65'));}else{_0xcbd25b[_0x3385('0x62')]=_0x3385('0x66');ut[_0x3385('0x64')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xcbd25b[_0x3385('0x2a')]+_0x3385('0x67'));}emitCampaignPreview(_0xcbd25b);}}Preview['prototype'][_0x3385('0x68')]=function(){var _0x2897a0=this;setInterval(function(){_0x2897a0[_0x3385('0x69')]();},0x7cf);};Preview[_0x3385('0x10')][_0x3385('0x69')]=function(){var _0x59a9e7=this[_0x3385('0x13')];this[_0x3385('0x18')]+=0x1;for(var _0x2ec713 in _0x59a9e7){if(_0x59a9e7[_0x3385('0x6a')](_0x2ec713)&&(_0x59a9e7[_0x2ec713]['dialMethod']==='preview'||_0x59a9e7[_0x2ec713][_0x3385('0x34')]==='booked')&&_0x59a9e7[_0x2ec713]['type']===_0x3385('0x29')){if(this['clockClearZombieChannels']>0x7){this[_0x3385('0x18')]=0x0;this[_0x3385('0x6b')]();}}if(_0x59a9e7[_0x3385('0x6a')](_0x2ec713)&&_0x59a9e7[_0x2ec713]['dialMethod']===_0x3385('0x7')&&_0x59a9e7[_0x2ec713][_0x3385('0x28')]===_0x3385('0x29')){if(_0x59a9e7[_0x2ec713]['dialActive']){this['setMessage'](_0x59a9e7[_0x2ec713]);if(_0x59a9e7[_0x2ec713][_0x3385('0x6c')])this['recallMe'](_0x59a9e7[_0x2ec713]);}else{notSendMessagesQueue(_0x59a9e7[_0x2ec713]);}}}};Preview[_0x3385('0x10')][_0x3385('0x6d')]=function(_0x1b24c9){var _0x258dce=this;this[_0x3385('0x6e')][_0x3385('0x11')](function(){if(!_[_0x3385('0x6f')](_0x258dce[_0x3385('0x16')][_0x1b24c9])){loggerAction['info'](_0x3385('0x70'),_0x1b24c9,_0x3385('0x71'),_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x72')],'originated:\x20',JSON[_0x3385('0x56')](_0x258dce[_0x3385('0x13')][_0x258dce[_0x3385('0x16')][_0x1b24c9]['queue']][_0x3385('0x60')]),'pTalking:\x20',JSON[_0x3385('0x56')](_0x258dce[_0x3385('0x13')][_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x72')]][_0x3385('0x2e')]),JSON[_0x3385('0x56')](_0x258dce['actions'][_0x1b24c9][_0x3385('0x73')]),JSON['stringify'](_[_0x3385('0x74')](_0x258dce[_0x3385('0x16')][_0x1b24c9],[_0x3385('0x75'),_0x3385('0x76'),_0x3385('0x77'),_0x3385('0x78')])));return ami[_0x3385('0x79')]({'action':_0x3385('0x7a'),'channel':_0x258dce[_0x3385('0x16')][_0x1b24c9]['channel']})[_0x3385('0x7b')](function(_0x29e402){if(_0x29e402['message']===_0x3385('0x7c')){setTimeout(function(){if(_0x258dce[_0x3385('0x16')][_0x1b24c9]){ut['updateOriginated'](_0x258dce[_0x3385('0x13')][_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x72')]],_0x3385('0x7d'));if(_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x73')]===!![]){ut[_0x3385('0x7e')](_0x258dce[_0x3385('0x13')][_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x72')]],'[clearZombieChannel]');ut['loggerError'](_0x3385('0x7f')+_0x1b24c9,_0x258dce[_0x3385('0x16')][_0x1b24c9][_0x3385('0x72')]);}ut[_0x3385('0x80')](_0x3385('0x81')+_0x1b24c9,_0x258dce[_0x3385('0x16')][_0x1b24c9]['queue']);delete _0x258dce[_0x3385('0x16')][_0x1b24c9];}},0x2328);}});}});};Preview[_0x3385('0x10')][_0x3385('0x6b')]=function(){var _0x4b74bc=this;loggerAction[_0x3385('0x5a')](_0x3385('0x82'),_[_0x3385('0x83')](this[_0x3385('0x16')]));for(var _0x2e42c7 in this[_0x3385('0x16')]){if(_0x4b74bc['actions'][_0x3385('0x6a')](_0x2e42c7)){_0x4b74bc['clearZombieChannel'](_0x2e42c7);}}};Preview[_0x3385('0x10')][_0x3385('0x84')]=function(_0x51b024){var _0x17b90b=this;rpcDb[_0x3385('0x85')](_0x51b024['id'],ut['agentReadyId'](this[_0x3385('0x17')]))['then'](function(_0x18b104){if(!_[_0x3385('0x6f')](_0x18b104)){for(var _0x4bb79c=0x0;_0x4bb79c<_0x18b104[_0x3385('0x86')];_0x4bb79c+=0x1){if(ut[_0x3385('0x87')](_0x18b104[_0x4bb79c][_0x3385('0x88')])<_0x51b024[_0x3385('0x89')]*0x3c){if(_0x18b104[_0x4bb79c][_0x3385('0x8a')]&&!_0x18b104[_0x4bb79c][_0x3385('0x8a')][_0x3385('0x8b')]){_0x17b90b['run'](_0x18b104[_0x4bb79c]['id'])[_0x3385('0x8c')](ut[_0x3385('0x8d')](_0x3385('0x8e')))[_0x3385('0x7b')](ut[_0x3385('0x8d')](_0x3385('0x8e')));}else{rpcDb[_0x3385('0x8f')](_0x18b104[_0x4bb79c]['id']);}}else{var _0x148b87=new Action(_0x18b104[_0x4bb79c],_0x51b024);_0x148b87[_0x3385('0x90')]=moment()[_0x3385('0x58')](_0x3385('0x91'));_0x51b024['outboundReCallsDay']+=0x1;ut['logCustomer'](_0x148b87,0x17,'RecallInQueue');if(_0x51b024[_0x3385('0x92')]){rpcDb[_0x3385('0x93')](ut['createBody'](_0x18b104[_0x4bb79c]));rpcDb[_0x3385('0x94')](_0x148b87,_0x3385('0x95'));}else{ut['logCustomer'](_0x148b87,0x16,_0x3385('0x96'));rpcDb['createCustomerHistory'](_0x148b87,'[HistoryRecallClose]');rpcDb[_0x3385('0x97')](_0x148b87,_0x3385('0x98'));}}}}})[_0x3385('0x7b')](ut[_0x3385('0x8d')](_0x3385('0x99')));};Preview[_0x3385('0x10')][_0x3385('0x9a')]=function(_0x476c0d){_0x476c0d[_0x3385('0x5f')]=!![];if(ut[_0x3385('0x9b')](_0x476c0d[_0x3385('0x2d')])){_0x476c0d[_0x3385('0x62')]=_0x3385('0x9c');}else if(!ut[_0x3385('0x9d')](_0x476c0d[_0x3385('0x9e')])){_0x476c0d[_0x3385('0x62')]=_0x3385('0x63');}else if(!this[_0x3385('0x9f')](_0x476c0d['Trunk'])){if(!this['isTrunkReachable'](_0x476c0d[_0x3385('0xa0')])){_0x476c0d[_0x3385('0x62')]=_0x3385('0xa1');}else{_0x476c0d[_0x3385('0x62')]='ACTIVE';}}else{_0x476c0d[_0x3385('0x62')]=_0x3385('0xa2');}emitCampaignPreview(_0x476c0d);};Preview[_0x3385('0x10')][_0x3385('0xa3')]=function(_0x533cf7,_0x2341a2,_0x3f2e7b){var _0x347c77=this;var _0x12d202=this[_0x3385('0x16')][_0x2341a2];var _0x42e607=this[_0x3385('0x13')][_0x12d202[_0x3385('0x72')]];var _0x39a0f6;var _0x3bbd79=![];var _0x1b5861=0x2;var _0x174073=0x3;if(_0x42e607){switch(_0x3f2e7b){case'1':_0x42e607[_0x3385('0x40')]+=0x1;_0x12d202['countnosuchnumberretry']+=0x1;_0x12d202[_0x3385('0xa4')]=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x0,_0x3385('0xa7'));ami[_0x3385('0x27')]('custom:agentnosuchnumber',ut[_0x3385('0xa8')](_0x12d202,'nosuchnumber'));rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xa9'));_0x347c77['verifyAdditionalPhones'](_0x12d202,'0',_0x42e607)[_0x3385('0x8c')](function(_0x1fa0ef){_0x3bbd79=_0x1fa0ef[_0x3385('0xaa')]==0x1;_0x1b5861=_0x42e607[_0x3385('0xab')];_0x174073=_0x42e607[_0x3385('0xac')];if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xb0'));}else{if(_0x12d202['countnosuchnumberretry']>=_0x42e607[_0x3385('0xb1')]){rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xb0'));}else{rpcDb[_0x3385('0xb2')](ut[_0x3385('0xb3')](_0x12d202,'countnosuchnumberretry',_0x42e607[_0x3385('0xab')]),_0x12d202[_0x3385('0xb4')],_0x12d202['activeContact']);}}delete this[_0x3385('0x16')][_0x533cf7[_0x3385('0xb5')]];}else{_0x12d202[_0x3385('0xb6')]++;logger[_0x3385('0x5a')]('actioncountonusuch',_0x12d202[_0x3385('0xb6')]);logger[_0x3385('0x5a')]('id',_0x12d202[_0x3385('0xb7')]);_0x347c77['incrementPreviewCounters']({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnosuchnumberretry':_0x12d202['countnosuchnumberretry']}})[_0x3385('0x8c')](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});break;case _0x3385('0xb9'):var _0x509866=moment()[_0x3385('0x58')](_0x3385('0x91'));_0x12d202[_0x3385('0xba')]=_0x509866;_0x12d202['answertime']=_0x509866;_0x12d202['dialAnswer']=!![];_0x42e607['pTalking']+=0x1;logger[_0x3385('0x5a')](_0x3385('0xbb'),_0x12d202[_0x3385('0xbc')],_0x3385('0xbd'),_0x42e607[_0x3385('0x2a')],_0x3385('0xbe'),_0x42e607[_0x3385('0x2e')]);ami[_0x3385('0x27')](_0x3385('0xbf'),ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xc0'),this[_0x3385('0x13')][_0x12d202[_0x3385('0x72')]]));if(_0x42e607[_0x3385('0xc1')]){ami['emit']('custom:agentConnectPreview',ut[_0x3385('0xc2')](_0x12d202));}break;case'16':ami['emit'](_0x3385('0xc3'),ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xc4'),this[_0x3385('0x13')][_0x12d202[_0x3385('0x72')]]));emitVoiceQueueChannelRemove(ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xc4')));_0x42e607[_0x3385('0x39')]+=0x1;_0x42e607[_0x3385('0x32')]+=0x1;_0x42e607[_0x3385('0xc5')]+=0x1;ut[_0x3385('0x7e')](_0x42e607,_0x3385('0xc6'));_0x12d202[_0x3385('0xa4')]=ut['totalGlobal'](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x4,_0x3385('0xc7'));rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xc8'));rpcDb[_0x3385('0x97')](_0x12d202,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x3385('0xc9')](_0x12d202);_0x42e607[_0x3385('0x30')]+=_0x12d202[_0x3385('0xca')];_0x42e607['sumBillable']+=_0x12d202[_0x3385('0xca')];logger[_0x3385('0x5a')]('[syncHangup][talking][decrement]',_0x12d202[_0x3385('0xbc')],'\x20Queue',_0x42e607[_0x3385('0x2a')],'pTalking:\x20',_0x42e607[_0x3385('0x2e')]);delete this[_0x3385('0x16')][_0x533cf7[_0x3385('0xb5')]];break;case _0x3385('0xcb'):_0x42e607['outboundBusyCallsDay']+=0x1;_0x12d202[_0x3385('0xcc')]+=0x1;_0x12d202[_0x3385('0xa4')]=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x5,_0x3385('0xcd'));_0x1b5861=_0x42e607['dialBusyRetryFrequency'];_0x174073=_0x42e607['callAdditionalPhoneAfterMin'];ami['emit'](_0x3385('0xce'),ut['buildObj'](_0x12d202,_0x3385('0xcf')));rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xd0'));_0x347c77[_0x3385('0xd1')](_0x12d202,'5',_0x42e607)[_0x3385('0x8c')](function(_0x1a9cfd){_0x3bbd79=_0x1a9cfd[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xd2'));}else{if(_0x12d202['countbusyretry']>=_0x42e607[_0x3385('0xd3')]){rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xd0'));}else{rpcDb[_0x3385('0xb2')](ut[_0x3385('0xb3')](_0x12d202,_0x3385('0xcc'),_0x42e607['dialBusyRetryFrequency']),_0x12d202[_0x3385('0xb4')],_0x12d202[_0x3385('0xd4')]);}}}else{_0x12d202[_0x3385('0xcc')]++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countbusyretry':_0x12d202[_0x3385('0xcc')]}})[_0x3385('0x8c')](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});break;case _0x3385('0xd6'):_0x42e607['outboundNoAnswerCallsDay']+=0x1;_0x12d202[_0x3385('0xd7')]+=0x1;_0x12d202['countglobal']=ut[_0x3385('0xa5')](_0x12d202);ut['logCustomer'](_0x12d202,0x3,'NoAnswer');_0x1b5861=_0x42e607[_0x3385('0xd8')];_0x174073=_0x42e607[_0x3385('0xac')];var _0x173c4f=ut[_0x3385('0xd9')](_0x12d202,_0x42e607);ami[_0x3385('0x27')](_0x3385('0xda'),_0x173c4f);rpcDb[_0x3385('0x94')](_0x12d202,'[callProgressDetectingCustomer][logNoAnswer]');_0x347c77[_0x3385('0xd1')](_0x12d202,'3',_0x42e607)[_0x3385('0x8c')](function(_0x1bd53d){_0x3bbd79=_0x1bd53d[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut['cloneAction'](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xdb'));}else{if(_0x12d202['countnoanswerretry']>=_0x42e607[_0x3385('0xdc')]){rpcDb['createCustomerFinal'](_0x12d202,_0x3385('0xdd'));}else{rpcDb[_0x3385('0xb2')](ut[_0x3385('0xb3')](_0x12d202,_0x3385('0xd7'),_0x42e607[_0x3385('0xd8')]),_0x12d202[_0x3385('0xb4')],_0x12d202[_0x3385('0xd4')]);}}}else{_0x12d202['countnoanswerretry']++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnoanswerretry':_0x12d202[_0x3385('0xd7')]}})[_0x3385('0x8c')](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});break;case _0x3385('0xde'):_0x42e607[_0x3385('0xdf')]+=0x1;_0x12d202[_0x3385('0xe0')]+=0x1;_0x12d202[_0x3385('0xa4')]=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x8,_0x3385('0xe1'));_0x1b5861=_0x42e607[_0x3385('0xe2')];_0x174073=_0x42e607[_0x3385('0xac')];ami[_0x3385('0x27')]('custom:agentcongestion',ut[_0x3385('0xa8')](_0x12d202,'congestion'));rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xe3'));_0x347c77[_0x3385('0xd1')](_0x12d202,'8',_0x42e607)[_0x3385('0x8c')](function(_0x94bef9){_0x3bbd79=_0x94bef9[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607['dialGlobalMaxRetry']){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,'Global');rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xe4'));}else{if(_0x12d202[_0x3385('0xe0')]>=_0x42e607[_0x3385('0xe5')]){rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xe3'));}else{rpcDb[_0x3385('0xb2')](ut[_0x3385('0xb3')](_0x12d202,_0x3385('0xe0'),_0x42e607[_0x3385('0xe6')]),_0x12d202['unlockAgent'],_0x12d202[_0x3385('0xd4')]);}}}else{_0x12d202[_0x3385('0xe0')]++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countcongestionretry':_0x12d202[_0x3385('0xe0')]}})[_0x3385('0x8c')](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});break;case'CANCEL':_0x42e607[_0x3385('0x42')]+=0x1;_0x12d202['countagentrejectretry']+=0x1;_0x12d202['countglobal']=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x14,_0x3385('0xe7'));_0x1b5861=_0x42e607['dialAgentRejectRetryFrequency'];_0x174073=_0x42e607[_0x3385('0xac')];ami[_0x3385('0x27')](_0x3385('0xe8'),ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xe9')));rpcDb['createCustomerHistory'](_0x12d202,_0x3385('0xea'));_0x347c77[_0x3385('0xd1')](_0x12d202,'20',_0x42e607)[_0x3385('0x8c')](function(_0x42f583){_0x3bbd79=_0x42f583[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607['dialGlobalMaxRetry']){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0x14,_0x3385('0xe7'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xeb'));}else{if(_0x12d202[_0x3385('0xec')]>=_0x42e607[_0x3385('0xed')]){rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xeb'));}else{rpcDb[_0x3385('0xb2')](ut[_0x3385('0xb3')](_0x12d202,_0x3385('0xec'),_0x42e607[_0x3385('0xee')]),_0x12d202[_0x3385('0xb4')],_0x12d202[_0x3385('0xd4')]);}}}else{_0x12d202['countnoanswerretry']++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnoanswerretry':_0x12d202[_0x3385('0xd7')]}})['then'](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});break;case _0x3385('0xef'):_0x42e607[_0x3385('0x44')]+=0x1;_0x12d202['countabandonedretry']+=0x1;_0x12d202['countglobal']=ut[_0x3385('0xa5')](_0x12d202);ut['logCustomer'](_0x12d202,0xb,'Abandoned');rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xf0'));_0x347c77[_0x3385('0xd1')](_0x12d202,'11',_0x42e607)[_0x3385('0x8c')](function(_0x78d812){_0x3bbd79=_0x78d812[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut['totalGlobal'](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x12d202[_0x3385('0xf1')]>=_0x42e607[_0x3385('0xf2')]){rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xf0'));}else{rpcDb['rescheduleContact'](ut[_0x3385('0xb3')](_0x12d202,_0x3385('0xf3'),_0x42e607[_0x3385('0xf4')]),_0x12d202[_0x3385('0xb4')],_0x12d202['activeContact']);}}}else{_0x12d202['countnoanswerretry']++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnoanswerretry':_0x12d202[_0x3385('0xd7')]}})[_0x3385('0x8c')](function(){_0x347c77['swapAdditionalPhones'](_0x12d202,_0x1b5861,_0x174073)['then'](function(){});});}});break;case'18':_0x42e607['outboundUnknownCallsDay']+=0x1;_0x12d202['countmachineretry']+=0x1;_0x12d202[_0x3385('0xa4')]=ut[_0x3385('0xa5')](_0x12d202);ut['logCustomer'](_0x12d202,0x12,_0x533cf7[_0x3385('0xf5')]||_0x533cf7[_0x3385('0xf6')]);ami[_0x3385('0x27')](_0x3385('0xf7'),ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xf8')));rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xf9'));_0x347c77[_0x3385('0xd1')](_0x12d202,'18',_0x42e607)[_0x3385('0x8c')](function(_0x4400bf){_0x3bbd79=_0x4400bf[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut['cloneAction'](_0x12d202,0x12,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xf9'));}else{rpcDb[_0x3385('0x97')](_0x12d202,_0x3385('0xf9'));}}else{_0x12d202[_0x3385('0xd7')]++;_0x347c77['incrementPreviewCounters']({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnoanswerretry':_0x12d202[_0x3385('0xd7')]}})[_0x3385('0x8c')](function(){_0x347c77['swapAdditionalPhones'](_0x12d202,_0x1b5861,_0x174073)['then'](function(){});});}});delete this[_0x3385('0x16')][_0x533cf7['linkedid']];break;case'19':_0x42e607[_0x3385('0x43')]+=0x1;_0x12d202['countglobal']=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0x13,_0x533cf7[_0x3385('0xf5')]||_0x533cf7[_0x3385('0xf6')]);ami[_0x3385('0x27')](_0x3385('0xf7'),ut[_0x3385('0xa8')](_0x12d202,_0x3385('0xf8')));rpcDb['createCustomerHistory'](_0x12d202,'[callProgressDetectingCustomer][machine]');_0x347c77[_0x3385('0xd1')](_0x12d202,'18',_0x42e607)[_0x3385('0x8c')](function(_0x28f55f){_0x3bbd79=_0x28f55f[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607[_0x3385('0xad')]){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xfa'));}else{rpcDb['createCustomerFinal'](_0x12d202,_0x3385('0xfa'));}}else{_0x12d202[_0x3385('0xd7')]++;_0x347c77[_0x3385('0xd5')]({'id':_0x12d202[_0x3385('0xb7')],'field':{'countnoanswerretry':_0x12d202[_0x3385('0xd7')]}})[_0x3385('0x8c')](function(){_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});});}});delete this['actions'][_0x533cf7['linkedid']];break;default:if(_0x12d202['dialAnswer']){ut['decrementTalkink'](_0x42e607,_0x3385('0xfb'));ut[_0x3385('0x80')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x42e607[_0x3385('0x2a')],_0x533cf7);}_0x42e607[_0x3385('0x43')]+=0x1;_0x12d202[_0x3385('0xa4')]=ut[_0x3385('0xa5')](_0x12d202);ut[_0x3385('0xa6')](_0x12d202,0xc,_0x533cf7['cause-txt']||_0x533cf7[_0x3385('0xf6')]);_0x1b5861=_0x42e607[_0x3385('0xee')];_0x174073=_0x42e607[_0x3385('0xac')];rpcDb[_0x3385('0x94')](_0x12d202,_0x3385('0xfc'));_0x347c77[_0x3385('0xd1')](_0x12d202,'20',_0x42e607)[_0x3385('0x8c')](function(_0x445727){_0x3bbd79=_0x445727[_0x3385('0xaa')]==0x1;if(!_0x3bbd79){if(ut[_0x3385('0xa5')](_0x12d202)>=_0x42e607['dialGlobalMaxRetry']){_0x39a0f6=ut[_0x3385('0xae')](_0x12d202,0xf,_0x3385('0xaf'));rpcDb[_0x3385('0x97')](_0x39a0f6,_0x3385('0xfd'));}else{rpcDb['createCustomerFinal'](_0x12d202,_0x3385('0xfd'));}delete this[_0x3385('0x16')][_0x533cf7[_0x3385('0xb5')]];}else{_0x347c77[_0x3385('0xb8')](_0x12d202,_0x1b5861,_0x174073)[_0x3385('0x8c')](function(){});}});}if(!(_0x12d202[_0x3385('0x73')]&&_0x3f2e7b==='16')){ut['updateOriginated'](_0x42e607,_0x3385('0xfe'));logger['info'](_0x3385('0xff'),_0x12d202[_0x3385('0xbc')],_0x3385('0xbd'),_0x42e607[_0x3385('0x2a')],'originated:\x20',_0x42e607['originated']);}if(_0x3f2e7b!==_0x3385('0xb9')){delete this[_0x3385('0x16')][_0x533cf7['linkedid']];delete this[_0x3385('0x16')][_0x533cf7[_0x3385('0x100')]];}}};Preview[_0x3385('0x10')][_0x3385('0x101')]=function(_0x6b50e1,_0x2b6e8d,_0x21176f){if(_[_0x3385('0x102')](_0x2b6e8d)&&'object'!==typeof _0x2b6e8d){return;}if(_['isUndefined'](_0x21176f)&&_0x3385('0x103')!==typeof _0x21176f){return;}switch(_0x21176f[_0x3385('0x104')]){case'0':ut[_0x3385('0x105')](_0x6b50e1,0x0,_0x3385('0xa7'));rpcDb['createAgentHistory'](_0x6b50e1,_0x3385('0x106'));break;case'3':ut[_0x3385('0x105')](_0x6b50e1,0x3,_0x3385('0x107'));rpcDb['createAgentHistory'](_0x6b50e1,_0x3385('0x108'));break;case'5':ut[_0x3385('0x105')](_0x6b50e1,0x5,'Busy');rpcDb[_0x3385('0x109')](_0x6b50e1,_0x3385('0x10a'));break;case'8':ut[_0x3385('0x105')](_0x6b50e1,0x8,_0x3385('0xe1'));rpcDb[_0x3385('0x109')](_0x6b50e1,_0x3385('0x10b'));break;case'22':ut[_0x3385('0x105')](_0x6b50e1,0x16,'AnswerAGI');rpcDb[_0x3385('0x109')](_0x6b50e1,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x3385('0x105')](_0x6b50e1,0xc,_0x21176f[_0x3385('0x104')]);rpcDb['createAgentHistory'](_0x6b50e1,_0x3385('0x10b'));}ut[_0x3385('0x10c')](_0x2b6e8d,_0x3385('0x10d'));logger['info'](_0x3385('0x10e'),_0x6b50e1[_0x3385('0xbc')],_0x3385('0xbd'),_0x2b6e8d[_0x3385('0x2a')],_0x3385('0x10f'),_0x2b6e8d[_0x3385('0x60')]);delete this[_0x3385('0x16')][_0x6b50e1['uniqueid']];};Preview['prototype']['verifyAdditionalPhones']=function(_0x404cd5,_0x5c150a,_0x411ebf){return Promise[_0x3385('0x110')]()['then'](cmHopperAdditionalPhone[_0x3385('0xd1')](_0x404cd5,_0x5c150a,_0x411ebf))[_0x3385('0x7b')](logger[_0x3385('0x5a')](_0x3385('0x111')));};Preview[_0x3385('0x10')][_0x3385('0xb8')]=function(_0x25d341,_0x3c51cb,_0x2f763b){return Promise[_0x3385('0x110')]()[_0x3385('0x8c')](cmHopperAdditionalPhone[_0x3385('0xb8')](_0x25d341,_0x3c51cb,_0x2f763b))[_0x3385('0x7b')](logger['info'](_0x3385('0x112')));};Preview[_0x3385('0x10')][_0x3385('0xd5')]=function(_0x549f43){return Promise[_0x3385('0x110')]()[_0x3385('0x8c')](cmHopperAdditionalPhone['incrementPreviewCounters'](_0x549f43))[_0x3385('0x7b')](logger[_0x3385('0x5a')](_0x3385('0x113')));};Preview[_0x3385('0x10')][_0x3385('0x114')]=function(_0x530669,_0xaff0,_0x469c51,_0x43d584,_0x32c72a){var _0x39f8fa=this;return new Promise(function(_0x267f1d,_0x1524e5){if(_[_0x3385('0x6f')](_0xaff0)||_['isNil'](_0xaff0[_0x3385('0x115')])||_[_0x3385('0x6f')](_0xaff0[_0x3385('0x116')])||_['isNil'](_0xaff0[_0x3385('0x77')])){_0x1524e5(ut['message'](_0x3385('0x117'),_0x43d584,_0x32c72a));return;}var _0x10a975=uuid['v4']();var _0x7c62d9=_0x39f8fa['campaignsPreview'][_0xaff0[_0x3385('0x71')]['name']];var _0x1abf6b=_0x469c51?_0x39f8fa[_0x3385('0x17')][_0x469c51]['id']:undefined;_0x39f8fa['actions'][_0x10a975]=new Action(_0xaff0,_0x7c62d9,_0x10a975,_0x469c51,_0x1abf6b);var _0x4a18c6=_0x39f8fa[_0x3385('0x16')][_0x10a975];_0x4a18c6['unlockAgent']=_0x43d584;_0x4a18c6[_0x3385('0xd4')]=_0x32c72a;_0x4a18c6[_0x3385('0x118')]=_0x469c51;if(_[_0x3385('0x119')](_0x530669)){_0x39f8fa[_0x3385('0x11a')](_0x4a18c6,_0x7c62d9,_0xaff0,_0x469c51)[_0x3385('0x8c')](function(_0xa6b94e){logger[_0x3385('0x5a')](_0x3385('0x11b'),_0x3385('0x11c')+_0x4a18c6['queue']+'\x20IdHopper:\x20'+_0x4a18c6[_0x3385('0xb7')],JSON[_0x3385('0x56')](_0xa6b94e));ami[_0x3385('0x27')](_0x3385('0x11d'),ut[_0x3385('0xa8')](_0x4a18c6,_0x3385('0x11e'),_0x39f8fa[_0x3385('0x13')][_0x4a18c6['queue']]));_0x267f1d(ut[_0x3385('0x62')](_0x3385('0x11f')));})[_0x3385('0x7b')](function(_0x2df766){ut[_0x3385('0x64')](_0x3385('0x120'),_0x2df766);_0x1524e5(ut['message'](_0x3385('0x121'),_0x43d584,_0x32c72a));});}else{_0x7c62d9[_0x3385('0x3a')]+=0x1;ut[_0x3385('0x122')](_0x4a18c6);rpcDb[_0x3385('0x123')](_0x4a18c6,_0x3385('0x124'));delete _0x39f8fa[_0x3385('0x16')][_0x10a975];_0x1524e5(ut[_0x3385('0x62')](_0x3385('0x125'),_0x43d584,_0x32c72a));}});};Preview[_0x3385('0x10')][_0x3385('0x9f')]=function(_0x1db259){return!_[_0x3385('0x6f')](_0x1db259)&&!_[_0x3385('0x6f')](_0x1db259[_0x3385('0x2a')])&&!_[_0x3385('0x6f')](_0x1db259['active'])&&_0x1db259['active']&&!_[_0x3385('0x6f')](this['trunks'][util['format'](_0x3385('0x126'),_0x1db259[_0x3385('0x2a')])])&&!_['isNil'](this[_0x3385('0x15')][util[_0x3385('0x58')](_0x3385('0x126'),_0x1db259['name'])]['status'])&&(this['trunks'][util['format'](_0x3385('0x126'),_0x1db259[_0x3385('0x2a')])][_0x3385('0x7a')]===_0x3385('0x127')||this['trunks'][util[_0x3385('0x58')](_0x3385('0x126'),_0x1db259[_0x3385('0x2a')])]['status']===_0x3385('0x128'));};Preview[_0x3385('0x10')][_0x3385('0x129')]=function(_0x4353b7,_0xedaea5){var _0x2a4611=this;return new Promise(function(_0x2ae10c,_0x5dc368){_0x2a4611[_0x3385('0x12a')](_0x4353b7,_0xedaea5)[_0x3385('0x8c')](function(_0x5bfc15){_0x2ae10c(_['pick'](_0x5bfc15,['message']));})['catch'](function(_0x22684b){if(_0x22684b[_0x3385('0x12b')]){rpcDb['unlockContact'](_0x4353b7);}if(_0x22684b[_0x3385('0x53')]){rpcDb[_0x3385('0x8f')](_0x4353b7);}_0x5dc368(_['pick'](_0x22684b,['message']));});});};Preview[_0x3385('0x10')][_0x3385('0x12a')]=function(_0xefc700,_0x1b7023){var _0x1490bd=this;return new Promise(function(_0x2fa024,_0x5dce25){var _0x54b416,_0x165f08;rpcDb[_0x3385('0x12c')](_0xefc700)['then'](function(_0x4f055b){if(!_[_0x3385('0x6f')](_0x4f055b[0x0])){_0x165f08=_0x4f055b[0x0][_0x3385('0x12d')]?![]:!![];_0x54b416=_0x4f055b[0x0]['recallme']?!![]:![];_0x54b416=_0x1b7023?!![]:_0x54b416;}var _0x34daa9=_0x1490bd[_0x3385('0x12e')](_0x4f055b);if(_0x34daa9[_0x3385('0x12f')]){rpcDb[_0x3385('0x130')](_[_0x3385('0x74')](_0x4f055b[0x0],[_0x3385('0x77'),_0x3385('0x116')]))[_0x3385('0x8c')](function(_0x4bd24b){_0x1490bd[_0x3385('0x114')](_0x4bd24b,_0x4f055b[0x0],_0x1b7023,_0x165f08,_0x54b416)[_0x3385('0x8c')](function(_0x3741ae){_0x2fa024(_0x3741ae);})['catch'](function(_0x288817){_0x5dce25(_0x288817);});})[_0x3385('0x7b')](function(_0x26b5d2){ut[_0x3385('0x64')](_0x3385('0x131'),_0x26b5d2);_0x5dce25(ut[_0x3385('0x62')](_0x3385('0x132'),_0x165f08,_0x54b416));});}else{_0x5dce25(ut[_0x3385('0x62')](_0x34daa9[_0x3385('0x62')],_0x165f08,_0x54b416));}})[_0x3385('0x7b')](function(_0x380dd5){ut[_0x3385('0x64')]('[Preview][getContactPreview]',_0x380dd5);_0x5dce25(ut[_0x3385('0x62')](_0x3385('0x132'),![],!![]));});});};Preview[_0x3385('0x10')][_0x3385('0x12e')]=function(_0x3f9d8d){if(_[_0x3385('0x6f')](_0x3f9d8d)||_[_0x3385('0x119')](_0x3f9d8d)||!_['isNil'](_0x3f9d8d[0x0]['Agent'])&&_['isNil'](_0x3f9d8d[0x0][_0x3385('0x8a')][_0x3385('0x2a')])){ut[_0x3385('0x64')]('[Preview][validateContact][Empty\x20Contact]',_0x3f9d8d);return{'isValid':![],'message':_0x3385('0x133')};}var _0x28777e=this[_0x3385('0x13')][_0x3f9d8d[0x0][_0x3385('0x71')]['name']];_0x28777e[_0x3385('0x62')]=_0x3385('0xa2');if(_[_0x3385('0x6f')](_0x28777e)){ut['logger'](_0x3385('0x134'),_0x28777e);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x28777e[_0x3385('0x52')])){ut[_0x3385('0x64')](_0x3385('0x135'),_0x3385('0x136')+_0x28777e[_0x3385('0x2a')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x3385('0x9f')](_0x28777e[_0x3385('0xa0')])){ut['logger'](_0x3385('0x135'),_0x28777e['name']+_0x3385('0x137'));return{'isValid':![],'message':_0x3385('0x138')};}}if(!ut[_0x3385('0x9d')](_0x28777e[_0x3385('0x9e')])){ut['logger'](_0x3385('0x139'),_0x28777e[_0x3385('0x2a')]+_0x3385('0x13a'));return{'isValid':![],'message':_0x3385('0x136')+_0x28777e[_0x3385('0x2a')]+_0x3385('0x13a')};}return{'isValid':!![],'message':_0x3385('0x13b')};};Preview[_0x3385('0x10')][_0x3385('0x11a')]=function(_0x614c71,_0x441d35,_0x2e72d7,_0x126e9f){var _0x4aa412=this;return new Promise(function(_0x48d691,_0x29cc9b){var _0x2ef857=_0x614c71['uniqueid'];var _0xee9dd5=_0x4aa412[_0x3385('0x9f')](_0x441d35[_0x3385('0x52')])?util[_0x3385('0x58')](_0x3385('0x13c'),_0x441d35[_0x3385('0x52')][_0x3385('0x2a')],_[_0x3385('0x6f')](_0x441d35[_0x3385('0x37')])?'':_0x441d35[_0x3385('0x37')][_0x3385('0x13d')]()||'',_0x441d35[_0x3385('0x13e')]>0x0?_0x2e72d7[_0x3385('0x116')][_0x3385('0x13f')](_0x441d35[_0x3385('0x13e')]):_0x2e72d7['phone']):util[_0x3385('0x58')]('SIP/%s/%s%s',_[_0x3385('0x6f')](_0x441d35['TrunkBackup'])?_0x441d35['Trunk'][_0x3385('0x2a')]:_0x441d35['TrunkBackup'][_0x3385('0x2a')],_[_0x3385('0x6f')](_0x441d35[_0x3385('0x37')])?'':_0x441d35[_0x3385('0x37')][_0x3385('0x13d')]()||'',_0x441d35[_0x3385('0x13e')]>0x0?_0x2e72d7[_0x3385('0x116')][_0x3385('0x13f')](_0x441d35['dialCutDigit']):_0x2e72d7['phone']);var _0x337638=_0x4aa412['isTrunkReachable'](_0x441d35[_0x3385('0x52')])?ut[_0x3385('0x140')](_0x441d35['Trunk'][_0x3385('0x54')],_0x441d35['dialOriginateCallerIdName'],_0x441d35[_0x3385('0x141')]>0x0?ut['getCallerIdRandom'](_0x441d35[_0x3385('0x36')],_0x441d35['dialRandomLastDigitCallerIdNumber']):_0x441d35['dialOriginateCallerIdNumber']):ut[_0x3385('0x140')](_[_0x3385('0x6f')](_0x441d35[_0x3385('0xa0')])?_0x441d35[_0x3385('0x52')][_0x3385('0x54')]:_0x441d35[_0x3385('0xa0')][_0x3385('0x54')],_0x441d35[_0x3385('0x35')],_0x441d35[_0x3385('0x141')]>0x0?ut[_0x3385('0x142')](_0x441d35[_0x3385('0x36')],_0x441d35[_0x3385('0x141')]):_0x441d35[_0x3385('0x36')]);if(_0x337638){_0x614c71[_0x3385('0x143')]=ut[_0x3385('0x144')](_0x337638);_0x614c71[_0x3385('0x145')]=ut[_0x3385('0x146')](_0x337638);}var _0x3ccc49=ut[_0x3385('0x147')](_0x441d35,_0x2e72d7,_0xee9dd5,_0x337638,_0x2ef857,_0x614c71);_[_0x3385('0x148')](_0x614c71,ut['toLowerVariables'](_0x3ccc49));_0x614c71[_0x3385('0x90')]=moment()['format'](_0x3385('0x91'));_0x441d35[_0x3385('0x149')]=_0x3ccc49;ami[_0x3385('0x79')](ut[_0x3385('0x14a')](_0x614c71,_0x441d35,_0x3ccc49,_0x614c71[_0x3385('0xd4')],_0x126e9f))[_0x3385('0x8c')](function(_0x1f0876){_0x441d35[_0x3385('0x60')]+=0x1;logger[_0x3385('0x5a')]('[originated][increment]',_0x2ef857,'\x20Queue',_0x441d35[_0x3385('0x2a')],_0x3385('0x10f'),_0x441d35[_0x3385('0x60')]);_0x48d691(_0x1f0876);})['catch'](function(_0xf3e9c8){ut[_0x3385('0x105')](_0x614c71,0xe,'OriginateError');rpcDb[_0x3385('0x109')](_0x614c71,_0x3385('0x14b'));_0x29cc9b(_0xf3e9c8);});});};Preview[_0x3385('0x10')][_0x3385('0x21')]=function(_0x5896e5){if(this[_0x3385('0x16')][_0x5896e5[_0x3385('0xb5')]]){this[_0x3385('0x16')][_0x5896e5['linkedid']][_0x3385('0x14c')]=_0x5896e5['channel'];}};Preview[_0x3385('0x10')][_0x3385('0x1a')]=function(_0xaaff7d){var _0x2e2c05=this;var _0x3e0199=this['actions'][_0xaaff7d[_0x3385('0x14d')]];if(_0x3e0199){if(_0x3e0199['lookAgent']&&this['agents'][_0x3e0199[_0x3385('0x118')]]){ut['logLookAgent'](_0x3e0199,this[_0x3385('0x17')][_0x3e0199[_0x3385('0x118')]][_0x3385('0x2a')],this[_0x3385('0x17')][_0x3e0199['lookAgent']]['id']);}var _0x3b51f7=_[_0x3385('0x14e')](_0x3e0199);_0x3b51f7['responsetime']=moment()[_0x3385('0x58')](_0x3385('0x91'));var _0x1ce397=_0x2e2c05['campaignsPreview'][_0x3e0199['queue']];if(ut[_0x3385('0x14f')](_0xaaff7d['response'])){if(_0x3e0199[_0x3385('0xb4')]){rpcDb[_0x3385('0x150')](_0x3e0199['idContact']);}if(_0x3e0199[_0x3385('0xd4')]){rpcDb['disableContact'](_0x3e0199[_0x3385('0xb7')]);}ami[_0x3385('0x27')](_0x3385('0x151'),ut[_0x3385('0xa8')](_0x3e0199,_0x3385('0x152'),this[_0x3385('0x13')][_0x3e0199[_0x3385('0x72')]]));this['callProgressDetectingAgent'](_0x3b51f7,_0x1ce397,_0xaaff7d);}else{_0x3e0199[_0x3385('0x90')]=moment()[_0x3385('0x58')](_0x3385('0x91'));ut['logAgent'](_0x3b51f7,0x4,'Answer');rpcDb[_0x3385('0x109')](_0x3b51f7,_0x3385('0x153'));}}};Preview[_0x3385('0x10')][_0x3385('0x154')]=function(_0x4509a2){var _0x14a91c=this['actions'][_0x4509a2[_0x3385('0xb5')]];var _0x4bb76e;if(_0x14a91c){_0x4bb76e=this[_0x3385('0x13')][_0x14a91c[_0x3385('0x72')]];logger[_0x3385('0x5a')](_0x3385('0x155'),_0x4509a2['linkedid'],_0x3385('0xbd'),_0x4bb76e[_0x3385('0x2a')],_0x3385('0xbe'),_0x4bb76e['pTalking']);}if(this[_0x3385('0x16')][_0x4509a2['linkedid']]&&_0x4509a2['linkedid']!==_0x4509a2[_0x3385('0xbc')]){if(_0x4509a2['cause']==='16'&&this[_0x3385('0x16')][_0x4509a2[_0x3385('0xb5')]][_0x3385('0x73')]){this[_0x3385('0xa3')](_0x4509a2,_0x4509a2[_0x3385('0xb5')],_0x4509a2['cause']);}else if(this[_0x3385('0x16')][_0x4509a2[_0x3385('0xb5')]]['dialAnswer']){logger[_0x3385('0x5a')](_0x3385('0x156'),_0x4509a2[_0x3385('0xb5')],_0x4509a2[_0x3385('0x157')],_0x3385('0xbd'),_0x4bb76e[_0x3385('0x2a')],'pTalking:\x20',_0x4bb76e[_0x3385('0x2e')]);this[_0x3385('0xa3')](_0x4509a2,_0x4509a2[_0x3385('0xb5')],_0x4509a2['cause']);}}else if(_0x14a91c&&_[_0x3385('0x6f')](_0x14a91c[_0x3385('0x158')])&&_0x4bb76e['dialQueueProject']&&_0x4509a2['linkedid']===_0x4509a2['uniqueid']&&_[_0x3385('0x6f')](_0x4509a2['reason'])&&_0x4509a2['cause']==='16'&&_0x4509a2[_0x3385('0x159')]==='6'&&_[_0x3385('0x102')](_0x14a91c['transfer'])){if(_0x14a91c[_0x3385('0xb4')]){rpcDb[_0x3385('0x150')](_0x14a91c[_0x3385('0xb7')]);}if(_0x14a91c[_0x3385('0xd4')]){rpcDb[_0x3385('0x8f')](_0x14a91c[_0x3385('0xb7')]);}_0x4509a2[_0x3385('0x104')]='22';this[_0x3385('0x101')](_0x14a91c,_0x4bb76e,_0x4509a2);}else if(_0x14a91c&&_0x14a91c[_0x3385('0x15a')]){if(_0x4509a2[_0x3385('0x157')]==='16'&&this['actions'][_0x4509a2[_0x3385('0xb5')]][_0x3385('0x73')]){logger[_0x3385('0x5a')]('[syncHangup][talking][transfer]',_0x4509a2['linkedid'],_0x4509a2[_0x3385('0x157')],_0x3385('0xbd'),_0x4bb76e['name'],_0x3385('0xbe'),_0x4bb76e[_0x3385('0x2e')]);this[_0x3385('0xa3')](_0x4509a2,_0x4509a2[_0x3385('0xb5')],_0x4509a2[_0x3385('0x157')]);}else if(this[_0x3385('0x16')][_0x4509a2['linkedid']][_0x3385('0x73')]){logger[_0x3385('0x5a')](_0x3385('0x156'),_0x4509a2[_0x3385('0xb5')],_0x4509a2[_0x3385('0x157')],_0x3385('0xbd'),_0x4bb76e[_0x3385('0x2a')],_0x3385('0xbe'),_0x4bb76e['pTalking']);this[_0x3385('0xa3')](_0x4509a2,_0x4509a2[_0x3385('0xb5')],_0x4509a2[_0x3385('0x157')]);}}};Preview[_0x3385('0x10')][_0x3385('0x15b')]=function(_0x1ef9fd){if(this['actions'][_0x1ef9fd[_0x3385('0x100')]]&&_0x1ef9fd[_0x3385('0x100')]!==_0x1ef9fd[_0x3385('0x15c')]){this[_0x3385('0xa3')](_0x1ef9fd,_0x1ef9fd[_0x3385('0x100')],_0x1ef9fd['dialstatus']);}};Preview[_0x3385('0x10')][_0x3385('0x1e')]=function(_0x54d04d){if(this['actions'][_0x54d04d[_0x3385('0xb5')]]&&_0x54d04d[_0x3385('0xb5')]!==_0x54d04d[_0x3385('0xbc')]&&!this[_0x3385('0x16')][_0x54d04d['linkedid']][_0x3385('0x73')]){if(_0x54d04d[_0x3385('0x157')]==='1'){this[_0x3385('0xa3')](_0x54d04d,_0x54d04d['linkedid'],_0x54d04d[_0x3385('0x157')]);}}};Preview[_0x3385('0x10')][_0x3385('0x15d')]=function(_0x11cff6,_0x4ab82c,_0x539225){if(this[_0x3385('0x16')][_0x11cff6]){if(_[_0x3385('0x6f')](this[_0x3385('0x16')][_0x11cff6][_0x3385('0x149')])){this[_0x3385('0x16')][_0x11cff6][_0x3385('0x149')]={};}this[_0x3385('0x16')][_0x11cff6][_0x3385('0x149')][_0x4ab82c]=_0x539225;}};Preview[_0x3385('0x10')][_0x3385('0x23')]=function(_0x476d59){try{if(!_[_0x3385('0x6f')](_0x476d59)){if(ut[_0x3385('0x15e')](_[_0x3385('0x15f')](_0x476d59[_0x3385('0x160')])[0x0])){this['addVariable'](_0x476d59[_0x3385('0xbc')],_['keys'](_0x476d59[_0x3385('0x160')])[0x0],_0x476d59[_0x3385('0x161')]);}}}catch(_0x4fd73e){logger[_0x3385('0x162')](_0x3385('0x163'),util[_0x3385('0x164')](_0x4fd73e,{'showHidden':![],'depth':null}));}};Preview[_0x3385('0x10')][_0x3385('0x24')]=function(_0x38c77e){if(_0x38c77e){if(this[_0x3385('0x16')][_0x38c77e['transfertargetlinkedid']]){this[_0x3385('0x16')][_0x38c77e[_0x3385('0x165')]][_0x3385('0x15a')]=!![];}}};Preview[_0x3385('0x10')][_0x3385('0x26')]=function(_0x12867b){if(_0x12867b){if(this[_0x3385('0x16')][_0x12867b[_0x3385('0x166')]]){this[_0x3385('0x16')][_0x12867b[_0x3385('0x166')]][_0x3385('0x15a')]=!![];}}};module[_0x3385('0x167')]=Preview;
\ No newline at end of file
index 80dfa25..680c32a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5ce=['../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','then','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird'];(function(_0x3d86f5,_0x257914){var _0x2d6881=function(_0x2d912e){while(--_0x2d912e){_0x3d86f5['push'](_0x3d86f5['shift']());}};_0x2d6881(++_0x257914);}(_0xc5ce,0xa9));var _0xec5c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc5ce[_0x4b369d];return _0x571a98;};'use strict';var util=require(_0xec5c('0x0'));var BPromise=require(_0xec5c('0x1'));var logger=require(_0xec5c('0x2'))(_0xec5c('0x3'));var _=require(_0xec5c('0x4'));var cmHopper=require(_0xec5c('0x5'));var cmHopperFinal=require(_0xec5c('0x6'));var cmHopperHistory=require(_0xec5c('0x7'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xec5c('0x8'));var agentReportPreview=require(_0xec5c('0x9'));var voiceQueueReport=require(_0xec5c('0xa'));function loggerCatch(_0x1e397b){return function(_0x31baf3){logger[_0xec5c('0xb')](_0x1e397b,util[_0xec5c('0xc')](_0x31baf3,{'showHidden':![],'depth':null}));};}function create(_0x519bb9){return BPromise['resolve']()[_0xec5c('0xd')](cmHopperHistory[_0xec5c('0xe')](_0x519bb9))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x10')));}function createAgent(_0x4174f6){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](agentReportPreview[_0xec5c('0xe')](_0x4174f6))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x10')));}function moveContact(_0x5b1cb0){return BPromise[_0xec5c('0x11')]()['then'](cmHopper['moveContactManagedDialer'](_0x5b1cb0,!![]))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x12')));}exports[_0xec5c('0x13')]=function(_0x10f30f){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopperBlack[_0xec5c('0x13')](_0x10f30f))['catch'](loggerCatch(_0xec5c('0x14')));};exports[_0xec5c('0x15')]=function(_0x36ecc0){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopper[_0xec5c('0x15')](_0x36ecc0))['catch'](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0xdaa8d6,_0x9801d3){create(_0xdaa8d6)['catch'](loggerCatch(_0x9801d3));moveContact(_0xdaa8d6)[_0xec5c('0xf')](loggerCatch(_0x9801d3));};exports[_0xec5c('0x16')]=function(_0x1ac651,_0x2a200b){createAgent(_0x1ac651)[_0xec5c('0xf')](loggerCatch(_0x2a200b));};exports[_0xec5c('0x17')]=function(_0x2e8027,_0x508989){create(_0x2e8027)[_0xec5c('0xf')](loggerCatch(_0x508989));};exports[_0xec5c('0x18')]=function(_0x4b8846,_0x452275){moveContact(_0x4b8846)[_0xec5c('0xf')](loggerCatch(_0x452275));};exports[_0xec5c('0x19')]=function(_0x3c26ca,_0x38c163,_0x5beb79){if(_0x38c163){_0x3c26ca[_0xec5c('0x1a')]=null;}if(_0x5beb79){_0x3c26ca[_0xec5c('0x1b')]=![];}return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopper['rescheduleContact'](_0x3c26ca))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x1c')));};exports[_0xec5c('0x1d')]=function(_0x509641){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopper[_0xec5c('0x1d')](_0x509641))[_0xec5c('0xf')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x263ff4){return BPromise[_0xec5c('0x11')]()['then'](cmHopper[_0xec5c('0x1e')]({'UserId':null},_0x263ff4,0x1))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x1f')));};exports[_0xec5c('0x20')]=function(_0x5b3c8e){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopper[_0xec5c('0x1e')]({'active':![]},_0x5b3c8e,0x1))[_0xec5c('0xf')](loggerCatch('[activeContact]\x20'));};exports[_0xec5c('0x21')]=function(_0x170f14){var _0x1e5dd9={};_0x1e5dd9['type']=_0x170f14['type'];_0x1e5dd9[_0xec5c('0x22')]=_0x170f14['uniqueid'];_0x1e5dd9['calleridnum']=_0x170f14[_0xec5c('0x23')];_0x1e5dd9['calleridname']=_0x170f14[_0xec5c('0x24')];_0x1e5dd9[_0xec5c('0x25')]=_0x170f14[_0xec5c('0x25')];_0x1e5dd9[_0xec5c('0x26')]=_0x170f14[_0xec5c('0x27')];_0x1e5dd9[_0xec5c('0x28')]=_0x170f14['answertime'];_0x1e5dd9[_0xec5c('0x29')]=0x1;_0x1e5dd9[_0xec5c('0x2a')]=_0x170f14['endtime'];_0x1e5dd9[_0xec5c('0x2b')]=_0x170f14['membername'];_0x1e5dd9[_0xec5c('0x2c')]=_0xec5c('0x2d');_0x1e5dd9[_0xec5c('0x2e')]=_0xec5c('0x2f');_0x1e5dd9[_0xec5c('0x30')]=0x0;_0x1e5dd9[_0xec5c('0x31')]=0x1;_0x1e5dd9[_0xec5c('0x32')]=_0x170f14['membername'];_0x1e5dd9[_0xec5c('0x33')]=_0xec5c('0x34');return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](voiceQueueReport['create'](_0x1e5dd9))[_0xec5c('0xf')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0xec5c('0x35')]=function(_0x205529,_0x489656){return BPromise[_0xec5c('0x11')]()['then'](cmHopper[_0xec5c('0x35')](_0x205529,_0x489656))[_0xec5c('0xf')](loggerCatch(_0xec5c('0x36')));};exports[_0xec5c('0x37')]=function(_0x426b88){return BPromise[_0xec5c('0x11')]()[_0xec5c('0xd')](cmHopper['rescheduleContact'](_0x426b88,!![],!![]))['catch'](loggerCatch(_0xec5c('0x38')));};
\ No newline at end of file
+var _0x1533=['COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','util','bluebird','preview','lodash','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','exten','xcally-motion-preview','queuecallerexitreason'];(function(_0x459a0b,_0x3cb7fe){var _0x8baee5=function(_0x358bff){while(--_0x358bff){_0x459a0b['push'](_0x459a0b['shift']());}};_0x8baee5(++_0x3cb7fe);}(_0x1533,0x71));var _0x3153=function(_0x279614,_0x4cce43){_0x279614=_0x279614-0x0;var _0x2a331c=_0x1533[_0x279614];return _0x2a331c;};'use strict';var util=require(_0x3153('0x0'));var BPromise=require(_0x3153('0x1'));var logger=require('../../../config/logger')(_0x3153('0x2'));var _=require(_0x3153('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x3153('0x4'));var cmHopperBlack=require(_0x3153('0x5'));var voiceQueueRt=require(_0x3153('0x6'));var agentReportPreview=require(_0x3153('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x51c65d){return function(_0x19d16e){logger[_0x3153('0x8')](_0x51c65d,util[_0x3153('0x9')](_0x19d16e,{'showHidden':![],'depth':null}));};}function create(_0x44de18){return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](cmHopperHistory[_0x3153('0xc')](_0x44de18))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x3c356f){return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](agentReportPreview[_0x3153('0xc')](_0x3c356f))[_0x3153('0xd')](loggerCatch(_0x3153('0xe')));}function moveContact(_0x590563){return BPromise['resolve']()[_0x3153('0xb')](cmHopper[_0x3153('0xf')](_0x590563,!![]))[_0x3153('0xd')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x3153('0x10')]=function(_0x5baf30){return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](cmHopperBlack[_0x3153('0x10')](_0x5baf30))[_0x3153('0xd')](loggerCatch(_0x3153('0x11')));};exports[_0x3153('0x12')]=function(_0x5363fe){return BPromise[_0x3153('0xa')]()['then'](cmHopper[_0x3153('0x12')](_0x5363fe))['catch'](loggerCatch(_0x3153('0x13')));};exports[_0x3153('0xc')]=function(_0xa34b2c,_0x457f4f){create(_0xa34b2c)[_0x3153('0xd')](loggerCatch(_0x457f4f));moveContact(_0xa34b2c)['catch'](loggerCatch(_0x457f4f));};exports[_0x3153('0x14')]=function(_0x3a8500,_0x2055e7){createAgent(_0x3a8500)[_0x3153('0xd')](loggerCatch(_0x2055e7));};exports[_0x3153('0x15')]=function(_0x2e7522,_0x42d100){create(_0x2e7522)['catch'](loggerCatch(_0x42d100));};exports[_0x3153('0x16')]=function(_0x4d39e5,_0x3ba998){moveContact(_0x4d39e5)['catch'](loggerCatch(_0x3ba998));};exports[_0x3153('0x17')]=function(_0x3d459c,_0x59afe2,_0x525df8){if(_0x59afe2){_0x3d459c[_0x3153('0x18')]=null;}if(_0x525df8){_0x3d459c['active']=![];}return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](cmHopper[_0x3153('0x17')](_0x3d459c))[_0x3153('0xd')](loggerCatch(_0x3153('0x19')));};exports[_0x3153('0x1a')]=function(_0x440da8){return BPromise[_0x3153('0xa')]()['then'](cmHopper['countReScheduled'](_0x440da8))['catch'](loggerCatch(_0x3153('0x1b')));};exports['unlockContact']=function(_0x36640f){return BPromise['resolve']()[_0x3153('0xb')](cmHopper[_0x3153('0x1c')]({'UserId':null},_0x36640f,0x1))[_0x3153('0xd')](loggerCatch(_0x3153('0x1d')));};exports[_0x3153('0x1e')]=function(_0x116906){return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](cmHopper[_0x3153('0x1c')]({'active':![]},_0x116906,0x1))[_0x3153('0xd')](loggerCatch(_0x3153('0x1f')));};exports[_0x3153('0x20')]=function(_0x8395d3){var _0x220ae1={};_0x220ae1[_0x3153('0x21')]=_0x8395d3[_0x3153('0x21')];_0x220ae1[_0x3153('0x22')]=_0x8395d3[_0x3153('0x22')];_0x220ae1[_0x3153('0x23')]=_0x8395d3['calleridnum'];_0x220ae1[_0x3153('0x24')]=_0x8395d3[_0x3153('0x24')];_0x220ae1[_0x3153('0x25')]=_0x8395d3['queue'];_0x220ae1[_0x3153('0x26')]=_0x8395d3[_0x3153('0x27')];_0x220ae1[_0x3153('0x28')]=_0x8395d3[_0x3153('0x27')];_0x220ae1[_0x3153('0x29')]=0x1;_0x220ae1[_0x3153('0x2a')]=_0x8395d3[_0x3153('0x2b')];_0x220ae1[_0x3153('0x2c')]=_0x8395d3[_0x3153('0x2d')];_0x220ae1['context']='from-sip';_0x220ae1[_0x3153('0x2e')]=_0x3153('0x2f');_0x220ae1['holdtime']=0x0;_0x220ae1['assigned']=0x1;_0x220ae1['lastAssignedTo']=_0x8395d3[_0x3153('0x2d')];_0x220ae1[_0x3153('0x30')]=_0x3153('0x31');return BPromise[_0x3153('0xa')]()[_0x3153('0xb')](voiceQueueReport[_0x3153('0x32')](_0x220ae1))[_0x3153('0xd')](loggerCatch(_0x3153('0x33')));};exports['getContactRecallMe']=function(_0x4fc3a6,_0x125676){return BPromise['resolve']()['then'](cmHopper[_0x3153('0x34')](_0x4fc3a6,_0x125676))[_0x3153('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3153('0x35')]=function(_0x38261b){return BPromise[_0x3153('0xa')]()['then'](cmHopper['rescheduleContact'](_0x38261b,!![],!![]))[_0x3153('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index 77e16b8..dd34166 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa16=['variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','127.0.0.1','milliseconds','diff','error','inspect','logger','loggerError','logger2','info','message','getCallerId','string','isUndefined','\x22%s\x22\x20<%s>','isEmpty','isActive','isNil','addVariables','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','updatedAt','%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','responsetime','endtime','logAgent','state','ringtime','logLookAgent','membername','logCustomer','answertime','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','interface','motionChannel','voice','mandatoryDisposition','buildAcw','queue','agentReadyId','not_inuse','status','push','getDiff','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','rtpaudioqosloss','bridgepeer','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xaa16,0x131));var _0x6aa1=function(_0x38c20b,_0x2b832b){_0x38c20b=_0x38c20b-0x0;var _0x3f37b5=_0xaa16[_0x38c20b];return _0x3f37b5;};'use strict';var util=require(_0x6aa1('0x0'));var _=require(_0x6aa1('0x1'));var moment=require(_0x6aa1('0x2'));var logger=require(_0x6aa1('0x3'))(_0x6aa1('0x4'));var ipAgi=process[_0x6aa1('0x5')]['XCALLY_IP_AGI']||_0x6aa1('0x6');function getSeconds(_0x58747f,_0x127712){var _0x17efbb=moment(_0x58747f)['milliseconds'](0x0);var _0x4fb6ce=moment(_0x127712)[_0x6aa1('0x7')](0x0);return _0x17efbb[_0x6aa1('0x8')](_0x4fb6ce,'seconds');}exports['loggerCatch']=function(_0x25b1d7){return function(_0x1dd56f){logger[_0x6aa1('0x9')](_0x25b1d7,util[_0x6aa1('0xa')](_0x1dd56f,{'showHidden':![],'depth':null}));};};exports[_0x6aa1('0xb')]=function(_0x3d2afe,_0x23a255){logger['info'](_0x3d2afe,util[_0x6aa1('0xa')](_0x23a255,{'showHidden':![],'depth':null}));};exports[_0x6aa1('0xc')]=function(_0x36ed40,_0x50b5c1){logger['error'](_0x36ed40,util['inspect'](_0x50b5c1,{'showHidden':![],'depth':null}));};exports[_0x6aa1('0xd')]=function(_0x2c695a){return function(_0x30ab9a){logger[_0x6aa1('0xe')](_0x2c695a,util[_0x6aa1('0xa')](_0x30ab9a,{'showHidden':![],'depth':null}));};};exports[_0x6aa1('0xf')]=function(_0x24598c,_0x12fd27,_0x4988f1){return{'message':_0x24598c,'unlock':_0x12fd27,'active':_0x4988f1};};exports[_0x6aa1('0x10')]=function(_0x5a5737,_0x53a4b4,_0x1cb52f){if(!_['isUndefined'](_0x1cb52f)&&_0x6aa1('0x11')===typeof _0x1cb52f&&!_['isEmpty'](_0x1cb52f)){if(!_[_0x6aa1('0x12')](_0x53a4b4)&&_0x6aa1('0x11')===typeof _0x53a4b4&&!_['isEmpty'](_0x53a4b4)){return util['format'](_0x6aa1('0x13'),_0x53a4b4,_0x1cb52f);}return util['format'](_0x6aa1('0x13'),_0x1cb52f,_0x1cb52f);}if(!_['isUndefined'](_0x5a5737)&&_0x6aa1('0x11')===typeof _0x5a5737&&!_[_0x6aa1('0x14')](_0x5a5737)){return _0x5a5737;}return'\x22\x22\x20<>';};exports[_0x6aa1('0x15')]=function(_0x11fb3d){if(_[_0x6aa1('0x16')](_0x11fb3d)){return![];}return _0x11fb3d;};exports[_0x6aa1('0x17')]=function(_0x41d585,_0x2b592d,_0x47ec25,_0x10a932,_0x5a275d,_0x5b2a0f){var _0x2c4d00={'XMD-QUEUE':_0x2b592d[_0x6aa1('0x18')]?_0x2b592d[_0x6aa1('0x18')][_0x6aa1('0x19')]:'','XMD-CALLERID':_0x10a932,'XMD-CALLERID-PREVIEW':_0x5b2a0f?util[_0x6aa1('0x1a')](_0x6aa1('0x13'),_0x5b2a0f[_0x6aa1('0x1b')],_0x5b2a0f[_0x6aa1('0x1c')]):_0x10a932,'XMD-DIALID':_0x5a275d,'XMD-CONTACTID':_0x2b592d[_0x6aa1('0x1d')],'XMD-CDRTYPE':_0x6aa1('0x1e'),'CALLERID(all)':_0x10a932,'XMD-VOICEQUEUEID':_0x2b592d[_0x6aa1('0x1f')],'XMD-DIALCHANNEL':_0x47ec25,'XMD-DIALTIMEOUT':_0x41d585[_0x6aa1('0x20')]||0x1e,'XMD-DIALOPTIONS':util[_0x6aa1('0x1a')](_0x6aa1('0x21'),_0x41d585[_0x6aa1('0x22')]?'g':'',_[_0x6aa1('0x14')](_0x41d585['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x41d585[_0x6aa1('0x23')]||'','XMD-AGI':_0x41d585[_0x6aa1('0x24')]?util[_0x6aa1('0x1a')]('\x22agi://%s/square,%s\x22',ipAgi,_0x41d585[_0x6aa1('0x24')]):_0x6aa1('0x25'),'XMD-AGIAFTER':_0x41d585[_0x6aa1('0x22')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x41d585[_0x6aa1('0x22')]):_0x6aa1('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x5b2a0f?_0x5b2a0f[_0x6aa1('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x5b2a0f?_0x5b2a0f[_0x6aa1('0x27')]:'','XMD-DESTINATION':_0x6aa1('0x28'),'SIPADDHEADER':_0x6aa1('0x29')};if(!_[_0x6aa1('0x14')](_0x41d585['monitor_format'])){_0x2c4d00[util['format']('%s',_0x6aa1('0x2a'))]=_0x41d585[_0x6aa1('0x2b')];_0x2c4d00[util['format']('%s',_0x6aa1('0x2c'))]=_0x5a275d;}if(_0x2b592d&&_0x2b592d[_0x6aa1('0x2d')]){for(var _0x4091d6 in _0x2b592d[_0x6aa1('0x2d')]){if(_0x2b592d['Contact'][_0x6aa1('0x2e')](_0x4091d6)){if(!_[_0x6aa1('0x16')](_0x2b592d[_0x6aa1('0x2d')][_0x4091d6])&&_0x4091d6!=='id'&&_0x4091d6!=='tags'&&_0x4091d6!=='createdAt'&&_0x4091d6!==_0x6aa1('0x2f')){_0x2c4d00[util[_0x6aa1('0x1a')](_0x6aa1('0x30'),_0x6aa1('0x31'),_[_0x6aa1('0x32')](_0x4091d6))]=_0x2b592d[_0x6aa1('0x2d')][_0x4091d6];}}}}return _0x2c4d00;};exports[_0x6aa1('0x33')]=function(_0x8f86ec){var _0x21253f={};for(var _0x1427b0 in _0x8f86ec){if(_0x8f86ec[_0x6aa1('0x2e')](_0x1427b0)){_0x21253f[util[_0x6aa1('0x1a')]('%s',_[_0x6aa1('0x34')](_0x1427b0))]=_0x8f86ec[_0x1427b0];}}return{'variables':_0x21253f};};exports[_0x6aa1('0x35')]=function(_0x806de9,_0x43cf2d){if(!_[_0x6aa1('0x16')](_0x806de9)){if(_0x806de9[_0x6aa1('0x2e')](_0x6aa1('0x36'))){if(_0x806de9['originated']>0x0){_0x806de9[_0x6aa1('0x36')]-=0x1;}else{logger[_0x6aa1('0x9')](_0x6aa1('0x37'),_0x43cf2d);}}}else{logger[_0x6aa1('0x9')](_0x6aa1('0x38'),_0x43cf2d);}};exports[_0x6aa1('0x39')]=function(_0x51773b){var _0x2159f9=moment()[_0x6aa1('0x1a')](_0x6aa1('0x3a'));_0x51773b['state']=0xd;_0x51773b[_0x6aa1('0x3b')]='Blacklist';_0x51773b['starttime']=_0x2159f9;_0x51773b[_0x6aa1('0x3c')]=_0x2159f9;_0x51773b[_0x6aa1('0x3d')]=_0x2159f9;};exports[_0x6aa1('0x3e')]=function(_0x5462d4,_0xf8035c,_0x518a9c){var _0x488c8e=moment()[_0x6aa1('0x1a')](_0x6aa1('0x3a'));_0x5462d4[_0x6aa1('0x3f')]=_0xf8035c;_0x5462d4['statedesc']=_0x518a9c;_0x5462d4[_0x6aa1('0x3c')]=_0x488c8e;_0x5462d4[_0x6aa1('0x40')]=getSeconds(_0x5462d4[_0x6aa1('0x3c')],_0x5462d4['starttime']);};exports[_0x6aa1('0x41')]=function(_0x57f083,_0x5248bd,_0xc5b40e){_0x57f083[_0x6aa1('0x42')]=_0x5248bd;_0x57f083['UserId']=_0xc5b40e;};exports[_0x6aa1('0x43')]=function(_0x591623,_0x26a142,_0x4fdc37){var _0x5aef92=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x591623['state']=_0x26a142;_0x591623[_0x6aa1('0x3b')]=_0x4fdc37;_0x591623['responsetime']=_0x591623['responsetime']?_0x591623['responsetime']:_0x5aef92;_0x591623[_0x6aa1('0x3d')]=_0x591623[_0x6aa1('0x3d')]?_0x591623[_0x6aa1('0x3d')]:_0x5aef92;_0x591623[_0x6aa1('0x40')]=getSeconds(_0x591623[_0x6aa1('0x3c')]||0x0,_0x591623['starttime']||0x0);_0x591623['talktime']=_0x591623[_0x6aa1('0x44')]?getSeconds(_0x591623['endtime'],_0x591623[_0x6aa1('0x44')]):0x0;};exports['isFailure']=function(_0x5aaa23){return _0x5aaa23===_0x6aa1('0x45');};exports['variablesAction']=function(_0x394a32,_0x14aa6e,_0x30d512,_0x52964a,_0x4d4920){var _0x561022=_0x52964a?_0x6aa1('0x46'):_0x394a32[_0x6aa1('0x1b')];_0x561022=_0x4d4920?_0x6aa1('0x47'):_0x561022;return{'actionid':_0x394a32[_0x6aa1('0x48')],'action':_0x6aa1('0x49'),'channel':_0x394a32[_0x6aa1('0x4a')],'callerid':util[_0x6aa1('0x1a')](_0x6aa1('0x13'),_0x561022,_0x394a32[_0x6aa1('0x1c')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x30d512,'timeout':(_0x14aa6e['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x394a32['uniqueid']};};exports['totalGlobal']=function(_0x219ba2){return _0x219ba2[_0x6aa1('0x4b')]+_0x219ba2[_0x6aa1('0x4c')]+_0x219ba2['countnoanswerretry']+_0x219ba2[_0x6aa1('0x4d')]+_0x219ba2[_0x6aa1('0x4e')];};exports[_0x6aa1('0x4f')]=function(_0x5d2a50){var _0xb3717a=_[_0x6aa1('0x50')](_0x5d2a50);_0xb3717a[_0x6aa1('0x3f')]=0xf;_0xb3717a[_0x6aa1('0x3b')]=_0x6aa1('0x51');return _0xb3717a;};exports[_0x6aa1('0x52')]=function(_0x3a11ae,_0x1ea75d,_0x6d1c30){var _0x17919f={};_0x17919f[_0x1ea75d]=_0x3a11ae[_0x1ea75d];_0x17919f[_0x6aa1('0x53')]=![];_0x17919f[_0x6aa1('0x54')]=moment()[_0x6aa1('0x55')](_0x6d1c30,_0x6aa1('0x56'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x17919f['ContactId']=_0x3a11ae[_0x6aa1('0x1d')];_0x17919f[_0x6aa1('0x57')]=_0x3a11ae[_0x6aa1('0x57')];_0x17919f[_0x6aa1('0x1f')]=_0x3a11ae['VoiceQueueId']||undefined;return _0x17919f;};exports[_0x6aa1('0x58')]=function(_0x361473,_0x18d35c){if(!_[_0x6aa1('0x16')](_0x361473)){if(_0x361473[_0x6aa1('0x59')]>0x0){_0x361473[_0x6aa1('0x59')]-=0x1;}else{logger[_0x6aa1('0x9')](_0x18d35c,_0x6aa1('0x5a'));}}else{logger[_0x6aa1('0x9')](_0x18d35c,_0x6aa1('0x5b'));}};exports[_0x6aa1('0x5c')]=function(_0x36ad48){if(_0x36ad48<=0x0){return!![];}return![];};function buildObj(_0x365500,_0x1efe5c,_0xb4ed59){_0x365500[_0x6aa1('0x5d')]=_0x1efe5c;_0x365500['name']=_0x365500['queue'];_0x365500[_0x6aa1('0x5e')]=_0x365500['channelAgent'];_0x365500[_0x6aa1('0x5f')]=_0x6aa1('0x60');if(_0xb4ed59){_0x365500['mandatoryDisposition']=_0xb4ed59[_0x6aa1('0x61')];}return _0x365500;}exports['buildObj']=buildObj;exports[_0x6aa1('0x62')]=function(_0x284816){var _0x1163a9={};_0x1163a9['queue']=_0x284816[_0x6aa1('0x63')];_0x1163a9[_0x6aa1('0x5e')]=_0x284816[_0x6aa1('0x4a')];_0x1163a9[_0x6aa1('0x48')]=_0x284816[_0x6aa1('0x48')];return _0x1163a9;};exports[_0x6aa1('0x64')]=function(_0x132fe2){var _0x968149=[];for(var _0xbf608e in _0x132fe2){if(_0x132fe2['hasOwnProperty'](_0xbf608e)){if(!_[_0x6aa1('0x16')](_0x132fe2[_0xbf608e])&&_0x132fe2[_0xbf608e]['state']===_0x6aa1('0x65')&&_0x132fe2[_0xbf608e][_0x6aa1('0x66')]==='reachable'){_0x968149[_0x6aa1('0x67')](_0x132fe2[_0xbf608e]['id']);}}}return _0x968149;};exports[_0x6aa1('0x68')]=function(_0x15b374){var _0x22c057=moment()[_0x6aa1('0x7')](0x0);var _0x3f5645=moment(_0x15b374)[_0x6aa1('0x7')](0x0);return _0x22c057[_0x6aa1('0x8')](_0x3f5645,'seconds');};exports['createBody']=function(_0x23cc74){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x23cc74['ContactId'],'ListId':_0x23cc74['ListId'],'VoiceQueueId':_0x23cc74[_0x6aa1('0x1f')]||undefined,'CampaignId':_0x23cc74[_0x6aa1('0x69')]||undefined};};exports[_0x6aa1('0x6a')]=function(_0x3236f0){if(_0x3236f0===_0x6aa1('0x48')||_0x3236f0===_0x6aa1('0x6b')||_0x3236f0==='queue'||_0x3236f0===_0x6aa1('0x6c')||_0x3236f0===_0x6aa1('0x6d')||_0x3236f0===_0x6aa1('0x6e')||_0x3236f0===_0x6aa1('0x42')||_0x3236f0==='channelAgent'||_0x3236f0===_0x6aa1('0x1b')||_0x3236f0===_0x6aa1('0x53')||_0x3236f0===_0x6aa1('0x1c')||_0x3236f0===_0x6aa1('0x54')||_0x3236f0==='countbusyretry'||_0x3236f0===_0x6aa1('0x4c')||_0x3236f0===_0x6aa1('0x6f')||_0x3236f0===_0x6aa1('0x70')||_0x3236f0===_0x6aa1('0x71')||_0x3236f0===_0x6aa1('0x72')||_0x3236f0===_0x6aa1('0x73')||_0x3236f0===_0x6aa1('0x74')||_0x3236f0===_0x6aa1('0x1d')||_0x3236f0===_0x6aa1('0x57')||_0x3236f0===_0x6aa1('0x75')||_0x3236f0===_0x6aa1('0x1f')||_0x3236f0==='sipcallid'||_0x3236f0===_0x6aa1('0x76')||_0x3236f0===_0x6aa1('0x77')||_0x3236f0===_0x6aa1('0x78')||_0x3236f0===_0x6aa1('0x79')||_0x3236f0===_0x6aa1('0x7a')||_0x3236f0===_0x6aa1('0x7b')||_0x3236f0===_0x6aa1('0x7c')||_0x3236f0===_0x6aa1('0x7d')||_0x3236f0===_0x6aa1('0x7e')||_0x3236f0==='xmd-contactid'||_0x3236f0===_0x6aa1('0x7f')||_0x3236f0==='xmd-callerid'||_0x3236f0===_0x6aa1('0x80')||_0x3236f0===_0x6aa1('0x81')||_0x3236f0===_0x6aa1('0x82')||_0x3236f0===_0x6aa1('0x83')||_0x3236f0===_0x6aa1('0x84')||_0x3236f0===_0x6aa1('0x85')||_0x3236f0==='rtpaudioqosloss'||_0x3236f0===_0x6aa1('0x86')||_0x3236f0==='rtpaudioqosrtt'||_0x3236f0===_0x6aa1('0x87')||_0x3236f0===_0x6aa1('0x82')||_0x3236f0===_0x6aa1('0x83')||_0x3236f0===_0x6aa1('0x84')||_0x3236f0===_0x6aa1('0x85')||_0x3236f0===_0x6aa1('0x88')||_0x3236f0===_0x6aa1('0x86')||_0x3236f0==='rtpaudioqosrtt'||_0x3236f0===_0x6aa1('0x87')||_0x3236f0===_0x6aa1('0x89')||_0x3236f0==='bridgepvtcallid'||_0x3236f0===_0x6aa1('0x3f')||_0x3236f0===_0x6aa1('0x3b')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x223555,_0xbadc1b){var _0x3cf3ad,_0x2e0d93,_0x40787f;if(_0xbadc1b<=0x0){_0xbadc1b=0x1;}_0x3cf3ad=new RegExp('\x5cw{0,'+_0xbadc1b+'}$');_0x2e0d93=Math[_0x6aa1('0x8a')](0xa,_0xbadc1b-0x1);_0x40787f=Math[_0x6aa1('0x8a')](0xa,_0xbadc1b)-0x1;return util[_0x6aa1('0x1a')]('%s',_[_0x6aa1('0x8b')](_0x223555,_0x3cf3ad,_[_0x6aa1('0x8c')](_0x2e0d93,_0x40787f)));};exports[_0x6aa1('0x8d')]=function(_0x5622bb){var _0x516b00=_0x5622bb[_0x6aa1('0x8e')](/"(.*?)"/);return _0x516b00?_0x516b00[0x1]:_0x5622bb;};exports[_0x6aa1('0x8f')]=function(_0x342562){var _0x186175=_0x342562['match'](/<(.*?)>/);return _0x186175?_0x186175[0x1]:_0x342562;};function buildNoAnswerEventPayload(_0x2f0514,_0x51e56a){var _0x3b8b35=buildObj(_0x2f0514,_0x6aa1('0x90'));if(!_[_0x6aa1('0x14')](_0x51e56a[_0x6aa1('0x91')])){Object[_0x6aa1('0x92')](_0x51e56a[_0x6aa1('0x91')])[_0x6aa1('0x93')](function(_0x2c444b){_0x3b8b35[_0x2c444b[_0x6aa1('0x94')]()]=_0x51e56a['variables'][_0x2c444b];});}return _0x3b8b35;}exports[_0x6aa1('0x95')]=buildNoAnswerEventPayload;
\ No newline at end of file
+var _0x17bb=['logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','responsetime','logAgent','starttime','logLookAgent','membername','UserId','logCustomer','endtime','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','timeout','countcongestionretry','countnoanswerretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','channelAgent','voice','mandatoryDisposition','buildAcw','push','getDiff','filterKey','type','campaigntype','dialAnswer','countbusyretry','countglobal','callback','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','buildNoAnswerEventPayload','util','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','logger2','isUndefined','string','\x22%s\x22\x20<%s>','format','isEmpty','isActive','isNil','addVariables','Queue','calleridname','calleridnum','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined'];(function(_0x3a9570,_0x5232a6){var _0x211ecb=function(_0x3af373){while(--_0x3af373){_0x3a9570['push'](_0x3a9570['shift']());}};_0x211ecb(++_0x5232a6);}(_0x17bb,0x17a));var _0xb17b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x17bb[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xb17b('0x0'));var _=require('lodash');var moment=require(_0xb17b('0x1'));var logger=require(_0xb17b('0x2'))(_0xb17b('0x3'));var ipAgi=process[_0xb17b('0x4')][_0xb17b('0x5')]||_0xb17b('0x6');function getSeconds(_0x20200d,_0x3bdc4c){var _0x5b5f6e=moment(_0x20200d)[_0xb17b('0x7')](0x0);var _0x49195e=moment(_0x3bdc4c)[_0xb17b('0x7')](0x0);return _0x5b5f6e[_0xb17b('0x8')](_0x49195e,_0xb17b('0x9'));}exports[_0xb17b('0xa')]=function(_0xdfd48f){return function(_0x379d23){logger['error'](_0xdfd48f,util[_0xb17b('0xb')](_0x379d23,{'showHidden':![],'depth':null}));};};exports[_0xb17b('0xc')]=function(_0x187836,_0xc2cb68){logger[_0xb17b('0xd')](_0x187836,util[_0xb17b('0xb')](_0xc2cb68,{'showHidden':![],'depth':null}));};exports[_0xb17b('0xe')]=function(_0x1151bf,_0x4d91a2){logger['error'](_0x1151bf,util[_0xb17b('0xb')](_0x4d91a2,{'showHidden':![],'depth':null}));};exports[_0xb17b('0xf')]=function(_0x1713c4){return function(_0x1adaed){logger[_0xb17b('0xd')](_0x1713c4,util['inspect'](_0x1adaed,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x223c0b,_0x370267,_0x1de964){return{'message':_0x223c0b,'unlock':_0x370267,'active':_0x1de964};};exports['getCallerId']=function(_0x9f9a5,_0x38587c,_0x54c4d1){if(!_[_0xb17b('0x10')](_0x54c4d1)&&_0xb17b('0x11')===typeof _0x54c4d1&&!_['isEmpty'](_0x54c4d1)){if(!_[_0xb17b('0x10')](_0x38587c)&&'string'===typeof _0x38587c&&!_['isEmpty'](_0x38587c)){return util['format'](_0xb17b('0x12'),_0x38587c,_0x54c4d1);}return util[_0xb17b('0x13')]('\x22%s\x22\x20<%s>',_0x54c4d1,_0x54c4d1);}if(!_[_0xb17b('0x10')](_0x9f9a5)&&_0xb17b('0x11')===typeof _0x9f9a5&&!_[_0xb17b('0x14')](_0x9f9a5)){return _0x9f9a5;}return'\x22\x22\x20<>';};exports[_0xb17b('0x15')]=function(_0x14f842){if(_[_0xb17b('0x16')](_0x14f842)){return![];}return _0x14f842;};exports[_0xb17b('0x17')]=function(_0x356c1f,_0x50b6f7,_0x33ed0d,_0x4eacc8,_0x3e9d5d,_0x389e4f){var _0x54d37c={'XMD-QUEUE':_0x50b6f7[_0xb17b('0x18')]?_0x50b6f7[_0xb17b('0x18')]['name']:'','XMD-CALLERID':_0x4eacc8,'XMD-CALLERID-PREVIEW':_0x389e4f?util[_0xb17b('0x13')](_0xb17b('0x12'),_0x389e4f[_0xb17b('0x19')],_0x389e4f[_0xb17b('0x1a')]):_0x4eacc8,'XMD-DIALID':_0x3e9d5d,'XMD-CONTACTID':_0x50b6f7['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4eacc8,'XMD-VOICEQUEUEID':_0x50b6f7[_0xb17b('0x1b')],'XMD-DIALCHANNEL':_0x33ed0d,'XMD-DIALTIMEOUT':_0x356c1f[_0xb17b('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0xb17b('0x1d'),_0x356c1f[_0xb17b('0x1e')]?'g':'',_[_0xb17b('0x14')](_0x356c1f[_0xb17b('0x1f')])?'':_0xb17b('0x20')),'XMD-DIALURL':_0x356c1f['dialPreviewUrl']||'','XMD-AGI':_0x356c1f[_0xb17b('0x21')]?util['format'](_0xb17b('0x22'),ipAgi,_0x356c1f[_0xb17b('0x21')]):_0xb17b('0x23'),'XMD-AGIAFTER':_0x356c1f[_0xb17b('0x1e')]?util[_0xb17b('0x13')](_0xb17b('0x22'),ipAgi,_0x356c1f['dialQueueProject2']):_0xb17b('0x23'),'XMD-ORIGINATECALLERIDNUM':_0x389e4f?_0x389e4f['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x389e4f?_0x389e4f['originatecalleridname']:'','XMD-DESTINATION':_0xb17b('0x24'),'SIPADDHEADER':_0xb17b('0x25')};if(!_[_0xb17b('0x14')](_0x356c1f[_0xb17b('0x1f')])){_0x54d37c[util['format']('%s',_0xb17b('0x26'))]=_0x356c1f[_0xb17b('0x1f')];_0x54d37c[util[_0xb17b('0x13')]('%s',_0xb17b('0x27'))]=_0x3e9d5d;}if(_0x50b6f7&&_0x50b6f7['Contact']){for(var _0x5d5049 in _0x50b6f7[_0xb17b('0x28')]){if(_0x50b6f7[_0xb17b('0x28')]['hasOwnProperty'](_0x5d5049)){if(!_[_0xb17b('0x16')](_0x50b6f7[_0xb17b('0x28')][_0x5d5049])&&_0x5d5049!=='id'&&_0x5d5049!==_0xb17b('0x29')&&_0x5d5049!==_0xb17b('0x2a')&&_0x5d5049!==_0xb17b('0x2b')){_0x54d37c[util['format'](_0xb17b('0x2c'),'XMD-',_[_0xb17b('0x2d')](_0x5d5049))]=_0x50b6f7['Contact'][_0x5d5049];}}}}return _0x54d37c;};exports[_0xb17b('0x2e')]=function(_0x4b1643){var _0x4ade46={};for(var _0x4dfd9e in _0x4b1643){if(_0x4b1643[_0xb17b('0x2f')](_0x4dfd9e)){_0x4ade46[util[_0xb17b('0x13')]('%s',_[_0xb17b('0x30')](_0x4dfd9e))]=_0x4b1643[_0x4dfd9e];}}return{'variables':_0x4ade46};};exports[_0xb17b('0x31')]=function(_0x534a94,_0x5e30a5){if(!_[_0xb17b('0x16')](_0x534a94)){if(_0x534a94[_0xb17b('0x2f')](_0xb17b('0x32'))){if(_0x534a94[_0xb17b('0x32')]>0x0){_0x534a94[_0xb17b('0x32')]-=0x1;}else{logger[_0xb17b('0x33')](_0xb17b('0x34'),_0x5e30a5);}}}else{logger[_0xb17b('0x33')](_0xb17b('0x35'),_0x5e30a5);}};exports[_0xb17b('0x36')]=function(_0x4a181b){var _0x4c708c=moment()[_0xb17b('0x13')](_0xb17b('0x37'));_0x4a181b[_0xb17b('0x38')]=0xd;_0x4a181b[_0xb17b('0x39')]=_0xb17b('0x3a');_0x4a181b['starttime']=_0x4c708c;_0x4a181b[_0xb17b('0x3b')]=_0x4c708c;_0x4a181b['endtime']=_0x4c708c;};exports[_0xb17b('0x3c')]=function(_0x5a11ac,_0x8a2cb7,_0x4f32f5){var _0x48163e=moment()[_0xb17b('0x13')](_0xb17b('0x37'));_0x5a11ac[_0xb17b('0x38')]=_0x8a2cb7;_0x5a11ac['statedesc']=_0x4f32f5;_0x5a11ac['responsetime']=_0x48163e;_0x5a11ac['ringtime']=getSeconds(_0x5a11ac['responsetime'],_0x5a11ac[_0xb17b('0x3d')]);};exports[_0xb17b('0x3e')]=function(_0x3ebf32,_0xf27a1a,_0x17e032){_0x3ebf32[_0xb17b('0x3f')]=_0xf27a1a;_0x3ebf32[_0xb17b('0x40')]=_0x17e032;};exports[_0xb17b('0x41')]=function(_0x4c0460,_0x38ec7d,_0x74c57c){var _0x38feb0=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4c0460['state']=_0x38ec7d;_0x4c0460[_0xb17b('0x39')]=_0x74c57c;_0x4c0460[_0xb17b('0x3b')]=_0x4c0460[_0xb17b('0x3b')]?_0x4c0460[_0xb17b('0x3b')]:_0x38feb0;_0x4c0460[_0xb17b('0x42')]=_0x4c0460[_0xb17b('0x42')]?_0x4c0460[_0xb17b('0x42')]:_0x38feb0;_0x4c0460[_0xb17b('0x43')]=getSeconds(_0x4c0460[_0xb17b('0x3b')]||0x0,_0x4c0460['starttime']||0x0);_0x4c0460[_0xb17b('0x44')]=_0x4c0460[_0xb17b('0x45')]?getSeconds(_0x4c0460[_0xb17b('0x42')],_0x4c0460['answertime']):0x0;};exports[_0xb17b('0x46')]=function(_0x538394){return _0x538394===_0xb17b('0x47');};exports[_0xb17b('0x48')]=function(_0x5850e3,_0x29b755,_0x126c5a,_0xa856d9,_0x21209e){var _0x1d414a=_0xa856d9?_0xb17b('0x49'):_0x5850e3['calleridname'];_0x1d414a=_0x21209e?_0xb17b('0x4a'):_0x1d414a;return{'actionid':_0x5850e3[_0xb17b('0x4b')],'action':'originate','channel':_0x5850e3['channelAgent'],'callerid':util['format'](_0xb17b('0x12'),_0x1d414a,_0x5850e3[_0xb17b('0x1a')]),'Exten':_0xb17b('0x24'),'Context':'from-sip','Priority':'1','variable':_0x126c5a,'timeout':(_0x29b755[_0xb17b('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5850e3[_0xb17b('0x4b')]};};exports['totalGlobal']=function(_0x1e31da){return _0x1e31da['countbusyretry']+_0x1e31da[_0xb17b('0x4d')]+_0x1e31da[_0xb17b('0x4e')]+_0x1e31da['countagentrejectretry']+_0x1e31da[_0xb17b('0x4f')];};exports[_0xb17b('0x50')]=function(_0x3a36f4){var _0x450159=_[_0xb17b('0x51')](_0x3a36f4);_0x450159[_0xb17b('0x38')]=0xf;_0x450159['statedesc']=_0xb17b('0x52');return _0x450159;};exports[_0xb17b('0x53')]=function(_0x12c43b,_0x5292fb,_0x1f43cd){var _0x27f372={};_0x27f372[_0x5292fb]=_0x12c43b[_0x5292fb];_0x27f372[_0xb17b('0x54')]=![];_0x27f372[_0xb17b('0x55')]=moment()[_0xb17b('0x56')](_0x1f43cd,_0xb17b('0x57'))[_0xb17b('0x13')](_0xb17b('0x37'));_0x27f372[_0xb17b('0x58')]=_0x12c43b[_0xb17b('0x58')];_0x27f372[_0xb17b('0x59')]=_0x12c43b[_0xb17b('0x59')];_0x27f372[_0xb17b('0x1b')]=_0x12c43b[_0xb17b('0x1b')]||undefined;return _0x27f372;};exports[_0xb17b('0x5a')]=function(_0x7c1978,_0x598ac6){if(!_[_0xb17b('0x16')](_0x7c1978)){if(_0x7c1978[_0xb17b('0x5b')]>0x0){_0x7c1978[_0xb17b('0x5b')]-=0x1;}else{logger[_0xb17b('0x33')](_0x598ac6,_0xb17b('0x5c'));}}else{logger['error'](_0x598ac6,_0xb17b('0x5d'));}};exports['IsNotLoggedIn']=function(_0x55ce1c){if(_0x55ce1c<=0x0){return!![];}return![];};function buildObj(_0x2efe50,_0x1d1ea0,_0x1cd70b){_0x2efe50[_0xb17b('0x5e')]=_0x1d1ea0;_0x2efe50['name']=_0x2efe50[_0xb17b('0x5f')];_0x2efe50['interface']=_0x2efe50[_0xb17b('0x60')];_0x2efe50['motionChannel']=_0xb17b('0x61');if(_0x1cd70b){_0x2efe50['mandatoryDisposition']=_0x1cd70b[_0xb17b('0x62')];}return _0x2efe50;}exports['buildObj']=buildObj;exports[_0xb17b('0x63')]=function(_0x35500d){var _0x514325={};_0x514325[_0xb17b('0x5f')]=_0x35500d['queue'];_0x514325['interface']=_0x35500d[_0xb17b('0x60')];_0x514325[_0xb17b('0x4b')]=_0x35500d[_0xb17b('0x4b')];return _0x514325;};exports['agentReadyId']=function(_0x105225){var _0x310908=[];for(var _0x1d5937 in _0x105225){if(_0x105225['hasOwnProperty'](_0x1d5937)){if(!_['isNil'](_0x105225[_0x1d5937])&&_0x105225[_0x1d5937][_0xb17b('0x38')]==='not_inuse'&&_0x105225[_0x1d5937]['status']==='reachable'){_0x310908[_0xb17b('0x64')](_0x105225[_0x1d5937]['id']);}}}return _0x310908;};exports[_0xb17b('0x65')]=function(_0x1cfbee){var _0x221228=moment()[_0xb17b('0x7')](0x0);var _0x257c91=moment(_0x1cfbee)[_0xb17b('0x7')](0x0);return _0x221228[_0xb17b('0x8')](_0x257c91,_0xb17b('0x9'));};exports['createBody']=function(_0xd77043){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xd77043[_0xb17b('0x58')],'ListId':_0xd77043[_0xb17b('0x59')],'VoiceQueueId':_0xd77043[_0xb17b('0x1b')]||undefined,'CampaignId':_0xd77043['CampaignId']||undefined};};exports[_0xb17b('0x66')]=function(_0x58cd78){if(_0x58cd78===_0xb17b('0x4b')||_0x58cd78==='idContact'||_0x58cd78===_0xb17b('0x5f')||_0x58cd78===_0xb17b('0x67')||_0x58cd78===_0xb17b('0x68')||_0x58cd78===_0xb17b('0x69')||_0x58cd78==='membername'||_0x58cd78===_0xb17b('0x60')||_0x58cd78==='calleridname'||_0x58cd78==='active'||_0x58cd78==='calleridnum'||_0x58cd78===_0xb17b('0x55')||_0x58cd78===_0xb17b('0x6a')||_0x58cd78===_0xb17b('0x4d')||_0x58cd78===_0xb17b('0x4e')||_0x58cd78===_0xb17b('0x6b')||_0x58cd78===_0xb17b('0x6c')||_0x58cd78==='callbackuniqueid'||_0x58cd78===_0xb17b('0x6d')||_0x58cd78===_0xb17b('0x6e')||_0x58cd78===_0xb17b('0x58')||_0x58cd78===_0xb17b('0x59')||_0x58cd78===_0xb17b('0x40')||_0x58cd78===_0xb17b('0x1b')||_0x58cd78===_0xb17b('0x6f')||_0x58cd78==='xmd-voicequeueid'||_0x58cd78==='xmd-queue'||_0x58cd78===_0xb17b('0x70')||_0x58cd78===_0xb17b('0x71')||_0x58cd78===_0xb17b('0x72')||_0x58cd78==='xmd-dialtimeout'||_0x58cd78===_0xb17b('0x73')||_0x58cd78===_0xb17b('0x74')||_0x58cd78===_0xb17b('0x75')||_0x58cd78===_0xb17b('0x76')||_0x58cd78===_0xb17b('0x77')||_0x58cd78===_0xb17b('0x78')||_0x58cd78===_0xb17b('0x79')||_0x58cd78===_0xb17b('0x7a')||_0x58cd78===_0xb17b('0x7b')||_0x58cd78===_0xb17b('0x7c')||_0x58cd78===_0xb17b('0x7d')||_0x58cd78===_0xb17b('0x7e')||_0x58cd78===_0xb17b('0x7f')||_0x58cd78===_0xb17b('0x80')||_0x58cd78===_0xb17b('0x81')||_0x58cd78==='rtpaudioqosrttbridged'||_0x58cd78==='rtpaudioqos'||_0x58cd78===_0xb17b('0x7c')||_0x58cd78===_0xb17b('0x7d')||_0x58cd78==='rtpaudioqosjitterbridged'||_0x58cd78===_0xb17b('0x7f')||_0x58cd78===_0xb17b('0x80')||_0x58cd78===_0xb17b('0x81')||_0x58cd78===_0xb17b('0x82')||_0x58cd78===_0xb17b('0x83')||_0x58cd78==='bridgepvtcallid'||_0x58cd78===_0xb17b('0x38')||_0x58cd78===_0xb17b('0x39')){return![];}return!![];};exports[_0xb17b('0x84')]=function(_0x384bd6,_0x40fd03){var _0x892d0b,_0x461b07,_0x3b6b5c;if(_0x40fd03<=0x0){_0x40fd03=0x1;}_0x892d0b=new RegExp(_0xb17b('0x85')+_0x40fd03+'}$');_0x461b07=Math[_0xb17b('0x86')](0xa,_0x40fd03-0x1);_0x3b6b5c=Math[_0xb17b('0x86')](0xa,_0x40fd03)-0x1;return util['format']('%s',_['replace'](_0x384bd6,_0x892d0b,_[_0xb17b('0x87')](_0x461b07,_0x3b6b5c)));};exports[_0xb17b('0x88')]=function(_0x224a06){var _0x103ce4=_0x224a06[_0xb17b('0x89')](/"(.*?)"/);return _0x103ce4?_0x103ce4[0x1]:_0x224a06;};exports[_0xb17b('0x8a')]=function(_0x35eee4){var _0x53ef38=_0x35eee4['match'](/<(.*?)>/);return _0x53ef38?_0x53ef38[0x1]:_0x35eee4;};function buildNoAnswerEventPayload(_0x33dfbd,_0x2b7782){var _0x19232a=buildObj(_0x33dfbd,'noanswer');if(!_[_0xb17b('0x14')](_0x2b7782[_0xb17b('0x8b')])){Object[_0xb17b('0x8c')](_0x2b7782[_0xb17b('0x8b')])[_0xb17b('0x8d')](function(_0x56d365){_0x19232a[_0x56d365[_0xb17b('0x8e')]()]=_0x2b7782[_0xb17b('0x8b')][_0x56d365];});}return _0x19232a;}exports[_0xb17b('0x8f')]=buildNoAnswerEventPayload;
\ No newline at end of file
index 4bcae74..2841df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8420=['number','boolean','queueremove','queuepause','reload','voicequeuechannel','queueadd','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8420,0xbe));var _0x0842=function(_0x2017ee,_0x1cbc0d){_0x2017ee=_0x2017ee-0x0;var _0x2618e9=_0x8420[_0x2017ee];return _0x2618e9;};'use strict';exports[_0x0842('0x0')]={'queue':{'type':_0x0842('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x0842('0x2'),'required':![]},'paused':{'type':_0x0842('0x3'),'required':![]}};exports[_0x0842('0x4')]={'queue':{'type':_0x0842('0x1'),'required':!![]},'interface':{'type':_0x0842('0x1'),'required':!![]}};exports[_0x0842('0x5')]={'interface':{'type':_0x0842('0x1'),'required':!![]},'paused':{'type':_0x0842('0x3')},'reason':{'type':_0x0842('0x1'),'required':![]}};exports[_0x0842('0x6')]={'module':{'type':_0x0842('0x1'),'required':![]}};exports[_0x0842('0x7')]={'uniqueid':{'type':_0x0842('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x0842('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x0842('0x1')},'mixmonitorid':{'type':_0x0842('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x0842('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x0842('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0x5116=['string','number','boolean','queuepause','reload','voicechannel','voicequeuechannelhangup','queueadd'];(function(_0x4c7b56,_0x537b32){var _0x43d18a=function(_0x10d7e5){while(--_0x10d7e5){_0x4c7b56['push'](_0x4c7b56['shift']());}};_0x43d18a(++_0x537b32);}(_0x5116,0x187));var _0x6511=function(_0x472b84,_0x5d2b6e){_0x472b84=_0x472b84-0x0;var _0x46e146=_0x5116[_0x472b84];return _0x46e146;};'use strict';exports[_0x6511('0x0')]={'queue':{'type':_0x6511('0x1'),'required':!![]},'interface':{'type':_0x6511('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x6511('0x2'),'required':![]},'paused':{'type':_0x6511('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x6511('0x1'),'required':!![]},'interface':{'type':_0x6511('0x1'),'required':!![]}};exports[_0x6511('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x6511('0x3')},'reason':{'type':_0x6511('0x1'),'required':![]}};exports[_0x6511('0x5')]={'module':{'type':_0x6511('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x6511('0x1'),'required':!![]}};exports[_0x6511('0x6')]={'uniqueid':{'type':_0x6511('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':_0x6511('0x1')}};exports[_0x6511('0x7')]={'uniqueid':{'type':_0x6511('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x6511('0x1'),'required':!![]},'exten':{'type':_0x6511('0x1'),'required':!![]},'context':{'type':_0x6511('0x1')}};
\ No newline at end of file
index c20c8ad..1f2514e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88ff=['channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','freshdeskAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','SIP/%s','name','hasOwnProperty','isNil','interface','format','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','answered','unmanaged','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','isUndefined','initTelephones','length','initTrunks','trunks','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','seconds','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initFaxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','outbound','voiceExtensions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x88ff,0x196));var _0xf88f=function(_0x812165,_0x5babaf){_0x812165=_0x812165-0x0;var _0x4f32f0=_0x88ff[_0x812165];return _0x4f32f0;};'use strict';var util=require(_0xf88f('0x0'));var _=require(_0xf88f('0x1'));var moment=require(_0xf88f('0x2'));var Agent=require(_0xf88f('0x3'));var Telephone=require(_0xf88f('0x4'));var Trunk=require(_0xf88f('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0xf88f('0x6'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0xf88f('0x7'));var SalesforceAccount=require(_0xf88f('0x8'));var FreshdeskAccount=require(_0xf88f('0x9'));var SugarcrmAccount=require(_0xf88f('0xa'));var ZohoAccount=require(_0xf88f('0xb'));var DeskAccount=require(_0xf88f('0xc'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xf88f('0xd'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf88f('0xe'));var Realtime=function(){this[_0xf88f('0xf')]={};this[_0xf88f('0x10')]={};this['trunks']={};this[_0xf88f('0x11')]={};this[_0xf88f('0x12')]={};this[_0xf88f('0x13')]={};this['templates']={};this[_0xf88f('0x14')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf88f('0x15')]={};this[_0xf88f('0x16')]={};this[_0xf88f('0x17')]={};this[_0xf88f('0x18')]={};this[_0xf88f('0x19')]={};this[_0xf88f('0x1a')]={};this[_0xf88f('0x1b')]={};this['salesforceAccounts']={};this['sugarcrmAccounts']={};this[_0xf88f('0x1c')]={};this[_0xf88f('0x1d')]={};this['deskAccounts']={};this[_0xf88f('0x1e')]={};this['servicenowAccounts']={};this[_0xf88f('0x1f')]={};this[_0xf88f('0x20')]={};this[_0xf88f('0x21')]={};};function freeIsNotKey(_0x1eadcf,_0x1a9fbb,_0x1c5b80){var _0x41b06e=_['mapKeys'](_0x1eadcf,function(_0x3432cc,_0x43b569){return _0x3432cc[_0x1c5b80];});for(var _0x347212 in _0x1a9fbb){if(_0x1a9fbb['hasOwnProperty'](_0x347212)){if(!_0x41b06e[_0x347212]){delete _0x1a9fbb[_0x347212];}}}}function freeIsNotKeySip(_0x30c2db,_0x2e81d9){var _0x4b32f1=_[_0xf88f('0x22')](_0x30c2db,function(_0x5b5a5f,_0x14aece){return util['format'](_0xf88f('0x23'),_0x5b5a5f[_0xf88f('0x24')]);});for(var _0x5c1aa6 in _0x2e81d9){if(_0x2e81d9[_0xf88f('0x25')](_0x5c1aa6)){if(!_0x4b32f1[_0x5c1aa6]){delete _0x2e81d9[_0x5c1aa6];}}}}function freeIsNotKeyAgent(_0xfbddde,_0x27c126){var _0x34e597=_[_0xf88f('0x22')](_0xfbddde,function(_0x500dc6,_0x302a15){var _0x593b74=_[_0xf88f('0x26')](_0x500dc6[_0xf88f('0x27')])?util[_0xf88f('0x28')](_0xf88f('0x23'),_0x500dc6[_0xf88f('0x24')]):_0x500dc6[_0xf88f('0x27')];return _0x593b74;});for(var _0x1db033 in _0x27c126){if(_0x27c126[_0xf88f('0x25')](_0x1db033)){if(!_0x34e597[_0x1db033]){delete _0x27c126[_0x1db033];}}}}function clearVoiceCallReports(_0x1a8289){_0x1a8289[_0xf88f('0x29')]=0x0;_0x1a8289['answered']=0x0;_0x1a8289[_0xf88f('0x2a')]=0x0;_0x1a8289[_0xf88f('0x2b')]=0x0;_0x1a8289[_0xf88f('0x2c')]=0x0;}function clearCampaigns(_0x2bb20e){if(!_[_0xf88f('0x2d')](_0x2bb20e)){for(var _0x3266a3 in _0x2bb20e){if(_0x2bb20e[_0xf88f('0x25')](_0x3266a3)){_0x2bb20e[_0x3266a3][_0xf88f('0x2e')]=0x0;_0x2bb20e[_0x3266a3]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x10be01){if(!_[_0xf88f('0x2d')](_0x10be01)){for(var _0x8406e5 in _0x10be01){if(_0x10be01[_0xf88f('0x25')](_0x8406e5)){_0x10be01[_0x8406e5][_0xf88f('0x29')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x2f')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x30')]=0x0;_0x10be01[_0x8406e5]['abandoned']=0x0;_0x10be01[_0x8406e5][_0xf88f('0x2a')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x2b')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x2c')]=0x0;_0x10be01[_0x8406e5]['outboundAnswerAgiCallsDay']=0x0;_0x10be01[_0x8406e5][_0xf88f('0x31')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x32')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x33')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x34')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x35')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x36')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x37')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x38')]=0x0;_0x10be01[_0x8406e5]['outboundOriginateFailureCallsDay']=0x0;_0x10be01[_0x8406e5][_0xf88f('0x39')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x3a')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x3b')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x3c')]=0x0;_0x10be01[_0x8406e5][_0xf88f('0x3d')]=!![];}}}}Realtime['prototype'][_0xf88f('0x3e')]=function(_0x34cabf,_0x18243f){for(var _0xd14abb in _0x18243f){if(_0x34cabf[_0xf88f('0x25')](_0xd14abb)){_0x34cabf[_0xd14abb]=_0x18243f[_0xd14abb];}}};Realtime[_0xf88f('0x3f')][_0xf88f('0x40')]=function(){var _0x588102=this;return function(_0x34a6d5){if(_0x34a6d5){freeIsNotKeyAgent(_0x34a6d5,_0x588102['agents']);for(var _0x318eb2=0x0,_0x6ec6d2={},_0xd7278b={};_0x318eb2<_0x34a6d5['length'];_0x318eb2+=0x1){_0x6ec6d2=_0x34a6d5[_0x318eb2];var _0x4cfefe=_[_0xf88f('0x26')](_0x6ec6d2[_0xf88f('0x27')])?util[_0xf88f('0x28')]('SIP/%s',_0x6ec6d2[_0xf88f('0x24')]):_0x6ec6d2[_0xf88f('0x27')];if(_[_0xf88f('0x41')](_0x588102[_0xf88f('0xf')][_0x4cfefe])){_0x588102[_0xf88f('0xf')][_0x4cfefe]=new Agent(_0x6ec6d2);}else{_0x588102[_0xf88f('0x3e')](_0x588102['agents'][_0x4cfefe],_0x6ec6d2);}}}return _0x588102['agents'];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x42')]=function(){var _0x334385=this;return function(_0x1d9ce4){if(_0x1d9ce4){freeIsNotKeySip(_0x1d9ce4,_0x334385[_0xf88f('0x10')]);for(var _0x5d4628=0x0,_0x417007={},_0x50af98={};_0x5d4628<_0x1d9ce4[_0xf88f('0x43')];_0x5d4628+=0x1){_0x417007=_0x1d9ce4[_0x5d4628];if(_[_0xf88f('0x41')](_0x334385[_0xf88f('0x10')][util[_0xf88f('0x28')](_0xf88f('0x23'),_0x417007['name'])])){_0x334385[_0xf88f('0x10')][util['format'](_0xf88f('0x23'),_0x417007[_0xf88f('0x24')])]=new Telephone(_0x417007);}else{_0x334385[_0xf88f('0x3e')](_0x334385[_0xf88f('0x10')][util['format'](_0xf88f('0x23'),_0x417007[_0xf88f('0x24')])],_0x417007);}}}return _0x334385['telephones'];};};Realtime['prototype'][_0xf88f('0x44')]=function(){var _0x859a77=this;return function(_0x26b93f){if(_0x26b93f){freeIsNotKeySip(_0x26b93f,_0x859a77[_0xf88f('0x45')]);for(var _0x322c49=0x0,_0x414bdc={},_0x4f184b={};_0x322c49<_0x26b93f[_0xf88f('0x43')];_0x322c49+=0x1){_0x414bdc=_0x26b93f[_0x322c49];if(_[_0xf88f('0x41')](_0x859a77[_0xf88f('0x45')][util[_0xf88f('0x28')](_0xf88f('0x23'),_0x414bdc[_0xf88f('0x24')])])){_0x859a77['trunks'][util[_0xf88f('0x28')](_0xf88f('0x23'),_0x414bdc[_0xf88f('0x24')])]=new Trunk(_0x414bdc);}else{_0x859a77[_0xf88f('0x3e')](_0x859a77[_0xf88f('0x45')][util[_0xf88f('0x28')]('SIP/%s',_0x414bdc[_0xf88f('0x24')])],_0x414bdc);}}}return _0x859a77[_0xf88f('0x45')];};};Realtime[_0xf88f('0x3f')]['initVoiceQueues']=function(){var _0x2f7149=this;return function(_0x3ccd14){if(_0x3ccd14){freeIsNotKey(_0x3ccd14,_0x2f7149[_0xf88f('0x11')],_0xf88f('0x24'));for(var _0x5e29f7=0x0,_0x385fb8={},_0x3e6c30={};_0x5e29f7<_0x3ccd14[_0xf88f('0x43')];_0x5e29f7+=0x1){_0x385fb8=_0x3ccd14[_0x5e29f7];if(_['isUndefined'](_0x2f7149[_0xf88f('0x11')][_0x385fb8[_0xf88f('0x24')]])){_0x2f7149[_0xf88f('0x11')][_0x385fb8[_0xf88f('0x24')]]=new VoiceQueue(_0x385fb8);}else{_0x2f7149[_0xf88f('0x3e')](_0x2f7149['voiceQueues'][_0x385fb8[_0xf88f('0x24')]],_0x385fb8);}}}return _0x2f7149['voiceQueues'];};};Realtime['prototype']['initTriggers']=function(){var _0x2d1626=this;return function(_0x28ce5c){if(_0x28ce5c){freeIsNotKey(_0x28ce5c,_0x2d1626[_0xf88f('0x12')],'id');for(var _0x4d4a06=0x0,_0x4ff9a4={},_0x1e227d={};_0x4d4a06<_0x28ce5c[_0xf88f('0x43')];_0x4d4a06+=0x1){_0x4ff9a4=_0x28ce5c[_0x4d4a06];if(_[_0xf88f('0x41')](_0x2d1626[_0xf88f('0x12')][_0x4ff9a4['id']])){_0x2d1626[_0xf88f('0x12')][_0x4ff9a4['id']]=new Trigger(_0x4ff9a4);}else{_0x2d1626[_0xf88f('0x3e')](_0x2d1626[_0xf88f('0x12')][_0x4ff9a4['id']],_0x4ff9a4);}}}return _0x2d1626[_0xf88f('0x12')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x46')]=function(){var _0x822fc0=this;return function(_0x29222f){if(_0x29222f){freeIsNotKey(_0x29222f,_0x822fc0['templates'],'id');for(var _0x3ea57e=0x0,_0x5d6607={},_0x19ebce={};_0x3ea57e<_0x29222f[_0xf88f('0x43')];_0x3ea57e+=0x1){_0x5d6607=_0x29222f[_0x3ea57e];if(_[_0xf88f('0x41')](_0x822fc0['templates'][_0x5d6607['id']])){_0x822fc0['templates'][_0x5d6607['id']]=new Template(_0x5d6607);}else{_0x822fc0['mergeFromDatabase'](_0x822fc0['templates'][_0x5d6607['id']],_0x5d6607);}}}return _0x822fc0[_0xf88f('0x47')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x48')]=function(){var _0x384f1c=this;return function(_0x52a9c8){if(_0x52a9c8){freeIsNotKey(_0x52a9c8,_0x384f1c[_0xf88f('0x1b')],'id');for(var _0x3870b0=0x0,_0x5502ee={},_0x3eb8e4={};_0x3870b0<_0x52a9c8[_0xf88f('0x43')];_0x3870b0+=0x1){_0x5502ee=_0x52a9c8[_0x3870b0];if(_[_0xf88f('0x41')](_0x384f1c[_0xf88f('0x1b')][_0x5502ee['id']])){_0x384f1c[_0xf88f('0x1b')][_0x5502ee['id']]=new ZendeskAccount(_0x5502ee);}else{_0x384f1c['mergeFromDatabase'](_0x384f1c[_0xf88f('0x1b')][_0x5502ee['id']],_0x5502ee);}}}return _0x384f1c[_0xf88f('0x1b')];};};Realtime['prototype'][_0xf88f('0x49')]=function(){var _0x3297bc=this;return function(_0x19ca07){if(_0x19ca07){freeIsNotKey(_0x19ca07,_0x3297bc['salesforceAccounts'],'id');for(var _0x34a823=0x0,_0x4402d0={},_0x847be5={};_0x34a823<_0x19ca07['length'];_0x34a823+=0x1){_0x4402d0=_0x19ca07[_0x34a823];if(_[_0xf88f('0x41')](_0x3297bc[_0xf88f('0x4a')][_0x4402d0['id']])){_0x3297bc['salesforceAccounts'][_0x4402d0['id']]=new SalesforceAccount(_0x4402d0);}else{_0x3297bc['mergeFromDatabase'](_0x3297bc[_0xf88f('0x4a')][_0x4402d0['id']],_0x4402d0);}}}return _0x3297bc[_0xf88f('0x4a')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x4b')]=function(){var _0x2158b1=this;return function(_0x36fb15){if(_0x36fb15){freeIsNotKey(_0x36fb15,_0x2158b1[_0xf88f('0x1c')],'id');for(var _0x339378=0x0,_0x17e6ed={},_0x593b5b={};_0x339378<_0x36fb15[_0xf88f('0x43')];_0x339378+=0x1){_0x17e6ed=_0x36fb15[_0x339378];if(_[_0xf88f('0x41')](_0x2158b1[_0xf88f('0x1c')][_0x17e6ed['id']])){_0x2158b1[_0xf88f('0x1c')][_0x17e6ed['id']]=new FreshdeskAccount(_0x17e6ed);}else{_0x2158b1['mergeFromDatabase'](_0x2158b1[_0xf88f('0x1c')][_0x17e6ed['id']],_0x17e6ed);}}}return _0x2158b1['freshdeskAccounts'];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x4c')]=function(){var _0x18d867=this;return function(_0x2ff482){if(_0x2ff482){freeIsNotKey(_0x2ff482,_0x18d867['zohoAccounts'],'id');for(var _0x40e89e=0x0,_0x4b41e5={},_0x1cf380={};_0x40e89e<_0x2ff482['length'];_0x40e89e+=0x1){_0x4b41e5=_0x2ff482[_0x40e89e];if(_[_0xf88f('0x41')](_0x18d867[_0xf88f('0x1d')][_0x4b41e5['id']])){_0x18d867['zohoAccounts'][_0x4b41e5['id']]=new ZohoAccount(_0x4b41e5);}else{_0x18d867[_0xf88f('0x3e')](_0x18d867[_0xf88f('0x1d')][_0x4b41e5['id']],_0x4b41e5);}}}return _0x18d867[_0xf88f('0x1d')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x4d')]=function(){var _0x54ca85=this;return function(_0xf0a0f4){if(_0xf0a0f4){freeIsNotKey(_0xf0a0f4,_0x54ca85['deskAccounts'],'id');for(var _0x2a169c=0x0,_0xb0a248={},_0x3b3999={};_0x2a169c<_0xf0a0f4['length'];_0x2a169c+=0x1){_0xb0a248=_0xf0a0f4[_0x2a169c];if(_[_0xf88f('0x41')](_0x54ca85[_0xf88f('0x4e')][_0xb0a248['id']])){_0x54ca85['deskAccounts'][_0xb0a248['id']]=new DeskAccount(_0xb0a248);}else{_0x54ca85[_0xf88f('0x3e')](_0x54ca85['deskAccounts'][_0xb0a248['id']],_0xb0a248);}}}return _0x54ca85[_0xf88f('0x4e')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x4f')]=function(){var _0x17c8d9=this;return function(_0x441d34){if(_0x441d34){freeIsNotKey(_0x441d34,_0x17c8d9[_0xf88f('0x50')],'id');for(var _0x15a36a=0x0,_0x507b15={},_0x48998d={};_0x15a36a<_0x441d34[_0xf88f('0x43')];_0x15a36a+=0x1){_0x507b15=_0x441d34[_0x15a36a];if(_[_0xf88f('0x41')](_0x17c8d9[_0xf88f('0x50')][_0x507b15['id']])){_0x17c8d9['sugarcrmAccounts'][_0x507b15['id']]=new SugarcrmAccount(_0x507b15);}else{_0x17c8d9[_0xf88f('0x3e')](_0x17c8d9['sugarcrmAccounts'][_0x507b15['id']],_0x507b15);}}}return _0x17c8d9[_0xf88f('0x50')];};};Realtime[_0xf88f('0x3f')]['initVtigerAccounts']=function(){var _0x2f10a4=this;return function(_0x349d39){if(_0x349d39){freeIsNotKey(_0x349d39,_0x2f10a4[_0xf88f('0x1e')],'id');for(var _0x37ea91=0x0,_0x223c53={},_0x48533a={};_0x37ea91<_0x349d39['length'];_0x37ea91+=0x1){_0x223c53=_0x349d39[_0x37ea91];if(_['isUndefined'](_0x2f10a4[_0xf88f('0x1e')][_0x223c53['id']])){_0x2f10a4[_0xf88f('0x1e')][_0x223c53['id']]=new VtigerAccount(_0x223c53);}else{_0x2f10a4['mergeFromDatabase'](_0x2f10a4[_0xf88f('0x1e')][_0x223c53['id']],_0x223c53);}}}return _0x2f10a4[_0xf88f('0x1e')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x51')]=function(){var _0xcb1801=this;return function(_0x58b9b5){if(_0x58b9b5){freeIsNotKey(_0x58b9b5,_0xcb1801[_0xf88f('0x52')],'id');for(var _0x2efcef=0x0,_0x27adce={},_0x2cc4c8={};_0x2efcef<_0x58b9b5[_0xf88f('0x43')];_0x2efcef+=0x1){_0x27adce=_0x58b9b5[_0x2efcef];if(_['isUndefined'](_0xcb1801[_0xf88f('0x52')][_0x27adce['id']])){_0xcb1801['servicenowAccounts'][_0x27adce['id']]=new ServicenowAccount(_0x27adce);}else{_0xcb1801['mergeFromDatabase'](_0xcb1801[_0xf88f('0x52')][_0x27adce['id']],_0x27adce);}}}return _0xcb1801[_0xf88f('0x52')];};};Realtime['prototype'][_0xf88f('0x53')]=function(){var _0x1c3e8d=this;return function(_0x5f1693){if(_0x5f1693){freeIsNotKey(_0x5f1693,_0x1c3e8d[_0xf88f('0x1f')],'id');for(var _0x28f605=0x0,_0x46df29={},_0x38c9c1={};_0x28f605<_0x5f1693[_0xf88f('0x43')];_0x28f605+=0x1){_0x46df29=_0x5f1693[_0x28f605];if(_[_0xf88f('0x41')](_0x1c3e8d[_0xf88f('0x1f')][_0x46df29['id']])){_0x1c3e8d['dynamics365Accounts'][_0x46df29['id']]=new Dynamics365Account(_0x46df29);}else{_0x1c3e8d[_0xf88f('0x3e')](_0x1c3e8d[_0xf88f('0x1f')][_0x46df29['id']],_0x46df29);}}}return _0x1c3e8d[_0xf88f('0x1f')];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x57f621=this;return function(_0x2cf148){if(_0x2cf148){freeIsNotKey(_0x2cf148,_0x57f621[_0xf88f('0x20')],'id');for(var _0x4e795b=0x0,_0x397e42={},_0x161921={};_0x4e795b<_0x2cf148[_0xf88f('0x43')];_0x4e795b+=0x1){_0x397e42=_0x2cf148[_0x4e795b];if(_['isUndefined'](_0x57f621['freshsalesAccounts'][_0x397e42['id']])){_0x57f621[_0xf88f('0x20')][_0x397e42['id']]=new FreshsalesAccount(_0x397e42);}else{_0x57f621[_0xf88f('0x3e')](_0x57f621[_0xf88f('0x20')][_0x397e42['id']],_0x397e42);}}}return _0x57f621[_0xf88f('0x20')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x54')]=function(){var _0x45f7f8=this;return function(_0x4161f7){for(var _0x285da8=0x0;_0x285da8<_0x4161f7[_0xf88f('0x43')];_0x285da8+=0x1){_['merge'](_0x45f7f8[_0xf88f('0x11')][_0x4161f7[_0x285da8]['name']],_0x4161f7[_0x285da8]);}return _0x45f7f8[_0xf88f('0x11')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x55')]=function(){var _0x542ceb=this;return function(_0x1dfec2){clearVoiceQueues(_0x542ceb['voiceQueues']);if(_0x1dfec2){_0x1dfec2=_[_0xf88f('0x56')](_0x1dfec2,'uniqueid');for(var _0x2b6cf9 in _0x1dfec2){if(_0x1dfec2[_0xf88f('0x25')](_0x2b6cf9)){var _0x22b1c8={};for(var _0xca1fb6=0x0;_0xca1fb6<_0x1dfec2[_0x2b6cf9]['length'];_0xca1fb6+=0x1){var _0x52d093=_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x57')];if(_0x542ceb[_0xf88f('0x11')][_0x52d093]){if(_0x1dfec2[_0x2b6cf9][_0xca1fb6]['queuecallerexit']){_0x542ceb[_0xf88f('0x11')][_0x52d093][_0xf88f('0x30')]+=0x1;}if(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x58')]){_0x542ceb[_0xf88f('0x11')][_0x52d093]['abandoned']+=0x1;}_0x542ceb[_0xf88f('0x11')][_0x52d093][_0xf88f('0x2a')]+=moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x59')])['diff'](moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5a')]),'seconds')||0x0;if(_0xca1fb6===_0x1dfec2[_0x2b6cf9][_0xf88f('0x43')]-0x1){_0x542ceb['voiceQueues'][_0x52d093][_0xf88f('0x2b')]+=moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5b')]||_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5c')]||_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5d')])[_0xf88f('0x5e')](moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5a')]),_0xf88f('0x5f'))||0x0;_0x542ceb['voiceQueues'][_0x52d093][_0xf88f('0x29')]+=0x1;if(_0x1dfec2[_0x2b6cf9][_0xca1fb6]['queuecallercomplete']){_0x542ceb[_0xf88f('0x11')][_0x52d093][_0xf88f('0x2f')]+=0x1;_0x542ceb['voiceQueues'][_0x52d093][_0xf88f('0x2c')]+=moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x5b')])['diff'](moment(_0x1dfec2[_0x2b6cf9][_0xca1fb6][_0xf88f('0x59')]),_0xf88f('0x5f'))||0x0;}}else{_0x542ceb[_0xf88f('0x11')][_0x52d093][_0xf88f('0x2b')]+=_0x542ceb['voiceQueues'][_0x52d093]['sumHoldTime']||0x0;}}}}}}return _0x542ceb[_0xf88f('0x11')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x60')]=function(){var _0x3cafed=this;return function(_0x586592){clearVoiceCallReports(_0x3cafed[_0xf88f('0x14')]);if(_0x586592){for(var _0x40da10=0x0;_0x40da10<_0x586592[_0xf88f('0x43')];_0x40da10+=0x1){_0x3cafed[_0xf88f('0x14')][_0xf88f('0x29')]+=0x1;_0x3cafed[_0xf88f('0x14')][_0xf88f('0x2b')]+=_0x586592[_0x40da10][_0xf88f('0x61')];if(_0x586592[_0x40da10][_0xf88f('0x62')]===_0xf88f('0x63')){_0x3cafed[_0xf88f('0x14')][_0xf88f('0x2f')]+=0x1;_0x3cafed[_0xf88f('0x14')][_0xf88f('0x2a')]+=_0x586592[_0x40da10]['duration']-_0x586592[_0x40da10][_0xf88f('0x64')]||0x0;_0x3cafed['outbound'][_0xf88f('0x2c')]+=_0x586592[_0x40da10]['billableseconds'];}}}return _0x3cafed[_0xf88f('0x14')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x65')]=function(){var _0x308e1a=this;return function(_0xe9f266){if(_0xe9f266){freeIsNotKey(_0xe9f266,_0x308e1a[_0xf88f('0x13')],'name');for(var _0x3662e8=0x0,_0x1ca1a8={};_0x3662e8<_0xe9f266[_0xf88f('0x43')];_0x3662e8+=0x1){_0x1ca1a8=_0xe9f266[_0x3662e8];if(_[_0xf88f('0x41')](_0x308e1a[_0xf88f('0x13')][_0x1ca1a8[_0xf88f('0x24')]])){_0x308e1a[_0xf88f('0x13')][_0x1ca1a8['name']]=new Campaign(_0x1ca1a8);}else{_0x308e1a[_0xf88f('0x3e')](_0x308e1a[_0xf88f('0x13')][_0x1ca1a8[_0xf88f('0x24')]],_0x1ca1a8);_0x308e1a[_0xf88f('0x13')][_0x1ca1a8[_0xf88f('0x24')]][_0xf88f('0x66')]=_0x1ca1a8[_0xf88f('0x67')]?_0x1ca1a8['SquareProject']['name']:undefined;}}}return _0x308e1a[_0xf88f('0x13')];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x68')]=function(){var _0x4c6f48=this;return function(_0x1f4ded){if(_0x1f4ded){freeIsNotKey(_0x1f4ded,_0x4c6f48[_0xf88f('0x15')],'id');for(var _0xdb5850=0x0,_0x2bae17={};_0xdb5850<_0x1f4ded[_0xf88f('0x43')];_0xdb5850+=0x1){_0x2bae17=_0x1f4ded[_0xdb5850];if(_[_0xf88f('0x41')](_0x4c6f48['voiceExtensions'][_0x2bae17['id']])){_0x4c6f48[_0xf88f('0x15')][_0x2bae17['id']]=new VoiceExtension(_0x2bae17);}else{_0x4c6f48['mergeFromDatabase'](_0x4c6f48[_0xf88f('0x15')][_0x2bae17['id']],_0x2bae17);}}}return _0x4c6f48[_0xf88f('0x15')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x4ae776=this;return function(_0x4304ef){clearCampaigns(_0x4ae776['campaigns']);for(var _0x4b6779=0x0;_0x4b6779<_0x4304ef[_0xf88f('0x43')];_0x4b6779+=0x1){_['merge'](_0x4ae776[_0xf88f('0x13')][_0x4304ef[_0x4b6779][_0xf88f('0x24')]],_0x4304ef[_0x4b6779]);}return _0x4ae776['campaigns'];};};Realtime[_0xf88f('0x3f')][_0xf88f('0x69')]=function(){var _0x1c9c57=this;return function(_0x43dd49){if(_0x43dd49){freeIsNotKey(_0x43dd49,_0x1c9c57[_0xf88f('0x21')],'id');for(var _0x5831b9=0x0,_0x45a9af={},_0x4e5d7b={};_0x5831b9<_0x43dd49[_0xf88f('0x43')];_0x5831b9+=0x1){_0x45a9af=_0x43dd49[_0x5831b9];if(_[_0xf88f('0x41')](_0x1c9c57[_0xf88f('0x21')][_0x45a9af['id']])){_0x1c9c57['faxAccounts'][_0x45a9af['id']]=new FaxAccount(_0x45a9af);}else{_0x1c9c57[_0xf88f('0x3e')](_0x1c9c57[_0xf88f('0x21')][_0x45a9af['id']],_0x45a9af);}}}return _0x1c9c57['faxAccounts'];};};module[_0xf88f('0x6a')]=Realtime;
\ No newline at end of file
+var _0xe260=['length','initTelephones','telephones','isUndefined','initTrunks','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','disposition','ANSWERED','duration','sumBillable','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','exports','util','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','trunks','voiceQueues','triggers','outbound','voiceExtensions','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundReCallsDay','mergeFromDatabase','prototype','initAgents'];(function(_0x2fc3c3,_0xf00f6b){var _0xd2b6c8=function(_0xe574bd){while(--_0xe574bd){_0x2fc3c3['push'](_0x2fc3c3['shift']());}};_0xd2b6c8(++_0xf00f6b);}(_0xe260,0x94));var _0x0e26=function(_0x1a0567,_0x2746f7){_0x1a0567=_0x1a0567-0x0;var _0x4dc2bc=_0xe260[_0x1a0567];return _0x4dc2bc;};'use strict';var util=require(_0x0e26('0x0'));var _=require('lodash');var moment=require(_0x0e26('0x1'));var Agent=require(_0x0e26('0x2'));var Telephone=require(_0x0e26('0x3'));var Trunk=require(_0x0e26('0x4'));var VoiceQueue=require(_0x0e26('0x5'));var Trigger=require(_0x0e26('0x6'));var Template=require(_0x0e26('0x7'));var Campaign=require(_0x0e26('0x8'));var VoiceExtension=require(_0x0e26('0x9'));var ZendeskAccount=require(_0x0e26('0xa'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x0e26('0xb'));var ZohoAccount=require(_0x0e26('0xc'));var DeskAccount=require(_0x0e26('0xd'));var VtigerAccount=require(_0x0e26('0xe'));var ServicenowAccount=require(_0x0e26('0xf'));var Dynamics365Account=require(_0x0e26('0x10'));var FreshsalesAccount=require(_0x0e26('0x11'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x0e26('0x12')]={};this['telephones']={};this[_0x0e26('0x13')]={};this[_0x0e26('0x14')]={};this[_0x0e26('0x15')]={};this['campaigns']={};this['templates']={};this[_0x0e26('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x0e26('0x17')]={};this['channels']={};this[_0x0e26('0x18')]={};this[_0x0e26('0x19')]={};this[_0x0e26('0x1a')]={};this['settings']={};this[_0x0e26('0x1b')]={};this[_0x0e26('0x1c')]={};this[_0x0e26('0x1d')]={};this[_0x0e26('0x1e')]={};this[_0x0e26('0x1f')]={};this[_0x0e26('0x20')]={};this[_0x0e26('0x21')]={};this['servicenowAccounts']={};this[_0x0e26('0x22')]={};this[_0x0e26('0x23')]={};this[_0x0e26('0x24')]={};};function freeIsNotKey(_0x34a12c,_0x517a7d,_0x12a0a9){var _0x8571bf=_[_0x0e26('0x25')](_0x34a12c,function(_0x240ed1,_0x16782d){return _0x240ed1[_0x12a0a9];});for(var _0x5d0c24 in _0x517a7d){if(_0x517a7d[_0x0e26('0x26')](_0x5d0c24)){if(!_0x8571bf[_0x5d0c24]){delete _0x517a7d[_0x5d0c24];}}}}function freeIsNotKeySip(_0x94f8b5,_0x43dcd1){var _0xac68fb=_[_0x0e26('0x25')](_0x94f8b5,function(_0x2a997b,_0x139053){return util[_0x0e26('0x27')](_0x0e26('0x28'),_0x2a997b[_0x0e26('0x29')]);});for(var _0x2f1df7 in _0x43dcd1){if(_0x43dcd1[_0x0e26('0x26')](_0x2f1df7)){if(!_0xac68fb[_0x2f1df7]){delete _0x43dcd1[_0x2f1df7];}}}}function freeIsNotKeyAgent(_0x1b87f1,_0x30497c){var _0x56e284=_[_0x0e26('0x25')](_0x1b87f1,function(_0x5f55c9,_0x8944b3){var _0x57fd1c=_[_0x0e26('0x2a')](_0x5f55c9[_0x0e26('0x2b')])?util[_0x0e26('0x27')](_0x0e26('0x28'),_0x5f55c9[_0x0e26('0x29')]):_0x5f55c9[_0x0e26('0x2b')];return _0x57fd1c;});for(var _0x320d6b in _0x30497c){if(_0x30497c[_0x0e26('0x26')](_0x320d6b)){if(!_0x56e284[_0x320d6b]){delete _0x30497c[_0x320d6b];}}}}function clearVoiceCallReports(_0x469acf){_0x469acf[_0x0e26('0x2c')]=0x0;_0x469acf[_0x0e26('0x2d')]=0x0;_0x469acf[_0x0e26('0x2e')]=0x0;_0x469acf['sumDuration']=0x0;_0x469acf['sumBillable']=0x0;}function clearCampaigns(_0x1c7d69){if(!_['isEmpty'](_0x1c7d69)){for(var _0x5f2fb8 in _0x1c7d69){if(_0x1c7d69[_0x0e26('0x26')](_0x5f2fb8)){_0x1c7d69[_0x5f2fb8][_0x0e26('0x2f')]=0x0;_0x1c7d69[_0x5f2fb8][_0x0e26('0x30')]=0x0;}}}}function clearVoiceQueues(_0x40f464){if(!_['isEmpty'](_0x40f464)){for(var _0x4c6cac in _0x40f464){if(_0x40f464['hasOwnProperty'](_0x4c6cac)){_0x40f464[_0x4c6cac][_0x0e26('0x2c')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x2d')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x31')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x32')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x2e')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x33')]=0x0;_0x40f464[_0x4c6cac]['sumBillable']=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x34')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x35')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x36')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x37')]=0x0;_0x40f464[_0x4c6cac]['outboundNoSuchCallsDay']=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x38')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x39')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x3a')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x3b')]=0x0;_0x40f464[_0x4c6cac]['outboundOriginateFailureCallsDay']=0x0;_0x40f464[_0x4c6cac]['outboundRejectCallsDay']=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x3c')]=0x0;_0x40f464[_0x4c6cac][_0x0e26('0x34')]=0x0;_0x40f464[_0x4c6cac]['outboundAnswerCallsDay']=0x0;_0x40f464[_0x4c6cac]['queueStatusComplete']=!![];}}}}Realtime['prototype'][_0x0e26('0x3d')]=function(_0x555961,_0x288354){for(var _0x5ad8db in _0x288354){if(_0x555961['hasOwnProperty'](_0x5ad8db)){_0x555961[_0x5ad8db]=_0x288354[_0x5ad8db];}}};Realtime[_0x0e26('0x3e')][_0x0e26('0x3f')]=function(){var _0x3e590d=this;return function(_0x23f071){if(_0x23f071){freeIsNotKeyAgent(_0x23f071,_0x3e590d[_0x0e26('0x12')]);for(var _0xb44883=0x0,_0x19a5e4={},_0x520b3e={};_0xb44883<_0x23f071[_0x0e26('0x40')];_0xb44883+=0x1){_0x19a5e4=_0x23f071[_0xb44883];var _0x4553cb=_[_0x0e26('0x2a')](_0x19a5e4[_0x0e26('0x2b')])?util[_0x0e26('0x27')](_0x0e26('0x28'),_0x19a5e4[_0x0e26('0x29')]):_0x19a5e4[_0x0e26('0x2b')];if(_['isUndefined'](_0x3e590d['agents'][_0x4553cb])){_0x3e590d[_0x0e26('0x12')][_0x4553cb]=new Agent(_0x19a5e4);}else{_0x3e590d[_0x0e26('0x3d')](_0x3e590d[_0x0e26('0x12')][_0x4553cb],_0x19a5e4);}}}return _0x3e590d['agents'];};};Realtime['prototype'][_0x0e26('0x41')]=function(){var _0x2bfe72=this;return function(_0x10a92c){if(_0x10a92c){freeIsNotKeySip(_0x10a92c,_0x2bfe72[_0x0e26('0x42')]);for(var _0x5ea972=0x0,_0x2daaeb={},_0xce77ff={};_0x5ea972<_0x10a92c['length'];_0x5ea972+=0x1){_0x2daaeb=_0x10a92c[_0x5ea972];if(_[_0x0e26('0x43')](_0x2bfe72[_0x0e26('0x42')][util[_0x0e26('0x27')](_0x0e26('0x28'),_0x2daaeb['name'])])){_0x2bfe72[_0x0e26('0x42')][util['format'](_0x0e26('0x28'),_0x2daaeb[_0x0e26('0x29')])]=new Telephone(_0x2daaeb);}else{_0x2bfe72['mergeFromDatabase'](_0x2bfe72[_0x0e26('0x42')][util['format']('SIP/%s',_0x2daaeb[_0x0e26('0x29')])],_0x2daaeb);}}}return _0x2bfe72[_0x0e26('0x42')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x44')]=function(){var _0x12a917=this;return function(_0x40cf7c){if(_0x40cf7c){freeIsNotKeySip(_0x40cf7c,_0x12a917[_0x0e26('0x13')]);for(var _0x5a05c6=0x0,_0x2207d8={},_0x46fdfa={};_0x5a05c6<_0x40cf7c[_0x0e26('0x40')];_0x5a05c6+=0x1){_0x2207d8=_0x40cf7c[_0x5a05c6];if(_[_0x0e26('0x43')](_0x12a917[_0x0e26('0x13')][util['format']('SIP/%s',_0x2207d8['name'])])){_0x12a917[_0x0e26('0x13')][util[_0x0e26('0x27')](_0x0e26('0x28'),_0x2207d8[_0x0e26('0x29')])]=new Trunk(_0x2207d8);}else{_0x12a917[_0x0e26('0x3d')](_0x12a917[_0x0e26('0x13')][util['format'](_0x0e26('0x28'),_0x2207d8[_0x0e26('0x29')])],_0x2207d8);}}}return _0x12a917[_0x0e26('0x13')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x45')]=function(){var _0x3d3dc8=this;return function(_0x36cb0e){if(_0x36cb0e){freeIsNotKey(_0x36cb0e,_0x3d3dc8[_0x0e26('0x14')],_0x0e26('0x29'));for(var _0x36b3c3=0x0,_0x4b30e5={},_0x56e54b={};_0x36b3c3<_0x36cb0e[_0x0e26('0x40')];_0x36b3c3+=0x1){_0x4b30e5=_0x36cb0e[_0x36b3c3];if(_['isUndefined'](_0x3d3dc8[_0x0e26('0x14')][_0x4b30e5[_0x0e26('0x29')]])){_0x3d3dc8['voiceQueues'][_0x4b30e5[_0x0e26('0x29')]]=new VoiceQueue(_0x4b30e5);}else{_0x3d3dc8['mergeFromDatabase'](_0x3d3dc8[_0x0e26('0x14')][_0x4b30e5[_0x0e26('0x29')]],_0x4b30e5);}}}return _0x3d3dc8['voiceQueues'];};};Realtime[_0x0e26('0x3e')]['initTriggers']=function(){var _0x2b072a=this;return function(_0x36921d){if(_0x36921d){freeIsNotKey(_0x36921d,_0x2b072a[_0x0e26('0x15')],'id');for(var _0x4fdb74=0x0,_0x1c235e={},_0x2f8b89={};_0x4fdb74<_0x36921d['length'];_0x4fdb74+=0x1){_0x1c235e=_0x36921d[_0x4fdb74];if(_[_0x0e26('0x43')](_0x2b072a['triggers'][_0x1c235e['id']])){_0x2b072a[_0x0e26('0x15')][_0x1c235e['id']]=new Trigger(_0x1c235e);}else{_0x2b072a['mergeFromDatabase'](_0x2b072a[_0x0e26('0x15')][_0x1c235e['id']],_0x1c235e);}}}return _0x2b072a[_0x0e26('0x15')];};};Realtime['prototype'][_0x0e26('0x46')]=function(){var _0x52b73c=this;return function(_0x55f92e){if(_0x55f92e){freeIsNotKey(_0x55f92e,_0x52b73c[_0x0e26('0x47')],'id');for(var _0x965ce3=0x0,_0x208f61={},_0x31dc1e={};_0x965ce3<_0x55f92e[_0x0e26('0x40')];_0x965ce3+=0x1){_0x208f61=_0x55f92e[_0x965ce3];if(_['isUndefined'](_0x52b73c['templates'][_0x208f61['id']])){_0x52b73c[_0x0e26('0x47')][_0x208f61['id']]=new Template(_0x208f61);}else{_0x52b73c[_0x0e26('0x3d')](_0x52b73c['templates'][_0x208f61['id']],_0x208f61);}}}return _0x52b73c['templates'];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x48')]=function(){var _0x15b9af=this;return function(_0x18a0f9){if(_0x18a0f9){freeIsNotKey(_0x18a0f9,_0x15b9af[_0x0e26('0x1b')],'id');for(var _0x3c96d9=0x0,_0x4d9787={},_0x26c2fc={};_0x3c96d9<_0x18a0f9['length'];_0x3c96d9+=0x1){_0x4d9787=_0x18a0f9[_0x3c96d9];if(_[_0x0e26('0x43')](_0x15b9af[_0x0e26('0x1b')][_0x4d9787['id']])){_0x15b9af[_0x0e26('0x1b')][_0x4d9787['id']]=new ZendeskAccount(_0x4d9787);}else{_0x15b9af['mergeFromDatabase'](_0x15b9af[_0x0e26('0x1b')][_0x4d9787['id']],_0x4d9787);}}}return _0x15b9af['zendeskAccounts'];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x49')]=function(){var _0x399505=this;return function(_0x2edfea){if(_0x2edfea){freeIsNotKey(_0x2edfea,_0x399505[_0x0e26('0x1c')],'id');for(var _0x3f5458=0x0,_0x38ed50={},_0x2932e2={};_0x3f5458<_0x2edfea[_0x0e26('0x40')];_0x3f5458+=0x1){_0x38ed50=_0x2edfea[_0x3f5458];if(_[_0x0e26('0x43')](_0x399505[_0x0e26('0x1c')][_0x38ed50['id']])){_0x399505[_0x0e26('0x1c')][_0x38ed50['id']]=new SalesforceAccount(_0x38ed50);}else{_0x399505[_0x0e26('0x3d')](_0x399505['salesforceAccounts'][_0x38ed50['id']],_0x38ed50);}}}return _0x399505[_0x0e26('0x1c')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x4a')]=function(){var _0x2825be=this;return function(_0x3442fe){if(_0x3442fe){freeIsNotKey(_0x3442fe,_0x2825be[_0x0e26('0x1e')],'id');for(var _0x5d1283=0x0,_0x482d9e={},_0x7d3b8c={};_0x5d1283<_0x3442fe[_0x0e26('0x40')];_0x5d1283+=0x1){_0x482d9e=_0x3442fe[_0x5d1283];if(_['isUndefined'](_0x2825be[_0x0e26('0x1e')][_0x482d9e['id']])){_0x2825be[_0x0e26('0x1e')][_0x482d9e['id']]=new FreshdeskAccount(_0x482d9e);}else{_0x2825be[_0x0e26('0x3d')](_0x2825be[_0x0e26('0x1e')][_0x482d9e['id']],_0x482d9e);}}}return _0x2825be[_0x0e26('0x1e')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x4b')]=function(){var _0x1bce9a=this;return function(_0x221c6d){if(_0x221c6d){freeIsNotKey(_0x221c6d,_0x1bce9a[_0x0e26('0x1f')],'id');for(var _0xae0f49=0x0,_0x3d2a7a={},_0x20a0bf={};_0xae0f49<_0x221c6d[_0x0e26('0x40')];_0xae0f49+=0x1){_0x3d2a7a=_0x221c6d[_0xae0f49];if(_[_0x0e26('0x43')](_0x1bce9a[_0x0e26('0x1f')][_0x3d2a7a['id']])){_0x1bce9a[_0x0e26('0x1f')][_0x3d2a7a['id']]=new ZohoAccount(_0x3d2a7a);}else{_0x1bce9a[_0x0e26('0x3d')](_0x1bce9a[_0x0e26('0x1f')][_0x3d2a7a['id']],_0x3d2a7a);}}}return _0x1bce9a[_0x0e26('0x1f')];};};Realtime['prototype']['initDeskAccounts']=function(){var _0x109519=this;return function(_0x2c71f5){if(_0x2c71f5){freeIsNotKey(_0x2c71f5,_0x109519[_0x0e26('0x20')],'id');for(var _0x5dd90d=0x0,_0x586ee6={},_0x1b0230={};_0x5dd90d<_0x2c71f5[_0x0e26('0x40')];_0x5dd90d+=0x1){_0x586ee6=_0x2c71f5[_0x5dd90d];if(_['isUndefined'](_0x109519[_0x0e26('0x20')][_0x586ee6['id']])){_0x109519['deskAccounts'][_0x586ee6['id']]=new DeskAccount(_0x586ee6);}else{_0x109519[_0x0e26('0x3d')](_0x109519[_0x0e26('0x20')][_0x586ee6['id']],_0x586ee6);}}}return _0x109519[_0x0e26('0x20')];};};Realtime['prototype'][_0x0e26('0x4c')]=function(){var _0x890fc4=this;return function(_0x4954c9){if(_0x4954c9){freeIsNotKey(_0x4954c9,_0x890fc4[_0x0e26('0x1d')],'id');for(var _0x8ceeb=0x0,_0x513132={},_0x3f0a9f={};_0x8ceeb<_0x4954c9[_0x0e26('0x40')];_0x8ceeb+=0x1){_0x513132=_0x4954c9[_0x8ceeb];if(_[_0x0e26('0x43')](_0x890fc4[_0x0e26('0x1d')][_0x513132['id']])){_0x890fc4['sugarcrmAccounts'][_0x513132['id']]=new SugarcrmAccount(_0x513132);}else{_0x890fc4[_0x0e26('0x3d')](_0x890fc4['sugarcrmAccounts'][_0x513132['id']],_0x513132);}}}return _0x890fc4['sugarcrmAccounts'];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x4d')]=function(){var _0x288def=this;return function(_0x4ada61){if(_0x4ada61){freeIsNotKey(_0x4ada61,_0x288def['vtigerAccounts'],'id');for(var _0x2f9a0a=0x0,_0x59dce6={},_0x1b4978={};_0x2f9a0a<_0x4ada61['length'];_0x2f9a0a+=0x1){_0x59dce6=_0x4ada61[_0x2f9a0a];if(_[_0x0e26('0x43')](_0x288def[_0x0e26('0x21')][_0x59dce6['id']])){_0x288def[_0x0e26('0x21')][_0x59dce6['id']]=new VtigerAccount(_0x59dce6);}else{_0x288def[_0x0e26('0x3d')](_0x288def[_0x0e26('0x21')][_0x59dce6['id']],_0x59dce6);}}}return _0x288def['vtigerAccounts'];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x4e')]=function(){var _0x9d95e4=this;return function(_0x2bb680){if(_0x2bb680){freeIsNotKey(_0x2bb680,_0x9d95e4[_0x0e26('0x4f')],'id');for(var _0x17d570=0x0,_0x70f48a={},_0x3ebe45={};_0x17d570<_0x2bb680['length'];_0x17d570+=0x1){_0x70f48a=_0x2bb680[_0x17d570];if(_[_0x0e26('0x43')](_0x9d95e4[_0x0e26('0x4f')][_0x70f48a['id']])){_0x9d95e4[_0x0e26('0x4f')][_0x70f48a['id']]=new ServicenowAccount(_0x70f48a);}else{_0x9d95e4['mergeFromDatabase'](_0x9d95e4[_0x0e26('0x4f')][_0x70f48a['id']],_0x70f48a);}}}return _0x9d95e4[_0x0e26('0x4f')];};};Realtime[_0x0e26('0x3e')]['initDynamics365Accounts']=function(){var _0x55a198=this;return function(_0x5c13b5){if(_0x5c13b5){freeIsNotKey(_0x5c13b5,_0x55a198[_0x0e26('0x22')],'id');for(var _0x3098e9=0x0,_0x155947={},_0x819956={};_0x3098e9<_0x5c13b5[_0x0e26('0x40')];_0x3098e9+=0x1){_0x155947=_0x5c13b5[_0x3098e9];if(_[_0x0e26('0x43')](_0x55a198['dynamics365Accounts'][_0x155947['id']])){_0x55a198[_0x0e26('0x22')][_0x155947['id']]=new Dynamics365Account(_0x155947);}else{_0x55a198['mergeFromDatabase'](_0x55a198['dynamics365Accounts'][_0x155947['id']],_0x155947);}}}return _0x55a198[_0x0e26('0x22')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x50')]=function(){var _0x2af159=this;return function(_0x65b1b6){if(_0x65b1b6){freeIsNotKey(_0x65b1b6,_0x2af159[_0x0e26('0x23')],'id');for(var _0x254c73=0x0,_0x1dded5={},_0x439caf={};_0x254c73<_0x65b1b6[_0x0e26('0x40')];_0x254c73+=0x1){_0x1dded5=_0x65b1b6[_0x254c73];if(_[_0x0e26('0x43')](_0x2af159[_0x0e26('0x23')][_0x1dded5['id']])){_0x2af159[_0x0e26('0x23')][_0x1dded5['id']]=new FreshsalesAccount(_0x1dded5);}else{_0x2af159[_0x0e26('0x3d')](_0x2af159['freshsalesAccounts'][_0x1dded5['id']],_0x1dded5);}}}return _0x2af159[_0x0e26('0x23')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x51')]=function(){var _0x14e312=this;return function(_0x2f43cc){for(var _0x367d0a=0x0;_0x367d0a<_0x2f43cc[_0x0e26('0x40')];_0x367d0a+=0x1){_[_0x0e26('0x52')](_0x14e312[_0x0e26('0x14')][_0x2f43cc[_0x367d0a]['name']],_0x2f43cc[_0x367d0a]);}return _0x14e312[_0x0e26('0x14')];};};Realtime['prototype'][_0x0e26('0x53')]=function(){var _0x3d0bc8=this;return function(_0x47e92c){clearVoiceQueues(_0x3d0bc8['voiceQueues']);if(_0x47e92c){_0x47e92c=_['groupBy'](_0x47e92c,_0x0e26('0x54'));for(var _0x5d0275 in _0x47e92c){if(_0x47e92c[_0x0e26('0x26')](_0x5d0275)){var _0x5df620={};for(var _0x1ac3e0=0x0;_0x1ac3e0<_0x47e92c[_0x5d0275]['length'];_0x1ac3e0+=0x1){var _0x1f0072=_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x55')];if(_0x3d0bc8['voiceQueues'][_0x1f0072]){if(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x56')]){_0x3d0bc8[_0x0e26('0x14')][_0x1f0072]['unmanaged']+=0x1;}if(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x57')]){_0x3d0bc8[_0x0e26('0x14')][_0x1f0072][_0x0e26('0x32')]+=0x1;}_0x3d0bc8[_0x0e26('0x14')][_0x1f0072][_0x0e26('0x2e')]+=moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x58')])[_0x0e26('0x59')](moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5a')]),'seconds')||0x0;if(_0x1ac3e0===_0x47e92c[_0x5d0275][_0x0e26('0x40')]-0x1){_0x3d0bc8[_0x0e26('0x14')][_0x1f0072][_0x0e26('0x33')]+=moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5b')]||_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5c')]||_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5d')])[_0x0e26('0x59')](moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5a')]),_0x0e26('0x5e'))||0x0;_0x3d0bc8[_0x0e26('0x14')][_0x1f0072]['total']+=0x1;if(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5f')]){_0x3d0bc8[_0x0e26('0x14')][_0x1f0072][_0x0e26('0x2d')]+=0x1;_0x3d0bc8[_0x0e26('0x14')][_0x1f0072]['sumBillable']+=moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x5b')])[_0x0e26('0x59')](moment(_0x47e92c[_0x5d0275][_0x1ac3e0][_0x0e26('0x58')]),_0x0e26('0x5e'))||0x0;}}else{_0x3d0bc8['voiceQueues'][_0x1f0072][_0x0e26('0x33')]+=_0x3d0bc8['voiceQueues'][_0x1f0072]['sumHoldTime']||0x0;}}}}}}return _0x3d0bc8['voiceQueues'];};};Realtime[_0x0e26('0x3e')]['initVoiceCallReports']=function(){var _0x4db899=this;return function(_0x1a7877){clearVoiceCallReports(_0x4db899[_0x0e26('0x16')]);if(_0x1a7877){for(var _0x22aa82=0x0;_0x22aa82<_0x1a7877[_0x0e26('0x40')];_0x22aa82+=0x1){_0x4db899['outbound'][_0x0e26('0x2c')]+=0x1;_0x4db899[_0x0e26('0x16')][_0x0e26('0x33')]+=_0x1a7877[_0x22aa82]['duration'];if(_0x1a7877[_0x22aa82][_0x0e26('0x60')]===_0x0e26('0x61')){_0x4db899[_0x0e26('0x16')]['answered']+=0x1;_0x4db899[_0x0e26('0x16')][_0x0e26('0x2e')]+=_0x1a7877[_0x22aa82][_0x0e26('0x62')]-_0x1a7877[_0x22aa82]['billableseconds']||0x0;_0x4db899[_0x0e26('0x16')][_0x0e26('0x63')]+=_0x1a7877[_0x22aa82][_0x0e26('0x64')];}}}return _0x4db899[_0x0e26('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x6afef4=this;return function(_0x10ef01){if(_0x10ef01){freeIsNotKey(_0x10ef01,_0x6afef4[_0x0e26('0x65')],_0x0e26('0x29'));for(var _0x488230=0x0,_0x26413a={};_0x488230<_0x10ef01[_0x0e26('0x40')];_0x488230+=0x1){_0x26413a=_0x10ef01[_0x488230];if(_[_0x0e26('0x43')](_0x6afef4[_0x0e26('0x65')][_0x26413a[_0x0e26('0x29')]])){_0x6afef4[_0x0e26('0x65')][_0x26413a[_0x0e26('0x29')]]=new Campaign(_0x26413a);}else{_0x6afef4['mergeFromDatabase'](_0x6afef4['campaigns'][_0x26413a[_0x0e26('0x29')]],_0x26413a);_0x6afef4[_0x0e26('0x65')][_0x26413a[_0x0e26('0x29')]][_0x0e26('0x66')]=_0x26413a[_0x0e26('0x67')]?_0x26413a[_0x0e26('0x67')][_0x0e26('0x29')]:undefined;}}}return _0x6afef4[_0x0e26('0x65')];};};Realtime[_0x0e26('0x3e')][_0x0e26('0x68')]=function(){var _0x1bdfa8=this;return function(_0x2a79a6){if(_0x2a79a6){freeIsNotKey(_0x2a79a6,_0x1bdfa8[_0x0e26('0x17')],'id');for(var _0x512fae=0x0,_0x2a2419={};_0x512fae<_0x2a79a6[_0x0e26('0x40')];_0x512fae+=0x1){_0x2a2419=_0x2a79a6[_0x512fae];if(_['isUndefined'](_0x1bdfa8[_0x0e26('0x17')][_0x2a2419['id']])){_0x1bdfa8[_0x0e26('0x17')][_0x2a2419['id']]=new VoiceExtension(_0x2a2419);}else{_0x1bdfa8[_0x0e26('0x3d')](_0x1bdfa8[_0x0e26('0x17')][_0x2a2419['id']],_0x2a2419);}}}return _0x1bdfa8[_0x0e26('0x17')];};};Realtime[_0x0e26('0x3e')]['initCampaignHopperHistory']=function(){var _0x607379=this;return function(_0x2ec338){clearCampaigns(_0x607379[_0x0e26('0x65')]);for(var _0x222e95=0x0;_0x222e95<_0x2ec338['length'];_0x222e95+=0x1){_[_0x0e26('0x52')](_0x607379[_0x0e26('0x65')][_0x2ec338[_0x222e95]['name']],_0x2ec338[_0x222e95]);}return _0x607379[_0x0e26('0x65')];};};Realtime['prototype']['initFaxAccounts']=function(){var _0x53b47b=this;return function(_0x5eae56){if(_0x5eae56){freeIsNotKey(_0x5eae56,_0x53b47b[_0x0e26('0x24')],'id');for(var _0x41a4b6=0x0,_0x147fbc={},_0x1dd408={};_0x41a4b6<_0x5eae56[_0x0e26('0x40')];_0x41a4b6+=0x1){_0x147fbc=_0x5eae56[_0x41a4b6];if(_[_0x0e26('0x43')](_0x53b47b[_0x0e26('0x24')][_0x147fbc['id']])){_0x53b47b['faxAccounts'][_0x147fbc['id']]=new FaxAccount(_0x147fbc);}else{_0x53b47b[_0x0e26('0x3d')](_0x53b47b['faxAccounts'][_0x147fbc['id']],_0x147fbc);}}}return _0x53b47b[_0x0e26('0x24')];};};module[_0x0e26('0x69')]=Realtime;
\ No newline at end of file
index d584bde..1cbb9b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b1a=['getCallType','channel','split','calleridnum','outbound','internal','destination','exten','lastapplication','lastdata','queue','from-voip-provider','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','disposition','ANSWERED','callerid','calleridname','linkedid','transfers','uniqueid','type','UserId','create','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode','name','isNil','find','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys'];(function(_0x292756,_0x3d8c47){var _0x3a52d8=function(_0x3982cd){while(--_0x3982cd){_0x292756['push'](_0x292756['shift']());}};_0x3a52d8(++_0x3d8c47);}(_0x0b1a,0x85));var _0xa0b1=function(_0x9bc394,_0x42373d){_0x9bc394=_0x9bc394-0x0;var _0x16faf8=_0x0b1a[_0x9bc394];return _0x16faf8;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xa0b1('0x0'));var config=require(_0xa0b1('0x1'));var ami=require(_0xa0b1('0x2'));var RpcVoiceAgentReport=require(_0xa0b1('0x3'));var RpcVoiceCallReport=require(_0xa0b1('0x4'));var RpcVoiceDialReport=require(_0xa0b1('0x5'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xa0b1('0x6'));var RpcVoiceTransferReport=require(_0xa0b1('0x7'));var VoiceQueueReport=require(_0xa0b1('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xa0b1('0x9'));var VoiceDialReport=require(_0xa0b1('0xa'));var UserReport=require(_0xa0b1('0xb'));function Report(_0x165d76){this[_0xa0b1('0xc')]=_0x165d76;this[_0xa0b1('0xd')]=_0x165d76[_0xa0b1('0xd')];this[_0xa0b1('0xe')]=_0x165d76[_0xa0b1('0xe')];}Report[_0xa0b1('0xf')][_0xa0b1('0x10')]=function(_0x14abcb){var _0x421ace=new VoiceQueueReport(this[_0xa0b1('0xc')]);var _0x3dc9f2=new VoiceAgentReport(this[_0xa0b1('0xc')]);var _0x17a896=new VoiceDialReport(this[_0xa0b1('0xc')]);var _0xdc6b0a=new VoiceCallReport(this[_0xa0b1('0xc')]);var _0x484998=new UserReport(this[_0xa0b1('0xc')]);if(config['xdr']&&config['xdr'][_0xa0b1('0x11')]){ami['on'](_0xa0b1('0x12'),this['voiceQueueReport'][_0xa0b1('0x13')](this));ami['on'](_0xa0b1('0x14'),this[_0xa0b1('0x15')][_0xa0b1('0x13')](this));ami['on'](_0xa0b1('0x16'),this[_0xa0b1('0x17')]['bind'](this));ami['on']('custom:voiceDialReport',this[_0xa0b1('0x18')][_0xa0b1('0x13')](this));ami['on'](_0xa0b1('0x19'),this[_0xa0b1('0x1a')][_0xa0b1('0x13')](this));ami['on'](_0xa0b1('0x1b'),this[_0xa0b1('0x1c')][_0xa0b1('0x13')](this));}};Report[_0xa0b1('0xf')][_0xa0b1('0x1d')]=function(_0xa15eab){var _0x530def;_0x530def=_['find'](this[_0xa0b1('0xd')],function(_0x3dafbc){return _0x3dafbc[_0xa0b1('0x1e')]==_0xa15eab||_0x3dafbc[_0xa0b1('0x1f')]==_0xa15eab;});if(_[_0xa0b1('0x20')](_0x530def)){var _0x404610=_[_0xa0b1('0x21')](this[_0xa0b1('0xe')],function(_0x57e54b){return _0x57e54b[_0xa0b1('0x1e')]==_0xa15eab||_0x57e54b[_0xa0b1('0x1f')]==_0xa15eab;});if(_0x404610){_0x530def=_[_0xa0b1('0x21')](this['agents'],function(_0x29a7d7){return _0x29a7d7[_0xa0b1('0x22')]==util['format'](_0xa0b1('0x23'),_0x404610[_0xa0b1('0x1f')]);});}}return _0x530def;};Report[_0xa0b1('0xf')][_0xa0b1('0x24')]=function(_0x5c647c){for(var _0x1689ed=0x0;_0x1689ed<_0x5c647c[_0xa0b1('0x25')];_0x1689ed+=0x1){var _0x50fb49=this['findAgent'](_0x5c647c[_0x1689ed][_0xa0b1('0x26')]);if(_0x50fb49){_0x5c647c[_0x1689ed][_0xa0b1('0x1e')]=_0x50fb49[_0xa0b1('0x1e')];_0x5c647c[_0x1689ed][_0xa0b1('0x27')]=!![];_0x5c647c[_0x1689ed]['lastAssignedTo']=_0x50fb49[_0xa0b1('0x1f')];_0x5c647c[_0x1689ed][_0xa0b1('0x22')]=_[_0xa0b1('0x20')](_0x50fb49[_0xa0b1('0x22')])?util['format'](_0xa0b1('0x23'),_0x50fb49[_0xa0b1('0x1f')]):_0x50fb49[_0xa0b1('0x22')];if(_0x5c647c[_0x1689ed][_0xa0b1('0x28')]){_0x5c647c[_0x1689ed][_0xa0b1('0x29')]=moment()[_0xa0b1('0x2a')](_0xa0b1('0x2b'));}if(_0x5c647c[_0x1689ed][_0xa0b1('0x2c')]){_0x5c647c[_0x1689ed][_0xa0b1('0x2d')]=moment()[_0xa0b1('0x2a')](_0xa0b1('0x2b'));}RpcMemberReport[_0xa0b1('0x24')](_0x5c647c[_0x1689ed]);}RpcVoiceQueueReport['create'](_0x5c647c[_0x1689ed]);}};function extractCalleridNumber(_0x48aa74){var _0x1c6083=_0x48aa74[_0xa0b1('0x2e')](/<(.*?)>/);return _0x1c6083?_0x1c6083[0x1]:_0x48aa74;}Report[_0xa0b1('0xf')][_0xa0b1('0x2f')]=function(_0x4d4faf){for(var _0x3efe4b=0x0;_0x3efe4b<Object[_0xa0b1('0x30')](this['agents'])['length'];_0x3efe4b++){var _0x3488b2=Object[_0xa0b1('0x30')](this[_0xa0b1('0xd')])[_0x3efe4b];var _0x3bbd03=this[_0xa0b1('0xd')][_0x3488b2];if(_0x3bbd03[_0xa0b1('0x1e')]===Number(_0x4d4faf))return _0x3bbd03;}return null;};Report[_0xa0b1('0xf')][_0xa0b1('0x31')]=function(_0x3006a2){var _0x1f37cb=_0x3006a2[_0xa0b1('0x32')][_0xa0b1('0x33')]('-')[0x0];var _0x582594=this[_0xa0b1('0xd')][_0x1f37cb];if(!_0x582594)_0x582594=this[_0xa0b1('0x2f')](_0x3006a2[_0xa0b1('0x34')]);return!_0x582594?_0xa0b1('0x35'):_0xa0b1('0x36');};Report['prototype'][_0xa0b1('0x15')]=function(_0x270593){_0x270593[_0xa0b1('0x37')]=_0x270593[_0xa0b1('0x37')]||_0x270593[_0xa0b1('0x38')];if(_0x270593['type']=='dialer'){_0x270593[_0xa0b1('0x39')]='queue';_0x270593[_0xa0b1('0x3a')]=_0x270593[_0xa0b1('0x3b')];if(_0x270593['context']==_0xa0b1('0x3c')){_0x270593[_0xa0b1('0x1e')]='';_0x270593[_0xa0b1('0x37')]=extractCalleridNumber(_0x270593['callerid']);}else if(_0x270593['context']=='from-sip'){if(_0x270593[_0xa0b1('0x37')]==_0xa0b1('0x3d')){_0x270593[_0xa0b1('0x37')]=extractCalleridNumber(_0x270593[_0xa0b1('0x3e')]);_0x270593['calleridnum']=_0x270593[_0xa0b1('0x3f')];_0x270593[_0xa0b1('0x40')]=[_0x270593['channel'],_0x270593[_0xa0b1('0x32')]=_0x270593[_0xa0b1('0x40')]][0x0];_0x270593['callerid']=_0x270593[_0xa0b1('0x3e')];}else{_0x270593[_0xa0b1('0x37')]=_0x270593[_0xa0b1('0x34')];_0x270593[_0xa0b1('0x34')]=_0x270593[_0xa0b1('0x3f')];if(_0x270593[_0xa0b1('0x41')]==_0xa0b1('0x42')){_0x270593[_0xa0b1('0x1e')]=_0x270593[_0xa0b1('0x26')];}else{_0x270593[_0xa0b1('0x1e')]='';}}}}else{_0x270593[_0xa0b1('0x43')]=util[_0xa0b1('0x2a')]('\x22%s\x22\x20<%s>',_0x270593[_0xa0b1('0x44')],_0x270593[_0xa0b1('0x34')]);}if(RpcVoiceTransferReport['transfers'][_0x270593[_0xa0b1('0x45')]]){var _0x255d19=RpcVoiceTransferReport[_0xa0b1('0x46')][_0x270593[_0xa0b1('0x45')]];_0x255d19['transfereelinkedid']=_0x270593[_0xa0b1('0x47')];RpcVoiceTransferReport['blindTransfer'](_0x255d19);delete RpcVoiceTransferReport[_0xa0b1('0x46')][_0x270593[_0xa0b1('0x45')]];}if(_[_0xa0b1('0x20')](_0x270593[_0xa0b1('0x48')])){_0x270593[_0xa0b1('0x48')]=this[_0xa0b1('0x31')](_0x270593);}if(_[_0xa0b1('0x20')](_0x270593[_0xa0b1('0x49')])){var _0x134cd9=_0x270593[_0xa0b1('0x32')][_0xa0b1('0x33')]('-')[0x0];var _0x29806c=this[_0xa0b1('0xd')][_0x134cd9];if(!_0x29806c)_0x29806c=this['getAgentByInternal'](_0x270593['accountcode']);if(_0x29806c){_0x270593[_0xa0b1('0x49')]=_0x29806c['id'];_0x270593['membername']=_0x29806c['name'];}}RpcVoiceCallReport[_0xa0b1('0x4a')](_0x270593);if(_0x270593[_0xa0b1('0x4b')]){for(var _0xb88022=0x0;_0xb88022<_0x270593[_0xa0b1('0x4c')][_0xa0b1('0x25')];_0xb88022+=0x1){_0x270593[_0xa0b1('0x4d')]=_0x270593['monitors'][_0xb88022][_0xa0b1('0x4e')];_0x270593['createdAt']=_0x270593[_0xa0b1('0x4c')][_0xb88022][_0xa0b1('0x4f')];if(_0x270593['exten']==_0xa0b1('0x3d')){_0x270593['calleridnum']=_0x270593[_0xa0b1('0x26')];_0x270593[_0xa0b1('0x44')]=_0x270593['connectedlinename'];_0x270593[_0xa0b1('0x26')]=_0x270593[_0xa0b1('0x1e')];_0x270593[_0xa0b1('0x50')]=_0x270593[_0xa0b1('0x51')];_0x270593['exten']=_0x270593[_0xa0b1('0x3f')];}else if(_0x270593['exten']==_0xa0b1('0x52')){_0x270593[_0xa0b1('0x34')]=_0x270593[_0xa0b1('0x37')];_0x270593[_0xa0b1('0x38')]=_0x270593['originatecalleridnum'];}RpcVoiceRecording[_0xa0b1('0x4a')](_0x270593);}}};Report[_0xa0b1('0xf')][_0xa0b1('0x17')]=function(_0x30d0ef){if(_[_0xa0b1('0x53')](_0x30d0ef)){_0x30d0ef[_0xa0b1('0x54')](function(_0x5beeb2){RpcVoiceAgentReport[_0xa0b1('0x4a')](_0x5beeb2);});}else{RpcVoiceAgentReport['create'](_0x30d0ef);}};Report['prototype'][_0xa0b1('0x18')]=function(_0x473fcc){RpcVoiceDialReport['create'](_0x473fcc);var _0x4df142;var _0x380b0b;var _0x190c73=_0x473fcc[_0xa0b1('0x32')];if(_[_0xa0b1('0x55')](_0x190c73,_0xa0b1('0x56'))){_0x380b0b=_0x190c73[_0xa0b1('0x57')](_0x190c73[_0xa0b1('0x58')]('/')+0x1,_0x190c73[_0xa0b1('0x58')]('@'));_0x4df142=_[_0xa0b1('0x21')](this['agents'],function(_0x14296d){return _0x14296d['mobile']==_0x380b0b||_0x14296d[_0xa0b1('0x59')]==_0x380b0b||_0x14296d[_0xa0b1('0x1e')]==_0x380b0b;});}else{_0x380b0b=_0x190c73[_0xa0b1('0x57')](_0x190c73[_0xa0b1('0x58')]('/')+0x1,_0x190c73[_0xa0b1('0x5a')]('-'));_0x4df142=this[_0xa0b1('0x1d')](_0x380b0b);}if(_0x4df142){_0x473fcc[_0xa0b1('0x22')]=_[_0xa0b1('0x20')](_0x4df142[_0xa0b1('0x22')])?util['format'](_0xa0b1('0x23'),_0x4df142['name']):_0x4df142[_0xa0b1('0x22')];_0x473fcc[_0xa0b1('0x51')]=_0x4df142[_0xa0b1('0x1f')];_0x473fcc[_0xa0b1('0x1e')]=_0x4df142[_0xa0b1('0x1e')];RpcMemberReport[_0xa0b1('0x18')](_0x473fcc);}};Report['prototype'][_0xa0b1('0x1a')]=function(_0x5bcd43){RpcVoiceTransferReport['transfers'][_0x5bcd43['transfererlinkedid']]=_0x5bcd43;};Report[_0xa0b1('0xf')]['attendedTransfer']=function(_0x562096){RpcVoiceTransferReport['attendedTransfer'](_0x562096);};module['exports']=Report;
\ No newline at end of file
+var _0x4662=['./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./userReport','realtime','agents','sync','xdr','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','prototype','accountcode','name','isNil','find','interface','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','format','queuecallercompleteAt','getAgentByInternal','keys','channel','calleridnum','outbound','internal','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','uniqueid','blindTransfer','getCallType','UserId','split','create','monitor','monitors','monitorFilename','filename','createdAt','xcally-motion-preview','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','phone','substring','lastIndexOf','findAgent','exports','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport'];(function(_0x182316,_0x1f9eee){var _0x490da7=function(_0x1badd2){while(--_0x1badd2){_0x182316['push'](_0x182316['shift']());}};_0x490da7(++_0x1f9eee);}(_0x4662,0x1b6));var _0x2466=function(_0x5e6551,_0x64f18d){_0x5e6551=_0x5e6551-0x0;var _0x552dab=_0x4662[_0x5e6551];return _0x552dab;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var config=require(_0x2466('0x0'));var ami=require(_0x2466('0x1'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x2466('0x2'));var RpcMemberReport=require(_0x2466('0x3'));var RpcVoiceQueueReport=require(_0x2466('0x4'));var RpcVoiceRecording=require(_0x2466('0x5'));var RpcVoiceTransferReport=require(_0x2466('0x6'));var VoiceQueueReport=require(_0x2466('0x7'));var VoiceCallReport=require(_0x2466('0x8'));var VoiceAgentReport=require(_0x2466('0x9'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x2466('0xa'));function Report(_0x4d132e){this[_0x2466('0xb')]=_0x4d132e;this[_0x2466('0xc')]=_0x4d132e[_0x2466('0xc')];this['telephones']=_0x4d132e['telephones'];}Report['prototype'][_0x2466('0xd')]=function(_0x36cdad){var _0x374327=new VoiceQueueReport(this[_0x2466('0xb')]);var _0x252cc2=new VoiceAgentReport(this['realtime']);var _0x24e622=new VoiceDialReport(this[_0x2466('0xb')]);var _0x178aba=new VoiceCallReport(this[_0x2466('0xb')]);var _0x5f326c=new UserReport(this['realtime']);if(config['xdr']&&config[_0x2466('0xe')]['disabled']){ami['on'](_0x2466('0xf'),this[_0x2466('0x10')][_0x2466('0x11')](this));ami['on'](_0x2466('0x12'),this[_0x2466('0x13')][_0x2466('0x11')](this));ami['on'](_0x2466('0x14'),this[_0x2466('0x15')]['bind'](this));ami['on'](_0x2466('0x16'),this[_0x2466('0x17')]['bind'](this));ami['on'](_0x2466('0x18'),this['blindTransfer']['bind'](this));ami['on'](_0x2466('0x19'),this[_0x2466('0x1a')][_0x2466('0x11')](this));}};Report[_0x2466('0x1b')]['findAgent']=function(_0x329e53){var _0x231cbe;_0x231cbe=_['find'](this[_0x2466('0xc')],function(_0x5f0c54){return _0x5f0c54[_0x2466('0x1c')]==_0x329e53||_0x5f0c54[_0x2466('0x1d')]==_0x329e53;});if(_[_0x2466('0x1e')](_0x231cbe)){var _0x3b55cd=_[_0x2466('0x1f')](this['telephones'],function(_0x173e10){return _0x173e10['accountcode']==_0x329e53||_0x173e10[_0x2466('0x1d')]==_0x329e53;});if(_0x3b55cd){_0x231cbe=_['find'](this[_0x2466('0xc')],function(_0x5c0f35){return _0x5c0f35[_0x2466('0x20')]==util['format'](_0x2466('0x21'),_0x3b55cd[_0x2466('0x1d')]);});}}return _0x231cbe;};Report['prototype']['voiceQueueReport']=function(_0x3f6f74){for(var _0x2bb4e0=0x0;_0x2bb4e0<_0x3f6f74[_0x2466('0x22')];_0x2bb4e0+=0x1){var _0x21b50e=this['findAgent'](_0x3f6f74[_0x2bb4e0][_0x2466('0x23')]);if(_0x21b50e){_0x3f6f74[_0x2bb4e0][_0x2466('0x1c')]=_0x21b50e[_0x2466('0x1c')];_0x3f6f74[_0x2bb4e0][_0x2466('0x24')]=!![];_0x3f6f74[_0x2bb4e0][_0x2466('0x25')]=_0x21b50e['name'];_0x3f6f74[_0x2bb4e0]['interface']=_[_0x2466('0x1e')](_0x21b50e['interface'])?util[_0x2466('0x26')](_0x2466('0x21'),_0x21b50e[_0x2466('0x1d')]):_0x21b50e[_0x2466('0x20')];if(_0x3f6f74[_0x2bb4e0]['queuecallercomplete']){_0x3f6f74[_0x2bb4e0][_0x2466('0x27')]=moment()[_0x2466('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x3f6f74[_0x2bb4e0]['queuecallerexit']){_0x3f6f74[_0x2bb4e0]['queuecallerexitAt']=moment()[_0x2466('0x26')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport['voiceQueueReport'](_0x3f6f74[_0x2bb4e0]);}RpcVoiceQueueReport['create'](_0x3f6f74[_0x2bb4e0]);}};function extractCalleridNumber(_0x841969){var _0x152c33=_0x841969['match'](/<(.*?)>/);return _0x152c33?_0x152c33[0x1]:_0x841969;}Report[_0x2466('0x1b')][_0x2466('0x28')]=function(_0x4174f8){for(var _0x184dd5=0x0;_0x184dd5<Object[_0x2466('0x29')](this['agents'])[_0x2466('0x22')];_0x184dd5++){var _0x28e375=Object[_0x2466('0x29')](this[_0x2466('0xc')])[_0x184dd5];var _0x499e51=this['agents'][_0x28e375];if(_0x499e51[_0x2466('0x1c')]===Number(_0x4174f8))return _0x499e51;}return null;};Report[_0x2466('0x1b')]['getCallType']=function(_0x478b52){var _0x569655=_0x478b52[_0x2466('0x2a')]['split']('-')[0x0];var _0x2448c6=this[_0x2466('0xc')][_0x569655];if(!_0x2448c6)_0x2448c6=this[_0x2466('0x28')](_0x478b52[_0x2466('0x2b')]);return!_0x2448c6?_0x2466('0x2c'):_0x2466('0x2d');};Report[_0x2466('0x1b')]['voiceCallReport']=function(_0x4445c3){_0x4445c3[_0x2466('0x2e')]=_0x4445c3[_0x2466('0x2e')]||_0x4445c3[_0x2466('0x2f')];if(_0x4445c3[_0x2466('0x30')]==_0x2466('0x31')){_0x4445c3[_0x2466('0x32')]='queue';_0x4445c3['lastdata']=_0x4445c3[_0x2466('0x33')];if(_0x4445c3[_0x2466('0x34')]==_0x2466('0x35')){_0x4445c3[_0x2466('0x1c')]='';_0x4445c3[_0x2466('0x2e')]=extractCalleridNumber(_0x4445c3[_0x2466('0x36')]);}else if(_0x4445c3[_0x2466('0x34')]==_0x2466('0x37')){if(_0x4445c3['destination']=='xcally-motion-preview'){_0x4445c3[_0x2466('0x2e')]=extractCalleridNumber(_0x4445c3['calleridpreview']);_0x4445c3['calleridnum']=_0x4445c3['originatecalleridnum'];_0x4445c3[_0x2466('0x38')]=[_0x4445c3[_0x2466('0x2a')],_0x4445c3[_0x2466('0x2a')]=_0x4445c3[_0x2466('0x38')]][0x0];_0x4445c3[_0x2466('0x36')]=_0x4445c3[_0x2466('0x39')];}else{_0x4445c3[_0x2466('0x2e')]=_0x4445c3['calleridnum'];_0x4445c3[_0x2466('0x2b')]=_0x4445c3['originatecalleridnum'];if(_0x4445c3[_0x2466('0x3a')]==_0x2466('0x3b')){_0x4445c3[_0x2466('0x1c')]=_0x4445c3['connectedlinenum'];}else{_0x4445c3['accountcode']='';}}}}else{_0x4445c3['callerid']=util[_0x2466('0x26')](_0x2466('0x3c'),_0x4445c3[_0x2466('0x3d')],_0x4445c3[_0x2466('0x2b')]);}if(RpcVoiceTransferReport[_0x2466('0x3e')][_0x4445c3[_0x2466('0x3f')]]){var _0x2a0d68=RpcVoiceTransferReport['transfers'][_0x4445c3['linkedid']];_0x2a0d68['transfereelinkedid']=_0x4445c3[_0x2466('0x40')];RpcVoiceTransferReport[_0x2466('0x41')](_0x2a0d68);delete RpcVoiceTransferReport['transfers'][_0x4445c3[_0x2466('0x3f')]];}if(_[_0x2466('0x1e')](_0x4445c3[_0x2466('0x30')])){_0x4445c3[_0x2466('0x30')]=this[_0x2466('0x42')](_0x4445c3);}if(_[_0x2466('0x1e')](_0x4445c3[_0x2466('0x43')])){var _0x18c8ce=_0x4445c3[_0x2466('0x2a')][_0x2466('0x44')]('-')[0x0];var _0x4fb93e=this[_0x2466('0xc')][_0x18c8ce];if(!_0x4fb93e)_0x4fb93e=this[_0x2466('0x28')](_0x4445c3[_0x2466('0x1c')]);if(_0x4fb93e){_0x4445c3[_0x2466('0x43')]=_0x4fb93e['id'];_0x4445c3['membername']=_0x4fb93e['name'];}}RpcVoiceCallReport[_0x2466('0x45')](_0x4445c3);if(_0x4445c3[_0x2466('0x46')]){for(var _0x2f8f90=0x0;_0x2f8f90<_0x4445c3[_0x2466('0x47')][_0x2466('0x22')];_0x2f8f90+=0x1){_0x4445c3[_0x2466('0x48')]=_0x4445c3[_0x2466('0x47')][_0x2f8f90][_0x2466('0x49')];_0x4445c3[_0x2466('0x4a')]=_0x4445c3[_0x2466('0x47')][_0x2f8f90][_0x2466('0x4a')];if(_0x4445c3[_0x2466('0x2f')]==_0x2466('0x4b')){_0x4445c3['calleridnum']=_0x4445c3[_0x2466('0x23')];_0x4445c3[_0x2466('0x3d')]=_0x4445c3[_0x2466('0x4c')];_0x4445c3[_0x2466('0x23')]=_0x4445c3[_0x2466('0x1c')];_0x4445c3['connectedlinename']=_0x4445c3[_0x2466('0x4d')];_0x4445c3[_0x2466('0x2f')]=_0x4445c3[_0x2466('0x4e')];}else if(_0x4445c3[_0x2466('0x2f')]==_0x2466('0x4f')){_0x4445c3[_0x2466('0x2b')]=_0x4445c3[_0x2466('0x2e')];_0x4445c3[_0x2466('0x2f')]=_0x4445c3['originatecalleridnum'];}RpcVoiceRecording[_0x2466('0x45')](_0x4445c3);}}};Report[_0x2466('0x1b')][_0x2466('0x15')]=function(_0x30ab6){if(_[_0x2466('0x50')](_0x30ab6)){_0x30ab6[_0x2466('0x51')](function(_0x2aa289){RpcVoiceAgentReport[_0x2466('0x45')](_0x2aa289);});}else{RpcVoiceAgentReport[_0x2466('0x45')](_0x30ab6);}};Report[_0x2466('0x1b')][_0x2466('0x17')]=function(_0x13a206){RpcVoiceDialReport['create'](_0x13a206);var _0x568ac1;var _0x160c3e;var _0x27dfdc=_0x13a206[_0x2466('0x2a')];if(_[_0x2466('0x52')](_0x27dfdc,'Local')){_0x160c3e=_0x27dfdc['substring'](_0x27dfdc['indexOf']('/')+0x1,_0x27dfdc[_0x2466('0x53')]('@'));_0x568ac1=_[_0x2466('0x1f')](this[_0x2466('0xc')],function(_0x4768a8){return _0x4768a8['mobile']==_0x160c3e||_0x4768a8[_0x2466('0x54')]==_0x160c3e||_0x4768a8[_0x2466('0x1c')]==_0x160c3e;});}else{_0x160c3e=_0x27dfdc[_0x2466('0x55')](_0x27dfdc[_0x2466('0x53')]('/')+0x1,_0x27dfdc[_0x2466('0x56')]('-'));_0x568ac1=this[_0x2466('0x57')](_0x160c3e);}if(_0x568ac1){_0x13a206[_0x2466('0x20')]=_[_0x2466('0x1e')](_0x568ac1['interface'])?util[_0x2466('0x26')](_0x2466('0x21'),_0x568ac1[_0x2466('0x1d')]):_0x568ac1[_0x2466('0x20')];_0x13a206[_0x2466('0x4d')]=_0x568ac1[_0x2466('0x1d')];_0x13a206[_0x2466('0x1c')]=_0x568ac1[_0x2466('0x1c')];RpcMemberReport[_0x2466('0x17')](_0x13a206);}};Report['prototype'][_0x2466('0x41')]=function(_0x42762a){RpcVoiceTransferReport[_0x2466('0x3e')][_0x42762a['transfererlinkedid']]=_0x42762a;};Report['prototype'][_0x2466('0x1a')]=function(_0x141c19){RpcVoiceTransferReport[_0x2466('0x1a')](_0x141c19);};module[_0x2466('0x58')]=Report;
\ No newline at end of file
index 13ce635..cda5f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2d9=['[userReport][registry]\x20registry:%s\x20state:%s','username','state','[userReport][registry]','find','stateRegistry','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:%s','startsWith','Local','indexOf','mobile','syncPeerStatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','address','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','registry','syncRegistry','devicestatechange','syncDeviceState','bind','peerstatus','resolve','then','actionSipShowRegistry','catch','[userReport][sipshowregistry]','inspect','actionDeviceStateList','error','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','syncRealtimeShow','isNotNull','emit','info'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa2d9,0x78));var _0x9a2d=function(_0x27c05f,_0x2b2f4f){_0x27c05f=_0x27c05f-0x0;var _0x247676=_0xa2d9[_0x27c05f];return _0x247676;};'use strict';var _=require(_0x9a2d('0x0'));var moment=require(_0x9a2d('0x1'));var util=require(_0x9a2d('0x2'));var Redis=require(_0x9a2d('0x3'));var BPromise=require(_0x9a2d('0x4'));var config=require('../../../config/environment');var logger=require(_0x9a2d('0x5'))(_0x9a2d('0x6'));var ami=require(_0x9a2d('0x7'));config['redis']=_[_0x9a2d('0x8')](config[_0x9a2d('0x9')],{'host':_0x9a2d('0xa'),'port':0x18eb});var io=require(_0x9a2d('0xb'))(new Redis(config['redis']));function UserReport(_0x42826b){this[_0x9a2d('0xc')]=_0x42826b[_0x9a2d('0xc')];this['agents']=_0x42826b[_0x9a2d('0xd')];this[_0x9a2d('0xe')]=_0x42826b[_0x9a2d('0xe')];ami['on'](_0x9a2d('0xf'),this['syncRegistry']['bind'](this));ami['on'](_0x9a2d('0x10'),this[_0x9a2d('0x11')]['bind'](this));ami['on'](_0x9a2d('0x12'),this[_0x9a2d('0x13')][_0x9a2d('0x14')](this));ami['on'](_0x9a2d('0x15'),this['syncPeerStatus'][_0x9a2d('0x14')](this));return this['syncRealtimeShow']();}function showSipRegistrations(){Promise[_0x9a2d('0x16')]()[_0x9a2d('0x17')](ami[_0x9a2d('0x18')]())[_0x9a2d('0x19')](function(_0xf83935){logger['error'](_0x9a2d('0x1a'),util[_0x9a2d('0x1b')](_0xf83935,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x9a2d('0x16')]()[_0x9a2d('0x17')](ami[_0x9a2d('0x1c')]())['catch'](function(_0x33a4f5){logger[_0x9a2d('0x1d')](_0x9a2d('0x1e'),util[_0x9a2d('0x1b')](_0x33a4f5,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x9a2d('0x16')]()[_0x9a2d('0x17')](ami[_0x9a2d('0x1f')]())[_0x9a2d('0x19')](function(_0x56659a){logger['error'](_0x9a2d('0x20'),util[_0x9a2d('0x1b')](_0x56659a,{'showHidden':![],'depth':null}));});}UserReport[_0x9a2d('0x21')][_0x9a2d('0x22')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())['then'](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport[_0x9a2d('0x21')][_0x9a2d('0x23')]=function(_0x1da809){return _0x1da809!==null&&!_['isUndefined'](_0x1da809);};UserReport[_0x9a2d('0x21')][_0x9a2d('0x24')]=function(_0x2f280a,_0x387fac,_0x41b9f3){io['to'](_0x2f280a)[_0x9a2d('0x24')](_0x387fac,_0x41b9f3);};UserReport[_0x9a2d('0x21')][_0x9a2d('0x11')]=function(_0x340cbd){try{if(this[_0x9a2d('0x23')](_0x340cbd)){logger[_0x9a2d('0x25')](_0x9a2d('0x26'),_0x340cbd[_0x9a2d('0x27')],_0x340cbd[_0x9a2d('0x28')]);logger['debug'](_0x9a2d('0x29'),util[_0x9a2d('0x1b')](_0x340cbd,{'showHidden':![],'depth':null}));var _0x5a9fc9=_[_0x9a2d('0x2a')](this[_0x9a2d('0xc')],{'defaultuser':_0x340cbd['username']});if(_0x5a9fc9){_0x340cbd[_0x9a2d('0x2b')]=_0x340cbd[_0x9a2d('0x28')];_['merge'](_0x5a9fc9,_[_0x9a2d('0x2c')](_0x340cbd,[_0x9a2d('0x2d'),_0x9a2d('0x2e'),_0x9a2d('0x27'),_0x9a2d('0x28')]));logger[_0x9a2d('0x2f')](_0x9a2d('0x30'),util[_0x9a2d('0x1b')](_0x5a9fc9,{'showHidden':![],'depth':null}));this[_0x9a2d('0x24')](util[_0x9a2d('0x31')]('trunk:%s',_0x5a9fc9[_0x9a2d('0x32')]),_0x9a2d('0x33'),_0x5a9fc9);}}}catch(_0x90c985){logger['error'](_0x9a2d('0x29'),util[_0x9a2d('0x1b')](_0x90c985,{'showHidden':![],'depth':null}));}};UserReport[_0x9a2d('0x21')][_0x9a2d('0x13')]=function(_0xa0c4af){try{if(this[_0x9a2d('0x23')](_0xa0c4af)){logger['info'](_0x9a2d('0x34'),_0xa0c4af[_0x9a2d('0x35')],_0xa0c4af[_0x9a2d('0x28')]);logger[_0x9a2d('0x2f')](_0x9a2d('0x36'),util[_0x9a2d('0x1b')](_0xa0c4af,{'showHidden':![],'depth':null}));if(this[_0x9a2d('0xd')][_0xa0c4af['device']]){if(!this['agents'][_0xa0c4af[_0x9a2d('0x35')]]['local']||_0xa0c4af[_0x9a2d('0x28')][_0x9a2d('0x37')]()==_0x9a2d('0x38')){this[_0x9a2d('0xd')][_0xa0c4af['device']][_0x9a2d('0x39')]=![];if(this[_0x9a2d('0xd')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x28')]!==_0xa0c4af[_0x9a2d('0x28')]['toLowerCase']()){this[_0x9a2d('0xd')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x3a')]=_[_0x9a2d('0x3b')](moment()[_0x9a2d('0x31')]('x'));}this['agents'][_0xa0c4af['device']]['state']=_0xa0c4af[_0x9a2d('0x28')][_0x9a2d('0x37')]();this[_0x9a2d('0xd')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x3c')](_0xa0c4af);}}else if(this[_0x9a2d('0xe')][_0xa0c4af[_0x9a2d('0x35')]]){if(this['telephones'][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x28')]!==_0xa0c4af[_0x9a2d('0x28')][_0x9a2d('0x37')]()){this[_0x9a2d('0xe')][_0xa0c4af['device']][_0x9a2d('0x3a')]=_[_0x9a2d('0x3b')](moment()[_0x9a2d('0x31')]('x'));}this['telephones'][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x28')]=_0xa0c4af[_0x9a2d('0x28')]['toLowerCase']();logger[_0x9a2d('0x2f')](_0x9a2d('0x3d'),util[_0x9a2d('0x1b')](this[_0x9a2d('0xe')][_0xa0c4af[_0x9a2d('0x35')]],{'showHidden':![],'depth':null}));this[_0x9a2d('0x24')](util['format'](_0x9a2d('0x3e'),this[_0x9a2d('0xe')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x32')]),'telephone:save',this[_0x9a2d('0xe')][_0xa0c4af[_0x9a2d('0x35')]]);}else if(this[_0x9a2d('0xc')][_0xa0c4af[_0x9a2d('0x35')]]){if(this[_0x9a2d('0xc')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x28')]!==_0xa0c4af[_0x9a2d('0x28')][_0x9a2d('0x37')]()){this[_0x9a2d('0xc')][_0xa0c4af[_0x9a2d('0x35')]]['stateTime']=_['toNumber'](moment()[_0x9a2d('0x31')]('x'));}this['trunks'][_0xa0c4af['device']][_0x9a2d('0x28')]=_0xa0c4af[_0x9a2d('0x28')][_0x9a2d('0x37')]();logger['debug'](_0x9a2d('0x3f'),util['inspect'](this[_0x9a2d('0xc')][_0xa0c4af['device']],{'showHidden':![],'depth':null}));this['emit'](util[_0x9a2d('0x31')](_0x9a2d('0x40'),this[_0x9a2d('0xc')][_0xa0c4af[_0x9a2d('0x35')]][_0x9a2d('0x32')]),_0x9a2d('0x33'),this[_0x9a2d('0xc')][_0xa0c4af[_0x9a2d('0x35')]]);}else if(_[_0x9a2d('0x41')](_0xa0c4af[_0x9a2d('0x35')],_0x9a2d('0x42'))){var _0x4ae089=_0xa0c4af[_0x9a2d('0x35')];var _0x3abdaf=_0x4ae089['substring'](_0x4ae089[_0x9a2d('0x43')]('/')+0x1,_0x4ae089[_0x9a2d('0x43')]('@'));var _0xeac077=_[_0x9a2d('0x2a')](this[_0x9a2d('0xd')],function(_0xde969c){return _0xde969c[_0x9a2d('0x44')]==_0x3abdaf||_0xde969c['phone']==_0x3abdaf||_0xde969c['accountcode']==_0x3abdaf;});if(_0xeac077){if(_0xeac077[_0x9a2d('0x28')]!==_0xa0c4af['state'][_0x9a2d('0x37')]()){_0xeac077['stateTime']=_[_0x9a2d('0x3b')](moment()[_0x9a2d('0x31')]('x'));}_0xeac077[_0x9a2d('0x28')]=_0xa0c4af[_0x9a2d('0x28')]['toLowerCase']();_0xeac077[_0x9a2d('0x39')]=!![];_0xeac077[_0x9a2d('0x3c')](_0xa0c4af);}}}}catch(_0x1cdf27){logger[_0x9a2d('0x1d')]('[userReport][devicestatechange]',util[_0x9a2d('0x1b')](_0x1cdf27,{'showHidden':![],'depth':null}));}};UserReport[_0x9a2d('0x21')][_0x9a2d('0x45')]=function(_0x3bc509){try{if(this[_0x9a2d('0x23')](_0x3bc509)&&this['isNotNull'](_0x3bc509[_0x9a2d('0x15')])){logger['info'](_0x9a2d('0x46'),_0x3bc509[_0x9a2d('0x47')],_0x3bc509['address'],_0x3bc509[_0x9a2d('0x15')]);logger[_0x9a2d('0x2f')](_0x9a2d('0x48'),util[_0x9a2d('0x1b')](_0x3bc509,{'showHidden':![],'depth':null}));if(this[_0x9a2d('0xd')][_0x3bc509[_0x9a2d('0x47')]]){if(!this[_0x9a2d('0xd')][_0x3bc509[_0x9a2d('0x47')]]['local']||_0x3bc509[_0x9a2d('0x15')][_0x9a2d('0x37')]()==_0x9a2d('0x49')){this[_0x9a2d('0xd')][_0x3bc509[_0x9a2d('0x47')]][_0x9a2d('0x39')]=![];this[_0x9a2d('0xd')][_0x3bc509[_0x9a2d('0x47')]]['status']=_0x3bc509['peerstatus'][_0x9a2d('0x37')]();this[_0x9a2d('0xd')][_0x3bc509['peer']][_0x9a2d('0x4a')]=_0x3bc509[_0x9a2d('0x4a')];this['agents'][_0x3bc509['peer']][_0x9a2d('0x3c')](_0x3bc509);}}else if(this[_0x9a2d('0xe')][_0x3bc509[_0x9a2d('0x47')]]){this[_0x9a2d('0xe')][_0x3bc509['peer']][_0x9a2d('0x4b')]=_0x3bc509[_0x9a2d('0x15')]['toLowerCase']();this[_0x9a2d('0xe')][_0x3bc509[_0x9a2d('0x47')]][_0x9a2d('0x4a')]=_0x3bc509[_0x9a2d('0x4a')];logger[_0x9a2d('0x2f')](_0x9a2d('0x4c'),util[_0x9a2d('0x1b')](this[_0x9a2d('0xe')][_0x3bc509[_0x9a2d('0x47')]],{'showHidden':![],'depth':null}));this['emit'](util['format']('telephone:%s',this[_0x9a2d('0xe')][_0x3bc509[_0x9a2d('0x47')]][_0x9a2d('0x32')]),_0x9a2d('0x4d'),this[_0x9a2d('0xe')][_0x3bc509[_0x9a2d('0x47')]]);}else if(this['trunks'][_0x3bc509['peer']]){this['trunks'][_0x3bc509[_0x9a2d('0x47')]][_0x9a2d('0x4b')]=_0x3bc509[_0x9a2d('0x15')][_0x9a2d('0x37')]();this[_0x9a2d('0xc')][_0x3bc509[_0x9a2d('0x47')]]['address']=_0x3bc509['address'];logger['debug'](_0x9a2d('0x4e'),util[_0x9a2d('0x1b')](this[_0x9a2d('0xc')][_0x3bc509['peer']],{'showHidden':![],'depth':null}));this[_0x9a2d('0x24')](util[_0x9a2d('0x31')](_0x9a2d('0x40'),this[_0x9a2d('0xc')][_0x3bc509[_0x9a2d('0x47')]][_0x9a2d('0x32')]),_0x9a2d('0x33'),this[_0x9a2d('0xc')][_0x3bc509[_0x9a2d('0x47')]]);}}}catch(_0x226f13){logger['error']('[userReport][peerstatus]',util[_0x9a2d('0x1b')](_0x226f13,{'showHidden':![],'depth':null}));}};module['exports']=UserReport;
\ No newline at end of file
+var _0xe276=['telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','updateStatusRealtime','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','[userReport][peerstatus]','registered','status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','exports','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','../ami','defaults','redis','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','catch','error','inspect','then','actionDeviceStateList','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','state','debug','find','username','stateRegistry','merge','omit','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','trunk:save','[userReport][registry]','syncDeviceState','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','name'];(function(_0x52736d,_0x4b8130){var _0x215225=function(_0x261932){while(--_0x261932){_0x52736d['push'](_0x52736d['shift']());}};_0x215225(++_0x4b8130);}(_0xe276,0xac));var _0x6e27=function(_0x305528,_0x263ca6){_0x305528=_0x305528-0x0;var _0x2531f0=_0xe276[_0x305528];return _0x2531f0;};'use strict';var _=require('lodash');var moment=require(_0x6e27('0x0'));var util=require(_0x6e27('0x1'));var Redis=require(_0x6e27('0x2'));var BPromise=require(_0x6e27('0x3'));var config=require(_0x6e27('0x4'));var logger=require(_0x6e27('0x5'))('ami');var ami=require(_0x6e27('0x6'));config['redis']=_[_0x6e27('0x7')](config[_0x6e27('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x6e27('0x9'))(new Redis(config['redis']));function UserReport(_0x443f44){this['trunks']=_0x443f44[_0x6e27('0xa')];this[_0x6e27('0xb')]=_0x443f44[_0x6e27('0xb')];this[_0x6e27('0xc')]=_0x443f44['telephones'];ami['on'](_0x6e27('0xd'),this[_0x6e27('0xe')][_0x6e27('0xf')](this));ami['on'](_0x6e27('0x10'),this[_0x6e27('0xe')][_0x6e27('0xf')](this));ami['on'](_0x6e27('0x11'),this['syncDeviceState'][_0x6e27('0xf')](this));ami['on'](_0x6e27('0x12'),this[_0x6e27('0x13')][_0x6e27('0xf')](this));return this[_0x6e27('0x14')]();}function showSipRegistrations(){Promise[_0x6e27('0x15')]()['then'](ami['actionSipShowRegistry']())[_0x6e27('0x16')](function(_0x37a07e){logger[_0x6e27('0x17')]('[userReport][sipshowregistry]',util[_0x6e27('0x18')](_0x37a07e,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x6e27('0x15')]()[_0x6e27('0x19')](ami[_0x6e27('0x1a')]())['catch'](function(_0x428d56){logger[_0x6e27('0x17')]('[userReport][devicestatelist]',util[_0x6e27('0x18')](_0x428d56,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x6e27('0x15')]()[_0x6e27('0x19')](ami['actionSipPeerStatus']())[_0x6e27('0x16')](function(_0x1e598a){logger[_0x6e27('0x17')](_0x6e27('0x1b'),util[_0x6e27('0x18')](_0x1e598a,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x6e27('0x14')]=function(){setInterval(function(){BPromise[_0x6e27('0x15')]()['then'](showSipRegistrations())[_0x6e27('0x19')](listDeviceStates())[_0x6e27('0x19')](showPeersStatus());},0x32c8);};UserReport[_0x6e27('0x1c')]['isNotNull']=function(_0x28d413){return _0x28d413!==null&&!_[_0x6e27('0x1d')](_0x28d413);};UserReport['prototype'][_0x6e27('0x1e')]=function(_0x490750,_0x2a8a8e,_0x42a53d){io['to'](_0x490750)[_0x6e27('0x1e')](_0x2a8a8e,_0x42a53d);};UserReport[_0x6e27('0x1c')][_0x6e27('0xe')]=function(_0x535f80){try{if(this[_0x6e27('0x1f')](_0x535f80)){logger['info'](_0x6e27('0x20'),_0x535f80['username'],_0x535f80[_0x6e27('0x21')]);logger[_0x6e27('0x22')]('[userReport][registry]',util[_0x6e27('0x18')](_0x535f80,{'showHidden':![],'depth':null}));var _0x54747a=_[_0x6e27('0x23')](this[_0x6e27('0xa')],{'defaultuser':_0x535f80[_0x6e27('0x24')]});if(_0x54747a){_0x535f80[_0x6e27('0x25')]=_0x535f80[_0x6e27('0x21')];_[_0x6e27('0x26')](_0x54747a,_[_0x6e27('0x27')](_0x535f80,['event',_0x6e27('0x28'),_0x6e27('0x24'),'state']));logger[_0x6e27('0x22')](_0x6e27('0x29'),util[_0x6e27('0x18')](_0x54747a,{'showHidden':![],'depth':null}));this['emit'](util[_0x6e27('0x2a')](_0x6e27('0x2b'),_0x54747a['name']),_0x6e27('0x2c'),_0x54747a);}}}catch(_0x2cbc92){logger[_0x6e27('0x17')](_0x6e27('0x2d'),util[_0x6e27('0x18')](_0x2cbc92,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x6e27('0x2e')]=function(_0x29ccba){try{if(this[_0x6e27('0x1f')](_0x29ccba)){logger[_0x6e27('0x2f')](_0x6e27('0x30'),_0x29ccba[_0x6e27('0x31')],_0x29ccba[_0x6e27('0x21')]);logger['debug'](_0x6e27('0x32'),util[_0x6e27('0x18')](_0x29ccba,{'showHidden':![],'depth':null}));if(this[_0x6e27('0xb')][_0x29ccba['device']]){if(!this[_0x6e27('0xb')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x33')]||_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]()==_0x6e27('0x35')){this['agents'][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x33')]=![];if(this[_0x6e27('0xb')][_0x29ccba['device']][_0x6e27('0x21')]!==_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]()){this['agents'][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x36')]=_[_0x6e27('0x37')](moment()[_0x6e27('0x2a')]('x'));}this[_0x6e27('0xb')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x21')]=_0x29ccba['state'][_0x6e27('0x34')]();this[_0x6e27('0xb')][_0x29ccba[_0x6e27('0x31')]]['updateStatusRealtime'](_0x29ccba);}}else if(this[_0x6e27('0xc')][_0x29ccba['device']]){if(this[_0x6e27('0xc')][_0x29ccba['device']]['state']!==_0x29ccba['state'][_0x6e27('0x34')]()){this[_0x6e27('0xc')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x36')]=_[_0x6e27('0x37')](moment()[_0x6e27('0x2a')]('x'));}this[_0x6e27('0xc')][_0x29ccba[_0x6e27('0x31')]]['state']=_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]();logger[_0x6e27('0x22')](_0x6e27('0x38'),util[_0x6e27('0x18')](this[_0x6e27('0xc')][_0x29ccba[_0x6e27('0x31')]],{'showHidden':![],'depth':null}));this[_0x6e27('0x1e')](util[_0x6e27('0x2a')](_0x6e27('0x39'),this[_0x6e27('0xc')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x3a')]),_0x6e27('0x3b'),this[_0x6e27('0xc')][_0x29ccba['device']]);}else if(this['trunks'][_0x29ccba[_0x6e27('0x31')]]){if(this[_0x6e27('0xa')][_0x29ccba[_0x6e27('0x31')]]['state']!==_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]()){this['trunks'][_0x29ccba[_0x6e27('0x31')]]['stateTime']=_[_0x6e27('0x37')](moment()[_0x6e27('0x2a')]('x'));}this[_0x6e27('0xa')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x21')]=_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]();logger[_0x6e27('0x22')](_0x6e27('0x3c'),util[_0x6e27('0x18')](this['trunks'][_0x29ccba[_0x6e27('0x31')]],{'showHidden':![],'depth':null}));this[_0x6e27('0x1e')](util['format'](_0x6e27('0x2b'),this[_0x6e27('0xa')][_0x29ccba[_0x6e27('0x31')]][_0x6e27('0x3a')]),_0x6e27('0x2c'),this[_0x6e27('0xa')][_0x29ccba[_0x6e27('0x31')]]);}else if(_[_0x6e27('0x3d')](_0x29ccba[_0x6e27('0x31')],_0x6e27('0x3e'))){var _0x355ac7=_0x29ccba[_0x6e27('0x31')];var _0x582788=_0x355ac7[_0x6e27('0x3f')](_0x355ac7[_0x6e27('0x40')]('/')+0x1,_0x355ac7[_0x6e27('0x40')]('@'));var _0x1bd13e=_[_0x6e27('0x23')](this['agents'],function(_0xf4aef5){return _0xf4aef5[_0x6e27('0x41')]==_0x582788||_0xf4aef5[_0x6e27('0x42')]==_0x582788||_0xf4aef5[_0x6e27('0x43')]==_0x582788;});if(_0x1bd13e){if(_0x1bd13e[_0x6e27('0x21')]!==_0x29ccba[_0x6e27('0x21')][_0x6e27('0x34')]()){_0x1bd13e[_0x6e27('0x36')]=_[_0x6e27('0x37')](moment()[_0x6e27('0x2a')]('x'));}_0x1bd13e[_0x6e27('0x21')]=_0x29ccba['state'][_0x6e27('0x34')]();_0x1bd13e[_0x6e27('0x33')]=!![];_0x1bd13e[_0x6e27('0x44')](_0x29ccba);}}}}catch(_0x298152){logger[_0x6e27('0x17')](_0x6e27('0x32'),util['inspect'](_0x298152,{'showHidden':![],'depth':null}));}};UserReport[_0x6e27('0x1c')][_0x6e27('0x13')]=function(_0x327aaf){try{if(this[_0x6e27('0x1f')](_0x327aaf)&&this[_0x6e27('0x1f')](_0x327aaf[_0x6e27('0x12')])){logger[_0x6e27('0x2f')](_0x6e27('0x45'),_0x327aaf[_0x6e27('0x46')],_0x327aaf['address'],_0x327aaf[_0x6e27('0x12')]);logger[_0x6e27('0x22')](_0x6e27('0x47'),util[_0x6e27('0x18')](_0x327aaf,{'showHidden':![],'depth':null}));if(this[_0x6e27('0xb')][_0x327aaf['peer']]){if(!this['agents'][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x33')]||_0x327aaf[_0x6e27('0x12')][_0x6e27('0x34')]()==_0x6e27('0x48')){this[_0x6e27('0xb')][_0x327aaf[_0x6e27('0x46')]]['local']=![];this['agents'][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x49')]=_0x327aaf[_0x6e27('0x12')][_0x6e27('0x34')]();this[_0x6e27('0xb')][_0x327aaf['peer']]['address']=_0x327aaf['address'];this['agents'][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x44')](_0x327aaf);}}else if(this[_0x6e27('0xc')][_0x327aaf['peer']]){this[_0x6e27('0xc')][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x49')]=_0x327aaf[_0x6e27('0x12')][_0x6e27('0x34')]();this['telephones'][_0x327aaf[_0x6e27('0x46')]]['address']=_0x327aaf[_0x6e27('0x4a')];logger[_0x6e27('0x22')](_0x6e27('0x4b'),util[_0x6e27('0x18')](this[_0x6e27('0xc')][_0x327aaf[_0x6e27('0x46')]],{'showHidden':![],'depth':null}));this[_0x6e27('0x1e')](util[_0x6e27('0x2a')](_0x6e27('0x39'),this['telephones'][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x3a')]),'telephone:save',this[_0x6e27('0xc')][_0x327aaf[_0x6e27('0x46')]]);}else if(this['trunks'][_0x327aaf['peer']]){this[_0x6e27('0xa')][_0x327aaf[_0x6e27('0x46')]][_0x6e27('0x49')]=_0x327aaf[_0x6e27('0x12')][_0x6e27('0x34')]();this['trunks'][_0x327aaf[_0x6e27('0x46')]]['address']=_0x327aaf[_0x6e27('0x4a')];logger[_0x6e27('0x22')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util[_0x6e27('0x18')](this[_0x6e27('0xa')][_0x327aaf[_0x6e27('0x46')]],{'showHidden':![],'depth':null}));this['emit'](util[_0x6e27('0x2a')](_0x6e27('0x2b'),this[_0x6e27('0xa')][_0x327aaf['peer']]['name']),_0x6e27('0x2c'),this[_0x6e27('0xa')][_0x327aaf[_0x6e27('0x46')]]);}}}catch(_0x305c50){logger[_0x6e27('0x17')](_0x6e27('0x47'),util['inspect'](_0x305c50,{'showHidden':![],'depth':null}));}};module[_0x6e27('0x4c')]=UserReport;
\ No newline at end of file
index 45dcc61..ac2b7ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdec8=['destchannelstatedesc','holdtime','routealias','merge','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentringnoanswerAt','answeredelsewheredestinationuniqueid','lastevent','answered_elsewhere','reason','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','custom:agentcomplete','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','[%s][voiceAgentReport][varset]\x20event:','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','values','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','syncMusicOnHoldStart','channel','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','substring','lastIndexOf','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','voiceChannels','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','syncAgentComplete','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','voice','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:called','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','connectedlinename','connectedlinenum','destchannelstate'];(function(_0x1176d9,_0x2a1b64){var _0x3d1cb6=function(_0xe01528){while(--_0xe01528){_0x1176d9['push'](_0x1176d9['shift']());}};_0x3d1cb6(++_0x2a1b64);}(_0xdec8,0xef));var _0x8dec=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xdec8[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x8dec('0x0'));var moment=require(_0x8dec('0x1'));var util=require('util');var Redis=require(_0x8dec('0x2'));var config=require(_0x8dec('0x3'));var logger=require(_0x8dec('0x4'))(_0x8dec('0x5'));var ami=require(_0x8dec('0x6'));config[_0x8dec('0x7')]=_[_0x8dec('0x8')](config[_0x8dec('0x7')],{'host':_0x8dec('0x9'),'port':0x18eb});var io=require(_0x8dec('0xa'))(new Redis(config[_0x8dec('0x7')]));function VoiceAgentReport(_0x34143d){this['channels']={};this[_0x8dec('0xb')]=_0x34143d[_0x8dec('0xc')];this[_0x8dec('0xd')]=_0x34143d[_0x8dec('0xd')];this[_0x8dec('0xe')]=_0x34143d[_0x8dec('0xe')];this[_0x8dec('0xf')]={};ami['on'](_0x8dec('0x10'),this[_0x8dec('0x11')][_0x8dec('0x12')](this));ami['on'](_0x8dec('0x13'),this[_0x8dec('0x14')][_0x8dec('0x12')](this));ami['on'](_0x8dec('0x15'),this[_0x8dec('0x16')][_0x8dec('0x12')](this));ami['on'](_0x8dec('0x17'),this['syncQueueCallerAbandon'][_0x8dec('0x12')](this));ami['on'](_0x8dec('0x18'),this[_0x8dec('0x19')][_0x8dec('0x12')](this));ami['on']('varset',this[_0x8dec('0x1a')]['bind'](this));ami['on'](_0x8dec('0x1b'),this[_0x8dec('0x1c')][_0x8dec('0x12')](this));ami['on'](_0x8dec('0x1d'),this['syncMusicOnHoldStart'][_0x8dec('0x12')](this));ami['on']('musiconholdstop',this[_0x8dec('0x1e')]['bind'](this));ami['on'](_0x8dec('0x1f'),this['syncAttendedTransfer'][_0x8dec('0x12')](this));ami['on']('blindtransfer',this[_0x8dec('0x20')][_0x8dec('0x12')](this));}VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x22')]=function(_0x4f96f4,_0xdcdfb5,_0x1d7200){io['to'](_0x4f96f4)[_0x8dec('0x22')](_0xdcdfb5,_0x1d7200);};VoiceAgentReport['prototype'][_0x8dec('0x23')]=function(_0x5930d9){return _0x5930d9!==null&&!_[_0x8dec('0x24')](_0x5930d9);};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x11')]=function(_0x2de7ba){try{if(this[_0x8dec('0x23')](_0x2de7ba)){logger[_0x8dec('0x25')](_0x8dec('0x26'),_0x2de7ba[_0x8dec('0x27')],_0x2de7ba[_0x8dec('0x28')],_0x2de7ba['destuniqueid']);logger[_0x8dec('0x29')](_0x8dec('0x2a'),_0x2de7ba[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x2de7ba,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['channels'][_0x2de7ba['uniqueid']])){this[_0x8dec('0xc')][_0x2de7ba[_0x8dec('0x27')]]={};}if(_[_0x8dec('0x24')](this[_0x8dec('0xc')][_0x2de7ba[_0x8dec('0x27')]][_0x2de7ba[_0x8dec('0x2c')]])){this[_0x8dec('0xc')][_0x2de7ba[_0x8dec('0x27')]][_0x2de7ba['destuniqueid']]={'agentcalledAt':moment()[_0x8dec('0x2d')](_0x8dec('0x2e')),'lastevent':_0x8dec('0x2f'),'mandatoryDisposition':this[_0x8dec('0xd')][_0x2de7ba[_0x8dec('0x30')]]?this[_0x8dec('0xd')][_0x2de7ba['queue']][_0x8dec('0x31')]||![]:![],'type':this[_0x8dec('0xd')][_0x2de7ba[_0x8dec('0x30')]]?this[_0x8dec('0xd')][_0x2de7ba[_0x8dec('0x30')]][_0x8dec('0x32')]||_0x8dec('0x33'):_0x8dec('0x33'),'variables':this[_0x8dec('0xf')][_0x2de7ba[_0x8dec('0x27')]],'motionChannel':_0x8dec('0x34')};}_['merge'](this['channels'][_0x2de7ba[_0x8dec('0x27')]][_0x2de7ba['destuniqueid']],_['omit'](_0x2de7ba,[_0x8dec('0x35'),_0x8dec('0x36')]));logger['debug'](_0x8dec('0x37'),_0x2de7ba[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x2de7ba[_0x8dec('0x27')]][_0x2de7ba['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x38'),this[_0x8dec('0xc')][_0x2de7ba[_0x8dec('0x27')]][_0x2de7ba[_0x8dec('0x2c')]]);var _0xe956a9={'id':this[_0x8dec('0xe')][_0x2de7ba[_0x8dec('0x39')]]['id'],'calleridnum':this[_0x8dec('0xc')][_0x2de7ba['uniqueid']][_0x2de7ba[_0x8dec('0x2c')]][_0x8dec('0x3a')],'queue':this[_0x8dec('0xc')][_0x2de7ba['uniqueid']][_0x2de7ba[_0x8dec('0x2c')]]['queue'],'variables':this[_0x8dec('0xc')][_0x2de7ba['uniqueid']][_0x2de7ba[_0x8dec('0x2c')]][_0x8dec('0xf')]};logger[_0x8dec('0x29')](_0x8dec('0x3b'),_0x2de7ba[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0xe956a9,{'showHidden':![],'depth':null}));this[_0x8dec('0x22')](util['format']('user:%s',_0x2de7ba['membername']),_0x8dec('0x3c'),_0xe956a9);}}catch(_0x58be1d){logger['error'](_0x8dec('0x3d'),_0x2de7ba[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x58be1d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x14')]=function(_0x1a669c){try{if(this['isNotNull'](_0x1a669c)){if(this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]]){logger['debug']('[%s][voiceAgentReport][agentconnect]\x20event:',_0x1a669c[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x1a669c,{'showHidden':![],'depth':null}));for(var _0x278edd in this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]]){if(this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x8dec('0x3e')](_0x278edd)){if(_0x1a669c[_0x8dec('0x2c')]===_0x278edd){logger[_0x8dec('0x25')](_0x8dec('0x3f'),_0x1a669c[_0x8dec('0x27')],_0x1a669c['membername'],_0x1a669c[_0x8dec('0x2c')]);this['channels'][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['agentconnectAt']=moment()[_0x8dec('0x2d')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x40')]=_0x1a669c[_0x8dec('0x40')];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['connectedlinenum']=_0x1a669c[_0x8dec('0x41')];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x42')]=_0x1a669c['destchannelstate'];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x43')]=_0x1a669c['destchannelstatedesc'];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x44')]=_0x1a669c['holdtime'];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['lastevent']='connect';if(this[_0x8dec('0xb')][this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x27')]]){var _0x257221=this['voiceChannels'][this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x27')]][_0x8dec('0x45')];this[_0x8dec('0xc')][_0x1a669c['uniqueid']][_0x278edd][_0x8dec('0x45')]=_0x257221;_0x1a669c['routealias']=_0x257221;}_[_0x8dec('0x46')](this[_0x8dec('0xe')][_0x1a669c[_0x8dec('0x39')]],_[_0x8dec('0x47')](_0x1a669c,[_0x8dec('0x30'),_0x8dec('0x48'),_0x8dec('0x45')]));logger[_0x8dec('0x29')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x1a669c[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x1a669c[_0x8dec('0x2c')]],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x49'),this['channels'][_0x1a669c[_0x8dec('0x27')]][_0x1a669c['destuniqueid']]);logger[_0x8dec('0x29')](_0x8dec('0x4a'),_0x1a669c[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x1a669c['destuniqueid']],{'showHidden':![],'depth':null}));this['emit'](util[_0x8dec('0x2d')]('user:%s',_0x1a669c[_0x8dec('0x28')]),_0x8dec('0x4b'),this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x1a669c['destuniqueid']]);}else if(!this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['agentringnoanswer']&&!this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['agentcomplete']){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere',_0x1a669c[_0x8dec('0x27')],this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x28')],_0x278edd);this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x15')]=!![];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x4c')]=moment()[_0x8dec('0x2d')](_0x8dec('0x2e'));this[_0x8dec('0xc')][_0x1a669c['uniqueid']][_0x278edd][_0x8dec('0x4d')]=_0x1a669c[_0x8dec('0x2c')];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd]['answeredelsewheremembername']=_0x1a669c[_0x8dec('0x28')];this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd][_0x8dec('0x4e')]=_0x8dec('0x4f');this['channels'][_0x1a669c['uniqueid']][_0x278edd][_0x8dec('0x50')]=_0x8dec('0x4f');logger[_0x8dec('0x29')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x1a669c[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x1a669c[_0x8dec('0x27')]][_0x278edd],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x51'),this['channels'][_0x1a669c['uniqueid']][_0x278edd]);}}}}}}catch(_0x1a40de){logger['error'](_0x8dec('0x52'),_0x1a669c[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x1a40de,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x16')]=function(_0x2fadfc){try{if(this[_0x8dec('0x23')](_0x2fadfc)){logger['debug'](_0x8dec('0x53'),_0x2fadfc['uniqueid'],util[_0x8dec('0x2b')](_0x2fadfc,{'showHidden':![],'depth':null}));if(this[_0x8dec('0xc')][_0x2fadfc[_0x8dec('0x27')]]&&this['channels'][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc[_0x8dec('0x2c')]]){logger['info']('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x2fadfc[_0x8dec('0x27')],_0x2fadfc[_0x8dec('0x28')],_0x2fadfc[_0x8dec('0x2c')]);this[_0x8dec('0xc')][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc[_0x8dec('0x2c')]][_0x8dec('0x15')]=!![];this[_0x8dec('0xc')][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc['destuniqueid']][_0x8dec('0x4c')]=moment()[_0x8dec('0x2d')](_0x8dec('0x2e'));this['channels'][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc[_0x8dec('0x2c')]][_0x8dec('0x4e')]='rejected';this['channels'][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc['destuniqueid']][_0x8dec('0x50')]=_0x8dec('0x54');logger[_0x8dec('0x29')](_0x8dec('0x55'),_0x2fadfc[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc[_0x8dec('0x2c')]],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x56'),this['channels'][_0x2fadfc[_0x8dec('0x27')]][_0x2fadfc['destuniqueid']]);}}}catch(_0x408566){logger[_0x8dec('0x57')]('[%s][voiceAgentReport][agentringnoanswer]',_0x2fadfc[_0x8dec('0x27')],util['inspect'](_0x408566,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x58')]=function(_0x3a0759){try{if(this[_0x8dec('0x23')](_0x3a0759)){logger[_0x8dec('0x29')](_0x8dec('0x59'),_0x3a0759['uniqueid'],util[_0x8dec('0x2b')](_0x3a0759,{'showHidden':![],'depth':null}));if(this[_0x8dec('0xc')][_0x3a0759[_0x8dec('0x27')]]){for(var _0x5c03b4 in this[_0x8dec('0xc')][_0x3a0759['uniqueid']]){if(this[_0x8dec('0xc')][_0x3a0759['uniqueid']]['hasOwnProperty'](_0x5c03b4)&&!this[_0x8dec('0xc')][_0x3a0759['uniqueid']][_0x5c03b4][_0x8dec('0x15')]&&!this['channels'][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4][_0x8dec('0x18')]){logger[_0x8dec('0x25')](_0x8dec('0x5a'),_0x3a0759[_0x8dec('0x27')],this[_0x8dec('0xc')][_0x3a0759['uniqueid']][_0x5c03b4][_0x8dec('0x28')],_0x5c03b4);this['channels'][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4][_0x8dec('0x15')]=!![];this[_0x8dec('0xc')][_0x3a0759['uniqueid']][_0x5c03b4][_0x8dec('0x4c')]=moment()[_0x8dec('0x2d')](_0x8dec('0x2e'));this[_0x8dec('0xc')][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4][_0x8dec('0x4e')]=_0x8dec('0x5b');this[_0x8dec('0xc')][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4][_0x8dec('0x50')]='abandoned';logger['debug'](_0x8dec('0x5c'),_0x3a0759[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x5d'),this[_0x8dec('0xc')][_0x3a0759[_0x8dec('0x27')]][_0x5c03b4]);}}}}}catch(_0x40f9ac){logger[_0x8dec('0x57')]('[%s][voiceAgentReport][queuecallerabandon]',_0x3a0759[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x40f9ac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x19')]=function(_0x275063){try{if(this[_0x8dec('0x23')](_0x275063)){logger['debug'](_0x8dec('0x5e'),_0x275063['uniqueid'],util[_0x8dec('0x2b')](_0x275063,{'showHidden':![],'depth':null}));if(this['channels'][_0x275063[_0x8dec('0x27')]]){for(var _0x3f0ac8 in this['channels'][_0x275063[_0x8dec('0x27')]]){if(this[_0x8dec('0xc')][_0x275063['uniqueid']]['hasOwnProperty'](_0x3f0ac8)){if(this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x5f')]&&!this[_0x8dec('0xc')][_0x275063['uniqueid']][_0x3f0ac8][_0x8dec('0x18')]){logger[_0x8dec('0x25')](_0x8dec('0x60'),_0x275063[_0x8dec('0x27')],this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x28')],_0x3f0ac8);this[_0x8dec('0xc')][_0x275063['uniqueid']][_0x3f0ac8][_0x8dec('0x18')]=!![];this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x61')]=moment()[_0x8dec('0x2d')](_0x8dec('0x2e'));this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8]['lastevent']=_0x8dec('0x62');this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x50')]=_0x275063[_0x8dec('0x50')]==_0x8dec('0x63')?_0x8dec('0x64'):_0x275063[_0x8dec('0x50')];this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x65')]=_0x275063[_0x8dec('0x65')];if(this[_0x8dec('0xd')][_0x275063[_0x8dec('0x30')]]&&this[_0x8dec('0xd')][_0x275063[_0x8dec('0x30')]][_0x8dec('0x66')]){this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x67')]=this[_0x8dec('0xd')][_0x275063[_0x8dec('0x30')]][_0x8dec('0x68')];this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8][_0x8dec('0x69')]=!![];}this[_0x8dec('0xe')][_0x275063[_0x8dec('0x39')]]=_[_0x8dec('0x6a')](this['agents'][_0x275063[_0x8dec('0x39')]],['queue',_0x8dec('0x48')]);logger[_0x8dec('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x275063[_0x8dec('0x27')],util[_0x8dec('0x2b')](this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8],{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')](_0x8dec('0x6b'),this[_0x8dec('0xc')][_0x275063[_0x8dec('0x27')]][_0x3f0ac8]);logger[_0x8dec('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x275063['uniqueid'],util[_0x8dec('0x2b')]({'id':this[_0x8dec('0xe')][_0x275063['interface']]['id'],'destaccountcode':_0x275063[_0x8dec('0x6c')]},{'showHidden':![],'depth':null}));this['emit'](util['format']('user:%s',_0x275063['membername']),_0x8dec('0x6d'),{'id':this['agents'][_0x275063[_0x8dec('0x39')]]['id'],'destaccountcode':_0x275063[_0x8dec('0x6c')]});}}}}}}catch(_0x412a83){logger[_0x8dec('0x57')](_0x8dec('0x6e'),_0x275063[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x412a83,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8dec('0x1a')]=function(_0x41e215){try{if(this[_0x8dec('0x23')](_0x41e215)){logger[_0x8dec('0x29')](_0x8dec('0x6f'),_0x41e215[_0x8dec('0x27')],util['inspect'](_0x41e215,{'showHidden':![],'depth':null}));this['addVariable'](_0x41e215['uniqueid'],_[_0x8dec('0x70')](_0x41e215[_0x8dec('0x71')])[0x0],_0x41e215[_0x8dec('0x72')]);if(this[_0x8dec('0xc')][_0x41e215[_0x8dec('0x27')]]){for(var _0x56029f in this[_0x8dec('0xc')][_0x41e215[_0x8dec('0x27')]]){if(this[_0x8dec('0xc')][_0x41e215['uniqueid']]['hasOwnProperty'](_0x56029f)){logger['info'](_0x8dec('0x73'),_0x41e215[_0x8dec('0x27')],_0x56029f,_[_0x8dec('0x70')](_0x41e215[_0x8dec('0x71')])[0x0],_0x41e215['value']);if(_['isUndefined'](this['channels'][_0x41e215[_0x8dec('0x27')]][_0x56029f][_0x8dec('0xf')])){this['channels'][_0x41e215[_0x8dec('0x27')]][_0x56029f][_0x8dec('0xf')]={};}this[_0x8dec('0xc')][_0x41e215['uniqueid']][_0x56029f][_0x8dec('0xf')]=this[_0x8dec('0xf')][_0x41e215[_0x8dec('0x27')]];}}}}}catch(_0x1bda33){logger[_0x8dec('0x57')](_0x8dec('0x74'),_0x41e215[_0x8dec('0x27')],util['inspect'](_0x1bda33,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')]['addVariable']=function(_0x15277f,_0x478a39,_0xa3125e){var _0x380c54=[_0x8dec('0x75'),_0x8dec('0x76'),_0x8dec('0x77'),_0x8dec('0x78'),_0x8dec('0x79'),'rtpaudioqoslossbridged',_0x8dec('0x7a'),_0x8dec('0x7b'),_0x8dec('0x7c'),'sipuri',_0x8dec('0x7d'),_0x8dec('0x7e'),_0x8dec('0x7f'),'memberdynamic',_0x8dec('0x80'),_0x8dec('0x81'),_0x8dec('0x28'),_0x8dec('0x82'),'memberrealtime'];if(!_[_0x8dec('0x83')](_0x478a39)&&!_[_0x8dec('0x84')](_0x380c54,_0x478a39)){if(_[_0x8dec('0x24')](this[_0x8dec('0xf')][_0x15277f])){this['variables'][_0x15277f]={};}this[_0x8dec('0xf')][_0x15277f][_0x478a39]=_0xa3125e;}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x1c')]=function(_0x92c2d4){try{if(this[_0x8dec('0x23')](_0x92c2d4)){logger[_0x8dec('0x29')](_0x8dec('0x85'),_0x92c2d4[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x92c2d4,{'showHidden':![],'depth':null}));if(this[_0x8dec('0xc')][_0x92c2d4[_0x8dec('0x27')]]){for(var _0x43a6f7 in this[_0x8dec('0xc')][_0x92c2d4[_0x8dec('0x27')]]){if(this[_0x8dec('0xc')][_0x92c2d4['uniqueid']]['hasOwnProperty'](_0x43a6f7)){if(this['channels'][_0x92c2d4[_0x8dec('0x27')]][_0x43a6f7][_0x8dec('0x50')]=='transfer'&&this['channels'][_0x92c2d4[_0x8dec('0x27')]][_0x43a6f7][_0x8dec('0x18')]){logger[_0x8dec('0x25')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x92c2d4['uniqueid'],_0x43a6f7);this[_0x8dec('0xc')][_0x92c2d4[_0x8dec('0x27')]][_0x43a6f7][_0x8dec('0x61')]=moment()['format'](_0x8dec('0x2e'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x92c2d4[_0x8dec('0x27')],util[_0x8dec('0x2b')](_['values'](this[_0x8dec('0xc')][_0x92c2d4['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x8dec('0x22')]('custom:voiceAgentReport',_[_0x8dec('0x86')](this[_0x8dec('0xc')][_0x92c2d4[_0x8dec('0x27')]]));delete this[_0x8dec('0xc')][_0x92c2d4[_0x8dec('0x27')]];}if(this[_0x8dec('0xf')][_0x92c2d4[_0x8dec('0x27')]]){delete this[_0x8dec('0xf')][_0x92c2d4[_0x8dec('0x27')]];}}}catch(_0x2d7a04){logger[_0x8dec('0x57')]('[%s][voiceAgentReport][hangup]',_0x92c2d4[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x2d7a04,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8dec('0x87')]=function(_0xc63a67){try{if(this[_0x8dec('0x23')](_0xc63a67)){logger[_0x8dec('0x29')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xc63a67['uniqueid'],util[_0x8dec('0x2b')](_0xc63a67,{'showHidden':![],'depth':null}));if(this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]]){for(var _0x4fb267 in this['channels'][_0xc63a67[_0x8dec('0x88')]]){if(this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x8dec('0x3e')](_0x4fb267)){if(_0xc63a67[_0x8dec('0x89')]===_0x4fb267){logger[_0x8dec('0x25')](_0x8dec('0x8a'),_0xc63a67[_0x8dec('0x27')],this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x4fb267][_0x8dec('0x28')],_0x4fb267);var _0x142e6f=moment();this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x4fb267][_0x8dec('0x18')]=!![];this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x4fb267]['agentcompleteAt']=moment()[_0x8dec('0x2d')](_0x8dec('0x2e'));this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x4fb267][_0x8dec('0x4e')]=_0x8dec('0x62');this['channels'][_0xc63a67[_0x8dec('0x88')]][_0x4fb267]['reason']=_0x8dec('0x63');this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]][_0x4fb267][_0x8dec('0x65')]=_0x142e6f[_0x8dec('0x8b')](this[_0x8dec('0xc')][_0xc63a67['transfereeuniqueid']][_0x4fb267][_0x8dec('0x5f')],_0x8dec('0x8c'));}}}}if(this[_0x8dec('0xc')][_0xc63a67['secondtransfereruniqueid']]){var _0x33c9a8=this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x8d')]];this['channels'][_0xc63a67[_0x8dec('0x8d')]]=this['channels'][_0xc63a67[_0x8dec('0x88')]];this[_0x8dec('0xc')][_0xc63a67[_0x8dec('0x88')]]=_0x33c9a8;}}}catch(_0x34d915){logger[_0x8dec('0x57')](_0x8dec('0x8e'),_0xc63a67[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x34d915,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x8dec('0x20')]=function(_0x4eeff1){try{if(this[_0x8dec('0x23')](_0x4eeff1)){logger[_0x8dec('0x29')]('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x4eeff1[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x4eeff1,{'showHidden':![],'depth':null}));if(this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]]){for(var _0x4f2795 in this['channels'][_0x4eeff1[_0x8dec('0x88')]]){if(this[_0x8dec('0xc')][_0x4eeff1['transfereeuniqueid']][_0x8dec('0x3e')](_0x4f2795)){if(_0x4eeff1['transfereruniqueid']===_0x4f2795){logger['info'](_0x8dec('0x8f'),_0x4eeff1[_0x8dec('0x27')],this['channels'][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795][_0x8dec('0x28')],_0x4f2795);var _0x37e7f5=moment();this['channels'][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795][_0x8dec('0x18')]=!![];this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795][_0x8dec('0x61')]=_0x37e7f5;this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795]['lastevent']=_0x8dec('0x62');this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795]['reason']=_0x8dec('0x63');this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795]['talktime']=_0x37e7f5['diff'](this[_0x8dec('0xc')][_0x4eeff1[_0x8dec('0x88')]][_0x4f2795]['agentconnectAt'],'seconds');}}}}}}catch(_0x12ba21){logger[_0x8dec('0x57')](_0x8dec('0x90'),_0x4eeff1[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x12ba21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x8dec('0x21')][_0x8dec('0x91')]=function(_0x2924a0){var _0x5e636e='';try{if(this[_0x8dec('0x23')](_0x2924a0)){logger[_0x8dec('0x29')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x2924a0[_0x8dec('0x27')],util[_0x8dec('0x2b')](_0x2924a0,{'showHidden':![],'depth':null}));if(_0x2924a0[_0x8dec('0x92')]){_0x5e636e=_0x2924a0[_0x8dec('0x92')]['substring'](0x0,_0x2924a0[_0x8dec('0x92')]['lastIndexOf']('-'));if(this[_0x8dec('0xe')][_0x5e636e]){logger[_0x8dec('0x25')](_0x8dec('0x93'),_0x2924a0[_0x8dec('0x27')],_0x5e636e);this[_0x8dec('0xe')][_0x5e636e][_0x8dec('0x94')]=!![];}}}}catch(_0x339878){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x2924a0['uniqueid'],util[_0x8dec('0x2b')](_0x339878,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x571ac1){var _0xb111a8='';try{if(this[_0x8dec('0x23')](_0x571ac1)){logger[_0x8dec('0x29')](_0x8dec('0x95'),_0x571ac1['uniqueid'],util[_0x8dec('0x2b')](_0x571ac1,{'showHidden':![],'depth':null}));if(_0x571ac1[_0x8dec('0x92')]){_0xb111a8=_0x571ac1['channel'][_0x8dec('0x96')](0x0,_0x571ac1[_0x8dec('0x92')][_0x8dec('0x97')]('-'));if(this[_0x8dec('0xe')][_0xb111a8]){logger[_0x8dec('0x25')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x571ac1[_0x8dec('0x27')],_0xb111a8);this[_0x8dec('0xe')][_0xb111a8][_0x8dec('0x94')]=![];}}}}catch(_0x20eacd){logger[_0x8dec('0x57')]('[%s][voiceAgentReport][musiconholdstop]',_0x571ac1['uniqueid'],util[_0x8dec('0x2b')](_0x20eacd,{'showHidden':![],'depth':null}));}};module[_0x8dec('0x98')]=VoiceAgentReport;
\ No newline at end of file
+var _0xd412=['[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','socket.io-emitter','voiceChannels','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','queuecallerabandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isUndefined','isNotNull','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','destuniqueid','debug','uniqueid','inspect','channels','YYYY-MM-DD\x20HH:mm:ss','called','voiceQueues','queue','mandatoryDisposition','type','inbound','voice','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','interface','calleridnum','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','membername','agentconnectAt','connectedlinename','connectedlinenum','destchannelstatedesc','routealias','merge','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','info','lastevent','rejected','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','omit','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff'];(function(_0x177515,_0x36b8bb){var _0xffbab4=function(_0x288a29){while(--_0x288a29){_0x177515['push'](_0x177515['shift']());}};_0xffbab4(++_0x36b8bb);}(_0xd412,0x1f1));var _0x2d41=function(_0x26371f,_0x3529d6){_0x26371f=_0x26371f-0x0;var _0x7bf77f=_0xd412[_0x26371f];return _0x7bf77f;};'use strict';var _=require(_0x2d41('0x0'));var moment=require(_0x2d41('0x1'));var util=require(_0x2d41('0x2'));var Redis=require(_0x2d41('0x3'));var config=require(_0x2d41('0x4'));var logger=require(_0x2d41('0x5'))('ami');var ami=require(_0x2d41('0x6'));config[_0x2d41('0x7')]=_['defaults'](config[_0x2d41('0x7')],{'host':_0x2d41('0x8'),'port':0x18eb});var io=require(_0x2d41('0x9'))(new Redis(config[_0x2d41('0x7')]));function VoiceAgentReport(_0x4b67f4){this['channels']={};this[_0x2d41('0xa')]=_0x4b67f4['channels'];this['voiceQueues']=_0x4b67f4['voiceQueues'];this[_0x2d41('0xb')]=_0x4b67f4['agents'];this[_0x2d41('0xc')]={};ami['on'](_0x2d41('0xd'),this[_0x2d41('0xe')]['bind'](this));ami['on'](_0x2d41('0xf'),this[_0x2d41('0x10')][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x12'),this['syncAgentRingNoAnswer'][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x13'),this['syncQueueCallerAbandon'][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x14'),this['syncAgentComplete'][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x15'),this[_0x2d41('0x16')][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x17'),this[_0x2d41('0x18')][_0x2d41('0x11')](this));ami['on']('musiconholdstart',this[_0x2d41('0x19')][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x1a'),this[_0x2d41('0x1b')][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x1c'),this[_0x2d41('0x1d')][_0x2d41('0x11')](this));ami['on'](_0x2d41('0x1e'),this['syncBlindTransfer'][_0x2d41('0x11')](this));}VoiceAgentReport[_0x2d41('0x1f')]['emit']=function(_0x3697e1,_0x18b43d,_0x191e35){io['to'](_0x3697e1)[_0x2d41('0x20')](_0x18b43d,_0x191e35);};VoiceAgentReport[_0x2d41('0x1f')]['isNotNull']=function(_0x26945c){return _0x26945c!==null&&!_[_0x2d41('0x21')](_0x26945c);};VoiceAgentReport[_0x2d41('0x1f')][_0x2d41('0xe')]=function(_0x23d890){try{if(this[_0x2d41('0x22')](_0x23d890)){logger['info'](_0x2d41('0x23'),_0x23d890['uniqueid'],_0x23d890['membername'],_0x23d890[_0x2d41('0x24')]);logger[_0x2d41('0x25')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x23d890[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x23d890,{'showHidden':![],'depth':null}));if(_[_0x2d41('0x21')](this[_0x2d41('0x28')][_0x23d890[_0x2d41('0x26')]])){this[_0x2d41('0x28')][_0x23d890['uniqueid']]={};}if(_[_0x2d41('0x21')](this['channels'][_0x23d890[_0x2d41('0x26')]][_0x23d890[_0x2d41('0x24')]])){this[_0x2d41('0x28')][_0x23d890['uniqueid']][_0x23d890[_0x2d41('0x24')]]={'agentcalledAt':moment()['format'](_0x2d41('0x29')),'lastevent':_0x2d41('0x2a'),'mandatoryDisposition':this[_0x2d41('0x2b')][_0x23d890[_0x2d41('0x2c')]]?this[_0x2d41('0x2b')][_0x23d890[_0x2d41('0x2c')]][_0x2d41('0x2d')]||![]:![],'type':this[_0x2d41('0x2b')][_0x23d890[_0x2d41('0x2c')]]?this[_0x2d41('0x2b')][_0x23d890['queue']][_0x2d41('0x2e')]||_0x2d41('0x2f'):_0x2d41('0x2f'),'variables':this[_0x2d41('0xc')][_0x23d890[_0x2d41('0x26')]],'motionChannel':_0x2d41('0x30')};}_['merge'](this[_0x2d41('0x28')][_0x23d890[_0x2d41('0x26')]][_0x23d890[_0x2d41('0x24')]],_['omit'](_0x23d890,['event',_0x2d41('0x31')]));logger[_0x2d41('0x25')](_0x2d41('0x32'),_0x23d890[_0x2d41('0x26')],util[_0x2d41('0x27')](this[_0x2d41('0x28')][_0x23d890['uniqueid']][_0x23d890[_0x2d41('0x24')]],{'showHidden':![],'depth':null}));ami[_0x2d41('0x20')]('custom:agentcalled',this['channels'][_0x23d890['uniqueid']][_0x23d890[_0x2d41('0x24')]]);var _0x12e982={'id':this['agents'][_0x23d890[_0x2d41('0x33')]]['id'],'calleridnum':this[_0x2d41('0x28')][_0x23d890[_0x2d41('0x26')]][_0x23d890[_0x2d41('0x24')]][_0x2d41('0x34')],'queue':this[_0x2d41('0x28')][_0x23d890['uniqueid']][_0x23d890['destuniqueid']][_0x2d41('0x2c')],'variables':this[_0x2d41('0x28')][_0x23d890[_0x2d41('0x26')]][_0x23d890[_0x2d41('0x24')]]['variables']};logger[_0x2d41('0x25')](_0x2d41('0x35'),_0x23d890[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x12e982,{'showHidden':![],'depth':null}));this[_0x2d41('0x20')](util[_0x2d41('0x36')](_0x2d41('0x37'),_0x23d890['membername']),_0x2d41('0x38'),_0x12e982);}}catch(_0x304f97){logger[_0x2d41('0x39')](_0x2d41('0x3a'),_0x23d890[_0x2d41('0x26')],util['inspect'](_0x304f97,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')][_0x2d41('0x10')]=function(_0x454efc){try{if(this[_0x2d41('0x22')](_0x454efc)){if(this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]]){logger[_0x2d41('0x25')](_0x2d41('0x3b'),_0x454efc['uniqueid'],util[_0x2d41('0x27')](_0x454efc,{'showHidden':![],'depth':null}));for(var _0x260fc1 in this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]]){if(this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x2d41('0x3c')](_0x260fc1)){if(_0x454efc[_0x2d41('0x24')]===_0x260fc1){logger['info'](_0x2d41('0x3d'),_0x454efc[_0x2d41('0x26')],_0x454efc[_0x2d41('0x3e')],_0x454efc[_0x2d41('0x24')]);this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x3f')]=moment()[_0x2d41('0x36')](_0x2d41('0x29'));this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x40')]=_0x454efc['connectedlinename'];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1]['connectedlinenum']=_0x454efc[_0x2d41('0x41')];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1]['destchannelstate']=_0x454efc['destchannelstate'];this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1]['destchannelstatedesc']=_0x454efc[_0x2d41('0x42')];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1]['holdtime']=_0x454efc['holdtime'];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1]['lastevent']='connect';if(this[_0x2d41('0xa')][this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x26')]]){var _0x39b1fa=this[_0x2d41('0xa')][this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x26')]][_0x2d41('0x43')];this['channels'][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x43')]=_0x39b1fa;_0x454efc['routealias']=_0x39b1fa;}_[_0x2d41('0x44')](this['agents'][_0x454efc[_0x2d41('0x33')]],_[_0x2d41('0x45')](_0x454efc,[_0x2d41('0x2c'),_0x2d41('0x46'),'routealias']));logger[_0x2d41('0x25')](_0x2d41('0x47'),_0x454efc['uniqueid'],util[_0x2d41('0x27')](this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x454efc[_0x2d41('0x24')]],{'showHidden':![],'depth':null}));ami[_0x2d41('0x20')]('custom:agentconnect',this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x454efc['destuniqueid']]);logger[_0x2d41('0x25')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:',_0x454efc['uniqueid'],util[_0x2d41('0x27')](this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x454efc[_0x2d41('0x24')]],{'showHidden':![],'depth':null}));this[_0x2d41('0x20')](util[_0x2d41('0x36')](_0x2d41('0x37'),_0x454efc[_0x2d41('0x3e')]),_0x2d41('0x48'),this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x454efc['destuniqueid']]);}else if(!this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x12')]&&!this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x14')]){logger['info'](_0x2d41('0x49'),_0x454efc[_0x2d41('0x26')],this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x3e')],_0x260fc1);this['channels'][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x12')]=!![];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1][_0x2d41('0x4a')]=moment()[_0x2d41('0x36')](_0x2d41('0x29'));this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x4b')]=_0x454efc[_0x2d41('0x24')];this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x4c')]=_0x454efc[_0x2d41('0x3e')];this[_0x2d41('0x28')][_0x454efc[_0x2d41('0x26')]][_0x260fc1]['lastevent']=_0x2d41('0x4d');this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1][_0x2d41('0x4e')]=_0x2d41('0x4d');logger[_0x2d41('0x25')](_0x2d41('0x4f'),_0x454efc[_0x2d41('0x26')],util['inspect'](this[_0x2d41('0x28')][_0x454efc['uniqueid']][_0x260fc1],{'showHidden':![],'depth':null}));ami[_0x2d41('0x20')](_0x2d41('0x50'),this['channels'][_0x454efc['uniqueid']][_0x260fc1]);}}}}}}catch(_0x5524ac){logger[_0x2d41('0x39')](_0x2d41('0x51'),_0x454efc['uniqueid'],util[_0x2d41('0x27')](_0x5524ac,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')][_0x2d41('0x52')]=function(_0x468bb4){try{if(this[_0x2d41('0x22')](_0x468bb4)){logger['debug']('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x468bb4[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x468bb4,{'showHidden':![],'depth':null}));if(this[_0x2d41('0x28')][_0x468bb4[_0x2d41('0x26')]]&&this['channels'][_0x468bb4[_0x2d41('0x26')]][_0x468bb4[_0x2d41('0x24')]]){logger[_0x2d41('0x53')]('[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected',_0x468bb4[_0x2d41('0x26')],_0x468bb4[_0x2d41('0x3e')],_0x468bb4[_0x2d41('0x24')]);this[_0x2d41('0x28')][_0x468bb4[_0x2d41('0x26')]][_0x468bb4[_0x2d41('0x24')]][_0x2d41('0x12')]=!![];this[_0x2d41('0x28')][_0x468bb4['uniqueid']][_0x468bb4[_0x2d41('0x24')]][_0x2d41('0x4a')]=moment()[_0x2d41('0x36')](_0x2d41('0x29'));this['channels'][_0x468bb4[_0x2d41('0x26')]][_0x468bb4[_0x2d41('0x24')]][_0x2d41('0x54')]=_0x2d41('0x55');this[_0x2d41('0x28')][_0x468bb4[_0x2d41('0x26')]][_0x468bb4['destuniqueid']][_0x2d41('0x4e')]=_0x2d41('0x55');logger[_0x2d41('0x25')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x468bb4[_0x2d41('0x26')],util[_0x2d41('0x27')](this['channels'][_0x468bb4[_0x2d41('0x26')]][_0x468bb4['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x2d41('0x20')](_0x2d41('0x56'),this['channels'][_0x468bb4[_0x2d41('0x26')]][_0x468bb4[_0x2d41('0x24')]]);}}}catch(_0xfef782){logger[_0x2d41('0x39')](_0x2d41('0x57'),_0x468bb4[_0x2d41('0x26')],util[_0x2d41('0x27')](_0xfef782,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x2d41('0x58')]=function(_0x23782d){try{if(this[_0x2d41('0x22')](_0x23782d)){logger[_0x2d41('0x25')](_0x2d41('0x59'),_0x23782d['uniqueid'],util['inspect'](_0x23782d,{'showHidden':![],'depth':null}));if(this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]]){for(var _0x2143e3 in this['channels'][_0x23782d['uniqueid']]){if(this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]]['hasOwnProperty'](_0x2143e3)&&!this['channels'][_0x23782d[_0x2d41('0x26')]][_0x2143e3][_0x2d41('0x12')]&&!this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]][_0x2143e3][_0x2d41('0x14')]){logger[_0x2d41('0x53')]('[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x23782d[_0x2d41('0x26')],this['channels'][_0x23782d[_0x2d41('0x26')]][_0x2143e3]['membername'],_0x2143e3);this['channels'][_0x23782d[_0x2d41('0x26')]][_0x2143e3][_0x2d41('0x12')]=!![];this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]][_0x2143e3]['agentringnoanswerAt']=moment()['format'](_0x2d41('0x29'));this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]][_0x2143e3][_0x2d41('0x54')]=_0x2d41('0x5a');this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]][_0x2143e3]['reason']=_0x2d41('0x5a');logger['debug'](_0x2d41('0x5b'),_0x23782d[_0x2d41('0x26')],util[_0x2d41('0x27')](this[_0x2d41('0x28')][_0x23782d['uniqueid']][_0x2143e3],{'showHidden':![],'depth':null}));ami[_0x2d41('0x20')](_0x2d41('0x5c'),this[_0x2d41('0x28')][_0x23782d[_0x2d41('0x26')]][_0x2143e3]);}}}}}catch(_0x3668ce){logger[_0x2d41('0x39')](_0x2d41('0x5d'),_0x23782d[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x3668ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')][_0x2d41('0x5e')]=function(_0x753907){try{if(this['isNotNull'](_0x753907)){logger[_0x2d41('0x25')](_0x2d41('0x5f'),_0x753907['uniqueid'],util[_0x2d41('0x27')](_0x753907,{'showHidden':![],'depth':null}));if(this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]]){for(var _0x770f7f in this['channels'][_0x753907[_0x2d41('0x26')]]){if(this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]]['hasOwnProperty'](_0x770f7f)){if(this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x3f')]&&!this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x14')]){logger[_0x2d41('0x53')](_0x2d41('0x60'),_0x753907[_0x2d41('0x26')],this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x3e')],_0x770f7f);this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f]['agentcomplete']=!![];this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]][_0x770f7f]['agentcompleteAt']=moment()['format'](_0x2d41('0x29'));this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x54')]=_0x2d41('0x61');this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x4e')]=_0x753907[_0x2d41('0x4e')]==_0x2d41('0x62')?_0x2d41('0x63'):_0x753907[_0x2d41('0x4e')];this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f]['talktime']=_0x753907[_0x2d41('0x64')];if(this[_0x2d41('0x2b')][_0x753907[_0x2d41('0x2c')]]&&this[_0x2d41('0x2b')][_0x753907['queue']][_0x2d41('0x65')]){this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x66')]=this[_0x2d41('0x2b')][_0x753907[_0x2d41('0x2c')]][_0x2d41('0x67')];this[_0x2d41('0x28')][_0x753907[_0x2d41('0x26')]][_0x770f7f][_0x2d41('0x68')]=!![];}this[_0x2d41('0xb')][_0x753907[_0x2d41('0x33')]]=_[_0x2d41('0x69')](this[_0x2d41('0xb')][_0x753907[_0x2d41('0x33')]],[_0x2d41('0x2c'),'destconnectedlinenum']);logger['debug'](_0x2d41('0x6a'),_0x753907['uniqueid'],util[_0x2d41('0x27')](this['channels'][_0x753907['uniqueid']][_0x770f7f],{'showHidden':![],'depth':null}));ami['emit'](_0x2d41('0x6b'),this['channels'][_0x753907[_0x2d41('0x26')]][_0x770f7f]);logger[_0x2d41('0x25')](_0x2d41('0x6c'),_0x753907[_0x2d41('0x26')],util[_0x2d41('0x27')]({'id':this[_0x2d41('0xb')][_0x753907[_0x2d41('0x33')]]['id'],'destaccountcode':_0x753907[_0x2d41('0x6d')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x2d41('0x36')](_0x2d41('0x37'),_0x753907[_0x2d41('0x3e')]),_0x2d41('0x6e'),{'id':this[_0x2d41('0xb')][_0x753907[_0x2d41('0x33')]]['id'],'destaccountcode':_0x753907[_0x2d41('0x6d')]});}}}}}}catch(_0x36c36a){logger[_0x2d41('0x39')](_0x2d41('0x6f'),_0x753907[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x36c36a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')]['syncVarSet']=function(_0x269f13){try{if(this['isNotNull'](_0x269f13)){logger[_0x2d41('0x25')]('[%s][voiceAgentReport][varset]\x20event:',_0x269f13[_0x2d41('0x26')],util['inspect'](_0x269f13,{'showHidden':![],'depth':null}));this[_0x2d41('0x70')](_0x269f13[_0x2d41('0x26')],_[_0x2d41('0x71')](_0x269f13[_0x2d41('0x72')])[0x0],_0x269f13[_0x2d41('0x73')]);if(this[_0x2d41('0x28')][_0x269f13['uniqueid']]){for(var _0x2ed200 in this[_0x2d41('0x28')][_0x269f13[_0x2d41('0x26')]]){if(this[_0x2d41('0x28')][_0x269f13['uniqueid']][_0x2d41('0x3c')](_0x2ed200)){logger[_0x2d41('0x53')](_0x2d41('0x74'),_0x269f13['uniqueid'],_0x2ed200,_['keys'](_0x269f13['variable'])[0x0],_0x269f13['value']);if(_[_0x2d41('0x21')](this[_0x2d41('0x28')][_0x269f13[_0x2d41('0x26')]][_0x2ed200]['variables'])){this[_0x2d41('0x28')][_0x269f13[_0x2d41('0x26')]][_0x2ed200]['variables']={};}this['channels'][_0x269f13['uniqueid']][_0x2ed200][_0x2d41('0xc')]=this[_0x2d41('0xc')][_0x269f13[_0x2d41('0x26')]];}}}}}catch(_0x4f5b31){logger[_0x2d41('0x39')](_0x2d41('0x75'),_0x269f13[_0x2d41('0x26')],util['inspect'](_0x4f5b31,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')]['addVariable']=function(_0x4a290c,_0x3c999d,_0x3eb054){var _0x24d166=[_0x2d41('0x76'),_0x2d41('0x77'),_0x2d41('0x78'),_0x2d41('0x79'),_0x2d41('0x7a'),_0x2d41('0x7b'),_0x2d41('0x7c'),_0x2d41('0x7d'),_0x2d41('0x7e'),_0x2d41('0x7f'),_0x2d41('0x80'),_0x2d41('0x81'),_0x2d41('0x82'),_0x2d41('0x83'),_0x2d41('0x84'),_0x2d41('0x85'),_0x2d41('0x3e'),'memberpenalty',_0x2d41('0x86')];if(!_[_0x2d41('0x87')](_0x3c999d)&&!_[_0x2d41('0x88')](_0x24d166,_0x3c999d)){if(_[_0x2d41('0x21')](this[_0x2d41('0xc')][_0x4a290c])){this[_0x2d41('0xc')][_0x4a290c]={};}this[_0x2d41('0xc')][_0x4a290c][_0x3c999d]=_0x3eb054;}};VoiceAgentReport[_0x2d41('0x1f')][_0x2d41('0x18')]=function(_0x5c6523){try{if(this[_0x2d41('0x22')](_0x5c6523)){logger[_0x2d41('0x25')](_0x2d41('0x89'),_0x5c6523['uniqueid'],util[_0x2d41('0x27')](_0x5c6523,{'showHidden':![],'depth':null}));if(this[_0x2d41('0x28')][_0x5c6523[_0x2d41('0x26')]]){for(var _0x223b7d in this[_0x2d41('0x28')][_0x5c6523['uniqueid']]){if(this['channels'][_0x5c6523[_0x2d41('0x26')]][_0x2d41('0x3c')](_0x223b7d)){if(this[_0x2d41('0x28')][_0x5c6523['uniqueid']][_0x223b7d][_0x2d41('0x4e')]=='transfer'&&this[_0x2d41('0x28')][_0x5c6523[_0x2d41('0x26')]][_0x223b7d][_0x2d41('0x14')]){logger[_0x2d41('0x53')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x5c6523[_0x2d41('0x26')],_0x223b7d);this[_0x2d41('0x28')][_0x5c6523[_0x2d41('0x26')]][_0x223b7d][_0x2d41('0x8a')]=moment()[_0x2d41('0x36')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0x2d41('0x25')](_0x2d41('0x8b'),_0x5c6523[_0x2d41('0x26')],util[_0x2d41('0x27')](_[_0x2d41('0x8c')](this[_0x2d41('0x28')][_0x5c6523[_0x2d41('0x26')]]),{'showHidden':![],'depth':null}));ami['emit']('custom:voiceAgentReport',_[_0x2d41('0x8c')](this[_0x2d41('0x28')][_0x5c6523['uniqueid']]));delete this[_0x2d41('0x28')][_0x5c6523['uniqueid']];}if(this[_0x2d41('0xc')][_0x5c6523[_0x2d41('0x26')]]){delete this[_0x2d41('0xc')][_0x5c6523[_0x2d41('0x26')]];}}}catch(_0x142808){logger[_0x2d41('0x39')](_0x2d41('0x8d'),_0x5c6523[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x142808,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')]['syncAttendedTransfer']=function(_0x465623){try{if(this[_0x2d41('0x22')](_0x465623)){logger[_0x2d41('0x25')](_0x2d41('0x8e'),_0x465623[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x465623,{'showHidden':![],'depth':null}));if(this[_0x2d41('0x28')][_0x465623['transfereeuniqueid']]){for(var _0x5a5880 in this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]]){if(this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]][_0x2d41('0x3c')](_0x5a5880)){if(_0x465623[_0x2d41('0x90')]===_0x5a5880){logger[_0x2d41('0x53')]('[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x465623['uniqueid'],this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]][_0x5a5880][_0x2d41('0x3e')],_0x5a5880);var _0x4f8fcf=moment();this['channels'][_0x465623['transfereeuniqueid']][_0x5a5880][_0x2d41('0x14')]=!![];this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]][_0x5a5880][_0x2d41('0x8a')]=moment()[_0x2d41('0x36')](_0x2d41('0x29'));this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]][_0x5a5880][_0x2d41('0x54')]=_0x2d41('0x61');this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]][_0x5a5880][_0x2d41('0x4e')]=_0x2d41('0x62');this[_0x2d41('0x28')][_0x465623['transfereeuniqueid']][_0x5a5880]['talktime']=_0x4f8fcf['diff'](this[_0x2d41('0x28')][_0x465623['transfereeuniqueid']][_0x5a5880][_0x2d41('0x3f')],_0x2d41('0x91'));}}}}if(this['channels'][_0x465623['secondtransfereruniqueid']]){var _0x7ded2e=this[_0x2d41('0x28')][_0x465623[_0x2d41('0x92')]];this['channels'][_0x465623[_0x2d41('0x92')]]=this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]];this[_0x2d41('0x28')][_0x465623[_0x2d41('0x8f')]]=_0x7ded2e;}}}catch(_0x18455a){logger['error']('[%s][voiceAgentReport][attendedtransfer]',_0x465623[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x18455a,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x1a1bb0){try{if(this[_0x2d41('0x22')](_0x1a1bb0)){logger[_0x2d41('0x25')](_0x2d41('0x93'),_0x1a1bb0[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x1a1bb0,{'showHidden':![],'depth':null}));if(this['channels'][_0x1a1bb0[_0x2d41('0x8f')]]){for(var _0x5d05f5 in this[_0x2d41('0x28')][_0x1a1bb0['transfereeuniqueid']]){if(this[_0x2d41('0x28')][_0x1a1bb0['transfereeuniqueid']][_0x2d41('0x3c')](_0x5d05f5)){if(_0x1a1bb0[_0x2d41('0x94')]===_0x5d05f5){logger[_0x2d41('0x53')](_0x2d41('0x95'),_0x1a1bb0[_0x2d41('0x26')],this['channels'][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x3e')],_0x5d05f5);var _0x1a7f24=moment();this[_0x2d41('0x28')][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x14')]=!![];this[_0x2d41('0x28')][_0x1a1bb0['transfereeuniqueid']][_0x5d05f5]['agentcompleteAt']=_0x1a7f24;this[_0x2d41('0x28')][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x54')]=_0x2d41('0x61');this[_0x2d41('0x28')][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x4e')]='transfer';this[_0x2d41('0x28')][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x64')]=_0x1a7f24[_0x2d41('0x96')](this[_0x2d41('0x28')][_0x1a1bb0[_0x2d41('0x8f')]][_0x5d05f5][_0x2d41('0x3f')],_0x2d41('0x91'));}}}}}}catch(_0x52bf91){logger[_0x2d41('0x39')](_0x2d41('0x97'),_0x1a1bb0[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x52bf91,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')]['syncMusicOnHoldStart']=function(_0x53b734){var _0x39b918='';try{if(this['isNotNull'](_0x53b734)){logger[_0x2d41('0x25')](_0x2d41('0x98'),_0x53b734['uniqueid'],util[_0x2d41('0x27')](_0x53b734,{'showHidden':![],'depth':null}));if(_0x53b734[_0x2d41('0x99')]){_0x39b918=_0x53b734['channel'][_0x2d41('0x9a')](0x0,_0x53b734['channel'][_0x2d41('0x9b')]('-'));if(this[_0x2d41('0xb')][_0x39b918]){logger[_0x2d41('0x53')](_0x2d41('0x9c'),_0x53b734[_0x2d41('0x26')],_0x39b918);this[_0x2d41('0xb')][_0x39b918][_0x2d41('0x9d')]=!![];}}}}catch(_0x10f77f){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x53b734[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x10f77f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x2d41('0x1f')]['syncMusicOnHoldStop']=function(_0x58c273){var _0x3ffa5e='';try{if(this[_0x2d41('0x22')](_0x58c273)){logger[_0x2d41('0x25')](_0x2d41('0x9e'),_0x58c273[_0x2d41('0x26')],util[_0x2d41('0x27')](_0x58c273,{'showHidden':![],'depth':null}));if(_0x58c273[_0x2d41('0x99')]){_0x3ffa5e=_0x58c273[_0x2d41('0x99')][_0x2d41('0x9a')](0x0,_0x58c273[_0x2d41('0x99')][_0x2d41('0x9b')]('-'));if(this[_0x2d41('0xb')][_0x3ffa5e]){logger['info'](_0x2d41('0x9f'),_0x58c273['uniqueid'],_0x3ffa5e);this[_0x2d41('0xb')][_0x3ffa5e]['onhold']=![];}}}}catch(_0x18f3ab){logger[_0x2d41('0x39')](_0x2d41('0xa0'),_0x58c273['uniqueid'],util['inspect'](_0x18f3ab,{'showHidden':![],'depth':null}));}};module[_0x2d41('0xa1')]=VoiceAgentReport;
\ No newline at end of file
index bc9baaa..4621bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fad=['name','accountcode','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','disposition','includes','lastdata','cdr(','match','isNil','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff','xcally-motion-preview','connectedlinename','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','.WAV','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','holdtime','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','getSettings','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','event','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','BlindTransfer','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','blindTransfers','coreshowchannel','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','isUndefined','merge','pick','keys','context','from-sip','agents','channel','split','destconnectedlinenum','connectedlinenum','format','user:agentconnect','[%s][voiceCallReport][newcallerid]','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:%s'];(function(_0x3f7f38,_0x51775b){var _0x33f453=function(_0xd28d22){while(--_0xd28d22){_0x3f7f38['push'](_0x3f7f38['shift']());}};_0x33f453(++_0x51775b);}(_0x1fad,0x146));var _0xd1fa=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x1fad[_0x1573ea];return _0x51c0e2;};'use strict';var _=require(_0xd1fa('0x0'));var moment=require(_0xd1fa('0x1'));var util=require(_0xd1fa('0x2'));var path=require('path');var Redis=require('ioredis');var config=require(_0xd1fa('0x3'));var logger=require(_0xd1fa('0x4'))(_0xd1fa('0x5'));var ami=require(_0xd1fa('0x6'));var Channel=require(_0xd1fa('0x7'));var RpcSetting=require('../rpc/setting');var applications=[_0xd1fa('0x8'),_0xd1fa('0x9'),_0xd1fa('0xa'),_0xd1fa('0xb'),_0xd1fa('0xc'),_0xd1fa('0xd')];var dispositions=[_0xd1fa('0xe'),_0xd1fa('0xf'),'FAILED',_0xd1fa('0xe'),_0xd1fa('0xe'),_0xd1fa('0xe'),_0xd1fa('0x10'),_0xd1fa('0x11'),_0xd1fa('0xf'),_0xd1fa('0xf'),_0xd1fa('0xf')];config[_0xd1fa('0x12')]=_[_0xd1fa('0x13')](config[_0xd1fa('0x12')],{'host':_0xd1fa('0x14'),'port':0x18eb});var io=require(_0xd1fa('0x15'))(new Redis(config[_0xd1fa('0x12')]));function VoiceCallReport(_0x55ce0c){this['channels']=_0x55ce0c[_0xd1fa('0x16')];this['agents']=_0x55ce0c['agents'];this[_0xd1fa('0x17')]={};ami['on'](_0xd1fa('0x18'),this['syncNewExten'][_0xd1fa('0x19')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0xd1fa('0x1a'),this[_0xd1fa('0x1b')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x1c'),this[_0xd1fa('0x1d')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x1e'),this[_0xd1fa('0x1f')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x20'),this[_0xd1fa('0x21')]['bind'](this));ami['on']('newcallerid',this[_0xd1fa('0x22')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x23'),this[_0xd1fa('0x24')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x25'),this['syncBlindTransfer'][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x26'),this[_0xd1fa('0x27')][_0xd1fa('0x19')](this));ami['on'](_0xd1fa('0x28'),this[_0xd1fa('0x29')][_0xd1fa('0x19')](this));try{logger[_0xd1fa('0x2a')](_0xd1fa('0x2b'));ami['actionCoreShowChannels']();}catch(_0x347690){logger[_0xd1fa('0x2c')](_0xd1fa('0x2d'),util[_0xd1fa('0x2e')](_0x347690,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x30')]=function(_0x43213d){return _0x43213d!==null&&!_['isUndefined'](_0x43213d);};VoiceCallReport['prototype']['emit']=function(_0x193ea7,_0x14f7ec,_0xee7efe){io['to'](_0x193ea7)[_0xd1fa('0x31')](_0x14f7ec,_0xee7efe);};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x22')]=function(_0x15b4cc){try{if(this[_0xd1fa('0x30')](_0x15b4cc)){logger[_0xd1fa('0x2a')](_0xd1fa('0x32'),_0x15b4cc['uniqueid'],_0x15b4cc[_0xd1fa('0x33')],_0x15b4cc['calleridnum']);logger[_0xd1fa('0x34')](_0xd1fa('0x35'),_0x15b4cc[_0xd1fa('0x36')],util['inspect'](_0x15b4cc,{'showHidden':![],'depth':null}));if(_0x15b4cc['uniqueid']===_0x15b4cc['linkedid']){if(!_[_0xd1fa('0x37')](this[_0xd1fa('0x16')][_0x15b4cc[_0xd1fa('0x36')]])){_[_0xd1fa('0x38')](this['channels'][_0x15b4cc['uniqueid']],_[_0xd1fa('0x39')](_0x15b4cc,_[_0xd1fa('0x3a')](this[_0xd1fa('0x16')][_0x15b4cc[_0xd1fa('0x36')]])));}}if(_0x15b4cc[_0xd1fa('0x3b')]===_0xd1fa('0x3c')){if(this[_0xd1fa('0x3d')][_0x15b4cc[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]){if(_0x15b4cc['exten']=='xcally-motion-preview'){this[_0xd1fa('0x3d')][_0x15b4cc['channel'][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x40')]=_0x15b4cc[_0xd1fa('0x41')];this['emit'](util[_0xd1fa('0x42')]('user:%s',this[_0xd1fa('0x3d')][_0x15b4cc[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['name']),_0xd1fa('0x43'),{'destaccountcode':this['agents'][_0x15b4cc['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x15b4cc[_0xd1fa('0x41')]});}}}}}catch(_0x3a9810){logger['error'](_0xd1fa('0x44'),_0x15b4cc[_0xd1fa('0x36')],util['inspect'](_0x3a9810,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x1b')]=function(_0x5a566b){try{if(this[_0xd1fa('0x30')](_0x5a566b)){logger[_0xd1fa('0x34')]('[%s][voiceCallReport][newchannel]\x20event:',_0x5a566b[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x5a566b,{'showHidden':![],'depth':null}));if(this[_0xd1fa('0x16')][_0x5a566b[_0xd1fa('0x36')]])return;if(_0x5a566b[_0xd1fa('0x3e')]==='OutgoingSpoolFailed')return;if(_0x5a566b['uniqueid']!==_0x5a566b['linkedid']&&!this[_0xd1fa('0x17')][_0x5a566b[_0xd1fa('0x45')]])return;logger[_0xd1fa('0x2a')](_0xd1fa('0x46'),_0x5a566b[_0xd1fa('0x36')],_0x5a566b['context'],_0x5a566b[_0xd1fa('0x47')]);this[_0xd1fa('0x16')][_0x5a566b[_0xd1fa('0x36')]]=new Channel();this['channels'][_0x5a566b[_0xd1fa('0x36')]][_0xd1fa('0x48')]=moment()[_0xd1fa('0x42')](_0xd1fa('0x49'));this[_0xd1fa('0x16')][_0x5a566b['uniqueid']]['disposition']=dispositions[_[_0xd1fa('0x4a')](_0x5a566b[_0xd1fa('0x4b')])];_[_0xd1fa('0x38')](this[_0xd1fa('0x16')][_0x5a566b[_0xd1fa('0x36')]],_[_0xd1fa('0x39')](_0x5a566b,_['keys'](this[_0xd1fa('0x16')][_0x5a566b[_0xd1fa('0x36')]])));if(_0x5a566b[_0xd1fa('0x3b')]==='from-sip'){if(this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]){if(_[_0xd1fa('0x37')](this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')]['split']('-')[0x0]][_0xd1fa('0x40')])){this['agents'][_0x5a566b[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x40')]=_0x5a566b[_0xd1fa('0x47')];logger[_0xd1fa('0x34')](_0xd1fa('0x4c'),_0x5a566b[_0xd1fa('0x36')],util[_0xd1fa('0x2e')]({'id':this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x5a566b[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x5a566b[_0xd1fa('0x47')]},{'showHidden':![],'depth':null}));this[_0xd1fa('0x31')](util['format'](_0xd1fa('0x4d'),this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')]['split']('-')[0x0]][_0xd1fa('0x4e')]),'user:agentconnect',{'id':this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xd1fa('0x3d')][_0x5a566b[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4f')],'destconnectedlinenum':_0x5a566b[_0xd1fa('0x47')]});}}}}}catch(_0x57f54b){logger[_0xd1fa('0x2c')]('[%s][voiceCallReport][newchannel]',_0x5a566b[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x57f54b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')]['syncNewExten']=function(_0x4dcc16){try{if(this['isNotNull'](_0x4dcc16)){logger[_0xd1fa('0x34')](_0xd1fa('0x50'),_0x4dcc16[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x4dcc16,{'showHidden':![],'depth':null}));if(_0x4dcc16[_0xd1fa('0x3e')]===_0xd1fa('0x51')||_0x4dcc16['exten']==='h')return;if(_0x4dcc16[_0xd1fa('0x36')]===_0x4dcc16[_0xd1fa('0x45')]||this[_0xd1fa('0x17')][_0x4dcc16[_0xd1fa('0x45')]]){_0x4dcc16[_0xd1fa('0x52')]=_0x4dcc16['application'][_0xd1fa('0x53')]();_0x4dcc16[_0xd1fa('0x54')]=_0x4dcc16[_0xd1fa('0x55')]||_0x4dcc16['applicationdata'];if(_0x4dcc16[_0xd1fa('0x55')]&&!_0x4dcc16[_0xd1fa('0x55')][_0xd1fa('0x56')](_0xd1fa('0x57'))&&_0x4dcc16[_0xd1fa('0x52')]!==_0xd1fa('0x9')){_0x4dcc16[_0xd1fa('0x54')]=_0x4dcc16[_0xd1fa('0x54')][_0xd1fa('0x53')]();}logger['info'](_0xd1fa('0x58'),_0x4dcc16[_0xd1fa('0x36')],_0x4dcc16[_0xd1fa('0x52')],_0x4dcc16['applicationdata']);if(_['isUndefined'](this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]])){this['channels'][_0x4dcc16['uniqueid']]=new Channel();this['channels'][_0x4dcc16['uniqueid']][_0xd1fa('0x48')]=_0x4dcc16['duration']?moment()[_0xd1fa('0x59')](moment[_0xd1fa('0x5a')](_0x4dcc16[_0xd1fa('0x5a')])[_0xd1fa('0x5b')](),'seconds')[_0xd1fa('0x42')](_0xd1fa('0x49')):moment()['format'](_0xd1fa('0x49'));this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]][_0xd1fa('0x5c')]=_0xd1fa('0xe');}_[_0xd1fa('0x38')](this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]],_[_0xd1fa('0x39')](_0x4dcc16,_[_0xd1fa('0x3a')](this[_0xd1fa('0x16')][_0x4dcc16['uniqueid']])));if(_[_0xd1fa('0x5d')](applications,_0x4dcc16[_0xd1fa('0x52')])){this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]]['lastapplication']=_0x4dcc16['application'];this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]][_0xd1fa('0x5e')]=_0x4dcc16[_0xd1fa('0x54')];if(_0x4dcc16[_0xd1fa('0x52')]===_0xd1fa('0x8')&&_['startsWith'](_0x4dcc16['applicationdata'][_0xd1fa('0x53')](),_0xd1fa('0x5f'))){var _0x4e7828=_0x4dcc16['applicationdata'][_0xd1fa('0x3f')]('=');var _0x5c93a7=_0x4e7828[0x0][_0xd1fa('0x53')]()[_0xd1fa('0x60')](/cdr\((.*)\)/);if(_0x5c93a7){if(_0x5c93a7[0x1]==='type'&&!_[_0xd1fa('0x61')](this['channels'][_0x4dcc16[_0xd1fa('0x36')]][_0x5c93a7[0x1]]))return;this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]][_0x5c93a7[0x1]]=_0x4e7828[0x1];}}else if(_0x4dcc16[_0xd1fa('0x52')]===_0xd1fa('0x9')){this[_0xd1fa('0x16')][_0x4dcc16[_0xd1fa('0x36')]][_0xd1fa('0x9')]=_0x4dcc16['applicationdata']['split'](',')[0x0];}}}}}catch(_0x3c1a53){logger[_0xd1fa('0x2c')]('[%s][voiceCallReport][newexten]',_0x4dcc16[_0xd1fa('0x36')],util['inspect'](_0x3c1a53,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x1d')]=function(_0x27fa40){try{if(this[_0xd1fa('0x30')](_0x27fa40)){logger['info'](_0xd1fa('0x62'),_0x27fa40[_0xd1fa('0x36')],_0x27fa40['linkedid'],_0x27fa40[_0xd1fa('0x33')],_0x27fa40[_0xd1fa('0x63')]);logger[_0xd1fa('0x34')](_0xd1fa('0x64'),_0x27fa40[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x27fa40,{'showHidden':![],'depth':null}));if(_0x27fa40[_0xd1fa('0x4b')]!=='6')return;if(_0x27fa40[_0xd1fa('0x36')]!==_0x27fa40[_0xd1fa('0x45')]){var _0x465953=moment();if(this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]]){if(!this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]]['answered']){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x65')]=!![];this[_0xd1fa('0x16')][_0x27fa40['linkedid']][_0xd1fa('0x66')]=_0x465953['format']('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xd1fa('0x16')][_0x27fa40['linkedid']][_0xd1fa('0x48')]){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]]['holdtime']=_0x465953[_0xd1fa('0x67')](this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x48')],_0xd1fa('0x5b'));}}this[_0xd1fa('0x16')][_0x27fa40['linkedid']][_0xd1fa('0x45')]=_0x27fa40[_0xd1fa('0x36')];if(_0x27fa40['calleridnum']!==_0xd1fa('0x68')){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x41')]=_0x27fa40['calleridnum'];}this[_0xd1fa('0x16')][_0x27fa40['linkedid']][_0xd1fa('0x69')]=_0x27fa40[_0xd1fa('0x33')];this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x6a')]=_0x27fa40[_0xd1fa('0x3e')];this['channels'][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x5c')]=dispositions[_[_0xd1fa('0x4a')](_0x27fa40[_0xd1fa('0x4b')])];if(this['agents'][_0x27fa40[_0xd1fa('0x3e')]['split']('-')[0x0]]){this['channels'][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x6b')]=this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'];this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x6c')]=this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4e')];}}if(this[_0xd1fa('0x16')][_0x27fa40['uniqueid']]){if(!this['channels'][_0x27fa40['uniqueid']][_0xd1fa('0x65')]){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x65')]=!![];this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x66')]=_0x465953[_0xd1fa('0x42')](_0xd1fa('0x49'));if(this['channels'][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x48')]){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]]['holdtime']=_0x465953[_0xd1fa('0x67')](this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x48')],_0xd1fa('0x5b'));}}if(_0x27fa40[_0xd1fa('0x63')]!==_0xd1fa('0x68')){this['channels'][_0x27fa40['uniqueid']][_0xd1fa('0x41')]=_0x27fa40[_0xd1fa('0x63')];}this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x69')]=_0x27fa40['calleridname'];this[_0xd1fa('0x16')][_0x27fa40['uniqueid']][_0xd1fa('0x6a')]=_0x27fa40[_0xd1fa('0x3e')];this['channels'][_0x27fa40['uniqueid']]['disposition']=dispositions[_['toNumber'](_0x27fa40['channelstate'])];}}else{if(this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]]){if(this[_0xd1fa('0x3d')][_0x27fa40['channel'][_0xd1fa('0x3f')]('-')[0x0]]){this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x6b')]=this['agents'][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'];this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x6c')]=this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')]['split']('-')[0x0]]['name'];}}}if(_0x27fa40[_0xd1fa('0x3b')]===_0xd1fa('0x3c')){if(this['agents'][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]){this['agents'][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x40')]=_0x27fa40[_0xd1fa('0x47')];var _0x20355d,_0x451b15;if(this[_0xd1fa('0x16')][_0x27fa40['uniqueid']]){_0x20355d=this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x6d')];_0x451b15=this['channels'][_0x27fa40[_0xd1fa('0x36')]][_0xd1fa('0x9')];}else if(this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]]){_0x20355d=this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x6d')];_0x451b15=this[_0xd1fa('0x16')][_0x27fa40[_0xd1fa('0x45')]][_0xd1fa('0x9')];}this[_0xd1fa('0x3d')][_0x27fa40['channel']['split']('-')[0x0]][_0xd1fa('0x9')]=_0x451b15;this[_0xd1fa('0x3d')][_0x27fa40['channel']['split']('-')[0x0]][_0xd1fa('0x6d')]=_0x20355d;logger[_0xd1fa('0x34')]('[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:',_0x27fa40['uniqueid'],util[_0xd1fa('0x2e')]({'id':this['agents'][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'],'destaccountcode':this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')]['split']('-')[0x0]][_0xd1fa('0x4f')],'destconnectedlinenum':_0x27fa40[_0xd1fa('0x47')],'routealias':_0x20355d,'queue':_0x451b15||undefined},{'showHidden':![],'depth':null}));this['emit'](util[_0xd1fa('0x42')](_0xd1fa('0x4d'),this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')]['split']('-')[0x0]]['name']),_0xd1fa('0x43'),{'id':this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0xd1fa('0x3d')][_0x27fa40[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4f')],'destconnectedlinenum':_0x27fa40[_0xd1fa('0x47')],'routealias':_0x20355d,'queue':_0x451b15||undefined});}}}}catch(_0x1f38bf){logger['error'](_0xd1fa('0x6e'),_0x27fa40[_0xd1fa('0x36')],util['inspect'](_0x1f38bf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x6f')]=function(_0x255665,_0x134706){try{if(this[_0xd1fa('0x16')][_0x255665]){logger[_0xd1fa('0x2a')](_0xd1fa('0x70'),_0x255665,_0x134706);this[_0xd1fa('0x16')][_0x255665]['monitor']=!![];if(_[_0xd1fa('0x71')](_0x134706,_0xd1fa('0x72'))){_0x134706=_0x134706['replace'](_0xd1fa('0x72'),_0xd1fa('0x73'));}this[_0xd1fa('0x16')][_0x255665][_0xd1fa('0x74')]=_0x134706;var _0x1a8401=_[_0xd1fa('0x75')](this[_0xd1fa('0x16')][_0x255665][_0xd1fa('0x76')],{'filename':_0x134706});if(_[_0xd1fa('0x61')](_0x1a8401)){this[_0xd1fa('0x16')][_0x255665][_0xd1fa('0x76')][_0xd1fa('0x77')]({'filename':_0x134706,'createdAt':moment()[_0xd1fa('0x42')](_0xd1fa('0x49')),'mixmonitorid':'','status':'rec'});}}}catch(_0x4b24d4){logger[_0xd1fa('0x2c')](_0xd1fa('0x78'),_0x255665,util['inspect'](_0x4b24d4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x1f')]=function(_0x469829){try{if(this[_0xd1fa('0x30')](_0x469829)){logger[_0xd1fa('0x34')](_0xd1fa('0x79'),_0x469829['uniqueid'],util[_0xd1fa('0x2e')](_0x469829,{'showHidden':![],'depth':null}));if(this['channels'][_0x469829[_0xd1fa('0x36')]]&&_0x469829['channel']!=_0xd1fa('0x51')){if(this['isNotNull'](_0x469829[_0xd1fa('0x7a')])){if(this[_0xd1fa('0x30')](_0x469829['variable'][_0xd1fa('0x7b')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x7c'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x6f')](_0x469829[_0xd1fa('0x36')],_0x469829['value']);}else if(this[_0xd1fa('0x30')](_0x469829['variable'][_0xd1fa('0x7e')])){logger['info'](_0xd1fa('0x7f'),_0x469829[_0xd1fa('0x36')],_0x469829['value']);this[_0xd1fa('0x16')][_0x469829['uniqueid']]['calleridnum']=_0x469829[_0xd1fa('0x7d')];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x80')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x81'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x82')]=_0x469829[_0xd1fa('0x7d')];}else if(this[_0xd1fa('0x30')](_0x469829['variable'][_0xd1fa('0x83')])){logger['info'](_0xd1fa('0x84'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]]['type']=_0x469829['value'];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x85')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x86'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]['split'](',')[0x0]);this['channels'][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x9')]=_0x469829[_0xd1fa('0x7d')][_0xd1fa('0x3f')](',')[0x0];}else if(this[_0xd1fa('0x30')](_0x469829['variable'][_0xd1fa('0x87')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x88'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x89')]=_0x469829['value'];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')]['xmd-destination'])){logger[_0xd1fa('0x2a')](_0xd1fa('0x8a'),_0x469829['uniqueid'],_0x469829['value']);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]]['destination']=_0x469829['value'];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x8b')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x8c')]=_0x469829[_0xd1fa('0x7d')];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x8d')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x8e'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x9')]=_0x469829[_0xd1fa('0x7d')];}else if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x8f')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x90'),_0x469829[_0xd1fa('0x36')],_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x36')]][_0xd1fa('0x91')]=_0x469829[_0xd1fa('0x7d')];}}}else if(this['isNotNull'](_0x469829['variable']['mixmonitor_filename'])){if(_0x469829['value']){var _0x3c50ad=path[_0xd1fa('0x92')](_0x469829[_0xd1fa('0x7d')])['name'];logger[_0xd1fa('0x2a')](_0xd1fa('0x7c'),_0x3c50ad,_0x469829[_0xd1fa('0x7d')]);this[_0xd1fa('0x6f')](_0x3c50ad,_0x469829[_0xd1fa('0x7d')]);}}else if(this['channels'][_0x469829[_0xd1fa('0x45')]]){if(this[_0xd1fa('0x30')](_0x469829['variable'])){if(this[_0xd1fa('0x30')](_0x469829[_0xd1fa('0x7a')][_0xd1fa('0x8f')])){logger[_0xd1fa('0x2a')](_0xd1fa('0x90'),_0x469829[_0xd1fa('0x45')],_0x469829['value']);this[_0xd1fa('0x16')][_0x469829[_0xd1fa('0x45')]][_0xd1fa('0x93')]=_0x469829['value'];}}}}}catch(_0x3f1dce){logger[_0xd1fa('0x2c')](_0xd1fa('0x94'),_0x469829['uniqueid'],util[_0xd1fa('0x2e')](_0x3f1dce,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x21')]=function(_0x10ccba){try{if(this[_0xd1fa('0x30')](_0x10ccba)){logger[_0xd1fa('0x34')](_0xd1fa('0x95'),_0x10ccba[_0xd1fa('0x36')],util['inspect'](_0x10ccba,{'showHidden':![],'depth':null}));if(this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]]){if(this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x45')]]){this['channels'][this['blindTransfers'][_0x10ccba['linkedid']][_0xd1fa('0x45')]][_0xd1fa('0x36')]=_0x10ccba['uniqueid'];this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x45')]][_0xd1fa('0x65')]=this['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x65')];this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x45')]][_0xd1fa('0x66')]=this['channels'][_0x10ccba['uniqueid']]['answertime'];this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x45')]]['destinationchannel']=this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba['linkedid']][_0xd1fa('0x45')]][_0xd1fa('0x3e')];this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x45')]][_0xd1fa('0x5c')]=this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x5c')];this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]=this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba['linkedid']][_0xd1fa('0x45')]];delete this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]]['linkedid']];}else if(this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]]){this['channels'][this['blindTransfers'][_0x10ccba['linkedid']][_0xd1fa('0x36')]][_0xd1fa('0x36')]=[this[_0xd1fa('0x16')][this['blindTransfers'][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x45')],this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]]['uniqueid']][_0xd1fa('0x45')]=this[_0xd1fa('0x16')][this['blindTransfers'][_0x10ccba['linkedid']]['uniqueid']]['uniqueid']][0x0];this['channels'][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x65')]=this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]['answered'];this['channels'][this['blindTransfers'][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x66')]=this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]['answertime'];this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x6a')]=this['channels'][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x3e')];this['channels'][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]][_0xd1fa('0x36')]][_0xd1fa('0x5c')]=this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x5c')];this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]=this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba['linkedid']][_0xd1fa('0x36')]];delete this[_0xd1fa('0x16')][this[_0xd1fa('0x17')][_0x10ccba[_0xd1fa('0x45')]]['uniqueid']];}}if(this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]){logger[_0xd1fa('0x2a')](_0xd1fa('0x96'),_0x10ccba[_0xd1fa('0x36')],_0x10ccba[_0xd1fa('0x97')]);var _0x518981=moment();this['channels'][_0x10ccba['uniqueid']]['endtime']=_0x518981[_0xd1fa('0x42')](_0xd1fa('0x49'));this['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x5a')]=_0x518981[_0xd1fa('0x67')](this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x48')],_0xd1fa('0x5b'));if(this['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x65')]){this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x98')]=_0x518981['diff'](this['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x66')],_0xd1fa('0x5b'));this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x99')]=this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x5a')]-this['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x98')];}if(_0x10ccba[_0xd1fa('0x3b')]===_0xd1fa('0x3c')){if(this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]){this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]=_[_0xd1fa('0x9a')](this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]],[_0xd1fa('0x40')]);logger[_0xd1fa('0x34')](_0xd1fa('0x9b'),_0x10ccba[_0xd1fa('0x36')],util[_0xd1fa('0x2e')]({'id':this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x10ccba['channel'][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4f')]},{'showHidden':![],'depth':null}));this[_0xd1fa('0x31')](util['format'](_0xd1fa('0x4d'),this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4e')]),_0xd1fa('0x9c'),{'id':this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0xd1fa('0x3d')][_0x10ccba[_0xd1fa('0x3e')][_0xd1fa('0x3f')]('-')[0x0]][_0xd1fa('0x4f')]});for(var _0x9628b9=0x0;_0x9628b9<Object[_0xd1fa('0x3a')](this['agents'])[_0xd1fa('0x9d')];_0x9628b9++){var _0x95aa2f=Object[_0xd1fa('0x3a')](this[_0xd1fa('0x3d')])[_0x9628b9];var _0x2e5c4a=this['agents'][_0x95aa2f];if(_0x2e5c4a[_0xd1fa('0x4f')]===Number(_0x10ccba[_0xd1fa('0x41')])){this[_0xd1fa('0x31')](util['format'](_0xd1fa('0x4d'),_0x2e5c4a[_0xd1fa('0x4e')]),_0xd1fa('0x9c'),{'id':_0x2e5c4a['id'],'destaccountcode':_0x2e5c4a[_0xd1fa('0x4f')],'transfer':this[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x9e')]});break;}}}}var _0x150886=this;Promise[_0xd1fa('0x9f')]()[_0xd1fa('0xa0')](function(){var _0x597e5e=_0x150886[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]];if(typeof _0x597e5e[_0xd1fa('0x9e')]==='undefined')return;if(_['isEmpty'](_0x597e5e['monitors']))return;return RpcSetting[_0xd1fa('0xa1')]()[_0xd1fa('0xa0')](function(_0x5210c1){if(!_0x5210c1['stopRecordingOnTransfer'])return;return Promise[_0xd1fa('0x9f')]()[_0xd1fa('0xa0')](function(){return ami[_0xd1fa('0xa2')]({'action':'StopMixMonitor','channel':_0x597e5e['channel']})[_0xd1fa('0xa3')](function(){});})[_0xd1fa('0xa0')](function(){return ami[_0xd1fa('0xa2')]({'action':_0xd1fa('0xa4'),'channel':_0x597e5e['destinationchannel']})[_0xd1fa('0xa3')](function(){})[_0xd1fa('0xa5')](function(){var _0x3d492b=_0x150886[_0xd1fa('0x3d')][_0x597e5e[_0xd1fa('0x6a')][_0xd1fa('0x3f')]('-')[0x0]];if(!_0x3d492b)return;io['emit'](_0xd1fa('0xa6'),{'agentId':_0x3d492b['id'],'uniqueid':_0x597e5e['uniqueid']});});});});})[_0xd1fa('0xa0')](function(){if(_0x10ccba[_0xd1fa('0xa7')]==='BlindTransfer'){_0x150886['blindTransfers'][_0x10ccba['uniqueid']]=_0x10ccba;}else{if(_0x150886[_0xd1fa('0x16')][_0x10ccba['uniqueid']][_0xd1fa('0xa8')]===_0xd1fa('0xa9')&&_0x150886['blindTransfers'][_0x10ccba['uniqueid']]){_0x150886[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x36')]=[_0x150886[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]]['linkedid'],_0x150886['channels'][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x45')]=_0x150886[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]][_0xd1fa('0x36')]][0x0];delete _0x150886['blindTransfers'][_0x10ccba[_0xd1fa('0x36')]];}}logger[_0xd1fa('0x34')](_0xd1fa('0xaa'),_0x10ccba['uniqueid'],util[_0xd1fa('0x2e')](_0x150886[_0xd1fa('0x16')][_0x10ccba[_0xd1fa('0x36')]],{'showHidden':![],'depth':null}));ami[_0xd1fa('0x31')]('custom:voiceCallReport',_0x150886['channels'][_0x10ccba[_0xd1fa('0x36')]]);delete _0x150886['channels'][_0x10ccba['uniqueid']];});}}}catch(_0x4718a7){logger[_0xd1fa('0x2c')](_0xd1fa('0xab'),_0x10ccba[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x4718a7,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xd1fa('0x24')]=function(_0x5e22e9){try{if(this[_0xd1fa('0x30')](_0x5e22e9)){logger[_0xd1fa('0x2a')](_0xd1fa('0xac'),_0x5e22e9[_0xd1fa('0x36')],_0x5e22e9['origtransferercalleridnum'],_0x5e22e9[_0xd1fa('0xad')]);logger[_0xd1fa('0x34')](_0xd1fa('0xae'),_0x5e22e9[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x5e22e9,{'showHidden':![],'depth':null}));var _0x1bc62c;if(this[_0xd1fa('0x16')][_0x5e22e9['transfereeuniqueid']]){this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xaf')]]['transfercalleridnum']=_0x5e22e9[_0xd1fa('0xb0')];this[_0xd1fa('0x16')][_0x5e22e9['transfereeuniqueid']][_0xd1fa('0xb1')]=_0x5e22e9[_0xd1fa('0xad')];if(this['channels'][_0x5e22e9[_0xd1fa('0xb2')]]){_0x1bc62c=this[_0xd1fa('0x16')][_0x5e22e9['secondtransfereruniqueid']];this['channels'][_0x5e22e9[_0xd1fa('0xb2')]]=this['channels'][_0x5e22e9[_0xd1fa('0xaf')]];this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xaf')]]=_0x1bc62c;}this['channels'][_0x5e22e9[_0xd1fa('0xb2')]][_0xd1fa('0x9e')]=_0xd1fa('0xb3');}else if(this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb4')]]){this['channels'][_0x5e22e9['transfertargetuniqueid']][_0xd1fa('0xb5')]=_0x5e22e9['origtransferercalleridnum'];this[_0xd1fa('0x16')][_0x5e22e9['transfertargetuniqueid']]['transferconnectedlinenum']=_0x5e22e9[_0xd1fa('0xad')];if(this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb6')]]){_0x1bc62c=this['channels'][_0x5e22e9[_0xd1fa('0xb6')]];this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb6')]]=this[_0xd1fa('0x16')][_0x5e22e9['transfertargetuniqueid']];this[_0xd1fa('0x16')][_0x5e22e9['transfertargetuniqueid']]=_0x1bc62c;}this[_0xd1fa('0x16')][_0x5e22e9['transfertargetuniqueid']]['transferType']=_0xd1fa('0xb3');}if((this[_0xd1fa('0x16')][_0x5e22e9['origtransfereruniqueid']]||this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb7')]])&&this[_0xd1fa('0x16')][_0x5e22e9['secondtransfereruniqueid']]){var _0x2b07da=_[_0xd1fa('0xb8')]([this['channels'][_0x5e22e9[_0xd1fa('0xb6')]],this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb7')]],this['channels'][_0x5e22e9[_0xd1fa('0xb2')]]],function(_0x1581f4){return _0x1581f4&&_0x1581f4['type']===_0xd1fa('0xa9')&&_0x1581f4[_0xd1fa('0xb9')];});if(_0x2b07da){if(this['channels'][_0x5e22e9[_0xd1fa('0xb6')]])this[_0xd1fa('0x16')][_0x5e22e9['origtransfereruniqueid']]['transferType']=_0xd1fa('0xb3');if(this[_0xd1fa('0x16')][_0x5e22e9['origtransfererlinkedid']])this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb7')]][_0xd1fa('0x9e')]=_0xd1fa('0xb3');this[_0xd1fa('0x16')][_0x5e22e9[_0xd1fa('0xb2')]][_0xd1fa('0x9e')]=_0xd1fa('0xb3');}}}}catch(_0x512589){logger[_0xd1fa('0x2c')]('[%s][voiceCallReport][attendedtransfer]',_0x5e22e9[_0xd1fa('0x36')],util['inspect'](_0x512589,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')]['syncBlindTransfer']=function(_0xd34b5c){try{if(this['isNotNull'](_0xd34b5c)){logger['info'](_0xd1fa('0xba'),_0xd34b5c[_0xd1fa('0x36')],_0xd34b5c[_0xd1fa('0xbb')],_0xd34b5c[_0xd1fa('0xbc')]);logger[_0xd1fa('0x34')](_0xd1fa('0xbd'),_0xd34b5c[_0xd1fa('0x36')],util['inspect'](_0xd34b5c,{'showHidden':![],'depth':null}));if(this[_0xd1fa('0x16')][_0xd34b5c['transfereeuniqueid']]){this[_0xd1fa('0x16')][_0xd34b5c[_0xd1fa('0xaf')]][_0xd1fa('0xb5')]=_0xd34b5c[_0xd1fa('0xbb')];this['channels'][_0xd34b5c[_0xd1fa('0xaf')]][_0xd1fa('0xb1')]=_0xd34b5c[_0xd1fa('0xbc')];this[_0xd1fa('0x16')][_0xd34b5c[_0xd1fa('0xaf')]][_0xd1fa('0x9e')]=_0xd1fa('0xbe');this[_0xd1fa('0x21')]({'event':_0xd1fa('0xbf'),'uniqueid':_0xd34b5c[_0xd1fa('0xaf')],'linkedid':_0xd34b5c[_0xd1fa('0xc0')],'context':_0xd34b5c['context'],'channel':_0xd34b5c['transfererchannel']});}else{this['channels'][_0xd34b5c[_0xd1fa('0xc0')]][_0xd1fa('0x9e')]=_0xd1fa('0xbe');this[_0xd1fa('0x21')]({'event':_0xd1fa('0xbf'),'uniqueid':_0xd34b5c['transfereruniqueid'],'linkedid':_0xd34b5c[_0xd1fa('0xaf')],'context':_0xd34b5c[_0xd1fa('0x3b')],'channel':_0xd34b5c['transfererchannel']});}}}catch(_0x2f9570){logger[_0xd1fa('0x2c')](_0xd1fa('0xc1'),_0xd34b5c['uniqueid'],util[_0xd1fa('0x2e')](_0x2f9570,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x27')]=function(_0x3bc7d3){try{if(this[_0xd1fa('0x30')](_0x3bc7d3)){logger[_0xd1fa('0x34')](_0xd1fa('0xc2'),_0x3bc7d3[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x3bc7d3,{'showHidden':![],'depth':null}));if(this[_0xd1fa('0x16')][_0x3bc7d3[_0xd1fa('0x36')]]){if(!_['isNil'](this[_0xd1fa('0x16')][_0x3bc7d3[_0xd1fa('0x36')]][_0xd1fa('0x66')])){this[_0xd1fa('0x16')][_0x3bc7d3[_0xd1fa('0x36')]]['mohstarttime']=moment()[_0xd1fa('0x42')](_0xd1fa('0x49'));logger['info'](_0xd1fa('0xc3'),_0x3bc7d3['uniqueid'],this['channels'][_0x3bc7d3['uniqueid']][_0xd1fa('0xc4')]);}}}}catch(_0x41c72e){logger[_0xd1fa('0x2c')]('[%s][voiceCallReport][musiconholdstart]',_0x3bc7d3['uniqueid'],util['inspect'](_0x41c72e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xd1fa('0x2f')][_0xd1fa('0x29')]=function(_0x108a3f){try{if(this[_0xd1fa('0x30')](_0x108a3f)){logger[_0xd1fa('0x34')](_0xd1fa('0xc5'),_0x108a3f[_0xd1fa('0x36')],util['inspect'](_0x108a3f,{'showHidden':![],'depth':null}));if(this['channels'][_0x108a3f[_0xd1fa('0x36')]]){if(!_[_0xd1fa('0x61')](this['channels'][_0x108a3f[_0xd1fa('0x36')]][_0xd1fa('0xc4')])){this[_0xd1fa('0x16')][_0x108a3f[_0xd1fa('0x36')]][_0xd1fa('0xc6')]+=moment()[_0xd1fa('0xc7')](0x0)['diff'](this[_0xd1fa('0x16')][_0x108a3f[_0xd1fa('0x36')]][_0xd1fa('0xc4')],_0xd1fa('0x5b'));logger[_0xd1fa('0x2a')](_0xd1fa('0xc8'),_0x108a3f['uniqueid'],this[_0xd1fa('0x16')][_0x108a3f['uniqueid']][_0xd1fa('0xc6')]);delete this['channels'][_0x108a3f['uniqueid']][_0xd1fa('0xc4')];}}}}catch(_0x21c272){logger[_0xd1fa('0x2c')]('[%s][voiceCallReport][musiconholdstop]',_0x108a3f[_0xd1fa('0x36')],util[_0xd1fa('0x2e')](_0x21c272,{'showHidden':![],'depth':null}));}};module[_0xd1fa('0xc9')]=VoiceCallReport;
\ No newline at end of file
+var _0x8d29=['xcally-motion-preview','connectedlinename','destinationchannel','UserId','holdtime','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','push','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','undefined','isEmpty','stopRecordingOnTransfer','Action','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','ATTENDED','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','[%s][voiceCallReport][blindtransfer]\x20event:','transfereecalleridnum','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','mohstarttime','[%s][voiceCallReport][musiconholdstart]','milliseconds','mohtime','[%s][voiceCallReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','../rpc/setting','set','agi','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','hangup','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isUndefined','emit','isNotNull','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','from-sip','split','exten','channel','format','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','toNumber','channelstate','context','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','user:%s','name','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','YYYY-MM-DD\x20HH:mm:ss','keys','includes','cdr(','match','isNil','queue','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','diff'];(function(_0x34d251,_0x17825d){var _0x116403=function(_0x1c911f){while(--_0x1c911f){_0x34d251['push'](_0x34d251['shift']());}};_0x116403(++_0x17825d);}(_0x8d29,0x1e9));var _0x98d2=function(_0x2f6ad4,_0xe38c70){_0x2f6ad4=_0x2f6ad4-0x0;var _0x243e23=_0x8d29[_0x2f6ad4];return _0x243e23;};'use strict';var _=require('lodash');var moment=require(_0x98d2('0x0'));var util=require(_0x98d2('0x1'));var path=require('path');var Redis=require(_0x98d2('0x2'));var config=require(_0x98d2('0x3'));var logger=require(_0x98d2('0x4'))(_0x98d2('0x5'));var ami=require('../ami');var Channel=require(_0x98d2('0x6'));var RpcSetting=require(_0x98d2('0x7'));var applications=[_0x98d2('0x8'),'queue',_0x98d2('0x9'),'dial',_0x98d2('0xa'),_0x98d2('0xb')];var dispositions=[_0x98d2('0xc'),_0x98d2('0xd'),_0x98d2('0xd'),_0x98d2('0xc'),_0x98d2('0xc'),_0x98d2('0xc'),'ANSWERED',_0x98d2('0xe'),'FAILED',_0x98d2('0xd'),_0x98d2('0xd')];config['redis']=_[_0x98d2('0xf')](config[_0x98d2('0x10')],{'host':_0x98d2('0x11'),'port':0x18eb});var io=require(_0x98d2('0x12'))(new Redis(config[_0x98d2('0x10')]));function VoiceCallReport(_0x3df2cb){this[_0x98d2('0x13')]=_0x3df2cb[_0x98d2('0x13')];this[_0x98d2('0x14')]=_0x3df2cb['agents'];this[_0x98d2('0x15')]={};ami['on'](_0x98d2('0x16'),this[_0x98d2('0x17')][_0x98d2('0x18')](this));ami['on'](_0x98d2('0x19'),this[_0x98d2('0x17')]['bind'](this));ami['on'](_0x98d2('0x1a'),this[_0x98d2('0x1b')][_0x98d2('0x18')](this));ami['on']('newstate',this[_0x98d2('0x1c')][_0x98d2('0x18')](this));ami['on']('varset',this['syncVarSet'][_0x98d2('0x18')](this));ami['on'](_0x98d2('0x1d'),this[_0x98d2('0x1e')][_0x98d2('0x18')](this));ami['on']('newcallerid',this[_0x98d2('0x1f')]['bind'](this));ami['on'](_0x98d2('0x20'),this[_0x98d2('0x21')][_0x98d2('0x18')](this));ami['on'](_0x98d2('0x22'),this[_0x98d2('0x23')][_0x98d2('0x18')](this));ami['on']('musiconholdstart',this[_0x98d2('0x24')][_0x98d2('0x18')](this));ami['on'](_0x98d2('0x25'),this[_0x98d2('0x26')][_0x98d2('0x18')](this));try{logger[_0x98d2('0x27')](_0x98d2('0x28'));ami[_0x98d2('0x29')]();}catch(_0x24ffca){logger[_0x98d2('0x2a')]('[voiceCallReport][coreshowchannels]',util[_0x98d2('0x2b')](_0x24ffca,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x98d2('0x2c')]['isNotNull']=function(_0x4f34f5){return _0x4f34f5!==null&&!_[_0x98d2('0x2d')](_0x4f34f5);};VoiceCallReport['prototype']['emit']=function(_0x21d7e9,_0x4e3912,_0x365b40){io['to'](_0x21d7e9)[_0x98d2('0x2e')](_0x4e3912,_0x365b40);};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x1f')]=function(_0x7fc235){try{if(this[_0x98d2('0x2f')](_0x7fc235)){logger[_0x98d2('0x27')](_0x98d2('0x30'),_0x7fc235[_0x98d2('0x31')],_0x7fc235[_0x98d2('0x32')],_0x7fc235[_0x98d2('0x33')]);logger[_0x98d2('0x34')](_0x98d2('0x35'),_0x7fc235[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x7fc235,{'showHidden':![],'depth':null}));if(_0x7fc235['uniqueid']===_0x7fc235[_0x98d2('0x36')]){if(!_[_0x98d2('0x2d')](this['channels'][_0x7fc235['uniqueid']])){_[_0x98d2('0x37')](this[_0x98d2('0x13')][_0x7fc235[_0x98d2('0x31')]],_[_0x98d2('0x38')](_0x7fc235,_['keys'](this[_0x98d2('0x13')][_0x7fc235[_0x98d2('0x31')]])));}}if(_0x7fc235['context']===_0x98d2('0x39')){if(this[_0x98d2('0x14')][_0x7fc235['channel'][_0x98d2('0x3a')]('-')[0x0]]){if(_0x7fc235[_0x98d2('0x3b')]=='xcally-motion-preview'){this[_0x98d2('0x14')][_0x7fc235[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]['destconnectedlinenum']=_0x7fc235['connectedlinenum'];this[_0x98d2('0x2e')](util[_0x98d2('0x3d')]('user:%s',this['agents'][_0x7fc235[_0x98d2('0x3c')]['split']('-')[0x0]]['name']),_0x98d2('0x3e'),{'destaccountcode':this[_0x98d2('0x14')][_0x7fc235[_0x98d2('0x3c')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x7fc235[_0x98d2('0x3f')]});}}}}}catch(_0x172ffc){logger[_0x98d2('0x2a')](_0x98d2('0x40'),_0x7fc235['uniqueid'],util['inspect'](_0x172ffc,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')]['syncNewChannel']=function(_0x4f163e){try{if(this[_0x98d2('0x2f')](_0x4f163e)){logger[_0x98d2('0x34')]('[%s][voiceCallReport][newchannel]\x20event:',_0x4f163e[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x4f163e,{'showHidden':![],'depth':null}));if(this[_0x98d2('0x13')][_0x4f163e[_0x98d2('0x31')]])return;if(_0x4f163e[_0x98d2('0x3c')]==='OutgoingSpoolFailed')return;if(_0x4f163e['uniqueid']!==_0x4f163e['linkedid']&&!this[_0x98d2('0x15')][_0x4f163e['linkedid']])return;logger[_0x98d2('0x27')](_0x98d2('0x41'),_0x4f163e[_0x98d2('0x31')],_0x4f163e['context'],_0x4f163e[_0x98d2('0x3b')]);this[_0x98d2('0x13')][_0x4f163e[_0x98d2('0x31')]]=new Channel();this['channels'][_0x4f163e[_0x98d2('0x31')]][_0x98d2('0x42')]=moment()[_0x98d2('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x98d2('0x13')][_0x4f163e['uniqueid']][_0x98d2('0x43')]=dispositions[_[_0x98d2('0x44')](_0x4f163e[_0x98d2('0x45')])];_[_0x98d2('0x37')](this[_0x98d2('0x13')][_0x4f163e[_0x98d2('0x31')]],_[_0x98d2('0x38')](_0x4f163e,_['keys'](this[_0x98d2('0x13')][_0x4f163e['uniqueid']])));if(_0x4f163e[_0x98d2('0x46')]==='from-sip'){if(this[_0x98d2('0x14')][_0x4f163e[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]){if(_[_0x98d2('0x2d')](this[_0x98d2('0x14')][_0x4f163e[_0x98d2('0x3c')]['split']('-')[0x0]]['destconnectedlinenum'])){this[_0x98d2('0x14')][_0x4f163e[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x47')]=_0x4f163e['exten'];logger['debug'](_0x98d2('0x48'),_0x4f163e[_0x98d2('0x31')],util[_0x98d2('0x2b')]({'id':this['agents'][_0x4f163e[_0x98d2('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x98d2('0x14')][_0x4f163e[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x49')],'destconnectedlinenum':_0x4f163e['exten']},{'showHidden':![],'depth':null}));this['emit'](util[_0x98d2('0x3d')](_0x98d2('0x4a'),this[_0x98d2('0x14')][_0x4f163e['channel'][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x4b')]),'user:agentconnect',{'id':this['agents'][_0x4f163e[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x4f163e[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x49')],'destconnectedlinenum':_0x4f163e['exten']});}}}}}catch(_0x28c9eb){logger['error']('[%s][voiceCallReport][newchannel]',_0x4f163e['uniqueid'],util[_0x98d2('0x2b')](_0x28c9eb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x98d2('0x17')]=function(_0x30346b){try{if(this['isNotNull'](_0x30346b)){logger[_0x98d2('0x34')](_0x98d2('0x4c'),_0x30346b[_0x98d2('0x31')],util['inspect'](_0x30346b,{'showHidden':![],'depth':null}));if(_0x30346b[_0x98d2('0x3c')]===_0x98d2('0x4d')||_0x30346b[_0x98d2('0x3b')]==='h')return;if(_0x30346b['uniqueid']===_0x30346b['linkedid']||this[_0x98d2('0x15')][_0x30346b[_0x98d2('0x36')]]){_0x30346b[_0x98d2('0x4e')]=_0x30346b[_0x98d2('0x4e')][_0x98d2('0x4f')]();_0x30346b[_0x98d2('0x50')]=_0x30346b[_0x98d2('0x51')]||_0x30346b[_0x98d2('0x50')];if(_0x30346b[_0x98d2('0x51')]&&!_0x30346b[_0x98d2('0x51')][_0x98d2('0x52')](_0x98d2('0x53'))&&_0x30346b[_0x98d2('0x4e')]!=='queue'){_0x30346b['applicationdata']=_0x30346b[_0x98d2('0x50')][_0x98d2('0x4f')]();}logger[_0x98d2('0x27')](_0x98d2('0x54'),_0x30346b['uniqueid'],_0x30346b[_0x98d2('0x4e')],_0x30346b[_0x98d2('0x50')]);if(_[_0x98d2('0x2d')](this[_0x98d2('0x13')][_0x30346b['uniqueid']])){this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]]=new Channel();this['channels'][_0x30346b['uniqueid']][_0x98d2('0x42')]=_0x30346b[_0x98d2('0x55')]?moment()[_0x98d2('0x56')](moment['duration'](_0x30346b['duration'])['seconds'](),_0x98d2('0x57'))['format'](_0x98d2('0x58')):moment()[_0x98d2('0x3d')](_0x98d2('0x58'));this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]][_0x98d2('0x43')]=_0x98d2('0xc');}_[_0x98d2('0x37')](this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]],_['pick'](_0x30346b,_[_0x98d2('0x59')](this['channels'][_0x30346b[_0x98d2('0x31')]])));if(_[_0x98d2('0x5a')](applications,_0x30346b[_0x98d2('0x4e')])){this['channels'][_0x30346b['uniqueid']]['lastapplication']=_0x30346b['application'];this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]]['lastdata']=_0x30346b[_0x98d2('0x50')];if(_0x30346b[_0x98d2('0x4e')]==='set'&&_['startsWith'](_0x30346b[_0x98d2('0x50')][_0x98d2('0x4f')](),_0x98d2('0x5b'))){var _0x59ee38=_0x30346b['applicationdata'][_0x98d2('0x3a')]('=');var _0x3d09a4=_0x59ee38[0x0]['toLowerCase']()[_0x98d2('0x5c')](/cdr\((.*)\)/);if(_0x3d09a4){if(_0x3d09a4[0x1]==='type'&&!_[_0x98d2('0x5d')](this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]][_0x3d09a4[0x1]]))return;this[_0x98d2('0x13')][_0x30346b['uniqueid']][_0x3d09a4[0x1]]=_0x59ee38[0x1];}}else if(_0x30346b[_0x98d2('0x4e')]===_0x98d2('0x5e')){this[_0x98d2('0x13')][_0x30346b[_0x98d2('0x31')]]['queue']=_0x30346b['applicationdata'][_0x98d2('0x3a')](',')[0x0];}}}}}catch(_0x8d0aa6){logger[_0x98d2('0x2a')]('[%s][voiceCallReport][newexten]',_0x30346b[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x8d0aa6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')]['syncNewState']=function(_0x300ab8){try{if(this[_0x98d2('0x2f')](_0x300ab8)){logger[_0x98d2('0x27')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x300ab8[_0x98d2('0x31')],_0x300ab8[_0x98d2('0x36')],_0x300ab8[_0x98d2('0x32')],_0x300ab8[_0x98d2('0x33')]);logger['debug'](_0x98d2('0x5f'),_0x300ab8[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x300ab8,{'showHidden':![],'depth':null}));if(_0x300ab8[_0x98d2('0x45')]!=='6')return;if(_0x300ab8[_0x98d2('0x31')]!==_0x300ab8[_0x98d2('0x36')]){var _0x3a8202=moment();if(this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]]){if(!this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x60')]){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]]['answered']=!![];this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x61')]=_0x3a8202[_0x98d2('0x3d')](_0x98d2('0x58'));if(this[_0x98d2('0x13')][_0x300ab8['linkedid']][_0x98d2('0x42')]){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]]['holdtime']=_0x3a8202[_0x98d2('0x62')](this['channels'][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x42')],'seconds');}}this['channels'][_0x300ab8[_0x98d2('0x36')]]['linkedid']=_0x300ab8[_0x98d2('0x31')];if(_0x300ab8[_0x98d2('0x33')]!==_0x98d2('0x63')){this[_0x98d2('0x13')][_0x300ab8['linkedid']][_0x98d2('0x3f')]=_0x300ab8[_0x98d2('0x33')];}this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x64')]=_0x300ab8[_0x98d2('0x32')];this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x65')]=_0x300ab8[_0x98d2('0x3c')];this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x43')]=dispositions[_['toNumber'](_0x300ab8[_0x98d2('0x45')])];if(this[_0x98d2('0x14')][_0x300ab8['channel'][_0x98d2('0x3a')]('-')[0x0]]){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x66')]=this['agents'][_0x300ab8[_0x98d2('0x3c')]['split']('-')[0x0]]['id'];this[_0x98d2('0x13')][_0x300ab8['linkedid']]['membername']=this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x4b')];}}if(this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]]){if(!this['channels'][_0x300ab8[_0x98d2('0x31')]]['answered']){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x60')]=!![];this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x61')]=_0x3a8202[_0x98d2('0x3d')](_0x98d2('0x58'));if(this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x42')]){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x67')]=_0x3a8202['diff'](this['channels'][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x42')],_0x98d2('0x57'));}}if(_0x300ab8[_0x98d2('0x33')]!==_0x98d2('0x63')){this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]]['connectedlinenum']=_0x300ab8[_0x98d2('0x33')];}this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x64')]=_0x300ab8[_0x98d2('0x32')];this['channels'][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x65')]=_0x300ab8[_0x98d2('0x3c')];this[_0x98d2('0x13')][_0x300ab8['uniqueid']][_0x98d2('0x43')]=dispositions[_[_0x98d2('0x44')](_0x300ab8[_0x98d2('0x45')])];}}else{if(this['channels'][_0x300ab8['uniqueid']]){if(this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')]['split']('-')[0x0]]){this['channels'][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x66')]=this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]['id'];this['channels'][_0x300ab8['uniqueid']]['membername']=this[_0x98d2('0x14')][_0x300ab8['channel'][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x4b')];}}}if(_0x300ab8[_0x98d2('0x46')]==='from-sip'){if(this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]){this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x47')]=_0x300ab8[_0x98d2('0x3b')];var _0x1ac729,_0x497de1;if(this[_0x98d2('0x13')][_0x300ab8['uniqueid']]){_0x1ac729=this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x31')]][_0x98d2('0x68')];_0x497de1=this[_0x98d2('0x13')][_0x300ab8['uniqueid']]['queue'];}else if(this[_0x98d2('0x13')][_0x300ab8[_0x98d2('0x36')]]){_0x1ac729=this['channels'][_0x300ab8[_0x98d2('0x36')]][_0x98d2('0x68')];_0x497de1=this[_0x98d2('0x13')][_0x300ab8['linkedid']][_0x98d2('0x5e')];}this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')]['split']('-')[0x0]][_0x98d2('0x5e')]=_0x497de1;this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]['routealias']=_0x1ac729;logger[_0x98d2('0x34')](_0x98d2('0x69'),_0x300ab8['uniqueid'],util[_0x98d2('0x2b')]({'id':this[_0x98d2('0x14')][_0x300ab8['channel'][_0x98d2('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x49')],'destconnectedlinenum':_0x300ab8[_0x98d2('0x3b')],'routealias':_0x1ac729,'queue':_0x497de1||undefined},{'showHidden':![],'depth':null}));this[_0x98d2('0x2e')](util[_0x98d2('0x3d')](_0x98d2('0x4a'),this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x4b')]),'user:agentconnect',{'id':this['agents'][_0x300ab8['channel'][_0x98d2('0x3a')]('-')[0x0]]['id'],'agentconnected':!![],'destaccountcode':this[_0x98d2('0x14')][_0x300ab8[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x49')],'destconnectedlinenum':_0x300ab8[_0x98d2('0x3b')],'routealias':_0x1ac729,'queue':_0x497de1||undefined});}}}}catch(_0x3082ce){logger[_0x98d2('0x2a')](_0x98d2('0x6a'),_0x300ab8['uniqueid'],util[_0x98d2('0x2b')](_0x3082ce,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x6b')]=function(_0x3e2a60,_0x1b5595){try{if(this[_0x98d2('0x13')][_0x3e2a60]){logger[_0x98d2('0x27')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x3e2a60,_0x1b5595);this[_0x98d2('0x13')][_0x3e2a60][_0x98d2('0x6c')]=!![];if(_[_0x98d2('0x6d')](_0x1b5595,'.wav49')){_0x1b5595=_0x1b5595['replace'](_0x98d2('0x6e'),_0x98d2('0x6f'));}this['channels'][_0x3e2a60][_0x98d2('0x70')]=_0x1b5595;var _0x3733e4=_[_0x98d2('0x71')](this[_0x98d2('0x13')][_0x3e2a60]['monitors'],{'filename':_0x1b5595});if(_[_0x98d2('0x5d')](_0x3733e4)){this['channels'][_0x3e2a60][_0x98d2('0x72')][_0x98d2('0x73')]({'filename':_0x1b5595,'createdAt':moment()[_0x98d2('0x3d')](_0x98d2('0x58')),'mixmonitorid':'','status':'rec'});}}}catch(_0x1863e2){logger[_0x98d2('0x2a')](_0x98d2('0x74'),_0x3e2a60,util['inspect'](_0x1863e2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x75')]=function(_0x10806b){try{if(this['isNotNull'](_0x10806b)){logger['debug'](_0x98d2('0x76'),_0x10806b['uniqueid'],util[_0x98d2('0x2b')](_0x10806b,{'showHidden':![],'depth':null}));if(this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]]&&_0x10806b[_0x98d2('0x3c')]!=_0x98d2('0x4d')){if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')])){if(this[_0x98d2('0x2f')](_0x10806b['variable'][_0x98d2('0x78')])){logger[_0x98d2('0x27')](_0x98d2('0x79'),_0x10806b[_0x98d2('0x31')],_0x10806b[_0x98d2('0x7a')]);this[_0x98d2('0x6b')](_0x10806b[_0x98d2('0x31')],_0x10806b['value']);}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')]['xmd-phone'])){logger[_0x98d2('0x27')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x10806b['uniqueid'],_0x10806b[_0x98d2('0x7a')]);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]][_0x98d2('0x33')]=_0x10806b[_0x98d2('0x7a')];}else if(this['isNotNull'](_0x10806b[_0x98d2('0x77')][_0x98d2('0x7b')])){logger[_0x98d2('0x27')](_0x98d2('0x7c'),_0x10806b[_0x98d2('0x31')],_0x10806b['value']);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]]['callerid']=_0x10806b['value'];}else if(this[_0x98d2('0x2f')](_0x10806b['variable'][_0x98d2('0x7d')])){logger[_0x98d2('0x27')](_0x98d2('0x7e'),_0x10806b[_0x98d2('0x31')],_0x10806b[_0x98d2('0x7a')]);this['channels'][_0x10806b[_0x98d2('0x31')]]['type']=_0x10806b['value'];}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')][_0x98d2('0x7f')])){logger[_0x98d2('0x27')](_0x98d2('0x80'),_0x10806b[_0x98d2('0x31')],_0x10806b[_0x98d2('0x7a')][_0x98d2('0x3a')](',')[0x0]);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]][_0x98d2('0x5e')]=_0x10806b[_0x98d2('0x7a')][_0x98d2('0x3a')](',')[0x0];}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')][_0x98d2('0x81')])){logger['info'](_0x98d2('0x82'),_0x10806b[_0x98d2('0x31')],_0x10806b['value']);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]][_0x98d2('0x83')]=_0x10806b[_0x98d2('0x7a')];}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')][_0x98d2('0x84')])){logger[_0x98d2('0x27')](_0x98d2('0x85'),_0x10806b[_0x98d2('0x31')],_0x10806b[_0x98d2('0x7a')]);this['channels'][_0x10806b['uniqueid']][_0x98d2('0x86')]=_0x10806b[_0x98d2('0x7a')];}else if(this['isNotNull'](_0x10806b['variable'][_0x98d2('0x87')])){logger[_0x98d2('0x27')](_0x98d2('0x88'),_0x10806b['uniqueid'],_0x10806b['value']);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]]['calleridpreview']=_0x10806b[_0x98d2('0x7a')];}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')]['xmcs-queue'])){logger[_0x98d2('0x27')](_0x98d2('0x89'),_0x10806b[_0x98d2('0x31')],_0x10806b[_0x98d2('0x7a')]);this['channels'][_0x10806b[_0x98d2('0x31')]]['queue']=_0x10806b[_0x98d2('0x7a')];}else if(this[_0x98d2('0x2f')](_0x10806b['variable'][_0x98d2('0x8a')])){logger[_0x98d2('0x27')](_0x98d2('0x8b'),_0x10806b[_0x98d2('0x31')],_0x10806b['value']);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x31')]][_0x98d2('0x8c')]=_0x10806b[_0x98d2('0x7a')];}}}else if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')][_0x98d2('0x78')])){if(_0x10806b['value']){var _0x1d78fc=path[_0x98d2('0x8d')](_0x10806b['value'])[_0x98d2('0x4b')];logger[_0x98d2('0x27')](_0x98d2('0x79'),_0x1d78fc,_0x10806b[_0x98d2('0x7a')]);this[_0x98d2('0x6b')](_0x1d78fc,_0x10806b['value']);}}else if(this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x36')]]){if(this[_0x98d2('0x2f')](_0x10806b['variable'])){if(this[_0x98d2('0x2f')](_0x10806b[_0x98d2('0x77')][_0x98d2('0x8a')])){logger['info'](_0x98d2('0x8b'),_0x10806b[_0x98d2('0x36')],_0x10806b[_0x98d2('0x7a')]);this[_0x98d2('0x13')][_0x10806b[_0x98d2('0x36')]][_0x98d2('0x8e')]=_0x10806b[_0x98d2('0x7a')];}}}}}catch(_0x1f69ca){logger[_0x98d2('0x2a')](_0x98d2('0x8f'),_0x10806b[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x1f69ca,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x98d2('0x1e')]=function(_0x4747bf){try{if(this[_0x98d2('0x2f')](_0x4747bf)){logger[_0x98d2('0x34')](_0x98d2('0x90'),_0x4747bf[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x4747bf,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x4747bf['linkedid']]){if(this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf[_0x98d2('0x36')]][_0x98d2('0x36')]]){this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf['linkedid']]['linkedid']][_0x98d2('0x31')]=_0x4747bf[_0x98d2('0x31')];this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]]['linkedid']][_0x98d2('0x60')]=this[_0x98d2('0x13')][_0x4747bf['uniqueid']]['answered'];this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf['linkedid']]['linkedid']][_0x98d2('0x61')]=this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x61')];this['channels'][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]]['linkedid']][_0x98d2('0x65')]=this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf['linkedid']]['linkedid']][_0x98d2('0x3c')];this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf['linkedid']][_0x98d2('0x36')]][_0x98d2('0x43')]=this['channels'][_0x4747bf['uniqueid']][_0x98d2('0x43')];this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]=this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]][_0x98d2('0x36')]];delete this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]][_0x98d2('0x36')]];}else if(this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf[_0x98d2('0x36')]]['uniqueid']]){this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]][_0x98d2('0x31')]][_0x98d2('0x31')]=[this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf['linkedid']][_0x98d2('0x31')]]['linkedid'],this['channels'][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]]['uniqueid']][_0x98d2('0x36')]=this['channels'][this['blindTransfers'][_0x4747bf['linkedid']][_0x98d2('0x31')]][_0x98d2('0x31')]][0x0];this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf['linkedid']]['uniqueid']]['answered']=this[_0x98d2('0x13')][_0x4747bf['uniqueid']][_0x98d2('0x60')];this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]][_0x98d2('0x31')]]['answertime']=this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x61')];this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf['linkedid']]['uniqueid']]['destinationchannel']=this[_0x98d2('0x13')][this[_0x98d2('0x15')][_0x4747bf['linkedid']][_0x98d2('0x31')]]['channel'];this['channels'][this[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x36')]]['uniqueid']][_0x98d2('0x43')]=this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]['disposition'];this['channels'][_0x4747bf['uniqueid']]=this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf[_0x98d2('0x36')]]['uniqueid']];delete this[_0x98d2('0x13')][this['blindTransfers'][_0x4747bf[_0x98d2('0x36')]]['uniqueid']];}}if(this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]){logger[_0x98d2('0x27')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x4747bf[_0x98d2('0x31')],_0x4747bf[_0x98d2('0x91')]);var _0x20f7f5=moment();this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]['endtime']=_0x20f7f5[_0x98d2('0x3d')](_0x98d2('0x58'));this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x55')]=_0x20f7f5['diff'](this['channels'][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x42')],_0x98d2('0x57'));if(this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x60')]){this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x92')]=_0x20f7f5[_0x98d2('0x62')](this[_0x98d2('0x13')][_0x4747bf['uniqueid']][_0x98d2('0x61')],_0x98d2('0x57'));this['channels'][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x67')]=this['channels'][_0x4747bf['uniqueid']][_0x98d2('0x55')]-this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x92')];}if(_0x4747bf['context']===_0x98d2('0x39')){if(this[_0x98d2('0x14')][_0x4747bf['channel']['split']('-')[0x0]]){this[_0x98d2('0x14')][_0x4747bf['channel'][_0x98d2('0x3a')]('-')[0x0]]=_[_0x98d2('0x93')](this['agents'][_0x4747bf[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]],['destconnectedlinenum']);logger[_0x98d2('0x34')](_0x98d2('0x94'),_0x4747bf[_0x98d2('0x31')],util[_0x98d2('0x2b')]({'id':this['agents'][_0x4747bf[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x98d2('0x14')][_0x4747bf['channel']['split']('-')[0x0]][_0x98d2('0x49')]},{'showHidden':![],'depth':null}));this[_0x98d2('0x2e')](util[_0x98d2('0x3d')](_0x98d2('0x4a'),this[_0x98d2('0x14')][_0x4747bf[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x4b')]),_0x98d2('0x95'),{'id':this[_0x98d2('0x14')][_0x4747bf[_0x98d2('0x3c')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x98d2('0x14')][_0x4747bf[_0x98d2('0x3c')][_0x98d2('0x3a')]('-')[0x0]][_0x98d2('0x49')]});for(var _0x78b048=0x0;_0x78b048<Object[_0x98d2('0x59')](this[_0x98d2('0x14')])[_0x98d2('0x96')];_0x78b048++){var _0x46f4df=Object[_0x98d2('0x59')](this[_0x98d2('0x14')])[_0x78b048];var _0x4f8c7a=this[_0x98d2('0x14')][_0x46f4df];if(_0x4f8c7a[_0x98d2('0x49')]===Number(_0x4747bf[_0x98d2('0x3f')])){this['emit'](util[_0x98d2('0x3d')](_0x98d2('0x4a'),_0x4f8c7a['name']),_0x98d2('0x95'),{'id':_0x4f8c7a['id'],'destaccountcode':_0x4f8c7a[_0x98d2('0x49')],'transfer':this[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x97')]});break;}}}}var _0x5b5c4b=this;Promise[_0x98d2('0x98')]()[_0x98d2('0x99')](function(){var _0x287abe=_0x5b5c4b[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]];if(typeof _0x287abe['transferType']===_0x98d2('0x9a'))return;if(_[_0x98d2('0x9b')](_0x287abe[_0x98d2('0x72')]))return;return RpcSetting['getSettings']()['then'](function(_0x35dbe2){if(!_0x35dbe2[_0x98d2('0x9c')])return;return Promise[_0x98d2('0x98')]()['then'](function(){return ami[_0x98d2('0x9d')]({'action':'StopMixMonitor','channel':_0x287abe[_0x98d2('0x3c')]})[_0x98d2('0x9e')](function(){});})['then'](function(){return ami[_0x98d2('0x9d')]({'action':'StopMixMonitor','channel':_0x287abe[_0x98d2('0x65')]})[_0x98d2('0x9e')](function(){})[_0x98d2('0x9f')](function(){var _0x22bd88=_0x5b5c4b[_0x98d2('0x14')][_0x287abe[_0x98d2('0x65')]['split']('-')[0x0]];if(!_0x22bd88)return;io['emit'](_0x98d2('0xa0'),{'agentId':_0x22bd88['id'],'uniqueid':_0x287abe[_0x98d2('0x31')]});});});});})[_0x98d2('0x99')](function(){if(_0x4747bf[_0x98d2('0xa1')]===_0x98d2('0xa2')){_0x5b5c4b[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x31')]]=_0x4747bf;}else{if(_0x5b5c4b[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0xa3')]===_0x98d2('0xa4')&&_0x5b5c4b[_0x98d2('0x15')][_0x4747bf[_0x98d2('0x31')]]){_0x5b5c4b[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]['uniqueid']=[_0x5b5c4b[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]]['linkedid'],_0x5b5c4b[_0x98d2('0x13')][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x36')]=_0x5b5c4b['channels'][_0x4747bf[_0x98d2('0x31')]][_0x98d2('0x31')]][0x0];delete _0x5b5c4b['blindTransfers'][_0x4747bf[_0x98d2('0x31')]];}}logger[_0x98d2('0x34')](_0x98d2('0xa5'),_0x4747bf[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x5b5c4b['channels'][_0x4747bf[_0x98d2('0x31')]],{'showHidden':![],'depth':null}));ami['emit'](_0x98d2('0xa6'),_0x5b5c4b[_0x98d2('0x13')][_0x4747bf['uniqueid']]);delete _0x5b5c4b[_0x98d2('0x13')][_0x4747bf['uniqueid']];});}}}catch(_0x319b8f){logger[_0x98d2('0x2a')](_0x98d2('0xa7'),_0x4747bf['uniqueid'],util['inspect'](_0x319b8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x21')]=function(_0x4ad4bd){try{if(this[_0x98d2('0x2f')](_0x4ad4bd)){logger[_0x98d2('0x27')](_0x98d2('0xa8'),_0x4ad4bd['uniqueid'],_0x4ad4bd[_0x98d2('0xa9')],_0x4ad4bd['transfertargetcalleridnum']);logger[_0x98d2('0x34')](_0x98d2('0xaa'),_0x4ad4bd[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x4ad4bd,{'showHidden':![],'depth':null}));var _0x2698e1;if(this['channels'][_0x4ad4bd[_0x98d2('0xab')]]){this['channels'][_0x4ad4bd['transfereeuniqueid']][_0x98d2('0xac')]=_0x4ad4bd['origtransferercalleridnum'];this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xab')]][_0x98d2('0xad')]=_0x4ad4bd[_0x98d2('0xae')];if(this['channels'][_0x4ad4bd[_0x98d2('0xaf')]]){_0x2698e1=this['channels'][_0x4ad4bd[_0x98d2('0xaf')]];this['channels'][_0x4ad4bd[_0x98d2('0xaf')]]=this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xab')]];this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xab')]]=_0x2698e1;}this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xaf')]][_0x98d2('0x97')]='ATTENDED';}else if(this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb0')]]){this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb0')]][_0x98d2('0xac')]=_0x4ad4bd[_0x98d2('0xa9')];this['channels'][_0x4ad4bd[_0x98d2('0xb0')]][_0x98d2('0xad')]=_0x4ad4bd['transfertargetcalleridnum'];if(this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb1')]]){_0x2698e1=this['channels'][_0x4ad4bd[_0x98d2('0xb1')]];this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb1')]]=this['channels'][_0x4ad4bd[_0x98d2('0xb0')]];this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb0')]]=_0x2698e1;}this['channels'][_0x4ad4bd[_0x98d2('0xb0')]][_0x98d2('0x97')]=_0x98d2('0xb2');}if((this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb1')]]||this['channels'][_0x4ad4bd[_0x98d2('0xb3')]])&&this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xaf')]]){var _0x47c71b=_[_0x98d2('0xb4')]([this['channels'][_0x4ad4bd[_0x98d2('0xb1')]],this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xb3')]],this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xaf')]]],function(_0x105f08){return _0x105f08&&_0x105f08[_0x98d2('0xa3')]===_0x98d2('0xa4')&&_0x105f08[_0x98d2('0xb5')];});if(_0x47c71b){if(this[_0x98d2('0x13')][_0x4ad4bd['origtransfereruniqueid']])this['channels'][_0x4ad4bd[_0x98d2('0xb1')]]['transferType']=_0x98d2('0xb2');if(this[_0x98d2('0x13')][_0x4ad4bd['origtransfererlinkedid']])this[_0x98d2('0x13')][_0x4ad4bd['origtransfererlinkedid']]['transferType']=_0x98d2('0xb2');this[_0x98d2('0x13')][_0x4ad4bd[_0x98d2('0xaf')]]['transferType']='ATTENDED';}}}}catch(_0x289635){logger[_0x98d2('0x2a')](_0x98d2('0xb6'),_0x4ad4bd[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x289635,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x23')]=function(_0x278f2a){try{if(this[_0x98d2('0x2f')](_0x278f2a)){logger[_0x98d2('0x27')](_0x98d2('0xb7'),_0x278f2a['uniqueid'],_0x278f2a['transfereecalleridnum'],_0x278f2a['extension']);logger[_0x98d2('0x34')](_0x98d2('0xb8'),_0x278f2a[_0x98d2('0x31')],util['inspect'](_0x278f2a,{'showHidden':![],'depth':null}));if(this[_0x98d2('0x13')][_0x278f2a[_0x98d2('0xab')]]){this['channels'][_0x278f2a['transfereeuniqueid']][_0x98d2('0xac')]=_0x278f2a[_0x98d2('0xb9')];this[_0x98d2('0x13')][_0x278f2a[_0x98d2('0xab')]][_0x98d2('0xad')]=_0x278f2a['extension'];this[_0x98d2('0x13')][_0x278f2a[_0x98d2('0xab')]][_0x98d2('0x97')]=_0x98d2('0xba');this[_0x98d2('0x1e')]({'event':_0x98d2('0xa2'),'uniqueid':_0x278f2a[_0x98d2('0xab')],'linkedid':_0x278f2a[_0x98d2('0xbb')],'context':_0x278f2a['context'],'channel':_0x278f2a[_0x98d2('0xbc')]});}else{this[_0x98d2('0x13')][_0x278f2a[_0x98d2('0xbb')]][_0x98d2('0x97')]=_0x98d2('0xba');this[_0x98d2('0x1e')]({'event':'BlindTransfer','uniqueid':_0x278f2a[_0x98d2('0xbb')],'linkedid':_0x278f2a[_0x98d2('0xab')],'context':_0x278f2a[_0x98d2('0x46')],'channel':_0x278f2a[_0x98d2('0xbc')]});}}}catch(_0x4007f3){logger[_0x98d2('0x2a')](_0x98d2('0xbd'),_0x278f2a[_0x98d2('0x31')],util['inspect'](_0x4007f3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x24')]=function(_0xdc76ff){try{if(this['isNotNull'](_0xdc76ff)){logger[_0x98d2('0x34')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0xdc76ff[_0x98d2('0x31')],util['inspect'](_0xdc76ff,{'showHidden':![],'depth':null}));if(this[_0x98d2('0x13')][_0xdc76ff[_0x98d2('0x31')]]){if(!_[_0x98d2('0x5d')](this[_0x98d2('0x13')][_0xdc76ff[_0x98d2('0x31')]][_0x98d2('0x61')])){this[_0x98d2('0x13')][_0xdc76ff[_0x98d2('0x31')]][_0x98d2('0xbe')]=moment()[_0x98d2('0x3d')](_0x98d2('0x58'));logger[_0x98d2('0x27')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0xdc76ff[_0x98d2('0x31')],this['channels'][_0xdc76ff[_0x98d2('0x31')]][_0x98d2('0xbe')]);}}}}catch(_0x32d045){logger[_0x98d2('0x2a')](_0x98d2('0xbf'),_0xdc76ff['uniqueid'],util['inspect'](_0x32d045,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x98d2('0x2c')][_0x98d2('0x26')]=function(_0x4e71fc){try{if(this[_0x98d2('0x2f')](_0x4e71fc)){logger[_0x98d2('0x34')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x4e71fc[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x4e71fc,{'showHidden':![],'depth':null}));if(this['channels'][_0x4e71fc[_0x98d2('0x31')]]){if(!_['isNil'](this[_0x98d2('0x13')][_0x4e71fc['uniqueid']][_0x98d2('0xbe')])){this[_0x98d2('0x13')][_0x4e71fc[_0x98d2('0x31')]]['mohtime']+=moment()[_0x98d2('0xc0')](0x0)[_0x98d2('0x62')](this[_0x98d2('0x13')][_0x4e71fc['uniqueid']][_0x98d2('0xbe')],'seconds');logger['info']('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x4e71fc[_0x98d2('0x31')],this[_0x98d2('0x13')][_0x4e71fc['uniqueid']][_0x98d2('0xc1')]);delete this[_0x98d2('0x13')][_0x4e71fc[_0x98d2('0x31')]]['mohstarttime'];}}}}catch(_0x1dbe7a){logger['error'](_0x98d2('0xc2'),_0x4e71fc[_0x98d2('0x31')],util[_0x98d2('0x2b')](_0x1dbe7a,{'showHidden':![],'depth':null}));}};module[_0x98d2('0xc3')]=VoiceCallReport;
\ No newline at end of file
index 2218835..d24749b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['lastevent','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','variable','value','outboundrouteid','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','variables','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','duration','diff','starttime','seconds','complete','total','endtime','sumHoldTime','holdtime','sumBillable','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','syncNewExten','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','prototype','isNotNull','emit','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','info','membername','interface','debug','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','[%s][voiceDialReport][dialbegin]','dialstatus','connectedlinenum','connectedlinename','answertime'];(function(_0x55b2ee,_0x26dc56){var _0x2af8b1=function(_0x3ab2e0){while(--_0x3ab2e0){_0x55b2ee['push'](_0x55b2ee['shift']());}};_0x2af8b1(++_0x26dc56);}(_0xa630,0xbe));var _0x0a63=function(_0x3e0c7b,_0x1efad1){_0x3e0c7b=_0x3e0c7b-0x0;var _0x5b1128=_0xa630[_0x3e0c7b];return _0x5b1128;};'use strict';var _=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x0a63('0x2'));var logger=require('../../../config/logger')(_0x0a63('0x3'));var ami=require('../ami');config[_0x0a63('0x4')]=_[_0x0a63('0x5')](config[_0x0a63('0x4')],{'host':_0x0a63('0x6'),'port':0x18eb});var io=require(_0x0a63('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x2760b0){this[_0x0a63('0x8')]=_0x2760b0[_0x0a63('0x9')];this[_0x0a63('0xa')]=_0x2760b0[_0x0a63('0xa')];this[_0x0a63('0xb')]={};this['variables']={};ami['on'](_0x0a63('0xc'),this[_0x0a63('0xd')][_0x0a63('0xe')](this));ami['on'](_0x0a63('0xf'),this[_0x0a63('0x10')][_0x0a63('0xe')](this));ami['on'](_0x0a63('0x11'),this[_0x0a63('0x12')][_0x0a63('0xe')](this));ami['on'](_0x0a63('0x13'),this['syncHangup'][_0x0a63('0xe')](this));}VoiceDialReport[_0x0a63('0x14')][_0x0a63('0x15')]=function(_0x3d6323){return _0x3d6323!==null&&!_['isUndefined'](_0x3d6323);};VoiceDialReport[_0x0a63('0x14')]['emit']=function(_0x331e99,_0x19e922,_0x26b2bc){io['to'](_0x331e99)[_0x0a63('0x16')](_0x19e922,_0x26b2bc);};VoiceDialReport[_0x0a63('0x14')][_0x0a63('0xd')]=function(_0x552b1f){try{if(this[_0x0a63('0x15')](_0x552b1f)){logger['debug'](_0x0a63('0x17'),_0x552b1f['uniqueid'],util[_0x0a63('0x18')](_0x552b1f,{'showHidden':![],'depth':null}));if(this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]]){_[_0x0a63('0x1a')](this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]],{'starttime':moment()[_0x0a63('0x1b')](_0x0a63('0x1c')),'lastevent':_0x0a63('0x1d'),'interface':_0x552b1f[_0x0a63('0x1e')][_0x0a63('0x1f')](0x0,_0x552b1f['channel']['lastIndexOf']('-')),'membername':_0x552b1f[_0x0a63('0x1e')]['substring'](_0x552b1f[_0x0a63('0x1e')]['lastIndexOf']('/')+0x1,_0x552b1f[_0x0a63('0x1e')][_0x0a63('0x20')]('-'))},_[_0x0a63('0x21')](_0x552b1f,[_0x0a63('0x22'),'privilege']));logger[_0x0a63('0x23')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x552b1f[_0x0a63('0x19')],this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]][_0x0a63('0x24')],this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]][_0x0a63('0x25')]);logger[_0x0a63('0x26')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x552b1f['uniqueid'],util['inspect'](this['channels'][_0x552b1f[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x552b1f['uniqueid']])_[_0x0a63('0x1a')](this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]],this[_0x0a63('0xb')][_0x552b1f['uniqueid']]);this[_0x0a63('0x16')](_0x0a63('0x27'),_0x0a63('0x28'),this['channels'][_0x552b1f[_0x0a63('0x19')]]);logger[_0x0a63('0x26')](_0x0a63('0x29'),_0x552b1f[_0x0a63('0x19')],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x552b1f[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));ami[_0x0a63('0x16')]('custom:dialbegin',this[_0x0a63('0x8')][_0x552b1f['uniqueid']]);}}}catch(_0x151cb6){logger[_0x0a63('0x2a')](_0x0a63('0x2b'),_0x552b1f[_0x0a63('0x19')],util[_0x0a63('0x18')](_0x151cb6,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x0a63('0x10')]=function(_0x2884f1){try{if(this[_0x0a63('0x15')](_0x2884f1)){logger[_0x0a63('0x26')]('[%s][voiceDialReport][dialend]\x20event:',_0x2884f1[_0x0a63('0x19')],util[_0x0a63('0x18')](_0x2884f1,{'showHidden':![],'depth':null}));if(this['channels'][_0x2884f1['uniqueid']]){this[_0x0a63('0x8')][_0x2884f1['uniqueid']]['dialstatus']=_0x2884f1[_0x0a63('0x2c')];if(_0x2884f1[_0x0a63('0x2c')]==='ANSWER'){this[_0x0a63('0x8')][_0x2884f1[_0x0a63('0x19')]][_0x0a63('0x2d')]=_0x2884f1[_0x0a63('0x2d')];this[_0x0a63('0x8')][_0x2884f1['uniqueid']]['connectedlinename']=_0x2884f1[_0x0a63('0x2e')];this[_0x0a63('0x8')][_0x2884f1[_0x0a63('0x19')]][_0x0a63('0x2f')]=moment()[_0x0a63('0x1b')](_0x0a63('0x1c'));this['channels'][_0x2884f1[_0x0a63('0x19')]][_0x0a63('0x30')]='connect';logger[_0x0a63('0x23')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x2884f1['uniqueid'],_0x2884f1[_0x0a63('0x1e')][_0x0a63('0x1f')](_0x2884f1[_0x0a63('0x1e')]['lastIndexOf']('/')+0x1,_0x2884f1[_0x0a63('0x1e')][_0x0a63('0x20')]('-')));logger[_0x0a63('0x26')](_0x0a63('0x31'),_0x2884f1[_0x0a63('0x19')],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x2884f1['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a63('0x16')](_0x0a63('0x32'),this[_0x0a63('0x8')][_0x2884f1['uniqueid']]);}logger['debug'](_0x0a63('0x33'),_0x2884f1['uniqueid'],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x2884f1[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));this['emit'](_0x0a63('0x27'),_0x0a63('0x28'),this[_0x0a63('0x8')][_0x2884f1[_0x0a63('0x19')]]);}}}catch(_0x5d94e2){logger[_0x0a63('0x2a')](_0x0a63('0x34'),_0x2884f1[_0x0a63('0x19')],util[_0x0a63('0x18')](_0x5d94e2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x0a63('0x14')][_0x0a63('0x12')]=function(_0x5d22b5){try{if(this[_0x0a63('0x15')](_0x5d22b5)){logger[_0x0a63('0x26')](_0x0a63('0x35'),_0x5d22b5[_0x0a63('0x19')],util[_0x0a63('0x18')](_0x5d22b5,{'showHidden':![],'depth':null}));this[_0x0a63('0x36')](_0x5d22b5[_0x0a63('0x19')],_[_0x0a63('0x37')](_0x5d22b5[_0x0a63('0x38')])[0x0],_0x5d22b5[_0x0a63('0x39')]);if(this[_0x0a63('0x15')](_0x5d22b5[_0x0a63('0x38')])&&this[_0x0a63('0x15')](_0x5d22b5[_0x0a63('0x38')][_0x0a63('0x3a')])){if(_[_0x0a63('0x3b')](this[_0x0a63('0x8')][_0x5d22b5[_0x0a63('0x19')]])){this['channels'][_0x5d22b5[_0x0a63('0x19')]]={'routeId':_0x5d22b5['value'],'variables':this['variables'][_0x5d22b5[_0x0a63('0x19')]],'motionChannel':_0x0a63('0x3c')};logger[_0x0a63('0x23')](_0x0a63('0x3d'),_0x5d22b5[_0x0a63('0x19')],_0x5d22b5[_0x0a63('0x38')][_0x0a63('0x3a')],_[_0x0a63('0x37')](_0x5d22b5[_0x0a63('0x38')])[0x0],_0x5d22b5[_0x0a63('0x39')]);logger[_0x0a63('0x26')](_0x0a63('0x3e'),_0x5d22b5[_0x0a63('0x19')],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x5d22b5[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));this[_0x0a63('0x16')](_0x0a63('0x27'),_0x0a63('0x28'),this[_0x0a63('0x8')][_0x5d22b5['uniqueid']]);}}}}catch(_0x26bb2d){logger[_0x0a63('0x2a')]('[%s][voiceDialReport][varset]',_0x5d22b5['uniqueid'],util['inspect'](_0x26bb2d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x0a63('0x36')]=function(_0x85fcf,_0x5d9ffc,_0x1abf0b){var _0x59c367=[_0x0a63('0x3f'),_0x0a63('0x40'),'rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss',_0x0a63('0x41'),_0x0a63('0x42'),_0x0a63('0x43'),_0x0a63('0x44'),_0x0a63('0x45'),'bridgepeer',_0x0a63('0x46'),_0x0a63('0x47'),_0x0a63('0x48'),_0x0a63('0x49'),_0x0a63('0x4a'),'membername',_0x0a63('0x4b'),_0x0a63('0x4c')];if(!_[_0x0a63('0x4d')](_0x5d9ffc)&&!_[_0x0a63('0x4e')](_0x59c367,_0x5d9ffc)){if(_['isUndefined'](this[_0x0a63('0x4f')][_0x85fcf])){this[_0x0a63('0x4f')][_0x85fcf]={};}this[_0x0a63('0x4f')][_0x85fcf][_0x5d9ffc]=_0x1abf0b;}};VoiceDialReport[_0x0a63('0x14')][_0x0a63('0x50')]=function(_0x258ed3){try{if(this['isNotNull'](_0x258ed3)){logger[_0x0a63('0x26')](_0x0a63('0x51'),_0x258ed3[_0x0a63('0x19')],util[_0x0a63('0x18')](_0x258ed3,{'showHidden':![],'depth':null}));if(this['channels'][_0x258ed3['uniqueid']]){logger[_0x0a63('0x23')](_0x0a63('0x52'),_0x258ed3[_0x0a63('0x19')],_0x258ed3[_0x0a63('0x53')]);this[_0x0a63('0x8')][_0x258ed3['uniqueid']]['endtime']=moment()['format'](_0x0a63('0x1c'));this['channels'][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x54')]=moment(this[_0x0a63('0x8')][_0x258ed3['uniqueid']]['endtime'])[_0x0a63('0x55')](this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x56')],_0x0a63('0x57'));this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x30')]=_0x0a63('0x58');this[_0x0a63('0xa')][_0x0a63('0x59')]+=0x1;if(this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x2f')]){this['outbound']['answered']+=0x1;this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]]['holdtime']=moment(this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]]['answertime'])[_0x0a63('0x55')](this[_0x0a63('0x8')][_0x258ed3['uniqueid']]['starttime'],_0x0a63('0x57'));this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]]['billableseconds']=moment(this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x5a')])[_0x0a63('0x55')](this[_0x0a63('0x8')][_0x258ed3['uniqueid']][_0x0a63('0x2f')],_0x0a63('0x57'));this[_0x0a63('0xa')][_0x0a63('0x5b')]+=this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x5c')]||0x0;this['outbound'][_0x0a63('0x5d')]+=this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]][_0x0a63('0x5e')];}this[_0x0a63('0xa')][_0x0a63('0x5f')]+=this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]]['duration'];logger['debug'](_0x0a63('0x60'),_0x258ed3[_0x0a63('0x19')],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a63('0x61'),this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]]);logger[_0x0a63('0x26')](_0x0a63('0x62'),_0x258ed3[_0x0a63('0x19')],util[_0x0a63('0x18')](this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));ami[_0x0a63('0x16')](_0x0a63('0x63'),this['channels'][_0x258ed3[_0x0a63('0x19')]]);logger['debug'](_0x0a63('0x64'),_0x258ed3[_0x0a63('0x19')],util['inspect'](this['channels'][_0x258ed3['uniqueid']],{'showHidden':![],'depth':null}));this[_0x0a63('0x16')](_0x0a63('0x27'),_0x0a63('0x65'),this[_0x0a63('0xa')]);logger[_0x0a63('0x23')](_0x0a63('0x66'),JSON['stringify'](this['channels'][_0x258ed3['uniqueid']]));logger[_0x0a63('0x26')](_0x0a63('0x67'),_0x258ed3[_0x0a63('0x19')],util[_0x0a63('0x18')](this['channels'][_0x258ed3[_0x0a63('0x19')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x0a63('0x68'),this['channels'][_0x258ed3[_0x0a63('0x19')]]);delete this[_0x0a63('0x8')][_0x258ed3['uniqueid']];}else if(this[_0x0a63('0x8')][_0x258ed3['linkedid']]){this[_0x0a63('0x8')][_0x258ed3['linkedid']][_0x0a63('0x19')]=this[_0x0a63('0x8')][_0x258ed3[_0x0a63('0x69')]]['destuniqueid'];}if(this[_0x0a63('0x4f')][_0x258ed3[_0x0a63('0x19')]]){delete this[_0x0a63('0x4f')][_0x258ed3[_0x0a63('0x19')]];}}}catch(_0x471cd7){logger['error']('[%s][voiceDialReport][hangup]',_0x258ed3['uniqueid'],util[_0x0a63('0x18')](_0x471cd7,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x0a63('0x6a')]=function(_0xa27da4){try{if(this[_0x0a63('0x15')](_0xa27da4)){logger[_0x0a63('0x26')]('[%s][voiceDialReport][newexten]\x20event:',_0xa27da4[_0x0a63('0x19')],util[_0x0a63('0x18')](_0xa27da4,{'showHidden':![],'depth':null}));if(_0xa27da4['application'][_0x0a63('0x6b')]()===_0x0a63('0x6c')){_0xa27da4[_0x0a63('0x6d')]=(_0xa27da4[_0x0a63('0x6e')]||_0xa27da4[_0x0a63('0x6d')])['toLowerCase']();if(_[_0x0a63('0x6f')](_0xa27da4[_0x0a63('0x6d')],_0x0a63('0x70'))){if(_['isUndefined'](this['applications'][_0xa27da4['uniqueid']]))this[_0x0a63('0xb')][_0xa27da4[_0x0a63('0x19')]]={};logger[_0x0a63('0x23')](_0x0a63('0x71'),_0xa27da4[_0x0a63('0x19')],_0xa27da4[_0x0a63('0x72')],_0xa27da4[_0x0a63('0x6d')]);var _0x37255d=_0xa27da4[_0x0a63('0x6d')][_0x0a63('0x73')]('=');var _0x5c6e18=_0x37255d[0x0][_0x0a63('0x74')](/cdr\((.*)\)/);if(_0x5c6e18)this[_0x0a63('0xb')][_0xa27da4[_0x0a63('0x19')]][_0x5c6e18[0x1]]=_0x37255d[0x1];}}}}catch(_0x229954){logger[_0x0a63('0x2a')](_0x0a63('0x75'),_0xa27da4['uniqueid'],util['inspect'](_0x229954,{'showHidden':![],'depth':null}));}};module[_0x0a63('0x76')]=VoiceDialReport;
\ No newline at end of file
+var _0xda19=['called','channel','substring','lastIndexOf','omit','event','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','applications','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','YYYY-MM-DD\x20HH:mm:ss','lastevent','info','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','variables','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','total','answered','holdtime','billableseconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','appdata','applicationdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','exports','moment','util','../../../config/environment','ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','isNotNull','isUndefined','prototype','emit','syncDialBegin','debug','[%s][voiceDialReport][dialbegin]\x20event:','inspect','uniqueid','merge'];(function(_0x1fc5bb,_0x966c15){var _0x531fda=function(_0x34e933){while(--_0x34e933){_0x1fc5bb['push'](_0x1fc5bb['shift']());}};_0x531fda(++_0x966c15);}(_0xda19,0xd5));var _0x9da1=function(_0x2f7165,_0x55c484){_0x2f7165=_0x2f7165-0x0;var _0x1ea372=_0xda19[_0x2f7165];return _0x1ea372;};'use strict';var _=require('lodash');var moment=require(_0x9da1('0x0'));var util=require(_0x9da1('0x1'));var Redis=require('ioredis');var config=require(_0x9da1('0x2'));var logger=require('../../../config/logger')(_0x9da1('0x3'));var ami=require('../ami');config[_0x9da1('0x4')]=_[_0x9da1('0x5')](config[_0x9da1('0x4')],{'host':_0x9da1('0x6'),'port':0x18eb});var io=require(_0x9da1('0x7'))(new Redis(config[_0x9da1('0x4')]));function VoiceDialReport(_0x23e4f7){this[_0x9da1('0x8')]=_0x23e4f7[_0x9da1('0x9')];this[_0x9da1('0xa')]=_0x23e4f7['outbound'];this['applications']={};this['variables']={};ami['on'](_0x9da1('0xb'),this['syncDialBegin'][_0x9da1('0xc')](this));ami['on'](_0x9da1('0xd'),this[_0x9da1('0xe')][_0x9da1('0xc')](this));ami['on'](_0x9da1('0xf'),this[_0x9da1('0x10')][_0x9da1('0xc')](this));ami['on']('hangup',this['syncHangup'][_0x9da1('0xc')](this));}VoiceDialReport['prototype'][_0x9da1('0x11')]=function(_0x1d93f8){return _0x1d93f8!==null&&!_[_0x9da1('0x12')](_0x1d93f8);};VoiceDialReport[_0x9da1('0x13')]['emit']=function(_0x2837e3,_0x535a13,_0x4d17e1){io['to'](_0x2837e3)[_0x9da1('0x14')](_0x535a13,_0x4d17e1);};VoiceDialReport['prototype'][_0x9da1('0x15')]=function(_0x43c093){try{if(this[_0x9da1('0x11')](_0x43c093)){logger[_0x9da1('0x16')](_0x9da1('0x17'),_0x43c093['uniqueid'],util[_0x9da1('0x18')](_0x43c093,{'showHidden':![],'depth':null}));if(this[_0x9da1('0x8')][_0x43c093[_0x9da1('0x19')]]){_[_0x9da1('0x1a')](this[_0x9da1('0x8')][_0x43c093[_0x9da1('0x19')]],{'starttime':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x9da1('0x1b'),'interface':_0x43c093[_0x9da1('0x1c')][_0x9da1('0x1d')](0x0,_0x43c093[_0x9da1('0x1c')][_0x9da1('0x1e')]('-')),'membername':_0x43c093[_0x9da1('0x1c')][_0x9da1('0x1d')](_0x43c093['channel'][_0x9da1('0x1e')]('/')+0x1,_0x43c093[_0x9da1('0x1c')][_0x9da1('0x1e')]('-'))},_[_0x9da1('0x1f')](_0x43c093,[_0x9da1('0x20'),'privilege']));logger['info'](_0x9da1('0x21'),_0x43c093[_0x9da1('0x19')],this[_0x9da1('0x8')][_0x43c093[_0x9da1('0x19')]][_0x9da1('0x22')],this[_0x9da1('0x8')][_0x43c093['uniqueid']][_0x9da1('0x23')]);logger[_0x9da1('0x16')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x43c093[_0x9da1('0x19')],util[_0x9da1('0x18')](this['channels'][_0x43c093[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));if(this[_0x9da1('0x24')][_0x43c093['uniqueid']])_[_0x9da1('0x1a')](this[_0x9da1('0x8')][_0x43c093['uniqueid']],this['applications'][_0x43c093[_0x9da1('0x19')]]);this[_0x9da1('0x14')]('voice:outbound',_0x9da1('0x25'),this['channels'][_0x43c093['uniqueid']]);logger['debug'](_0x9da1('0x26'),_0x43c093[_0x9da1('0x19')],util[_0x9da1('0x18')](this[_0x9da1('0x8')][_0x43c093[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9da1('0x27'),this['channels'][_0x43c093[_0x9da1('0x19')]]);}}}catch(_0x235ced){logger['error'](_0x9da1('0x28'),_0x43c093[_0x9da1('0x19')],util['inspect'](_0x235ced,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9da1('0x13')][_0x9da1('0xe')]=function(_0x1802e0){try{if(this[_0x9da1('0x11')](_0x1802e0)){logger['debug']('[%s][voiceDialReport][dialend]\x20event:',_0x1802e0[_0x9da1('0x19')],util[_0x9da1('0x18')](_0x1802e0,{'showHidden':![],'depth':null}));if(this[_0x9da1('0x8')][_0x1802e0[_0x9da1('0x19')]]){this[_0x9da1('0x8')][_0x1802e0['uniqueid']][_0x9da1('0x29')]=_0x1802e0[_0x9da1('0x29')];if(_0x1802e0[_0x9da1('0x29')]===_0x9da1('0x2a')){this[_0x9da1('0x8')][_0x1802e0[_0x9da1('0x19')]]['connectedlinenum']=_0x1802e0[_0x9da1('0x2b')];this['channels'][_0x1802e0['uniqueid']][_0x9da1('0x2c')]=_0x1802e0['connectedlinename'];this[_0x9da1('0x8')][_0x1802e0[_0x9da1('0x19')]][_0x9da1('0x2d')]=moment()[_0x9da1('0x2e')](_0x9da1('0x2f'));this[_0x9da1('0x8')][_0x1802e0[_0x9da1('0x19')]][_0x9da1('0x30')]='connect';logger[_0x9da1('0x31')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x1802e0[_0x9da1('0x19')],_0x1802e0['channel']['substring'](_0x1802e0[_0x9da1('0x1c')]['lastIndexOf']('/')+0x1,_0x1802e0[_0x9da1('0x1c')][_0x9da1('0x1e')]('-')));logger['debug'](_0x9da1('0x32'),_0x1802e0[_0x9da1('0x19')],util[_0x9da1('0x18')](this[_0x9da1('0x8')][_0x1802e0['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x9da1('0x14')]('custom:dialconnect',this[_0x9da1('0x8')][_0x1802e0['uniqueid']]);}logger[_0x9da1('0x16')](_0x9da1('0x33'),_0x1802e0['uniqueid'],util[_0x9da1('0x18')](this[_0x9da1('0x8')][_0x1802e0[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound_channel:save',this[_0x9da1('0x8')][_0x1802e0['uniqueid']]);}}}catch(_0x5b215c){logger[_0x9da1('0x34')](_0x9da1('0x35'),_0x1802e0[_0x9da1('0x19')],util['inspect'](_0x5b215c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9da1('0x13')][_0x9da1('0x10')]=function(_0x25851b){try{if(this[_0x9da1('0x11')](_0x25851b)){logger[_0x9da1('0x16')](_0x9da1('0x36'),_0x25851b[_0x9da1('0x19')],util['inspect'](_0x25851b,{'showHidden':![],'depth':null}));this[_0x9da1('0x37')](_0x25851b['uniqueid'],_[_0x9da1('0x38')](_0x25851b['variable'])[0x0],_0x25851b[_0x9da1('0x39')]);if(this[_0x9da1('0x11')](_0x25851b['variable'])&&this[_0x9da1('0x11')](_0x25851b[_0x9da1('0x3a')]['outboundrouteid'])){if(_[_0x9da1('0x12')](this['channels'][_0x25851b[_0x9da1('0x19')]])){this[_0x9da1('0x8')][_0x25851b['uniqueid']]={'routeId':_0x25851b['value'],'variables':this[_0x9da1('0x3b')][_0x25851b[_0x9da1('0x19')]],'motionChannel':_0x9da1('0x3c')};logger[_0x9da1('0x31')](_0x9da1('0x3d'),_0x25851b[_0x9da1('0x19')],_0x25851b[_0x9da1('0x3a')][_0x9da1('0x3e')],_['keys'](_0x25851b[_0x9da1('0x3a')])[0x0],_0x25851b[_0x9da1('0x39')]);logger[_0x9da1('0x16')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x25851b[_0x9da1('0x19')],util[_0x9da1('0x18')](this[_0x9da1('0x8')][_0x25851b['uniqueid']],{'showHidden':![],'depth':null}));this[_0x9da1('0x14')](_0x9da1('0x3f'),_0x9da1('0x25'),this['channels'][_0x25851b[_0x9da1('0x19')]]);}}}}catch(_0x4d3909){logger['error'](_0x9da1('0x40'),_0x25851b[_0x9da1('0x19')],util['inspect'](_0x4d3909,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9da1('0x13')][_0x9da1('0x37')]=function(_0x47d685,_0x31a2b6,_0x36f2e2){var _0x1984f7=[_0x9da1('0x41'),_0x9da1('0x42'),_0x9da1('0x43'),_0x9da1('0x44'),_0x9da1('0x45'),_0x9da1('0x46'),'rtpaudioqosrtt',_0x9da1('0x47'),_0x9da1('0x48'),_0x9da1('0x49'),_0x9da1('0x4a'),'bridgepvtcallid','membercalls',_0x9da1('0x4b'),_0x9da1('0x4c'),_0x9da1('0x4d'),_0x9da1('0x22'),_0x9da1('0x4e'),_0x9da1('0x4f')];if(!_[_0x9da1('0x50')](_0x31a2b6)&&!_[_0x9da1('0x51')](_0x1984f7,_0x31a2b6)){if(_[_0x9da1('0x12')](this[_0x9da1('0x3b')][_0x47d685])){this[_0x9da1('0x3b')][_0x47d685]={};}this[_0x9da1('0x3b')][_0x47d685][_0x31a2b6]=_0x36f2e2;}};VoiceDialReport[_0x9da1('0x13')][_0x9da1('0x52')]=function(_0x4c99e8){try{if(this[_0x9da1('0x11')](_0x4c99e8)){logger[_0x9da1('0x16')]('[%s][voiceDialReport][hangup]\x20event:',_0x4c99e8[_0x9da1('0x19')],util['inspect'](_0x4c99e8,{'showHidden':![],'depth':null}));if(this[_0x9da1('0x8')][_0x4c99e8['uniqueid']]){logger[_0x9da1('0x31')](_0x9da1('0x53'),_0x4c99e8[_0x9da1('0x19')],_0x4c99e8[_0x9da1('0x54')]);this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x55')]=moment()[_0x9da1('0x2e')](_0x9da1('0x2f'));this[_0x9da1('0x8')][_0x4c99e8['uniqueid']][_0x9da1('0x56')]=moment(this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x55')])[_0x9da1('0x57')](this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x58')],_0x9da1('0x59'));this[_0x9da1('0x8')][_0x4c99e8['uniqueid']][_0x9da1('0x30')]=_0x9da1('0x5a');this['outbound'][_0x9da1('0x5b')]+=0x1;if(this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x2d')]){this[_0x9da1('0xa')][_0x9da1('0x5c')]+=0x1;this[_0x9da1('0x8')][_0x4c99e8['uniqueid']][_0x9da1('0x5d')]=moment(this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x2d')])['diff'](this[_0x9da1('0x8')][_0x4c99e8['uniqueid']][_0x9da1('0x58')],_0x9da1('0x59'));this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x5e')]=moment(this[_0x9da1('0x8')][_0x4c99e8['uniqueid']]['endtime'])[_0x9da1('0x57')](this['channels'][_0x4c99e8['uniqueid']]['answertime'],_0x9da1('0x59'));this['outbound'][_0x9da1('0x5f')]+=this['channels'][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x5d')]||0x0;this['outbound'][_0x9da1('0x60')]+=this[_0x9da1('0x8')][_0x4c99e8['uniqueid']][_0x9da1('0x5e')];}this[_0x9da1('0xa')]['sumDuration']+=this['channels'][_0x4c99e8[_0x9da1('0x19')]][_0x9da1('0x56')];logger[_0x9da1('0x16')](_0x9da1('0x61'),_0x4c99e8[_0x9da1('0x19')],util[_0x9da1('0x18')](this['channels'][_0x4c99e8[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]]);logger[_0x9da1('0x16')](_0x9da1('0x62'),_0x4c99e8[_0x9da1('0x19')],util[_0x9da1('0x18')](this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));ami[_0x9da1('0x14')]('custom:dialend',this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]]);logger[_0x9da1('0x16')](_0x9da1('0x63'),_0x4c99e8[_0x9da1('0x19')],util['inspect'](this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]],{'showHidden':![],'depth':null}));this[_0x9da1('0x14')](_0x9da1('0x3f'),_0x9da1('0x64'),this[_0x9da1('0xa')]);logger['info'](_0x9da1('0x65'),JSON['stringify'](this[_0x9da1('0x8')][_0x4c99e8['uniqueid']]));logger[_0x9da1('0x16')](_0x9da1('0x66'),_0x4c99e8[_0x9da1('0x19')],util[_0x9da1('0x18')](this['channels'][_0x4c99e8['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0x9da1('0x3f'),_0x9da1('0x67'),this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x19')]]);delete this['channels'][_0x4c99e8['uniqueid']];}else if(this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x68')]]){this[_0x9da1('0x8')][_0x4c99e8['linkedid']]['uniqueid']=this[_0x9da1('0x8')][_0x4c99e8[_0x9da1('0x68')]][_0x9da1('0x69')];}if(this['variables'][_0x4c99e8['uniqueid']]){delete this[_0x9da1('0x3b')][_0x4c99e8[_0x9da1('0x19')]];}}}catch(_0x27c9a0){logger[_0x9da1('0x34')](_0x9da1('0x6a'),_0x4c99e8['uniqueid'],util[_0x9da1('0x18')](_0x27c9a0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x9da1('0x13')][_0x9da1('0x6b')]=function(_0x1f0369){try{if(this['isNotNull'](_0x1f0369)){logger[_0x9da1('0x16')](_0x9da1('0x6c'),_0x1f0369[_0x9da1('0x19')],util['inspect'](_0x1f0369,{'showHidden':![],'depth':null}));if(_0x1f0369[_0x9da1('0x6d')][_0x9da1('0x6e')]()===_0x9da1('0x6f')){_0x1f0369['applicationdata']=(_0x1f0369[_0x9da1('0x70')]||_0x1f0369[_0x9da1('0x71')])['toLowerCase']();if(_[_0x9da1('0x72')](_0x1f0369['applicationdata'],_0x9da1('0x73'))){if(_['isUndefined'](this[_0x9da1('0x24')][_0x1f0369[_0x9da1('0x19')]]))this[_0x9da1('0x24')][_0x1f0369[_0x9da1('0x19')]]={};logger[_0x9da1('0x31')](_0x9da1('0x74'),_0x1f0369[_0x9da1('0x19')],_0x1f0369[_0x9da1('0x6d')],_0x1f0369[_0x9da1('0x71')]);var _0x457b45=_0x1f0369[_0x9da1('0x71')][_0x9da1('0x75')]('=');var _0x21119f=_0x457b45[0x0]['match'](/cdr\((.*)\)/);if(_0x21119f)this[_0x9da1('0x24')][_0x1f0369[_0x9da1('0x19')]][_0x21119f[0x1]]=_0x457b45[0x1];}}}}catch(_0x27cec6){logger[_0x9da1('0x34')](_0x9da1('0x76'),_0x1f0369['uniqueid'],util[_0x9da1('0x18')](_0x27cec6,{'showHidden':![],'depth':null}));}};module[_0x9da1('0x77')]=VoiceDialReport;
\ No newline at end of file
index 60dd911..e643572 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5ff=['syncAttendedTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','clearZombieChannels','switch','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','name','strategy','available','loggedIn','sumDuration','sumHoldTime','total','unmanaged','waiting','Trunk','callerid','Interval','[voiceQueueReport][','voice_queue:save','isUndefined','Action','queues','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','custom:queuesummary','flagQueueSummary','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','isNil','includes','length','abandoned','diff','milliseconds','sumBillable','lastevent','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transfertype','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transferid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','mohstarttime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','split','[%s][voiceQueueReport][newexten]','exports','lodash','util','md5','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','agentcomplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop'];(function(_0x4840ae,_0x3c9473){var _0x38fe37=function(_0x4382aa){while(--_0x4382aa){_0x4840ae['push'](_0x4840ae['shift']());}};_0x38fe37(++_0x3c9473);}(_0xe5ff,0xc9));var _0xfe5f=function(_0x236a8d,_0x2e9b1d){_0x236a8d=_0x236a8d-0x0;var _0x212efe=_0xe5ff[_0x236a8d];return _0x212efe;};'use strict';var _=require(_0xfe5f('0x0'));var moment=require('moment');var util=require(_0xfe5f('0x1'));var md5=require(_0xfe5f('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xfe5f('0x3'))(_0xfe5f('0x4'));var ami=require(_0xfe5f('0x5'));var QueueReport=require('../model/queueReport');config[_0xfe5f('0x6')]=_[_0xfe5f('0x7')](config[_0xfe5f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xfe5f('0x8'))(new Redis(config[_0xfe5f('0x6')]));var Sequence=function(){};Sequence[_0xfe5f('0x9')][_0xfe5f('0xa')]=function(_0x48da4f){this[_0xfe5f('0xb')]=this['tail']?this[_0xfe5f('0xb')][_0xfe5f('0xc')](_0x48da4f):_0x48da4f();};function VoiceQueueReport(_0x55d740){this[_0xfe5f('0xd')]=new Sequence();this[_0xfe5f('0xe')]={};this['agents']=_0x55d740['agents'];this[_0xfe5f('0xf')]=_0x55d740['queueChannels'];this[_0xfe5f('0x10')]=_0x55d740[_0xfe5f('0x10')];this['flagQueueSummary']=!![];this[_0xfe5f('0x11')]=_0x55d740[_0xfe5f('0x11')];this[_0xfe5f('0x12')]={};ami['on'](_0xfe5f('0x13'),this[_0xfe5f('0x14')][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x16'),this[_0xfe5f('0x17')][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x18'),this[_0xfe5f('0x19')][_0xfe5f('0x15')](this));ami['on']('queuecallerabandon',this[_0xfe5f('0x1a')][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x1b'),this['syncQueueCallerLeave'][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x1c'),this['syncAgentComplete'][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x1d'),this[_0xfe5f('0x1e')]['bind'](this));ami['on'](_0xfe5f('0x1f'),this['syncVarSet'][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x20'),this[_0xfe5f('0x21')]['bind'](this));ami['on'](_0xfe5f('0x22'),this['syncFullyBooted']['bind'](this));ami['on'](_0xfe5f('0x23'),this[_0xfe5f('0x24')][_0xfe5f('0x15')](this));ami['on'](_0xfe5f('0x25'),this['syncMusicOnHoldStop'][_0xfe5f('0x15')](this));ami['on']('attendedtransfer',this[_0xfe5f('0x26')][_0xfe5f('0x15')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xfe5f('0x15')](this));this['loopQueueSummary']();this[_0xfe5f('0x27')]();}function clearChannels(_0xd3abc7){if(!_[_0xfe5f('0x28')](_0xd3abc7)){for(var _0x590a2f in _0xd3abc7){if(_0xd3abc7[_0xfe5f('0x29')](_0x590a2f)){delete _0xd3abc7[_0x590a2f];}}}}function clearCampaigns(_0x274c78){if(!_[_0xfe5f('0x28')](_0x274c78)){for(var _0x5de82d in _0x274c78){if(_0x274c78[_0xfe5f('0x29')](_0x5de82d)){_0x274c78[_0x5de82d][_0xfe5f('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x5b6dfe){if(!_['isEmpty'](_0x5b6dfe)){for(var _0x3ec7d3 in _0x5b6dfe){if(_0x5b6dfe[_0xfe5f('0x29')](_0x3ec7d3)){_0x5b6dfe[_0x3ec7d3][_0xfe5f('0x2a')]=0x0;_0x5b6dfe[_0x3ec7d3][_0xfe5f('0x2b')]=0x0;_0x5b6dfe[_0x3ec7d3][_0xfe5f('0x2c')]=0x0;_0x5b6dfe[_0x3ec7d3]['waiting']=0x0;_0x5b6dfe[_0x3ec7d3][_0xfe5f('0x2d')]=!![];}}}}function clearAgentBooked(_0x5d39a0){if(!_[_0xfe5f('0x28')](_0x5d39a0)){for(var _0x49e819 in _0x5d39a0){if(_0x5d39a0['hasOwnProperty'](_0x49e819)){_0x5d39a0[_0x49e819]['unlockRR']=!![];}}}}VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x2e')]=function(){var _0x9aa7c7=this;for(var _0x17b592 in this[_0xfe5f('0xf')]){if(this['channels']['hasOwnProperty'](_0x17b592)&&!this[_0xfe5f('0xf')][_0x17b592][_0xfe5f('0x2f')]){this[_0xfe5f('0xd')][_0xfe5f('0xa')](function(){if(!_['isNil'](_0x9aa7c7[_0xfe5f('0xf')][_0x17b592])){return ami['Action']({'action':'status','channel':_0x9aa7c7[_0xfe5f('0xf')][_0x17b592][_0xfe5f('0x30')]})[_0xfe5f('0x31')](function(_0x4682ca){if(_0x4682ca[_0xfe5f('0x32')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x9aa7c7[_0xfe5f('0xf')][_0x17b592]){delete _0x9aa7c7['channels'][_0x17b592];logger[_0xfe5f('0x33')](_0xfe5f('0x34'),_0x17b592,util[_0xfe5f('0x35')](_0x4682ca,{'showHidden':![],'depth':null}));}if(_0x9aa7c7[_0xfe5f('0xe')][_0x17b592]){delete _0x9aa7c7[_0xfe5f('0xe')][_0x17b592];logger[_0xfe5f('0x33')](_0xfe5f('0x36'),_0x17b592,util[_0xfe5f('0x35')](_0x4682ca,{'showHidden':![],'depth':null}));}if(_0x9aa7c7[_0xfe5f('0x12')][_0x17b592]){delete _0x9aa7c7[_0xfe5f('0x12')][_0x17b592];logger['error'](_0xfe5f('0x37'),_0x17b592,util[_0xfe5f('0x35')](_0x4682ca,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x38')]=function(){logger[_0xfe5f('0x33')](_0xfe5f('0x39'));clearChannels(this['channels']);this['clearQueueReport'](this[_0xfe5f('0xe')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xfe5f('0x10')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x3a')]=function(_0x1d61c1){var _0x7b5667=this;if(!_[_0xfe5f('0x28')](_0x1d61c1)){for(var _0x3e720a in _0x1d61c1){if(_0x1d61c1['hasOwnProperty'](_0x3e720a)){_0x7b5667[_0xfe5f('0x3b')](_0x1d61c1[_0x3e720a],_0xfe5f('0x3c'));delete _0x1d61c1[_0x3e720a];}}}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x3d')]=function(_0x44f5bb,_0x535040,_0x1c3779){io['to'](_0x44f5bb)['emit'](_0x535040,_0x1c3779);};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x3e')]=function(_0x2180b6,_0x934b46){logger[_0xfe5f('0x3f')](_0xfe5f('0x40')+_0x934b46+_0xfe5f('0x41'),_0x2180b6[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x2180b6,{'showHidden':![],'depth':null}));this[_0xfe5f('0x3d')](util[_0xfe5f('0x43')](_0xfe5f('0x44'),_0x2180b6['name']),_0xfe5f('0x45'),_0x2180b6);io['emit']('voice_queue_presence:save',_0x2180b6);};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x3b')]=function(_0x1fa22d,_0x26c9d9){logger[_0xfe5f('0x3f')](_0xfe5f('0x40')+_0x26c9d9+_0xfe5f('0x46'),_0x1fa22d[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x1fa22d,{'showHidden':![],'depth':null}));if(_0x1fa22d[_0xfe5f('0x47')]===_0xfe5f('0x48'))return;this[_0xfe5f('0x3d')](util[_0xfe5f('0x43')](_0xfe5f('0x44'),_0x1fa22d['name']),_0xfe5f('0x49'),_0x1fa22d);io[_0xfe5f('0x3d')](_0xfe5f('0x4a'),_0x1fa22d);};VoiceQueueReport['prototype'][_0xfe5f('0x4b')]=function(_0x3ba51d,_0x3356f2){if(_0x3ba51d[_0xfe5f('0x4c')]===_0xfe5f('0x4d')){var _0x1812e8={'id':_0x3ba51d['id'],'name':_0x3ba51d[_0xfe5f('0x4e')],'strategy':_0x3ba51d[_0xfe5f('0x4f')],'answered':_0x3ba51d['answered'],'available':_0x3ba51d[_0xfe5f('0x50')],'loggedIn':_0x3ba51d[_0xfe5f('0x51')],'pTalking':_0x3ba51d['pTalking'],'sumBillable':_0x3ba51d['sumBillable'],'sumDuration':_0x3ba51d[_0xfe5f('0x52')],'sumHoldTime':_0x3ba51d[_0xfe5f('0x53')]||0x0,'talking':_0x3ba51d[_0xfe5f('0x2b')],'total':_0x3ba51d[_0xfe5f('0x54')],'type':_0x3ba51d[_0xfe5f('0x4c')],'unmanaged':_0x3ba51d[_0xfe5f('0x55')],'abandoned':_0x3ba51d['abandoned'],'waiting':_0x3ba51d[_0xfe5f('0x56')]};if(_0x3ba51d[_0xfe5f('0x57')]){_0x1812e8['Trunk']={'id':_0x3ba51d[_0xfe5f('0x57')]['id'],'name':_0x3ba51d[_0xfe5f('0x57')][_0xfe5f('0x4e')],'active':_0x3ba51d[_0xfe5f('0x57')]['active'],'callerid':_0x3ba51d[_0xfe5f('0x57')][_0xfe5f('0x58')]};}if(_0x3ba51d['Interval']){_0x1812e8[_0xfe5f('0x59')]={'id':_0x3ba51d[_0xfe5f('0x59')]['id'],'name':_0x3ba51d['Interval'][_0xfe5f('0x4e')]};}var _0x42b5ed=md5(JSON['stringify'](_0x1812e8));if(_0x3ba51d[_0xfe5f('0x2')]!==_0x42b5ed){_0x3ba51d['md5']=_0x42b5ed;logger[_0xfe5f('0x3f')](_0xfe5f('0x5a')+_0x3356f2+']\x20sending\x20voice_queue:save\x20event:',util[_0xfe5f('0x35')](_0x1812e8,{'showHidden':![],'depth':null}));this[_0xfe5f('0x3d')](util[_0xfe5f('0x43')]('voice:queue:%s',_0x1812e8[_0xfe5f('0x4e')]),_0xfe5f('0x5b'),_0x1812e8);}}};VoiceQueueReport[_0xfe5f('0x9')]['isNotNull']=function(_0x585016){return _0x585016!==null&&!_[_0xfe5f('0x5c')](_0x585016);};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x27')]=function(){var _0x2744c0=this;setInterval(function(){_0x2744c0[_0xfe5f('0x2e')]();ami[_0xfe5f('0x5d')]({'action':_0xfe5f('0x5e')})[_0xfe5f('0x31')](function(_0x375767){logger[_0xfe5f('0x33')]('[voiceQueueReport][queues]',util[_0xfe5f('0x35')](_0x375767,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xfe5f('0x9')]['loopQueueSummary']=function(){var _0x5819e6=this;setInterval(function(){if(_0x5819e6['flagQueueSummary']){return ami[_0xfe5f('0x5d')]({'action':_0xfe5f('0x13')})['then'](function(){_0x5819e6['flagQueueSummary']=![];})[_0xfe5f('0x31')](function(_0x2010a5){logger[_0xfe5f('0x33')](_0xfe5f('0x5f'),util[_0xfe5f('0x35')](_0x2010a5,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xfe5f('0x14')]=function(_0x17646b){try{if(this[_0xfe5f('0x60')](_0x17646b)&&this['isNotNull'](_0x17646b[_0xfe5f('0x61')])){logger[_0xfe5f('0x3f')](_0xfe5f('0x62'),util[_0xfe5f('0x35')](_0x17646b,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x17646b[_0xfe5f('0x61')]]){logger[_0xfe5f('0x63')](_0xfe5f('0x64'),_0x17646b[_0xfe5f('0x61')]);var _0x1577c2=_[_0xfe5f('0x65')](this['channels'],'queue')[_0x17646b[_0xfe5f('0x61')]]||0x0;var _0x178ec3=_0x1577c2-_0x17646b[_0xfe5f('0x66')];if(this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]]['waiting']!==_[_0xfe5f('0x67')](_0x17646b[_0xfe5f('0x66')])||this[_0xfe5f('0x10')][_0x17646b['queue']][_0xfe5f('0x51')]!==_['toNumber'](_0x17646b[_0xfe5f('0x68')])||this['voiceQueues'][_0x17646b['queue']][_0xfe5f('0x50')]!==_['toNumber'](_0x17646b[_0xfe5f('0x50')])||this[_0xfe5f('0x10')][_0x17646b['queue']][_0xfe5f('0x2b')]!==_0x178ec3){this['voiceQueues'][_0x17646b['queue']][_0xfe5f('0x56')]=_[_0xfe5f('0x67')](_0x17646b['callers']);this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]][_0xfe5f('0x51')]=_['toNumber'](_0x17646b[_0xfe5f('0x68')]);this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]][_0xfe5f('0x50')]=_[_0xfe5f('0x67')](_0x17646b[_0xfe5f('0x50')]);this[_0xfe5f('0x10')][_0x17646b['queue']][_0xfe5f('0x2b')]=_0x178ec3>0x0?_0x178ec3:0x0;this['voiceQueues'][_0x17646b[_0xfe5f('0x61')]][_0xfe5f('0x2b')]=this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]][_0xfe5f('0x2b')]>_[_0xfe5f('0x67')](_0x17646b[_0xfe5f('0x68')])?_['toNumber'](_0x17646b[_0xfe5f('0x68')]):this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]]['talking'];this['emitVoiceQueueSummary'](this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]],'queuesummary');}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this[_0xfe5f('0x10')][_0x17646b[_0xfe5f('0x61')]],{'showHidden':![],'depth':null}));ami['emit'](_0xfe5f('0x69'),this['voiceQueues'][_0x17646b[_0xfe5f('0x61')]]);}}}catch(_0x131ba2){logger['error'](_0xfe5f('0x5f'),util['inspect'](_0x131ba2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x17')]=function(_0x2d2afc){logger[_0xfe5f('0x3f')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x2d2afc,{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummarycomplete',{});this[_0xfe5f('0x6a')]=!![];};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x19')]=function(_0x283b5d){try{if(this[_0xfe5f('0x60')](_0x283b5d)){logger[_0xfe5f('0x3f')](_0xfe5f('0x6b'),_0x283b5d['uniqueid'],util[_0xfe5f('0x35')](_0x283b5d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x283b5d[_0xfe5f('0x42')]]))this[_0xfe5f('0xe')][_0x283b5d[_0xfe5f('0x42')]]=[];if(_[_0xfe5f('0x5c')](this[_0xfe5f('0xf')][_0x283b5d[_0xfe5f('0x42')]]))this['channels'][_0x283b5d[_0xfe5f('0x42')]]={};var _0x6258d4=new QueueReport();_0x6258d4[_0xfe5f('0x4e')]=_0x283b5d[_0xfe5f('0x61')];_0x6258d4[_0xfe5f('0x4c')]=this[_0xfe5f('0x10')][_0x6258d4[_0xfe5f('0x4e')]]&&this[_0xfe5f('0x10')][_0x6258d4[_0xfe5f('0x4e')]][_0xfe5f('0x4c')]?this[_0xfe5f('0x10')][_0x6258d4['name']][_0xfe5f('0x4c')]||'inbound':_0xfe5f('0x4d');_0x6258d4[_0xfe5f('0x61')]=_0x283b5d[_0xfe5f('0x61')];_0x6258d4['queuecallerjoinAt']=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));_0x6258d4[_0xfe5f('0x6d')]=_0x283b5d[_0xfe5f('0x6d')];_0x6258d4[_0xfe5f('0x6e')]=_0x283b5d[_0xfe5f('0x6e')];_0x6258d4['uniqueid']=_0x283b5d['uniqueid'];_0x6258d4['routealias']=this['channels'][_0x283b5d['uniqueid']][_0xfe5f('0x6f')];logger[_0xfe5f('0x63')](_0xfe5f('0x70'),_0x6258d4[_0xfe5f('0x4e')],_0x6258d4[_0xfe5f('0x4c')]);_[_0xfe5f('0x71')](_0x6258d4,_['pick'](_0x283b5d,_[_0xfe5f('0x72')](_0x6258d4)));this[_0xfe5f('0xe')][_0x283b5d[_0xfe5f('0x42')]][_0xfe5f('0x73')](_0x6258d4);this[_0xfe5f('0xf')][_0x283b5d[_0xfe5f('0x42')]]=_0x6258d4;this[_0xfe5f('0x3e')](_0x6258d4,_0xfe5f('0x18'));}}catch(_0x189a0b){logger[_0xfe5f('0x33')]('[%s][voiceQueueReport][queuecallerjoin]',_0x283b5d[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x189a0b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x1a')]=function(_0x5adfc8){try{if(this[_0xfe5f('0x60')](_0x5adfc8)){logger[_0xfe5f('0x3f')](_0xfe5f('0x74'),_0x5adfc8['uniqueid'],util['inspect'](_0x5adfc8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5adfc8[_0xfe5f('0x42')]]){var _0x566509=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x5adfc8['uniqueid']]);_0x566509[_0xfe5f('0x76')]=![];_0x566509[_0xfe5f('0x77')]=null;_0x566509[_0xfe5f('0x78')]=_0x5adfc8[_0xfe5f('0x78')];_0x566509[_0xfe5f('0x79')]=_0x5adfc8['originalposition'];_0x566509[_0xfe5f('0x7a')]=!![];_0x566509[_0xfe5f('0x7b')]=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));_0x566509[_0xfe5f('0x47')]='ABANDONED';_0x566509[_0xfe5f('0x7c')]=null;logger[_0xfe5f('0x63')](_0xfe5f('0x7d'),_0x566509['name'],_0x566509[_0xfe5f('0x4c')]);this[_0xfe5f('0xf')][_0x5adfc8[_0xfe5f('0x42')]]=_0x566509;this[_0xfe5f('0x3b')](_0x566509,'queuecallerabandon');}}}catch(_0x442ae9){logger[_0xfe5f('0x33')]('[%s][voiceQueueReport][queuecallerabandon]',_0x5adfc8['uniqueid'],util[_0xfe5f('0x35')](_0x442ae9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')]['syncQueueCallerLeave']=function(_0x556725){try{if(this[_0xfe5f('0x60')](_0x556725)){logger[_0xfe5f('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x556725['uniqueid'],util[_0xfe5f('0x35')](_0x556725,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x556725[_0xfe5f('0x42')]]){var _0x56357e=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x556725[_0xfe5f('0x42')]]);_0x56357e[_0xfe5f('0x7e')]=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));_0x56357e[_0xfe5f('0x7f')]=_0x556725[_0xfe5f('0x7f')];_0x56357e['connectedlinename']=_0x556725[_0xfe5f('0x80')];logger[_0xfe5f('0x63')](_0xfe5f('0x81'),_0x56357e[_0xfe5f('0x4e')],_0x56357e[_0xfe5f('0x4c')],_0x556725[_0xfe5f('0x7f')],_0x556725[_0xfe5f('0x80')]);this[_0xfe5f('0xf')][_0x556725[_0xfe5f('0x42')]]=_0x56357e;this[_0xfe5f('0x3e')](_0x56357e,_0xfe5f('0x1b'));}}}catch(_0x2b7ca3){logger[_0xfe5f('0x33')](_0xfe5f('0x82'),_0x556725[_0xfe5f('0x42')],util['inspect'](_0x2b7ca3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x1e')]=function(_0x1c0b65){try{if(this[_0xfe5f('0x60')](_0x1c0b65)){logger[_0xfe5f('0x3f')](_0xfe5f('0x83'),_0x1c0b65['uniqueid'],util['inspect'](_0x1c0b65,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x1c0b65['uniqueid']]){var _0x681574=_[_0xfe5f('0x75')](this['queueReports'][_0x1c0b65['uniqueid']]);_0x681574['queuecallercomplete']=!![];_0x681574[_0xfe5f('0x47')]=_0xfe5f('0x84');logger[_0xfe5f('0x63')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x681574[_0xfe5f('0x4e')],_0x681574[_0xfe5f('0x4c')]);}}}catch(_0x4fc390){logger[_0xfe5f('0x33')](_0xfe5f('0x83'),_0x1c0b65[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x4fc390,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfe5f('0x85')]=function(_0x10db8c){try{if(this[_0xfe5f('0x60')](_0x10db8c)){logger[_0xfe5f('0x3f')](_0xfe5f('0x86'),_0x10db8c['uniqueid'],util[_0xfe5f('0x35')](_0x10db8c,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x42')]]){var _0xcdcb39=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x42')]]);_0xcdcb39[_0xfe5f('0x7a')]=![];_0xcdcb39['queuecallerabandonAt']=null;_0xcdcb39[_0xfe5f('0x87')]=!![];_0xcdcb39['lastAssignedTo']=_0x10db8c[_0xfe5f('0x88')];_0xcdcb39[_0xfe5f('0x78')]=_0x10db8c['holdtime'];_0xcdcb39['queuecallercomplete']=!![];_0xcdcb39[_0xfe5f('0x89')]=![];_0xcdcb39[_0xfe5f('0x8a')]=null;if(!_0xcdcb39[_0xfe5f('0x8b')]){if(_0x10db8c[_0xfe5f('0x8c')]==_0xfe5f('0x8b')){_0xcdcb39['queuecallerexitreason']=_0xfe5f('0x8d');logger['info'](_0xfe5f('0x8e'),_0xcdcb39[_0xfe5f('0x4e')],_0xcdcb39[_0xfe5f('0x4c')]);}else{if(_['startsWith'](_0x10db8c[_0xfe5f('0x30')][_0xfe5f('0x8f')](),'local/')){if(this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x90')]]){var _0xdb04ee=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x90')]]);_0xdb04ee[_0xfe5f('0x76')]=![];_0xdb04ee[_0xfe5f('0x89')]=!![];_0xdb04ee['queuecallerexitAt']=moment(_0xcdcb39[_0xfe5f('0x91')])[_0xfe5f('0x92')](_0x10db8c[_0xfe5f('0x78')],_0xfe5f('0x93'))[_0xfe5f('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0xdb04ee[_0xfe5f('0x47')]=_0xfe5f('0x94');_0xdb04ee[_0xfe5f('0x8b')]=!![];_0xdb04ee['transfertype']=_0xfe5f('0x95');_0xdb04ee[_0xfe5f('0x96')]=_0x10db8c[_0xfe5f('0x97')];_0xdb04ee[_0xfe5f('0x98')]=_0x10db8c[_0xfe5f('0x42')];logger[_0xfe5f('0x63')](_0xfe5f('0x99'),_0xdb04ee[_0xfe5f('0x4e')],_0xdb04ee[_0xfe5f('0x4c')]);var _0x57caa8=this['queueReports'][_0x10db8c['linkedid']];this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x90')]]=this['queueReports'][_0x10db8c[_0xfe5f('0x42')]];this[_0xfe5f('0xe')][_0x10db8c[_0xfe5f('0x42')]]=_0x57caa8;}}else{_0xcdcb39[_0xfe5f('0x47')]='COMPLETEDBY'+_0x10db8c[_0xfe5f('0x8c')][_0xfe5f('0x9a')]();logger[_0xfe5f('0x63')](_0xfe5f('0x9b'),_0xcdcb39[_0xfe5f('0x4e')],_0xcdcb39[_0xfe5f('0x4c')],_0xcdcb39[_0xfe5f('0x47')]);}}}this[_0xfe5f('0xf')][_0x10db8c[_0xfe5f('0x42')]]=_0xcdcb39;this[_0xfe5f('0x3b')](_0xcdcb39,_0xfe5f('0x1c'));}}}catch(_0x3a20dc){logger['error'](_0xfe5f('0x86'),_0x10db8c[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x3a20dc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x9c')]=function(_0x39634c){try{if(this[_0xfe5f('0x60')](_0x39634c)){logger['debug'](_0xfe5f('0x9d'),_0x39634c[_0xfe5f('0x42')],util['inspect'](_0x39634c,{'showHidden':![],'depth':null}));this[_0xfe5f('0x9e')](_0x39634c['uniqueid'],_[_0xfe5f('0x72')](_0x39634c[_0xfe5f('0x9f')])[0x0],_0x39634c[_0xfe5f('0xa0')]);if(this[_0xfe5f('0xe')][_0x39634c[_0xfe5f('0x42')]]){var _0x5f0bb9=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x39634c['uniqueid']]);if(_0x5f0bb9){if(this['isNotNull'](_0x39634c[_0xfe5f('0x9f')])&&this[_0xfe5f('0x60')](_0x39634c[_0xfe5f('0x9f')][_0xfe5f('0xa1')])){switch(_0x39634c[_0xfe5f('0xa0')]){case _0xfe5f('0xa2'):_0x5f0bb9['queuecallerexit']=![];_0x5f0bb9['queuecallerexitAt']=null;break;case _0xfe5f('0xa3'):_0x5f0bb9['lastevent']=_0xfe5f('0xa4');_0x5f0bb9[_0xfe5f('0x89')]=!![];_0x5f0bb9[_0xfe5f('0x8a')]=moment()['format'](_0xfe5f('0x6c'));_0x5f0bb9[_0xfe5f('0x7e')]=moment()['format'](_0xfe5f('0x6c'));logger[_0xfe5f('0x3f')](_0xfe5f('0xa5'),_0x39634c['uniqueid'],util['inspect'](_0x5f0bb9,{'showHidden':![],'depth':null}));ami[_0xfe5f('0x3d')](_0xfe5f('0xa6'),_0x5f0bb9);break;default:_0x5f0bb9[_0xfe5f('0x89')]=!![];_0x5f0bb9[_0xfe5f('0x8a')]=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));_0x5f0bb9[_0xfe5f('0x7e')]=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));}_0x5f0bb9[_0xfe5f('0x7a')]=![];_0x5f0bb9[_0xfe5f('0x7b')]=null;_0x5f0bb9['queuecallerexitreason']=_0x39634c[_0xfe5f('0xa0')];this['channels'][_0x39634c[_0xfe5f('0x42')]]=_0x5f0bb9;this['emitVoiceQueueChannelRemove'](_0x5f0bb9,_0xfe5f('0x1f'));}else if(this[_0xfe5f('0x60')](_0x39634c[_0xfe5f('0x9f')])&&this[_0xfe5f('0x60')](_0x39634c[_0xfe5f('0x9f')]['queueposition'])){if(!_0x5f0bb9['queuecallerabandon']){_0x5f0bb9[_0xfe5f('0x89')]=!![];_0x5f0bb9[_0xfe5f('0x8a')]=moment()[_0xfe5f('0x43')](_0xfe5f('0x6c'));_0x5f0bb9[_0xfe5f('0x47')]=_0xfe5f('0xa7');_0x5f0bb9[_0xfe5f('0x7e')]=moment()['format'](_0xfe5f('0x6c'));this[_0xfe5f('0xf')][_0x39634c[_0xfe5f('0x42')]]=_0x5f0bb9;}}logger[_0xfe5f('0x63')](_0xfe5f('0xa8'),_0x39634c['uniqueid'],_0x5f0bb9[_0xfe5f('0x4e')],_0x5f0bb9[_0xfe5f('0x4c')],_['keys'](_0x39634c[_0xfe5f('0x9f')])[0x0],_0x39634c['value']);_0x5f0bb9['variables']=this[_0xfe5f('0x12')][_0x39634c['uniqueid']];}}}}catch(_0x207049){logger['error'](_0xfe5f('0x9d'),_0x39634c[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x207049,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x9e')]=function(_0x2f9a2e,_0x1f8828,_0x32d89d){var _0x384b4d=[_0xfe5f('0xa9'),_0xfe5f('0xaa'),'rtpaudioqosjitter',_0xfe5f('0xab'),_0xfe5f('0xac'),_0xfe5f('0xad'),_0xfe5f('0xae'),_0xfe5f('0xaf'),_0xfe5f('0xb0'),_0xfe5f('0xb1'),_0xfe5f('0xb2'),_0xfe5f('0xb3'),_0xfe5f('0xb4'),_0xfe5f('0xb5'),'memberinterface',_0xfe5f('0xb6'),_0xfe5f('0x88'),_0xfe5f('0xb7'),'memberrealtime'];if(!_[_0xfe5f('0xb8')](_0x1f8828)&&!_[_0xfe5f('0xb9')](_0x384b4d,_0x1f8828)){if(_[_0xfe5f('0x5c')](this[_0xfe5f('0x12')][_0x2f9a2e])){this['variables'][_0x2f9a2e]={};}this[_0xfe5f('0x12')][_0x2f9a2e][_0x1f8828]=_0x32d89d;}};VoiceQueueReport[_0xfe5f('0x9')]['handleHangup']=function(_0x12da8b,_0x443888,_0x2e873e){var _0x295d53={};for(var _0x41e622=0x0;_0x41e622<this[_0xfe5f('0xe')][_0x12da8b][_0xfe5f('0xba')];_0x41e622+=0x1){_0x295d53=this[_0xfe5f('0xe')][_0x12da8b][_0x41e622];if(this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]]){if(_0x295d53[_0xfe5f('0x89')]&&_0x295d53[_0xfe5f('0x8b')]!=!![]){this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]][_0xfe5f('0x55')]+=0x1;}if(_0x295d53[_0xfe5f('0x7a')]){this[_0xfe5f('0x10')][_0x295d53['queue']][_0xfe5f('0xbb')]+=0x1;}this['voiceQueues'][_0x295d53[_0xfe5f('0x61')]][_0xfe5f('0x53')]+=moment(_0x295d53[_0xfe5f('0x7e')])[_0xfe5f('0xbc')](_0x295d53[_0xfe5f('0x91')],_0xfe5f('0x93'))||0x0;if(_0x41e622===this[_0xfe5f('0xe')][_0x12da8b][_0xfe5f('0xba')]-0x1){this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]][_0xfe5f('0x52')]+=moment()[_0xfe5f('0xbd')](0x0)['diff'](_0x295d53[_0xfe5f('0x91')],_0xfe5f('0x93'));this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]]['total']+=0x1;if(_0x295d53[_0xfe5f('0x76')]){this[_0xfe5f('0x10')][_0x295d53['queue']]['answered']+=0x1;this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]][_0xfe5f('0xbe')]+=moment()[_0xfe5f('0xbd')](0x0)['diff'](_0x295d53[_0xfe5f('0x7e')],_0xfe5f('0x93'));_0x295d53[_0xfe5f('0x77')]=moment()[_0xfe5f('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x295d53[_0xfe5f('0x89')]=![];_0x295d53['queuecallerexitAt']=null;}if(_0x295d53[_0xfe5f('0x89')]&&_0x295d53[_0xfe5f('0x8b')]!=!![]){_0x295d53[_0xfe5f('0xbf')]='unmanaged';logger[_0xfe5f('0x3f')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x12da8b,util[_0xfe5f('0x35')](_0x295d53,{'showHidden':![],'depth':null}));ami[_0xfe5f('0x3d')](_0xfe5f('0xc0'),_0x295d53);}if(_0x295d53[_0xfe5f('0x7a')]){_0x295d53[_0xfe5f('0xbf')]=_0xfe5f('0xbb');logger[_0xfe5f('0x3f')](_0xfe5f('0xc1'),_0x12da8b,util[_0xfe5f('0x35')](_0x295d53,{'showHidden':![],'depth':null}));ami[_0xfe5f('0x3d')](_0xfe5f('0xc2'),_0x295d53);}}else{this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]][_0xfe5f('0x52')]+=this[_0xfe5f('0x10')][_0x295d53['queue']][_0xfe5f('0x53')];}logger['info'](_0xfe5f('0xc3'),_0x12da8b,_0x295d53[_0xfe5f('0x4e')],_0x295d53[_0xfe5f('0x4c')],_0x443888);if(_0x2e873e&&_0x295d53[_0xfe5f('0x47')]==='ATTENDEDTRANSFER'){_0x295d53[_0xfe5f('0x47')]='COMPLETEDBYAGENT';}this[_0xfe5f('0xf')][_0x12da8b]=_0x295d53;this[_0xfe5f('0x3b')](_0x295d53,_0xfe5f('0x20'));this[_0xfe5f('0x4b')](this[_0xfe5f('0x10')][_0x295d53[_0xfe5f('0x61')]],_0xfe5f('0x20'));}}logger['debug'](_0xfe5f('0xc4'),_0x12da8b,util[_0xfe5f('0x35')](this[_0xfe5f('0xe')][_0x12da8b],{'showHidden':![],'depth':null}));ami[_0xfe5f('0x3d')](_0xfe5f('0xc5'),this[_0xfe5f('0xe')][_0x12da8b]);if(_0x295d53[_0xfe5f('0x47')]==='ATTENDEDTRANSFER')return;delete this[_0xfe5f('0xe')][_0x12da8b];delete this[_0xfe5f('0xf')][_0x12da8b];if(this[_0xfe5f('0x12')][_0x12da8b]){delete this[_0xfe5f('0x12')][_0x12da8b];}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0x21')]=function(_0x5500f8){try{if(this[_0xfe5f('0x60')](_0x5500f8)){logger[_0xfe5f('0x3f')](_0xfe5f('0xc6'),_0x5500f8[_0xfe5f('0x42')],util['inspect'](_0x5500f8,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x5500f8[_0xfe5f('0x42')]]){return this[_0xfe5f('0xc7')](_0x5500f8[_0xfe5f('0x42')],_0x5500f8[_0xfe5f('0xc8')]);}if(this[_0xfe5f('0xe')][_0x5500f8[_0xfe5f('0x90')]]){if(_0x5500f8[_0xfe5f('0xc9')]==='21'){return;}return this[_0xfe5f('0xc7')](_0x5500f8[_0xfe5f('0x90')],_0x5500f8[_0xfe5f('0xc8')],!![]);}var _0xc197a1=Object[_0xfe5f('0x72')](this['queueReports']);for(var _0x30c048=0x0;_0x30c048<_0xc197a1[_0xfe5f('0xba')];_0x30c048++){var _0x26e8a2=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0xc197a1[_0x30c048]]);if(_0x26e8a2&&_0x26e8a2['transferid']===_0x5500f8[_0xfe5f('0x42')]){return this[_0xfe5f('0xc7')](_0x26e8a2['uniqueid'],_0x5500f8[_0xfe5f('0xc8')],!![]);}}}}catch(_0x6276c4){logger[_0xfe5f('0x33')](_0xfe5f('0xc6'),_0x5500f8[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x6276c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')]['syncAttendedTransfer']=function(_0x3a5895){try{if(this[_0xfe5f('0x60')](_0x3a5895)){logger[_0xfe5f('0x3f')](_0xfe5f('0xca'),_0x3a5895[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x3a5895,{'showHidden':![],'depth':null}));var _0x42d7a5;var _0x3bf64e;var _0x2e0e8b;if(this[_0xfe5f('0xe')][_0x3a5895['transfereeuniqueid']]){_0x42d7a5=_[_0xfe5f('0x75')](this['queueReports'][_0x3a5895[_0xfe5f('0xcb')]]);_0x42d7a5[_0xfe5f('0x96')]=_0x3a5895[_0xfe5f('0xcc')];_0x42d7a5[_0xfe5f('0x98')]=_0x3a5895['secondtransfereruniqueid'];_0x42d7a5[_0xfe5f('0x47')]=_0xfe5f('0x48');_0x42d7a5[_0xfe5f('0x8b')]=!![];_0x42d7a5[_0xfe5f('0xcd')]=_0xfe5f('0xce');if(this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xcf')]]){_0x2e0e8b=this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xcf')]];this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xcf')]]=this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xcb')]];this['queueReports'][_0x3a5895[_0xfe5f('0xcb')]]=_0x2e0e8b;_0x3bf64e=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xcb')]]);_0x3bf64e[_0xfe5f('0x2f')]=!![];}logger[_0xfe5f('0x63')](_0xfe5f('0xd0'),_0x3a5895[_0xfe5f('0x42')],_0x42d7a5['name'],_0x42d7a5[_0xfe5f('0x4c')],_0x42d7a5[_0xfe5f('0x96')],_0x42d7a5[_0xfe5f('0x98')]);}else if(this['queueReports'][_0x3a5895[_0xfe5f('0xd1')]]){_0x42d7a5=_['last'](this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd1')]]);_0x42d7a5[_0xfe5f('0x96')]=_0x3a5895[_0xfe5f('0xd2')];_0x42d7a5['transferuniqueid']=_0x3a5895[_0xfe5f('0xd3')];_0x42d7a5[_0xfe5f('0x47')]=_0xfe5f('0x48');_0x42d7a5[_0xfe5f('0x8b')]=!![];_0x42d7a5[_0xfe5f('0xcd')]=_0xfe5f('0xce');if(this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd3')]]){_0x2e0e8b=this['queueReports'][_0x3a5895['origtransfereruniqueid']];this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd3')]]=this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd1')]];this[_0xfe5f('0xe')][_0x3a5895['transfertargetuniqueid']]=_0x2e0e8b;_0x3bf64e=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd1')]]);_0x3bf64e[_0xfe5f('0x2f')]=!![];}logger[_0xfe5f('0x63')](_0xfe5f('0xd0'),_0x3a5895[_0xfe5f('0x42')],_0x42d7a5[_0xfe5f('0x4e')],_0x42d7a5[_0xfe5f('0x4c')],_0x42d7a5[_0xfe5f('0x96')],_0x42d7a5[_0xfe5f('0x98')]);}else if(this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd3')]]){_0x42d7a5=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x3a5895[_0xfe5f('0xd3')]]);_0x42d7a5[_0xfe5f('0x96')]=_0x3a5895[_0xfe5f('0xd2')];_0x42d7a5[_0xfe5f('0x98')]=_0x3a5895[_0xfe5f('0xd3')];_0x42d7a5[_0xfe5f('0x47')]=_0xfe5f('0x48');_0x42d7a5[_0xfe5f('0x8b')]=!![];_0x42d7a5['transfertype']=_0xfe5f('0xce');_0x42d7a5[_0xfe5f('0x2f')]=!![];_0x42d7a5['transferid']=_0x3a5895[_0xfe5f('0xcb')];}else if(this['queueReports'][_0x3a5895['secondtransfereruniqueid']]){_0x42d7a5=_['last'](this['queueReports'][_0x3a5895[_0xfe5f('0xcf')]]);_0x42d7a5['transferexten']=_0x3a5895['secondtransfererexten'];_0x42d7a5['transferuniqueid']=_0x3a5895[_0xfe5f('0xcf')];_0x42d7a5[_0xfe5f('0x47')]='ATTENDEDTRANSFER';_0x42d7a5[_0xfe5f('0x8b')]=!![];_0x42d7a5[_0xfe5f('0xcd')]=_0xfe5f('0xce');_0x42d7a5[_0xfe5f('0x2f')]=!![];_0x42d7a5[_0xfe5f('0xd4')]=_0x3a5895[_0xfe5f('0xd1')];}}}catch(_0x331d6d){logger['error']('[%s][voiceQueueReport][attendedtransfer]',_0x3a5895[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x331d6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0xd5')]=function(_0x563f63){try{if(this[_0xfe5f('0x60')](_0x563f63)){logger['debug'](_0xfe5f('0xd6'),_0x563f63[_0xfe5f('0x42')],util['inspect'](_0x563f63,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x563f63['transfereeuniqueid']]){var _0xae1352=_['last'](this[_0xfe5f('0xe')][_0x563f63[_0xfe5f('0xcb')]]);_0xae1352['queuecallerexitreason']=_0xfe5f('0xd7');_0xae1352[_0xfe5f('0x8b')]=!![];_0xae1352['transfertype']=_0xfe5f('0xd8');_0xae1352[_0xfe5f('0x96')]=_0x563f63[_0xfe5f('0xd9')];_0xae1352[_0xfe5f('0x98')]=_0x563f63[_0xfe5f('0xcb')];logger['info'](_0xfe5f('0xda'),_0x563f63[_0xfe5f('0x42')],_0xae1352['name'],_0xae1352[_0xfe5f('0x4c')],_0xae1352[_0xfe5f('0x96')],_0xae1352[_0xfe5f('0x98')]);this[_0xfe5f('0x21')]({'event':_0xfe5f('0xdb'),'uniqueid':_0x563f63[_0xfe5f('0xcb')],'context':_0x563f63[_0xfe5f('0xdc')],'channel':_0x563f63[_0xfe5f('0xdd')]});}}}catch(_0x26ba16){logger[_0xfe5f('0x33')](_0xfe5f('0xd6'),_0x563f63[_0xfe5f('0x42')],util[_0xfe5f('0x35')](_0x26ba16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfe5f('0x24')]=function(_0x10e4e7){try{if(this[_0xfe5f('0x60')](_0x10e4e7)){logger[_0xfe5f('0x3f')](_0xfe5f('0xde'),_0x10e4e7['uniqueid'],util['inspect'](_0x10e4e7,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x10e4e7[_0xfe5f('0x42')]]){var _0x2edfd2=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x10e4e7[_0xfe5f('0x42')]]);if(!_[_0xfe5f('0xb8')](_0x2edfd2[_0xfe5f('0x7e')])){_0x2edfd2['mohstarttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0xfe5f('0x63')](_0xfe5f('0xdf'),_0x10e4e7['uniqueid'],_0x2edfd2['mohstarttime']);}}}}catch(_0x5c0f9f){logger[_0xfe5f('0x33')](_0xfe5f('0xde'),_0x10e4e7['uniqueid'],util[_0xfe5f('0x35')](_0x5c0f9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0xe0')]=function(_0x394868){try{if(this[_0xfe5f('0x60')](_0x394868)){logger['debug'](_0xfe5f('0xe1'),_0x394868[_0xfe5f('0x42')],util['inspect'](_0x394868,{'showHidden':![],'depth':null}));if(this[_0xfe5f('0xe')][_0x394868[_0xfe5f('0x42')]]){var _0x2f3433=_[_0xfe5f('0x75')](this[_0xfe5f('0xe')][_0x394868[_0xfe5f('0x42')]]);if(!_[_0xfe5f('0xb8')](_0x2f3433['mohstarttime'])){_0x2f3433[_0xfe5f('0xe2')]+=moment()[_0xfe5f('0xbd')](0x0)[_0xfe5f('0xbc')](_0x2f3433[_0xfe5f('0xe3')],_0xfe5f('0x93'));logger[_0xfe5f('0x63')](_0xfe5f('0xe4'),_0x394868[_0xfe5f('0x42')],_0x2f3433[_0xfe5f('0xe2')]);delete _0x2f3433[_0xfe5f('0xe3')];}}}}catch(_0x3f07f9){logger[_0xfe5f('0x33')](_0xfe5f('0xe1'),_0x394868[_0xfe5f('0x42')],util['inspect'](_0x3f07f9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfe5f('0x9')][_0xfe5f('0xe5')]=function(_0x298bf5){try{if(this[_0xfe5f('0x60')](_0x298bf5)){logger[_0xfe5f('0x3f')](_0xfe5f('0xe6'),_0x298bf5[_0xfe5f('0x42')],util['inspect'](_0x298bf5,{'showHidden':![],'depth':null}));if(_0x298bf5['application']['toLowerCase']()==='set'){_0x298bf5[_0xfe5f('0xe7')]=_0x298bf5[_0xfe5f('0xe8')]&&_0x298bf5[_0xfe5f('0xe8')][_0xfe5f('0xe9')](_0xfe5f('0xea'))?_0x298bf5[_0xfe5f('0xe8')]:(_0x298bf5[_0xfe5f('0xe8')]||_0x298bf5[_0xfe5f('0xe7')])[_0xfe5f('0x8f')]();if(_[_0xfe5f('0xe9')](_0x298bf5[_0xfe5f('0xe7')][_0xfe5f('0x8f')](),_0xfe5f('0xeb'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x298bf5['uniqueid'],_0x298bf5['application'],_0x298bf5[_0xfe5f('0xe7')]);if(_[_0xfe5f('0x5c')](this[_0xfe5f('0xf')][_0x298bf5[_0xfe5f('0x42')]]))this[_0xfe5f('0xf')][_0x298bf5[_0xfe5f('0x42')]]={};var _0x1a2650=_0x298bf5[_0xfe5f('0xe7')][_0xfe5f('0xec')]('=');var _0x2ea201=_0x1a2650[0x0][_0xfe5f('0x8f')]()['match'](/cdr\((.*)\)/);if(_0x2ea201)this[_0xfe5f('0xf')][_0x298bf5[_0xfe5f('0x42')]][_0x2ea201[0x1]]=_0x1a2650[0x1];}}}}catch(_0x3f1348){logger[_0xfe5f('0x33')](_0xfe5f('0xed'),_0x298bf5[_0xfe5f('0x42')],util['inspect'](_0x3f1348,{'showHidden':![],'depth':null}));}};module[_0xfe5f('0xee')]=VoiceQueueReport;
\ No newline at end of file
+var _0xe209=['transfertype','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferexten','transfertargetuniqueid','origtransfereruniqueid','secondtransfererexten','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','applicationdata','appdata','CDR(routeAlias)','toLowerCase','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','[%s][voiceQueueReport][newexten]','exports','lodash','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','enqueue','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','abandoned','Trunk','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','flagQueueSummary','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','loggedIn','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','uniqueid','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','membername','transfer','reason','COMPLETED','startsWith','channel','local/','linkedid','queuecallerexit','queuecallerexitAt','add','seconds','FORWARD','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','handleHangup','unmanaged','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','COMPLETEDBYAGENT','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','length','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid'];(function(_0x46a55e,_0xe095bf){var _0x2648a8=function(_0x16616f){while(--_0x16616f){_0x46a55e['push'](_0x46a55e['shift']());}};_0x2648a8(++_0xe095bf);}(_0xe209,0x117));var _0x9e20=function(_0x3a52e4,_0x2e2905){_0x3a52e4=_0x3a52e4-0x0;var _0xc3a550=_0xe209[_0x3a52e4];return _0xc3a550;};'use strict';var _=require(_0x9e20('0x0'));var moment=require('moment');var util=require('util');var md5=require(_0x9e20('0x1'));var Redis=require(_0x9e20('0x2'));var config=require('../../../config/environment');var logger=require(_0x9e20('0x3'))(_0x9e20('0x4'));var ami=require(_0x9e20('0x5'));var QueueReport=require(_0x9e20('0x6'));config[_0x9e20('0x7')]=_[_0x9e20('0x8')](config['redis'],{'host':_0x9e20('0x9'),'port':0x18eb});var io=require(_0x9e20('0xa'))(new Redis(config[_0x9e20('0x7')]));var Sequence=function(){};Sequence[_0x9e20('0xb')]['enqueue']=function(_0xa5087e){this[_0x9e20('0xc')]=this['tail']?this[_0x9e20('0xc')][_0x9e20('0xd')](_0xa5087e):_0xa5087e();};function VoiceQueueReport(_0x5ed096){this[_0x9e20('0xe')]=new Sequence();this[_0x9e20('0xf')]={};this[_0x9e20('0x10')]=_0x5ed096[_0x9e20('0x10')];this['channels']=_0x5ed096[_0x9e20('0x11')];this['voiceQueues']=_0x5ed096[_0x9e20('0x12')];this['flagQueueSummary']=!![];this[_0x9e20('0x13')]=_0x5ed096[_0x9e20('0x13')];this[_0x9e20('0x14')]={};ami['on'](_0x9e20('0x15'),this[_0x9e20('0x16')]['bind'](this));ami['on'](_0x9e20('0x17'),this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x9e20('0x18'),this[_0x9e20('0x19')][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x1b'),this[_0x9e20('0x1c')][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x1d'),this['syncQueueCallerLeave'][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x1e'),this[_0x9e20('0x1f')][_0x9e20('0x1a')](this));ami['on']('agentconnect',this[_0x9e20('0x20')]['bind'](this));ami['on'](_0x9e20('0x21'),this[_0x9e20('0x22')][_0x9e20('0x1a')](this));ami['on']('hangup',this[_0x9e20('0x23')][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x24'),this[_0x9e20('0x25')][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x26'),this[_0x9e20('0x27')]['bind'](this));ami['on']('musiconholdstop',this[_0x9e20('0x28')]['bind'](this));ami['on'](_0x9e20('0x29'),this[_0x9e20('0x2a')][_0x9e20('0x1a')](this));ami['on'](_0x9e20('0x2b'),this[_0x9e20('0x2c')][_0x9e20('0x1a')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x5cf3d0){if(!_[_0x9e20('0x2d')](_0x5cf3d0)){for(var _0x43081d in _0x5cf3d0){if(_0x5cf3d0[_0x9e20('0x2e')](_0x43081d)){delete _0x5cf3d0[_0x43081d];}}}}function clearCampaigns(_0x845c16){if(!_['isEmpty'](_0x845c16)){for(var _0x29279f in _0x845c16){if(_0x845c16[_0x9e20('0x2e')](_0x29279f)){_0x845c16[_0x29279f][_0x9e20('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xfdb2ef){if(!_[_0x9e20('0x2d')](_0xfdb2ef)){for(var _0xe3b026 in _0xfdb2ef){if(_0xfdb2ef['hasOwnProperty'](_0xe3b026)){_0xfdb2ef[_0xe3b026][_0x9e20('0x2f')]=0x0;_0xfdb2ef[_0xe3b026][_0x9e20('0x30')]=0x0;_0xfdb2ef[_0xe3b026][_0x9e20('0x31')]=0x0;_0xfdb2ef[_0xe3b026][_0x9e20('0x32')]=0x0;_0xfdb2ef[_0xe3b026][_0x9e20('0x33')]=!![];}}}}function clearAgentBooked(_0x513c98){if(!_[_0x9e20('0x2d')](_0x513c98)){for(var _0x351b7a in _0x513c98){if(_0x513c98[_0x9e20('0x2e')](_0x351b7a)){_0x513c98[_0x351b7a][_0x9e20('0x34')]=!![];}}}}VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x35')]=function(){var _0x5f3a24=this;for(var _0x1d62cd in this[_0x9e20('0x36')]){if(this[_0x9e20('0x36')]['hasOwnProperty'](_0x1d62cd)&&!this[_0x9e20('0x36')][_0x1d62cd][_0x9e20('0x37')]){this[_0x9e20('0xe')][_0x9e20('0x38')](function(){if(!_['isNil'](_0x5f3a24[_0x9e20('0x36')][_0x1d62cd])){return ami[_0x9e20('0x39')]({'action':_0x9e20('0x3a'),'channel':_0x5f3a24[_0x9e20('0x36')][_0x1d62cd]['channel']})[_0x9e20('0x3b')](function(_0x530c15){if(_0x530c15[_0x9e20('0x3c')]===_0x9e20('0x3d')){setTimeout(function(){if(_0x5f3a24['channels'][_0x1d62cd]){delete _0x5f3a24[_0x9e20('0x36')][_0x1d62cd];logger[_0x9e20('0x3e')](_0x9e20('0x3f'),_0x1d62cd,util['inspect'](_0x530c15,{'showHidden':![],'depth':null}));}if(_0x5f3a24[_0x9e20('0xf')][_0x1d62cd]){delete _0x5f3a24[_0x9e20('0xf')][_0x1d62cd];logger[_0x9e20('0x3e')]('[%s][voiceQueueReport][checkQueueReport]',_0x1d62cd,util[_0x9e20('0x40')](_0x530c15,{'showHidden':![],'depth':null}));}if(_0x5f3a24[_0x9e20('0x14')][_0x1d62cd]){delete _0x5f3a24[_0x9e20('0x14')][_0x1d62cd];logger[_0x9e20('0x3e')](_0x9e20('0x41'),_0x1d62cd,util['inspect'](_0x530c15,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x25')]=function(){logger[_0x9e20('0x3e')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x9e20('0x36')]);this['clearQueueReport'](this[_0x9e20('0xf')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x9e20('0x12')]);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0x9e20('0x42')]=function(_0x444718){var _0x39d7d4=this;if(!_['isEmpty'](_0x444718)){for(var _0x4cd96c in _0x444718){if(_0x444718[_0x9e20('0x2e')](_0x4cd96c)){_0x39d7d4[_0x9e20('0x43')](_0x444718[_0x4cd96c],_0x9e20('0x44'));delete _0x444718[_0x4cd96c];}}}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x45')]=function(_0xd37823,_0x270cb1,_0x5a04c9){io['to'](_0xd37823)[_0x9e20('0x45')](_0x270cb1,_0x5a04c9);};VoiceQueueReport['prototype'][_0x9e20('0x46')]=function(_0x374b5b,_0x40d37b){logger[_0x9e20('0x47')](_0x9e20('0x48')+_0x40d37b+_0x9e20('0x49'),_0x374b5b['uniqueid'],util[_0x9e20('0x40')](_0x374b5b,{'showHidden':![],'depth':null}));this[_0x9e20('0x45')](util[_0x9e20('0x4a')]('voice:queue:%s',_0x374b5b[_0x9e20('0x4b')]),_0x9e20('0x4c'),_0x374b5b);io[_0x9e20('0x45')](_0x9e20('0x4d'),_0x374b5b);};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x43')]=function(_0xa3a750,_0x170b4b){logger[_0x9e20('0x47')]('[%s][voiceQueueReport]['+_0x170b4b+_0x9e20('0x4e'),_0xa3a750['uniqueid'],util[_0x9e20('0x40')](_0xa3a750,{'showHidden':![],'depth':null}));if(_0xa3a750[_0x9e20('0x4f')]===_0x9e20('0x50'))return;this['emit'](util['format']('voice:queue:%s',_0xa3a750[_0x9e20('0x4b')]),'voice_queue_channel:remove',_0xa3a750);io[_0x9e20('0x45')](_0x9e20('0x51'),_0xa3a750);};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x52')]=function(_0x1eb056,_0x16ff1a){if(_0x1eb056[_0x9e20('0x53')]===_0x9e20('0x54')){var _0x4f1b34={'id':_0x1eb056['id'],'name':_0x1eb056['name'],'strategy':_0x1eb056[_0x9e20('0x55')],'answered':_0x1eb056[_0x9e20('0x56')],'available':_0x1eb056[_0x9e20('0x57')],'loggedIn':_0x1eb056['loggedIn'],'pTalking':_0x1eb056[_0x9e20('0x31')],'sumBillable':_0x1eb056[_0x9e20('0x58')],'sumDuration':_0x1eb056[_0x9e20('0x59')],'sumHoldTime':_0x1eb056[_0x9e20('0x5a')]||0x0,'talking':_0x1eb056[_0x9e20('0x30')],'total':_0x1eb056[_0x9e20('0x5b')],'type':_0x1eb056['type'],'unmanaged':_0x1eb056['unmanaged'],'abandoned':_0x1eb056[_0x9e20('0x5c')],'waiting':_0x1eb056[_0x9e20('0x32')]};if(_0x1eb056['Trunk']){_0x4f1b34[_0x9e20('0x5d')]={'id':_0x1eb056[_0x9e20('0x5d')]['id'],'name':_0x1eb056['Trunk'][_0x9e20('0x4b')],'active':_0x1eb056[_0x9e20('0x5d')]['active'],'callerid':_0x1eb056[_0x9e20('0x5d')][_0x9e20('0x5e')]};}if(_0x1eb056[_0x9e20('0x5f')]){_0x4f1b34[_0x9e20('0x5f')]={'id':_0x1eb056[_0x9e20('0x5f')]['id'],'name':_0x1eb056['Interval'][_0x9e20('0x4b')]};}var _0xb7374f=md5(JSON[_0x9e20('0x60')](_0x4f1b34));if(_0x1eb056[_0x9e20('0x1')]!==_0xb7374f){_0x1eb056[_0x9e20('0x1')]=_0xb7374f;logger['debug'](_0x9e20('0x61')+_0x16ff1a+_0x9e20('0x62'),util[_0x9e20('0x40')](_0x4f1b34,{'showHidden':![],'depth':null}));this[_0x9e20('0x45')](util[_0x9e20('0x4a')](_0x9e20('0x63'),_0x4f1b34['name']),_0x9e20('0x64'),_0x4f1b34);}}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x65')]=function(_0x1a79e4){return _0x1a79e4!==null&&!_['isUndefined'](_0x1a79e4);};VoiceQueueReport[_0x9e20('0xb')]['loopQueueShow']=function(){var _0x53895e=this;setInterval(function(){_0x53895e[_0x9e20('0x35')]();ami[_0x9e20('0x39')]({'action':_0x9e20('0x66')})[_0x9e20('0x3b')](function(_0xb0341d){logger[_0x9e20('0x3e')](_0x9e20('0x67'),util[_0x9e20('0x40')](_0xb0341d,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x9e20('0x68')]=function(){var _0x32e8d1=this;setInterval(function(){if(_0x32e8d1['flagQueueSummary']){return ami[_0x9e20('0x39')]({'action':_0x9e20('0x15')})[_0x9e20('0x69')](function(){_0x32e8d1[_0x9e20('0x6a')]=![];})[_0x9e20('0x3b')](function(_0x5ed5bf){logger[_0x9e20('0x3e')](_0x9e20('0x6b'),util['inspect'](_0x5ed5bf,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x16')]=function(_0x12a85e){try{if(this[_0x9e20('0x65')](_0x12a85e)&&this[_0x9e20('0x65')](_0x12a85e[_0x9e20('0x6c')])){logger['debug'](_0x9e20('0x6d'),util[_0x9e20('0x40')](_0x12a85e,{'showHidden':![],'depth':null}));if(this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]]){logger[_0x9e20('0x6e')](_0x9e20('0x6f'),_0x12a85e[_0x9e20('0x6c')]);var _0x50f2eb=_['countBy'](this[_0x9e20('0x36')],_0x9e20('0x6c'))[_0x12a85e[_0x9e20('0x6c')]]||0x0;var _0x55373b=_0x50f2eb-_0x12a85e['callers'];if(this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x32')]!==_[_0x9e20('0x70')](_0x12a85e[_0x9e20('0x71')])||this['voiceQueues'][_0x12a85e[_0x9e20('0x6c')]]['loggedIn']!==_[_0x9e20('0x70')](_0x12a85e[_0x9e20('0x72')])||this[_0x9e20('0x12')][_0x12a85e['queue']][_0x9e20('0x57')]!==_[_0x9e20('0x70')](_0x12a85e[_0x9e20('0x57')])||this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x30')]!==_0x55373b){this['voiceQueues'][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x32')]=_['toNumber'](_0x12a85e['callers']);this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x73')]=_[_0x9e20('0x70')](_0x12a85e['loggedin']);this['voiceQueues'][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x57')]=_[_0x9e20('0x70')](_0x12a85e[_0x9e20('0x57')]);this[_0x9e20('0x12')][_0x12a85e['queue']][_0x9e20('0x30')]=_0x55373b>0x0?_0x55373b:0x0;this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]][_0x9e20('0x30')]=this[_0x9e20('0x12')][_0x12a85e['queue']][_0x9e20('0x30')]>_[_0x9e20('0x70')](_0x12a85e['loggedin'])?_[_0x9e20('0x70')](_0x12a85e[_0x9e20('0x72')]):this['voiceQueues'][_0x12a85e['queue']][_0x9e20('0x30')];this[_0x9e20('0x52')](this['voiceQueues'][_0x12a85e['queue']],_0x9e20('0x15'));}logger[_0x9e20('0x47')](_0x9e20('0x74'),util[_0x9e20('0x40')](this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x9e20('0x75'),this[_0x9e20('0x12')][_0x12a85e[_0x9e20('0x6c')]]);}}}catch(_0x8925f5){logger[_0x9e20('0x3e')]('[voiceQueueReport][queuesummary]',util[_0x9e20('0x40')](_0x8925f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x76')]=function(_0x332790){logger[_0x9e20('0x47')](_0x9e20('0x77'),util['inspect'](_0x332790,{'showHidden':![],'depth':null}));ami[_0x9e20('0x45')](_0x9e20('0x78'),{});this[_0x9e20('0x6a')]=!![];};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x19')]=function(_0x4afc10){try{if(this[_0x9e20('0x65')](_0x4afc10)){logger[_0x9e20('0x47')]('[%s][voiceQueueReport][queuecallerjoin]',_0x4afc10[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x4afc10,{'showHidden':![],'depth':null}));if(_[_0x9e20('0x7a')](this[_0x9e20('0xf')][_0x4afc10['uniqueid']]))this['queueReports'][_0x4afc10[_0x9e20('0x79')]]=[];if(_['isUndefined'](this[_0x9e20('0x36')][_0x4afc10['uniqueid']]))this['channels'][_0x4afc10[_0x9e20('0x79')]]={};var _0x563072=new QueueReport();_0x563072[_0x9e20('0x4b')]=_0x4afc10['queue'];_0x563072['type']=this[_0x9e20('0x12')][_0x563072['name']]&&this['voiceQueues'][_0x563072[_0x9e20('0x4b')]]['type']?this[_0x9e20('0x12')][_0x563072[_0x9e20('0x4b')]][_0x9e20('0x53')]||'inbound':_0x9e20('0x54');_0x563072[_0x9e20('0x6c')]=_0x4afc10[_0x9e20('0x6c')];_0x563072[_0x9e20('0x7b')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));_0x563072[_0x9e20('0x7d')]=_0x4afc10[_0x9e20('0x7d')];_0x563072[_0x9e20('0x7e')]=_0x4afc10[_0x9e20('0x7e')];_0x563072[_0x9e20('0x79')]=_0x4afc10[_0x9e20('0x79')];_0x563072[_0x9e20('0x7f')]=this[_0x9e20('0x36')][_0x4afc10[_0x9e20('0x79')]][_0x9e20('0x7f')];logger[_0x9e20('0x6e')](_0x9e20('0x80'),_0x563072['name'],_0x563072['type']);_['merge'](_0x563072,_[_0x9e20('0x81')](_0x4afc10,_[_0x9e20('0x82')](_0x563072)));this[_0x9e20('0xf')][_0x4afc10[_0x9e20('0x79')]][_0x9e20('0x83')](_0x563072);this['channels'][_0x4afc10[_0x9e20('0x79')]]=_0x563072;this[_0x9e20('0x46')](_0x563072,_0x9e20('0x18'));}}catch(_0x55b073){logger['error'](_0x9e20('0x84'),_0x4afc10[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x55b073,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x1c')]=function(_0x170603){try{if(this[_0x9e20('0x65')](_0x170603)){logger[_0x9e20('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x170603['uniqueid'],util[_0x9e20('0x40')](_0x170603,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x170603[_0x9e20('0x79')]]){var _0x1740d3=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x170603['uniqueid']]);_0x1740d3[_0x9e20('0x86')]=![];_0x1740d3[_0x9e20('0x87')]=null;_0x1740d3[_0x9e20('0x88')]=_0x170603[_0x9e20('0x88')];_0x1740d3[_0x9e20('0x89')]=_0x170603[_0x9e20('0x89')];_0x1740d3[_0x9e20('0x1b')]=!![];_0x1740d3[_0x9e20('0x8a')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));_0x1740d3[_0x9e20('0x4f')]=_0x9e20('0x8b');_0x1740d3['lastAssignedTo']=null;logger[_0x9e20('0x6e')](_0x9e20('0x8c'),_0x1740d3[_0x9e20('0x4b')],_0x1740d3[_0x9e20('0x53')]);this[_0x9e20('0x36')][_0x170603[_0x9e20('0x79')]]=_0x1740d3;this['emitVoiceQueueChannelRemove'](_0x1740d3,_0x9e20('0x1b'));}}}catch(_0x1eb254){logger[_0x9e20('0x3e')](_0x9e20('0x8d'),_0x170603[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x1eb254,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x8e')]=function(_0x4f19fc){try{if(this[_0x9e20('0x65')](_0x4f19fc)){logger[_0x9e20('0x47')](_0x9e20('0x8f'),_0x4f19fc[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x4f19fc,{'showHidden':![],'depth':null}));if(this[_0x9e20('0xf')][_0x4f19fc[_0x9e20('0x79')]]){var _0x15fb42=_['last'](this[_0x9e20('0xf')][_0x4f19fc[_0x9e20('0x79')]]);_0x15fb42[_0x9e20('0x90')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));_0x15fb42[_0x9e20('0x91')]=_0x4f19fc['connectedlinenum'];_0x15fb42['connectedlinename']=_0x4f19fc[_0x9e20('0x92')];logger['info'](_0x9e20('0x93'),_0x15fb42[_0x9e20('0x4b')],_0x15fb42[_0x9e20('0x53')],_0x4f19fc[_0x9e20('0x91')],_0x4f19fc[_0x9e20('0x92')]);this[_0x9e20('0x36')][_0x4f19fc[_0x9e20('0x79')]]=_0x15fb42;this[_0x9e20('0x46')](_0x15fb42,_0x9e20('0x1d'));}}}catch(_0x2cdafe){logger[_0x9e20('0x3e')](_0x9e20('0x8f'),_0x4f19fc[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x2cdafe,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x20')]=function(_0x442f9e){try{if(this[_0x9e20('0x65')](_0x442f9e)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x442f9e[_0x9e20('0x79')],util['inspect'](_0x442f9e,{'showHidden':![],'depth':null}));if(this[_0x9e20('0xf')][_0x442f9e[_0x9e20('0x79')]]){var _0x4e2233=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x442f9e['uniqueid']]);_0x4e2233['queuecallercomplete']=!![];_0x4e2233['queuecallerexitreason']='COMPLETEDBYAGENT';logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4e2233[_0x9e20('0x4b')],_0x4e2233[_0x9e20('0x53')]);}}}catch(_0x2837ff){logger[_0x9e20('0x3e')](_0x9e20('0x94'),_0x442f9e[_0x9e20('0x79')],util['inspect'](_0x2837ff,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x1f')]=function(_0x55f3ca){try{if(this[_0x9e20('0x65')](_0x55f3ca)){logger[_0x9e20('0x47')](_0x9e20('0x95'),_0x55f3ca['uniqueid'],util[_0x9e20('0x40')](_0x55f3ca,{'showHidden':![],'depth':null}));if(this[_0x9e20('0xf')][_0x55f3ca['uniqueid']]){var _0x41449e=_['last'](this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x79')]]);_0x41449e[_0x9e20('0x1b')]=![];_0x41449e[_0x9e20('0x8a')]=null;_0x41449e['assigned']=!![];_0x41449e['lastAssignedTo']=_0x55f3ca[_0x9e20('0x96')];_0x41449e[_0x9e20('0x88')]=_0x55f3ca[_0x9e20('0x88')];_0x41449e[_0x9e20('0x86')]=!![];_0x41449e['queuecallerexit']=![];_0x41449e['queuecallerexitAt']=null;if(!_0x41449e[_0x9e20('0x97')]){if(_0x55f3ca[_0x9e20('0x98')]==_0x9e20('0x97')){_0x41449e[_0x9e20('0x4f')]=_0x9e20('0x99');logger[_0x9e20('0x6e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x41449e[_0x9e20('0x4b')],_0x41449e[_0x9e20('0x53')]);}else{if(_[_0x9e20('0x9a')](_0x55f3ca[_0x9e20('0x9b')]['toLowerCase'](),_0x9e20('0x9c'))){if(this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x9d')]]){var _0x13eadb=_['last'](this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x9d')]]);_0x13eadb['queuecallercomplete']=![];_0x13eadb[_0x9e20('0x9e')]=!![];_0x13eadb[_0x9e20('0x9f')]=moment(_0x41449e['queuecallerjoinAt'])[_0x9e20('0xa0')](_0x55f3ca[_0x9e20('0x88')],_0x9e20('0xa1'))[_0x9e20('0x4a')](_0x9e20('0x7c'));_0x13eadb[_0x9e20('0x4f')]='FORWARDTRANSFER';_0x13eadb[_0x9e20('0x97')]=!![];_0x13eadb['transfertype']=_0x9e20('0xa2');_0x13eadb['transferexten']=_0x55f3ca[_0x9e20('0xa3')];_0x13eadb['transferuniqueid']=_0x55f3ca[_0x9e20('0x79')];logger[_0x9e20('0x6e')](_0x9e20('0xa4'),_0x13eadb[_0x9e20('0x4b')],_0x13eadb['type']);var _0x544e34=this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x9d')]];this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x9d')]]=this[_0x9e20('0xf')][_0x55f3ca[_0x9e20('0x79')]];this['queueReports'][_0x55f3ca['uniqueid']]=_0x544e34;}}else{_0x41449e[_0x9e20('0x4f')]=_0x9e20('0xa5')+_0x55f3ca[_0x9e20('0x98')][_0x9e20('0xa6')]();logger[_0x9e20('0x6e')](_0x9e20('0xa7'),_0x41449e[_0x9e20('0x4b')],_0x41449e[_0x9e20('0x53')],_0x41449e['queuecallerexitreason']);}}}this['channels'][_0x55f3ca[_0x9e20('0x79')]]=_0x41449e;this['emitVoiceQueueChannelRemove'](_0x41449e,_0x9e20('0x1e'));}}}catch(_0x330fa6){logger['error'](_0x9e20('0x95'),_0x55f3ca['uniqueid'],util['inspect'](_0x330fa6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x22')]=function(_0x32f83d){try{if(this[_0x9e20('0x65')](_0x32f83d)){logger['debug'](_0x9e20('0xa8'),_0x32f83d[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x32f83d,{'showHidden':![],'depth':null}));this[_0x9e20('0xa9')](_0x32f83d['uniqueid'],_[_0x9e20('0x82')](_0x32f83d[_0x9e20('0xaa')])[0x0],_0x32f83d[_0x9e20('0xab')]);if(this[_0x9e20('0xf')][_0x32f83d[_0x9e20('0x79')]]){var _0x9818ea=_[_0x9e20('0x85')](this['queueReports'][_0x32f83d['uniqueid']]);if(_0x9818ea){if(this[_0x9e20('0x65')](_0x32f83d[_0x9e20('0xaa')])&&this[_0x9e20('0x65')](_0x32f83d[_0x9e20('0xaa')]['queuestatus'])){switch(_0x32f83d['value']){case _0x9e20('0xac'):_0x9818ea[_0x9e20('0x9e')]=![];_0x9818ea['queuecallerexitAt']=null;break;case _0x9e20('0xad'):_0x9818ea[_0x9e20('0xae')]=_0x9e20('0xaf');_0x9818ea['queuecallerexit']=!![];_0x9818ea[_0x9e20('0x9f')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));_0x9818ea['queuecallerleaveAt']=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));logger[_0x9e20('0x47')](_0x9e20('0xb0'),_0x32f83d[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x9818ea,{'showHidden':![],'depth':null}));ami[_0x9e20('0x45')]('custom:timeout',_0x9818ea);break;default:_0x9818ea[_0x9e20('0x9e')]=!![];_0x9818ea[_0x9e20('0x9f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x9818ea[_0x9e20('0x90')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));}_0x9818ea['queuecallerabandon']=![];_0x9818ea[_0x9e20('0x8a')]=null;_0x9818ea[_0x9e20('0x4f')]=_0x32f83d[_0x9e20('0xab')];this[_0x9e20('0x36')][_0x32f83d[_0x9e20('0x79')]]=_0x9818ea;this[_0x9e20('0x43')](_0x9818ea,'varset');}else if(this[_0x9e20('0x65')](_0x32f83d['variable'])&&this['isNotNull'](_0x32f83d[_0x9e20('0xaa')]['queueposition'])){if(!_0x9818ea[_0x9e20('0x1b')]){_0x9818ea['queuecallerexit']=!![];_0x9818ea[_0x9e20('0x9f')]=moment()['format'](_0x9e20('0x7c'));_0x9818ea['queuecallerexitreason']=_0x9e20('0xb1');_0x9818ea[_0x9e20('0x90')]=moment()[_0x9e20('0x4a')](_0x9e20('0x7c'));this[_0x9e20('0x36')][_0x32f83d[_0x9e20('0x79')]]=_0x9818ea;}}logger[_0x9e20('0x6e')](_0x9e20('0xb2'),_0x32f83d['uniqueid'],_0x9818ea['name'],_0x9818ea[_0x9e20('0x53')],_[_0x9e20('0x82')](_0x32f83d['variable'])[0x0],_0x32f83d[_0x9e20('0xab')]);_0x9818ea[_0x9e20('0x14')]=this['variables'][_0x32f83d[_0x9e20('0x79')]];}}}}catch(_0x37a877){logger[_0x9e20('0x3e')](_0x9e20('0xa8'),_0x32f83d[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x37a877,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0xa9')]=function(_0x2592a1,_0x312096,_0x535832){var _0xe59cda=[_0x9e20('0xb3'),_0x9e20('0xb4'),_0x9e20('0xb5'),_0x9e20('0xb6'),_0x9e20('0xb7'),_0x9e20('0xb8'),_0x9e20('0xb9'),_0x9e20('0xba'),_0x9e20('0xbb'),'sipuri',_0x9e20('0xbc'),_0x9e20('0xbd'),_0x9e20('0xbe'),'memberdynamic',_0x9e20('0xbf'),_0x9e20('0xc0'),_0x9e20('0x96'),_0x9e20('0xc1'),_0x9e20('0xc2')];if(!_[_0x9e20('0xc3')](_0x312096)&&!_[_0x9e20('0xc4')](_0xe59cda,_0x312096)){if(_[_0x9e20('0x7a')](this['variables'][_0x2592a1])){this[_0x9e20('0x14')][_0x2592a1]={};}this[_0x9e20('0x14')][_0x2592a1][_0x312096]=_0x535832;}};VoiceQueueReport['prototype'][_0x9e20('0xc5')]=function(_0x167eac,_0x3e9616,_0x18879e){var _0x49c133={};for(var _0xce8df2=0x0;_0xce8df2<this[_0x9e20('0xf')][_0x167eac]['length'];_0xce8df2+=0x1){_0x49c133=this['queueReports'][_0x167eac][_0xce8df2];if(this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]]){if(_0x49c133[_0x9e20('0x9e')]&&_0x49c133[_0x9e20('0x97')]!=!![]){this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0xc6')]+=0x1;}if(_0x49c133[_0x9e20('0x1b')]){this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x5c')]+=0x1;}this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x5a')]+=moment(_0x49c133['queuecallerleaveAt'])[_0x9e20('0xc7')](_0x49c133['queuecallerjoinAt'],_0x9e20('0xa1'))||0x0;if(_0xce8df2===this['queueReports'][_0x167eac]['length']-0x1){this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x59')]+=moment()[_0x9e20('0xc8')](0x0)[_0x9e20('0xc7')](_0x49c133[_0x9e20('0x7b')],'seconds');this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x5b')]+=0x1;if(_0x49c133[_0x9e20('0x86')]){this[_0x9e20('0x12')][_0x49c133['queue']][_0x9e20('0x56')]+=0x1;this['voiceQueues'][_0x49c133[_0x9e20('0x6c')]]['sumBillable']+=moment()[_0x9e20('0xc8')](0x0)['diff'](_0x49c133[_0x9e20('0x90')],_0x9e20('0xa1'));_0x49c133['queuecallercompleteAt']=moment()['format'](_0x9e20('0x7c'));_0x49c133['queuecallerexit']=![];_0x49c133['queuecallerexitAt']=null;}if(_0x49c133[_0x9e20('0x9e')]&&_0x49c133['transfer']!=!![]){_0x49c133['lastevent']=_0x9e20('0xc6');logger[_0x9e20('0x47')](_0x9e20('0xc9'),_0x167eac,util[_0x9e20('0x40')](_0x49c133,{'showHidden':![],'depth':null}));ami[_0x9e20('0x45')]('custom:queuecallerunmanaged',_0x49c133);}if(_0x49c133['queuecallerabandon']){_0x49c133[_0x9e20('0xae')]=_0x9e20('0x5c');logger[_0x9e20('0x47')](_0x9e20('0xca'),_0x167eac,util['inspect'](_0x49c133,{'showHidden':![],'depth':null}));ami[_0x9e20('0x45')](_0x9e20('0xcb'),_0x49c133);}}else{this['voiceQueues'][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x59')]+=this[_0x9e20('0x12')][_0x49c133[_0x9e20('0x6c')]][_0x9e20('0x5a')];}logger[_0x9e20('0x6e')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x167eac,_0x49c133[_0x9e20('0x4b')],_0x49c133[_0x9e20('0x53')],_0x3e9616);if(_0x18879e&&_0x49c133[_0x9e20('0x4f')]===_0x9e20('0x50')){_0x49c133[_0x9e20('0x4f')]=_0x9e20('0xcc');}this[_0x9e20('0x36')][_0x167eac]=_0x49c133;this[_0x9e20('0x43')](_0x49c133,_0x9e20('0xcd'));this[_0x9e20('0x52')](this[_0x9e20('0x12')][_0x49c133['queue']],_0x9e20('0xcd'));}}logger['debug'](_0x9e20('0xce'),_0x167eac,util[_0x9e20('0x40')](this[_0x9e20('0xf')][_0x167eac],{'showHidden':![],'depth':null}));ami[_0x9e20('0x45')](_0x9e20('0xcf'),this[_0x9e20('0xf')][_0x167eac]);if(_0x49c133[_0x9e20('0x4f')]===_0x9e20('0x50'))return;delete this[_0x9e20('0xf')][_0x167eac];delete this[_0x9e20('0x36')][_0x167eac];if(this[_0x9e20('0x14')][_0x167eac]){delete this[_0x9e20('0x14')][_0x167eac];}};VoiceQueueReport['prototype']['syncHangup']=function(_0x475967){try{if(this[_0x9e20('0x65')](_0x475967)){logger[_0x9e20('0x47')](_0x9e20('0xd0'),_0x475967[_0x9e20('0x79')],util['inspect'](_0x475967,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x475967[_0x9e20('0x79')]]){return this['handleHangup'](_0x475967[_0x9e20('0x79')],_0x475967[_0x9e20('0xd1')]);}if(this[_0x9e20('0xf')][_0x475967[_0x9e20('0x9d')]]){if(_0x475967[_0x9e20('0xd2')]==='21'){return;}return this[_0x9e20('0xc5')](_0x475967[_0x9e20('0x9d')],_0x475967['cause-txt'],!![]);}var _0x5ea785=Object[_0x9e20('0x82')](this[_0x9e20('0xf')]);for(var _0x363ed8=0x0;_0x363ed8<_0x5ea785[_0x9e20('0xd3')];_0x363ed8++){var _0x339df2=_[_0x9e20('0x85')](this['queueReports'][_0x5ea785[_0x363ed8]]);if(_0x339df2&&_0x339df2[_0x9e20('0xd4')]===_0x475967[_0x9e20('0x79')]){return this[_0x9e20('0xc5')](_0x339df2[_0x9e20('0x79')],_0x475967[_0x9e20('0xd1')],!![]);}}}}catch(_0x9e39ee){logger['error'](_0x9e20('0xd0'),_0x475967[_0x9e20('0x79')],util['inspect'](_0x9e39ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')]['syncAttendedTransfer']=function(_0x1da9f7){try{if(this[_0x9e20('0x65')](_0x1da9f7)){logger['debug'](_0x9e20('0xd5'),_0x1da9f7[_0x9e20('0x79')],util['inspect'](_0x1da9f7,{'showHidden':![],'depth':null}));var _0x5828c7;var _0x2de3d9;var _0x321d17;if(this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd6')]]){_0x5828c7=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd6')]]);_0x5828c7['transferexten']=_0x1da9f7['secondtransfererexten'];_0x5828c7[_0x9e20('0xd7')]=_0x1da9f7[_0x9e20('0xd8')];_0x5828c7[_0x9e20('0x4f')]=_0x9e20('0x50');_0x5828c7[_0x9e20('0x97')]=!![];_0x5828c7[_0x9e20('0xd9')]=_0x9e20('0xda');if(this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd8')]]){_0x321d17=this['queueReports'][_0x1da9f7[_0x9e20('0xd8')]];this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd8')]]=this[_0x9e20('0xf')][_0x1da9f7['transfereeuniqueid']];this['queueReports'][_0x1da9f7[_0x9e20('0xd6')]]=_0x321d17;_0x2de3d9=_['last'](this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd6')]]);_0x2de3d9['switch']=!![];}logger[_0x9e20('0x6e')](_0x9e20('0xdb'),_0x1da9f7[_0x9e20('0x79')],_0x5828c7[_0x9e20('0x4b')],_0x5828c7[_0x9e20('0x53')],_0x5828c7[_0x9e20('0xdc')],_0x5828c7['transferuniqueid']);}else if(this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xdd')]]){_0x5828c7=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xdd')]]);_0x5828c7[_0x9e20('0xdc')]=_0x1da9f7['origtransfererexten'];_0x5828c7['transferuniqueid']=_0x1da9f7[_0x9e20('0xde')];_0x5828c7[_0x9e20('0x4f')]=_0x9e20('0x50');_0x5828c7['transfer']=!![];_0x5828c7[_0x9e20('0xd9')]='ATTENDED';if(this[_0x9e20('0xf')][_0x1da9f7['origtransfereruniqueid']]){_0x321d17=this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xde')]];this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xde')]]=this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xdd')]];this[_0x9e20('0xf')][_0x1da9f7['transfertargetuniqueid']]=_0x321d17;_0x2de3d9=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xdd')]]);_0x2de3d9[_0x9e20('0x37')]=!![];}logger[_0x9e20('0x6e')](_0x9e20('0xdb'),_0x1da9f7[_0x9e20('0x79')],_0x5828c7[_0x9e20('0x4b')],_0x5828c7[_0x9e20('0x53')],_0x5828c7[_0x9e20('0xdc')],_0x5828c7[_0x9e20('0xd7')]);}else if(this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xde')]]){_0x5828c7=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1da9f7['origtransfereruniqueid']]);_0x5828c7['transferexten']=_0x1da9f7['origtransfererexten'];_0x5828c7[_0x9e20('0xd7')]=_0x1da9f7[_0x9e20('0xde')];_0x5828c7[_0x9e20('0x4f')]=_0x9e20('0x50');_0x5828c7[_0x9e20('0x97')]=!![];_0x5828c7[_0x9e20('0xd9')]='ATTENDED';_0x5828c7[_0x9e20('0x37')]=!![];_0x5828c7[_0x9e20('0xd4')]=_0x1da9f7[_0x9e20('0xd6')];}else if(this['queueReports'][_0x1da9f7[_0x9e20('0xd8')]]){_0x5828c7=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1da9f7[_0x9e20('0xd8')]]);_0x5828c7['transferexten']=_0x1da9f7[_0x9e20('0xdf')];_0x5828c7['transferuniqueid']=_0x1da9f7[_0x9e20('0xd8')];_0x5828c7[_0x9e20('0x4f')]=_0x9e20('0x50');_0x5828c7[_0x9e20('0x97')]=!![];_0x5828c7[_0x9e20('0xd9')]='ATTENDED';_0x5828c7['switch']=!![];_0x5828c7[_0x9e20('0xd4')]=_0x1da9f7[_0x9e20('0xdd')];}}}catch(_0x52ae6e){logger[_0x9e20('0x3e')](_0x9e20('0xd5'),_0x1da9f7[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x52ae6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x2c')]=function(_0x33f85c){try{if(this[_0x9e20('0x65')](_0x33f85c)){logger[_0x9e20('0x47')](_0x9e20('0xe0'),_0x33f85c[_0x9e20('0x79')],util['inspect'](_0x33f85c,{'showHidden':![],'depth':null}));if(this[_0x9e20('0xf')][_0x33f85c[_0x9e20('0xd6')]]){var _0x5307f3=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x33f85c[_0x9e20('0xd6')]]);_0x5307f3[_0x9e20('0x4f')]=_0x9e20('0xe1');_0x5307f3[_0x9e20('0x97')]=!![];_0x5307f3[_0x9e20('0xd9')]=_0x9e20('0xe2');_0x5307f3[_0x9e20('0xdc')]=_0x33f85c[_0x9e20('0xe3')];_0x5307f3[_0x9e20('0xd7')]=_0x33f85c['transfereeuniqueid'];logger[_0x9e20('0x6e')](_0x9e20('0xe4'),_0x33f85c[_0x9e20('0x79')],_0x5307f3[_0x9e20('0x4b')],_0x5307f3[_0x9e20('0x53')],_0x5307f3['transferexten'],_0x5307f3[_0x9e20('0xd7')]);this['syncHangup']({'event':_0x9e20('0xe5'),'uniqueid':_0x33f85c[_0x9e20('0xd6')],'context':_0x33f85c[_0x9e20('0xe6')],'channel':_0x33f85c[_0x9e20('0xe7')]});}}}catch(_0x539401){logger[_0x9e20('0x3e')](_0x9e20('0xe0'),_0x33f85c[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x539401,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')][_0x9e20('0x27')]=function(_0x1671b7){try{if(this[_0x9e20('0x65')](_0x1671b7)){logger[_0x9e20('0x47')](_0x9e20('0xe8'),_0x1671b7[_0x9e20('0x79')],util['inspect'](_0x1671b7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1671b7['uniqueid']]){var _0x6b7ad0=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x1671b7[_0x9e20('0x79')]]);if(!_[_0x9e20('0xc3')](_0x6b7ad0['queuecallerleaveAt'])){_0x6b7ad0[_0x9e20('0xe9')]=moment()['format'](_0x9e20('0x7c'));logger[_0x9e20('0x6e')](_0x9e20('0xea'),_0x1671b7[_0x9e20('0x79')],_0x6b7ad0['mohstarttime']);}}}}catch(_0x53557d){logger[_0x9e20('0x3e')]('[%s][voiceQueueReport][musiconholdstart]',_0x1671b7[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x53557d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')]['syncMusicOnHoldStop']=function(_0x711d29){try{if(this[_0x9e20('0x65')](_0x711d29)){logger['debug'](_0x9e20('0xeb'),_0x711d29['uniqueid'],util[_0x9e20('0x40')](_0x711d29,{'showHidden':![],'depth':null}));if(this[_0x9e20('0xf')][_0x711d29[_0x9e20('0x79')]]){var _0x27fd84=_[_0x9e20('0x85')](this[_0x9e20('0xf')][_0x711d29[_0x9e20('0x79')]]);if(!_[_0x9e20('0xc3')](_0x27fd84[_0x9e20('0xe9')])){_0x27fd84[_0x9e20('0xec')]+=moment()[_0x9e20('0xc8')](0x0)[_0x9e20('0xc7')](_0x27fd84[_0x9e20('0xe9')],_0x9e20('0xa1'));logger[_0x9e20('0x6e')](_0x9e20('0xed'),_0x711d29[_0x9e20('0x79')],_0x27fd84[_0x9e20('0xec')]);delete _0x27fd84['mohstarttime'];}}}}catch(_0x4eb03e){logger[_0x9e20('0x3e')](_0x9e20('0xeb'),_0x711d29[_0x9e20('0x79')],util[_0x9e20('0x40')](_0x4eb03e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9e20('0xb')]['syncNewExten']=function(_0x495f1a){try{if(this[_0x9e20('0x65')](_0x495f1a)){logger['debug']('[%s][voiceQueueReport][newexten]\x20event:',_0x495f1a['uniqueid'],util[_0x9e20('0x40')](_0x495f1a,{'showHidden':![],'depth':null}));if(_0x495f1a['application']['toLowerCase']()==='set'){_0x495f1a[_0x9e20('0xee')]=_0x495f1a[_0x9e20('0xef')]&&_0x495f1a[_0x9e20('0xef')][_0x9e20('0x9a')](_0x9e20('0xf0'))?_0x495f1a[_0x9e20('0xef')]:(_0x495f1a[_0x9e20('0xef')]||_0x495f1a[_0x9e20('0xee')])['toLowerCase']();if(_[_0x9e20('0x9a')](_0x495f1a['applicationdata'][_0x9e20('0xf1')](),_0x9e20('0xf2'))){logger['info'](_0x9e20('0xf3'),_0x495f1a['uniqueid'],_0x495f1a[_0x9e20('0xf4')],_0x495f1a['applicationdata']);if(_[_0x9e20('0x7a')](this[_0x9e20('0x36')][_0x495f1a[_0x9e20('0x79')]]))this[_0x9e20('0x36')][_0x495f1a[_0x9e20('0x79')]]={};var _0x398d05=_0x495f1a[_0x9e20('0xee')][_0x9e20('0xf5')]('=');var _0x764bcf=_0x398d05[0x0][_0x9e20('0xf1')]()['match'](/cdr\((.*)\)/);if(_0x764bcf)this[_0x9e20('0x36')][_0x495f1a[_0x9e20('0x79')]][_0x764bcf[0x1]]=_0x398d05[0x1];}}}}catch(_0x4a6589){logger[_0x9e20('0x3e')](_0x9e20('0xf6'),_0x495f1a['uniqueid'],util[_0x9e20('0x40')](_0x4a6589,{'showHidden':![],'depth':null}));}};module[_0x9e20('0xf7')]=VoiceQueueReport;
\ No newline at end of file
index cd24efe..42928da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xad7f=['../client','createHistory','campaign','queue','Request','CreateReportAgentPreview'];(function(_0x142cf2,_0x2c1eab){var _0x311512=function(_0x44ce51){while(--_0x44ce51){_0x142cf2['push'](_0x142cf2['shift']());}};_0x311512(++_0x2c1eab);}(_0xad7f,0x192));var _0xfad7=function(_0x470cdd,_0x4708cd){_0x470cdd=_0x470cdd-0x0;var _0x57fda7=_0xad7f[_0x470cdd];return _0x57fda7;};'use strict';var client=require(_0xfad7('0x0'));exports[_0xfad7('0x1')]=function(_0x397051){return function(){_0x397051[_0xfad7('0x2')]=_0x397051[_0xfad7('0x3')];return client[_0xfad7('0x4')](_0xfad7('0x5'),{'body':_0x397051,'log':_0xfad7('0x5')});};};
\ No newline at end of file
+var _0xa4bb=['queue','CreateReportAgentPreview','../client','createHistory','campaign'];(function(_0x50406a,_0x2871ee){var _0xe06568=function(_0xa087a){while(--_0xa087a){_0x50406a['push'](_0x50406a['shift']());}};_0xe06568(++_0x2871ee);}(_0xa4bb,0x18d));var _0xba4b=function(_0x543040,_0x462206){_0x543040=_0x543040-0x0;var _0x10930d=_0xa4bb[_0x543040];return _0x10930d;};'use strict';var client=require(_0xba4b('0x0'));exports[_0xba4b('0x1')]=function(_0x8bc19a){return function(){_0x8bc19a[_0xba4b('0x2')]=_0x8bc19a[_0xba4b('0x3')];return client['Request'](_0xba4b('0x4'),{'body':_0x8bc19a,'log':_0xba4b('0x4')});};};
\ No newline at end of file
index 50540a4..0c33246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9731=['CreateAttachment','create','Request'];(function(_0x191ab5,_0x5cb3d1){var _0x3b0a67=function(_0x3589e9){while(--_0x3589e9){_0x191ab5['push'](_0x191ab5['shift']());}};_0x3b0a67(++_0x5cb3d1);}(_0x9731,0x1a5));var _0x1973=function(_0x5b805d,_0x5d9219){_0x5b805d=_0x5b805d-0x0;var _0x286618=_0x9731[_0x5b805d];return _0x286618;};'use strict';var client=require('../client');exports[_0x1973('0x0')]=function(_0x221341){return client[_0x1973('0x1')](_0x1973('0x2'),{'body':_0x221341,'log':_0x1973('0x2')});};
\ No newline at end of file
+var _0x7903=['CreateAttachment','../client','Request'];(function(_0x42e887,_0xb41bb9){var _0x4e610b=function(_0x26e9ed){while(--_0x26e9ed){_0x42e887['push'](_0x42e887['shift']());}};_0x4e610b(++_0xb41bb9);}(_0x7903,0xe2));var _0x3790=function(_0xe80da4,_0x3e9bfc){_0xe80da4=_0xe80da4-0x0;var _0x5cef6c=_0x7903[_0xe80da4];return _0x5cef6c;};'use strict';var client=require(_0x3790('0x0'));exports['create']=function(_0xab0359){return client[_0x3790('0x1')](_0x3790('0x2'),{'body':_0xab0359,'log':_0x3790('0x2')});};
\ No newline at end of file
index a55640f..a1c80f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialCutDigit','Trunk','callerid','active','TrunkBackup','Interval','SquareProject','getCampaign','getCampaigns','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength'];(function(_0x5a5ff0,_0x1abbbc){var _0x342e90=function(_0x139e44){while(--_0x139e44){_0x5a5ff0['push'](_0x5a5ff0['shift']());}};_0x342e90(++_0x1abbbc);}(_0xadb5,0xad));var _0x5adb=function(_0x41e6f0,_0x350844){_0x41e6f0=_0x41e6f0-0x0;var _0xd7d5ac=_0xadb5[_0x41e6f0];return _0xd7d5ac;};'use strict';var client=require('../client');exports[_0x5adb('0x0')]=function(){return function(){return client['Request'](_0x5adb('0x1'),{'options':{'raw':![],'attributes':['id',_0x5adb('0x2'),_0x5adb('0x3'),'active',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'dialOriginateTimeout',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'dialAMDActive',_0x5adb('0x18'),'dialAMDGreeting',_0x5adb('0x19'),'dialAMDTotalAnalysisTime',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'dialAMDSilenceThreshold',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'dialRandomLastDigitCallerIdNumber',_0x5adb('0x20')],'include':[{'model':'Trunk','as':_0x5adb('0x21'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':_0x5adb('0x21'),'as':_0x5adb('0x24'),'attributes':['id',_0x5adb('0x2'),_0x5adb('0x22'),_0x5adb('0x23')]},{'model':'Interval','as':_0x5adb('0x25'),'attributes':['id','name'],'include':[{'model':_0x5adb('0x25'),'as':'Intervals','attributes':['id',_0x5adb('0x2'),'interval']}]},{'model':'SquareProject','as':_0x5adb('0x26'),'attributes':['id',_0x5adb('0x2')]}]},'log':_0x5adb('0x27')});};};
\ No newline at end of file
+var _0xdb28=['dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','name','callerid','Interval','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialTimezone','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt'];(function(_0x17736a,_0x10db71){var _0x4a12c1=function(_0xe8649){while(--_0xe8649){_0x17736a['push'](_0x17736a['shift']());}};_0x4a12c1(++_0x10db71);}(_0xdb28,0x106));var _0x8db2=function(_0x3060c6,_0x2c70c4){_0x3060c6=_0x3060c6-0x0;var _0x5cd761=_0xdb28[_0x3060c6];return _0x5cd761;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(){return function(){return client[_0x8db2('0x2')](_0x8db2('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8db2('0x4'),_0x8db2('0x5'),_0x8db2('0x6'),_0x8db2('0x7'),_0x8db2('0x8'),'dialOriginateTimeout',_0x8db2('0x9'),_0x8db2('0xa'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8db2('0xb'),_0x8db2('0xc'),_0x8db2('0xd'),_0x8db2('0xe'),_0x8db2('0xf'),_0x8db2('0x10'),_0x8db2('0x11'),'dialAbandonedMaxRetry',_0x8db2('0x12'),_0x8db2('0x13'),_0x8db2('0x14'),'dialAgentRejectMaxRetry',_0x8db2('0x15'),_0x8db2('0x16'),'dialGlobalInterval',_0x8db2('0x17'),_0x8db2('0x18'),_0x8db2('0x19'),_0x8db2('0x1a'),_0x8db2('0x1b'),'dialAMDMinWordLength','dialAMDBetweenWordsSilence',_0x8db2('0x1c'),_0x8db2('0x1d'),_0x8db2('0x1e'),_0x8db2('0x1f'),_0x8db2('0x20'),_0x8db2('0x21'),_0x8db2('0x22')],'include':[{'model':_0x8db2('0x23'),'as':_0x8db2('0x23'),'attributes':['id',_0x8db2('0x24'),'callerid',_0x8db2('0x5')]},{'model':_0x8db2('0x23'),'as':'TrunkBackup','attributes':['id',_0x8db2('0x24'),_0x8db2('0x25'),_0x8db2('0x5')]},{'model':_0x8db2('0x26'),'as':_0x8db2('0x26'),'attributes':['id',_0x8db2('0x24')],'include':[{'model':'Interval','as':'Intervals','attributes':['id',_0x8db2('0x24'),_0x8db2('0x27')]}]},{'model':_0x8db2('0x28'),'as':_0x8db2('0x28'),'attributes':['id','name']}]},'log':_0x8db2('0x29')});};};
\ No newline at end of file
index e600fc8..a8c824d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e6=['GetCmContact','../client','createContact','CreateCmContact','Request'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x24e6,0x97));var _0x624e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x24e6[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0x624e('0x0'));exports[_0x624e('0x1')]=function(_0x4ce483){return function(){return client['Request']('CreateCmContact',{'body':_0x4ce483,'log':_0x624e('0x2')});};};exports['getContacts']=function(_0x286382){return function(){return client[_0x624e('0x3')]('GetCmContact',{'options':_0x286382,'log':_0x624e('0x4')});};};
\ No newline at end of file
+var _0x2849=['../client','Request','CreateCmContact','GetCmContact'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0x2849,0xdc));var _0x9284=function(_0x89209a,_0x2f8746){_0x89209a=_0x89209a-0x0;var _0x8f69b8=_0x2849[_0x89209a];return _0x8f69b8;};'use strict';var client=require(_0x9284('0x0'));exports['createContact']=function(_0x5c9cee){return function(){return client[_0x9284('0x1')](_0x9284('0x2'),{'body':_0x5c9cee,'log':_0x9284('0x2')});};};exports['getContacts']=function(_0x400046){return function(){return client[_0x9284('0x1')](_0x9284('0x3'),{'options':_0x400046,'log':_0x9284('0x3')});};};
\ No newline at end of file
index 8f15613..c8dcbb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x041b=['name','unlockContact','getContactRecallMe','GetContactRecallMe','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','../client','moment','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','UpdateCmHopper','ContactId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','format','YYYY-MM-DD\x20HH:mm:ss','priority','DESC','scheduledat','ASC','moveContactManagedDialer','campaign','queue','ListId','VoiceQueueId','CampaignId','countReScheduled','CountReScheduled','GetCmHopperPreview','User','Agent','VoiceQueue','Queue'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x041b,0x159));var _0xb041=function(_0x2a6e66,_0x558e15){_0x2a6e66=_0x2a6e66-0x0;var _0x5aa55c=_0x041b[_0x2a6e66];return _0x5aa55c;};'use strict';var client=require(_0xb041('0x0'));var moment=require(_0xb041('0x1'));exports['getContacts']=function(_0x100477,_0x4060ff){return function(){return client[_0xb041('0x2')](_0xb041('0x3'),{'options':{'where':{'VoiceQueueId':_0x100477},'include':[{'model':_0xb041('0x4'),'as':_0xb041('0x5')}],'limit':_0x4060ff,'raw':![]},'log':_0xb041('0x6')});};};exports[_0xb041('0x7')]=function(_0x4e5692,_0x150a1e,_0x13aa51){return function(){return client[_0xb041('0x2')](_0xb041('0x8'),{'body':_0x4e5692,'options':{'where':{'VoiceQueueId':_0x150a1e,'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x13aa51},'log':_0xb041('0x8')});};};exports['rescheduleContact']=function(_0xe57442){return function(){return client[_0xb041('0x2')](_0xb041('0x8'),{'body':_0xe57442,'options':{'where':{'ContactId':_0xe57442[_0xb041('0x9')],'ListId':_0xe57442['ListId'],'VoiceQueueId':_0xe57442['VoiceQueueId'],'CampaignId':_0xe57442['CampaignId']}},'log':'rescheduleContact'});};};exports[_0xb041('0xa')]=function(_0x3a9698,_0x270b82,_0x5c129a){return function(){return client[_0xb041('0x2')](_0xb041('0xb'),{'options':{'where':{'VoiceQueueId':_0x3a9698,'ListId':_0x270b82,'ContactId':_0x5c129a}},'log':'DestroyCmHopper'});};};exports[_0xb041('0xc')]=function(_0x565848,_0x74008d,_0x3339c0,_0x5db040){return function(){return client[_0xb041('0x2')](_0xb041('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x565848,'active':![],'scheduledat':{'$lte':moment()[_0xb041('0xe')](_0xb041('0xf'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x74008d}}]},'order':[[_0xb041('0x10'),_0xb041('0x11')],[_0xb041('0x12'),_0x5db040],['id',_0xb041('0x13')]],'raw':!![],'limit':_0x3339c0},'log':'GetContactDialer'});};};exports['getContactDialerIvr']=function(_0x2d63c8,_0x98603,_0x425461){return function(){return client[_0xb041('0x2')](_0xb041('0xd'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2d63c8,'active':![],'scheduledat':{'$lte':moment()[_0xb041('0xe')](_0xb041('0xf'))}},'include':[{'model':_0xb041('0x4'),'as':_0xb041('0x5')}],'order':[[_0xb041('0x10'),'DESC'],['scheduledat',_0x425461],['id','ASC']],'raw':!![],'limit':_0x98603},'log':'GetContactDialerIvr'});};};exports[_0xb041('0x14')]=function(_0x24913b,_0x56f841){return function(){_0x24913b[_0xb041('0x15')]=_0x24913b[_0xb041('0x16')];return client[_0xb041('0x2')]('MoveContactManagedDialer',{'body':_0x24913b,'options':{'where':{'ContactId':_0x24913b[_0xb041('0x9')],'ListId':_0x24913b[_0xb041('0x17')],'VoiceQueueId':_0x24913b[_0xb041('0x18')],'CampaignId':_0x24913b[_0xb041('0x19')],'active':_0x56f841?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0xb041('0x1a')]=function(_0x2b9c21){return function(){return client[_0xb041('0x2')](_0xb041('0x1b'),{'options':{'where':{'VoiceQueueId':_0x2b9c21['id']?_0x2b9c21['id']||null:null}},'log':_0xb041('0x1a')});};};exports['getContactPreview']=function(_0x330ccc){return function(){return client[_0xb041('0x2')](_0xb041('0x1c'),{'options':{'where':{'id':_0x330ccc},'include':[{'model':_0xb041('0x4'),'as':'Contact'},{'model':_0xb041('0x1d'),'as':_0xb041('0x1e'),'attributes':['id','name']},{'model':_0xb041('0x1f'),'as':_0xb041('0x20'),'attributes':['id',_0xb041('0x21')]}],'raw':!![]},'log':_0xb041('0x6')});};};exports[_0xb041('0x22')]=function(_0x227740,_0x109695,_0x27f07e){return function(){return client[_0xb041('0x2')](_0xb041('0x8'),{'body':_0x227740,'options':{'where':{'id':_0x109695},'limit':_0x27f07e},'log':'UpdateCmHopper'});};};exports[_0xb041('0x23')]=function(_0x5b8af3,_0x4d768b){return function(){return client[_0xb041('0x2')](_0xb041('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5b8af3,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0xb041('0xf'))},'UserId':{'$in':_0x4d768b}},'order':[[_0xb041('0x10'),_0xb041('0x11')],[_0xb041('0x12'),'DESC'],['id','ASC']],'include':[{'model':_0xb041('0x4'),'as':_0xb041('0x5')},{'model':_0xb041('0x1d'),'as':_0xb041('0x1e'),'attributes':['id','name',_0xb041('0x25')]}],'group':_0xb041('0x26'),'raw':!![]},'log':'GetContactDialer'});};};exports[_0xb041('0x27')]=function(_0x595808){return function(){return client['Request'](_0xb041('0x28'),{'body':_0x595808,'options':{},'log':_0xb041('0x28')});};};exports[_0xb041('0x29')]=function(_0x2f079f,_0x4843a3,_0x3cce5d){return function(){return client[_0xb041('0x2')]('CmHopperHandlePreviewRecallNotifications',{'body':{'where':{'voiceQueueIds':_0x2f079f,'interval':_0x4843a3,'availableAgentsIds':_0x3cce5d}},'log':_0xb041('0x29')});};};
\ No newline at end of file
+var _0x3e56=['unlockContact','getContactRecallMe','GetContactRecallMe','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','CmContact','Contact','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','CampaignId','destroyContact','DestroyCmHopper','getContactDialer','GetContactDialer','priority','scheduledat','ASC','getContactDialerIvr','DESC','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','VoiceQueueId','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','Agent','Queue','getCmHopper'];(function(_0x5b7c76,_0x1e23a9){var _0x392bca=function(_0x891b6f){while(--_0x891b6f){_0x5b7c76['push'](_0x5b7c76['shift']());}};_0x392bca(++_0x1e23a9);}(_0x3e56,0xc0));var _0x63e5=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x3e56[_0x1daaa9];return _0x1dd221;};'use strict';var client=require(_0x63e5('0x0'));var moment=require(_0x63e5('0x1'));exports[_0x63e5('0x2')]=function(_0x18858d,_0x5906e2){return function(){return client[_0x63e5('0x3')](_0x63e5('0x4'),{'options':{'where':{'VoiceQueueId':_0x18858d},'include':[{'model':_0x63e5('0x5'),'as':_0x63e5('0x6')}],'limit':_0x5906e2,'raw':![]},'log':'getCmHopper'});};};exports[_0x63e5('0x7')]=function(_0x23cdef,_0x3163a4,_0x57d714){return function(){return client[_0x63e5('0x3')](_0x63e5('0x8'),{'body':_0x23cdef,'options':{'where':{'VoiceQueueId':_0x3163a4,'scheduledat':{'$lte':moment()[_0x63e5('0x9')](_0x63e5('0xa'))}},'limit':_0x57d714},'log':'UpdateCmHopper'});};};exports[_0x63e5('0xb')]=function(_0x3d54b2){return function(){return client[_0x63e5('0x3')]('UpdateCmHopper',{'body':_0x3d54b2,'options':{'where':{'ContactId':_0x3d54b2[_0x63e5('0xc')],'ListId':_0x3d54b2[_0x63e5('0xd')],'VoiceQueueId':_0x3d54b2['VoiceQueueId'],'CampaignId':_0x3d54b2[_0x63e5('0xe')]}},'log':_0x63e5('0xb')});};};exports[_0x63e5('0xf')]=function(_0x17c235,_0x50ee02,_0x31bf6b){return function(){return client[_0x63e5('0x3')](_0x63e5('0x10'),{'options':{'where':{'VoiceQueueId':_0x17c235,'ListId':_0x50ee02,'ContactId':_0x31bf6b}},'log':_0x63e5('0x10')});};};exports[_0x63e5('0x11')]=function(_0x5d7307,_0xc2776d,_0xcd6cd8,_0x33d486){return function(){return client[_0x63e5('0x3')](_0x63e5('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x5d7307,'active':![],'scheduledat':{'$lte':moment()[_0x63e5('0x9')](_0x63e5('0xa'))},'$or':[{'UserId':null},{'UserId':{'$in':_0xc2776d}}]},'order':[[_0x63e5('0x13'),'DESC'],[_0x63e5('0x14'),_0x33d486],['id',_0x63e5('0x15')]],'raw':!![],'limit':_0xcd6cd8},'log':_0x63e5('0x12')});};};exports[_0x63e5('0x16')]=function(_0x1eedf0,_0x133e32,_0x32d2b1){return function(){return client[_0x63e5('0x3')](_0x63e5('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1eedf0,'active':![],'scheduledat':{'$lte':moment()[_0x63e5('0x9')]('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':_0x63e5('0x6')}],'order':[[_0x63e5('0x13'),_0x63e5('0x17')],[_0x63e5('0x14'),_0x32d2b1],['id',_0x63e5('0x15')]],'raw':!![],'limit':_0x133e32},'log':_0x63e5('0x18')});};};exports[_0x63e5('0x19')]=function(_0xf6c979,_0x199fd8){return function(){_0xf6c979[_0x63e5('0x1a')]=_0xf6c979[_0x63e5('0x1b')];return client[_0x63e5('0x3')](_0x63e5('0x1c'),{'body':_0xf6c979,'options':{'where':{'ContactId':_0xf6c979['ContactId'],'ListId':_0xf6c979[_0x63e5('0xd')],'VoiceQueueId':_0xf6c979[_0x63e5('0x1d')],'CampaignId':_0xf6c979['CampaignId'],'active':_0x199fd8?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x63e5('0x1e')]=function(_0x44976a){return function(){return client['Request'](_0x63e5('0x1f'),{'options':{'where':{'VoiceQueueId':_0x44976a['id']?_0x44976a['id']||null:null}},'log':'countReScheduled'});};};exports[_0x63e5('0x20')]=function(_0x415d87){return function(){return client[_0x63e5('0x3')](_0x63e5('0x21'),{'options':{'where':{'id':_0x415d87},'include':[{'model':_0x63e5('0x5'),'as':_0x63e5('0x6')},{'model':_0x63e5('0x22'),'as':_0x63e5('0x23'),'attributes':['id','name']},{'model':'VoiceQueue','as':_0x63e5('0x24'),'attributes':['id','name']}],'raw':!![]},'log':_0x63e5('0x25')});};};exports[_0x63e5('0x26')]=function(_0x187287,_0x570033,_0x147085){return function(){return client['Request']('UpdateCmHopper',{'body':_0x187287,'options':{'where':{'id':_0x570033},'limit':_0x147085},'log':_0x63e5('0x8')});};};exports[_0x63e5('0x27')]=function(_0x123b32,_0x1ac804){return function(){return client[_0x63e5('0x3')](_0x63e5('0x28'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x123b32,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x63e5('0x9')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x1ac804}},'order':[[_0x63e5('0x13'),'DESC'],[_0x63e5('0x14'),_0x63e5('0x17')],['id',_0x63e5('0x15')]],'include':[{'model':_0x63e5('0x5'),'as':_0x63e5('0x6')},{'model':_0x63e5('0x22'),'as':'Agent','attributes':['id','name','voicePause']}],'group':_0x63e5('0x29'),'raw':!![]},'log':'GetContactDialer'});};};exports[_0x63e5('0x2a')]=function(_0x35630f){return function(){return client[_0x63e5('0x3')]('ResetActiveCalls',{'body':_0x35630f,'options':{},'log':_0x63e5('0x2b')});};};exports[_0x63e5('0x2c')]=function(_0x7bbb1b,_0x4989a0,_0x3defa5){return function(){return client[_0x63e5('0x3')](_0x63e5('0x2d'),{'body':{'where':{'voiceQueueIds':_0x7bbb1b,'interval':_0x4989a0,'availableAgentsIds':_0x3defa5}},'log':'handlePreviewRecallNotifications'});};};
\ No newline at end of file
index 6ab5690..4ab77c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53c8=['../client','moment','verifyAdditionalPhones','Request','VerifyAdditionalPhones','SwapAdditionalPhones','IncrementPreviewCounters'];(function(_0x98fd67,_0x4abe55){var _0x15b8c3=function(_0x42d96c){while(--_0x42d96c){_0x98fd67['push'](_0x98fd67['shift']());}};_0x15b8c3(++_0x4abe55);}(_0x53c8,0x103));var _0x853c=function(_0x528bb5,_0x119c5b){_0x528bb5=_0x528bb5-0x0;var _0x58e8ca=_0x53c8[_0x528bb5];return _0x58e8ca;};'use strict';var client=require(_0x853c('0x0'));var moment=require(_0x853c('0x1'));exports[_0x853c('0x2')]=function(_0x488d97,_0x126a6a,_0x30d98f){return function(){return client[_0x853c('0x3')](_0x853c('0x4'),{'body':_0x488d97,'reason':_0x126a6a,'entity':_0x30d98f,'log':_0x853c('0x4')});};};exports['swapAdditionalPhones']=function(_0x53c739,_0x196783,_0x36dde3){return function(){return client['Request']('SwapAdditionalPhones',{'body':_0x53c739,'duration':_0x196783,'waitTime':_0x36dde3,'log':_0x853c('0x5')});};};exports['incrementPreviewCounters']=function(_0x90f280){return function(){return client[_0x853c('0x3')](_0x853c('0x6'),{'body':_0x90f280,'log':_0x853c('0x6')});};};
\ No newline at end of file
+var _0x75fe=['incrementPreviewCounters','IncrementPreviewCounters','../client','Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones'];(function(_0x2fbd7b,_0x50cc07){var _0x5b7737=function(_0x4c5fdf){while(--_0x4c5fdf){_0x2fbd7b['push'](_0x2fbd7b['shift']());}};_0x5b7737(++_0x50cc07);}(_0x75fe,0x79));var _0xe75f=function(_0x26ce45,_0x3e896c){_0x26ce45=_0x26ce45-0x0;var _0x148f39=_0x75fe[_0x26ce45];return _0x148f39;};'use strict';var client=require(_0xe75f('0x0'));var moment=require('moment');exports['verifyAdditionalPhones']=function(_0x483ac0,_0x586403,_0x3ecea1){return function(){return client[_0xe75f('0x1')]('VerifyAdditionalPhones',{'body':_0x483ac0,'reason':_0x586403,'entity':_0x3ecea1,'log':_0xe75f('0x2')});};};exports[_0xe75f('0x3')]=function(_0x5f1361,_0x10c672,_0x79c096){return function(){return client[_0xe75f('0x1')](_0xe75f('0x4'),{'body':_0x5f1361,'duration':_0x10c672,'waitTime':_0x79c096,'log':_0xe75f('0x4')});};};exports[_0xe75f('0x5')]=function(_0x497070){return function(){return client[_0xe75f('0x1')]('IncrementPreviewCounters',{'body':_0x497070,'log':_0xe75f('0x6')});};};
\ No newline at end of file
index 0cf0d23..c8a86c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb279=['../client','checkIsBlackList','GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','Request','CampaignId'];(function(_0x17766a,_0x5c94f2){var _0x2b1e3f=function(_0x50c481){while(--_0x50c481){_0x17766a['push'](_0x17766a['shift']());}};_0x2b1e3f(++_0x5c94f2);}(_0xb279,0xc8));var _0x9b27=function(_0x4ff697,_0x3b6fd9){_0x4ff697=_0x4ff697-0x0;var _0x1923bb=_0xb279[_0x4ff697];return _0x1923bb;};'use strict';var client=require(_0x9b27('0x0'));exports[_0x9b27('0x1')]=function(_0xe39bb7){return function(){return client['Request'](_0x9b27('0x2'),{'options':{'where':{'VoiceQueueId':_0xe39bb7[_0x9b27('0x3')],'phone':_0xe39bb7[_0x9b27('0x4')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x9b27('0x5')]=function(_0x2b7ee6){return function(){return client[_0x9b27('0x6')](_0x9b27('0x2'),{'options':{'where':{'CampaignId':_0x2b7ee6[_0x9b27('0x7')],'phone':_0x2b7ee6[_0x9b27('0x4')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
+var _0x7b11=['GetCmHopperBlack','VoiceQueueId','phone','CampaignId','GetCmHopperBlackIvr','../client','checkIsBlackList','Request'];(function(_0x5327b6,_0x424c87){var _0x20d48c=function(_0x478b52){while(--_0x478b52){_0x5327b6['push'](_0x5327b6['shift']());}};_0x20d48c(++_0x424c87);}(_0x7b11,0x75));var _0x17b1=function(_0x5892fb,_0x5b0358){_0x5892fb=_0x5892fb-0x0;var _0x11b621=_0x7b11[_0x5892fb];return _0x11b621;};'use strict';var client=require(_0x17b1('0x0'));exports[_0x17b1('0x1')]=function(_0x4ef746){return function(){return client[_0x17b1('0x2')](_0x17b1('0x3'),{'options':{'where':{'VoiceQueueId':_0x4ef746[_0x17b1('0x4')],'phone':_0x4ef746[_0x17b1('0x5')]},'raw':![]},'log':_0x17b1('0x3')});};};exports['checkIsBlackListIvr']=function(_0x38b70f){return function(){return client['Request'](_0x17b1('0x3'),{'options':{'where':{'CampaignId':_0x38b70f[_0x17b1('0x6')],'phone':_0x38b70f[_0x17b1('0x5')]},'raw':![]},'log':_0x17b1('0x7')});};};
\ No newline at end of file
index 053a590..95b7868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d14=['queue','Request','createContact'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x0d14,0x15e));var _0x40d1=function(_0xb48a10,_0x4c61c0){_0xb48a10=_0xb48a10-0x0;var _0x40f4e7=_0x0d14[_0xb48a10];return _0x40f4e7;};'use strict';var client=require('../client');exports[_0x40d1('0x0')]=function(_0x13c1fe){return function(){_0x13c1fe['campaign']=_0x13c1fe[_0x40d1('0x1')];return client[_0x40d1('0x2')]('CreateCmHopperFinal',{'body':_0x13c1fe,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x50cd=['Request','CreateCmHopperFinal','createContact','campaign'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x50cd,0x72));var _0xd50c=function(_0x1e2072,_0x145d84){_0x1e2072=_0x1e2072-0x0;var _0x1a72ce=_0x50cd[_0x1e2072];return _0x1a72ce;};'use strict';var client=require('../client');exports[_0xd50c('0x0')]=function(_0x16a88b){return function(){_0x16a88b[_0xd50c('0x1')]=_0x16a88b['queue'];return client[_0xd50c('0x2')](_0xd50c('0x3'),{'body':_0x16a88b,'log':_0xd50c('0x3')});};};
\ No newline at end of file
index 0c1d14a..2a249b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc1b=['GetCampaignHopperHistory','endOf','ivr','moment','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','getCampaignHopperHistory'];(function(_0x52fe97,_0x220f6a){var _0x4449c8=function(_0x1059ef){while(--_0x1059ef){_0x52fe97['push'](_0x52fe97['shift']());}};_0x4449c8(++_0x220f6a);}(_0xbc1b,0xcf));var _0xbbc1=function(_0x218972,_0x1f9794){_0x218972=_0x218972-0x0;var _0x1bb1a8=_0xbc1b[_0x218972];return _0x1bb1a8;};'use strict';var client=require('../client');var moment=require(_0xbbc1('0x0'));exports['createHistory']=function(_0x5e5010){return function(){_0x5e5010['campaign']=_0x5e5010[_0xbbc1('0x1')];return client[_0xbbc1('0x2')](_0xbbc1('0x3'),{'body':_0x5e5010,'log':'CreateCmHopperHistory'});};};exports[_0xbbc1('0x4')]=function(_0x5697b7){return function(){return client[_0xbbc1('0x2')](_0xbbc1('0x5'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x5697b7,_0xbbc1('0x6'))[_0xbbc1('0x7')](_0xbbc1('0x8')),moment()[_0xbbc1('0x7')](_0xbbc1('0x8'))]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0xbbc1('0x9')]=function(_0xf895c0){return function(){return client[_0xbbc1('0x2')](_0xbbc1('0xa'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xbbc1('0xb')]('day')[_0xbbc1('0x7')](_0xbbc1('0x8')),moment()['endOf'](_0xbbc1('0xc'))[_0xbbc1('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0xbbc1('0xa')});};};exports[_0xbbc1('0xd')]=function(_0x5c0f93){return function(){return client['Request'](_0xbbc1('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xbbc1('0xc'))[_0xbbc1('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbbc1('0xf')]('day')[_0xbbc1('0x7')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0xbbc1('0x10')},'raw':![]},'log':_0xbbc1('0xe')});};};
\ No newline at end of file
+var _0x0dac=['GetCampaignHopperHistory','../client','createHistory','campaign','queue','Request','CreateCmHopperHistory','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory'];(function(_0x380d58,_0x380c88){var _0x171479=function(_0x34a270){while(--_0x34a270){_0x380d58['push'](_0x380d58['shift']());}};_0x171479(++_0x380c88);}(_0x0dac,0x145));var _0xc0da=function(_0x2d4f5d,_0x3f069f){_0x2d4f5d=_0x2d4f5d-0x0;var _0xb034a6=_0x0dac[_0x2d4f5d];return _0xb034a6;};'use strict';var client=require(_0xc0da('0x0'));var moment=require('moment');exports[_0xc0da('0x1')]=function(_0x77c5ce){return function(){_0x77c5ce[_0xc0da('0x2')]=_0x77c5ce[_0xc0da('0x3')];return client[_0xc0da('0x4')](_0xc0da('0x5'),{'body':_0x77c5ce,'log':'CreateCmHopperHistory'});};};exports['avgHandleTime']=function(_0x873255){return function(){return client[_0xc0da('0x4')](_0xc0da('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x873255,_0xc0da('0x7'))[_0xc0da('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xc0da('0x8')](_0xc0da('0x9'))]}},'raw':![]},'log':_0xc0da('0xa')});};};exports[_0xc0da('0xb')]=function(_0x5ee763){return function(){return client[_0xc0da('0x4')](_0xc0da('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xc0da('0xd')](_0xc0da('0xe'))[_0xc0da('0x8')](_0xc0da('0x9')),moment()[_0xc0da('0xf')]('day')[_0xc0da('0x8')](_0xc0da('0x9'))]},'campaigntype':_0xc0da('0x3')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0xc0da('0x10')]=function(_0x28da31){return function(){return client[_0xc0da('0x4')](_0xc0da('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xc0da('0xe'))[_0xc0da('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0xc0da('0xe'))[_0xc0da('0x8')](_0xc0da('0x9'))]},'campaigntype':'ivr'},'raw':![]},'log':'GetCampaignHopperHistory'});};};
\ No newline at end of file
index 5f65315..5a38de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb96d=['ecm','headerinfo','maxrate','modem','gateway','faxdetect','tech','TrunkId','key','Trunk','name','active','getFaxAccount','NotifyFaxAccount','getFaxAccounts','Request','GetFaxAccount','description'];(function(_0x5f2609,_0x50e37f){var _0x141c5f=function(_0x48a367){while(--_0x48a367){_0x5f2609['push'](_0x5f2609['shift']());}};_0x141c5f(++_0x50e37f);}(_0xb96d,0x9e));var _0xdb96=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xb96d[_0x220dbb];return _0x2b77de;};'use strict';var client=require('../client');exports[_0xdb96('0x0')]=function(){return function(){return client[_0xdb96('0x1')](_0xdb96('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xdb96('0x3'),_0xdb96('0x4'),_0xdb96('0x5'),'localstationid','minrate',_0xdb96('0x6'),_0xdb96('0x7'),_0xdb96('0x8'),_0xdb96('0x9'),'t38timeout',_0xdb96('0xa'),_0xdb96('0xb'),'ListId',_0xdb96('0xc')],'include':[{'model':'Trunk','as':_0xdb96('0xd'),'attributes':['id',_0xdb96('0xe'),'callerid',_0xdb96('0xf')]}]},'log':_0xdb96('0x10')});};};exports['notify']=function(_0x220777,_0xa9010e){return client[_0xdb96('0x1')](_0xdb96('0x11'),{'account':{'id':_0x220777},'body':_0xa9010e,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0xafcd=['maxrate','gateway','faxdetect','t38timeout','TrunkId','ListId','key','Trunk','callerid','active','getFaxAccount','notify','NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','description','ecm','localstationid','minrate'];(function(_0x1eee0f,_0x62285){var _0x410692=function(_0x79d3a0){while(--_0x79d3a0){_0x1eee0f['push'](_0x1eee0f['shift']());}};_0x410692(++_0x62285);}(_0xafcd,0x157));var _0xdafc=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xafcd[_0x4b7b62];return _0x2280df;};'use strict';var client=require(_0xdafc('0x0'));exports[_0xdafc('0x1')]=function(){return function(){return client[_0xdafc('0x2')](_0xdafc('0x3'),{'options':{'raw':![],'attributes':['id',_0xdafc('0x4'),_0xdafc('0x5'),_0xdafc('0x6'),'headerinfo',_0xdafc('0x7'),_0xdafc('0x8'),_0xdafc('0x9'),'modem',_0xdafc('0xa'),_0xdafc('0xb'),_0xdafc('0xc'),'tech',_0xdafc('0xd'),_0xdafc('0xe'),_0xdafc('0xf')],'include':[{'model':_0xdafc('0x10'),'as':_0xdafc('0x10'),'attributes':['id',_0xdafc('0x4'),_0xdafc('0x11'),_0xdafc('0x12')]}]},'log':_0xdafc('0x13')});};};exports[_0xdafc('0x14')]=function(_0x39561b,_0x5c6c14){return client['Request'](_0xdafc('0x15'),{'account':{'id':_0x39561b},'body':_0x5c6c14,'log':_0xdafc('0x15')});};
\ No newline at end of file
index 66d017f..e6902f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfec2=['update','Request','../client'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0xfec2,0xe0));var _0x2fec=function(_0x43b9b4,_0x196a8f){_0x43b9b4=_0x43b9b4-0x0;var _0x4fa44b=_0xfec2[_0x43b9b4];return _0x4fa44b;};'use strict';var client=require(_0x2fec('0x0'));exports[_0x2fec('0x1')]=function(_0x18684e,_0xf54f9e){return client[_0x2fec('0x2')]('UpdateFaxMessage',{'body':_0xf54f9e,'options':{'where':{'AttachmentId':_0x18684e}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
+var _0x565f=['UpdateFaxMessage','update','Request'];(function(_0x15c22e,_0x3e1ccd){var _0x5f21c0=function(_0x30bfda){while(--_0x30bfda){_0x15c22e['push'](_0x15c22e['shift']());}};_0x5f21c0(++_0x3e1ccd);}(_0x565f,0xaf));var _0xf565=function(_0x504dc5,_0x1d8e6a){_0x504dc5=_0x504dc5-0x0;var _0x52701e=_0x565f[_0x504dc5];return _0x52701e;};'use strict';var client=require('../client');exports[_0xf565('0x0')]=function(_0x4a27b7,_0x1eba0b){return client[_0xf565('0x1')]('UpdateFaxMessage',{'body':_0x1eba0b,'options':{'where':{'AttachmentId':_0x4a27b7}},'log':_0xf565('0x2')});};
\ No newline at end of file
index 60e7568..3739477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1881=['Variable','Descriptions','content','keyType','Fields','idField','nameField','customField','variableName','Tags','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1881,0x1ea));var _0x1188=function(_0x9d77b5,_0x4fcdb3){_0x9d77b5=_0x9d77b5-0x0;var _0x4b26d0=_0x1881[_0x9d77b5];return _0x4b26d0;};'use strict';var client=require('../../client');exports[_0x1188('0x0')]=function(){return function(_0x442f83){return client[_0x1188('0x1')](_0x1188('0x2'),{'options':{'raw':![],'attributes':['id',_0x1188('0x3'),_0x1188('0x4'),_0x1188('0x5'),_0x1188('0x6'),_0x1188('0x7'),_0x1188('0x8'),_0x1188('0x9'),_0x1188('0xa')],'include':[{'model':_0x1188('0xb'),'as':_0x1188('0xc'),'attributes':['id',_0x1188('0x3')],'include':[{'model':_0x1188('0xd'),'as':'Subjects','attributes':['id','type','content','variableName'],'include':[{'model':_0x1188('0xe'),'as':'Variable','attributes':['id',_0x1188('0x3')]}]},{'model':'DeskField','as':_0x1188('0xf'),'attributes':['id',_0x1188('0x9'),_0x1188('0x10'),'key',_0x1188('0x11'),'keyContent','variableName'],'include':[{'model':_0x1188('0xe'),'as':_0x1188('0xe'),'attributes':['id',_0x1188('0x3')]}]},{'model':'DeskField','as':_0x1188('0x12'),'attributes':['id',_0x1188('0x9'),_0x1188('0x10'),_0x1188('0x13'),_0x1188('0x14'),_0x1188('0x15'),_0x1188('0x16')],'include':[{'model':'Variable','as':_0x1188('0xe'),'attributes':['id',_0x1188('0x3')]}]},{'model':'Tag','as':_0x1188('0x17'),'attributes':['id',_0x1188('0x3')]}]}]},'log':'GetDeskAccount'});};};
\ No newline at end of file
+var _0xddb3=['Request','GetDeskAccount','name','username','remoteUri','type','serverUrl','DeskConfiguration','Configurations','Subjects','content','variableName','Variable','DeskField','Descriptions','key','idField','customField','Tag','Tags','../../client','getDeskAccounts'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0xddb3,0xc4));var _0x3ddb=function(_0x218a3f,_0x1a30e1){_0x218a3f=_0x218a3f-0x0;var _0x449974=_0xddb3[_0x218a3f];return _0x449974;};'use strict';var client=require(_0x3ddb('0x0'));exports[_0x3ddb('0x1')]=function(){return function(_0xd1465e){return client[_0x3ddb('0x2')](_0x3ddb('0x3'),{'options':{'raw':![],'attributes':['id',_0x3ddb('0x4'),'description',_0x3ddb('0x5'),'password',_0x3ddb('0x6'),'authType',_0x3ddb('0x7'),_0x3ddb('0x8')],'include':[{'model':_0x3ddb('0x9'),'as':_0x3ddb('0xa'),'attributes':['id',_0x3ddb('0x4')],'include':[{'model':'DeskField','as':_0x3ddb('0xb'),'attributes':['id',_0x3ddb('0x7'),_0x3ddb('0xc'),_0x3ddb('0xd')],'include':[{'model':_0x3ddb('0xe'),'as':_0x3ddb('0xe'),'attributes':['id',_0x3ddb('0x4')]}]},{'model':_0x3ddb('0xf'),'as':_0x3ddb('0x10'),'attributes':['id',_0x3ddb('0x7'),_0x3ddb('0xc'),_0x3ddb('0x11'),'keyType','keyContent','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x3ddb('0x4')]}]},{'model':_0x3ddb('0xf'),'as':'Fields','attributes':['id',_0x3ddb('0x7'),_0x3ddb('0xc'),_0x3ddb('0x12'),'nameField',_0x3ddb('0x13'),'variableName'],'include':[{'model':_0x3ddb('0xe'),'as':_0x3ddb('0xe'),'attributes':['id',_0x3ddb('0x4')]}]},{'model':_0x3ddb('0x14'),'as':_0x3ddb('0x15'),'attributes':['id',_0x3ddb('0x4')]}]}]},'log':_0x3ddb('0x3')});};};
\ No newline at end of file
index c8998ab..9b36b13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ea9=['key','keyContent','Fields','idField','nameField','CloudProvider','data2','data5','data7','../../client','getDynamics365Accounts','Request','GetDynamics365Account','username','password','remoteUri','clientId','serverUrl','modernAuthentication','Configurations','name','ticketType','moduleCreate','additionalSearchContact','openNewTab','Subjects','type','content','variableName','Variable','Dynamics365Field','Descriptions'];(function(_0x4c160b,_0x1af746){var _0x5336b3=function(_0x726df){while(--_0x726df){_0x4c160b['push'](_0x4c160b['shift']());}};_0x5336b3(++_0x1af746);}(_0x6ea9,0x89));var _0x96ea=function(_0x5edb8c,_0x5762a6){_0x5edb8c=_0x5edb8c-0x0;var _0x1107e4=_0x6ea9[_0x5edb8c];return _0x1107e4;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(_0x27c316){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x96ea('0x4'),_0x96ea('0x5'),_0x96ea('0x6'),'tenantId',_0x96ea('0x7'),'clientSecret',_0x96ea('0x8'),'description',_0x96ea('0x9')],'include':[{'model':'Dynamics365Configuration','as':_0x96ea('0xa'),'attributes':['id',_0x96ea('0xb'),_0x96ea('0xc'),_0x96ea('0xd'),_0x96ea('0xe'),_0x96ea('0xf')],'include':[{'model':'Dynamics365Field','as':_0x96ea('0x10'),'attributes':['id',_0x96ea('0x11'),_0x96ea('0x12'),_0x96ea('0x13')],'include':[{'model':_0x96ea('0x14'),'as':_0x96ea('0x14'),'attributes':['id',_0x96ea('0xb')]}]},{'model':_0x96ea('0x15'),'as':_0x96ea('0x16'),'attributes':['id',_0x96ea('0x11'),'content',_0x96ea('0x17'),'keyType',_0x96ea('0x18'),_0x96ea('0x13')],'include':[{'model':'Variable','as':_0x96ea('0x14'),'attributes':['id',_0x96ea('0xb')]}]},{'model':_0x96ea('0x15'),'as':_0x96ea('0x19'),'attributes':['id',_0x96ea('0x11'),_0x96ea('0x12'),_0x96ea('0x1a'),_0x96ea('0x1b'),'customField',_0x96ea('0x13')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x96ea('0xb')]}]}]},{'model':_0x96ea('0x1c'),'as':'CloudProvider','attributes':['id',_0x96ea('0x1d'),_0x96ea('0x1e'),_0x96ea('0x1f')]}]},'log':_0x96ea('0x3')});};};
\ No newline at end of file
+var _0x5ba3=['GetDynamics365Account','../../client','Request','name','username','password','tenantId','clientId','clientSecret','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','additionalSearchContact','openNewTab','Dynamics365Field','Subjects','content','Descriptions','type','key','keyType','keyContent','Variable','nameField','customField','CloudProvider','data2','data7'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5ba3,0x140));var _0x35ba=function(_0x41afa3,_0x294fcb){_0x41afa3=_0x41afa3-0x0;var _0x1d345d=_0x5ba3[_0x41afa3];return _0x1d345d;};'use strict';var client=require(_0x35ba('0x0'));exports['getDynamics365Accounts']=function(){return function(_0xa1a1e0){return client[_0x35ba('0x1')]('GetDynamics365Account',{'options':{'raw':![],'attributes':['id',_0x35ba('0x2'),_0x35ba('0x3'),_0x35ba('0x4'),'remoteUri',_0x35ba('0x5'),_0x35ba('0x6'),_0x35ba('0x7'),'serverUrl','description',_0x35ba('0x8')],'include':[{'model':_0x35ba('0x9'),'as':_0x35ba('0xa'),'attributes':['id','name',_0x35ba('0xb'),'moduleCreate',_0x35ba('0xc'),_0x35ba('0xd')],'include':[{'model':_0x35ba('0xe'),'as':_0x35ba('0xf'),'attributes':['id','type',_0x35ba('0x10'),'variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x35ba('0x2')]}]},{'model':_0x35ba('0xe'),'as':_0x35ba('0x11'),'attributes':['id',_0x35ba('0x12'),_0x35ba('0x10'),_0x35ba('0x13'),_0x35ba('0x14'),_0x35ba('0x15'),'variableName'],'include':[{'model':_0x35ba('0x16'),'as':_0x35ba('0x16'),'attributes':['id',_0x35ba('0x2')]}]},{'model':_0x35ba('0xe'),'as':'Fields','attributes':['id',_0x35ba('0x12'),'content','idField',_0x35ba('0x17'),_0x35ba('0x18'),'variableName'],'include':[{'model':_0x35ba('0x16'),'as':_0x35ba('0x16'),'attributes':['id',_0x35ba('0x2')]}]}]},{'model':_0x35ba('0x19'),'as':_0x35ba('0x19'),'attributes':['id',_0x35ba('0x1a'),'data5',_0x35ba('0x1b')]}]},'log':_0x35ba('0x1c')});};};
\ No newline at end of file
index 668601e..e629c14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a3=['Subjects','content','variableName','Variable','Descriptions','type','key','keyType','keyContent','Fields','nameField','Request','name','username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x23a3,0x131));var _0x323a=function(_0x3a1ad5,_0x46b73a){_0x3a1ad5=_0x3a1ad5-0x0;var _0x275ef1=_0x23a3[_0x3a1ad5];return _0x275ef1;};'use strict';var client=require('../../client');exports['getFreshdeskAccounts']=function(){return function(_0x5e2477){return client[_0x323a('0x0')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x323a('0x1'),_0x323a('0x2'),_0x323a('0x3'),_0x323a('0x4'),_0x323a('0x5')],'include':[{'model':_0x323a('0x6'),'as':_0x323a('0x7'),'attributes':['id',_0x323a('0x1')],'include':[{'model':_0x323a('0x8'),'attributes':['id','name']},{'model':_0x323a('0x9'),'as':_0x323a('0xa'),'attributes':['id','type',_0x323a('0xb'),_0x323a('0xc')],'include':[{'model':_0x323a('0xd'),'as':'Variable','attributes':['id',_0x323a('0x1')]}]},{'model':_0x323a('0x9'),'as':_0x323a('0xe'),'attributes':['id',_0x323a('0xf'),_0x323a('0xb'),_0x323a('0x10'),_0x323a('0x11'),_0x323a('0x12'),_0x323a('0xc')],'include':[{'model':_0x323a('0xd'),'as':_0x323a('0xd'),'attributes':['id',_0x323a('0x1')]}]},{'model':_0x323a('0x9'),'as':_0x323a('0x13'),'attributes':['id','type',_0x323a('0xb'),'idField',_0x323a('0x14'),'customField','variableName'],'include':[{'model':_0x323a('0xd'),'as':'Variable','attributes':['id',_0x323a('0x1')]}]}]}]},'log':'GetFreshdeskAccount'});};};
\ No newline at end of file
+var _0xbfcc=['nameField','customField','../../client','Request','GetFreshdeskAccount','name','username','Configurations','Subjects','type','content','variableName','Variable','FreshdeskField','Descriptions','keyType','keyContent','Fields','idField'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1f9f5f,_0x509fb7){_0x1f9f5f=_0x1f9f5f-0x0;var _0x51d649=_0xbfcc[_0x1f9f5f];return _0x51d649;};'use strict';var client=require(_0xcbfc('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x5c0fe4){return client[_0xcbfc('0x1')](_0xcbfc('0x2'),{'options':{'raw':![],'attributes':['id',_0xcbfc('0x3'),_0xcbfc('0x4'),'apiKey','remoteUri','serverUrl'],'include':[{'model':'FreshdeskConfiguration','as':_0xcbfc('0x5'),'attributes':['id',_0xcbfc('0x3')],'include':[{'model':'Tag','attributes':['id',_0xcbfc('0x3')]},{'model':'FreshdeskField','as':_0xcbfc('0x6'),'attributes':['id',_0xcbfc('0x7'),_0xcbfc('0x8'),_0xcbfc('0x9')],'include':[{'model':'Variable','as':_0xcbfc('0xa'),'attributes':['id',_0xcbfc('0x3')]}]},{'model':_0xcbfc('0xb'),'as':_0xcbfc('0xc'),'attributes':['id',_0xcbfc('0x7'),_0xcbfc('0x8'),'key',_0xcbfc('0xd'),_0xcbfc('0xe'),_0xcbfc('0x9')],'include':[{'model':_0xcbfc('0xa'),'as':_0xcbfc('0xa'),'attributes':['id','name']}]},{'model':_0xcbfc('0xb'),'as':_0xcbfc('0xf'),'attributes':['id',_0xcbfc('0x7'),'content',_0xcbfc('0x10'),_0xcbfc('0x11'),_0xcbfc('0x12'),_0xcbfc('0x9')],'include':[{'model':_0xcbfc('0xa'),'as':'Variable','attributes':['id',_0xcbfc('0x3')]}]}]}]},'log':_0xcbfc('0x2')});};};
\ No newline at end of file
index 987a18c..f97f29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ec2=['Variable','Descriptions','type','key','keyType','keyContent','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','content','variableName'];(function(_0x4f01b5,_0x30910b){var _0x178b7d=function(_0x51ab4a){while(--_0x51ab4a){_0x4f01b5['push'](_0x4f01b5['shift']());}};_0x178b7d(++_0x30910b);}(_0x6ec2,0x78));var _0x26ec=function(_0xa0787b,_0x3fdc83){_0xa0787b=_0xa0787b-0x0;var _0x1d21ae=_0x6ec2[_0xa0787b];return _0x1d21ae;};'use strict';var client=require(_0x26ec('0x0'));exports[_0x26ec('0x1')]=function(){return function(_0x3d8b7c){return client[_0x26ec('0x2')](_0x26ec('0x3'),{'options':{'raw':![],'attributes':['id',_0x26ec('0x4'),'username',_0x26ec('0x5'),_0x26ec('0x6'),_0x26ec('0x7')],'include':[{'model':_0x26ec('0x8'),'as':_0x26ec('0x9'),'attributes':['id','name'],'include':[{'model':_0x26ec('0xa'),'as':'Subjects','attributes':['id','type',_0x26ec('0xb'),_0x26ec('0xc')],'include':[{'model':_0x26ec('0xd'),'as':'Variable','attributes':['id',_0x26ec('0x4')]}]},{'model':'FreshsalesField','as':_0x26ec('0xe'),'attributes':['id',_0x26ec('0xf'),_0x26ec('0xb'),_0x26ec('0x10'),_0x26ec('0x11'),_0x26ec('0x12'),_0x26ec('0xc')],'include':[{'model':_0x26ec('0xd'),'as':_0x26ec('0xd'),'attributes':['id',_0x26ec('0x4')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
+var _0xafc4=['../../client','GetFreshsalesAccount','name','username','apiKey','Configurations','FreshsalesField','Subjects','type','content','Variable','Descriptions','keyType','variableName','GetFreshsalesccount'];(function(_0x5f10d1,_0x482139){var _0x5d9971=function(_0xfbd515){while(--_0xfbd515){_0x5f10d1['push'](_0x5f10d1['shift']());}};_0x5d9971(++_0x482139);}(_0xafc4,0x69));var _0x4afc=function(_0x4a0669,_0x46a393){_0x4a0669=_0x4a0669-0x0;var _0x5b9061=_0xafc4[_0x4a0669];return _0x5b9061;};'use strict';var client=require(_0x4afc('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x2604d4){return client['Request'](_0x4afc('0x1'),{'options':{'raw':![],'attributes':['id',_0x4afc('0x2'),_0x4afc('0x3'),_0x4afc('0x4'),'remoteUri','serverUrl'],'include':[{'model':'FreshsalesConfiguration','as':_0x4afc('0x5'),'attributes':['id',_0x4afc('0x2')],'include':[{'model':_0x4afc('0x6'),'as':_0x4afc('0x7'),'attributes':['id',_0x4afc('0x8'),_0x4afc('0x9'),'variableName'],'include':[{'model':_0x4afc('0xa'),'as':_0x4afc('0xa'),'attributes':['id',_0x4afc('0x2')]}]},{'model':_0x4afc('0x6'),'as':_0x4afc('0xb'),'attributes':['id',_0x4afc('0x8'),'content','key',_0x4afc('0xc'),'keyContent',_0x4afc('0xd')],'include':[{'model':_0x4afc('0xa'),'as':'Variable','attributes':['id',_0x4afc('0x2')]}]}]}]},'log':_0x4afc('0xe')});};};
\ No newline at end of file
index bc51ef0..1b06dbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9d=['additionalSearchLead','Subjects','Variable','name','SalesforceField','Descriptions','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','username','remoteUri','clientId','clientSecret','securityToken','serverUrl','Configurations','moduleSearch','moduleCreate','leadId','additionalSearchAccount','additionalSearchContact'];(function(_0x22cc16,_0x1f4fa2){var _0x399b70=function(_0x34d464){while(--_0x34d464){_0x22cc16['push'](_0x22cc16['shift']());}};_0x399b70(++_0x1f4fa2);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x4aa202,_0x4215c0){_0x4aa202=_0x4aa202-0x0;var _0x2c0fcd=_0xfe9d[_0x4aa202];return _0x2c0fcd;};'use strict';var client=require(_0xdfe9('0x0'));exports[_0xdfe9('0x1')]=function(){return function(_0x75737a){return client[_0xdfe9('0x2')](_0xdfe9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdfe9('0x4'),'password',_0xdfe9('0x5'),_0xdfe9('0x6'),_0xdfe9('0x7'),_0xdfe9('0x8'),_0xdfe9('0x9'),'type'],'include':[{'model':'SalesforceConfiguration','as':_0xdfe9('0xa'),'attributes':['id','name',_0xdfe9('0xb'),_0xdfe9('0xc'),'ticketType',_0xdfe9('0xd'),_0xdfe9('0xe'),_0xdfe9('0xf'),_0xdfe9('0x10')],'include':[{'model':'SalesforceField','as':_0xdfe9('0x11'),'include':[{'model':_0xdfe9('0x12'),'as':_0xdfe9('0x12'),'attributes':['id',_0xdfe9('0x13')]}]},{'model':_0xdfe9('0x14'),'as':_0xdfe9('0x15'),'include':[{'model':_0xdfe9('0x12'),'as':_0xdfe9('0x12'),'attributes':['id',_0xdfe9('0x13')]}]},{'model':_0xdfe9('0x14'),'as':'Fields','include':[{'model':_0xdfe9('0x12'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xdfe9('0x3')});};};
\ No newline at end of file
+var _0x40ac=['GetSalesforceAccount','name','username','password','remoteUri','clientSecret','securityToken','serverUrl','Configurations','moduleCreate','ticketType','leadId','additionalSearchAccount','Subjects','Variable','Descriptions','SalesforceField','Fields','../../client','Request'];(function(_0x54152b,_0x49e121){var _0x129cd3=function(_0xe7441c){while(--_0xe7441c){_0x54152b['push'](_0x54152b['shift']());}};_0x129cd3(++_0x49e121);}(_0x40ac,0x1de));var _0xc40a=function(_0x1abbf4,_0x2f199d){_0x1abbf4=_0x1abbf4-0x0;var _0x4c28d9=_0x40ac[_0x1abbf4];return _0x4c28d9;};'use strict';var client=require(_0xc40a('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x10d6e7){return client[_0xc40a('0x1')](_0xc40a('0x2'),{'options':{'raw':![],'attributes':['id',_0xc40a('0x3'),_0xc40a('0x4'),_0xc40a('0x5'),_0xc40a('0x6'),'clientId',_0xc40a('0x7'),_0xc40a('0x8'),_0xc40a('0x9'),'type'],'include':[{'model':'SalesforceConfiguration','as':_0xc40a('0xa'),'attributes':['id',_0xc40a('0x3'),'moduleSearch',_0xc40a('0xb'),_0xc40a('0xc'),_0xc40a('0xd'),_0xc40a('0xe'),'additionalSearchContact','additionalSearchLead'],'include':[{'model':'SalesforceField','as':_0xc40a('0xf'),'include':[{'model':'Variable','as':_0xc40a('0x10'),'attributes':['id','name']}]},{'model':'SalesforceField','as':_0xc40a('0x11'),'include':[{'model':_0xc40a('0x10'),'as':_0xc40a('0x10'),'attributes':['id',_0xc40a('0x3')]}]},{'model':_0xc40a('0x12'),'as':_0xc40a('0x13'),'include':[{'model':_0xc40a('0x10'),'as':_0xc40a('0x10'),'attributes':['id','name']}]}]}]},'log':_0xc40a('0x2')});};};
\ No newline at end of file
index 3f31f0e..97ae9cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['Variable','Descriptions','key','keyType','variableName','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','name','ServicenowField','type','content'];(function(_0x5adb8a,_0x5a59a5){var _0xcee29a=function(_0x55669c){while(--_0x55669c){_0x5adb8a['push'](_0x5adb8a['shift']());}};_0xcee29a(++_0x5a59a5);}(_0x687b,0x14a));var _0xb687=function(_0x3cf1dc,_0x1d3274){_0x3cf1dc=_0x3cf1dc-0x0;var _0xb97c58=_0x687b[_0x3cf1dc];return _0xb97c58;};'use strict';var client=require(_0xb687('0x0'));exports[_0xb687('0x1')]=function(){return function(_0xd000be){return client[_0xb687('0x2')]('GetServicenowAccount',{'options':{'raw':![],'attributes':['id','name',_0xb687('0x3'),_0xb687('0x4'),_0xb687('0x5'),_0xb687('0x6'),_0xb687('0x7'),_0xb687('0x8')],'include':[{'model':_0xb687('0x9'),'as':_0xb687('0xa'),'attributes':['id',_0xb687('0xb')],'include':[{'model':_0xb687('0xc'),'as':'Subjects','attributes':['id',_0xb687('0xd'),_0xb687('0xe'),'variableName'],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]},{'model':_0xb687('0xc'),'as':_0xb687('0x10'),'attributes':['id',_0xb687('0xd'),_0xb687('0xe'),_0xb687('0x11'),_0xb687('0x12'),'keyContent',_0xb687('0x13')],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]},{'model':'ServicenowField','as':'Fields','attributes':['id',_0xb687('0xd'),_0xb687('0xe'),'idField',_0xb687('0x14'),_0xb687('0x15'),_0xb687('0x13')],'include':[{'model':_0xb687('0xf'),'as':_0xb687('0xf'),'attributes':['id',_0xb687('0xb')]}]}]}]},'log':_0xb687('0x16')});};};
\ No newline at end of file
+var _0x1967=['description','username','password','email','remoteUri','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','variableName','Variable','content','key','keyType','keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','getServicenowAccounts','Request','GetServicenowAccount','name'];(function(_0x2aa4dd,_0x2be855){var _0x4e77d2=function(_0x669fa4){while(--_0x669fa4){_0x2aa4dd['push'](_0x2aa4dd['shift']());}};_0x4e77d2(++_0x2be855);}(_0x1967,0x173));var _0x7196=function(_0x34da34,_0x5b0074){_0x34da34=_0x34da34-0x0;var _0x5aa477=_0x1967[_0x34da34];return _0x5aa477;};'use strict';var client=require('../../client');exports[_0x7196('0x0')]=function(){return function(_0xdb72bb){return client[_0x7196('0x1')](_0x7196('0x2'),{'options':{'raw':![],'attributes':['id',_0x7196('0x3'),_0x7196('0x4'),_0x7196('0x5'),_0x7196('0x6'),_0x7196('0x7'),_0x7196('0x8'),'serverUrl'],'include':[{'model':_0x7196('0x9'),'as':_0x7196('0xa'),'attributes':['id',_0x7196('0x3')],'include':[{'model':_0x7196('0xb'),'as':_0x7196('0xc'),'attributes':['id',_0x7196('0xd'),'content',_0x7196('0xe')],'include':[{'model':_0x7196('0xf'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0xb'),'as':'Descriptions','attributes':['id','type',_0x7196('0x10'),_0x7196('0x11'),_0x7196('0x12'),_0x7196('0x13'),_0x7196('0xe')],'include':[{'model':_0x7196('0xf'),'as':_0x7196('0xf'),'attributes':['id',_0x7196('0x3')]}]},{'model':_0x7196('0xb'),'as':_0x7196('0x14'),'attributes':['id',_0x7196('0xd'),'content',_0x7196('0x15'),_0x7196('0x16'),_0x7196('0x17'),_0x7196('0xe')],'include':[{'model':'Variable','as':_0x7196('0xf'),'attributes':['id','name']}]}]}]},'log':_0x7196('0x18')});};};
\ No newline at end of file
index 7f40beb..bbccbc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['variableName','key','keyContent','Variable','SugarcrmField','Fields','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','username','password','SugarcrmConfiguration','Configurations','type','content'];(function(_0x4b095c,_0x266c55){var _0x4495e2=function(_0x556701){while(--_0x556701){_0x4b095c['push'](_0x4b095c['shift']());}};_0x4495e2(++_0x266c55);}(_0x14a0,0x8e));var _0x014a=function(_0x3a4720,_0x5143a9){_0x3a4720=_0x3a4720-0x0;var _0x4cb457=_0x14a0[_0x3a4720];return _0x4cb457;};'use strict';var client=require('../../client');exports[_0x014a('0x0')]=function(){return function(_0x451138){return client[_0x014a('0x1')](_0x014a('0x2'),{'options':{'raw':![],'attributes':['id',_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),'remoteUri','serverUrl'],'include':[{'model':_0x014a('0x6'),'as':_0x014a('0x7'),'attributes':['id',_0x014a('0x3')],'include':[{'model':'SugarcrmField','as':'Subjects','attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x014a('0x3')]}]},{'model':'SugarcrmField','as':'Descriptions','attributes':['id','type','content',_0x014a('0xb'),'keyType',_0x014a('0xc'),_0x014a('0xa')],'include':[{'model':'Variable','as':_0x014a('0xd'),'attributes':['id',_0x014a('0x3')]}]},{'model':_0x014a('0xe'),'as':_0x014a('0xf'),'attributes':['id',_0x014a('0x8'),_0x014a('0x9'),_0x014a('0x10'),_0x014a('0x11'),_0x014a('0x12'),_0x014a('0xa')],'include':[{'model':_0x014a('0xd'),'as':_0x014a('0xd'),'attributes':['id','name']}]}]}]},'log':_0x014a('0x2')});};};
\ No newline at end of file
+var _0x5f2f=['username','password','SugarcrmConfiguration','Configurations','SugarcrmField','Subjects','type','variableName','Variable','Descriptions','key','Fields','content','idField','customField','../../client','getSugarcrmAccounts','Request','GetSugarcrmAccount','name'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x479700,_0x1125d2){_0x479700=_0x479700-0x0;var _0x2a6c06=_0x5f2f[_0x479700];return _0x2a6c06;};'use strict';var client=require(_0xf5f2('0x0'));exports[_0xf5f2('0x1')]=function(){return function(_0x2dcf60){return client[_0xf5f2('0x2')](_0xf5f2('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5f2('0x4'),_0xf5f2('0x5'),_0xf5f2('0x6'),'remoteUri','serverUrl'],'include':[{'model':_0xf5f2('0x7'),'as':_0xf5f2('0x8'),'attributes':['id',_0xf5f2('0x4')],'include':[{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xa'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id','name']}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0xe'),'attributes':['id',_0xf5f2('0xb'),'content',_0xf5f2('0xf'),'keyType','keyContent',_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':'Variable','attributes':['id',_0xf5f2('0x4')]}]},{'model':_0xf5f2('0x9'),'as':_0xf5f2('0x10'),'attributes':['id',_0xf5f2('0xb'),_0xf5f2('0x11'),_0xf5f2('0x12'),'nameField',_0xf5f2('0x13'),_0xf5f2('0xc')],'include':[{'model':_0xf5f2('0xd'),'as':_0xf5f2('0xd'),'attributes':['id',_0xf5f2('0x4')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
index ad38b83..ce81d2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9798=['accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','name','Subjects','content','variableName','Variable','VtigerField','Descriptions','type','key','keyType','keyContent','Fields','idField','nameField','Request','GetVtigerAccount','username'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x9798,0xef));var _0x8979=function(_0x19480c,_0x52042a){_0x19480c=_0x19480c-0x0;var _0x43663b=_0x9798[_0x19480c];return _0x43663b;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x292587){return client[_0x8979('0x0')](_0x8979('0x1'),{'options':{'raw':![],'attributes':['id','name','description',_0x8979('0x2'),_0x8979('0x3'),_0x8979('0x4'),_0x8979('0x5')],'include':[{'model':_0x8979('0x6'),'as':_0x8979('0x7'),'attributes':['id',_0x8979('0x8')],'include':[{'model':'VtigerField','as':_0x8979('0x9'),'attributes':['id','type',_0x8979('0xa'),_0x8979('0xb')],'include':[{'model':'Variable','as':_0x8979('0xc'),'attributes':['id',_0x8979('0x8')]}]},{'model':_0x8979('0xd'),'as':_0x8979('0xe'),'attributes':['id',_0x8979('0xf'),_0x8979('0xa'),_0x8979('0x10'),_0x8979('0x11'),_0x8979('0x12'),_0x8979('0xb')],'include':[{'model':_0x8979('0xc'),'as':'Variable','attributes':['id','name']}]},{'model':_0x8979('0xd'),'as':_0x8979('0x13'),'attributes':['id','type',_0x8979('0xa'),_0x8979('0x14'),_0x8979('0x15'),'customField','variableName'],'include':[{'model':_0x8979('0xc'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x8979('0x1')});};};
\ No newline at end of file
+var _0xba1e=['Configurations','VtigerField','Subjects','type','variableName','Variable','Descriptions','key','keyType','keyContent','idField','nameField','customField','../../client','Request','GetVtigerAccount','name','description','username','VtigerConfiguration'];(function(_0x1968ac,_0x19d7d5){var _0x2c78b2=function(_0x133e1d){while(--_0x133e1d){_0x1968ac['push'](_0x1968ac['shift']());}};_0x2c78b2(++_0x19d7d5);}(_0xba1e,0x1c5));var _0xeba1=function(_0x47fdbc,_0x57c1a4){_0x47fdbc=_0x47fdbc-0x0;var _0xcad35f=_0xba1e[_0x47fdbc];return _0xcad35f;};'use strict';var client=require(_0xeba1('0x0'));exports['getVtigerAccounts']=function(){return function(_0x3e9d40){return client[_0xeba1('0x1')](_0xeba1('0x2'),{'options':{'raw':![],'attributes':['id',_0xeba1('0x3'),_0xeba1('0x4'),_0xeba1('0x5'),'accessKey','remoteUri','serverUrl'],'include':[{'model':_0xeba1('0x6'),'as':_0xeba1('0x7'),'attributes':['id',_0xeba1('0x3')],'include':[{'model':_0xeba1('0x8'),'as':_0xeba1('0x9'),'attributes':['id',_0xeba1('0xa'),'content',_0xeba1('0xb')],'include':[{'model':_0xeba1('0xc'),'as':_0xeba1('0xc'),'attributes':['id',_0xeba1('0x3')]}]},{'model':_0xeba1('0x8'),'as':_0xeba1('0xd'),'attributes':['id','type','content',_0xeba1('0xe'),_0xeba1('0xf'),_0xeba1('0x10'),'variableName'],'include':[{'model':'Variable','as':_0xeba1('0xc'),'attributes':['id','name']}]},{'model':_0xeba1('0x8'),'as':'Fields','attributes':['id',_0xeba1('0xa'),'content',_0xeba1('0x11'),_0xeba1('0x12'),_0xeba1('0x13'),_0xeba1('0xb')],'include':[{'model':_0xeba1('0xc'),'as':_0xeba1('0xc'),'attributes':['id',_0xeba1('0x3')]}]}]}]},'log':_0xeba1('0x2')});};};
\ No newline at end of file
index 519ed39..d7b7ba4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5bd=['Request','GetZendeskAccount','name','username','remoteUri','authType','serverUrl','ZendeskConfiguration','Tag','ZendeskField','type','variableName','Variable','key','keyType','keyContent','Fields','content','idField','nameField','customField','../../client','getZendeskAccounts'];(function(_0x1e372f,_0x14a559){var _0x55879b=function(_0x2f833b){while(--_0x2f833b){_0x1e372f['push'](_0x1e372f['shift']());}};_0x55879b(++_0x14a559);}(_0xd5bd,0x129));var _0xdd5b=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd5bd[_0x24061a];return _0x82054e;};'use strict';var client=require(_0xdd5b('0x0'));exports[_0xdd5b('0x1')]=function(){return function(_0x495a81){return client[_0xdd5b('0x2')](_0xdd5b('0x3'),{'options':{'raw':![],'attributes':['id',_0xdd5b('0x4'),_0xdd5b('0x5'),'password','token',_0xdd5b('0x6'),_0xdd5b('0x7'),_0xdd5b('0x8'),'type'],'include':[{'model':_0xdd5b('0x9'),'as':'Configurations','attributes':['id',_0xdd5b('0x4')],'include':[{'model':_0xdd5b('0xa'),'attributes':['id',_0xdd5b('0x4')]},{'model':_0xdd5b('0xb'),'as':'Subjects','attributes':['id',_0xdd5b('0xc'),'content',_0xdd5b('0xd')],'include':[{'model':_0xdd5b('0xe'),'as':_0xdd5b('0xe'),'attributes':['id',_0xdd5b('0x4')]}]},{'model':_0xdd5b('0xb'),'as':'Descriptions','attributes':['id',_0xdd5b('0xc'),'content',_0xdd5b('0xf'),_0xdd5b('0x10'),_0xdd5b('0x11'),_0xdd5b('0xd')],'include':[{'model':'Variable','as':_0xdd5b('0xe'),'attributes':['id','name']}]},{'model':_0xdd5b('0xb'),'as':_0xdd5b('0x12'),'attributes':['id',_0xdd5b('0xc'),_0xdd5b('0x13'),_0xdd5b('0x14'),_0xdd5b('0x15'),_0xdd5b('0x16'),'variableName'],'include':[{'model':_0xdd5b('0xe'),'as':_0xdd5b('0xe'),'attributes':['id',_0xdd5b('0x4')]}]}]}]},'log':_0xdd5b('0x3')});};};
\ No newline at end of file
+var _0xc78e=['GetZendeskAccount','name','username','token','remoteUri','authType','serverUrl','type','ZendeskConfiguration','Tag','ZendeskField','Subjects','variableName','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','customField','getZendeskAccounts'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc78e,0x89));var _0xec78=function(_0x2a0271,_0xf11a46){_0x2a0271=_0x2a0271-0x0;var _0x49ff35=_0xc78e[_0x2a0271];return _0x49ff35;};'use strict';var client=require('../../client');exports[_0xec78('0x0')]=function(){return function(_0x1feb1e){return client['Request'](_0xec78('0x1'),{'options':{'raw':![],'attributes':['id',_0xec78('0x2'),_0xec78('0x3'),'password',_0xec78('0x4'),_0xec78('0x5'),_0xec78('0x6'),_0xec78('0x7'),_0xec78('0x8')],'include':[{'model':_0xec78('0x9'),'as':'Configurations','attributes':['id',_0xec78('0x2')],'include':[{'model':_0xec78('0xa'),'attributes':['id',_0xec78('0x2')]},{'model':_0xec78('0xb'),'as':_0xec78('0xc'),'attributes':['id',_0xec78('0x8'),'content',_0xec78('0xd')],'include':[{'model':_0xec78('0xe'),'as':'Variable','attributes':['id','name']}]},{'model':'ZendeskField','as':_0xec78('0xf'),'attributes':['id','type',_0xec78('0x10'),_0xec78('0x11'),_0xec78('0x12'),_0xec78('0x13'),'variableName'],'include':[{'model':'Variable','as':_0xec78('0xe'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0xec78('0x14'),'attributes':['id',_0xec78('0x8'),'content','idField',_0xec78('0x15'),_0xec78('0x16'),_0xec78('0xd')],'include':[{'model':'Variable','as':_0xec78('0xe'),'attributes':['id',_0xec78('0x2')]}]}]}]},'log':_0xec78('0x1')});};};
\ No newline at end of file
index fa6a1f3..e6a60d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7bdf=['getZohoAccounts','Request','name','description','host','clientId','clientSecret','serverUrl','code','ZohoConfiguration','moduleCreate','ZohoField','Subjects','type','variableName','Variable','Descriptions','content','key','keyType','Fields','idField','nameField','customField','GetZohoAccount','../../client'];(function(_0x3207e7,_0x37b11e){var _0x3a2a76=function(_0x1fd7fb){while(--_0x1fd7fb){_0x3207e7['push'](_0x3207e7['shift']());}};_0x3a2a76(++_0x37b11e);}(_0x7bdf,0x1ed));var _0xf7bd=function(_0x4c0e30,_0x5410aa){_0x4c0e30=_0x4c0e30-0x0;var _0x509a35=_0x7bdf[_0x4c0e30];return _0x509a35;};'use strict';var client=require(_0xf7bd('0x0'));exports[_0xf7bd('0x1')]=function(){return function(_0xac967d){return client[_0xf7bd('0x2')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0xf7bd('0x3'),_0xf7bd('0x4'),_0xf7bd('0x5'),'zone',_0xf7bd('0x6'),_0xf7bd('0x7'),_0xf7bd('0x8'),_0xf7bd('0x9'),'refreshToken'],'include':[{'model':_0xf7bd('0xa'),'as':'Configurations','attributes':['id',_0xf7bd('0x3'),_0xf7bd('0xb'),'moduleSearch','description'],'include':[{'model':_0xf7bd('0xc'),'as':_0xf7bd('0xd'),'attributes':['id',_0xf7bd('0xe'),'content',_0xf7bd('0xf')],'include':[{'model':_0xf7bd('0x10'),'as':_0xf7bd('0x10'),'attributes':['id',_0xf7bd('0x3')]}]},{'model':_0xf7bd('0xc'),'as':_0xf7bd('0x11'),'attributes':['id',_0xf7bd('0xe'),_0xf7bd('0x12'),_0xf7bd('0x13'),_0xf7bd('0x14'),'keyContent',_0xf7bd('0xf')],'include':[{'model':_0xf7bd('0x10'),'as':'Variable','attributes':['id',_0xf7bd('0x3')]}]},{'model':'ZohoField','as':_0xf7bd('0x15'),'attributes':['id',_0xf7bd('0xe'),_0xf7bd('0x12'),_0xf7bd('0x16'),_0xf7bd('0x17'),_0xf7bd('0x18'),_0xf7bd('0xf')],'include':[{'model':'Variable','as':_0xf7bd('0x10'),'attributes':['id',_0xf7bd('0x3')]}]}]}]},'log':_0xf7bd('0x19')});};};
\ No newline at end of file
+var _0x9594=['moduleCreate','moduleSearch','ZohoField','Subjects','variableName','Variable','Descriptions','type','content','key','keyType','Fields','idField','nameField','customField','../../client','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','refreshToken','ZohoConfiguration','Configurations'];(function(_0x4ca6a4,_0x5e9694){var _0x120555=function(_0x56888c){while(--_0x56888c){_0x4ca6a4['push'](_0x4ca6a4['shift']());}};_0x120555(++_0x5e9694);}(_0x9594,0x197));var _0x4959=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x9594[_0x43d11d];return _0x38cd08;};'use strict';var client=require(_0x4959('0x0'));exports['getZohoAccounts']=function(){return function(_0x2038bf){return client[_0x4959('0x1')](_0x4959('0x2'),{'options':{'raw':![],'attributes':['id',_0x4959('0x3'),_0x4959('0x4'),_0x4959('0x5'),_0x4959('0x6'),_0x4959('0x7'),_0x4959('0x8'),_0x4959('0x9'),'code',_0x4959('0xa')],'include':[{'model':_0x4959('0xb'),'as':_0x4959('0xc'),'attributes':['id',_0x4959('0x3'),_0x4959('0xd'),_0x4959('0xe'),'description'],'include':[{'model':_0x4959('0xf'),'as':_0x4959('0x10'),'attributes':['id','type','content',_0x4959('0x11')],'include':[{'model':_0x4959('0x12'),'as':_0x4959('0x12'),'attributes':['id',_0x4959('0x3')]}]},{'model':_0x4959('0xf'),'as':_0x4959('0x13'),'attributes':['id',_0x4959('0x14'),_0x4959('0x15'),_0x4959('0x16'),_0x4959('0x17'),'keyContent',_0x4959('0x11')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]},{'model':_0x4959('0xf'),'as':_0x4959('0x18'),'attributes':['id','type',_0x4959('0x15'),_0x4959('0x19'),_0x4959('0x1a'),_0x4959('0x1b'),_0x4959('0x11')],'include':[{'model':_0x4959('0x12'),'as':_0x4959('0x12'),'attributes':['id','name']}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index 8596911..5578782 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e96=['lodash','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','voice','isNil','interface','format','lastAssignedTo','TALKING','queuecallerleaveAt','diff','seconds','inbound','exten','agent','accountcode','toNumber','membername','endtime','starttime','outbound','dialstring','uniqueid','CreateMemberReport','moment'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x5e96,0x6b));var _0x65e9=function(_0x4de7d3,_0x198959){_0x4de7d3=_0x4de7d3-0x0;var _0x52f1c2=_0x5e96[_0x4de7d3];return _0x52f1c2;};'use strict';var moment=require(_0x65e9('0x0'));var _=require(_0x65e9('0x1'));var util=require('util');var client=require(_0x65e9('0x2'));exports[_0x65e9('0x3')]=function(_0x298f10){var _0x3ba9c0=_0x298f10[_0x65e9('0x4')]||_0x298f10[_0x65e9('0x5')];return client['Request']('CreateMemberReport',{'body':{'channel':_0x65e9('0x6'),'membername':_0x298f10['lastAssignedTo'],'interface':_[_0x65e9('0x7')](_0x298f10[_0x65e9('0x8')])?util[_0x65e9('0x9')]('SIP/%s',_0x298f10[_0x65e9('0xa')]):_0x298f10[_0x65e9('0x8')],'type':_0x65e9('0xb'),'enterAt':_0x298f10[_0x65e9('0xc')],'exitAt':_0x3ba9c0,'duration':moment(_0x3ba9c0)[_0x65e9('0xd')](_0x298f10[_0x65e9('0xc')],_0x65e9('0xe')),'data1':_0x65e9('0xf'),'data2':_0x298f10['calleridnum'],'data3':_0x298f10[_0x65e9('0x10')],'data4':null,'data5':_0x298f10['queue'],'role':_0x65e9('0x11'),'internal':_0x298f10[_0x65e9('0x12')]?_[_0x65e9('0x13')](_0x298f10[_0x65e9('0x12')]):undefined,'uniqueid':_0x298f10['uniqueid']},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x10ee05){return client['Request']('CreateMemberReport',{'body':{'channel':_0x65e9('0x6'),'membername':_0x10ee05[_0x65e9('0x14')],'interface':_0x10ee05[_0x65e9('0x8')],'type':_0x65e9('0xb'),'enterAt':_0x10ee05['starttime'],'exitAt':_0x10ee05[_0x65e9('0x15')],'duration':moment(_0x10ee05['endtime'])[_0x65e9('0xd')](_0x10ee05[_0x65e9('0x16')],_0x65e9('0xe'))>=0x0?moment(_0x10ee05[_0x65e9('0x15')])[_0x65e9('0xd')](_0x10ee05['starttime'],_0x65e9('0xe')):null,'data1':_0x65e9('0x17'),'data2':_0x10ee05[_0x65e9('0x12')],'data3':_0x10ee05[_0x65e9('0x10')],'data4':_0x10ee05[_0x65e9('0x18')]||null,'role':'agent','internal':_0x10ee05[_0x65e9('0x12')]?_['toNumber'](_0x10ee05[_0x65e9('0x12')]):undefined,'uniqueid':_0x10ee05[_0x65e9('0x19')]},'log':_0x65e9('0x1a')});};
\ No newline at end of file
+var _0x5eb0=['format','SIP/%s','queuecallerleaveAt','diff','seconds','exten','agent','accountcode','toNumber','uniqueid','voiceDialReport','CreateMemberReport','membername','TALKING','starttime','endtime','dialstring','moment','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','voice','isNil','interface'];(function(_0x42e8e4,_0x1b7310){var _0x19aae2=function(_0x1fd08e){while(--_0x1fd08e){_0x42e8e4['push'](_0x42e8e4['shift']());}};_0x19aae2(++_0x1b7310);}(_0x5eb0,0x93));var _0x05eb=function(_0x21d63f,_0x246d2b){_0x21d63f=_0x21d63f-0x0;var _0x36fc05=_0x5eb0[_0x21d63f];return _0x36fc05;};'use strict';var moment=require(_0x05eb('0x0'));var _=require('lodash');var util=require(_0x05eb('0x1'));var client=require('../client');exports[_0x05eb('0x2')]=function(_0x338463){var _0xbeb666=_0x338463[_0x05eb('0x3')]||_0x338463[_0x05eb('0x4')];return client[_0x05eb('0x5')]('CreateMemberReport',{'body':{'channel':_0x05eb('0x6'),'membername':_0x338463['lastAssignedTo'],'interface':_[_0x05eb('0x7')](_0x338463[_0x05eb('0x8')])?util[_0x05eb('0x9')](_0x05eb('0xa'),_0x338463['lastAssignedTo']):_0x338463[_0x05eb('0x8')],'type':'TALKING','enterAt':_0x338463[_0x05eb('0xb')],'exitAt':_0xbeb666,'duration':moment(_0xbeb666)[_0x05eb('0xc')](_0x338463[_0x05eb('0xb')],_0x05eb('0xd')),'data1':'inbound','data2':_0x338463['calleridnum'],'data3':_0x338463[_0x05eb('0xe')],'data4':null,'data5':_0x338463['queue'],'role':_0x05eb('0xf'),'internal':_0x338463[_0x05eb('0x10')]?_[_0x05eb('0x11')](_0x338463['accountcode']):undefined,'uniqueid':_0x338463[_0x05eb('0x12')]},'log':'CreateMemberReport'});};exports[_0x05eb('0x13')]=function(_0x64593b){return client['Request'](_0x05eb('0x14'),{'body':{'channel':'voice','membername':_0x64593b[_0x05eb('0x15')],'interface':_0x64593b[_0x05eb('0x8')],'type':_0x05eb('0x16'),'enterAt':_0x64593b[_0x05eb('0x17')],'exitAt':_0x64593b['endtime'],'duration':moment(_0x64593b[_0x05eb('0x18')])['diff'](_0x64593b[_0x05eb('0x17')],_0x05eb('0xd'))>=0x0?moment(_0x64593b[_0x05eb('0x18')])[_0x05eb('0xc')](_0x64593b['starttime'],_0x05eb('0xd')):null,'data1':'outbound','data2':_0x64593b[_0x05eb('0x10')],'data3':_0x64593b[_0x05eb('0xe')],'data4':_0x64593b[_0x05eb('0x19')]||null,'role':_0x05eb('0xf'),'internal':_0x64593b['accountcode']?_[_0x05eb('0x11')](_0x64593b[_0x05eb('0x10')]):undefined,'uniqueid':_0x64593b[_0x05eb('0x12')]},'log':_0x05eb('0x14')});};
\ No newline at end of file
index 5a22954..198b7bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d0=['getSettings','Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x582e18,_0x4fd856){var _0x445d03=function(_0x112957){while(--_0x112957){_0x582e18['push'](_0x582e18['shift']());}};_0x445d03(++_0x4fd856);}(_0x90d0,0x10d));var _0x090d=function(_0x3337b6,_0x42c7f9){_0x3337b6=_0x3337b6-0x0;var _0x568270=_0x90d0[_0x3337b6];return _0x568270;};'use strict';var client=require(_0x090d('0x0'));exports[_0x090d('0x1')]=function(){return client[_0x090d('0x2')](_0x090d('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x090d('0x4')]},'log':_0x090d('0x5')});};
\ No newline at end of file
+var _0xbdd4=['GetSettings','Request','ShowSetting'];(function(_0x12e3c4,_0x4930f5){var _0x4b93e7=function(_0x9cc02c){while(--_0x9cc02c){_0x12e3c4['push'](_0x12e3c4['shift']());}};_0x4b93e7(++_0x4930f5);}(_0xbdd4,0x14e));var _0x4bdd=function(_0x5317b5,_0x4dfd6e){_0x5317b5=_0x5317b5-0x0;var _0x3b7ce2=_0xbdd4[_0x5317b5];return _0x3b7ce2;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x4bdd('0x0')](_0x4bdd('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer','previewRecallmeReminderInterval']},'log':_0x4bdd('0x2')});};
\ No newline at end of file
index 576f45c..b1b98eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cab=['Request','GetTemplate','name','getTemplates'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x9cab,0x1e7));var _0xb9ca=function(_0x3c887e,_0xb618ae){_0x3c887e=_0x3c887e-0x0;var _0x11b462=_0x9cab[_0x3c887e];return _0x11b462;};'use strict';var client=require('../client');exports[_0xb9ca('0x0')]=function(_0x2d3077){return function(_0x24ae6d){return client[_0xb9ca('0x1')](_0xb9ca('0x2'),{'options':{'raw':!![],'attributes':['id',_0xb9ca('0x3'),'html']},'log':_0xb9ca('0x2')});};};
\ No newline at end of file
+var _0x8404=['html','../client','getTemplates','Request','GetTemplate','name'];(function(_0x99cebd,_0x401a68){var _0x10cdf2=function(_0x32681c){while(--_0x32681c){_0x99cebd['push'](_0x99cebd['shift']());}};_0x10cdf2(++_0x401a68);}(_0x8404,0x15d));var _0x4840=function(_0x50c1a2,_0xd8fb70){_0x50c1a2=_0x50c1a2-0x0;var _0xe3cfb0=_0x8404[_0x50c1a2];return _0xe3cfb0;};'use strict';var client=require(_0x4840('0x0'));exports[_0x4840('0x1')]=function(_0x10f714){return function(_0x335aaf){return client[_0x4840('0x2')](_0x4840('0x3'),{'options':{'raw':!![],'attributes':['id',_0x4840('0x4'),_0x4840('0x5')]},'log':_0x4840('0x3')});};};
\ No newline at end of file
index cb5d049..e47d82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8494=['getTriggers','name','channel','status','field','operator','Condition','AnyConditions','Action','Actions','action','data1','data2','data3','data5','data6','data7'];(function(_0x370be6,_0x17c8c8){var _0xb512b2=function(_0x32b1a6){while(--_0x32b1a6){_0x370be6['push'](_0x370be6['shift']());}};_0xb512b2(++_0x17c8c8);}(_0x8494,0x1a9));var _0x4849=function(_0x27fc6b,_0x4f9fd6){_0x27fc6b=_0x27fc6b-0x0;var _0x353e33=_0x8494[_0x27fc6b];return _0x353e33;};'use strict';var client=require('../client');exports[_0x4849('0x0')]=function(_0x1817c0){return function(_0x1c0631){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x4849('0x1'),_0x4849('0x2'),_0x4849('0x3')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x4849('0x4'),_0x4849('0x5'),'value']},{'model':_0x4849('0x6'),'as':_0x4849('0x7'),'attributes':['id','field','operator','value']},{'model':_0x4849('0x8'),'as':_0x4849('0x9'),'attributes':['id',_0x4849('0xa'),_0x4849('0xb'),_0x4849('0xc'),_0x4849('0xd'),'data4',_0x4849('0xe'),_0x4849('0xf'),_0x4849('0x10')]}]},'log':'GetTrigger'});};};
\ No newline at end of file
+var _0xa9a5=['data3','data4','data6','data7','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','action','data1','data2'];(function(_0x22a32c,_0x252581){var _0x25cb6c=function(_0x5377d9){while(--_0x5377d9){_0x22a32c['push'](_0x22a32c['shift']());}};_0x25cb6c(++_0x252581);}(_0xa9a5,0x169));var _0x5a9a=function(_0x3b58f0,_0x5e24b1){_0x3b58f0=_0x3b58f0-0x0;var _0x4b9b42=_0xa9a5[_0x3b58f0];return _0x4b9b42;};'use strict';var client=require(_0x5a9a('0x0'));exports[_0x5a9a('0x1')]=function(_0x4f0b64){return function(_0x26ead5){return client[_0x5a9a('0x2')](_0x5a9a('0x3'),{'options':{'raw':![],'attributes':['id',_0x5a9a('0x4'),_0x5a9a('0x5'),_0x5a9a('0x6')],'include':[{'model':_0x5a9a('0x7'),'as':_0x5a9a('0x8'),'attributes':['id',_0x5a9a('0x9'),_0x5a9a('0xa'),'value']},{'model':_0x5a9a('0x7'),'as':_0x5a9a('0xb'),'attributes':['id',_0x5a9a('0x9'),_0x5a9a('0xa'),_0x5a9a('0xc')]},{'model':_0x5a9a('0xd'),'as':'Actions','attributes':['id',_0x5a9a('0xe'),_0x5a9a('0xf'),_0x5a9a('0x10'),_0x5a9a('0x11'),_0x5a9a('0x12'),'data5',_0x5a9a('0x13'),_0x5a9a('0x14')]}]},'log':_0x5a9a('0x3')});};};
\ No newline at end of file
index 95b0742..2f0e2d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5ec=['registry','../client','getTrunks','GetTrunk','name'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xb5ec,0x97));var _0xcb5e=function(_0xa61c4f,_0x19623c){_0xa61c4f=_0xa61c4f-0x0;var _0x1926c2=_0xb5ec[_0xa61c4f];return _0x1926c2;};'use strict';var client=require(_0xcb5e('0x0'));exports[_0xcb5e('0x1')]=function(_0x2f9b56){return function(_0x29a9ca){return client['Request'](_0xcb5e('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xcb5e('0x3'),_0xcb5e('0x4'),'defaultuser']},'log':_0xcb5e('0x2')});};};
\ No newline at end of file
+var _0xf3be=['Request','GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x39c009,_0x21b330){var _0x2c6cb8=function(_0xad6ad3){while(--_0xad6ad3){_0x39c009['push'](_0x39c009['shift']());}};_0x2c6cb8(++_0x21b330);}(_0xf3be,0x178));var _0xef3b=function(_0x446f35,_0x522e92){_0x446f35=_0x446f35-0x0;var _0x3f5897=_0xf3be[_0x446f35];return _0x3f5897;};'use strict';var client=require(_0xef3b('0x0'));exports[_0xef3b('0x1')]=function(_0xdeb7b1){return function(_0x2d91c8){return client[_0xef3b('0x2')](_0xef3b('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xef3b('0x4'),_0xef3b('0x5'),_0xef3b('0x6')]},'log':_0xef3b('0x3')});};};
\ No newline at end of file
index 1d3c350..375f29f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['agent','lastPauseAt','interface','../client','getAgents','Request','name','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','phone','mobile','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'lastPauseAt',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'interface']},'log':'getAgents'});};};exports[_0x0a9e('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0a9e('0xd')},'attributes':['id',_0x0a9e('0x3'),_0x0a9e('0x4'),_0x0a9e('0xe')]},'log':_0x0a9e('0xc')});};};exports[_0x0a9e('0xf')]=function(_0x4a4c56,_0x50dfb2,_0x527cdd){return client['Request'](_0x0a9e('0x10'),{'body':{'type':_0x50dfb2,'uniqueid':_0x527cdd},'options':{'where':{'id':_0x4a4c56['id']}},'log':_0x0a9e('0xf')});};exports[_0x0a9e('0x11')]=function(_0x26d672){return client[_0x0a9e('0x2')](_0x0a9e('0x12'),{'body':{},'options':{'where':{'id':_0x26d672['id']}},'log':'savePause'});};exports[_0x0a9e('0x13')]=function(_0x239b12){return client[_0x0a9e('0x2')](_0x0a9e('0x14'),{'options':{'raw':![],'where':{'role':_0x0a9e('0x15'),'id':_0x239b12},'attributes':['id',_0x0a9e('0x3'),'email',_0x0a9e('0x4'),'fullname',_0x0a9e('0x6'),'lastLoginAt',_0x0a9e('0x8'),_0x0a9e('0x16'),'voicePause',_0x0a9e('0x17')]},'log':'getAgent'});};
\ No newline at end of file
+var _0x0713=['getAgent','Request','GetUser','agent','name','email','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getAgents','getTelephones','accountcode','internal','savePause','PauseUser'];(function(_0x27c7b2,_0x265380){var _0x356718=function(_0xe1a511){while(--_0xe1a511){_0x27c7b2['push'](_0x27c7b2['shift']());}};_0x356718(++_0x265380);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'where':{'role':_0x3071('0x2')},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),'accountcode',_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),_0x3071('0xb'),_0x3071('0xc'),_0x3071('0xd')]},'log':_0x3071('0xe')});};};exports[_0x3071('0xf')]=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x3071('0x3'),_0x3071('0x10'),_0x3071('0x11')]},'log':_0x3071('0xf')});};};exports[_0x3071('0x12')]=function(_0x4a470a,_0x2ace21,_0x11a7ee){return client[_0x3071('0x0')](_0x3071('0x13'),{'body':{'type':_0x2ace21,'uniqueid':_0x11a7ee},'options':{'where':{'id':_0x4a470a['id']}},'log':_0x3071('0x12')});};exports['saveUnpause']=function(_0x5330a8){return client[_0x3071('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x5330a8['id']}},'log':_0x3071('0x12')});};exports[_0x3071('0x14')]=function(_0x5d4883){return client[_0x3071('0x0')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x3071('0x2'),'id':_0x5d4883},'attributes':['id',_0x3071('0x3'),_0x3071('0x4'),_0x3071('0x10'),_0x3071('0x5'),_0x3071('0x6'),_0x3071('0x7'),_0x3071('0x8'),_0x3071('0x9'),_0x3071('0xa'),'interface']},'log':_0x3071('0x14')});};
\ No newline at end of file
index 1eec197..4ebb570 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57b9=['update','Request','UpdateVoiceAgentReport','../client'];(function(_0x34a44d,_0x152e51){var _0x277a68=function(_0xa5104){while(--_0xa5104){_0x34a44d['push'](_0x34a44d['shift']());}};_0x277a68(++_0x152e51);}(_0x57b9,0x6b));var _0x957b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x57b9[_0x8a969d];return _0x1d8dc7;};'use strict';var client=require(_0x957b('0x0'));exports['create']=function(_0x1f671d){return client['Request']('CreateVoiceAgentReport',{'body':_0x1f671d,'log':'CreateVoiceAgentReport'});};exports[_0x957b('0x1')]=function(_0x391aab,_0x2ff327,_0x431172){return client[_0x957b('0x2')](_0x957b('0x3'),{'body':_0x391aab,'options':{'where':{'uniqueid':_0x2ff327,'interface':_0x431172,'agentcomplete':!![]}},'log':_0x957b('0x3')});};
\ No newline at end of file
+var _0x5ff0=['create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client'];(function(_0x1d8119,_0xc98f17){var _0x3e30f6=function(_0x2c7f3e){while(--_0x2c7f3e){_0x1d8119['push'](_0x1d8119['shift']());}};_0x3e30f6(++_0xc98f17);}(_0x5ff0,0x90));var _0x05ff=function(_0x39f2ed,_0x25fc89){_0x39f2ed=_0x39f2ed-0x0;var _0x4d04f0=_0x5ff0[_0x39f2ed];return _0x4d04f0;};'use strict';var client=require(_0x05ff('0x0'));exports[_0x05ff('0x1')]=function(_0x341afd){return client['Request'](_0x05ff('0x2'),{'body':_0x341afd,'log':_0x05ff('0x2')});};exports[_0x05ff('0x3')]=function(_0x265663,_0x523c4f,_0x566a63){return client['Request'](_0x05ff('0x4'),{'body':_0x265663,'options':{'where':{'uniqueid':_0x523c4f,'interface':_0x566a63,'agentcomplete':!![]}},'log':_0x05ff('0x4')});};
\ No newline at end of file
index df6f49b..f5ed3ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b41=['GetVoiceCallReport','outbound','startOf','day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','moment','util','../client','merge','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request'];(function(_0x123450,_0x491c01){var _0x23b29d=function(_0x2c23cb){while(--_0x2c23cb){_0x123450['push'](_0x123450['shift']());}};_0x23b29d(++_0x491c01);}(_0x9b41,0x74));var _0x19b4=function(_0x28ba9b,_0x3c0681){_0x28ba9b=_0x28ba9b-0x0;var _0x3c0068=_0x9b41[_0x28ba9b];return _0x3c0068;};'use strict';var moment=require(_0x19b4('0x0'));var util=require(_0x19b4('0x1'));var _=require('lodash');var client=require(_0x19b4('0x2'));exports['create']=function(_0x2a6f5d){return client['Request']('CreateVoiceCallReport',{'body':_[_0x19b4('0x3')](_0x2a6f5d,{'source':_0x2a6f5d['calleridnum'],'destinationcontext':_0x2a6f5d[_0x19b4('0x4')],'callerid':_0x2a6f5d[_0x19b4('0x5')],'amaflags':_0x19b4('0x6')}),'log':_0x19b4('0x7')});};exports[_0x19b4('0x8')]=function(){return function(){return client[_0x19b4('0x9')](_0x19b4('0xa'),{'options':{'where':{'type':[_0x19b4('0xb')],'createdAt':{'$between':[moment()[_0x19b4('0xc')](_0x19b4('0xd'))[_0x19b4('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x19b4('0xf')](_0x19b4('0xd'))[_0x19b4('0xe')](_0x19b4('0x10'))]}},'attributes':[_0x19b4('0x11'),_0x19b4('0x12'),_0x19b4('0x13'),_0x19b4('0x14')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0xd430=['calleridnum','context','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','type','billableseconds','moment','util','lodash','../client','create','Request'];(function(_0x443b85,_0x559bc9){var _0x4d1d7c=function(_0x4ec43f){while(--_0x4ec43f){_0x443b85['push'](_0x443b85['shift']());}};_0x4d1d7c(++_0x559bc9);}(_0xd430,0x1b2));var _0x0d43=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xd430[_0x9df060];return _0x338dfe;};'use strict';var moment=require(_0x0d43('0x0'));var util=require(_0x0d43('0x1'));var _=require(_0x0d43('0x2'));var client=require(_0x0d43('0x3'));exports[_0x0d43('0x4')]=function(_0x106c32){return client[_0x0d43('0x5')]('CreateVoiceCallReport',{'body':_['merge'](_0x106c32,{'source':_0x106c32[_0x0d43('0x6')],'destinationcontext':_0x106c32[_0x0d43('0x7')],'callerid':_0x106c32['callerid'],'amaflags':_0x0d43('0x8')}),'log':_0x0d43('0x9')});};exports[_0x0d43('0xa')]=function(){return function(){return client[_0x0d43('0x5')](_0x0d43('0xb'),{'options':{'where':{'type':[_0x0d43('0xc')],'createdAt':{'$between':[moment()[_0x0d43('0xd')]('day')[_0x0d43('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x0d43('0xf')](_0x0d43('0x10'))['format'](_0x0d43('0x11'))]}},'attributes':[_0x0d43('0x12'),'disposition','duration',_0x0d43('0x13')]},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
index 148480e..c837688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68aa=['Request','CreateVoiceDialReport','../client'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x68aa,0x15e));var _0xa68a=function(_0x25b395,_0x3fb998){_0x25b395=_0x25b395-0x0;var _0x281fe5=_0x68aa[_0x25b395];return _0x281fe5;};'use strict';var client=require(_0xa68a('0x0'));exports['create']=function(_0x226369){return client[_0xa68a('0x1')](_0xa68a('0x2'),{'body':_0x226369,'log':_0xa68a('0x2')});};
\ No newline at end of file
+var _0x3126=['CreateVoiceDialReport','../client','create','Request'];(function(_0x10634b,_0x4e8e3a){var _0x3b4be2=function(_0x48d758){while(--_0x48d758){_0x10634b['push'](_0x10634b['shift']());}};_0x3b4be2(++_0x4e8e3a);}(_0x3126,0x1bd));var _0x6312=function(_0x3040f3,_0x2c3981){_0x3040f3=_0x3040f3-0x0;var _0x3d1d64=_0x3126[_0x3040f3];return _0x3d1d64;};'use strict';var client=require(_0x6312('0x0'));exports[_0x6312('0x1')]=function(_0x2cc2f5){return client[_0x6312('0x2')](_0x6312('0x3'),{'body':_0x2cc2f5,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
index 1772572..5ef6a29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e21=['Request','exten','../client','getVoiceExtensions'];(function(_0x5f49ba,_0x12690a){var _0x45f6eb=function(_0xb44291){while(--_0xb44291){_0x5f49ba['push'](_0x5f49ba['shift']());}};_0x45f6eb(++_0x12690a);}(_0x2e21,0xba));var _0x12e2=function(_0x10ae21,_0x291f65){_0x10ae21=_0x10ae21-0x0;var _0x4cbb6a=_0x2e21[_0x10ae21];return _0x4cbb6a;};'use strict';var client=require(_0x12e2('0x0'));exports[_0x12e2('0x1')]=function(){return function(){return client[_0x12e2('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x12e2('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x12e2('0x1')});};};
\ No newline at end of file
+var _0xaa1b=['getVoiceExtensions','Request','exten','../client'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0xbaa1('0x0'));exports[_0xbaa1('0x1')]=function(){return function(){return client[_0xbaa1('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xbaa1('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xbaa1('0x1')});};};
\ No newline at end of file
index 1a559b5..021eb5c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbda=['dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber'];(function(_0x39a146,_0x40e214){var _0x5d9a3d=function(_0x39c42b){while(--_0x39c42b){_0x39a146['push'](_0x39a146['shift']());}};_0x5d9a3d(++_0x40e214);}(_0xcbda,0x1e9));var _0xacbd=function(_0x67d4f5,_0xed252c){_0x67d4f5=_0x67d4f5-0x0;var _0x3c98b6=_0xcbda[_0x67d4f5];return _0x3c98b6;};'use strict';var client=require(_0xacbd('0x0'));exports[_0xacbd('0x1')]=function(){return function(){return client[_0xacbd('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xacbd('0x3'),_0xacbd('0x4'),_0xacbd('0x5'),_0xacbd('0x6'),_0xacbd('0x7'),_0xacbd('0x8'),'dialActive',_0xacbd('0x9'),'dialLimitChannel','dialLimitQueue',_0xacbd('0xa'),_0xacbd('0xb'),_0xacbd('0xc'),'dialPredictiveInterval',_0xacbd('0xd'),_0xacbd('0xe'),'dialOriginateTimeout',_0xacbd('0xf'),_0xacbd('0x10'),_0xacbd('0x11'),'dialCongestionMaxRetry',_0xacbd('0x12'),_0xacbd('0x13'),_0xacbd('0x14'),_0xacbd('0x15'),_0xacbd('0x16'),_0xacbd('0x17'),_0xacbd('0x18'),'dialGlobalInterval',_0xacbd('0x19'),_0xacbd('0x1a'),_0xacbd('0x1b'),'dialAMDInitialSilence',_0xacbd('0x1c'),_0xacbd('0x1d'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0xacbd('0x1e'),_0xacbd('0x1f'),_0xacbd('0x20'),_0xacbd('0x21'),_0xacbd('0x22'),'dialRecallMeTimeout',_0xacbd('0x23'),_0xacbd('0x24'),_0xacbd('0x25'),_0xacbd('0x26'),_0xacbd('0x27'),_0xacbd('0x7'),'strategy',_0xacbd('0x28'),_0xacbd('0x29'),'dialNoSuchNumberMaxRetry',_0xacbd('0x2a'),'dialDropMaxRetry',_0xacbd('0x2b'),_0xacbd('0x2c'),_0xacbd('0x2d'),_0xacbd('0x2e'),_0xacbd('0x2f'),_0xacbd('0x30'),_0xacbd('0x31'),'mandatoryDisposition',_0xacbd('0x32'),_0xacbd('0x33'),_0xacbd('0x34'),_0xacbd('0x35'),'callAdditionalPhoneAfterMin'],'include':[{'model':_0xacbd('0x36'),'as':_0xacbd('0x36'),'attributes':['id',_0xacbd('0x3'),_0xacbd('0x37'),_0xacbd('0x38')]},{'model':_0xacbd('0x39'),'as':_0xacbd('0x3a'),'attributes':['id',_0xacbd('0x3')]},{'model':_0xacbd('0x36'),'as':_0xacbd('0x3b'),'attributes':['id',_0xacbd('0x3'),'callerid',_0xacbd('0x38')]},{'model':'Interval','as':_0xacbd('0x3c'),'attributes':['id',_0xacbd('0x3')],'include':[{'model':_0xacbd('0x3c'),'as':_0xacbd('0x3d'),'attributes':['id',_0xacbd('0x3'),_0xacbd('0x3e')]}]}]},'log':_0xacbd('0x1')});};};
\ No newline at end of file
+var _0xb902=['Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','strategy','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','callAdditionalPhoneAfterMin','Trunk','callerid'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb902,0xf0));var _0x2b90=function(_0x4b9e3c,_0x8ec6e6){_0x4b9e3c=_0x4b9e3c-0x0;var _0xf0b239=_0xb902[_0x4b9e3c];return _0xf0b239;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0x2b90('0x0')](_0x2b90('0x1'),{'options':{'raw':![],'attributes':['id',_0x2b90('0x2'),_0x2b90('0x3'),_0x2b90('0x4'),_0x2b90('0x5'),_0x2b90('0x6'),'type',_0x2b90('0x7'),'dialMethod',_0x2b90('0x8'),'dialLimitQueue',_0x2b90('0x9'),_0x2b90('0xa'),_0x2b90('0xb'),_0x2b90('0xc'),_0x2b90('0xd'),_0x2b90('0xe'),_0x2b90('0xf'),_0x2b90('0x10'),'dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry',_0x2b90('0x11'),_0x2b90('0x12'),_0x2b90('0x13'),_0x2b90('0x14'),_0x2b90('0x15'),_0x2b90('0x16'),_0x2b90('0x17'),_0x2b90('0x18'),'dialPrefix',_0x2b90('0x19'),_0x2b90('0x1a'),'dialAMDInitialSilence',_0x2b90('0x1b'),_0x2b90('0x1c'),'dialAMDTotalAnalysisTime','dialAMDMinWordLength',_0x2b90('0x1d'),_0x2b90('0x1e'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout',_0x2b90('0x1f'),_0x2b90('0x20'),_0x2b90('0x21'),'dialAgiAfterHangupAgent',_0x2b90('0x22'),'dialQueueProject2',_0x2b90('0x6'),_0x2b90('0x23'),'dialRandomLastDigitCallerIdNumber',_0x2b90('0x24'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x2b90('0x25'),_0x2b90('0x26'),_0x2b90('0x27'),_0x2b90('0x28'),_0x2b90('0x29'),'dialMachineRetryFrequency',_0x2b90('0x2a'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x2b90('0x2b'),_0x2b90('0x2c'),_0x2b90('0x2d'),_0x2b90('0x2e'),_0x2b90('0x2f')],'include':[{'model':'Trunk','as':_0x2b90('0x30'),'attributes':['id',_0x2b90('0x2'),_0x2b90('0x31'),'active']},{'model':_0x2b90('0x32'),'as':_0x2b90('0x33'),'attributes':['id',_0x2b90('0x2')]},{'model':_0x2b90('0x30'),'as':_0x2b90('0x34'),'attributes':['id',_0x2b90('0x2'),_0x2b90('0x31'),_0x2b90('0x35')]},{'model':_0x2b90('0x36'),'as':'Interval','attributes':['id',_0x2b90('0x2')],'include':[{'model':_0x2b90('0x36'),'as':_0x2b90('0x37'),'attributes':['id',_0x2b90('0x2'),_0x2b90('0x38')]}]}]},'log':_0x2b90('0x39')});};};
\ No newline at end of file
index 36c4941..826b970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x138fa1,_0x41c088){var _0x5eb3e7=function(_0x347714){while(--_0x347714){_0x138fa1['push'](_0x138fa1['shift']());}};_0x5eb3e7(++_0x41c088);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x160182,_0x4cf21a){var _0x1c1e78=function(_0x248245){while(--_0x248245){_0x160182['push'](_0x160182['shift']());}};_0x1c1e78(++_0x4cf21a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index f30856a..505cf8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d91=['getVoiceQueueRtPauses','Request'];(function(_0x4b67e1,_0x1f1e43){var _0x46a20f=function(_0x3026e7){while(--_0x3026e7){_0x4b67e1['push'](_0x4b67e1['shift']());}};_0x46a20f(++_0x1f1e43);}(_0x0d91,0x156));var _0x10d9=function(_0x3560de,_0x28b150){_0x3560de=_0x3560de-0x0;var _0x2d31c1=_0x0d91[_0x3560de];return _0x2d31c1;};'use strict';var client=require('../client');exports[_0x10d9('0x0')]=function(_0x582d22){return function(){return client[_0x10d9('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x582d22,'paused':!![]},'raw':!![]},'log':_0x10d9('0x0')});};};
\ No newline at end of file
+var _0x5603=['../client','getVoiceQueueRtPauses'];(function(_0x3cacdc,_0x18f792){var _0x46daa4=function(_0x4c9923){while(--_0x4c9923){_0x3cacdc['push'](_0x3cacdc['shift']());}};_0x46daa4(++_0x18f792);}(_0x5603,0x1ac));var _0x3560=function(_0x2ef0f0,_0x1f8939){_0x2ef0f0=_0x2ef0f0-0x0;var _0x20ff51=_0x5603[_0x2ef0f0];return _0x20ff51;};'use strict';var client=require(_0x3560('0x0'));exports[_0x3560('0x1')]=function(_0x3e9e04){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x3e9e04,'paused':!![]},'raw':!![]},'log':_0x3560('0x1')});};};
\ No newline at end of file
index edf913e..2eab915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5ac1f9,_0x16af55){var _0x1f533e=function(_0x5d5f49){while(--_0x5d5f49){_0x5ac1f9['push'](_0x5ac1f9['shift']());}};_0x1f533e(++_0x16af55);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x5a6de9,_0x9277e6){var _0x3a7978=function(_0x5a0662){while(--_0x5a0662){_0x5a6de9['push'](_0x5a6de9['shift']());}};_0x3a7978(++_0x9277e6);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
index e4904e1..c671cd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f55=['origtransfererexten','../client','transfers','blindTransfer','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','isexternal','context','extension','CreateVoiceTransferReport','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3f55,0x119));var _0x53f5=function(_0x188379,_0x7fa345){_0x188379=_0x188379-0x0;var _0x3d8a8f=_0x3f55[_0x188379];return _0x3d8a8f;};'use strict';var client=require(_0x53f5('0x0'));exports[_0x53f5('0x1')]={};exports[_0x53f5('0x2')]=function(_0x214258){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x214258['result'],'transfererchannel':_0x214258[_0x53f5('0x3')],'transferercalleridnum':_0x214258[_0x53f5('0x4')],'transferercalleridname':_0x214258[_0x53f5('0x5')],'transfererconnectedlinenum':_0x214258[_0x53f5('0x6')],'transfererconnectedlinename':_0x214258[_0x53f5('0x7')],'transfereraccountcode':_0x214258[_0x53f5('0x8')],'transferercontext':_0x214258['transferercontext'],'transfererexten':_0x214258[_0x53f5('0x9')],'transfererlinkedid':_0x214258[_0x53f5('0xa')],'transfereechannel':_0x214258[_0x53f5('0xb')],'transfereecalleridnum':_0x214258['transfereecalleridnum'],'transfereecalleridname':_0x214258[_0x53f5('0xc')],'transfereeconnectedlinenum':_0x214258['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x214258[_0x53f5('0xd')],'transfereeaccountcode':_0x214258[_0x53f5('0xe')],'transfereecontext':_0x214258[_0x53f5('0xf')],'transfereeexten':_0x214258['transfereeexten'],'transfereelinkedid':_0x214258['transfereelinkedid'],'isexternal':_0x214258[_0x53f5('0x10')],'context':_0x214258[_0x53f5('0x11')],'extension':_0x214258[_0x53f5('0x12')],'type':'blind'},'log':_0x53f5('0x13')});};exports[_0x53f5('0x14')]=function(_0x4731be){return client['Request'](_0x53f5('0x13'),{'body':{'result':_0x4731be[_0x53f5('0x15')],'transfererchannel':_0x4731be[_0x53f5('0x16')],'transferercalleridnum':_0x4731be[_0x53f5('0x17')],'transferercalleridname':_0x4731be[_0x53f5('0x18')],'transfererconnectedlinenum':_0x4731be[_0x53f5('0x19')],'transfererconnectedlinename':_0x4731be[_0x53f5('0x1a')],'transfereraccountcode':_0x4731be[_0x53f5('0x1b')],'transferercontext':_0x4731be[_0x53f5('0x1c')],'transfererexten':_0x4731be[_0x53f5('0x1d')],'transfererlinkedid':_0x4731be['origtransfererlinkedid'],'transfereechannel':_0x4731be[_0x53f5('0x1e')],'transfereecalleridnum':_0x4731be[_0x53f5('0x1f')],'transfereecalleridname':_0x4731be[_0x53f5('0x20')],'transfereeconnectedlinenum':_0x4731be['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x4731be[_0x53f5('0x21')],'transfereeaccountcode':_0x4731be[_0x53f5('0x22')],'transfereecontext':_0x4731be[_0x53f5('0x23')],'transfereeexten':_0x4731be[_0x53f5('0x24')],'transfereelinkedid':_0x4731be[_0x53f5('0x25')],'isexternal':_0x4731be['isexternal'],'context':_0x4731be[_0x53f5('0x26')],'extension':_0x4731be[_0x53f5('0x27')],'type':'attended'},'log':_0x53f5('0x13')});};
\ No newline at end of file
+var _0x4824=['transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereecontext','transfereelinkedid','context','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','attended','../client','transfers','Request','result','transfererchannel','transferercalleridname'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4824,0x158));var _0x4482=function(_0x4d89e3,_0x2267e1){_0x4d89e3=_0x4d89e3-0x0;var _0x39857c=_0x4824[_0x4d89e3];return _0x39857c;};'use strict';var client=require(_0x4482('0x0'));exports[_0x4482('0x1')]={};exports['blindTransfer']=function(_0xb489e){return client[_0x4482('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xb489e[_0x4482('0x3')],'transfererchannel':_0xb489e[_0x4482('0x4')],'transferercalleridnum':_0xb489e['transferercalleridnum'],'transferercalleridname':_0xb489e[_0x4482('0x5')],'transfererconnectedlinenum':_0xb489e['transfererconnectedlinenum'],'transfererconnectedlinename':_0xb489e[_0x4482('0x6')],'transfereraccountcode':_0xb489e[_0x4482('0x7')],'transferercontext':_0xb489e[_0x4482('0x8')],'transfererexten':_0xb489e[_0x4482('0x9')],'transfererlinkedid':_0xb489e[_0x4482('0xa')],'transfereechannel':_0xb489e[_0x4482('0xb')],'transfereecalleridnum':_0xb489e['transfereecalleridnum'],'transfereecalleridname':_0xb489e[_0x4482('0xc')],'transfereeconnectedlinenum':_0xb489e[_0x4482('0xd')],'transfereeconnectedlinename':_0xb489e['transfereeconnectedlinename'],'transfereeaccountcode':_0xb489e[_0x4482('0xe')],'transfereecontext':_0xb489e[_0x4482('0xf')],'transfereeexten':_0xb489e['transfereeexten'],'transfereelinkedid':_0xb489e[_0x4482('0x10')],'isexternal':_0xb489e['isexternal'],'context':_0xb489e[_0x4482('0x11')],'extension':_0xb489e['extension'],'type':'blind'},'log':_0x4482('0x12')});};exports[_0x4482('0x13')]=function(_0x5285e0){return client[_0x4482('0x2')](_0x4482('0x12'),{'body':{'result':_0x5285e0[_0x4482('0x3')],'transfererchannel':_0x5285e0[_0x4482('0x14')],'transferercalleridnum':_0x5285e0[_0x4482('0x15')],'transferercalleridname':_0x5285e0[_0x4482('0x16')],'transfererconnectedlinenum':_0x5285e0['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5285e0[_0x4482('0x17')],'transfereraccountcode':_0x5285e0[_0x4482('0x18')],'transferercontext':_0x5285e0[_0x4482('0x19')],'transfererexten':_0x5285e0['secondtransfererexten'],'transfererlinkedid':_0x5285e0['origtransfererlinkedid'],'transfereechannel':_0x5285e0[_0x4482('0x1a')],'transfereecalleridnum':_0x5285e0[_0x4482('0x1b')],'transfereecalleridname':_0x5285e0[_0x4482('0x1c')],'transfereeconnectedlinenum':_0x5285e0[_0x4482('0x1d')],'transfereeconnectedlinename':_0x5285e0['transfertargetconnectedlinename'],'transfereeaccountcode':_0x5285e0['transfertargetaccountcode'],'transfereecontext':_0x5285e0[_0x4482('0x1e')],'transfereeexten':_0x5285e0[_0x4482('0x1f')],'transfereelinkedid':_0x5285e0['transfertargetlinkedid'],'isexternal':_0x5285e0[_0x4482('0x20')],'context':_0x5285e0[_0x4482('0x21')],'extension':_0x5285e0['origtransfererexten'],'type':_0x4482('0x22')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 510ba19..238065f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','stop','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','outbound','campaigns','event','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','moment','../../../config/environment','listen','SIP','timers','timer','updateAcw','agents','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','catch','error','command','Command','message','voiceQueues','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','channels','voicechannel','uniqueid','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase'];(function(_0x1e4150,_0x55b02a){var _0x1ce3ee=function(_0x59324e){while(--_0x59324e){_0x1e4150['push'](_0x1e4150['shift']());}};_0x1ce3ee(++_0x55b02a);}(_0xac4a,0x13f));var _0xaac4=function(_0x554aaf,_0x129462){_0x554aaf=_0x554aaf-0x0;var _0x2f396c=_0xac4a[_0x554aaf];return _0x2f396c;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var jayson=require(_0xaac4('0x2'));var schema=require(_0xaac4('0x3'));var moment=require(_0xaac4('0x4'));var config=require(_0xaac4('0x5'));var properties=require('../properties');var ami=require('../ami');exports[_0xaac4('0x6')]=function(_0x2a5762,_0x32d34c,_0x58ae95){return new Promise(function(_0x1283a5,_0x53d03a){var _0x1cdfc5={'QueuePause':function(_0x5870e8){return new Promise(function(_0x1e4283){var _0x27354c=util['format']('%s/%s',_0xaac4('0x7'),_0x5870e8['name']);if(_0x2a5762[_0xaac4('0x8')]&&_0x2a5762['timers'][_0x27354c]&&_0x2a5762['timers'][_0x27354c][_0xaac4('0x9')]){_0x2a5762[_0xaac4('0x8')][_0x27354c][_0xaac4('0xa')]();}if(_0x2a5762[_0xaac4('0xb')][_0x27354c]){_0x2a5762[_0xaac4('0xb')][_0x27354c]['updateStatusRealtime']({'statePause':_0x5870e8['pause']?!![]:![]});}_0x1e4283({'code':0xc8,'message':_0xaac4('0xc')});});},'Reload':function(_0x2e2d02){var _0x45e512=this;return new Promise(function(_0x5a4801,_0x6a808d){if(ami[_0xaac4('0xd')]()==![]){return _0x6a808d(_0x45e512['error'](0x1f4,[config[_0xaac4('0xe')]['ip'],config[_0xaac4('0xe')][_0xaac4('0xf')],_0xaac4('0x10')][_0xaac4('0x11')]('\x20')));}_0x2e2d02=_[_0xaac4('0x12')](_0x2e2d02,_[_0xaac4('0x13')](properties[_0xaac4('0x14')]));_0x2e2d02[_0xaac4('0x15')]=_0xaac4('0x16');return ami[_0xaac4('0x17')](_0x2e2d02)[_0xaac4('0x18')](function(_0x3f643c){_0x5a4801({'code':0xc8,'message':_0x3f643c['message']});})[_0xaac4('0x19')](function(_0x52085a){_0x6a808d(_0x45e512[_0xaac4('0x1a')](0x1f5,_0x52085a['message']));});});},'Command':function(_0x3ce35a){var _0x27fe7b=this;return new Promise(function(_0xa22b76,_0x271bcb){if(ami[_0xaac4('0xd')]()==![]){return _0x271bcb(_0x27fe7b[_0xaac4('0x1a')](0x1f4,[config[_0xaac4('0xe')]['ip'],config[_0xaac4('0xe')][_0xaac4('0xf')],'ami\x20disconnected'][_0xaac4('0x11')]('\x20')));}_0x3ce35a=_['pick'](_0x3ce35a,_0xaac4('0x1b'));_0x3ce35a[_0xaac4('0x15')]=_0xaac4('0x1c');return ami[_0xaac4('0x17')](_0x3ce35a)[_0xaac4('0x18')](function(_0x383a8c){_0xa22b76({'code':0xc8,'message':_0x383a8c['content']});})[_0xaac4('0x19')](function(_0x27a84d){_0x271bcb(_0x27fe7b[_0xaac4('0x1a')](0x1f5,_0x27a84d[_0xaac4('0x1d')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3dd059){var _0x2dcc59=[];for(var _0xb2577b in _0x2a5762['voiceQueues']){if(_0x2a5762[_0xaac4('0x1e')]['hasOwnProperty'](_0xb2577b)){var _0x54203b=_0x2a5762['voiceQueues'][_0xb2577b];var _0x5a0bb3={'id':_0x54203b['id'],'name':_0x54203b[_0xaac4('0x1f')],'strategy':_0x54203b[_0xaac4('0x20')],'answered':_0x54203b[_0xaac4('0x21')],'available':_0x54203b[_0xaac4('0x22')],'loggedIn':_0x54203b[_0xaac4('0x23')],'pTalking':_0x54203b[_0xaac4('0x24')],'sumBillable':_0x54203b[_0xaac4('0x25')],'sumDuration':_0x54203b[_0xaac4('0x26')],'sumHoldTime':_0x54203b[_0xaac4('0x27')]||0x0,'talking':_0x54203b[_0xaac4('0x28')],'total':_0x54203b['total'],'type':_0x54203b[_0xaac4('0x29')],'unmanaged':_0x54203b[_0xaac4('0x2a')],'abandoned':_0x54203b[_0xaac4('0x2b')],'waiting':_0x54203b[_0xaac4('0x2c')],'loggedInDb':_0x54203b[_0xaac4('0x2d')]};if(_0x54203b[_0xaac4('0x29')]==='outbound'){_0x5a0bb3[_0xaac4('0x2e')]=_0x54203b['dialActive'];_0x5a0bb3[_0xaac4('0x2f')]=_0x54203b[_0xaac4('0x2f')];_0x5a0bb3[_0xaac4('0x30')]=_0x54203b[_0xaac4('0x30')];_0x5a0bb3['dialOriginateCallerIdNumber']=_0x54203b['dialOriginateCallerIdNumber'];_0x5a0bb3['dialOriginateTimeout']=_0x54203b[_0xaac4('0x31')];_0x5a0bb3[_0xaac4('0x32')]=_0x54203b[_0xaac4('0x32')];_0x5a0bb3[_0xaac4('0x33')]=_0x54203b[_0xaac4('0x33')];_0x5a0bb3[_0xaac4('0x34')]=_0x54203b[_0xaac4('0x34')];_0x5a0bb3[_0xaac4('0x35')]=_0x54203b[_0xaac4('0x35')];_0x5a0bb3[_0xaac4('0x36')]=_0x54203b[_0xaac4('0x36')];_0x5a0bb3[_0xaac4('0x37')]=_0x54203b[_0xaac4('0x37')];_0x5a0bb3[_0xaac4('0x38')]=_0x54203b[_0xaac4('0x38')];_0x5a0bb3['outboundDropCallsDayACS']=_0x54203b['outboundDropCallsDayACS'];_0x5a0bb3[_0xaac4('0x39')]=_0x54203b[_0xaac4('0x39')];_0x5a0bb3[_0xaac4('0x3a')]=_0x54203b['outboundDropCallsDayTimeout'];_0x5a0bb3[_0xaac4('0x3b')]=_0x54203b[_0xaac4('0x3b')];_0x5a0bb3[_0xaac4('0x3c')]=_0x54203b[_0xaac4('0x3c')];_0x5a0bb3[_0xaac4('0x3d')]=_0x54203b[_0xaac4('0x3d')];_0x5a0bb3[_0xaac4('0x3e')]=_0x54203b['outboundReCallsDay'];_0x5a0bb3[_0xaac4('0x3f')]=_0x54203b[_0xaac4('0x3f')];_0x5a0bb3[_0xaac4('0x40')]=_0x54203b['outboundUnknownCallsDay'];_0x5a0bb3[_0xaac4('0x41')]=_0x54203b['predictiveIntervalAnsweredCalls'];_0x5a0bb3['predictiveIntervalAvgHoldtime']=_0x54203b[_0xaac4('0x42')];_0x5a0bb3[_0xaac4('0x43')]=_0x54203b[_0xaac4('0x43')];_0x5a0bb3['predictiveIntervalDroppedCallsCallersExit']=_0x54203b['predictiveIntervalDroppedCallsCallersExit'];_0x5a0bb3[_0xaac4('0x44')]=_0x54203b[_0xaac4('0x44')];_0x5a0bb3[_0xaac4('0x45')]=_0x54203b[_0xaac4('0x45')];_0x5a0bb3[_0xaac4('0x46')]=_0x54203b[_0xaac4('0x46')];_0x5a0bb3['predictiveIntervalHitRate']=_0x54203b['predictiveIntervalHitRate'];_0x5a0bb3[_0xaac4('0x47')]=_0x54203b[_0xaac4('0x47')];_0x5a0bb3['predictiveIntervalPauses']=_0x54203b[_0xaac4('0x48')];_0x5a0bb3[_0xaac4('0x49')]=_0x54203b[_0xaac4('0x49')];_0x5a0bb3['predictiveIntervalTotalCalls']=_0x54203b[_0xaac4('0x4a')];_0x5a0bb3[_0xaac4('0x1d')]=_0x54203b[_0xaac4('0x1d')];_0x5a0bb3['originated']=_0x54203b[_0xaac4('0x4b')];_0x5a0bb3[_0xaac4('0x4c')]=_0x54203b[_0xaac4('0x4c')];_0x5a0bb3[_0xaac4('0x4d')]=_0x54203b['erlangCallToSecond'];_0x5a0bb3[_0xaac4('0x4e')]=_0x54203b['erlangAbandonmentRate'];_0x5a0bb3['erlangBusyFactor']=_0x54203b[_0xaac4('0x4f')];_0x5a0bb3[_0xaac4('0x50')]=_0x54203b[_0xaac4('0x50')];_0x5a0bb3[_0xaac4('0x51')]=_0x54203b[_0xaac4('0x51')];}if(_0x54203b[_0xaac4('0x52')]){_0x5a0bb3[_0xaac4('0x52')]={'id':_0x54203b[_0xaac4('0x52')]['id'],'name':_0x54203b['Trunk'][_0xaac4('0x1f')],'active':_0x54203b[_0xaac4('0x52')][_0xaac4('0x53')],'callerid':_0x54203b[_0xaac4('0x52')]['callerid']};}if(_0x54203b[_0xaac4('0x54')]){_0x5a0bb3[_0xaac4('0x54')]={'id':_0x54203b[_0xaac4('0x54')]['id'],'name':_0x54203b['Interval'][_0xaac4('0x1f')]};}_0x2dcc59[_0xaac4('0x55')](_0x5a0bb3);}}_0x3dd059({'count':_0x2dcc59[_0xaac4('0x56')],'rows':_0x2dcc59});});},'UpdateVoiceQueue':function(_0x2b9030){return new Promise(function(_0x5e6f37,_0x10047d){var _0x46e338=_[_0xaac4('0x57')](_0x2a5762['voiceQueues'],{'id':parseInt(_0x2b9030['id'])});var _0xf404b9=_[_0xaac4('0x58')](_0x2b9030,['id']);if(_0x46e338){for(var _0x42e0dc in _0xf404b9){if(typeof _0xf404b9[_0x42e0dc]!==_0xaac4('0x59')&&typeof _0x46e338[_0x42e0dc]!==_0xaac4('0x59')){_0x46e338[_0x42e0dc]=_0xf404b9[_0x42e0dc];}}_0x5e6f37(_0x46e338);}else{_0x10047d();}});},'VoiceChannels':function(){return new Promise(function(_0x1ad713){var _0x25e1b1=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0x5b')]);_0x1ad713({'count':_0x25e1b1['length'],'rows':_0x25e1b1});});},'VoiceChannelMixMonitor':function(_0x10223a){var _0x1df765=this;return new Promise(function(_0x27425a,_0x360420){if(ami[_0xaac4('0xd')]()==![]){return _0x360420(_0x1df765['error'](0x1f4,[config['asterisk']['ip'],config[_0xaac4('0xe')][_0xaac4('0xf')],_0xaac4('0x10')][_0xaac4('0x11')]('\x20')));}var _0x5f33ea=schema(properties[_0xaac4('0x5c')])['validate'](_0x10223a);if(_0x5f33ea[_0xaac4('0x56')]>0x0){return _0x360420(_0x1df765[_0xaac4('0x1a')](0x1f4,_['map'](_0x5f33ea,_0xaac4('0x1d'))[_0xaac4('0x11')](',\x20')));}var _0x357bc6=_['find'](_0x2a5762['channels'],{'uniqueid':_0x10223a[_0xaac4('0x5d')]});if(_0x357bc6&&_0x357bc6[_0xaac4('0x5e')]){var _0x22dda7=util[_0xaac4('0x5f')](_0xaac4('0x60'),_0x10223a[_0xaac4('0x61')]||_0x10223a['uniqueid'],_0x10223a[_0xaac4('0x5f')]||_0xaac4('0x62'));return ami[_0xaac4('0x17')]({'action':_0xaac4('0x63'),'channel':_0x357bc6['channel'],'file':_0x22dda7,'options':_0xaac4('0x64')})['then'](function(_0x33e32f){var _0x3a703c=_[_0xaac4('0x57')](_0x357bc6[_0xaac4('0x65')],{'filename':_0xaac4('0x66')+_0x22dda7[_0xaac4('0x67')]()});if(_[_0xaac4('0x68')](_0x3a703c)){_0x357bc6[_0xaac4('0x65')][_0xaac4('0x55')]({'filename':_0xaac4('0x66')+_0x22dda7[_0xaac4('0x67')](),'createdAt':moment()[_0xaac4('0x5f')](_0xaac4('0x69')),'mixmonitorid':_0x33e32f[_0xaac4('0x6a')],'status':'rec'});}else{_0x3a703c[_0xaac4('0x6a')]=_0x33e32f[_0xaac4('0x6a')];_0x3a703c[_0xaac4('0x6b')]=_0xaac4('0x6c');}_0x27425a({'code':0xc8,'message':[_0x10223a[_0xaac4('0x5d')],_0xaac4('0x6d'),_0x33e32f[_0xaac4('0x6a')]][_0xaac4('0x11')]('\x20'),'mixmonitorid':_0x33e32f['mixmonitorid']});})[_0xaac4('0x19')](function(_0x501664){_0x360420(_0x1df765[_0xaac4('0x1a')](0x1f5,[_0x10223a['uniqueid'],_0x501664[_0xaac4('0x1d')]['toLowerCase']()]['join']('\x20')));});}else{return _0x360420(_0x1df765[_0xaac4('0x1a')](0x1f5,_0xaac4('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x48ae39){var _0x2f287c=this;return new Promise(function(_0x3f66e6,_0xc93260){if(ami[_0xaac4('0xd')]()==![]){return _0xc93260(_0x2f287c[_0xaac4('0x1a')](0x1f4,[config[_0xaac4('0xe')]['ip'],config['asterisk'][_0xaac4('0xf')],'ami\x20disconnected'][_0xaac4('0x11')]('\x20')));}var _0x5ec220=schema(properties['voicechannel'])['validate'](_0x48ae39);if(_0x5ec220[_0xaac4('0x56')]>0x0){return _0xc93260(_0x2f287c[_0xaac4('0x1a')](0x1f4,_[_0xaac4('0x6f')](_0x5ec220,_0xaac4('0x1d'))['join'](',\x20')));}var _0x372f96=_[_0xaac4('0x57')](_0x2a5762[_0xaac4('0x5b')],{'uniqueid':_0x48ae39['uniqueid']});if(_0x372f96){return Promise[_0xaac4('0x70')]()[_0xaac4('0x18')](function(){if(_0x372f96[_0xaac4('0x5e')]){return ami[_0xaac4('0x17')]({'action':_0xaac4('0x71'),'channel':_0x372f96[_0xaac4('0x5e')],'mixmonitorid':_0x48ae39[_0xaac4('0x6a')]})['catch'](function(){});}})['then'](function(){if(_0x372f96[_0xaac4('0x72')]){return ami['Action']({'action':'StopMixMonitor','channel':_0x372f96[_0xaac4('0x72')],'mixmonitorid':_0x48ae39['mixmonitorid']})[_0xaac4('0x19')](function(){});}})['then'](function(){var _0x316012=_[_0xaac4('0x57')](_0x372f96['monitors'],{'mixmonitorid':_0x48ae39['mixmonitorid']});if(_0x316012){_0x316012['status']='stop';}})[_0xaac4('0x18')](function(){var _0x18451f=util[_0xaac4('0x5f')](_0xaac4('0x60'),_0x48ae39['filename']||_0x48ae39[_0xaac4('0x5d')],_0x48ae39[_0xaac4('0x5f')]||_0xaac4('0x62'));var _0x447d99=_[_0xaac4('0x57')](_0x372f96[_0xaac4('0x65')],{'filename':_0xaac4('0x66')+_0x18451f[_0xaac4('0x67')]()});if(_0x447d99){_0x447d99[_0xaac4('0x6b')]=_0xaac4('0x73');}})[_0xaac4('0x18')](function(){_0x3f66e6({'code':0xc8,'message':[_0x48ae39['uniqueid'],'StopMixMonitor\x20Success'][_0xaac4('0x11')]('\x20')});})['catch'](function(_0x5eda2e){_0xc93260(_0x2f287c[_0xaac4('0x1a')](0x1f5,[_0x48ae39['uniqueid'],_0x5eda2e[_0xaac4('0x1d')][_0xaac4('0x67')]()][_0xaac4('0x11')]('\x20')));});}else{return _0xc93260(_0x2f287c[_0xaac4('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x1a49c5){var _0x2de8d4=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0x74')]);_0x1a49c5({'count':_0x2de8d4[_0xaac4('0x56')],'rows':_0x2de8d4});});},'VoiceQueuesChannel':function(_0x3a1b41){var _0x5b20c6=this;return new Promise(function(_0x1db7c7,_0x429661){var _0x5b5e57=schema(properties[_0xaac4('0x75')])[_0xaac4('0x3')](_0x3a1b41);if(_0x5b5e57['length']>0x0){return _0x429661(_0x5b20c6['error'](0x1f4,_[_0xaac4('0x6f')](_0x5b5e57,_0xaac4('0x1d'))[_0xaac4('0x11')](',\x20')));}var _0x458a17=_[_0xaac4('0x57')](_0x2a5762[_0xaac4('0x74')],{'uniqueid':_0x3a1b41[_0xaac4('0x5d')]});if(_0x458a17){_0x1db7c7(_0x458a17);}else{return _0x429661(_0x5b20c6[_0xaac4('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x3f53f2){var _0x155fc4=this;return new Promise(function(_0x3dead0,_0x254fb3){if(ami[_0xaac4('0xd')]()==![]){return _0x254fb3(_0x155fc4[_0xaac4('0x1a')](0x1f4,[config['asterisk']['ip'],config[_0xaac4('0xe')][_0xaac4('0xf')],'ami\x20disconnected']['join']('\x20')));}var _0x5357ad=schema(properties[_0xaac4('0x76')])['validate'](_0x3f53f2);if(_0x5357ad['length']>0x0){return _0x254fb3(_0x155fc4['error'](0x1f4,_['map'](_0x5357ad,'message')[_0xaac4('0x11')](',\x20')));}var _0x46b0d6=_[_0xaac4('0x57')](_0x2a5762[_0xaac4('0x74')],{'uniqueid':_0x3f53f2['uniqueid']});if(_0x46b0d6&&_0x46b0d6[_0xaac4('0x5e')]){return ami[_0xaac4('0x17')]({'action':_0xaac4('0x77'),'channel':_0x46b0d6[_0xaac4('0x5e')]})[_0xaac4('0x18')](function(_0x3f2b70){_0x3dead0({'code':0xc8,'message':[_0x3f53f2[_0xaac4('0x5d')],_0x3f2b70['message'][_0xaac4('0x67')]()]['join']('\x20')});})['catch'](function(_0x20dff9){_0x254fb3(_0x155fc4[_0xaac4('0x1a')](0x1f5,[_0x3f53f2[_0xaac4('0x5d')],_0x20dff9[_0xaac4('0x1d')][_0xaac4('0x67')]()][_0xaac4('0x11')]('\x20')));});}else{return _0x254fb3(_0x155fc4[_0xaac4('0x1a')](0x1f5,_0xaac4('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x185545){var _0x257955=this;return new Promise(function(_0x24b1d8,_0x36d93b){if(ami[_0xaac4('0xd')]()==![]){return _0x36d93b(_0x257955[_0xaac4('0x1a')](0x1f4,[config[_0xaac4('0xe')]['ip'],config[_0xaac4('0xe')][_0xaac4('0xf')],_0xaac4('0x10')][_0xaac4('0x11')]('\x20')));}var _0x3d452f=schema(properties[_0xaac4('0x78')])[_0xaac4('0x3')](_0x185545);if(_0x3d452f[_0xaac4('0x56')]>0x0){return _0x36d93b(_0x257955[_0xaac4('0x1a')](0x1f4,_[_0xaac4('0x6f')](_0x3d452f,'message')[_0xaac4('0x11')](',\x20')));}var _0x2f77d4=_[_0xaac4('0x57')](_0x2a5762[_0xaac4('0x74')],{'uniqueid':_0x185545[_0xaac4('0x5d')]});if(_0x2f77d4&&_0x2f77d4['channel']){return ami[_0xaac4('0x17')]({'action':_0xaac4('0x79'),'channel':_0x2f77d4[_0xaac4('0x5e')],'exten':_0x185545[_0xaac4('0x7a')],'context':_0x185545[_0xaac4('0x7b')]||_0x2f77d4['context'],'priority':0x1})[_0xaac4('0x18')](function(_0x584ad9){_0x24b1d8({'code':0xc8,'message':[_0x185545[_0xaac4('0x5d')],_0x584ad9[_0xaac4('0x1d')]['toLowerCase']()][_0xaac4('0x11')]('\x20')});})['catch'](function(_0x161aae){_0x36d93b(_0x257955[_0xaac4('0x1a')](0x1f5,[_0x185545['uniqueid'],_0x161aae[_0xaac4('0x1d')][_0xaac4('0x67')]()]['join']('\x20')));});}else{return _0x36d93b(_0x257955[_0xaac4('0x1a')](0x1f5,_0xaac4('0x6e')));}});},'Agents':function(_0x205007){return new Promise(function(_0x1d6179){var _0x22b8dc=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0xb')]);if(_0x205007&&_0x205007['id']){var _0x220f18=_[_0xaac4('0x57')](_0x22b8dc,function(_0x518af6){return _0x518af6['id']===_0x205007['id'];});_0x1d6179(_0x220f18);}else{_0x1d6179({'count':_0x22b8dc[_0xaac4('0x56')],'rows':_0x22b8dc});}});},'Telephones':function(){return new Promise(function(_0x466484){var _0x12f48c=_['values'](_0x2a5762[_0xaac4('0x7c')]);_0x466484({'count':_0x12f48c[_0xaac4('0x56')],'rows':_0x12f48c});});},'Trunks':function(){return new Promise(function(_0x176c7d){var _0x3dd2bf=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0x7d')]);_0x176c7d({'count':_0x3dd2bf[_0xaac4('0x56')],'rows':_0x3dd2bf});});},'OutboundChannels':function(){return new Promise(function(_0x20c569){var _0xcbeeb5=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0x7e')]);_0x20c569({'count':_0xcbeeb5[_0xaac4('0x56')],'rows':_0xcbeeb5});});},'Outbound':function(){return new Promise(function(_0x7a53d0){_0x7a53d0(_0x2a5762[_0xaac4('0x7f')]);});},'Campaigns':function(){return new Promise(function(_0x3f2cf2){var _0x3d57ef=_['values'](_0x2a5762[_0xaac4('0x80')]);_0x3f2cf2({'count':_0x3d57ef[_0xaac4('0x56')],'rows':_0x3d57ef});});},'VoiceQueuesPreview':function(_0x12fb33){var _0x553bca=this;return new Promise(function(_0x319290,_0x196140){_0x32d34c['run'](_0x12fb33['id'])[_0xaac4('0x18')](function(_0x5ec041){_0x319290({'code':0xc8,'message':_0x5ec041[_0xaac4('0x1d')]});})[_0xaac4('0x19')](function(_0xa5c0a6){_0x196140(_0x553bca[_0xaac4('0x1a')](0x1f4,_0xa5c0a6[_0xaac4('0x1d')]));});});},'EventManager':function(_0x18f6d7){var _0x573dae=this;return new Promise(function(_0x2760bf,_0x207c90){if(!_0x18f6d7[_0xaac4('0x81')]){return _0x207c90(_0x573dae[_0xaac4('0x1a')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xaac4('0x82')](_0xaac4('0x83')+_0x18f6d7[_0xaac4('0x81')],_0x18f6d7['message']);_0x2760bf({'code':0xc8,'message':_0x18f6d7});});},'FaxAccounts':function(){return new Promise(function(_0xa78f15){var _0x8f9f2d=_[_0xaac4('0x5a')](_0x2a5762[_0xaac4('0x84')]);_0xa78f15({'count':_0x8f9f2d[_0xaac4('0x56')],'rows':_0x8f9f2d});});},'SendFax':function(_0x48e5dc){var _0x508907=this;return new Promise(function(_0x434086,_0x1467f5){_0x58ae95[_0xaac4('0x85')](_0x48e5dc)[_0xaac4('0x18')](function(_0x563bff){_0x434086({'code':0xc8,'message':_0x563bff[_0xaac4('0x1d')]});})[_0xaac4('0x19')](function(_0x43a593){_0x1467f5(_0x508907[_0xaac4('0x1a')](0x1f4,_0x43a593[_0xaac4('0x1d')]));});});},'CheckAfterSend':function(_0x22859e){var _0x3e82e5=this;return new Promise(function(_0x3f97ba,_0x145ac1){_0x58ae95[_0xaac4('0x86')](_0x22859e)[_0xaac4('0x18')](function(_0x1e4e84){_0x3f97ba({'code':0xc8,'message':_0x1e4e84[_0xaac4('0x1d')]});})['catch'](function(_0x2ac631){_0x145ac1(_0x3e82e5[_0xaac4('0x1a')](0x1f4,_0x2ac631[_0xaac4('0x1d')]));});});}};var _0x43c575=jayson[_0xaac4('0x87')](_0x1cdfc5)[_0xaac4('0x88')]();_0x43c575['on'](_0xaac4('0x1a'),function(_0x555dd4){return _0x53d03a(_0x555dd4);});_0x43c575[_0xaac4('0x6')](0x232a,_0xaac4('0x89'),function(){console[_0xaac4('0x8a')](_0xaac4('0x8b'),0x232a);return _0x1283a5(_0xaac4('0x8c')+0x232a);});});};
\ No newline at end of file
+var _0x0bb5=['values','voicechannel','map','channels','channel','format','%s.%s','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','uniqueid','MixMonitor\x20Success','resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','validate','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','outbound','campaigns','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','server','http','127.0.0.1','log','lodash','util','moment','../../../config/environment','../properties','../ami','listen','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','asterisk','username','join','keys','module','action','Reload','Action','message','error','ami\x20disconnected','command','Command','then','content','catch','voiceQueues','hasOwnProperty','strategy','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined'];(function(_0x4fb6e1,_0x244cb6){var _0x298729=function(_0x5ded22){while(--_0x5ded22){_0x4fb6e1['push'](_0x4fb6e1['shift']());}};_0x298729(++_0x244cb6);}(_0x0bb5,0x148));var _0x50bb=function(_0x5e82b5,_0x39f8bf){_0x5e82b5=_0x5e82b5-0x0;var _0xb17a50=_0x0bb5[_0x5e82b5];return _0xb17a50;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x50bb('0x2'));var config=require(_0x50bb('0x3'));var properties=require(_0x50bb('0x4'));var ami=require(_0x50bb('0x5'));exports[_0x50bb('0x6')]=function(_0xfdc9d4,_0x451b4c,_0x33f2c5){return new Promise(function(_0x4e6093,_0x4a105c){var _0xfd7aeb={'QueuePause':function(_0x35de5d){return new Promise(function(_0x2e5463){var _0x33ff54=util['format']('%s/%s',_0x50bb('0x7'),_0x35de5d[_0x50bb('0x8')]);if(_0xfdc9d4[_0x50bb('0x9')]&&_0xfdc9d4[_0x50bb('0x9')][_0x33ff54]&&_0xfdc9d4['timers'][_0x33ff54][_0x50bb('0xa')]){_0xfdc9d4[_0x50bb('0x9')][_0x33ff54][_0x50bb('0xb')]();}if(_0xfdc9d4[_0x50bb('0xc')][_0x33ff54]){_0xfdc9d4[_0x50bb('0xc')][_0x33ff54][_0x50bb('0xd')]({'statePause':_0x35de5d[_0x50bb('0xe')]?!![]:![]});}_0x2e5463({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x226370){var _0x58837d=this;return new Promise(function(_0x283f04,_0xd8ab27){if(ami[_0x50bb('0xf')]()==![]){return _0xd8ab27(_0x58837d['error'](0x1f4,[config[_0x50bb('0x10')]['ip'],config[_0x50bb('0x10')][_0x50bb('0x11')],'ami\x20disconnected'][_0x50bb('0x12')]('\x20')));}_0x226370=_['pick'](_0x226370,_[_0x50bb('0x13')](properties[_0x50bb('0x14')]));_0x226370[_0x50bb('0x15')]=_0x50bb('0x16');return ami[_0x50bb('0x17')](_0x226370)['then'](function(_0x10a191){_0x283f04({'code':0xc8,'message':_0x10a191[_0x50bb('0x18')]});})['catch'](function(_0x24ba19){_0xd8ab27(_0x58837d['error'](0x1f5,_0x24ba19[_0x50bb('0x18')]));});});},'Command':function(_0x431ed4){var _0x4b06f5=this;return new Promise(function(_0x4f1c0a,_0x43465b){if(ami[_0x50bb('0xf')]()==![]){return _0x43465b(_0x4b06f5[_0x50bb('0x19')](0x1f4,[config[_0x50bb('0x10')]['ip'],config['asterisk'][_0x50bb('0x11')],_0x50bb('0x1a')][_0x50bb('0x12')]('\x20')));}_0x431ed4=_['pick'](_0x431ed4,_0x50bb('0x1b'));_0x431ed4[_0x50bb('0x15')]=_0x50bb('0x1c');return ami['Action'](_0x431ed4)[_0x50bb('0x1d')](function(_0x4cc7f9){_0x4f1c0a({'code':0xc8,'message':_0x4cc7f9[_0x50bb('0x1e')]});})[_0x50bb('0x1f')](function(_0x1a2a0b){_0x43465b(_0x4b06f5[_0x50bb('0x19')](0x1f5,_0x1a2a0b[_0x50bb('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x342078){var _0x4f7f73=[];for(var _0xad17ac in _0xfdc9d4[_0x50bb('0x20')]){if(_0xfdc9d4[_0x50bb('0x20')][_0x50bb('0x21')](_0xad17ac)){var _0x5234d7=_0xfdc9d4[_0x50bb('0x20')][_0xad17ac];var _0x4d38f7={'id':_0x5234d7['id'],'name':_0x5234d7['name'],'strategy':_0x5234d7[_0x50bb('0x22')],'answered':_0x5234d7['answered'],'available':_0x5234d7['available'],'loggedIn':_0x5234d7[_0x50bb('0x23')],'pTalking':_0x5234d7[_0x50bb('0x24')],'sumBillable':_0x5234d7[_0x50bb('0x25')],'sumDuration':_0x5234d7[_0x50bb('0x26')],'sumHoldTime':_0x5234d7[_0x50bb('0x27')]||0x0,'talking':_0x5234d7[_0x50bb('0x28')],'total':_0x5234d7[_0x50bb('0x29')],'type':_0x5234d7[_0x50bb('0x2a')],'unmanaged':_0x5234d7['unmanaged'],'abandoned':_0x5234d7[_0x50bb('0x2b')],'waiting':_0x5234d7[_0x50bb('0x2c')],'loggedInDb':_0x5234d7[_0x50bb('0x2d')]};if(_0x5234d7[_0x50bb('0x2a')]==='outbound'){_0x4d38f7[_0x50bb('0x2e')]=_0x5234d7[_0x50bb('0x2e')];_0x4d38f7[_0x50bb('0x2f')]=_0x5234d7[_0x50bb('0x2f')];_0x4d38f7[_0x50bb('0x30')]=_0x5234d7[_0x50bb('0x30')];_0x4d38f7[_0x50bb('0x31')]=_0x5234d7[_0x50bb('0x31')];_0x4d38f7[_0x50bb('0x32')]=_0x5234d7[_0x50bb('0x32')];_0x4d38f7[_0x50bb('0x33')]=_0x5234d7[_0x50bb('0x33')];_0x4d38f7['temp']=_0x5234d7[_0x50bb('0x34')];_0x4d38f7[_0x50bb('0x35')]=_0x5234d7[_0x50bb('0x35')];_0x4d38f7[_0x50bb('0x36')]=_0x5234d7[_0x50bb('0x36')];_0x4d38f7[_0x50bb('0x37')]=_0x5234d7[_0x50bb('0x37')];_0x4d38f7[_0x50bb('0x38')]=_0x5234d7[_0x50bb('0x38')];_0x4d38f7[_0x50bb('0x39')]=_0x5234d7[_0x50bb('0x39')];_0x4d38f7['outboundDropCallsDayACS']=_0x5234d7[_0x50bb('0x3a')];_0x4d38f7[_0x50bb('0x3b')]=_0x5234d7[_0x50bb('0x3b')];_0x4d38f7[_0x50bb('0x3c')]=_0x5234d7[_0x50bb('0x3c')];_0x4d38f7[_0x50bb('0x3d')]=_0x5234d7['outboundNoAnswerCallsDay'];_0x4d38f7['outboundNoSuchCallsDay']=_0x5234d7[_0x50bb('0x3e')];_0x4d38f7['outboundOriginateFailureCallsDay']=_0x5234d7[_0x50bb('0x3f')];_0x4d38f7[_0x50bb('0x40')]=_0x5234d7[_0x50bb('0x40')];_0x4d38f7[_0x50bb('0x41')]=_0x5234d7[_0x50bb('0x41')];_0x4d38f7['outboundUnknownCallsDay']=_0x5234d7[_0x50bb('0x42')];_0x4d38f7['predictiveIntervalAnsweredCalls']=_0x5234d7[_0x50bb('0x43')];_0x4d38f7[_0x50bb('0x44')]=_0x5234d7[_0x50bb('0x44')];_0x4d38f7['predictiveIntervalAvgTalktime']=_0x5234d7['predictiveIntervalAvgTalktime'];_0x4d38f7[_0x50bb('0x45')]=_0x5234d7[_0x50bb('0x45')];_0x4d38f7[_0x50bb('0x46')]=_0x5234d7[_0x50bb('0x46')];_0x4d38f7['predictiveIntervalErlangCalls']=_0x5234d7[_0x50bb('0x47')];_0x4d38f7['predictiveIntervalErlangCallsDroppedCalls']=_0x5234d7['predictiveIntervalErlangCallsDroppedCalls'];_0x4d38f7[_0x50bb('0x48')]=_0x5234d7['predictiveIntervalHitRate'];_0x4d38f7[_0x50bb('0x49')]=_0x5234d7[_0x50bb('0x49')];_0x4d38f7[_0x50bb('0x4a')]=_0x5234d7[_0x50bb('0x4a')];_0x4d38f7[_0x50bb('0x4b')]=_0x5234d7[_0x50bb('0x4b')];_0x4d38f7[_0x50bb('0x4c')]=_0x5234d7[_0x50bb('0x4c')];_0x4d38f7[_0x50bb('0x18')]=_0x5234d7[_0x50bb('0x18')];_0x4d38f7['originated']=_0x5234d7['originated'];_0x4d38f7[_0x50bb('0x4d')]=_0x5234d7[_0x50bb('0x4d')];_0x4d38f7[_0x50bb('0x4e')]=_0x5234d7[_0x50bb('0x4e')];_0x4d38f7['erlangAbandonmentRate']=_0x5234d7[_0x50bb('0x4f')];_0x4d38f7['erlangBusyFactor']=_0x5234d7[_0x50bb('0x50')];_0x4d38f7[_0x50bb('0x51')]=_0x5234d7[_0x50bb('0x51')];_0x4d38f7[_0x50bb('0x52')]=_0x5234d7[_0x50bb('0x52')];}if(_0x5234d7[_0x50bb('0x53')]){_0x4d38f7[_0x50bb('0x53')]={'id':_0x5234d7[_0x50bb('0x53')]['id'],'name':_0x5234d7[_0x50bb('0x53')][_0x50bb('0x8')],'active':_0x5234d7[_0x50bb('0x53')][_0x50bb('0x54')],'callerid':_0x5234d7[_0x50bb('0x53')][_0x50bb('0x55')]};}if(_0x5234d7[_0x50bb('0x56')]){_0x4d38f7[_0x50bb('0x56')]={'id':_0x5234d7['Interval']['id'],'name':_0x5234d7[_0x50bb('0x56')]['name']};}_0x4f7f73[_0x50bb('0x57')](_0x4d38f7);}}_0x342078({'count':_0x4f7f73[_0x50bb('0x58')],'rows':_0x4f7f73});});},'UpdateVoiceQueue':function(_0x415229){return new Promise(function(_0x4613c8,_0x1ad25f){var _0x865480=_[_0x50bb('0x59')](_0xfdc9d4[_0x50bb('0x20')],{'id':parseInt(_0x415229['id'])});var _0x3ecec7=_[_0x50bb('0x5a')](_0x415229,['id']);if(_0x865480){for(var _0x1cdfc0 in _0x3ecec7){if(typeof _0x3ecec7[_0x1cdfc0]!==_0x50bb('0x5b')&&typeof _0x865480[_0x1cdfc0]!==_0x50bb('0x5b')){_0x865480[_0x1cdfc0]=_0x3ecec7[_0x1cdfc0];}}_0x4613c8(_0x865480);}else{_0x1ad25f();}});},'VoiceChannels':function(){return new Promise(function(_0x457bb4){var _0x5880df=_[_0x50bb('0x5c')](_0xfdc9d4['channels']);_0x457bb4({'count':_0x5880df[_0x50bb('0x58')],'rows':_0x5880df});});},'VoiceChannelMixMonitor':function(_0x141aee){var _0x470b65=this;return new Promise(function(_0x35b440,_0x650e91){if(ami[_0x50bb('0xf')]()==![]){return _0x650e91(_0x470b65[_0x50bb('0x19')](0x1f4,[config[_0x50bb('0x10')]['ip'],config['asterisk'][_0x50bb('0x11')],_0x50bb('0x1a')][_0x50bb('0x12')]('\x20')));}var _0x13afe2=schema(properties[_0x50bb('0x5d')])['validate'](_0x141aee);if(_0x13afe2[_0x50bb('0x58')]>0x0){return _0x650e91(_0x470b65[_0x50bb('0x19')](0x1f4,_[_0x50bb('0x5e')](_0x13afe2,_0x50bb('0x18'))[_0x50bb('0x12')](',\x20')));}var _0x5e050f=_['find'](_0xfdc9d4[_0x50bb('0x5f')],{'uniqueid':_0x141aee['uniqueid']});if(_0x5e050f&&_0x5e050f[_0x50bb('0x60')]){var _0x57ee0e=util[_0x50bb('0x61')](_0x50bb('0x62'),_0x141aee[_0x50bb('0x63')]||_0x141aee['uniqueid'],_0x141aee[_0x50bb('0x61')]||_0x50bb('0x64'));return ami['Action']({'action':_0x50bb('0x65'),'channel':_0x5e050f[_0x50bb('0x60')],'file':_0x57ee0e,'options':_0x50bb('0x66')})[_0x50bb('0x1d')](function(_0x55a4a6){var _0x33e71f=_[_0x50bb('0x59')](_0x5e050f[_0x50bb('0x67')],{'filename':_0x50bb('0x68')+_0x57ee0e[_0x50bb('0x69')]()});if(_['isNil'](_0x33e71f)){_0x5e050f[_0x50bb('0x67')]['push']({'filename':_0x50bb('0x68')+_0x57ee0e['toLowerCase'](),'createdAt':moment()['format'](_0x50bb('0x6a')),'mixmonitorid':_0x55a4a6['mixmonitorid'],'status':'rec'});}else{_0x33e71f[_0x50bb('0x6b')]=_0x55a4a6[_0x50bb('0x6b')];_0x33e71f[_0x50bb('0x6c')]=_0x50bb('0x6d');}_0x35b440({'code':0xc8,'message':[_0x141aee[_0x50bb('0x6e')],_0x50bb('0x6f'),_0x55a4a6[_0x50bb('0x6b')]][_0x50bb('0x12')]('\x20'),'mixmonitorid':_0x55a4a6['mixmonitorid']});})['catch'](function(_0x372a06){_0x650e91(_0x470b65[_0x50bb('0x19')](0x1f5,[_0x141aee[_0x50bb('0x6e')],_0x372a06[_0x50bb('0x18')][_0x50bb('0x69')]()][_0x50bb('0x12')]('\x20')));});}else{return _0x650e91(_0x470b65[_0x50bb('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x3be83b){var _0x31cfca=this;return new Promise(function(_0x640fd1,_0x2625ff){if(ami[_0x50bb('0xf')]()==![]){return _0x2625ff(_0x31cfca['error'](0x1f4,[config[_0x50bb('0x10')]['ip'],config[_0x50bb('0x10')][_0x50bb('0x11')],_0x50bb('0x1a')][_0x50bb('0x12')]('\x20')));}var _0x5b20f7=schema(properties[_0x50bb('0x5d')])['validate'](_0x3be83b);if(_0x5b20f7['length']>0x0){return _0x2625ff(_0x31cfca[_0x50bb('0x19')](0x1f4,_[_0x50bb('0x5e')](_0x5b20f7,_0x50bb('0x18'))[_0x50bb('0x12')](',\x20')));}var _0x431d71=_[_0x50bb('0x59')](_0xfdc9d4[_0x50bb('0x5f')],{'uniqueid':_0x3be83b[_0x50bb('0x6e')]});if(_0x431d71){return Promise[_0x50bb('0x70')]()[_0x50bb('0x1d')](function(){if(_0x431d71[_0x50bb('0x60')]){return ami['Action']({'action':_0x50bb('0x71'),'channel':_0x431d71['channel'],'mixmonitorid':_0x3be83b[_0x50bb('0x6b')]})[_0x50bb('0x1f')](function(){});}})['then'](function(){if(_0x431d71[_0x50bb('0x72')]){return ami[_0x50bb('0x17')]({'action':_0x50bb('0x71'),'channel':_0x431d71[_0x50bb('0x72')],'mixmonitorid':_0x3be83b[_0x50bb('0x6b')]})[_0x50bb('0x1f')](function(){});}})[_0x50bb('0x1d')](function(){var _0x621ad2=_['find'](_0x431d71[_0x50bb('0x67')],{'mixmonitorid':_0x3be83b[_0x50bb('0x6b')]});if(_0x621ad2){_0x621ad2[_0x50bb('0x6c')]='stop';}})[_0x50bb('0x1d')](function(){var _0x2779b3=util[_0x50bb('0x61')](_0x50bb('0x62'),_0x3be83b[_0x50bb('0x63')]||_0x3be83b[_0x50bb('0x6e')],_0x3be83b['format']||_0x50bb('0x64'));var _0x3d1839=_[_0x50bb('0x59')](_0x431d71[_0x50bb('0x67')],{'filename':_0x50bb('0x68')+_0x2779b3[_0x50bb('0x69')]()});if(_0x3d1839){_0x3d1839['status']=_0x50bb('0x73');}})[_0x50bb('0x1d')](function(){_0x640fd1({'code':0xc8,'message':[_0x3be83b[_0x50bb('0x6e')],_0x50bb('0x74')][_0x50bb('0x12')]('\x20')});})[_0x50bb('0x1f')](function(_0x25191c){_0x2625ff(_0x31cfca[_0x50bb('0x19')](0x1f5,[_0x3be83b[_0x50bb('0x6e')],_0x25191c['message'][_0x50bb('0x69')]()][_0x50bb('0x12')]('\x20')));});}else{return _0x2625ff(_0x31cfca[_0x50bb('0x19')](0x1f5,_0x50bb('0x75')));}});},'VoiceQueuesChannels':function(){return new Promise(function(_0x367bb9){var _0x4627d1=_[_0x50bb('0x5c')](_0xfdc9d4[_0x50bb('0x76')]);_0x367bb9({'count':_0x4627d1[_0x50bb('0x58')],'rows':_0x4627d1});});},'VoiceQueuesChannel':function(_0x578ff3){var _0x58ad41=this;return new Promise(function(_0x5babbc,_0x4159ad){var _0x5ba597=schema(properties['voicequeuechannel'])[_0x50bb('0x77')](_0x578ff3);if(_0x5ba597[_0x50bb('0x58')]>0x0){return _0x4159ad(_0x58ad41[_0x50bb('0x19')](0x1f4,_[_0x50bb('0x5e')](_0x5ba597,'message')[_0x50bb('0x12')](',\x20')));}var _0x16a500=_['find'](_0xfdc9d4[_0x50bb('0x76')],{'uniqueid':_0x578ff3['uniqueid']});if(_0x16a500){_0x5babbc(_0x16a500);}else{return _0x4159ad(_0x58ad41[_0x50bb('0x19')](0x1f5,_0x50bb('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x48e350){var _0x23bff2=this;return new Promise(function(_0x52c882,_0x8f5df6){if(ami[_0x50bb('0xf')]()==![]){return _0x8f5df6(_0x23bff2['error'](0x1f4,[config[_0x50bb('0x10')]['ip'],config[_0x50bb('0x10')][_0x50bb('0x11')],'ami\x20disconnected'][_0x50bb('0x12')]('\x20')));}var _0x12c4ee=schema(properties[_0x50bb('0x78')])[_0x50bb('0x77')](_0x48e350);if(_0x12c4ee['length']>0x0){return _0x8f5df6(_0x23bff2[_0x50bb('0x19')](0x1f4,_[_0x50bb('0x5e')](_0x12c4ee,'message')['join'](',\x20')));}var _0x1aecc4=_[_0x50bb('0x59')](_0xfdc9d4['queueChannels'],{'uniqueid':_0x48e350[_0x50bb('0x6e')]});if(_0x1aecc4&&_0x1aecc4[_0x50bb('0x60')]){return ami[_0x50bb('0x17')]({'action':_0x50bb('0x79'),'channel':_0x1aecc4[_0x50bb('0x60')]})['then'](function(_0x480163){_0x52c882({'code':0xc8,'message':[_0x48e350[_0x50bb('0x6e')],_0x480163[_0x50bb('0x18')][_0x50bb('0x69')]()][_0x50bb('0x12')]('\x20')});})['catch'](function(_0x1975f7){_0x8f5df6(_0x23bff2['error'](0x1f5,[_0x48e350[_0x50bb('0x6e')],_0x1975f7[_0x50bb('0x18')][_0x50bb('0x69')]()][_0x50bb('0x12')]('\x20')));});}else{return _0x8f5df6(_0x23bff2[_0x50bb('0x19')](0x1f5,_0x50bb('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x3a7ba7){var _0x57ccc7=this;return new Promise(function(_0x4d3d71,_0x1c8ea4){if(ami[_0x50bb('0xf')]()==![]){return _0x1c8ea4(_0x57ccc7[_0x50bb('0x19')](0x1f4,[config[_0x50bb('0x10')]['ip'],config[_0x50bb('0x10')][_0x50bb('0x11')],'ami\x20disconnected'][_0x50bb('0x12')]('\x20')));}var _0x3033db=schema(properties[_0x50bb('0x7a')])[_0x50bb('0x77')](_0x3a7ba7);if(_0x3033db[_0x50bb('0x58')]>0x0){return _0x1c8ea4(_0x57ccc7['error'](0x1f4,_['map'](_0x3033db,_0x50bb('0x18'))['join'](',\x20')));}var _0x3c9180=_[_0x50bb('0x59')](_0xfdc9d4['queueChannels'],{'uniqueid':_0x3a7ba7['uniqueid']});if(_0x3c9180&&_0x3c9180[_0x50bb('0x60')]){return ami[_0x50bb('0x17')]({'action':_0x50bb('0x7b'),'channel':_0x3c9180['channel'],'exten':_0x3a7ba7[_0x50bb('0x7c')],'context':_0x3a7ba7[_0x50bb('0x7d')]||_0x3c9180[_0x50bb('0x7d')],'priority':0x1})[_0x50bb('0x1d')](function(_0x669966){_0x4d3d71({'code':0xc8,'message':[_0x3a7ba7[_0x50bb('0x6e')],_0x669966[_0x50bb('0x18')]['toLowerCase']()]['join']('\x20')});})[_0x50bb('0x1f')](function(_0x27ffc5){_0x1c8ea4(_0x57ccc7[_0x50bb('0x19')](0x1f5,[_0x3a7ba7[_0x50bb('0x6e')],_0x27ffc5[_0x50bb('0x18')][_0x50bb('0x69')]()][_0x50bb('0x12')]('\x20')));});}else{return _0x1c8ea4(_0x57ccc7[_0x50bb('0x19')](0x1f5,_0x50bb('0x75')));}});},'Agents':function(_0x2d01ec){return new Promise(function(_0x484402){var _0x266126=_[_0x50bb('0x5c')](_0xfdc9d4[_0x50bb('0xc')]);if(_0x2d01ec&&_0x2d01ec['id']){var _0x16f965=_[_0x50bb('0x59')](_0x266126,function(_0x1d8117){return _0x1d8117['id']===_0x2d01ec['id'];});_0x484402(_0x16f965);}else{_0x484402({'count':_0x266126[_0x50bb('0x58')],'rows':_0x266126});}});},'Telephones':function(){return new Promise(function(_0x265356){var _0x376337=_[_0x50bb('0x5c')](_0xfdc9d4[_0x50bb('0x7e')]);_0x265356({'count':_0x376337[_0x50bb('0x58')],'rows':_0x376337});});},'Trunks':function(){return new Promise(function(_0xc02791){var _0x368cec=_[_0x50bb('0x5c')](_0xfdc9d4['trunks']);_0xc02791({'count':_0x368cec[_0x50bb('0x58')],'rows':_0x368cec});});},'OutboundChannels':function(){return new Promise(function(_0x28c4ca){var _0x348a6e=_['values'](_0xfdc9d4[_0x50bb('0x7f')]);_0x28c4ca({'count':_0x348a6e[_0x50bb('0x58')],'rows':_0x348a6e});});},'Outbound':function(){return new Promise(function(_0x310525){_0x310525(_0xfdc9d4[_0x50bb('0x80')]);});},'Campaigns':function(){return new Promise(function(_0x225253){var _0x1ee1bf=_[_0x50bb('0x5c')](_0xfdc9d4[_0x50bb('0x81')]);_0x225253({'count':_0x1ee1bf[_0x50bb('0x58')],'rows':_0x1ee1bf});});},'VoiceQueuesPreview':function(_0x20f98d){var _0x4ec601=this;return new Promise(function(_0x353058,_0x2a05cf){_0x451b4c[_0x50bb('0x82')](_0x20f98d['id'])[_0x50bb('0x1d')](function(_0x23b9b9){_0x353058({'code':0xc8,'message':_0x23b9b9[_0x50bb('0x18')]});})[_0x50bb('0x1f')](function(_0x39b247){_0x2a05cf(_0x4ec601[_0x50bb('0x19')](0x1f4,_0x39b247[_0x50bb('0x18')]));});});},'EventManager':function(_0x3824f9){var _0x50859a=this;return new Promise(function(_0x3fe3bf,_0x1724cb){if(!_0x3824f9[_0x50bb('0x83')]){return _0x1724cb(_0x50859a[_0x50bb('0x19')](0x1f4,_0x50bb('0x84')));}ami[_0x50bb('0x85')]('custom:'+_0x3824f9[_0x50bb('0x83')],_0x3824f9['message']);_0x3fe3bf({'code':0xc8,'message':_0x3824f9});});},'FaxAccounts':function(){return new Promise(function(_0x449979){var _0x35edd2=_['values'](_0xfdc9d4['faxAccounts']);_0x449979({'count':_0x35edd2['length'],'rows':_0x35edd2});});},'SendFax':function(_0x1e4f72){var _0x3db8be=this;return new Promise(function(_0x31561f,_0xf39f65){_0x33f2c5[_0x50bb('0x86')](_0x1e4f72)[_0x50bb('0x1d')](function(_0xab456d){_0x31561f({'code':0xc8,'message':_0xab456d['message']});})[_0x50bb('0x1f')](function(_0x5cb9b2){_0xf39f65(_0x3db8be[_0x50bb('0x19')](0x1f4,_0x5cb9b2[_0x50bb('0x18')]));});});},'CheckAfterSend':function(_0x49a866){var _0x575794=this;return new Promise(function(_0x1e1215,_0x48b432){_0x33f2c5[_0x50bb('0x87')](_0x49a866)[_0x50bb('0x1d')](function(_0x293131){_0x1e1215({'code':0xc8,'message':_0x293131[_0x50bb('0x18')]});})[_0x50bb('0x1f')](function(_0xd6279b){_0x48b432(_0x575794['error'](0x1f4,_0xd6279b[_0x50bb('0x18')]));});});}};var _0x464b3f=jayson[_0x50bb('0x88')](_0xfd7aeb)[_0x50bb('0x89')]();_0x464b3f['on'](_0x50bb('0x19'),function(_0x470dc4){return _0x4a105c(_0x470dc4);});_0x464b3f[_0x50bb('0x6')](0x232a,_0x50bb('0x8a'),function(){console[_0x50bb('0x8b')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x4e6093('RPC\x20listening\x20on\x20port:'+0x232a);});});};
\ No newline at end of file
index ac6ae99..30608b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe8f=['firstName','lastName','fax','createdAt','scheduledAt','union','then','getContacts','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','<unknown>','Unknown','destcalleridname','resolve','createContact','[CM][%s][%s]\x20Contact\x20created:%s','push','format','action','bluebird','ioredis','util','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','map','routeId','calleridnum','destcalleridnum'];(function(_0x928a02,_0x2257cd){var _0x30705c=function(_0x5879a1){while(--_0x5879a1){_0x928a02['push'](_0x928a02['shift']());}};_0x30705c(++_0x2257cd);}(_0xbe8f,0x1e4));var _0xfbe8=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xbe8f[_0x599e60];return _0x468e19;};'use strict';var _=require('lodash');var BPromise=require(_0xfbe8('0x0'));var Redis=require(_0xfbe8('0x1'));var util=require(_0xfbe8('0x2'));var config=require(_0xfbe8('0x3'));var logger=require(_0xfbe8('0x4'))(_0xfbe8('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0xfbe8('0x6')]=_[_0xfbe8('0x7')](config['redis'],{'host':_0xfbe8('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4520c5,_0x4d631f,_0x1eb31f,_0x53a715,_0x16a0c6){logger[_0xfbe8('0x9')]('[CM][%s][%s]',_0x4520c5,_0x4d631f['id'],_0x1eb31f,_0x53a715,JSON[_0xfbe8('0xa')](_0x16a0c6));io['to'](_0x1eb31f)[_0xfbe8('0xb')](_0x53a715,_0x16a0c6);}exports[_0xfbe8('0xc')]=function(_0x341a1f,_0x7a72d5,_0x282bf5,_0x1bc556){var _0x584a0c,_0x58cd9d;var _0x53d0bc={};var _0x24118c;var _0x4fb299=Number(_0x282bf5[_0xfbe8('0xd')]);var _0x23fb9d=_0x282bf5[_0xfbe8('0xe')]?Boolean(Number(_0x282bf5[_0xfbe8('0xe')])):![];var _0x5274bb;var _0x4cfc1c=![];if(!_[_0xfbe8('0xf')](_0x282bf5[_0xfbe8('0x10')])){if(_0x282bf5['data5']=='1')_0x4cfc1c=!![];}if(!_0x4cfc1c){if(_0x1bc556[_0xfbe8('0x11')]){_0x53d0bc['id']=_0x1bc556['xmd-contactid'];}}if(!_0x53d0bc['id']){_0x53d0bc[_0xfbe8('0x12')]=_0x4fb299;_0x5274bb=_0x282bf5[_0xfbe8('0x13')]&&_0x282bf5['data3']!=='0'?_0x282bf5[_0xfbe8('0x13')][_0xfbe8('0x14')](','):[_0xfbe8('0x15')];_0x53d0bc['$or']=_[_0xfbe8('0x16')](_0x5274bb,function(_0x1dd6a0){var _0x2172a1={};_0x2172a1[_0x1dd6a0]=_0x1bc556[_0xfbe8('0x17')]?_0x1bc556['destcalleridnum']:_0x1bc556[_0xfbe8('0x18')];return _0x2172a1;});_0x24118c=_0x1bc556[_0xfbe8('0x17')]?_0x1bc556[_0xfbe8('0x19')]:_0x1bc556[_0xfbe8('0x18')];}var _0x449353=['id',_0xfbe8('0x1a'),_0xfbe8('0x1b'),_0xfbe8('0x15'),'mobile',_0xfbe8('0x1c'),'ListId',_0xfbe8('0x1d'),_0xfbe8('0x1e'),'updatedAt'];var _0x459902=_[_0xfbe8('0x1f')](_0x449353,_0x5274bb);BPromise['resolve']()[_0xfbe8('0x20')](cmContactRpc[_0xfbe8('0x21')]({'attributes':_0x459902,'where':_0x53d0bc,'phone':_0x24118c}))['then'](function(_0x2d8287){_0x58cd9d=_0x2d8287;if(!_[_0xfbe8('0x22')](_0x58cd9d)){if(_0x58cd9d[_0xfbe8('0x23')]===0x1){_0x584a0c=_0x58cd9d[0x0];logger[_0xfbe8('0x9')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x1bc556[_0xfbe8('0x24')],_0x7a72d5['id'],_0x584a0c['id']);}else{logger[_0xfbe8('0x9')](_0xfbe8('0x25'),_0x1bc556['uniqueid'],_0x7a72d5['id'],_[_0xfbe8('0x16')](_0x58cd9d,'id')[_0xfbe8('0x26')](','));}return;}else{logger[_0xfbe8('0x9')](_0xfbe8('0x27'),_0x1bc556['uniqueid'],_0x7a72d5['id']);var _0x33d92d={'ListId':_0x4fb299};var _0x1da350=_0x282bf5[_0xfbe8('0x28')]&&_0x282bf5[_0xfbe8('0x28')]!=='0'?_0x282bf5[_0xfbe8('0x28')]:_0xfbe8('0x15');if(_0x23fb9d){logger[_0xfbe8('0x9')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x1bc556[_0xfbe8('0x24')],_0x7a72d5['id']);_0x33d92d[_0x1da350]=_[_0xfbe8('0xf')](_0x1bc556[_0xfbe8('0x17')])?_0x1bc556[_0xfbe8('0x18')]:_0x1bc556[_0xfbe8('0x19')];if(_[_0xfbe8('0xf')](_0x1bc556[_0xfbe8('0x17')])){_0x33d92d[_0xfbe8('0x1a')]=_0x1bc556[_0xfbe8('0x29')]&&_0x1bc556[_0xfbe8('0x29')]!==_0xfbe8('0x2a')?_0x1bc556[_0xfbe8('0x29')]:_0xfbe8('0x2b');}else{_0x33d92d[_0xfbe8('0x1a')]=_0x1bc556[_0xfbe8('0x2c')]&&_0x1bc556[_0xfbe8('0x2c')]!==_0xfbe8('0x2a')?_0x1bc556['destcalleridname']:_0xfbe8('0x2b');}return BPromise[_0xfbe8('0x2d')]()[_0xfbe8('0x20')](cmContactRpc[_0xfbe8('0x2e')](_0x33d92d))[_0xfbe8('0x20')](function(_0x4b983a){_0x584a0c=_0x4b983a;_0x58cd9d['push'](_0x4b983a);if(_0x584a0c){logger[_0xfbe8('0x9')](_0xfbe8('0x2f'),_0x1bc556[_0xfbe8('0x24')],_0x7a72d5['id'],_0x584a0c['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x1bc556[_0xfbe8('0x24')],_0x7a72d5['id']);_0x33d92d[_0x1da350]=_['isNil'](_0x1bc556[_0xfbe8('0x17')])?_0x1bc556[_0xfbe8('0x18')]:_0x1bc556[_0xfbe8('0x19')];if(_[_0xfbe8('0xf')](_0x1bc556[_0xfbe8('0x17')])){_0x33d92d[_0xfbe8('0x1a')]=_0x1bc556[_0xfbe8('0x29')]&&_0x1bc556[_0xfbe8('0x29')]!==_0xfbe8('0x2a')?_0x1bc556['calleridname']:_0xfbe8('0x2b');}else{_0x33d92d[_0xfbe8('0x1a')]=_0x1bc556[_0xfbe8('0x2c')]&&_0x1bc556[_0xfbe8('0x2c')]!==_0xfbe8('0x2a')?_0x1bc556[_0xfbe8('0x2c')]:_0xfbe8('0x2b');}_0x584a0c=_0x33d92d;_0x58cd9d[_0xfbe8('0x30')](_0x33d92d);return;}}})[_0xfbe8('0x20')](function(){if(_0x341a1f){emit(_0x1bc556[_0xfbe8('0x24')],_0x7a72d5,util[_0xfbe8('0x31')]('user:%s',_0x341a1f['name']),util[_0xfbe8('0x31')]('trigger:%s',_0x282bf5[_0xfbe8('0x32')]['toLowerCase']()),{'evt':_['merge'](_0x1bc556,{'autoCreate':_0x23fb9d}),'contact':_0x584a0c===undefined?{}:_0x584a0c,'contacts':_0x58cd9d[_0xfbe8('0x23')]===0x0?undefined:_0x58cd9d});}});};
\ No newline at end of file
+var _0x4386=['data1','data2','isNil','data5','xmd-contactid','data3','split','$or','map','routeId','calleridnum','destcalleridnum','firstName','lastName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','then','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','<unknown>','format','name','trigger:%s','action','toLowerCase','merge','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit'];(function(_0x4ecbba,_0x3c366f){var _0x569384=function(_0x38a8a5){while(--_0x38a8a5){_0x4ecbba['push'](_0x4ecbba['shift']());}};_0x569384(++_0x3c366f);}(_0x4386,0xe9));var _0x6438=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x4386[_0x1bd323];return _0x13097b;};'use strict';var _=require(_0x6438('0x0'));var BPromise=require(_0x6438('0x1'));var Redis=require('ioredis');var util=require(_0x6438('0x2'));var config=require(_0x6438('0x3'));var logger=require(_0x6438('0x4'))(_0x6438('0x5'));var cmContactRpc=require(_0x6438('0x6'));config['redis']=_[_0x6438('0x7')](config[_0x6438('0x8')],{'host':_0x6438('0x9'),'port':0x18eb});var io=require(_0x6438('0xa'))(new Redis(config['redis']));function emit(_0x5c1513,_0x30a7cb,_0x33bb55,_0x36bdd7,_0x27217f){logger[_0x6438('0xb')](_0x6438('0xc'),_0x5c1513,_0x30a7cb['id'],_0x33bb55,_0x36bdd7,JSON[_0x6438('0xd')](_0x27217f));io['to'](_0x33bb55)[_0x6438('0xe')](_0x36bdd7,_0x27217f);}exports['exec']=function(_0x48c714,_0x2439c1,_0x25aa5f,_0x18dc88){var _0x1241fa,_0xecc208;var _0x1eb71a={};var _0x32c325;var _0x5647f8=Number(_0x25aa5f[_0x6438('0xf')]);var _0x5c6c40=_0x25aa5f[_0x6438('0x10')]?Boolean(Number(_0x25aa5f[_0x6438('0x10')])):![];var _0x4616eb;var _0x5bd433=![];if(!_[_0x6438('0x11')](_0x25aa5f[_0x6438('0x12')])){if(_0x25aa5f[_0x6438('0x12')]=='1')_0x5bd433=!![];}if(!_0x5bd433){if(_0x18dc88['xmd-contactid']){_0x1eb71a['id']=_0x18dc88[_0x6438('0x13')];}}if(!_0x1eb71a['id']){_0x1eb71a['ListId']=_0x5647f8;_0x4616eb=_0x25aa5f[_0x6438('0x14')]&&_0x25aa5f[_0x6438('0x14')]!=='0'?_0x25aa5f['data3'][_0x6438('0x15')](','):['phone'];_0x1eb71a[_0x6438('0x16')]=_[_0x6438('0x17')](_0x4616eb,function(_0x2c0d77){var _0x4da256={};_0x4da256[_0x2c0d77]=_0x18dc88[_0x6438('0x18')]?_0x18dc88['destcalleridnum']:_0x18dc88[_0x6438('0x19')];return _0x4da256;});_0x32c325=_0x18dc88[_0x6438('0x18')]?_0x18dc88[_0x6438('0x1a')]:_0x18dc88[_0x6438('0x19')];}var _0x5e9fe5=['id',_0x6438('0x1b'),_0x6438('0x1c'),_0x6438('0x1d'),_0x6438('0x1e'),_0x6438('0x1f'),'ListId',_0x6438('0x20'),_0x6438('0x21'),_0x6438('0x22')];var _0x97cf07=_[_0x6438('0x23')](_0x5e9fe5,_0x4616eb);BPromise[_0x6438('0x24')]()['then'](cmContactRpc[_0x6438('0x25')]({'attributes':_0x97cf07,'where':_0x1eb71a,'phone':_0x32c325}))['then'](function(_0x249981){_0xecc208=_0x249981;if(!_[_0x6438('0x26')](_0xecc208)){if(_0xecc208[_0x6438('0x27')]===0x1){_0x1241fa=_0xecc208[0x0];logger[_0x6438('0xb')](_0x6438('0x28'),_0x18dc88[_0x6438('0x29')],_0x2439c1['id'],_0x1241fa['id']);}else{logger['info'](_0x6438('0x2a'),_0x18dc88[_0x6438('0x29')],_0x2439c1['id'],_[_0x6438('0x17')](_0xecc208,'id')[_0x6438('0x2b')](','));}return;}else{logger['info'](_0x6438('0x2c'),_0x18dc88[_0x6438('0x29')],_0x2439c1['id']);var _0x1b4f86={'ListId':_0x5647f8};var _0x130527=_0x25aa5f['data4']&&_0x25aa5f[_0x6438('0x2d')]!=='0'?_0x25aa5f[_0x6438('0x2d')]:'phone';if(_0x5c6c40){logger[_0x6438('0xb')](_0x6438('0x2e'),_0x18dc88['uniqueid'],_0x2439c1['id']);_0x1b4f86[_0x130527]=_['isNil'](_0x18dc88[_0x6438('0x18')])?_0x18dc88['calleridnum']:_0x18dc88[_0x6438('0x1a')];if(_[_0x6438('0x11')](_0x18dc88[_0x6438('0x18')])){_0x1b4f86[_0x6438('0x1b')]=_0x18dc88['calleridname']&&_0x18dc88['calleridname']!=='<unknown>'?_0x18dc88[_0x6438('0x2f')]:_0x6438('0x30');}else{_0x1b4f86['firstName']=_0x18dc88[_0x6438('0x31')]&&_0x18dc88[_0x6438('0x31')]!=='<unknown>'?_0x18dc88['destcalleridname']:_0x6438('0x30');}return BPromise[_0x6438('0x24')]()[_0x6438('0x32')](cmContactRpc[_0x6438('0x33')](_0x1b4f86))[_0x6438('0x32')](function(_0x35d6e9){_0x1241fa=_0x35d6e9;_0xecc208[_0x6438('0x34')](_0x35d6e9);if(_0x1241fa){logger['info'](_0x6438('0x35'),_0x18dc88[_0x6438('0x29')],_0x2439c1['id'],_0x1241fa['id']);}return;});}else{logger[_0x6438('0xb')](_0x6438('0x36'),_0x18dc88[_0x6438('0x29')],_0x2439c1['id']);_0x1b4f86[_0x130527]=_[_0x6438('0x11')](_0x18dc88[_0x6438('0x18')])?_0x18dc88[_0x6438('0x19')]:_0x18dc88['destcalleridnum'];if(_[_0x6438('0x11')](_0x18dc88['routeId'])){_0x1b4f86[_0x6438('0x1b')]=_0x18dc88['calleridname']&&_0x18dc88[_0x6438('0x2f')]!=='<unknown>'?_0x18dc88['calleridname']:_0x6438('0x30');}else{_0x1b4f86[_0x6438('0x1b')]=_0x18dc88[_0x6438('0x31')]&&_0x18dc88[_0x6438('0x31')]!==_0x6438('0x37')?_0x18dc88[_0x6438('0x31')]:_0x6438('0x30');}_0x1241fa=_0x1b4f86;_0xecc208[_0x6438('0x34')](_0x1b4f86);return;}}})[_0x6438('0x32')](function(){if(_0x48c714){emit(_0x18dc88['uniqueid'],_0x2439c1,util[_0x6438('0x38')]('user:%s',_0x48c714[_0x6438('0x39')]),util[_0x6438('0x38')](_0x6438('0x3a'),_0x25aa5f[_0x6438('0x3b')][_0x6438('0x3c')]()),{'evt':_[_0x6438('0x3d')](_0x18dc88,{'autoCreate':_0x5c6c40}),'contact':_0x1241fa===undefined?{}:_0x1241fa,'contacts':_0xecc208['length']===0x0?undefined:_0xecc208});}});};
\ No newline at end of file
index 8070de8..6d39f82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb470=['../../../config/logger','trigger','../ami','redis','defaults','localhost','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnoanswer','custom:agentreject','custom:amd','custom:queuecallerabandon','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','clone','motionChannel','undefined','checkTriggers','prototype','hasOwnProperty','status','checkTrigger','merge','variables','Actions','interface','toLowerCase','contactmanager','motionbar','browser','data1','popup','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data4','uriLocation','windowWidth','800','data5','windowHeight','600','data6','winArguments','data3','user:%s','name','format','jscripty','action','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','length','every','checkConditions','some','field','account','chat','operator','value','ChatWebsiteId','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','equals','util','lodash','url','mustache','./urlforward','./integration','./cmContact','../../../config/environment'];(function(_0x5367c7,_0x3f77ef){var _0x95c323=function(_0x47cfac){while(--_0x47cfac){_0x5367c7['push'](_0x5367c7['shift']());}};_0x95c323(++_0x3f77ef);}(_0xb470,0x75));var _0x0b47=function(_0x576a18,_0x1086a2){_0x576a18=_0x576a18-0x0;var _0x324473=_0xb470[_0x576a18];return _0x324473;};'use strict';var util=require(_0x0b47('0x0'));var _=require(_0x0b47('0x1'));var url=require(_0x0b47('0x2'));var Mustache=require(_0x0b47('0x3'));var Redis=require('ioredis');var urlforward=require(_0x0b47('0x4'));var integration=require(_0x0b47('0x5'));var cmContact=require(_0x0b47('0x6'));var script=require('./script');var config=require(_0x0b47('0x7'));var logger=require(_0x0b47('0x8'))(_0x0b47('0x9'));var ami=require(_0x0b47('0xa'));config[_0x0b47('0xb')]=_[_0x0b47('0xc')](config[_0x0b47('0xb')],{'host':_0x0b47('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x5f02db,_0x5c21d2){return _0x5f02db==_0x5c21d2;},'not_equals':function(_0x38523d,_0x2b9cd0){return _0x38523d!=_0x2b9cd0;}};var barAndWebActions=['popup',_0x0b47('0x2'),_0x0b47('0xe')];function Trigger(_0x243f01){this[_0x0b47('0xf')]=_0x243f01[_0x0b47('0xf')];this[_0x0b47('0x10')]=_0x243f01[_0x0b47('0x10')];this[_0x0b47('0x11')]=_0x243f01[_0x0b47('0x11')];this[_0x0b47('0x12')]=_0x243f01['templates'];this['voiceExtensions']=_0x243f01[_0x0b47('0x13')];this['zendeskAccounts']=_0x243f01[_0x0b47('0x14')];this[_0x0b47('0x15')]=_0x243f01['freshdeskAccounts'];this[_0x0b47('0x16')]=_0x243f01[_0x0b47('0x16')];this[_0x0b47('0x17')]=_0x243f01[_0x0b47('0x17')];this[_0x0b47('0x18')]=_0x243f01[_0x0b47('0x18')];this[_0x0b47('0x19')]=_0x243f01[_0x0b47('0x19')];this[_0x0b47('0x1a')]=_0x243f01[_0x0b47('0x1a')];this['servicenowAccounts']=_0x243f01[_0x0b47('0x1b')];this['dynamics365Accounts']=_0x243f01[_0x0b47('0x1c')];this[_0x0b47('0x1d')]=_0x243f01[_0x0b47('0x1d')];this['accounts']={'zendesk':this[_0x0b47('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x0b47('0x17')],'zoho':this[_0x0b47('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x0b47('0x1a')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x0b47('0x1d')],'servicenow':this[_0x0b47('0x1b')]};ami['on'](_0x0b47('0x1e'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x21'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x22'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on']('custom:agentcomplete',this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on']('custom:agentnosuchnumber',this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x23'),this[_0x0b47('0x1f')]['bind'](this));ami['on']('custom:agentbusy',this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on']('custom:agentcongestion',this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x24'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x25'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x26'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x0b47('0x20')](this));ami['on']('custom:dialbegin',this[_0x0b47('0x27')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x28'),this[_0x0b47('0x27')][_0x0b47('0x20')](this));ami['on']('custom:dialend',this[_0x0b47('0x27')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x29'),this['syncCustomEvent'][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x2a'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x2b'),this[_0x0b47('0x1f')]['bind'](this));ami['on']('custom:incomingmessage',this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x2c'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x2d'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on'](_0x0b47('0x2e'),this[_0x0b47('0x1f')][_0x0b47('0x20')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0x0b47('0x20')](this));}Trigger['prototype'][_0x0b47('0x2f')]=function(_0x2c58d2,_0x15c66a,_0xa7724f){logger[_0x0b47('0x30')](_0x2c58d2,_0x15c66a,JSON[_0x0b47('0x31')](_0xa7724f));io['to'](_0x2c58d2)['emit'](_0x15c66a,_0xa7724f);};Trigger['prototype']['syncCustomEvent']=function(_0x1222da){var _0x368c2a=_[_0x0b47('0x32')](_0x1222da);if(typeof _0x368c2a[_0x0b47('0x33')]===_0x0b47('0x34')){_0x368c2a[_0x0b47('0x33')]='voice';}this[_0x0b47('0x35')](_0x368c2a);};Trigger[_0x0b47('0x36')][_0x0b47('0x27')]=function(_0x907222){if(this['agents'][_0x907222['interface']]){this[_0x0b47('0x1f')](_0x907222);}};Trigger[_0x0b47('0x36')]['checkTriggers']=function(_0x417db0){var _0x10e52b;for(var _0xa332b7 in this['triggers']){if(this['triggers'][_0x0b47('0x37')](_0xa332b7)){if(this[_0x0b47('0xf')][_0xa332b7][_0x0b47('0x38')]){_0x10e52b=this[_0x0b47('0x39')](this[_0x0b47('0xf')][_0xa332b7],_0x417db0);if(_0x10e52b){_[_0x0b47('0x3a')](_0x417db0,_0x417db0[_0x0b47('0x3b')]);for(var _0xc238cf=0x0,_0x126bcd,_0x34a089,_0x381379;_0xc238cf<this[_0x0b47('0xf')][_0xa332b7][_0x0b47('0x3c')]['length'];_0xc238cf+=0x1){_0x126bcd=this['triggers'][_0xa332b7][_0x0b47('0x3c')][_0xc238cf];if(this['agents'][_0x417db0[_0x0b47('0x3d')]]){switch(_0x126bcd['action'][_0x0b47('0x3e')]()){case _0x0b47('0x3f'):break;case _0x0b47('0x40'):case _0x0b47('0x41'):var _0x4f6f12={};switch(barAndWebActions[_0x126bcd[_0x0b47('0x42')]]){case _0x0b47('0x43'):_0x4f6f12['TemplateId']=_0x126bcd[_0x0b47('0x44')];_0x4f6f12['html']=this[_0x0b47('0x12')][_0x126bcd[_0x0b47('0x44')]]?Mustache[_0x0b47('0x45')](this[_0x0b47('0x12')][_0x126bcd[_0x0b47('0x44')]][_0x0b47('0x46')],_0x417db0):_0x0b47('0x47');break;case _0x0b47('0x2'):_0x4f6f12[_0x0b47('0x48')]=this[_0x0b47('0x49')](_0x126bcd['data2'],_0x417db0,_['isNil'](_0x126bcd['data3'])?!![]:parseInt(_0x126bcd['data3'],0xa));if(_[_0x0b47('0x4a')](_0x126bcd[_0x0b47('0x4b')])){_0x4f6f12['location']='0';}else{_0x4f6f12[_0x0b47('0x4c')]=_0x126bcd['data4'];_0x4f6f12[_0x0b47('0x4d')]=_[_0x0b47('0x4a')](_0x126bcd['data5'])?_0x0b47('0x4e'):_0x126bcd[_0x0b47('0x4f')];_0x4f6f12[_0x0b47('0x50')]=_[_0x0b47('0x4a')](_0x126bcd['data6'])?_0x0b47('0x51'):_0x126bcd[_0x0b47('0x52')];}break;case _0x0b47('0xe'):_0x4f6f12['winApplication']=_0x126bcd[_0x0b47('0x44')]?Mustache[_0x0b47('0x45')](_0x126bcd['data2'],_0x417db0):'';_0x4f6f12[_0x0b47('0x53')]=_0x126bcd['data3']?Mustache['render'](_0x126bcd[_0x0b47('0x54')],_0x417db0):'';break;}this[_0x0b47('0x2f')](util['format'](_0x0b47('0x55'),this['agents'][_0x417db0[_0x0b47('0x3d')]][_0x0b47('0x56')]),util[_0x0b47('0x57')]('trigger:%s:%s',_0x126bcd['action'][_0x0b47('0x3e')](),barAndWebActions[_0x126bcd[_0x0b47('0x42')]]),_[_0x0b47('0x3a')](_0x4f6f12,_0x417db0));break;case _0x0b47('0x58'):this[_0x0b47('0x2f')](util[_0x0b47('0x57')](_0x0b47('0x55'),this[_0x0b47('0x10')][_0x417db0[_0x0b47('0x3d')]][_0x0b47('0x56')]),util[_0x0b47('0x57')]('trigger:%s',_0x126bcd[_0x0b47('0x59')][_0x0b47('0x3e')]()),_[_0x0b47('0x3a')]({'ProjectId':parseInt(_0x126bcd['data1'],0xa)},_0x417db0));break;default:this['emit'](util['format']('user:%s',this[_0x0b47('0x10')][_0x417db0[_0x0b47('0x3d')]][_0x0b47('0x56')]),util[_0x0b47('0x57')](_0x0b47('0x5a'),_0x126bcd[_0x0b47('0x59')]['toLowerCase']()),_[_0x0b47('0x3a')]({},_0x126bcd,_0x417db0));}}switch(_0x126bcd[_0x0b47('0x59')][_0x0b47('0x3e')]()){case'contactmanager':cmContact[_0x0b47('0x5b')](this[_0x0b47('0x10')][_0x417db0[_0x0b47('0x3d')]],this[_0x0b47('0xf')][_0xa332b7],_0x126bcd,_0x417db0);break;case _0x0b47('0x5c'):integration['exec'](_0x126bcd,_0x417db0,this['accounts'],this[_0x0b47('0x10')][_0x417db0[_0x0b47('0x3d')]],this['voiceQueues'][_0x417db0[_0x0b47('0x5d')]],this[_0x0b47('0x13')][_0x417db0[_0x0b47('0x5e')]]);break;case _0x0b47('0x5f'):urlforward[_0x0b47('0x5b')](_0x126bcd,_0x417db0);break;case _0x0b47('0x60'):script[_0x0b47('0x5b')](_0x126bcd,_0x417db0);break;}}}}}}};Trigger[_0x0b47('0x36')]['buildUri']=function(_0x3237aa,_0x538888,_0x575867){var _0x132666=url[_0x0b47('0x61')](Mustache['render'](_0x3237aa,_0x538888),!![]);if(_0x575867){_[_0x0b47('0x3a')](_0x132666[_0x0b47('0x62')],_0x538888);}delete _0x132666[_0x0b47('0x63')];var _0x3712c8=url['format'](_0x132666);_0x3712c8=_0x3712c8[_0x0b47('0x64')](/\/\?/g,'?');return _0x3712c8;};Trigger['prototype'][_0x0b47('0x39')]=function(_0x3ae376,_0x10155f){var _0x13654a=!![];var _0x1d11cc=!![];var _0x2370ea=![];if(_0x3ae376[_0x0b47('0x65')]===_0x10155f[_0x0b47('0x33')]){_0x2370ea=!![];}if(_0x3ae376[_0x0b47('0x66')][_0x0b47('0x67')]){_0x13654a=_[_0x0b47('0x68')](_0x3ae376[_0x0b47('0x66')],this[_0x0b47('0x69')](_0x10155f,_0x3ae376[_0x0b47('0x65')]));}if(_0x3ae376['AnyConditions'][_0x0b47('0x67')]){_0x1d11cc=_[_0x0b47('0x6a')](_0x3ae376['AnyConditions'],this[_0x0b47('0x69')](_0x10155f,_0x3ae376[_0x0b47('0x65')]));}return _0x2370ea&&_0x13654a&&_0x1d11cc;};Trigger[_0x0b47('0x36')][_0x0b47('0x69')]=function(_0x1b86f1,_0x1a3f2d){return function(_0x4933d6){switch(_0x4933d6[_0x0b47('0x6b')]){case _0x0b47('0x6c'):if(_0x1b86f1[_0x0b47('0x65')]===_0x1a3f2d){if(_0x1a3f2d===_0x0b47('0x6d')){return _0x1b86f1['ChatWebsiteId']?operators[_0x4933d6[_0x0b47('0x6e')]](Number(_0x4933d6[_0x0b47('0x6f')]),_0x1b86f1[_0x0b47('0x70')]):![];}else{return _0x1b86f1[_['upperFirst'](_0x1a3f2d)+'AccountId']?operators[_0x4933d6[_0x0b47('0x6e')]](Number(_0x4933d6['value']),_0x1b86f1[_[_0x0b47('0x71')](_0x1a3f2d)+_0x0b47('0x72')]):![];}}break;case _0x0b47('0x73'):case _0x0b47('0x74'):if(_0x1b86f1['channel']===_0x1a3f2d){return _0x1b86f1[_0x0b47('0x75')]?operators[_0x4933d6[_0x0b47('0x6e')]](_0x4933d6[_0x0b47('0x6f')],_0x1b86f1[_0x0b47('0x75')]):![];}break;case _0x0b47('0x5d'):return _0x1b86f1['queue']?operators[_0x4933d6['operator']](_0x4933d6[_0x0b47('0x6f')],_0x1b86f1[_0x0b47('0x5d')]):![];case _0x0b47('0x76'):return _0x1b86f1['membername']?operators[_0x4933d6[_0x0b47('0x6e')]](_0x4933d6['value'],_0x1b86f1[_0x0b47('0x77')]):![];case _0x0b47('0x78'):return _0x1b86f1[_0x0b47('0x78')]?operators[_0x4933d6[_0x0b47('0x6e')]](_0x4933d6[_0x0b47('0x6f')],_0x1b86f1[_0x0b47('0x78')]):![];case _0x0b47('0x5e'):return _0x1b86f1[_0x0b47('0x5e')]?operators[_0x4933d6[_0x0b47('0x6e')]](_0x4933d6[_0x0b47('0x6f')],_0x1b86f1[_0x0b47('0x5e')]):![];case _0x0b47('0x79'):if(_0x4933d6['value']===_0x0b47('0x7a'))_0x4933d6[_0x0b47('0x6f')]=null;return typeof _0x1b86f1[_0x0b47('0x7b')]!==_0x0b47('0x34')?operators[_0x4933d6[_0x0b47('0x6e')]](_0x4933d6[_0x0b47('0x6f')],_0x1b86f1[_0x0b47('0x7b')]):![];case'offlineMessage':if(_0x1b86f1[_0x0b47('0x65')]===_0x1a3f2d){return _0x4933d6[_0x0b47('0x6f')]==='created'&&_0x4933d6[_0x0b47('0x6e')]===_0x0b47('0x7c')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x5a99=['voice','interface','checkTriggers','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','toLowerCase','motionbar','browser','data1','TemplateId','data2','html','render','template\x20not\x20found','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','data6','600','winapp','winApplication','winArguments','format','user:%s','name','jscripty','trigger:%s','contactmanager','exec','integration','queue','routeId','urlforward','script','buildUri','parse','query','channel','AllConditions','every','AnyConditions','some','checkConditions','field','account','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','message','agent','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','ioredis','./urlforward','./integration','./cmContact','../../../config/environment','../../../config/logger','trigger','../ami','defaults','redis','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','zendeskAccounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','emit','info','stringify','clone','motionChannel','undefined'];(function(_0x413aac,_0x5e2430){var _0x569b11=function(_0x52e060){while(--_0x52e060){_0x413aac['push'](_0x413aac['shift']());}};_0x569b11(++_0x5e2430);}(_0x5a99,0xc9));var _0x95a9=function(_0xe84837,_0x5d6d0b){_0xe84837=_0xe84837-0x0;var _0x3bc65b=_0x5a99[_0xe84837];return _0x3bc65b;};'use strict';var util=require(_0x95a9('0x0'));var _=require(_0x95a9('0x1'));var url=require(_0x95a9('0x2'));var Mustache=require('mustache');var Redis=require(_0x95a9('0x3'));var urlforward=require(_0x95a9('0x4'));var integration=require(_0x95a9('0x5'));var cmContact=require(_0x95a9('0x6'));var script=require('./script');var config=require(_0x95a9('0x7'));var logger=require(_0x95a9('0x8'))(_0x95a9('0x9'));var ami=require(_0x95a9('0xa'));config['redis']=_[_0x95a9('0xb')](config[_0x95a9('0xc')],{'host':_0x95a9('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x95a9('0xc')]));var operators={'equals':function(_0x503d04,_0x221b95){return _0x503d04==_0x221b95;},'not_equals':function(_0x34290e,_0x48d5f0){return _0x34290e!=_0x48d5f0;}};var barAndWebActions=[_0x95a9('0xe'),_0x95a9('0x2'),'winapp'];function Trigger(_0x4aedae){this[_0x95a9('0xf')]=_0x4aedae[_0x95a9('0xf')];this['agents']=_0x4aedae[_0x95a9('0x10')];this['voiceQueues']=_0x4aedae[_0x95a9('0x11')];this[_0x95a9('0x12')]=_0x4aedae[_0x95a9('0x12')];this[_0x95a9('0x13')]=_0x4aedae[_0x95a9('0x13')];this['zendeskAccounts']=_0x4aedae['zendeskAccounts'];this['freshdeskAccounts']=_0x4aedae[_0x95a9('0x14')];this['salesforceAccounts']=_0x4aedae[_0x95a9('0x15')];this[_0x95a9('0x16')]=_0x4aedae[_0x95a9('0x16')];this['zohoAccounts']=_0x4aedae[_0x95a9('0x17')];this['deskAccounts']=_0x4aedae[_0x95a9('0x18')];this[_0x95a9('0x19')]=_0x4aedae[_0x95a9('0x19')];this['servicenowAccounts']=_0x4aedae[_0x95a9('0x1a')];this['dynamics365Accounts']=_0x4aedae['dynamics365Accounts'];this[_0x95a9('0x1b')]=_0x4aedae[_0x95a9('0x1b')];this[_0x95a9('0x1c')]={'zendesk':this[_0x95a9('0x1d')],'salesforce':this[_0x95a9('0x15')],'freshdesk':this[_0x95a9('0x14')],'sugarcrm':this[_0x95a9('0x16')],'zoho':this[_0x95a9('0x17')],'desk':this[_0x95a9('0x18')],'vtiger':this[_0x95a9('0x19')],'dynamics365':this[_0x95a9('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x95a9('0x1a')]};ami['on'](_0x95a9('0x1f'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on']('custom:agentconnect',this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x22'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x23'),this[_0x95a9('0x20')]['bind'](this));ami['on'](_0x95a9('0x24'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on']('custom:agentnoanswer',this['syncCustomEvent'][_0x95a9('0x21')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x95a9('0x21')](this));ami['on']('custom:agentcongestion',this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x25'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x26'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x27'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x28'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x29'),this[_0x95a9('0x2a')][_0x95a9('0x21')](this));ami['on']('custom:dialconnect',this['syncAgentDial']['bind'](this));ami['on'](_0x95a9('0x2b'),this[_0x95a9('0x2a')][_0x95a9('0x21')](this));ami['on']('custom:newinteraction',this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x2c'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x2d'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on']('custom:incomingmessage',this['syncCustomEvent']['bind'](this));ami['on'](_0x95a9('0x2e'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x2f'),this['syncCustomEvent'][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x30'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));ami['on'](_0x95a9('0x31'),this[_0x95a9('0x20')][_0x95a9('0x21')](this));}Trigger[_0x95a9('0x32')][_0x95a9('0x33')]=function(_0xfd7f78,_0x39f593,_0x5749fb){logger[_0x95a9('0x34')](_0xfd7f78,_0x39f593,JSON[_0x95a9('0x35')](_0x5749fb));io['to'](_0xfd7f78)[_0x95a9('0x33')](_0x39f593,_0x5749fb);};Trigger[_0x95a9('0x32')][_0x95a9('0x20')]=function(_0x3a3caf){var _0x5b415a=_[_0x95a9('0x36')](_0x3a3caf);if(typeof _0x5b415a[_0x95a9('0x37')]===_0x95a9('0x38')){_0x5b415a[_0x95a9('0x37')]=_0x95a9('0x39');}this['checkTriggers'](_0x5b415a);};Trigger[_0x95a9('0x32')][_0x95a9('0x2a')]=function(_0x525f36){if(this[_0x95a9('0x10')][_0x525f36[_0x95a9('0x3a')]]){this['syncCustomEvent'](_0x525f36);}};Trigger['prototype'][_0x95a9('0x3b')]=function(_0x147a7b){var _0x3f4805;for(var _0x336cbf in this[_0x95a9('0xf')]){if(this[_0x95a9('0xf')][_0x95a9('0x3c')](_0x336cbf)){if(this[_0x95a9('0xf')][_0x336cbf]['status']){_0x3f4805=this[_0x95a9('0x3d')](this[_0x95a9('0xf')][_0x336cbf],_0x147a7b);if(_0x3f4805){_[_0x95a9('0x3e')](_0x147a7b,_0x147a7b[_0x95a9('0x3f')]);for(var _0x16096f=0x0,_0x1f3557,_0x3778c5,_0x42a56c;_0x16096f<this[_0x95a9('0xf')][_0x336cbf][_0x95a9('0x40')][_0x95a9('0x41')];_0x16096f+=0x1){_0x1f3557=this[_0x95a9('0xf')][_0x336cbf]['Actions'][_0x16096f];if(this[_0x95a9('0x10')][_0x147a7b['interface']]){switch(_0x1f3557[_0x95a9('0x42')][_0x95a9('0x43')]()){case'contactmanager':break;case _0x95a9('0x44'):case _0x95a9('0x45'):var _0x25c3ba={};switch(barAndWebActions[_0x1f3557[_0x95a9('0x46')]]){case _0x95a9('0xe'):_0x25c3ba[_0x95a9('0x47')]=_0x1f3557[_0x95a9('0x48')];_0x25c3ba[_0x95a9('0x49')]=this[_0x95a9('0x12')][_0x1f3557[_0x95a9('0x48')]]?Mustache[_0x95a9('0x4a')](this[_0x95a9('0x12')][_0x1f3557[_0x95a9('0x48')]][_0x95a9('0x49')],_0x147a7b):_0x95a9('0x4b');break;case _0x95a9('0x2'):_0x25c3ba['uri']=this['buildUri'](_0x1f3557[_0x95a9('0x48')],_0x147a7b,_[_0x95a9('0x4c')](_0x1f3557[_0x95a9('0x4d')])?!![]:parseInt(_0x1f3557[_0x95a9('0x4d')],0xa));if(_[_0x95a9('0x4c')](_0x1f3557[_0x95a9('0x4e')])){_0x25c3ba[_0x95a9('0x4f')]='0';}else{_0x25c3ba[_0x95a9('0x50')]=_0x1f3557[_0x95a9('0x4e')];_0x25c3ba[_0x95a9('0x51')]=_[_0x95a9('0x4c')](_0x1f3557['data5'])?_0x95a9('0x52'):_0x1f3557[_0x95a9('0x53')];_0x25c3ba['windowHeight']=_[_0x95a9('0x4c')](_0x1f3557[_0x95a9('0x54')])?_0x95a9('0x55'):_0x1f3557[_0x95a9('0x54')];}break;case _0x95a9('0x56'):_0x25c3ba[_0x95a9('0x57')]=_0x1f3557[_0x95a9('0x48')]?Mustache[_0x95a9('0x4a')](_0x1f3557['data2'],_0x147a7b):'';_0x25c3ba[_0x95a9('0x58')]=_0x1f3557[_0x95a9('0x4d')]?Mustache[_0x95a9('0x4a')](_0x1f3557[_0x95a9('0x4d')],_0x147a7b):'';break;}this[_0x95a9('0x33')](util[_0x95a9('0x59')](_0x95a9('0x5a'),this[_0x95a9('0x10')][_0x147a7b[_0x95a9('0x3a')]][_0x95a9('0x5b')]),util[_0x95a9('0x59')]('trigger:%s:%s',_0x1f3557['action'][_0x95a9('0x43')](),barAndWebActions[_0x1f3557[_0x95a9('0x46')]]),_['merge'](_0x25c3ba,_0x147a7b));break;case _0x95a9('0x5c'):this['emit'](util[_0x95a9('0x59')](_0x95a9('0x5a'),this[_0x95a9('0x10')][_0x147a7b['interface']][_0x95a9('0x5b')]),util[_0x95a9('0x59')](_0x95a9('0x5d'),_0x1f3557['action'][_0x95a9('0x43')]()),_[_0x95a9('0x3e')]({'ProjectId':parseInt(_0x1f3557[_0x95a9('0x46')],0xa)},_0x147a7b));break;default:this[_0x95a9('0x33')](util[_0x95a9('0x59')](_0x95a9('0x5a'),this[_0x95a9('0x10')][_0x147a7b[_0x95a9('0x3a')]][_0x95a9('0x5b')]),util[_0x95a9('0x59')](_0x95a9('0x5d'),_0x1f3557[_0x95a9('0x42')][_0x95a9('0x43')]()),_[_0x95a9('0x3e')]({},_0x1f3557,_0x147a7b));}}switch(_0x1f3557[_0x95a9('0x42')]['toLowerCase']()){case _0x95a9('0x5e'):cmContact[_0x95a9('0x5f')](this[_0x95a9('0x10')][_0x147a7b[_0x95a9('0x3a')]],this[_0x95a9('0xf')][_0x336cbf],_0x1f3557,_0x147a7b);break;case _0x95a9('0x60'):integration[_0x95a9('0x5f')](_0x1f3557,_0x147a7b,this[_0x95a9('0x1c')],this[_0x95a9('0x10')][_0x147a7b[_0x95a9('0x3a')]],this[_0x95a9('0x11')][_0x147a7b[_0x95a9('0x61')]],this[_0x95a9('0x13')][_0x147a7b[_0x95a9('0x62')]]);break;case _0x95a9('0x63'):urlforward[_0x95a9('0x5f')](_0x1f3557,_0x147a7b);break;case _0x95a9('0x64'):script[_0x95a9('0x5f')](_0x1f3557,_0x147a7b);break;}}}}}}};Trigger[_0x95a9('0x32')][_0x95a9('0x65')]=function(_0x3131b8,_0x3d7c7f,_0x5655e2){var _0x5afbb6=url[_0x95a9('0x66')](Mustache[_0x95a9('0x4a')](_0x3131b8,_0x3d7c7f),!![]);if(_0x5655e2){_['merge'](_0x5afbb6[_0x95a9('0x67')],_0x3d7c7f);}delete _0x5afbb6['search'];var _0x593c6b=url[_0x95a9('0x59')](_0x5afbb6);_0x593c6b=_0x593c6b['replace'](/\/\?/g,'?');return _0x593c6b;};Trigger[_0x95a9('0x32')][_0x95a9('0x3d')]=function(_0x48a6f6,_0x3b1022){var _0x1eb82e=!![];var _0x56f37c=!![];var _0x36952f=![];if(_0x48a6f6[_0x95a9('0x68')]===_0x3b1022['motionChannel']){_0x36952f=!![];}if(_0x48a6f6[_0x95a9('0x69')][_0x95a9('0x41')]){_0x1eb82e=_[_0x95a9('0x6a')](_0x48a6f6[_0x95a9('0x69')],this['checkConditions'](_0x3b1022,_0x48a6f6['channel']));}if(_0x48a6f6[_0x95a9('0x6b')][_0x95a9('0x41')]){_0x56f37c=_[_0x95a9('0x6c')](_0x48a6f6[_0x95a9('0x6b')],this[_0x95a9('0x6d')](_0x3b1022,_0x48a6f6[_0x95a9('0x68')]));}return _0x36952f&&_0x1eb82e&&_0x56f37c;};Trigger[_0x95a9('0x32')]['checkConditions']=function(_0x47a6fb,_0x58abbb){return function(_0xde306){switch(_0xde306[_0x95a9('0x6e')]){case _0x95a9('0x6f'):if(_0x47a6fb[_0x95a9('0x68')]===_0x58abbb){if(_0x58abbb==='chat'){return _0x47a6fb[_0x95a9('0x70')]?operators[_0xde306[_0x95a9('0x71')]](Number(_0xde306['value']),_0x47a6fb[_0x95a9('0x70')]):![];}else{return _0x47a6fb[_[_0x95a9('0x72')](_0x58abbb)+_0x95a9('0x73')]?operators[_0xde306[_0x95a9('0x71')]](Number(_0xde306[_0x95a9('0x74')]),_0x47a6fb[_[_0x95a9('0x72')](_0x58abbb)+_0x95a9('0x73')]):![];}}break;case _0x95a9('0x75'):case _0x95a9('0x76'):if(_0x47a6fb[_0x95a9('0x68')]===_0x58abbb){return _0x47a6fb['event']?operators[_0xde306[_0x95a9('0x71')]](_0xde306[_0x95a9('0x74')],_0x47a6fb['event']):![];}break;case _0x95a9('0x61'):return _0x47a6fb[_0x95a9('0x61')]?operators[_0xde306[_0x95a9('0x71')]](_0xde306['value'],_0x47a6fb['queue']):![];case _0x95a9('0x77'):return _0x47a6fb['membername']?operators[_0xde306[_0x95a9('0x71')]](_0xde306['value'],_0x47a6fb[_0x95a9('0x78')]):![];case _0x95a9('0x79'):return _0x47a6fb[_0x95a9('0x79')]?operators[_0xde306['operator']](_0xde306[_0x95a9('0x74')],_0x47a6fb[_0x95a9('0x79')]):![];case _0x95a9('0x62'):return _0x47a6fb[_0x95a9('0x62')]?operators[_0xde306[_0x95a9('0x71')]](_0xde306['value'],_0x47a6fb[_0x95a9('0x62')]):![];case _0x95a9('0x7a'):if(_0xde306['value']===_0x95a9('0x7b'))_0xde306[_0x95a9('0x74')]=null;return typeof _0x47a6fb[_0x95a9('0x7c')]!==_0x95a9('0x38')?operators[_0xde306[_0x95a9('0x71')]](_0xde306[_0x95a9('0x74')],_0x47a6fb['substatus']):![];case _0x95a9('0x7d'):if(_0x47a6fb[_0x95a9('0x68')]===_0x58abbb){return _0xde306[_0x95a9('0x74')]===_0x95a9('0x7e')&&_0xde306[_0x95a9('0x71')]===_0x95a9('0x7f')?!![]:![];}break;}return![];};};module[_0x95a9('0x80')]=Trigger;
\ No newline at end of file
index d12f799..a3d2116 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['catch','stringify','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','%s/users','then','total_entries','_embedded','entries','Agent\x20found!','format','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','debug','[HTTP]','GET','authType','basic','password','%s/token:%s','Basic\x20%s','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','work','map','length','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','toString','variable','variableName','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','concat','Descriptions','user','Fields','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','integrationTab','%s/agent/tickets/%s'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x326f,0xd1));var _0xf326=function(_0x4136c6,_0x428e61){_0x4136c6=_0x4136c6-0x0;var _0x3deaad=_0x326f[_0x4136c6];return _0x3deaad;};'use strict';var _=require(_0xf326('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xf326('0x1'));var Redis=require(_0xf326('0x2'));var intUtil=require(_0xf326('0x3'));var config=require(_0xf326('0x4'));var logger=require(_0xf326('0x5'))(_0xf326('0x6'));config[_0xf326('0x7')]=_[_0xf326('0x8')](config[_0xf326('0x7')],{'host':_0xf326('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf326('0x7')]));function emit(_0x3851eb,_0x165f95,_0x1e7b8a){io['to'](_0x3851eb)['emit'](_0x165f95,_0x1e7b8a);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x3bacf2,_0x1fc80e){if(intUtil[_0xf326('0xa')](_0x1fc80e)===!![]){logger[_0xf326('0xb')](_0xf326('0xc'),_0x1fc80e);return request({'uri':util['format'](_0xf326('0xd'),_0x3bacf2['remoteUri'])})[_0xf326('0xe')](function(_0x4aaf3a){if(_0x4aaf3a[_0xf326('0xf')]){return _['find'](_0x4aaf3a[_0xf326('0x10')][_0xf326('0x11')],{'email':_0x1fc80e});}})['then'](function(_0x342fe5){if(_0x342fe5){logger[_0xf326('0xb')](_0xf326('0x12'));return _0x342fe5;}else{logger[_0xf326('0xb')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf326('0x13')]('%s/users/me',_0x3bacf2['remoteUri'])});}});}else{logger[_0xf326('0xb')](_0xf326('0x14'));return request({'uri':util[_0xf326('0x13')](_0xf326('0x15'),_0x3bacf2[_0xf326('0x16')])});}}function request(_0x287a2a){logger[_0xf326('0x17')](_0xf326('0x18'),JSON['stringify'](_0x287a2a));return rp(_[_0xf326('0x8')](_0x287a2a,{'method':_0xf326('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x18bee3){var _0x31ffb9;if(_0x18bee3[_0xf326('0x1a')]===_0xf326('0x1b')){_0x31ffb9=util['format']('%s:%s',_0x18bee3['username'],_0x18bee3[_0xf326('0x1c')]);}else if(_0x18bee3[_0xf326('0x1a')]==='token'){_0x31ffb9=util['format'](_0xf326('0x1d'),_0x18bee3['username'],_0x18bee3['token']);}return util[_0xf326('0x13')](_0xf326('0x1e'),new Buffer(_0x31ffb9)['toString']('base64'));}function getEndUser(_0x19b8ba,_0xb1efcf,_0x5f21a2){logger[_0xf326('0xb')](_0xf326('0x1f'),_0x5f21a2);return request({'uri':util[_0xf326('0x13')](_0xf326('0x20'),_0x19b8ba[_0xf326('0x16')]),'qs':{'phone':_0x5f21a2}})[_0xf326('0xe')](function(_0x5ce532){if(_0x5ce532['total_entries']){logger['info'](_0xf326('0x21'));return _0x5ce532[_0xf326('0x10')][_0xf326('0x11')][0x0];}else{logger[_0xf326('0xb')](_0xf326('0x22'));return request({'uri':util[_0xf326('0x13')]('%s/customers',_0x19b8ba[_0xf326('0x16')]),'method':_0xf326('0x23'),'body':{'first_name':_0xb1efcf,'title':_0xb1efcf,'phone_numbers':[{'type':_0xf326('0x24'),'value':_0x5f21a2}]}});}});}function getTags(_0x581531,_0x1617d2){var _0x55ad0f=[];if(_0x581531&&_0x581531['length']>0x0){_0x55ad0f=_[_0xf326('0x25')](_0x581531,_0x1617d2);}return _0x55ad0f;}function getCustomFields(_0x1ae23a,_0x2fa28e){var _0x5dbe63=[];var _0xc115d9={'custom_fields':{}};if(_0x1ae23a[_0xf326('0x26')]>0x0){_['forEach'](_0x1ae23a,function(_0x225776){if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776[_0xf326('0x2a')])&&_0x225776[_0xf326('0x2b')]&&!_0x225776[_0xf326('0x2c')]){_0xc115d9[_0x225776[_0xf326('0x2b')][_0xf326('0x2d')]()]=_0x225776[_0xf326('0x2e')]['toString']();}else if(_[_0xf326('0x27')]([_0xf326('0x28'),_0xf326('0x29')],_0x225776['type'])&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x225776['content'][_0xf326('0x31')]();}else if(_0x225776[_0xf326('0x2a')]===_0xf326('0x32')&&_0x225776[_0xf326('0x33')]&&_0x225776[_0xf326('0x2f')]&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776[_0xf326('0x33')]]&&(_0xc115d9[_0xf326('0x30')][_0x225776['idField']]=_0x2fa28e[_0x225776[_0xf326('0x33')]][_0xf326('0x31')]());}else if(_0x225776['type']===_0xf326('0x34')&&_0x225776['Variable']&&_0x225776[_0xf326('0x35')]['name']&&_0x225776['idField']&&_0x225776[_0xf326('0x2c')]){_0x2fa28e[_0x225776['Variable'][_0xf326('0x36')]['toLowerCase']()]&&(_0xc115d9[_0xf326('0x30')][_0x225776[_0xf326('0x2f')]]=_0x2fa28e[_0x225776[_0xf326('0x35')]['name'][_0xf326('0x2d')]()][_0xf326('0x31')]());}});}if(_0xc115d9['priority']){_0xc115d9[_0xf326('0x37')]=Number(_0xc115d9[_0xf326('0x37')]);}return _0xc115d9;}function getTicket(_0x40fa7a,_0xaf65e0,_0x51076c,_0x2c4416,_0xb1ef35){logger[_0xf326('0xb')](_0xf326('0x38'));var _0x1d88ed=_['merge']({'subject':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3a')],_0xb1ef35,'\x20'),'type':'phone','status':'new','labels':[_0xf326('0x3b'),'Motion','CTI'][_0xf326('0x3c')](getTags(_0x2c4416['Tags'],_0xf326('0x36'))),'description':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a'),'_links':{'assigned_user':{'href':util[_0xf326('0x13')]('/api/v2/users/%d',_0xaf65e0['id']),'class':_0xf326('0x3e')}},'message':{'direction':'in','body':intUtil[_0xf326('0x39')](_0x2c4416[_0xf326('0x3d')],_0xb1ef35,'\x0a')}},getCustomFields(_0x2c4416[_0xf326('0x3f')],_0xb1ef35));return request({'uri':util[_0xf326('0x13')](_0xf326('0x40'),_0x40fa7a[_0xf326('0x16')],_0x51076c['id']),'method':_0xf326('0x23'),'body':_0x1d88ed});}exports[_0xf326('0x41')]=function(_0x1227d3,_0x361776,_0x2bab13,_0x50d63f,_0x1b6126,_0x1637dc){var _0x2ed1a7,_0x270288;_0x1637dc[_0xf326('0x16')]=intUtil[_0xf326('0x42')](_0x1637dc['remoteUri']);_0x1637dc[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x1637dc['serverUrl']);if(_0x1b6126&&_0x1b6126[_0xf326('0x44')]){logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x46'));_0x361776[_0xf326('0x47')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1637dc[_0xf326('0x43')],_0x361776[_0xf326('0x48')],md5(_0x361776['uniqueid']));}else{_0x361776['recordingURL']='';}headers[_0xf326('0x49')]=getAuth(_0x1637dc);return getUser(_0x1637dc,_0x50d63f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x5b3705){_0x2ed1a7=_0x5b3705;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2ed1a7['id']);return getEndUser(_0x1637dc,_0x361776[_0xf326('0x4c')],_0x361776[_0xf326('0x4d')]);})[_0xf326('0xe')](function(_0x2d9bba){_0x270288=_0x2d9bba;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x270288['id']);return getTicket(_0x1637dc,_0x2ed1a7,_0x270288,_0x2bab13,_0x361776);})[_0xf326('0xe')](function(_0x27ced1){if(_0x27ced1){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x27ced1['id']);switch(_0x1637dc[_0xf326('0x2a')]){case'integrationTab':logger[_0xf326('0xb')](_0xf326('0x45'),_0xf326('0x51'));emit(util[_0xf326('0x13')]('user:%s',_0x50d63f[_0xf326('0x36')]),_0xf326('0x52'),{'recordId':_0x27ced1['id']});break;case _0xf326('0x53'):logger[_0xf326('0xb')]('[QUEUE]',_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x50d63f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x27ced1['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x45'),_0xf326('0x58'));}}})['catch'](function(_0x102fba){console[_0xf326('0x57')](_0x102fba);logger[_0xf326('0x57')]('[QUEUE]',JSON['stringify'](_0x102fba));});};exports[_0xf326('0x59')]=function(_0x5b4832,_0x1cf58f,_0x554277,_0x458e5f,_0x7ee57,_0x28c959,_0x25e091){var _0x212594,_0x35d3c8;_0x28c959[_0xf326('0x16')]=intUtil['stripTrailingSlash'](_0x28c959[_0xf326('0x16')]);_0x28c959[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28c959['serverUrl']);if(_0x25e091&&_0x25e091[_0xf326('0x5a')]&&_0x25e091[_0xf326('0x5a')]!==_0xf326('0x5b')){logger[_0xf326('0xb')](_0xf326('0x5c'),'Recording\x20is\x20enabled!');_0x1cf58f[_0xf326('0x47')]=util[_0xf326('0x13')](_0xf326('0x5d'),_0x28c959[_0xf326('0x43')],_0x1cf58f['uniqueid'],md5(_0x1cf58f[_0xf326('0x48')]));}headers[_0xf326('0x49')]=getAuth(_0x28c959);return getUser(_0x28c959,_0x458e5f[_0xf326('0x4a')])[_0xf326('0xe')](function(_0x4d3b9e){_0x212594=_0x4d3b9e;logger['info'](_0xf326('0x4b'),_0x212594['id']);return getEndUser(_0x28c959,_0x1cf58f[_0xf326('0x5e')],_0x1cf58f['destcalleridnum']);})[_0xf326('0xe')](function(_0x29de71){_0x35d3c8=_0x29de71;logger[_0xf326('0xb')](_0xf326('0x4e'),_0x35d3c8['id']);return getTicket(_0x28c959,_0x212594,_0x35d3c8,_0x554277,_0x1cf58f);})['then'](function(_0xb1c18c){if(_0xb1c18c){logger['info']('Ticket\x20created!');logger[_0xf326('0xb')]('The\x20Ticket\x20ID\x20is:',_0xb1c18c['id']);switch(_0x28c959[_0xf326('0x2a')]){case _0xf326('0x5f'):logger[_0xf326('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),'trigger:desk:display',{'recordId':_0xb1c18c['id']});break;case _0xf326('0x53'):logger['info'](_0xf326('0x45'),_0xf326('0x54'));emit(util[_0xf326('0x13')](_0xf326('0x55'),_0x458e5f[_0xf326('0x36')]),_0xf326('0x56'),{'uri':util[_0xf326('0x13')](_0xf326('0x60'),_0x28c959[_0xf326('0x16')],_0xb1c18c['id'])});break;default:logger[_0xf326('0x57')](_0xf326('0x5c'),_0xf326('0x58'));}}})[_0xf326('0x61')](function(_0x4ca1b8){logger[_0xf326('0x57')]('[OUTBOUND]',JSON[_0xf326('0x62')](_0x4ca1b8));});};exports[_0xf326('0x63')]=function(_0x5e858d,_0x2b770c,_0x5283da,_0x3255b2,_0xd55246,_0x28f3cb){var _0x2d45c9,_0x31b6dd;_0x28f3cb['remoteUri']=intUtil['stripTrailingSlash'](_0x28f3cb[_0xf326('0x16')]);_0x28f3cb[_0xf326('0x43')]=intUtil[_0xf326('0x42')](_0x28f3cb[_0xf326('0x43')]);if(_0xd55246&&_0xd55246[_0xf326('0x44')]){logger['info']('['+_0x2b770c[_0xf326('0x64')][_0xf326('0x65')]()+']','Recording\x20is\x20enabled!');_0x2b770c['recordingURL']=util['format'](_0xf326('0x5d'),_0x28f3cb[_0xf326('0x43')],_0x2b770c[_0xf326('0x48')],md5(_0x2b770c[_0xf326('0x48')]));}else{_0x2b770c[_0xf326('0x47')]='';}headers[_0xf326('0x49')]=getAuth(_0x28f3cb);return getUser(_0x28f3cb)[_0xf326('0xe')](function(_0x4b9013){_0x2d45c9=_0x4b9013;logger[_0xf326('0xb')](_0xf326('0x4b'),_0x2d45c9['id']);return getEndUser(_0x28f3cb,_0x2b770c[_0xf326('0x4c')],_0x2b770c[_0xf326('0x4d')]);})['then'](function(_0x3717fe){_0x31b6dd=_0x3717fe;logger['info']('The\x20Enduser\x20ID\x20is:',_0x31b6dd['id']);return getTicket(_0x28f3cb,_0x2d45c9,_0x31b6dd,_0x5283da,_0x2b770c);})[_0xf326('0xe')](function(_0x540fa0){if(_0x540fa0){logger[_0xf326('0xb')](_0xf326('0x4f'));logger[_0xf326('0xb')](_0xf326('0x50'),_0x540fa0['id']);}})[_0xf326('0x61')](function(_0x541491){logger['error']('['+_0x2b770c['lastevent'][_0xf326('0x65')]()+']',JSON[_0xf326('0x62')](_0x541491));});};
\ No newline at end of file
+var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x2b0a23,_0x20ad34){var _0x125679=function(_0x3dca65){while(--_0x3dca65){_0x2b0a23['push'](_0x2b0a23['shift']());}};_0x125679(++_0x20ad34);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
index bb6a01f..01305c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4af6=['request-promise','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','modernAuthentication','remoteUri','CloudProvider','data7','data2','resolve','data5','POST','username','password','clientSecret','access_token','error','toUpperCase','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','then','value','isNil','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','catch','message','toLowerCase','outbound','destcalleridnum','/systemusers(','Bearer\x20','body','headers','substring','enduserId','calleridnum','telephone1','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','string','type','customField','indexOf','ticketType','incident','assign','getString','/contacts(','Fields','queue','callDirection','phonecalls','Subjects','Descriptions','lastIndexOf','ticketId','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name','lodash'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x4af6,0x193));var _0x64af=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x4af6[_0x178e48];return _0x440d7e;};'use strict';var _=require(_0x64af('0x0'));var rp=require(_0x64af('0x1'));var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x64af('0x2'));var logger=require(_0x64af('0x3'))(_0x64af('0x4'));var config=require(_0x64af('0x5'));config[_0x64af('0x6')]=_[_0x64af('0x7')](config[_0x64af('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x64af('0x6')]));function getAuthToken(_0x131f63,_0x358c58,_0x441e46){if(_0x131f63[_0x64af('0x8')]){_0x131f63[_0x64af('0x9')]=_0x131f63[_0x64af('0xa')][_0x64af('0xb')];_0x131f63['tenantId']=_0x131f63[_0x64af('0xa')][_0x64af('0xc')];return Promise[_0x64af('0xd')](_0x131f63[_0x64af('0xa')][_0x64af('0xe')]);}var _0x581aa3={'method':_0x64af('0xf'),'uri':_0x358c58,'form':{'client_id':_0x131f63['clientId'],'resource':_0x131f63[_0x64af('0x9')],'username':_0x131f63[_0x64af('0x10')],'password':_0x131f63[_0x64af('0x11')],'grant_type':_0x64af('0x11'),'client_secret':_0x131f63[_0x64af('0x12')]},'json':!![]};return rp(_0x581aa3)['then'](function(_0x5e094f){return _0x5e094f[_0x64af('0x13')];})['catch'](function(_0xaf4e55){logger[_0x64af('0x14')]('['+[_0x441e46[_0x64af('0x15')]()]+']\x20Wrong\x20credentials!');return _0xaf4e55['message'];});}function getUser(_0x133f6e,_0x14754c,_0x37f6d7,_0x3a4ef8,_0x4f2e85,_0xa671bf){return new Promise(function(_0x4d1e35,_0x5b7fff){return getAuthToken(_0x14754c,_0x3a4ef8,_0xa671bf)['then'](function(_0xb2a3cc){var _0x430808={'method':'GET','uri':_0x4f2e85+_0x64af('0x16'),'headers':{'Authorization':'Bearer\x20'+_0xb2a3cc,'OData-Version':_0x64af('0x17')},'json':!![]};return rp(_0x430808);})[_0x64af('0x18')](function(_0x3654c1){var _0x2ee2a9=_0x3654c1[_0x64af('0x19')];var _0x441378=![];var _0xa95fa0=null;if(!_[_0x64af('0x1a')](_0x37f6d7)){if(intUtil['validateEmail'](_0x37f6d7[_0x64af('0x1b')])){_0x133f6e[_0x64af('0x1c')]=_0x37f6d7[_0x64af('0x1b')];for(_0xa95fa0=0x0;_0xa95fa0<_0x2ee2a9[_0x64af('0x1d')];_0xa95fa0++){if(_0x2ee2a9[_0xa95fa0][_0x64af('0x1e')]===_0x37f6d7[_0x64af('0x1b')]&&!_0x2ee2a9[_0xa95fa0][_0x64af('0x1f')]){_0x441378=!![];logger[_0x64af('0x20')]('['+[_0xa671bf[_0x64af('0x15')]()]+_0x64af('0x21')+_0x2ee2a9[_0xa95fa0][_0x64af('0x22')]+'!');_0x133f6e[_0x64af('0x23')]=_0x2ee2a9[_0xa95fa0][_0x64af('0x22')];}}}}if(!_0x441378){logger[_0x64af('0x20')]('['+[_0xa671bf[_0x64af('0x15')]()]+_0x64af('0x24'));_0x133f6e[_0x64af('0x1c')]=_0x14754c[_0x64af('0x10')];for(_0xa95fa0=0x0;_0xa95fa0<_0x2ee2a9[_0x64af('0x1d')];_0xa95fa0++){if(_0x2ee2a9[_0xa95fa0][_0x64af('0x1e')]===_0x14754c[_0x64af('0x10')]){_0x133f6e[_0x64af('0x23')]=_0x2ee2a9[_0xa95fa0][_0x64af('0x22')];}}}_0x4d1e35(_0x133f6e);})[_0x64af('0x25')](function(_0x15416f){_0x5b7fff(_0x15416f[_0x64af('0x26')]);});});}function createEndUser(_0x24c48b,_0x579e6d,_0x535372,_0x44942d,_0x2a3119,_0x3fd550,_0x494bd9){return new Promise(function(_0x4d910d,_0x3f4740){return getAuthToken(_0x579e6d,_0x535372,_0x3fd550)[_0x64af('0x18')](function(_0xa97c1f){var _0x23aace=_0x3fd550[_0x64af('0x27')]()===_0x64af('0x28')?_0x2a3119[_0x64af('0x29')]:_0x2a3119['calleridnum'];var _0x58aae4={'method':_0x64af('0xf'),'uri':_0x44942d+'contacts','body':{'fullname':_0x23aace,'firstname':_0x23aace,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x64af('0x2a')+_0x24c48b[_0x64af('0x23')]+')'},'headers':{'Authorization':_0x64af('0x2b')+_0xa97c1f,'OData-Version':_0x64af('0x17')},'json':!![],'resolveWithFullResponse':!![]};_0x58aae4[_0x64af('0x2c')][_0x494bd9]=_0x23aace;return rp(_0x58aae4);})[_0x64af('0x18')](function(_0x39b675){var _0x35bfe1=_0x39b675[_0x64af('0x2d')]['odata-entityid'];var _0x9f4ad=_0x35bfe1[_0x64af('0x2e')](_0x35bfe1['lastIndexOf']('(')+0x1,_0x35bfe1['lastIndexOf'](')'));_0x24c48b[_0x64af('0x2f')]=_0x9f4ad;_0x4d910d(_0x24c48b);})[_0x64af('0x25')](function(_0x48dfe4){_0x3f4740(_0x48dfe4['message']);});});}function getEndUser(_0x233d1f,_0x137791,_0x3755eb,_0x30191a,_0x2b31e2,_0x1e6806,_0x225e92,_0x1135aa){var _0x5e8e79=_0x1e6806[_0x64af('0x27')]()===_0x64af('0x28')?_0x2b31e2['destcalleridnum']:_0x2b31e2[_0x64af('0x30')];return getAuthToken(_0x137791,_0x3755eb,_0x1e6806)[_0x64af('0x18')](function(_0x561b8b){_0x1135aa=_0x1135aa?_0x1135aa:_0x64af('0x31');var _0x2351b4={'method':_0x64af('0x32'),'uri':_0x30191a+_0x64af('0x33')+_0x1135aa+_0x64af('0x34')+_0x1135aa+_0x64af('0x35')+_0x5e8e79[_0x64af('0x36')]('+',_0x64af('0x37'))+'\x27','headers':{'Authorization':_0x64af('0x2b')+_0x561b8b,'If-None-Match':null,'OData-Version':_0x64af('0x17')},'json':!![]};return rp(_0x2351b4);})[_0x64af('0x18')](function(_0x3fa34d){var _0x2aaef5=![];if(!_0x3fa34d)return _0x2aaef5;var _0x832687=_0x3fa34d[_0x64af('0x19')];for(var _0x4b3e11=0x0;_0x4b3e11<_0x832687['length'];_0x4b3e11++){if(_0x832687[_0x4b3e11][_0x1135aa]===_0x5e8e79){_0x2aaef5=!![];_0x233d1f[_0x64af('0x2f')]=_0x832687[_0x4b3e11]['contactid'];}}return _0x2aaef5;})[_0x64af('0x18')](function(_0x29b2cb){if(_0x29b2cb)return _0x233d1f;if(_0x225e92==='nothing'){logger['info']('['+[_0x1e6806['toUpperCase']()]+_0x64af('0x38'));return _0x233d1f;}return createEndUser(_0x233d1f,_0x137791,_0x3755eb,_0x30191a,_0x2b31e2,_0x1e6806,_0x1135aa)['then'](function(_0x47b7be){logger[_0x64af('0x20')]('['+[_0x1e6806[_0x64af('0x15')]()]+_0x64af('0x39'),_0x47b7be['enduserId']);return _0x47b7be;});});}function getCustomFields(_0xb9b5a3,_0x45d388,_0x1f9291){var _0x16a82a={};if(_0xb9b5a3[_0x64af('0x1d')]>0x0){_[_0x64af('0x3a')](_0xb9b5a3,function(_0x58188b){if(_['includes']([_0x64af('0x3b'),'picklist'],_0x58188b[_0x64af('0x3c')])&&_0x58188b['nameField']&&!_0x58188b[_0x64af('0x3d')]){var _0x3deb45=_0x58188b['idField'][_0x64af('0x27')]();var _0x44dbb4=_0x3deb45[_0x64af('0x2e')](0x0,_0x3deb45['indexOf']('_'));var _0x2ac588=_0x3deb45[_0x64af('0x2e')](_0x3deb45[_0x64af('0x3e')]('_')+0x1);if(_0x44dbb4===_0x1f9291){_0x16a82a[_0x2ac588]=_0x58188b['content'];}}});}return _0x16a82a;}function getTicket(_0x1763ae,_0xc0da20,_0x46bbe0,_0x582926,_0x52cfff,_0x57e99b,_0x3de3b5){return new Promise(function(_0x4c6358,_0x4f9943){var _0x1c8ec4;return getAuthToken(_0xc0da20,_0x46bbe0,_0x3de3b5)[_0x64af('0x18')](function(_0x4e06be){if(_0x57e99b[_0x64af('0x3f')]===_0x64af('0x40')){_0x1c8ec4={'method':_0x64af('0xf'),'uri':_0x582926+'incidents','body':Object[_0x64af('0x41')]({},{'title':intUtil[_0x64af('0x42')](_0x57e99b['Subjects'],_0x52cfff,'\x20'),'description':intUtil[_0x64af('0x42')](_0x57e99b['Descriptions'],_0x52cfff,'\x0a'),'customerid_contact@odata.bind':_0x1763ae[_0x64af('0x2f')]?_0x64af('0x43')+_0x1763ae[_0x64af('0x2f')]+')':undefined,'ownerid@odata.bind':_0x64af('0x2a')+_0x1763ae[_0x64af('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x57e99b[_0x64af('0x44')],_0x52cfff,_0x57e99b['ticketType'])),'headers':{'Authorization':_0x64af('0x2b')+_0x4e06be,'OData-Version':_0x64af('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x57e99b[_0x64af('0x3f')]==='phonecall'){var _0x3398ff=_0x1763ae[_0x64af('0x2f')]?[{'partyid_systemuser@odata.bind':_0x64af('0x2a')+_0x1763ae['userId']+')','participationtypemask':_0x1763ae['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x64af('0x43')+_0x1763ae[_0x64af('0x2f')]+')','participationtypemask':_0x1763ae['callDirection']===_0x64af('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x64af('0x2a')+_0x1763ae[_0x64af('0x23')]+')','participationtypemask':_0x1763ae[_0x64af('0x46')]===_0x64af('0x45')?0x2:0x1}];_0x1c8ec4={'method':_0x64af('0xf'),'uri':_0x582926+_0x64af('0x47'),'body':Object[_0x64af('0x41')]({},{'subject':intUtil['getString'](_0x57e99b[_0x64af('0x48')],_0x52cfff,'\x20'),'phonenumber':String(_0x52cfff[_0x64af('0x30')]),'description':intUtil['getString'](_0x57e99b[_0x64af('0x49')],_0x52cfff,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1763ae['enduserId']?_0x64af('0x43')+_0x1763ae[_0x64af('0x2f')]+')':undefined,'ownerid@odata.bind':_0x64af('0x2a')+_0x1763ae['userId']+')','directioncode':_0x1763ae['callDirection']===_0x64af('0x45')?![]:!![],'phonecall_activity_parties':_0x3398ff},getCustomFields(_0x57e99b[_0x64af('0x44')],_0x52cfff,_0x57e99b[_0x64af('0x3f')])),'headers':{'Authorization':_0x64af('0x2b')+_0x4e06be,'OData-Version':_0x64af('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1c8ec4);})[_0x64af('0x18')](function(_0x12b80f){var _0x1f1365=_0x12b80f[_0x64af('0x2d')]['odata-entityid'];var _0x4396e5=_0x1f1365[_0x64af('0x2e')](_0x1f1365[_0x64af('0x4a')]('(')+0x1,_0x1f1365[_0x64af('0x4a')](')'));_0x1763ae[_0x64af('0x4b')]=_0x4396e5;_0x4c6358(_0x1763ae);})['catch'](function(_0x4dff36){_0x4f9943(_0x4dff36[_0x64af('0x26')]);});});}function emit(_0x252f18,_0x26db99,_0x4720e1,_0x3802a4){var _0x2f8bf9={'uri':util['format'](_0x64af('0x4c'),_0x252f18,_0x4720e1,_0x3802a4)};io['to'](util[_0x64af('0x4d')](_0x64af('0x4e'),_0x26db99))[_0x64af('0x4f')](_0x64af('0x50'),_0x2f8bf9);}exports['cs']=function(_0x55aea9,_0x50feda,_0x2f058e,_0x277557,_0x33b26a,_0x40a3df,_0x308e1a,_0x1c0094){var _0x40ffbb={};_0x40a3df[_0x64af('0x9')]=_0x40a3df[_0x64af('0x8')]?intUtil[_0x64af('0x51')](_0x40a3df[_0x64af('0xa')]['data7']):intUtil[_0x64af('0x51')](_0x40a3df[_0x64af('0x9')]);_0x40a3df[_0x64af('0x52')]=intUtil['stripTrailingSlash'](_0x40a3df['serverUrl']);_0x40ffbb[_0x64af('0x46')]=_0x1c0094==='queue'||_0x1c0094==='unmanaged'?'queue':_0x64af('0x28');var _0x439274=_0x40a3df['modernAuthentication']?util['format'](_0x64af('0x53'),_0x40a3df[_0x64af('0xa')][_0x64af('0xb')]):util['format'](_0x64af('0x53'),_0x40a3df[_0x64af('0x9')]);var _0x228eeb=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x40a3df[_0x64af('0x54')]);var _0x4a5fb2=util['format'](_0x64af('0x55'),_0x40a3df[_0x64af('0x52')],_0x50feda[_0x64af('0x56')],md5(_0x50feda[_0x64af('0x56')]));if(_0x33b26a&&_0x33b26a['monitor_format']){logger[_0x64af('0x20')](_0x64af('0x57'),_0x64af('0x58'));_0x50feda[_0x64af('0x59')]=_0x4a5fb2;}else if(_0x308e1a&&_0x308e1a[_0x64af('0x5a')]&&_0x308e1a[_0x64af('0x5a')]!==_0x64af('0x5b')){logger['info'](_0x64af('0x5c'),_0x64af('0x58'));_0x50feda[_0x64af('0x59')]=_0x4a5fb2;}else{_0x50feda['recordingURL']='';}return getUser(_0x40ffbb,_0x40a3df,_0x277557,_0x228eeb,_0x439274,_0x1c0094)[_0x64af('0x18')](function(_0x24ecda){logger['info']('['+_0x1c0094['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x24ecda[_0x64af('0x23')]);logger[_0x64af('0x20')]('['+_0x1c0094['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x24ecda[_0x64af('0x1c')]);return getEndUser(_0x24ecda,_0x40a3df,_0x228eeb,_0x439274,_0x50feda,_0x1c0094,_0x2f058e[_0x64af('0x5d')],_0x2f058e['additionalSearchContact']);})['then'](function(_0x4451e7){logger[_0x64af('0x20')]('['+_0x1c0094['toUpperCase']()+_0x64af('0x5e'),_0x4451e7[_0x64af('0x2f')]);logger[_0x64af('0x20')]('['+_0x1c0094[_0x64af('0x15')]()+_0x64af('0x5f'),_0x50feda[_0x64af('0x30')]);return getTicket(_0x4451e7,_0x40a3df,_0x228eeb,_0x439274,_0x50feda,_0x2f058e,_0x1c0094);})['then'](function(_0x50ebb3){logger['info'](util[_0x64af('0x4d')]('['+_0x1c0094[_0x64af('0x15')]()+_0x64af('0x60'),_0x2f058e[_0x64af('0x3f')],_0x50ebb3[_0x64af('0x4b')]));logger[_0x64af('0x20')](util['format']('['+_0x1c0094['toUpperCase']()+_0x64af('0x61'),_0x1c0094));if(_0x1c0094!==_0x64af('0x62')&&_0x2f058e[_0x64af('0x63')]){logger[_0x64af('0x20')]('['+_0x1c0094[_0x64af('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x40a3df[_0x64af('0x9')],_0x277557[_0x64af('0x64')],_0x2f058e['ticketType'],_0x50ebb3[_0x64af('0x4b')]);}})['catch'](function(_0x1029f0){logger[_0x64af('0x14')]('['+_0x1c0094['toUpperCase']()+']\x20Error\x20running\x20Dynamics365\x20integration',_0x1029f0['message']);console[_0x64af('0x14')]('Error\x20running\x20Dynamics365\x20integration',_0x1029f0);});};
\ No newline at end of file
+var _0xbcba=['odata-entityid','substring','lastIndexOf','toLowerCase','outbound','telephone1','contacts?$select=','\x20eq\x20\x27','%2b','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','includes','string','picklist','nameField','indexOf','ticketType','incident','incidents','getString','Descriptions','enduserId','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','phonecalls','Subjects','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','ticketId','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','modernAuthentication','CloudProvider','data7','tenantId','data2','resolve','data5','POST','remoteUri','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','Bearer\x20','4.0','value','userEmail','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','destcalleridnum','calleridnum','contacts','body','headers'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xbcba,0x177));var _0xabcb=function(_0x48f25d,_0x4d5c7e){_0x48f25d=_0x48f25d-0x0;var _0x1a02fd=_0xbcba[_0x48f25d];return _0x1a02fd;};'use strict';var _=require(_0xabcb('0x0'));var rp=require('request-promise');var util=require(_0xabcb('0x1'));var intUtil=require(_0xabcb('0x2'));var md5=require(_0xabcb('0x3'));var Redis=require(_0xabcb('0x4'));var logger=require(_0xabcb('0x5'))(_0xabcb('0x6'));var config=require('../../../../config/environment');config[_0xabcb('0x7')]=_[_0xabcb('0x8')](config[_0xabcb('0x7')],{'host':_0xabcb('0x9'),'port':0x18eb});var io=require(_0xabcb('0xa'))(new Redis(config[_0xabcb('0x7')]));function getAuthToken(_0x520892,_0x58141b,_0xf5b677){if(_0x520892[_0xabcb('0xb')]){_0x520892['remoteUri']=_0x520892[_0xabcb('0xc')][_0xabcb('0xd')];_0x520892[_0xabcb('0xe')]=_0x520892[_0xabcb('0xc')][_0xabcb('0xf')];return Promise[_0xabcb('0x10')](_0x520892['CloudProvider'][_0xabcb('0x11')]);}var _0x423c7c={'method':_0xabcb('0x12'),'uri':_0x58141b,'form':{'client_id':_0x520892['clientId'],'resource':_0x520892[_0xabcb('0x13')],'username':_0x520892['username'],'password':_0x520892[_0xabcb('0x14')],'grant_type':_0xabcb('0x14'),'client_secret':_0x520892[_0xabcb('0x15')]},'json':!![]};return rp(_0x423c7c)[_0xabcb('0x16')](function(_0x4f298b){return _0x4f298b[_0xabcb('0x17')];})[_0xabcb('0x18')](function(_0x7e939e){logger[_0xabcb('0x19')]('['+[_0xf5b677[_0xabcb('0x1a')]()]+_0xabcb('0x1b'));return _0x7e939e[_0xabcb('0x1c')];});}function getUser(_0x2eba3b,_0x32cfe7,_0x37590b,_0x2ef09d,_0x1709c2,_0x4d8a31){return new Promise(function(_0x4f10d2,_0x42556f){return getAuthToken(_0x32cfe7,_0x2ef09d,_0x4d8a31)[_0xabcb('0x16')](function(_0xa0dccf){var _0x3506d0={'method':_0xabcb('0x1d'),'uri':_0x1709c2+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xabcb('0x1e')+_0xa0dccf,'OData-Version':_0xabcb('0x1f')},'json':!![]};return rp(_0x3506d0);})[_0xabcb('0x16')](function(_0xb9432f){var _0x22edbf=_0xb9432f[_0xabcb('0x20')];var _0x2946db=![];var _0x383006=null;if(!_['isNil'](_0x37590b)){if(intUtil['validateEmail'](_0x37590b['email'])){_0x2eba3b[_0xabcb('0x21')]=_0x37590b[_0xabcb('0x22')];for(_0x383006=0x0;_0x383006<_0x22edbf[_0xabcb('0x23')];_0x383006++){if(_0x22edbf[_0x383006][_0xabcb('0x24')]===_0x37590b[_0xabcb('0x22')]&&!_0x22edbf[_0x383006][_0xabcb('0x25')]){_0x2946db=!![];logger[_0xabcb('0x26')]('['+[_0x4d8a31[_0xabcb('0x1a')]()]+_0xabcb('0x27')+_0x22edbf[_0x383006]['systemuserid']+'!');_0x2eba3b[_0xabcb('0x28')]=_0x22edbf[_0x383006][_0xabcb('0x29')];}}}}if(!_0x2946db){logger[_0xabcb('0x26')]('['+[_0x4d8a31[_0xabcb('0x1a')]()]+_0xabcb('0x2a'));_0x2eba3b[_0xabcb('0x21')]=_0x32cfe7[_0xabcb('0x2b')];for(_0x383006=0x0;_0x383006<_0x22edbf[_0xabcb('0x23')];_0x383006++){if(_0x22edbf[_0x383006][_0xabcb('0x24')]===_0x32cfe7['username']){_0x2eba3b[_0xabcb('0x28')]=_0x22edbf[_0x383006]['systemuserid'];}}}_0x4f10d2(_0x2eba3b);})['catch'](function(_0x36c8f5){_0x42556f(_0x36c8f5[_0xabcb('0x1c')]);});});}function createEndUser(_0xf2a62d,_0x92130,_0x38ff41,_0x59f34b,_0x34d45c,_0x10db80,_0x52fa2d){return new Promise(function(_0x5d9fcd,_0x11535e){return getAuthToken(_0x92130,_0x38ff41,_0x10db80)[_0xabcb('0x16')](function(_0x4c5178){var _0x23c688=_0x10db80['toLowerCase']()==='outbound'?_0x34d45c[_0xabcb('0x2c')]:_0x34d45c[_0xabcb('0x2d')];var _0x47569b={'method':_0xabcb('0x12'),'uri':_0x59f34b+_0xabcb('0x2e'),'body':{'fullname':_0x23c688,'firstname':_0x23c688,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xf2a62d[_0xabcb('0x28')]+')'},'headers':{'Authorization':_0xabcb('0x1e')+_0x4c5178,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x47569b[_0xabcb('0x2f')][_0x52fa2d]=_0x23c688;return rp(_0x47569b);})['then'](function(_0x3ff90b){var _0x58ebb3=_0x3ff90b[_0xabcb('0x30')][_0xabcb('0x31')];var _0xa74ce0=_0x58ebb3[_0xabcb('0x32')](_0x58ebb3[_0xabcb('0x33')]('(')+0x1,_0x58ebb3[_0xabcb('0x33')](')'));_0xf2a62d['enduserId']=_0xa74ce0;_0x5d9fcd(_0xf2a62d);})['catch'](function(_0x13f668){_0x11535e(_0x13f668[_0xabcb('0x1c')]);});});}function getEndUser(_0x21b69a,_0x8d6744,_0x1665a0,_0x4481a9,_0x236ed3,_0xda61c3,_0x320984,_0xba153){var _0x503c1d=_0xda61c3[_0xabcb('0x34')]()===_0xabcb('0x35')?_0x236ed3[_0xabcb('0x2c')]:_0x236ed3[_0xabcb('0x2d')];return getAuthToken(_0x8d6744,_0x1665a0,_0xda61c3)['then'](function(_0x2259cf){_0xba153=_0xba153?_0xba153:_0xabcb('0x36');var _0x3358f4={'method':_0xabcb('0x1d'),'uri':_0x4481a9+_0xabcb('0x37')+_0xba153+'&$filter='+_0xba153+_0xabcb('0x38')+_0x503c1d['replace']('+',_0xabcb('0x39'))+'\x27','headers':{'Authorization':_0xabcb('0x1e')+_0x2259cf,'If-None-Match':null,'OData-Version':_0xabcb('0x1f')},'json':!![]};return rp(_0x3358f4);})[_0xabcb('0x16')](function(_0x1cc744){var _0x39c698=![];if(!_0x1cc744)return _0x39c698;var _0x6eeecb=_0x1cc744[_0xabcb('0x20')];for(var _0x5cdbbe=0x0;_0x5cdbbe<_0x6eeecb[_0xabcb('0x23')];_0x5cdbbe++){if(_0x6eeecb[_0x5cdbbe][_0xba153]===_0x503c1d){_0x39c698=!![];_0x21b69a['enduserId']=_0x6eeecb[_0x5cdbbe]['contactid'];}}return _0x39c698;})['then'](function(_0x579a6a){if(_0x579a6a)return _0x21b69a;if(_0x320984===_0xabcb('0x3a')){logger['info']('['+[_0xda61c3['toUpperCase']()]+_0xabcb('0x3b'));return _0x21b69a;}return createEndUser(_0x21b69a,_0x8d6744,_0x1665a0,_0x4481a9,_0x236ed3,_0xda61c3,_0xba153)[_0xabcb('0x16')](function(_0xaec2b0){logger[_0xabcb('0x26')]('['+[_0xda61c3[_0xabcb('0x1a')]()]+_0xabcb('0x3c'),_0xaec2b0['enduserId']);return _0xaec2b0;});});}function getCustomFields(_0x3787cd,_0x125cc5,_0x9b600f){var _0x34a79e={};if(_0x3787cd[_0xabcb('0x23')]>0x0){_['forEach'](_0x3787cd,function(_0x265846){if(_[_0xabcb('0x3d')]([_0xabcb('0x3e'),_0xabcb('0x3f')],_0x265846['type'])&&_0x265846[_0xabcb('0x40')]&&!_0x265846['customField']){var _0x4b899f=_0x265846['idField'][_0xabcb('0x34')]();var _0x4f8812=_0x4b899f['substring'](0x0,_0x4b899f[_0xabcb('0x41')]('_'));var _0x1f01ab=_0x4b899f['substring'](_0x4b899f[_0xabcb('0x41')]('_')+0x1);if(_0x4f8812===_0x9b600f){_0x34a79e[_0x1f01ab]=_0x265846['content'];}}});}return _0x34a79e;}function getTicket(_0x3cea3b,_0x5c7024,_0x46c1d2,_0x2d8113,_0x595b5e,_0x2091a3,_0x1035f2){return new Promise(function(_0x15d88e,_0x26506f){var _0x269a27;return getAuthToken(_0x5c7024,_0x46c1d2,_0x1035f2)['then'](function(_0x52925c){if(_0x2091a3[_0xabcb('0x42')]===_0xabcb('0x43')){_0x269a27={'method':_0xabcb('0x12'),'uri':_0x2d8113+_0xabcb('0x44'),'body':Object['assign']({},{'title':intUtil[_0xabcb('0x45')](_0x2091a3['Subjects'],_0x595b5e,'\x20'),'description':intUtil[_0xabcb('0x45')](_0x2091a3[_0xabcb('0x46')],_0x595b5e,'\x0a'),'customerid_contact@odata.bind':_0x3cea3b[_0xabcb('0x47')]?_0xabcb('0x48')+_0x3cea3b[_0xabcb('0x47')]+')':undefined,'ownerid@odata.bind':_0xabcb('0x49')+_0x3cea3b[_0xabcb('0x28')]+')','caseorigincode':'1'},getCustomFields(_0x2091a3[_0xabcb('0x4a')],_0x595b5e,_0x2091a3[_0xabcb('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x52925c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2091a3[_0xabcb('0x42')]===_0xabcb('0x4b')){var _0x1521cb=_0x3cea3b[_0xabcb('0x47')]?[{'partyid_systemuser@odata.bind':_0xabcb('0x49')+_0x3cea3b['userId']+')','participationtypemask':_0x3cea3b[_0xabcb('0x4c')]===_0xabcb('0x4d')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x3cea3b[_0xabcb('0x47')]+')','participationtypemask':_0x3cea3b['callDirection']===_0xabcb('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xabcb('0x49')+_0x3cea3b[_0xabcb('0x28')]+')','participationtypemask':_0x3cea3b[_0xabcb('0x4c')]===_0xabcb('0x4d')?0x2:0x1}];_0x269a27={'method':_0xabcb('0x12'),'uri':_0x2d8113+_0xabcb('0x4e'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x2091a3[_0xabcb('0x4f')],_0x595b5e,'\x20'),'phonenumber':String(_0x595b5e[_0xabcb('0x2d')]),'description':intUtil['getString'](_0x2091a3[_0xabcb('0x46')],_0x595b5e,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3cea3b[_0xabcb('0x47')]?_0xabcb('0x48')+_0x3cea3b[_0xabcb('0x47')]+')':undefined,'ownerid@odata.bind':_0xabcb('0x49')+_0x3cea3b[_0xabcb('0x28')]+')','directioncode':_0x3cea3b[_0xabcb('0x4c')]==='queue'?![]:!![],'phonecall_activity_parties':_0x1521cb},getCustomFields(_0x2091a3['Fields'],_0x595b5e,_0x2091a3[_0xabcb('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x52925c,'OData-Version':_0xabcb('0x1f')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x269a27);})['then'](function(_0x2fb735){var _0x8ad8d6=_0x2fb735[_0xabcb('0x30')]['odata-entityid'];var _0x41156e=_0x8ad8d6[_0xabcb('0x32')](_0x8ad8d6[_0xabcb('0x33')]('(')+0x1,_0x8ad8d6[_0xabcb('0x33')](')'));_0x3cea3b['ticketId']=_0x41156e;_0x15d88e(_0x3cea3b);})['catch'](function(_0x1511c6){_0x26506f(_0x1511c6[_0xabcb('0x1c')]);});});}function emit(_0x32fc30,_0x587110,_0x49e3df,_0x575d8e){var _0xe7a591={'uri':util[_0xabcb('0x50')](_0xabcb('0x51'),_0x32fc30,_0x49e3df,_0x575d8e)};io['to'](util[_0xabcb('0x50')](_0xabcb('0x52'),_0x587110))[_0xabcb('0x53')](_0xabcb('0x54'),_0xe7a591);}exports['cs']=function(_0x51a4a1,_0x5ab38c,_0x292b12,_0x371fb3,_0x22192c,_0xebb6e5,_0x384d0e,_0x452d6c){var _0x5a25dc={};_0xebb6e5[_0xabcb('0x13')]=_0xebb6e5[_0xabcb('0xb')]?intUtil[_0xabcb('0x55')](_0xebb6e5[_0xabcb('0xc')][_0xabcb('0xd')]):intUtil['stripTrailingSlash'](_0xebb6e5[_0xabcb('0x13')]);_0xebb6e5[_0xabcb('0x56')]=intUtil['stripTrailingSlash'](_0xebb6e5[_0xabcb('0x56')]);_0x5a25dc[_0xabcb('0x4c')]=_0x452d6c===_0xabcb('0x4d')||_0x452d6c===_0xabcb('0x57')?_0xabcb('0x4d'):_0xabcb('0x35');var _0x577509=_0xebb6e5['modernAuthentication']?util[_0xabcb('0x50')](_0xabcb('0x58'),_0xebb6e5[_0xabcb('0xc')]['data7']):util[_0xabcb('0x50')](_0xabcb('0x58'),_0xebb6e5['remoteUri']);var _0xaf1458=util[_0xabcb('0x50')]('https://login.microsoftonline.com/%s/oauth2/token',_0xebb6e5[_0xabcb('0xe')]);var _0x33a424=util[_0xabcb('0x50')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xebb6e5[_0xabcb('0x56')],_0x5ab38c[_0xabcb('0x59')],md5(_0x5ab38c['uniqueid']));if(_0x22192c&&_0x22192c['monitor_format']){logger[_0xabcb('0x26')](_0xabcb('0x5a'),_0xabcb('0x5b'));_0x5ab38c[_0xabcb('0x5c')]=_0x33a424;}else if(_0x384d0e&&_0x384d0e['recordingFormat']&&_0x384d0e[_0xabcb('0x5d')]!==_0xabcb('0x5e')){logger[_0xabcb('0x26')](_0xabcb('0x5f'),_0xabcb('0x5b'));_0x5ab38c[_0xabcb('0x5c')]=_0x33a424;}else{_0x5ab38c[_0xabcb('0x5c')]='';}return getUser(_0x5a25dc,_0xebb6e5,_0x371fb3,_0xaf1458,_0x577509,_0x452d6c)[_0xabcb('0x16')](function(_0x324150){logger[_0xabcb('0x26')]('['+_0x452d6c[_0xabcb('0x1a')]()+']\x20The\x20User\x20ID\x20is:',_0x324150['userId']);logger[_0xabcb('0x26')]('['+_0x452d6c[_0xabcb('0x1a')]()+']\x20The\x20User\x20email\x20is:',_0x324150['userEmail']);return getEndUser(_0x324150,_0xebb6e5,_0xaf1458,_0x577509,_0x5ab38c,_0x452d6c,_0x292b12[_0xabcb('0x60')],_0x292b12[_0xabcb('0x61')]);})[_0xabcb('0x16')](function(_0x177f93){logger[_0xabcb('0x26')]('['+_0x452d6c[_0xabcb('0x1a')]()+_0xabcb('0x62'),_0x177f93[_0xabcb('0x47')]);logger[_0xabcb('0x26')]('['+_0x452d6c['toUpperCase']()+_0xabcb('0x63'),_0x5ab38c[_0xabcb('0x2d')]);return getTicket(_0x177f93,_0xebb6e5,_0xaf1458,_0x577509,_0x5ab38c,_0x292b12,_0x452d6c);})[_0xabcb('0x16')](function(_0xab2bbe){logger[_0xabcb('0x26')](util[_0xabcb('0x50')]('['+_0x452d6c[_0xabcb('0x1a')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x292b12['ticketType'],_0xab2bbe[_0xabcb('0x64')]));logger[_0xabcb('0x26')](util['format']('['+_0x452d6c[_0xabcb('0x1a')]()+']\x20Call\x20direction:\x20%s',_0x452d6c));if(_0x452d6c!==_0xabcb('0x57')&&_0x292b12[_0xabcb('0x65')]){logger[_0xabcb('0x26')]('['+_0x452d6c['toUpperCase']()+']',_0xabcb('0x66'));emit(_0xebb6e5[_0xabcb('0x13')],_0x371fb3[_0xabcb('0x67')],_0x292b12['ticketType'],_0xab2bbe[_0xabcb('0x64')]);}})['catch'](function(_0xb93369){logger[_0xabcb('0x19')]('['+_0x452d6c[_0xabcb('0x1a')]()+_0xabcb('0x68'),_0xb93369[_0xabcb('0x1c')]);console[_0xabcb('0x19')](_0xabcb('0x69'),_0xb93369);});};
\ No newline at end of file
index c3c1e9e..e457ea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb39=['monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','The\x20Enduser\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','calleridname','stringify','lodash','request-promise','md5','util','ioredis','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridnum','getString','Subjects','<br>','Tags','name','custom_fields','mapValues','keyBy','value','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','toString','base64','debug','[HTTP]','forEach','includes','string','type','nameField','customField','toLowerCase','content','picklist','idField','variable','variableName','push','Variable','queue','serverUrl','stripTrailingSlash'];(function(_0xd007e8,_0x6c14e5){var _0x4d9f9a=function(_0x188f9d){while(--_0x188f9d){_0xd007e8['push'](_0xd007e8['shift']());}};_0x4d9f9a(++_0x6c14e5);}(_0xcb39,0x124));var _0x9cb3=function(_0xa8d40a,_0x174d0f){_0xa8d40a=_0xa8d40a-0x0;var _0x5bd5a6=_0xcb39[_0xa8d40a];return _0x5bd5a6;};'use strict';var _=require(_0x9cb3('0x0'));var rp=require(_0x9cb3('0x1'));var md5=require(_0x9cb3('0x2'));var util=require(_0x9cb3('0x3'));var Redis=require(_0x9cb3('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9cb3('0x5'))(_0x9cb3('0x6'));config[_0x9cb3('0x7')]=_[_0x9cb3('0x8')](config[_0x9cb3('0x7')],{'host':_0x9cb3('0x9'),'port':0x18eb});var io=require(_0x9cb3('0xa'))(new Redis(config[_0x9cb3('0x7')]));var headers={'Content-Type':_0x9cb3('0xb'),'Accept':_0x9cb3('0xb')};function emit(_0x225c3b,_0x143859,_0x41318b){io['to'](_0x225c3b)[_0x9cb3('0xc')](_0x143859,_0x41318b);}function getTicket(_0x209e2f,_0x448d59,_0x52a2a6,_0x3c12c8,_0x72544d){logger[_0x9cb3('0xd')](_0x9cb3('0xe'));var _0x1ce4e4=_[_0x9cb3('0xf')]({'responder_id':_0x448d59['id'],'requester_id':_0x52a2a6['id'],'name':util[_0x9cb3('0x10')]('Caller\x20-\x20%s',_0x72544d['calleridname']),'phone':_0x72544d[_0x9cb3('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x9cb3('0x12')](_0x3c12c8[_0x9cb3('0x13')],_0x72544d,'\x20'),'description':intUtil[_0x9cb3('0x12')](_0x3c12c8['Descriptions'],_0x72544d,_0x9cb3('0x14')),'tags':getTags(_0x3c12c8[_0x9cb3('0x15')],_0x9cb3('0x16'))},getCustomFields(_0x3c12c8['Fields'],_0x72544d));_0x1ce4e4[_0x9cb3('0x17')]=_[_0x9cb3('0x18')](_[_0x9cb3('0x19')](_0x1ce4e4[_0x9cb3('0x17')],'id'),_0x9cb3('0x1a'));return request({'uri':util['format']('%s/api/v2/tickets',_0x209e2f['remoteUri']),'method':'POST','body':_0x1ce4e4})[_0x9cb3('0x1b')](function(_0x1037a8){logger[_0x9cb3('0xd')](_0x9cb3('0x1c'));return _0x1037a8;});}function getUser(_0x4723fe,_0x1fe4e7){if(intUtil['validateEmail'](_0x1fe4e7)){return request({'uri':util['format'](_0x9cb3('0x1d'),_0x4723fe[_0x9cb3('0x1e')]),'qs':{'email':_0x1fe4e7}})[_0x9cb3('0x1b')](function(_0x51dde3){if(_0x51dde3[_0x9cb3('0x1f')]){logger[_0x9cb3('0xd')](_0x9cb3('0x20'));return _[_0x9cb3('0x21')](_0x51dde3,function(_0x2bb75c){return _0x2bb75c[_0x9cb3('0x22')][_0x9cb3('0x23')]===_0x1fe4e7;});}else{logger[_0x9cb3('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x9cb3('0x10')](_0x9cb3('0x24'),_0x4723fe[_0x9cb3('0x1e')])})[_0x9cb3('0x1b')](function(_0x24c8f9){logger[_0x9cb3('0xd')](_0x9cb3('0x25'));return _0x24c8f9;});}});}else{logger[_0x9cb3('0xd')](_0x9cb3('0x26'));return request({'uri':util[_0x9cb3('0x10')]('%s/api/v2/agents/me',_0x4723fe[_0x9cb3('0x1e')])})['then'](function(_0x134a8e){logger['info'](_0x9cb3('0x25'));return _0x134a8e;});}}function getEndUser(_0x11af65,_0x3fe326,_0x140451){logger[_0x9cb3('0xd')](_0x9cb3('0x27'),_0x140451);return request({'uri':util['format']('%s/api/v2/contacts',_0x11af65[_0x9cb3('0x1e')]),'qs':{'phone':_0x140451}})[_0x9cb3('0x1b')](function(_0x4f62d1){if(_0x4f62d1[_0x9cb3('0x1f')]){logger[_0x9cb3('0xd')](_0x9cb3('0x28'));return _[_0x9cb3('0x21')](_0x4f62d1,{'phone':_0x140451});}else{logger['info'](_0x9cb3('0x29'));return request({'uri':util[_0x9cb3('0x10')](_0x9cb3('0x2a'),_0x11af65[_0x9cb3('0x1e')]),'method':'POST','body':{'name':_0x3fe326,'phone':_0x140451}})[_0x9cb3('0x1b')](function(_0xdad1e){logger[_0x9cb3('0xd')]('Enduser\x20created.');return _0xdad1e;});}});}function getAuth(_0x367469){return util[_0x9cb3('0x10')]('Basic\x20%s',new Buffer(_0x367469['apiKey']+':X')[_0x9cb3('0x2b')](_0x9cb3('0x2c')));}function request(_0x1437cc){logger[_0x9cb3('0x2d')](_0x9cb3('0x2e'),JSON['stringify'](_0x1437cc));return rp(_[_0x9cb3('0x8')](_0x1437cc,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5bb13e,_0x2fdd7d){var _0x38475a=[];if(_0x5bb13e&&_0x5bb13e[_0x9cb3('0x1f')]>0x0){_0x38475a=_['map'](_0x5bb13e,_0x2fdd7d);}return _0x38475a;}function getCustomFields(_0x5125ae,_0x125f0e){var _0x22409d=[];var _0x3baeb8={'custom_fields':[]};if(_0x5125ae['length']>0x0){_[_0x9cb3('0x2f')](_0x5125ae,function(_0x4604b3){if(_[_0x9cb3('0x30')]([_0x9cb3('0x31'),'picklist'],_0x4604b3[_0x9cb3('0x32')])&&_0x4604b3[_0x9cb3('0x33')]&&!_0x4604b3[_0x9cb3('0x34')]){_0x3baeb8[_0x4604b3['nameField'][_0x9cb3('0x35')]()]=_0x4604b3[_0x9cb3('0x36')][_0x9cb3('0x2b')]();}else if(_[_0x9cb3('0x30')]([_0x9cb3('0x31'),_0x9cb3('0x37')],_0x4604b3['type'])&&_0x4604b3[_0x9cb3('0x38')]&&_0x4604b3[_0x9cb3('0x34')]){_0x3baeb8['custom_fields']['push']({'id':_0x4604b3[_0x9cb3('0x38')],'value':_0x4604b3[_0x9cb3('0x36')][_0x9cb3('0x2b')]()});}else if(_0x4604b3[_0x9cb3('0x32')]===_0x9cb3('0x39')&&_0x4604b3['variableName']&&_0x4604b3[_0x9cb3('0x38')]&&_0x4604b3[_0x9cb3('0x34')]){_0x125f0e[_0x4604b3[_0x9cb3('0x3a')]]&&_0x3baeb8['custom_fields'][_0x9cb3('0x3b')]({'id':_0x4604b3[_0x9cb3('0x38')],'value':_0x125f0e[_0x4604b3[_0x9cb3('0x3a')]][_0x9cb3('0x2b')]()});}else if(_0x4604b3['type']==='customVariable'&&_0x4604b3[_0x9cb3('0x3c')]&&_0x4604b3[_0x9cb3('0x3c')][_0x9cb3('0x16')]&&_0x4604b3[_0x9cb3('0x38')]&&_0x4604b3[_0x9cb3('0x34')]){_0x125f0e[_0x4604b3[_0x9cb3('0x3c')][_0x9cb3('0x16')][_0x9cb3('0x35')]()]&&_0x3baeb8['custom_fields'][_0x9cb3('0x3b')]({'id':_0x4604b3['idField'],'value':_0x125f0e[_0x4604b3[_0x9cb3('0x3c')][_0x9cb3('0x16')][_0x9cb3('0x35')]()]['toString']()});}});}return _0x3baeb8;}exports[_0x9cb3('0x3d')]=function(_0x4e9435,_0x50a7a1,_0x2110b9,_0x2786c4,_0x572f0f,_0x4a3551){var _0x27e06b,_0xcbe63e;_0x4a3551['remoteUri']=intUtil['stripTrailingSlash'](_0x4a3551['remoteUri']);_0x4a3551[_0x9cb3('0x3e')]=intUtil[_0x9cb3('0x3f')](_0x4a3551[_0x9cb3('0x3e')]);if(_0x572f0f&&_0x572f0f[_0x9cb3('0x40')]){logger[_0x9cb3('0xd')]('[QUEUE]',_0x9cb3('0x41'));_0x50a7a1[_0x9cb3('0x42')]=util[_0x9cb3('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a3551['serverUrl'],_0x50a7a1[_0x9cb3('0x43')],md5(_0x50a7a1[_0x9cb3('0x43')]));}else{_0x50a7a1[_0x9cb3('0x42')]='';}headers[_0x9cb3('0x44')]=getAuth(_0x4a3551);return getUser(_0x4a3551,_0x2786c4['email'])[_0x9cb3('0x1b')](function(_0x5f0bd8){_0x27e06b=_0x5f0bd8;logger[_0x9cb3('0xd')](_0x9cb3('0x45'),_0x27e06b['id']);return getEndUser(_0x4a3551,_0x50a7a1['calleridname'],_0x50a7a1[_0x9cb3('0x11')]);})[_0x9cb3('0x1b')](function(_0x228d02){_0xcbe63e=_0x228d02;logger[_0x9cb3('0xd')]('The\x20Enduser\x20ID\x20is:',_0xcbe63e['id']);return getTicket(_0x4a3551,_0x27e06b,_0xcbe63e,_0x2110b9,_0x50a7a1);})['then'](function(_0x2c1b6d){if(_0x2c1b6d&&_0x2c1b6d['id']){logger[_0x9cb3('0xd')](_0x9cb3('0x1c'));logger['info'](_0x9cb3('0x46'),_0x2c1b6d['id']);logger[_0x9cb3('0xd')](_0x9cb3('0x47'),_0x9cb3('0x48'));emit(util[_0x9cb3('0x10')]('user:%s',_0x2786c4[_0x9cb3('0x16')]),_0x9cb3('0x49'),{'uri':util[_0x9cb3('0x10')](_0x9cb3('0x4a'),_0x4a3551['remoteUri'],_0x2c1b6d['id'])});}})[_0x9cb3('0x4b')](function(_0x2019ee){logger[_0x9cb3('0x4c')](_0x9cb3('0x47'),JSON['stringify'](_0x2019ee));});};exports[_0x9cb3('0x4d')]=function(_0x3848ff,_0x3b4fbc,_0x16b915,_0xbfc261,_0x11091e,_0x3a11b3,_0x41c85c){var _0x22542b,_0x79a164;_0x3a11b3['remoteUri']=intUtil['stripTrailingSlash'](_0x3a11b3['remoteUri']);_0x3a11b3[_0x9cb3('0x3e')]=intUtil[_0x9cb3('0x3f')](_0x3a11b3[_0x9cb3('0x3e')]);if(_0x41c85c&&_0x41c85c[_0x9cb3('0x4e')]&&_0x41c85c['recordingFormat']!=='none'){logger['info'](_0x9cb3('0x4f'),_0x9cb3('0x41'));_0x3b4fbc[_0x9cb3('0x42')]=util[_0x9cb3('0x10')](_0x9cb3('0x50'),_0x3a11b3[_0x9cb3('0x3e')],_0x3b4fbc['uniqueid'],md5(_0x3b4fbc[_0x9cb3('0x43')]));}headers[_0x9cb3('0x44')]=getAuth(_0x3a11b3);return getUser(_0x3a11b3,_0xbfc261['email'])[_0x9cb3('0x1b')](function(_0x2a0b53){_0x22542b=_0x2a0b53;logger[_0x9cb3('0xd')]('The\x20User\x20ID\x20is:',_0x22542b['id']);return getEndUser(_0x3a11b3,_0x3b4fbc[_0x9cb3('0x51')],_0x3b4fbc['destcalleridnum']);})['then'](function(_0x37b4e8){_0x79a164=_0x37b4e8;logger[_0x9cb3('0xd')](_0x9cb3('0x52'),_0x79a164['id']);return getTicket(_0x3a11b3,_0x22542b,_0x79a164,_0x16b915,_0x3b4fbc);})[_0x9cb3('0x1b')](function(_0x4c9451){if(_0x4c9451&&_0x4c9451['id']){logger[_0x9cb3('0xd')](_0x9cb3('0x1c'));logger[_0x9cb3('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4c9451['id']);logger[_0x9cb3('0xd')](_0x9cb3('0x4f'),_0x9cb3('0x48'));emit(util[_0x9cb3('0x10')](_0x9cb3('0x53'),_0xbfc261[_0x9cb3('0x16')]),'trigger:browser:url',{'uri':util['format'](_0x9cb3('0x4a'),_0x3a11b3[_0x9cb3('0x1e')],_0x4c9451['id'])});}})[_0x9cb3('0x4b')](function(_0x4f6200){logger[_0x9cb3('0x4c')](_0x9cb3('0x4f'),JSON['stringify'](_0x4f6200));});};exports[_0x9cb3('0x54')]=function(_0x1782d9,_0x53ac2b,_0x5d6b7b,_0x3910da,_0x301339,_0x4a2a70){var _0x36dcd1,_0x146354;_0x4a2a70['remoteUri']=intUtil[_0x9cb3('0x3f')](_0x4a2a70[_0x9cb3('0x1e')]);_0x4a2a70[_0x9cb3('0x3e')]=intUtil['stripTrailingSlash'](_0x4a2a70[_0x9cb3('0x3e')]);if(_0x301339&&_0x301339['monitor_format']){logger[_0x9cb3('0xd')]('['+_0x53ac2b[_0x9cb3('0x55')][_0x9cb3('0x56')]()+']',_0x9cb3('0x41'));_0x53ac2b[_0x9cb3('0x42')]=util[_0x9cb3('0x10')](_0x9cb3('0x50'),_0x4a2a70[_0x9cb3('0x3e')],_0x53ac2b['uniqueid'],md5(_0x53ac2b[_0x9cb3('0x43')]));}else{_0x53ac2b[_0x9cb3('0x42')]='';}headers[_0x9cb3('0x44')]=getAuth(_0x4a2a70);return getUser(_0x4a2a70,'')[_0x9cb3('0x1b')](function(_0x489236){_0x36dcd1=_0x489236;logger[_0x9cb3('0xd')](_0x9cb3('0x45'),_0x36dcd1['id']);return getEndUser(_0x4a2a70,_0x53ac2b[_0x9cb3('0x57')],_0x53ac2b[_0x9cb3('0x11')]);})[_0x9cb3('0x1b')](function(_0x4a2c50){_0x146354=_0x4a2c50;logger[_0x9cb3('0xd')](_0x9cb3('0x52'),_0x146354['id']);return getTicket(_0x4a2a70,_0x36dcd1,_0x146354,_0x5d6b7b,_0x53ac2b);})[_0x9cb3('0x1b')](function(_0x3a5bad){if(_0x3a5bad){logger[_0x9cb3('0xd')](_0x9cb3('0x1c'));logger[_0x9cb3('0xd')](_0x9cb3('0x46'),_0x3a5bad['id']);}})[_0x9cb3('0x4b')](function(_0x3ca45b){logger[_0x9cb3('0x4c')]('['+_0x53ac2b['lastevent']['toUpperCase']()+']',JSON[_0x9cb3('0x58')](_0x3ca45b));});};
\ No newline at end of file
+var _0xa044=['toString','base64','[HTTP]','stringify','GET','map','includes','picklist','nameField','content','string','customField','push','variable','variableName','idField','type','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','request-promise','md5','util','ioredis','./util','redis','defaults','localhost','application/json','emit','info','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','format','%s/api/v2/agents','then','length','find','contact','email','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey'];(function(_0x4ad6e4,_0x103161){var _0x11e62a=function(_0x10dc1e){while(--_0x10dc1e){_0x4ad6e4['push'](_0x4ad6e4['shift']());}};_0x11e62a(++_0x103161);}(_0xa044,0x1da));var _0x4a04=function(_0x19b5a0,_0x22be6a){_0x19b5a0=_0x19b5a0-0x0;var _0x3535d4=_0xa044[_0x19b5a0];return _0x3535d4;};'use strict';var _=require('lodash');var rp=require(_0x4a04('0x0'));var md5=require(_0x4a04('0x1'));var util=require(_0x4a04('0x2'));var Redis=require(_0x4a04('0x3'));var intUtil=require(_0x4a04('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('freshdesk');config[_0x4a04('0x5')]=_[_0x4a04('0x6')](config['redis'],{'host':_0x4a04('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a04('0x5')]));var headers={'Content-Type':_0x4a04('0x8'),'Accept':_0x4a04('0x8')};function emit(_0x5251e8,_0x2931db,_0x37270a){io['to'](_0x5251e8)[_0x4a04('0x9')](_0x2931db,_0x37270a);}function getTicket(_0x56d1b6,_0x4b15f7,_0x27269d,_0x2b4762,_0x1c2c7a){logger[_0x4a04('0xa')]('Creating\x20new\x20ticket...');var _0x1647bf=_[_0x4a04('0xb')]({'responder_id':_0x4b15f7['id'],'requester_id':_0x27269d['id'],'name':util['format'](_0x4a04('0xc'),_0x1c2c7a[_0x4a04('0xd')]),'phone':_0x1c2c7a['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4a04('0xe')](_0x2b4762[_0x4a04('0xf')],_0x1c2c7a,'\x20'),'description':intUtil['getString'](_0x2b4762[_0x4a04('0x10')],_0x1c2c7a,'<br>'),'tags':getTags(_0x2b4762[_0x4a04('0x11')],_0x4a04('0x12'))},getCustomFields(_0x2b4762[_0x4a04('0x13')],_0x1c2c7a));_0x1647bf['custom_fields']=_[_0x4a04('0x14')](_[_0x4a04('0x15')](_0x1647bf[_0x4a04('0x16')],'id'),_0x4a04('0x17'));return request({'uri':util['format'](_0x4a04('0x18'),_0x56d1b6['remoteUri']),'method':_0x4a04('0x19'),'body':_0x1647bf})['then'](function(_0x435798){logger[_0x4a04('0xa')](_0x4a04('0x1a'));return _0x435798;});}function getUser(_0x50688d,_0x33c3f7){if(intUtil[_0x4a04('0x1b')](_0x33c3f7)){return request({'uri':util[_0x4a04('0x1c')](_0x4a04('0x1d'),_0x50688d['remoteUri']),'qs':{'email':_0x33c3f7}})[_0x4a04('0x1e')](function(_0xa9df7){if(_0xa9df7[_0x4a04('0x1f')]){logger[_0x4a04('0xa')]('Agent\x20found!');return _[_0x4a04('0x20')](_0xa9df7,function(_0x5d1dd0){return _0x5d1dd0[_0x4a04('0x21')][_0x4a04('0x22')]===_0x33c3f7;});}else{logger[_0x4a04('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4a04('0x1c')]('%s/api/v2/agents/me',_0x50688d['remoteUri'])})[_0x4a04('0x1e')](function(_0x37369a){logger[_0x4a04('0xa')]('Admin\x20account\x20selected.');return _0x37369a;});}});}else{logger[_0x4a04('0xa')](_0x4a04('0x23'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x50688d[_0x4a04('0x24')])})[_0x4a04('0x1e')](function(_0x28af7d){logger[_0x4a04('0xa')]('Admin\x20account\x20selected.');return _0x28af7d;});}}function getEndUser(_0x3f75ab,_0x2eb726,_0xc584c8){logger['info']('Searching\x20enduser\x20with\x20phone',_0xc584c8);return request({'uri':util[_0x4a04('0x1c')]('%s/api/v2/contacts',_0x3f75ab['remoteUri']),'qs':{'phone':_0xc584c8}})[_0x4a04('0x1e')](function(_0x37ef2b){if(_0x37ef2b[_0x4a04('0x1f')]){logger[_0x4a04('0xa')](_0x4a04('0x25'));return _[_0x4a04('0x20')](_0x37ef2b,{'phone':_0xc584c8});}else{logger[_0x4a04('0xa')](_0x4a04('0x26'));return request({'uri':util[_0x4a04('0x1c')]('%s/api/v2/contacts',_0x3f75ab[_0x4a04('0x24')]),'method':_0x4a04('0x19'),'body':{'name':_0x2eb726,'phone':_0xc584c8}})[_0x4a04('0x1e')](function(_0x26d45b){logger[_0x4a04('0xa')](_0x4a04('0x27'));return _0x26d45b;});}});}function getAuth(_0x210207){return util[_0x4a04('0x1c')](_0x4a04('0x28'),new Buffer(_0x210207[_0x4a04('0x29')]+':X')[_0x4a04('0x2a')](_0x4a04('0x2b')));}function request(_0x1a100d){logger['debug'](_0x4a04('0x2c'),JSON[_0x4a04('0x2d')](_0x1a100d));return rp(_['defaults'](_0x1a100d,{'method':_0x4a04('0x2e'),'headers':headers,'json':!![]}));}function getTags(_0x3f5c41,_0x4c0e39){var _0x2d1152=[];if(_0x3f5c41&&_0x3f5c41[_0x4a04('0x1f')]>0x0){_0x2d1152=_[_0x4a04('0x2f')](_0x3f5c41,_0x4c0e39);}return _0x2d1152;}function getCustomFields(_0x2692f4,_0x255d74){var _0x109426=[];var _0x1ff1bf={'custom_fields':[]};if(_0x2692f4[_0x4a04('0x1f')]>0x0){_['forEach'](_0x2692f4,function(_0x5443b5){if(_[_0x4a04('0x30')](['string',_0x4a04('0x31')],_0x5443b5['type'])&&_0x5443b5[_0x4a04('0x32')]&&!_0x5443b5['customField']){_0x1ff1bf[_0x5443b5[_0x4a04('0x32')]['toLowerCase']()]=_0x5443b5[_0x4a04('0x33')]['toString']();}else if(_['includes']([_0x4a04('0x34'),'picklist'],_0x5443b5['type'])&&_0x5443b5['idField']&&_0x5443b5[_0x4a04('0x35')]){_0x1ff1bf[_0x4a04('0x16')][_0x4a04('0x36')]({'id':_0x5443b5['idField'],'value':_0x5443b5[_0x4a04('0x33')]['toString']()});}else if(_0x5443b5['type']===_0x4a04('0x37')&&_0x5443b5[_0x4a04('0x38')]&&_0x5443b5['idField']&&_0x5443b5['customField']){_0x255d74[_0x5443b5[_0x4a04('0x38')]]&&_0x1ff1bf[_0x4a04('0x16')]['push']({'id':_0x5443b5[_0x4a04('0x39')],'value':_0x255d74[_0x5443b5[_0x4a04('0x38')]][_0x4a04('0x2a')]()});}else if(_0x5443b5[_0x4a04('0x3a')]==='customVariable'&&_0x5443b5[_0x4a04('0x3b')]&&_0x5443b5[_0x4a04('0x3b')]['name']&&_0x5443b5[_0x4a04('0x39')]&&_0x5443b5[_0x4a04('0x35')]){_0x255d74[_0x5443b5[_0x4a04('0x3b')][_0x4a04('0x12')][_0x4a04('0x3c')]()]&&_0x1ff1bf[_0x4a04('0x16')][_0x4a04('0x36')]({'id':_0x5443b5[_0x4a04('0x39')],'value':_0x255d74[_0x5443b5[_0x4a04('0x3b')][_0x4a04('0x12')]['toLowerCase']()][_0x4a04('0x2a')]()});}});}return _0x1ff1bf;}exports['queue']=function(_0x591d10,_0x3c8f90,_0x324b19,_0x394e98,_0x29055e,_0x5631e4){var _0x244e25,_0x55a55c;_0x5631e4[_0x4a04('0x24')]=intUtil[_0x4a04('0x3d')](_0x5631e4[_0x4a04('0x24')]);_0x5631e4[_0x4a04('0x3e')]=intUtil[_0x4a04('0x3d')](_0x5631e4[_0x4a04('0x3e')]);if(_0x29055e&&_0x29055e[_0x4a04('0x3f')]){logger[_0x4a04('0xa')](_0x4a04('0x40'),_0x4a04('0x41'));_0x3c8f90[_0x4a04('0x42')]=util[_0x4a04('0x1c')](_0x4a04('0x43'),_0x5631e4['serverUrl'],_0x3c8f90[_0x4a04('0x44')],md5(_0x3c8f90['uniqueid']));}else{_0x3c8f90[_0x4a04('0x42')]='';}headers['Authorization']=getAuth(_0x5631e4);return getUser(_0x5631e4,_0x394e98[_0x4a04('0x22')])['then'](function(_0x20afa0){_0x244e25=_0x20afa0;logger[_0x4a04('0xa')](_0x4a04('0x45'),_0x244e25['id']);return getEndUser(_0x5631e4,_0x3c8f90['calleridname'],_0x3c8f90[_0x4a04('0x46')]);})[_0x4a04('0x1e')](function(_0x165765){_0x55a55c=_0x165765;logger['info']('The\x20Enduser\x20ID\x20is:',_0x55a55c['id']);return getTicket(_0x5631e4,_0x244e25,_0x55a55c,_0x324b19,_0x3c8f90);})['then'](function(_0x15ebae){if(_0x15ebae&&_0x15ebae['id']){logger[_0x4a04('0xa')](_0x4a04('0x1a'));logger[_0x4a04('0xa')](_0x4a04('0x47'),_0x15ebae['id']);logger[_0x4a04('0xa')](_0x4a04('0x40'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x4a04('0x1c')](_0x4a04('0x48'),_0x394e98[_0x4a04('0x12')]),_0x4a04('0x49'),{'uri':util[_0x4a04('0x1c')](_0x4a04('0x4a'),_0x5631e4[_0x4a04('0x24')],_0x15ebae['id'])});}})['catch'](function(_0x42250){logger[_0x4a04('0x4b')](_0x4a04('0x40'),JSON[_0x4a04('0x2d')](_0x42250));});};exports['outbound']=function(_0x88405d,_0x252111,_0x47312b,_0x4c50ab,_0x13dd22,_0x1f441a,_0x2ce95a){var _0xdf5052,_0x1fea34;_0x1f441a[_0x4a04('0x24')]=intUtil[_0x4a04('0x3d')](_0x1f441a['remoteUri']);_0x1f441a['serverUrl']=intUtil[_0x4a04('0x3d')](_0x1f441a[_0x4a04('0x3e')]);if(_0x2ce95a&&_0x2ce95a[_0x4a04('0x4c')]&&_0x2ce95a[_0x4a04('0x4c')]!=='none'){logger['info'](_0x4a04('0x4d'),_0x4a04('0x41'));_0x252111['recordingURL']=util[_0x4a04('0x1c')](_0x4a04('0x43'),_0x1f441a['serverUrl'],_0x252111[_0x4a04('0x44')],md5(_0x252111[_0x4a04('0x44')]));}headers[_0x4a04('0x4e')]=getAuth(_0x1f441a);return getUser(_0x1f441a,_0x4c50ab['email'])[_0x4a04('0x1e')](function(_0xa4112d){_0xdf5052=_0xa4112d;logger[_0x4a04('0xa')](_0x4a04('0x45'),_0xdf5052['id']);return getEndUser(_0x1f441a,_0x252111[_0x4a04('0x4f')],_0x252111['destcalleridnum']);})['then'](function(_0x1906b5){_0x1fea34=_0x1906b5;logger['info'](_0x4a04('0x50'),_0x1fea34['id']);return getTicket(_0x1f441a,_0xdf5052,_0x1fea34,_0x47312b,_0x252111);})[_0x4a04('0x1e')](function(_0xa8d04d){if(_0xa8d04d&&_0xa8d04d['id']){logger['info'](_0x4a04('0x1a'));logger[_0x4a04('0xa')]('The\x20Ticket\x20ID\x20is:',_0xa8d04d['id']);logger[_0x4a04('0xa')](_0x4a04('0x4d'),_0x4a04('0x51'));emit(util[_0x4a04('0x1c')](_0x4a04('0x48'),_0x4c50ab[_0x4a04('0x12')]),'trigger:browser:url',{'uri':util[_0x4a04('0x1c')](_0x4a04('0x4a'),_0x1f441a[_0x4a04('0x24')],_0xa8d04d['id'])});}})[_0x4a04('0x52')](function(_0x1a1981){logger[_0x4a04('0x4b')](_0x4a04('0x4d'),JSON[_0x4a04('0x2d')](_0x1a1981));});};exports[_0x4a04('0x53')]=function(_0x308de7,_0x6ac244,_0x109642,_0x3edbe7,_0x24401e,_0x5b7445){var _0x232985,_0x2b96d0;_0x5b7445[_0x4a04('0x24')]=intUtil[_0x4a04('0x3d')](_0x5b7445['remoteUri']);_0x5b7445[_0x4a04('0x3e')]=intUtil[_0x4a04('0x3d')](_0x5b7445[_0x4a04('0x3e')]);if(_0x24401e&&_0x24401e[_0x4a04('0x3f')]){logger[_0x4a04('0xa')]('['+_0x6ac244[_0x4a04('0x54')][_0x4a04('0x55')]()+']','Recording\x20is\x20enabled!');_0x6ac244[_0x4a04('0x42')]=util['format'](_0x4a04('0x43'),_0x5b7445['serverUrl'],_0x6ac244['uniqueid'],md5(_0x6ac244['uniqueid']));}else{_0x6ac244['recordingURL']='';}headers[_0x4a04('0x4e')]=getAuth(_0x5b7445);return getUser(_0x5b7445,'')[_0x4a04('0x1e')](function(_0x2be9ed){_0x232985=_0x2be9ed;logger['info'](_0x4a04('0x45'),_0x232985['id']);return getEndUser(_0x5b7445,_0x6ac244[_0x4a04('0xd')],_0x6ac244[_0x4a04('0x46')]);})[_0x4a04('0x1e')](function(_0x54ba71){_0x2b96d0=_0x54ba71;logger[_0x4a04('0xa')](_0x4a04('0x50'),_0x2b96d0['id']);return getTicket(_0x5b7445,_0x232985,_0x2b96d0,_0x109642,_0x6ac244);})[_0x4a04('0x1e')](function(_0x6aacf0){if(_0x6aacf0){logger['info'](_0x4a04('0x1a'));logger['info'](_0x4a04('0x47'),_0x6aacf0['id']);}})['catch'](function(_0x2cee1a){logger[_0x4a04('0x4b')]('['+_0x6ac244[_0x4a04('0x54')][_0x4a04('0x55')]()+']',JSON['stringify'](_0x2cee1a));});};
\ No newline at end of file
index c9486b9..a996dc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf93b=['stripTrailingSlash','serverUrl','username','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','inspect','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','GET','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','find','contacts','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Contact','ticketId','task','user:%s','emit','trigger:browser:url','apiKey','remoteUri'];(function(_0x28bfbc,_0x2335b1){var _0x1b36df=function(_0x3a0536){while(--_0x3a0536){_0x28bfbc['push'](_0x28bfbc['shift']());}};_0x1b36df(++_0x2335b1);}(_0xf93b,0xb5));var _0xbf93=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0xf93b[_0x389832];return _0x59429e;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0xbf93('0x0'));var util=require(_0xbf93('0x1'));var moment=require(_0xbf93('0x2'));var Promise=require(_0xbf93('0x3'));var Redis=require(_0xbf93('0x4'));var intUtil=require(_0xbf93('0x5'));var config=require(_0xbf93('0x6'));var logger=require(_0xbf93('0x7'))('freshsales');config[_0xbf93('0x8')]=_['defaults'](config[_0xbf93('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xbf93('0x9'))(new Redis(config[_0xbf93('0x8')]));function getAdminId(_0x8e4186,_0xf1fbca,_0x370203,_0x50c08c){return new Promise(function(_0x478e81,_0x2f1e7a){var _0x1eece6=![];var _0x58296b={'method':'GET','uri':_0x50c08c+_0xbf93('0xa'),'json':!![]};_0x58296b[_0xbf93('0xb')]=_0x370203;logger[_0xbf93('0xc')](_0xbf93('0xd'));return rp(_0x58296b)[_0xbf93('0xe')](function(_0xc7a52e){if(_0xc7a52e){var _0x5571a7=_0xc7a52e[_0xbf93('0xf')];var _0x15662f=null;for(_0x15662f=0x0;_0x15662f<_0x5571a7[_0xbf93('0x10')];_0x15662f++){if(_0x5571a7[_0x15662f][_0xbf93('0x11')]===_0x8e4186[_0xbf93('0x12')]){_0x8e4186[_0xbf93('0x13')]=_0x5571a7[_0x15662f]['id'];_0x1eece6=!![];}}if(_0x1eece6){logger[_0xbf93('0xc')](_0xbf93('0x14'),_0x8e4186[_0xbf93('0x13')]);_0x478e81(_0x8e4186);}else{_0x2f1e7a({'statusCode':0x194,'message':_0xbf93('0x15')});}}else{_0x2f1e7a({'statusCode':0x194,'message':_0xbf93('0x15')});}})[_0xbf93('0x16')](function(_0x29bea0){logger['error']('['+[_0xf1fbca[_0xbf93('0x17')]()]+']',_0x29bea0[_0xbf93('0x18')]);_0x2f1e7a(_0x29bea0);});});}function getUser(_0x89ae0f,_0x1962df,_0x3d3097){return function(_0x245418){return new Promise(function(_0x5e3b8d,_0x51127f){var _0x33bc8c={'method':_0xbf93('0x19'),'uri':_0x3d3097+_0xbf93('0xa'),'json':!![]};_0x33bc8c[_0xbf93('0xb')]=_0x1962df;logger[_0xbf93('0xc')](_0xbf93('0x1a'));return rp(_0x33bc8c)[_0xbf93('0xe')](function(_0x5c9469){if(_0x5c9469){var _0x1c7fdc=_0x5c9469['users'];var _0x3f1d68=![];var _0x3998f5=null;if(_0x245418[_0xbf93('0x1b')]!==null){logger['info'](_0xbf93('0x1c'),_0x245418[_0xbf93('0x1b')]);_0x245418[_0xbf93('0x1d')]=_0x245418[_0xbf93('0x1b')];for(_0x3998f5=0x0;_0x3998f5<_0x1c7fdc[_0xbf93('0x10')];_0x3998f5++){if(_0x1c7fdc[_0x3998f5]['email']===_0x245418[_0xbf93('0x1b')]){_0x3f1d68=!![];_0x245418[_0xbf93('0x1e')]=_0x1c7fdc[_0x3998f5]['id'];logger[_0xbf93('0xc')](_0xbf93('0x1f'),_0x245418['userId']);}}}if(!_0x3f1d68){logger[_0xbf93('0xc')](_0xbf93('0x20'));_0x245418[_0xbf93('0x1d')]=_0x245418[_0xbf93('0x12')];_0x245418[_0xbf93('0x1e')]=_0x245418[_0xbf93('0x13')];_0x3f1d68=!![];}if(_0x3f1d68){_0x5e3b8d(_0x245418);}else{_0x51127f({'statusCode':0x194,'message':_0xbf93('0x15')});}}else{_0x51127f({'statusCode':0x194,'message':_0xbf93('0x15')});}})[_0xbf93('0x16')](function(_0x25f324){logger[_0xbf93('0x21')]('['+[_0x89ae0f[_0xbf93('0x17')]()]+']',_0x25f324['message']);_0x51127f(_0x25f324);});});};}function searchContact(_0x3430f5,_0x2dfe87,_0x2380d6,_0x25a562){return new Promise(function(_0x3b56d2,_0x174239){var _0x29c523={'method':'GET','headers':_0x2dfe87,'uri':_0x3430f5+_0xbf93('0x22')+_0x25a562+_0xbf93('0x23')+_0x2380d6+'&entities=contact','json':!![]};rp(_0x29c523)[_0xbf93('0xe')](function(_0x4bc67b){var _0x468e1b=_[_0xbf93('0x24')](_0x4bc67b[_0xbf93('0x25')][_0xbf93('0x25')],[_0x2380d6,_0x25a562]);_0x3b56d2(_0x468e1b);})['catch'](function(_0x2b0482){_0x174239(_0x2b0482);});});}function getEndUser(_0x3af9ba,_0x4e2ecc,_0x20f102){return function(_0x2025e1){return new Promise(function(_0x72185d,_0x1066f9){logger['info'](util['format']('Searching\x20contact\x20with\x20phone\x20%s',_0x2025e1[_0xbf93('0x26')]));searchContact(_0x20f102,_0x4e2ecc,_0xbf93('0x27'),_0x2025e1[_0xbf93('0x26')])[_0xbf93('0xe')](function(_0x58b73c){if(_0x58b73c){_0x2025e1[_0xbf93('0x28')]=_0x58b73c['id'];logger['info'](_0xbf93('0x29'),_0x2025e1[_0xbf93('0x28')]);return _0x72185d(_0x2025e1);}searchContact(_0x20f102,_0x4e2ecc,'work_number',_0x2025e1[_0xbf93('0x26')])[_0xbf93('0xe')](function(_0x2fa84e){if(_0x2fa84e){_0x2025e1[_0xbf93('0x28')]=_0x2fa84e['id'];logger[_0xbf93('0xc')]('Contact\x20found\x20work_number:',_0x2025e1[_0xbf93('0x28')]);return _0x72185d(_0x2025e1);}createEndUser(_0x2025e1,_0x3af9ba,_0x4e2ecc,_0x20f102)['then'](function(_0x337989){logger[_0xbf93('0xc')]('Contact\x20created:',_0x337989[_0xbf93('0x28')]);return _0x72185d(_0x337989);});});})[_0xbf93('0x16')](function(_0x26bad2){_0x1066f9(_0x26bad2);});});};}function createEndUser(_0x504ed1,_0x28f979,_0x5e7d6e,_0x5188ac){return new Promise(function(_0x5a6630,_0x54af96){var _0x54220d=moment();var _0x515765={'method':_0xbf93('0x2a'),'uri':_0x5188ac+_0xbf93('0x2b'),'body':{'contact':{'last_name':_0x504ed1['contactNumber'],'work_number':_0x504ed1[_0xbf93('0x26')],'mobile_number':_0x504ed1[_0xbf93('0x26')],'owner_id':_0x504ed1[_0xbf93('0x1e')],'created_at':_0x54220d[_0xbf93('0x2c')](_0xbf93('0x2d'))}},'json':!![]};_0x515765['headers']=_0x5e7d6e;logger[_0xbf93('0xc')](_0xbf93('0x2e'));return rp(_0x515765)['then'](function(_0x9413){_0x504ed1[_0xbf93('0x28')]=_0x9413[_0xbf93('0x2f')]['id'];_0x5a6630(_0x504ed1);})[_0xbf93('0x16')](function(_0x8b90c2){logger[_0xbf93('0x21')]('['+[_0x28f979['toUpperCase']()]+']',_0x8b90c2[_0xbf93('0x18')]);_0x54af96(_0x8b90c2['message']);});});}function getTicket(_0x28c610,_0x333439,_0x2dc2f5,_0x1e3379,_0x5cb991){return function(_0x8b6345){logger[_0xbf93('0xc')](_0xbf93('0x30'));return new Promise(function(_0x179145,_0x299527){var _0x10f095=moment();var _0x46f652={'method':_0xbf93('0x2a'),'uri':_0x2dc2f5+'/api/tasks','body':{'title':intUtil[_0xbf93('0x31')](_0x1e3379[_0xbf93('0x32')],_0x5cb991,'\x20'),'description':intUtil[_0xbf93('0x31')](_0x1e3379['Descriptions'],_0x5cb991,'\x0a'),'owner_id':_0x8b6345[_0xbf93('0x1e')],'creater_id':_0x8b6345[_0xbf93('0x13')],'targetable_id':_0x8b6345[_0xbf93('0x28')],'targetable_type':_0xbf93('0x33'),'created_at':_0x10f095['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x10f095['add'](0x1e,'m')[_0xbf93('0x2c')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x46f652[_0xbf93('0xb')]=_0x333439;return rp(_0x46f652)[_0xbf93('0xe')](function(_0x31ed09){_0x8b6345[_0xbf93('0x34')]=_0x31ed09[_0xbf93('0x35')]['id'];logger['info']('Task\x20created:',_0x8b6345[_0xbf93('0x34')]);_0x179145(_0x8b6345);})[_0xbf93('0x16')](function(_0x56de11){logger['error']('['+[_0x28c610[_0xbf93('0x17')]()]+']',_0x56de11[_0xbf93('0x18')]);_0x299527(_0x56de11[_0xbf93('0x18')]);});});};}function emit(_0x2a3f70,_0x5eda80,_0x2e0c18){var _0xbf1cf7={'uri':_0x2a3f70+'/contacts/'+_0x2e0c18};io['to'](util[_0xbf93('0x2c')](_0xbf93('0x36'),_0x5eda80))[_0xbf93('0x37')](_0xbf93('0x38'),_0xbf1cf7);}exports['cs']=function(_0x40886b,_0x2bdba9,_0x263285,_0x39393d,_0x4d8163,_0x32cb73,_0x461a4b,_0x43c31a){var _0x2ca2d7={};var _0x271f4c={'Authorization':'Token\x20token='+_0x32cb73[_0xbf93('0x39')]};_0x32cb73[_0xbf93('0x3a')]=intUtil[_0xbf93('0x3b')](_0x32cb73[_0xbf93('0x3a')]);_0x32cb73[_0xbf93('0x3c')]=intUtil['stripTrailingSlash'](_0x32cb73[_0xbf93('0x3c')]);var _0x21581a=_0x32cb73[_0xbf93('0x3a')];_0x2ca2d7[_0xbf93('0x12')]=_0x32cb73[_0xbf93('0x3d')];_0x2ca2d7['contactNumber']=_0x43c31a['toLowerCase']()==='outbound'?_0x2bdba9[_0xbf93('0x3e')]:_0x2bdba9[_0xbf93('0x3f')];_0x2ca2d7[_0xbf93('0x40')]=_0x43c31a==='queue'||_0x43c31a===_0xbf93('0x41')?'queue':_0xbf93('0x42');if(_0x39393d){_0x2ca2d7['agentEmail']=_0x39393d[_0xbf93('0x11')];}var _0x55e9c2=util[_0xbf93('0x2c')](_0xbf93('0x43'),_0x32cb73[_0xbf93('0x3c')],_0x2bdba9[_0xbf93('0x44')],md5(_0x2bdba9['uniqueid']));if(_0x4d8163&&_0x4d8163[_0xbf93('0x45')]){logger[_0xbf93('0xc')](_0xbf93('0x46'),_0xbf93('0x47'));_0x2bdba9[_0xbf93('0x48')]=_0x55e9c2;}else if(_0x461a4b&&_0x461a4b[_0xbf93('0x49')]&&_0x461a4b[_0xbf93('0x49')]!==_0xbf93('0x4a')){logger[_0xbf93('0xc')](_0xbf93('0x4b'),'Recording\x20is\x20enabled!');_0x2bdba9[_0xbf93('0x48')]=_0x55e9c2;}else{_0x2bdba9[_0xbf93('0x48')]='';}return getAdminId(_0x2ca2d7,_0x43c31a,_0x271f4c,_0x21581a)['then'](getUser(_0x43c31a,_0x271f4c,_0x21581a))[_0xbf93('0xe')](getEndUser(_0x43c31a,_0x271f4c,_0x21581a))[_0xbf93('0xe')](getTicket(_0x43c31a,_0x271f4c,_0x21581a,_0x263285,_0x2bdba9))[_0xbf93('0xe')](function(_0x1e1936){logger['info'](util[_0xbf93('0x2c')](_0xbf93('0x4c'),_0x1e1936[_0xbf93('0x34')]));if(_0x43c31a!==_0xbf93('0x41')){logger[_0xbf93('0xc')]('['+[_0x43c31a[_0xbf93('0x17')]()]+']',_0xbf93('0x4d'));emit(_0x21581a,_0x39393d[_0xbf93('0x4e')],_0x1e1936[_0xbf93('0x28')]);}})[_0xbf93('0x16')](function(_0x2f80c7){logger[_0xbf93('0x21')]('['+[_0x43c31a[_0xbf93('0x17')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0xbf93('0x4f')](_0x2f80c7,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x212f=['emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','toLowerCase','outbound','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','bluebird','ioredis','../../../../config/logger','freshsales','socket.io-emitter','redis','headers','info','Getting\x20admin\x20information','then','users','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','/api/selector/owners','agentEmail','userEmail','userId','User\x20found:','adminEmail','/api/lookup?q=','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Descriptions','add','ticketId','task','Task\x20created:','toUpperCase','user:%s'];(function(_0x57c735,_0x1cac72){var _0x51746e=function(_0x21aa9a){while(--_0x21aa9a){_0x57c735['push'](_0x57c735['shift']());}};_0x51746e(++_0x1cac72);}(_0x212f,0xb5));var _0xf212=function(_0x48e13b,_0x40f5c7){_0x48e13b=_0x48e13b-0x0;var _0x55a5fa=_0x212f[_0x48e13b];return _0x55a5fa;};'use strict';var _=require(_0xf212('0x0'));var rp=require(_0xf212('0x1'));var md5=require(_0xf212('0x2'));var util=require(_0xf212('0x3'));var moment=require('moment');var Promise=require(_0xf212('0x4'));var Redis=require(_0xf212('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xf212('0x6'))(_0xf212('0x7'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf212('0x8'))(new Redis(config[_0xf212('0x9')]));function getAdminId(_0x3a83e0,_0x4ba760,_0x406c87,_0x331be4){return new Promise(function(_0x200e9d,_0x17afaa){var _0x342db3=![];var _0xc23635={'method':'GET','uri':_0x331be4+'/api/selector/owners','json':!![]};_0xc23635[_0xf212('0xa')]=_0x406c87;logger[_0xf212('0xb')](_0xf212('0xc'));return rp(_0xc23635)[_0xf212('0xd')](function(_0x1d273b){if(_0x1d273b){var _0x17dc1f=_0x1d273b[_0xf212('0xe')];var _0x54c6ba=null;for(_0x54c6ba=0x0;_0x54c6ba<_0x17dc1f[_0xf212('0xf')];_0x54c6ba++){if(_0x17dc1f[_0x54c6ba][_0xf212('0x10')]===_0x3a83e0['adminEmail']){_0x3a83e0[_0xf212('0x11')]=_0x17dc1f[_0x54c6ba]['id'];_0x342db3=!![];}}if(_0x342db3){logger['info'](_0xf212('0x12'),_0x3a83e0[_0xf212('0x11')]);_0x200e9d(_0x3a83e0);}else{_0x17afaa({'statusCode':0x194,'message':_0xf212('0x13')});}}else{_0x17afaa({'statusCode':0x194,'message':_0xf212('0x13')});}})[_0xf212('0x14')](function(_0x5305a8){logger[_0xf212('0x15')]('['+[_0x4ba760['toUpperCase']()]+']',_0x5305a8[_0xf212('0x16')]);_0x17afaa(_0x5305a8);});});}function getUser(_0x204914,_0x55f673,_0x18a44f){return function(_0x13aef7){return new Promise(function(_0x24238d,_0x30088f){var _0xabb62={'method':_0xf212('0x17'),'uri':_0x18a44f+_0xf212('0x18'),'json':!![]};_0xabb62[_0xf212('0xa')]=_0x55f673;logger['info']('Getting\x20user\x20list');return rp(_0xabb62)['then'](function(_0x2cb7f0){if(_0x2cb7f0){var _0x53f0ef=_0x2cb7f0['users'];var _0x1dfe71=![];var _0x2a24a0=null;if(_0x13aef7[_0xf212('0x19')]!==null){logger[_0xf212('0xb')]('Getting\x20user\x20with\x20email',_0x13aef7[_0xf212('0x19')]);_0x13aef7[_0xf212('0x1a')]=_0x13aef7[_0xf212('0x19')];for(_0x2a24a0=0x0;_0x2a24a0<_0x53f0ef[_0xf212('0xf')];_0x2a24a0++){if(_0x53f0ef[_0x2a24a0][_0xf212('0x10')]===_0x13aef7[_0xf212('0x19')]){_0x1dfe71=!![];_0x13aef7[_0xf212('0x1b')]=_0x53f0ef[_0x2a24a0]['id'];logger[_0xf212('0xb')](_0xf212('0x1c'),_0x13aef7['userId']);}}}if(!_0x1dfe71){logger[_0xf212('0xb')]('Admin\x20selected');_0x13aef7[_0xf212('0x1a')]=_0x13aef7[_0xf212('0x1d')];_0x13aef7[_0xf212('0x1b')]=_0x13aef7['adminId'];_0x1dfe71=!![];}if(_0x1dfe71){_0x24238d(_0x13aef7);}else{_0x30088f({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x30088f({'statusCode':0x194,'message':_0xf212('0x13')});}})[_0xf212('0x14')](function(_0x4928f4){logger[_0xf212('0x15')]('['+[_0x204914['toUpperCase']()]+']',_0x4928f4['message']);_0x30088f(_0x4928f4);});});};}function searchContact(_0x6672a2,_0x4586be,_0x1c3357,_0x50a545){return new Promise(function(_0x1a0c5e,_0x4ae7bf){var _0x4d938f={'method':_0xf212('0x17'),'headers':_0x4586be,'uri':_0x6672a2+_0xf212('0x1e')+_0x50a545+_0xf212('0x1f')+_0x1c3357+_0xf212('0x20'),'json':!![]};rp(_0x4d938f)[_0xf212('0xd')](function(_0x3ecf28){var _0x42f562=_['find'](_0x3ecf28[_0xf212('0x21')][_0xf212('0x21')],[_0x1c3357,_0x50a545]);_0x1a0c5e(_0x42f562);})['catch'](function(_0x406124){_0x4ae7bf(_0x406124);});});}function getEndUser(_0x5ae3b1,_0x3a54eb,_0x3d4449){return function(_0x1d12d4){return new Promise(function(_0x5cb71e,_0x1f3ea0){logger['info'](util[_0xf212('0x22')](_0xf212('0x23'),_0x1d12d4[_0xf212('0x24')]));searchContact(_0x3d4449,_0x3a54eb,_0xf212('0x25'),_0x1d12d4['contactNumber'])['then'](function(_0x950f49){if(_0x950f49){_0x1d12d4[_0xf212('0x26')]=_0x950f49['id'];logger[_0xf212('0xb')](_0xf212('0x27'),_0x1d12d4[_0xf212('0x26')]);return _0x5cb71e(_0x1d12d4);}searchContact(_0x3d4449,_0x3a54eb,_0xf212('0x28'),_0x1d12d4[_0xf212('0x24')])[_0xf212('0xd')](function(_0x57ee2e){if(_0x57ee2e){_0x1d12d4[_0xf212('0x26')]=_0x57ee2e['id'];logger[_0xf212('0xb')]('Contact\x20found\x20work_number:',_0x1d12d4[_0xf212('0x26')]);return _0x5cb71e(_0x1d12d4);}createEndUser(_0x1d12d4,_0x5ae3b1,_0x3a54eb,_0x3d4449)[_0xf212('0xd')](function(_0x396c99){logger['info'](_0xf212('0x29'),_0x396c99['endUserId']);return _0x5cb71e(_0x396c99);});});})[_0xf212('0x14')](function(_0x5539d1){_0x1f3ea0(_0x5539d1);});});};}function createEndUser(_0x1dd16f,_0x40b7c1,_0x1bdebf,_0x108f48){return new Promise(function(_0x4bf3ba,_0x3bcbfb){var _0x1a4630=moment();var _0x242c4b={'method':_0xf212('0x2a'),'uri':_0x108f48+_0xf212('0x2b'),'body':{'contact':{'last_name':_0x1dd16f[_0xf212('0x24')],'work_number':_0x1dd16f[_0xf212('0x24')],'mobile_number':_0x1dd16f[_0xf212('0x24')],'owner_id':_0x1dd16f[_0xf212('0x1b')],'created_at':_0x1a4630[_0xf212('0x22')](_0xf212('0x2c'))}},'json':!![]};_0x242c4b[_0xf212('0xa')]=_0x1bdebf;logger[_0xf212('0xb')](_0xf212('0x2d'));return rp(_0x242c4b)['then'](function(_0x1a8ddf){_0x1dd16f[_0xf212('0x26')]=_0x1a8ddf[_0xf212('0x2e')]['id'];_0x4bf3ba(_0x1dd16f);})[_0xf212('0x14')](function(_0x28a515){logger[_0xf212('0x15')]('['+[_0x40b7c1['toUpperCase']()]+']',_0x28a515[_0xf212('0x16')]);_0x3bcbfb(_0x28a515[_0xf212('0x16')]);});});}function getTicket(_0x3df2b4,_0x52fb7d,_0x3970f9,_0xcda1f9,_0x170fd5){return function(_0xfb310f){logger[_0xf212('0xb')](_0xf212('0x2f'));return new Promise(function(_0x4ae08b,_0x51ea8f){var _0x3eab1e=moment();var _0x425328={'method':_0xf212('0x2a'),'uri':_0x3970f9+'/api/tasks','body':{'title':intUtil[_0xf212('0x30')](_0xcda1f9['Subjects'],_0x170fd5,'\x20'),'description':intUtil[_0xf212('0x30')](_0xcda1f9[_0xf212('0x31')],_0x170fd5,'\x0a'),'owner_id':_0xfb310f[_0xf212('0x1b')],'creater_id':_0xfb310f['adminId'],'targetable_id':_0xfb310f[_0xf212('0x26')],'targetable_type':'Contact','created_at':_0x3eab1e['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x3eab1e[_0xf212('0x32')](0x1e,'m')['format'](_0xf212('0x2c'))},'json':!![]};_0x425328['headers']=_0x52fb7d;return rp(_0x425328)[_0xf212('0xd')](function(_0x2e2e91){_0xfb310f[_0xf212('0x33')]=_0x2e2e91[_0xf212('0x34')]['id'];logger[_0xf212('0xb')](_0xf212('0x35'),_0xfb310f['ticketId']);_0x4ae08b(_0xfb310f);})[_0xf212('0x14')](function(_0x2cbb2d){logger['error']('['+[_0x3df2b4[_0xf212('0x36')]()]+']',_0x2cbb2d['message']);_0x51ea8f(_0x2cbb2d['message']);});});};}function emit(_0x4e95e9,_0x466018,_0x4459c0){var _0x64b44e={'uri':_0x4e95e9+'/contacts/'+_0x4459c0};io['to'](util[_0xf212('0x22')](_0xf212('0x37'),_0x466018))[_0xf212('0x38')](_0xf212('0x39'),_0x64b44e);}exports['cs']=function(_0x41bedb,_0x36adf6,_0x2fdcbd,_0x50bd15,_0x75e5b9,_0xfce0ae,_0x3480c0,_0x9ca762){var _0x4b85fe={};var _0x54ae6f={'Authorization':_0xf212('0x3a')+_0xfce0ae[_0xf212('0x3b')]};_0xfce0ae['remoteUri']=intUtil[_0xf212('0x3c')](_0xfce0ae['remoteUri']);_0xfce0ae[_0xf212('0x3d')]=intUtil['stripTrailingSlash'](_0xfce0ae[_0xf212('0x3d')]);var _0x41fa76=_0xfce0ae[_0xf212('0x3e')];_0x4b85fe[_0xf212('0x1d')]=_0xfce0ae[_0xf212('0x3f')];_0x4b85fe[_0xf212('0x24')]=_0x9ca762[_0xf212('0x40')]()===_0xf212('0x41')?_0x36adf6['destcalleridnum']:_0x36adf6['calleridnum'];_0x4b85fe['callDirection']=_0x9ca762===_0xf212('0x42')||_0x9ca762===_0xf212('0x43')?_0xf212('0x42'):'outbound';if(_0x50bd15){_0x4b85fe[_0xf212('0x19')]=_0x50bd15[_0xf212('0x10')];}var _0x335e25=util[_0xf212('0x22')](_0xf212('0x44'),_0xfce0ae['serverUrl'],_0x36adf6[_0xf212('0x45')],md5(_0x36adf6[_0xf212('0x45')]));if(_0x75e5b9&&_0x75e5b9[_0xf212('0x46')]){logger[_0xf212('0xb')](_0xf212('0x47'),'Recording\x20is\x20enabled!');_0x36adf6[_0xf212('0x48')]=_0x335e25;}else if(_0x3480c0&&_0x3480c0[_0xf212('0x49')]&&_0x3480c0[_0xf212('0x49')]!==_0xf212('0x4a')){logger['info'](_0xf212('0x4b'),_0xf212('0x4c'));_0x36adf6['recordingURL']=_0x335e25;}else{_0x36adf6[_0xf212('0x48')]='';}return getAdminId(_0x4b85fe,_0x9ca762,_0x54ae6f,_0x41fa76)[_0xf212('0xd')](getUser(_0x9ca762,_0x54ae6f,_0x41fa76))['then'](getEndUser(_0x9ca762,_0x54ae6f,_0x41fa76))['then'](getTicket(_0x9ca762,_0x54ae6f,_0x41fa76,_0x2fdcbd,_0x36adf6))[_0xf212('0xd')](function(_0x4cb010){logger[_0xf212('0xb')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x4cb010['ticketId']));if(_0x9ca762!==_0xf212('0x43')){logger[_0xf212('0xb')]('['+[_0x9ca762[_0xf212('0x36')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x41fa76,_0x50bd15[_0xf212('0x4d')],_0x4cb010[_0xf212('0x26')]);}})['catch'](function(_0x2fb2bf){logger[_0xf212('0x15')]('['+[_0x9ca762[_0xf212('0x36')]()]+_0xf212('0x4e'),util['inspect'](_0x2fb2bf,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7c4b294..502779f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26c1=['util','./zendesk','./salesforce','./sugarcrm','./desk','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','../../../../config/logger','error','[EXEC]','format','lodash'];(function(_0x259fe7,_0x331b06){var _0x43e47e=function(_0x26d757){while(--_0x26d757){_0x259fe7['push'](_0x259fe7['shift']());}};_0x43e47e(++_0x331b06);}(_0x26c1,0x1c6));var _0x126c=function(_0x39ad4c,_0x2fa27e){_0x39ad4c=_0x39ad4c-0x0;var _0xf3314d=_0x26c1[_0x39ad4c];return _0xf3314d;};'use strict';var _=require(_0x126c('0x0'));var util=require(_0x126c('0x1'));var zendesk=require(_0x126c('0x2'));var salesforce=require(_0x126c('0x3'));var sugarcrm=require(_0x126c('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x126c('0x5'));var vtiger=require('./vtiger');var servicenow=require(_0x126c('0x6'));var dynamics365=require(_0x126c('0x7'));var freshsales=require(_0x126c('0x8'));var integrations=['zendesk',_0x126c('0x9'),_0x126c('0xa'),_0x126c('0xb'),_0x126c('0xc'),_0x126c('0xd'),_0x126c('0xe'),_0x126c('0xf'),'freshsales',_0x126c('0x10')];exports[_0x126c('0x11')]=function(_0x1efadd,_0x3af24d,_0x50b780,_0x24e47c,_0xe715ea,_0x4b17b8){if(_0x50b780){if(_[_0x126c('0x12')](integrations,_0x1efadd[_0x126c('0x13')]['toLowerCase']())){try{var _0x571e63=null;var _0x1d5614='';var _0x5a804d=_0x50b780[_0x1efadd[_0x126c('0x13')][_0x126c('0x14')]()];if(_0x5a804d){var _0x300d98=_0x5a804d[_0x1efadd[_0x126c('0x15')]];if(_0x300d98){var _0x42a030=_[_0x126c('0x16')](_0x300d98[_0x126c('0x17')],{'id':parseInt(_0x1efadd[_0x126c('0x18')],0xa)});if(_0x42a030){if(_0x24e47c){if(_0xe715ea&&_0x3af24d[_0x126c('0x19')]){_0x1d5614='queue';}else if(_0x3af24d['routeId']){_0x1d5614=_0x126c('0x1a');}else{console[_0x126c('0x1b')](_0x126c('0x1c'),_0x3af24d);}}else{_0x1d5614=_0x126c('0x1d');}switch(_0x1efadd['data1'][_0x126c('0x14')]()){case _0x126c('0x1e'):zendesk[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0x9'):salesforce[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0xa'):sugarcrm[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0xb'):freshdesk[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0xc'):zoho[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0xd'):desk[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case _0x126c('0xe'):vtiger[_0x1d5614](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8);break;case'freshsales':freshsales['cs'](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8,_0x1d5614);break;case _0x126c('0x10'):servicenow['cs'](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8,_0x1d5614);break;case _0x126c('0xf'):dynamics365['cs'](_0x1efadd,_0x3af24d,_0x42a030,_0x24e47c,_0xe715ea,_0x300d98,_0x4b17b8,_0x1d5614);break;default:console[_0x126c('0x1b')]('unknown\x20integration');}}else{_0x571e63=require(_0x126c('0x1f'))(_0x1efadd['data1'][_0x126c('0x14')]());_0x571e63[_0x126c('0x20')](_0x126c('0x21'),util[_0x126c('0x22')]('%s\x20configuration\x20#%s\x20not\x20found',_0x1efadd[_0x126c('0x13')]['toLowerCase'](),_0x1efadd[_0x126c('0x18')]));}}else{_0x571e63=require(_0x126c('0x1f'))(_0x1efadd[_0x126c('0x13')][_0x126c('0x14')]());_0x571e63[_0x126c('0x20')](_0x126c('0x21'),util['format']('%s\x20account\x20#%s\x20not\x20found',_0x1efadd[_0x126c('0x13')][_0x126c('0x14')](),_0x1efadd[_0x126c('0x15')]));}}else{}}catch(_0x5158bf){console[_0x126c('0x20')](_0x5158bf);}}}};
\ No newline at end of file
+var _0xbebf=['zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','toLowerCase','data2','find','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','salesforce','unknown\x20integration','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales'];(function(_0x145b76,_0x1d082a){var _0x17e9a1=function(_0x10c60d){while(--_0x10c60d){_0x145b76['push'](_0x145b76['shift']());}};_0x17e9a1(++_0x1d082a);}(_0xbebf,0xf9));var _0xfbeb=function(_0x3dd390,_0xa92ed3){_0x3dd390=_0x3dd390-0x0;var _0x413323=_0xbebf[_0x3dd390];return _0x413323;};'use strict';var _=require(_0xfbeb('0x0'));var util=require('util');var zendesk=require(_0xfbeb('0x1'));var salesforce=require(_0xfbeb('0x2'));var sugarcrm=require(_0xfbeb('0x3'));var freshdesk=require(_0xfbeb('0x4'));var zoho=require(_0xfbeb('0x5'));var desk=require('./desk');var vtiger=require(_0xfbeb('0x6'));var servicenow=require(_0xfbeb('0x7'));var dynamics365=require(_0xfbeb('0x8'));var freshsales=require(_0xfbeb('0x9'));var integrations=[_0xfbeb('0xa'),'salesforce',_0xfbeb('0xb'),_0xfbeb('0xc'),_0xfbeb('0xd'),_0xfbeb('0xe'),_0xfbeb('0xf'),_0xfbeb('0x10'),'freshsales',_0xfbeb('0x11')];exports[_0xfbeb('0x12')]=function(_0x3f694e,_0x5502e4,_0x55be2d,_0x1f2e6a,_0x2977af,_0x48ba3e){if(_0x55be2d){if(_[_0xfbeb('0x13')](integrations,_0x3f694e['data1'][_0xfbeb('0x14')]())){try{var _0x596e11=null;var _0xdbc2db='';var _0x5aef2d=_0x55be2d[_0x3f694e['data1'][_0xfbeb('0x14')]()];if(_0x5aef2d){var _0x311227=_0x5aef2d[_0x3f694e[_0xfbeb('0x15')]];if(_0x311227){var _0xbe6426=_[_0xfbeb('0x16')](_0x311227['Configurations'],{'id':parseInt(_0x3f694e[_0xfbeb('0x17')],0xa)});if(_0xbe6426){if(_0x1f2e6a){if(_0x2977af&&_0x5502e4[_0xfbeb('0x18')]){_0xdbc2db=_0xfbeb('0x18');}else if(_0x5502e4['routeId']){_0xdbc2db=_0xfbeb('0x19');}else{console[_0xfbeb('0x1a')](_0xfbeb('0x1b'),_0x5502e4);}}else{_0xdbc2db=_0xfbeb('0x1c');}switch(_0x3f694e[_0xfbeb('0x1d')]['toLowerCase']()){case'zendesk':zendesk[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case _0xfbeb('0x1e'):salesforce[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case'sugarcrm':sugarcrm[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case _0xfbeb('0xc'):freshdesk[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case _0xfbeb('0xd'):zoho[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case _0xfbeb('0xe'):desk[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case _0xfbeb('0xf'):vtiger[_0xdbc2db](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e);break;case'freshsales':freshsales['cs'](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e,_0xdbc2db);break;case'servicenow':servicenow['cs'](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e,_0xdbc2db);break;case _0xfbeb('0x10'):dynamics365['cs'](_0x3f694e,_0x5502e4,_0xbe6426,_0x1f2e6a,_0x2977af,_0x311227,_0x48ba3e,_0xdbc2db);break;default:console[_0xfbeb('0x1a')](_0xfbeb('0x1f'));}}else{_0x596e11=require('../../../../config/logger')(_0x3f694e[_0xfbeb('0x1d')]['toLowerCase']());_0x596e11['error'](_0xfbeb('0x20'),util[_0xfbeb('0x21')](_0xfbeb('0x22'),_0x3f694e[_0xfbeb('0x1d')]['toLowerCase'](),_0x3f694e[_0xfbeb('0x17')]));}}else{_0x596e11=require('../../../../config/logger')(_0x3f694e[_0xfbeb('0x1d')]['toLowerCase']());_0x596e11[_0xfbeb('0x23')](_0xfbeb('0x20'),util[_0xfbeb('0x21')](_0xfbeb('0x24'),_0x3f694e['data1']['toLowerCase'](),_0x3f694e[_0xfbeb('0x15')]));}}else{}}catch(_0x1da75d){console[_0xfbeb('0x23')](_0x1da75d);}}}};
\ No newline at end of file
index b0d83f7..97f89ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa834=['LastName','<unknown>','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','string','idField','content','toString','variableName','Variable','name','password','concat','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','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.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','localhost','emit','assign','getString','Subjects','Descriptions','ticketType','Task','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','merge','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchContact','$or','additionalSearchAccount','Account','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.'];(function(_0x3f5820,_0x4e4703){var _0x4b36b3=function(_0x5eaa09){while(--_0x5eaa09){_0x3f5820['push'](_0x3f5820['shift']());}};_0x4b36b3(++_0x4e4703);}(_0xa834,0x1bd));var _0x4a83=function(_0x159ff2,_0x2095b0){_0x159ff2=_0x159ff2-0x0;var _0x91fd39=_0xa834[_0x159ff2];return _0x91fd39;};'use strict';var _=require(_0x4a83('0x0'));var rp=require(_0x4a83('0x1'));var moment=require('moment');var BPromise=require(_0x4a83('0x2'));var md5=require(_0x4a83('0x3'));var jsforce=require('jsforce');var util=require(_0x4a83('0x4'));var Redis=require(_0x4a83('0x5'));var intUtil=require(_0x4a83('0x6'));var config=require(_0x4a83('0x7'));var logger=require(_0x4a83('0x8'))(_0x4a83('0x9'));config[_0x4a83('0xa')]=_['defaults'](config[_0x4a83('0xa')],{'host':_0x4a83('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a83('0xa')]));function emit(_0x4e0727,_0x5c07bc,_0x20132a){io['to'](_0x4e0727)[_0x4a83('0xc')](_0x5c07bc,_0x20132a);}function getTicket(_0x44d50d,_0x15c47d,_0x5ac43d,_0x4cda3b,_0x44e490,_0x4b79a7,_0x46e310,_0x4234d3){var _0x330d3d=Object[_0x4a83('0xd')]({},{'OwnerId':_0x15c47d['id'],'Subject':intUtil[_0x4a83('0xe')](_0x4cda3b[_0x4a83('0xf')],_0x44e490,'\x20'),'Description':intUtil[_0x4a83('0xe')](_0x4cda3b[_0x4a83('0x10')],_0x44e490,'\x0a')},getCustomFields(_0x4b79a7,_0x44e490));if(_0x5ac43d){if(_0x4cda3b[_0x4a83('0x11')]===_0x4a83('0x12')){_0x330d3d['ActivityDate']=moment['utc']();_0x330d3d['IsReminderSet']=![];_0x330d3d[_0x4a83('0x13')]=![];if(_0x5ac43d[_0x4a83('0x14')]===_0x4a83('0x15')||_0x5ac43d['endUserType']===_0x4a83('0x16')){_0x330d3d[_0x4a83('0x17')]=_0x5ac43d['id'];}else if(_0x5ac43d[_0x4a83('0x14')]===_0x4a83('0x18')){_0x330d3d[_0x4a83('0x19')]=_0x5ac43d['id'];}}else if(_0x4cda3b[_0x4a83('0x11')]===_0x4a83('0x1a')){if(_0x5ac43d['endUserType']===_0x4a83('0x15')){_0x330d3d[_0x4a83('0x1b')]=_0x5ac43d['id'];}else if(_0x5ac43d[_0x4a83('0x14')]==='account'){_0x330d3d[_0x4a83('0x1c')]=_0x5ac43d['id'];}else if(_0x5ac43d[_0x4a83('0x14')]===_0x4a83('0x16')&&_0x4cda3b[_0x4a83('0x1d')]){_0x330d3d[_0x4cda3b[_0x4a83('0x1d')]]=_0x5ac43d['id'];}else{logger[_0x4a83('0x1e')](_0x4a83('0x1f'));}}}return _0x46e310[_0x4a83('0x20')](_0x4cda3b[_0x4a83('0x11')])['create'](_0x330d3d);}function getUser(_0x48e386,_0x5a1336,_0x4526c9){if(!_[_0x4a83('0x21')](_0x5a1336)&&intUtil['validateEmail'](_0x5a1336)){var _0xfc0519={'Email':_0x5a1336};var _0x96f269={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4526c9['sobject'](_0x4a83('0x22'))[_0x4a83('0x23')](_0xfc0519,_0x96f269)[_0x4a83('0x24')]()[_0x4a83('0x25')](function(_0x4c9441){if(_0x4c9441[_0x4a83('0x26')]){var _0x31c305=_[_0x4a83('0x23')](_0x4c9441,function(_0x8f3253){return _0x8f3253[_0x4a83('0x27')]===_0x5a1336;});if(_0x31c305){logger['info'](_0x4a83('0x28'),_0x5a1336);return BPromise[_0x4a83('0x29')]({'id':_0x31c305['Id'],'name':_0x31c305[_0x4a83('0x2a')]});}}else{logger[_0x4a83('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x5a1336);return _0x4526c9['identity']()[_0x4a83('0x25')](function(_0x1ae5c9){return BPromise[_0x4a83('0x29')]({'id':_0x1ae5c9[_0x4a83('0x2b')],'name':_0x1ae5c9[_0x4a83('0x2c')]});});}});}else{logger[_0x4a83('0x1e')](_0x4a83('0x2d'),_0x5a1336);return _0x4526c9[_0x4a83('0x2e')]()[_0x4a83('0x25')](function(_0x44b497){return BPromise[_0x4a83('0x29')]({'id':_0x44b497[_0x4a83('0x2b')],'name':_0x44b497[_0x4a83('0x2c')]});});}}function getEndUser(_0x1dd71f,_0x1f860d,_0x599c5c,_0x160871,_0x502495){var _0x13d780={'$or':{'Phone':_0x160871}};var _0x47c63d={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x4a83('0x25')](function(){logger['info'](_0x4a83('0x2f'),_0x160871,_0x1f860d[_0x4a83('0x30')]);switch(_0x1f860d[_0x4a83('0x30')]){case _0x4a83('0x31'):var _0x4f57f1=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d['additionalSearchContact']){var _0x48da51={};_0x48da51[_0x1f860d['additionalSearchContact']]=_0x160871;_[_0x4a83('0x33')](_0x4f57f1['$or'],_0x48da51);}return _0x502495[_0x4a83('0x20')](_0x4a83('0x34'))[_0x4a83('0x23')](_0x4f57f1,_0x47c63d)[_0x4a83('0x24')]()[_0x4a83('0x25')](function(_0x4dec4e){if(_0x4dec4e&&_0x4dec4e[_0x4a83('0x26')]){return _0x4dec4e;}else{var _0x258ac8=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d[_0x4a83('0x35')]){var _0x516662={};_0x516662[_0x1f860d[_0x4a83('0x35')]]=_0x160871;_['merge'](_0x258ac8['$or'],_0x516662);}return _0x502495['sobject'](_0x4a83('0x36'))['find'](_0x258ac8,_0x47c63d);}});case _0x4a83('0x37'):var _0x20c10a=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d['additionalSearchAccount']){var _0x48da51={};_0x48da51[_0x1f860d['additionalSearchAccount']]=_0x160871;_[_0x4a83('0x33')](_0x20c10a['$or'],_0x48da51);}return _0x502495[_0x4a83('0x20')]('Account')[_0x4a83('0x23')](_0x20c10a,_0x47c63d)[_0x4a83('0x24')]()[_0x4a83('0x25')](function(_0x81ba6f){if(_0x81ba6f&&_0x81ba6f[_0x4a83('0x26')]){return _0x81ba6f;}else{var _0x276c2e=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d[_0x4a83('0x38')]){var _0x17dfe8={};_0x17dfe8[_0x1f860d[_0x4a83('0x38')]]=_0x160871;_[_0x4a83('0x33')](_0x276c2e[_0x4a83('0x39')],_0x17dfe8);}return _0x502495['sobject']('Contact')[_0x4a83('0x23')](_0x276c2e,_0x47c63d)['then'](function(_0x4e5140){if(_0x4e5140&&_0x4e5140['length']){return _0x4e5140;}else{var _0x12df81=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d[_0x4a83('0x35')]){var _0x23af91={};_0x23af91[_0x1f860d[_0x4a83('0x35')]]=_0x160871;_[_0x4a83('0x33')](_0x12df81['$or'],_0x23af91);}return _0x502495[_0x4a83('0x20')](_0x4a83('0x36'))[_0x4a83('0x23')](_0x12df81,_0x47c63d);}});}});case _0x4a83('0x15'):var _0x4f57f1=_['cloneDeep'](_0x13d780);if(_0x1f860d[_0x4a83('0x38')]){var _0x48da51={};_0x48da51[_0x1f860d[_0x4a83('0x38')]]=_0x160871;_['merge'](_0x4f57f1[_0x4a83('0x39')],_0x48da51);}return _0x502495['sobject'](_0x4a83('0x34'))[_0x4a83('0x23')](_0x4f57f1,_0x47c63d)[_0x4a83('0x24')]();case _0x4a83('0x16'):var _0x42fd06=_[_0x4a83('0x32')](_0x13d780);if(_0x1f860d[_0x4a83('0x35')]){var _0x48da51={};_0x48da51[_0x1f860d[_0x4a83('0x35')]]=_0x160871;_[_0x4a83('0x33')](_0x42fd06[_0x4a83('0x39')],_0x48da51);}return _0x502495[_0x4a83('0x20')](_0x4a83('0x36'))[_0x4a83('0x23')](_0x42fd06,_0x47c63d);case'account':var _0x20c10a=_['cloneDeep'](_0x13d780);if(_0x1f860d[_0x4a83('0x3a')]){var _0x48da51={};_0x48da51[_0x1f860d[_0x4a83('0x3a')]]=_0x160871;_['merge'](_0x20c10a[_0x4a83('0x39')],_0x48da51);}return _0x502495[_0x4a83('0x20')](_0x4a83('0x3b'))[_0x4a83('0x23')](_0x20c10a,_0x47c63d);default:return null;}})[_0x4a83('0x25')](function(_0x471671){if(_0x471671&&_0x471671['length']){var _0x5f2a6f=_['first'](_0x471671);if(_0x5f2a6f){return BPromise[_0x4a83('0x29')]({'id':_0x5f2a6f['Id'],'name':_0x5f2a6f[_0x4a83('0x2a')],'phone':_0x5f2a6f['Phone'],'endUserType':_0x5f2a6f[_0x4a83('0x3c')][_0x4a83('0x3d')][_0x4a83('0x3e')]()});}}})[_0x4a83('0x25')](function(_0x34feae){if(_0x34feae){logger['info'](_0x4a83('0x3f'),_0x34feae['endUserType'],_0x160871);return BPromise[_0x4a83('0x29')](_0x34feae);}else{logger[_0x4a83('0x1e')](_0x4a83('0x40'),_0x160871);var _0x3c6dd5={'Phone':_0x160871};if(_0x1f860d[_0x4a83('0x41')]){if(_0x1f860d[_0x4a83('0x41')]===_0x4a83('0x15')){logger['info'](_0x4a83('0x42'),_0x160871,_0x1f860d[_0x4a83('0x41')]);_0x3c6dd5[_0x4a83('0x43')]=_0x599c5c!==_0x4a83('0x44')?_0x599c5c:util[_0x4a83('0x45')](_0x4a83('0x46'),_0x160871);}else if(_0x1f860d[_0x4a83('0x41')]===_0x4a83('0x16')){logger[_0x4a83('0x1e')](_0x4a83('0x42'),_0x160871,_0x1f860d[_0x4a83('0x41')]);_0x3c6dd5['LastName']=_0x599c5c!=='<unknown>'?_0x599c5c:util[_0x4a83('0x45')](_0x4a83('0x46'),_0x160871);_0x3c6dd5[_0x4a83('0x47')]=_0x4a83('0x48');}else if(_0x1f860d['moduleCreate']===_0x4a83('0x18')){logger[_0x4a83('0x1e')](_0x4a83('0x42'),_0x160871,_0x1f860d[_0x4a83('0x41')]);_0x3c6dd5[_0x4a83('0x2a')]=_0x599c5c!==_0x4a83('0x44')?_0x599c5c:util[_0x4a83('0x45')]('Caller\x20-\x20%s',_0x160871);}else{return null;}}return _0x502495[_0x4a83('0x20')](_[_0x4a83('0x49')](_0x1f860d['moduleCreate']))['create'](_0x3c6dd5)[_0x4a83('0x25')](function(_0x2fea40){return BPromise[_0x4a83('0x29')]({'id':_0x2fea40['id'],'endUserType':_0x1f860d[_0x4a83('0x41')]});});}});}function getCustomFields(_0x391189,_0x122a23){var _0x38f52d={};if(_0x391189[_0x4a83('0x26')]>0x0){_[_0x4a83('0x4a')](_0x391189,function(_0x1e30d1){if(_['includes']([_0x4a83('0x4b'),'picklist'],_0x1e30d1[_0x4a83('0x3d')])&&_0x1e30d1[_0x4a83('0x4c')]){_0x38f52d[_0x1e30d1[_0x4a83('0x4c')]]=_0x1e30d1[_0x4a83('0x4d')][_0x4a83('0x4e')]();}else if(_0x1e30d1[_0x4a83('0x3d')]==='variable'&&_0x1e30d1[_0x4a83('0x4f')]&&_0x1e30d1[_0x4a83('0x4c')]){_0x122a23[_0x1e30d1[_0x4a83('0x4f')]]&&(_0x38f52d[_0x1e30d1[_0x4a83('0x4c')]]=_0x122a23[_0x1e30d1[_0x4a83('0x4f')]][_0x4a83('0x4e')]());}else if(_0x1e30d1['type']==='customVariable'&&_0x1e30d1[_0x4a83('0x50')]&&_0x1e30d1['Variable'][_0x4a83('0x51')]&&_0x1e30d1['idField']){_0x122a23[_0x1e30d1[_0x4a83('0x50')][_0x4a83('0x51')][_0x4a83('0x3e')]()]&&(_0x38f52d[_0x1e30d1[_0x4a83('0x4c')]]=_0x122a23[_0x1e30d1['Variable']['name'][_0x4a83('0x3e')]()]['toString']());}});}return _0x38f52d;}function getConnection(_0x168084){var _0x5c4f58=_0x168084[_0x4a83('0x52')][_0x4a83('0x53')](_0x168084[_0x4a83('0x54')]);var _0x40d21f=new jsforce['Connection']({'oauth2':{'loginUrl':_0x168084[_0x4a83('0x55')]||'https://login.salesforce.com','clientId':_0x168084[_0x4a83('0x56')],'clientSecret':_0x168084[_0x4a83('0x57')]}});return _0x40d21f[_0x4a83('0x58')](_0x168084[_0x4a83('0x59')],_0x5c4f58)['then'](function(){logger[_0x4a83('0x1e')](_0x4a83('0x5a'));return _0x40d21f;});}exports[_0x4a83('0x5b')]=function(_0x3a63be,_0x5ae6e1,_0x1eb4f5,_0x3d1d10,_0x5f3f65,_0x5bd027){var _0x5c2f57,_0x5aef8e,_0x57cfeb,_0x551ade;_0x5bd027[_0x4a83('0x5c')]=intUtil[_0x4a83('0x5d')](_0x5bd027[_0x4a83('0x5c')]);_0x5bd027[_0x4a83('0x55')]=intUtil[_0x4a83('0x5d')](_0x5bd027['remoteUri']);if(_0x5f3f65&&_0x5f3f65[_0x4a83('0x5e')]){logger[_0x4a83('0x1e')](_0x4a83('0x5f'),_0x4a83('0x60'));_0x5ae6e1[_0x4a83('0x61')]=util[_0x4a83('0x45')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5bd027[_0x4a83('0x5c')],_0x5ae6e1[_0x4a83('0x62')],md5(_0x5ae6e1[_0x4a83('0x62')]));}else{_0x5ae6e1[_0x4a83('0x61')]='';}return getConnection(_0x5bd027)[_0x4a83('0x25')](function(_0x37f016){_0x551ade=_0x37f016;return getUser(_0x5bd027,_0x3d1d10[_0x4a83('0x63')],_0x551ade);})[_0x4a83('0x25')](function(_0x484655){_0x5c2f57=_0x484655;return getEndUser(_0x5bd027,_0x1eb4f5,_0x5ae6e1[_0x4a83('0x64')],_0x5ae6e1[_0x4a83('0x65')],_0x551ade);})[_0x4a83('0x25')](function(_0x26b2dc){_0x5aef8e=_0x26b2dc;return getTicket(_0x5bd027,_0x5c2f57,_0x5aef8e,_0x1eb4f5,_0x5ae6e1,_0x1eb4f5[_0x4a83('0x66')],_0x551ade,_0x4a83('0x5b'));})['then'](function(_0x5aee1e){_0x57cfeb=_0x5aee1e;logger['info'](_0x4a83('0x67'),_0x57cfeb['id']);logger['info'](_0x4a83('0x68'),_0x57cfeb['id'],_0x3d1d10[_0x4a83('0x51')],_0x5bd027[_0x4a83('0x3d')]);switch(_0x5bd027[_0x4a83('0x3d')]){case _0x4a83('0x69'):emit(util[_0x4a83('0x45')](_0x4a83('0x6a'),_0x3d1d10[_0x4a83('0x51')]),_0x4a83('0x6b'),{'recordId':_0x57cfeb['id']});break;case _0x4a83('0x6c'):emit(util[_0x4a83('0x45')]('user:%s',_0x3d1d10[_0x4a83('0x51')]),_0x4a83('0x6d'),{'uri':util['format'](_0x4a83('0x6e'),_0x551ade[_0x4a83('0x6f')],_0x57cfeb['id'])});break;default:logger[_0x4a83('0x70')](_0x4a83('0x71'));}})[_0x4a83('0x72')](function(_0x49a387){logger[_0x4a83('0x70')](_0x4a83('0x5f'),_0x49a387);});};exports[_0x4a83('0x73')]=function(_0x2b4cd7,_0x21cdf8,_0x59e82f,_0x2f458b,_0xe57275,_0x159526,_0x12f774){var _0x120ea4,_0x49114b,_0x25000b,_0x207748;_0x159526[_0x4a83('0x5c')]=intUtil[_0x4a83('0x5d')](_0x159526[_0x4a83('0x5c')]);_0x159526[_0x4a83('0x55')]=intUtil[_0x4a83('0x5d')](_0x159526[_0x4a83('0x55')]);if(_0x12f774&&_0x12f774['recordingFormat']&&_0x12f774[_0x4a83('0x74')]!==_0x4a83('0x75')){logger[_0x4a83('0x1e')](_0x4a83('0x76'),_0x4a83('0x60'));_0x21cdf8['recordingURL']=util[_0x4a83('0x45')](_0x4a83('0x77'),_0x159526['serverUrl'],_0x21cdf8[_0x4a83('0x62')],md5(_0x21cdf8[_0x4a83('0x62')]));}return getConnection(_0x159526)[_0x4a83('0x25')](function(_0x2bc90d){_0x207748=_0x2bc90d;return getUser(_0x159526,_0x2f458b[_0x4a83('0x63')],_0x207748);})[_0x4a83('0x25')](function(_0x3bfa43){_0x120ea4=_0x3bfa43;return getEndUser(_0x159526,_0x59e82f,_0x21cdf8[_0x4a83('0x78')],_0x21cdf8[_0x4a83('0x79')],_0x207748);})[_0x4a83('0x25')](function(_0x1cfc19){_0x49114b=_0x1cfc19;return getTicket(_0x159526,_0x120ea4,_0x49114b,_0x59e82f,_0x21cdf8,_0x59e82f[_0x4a83('0x66')],_0x207748,_0x4a83('0x73'));})['then'](function(_0x10df84){_0x25000b=_0x10df84;logger[_0x4a83('0x1e')](_0x4a83('0x7a'),_0x25000b['id']);logger[_0x4a83('0x1e')](_0x4a83('0x7b'),_0x25000b['id'],_0x2f458b['name'],_0x159526[_0x4a83('0x3d')]);switch(_0x159526[_0x4a83('0x3d')]){case'integrationTab':emit(util[_0x4a83('0x45')](_0x4a83('0x6a'),_0x2f458b[_0x4a83('0x51')]),'trigger:salesforce:display',{'recordId':_0x25000b['id']});break;case _0x4a83('0x6c'):emit(util[_0x4a83('0x45')](_0x4a83('0x6a'),_0x2f458b[_0x4a83('0x51')]),'trigger:browser:url',{'uri':util[_0x4a83('0x45')](_0x4a83('0x6e'),_0x207748['instanceUrl'],_0x25000b['id'])});break;default:logger[_0x4a83('0x70')](_0x4a83('0x76'),_0x4a83('0x7c'));}})[_0x4a83('0x72')](function(_0xc44646){logger['error']('[OUTBOUND]',_0xc44646);});};exports['unmanaged']=function(_0xee0b3d,_0x571e5c,_0x1490c8,_0x4b878f,_0x93aa8e,_0xf9f203){var _0x5a9d52,_0x1bfa83,_0x15d60c,_0x104fba;_0xf9f203[_0x4a83('0x5c')]=intUtil[_0x4a83('0x5d')](_0xf9f203[_0x4a83('0x5c')]);_0xf9f203[_0x4a83('0x55')]=intUtil['stripTrailingSlash'](_0xf9f203[_0x4a83('0x55')]);if(_0x93aa8e&&_0x93aa8e[_0x4a83('0x5e')]){logger[_0x4a83('0x1e')]('['+_0x571e5c[_0x4a83('0x7d')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x571e5c[_0x4a83('0x61')]=util['format'](_0x4a83('0x77'),_0xf9f203[_0x4a83('0x5c')],_0x571e5c[_0x4a83('0x62')],md5(_0x571e5c[_0x4a83('0x62')]));}else{_0x571e5c[_0x4a83('0x61')]='';}return getConnection(_0xf9f203)['then'](function(_0x3a5e50){_0x104fba=_0x3a5e50;if(!_['isNil'](_0x4b878f)){return getUser(_0xf9f203,_0x4b878f['name'],_0x104fba);}else{return getUser(_0xf9f203,null,_0x104fba);}})[_0x4a83('0x25')](function(_0x2a7720){_0x5a9d52=_0x2a7720;return getEndUser(_0xf9f203,_0x1490c8,_0x571e5c[_0x4a83('0x64')],_0x571e5c['calleridnum'],_0x104fba);})[_0x4a83('0x25')](function(_0x3db9b6){_0x1bfa83=_0x3db9b6;return getTicket(_0xf9f203,_0x5a9d52,_0x1bfa83,_0x1490c8,_0x571e5c,_0x1490c8[_0x4a83('0x66')],_0x104fba);})[_0x4a83('0x25')](function(_0x32eff8){_0x15d60c=_0x32eff8;logger[_0x4a83('0x1e')]('['+_0x571e5c['lastevent']['toUpperCase']()+_0x4a83('0x7e'),_0x15d60c['id']);logger['info']('['+_0x571e5c[_0x4a83('0x7d')][_0x4a83('0x7f')]()+']\x20Integration\x20account\x20type\x20%s.',_0xf9f203[_0x4a83('0x3d')]);})[_0x4a83('0x72')](function(_0x39ed0e){logger[_0x4a83('0x70')]('['+_0x571e5c['lastevent'][_0x4a83('0x7f')]()+']',_0x39ed0e);});};
\ No newline at end of file
+var _0x3ad6=['[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','calleridname','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridnum','Fields','error','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','bluebird','md5','jsforce','util','./util','../../../../config/logger','salesforce','defaults','localhost','redis','emit','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','IsRecurrence','contact','WhoId','endUserType','account','Case','AccountId','lead','leadId','info','validateEmail','sobject','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','additionalSearchLead','merge','$or','Lead','account_contact_lead','additionalSearchAccount','Account','Contact','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','upperFirst','create','forEach','includes','string','picklist','idField','content','toString','variable','variableName','customVariable','Variable','name','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3ad6,0x119));var _0x63ad=function(_0x524955,_0x3a67d0){_0x524955=_0x524955-0x0;var _0xf875f0=_0x3ad6[_0x524955];return _0xf875f0;};'use strict';var _=require(_0x63ad('0x0'));var rp=require(_0x63ad('0x1'));var moment=require('moment');var BPromise=require(_0x63ad('0x2'));var md5=require(_0x63ad('0x3'));var jsforce=require(_0x63ad('0x4'));var util=require(_0x63ad('0x5'));var Redis=require('ioredis');var intUtil=require(_0x63ad('0x6'));var config=require('../../../../config/environment');var logger=require(_0x63ad('0x7'))(_0x63ad('0x8'));config['redis']=_[_0x63ad('0x9')](config['redis'],{'host':_0x63ad('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x63ad('0xb')]));function emit(_0xfaac4b,_0x34cdf3,_0x57a3b3){io['to'](_0xfaac4b)[_0x63ad('0xc')](_0x34cdf3,_0x57a3b3);}function getTicket(_0x4e099a,_0x5b2cd4,_0x46ea2c,_0x24c5d5,_0x3587f2,_0xed0724,_0x32ee79,_0x2e11f9){var _0x19f4d6=Object['assign']({},{'OwnerId':_0x5b2cd4['id'],'Subject':intUtil['getString'](_0x24c5d5[_0x63ad('0xd')],_0x3587f2,'\x20'),'Description':intUtil[_0x63ad('0xe')](_0x24c5d5[_0x63ad('0xf')],_0x3587f2,'\x0a')},getCustomFields(_0xed0724,_0x3587f2));if(_0x46ea2c){if(_0x24c5d5[_0x63ad('0x10')]===_0x63ad('0x11')){_0x19f4d6[_0x63ad('0x12')]=moment[_0x63ad('0x13')]();_0x19f4d6['IsReminderSet']=![];_0x19f4d6[_0x63ad('0x14')]=![];if(_0x46ea2c['endUserType']===_0x63ad('0x15')||_0x46ea2c['endUserType']==='lead'){_0x19f4d6[_0x63ad('0x16')]=_0x46ea2c['id'];}else if(_0x46ea2c[_0x63ad('0x17')]===_0x63ad('0x18')){_0x19f4d6['WhatId']=_0x46ea2c['id'];}}else if(_0x24c5d5[_0x63ad('0x10')]===_0x63ad('0x19')){if(_0x46ea2c[_0x63ad('0x17')]===_0x63ad('0x15')){_0x19f4d6['ContactId']=_0x46ea2c['id'];}else if(_0x46ea2c[_0x63ad('0x17')]===_0x63ad('0x18')){_0x19f4d6[_0x63ad('0x1a')]=_0x46ea2c['id'];}else if(_0x46ea2c[_0x63ad('0x17')]===_0x63ad('0x1b')&&_0x24c5d5[_0x63ad('0x1c')]){_0x19f4d6[_0x24c5d5[_0x63ad('0x1c')]]=_0x46ea2c['id'];}else{logger[_0x63ad('0x1d')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x32ee79['sobject'](_0x24c5d5[_0x63ad('0x10')])['create'](_0x19f4d6);}function getUser(_0x59c602,_0x124006,_0x396ad6){if(!_['isNil'](_0x124006)&&intUtil[_0x63ad('0x1e')](_0x124006)){var _0x96bc5d={'Email':_0x124006};var _0x17b423={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x396ad6[_0x63ad('0x1f')]('User')[_0x63ad('0x20')](_0x96bc5d,_0x17b423)[_0x63ad('0x21')]()[_0x63ad('0x22')](function(_0xb31494){if(_0xb31494[_0x63ad('0x23')]){var _0x1a6c1f=_[_0x63ad('0x20')](_0xb31494,function(_0x465704){return _0x465704[_0x63ad('0x24')]===_0x124006;});if(_0x1a6c1f){logger[_0x63ad('0x1d')](_0x63ad('0x25'),_0x124006);return BPromise[_0x63ad('0x26')]({'id':_0x1a6c1f['Id'],'name':_0x1a6c1f[_0x63ad('0x27')]});}}else{logger['info'](_0x63ad('0x28'),_0x124006);return _0x396ad6[_0x63ad('0x29')]()[_0x63ad('0x22')](function(_0x1e7dae){return BPromise[_0x63ad('0x26')]({'id':_0x1e7dae[_0x63ad('0x2a')],'name':_0x1e7dae['display_name']});});}});}else{logger[_0x63ad('0x1d')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x124006);return _0x396ad6[_0x63ad('0x29')]()[_0x63ad('0x22')](function(_0x523764){return BPromise[_0x63ad('0x26')]({'id':_0x523764[_0x63ad('0x2a')],'name':_0x523764[_0x63ad('0x2b')]});});}}function getEndUser(_0x19118b,_0x162845,_0x156eff,_0x121648,_0x521e6d){var _0x3474c1={'$or':{'Phone':_0x121648}};var _0x526e83={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x63ad('0x26')]()[_0x63ad('0x22')](function(){logger[_0x63ad('0x1d')](_0x63ad('0x2c'),_0x121648,_0x162845[_0x63ad('0x2d')]);switch(_0x162845[_0x63ad('0x2d')]){case _0x63ad('0x2e'):var _0x45c494=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845['additionalSearchContact']){var _0x5e15cf={};_0x5e15cf[_0x162845[_0x63ad('0x30')]]=_0x121648;_['merge'](_0x45c494['$or'],_0x5e15cf);}return _0x521e6d[_0x63ad('0x1f')]('Contact')[_0x63ad('0x20')](_0x45c494,_0x526e83)[_0x63ad('0x21')]()[_0x63ad('0x22')](function(_0x15b965){if(_0x15b965&&_0x15b965[_0x63ad('0x23')]){return _0x15b965;}else{var _0x3f2309=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845[_0x63ad('0x31')]){var _0x2aaff3={};_0x2aaff3[_0x162845[_0x63ad('0x31')]]=_0x121648;_[_0x63ad('0x32')](_0x3f2309[_0x63ad('0x33')],_0x2aaff3);}return _0x521e6d[_0x63ad('0x1f')](_0x63ad('0x34'))[_0x63ad('0x20')](_0x3f2309,_0x526e83);}});case _0x63ad('0x35'):var _0x30cda5=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845[_0x63ad('0x36')]){var _0x5e15cf={};_0x5e15cf[_0x162845[_0x63ad('0x36')]]=_0x121648;_[_0x63ad('0x32')](_0x30cda5[_0x63ad('0x33')],_0x5e15cf);}return _0x521e6d[_0x63ad('0x1f')](_0x63ad('0x37'))[_0x63ad('0x20')](_0x30cda5,_0x526e83)[_0x63ad('0x21')]()['then'](function(_0x2f8d79){if(_0x2f8d79&&_0x2f8d79[_0x63ad('0x23')]){return _0x2f8d79;}else{var _0x2a393b=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845[_0x63ad('0x30')]){var _0x2e87dc={};_0x2e87dc[_0x162845[_0x63ad('0x30')]]=_0x121648;_['merge'](_0x2a393b[_0x63ad('0x33')],_0x2e87dc);}return _0x521e6d['sobject'](_0x63ad('0x38'))[_0x63ad('0x20')](_0x2a393b,_0x526e83)[_0x63ad('0x22')](function(_0x3e028d){if(_0x3e028d&&_0x3e028d[_0x63ad('0x23')]){return _0x3e028d;}else{var _0x33cce7=_['cloneDeep'](_0x3474c1);if(_0x162845[_0x63ad('0x31')]){var _0xb7cada={};_0xb7cada[_0x162845['additionalSearchLead']]=_0x121648;_[_0x63ad('0x32')](_0x33cce7[_0x63ad('0x33')],_0xb7cada);}return _0x521e6d['sobject']('Lead')[_0x63ad('0x20')](_0x33cce7,_0x526e83);}});}});case _0x63ad('0x15'):var _0x45c494=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845[_0x63ad('0x30')]){var _0x5e15cf={};_0x5e15cf[_0x162845[_0x63ad('0x30')]]=_0x121648;_['merge'](_0x45c494[_0x63ad('0x33')],_0x5e15cf);}return _0x521e6d['sobject']('Contact')[_0x63ad('0x20')](_0x45c494,_0x526e83)['execute']();case _0x63ad('0x1b'):var _0x3f53a6=_[_0x63ad('0x2f')](_0x3474c1);if(_0x162845[_0x63ad('0x31')]){var _0x5e15cf={};_0x5e15cf[_0x162845['additionalSearchLead']]=_0x121648;_[_0x63ad('0x32')](_0x3f53a6['$or'],_0x5e15cf);}return _0x521e6d['sobject'](_0x63ad('0x34'))[_0x63ad('0x20')](_0x3f53a6,_0x526e83);case _0x63ad('0x18'):var _0x30cda5=_['cloneDeep'](_0x3474c1);if(_0x162845[_0x63ad('0x36')]){var _0x5e15cf={};_0x5e15cf[_0x162845['additionalSearchAccount']]=_0x121648;_[_0x63ad('0x32')](_0x30cda5[_0x63ad('0x33')],_0x5e15cf);}return _0x521e6d[_0x63ad('0x1f')](_0x63ad('0x37'))[_0x63ad('0x20')](_0x30cda5,_0x526e83);default:return null;}})[_0x63ad('0x22')](function(_0x201c32){if(_0x201c32&&_0x201c32[_0x63ad('0x23')]){var _0x632d8=_['first'](_0x201c32);if(_0x632d8){return BPromise[_0x63ad('0x26')]({'id':_0x632d8['Id'],'name':_0x632d8['Name'],'phone':_0x632d8[_0x63ad('0x39')],'endUserType':_0x632d8[_0x63ad('0x3a')][_0x63ad('0x3b')][_0x63ad('0x3c')]()});}}})[_0x63ad('0x22')](function(_0x523e06){if(_0x523e06){logger[_0x63ad('0x1d')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x523e06[_0x63ad('0x17')],_0x121648);return BPromise[_0x63ad('0x26')](_0x523e06);}else{logger[_0x63ad('0x1d')](_0x63ad('0x3d'),_0x121648);var _0x31eaf6={'Phone':_0x121648};if(_0x162845[_0x63ad('0x3e')]){if(_0x162845[_0x63ad('0x3e')]==='contact'){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x121648,_0x162845[_0x63ad('0x3e')]);_0x31eaf6[_0x63ad('0x3f')]=_0x156eff!==_0x63ad('0x40')?_0x156eff:util[_0x63ad('0x41')](_0x63ad('0x42'),_0x121648);}else if(_0x162845[_0x63ad('0x3e')]===_0x63ad('0x1b')){logger[_0x63ad('0x1d')](_0x63ad('0x43'),_0x121648,_0x162845[_0x63ad('0x3e')]);_0x31eaf6[_0x63ad('0x3f')]=_0x156eff!==_0x63ad('0x40')?_0x156eff:util['format'](_0x63ad('0x42'),_0x121648);_0x31eaf6['Company']='No\x20Company';}else if(_0x162845[_0x63ad('0x3e')]==='account'){logger[_0x63ad('0x1d')](_0x63ad('0x43'),_0x121648,_0x162845[_0x63ad('0x3e')]);_0x31eaf6['Name']=_0x156eff!==_0x63ad('0x40')?_0x156eff:util[_0x63ad('0x41')](_0x63ad('0x42'),_0x121648);}else{return null;}}return _0x521e6d[_0x63ad('0x1f')](_[_0x63ad('0x44')](_0x162845['moduleCreate']))[_0x63ad('0x45')](_0x31eaf6)[_0x63ad('0x22')](function(_0x9438af){return BPromise[_0x63ad('0x26')]({'id':_0x9438af['id'],'endUserType':_0x162845['moduleCreate']});});}});}function getCustomFields(_0x26863e,_0x5c37d5){var _0x2bbad9={};if(_0x26863e[_0x63ad('0x23')]>0x0){_[_0x63ad('0x46')](_0x26863e,function(_0x45acca){if(_[_0x63ad('0x47')]([_0x63ad('0x48'),_0x63ad('0x49')],_0x45acca[_0x63ad('0x3b')])&&_0x45acca[_0x63ad('0x4a')]){_0x2bbad9[_0x45acca[_0x63ad('0x4a')]]=_0x45acca[_0x63ad('0x4b')][_0x63ad('0x4c')]();}else if(_0x45acca[_0x63ad('0x3b')]===_0x63ad('0x4d')&&_0x45acca[_0x63ad('0x4e')]&&_0x45acca['idField']){_0x5c37d5[_0x45acca[_0x63ad('0x4e')]]&&(_0x2bbad9[_0x45acca[_0x63ad('0x4a')]]=_0x5c37d5[_0x45acca[_0x63ad('0x4e')]]['toString']());}else if(_0x45acca['type']===_0x63ad('0x4f')&&_0x45acca[_0x63ad('0x50')]&&_0x45acca[_0x63ad('0x50')]['name']&&_0x45acca[_0x63ad('0x4a')]){_0x5c37d5[_0x45acca[_0x63ad('0x50')][_0x63ad('0x51')]['toLowerCase']()]&&(_0x2bbad9[_0x45acca[_0x63ad('0x4a')]]=_0x5c37d5[_0x45acca[_0x63ad('0x50')]['name'][_0x63ad('0x3c')]()][_0x63ad('0x4c')]());}});}return _0x2bbad9;}function getConnection(_0x3f90d6){var _0x55c4e9=_0x3f90d6['password']['concat'](_0x3f90d6[_0x63ad('0x52')]);var _0x17a438=new jsforce[(_0x63ad('0x53'))]({'oauth2':{'loginUrl':_0x3f90d6[_0x63ad('0x54')]||_0x63ad('0x55'),'clientId':_0x3f90d6[_0x63ad('0x56')],'clientSecret':_0x3f90d6[_0x63ad('0x57')]}});return _0x17a438[_0x63ad('0x58')](_0x3f90d6[_0x63ad('0x59')],_0x55c4e9)[_0x63ad('0x22')](function(){logger['info'](_0x63ad('0x5a'));return _0x17a438;});}exports[_0x63ad('0x5b')]=function(_0x173c47,_0x37e927,_0x1e6dc6,_0x2e0941,_0x57dfed,_0x53f373){var _0x3a106c,_0x350ff8,_0x202a0f,_0x5e58f7;_0x53f373[_0x63ad('0x5c')]=intUtil[_0x63ad('0x5d')](_0x53f373[_0x63ad('0x5c')]);_0x53f373['remoteUri']=intUtil['stripTrailingSlash'](_0x53f373['remoteUri']);if(_0x57dfed&&_0x57dfed['monitor_format']){logger['info'](_0x63ad('0x5e'),_0x63ad('0x5f'));_0x37e927[_0x63ad('0x60')]=util['format'](_0x63ad('0x61'),_0x53f373[_0x63ad('0x5c')],_0x37e927['uniqueid'],md5(_0x37e927['uniqueid']));}else{_0x37e927[_0x63ad('0x60')]='';}return getConnection(_0x53f373)[_0x63ad('0x22')](function(_0x42d16a){_0x5e58f7=_0x42d16a;return getUser(_0x53f373,_0x2e0941[_0x63ad('0x62')],_0x5e58f7);})[_0x63ad('0x22')](function(_0x292508){_0x3a106c=_0x292508;return getEndUser(_0x53f373,_0x1e6dc6,_0x37e927[_0x63ad('0x63')],_0x37e927[_0x63ad('0x64')],_0x5e58f7);})[_0x63ad('0x22')](function(_0x5e2456){_0x350ff8=_0x5e2456;return getTicket(_0x53f373,_0x3a106c,_0x350ff8,_0x1e6dc6,_0x37e927,_0x1e6dc6['Fields'],_0x5e58f7,_0x63ad('0x5b'));})[_0x63ad('0x22')](function(_0x59391d){_0x202a0f=_0x59391d;logger[_0x63ad('0x1d')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x202a0f['id']);logger[_0x63ad('0x1d')](_0x63ad('0x65'),_0x202a0f['id'],_0x2e0941[_0x63ad('0x51')],_0x53f373[_0x63ad('0x3b')]);switch(_0x53f373[_0x63ad('0x3b')]){case _0x63ad('0x66'):emit(util['format'](_0x63ad('0x67'),_0x2e0941[_0x63ad('0x51')]),_0x63ad('0x68'),{'recordId':_0x202a0f['id']});break;case _0x63ad('0x69'):emit(util[_0x63ad('0x41')](_0x63ad('0x67'),_0x2e0941[_0x63ad('0x51')]),_0x63ad('0x6a'),{'uri':util[_0x63ad('0x41')](_0x63ad('0x6b'),_0x5e58f7[_0x63ad('0x6c')],_0x202a0f['id'])});break;default:logger['error']('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x63ad('0x6d')](function(_0x228e77){logger['error'](_0x63ad('0x5e'),_0x228e77);});};exports[_0x63ad('0x6e')]=function(_0x1b895b,_0x44542d,_0x43c47f,_0x4c5a01,_0xb74089,_0x5f4698,_0x2ab558){var _0x410463,_0x56fe11,_0x2da882,_0x43aa9d;_0x5f4698[_0x63ad('0x5c')]=intUtil['stripTrailingSlash'](_0x5f4698[_0x63ad('0x5c')]);_0x5f4698[_0x63ad('0x54')]=intUtil['stripTrailingSlash'](_0x5f4698[_0x63ad('0x54')]);if(_0x2ab558&&_0x2ab558['recordingFormat']&&_0x2ab558[_0x63ad('0x6f')]!==_0x63ad('0x70')){logger['info'](_0x63ad('0x71'),_0x63ad('0x5f'));_0x44542d[_0x63ad('0x60')]=util[_0x63ad('0x41')](_0x63ad('0x61'),_0x5f4698['serverUrl'],_0x44542d[_0x63ad('0x72')],md5(_0x44542d[_0x63ad('0x72')]));}return getConnection(_0x5f4698)['then'](function(_0x223a80){_0x43aa9d=_0x223a80;return getUser(_0x5f4698,_0x4c5a01[_0x63ad('0x62')],_0x43aa9d);})['then'](function(_0x4e6105){_0x410463=_0x4e6105;return getEndUser(_0x5f4698,_0x43c47f,_0x44542d['destcalleridname'],_0x44542d[_0x63ad('0x73')],_0x43aa9d);})[_0x63ad('0x22')](function(_0xc49b31){_0x56fe11=_0xc49b31;return getTicket(_0x5f4698,_0x410463,_0x56fe11,_0x43c47f,_0x44542d,_0x43c47f[_0x63ad('0x74')],_0x43aa9d,_0x63ad('0x6e'));})['then'](function(_0x38ff68){_0x2da882=_0x38ff68;logger[_0x63ad('0x1d')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2da882['id']);logger[_0x63ad('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2da882['id'],_0x4c5a01[_0x63ad('0x51')],_0x5f4698[_0x63ad('0x3b')]);switch(_0x5f4698[_0x63ad('0x3b')]){case'integrationTab':emit(util['format'](_0x63ad('0x67'),_0x4c5a01['name']),_0x63ad('0x68'),{'recordId':_0x2da882['id']});break;case _0x63ad('0x69'):emit(util[_0x63ad('0x41')](_0x63ad('0x67'),_0x4c5a01[_0x63ad('0x51')]),_0x63ad('0x6a'),{'uri':util['format']('%s/%s/e',_0x43aa9d['instanceUrl'],_0x2da882['id'])});break;default:logger[_0x63ad('0x75')](_0x63ad('0x71'),_0x63ad('0x76'));}})[_0x63ad('0x6d')](function(_0x533df7){logger[_0x63ad('0x75')]('[OUTBOUND]',_0x533df7);});};exports[_0x63ad('0x77')]=function(_0xe45fcf,_0x328bbe,_0x4f3fbb,_0x5eb466,_0x3694bf,_0x55fa1e){var _0x336eb7,_0x155e8a,_0x48bfbe,_0x1338a7;_0x55fa1e['serverUrl']=intUtil[_0x63ad('0x5d')](_0x55fa1e['serverUrl']);_0x55fa1e[_0x63ad('0x54')]=intUtil['stripTrailingSlash'](_0x55fa1e[_0x63ad('0x54')]);if(_0x3694bf&&_0x3694bf[_0x63ad('0x78')]){logger[_0x63ad('0x1d')]('['+_0x328bbe[_0x63ad('0x79')][_0x63ad('0x7a')]()+']',_0x63ad('0x5f'));_0x328bbe[_0x63ad('0x60')]=util[_0x63ad('0x41')](_0x63ad('0x61'),_0x55fa1e[_0x63ad('0x5c')],_0x328bbe['uniqueid'],md5(_0x328bbe[_0x63ad('0x72')]));}else{_0x328bbe[_0x63ad('0x60')]='';}return getConnection(_0x55fa1e)[_0x63ad('0x22')](function(_0x57226c){_0x1338a7=_0x57226c;if(!_['isNil'](_0x5eb466)){return getUser(_0x55fa1e,_0x5eb466['name'],_0x1338a7);}else{return getUser(_0x55fa1e,null,_0x1338a7);}})['then'](function(_0xe6a180){_0x336eb7=_0xe6a180;return getEndUser(_0x55fa1e,_0x4f3fbb,_0x328bbe[_0x63ad('0x63')],_0x328bbe['calleridnum'],_0x1338a7);})['then'](function(_0x5a4a12){_0x155e8a=_0x5a4a12;return getTicket(_0x55fa1e,_0x336eb7,_0x155e8a,_0x4f3fbb,_0x328bbe,_0x4f3fbb['Fields'],_0x1338a7);})[_0x63ad('0x22')](function(_0x20fa7c){_0x48bfbe=_0x20fa7c;logger[_0x63ad('0x1d')]('['+_0x328bbe[_0x63ad('0x79')][_0x63ad('0x7a')]()+_0x63ad('0x7b'),_0x48bfbe['id']);logger[_0x63ad('0x1d')]('['+_0x328bbe[_0x63ad('0x79')][_0x63ad('0x7a')]()+_0x63ad('0x7c'),_0x55fa1e[_0x63ad('0x3b')]);})[_0x63ad('0x6d')](function(_0x142827){logger[_0x63ad('0x75')]('['+_0x328bbe[_0x63ad('0x79')][_0x63ad('0x7a')]()+']',_0x142827);});};
\ No newline at end of file
index 5856e54..71c39db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a8=['error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','string','picklist','type','customField','nameField','toLowerCase','content','toString','includes','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','Subjects','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','label_entry','incident','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xd8a8,0x12d));var _0x8d8a=function(_0x31de94,_0x1f0155){_0x31de94=_0x31de94-0x0;var _0x5cd111=_0xd8a8[_0x31de94];return _0x5cd111;};'use strict';var _=require(_0x8d8a('0x0'));var Promise=require(_0x8d8a('0x1'));var rp=require(_0x8d8a('0x2'));var util=require(_0x8d8a('0x3'));var md5=require('md5');var Redis=require(_0x8d8a('0x4'));var intUtil=require(_0x8d8a('0x5'));var config=require(_0x8d8a('0x6'));var logger=require(_0x8d8a('0x7'))('servicenow');config[_0x8d8a('0x8')]=_[_0x8d8a('0x9')](config['redis'],{'host':_0x8d8a('0xa'),'port':0x18eb});var io=require(_0x8d8a('0xb'))(new Redis(config['redis']));function getAdminUser(_0x565d4d,_0x3edfad,_0x2ee25d,_0xed765,_0x1bfdfd,_0x2751e5){return new Promise(function(_0x111c75,_0x442597){var _0x850e88={'method':_0x8d8a('0xc'),'uri':_0xed765+_0x8d8a('0xd')+'&'+_0x1bfdfd+'&'+_0x2751e5,'auth':_0x3edfad,'json':!![]};return rp(_0x850e88)[_0x8d8a('0xe')](function(_0x2469e8){if(_0x2469e8[_0x8d8a('0xf')][_0x8d8a('0x10')]>0x0){_0x2ee25d[_0x8d8a('0x11')]=_0x2469e8['result'][0x0][_0x8d8a('0x12')];}logger[_0x8d8a('0x13')]('['+[_0x565d4d[_0x8d8a('0x14')]()]+_0x8d8a('0x15'),_0x2ee25d);_0x111c75(_0x2ee25d);})[_0x8d8a('0x16')](function(_0x5ac758){logger[_0x8d8a('0x17')]('['+[_0x565d4d['toUpperCase']()]+']',_0x5ac758[_0x8d8a('0x18')]);_0x442597(_0x5ac758['message']);});});}function getUser(_0x4831b5,_0x3f16ba,_0x5d9381,_0x4c0680,_0x3a4d85){return function(_0x254e82){logger[_0x8d8a('0x13')]('['+[_0x4831b5[_0x8d8a('0x14')]()]+_0x8d8a('0x19'),_0x254e82);return new Promise(function(_0x20649d,_0x3afa46){if(intUtil[_0x8d8a('0x1a')](_0x254e82[_0x8d8a('0x1b')])){var _0x5d8812={'method':'GET','uri':_0x5d9381+_0x8d8a('0x1c')+_0x254e82['userEmail']+'&'+_0x4c0680+'&'+_0x3a4d85,'auth':_0x3f16ba,'json':!![]};logger[_0x8d8a('0x13')]('['+[_0x4831b5[_0x8d8a('0x14')]()]+_0x8d8a('0x1d'),_0x5d8812);return rp(_0x5d8812)[_0x8d8a('0xe')](function(_0xc51be2){logger[_0x8d8a('0x13')]('['+[_0x4831b5[_0x8d8a('0x14')]()]+_0x8d8a('0x1e'),_0xc51be2);if(_0xc51be2[_0x8d8a('0xf')][_0x8d8a('0x10')]>0x0&&String(_0xc51be2[_0x8d8a('0xf')][0x0]['active'])===_0x8d8a('0x1f')){_0x254e82[_0x8d8a('0x20')]=_0xc51be2[_0x8d8a('0xf')][0x0][_0x8d8a('0x12')];}else{_0x254e82[_0x8d8a('0x20')]=_0x254e82[_0x8d8a('0x11')];_0x254e82[_0x8d8a('0x1b')]=_0x254e82[_0x8d8a('0x21')];}logger[_0x8d8a('0x13')]('['+[_0x4831b5['toUpperCase']()]+_0x8d8a('0x22'),_0x254e82);_0x20649d(_0x254e82);})[_0x8d8a('0x16')](function(_0x17e8cc){logger[_0x8d8a('0x17')]('['+[_0x4831b5[_0x8d8a('0x14')]()]+']',_0x17e8cc[_0x8d8a('0x18')]);_0x3afa46(_0x17e8cc[_0x8d8a('0x18')]);});}else{logger[_0x8d8a('0x13')]('['+[_0x4831b5[_0x8d8a('0x14')]()]+_0x8d8a('0x23'));_0x254e82[_0x8d8a('0x20')]=_0x254e82['adminId'];_0x254e82['userEmail']=_0x254e82[_0x8d8a('0x21')];_0x20649d(_0x254e82);}});};}function createEndUser(_0x5d0989,_0x49be5c,_0x4764e6,_0x43033a,_0x4bc764){logger[_0x8d8a('0x13')]('['+[_0x5d0989['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4764e6);return new Promise(function(_0x350147,_0x33e49b){var _0x563c53={'method':'POST','uri':_0x43033a+_0x8d8a('0x24')+_0x4bc764,'body':{'user_name':_0x4764e6['endUserNumber'],'roles':_0x8d8a('0x25'),'first_name':_0x4764e6[_0x8d8a('0x26')],'active':_0x8d8a('0x1f'),'date_format':'System','phone':_0x4764e6['endUserNumber']},'auth':_0x49be5c,'json':!![]};return rp(_0x563c53)[_0x8d8a('0xe')](function(_0x1a755f){logger[_0x8d8a('0x13')]('['+[_0x5d0989[_0x8d8a('0x14')]()]+_0x8d8a('0x27'),_0x1a755f['result']);_0x4764e6[_0x8d8a('0x28')]=_0x1a755f[_0x8d8a('0xf')][_0x8d8a('0x12')];_0x350147(_0x4764e6);})['catch'](function(_0x230d05){logger[_0x8d8a('0x17')]('['+[_0x5d0989['toUpperCase']()]+']',_0x230d05[_0x8d8a('0x18')]);_0x33e49b(_0x230d05[_0x8d8a('0x18')]);});});}function getEndUser(_0x29fe49,_0x71a685,_0x24b46d,_0x3f55a9,_0x41af42){return function(_0x402d23){logger[_0x8d8a('0x13')]('['+[_0x29fe49[_0x8d8a('0x14')]()]+_0x8d8a('0x29'),_0x402d23);return new Promise(function(_0x321aa6,_0x30e2ea){var _0x4131fa={'method':_0x8d8a('0xc'),'uri':_0x24b46d+_0x8d8a('0x2a')+_0x402d23[_0x8d8a('0x26')]+'&'+_0x3f55a9+'&'+_0x41af42,'auth':_0x71a685,'json':!![]};return rp(_0x4131fa)[_0x8d8a('0xe')](function(_0x10afdd){if(_0x10afdd['result'][_0x8d8a('0x10')]>0x0){_0x402d23[_0x8d8a('0x28')]=_0x10afdd['result'][0x0][_0x8d8a('0x12')];logger['info']('['+[_0x29fe49[_0x8d8a('0x14')]()]+_0x8d8a('0x2b'),_0x402d23);_0x321aa6(_0x402d23);}else{return createEndUser(_0x29fe49,_0x71a685,_0x402d23,_0x24b46d,_0x3f55a9)['then'](function(_0x38b8d5){logger[_0x8d8a('0x13')]('['+[_0x29fe49[_0x8d8a('0x14')]()]+_0x8d8a('0x2c'),_0x38b8d5);_0x321aa6(_0x38b8d5);});}})[_0x8d8a('0x16')](function(_0x4a216a){logger[_0x8d8a('0x17')]('['+[_0x29fe49[_0x8d8a('0x14')]()]+']',_0x4a216a[_0x8d8a('0x18')]);_0x30e2ea(_0x4a216a[_0x8d8a('0x18')]);});});};}function getCustomFields(_0x2cd2d4,_0x6c640c){var _0x773b8d={};if(_0x2cd2d4[_0x8d8a('0x10')]>0x0){_[_0x8d8a('0x2d')](_0x2cd2d4,function(_0x1d1b69){if(_['includes']([_0x8d8a('0x2e'),_0x8d8a('0x2f')],_0x1d1b69[_0x8d8a('0x30')])&&_0x1d1b69['nameField']&&!_0x1d1b69[_0x8d8a('0x31')]){_0x773b8d[_0x1d1b69[_0x8d8a('0x32')][_0x8d8a('0x33')]()]=_0x1d1b69[_0x8d8a('0x34')][_0x8d8a('0x35')]();}else if(_[_0x8d8a('0x36')]([_0x8d8a('0x2e'),'picklist'],_0x1d1b69['type'])&&_0x1d1b69[_0x8d8a('0x37')]&&_0x1d1b69[_0x8d8a('0x31')]){_0x773b8d[_0x1d1b69[_0x8d8a('0x37')][_0x8d8a('0x33')]()]=_0x1d1b69[_0x8d8a('0x34')][_0x8d8a('0x35')]();}else if(_0x1d1b69[_0x8d8a('0x30')]===_0x8d8a('0x38')&&_0x1d1b69[_0x8d8a('0x39')]&&_0x1d1b69['idField']&&_0x1d1b69[_0x8d8a('0x31')]){_0x773b8d[_0x1d1b69[_0x8d8a('0x37')]['toLowerCase']()]=_0x6c640c[_0x1d1b69[_0x8d8a('0x39')]][_0x8d8a('0x35')]();}else if(_0x1d1b69[_0x8d8a('0x30')]===_0x8d8a('0x3a')&&_0x1d1b69[_0x8d8a('0x3b')]&&_0x1d1b69[_0x8d8a('0x3b')][_0x8d8a('0x3c')]&&_0x1d1b69[_0x8d8a('0x37')]&&_0x1d1b69['customField']){_0x773b8d[_0x1d1b69[_0x8d8a('0x37')][_0x8d8a('0x33')]()]=_0x6c640c[_0x1d1b69['Variable'][_0x8d8a('0x3c')][_0x8d8a('0x33')]()][_0x8d8a('0x35')]();}});}return _0x773b8d;}function getTicket(_0x4d6d31,_0x207a89,_0x18f39b,_0x56fd8e,_0xbc8f9b,_0x593164){return function(_0x1e5deb){logger['info']('['+[_0x4d6d31[_0x8d8a('0x14')]()]+_0x8d8a('0x3d'),_0x1e5deb);return new Promise(function(_0x13a6c9,_0x141382){var _0x169e8a=_0x4d6d31[_0x8d8a('0x33')]()===_0x8d8a('0x3e')?_0x1e5deb[_0x8d8a('0x20')]:_0x1e5deb[_0x8d8a('0x28')];var _0x3bf17e={'method':_0x8d8a('0x3f'),'uri':_0x18f39b+'incident'+'?'+_0x593164,'body':Object[_0x8d8a('0x40')]({},{'active':_0x8d8a('0x1f'),'caller_id':_0x169e8a,'assigned_to':_0x1e5deb['userId'],'short_description':intUtil['getString'](_0x56fd8e[_0x8d8a('0x41')],_0xbc8f9b,'\x20'),'description':intUtil['getString'](_0x56fd8e['Descriptions'],_0xbc8f9b,'\x0a')},getCustomFields(_0x56fd8e[_0x8d8a('0x42')],_0xbc8f9b)),'auth':_0x207a89,'json':!![]};return rp(_0x3bf17e)['then'](function(_0x35007c){logger[_0x8d8a('0x13')]('['+[_0x4d6d31[_0x8d8a('0x14')]()]+_0x8d8a('0x43'),_0x35007c[_0x8d8a('0xf')]);_0x1e5deb[_0x8d8a('0x44')]=_0x35007c[_0x8d8a('0xf')][_0x8d8a('0x12')];_0x1e5deb[_0x8d8a('0x45')]=_0x35007c[_0x8d8a('0xf')][_0x8d8a('0x46')];logger[_0x8d8a('0x13')]('['+[_0x4d6d31[_0x8d8a('0x14')]()]+_0x8d8a('0x47'),_0x1e5deb);_0x13a6c9(_0x1e5deb);})['catch'](function(_0x40db87){logger[_0x8d8a('0x17')]('['+[_0x4d6d31[_0x8d8a('0x14')]()]+']',_0x40db87[_0x8d8a('0x18')]);_0x141382(_0x40db87[_0x8d8a('0x18')]);});});};}function createRemoteTag(_0x2a0dac,_0x36e94d,_0x5c1cff,_0x36981c){return new Promise(function(_0x33a858,_0x52959c){var _0x5292ef={'method':'POST','uri':_0x5c1cff+_0x8d8a('0x48')+'?'+_0x36981c,'body':{'short_description':_0x2a0dac,'global':!![],'active':!![],'name':_0x2a0dac},'auth':_0x36e94d,'json':!![]};return rp(_0x5292ef)[_0x8d8a('0xe')](function(_0x47c380){var _0x1ce3e8=_0x47c380[_0x8d8a('0xf')][_0x8d8a('0x12')];_0x33a858(_0x1ce3e8);});});}function getRemoteTag(_0x551d2a,_0x763bf5,_0x5830de,_0x29acc4,_0x57c149){return new Promise(function(_0x537e77,_0x4bdd22){var _0x13634f={'method':'GET','uri':_0x5830de+_0x8d8a('0x48')+'?sysparm_query=name%3D'+_0x551d2a+'&'+_0x29acc4,'auth':_0x763bf5,'json':!![]};return rp(_0x13634f)[_0x8d8a('0xe')](function(_0x238a48){if(_0x238a48[_0x8d8a('0xf')][_0x8d8a('0x10')]>0x0){var _0x2842fb=_0x238a48['result'][0x0]['sys_id'];_0x537e77(_0x2842fb);}else{return createRemoteTag(_0x551d2a,_0x763bf5,_0x5830de,_0x29acc4)[_0x8d8a('0xe')](function(_0xe30380){_0x537e77(_0xe30380);});}});});}function assignTagToIncident(_0x7dcfdc,_0x21f0be,_0x472101,_0x4deffc,_0x22b783){return new Promise(function(_0x45253a,_0x150de5){var _0x514535={'method':_0x8d8a('0x3f'),'uri':_0x472101+_0x8d8a('0x49')+'?'+_0x22b783,'body':{'label':_0x7dcfdc,'table':_0x8d8a('0x4a'),'id_type':_0x8d8a('0x4b'),'table_key':_0x4deffc[_0x8d8a('0x44')],'title':_0x8d8a('0x4c')+_0x4deffc['ticketNumber'],'id_display':_0x4deffc['ticketNumber']},'auth':_0x21f0be,'json':!![]};return rp(_0x514535)[_0x8d8a('0xe')](function(_0x5297e3){_0x45253a();})[_0x8d8a('0x16')](function(){_0x45253a();});});}function manageTags(_0x56e954,_0x394fe3,_0x2d1e3e,_0x586222,_0x37e6b,_0x1233b3,_0x151be0){return new Promise(function(_0x182008,_0x289f1f){var _0x40c9d0=[];_0x394fe3[_0x8d8a('0x2d')](function(_0x1cc707){_0x40c9d0[_0x8d8a('0x4d')](getRemoteTag(_0x1cc707,_0x2d1e3e,_0x586222,_0x1233b3,_0x151be0));});return Promise[_0x8d8a('0x4e')](_0x40c9d0)[_0x8d8a('0xe')](function(_0x1dc7a3){if(_0x1dc7a3[_0x8d8a('0x10')]){logger[_0x8d8a('0x13')]('['+[_0x56e954[_0x8d8a('0x14')]()]+_0x8d8a('0x4f'),_0x1dc7a3);var _0x2f81fe=[];_0x1dc7a3[_0x8d8a('0x2d')](function(_0x357e2f){_0x2f81fe[_0x8d8a('0x4d')](assignTagToIncident(_0x357e2f,_0x2d1e3e,_0x586222,_0x37e6b,_0x1233b3));});return Promise['all'](_0x2f81fe)['then'](function(){_0x182008();})[_0x8d8a('0x16')](function(){_0x182008();});}else{_0x182008();}});});}function getTags(_0xbde957,_0x202ea5,_0x25ed17,_0x2b548a,_0x2e4847,_0x39d1e7){return function(_0x56fd64){return new Promise(function(_0x199107,_0x5ee57f){var _0x1672d5=[];var _0x265819=_0x2b548a['Tags'];if(_0x265819&&_0x265819['length']>0x0){_0x1672d5=_['map'](_0x265819,'name');}if(_0x1672d5[_0x8d8a('0x10')]>0x0){return manageTags(_0xbde957,_0x1672d5,_0x202ea5,_0x25ed17,_0x56fd64,_0x2e4847,_0x39d1e7)['then'](function(){_0x199107(_0x56fd64);});}else{_0x199107(_0x56fd64);}});};}function emit(_0x821c60,_0x3738d8,_0x199a1e){var _0x4147a3='%26sysparm_record_target%3Dincident'+_0x8d8a('0x50')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x8d8a('0x51');var _0x3b9ce2={'uri':_0x821c60+_0x8d8a('0x52')+_0x199a1e+_0x4147a3};io['to'](util[_0x8d8a('0x53')](_0x8d8a('0x54'),_0x3738d8))[_0x8d8a('0x55')](_0x8d8a('0x56'),_0x3b9ce2);}exports['cs']=function(_0x93d53d,_0x55eb43,_0x24cac3,_0x34e87e,_0xcc31b6,_0x2f64be,_0x5b4ff9,_0x3ddf39){var _0x25d99b={};var _0x5d97c0={'user':_0x2f64be[_0x8d8a('0x57')],'pass':_0x2f64be[_0x8d8a('0x58')]};var _0x254aa6=_0x8d8a('0x59');var _0x5cafd2='sysparm_display_value=true';_0x2f64be[_0x8d8a('0x5a')]=intUtil[_0x8d8a('0x5b')](_0x2f64be[_0x8d8a('0x5a')]);_0x2f64be['serverUrl']=intUtil[_0x8d8a('0x5b')](_0x2f64be[_0x8d8a('0x5c')]);var _0x26697e=util['format'](_0x8d8a('0x5d'),_0x2f64be[_0x8d8a('0x5a')]);_0x25d99b['userEmail']=!_['isNil'](_0x34e87e)?_0x34e87e[_0x8d8a('0x5e')]:null;_0x25d99b[_0x8d8a('0x21')]=_0x2f64be[_0x8d8a('0x5e')];_0x25d99b[_0x8d8a('0x26')]=_0x3ddf39[_0x8d8a('0x33')]()===_0x8d8a('0x3e')?_0x55eb43[_0x8d8a('0x5f')]:_0x55eb43['calleridnum'];_0x25d99b[_0x8d8a('0x60')]=_0x3ddf39===_0x8d8a('0x61')||_0x3ddf39===_0x8d8a('0x62')?_0x8d8a('0x61'):'outbound';var _0x5f540a=util[_0x8d8a('0x53')](_0x8d8a('0x63'),_0x2f64be['serverUrl'],_0x55eb43[_0x8d8a('0x64')],md5(_0x55eb43['uniqueid']));if(_0xcc31b6&&_0xcc31b6['monitor_format']){logger['info']('[QUEUE]',_0x8d8a('0x65'));_0x55eb43[_0x8d8a('0x66')]=_0x5f540a;}else if(_0x5b4ff9&&_0x5b4ff9[_0x8d8a('0x67')]&&_0x5b4ff9[_0x8d8a('0x67')]!=='none'){logger['info']('[OUTBOUND]',_0x8d8a('0x65'));_0x55eb43[_0x8d8a('0x66')]=_0x5f540a;}else{_0x55eb43['recordingURL']='';}return getAdminUser(_0x3ddf39,_0x5d97c0,_0x25d99b,_0x26697e,_0x5cafd2,_0x254aa6)['then'](getUser(_0x3ddf39,_0x5d97c0,_0x26697e,_0x5cafd2,_0x254aa6))['then'](getEndUser(_0x3ddf39,_0x5d97c0,_0x26697e,_0x5cafd2,_0x254aa6))[_0x8d8a('0xe')](getTicket(_0x3ddf39,_0x5d97c0,_0x26697e,_0x24cac3,_0x55eb43,_0x5cafd2))[_0x8d8a('0xe')](function(_0x35eab5){logger[_0x8d8a('0x13')](util[_0x8d8a('0x53')]('The\x20ticket\x20ID\x20is:\x20%s',_0x35eab5['ticketId']));logger['info'](util['format'](_0x8d8a('0x68'),_0x3ddf39));if(_0x3ddf39!==_0x8d8a('0x62')){logger[_0x8d8a('0x13')]('['+[_0x3ddf39[_0x8d8a('0x14')]()]+']',_0x8d8a('0x69'));emit(_0x2f64be['remoteUri'],_0x34e87e[_0x8d8a('0x3c')],_0x35eab5[_0x8d8a('0x44')]);}})[_0x8d8a('0x16')](function(_0x301b7b){logger[_0x8d8a('0x17')]('['+[_0x3ddf39[_0x8d8a('0x14')]()]+_0x8d8a('0x6a'),util[_0x8d8a('0x6b')](_0x301b7b,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x2048=['user:%s','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','catch','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','variableName','customVariable','Variable','name','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format'];(function(_0x233f43,_0x600ccb){var _0x3059d4=function(_0x3673e3){while(--_0x3673e3){_0x233f43['push'](_0x233f43['shift']());}};_0x3059d4(++_0x600ccb);}(_0x2048,0xf7));var _0x8204=function(_0x4ff939,_0x5f54ea){_0x4ff939=_0x4ff939-0x0;var _0x3f8ba8=_0x2048[_0x4ff939];return _0x3f8ba8;};'use strict';var _=require(_0x8204('0x0'));var Promise=require(_0x8204('0x1'));var rp=require('request-promise');var util=require(_0x8204('0x2'));var md5=require('md5');var Redis=require(_0x8204('0x3'));var intUtil=require(_0x8204('0x4'));var config=require(_0x8204('0x5'));var logger=require(_0x8204('0x6'))(_0x8204('0x7'));config[_0x8204('0x8')]=_[_0x8204('0x9')](config['redis'],{'host':_0x8204('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8204('0x8')]));function getAdminUser(_0x49dcf1,_0x1c53e1,_0x1a3494,_0x5e58ec,_0xd97106,_0x240542){return new Promise(function(_0x275c8a,_0x3a1b27){var _0x35c6fd={'method':_0x8204('0xb'),'uri':_0x5e58ec+_0x8204('0xc')+'&'+_0xd97106+'&'+_0x240542,'auth':_0x1c53e1,'json':!![]};return rp(_0x35c6fd)['then'](function(_0x3c5a4d){if(_0x3c5a4d[_0x8204('0xd')][_0x8204('0xe')]>0x0){_0x1a3494[_0x8204('0xf')]=_0x3c5a4d['result'][0x0][_0x8204('0x10')];}logger[_0x8204('0x11')]('['+[_0x49dcf1[_0x8204('0x12')]()]+'],\x20getAdminUser\x20crm',_0x1a3494);_0x275c8a(_0x1a3494);})[_0x8204('0x13')](function(_0x1d54d4){logger['error']('['+[_0x49dcf1[_0x8204('0x12')]()]+']',_0x1d54d4['message']);_0x3a1b27(_0x1d54d4[_0x8204('0x14')]);});});}function getUser(_0x3bb6ba,_0x1feb99,_0x145fb1,_0x1ad6a8,_0x3e35f2){return function(_0x4e60ef){logger[_0x8204('0x11')]('['+[_0x3bb6ba['toUpperCase']()]+_0x8204('0x15'),_0x4e60ef);return new Promise(function(_0x1022b1,_0x2135ae){if(intUtil[_0x8204('0x16')](_0x4e60ef[_0x8204('0x17')])){var _0xb22be={'method':_0x8204('0xb'),'uri':_0x145fb1+_0x8204('0x18')+_0x4e60ef[_0x8204('0x17')]+'&'+_0x1ad6a8+'&'+_0x3e35f2,'auth':_0x1feb99,'json':!![]};logger['info']('['+[_0x3bb6ba[_0x8204('0x12')]()]+_0x8204('0x19'),_0xb22be);return rp(_0xb22be)[_0x8204('0x1a')](function(_0x4374c4){logger[_0x8204('0x11')]('['+[_0x3bb6ba[_0x8204('0x12')]()]+_0x8204('0x1b'),_0x4374c4);if(_0x4374c4[_0x8204('0xd')][_0x8204('0xe')]>0x0&&String(_0x4374c4[_0x8204('0xd')][0x0]['active'])===_0x8204('0x1c')){_0x4e60ef[_0x8204('0x1d')]=_0x4374c4[_0x8204('0xd')][0x0]['sys_id'];}else{_0x4e60ef[_0x8204('0x1d')]=_0x4e60ef[_0x8204('0xf')];_0x4e60ef[_0x8204('0x17')]=_0x4e60ef[_0x8204('0x1e')];}logger[_0x8204('0x11')]('['+[_0x3bb6ba['toUpperCase']()]+_0x8204('0x1f'),_0x4e60ef);_0x1022b1(_0x4e60ef);})[_0x8204('0x13')](function(_0x42ef33){logger[_0x8204('0x20')]('['+[_0x3bb6ba['toUpperCase']()]+']',_0x42ef33[_0x8204('0x14')]);_0x2135ae(_0x42ef33[_0x8204('0x14')]);});}else{logger[_0x8204('0x11')]('['+[_0x3bb6ba['toUpperCase']()]+_0x8204('0x21'));_0x4e60ef[_0x8204('0x1d')]=_0x4e60ef[_0x8204('0xf')];_0x4e60ef[_0x8204('0x17')]=_0x4e60ef[_0x8204('0x1e')];_0x1022b1(_0x4e60ef);}});};}function createEndUser(_0x5bc378,_0x474862,_0x209883,_0x4c0bdf,_0x3e4de0){logger[_0x8204('0x11')]('['+[_0x5bc378[_0x8204('0x12')]()]+_0x8204('0x22'),_0x209883);return new Promise(function(_0x4aea60,_0x2cd1e3){var _0x21e560={'method':_0x8204('0x23'),'uri':_0x4c0bdf+_0x8204('0x24')+_0x3e4de0,'body':{'user_name':_0x209883[_0x8204('0x25')],'roles':'user','first_name':_0x209883[_0x8204('0x25')],'active':_0x8204('0x1c'),'date_format':'System','phone':_0x209883[_0x8204('0x25')]},'auth':_0x474862,'json':!![]};return rp(_0x21e560)['then'](function(_0x3c6ed7){logger[_0x8204('0x11')]('['+[_0x5bc378[_0x8204('0x12')]()]+_0x8204('0x26'),_0x3c6ed7[_0x8204('0xd')]);_0x209883[_0x8204('0x27')]=_0x3c6ed7[_0x8204('0xd')][_0x8204('0x10')];_0x4aea60(_0x209883);})[_0x8204('0x13')](function(_0x488c1c){logger[_0x8204('0x20')]('['+[_0x5bc378[_0x8204('0x12')]()]+']',_0x488c1c[_0x8204('0x14')]);_0x2cd1e3(_0x488c1c[_0x8204('0x14')]);});});}function getEndUser(_0xbf180a,_0x20d30c,_0x32bd9,_0x5521d8,_0x4ec77b){return function(_0x301a06){logger[_0x8204('0x11')]('['+[_0xbf180a['toUpperCase']()]+_0x8204('0x28'),_0x301a06);return new Promise(function(_0x22f180,_0xc5a04e){var _0x24a1bb={'method':_0x8204('0xb'),'uri':_0x32bd9+_0x8204('0x29')+_0x301a06[_0x8204('0x25')]+'&'+_0x5521d8+'&'+_0x4ec77b,'auth':_0x20d30c,'json':!![]};return rp(_0x24a1bb)[_0x8204('0x1a')](function(_0x1335eb){if(_0x1335eb['result']['length']>0x0){_0x301a06['endUserId']=_0x1335eb[_0x8204('0xd')][0x0][_0x8204('0x10')];logger[_0x8204('0x11')]('['+[_0xbf180a['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x301a06);_0x22f180(_0x301a06);}else{return createEndUser(_0xbf180a,_0x20d30c,_0x301a06,_0x32bd9,_0x5521d8)[_0x8204('0x1a')](function(_0x224e0f){logger['info']('['+[_0xbf180a['toUpperCase']()]+_0x8204('0x2a'),_0x224e0f);_0x22f180(_0x224e0f);});}})[_0x8204('0x13')](function(_0x9618c8){logger[_0x8204('0x20')]('['+[_0xbf180a[_0x8204('0x12')]()]+']',_0x9618c8['message']);_0xc5a04e(_0x9618c8[_0x8204('0x14')]);});});};}function getCustomFields(_0x348959,_0x47ff4c){var _0x17b10d={};if(_0x348959['length']>0x0){_[_0x8204('0x2b')](_0x348959,function(_0x150046){if(_['includes']([_0x8204('0x2c'),_0x8204('0x2d')],_0x150046[_0x8204('0x2e')])&&_0x150046[_0x8204('0x2f')]&&!_0x150046[_0x8204('0x30')]){_0x17b10d[_0x150046[_0x8204('0x2f')][_0x8204('0x31')]()]=_0x150046[_0x8204('0x32')][_0x8204('0x33')]();}else if(_[_0x8204('0x34')]([_0x8204('0x2c'),'picklist'],_0x150046['type'])&&_0x150046['idField']&&_0x150046[_0x8204('0x30')]){_0x17b10d[_0x150046[_0x8204('0x35')][_0x8204('0x31')]()]=_0x150046['content'][_0x8204('0x33')]();}else if(_0x150046[_0x8204('0x2e')]==='variable'&&_0x150046['variableName']&&_0x150046[_0x8204('0x35')]&&_0x150046[_0x8204('0x30')]){_0x17b10d[_0x150046['idField'][_0x8204('0x31')]()]=_0x47ff4c[_0x150046[_0x8204('0x36')]][_0x8204('0x33')]();}else if(_0x150046[_0x8204('0x2e')]===_0x8204('0x37')&&_0x150046['Variable']&&_0x150046[_0x8204('0x38')][_0x8204('0x39')]&&_0x150046[_0x8204('0x35')]&&_0x150046[_0x8204('0x30')]){_0x17b10d[_0x150046[_0x8204('0x35')]['toLowerCase']()]=_0x47ff4c[_0x150046['Variable']['name']['toLowerCase']()][_0x8204('0x33')]();}});}return _0x17b10d;}function getTicket(_0x3467c4,_0x4335e1,_0x1f0e4f,_0x2dfcf2,_0x556d35,_0x42f6bc){return function(_0x50e277){logger[_0x8204('0x11')]('['+[_0x3467c4[_0x8204('0x12')]()]+']\x20getTicket\x20input\x20crm',_0x50e277);return new Promise(function(_0x391372,_0xc22365){var _0x4ddeca=_0x3467c4[_0x8204('0x31')]()==='outbound'?_0x50e277[_0x8204('0x1d')]:_0x50e277[_0x8204('0x27')];var _0x311817={'method':_0x8204('0x23'),'uri':_0x1f0e4f+_0x8204('0x3a')+'?'+_0x42f6bc,'body':Object['assign']({},{'active':_0x8204('0x1c'),'caller_id':_0x4ddeca,'assigned_to':_0x50e277[_0x8204('0x1d')],'short_description':intUtil[_0x8204('0x3b')](_0x2dfcf2[_0x8204('0x3c')],_0x556d35,'\x20'),'description':intUtil[_0x8204('0x3b')](_0x2dfcf2[_0x8204('0x3d')],_0x556d35,'\x0a')},getCustomFields(_0x2dfcf2[_0x8204('0x3e')],_0x556d35)),'auth':_0x4335e1,'json':!![]};return rp(_0x311817)[_0x8204('0x1a')](function(_0x14569a){logger[_0x8204('0x11')]('['+[_0x3467c4['toUpperCase']()]+_0x8204('0x3f'),_0x14569a['result']);_0x50e277[_0x8204('0x40')]=_0x14569a['result'][_0x8204('0x10')];_0x50e277[_0x8204('0x41')]=_0x14569a[_0x8204('0xd')][_0x8204('0x42')];logger['info']('['+[_0x3467c4[_0x8204('0x12')]()]+']\x20getTicket\x20crm',_0x50e277);_0x391372(_0x50e277);})['catch'](function(_0x90ec2d){logger[_0x8204('0x20')]('['+[_0x3467c4[_0x8204('0x12')]()]+']',_0x90ec2d[_0x8204('0x14')]);_0xc22365(_0x90ec2d['message']);});});};}function createRemoteTag(_0x51a501,_0x2c58d7,_0x635ba7,_0x1c244f){return new Promise(function(_0x2162ad,_0x5bcc1f){var _0x35c153={'method':'POST','uri':_0x635ba7+_0x8204('0x43')+'?'+_0x1c244f,'body':{'short_description':_0x51a501,'global':!![],'active':!![],'name':_0x51a501},'auth':_0x2c58d7,'json':!![]};return rp(_0x35c153)[_0x8204('0x1a')](function(_0x3d2d7e){var _0x23c970=_0x3d2d7e[_0x8204('0xd')]['sys_id'];_0x2162ad(_0x23c970);});});}function getRemoteTag(_0x82817c,_0x2558f7,_0x59b2f5,_0x3ce078,_0x2353b6){return new Promise(function(_0x172d9b,_0x35c92f){var _0x475d24={'method':'GET','uri':_0x59b2f5+'label'+_0x8204('0x44')+_0x82817c+'&'+_0x3ce078,'auth':_0x2558f7,'json':!![]};return rp(_0x475d24)['then'](function(_0x10349b){if(_0x10349b[_0x8204('0xd')]['length']>0x0){var _0x2e1c61=_0x10349b[_0x8204('0xd')][0x0]['sys_id'];_0x172d9b(_0x2e1c61);}else{return createRemoteTag(_0x82817c,_0x2558f7,_0x59b2f5,_0x3ce078)[_0x8204('0x1a')](function(_0x102611){_0x172d9b(_0x102611);});}});});}function assignTagToIncident(_0x3a2a63,_0x40ab24,_0x4817b8,_0x35f61c,_0x50da04){return new Promise(function(_0x57d6fb,_0x495e66){var _0x231ba6={'method':'POST','uri':_0x4817b8+_0x8204('0x45')+'?'+_0x50da04,'body':{'label':_0x3a2a63,'table':_0x8204('0x3a'),'id_type':'Incident','table_key':_0x35f61c[_0x8204('0x40')],'title':_0x8204('0x46')+_0x35f61c[_0x8204('0x41')],'id_display':_0x35f61c['ticketNumber']},'auth':_0x40ab24,'json':!![]};return rp(_0x231ba6)[_0x8204('0x1a')](function(_0x27fd98){_0x57d6fb();})['catch'](function(){_0x57d6fb();});});}function manageTags(_0x2dda24,_0x32a0b0,_0x38b94a,_0x414761,_0xb2dfa9,_0x1ec4b7,_0x3d76e){return new Promise(function(_0x4cc77e,_0x4f8579){var _0x689eae=[];_0x32a0b0['forEach'](function(_0x3746e6){_0x689eae[_0x8204('0x47')](getRemoteTag(_0x3746e6,_0x38b94a,_0x414761,_0x1ec4b7,_0x3d76e));});return Promise[_0x8204('0x48')](_0x689eae)[_0x8204('0x1a')](function(_0x100d44){if(_0x100d44[_0x8204('0xe')]){logger[_0x8204('0x11')]('['+[_0x2dda24[_0x8204('0x12')]()]+_0x8204('0x49'),_0x100d44);var _0x19f6bb=[];_0x100d44[_0x8204('0x2b')](function(_0xbe0f06){_0x19f6bb['push'](assignTagToIncident(_0xbe0f06,_0x38b94a,_0x414761,_0xb2dfa9,_0x1ec4b7));});return Promise['all'](_0x19f6bb)[_0x8204('0x1a')](function(){_0x4cc77e();})['catch'](function(){_0x4cc77e();});}else{_0x4cc77e();}});});}function getTags(_0x385116,_0x54ec4e,_0x15be74,_0x660321,_0x1f23a3,_0x1b730c){return function(_0x37826c){return new Promise(function(_0x399b5c,_0x4c7111){var _0x166357=[];var _0x137f7e=_0x660321[_0x8204('0x4a')];if(_0x137f7e&&_0x137f7e[_0x8204('0xe')]>0x0){_0x166357=_['map'](_0x137f7e,'name');}if(_0x166357[_0x8204('0xe')]>0x0){return manageTags(_0x385116,_0x166357,_0x54ec4e,_0x15be74,_0x37826c,_0x1f23a3,_0x1b730c)[_0x8204('0x1a')](function(){_0x399b5c(_0x37826c);});}else{_0x399b5c(_0x37826c);}});};}function emit(_0x568987,_0x273c2c,_0x375f5c){var _0x1eef4d='%26sysparm_record_target%3Dincident'+_0x8204('0x4b')+_0x8204('0x4c')+_0x8204('0x4d');var _0xa9da8c={'uri':_0x568987+_0x8204('0x4e')+_0x375f5c+_0x1eef4d};io['to'](util[_0x8204('0x4f')](_0x8204('0x50'),_0x273c2c))['emit'](_0x8204('0x51'),_0xa9da8c);}exports['cs']=function(_0x15989a,_0x37f613,_0x1a0629,_0x23f97a,_0x807731,_0x5c3b59,_0x47a953,_0x39c72b){var _0x50f945={};var _0xcdee00={'user':_0x5c3b59[_0x8204('0x52')],'pass':_0x5c3b59[_0x8204('0x53')]};var _0x5f14a5=_0x8204('0x54');var _0x1314ad='sysparm_display_value=true';_0x5c3b59[_0x8204('0x55')]=intUtil[_0x8204('0x56')](_0x5c3b59['remoteUri']);_0x5c3b59['serverUrl']=intUtil[_0x8204('0x56')](_0x5c3b59[_0x8204('0x57')]);var _0x44af3e=util[_0x8204('0x4f')](_0x8204('0x58'),_0x5c3b59[_0x8204('0x55')]);_0x50f945['userEmail']=!_[_0x8204('0x59')](_0x23f97a)?_0x23f97a[_0x8204('0x5a')]:null;_0x50f945[_0x8204('0x1e')]=_0x5c3b59[_0x8204('0x5a')];_0x50f945['endUserNumber']=_0x39c72b[_0x8204('0x31')]()===_0x8204('0x5b')?_0x37f613[_0x8204('0x5c')]:_0x37f613[_0x8204('0x5d')];_0x50f945[_0x8204('0x5e')]=_0x39c72b===_0x8204('0x5f')||_0x39c72b===_0x8204('0x60')?_0x8204('0x5f'):'outbound';var _0xc581ee=util['format'](_0x8204('0x61'),_0x5c3b59[_0x8204('0x57')],_0x37f613['uniqueid'],md5(_0x37f613[_0x8204('0x62')]));if(_0x807731&&_0x807731[_0x8204('0x63')]){logger[_0x8204('0x11')](_0x8204('0x64'),'Recording\x20is\x20enabled!');_0x37f613[_0x8204('0x65')]=_0xc581ee;}else if(_0x47a953&&_0x47a953['recordingFormat']&&_0x47a953[_0x8204('0x66')]!=='none'){logger[_0x8204('0x11')](_0x8204('0x67'),_0x8204('0x68'));_0x37f613[_0x8204('0x65')]=_0xc581ee;}else{_0x37f613[_0x8204('0x65')]='';}return getAdminUser(_0x39c72b,_0xcdee00,_0x50f945,_0x44af3e,_0x1314ad,_0x5f14a5)[_0x8204('0x1a')](getUser(_0x39c72b,_0xcdee00,_0x44af3e,_0x1314ad,_0x5f14a5))[_0x8204('0x1a')](getEndUser(_0x39c72b,_0xcdee00,_0x44af3e,_0x1314ad,_0x5f14a5))[_0x8204('0x1a')](getTicket(_0x39c72b,_0xcdee00,_0x44af3e,_0x1a0629,_0x37f613,_0x1314ad))[_0x8204('0x1a')](function(_0x19be00){logger[_0x8204('0x11')](util[_0x8204('0x4f')](_0x8204('0x69'),_0x19be00[_0x8204('0x40')]));logger[_0x8204('0x11')](util[_0x8204('0x4f')]('call\x20direction:\x20%s',_0x39c72b));if(_0x39c72b!==_0x8204('0x60')){logger['info']('['+[_0x39c72b[_0x8204('0x12')]()]+']',_0x8204('0x6a'));emit(_0x5c3b59['remoteUri'],_0x23f97a[_0x8204('0x39')],_0x19be00[_0x8204('0x40')]);}})[_0x8204('0x13')](function(_0x36c4d1){logger['error']('['+[_0x39c72b[_0x8204('0x12')]()]+_0x8204('0x6b'),util[_0x8204('0x6c')](_0x36c4d1,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 96e4179..03eae55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf85=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','trigger:browser:url','%s/service/v4_1/rest.php','toUpperCase','isNil','Inbound','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','socket.io-emitter','POST','info','Creating\x20new\x20ticket...','name','getString','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','length','variableName','push','idField','set_entry','JSON','format','apiKey','toString','base64','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Enduser\x20created.','debug','[HTTP]','merge','forEach','type','string','nameField','toLowerCase','content','custom_fields','variable','customVariable','Variable','customField','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','serverUrl','stripTrailingSlash'];(function(_0x204f31,_0x1d9b04){var _0x4c0106=function(_0x48154e){while(--_0x48154e){_0x204f31['push'](_0x204f31['shift']());}};_0x4c0106(++_0x1d9b04);}(_0xaf85,0x18e));var _0x5af8=function(_0x4216ba,_0x5739c5){_0x4216ba=_0x4216ba-0x0;var _0x2592ca=_0xaf85[_0x4216ba];return _0x2592ca;};'use strict';var _=require(_0x5af8('0x0'));var rp=require(_0x5af8('0x1'));var BPromise=require(_0x5af8('0x2'));var md5=require(_0x5af8('0x3'));var util=require(_0x5af8('0x4'));var Redis=require(_0x5af8('0x5'));var intUtil=require(_0x5af8('0x6'));var config=require(_0x5af8('0x7'));var logger=require(_0x5af8('0x8'))('sugarcrm');config['redis']=_[_0x5af8('0x9')](config[_0x5af8('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x5af8('0xb'))(new Redis(config[_0x5af8('0xa')]));var def={'method':_0x5af8('0xc'),'json':!![]};function emit(_0x385c74,_0x3c9118,_0x3e4475){io['to'](_0x385c74)['emit'](_0x3c9118,_0x3e4475);}function getTicket(_0x5e2eca,_0x23aa81,_0x4ccb17,_0x50d63e,_0x51043e,_0x188072,_0xc79dd,_0x10c602){logger[_0x5af8('0xd')](_0x5af8('0xe'));var _0x538f5a=new Date();var _0x8a0d22=[{'name':_0x5af8('0xf'),'value':intUtil[_0x5af8('0x10')](_0x50d63e['Subjects'],_0x51043e,'\x20')},{'name':_0x5af8('0x11'),'value':_0x23aa81['id']},{'name':_0x5af8('0x12'),'value':_0x23aa81['id']},{'name':_0x5af8('0x13'),'value':intUtil['getString'](_0x50d63e[_0x5af8('0x14')],_0x51043e,'\x0a')},{'name':_0x5af8('0x15'),'value':_0x538f5a[_0x5af8('0x16')]()[_0x5af8('0x17')](0x0,0x13)[_0x5af8('0x18')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x5af8('0x19'),'value':'15'},{'name':_0x5af8('0x1a'),'value':_0x4ccb17['id']},{'name':_0x5af8('0x1b'),'value':_0x5af8('0x1c')},{'name':_0x5af8('0x1d'),'value':_0x4ccb17[_0x5af8('0xf')]},{'name':'direction','value':_0x10c602}];if(_0x188072[_0x5af8('0x1e')]){_['forEach'](_0x188072,function(_0x4918cb){if(_0x51043e[_0x4918cb[_0x5af8('0x1f')]]){_0x8a0d22[_0x5af8('0x20')]({'name':_0x4918cb[_0x5af8('0x21')],'value':_0x51043e[_0x4918cb['variableName']]});}});}return request({'form':{'method':_0x5af8('0x22'),'input_type':_0x5af8('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xc79dd['id'],'module_name':'Calls','name_value_list':_0x8a0d22})}});}function getAuth(_0x39bb29){return util[_0x5af8('0x24')]('Basic\x20%s',new Buffer(_0x39bb29[_0x5af8('0x25')]+':X')[_0x5af8('0x26')](_0x5af8('0x27')));}function getServerInfo(_0xc5af92){return request({'form':{'method':'get_server_info','input_type':_0x5af8('0x23'),'response_type':_0x5af8('0x23'),'rest_data':JSON[_0x5af8('0x28')]({'session':_0xc5af92['id']})}});}function getUser(_0x2f04d7,_0x446f4b,_0x26052e){if(!_['isNil'](_0x446f4b)){logger[_0x5af8('0xd')](_0x5af8('0x29'),_0x446f4b);return request({'form':{'method':_0x5af8('0x2a'),'input_type':_0x5af8('0x23'),'response_type':_0x5af8('0x23'),'rest_data':JSON[_0x5af8('0x28')]({'session':_0x26052e['id'],'module_name':_0x5af8('0x2b'),'query':util[_0x5af8('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x446f4b),'order_by':'','offset':'0','select_fields':['id',_0x5af8('0xf'),_0x5af8('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5af8('0x2d')](function(_0x2111db){if(_0x2111db['entry_list'][_0x5af8('0x1e')]){var _0x3fb905=_[_0x5af8('0x2e')](_0x2111db[_0x5af8('0x2f')],function(_0x59c738){return _0x59c738[_0x5af8('0x30')]['user_name'][_0x5af8('0x31')]===_0x446f4b;});if(_0x3fb905){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x3fb905[_0x5af8('0x30')]['id'][_0x5af8('0x31')],'name':_0x3fb905[_0x5af8('0x30')][_0x5af8('0xf')][_0x5af8('0x31')]});}}logger[_0x5af8('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x5af8('0x32')]({'id':_0x26052e[_0x5af8('0x30')]['user_id'][_0x5af8('0x31')],'name':_0x26052e['name_value_list'][_0x5af8('0x2c')][_0x5af8('0x31')]});});}else{logger[_0x5af8('0xd')](_0x5af8('0x33'));return BPromise[_0x5af8('0x32')]({'id':_0x26052e[_0x5af8('0x30')][_0x5af8('0x34')][_0x5af8('0x31')],'name':_0x26052e['name_value_list'][_0x5af8('0x2c')][_0x5af8('0x31')]});}}function getEndUser(_0x1f7504,_0x1f5be2,_0x3b8b72,_0x2320a4){logger['info'](_0x5af8('0x35'),_0x3b8b72);return request({'form':{'method':'get_entry_list','input_type':_0x5af8('0x23'),'response_type':_0x5af8('0x23'),'rest_data':JSON[_0x5af8('0x28')]({'session':_0x2320a4['id'],'module_name':_0x5af8('0x1c'),'query':util[_0x5af8('0x24')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x3b8b72),'order_by':'','offset':'0','select_fields':['id','name',_0x5af8('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5af8('0x2d')](function(_0x2424ac){if(_0x2424ac['entry_list'][_0x5af8('0x1e')]){var _0xb097ba=_[_0x5af8('0x2e')](_0x2424ac[_0x5af8('0x2f')],function(_0x4fa488){return _0x4fa488['name_value_list']['phone_home'][_0x5af8('0x31')]===_0x3b8b72;});if(_0xb097ba){logger[_0x5af8('0xd')](_0x5af8('0x37'));return BPromise[_0x5af8('0x32')]({'id':_0xb097ba[_0x5af8('0x30')]['id'][_0x5af8('0x31')],'name':_0xb097ba[_0x5af8('0x30')][_0x5af8('0xf')]['value'],'phone':_0xb097ba[_0x5af8('0x30')][_0x5af8('0x36')]['value']});}}else{logger['info'](_0x5af8('0x38'));return request({'form':{'method':_0x5af8('0x22'),'input_type':_0x5af8('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x2320a4['id'],'module_name':'Contacts','name_value_list':[{'name':_0x5af8('0x39'),'value':_0x1f5be2!==_0x5af8('0x3a')?_0x1f5be2:util[_0x5af8('0x24')]('Caller\x20-\x20%s',_0x3b8b72)},{'name':'phone_home','value':_0x3b8b72}]})}})[_0x5af8('0x2d')](function(_0x1cedf1){logger['info'](_0x5af8('0x3b'));return BPromise[_0x5af8('0x32')]({'id':_0x1cedf1['id'],'name':_0x1cedf1[_0x5af8('0x2f')][_0x5af8('0x39')][_0x5af8('0x31')],'phone':_0x1cedf1[_0x5af8('0x2f')]['phone_home'][_0x5af8('0x31')]});});}});}function request(_0x18b97b){logger[_0x5af8('0x3c')](_0x5af8('0x3d'),JSON['stringify'](_0x18b97b));return rp(_[_0x5af8('0x3e')](def,_0x18b97b));}function getTags(_0x5589a0,_0xf43f3a){var _0x1bd8a5=[];if(_0x5589a0&&_0x5589a0['length']>0x0){_0x1bd8a5=_['map'](_0x5589a0,_0xf43f3a);}return _0x1bd8a5;}function getCustomFields(_0x3783e0,_0x1a7821){var _0x58c1fa=[];var _0x2f6425={'custom_fields':[]};if(_0x3783e0[_0x5af8('0x1e')]>0x0){_[_0x5af8('0x3f')](_0x3783e0,function(_0x4f6349){if(_0x4f6349[_0x5af8('0x40')]===_0x5af8('0x41')&&_0x4f6349['nameField']&&!_0x4f6349['customField']){_0x2f6425[_0x4f6349[_0x5af8('0x42')][_0x5af8('0x43')]()]=_0x4f6349[_0x5af8('0x44')][_0x5af8('0x26')]();}else if(_0x4f6349['type']===_0x5af8('0x41')&&_0x4f6349[_0x5af8('0x21')]&&_0x4f6349['customField']){_0x2f6425[_0x5af8('0x45')][_0x5af8('0x20')]({'id':_0x4f6349['idField'],'value':_0x4f6349['content'][_0x5af8('0x26')]()});}else if(_0x4f6349[_0x5af8('0x40')]===_0x5af8('0x46')&&_0x4f6349[_0x5af8('0x1f')]&&_0x4f6349[_0x5af8('0x21')]&&_0x4f6349['customField']){_0x1a7821[_0x4f6349['variableName']]&&_0x2f6425[_0x5af8('0x45')][_0x5af8('0x20')]({'id':_0x4f6349[_0x5af8('0x21')],'value':_0x1a7821[_0x4f6349[_0x5af8('0x1f')]]['toString']()});}else if(_0x4f6349['type']===_0x5af8('0x47')&&_0x4f6349[_0x5af8('0x48')]&&_0x4f6349[_0x5af8('0x48')]['name']&&_0x4f6349[_0x5af8('0x21')]&&_0x4f6349[_0x5af8('0x49')]){_0x1a7821[_0x4f6349['Variable'][_0x5af8('0xf')][_0x5af8('0x43')]()]&&_0x2f6425['custom_fields'][_0x5af8('0x20')]({'id':_0x4f6349[_0x5af8('0x21')],'value':_0x1a7821[_0x4f6349[_0x5af8('0x48')][_0x5af8('0xf')][_0x5af8('0x43')]()][_0x5af8('0x26')]()});}});}return _0x2f6425;}function getConnection(_0x577243){return request({'method':_0x5af8('0xc'),'form':{'method':'login','input_type':_0x5af8('0x23'),'response_type':_0x5af8('0x23'),'rest_data':JSON[_0x5af8('0x28')]({'user_auth':{'user_name':_0x577243[_0x5af8('0x4a')],'password':_0x577243[_0x5af8('0x4b')],'encryption':_0x5af8('0x4c')},'application':_0x5af8('0x4d')})}})[_0x5af8('0x2d')](function(_0x4eeee7){var _0x54cb76=_0x4eeee7;if(_0x54cb76['id']){def[_0x5af8('0x4e')]=_0x54cb76['id'];return BPromise[_0x5af8('0x32')](_0x54cb76);}else{throw new Error(util[_0x5af8('0x24')](_0x5af8('0x4f'),_0x577243['id']));}});}function setRelationship(_0x5e6606,_0x928874,_0x307c0f,_0x582c22){return request({'form':{'method':_0x5af8('0x50'),'input_type':'JSON','response_type':_0x5af8('0x23'),'rest_data':JSON[_0x5af8('0x28')]({'session':_0x5e6606['id'],'module_name':_0x5af8('0x51'),'module_id':_0x307c0f['id'],'link_field_name':_0x582c22,'related_ids':[_0x928874['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5af8('0x52')]=function(_0x1504bf,_0x3231de,_0x25e476,_0x530343,_0xa41b16,_0x2a5d77){var _0x5245ef,_0x1c6e56,_0x198764,_0x123b33;_0x2a5d77[_0x5af8('0x53')]=intUtil['stripTrailingSlash'](_0x2a5d77['remoteUri']);_0x2a5d77[_0x5af8('0x54')]=intUtil[_0x5af8('0x55')](_0x2a5d77[_0x5af8('0x54')]);def['uri']=util[_0x5af8('0x24')]('%s/service/v4_1/rest.php',_0x2a5d77[_0x5af8('0x53')]);if(_0xa41b16&&_0xa41b16[_0x5af8('0x56')]){logger['info'](_0x5af8('0x57'),_0x5af8('0x58'));_0x3231de[_0x5af8('0x59')]=util[_0x5af8('0x24')](_0x5af8('0x5a'),_0x2a5d77[_0x5af8('0x54')],_0x3231de[_0x5af8('0x5b')],md5(_0x3231de[_0x5af8('0x5b')]));}else{_0x3231de[_0x5af8('0x59')]='';}return getConnection(_0x2a5d77)[_0x5af8('0x2d')](function(_0x3f0a0b){_0x123b33=_0x3f0a0b;return getUser(_0x2a5d77,_0x530343[_0x5af8('0xf')],_0x123b33);})[_0x5af8('0x2d')](function(_0x217b51){_0x5245ef=_0x217b51;logger[_0x5af8('0xd')]('The\x20User\x20ID\x20is:',_0x5245ef['id']);return getEndUser(_0x2a5d77,_0x3231de[_0x5af8('0x5c')],_0x3231de[_0x5af8('0x5d')],_0x123b33);})[_0x5af8('0x2d')](function(_0x31053){_0x1c6e56=_0x31053;logger[_0x5af8('0xd')](_0x5af8('0x5e'),_0x1c6e56['id']);return getTicket(_0x2a5d77,_0x5245ef,_0x1c6e56,_0x25e476,_0x3231de,_0x25e476[_0x5af8('0x5f')],_0x123b33,'Inbound');})[_0x5af8('0x2d')](function(_0xfb903c){_0x198764=_0xfb903c;logger['info'](_0x5af8('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x198764['id']);return setRelationship(_0x123b33,_0x5245ef,_0x198764,'users');})[_0x5af8('0x2d')](function(){return setRelationship(_0x123b33,_0x1c6e56,_0x198764,'contacts');})[_0x5af8('0x2d')](function(){return getServerInfo(_0x123b33);})[_0x5af8('0x2d')](function(_0x53e670){var _0x49faea=parseInt(_0x53e670[_0x5af8('0x61')][_0x5af8('0x62')](0x0));var _0x5e9ab6=util[_0x5af8('0x24')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x2a5d77[_0x5af8('0x53')],_0x198764['id']);if(_0x49faea>0x6){_0x5e9ab6=util[_0x5af8('0x24')](_0x5af8('0x63'),_0x2a5d77[_0x5af8('0x53')],_0x198764['id']);}logger['info']('[QUEUE]',_0x5af8('0x64'));emit(util[_0x5af8('0x24')](_0x5af8('0x65'),_0x530343[_0x5af8('0xf')]),'trigger:browser:url',{'uri':_0x5e9ab6});})[_0x5af8('0x66')](function(_0x49d253){logger[_0x5af8('0x67')](_0x5af8('0x57'),JSON['stringify'](_0x49d253));});};exports[_0x5af8('0x68')]=function(_0xfb2cfa,_0x413a9b,_0x5599be,_0x3e4a9e,_0x25c9d7,_0x34cca7,_0x4cec4e){var _0x484796,_0x2d2035,_0x3edb81,_0x1742fe;_0x34cca7['remoteUri']=intUtil['stripTrailingSlash'](_0x34cca7['remoteUri']);_0x34cca7[_0x5af8('0x54')]=intUtil['stripTrailingSlash'](_0x34cca7[_0x5af8('0x54')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x34cca7[_0x5af8('0x53')]);if(_0x4cec4e&&_0x4cec4e[_0x5af8('0x69')]&&_0x4cec4e[_0x5af8('0x69')]!==_0x5af8('0x6a')){logger[_0x5af8('0xd')](_0x5af8('0x6b'),_0x5af8('0x58'));_0x413a9b[_0x5af8('0x59')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x34cca7['serverUrl'],_0x413a9b[_0x5af8('0x5b')],md5(_0x413a9b[_0x5af8('0x5b')]));}return getConnection(_0x34cca7)['then'](function(_0x5f7d0a){_0x1742fe=_0x5f7d0a;return getUser(_0x34cca7,_0x3e4a9e[_0x5af8('0xf')],_0x1742fe);})[_0x5af8('0x2d')](function(_0x43973f){_0x484796=_0x43973f;logger[_0x5af8('0xd')](_0x5af8('0x6c'),_0x484796['id']);return getEndUser(_0x34cca7,_0x413a9b['destcalleridname'],_0x413a9b[_0x5af8('0x6d')],_0x1742fe);})[_0x5af8('0x2d')](function(_0xec899){_0x2d2035=_0xec899;logger[_0x5af8('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2d2035['id']);return getTicket(_0x34cca7,_0x484796,_0x2d2035,_0x5599be,_0x413a9b,_0x5599be['Fields'],_0x1742fe,_0x5af8('0x6e'));})[_0x5af8('0x2d')](function(_0x44d12e){_0x3edb81=_0x44d12e;logger[_0x5af8('0xd')](_0x5af8('0x60'));logger['info'](_0x5af8('0x6f'),_0x3edb81['id']);return setRelationship(_0x1742fe,_0x484796,_0x3edb81,_0x5af8('0x70'));})[_0x5af8('0x2d')](function(){return setRelationship(_0x1742fe,_0x2d2035,_0x3edb81,_0x5af8('0x71'));})[_0x5af8('0x2d')](function(){return getServerInfo(_0x1742fe);})[_0x5af8('0x2d')](function(_0x136e2e){var _0x550d01=parseInt(_0x136e2e[_0x5af8('0x61')][_0x5af8('0x62')](0x0));var _0x5b81ff=util[_0x5af8('0x24')](_0x5af8('0x72'),_0x34cca7[_0x5af8('0x53')],_0x3edb81['id']);if(_0x550d01>0x6){_0x5b81ff=util[_0x5af8('0x24')](_0x5af8('0x63'),_0x34cca7['remoteUri'],_0x3edb81['id']);}logger[_0x5af8('0xd')](_0x5af8('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x5af8('0x24')]('user:%s',_0x3e4a9e[_0x5af8('0xf')]),_0x5af8('0x73'),{'uri':_0x5b81ff});})['catch'](function(_0x13f3ea){logger[_0x5af8('0x67')](_0x5af8('0x6b'),JSON[_0x5af8('0x28')](_0x13f3ea));});};exports['unmanaged']=function(_0x2585cc,_0x3d508e,_0x5bbfd8,_0xc400ba,_0xd527fe,_0x54bfbc){var _0x4cfd06,_0x42081e,_0xd91751,_0x4761b9;_0x54bfbc[_0x5af8('0x53')]=intUtil['stripTrailingSlash'](_0x54bfbc[_0x5af8('0x53')]);_0x54bfbc[_0x5af8('0x54')]=intUtil[_0x5af8('0x55')](_0x54bfbc[_0x5af8('0x54')]);def['uri']=util[_0x5af8('0x24')](_0x5af8('0x74'),_0x54bfbc[_0x5af8('0x53')]);if(_0xd527fe&&_0xd527fe[_0x5af8('0x56')]){logger[_0x5af8('0xd')]('['+_0x3d508e['lastevent'][_0x5af8('0x75')]()+']',_0x5af8('0x58'));_0x3d508e[_0x5af8('0x59')]=util[_0x5af8('0x24')](_0x5af8('0x5a'),_0x54bfbc[_0x5af8('0x54')],_0x3d508e['uniqueid'],md5(_0x3d508e['uniqueid']));}else{_0x3d508e['recordingURL']='';}return getConnection(_0x54bfbc)[_0x5af8('0x2d')](function(_0xc2b1cb){_0x4761b9=_0xc2b1cb;if(!_[_0x5af8('0x76')](_0xc400ba)){return getUser(_0x54bfbc,_0xc400ba[_0x5af8('0xf')],_0x4761b9);}else{return getUser(_0x54bfbc,null,_0x4761b9);}})[_0x5af8('0x2d')](function(_0x57481e){_0x4cfd06=_0x57481e;logger['info']('The\x20User\x20ID\x20is:',_0x4cfd06['id']);return getEndUser(_0x54bfbc,_0x3d508e[_0x5af8('0x5c')],_0x3d508e[_0x5af8('0x5d')],_0x4761b9);})['then'](function(_0x29dc8){_0x42081e=_0x29dc8;logger[_0x5af8('0xd')](_0x5af8('0x5e'),_0x42081e['id']);return getTicket(_0x54bfbc,_0x4cfd06,_0x42081e,_0x5bbfd8,_0x3d508e,_0x5bbfd8['Fields'],_0x4761b9,_0x5af8('0x77'));})[_0x5af8('0x2d')](function(_0x8dcfe7){_0xd91751=_0x8dcfe7;logger['info'](_0x5af8('0x60'));logger[_0x5af8('0xd')](_0x5af8('0x6f'),_0xd91751['id']);return setRelationship(_0x4761b9,_0x4cfd06,_0xd91751,_0x5af8('0x70'));})[_0x5af8('0x2d')](function(){return setRelationship(_0x4761b9,_0x42081e,_0xd91751,'contacts');})[_0x5af8('0x2d')](function(){return getServerInfo(_0x4761b9);})[_0x5af8('0x66')](function(_0x587ee7){logger[_0x5af8('0x67')]('['+_0x3d508e[_0x5af8('0x78')][_0x5af8('0x75')]()+']',JSON[_0x5af8('0x28')](_0x587ee7));});};
\ No newline at end of file
+var _0xc1a5=['uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','catch','error','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','calleridnum','lodash','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','stringify','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','find','name_value_list','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','debug','[HTTP]','merge','map','string','customField','nameField','content','type','variable','custom_fields','customVariable','Variable','toLowerCase','login','username','sessionID','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','recordingURL'];(function(_0x310da2,_0x181858){var _0x12bc21=function(_0x559fe7){while(--_0x559fe7){_0x310da2['push'](_0x310da2['shift']());}};_0x12bc21(++_0x181858);}(_0xc1a5,0x93));var _0x5c1a=function(_0x55ee8e,_0xe2a7d){_0x55ee8e=_0x55ee8e-0x0;var _0xce6ba7=_0xc1a5[_0x55ee8e];return _0xce6ba7;};'use strict';var _=require(_0x5c1a('0x0'));var rp=require('request-promise');var BPromise=require(_0x5c1a('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x5c1a('0x2'));var intUtil=require(_0x5c1a('0x3'));var config=require(_0x5c1a('0x4'));var logger=require(_0x5c1a('0x5'))(_0x5c1a('0x6'));config[_0x5c1a('0x7')]=_['defaults'](config[_0x5c1a('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var def={'method':_0x5c1a('0x8'),'json':!![]};function emit(_0x3cf306,_0x198e14,_0x488805){io['to'](_0x3cf306)[_0x5c1a('0x9')](_0x198e14,_0x488805);}function getTicket(_0x4e87a4,_0x377554,_0x11d985,_0x50b379,_0x3af639,_0x1bd803,_0x15909b,_0x567d04){logger[_0x5c1a('0xa')](_0x5c1a('0xb'));var _0x1f5774=new Date();var _0x4ea214=[{'name':_0x5c1a('0xc'),'value':intUtil[_0x5c1a('0xd')](_0x50b379[_0x5c1a('0xe')],_0x3af639,'\x20')},{'name':_0x5c1a('0xf'),'value':_0x377554['id']},{'name':_0x5c1a('0x10'),'value':_0x377554['id']},{'name':_0x5c1a('0x11'),'value':intUtil[_0x5c1a('0xd')](_0x50b379['Descriptions'],_0x3af639,'\x0a')},{'name':'date_start','value':_0x1f5774[_0x5c1a('0x12')]()[_0x5c1a('0x13')](0x0,0x13)[_0x5c1a('0x14')]('T','\x20')},{'name':_0x5c1a('0x15'),'value':'0'},{'name':_0x5c1a('0x16'),'value':'15'},{'name':'parent_id','value':_0x11d985['id']},{'name':_0x5c1a('0x17'),'value':_0x5c1a('0x18')},{'name':_0x5c1a('0x19'),'value':_0x11d985[_0x5c1a('0xc')]},{'name':_0x5c1a('0x1a'),'value':_0x567d04}];if(_0x1bd803['length']){_[_0x5c1a('0x1b')](_0x1bd803,function(_0xe9c073){if(_0x3af639[_0xe9c073[_0x5c1a('0x1c')]]){_0x4ea214[_0x5c1a('0x1d')]({'name':_0xe9c073[_0x5c1a('0x1e')],'value':_0x3af639[_0xe9c073[_0x5c1a('0x1c')]]});}});}return request({'form':{'method':_0x5c1a('0x1f'),'input_type':_0x5c1a('0x20'),'response_type':_0x5c1a('0x20'),'rest_data':JSON[_0x5c1a('0x21')]({'session':_0x15909b['id'],'module_name':'Calls','name_value_list':_0x4ea214})}});}function getAuth(_0x2f995f){return util['format'](_0x5c1a('0x22'),new Buffer(_0x2f995f[_0x5c1a('0x23')]+':X')[_0x5c1a('0x24')](_0x5c1a('0x25')));}function getServerInfo(_0x51daf6){return request({'form':{'method':_0x5c1a('0x26'),'input_type':'JSON','response_type':_0x5c1a('0x20'),'rest_data':JSON['stringify']({'session':_0x51daf6['id']})}});}function getUser(_0x14bf90,_0x2645db,_0x5fe7ee){if(!_[_0x5c1a('0x27')](_0x2645db)){logger['info'](_0x5c1a('0x28'),_0x2645db);return request({'form':{'method':_0x5c1a('0x29'),'input_type':_0x5c1a('0x20'),'response_type':_0x5c1a('0x20'),'rest_data':JSON[_0x5c1a('0x21')]({'session':_0x5fe7ee['id'],'module_name':_0x5c1a('0x2a'),'query':util[_0x5c1a('0x2b')](_0x5c1a('0x2c'),_0x2645db),'order_by':'','offset':'0','select_fields':['id',_0x5c1a('0xc'),_0x5c1a('0x2d')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x5c1a('0x2e')](function(_0x41f6bc){if(_0x41f6bc[_0x5c1a('0x2f')][_0x5c1a('0x30')]){var _0x4e1fd7=_[_0x5c1a('0x31')](_0x41f6bc['entry_list'],function(_0x547e80){return _0x547e80[_0x5c1a('0x32')][_0x5c1a('0x2d')][_0x5c1a('0x33')]===_0x2645db;});if(_0x4e1fd7){logger['info']('Agent\x20found!');return BPromise['resolve']({'id':_0x4e1fd7[_0x5c1a('0x32')]['id'][_0x5c1a('0x33')],'name':_0x4e1fd7[_0x5c1a('0x32')][_0x5c1a('0xc')]['value']});}}logger[_0x5c1a('0xa')](_0x5c1a('0x34'));return BPromise[_0x5c1a('0x35')]({'id':_0x5fe7ee['name_value_list'][_0x5c1a('0x36')]['value'],'name':_0x5fe7ee[_0x5c1a('0x32')]['user_name'][_0x5c1a('0x33')]});});}else{logger[_0x5c1a('0xa')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5fe7ee[_0x5c1a('0x32')]['user_id'][_0x5c1a('0x33')],'name':_0x5fe7ee['name_value_list'][_0x5c1a('0x2d')]['value']});}}function getEndUser(_0x24823f,_0x2014d4,_0x560cf1,_0x244249){logger['info']('Searching\x20enduser\x20with\x20phone',_0x560cf1);return request({'form':{'method':_0x5c1a('0x29'),'input_type':_0x5c1a('0x20'),'response_type':_0x5c1a('0x20'),'rest_data':JSON['stringify']({'session':_0x244249['id'],'module_name':'Contacts','query':util[_0x5c1a('0x2b')](_0x5c1a('0x37'),_0x560cf1),'order_by':'','offset':'0','select_fields':['id',_0x5c1a('0xc'),_0x5c1a('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x1d5d96){if(_0x1d5d96[_0x5c1a('0x2f')][_0x5c1a('0x30')]){var _0x376498=_['find'](_0x1d5d96['entry_list'],function(_0x1e3c68){return _0x1e3c68[_0x5c1a('0x32')][_0x5c1a('0x38')][_0x5c1a('0x33')]===_0x560cf1;});if(_0x376498){logger[_0x5c1a('0xa')](_0x5c1a('0x39'));return BPromise[_0x5c1a('0x35')]({'id':_0x376498[_0x5c1a('0x32')]['id'][_0x5c1a('0x33')],'name':_0x376498[_0x5c1a('0x32')]['name'][_0x5c1a('0x33')],'phone':_0x376498[_0x5c1a('0x32')][_0x5c1a('0x38')]['value']});}}else{logger[_0x5c1a('0xa')](_0x5c1a('0x3a'));return request({'form':{'method':_0x5c1a('0x1f'),'input_type':_0x5c1a('0x20'),'response_type':_0x5c1a('0x20'),'rest_data':JSON[_0x5c1a('0x21')]({'session':_0x244249['id'],'module_name':_0x5c1a('0x18'),'name_value_list':[{'name':_0x5c1a('0x3b'),'value':_0x2014d4!==_0x5c1a('0x3c')?_0x2014d4:util[_0x5c1a('0x2b')]('Caller\x20-\x20%s',_0x560cf1)},{'name':'phone_home','value':_0x560cf1}]})}})[_0x5c1a('0x2e')](function(_0x362a98){logger[_0x5c1a('0xa')]('Enduser\x20created.');return BPromise[_0x5c1a('0x35')]({'id':_0x362a98['id'],'name':_0x362a98[_0x5c1a('0x2f')][_0x5c1a('0x3b')][_0x5c1a('0x33')],'phone':_0x362a98['entry_list'][_0x5c1a('0x38')]['value']});});}});}function request(_0x174374){logger[_0x5c1a('0x3d')](_0x5c1a('0x3e'),JSON[_0x5c1a('0x21')](_0x174374));return rp(_[_0x5c1a('0x3f')](def,_0x174374));}function getTags(_0x4d97c9,_0x5ec7e8){var _0x3764c0=[];if(_0x4d97c9&&_0x4d97c9['length']>0x0){_0x3764c0=_[_0x5c1a('0x40')](_0x4d97c9,_0x5ec7e8);}return _0x3764c0;}function getCustomFields(_0x2c15e8,_0x1bb390){var _0x4136ed=[];var _0x4f2a57={'custom_fields':[]};if(_0x2c15e8[_0x5c1a('0x30')]>0x0){_['forEach'](_0x2c15e8,function(_0xf04761){if(_0xf04761['type']===_0x5c1a('0x41')&&_0xf04761['nameField']&&!_0xf04761[_0x5c1a('0x42')]){_0x4f2a57[_0xf04761[_0x5c1a('0x43')]['toLowerCase']()]=_0xf04761[_0x5c1a('0x44')][_0x5c1a('0x24')]();}else if(_0xf04761[_0x5c1a('0x45')]===_0x5c1a('0x41')&&_0xf04761['idField']&&_0xf04761[_0x5c1a('0x42')]){_0x4f2a57['custom_fields'][_0x5c1a('0x1d')]({'id':_0xf04761[_0x5c1a('0x1e')],'value':_0xf04761[_0x5c1a('0x44')][_0x5c1a('0x24')]()});}else if(_0xf04761['type']===_0x5c1a('0x46')&&_0xf04761['variableName']&&_0xf04761[_0x5c1a('0x1e')]&&_0xf04761['customField']){_0x1bb390[_0xf04761[_0x5c1a('0x1c')]]&&_0x4f2a57[_0x5c1a('0x47')][_0x5c1a('0x1d')]({'id':_0xf04761[_0x5c1a('0x1e')],'value':_0x1bb390[_0xf04761[_0x5c1a('0x1c')]][_0x5c1a('0x24')]()});}else if(_0xf04761[_0x5c1a('0x45')]===_0x5c1a('0x48')&&_0xf04761[_0x5c1a('0x49')]&&_0xf04761['Variable'][_0x5c1a('0xc')]&&_0xf04761[_0x5c1a('0x1e')]&&_0xf04761[_0x5c1a('0x42')]){_0x1bb390[_0xf04761[_0x5c1a('0x49')]['name']['toLowerCase']()]&&_0x4f2a57[_0x5c1a('0x47')][_0x5c1a('0x1d')]({'id':_0xf04761['idField'],'value':_0x1bb390[_0xf04761['Variable'][_0x5c1a('0xc')][_0x5c1a('0x4a')]()][_0x5c1a('0x24')]()});}});}return _0x4f2a57;}function getConnection(_0x5be753){return request({'method':'POST','form':{'method':_0x5c1a('0x4b'),'input_type':'JSON','response_type':_0x5c1a('0x20'),'rest_data':JSON[_0x5c1a('0x21')]({'user_auth':{'user_name':_0x5be753[_0x5c1a('0x4c')],'password':_0x5be753['password'],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x5c1a('0x2e')](function(_0x29f52c){var _0xb71d8d=_0x29f52c;if(_0xb71d8d['id']){def[_0x5c1a('0x4d')]=_0xb71d8d['id'];return BPromise['resolve'](_0xb71d8d);}else{throw new Error(util[_0x5c1a('0x2b')]('Account\x20%d\x20is\x20not\x20valid',_0x5be753['id']));}});}function setRelationship(_0xe4f2a0,_0x31423a,_0x3338db,_0x241166){return request({'form':{'method':'set_relationship','input_type':_0x5c1a('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0xe4f2a0['id'],'module_name':'Calls','module_id':_0x3338db['id'],'link_field_name':_0x241166,'related_ids':[_0x31423a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x5c1a('0x4e')]=function(_0x399320,_0x450d31,_0x1130fd,_0x469037,_0x2a459d,_0x5b5fdd){var _0x5c9a2a,_0xb7b46a,_0x19d9ec,_0x26417e;_0x5b5fdd[_0x5c1a('0x4f')]=intUtil[_0x5c1a('0x50')](_0x5b5fdd[_0x5c1a('0x4f')]);_0x5b5fdd[_0x5c1a('0x51')]=intUtil[_0x5c1a('0x50')](_0x5b5fdd['serverUrl']);def[_0x5c1a('0x52')]=util['format'](_0x5c1a('0x53'),_0x5b5fdd[_0x5c1a('0x4f')]);if(_0x2a459d&&_0x2a459d[_0x5c1a('0x54')]){logger[_0x5c1a('0xa')](_0x5c1a('0x55'),'Recording\x20is\x20enabled!');_0x450d31[_0x5c1a('0x56')]=util[_0x5c1a('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b5fdd[_0x5c1a('0x51')],_0x450d31[_0x5c1a('0x57')],md5(_0x450d31['uniqueid']));}else{_0x450d31[_0x5c1a('0x56')]='';}return getConnection(_0x5b5fdd)[_0x5c1a('0x2e')](function(_0x1b10d8){_0x26417e=_0x1b10d8;return getUser(_0x5b5fdd,_0x469037[_0x5c1a('0xc')],_0x26417e);})[_0x5c1a('0x2e')](function(_0x30cff3){_0x5c9a2a=_0x30cff3;logger[_0x5c1a('0xa')]('The\x20User\x20ID\x20is:',_0x5c9a2a['id']);return getEndUser(_0x5b5fdd,_0x450d31[_0x5c1a('0x58')],_0x450d31['calleridnum'],_0x26417e);})[_0x5c1a('0x2e')](function(_0x328ec9){_0xb7b46a=_0x328ec9;logger['info'](_0x5c1a('0x59'),_0xb7b46a['id']);return getTicket(_0x5b5fdd,_0x5c9a2a,_0xb7b46a,_0x1130fd,_0x450d31,_0x1130fd[_0x5c1a('0x5a')],_0x26417e,_0x5c1a('0x5b'));})[_0x5c1a('0x2e')](function(_0x1380fa){_0x19d9ec=_0x1380fa;logger[_0x5c1a('0xa')]('Ticket\x20created!');logger[_0x5c1a('0xa')](_0x5c1a('0x5c'),_0x19d9ec['id']);return setRelationship(_0x26417e,_0x5c9a2a,_0x19d9ec,_0x5c1a('0x5d'));})[_0x5c1a('0x2e')](function(){return setRelationship(_0x26417e,_0xb7b46a,_0x19d9ec,_0x5c1a('0x5e'));})['then'](function(){return getServerInfo(_0x26417e);})[_0x5c1a('0x2e')](function(_0x3fdc28){var _0x23e812=parseInt(_0x3fdc28['version'][_0x5c1a('0x5f')](0x0));var _0x489d2c=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x5b5fdd[_0x5c1a('0x4f')],_0x19d9ec['id']);if(_0x23e812>0x6){_0x489d2c=util['format'](_0x5c1a('0x60'),_0x5b5fdd[_0x5c1a('0x4f')],_0x19d9ec['id']);}logger['info']('[QUEUE]',_0x5c1a('0x61'));emit(util['format'](_0x5c1a('0x62'),_0x469037['name']),_0x5c1a('0x63'),{'uri':_0x489d2c});})['catch'](function(_0x28542f){logger['error']('[QUEUE]',JSON[_0x5c1a('0x21')](_0x28542f));});};exports[_0x5c1a('0x64')]=function(_0x32068d,_0x559f46,_0x54952a,_0x31b0c6,_0x45d6fd,_0x266ec1,_0x1776c3){var _0x1de8ae,_0xede074,_0x2102f7,_0xa28e6b;_0x266ec1['remoteUri']=intUtil[_0x5c1a('0x50')](_0x266ec1['remoteUri']);_0x266ec1[_0x5c1a('0x51')]=intUtil[_0x5c1a('0x50')](_0x266ec1[_0x5c1a('0x51')]);def['uri']=util[_0x5c1a('0x2b')](_0x5c1a('0x53'),_0x266ec1[_0x5c1a('0x4f')]);if(_0x1776c3&&_0x1776c3[_0x5c1a('0x65')]&&_0x1776c3[_0x5c1a('0x65')]!==_0x5c1a('0x66')){logger['info'](_0x5c1a('0x67'),'Recording\x20is\x20enabled!');_0x559f46[_0x5c1a('0x56')]=util[_0x5c1a('0x2b')](_0x5c1a('0x68'),_0x266ec1[_0x5c1a('0x51')],_0x559f46[_0x5c1a('0x57')],md5(_0x559f46['uniqueid']));}return getConnection(_0x266ec1)[_0x5c1a('0x2e')](function(_0x48b8bd){_0xa28e6b=_0x48b8bd;return getUser(_0x266ec1,_0x31b0c6['name'],_0xa28e6b);})[_0x5c1a('0x2e')](function(_0x2a31bb){_0x1de8ae=_0x2a31bb;logger[_0x5c1a('0xa')](_0x5c1a('0x69'),_0x1de8ae['id']);return getEndUser(_0x266ec1,_0x559f46[_0x5c1a('0x6a')],_0x559f46[_0x5c1a('0x6b')],_0xa28e6b);})['then'](function(_0x214712){_0xede074=_0x214712;logger[_0x5c1a('0xa')](_0x5c1a('0x59'),_0xede074['id']);return getTicket(_0x266ec1,_0x1de8ae,_0xede074,_0x54952a,_0x559f46,_0x54952a[_0x5c1a('0x5a')],_0xa28e6b,'Outbound');})[_0x5c1a('0x2e')](function(_0x1486c8){_0x2102f7=_0x1486c8;logger['info'](_0x5c1a('0x6c'));logger[_0x5c1a('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2102f7['id']);return setRelationship(_0xa28e6b,_0x1de8ae,_0x2102f7,_0x5c1a('0x5d'));})[_0x5c1a('0x2e')](function(){return setRelationship(_0xa28e6b,_0xede074,_0x2102f7,'contacts');})[_0x5c1a('0x2e')](function(){return getServerInfo(_0xa28e6b);})[_0x5c1a('0x2e')](function(_0x11f88d){var _0x4eb29c=parseInt(_0x11f88d['version'][_0x5c1a('0x5f')](0x0));var _0x312b86=util[_0x5c1a('0x2b')](_0x5c1a('0x6d'),_0x266ec1[_0x5c1a('0x4f')],_0x2102f7['id']);if(_0x4eb29c>0x6){_0x312b86=util[_0x5c1a('0x2b')](_0x5c1a('0x60'),_0x266ec1['remoteUri'],_0x2102f7['id']);}logger['info'](_0x5c1a('0x67'),_0x5c1a('0x61'));emit(util['format'](_0x5c1a('0x62'),_0x31b0c6[_0x5c1a('0xc')]),_0x5c1a('0x63'),{'uri':_0x312b86});})[_0x5c1a('0x6e')](function(_0x38cf93){logger[_0x5c1a('0x6f')]('[OUTBOUND]',JSON[_0x5c1a('0x21')](_0x38cf93));});};exports[_0x5c1a('0x70')]=function(_0x5099d5,_0x4dfc00,_0x11d785,_0x5d7e65,_0x4d1910,_0x515d20){var _0x32dfd5,_0x1e9b8c,_0x37f2a0,_0x23bbc6;_0x515d20['remoteUri']=intUtil[_0x5c1a('0x50')](_0x515d20[_0x5c1a('0x4f')]);_0x515d20[_0x5c1a('0x51')]=intUtil['stripTrailingSlash'](_0x515d20[_0x5c1a('0x51')]);def[_0x5c1a('0x52')]=util[_0x5c1a('0x2b')](_0x5c1a('0x53'),_0x515d20[_0x5c1a('0x4f')]);if(_0x4d1910&&_0x4d1910[_0x5c1a('0x54')]){logger['info']('['+_0x4dfc00[_0x5c1a('0x71')][_0x5c1a('0x72')]()+']',_0x5c1a('0x73'));_0x4dfc00['recordingURL']=util['format'](_0x5c1a('0x68'),_0x515d20['serverUrl'],_0x4dfc00[_0x5c1a('0x57')],md5(_0x4dfc00[_0x5c1a('0x57')]));}else{_0x4dfc00[_0x5c1a('0x56')]='';}return getConnection(_0x515d20)['then'](function(_0x3833e6){_0x23bbc6=_0x3833e6;if(!_[_0x5c1a('0x27')](_0x5d7e65)){return getUser(_0x515d20,_0x5d7e65[_0x5c1a('0xc')],_0x23bbc6);}else{return getUser(_0x515d20,null,_0x23bbc6);}})[_0x5c1a('0x2e')](function(_0x235e18){_0x32dfd5=_0x235e18;logger[_0x5c1a('0xa')](_0x5c1a('0x69'),_0x32dfd5['id']);return getEndUser(_0x515d20,_0x4dfc00['calleridname'],_0x4dfc00[_0x5c1a('0x74')],_0x23bbc6);})[_0x5c1a('0x2e')](function(_0x2177d0){_0x1e9b8c=_0x2177d0;logger[_0x5c1a('0xa')](_0x5c1a('0x59'),_0x1e9b8c['id']);return getTicket(_0x515d20,_0x32dfd5,_0x1e9b8c,_0x11d785,_0x4dfc00,_0x11d785[_0x5c1a('0x5a')],_0x23bbc6,_0x5c1a('0x5b'));})[_0x5c1a('0x2e')](function(_0x25f07b){_0x37f2a0=_0x25f07b;logger[_0x5c1a('0xa')](_0x5c1a('0x6c'));logger[_0x5c1a('0xa')](_0x5c1a('0x5c'),_0x37f2a0['id']);return setRelationship(_0x23bbc6,_0x32dfd5,_0x37f2a0,_0x5c1a('0x5d'));})[_0x5c1a('0x2e')](function(){return setRelationship(_0x23bbc6,_0x1e9b8c,_0x37f2a0,'contacts');})[_0x5c1a('0x2e')](function(){return getServerInfo(_0x23bbc6);})['catch'](function(_0x27f542){logger[_0x5c1a('0x6f')]('['+_0x4dfc00[_0x5c1a('0x71')][_0x5c1a('0x72')]()+']',JSON[_0x5c1a('0x21')](_0x27f542));});};
\ No newline at end of file
index 9bd0c52..0b3238e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6434=['variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','stripTrailingSlash','slice','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable'];(function(_0x36bf46,_0x3d8db9){var _0x1d0a72=function(_0x328e8d){while(--_0x328e8d){_0x36bf46['push'](_0x36bf46['shift']());}};_0x1d0a72(++_0x3d8db9);}(_0x6434,0x13b));var _0x4643=function(_0x10174b,_0x1d1c69){_0x10174b=_0x10174b-0x0;var _0x47f46e=_0x6434[_0x10174b];return _0x47f46e;};'use strict';var _=require(_0x4643('0x0'));var util=require(_0x4643('0x1'));exports[_0x4643('0x2')]=function(_0x1b9720,_0xe40357,_0x1040d7){var _0x3a445d=[];if(_0x1b9720[_0x4643('0x3')]>0x0){var _0x54ea6e=_[_0x4643('0x4')](_0x1b9720,['id']);for(var _0x13af6d=0x0;_0x13af6d<_0x54ea6e[_0x4643('0x3')];_0x13af6d++){var _0x25d47a=_0x54ea6e[_0x13af6d];if(_0x25d47a[_0x4643('0x5')]===_0x4643('0x6')){_0x3a445d[_0x4643('0x7')](_0x25d47a[_0x4643('0x8')]);}else if(_0x25d47a[_0x4643('0x5')]===_0x4643('0x9')&&_0x25d47a[_0x4643('0xa')]){_0xe40357[_0x25d47a['variableName']]&&_0x3a445d[_0x4643('0x7')](_0xe40357[_0x25d47a[_0x4643('0xa')]][_0x4643('0xb')]());}else if(_0x25d47a['type']===_0x4643('0xc')&&_0x25d47a[_0x4643('0xd')]&&_0x25d47a['Variable'][_0x4643('0xe')]){_0xe40357[_0x25d47a[_0x4643('0xd')][_0x4643('0xe')][_0x4643('0xf')]()]&&_0x3a445d['push'](_0xe40357[_0x25d47a[_0x4643('0xd')]['name'][_0x4643('0xf')]()][_0x4643('0xb')]());}else if(_0x25d47a[_0x4643('0x5')]===_0x4643('0x10')){if(_0x25d47a[_0x4643('0x11')]==='string'&&_0x25d47a[_0x4643('0x12')]){_0x3a445d[_0x4643('0x7')](util[_0x4643('0x13')](_0x4643('0x14'),_0x25d47a[_0x4643('0x12')],_0x25d47a['keyContent']));}else if(_0x25d47a[_0x4643('0x11')]==='variable'&&_0x25d47a[_0x4643('0xa')]&&_0x25d47a[_0x4643('0x12')]){_0xe40357[_0x25d47a[_0x4643('0xa')]]&&_0x3a445d[_0x4643('0x7')](util[_0x4643('0x13')](_0x4643('0x14'),_0x25d47a[_0x4643('0x12')],_0xe40357[_0x25d47a[_0x4643('0xa')]]));}else if(_0x25d47a['keyType']===_0x4643('0xc')&&_0x25d47a[_0x4643('0xd')]&&_0x25d47a[_0x4643('0xd')][_0x4643('0xe')]&&_0x25d47a[_0x4643('0x12')]){_0xe40357[_0x25d47a[_0x4643('0xd')][_0x4643('0xe')][_0x4643('0xf')]()]&&_0x3a445d[_0x4643('0x7')](util['format'](_0x4643('0x14'),_0x25d47a[_0x4643('0x12')],_0xe40357[_0x25d47a[_0x4643('0xd')]['name'][_0x4643('0xf')]()]));}}}}return _0x3a445d['join'](_0x1040d7);};exports[_0x4643('0x15')]=function(_0x40b66e){var _0x3360a3=_0x40b66e[_0x4643('0x16')](-0x1);if(_0x3360a3==='/'){_0x40b66e=_0x40b66e['substring'](0x0,_0x40b66e['lastIndexOf'](_0x3360a3));}return _0x40b66e;};exports['validateEmail']=function(_0x2efd79){if(!_[_0x4643('0x17')](_0x2efd79)&&_0x2efd79!==''){var _0x5e2046=/^(([^<>()\[\]\\.,;:\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 _0x5e2046[_0x4643('0x18')](String(_0x2efd79)[_0x4643('0xf')]());}else{return![];}};
\ No newline at end of file
+var _0x1a88=['string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','key','format','%s:\x20%s','keyType','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length'];(function(_0x35ef6b,_0x202c42){var _0x3ad145=function(_0x3092de){while(--_0x3092de){_0x35ef6b['push'](_0x35ef6b['shift']());}};_0x3ad145(++_0x202c42);}(_0x1a88,0xe5));var _0x81a8=function(_0x5aaed4,_0x513580){_0x5aaed4=_0x5aaed4-0x0;var _0xcbdf23=_0x1a88[_0x5aaed4];return _0xcbdf23;};'use strict';var _=require(_0x81a8('0x0'));var util=require(_0x81a8('0x1'));exports[_0x81a8('0x2')]=function(_0x4c7498,_0x37dad5,_0x2f597e){var _0x1058b6=[];if(_0x4c7498['length']>0x0){var _0x433dc5=_[_0x81a8('0x3')](_0x4c7498,['id']);for(var _0x330c75=0x0;_0x330c75<_0x433dc5[_0x81a8('0x4')];_0x330c75++){var _0x5dc094=_0x433dc5[_0x330c75];if(_0x5dc094['type']===_0x81a8('0x5')){_0x1058b6[_0x81a8('0x6')](_0x5dc094['content']);}else if(_0x5dc094[_0x81a8('0x7')]===_0x81a8('0x8')&&_0x5dc094[_0x81a8('0x9')]){_0x37dad5[_0x5dc094[_0x81a8('0x9')]]&&_0x1058b6[_0x81a8('0x6')](_0x37dad5[_0x5dc094['variableName']][_0x81a8('0xa')]());}else if(_0x5dc094[_0x81a8('0x7')]===_0x81a8('0xb')&&_0x5dc094['Variable']&&_0x5dc094[_0x81a8('0xc')][_0x81a8('0xd')]){_0x37dad5[_0x5dc094[_0x81a8('0xc')][_0x81a8('0xd')][_0x81a8('0xe')]()]&&_0x1058b6[_0x81a8('0x6')](_0x37dad5[_0x5dc094[_0x81a8('0xc')]['name'][_0x81a8('0xe')]()][_0x81a8('0xa')]());}else if(_0x5dc094[_0x81a8('0x7')]==='keyValue'){if(_0x5dc094['keyType']===_0x81a8('0x5')&&_0x5dc094[_0x81a8('0xf')]){_0x1058b6['push'](util[_0x81a8('0x10')](_0x81a8('0x11'),_0x5dc094[_0x81a8('0xf')],_0x5dc094['keyContent']));}else if(_0x5dc094['keyType']==='variable'&&_0x5dc094[_0x81a8('0x9')]&&_0x5dc094[_0x81a8('0xf')]){_0x37dad5[_0x5dc094[_0x81a8('0x9')]]&&_0x1058b6['push'](util[_0x81a8('0x10')](_0x81a8('0x11'),_0x5dc094[_0x81a8('0xf')],_0x37dad5[_0x5dc094[_0x81a8('0x9')]]));}else if(_0x5dc094[_0x81a8('0x12')]===_0x81a8('0xb')&&_0x5dc094[_0x81a8('0xc')]&&_0x5dc094['Variable'][_0x81a8('0xd')]&&_0x5dc094[_0x81a8('0xf')]){_0x37dad5[_0x5dc094[_0x81a8('0xc')][_0x81a8('0xd')][_0x81a8('0xe')]()]&&_0x1058b6[_0x81a8('0x6')](util['format'](_0x81a8('0x11'),_0x5dc094['key'],_0x37dad5[_0x5dc094[_0x81a8('0xc')][_0x81a8('0xd')][_0x81a8('0xe')]()]));}}}}return _0x1058b6['join'](_0x2f597e);};exports[_0x81a8('0x13')]=function(_0x31a50f){var _0x4e7ddd=_0x31a50f[_0x81a8('0x14')](-0x1);if(_0x4e7ddd==='/'){_0x31a50f=_0x31a50f[_0x81a8('0x15')](0x0,_0x31a50f[_0x81a8('0x16')](_0x4e7ddd));}return _0x31a50f;};exports[_0x81a8('0x17')]=function(_0x4f9d69){if(!_[_0x81a8('0x18')](_0x4f9d69)&&_0x4f9d69!==''){var _0x1fe301=/^(([^<>()\[\]\\.,;:\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 _0x1fe301[_0x81a8('0x19')](String(_0x4f9d69)[_0x81a8('0xe')]());}else{return![];}};
\ No newline at end of file
index 24c5581..360a4df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
+var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x3e3e5d,_0x1aa370){var _0x1851f4=function(_0x53be11){while(--_0x53be11){_0x3e3e5d['push'](_0x3e3e5d['shift']());}};_0x1851f4(++_0x1aa370);}(_0xe706,0xa3));var _0x6e70=function(_0x21bdd1,_0x3f7cd8){_0x21bdd1=_0x21bdd1-0x0;var _0x30514e=_0xe706[_0x21bdd1];return _0x30514e;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
index 9651175..400b223 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc137=['[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','recordingURL','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','catch','lodash','request-promise','md5','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Descriptions','Fields','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','then','Admin\x20account\x20selected.','user','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','includes','string','picklist','type','nameField','customField','toLowerCase','custom_fields','push','content','variable','variableName','idField','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized'];(function(_0x1773f6,_0x3ca5fb){var _0x4cd423=function(_0x374162){while(--_0x374162){_0x1773f6['push'](_0x1773f6['shift']());}};_0x4cd423(++_0x3ca5fb);}(_0xc137,0x14a));var _0x7c13=function(_0x37205b,_0x2c124d){_0x37205b=_0x37205b-0x0;var _0x4293e5=_0xc137[_0x37205b];return _0x4293e5;};'use strict';var _=require(_0x7c13('0x0'));var rp=require(_0x7c13('0x1'));var md5=require(_0x7c13('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x7c13('0x3'));var logger=require('../../../../config/logger')(_0x7c13('0x4'));config[_0x7c13('0x5')]=_[_0x7c13('0x6')](config[_0x7c13('0x5')],{'host':_0x7c13('0x7'),'port':0x18eb});var io=require(_0x7c13('0x8'))(new Redis(config[_0x7c13('0x5')]));function emit(_0x353411,_0x5641be,_0x2b3851){io['to'](_0x353411)[_0x7c13('0x9')](_0x5641be,_0x2b3851);}var headers={'Content-Type':'application/json','Accept':_0x7c13('0xa')};function getTicket(_0x32b654,_0x52f26e,_0x26a9e5,_0x329096,_0x5f4f75){logger['info'](_0x7c13('0xb'));return request({'uri':util['format'](_0x7c13('0xc'),_0x32b654[_0x7c13('0xd')]),'method':_0x7c13('0xe'),'body':{'ticket':_[_0x7c13('0xf')]({'requester_id':_0x26a9e5['id'],'submitter_id':_0x52f26e?_0x52f26e['id']:undefined,'assignee_id':_0x52f26e?_0x52f26e['id']:undefined,'tags':getTags(_0x329096[_0x7c13('0x10')],_0x7c13('0x11')),'subject':intUtil[_0x7c13('0x12')](_0x329096['Subjects'],_0x5f4f75,'\x20'),'description':intUtil[_0x7c13('0x12')](_0x329096[_0x7c13('0x13')],_0x5f4f75,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x329096[_0x7c13('0x13')],_0x5f4f75,'\x0a')}},getCustomFields(_0x329096[_0x7c13('0x14')],_0x5f4f75))}})['then'](function(_0x428457){logger[_0x7c13('0x15')](_0x7c13('0x16'));return _0x428457[_0x7c13('0x17')];});}function getUser(_0x9cd4c2,_0x39bdc1){if(intUtil['validateEmail'](_0x39bdc1)){logger[_0x7c13('0x15')](_0x7c13('0x18'),_0x39bdc1);return request({'uri':util[_0x7c13('0x19')](_0x7c13('0x1a'),_0x9cd4c2['remoteUri']),'qs':{'query':util[_0x7c13('0x19')](_0x7c13('0x1b'),_0x39bdc1)}})['then'](function(_0x679d58){if(_0x679d58[_0x7c13('0x1c')]){logger[_0x7c13('0x15')](_0x7c13('0x1d'));return _['find'](_0x679d58[_0x7c13('0x1e')],{'email':_0x39bdc1,'role':'agent'});}else{logger[_0x7c13('0x15')](_0x7c13('0x1f'));return request({'uri':util[_0x7c13('0x19')](_0x7c13('0x20'),_0x9cd4c2[_0x7c13('0xd')])})[_0x7c13('0x21')](function(_0x2bae59){logger[_0x7c13('0x15')](_0x7c13('0x22'));return _0x2bae59[_0x7c13('0x23')];});}});}else{logger[_0x7c13('0x15')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7c13('0x20'),_0x9cd4c2['remoteUri'])})['then'](function(_0x20a6a8){logger['info'](_0x7c13('0x22'));return _0x20a6a8[_0x7c13('0x23')];});}}function getEndUser(_0x446f16,_0x450d59,_0x5aefe8){logger[_0x7c13('0x15')]('Searching\x20enduser\x20with\x20phone',_0x5aefe8);return request({'uri':util['format'](_0x7c13('0x1a'),_0x446f16['remoteUri']),'qs':{'query':util[_0x7c13('0x19')](_0x7c13('0x24'),_0x5aefe8)}})[_0x7c13('0x21')](function(_0x687c5c){var _0x525ac0;if(_0x687c5c[_0x7c13('0x1e')][_0x7c13('0x25')]){_0x687c5c['results']=_[_0x7c13('0x26')](_0x687c5c[_0x7c13('0x1e')],{'suspended':![],'role':_0x7c13('0x27')});if(_0x687c5c[_0x7c13('0x1e')][_0x7c13('0x25')]){_0x525ac0=_[_0x7c13('0x28')](_0x687c5c['results']);}}if(_0x525ac0){logger[_0x7c13('0x15')]('Enduser\x20found!');return _0x525ac0;}else{logger['info'](_0x7c13('0x29'));return request({'uri':util['format'](_0x7c13('0x2a'),_0x446f16[_0x7c13('0xd')]),'method':'POST','body':{'user':{'role':_0x7c13('0x27'),'name':util[_0x7c13('0x19')](_0x7c13('0x2b'),_0x450d59||_0x5aefe8),'phone':_0x5aefe8}}})['then'](function(_0x451b18){logger['info'](_0x7c13('0x2c'));return _0x451b18[_0x7c13('0x23')];});}});}function getAuth(_0x5e3777){var _0x26e0df;if(_0x5e3777[_0x7c13('0x2d')]===_0x7c13('0x2e')){_0x26e0df=util[_0x7c13('0x19')](_0x7c13('0x2f'),_0x5e3777['username'],_0x5e3777['password']);}else if(_0x5e3777[_0x7c13('0x2d')]===_0x7c13('0x30')){_0x26e0df=util[_0x7c13('0x19')]('%s/token:%s',_0x5e3777['username'],_0x5e3777[_0x7c13('0x30')]);}return util[_0x7c13('0x19')](_0x7c13('0x31'),new Buffer(_0x26e0df)[_0x7c13('0x32')](_0x7c13('0x33')));}function request(_0x2562b9){logger[_0x7c13('0x34')](_0x7c13('0x35'),JSON[_0x7c13('0x36')](_0x2562b9));return rp(_[_0x7c13('0x6')](_0x2562b9,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x211b04,_0x49b11f){var _0x5ed55a=[];if(_0x211b04&&_0x211b04['length']>0x0){_0x5ed55a=_['map'](_0x211b04,_0x49b11f);}return _0x5ed55a;}function getCustomFields(_0x4b881a,_0x16f796){var _0x4a5183=[];var _0x50c1b2={'custom_fields':[]};if(_0x4b881a[_0x7c13('0x25')]>0x0){_['forEach'](_0x4b881a,function(_0xd32e14){if(_[_0x7c13('0x37')]([_0x7c13('0x38'),_0x7c13('0x39')],_0xd32e14[_0x7c13('0x3a')])&&_0xd32e14[_0x7c13('0x3b')]&&!_0xd32e14[_0x7c13('0x3c')]){_0x50c1b2[_0xd32e14[_0x7c13('0x3b')][_0x7c13('0x3d')]()]=_0xd32e14['content'][_0x7c13('0x32')]();}else if(_[_0x7c13('0x37')]([_0x7c13('0x38'),'picklist'],_0xd32e14[_0x7c13('0x3a')])&&_0xd32e14['idField']&&_0xd32e14[_0x7c13('0x3c')]){_0x50c1b2[_0x7c13('0x3e')][_0x7c13('0x3f')]({'id':_0xd32e14['idField'],'value':_0xd32e14[_0x7c13('0x40')]['toString']()});}else if(_0xd32e14[_0x7c13('0x3a')]===_0x7c13('0x41')&&_0xd32e14[_0x7c13('0x42')]&&_0xd32e14[_0x7c13('0x43')]&&_0xd32e14['customField']){_0x16f796[_0xd32e14[_0x7c13('0x42')]]&&_0x50c1b2[_0x7c13('0x3e')]['push']({'id':_0xd32e14[_0x7c13('0x43')],'value':_0x16f796[_0xd32e14['variableName']][_0x7c13('0x32')]()});}else if(_0xd32e14[_0x7c13('0x3a')]===_0x7c13('0x44')&&_0xd32e14['Variable']&&_0xd32e14[_0x7c13('0x45')][_0x7c13('0x11')]&&_0xd32e14[_0x7c13('0x43')]&&_0xd32e14['customField']){_0x16f796[_0xd32e14[_0x7c13('0x45')][_0x7c13('0x11')][_0x7c13('0x3d')]()]&&_0x50c1b2[_0x7c13('0x3e')][_0x7c13('0x3f')]({'id':_0xd32e14[_0x7c13('0x43')],'value':_0x16f796[_0xd32e14[_0x7c13('0x45')][_0x7c13('0x11')][_0x7c13('0x3d')]()][_0x7c13('0x32')]()});}});}return _0x50c1b2;}exports['queue']=function(_0x5a5a3f,_0x138ba7,_0x2380d9,_0x4b5330,_0x1e6f9a,_0x5dee9a){var _0x232fc0,_0x4ea7fb;_0x5dee9a[_0x7c13('0xd')]=intUtil[_0x7c13('0x46')](_0x5dee9a[_0x7c13('0xd')]);_0x5dee9a[_0x7c13('0x47')]=intUtil[_0x7c13('0x46')](_0x5dee9a['serverUrl']);if(_0x1e6f9a&&_0x1e6f9a[_0x7c13('0x48')]){logger[_0x7c13('0x15')](_0x7c13('0x49'),'Recording\x20is\x20enabled!');_0x138ba7['recordingURL']=util[_0x7c13('0x19')](_0x7c13('0x4a'),_0x5dee9a[_0x7c13('0x47')],_0x138ba7['uniqueid'],md5(_0x138ba7[_0x7c13('0x4b')]));}else{_0x138ba7['recordingURL']='';}headers[_0x7c13('0x4c')]=getAuth(_0x5dee9a);return getUser(_0x5dee9a,_0x4b5330[_0x7c13('0x4d')])[_0x7c13('0x21')](function(_0x471b17){_0x232fc0=_0x471b17;logger[_0x7c13('0x15')](_0x7c13('0x4e'),_0x232fc0['id']);return getEndUser(_0x5dee9a,_0x138ba7[_0x7c13('0x4f')],_0x138ba7[_0x7c13('0x50')]);})[_0x7c13('0x21')](function(_0xede4ad){_0x4ea7fb=_0xede4ad;logger[_0x7c13('0x15')](_0x7c13('0x51'),_0x4ea7fb['id']);return getTicket(_0x5dee9a,_0x232fc0,_0x4ea7fb,_0x2380d9,_0x138ba7);})['then'](function(_0x29999c){if(_0x29999c){logger['info'](_0x7c13('0x52'),_0x29999c['id']);switch(_0x5dee9a['type']){case _0x7c13('0x53'):logger[_0x7c13('0x15')](_0x7c13('0x49'),_0x7c13('0x54'));return request({'uri':util[_0x7c13('0x19')](_0x7c13('0x55'),_0x5dee9a['remoteUri'],_0x232fc0['id'],_0x29999c['id']),'method':'POST'});case _0x7c13('0x56'):logger[_0x7c13('0x15')](_0x7c13('0x49'),_0x7c13('0x57'));emit(util['format'](_0x7c13('0x58'),_0x4b5330['name']),_0x7c13('0x59'),{'uri':util[_0x7c13('0x19')](_0x7c13('0x5a'),_0x5dee9a['remoteUri'][_0x7c13('0x5b')]('/api/v2',''),_0x29999c['id'])});break;default:logger[_0x7c13('0x5c')](_0x7c13('0x49'),_0x7c13('0x5d'));}}})['catch'](function(_0x4f1c3a){logger[_0x7c13('0x5c')](_0x7c13('0x5e'),util['inspect'](_0x4f1c3a,{'showHidden':!![],'depth':null}));});};exports[_0x7c13('0x5f')]=function(_0x1564ed,_0x15634f,_0x2a0180,_0x4fb5fe,_0x222d2d,_0x420e35,_0x4c950a){var _0x5bf28b,_0x10dd8b;_0x420e35[_0x7c13('0xd')]=intUtil[_0x7c13('0x46')](_0x420e35[_0x7c13('0xd')]);_0x420e35[_0x7c13('0x47')]=intUtil[_0x7c13('0x46')](_0x420e35[_0x7c13('0x47')]);if(_0x4c950a&&_0x4c950a[_0x7c13('0x60')]&&_0x4c950a[_0x7c13('0x60')]!=='none'){logger['info'](_0x7c13('0x61'),'Recording\x20is\x20enabled!');_0x15634f[_0x7c13('0x62')]=util['format'](_0x7c13('0x4a'),_0x420e35[_0x7c13('0x47')],_0x15634f[_0x7c13('0x4b')],md5(_0x15634f[_0x7c13('0x4b')]));}headers[_0x7c13('0x4c')]=getAuth(_0x420e35);return getUser(_0x420e35,_0x4fb5fe['email'])[_0x7c13('0x21')](function(_0x2653e9){_0x5bf28b=_0x2653e9;logger[_0x7c13('0x15')](_0x7c13('0x4e'),_0x5bf28b['id']);return getEndUser(_0x420e35,_0x15634f['destcalleridname'],_0x15634f['destcalleridnum']);})[_0x7c13('0x21')](function(_0x455e9e){_0x10dd8b=_0x455e9e;logger[_0x7c13('0x15')]('The\x20Enduser\x20ID\x20is:',_0x10dd8b['id']);return getTicket(_0x420e35,_0x5bf28b,_0x10dd8b,_0x2a0180,_0x15634f);})['then'](function(_0x57580c){if(_0x57580c){logger[_0x7c13('0x15')](_0x7c13('0x52'),_0x57580c['id']);switch(_0x420e35[_0x7c13('0x3a')]){case _0x7c13('0x53'):logger['info'](_0x7c13('0x61'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0x7c13('0x55'),_0x420e35[_0x7c13('0xd')],_0x5bf28b['id'],_0x57580c['id']),'method':_0x7c13('0xe')});case _0x7c13('0x56'):logger['info']('[OUTBOUND]',_0x7c13('0x57'));emit(util[_0x7c13('0x19')](_0x7c13('0x58'),_0x4fb5fe[_0x7c13('0x11')]),'trigger:browser:url',{'uri':util[_0x7c13('0x19')](_0x7c13('0x5a'),_0x420e35[_0x7c13('0xd')][_0x7c13('0x5b')]('/api/v2',''),_0x57580c['id'])});break;default:logger[_0x7c13('0x5c')](_0x7c13('0x61'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0xdc6ee7){logger[_0x7c13('0x5c')](_0x7c13('0x63'),util[_0x7c13('0x64')](_0xdc6ee7,{'showHidden':!![],'depth':null}));});};exports[_0x7c13('0x65')]=function(_0x32a417,_0x547b2b,_0x37ac28,_0x5eae95,_0x4b05d8,_0x4eea07){var _0x246491,_0x3f10ab;_0x4eea07[_0x7c13('0xd')]=intUtil[_0x7c13('0x46')](_0x4eea07[_0x7c13('0xd')]);_0x4eea07['serverUrl']=intUtil[_0x7c13('0x46')](_0x4eea07[_0x7c13('0x47')]);if(_0x4b05d8&&_0x4b05d8[_0x7c13('0x48')]){logger[_0x7c13('0x15')]('['+_0x547b2b[_0x7c13('0x66')][_0x7c13('0x67')]()+']',_0x7c13('0x68'));_0x547b2b[_0x7c13('0x62')]=util['format'](_0x7c13('0x4a'),_0x4eea07[_0x7c13('0x47')],_0x547b2b[_0x7c13('0x4b')],md5(_0x547b2b[_0x7c13('0x4b')]));}else{_0x547b2b[_0x7c13('0x62')]='';}headers[_0x7c13('0x4c')]=getAuth(_0x4eea07);return getUser(_0x4eea07)[_0x7c13('0x21')](function(_0x4a1b82){_0x246491=_0x4a1b82;logger[_0x7c13('0x15')](_0x7c13('0x4e'),_0x246491['id']);return getEndUser(_0x4eea07,_0x547b2b['calleridname'],_0x547b2b['calleridnum']);})[_0x7c13('0x21')](function(_0x333c17){_0x3f10ab=_0x333c17;logger[_0x7c13('0x15')](_0x7c13('0x51'),_0x3f10ab['id']);return getTicket(_0x4eea07,_0x246491,_0x3f10ab,_0x37ac28,_0x547b2b);})[_0x7c13('0x21')](function(_0x5e5ac5){if(_0x5e5ac5){logger[_0x7c13('0x15')](_0x7c13('0x52'),_0x5e5ac5['id']);}})[_0x7c13('0x69')](function(_0x5e58a0){logger[_0x7c13('0x5c')]('['+_0x547b2b[_0x7c13('0x66')][_0x7c13('0x67')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x5e58a0,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x162a=['content','string','picklist','idField','custom_fields','push','variable','variableName','customField','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','calleridname','catch','toUpperCase','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','remoteUri','type:user\x20role:agent\x20email:%s','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','password','%s:%s','username','authType','token','%s/token:%s','Basic\x20%s','toString','base64','stringify','GET','includes','type','nameField'];(function(_0x453a4f,_0x1fabd8){var _0x22c46f=function(_0x705ae){while(--_0x705ae){_0x453a4f['push'](_0x453a4f['shift']());}};_0x22c46f(++_0x1fabd8);}(_0x162a,0x1e1));var _0xa162=function(_0x36d360,_0x11c118){_0x36d360=_0x36d360-0x0;var _0x39b33b=_0x162a[_0x36d360];return _0x39b33b;};'use strict';var _=require(_0xa162('0x0'));var rp=require('request-promise');var md5=require(_0xa162('0x1'));var util=require(_0xa162('0x2'));var Redis=require(_0xa162('0x3'));var intUtil=require(_0xa162('0x4'));var config=require(_0xa162('0x5'));var logger=require(_0xa162('0x6'))(_0xa162('0x7'));config[_0xa162('0x8')]=_[_0xa162('0x9')](config[_0xa162('0x8')],{'host':_0xa162('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa162('0x8')]));function emit(_0x2b8f31,_0x4ee6d4,_0x3a2acb){io['to'](_0x2b8f31)[_0xa162('0xb')](_0x4ee6d4,_0x3a2acb);}var headers={'Content-Type':_0xa162('0xc'),'Accept':'application/json'};function getTicket(_0x465858,_0x2a6161,_0x17960b,_0x1b1ef8,_0x3371de){logger[_0xa162('0xd')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xa162('0xe')](_0xa162('0xf'),_0x465858['remoteUri']),'method':_0xa162('0x10'),'body':{'ticket':_[_0xa162('0x11')]({'requester_id':_0x17960b['id'],'submitter_id':_0x2a6161?_0x2a6161['id']:undefined,'assignee_id':_0x2a6161?_0x2a6161['id']:undefined,'tags':getTags(_0x1b1ef8[_0xa162('0x12')],_0xa162('0x13')),'subject':intUtil[_0xa162('0x14')](_0x1b1ef8[_0xa162('0x15')],_0x3371de,'\x20'),'description':intUtil[_0xa162('0x14')](_0x1b1ef8['Descriptions'],_0x3371de,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa162('0x14')](_0x1b1ef8[_0xa162('0x16')],_0x3371de,'\x0a')}},getCustomFields(_0x1b1ef8[_0xa162('0x17')],_0x3371de))}})[_0xa162('0x18')](function(_0x157bf0){logger[_0xa162('0xd')](_0xa162('0x19'));return _0x157bf0['ticket'];});}function getUser(_0x3d989a,_0x5e3b20){if(intUtil[_0xa162('0x1a')](_0x5e3b20)){logger['info'](_0xa162('0x1b'),_0x5e3b20);return request({'uri':util[_0xa162('0xe')]('%s/search.json',_0x3d989a[_0xa162('0x1c')]),'qs':{'query':util[_0xa162('0xe')](_0xa162('0x1d'),_0x5e3b20)}})[_0xa162('0x18')](function(_0x1b88a6){if(_0x1b88a6[_0xa162('0x1e')]){logger[_0xa162('0xd')]('Agent\x20found!');return _[_0xa162('0x1f')](_0x1b88a6[_0xa162('0x20')],{'email':_0x5e3b20,'role':_0xa162('0x21')});}else{logger['info'](_0xa162('0x22'));return request({'uri':util[_0xa162('0xe')]('%s/users/me.json',_0x3d989a[_0xa162('0x1c')])})[_0xa162('0x18')](function(_0x72c02d){logger[_0xa162('0xd')](_0xa162('0x23'));return _0x72c02d[_0xa162('0x24')];});}});}else{logger[_0xa162('0xd')](_0xa162('0x22'));return request({'uri':util[_0xa162('0xe')](_0xa162('0x25'),_0x3d989a['remoteUri'])})['then'](function(_0x34fa02){logger['info'](_0xa162('0x23'));return _0x34fa02['user'];});}}function getEndUser(_0x5d12d8,_0x54bd5c,_0x388ec0){logger[_0xa162('0xd')](_0xa162('0x26'),_0x388ec0);return request({'uri':util[_0xa162('0xe')](_0xa162('0x27'),_0x5d12d8[_0xa162('0x1c')]),'qs':{'query':util[_0xa162('0xe')](_0xa162('0x28'),_0x388ec0)}})['then'](function(_0x405de2){var _0x3ef58e;if(_0x405de2[_0xa162('0x20')][_0xa162('0x29')]){_0x405de2[_0xa162('0x20')]=_['filter'](_0x405de2[_0xa162('0x20')],{'suspended':![],'role':_0xa162('0x2a')});if(_0x405de2[_0xa162('0x20')]['length']){_0x3ef58e=_['first'](_0x405de2[_0xa162('0x20')]);}}if(_0x3ef58e){logger[_0xa162('0xd')]('Enduser\x20found!');return _0x3ef58e;}else{logger[_0xa162('0xd')](_0xa162('0x2b'));return request({'uri':util[_0xa162('0xe')](_0xa162('0x2c'),_0x5d12d8[_0xa162('0x1c')]),'method':_0xa162('0x10'),'body':{'user':{'role':_0xa162('0x2a'),'name':util['format']('Caller\x20-\x20%s',_0x54bd5c||_0x388ec0),'phone':_0x388ec0}}})[_0xa162('0x18')](function(_0x183dbb){logger[_0xa162('0xd')]('Enduser\x20created.');return _0x183dbb[_0xa162('0x24')];});}});}function getAuth(_0x1aea5f){var _0x2727b1;if(_0x1aea5f['authType']===_0xa162('0x2d')){_0x2727b1=util['format'](_0xa162('0x2e'),_0x1aea5f[_0xa162('0x2f')],_0x1aea5f[_0xa162('0x2d')]);}else if(_0x1aea5f[_0xa162('0x30')]===_0xa162('0x31')){_0x2727b1=util[_0xa162('0xe')](_0xa162('0x32'),_0x1aea5f['username'],_0x1aea5f['token']);}return util[_0xa162('0xe')](_0xa162('0x33'),new Buffer(_0x2727b1)[_0xa162('0x34')](_0xa162('0x35')));}function request(_0x4aa16c){logger['debug']('[HTTP]',JSON[_0xa162('0x36')](_0x4aa16c));return rp(_['defaults'](_0x4aa16c,{'method':_0xa162('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x4b18b3,_0x1ef744){var _0x5ea6ea=[];if(_0x4b18b3&&_0x4b18b3['length']>0x0){_0x5ea6ea=_['map'](_0x4b18b3,_0x1ef744);}return _0x5ea6ea;}function getCustomFields(_0x363d26,_0x4de185){var _0x31fe59=[];var _0x21e5de={'custom_fields':[]};if(_0x363d26[_0xa162('0x29')]>0x0){_['forEach'](_0x363d26,function(_0x4ac877){if(_[_0xa162('0x38')](['string','picklist'],_0x4ac877[_0xa162('0x39')])&&_0x4ac877[_0xa162('0x3a')]&&!_0x4ac877['customField']){_0x21e5de[_0x4ac877[_0xa162('0x3a')]['toLowerCase']()]=_0x4ac877[_0xa162('0x3b')][_0xa162('0x34')]();}else if(_[_0xa162('0x38')]([_0xa162('0x3c'),_0xa162('0x3d')],_0x4ac877[_0xa162('0x39')])&&_0x4ac877[_0xa162('0x3e')]&&_0x4ac877['customField']){_0x21e5de[_0xa162('0x3f')][_0xa162('0x40')]({'id':_0x4ac877['idField'],'value':_0x4ac877[_0xa162('0x3b')][_0xa162('0x34')]()});}else if(_0x4ac877[_0xa162('0x39')]===_0xa162('0x41')&&_0x4ac877[_0xa162('0x42')]&&_0x4ac877[_0xa162('0x3e')]&&_0x4ac877[_0xa162('0x43')]){_0x4de185[_0x4ac877[_0xa162('0x42')]]&&_0x21e5de['custom_fields'][_0xa162('0x40')]({'id':_0x4ac877[_0xa162('0x3e')],'value':_0x4de185[_0x4ac877[_0xa162('0x42')]][_0xa162('0x34')]()});}else if(_0x4ac877[_0xa162('0x39')]===_0xa162('0x44')&&_0x4ac877[_0xa162('0x45')]&&_0x4ac877[_0xa162('0x45')][_0xa162('0x13')]&&_0x4ac877[_0xa162('0x3e')]&&_0x4ac877[_0xa162('0x43')]){_0x4de185[_0x4ac877[_0xa162('0x45')][_0xa162('0x13')][_0xa162('0x46')]()]&&_0x21e5de[_0xa162('0x3f')][_0xa162('0x40')]({'id':_0x4ac877[_0xa162('0x3e')],'value':_0x4de185[_0x4ac877[_0xa162('0x45')][_0xa162('0x13')][_0xa162('0x46')]()][_0xa162('0x34')]()});}});}return _0x21e5de;}exports[_0xa162('0x47')]=function(_0x5feef0,_0x200ac2,_0x2f7565,_0x238030,_0x5eb44d,_0x4c96ee){var _0x502a21,_0x265804;_0x4c96ee[_0xa162('0x1c')]=intUtil[_0xa162('0x48')](_0x4c96ee[_0xa162('0x1c')]);_0x4c96ee['serverUrl']=intUtil[_0xa162('0x48')](_0x4c96ee[_0xa162('0x49')]);if(_0x5eb44d&&_0x5eb44d['monitor_format']){logger['info'](_0xa162('0x4a'),'Recording\x20is\x20enabled!');_0x200ac2[_0xa162('0x4b')]=util[_0xa162('0xe')](_0xa162('0x4c'),_0x4c96ee[_0xa162('0x49')],_0x200ac2[_0xa162('0x4d')],md5(_0x200ac2[_0xa162('0x4d')]));}else{_0x200ac2[_0xa162('0x4b')]='';}headers[_0xa162('0x4e')]=getAuth(_0x4c96ee);return getUser(_0x4c96ee,_0x238030['email'])['then'](function(_0x1060af){_0x502a21=_0x1060af;logger['info'](_0xa162('0x4f'),_0x502a21['id']);return getEndUser(_0x4c96ee,_0x200ac2['calleridname'],_0x200ac2[_0xa162('0x50')]);})['then'](function(_0x5a98f1){_0x265804=_0x5a98f1;logger[_0xa162('0xd')](_0xa162('0x51'),_0x265804['id']);return getTicket(_0x4c96ee,_0x502a21,_0x265804,_0x2f7565,_0x200ac2);})[_0xa162('0x18')](function(_0x9169ba){if(_0x9169ba){logger[_0xa162('0xd')](_0xa162('0x52'),_0x9169ba['id']);switch(_0x4c96ee['type']){case _0xa162('0x53'):logger[_0xa162('0xd')]('[QUEUE]',_0xa162('0x54'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x4c96ee[_0xa162('0x1c')],_0x502a21['id'],_0x9169ba['id']),'method':_0xa162('0x10')});case _0xa162('0x55'):logger[_0xa162('0xd')](_0xa162('0x4a'),_0xa162('0x56'));emit(util[_0xa162('0xe')](_0xa162('0x57'),_0x238030[_0xa162('0x13')]),_0xa162('0x58'),{'uri':util[_0xa162('0xe')](_0xa162('0x59'),_0x4c96ee[_0xa162('0x1c')][_0xa162('0x5a')](_0xa162('0x5b'),''),_0x9169ba['id'])});break;default:logger[_0xa162('0x5c')]('[QUEUE]',_0xa162('0x5d'));}}})['catch'](function(_0x1d60db){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1d60db,{'showHidden':!![],'depth':null}));});};exports[_0xa162('0x5e')]=function(_0x219f8a,_0x44b713,_0x15185a,_0x5daaaa,_0x17ffa5,_0x515c7e,_0x2ebfa5){var _0x14b135,_0x1c4a86;_0x515c7e[_0xa162('0x1c')]=intUtil['stripTrailingSlash'](_0x515c7e[_0xa162('0x1c')]);_0x515c7e[_0xa162('0x49')]=intUtil['stripTrailingSlash'](_0x515c7e['serverUrl']);if(_0x2ebfa5&&_0x2ebfa5[_0xa162('0x5f')]&&_0x2ebfa5[_0xa162('0x5f')]!=='none'){logger[_0xa162('0xd')](_0xa162('0x60'),_0xa162('0x61'));_0x44b713[_0xa162('0x4b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x515c7e['serverUrl'],_0x44b713['uniqueid'],md5(_0x44b713[_0xa162('0x4d')]));}headers[_0xa162('0x4e')]=getAuth(_0x515c7e);return getUser(_0x515c7e,_0x5daaaa[_0xa162('0x62')])[_0xa162('0x18')](function(_0x193143){_0x14b135=_0x193143;logger[_0xa162('0xd')]('The\x20User\x20ID\x20is:',_0x14b135['id']);return getEndUser(_0x515c7e,_0x44b713[_0xa162('0x63')],_0x44b713[_0xa162('0x64')]);})[_0xa162('0x18')](function(_0x5bc443){_0x1c4a86=_0x5bc443;logger['info'](_0xa162('0x51'),_0x1c4a86['id']);return getTicket(_0x515c7e,_0x14b135,_0x1c4a86,_0x15185a,_0x44b713);})[_0xa162('0x18')](function(_0x100673){if(_0x100673){logger[_0xa162('0xd')](_0xa162('0x52'),_0x100673['id']);switch(_0x515c7e[_0xa162('0x39')]){case _0xa162('0x53'):logger[_0xa162('0xd')](_0xa162('0x60'),_0xa162('0x54'));return request({'uri':util[_0xa162('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x515c7e[_0xa162('0x1c')],_0x14b135['id'],_0x100673['id']),'method':_0xa162('0x10')});case _0xa162('0x55'):logger[_0xa162('0xd')](_0xa162('0x60'),_0xa162('0x56'));emit(util['format'](_0xa162('0x57'),_0x5daaaa[_0xa162('0x13')]),_0xa162('0x58'),{'uri':util[_0xa162('0xe')](_0xa162('0x59'),_0x515c7e[_0xa162('0x1c')][_0xa162('0x5a')]('/api/v2',''),_0x100673['id'])});break;default:logger[_0xa162('0x5c')](_0xa162('0x60'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x1f9867){logger[_0xa162('0x5c')](_0xa162('0x65'),util['inspect'](_0x1f9867,{'showHidden':!![],'depth':null}));});};exports[_0xa162('0x66')]=function(_0x3a73ce,_0x1a0612,_0x518974,_0x55ee8a,_0x7024f1,_0x5bc70d){var _0x4a974e,_0xedfe14;_0x5bc70d[_0xa162('0x1c')]=intUtil['stripTrailingSlash'](_0x5bc70d['remoteUri']);_0x5bc70d[_0xa162('0x49')]=intUtil[_0xa162('0x48')](_0x5bc70d['serverUrl']);if(_0x7024f1&&_0x7024f1[_0xa162('0x67')]){logger[_0xa162('0xd')]('['+_0x1a0612[_0xa162('0x68')]['toUpperCase']()+']',_0xa162('0x61'));_0x1a0612['recordingURL']=util[_0xa162('0xe')](_0xa162('0x4c'),_0x5bc70d[_0xa162('0x49')],_0x1a0612[_0xa162('0x4d')],md5(_0x1a0612[_0xa162('0x4d')]));}else{_0x1a0612[_0xa162('0x4b')]='';}headers[_0xa162('0x4e')]=getAuth(_0x5bc70d);return getUser(_0x5bc70d)[_0xa162('0x18')](function(_0x17f98d){_0x4a974e=_0x17f98d;logger['info'](_0xa162('0x4f'),_0x4a974e['id']);return getEndUser(_0x5bc70d,_0x1a0612[_0xa162('0x69')],_0x1a0612['calleridnum']);})['then'](function(_0x357906){_0xedfe14=_0x357906;logger[_0xa162('0xd')](_0xa162('0x51'),_0xedfe14['id']);return getTicket(_0x5bc70d,_0x4a974e,_0xedfe14,_0x518974,_0x1a0612);})[_0xa162('0x18')](function(_0x3e01fc){if(_0x3e01fc){logger[_0xa162('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3e01fc['id']);}})[_0xa162('0x6a')](function(_0x1017ce){logger[_0xa162('0x5c')]('['+_0x1a0612[_0xa162('0x68')][_0xa162('0x6b')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x1017ce,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 71c4b23..8362072 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fee=['starttime','lastevent','called','Called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','code','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridnum','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','/api/voice/recordings/','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','toUpperCase','calleridname','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','[HTTP]','length','forEach','string','picklist','idField','toString','type','variable','variableName','Variable','name','toLowerCase','isNil','isBefore','expires_in','access_token','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','stack','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','email','info','profile','user','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','role','first_name','last_name','SUCCESS','details','moduleCreate','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','Contacts','Leads','nothing','contact','https://www.zohoapis.','lead','Creating\x20new\x20call...','Owner','Subject','getString','Subjects','Description','Who_Id','Full_Name','Last_Name','What_Id','First_Name','talktime','Call_Duration','mm:ss','answertime','YYYY-MM-DDTHH:mm:ss','diff'];(function(_0x1ba43c,_0x5bd2e8){var _0x2f60eb=function(_0x349dff){while(--_0x349dff){_0x1ba43c['push'](_0x1ba43c['shift']());}};_0x2f60eb(++_0x5bd2e8);}(_0x9fee,0xc5));var _0xe9fe=function(_0x15b0bc,_0x5edd45){_0x15b0bc=_0x15b0bc-0x0;var _0x4c3073=_0x9fee[_0x15b0bc];return _0x4c3073;};'use strict';var _=require('lodash');var rp=require(_0xe9fe('0x0'));var md5=require(_0xe9fe('0x1'));var util=require(_0xe9fe('0x2'));var intUtil=require('./util');var moment=require(_0xe9fe('0x3'));var Redis=require(_0xe9fe('0x4'));var BPromise=require(_0xe9fe('0x5'));var config=require('../../../../config/environment');var logger=require(_0xe9fe('0x6'))(_0xe9fe('0x7'));config[_0xe9fe('0x8')]=_[_0xe9fe('0x9')](config[_0xe9fe('0x8')],{'host':_0xe9fe('0xa'),'port':0x18eb});var io=require(_0xe9fe('0xb'))(new Redis(config[_0xe9fe('0x8')]));function emit(_0x16dad9,_0x56b3a1,_0x344cff){io['to'](_0x16dad9)[_0xe9fe('0xc')](_0x56b3a1,_0x344cff);}function request(_0x2cfcfc){logger['debug'](_0xe9fe('0xd'),JSON['stringify'](_0x2cfcfc));return rp(_0x2cfcfc);}function getCustomFields(_0x23fccf,_0x4dafd1){var _0x23052f={};if(_0x23fccf[_0xe9fe('0xe')]>0x0){_[_0xe9fe('0xf')](_0x23fccf,function(_0x82c5){if(_['includes']([_0xe9fe('0x10'),_0xe9fe('0x11')],_0x82c5['type'])&&_0x82c5[_0xe9fe('0x12')]){_0x23052f[_0x82c5[_0xe9fe('0x12')]]=_0x82c5['content'][_0xe9fe('0x13')]();}else if(_0x82c5[_0xe9fe('0x14')]===_0xe9fe('0x15')&&_0x82c5['variableName']&&_0x82c5[_0xe9fe('0x12')]&&_0x4dafd1[_0x82c5[_0xe9fe('0x16')]]){_0x23052f[_0x82c5['idField']]=_0x4dafd1[_0x82c5[_0xe9fe('0x16')]]['toString']();}else if(_0x82c5[_0xe9fe('0x14')]==='customVariable'&&_0x82c5['Variable']&&_0x82c5[_0xe9fe('0x17')][_0xe9fe('0x18')]&&_0x82c5[_0xe9fe('0x12')]&&_0x4dafd1[_0x82c5[_0xe9fe('0x17')][_0xe9fe('0x18')][_0xe9fe('0x19')]()]){_0x23052f[_0x82c5[_0xe9fe('0x12')]]=_0x4dafd1[_0x82c5['Variable'][_0xe9fe('0x18')]['toLowerCase']()][_0xe9fe('0x13')]();}});}return _0x23052f;}function getName(_0x15601e){if(_0x15601e['indexOf']('\x20')>0x0){var _0x527947=_0x15601e['split'](/ (.+)/);if(_0x527947[0x1]){return _0x527947;}}return[_0x15601e,_0x15601e];}var accountsTokens={};function getAccessToken(_0x4820c2){return new Promise(function(_0x495ab7,_0x5e33b5){if(!_['isNil'](accountsTokens[_0x4820c2['id']])&&!_[_0xe9fe('0x1a')](accountsTokens[_0x4820c2['id']]['access_token'])){if(moment()[_0xe9fe('0x1b')](accountsTokens[_0x4820c2['id']][_0xe9fe('0x1c')])){_0x495ab7(accountsTokens[_0x4820c2['id']][_0xe9fe('0x1d')]);}}var _0x298063;switch(_0x4820c2['zone']){case'US':_0x298063=_0xe9fe('0x1e');break;case'AU':_0x298063=_0xe9fe('0x1f');break;case'EU':_0x298063=_0xe9fe('0x20');break;case'IN':_0x298063='https://accounts.zoho.in';break;case'CN':_0x298063=_0xe9fe('0x21');break;default:_0x298063=_0xe9fe('0x20');break;}var _0x52e49b={'method':'POST','uri':_0x298063+_0xe9fe('0x22'),'qs':{'refresh_token':_0x4820c2['refreshToken'],'client_id':_0x4820c2[_0xe9fe('0x23')],'client_secret':_0x4820c2[_0xe9fe('0x24')],'grant_type':_0xe9fe('0x25')},'json':!![]};return rp(_0x52e49b)[_0xe9fe('0x26')](function(_0x633224){accountsTokens[_0x4820c2['id']]={'access_token':_0x633224[_0xe9fe('0x1d')],'expires_in':moment()['add'](_0x633224['expires_in'],'seconds')};_0x495ab7(_0x633224['access_token']);})[_0xe9fe('0x27')](function(_0x3d3a73){logger[_0xe9fe('0x28')](_0xe9fe('0x29'),_0x3d3a73[_0xe9fe('0x2a')]);_0x5e33b5(_0x3d3a73);});});}function getUser(_0x363040,_0x427f63,_0x3544ed,_0x5da2c4){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0xe9fe('0x2b')](_0xe9fe('0x2c'),_0x427f63),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xe9fe('0x2d')+_0x363040},'json':!![]})['then'](function(_0x43ca1c){if(_0x43ca1c[_0xe9fe('0x2e')]){var _0x5c01b4=-0x1;if(_['isArrayLikeObject'](_0x43ca1c[_0xe9fe('0x2e')])){if(!_[_0xe9fe('0x1a')](_0x5da2c4)){_0x5c01b4=_[_0xe9fe('0x2f')](_0x43ca1c[_0xe9fe('0x2e')],function(_0x388773){return _0x388773[_0xe9fe('0x30')]===_0x5da2c4;});}if(_0x5c01b4>=0x0){logger[_0xe9fe('0x31')]('Agent\x20found!');}else{logger[_0xe9fe('0x31')]('Using\x20the\x20admin\x20account!');_0x5c01b4=_['findIndex'](_0x43ca1c[_0xe9fe('0x2e')],function(_0x10c126){return _0x10c126[_0xe9fe('0x32')][_0xe9fe('0x18')]==='Administrator';});}return _0x43ca1c[_0xe9fe('0x2e')][_0x5c01b4];}else{if(_0x43ca1c[_0xe9fe('0x33')]['profile']['name']===_0xe9fe('0x34')){logger[_0xe9fe('0x31')](_0xe9fe('0x35'));user=_0x43ca1c[_0xe9fe('0x33')];return user;}else{logger[_0xe9fe('0x28')](_0xe9fe('0x36'),JSON[_0xe9fe('0x37')](_0x43ca1c));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xe9fe('0x37')](_0x43ca1c));}}}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0xe9fe('0x37')](_0x43ca1c));throw new Error(_0xe9fe('0x38')+JSON[_0xe9fe('0x37')](_0x43ca1c));}})['catch'](function(_0x505854){console[_0xe9fe('0x28')](_0x505854);});}function getZohoUser(_0x3e60b1,_0x3f8d08){return new BPromise(function(_0x2ba8bc,_0x2b4135){request(_0x3e60b1)[_0xe9fe('0x26')](function(_0x301949){var _0x312086=null;if(_0x301949){_0x312086=_0x301949[_0xe9fe('0x39')][0x0];_0x312086[_0xe9fe('0x3a')]=_0x3f8d08;}_0x2ba8bc(_0x312086);})['catch'](function(_0x2bc02a){_0x2b4135(_0x2bc02a);});});}function createEndUser(_0xdb3874,_0x231314,_0x21f2e2,_0x452250,_0x39a2fa,_0x3ab711){var _0x21f2e2=getName(_0x21f2e2);return request({'method':_0xe9fe('0x3b'),'uri':'https://www.zohoapis.'+_0x231314+'/crm/v2/'+_['startCase'](_0x3ab711['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x21f2e2[0x1],'First_Name':_0x21f2e2[0x0],'Phone':_0x452250,'Owner':{'name':!_[_0xe9fe('0x1a')](_0x39a2fa[_0xe9fe('0x3c')][_0xe9fe('0x18')])?_0x39a2fa[_0xe9fe('0x3c')][_0xe9fe('0x18')]:!_[_0xe9fe('0x1a')](_0x39a2fa[_0xe9fe('0x3d')])?_0x39a2fa['first_name']+'\x20'+_0x39a2fa[_0xe9fe('0x3e')]:_0x39a2fa[_0xe9fe('0x3e')],'id':_0x39a2fa['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xdb3874},'json':!![]})[_0xe9fe('0x26')](function(_0xb0b81c){if(_0xb0b81c&&_0xb0b81c['data'][0x0]['code']===_0xe9fe('0x3f')){var _0x30e509=_0xb0b81c[_0xe9fe('0x39')][0x0][_0xe9fe('0x40')];_0x30e509['enduserType']=_['startCase'](_0x3ab711[_0xe9fe('0x41')])+'s';return _0x30e509;}logger['error'](_0xe9fe('0x36'),JSON[_0xe9fe('0x37')](data));throw new Error('Error:\x20'+JSON[_0xe9fe('0x37')](data));})['catch'](function(_0x185502){console[_0xe9fe('0x42')](_0xe9fe('0x43'),_0x185502);});}function getEndUser(_0x4bd562,_0x57e7da,_0x2c2f2a,_0xea5efa,_0x2caeb0,_0x3446bd,_0x10355d){var _0x37db53={'method':_0xe9fe('0x44'),'uri':'','headers':{'Authorization':_0xe9fe('0x2d')+_0x4bd562},'json':!![]};switch(_0x10355d[_0xe9fe('0x45')]){case _0xe9fe('0x46'):_0x37db53[_0xe9fe('0x47')]='https://www.zohoapis.'+_0x57e7da+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2caeb0+'))';return getZohoUser(_0x37db53,_0xe9fe('0x48'))['then'](function(_0x2e5bd6){if(_0x2e5bd6)return _0x2e5bd6;_0x37db53[_0xe9fe('0x47')]='https://www.zohoapis.'+_0x57e7da+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2caeb0+'))';return getZohoUser(_0x37db53,_0xe9fe('0x49'))['then'](function(_0x26d7a5){if(_0x26d7a5)return _0x26d7a5;if(_0x10355d[_0xe9fe('0x41')]!=_0xe9fe('0x4a')){return createEndUser(_0x4bd562,_0x57e7da,_0xea5efa,_0x2caeb0,_0x3446bd,_0x10355d);}else{return{};}});});break;case _0xe9fe('0x4b'):_0x37db53[_0xe9fe('0x47')]=_0xe9fe('0x4c')+_0x57e7da+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2caeb0+'))';return getZohoUser(_0x37db53,_0xe9fe('0x48'))[_0xe9fe('0x26')](function(_0xee9fff){if(_0xee9fff)return _0xee9fff;if(_0x10355d[_0xe9fe('0x41')]!=_0xe9fe('0x4a')){return createEndUser(_0x4bd562,_0x57e7da,_0xea5efa,_0x2caeb0,_0x3446bd,_0x10355d);}else{return{};}});break;case _0xe9fe('0x4d'):_0x37db53[_0xe9fe('0x47')]='https://www.zohoapis.'+_0x57e7da+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2caeb0+'))';return getZohoUser(_0x37db53,_0xe9fe('0x49'))[_0xe9fe('0x26')](function(_0x24dff4){if(_0x24dff4)return _0x24dff4;if(_0x10355d[_0xe9fe('0x41')]!=_0xe9fe('0x4a')){return createEndUser(_0x4bd562,_0x57e7da,_0xea5efa,_0x2caeb0,_0x3446bd,_0x10355d);}else{return{};}});break;}}function getCall(_0x351a66,_0x57c466,_0x4a0e30,_0xce60f,_0x5c397a,_0x5100eb,_0x388cf7,_0x1844c1){logger[_0xe9fe('0x31')](_0xe9fe('0x4e'));var _0x25ea52={};_0x25ea52[_0xe9fe('0x4f')]={'name':!_[_0xe9fe('0x1a')](_0xce60f[_0xe9fe('0x3c')][_0xe9fe('0x18')])&&!_[_0xe9fe('0x1a')](_0xce60f[_0xe9fe('0x32')][_0xe9fe('0x18')])&&_0xce60f[_0xe9fe('0x32')][_0xe9fe('0x18')]==='administrator'?_0xce60f[_0xe9fe('0x3c')]['name']:!_['isNil'](_0xce60f[_0xe9fe('0x3d')])?_0xce60f['first_name']+'\x20'+_0xce60f[_0xe9fe('0x3e')]:_0xce60f[_0xe9fe('0x3e')],'id':_0xce60f['id']};_0x25ea52[_0xe9fe('0x50')]=intUtil[_0xe9fe('0x51')](_0x5100eb[_0xe9fe('0x52')],_0x388cf7,'\x20');_0x25ea52[_0xe9fe('0x53')]=intUtil[_0xe9fe('0x51')](_0x5100eb['Descriptions'],_0x388cf7,'\x0a');if(_0x5c397a['enduserType']===_0xe9fe('0x48')){_0x25ea52[_0xe9fe('0x54')]={'name':!_[_0xe9fe('0x1a')](_0x5c397a['Full_Name'])?_0x5c397a[_0xe9fe('0x55')]:!_[_0xe9fe('0x1a')](_0x5c397a['First_Name'])?_0x5c397a['First_Name']+'\x20'+_0x5c397a[_0xe9fe('0x56')]:_0x5c397a[_0xe9fe('0x56')],'id':_0x5c397a['id']};}if(_0x5c397a[_0xe9fe('0x3a')]==='Leads'){_0x25ea52[_0xe9fe('0x57')]={'name':!_[_0xe9fe('0x1a')](_0x5c397a[_0xe9fe('0x55')])?_0x5c397a[_0xe9fe('0x55')]:!_[_0xe9fe('0x1a')](_0x5c397a[_0xe9fe('0x58')])?_0x5c397a['First_Name']+'\x20'+_0x5c397a[_0xe9fe('0x56')]:_0x5c397a[_0xe9fe('0x56')],'id':_0x5c397a['id']};_0x25ea52['$se_module']=_['startCase'](_0x5c397a[_0xe9fe('0x3a')]);}if(_0x388cf7[_0xe9fe('0x59')]){_0x25ea52[_0xe9fe('0x5a')]=moment['utc'](parseInt(_0x388cf7[_0xe9fe('0x59')])*0x3e8)['format'](_0xe9fe('0x5b'));}else if(_0x388cf7[_0xe9fe('0x5c')]&&_0x388cf7['endtime']){_0x25ea52['Call_Duration']=moment['utc'](moment(_0x388cf7['endtime'],_0xe9fe('0x5d'))[_0xe9fe('0x5e')](moment(_0x388cf7[_0xe9fe('0x5f')],_0xe9fe('0x5d'))))[_0xe9fe('0x2b')](_0xe9fe('0x5b'));}switch(_0x388cf7[_0xe9fe('0x60')]){case _0xe9fe('0x61'):_0x25ea52['Call_Result']=_0xe9fe('0x62');break;case _0xe9fe('0x63'):case'connect':_0x25ea52[_0xe9fe('0x64')]=_0xe9fe('0x65');break;case _0xe9fe('0x66'):_0x25ea52['Call_Result']=_0xe9fe('0x67');break;case _0xe9fe('0x68'):_0x25ea52[_0xe9fe('0x64')]=_0xe9fe('0x69');break;case _0xe9fe('0x6a'):_0x25ea52[_0xe9fe('0x64')]=_0xe9fe('0x6b');default:}_0x25ea52[_0xe9fe('0x6c')]=(_0x1844c1===_0xe9fe('0x6d')?moment(_0x388cf7[_0xe9fe('0x5f')])[_0xe9fe('0x2b')](_0xe9fe('0x5d')):moment(_0x388cf7[_0xe9fe('0x6e')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xe9fe('0x2b')](_0xe9fe('0x5d'));_0x25ea52[_0xe9fe('0x6f')]=_0x1844c1||_0xe9fe('0x70');_0x25ea52=_['merge'](_0x25ea52,getCustomFields(_0x5100eb[_0xe9fe('0x71')],_0x388cf7));return request({'method':_0xe9fe('0x3b'),'uri':_0xe9fe('0x4c')+_0x57c466+_0xe9fe('0x72'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x351a66},'body':{'data':[_0x25ea52]},'json':!![]})['then'](function(_0x3cd2b7){if(_0x3cd2b7&&_0x3cd2b7[_0xe9fe('0x39')][0x0][_0xe9fe('0x73')]===_0xe9fe('0x3f')){logger[_0xe9fe('0x31')]('Call\x20created!');return{'id':_0x3cd2b7['data'][0x0][_0xe9fe('0x40')]['id']};}})[_0xe9fe('0x27')](function(_0x48faac){logger[_0xe9fe('0x31')](_0xe9fe('0x74'),_0x48faac[_0xe9fe('0x2a')]);console[_0xe9fe('0x42')](_0xe9fe('0x74'),_0x48faac);});}exports[_0xe9fe('0x75')]=function(_0x225943,_0x3c7df6,_0x4b1ada,_0x4491be,_0xa54184,_0x20b198){var _0xff500a,_0xaf5f97,_0x6860b7;_0x20b198['host']=intUtil[_0xe9fe('0x76')](_0x20b198[_0xe9fe('0x77')]);_0x20b198[_0xe9fe('0x78')]=intUtil[_0xe9fe('0x76')](_0x20b198[_0xe9fe('0x78')]);if(_0xa54184&&_0xa54184[_0xe9fe('0x79')]){logger[_0xe9fe('0x31')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3c7df6[_0xe9fe('0x7a')]=_0x20b198[_0xe9fe('0x78')]+'/api/voice/recordings/'+_0x3c7df6[_0xe9fe('0x7b')]+_0xe9fe('0x7c')+md5(_0x3c7df6[_0xe9fe('0x7b')]);}else{_0x3c7df6[_0xe9fe('0x7a')]='';}var _0x4d335f=_0x20b198[_0xe9fe('0x77')]===_0xe9fe('0x7d')?'eu':_0xe9fe('0x7e');return getAccessToken(_0x20b198)[_0xe9fe('0x26')](function(_0x4e417c){_0x6860b7=_0x4e417c;return getUser(_0x6860b7,_0x4d335f,_0x20b198,_0x4491be[_0xe9fe('0x30')]);})[_0xe9fe('0x26')](function(_0x5da084){_0xff500a=_0x5da084;logger['info']('The\x20User\x20ID\x20is:',_0xff500a['id']);return getEndUser(_0x6860b7,_0x4d335f,_0x20b198,_0x3c7df6['calleridname'],_0x3c7df6[_0xe9fe('0x7f')],_0xff500a,_0x4b1ada);})[_0xe9fe('0x26')](function(_0x134169){_0xaf5f97=_0x134169;return getCall(_0x6860b7,_0x4d335f,_0x20b198,_0xff500a,_0xaf5f97,_0x4b1ada,_0x3c7df6,_0xe9fe('0x70'));})['then'](function(_0x39dfc){if(_0x39dfc){logger[_0xe9fe('0x31')]('The\x20Call\x20ID\x20is:',_0x39dfc['id']);logger[_0xe9fe('0x31')](_0xe9fe('0x80'),_0xe9fe('0x81'));emit(util[_0xe9fe('0x2b')](_0xe9fe('0x82'),_0x4491be['name']),_0xe9fe('0x83'),{'uri':_0xe9fe('0x84')+_0x20b198[_0xe9fe('0x77')]+_0xe9fe('0x85')+_0x39dfc['id']});}})[_0xe9fe('0x27')](function(_0x569d82){logger[_0xe9fe('0x28')](_0xe9fe('0x80'),JSON[_0xe9fe('0x37')](_0x569d82));});};exports[_0xe9fe('0x6d')]=function(_0x129c31,_0x3fe338,_0x3f1e18,_0x2ffec5,_0x102e5f,_0x1e74d3,_0x1e04ff){var _0x10544b,_0x287723,_0x20f0a4;_0x1e74d3['host']=intUtil[_0xe9fe('0x76')](_0x1e74d3['host']);_0x1e74d3['serverUrl']=intUtil['stripTrailingSlash'](_0x1e74d3[_0xe9fe('0x78')]);if(_0x1e04ff&&_0x1e04ff['recordingFormat']&&_0x1e04ff[_0xe9fe('0x86')]!==_0xe9fe('0x87')){logger[_0xe9fe('0x31')](_0xe9fe('0x88'),_0xe9fe('0x89'));_0x3fe338[_0xe9fe('0x7a')]=_0x1e74d3[_0xe9fe('0x78')]+_0xe9fe('0x8a')+_0x3fe338[_0xe9fe('0x7b')]+_0xe9fe('0x7c')+md5(_0x3fe338[_0xe9fe('0x7b')]);}var _0x31bbfa=_0x1e74d3['host']===_0xe9fe('0x7d')?'eu':_0xe9fe('0x7e');return getAccessToken(_0x1e74d3)[_0xe9fe('0x26')](function(_0x1e1d80){_0x20f0a4=_0x1e1d80;return getUser(_0x20f0a4,_0x31bbfa,_0x1e74d3,_0x2ffec5['email']);})[_0xe9fe('0x26')](function(_0x4f4cfe){_0x10544b=_0x4f4cfe;logger['info'](_0xe9fe('0x8b'),_0x10544b['id']);return getEndUser(_0x20f0a4,_0x31bbfa,_0x1e74d3,_0x3fe338[_0xe9fe('0x8c')],_0x3fe338[_0xe9fe('0x8d')],_0x10544b,_0x3f1e18);})[_0xe9fe('0x26')](function(_0x53d47a){_0x287723=_0x53d47a;return getCall(_0x20f0a4,_0x31bbfa,_0x1e74d3,_0x10544b,_0x287723,_0x3f1e18,_0x3fe338,_0xe9fe('0x8e'));})[_0xe9fe('0x26')](function(_0x105663){if(_0x105663){logger[_0xe9fe('0x31')](_0xe9fe('0x8f'),_0x105663['id']);logger[_0xe9fe('0x31')](_0xe9fe('0x88'),_0xe9fe('0x81'));emit(util[_0xe9fe('0x2b')](_0xe9fe('0x82'),_0x2ffec5[_0xe9fe('0x18')]),_0xe9fe('0x83'),{'uri':_0xe9fe('0x84')+_0x1e74d3[_0xe9fe('0x77')]+_0xe9fe('0x85')+_0x105663['id']});}})[_0xe9fe('0x27')](function(_0x387938){logger[_0xe9fe('0x28')](_0xe9fe('0x88'),JSON['stringify'](_0x387938));});};exports['unmanaged']=function(_0x4b2820,_0x18d867,_0x45ec88,_0x5de942,_0x522aa6,_0x456b60){var _0x3c934a,_0x7fd633,_0x1dfe7a;_0x456b60[_0xe9fe('0x77')]=intUtil[_0xe9fe('0x76')](_0x456b60['host']);_0x456b60[_0xe9fe('0x78')]=intUtil[_0xe9fe('0x76')](_0x456b60[_0xe9fe('0x78')]);if(_0x522aa6&&_0x522aa6['monitor_format']){logger[_0xe9fe('0x31')]('['+_0x18d867[_0xe9fe('0x60')][_0xe9fe('0x90')]()+']','Recording\x20is\x20enabled!');_0x18d867[_0xe9fe('0x7a')]=_0x456b60['serverUrl']+_0xe9fe('0x8a')+_0x18d867[_0xe9fe('0x7b')]+_0xe9fe('0x7c')+md5(_0x18d867['uniqueid']);}else{_0x18d867['recordingURL']='';}var _0x317831=_0x456b60['host']===_0xe9fe('0x7d')?'eu':'com';return getAccessToken(_0x456b60)[_0xe9fe('0x26')](function(_0x1ec574){_0x1dfe7a=_0x1ec574;return getUser(_0x1dfe7a,_0x317831,_0x456b60);})[_0xe9fe('0x26')](function(_0x148eb7){_0x3c934a=_0x148eb7;logger[_0xe9fe('0x31')]('The\x20User\x20ID\x20is:',_0x3c934a['id']);return getEndUser(_0x1dfe7a,_0x317831,_0x456b60,_0x18d867[_0xe9fe('0x91')],_0x18d867[_0xe9fe('0x7f')],_0x3c934a,_0x45ec88);})['then'](function(_0x144aeb){_0x7fd633=_0x144aeb;return getCall(_0x1dfe7a,_0x317831,_0x456b60,_0x3c934a,_0x7fd633,_0x45ec88,_0x18d867,'Inbound');})['then'](function(_0x2e15cf){if(_0x2e15cf){logger[_0xe9fe('0x31')]('The\x20Call\x20ID\x20is:',_0x2e15cf['id']);}})[_0xe9fe('0x27')](function(_0x1e90ca){logger[_0xe9fe('0x28')]('['+_0x18d867[_0xe9fe('0x60')][_0xe9fe('0x90')]()+']',JSON[_0xe9fe('0x37')](_0x1e90ca));});};
\ No newline at end of file
+var _0x1cf7=['answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','Inbound','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','Outbound','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','calleridname','lodash','request-promise','md5','util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','localhost','socket.io-emitter','debug','[HTTP]','stringify','includes','picklist','idField','toString','variableName','type','customVariable','Variable','name','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','refreshToken','clientId','clientSecret','then','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','POST','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','data','Error:\x20','log','CREATE\x20ERROR','moduleSearch','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','Subject','getString','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss'];(function(_0xcc122c,_0x3bc1ef){var _0x281b58=function(_0x39f5bd){while(--_0x39f5bd){_0xcc122c['push'](_0xcc122c['shift']());}};_0x281b58(++_0x3bc1ef);}(_0x1cf7,0x158));var _0x71cf=function(_0x22b55a,_0x541504){_0x22b55a=_0x22b55a-0x0;var _0x3704e5=_0x1cf7[_0x22b55a];return _0x3704e5;};'use strict';var _=require(_0x71cf('0x0'));var rp=require(_0x71cf('0x1'));var md5=require(_0x71cf('0x2'));var util=require(_0x71cf('0x3'));var intUtil=require('./util');var moment=require(_0x71cf('0x4'));var Redis=require(_0x71cf('0x5'));var BPromise=require(_0x71cf('0x6'));var config=require(_0x71cf('0x7'));var logger=require('../../../../config/logger')(_0x71cf('0x8'));config[_0x71cf('0x9')]=_['defaults'](config[_0x71cf('0x9')],{'host':_0x71cf('0xa'),'port':0x18eb});var io=require(_0x71cf('0xb'))(new Redis(config[_0x71cf('0x9')]));function emit(_0x356906,_0x344410,_0x5acf51){io['to'](_0x356906)['emit'](_0x344410,_0x5acf51);}function request(_0x3bad67){logger[_0x71cf('0xc')](_0x71cf('0xd'),JSON[_0x71cf('0xe')](_0x3bad67));return rp(_0x3bad67);}function getCustomFields(_0x53b976,_0x26a109){var _0x44a859={};if(_0x53b976['length']>0x0){_['forEach'](_0x53b976,function(_0x260a7b){if(_[_0x71cf('0xf')](['string',_0x71cf('0x10')],_0x260a7b['type'])&&_0x260a7b[_0x71cf('0x11')]){_0x44a859[_0x260a7b[_0x71cf('0x11')]]=_0x260a7b['content'][_0x71cf('0x12')]();}else if(_0x260a7b['type']==='variable'&&_0x260a7b['variableName']&&_0x260a7b[_0x71cf('0x11')]&&_0x26a109[_0x260a7b[_0x71cf('0x13')]]){_0x44a859[_0x260a7b[_0x71cf('0x11')]]=_0x26a109[_0x260a7b['variableName']][_0x71cf('0x12')]();}else if(_0x260a7b[_0x71cf('0x14')]===_0x71cf('0x15')&&_0x260a7b['Variable']&&_0x260a7b[_0x71cf('0x16')][_0x71cf('0x17')]&&_0x260a7b[_0x71cf('0x11')]&&_0x26a109[_0x260a7b[_0x71cf('0x16')]['name']['toLowerCase']()]){_0x44a859[_0x260a7b['idField']]=_0x26a109[_0x260a7b['Variable'][_0x71cf('0x17')]['toLowerCase']()][_0x71cf('0x12')]();}});}return _0x44a859;}function getName(_0x36c9fb){if(_0x36c9fb['indexOf']('\x20')>0x0){var _0x13baa5=_0x36c9fb['split'](/ (.+)/);if(_0x13baa5[0x1]){return _0x13baa5;}}return[_0x36c9fb,_0x36c9fb];}var accountsTokens={};function getAccessToken(_0xa0f8e1){return new Promise(function(_0x2a0457,_0xbbc4a1){if(!_[_0x71cf('0x18')](accountsTokens[_0xa0f8e1['id']])&&!_['isNil'](accountsTokens[_0xa0f8e1['id']][_0x71cf('0x19')])){if(moment()[_0x71cf('0x1a')](accountsTokens[_0xa0f8e1['id']][_0x71cf('0x1b')])){_0x2a0457(accountsTokens[_0xa0f8e1['id']][_0x71cf('0x19')]);}}var _0x5a9719;switch(_0xa0f8e1[_0x71cf('0x1c')]){case'US':_0x5a9719=_0x71cf('0x1d');break;case'AU':_0x5a9719='https://accounts.zoho.com.au';break;case'EU':_0x5a9719='https://accounts.zoho.eu';break;case'IN':_0x5a9719=_0x71cf('0x1e');break;case'CN':_0x5a9719=_0x71cf('0x1f');break;default:_0x5a9719=_0x71cf('0x20');break;}var _0x18f1b2={'method':'POST','uri':_0x5a9719+_0x71cf('0x21'),'qs':{'refresh_token':_0xa0f8e1[_0x71cf('0x22')],'client_id':_0xa0f8e1[_0x71cf('0x23')],'client_secret':_0xa0f8e1[_0x71cf('0x24')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x18f1b2)[_0x71cf('0x25')](function(_0x5d8f08){accountsTokens[_0xa0f8e1['id']]={'access_token':_0x5d8f08[_0x71cf('0x19')],'expires_in':moment()['add'](_0x5d8f08[_0x71cf('0x1b')],_0x71cf('0x26'))};_0x2a0457(_0x5d8f08['access_token']);})['catch'](function(_0x108201){logger[_0x71cf('0x27')](_0x71cf('0x28'),_0x108201[_0x71cf('0x29')]);_0xbbc4a1(_0x108201);});});}function getUser(_0x4922c1,_0x54c862,_0x42d473,_0x52fa56){logger[_0x71cf('0x2a')]('Search\x20user');return request({'method':_0x71cf('0x2b'),'uri':util[_0x71cf('0x2c')](_0x71cf('0x2d'),_0x54c862),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x71cf('0x2e')+_0x4922c1},'json':!![]})[_0x71cf('0x25')](function(_0x2150c3){if(_0x2150c3[_0x71cf('0x2f')]){var _0x47aca0=-0x1;if(_[_0x71cf('0x30')](_0x2150c3['users'])){if(!_[_0x71cf('0x18')](_0x52fa56)){_0x47aca0=_[_0x71cf('0x31')](_0x2150c3[_0x71cf('0x2f')],function(_0x2b98dc){return _0x2b98dc[_0x71cf('0x32')]===_0x52fa56;});}if(_0x47aca0>=0x0){logger[_0x71cf('0x2a')](_0x71cf('0x33'));}else{logger[_0x71cf('0x2a')](_0x71cf('0x34'));_0x47aca0=_[_0x71cf('0x31')](_0x2150c3[_0x71cf('0x2f')],function(_0x1f1966){return _0x1f1966[_0x71cf('0x35')][_0x71cf('0x17')]===_0x71cf('0x36');});}return _0x2150c3[_0x71cf('0x2f')][_0x47aca0];}else{if(_0x2150c3[_0x71cf('0x37')]['profile'][_0x71cf('0x17')]===_0x71cf('0x36')){logger[_0x71cf('0x2a')]('Using\x20the\x20admin\x20account!');user=_0x2150c3[_0x71cf('0x37')];return user;}else{logger[_0x71cf('0x27')](_0x71cf('0x38'),JSON['stringify'](_0x2150c3));throw new Error(_0x71cf('0x39')+JSON['stringify'](_0x2150c3));}}}else{logger[_0x71cf('0x27')](_0x71cf('0x38'),JSON[_0x71cf('0xe')](_0x2150c3));throw new Error(_0x71cf('0x39')+JSON[_0x71cf('0xe')](_0x2150c3));}})[_0x71cf('0x3a')](function(_0x16830f){console[_0x71cf('0x27')](_0x16830f);});}function getZohoUser(_0x4d8a30,_0x27e46a){return new BPromise(function(_0x29eaed,_0x83eb5e){request(_0x4d8a30)[_0x71cf('0x25')](function(_0x3774f3){var _0x4cbc30=null;if(_0x3774f3){_0x4cbc30=_0x3774f3['data'][0x0];_0x4cbc30[_0x71cf('0x3b')]=_0x27e46a;}_0x29eaed(_0x4cbc30);})[_0x71cf('0x3a')](function(_0x1909a6){_0x83eb5e(_0x1909a6);});});}function createEndUser(_0x180490,_0x48968b,_0x5c7992,_0x564ade,_0x54fc03,_0x22e9c0){var _0x5c7992=getName(_0x5c7992);return request({'method':_0x71cf('0x3c'),'uri':_0x71cf('0x3d')+_0x48968b+_0x71cf('0x3e')+_[_0x71cf('0x3f')](_0x22e9c0[_0x71cf('0x40')])+'s','body':{'data':[{'Last_Name':_0x5c7992[0x1],'First_Name':_0x5c7992[0x0],'Phone':_0x564ade,'Owner':{'name':!_[_0x71cf('0x18')](_0x54fc03[_0x71cf('0x41')][_0x71cf('0x17')])?_0x54fc03['role']['name']:!_[_0x71cf('0x18')](_0x54fc03['first_name'])?_0x54fc03[_0x71cf('0x42')]+'\x20'+_0x54fc03[_0x71cf('0x43')]:_0x54fc03[_0x71cf('0x43')],'id':_0x54fc03['id']}}]},'headers':{'Authorization':_0x71cf('0x2e')+_0x180490},'json':!![]})[_0x71cf('0x25')](function(_0xc77485){if(_0xc77485&&_0xc77485['data'][0x0][_0x71cf('0x44')]===_0x71cf('0x45')){var _0x3992d6=_0xc77485[_0x71cf('0x46')][0x0]['details'];_0x3992d6[_0x71cf('0x3b')]=_[_0x71cf('0x3f')](_0x22e9c0[_0x71cf('0x40')])+'s';return _0x3992d6;}logger[_0x71cf('0x27')](_0x71cf('0x38'),JSON[_0x71cf('0xe')](data));throw new Error(_0x71cf('0x47')+JSON['stringify'](data));})[_0x71cf('0x3a')](function(_0x59bdd2){console[_0x71cf('0x48')](_0x71cf('0x49'),_0x59bdd2);});}function getEndUser(_0x35d13f,_0x106f3c,_0xfdaa67,_0x4190cb,_0x8db439,_0x477a2a,_0x3da6ae){var _0x3e0d22={'method':_0x71cf('0x2b'),'uri':'','headers':{'Authorization':_0x71cf('0x2e')+_0x35d13f},'json':!![]};switch(_0x3da6ae[_0x71cf('0x4a')]){case'contact_lead':_0x3e0d22['uri']='https://www.zohoapis.'+_0x106f3c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x8db439+'))';return getZohoUser(_0x3e0d22,_0x71cf('0x4b'))[_0x71cf('0x25')](function(_0x2194f6){if(_0x2194f6)return _0x2194f6;_0x3e0d22[_0x71cf('0x4c')]='https://www.zohoapis.'+_0x106f3c+_0x71cf('0x4d')+_0x8db439+'))';return getZohoUser(_0x3e0d22,_0x71cf('0x4e'))[_0x71cf('0x25')](function(_0x49cbcb){if(_0x49cbcb)return _0x49cbcb;if(_0x3da6ae[_0x71cf('0x40')]!='nothing'){return createEndUser(_0x35d13f,_0x106f3c,_0x4190cb,_0x8db439,_0x477a2a,_0x3da6ae);}else{return{};}});});break;case'contact':_0x3e0d22[_0x71cf('0x4c')]=_0x71cf('0x3d')+_0x106f3c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x8db439+'))';return getZohoUser(_0x3e0d22,_0x71cf('0x4b'))[_0x71cf('0x25')](function(_0x56accb){if(_0x56accb)return _0x56accb;if(_0x3da6ae[_0x71cf('0x40')]!=_0x71cf('0x4f')){return createEndUser(_0x35d13f,_0x106f3c,_0x4190cb,_0x8db439,_0x477a2a,_0x3da6ae);}else{return{};}});break;case _0x71cf('0x50'):_0x3e0d22[_0x71cf('0x4c')]=_0x71cf('0x3d')+_0x106f3c+_0x71cf('0x4d')+_0x8db439+'))';return getZohoUser(_0x3e0d22,'Leads')[_0x71cf('0x25')](function(_0x2e6c2d){if(_0x2e6c2d)return _0x2e6c2d;if(_0x3da6ae[_0x71cf('0x40')]!=_0x71cf('0x4f')){return createEndUser(_0x35d13f,_0x106f3c,_0x4190cb,_0x8db439,_0x477a2a,_0x3da6ae);}else{return{};}});break;}}function getCall(_0x26343c,_0x2c4552,_0x192773,_0x4cb4f8,_0x2b2d1b,_0x50130e,_0x37050b,_0x4d3dce){logger[_0x71cf('0x2a')]('Creating\x20new\x20call...');var _0x590317={};_0x590317[_0x71cf('0x51')]={'name':!_['isNil'](_0x4cb4f8[_0x71cf('0x41')][_0x71cf('0x17')])&&!_[_0x71cf('0x18')](_0x4cb4f8[_0x71cf('0x35')]['name'])&&_0x4cb4f8[_0x71cf('0x35')][_0x71cf('0x17')]==='administrator'?_0x4cb4f8['role'][_0x71cf('0x17')]:!_[_0x71cf('0x18')](_0x4cb4f8[_0x71cf('0x42')])?_0x4cb4f8[_0x71cf('0x42')]+'\x20'+_0x4cb4f8[_0x71cf('0x43')]:_0x4cb4f8[_0x71cf('0x43')],'id':_0x4cb4f8['id']};_0x590317[_0x71cf('0x52')]=intUtil[_0x71cf('0x53')](_0x50130e['Subjects'],_0x37050b,'\x20');_0x590317['Description']=intUtil['getString'](_0x50130e['Descriptions'],_0x37050b,'\x0a');if(_0x2b2d1b['enduserType']===_0x71cf('0x4b')){_0x590317[_0x71cf('0x54')]={'name':!_[_0x71cf('0x18')](_0x2b2d1b[_0x71cf('0x55')])?_0x2b2d1b[_0x71cf('0x55')]:!_['isNil'](_0x2b2d1b[_0x71cf('0x56')])?_0x2b2d1b[_0x71cf('0x56')]+'\x20'+_0x2b2d1b[_0x71cf('0x57')]:_0x2b2d1b[_0x71cf('0x57')],'id':_0x2b2d1b['id']};}if(_0x2b2d1b[_0x71cf('0x3b')]===_0x71cf('0x4e')){_0x590317[_0x71cf('0x58')]={'name':!_['isNil'](_0x2b2d1b[_0x71cf('0x55')])?_0x2b2d1b[_0x71cf('0x55')]:!_[_0x71cf('0x18')](_0x2b2d1b['First_Name'])?_0x2b2d1b[_0x71cf('0x56')]+'\x20'+_0x2b2d1b[_0x71cf('0x57')]:_0x2b2d1b['Last_Name'],'id':_0x2b2d1b['id']};_0x590317[_0x71cf('0x59')]=_['startCase'](_0x2b2d1b['enduserType']);}if(_0x37050b[_0x71cf('0x5a')]){_0x590317[_0x71cf('0x5b')]=moment[_0x71cf('0x5c')](parseInt(_0x37050b['talktime'])*0x3e8)[_0x71cf('0x2c')](_0x71cf('0x5d'));}else if(_0x37050b[_0x71cf('0x5e')]&&_0x37050b[_0x71cf('0x5f')]){_0x590317[_0x71cf('0x5b')]=moment[_0x71cf('0x5c')](moment(_0x37050b[_0x71cf('0x5f')],_0x71cf('0x60'))[_0x71cf('0x61')](moment(_0x37050b[_0x71cf('0x62')],_0x71cf('0x60'))))[_0x71cf('0x2c')](_0x71cf('0x5d'));}switch(_0x37050b[_0x71cf('0x63')]){case'called':_0x590317[_0x71cf('0x64')]=_0x71cf('0x65');break;case _0x71cf('0x66'):case'connect':_0x590317[_0x71cf('0x64')]=_0x71cf('0x67');break;case _0x71cf('0x68'):_0x590317[_0x71cf('0x64')]=_0x71cf('0x69');break;case _0x71cf('0x6a'):_0x590317['Call_Result']=_0x71cf('0x6b');break;case _0x71cf('0x6c'):_0x590317[_0x71cf('0x64')]=_0x71cf('0x6d');default:}_0x590317[_0x71cf('0x6e')]=(_0x4d3dce===_0x71cf('0x6f')?moment(_0x37050b[_0x71cf('0x62')])[_0x71cf('0x2c')](_0x71cf('0x60')):moment(_0x37050b['agentcalledAt'])[_0x71cf('0x2c')](_0x71cf('0x60')))||moment()[_0x71cf('0x2c')](_0x71cf('0x60'));_0x590317['Call_Type']=_0x4d3dce||_0x71cf('0x70');_0x590317=_['merge'](_0x590317,getCustomFields(_0x50130e[_0x71cf('0x71')],_0x37050b));return request({'method':_0x71cf('0x3c'),'uri':_0x71cf('0x3d')+_0x2c4552+'/crm/v2/Calls','headers':{'Authorization':_0x71cf('0x2e')+_0x26343c},'body':{'data':[_0x590317]},'json':!![]})[_0x71cf('0x25')](function(_0x5942bf){if(_0x5942bf&&_0x5942bf[_0x71cf('0x46')][0x0][_0x71cf('0x44')]===_0x71cf('0x45')){logger[_0x71cf('0x2a')](_0x71cf('0x72'));return{'id':_0x5942bf[_0x71cf('0x46')][0x0][_0x71cf('0x73')]['id']};}})[_0x71cf('0x3a')](function(_0x4b6709){logger[_0x71cf('0x2a')](_0x71cf('0x74'),_0x4b6709[_0x71cf('0x29')]);console[_0x71cf('0x48')](_0x71cf('0x74'),_0x4b6709);});}exports[_0x71cf('0x75')]=function(_0x5d4090,_0x3af0c0,_0x1d6625,_0x29660d,_0x5ed4e0,_0x136c42){var _0x17a46d,_0x3614f6,_0x72edc2;_0x136c42[_0x71cf('0x76')]=intUtil[_0x71cf('0x77')](_0x136c42['host']);_0x136c42[_0x71cf('0x78')]=intUtil[_0x71cf('0x77')](_0x136c42[_0x71cf('0x78')]);if(_0x5ed4e0&&_0x5ed4e0['monitor_format']){logger[_0x71cf('0x2a')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3af0c0[_0x71cf('0x79')]=_0x136c42[_0x71cf('0x78')]+_0x71cf('0x7a')+_0x3af0c0[_0x71cf('0x7b')]+_0x71cf('0x7c')+md5(_0x3af0c0[_0x71cf('0x7b')]);}else{_0x3af0c0['recordingURL']='';}var _0x39d387=_0x136c42[_0x71cf('0x76')]===_0x71cf('0x7d')?'eu':_0x71cf('0x7e');return getAccessToken(_0x136c42)[_0x71cf('0x25')](function(_0x44b886){_0x72edc2=_0x44b886;return getUser(_0x72edc2,_0x39d387,_0x136c42,_0x29660d['email']);})[_0x71cf('0x25')](function(_0x17d540){_0x17a46d=_0x17d540;logger[_0x71cf('0x2a')](_0x71cf('0x7f'),_0x17a46d['id']);return getEndUser(_0x72edc2,_0x39d387,_0x136c42,_0x3af0c0['calleridname'],_0x3af0c0[_0x71cf('0x80')],_0x17a46d,_0x1d6625);})['then'](function(_0x794e61){_0x3614f6=_0x794e61;return getCall(_0x72edc2,_0x39d387,_0x136c42,_0x17a46d,_0x3614f6,_0x1d6625,_0x3af0c0,'Inbound');})[_0x71cf('0x25')](function(_0x211bab){if(_0x211bab){logger[_0x71cf('0x2a')](_0x71cf('0x81'),_0x211bab['id']);logger['info'](_0x71cf('0x82'),_0x71cf('0x83'));emit(util[_0x71cf('0x2c')](_0x71cf('0x84'),_0x29660d['name']),'trigger:browser:url',{'uri':_0x71cf('0x85')+_0x136c42['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x211bab['id']});}})[_0x71cf('0x3a')](function(_0x2e0f79){logger[_0x71cf('0x27')](_0x71cf('0x82'),JSON[_0x71cf('0xe')](_0x2e0f79));});};exports['outbound']=function(_0x3ce26c,_0x3a88d4,_0x24a2c4,_0xa0ea3f,_0x35b62d,_0x4d4137,_0x15436a){var _0x451d78,_0x17cd11,_0x102290;_0x4d4137[_0x71cf('0x76')]=intUtil['stripTrailingSlash'](_0x4d4137[_0x71cf('0x76')]);_0x4d4137[_0x71cf('0x78')]=intUtil[_0x71cf('0x77')](_0x4d4137[_0x71cf('0x78')]);if(_0x15436a&&_0x15436a[_0x71cf('0x86')]&&_0x15436a[_0x71cf('0x86')]!==_0x71cf('0x87')){logger['info'](_0x71cf('0x88'),_0x71cf('0x89'));_0x3a88d4[_0x71cf('0x79')]=_0x4d4137[_0x71cf('0x78')]+_0x71cf('0x7a')+_0x3a88d4[_0x71cf('0x7b')]+_0x71cf('0x7c')+md5(_0x3a88d4[_0x71cf('0x7b')]);}var _0x33d9f=_0x4d4137[_0x71cf('0x76')]==='zoho.eu'?'eu':_0x71cf('0x7e');return getAccessToken(_0x4d4137)[_0x71cf('0x25')](function(_0x5470a4){_0x102290=_0x5470a4;return getUser(_0x102290,_0x33d9f,_0x4d4137,_0xa0ea3f[_0x71cf('0x32')]);})['then'](function(_0x1016d7){_0x451d78=_0x1016d7;logger[_0x71cf('0x2a')](_0x71cf('0x7f'),_0x451d78['id']);return getEndUser(_0x102290,_0x33d9f,_0x4d4137,_0x3a88d4['destcalleridname'],_0x3a88d4[_0x71cf('0x8a')],_0x451d78,_0x24a2c4);})[_0x71cf('0x25')](function(_0x1773e6){_0x17cd11=_0x1773e6;return getCall(_0x102290,_0x33d9f,_0x4d4137,_0x451d78,_0x17cd11,_0x24a2c4,_0x3a88d4,_0x71cf('0x8b'));})[_0x71cf('0x25')](function(_0x3857aa){if(_0x3857aa){logger[_0x71cf('0x2a')]('The\x20Call\x20ID\x20is:',_0x3857aa['id']);logger[_0x71cf('0x2a')]('[OUTBOUND]',_0x71cf('0x83'));emit(util[_0x71cf('0x2c')](_0x71cf('0x84'),_0xa0ea3f[_0x71cf('0x17')]),_0x71cf('0x8c'),{'uri':_0x71cf('0x85')+_0x4d4137[_0x71cf('0x76')]+_0x71cf('0x8d')+_0x3857aa['id']});}})[_0x71cf('0x3a')](function(_0x48d856){logger[_0x71cf('0x27')](_0x71cf('0x88'),JSON[_0x71cf('0xe')](_0x48d856));});};exports[_0x71cf('0x8e')]=function(_0x51c991,_0x5aabe4,_0x3da86c,_0xdaec,_0x3b5663,_0x5267c3){var _0x24cb55,_0x474e24,_0x153eb2;_0x5267c3[_0x71cf('0x76')]=intUtil[_0x71cf('0x77')](_0x5267c3[_0x71cf('0x76')]);_0x5267c3[_0x71cf('0x78')]=intUtil[_0x71cf('0x77')](_0x5267c3[_0x71cf('0x78')]);if(_0x3b5663&&_0x3b5663[_0x71cf('0x8f')]){logger[_0x71cf('0x2a')]('['+_0x5aabe4[_0x71cf('0x63')][_0x71cf('0x90')]()+']',_0x71cf('0x89'));_0x5aabe4[_0x71cf('0x79')]=_0x5267c3['serverUrl']+_0x71cf('0x7a')+_0x5aabe4['uniqueid']+_0x71cf('0x7c')+md5(_0x5aabe4[_0x71cf('0x7b')]);}else{_0x5aabe4[_0x71cf('0x79')]='';}var _0x194818=_0x5267c3[_0x71cf('0x76')]===_0x71cf('0x7d')?'eu':_0x71cf('0x7e');return getAccessToken(_0x5267c3)['then'](function(_0x3270b3){_0x153eb2=_0x3270b3;return getUser(_0x153eb2,_0x194818,_0x5267c3);})[_0x71cf('0x25')](function(_0x54d5eb){_0x24cb55=_0x54d5eb;logger[_0x71cf('0x2a')]('The\x20User\x20ID\x20is:',_0x24cb55['id']);return getEndUser(_0x153eb2,_0x194818,_0x5267c3,_0x5aabe4[_0x71cf('0x91')],_0x5aabe4[_0x71cf('0x80')],_0x24cb55,_0x3da86c);})[_0x71cf('0x25')](function(_0x1fef7a){_0x474e24=_0x1fef7a;return getCall(_0x153eb2,_0x194818,_0x5267c3,_0x24cb55,_0x474e24,_0x3da86c,_0x5aabe4,_0x71cf('0x70'));})[_0x71cf('0x25')](function(_0x2b5260){if(_0x2b5260){logger[_0x71cf('0x2a')](_0x71cf('0x81'),_0x2b5260['id']);}})['catch'](function(_0x354379){logger[_0x71cf('0x27')]('['+_0x5aabe4['lastevent']['toUpperCase']()+']',JSON[_0x71cf('0xe')](_0x354379));});};
\ No newline at end of file
index 32bae14..8f32f36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3d=['exec','data2','Script','data3','render','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','../../../../config/logger','trigger'];(function(_0x336030,_0x4086ea){var _0x2b203b=function(_0x10b0ad){while(--_0x10b0ad){_0x336030['push'](_0x336030['shift']());}};_0x2b203b(++_0x4086ea);}(_0x0b3d,0xe1));var _0xd0b3=function(_0x10a7b2,_0x37587c){_0x10a7b2=_0x10a7b2-0x0;var _0x5cf00e=_0x0b3d[_0x10a7b2];return _0x5cf00e;};'use strict';var util=require('util');var sh=require(_0xd0b3('0x0'));var Mustache=require('mustache');var logger=require(_0xd0b3('0x1'))(_0xd0b3('0x2'));exports[_0xd0b3('0x3')]=function(_0x4465f7,_0x4b2ae3){var _0x540288=_0x4465f7[_0xd0b3('0x4')]?_0x4465f7[_0xd0b3('0x4')]:_0xd0b3('0x5');var _0x2cbf0e=_0x4465f7[_0xd0b3('0x6')]?Mustache[_0xd0b3('0x7')](_0x4465f7[_0xd0b3('0x6')],_0x4b2ae3):_0x4b2ae3;sh['exec'](_0x2cbf0e,function(_0xf4c22d,_0x3960fe,_0x2b43e1){if(_0xf4c22d!==0x0){logger[_0xd0b3('0x8')](util[_0xd0b3('0x9')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x540288,_0x2cbf0e,_0xf4c22d,_0x2b43e1));}else{logger[_0xd0b3('0xa')](util[_0xd0b3('0x9')](_0xd0b3('0xb'),_0x540288,_0x2cbf0e,_0x3960fe));}});};
\ No newline at end of file
+var _0x6ac3=['%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','data3','error'];(function(_0x1274a9,_0x5043d1){var _0x5274bc=function(_0x405fe4){while(--_0x405fe4){_0x1274a9['push'](_0x1274a9['shift']());}};_0x5274bc(++_0x5043d1);}(_0x6ac3,0xe1));var _0x36ac=function(_0x5563f6,_0x3c11da){_0x5563f6=_0x5563f6-0x0;var _0x5a967a=_0x6ac3[_0x5563f6];return _0x5a967a;};'use strict';var util=require(_0x36ac('0x0'));var sh=require(_0x36ac('0x1'));var Mustache=require(_0x36ac('0x2'));var logger=require(_0x36ac('0x3'))(_0x36ac('0x4'));exports[_0x36ac('0x5')]=function(_0x3be0d7,_0x4582f0){var _0x24750d=_0x3be0d7[_0x36ac('0x6')]?_0x3be0d7[_0x36ac('0x6')]:'Script';var _0x2e7f65=_0x3be0d7['data3']?Mustache['render'](_0x3be0d7[_0x36ac('0x7')],_0x4582f0):_0x4582f0;sh[_0x36ac('0x5')](_0x2e7f65,function(_0x1b51e2,_0x5d6b72,_0x106a50){if(_0x1b51e2!==0x0){logger[_0x36ac('0x8')](util['format'](_0x36ac('0x9'),_0x24750d,_0x2e7f65,_0x1b51e2,_0x106a50));}else{logger[_0x36ac('0xa')](util[_0x36ac('0xb')](_0x36ac('0xc'),_0x24750d,_0x2e7f65,_0x5d6b72));}});};
\ No newline at end of file
index 9254cc1..ef09bc1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43e=['error','stack','GET','DELETE','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','then','isNil',',\x20request\x20body:\x20','stringify','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','lodash','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','data5','number','data6'];(function(_0xa1a1f3,_0x1f5fce){var _0x5d875a=function(_0xb35035){while(--_0xb35035){_0xa1a1f3['push'](_0xa1a1f3['shift']());}};_0x5d875a(++_0x1f5fce);}(_0xb43e,0x180));var _0xeb43=function(_0x59808b,_0x448eac){_0x59808b=_0x59808b-0x0;var _0x32e13a=_0xb43e[_0x59808b];return _0x32e13a;};'use strict';var rp=require(_0xeb43('0x0'));var util=require('util');var _=require(_0xeb43('0x1'));var Mustache=require('mustache');var logger=require(_0xeb43('0x2'))(_0xeb43('0x3'));exports[_0xeb43('0x4')]=function(_0x76ebda,_0x3bc988){var _0xf82915,_0x3c13a5;var _0x3c95bf={'method':_0x76ebda[_0xeb43('0x5')][_0xeb43('0x6')](),'uri':Mustache[_0xeb43('0x7')](_0x76ebda[_0xeb43('0x8')],_0x3bc988),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x76ebda[_0xeb43('0x9')])===_0xeb43('0xa')&&parseInt(_0x76ebda[_0xeb43('0x9')])>=0x1&&parseInt(_0x76ebda['data5'])<=0xa?parseInt(_0x76ebda['data5'])*0x3e8:0x5*0x3e8};try{_0x3c95bf['headers']=_0x76ebda['data6']?JSON['parse'](Mustache[_0xeb43('0x7')](_0x76ebda[_0xeb43('0xb')],_0x3bc988)):{};}catch(_0x594a78){logger[_0xeb43('0xc')](_0x594a78[_0xeb43('0xd')]);}switch(_0x76ebda[_0xeb43('0x5')][_0xeb43('0x6')]()){case _0xeb43('0xe'):case _0xeb43('0xf'):_0xf82915=null;_0x3c95bf['qs']=_0x3bc988;break;case'POST':case _0xeb43('0x10'):if(_0x76ebda[_0xeb43('0x11')]){try{_0xf82915=JSON[_0xeb43('0x12')](Mustache[_0xeb43('0x7')](_0x76ebda[_0xeb43('0x11')],_0x3bc988));_0x3c95bf[_0xeb43('0x13')]=_0xf82915;}catch(_0x333023){logger[_0xeb43('0xc')](_0x333023[_0xeb43('0xd')]);logger[_0xeb43('0xc')](_0xeb43('0x14'));}}else{_0xf82915=_0x3bc988;_0x3c95bf[_0xeb43('0x13')]=_0xf82915;}break;}logger[_0xeb43('0x15')](util[_0xeb43('0x16')](_0xeb43('0x17'),_0x76ebda[_0xeb43('0x5')],_0x76ebda[_0xeb43('0x8')],JSON['stringify'](_0x3c95bf)));rp(_0x3c95bf)[_0xeb43('0x18')](function(_0x2e2855){_0xf82915=!_[_0xeb43('0x19')](_0xf82915)?_0xeb43('0x1a')+_0xf82915:'';_0x3c13a5=typeof _0x2e2855[_0xeb43('0x13')]==='object'?JSON[_0xeb43('0x1b')](_0x2e2855['body']):_0x2e2855[_0xeb43('0x13')];logger[_0xeb43('0x15')](util[_0xeb43('0x16')](_0xeb43('0x1c'),_0x76ebda['data1'],_0x76ebda[_0xeb43('0x8')],_0x2e2855[_0xeb43('0x1d')],_0x3c13a5));})[_0xeb43('0x1e')](function(_0x4276d1){logger[_0xeb43('0xc')](util[_0xeb43('0x16')](_0xeb43('0x1f'),_0x76ebda['data1'],_0x76ebda[_0xeb43('0x8')],_0x4276d1[_0xeb43('0x1d')],_0x4276d1[_0xeb43('0x20')],_0x4276d1['message']));});};
\ No newline at end of file
+var _0x21fc=['error','stack','GET','DELETE','POST','PUT','data7','parse','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil','object','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6'];(function(_0xfb6a38,_0x516650){var _0x3b7a84=function(_0x5d5d3f){while(--_0x5d5d3f){_0xfb6a38['push'](_0xfb6a38['shift']());}};_0x3b7a84(++_0x516650);}(_0x21fc,0x1a2));var _0xc21f=function(_0x2baf40,_0x5ebef2){_0x2baf40=_0x2baf40-0x0;var _0x2bb2cb=_0x21fc[_0x2baf40];return _0x2bb2cb;};'use strict';var rp=require(_0xc21f('0x0'));var util=require('util');var _=require(_0xc21f('0x1'));var Mustache=require(_0xc21f('0x2'));var logger=require(_0xc21f('0x3'))(_0xc21f('0x4'));exports[_0xc21f('0x5')]=function(_0x126957,_0x4fa048){var _0x4c6dd6,_0x364a0b;var _0x872b44={'method':_0x126957[_0xc21f('0x6')][_0xc21f('0x7')](),'uri':Mustache[_0xc21f('0x8')](_0x126957[_0xc21f('0x9')],_0x4fa048),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x126957['data5'])===_0xc21f('0xa')&&parseInt(_0x126957[_0xc21f('0xb')])>=0x1&&parseInt(_0x126957['data5'])<=0xa?parseInt(_0x126957[_0xc21f('0xb')])*0x3e8:0x5*0x3e8};try{_0x872b44[_0xc21f('0xc')]=_0x126957[_0xc21f('0xd')]?JSON['parse'](Mustache['render'](_0x126957[_0xc21f('0xd')],_0x4fa048)):{};}catch(_0x5bd4e1){logger[_0xc21f('0xe')](_0x5bd4e1[_0xc21f('0xf')]);}switch(_0x126957[_0xc21f('0x6')][_0xc21f('0x7')]()){case _0xc21f('0x10'):case _0xc21f('0x11'):_0x4c6dd6=null;_0x872b44['qs']=_0x4fa048;break;case _0xc21f('0x12'):case _0xc21f('0x13'):if(_0x126957[_0xc21f('0x14')]){try{_0x4c6dd6=JSON[_0xc21f('0x15')](Mustache[_0xc21f('0x8')](_0x126957[_0xc21f('0x14')],_0x4fa048));_0x872b44[_0xc21f('0x16')]=_0x4c6dd6;}catch(_0x24cc4f){logger[_0xc21f('0xe')](_0x24cc4f['stack']);logger['error'](_0xc21f('0x17'));}}else{_0x4c6dd6=_0x4fa048;_0x872b44['body']=_0x4c6dd6;}break;}logger[_0xc21f('0x18')](util[_0xc21f('0x19')](_0xc21f('0x1a'),_0x126957[_0xc21f('0x6')],_0x126957[_0xc21f('0x9')],JSON[_0xc21f('0x1b')](_0x872b44)));rp(_0x872b44)[_0xc21f('0x1c')](function(_0x522194){_0x4c6dd6=!_[_0xc21f('0x1d')](_0x4c6dd6)?',\x20request\x20body:\x20'+_0x4c6dd6:'';_0x364a0b=typeof _0x522194[_0xc21f('0x16')]===_0xc21f('0x1e')?JSON[_0xc21f('0x1b')](_0x522194[_0xc21f('0x16')]):_0x522194[_0xc21f('0x16')];logger['info'](util['format']('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x126957[_0xc21f('0x6')],_0x126957[_0xc21f('0x9')],_0x522194[_0xc21f('0x1f')],_0x364a0b));})[_0xc21f('0x20')](function(_0x178d60){logger[_0xc21f('0xe')](util[_0xc21f('0x19')](_0xc21f('0x21'),_0x126957['data1'],_0x126957[_0xc21f('0x9')],_0x178d60[_0xc21f('0x1f')],_0x178d60[_0xc21f('0x22')],_0x178d60[_0xc21f('0x23')]));});};
\ No newline at end of file
index 5403f7e..eb2a416 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11b4=['jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error','message','result','exports'];(function(_0x2e4675,_0x271eef){var _0x246521=function(_0x1febf7){while(--_0x1febf7){_0x2e4675['push'](_0x2e4675['shift']());}};_0x246521(++_0x271eef);}(_0x11b4,0x168));var _0x411b=function(_0x4d6513,_0x35b993){_0x4d6513=_0x4d6513-0x0;var _0x23479e=_0x11b4[_0x4d6513];return _0x23479e;};'use strict';var jayson=require(_0x411b('0x0'));var BPromise=require(_0x411b('0x1'));var logger=require(_0x411b('0x2'))(_0x411b('0x3'));var client=jayson[_0x411b('0x4')][_0x411b('0x5')]({'port':0x2329});client[_0x411b('0x6')]=function(_0x3232d5,_0x37c241){return new BPromise(function(_0x10d148,_0x8cca63){return client[_0x411b('0x7')](_0x3232d5,_0x37c241)[_0x411b('0x8')](function(_0x3e5f75){logger[_0x411b('0x9')](_0x411b('0xa'),_0x411b('0x3'),_0x3232d5,_0x37c241,_0x3e5f75);if(_0x3e5f75['error']){logger['error'](_0x411b('0xa'),_0x411b('0x3'),_0x3232d5,_0x3e5f75[_0x411b('0xb')][_0x411b('0xc')],_0x37c241);return _0x8cca63(_0x3e5f75[_0x411b('0xb')][_0x411b('0xc')]);}else{return _0x10d148(_0x3e5f75[_0x411b('0xd')]);}})['catch'](function(_0x430f9e){logger[_0x411b('0xb')]('rpc',_0x411b('0x3'),_0x3232d5,_0x430f9e,_0x37c241);return _0x8cca63(_0x430f9e);});});};module[_0x411b('0xe')]=client;
\ No newline at end of file
+var _0x0129=['../../config/logger','routing','client','request','then','debug','rpc','error','message','result','exports','jayson/promise','bluebird'];(function(_0x19c39f,_0x298aa2){var _0x4c7b84=function(_0x431632){while(--_0x431632){_0x19c39f['push'](_0x19c39f['shift']());}};_0x4c7b84(++_0x298aa2);}(_0x0129,0x66));var _0x9012=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0129[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0x9012('0x0'));var BPromise=require(_0x9012('0x1'));var logger=require(_0x9012('0x2'))(_0x9012('0x3'));var client=jayson[_0x9012('0x4')]['http']({'port':0x2329});client['Request']=function(_0x520504,_0x5e112e){return new BPromise(function(_0x4df3ee,_0x4ecb08){return client[_0x9012('0x5')](_0x520504,_0x5e112e)[_0x9012('0x6')](function(_0x559901){logger[_0x9012('0x7')](_0x9012('0x8'),'routing',_0x520504,_0x5e112e,_0x559901);if(_0x559901[_0x9012('0x9')]){logger['error']('rpc',_0x9012('0x3'),_0x520504,_0x559901[_0x9012('0x9')][_0x9012('0xa')],_0x5e112e);return _0x4ecb08(_0x559901[_0x9012('0x9')]['message']);}else{return _0x4df3ee(_0x559901[_0x9012('0xb')]);}})['catch'](function(_0x5a3ab2){logger['error']('rpc',_0x9012('0x3'),_0x520504,_0x5a3ab2,_0x5e112e);return _0x4ecb08(_0x5a3ab2);});});};module[_0x9012('0xc')]=client;
\ No newline at end of file
index 204cd21..db0544c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc47e=['resolve','then','getMailAccounts','listen','getSettings','catch','error','Email\x20service\x20initialization','./realtime','./lib/email','./rpc/setting','email'];(function(_0x258553,_0x2625a1){var _0x257104=function(_0x4b4872){while(--_0x4b4872){_0x258553['push'](_0x258553['shift']());}};_0x257104(++_0x2625a1);}(_0xc47e,0x170));var _0xec47=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xc47e[_0x49052b];return _0x48c045;};'use strict';var server=require('./server');var Realtime=require(_0xec47('0x0'));var EmailChannel=require(_0xec47('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xec47('0x2'));var logger=require('../../config/logger')(_0xec47('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xec47('0x4')]()[_0xec47('0x5')](mailAccount[_0xec47('0x6')]())[_0xec47('0x5')](realtime['initMailAccounts']())[_0xec47('0x5')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xec47('0x7')](realtime,email)[_0xec47('0x5')](function(){return initRealtime();})['then'](function(){return setting[_0xec47('0x8')]();})['then'](function(_0x2c6eb3){return setInterval(initRealtime,_0x2c6eb3['loginMailFrequency']*0x3e8);})[_0xec47('0x9')](function(_0x2f0d06){logger[_0xec47('0xa')](_0xec47('0xb'),_0x2f0d06);});}main();
\ No newline at end of file
+var _0xf1ba=['catch','error','./server','./lib/email','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x5e5568,_0x300d0d){var _0x557045=function(_0x2ee76c){while(--_0x2ee76c){_0x5e5568['push'](_0x5e5568['shift']());}};_0x557045(++_0x300d0d);}(_0xf1ba,0x154));var _0xaf1b=function(_0x1e4a72,_0x1e9e88){_0x1e4a72=_0x1e4a72-0x0;var _0x191457=_0xf1ba[_0x1e4a72];return _0x191457;};'use strict';var server=require(_0xaf1b('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0xaf1b('0x1'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0xaf1b('0x2'))(_0xaf1b('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xaf1b('0x4')]()[_0xaf1b('0x5')](mailAccount[_0xaf1b('0x6')]())[_0xaf1b('0x5')](realtime[_0xaf1b('0x7')]())[_0xaf1b('0x5')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xaf1b('0x8')](realtime,email)[_0xaf1b('0x5')](function(){return initRealtime();})[_0xaf1b('0x5')](function(){return setting[_0xaf1b('0x9')]();})[_0xaf1b('0x5')](function(_0x2a3dcd){return setInterval(initRealtime,_0x2a3dcd[_0xaf1b('0xa')]*0x3e8);})[_0xaf1b('0xb')](function(_0x585cbf){logger[_0xaf1b('0xc')]('Email\x20service\x20initialization',_0x585cbf);});}main();
\ No newline at end of file
index e406cc5..c6c5315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6d7=['handleImapError','disabled','handleImapBox','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','imapAccounts','box','handleImapEmail','bind','end','handleImapEnd','error'];(function(_0x41d432,_0x20e878){var _0x1650f9=function(_0x27f177){while(--_0x27f177){_0x41d432['push'](_0x41d432['shift']());}};_0x1650f9(++_0x20e878);}(_0xf6d7,0x1e3));var _0x7f6d=function(_0x1b640f,_0x215390){_0x1b640f=_0x1b640f-0x0;var _0x560770=_0xf6d7[_0x1b640f];return _0x560770;};'use strict';var _=require(_0x7f6d('0x0'));var moment=require(_0x7f6d('0x1'));var BPromise=require(_0x7f6d('0x2'));var md5=require(_0x7f6d('0x3'));var Redis=require(_0x7f6d('0x4'));var config=require(_0x7f6d('0x5'));var logger=require(_0x7f6d('0x6'))(_0x7f6d('0x7'));config[_0x7f6d('0x8')]=_['defaults'](config['redis'],{'host':_0x7f6d('0x9'),'port':0x18eb});var io=require(_0x7f6d('0xa'))(new Redis(config[_0x7f6d('0x8')]));var EmailImap=require(_0x7f6d('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x7f6d('0xc'));var md5Accounts={};function EmailChannel(_0x2132a0){logger[_0x7f6d('0xd')]('start\x20email\x20channel');this[_0x7f6d('0xe')]=_0x2132a0['mailAccounts'];this['imapAccounts']={};this[_0x7f6d('0xf')]=new EmailSmtp();}EmailChannel[_0x7f6d('0x10')][_0x7f6d('0x11')]=function(_0x197867){var _0x5e9cdb=this[_0x7f6d('0xe')][_0x197867];var _0x1cded2={'id':_0x5e9cdb['id'],'name':_0x5e9cdb[_0x7f6d('0x12')],'key':_0x5e9cdb[_0x7f6d('0x13')],'active':_0x5e9cdb[_0x7f6d('0x14')],'Imap':{'status':_0x5e9cdb[_0x7f6d('0x15')][_0x7f6d('0x16')],'messageStatus':_0x5e9cdb[_0x7f6d('0x15')][_0x7f6d('0x17')],'total':_0x5e9cdb[_0x7f6d('0x15')][_0x7f6d('0x18')]}};if(_[_0x7f6d('0x19')](md5Accounts[_0x197867])){md5Accounts[_0x197867]={};}var _0x10f0df=md5(JSON[_0x7f6d('0x1a')](_0x1cded2));if(md5Accounts[_0x197867]['md5']!==_0x10f0df){md5Accounts[_0x197867]['md5']=_0x10f0df;io[_0x7f6d('0x11')](_0x7f6d('0x1b'),_0x1cded2);}};EmailChannel[_0x7f6d('0x10')][_0x7f6d('0x1c')]=function(_0x3b4901){for(var _0x274a14 in _0x3b4901){if(_0x3b4901[_0x7f6d('0x1d')](_0x274a14)){if(_0x3b4901[_0x274a14][_0x7f6d('0x15')]&&_0x3b4901[_0x274a14]['active']){var _0xe1d54c=_0x3b4901[_0x274a14][_0x7f6d('0x15')];if(!_0xe1d54c[_0x7f6d('0x1e')]&&_0x3b4901[_0x274a14][_0x7f6d('0x1f')]!=='custom')_0xe1d54c['service']=_0x3b4901[_0x274a14][_0x7f6d('0x1f')];if(!this['imapAccounts'][_0x7f6d('0x1d')](_0xe1d54c['id'])){this[_0x7f6d('0x20')][_0xe1d54c['id']]=new EmailImap(_0xe1d54c,_0x3b4901[_0x274a14]['email']);this[_0x7f6d('0x20')][_0xe1d54c['id']]['on'](_0x7f6d('0x21'),this['handleImapBox']['bind'](this,_0x274a14));this[_0x7f6d('0x20')][_0xe1d54c['id']]['on']('email',this[_0x7f6d('0x22')][_0x7f6d('0x23')](this,_0x274a14));this['imapAccounts'][_0xe1d54c['id']]['on'](_0x7f6d('0x24'),this[_0x7f6d('0x25')][_0x7f6d('0x23')](this,_0x274a14));this[_0x7f6d('0x20')][_0xe1d54c['id']]['on'](_0x7f6d('0x26'),this[_0x7f6d('0x27')][_0x7f6d('0x23')](this,_0x274a14));}}else{if(_[_0x7f6d('0x19')](this[_0x7f6d('0xe')][_0x274a14][_0x7f6d('0x15')])){this[_0x7f6d('0xe')][_0x274a14][_0x7f6d('0x15')]={};}this[_0x7f6d('0xe')][_0x274a14][_0x7f6d('0x15')][_0x7f6d('0x16')]=_0x7f6d('0x28');this[_0x7f6d('0xe')][_0x274a14][_0x7f6d('0x15')][_0x7f6d('0x17')]='';this['emit'](_0x274a14);}}}};EmailChannel[_0x7f6d('0x10')][_0x7f6d('0x29')]=function(_0x4c26a4,_0x449032){if(this[_0x7f6d('0xe')][_0x4c26a4]){this[_0x7f6d('0xe')][_0x4c26a4][_0x7f6d('0x15')][_0x7f6d('0x16')]=_0x7f6d('0x2a');this[_0x7f6d('0xe')][_0x4c26a4]['Imap'][_0x7f6d('0x17')]=_0x449032[_0x7f6d('0x12')];if(_0x449032[_0x7f6d('0x2b')]){this['mailAccounts'][_0x4c26a4][_0x7f6d('0x15')][_0x7f6d('0x18')]=_0x449032[_0x7f6d('0x2b')][_0x7f6d('0x18')];}return this[_0x7f6d('0x11')](_0x4c26a4);}};EmailChannel['prototype'][_0x7f6d('0x22')]=function(_0x6dfd61,_0x1af046){logger['info'](_0x7f6d('0x2c'),_0x1af046['firstName'],_0x1af046[_0x7f6d('0x2d')],_0x1af046[_0x7f6d('0x2e')],_0x6dfd61);if(this[_0x7f6d('0xe')][_0x6dfd61]){return mailAccount[_0x7f6d('0x2f')](_0x6dfd61,_0x1af046)[_0x7f6d('0x30')](function(_0xb55554){if(_0xb55554){logger[_0x7f6d('0xd')]('Mail\x20accepted\x20from\x20routing');}})[_0x7f6d('0x31')](function(_0x7def7c){logger['error'](_0x7f6d('0x32'),JSON[_0x7f6d('0x1a')](_0x7def7c));});}};EmailChannel[_0x7f6d('0x10')][_0x7f6d('0x25')]=function(_0x4816b5){if(this[_0x7f6d('0xe')][_0x4816b5]&&this[_0x7f6d('0xe')][_0x4816b5][_0x7f6d('0x15')]){if(this['imapAccounts'][this[_0x7f6d('0xe')][_0x4816b5][_0x7f6d('0x15')]['id']]){delete this[_0x7f6d('0x20')][this['mailAccounts'][_0x4816b5]['Imap']['id']];}this[_0x7f6d('0xe')][_0x4816b5]['Imap'][_0x7f6d('0x33')]=moment();this['emit'](_0x4816b5);}};EmailChannel['prototype'][_0x7f6d('0x27')]=function(_0x4d0c91,_0x2b3a11){if(this[_0x7f6d('0xe')][_0x4d0c91]){this[_0x7f6d('0xe')][_0x4d0c91][_0x7f6d('0x15')][_0x7f6d('0x16')]=_0x7f6d('0x26');this[_0x7f6d('0xe')][_0x4d0c91][_0x7f6d('0x15')]['messageStatus']=_0x2b3a11;return this[_0x7f6d('0x11')](_0x4d0c91);}};EmailChannel[_0x7f6d('0x10')]['sendMail']=function(_0x26ebf2,_0x5092da){return this[_0x7f6d('0xf')][_0x7f6d('0x34')](_0x26ebf2,_0x5092da);};EmailChannel[_0x7f6d('0x10')][_0x7f6d('0x35')]=function(_0x2713a1){var _0x3e2805=this;if(this[_0x7f6d('0xe')][_0x2713a1['id']]){if(_[_0x7f6d('0x19')](this[_0x7f6d('0xe')][_0x2713a1['id']][_0x7f6d('0x36')])){this[_0x7f6d('0xe')][_0x2713a1['id']][_0x7f6d('0x36')]={};}this['mailAccounts'][_0x2713a1['id']][_0x7f6d('0x36')][_0x7f6d('0x33')]=moment();return new BPromise(function(_0x37908e,_0x13a4d2){return _0x3e2805[_0x7f6d('0xf')][_0x7f6d('0x37')](_0x2713a1)[_0x7f6d('0x30')](function(_0x24623a){_0x3e2805[_0x7f6d('0xe')][_0x2713a1['id']][_0x7f6d('0x36')][_0x7f6d('0x16')]=_0x7f6d('0x38');_0x3e2805[_0x7f6d('0xe')][_0x2713a1['id']]['Smtp'][_0x7f6d('0x17')]='';_0x3e2805['emit'](_0x2713a1['id']);_0x37908e(_0x24623a);})[_0x7f6d('0x31')](function(_0x1dd381){_0x3e2805[_0x7f6d('0xe')][_0x2713a1['id']][_0x7f6d('0x36')][_0x7f6d('0x16')]=_0x7f6d('0x26');_0x3e2805[_0x7f6d('0xe')][_0x2713a1['id']][_0x7f6d('0x36')][_0x7f6d('0x17')]=_0x1dd381;_0x3e2805['emit'](_0x2713a1['id']);_0x13a4d2(_0x1dd381);});});}return this[_0x7f6d('0xf')]['verify'](_0x2713a1);};module[_0x7f6d('0x39')]=EmailChannel;
\ No newline at end of file
+var _0x1a17=['total','isNil','mailAccount:update','prototype','hasOwnProperty','provider','custom','service','box','bind','handleImapEmail','handleImapEnd','handleImapError','status','disabled','emit','connected','messages','info','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','send','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','localhost','./imap','./smtp','../rpc/mailAccount','mailAccounts','imapAccounts','smtp','name','active','Imap','messageStatus'];(function(_0x5bfdbb,_0xefba86){var _0x16cf9a=function(_0x23d98f){while(--_0x23d98f){_0x5bfdbb['push'](_0x5bfdbb['shift']());}};_0x16cf9a(++_0xefba86);}(_0x1a17,0x8c));var _0x71a1=function(_0x121cb3,_0x126008){_0x121cb3=_0x121cb3-0x0;var _0x35e158=_0x1a17[_0x121cb3];return _0x35e158;};'use strict';var _=require(_0x71a1('0x0'));var moment=require(_0x71a1('0x1'));var BPromise=require(_0x71a1('0x2'));var md5=require(_0x71a1('0x3'));var Redis=require(_0x71a1('0x4'));var config=require(_0x71a1('0x5'));var logger=require('../../../config/logger')(_0x71a1('0x6'));config['redis']=_['defaults'](config[_0x71a1('0x7')],{'host':_0x71a1('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x71a1('0x9'));var EmailSmtp=require(_0x71a1('0xa'));var mailAccount=require(_0x71a1('0xb'));var md5Accounts={};function EmailChannel(_0x1537a9){logger['info']('start\x20email\x20channel');this['mailAccounts']=_0x1537a9[_0x71a1('0xc')];this[_0x71a1('0xd')]={};this[_0x71a1('0xe')]=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0x4acf6a){var _0x2ec0ec=this[_0x71a1('0xc')][_0x4acf6a];var _0x1a87a9={'id':_0x2ec0ec['id'],'name':_0x2ec0ec[_0x71a1('0xf')],'key':_0x2ec0ec['key'],'active':_0x2ec0ec[_0x71a1('0x10')],'Imap':{'status':_0x2ec0ec[_0x71a1('0x11')]['status'],'messageStatus':_0x2ec0ec['Imap'][_0x71a1('0x12')],'total':_0x2ec0ec[_0x71a1('0x11')][_0x71a1('0x13')]}};if(_[_0x71a1('0x14')](md5Accounts[_0x4acf6a])){md5Accounts[_0x4acf6a]={};}var _0x140612=md5(JSON['stringify'](_0x1a87a9));if(md5Accounts[_0x4acf6a][_0x71a1('0x3')]!==_0x140612){md5Accounts[_0x4acf6a][_0x71a1('0x3')]=_0x140612;io['emit'](_0x71a1('0x15'),_0x1a87a9);}};EmailChannel[_0x71a1('0x16')]['refresh']=function(_0x3a8fea){for(var _0x1f04a7 in _0x3a8fea){if(_0x3a8fea[_0x71a1('0x17')](_0x1f04a7)){if(_0x3a8fea[_0x1f04a7][_0x71a1('0x11')]&&_0x3a8fea[_0x1f04a7][_0x71a1('0x10')]){var _0x41c1ed=_0x3a8fea[_0x1f04a7][_0x71a1('0x11')];if(!_0x41c1ed['service']&&_0x3a8fea[_0x1f04a7][_0x71a1('0x18')]!==_0x71a1('0x19'))_0x41c1ed[_0x71a1('0x1a')]=_0x3a8fea[_0x1f04a7]['provider'];if(!this[_0x71a1('0xd')][_0x71a1('0x17')](_0x41c1ed['id'])){this[_0x71a1('0xd')][_0x41c1ed['id']]=new EmailImap(_0x41c1ed,_0x3a8fea[_0x1f04a7][_0x71a1('0x6')]);this['imapAccounts'][_0x41c1ed['id']]['on'](_0x71a1('0x1b'),this['handleImapBox'][_0x71a1('0x1c')](this,_0x1f04a7));this['imapAccounts'][_0x41c1ed['id']]['on'](_0x71a1('0x6'),this[_0x71a1('0x1d')]['bind'](this,_0x1f04a7));this[_0x71a1('0xd')][_0x41c1ed['id']]['on']('end',this[_0x71a1('0x1e')][_0x71a1('0x1c')](this,_0x1f04a7));this[_0x71a1('0xd')][_0x41c1ed['id']]['on']('error',this[_0x71a1('0x1f')][_0x71a1('0x1c')](this,_0x1f04a7));}}else{if(_[_0x71a1('0x14')](this[_0x71a1('0xc')][_0x1f04a7][_0x71a1('0x11')])){this[_0x71a1('0xc')][_0x1f04a7][_0x71a1('0x11')]={};}this[_0x71a1('0xc')][_0x1f04a7][_0x71a1('0x11')][_0x71a1('0x20')]=_0x71a1('0x21');this[_0x71a1('0xc')][_0x1f04a7][_0x71a1('0x11')][_0x71a1('0x12')]='';this[_0x71a1('0x22')](_0x1f04a7);}}}};EmailChannel[_0x71a1('0x16')]['handleImapBox']=function(_0x26fbf6,_0x3a37d7){if(this[_0x71a1('0xc')][_0x26fbf6]){this[_0x71a1('0xc')][_0x26fbf6]['Imap']['status']=_0x71a1('0x23');this[_0x71a1('0xc')][_0x26fbf6]['Imap'][_0x71a1('0x12')]=_0x3a37d7['name'];if(_0x3a37d7[_0x71a1('0x24')]){this[_0x71a1('0xc')][_0x26fbf6][_0x71a1('0x11')][_0x71a1('0x13')]=_0x3a37d7['messages']['total'];}return this[_0x71a1('0x22')](_0x26fbf6);}};EmailChannel['prototype'][_0x71a1('0x1d')]=function(_0x52513c,_0x2b8268){logger[_0x71a1('0x25')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x2b8268[_0x71a1('0x26')],_0x2b8268[_0x71a1('0x27')],_0x2b8268[_0x71a1('0x28')],_0x52513c);if(this['mailAccounts'][_0x52513c]){return mailAccount[_0x71a1('0x29')](_0x52513c,_0x2b8268)[_0x71a1('0x2a')](function(_0x27c12a){if(_0x27c12a){logger['info'](_0x71a1('0x2b'));}})[_0x71a1('0x2c')](function(_0x3cc877){logger[_0x71a1('0x2d')](_0x71a1('0x2e'),JSON[_0x71a1('0x2f')](_0x3cc877));});}};EmailChannel[_0x71a1('0x16')][_0x71a1('0x1e')]=function(_0x1b475b){if(this[_0x71a1('0xc')][_0x1b475b]&&this[_0x71a1('0xc')][_0x1b475b][_0x71a1('0x11')]){if(this['imapAccounts'][this[_0x71a1('0xc')][_0x1b475b][_0x71a1('0x11')]['id']]){delete this[_0x71a1('0xd')][this['mailAccounts'][_0x1b475b][_0x71a1('0x11')]['id']];}this[_0x71a1('0xc')][_0x1b475b]['Imap'][_0x71a1('0x30')]=moment();this[_0x71a1('0x22')](_0x1b475b);}};EmailChannel[_0x71a1('0x16')]['handleImapError']=function(_0x5a46b6,_0x82a678){if(this[_0x71a1('0xc')][_0x5a46b6]){this['mailAccounts'][_0x5a46b6][_0x71a1('0x11')][_0x71a1('0x20')]=_0x71a1('0x2d');this[_0x71a1('0xc')][_0x5a46b6][_0x71a1('0x11')][_0x71a1('0x12')]=_0x82a678;return this[_0x71a1('0x22')](_0x5a46b6);}};EmailChannel[_0x71a1('0x16')]['sendMail']=function(_0x268624,_0x4bc2b5){return this[_0x71a1('0xe')][_0x71a1('0x31')](_0x268624,_0x4bc2b5);};EmailChannel['prototype']['verifySmtp']=function(_0x59405a){var _0x53ae5a=this;if(this['mailAccounts'][_0x59405a['id']]){if(_[_0x71a1('0x14')](this[_0x71a1('0xc')][_0x59405a['id']][_0x71a1('0x32')])){this[_0x71a1('0xc')][_0x59405a['id']][_0x71a1('0x32')]={};}this[_0x71a1('0xc')][_0x59405a['id']]['Smtp'][_0x71a1('0x30')]=moment();return new BPromise(function(_0xefd9f5,_0x20a893){return _0x53ae5a[_0x71a1('0xe')][_0x71a1('0x33')](_0x59405a)[_0x71a1('0x2a')](function(_0x1091b1){_0x53ae5a[_0x71a1('0xc')][_0x59405a['id']]['Smtp'][_0x71a1('0x20')]='verified';_0x53ae5a[_0x71a1('0xc')][_0x59405a['id']][_0x71a1('0x32')]['messageStatus']='';_0x53ae5a['emit'](_0x59405a['id']);_0xefd9f5(_0x1091b1);})[_0x71a1('0x2c')](function(_0xa26419){_0x53ae5a['mailAccounts'][_0x59405a['id']][_0x71a1('0x32')][_0x71a1('0x20')]=_0x71a1('0x2d');_0x53ae5a['mailAccounts'][_0x59405a['id']][_0x71a1('0x32')][_0x71a1('0x12')]=_0xa26419;_0x53ae5a['emit'](_0x59405a['id']);_0x20a893(_0xa26419);});});}return this[_0x71a1('0xe')][_0x71a1('0x33')](_0x59405a);};module[_0x71a1('0x34')]=EmailChannel;
\ No newline at end of file
index bb04f7c..2dc569b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f5=['closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','lodash','util','imap','mailparser','iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','anonymous@xcally.com','xoauth2','generateXOAuth2Token','data5','password','host','port','tls','autotls','required','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd'];(function(_0x23484a,_0x5cef4e){var _0x5499bb=function(_0x38ab7f){while(--_0x38ab7f){_0x23484a['push'](_0x23484a['shift']());}};_0x5499bb(++_0x5cef4e);}(_0x13f5,0xc3));var _0x513f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x13f5[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x513f('0x0'));var util=require(_0x513f('0x1'));var Imap=require(_0x513f('0x2'));var simpleParser=require(_0x513f('0x3'))['simpleParser'];var Iconv=require(_0x513f('0x4'))['Iconv'];var EventEmitter=require('events')[_0x513f('0x5')];var utils=require(_0x513f('0x6'));var logger=require(_0x513f('0x7'))(_0x513f('0x8'));function EmailImap(_0x8d019b,_0x579681){this[_0x513f('0x9')]=_0x513f('0xa');this[_0x513f('0xb')]=this[_0x513f('0xc')](_0x8d019b,_0x579681);this[_0x513f('0x2')]=new Imap(this[_0x513f('0xb')]);this['imap'][_0x513f('0xd')](_0x513f('0xe'),this[_0x513f('0xf')][_0x513f('0x10')](this));this[_0x513f('0x2')]['once'](_0x513f('0x11'),this[_0x513f('0x12')]['bind'](this));this[_0x513f('0x2')]['on'](_0x513f('0x13'),this[_0x513f('0x14')][_0x513f('0x10')](this));this[_0x513f('0x2')][_0x513f('0x15')]();}util[_0x513f('0x16')](EmailImap,EventEmitter);EmailImap[_0x513f('0x17')][_0x513f('0xc')]=function(_0x2356ab,_0x3958ab){var _0x359478={'connTimeout':_0x2356ab[_0x513f('0x18')]?_0x2356ab[_0x513f('0x18')]*0x3e8:0x2710,'authTimeout':_0x2356ab['authTimeout']?_0x2356ab[_0x513f('0x19')]*0x3e8:0x1388};if(_0x2356ab['service']){_0x359478[_0x513f('0x1a')]=_0x2356ab[_0x513f('0x1a')];_0x359478[_0x513f('0x8')]=_0x3958ab||_0x2356ab[_0x513f('0x1a')]||_0x513f('0x1b');if(_0x2356ab['modernAuthentication']){_0x359478[_0x513f('0x1c')]=utils[_0x513f('0x1d')](_0x2356ab['CloudProvider'][_0x513f('0x1e')],_0x2356ab['user']);}else{_0x359478[_0x513f('0x1f')]=_0x2356ab[_0x513f('0x1f')];}}else{if(_0x2356ab['authentication']){_0x359478[_0x513f('0x1a')]=_0x2356ab[_0x513f('0x1a')];_0x359478[_0x513f('0x1f')]=_0x2356ab[_0x513f('0x1f')];}}_0x359478[_0x513f('0x20')]=_0x2356ab[_0x513f('0x20')];_0x359478['port']=_0x2356ab[_0x513f('0x21')]||0x3e1;if(_0x2356ab[_0x513f('0x22')]){_0x359478['tls']=!![];}else{_0x359478[_0x513f('0x22')]=![];_0x359478[_0x513f('0x23')]=_0x513f('0x24');}return _0x359478;};EmailImap[_0x513f('0x17')][_0x513f('0xf')]=function(){this[_0x513f('0x2')]['openBox'](this['mailbox'],![],this['handleOpenBox'][_0x513f('0x10')](this));};EmailImap[_0x513f('0x17')][_0x513f('0x25')]=function(_0x1069d4,_0x2191d4){if(_0x1069d4){this[_0x513f('0x14')](_0x1069d4,!![]);}else{this[_0x513f('0x26')](_0x513f('0x27'),_0x2191d4);this[_0x513f('0x28')]();}};EmailImap['prototype'][_0x513f('0x29')]=function(_0xf6a76a){if(_0xf6a76a){this[_0x513f('0x14')](_0xf6a76a,!![]);}else{this[_0x513f('0x2')]['end']();}};EmailImap[_0x513f('0x17')][_0x513f('0x28')]=function(){this['imap'][_0x513f('0x2a')](['UNSEEN'],this['handleReadUnseen'][_0x513f('0x10')](this));};EmailImap[_0x513f('0x17')][_0x513f('0x2b')]=function(_0x2154d2,_0x4c7d10){if(_0x2154d2){this[_0x513f('0x14')](_0x2154d2,!![]);}else{if(_0x4c7d10[_0x513f('0x2c')]){try{var _0xd8023d=this[_0x513f('0x2')]['fetch'](_0x4c7d10,{'bodies':'','markSeen':!![]});_0xd8023d['on'](_0x513f('0x2d'),this[_0x513f('0x2e')][_0x513f('0x10')](this));_0xd8023d[_0x513f('0xd')](_0x513f('0x13'),this[_0x513f('0x2f')]['bind'](this));_0xd8023d['once'](_0x513f('0x11'),this[_0x513f('0x30')]['bind'](this));}catch(_0x4a11f7){logger[_0x513f('0x13')](_0x4a11f7);}}else{this[_0x513f('0x2')][_0x513f('0x31')](!![],this['handleCloseBox'][_0x513f('0x10')](this));}}};EmailImap[_0x513f('0x17')]['handleFetchMessage']=function(_0x45d134){_0x45d134['on'](_0x513f('0x32'),this[_0x513f('0x33')][_0x513f('0x10')](this));_0x45d134[_0x513f('0xd')](_0x513f('0x34'),this[_0x513f('0x35')][_0x513f('0x10')](this));_0x45d134[_0x513f('0xd')]('end',this[_0x513f('0x36')]['bind'](this));};EmailImap['prototype'][_0x513f('0x33')]=function(_0x571e6d){simpleParser(_0x571e6d,{'Iconv':Iconv},this[_0x513f('0x37')][_0x513f('0x10')](this));};EmailImap['prototype'][_0x513f('0x35')]=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0x513f('0x17')][_0x513f('0x37')]=function(_0x223e2d,_0x3a8928){if(_0x223e2d){logger[_0x513f('0x13')](_0x223e2d);}else{var _0x531fd6=this;utils[_0x513f('0x38')](this[_0x513f('0xb')],_0x3a8928,function(_0x4ff9c9){_0x531fd6[_0x513f('0x26')](_0x513f('0x8'),_0x4ff9c9);});}};EmailImap[_0x513f('0x17')][_0x513f('0x30')]=function(){this[_0x513f('0x2')]['closeBox'](!![],this[_0x513f('0x29')][_0x513f('0x10')](this));};EmailImap[_0x513f('0x17')][_0x513f('0x2f')]=function(_0x51bf13){this['handleError'](_0x51bf13);this[_0x513f('0x2')][_0x513f('0x31')](!![],this[_0x513f('0x29')][_0x513f('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x513f('0x26')](_0x513f('0x11'));};EmailImap[_0x513f('0x17')][_0x513f('0x14')]=function(_0x17733b,_0x4e4981){logger[_0x513f('0x13')](_0x513f('0x14'),this[_0x513f('0xb')]['email'],JSON[_0x513f('0x39')](_0x17733b));var _0x46375b='';if(_0x17733b){if(_0x17733b['textCode']){_0x46375b=_0x17733b[_0x513f('0x3a')];}else{for(var _0x258198 in _0x17733b){if(_0x17733b[_0x513f('0x3b')](_0x258198)){_0x46375b+=_[_0x513f('0x3c')](_0x258198)+':\x20'+_0x17733b[_0x258198]+'\x0a';}}}}if(_0x4e4981){this[_0x513f('0x2')]['end']();}else{this[_0x513f('0x26')](_0x513f('0x13'),_0x46375b);this[_0x513f('0x26')](_0x513f('0x11'));}};module['exports']=EmailImap;
\ No newline at end of file
+var _0x68b3=['emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','Iconv','events','EventEmitter','./utils','email','mailbox','INBOX','account','getAccount','once','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','user','anonymous@xcally.com','modernAuthentication','xoauth2','data5','password','authentication','host','port','tls','autotls','required','openBox','handleOpenBox'];(function(_0x213afe,_0xa780db){var _0x37a0c4=function(_0x116efe){while(--_0x116efe){_0x213afe['push'](_0x213afe['shift']());}};_0x37a0c4(++_0xa780db);}(_0x68b3,0x1d8));var _0x368b=function(_0x5a47d4,_0x3268c4){_0x5a47d4=_0x5a47d4-0x0;var _0x5c51fa=_0x68b3[_0x5a47d4];return _0x5c51fa;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var Imap=require(_0x368b('0x2'));var simpleParser=require(_0x368b('0x3'))[_0x368b('0x4')];var Iconv=require('iconv')[_0x368b('0x5')];var EventEmitter=require(_0x368b('0x6'))[_0x368b('0x7')];var utils=require(_0x368b('0x8'));var logger=require('../../../config/logger')(_0x368b('0x9'));function EmailImap(_0x41b15b,_0x104dad){this[_0x368b('0xa')]=_0x368b('0xb');this[_0x368b('0xc')]=this[_0x368b('0xd')](_0x41b15b,_0x104dad);this[_0x368b('0x2')]=new Imap(this[_0x368b('0xc')]);this[_0x368b('0x2')][_0x368b('0xe')]('ready',this[_0x368b('0xf')][_0x368b('0x10')](this));this[_0x368b('0x2')]['once'](_0x368b('0x11'),this[_0x368b('0x12')][_0x368b('0x10')](this));this['imap']['on'](_0x368b('0x13'),this[_0x368b('0x14')]['bind'](this));this[_0x368b('0x2')][_0x368b('0x15')]();}util[_0x368b('0x16')](EmailImap,EventEmitter);EmailImap[_0x368b('0x17')][_0x368b('0xd')]=function(_0x4fffe5,_0x2b326c){var _0x40faa0={'connTimeout':_0x4fffe5['connTimeout']?_0x4fffe5[_0x368b('0x18')]*0x3e8:0x2710,'authTimeout':_0x4fffe5[_0x368b('0x19')]?_0x4fffe5[_0x368b('0x19')]*0x3e8:0x1388};if(_0x4fffe5['service']){_0x40faa0[_0x368b('0x1a')]=_0x4fffe5[_0x368b('0x1a')];_0x40faa0[_0x368b('0x9')]=_0x2b326c||_0x4fffe5['user']||_0x368b('0x1b');if(_0x4fffe5[_0x368b('0x1c')]){_0x40faa0[_0x368b('0x1d')]=utils['generateXOAuth2Token'](_0x4fffe5['CloudProvider'][_0x368b('0x1e')],_0x4fffe5[_0x368b('0x1a')]);}else{_0x40faa0[_0x368b('0x1f')]=_0x4fffe5[_0x368b('0x1f')];}}else{if(_0x4fffe5[_0x368b('0x20')]){_0x40faa0['user']=_0x4fffe5[_0x368b('0x1a')];_0x40faa0[_0x368b('0x1f')]=_0x4fffe5[_0x368b('0x1f')];}}_0x40faa0[_0x368b('0x21')]=_0x4fffe5[_0x368b('0x21')];_0x40faa0[_0x368b('0x22')]=_0x4fffe5[_0x368b('0x22')]||0x3e1;if(_0x4fffe5[_0x368b('0x23')]){_0x40faa0['tls']=!![];}else{_0x40faa0[_0x368b('0x23')]=![];_0x40faa0[_0x368b('0x24')]=_0x368b('0x25');}return _0x40faa0;};EmailImap[_0x368b('0x17')][_0x368b('0xf')]=function(){this['imap'][_0x368b('0x26')](this[_0x368b('0xa')],![],this[_0x368b('0x27')][_0x368b('0x10')](this));};EmailImap[_0x368b('0x17')][_0x368b('0x27')]=function(_0x430e16,_0x11ea2d){if(_0x430e16){this[_0x368b('0x14')](_0x430e16,!![]);}else{this[_0x368b('0x28')](_0x368b('0x29'),_0x11ea2d);this[_0x368b('0x2a')]();}};EmailImap[_0x368b('0x17')][_0x368b('0x2b')]=function(_0x4636f4){if(_0x4636f4){this[_0x368b('0x14')](_0x4636f4,!![]);}else{this[_0x368b('0x2')][_0x368b('0x11')]();}};EmailImap[_0x368b('0x17')][_0x368b('0x2a')]=function(){this[_0x368b('0x2')][_0x368b('0x2c')]([_0x368b('0x2d')],this[_0x368b('0x2e')]['bind'](this));};EmailImap['prototype'][_0x368b('0x2e')]=function(_0x2f1d52,_0x3d1ceb){if(_0x2f1d52){this[_0x368b('0x14')](_0x2f1d52,!![]);}else{if(_0x3d1ceb['length']){try{var _0x12ae59=this[_0x368b('0x2')][_0x368b('0x2f')](_0x3d1ceb,{'bodies':'','markSeen':!![]});_0x12ae59['on'](_0x368b('0x30'),this[_0x368b('0x31')]['bind'](this));_0x12ae59[_0x368b('0xe')](_0x368b('0x13'),this[_0x368b('0x32')][_0x368b('0x10')](this));_0x12ae59['once']('end',this['handleFetchEnd'][_0x368b('0x10')](this));}catch(_0x2bc363){logger[_0x368b('0x13')](_0x2bc363);}}else{this[_0x368b('0x2')][_0x368b('0x33')](!![],this['handleCloseBox'][_0x368b('0x10')](this));}}};EmailImap[_0x368b('0x17')]['handleFetchMessage']=function(_0x305097){_0x305097['on'](_0x368b('0x34'),this['handleMessageBody'][_0x368b('0x10')](this));_0x305097[_0x368b('0xe')]('attributes',this[_0x368b('0x35')]['bind'](this));_0x305097['once']('end',this[_0x368b('0x36')][_0x368b('0x10')](this));};EmailImap[_0x368b('0x17')][_0x368b('0x37')]=function(_0x3b00fe){simpleParser(_0x3b00fe,{'Iconv':Iconv},this[_0x368b('0x38')][_0x368b('0x10')](this));};EmailImap[_0x368b('0x17')][_0x368b('0x35')]=function(){};EmailImap[_0x368b('0x17')]['handleMessageEnd']=function(){};EmailImap[_0x368b('0x17')][_0x368b('0x38')]=function(_0x484cc6,_0x221210){if(_0x484cc6){logger[_0x368b('0x13')](_0x484cc6);}else{var _0x37bd6f=this;utils[_0x368b('0x39')](this[_0x368b('0xc')],_0x221210,function(_0x5b4cf9){_0x37bd6f[_0x368b('0x28')](_0x368b('0x9'),_0x5b4cf9);});}};EmailImap[_0x368b('0x17')][_0x368b('0x3a')]=function(){this['imap']['closeBox'](!![],this[_0x368b('0x2b')][_0x368b('0x10')](this));};EmailImap[_0x368b('0x17')][_0x368b('0x32')]=function(_0x248487){this[_0x368b('0x14')](_0x248487);this[_0x368b('0x2')][_0x368b('0x33')](!![],this[_0x368b('0x2b')][_0x368b('0x10')](this));};EmailImap['prototype'][_0x368b('0x12')]=function(){this[_0x368b('0x28')]('end');};EmailImap[_0x368b('0x17')][_0x368b('0x14')]=function(_0x3a9b1f,_0x360a27){logger['error'](_0x368b('0x14'),this[_0x368b('0xc')]['email'],JSON[_0x368b('0x3b')](_0x3a9b1f));var _0x1e8891='';if(_0x3a9b1f){if(_0x3a9b1f[_0x368b('0x3c')]){_0x1e8891=_0x3a9b1f['textCode'];}else{for(var _0x46a72f in _0x3a9b1f){if(_0x3a9b1f[_0x368b('0x3d')](_0x46a72f)){_0x1e8891+=_[_0x368b('0x3e')](_0x46a72f)+':\x20'+_0x3a9b1f[_0x46a72f]+'\x0a';}}}}if(_0x360a27){this['imap']['end']();}else{this[_0x368b('0x28')](_0x368b('0x13'),_0x1e8891);this['emit'](_0x368b('0x11'));}};module[_0x368b('0x3f')]=EmailImap;
\ No newline at end of file
index 6243bc2..075cc14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e0d=['Not\x20verifired','exports','nodemailer','prototype','send','createTransport','compile','sendMail','toString','verify'];(function(_0x3a03cf,_0xf70834){var _0x2e943c=function(_0x5ca0a8){while(--_0x5ca0a8){_0x3a03cf['push'](_0x3a03cf['shift']());}};_0x2e943c(++_0xf70834);}(_0x6e0d,0x16a));var _0xd6e0=function(_0x545ee6,_0x2793f7){_0x545ee6=_0x545ee6-0x0;var _0x27d741=_0x6e0d[_0x545ee6];return _0x27d741;};'use strict';var nodemailer=require(_0xd6e0('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0xd6e0('0x1')][_0xd6e0('0x2')]=function(_0x12b363,_0xd50148){return new Promise(function(_0x446cb1,_0x4e0768){var _0xd6da48=nodemailer[_0xd6e0('0x3')](_0x12b363);_0xd6da48['use'](_0xd6e0('0x4'),inlineBase64());_0xd6da48[_0xd6e0('0x5')](_0xd50148,function(_0x35ce85,_0x7b0c37){if(_0x35ce85){_0x4e0768(_0x35ce85[_0xd6e0('0x6')]());}else{_0x446cb1(_0x7b0c37);}});});};EmailSmtp[_0xd6e0('0x1')][_0xd6e0('0x7')]=function(_0x4725cf){return new Promise(function(_0x161cf3,_0x391178){var _0x430f2e=nodemailer[_0xd6e0('0x3')](_0x4725cf);_0x430f2e[_0xd6e0('0x7')](function(_0x44415c,_0x6363a9){if(_0x44415c){_0x391178(_0x44415c[_0xd6e0('0x6')]());}else{if(_0x6363a9){_0x161cf3(_0x6363a9);}else{_0x391178(_0xd6e0('0x8'));}}});});};module[_0xd6e0('0x9')]=EmailSmtp;
\ No newline at end of file
+var _0xc529=['nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail','verify','toString','exports','nodemailer'];(function(_0x1f0c5b,_0x5caaa5){var _0x1f3b29=function(_0x366368){while(--_0x366368){_0x1f0c5b['push'](_0x1f0c5b['shift']());}};_0x1f3b29(++_0x5caaa5);}(_0xc529,0x171));var _0x9c52=function(_0x1a65ee,_0x249675){_0x1a65ee=_0x1a65ee-0x0;var _0x5f23a1=_0xc529[_0x1a65ee];return _0x5f23a1;};'use strict';var nodemailer=require(_0x9c52('0x0'));var inlineBase64=require(_0x9c52('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x9c52('0x2')]=function(_0x34139d,_0x2826a8){return new Promise(function(_0x28d4da,_0x36e5a7){var _0x3cc6d5=nodemailer[_0x9c52('0x3')](_0x34139d);_0x3cc6d5[_0x9c52('0x4')](_0x9c52('0x5'),inlineBase64());_0x3cc6d5[_0x9c52('0x6')](_0x2826a8,function(_0x24ad20,_0x1d443b){if(_0x24ad20){_0x36e5a7(_0x24ad20['toString']());}else{_0x28d4da(_0x1d443b);}});});};EmailSmtp['prototype'][_0x9c52('0x7')]=function(_0x52c2dd){return new Promise(function(_0x19c8fa,_0x26cdd3){var _0x4be860=nodemailer[_0x9c52('0x3')](_0x52c2dd);_0x4be860[_0x9c52('0x7')](function(_0x28ae7a,_0x276949){if(_0x28ae7a){_0x26cdd3(_0x28ae7a[_0x9c52('0x8')]());}else{if(_0x276949){_0x19c8fa(_0x276949);}else{_0x26cdd3('Not\x20verifired');}}});});};module[_0x9c52('0x9')]=EmailSmtp;
\ No newline at end of file
index 261c63b..e03dc9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1443=['test','html','replace','includes','attachments','forEach','push','filename','_SRC','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','parser','from','subject','messageId','inReplyTo','date','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Data','auth=Bearer\x20','join','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','@xcally.com','value','name','substring','indexOf','length','Anonymous','pop','isEmpty','anonymous'];(function(_0x52976d,_0x1bd280){var _0x757b7e=function(_0x3dec56){while(--_0x3dec56){_0x52976d['push'](_0x52976d['shift']());}};_0x757b7e(++_0x1bd280);}(_0x1443,0x112));var _0x3144=function(_0x359334,_0x5d17ef){_0x359334=_0x359334-0x0;var _0x53bb24=_0x1443[_0x359334];return _0x53bb24;};'use strict';var _=require(_0x3144('0x0'));var moment=require(_0x3144('0x1'));var random=require(_0x3144('0x2'));var fs=require('fs');var path=require(_0x3144('0x3'));var util=require(_0x3144('0x4'));var tnef=require(_0x3144('0x5'));var logger=require(_0x3144('0x6'))(_0x3144('0x7'));var config=require(_0x3144('0x8'));function getAddress(_0x45bb32){var _0x13de23=_[_0x3144('0x9')](_0x45bb32['value']);return _0x13de23&&_0x13de23[_0x3144('0xa')]?_0x13de23[_0x3144('0xa')]:'anonymous'+random[_0x3144('0xb')](0x6)+_0x3144('0xc');}function getFirstName(_0x38ee76){var _0x4cc250=_['head'](_0x38ee76[_0x3144('0xd')]);if(_0x4cc250&&_0x4cc250[_0x3144('0xe')]){if(_0x4cc250[_0x3144('0xe')]==_0x4cc250[_0x3144('0xa')]){return _0x4cc250['name'][_0x3144('0xf')](0x0,_0x4cc250['name'][_0x3144('0x10')]('@'));}var _0x2bada0=_0x4cc250[_0x3144('0xe')]['split'](/\s+/);return _0x2bada0[_0x3144('0x11')]>0x1?_0x2bada0['slice'](0x0,-0x1)['join']('\x20'):_0x4cc250['name'];}return _0x3144('0x12');}function getLastName(_0x1e47a3){var _0x474b61=_[_0x3144('0x9')](_0x1e47a3[_0x3144('0xd')]);if(_0x474b61&&_0x474b61['name']){var _0x40276f=_0x474b61['name']['split'](/\s+/);return _0x40276f[_0x3144('0x11')]>0x1?_0x40276f[_0x3144('0x13')]():'';}return'';}function getMails(_0x4dae4a,_0x189fd3){var _0x3fd5a4='';for(var _0x4ac3c4=0x0;_0x4ac3c4<_0x189fd3[_0x3144('0xd')]['length'];_0x4ac3c4+=0x1){if(_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]!==_0x4dae4a){if(!_[_0x3144('0x14')](_0x3fd5a4)){_0x3fd5a4+=',';}_0x3fd5a4+=_0x189fd3['value'][_0x4ac3c4][_0x3144('0xe')]||_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]||'';_0x3fd5a4+='\x20<';_0x3fd5a4+=_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]?_0x189fd3[_0x3144('0xd')][_0x4ac3c4][_0x3144('0xa')]:_0x3144('0x15')+random['generate'](0x6)+_0x3144('0xc');_0x3fd5a4+='>';}}return _0x3fd5a4;}function parseEmail(_0x1870bf,_0x23491b,_0x1c4397){if(_0x23491b['html']){var _0x509cbd=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x509cbd[_0x3144('0x16')](_0x23491b[_0x3144('0x17')])){_0x23491b[_0x3144('0x17')]=_0x23491b[_0x3144('0x17')][_0x3144('0x18')](_0x509cbd,'');}if(_0x23491b[_0x3144('0x17')][_0x3144('0x19')]('<img')){var _0x48ddef=[];_0x23491b[_0x3144('0x1a')][_0x3144('0x1b')](_0x4dd0b8=>{_0x48ddef[_0x3144('0x1c')](_0x4dd0b8[_0x3144('0x1d')]);});var _0xf05df2=/<img.*? _SRC(.*?)[^>]+>/g;var _0x2e08d1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2155e8=_0x23491b[_0x3144('0x17')][_0x3144('0x18')](_0x2e08d1,_0x3144('0x1e'));var _0x394dbc=_0x2155e8['replace'](_0xf05df2,'_IMG');for(let _0x554f15=0x0;_0x554f15<_0x48ddef[_0x3144('0x11')];_0x554f15++){var _0xdc62eb=_0x394dbc[_0x3144('0x18')]('_IMG',_0x3144('0x1f')+_0x48ddef[_0x554f15]+_0x3144('0x20'));_0x394dbc=_0xdc62eb;}_0x23491b[_0x3144('0x17')]=_0x394dbc;}_0x1c4397[_0x3144('0x21')]=_0x23491b[_0x3144('0x17')];}else{_0x1c4397[_0x3144('0x21')]=_0x23491b[_0x3144('0x22')];}if(_0x1c4397[_0x3144('0x21')]){_0x1c4397[_0x3144('0x21')]=_0x1c4397[_0x3144('0x21')][_0x3144('0x18')](/<a\s+/gi,_0x3144('0x23'));}if(_0x23491b['to']){_0x1c4397[_0x3144('0x24')][_0x3144('0x25')]=getMails(null,_0x23491b['to']);var _0x12b085=getMails(_0x1870bf['email'],_0x23491b['to']);if(!_[_0x3144('0x14')](_0x12b085)){_0x1c4397[_0x3144('0x24')]['cc']+=_0x12b085;}}if(_0x23491b['cc']){_0x1c4397['message'][_0x3144('0x26')]=getMails(null,_0x23491b['cc']);var _0x315507=getMails(_0x1870bf[_0x3144('0x7')],_0x23491b['cc']);if(!_[_0x3144('0x14')](_0x315507)){if(!_['isEmpty'](_0x1c4397[_0x3144('0x24')]['cc'])){_0x1c4397[_0x3144('0x24')]['cc']+=',';}_0x1c4397[_0x3144('0x24')]['cc']+=_0x315507;}}if(!_['includes'](_0x1c4397[_0x3144('0x24')][_0x3144('0x25')],_0x1870bf[_0x3144('0x7')])&&!_[_0x3144('0x19')](_0x1c4397[_0x3144('0x24')][_0x3144('0x26')],_0x1870bf['email'])){_0x1c4397[_0x3144('0x24')][_0x3144('0x27')]=_0x1870bf[_0x3144('0x7')];}if(_0x23491b['attachments']&&_0x23491b[_0x3144('0x1a')][_0x3144('0x11')]){_0x1c4397['message'][_0x3144('0x28')]=_0x23491b[_0x3144('0x1a')]['length'];for(var _0x2e090d=0x0,_0x40ebdc,_0x37c28f,_0x4c09c8;_0x2e090d<_0x23491b[_0x3144('0x1a')][_0x3144('0x11')];_0x2e090d+=0x1){if(_0x23491b[_0x3144('0x1a')][_0x2e090d][_0x3144('0x29')]===_0x3144('0x2a')){_0x4c09c8=_0x23491b['attachments'][_0x2e090d][_0x3144('0x1d')]||_0x3144('0x2b')+_0x2e090d;_0x40ebdc=util[_0x3144('0x2c')](_0x3144('0x2d'),Date['now'](),_0x4c09c8);_0x37c28f=path['join'](config['root'],_0x3144('0x2e'),_0x40ebdc);fs[_0x3144('0x2f')](_0x37c28f,_0x23491b['attachments'][_0x2e090d][_0x3144('0x30')]);_0x1c4397[_0x3144('0x24')][_0x3144('0x1a')][_0x3144('0x1c')]({'name':_0x4c09c8,'basename':_0x40ebdc,'type':_0x23491b['attachments'][_0x2e090d][_0x3144('0x31')],'filepath':_0x37c28f});}}}if(_0x23491b[_0x3144('0x32')]&&_0x23491b[_0x3144('0x32')]['length']>0x0){var _0x1b8dda=[_0x3144('0x33'),_0x3144('0x34'),_0x3144('0x35')];for(var _0x572cf9=0x0;_0x572cf9<_0x23491b['headerLines'][_0x3144('0x11')];_0x572cf9++){var _0x5098a0=_[_0x3144('0x10')](_0x1b8dda,_0x23491b[_0x3144('0x32')][_0x572cf9][_0x3144('0x36')]);if(_0x5098a0>=0x0){_0x1c4397['isAutoreply']=!![];}}}return _0x1c4397;}exports[_0x3144('0x37')]=function(_0x26b069,_0x2399ea,_0x4d71b8){var _0x1964f3={'from':getAddress(_0x2399ea['from']),'firstName':getFirstName(_0x2399ea[_0x3144('0x38')]),'lastName':getLastName(_0x2399ea[_0x3144('0x38')]),'mapKey':'email','message':{'from':getMails(_0x26b069['email'],_0x2399ea['from']),'to':_0x26b069[_0x3144('0x7')],'cc':'','subject':_0x2399ea[_0x3144('0x39')]||'','messageId':_0x2399ea[_0x3144('0x3a')],'inReplyTo':_0x2399ea[_0x3144('0x3b')],'sentAt':moment(_0x2399ea[_0x3144('0x3c')])[_0x3144('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x2399ea[_0x3144('0x17')]&&!_0x2399ea['textAsHtml']){var _0x5189ac=_[_0x3144('0x3d')](_0x2399ea[_0x3144('0x1a')],{'contentType':_0x3144('0x3e')});if(_0x5189ac[_0x3144('0x11')]){logger[_0x3144('0x3f')](util[_0x3144('0x2c')](_0x3144('0x40'),_0x2399ea[_0x3144('0x3a')]));tnef[_0x3144('0x41')](_['first'](_0x5189ac)[_0x3144('0x30')],function(_0xa9f1b,_0x479696){if(_0x479696){_0x2399ea[_0x3144('0x17')]=_0x479696[_0x3144('0x42')]||_0x3144('0x43');if(_0x479696[_0x3144('0x44')]){for(var _0x56b96e=0x0;_0x56b96e<_0x479696[_0x3144('0x44')][_0x3144('0x11')];_0x56b96e++){var _0x147f2d=_0x479696[_0x3144('0x44')][_0x56b96e];_0x1964f3['message'][_0x3144('0x1a')][_0x3144('0x1c')]({'filename':_0x147f2d['Title'],'content':Buffer[_0x3144('0x38')](_0x147f2d[_0x3144('0x45')])});}}}_0x4d71b8(parseEmail(_0x26b069,_0x2399ea,_0x1964f3));});}else{_0x2399ea[_0x3144('0x17')]='<p>Empty\x20message</p>';_0x4d71b8(parseEmail(_0x26b069,_0x2399ea,_0x1964f3));}}else{_0x4d71b8(parseEmail(_0x26b069,_0x2399ea,_0x1964f3));}};exports['generateXOAuth2Token']=function(_0x4d572b,_0x2bd14e){var _0x4a494f=['user='+(_0x2bd14e||''),_0x3144('0x46')+_0x4d572b,'',''];return Buffer[_0x3144('0x38')](_0x4a494f[_0x3144('0x47')]('\ 1'),_0x3144('0x48'))[_0x3144('0x49')]('base64');};
\ No newline at end of file
+var _0xe119=['\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','attachments','attach','now','root','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','subject','inReplyTo','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','format','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','first','<p>Empty\x20message</p>','Attachments','Data','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','value','address','anonymous','generate','@xcally.com','name','indexOf','split','length','slice','join','pop','isEmpty','html','test','replace','includes','<img','forEach','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20'];(function(_0x270795,_0xd985ac){var _0x2a5708=function(_0x489816){while(--_0x489816){_0x270795['push'](_0x270795['shift']());}};_0x2a5708(++_0xd985ac);}(_0xe119,0x1d8));var _0x9e11=function(_0x349c96,_0xc56b8){_0x349c96=_0x349c96-0x0;var _0x4666e6=_0xe119[_0x349c96];return _0x4666e6;};'use strict';var _=require(_0x9e11('0x0'));var moment=require('moment');var random=require(_0x9e11('0x1'));var fs=require('fs');var path=require(_0x9e11('0x2'));var util=require(_0x9e11('0x3'));var tnef=require(_0x9e11('0x4'));var logger=require(_0x9e11('0x5'))(_0x9e11('0x6'));var config=require(_0x9e11('0x7'));function getAddress(_0x4be712){var _0x2d4122=_['head'](_0x4be712[_0x9e11('0x8')]);return _0x2d4122&&_0x2d4122[_0x9e11('0x9')]?_0x2d4122[_0x9e11('0x9')]:_0x9e11('0xa')+random[_0x9e11('0xb')](0x6)+_0x9e11('0xc');}function getFirstName(_0xa6ad3){var _0x55ef80=_['head'](_0xa6ad3[_0x9e11('0x8')]);if(_0x55ef80&&_0x55ef80['name']){if(_0x55ef80['name']==_0x55ef80[_0x9e11('0x9')]){return _0x55ef80[_0x9e11('0xd')]['substring'](0x0,_0x55ef80[_0x9e11('0xd')][_0x9e11('0xe')]('@'));}var _0x50fb4c=_0x55ef80['name'][_0x9e11('0xf')](/\s+/);return _0x50fb4c[_0x9e11('0x10')]>0x1?_0x50fb4c[_0x9e11('0x11')](0x0,-0x1)[_0x9e11('0x12')]('\x20'):_0x55ef80[_0x9e11('0xd')];}return'Anonymous';}function getLastName(_0x903b9b){var _0x8835f5=_['head'](_0x903b9b[_0x9e11('0x8')]);if(_0x8835f5&&_0x8835f5[_0x9e11('0xd')]){var _0x3adf43=_0x8835f5[_0x9e11('0xd')]['split'](/\s+/);return _0x3adf43[_0x9e11('0x10')]>0x1?_0x3adf43[_0x9e11('0x13')]():'';}return'';}function getMails(_0x491027,_0x5e2d86){var _0x58297a='';for(var _0x61e62b=0x0;_0x61e62b<_0x5e2d86[_0x9e11('0x8')][_0x9e11('0x10')];_0x61e62b+=0x1){if(_0x5e2d86[_0x9e11('0x8')][_0x61e62b][_0x9e11('0x9')]!==_0x491027){if(!_[_0x9e11('0x14')](_0x58297a)){_0x58297a+=',';}_0x58297a+=_0x5e2d86[_0x9e11('0x8')][_0x61e62b][_0x9e11('0xd')]||_0x5e2d86[_0x9e11('0x8')][_0x61e62b][_0x9e11('0x9')]||'';_0x58297a+='\x20<';_0x58297a+=_0x5e2d86[_0x9e11('0x8')][_0x61e62b][_0x9e11('0x9')]?_0x5e2d86[_0x9e11('0x8')][_0x61e62b][_0x9e11('0x9')]:_0x9e11('0xa')+random[_0x9e11('0xb')](0x6)+_0x9e11('0xc');_0x58297a+='>';}}return _0x58297a;}function parseEmail(_0x54743d,_0x577515,_0x146f1e){if(_0x577515[_0x9e11('0x15')]){var _0x4e53d2=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x4e53d2[_0x9e11('0x16')](_0x577515[_0x9e11('0x15')])){_0x577515[_0x9e11('0x15')]=_0x577515[_0x9e11('0x15')][_0x9e11('0x17')](_0x4e53d2,'');}if(_0x577515[_0x9e11('0x15')][_0x9e11('0x18')](_0x9e11('0x19'))){var _0x162aae=[];_0x577515['attachments'][_0x9e11('0x1a')](_0x405d6f=>{_0x162aae[_0x9e11('0x1b')](_0x405d6f[_0x9e11('0x1c')]);});var _0x2fdc19=/<img.*? _SRC(.*?)[^>]+>/g;var _0x7d9234=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2b6c2=_0x577515[_0x9e11('0x15')][_0x9e11('0x17')](_0x7d9234,_0x9e11('0x1d'));var _0x55b1d7=_0x2b6c2['replace'](_0x2fdc19,_0x9e11('0x1e'));for(let _0x290701=0x0;_0x290701<_0x162aae[_0x9e11('0x10')];_0x290701++){var _0x2222b5=_0x55b1d7[_0x9e11('0x17')](_0x9e11('0x1e'),_0x9e11('0x1f')+_0x162aae[_0x290701]+_0x9e11('0x20'));_0x55b1d7=_0x2222b5;}_0x577515['html']=_0x55b1d7;}_0x146f1e['body']=_0x577515[_0x9e11('0x15')];}else{_0x146f1e[_0x9e11('0x21')]=_0x577515[_0x9e11('0x22')];}if(_0x146f1e[_0x9e11('0x21')]){_0x146f1e[_0x9e11('0x21')]=_0x146f1e[_0x9e11('0x21')]['replace'](/<a\s+/gi,_0x9e11('0x23'));}if(_0x577515['to']){_0x146f1e[_0x9e11('0x24')][_0x9e11('0x25')]=getMails(null,_0x577515['to']);var _0x1949c4=getMails(_0x54743d[_0x9e11('0x6')],_0x577515['to']);if(!_[_0x9e11('0x14')](_0x1949c4)){_0x146f1e[_0x9e11('0x24')]['cc']+=_0x1949c4;}}if(_0x577515['cc']){_0x146f1e[_0x9e11('0x24')][_0x9e11('0x26')]=getMails(null,_0x577515['cc']);var _0x1bcc66=getMails(_0x54743d[_0x9e11('0x6')],_0x577515['cc']);if(!_[_0x9e11('0x14')](_0x1bcc66)){if(!_[_0x9e11('0x14')](_0x146f1e['message']['cc'])){_0x146f1e[_0x9e11('0x24')]['cc']+=',';}_0x146f1e[_0x9e11('0x24')]['cc']+=_0x1bcc66;}}if(!_[_0x9e11('0x18')](_0x146f1e[_0x9e11('0x24')][_0x9e11('0x25')],_0x54743d[_0x9e11('0x6')])&&!_[_0x9e11('0x18')](_0x146f1e[_0x9e11('0x24')]['originCc'],_0x54743d[_0x9e11('0x6')])){_0x146f1e['message'][_0x9e11('0x27')]=_0x54743d['email'];}if(_0x577515[_0x9e11('0x28')]&&_0x577515[_0x9e11('0x28')]['length']){_0x146f1e[_0x9e11('0x24')][_0x9e11('0x29')]=_0x577515['attachments'][_0x9e11('0x10')];for(var _0x54ca31=0x0,_0x36b1a8,_0x2347aa,_0x22c899;_0x54ca31<_0x577515[_0x9e11('0x28')][_0x9e11('0x10')];_0x54ca31+=0x1){if(_0x577515['attachments'][_0x54ca31]['type']==='attachment'){_0x22c899=_0x577515[_0x9e11('0x28')][_0x54ca31][_0x9e11('0x1c')]||'attachment-'+_0x54ca31;_0x36b1a8=util['format']('%s-%s',Date[_0x9e11('0x2a')](),_0x22c899);_0x2347aa=path[_0x9e11('0x12')](config[_0x9e11('0x2b')],_0x9e11('0x2c'),_0x36b1a8);fs[_0x9e11('0x2d')](_0x2347aa,_0x577515['attachments'][_0x54ca31][_0x9e11('0x2e')]);_0x146f1e['message'][_0x9e11('0x28')][_0x9e11('0x1b')]({'name':_0x22c899,'basename':_0x36b1a8,'type':_0x577515[_0x9e11('0x28')][_0x54ca31][_0x9e11('0x2f')],'filepath':_0x2347aa});}}}if(_0x577515[_0x9e11('0x30')]&&_0x577515['headerLines'][_0x9e11('0x10')]>0x0){var _0x2cf6ce=[_0x9e11('0x31'),_0x9e11('0x32'),_0x9e11('0x33')];for(var _0x3b1818=0x0;_0x3b1818<_0x577515[_0x9e11('0x30')]['length'];_0x3b1818++){var _0x21561e=_[_0x9e11('0xe')](_0x2cf6ce,_0x577515[_0x9e11('0x30')][_0x3b1818][_0x9e11('0x34')]);if(_0x21561e>=0x0){_0x146f1e[_0x9e11('0x35')]=!![];}}}return _0x146f1e;}exports['parser']=function(_0x329628,_0x1b84fc,_0x44b27b){var _0x1c3a26={'from':getAddress(_0x1b84fc[_0x9e11('0x36')]),'firstName':getFirstName(_0x1b84fc[_0x9e11('0x36')]),'lastName':getLastName(_0x1b84fc[_0x9e11('0x36')]),'mapKey':_0x9e11('0x6'),'message':{'from':getMails(_0x329628[_0x9e11('0x6')],_0x1b84fc[_0x9e11('0x36')]),'to':_0x329628[_0x9e11('0x6')],'cc':'','subject':_0x1b84fc[_0x9e11('0x37')]||'','messageId':_0x1b84fc['messageId'],'inReplyTo':_0x1b84fc[_0x9e11('0x38')],'sentAt':moment(_0x1b84fc['date'])['format'](_0x9e11('0x39')),'attach':![],'attachments':[]}};if(!_0x1b84fc['html']&&!_0x1b84fc['textAsHtml']){var _0x52640b=_[_0x9e11('0x3a')](_0x1b84fc[_0x9e11('0x28')],{'contentType':_0x9e11('0x3b')});if(_0x52640b[_0x9e11('0x10')]){logger['info'](util[_0x9e11('0x3c')](_0x9e11('0x3d'),_0x1b84fc[_0x9e11('0x3e')]));tnef['parseBuffer'](_[_0x9e11('0x3f')](_0x52640b)[_0x9e11('0x2e')],function(_0x174cbb,_0x3a654a){if(_0x3a654a){_0x1b84fc[_0x9e11('0x15')]=_0x3a654a['BodyHTML']||_0x9e11('0x40');if(_0x3a654a[_0x9e11('0x41')]){for(var _0x50817a=0x0;_0x50817a<_0x3a654a[_0x9e11('0x41')][_0x9e11('0x10')];_0x50817a++){var _0x1b4969=_0x3a654a[_0x9e11('0x41')][_0x50817a];_0x1c3a26[_0x9e11('0x24')]['attachments']['push']({'filename':_0x1b4969['Title'],'content':Buffer[_0x9e11('0x36')](_0x1b4969[_0x9e11('0x42')])});}}}_0x44b27b(parseEmail(_0x329628,_0x1b84fc,_0x1c3a26));});}else{_0x1b84fc[_0x9e11('0x15')]='<p>Empty\x20message</p>';_0x44b27b(parseEmail(_0x329628,_0x1b84fc,_0x1c3a26));}}else{_0x44b27b(parseEmail(_0x329628,_0x1b84fc,_0x1c3a26));}};exports[_0x9e11('0x43')]=function(_0x2fbee6,_0x59b682){var _0x35f7f6=[_0x9e11('0x44')+(_0x59b682||''),'auth=Bearer\x20'+_0x2fbee6,'',''];return Buffer['from'](_0x35f7f6['join']('\ 1'),_0x9e11('0x45'))[_0x9e11('0x46')](_0x9e11('0x47'));};
\ No newline at end of file
index 4c59a0f..a759761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c96=['lodash','key','SERV','active','Imap','Smtp','exports'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x5c96,0x196));var _0x65c9=function(_0x545cf0,_0x293681){_0x545cf0=_0x545cf0-0x0;var _0x3c7558=_0x5c96[_0x545cf0];return _0x3c7558;};'use strict';var _=require(_0x65c9('0x0'));function MailAccount(_0x2cb9bc){this['id']=_0x2cb9bc['id']||0x0;this['name']=_0x2cb9bc['name']||'Service';this[_0x65c9('0x1')]=_0x2cb9bc[_0x65c9('0x1')]||_0x65c9('0x2');this['active']=_0x2cb9bc[_0x65c9('0x3')]||![];this[_0x65c9('0x4')]=_0x2cb9bc[_0x65c9('0x4')]||[];this['Smtp']=_0x2cb9bc[_0x65c9('0x5')]||[];}module[_0x65c9('0x6')]=MailAccount;
\ No newline at end of file
+var _0x3c5a=['Smtp','lodash','Service','key','SERV','active'];(function(_0x2d7fbe,_0x44b669){var _0x3a93ac=function(_0x101520){while(--_0x101520){_0x2d7fbe['push'](_0x2d7fbe['shift']());}};_0x3a93ac(++_0x44b669);}(_0x3c5a,0xa3));var _0xa3c5=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x3c5a[_0x5a1cc9];return _0x471761;};'use strict';var _=require(_0xa3c5('0x0'));function MailAccount(_0x2633b3){this['id']=_0x2633b3['id']||0x0;this['name']=_0x2633b3['name']||_0xa3c5('0x1');this[_0xa3c5('0x2')]=_0x2633b3[_0xa3c5('0x2')]||_0xa3c5('0x3');this['active']=_0x2633b3[_0xa3c5('0x4')]||![];this['Imap']=_0x2633b3['Imap']||[];this[_0xa3c5('0x5')]=_0x2633b3[_0xa3c5('0x5')]||[];}module['exports']=MailAccount;
\ No newline at end of file
index 1f7a48c..d1eb1a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430b=['initMailAccounts','length','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase'];(function(_0x32ae99,_0x29a42e){var _0x2b53e8=function(_0x23cfef){while(--_0x23cfef){_0x32ae99['push'](_0x32ae99['shift']());}};_0x2b53e8(++_0x29a42e);}(_0x430b,0xa4));var _0xb430=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x430b[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xb430('0x0'));var MailAccount=require(_0xb430('0x1'));var Realtime=function(){this[_0xb430('0x2')]={};};function freeIsNotKey(_0x5494c8,_0x1eb5e5,_0x5bd037){var _0x3973ed=_[_0xb430('0x3')](_0x5494c8,function(_0xb4c44d,_0x57e972){return _0xb4c44d[_0x5bd037];});for(var _0x34f1b5 in _0x1eb5e5){if(_0x1eb5e5[_0xb430('0x4')](_0x34f1b5)){if(!_0x3973ed[_0x34f1b5]){delete _0x1eb5e5[_0x34f1b5];}}}}Realtime[_0xb430('0x5')][_0xb430('0x6')]=function(_0x54da10,_0x40cd1f){for(var _0x342795 in _0x40cd1f){if(_0x54da10[_0xb430('0x4')](_0x342795)){_0x54da10[_0x342795]=_0x40cd1f[_0x342795];}}};Realtime[_0xb430('0x5')][_0xb430('0x7')]=function(){var _0x562e71=this;return function(_0x332fab){if(_0x332fab){freeIsNotKey(_0x332fab,_0x562e71[_0xb430('0x2')],'id');for(var _0x3c26c8=0x0,_0x40f6be={},_0x4e75a2={};_0x3c26c8<_0x332fab[_0xb430('0x8')];_0x3c26c8+=0x1){_0x40f6be=_0x332fab[_0x3c26c8];if(_['isUndefined'](_0x562e71[_0xb430('0x2')][_0x40f6be['id']])){_0x562e71[_0xb430('0x2')][_0x40f6be['id']]=new MailAccount(_0x40f6be);}else{_['merge'](_0x562e71[_0xb430('0x2')][_0x40f6be['id']],_0x40f6be);}}}return _0x562e71['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
+var _0xbd01=['mailAccounts','hasOwnProperty','prototype','length','isUndefined','merge','exports','../model/mailAccount'];(function(_0x59e48b,_0x2094e7){var _0x3d835e=function(_0xdf2d18){while(--_0xdf2d18){_0x59e48b['push'](_0x59e48b['shift']());}};_0x3d835e(++_0x2094e7);}(_0xbd01,0xe7));var _0x1bd0=function(_0xba21d1,_0x5ea074){_0xba21d1=_0xba21d1-0x0;var _0xad42b6=_0xbd01[_0xba21d1];return _0xad42b6;};'use strict';var _=require('lodash');var MailAccount=require(_0x1bd0('0x0'));var Realtime=function(){this[_0x1bd0('0x1')]={};};function freeIsNotKey(_0xcd1869,_0x13068c,_0x57d1b1){var _0x47a551=_['mapKeys'](_0xcd1869,function(_0x109691,_0x11bda9){return _0x109691[_0x57d1b1];});for(var _0x2fa7c2 in _0x13068c){if(_0x13068c[_0x1bd0('0x2')](_0x2fa7c2)){if(!_0x47a551[_0x2fa7c2]){delete _0x13068c[_0x2fa7c2];}}}}Realtime[_0x1bd0('0x3')]['mergeFromDatabase']=function(_0x14921f,_0x3decf7){for(var _0x178d05 in _0x3decf7){if(_0x14921f['hasOwnProperty'](_0x178d05)){_0x14921f[_0x178d05]=_0x3decf7[_0x178d05];}}};Realtime[_0x1bd0('0x3')]['initMailAccounts']=function(){var _0x2271a9=this;return function(_0x5a7025){if(_0x5a7025){freeIsNotKey(_0x5a7025,_0x2271a9[_0x1bd0('0x1')],'id');for(var _0x319b02=0x0,_0x7a23d0={},_0x33071a={};_0x319b02<_0x5a7025[_0x1bd0('0x4')];_0x319b02+=0x1){_0x7a23d0=_0x5a7025[_0x319b02];if(_[_0x1bd0('0x5')](_0x2271a9['mailAccounts'][_0x7a23d0['id']])){_0x2271a9['mailAccounts'][_0x7a23d0['id']]=new MailAccount(_0x7a23d0);}else{_[_0x1bd0('0x6')](_0x2271a9[_0x1bd0('0x1')][_0x7a23d0['id']],_0x7a23d0);}}}return _0x2271a9[_0x1bd0('0x1')];};};module[_0x1bd0('0x7')]=Realtime;
\ No newline at end of file
index fc591b8..c85549b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f4=['ListId','TemplateId','MailServerIn','CloudProvider','data5','MailServerOut','Smtp','service','getMailAccount','notify','Request','NotifyMailAccount','../client','GetMailAccount','name','email'];(function(_0x95369a,_0x54e0a4){var _0x1f61c9=function(_0x33b4ac){while(--_0x33b4ac){_0x95369a['push'](_0x95369a['shift']());}};_0x1f61c9(++_0x54e0a4);}(_0xd4f4,0x1bc));var _0x4d4f=function(_0x5d7332,_0x5afdfe){_0x5d7332=_0x5d7332-0x0;var _0x4ed1d0=_0xd4f4[_0x5d7332];return _0x4ed1d0;};'use strict';var client=require(_0x4d4f('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0x4d4f('0x1'),{'options':{'attributes':['id',_0x4d4f('0x2'),'provider','service',_0x4d4f('0x3'),'active','key',_0x4d4f('0x4'),_0x4d4f('0x5')],'raw':![],'include':[{'model':_0x4d4f('0x6'),'as':'Imap','include':[{'model':_0x4d4f('0x7'),'attributes':['id','name','service','type',_0x4d4f('0x8')],'as':_0x4d4f('0x7')}]},{'model':_0x4d4f('0x9'),'as':_0x4d4f('0xa'),'include':[{'model':_0x4d4f('0x7'),'attributes':['id',_0x4d4f('0x2'),_0x4d4f('0xb'),'type',_0x4d4f('0x8')],'as':_0x4d4f('0x7')}]}]},'log':_0x4d4f('0xc')});};};exports[_0x4d4f('0xd')]=function(_0x3f38e7,_0x15d4a1){return client[_0x4d4f('0xe')](_0x4d4f('0xf'),{'account':{'id':_0x3f38e7},'body':_0x15d4a1,'log':'NotifyMailAccount'});};
\ No newline at end of file
+var _0xda42=['GetMailAccount','name','provider','service','active','ListId','CloudProvider','type','data5','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request'];(function(_0x42c241,_0x505e52){var _0x5cc387=function(_0x38197e){while(--_0x38197e){_0x42c241['push'](_0x42c241['shift']());}};_0x5cc387(++_0x505e52);}(_0xda42,0x1bd));var _0x2da4=function(_0x297f45,_0x32e07a){_0x297f45=_0x297f45-0x0;var _0x100506=_0xda42[_0x297f45];return _0x100506;};'use strict';var client=require(_0x2da4('0x0'));exports[_0x2da4('0x1')]=function(){return function(){return client[_0x2da4('0x2')](_0x2da4('0x3'),{'options':{'attributes':['id',_0x2da4('0x4'),_0x2da4('0x5'),_0x2da4('0x6'),'email',_0x2da4('0x7'),'key',_0x2da4('0x8'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':'Imap','include':[{'model':_0x2da4('0x9'),'attributes':['id',_0x2da4('0x4'),_0x2da4('0x6'),_0x2da4('0xa'),_0x2da4('0xb')],'as':_0x2da4('0x9')}]},{'model':_0x2da4('0xc'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0x2da4('0x4'),_0x2da4('0x6'),_0x2da4('0xa'),'data5'],'as':_0x2da4('0x9')}]}]},'log':_0x2da4('0xd')});};};exports[_0x2da4('0xe')]=function(_0x400a40,_0x208170){return client[_0x2da4('0x2')](_0x2da4('0xf'),{'account':{'id':_0x400a40},'body':_0x208170,'log':'NotifyMailAccount'});};
\ No newline at end of file
index b9596cf..84615d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04b9=['loginMailFrequency','GetSettings','getSettings','Request','ShowSetting'];(function(_0x100497,_0x1aa6a2){var _0x10f131=function(_0x4eae44){while(--_0x4eae44){_0x100497['push'](_0x100497['shift']());}};_0x10f131(++_0x1aa6a2);}(_0x04b9,0x1c4));var _0x904b=function(_0x364ab5,_0x3d1ee7){_0x364ab5=_0x364ab5-0x0;var _0x1554cd=_0x04b9[_0x364ab5];return _0x1554cd;};'use strict';var client=require('../client');exports[_0x904b('0x0')]=function(){return client[_0x904b('0x1')](_0x904b('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x904b('0x3')]},'log':_0x904b('0x4')});};
\ No newline at end of file
+var _0x3792=['loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x3792,0x192));var _0x2379=function(_0x36f397,_0x20bafb){_0x36f397=_0x36f397-0x0;var _0x356217=_0x3792[_0x36f397];return _0x356217;};'use strict';var client=require(_0x2379('0x0'));exports[_0x2379('0x1')]=function(){return client[_0x2379('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2379('0x3')]},'log':_0x2379('0x4')});};
\ No newline at end of file
index c17d166..122728f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index 5e75aa0..1bf0e22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b34=['../../config/triggers','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','http','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','websocket','polling','defaults','localhost','socket.io-redis','redis'];(function(_0x26d678,_0x273258){var _0x4ad538=function(_0x7267eb){while(--_0x7267eb){_0x26d678['push'](_0x26d678['shift']());}};_0x4ad538(++_0x273258);}(_0x1b34,0x191));var _0x41b3=function(_0x44ede8,_0x4e1b37){_0x44ede8=_0x44ede8-0x0;var _0x12fa9d=_0x1b34[_0x44ede8];return _0x12fa9d;};'use strict';var _=require('lodash');var http=require(_0x41b3('0x0'));var express=require('express');var sticky=require(_0x41b3('0x1'));var Redis=require(_0x41b3('0x2'));var config=require(_0x41b3('0x3'));var app=express();var server=http['createServer'](app);server[_0x41b3('0x4')]=0xdbba0;if(sticky[_0x41b3('0x5')](server,config['port'])){var socketio=require(_0x41b3('0x6'))(server,{'transports':[_0x41b3('0x7'),_0x41b3('0x8')]});config['redis']=_[_0x41b3('0x9')](config['redis'],{'host':_0x41b3('0xa'),'port':0x18eb});socketio['adapter'](require(_0x41b3('0xb'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x41b3('0xc')])}));require(_0x41b3('0xd'))['default']();require('../../config/socketio')[_0x41b3('0xe')](socketio);require(_0x41b3('0xf'))['default'](app);require(_0x41b3('0x10'))[_0x41b3('0xe')](app);}else{server[_0x41b3('0x11')](_0x41b3('0x12'),function(){console[_0x41b3('0x13')](_0x41b3('0x14'),config[_0x41b3('0x15')]);});}exports=module[_0x41b3('0x16')]=app;
\ No newline at end of file
+var _0xb665=['port','socket.io','redis','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','createServer','listen'];(function(_0x55df29,_0x1648e4){var _0x4b2385=function(_0x39c35f){while(--_0x39c35f){_0x55df29['push'](_0x55df29['shift']());}};_0x4b2385(++_0x1648e4);}(_0xb665,0x13e));var _0x5b66=function(_0x1527b1,_0x2910f7){_0x1527b1=_0x1527b1-0x0;var _0x2aa5d8=_0xb665[_0x1527b1];return _0x2aa5d8;};'use strict';var _=require(_0x5b66('0x0'));var http=require(_0x5b66('0x1'));var express=require('express');var sticky=require(_0x5b66('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x5b66('0x3')](app);server['timeout']=0xdbba0;if(sticky[_0x5b66('0x4')](server,config[_0x5b66('0x5')])){var socketio=require(_0x5b66('0x6'))(server,{'transports':['websocket','polling']});config[_0x5b66('0x7')]=_['defaults'](config['redis'],{'host':_0x5b66('0x8'),'port':0x18eb});socketio[_0x5b66('0x9')](require(_0x5b66('0xa'))({'pubClient':new Redis(config[_0x5b66('0x7')]),'subClient':new Redis(config['redis'])}));require(_0x5b66('0xb'))[_0x5b66('0xc')]();require(_0x5b66('0xd'))[_0x5b66('0xc')](socketio);require(_0x5b66('0xe'))['default'](app);require('../../routes')[_0x5b66('0xc')](app);}else{server[_0x5b66('0xf')](_0x5b66('0x10'),function(){console['log'](_0x5b66('0x11'),config[_0x5b66('0x5')]);});}exports=module[_0x5b66('0x12')]=app;
\ No newline at end of file
index 6944548..7b926c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebb3=['jayson/promise','bluebird','../../config/logger','routing','request','then','rpc','error','message','result','exports'];(function(_0x4dd36d,_0x123987){var _0x2b0c4c=function(_0x4f0057){while(--_0x4f0057){_0x4dd36d['push'](_0x4dd36d['shift']());}};_0x2b0c4c(++_0x123987);}(_0xebb3,0x176));var _0x3ebb=function(_0x22b430,_0x1aede5){_0x22b430=_0x22b430-0x0;var _0x338d2a=_0xebb3[_0x22b430];return _0x338d2a;};'use strict';var jayson=require(_0x3ebb('0x0'));var BPromise=require(_0x3ebb('0x1'));var logger=require(_0x3ebb('0x2'))(_0x3ebb('0x3'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x53f158,_0x3467e8){return new BPromise(function(_0x20854f,_0x5b534f){return client[_0x3ebb('0x4')](_0x53f158,_0x3467e8)[_0x3ebb('0x5')](function(_0x8c28c4){logger['debug'](_0x3ebb('0x6'),_0x3ebb('0x3'),_0x53f158,_0x3467e8,_0x8c28c4);if(_0x8c28c4[_0x3ebb('0x7')]){logger['error'](_0x3ebb('0x6'),_0x3ebb('0x3'),_0x53f158,_0x8c28c4[_0x3ebb('0x7')][_0x3ebb('0x8')],_0x3467e8);return _0x5b534f(_0x8c28c4['error'][_0x3ebb('0x8')]);}else{return _0x20854f(_0x8c28c4[_0x3ebb('0x9')]);}})['catch'](function(_0x2cbe6b){logger[_0x3ebb('0x7')]('rpc',_0x3ebb('0x3'),_0x53f158,_0x2cbe6b,_0x3467e8);return _0x5b534f(_0x2cbe6b);});});};module[_0x3ebb('0xa')]=client;
\ No newline at end of file
+var _0x0869=['client','http','Request','request','debug','error','rpc','message','catch','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x5dea6a,_0x192e18){var _0x4d5435=function(_0x26bd80){while(--_0x26bd80){_0x5dea6a['push'](_0x5dea6a['shift']());}};_0x4d5435(++_0x192e18);}(_0x0869,0x168));var _0x9086=function(_0x4b8df7,_0x55e447){_0x4b8df7=_0x4b8df7-0x0;var _0x4e4fab=_0x0869[_0x4b8df7];return _0x4e4fab;};'use strict';var jayson=require(_0x9086('0x0'));var BPromise=require(_0x9086('0x1'));var logger=require(_0x9086('0x2'))(_0x9086('0x3'));var client=jayson[_0x9086('0x4')][_0x9086('0x5')]({'port':0x2329});client[_0x9086('0x6')]=function(_0x5e11e1,_0x52ab40){return new BPromise(function(_0x3dbbe6,_0x1ad392){return client[_0x9086('0x7')](_0x5e11e1,_0x52ab40)['then'](function(_0x352da4){logger[_0x9086('0x8')]('rpc','routing',_0x5e11e1,_0x52ab40,_0x352da4);if(_0x352da4[_0x9086('0x9')]){logger[_0x9086('0x9')](_0x9086('0xa'),'routing',_0x5e11e1,_0x352da4[_0x9086('0x9')][_0x9086('0xb')],_0x52ab40);return _0x1ad392(_0x352da4['error'][_0x9086('0xb')]);}else{return _0x3dbbe6(_0x352da4['result']);}})[_0x9086('0xc')](function(_0x2692be){logger[_0x9086('0x9')](_0x9086('0xa'),'routing',_0x5e11e1,_0x2692be,_0x52ab40);return _0x1ad392(_0x2692be);});});};module['exports']=client;
\ No newline at end of file
index 0516782..f061fb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdd2=['initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/faxQueue','resolve','then','initAgents','getOpenchannelQueues','initSmsQueues','getMailQueues'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xbdd2,0x1d2));var _0x2bdd=function(_0x24ecf6,_0x17ecf3){_0x24ecf6=_0x24ecf6-0x0;var _0x4bc2ff=_0xbdd2[_0x24ecf6];return _0x4bc2ff;};'use strict';var BPromise=require(_0x2bdd('0x0'));var server=require(_0x2bdd('0x1'));var Realtime=require(_0x2bdd('0x2'));var user=require(_0x2bdd('0x3'));var interval=require(_0x2bdd('0x4'));var openchannelQueue=require(_0x2bdd('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x2bdd('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x2bdd('0x7'));var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise[_0x2bdd('0x8')]()[_0x2bdd('0x9')](user['getAgents']())[_0x2bdd('0x9')](realtime[_0x2bdd('0xa')]())['then'](interval['getIntervals']())[_0x2bdd('0x9')](realtime['initIntervals']())[_0x2bdd('0x9')](openchannelQueue[_0x2bdd('0xb')]())['then'](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())['then'](realtime['initChatQueues']())[_0x2bdd('0x9')](smsQueue['getSmsQueues']())[_0x2bdd('0x9')](realtime[_0x2bdd('0xc')]())[_0x2bdd('0x9')](mailQueue[_0x2bdd('0xd')]())[_0x2bdd('0x9')](realtime[_0x2bdd('0xe')]())['then'](faxQueue[_0x2bdd('0xf')]())[_0x2bdd('0x9')](realtime[_0x2bdd('0x10')]())['then'](whatsappQueue[_0x2bdd('0x11')]())[_0x2bdd('0x9')](realtime[_0x2bdd('0x12')]())[_0x2bdd('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x1f0216){return initRealtime();})[_0x2bdd('0x9')](function(_0x1a0681){return setInterval(initRealtime,0x1388);})[_0x2bdd('0x13')](function(_0x331e11){console['log'](_0x331e11);});}main();
\ No newline at end of file
+var _0xb745=['bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xb745,0xea));var _0x5b74=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb745[_0x243b2f];return _0xcb3c2d;};'use strict';var BPromise=require(_0x5b74('0x0'));var server=require(_0x5b74('0x1'));var Realtime=require(_0x5b74('0x2'));var user=require(_0x5b74('0x3'));var interval=require(_0x5b74('0x4'));var openchannelQueue=require(_0x5b74('0x5'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x5b74('0x6'));var mailQueue=require(_0x5b74('0x7'));var faxQueue=require(_0x5b74('0x8'));var whatsappQueue=require(_0x5b74('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x5b74('0xa')]()[_0x5b74('0xb')](user['getAgents']())[_0x5b74('0xb')](realtime[_0x5b74('0xc')]())[_0x5b74('0xb')](interval[_0x5b74('0xd')]())[_0x5b74('0xb')](realtime['initIntervals']())[_0x5b74('0xb')](openchannelQueue[_0x5b74('0xe')]())[_0x5b74('0xb')](realtime[_0x5b74('0xf')]())[_0x5b74('0xb')](chatQueue['getChatQueues']())[_0x5b74('0xb')](realtime[_0x5b74('0x10')]())['then'](smsQueue[_0x5b74('0x11')]())['then'](realtime[_0x5b74('0x12')]())[_0x5b74('0xb')](mailQueue['getMailQueues']())[_0x5b74('0xb')](realtime['initMailQueues']())[_0x5b74('0xb')](faxQueue[_0x5b74('0x13')]())[_0x5b74('0xb')](realtime[_0x5b74('0x14')]())[_0x5b74('0xb')](whatsappQueue[_0x5b74('0x15')]())[_0x5b74('0xb')](realtime[_0x5b74('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x5b74('0x17')](realtime)[_0x5b74('0xb')](function(_0x2ac620){return initRealtime();})[_0x5b74('0xb')](function(_0x4b8607){return setInterval(initRealtime,0x1388);})[_0x5b74('0x18')](function(_0x21f1a0){console[_0x5b74('0x19')](_0x21f1a0);});}main();
\ No newline at end of file
index b774fd7..1247113 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x5107d2,_0x34ab23){var _0x359ad9=function(_0x3ec25e){while(--_0x3ec25e){_0x5107d2['push'](_0x5107d2['shift']());}};_0x359ad9(++_0x34ab23);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine;
\ No newline at end of file
+var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x222f42,_0x54f2f5){var _0x28251a=function(_0x263c95){while(--_0x263c95){_0x222f42['push'](_0x222f42['shift']());}};_0x28251a(++_0x54f2f5);}(_0x5fc3,0xa8));var _0x35fc=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x5fc3[_0x54ea7a];return _0x65a10d;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
index 7d4bed7..51e481f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d62=['sendMailMessage','bluebird','jayson/promise','client','http','request','error','message','result'];(function(_0x5d6660,_0x42d5d4){var _0x1d92fb=function(_0x422823){while(--_0x422823){_0x5d6660['push'](_0x5d6660['shift']());}};_0x1d92fb(++_0x42d5d4);}(_0x1d62,0x1cc));var _0x21d6=function(_0x36ee88,_0x46337c){_0x36ee88=_0x36ee88-0x0;var _0x444226=_0x1d62[_0x36ee88];return _0x444226;};'use strict';var BPromise=require(_0x21d6('0x0'));var jayson=require(_0x21d6('0x1'));var client=jayson[_0x21d6('0x2')][_0x21d6('0x3')]({'port':0x232b});function request(_0x3e892b,_0x4b4a76){return new BPromise(function(_0x29ec0c,_0x285848){return client[_0x21d6('0x4')](_0x3e892b,_0x4b4a76)['then'](function(_0x4b3631){if(_0x4b3631[_0x21d6('0x5')]){return _0x285848(_0x4b3631[_0x21d6('0x5')][_0x21d6('0x6')]);}else{return _0x29ec0c(_0x4b3631[_0x21d6('0x7')]);}})['catch'](function(_0x3d1420){return _0x285848(_0x3d1420);});});}exports[_0x21d6('0x8')]=function(_0x2aeb95,_0x44c6bf){return request('SendMail',{'account':_0x2aeb95,'message':_0x44c6bf});};
\ No newline at end of file
+var _0x8b4b=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','error','message','result'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x8b4b,0xa3));var _0xb8b4=function(_0x2da0db,_0x5a7930){_0x2da0db=_0x2da0db-0x0;var _0x208299=_0x8b4b[_0x2da0db];return _0x208299;};'use strict';var BPromise=require(_0xb8b4('0x0'));var jayson=require(_0xb8b4('0x1'));var client=jayson[_0xb8b4('0x2')]['http']({'port':0x232b});function request(_0x11a33e,_0x1968bc){return new BPromise(function(_0x42b8dd,_0x1af85c){return client[_0xb8b4('0x3')](_0x11a33e,_0x1968bc)['then'](function(_0x227b6d){if(_0x227b6d[_0xb8b4('0x4')]){return _0x1af85c(_0x227b6d[_0xb8b4('0x4')][_0xb8b4('0x5')]);}else{return _0x42b8dd(_0x227b6d[_0xb8b4('0x6')]);}})[_0xb8b4('0x7')](function(_0x48ee81){return _0x1af85c(_0x48ee81);});});}exports[_0xb8b4('0x8')]=function(_0xbd5c18,_0x402729){return request(_0xb8b4('0x9'),{'account':_0xbd5c18,'message':_0x402729});};
\ No newline at end of file
index 9a21eed..09693ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd763=['Status','StatusTime','format','smsCurrentCapacity','whatsappCurrentCapacity','openchannelCurrentCapacity','stringify','emit','user:save','exports','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','prototype','updateRealtime','mail','chat','openchannel','fax','sms','whatsapp','length'];(function(_0x1ed311,_0xb346e7){var _0x34f63b=function(_0x45e720){while(--_0x45e720){_0x1ed311['push'](_0x1ed311['shift']());}};_0x34f63b(++_0xb346e7);}(_0xd763,0x17e));var _0x3d76=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xd763[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require('md5');var Redis=require(_0x3d76('0x0'));var config=require(_0x3d76('0x1'));config[_0x3d76('0x2')]=_['defaults'](config[_0x3d76('0x2')],{'host':_0x3d76('0x3'),'port':0x18eb});var io=require(_0x3d76('0x4'))(new Redis(config[_0x3d76('0x2')]));function Agent(_0x1e857c){this['id']=_0x1e857c['id']||0x0;this[_0x3d76('0x5')]=_0x1e857c[_0x3d76('0x5')]||'';this[_0x3d76('0x6')]=_0x1e857c[_0x3d76('0x6')]||!![];this[_0x3d76('0x7')]=_0x1e857c['voicePause']||![];this['chatPause']=_0x1e857c[_0x3d76('0x8')]||![];this['mailPause']=_0x1e857c[_0x3d76('0x9')]||![];this['faxPause']=_0x1e857c[_0x3d76('0xa')]||![];this[_0x3d76('0xb')]=_0x1e857c[_0x3d76('0xb')]||![];this[_0x3d76('0xc')]=_0x1e857c[_0x3d76('0xc')]||![];this[_0x3d76('0xd')]=_0x3d76('0xe');this[_0x3d76('0xf')]=0x0;this[_0x3d76('0x10')]=_0x1e857c[_0x3d76('0x10')]||0x0;this[_0x3d76('0x11')]=0x0;this[_0x3d76('0x12')]=_0x3d76('0xe');this[_0x3d76('0x13')]=0x0;this['mailCapacity']=_0x1e857c[_0x3d76('0x14')]||0x0;this[_0x3d76('0x15')]=0x0;this[_0x3d76('0x16')]=_0x3d76('0xe');this[_0x3d76('0x17')]=0x0;this['faxCapacity']=_0x1e857c[_0x3d76('0x18')]||0x0;this[_0x3d76('0x19')]=0x0;this[_0x3d76('0x1a')]=_0x3d76('0xe');this[_0x3d76('0x1b')]=0x0;this[_0x3d76('0x1c')]=_0x1e857c[_0x3d76('0x1c')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x3d76('0x1d')]=_0x3d76('0xe');this[_0x3d76('0x1e')]=0x0;this['whatsappCapacity']=_0x1e857c[_0x3d76('0x1f')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x3d76('0x20')]=_0x3d76('0xe');this[_0x3d76('0x21')]=0x0;this[_0x3d76('0x22')]=_0x1e857c[_0x3d76('0x22')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x3d76('0x23')]=![];this[_0x3d76('0x24')]=undefined;this[_0x3d76('0x25')]='';this['updateRealtime']();}Agent['prototype'][_0x3d76('0x26')]=function(_0x5f1078){if(this[_0x5f1078+_0x3d76('0x27')]>0x0){if(this[_0x5f1078+_0x3d76('0x28')]>0x0&&this[_0x5f1078+_0x3d76('0x27')]>=this[_0x5f1078+'Capacity']){return _0x3d76('0x29');}else{return _0x3d76('0x2a');}}else{return'idle';}};Agent[_0x3d76('0x2b')][_0x3d76('0x2c')]=function(){var _0x3693b9=[_0x3d76('0x2d'),_0x3d76('0x2e'),_0x3d76('0x2f'),_0x3d76('0x30'),_0x3d76('0x31'),_0x3d76('0x32')];for(var _0x5936e7=0x0;_0x5936e7<_0x3693b9[_0x3d76('0x33')];_0x5936e7+=0x1){var _0x5c0327=this[_0x3d76('0x26')](_0x3693b9[_0x5936e7]);if(this[_0x3693b9[_0x5936e7]+_0x3d76('0x34')]!==_0x5c0327){this[_0x3693b9[_0x5936e7]+_0x3d76('0x35')]=_['toNumber'](moment()[_0x3d76('0x36')]('x'));}this[_0x3693b9[_0x5936e7]+_0x3d76('0x34')]=_0x5c0327;}var _0x57fd6a={'id':this['id'],'name':this[_0x3d76('0x5')],'online':this[_0x3d76('0x6')],'voicePause':this[_0x3d76('0x7')],'chatPause':this[_0x3d76('0x8')],'mailPause':this[_0x3d76('0x9')],'smsPause':this[_0x3d76('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0x3d76('0xc')],'chatStatus':this[_0x3d76('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x3d76('0x10')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x3d76('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x3d76('0x14')],'mailCurrentCapacity':this[_0x3d76('0x15')],'faxStatus':this[_0x3d76('0x16')],'faxStatusTime':this[_0x3d76('0x17')],'faxCapacity':this[_0x3d76('0x18')],'faxCurrentCapacity':this[_0x3d76('0x19')],'smsStatus':this[_0x3d76('0x1a')],'smsStatusTime':this[_0x3d76('0x1b')],'smsCapacity':this[_0x3d76('0x1c')],'smsCurrentCapacity':this[_0x3d76('0x37')],'whatsappStatus':this[_0x3d76('0x1d')],'whatsappStatusTime':this[_0x3d76('0x1e')],'whatsappCapacity':this[_0x3d76('0x1f')],'whatsappCurrentCapacity':this[_0x3d76('0x38')],'openchannelStatus':this[_0x3d76('0x20')],'openchannelStatusTime':this[_0x3d76('0x21')],'openchannelCapacity':this[_0x3d76('0x22')],'openchannelCurrentCapacity':this[_0x3d76('0x39')],'busy':this[_0x3d76('0x23')],'busyQueue':this[_0x3d76('0x24')]};var _0x10ef6a=md5(JSON[_0x3d76('0x3a')](_0x57fd6a));if(this[_0x3d76('0x25')]!==_0x10ef6a){this[_0x3d76('0x25')]=_0x10ef6a;io[_0x3d76('0x3b')](_0x3d76('0x3c'),_0x57fd6a);}};module[_0x3d76('0x3d')]=Agent;
\ No newline at end of file
+var _0x7b9b=['whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busyQueue','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','openchannel','sms','whatsapp','Status','toNumber','format','chatStatus','mailStatus','mailStatusTime','faxStatus','smsStatus','smsStatusTime','whatsappStatus','busy','stringify','md5','emit','user:save','exports','moment','ioredis','../../../config/environment','defaults','redis','localhost','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity'];(function(_0x44cb9a,_0xb28d27){var _0x50d338=function(_0x307025){while(--_0x307025){_0x44cb9a['push'](_0x44cb9a['shift']());}};_0x50d338(++_0xb28d27);}(_0x7b9b,0x97));var _0xb7b9=function(_0x4ef724,_0x2eaa8f){_0x4ef724=_0x4ef724-0x0;var _0x16b426=_0x7b9b[_0x4ef724];return _0x16b426;};'use strict';var _=require('lodash');var moment=require(_0xb7b9('0x0'));var md5=require('md5');var Redis=require(_0xb7b9('0x1'));var config=require(_0xb7b9('0x2'));config['redis']=_[_0xb7b9('0x3')](config[_0xb7b9('0x4')],{'host':_0xb7b9('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb7b9('0x4')]));function Agent(_0x41d613){this['id']=_0x41d613['id']||0x0;this[_0xb7b9('0x6')]=_0x41d613[_0xb7b9('0x6')]||'';this[_0xb7b9('0x7')]=_0x41d613[_0xb7b9('0x7')]||!![];this[_0xb7b9('0x8')]=_0x41d613[_0xb7b9('0x8')]||![];this[_0xb7b9('0x9')]=_0x41d613[_0xb7b9('0x9')]||![];this[_0xb7b9('0xa')]=_0x41d613[_0xb7b9('0xa')]||![];this[_0xb7b9('0xb')]=_0x41d613[_0xb7b9('0xb')]||![];this['smsPause']=_0x41d613['smsPause']||![];this[_0xb7b9('0xc')]=_0x41d613[_0xb7b9('0xc')]||![];this['chatStatus']=_0xb7b9('0xd');this[_0xb7b9('0xe')]=0x0;this[_0xb7b9('0xf')]=_0x41d613[_0xb7b9('0xf')]||0x0;this[_0xb7b9('0x10')]=0x0;this['mailStatus']=_0xb7b9('0xd');this['mailStatusTime']=0x0;this[_0xb7b9('0x11')]=_0x41d613['mailCapacity']||0x0;this[_0xb7b9('0x12')]=0x0;this['faxStatus']='unknown';this[_0xb7b9('0x13')]=0x0;this[_0xb7b9('0x14')]=_0x41d613[_0xb7b9('0x14')]||0x0;this[_0xb7b9('0x15')]=0x0;this['smsStatus']=_0xb7b9('0xd');this['smsStatusTime']=0x0;this['smsCapacity']=_0x41d613[_0xb7b9('0x16')]||0x0;this[_0xb7b9('0x17')]=0x0;this['whatsappStatus']=_0xb7b9('0xd');this[_0xb7b9('0x18')]=0x0;this[_0xb7b9('0x19')]=_0x41d613[_0xb7b9('0x19')]||0x0;this[_0xb7b9('0x1a')]=0x0;this[_0xb7b9('0x1b')]=_0xb7b9('0xd');this[_0xb7b9('0x1c')]=0x0;this[_0xb7b9('0x1d')]=_0x41d613[_0xb7b9('0x1d')]||0x0;this[_0xb7b9('0x1e')]=0x0;this['busy']=![];this[_0xb7b9('0x1f')]=undefined;this['md5']='';this[_0xb7b9('0x20')]();}Agent[_0xb7b9('0x21')]['getChannelStatus']=function(_0x1fba11){if(this[_0x1fba11+_0xb7b9('0x22')]>0x0){if(this[_0x1fba11+_0xb7b9('0x23')]>0x0&&this[_0x1fba11+_0xb7b9('0x22')]>=this[_0x1fba11+_0xb7b9('0x23')]){return _0xb7b9('0x24');}else{return'working';}}else{return _0xb7b9('0x25');}};Agent[_0xb7b9('0x21')][_0xb7b9('0x20')]=function(){var _0x30840e=[_0xb7b9('0x26'),_0xb7b9('0x27'),_0xb7b9('0x28'),'fax',_0xb7b9('0x29'),_0xb7b9('0x2a')];for(var _0x31753f=0x0;_0x31753f<_0x30840e['length'];_0x31753f+=0x1){var _0x5020ab=this['getChannelStatus'](_0x30840e[_0x31753f]);if(this[_0x30840e[_0x31753f]+_0xb7b9('0x2b')]!==_0x5020ab){this[_0x30840e[_0x31753f]+'StatusTime']=_[_0xb7b9('0x2c')](moment()[_0xb7b9('0x2d')]('x'));}this[_0x30840e[_0x31753f]+_0xb7b9('0x2b')]=_0x5020ab;}var _0x2304f9={'id':this['id'],'name':this['name'],'online':this[_0xb7b9('0x7')],'voicePause':this['voicePause'],'chatPause':this[_0xb7b9('0x9')],'mailPause':this[_0xb7b9('0xa')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xb7b9('0x2e')],'chatStatusTime':this[_0xb7b9('0xe')],'chatCapacity':this[_0xb7b9('0xf')],'chatCurrentCapacity':this[_0xb7b9('0x10')],'mailStatus':this[_0xb7b9('0x2f')],'mailStatusTime':this[_0xb7b9('0x30')],'mailCapacity':this[_0xb7b9('0x11')],'mailCurrentCapacity':this[_0xb7b9('0x12')],'faxStatus':this[_0xb7b9('0x31')],'faxStatusTime':this[_0xb7b9('0x13')],'faxCapacity':this[_0xb7b9('0x14')],'faxCurrentCapacity':this[_0xb7b9('0x15')],'smsStatus':this[_0xb7b9('0x32')],'smsStatusTime':this[_0xb7b9('0x33')],'smsCapacity':this[_0xb7b9('0x16')],'smsCurrentCapacity':this[_0xb7b9('0x17')],'whatsappStatus':this[_0xb7b9('0x34')],'whatsappStatusTime':this[_0xb7b9('0x18')],'whatsappCapacity':this[_0xb7b9('0x19')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xb7b9('0x1c')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0xb7b9('0x35')],'busyQueue':this['busyQueue']};var _0x353140=md5(JSON[_0xb7b9('0x36')](_0x2304f9));if(this[_0xb7b9('0x37')]!==_0x353140){this[_0xb7b9('0x37')]=_0x353140;io[_0xb7b9('0x38')](_0xb7b9('0x39'),_0x2304f9);}};module[_0xb7b9('0x3a')]=Agent;
\ No newline at end of file
index 8c9bb35..b05d668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30ae=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','map','updateRealtime','paused','length','chatPause','available','stringify','md5','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name'];(function(_0x4ef826,_0x2e0ac8){var _0x154b8=function(_0x4fae58){while(--_0x4fae58){_0x4ef826['push'](_0x4ef826['shift']());}};_0x154b8(++_0x2e0ac8);}(_0x30ae,0x12d));var _0xe30a=function(_0x288e34,_0x102f3a){_0x288e34=_0x288e34-0x0;var _0xa96660=_0x30ae[_0x288e34];return _0xa96660;};'use strict';var _=require(_0xe30a('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0xe30a('0x1'));config['redis']=_[_0xe30a('0x2')](config[_0xe30a('0x3')],{'host':_0xe30a('0x4'),'port':0x18eb});var io=require(_0xe30a('0x5'))(new Redis(config[_0xe30a('0x3')]));function ChatQueue(_0x1da901){this['id']=_0x1da901['id']||0x0;this[_0xe30a('0x6')]=_0x1da901[_0xe30a('0x6')]||'';this[_0xe30a('0x7')]=_0x1da901['timeout']||0xa;this[_0xe30a('0x8')]=_0x1da901['strategy']||_0xe30a('0x9');this['Agents']=_0x1da901[_0xe30a('0xa')];this[_0xe30a('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0xe30a('0xc')]();this['updateRealtime']();}ChatQueue[_0xe30a('0xd')][_0xe30a('0xc')]=function(){var _0x5c68e1=this['mapAgentsId'][_0xe30a('0xe')];this[_0xe30a('0xb')]=_[_0xe30a('0xf')](this['Agents'],'id');this[_0xe30a('0xb')][_0xe30a('0xe')]=_0x5c68e1;};ChatQueue['prototype'][_0xe30a('0x10')]=function(){this['loggedIn']=0x0;this[_0xe30a('0x11')]=0x0;for(var _0x541671=0x0;_0x541671<this[_0xe30a('0xa')][_0xe30a('0x12')];_0x541671+=0x1){if(this['Agents'][_0x541671]['online']){this['loggedIn']+=0x1;}if(this[_0xe30a('0xa')][_0x541671][_0xe30a('0x13')]){this['paused']+=0x1;}}this[_0xe30a('0x14')]=this['loggedIn']-this[_0xe30a('0x11')];this[_0xe30a('0x14')]=this[_0xe30a('0x14')]>=0x0?this[_0xe30a('0x14')]:0x0;var _0x583737={'id':this['id'],'available':this[_0xe30a('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xe30a('0x6')],'paused':this[_0xe30a('0x11')],'waiting':this['waiting']};var _0x3ed866=md5(JSON[_0xe30a('0x15')](_0x583737));if(this[_0xe30a('0x16')]!==_0x3ed866){this[_0xe30a('0x16')]=_0x3ed866;io['to'](util[_0xe30a('0x17')](_0xe30a('0x18'),_0x583737[_0xe30a('0x6')]))[_0xe30a('0x19')](_0xe30a('0x1a'),_0x583737);}};module[_0xe30a('0x1b')]=ChatQueue;
\ No newline at end of file
+var _0x5917=['loggedIn','paused','online','chatPause','available','format','emit','chat_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr'];(function(_0x598152,_0x4230ac){var _0x71af95=function(_0x59f1da){while(--_0x59f1da){_0x598152['push'](_0x598152['shift']());}};_0x71af95(++_0x4230ac);}(_0x5917,0x13c));var _0x7591=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5917[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x7591('0x0'));var md5=require(_0x7591('0x1'));var util=require(_0x7591('0x2'));var Redis=require(_0x7591('0x3'));var config=require(_0x7591('0x4'));config[_0x7591('0x5')]=_['defaults'](config[_0x7591('0x5')],{'host':_0x7591('0x6'),'port':0x18eb});var io=require(_0x7591('0x7'))(new Redis(config[_0x7591('0x5')]));function ChatQueue(_0xfe1aef){this['id']=_0xfe1aef['id']||0x0;this[_0x7591('0x8')]=_0xfe1aef['name']||'';this[_0x7591('0x9')]=_0xfe1aef[_0x7591('0x9')]||0xa;this[_0x7591('0xa')]=_0xfe1aef['strategy']||_0x7591('0xb');this[_0x7591('0xc')]=_0xfe1aef[_0x7591('0xc')];this[_0x7591('0xd')]={};this[_0x7591('0xe')]=0x0;this[_0x7591('0x1')]='';this[_0x7591('0xf')]();this[_0x7591('0x10')]();}ChatQueue[_0x7591('0x11')][_0x7591('0xf')]=function(){var _0x5261e7=this[_0x7591('0xd')]['_rr'];this[_0x7591('0xd')]=_[_0x7591('0x12')](this[_0x7591('0xc')],'id');this[_0x7591('0xd')][_0x7591('0x13')]=_0x5261e7;};ChatQueue[_0x7591('0x11')][_0x7591('0x10')]=function(){this[_0x7591('0x14')]=0x0;this[_0x7591('0x15')]=0x0;for(var _0x476206=0x0;_0x476206<this[_0x7591('0xc')]['length'];_0x476206+=0x1){if(this[_0x7591('0xc')][_0x476206][_0x7591('0x16')]){this[_0x7591('0x14')]+=0x1;}if(this[_0x7591('0xc')][_0x476206][_0x7591('0x17')]){this[_0x7591('0x15')]+=0x1;}}this[_0x7591('0x18')]=this['loggedIn']-this[_0x7591('0x15')];this[_0x7591('0x18')]=this[_0x7591('0x18')]>=0x0?this[_0x7591('0x18')]:0x0;var _0x1a6698={'id':this['id'],'available':this[_0x7591('0x18')],'loggedIn':this[_0x7591('0x14')],'name':this[_0x7591('0x8')],'paused':this['paused'],'waiting':this[_0x7591('0xe')]};var _0x18e7bf=md5(JSON['stringify'](_0x1a6698));if(this['md5']!==_0x18e7bf){this['md5']=_0x18e7bf;io['to'](util[_0x7591('0x19')]('chat:queue:%s',_0x1a6698[_0x7591('0x8')]))[_0x7591('0x1a')](_0x7591('0x1b'),_0x1a6698);}};module['exports']=ChatQueue;
\ No newline at end of file
index 6f00602..e815db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dbb=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','prototype','map','_rr','updateRealtime','loggedIn','length','faxPause','paused','available','waiting','stringify','emit','fax_queue:save','exports','md5','util','ioredis','redis'];(function(_0x108a55,_0x2e2467){var _0x2424ed=function(_0x140df2){while(--_0x140df2){_0x108a55['push'](_0x108a55['shift']());}};_0x2424ed(++_0x2e2467);}(_0x7dbb,0x1e2));var _0xb7db=function(_0xd306f9,_0x129d74){_0xd306f9=_0xd306f9-0x0;var _0x3a4ee7=_0x7dbb[_0xd306f9];return _0x3a4ee7;};'use strict';var _=require('lodash');var md5=require(_0xb7db('0x0'));var util=require(_0xb7db('0x1'));var Redis=require(_0xb7db('0x2'));var config=require('../../../config/environment');config[_0xb7db('0x3')]=_[_0xb7db('0x4')](config[_0xb7db('0x3')],{'host':_0xb7db('0x5'),'port':0x18eb});var io=require(_0xb7db('0x6'))(new Redis(config[_0xb7db('0x3')]));function FaxQueue(_0x1bd39f){this['id']=_0x1bd39f['id']||0x0;this['name']=_0x1bd39f[_0xb7db('0x7')]||'';this[_0xb7db('0x8')]=_0x1bd39f['timeout']||0xa;this[_0xb7db('0x9')]=_0x1bd39f['strategy']||_0xb7db('0xa');this[_0xb7db('0xb')]=_0x1bd39f[_0xb7db('0xb')];this[_0xb7db('0xc')]={};this['waiting']=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xb7db('0xd')]['updateRouting']=function(){var _0x3c2925=this['mapAgentsId']['_rr'];this[_0xb7db('0xc')]=_[_0xb7db('0xe')](this[_0xb7db('0xb')],'id');this[_0xb7db('0xc')][_0xb7db('0xf')]=_0x3c2925;};FaxQueue['prototype'][_0xb7db('0x10')]=function(){this[_0xb7db('0x11')]=0x0;this['paused']=0x0;for(var _0x1355ff=0x0;_0x1355ff<this['Agents'][_0xb7db('0x12')];_0x1355ff+=0x1){if(this['Agents'][_0x1355ff]['online']){this[_0xb7db('0x11')]+=0x1;}if(this['Agents'][_0x1355ff][_0xb7db('0x13')]){this[_0xb7db('0x14')]+=0x1;}}this['available']=this[_0xb7db('0x11')]-this[_0xb7db('0x14')];this['available']=this[_0xb7db('0x15')]>=0x0?this[_0xb7db('0x15')]:0x0;var _0x2d05ef={'id':this['id'],'available':this[_0xb7db('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xb7db('0x7')],'paused':this['paused'],'waiting':this[_0xb7db('0x16')]};var _0x19b470=md5(JSON[_0xb7db('0x17')](_0x2d05ef));if(this[_0xb7db('0x0')]!==_0x19b470){this['md5']=_0x19b470;io['to'](util['format']('fax:queue:%s',_0x2d05ef[_0xb7db('0x7')]))[_0xb7db('0x18')](_0xb7db('0x19'),_0x2d05ef);}};module[_0xb7db('0x1a')]=FaxQueue;
\ No newline at end of file
+var _0x485b=['defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','online','faxPause','available','stringify','format','fax:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment'];(function(_0x29017c,_0x46d01f){var _0x939a9b=function(_0x3926cb){while(--_0x3926cb){_0x29017c['push'](_0x29017c['shift']());}};_0x939a9b(++_0x46d01f);}(_0x485b,0x1be));var _0xb485=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x485b[_0x1e2080];return _0x260111;};'use strict';var _=require(_0xb485('0x0'));var md5=require('md5');var util=require(_0xb485('0x1'));var Redis=require(_0xb485('0x2'));var config=require(_0xb485('0x3'));config['redis']=_[_0xb485('0x4')](config['redis'],{'host':_0xb485('0x5'),'port':0x18eb});var io=require(_0xb485('0x6'))(new Redis(config[_0xb485('0x7')]));function FaxQueue(_0xe1309f){this['id']=_0xe1309f['id']||0x0;this[_0xb485('0x8')]=_0xe1309f[_0xb485('0x8')]||'';this[_0xb485('0x9')]=_0xe1309f[_0xb485('0x9')]||0xa;this[_0xb485('0xa')]=_0xe1309f[_0xb485('0xa')]||_0xb485('0xb');this[_0xb485('0xc')]=_0xe1309f[_0xb485('0xc')];this[_0xb485('0xd')]={};this[_0xb485('0xe')]=0x0;this[_0xb485('0xf')]='';this[_0xb485('0x10')]();this['updateRealtime']();}FaxQueue[_0xb485('0x11')][_0xb485('0x10')]=function(){var _0xbc594a=this['mapAgentsId'][_0xb485('0x12')];this[_0xb485('0xd')]=_['map'](this[_0xb485('0xc')],'id');this[_0xb485('0xd')][_0xb485('0x12')]=_0xbc594a;};FaxQueue[_0xb485('0x11')][_0xb485('0x13')]=function(){this[_0xb485('0x14')]=0x0;this[_0xb485('0x15')]=0x0;for(var _0x3ee778=0x0;_0x3ee778<this[_0xb485('0xc')]['length'];_0x3ee778+=0x1){if(this[_0xb485('0xc')][_0x3ee778][_0xb485('0x16')]){this[_0xb485('0x14')]+=0x1;}if(this[_0xb485('0xc')][_0x3ee778][_0xb485('0x17')]){this[_0xb485('0x15')]+=0x1;}}this[_0xb485('0x18')]=this['loggedIn']-this['paused'];this[_0xb485('0x18')]=this[_0xb485('0x18')]>=0x0?this['available']:0x0;var _0x152e29={'id':this['id'],'available':this[_0xb485('0x18')],'loggedIn':this[_0xb485('0x14')],'name':this[_0xb485('0x8')],'paused':this[_0xb485('0x15')],'waiting':this[_0xb485('0xe')]};var _0x38fffc=md5(JSON[_0xb485('0x19')](_0x152e29));if(this['md5']!==_0x38fffc){this['md5']=_0x38fffc;io['to'](util[_0xb485('0x1a')](_0xb485('0x1b'),_0x152e29[_0xb485('0x8')]))[_0xb485('0x1c')]('fax_queue:save',_0x152e29);}};module[_0xb485('0x1d')]=FaxQueue;
\ No newline at end of file
index c4003ce..e24f228 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf0e=['Intervals','name'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0xaf0e,0x115));var _0xeaf0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xaf0e[_0x5b644e];return _0x49c6bf;};'use strict';function Interval(_0x4602be){this['id']=_0x4602be['id']||0x0;this[_0xeaf0('0x0')]=_0x4602be[_0xeaf0('0x0')]||'';this['Intervals']=_0x4602be[_0xeaf0('0x1')]||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xec73=['exports','name','Intervals'];(function(_0x15bf24,_0x3e8c73){var _0x503f98=function(_0x50940f){while(--_0x50940f){_0x15bf24['push'](_0x15bf24['shift']());}};_0x503f98(++_0x3e8c73);}(_0xec73,0x17e));var _0x3ec7=function(_0x325290,_0x2b892b){_0x325290=_0x325290-0x0;var _0x13f2e7=_0xec73[_0x325290];return _0x13f2e7;};'use strict';function Interval(_0x75fa6e){this['id']=_0x75fa6e['id']||0x0;this[_0x3ec7('0x0')]=_0x75fa6e[_0x3ec7('0x0')]||'';this['Intervals']=_0x75fa6e[_0x3ec7('0x1')]||{};}module[_0x3ec7('0x2')]=Interval;
\ No newline at end of file
index 5958894..9eee9f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd577=['util','defaults','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','waiting','stringify','format','emit','mail_queue:save','exports','lodash'];(function(_0x2280ff,_0x45b5b2){var _0x657217=function(_0x13ed6f){while(--_0x13ed6f){_0x2280ff['push'](_0x2280ff['shift']());}};_0x657217(++_0x45b5b2);}(_0xd577,0x137));var _0x7d57=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0xd577[_0x257b0e];return _0x27ac2a;};'use strict';var _=require(_0x7d57('0x0'));var md5=require('md5');var util=require(_0x7d57('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x7d57('0x2')](config[_0x7d57('0x3')],{'host':_0x7d57('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7d57('0x3')]));function MailQueue(_0x422ce5){this['id']=_0x422ce5['id']||0x0;this[_0x7d57('0x5')]=_0x422ce5['name']||'';this['timeout']=_0x422ce5[_0x7d57('0x6')]||0xa;this[_0x7d57('0x7')]=_0x422ce5['strategy']||'beepall';this['Agents']=_0x422ce5[_0x7d57('0x8')];this[_0x7d57('0x9')]={};this['waiting']=0x0;this[_0x7d57('0xa')]='';this[_0x7d57('0xb')]();this[_0x7d57('0xc')]();}MailQueue[_0x7d57('0xd')]['updateRouting']=function(){var _0x21aa17=this[_0x7d57('0x9')][_0x7d57('0xe')];this[_0x7d57('0x9')]=_['map'](this[_0x7d57('0x8')],'id');this[_0x7d57('0x9')][_0x7d57('0xe')]=_0x21aa17;};MailQueue[_0x7d57('0xd')][_0x7d57('0xc')]=function(){this[_0x7d57('0xf')]=0x0;this[_0x7d57('0x10')]=0x0;for(var _0x463920=0x0;_0x463920<this[_0x7d57('0x8')][_0x7d57('0x11')];_0x463920+=0x1){if(this[_0x7d57('0x8')][_0x463920][_0x7d57('0x12')]){this[_0x7d57('0xf')]+=0x1;}if(this['Agents'][_0x463920]['mailPause']){this[_0x7d57('0x10')]+=0x1;}}this['available']=this[_0x7d57('0xf')]-this[_0x7d57('0x10')];this[_0x7d57('0x13')]=this[_0x7d57('0x13')]>=0x0?this[_0x7d57('0x13')]:0x0;var _0x109e82={'id':this['id'],'available':this[_0x7d57('0x13')],'loggedIn':this[_0x7d57('0xf')],'name':this[_0x7d57('0x5')],'paused':this['paused'],'waiting':this[_0x7d57('0x14')]};var _0xec793=md5(JSON[_0x7d57('0x15')](_0x109e82));if(this[_0x7d57('0xa')]!==_0xec793){this[_0x7d57('0xa')]=_0xec793;io['to'](util[_0x7d57('0x16')]('mail:queue:%s',_0x109e82[_0x7d57('0x5')]))[_0x7d57('0x17')](_0x7d57('0x18'),_0x109e82);}};module[_0x7d57('0x19')]=MailQueue;
\ No newline at end of file
+var _0xc996=['prototype','map','loggedIn','paused','length','available','stringify','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0xc996,0x1bf));var _0x6c99=function(_0x5c3332,_0x57dc5f){_0x5c3332=_0x5c3332-0x0;var _0x5258b0=_0xc996[_0x5c3332];return _0x5258b0;};'use strict';var _=require(_0x6c99('0x0'));var md5=require(_0x6c99('0x1'));var util=require('util');var Redis=require(_0x6c99('0x2'));var config=require(_0x6c99('0x3'));config[_0x6c99('0x4')]=_[_0x6c99('0x5')](config[_0x6c99('0x4')],{'host':_0x6c99('0x6'),'port':0x18eb});var io=require(_0x6c99('0x7'))(new Redis(config[_0x6c99('0x4')]));function MailQueue(_0x5dbfa6){this['id']=_0x5dbfa6['id']||0x0;this['name']=_0x5dbfa6[_0x6c99('0x8')]||'';this[_0x6c99('0x9')]=_0x5dbfa6['timeout']||0xa;this[_0x6c99('0xa')]=_0x5dbfa6[_0x6c99('0xa')]||_0x6c99('0xb');this['Agents']=_0x5dbfa6[_0x6c99('0xc')];this[_0x6c99('0xd')]={};this[_0x6c99('0xe')]=0x0;this[_0x6c99('0x1')]='';this[_0x6c99('0xf')]();this[_0x6c99('0x10')]();}MailQueue[_0x6c99('0x11')][_0x6c99('0xf')]=function(){var _0x4fe5e0=this[_0x6c99('0xd')]['_rr'];this[_0x6c99('0xd')]=_[_0x6c99('0x12')](this['Agents'],'id');this[_0x6c99('0xd')]['_rr']=_0x4fe5e0;};MailQueue['prototype'][_0x6c99('0x10')]=function(){this[_0x6c99('0x13')]=0x0;this[_0x6c99('0x14')]=0x0;for(var _0x36ab5f=0x0;_0x36ab5f<this['Agents'][_0x6c99('0x15')];_0x36ab5f+=0x1){if(this[_0x6c99('0xc')][_0x36ab5f]['online']){this['loggedIn']+=0x1;}if(this['Agents'][_0x36ab5f]['mailPause']){this[_0x6c99('0x14')]+=0x1;}}this[_0x6c99('0x16')]=this[_0x6c99('0x13')]-this[_0x6c99('0x14')];this[_0x6c99('0x16')]=this[_0x6c99('0x16')]>=0x0?this[_0x6c99('0x16')]:0x0;var _0x3919b7={'id':this['id'],'available':this[_0x6c99('0x16')],'loggedIn':this[_0x6c99('0x13')],'name':this[_0x6c99('0x8')],'paused':this[_0x6c99('0x14')],'waiting':this[_0x6c99('0xe')]};var _0x132fba=md5(JSON[_0x6c99('0x17')](_0x3919b7));if(this[_0x6c99('0x1')]!==_0x132fba){this[_0x6c99('0x1')]=_0x132fba;io['to'](util[_0x6c99('0x18')](_0x6c99('0x19'),_0x3919b7['name']))[_0x6c99('0x1a')](_0x6c99('0x1b'),_0x3919b7);}};module[_0x6c99('0x1c')]=MailQueue;
\ No newline at end of file
index 4618062..576e957 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x2ce055,_0x754ee6){var _0x31dd95=function(_0x9539f1){while(--_0x9539f1){_0x2ce055['push'](_0x2ce055['shift']());}};_0x31dd95(++_0x754ee6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x5fc3[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
+var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x7a54,0x106));var _0x47a5=function(_0x493f6e,_0x53691d){_0x493f6e=_0x493f6e-0x0;var _0xf38a86=_0x7a54[_0x493f6e];return _0xf38a86;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25<this[_0x47a5('0x10')][_0x47a5('0x14')];_0x139f25+=0x1){if(this[_0x47a5('0x10')][_0x139f25]['online']){this[_0x47a5('0x12')]+=0x1;}if(this[_0x47a5('0x10')][_0x139f25][_0x47a5('0x15')]){this[_0x47a5('0x13')]+=0x1;}}this[_0x47a5('0x16')]=this['loggedIn']-this['paused'];this[_0x47a5('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue;
\ No newline at end of file
index 914a81b..d29054f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66c=['timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','_rr','loggedIn','online','smsPause','paused','available','waiting','stringify','md5','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name'];(function(_0x52f890,_0xdb869a){var _0x1b0d30=function(_0x2399b8){while(--_0x2399b8){_0x52f890['push'](_0x52f890['shift']());}};_0x1b0d30(++_0xdb869a);}(_0xd66c,0x106));var _0xcd66=function(_0x32659a,_0x122f7e){_0x32659a=_0x32659a-0x0;var _0x2d75db=_0xd66c[_0x32659a];return _0x2d75db;};'use strict';var _=require(_0xcd66('0x0'));var md5=require('md5');var util=require(_0xcd66('0x1'));var Redis=require(_0xcd66('0x2'));var config=require(_0xcd66('0x3'));config[_0xcd66('0x4')]=_['defaults'](config[_0xcd66('0x4')],{'host':_0xcd66('0x5'),'port':0x18eb});var io=require(_0xcd66('0x6'))(new Redis(config[_0xcd66('0x4')]));function SmsQueue(_0xc037fc){this['id']=_0xc037fc['id']||0x0;this[_0xcd66('0x7')]=_0xc037fc[_0xcd66('0x7')]||'';this[_0xcd66('0x8')]=_0xc037fc['timeout']||0xa;this[_0xcd66('0x9')]=_0xc037fc[_0xcd66('0x9')]||_0xcd66('0xa');this[_0xcd66('0xb')]=_0xc037fc[_0xcd66('0xb')];this[_0xcd66('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xcd66('0xd')]();this['updateRealtime']();}SmsQueue[_0xcd66('0xe')][_0xcd66('0xd')]=function(){var _0x4edd72=this[_0xcd66('0xc')]['_rr'];this[_0xcd66('0xc')]=_[_0xcd66('0xf')](this[_0xcd66('0xb')],'id');this[_0xcd66('0xc')][_0xcd66('0x10')]=_0x4edd72;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xcd66('0x11')]=0x0;this['paused']=0x0;for(var _0x28ae0c=0x0;_0x28ae0c<this['Agents']['length'];_0x28ae0c+=0x1){if(this[_0xcd66('0xb')][_0x28ae0c][_0xcd66('0x12')]){this[_0xcd66('0x11')]+=0x1;}if(this[_0xcd66('0xb')][_0x28ae0c][_0xcd66('0x13')]){this[_0xcd66('0x14')]+=0x1;}}this['available']=this[_0xcd66('0x11')]-this['paused'];this[_0xcd66('0x15')]=this[_0xcd66('0x15')]>=0x0?this[_0xcd66('0x15')]:0x0;var _0x4d5212={'id':this['id'],'available':this[_0xcd66('0x15')],'loggedIn':this[_0xcd66('0x11')],'name':this[_0xcd66('0x7')],'paused':this[_0xcd66('0x14')],'waiting':this[_0xcd66('0x16')]};var _0x4216fd=md5(JSON[_0xcd66('0x17')](_0x4d5212));if(this[_0xcd66('0x18')]!==_0x4216fd){this[_0xcd66('0x18')]=_0x4216fd;io['to'](util[_0xcd66('0x19')](_0xcd66('0x1a'),_0x4d5212['name']))[_0xcd66('0x1b')](_0xcd66('0x1c'),_0x4d5212);}};module[_0xcd66('0x1d')]=SmsQueue;
\ No newline at end of file
+var _0x8db0=['updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online','smsPause','available','paused','stringify','format','sms:queue:%s','sms_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','waiting'];(function(_0x288285,_0x222a9e){var _0x1d1328=function(_0x3d78f6){while(--_0x3d78f6){_0x288285['push'](_0x288285['shift']());}};_0x1d1328(++_0x222a9e);}(_0x8db0,0x65));var _0x08db=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0x8db0[_0x5b64a1];return _0x4b6f55;};'use strict';var _=require(_0x08db('0x0'));var md5=require(_0x08db('0x1'));var util=require('util');var Redis=require(_0x08db('0x2'));var config=require(_0x08db('0x3'));config[_0x08db('0x4')]=_['defaults'](config[_0x08db('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x218333){this['id']=_0x218333['id']||0x0;this['name']=_0x218333[_0x08db('0x5')]||'';this['timeout']=_0x218333[_0x08db('0x6')]||0xa;this[_0x08db('0x7')]=_0x218333[_0x08db('0x7')]||_0x08db('0x8');this[_0x08db('0x9')]=_0x218333['Agents'];this['mapAgentsId']={};this[_0x08db('0xa')]=0x0;this[_0x08db('0x1')]='';this[_0x08db('0xb')]();this[_0x08db('0xc')]();}SmsQueue[_0x08db('0xd')][_0x08db('0xb')]=function(){var _0x2b1d6f=this[_0x08db('0xe')][_0x08db('0xf')];this[_0x08db('0xe')]=_[_0x08db('0x10')](this[_0x08db('0x9')],'id');this[_0x08db('0xe')][_0x08db('0xf')]=_0x2b1d6f;};SmsQueue[_0x08db('0xd')][_0x08db('0xc')]=function(){this[_0x08db('0x11')]=0x0;this['paused']=0x0;for(var _0x592286=0x0;_0x592286<this['Agents'][_0x08db('0x12')];_0x592286+=0x1){if(this[_0x08db('0x9')][_0x592286][_0x08db('0x13')]){this[_0x08db('0x11')]+=0x1;}if(this['Agents'][_0x592286][_0x08db('0x14')]){this['paused']+=0x1;}}this[_0x08db('0x15')]=this['loggedIn']-this[_0x08db('0x16')];this[_0x08db('0x15')]=this['available']>=0x0?this[_0x08db('0x15')]:0x0;var _0x16ca71={'id':this['id'],'available':this[_0x08db('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x08db('0x5')],'paused':this[_0x08db('0x16')],'waiting':this[_0x08db('0xa')]};var _0x27dc5c=md5(JSON[_0x08db('0x17')](_0x16ca71));if(this[_0x08db('0x1')]!==_0x27dc5c){this[_0x08db('0x1')]=_0x27dc5c;io['to'](util[_0x08db('0x18')](_0x08db('0x19'),_0x16ca71[_0x08db('0x5')]))['emit'](_0x08db('0x1a'),_0x16ca71);}};module[_0x08db('0x1b')]=SmsQueue;
\ No newline at end of file
index 479c53d..5d02222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x263c=['redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','updateRouting','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x263c,0x131));var _0xc263=function(_0x304429,_0x5c956f){_0x304429=_0x304429-0x0;var _0x26a77f=_0x263c[_0x304429];return _0x26a77f;};'use strict';var _=require(_0xc263('0x0'));var md5=require(_0xc263('0x1'));var util=require(_0xc263('0x2'));var Redis=require(_0xc263('0x3'));var config=require(_0xc263('0x4'));config[_0xc263('0x5')]=_['defaults'](config[_0xc263('0x5')],{'host':_0xc263('0x6'),'port':0x18eb});var io=require(_0xc263('0x7'))(new Redis(config[_0xc263('0x5')]));function WhatsappQueue(_0x20d278){this['id']=_0x20d278['id']||0x0;this[_0xc263('0x8')]=_0x20d278[_0xc263('0x8')]||'';this['timeout']=_0x20d278[_0xc263('0x9')]||0xa;this[_0xc263('0xa')]=_0x20d278[_0xc263('0xa')]||_0xc263('0xb');this[_0xc263('0xc')]=_0x20d278['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0xc263('0x1')]='';this[_0xc263('0xd')]();this['updateRealtime']();}WhatsappQueue[_0xc263('0xe')][_0xc263('0xd')]=function(){var _0x5b5bae=this[_0xc263('0xf')]['_rr'];this['mapAgentsId']=_[_0xc263('0x10')](this['Agents'],'id');this[_0xc263('0xf')][_0xc263('0x11')]=_0x5b5bae;};WhatsappQueue[_0xc263('0xe')]['updateRealtime']=function(){this[_0xc263('0x12')]=0x0;this[_0xc263('0x13')]=0x0;for(var _0x3c6e41=0x0;_0x3c6e41<this['Agents'][_0xc263('0x14')];_0x3c6e41+=0x1){if(this['Agents'][_0x3c6e41][_0xc263('0x15')]){this['loggedIn']+=0x1;}if(this[_0xc263('0xc')][_0x3c6e41][_0xc263('0x16')]){this[_0xc263('0x13')]+=0x1;}}this[_0xc263('0x17')]=this[_0xc263('0x12')]-this['paused'];this[_0xc263('0x17')]=this[_0xc263('0x17')]>=0x0?this[_0xc263('0x17')]:0x0;var _0xe6fca4={'id':this['id'],'available':this[_0xc263('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xc263('0x8')],'paused':this['paused'],'waiting':this[_0xc263('0x18')]};var _0x42d7f2=md5(JSON[_0xc263('0x19')](_0xe6fca4));if(this[_0xc263('0x1')]!==_0x42d7f2){this['md5']=_0x42d7f2;io['to'](util[_0xc263('0x1a')](_0xc263('0x1b'),_0xe6fca4[_0xc263('0x8')]))[_0xc263('0x1c')](_0xc263('0x1d'),_0xe6fca4);}};module[_0xc263('0x1e')]=WhatsappQueue;
\ No newline at end of file
+var _0xb120=['stringify','emit','whatsapp_queue:save','exports','lodash','md5','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','paused','online','available'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xb120,0x184));var _0x0b12=function(_0x555bbb,_0x2d8068){_0x555bbb=_0x555bbb-0x0;var _0x2528cc=_0xb120[_0x555bbb];return _0x2528cc;};'use strict';var _=require(_0x0b12('0x0'));var md5=require(_0x0b12('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0b12('0x2')]=_['defaults'](config[_0x0b12('0x2')],{'host':_0x0b12('0x3'),'port':0x18eb});var io=require(_0x0b12('0x4'))(new Redis(config[_0x0b12('0x2')]));function WhatsappQueue(_0x17aed2){this['id']=_0x17aed2['id']||0x0;this[_0x0b12('0x5')]=_0x17aed2[_0x0b12('0x5')]||'';this[_0x0b12('0x6')]=_0x17aed2[_0x0b12('0x6')]||0xa;this[_0x0b12('0x7')]=_0x17aed2[_0x0b12('0x7')]||_0x0b12('0x8');this[_0x0b12('0x9')]=_0x17aed2['Agents'];this['mapAgentsId']={};this[_0x0b12('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0x0b12('0xb')]();}WhatsappQueue[_0x0b12('0xc')][_0x0b12('0xd')]=function(){var _0x46a37e=this[_0x0b12('0xe')][_0x0b12('0xf')];this[_0x0b12('0xe')]=_['map'](this[_0x0b12('0x9')],'id');this[_0x0b12('0xe')][_0x0b12('0xf')]=_0x46a37e;};WhatsappQueue[_0x0b12('0xc')][_0x0b12('0xb')]=function(){this[_0x0b12('0x10')]=0x0;this[_0x0b12('0x11')]=0x0;for(var _0x20f2ab=0x0;_0x20f2ab<this[_0x0b12('0x9')]['length'];_0x20f2ab+=0x1){if(this['Agents'][_0x20f2ab][_0x0b12('0x12')]){this['loggedIn']+=0x1;}if(this[_0x0b12('0x9')][_0x20f2ab]['whatsappPause']){this[_0x0b12('0x11')]+=0x1;}}this[_0x0b12('0x13')]=this[_0x0b12('0x10')]-this['paused'];this['available']=this['available']>=0x0?this[_0x0b12('0x13')]:0x0;var _0x14780e={'id':this['id'],'available':this[_0x0b12('0x13')],'loggedIn':this[_0x0b12('0x10')],'name':this[_0x0b12('0x5')],'paused':this[_0x0b12('0x11')],'waiting':this['waiting']};var _0x3c3299=md5(JSON[_0x0b12('0x14')](_0x14780e));if(this[_0x0b12('0x1')]!==_0x3c3299){this[_0x0b12('0x1')]=_0x3c3299;io['to'](util['format']('whatsapp:queue:%s',_0x14780e[_0x0b12('0x5')]))[_0x0b12('0x15')](_0x0b12('0x16'),_0x14780e);}};module[_0x0b12('0x17')]=WhatsappQueue;
\ No newline at end of file
index 6b8a28a..6e5e553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x4e93ae,_0xfa2a35){var _0x43bae8=function(_0x529880){while(--_0x529880){_0x4e93ae['push'](_0x4e93ae['shift']());}};_0x43bae8(++_0xfa2a35);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0xb10b[_0x3d4ef1];return _0x409423;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3a69a0,_0x3d107c){var _0x35d2f0=function(_0x2b3a70){while(--_0x2b3a70){_0x3a69a0['push'](_0x3a69a0['shift']());}};_0x35d2f0(++_0x3d107c);}(_0xb10b,0x12a));var _0xbb10=function(_0xe1770a,_0x4fc5d6){_0xe1770a=_0xe1770a-0x0;var _0x3e6274=_0xb10b[_0xe1770a];return _0x3e6274;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
index 8875fd0..be803fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba94=['../client','update','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x564cfa,_0x22438f){var _0x348249=function(_0x3c82f7){while(--_0x3c82f7){_0x564cfa['push'](_0x564cfa['shift']());}};_0x348249(++_0x22438f);}(_0xba94,0x188));var _0x4ba9=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0xba94[_0x38ced4];return _0x547c07;};'use strict';var client=require(_0x4ba9('0x0'));exports[_0x4ba9('0x1')]=function(_0x48802c,_0x5cbeee){return client[_0x4ba9('0x2')](_0x4ba9('0x3'),{'body':_0x5cbeee,'options':{'where':{'id':_0x48802c}},'log':_0x4ba9('0x4')});};exports[_0x4ba9('0x5')]=function(_0x3243c7,_0x4a1067){return client[_0x4ba9('0x2')](_0x4ba9('0x6'),{'body':_0x4a1067,'options':{'where':{'id':_0x3243c7}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0xd5bf=['addTagsToChatInteraction','../client','updateChatInteraction','addTags','Request','AddTagsToChatInteraction'];(function(_0x3783b0,_0x5a77d6){var _0x1b6fd9=function(_0x248ad6){while(--_0x248ad6){_0x3783b0['push'](_0x3783b0['shift']());}};_0x1b6fd9(++_0x5a77d6);}(_0xd5bf,0x127));var _0xfd5b=function(_0xc734cf,_0x17ad11){_0xc734cf=_0xc734cf-0x0;var _0x3bad32=_0xd5bf[_0xc734cf];return _0x3bad32;};'use strict';var client=require(_0xfd5b('0x0'));exports['update']=function(_0x3d460e,_0x3d7bdf){return client['Request']('UpdateChatInteraction',{'body':_0x3d7bdf,'options':{'where':{'id':_0x3d460e}},'log':_0xfd5b('0x1')});};exports[_0xfd5b('0x2')]=function(_0x30b549,_0x31948c){return client[_0xfd5b('0x3')](_0xfd5b('0x4'),{'body':_0x31948c,'options':{'where':{'id':_0x30b549}},'log':_0xfd5b('0x5')});};
\ No newline at end of file
index ed7b4b3..ef2889c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0322=['../client','create','Request','createChatMessage'];(function(_0x168478,_0x323a27){var _0x29c2f8=function(_0x4f7a8a){while(--_0x4f7a8a){_0x168478['push'](_0x168478['shift']());}};_0x29c2f8(++_0x323a27);}(_0x0322,0x158));var _0x2032=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x0322[_0x290fa6];return _0x47f1f3;};'use strict';var client=require(_0x2032('0x0'));exports[_0x2032('0x1')]=function(_0x23cab1){return client[_0x2032('0x2')]('CreateChatMessage',{'body':_0x23cab1,'log':_0x2032('0x3')});};
\ No newline at end of file
+var _0x79ab=['Request','CreateChatMessage'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x79ab,0xc6));var _0xb79a=function(_0x4d572e,_0x59ceb7){_0x4d572e=_0x4d572e-0x0;var _0x43a969=_0x79ab[_0x4d572e];return _0x43a969;};'use strict';var client=require('../client');exports['create']=function(_0x5405fe){return client[_0xb79a('0x0')](_0xb79a('0x1'),{'body':_0x5405fe,'log':'createChatMessage'});};
\ No newline at end of file
index 6a83acb..62647b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x142c=['GetChatQueue','name','strategy','User','online','getChatQueues','../client','Request'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x142c,0x86));var _0xc142=function(_0x3babdb,_0x2cb497){_0x3babdb=_0x3babdb-0x0;var _0x59c37a=_0x142c[_0x3babdb];return _0x59c37a;};'use strict';var client=require(_0xc142('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xc142('0x1')](_0xc142('0x2'),{'options':{'raw':![],'attributes':['id',_0xc142('0x3'),'timeout',_0xc142('0x4')],'include':[{'model':_0xc142('0x5'),'as':'Agents','attributes':['id','name',_0xc142('0x6'),'chatPause']}]},'log':_0xc142('0x7')});};};
\ No newline at end of file
+var _0x106f=['online','chatPause','../client','getChatQueues','GetChatQueue','name','strategy','Agents'];(function(_0x44a327,_0x1d7469){var _0x3a9ebb=function(_0x20284f){while(--_0x20284f){_0x44a327['push'](_0x44a327['shift']());}};_0x3a9ebb(++_0x1d7469);}(_0x106f,0x162));var _0xf106=function(_0x47d4e6,_0x8d8b0b){_0x47d4e6=_0x47d4e6-0x0;var _0x3c2988=_0x106f[_0x47d4e6];return _0x3c2988;};'use strict';var client=require(_0xf106('0x0'));exports[_0xf106('0x1')]=function(){return function(){return client['Request'](_0xf106('0x2'),{'options':{'raw':![],'attributes':['id',_0xf106('0x3'),'timeout',_0xf106('0x4')],'include':[{'model':'User','as':_0xf106('0x5'),'attributes':['id',_0xf106('0x3'),_0xf106('0x6'),_0xf106('0x7')]}]},'log':_0xf106('0x1')});};};
\ No newline at end of file
index 412a74d..08b55ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38df=['create','Request','CreateChatQueueReport','UpdateChatQueueReport','../client'];(function(_0x119961,_0x38c0a1){var _0x147fe2=function(_0xd2e914){while(--_0xd2e914){_0x119961['push'](_0x119961['shift']());}};_0x147fe2(++_0x38c0a1);}(_0x38df,0x144));var _0xf38d=function(_0x5c6f37,_0x53bc84){_0x5c6f37=_0x5c6f37-0x0;var _0x4ae388=_0x38df[_0x5c6f37];return _0x4ae388;};'use strict';var client=require(_0xf38d('0x0'));exports[_0xf38d('0x1')]=function(_0x1b738c){return client[_0xf38d('0x2')](_0xf38d('0x3'),{'body':_0x1b738c,'log':_0xf38d('0x3')});};exports['update']=function(_0x5776bb,_0x115eaa){return client[_0xf38d('0x2')](_0xf38d('0x4'),{'body':_0x115eaa,'options':{'where':{'uniqueid':_0x5776bb},'order':[['id','DESC']],'limit':0x1},'log':_0xf38d('0x4')});};
\ No newline at end of file
+var _0xcb18=['CreateChatQueueReport','update','Request','UpdateChatQueueReport','DESC'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb18,0x159));var _0x8cb1=function(_0x54c6ad,_0x2c4344){_0x54c6ad=_0x54c6ad-0x0;var _0x282a76=_0xcb18[_0x54c6ad];return _0x282a76;};'use strict';var client=require('../client');exports['create']=function(_0x3b0e30){return client['Request'](_0x8cb1('0x0'),{'body':_0x3b0e30,'log':'CreateChatQueueReport'});};exports[_0x8cb1('0x1')]=function(_0x39e801,_0x87b1d3){return client[_0x8cb1('0x2')](_0x8cb1('0x3'),{'body':_0x87b1d3,'options':{'where':{'uniqueid':_0x39e801},'order':[['id',_0x8cb1('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});};
\ No newline at end of file
index b08cd49..21c7d2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x26bcec,_0xe13f50){var _0x1049dc=function(_0x4c0d9b){while(--_0x4c0d9b){_0x26bcec['push'](_0x26bcec['shift']());}};_0x1049dc(++_0xe13f50);}(_0x7a54,0x106));var _0x47a5=function(_0x4513c6,_0xecc16d){_0x4513c6=_0x4513c6-0x0;var _0x33e8a1=_0x7a54[_0x4513c6];return _0x33e8a1;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xe9c019,_0x1c72a1){var _0x67a688=function(_0x487bd1){while(--_0x487bd1){_0xe9c019['push'](_0xe9c019['shift']());}};_0x67a688(++_0x1c72a1);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index b335e97..b6e7a84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1845=['Request','CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x1845,0x170));var _0x5184=function(_0x4b88a5,_0xc9e4d9){_0x4b88a5=_0x4b88a5-0x0;var _0x10ffcc=_0x1845[_0x4b88a5];return _0x10ffcc;};'use strict';var client=require(_0x5184('0x0'));exports[_0x5184('0x1')]=function(_0x3e6c3a){return client[_0x5184('0x2')](_0x5184('0x3'),{'body':_0x3e6c3a,'log':_0x5184('0x4')});};
\ No newline at end of file
+var _0x9c43=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x3b1777,_0x1c0e02){var _0x111b93=function(_0x4478e3){while(--_0x4478e3){_0x3b1777['push'](_0x3b1777['shift']());}};_0x111b93(++_0x1c0e02);}(_0x9c43,0x1e5));var _0x39c4=function(_0x3a175b,_0x505d13){_0x3a175b=_0x3a175b-0x0;var _0x9b84fa=_0x9c43[_0x3a175b];return _0x9b84fa;};'use strict';var client=require('../client');exports[_0x39c4('0x0')]=function(_0x48d97b){return client[_0x39c4('0x1')](_0x39c4('0x2'),{'body':_0x48d97b,'log':_0x39c4('0x3')});};
\ No newline at end of file
index 101a3a3..ae81cb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b46=['getFaxQueues','../client','Request','GetFaxQueue','name','User','Agents','online','faxPause'];(function(_0x1381e2,_0xba45bb){var _0x505867=function(_0x24297d){while(--_0x24297d){_0x1381e2['push'](_0x1381e2['shift']());}};_0x505867(++_0xba45bb);}(_0x6b46,0x1c3));var _0x66b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6b46[_0x397e5f];return _0x5302b8;};'use strict';var client=require(_0x66b4('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x66b4('0x1')](_0x66b4('0x2'),{'options':{'raw':![],'attributes':['id',_0x66b4('0x3'),'timeout','strategy'],'include':[{'model':_0x66b4('0x4'),'as':_0x66b4('0x5'),'attributes':['id',_0x66b4('0x3'),_0x66b4('0x6'),_0x66b4('0x7')]}]},'log':_0x66b4('0x8')});};};
\ No newline at end of file
+var _0x7875=['faxPause','../client','getFaxQueues','name','timeout','strategy','User','online'];(function(_0x333e5e,_0x2ad165){var _0x23e82e=function(_0x2744c0){while(--_0x2744c0){_0x333e5e['push'](_0x333e5e['shift']());}};_0x23e82e(++_0x2ad165);}(_0x7875,0x1b1));var _0x5787=function(_0x488df1,_0x1bb1e3){_0x488df1=_0x488df1-0x0;var _0x467127=_0x7875[_0x488df1];return _0x467127;};'use strict';var client=require(_0x5787('0x0'));exports[_0x5787('0x1')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x5787('0x2'),_0x5787('0x3'),_0x5787('0x4')],'include':[{'model':_0x5787('0x5'),'as':'Agents','attributes':['id',_0x5787('0x2'),_0x5787('0x6'),_0x5787('0x7')]}]},'log':_0x5787('0x1')});};};
\ No newline at end of file
index 43b7bde..bd9e6fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x679b=['DESC','../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport'];(function(_0x4c12bf,_0x48a49d){var _0x1e8c1e=function(_0x26029){while(--_0x26029){_0x4c12bf['push'](_0x4c12bf['shift']());}};_0x1e8c1e(++_0x48a49d);}(_0x679b,0x67));var _0xb679=function(_0x33b86e,_0x299225){_0x33b86e=_0x33b86e-0x0;var _0x29fca0=_0x679b[_0x33b86e];return _0x29fca0;};'use strict';var client=require(_0xb679('0x0'));exports['create']=function(_0x1f18d0){return client[_0xb679('0x1')](_0xb679('0x2'),{'body':_0x1f18d0,'log':_0xb679('0x2')});};exports[_0xb679('0x3')]=function(_0x1cbc45,_0x278fbf){return client[_0xb679('0x1')](_0xb679('0x4'),{'body':_0x278fbf,'options':{'where':{'uniqueid':_0x1cbc45},'order':[['id',_0xb679('0x5')]],'limit':0x1},'log':_0xb679('0x4')});};
\ No newline at end of file
+var _0xb6ad=['UpdateFaxQueueReport','create','Request'];(function(_0x2e650d,_0x58436b){var _0x582488=function(_0x136231){while(--_0x136231){_0x2e650d['push'](_0x2e650d['shift']());}};_0x582488(++_0x58436b);}(_0xb6ad,0x1d5));var _0xdb6a=function(_0x47a041,_0x68361a){_0x47a041=_0x47a041-0x0;var _0x59dc02=_0xb6ad[_0x47a041];return _0x59dc02;};'use strict';var client=require('../client');exports[_0xdb6a('0x0')]=function(_0x3bd3fe){return client[_0xdb6a('0x1')]('CreateFaxQueueReport',{'body':_0x3bd3fe,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x3da2ce,_0x37a7f5){return client[_0xdb6a('0x1')](_0xdb6a('0x2'),{'body':_0x37a7f5,'options':{'where':{'uniqueid':_0x3da2ce},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
index 6c0cfbf..3dd462b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10fa=['getIntervals','name','Interval','Intervals','interval','../client'];(function(_0x5c92ff,_0x5478ab){var _0x40842c=function(_0x5ee52d){while(--_0x5ee52d){_0x5c92ff['push'](_0x5c92ff['shift']());}};_0x40842c(++_0x5478ab);}(_0x10fa,0xd7));var _0xa10f=function(_0x450f37,_0x2bee2d){_0x450f37=_0x450f37-0x0;var _0x3e80f0=_0x10fa[_0x450f37];return _0x3e80f0;};'use strict';var client=require(_0xa10f('0x0'));exports[_0xa10f('0x1')]=function(){return function(){return client['Request']('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa10f('0x2')],'include':[{'model':_0xa10f('0x3'),'as':_0xa10f('0x4'),'attributes':['id',_0xa10f('0x2'),_0xa10f('0x5')]}]},'log':_0xa10f('0x1')});};};
\ No newline at end of file
+var _0x7b09=['GetInterval','name','Intervals','getIntervals','Request'];(function(_0x59f61a,_0x5423a4){var _0x3837c6=function(_0x44008d){while(--_0x44008d){_0x59f61a['push'](_0x59f61a['shift']());}};_0x3837c6(++_0x5423a4);}(_0x7b09,0x1a7));var _0x97b0=function(_0x5327cc,_0x71501d){_0x5327cc=_0x5327cc-0x0;var _0x10e8da=_0x7b09[_0x5327cc];return _0x10e8da;};'use strict';var client=require('../client');exports[_0x97b0('0x0')]=function(){return function(){return client[_0x97b0('0x1')](_0x97b0('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x97b0('0x3')],'include':[{'model':'Interval','as':_0x97b0('0x4'),'attributes':['id',_0x97b0('0x3'),'interval']}]},'log':_0x97b0('0x0')});};};
\ No newline at end of file
index b245230..1e8f983 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd117=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x392f45,_0x4c8a33){var _0x314477=function(_0x580307){while(--_0x580307){_0x392f45['push'](_0x392f45['shift']());}};_0x314477(++_0x4c8a33);}(_0xd117,0x182));var _0x7d11=function(_0xd3e0b9,_0xd80d4d){_0xd3e0b9=_0xd3e0b9-0x0;var _0x470133=_0xd117[_0xd3e0b9];return _0x470133;};'use strict';var client=require(_0x7d11('0x0'));exports[_0x7d11('0x1')]=function(_0x2737ce,_0x45ee65){return client[_0x7d11('0x2')](_0x7d11('0x3'),{'body':_0x45ee65,'options':{'where':{'id':_0x2737ce}},'log':_0x7d11('0x4')});};exports[_0x7d11('0x5')]=function(_0x3c07be,_0x31fcb0){return client[_0x7d11('0x2')](_0x7d11('0x6'),{'body':_0x31fcb0,'options':{'where':{'id':_0x3c07be}},'log':_0x7d11('0x7')});};
\ No newline at end of file
+var _0xdb28=['addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x3f5491,_0x9344ba){var _0x4a364d=function(_0x4dfe73){while(--_0x4dfe73){_0x3f5491['push'](_0x3f5491['shift']());}};_0x4a364d(++_0x9344ba);}(_0xdb28,0x106));var _0x8db2=function(_0xb06e10,_0x17c4df){_0xb06e10=_0xb06e10-0x0;var _0x1fa6f8=_0xdb28[_0xb06e10];return _0x1fa6f8;};'use strict';var client=require(_0x8db2('0x0'));exports[_0x8db2('0x1')]=function(_0x1dc797,_0xf66e59){return client['Request'](_0x8db2('0x2'),{'body':_0xf66e59,'options':{'where':{'id':_0x1dc797}},'log':_0x8db2('0x3')});};exports[_0x8db2('0x4')]=function(_0x4426fe,_0x11109e){return client['Request'](_0x8db2('0x5'),{'body':_0x11109e,'options':{'where':{'id':_0x4426fe}},'log':_0x8db2('0x6')});};
\ No newline at end of file
index 83a98ee..01b249d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8d=['CreateMailMessage','createMailMessage','../client','Request'];(function(_0xebe9a9,_0x4936f1){var _0x3c3631=function(_0x136691){while(--_0x136691){_0xebe9a9['push'](_0xebe9a9['shift']());}};_0x3c3631(++_0x4936f1);}(_0x8b8d,0x1e2));var _0xd8b8=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x8b8d[_0x273c39];return _0x46d6b5;};'use strict';var client=require(_0xd8b8('0x0'));exports['create']=function(_0x326b55){return client[_0xd8b8('0x1')](_0xd8b8('0x2'),{'body':_0x326b55,'log':_0xd8b8('0x3')});};
\ No newline at end of file
+var _0x4e74=['create','Request','createMailMessage','../client'];(function(_0x3e3723,_0x359ca0){var _0x552d2b=function(_0x45e20b){while(--_0x45e20b){_0x3e3723['push'](_0x3e3723['shift']());}};_0x552d2b(++_0x359ca0);}(_0x4e74,0xe7));var _0x44e7=function(_0x1f0679,_0x53d43c){_0x1f0679=_0x1f0679-0x0;var _0x3dc3a4=_0x4e74[_0x1f0679];return _0x3dc3a4;};'use strict';var client=require(_0x44e7('0x0'));exports[_0x44e7('0x1')]=function(_0x2d56ae){return client[_0x44e7('0x2')]('CreateMailMessage',{'body':_0x2d56ae,'log':_0x44e7('0x3')});};
\ No newline at end of file
index a6b8948..c28803a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca69=['mailPause','../client','getMailQueues','Request','User','Agents','name','online'];(function(_0x531899,_0x3606e3){var _0x313ee2=function(_0x2eea90){while(--_0x2eea90){_0x531899['push'](_0x531899['shift']());}};_0x313ee2(++_0x3606e3);}(_0xca69,0xb1));var _0x9ca6=function(_0x5ac40c,_0x401834){_0x5ac40c=_0x5ac40c-0x0;var _0x486bed=_0xca69[_0x5ac40c];return _0x486bed;};'use strict';var client=require(_0x9ca6('0x0'));exports[_0x9ca6('0x1')]=function(){return function(){return client[_0x9ca6('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':_0x9ca6('0x3'),'as':_0x9ca6('0x4'),'attributes':['id',_0x9ca6('0x5'),_0x9ca6('0x6'),_0x9ca6('0x7')]}]},'log':_0x9ca6('0x1')});};};
\ No newline at end of file
+var _0x5c04=['online','Request','name','strategy','Agents'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5c04,0x8d));var _0x45c0=function(_0x3ac90c,_0x7f6c77){_0x3ac90c=_0x3ac90c-0x0;var _0x223800=_0x5c04[_0x3ac90c];return _0x223800;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0x45c0('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x45c0('0x1'),'timeout',_0x45c0('0x2')],'include':[{'model':'User','as':_0x45c0('0x3'),'attributes':['id',_0x45c0('0x1'),_0x45c0('0x4'),'mailPause']}]},'log':'getMailQueues'});};};
\ No newline at end of file
index f0eacd1..3cc32c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed70=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xed70,0x1c4));var _0x0ed7=function(_0x598495,_0x2e1c35){_0x598495=_0x598495-0x0;var _0x419caf=_0xed70[_0x598495];return _0x419caf;};'use strict';var client=require(_0x0ed7('0x0'));exports[_0x0ed7('0x1')]=function(_0x369cf3){return client[_0x0ed7('0x2')]('CreateMailQueueReport',{'body':_0x369cf3,'log':_0x0ed7('0x3')});};exports[_0x0ed7('0x4')]=function(_0x30c842,_0x2512bb){return client['Request']('UpdateMailQueueReport',{'body':_0x2512bb,'options':{'where':{'uniqueid':_0x30c842},'order':[['id',_0x0ed7('0x5')]],'limit':0x1},'log':_0x0ed7('0x6')});};
\ No newline at end of file
+var _0xbb83=['DESC','../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport'];(function(_0x2229c2,_0x196245){var _0x4981bc=function(_0x1d91ff){while(--_0x1d91ff){_0x2229c2['push'](_0x2229c2['shift']());}};_0x4981bc(++_0x196245);}(_0xbb83,0x190));var _0x3bb8=function(_0xddc0e2,_0x3f311f){_0xddc0e2=_0xddc0e2-0x0;var _0x3f6bba=_0xbb83[_0xddc0e2];return _0x3f6bba;};'use strict';var client=require(_0x3bb8('0x0'));exports[_0x3bb8('0x1')]=function(_0x5d3fc0){return client[_0x3bb8('0x2')]('CreateMailQueueReport',{'body':_0x5d3fc0,'log':_0x3bb8('0x3')});};exports[_0x3bb8('0x4')]=function(_0x5840d1,_0xf6f18f){return client[_0x3bb8('0x2')](_0x3bb8('0x5'),{'body':_0xf6f18f,'options':{'where':{'uniqueid':_0x5840d1},'order':[['id',_0x3bb8('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index 749d138..4b702e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd170=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x3c4f76,_0x93a866){var _0x3dc750=function(_0x1a3129){while(--_0x1a3129){_0x3c4f76['push'](_0x3c4f76['shift']());}};_0x3dc750(++_0x93a866);}(_0xd170,0x1a7));var _0x0d17=function(_0x25fded,_0x34216e){_0x25fded=_0x25fded-0x0;var _0x269156=_0xd170[_0x25fded];return _0x269156;};'use strict';var client=require(_0x0d17('0x0'));exports['update']=function(_0x1988ab,_0xc5d01f){return client[_0x0d17('0x1')](_0x0d17('0x2'),{'body':_0xc5d01f,'options':{'where':{'id':_0x1988ab}},'log':_0x0d17('0x3')});};exports[_0x0d17('0x4')]=function(_0xeb795a,_0x29ab25){return client[_0x0d17('0x1')](_0x0d17('0x5'),{'body':_0x29ab25,'options':{'where':{'id':_0xeb795a}},'log':_0x0d17('0x6')});};
\ No newline at end of file
+var _0x2340=['updateOpenchannelInteraction','AddTagsToOpenchannelInteraction','Request'];(function(_0xd5a842,_0x3bef1f){var _0xcedd84=function(_0x1b0965){while(--_0x1b0965){_0xd5a842['push'](_0xd5a842['shift']());}};_0xcedd84(++_0x3bef1f);}(_0x2340,0x1ca));var _0x0234=function(_0x414808,_0x949685){_0x414808=_0x414808-0x0;var _0x42c914=_0x2340[_0x414808];return _0x42c914;};'use strict';var client=require('../client');exports['update']=function(_0x2c0986,_0xc871ca){return client[_0x0234('0x0')]('UpdateOpenchannelInteraction',{'body':_0xc871ca,'options':{'where':{'id':_0x2c0986}},'log':_0x0234('0x1')});};exports['addTags']=function(_0xccf6f2,_0x1680ad){return client[_0x0234('0x0')](_0x0234('0x2'),{'body':_0x1680ad,'options':{'where':{'id':_0xccf6f2}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 7d98b41..f8e14dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7d4=['createOpenchannelMessage','../client','Request','CreateOpenchannelMessage'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc7d4,0x125));var _0x4c7d=function(_0x12e588,_0x1985e5){_0x12e588=_0x12e588-0x0;var _0x5377e6=_0xc7d4[_0x12e588];return _0x5377e6;};'use strict';var client=require(_0x4c7d('0x0'));exports['create']=function(_0x5ac7e7){return client[_0x4c7d('0x1')](_0x4c7d('0x2'),{'body':_0x5ac7e7,'log':_0x4c7d('0x3')});};
\ No newline at end of file
+var _0x200d=['CreateOpenchannelMessage'];(function(_0x31a576,_0x424419){var _0x30b1d3=function(_0x4710e8){while(--_0x4710e8){_0x31a576['push'](_0x31a576['shift']());}};_0x30b1d3(++_0x424419);}(_0x200d,0x125));var _0xd200=function(_0x3a3e30,_0x5996b5){_0x3a3e30=_0x3a3e30-0x0;var _0x19f849=_0x200d[_0x3a3e30];return _0x19f849;};'use strict';var client=require('../client');exports['create']=function(_0x42df14){return client['Request'](_0xd200('0x0'),{'body':_0x42df14,'log':'createOpenchannelMessage'});};
\ No newline at end of file
index f6b27ce..d07ad7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbee9=['GetOpenchannelQueue','name','strategy','Agents','online','openchannelPause','../client','getOpenchannelQueues','Request'];(function(_0x872b02,_0x4f4458){var _0x1a6b24=function(_0x1dfb4e){while(--_0x1dfb4e){_0x872b02['push'](_0x872b02['shift']());}};_0x1a6b24(++_0x4f4458);}(_0xbee9,0xf9));var _0x9bee=function(_0x475db1,_0x4dec37){_0x475db1=_0x475db1-0x0;var _0xa8961f=_0xbee9[_0x475db1];return _0xa8961f;};'use strict';var client=require(_0x9bee('0x0'));exports[_0x9bee('0x1')]=function(){return function(){return client[_0x9bee('0x2')](_0x9bee('0x3'),{'options':{'raw':![],'attributes':['id',_0x9bee('0x4'),'timeout',_0x9bee('0x5')],'include':[{'model':'User','as':_0x9bee('0x6'),'attributes':['id',_0x9bee('0x4'),_0x9bee('0x7'),_0x9bee('0x8')]}]},'log':_0x9bee('0x1')});};};
\ No newline at end of file
+var _0xa74b=['name','openchannelPause','../client','getOpenchannelQueues','strategy','Agents'];(function(_0x4b62fd,_0x4a9085){var _0x324489=function(_0x223836){while(--_0x223836){_0x4b62fd['push'](_0x4b62fd['shift']());}};_0x324489(++_0x4a9085);}(_0xa74b,0x140));var _0xba74=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa74b[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0xba74('0x0'));exports[_0xba74('0x1')]=function(){return function(){return client['Request']('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0xba74('0x2')],'include':[{'model':'User','as':_0xba74('0x3'),'attributes':['id',_0xba74('0x4'),'online',_0xba74('0x5')]}]},'log':_0xba74('0x1')});};};
\ No newline at end of file
index e65db2a..8f59c88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab26=['../client','create','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0xab26,0xd2));var _0x6ab2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xab26[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x6ab2('0x0'));exports[_0x6ab2('0x1')]=function(_0x18e2d0){return client['Request'](_0x6ab2('0x2'),{'body':_0x18e2d0,'log':_0x6ab2('0x2')});};exports['update']=function(_0x4fcec3,_0x4c8cf){return client['Request'](_0x6ab2('0x3'),{'body':_0x4c8cf,'options':{'where':{'uniqueid':_0x4fcec3},'order':[['id',_0x6ab2('0x4')]],'limit':0x1},'log':_0x6ab2('0x3')});};
\ No newline at end of file
+var _0xd6e2=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x498b8f,_0x3ec603){var _0x54940a=function(_0x69cebd){while(--_0x69cebd){_0x498b8f['push'](_0x498b8f['shift']());}};_0x54940a(++_0x3ec603);}(_0xd6e2,0x169));var _0x2d6e=function(_0x9a0e39,_0x329a84){_0x9a0e39=_0x9a0e39-0x0;var _0x2eebbf=_0xd6e2[_0x9a0e39];return _0x2eebbf;};'use strict';var client=require(_0x2d6e('0x0'));exports['create']=function(_0x5abe1b){return client[_0x2d6e('0x1')](_0x2d6e('0x2'),{'body':_0x5abe1b,'log':_0x2d6e('0x2')});};exports[_0x2d6e('0x3')]=function(_0xa75d5a,_0x52d498){return client['Request'](_0x2d6e('0x4'),{'body':_0x52d498,'options':{'where':{'uniqueid':_0xa75d5a},'order':[['id',_0x2d6e('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 91562ae..93ecbb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x98a8=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0xc25389,_0x4d62c4){var _0x4c5850=function(_0x1c4792){while(--_0x1c4792){_0xc25389['push'](_0xc25389['shift']());}};_0x4c5850(++_0x4d62c4);}(_0x98a8,0x12c));var _0x898a=function(_0x42ffaf,_0x5dfbe0){_0x42ffaf=_0x42ffaf-0x0;var _0x4c242b=_0x98a8[_0x42ffaf];return _0x4c242b;};'use strict';var client=require(_0x898a('0x0'));exports[_0x898a('0x1')]=function(_0x3c1d2d,_0x4583d9){return client[_0x898a('0x2')](_0x898a('0x3'),{'body':_0x4583d9,'options':{'where':{'id':_0x3c1d2d}},'log':_0x898a('0x4')});};exports['addTags']=function(_0x2bb3e2,_0xf84a19){return client[_0x898a('0x2')](_0x898a('0x5'),{'body':_0xf84a19,'options':{'where':{'id':_0x2bb3e2}},'log':_0x898a('0x6')});};
\ No newline at end of file
+var _0xe3c5=['addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x4cbf20,_0x1bfa66){var _0x582ae4=function(_0x5eca38){while(--_0x5eca38){_0x4cbf20['push'](_0x4cbf20['shift']());}};_0x582ae4(++_0x1bfa66);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x3662b4,_0x503b4d){_0x3662b4=_0x3662b4-0x0;var _0x50928c=_0xe3c5[_0x3662b4];return _0x50928c;};'use strict';var client=require(_0x5e3c('0x0'));exports[_0x5e3c('0x1')]=function(_0x2c9f92,_0x6230a){return client[_0x5e3c('0x2')](_0x5e3c('0x3'),{'body':_0x6230a,'options':{'where':{'id':_0x2c9f92}},'log':'updateSmsInteraction'});};exports[_0x5e3c('0x4')]=function(_0x2ef6cd,_0x361936){return client[_0x5e3c('0x2')](_0x5e3c('0x5'),{'body':_0x361936,'options':{'where':{'id':_0x2ef6cd}},'log':_0x5e3c('0x6')});};
\ No newline at end of file
index 1519ff2..c7c8998 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3da=['../client','create','Request','createSmsMessage'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xb3da,0x178));var _0xab3d=function(_0x154007,_0x5f3e7d){_0x154007=_0x154007-0x0;var _0x590934=_0xb3da[_0x154007];return _0x590934;};'use strict';var client=require(_0xab3d('0x0'));exports[_0xab3d('0x1')]=function(_0x21726b){return client[_0xab3d('0x2')]('CreateSmsMessage',{'body':_0x21726b,'log':_0xab3d('0x3')});};
\ No newline at end of file
+var _0x291d=['createSmsMessage','../client','Request','CreateSmsMessage'];(function(_0x2e1ca2,_0x150397){var _0x60bc65=function(_0x12de2d){while(--_0x12de2d){_0x2e1ca2['push'](_0x2e1ca2['shift']());}};_0x60bc65(++_0x150397);}(_0x291d,0x131));var _0xd291=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x291d[_0x5e36d1];return _0x950b9e;};'use strict';var client=require(_0xd291('0x0'));exports['create']=function(_0x5a37a4){return client[_0xd291('0x1')](_0xd291('0x2'),{'body':_0x5a37a4,'log':_0xd291('0x3')});};
\ No newline at end of file
index 38e2f26..855c196 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x16fcaf,_0xb63e53){var _0x485781=function(_0x13ced5){while(--_0x13ced5){_0x16fcaf['push'](_0x16fcaf['shift']());}};_0x485781(++_0xb63e53);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};};
\ No newline at end of file
+var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x158147,_0x15c105){var _0x2a751b=function(_0x111e0e){while(--_0x111e0e){_0x158147['push'](_0x158147['shift']());}};_0x2a751b(++_0x15c105);}(_0x70e0,0x17b));var _0x070e=function(_0x10ea3d,_0x578386){_0x10ea3d=_0x10ea3d-0x0;var _0x2bc36c=_0x70e0[_0x10ea3d];return _0x2bc36c;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};};
\ No newline at end of file
index fced3fe..a89e71e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0xedd9,0xfc));var _0x9edd=function(_0x3da0fa,_0x3991a8){_0x3da0fa=_0x3da0fa-0x0;var _0x4f1cea=_0xedd9[_0x3da0fa];return _0x4f1cea;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
+var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x2d3adf,_0x2d193c){var _0x51f54f=function(_0xe095c6){while(--_0xe095c6){_0x2d3adf['push'](_0x2d3adf['shift']());}};_0x51f54f(++_0x2d193c);}(_0x9c44,0x178));var _0x49c4=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x9c44[_0x4fde08];return _0x12e725;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});};
\ No newline at end of file
index 793363d..ab87889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3de80e,_0x5cabca){var _0x5629fd=function(_0x5d7ff5){while(--_0x5d7ff5){_0x3de80e['push'](_0x3de80e['shift']());}};_0x5629fd(++_0x5cabca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x5434e0,_0x351357){var _0x621117=function(_0x598eb8){while(--_0x598eb8){_0x5434e0['push'](_0x5434e0['shift']());}};_0x621117(++_0x351357);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index 5bb75d1..e858f95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68fd=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x68fd,0x1e9));var _0xd68f=function(_0x5b26f1,_0x92f4cd){_0x5b26f1=_0x5b26f1-0x0;var _0x4504cd=_0x68fd[_0x5b26f1];return _0x4504cd;};'use strict';var client=require(_0xd68f('0x0'));exports['update']=function(_0x17591d,_0x1492a9){return client['Request'](_0xd68f('0x1'),{'body':_0x1492a9,'options':{'where':{'id':_0x17591d}},'log':_0xd68f('0x2')});};exports[_0xd68f('0x3')]=function(_0x3e5e78,_0x37c481){return client[_0xd68f('0x4')](_0xd68f('0x5'),{'body':_0x37c481,'options':{'where':{'id':_0x3e5e78}},'log':_0xd68f('0x6')});};
\ No newline at end of file
+var _0x6931=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x1cd477,_0x42d4cd){var _0x3d9007=function(_0x1f3f4d){while(--_0x1f3f4d){_0x1cd477['push'](_0x1cd477['shift']());}};_0x3d9007(++_0x42d4cd);}(_0x6931,0x1a9));var _0x1693=function(_0x3cf725,_0xe3fe7){_0x3cf725=_0x3cf725-0x0;var _0x50842a=_0x6931[_0x3cf725];return _0x50842a;};'use strict';var client=require(_0x1693('0x0'));exports[_0x1693('0x1')]=function(_0x321d58,_0x773026){return client[_0x1693('0x2')](_0x1693('0x3'),{'body':_0x773026,'options':{'where':{'id':_0x321d58}},'log':_0x1693('0x4')});};exports[_0x1693('0x5')]=function(_0x59d148,_0x19ff1c){return client[_0x1693('0x2')](_0x1693('0x6'),{'body':_0x19ff1c,'options':{'where':{'id':_0x59d148}},'log':_0x1693('0x7')});};
\ No newline at end of file
index fc8c6fc..103e3b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc91f=['create','Request','createWhatsappMessage','../client'];(function(_0x4dc7b9,_0x319d5a){var _0x3ab114=function(_0x51a9df){while(--_0x51a9df){_0x4dc7b9['push'](_0x4dc7b9['shift']());}};_0x3ab114(++_0x319d5a);}(_0xc91f,0x1ab));var _0xfc91=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc91f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xfc91('0x0'));exports[_0xfc91('0x1')]=function(_0x32a899){return client[_0xfc91('0x2')]('CreateWhatsappMessage',{'body':_0x32a899,'log':_0xfc91('0x3')});};
\ No newline at end of file
+var _0x06cb=['Request','CreateWhatsappMessage'];(function(_0x5bf4ed,_0xb54e4f){var _0x14e79b=function(_0x4efef8){while(--_0x4efef8){_0x5bf4ed['push'](_0x5bf4ed['shift']());}};_0x14e79b(++_0xb54e4f);}(_0x06cb,0x1ba));var _0xb06c=function(_0x38e7e0,_0x5c5dae){_0x38e7e0=_0x38e7e0-0x0;var _0x38540b=_0x06cb[_0x38e7e0];return _0x38540b;};'use strict';var client=require('../client');exports['create']=function(_0x2abb8d){return client[_0xb06c('0x0')](_0xb06c('0x1'),{'body':_0x2abb8d,'log':'createWhatsappMessage'});};
\ No newline at end of file
index b95b394..72b2256 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a35=['online','whatsappPause','getWhatsappQueues','../client','GetWhatsappQueue','name','strategy','User','Agents'];(function(_0xbebc05,_0x178145){var _0x1cd1dc=function(_0x45446d){while(--_0x45446d){_0xbebc05['push'](_0xbebc05['shift']());}};_0x1cd1dc(++_0x178145);}(_0x3a35,0x12c));var _0x53a3=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x3a35[_0x2160a9];return _0xa88cf7;};'use strict';var client=require(_0x53a3('0x0'));exports['getWhatsappQueues']=function(){return function(){return client['Request'](_0x53a3('0x1'),{'options':{'raw':![],'attributes':['id',_0x53a3('0x2'),'timeout',_0x53a3('0x3')],'include':[{'model':_0x53a3('0x4'),'as':_0x53a3('0x5'),'attributes':['id',_0x53a3('0x2'),_0x53a3('0x6'),_0x53a3('0x7')]}]},'log':_0x53a3('0x8')});};};
\ No newline at end of file
+var _0x6cf1=['timeout','strategy','Agents','online','getWhatsappQueues','../client','Request','GetWhatsappQueue'];(function(_0x2324e2,_0x20c55c){var _0x14e540=function(_0x4b97e3){while(--_0x4b97e3){_0x2324e2['push'](_0x2324e2['shift']());}};_0x14e540(++_0x20c55c);}(_0x6cf1,0x14d));var _0x16cf=function(_0x4451c5,_0x5742b6){_0x4451c5=_0x4451c5-0x0;var _0x153a05=_0x6cf1[_0x4451c5];return _0x153a05;};'use strict';var client=require(_0x16cf('0x0'));exports['getWhatsappQueues']=function(){return function(){return client[_0x16cf('0x1')](_0x16cf('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x16cf('0x3'),_0x16cf('0x4')],'include':[{'model':'User','as':_0x16cf('0x5'),'attributes':['id','name',_0x16cf('0x6'),'whatsappPause']}]},'log':_0x16cf('0x7')});};};
\ No newline at end of file
index d80f740..404994a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea6d=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','create','Request'];(function(_0x10221b,_0x4202b8){var _0x40e259=function(_0x389b79){while(--_0x389b79){_0x10221b['push'](_0x10221b['shift']());}};_0x40e259(++_0x4202b8);}(_0xea6d,0x89));var _0xdea6=function(_0x2b2308,_0x3dcc58){_0x2b2308=_0x2b2308-0x0;var _0x1f1d93=_0xea6d[_0x2b2308];return _0x1f1d93;};'use strict';var client=require(_0xdea6('0x0'));exports[_0xdea6('0x1')]=function(_0x556941){return client[_0xdea6('0x2')](_0xdea6('0x3'),{'body':_0x556941,'log':'CreateWhatsappQueueReport'});};exports[_0xdea6('0x4')]=function(_0x128ede,_0x51b691){return client[_0xdea6('0x2')](_0xdea6('0x5'),{'body':_0x51b691,'options':{'where':{'uniqueid':_0x128ede},'order':[['id',_0xdea6('0x6')]],'limit':0x1},'log':'UpdateWhatsappQueueReport'});};
\ No newline at end of file
+var _0x0e79=['CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client','Request'];(function(_0xa5d9c5,_0x41991d){var _0x35233a=function(_0x54004a){while(--_0x54004a){_0xa5d9c5['push'](_0xa5d9c5['shift']());}};_0x35233a(++_0x41991d);}(_0x0e79,0x136));var _0x90e7=function(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x0e79[_0x205e5a];return _0x10da58;};'use strict';var client=require(_0x90e7('0x0'));exports['create']=function(_0x160851){return client[_0x90e7('0x1')](_0x90e7('0x2'),{'body':_0x160851,'log':'CreateWhatsappQueueReport'});};exports[_0x90e7('0x3')]=function(_0x2fc10e,_0x290bf9){return client[_0x90e7('0x1')](_0x90e7('0x4'),{'body':_0x290bf9,'options':{'where':{'uniqueid':_0x2fc10e},'order':[['id',_0x90e7('0x5')]],'limit':0x1},'log':_0x90e7('0x4')});};
\ No newline at end of file
index 8f3d743..9c1d4d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ecb=['../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','atimeout','channel','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue'];(function(_0x260f28,_0x4e9b30){var _0x3aefcc=function(_0x223b18){while(--_0x223b18){_0x260f28['push'](_0x260f28['shift']());}};_0x3aefcc(++_0x4e9b30);}(_0x1ecb,0xb5));var _0xb1ec=function(_0x2e9ef1,_0x5fd211){_0x2e9ef1=_0x2e9ef1-0x0;var _0x3f00fa=_0x1ecb[_0x2e9ef1];return _0x3f00fa;};'use strict';var schema=require(_0xb1ec('0x0'));var _=require(_0xb1ec('0x1'));var util=require(_0xb1ec('0x2'));var seqqueue=require(_0xb1ec('0x3'));var logger=require(_0xb1ec('0x4'))(_0xb1ec('0x5'));var strategy=require(_0xb1ec('0x6'));var queue=schema({'name':{'type':_0xb1ec('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb1ec('0x8'),'message':_0xb1ec('0x9')}});function writeLog(_0x4ebd71,_0x93af7b,_0x34770e){return logger[_0xb1ec('0xa')](util[_0xb1ec('0xb')](_0xb1ec('0xc'),_0x4ebd71,_0x93af7b[_0xb1ec('0xd')],_0x34770e));}function handleFindAgent(_0x6d1edf){return function(_0x537b28){return _0x537b28[_0xb1ec('0xd')][_0xb1ec('0xe')]()===_0x6d1edf[_0xb1ec('0xe')]();};}exports[_0xb1ec('0xf')]=function(_0x45961d,_0x461cc9,_0x452c3c,_0x15301c){return function(_0x48ce1c){try{var _0x11c495={'name':_0x461cc9[0x0],'timeout':_0x461cc9[0x1]};var _0x43e3c0=queue[_0xb1ec('0x0')](_0x11c495,{'typecast':!![]});if(_0x43e3c0[_0xb1ec('0x10')]){logger[_0xb1ec('0x11')](_0xb1ec('0x12'),_0x45961d,_[_0xb1ec('0x13')](_0x43e3c0,_0xb1ec('0x14'))['join'](',\x20'));_0x48ce1c[_0xb1ec('0x15')]();}else{var _0x4ee8e6=_[_0xb1ec('0x16')](_0x452c3c[_0xb1ec('0x17')],handleFindAgent(_0x11c495[_0xb1ec('0xd')]));if(_0x4ee8e6){var _0x5ab7b7=(_0x11c495['timeout']||0xa)*0x3e8;var _0x13ef34,_0x23d0ab;var _0x2c0846=seqqueue['createQueue'](_0x5ab7b7);_0x2c0846['id']=_0x45961d;_0x2c0846[_0xb1ec('0x18')]=_0x5ab7b7;_0x2c0846[_0xb1ec('0x19')]=_0x15301c['channel'];writeLog(_0x45961d,_0x4ee8e6,util[_0xb1ec('0xb')](_0xb1ec('0x1a'),_0x5ab7b7));_0x452c3c[_0xb1ec('0x1b')][_0x45961d]['on']('end',function(){logger[_0xb1ec('0xa')](_0xb1ec('0x1c'),_0x45961d);clearTimeout(_0x23d0ab);_0x23d0ab=undefined;_0x2c0846['close']();if(_0x452c3c[_0xb1ec('0x1b')][_0x45961d]){delete _0x452c3c[_0xb1ec('0x1b')][_0x45961d];}_0x48ce1c[_0xb1ec('0x15')]();});_0x452c3c[_0xb1ec('0x1b')][_0x45961d]['on'](_0xb1ec('0x1d'),function(){if(_0x452c3c[_0xb1ec('0x1b')][_0x45961d]){delete _0x452c3c[_0xb1ec('0x1b')][_0x45961d];}});_0x23d0ab=setTimeout(function(){logger[_0xb1ec('0xa')](_0xb1ec('0x1e'),_0x45961d);clearTimeout(_0x23d0ab);_0x2c0846[_0xb1ec('0x1f')]();_0x48ce1c[_0xb1ec('0x20')]();},_0x5ab7b7);strategy[_0xb1ec('0x21')](_0x2c0846,_0x4ee8e6,_0x452c3c,_0x15301c);}else{logger[_0xb1ec('0x11')](_0xb1ec('0x22'),_0x45961d,_0x11c495['name']);_0x48ce1c['stop']();}}}catch(_0x5b90ed){console[_0xb1ec('0x23')](_0x5b90ed);logger[_0xb1ec('0x11')](_0xb1ec('0x24'),_0x45961d,_0x5b90ed['stack']);_0x48ce1c['stop']();}};};
\ No newline at end of file
+var _0xca03=['number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','validate','map','message','find','timeout','atimeout','channel','START:%s','end','rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','close','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','util','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0xf4fee8,_0x5951ce){var _0x1303d7=function(_0x56e749){while(--_0x56e749){_0xf4fee8['push'](_0xf4fee8['shift']());}};_0x1303d7(++_0x5951ce);}(_0xca03,0x150));var _0x3ca0=function(_0x49d2ff,_0xe1a8d4){_0x49d2ff=_0x49d2ff-0x0;var _0x445143=_0xca03[_0x49d2ff];return _0x445143;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x3ca0('0x0'));var seqqueue=require('seq-queue');var logger=require(_0x3ca0('0x1'))(_0x3ca0('0x2'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x3ca0('0x3'),'required':!![],'message':_0x3ca0('0x4')},'timeout':{'type':_0x3ca0('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x312d4f,_0x5cb594,_0x55b127){return logger[_0x3ca0('0x6')](util[_0x3ca0('0x7')](_0x3ca0('0x8'),_0x312d4f,_0x5cb594['name'],_0x55b127));}function handleFindAgent(_0x4e47d6){return function(_0x2ecb6a){return _0x2ecb6a[_0x3ca0('0x9')][_0x3ca0('0xa')]()===_0x4e47d6[_0x3ca0('0xa')]();};}exports['consequence']=function(_0x16ccad,_0x2d07c,_0x417cbb,_0xbc01d4){return function(_0x2667db){try{var _0x28f6a8={'name':_0x2d07c[0x0],'timeout':_0x2d07c[0x1]};var _0x720869=queue[_0x3ca0('0xb')](_0x28f6a8,{'typecast':!![]});if(_0x720869['length']){logger['error']('[%s][AGENT]\x20%s',_0x16ccad,_[_0x3ca0('0xc')](_0x720869,_0x3ca0('0xd'))['join'](',\x20'));_0x2667db['stop']();}else{var _0x5e6102=_[_0x3ca0('0xe')](_0x417cbb['agents'],handleFindAgent(_0x28f6a8[_0x3ca0('0x9')]));if(_0x5e6102){var _0x2649f9=(_0x28f6a8[_0x3ca0('0xf')]||0xa)*0x3e8;var _0x5b6106,_0x5c69a0;var _0x39a020=seqqueue['createQueue'](_0x2649f9);_0x39a020['id']=_0x16ccad;_0x39a020[_0x3ca0('0x10')]=_0x2649f9;_0x39a020[_0x3ca0('0x11')]=_0xbc01d4[_0x3ca0('0x11')];writeLog(_0x16ccad,_0x5e6102,util['format'](_0x3ca0('0x12'),_0x2649f9));_0x417cbb['rules'][_0x16ccad]['on'](_0x3ca0('0x13'),function(){logger[_0x3ca0('0x6')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x16ccad);clearTimeout(_0x5c69a0);_0x5c69a0=undefined;_0x39a020['close']();if(_0x417cbb['rules'][_0x16ccad]){delete _0x417cbb[_0x3ca0('0x14')][_0x16ccad];}_0x2667db[_0x3ca0('0x15')]();});_0x417cbb[_0x3ca0('0x14')][_0x16ccad]['on'](_0x3ca0('0x16'),function(){if(_0x417cbb[_0x3ca0('0x14')][_0x16ccad]){delete _0x417cbb[_0x3ca0('0x14')][_0x16ccad];}});_0x5c69a0=setTimeout(function(){logger[_0x3ca0('0x6')](_0x3ca0('0x17'),_0x16ccad);clearTimeout(_0x5c69a0);_0x39a020[_0x3ca0('0x18')]();_0x2667db[_0x3ca0('0x19')]();},_0x2649f9);strategy[_0x3ca0('0x1a')](_0x39a020,_0x5e6102,_0x417cbb,_0xbc01d4);}else{logger[_0x3ca0('0x1b')](_0x3ca0('0x1c'),_0x16ccad,_0x28f6a8['name']);_0x2667db[_0x3ca0('0x15')]();}}}catch(_0x468a42){console[_0x3ca0('0x1d')](_0x468a42);logger[_0x3ca0('0x1b')](_0x3ca0('0x1e'),_0x16ccad,_0x468a42['stack']);_0x2667db[_0x3ca0('0x15')]();}};};
\ No newline at end of file
index 366f068..0843ae9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d05=['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!','LexRuntime','$LATEST','message','toString','postText','providerName','amazonlex','providerResponse','Failed','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','account','AccountId','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then'];(function(_0x58a329,_0xd74d19){var _0x1389f8=function(_0x1f183d){while(--_0x1f183d){_0x58a329['push'](_0x58a329['shift']());}};_0x1389f8(++_0xd74d19);}(_0x4d05,0x10a));var _0x54d0=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4d05[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x54d0('0x0'));var moment=require(_0x54d0('0x1'));var AWS=require(_0x54d0('0x2'));var utils=require(_0x54d0('0x3'));var logger=require(_0x54d0('0x4'))('routing');var rpc={'chatMessage':require(_0x54d0('0x5')),'openchannelMessage':require(_0x54d0('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x54d0('0x7')),'whatsappMessage':require(_0x54d0('0x8'))};exports[_0x54d0('0x9')]=function(_0x54e1e3,_0x38d0b0){return function(_0x10d3a8){try{if(!_[_0x54d0('0xa')](this[_0x54d0('0xb')][_0x54d0('0xc')])){logger[_0x54d0('0xd')](_0x54d0('0xe'),_0x54e1e3,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x10d3a8[_0x54d0('0xf')]();}var _0x1861b7={'ContactId':this[_0x54d0('0x10')]['id'],'sentAt':moment()['format'](_0x54d0('0x11')),'direction':_0x54d0('0x12')};if(this[_0x54d0('0x13')]===_0x54d0('0x14')||this[_0x54d0('0x13')]===_0x54d0('0x15')){_0x1861b7[_0x54d0('0x16')]=this[_0x54d0('0xb')][_0x54d0('0x16')];}var _0x12dfc7=this['channel'];if(_0x12dfc7===_0x54d0('0x17')){_0x1861b7['ChatWebsiteId']=this[_0x54d0('0x18')]['id'];}else{_0x1861b7[_['upperFirst'](_0x12dfc7)+_0x54d0('0x19')]=this[_0x54d0('0x18')]['id'];}_0x1861b7[_[_0x54d0('0x1a')](_0x12dfc7)+'InteractionId']=this[_0x54d0('0xb')]['id'];if(this[_0x54d0('0xb')][_0x54d0('0x1b')]){var _0x4f286c=_0x38d0b0[0x4];if(!_[_0x54d0('0x1c')](_0x4f286c)){_0x1861b7[_0x54d0('0x1d')]=utils[_0x54d0('0x1e')](_0x4f286c,this);return rpc[_0x12dfc7+_0x54d0('0x1f')][_0x54d0('0x20')](_0x1861b7)[_0x54d0('0x21')](function(_0x3fe985){logger[_0x54d0('0xd')]('[%s][AMAZONLEX]\x20%s',_0x54e1e3,_0x1861b7[_0x54d0('0x1d')]);})[_0x54d0('0x22')](function(_0x1f48aa){logger['error'](_0x54d0('0xe'),_0x54e1e3,JSON[_0x54d0('0x23')](_0x1f48aa));})[_0x54d0('0x24')](function(){logger['info'](_0x54d0('0x25'),_0x54e1e3);_0x10d3a8[_0x54d0('0x26')]();});}else{logger['info'](_0x54d0('0x27'),_0x54e1e3);_0x10d3a8[_0x54d0('0x26')]();}}else{var _0x1fecf5=this;var _0x4f1236=new AWS[(_0x54d0('0x28'))]({'accessKeyId':_0x38d0b0[0x0],'secretAccessKey':_0x38d0b0[0x1],'region':_0x38d0b0[0x2]});var _0x17f5a4={'botAlias':_0x54d0('0x29'),'botName':_0x38d0b0[0x3],'inputText':this[_0x54d0('0x2a')][_0x54d0('0x1d')],'userId':this[_0x54d0('0x13')]+':'+this['interaction']['id'][_0x54d0('0x2b')]()};_0x4f1236[_0x54d0('0x2c')](_0x17f5a4,function(_0x2756a5,_0x1946c1){if(_0x2756a5){logger['error']('[%s][AMAZONLEX]\x20%s',_0x54e1e3,_0x2756a5[_0x54d0('0x2a')]);_0x10d3a8[_0x54d0('0xf')]();}else if(_0x1946c1&&_0x1946c1[_0x54d0('0x2a')]){_0x1fecf5[_0x54d0('0x1d')]['amazonlex']=_0x1946c1;_0x1861b7[_0x54d0('0x1d')]=_0x1946c1['message'];_0x1861b7[_0x54d0('0x2d')]=_0x54d0('0x2e');_0x1861b7[_0x54d0('0x2f')]=JSON[_0x54d0('0x23')](_0x1946c1);return rpc[_0x12dfc7+_0x54d0('0x1f')][_0x54d0('0x20')](_0x1861b7)[_0x54d0('0x21')](function(_0x3a213e){logger[_0x54d0('0xd')](_0x54d0('0xe'),_0x54e1e3,_0x1861b7[_0x54d0('0x1d')]);if(_0x1946c1['dialogState']==_0x54d0('0x30')){_0x10d3a8['next']();}else{_0x10d3a8['stop']();}})[_0x54d0('0x22')](function(_0x418ff6){logger[_0x54d0('0x31')](_0x54d0('0xe'),_0x54e1e3,JSON[_0x54d0('0x23')](_0x418ff6));_0x10d3a8[_0x54d0('0xf')]();});}else{_0x10d3a8[_0x54d0('0xf')]();}});}}catch(_0x57cd49){logger['error'](_0x54d0('0xe'),_0x54e1e3,JSON[_0x54d0('0x23')](_0x57cd49));_0x10d3a8[_0x54d0('0x26')]();}};};
\ No newline at end of file
+var _0x872a=['[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','$LATEST','toString','error','message','providerName','amazonlex','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info'];(function(_0x5da27f,_0x504b76){var _0x54a3fb=function(_0x3b65a8){while(--_0x3b65a8){_0x5da27f['push'](_0x5da27f['shift']());}};_0x54a3fb(++_0x504b76);}(_0x872a,0x1b4));var _0xa872=function(_0x5020cc,_0x36da25){_0x5020cc=_0x5020cc-0x0;var _0x5e81b7=_0x872a[_0x5020cc];return _0x5e81b7;};'use strict';var _=require(_0xa872('0x0'));var moment=require(_0xa872('0x1'));var AWS=require(_0xa872('0x2'));var utils=require(_0xa872('0x3'));var logger=require('../../../../config/logger')(_0xa872('0x4'));var rpc={'chatMessage':require(_0xa872('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa872('0x6')),'smsMessage':require(_0xa872('0x7')),'faxMessage':require(_0xa872('0x8')),'whatsappMessage':require(_0xa872('0x9'))};exports[_0xa872('0xa')]=function(_0x529bf8,_0x1d759e){return function(_0x1ba87e){try{if(!_['isNil'](this[_0xa872('0xb')][_0xa872('0xc')])){logger[_0xa872('0xd')](_0xa872('0xe'),_0x529bf8,_0xa872('0xf'));return _0x1ba87e[_0xa872('0x10')]();}var _0x4646c0={'ContactId':this['contact']['id'],'sentAt':moment()[_0xa872('0x11')](_0xa872('0x12')),'direction':_0xa872('0x13')};if(this['channel']===_0xa872('0x14')||this[_0xa872('0x15')]===_0xa872('0x16')){_0x4646c0[_0xa872('0x17')]=this[_0xa872('0xb')][_0xa872('0x17')];}var _0xeac4c3=this[_0xa872('0x15')];if(_0xeac4c3==='chat'){_0x4646c0['ChatWebsiteId']=this[_0xa872('0x18')]['id'];}else{_0x4646c0[_[_0xa872('0x19')](_0xeac4c3)+_0xa872('0x1a')]=this[_0xa872('0x18')]['id'];}_0x4646c0[_[_0xa872('0x19')](_0xeac4c3)+_0xa872('0x1b')]=this[_0xa872('0xb')]['id'];if(this[_0xa872('0xb')]['created']){var _0x1b1dbf=_0x1d759e[0x4];if(!_[_0xa872('0x1c')](_0x1b1dbf)){_0x4646c0[_0xa872('0x1d')]=utils[_0xa872('0x1e')](_0x1b1dbf,this);return rpc[_0xeac4c3+_0xa872('0x1f')][_0xa872('0x20')](_0x4646c0)[_0xa872('0x21')](function(_0x68a144){logger[_0xa872('0xd')](_0xa872('0xe'),_0x529bf8,_0x4646c0[_0xa872('0x1d')]);})[_0xa872('0x22')](function(_0x190589){logger['error'](_0xa872('0xe'),_0x529bf8,JSON[_0xa872('0x23')](_0x190589));})[_0xa872('0x24')](function(){logger[_0xa872('0xd')](_0xa872('0x25'),_0x529bf8);_0x1ba87e['stop']();});}else{logger[_0xa872('0xd')](_0xa872('0x26'),_0x529bf8);_0x1ba87e[_0xa872('0x27')]();}}else{var _0x58ddc8=this;var _0x21326d=new AWS[(_0xa872('0x28'))]({'accessKeyId':_0x1d759e[0x0],'secretAccessKey':_0x1d759e[0x1],'region':_0x1d759e[0x2]});var _0x460ac9={'botAlias':_0xa872('0x29'),'botName':_0x1d759e[0x3],'inputText':this['message']['body'],'userId':this[_0xa872('0x15')]+':'+this[_0xa872('0xb')]['id'][_0xa872('0x2a')]()};_0x21326d['postText'](_0x460ac9,function(_0x318e8a,_0x3c7628){if(_0x318e8a){logger[_0xa872('0x2b')](_0xa872('0xe'),_0x529bf8,_0x318e8a[_0xa872('0x2c')]);_0x1ba87e[_0xa872('0x10')]();}else if(_0x3c7628&&_0x3c7628['message']){_0x58ddc8[_0xa872('0x1d')]['amazonlex']=_0x3c7628;_0x4646c0['body']=_0x3c7628[_0xa872('0x2c')];_0x4646c0[_0xa872('0x2d')]=_0xa872('0x2e');_0x4646c0[_0xa872('0x2f')]=JSON['stringify'](_0x3c7628);return rpc[_0xeac4c3+_0xa872('0x1f')][_0xa872('0x20')](_0x4646c0)['then'](function(_0x45a56b){logger[_0xa872('0xd')]('[%s][AMAZONLEX]\x20%s',_0x529bf8,_0x4646c0['body']);if(_0x3c7628[_0xa872('0x30')]==_0xa872('0x31')){_0x1ba87e[_0xa872('0x10')]();}else{_0x1ba87e[_0xa872('0x27')]();}})[_0xa872('0x22')](function(_0x5b1b47){logger[_0xa872('0x2b')](_0xa872('0xe'),_0x529bf8,JSON[_0xa872('0x23')](_0x5b1b47));_0x1ba87e[_0xa872('0x10')]();});}else{_0x1ba87e[_0xa872('0x10')]();}});}}catch(_0x52ac3f){logger[_0xa872('0x2b')](_0xa872('0xe'),_0x529bf8,JSON[_0xa872('0x23')](_0x52ac3f));_0x1ba87e['stop']();}};};
\ No newline at end of file
index 5d046a9..2c4e744 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35eb=['getMustacheRender','message','from','phone','read','subject','startsWith','chat','ChatWebsiteId','AccountId','account','Message','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','<div','headers','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','resolve','Interaction','update','stop','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','mail','body','isAutoreply','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel'];(function(_0x26b30a,_0xfb3217){var _0x269187=function(_0x468148){while(--_0x468148){_0x26b30a['push'](_0x26b30a['shift']());}};_0x269187(++_0xfb3217);}(_0x35eb,0x1a1));var _0xb35e=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0x35eb[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require(_0xb35e('0x0'));var moment=require(_0xb35e('0x1'));var utils=require('./utils');var logger=require(_0xb35e('0x2'))(_0xb35e('0x3'));var rpc={'chatMessage':require(_0xb35e('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xb35e('0x5')),'smsMessage':require(_0xb35e('0x6')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xb35e('0x7')),'chatInteraction':require(_0xb35e('0x8')),'openchannelInteraction':require(_0xb35e('0x9')),'mailInteraction':require(_0xb35e('0xa')),'smsInteraction':require(_0xb35e('0xb')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xb35e('0xc'));exports[_0xb35e('0xd')]=function(_0xa623d8,_0x47111a,_0x6dd0d6,_0x5c02fa){return function(_0x3779df){try{var _0x434532=this['channel'];if(_0x434532===_0xb35e('0xe')&&_0x5c02fa[_0xb35e('0xf')][_0xb35e('0x10')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0xa623d8,_0xb35e('0x11'));return _0x3779df[_0xb35e('0x12')]();}if(_0x47111a[0x0]==='1'&&(_[_0xb35e('0x13')](this[_0xb35e('0x14')]['created'])||!this[_0xb35e('0x14')][_0xb35e('0x15')])){logger[_0xb35e('0x16')](_0xb35e('0x17'),_0xa623d8,_0xb35e('0x18'));return _0x3779df[_0xb35e('0x12')]();}if(_0x47111a[0x0]==='2'&&this[_0xb35e('0x14')][_0xb35e('0x19')]){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xa623d8,'One\x20Time\x20already\x20sent');return _0x3779df['next']();}var _0x1c55cc={'ContactId':this[_0xb35e('0x1a')]['id'],'sentAt':moment()[_0xb35e('0x1b')](_0xb35e('0x1c')),'direction':_0xb35e('0x1d')};if(this[_0xb35e('0x1e')]===_0xb35e('0xe')){_0x1c55cc['body']=utils[_0xb35e('0x1f')](_0x47111a[0x2],this);}else{_0x1c55cc[_0xb35e('0xf')]=utils['getMustacheRender'](_0x47111a[0x1],this);}if(this[_0xb35e('0x20')]){_0x1c55cc['to']=this['message'][_0xb35e('0x21')]||'';if(this['channel']===_0xb35e('0xe')&&_0x47111a[0x1]==='1'){_0x1c55cc['cc']=this['message']['cc']||'';}_0x1c55cc[_0xb35e('0x21')]=this['message']['to']||'';_0x1c55cc[_0xb35e('0x22')]=this[_0xb35e('0x20')][_0xb35e('0x22')]||'';_0x1c55cc[_0xb35e('0x23')]=!![];if(this[_0xb35e('0x20')]['subject']){_0x1c55cc['subject']='';_0x1c55cc[_0xb35e('0x24')]+=_[_0xb35e('0x25')](this[_0xb35e('0x20')][_0xb35e('0x24')],'Re:')?'':'Re:\x20';_0x1c55cc[_0xb35e('0x24')]+=this[_0xb35e('0x20')][_0xb35e('0x24')];}}if(this[_0xb35e('0x1e')]===_0xb35e('0x26')){_0x1c55cc[_0xb35e('0x27')]=this['account']['id'];}else{_0x1c55cc[_['upperFirst'](this[_0xb35e('0x1e')])+_0xb35e('0x28')]=this[_0xb35e('0x29')]['id'];}_0x1c55cc[_['upperFirst'](this['channel'])+'InteractionId']=this[_0xb35e('0x14')]['id'];var _0x401050=this[_0xb35e('0x14')];if(rpc[this[_0xb35e('0x1e')]+_0xb35e('0x2a')]){if(this[_0xb35e('0x1e')]==='mail'){_0x1c55cc[_0xb35e('0x2b')]=this[_0xb35e('0x20')][_0xb35e('0x2c')];_0x1c55cc[_0xb35e('0x2d')]=_0xb35e('0x2e')+_['replace'](_0x1c55cc[_0xb35e('0xf')],'<div\x20id=\x22xm-mail-content\x22',_0xb35e('0x2f'))+'</div>';_0x1c55cc[_0xb35e('0x30')]={'Auto-Submitted':'auto-replied','X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0xb35e('0x29')][_0xb35e('0x31')],_0x1c55cc)['then'](function(_0x56577d){logger['info'](_0xb35e('0x32'),_0xa623d8);_0x1c55cc[_0xb35e('0x2c')]=_0x56577d[_0xb35e('0x20')][_0xb35e('0x2c')];return rpc[_0x434532+_0xb35e('0x2a')][_0xb35e('0x33')](_0x1c55cc);})[_0xb35e('0x34')](function(_0x4cc33e){logger[_0xb35e('0x16')](_0xb35e('0x17'),_0xa623d8,JSON[_0xb35e('0x35')](_0x4cc33e));})['catch'](function(_0x2ddc95){logger[_0xb35e('0x36')](_0xb35e('0x37'),_0xa623d8,JSON['stringify'](_0x2ddc95));})[_0xb35e('0x38')](function(){Promise['resolve']()[_0xb35e('0x34')](function(){if(_0x47111a[0x0]!=='2'||_0x401050[_0xb35e('0x19')])return;return rpc[_0x434532+'Interaction']['update'](_0x401050['id'],{'autoreplyExecuted':!![]})[_0xb35e('0x34')](function(_0x3c07d8){logger[_0xb35e('0x16')](_0xb35e('0x39'),_0xa623d8,JSON[_0xb35e('0x35')](_0x3c07d8));})[_0xb35e('0x3a')](function(_0x30a7bc){logger['error'](_0xb35e('0x3b'),_0xa623d8,JSON['stringify'](_0x30a7bc));});})[_0xb35e('0x34')](function(){_0x3779df[_0xb35e('0x12')]();});});}else{return rpc[this['channel']+_0xb35e('0x2a')]['create'](_0x1c55cc)[_0xb35e('0x34')](function(){logger[_0xb35e('0x16')](_0xb35e('0x17'),_0xa623d8,_0x1c55cc[_0xb35e('0xf')]);})[_0xb35e('0x3a')](function(_0x58bf5d){logger[_0xb35e('0x36')](_0xb35e('0x17'),_0xa623d8,JSON[_0xb35e('0x35')](_0x58bf5d));})[_0xb35e('0x38')](function(){Promise[_0xb35e('0x3c')]()[_0xb35e('0x34')](function(){if(_0x47111a[0x0]!=='2'||_0x401050['autoreplyExecuted'])return;return rpc[_0x434532+_0xb35e('0x3d')][_0xb35e('0x3e')](_0x401050['id'],{'autoreplyExecuted':!![]})['then'](function(_0x264816){logger[_0xb35e('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xa623d8,JSON['stringify'](_0x264816));})['catch'](function(_0x436a5f){logger[_0xb35e('0x36')](_0xb35e('0x3b'),_0xa623d8,JSON[_0xb35e('0x35')](_0x436a5f));});})['then'](function(){_0x3779df[_0xb35e('0x12')]();});});}}}catch(_0x1a66e8){logger[_0xb35e('0x36')](_0xb35e('0x17'),_0xa623d8,JSON['stringify'](_0x1a66e8));_0x3779df[_0xb35e('0x3f')]();}};};
\ No newline at end of file
+var _0x80b9=['created','info','Autoreply\x20already\x20sent','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','chat','account','upperFirst','AccountId','Message','inReplyTo','messageId','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','<div','</div>','auto-replied','All','sendMailMessage','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction'];(function(_0xa9d6d1,_0x3762b2){var _0x53a4cb=function(_0x181c1f){while(--_0x181c1f){_0xa9d6d1['push'](_0xa9d6d1['shift']());}};_0x53a4cb(++_0x3762b2);}(_0x80b9,0x74));var _0x980b=function(_0x2fe300,_0x40fc60){_0x2fe300=_0x2fe300-0x0;var _0x53db5a=_0x80b9[_0x2fe300];return _0x53db5a;};'use strict';var _=require(_0x980b('0x0'));var moment=require(_0x980b('0x1'));var utils=require(_0x980b('0x2'));var logger=require('../../../../config/logger')(_0x980b('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x980b('0x4')),'mailMessage':require(_0x980b('0x5')),'smsMessage':require(_0x980b('0x6')),'faxMessage':require(_0x980b('0x7')),'whatsappMessage':require(_0x980b('0x8')),'chatInteraction':require(_0x980b('0x9')),'openchannelInteraction':require(_0x980b('0xa')),'mailInteraction':require(_0x980b('0xb')),'smsInteraction':require(_0x980b('0xc')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x980b('0xd'));exports[_0x980b('0xe')]=function(_0x5dabcb,_0x37870d,_0x50bbf4,_0x3a27db){return function(_0x16e620){try{var _0x4b28c4=this[_0x980b('0xf')];if(_0x4b28c4===_0x980b('0x10')&&_0x3a27db[_0x980b('0x11')][_0x980b('0x12')]){logger['info'](_0x980b('0x13'),_0x5dabcb,_0x980b('0x14'));return _0x16e620[_0x980b('0x15')]();}if(_0x37870d[0x0]==='1'&&(_[_0x980b('0x16')](this[_0x980b('0x17')][_0x980b('0x18')])||!this[_0x980b('0x17')][_0x980b('0x18')])){logger[_0x980b('0x19')](_0x980b('0x13'),_0x5dabcb,_0x980b('0x1a'));return _0x16e620['next']();}if(_0x37870d[0x0]==='2'&&this['interaction']['autoreplyExecuted']){logger[_0x980b('0x19')](_0x980b('0x1b'),_0x5dabcb,_0x980b('0x1c'));return _0x16e620[_0x980b('0x15')]();}var _0x5923ea={'ContactId':this[_0x980b('0x1d')]['id'],'sentAt':moment()[_0x980b('0x1e')](_0x980b('0x1f')),'direction':_0x980b('0x20')};if(this[_0x980b('0xf')]===_0x980b('0x10')){_0x5923ea[_0x980b('0x11')]=utils['getMustacheRender'](_0x37870d[0x2],this);}else{_0x5923ea[_0x980b('0x11')]=utils[_0x980b('0x21')](_0x37870d[0x1],this);}if(this['message']){_0x5923ea['to']=this[_0x980b('0x22')][_0x980b('0x23')]||'';if(this[_0x980b('0xf')]==='mail'&&_0x37870d[0x1]==='1'){_0x5923ea['cc']=this[_0x980b('0x22')]['cc']||'';}_0x5923ea[_0x980b('0x23')]=this['message']['to']||'';_0x5923ea[_0x980b('0x24')]=this[_0x980b('0x22')]['phone']||'';_0x5923ea[_0x980b('0x25')]=!![];if(this[_0x980b('0x22')][_0x980b('0x26')]){_0x5923ea[_0x980b('0x26')]='';_0x5923ea[_0x980b('0x26')]+=_['startsWith'](this[_0x980b('0x22')][_0x980b('0x26')],_0x980b('0x27'))?'':_0x980b('0x28');_0x5923ea[_0x980b('0x26')]+=this[_0x980b('0x22')]['subject'];}}if(this[_0x980b('0xf')]===_0x980b('0x29')){_0x5923ea['ChatWebsiteId']=this[_0x980b('0x2a')]['id'];}else{_0x5923ea[_[_0x980b('0x2b')](this['channel'])+_0x980b('0x2c')]=this[_0x980b('0x2a')]['id'];}_0x5923ea[_['upperFirst'](this[_0x980b('0xf')])+'InteractionId']=this['interaction']['id'];var _0x13fd56=this['interaction'];if(rpc[this[_0x980b('0xf')]+_0x980b('0x2d')]){if(this['channel']===_0x980b('0x10')){_0x5923ea[_0x980b('0x2e')]=this[_0x980b('0x22')][_0x980b('0x2f')];_0x5923ea['html']=_0x980b('0x30')+_[_0x980b('0x31')](_0x5923ea[_0x980b('0x11')],_0x980b('0x32'),_0x980b('0x33'))+_0x980b('0x34');_0x5923ea['headers']={'Auto-Submitted':_0x980b('0x35'),'X-Auto-Response-Suppress':_0x980b('0x36'),'Precedence':'auto_reply'};return mailRpc[_0x980b('0x37')](this[_0x980b('0x2a')][_0x980b('0x38')],_0x5923ea)['then'](function(_0x211875){logger[_0x980b('0x19')](_0x980b('0x39'),_0x5dabcb);_0x5923ea[_0x980b('0x2f')]=_0x211875[_0x980b('0x22')][_0x980b('0x2f')];return rpc[_0x4b28c4+_0x980b('0x2d')][_0x980b('0x3a')](_0x5923ea);})[_0x980b('0x3b')](function(_0x169e6d){logger['info'](_0x980b('0x13'),_0x5dabcb,JSON[_0x980b('0x3c')](_0x169e6d));})[_0x980b('0x3d')](function(_0x11eb85){logger[_0x980b('0x3e')](_0x980b('0x3f'),_0x5dabcb,JSON[_0x980b('0x3c')](_0x11eb85));})['finally'](function(){Promise[_0x980b('0x40')]()[_0x980b('0x3b')](function(){if(_0x37870d[0x0]!=='2'||_0x13fd56[_0x980b('0x41')])return;return rpc[_0x4b28c4+'Interaction'][_0x980b('0x42')](_0x13fd56['id'],{'autoreplyExecuted':!![]})['then'](function(_0x36c326){logger[_0x980b('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5dabcb,JSON[_0x980b('0x3c')](_0x36c326));})[_0x980b('0x3d')](function(_0x2ccc4c){logger[_0x980b('0x3e')](_0x980b('0x43'),_0x5dabcb,JSON[_0x980b('0x3c')](_0x2ccc4c));});})[_0x980b('0x3b')](function(){_0x16e620[_0x980b('0x15')]();});});}else{return rpc[this[_0x980b('0xf')]+'Message'][_0x980b('0x3a')](_0x5923ea)[_0x980b('0x3b')](function(){logger[_0x980b('0x19')](_0x980b('0x13'),_0x5dabcb,_0x5923ea['body']);})[_0x980b('0x3d')](function(_0x2f73af){logger[_0x980b('0x3e')](_0x980b('0x13'),_0x5dabcb,JSON['stringify'](_0x2f73af));})['finally'](function(){Promise[_0x980b('0x40')]()[_0x980b('0x3b')](function(){if(_0x37870d[0x0]!=='2'||_0x13fd56['autoreplyExecuted'])return;return rpc[_0x4b28c4+_0x980b('0x44')][_0x980b('0x42')](_0x13fd56['id'],{'autoreplyExecuted':!![]})[_0x980b('0x3b')](function(_0x1040de){logger[_0x980b('0x19')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5dabcb,JSON['stringify'](_0x1040de));})[_0x980b('0x3d')](function(_0x226da7){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5dabcb,JSON[_0x980b('0x3c')](_0x226da7));});})[_0x980b('0x3b')](function(){_0x16e620[_0x980b('0x15')]();});});}}}catch(_0x1d5c80){logger[_0x980b('0x3e')](_0x980b('0x13'),_0x5dabcb,JSON[_0x980b('0x3c')](_0x1d5c80));_0x16e620[_0x980b('0x45')]();}};};
\ No newline at end of file
index ed393d3..35f1c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8943=['consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x23990b,_0x4a5db6){var _0x5aaa82=function(_0x387978){while(--_0x387978){_0x23990b['push'](_0x23990b['shift']());}};_0x5aaa82(++_0x4a5db6);}(_0x8943,0x119));var _0x3894=function(_0x5cc40c,_0x282c47){_0x5cc40c=_0x5cc40c-0x0;var _0x11e524=_0x8943[_0x5cc40c];return _0x11e524;};'use strict';var moment=require('moment');var logger=require(_0x3894('0x0'))(_0x3894('0x1'));var rpc={'chatInteraction':require(_0x3894('0x2')),'openchannelInteraction':require(_0x3894('0x3')),'smsInteraction':require(_0x3894('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x3894('0x5')]=function(_0x2b95ec,_0x38cf80,_0x312c05,_0x51a227){return function(_0x496114){try{logger['info'](_0x3894('0x6'),_0x2b95ec,_0x38cf80[0x0]);var _0x2e11f1={'closed':0x1,'closedAt':moment()[_0x3894('0x7')](_0x3894('0x8')),'closeReason':_0x3894('0x9'),'disposition':_0x38cf80[0x0]};if(rpc[_0x51a227[_0x3894('0xa')]+'Interaction']){rpc[_0x51a227['channel']+'Interaction'][_0x3894('0xb')](_0x51a227[_0x3894('0xc')]['id'],_0x2e11f1)[_0x3894('0xd')](function(_0x118306){logger[_0x3894('0xe')](_0x3894('0xf'),_0x2b95ec,_0x51a227[_0x3894('0xc')]['id']);})[_0x3894('0x10')](function(_0x566acc){logger[_0x3894('0x11')](_0x3894('0x12'),_0x2b95ec,JSON[_0x3894('0x13')](_0x566acc));})[_0x3894('0x14')](function(){_0x496114[_0x3894('0x15')]();});}}catch(_0x5ab9ff){logger[_0x3894('0x11')]('[%s][CLOSE]\x20%s',_0x2b95ec,JSON['stringify'](_0x5ab9ff));_0x496114[_0x3894('0x15')]();}};};
\ No newline at end of file
+var _0x1e59=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction'];(function(_0x2b22fe,_0x393f3f){var _0x37aafa=function(_0x48c45c){while(--_0x48c45c){_0x2b22fe['push'](_0x2b22fe['shift']());}};_0x37aafa(++_0x393f3f);}(_0x1e59,0x99));var _0x91e5=function(_0x146303,_0x326885){_0x146303=_0x146303-0x0;var _0x30237e=_0x1e59[_0x146303];return _0x30237e;};'use strict';var moment=require(_0x91e5('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatInteraction':require(_0x91e5('0x1')),'openchannelInteraction':require(_0x91e5('0x2')),'smsInteraction':require(_0x91e5('0x3')),'mailInteraction':require(_0x91e5('0x4')),'faxInteraction':require(_0x91e5('0x5')),'whatsappInteraction':require(_0x91e5('0x6'))};exports['consequence']=function(_0x552e93,_0x97a94a,_0x514da3,_0x3dec1b){return function(_0x39a390){try{logger[_0x91e5('0x7')](_0x91e5('0x8'),_0x552e93,_0x97a94a[0x0]);var _0x41edce={'closed':0x1,'closedAt':moment()[_0x91e5('0x9')](_0x91e5('0xa')),'closeReason':'system','disposition':_0x97a94a[0x0]};if(rpc[_0x3dec1b['channel']+_0x91e5('0xb')]){rpc[_0x3dec1b[_0x91e5('0xc')]+_0x91e5('0xb')][_0x91e5('0xd')](_0x3dec1b[_0x91e5('0xe')]['id'],_0x41edce)['then'](function(_0x266139){logger[_0x91e5('0x7')](_0x91e5('0xf'),_0x552e93,_0x3dec1b[_0x91e5('0xe')]['id']);})['catch'](function(_0x31fa63){logger[_0x91e5('0x10')](_0x91e5('0x11'),_0x552e93,JSON[_0x91e5('0x12')](_0x31fa63));})[_0x91e5('0x13')](function(){_0x39a390[_0x91e5('0x14')]();});}}catch(_0x2cfe51){logger[_0x91e5('0x10')](_0x91e5('0x11'),_0x552e93,JSON[_0x91e5('0x12')](_0x2cfe51));_0x39a390[_0x91e5('0x14')]();}};};
\ No newline at end of file
index 36eef72..962ad85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c99=['error','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','body','interaction','dialogflow','result','fulfillment','speech','providerResponse','stringify','metadata','endConversation','next','lodash','apiai-promise','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','upperFirst','AccountId','account','created','isEmpty','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','catch'];(function(_0x5bea40,_0x3fecce){var _0x163d3d=function(_0x4677f3){while(--_0x4677f3){_0x5bea40['push'](_0x5bea40['shift']());}};_0x163d3d(++_0x3fecce);}(_0x6c99,0x9b));var _0x96c9=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x6c99[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0x96c9('0x0'));var moment=require('moment');var apiai=require(_0x96c9('0x1'));var md5=require('md5');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x96c9('0x2')),'mailMessage':require(_0x96c9('0x3')),'smsMessage':require(_0x96c9('0x4')),'faxMessage':require(_0x96c9('0x5')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x96c9('0x6')]=function(_0x1a30b2,_0x4323be){return function(_0x31d79e){try{if(!_[_0x96c9('0x7')](this['interaction']['UserId'])){logger[_0x96c9('0x8')]('[%s][DIALOGFLOW]\x20%s',_0x1a30b2,_0x96c9('0x9'));return _0x31d79e['next']();}var _0x2e05a5={'ContactId':this[_0x96c9('0xa')]['id'],'sentAt':moment()[_0x96c9('0xb')](_0x96c9('0xc')),'direction':'out'};if(this[_0x96c9('0xd')]===_0x96c9('0xe')||this[_0x96c9('0xd')]===_0x96c9('0xf')){_0x2e05a5[_0x96c9('0x10')]=this['interaction'][_0x96c9('0x10')];}var _0x196124=this[_0x96c9('0xd')];if(_0x196124===_0x96c9('0x11')){_0x2e05a5['ChatWebsiteId']=this['account']['id'];}else{_0x2e05a5[_[_0x96c9('0x12')](_0x196124)+_0x96c9('0x13')]=this[_0x96c9('0x14')]['id'];}_0x2e05a5[_[_0x96c9('0x12')](_0x196124)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0x96c9('0x15')]){var _0x508568=_0x4323be[0x2];if(!_[_0x96c9('0x16')](_0x508568)){_0x2e05a5['body']=utils[_0x96c9('0x17')](_0x508568,this);return rpc[_0x196124+_0x96c9('0x18')][_0x96c9('0x19')](_0x2e05a5)[_0x96c9('0x1a')](function(_0x3bdf8f){logger['info'](_0x96c9('0x1b'),_0x1a30b2,_0x2e05a5['body']);})[_0x96c9('0x1c')](function(_0x433390){logger[_0x96c9('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x1a30b2,JSON['stringify'](_0x433390));})[_0x96c9('0x1e')](function(){logger[_0x96c9('0x8')](_0x96c9('0x1f'),_0x1a30b2);_0x31d79e[_0x96c9('0x20')]();});}else{logger[_0x96c9('0x8')](_0x96c9('0x21'),_0x1a30b2);_0x31d79e['stop']();}}else{var _0x101a25=this;var _0x3a7fc5=apiai(_0x4323be[0x0],{'language':_0x4323be[0x1]||'en'});return _0x3a7fc5['textRequest'](this[_0x96c9('0x22')][_0x96c9('0x23')],{'sessionId':md5(this[_0x96c9('0x24')]['id'])})['then'](function(_0x13e642){_0x101a25[_0x96c9('0x23')][_0x96c9('0x25')]=_0x13e642;_0x2e05a5[_0x96c9('0x23')]=_0x13e642[_0x96c9('0x26')][_0x96c9('0x27')][_0x96c9('0x28')];_0x2e05a5['providerName']=_0x96c9('0x25');_0x2e05a5[_0x96c9('0x29')]=JSON[_0x96c9('0x2a')](_0x13e642);return rpc[_0x196124+_0x96c9('0x18')][_0x96c9('0x19')](_0x2e05a5)[_0x96c9('0x1a')](function(_0x306ac6){logger[_0x96c9('0x8')](_0x96c9('0x1b'),_0x1a30b2,_0x2e05a5[_0x96c9('0x23')]);if(_0x13e642[_0x96c9('0x26')][_0x96c9('0x2b')][_0x96c9('0x2c')]){_0x31d79e['next']();}else{_0x31d79e[_0x96c9('0x20')]();}})[_0x96c9('0x1c')](function(_0x4cae5a){logger[_0x96c9('0x1d')]('[%s][DIALOGFLOW]\x20%s',_0x1a30b2,JSON['stringify'](_0x4cae5a));_0x31d79e[_0x96c9('0x2d')]();});})[_0x96c9('0x1c')](function(_0x3516eb){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x1a30b2,_0x3516eb[_0x96c9('0x22')]);_0x31d79e[_0x96c9('0x2d')]();});}}catch(_0x4408bd){logger[_0x96c9('0x1d')](_0x96c9('0x1b'),_0x1a30b2,JSON[_0x96c9('0x2a')](_0x4408bd));_0x31d79e['stop']();}};};
\ No newline at end of file
+var _0x96f1=['consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','sms','channel','whatsapp','phone','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','then','info','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','dialogflow','result','fulfillment','speech','providerName','create','metadata','error','message','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage'];(function(_0x61e3f1,_0x4e16d2){var _0x59d890=function(_0x4e3052){while(--_0x4e3052){_0x61e3f1['push'](_0x61e3f1['shift']());}};_0x59d890(++_0x4e16d2);}(_0x96f1,0x19c));var _0x196f=function(_0x16e4ed,_0x1d4685){_0x16e4ed=_0x16e4ed-0x0;var _0x25fe46=_0x96f1[_0x16e4ed];return _0x25fe46;};'use strict';var _=require(_0x196f('0x0'));var moment=require(_0x196f('0x1'));var apiai=require(_0x196f('0x2'));var md5=require(_0x196f('0x3'));var utils=require(_0x196f('0x4'));var logger=require(_0x196f('0x5'))(_0x196f('0x6'));var rpc={'chatMessage':require(_0x196f('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x196f('0x8')),'faxMessage':require(_0x196f('0x9')),'whatsappMessage':require(_0x196f('0xa'))};exports[_0x196f('0xb')]=function(_0x17f603,_0x59bc2e){return function(_0x427333){try{if(!_[_0x196f('0xc')](this[_0x196f('0xd')][_0x196f('0xe')])){logger['info'](_0x196f('0xf'),_0x17f603,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x427333[_0x196f('0x10')]();}var _0x52fe33={'ContactId':this[_0x196f('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0x196f('0x12')||this[_0x196f('0x13')]===_0x196f('0x14')){_0x52fe33[_0x196f('0x15')]=this[_0x196f('0xd')][_0x196f('0x15')];}var _0x5f02a9=this[_0x196f('0x13')];if(_0x5f02a9==='chat'){_0x52fe33[_0x196f('0x16')]=this['account']['id'];}else{_0x52fe33[_[_0x196f('0x17')](_0x5f02a9)+'AccountId']=this[_0x196f('0x18')]['id'];}_0x52fe33[_[_0x196f('0x17')](_0x5f02a9)+_0x196f('0x19')]=this[_0x196f('0xd')]['id'];if(this[_0x196f('0xd')][_0x196f('0x1a')]){var _0x565db7=_0x59bc2e[0x2];if(!_[_0x196f('0x1b')](_0x565db7)){_0x52fe33[_0x196f('0x1c')]=utils[_0x196f('0x1d')](_0x565db7,this);return rpc[_0x5f02a9+_0x196f('0x1e')]['create'](_0x52fe33)[_0x196f('0x1f')](function(_0x2b2f56){logger[_0x196f('0x20')]('[%s][DIALOGFLOW]\x20%s',_0x17f603,_0x52fe33[_0x196f('0x1c')]);})[_0x196f('0x21')](function(_0x592a46){logger['error'](_0x196f('0xf'),_0x17f603,JSON[_0x196f('0x22')](_0x592a46));})[_0x196f('0x23')](function(){logger[_0x196f('0x20')](_0x196f('0x24'),_0x17f603);_0x427333[_0x196f('0x25')]();});}else{logger[_0x196f('0x20')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x17f603);_0x427333[_0x196f('0x25')]();}}else{var _0x3d6e33=this;var _0x31bf42=apiai(_0x59bc2e[0x0],{'language':_0x59bc2e[0x1]||'en'});return _0x31bf42['textRequest'](this['message'][_0x196f('0x1c')],{'sessionId':md5(this[_0x196f('0xd')]['id'])})[_0x196f('0x1f')](function(_0x18b220){_0x3d6e33['body'][_0x196f('0x26')]=_0x18b220;_0x52fe33[_0x196f('0x1c')]=_0x18b220[_0x196f('0x27')][_0x196f('0x28')][_0x196f('0x29')];_0x52fe33[_0x196f('0x2a')]='dialogflow';_0x52fe33['providerResponse']=JSON[_0x196f('0x22')](_0x18b220);return rpc[_0x5f02a9+_0x196f('0x1e')][_0x196f('0x2b')](_0x52fe33)[_0x196f('0x1f')](function(_0x53fabc){logger[_0x196f('0x20')](_0x196f('0xf'),_0x17f603,_0x52fe33[_0x196f('0x1c')]);if(_0x18b220[_0x196f('0x27')][_0x196f('0x2c')]['endConversation']){_0x427333[_0x196f('0x10')]();}else{_0x427333[_0x196f('0x25')]();}})['catch'](function(_0x179e4c){logger['error'](_0x196f('0xf'),_0x17f603,JSON['stringify'](_0x179e4c));_0x427333[_0x196f('0x10')]();});})[_0x196f('0x21')](function(_0x2b8527){logger[_0x196f('0x2d')]('[%s][DIALOGFLOW]\x20%s',_0x17f603,_0x2b8527[_0x196f('0x2e')]);_0x427333[_0x196f('0x10')]();});}}catch(_0x430b28){logger[_0x196f('0x2d')](_0x196f('0xf'),_0x17f603,JSON[_0x196f('0x22')](_0x430b28));_0x427333['stop']();}};};
\ No newline at end of file
index 03f1bf8..5b98a42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe12c=['intentDetectionConfidence','push','fulfillmentText','all','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','Message','then','body','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','info','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','account','AccountId','interaction','created','isEmpty','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE'];(function(_0x1878db,_0x18d9f6){var _0x1ae242=function(_0x5a66d7){while(--_0x5a66d7){_0x1878db['push'](_0x1878db['shift']());}};_0x1ae242(++_0x18d9f6);}(_0xe12c,0x118));var _0xce12=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0xe12c[_0x3a7634];return _0x23bbe9;};'use strict';var _=require('lodash');var dialogflow=require(_0xce12('0x0'));var md5=require(_0xce12('0x1'));var moment=require(_0xce12('0x2'));var Promise=require(_0xce12('0x3'));var logger=require(_0xce12('0x4'))(_0xce12('0x5'));var utils=require(_0xce12('0x6'));var rpc={'chatMessage':require(_0xce12('0x7')),'openchannelMessage':require(_0xce12('0x8')),'mailMessage':require(_0xce12('0x9')),'smsMessage':require(_0xce12('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xce12('0xb'))};function createMessage(_0x476dd2,_0x1967c6,_0x47bb75,_0x541789){return new Promise(function(_0x35199e,_0x3f8d87){var _0x287cd5=_[_0xce12('0xc')](_0x47bb75);_0x287cd5['body']=_0x541789;return rpc[_0x1967c6+_0xce12('0xd')]['create'](_0x287cd5)[_0xce12('0xe')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x476dd2,_0x287cd5[_0xce12('0xf')]);_0x35199e();})[_0xce12('0x10')](function(_0x5dcd89){logger[_0xce12('0x11')](_0xce12('0x12'),_0x476dd2,JSON[_0xce12('0x13')](_0x5dcd89));_0x3f8d87(_0x5dcd89);});});}exports[_0xce12('0x14')]=function(_0x6a61c7,_0x173874){return function(_0x5e6095){try{if(!_[_0xce12('0x15')](this['interaction']['UserId'])){logger[_0xce12('0x16')](_0xce12('0x12'),_0x6a61c7,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5e6095[_0xce12('0x17')]();}var _0x43c55b={'ContactId':this[_0xce12('0x18')]['id'],'sentAt':moment()['format'](_0xce12('0x19')),'direction':'out'};if(this[_0xce12('0x1a')]===_0xce12('0x1b')||this[_0xce12('0x1a')]===_0xce12('0x1c')){_0x43c55b[_0xce12('0x1d')]=this['interaction'][_0xce12('0x1d')];}var _0x3c2eee=this[_0xce12('0x1a')];if(_0x3c2eee==='chat'){_0x43c55b['ChatWebsiteId']=this[_0xce12('0x1e')]['id'];}else{_0x43c55b[_['upperFirst'](_0x3c2eee)+_0xce12('0x1f')]=this[_0xce12('0x1e')]['id'];}_0x43c55b[_['upperFirst'](_0x3c2eee)+'InteractionId']=this[_0xce12('0x20')]['id'];if(this['interaction'][_0xce12('0x21')]){var _0x7412a6=_0x173874[0x4];if(!_[_0xce12('0x22')](_0x7412a6)){_0x43c55b[_0xce12('0xf')]=utils[_0xce12('0x23')](_0x7412a6,this);return rpc[_0x3c2eee+_0xce12('0xd')][_0xce12('0x24')](_0x43c55b)[_0xce12('0xe')](function(_0x560710){logger[_0xce12('0x16')](_0xce12('0x12'),_0x6a61c7,_0x43c55b[_0xce12('0xf')]);})[_0xce12('0x10')](function(_0x4b5e3c){logger[_0xce12('0x11')](_0xce12('0x12'),_0x6a61c7,JSON['stringify'](_0x4b5e3c));})[_0xce12('0x25')](function(){logger[_0xce12('0x16')](_0xce12('0x26'),_0x6a61c7);_0x5e6095[_0xce12('0x27')]();});}else{logger[_0xce12('0x16')](_0xce12('0x28'),_0x6a61c7);_0x5e6095[_0xce12('0x27')]();}}else{var _0x54079e=this;var _0x100518=_0x173874[0x2]['replace'](/\\n/g,'\x0a');var _0x4d894c={'credentials':{'private_key':_0x100518,'client_email':_0x173874[0x1]}};var _0x788639=new dialogflow['SessionsClient'](_0x4d894c);var _0x2cf520=_0x788639[_0xce12('0x29')](_0x173874[0x0],md5(_0x54079e[_0xce12('0x20')]['id']));var _0xd5ea3={'session':_0x2cf520,'queryInput':{'text':{'text':_0x54079e[_0xce12('0x2a')][_0xce12('0xf')],'languageCode':_0x173874[0x3]||'en'}}};return _0x788639[_0xce12('0x2b')](_0xd5ea3)['then'](function(_0x2b9f7d){if(_0x2b9f7d&&_0x2b9f7d[_0xce12('0x2c')]){_0x54079e[_0xce12('0xf')][_0xce12('0x2d')]=_0x2b9f7d;var _0x121a97=_0x2b9f7d[0x0];var _0x5ed69f=_0x121a97[_0xce12('0x2e')][_0xce12('0x2f')]&&_0x121a97[_0xce12('0x2e')][_0xce12('0x2f')]['fields']?_0x121a97['queryResult'][_0xce12('0x2f')][_0xce12('0x30')][_0xce12('0x31')][_0xce12('0x32')]:![];_0x54079e[_0xce12('0xf')][_0xce12('0x33')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x34')];_0x54079e['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x121a97[_0xce12('0x2e')][_0xce12('0x35')];_0x54079e[_0xce12('0xf')][_0xce12('0x36')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x2f')]&&_0x121a97[_0xce12('0x2e')]['diagnosticInfo']['fields']?_0x121a97[_0xce12('0x2e')]['diagnosticInfo'][_0xce12('0x30')]['end_conversation'][_0xce12('0x32')]:![];_0x54079e['body'][_0xce12('0x37')]=_0x121a97['queryResult'][_0xce12('0x38')][_0xce12('0x39')];_0x54079e[_0xce12('0xf')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x121a97[_0xce12('0x2e')][_0xce12('0x38')][_0xce12('0x3a')];_0x54079e[_0xce12('0xf')][_0xce12('0x3b')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x38')]['isFallback'];_0x54079e[_0xce12('0xf')][_0xce12('0x3c')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x3d')];_0x54079e['body'][_0xce12('0x3e')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x3f')];_0x54079e[_0xce12('0xf')][_0xce12('0x40')]=_0x121a97[_0xce12('0x2e')][_0xce12('0x41')];_0x43c55b['providerName']=_0xce12('0x2d');_0x43c55b['providerResponse']=JSON[_0xce12('0x13')](_0x2b9f7d);var _0x14112d=[];for(var _0x5999a2=0x0;_0x5999a2<_0x2b9f7d['length'];_0x5999a2++){var _0x5a8840=_0x2b9f7d[_0x5999a2];if(_0x5a8840&&_0x5a8840[_0xce12('0x2e')]&&_0x5a8840[_0xce12('0x2e')]['fulfillmentText']){_0x14112d[_0xce12('0x42')](createMessage(_0x6a61c7,_0x3c2eee,_0x43c55b,_0x5a8840[_0xce12('0x2e')][_0xce12('0x43')]));}}return Promise[_0xce12('0x44')](_0x14112d)['then'](function(){if(_0x5ed69f){_0x5e6095['next']();}else{_0x5e6095[_0xce12('0x27')]();}})[_0xce12('0x10')](function(_0x5bdef2){logger[_0xce12('0x11')](_0xce12('0x12'),_0x6a61c7,JSON[_0xce12('0x13')](_0x5bdef2));_0x5e6095[_0xce12('0x17')]();});}})[_0xce12('0x10')](function(_0x3e2c10){logger[_0xce12('0x11')](_0xce12('0x12'),_0x6a61c7,_0x3e2c10[_0xce12('0x2a')]);_0x5e6095[_0xce12('0x17')]();});}}catch(_0xbd08b9){logger[_0xce12('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x6a61c7,JSON[_0xce12('0x13')](_0xbd08b9));_0x5e6095[_0xce12('0x27')]();}};};
\ No newline at end of file
+var _0x32ef=['end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','push','fulfillmentText','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','getMustacheRender','create','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields'];(function(_0x1d9114,_0x286c5f){var _0x5a1db8=function(_0xabeb42){while(--_0xabeb42){_0x1d9114['push'](_0x1d9114['shift']());}};_0x5a1db8(++_0x286c5f);}(_0x32ef,0xf9));var _0xf32e=function(_0x58b40b,_0x424124){_0x58b40b=_0x58b40b-0x0;var _0x18a141=_0x32ef[_0x58b40b];return _0x18a141;};'use strict';var _=require(_0xf32e('0x0'));var dialogflow=require(_0xf32e('0x1'));var md5=require(_0xf32e('0x2'));var moment=require(_0xf32e('0x3'));var Promise=require(_0xf32e('0x4'));var logger=require(_0xf32e('0x5'))('routing');var utils=require(_0xf32e('0x6'));var rpc={'chatMessage':require(_0xf32e('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xf32e('0x8')),'smsMessage':require(_0xf32e('0x9')),'faxMessage':require(_0xf32e('0xa')),'whatsappMessage':require(_0xf32e('0xb'))};function createMessage(_0xefc0a7,_0x899efc,_0x5aa5c8,_0xdac5e){return new Promise(function(_0x5b3463,_0x384f27){var _0x18a947=_[_0xf32e('0xc')](_0x5aa5c8);_0x18a947[_0xf32e('0xd')]=_0xdac5e;return rpc[_0x899efc+_0xf32e('0xe')]['create'](_0x18a947)[_0xf32e('0xf')](function(){logger[_0xf32e('0x10')](_0xf32e('0x11'),_0xefc0a7,_0x18a947[_0xf32e('0xd')]);_0x5b3463();})[_0xf32e('0x12')](function(_0x259f37){logger[_0xf32e('0x13')](_0xf32e('0x11'),_0xefc0a7,JSON[_0xf32e('0x14')](_0x259f37));_0x384f27(_0x259f37);});});}exports[_0xf32e('0x15')]=function(_0xf7dc32,_0x5f077f){return function(_0x3c21ad){try{if(!_[_0xf32e('0x16')](this[_0xf32e('0x17')][_0xf32e('0x18')])){logger[_0xf32e('0x10')](_0xf32e('0x11'),_0xf7dc32,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3c21ad[_0xf32e('0x19')]();}var _0x299efa={'ContactId':this[_0xf32e('0x1a')]['id'],'sentAt':moment()[_0xf32e('0x1b')](_0xf32e('0x1c')),'direction':_0xf32e('0x1d')};if(this[_0xf32e('0x1e')]===_0xf32e('0x1f')||this[_0xf32e('0x1e')]==='whatsapp'){_0x299efa[_0xf32e('0x20')]=this[_0xf32e('0x17')][_0xf32e('0x20')];}var _0x290547=this[_0xf32e('0x1e')];if(_0x290547===_0xf32e('0x21')){_0x299efa[_0xf32e('0x22')]=this[_0xf32e('0x23')]['id'];}else{_0x299efa[_[_0xf32e('0x24')](_0x290547)+_0xf32e('0x25')]=this[_0xf32e('0x23')]['id'];}_0x299efa[_[_0xf32e('0x24')](_0x290547)+_0xf32e('0x26')]=this[_0xf32e('0x17')]['id'];if(this[_0xf32e('0x17')]['created']){var _0x23552d=_0x5f077f[0x4];if(!_['isEmpty'](_0x23552d)){_0x299efa[_0xf32e('0xd')]=utils[_0xf32e('0x27')](_0x23552d,this);return rpc[_0x290547+_0xf32e('0xe')][_0xf32e('0x28')](_0x299efa)[_0xf32e('0xf')](function(_0x5409b4){logger[_0xf32e('0x10')](_0xf32e('0x11'),_0xf7dc32,_0x299efa[_0xf32e('0xd')]);})[_0xf32e('0x12')](function(_0x5e62eb){logger[_0xf32e('0x13')](_0xf32e('0x11'),_0xf7dc32,JSON[_0xf32e('0x14')](_0x5e62eb));})[_0xf32e('0x29')](function(){logger[_0xf32e('0x10')](_0xf32e('0x2a'),_0xf7dc32);_0x3c21ad[_0xf32e('0x2b')]();});}else{logger[_0xf32e('0x10')](_0xf32e('0x2c'),_0xf7dc32);_0x3c21ad[_0xf32e('0x2b')]();}}else{var _0x488489=this;var _0x3e6e6f=_0x5f077f[0x2][_0xf32e('0x2d')](/\\n/g,'\x0a');var _0x3b906c={'credentials':{'private_key':_0x3e6e6f,'client_email':_0x5f077f[0x1]}};var _0x4a873c=new dialogflow[(_0xf32e('0x2e'))](_0x3b906c);var _0x5bc6f2=_0x4a873c[_0xf32e('0x2f')](_0x5f077f[0x0],md5(_0x488489['interaction']['id']));var _0x439143={'session':_0x5bc6f2,'queryInput':{'text':{'text':_0x488489[_0xf32e('0x30')][_0xf32e('0xd')],'languageCode':_0x5f077f[0x3]||'en'}}};return _0x4a873c[_0xf32e('0x31')](_0x439143)[_0xf32e('0xf')](function(_0x4e64d4){if(_0x4e64d4&&_0x4e64d4[_0xf32e('0x32')]){_0x488489[_0xf32e('0xd')][_0xf32e('0x33')]=_0x4e64d4;var _0x498c9c=_0x4e64d4[0x0];var _0x2fa18d=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x35')]&&_0x498c9c[_0xf32e('0x34')][_0xf32e('0x35')][_0xf32e('0x36')]?_0x498c9c[_0xf32e('0x34')][_0xf32e('0x35')][_0xf32e('0x36')][_0xf32e('0x37')][_0xf32e('0x38')]:![];_0x488489[_0xf32e('0xd')][_0xf32e('0x39')]=_0x498c9c['queryResult'][_0xf32e('0x3a')];_0x488489['body'][_0xf32e('0x3b')]=_0x498c9c['queryResult']['allRequiredParamsPresent'];_0x488489[_0xf32e('0xd')][_0xf32e('0x3c')]=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x35')]&&_0x498c9c[_0xf32e('0x34')]['diagnosticInfo'][_0xf32e('0x36')]?_0x498c9c[_0xf32e('0x34')][_0xf32e('0x35')][_0xf32e('0x36')]['end_conversation'][_0xf32e('0x38')]:![];_0x488489[_0xf32e('0xd')][_0xf32e('0x3d')]=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x3e')]['name'];_0x488489[_0xf32e('0xd')][_0xf32e('0x3f')]=_0x498c9c[_0xf32e('0x34')]['intent'][_0xf32e('0x40')];_0x488489['body'][_0xf32e('0x41')]=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x3e')]['isFallback'];_0x488489[_0xf32e('0xd')][_0xf32e('0x42')]=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x43')];_0x488489[_0xf32e('0xd')][_0xf32e('0x44')]=_0x498c9c['queryResult'][_0xf32e('0x45')];_0x488489[_0xf32e('0xd')][_0xf32e('0x46')]=_0x498c9c[_0xf32e('0x34')][_0xf32e('0x47')];_0x299efa[_0xf32e('0x48')]=_0xf32e('0x33');_0x299efa['providerResponse']=JSON[_0xf32e('0x14')](_0x4e64d4);var _0x160a30=[];for(var _0x41fbb1=0x0;_0x41fbb1<_0x4e64d4[_0xf32e('0x32')];_0x41fbb1++){var _0x1576a1=_0x4e64d4[_0x41fbb1];if(_0x1576a1&&_0x1576a1[_0xf32e('0x34')]&&_0x1576a1[_0xf32e('0x34')]['fulfillmentText']){_0x160a30[_0xf32e('0x49')](createMessage(_0xf7dc32,_0x290547,_0x299efa,_0x1576a1[_0xf32e('0x34')][_0xf32e('0x4a')]));}}return Promise[_0xf32e('0x4b')](_0x160a30)[_0xf32e('0xf')](function(){if(_0x2fa18d){_0x3c21ad[_0xf32e('0x19')]();}else{_0x3c21ad[_0xf32e('0x2b')]();}})[_0xf32e('0x12')](function(_0x3d2536){logger[_0xf32e('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0xf7dc32,JSON[_0xf32e('0x14')](_0x3d2536));_0x3c21ad[_0xf32e('0x19')]();});}})[_0xf32e('0x12')](function(_0x2146e8){logger[_0xf32e('0x13')](_0xf32e('0x11'),_0xf7dc32,_0x2146e8['message']);_0x3c21ad[_0xf32e('0x19')]();});}}catch(_0x38e39f){logger[_0xf32e('0x13')](_0xf32e('0x11'),_0xf7dc32,JSON[_0xf32e('0x14')](_0x38e39f));_0x3c21ad['stop']();}};};
\ No newline at end of file
index 5a40278..cff2339 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f0=['validate','lodash','../../../../config/logger','routing','string','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','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s'];(function(_0x38eefc,_0x2b1b63){var _0xee6253=function(_0x730b91){while(--_0x730b91){_0x38eefc['push'](_0x38eefc['shift']());}};_0xee6253(++_0x2b1b63);}(_0xd4f0,0x70));var _0x0d4f=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xd4f0[_0x1ca9eb];return _0x2e284e;};'use strict';var schema=require(_0x0d4f('0x0'));var _=require(_0x0d4f('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require(_0x0d4f('0x2'))(_0x0d4f('0x3'));var gotoif=schema({'condition':{'type':_0x0d4f('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x0d4f('0x5'),'message':_0x0d4f('0x6')},'priorityFalse':{'type':'number','message':_0x0d4f('0x7')}});exports[_0x0d4f('0x8')]=function(_0x383bb5,_0x343055){return function(_0xd11f37){try{var _0x547bb1={'condition':htmlToText['fromString'](utils[_0x0d4f('0x9')](_0x343055[0x0],this),{'wordwrap':![]})[_0x0d4f('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x343055[0x1],'priorityFalse':_0x343055[0x2]};var _0x517f42=gotoif[_0x0d4f('0x0')](_0x547bb1,{'typecast':!![]});if(_0x517f42[_0x0d4f('0xb')]){logger[_0x0d4f('0xc')](_0x0d4f('0xd'),_0x383bb5,_[_0x0d4f('0xe')](_0x517f42,_0x0d4f('0xf'))[_0x0d4f('0x10')](',\x20'));_0xd11f37[_0x0d4f('0x11')]();}else{try{var _0x18c712=eval('('+_0x547bb1['condition']+')');var _0x54e288=_0x18c712?_0x547bb1[_0x0d4f('0x12')]:_0x547bb1[_0x0d4f('0x13')];logger[_0x0d4f('0x14')](_0x0d4f('0x15'),_0x383bb5,_0x547bb1[_0x0d4f('0x16')],_0x18c712,_0x54e288||_0x0d4f('0x17'));if(_0x54e288){var _0x5df2ae=_[_0x0d4f('0x18')](_0xd11f37[_0x0d4f('0x19')](),{'p':_0x54e288});if(_0x5df2ae>=0x0){logger[_0x0d4f('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x383bb5,_0x54e288||'next',_0x5df2ae);_0xd11f37[_0x0d4f('0x17')](_0x5df2ae);}else{logger[_0x0d4f('0x14')](_0x0d4f('0x1a'),_0x383bb5,_0x54e288||_0x0d4f('0x17'));_0xd11f37[_0x0d4f('0x11')]();}}else{_0xd11f37['next']();}}catch(_0xde93d2){logger[_0x0d4f('0xc')](_0x0d4f('0x1b'),_0x383bb5,_0xde93d2[_0x0d4f('0xf')]);_0xd11f37[_0x0d4f('0x11')]();}}}catch(_0x5cffab){logger[_0x0d4f('0xc')](_0x0d4f('0xd'),_0x383bb5,JSON['stringify'](_0x5cffab));_0xd11f37[_0x0d4f('0x11')]();}};};
\ No newline at end of file
+var _0xdfaf=['length','error','[%s][GOTOIF]\x20%s','map','message','join','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','validate','lodash','html-to-text','./utils','../../../../config/logger','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace'];(function(_0x2ed311,_0x47a90f){var _0x520e64=function(_0x48eaad){while(--_0x48eaad){_0x2ed311['push'](_0x2ed311['shift']());}};_0x520e64(++_0x47a90f);}(_0xdfaf,0xcc));var _0xfdfa=function(_0x3e5e44,_0x52116a){_0x3e5e44=_0x3e5e44-0x0;var _0x581635=_0xdfaf[_0x3e5e44];return _0x581635;};'use strict';var schema=require(_0xfdfa('0x0'));var _=require(_0xfdfa('0x1'));var htmlToText=require(_0xfdfa('0x2'));var utils=require(_0xfdfa('0x3'));var logger=require(_0xfdfa('0x4'))('routing');var gotoif=schema({'condition':{'type':_0xfdfa('0x5'),'required':!![],'message':_0xfdfa('0x6')},'priorityTrue':{'type':_0xfdfa('0x7'),'message':_0xfdfa('0x8')},'priorityFalse':{'type':_0xfdfa('0x7'),'message':_0xfdfa('0x9')}});exports[_0xfdfa('0xa')]=function(_0x5f1a9c,_0x36ca78){return function(_0x4db674){try{var _0x111f0c={'condition':htmlToText['fromString'](utils[_0xfdfa('0xb')](_0x36ca78[0x0],this),{'wordwrap':![]})[_0xfdfa('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x36ca78[0x1],'priorityFalse':_0x36ca78[0x2]};var _0xcd9d8d=gotoif[_0xfdfa('0x0')](_0x111f0c,{'typecast':!![]});if(_0xcd9d8d[_0xfdfa('0xd')]){logger[_0xfdfa('0xe')](_0xfdfa('0xf'),_0x5f1a9c,_[_0xfdfa('0x10')](_0xcd9d8d,_0xfdfa('0x11'))[_0xfdfa('0x12')](',\x20'));_0x4db674['stop']();}else{try{var _0xf834d1=eval('('+_0x111f0c[_0xfdfa('0x13')]+')');var _0x3ec1c7=_0xf834d1?_0x111f0c[_0xfdfa('0x14')]:_0x111f0c[_0xfdfa('0x15')];logger[_0xfdfa('0x16')](_0xfdfa('0x17'),_0x5f1a9c,_0x111f0c[_0xfdfa('0x13')],_0xf834d1,_0x3ec1c7||_0xfdfa('0x18'));if(_0x3ec1c7){var _0x307b04=_[_0xfdfa('0x19')](_0x4db674[_0xfdfa('0x1a')](),{'p':_0x3ec1c7});if(_0x307b04>=0x0){logger[_0xfdfa('0x16')](_0xfdfa('0x1b'),_0x5f1a9c,_0x3ec1c7||_0xfdfa('0x18'),_0x307b04);_0x4db674[_0xfdfa('0x18')](_0x307b04);}else{logger[_0xfdfa('0x16')](_0xfdfa('0x1c'),_0x5f1a9c,_0x3ec1c7||_0xfdfa('0x18'));_0x4db674[_0xfdfa('0x1d')]();}}else{_0x4db674[_0xfdfa('0x18')]();}}catch(_0x5ad034){logger[_0xfdfa('0xe')](_0xfdfa('0x1e'),_0x5f1a9c,_0x5ad034[_0xfdfa('0x11')]);_0x4db674[_0xfdfa('0x1d')]();}}}catch(_0x162478){logger[_0xfdfa('0xe')](_0xfdfa('0xf'),_0x5f1a9c,JSON['stringify'](_0x162478));_0x4db674['stop']();}};};
\ No newline at end of file
index e4ac19a..fda6426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f93=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','map','message','stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing'];(function(_0x36fe35,_0x5bbca2){var _0x5e7fa0=function(_0x44a30e){while(--_0x44a30e){_0x36fe35['push'](_0x36fe35['shift']());}};_0x5e7fa0(++_0x5bbca2);}(_0x5f93,0x106));var _0x35f9=function(_0x5054e6,_0x3d2888){_0x5054e6=_0x5054e6-0x0;var _0x7bc286=_0x5f93[_0x5054e6];return _0x7bc286;};'use strict';var schema=require(_0x35f9('0x0'));var _=require(_0x35f9('0x1'));var logger=require(_0x35f9('0x2'))(_0x35f9('0x3'));var gotop=schema({'priority':{'type':_0x35f9('0x4'),'required':!![],'message':_0x35f9('0x5')}});exports['consequence']=function(_0x1a91a6,_0x1c5d47){return function(_0x3f01c3){try{var _0x44f4ac={'priority':_0x1c5d47[0x0]};var _0x4f36e7=gotop[_0x35f9('0x0')](_0x44f4ac,{'typecast':!![]});if(_0x4f36e7[_0x35f9('0x6')]){logger[_0x35f9('0x7')]('[%s][GOTOP]\x20%s',_0x1a91a6,_[_0x35f9('0x8')](_0x4f36e7,_0x35f9('0x9'))['join'](',\x20'));_0x3f01c3[_0x35f9('0xa')]();}else{logger['info'](_0x35f9('0xb'),_0x1a91a6,_0x44f4ac[_0x35f9('0xc')]);if(_0x44f4ac[_0x35f9('0xc')]){var _0x5d0a7b=_[_0x35f9('0xd')](_0x3f01c3[_0x35f9('0xe')](),{'p':_0x44f4ac[_0x35f9('0xc')]});if(_0x5d0a7b>=0x0){logger[_0x35f9('0xf')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1a91a6,_0x44f4ac[_0x35f9('0xc')]||_0x35f9('0x10'),_0x5d0a7b);_0x3f01c3[_0x35f9('0x10')](_0x5d0a7b);}else{logger[_0x35f9('0xf')](_0x35f9('0x11'),_0x1a91a6,_0x44f4ac['priority']||'next');_0x3f01c3['stop']();}}else{_0x3f01c3[_0x35f9('0x10')]();}}}catch(_0x2ca82b){logger[_0x35f9('0x7')]('[%s][GOTOP]\x20%s',_0x1a91a6,JSON[_0x35f9('0x12')](_0x2ca82b));_0x3f01c3[_0x35f9('0xa')]();}};};
\ No newline at end of file
+var _0x2595=['consequence','length','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number'];(function(_0x4702cb,_0x23e1e1){var _0x16eb76=function(_0x5ec667){while(--_0x5ec667){_0x4702cb['push'](_0x4702cb['shift']());}};_0x16eb76(++_0x23e1e1);}(_0x2595,0x19e));var _0x5259=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x2595[_0x10b317];return _0x1e3054;};'use strict';var schema=require(_0x5259('0x0'));var _=require('lodash');var logger=require(_0x5259('0x1'))(_0x5259('0x2'));var gotop=schema({'priority':{'type':_0x5259('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x5259('0x4')]=function(_0x9e91cb,_0x228884){return function(_0x1fcb3b){try{var _0x51dadb={'priority':_0x228884[0x0]};var _0x454fce=gotop[_0x5259('0x0')](_0x51dadb,{'typecast':!![]});if(_0x454fce[_0x5259('0x5')]){logger[_0x5259('0x6')]('[%s][GOTOP]\x20%s',_0x9e91cb,_[_0x5259('0x7')](_0x454fce,'message')[_0x5259('0x8')](',\x20'));_0x1fcb3b[_0x5259('0x9')]();}else{logger[_0x5259('0xa')](_0x5259('0xb'),_0x9e91cb,_0x51dadb[_0x5259('0xc')]);if(_0x51dadb[_0x5259('0xc')]){var _0x35b236=_[_0x5259('0xd')](_0x1fcb3b[_0x5259('0xe')](),{'p':_0x51dadb[_0x5259('0xc')]});if(_0x35b236>=0x0){logger[_0x5259('0xa')](_0x5259('0xf'),_0x9e91cb,_0x51dadb[_0x5259('0xc')]||'next',_0x35b236);_0x1fcb3b[_0x5259('0x10')](_0x35b236);}else{logger[_0x5259('0xa')](_0x5259('0x11'),_0x9e91cb,_0x51dadb[_0x5259('0xc')]||_0x5259('0x10'));_0x1fcb3b['stop']();}}else{_0x1fcb3b['next']();}}}catch(_0x15aba8){logger['error']('[%s][GOTOP]\x20%s',_0x9e91cb,JSON[_0x5259('0x12')](_0x15aba8));_0x1fcb3b[_0x5259('0x9')]();}};};
\ No newline at end of file
index c9b3b64..9f25892 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd38f=['upperFirst','AccountId','InteractionId','interaction','Message','then','info','[%s][MESSAGE]\x20%s','body','next','catch','stop','stringify','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','account'];(function(_0x48383e,_0x107920){var _0x3611b2=function(_0x4df43a){while(--_0x4df43a){_0x48383e['push'](_0x48383e['shift']());}};_0x3611b2(++_0x107920);}(_0xd38f,0xa3));var _0xfd38=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xd38f[_0x1cd674];return _0x27928f;};'use strict';var _=require(_0xfd38('0x0'));var utils=require(_0xfd38('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xfd38('0x2')),'mailMessage':require(_0xfd38('0x3')),'smsMessage':require(_0xfd38('0x4')),'faxMessage':require(_0xfd38('0x5')),'whatsappMessage':require(_0xfd38('0x6'))};exports[_0xfd38('0x7')]=function(_0x168599,_0x121417){return function(_0x56d5a9){try{var _0x318785={'body':utils[_0xfd38('0x8')](_0x121417[0x0],this),'ContactId':this[_0xfd38('0x9')]['id']};if(this[_0xfd38('0xa')]==='chat'){_0x318785['ChatWebsiteId']=this[_0xfd38('0xb')]['id'];}else{_0x318785[_[_0xfd38('0xc')](this['channel'])+_0xfd38('0xd')]=this[_0xfd38('0xb')]['id'];}_0x318785[_[_0xfd38('0xc')](this[_0xfd38('0xa')])+_0xfd38('0xe')]=this[_0xfd38('0xf')]['id'];if(rpc[this[_0xfd38('0xa')]+_0xfd38('0x10')]){return rpc[this[_0xfd38('0xa')]+_0xfd38('0x10')]['create'](_0x318785)[_0xfd38('0x11')](function(_0x5934f3){logger[_0xfd38('0x12')](_0xfd38('0x13'),_0x168599,_0x318785[_0xfd38('0x14')]);_0x56d5a9[_0xfd38('0x15')]();})[_0xfd38('0x16')](function(_0x535593){logger['error'](_0xfd38('0x13'),_0x168599,JSON['stringify'](_0x535593));_0x56d5a9[_0xfd38('0x17')]();});}}catch(_0x344fc5){logger['error'](_0xfd38('0x13'),_0x168599,JSON[_0xfd38('0x18')](_0x344fc5));_0x56d5a9[_0xfd38('0x17')]();}};};
\ No newline at end of file
+var _0xc88f=['Message','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify','lodash','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','interaction'];(function(_0x2f8519,_0x416099){var _0x2b0873=function(_0x43c4b6){while(--_0x43c4b6){_0x2f8519['push'](_0x2f8519['shift']());}};_0x2b0873(++_0x416099);}(_0xc88f,0xf3));var _0xfc88=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc88f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfc88('0x0'));var utils=require(_0xfc88('0x1'));var logger=require('../../../../config/logger')(_0xfc88('0x2'));var rpc={'chatMessage':require(_0xfc88('0x3')),'openchannelMessage':require(_0xfc88('0x4')),'mailMessage':require(_0xfc88('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfc88('0x6')),'whatsappMessage':require(_0xfc88('0x7'))};exports[_0xfc88('0x8')]=function(_0x36ba78,_0x1c938b){return function(_0x4698df){try{var _0x5cf0f9={'body':utils[_0xfc88('0x9')](_0x1c938b[0x0],this),'ContactId':this[_0xfc88('0xa')]['id']};if(this[_0xfc88('0xb')]===_0xfc88('0xc')){_0x5cf0f9[_0xfc88('0xd')]=this[_0xfc88('0xe')]['id'];}else{_0x5cf0f9[_[_0xfc88('0xf')](this[_0xfc88('0xb')])+'AccountId']=this[_0xfc88('0xe')]['id'];}_0x5cf0f9[_['upperFirst'](this[_0xfc88('0xb')])+'InteractionId']=this[_0xfc88('0x10')]['id'];if(rpc[this[_0xfc88('0xb')]+_0xfc88('0x11')]){return rpc[this[_0xfc88('0xb')]+_0xfc88('0x11')]['create'](_0x5cf0f9)[_0xfc88('0x12')](function(_0x30e672){logger[_0xfc88('0x13')](_0xfc88('0x14'),_0x36ba78,_0x5cf0f9[_0xfc88('0x15')]);_0x4698df['next']();})[_0xfc88('0x16')](function(_0x36ccae){logger[_0xfc88('0x17')](_0xfc88('0x14'),_0x36ba78,JSON['stringify'](_0x36ccae));_0x4698df[_0xfc88('0x18')]();});}}catch(_0xd8528d){logger[_0xfc88('0x17')](_0xfc88('0x14'),_0x36ba78,JSON[_0xfc88('0x19')](_0xd8528d));_0x4698df[_0xfc88('0x18')]();}};};
\ No newline at end of file
index 5846678..220474f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4061=['stringify','stop','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x34c82a,_0x11ee32){var _0x4ecc96=function(_0x3605a3){while(--_0x3605a3){_0x34c82a['push'](_0x34c82a['shift']());}};_0x4ecc96(++_0x11ee32);}(_0x4061,0x1c2));var _0x1406=function(_0x20706c,_0xcf9921){_0x20706c=_0x20706c-0x0;var _0x3b1f9f=_0x4061[_0x20706c];return _0x3b1f9f;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')('routing');exports[_0x1406('0x0')]=function(_0x4d396f,_0x5b1844){return function(_0x2fd05c){try{logger[_0x1406('0x1')](_0x1406('0x2'),_0x4d396f,utils[_0x1406('0x3')](_0x5b1844[0x0],this));_0x2fd05c[_0x1406('0x4')]();}catch(_0x3fe3c9){logger[_0x1406('0x5')](_0x1406('0x2'),_0x4d396f,JSON[_0x1406('0x6')](_0x3fe3c9));_0x2fd05c[_0x1406('0x7')]();}};};
\ No newline at end of file
+var _0xd88d=['stringify','stop','./utils','routing','consequence','info','getMustacheRender','next','[%s][NOOP]\x20%s'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd88d,0xb6));var _0xdd88=function(_0x115bac,_0x155872){_0x115bac=_0x115bac-0x0;var _0x51b763=_0xd88d[_0x115bac];return _0x51b763;};'use strict';var utils=require(_0xdd88('0x0'));var logger=require('../../../../config/logger')(_0xdd88('0x1'));exports[_0xdd88('0x2')]=function(_0x5efb39,_0x2e79c4){return function(_0x2d0398){try{logger[_0xdd88('0x3')]('[%s][NOOP]\x20%s',_0x5efb39,utils[_0xdd88('0x4')](_0x2e79c4[0x0],this));_0x2d0398[_0xdd88('0x5')]();}catch(_0x48a97f){logger['error'](_0xdd88('0x6'),_0x5efb39,JSON[_0xdd88('0x7')](_0x48a97f));_0x2d0398[_0xdd88('0x8')]();}};};
\ No newline at end of file
index ca575b7..bb2613f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2ee=['AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','body','update','update\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat'];(function(_0x1609fc,_0x35fd25){var _0x394ff2=function(_0x2fa291){while(--_0x2fa291){_0x1609fc['push'](_0x1609fc['shift']());}};_0x394ff2(++_0x35fd25);}(_0xd2ee,0x161));var _0xed2e=function(_0x638263,_0x2aa838){_0x638263=_0x638263-0x0;var _0x19fb3e=_0xd2ee[_0x638263];return _0x19fb3e;};'use strict';var schema=require('validate');var _=require(_0xed2e('0x0'));var util=require('util');var seqqueue=require(_0xed2e('0x1'));var moment=require('moment');var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xed2e('0x2'))(_0xed2e('0x3'));var strategy=require(_0xed2e('0x4'));config[_0xed2e('0x5')]=_['defaults'](config[_0xed2e('0x5')],{'host':_0xed2e('0x6'),'port':0x18eb});var io=require(_0xed2e('0x7'))(new Redis(config['redis']));var attributes=['id',_0xed2e('0x8'),_0xed2e('0x9'),_0xed2e('0xa'),_0xed2e('0xb'),_0xed2e('0xc')];function emit(_0x1b71f6,_0x45b607,_0x5caee4){io['to'](_0x1b71f6)[_0xed2e('0xd')](_0x45b607,_0x5caee4);}function emitChannelQueueInteraction(_0x28ea89,_0x5160c0,_0x53424f,_0x2f19d7,_0x1d0d71,_0x50294a,_0x1fce4d,_0x4dedb8){var _0xaaad6e=_[_0xed2e('0xe')](_0x53424f);_0xaaad6e[_0xed2e('0x8')]=_0x4dedb8;_0xaaad6e[_0xed2e('0xa')]=_0x5160c0;_0xaaad6e[_0xed2e('0x9')]=_0x2f19d7;_0xaaad6e['id']=_0x1d0d71;if(_0x50294a){_0x1fce4d[util[_0xed2e('0xf')](_0xed2e('0x10'),_0x28ea89)][_0x1d0d71]=_[_0xed2e('0x11')](_0xaaad6e,attributes);}else{delete _0x1fce4d[util['format'](_0xed2e('0x10'),_0x28ea89)][_0x1d0d71];}emit(util['format']('%s:queue:%s',_0x28ea89,_0x5160c0),util[_0xed2e('0xf')]('%s_queue_waiting_interaction:%s',_0x28ea89,_0x50294a?'save':_0xed2e('0x12')),_[_0xed2e('0x11')](_0xaaad6e,attributes));}var rpc={'openchannelQueueReport':require(_0xed2e('0x13')),'mailQueueReport':require(_0xed2e('0x14')),'chatQueueReport':require(_0xed2e('0x15')),'smsQueueReport':require(_0xed2e('0x16')),'faxQueueReport':require(_0xed2e('0x17')),'whatsappQueueReport':require(_0xed2e('0x18'))};var queue=schema({'name':{'type':_0xed2e('0x19'),'required':!![],'message':_0xed2e('0x1a')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x288a02,_0x221437,_0x467df2,_0x2a79c8){if(_0x288a02&&_0x221437&&_0x467df2){_0x221437[_0xed2e('0x1b')]+=0x1;var _0x3756df={'uniqueid':_0x288a02,'from':_0x467df2['body']?_0x467df2['body']['from']:'','joinAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x467df2[_0xed2e('0x1c')]?_0x467df2[_0xed2e('0x1c')]['id']:null,'ListId':_0x467df2[_0xed2e('0x1d')]?_0x467df2[_0xed2e('0x1d')]['id']:null};_0x3756df[_[_0xed2e('0x1e')](_0x467df2[_0xed2e('0x1f')])+_0xed2e('0x20')]=_0x221437['id']||null;_0x3756df[_['upperFirst'](_0x467df2[_0xed2e('0x1f')])+_0xed2e('0x21')]=_0x467df2[_0xed2e('0x22')]?_0x467df2[_0xed2e('0x22')]['id']:null;_0x3756df[_['upperFirst'](_0x467df2[_0xed2e('0x1f')])+'MessageId']=_0x467df2[_0xed2e('0x23')]?_0x467df2[_0xed2e('0x23')]['id']:null;_0x3756df[_['upperFirst'](_0x467df2[_0xed2e('0x1f')])+(_0x467df2[_0xed2e('0x1f')]!==_0xed2e('0x24')?_0xed2e('0x25'):_0xed2e('0x26'))]=_0x467df2[_0xed2e('0x9')]?_0x467df2[_0xed2e('0x9')]['id']:null;logger[_0xed2e('0x27')](util[_0xed2e('0xf')](_0xed2e('0x28'),_0x288a02,_0x221437[_0xed2e('0x29')]));emitChannelQueueInteraction(_0x467df2['channel'],_0x221437[_0xed2e('0x29')],_0x3756df,_0x467df2[_0xed2e('0x9')]['name'],_0x467df2['message']['id'],!![],_0x2a79c8,_0x221437['id']);if(rpc[_0x467df2[_0xed2e('0x1f')]+_0xed2e('0x2a')]){return rpc[_0x467df2[_0xed2e('0x1f')]+_0xed2e('0x2a')][_0xed2e('0x2b')](_0x3756df)[_0xed2e('0x2c')](function(_0x91cfc1){logger[_0xed2e('0x2d')](_0xed2e('0x2e'));});}}}function stopRouting(_0x42246d,_0x2025da,_0x28bc3d,_0x3906d8){if(_0x42246d&&_0x2025da){_0x2025da[_0xed2e('0x1b')]-=0x1;var _0x52f90d={'leaveAt':moment()[_0xed2e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xed2e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xed2e('0x2f')};logger[_0xed2e('0x27')](util[_0xed2e('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0x42246d,_0x2025da[_0xed2e('0x29')]));emitChannelQueueInteraction(_0x28bc3d['channel'],_0x2025da['name'],_0x28bc3d[_0xed2e('0x30')],_0x28bc3d['account']['name'],_0x28bc3d[_0xed2e('0x23')]['id'],![],_0x3906d8,_0x2025da['id']);if(rpc[_0x28bc3d[_0xed2e('0x1f')]+_0xed2e('0x2a')]){return rpc[_0x28bc3d['channel']+'QueueReport'][_0xed2e('0x31')](_0x42246d,_0x52f90d)[_0xed2e('0x2c')](function(_0xb2983e){logger['error'](_0xed2e('0x32'));});}}}function endRouting(_0x4dce94,_0x321f53,_0x1d1583,_0x232640){if(_0x4dce94&&_0x321f53){_0x321f53['waiting']-=0x1;var _0x2ba43f={'leaveAt':moment()[_0xed2e('0xf')](_0xed2e('0x33')),'exitAt':moment()['format'](_0xed2e('0x33')),'reason':_0xed2e('0x34')};logger['info'](util[_0xed2e('0xf')](_0xed2e('0x35'),_0x4dce94,_0x321f53['name']));emitChannelQueueInteraction(_0x1d1583[_0xed2e('0x1f')],_0x321f53[_0xed2e('0x29')],_0x1d1583[_0xed2e('0x30')],_0x1d1583[_0xed2e('0x9')][_0xed2e('0x29')],_0x1d1583[_0xed2e('0x23')]['id'],![],_0x232640);if(rpc[_0x1d1583[_0xed2e('0x1f')]+'QueueReport']){return rpc[_0x1d1583[_0xed2e('0x1f')]+_0xed2e('0x2a')][_0xed2e('0x31')](_0x4dce94,_0x2ba43f)[_0xed2e('0x2c')](function(_0x3d13ed){logger[_0xed2e('0x2d')](_0xed2e('0x32'));});}}}function handleFindQueue(_0x4268f3){return function(_0x2e4934){return _0x2e4934[_0xed2e('0x29')]['toLowerCase']()===_0x4268f3[_0xed2e('0x36')]();};}exports[_0xed2e('0x37')]=function(_0x213564,_0x9abf55,_0x540aa2,_0x2e2c0b){return function(_0x4c7e93){try{var _0x48c21d={'name':_0x9abf55[0x0],'timeout':_0x9abf55[0x1]};var _0x3b7e4f=queue[_0xed2e('0x38')](_0x48c21d,{'typecast':!![]});if(_0x3b7e4f[_0xed2e('0x39')]){logger[_0xed2e('0x2d')](_0xed2e('0x3a'),_0x213564,_[_0xed2e('0x3b')](_0x3b7e4f,_0xed2e('0x23'))[_0xed2e('0x3c')](',\x20'));_0x4c7e93['stop']();}else{var _0x90b93a=_[_0xed2e('0x3d')](_0x540aa2[_0x2e2c0b[_0xed2e('0x1f')]+_0xed2e('0x3e')],handleFindQueue(_0x48c21d[_0xed2e('0x29')]));if(_0x90b93a){startRouting(_0x213564,_0x90b93a,_0x2e2c0b,_0x540aa2);var _0x1b5fd6=(_0x90b93a[_0xed2e('0x34')]||0xa)*0x3e8;var _0xc96c80=(_0x48c21d[_0xed2e('0x34')]||0x14)*0x3e8;var _0x2308c5,_0x580426;if(_0x1b5fd6>_0xc96c80){_0xc96c80=_0x1b5fd6;}var _0x3d6fba=seqqueue[_0xed2e('0x3f')](_0x1b5fd6);_0x3d6fba['id']=_0x213564;_0x3d6fba[_0xed2e('0x40')]=_0x1b5fd6;_0x3d6fba[_0xed2e('0x41')]=_0xc96c80;_0x3d6fba['channel']=_0x2e2c0b['channel'];_0x540aa2[_0xed2e('0x42')][_0x213564]['on'](_0xed2e('0x43'),function(){logger[_0xed2e('0x27')](_0xed2e('0x44'),_0x213564);stopRouting(_0x213564,_0x90b93a,_0x2e2c0b,_0x540aa2);clearTimeout(_0x2308c5);_0x2308c5=undefined;_0x3d6fba[_0xed2e('0x45')](!![]);if(_0x540aa2[_0xed2e('0x42')][_0x213564]){delete _0x540aa2[_0xed2e('0x42')][_0x213564];}_0x4c7e93[_0xed2e('0x46')]();});_0x540aa2[_0xed2e('0x42')][_0x213564]['on']('complete',function(){if(_0x540aa2[_0xed2e('0x42')][_0x213564]){delete _0x540aa2['rules'][_0x213564];}});_0x2308c5=setTimeout(function(){logger[_0xed2e('0x27')](_0xed2e('0x47'),_0x213564);endRouting(_0x213564,_0x90b93a,_0x2e2c0b,_0x540aa2);clearTimeout(_0x2308c5);_0x3d6fba[_0xed2e('0x45')](!![]);_0x4c7e93[_0xed2e('0x48')]();},_0xc96c80);switch(_0x90b93a[_0xed2e('0x49')]){case _0xed2e('0x4a'):strategy[_0xed2e('0x4a')](_0x3d6fba,_0x90b93a,_0x540aa2,_0x2e2c0b);break;default:strategy[_0xed2e('0x4b')](_0x3d6fba,_0x90b93a,_0x540aa2,_0x2e2c0b);}}else{logger[_0xed2e('0x2d')](_0xed2e('0x4c'),_0x213564,_0x48c21d['name']);_0x4c7e93[_0xed2e('0x46')]();}}}catch(_0x16ba74){console['log'](_0x16ba74);logger[_0xed2e('0x2d')]('[%s][QUEUE]\x20%s',_0x213564,_0x16ba74[_0xed2e('0x4d')]);_0x4c7e93[_0xed2e('0x46')]();}};};
\ No newline at end of file
+var _0xcadc=['accepted','[%s][STOP:QUEUE][NAME:%s]','update','timeout','[%s][END:QUEUE][NAME:%s]','update\x20queue\x20report','toLowerCase','consequence','length','stop','Queues','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','queue_id','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','contact','list','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','account','info','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x40ec4e,_0x5d8b1b){var _0x333401=function(_0x348098){while(--_0x348098){_0x40ec4e['push'](_0x40ec4e['shift']());}};_0x333401(++_0x5d8b1b);}(_0xcadc,0x1a6));var _0xccad=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcadc[_0x20a584];return _0x4b41a8;};'use strict';var schema=require('validate');var _=require(_0xccad('0x0'));var util=require(_0xccad('0x1'));var seqqueue=require(_0xccad('0x2'));var moment=require(_0xccad('0x3'));var Redis=require('ioredis');var config=require(_0xccad('0x4'));var logger=require(_0xccad('0x5'))(_0xccad('0x6'));var strategy=require(_0xccad('0x7'));config[_0xccad('0x8')]=_[_0xccad('0x9')](config[_0xccad('0x8')],{'host':_0xccad('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xccad('0x8')]));var attributes=['id',_0xccad('0xb'),'account',_0xccad('0xc'),_0xccad('0xd'),_0xccad('0xe')];function emit(_0x39897b,_0x5c7f32,_0x588f5e){io['to'](_0x39897b)[_0xccad('0xf')](_0x5c7f32,_0x588f5e);}function emitChannelQueueInteraction(_0x534bc5,_0x5cf11b,_0x3523fd,_0x187c2e,_0x2ee231,_0xc10daa,_0xbe880c,_0x56cd3b){var _0x182609=_[_0xccad('0x10')](_0x3523fd);_0x182609[_0xccad('0xb')]=_0x56cd3b;_0x182609[_0xccad('0xc')]=_0x5cf11b;_0x182609['account']=_0x187c2e;_0x182609['id']=_0x2ee231;if(_0xc10daa){_0xbe880c[util['format'](_0xccad('0x11'),_0x534bc5)][_0x2ee231]=_[_0xccad('0x12')](_0x182609,attributes);}else{delete _0xbe880c[util[_0xccad('0x13')](_0xccad('0x11'),_0x534bc5)][_0x2ee231];}emit(util[_0xccad('0x13')]('%s:queue:%s',_0x534bc5,_0x5cf11b),util[_0xccad('0x13')](_0xccad('0x14'),_0x534bc5,_0xc10daa?_0xccad('0x15'):'remove'),_[_0xccad('0x12')](_0x182609,attributes));}var rpc={'openchannelQueueReport':require(_0xccad('0x16')),'mailQueueReport':require(_0xccad('0x17')),'chatQueueReport':require(_0xccad('0x18')),'smsQueueReport':require(_0xccad('0x19')),'faxQueueReport':require(_0xccad('0x1a')),'whatsappQueueReport':require(_0xccad('0x1b'))};var queue=schema({'name':{'type':_0xccad('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xccad('0x1d')}});function startRouting(_0x3ac846,_0x3ceee4,_0x49df0b,_0x453a5e){if(_0x3ac846&&_0x3ceee4&&_0x49df0b){_0x3ceee4[_0xccad('0x1e')]+=0x1;var _0x28b5b9={'uniqueid':_0x3ac846,'from':_0x49df0b[_0xccad('0x1f')]?_0x49df0b[_0xccad('0x1f')]['from']:'','joinAt':moment()[_0xccad('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x49df0b[_0xccad('0x20')]?_0x49df0b['contact']['id']:null,'ListId':_0x49df0b[_0xccad('0x21')]?_0x49df0b[_0xccad('0x21')]['id']:null};_0x28b5b9[_['upperFirst'](_0x49df0b[_0xccad('0x22')])+_0xccad('0x23')]=_0x3ceee4['id']||null;_0x28b5b9[_[_0xccad('0x24')](_0x49df0b[_0xccad('0x22')])+_0xccad('0x25')]=_0x49df0b[_0xccad('0x26')]?_0x49df0b[_0xccad('0x26')]['id']:null;_0x28b5b9[_['upperFirst'](_0x49df0b[_0xccad('0x22')])+_0xccad('0x27')]=_0x49df0b['message']?_0x49df0b[_0xccad('0x28')]['id']:null;_0x28b5b9[_['upperFirst'](_0x49df0b['channel'])+(_0x49df0b[_0xccad('0x22')]!==_0xccad('0x29')?_0xccad('0x2a'):_0xccad('0x2b'))]=_0x49df0b['account']?_0x49df0b[_0xccad('0x2c')]['id']:null;logger[_0xccad('0x2d')](util[_0xccad('0x13')]('[%s][START:QUEUE][NAME:%s]',_0x3ac846,_0x3ceee4[_0xccad('0x2e')]));emitChannelQueueInteraction(_0x49df0b['channel'],_0x3ceee4[_0xccad('0x2e')],_0x28b5b9,_0x49df0b[_0xccad('0x2c')][_0xccad('0x2e')],_0x49df0b[_0xccad('0x28')]['id'],!![],_0x453a5e,_0x3ceee4['id']);if(rpc[_0x49df0b['channel']+_0xccad('0x2f')]){return rpc[_0x49df0b[_0xccad('0x22')]+'QueueReport']['create'](_0x28b5b9)[_0xccad('0x30')](function(_0xaaf565){logger[_0xccad('0x31')](_0xccad('0x32'));});}}}function stopRouting(_0x3a3ea7,_0x394d82,_0x34c03f,_0x485b82){if(_0x3a3ea7&&_0x394d82){_0x394d82[_0xccad('0x1e')]-=0x1;var _0x5be5b4={'leaveAt':moment()[_0xccad('0x13')](_0xccad('0x33')),'acceptAt':moment()['format'](_0xccad('0x33')),'reason':_0xccad('0x34')};logger[_0xccad('0x2d')](util[_0xccad('0x13')](_0xccad('0x35'),_0x3a3ea7,_0x394d82[_0xccad('0x2e')]));emitChannelQueueInteraction(_0x34c03f[_0xccad('0x22')],_0x394d82[_0xccad('0x2e')],_0x34c03f[_0xccad('0x1f')],_0x34c03f[_0xccad('0x2c')]['name'],_0x34c03f['message']['id'],![],_0x485b82,_0x394d82['id']);if(rpc[_0x34c03f['channel']+_0xccad('0x2f')]){return rpc[_0x34c03f[_0xccad('0x22')]+_0xccad('0x2f')][_0xccad('0x36')](_0x3a3ea7,_0x5be5b4)[_0xccad('0x30')](function(_0x1b09de){logger[_0xccad('0x31')]('update\x20queue\x20report');});}}}function endRouting(_0x4920fd,_0x72c9d4,_0x272cd2,_0x54bfb7){if(_0x4920fd&&_0x72c9d4){_0x72c9d4[_0xccad('0x1e')]-=0x1;var _0x567cf8={'leaveAt':moment()[_0xccad('0x13')](_0xccad('0x33')),'exitAt':moment()['format'](_0xccad('0x33')),'reason':_0xccad('0x37')};logger[_0xccad('0x2d')](util[_0xccad('0x13')](_0xccad('0x38'),_0x4920fd,_0x72c9d4[_0xccad('0x2e')]));emitChannelQueueInteraction(_0x272cd2[_0xccad('0x22')],_0x72c9d4[_0xccad('0x2e')],_0x272cd2['body'],_0x272cd2['account'][_0xccad('0x2e')],_0x272cd2['message']['id'],![],_0x54bfb7);if(rpc[_0x272cd2['channel']+_0xccad('0x2f')]){return rpc[_0x272cd2[_0xccad('0x22')]+_0xccad('0x2f')][_0xccad('0x36')](_0x4920fd,_0x567cf8)[_0xccad('0x30')](function(_0x1d683f){logger['error'](_0xccad('0x39'));});}}}function handleFindQueue(_0x4b5141){return function(_0x41b4d4){return _0x41b4d4['name'][_0xccad('0x3a')]()===_0x4b5141['toLowerCase']();};}exports[_0xccad('0x3b')]=function(_0x233f99,_0x49d241,_0x5c3fa7,_0x5f09c3){return function(_0x59dbf4){try{var _0x485039={'name':_0x49d241[0x0],'timeout':_0x49d241[0x1]};var _0x8d3bc8=queue['validate'](_0x485039,{'typecast':!![]});if(_0x8d3bc8[_0xccad('0x3c')]){logger[_0xccad('0x31')]('[%s][QUEUE]\x20%s',_0x233f99,_['map'](_0x8d3bc8,_0xccad('0x28'))['join'](',\x20'));_0x59dbf4[_0xccad('0x3d')]();}else{var _0x3d52b7=_['find'](_0x5c3fa7[_0x5f09c3[_0xccad('0x22')]+_0xccad('0x3e')],handleFindQueue(_0x485039['name']));if(_0x3d52b7){startRouting(_0x233f99,_0x3d52b7,_0x5f09c3,_0x5c3fa7);var _0x33162c=(_0x3d52b7['timeout']||0xa)*0x3e8;var _0x2eafee=(_0x485039[_0xccad('0x37')]||0x14)*0x3e8;var _0xee9a4a,_0x1d9635;if(_0x33162c>_0x2eafee){_0x2eafee=_0x33162c;}var _0x26c901=seqqueue[_0xccad('0x3f')](_0x33162c);_0x26c901['id']=_0x233f99;_0x26c901[_0xccad('0x40')]=_0x33162c;_0x26c901[_0xccad('0x41')]=_0x2eafee;_0x26c901[_0xccad('0x22')]=_0x5f09c3[_0xccad('0x22')];_0x5c3fa7['rules'][_0x233f99]['on']('end',function(){logger[_0xccad('0x2d')](_0xccad('0x42'),_0x233f99);stopRouting(_0x233f99,_0x3d52b7,_0x5f09c3,_0x5c3fa7);clearTimeout(_0xee9a4a);_0xee9a4a=undefined;_0x26c901[_0xccad('0x43')](!![]);if(_0x5c3fa7[_0xccad('0x44')][_0x233f99]){delete _0x5c3fa7[_0xccad('0x44')][_0x233f99];}_0x59dbf4[_0xccad('0x3d')]();});_0x5c3fa7[_0xccad('0x44')][_0x233f99]['on'](_0xccad('0x45'),function(){if(_0x5c3fa7[_0xccad('0x44')][_0x233f99]){delete _0x5c3fa7[_0xccad('0x44')][_0x233f99];}});_0xee9a4a=setTimeout(function(){logger[_0xccad('0x2d')](_0xccad('0x46'),_0x233f99);endRouting(_0x233f99,_0x3d52b7,_0x5f09c3,_0x5c3fa7);clearTimeout(_0xee9a4a);_0x26c901['close'](!![]);_0x59dbf4[_0xccad('0x47')]();},_0x2eafee);switch(_0x3d52b7[_0xccad('0x48')]){case _0xccad('0x49'):strategy[_0xccad('0x49')](_0x26c901,_0x3d52b7,_0x5c3fa7,_0x5f09c3);break;default:strategy[_0xccad('0x4a')](_0x26c901,_0x3d52b7,_0x5c3fa7,_0x5f09c3);}}else{logger['error'](_0xccad('0x4b'),_0x233f99,_0x485039[_0xccad('0x2e')]);_0x59dbf4['stop']();}}}catch(_0x1ed2e5){console[_0xccad('0x4c')](_0x1ed2e5);logger[_0xccad('0x31')](_0xccad('0x4d'),_0x233f99,_0x1ed2e5[_0xccad('0x4e')]);_0x59dbf4[_0xccad('0x3d')]();}};};
\ No newline at end of file
index 0ccc188..62958f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1193=['debug','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','realtime','routing','squeue','push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','agent','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue',':FORCED'];(function(_0x1eb6cc,_0x520e07){var _0x23971a=function(_0x437298){while(--_0x437298){_0x1eb6cc['push'](_0x1eb6cc['shift']());}};_0x23971a(++_0x520e07);}(_0x1193,0x9d));var _0x3119=function(_0x32b4bb,_0x4a8f84){_0x32b4bb=_0x32b4bb-0x0;var _0x24dff2=_0x1193[_0x32b4bb];return _0x24dff2;};'use strict';var _=require(_0x3119('0x0'));var uuid=require('uuid');var util=require(_0x3119('0x1'));var logger=require(_0x3119('0x2'))('routing');var Agent=function(_0x5d83b8,_0x1f0a34,_0x30f400,_0x56d912){this[_0x3119('0x3')]=uuid['v4']();this['squeue']=_0x5d83b8;this['agent']=_0x1f0a34;this[_0x3119('0x4')]=_0x30f400;this[_0x3119('0x5')]=_0x56d912;this[_0x3119('0x6')][_0x3119('0x7')](this[_0x3119('0x8')]['bind'](this),this['handleTimeout'][_0x3119('0x9')](this));this[_0x3119('0x6')]['on'](_0x3119('0xa'),this[_0x3119('0xb')][_0x3119('0x9')](this));this[_0x3119('0x6')]['on']('drained',this[_0x3119('0xc')][_0x3119('0x9')](this));};Agent[_0x3119('0xd')][_0x3119('0x7')]=function(){this[_0x3119('0x6')][_0x3119('0x7')](this[_0x3119('0x8')][_0x3119('0x9')](this),this[_0x3119('0xb')][_0x3119('0x9')](this));};Agent['prototype'][_0x3119('0xc')]=function(){this[_0x3119('0xb')](!![]);};Agent['prototype'][_0x3119('0x8')]=function(){logger['debug'](_0x3119('0xe'),this['squeue']['id'],this[_0x3119('0xf')]['id']);if(_[_0x3119('0x10')](this[_0x3119('0x4')][_0x3119('0x11')][this['agent']['id']])){logger['debug'](_0x3119('0x12'),this[_0x3119('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x3119('0x7')]['bind'](this),0x3e8);}else{if(this[_0x3119('0x5')][_0x3119('0x13')]||util['isAgentAvailable'](this[_0x3119('0x6')]['id'],this[_0x3119('0x4')]['agents'][this[_0x3119('0xf')]['id']],this[_0x3119('0x6')][_0x3119('0x14')],![])){this[_0x3119('0x4')][_0x3119('0x11')][this[_0x3119('0xf')]['id']]['busy']=!![];this[_0x3119('0x4')][_0x3119('0x11')][this['agent']['id']][_0x3119('0x15')]=undefined;util['showNotification'](this[_0x3119('0x3')],this[_0x3119('0x6')]['id'],this[_0x3119('0x4')]['agents'][this['agent']['id']],null,this[_0x3119('0x5')]);util['writeLog'](this[_0x3119('0x6')]['id'],this[_0x3119('0x4')][_0x3119('0x11')][this[_0x3119('0xf')]['id']],'RINGING'+(this[_0x3119('0x5')][_0x3119('0x13')]?_0x3119('0x16'):''));}else{logger['debug']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x3119('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x3119('0x9')](this),0x3e8);}}};Agent['prototype'][_0x3119('0xb')]=function(_0x272efa){if(_[_0x3119('0x10')](this[_0x3119('0x4')][_0x3119('0x11')][this[_0x3119('0xf')]['id']])){return logger['debug'](_0x3119('0x12'),this['squeue']['id'],this[_0x3119('0xf')]['id']);}else{logger[_0x3119('0x17')](_0x3119('0x18'),this[_0x3119('0x6')]['id'],this[_0x3119('0xf')]['id']);util[_0x3119('0x19')](this[_0x3119('0x3')],this['squeue']['id'],this['realtime'][_0x3119('0x11')][this['agent']['id']],null,this[_0x3119('0x5')]);this['realtime'][_0x3119('0x11')][this[_0x3119('0xf')]['id']]['busy']=![];this[_0x3119('0x4')][_0x3119('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0x3119('0x1a')](this[_0x3119('0x6')]['id'],this[_0x3119('0x4')][_0x3119('0x11')][this[_0x3119('0xf')]['id']],_0x272efa?_0x3119('0x1b'):_0x3119('0x1c'));}if(!_0x272efa){setTimeout(this[_0x3119('0x7')]['bind'](this),0x3e8);}};function agent(_0x2cd557,_0x3af386,_0x4c31aa,_0x176fff){return new Agent(_0x2cd557,_0x3af386,_0x4c31aa,_0x176fff);}module[_0x3119('0x1d')]=agent;
\ No newline at end of file
+var _0xdd66=['[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','uuid','./util','notificationId','squeue','agent','handleRun','handleTimeout','bind','timeout','drained','push','prototype','handleDrained','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','agents','busyQueue','writeLog',':FORCED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd66,0x19a));var _0x6dd6=function(_0x2ea665,_0x674ef3){_0x2ea665=_0x2ea665-0x0;var _0x87186a=_0xdd66[_0x2ea665];return _0x87186a;};'use strict';var _=require('lodash');var uuid=require(_0x6dd6('0x0'));var util=require(_0x6dd6('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x1eb94a,_0x166b03,_0xb74c23,_0x2be3c6){this[_0x6dd6('0x2')]=uuid['v4']();this[_0x6dd6('0x3')]=_0x1eb94a;this[_0x6dd6('0x4')]=_0x166b03;this['realtime']=_0xb74c23;this['routing']=_0x2be3c6;this[_0x6dd6('0x3')]['push'](this[_0x6dd6('0x5')]['bind'](this),this[_0x6dd6('0x6')][_0x6dd6('0x7')](this));this['squeue']['on'](_0x6dd6('0x8'),this['handleTimeout']['bind'](this));this[_0x6dd6('0x3')]['on'](_0x6dd6('0x9'),this['handleDrained'][_0x6dd6('0x7')](this));};Agent['prototype']['push']=function(){this[_0x6dd6('0x3')][_0x6dd6('0xa')](this[_0x6dd6('0x5')][_0x6dd6('0x7')](this),this['handleTimeout'][_0x6dd6('0x7')](this));};Agent[_0x6dd6('0xb')][_0x6dd6('0xc')]=function(){this['handleTimeout'](!![]);};Agent[_0x6dd6('0xb')][_0x6dd6('0x5')]=function(){logger[_0x6dd6('0xd')](_0x6dd6('0xe'),this[_0x6dd6('0x3')]['id'],this['agent']['id']);if(_[_0x6dd6('0xf')](this[_0x6dd6('0x10')]['agents'][this[_0x6dd6('0x4')]['id']])){logger[_0x6dd6('0xd')](_0x6dd6('0x11'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x6dd6('0xa')][_0x6dd6('0x7')](this),0x3e8);}else{if(this[_0x6dd6('0x12')][_0x6dd6('0x13')]||util['isAgentAvailable'](this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x10')][_0x6dd6('0x14')][this['agent']['id']],this[_0x6dd6('0x3')]['channel'],![])){this[_0x6dd6('0x10')][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']]['busy']=!![];this['realtime'][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']][_0x6dd6('0x15')]=undefined;util['showNotification'](this[_0x6dd6('0x2')],this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x10')][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']],null,this[_0x6dd6('0x12')]);util[_0x6dd6('0x16')](this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x10')][_0x6dd6('0x14')][this['agent']['id']],'RINGING'+(this[_0x6dd6('0x12')][_0x6dd6('0x13')]?_0x6dd6('0x17'):''));}else{logger['debug'](_0x6dd6('0x18'),this['squeue']['id'],this[_0x6dd6('0x4')]['id']);setTimeout(this[_0x6dd6('0xa')][_0x6dd6('0x7')](this),0x3e8);}}};Agent[_0x6dd6('0xb')][_0x6dd6('0x6')]=function(_0x49e1ad){if(_[_0x6dd6('0xf')](this[_0x6dd6('0x10')][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']])){return logger[_0x6dd6('0xd')](_0x6dd6('0x11'),this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x4')]['id']);}else{logger[_0x6dd6('0xd')](_0x6dd6('0x19'),this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x4')]['id']);util[_0x6dd6('0x1a')](this[_0x6dd6('0x2')],this[_0x6dd6('0x3')]['id'],this['realtime'][_0x6dd6('0x14')][this['agent']['id']],null,this[_0x6dd6('0x12')]);this['realtime'][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']][_0x6dd6('0x1b')]=![];this[_0x6dd6('0x10')][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x6dd6('0x3')]['id'],this[_0x6dd6('0x10')][_0x6dd6('0x14')][this[_0x6dd6('0x4')]['id']],_0x49e1ad?_0x6dd6('0x1c'):_0x6dd6('0x1d'));}if(!_0x49e1ad){setTimeout(this[_0x6dd6('0xa')][_0x6dd6('0x7')](this),0x3e8);}};function agent(_0x15fa9b,_0x4b712f,_0xeb7af3,_0xddc797){return new Agent(_0x15fa9b,_0x4b712f,_0xeb7af3,_0xddc797);}module[_0x6dd6('0x1e')]=agent;
\ No newline at end of file
index 355970f..241705a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32c0=['push','isNil','Agents','length','agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','writeLog','STOP','TIMEOUT','busy','exports','lodash','uuid','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','handleRun','handleTimeout','bind','handleDrained','prototype'];(function(_0x9dd513,_0x48f4cd){var _0x16589b=function(_0x259302){while(--_0x259302){_0x9dd513['push'](_0x9dd513['shift']());}};_0x16589b(++_0x48f4cd);}(_0x32c0,0x1f3));var _0x032c=function(_0x31338a,_0x322928){_0x31338a=_0x31338a-0x0;var _0x39faf=_0x32c0[_0x31338a];return _0x39faf;};'use strict';var _=require(_0x032c('0x0'));var uuid=require(_0x032c('0x1'));var util=require('./util');var logger=require(_0x032c('0x2'))(_0x032c('0x3'));var Beepall=function(_0x4f5eb9,_0x254198,_0x2bc539,_0x283b77){this[_0x032c('0x4')]=uuid['v4']();this['squeue']=_0x4f5eb9;this[_0x032c('0x5')]=_0x254198;this[_0x032c('0x6')]=_0x2bc539;this[_0x032c('0x3')]=_0x283b77;this[_0x032c('0x7')]['push'](this[_0x032c('0x8')]['bind'](this),this[_0x032c('0x9')][_0x032c('0xa')](this));this['squeue']['on']('timeout',this[_0x032c('0x9')]['bind'](this));this[_0x032c('0x7')]['on']('drained',this[_0x032c('0xb')][_0x032c('0xa')](this));};Beepall[_0x032c('0xc')][_0x032c('0xd')]=function(){this[_0x032c('0x7')][_0x032c('0xd')](this['handleRun'][_0x032c('0xa')](this),this[_0x032c('0x9')][_0x032c('0xa')](this));};Beepall[_0x032c('0xc')]['handleDrained']=function(){this[_0x032c('0x9')](!![]);};Beepall[_0x032c('0xc')][_0x032c('0x8')]=function(){var _0x216984=!![];if(!_[_0x032c('0xe')](this[_0x032c('0x5')])&&!_['isNil'](this[_0x032c('0x5')][_0x032c('0xf')])&&this[_0x032c('0x5')][_0x032c('0xf')][_0x032c('0x10')]>0x0){for(var _0x46cbd2=0x0,_0x49c770;_0x46cbd2<this[_0x032c('0x5')][_0x032c('0xf')][_0x032c('0x10')];_0x46cbd2+=0x1){_0x49c770=this[_0x032c('0x5')][_0x032c('0xf')][_0x46cbd2]['id'];if(_[_0x032c('0xe')](this[_0x032c('0x6')][_0x032c('0x11')][_0x49c770])){logger[_0x032c('0x12')](_0x032c('0x13'),this[_0x032c('0x7')]['id'],_0x49c770);}else{if(util[_0x032c('0x14')](this[_0x032c('0x7')]['id'],this['realtime'][_0x032c('0x11')][_0x49c770],this['squeue']['channel'],!![])){_0x216984=![];util['writeLog'](this['squeue']['id'],this[_0x032c('0x6')]['agents'][_0x49c770],_0x032c('0x15'));this[_0x032c('0x6')][_0x032c('0x11')][_0x49c770]['busy']=!![];this[_0x032c('0x6')][_0x032c('0x11')][_0x49c770][_0x032c('0x16')]=this[_0x032c('0x5')][_0x032c('0x17')];util[_0x032c('0x18')](this[_0x032c('0x4')],this['squeue']['id'],this[_0x032c('0x6')][_0x032c('0x11')][_0x49c770],this[_0x032c('0x5')],this['routing']);}}}if(_0x216984){logger[_0x032c('0x12')](_0x032c('0x19'),this[_0x032c('0x7')]['id']);setTimeout(this[_0x032c('0xd')]['bind'](this),0x3e8);}}else{logger[_0x032c('0x12')](_0x032c('0x1a'),this[_0x032c('0x7')]['id']);setTimeout(this[_0x032c('0xd')]['bind'](this),0x3e8);}};Beepall[_0x032c('0xc')][_0x032c('0x9')]=function(_0x5cdd90){if(!_[_0x032c('0xe')](this[_0x032c('0x5')])&&!_[_0x032c('0xe')](this[_0x032c('0x5')]['Agents'])){for(var _0x50a3f8=0x0,_0x3e99b1;_0x50a3f8<this['queue'][_0x032c('0xf')][_0x032c('0x10')];_0x50a3f8+=0x1){_0x3e99b1=this['queue'][_0x032c('0xf')][_0x50a3f8]['id'];if(_[_0x032c('0xe')](this[_0x032c('0x6')][_0x032c('0x11')][_0x3e99b1])){logger['debug'](_0x032c('0x13'),this[_0x032c('0x7')]['id'],_0x3e99b1);}else{util['hideNotification'](this[_0x032c('0x4')],this[_0x032c('0x7')]['id'],this[_0x032c('0x6')][_0x032c('0x11')][_0x3e99b1],this[_0x032c('0x5')],this['routing']);util[_0x032c('0x1b')](this['squeue']['id'],this[_0x032c('0x6')]['agents'][_0x3e99b1],_0x5cdd90?_0x032c('0x1c'):_0x032c('0x1d'));this[_0x032c('0x6')][_0x032c('0x11')][_0x3e99b1][_0x032c('0x1e')]=![];this[_0x032c('0x6')]['agents'][_0x3e99b1][_0x032c('0x16')]=undefined;}}}if(!_0x5cdd90){setTimeout(this[_0x032c('0xd')]['bind'](this),0x3e8);}};function beepall(_0x237089,_0x33f8b0,_0x4264a9,_0x482889){return new Beepall(_0x237089,_0x33f8b0,_0x4264a9,_0x482889);}module[_0x032c('0x1f')]=beepall;
\ No newline at end of file
+var _0xd64b=['squeue','push','handleRun','bind','handleTimeout','handleDrained','prototype','queue','isNil','Agents','length','realtime','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','RINGING','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','busy','exports','lodash','./util','routing'];(function(_0x1c335a,_0x33493d){var _0x2fec8f=function(_0x15b36d){while(--_0x15b36d){_0x1c335a['push'](_0x1c335a['shift']());}};_0x2fec8f(++_0x33493d);}(_0xd64b,0xc1));var _0xbd64=function(_0x32b066,_0x8c6b13){_0x32b066=_0x32b066-0x0;var _0x34c871=_0xd64b[_0x32b066];return _0x34c871;};'use strict';var _=require(_0xbd64('0x0'));var uuid=require('uuid');var util=require(_0xbd64('0x1'));var logger=require('../../../../../config/logger')(_0xbd64('0x2'));var Beepall=function(_0xcbecd5,_0x64bd3b,_0x3f1f05,_0x30fe29){this['notificationId']=uuid['v4']();this['squeue']=_0xcbecd5;this['queue']=_0x64bd3b;this['realtime']=_0x3f1f05;this[_0xbd64('0x2')]=_0x30fe29;this[_0xbd64('0x3')][_0xbd64('0x4')](this[_0xbd64('0x5')][_0xbd64('0x6')](this),this[_0xbd64('0x7')][_0xbd64('0x6')](this));this['squeue']['on']('timeout',this[_0xbd64('0x7')][_0xbd64('0x6')](this));this[_0xbd64('0x3')]['on']('drained',this[_0xbd64('0x8')][_0xbd64('0x6')](this));};Beepall[_0xbd64('0x9')][_0xbd64('0x4')]=function(){this['squeue'][_0xbd64('0x4')](this['handleRun'][_0xbd64('0x6')](this),this[_0xbd64('0x7')][_0xbd64('0x6')](this));};Beepall[_0xbd64('0x9')][_0xbd64('0x8')]=function(){this[_0xbd64('0x7')](!![]);};Beepall[_0xbd64('0x9')][_0xbd64('0x5')]=function(){var _0x2b5808=!![];if(!_['isNil'](this[_0xbd64('0xa')])&&!_[_0xbd64('0xb')](this[_0xbd64('0xa')][_0xbd64('0xc')])&&this[_0xbd64('0xa')]['Agents'][_0xbd64('0xd')]>0x0){for(var _0x5332e0=0x0,_0xccb0d5;_0x5332e0<this[_0xbd64('0xa')][_0xbd64('0xc')][_0xbd64('0xd')];_0x5332e0+=0x1){_0xccb0d5=this[_0xbd64('0xa')][_0xbd64('0xc')][_0x5332e0]['id'];if(_[_0xbd64('0xb')](this[_0xbd64('0xe')]['agents'][_0xccb0d5])){logger[_0xbd64('0xf')](_0xbd64('0x10'),this['squeue']['id'],_0xccb0d5);}else{if(util['isAgentAvailable'](this[_0xbd64('0x3')]['id'],this[_0xbd64('0xe')][_0xbd64('0x11')][_0xccb0d5],this[_0xbd64('0x3')][_0xbd64('0x12')],!![])){_0x2b5808=![];util[_0xbd64('0x13')](this['squeue']['id'],this['realtime'][_0xbd64('0x11')][_0xccb0d5],_0xbd64('0x14'));this[_0xbd64('0xe')][_0xbd64('0x11')][_0xccb0d5]['busy']=!![];this['realtime'][_0xbd64('0x11')][_0xccb0d5]['busyQueue']=this[_0xbd64('0xa')]['name'];util[_0xbd64('0x15')](this[_0xbd64('0x16')],this[_0xbd64('0x3')]['id'],this[_0xbd64('0xe')]['agents'][_0xccb0d5],this[_0xbd64('0xa')],this[_0xbd64('0x2')]);}}}if(_0x2b5808){logger[_0xbd64('0xf')](_0xbd64('0x17'),this['squeue']['id']);setTimeout(this['push'][_0xbd64('0x6')](this),0x3e8);}}else{logger['debug']('[%s][QUEUE]\x20EMPTY',this[_0xbd64('0x3')]['id']);setTimeout(this['push'][_0xbd64('0x6')](this),0x3e8);}};Beepall['prototype'][_0xbd64('0x7')]=function(_0x5d8c35){if(!_[_0xbd64('0xb')](this[_0xbd64('0xa')])&&!_[_0xbd64('0xb')](this[_0xbd64('0xa')][_0xbd64('0xc')])){for(var _0x207ffc=0x0,_0x4ed44a;_0x207ffc<this[_0xbd64('0xa')][_0xbd64('0xc')][_0xbd64('0xd')];_0x207ffc+=0x1){_0x4ed44a=this[_0xbd64('0xa')][_0xbd64('0xc')][_0x207ffc]['id'];if(_[_0xbd64('0xb')](this['realtime']['agents'][_0x4ed44a])){logger[_0xbd64('0xf')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xbd64('0x3')]['id'],_0x4ed44a);}else{util[_0xbd64('0x18')](this['notificationId'],this['squeue']['id'],this[_0xbd64('0xe')]['agents'][_0x4ed44a],this['queue'],this[_0xbd64('0x2')]);util[_0xbd64('0x13')](this[_0xbd64('0x3')]['id'],this['realtime'][_0xbd64('0x11')][_0x4ed44a],_0x5d8c35?'STOP':_0xbd64('0x19'));this[_0xbd64('0xe')][_0xbd64('0x11')][_0x4ed44a][_0xbd64('0x1a')]=![];this[_0xbd64('0xe')][_0xbd64('0x11')][_0x4ed44a]['busyQueue']=undefined;}}}if(!_0x5d8c35){setTimeout(this['push'][_0xbd64('0x6')](this),0x3e8);}};function beepall(_0x2be110,_0x1b644a,_0xc5d971,_0x5cf522){return new Beepall(_0x2be110,_0x1b644a,_0xc5d971,_0x5cf522);}module[_0xbd64('0x1b')]=beepall;
\ No newline at end of file
index 9c9c906..f75a990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x022f=['./beepall','exports','./rrmemory'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x022f,0x18a));var _0xf022=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x022f[_0x20a584];return _0x4b41a8;};'use strict';module[_0xf022('0x0')]={'rrmemory':require(_0xf022('0x1')),'beepall':require(_0xf022('0x2')),'agent':require('./agent')};
\ No newline at end of file
+var _0x6241=['./agent','exports','./beepall'];(function(_0x79cd47,_0x16102d){var _0x3b9484=function(_0x23db95){while(--_0x23db95){_0x79cd47['push'](_0x79cd47['shift']());}};_0x3b9484(++_0x16102d);}(_0x6241,0x169));var _0x1624=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x6241[_0x565ed7];return _0x183ad7;};'use strict';module[_0x1624('0x0')]={'rrmemory':require('./rrmemory'),'beepall':require(_0x1624('0x1')),'agent':require(_0x1624('0x2'))};
\ No newline at end of file
index d3fd746..6c2dfb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb114=['handleRun','bind','timeout','handleTimeout','drained','prototype','handleDrained','handleCheckReject','agents','debug','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','queue','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','busyQueue','name','showNotification','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','intervals','push'];(function(_0x3234a0,_0x32e998){var _0x4ff3e0=function(_0x46366c){while(--_0x46366c){_0x3234a0['push'](_0x3234a0['shift']());}};_0x4ff3e0(++_0x32e998);}(_0xb114,0x11f));var _0x4b11=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xb114[_0x22f8ab];return _0x2a70e5;};'use strict';var rr=require('rr');var _=require(_0x4b11('0x0'));var uuid=require('uuid');var util=require(_0x4b11('0x1'));var logger=require(_0x4b11('0x2'))('routing');var RRMemory=function(_0x7df653,_0x386e9a,_0x1e2928,_0x12de1d){this[_0x4b11('0x3')]=uuid['v4']();this[_0x4b11('0x4')]=_0x7df653;this['queue']=_0x386e9a;this[_0x4b11('0x5')]=_0x1e2928;this[_0x4b11('0x6')]=_0x12de1d;this[_0x4b11('0x7')]={};this[_0x4b11('0x4')][_0x4b11('0x8')](this[_0x4b11('0x9')][_0x4b11('0xa')](this),this['handleTimeout'][_0x4b11('0xa')](this),this['module']);this[_0x4b11('0x4')]['on'](_0x4b11('0xb'),this[_0x4b11('0xc')][_0x4b11('0xa')](this));this[_0x4b11('0x4')]['on'](_0x4b11('0xd'),this['handleDrained'][_0x4b11('0xa')](this));};RRMemory[_0x4b11('0xe')][_0x4b11('0x8')]=function(){this[_0x4b11('0x4')]['push'](this['handleRun'][_0x4b11('0xa')](this),this[_0x4b11('0xc')][_0x4b11('0xa')](this));};RRMemory[_0x4b11('0xe')][_0x4b11('0xf')]=function(){this[_0x4b11('0xc')](!![]);};RRMemory[_0x4b11('0xe')][_0x4b11('0x10')]=function(_0x5a94d1){if(util['isAgentAvailable'](this[_0x4b11('0x4')]['id'],this[_0x4b11('0x5')][_0x4b11('0x11')][this['agentId']],this['squeue']['channel'],!![])){logger[_0x4b11('0x12')](_0x4b11('0x13'),this[_0x4b11('0x4')]['id'],this[_0x4b11('0x14')]);clearInterval(this[_0x4b11('0x7')][this[_0x4b11('0x14')]]);_0x5a94d1[_0x4b11('0x15')]();setTimeout(this[_0x4b11('0x8')][_0x4b11('0xa')](this),0x3e8);}};RRMemory[_0x4b11('0xe')]['handleRun']=function(_0x188de5){this[_0x4b11('0x14')]=rr(this[_0x4b11('0x16')]['mapAgentsId']);logger[_0x4b11('0x12')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x4b11('0x4')]['id'],this[_0x4b11('0x14')]);if(_[_0x4b11('0x17')](this[_0x4b11('0x5')][_0x4b11('0x11')][this[_0x4b11('0x14')]])){logger[_0x4b11('0x12')](_0x4b11('0x18'),this[_0x4b11('0x4')]['id'],this[_0x4b11('0x14')]);_0x188de5[_0x4b11('0x15')]();setTimeout(this['push'][_0x4b11('0xa')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0x4b11('0x4')]['id'],this['realtime']['agents'][this[_0x4b11('0x14')]],this[_0x4b11('0x4')][_0x4b11('0x19')],!![])){this[_0x4b11('0x5')][_0x4b11('0x11')][this['agentId']][_0x4b11('0x1a')]=!![];this[_0x4b11('0x5')][_0x4b11('0x11')][this[_0x4b11('0x14')]][_0x4b11('0x1b')]=this[_0x4b11('0x16')][_0x4b11('0x1c')];util[_0x4b11('0x1d')](this['notificationId'],this[_0x4b11('0x4')]['id'],this[_0x4b11('0x5')]['agents'][this[_0x4b11('0x14')]],this[_0x4b11('0x16')],this[_0x4b11('0x6')]);util[_0x4b11('0x1e')](this[_0x4b11('0x4')]['id'],this[_0x4b11('0x5')][_0x4b11('0x11')][this['agentId']],_0x4b11('0x1f'));this[_0x4b11('0x7')][this[_0x4b11('0x14')]]=setInterval(this['handleCheckReject'][_0x4b11('0xa')](this,_0x188de5),0x3e8);}else{logger[_0x4b11('0x12')](_0x4b11('0x20'),this[_0x4b11('0x4')]['id'],this[_0x4b11('0x14')]);_0x188de5[_0x4b11('0x15')]();setTimeout(this['push']['bind'](this),0x3e8);}}};RRMemory[_0x4b11('0xe')][_0x4b11('0xc')]=function(_0x28cdc2){logger[_0x4b11('0x12')](_0x4b11('0x21'),this[_0x4b11('0x4')]['id'],this[_0x4b11('0x14')]);if(_['isNil'](this[_0x4b11('0x5')][_0x4b11('0x11')][this[_0x4b11('0x14')]])){logger[_0x4b11('0x12')](_0x4b11('0x18'),this['squeue']['id'],this['agentId']);}else{clearInterval(this[_0x4b11('0x7')][this[_0x4b11('0x14')]]);util[_0x4b11('0x22')](this[_0x4b11('0x3')],this['squeue']['id'],this['realtime']['agents'][this[_0x4b11('0x14')]],this[_0x4b11('0x16')],this['routing']);util[_0x4b11('0x1e')](this['squeue']['id'],this[_0x4b11('0x5')][_0x4b11('0x11')][this[_0x4b11('0x14')]],_0x4b11('0x23'));this[_0x4b11('0x5')][_0x4b11('0x11')][this[_0x4b11('0x14')]][_0x4b11('0x1a')]=![];this[_0x4b11('0x5')][_0x4b11('0x11')][this['agentId']]['busyQueue']=undefined;}if(!_0x28cdc2){setTimeout(this[_0x4b11('0x8')][_0x4b11('0xa')](this),0x3e8);}};function rrmemory(_0x1278aa,_0x389cd0,_0x10335d,_0x1477cb){return new RRMemory(_0x1278aa,_0x389cd0,_0x10335d,_0x1477cb);}module[_0x4b11('0x24')]=rrmemory;
\ No newline at end of file
+var _0x20de=['done','debug','isNil','busy','busyQueue','name','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','intervals','bind','handleTimeout','timeout','handleDrained','prototype','push','handleRun','handleCheckReject','isAgentAvailable','agents','agentId','channel','[%s][QUEUE]\x20available\x20again\x20%s'];(function(_0x5ec21d,_0x5d0772){var _0x43bde8=function(_0x1bfc7c){while(--_0x1bfc7c){_0x5ec21d['push'](_0x5ec21d['shift']());}};_0x43bde8(++_0x5d0772);}(_0x20de,0x134));var _0xe20d=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x20de[_0x2aecb2];return _0x3ebb80;};'use strict';var rr=require('rr');var _=require(_0xe20d('0x0'));var uuid=require('uuid');var util=require(_0xe20d('0x1'));var logger=require(_0xe20d('0x2'))(_0xe20d('0x3'));var RRMemory=function(_0x26654a,_0x9a0b77,_0x39a7f3,_0x31c533){this[_0xe20d('0x4')]=uuid['v4']();this[_0xe20d('0x5')]=_0x26654a;this[_0xe20d('0x6')]=_0x9a0b77;this[_0xe20d('0x7')]=_0x39a7f3;this['routing']=_0x31c533;this[_0xe20d('0x8')]={};this['squeue']['push'](this['handleRun'][_0xe20d('0x9')](this),this[_0xe20d('0xa')][_0xe20d('0x9')](this),this['module']);this[_0xe20d('0x5')]['on'](_0xe20d('0xb'),this['handleTimeout'][_0xe20d('0x9')](this));this[_0xe20d('0x5')]['on']('drained',this[_0xe20d('0xc')][_0xe20d('0x9')](this));};RRMemory[_0xe20d('0xd')][_0xe20d('0xe')]=function(){this['squeue']['push'](this[_0xe20d('0xf')][_0xe20d('0x9')](this),this[_0xe20d('0xa')][_0xe20d('0x9')](this));};RRMemory[_0xe20d('0xd')][_0xe20d('0xc')]=function(){this[_0xe20d('0xa')](!![]);};RRMemory[_0xe20d('0xd')][_0xe20d('0x10')]=function(_0x56eeea){if(util[_0xe20d('0x11')](this['squeue']['id'],this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]],this['squeue'][_0xe20d('0x14')],!![])){logger['debug'](_0xe20d('0x15'),this[_0xe20d('0x5')]['id'],this[_0xe20d('0x13')]);clearInterval(this['intervals'][this[_0xe20d('0x13')]]);_0x56eeea[_0xe20d('0x16')]();setTimeout(this[_0xe20d('0xe')][_0xe20d('0x9')](this),0x3e8);}};RRMemory['prototype'][_0xe20d('0xf')]=function(_0x3fb2d6){this[_0xe20d('0x13')]=rr(this[_0xe20d('0x6')]['mapAgentsId']);logger[_0xe20d('0x17')]('[%s][QUEUE]\x20try\x20with\x20%s',this['squeue']['id'],this[_0xe20d('0x13')]);if(_[_0xe20d('0x18')](this['realtime']['agents'][this[_0xe20d('0x13')]])){logger[_0xe20d('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xe20d('0x5')]['id'],this[_0xe20d('0x13')]);_0x3fb2d6[_0xe20d('0x16')]();setTimeout(this[_0xe20d('0xe')][_0xe20d('0x9')](this),0x3e8);}else{if(util['isAgentAvailable'](this[_0xe20d('0x5')]['id'],this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]],this[_0xe20d('0x5')]['channel'],!![])){this['realtime'][_0xe20d('0x12')][this['agentId']][_0xe20d('0x19')]=!![];this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]][_0xe20d('0x1a')]=this[_0xe20d('0x6')][_0xe20d('0x1b')];util['showNotification'](this[_0xe20d('0x4')],this['squeue']['id'],this['realtime']['agents'][this['agentId']],this['queue'],this[_0xe20d('0x3')]);util[_0xe20d('0x1c')](this[_0xe20d('0x5')]['id'],this['realtime']['agents'][this[_0xe20d('0x13')]],_0xe20d('0x1d'));this[_0xe20d('0x8')][this[_0xe20d('0x13')]]=setInterval(this[_0xe20d('0x10')][_0xe20d('0x9')](this,_0x3fb2d6),0x3e8);}else{logger[_0xe20d('0x17')](_0xe20d('0x1e'),this['squeue']['id'],this[_0xe20d('0x13')]);_0x3fb2d6['done']();setTimeout(this['push'][_0xe20d('0x9')](this),0x3e8);}}};RRMemory['prototype'][_0xe20d('0xa')]=function(_0x2791c2){logger['debug']('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xe20d('0x13')]);if(_[_0xe20d('0x18')](this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]])){logger[_0xe20d('0x17')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xe20d('0x5')]['id'],this[_0xe20d('0x13')]);}else{clearInterval(this[_0xe20d('0x8')][this[_0xe20d('0x13')]]);util['hideNotification'](this[_0xe20d('0x4')],this[_0xe20d('0x5')]['id'],this[_0xe20d('0x7')][_0xe20d('0x12')][this['agentId']],this['queue'],this[_0xe20d('0x3')]);util[_0xe20d('0x1c')](this['squeue']['id'],this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]],_0xe20d('0x1f'));this[_0xe20d('0x7')][_0xe20d('0x12')][this[_0xe20d('0x13')]][_0xe20d('0x19')]=![];this['realtime']['agents'][this['agentId']][_0xe20d('0x1a')]=undefined;}if(!_0x2791c2){setTimeout(this[_0xe20d('0xe')]['bind'](this),0x3e8);}};function rrmemory(_0x2c51d8,_0x335527,_0x5ed198,_0x589980){return new RRMemory(_0x2c51d8,_0x335527,_0x5ed198,_0x589980);}module[_0xe20d('0x20')]=rrmemory;
\ No newline at end of file
index 47c484d..ced1977 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','routing','defaults','redis','localhost','format','user:%s','name','emit','user:save','split','account','notificationSound'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0x8958,0x93));var _0x8895=function(_0x36573d,_0x557b3e){_0x36573d=_0x36573d-0x0;var _0x3c6f69=_0x8958[_0x36573d];return _0x3c6f69;};'use strict';var _=require('lodash');var util=require(_0x8895('0x0'));var utils=require('../utils');var Redis=require('ioredis');var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x8895('0x1'));config['redis']=_[_0x8895('0x2')](config[_0x8895('0x3')],{'host':_0x8895('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8895('0x3')]));function sendNotification(_0x2f03ad,_0x124e1e,_0x40cec6,_0x33013a,_0x51376b,_0xe018b8){io['to'](util[_0x8895('0x5')](_0x8895('0x6'),_0x33013a[_0x8895('0x7')]))[_0x8895('0x8')](_0x8895('0x9'),_0x33013a);var _0x22a12b=_0xe018b8||{};var _0xdb3d59=_0x40cec6[_0x8895('0xa')]('.');var _0x107d86={'uniqueid':_0x124e1e,'channel':_0xdb3d59[0x0],'id':_0xdb3d59[0x1],'title':_0xdb3d59[0x0]+'\x20interaction','interactionId':_0xdb3d59[0x2],'queue':_0x51376b?_0x51376b[_0x8895('0x7')]:null,'sound':_0x22a12b[_0x8895('0xb')][_0x8895('0xc')],'shake':_0x22a12b[_0x8895('0xb')][_0x8895('0xd')]};try{if(!_0x22a12b[_0x8895('0xe')]){_0x22a12b['body']={};}if(_0x51376b){_0x22a12b[_0x8895('0xe')][_0x8895('0xf')]=_0x51376b;}else if(_0x22a12b[_0x8895('0xe')]['queue']){delete _0x22a12b['body'][_0x8895('0xf')];}_0x107d86['msg']=utils[_0x8895('0x10')](_0x22a12b[_0x8895('0xb')][_0x8895('0x11')],_0x22a12b);}catch(_0x3d7b59){_0x107d86[_0x8895('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x8895('0x13')](util[_0x8895('0x5')](_0x8895('0x14'),_0x124e1e,_0x3d7b59[_0x8895('0x15')]));}io['to'](util[_0x8895('0x5')](_0x8895('0x6'),_0x33013a[_0x8895('0x7')]))[_0x8895('0x8')](util[_0x8895('0x5')](_0x8895('0x16'),_0x2f03ad?_0x8895('0x17'):_0x8895('0x18')),_0x107d86);}function writeLog(_0x2df795,_0x54e6d4,_0x522a4e){return logger['debug'](util[_0x8895('0x5')](_0x8895('0x19'),_0x2df795,_0x54e6d4[_0x8895('0x7')],_0x522a4e));}exports[_0x8895('0x1a')]=function(_0x3f7d5a,_0x35bda5,_0x461346,_0xc1ce17){if(_0x35bda5['busy']){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1b'));return![];}if(!_0x35bda5[_0x8895('0x1c')]){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1d'));return![];}if(_0x35bda5[_0x461346+_0x8895('0x1e')]){writeLog(_0x3f7d5a,_0x35bda5,_0x8895('0x1f'));return![];}if(_0xc1ce17&&_0x35bda5['hasOwnProperty'](_0x461346+'Capacity')&&_0x35bda5[_0x8895('0x20')](_0x461346+_0x8895('0x21'))){if(_0x35bda5[_0x461346+_0x8895('0x22')]>0x0&&_0x35bda5[_0x461346+_0x8895('0x21')]>=_0x35bda5[_0x461346+'Capacity']){writeLog(_0x3f7d5a,_0x35bda5,_0x461346[_0x8895('0x23')]()+_0x8895('0x24'));return![];}}return!![];};exports[_0x8895('0x25')]=function(_0x5486a6,_0x4aee03,_0x78b57,_0x555e60,_0x3d51b0){return sendNotification(!![],_0x5486a6,_0x4aee03,_0x78b57,_0x555e60,_0x3d51b0);};exports[_0x8895('0x26')]=function(_0x10b48f,_0xf5fb66,_0x153220,_0x5c03ea,_0x4d567a){return sendNotification(![],_0x10b48f,_0xf5fb66,_0x153220,_0x5c03ea,_0x4d567a);};exports[_0x8895('0x27')]=writeLog;
\ No newline at end of file
+var _0xf494=['toUpperCase','\x20MAXCAPACITY','hideNotification','lodash','util','../utils','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','account','notificationShake','body','queue','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','message','save','remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf494,0x1c6));var _0x4f49=function(_0xd82c73,_0x73b276){_0xd82c73=_0xd82c73-0x0;var _0x930a22=_0xf494[_0xd82c73];return _0x930a22;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var utils=require(_0x4f49('0x2'));var Redis=require('ioredis');var config=require(_0x4f49('0x3'));var logger=require(_0x4f49('0x4'))(_0x4f49('0x5'));config[_0x4f49('0x6')]=_[_0x4f49('0x7')](config[_0x4f49('0x6')],{'host':_0x4f49('0x8'),'port':0x18eb});var io=require(_0x4f49('0x9'))(new Redis(config[_0x4f49('0x6')]));function sendNotification(_0x413530,_0x42b0e8,_0x5eb186,_0x58e9a0,_0x169c95,_0x327bd5){io['to'](util[_0x4f49('0xa')](_0x4f49('0xb'),_0x58e9a0[_0x4f49('0xc')]))[_0x4f49('0xd')](_0x4f49('0xe'),_0x58e9a0);var _0x410884=_0x327bd5||{};var _0x53ee74=_0x5eb186[_0x4f49('0xf')]('.');var _0x411759={'uniqueid':_0x42b0e8,'channel':_0x53ee74[0x0],'id':_0x53ee74[0x1],'title':_0x53ee74[0x0]+'\x20interaction','interactionId':_0x53ee74[0x2],'queue':_0x169c95?_0x169c95[_0x4f49('0xc')]:null,'sound':_0x410884['account']['notificationSound'],'shake':_0x410884[_0x4f49('0x10')][_0x4f49('0x11')]};try{if(!_0x410884['body']){_0x410884[_0x4f49('0x12')]={};}if(_0x169c95){_0x410884[_0x4f49('0x12')][_0x4f49('0x13')]=_0x169c95;}else if(_0x410884[_0x4f49('0x12')][_0x4f49('0x13')]){delete _0x410884[_0x4f49('0x12')][_0x4f49('0x13')];}_0x411759['msg']=utils[_0x4f49('0x14')](_0x410884[_0x4f49('0x10')][_0x4f49('0x15')],_0x410884);}catch(_0x5878f4){_0x411759['msg']=_0x4f49('0x16');logger[_0x4f49('0x17')](util[_0x4f49('0xa')]('[%s][QUEUE]\x20%s',_0x42b0e8,_0x5878f4[_0x4f49('0x18')]));}io['to'](util[_0x4f49('0xa')](_0x4f49('0xb'),_0x58e9a0['name']))['emit'](util['format']('notification:%s',_0x413530?_0x4f49('0x19'):_0x4f49('0x1a')),_0x411759);}function writeLog(_0x1c2d70,_0x407042,_0x5793ac){return logger[_0x4f49('0x1b')](util[_0x4f49('0xa')](_0x4f49('0x1c'),_0x1c2d70,_0x407042[_0x4f49('0xc')],_0x5793ac));}exports[_0x4f49('0x1d')]=function(_0x509f7c,_0x3e7e28,_0x357446,_0x3ae590){if(_0x3e7e28['busy']){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x1e'));return![];}if(!_0x3e7e28[_0x4f49('0x1f')]){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x20'));return![];}if(_0x3e7e28[_0x357446+_0x4f49('0x21')]){writeLog(_0x509f7c,_0x3e7e28,_0x4f49('0x22'));return![];}if(_0x3ae590&&_0x3e7e28[_0x4f49('0x23')](_0x357446+'Capacity')&&_0x3e7e28['hasOwnProperty'](_0x357446+_0x4f49('0x24'))){if(_0x3e7e28[_0x357446+_0x4f49('0x25')]>0x0&&_0x3e7e28[_0x357446+'CurrentCapacity']>=_0x3e7e28[_0x357446+_0x4f49('0x25')]){writeLog(_0x509f7c,_0x3e7e28,_0x357446[_0x4f49('0x26')]()+_0x4f49('0x27'));return![];}}return!![];};exports['showNotification']=function(_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab){return sendNotification(!![],_0xc54070,_0x2eed1c,_0x298785,_0x148153,_0xfefbab);};exports[_0x4f49('0x28')]=function(_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91){return sendNotification(![],_0x4915af,_0x50c571,_0x239f44,_0x2c00ee,_0x605c91);};exports['writeLog']=writeLog;
\ No newline at end of file
index 05375e1..ab4dfe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x613d=['trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','consequence','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x613d,0x177));var _0xd613=function(_0x22e644,_0x411f77){_0x22e644=_0x22e644-0x0;var _0x517ddf=_0x613d[_0x22e644];return _0x517ddf;};'use strict';var schema=require(_0xd613('0x0'));var sh=require(_0xd613('0x1'));var _=require(_0xd613('0x2'));var utils=require('./utils');var logger=require(_0xd613('0x3'))(_0xd613('0x4'));var system=schema({'command':{'type':_0xd613('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xd613('0x6')]=function(_0x437799,_0x1b4f7c){return function(_0x118def){try{var _0x16224b={'command':_0x1b4f7c[0x0]};var _0x17620b=system[_0xd613('0x0')](_0x16224b,{'typecast':!![]});if(_0x17620b[_0xd613('0x7')]){logger[_0xd613('0x8')]('[%s][SYSTEM]\x20%s',_0x437799,_[_0xd613('0x9')](_0x17620b,'message')[_0xd613('0xa')](',\x20'));logger[_0xd613('0xb')](_0xd613('0xc'),_0x437799);_0x118def[_0xd613('0xd')]();}else{var _0x17341e=this;var _0x30d423=utils[_0xd613('0xe')](_0x1b4f7c[0x0],this);logger[_0xd613('0xb')](_0xd613('0xf'),_0x437799,_0x30d423);sh[_0xd613('0x10')](_[_0xd613('0x11')](_0x30d423),function(_0x560c74,_0x4485ba){logger[_0xd613('0xb')](_0xd613('0x12'),_0x437799,_0x560c74);if(_0x560c74==0x0){var _0xb712cc=_0x4485ba[_0xd613('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0xd613('0x14')](_0x1b4f7c[0x1])||_[_0xd613('0x15')](_0x1b4f7c[0x1])){logger[_0xd613('0xb')](_0xd613('0x16'),_0x437799);_0x17341e[_0xd613('0x17')][_0x1b4f7c[0x1]]=_0xb712cc;}else{logger[_0xd613('0xb')](_0xd613('0x18'),_0x437799,_0x1b4f7c[0x1],_0xb712cc);_0x17341e[_0xd613('0x17')][_0x1b4f7c[0x1]]=_0xb712cc;}}_0x118def[_0xd613('0xd')]();});}}catch(_0x396425){logger[_0xd613('0x8')](_0xd613('0x19'),_0x437799,_[_0xd613('0x1a')](_0x396425)?JSON[_0xd613('0x1b')](_0x396425):_0x396425);logger[_0xd613('0xb')](_0xd613('0xc'),_0x437799);_0x118def['next']();}};};
\ No newline at end of file
+var _0xb8ef=['[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','error','isObject','stringify','next','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','[%s][SYSTEM]\x20commnad:\x20%s','exec'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb8ef,0x129));var _0xfb8e=function(_0x3b8683,_0x14065f){_0x3b8683=_0x3b8683-0x0;var _0xe6aeaa=_0xb8ef[_0x3b8683];return _0xe6aeaa;};'use strict';var schema=require(_0xfb8e('0x0'));var sh=require(_0xfb8e('0x1'));var _=require('lodash');var utils=require(_0xfb8e('0x2'));var logger=require(_0xfb8e('0x3'))(_0xfb8e('0x4'));var system=schema({'command':{'type':_0xfb8e('0x5'),'required':!![],'message':_0xfb8e('0x6')}});exports[_0xfb8e('0x7')]=function(_0x54bc4f,_0x44eefe){return function(_0xe8b228){try{var _0x5164b8={'command':_0x44eefe[0x0]};var _0x31150e=system[_0xfb8e('0x0')](_0x5164b8,{'typecast':!![]});if(_0x31150e[_0xfb8e('0x8')]){logger['error'](_0xfb8e('0x9'),_0x54bc4f,_['map'](_0x31150e,_0xfb8e('0xa'))['join'](',\x20'));logger[_0xfb8e('0xb')](_0xfb8e('0xc'),_0x54bc4f);_0xe8b228['next']();}else{var _0x5ed840=this;var _0x44c178=utils['getMustacheRender'](_0x44eefe[0x0],this);logger['info'](_0xfb8e('0xd'),_0x54bc4f,_0x44c178);sh[_0xfb8e('0xe')](_['trim'](_0x44c178),function(_0x40a390,_0xe50d16){logger[_0xfb8e('0xb')](_0xfb8e('0xf'),_0x54bc4f,_0x40a390);if(_0x40a390==0x0){var _0x46172c=_0xe50d16[_0xfb8e('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0xfb8e('0x11')](_0x44eefe[0x1])||_[_0xfb8e('0x12')](_0x44eefe[0x1])){logger[_0xfb8e('0xb')](_0xfb8e('0x13'),_0x54bc4f);_0x5ed840[_0xfb8e('0x14')][_0x44eefe[0x1]]=_0x46172c;}else{logger['info'](_0xfb8e('0x15'),_0x54bc4f,_0x44eefe[0x1],_0x46172c);_0x5ed840[_0xfb8e('0x14')][_0x44eefe[0x1]]=_0x46172c;}}_0xe8b228['next']();});}}catch(_0x15b7b8){logger[_0xfb8e('0x16')](_0xfb8e('0x9'),_0x54bc4f,_[_0xfb8e('0x17')](_0x15b7b8)?JSON[_0xfb8e('0x18')](_0x15b7b8):_0x15b7b8);logger[_0xfb8e('0xb')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x54bc4f);_0xe8b228[_0xfb8e('0x19')]();}};};
\ No newline at end of file
index 483b2d7..31c25f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a17=['lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','validate'];(function(_0x4a0307,_0x42fd1e){var _0xcda122=function(_0x3b71ee){while(--_0x3b71ee){_0x4a0307['push'](_0x4a0307['shift']());}};_0xcda122(++_0x42fd1e);}(_0x2a17,0x15b));var _0x72a1=function(_0x50729b,_0x4a6a46){_0x50729b=_0x50729b-0x0;var _0x2bc1e1=_0x2a17[_0x50729b];return _0x2bc1e1;};'use strict';var schema=require(_0x72a1('0x0'));var _=require(_0x72a1('0x1'));var rpc={'chatInteraction':require(_0x72a1('0x2')),'openchannelInteraction':require(_0x72a1('0x3')),'smsInteraction':require(_0x72a1('0x4')),'mailInteraction':require(_0x72a1('0x5')),'faxInteraction':require(_0x72a1('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x72a1('0x7'))(_0x72a1('0x8'));var tag=schema({'tag':{'type':_0x72a1('0x9'),'required':!![],'message':_0x72a1('0xa')}});exports[_0x72a1('0xb')]=function(_0x16efbf,_0x2a7345,_0x1da2b1,_0x7502c5){return function(_0x35f758){try{var _0x5845d2={'tag':_0x2a7345[0x0]};var _0x2b5468=tag[_0x72a1('0x0')](_0x5845d2,{'typecast':!![]});if(_0x2b5468['length']){logger[_0x72a1('0xc')](_0x72a1('0xd'),_0x16efbf,_[_0x72a1('0xe')](_0x2b5468,_0x72a1('0xf'))[_0x72a1('0x10')](',\x20'));logger[_0x72a1('0x11')](_0x72a1('0x12'),_0x16efbf);_0x35f758[_0x72a1('0x13')]();}else{var _0x3fff26={'ids':[_0x2a7345[0x0]]};if(rpc[_0x7502c5[_0x72a1('0x14')]+_0x72a1('0x15')]){rpc[_0x7502c5[_0x72a1('0x14')]+'Interaction'][_0x72a1('0x16')](_0x7502c5[_0x72a1('0x17')]['id'],_0x3fff26)[_0x72a1('0x18')](function(_0x46609f){logger['info'](_0x72a1('0x19'),_0x16efbf,_0x2a7345[0x1],_0x7502c5[_0x72a1('0x14')],_0x7502c5[_0x72a1('0x17')]['id']);})['catch'](function(_0x5d78f3){logger[_0x72a1('0xc')](_0x72a1('0xd'),_0x16efbf,JSON[_0x72a1('0x1a')](_0x5d78f3));logger[_0x72a1('0x11')](_0x72a1('0x12'),_0x16efbf);})[_0x72a1('0x1b')](function(){_0x35f758[_0x72a1('0x13')]();});}}}catch(_0x3145ef){logger['error'](_0x72a1('0xd'),_0x16efbf,_[_0x72a1('0x1c')](_0x3145ef)?JSON[_0x72a1('0x1a')](_0x3145ef):_0x3145ef);logger[_0x72a1('0x11')](_0x72a1('0x12'),_0x16efbf);_0x35f758[_0x72a1('0x13')]();}};};
\ No newline at end of file
+var _0xbe63=['catch','stringify','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s'];(function(_0x2c366f,_0x1bd4f8){var _0x180634=function(_0x5dcd2c){while(--_0x5dcd2c){_0x2c366f['push'](_0x2c366f['shift']());}};_0x180634(++_0x1bd4f8);}(_0xbe63,0xaa));var _0x3be6=function(_0x155c64,_0x26ff95){_0x155c64=_0x155c64-0x0;var _0x1f154a=_0xbe63[_0x155c64];return _0x1f154a;};'use strict';var schema=require(_0x3be6('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x3be6('0x1')),'openchannelInteraction':require(_0x3be6('0x2')),'smsInteraction':require(_0x3be6('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x3be6('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')('routing');var tag=schema({'tag':{'type':_0x3be6('0x5'),'required':!![],'message':_0x3be6('0x6')}});exports[_0x3be6('0x7')]=function(_0x1b36b2,_0x300b63,_0x9eee20,_0x9c14d1){return function(_0x5e0668){try{var _0x3a4ec4={'tag':_0x300b63[0x0]};var _0xc10af6=tag[_0x3be6('0x0')](_0x3a4ec4,{'typecast':!![]});if(_0xc10af6[_0x3be6('0x8')]){logger[_0x3be6('0x9')](_0x3be6('0xa'),_0x1b36b2,_['map'](_0xc10af6,_0x3be6('0xb'))[_0x3be6('0xc')](',\x20'));logger[_0x3be6('0xd')](_0x3be6('0xe'),_0x1b36b2);_0x5e0668[_0x3be6('0xf')]();}else{var _0x4fb814={'ids':[_0x300b63[0x0]]};if(rpc[_0x9c14d1[_0x3be6('0x10')]+_0x3be6('0x11')]){rpc[_0x9c14d1[_0x3be6('0x10')]+_0x3be6('0x11')][_0x3be6('0x12')](_0x9c14d1[_0x3be6('0x13')]['id'],_0x4fb814)[_0x3be6('0x14')](function(_0x394977){logger[_0x3be6('0xd')](_0x3be6('0x15'),_0x1b36b2,_0x300b63[0x1],_0x9c14d1[_0x3be6('0x10')],_0x9c14d1[_0x3be6('0x13')]['id']);})[_0x3be6('0x16')](function(_0x26404e){logger['error'](_0x3be6('0xa'),_0x1b36b2,JSON[_0x3be6('0x17')](_0x26404e));logger[_0x3be6('0xd')](_0x3be6('0xe'),_0x1b36b2);})['finally'](function(){_0x5e0668[_0x3be6('0xf')]();});}}}catch(_0x41a4c9){logger[_0x3be6('0x9')](_0x3be6('0xa'),_0x1b36b2,_['isObject'](_0x41a4c9)?JSON[_0x3be6('0x17')](_0x41a4c9):_0x41a4c9);logger[_0x3be6('0xd')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x1b36b2);_0x5e0668['next']();}};};
\ No newline at end of file
index 31ee2f5..7742dba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25cb=['request-promise','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','push','urlOnAnswer','?params=','title','jsonrpc','method','login','params','stringify','utf8','POST','application/json-rpc','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','info','next'];(function(_0x481b12,_0x44c4cd){var _0x4a1974=function(_0x51cc4e){while(--_0x51cc4e){_0x481b12['push'](_0x481b12['shift']());}};_0x4a1974(++_0x44c4cd);}(_0x25cb,0x16b));var _0xb25c=function(_0x2bb9b3,_0x1d2c25){_0x2bb9b3=_0x2bb9b3-0x0;var _0x601b6=_0x25cb[_0x2bb9b3];return _0x601b6;};'use strict';var rp=require(_0xb25c('0x0'));var logger=require(_0xb25c('0x1'))(_0xb25c('0x2'));var _=require(_0xb25c('0x3'));var arr=[];exports[_0xb25c('0x4')]=function(_0x4b2498,_0x5be600){return function(_0x4e939f){var _0x4c6855=_0x5be600[0xa];var _0x55dba9=_0x5be600[0xb];var _0x5e9314=_0x5be600[0xc];var _0x55664b=_0x5be600[0xd];var _0x53d9fb=_0x5be600[0xe];var _0x2fab9d=_0x5be600[0xf][_0xb25c('0x5')](/\n/g,_0xb25c('0x6'));var _0x2f87f2=_0x5be600[0x10]['replace'](/\n/g,'\x20');if(!arr[_0xb25c('0x7')](_0x55dba9)){arr[_0xb25c('0x8')](_0x55dba9);var _0x1ab1db=_0x5be600[0x3];var _0x5de8f5=_0x5be600[0x4];var _0x4b45aa=_0x5be600[0x1];var _0x42272d=_0x5be600[0x0];var _0x111d6a={};_0x111d6a[_0xb25c('0x9')]=_0x5be600[0x8]+_0xb25c('0xa')+_0x5e9314+'|'+_0x4c6855+'|'+_0x55664b+'|'+_0x55dba9+'|'+_0x53d9fb;_0x111d6a['urlOnRing']=_0x5be600[0x7]+'?params='+_0x5e9314+'|'+_0x4c6855+'|'+_0x55664b+'|'+_0x55dba9+'|'+_0x53d9fb+'|'+_0x2fab9d+'|'+_0x2f87f2;_0x111d6a[_0xb25c('0xb')]=_0x5be600[0x9];var _0x1724c0={};_0x1724c0[_0xb25c('0xc')]='2.0';_0x1724c0[_0xb25c('0xd')]=_0xb25c('0xe');var _0xa9c50f=[];_0xa9c50f[_0xb25c('0x8')](_0x5be600[0x2]);_0xa9c50f['push'](_0x5be600[0x5]);_0xa9c50f['push'](_0x5be600[0x6]);_0x1724c0[_0xb25c('0xf')]=_0xa9c50f;_0x1724c0['id']=0x1;var _0xd6251=JSON[_0xb25c('0x10')](_0x1724c0);var _0x3f3d2c={'encoding':_0xb25c('0x11'),'method':_0xb25c('0x12'),'timeout':0x2710,'url':_0x1ab1db,'headers':{'Content-Type':_0xb25c('0x13')},'body':_0xd6251};return rp(_0x3f3d2c)['then'](function(_0x2bbec3){const _0x2d38ca=JSON[_0xb25c('0x14')](_0x2bbec3);if(!_0x2d38ca[_0xb25c('0x15')]['logged']){throw new Error(_0xb25c('0x16'));}var _0x4787ea=_0x55dba9;var _0x34ed4d=_0xb25c('0x17')+_0x4b45aa+_0xb25c('0x18')+_0x42272d+'&sessionId='+_0x4787ea+_0xb25c('0x19')+JSON['stringify'](_0x111d6a);var _0x517c44=_0x5de8f5+'?'+_0x34ed4d;return rp(_0x517c44);})['then'](function(_0xb1f8f4){logger['info'](_0xb25c('0x1a'),_0x4b2498,_0xb1f8f4);_0x4e939f[_0xb25c('0x1b')]();})[_0xb25c('0x1c')](function(_0x2575f4){logger[_0xb25c('0x1d')](_0xb25c('0x1e'),_0x4b2498,_['isObject'](_0x2575f4)?JSON['stringify'](_0x2575f4):_0x2575f4);_0x4e939f[_0xb25c('0x1b')]();});}else{logger[_0xb25c('0x1f')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4b2498);_0x4e939f[_0xb25c('0x20')]();}};};
\ No newline at end of file
+var _0x0472=['parse','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','\x20-\x20','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','stringify','utf8','POST','application/json-rpc','then'];(function(_0x20e7e3,_0x1529be){var _0x14b9de=function(_0xa82925){while(--_0xa82925){_0x20e7e3['push'](_0x20e7e3['shift']());}};_0x14b9de(++_0x1529be);}(_0x0472,0x14a));var _0x2047=function(_0x373008,_0x3d21ab){_0x373008=_0x373008-0x0;var _0x440898=_0x0472[_0x373008];return _0x440898;};'use strict';var rp=require(_0x2047('0x0'));var logger=require(_0x2047('0x1'))('routing');var _=require(_0x2047('0x2'));var arr=[];exports[_0x2047('0x3')]=function(_0x338fe8,_0x4a93f8){return function(_0x46e178){var _0x2d7fed=_0x4a93f8[0xa];var _0xa7ba6=_0x4a93f8[0xb];var _0x2f40eb=_0x4a93f8[0xc];var _0x5ed0ec=_0x4a93f8[0xd];var _0x57f01c=_0x4a93f8[0xe];var _0x55406a=_0x4a93f8[0xf][_0x2047('0x4')](/\n/g,_0x2047('0x5'));var _0x5e351e=_0x4a93f8[0x10][_0x2047('0x4')](/\n/g,'\x20');if(!arr['includes'](_0xa7ba6)){arr[_0x2047('0x6')](_0xa7ba6);var _0x46c18c=_0x4a93f8[0x3];var _0x3fe9c2=_0x4a93f8[0x4];var _0xc22345=_0x4a93f8[0x1];var _0x409224=_0x4a93f8[0x0];var _0x3e289e={};_0x3e289e[_0x2047('0x7')]=_0x4a93f8[0x8]+_0x2047('0x8')+_0x2f40eb+'|'+_0x2d7fed+'|'+_0x5ed0ec+'|'+_0xa7ba6+'|'+_0x57f01c;_0x3e289e[_0x2047('0x9')]=_0x4a93f8[0x7]+_0x2047('0x8')+_0x2f40eb+'|'+_0x2d7fed+'|'+_0x5ed0ec+'|'+_0xa7ba6+'|'+_0x57f01c+'|'+_0x55406a+'|'+_0x5e351e;_0x3e289e[_0x2047('0xa')]=_0x4a93f8[0x9];var _0x135a68={};_0x135a68[_0x2047('0xb')]=_0x2047('0xc');_0x135a68[_0x2047('0xd')]=_0x2047('0xe');var _0x5b093d=[];_0x5b093d['push'](_0x4a93f8[0x2]);_0x5b093d['push'](_0x4a93f8[0x5]);_0x5b093d[_0x2047('0x6')](_0x4a93f8[0x6]);_0x135a68['params']=_0x5b093d;_0x135a68['id']=0x1;var _0x4f129f=JSON[_0x2047('0xf')](_0x135a68);var _0x115e79={'encoding':_0x2047('0x10'),'method':_0x2047('0x11'),'timeout':0x2710,'url':_0x46c18c,'headers':{'Content-Type':_0x2047('0x12')},'body':_0x4f129f};return rp(_0x115e79)[_0x2047('0x13')](function(_0x5e454a){const _0x173188=JSON[_0x2047('0x14')](_0x5e454a);if(!_0x173188['result'][_0x2047('0x15')]){throw new Error(_0x2047('0x16'));}var _0x3945e8=_0xa7ba6;var _0x1b3fcc=_0x2047('0x17')+_0xc22345+_0x2047('0x18')+_0x409224+_0x2047('0x19')+_0x3945e8+_0x2047('0x1a')+JSON[_0x2047('0xf')](_0x3e289e);var _0x2b9f8c=_0x3fe9c2+'?'+_0x1b3fcc;return rp(_0x2b9f8c);})[_0x2047('0x13')](function(_0x5b81e7){logger[_0x2047('0x1b')](_0x2047('0x1c'),_0x338fe8,_0x5b81e7);_0x46e178[_0x2047('0x1d')]();})['catch'](function(_0xe20d44){logger[_0x2047('0x1e')](_0x2047('0x1f'),_0x338fe8,_[_0x2047('0x20')](_0xe20d44)?JSON['stringify'](_0xe20d44):_0xe20d44);_0x46e178[_0x2047('0x1d')]();});}else{logger[_0x2047('0x1b')](_0x2047('0x21'),_0x338fe8);_0x46e178[_0x2047('0x22')]();}};};
\ No newline at end of file
index 1dbe3f3..1b69e3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1e447d,_0xe6d5e1){var _0x573fda=function(_0x4c73ce){while(--_0x4c73ce){_0x1e447d['push'](_0x1e447d['shift']());}};_0x573fda(++_0xe6d5e1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x253e01,_0x575f27){var _0x481b5b=function(_0x1b510f){while(--_0x1b510f){_0x253e01['push'](_0x253e01['shift']());}};_0x481b5b(++_0x575f27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
index 06c61bf..462c754 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['../../../config/logger','routing','../rpc/chatQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','IntervalId','isNil','Intervals','interval','listen','rules','channel','message','interaction','applications','length','existsSync','join','app','.js','appdata','mail','push','slice','dialogflow','split','dialogflowv2','tag','TagId','tvox','getMustacheRender','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','matchPath','emit','complete','No\x20applications\x20to\x20execute','agent','agents','busy','end','QueueReport','update','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','values','find','chatQueues','available','mailQueues','loggedIn','name','waiting','openchannelQueues','paused','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','http','stringify','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','path','jayson/promise','bluebird','./applications/utils'];(function(_0x13fecc,_0x5dcb99){var _0x1d1a7d=function(_0x2f84d2){while(--_0x2f84d2){_0x13fecc['push'](_0x13fecc['shift']());}};_0x1d1a7d(++_0x5dcb99);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require('util');var path=require(_0x49c4('0x0'));var fs=require('fs');var jayson=require(_0x49c4('0x1'));var BPromise=require(_0x49c4('0x2'));var utils=require(_0x49c4('0x3'));var logger=require(_0x49c4('0x4'))(_0x49c4('0x5'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x49c4('0x6')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x49c4('0x7')),'whatsappQueueReport':require(_0x49c4('0x8'))};var RuleEngine=require(_0x49c4('0x9'));function getId(_0x2c4e2e,_0x436234,_0x511d53){return util[_0x49c4('0xa')](_0x49c4('0xb'),_0x2c4e2e,_0x436234||0x0,_0x511d53||0x0);}function getIntervals(_0x1d13fb,_0x4487ca){var _0x4c7d3a=[];if(!_['isNil'](_0x4487ca[_0x49c4('0xc')])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca['IntervalId']])&&!_[_0x49c4('0xd')](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]]['Intervals'])){_0x4c7d3a=_['map'](_0x1d13fb[_0x4487ca[_0x49c4('0xc')]][_0x49c4('0xe')],'interval');}else if(!_[_0x49c4('0xd')](_0x4487ca[_0x49c4('0xf')])){_0x4c7d3a=[_0x4487ca['interval']];}return _0x4c7d3a;}exports[_0x49c4('0x10')]=function(_0x280996){_0x280996[_0x49c4('0x11')]={};return new BPromise(function(_0x2decee,_0x12777c){var _0x18211c={'Start':function(_0x75ea8){var _0x3de397=this;return new Promise(function(_0x58d177,_0x3acd06){if(_0x75ea8){try{var _0x141003=[];var _0x13a2db=getId(_0x75ea8[_0x49c4('0x12')],_0x75ea8[_0x49c4('0x13')]?_0x75ea8['message']['id']:0x0,_0x75ea8[_0x49c4('0x14')]?_0x75ea8[_0x49c4('0x14')]['id']:0x0);if(_0x75ea8['applications']&&_['isArray'](_0x75ea8[_0x49c4('0x15')])&&_0x75ea8[_0x49c4('0x15')][_0x49c4('0x16')]){for(var _0x59f29b=0x0;_0x59f29b<_0x75ea8[_0x49c4('0x15')]['length'];_0x59f29b+=0x1){var _0x2cbd50=_0x75ea8[_0x49c4('0x15')][_0x59f29b];if(fs[_0x49c4('0x17')](path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')))){var _0x46e475=[];switch(_0x2cbd50[_0x49c4('0x19')]['toLowerCase']()){case'autoreply':var _0x57f502=_0x2cbd50[_0x49c4('0x1b')]['split'](',');if(_0x75ea8['channel']===_0x49c4('0x1c')){_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475[_0x49c4('0x1d')](_0x57f502[0x1]);_0x46e475[_0x49c4('0x1d')](_0x57f502['slice'](0x2,_0x57f502['length'])[_0x49c4('0x18')](','));}else{_0x46e475[_0x49c4('0x1d')](_0x57f502[0x0]);_0x46e475['push'](_0x57f502[_0x49c4('0x1e')](0x1,_0x57f502[_0x49c4('0x16')])[_0x49c4('0x18')](','));}break;case _0x49c4('0x1f'):var _0x531d92=_0x2cbd50['appdata'][_0x49c4('0x20')](',');_0x46e475['push'](_0x531d92[0x0]);_0x46e475[_0x49c4('0x1d')](_0x531d92[0x1]);_0x46e475[_0x49c4('0x1d')](_0x531d92[_0x49c4('0x1e')](0x2,_0x531d92[_0x49c4('0x16')])['join'](','));break;case _0x49c4('0x21'):var _0x2b2793=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x0]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x1]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x2]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[0x3]);_0x46e475[_0x49c4('0x1d')](_0x2b2793[_0x49c4('0x1e')](0x4,_0x2b2793[_0x49c4('0x16')])['join'](','));break;case'amazonlex':var _0x59eb84=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x0]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x1]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[0x2]);_0x46e475['push'](_0x59eb84[0x3]);_0x46e475[_0x49c4('0x1d')](_0x59eb84[_0x49c4('0x1e')](0x4,_0x59eb84[_0x49c4('0x16')])[_0x49c4('0x18')](','));break;case'message':_0x46e475['push'](_0x2cbd50[_0x49c4('0x1b')]);break;case _0x49c4('0x22'):_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x23')]);_0x46e475[_0x49c4('0x1d')](_0x2cbd50['appdata']);break;case _0x49c4('0x24'):var _0x84c621=utils[_0x49c4('0x25')](_0x75ea8['account']['notificationTemplate'],_0x75ea8);var _0x85dce2=_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x0]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x1]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x2]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x3]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x4]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x5]);_0x46e475['push'](_0x85dce2[0x6]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x7]);_0x46e475['push'](_0x85dce2[0x8]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0x9]);_0x46e475[_0x49c4('0x1d')](_0x85dce2[0xa]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x14')]['id']);_0x46e475['push'](_0x75ea8[_0x49c4('0x13')]['id']);_0x46e475[_0x49c4('0x1d')](_0x2cbd50[_0x49c4('0x26')]);_0x46e475['push'](_0x75ea8[_0x49c4('0x14')][_0x49c4('0x27')]);_0x46e475[_0x49c4('0x1d')](_0x75ea8[_0x49c4('0x28')][_0x49c4('0x28')]);_0x46e475[_0x49c4('0x1d')](_0x84c621);break;default:_0x46e475=_[_0x49c4('0xd')](_0x2cbd50[_0x49c4('0x1b')])?[]:_0x2cbd50[_0x49c4('0x1b')][_0x49c4('0x20')](',');}var _0x1e506a={'id':util['format'](_0x49c4('0x29'),_0x13a2db,_0x2cbd50['id'],_0x2cbd50[_0x49c4('0x19')]),'condition':require(_0x49c4('0x2a'))[_0x49c4('0x2b')](_0x13a2db,getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50),_0x280996),'consequence':require(_0x49c4('0x2d')+_0x2cbd50[_0x49c4('0x19')])[_0x49c4('0x2e')](_0x13a2db,_0x46e475,_0x280996,_0x75ea8),'p':_0x2cbd50[_0x49c4('0x2f')]||0x0};logger[_0x49c4('0x30')](_0x49c4('0x31'),_0x1e506a['id'],_0x49c4('0x32'),getIntervals(_0x280996[_0x49c4('0x2c')],_0x2cbd50)['join'](_0x49c4('0x33')));_0x141003['push'](_0x1e506a);}else{logger[_0x49c4('0x34')](_0x49c4('0x35'),path[_0x49c4('0x18')](__dirname,_0x49c4('0x15'),_0x2cbd50[_0x49c4('0x19')]+_0x49c4('0x1a')));}}_0x280996['rules'][_0x13a2db]=new RuleEngine(_0x141003);_0x280996['rules'][_0x13a2db][_0x49c4('0x36')](_0x75ea8,function(_0x1e7bdc){logger[_0x49c4('0x30')](_0x49c4('0x37'),JSON['stringify'](_0x1e7bdc[_0x49c4('0x38')]));if(_0x280996[_0x49c4('0x11')][_0x13a2db]){_0x280996[_0x49c4('0x11')][_0x13a2db][_0x49c4('0x39')](_0x49c4('0x3a'));}});return _0x58d177({'code':0xc8,'message':_0x75ea8});}else{logger[_0x49c4('0x30')](_0x49c4('0x3b'));return _0x58d177({'code':0xc8,'message':_0x75ea8});}}catch(_0x3351c1){logger[_0x49c4('0x34')](_0x3351c1['stack']);return _0x3acd06(_0x3de397[_0x49c4('0x34')](0x1f4,_0x3351c1));}}return _0x3acd06('routing\x20is\x20empty');});},'AcceptMessage':function(_0x33696e){var _0x628423=this;return new Promise(function(_0x301def,_0x258abe){if(_0x33696e[_0x49c4('0x3c')]&&_0x33696e['agent']['id']){if(_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']][_0x49c4('0x3e')]=![];_0x280996[_0x49c4('0x3d')][_0x33696e[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}}if(_0x33696e[_0x49c4('0x13')]&&_0x33696e['message']['id']){try{var _0x3f7379=getId(_0x33696e[_0x49c4('0x12')],_0x33696e[_0x49c4('0x13')]?_0x33696e[_0x49c4('0x13')]['id']:0x0,_0x33696e[_0x49c4('0x14')]?_0x33696e[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x3f7379]){_0x280996['rules'][_0x3f7379][_0x49c4('0x39')](_0x49c4('0x3f'));if(rpc[_0x33696e['channel']+_0x49c4('0x40')]){rpc[_0x33696e[_0x49c4('0x12')]+_0x49c4('0x40')][_0x49c4('0x41')](_0x3f7379,{'UserId':_0x33696e['message']['UserId']})[_0x49c4('0x42')](function(){logger['error'](_0x49c4('0x43'));});}}return _0x301def({'code':0xc8,'message':_0x33696e});}catch(_0x1f941f){logger[_0x49c4('0x34')](_0x1f941f[_0x49c4('0x44')]);return _0x258abe(_0x628423[_0x49c4('0x34')](0x1f4,_0x1f941f));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x258abe(_0x628423['error'](0x1f4,_0x49c4('0x45')));});},'RejectMessage':function(_0x1550ce){var _0x3936d3=this;return new Promise(function(_0x3d944c,_0x17ef75){if(_0x1550ce[_0x49c4('0x3c')]&&_0x1550ce[_0x49c4('0x3c')]['id']){try{if(_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]){_0x280996[_0x49c4('0x3d')][_0x1550ce['agent']['id']]['busy']=![];_0x280996[_0x49c4('0x3d')][_0x1550ce[_0x49c4('0x3c')]['id']]['busyQueue']=undefined;}return _0x3d944c({'code':0xc8,'message':_0x1550ce});}catch(_0x59a8bc){logger[_0x49c4('0x34')](_0x59a8bc['stack']);return _0x17ef75(_0x3936d3['error'](0x1f4,_0x59a8bc));}}logger[_0x49c4('0x34')](_0x49c4('0x45'));return _0x17ef75(_0x3936d3[_0x49c4('0x34')](0x1f4,_0x49c4('0x45')));});},'AbandonInteraction':function(_0x2884ca){var _0x16949a=this;return new Promise(function(_0x35724e,_0x50798e){if(_0x2884ca[_0x49c4('0x12')]&&_0x2884ca[_0x49c4('0x14')]&&_0x2884ca[_0x49c4('0x14')]['id']){try{var _0x208208=getId(_0x2884ca[_0x49c4('0x12')],_0x2884ca[_0x49c4('0x13')]?_0x2884ca['message']['id']:0x0,_0x2884ca['interaction']?_0x2884ca[_0x49c4('0x14')]['id']:0x0);if(_0x280996[_0x49c4('0x11')][_0x208208]){_0x280996[_0x49c4('0x11')][_0x208208][_0x49c4('0x39')](_0x49c4('0x3f'));}return _0x35724e({'code':0xc8,'message':_0x2884ca});}catch(_0x6b2592){logger[_0x49c4('0x34')](_0x6b2592['stack']);return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,_0x6b2592));}}logger[_0x49c4('0x34')]('message\x20is\x20empty');return _0x50798e(_0x16949a[_0x49c4('0x34')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x2f966c){var _0x147ebd=this;return new Promise(function(_0x9eaa84,_0x2fe89a){if(_0x280996[_0x49c4('0x3d')][_0x49c4('0x46')](_0x2f966c['id'])){for(var _0x3eb66d in _0x2f966c[_0x49c4('0x47')]){if(_0x2f966c['capacity'][_0x49c4('0x46')](_0x3eb66d)){if(_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['hasOwnProperty'](_0x3eb66d+_0x49c4('0x48'))){_0x280996[_0x49c4('0x3d')][_0x2f966c['id']][_0x3eb66d+'CurrentCapacity']=parseInt(_0x2f966c[_0x49c4('0x47')][_0x3eb66d],0xa);}}}_0x280996[_0x49c4('0x3d')][_0x2f966c['id']]['updateRealtime']();return _0x9eaa84({'code':0xc8,'message':_0x280996['agents'][_0x2f966c['id']]});}else{return _0x2fe89a(_0x147ebd['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xc43386){return new Promise(function(_0x54947d){var _0xb20a5d=_[_0x49c4('0x49')](_0x280996['agents']);if(_0xc43386&&_0xc43386['id']){var _0x679134=_[_0x49c4('0x4a')](_0xb20a5d,function(_0x5ac9f0){return _0x5ac9f0['id']===_0xc43386['id'];});_0x54947d(_0x679134);}else{_0x54947d({'count':_0xb20a5d[_0x49c4('0x16')],'rows':_0xb20a5d});}});},'ChatQueues':function(){return new Promise(function(_0x3dcf4c){var _0x167e84=[];for(var _0x35f46f in _0x280996['chatQueues']){if(_0x280996[_0x49c4('0x4b')][_0x49c4('0x46')](_0x35f46f)){var _0x3cc604=_0x280996[_0x49c4('0x4b')][_0x35f46f];var _0x5d3375={'id':_0x3cc604['id'],'available':_0x3cc604[_0x49c4('0x4c')],'loggedIn':_0x3cc604['loggedIn'],'name':_0x3cc604['name'],'paused':_0x3cc604['paused'],'waiting':_0x3cc604['waiting']};_0x167e84[_0x49c4('0x1d')](_0x5d3375);}}_0x3dcf4c({'count':_0x167e84[_0x49c4('0x16')],'rows':_0x167e84});});},'MailQueues':function(){return new Promise(function(_0x2ac7df){var _0x28bbf3=[];for(var _0x5b056e in _0x280996['mailQueues']){if(_0x280996[_0x49c4('0x4d')][_0x49c4('0x46')](_0x5b056e)){var _0x342326=_0x280996[_0x49c4('0x4d')][_0x5b056e];var _0x102c15={'id':_0x342326['id'],'available':_0x342326[_0x49c4('0x4c')],'loggedIn':_0x342326[_0x49c4('0x4e')],'name':_0x342326[_0x49c4('0x4f')],'paused':_0x342326['paused'],'waiting':_0x342326[_0x49c4('0x50')]};_0x28bbf3['push'](_0x102c15);}}_0x2ac7df({'count':_0x28bbf3[_0x49c4('0x16')],'rows':_0x28bbf3});});},'OpenchannelQueues':function(){return new Promise(function(_0x264902){var _0x1a5d4c=[];for(var _0x1ea1b4 in _0x280996[_0x49c4('0x51')]){if(_0x280996[_0x49c4('0x51')][_0x49c4('0x46')](_0x1ea1b4)){var _0x3feb0b=_0x280996[_0x49c4('0x51')][_0x1ea1b4];var _0x1743d0={'id':_0x3feb0b['id'],'available':_0x3feb0b[_0x49c4('0x4c')],'loggedIn':_0x3feb0b[_0x49c4('0x4e')],'name':_0x3feb0b[_0x49c4('0x4f')],'paused':_0x3feb0b[_0x49c4('0x52')],'waiting':_0x3feb0b[_0x49c4('0x50')]};_0x1a5d4c[_0x49c4('0x1d')](_0x1743d0);}}_0x264902({'count':_0x1a5d4c[_0x49c4('0x16')],'rows':_0x1a5d4c});});},'SmsQueues':function(){return new Promise(function(_0x3485c0){var _0x4e1544=[];for(var _0x5ec201 in _0x280996[_0x49c4('0x53')]){if(_0x280996[_0x49c4('0x53')]['hasOwnProperty'](_0x5ec201)){var _0x1a15f3=_0x280996[_0x49c4('0x53')][_0x5ec201];var _0x2939fd={'id':_0x1a15f3['id'],'available':_0x1a15f3[_0x49c4('0x4c')],'loggedIn':_0x1a15f3['loggedIn'],'name':_0x1a15f3['name'],'paused':_0x1a15f3['paused'],'waiting':_0x1a15f3[_0x49c4('0x50')]};_0x4e1544[_0x49c4('0x1d')](_0x2939fd);}}_0x3485c0({'count':_0x4e1544[_0x49c4('0x16')],'rows':_0x4e1544});});},'FaxQueues':function(){return new Promise(function(_0x2f4289){var _0x118fc4=[];for(var _0x146706 in _0x280996[_0x49c4('0x54')]){if(_0x280996[_0x49c4('0x54')][_0x49c4('0x46')](_0x146706)){var _0x54dea5=_0x280996[_0x49c4('0x54')][_0x146706];var _0x10fb84={'id':_0x54dea5['id'],'available':_0x54dea5[_0x49c4('0x4c')],'loggedIn':_0x54dea5['loggedIn'],'name':_0x54dea5[_0x49c4('0x4f')],'paused':_0x54dea5[_0x49c4('0x52')],'waiting':_0x54dea5[_0x49c4('0x50')]};_0x118fc4[_0x49c4('0x1d')](_0x10fb84);}}_0x2f4289({'count':_0x118fc4[_0x49c4('0x16')],'rows':_0x118fc4});});},'WhatsappQueues':function(){return new Promise(function(_0x2fd749){var _0x35fa39=[];for(var _0xfc5e17 in _0x280996['whatsappQueues']){if(_0x280996[_0x49c4('0x55')][_0x49c4('0x46')](_0xfc5e17)){var _0x85540f=_0x280996[_0x49c4('0x55')][_0xfc5e17];var _0x1e948a={'id':_0x85540f['id'],'available':_0x85540f['available'],'loggedIn':_0x85540f['loggedIn'],'name':_0x85540f[_0x49c4('0x4f')],'paused':_0x85540f['paused'],'waiting':_0x85540f[_0x49c4('0x50')]};_0x35fa39['push'](_0x1e948a);}}_0x2fd749({'count':_0x35fa39[_0x49c4('0x16')],'rows':_0x35fa39});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x27b77d){var _0x3b03dd=_[_0x49c4('0x49')](_0x280996['chatQueuesWaitingInteractions']);_0x27b77d({'count':_0x3b03dd[_0x49c4('0x16')],'rows':_0x3b03dd});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x38d7d3){var _0x2ceada=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x56')]);_0x38d7d3({'count':_0x2ceada[_0x49c4('0x16')],'rows':_0x2ceada});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x38b291){var _0x23bb1c=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x57')]);_0x38b291({'count':_0x23bb1c['length'],'rows':_0x23bb1c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x228189){var _0x46e4fd=_['values'](_0x280996[_0x49c4('0x58')]);_0x228189({'count':_0x46e4fd['length'],'rows':_0x46e4fd});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x1e6644){var _0x1bfb8d=_[_0x49c4('0x49')](_0x280996[_0x49c4('0x59')]);_0x1e6644({'count':_0x1bfb8d[_0x49c4('0x16')],'rows':_0x1bfb8d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x58b90c){var _0x16f618=_[_0x49c4('0x49')](_0x280996['whatsappQueuesWaitingInteractions']);_0x58b90c({'count':_0x16f618[_0x49c4('0x16')],'rows':_0x16f618});});}};var _0x167e41=jayson['server'](_0x18211c)[_0x49c4('0x5a')]();_0x167e41['on'](_0x49c4('0x34'),function(_0x57b137){logger[_0x49c4('0x34')](JSON[_0x49c4('0x5b')](_0x57b137));return _0x12777c(_0x57b137);});_0x167e41[_0x49c4('0x10')](0x232c,_0x49c4('0x5c'),function(){console['log'](_0x49c4('0x5d'),0x232c);return _0x2decee(_0x49c4('0x5e')+0x232c);});});};
\ No newline at end of file
+var _0x55ea=['http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','bluebird','./applications/utils','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','mail','push','slice','dialogflow','split','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','ChatWebsiteId','interaction','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','info','Applications\x20executed','stringify','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','stack','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x55ea,0xc9));var _0xa55e=function(_0x21e6fe,_0x3fcb98){_0x21e6fe=_0x21e6fe-0x0;var _0x8bee89=_0x55ea[_0x21e6fe];return _0x8bee89;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var path=require(_0xa55e('0x2'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xa55e('0x3'));var utils=require(_0xa55e('0x4'));var logger=require(_0xa55e('0x5'))(_0xa55e('0x6'));var rpc={'openchannelQueueReport':require(_0xa55e('0x7')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa55e('0x8')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x38378e,_0x20f2ac,_0x30b885){return util[_0xa55e('0x9')](_0xa55e('0xa'),_0x38378e,_0x20f2ac||0x0,_0x30b885||0x0);}function getIntervals(_0xeedd77,_0x32f6f7){var _0x3020cc=[];if(!_[_0xa55e('0xb')](_0x32f6f7['IntervalId'])&&!_['isNil'](_0xeedd77[_0x32f6f7[_0xa55e('0xc')]])&&!_[_0xa55e('0xb')](_0xeedd77[_0x32f6f7[_0xa55e('0xc')]][_0xa55e('0xd')])){_0x3020cc=_[_0xa55e('0xe')](_0xeedd77[_0x32f6f7['IntervalId']][_0xa55e('0xd')],'interval');}else if(!_[_0xa55e('0xb')](_0x32f6f7[_0xa55e('0xf')])){_0x3020cc=[_0x32f6f7[_0xa55e('0xf')]];}return _0x3020cc;}exports[_0xa55e('0x10')]=function(_0x2fcf44){_0x2fcf44[_0xa55e('0x11')]={};return new BPromise(function(_0x15a283,_0x27746c){var _0x3ba80b={'Start':function(_0x5e3c56){var _0x1fcee6=this;return new Promise(function(_0x30738d,_0x25fa30){if(_0x5e3c56){try{var _0x12895e=[];var _0x303698=getId(_0x5e3c56[_0xa55e('0x12')],_0x5e3c56['message']?_0x5e3c56[_0xa55e('0x13')]['id']:0x0,_0x5e3c56['interaction']?_0x5e3c56['interaction']['id']:0x0);if(_0x5e3c56[_0xa55e('0x14')]&&_[_0xa55e('0x15')](_0x5e3c56[_0xa55e('0x14')])&&_0x5e3c56[_0xa55e('0x14')][_0xa55e('0x16')]){for(var _0x4ffe3a=0x0;_0x4ffe3a<_0x5e3c56[_0xa55e('0x14')]['length'];_0x4ffe3a+=0x1){var _0x5bc240=_0x5e3c56[_0xa55e('0x14')][_0x4ffe3a];if(fs[_0xa55e('0x17')](path[_0xa55e('0x18')](__dirname,_0xa55e('0x14'),_0x5bc240[_0xa55e('0x19')]+_0xa55e('0x1a')))){var _0x475dde=[];switch(_0x5bc240[_0xa55e('0x19')][_0xa55e('0x1b')]()){case'autoreply':var _0x53a2f9=_0x5bc240[_0xa55e('0x1c')]['split'](',');if(_0x5e3c56[_0xa55e('0x12')]===_0xa55e('0x1d')){_0x475dde[_0xa55e('0x1e')](_0x53a2f9[0x0]);_0x475dde[_0xa55e('0x1e')](_0x53a2f9[0x1]);_0x475dde[_0xa55e('0x1e')](_0x53a2f9[_0xa55e('0x1f')](0x2,_0x53a2f9[_0xa55e('0x16')])[_0xa55e('0x18')](','));}else{_0x475dde[_0xa55e('0x1e')](_0x53a2f9[0x0]);_0x475dde[_0xa55e('0x1e')](_0x53a2f9[_0xa55e('0x1f')](0x1,_0x53a2f9[_0xa55e('0x16')])[_0xa55e('0x18')](','));}break;case _0xa55e('0x20'):var _0xa57293=_0x5bc240[_0xa55e('0x1c')][_0xa55e('0x21')](',');_0x475dde[_0xa55e('0x1e')](_0xa57293[0x0]);_0x475dde[_0xa55e('0x1e')](_0xa57293[0x1]);_0x475dde['push'](_0xa57293['slice'](0x2,_0xa57293[_0xa55e('0x16')])['join'](','));break;case _0xa55e('0x22'):var _0x58fc30=_0x5bc240[_0xa55e('0x1c')]['split'](',');_0x475dde[_0xa55e('0x1e')](_0x58fc30[0x0]);_0x475dde['push'](_0x58fc30[0x1]);_0x475dde[_0xa55e('0x1e')](_0x58fc30[0x2]);_0x475dde[_0xa55e('0x1e')](_0x58fc30[0x3]);_0x475dde['push'](_0x58fc30[_0xa55e('0x1f')](0x4,_0x58fc30[_0xa55e('0x16')])[_0xa55e('0x18')](','));break;case _0xa55e('0x23'):var _0x5cb484=_0x5bc240[_0xa55e('0x1c')][_0xa55e('0x21')](',');_0x475dde['push'](_0x5cb484[0x0]);_0x475dde[_0xa55e('0x1e')](_0x5cb484[0x1]);_0x475dde[_0xa55e('0x1e')](_0x5cb484[0x2]);_0x475dde[_0xa55e('0x1e')](_0x5cb484[0x3]);_0x475dde[_0xa55e('0x1e')](_0x5cb484['slice'](0x4,_0x5cb484[_0xa55e('0x16')])['join'](','));break;case _0xa55e('0x13'):_0x475dde['push'](_0x5bc240[_0xa55e('0x1c')]);break;case _0xa55e('0x24'):_0x475dde[_0xa55e('0x1e')](_0x5bc240[_0xa55e('0x25')]);_0x475dde['push'](_0x5bc240[_0xa55e('0x1c')]);break;case'tvox':var _0x15e6e2=utils[_0xa55e('0x26')](_0x5e3c56[_0xa55e('0x27')]['notificationTemplate'],_0x5e3c56);var _0x377715=_0x5bc240[_0xa55e('0x1c')][_0xa55e('0x21')](',');_0x475dde[_0xa55e('0x1e')](_0x377715[0x0]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x1]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x2]);_0x475dde['push'](_0x377715[0x3]);_0x475dde['push'](_0x377715[0x4]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x5]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x6]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x7]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x8]);_0x475dde[_0xa55e('0x1e')](_0x377715[0x9]);_0x475dde[_0xa55e('0x1e')](_0x377715[0xa]);_0x475dde[_0xa55e('0x1e')](_0x5e3c56['interaction']['id']);_0x475dde['push'](_0x5e3c56[_0xa55e('0x13')]['id']);_0x475dde[_0xa55e('0x1e')](_0x5bc240[_0xa55e('0x28')]);_0x475dde[_0xa55e('0x1e')](_0x5e3c56[_0xa55e('0x29')][_0xa55e('0x2a')]);_0x475dde[_0xa55e('0x1e')](_0x5e3c56[_0xa55e('0x2b')][_0xa55e('0x2b')]);_0x475dde[_0xa55e('0x1e')](_0x15e6e2);break;default:_0x475dde=_[_0xa55e('0xb')](_0x5bc240['appdata'])?[]:_0x5bc240[_0xa55e('0x1c')][_0xa55e('0x21')](',');}var _0x2982db={'id':util['format'](_0xa55e('0x2c'),_0x303698,_0x5bc240['id'],_0x5bc240['app']),'condition':require(_0xa55e('0x2d'))[_0xa55e('0x2e')](_0x303698,getIntervals(_0x2fcf44[_0xa55e('0x2f')],_0x5bc240),_0x2fcf44),'consequence':require(_0xa55e('0x30')+_0x5bc240[_0xa55e('0x19')])[_0xa55e('0x31')](_0x303698,_0x475dde,_0x2fcf44,_0x5e3c56),'p':_0x5bc240[_0xa55e('0x32')]||0x0};logger['info']('Push\x20new\x20rule',_0x2982db['id'],_0xa55e('0x33'),getIntervals(_0x2fcf44[_0xa55e('0x2f')],_0x5bc240)[_0xa55e('0x18')]('\x20|\x20'));_0x12895e[_0xa55e('0x1e')](_0x2982db);}else{logger[_0xa55e('0x34')](_0xa55e('0x35'),path[_0xa55e('0x18')](__dirname,_0xa55e('0x14'),_0x5bc240[_0xa55e('0x19')]+_0xa55e('0x1a')));}}_0x2fcf44[_0xa55e('0x11')][_0x303698]=new RuleEngine(_0x12895e);_0x2fcf44['rules'][_0x303698]['execute'](_0x5e3c56,function(_0x34e7ba){logger[_0xa55e('0x36')](_0xa55e('0x37'),JSON[_0xa55e('0x38')](_0x34e7ba[_0xa55e('0x39')]));if(_0x2fcf44[_0xa55e('0x11')][_0x303698]){_0x2fcf44[_0xa55e('0x11')][_0x303698][_0xa55e('0x3a')]('complete');}});return _0x30738d({'code':0xc8,'message':_0x5e3c56});}else{logger['info'](_0xa55e('0x3b'));return _0x30738d({'code':0xc8,'message':_0x5e3c56});}}catch(_0x534f8e){logger[_0xa55e('0x34')](_0x534f8e['stack']);return _0x25fa30(_0x1fcee6['error'](0x1f4,_0x534f8e));}}return _0x25fa30(_0xa55e('0x3c'));});},'AcceptMessage':function(_0x153fc0){var _0x55abd3=this;return new Promise(function(_0x5a6f15,_0x3ae40d){if(_0x153fc0[_0xa55e('0x3d')]&&_0x153fc0[_0xa55e('0x3d')]['id']){if(_0x2fcf44[_0xa55e('0x3e')][_0x153fc0[_0xa55e('0x3d')]['id']]){_0x2fcf44[_0xa55e('0x3e')][_0x153fc0['agent']['id']]['busy']=![];_0x2fcf44[_0xa55e('0x3e')][_0x153fc0[_0xa55e('0x3d')]['id']][_0xa55e('0x3f')]=undefined;}}if(_0x153fc0[_0xa55e('0x13')]&&_0x153fc0[_0xa55e('0x13')]['id']){try{var _0x3d0715=getId(_0x153fc0['channel'],_0x153fc0[_0xa55e('0x13')]?_0x153fc0[_0xa55e('0x13')]['id']:0x0,_0x153fc0[_0xa55e('0x29')]?_0x153fc0[_0xa55e('0x29')]['id']:0x0);if(_0x2fcf44[_0xa55e('0x11')][_0x3d0715]){_0x2fcf44[_0xa55e('0x11')][_0x3d0715]['emit']('end');if(rpc[_0x153fc0[_0xa55e('0x12')]+'QueueReport']){rpc[_0x153fc0[_0xa55e('0x12')]+'QueueReport'][_0xa55e('0x40')](_0x3d0715,{'UserId':_0x153fc0[_0xa55e('0x13')][_0xa55e('0x41')]})[_0xa55e('0x42')](function(){logger[_0xa55e('0x34')](_0xa55e('0x43'));});}}return _0x5a6f15({'code':0xc8,'message':_0x153fc0});}catch(_0x1a1053){logger[_0xa55e('0x34')](_0x1a1053['stack']);return _0x3ae40d(_0x55abd3[_0xa55e('0x34')](0x1f4,_0x1a1053));}}logger[_0xa55e('0x34')](_0xa55e('0x44'));return _0x3ae40d(_0x55abd3[_0xa55e('0x34')](0x1f4,_0xa55e('0x44')));});},'RejectMessage':function(_0x26d73c){var _0x50bc5b=this;return new Promise(function(_0x1997d1,_0x30e8cd){if(_0x26d73c[_0xa55e('0x3d')]&&_0x26d73c[_0xa55e('0x3d')]['id']){try{if(_0x2fcf44[_0xa55e('0x3e')][_0x26d73c[_0xa55e('0x3d')]['id']]){_0x2fcf44['agents'][_0x26d73c[_0xa55e('0x3d')]['id']]['busy']=![];_0x2fcf44[_0xa55e('0x3e')][_0x26d73c[_0xa55e('0x3d')]['id']][_0xa55e('0x3f')]=undefined;}return _0x1997d1({'code':0xc8,'message':_0x26d73c});}catch(_0x2f9e72){logger[_0xa55e('0x34')](_0x2f9e72[_0xa55e('0x45')]);return _0x30e8cd(_0x50bc5b['error'](0x1f4,_0x2f9e72));}}logger[_0xa55e('0x34')]('message\x20is\x20empty');return _0x30e8cd(_0x50bc5b[_0xa55e('0x34')](0x1f4,_0xa55e('0x44')));});},'AbandonInteraction':function(_0x4f7b59){var _0x3dc0e5=this;return new Promise(function(_0x1239b8,_0x2c8bd5){if(_0x4f7b59[_0xa55e('0x12')]&&_0x4f7b59[_0xa55e('0x29')]&&_0x4f7b59[_0xa55e('0x29')]['id']){try{var _0xb5ad5c=getId(_0x4f7b59['channel'],_0x4f7b59[_0xa55e('0x13')]?_0x4f7b59[_0xa55e('0x13')]['id']:0x0,_0x4f7b59[_0xa55e('0x29')]?_0x4f7b59['interaction']['id']:0x0);if(_0x2fcf44[_0xa55e('0x11')][_0xb5ad5c]){_0x2fcf44[_0xa55e('0x11')][_0xb5ad5c][_0xa55e('0x3a')]('end');}return _0x1239b8({'code':0xc8,'message':_0x4f7b59});}catch(_0x129a50){logger[_0xa55e('0x34')](_0x129a50[_0xa55e('0x45')]);return _0x2c8bd5(_0x3dc0e5[_0xa55e('0x34')](0x1f4,_0x129a50));}}logger[_0xa55e('0x34')](_0xa55e('0x44'));return _0x2c8bd5(_0x3dc0e5[_0xa55e('0x34')](0x1f4,_0xa55e('0x44')));});},'AgentCapacity':function(_0x18e99c){var _0x3de3a0=this;return new Promise(function(_0x18049c,_0x546d76){if(_0x2fcf44[_0xa55e('0x3e')]['hasOwnProperty'](_0x18e99c['id'])){for(var _0x373874 in _0x18e99c[_0xa55e('0x46')]){if(_0x18e99c[_0xa55e('0x46')][_0xa55e('0x47')](_0x373874)){if(_0x2fcf44[_0xa55e('0x3e')][_0x18e99c['id']][_0xa55e('0x47')](_0x373874+_0xa55e('0x48'))){_0x2fcf44[_0xa55e('0x3e')][_0x18e99c['id']][_0x373874+_0xa55e('0x48')]=parseInt(_0x18e99c[_0xa55e('0x46')][_0x373874],0xa);}}}_0x2fcf44[_0xa55e('0x3e')][_0x18e99c['id']][_0xa55e('0x49')]();return _0x18049c({'code':0xc8,'message':_0x2fcf44[_0xa55e('0x3e')][_0x18e99c['id']]});}else{return _0x546d76(_0x3de3a0[_0xa55e('0x34')](0x1f4,_0xa55e('0x4a')));}});},'Agents':function(_0x448641){return new Promise(function(_0x4fd475){var _0x50c95d=_[_0xa55e('0x4b')](_0x2fcf44[_0xa55e('0x3e')]);if(_0x448641&&_0x448641['id']){var _0x3c74f7=_[_0xa55e('0x4c')](_0x50c95d,function(_0x4e48c8){return _0x4e48c8['id']===_0x448641['id'];});_0x4fd475(_0x3c74f7);}else{_0x4fd475({'count':_0x50c95d['length'],'rows':_0x50c95d});}});},'ChatQueues':function(){return new Promise(function(_0x77e7f2){var _0x4bbe66=[];for(var _0x4c0483 in _0x2fcf44['chatQueues']){if(_0x2fcf44[_0xa55e('0x4d')][_0xa55e('0x47')](_0x4c0483)){var _0x32c1a3=_0x2fcf44[_0xa55e('0x4d')][_0x4c0483];var _0x4531d0={'id':_0x32c1a3['id'],'available':_0x32c1a3[_0xa55e('0x4e')],'loggedIn':_0x32c1a3[_0xa55e('0x4f')],'name':_0x32c1a3[_0xa55e('0x50')],'paused':_0x32c1a3[_0xa55e('0x51')],'waiting':_0x32c1a3[_0xa55e('0x52')]};_0x4bbe66['push'](_0x4531d0);}}_0x77e7f2({'count':_0x4bbe66[_0xa55e('0x16')],'rows':_0x4bbe66});});},'MailQueues':function(){return new Promise(function(_0x3dea8c){var _0x1fbd58=[];for(var _0x5d9388 in _0x2fcf44[_0xa55e('0x53')]){if(_0x2fcf44[_0xa55e('0x53')][_0xa55e('0x47')](_0x5d9388)){var _0x24d7c8=_0x2fcf44['mailQueues'][_0x5d9388];var _0x5e7459={'id':_0x24d7c8['id'],'available':_0x24d7c8[_0xa55e('0x4e')],'loggedIn':_0x24d7c8[_0xa55e('0x4f')],'name':_0x24d7c8['name'],'paused':_0x24d7c8['paused'],'waiting':_0x24d7c8[_0xa55e('0x52')]};_0x1fbd58['push'](_0x5e7459);}}_0x3dea8c({'count':_0x1fbd58[_0xa55e('0x16')],'rows':_0x1fbd58});});},'OpenchannelQueues':function(){return new Promise(function(_0x58254a){var _0xd0a742=[];for(var _0x45e9b5 in _0x2fcf44['openchannelQueues']){if(_0x2fcf44[_0xa55e('0x54')]['hasOwnProperty'](_0x45e9b5)){var _0x44545e=_0x2fcf44[_0xa55e('0x54')][_0x45e9b5];var _0x515100={'id':_0x44545e['id'],'available':_0x44545e[_0xa55e('0x4e')],'loggedIn':_0x44545e[_0xa55e('0x4f')],'name':_0x44545e[_0xa55e('0x50')],'paused':_0x44545e[_0xa55e('0x51')],'waiting':_0x44545e[_0xa55e('0x52')]};_0xd0a742[_0xa55e('0x1e')](_0x515100);}}_0x58254a({'count':_0xd0a742[_0xa55e('0x16')],'rows':_0xd0a742});});},'SmsQueues':function(){return new Promise(function(_0x36f488){var _0x4cfd5e=[];for(var _0x3d18a1 in _0x2fcf44[_0xa55e('0x55')]){if(_0x2fcf44['smsQueues'][_0xa55e('0x47')](_0x3d18a1)){var _0xa77a69=_0x2fcf44['smsQueues'][_0x3d18a1];var _0x552ac2={'id':_0xa77a69['id'],'available':_0xa77a69['available'],'loggedIn':_0xa77a69[_0xa55e('0x4f')],'name':_0xa77a69[_0xa55e('0x50')],'paused':_0xa77a69[_0xa55e('0x51')],'waiting':_0xa77a69[_0xa55e('0x52')]};_0x4cfd5e[_0xa55e('0x1e')](_0x552ac2);}}_0x36f488({'count':_0x4cfd5e[_0xa55e('0x16')],'rows':_0x4cfd5e});});},'FaxQueues':function(){return new Promise(function(_0x5ccaf3){var _0x22b2a6=[];for(var _0x1894f3 in _0x2fcf44[_0xa55e('0x56')]){if(_0x2fcf44[_0xa55e('0x56')]['hasOwnProperty'](_0x1894f3)){var _0x18e616=_0x2fcf44[_0xa55e('0x56')][_0x1894f3];var _0x36ff97={'id':_0x18e616['id'],'available':_0x18e616[_0xa55e('0x4e')],'loggedIn':_0x18e616[_0xa55e('0x4f')],'name':_0x18e616[_0xa55e('0x50')],'paused':_0x18e616[_0xa55e('0x51')],'waiting':_0x18e616[_0xa55e('0x52')]};_0x22b2a6[_0xa55e('0x1e')](_0x36ff97);}}_0x5ccaf3({'count':_0x22b2a6[_0xa55e('0x16')],'rows':_0x22b2a6});});},'WhatsappQueues':function(){return new Promise(function(_0x4b7051){var _0xb2b3b1=[];for(var _0x5b8dff in _0x2fcf44[_0xa55e('0x57')]){if(_0x2fcf44[_0xa55e('0x57')][_0xa55e('0x47')](_0x5b8dff)){var _0x112437=_0x2fcf44['whatsappQueues'][_0x5b8dff];var _0x15fef0={'id':_0x112437['id'],'available':_0x112437[_0xa55e('0x4e')],'loggedIn':_0x112437[_0xa55e('0x4f')],'name':_0x112437[_0xa55e('0x50')],'paused':_0x112437['paused'],'waiting':_0x112437[_0xa55e('0x52')]};_0xb2b3b1['push'](_0x15fef0);}}_0x4b7051({'count':_0xb2b3b1[_0xa55e('0x16')],'rows':_0xb2b3b1});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xb118bf){var _0x563d84=_[_0xa55e('0x4b')](_0x2fcf44['chatQueuesWaitingInteractions']);_0xb118bf({'count':_0x563d84[_0xa55e('0x16')],'rows':_0x563d84});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x64a663){var _0x4fcdae=_['values'](_0x2fcf44[_0xa55e('0x58')]);_0x64a663({'count':_0x4fcdae[_0xa55e('0x16')],'rows':_0x4fcdae});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3a206c){var _0x5078b0=_[_0xa55e('0x4b')](_0x2fcf44[_0xa55e('0x59')]);_0x3a206c({'count':_0x5078b0['length'],'rows':_0x5078b0});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x124a0e){var _0x84002d=_['values'](_0x2fcf44[_0xa55e('0x5a')]);_0x124a0e({'count':_0x84002d[_0xa55e('0x16')],'rows':_0x84002d});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x341e96){var _0x5821d5=_['values'](_0x2fcf44[_0xa55e('0x5b')]);_0x341e96({'count':_0x5821d5[_0xa55e('0x16')],'rows':_0x5821d5});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0xdd3bc9){var _0x29580d=_[_0xa55e('0x4b')](_0x2fcf44['whatsappQueuesWaitingInteractions']);_0xdd3bc9({'count':_0x29580d['length'],'rows':_0x29580d});});}};var _0x59a85c=jayson[_0xa55e('0x5c')](_0x3ba80b)[_0xa55e('0x5d')]();_0x59a85c['on'](_0xa55e('0x34'),function(_0x1f2031){logger[_0xa55e('0x34')](JSON['stringify'](_0x1f2031));return _0x27746c(_0x1f2031);});_0x59a85c[_0xa55e('0x10')](0x232c,_0xa55e('0x5e'),function(){console[_0xa55e('0x5f')](_0xa55e('0x60'),0x232c);return _0x15a283(_0xa55e('0x61')+0x232c);});});};
\ No newline at end of file
index 4cfe6d4..cbc90ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca64=['stop','Command','format','message','indexOf','true','some','join','\x20|\x20','when','log','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','then','error','result','catch','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED'];(function(_0x2de0a7,_0x38d3e7){var _0x429437=function(_0x23c148){while(--_0x23c148){_0x2de0a7['push'](_0x2de0a7['shift']());}};_0x429437(++_0x38d3e7);}(_0xca64,0x1b1));var _0x4ca6=function(_0x430521,_0x4b2060){_0x430521=_0x430521-0x0;var _0x10db60=_0xca64[_0x430521];return _0x10db60;};'use strict';var util=require(_0x4ca6('0x0'));var BPromise=require(_0x4ca6('0x1'));var jayson=require(_0x4ca6('0x2'));var _=require(_0x4ca6('0x3'));var logger=require(_0x4ca6('0x4'))(_0x4ca6('0x5'));var client=jayson[_0x4ca6('0x6')][_0x4ca6('0x7')]({'port':0x232a});function request(_0x37514f,_0x2686a2){return new BPromise(function(_0x1ae069,_0x3339f0){return client[_0x4ca6('0x8')](_0x37514f,_0x2686a2)[_0x4ca6('0x9')](function(_0x1d1635){if(_0x1d1635[_0x4ca6('0xa')]){return _0x3339f0(_0x1d1635[_0x4ca6('0xa')]['message']);}else{return _0x1ae069(_0x1d1635[_0x4ca6('0xb')]);}})[_0x4ca6('0xc')](function(_0x5d0c5d){return _0x3339f0(_0x5d0c5d);});});}exports['condition']=function(_0xcd6a28,_0x44fcfe,_0x10963d){return function(_0x5d2921){if(_0x10963d['rules']&&!_0x10963d['rules'][_0xcd6a28]){logger[_0x4ca6('0xd')](_0x4ca6('0xe'),_0xcd6a28);return _0x5d2921[_0x4ca6('0xf')]();}var _0x103b0c=[];for(var _0x5c2ac8=0x0;_0x5c2ac8<_0x44fcfe['length'];_0x5c2ac8+=0x1){_0x103b0c['push'](request(_0x4ca6('0x10'),{'command':util[_0x4ca6('0x11')]('iftime\x20%s',_0x44fcfe[_0x5c2ac8])})['then'](function(_0x12d648){return _0x12d648&&_0x12d648[_0x4ca6('0x12')]&&_0x12d648[_0x4ca6('0x12')][_0x4ca6('0x13')](_0x4ca6('0x14'))>=0x0?!![]:![];})[_0x4ca6('0xc')](function(_0x53a2d4){logger['error']('[%s][INTERVAL]\x20%s',_0xcd6a28,_0x44fcfe[_0x5c2ac8]);}));}BPromise['all'](_0x103b0c)['then'](function(_0x559151){var _0x3f30a9=_[_0x4ca6('0x15')](_0x559151);logger[_0x4ca6('0xd')]('[%s][INTERVAL]\x20%s\x20%s',_0xcd6a28,_0x44fcfe[_0x4ca6('0x16')](_0x4ca6('0x17')),_0x3f30a9);_0x5d2921[_0x4ca6('0x18')](_0x3f30a9);})[_0x4ca6('0xc')](function(_0x5860fd){console[_0x4ca6('0x19')](_0x5860fd);logger[_0x4ca6('0xa')](_0x4ca6('0x1a'),_0xcd6a28,_0x44fcfe['join'](_0x4ca6('0x17')),_0x5860fd[_0x4ca6('0x1b')]);_0x5d2921[_0x4ca6('0xf')]();});};};
\ No newline at end of file
+var _0xcb41=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','push','Command','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','stack','stop','util','lodash','../../../config/logger','routing','http','then','error','message','result','condition','rules','info'];(function(_0x1059af,_0x339a6e){var _0x28f94b=function(_0x52ed0c){while(--_0x52ed0c){_0x1059af['push'](_0x1059af['shift']());}};_0x28f94b(++_0x339a6e);}(_0xcb41,0x1ec));var _0x1cb4=function(_0x22589c,_0x3da861){_0x22589c=_0x22589c-0x0;var _0x3474df=_0xcb41[_0x22589c];return _0x3474df;};'use strict';var util=require(_0x1cb4('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require(_0x1cb4('0x1'));var logger=require(_0x1cb4('0x2'))(_0x1cb4('0x3'));var client=jayson['client'][_0x1cb4('0x4')]({'port':0x232a});function request(_0x41bce8,_0x39c157){return new BPromise(function(_0x342bc5,_0x25fffd){return client['request'](_0x41bce8,_0x39c157)[_0x1cb4('0x5')](function(_0x315c35){if(_0x315c35[_0x1cb4('0x6')]){return _0x25fffd(_0x315c35[_0x1cb4('0x6')][_0x1cb4('0x7')]);}else{return _0x342bc5(_0x315c35[_0x1cb4('0x8')]);}})['catch'](function(_0x237c29){return _0x25fffd(_0x237c29);});});}exports[_0x1cb4('0x9')]=function(_0x23abb9,_0x376c35,_0x340e12){return function(_0x141a49){if(_0x340e12[_0x1cb4('0xa')]&&!_0x340e12[_0x1cb4('0xa')][_0x23abb9]){logger[_0x1cb4('0xb')](_0x1cb4('0xc'),_0x23abb9);return _0x141a49['stop']();}var _0x4a829b=[];for(var _0x32befa=0x0;_0x32befa<_0x376c35['length'];_0x32befa+=0x1){_0x4a829b[_0x1cb4('0xd')](request(_0x1cb4('0xe'),{'command':util[_0x1cb4('0xf')](_0x1cb4('0x10'),_0x376c35[_0x32befa])})[_0x1cb4('0x5')](function(_0x3b8483){return _0x3b8483&&_0x3b8483['message']&&_0x3b8483[_0x1cb4('0x7')][_0x1cb4('0x11')](_0x1cb4('0x12'))>=0x0?!![]:![];})[_0x1cb4('0x13')](function(_0x208475){logger[_0x1cb4('0x6')](_0x1cb4('0x14'),_0x23abb9,_0x376c35[_0x32befa]);}));}BPromise['all'](_0x4a829b)['then'](function(_0x410850){var _0x32b4ac=_['some'](_0x410850);logger[_0x1cb4('0xb')](_0x1cb4('0x15'),_0x23abb9,_0x376c35[_0x1cb4('0x16')](_0x1cb4('0x17')),_0x32b4ac);_0x141a49[_0x1cb4('0x18')](_0x32b4ac);})[_0x1cb4('0x13')](function(_0x49648b){console[_0x1cb4('0x19')](_0x49648b);logger[_0x1cb4('0x6')]('[%s][INTERVAL]\x20%s\x20%s',_0x23abb9,_0x376c35[_0x1cb4('0x16')]('\x20|\x20'),_0x49648b[_0x1cb4('0x1a')]);_0x141a49[_0x1cb4('0x1b')]();});};};
\ No newline at end of file
index 94a648d..8188eed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinenum','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','transfer','transfertype','blind','extension','transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','calleridname','agententerreason','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','lodash','util','info','format','uniqueid','channel','queue','interface','calleridnum','then','type','agentacw','agentcomplete','acw','acwTimeout','request','CreateVoiceAgentReport','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','called','connectedlinename','membername','error','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswer','agentringnoanswerAt','lastevent','reason','timeout','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','[%s][agents][agentconnect]'];(function(_0x496cc7,_0x1fbf15){var _0x5959ef=function(_0x577970){while(--_0x577970){_0x496cc7['push'](_0x496cc7['shift']());}};_0x5959ef(++_0x1fbf15);}(_0x13f6,0x124));var _0x613f=function(_0x17943d,_0x2ed7df){_0x17943d=_0x17943d-0x0;var _0x1e9958=_0x13f6[_0x17943d];return _0x1e9958;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563492,_0xd04cfd){utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x563492[_0x613f('0x4')],_0x563492[_0x613f('0x5')],_0x563492[_0x613f('0x6')],_0x563492['membername'],_0x563492[_0x613f('0x7')],_0x563492[_0x613f('0x8')],_0x563492['connectedlinenum'],_0x563492['lastevent']));if(_0x563492['queue']){utils['getVoiceQueueByName'](_0x563492[_0x613f('0x6')])[_0x613f('0x9')](function(_0x363736){if(_0x363736){_0x563492[_0x613f('0xa')]=_0x363736['type'];_0x563492[_0x613f('0xb')]=_0x563492[_0x613f('0xc')]?_0x363736[_0x613f('0xd')]:![];_0x563492['acwtime']=_0x563492[_0x613f('0xb')]?_0x363736[_0x613f('0xe')]:0x0;}utils[_0x613f('0xf')]('CreateVoiceAgentReport',_0x563492);});}else{utils[_0x613f('0xf')](_0x613f('0x10'),_0x563492);}if(_0xd04cfd){delete transfers[_0x563492['uniqueid']];}else{delete agents[_0x563492['destuniqueid']];}}exports['agentcalled']=function(_0x38d90a){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x12'),_0x38d90a[_0x613f('0x4')]),_0x38d90a);agents[_0x38d90a[_0x613f('0x13')]]=_0x38d90a;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();agents[_0x38d90a[_0x613f('0x13')]]['lastevent']=_0x613f('0x16');agents[_0x38d90a['destuniqueid']]['connectedlinenum']=null;agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x17')]=null;utils['info'](util[_0x613f('0x3')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x38d90a[_0x613f('0x4')],agents[_0x38d90a[_0x613f('0x13')]][_0x613f('0x18')],_0x38d90a[_0x613f('0x13')]));}catch(_0x3c0feb){utils[_0x613f('0x19')](util['format']('[%s][agents][agentcalled]',_0x38d90a[_0x613f('0x4')]),_0x3c0feb);}};exports['agentringnoanswer']=function(_0x48493c){try{if(!_[_0x613f('0x1a')](agents[_0x48493c[_0x613f('0x13')]])){utils['debug'](util[_0x613f('0x3')](_0x613f('0x1b'),_0x48493c[_0x613f('0x4')]),_0x48493c);utils['info'](util['format'](_0x613f('0x1c'),_0x48493c[_0x613f('0x4')],agents[_0x48493c[_0x613f('0x13')]]['membername'],_0x48493c[_0x613f('0x13')]));agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1d')]=!![];agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1e')]=utils['now']();agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x1f')]='timeout';agents[_0x48493c[_0x613f('0x13')]][_0x613f('0x20')]=_0x613f('0x21');agents[_0x48493c['destuniqueid']]['holdtime']=_0x48493c['ringtime']?parseInt(_0x48493c[_0x613f('0x22')])/0x3e8:0x0;agents[_0x48493c['destuniqueid']][_0x613f('0x23')]=0x0;unanswered[_0x613f('0x24')](_0x48493c['destuniqueid']);}}catch(_0x121241){utils[_0x613f('0x19')](util['format']('[%s][agents][agentringnoanswer]',_0x48493c['uniqueid']),_0x121241);}};exports[_0x613f('0x25')]=function(_0x7c1a94){try{_[_0x613f('0x26')](agents,function(_0x47f4af,_0x23eda8){if(_0x47f4af[_0x613f('0x4')]==_0x7c1a94[_0x613f('0x4')]&&!_[_0x613f('0x27')](unanswered,_0x47f4af['destuniqueid'])){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x7c1a94);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x7c1a94[_0x613f('0x4')],_0x47f4af[_0x613f('0x18')],_0x47f4af[_0x613f('0x13')]));_0x47f4af['agentringnoanswer']=!![];_0x47f4af[_0x613f('0x1e')]=utils['now']();_0x47f4af[_0x613f('0x1f')]=_0x613f('0x29');_0x47f4af[_0x613f('0x20')]=_0x613f('0x29');_0x47f4af[_0x613f('0x2a')]=_0x7c1a94[_0x613f('0x2a')];_0x47f4af['talktime']=0x0;writeDB(_0x47f4af);}});}catch(_0x1a18ce){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x28'),_0x7c1a94[_0x613f('0x4')]),_0x1a18ce);}};exports['agentconnect']=function(_0x59236e){try{if(agents[_0x59236e['destuniqueid']]){utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x59236e);utils['info'](util[_0x613f('0x3')](_0x613f('0x2c'),_0x59236e['uniqueid'],agents[_0x59236e[_0x613f('0x13')]]['membername'],_0x59236e[_0x613f('0x13')]));agents[_0x59236e['destuniqueid']][_0x613f('0x2d')]=utils['now']();agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2e')]=_0x59236e[_0x613f('0x2e')];agents[_0x59236e['destuniqueid']][_0x613f('0x17')]=_0x59236e[_0x613f('0x17')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];agents[_0x59236e[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x2f');_[_0x613f('0x26')](agents,function(_0x3313c1,_0x4da8d3){if(_0x3313c1[_0x613f('0x13')]!=_0x59236e[_0x613f('0x13')]&&_0x3313c1[_0x613f('0x4')]==_0x59236e[_0x613f('0x4')]){_0x3313c1[_0x613f('0x23')]=0x0;_0x3313c1[_0x613f('0x2a')]=_0x59236e[_0x613f('0x22')];_0x3313c1['agentringnoanswer']=!![];_0x3313c1[_0x613f('0x1e')]=utils[_0x613f('0x15')]();_0x3313c1[_0x613f('0x1f')]=_0x613f('0x30');_0x3313c1[_0x613f('0x20')]=_0x613f('0x30');_0x3313c1[_0x613f('0x31')]=_0x59236e['destuniqueid'];_0x3313c1[_0x613f('0x32')]=_0x59236e[_0x613f('0x18')];writeDB(_0x3313c1);}});}}catch(_0x3bb605){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x2b'),_0x59236e[_0x613f('0x4')]),_0x3bb605);}};exports[_0x613f('0xc')]=function(_0x403feb){try{if(!_[_0x613f('0x1a')](agents[_0x403feb[_0x613f('0x13')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][agentcomplete]',_0x403feb[_0x613f('0x4')]),_0x403feb);utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x33'),_0x403feb['uniqueid'],agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x18')],_0x403feb[_0x613f('0x13')]));agents[_0x403feb[_0x613f('0x13')]][_0x613f('0xc')]=!![];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x23')]=utils['diffTime'](agents[_0x403feb['destuniqueid']][_0x613f('0x34')],agents[_0x403feb[_0x613f('0x13')]]['agentconnectAt']);agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x20')]=_0x403feb[_0x613f('0x20')];agents[_0x403feb[_0x613f('0x13')]][_0x613f('0x1f')]=_0x613f('0x35');writeDB(agents[_0x403feb[_0x613f('0x13')]]);}}catch(_0x3a7f95){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x36'),_0x403feb[_0x613f('0x4')]),_0x3a7f95);}};exports[_0x613f('0x37')]=function(_0x17f8e5){try{if(!_[_0x613f('0x1a')](agents[_0x17f8e5[_0x613f('0x38')]])){utils[_0x613f('0x11')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]',_0x17f8e5['uniqueid']),_0x17f8e5);utils[_0x613f('0x2')](util[_0x613f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x17f8e5['uniqueid'],agents[_0x17f8e5[_0x613f('0x38')]]['membername'],agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x4')]));agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x39')]=!![];agents[_0x17f8e5['transfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x3b');agents[_0x17f8e5['transfereruniqueid']]['transferexten']=_0x17f8e5[_0x613f('0x3c')];agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x3d')]=agents[_0x17f8e5[_0x613f('0x38')]][_0x613f('0x4')];}}catch(_0x395357){utils[_0x613f('0x19')](util['format']('[%s][agents][blindtransfer]',_0x17f8e5[_0x613f('0x4')]),_0x395357);}};exports['attendedtransfer']=function(_0x5dd54e){try{utils[_0x613f('0x11')](util[_0x613f('0x3')](_0x613f('0x3e'),_0x5dd54e['origtransfereruniqueid']),_0x5dd54e);if(_0x5dd54e[_0x613f('0x3f')]==_0x5dd54e[_0x613f('0x40')]){if(!_[_0x613f('0x1a')](agents[_0x5dd54e[_0x613f('0x41')]])){utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e[_0x613f('0x41')]]['membername']));agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x39')]=!![];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x44')]=_0x5dd54e[_0x613f('0x45')];agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x3d')]=_0x5dd54e[_0x613f('0x3f')];}if(_0x5dd54e[_0x613f('0x46')]&&agents[_0x5dd54e[_0x613f('0x46')]]){agents[_0x5dd54e['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x5dd54e[_0x613f('0x46')]]=_['clone'](agents[_0x5dd54e[_0x613f('0x46')]]);transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x47')]=agents[_0x5dd54e[_0x613f('0x41')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x14')]=utils['now']();transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x2d')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x46')]]['holdtime']=0x0;transfers[_0x5dd54e[_0x613f('0x46')]][_0x613f('0x48')]=0x2;}}else if(_0x5dd54e['secondtransfereruniqueid']==_0x5dd54e['secondtransfererlinkedid']){if(!_[_0x613f('0x1a')](agents[_0x5dd54e['origtransfereruniqueid']])){utils['info'](util['format'](_0x613f('0x42'),_0x5dd54e['origtransfereruniqueid'],agents[_0x5dd54e['origtransfereruniqueid']]['membername']));agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x39')]=!![];agents[_0x5dd54e['origtransfereruniqueid']][_0x613f('0x3a')]=_0x613f('0x43');agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x44')]=_0x5dd54e['secondtransfererexten'];agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x3d')]=_0x5dd54e['secondtransfereruniqueid'];}if(_0x5dd54e[_0x613f('0x49')]&&agents[_0x5dd54e[_0x613f('0x49')]]){agents[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x1;transfers[_0x5dd54e[_0x613f('0x49')]]=_[_0x613f('0x4a')](agents[_0x5dd54e[_0x613f('0x49')]]);transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x8')]=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x8')];transfers[_0x5dd54e[_0x613f('0x49')]]['calleridname']=agents[_0x5dd54e[_0x613f('0x3f')]][_0x613f('0x47')];transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x14')]=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]]['agentconnectAt']=utils[_0x613f('0x15')]();transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x2a')]=0x0;transfers[_0x5dd54e[_0x613f('0x49')]][_0x613f('0x48')]=0x2;}}}catch(_0x2ae459){utils['error'](util['format'](_0x613f('0x3e'),_0x5dd54e[_0x613f('0x3f')]),_0x2ae459);}};exports[_0x613f('0x4b')]=function(_0xddcd6){try{utils['debug'](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0xddcd6);if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6['uniqueid']][_0x613f('0x20')]===_0x613f('0x21')){if(_0xddcd6[_0x613f('0x4d')]==='21'){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x4e');agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]='rejected';}utils[_0x613f('0x2')](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x18')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]));writeDB(agents[_0xddcd6['uniqueid']]);var _0x2c4b88=unanswered[_0x613f('0x50')](_0xddcd6[_0x613f('0x4')]);if(_0x2c4b88>-0x1){unanswered[_0x613f('0x51')](_0x2c4b88,0x1);}}if(transfers[_0xddcd6[_0x613f('0x4')]]){transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')]=utils[_0x613f('0x15')]();transfers[_0xddcd6[_0x613f('0x4')]]['talktime']=utils[_0x613f('0x52')](transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x34')],transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x20')]=_0x613f('0x53');transfers[_0xddcd6[_0x613f('0x4')]][_0x613f('0x1f')]=_0x613f('0x35');utils[_0x613f('0x2')](util['format'](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],transfers[_0xddcd6['uniqueid']][_0x613f('0x18')],transfers[_0xddcd6['uniqueid']][_0x613f('0x20')],transfers[_0xddcd6['uniqueid']]['lastevent']));writeDB(transfers[_0xddcd6[_0x613f('0x4')]],!![]);}if(agents[_0xddcd6[_0x613f('0x4')]]&&agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]){agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0xc')]=!![];agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt']=utils[_0x613f('0x15')]();agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x23')]=utils[_0x613f('0x52')](agents[_0xddcd6[_0x613f('0x4')]]['agentcompleteAt'],agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x2d')]);agents[_0xddcd6['uniqueid']][_0x613f('0x20')]=agents[_0xddcd6[_0x613f('0x4')]][_0x613f('0x39')]?'transfer':'agent';agents[_0xddcd6['uniqueid']][_0x613f('0x1f')]=_0x613f('0x35');utils['info'](util[_0x613f('0x3')](_0x613f('0x4f'),_0xddcd6[_0x613f('0x4')],agents[_0xddcd6['uniqueid']][_0x613f('0x18')],agents[_0xddcd6['uniqueid']][_0x613f('0x20')],agents[_0xddcd6['uniqueid']]['lastevent']));writeDB(agents[_0xddcd6[_0x613f('0x4')]]);}}catch(_0x1b5f6e){utils[_0x613f('0x19')](util[_0x613f('0x3')](_0x613f('0x4c'),_0xddcd6[_0x613f('0x4')]),_0x1b5f6e);}};
\ No newline at end of file
+var _0xd3d1=['transferuniqueid','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','clone','calleridname','agentcalledAt','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','agentringnoanswer','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension'];(function(_0x58e3cb,_0x1e159c){var _0x209825=function(_0x27d3c6){while(--_0x27d3c6){_0x58e3cb['push'](_0x58e3cb['shift']());}};_0x209825(++_0x1e159c);}(_0xd3d1,0x172));var _0x1d3d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd3d1[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x1d3d('0x0'));var util=require(_0x1d3d('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x56f01c,_0x2d0605){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x4'),_0x56f01c[_0x1d3d('0x5')],_0x56f01c[_0x1d3d('0x6')],_0x56f01c[_0x1d3d('0x7')],_0x56f01c[_0x1d3d('0x8')],_0x56f01c[_0x1d3d('0x9')],_0x56f01c[_0x1d3d('0xa')],_0x56f01c[_0x1d3d('0xb')],_0x56f01c[_0x1d3d('0xc')]));if(_0x56f01c[_0x1d3d('0x7')]){utils[_0x1d3d('0xd')](_0x56f01c[_0x1d3d('0x7')])[_0x1d3d('0xe')](function(_0x3683c9){if(_0x3683c9){_0x56f01c['type']=_0x3683c9[_0x1d3d('0xf')];_0x56f01c[_0x1d3d('0x10')]=_0x56f01c[_0x1d3d('0x11')]?_0x3683c9[_0x1d3d('0x12')]:![];_0x56f01c[_0x1d3d('0x13')]=_0x56f01c[_0x1d3d('0x10')]?_0x3683c9[_0x1d3d('0x14')]:0x0;}utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);});}else{utils[_0x1d3d('0x15')](_0x1d3d('0x16'),_0x56f01c);}if(_0x2d0605){delete transfers[_0x56f01c['uniqueid']];}else{delete agents[_0x56f01c[_0x1d3d('0x17')]];}}exports[_0x1d3d('0x18')]=function(_0x494b82){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x19'),_0x494b82[_0x1d3d('0x5')]),_0x494b82);agents[_0x494b82['destuniqueid']]=_0x494b82;agents[_0x494b82[_0x1d3d('0x17')]]['agentcalledAt']=utils[_0x1d3d('0x1a')]();agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x1b');agents[_0x494b82[_0x1d3d('0x17')]][_0x1d3d('0xb')]=null;agents[_0x494b82[_0x1d3d('0x17')]]['connectedlinename']=null;utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x1c'),_0x494b82['uniqueid'],agents[_0x494b82[_0x1d3d('0x17')]]['membername'],_0x494b82[_0x1d3d('0x17')]));}catch(_0x392e92){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][agentcalled]',_0x494b82[_0x1d3d('0x5')]),_0x392e92);}};exports['agentringnoanswer']=function(_0x56c424){try{if(!_[_0x1d3d('0x1e')](agents[_0x56c424[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x56c424);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x21'),_0x56c424[_0x1d3d('0x5')],agents[_0x56c424[_0x1d3d('0x17')]]['membername'],_0x56c424[_0x1d3d('0x17')]));agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswer']=!![];agents[_0x56c424[_0x1d3d('0x17')]]['agentringnoanswerAt']=utils[_0x1d3d('0x1a')]();agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0xc')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x23')]=_0x1d3d('0x22');agents[_0x56c424[_0x1d3d('0x17')]][_0x1d3d('0x24')]=_0x56c424[_0x1d3d('0x25')]?parseInt(_0x56c424[_0x1d3d('0x25')])/0x3e8:0x0;agents[_0x56c424['destuniqueid']][_0x1d3d('0x26')]=0x0;unanswered['push'](_0x56c424[_0x1d3d('0x17')]);}}catch(_0x2bcc2){utils['error'](util[_0x1d3d('0x3')](_0x1d3d('0x20'),_0x56c424[_0x1d3d('0x5')]),_0x2bcc2);}};exports[_0x1d3d('0x27')]=function(_0x4abbfc){try{_[_0x1d3d('0x28')](agents,function(_0x235ef3,_0x5d1b6c){if(_0x235ef3[_0x1d3d('0x5')]==_0x4abbfc['uniqueid']&&!_[_0x1d3d('0x29')](unanswered,_0x235ef3[_0x1d3d('0x17')])){utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc[_0x1d3d('0x5')]),_0x4abbfc);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2b'),_0x4abbfc[_0x1d3d('0x5')],_0x235ef3[_0x1d3d('0x8')],_0x235ef3[_0x1d3d('0x17')]));_0x235ef3['agentringnoanswer']=!![];_0x235ef3[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x235ef3[_0x1d3d('0xc')]=_0x1d3d('0x2d');_0x235ef3['reason']='abandoned';_0x235ef3[_0x1d3d('0x24')]=_0x4abbfc[_0x1d3d('0x24')];_0x235ef3['talktime']=0x0;writeDB(_0x235ef3);}});}catch(_0x43ef5d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2a'),_0x4abbfc['uniqueid']),_0x43ef5d);}};exports['agentconnect']=function(_0x29fa6c){try{if(agents[_0x29fa6c['destuniqueid']]){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c[_0x1d3d('0x5')]),_0x29fa6c);utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x2f'),_0x29fa6c[_0x1d3d('0x5')],agents[_0x29fa6c['destuniqueid']][_0x1d3d('0x8')],_0x29fa6c['destuniqueid']));agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0x30')]=utils['now']();agents[_0x29fa6c[_0x1d3d('0x17')]][_0x1d3d('0xb')]=_0x29fa6c[_0x1d3d('0xb')];agents[_0x29fa6c[_0x1d3d('0x17')]]['connectedlinename']=_0x29fa6c['connectedlinename'];agents[_0x29fa6c[_0x1d3d('0x17')]]['holdtime']=_0x29fa6c[_0x1d3d('0x25')];agents[_0x29fa6c[_0x1d3d('0x17')]]['lastevent']=_0x1d3d('0x31');_[_0x1d3d('0x28')](agents,function(_0x51be79,_0x2d5015){if(_0x51be79[_0x1d3d('0x17')]!=_0x29fa6c[_0x1d3d('0x17')]&&_0x51be79[_0x1d3d('0x5')]==_0x29fa6c[_0x1d3d('0x5')]){_0x51be79[_0x1d3d('0x26')]=0x0;_0x51be79['holdtime']=_0x29fa6c[_0x1d3d('0x25')];_0x51be79[_0x1d3d('0x32')]=!![];_0x51be79[_0x1d3d('0x2c')]=utils[_0x1d3d('0x1a')]();_0x51be79[_0x1d3d('0xc')]='answered_elsewhere';_0x51be79[_0x1d3d('0x23')]=_0x1d3d('0x33');_0x51be79[_0x1d3d('0x34')]=_0x29fa6c[_0x1d3d('0x17')];_0x51be79['answeredelsewheremembername']=_0x29fa6c[_0x1d3d('0x8')];writeDB(_0x51be79);}});}}catch(_0x977ea8){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x2e'),_0x29fa6c['uniqueid']),_0x977ea8);}};exports['agentcomplete']=function(_0x229f48){try{if(!_[_0x1d3d('0x1e')](agents[_0x229f48[_0x1d3d('0x17')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')]('[%s][agents][agentcomplete]',_0x229f48[_0x1d3d('0x5')]),_0x229f48);utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x35'),_0x229f48[_0x1d3d('0x5')],agents[_0x229f48[_0x1d3d('0x17')]]['membername'],_0x229f48[_0x1d3d('0x17')]));agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x11')]=!![];agents[_0x229f48[_0x1d3d('0x17')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x229f48[_0x1d3d('0x17')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x229f48['destuniqueid']][_0x1d3d('0x36')],agents[_0x229f48[_0x1d3d('0x17')]]['agentconnectAt']);agents[_0x229f48[_0x1d3d('0x17')]]['reason']=_0x229f48[_0x1d3d('0x23')];agents[_0x229f48['destuniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x38');writeDB(agents[_0x229f48[_0x1d3d('0x17')]]);}}catch(_0x25b547){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x39'),_0x229f48[_0x1d3d('0x5')]),_0x25b547);}};exports['blindtransfer']=function(_0x5899cc){try{if(!_['isNil'](agents[_0x5899cc[_0x1d3d('0x3a')]])){utils[_0x1d3d('0x1f')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5899cc);utils[_0x1d3d('0x2')](util['format']('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x5899cc['uniqueid'],agents[_0x5899cc['transfereruniqueid']][_0x1d3d('0x8')],agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')]));agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3c')]=!![];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3d')]=_0x1d3d('0x3e');agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x3f')]=_0x5899cc[_0x1d3d('0x40')];agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x41')]=agents[_0x5899cc[_0x1d3d('0x3a')]][_0x1d3d('0x5')];}}catch(_0x5ce0d3){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')](_0x1d3d('0x3b'),_0x5899cc[_0x1d3d('0x5')]),_0x5ce0d3);}};exports['attendedtransfer']=function(_0x41930f){try{utils['debug'](util['format'](_0x1d3d('0x42'),_0x41930f[_0x1d3d('0x43')]),_0x41930f);if(_0x41930f['origtransfereruniqueid']==_0x41930f[_0x1d3d('0x44')]){if(!_[_0x1d3d('0x1e')](agents[_0x41930f['secondtransfereruniqueid']])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x8')]));agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x46')]]['transfertype']=_0x1d3d('0x47');agents[_0x41930f['secondtransfereruniqueid']]['transferexten']=_0x41930f['origtransfererexten'];agents[_0x41930f['secondtransfereruniqueid']][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x43')];}if(_0x41930f[_0x1d3d('0x48')]&&agents[_0x41930f[_0x1d3d('0x48')]]){agents[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f['transfereeuniqueid']]=_[_0x1d3d('0x4a')](agents[_0x41930f[_0x1d3d('0x48')]]);transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0xa')]=agents[_0x41930f[_0x1d3d('0x46')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x46')]][_0x1d3d('0x4b')];transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x4c')]=utils['now']();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x48')]][_0x1d3d('0x24')]=0x0;transfers[_0x41930f['transfereeuniqueid']][_0x1d3d('0x49')]=0x2;}}else if(_0x41930f['secondtransfereruniqueid']==_0x41930f[_0x1d3d('0x4d')]){if(!_['isNil'](agents[_0x41930f[_0x1d3d('0x43')]])){utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x45'),_0x41930f[_0x1d3d('0x43')],agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x8')]));agents[_0x41930f['origtransfereruniqueid']][_0x1d3d('0x3c')]=!![];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3d')]=_0x1d3d('0x47');agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x3f')]=_0x41930f['secondtransfererexten'];agents[_0x41930f[_0x1d3d('0x43')]][_0x1d3d('0x41')]=_0x41930f[_0x1d3d('0x46')];}if(_0x41930f[_0x1d3d('0x4e')]&&agents[_0x41930f[_0x1d3d('0x4e')]]){agents[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x49')]=0x1;transfers[_0x41930f[_0x1d3d('0x4e')]]=_[_0x1d3d('0x4a')](agents[_0x41930f['transfertargetuniqueid']]);transfers[_0x41930f[_0x1d3d('0x4e')]]['calleridnum']=agents[_0x41930f[_0x1d3d('0x43')]]['calleridnum'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4b')]=agents[_0x41930f[_0x1d3d('0x43')]]['calleridname'];transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x4c')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f['transfertargetuniqueid']][_0x1d3d('0x30')]=utils[_0x1d3d('0x1a')]();transfers[_0x41930f[_0x1d3d('0x4e')]]['holdtime']=0x0;transfers[_0x41930f[_0x1d3d('0x4e')]][_0x1d3d('0x49')]=0x2;}}}catch(_0x37667d){utils[_0x1d3d('0x1d')](util[_0x1d3d('0x3')]('[%s][agents][attendedtransfer]',_0x41930f[_0x1d3d('0x43')]),_0x37667d);}};exports[_0x1d3d('0x4f')]=function(_0x25f4e0){try{utils['debug'](util[_0x1d3d('0x3')](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x25f4e0);if(agents[_0x25f4e0[_0x1d3d('0x5')]]&&agents[_0x25f4e0[_0x1d3d('0x5')]]['reason']===_0x1d3d('0x22')){if(_0x25f4e0[_0x1d3d('0x51')]==='21'){agents[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x52');agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]=_0x1d3d('0x52');}utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x25f4e0[_0x1d3d('0x5')],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(agents[_0x25f4e0[_0x1d3d('0x5')]]);var _0x4604cc=unanswered[_0x1d3d('0x53')](_0x25f4e0[_0x1d3d('0x5')]);if(_0x4604cc>-0x1){unanswered[_0x1d3d('0x54')](_0x4604cc,0x1);}}if(transfers[_0x25f4e0[_0x1d3d('0x5')]]){transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x11')]=!![];transfers[_0x25f4e0[_0x1d3d('0x5')]]['agentcompleteAt']=utils[_0x1d3d('0x1a')]();transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x26')]=utils['diffTime'](transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x30')]);transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')]=_0x1d3d('0x55');transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]='complete';utils[_0x1d3d('0x2')](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],transfers[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0x23')],transfers[_0x25f4e0['uniqueid']][_0x1d3d('0xc')]));writeDB(transfers[_0x25f4e0[_0x1d3d('0x5')]],!![]);}if(agents[_0x25f4e0['uniqueid']]&&agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]){agents[_0x25f4e0[_0x1d3d('0x5')]]['agentcomplete']=!![];agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')]=utils[_0x1d3d('0x1a')]();agents[_0x25f4e0[_0x1d3d('0x5')]]['talktime']=utils[_0x1d3d('0x37')](agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x36')],agents[_0x25f4e0['uniqueid']][_0x1d3d('0x30')]);agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x23')]=agents[_0x25f4e0['uniqueid']][_0x1d3d('0x3c')]?_0x1d3d('0x3c'):_0x1d3d('0x55');agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0xc')]=_0x1d3d('0x38');utils['info'](util[_0x1d3d('0x3')](_0x1d3d('0x56'),_0x25f4e0['uniqueid'],agents[_0x25f4e0[_0x1d3d('0x5')]][_0x1d3d('0x8')],agents[_0x25f4e0[_0x1d3d('0x5')]]['reason'],agents[_0x25f4e0[_0x1d3d('0x5')]]['lastevent']));writeDB(agents[_0x25f4e0['uniqueid']]);}}catch(_0x49d1e7){utils[_0x1d3d('0x1d')](util['format'](_0x1d3d('0x50'),_0x25f4e0[_0x1d3d('0x5')]),_0x49d1e7);}};
\ No newline at end of file
index 4a5c6ef..1a9f044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b1=['channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','diffTime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','userfield','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','musiconholdstartAt','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','value','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','noop','execif','lastdata','util','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','interface','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','calleridnum','exten','now','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime'];(function(_0x2b2b33,_0x56606f){var _0x229157=function(_0x52b63e){while(--_0x52b63e){_0x2b2b33['push'](_0x2b2b33['shift']());}};_0x229157(++_0x56606f);}(_0x29b1,0xbb));var _0x129b=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x29b1[_0x42bc91];return _0x3f5507;};'use strict';var _=require('lodash');var util=require(_0x129b('0x0'));var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x129b('0x1'),_0x129b('0x1'),_0x129b('0x2'),'NO\x20ANSWER',_0x129b('0x2'),_0x129b('0x3'),_0x129b('0x4'),_0x129b('0x1'),'FAILED',_0x129b('0x1')];var channels={};function writeDB(_0x1e2e84){var _0xe9a999;if(transfers[_0x129b('0x5')][_0x1e2e84[_0x129b('0x6')]]){_0xe9a999=_0x1e2e84['uniqueid'];_0x1e2e84['uniqueid']=transfers[_0x129b('0x5')][_0x1e2e84[_0x129b('0x6')]]['transfereeuniqueid'];}utils[_0x129b('0x7')](util['format'](_0x129b('0x8'),_0x1e2e84['uniqueid'],_0x1e2e84[_0x129b('0x9')],_0x1e2e84['queue'],_0x1e2e84['membername'],_0x1e2e84[_0x129b('0xa')],_0x1e2e84['calleridnum'],_0x1e2e84[_0x129b('0xb')],_0x1e2e84[_0x129b('0xc')]));if(_0x1e2e84[_0x129b('0xd')]){utils[_0x129b('0xe')](_0x1e2e84['accountcode'])[_0x129b('0xf')](function(_0x31af49){if(_0x31af49){_0x1e2e84[_0x129b('0x10')]=_0x31af49['id'];}utils[_0x129b('0x11')](_0x129b('0x12'),_0x1e2e84);});}else{utils[_0x129b('0x11')](_0x129b('0x12'),_0x1e2e84);}if(channels[_0x1e2e84[_0x129b('0x6')]]){delete channels[_0x1e2e84[_0x129b('0x6')]];}else if(_0xe9a999&&channels[_0xe9a999]){if(!transfers[_0x129b('0x5')][_0xe9a999][_0x129b('0x13')])delete transfers[_0x129b('0x5')][_0xe9a999];delete channels[_0xe9a999];}}exports[_0x129b('0x14')]=function(_0x10939e){try{utils[_0x129b('0x15')](util[_0x129b('0x16')](_0x129b('0x17'),_0x10939e[_0x129b('0x6')]),_0x10939e);if(_0x10939e[_0x129b('0x6')]==_0x10939e[_0x129b('0x18')]&&_0x10939e[_0x129b('0x9')]!=_0x129b('0x19')){utils[_0x129b('0x7')](util['format'](_0x129b('0x1a'),_0x10939e[_0x129b('0x6')],_0x10939e[_0x129b('0x1b')],_0x10939e['exten']));channels[_0x10939e[_0x129b('0x6')]]={'uniqueid':_0x10939e['uniqueid'],'accountcode':_0x10939e['accountcode'],'source':_0x10939e[_0x129b('0x1c')],'destination':_0x10939e[_0x129b('0x1d')],'destinationcontext':_0x10939e[_0x129b('0x1b')],'channel':_0x10939e[_0x129b('0x9')],'starttime':utils[_0x129b('0x1e')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x51cc74){utils[_0x129b('0x1f')](util['format'](_0x129b('0x17'),_0x10939e['uniqueid']),_0x51cc74);}};exports[_0x129b('0x20')]=function(_0x59df3b){try{utils[_0x129b('0x15')](util[_0x129b('0x16')](_0x129b('0x21'),_0x59df3b['uniqueid']),_0x59df3b);if(!_[_0x129b('0x22')](channels[_0x59df3b[_0x129b('0x6')]])&&_0x59df3b['channelstate']==0x6){utils[_0x129b('0x7')](util['format'](_0x129b('0x23'),_0x59df3b['uniqueid'],_0x59df3b[_0x129b('0x1b')],_0x59df3b[_0x129b('0x9')]));if(_[_0x129b('0x22')](channels[_0x59df3b[_0x129b('0x6')]][_0x129b('0x24')])){channels[_0x59df3b[_0x129b('0x6')]][_0x129b('0x24')]=utils[_0x129b('0x1e')]();}}else if(!_['isNil'](channels[_0x59df3b[_0x129b('0x18')]])&&_0x59df3b[_0x129b('0x25')]==0x6&&_0x59df3b[_0x129b('0x1b')]!=_0x129b('0x26')){utils[_0x129b('0x7')](util[_0x129b('0x16')](_0x129b('0x27'),_0x59df3b['uniqueid'],_0x59df3b[_0x129b('0x18')],_0x59df3b[_0x129b('0x1b')],_0x59df3b[_0x129b('0x9')]));channels[_0x59df3b[_0x129b('0x18')]]['accountcode']=_0x59df3b[_0x129b('0xd')];channels[_0x59df3b['linkedid']][_0x129b('0x28')]=_0x59df3b[_0x129b('0x9')];if(_['isNil'](channels[_0x59df3b[_0x129b('0x18')]][_0x129b('0x29')])){channels[_0x59df3b[_0x129b('0x18')]]['answertime']=utils[_0x129b('0x1e')]();}channels[_0x59df3b['linkedid']][_0x129b('0x2a')]=dispositions[_[_0x129b('0x2b')](_0x59df3b[_0x129b('0x25')])]||_0x129b('0x3');}}catch(_0x26b818){utils['error'](util[_0x129b('0x16')]('[%s][calls][newstate]',_0x59df3b[_0x129b('0x6')]),_0x26b818);}};exports[_0x129b('0x2c')]=function(_0x306e69){try{if(!_['isNil'](channels[_0x306e69['uniqueid']])){utils[_0x129b('0x15')](util[_0x129b('0x16')]('[%s][calls][hangup]',_0x306e69[_0x129b('0x6')]),_0x306e69);if(_['isNil'](channels[_0x306e69['uniqueid']][_0x129b('0x2d')])){channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x2d')]=_0x306e69['calleridname']+'\x20<'+_0x306e69[_0x129b('0x1c')]+'>';}utils['info'](util['format'](_0x129b('0x2e'),_0x306e69[_0x129b('0x6')],channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x2d')],_0x306e69[_0x129b('0x2f')]));channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x30')]=utils[_0x129b('0x1e')]();channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x31')]=utils[_0x129b('0x32')](channels[_0x306e69[_0x129b('0x6')]]['endtime'],channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x33')]);channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x34')]=channels[_0x306e69[_0x129b('0x6')]][_0x129b('0x29')]?utils[_0x129b('0x32')](channels[_0x306e69['uniqueid']][_0x129b('0x30')],channels[_0x306e69[_0x129b('0x6')]]['answertime']):0x0;writeDB(channels[_0x306e69[_0x129b('0x6')]]);}}catch(_0x8b2f7c){utils[_0x129b('0x1f')](util[_0x129b('0x16')](_0x129b('0x35'),_0x306e69[_0x129b('0x6')]),_0x8b2f7c);}};exports[_0x129b('0x36')]=function(_0x59a2c2){try{if(!_['isNil'](channels[_0x59a2c2[_0x129b('0x37')]])){utils[_0x129b('0x15')](util['format'](_0x129b('0x38'),_0x59a2c2['origtransfereruniqueid']),_0x59a2c2);if(channels[_0x59a2c2['localtwolinkedid']][_0x129b('0x9')]==_0x59a2c2[_0x129b('0x39')]){utils[_0x129b('0x7')](util[_0x129b('0x16')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x59a2c2[_0x129b('0x3a')],_0x59a2c2['localtwolinkedid'],_0x59a2c2[_0x129b('0x3b')]));channels[_0x59a2c2['localtwolinkedid']][_0x129b('0x28')]=_0x59a2c2['secondtransfererchannel'];channels[_0x59a2c2[_0x129b('0x37')]]['userfield']=_0x129b('0x3c');}else if(channels[_0x59a2c2[_0x129b('0x37')]]['channel']=_0x59a2c2[_0x129b('0x3d')]){utils[_0x129b('0x7')](util['format'](_0x129b('0x3e'),_0x59a2c2[_0x129b('0x3a')],_0x59a2c2[_0x129b('0x37')],_0x59a2c2['origtransfererchannel']));channels[_0x59a2c2[_0x129b('0x37')]][_0x129b('0x28')]=_0x59a2c2[_0x129b('0x3f')];channels[_0x59a2c2['localtwolinkedid']][_0x129b('0x40')]=_0x129b('0x3c');}}}catch(_0x4bd491){utils[_0x129b('0x1f')](util['format'](_0x129b('0x38'),_0x59a2c2[_0x129b('0x3a')]),_0x4bd491);}};exports[_0x129b('0x41')]=function(_0xaa0a88){try{if(!_[_0x129b('0x22')](channels[_0xaa0a88[_0x129b('0x6')]])){utils[_0x129b('0x15')](util[_0x129b('0x16')](_0x129b('0x42'),_0xaa0a88['uniqueid']),_0xaa0a88);channels[_0xaa0a88[_0x129b('0x6')]]['musiconholdstartAt']=utils[_0x129b('0x1e')]();utils[_0x129b('0x7')](util[_0x129b('0x16')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0xaa0a88[_0x129b('0x6')],channels[_0xaa0a88['uniqueid']]['musiconholdstartAt']));}}catch(_0x42ee9e){utils['error'](util[_0x129b('0x16')]('[%s][calls][musiconholdstart]',_0xaa0a88[_0x129b('0x6')]),_0x42ee9e);}};exports[_0x129b('0x43')]=function(_0x1c328c){try{if(!_[_0x129b('0x22')](channels[_0x1c328c[_0x129b('0x6')]])){utils[_0x129b('0x15')](util[_0x129b('0x16')](_0x129b('0x44'),_0x1c328c['uniqueid']),_0x1c328c);if(!_[_0x129b('0x22')](channels[_0x1c328c[_0x129b('0x6')]][_0x129b('0x45')])){channels[_0x1c328c[_0x129b('0x6')]]['mohtime']+=utils[_0x129b('0x32')](utils[_0x129b('0x1e')](),channels[_0x1c328c[_0x129b('0x6')]][_0x129b('0x45')]);utils['info'](util[_0x129b('0x16')](_0x129b('0x46'),_0x1c328c[_0x129b('0x6')],channels[_0x1c328c[_0x129b('0x6')]]['mohtime']));delete channels[_0x1c328c[_0x129b('0x6')]][_0x129b('0x45')];}}}catch(_0x34d68a){utils['error'](util[_0x129b('0x16')](_0x129b('0x44'),_0x1c328c[_0x129b('0x6')]),_0x34d68a);}};exports[_0x129b('0x47')]=function(_0x4ae7ea){try{if(!_['isNil'](channels[_0x4ae7ea[_0x129b('0x6')]])){utils[_0x129b('0x15')](util['format'](_0x129b('0x48'),_0x4ae7ea[_0x129b('0x6')]),_0x4ae7ea);if(!_[_0x129b('0x22')](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x4a')])){utils[_0x129b('0x7')](util[_0x129b('0x16')](_0x129b('0x4b'),_0x4ae7ea[_0x129b('0x6')],_0x4ae7ea['value']));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x4c')]=_0x4ae7ea['value'];}if(!_['isNil'](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x4d')])){utils['info'](util['format'](_0x129b('0x4e'),_0x4ae7ea[_0x129b('0x6')],_0x4ae7ea['value']));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x4f')]=_0x4ae7ea[_0x129b('0x50')];channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x2d')]='\x22'+_0x4ae7ea[_0x129b('0x50')]+'\x22\x20<'+_0x4ae7ea['value']+'>';}if(!_[_0x129b('0x22')](_0x4ae7ea['variable'][_0x129b('0x51')])||!_[_0x129b('0x22')](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x52')])){utils[_0x129b('0x7')](util[_0x129b('0x16')](_0x129b('0x53'),_0x4ae7ea['uniqueid'],!_[_0x129b('0x22')](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x51')])?_0x129b('0x51'):_0x129b('0x52'),_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea['uniqueid']]['callerid']=_0x4ae7ea[_0x129b('0x50')];}if(!_[_0x129b('0x22')](_0x4ae7ea['variable'][_0x129b('0x54')])||!_[_0x129b('0x22')](_0x4ae7ea['variable']['xmcs-queue'])){utils['info'](util[_0x129b('0x16')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4ae7ea['uniqueid'],!_[_0x129b('0x22')](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x54')])?'xmd-queue':_0x129b('0x55'),_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x56')]='Queue';channels[_0x4ae7ea[_0x129b('0x6')]]['lastdata']=_0x4ae7ea[_0x129b('0x50')];channels[_0x4ae7ea['uniqueid']]['queue']=!![];}if(!_[_0x129b('0x22')](_0x4ae7ea[_0x129b('0x49')][_0x129b('0x57')])){utils['info'](util[_0x129b('0x16')](_0x129b('0x58'),_0x4ae7ea[_0x129b('0x6')],_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x59')]=_0x4ae7ea['value'];}if(!_['isNil'](_0x4ae7ea['variable'][_0x129b('0x5a')])){utils['info'](util[_0x129b('0x16')](_0x129b('0x5b'),_0x4ae7ea['uniqueid'],_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x5c')]=_0x4ae7ea[_0x129b('0x50')];}if(!_[_0x129b('0x22')](_0x4ae7ea['variable']['outboundrouteid'])){utils[_0x129b('0x7')](util[_0x129b('0x16')](_0x129b('0x5d'),_0x4ae7ea[_0x129b('0x6')],_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea[_0x129b('0x6')]][_0x129b('0x5e')]=_0x4ae7ea[_0x129b('0x50')];}if(!_['isNil'](_0x4ae7ea[_0x129b('0x49')]['sipcallid'])){utils[_0x129b('0x7')](util[_0x129b('0x16')](_0x129b('0x5f'),_0x4ae7ea[_0x129b('0x6')],_0x4ae7ea[_0x129b('0x50')]));channels[_0x4ae7ea['uniqueid']]['sipcallid']=_0x4ae7ea['value'];}}}catch(_0xebfd88){utils[_0x129b('0x1f')](util[_0x129b('0x16')](_0x129b('0x48'),_0x4ae7ea['uniqueid']),_0xebfd88);}};exports[_0x129b('0x60')]=function(_0x101df5){try{if(!_[_0x129b('0x22')](channels[_0x101df5[_0x129b('0x6')]])){utils[_0x129b('0x15')](util[_0x129b('0x16')](_0x129b('0x61'),_0x101df5['uniqueid']),_0x101df5);utils[_0x129b('0x7')](util['format'](_0x129b('0x62'),_0x101df5[_0x129b('0x6')],_0x101df5[_0x129b('0x63')],_0x101df5[_0x129b('0x64')]));if(_0x101df5['application'][_0x129b('0x65')]()==_0x129b('0x66')&&_[_0x129b('0x67')](_0x101df5[_0x129b('0x64')]['toLowerCase'](),_0x129b('0x68'))){var _0x4ecabb=_0x101df5['appdata'][_0x129b('0x69')]('=');var _0x3c8607=_0x4ecabb[0x0][_0x129b('0x6a')](_0x4ecabb[0x0][_0x129b('0x6b')]('(')+0x1,_0x4ecabb[0x0][_0x129b('0x6b')](')'));var _0x50793d=_0x4ecabb[0x1];channels[_0x101df5[_0x129b('0x6')]][_0x3c8607]=_0x50793d;}if(!_[_0x129b('0x6c')](['hangup',_0x129b('0x6d'),_0x129b('0x6e'),_0x129b('0x66'),'gotoif'],_0x101df5['application'][_0x129b('0x65')]())){channels[_0x101df5[_0x129b('0x6')]]['lastapplication']=_0x101df5[_0x129b('0x63')];channels[_0x101df5[_0x129b('0x6')]][_0x129b('0x6f')]=_0x101df5[_0x129b('0x64')];}}}catch(_0x311484){utils[_0x129b('0x1f')](util['format'](_0x129b('0x61'),_0x101df5[_0x129b('0x6')]),_0x311484);}};
\ No newline at end of file
+var _0x870d=['sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','noop','execif','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','uniqueid','blinds','transfereeuniqueid','info','channel','queue','interface','calleridnum','lastevent','accountcode','UserId','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','isNil','transfer','toNumber','error','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds','attendedtransfer','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','destinationchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','value','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid'];(function(_0x19f2b3,_0x5590bc){var _0x29e0d6=function(_0x527ef5){while(--_0x527ef5){_0x19f2b3['push'](_0x19f2b3['shift']());}};_0x29e0d6(++_0x5590bc);}(_0x870d,0xde));var _0xd870=function(_0x156f59,_0x5f37f3){_0x156f59=_0x156f59-0x0;var _0x8be76e=_0x870d[_0x156f59];return _0x8be76e;};'use strict';var _=require('lodash');var util=require(_0xd870('0x0'));var utils=require(_0xd870('0x1'));var transfers=require(_0xd870('0x2'));var dispositions=[_0xd870('0x3'),_0xd870('0x4'),_0xd870('0x4'),'NO\x20ANSWER',_0xd870('0x3'),_0xd870('0x3'),_0xd870('0x5'),_0xd870('0x6'),_0xd870('0x4'),'FAILED',_0xd870('0x4')];var channels={};function writeDB(_0x1718c6){var _0x29d38b;if(transfers['blinds'][_0x1718c6['uniqueid']]){_0x29d38b=_0x1718c6[_0xd870('0x7')];_0x1718c6[_0xd870('0x7')]=transfers[_0xd870('0x8')][_0x1718c6[_0xd870('0x7')]][_0xd870('0x9')];}utils[_0xd870('0xa')](util['format']('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1718c6[_0xd870('0x7')],_0x1718c6[_0xd870('0xb')],_0x1718c6[_0xd870('0xc')],_0x1718c6['membername'],_0x1718c6[_0xd870('0xd')],_0x1718c6[_0xd870('0xe')],_0x1718c6['connectedlinenum'],_0x1718c6[_0xd870('0xf')]));if(_0x1718c6[_0xd870('0x10')]){utils['getUserByInternal'](_0x1718c6[_0xd870('0x10')])['then'](function(_0x34e325){if(_0x34e325){_0x1718c6[_0xd870('0x11')]=_0x34e325['id'];}utils[_0xd870('0x12')](_0xd870('0x13'),_0x1718c6);});}else{utils['request'](_0xd870('0x13'),_0x1718c6);}if(channels[_0x1718c6[_0xd870('0x7')]]){delete channels[_0x1718c6['uniqueid']];}else if(_0x29d38b&&channels[_0x29d38b]){if(!transfers[_0xd870('0x8')][_0x29d38b][_0xd870('0x14')])delete transfers[_0xd870('0x8')][_0x29d38b];delete channels[_0x29d38b];}}exports['newchannel']=function(_0x361563){try{utils[_0xd870('0x15')](util['format'](_0xd870('0x16'),_0x361563[_0xd870('0x7')]),_0x361563);if(_0x361563['uniqueid']==_0x361563[_0xd870('0x17')]&&_0x361563[_0xd870('0xb')]!='OutgoingSpoolFailed'){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x19'),_0x361563[_0xd870('0x7')],_0x361563['context'],_0x361563['exten']));channels[_0x361563[_0xd870('0x7')]]={'uniqueid':_0x361563[_0xd870('0x7')],'accountcode':_0x361563['accountcode'],'source':_0x361563['calleridnum'],'destination':_0x361563[_0xd870('0x1a')],'destinationcontext':_0x361563[_0xd870('0x1b')],'channel':_0x361563[_0xd870('0xb')],'starttime':utils[_0xd870('0x1c')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xd870('0x3'),'amaflags':_0xd870('0x1d')};}}catch(_0x134b84){utils['error'](util[_0xd870('0x18')](_0xd870('0x16'),_0x361563[_0xd870('0x7')]),_0x134b84);}};exports[_0xd870('0x1e')]=function(_0x2b3628){try{utils[_0xd870('0x15')](util[_0xd870('0x18')](_0xd870('0x1f'),_0x2b3628[_0xd870('0x7')]),_0x2b3628);if(!_['isNil'](channels[_0x2b3628['uniqueid']])&&_0x2b3628[_0xd870('0x20')]==0x6){utils[_0xd870('0xa')](util['format'](_0xd870('0x21'),_0x2b3628[_0xd870('0x7')],_0x2b3628[_0xd870('0x1b')],_0x2b3628[_0xd870('0xb')]));if(_['isNil'](channels[_0x2b3628[_0xd870('0x7')]][_0xd870('0x22')])){channels[_0x2b3628['uniqueid']][_0xd870('0x22')]=utils['now']();}}else if(!_[_0xd870('0x23')](channels[_0x2b3628['linkedid']])&&_0x2b3628['channelstate']==0x6&&_0x2b3628['context']!=_0xd870('0x24')){utils[_0xd870('0xa')](util['format']('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2b3628['uniqueid'],_0x2b3628['linkedid'],_0x2b3628[_0xd870('0x1b')],_0x2b3628['channel']));channels[_0x2b3628[_0xd870('0x17')]]['accountcode']=_0x2b3628['accountcode'];channels[_0x2b3628[_0xd870('0x17')]]['destinationchannel']=_0x2b3628[_0xd870('0xb')];if(_[_0xd870('0x23')](channels[_0x2b3628[_0xd870('0x17')]]['answertime'])){channels[_0x2b3628[_0xd870('0x17')]]['answertime']=utils[_0xd870('0x1c')]();}channels[_0x2b3628[_0xd870('0x17')]]['disposition']=dispositions[_[_0xd870('0x25')](_0x2b3628[_0xd870('0x20')])]||_0xd870('0x5');}}catch(_0x288c17){utils[_0xd870('0x26')](util['format'](_0xd870('0x1f'),_0x2b3628['uniqueid']),_0x288c17);}};exports[_0xd870('0x27')]=function(_0x1013a5){try{if(!_['isNil'](channels[_0x1013a5[_0xd870('0x7')]])){utils['debug'](util[_0xd870('0x18')](_0xd870('0x28'),_0x1013a5[_0xd870('0x7')]),_0x1013a5);if(_[_0xd870('0x23')](channels[_0x1013a5[_0xd870('0x7')]][_0xd870('0x29')])){channels[_0x1013a5[_0xd870('0x7')]]['callerid']=_0x1013a5[_0xd870('0x2a')]+'\x20<'+_0x1013a5[_0xd870('0xe')]+'>';}utils[_0xd870('0xa')](util['format'](_0xd870('0x2b'),_0x1013a5[_0xd870('0x7')],channels[_0x1013a5[_0xd870('0x7')]][_0xd870('0x29')],_0x1013a5['cause-txt']));channels[_0x1013a5['uniqueid']][_0xd870('0x2c')]=utils[_0xd870('0x1c')]();channels[_0x1013a5[_0xd870('0x7')]][_0xd870('0x2d')]=utils[_0xd870('0x2e')](channels[_0x1013a5['uniqueid']][_0xd870('0x2c')],channels[_0x1013a5['uniqueid']][_0xd870('0x2f')]);channels[_0x1013a5[_0xd870('0x7')]][_0xd870('0x30')]=channels[_0x1013a5['uniqueid']]['answertime']?utils['diffTime'](channels[_0x1013a5[_0xd870('0x7')]][_0xd870('0x2c')],channels[_0x1013a5[_0xd870('0x7')]]['answertime']):0x0;writeDB(channels[_0x1013a5[_0xd870('0x7')]]);}}catch(_0x3d1f48){utils[_0xd870('0x26')](util['format'](_0xd870('0x28'),_0x1013a5['uniqueid']),_0x3d1f48);}};exports[_0xd870('0x31')]=function(_0xef6a82){try{if(!_[_0xd870('0x23')](channels[_0xef6a82['localtwolinkedid']])){utils[_0xd870('0x15')](util['format']('[%s][calls][attendedtransfer]',_0xef6a82[_0xd870('0x32')]),_0xef6a82);if(channels[_0xef6a82[_0xd870('0x33')]][_0xd870('0xb')]==_0xef6a82[_0xd870('0x34')]){utils[_0xd870('0xa')](util['format'](_0xd870('0x35'),_0xef6a82['origtransfereruniqueid'],_0xef6a82[_0xd870('0x33')],_0xef6a82[_0xd870('0x36')]));channels[_0xef6a82[_0xd870('0x33')]][_0xd870('0x37')]=_0xef6a82[_0xd870('0x36')];channels[_0xef6a82[_0xd870('0x33')]][_0xd870('0x38')]=_0xd870('0x39');}else if(channels[_0xef6a82[_0xd870('0x33')]][_0xd870('0xb')]=_0xef6a82[_0xd870('0x3a')]){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x35'),_0xef6a82[_0xd870('0x32')],_0xef6a82[_0xd870('0x33')],_0xef6a82[_0xd870('0x3b')]));channels[_0xef6a82[_0xd870('0x33')]]['destinationchannel']=_0xef6a82['origtransfererchannel'];channels[_0xef6a82[_0xd870('0x33')]][_0xd870('0x38')]='_attended';}}}catch(_0x1b2e78){utils['error'](util[_0xd870('0x18')](_0xd870('0x3c'),_0xef6a82['origtransfereruniqueid']),_0x1b2e78);}};exports['musiconholdstart']=function(_0x243d6b){try{if(!_['isNil'](channels[_0x243d6b[_0xd870('0x7')]])){utils[_0xd870('0x15')](util[_0xd870('0x18')](_0xd870('0x3d'),_0x243d6b[_0xd870('0x7')]),_0x243d6b);channels[_0x243d6b[_0xd870('0x7')]][_0xd870('0x3e')]=utils['now']();utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x3f'),_0x243d6b[_0xd870('0x7')],channels[_0x243d6b[_0xd870('0x7')]][_0xd870('0x3e')]));}}catch(_0x17bc0b){utils['error'](util['format'](_0xd870('0x3d'),_0x243d6b['uniqueid']),_0x17bc0b);}};exports[_0xd870('0x40')]=function(_0x10871c){try{if(!_[_0xd870('0x23')](channels[_0x10871c[_0xd870('0x7')]])){utils[_0xd870('0x15')](util[_0xd870('0x18')](_0xd870('0x41'),_0x10871c['uniqueid']),_0x10871c);if(!_[_0xd870('0x23')](channels[_0x10871c[_0xd870('0x7')]][_0xd870('0x3e')])){channels[_0x10871c[_0xd870('0x7')]][_0xd870('0x42')]+=utils[_0xd870('0x2e')](utils['now'](),channels[_0x10871c[_0xd870('0x7')]][_0xd870('0x3e')]);utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x43'),_0x10871c['uniqueid'],channels[_0x10871c[_0xd870('0x7')]][_0xd870('0x42')]));delete channels[_0x10871c['uniqueid']][_0xd870('0x3e')];}}}catch(_0x16fcbf){utils['error'](util[_0xd870('0x18')](_0xd870('0x41'),_0x10871c[_0xd870('0x7')]),_0x16fcbf);}};exports[_0xd870('0x44')]=function(_0x10cfc4){try{if(!_[_0xd870('0x23')](channels[_0x10cfc4['uniqueid']])){utils[_0xd870('0x15')](util[_0xd870('0x18')](_0xd870('0x45'),_0x10cfc4[_0xd870('0x7')]),_0x10cfc4);if(!_[_0xd870('0x23')](_0x10cfc4['variable'][_0xd870('0x46')])){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x47'),_0x10cfc4[_0xd870('0x7')],_0x10cfc4['value']));channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x48')]=_0x10cfc4['value'];}if(!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')][_0xd870('0x4a')])){utils[_0xd870('0xa')](util['format'](_0xd870('0x4b'),_0x10cfc4['uniqueid'],_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x4d')]=_0x10cfc4[_0xd870('0x4c')];channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x29')]='\x22'+_0x10cfc4['value']+'\x22\x20<'+_0x10cfc4[_0xd870('0x4c')]+'>';}if(!_['isNil'](_0x10cfc4[_0xd870('0x49')][_0xd870('0x4e')])||!_[_0xd870('0x23')](_0x10cfc4['variable'][_0xd870('0x4f')])){utils[_0xd870('0xa')](util[_0xd870('0x18')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x10cfc4['uniqueid'],!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')]['xmd-callerid-preview'])?_0xd870('0x4e'):_0xd870('0x4f'),_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]]['callerid']=_0x10cfc4[_0xd870('0x4c')];}if(!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')][_0xd870('0x50')])||!_[_0xd870('0x23')](_0x10cfc4['variable']['xmcs-queue'])){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x51'),_0x10cfc4[_0xd870('0x7')],!_['isNil'](_0x10cfc4[_0xd870('0x49')][_0xd870('0x50')])?_0xd870('0x50'):'xmcs-queue',_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x52')]=_0xd870('0x53');channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x54')]=_0x10cfc4[_0xd870('0x4c')];channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0xc')]=!![];}if(!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')]['xmd-contactid'])){utils[_0xd870('0xa')](util[_0xd870('0x18')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x10cfc4['uniqueid'],_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]]['ContactId']=_0x10cfc4['value'];}if(!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')][_0xd870('0x55')])){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x56'),_0x10cfc4['uniqueid'],_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]]['type']=_0x10cfc4['value'];}if(!_['isNil'](_0x10cfc4[_0xd870('0x49')][_0xd870('0x57')])){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x58'),_0x10cfc4['uniqueid'],_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x59')]=_0x10cfc4['value'];}if(!_[_0xd870('0x23')](_0x10cfc4[_0xd870('0x49')][_0xd870('0x5a')])){utils[_0xd870('0xa')](util[_0xd870('0x18')](_0xd870('0x5b'),_0x10cfc4[_0xd870('0x7')],_0x10cfc4[_0xd870('0x4c')]));channels[_0x10cfc4[_0xd870('0x7')]][_0xd870('0x5a')]=_0x10cfc4[_0xd870('0x4c')];}}}catch(_0x1208c7){utils[_0xd870('0x26')](util[_0xd870('0x18')](_0xd870('0x45'),_0x10cfc4['uniqueid']),_0x1208c7);}};exports[_0xd870('0x5c')]=function(_0x1d8cbd){try{if(!_[_0xd870('0x23')](channels[_0x1d8cbd[_0xd870('0x7')]])){utils[_0xd870('0x15')](util[_0xd870('0x18')](_0xd870('0x5d'),_0x1d8cbd[_0xd870('0x7')]),_0x1d8cbd);utils[_0xd870('0xa')](util[_0xd870('0x18')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x1d8cbd['uniqueid'],_0x1d8cbd[_0xd870('0x5e')],_0x1d8cbd['appdata']));if(_0x1d8cbd[_0xd870('0x5e')][_0xd870('0x5f')]()==_0xd870('0x60')&&_[_0xd870('0x61')](_0x1d8cbd[_0xd870('0x62')][_0xd870('0x5f')](),_0xd870('0x63'))){var _0x119ea7=_0x1d8cbd[_0xd870('0x62')][_0xd870('0x64')]('=');var _0x4c69a9=_0x119ea7[0x0][_0xd870('0x65')](_0x119ea7[0x0]['lastIndexOf']('(')+0x1,_0x119ea7[0x0]['lastIndexOf'](')'));var _0x129fcd=_0x119ea7[0x1];channels[_0x1d8cbd['uniqueid']][_0x4c69a9]=_0x129fcd;}if(!_['includes']([_0xd870('0x27'),_0xd870('0x66'),_0xd870('0x67'),'set','gotoif'],_0x1d8cbd[_0xd870('0x5e')]['toLowerCase']())){channels[_0x1d8cbd[_0xd870('0x7')]]['lastapplication']=_0x1d8cbd['application'];channels[_0x1d8cbd[_0xd870('0x7')]][_0xd870('0x54')]=_0x1d8cbd[_0xd870('0x62')];}}}catch(_0x39422a){utils[_0xd870('0x26')](util[_0xd870('0x18')](_0xd870('0x5d'),_0x1d8cbd['uniqueid']),_0x39422a);}};
\ No newline at end of file
index df7853e..7ed1427 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff15=['shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected'];(function(_0x43f552,_0x42808c){var _0x17911b=function(_0x4407a7){while(--_0x4407a7){_0x43f552['push'](_0x43f552['shift']());}};_0x17911b(++_0x42808c);}(_0xff15,0x188));var _0x5ff1=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0xff15[_0x2136a6];return _0x55b948;};'use strict';var utils=require(_0x5ff1('0x0'));exports[_0x5ff1('0x1')]=function(){utils[_0x5ff1('0x2')](_0x5ff1('0x3'));};exports[_0x5ff1('0x4')]=function(){utils[_0x5ff1('0x2')](_0x5ff1('0x5'));};exports['fullybooted']=function(){utils[_0x5ff1('0x2')](_0x5ff1('0x6'));};exports[_0x5ff1('0x7')]=function(_0x3a639b){utils[_0x5ff1('0x7')](_0x5ff1('0x8'),_0x3a639b);};exports[_0x5ff1('0x9')]=function(){utils[_0x5ff1('0x2')](_0x5ff1('0xa'));};exports[_0x5ff1('0xb')]=function(_0x47d8b7){};
\ No newline at end of file
+var _0x5315=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0xb5a81f,_0x551b76){var _0x471224=function(_0x11fd26){while(--_0x11fd26){_0xb5a81f['push'](_0xb5a81f['shift']());}};_0x471224(++_0x551b76);}(_0x5315,0x1a5));var _0x5531=function(_0x4b3cf5,_0x48544d){_0x4b3cf5=_0x4b3cf5-0x0;var _0x272403=_0x5315[_0x4b3cf5];return _0x272403;};'use strict';var utils=require(_0x5531('0x0'));exports[_0x5531('0x1')]=function(){utils[_0x5531('0x2')](_0x5531('0x3'));};exports[_0x5531('0x4')]=function(){utils[_0x5531('0x2')]('[core]\x20shutdown');};exports[_0x5531('0x5')]=function(){utils[_0x5531('0x2')](_0x5531('0x6'));};exports[_0x5531('0x7')]=function(_0x139a3f){utils[_0x5531('0x7')](_0x5531('0x8'),_0x139a3f);};exports[_0x5531('0x9')]=function(){utils[_0x5531('0x2')](_0x5531('0xa'));};exports[_0x5531('0xb')]=function(_0x1eec92){};
\ No newline at end of file
index 0507aeb..9bd5b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa854=['appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','endtime','holdtime','diffTime','billableseconds','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s'];(function(_0x22612b,_0x577731){var _0x4aee02=function(_0x29d07c){while(--_0x29d07c){_0x22612b['push'](_0x22612b['shift']());}};_0x4aee02(++_0x577731);}(_0xa854,0x1d4));var _0x4a85=function(_0x5b53da,_0x408525){_0x5b53da=_0x5b53da-0x0;var _0x450738=_0xa854[_0x5b53da];return _0x450738;};'use strict';var _=require(_0x4a85('0x0'));var util=require(_0x4a85('0x1'));var utils=require(_0x4a85('0x2'));var dials={};function writeDB(_0x55b784){utils[_0x4a85('0x3')](util[_0x4a85('0x4')](_0x4a85('0x5'),_0x55b784[_0x4a85('0x6')],_0x55b784[_0x4a85('0x7')],_0x55b784[_0x4a85('0x8')],_0x55b784[_0x4a85('0x9')],_0x55b784[_0x4a85('0xa')],_0x55b784[_0x4a85('0xb')]));utils[_0x4a85('0xc')](_0x4a85('0xd'),_0x55b784);delete dials[_0x55b784[_0x4a85('0x6')]];}exports[_0x4a85('0xe')]=function(_0x47089f){try{utils[_0x4a85('0xf')](util['format'](_0x4a85('0x10'),_0x47089f[_0x4a85('0x6')]),_0x47089f);utils[_0x4a85('0x3')](util[_0x4a85('0x4')](_0x4a85('0x11'),_0x47089f[_0x4a85('0x6')],_0x47089f['application'],_0x47089f[_0x4a85('0x12')]));if(_0x47089f[_0x4a85('0x13')][_0x4a85('0x14')]()==_0x4a85('0x15')&&_[_0x4a85('0x16')](_0x47089f[_0x4a85('0x12')][_0x4a85('0x14')](),_0x4a85('0x17'))){var _0xe8acca=_0x47089f[_0x4a85('0x12')][_0x4a85('0x18')]('=');dials[_0x47089f[_0x4a85('0x6')]]={'routeId':_0xe8acca[0x1]};}}catch(_0x9bf8e7){utils[_0x4a85('0x19')](util[_0x4a85('0x4')](_0x4a85('0x10'),_0x47089f[_0x4a85('0x6')]),_0x9bf8e7);}};exports[_0x4a85('0x1a')]=function(_0x5183d2){try{utils[_0x4a85('0xf')](util[_0x4a85('0x4')](_0x4a85('0x1b'),_0x5183d2['uniqueid']),_0x5183d2);if(!_['isNil'](_0x5183d2['variable'][_0x4a85('0x1c')])){utils[_0x4a85('0x3')](util[_0x4a85('0x4')](_0x4a85('0x1d'),_0x5183d2[_0x4a85('0x6')],_0x5183d2['value']));dials[_0x5183d2[_0x4a85('0x6')]]={'routeId':_0x5183d2[_0x4a85('0x1e')]};}}catch(_0x205148){utils[_0x4a85('0x19')](util[_0x4a85('0x4')]('[%s][dials][varset]',_0x5183d2[_0x4a85('0x6')]),_0x205148);}};exports[_0x4a85('0x1f')]=function(_0x5d2334){try{if(!_[_0x4a85('0x20')](dials[_0x5d2334[_0x4a85('0x6')]])){utils[_0x4a85('0xf')](util[_0x4a85('0x4')](_0x4a85('0x21'),_0x5d2334['uniqueid']),_0x5d2334);dials[_0x5d2334[_0x4a85('0x6')]]=_[_0x4a85('0x22')](dials[_0x5d2334[_0x4a85('0x6')]],_0x5d2334);dials[_0x5d2334['uniqueid']][_0x4a85('0x23')]=utils['now']();dials[_0x5d2334['uniqueid']][_0x4a85('0x24')]=_0x4a85('0x25');utils['info'](util[_0x4a85('0x4')](_0x4a85('0x26'),_0x5d2334[_0x4a85('0x6')],dials[_0x5d2334[_0x4a85('0x6')]]['starttime']));}}catch(_0x5563c0){utils['error'](util['format']('[%s][dials][dialbegin]',_0x5d2334['uniqueid']),_0x5563c0);}};exports['dialend']=function(_0xa5371f){try{if(!_[_0x4a85('0x20')](dials[_0xa5371f[_0x4a85('0x6')]])){utils['debug'](util['format'](_0x4a85('0x27'),_0xa5371f[_0x4a85('0x6')]),_0xa5371f);dials[_0xa5371f[_0x4a85('0x6')]][_0x4a85('0xb')]=_0xa5371f[_0x4a85('0xb')];if(_0xa5371f[_0x4a85('0xb')]==_0x4a85('0x28')){dials[_0xa5371f[_0x4a85('0x6')]]=_[_0x4a85('0x22')](dials[_0xa5371f[_0x4a85('0x6')]],_0xa5371f);dials[_0xa5371f[_0x4a85('0x6')]][_0x4a85('0x29')]=utils[_0x4a85('0x2a')]();dials[_0xa5371f[_0x4a85('0x6')]][_0x4a85('0x24')]=_0x4a85('0x2b');utils[_0x4a85('0x3')](util[_0x4a85('0x4')](_0x4a85('0x2c'),_0xa5371f[_0x4a85('0x6')],_0xa5371f['dialstatus'],dials[_0xa5371f[_0x4a85('0x6')]][_0x4a85('0x29')]));}else{utils[_0x4a85('0x3')](util[_0x4a85('0x4')](_0x4a85('0x2d'),_0xa5371f['uniqueid'],_0xa5371f[_0x4a85('0xb')]));}}}catch(_0x525bdc){utils['error'](util[_0x4a85('0x4')](_0x4a85('0x27'),_0xa5371f[_0x4a85('0x6')]),_0x525bdc);}};exports['hangup']=function(_0x1edc6a){try{if(!_[_0x4a85('0x20')](dials[_0x1edc6a[_0x4a85('0x6')]])){utils[_0x4a85('0xf')](util[_0x4a85('0x4')](_0x4a85('0x2e'),_0x1edc6a[_0x4a85('0x6')]),_0x1edc6a);utils[_0x4a85('0x3')](util['format'](_0x4a85('0x2f'),_0x1edc6a[_0x4a85('0x6')],_0x1edc6a[_0x4a85('0x9')],_0x1edc6a['calleridname'],_0x1edc6a[_0x4a85('0x30')]));dials[_0x1edc6a[_0x4a85('0x6')]]=_[_0x4a85('0x22')](dials[_0x1edc6a['uniqueid']],{'endtime':utils[_0x4a85('0x2a')](),'lastevent':_0x4a85('0x31')});dials[_0x1edc6a[_0x4a85('0x6')]]['duration']=utils['diffTime'](dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x32')],dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x23')]);dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x33')]=utils[_0x4a85('0x34')](dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x29')]||dials[_0x1edc6a[_0x4a85('0x6')]]['endtime'],dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x23')]);dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x35')]=dials[_0x1edc6a[_0x4a85('0x6')]]['answertime']?utils[_0x4a85('0x34')](dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x32')],dials[_0x1edc6a[_0x4a85('0x6')]][_0x4a85('0x29')]):0x0;writeDB(dials[_0x1edc6a[_0x4a85('0x6')]]);}}catch(_0x2b74e0){utils['error'](util[_0x4a85('0x4')](_0x4a85('0x2e'),_0x1edc6a[_0x4a85('0x6')]),_0x2b74e0);}};
\ No newline at end of file
+var _0xf1b2=['hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','[%s][dials][hangup]','lodash','util','info','uniqueid','channel','dialstring','calleridnum','dialstatus','CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','application','toLowerCase','set','startsWith','appdata','error','varset','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][dialend]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1b2,0x1a3));var _0x2f1b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1b2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2f1b('0x0'));var util=require(_0x2f1b('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x3fa899){utils[_0x2f1b('0x2')](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x3fa899[_0x2f1b('0x3')],_0x3fa899[_0x2f1b('0x4')],_0x3fa899[_0x2f1b('0x5')],_0x3fa899[_0x2f1b('0x6')],_0x3fa899['connectedlinenum'],_0x3fa899[_0x2f1b('0x7')]));utils['request'](_0x2f1b('0x8'),_0x3fa899);delete dials[_0x3fa899['uniqueid']];}exports[_0x2f1b('0x9')]=function(_0x3908f5){try{utils[_0x2f1b('0xa')](util[_0x2f1b('0xb')](_0x2f1b('0xc'),_0x3908f5[_0x2f1b('0x3')]),_0x3908f5);utils[_0x2f1b('0x2')](util[_0x2f1b('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x3908f5['uniqueid'],_0x3908f5[_0x2f1b('0xd')],_0x3908f5['appdata']));if(_0x3908f5['application'][_0x2f1b('0xe')]()==_0x2f1b('0xf')&&_[_0x2f1b('0x10')](_0x3908f5['appdata']['toLowerCase'](),'cdr(routeid)')){var _0x45ccbf=_0x3908f5[_0x2f1b('0x11')]['split']('=');dials[_0x3908f5['uniqueid']]={'routeId':_0x45ccbf[0x1]};}}catch(_0x16ae23){utils[_0x2f1b('0x12')](util[_0x2f1b('0xb')](_0x2f1b('0xc'),_0x3908f5[_0x2f1b('0x3')]),_0x16ae23);}};exports[_0x2f1b('0x13')]=function(_0x1b1288){try{utils['debug'](util[_0x2f1b('0xb')]('[%s][dials][varset]',_0x1b1288[_0x2f1b('0x3')]),_0x1b1288);if(!_['isNil'](_0x1b1288[_0x2f1b('0x14')][_0x2f1b('0x15')])){utils[_0x2f1b('0x2')](util[_0x2f1b('0xb')](_0x2f1b('0x16'),_0x1b1288[_0x2f1b('0x3')],_0x1b1288[_0x2f1b('0x17')]));dials[_0x1b1288[_0x2f1b('0x3')]]={'routeId':_0x1b1288['value']};}}catch(_0x5d6f19){utils[_0x2f1b('0x12')](util[_0x2f1b('0xb')](_0x2f1b('0x18'),_0x1b1288['uniqueid']),_0x5d6f19);}};exports['dialbegin']=function(_0x372819){try{if(!_[_0x2f1b('0x19')](dials[_0x372819[_0x2f1b('0x3')]])){utils[_0x2f1b('0xa')](util['format'](_0x2f1b('0x1a'),_0x372819[_0x2f1b('0x3')]),_0x372819);dials[_0x372819[_0x2f1b('0x3')]]=_[_0x2f1b('0x1b')](dials[_0x372819[_0x2f1b('0x3')]],_0x372819);dials[_0x372819[_0x2f1b('0x3')]][_0x2f1b('0x1c')]=utils[_0x2f1b('0x1d')]();dials[_0x372819[_0x2f1b('0x3')]][_0x2f1b('0x1e')]=_0x2f1b('0x1f');utils['info'](util[_0x2f1b('0xb')](_0x2f1b('0x20'),_0x372819[_0x2f1b('0x3')],dials[_0x372819[_0x2f1b('0x3')]][_0x2f1b('0x1c')]));}}catch(_0x10355f){utils[_0x2f1b('0x12')](util[_0x2f1b('0xb')](_0x2f1b('0x1a'),_0x372819['uniqueid']),_0x10355f);}};exports[_0x2f1b('0x21')]=function(_0x5b8f35){try{if(!_['isNil'](dials[_0x5b8f35[_0x2f1b('0x3')]])){utils[_0x2f1b('0xa')](util[_0x2f1b('0xb')]('[%s][dials][dialend]',_0x5b8f35['uniqueid']),_0x5b8f35);dials[_0x5b8f35[_0x2f1b('0x3')]][_0x2f1b('0x7')]=_0x5b8f35[_0x2f1b('0x7')];if(_0x5b8f35[_0x2f1b('0x7')]==_0x2f1b('0x22')){dials[_0x5b8f35[_0x2f1b('0x3')]]=_['assign'](dials[_0x5b8f35[_0x2f1b('0x3')]],_0x5b8f35);dials[_0x5b8f35[_0x2f1b('0x3')]][_0x2f1b('0x23')]=utils[_0x2f1b('0x1d')]();dials[_0x5b8f35[_0x2f1b('0x3')]][_0x2f1b('0x1e')]=_0x2f1b('0x24');utils[_0x2f1b('0x2')](util[_0x2f1b('0xb')](_0x2f1b('0x25'),_0x5b8f35[_0x2f1b('0x3')],_0x5b8f35[_0x2f1b('0x7')],dials[_0x5b8f35[_0x2f1b('0x3')]][_0x2f1b('0x23')]));}else{utils[_0x2f1b('0x2')](util[_0x2f1b('0xb')](_0x2f1b('0x26'),_0x5b8f35['uniqueid'],_0x5b8f35[_0x2f1b('0x7')]));}}}catch(_0x55e61b){utils[_0x2f1b('0x12')](util[_0x2f1b('0xb')](_0x2f1b('0x27'),_0x5b8f35[_0x2f1b('0x3')]),_0x55e61b);}};exports[_0x2f1b('0x28')]=function(_0x1dbba6){try{if(!_['isNil'](dials[_0x1dbba6[_0x2f1b('0x3')]])){utils[_0x2f1b('0xa')](util[_0x2f1b('0xb')]('[%s][dials][hangup]',_0x1dbba6[_0x2f1b('0x3')]),_0x1dbba6);utils['info'](util[_0x2f1b('0xb')](_0x2f1b('0x29'),_0x1dbba6[_0x2f1b('0x3')],_0x1dbba6[_0x2f1b('0x6')],_0x1dbba6[_0x2f1b('0x2a')],_0x1dbba6[_0x2f1b('0x2b')]));dials[_0x1dbba6[_0x2f1b('0x3')]]=_[_0x2f1b('0x1b')](dials[_0x1dbba6['uniqueid']],{'endtime':utils['now'](),'lastevent':_0x2f1b('0x2c')});dials[_0x1dbba6['uniqueid']][_0x2f1b('0x2d')]=utils[_0x2f1b('0x2e')](dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x2f')],dials[_0x1dbba6['uniqueid']][_0x2f1b('0x1c')]);dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x30')]=utils[_0x2f1b('0x2e')](dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x23')]||dials[_0x1dbba6['uniqueid']][_0x2f1b('0x2f')],dials[_0x1dbba6['uniqueid']][_0x2f1b('0x1c')]);dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x31')]=dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x23')]?utils[_0x2f1b('0x2e')](dials[_0x1dbba6[_0x2f1b('0x3')]][_0x2f1b('0x2f')],dials[_0x1dbba6['uniqueid']][_0x2f1b('0x23')]):0x0;writeDB(dials[_0x1dbba6[_0x2f1b('0x3')]]);}}catch(_0x182cca){utils[_0x2f1b('0x12')](util[_0x2f1b('0xb')](_0x2f1b('0x32'),_0x1dbba6[_0x2f1b('0x3')]),_0x182cca);}};
\ No newline at end of file
index 0f8a004..250fdaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe28c=['./utils','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','device','[%s][index][devicestatechange]','[%s][index][agentcalled]','uniqueid','agentcalled','agentringnoanswer','debug','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','[%s][index][cdr]','cdr','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment'];(function(_0x1fb983,_0x386880){var _0x4e1676=function(_0x182655){while(--_0x182655){_0x1fb983['push'](_0x1fb983['shift']());}};_0x4e1676(++_0x386880);}(_0xe28c,0x8c));var _0xce28=function(_0x1a6399,_0x437d38){_0x1a6399=_0x1a6399-0x0;var _0x3a42d1=_0xe28c[_0x1a6399];return _0x3a42d1;};var AsteriskManager=require(_0xce28('0x0'));var config=require(_0xce28('0x1'));var utils=require(_0xce28('0x2'));var util=require(_0xce28('0x3'));var isXDREnabled=config[_0xce28('0x4')]&&config[_0xce28('0x4')][_0xce28('0x5')]?!config['xdr']['disabled']:!![];var isProduction=config['env']===_0xce28('0x6')||![];var isLocalAsterisk=config[_0xce28('0x4')]&&config[_0xce28('0x4')][_0xce28('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0xce28('0x8')][_0xce28('0x9')],config[_0xce28('0x8')]['ip'],config[_0xce28('0x8')][_0xce28('0xa')],config[_0xce28('0x8')][_0xce28('0xb')],!![]);ami[_0xce28('0xc')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xce28('0xd')](_0xce28('0xe'));}else{var agents=require(_0xce28('0xf'));var calls=require(_0xce28('0x10'));var queues=require(_0xce28('0x11'));var recordings=require(_0xce28('0x12'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0xce28('0x13'));var core=require(_0xce28('0x14'));ami['on'](_0xce28('0x15'),core[_0xce28('0x15')]);ami['on'](_0xce28('0x16'),core[_0xce28('0x16')]);ami['on'](_0xce28('0x17'),core[_0xce28('0x17')]);ami['on'](_0xce28('0x18'),core[_0xce28('0x18')]);ami['on'](_0xce28('0x19'),core[_0xce28('0x19')]);ami['on'](_0xce28('0x1a'),core[_0xce28('0x1a')]);ami['on'](_0xce28('0x1b'),function(_0x1e47f2){try{utils['debug'](util[_0xce28('0x1c')]('[%s][index][devicestatechange]',_0x1e47f2[_0xce28('0x1d')]),_0x1e47f2);members[_0xce28('0x1b')](_0x1e47f2);}catch(_0x3ed9ad){utils['error'](util[_0xce28('0x1c')](_0xce28('0x1e'),_0x1e47f2[_0xce28('0x1d')]),_0x3ed9ad);}});ami['on']('agentcalled',function(_0x476b09){try{utils['debug'](util[_0xce28('0x1c')](_0xce28('0x1f'),_0x476b09[_0xce28('0x20')]),_0x476b09);agents[_0xce28('0x21')](_0x476b09);}catch(_0x2b6768){utils[_0xce28('0x18')](util['format'](_0xce28('0x1f'),_0x476b09[_0xce28('0x20')]),_0x2b6768);}});ami['on'](_0xce28('0x22'),function(_0xb1157a){try{utils[_0xce28('0x23')](util['format']('[%s][index][agentringnoanswer]',_0xb1157a[_0xce28('0x20')]),_0xb1157a);agents['agentringnoanswer'](_0xb1157a);}catch(_0x33839e){utils['error'](util[_0xce28('0x1c')]('[%s][index][agentringnoanswer]',_0xb1157a[_0xce28('0x20')]),_0x33839e);}});ami['on'](_0xce28('0x24'),function(_0x5a4ff2){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x25'),_0x5a4ff2[_0xce28('0x20')]),_0x5a4ff2);agents[_0xce28('0x24')](_0x5a4ff2);queues['agentconnect'](_0x5a4ff2);}catch(_0x2d839a){utils[_0xce28('0x18')](util[_0xce28('0x1c')](_0xce28('0x25'),_0x5a4ff2[_0xce28('0x20')]),_0x2d839a);}});ami['on']('agentcomplete',function(_0x327caf){try{utils[_0xce28('0x23')](util['format']('[%s][index][agentcomplete]',_0x327caf[_0xce28('0x20')]),_0x327caf);agents[_0xce28('0x26')](_0x327caf);queues['agentcomplete'](_0x327caf);members[_0xce28('0x26')](_0x327caf);}catch(_0x170612){utils[_0xce28('0x18')](util[_0xce28('0x1c')](_0xce28('0x27'),_0x327caf[_0xce28('0x20')]),_0x170612);}});ami['on']('queuecallerabandon',function(_0x1cfbf4){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')]('[%s][index][queuecallerabandon]',_0x1cfbf4[_0xce28('0x20')]),_0x1cfbf4);agents[_0xce28('0x28')](_0x1cfbf4);queues[_0xce28('0x28')](_0x1cfbf4);}catch(_0xd9b60f){utils['error'](util[_0xce28('0x1c')](_0xce28('0x29'),_0x1cfbf4['uniqueid']),_0xd9b60f);}});ami['on'](_0xce28('0x2a'),function(_0x754c07){try{utils['debug'](util[_0xce28('0x1c')]('[%s][index][queuecallerjoin]',_0x754c07[_0xce28('0x20')]),_0x754c07);queues[_0xce28('0x2a')](_0x754c07);recordings['queuecallerjoin'](_0x754c07);}catch(_0x5ac33f){utils['error'](util[_0xce28('0x1c')](_0xce28('0x2b'),_0x754c07[_0xce28('0x20')]),_0x5ac33f);}});ami['on'](_0xce28('0x2c'),function(_0x1f68f0){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x2d'),_0x1f68f0[_0xce28('0x20')]),_0x1f68f0);queues['queuecallerleave'](_0x1f68f0);}catch(_0x9ef8ef){utils['error'](util[_0xce28('0x1c')](_0xce28('0x2d'),_0x1f68f0[_0xce28('0x20')]),_0x9ef8ef);}});ami['on'](_0xce28('0x2e'),function(_0x143464){try{utils[_0xce28('0x23')](util['format'](_0xce28('0x2f'),_0x143464[_0xce28('0x20')]),_0x143464);queues[_0xce28('0x2e')](_0x143464);calls[_0xce28('0x2e')](_0x143464);}catch(_0x355a19){utils['error'](util['format']('[%s][index][musiconholdstart]',_0x143464[_0xce28('0x20')]),_0x355a19);}});ami['on'](_0xce28('0x30'),function(_0x37f0e5){try{utils[_0xce28('0x23')](util['format'](_0xce28('0x31'),_0x37f0e5[_0xce28('0x20')]),_0x37f0e5);queues[_0xce28('0x30')](_0x37f0e5);calls['musiconholdstop'](_0x37f0e5);}catch(_0x2c5b34){utils['error'](util[_0xce28('0x1c')](_0xce28('0x31'),_0x37f0e5[_0xce28('0x20')]),_0x2c5b34);}});ami['on']('newstate',function(_0x2a1e77){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')]('[%s][index][newstate]',_0x2a1e77['uniqueid']),_0x2a1e77);calls['newstate'](_0x2a1e77);recordings[_0xce28('0x32')](_0x2a1e77);}catch(_0x522946){utils['error'](util[_0xce28('0x1c')](_0xce28('0x33'),_0x2a1e77['uniqueid']),_0x522946);}});ami['on']('hangup',function(_0x4e61a0){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x34'),_0x4e61a0[_0xce28('0x20')]),_0x4e61a0);calls[_0xce28('0x35')](_0x4e61a0);recordings[_0xce28('0x35')](_0x4e61a0);dials[_0xce28('0x35')](_0x4e61a0);agents[_0xce28('0x35')](_0x4e61a0);queues[_0xce28('0x35')](_0x4e61a0);}catch(_0x35410d){utils[_0xce28('0x18')](util[_0xce28('0x1c')]('[%s][index][hangup]',_0x4e61a0[_0xce28('0x20')]),_0x35410d);}});ami['on']('cdr',function(_0x3cf0ad){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x36'),_0x3cf0ad['uniqueid']),_0x3cf0ad);members[_0xce28('0x37')](_0x3cf0ad);}catch(_0x37b8ea){utils[_0xce28('0x18')](util[_0xce28('0x1c')](_0xce28('0x36'),_0x3cf0ad['uniqueid']),_0x37b8ea);}});ami['on']('blindtransfer',function(_0x2b5845){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x38'),_0x2b5845[_0xce28('0x20')]),_0x2b5845);queues[_0xce28('0x39')](_0x2b5845);agents[_0xce28('0x39')](_0x2b5845);transfers['blindtransfer'](_0x2b5845);recordings[_0xce28('0x39')](_0x2b5845);}catch(_0x51def2){utils['error'](util[_0xce28('0x1c')]('[%s][index][blindtransfer]',_0x2b5845[_0xce28('0x20')]),_0x51def2);}});ami['on']('attendedtransfer',function(_0x40f45d){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x3a'),_0x40f45d[_0xce28('0x3b')]),_0x40f45d);queues[_0xce28('0x3c')](_0x40f45d);transfers['attendedtransfer'](_0x40f45d);agents[_0xce28('0x3c')](_0x40f45d);calls['attendedtransfer'](_0x40f45d);}catch(_0x19069a){utils['error'](util[_0xce28('0x1c')](_0xce28('0x3a'),_0x40f45d[_0xce28('0x3b')]),_0x19069a);}});ami['on'](_0xce28('0x3d'),function(_0x246d38){try{utils[_0xce28('0x23')](util['format']('[%s][index][varset]',_0x246d38[_0xce28('0x20')]),_0x246d38);queues[_0xce28('0x3d')](_0x246d38);recordings['varset'](_0x246d38);calls[_0xce28('0x3d')](_0x246d38);dials[_0xce28('0x3d')](_0x246d38);}catch(_0x49a919){utils['error'](util[_0xce28('0x1c')]('[%s][index][varset]',_0x246d38[_0xce28('0x20')]),_0x49a919);}});ami['on']('newexten',function(_0x694edc){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x3e'),_0x694edc[_0xce28('0x20')]),_0x694edc);calls[_0xce28('0x3f')](_0x694edc);recordings[_0xce28('0x3f')](_0x694edc);dials['newexten'](_0x694edc);}catch(_0x52ee8e){utils[_0xce28('0x18')](util[_0xce28('0x1c')](_0xce28('0x3e'),_0x694edc[_0xce28('0x20')]),_0x52ee8e);}});ami['on']('newchannel',function(_0x3c54b9){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x40'),_0x3c54b9[_0xce28('0x20')]),_0x3c54b9);calls[_0xce28('0x41')](_0x3c54b9);recordings[_0xce28('0x41')](_0x3c54b9);}catch(_0x22d60f){utils[_0xce28('0x18')](util[_0xce28('0x1c')](_0xce28('0x40'),_0x3c54b9[_0xce28('0x20')]),_0x22d60f);}});ami['on'](_0xce28('0x42'),function(_0x20dd62){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x43'),_0x20dd62[_0xce28('0x20')]),_0x20dd62);dials['dialbegin'](_0x20dd62);}catch(_0x4cbcab){utils[_0xce28('0x18')](util['format'](_0xce28('0x44'),_0x20dd62[_0xce28('0x20')]),_0x4cbcab);}});ami['on'](_0xce28('0x45'),function(_0x342b0c){try{utils[_0xce28('0x23')](util[_0xce28('0x1c')](_0xce28('0x46'),_0x342b0c['uniqueid']),_0x342b0c);dials[_0xce28('0x45')](_0x342b0c);}catch(_0x416619){utils[_0xce28('0x18')](util[_0xce28('0x1c')]('[%s][index][dialend]',_0x342b0c[_0xce28('0x20')]),_0x416619);}});}
\ No newline at end of file
+var _0x90b8=['musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','port','asterisk','password','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','[%s][index][devicestatechange]','format','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]'];(function(_0x274311,_0x2005ac){var _0x39df7e=function(_0x22fbb9){while(--_0x22fbb9){_0x274311['push'](_0x274311['shift']());}};_0x39df7e(++_0x2005ac);}(_0x90b8,0x135));var _0x890b=function(_0x1ac77b,_0x10ee7a){_0x1ac77b=_0x1ac77b-0x0;var _0x161584=_0x90b8[_0x1ac77b];return _0x161584;};var AsteriskManager=require(_0x890b('0x0'));var config=require(_0x890b('0x1'));var utils=require(_0x890b('0x2'));var util=require(_0x890b('0x3'));var isXDREnabled=config[_0x890b('0x4')]&&config[_0x890b('0x4')][_0x890b('0x5')]?!config[_0x890b('0x4')]['disabled']:!![];var isProduction=config[_0x890b('0x6')]===_0x890b('0x7')||![];var isLocalAsterisk=config[_0x890b('0x4')]&&config['xdr'][_0x890b('0x8')]===!![]||![];var ami=new AsteriskManager(config['asterisk'][_0x890b('0x9')],config['asterisk']['ip'],config[_0x890b('0xa')]['username'],config['asterisk'][_0x890b('0xb')],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x890b('0xc')](_0x890b('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x890b('0xc')](_0x890b('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0x890b('0xf'));var queues=require('./queues.controller');var recordings=require(_0x890b('0x10'));var members=require(_0x890b('0x11'));var dials=require(_0x890b('0x12'));var transfers=require(_0x890b('0x13'));var core=require('./core.controller');ami['on'](_0x890b('0x14'),core[_0x890b('0x14')]);ami['on'](_0x890b('0x15'),core[_0x890b('0x15')]);ami['on'](_0x890b('0x16'),core['fullybooted']);ami['on'](_0x890b('0x17'),core[_0x890b('0x17')]);ami['on'](_0x890b('0x18'),core[_0x890b('0x18')]);ami['on']('managerevent',core[_0x890b('0x19')]);ami['on'](_0x890b('0x1a'),function(_0x475400){try{utils[_0x890b('0x1b')](util['format'](_0x890b('0x1c'),_0x475400['device']),_0x475400);members['devicestatechange'](_0x475400);}catch(_0x5226b8){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x1c'),_0x475400[_0x890b('0x1e')]),_0x5226b8);}});ami['on'](_0x890b('0x1f'),function(_0x1985a9){try{utils['debug'](util[_0x890b('0x1d')](_0x890b('0x20'),_0x1985a9[_0x890b('0x21')]),_0x1985a9);agents['agentcalled'](_0x1985a9);}catch(_0x5a548d){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x20'),_0x1985a9['uniqueid']),_0x5a548d);}});ami['on']('agentringnoanswer',function(_0x1f1ebc){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x22'),_0x1f1ebc[_0x890b('0x21')]),_0x1f1ebc);agents[_0x890b('0x23')](_0x1f1ebc);}catch(_0x362ccb){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x22'),_0x1f1ebc[_0x890b('0x21')]),_0x362ccb);}});ami['on'](_0x890b('0x24'),function(_0x3ddda3){try{utils['debug'](util['format'](_0x890b('0x25'),_0x3ddda3['uniqueid']),_0x3ddda3);agents[_0x890b('0x24')](_0x3ddda3);queues['agentconnect'](_0x3ddda3);}catch(_0x231dd7){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x25'),_0x3ddda3[_0x890b('0x21')]),_0x231dd7);}});ami['on']('agentcomplete',function(_0x22fc8e){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x26'),_0x22fc8e[_0x890b('0x21')]),_0x22fc8e);agents[_0x890b('0x27')](_0x22fc8e);queues[_0x890b('0x27')](_0x22fc8e);members[_0x890b('0x27')](_0x22fc8e);}catch(_0x200f27){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x26'),_0x22fc8e[_0x890b('0x21')]),_0x200f27);}});ami['on']('queuecallerabandon',function(_0x4049cf){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x28'),_0x4049cf[_0x890b('0x21')]),_0x4049cf);agents[_0x890b('0x29')](_0x4049cf);queues[_0x890b('0x29')](_0x4049cf);}catch(_0xa5a1fd){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x28'),_0x4049cf[_0x890b('0x21')]),_0xa5a1fd);}});ami['on'](_0x890b('0x2a'),function(_0x1707f6){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x2b'),_0x1707f6[_0x890b('0x21')]),_0x1707f6);queues[_0x890b('0x2a')](_0x1707f6);recordings[_0x890b('0x2a')](_0x1707f6);}catch(_0x2d3ec3){utils[_0x890b('0x17')](util['format'](_0x890b('0x2b'),_0x1707f6['uniqueid']),_0x2d3ec3);}});ami['on'](_0x890b('0x2c'),function(_0x710de5){try{utils[_0x890b('0x1b')](util['format']('[%s][index][queuecallerleave]',_0x710de5[_0x890b('0x21')]),_0x710de5);queues[_0x890b('0x2c')](_0x710de5);}catch(_0x1ffe7f){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x2d'),_0x710de5[_0x890b('0x21')]),_0x1ffe7f);}});ami['on'](_0x890b('0x2e'),function(_0x31855d){try{utils[_0x890b('0x1b')](util['format']('[%s][index][musiconholdstart]',_0x31855d[_0x890b('0x21')]),_0x31855d);queues[_0x890b('0x2e')](_0x31855d);calls[_0x890b('0x2e')](_0x31855d);}catch(_0x12fb62){utils['error'](util[_0x890b('0x1d')]('[%s][index][musiconholdstart]',_0x31855d[_0x890b('0x21')]),_0x12fb62);}});ami['on'](_0x890b('0x2f'),function(_0x553b0c){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x30'),_0x553b0c[_0x890b('0x21')]),_0x553b0c);queues['musiconholdstop'](_0x553b0c);calls[_0x890b('0x2f')](_0x553b0c);}catch(_0xd8a164){utils[_0x890b('0x17')](util['format'](_0x890b('0x30'),_0x553b0c[_0x890b('0x21')]),_0xd8a164);}});ami['on'](_0x890b('0x31'),function(_0x26c966){try{utils['debug'](util[_0x890b('0x1d')](_0x890b('0x32'),_0x26c966['uniqueid']),_0x26c966);calls['newstate'](_0x26c966);recordings[_0x890b('0x31')](_0x26c966);}catch(_0x1cc097){utils['error'](util['format'](_0x890b('0x32'),_0x26c966[_0x890b('0x21')]),_0x1cc097);}});ami['on'](_0x890b('0x33'),function(_0x4a1b00){try{utils['debug'](util[_0x890b('0x1d')](_0x890b('0x34'),_0x4a1b00[_0x890b('0x21')]),_0x4a1b00);calls[_0x890b('0x33')](_0x4a1b00);recordings[_0x890b('0x33')](_0x4a1b00);dials[_0x890b('0x33')](_0x4a1b00);agents[_0x890b('0x33')](_0x4a1b00);queues[_0x890b('0x33')](_0x4a1b00);}catch(_0x23bf61){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x34'),_0x4a1b00['uniqueid']),_0x23bf61);}});ami['on'](_0x890b('0x35'),function(_0x44bb77){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x36'),_0x44bb77['uniqueid']),_0x44bb77);members[_0x890b('0x35')](_0x44bb77);}catch(_0x1bbec6){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x36'),_0x44bb77[_0x890b('0x21')]),_0x1bbec6);}});ami['on'](_0x890b('0x37'),function(_0x13decb){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')]('[%s][index][blindtransfer]',_0x13decb['uniqueid']),_0x13decb);queues[_0x890b('0x37')](_0x13decb);agents[_0x890b('0x37')](_0x13decb);transfers[_0x890b('0x37')](_0x13decb);recordings[_0x890b('0x37')](_0x13decb);}catch(_0x3b3a55){utils['error'](util['format'](_0x890b('0x38'),_0x13decb[_0x890b('0x21')]),_0x3b3a55);}});ami['on']('attendedtransfer',function(_0x3cd2ef){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x39'),_0x3cd2ef[_0x890b('0x3a')]),_0x3cd2ef);queues[_0x890b('0x3b')](_0x3cd2ef);transfers['attendedtransfer'](_0x3cd2ef);agents['attendedtransfer'](_0x3cd2ef);calls['attendedtransfer'](_0x3cd2ef);}catch(_0x4213b9){utils[_0x890b('0x17')](util['format']('[%s][index][attendedtransfer]',_0x3cd2ef[_0x890b('0x3a')]),_0x4213b9);}});ami['on'](_0x890b('0x3c'),function(_0xccddfd){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x3d'),_0xccddfd[_0x890b('0x21')]),_0xccddfd);queues[_0x890b('0x3c')](_0xccddfd);recordings[_0x890b('0x3c')](_0xccddfd);calls[_0x890b('0x3c')](_0xccddfd);dials[_0x890b('0x3c')](_0xccddfd);}catch(_0xf10123){utils['error'](util[_0x890b('0x1d')](_0x890b('0x3d'),_0xccddfd[_0x890b('0x21')]),_0xf10123);}});ami['on'](_0x890b('0x3e'),function(_0x228dca){try{utils[_0x890b('0x1b')](util['format'](_0x890b('0x3f'),_0x228dca[_0x890b('0x21')]),_0x228dca);calls[_0x890b('0x3e')](_0x228dca);recordings[_0x890b('0x3e')](_0x228dca);dials[_0x890b('0x3e')](_0x228dca);}catch(_0x444ebd){utils['error'](util[_0x890b('0x1d')](_0x890b('0x3f'),_0x228dca[_0x890b('0x21')]),_0x444ebd);}});ami['on'](_0x890b('0x40'),function(_0x1ea64d){try{utils[_0x890b('0x1b')](util['format'](_0x890b('0x41'),_0x1ea64d[_0x890b('0x21')]),_0x1ea64d);calls[_0x890b('0x40')](_0x1ea64d);recordings['newchannel'](_0x1ea64d);}catch(_0x5cd95b){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x41'),_0x1ea64d[_0x890b('0x21')]),_0x5cd95b);}});ami['on']('dialbegin',function(_0x482371){try{utils[_0x890b('0x1b')](util[_0x890b('0x1d')](_0x890b('0x42'),_0x482371[_0x890b('0x21')]),_0x482371);dials[_0x890b('0x43')](_0x482371);}catch(_0x257405){utils[_0x890b('0x17')](util[_0x890b('0x1d')](_0x890b('0x44'),_0x482371[_0x890b('0x21')]),_0x257405);}});ami['on'](_0x890b('0x45'),function(_0x53ad9e){try{utils['debug'](util[_0x890b('0x1d')](_0x890b('0x46'),_0x53ad9e[_0x890b('0x21')]),_0x53ad9e);dials[_0x890b('0x45')](_0x53ad9e);}catch(_0x238046){utils[_0x890b('0x17')](util['format'](_0x890b('0x46'),_0x53ad9e['uniqueid']),_0x238046);}});}
\ No newline at end of file
index 92df1bd..9f5630d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5022=['split','assign','data1','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','source','lodash','./utils','Local/_attended@transfer','Queue:','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','data2','membername','type','getUserByInterface','then','name','CreateMemberReport','getUserByName','internal','catch','error','format','[%s][members][writeDB]','uniqueid','startsWith','devicestatechange','[%s][members][devicestatechange]','device','info','state','BUSY','voice','TALKING','agent','isNil','duration','diffTime','exitAt','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]'];(function(_0x33e96c,_0xcc86d9){var _0x4f5eea=function(_0x16d0f0){while(--_0x16d0f0){_0x33e96c['push'](_0x33e96c['shift']());}};_0x4f5eea(++_0xcc86d9);}(_0x5022,0xd0));var _0x2502=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x5022[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x2502('0x0'));var util=require('util');var utils=require(_0x2502('0x1'));var members={};var exclude=[_0x2502('0x2'),_0x2502('0x3')];function writeDB(_0x5a5943){utils['info'](util['format'](_0x2502('0x4'),_0x5a5943['uniqueid'],_0x5a5943[_0x2502('0x5')],_0x5a5943['channel'],_0x5a5943[_0x2502('0x6')],_0x5a5943[_0x2502('0x7')],_0x5a5943[_0x2502('0x8')]));if(_0x5a5943['interface']){utils[_0x2502('0x9')](_0x5a5943[_0x2502('0x5')])[_0x2502('0xa')](function(_0x17520f){if(_0x17520f){_0x5a5943['membername']=_0x17520f[_0x2502('0xb')];_0x5a5943['internal']=_0x17520f['internal'];utils['request'](_0x2502('0xc'),_0x5a5943);}else{utils[_0x2502('0xd')](_0x5a5943['interface']['split']('/')[0x1])['then'](function(_0x1a85dc){if(_0x1a85dc){_0x5a5943['membername']=_0x1a85dc[_0x2502('0xb')];_0x5a5943[_0x2502('0xe')]=_0x1a85dc[_0x2502('0xe')];utils['request'](_0x2502('0xc'),_0x5a5943);}});}})[_0x2502('0xf')](function(_0x5ed282){utils[_0x2502('0x10')](util[_0x2502('0x11')](_0x2502('0x12'),_0x5a5943[_0x2502('0x13')]),_0x5ed282);});}delete members[_0x5a5943[_0x2502('0x5')]];}function startsWith(_0x465fca,_0x3a34ca){return _['some'](_0x465fca,function(_0x25ef82){return _[_0x2502('0x14')](_0x3a34ca,_0x25ef82);});}exports[_0x2502('0x15')]=function(_0x2ab887){try{utils['debug'](util[_0x2502('0x11')](_0x2502('0x16'),members[_0x2ab887['device']]?members[_0x2ab887[_0x2502('0x17')]][_0x2502('0x13')]:_0x2ab887[_0x2502('0x17')]),_0x2ab887);utils[_0x2502('0x18')](util[_0x2502('0x11')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x2ab887[_0x2502('0x17')]]?members[_0x2ab887[_0x2502('0x17')]][_0x2502('0x13')]:_0x2ab887[_0x2502('0x17')],_0x2ab887[_0x2502('0x19')],_0x2ab887[_0x2502('0x17')]));switch(_0x2ab887[_0x2502('0x19')]){case'INUSE':case _0x2502('0x1a'):if(!startsWith(exclude,_0x2ab887[_0x2502('0x17')])){members[_0x2ab887[_0x2502('0x17')]]={'channel':_0x2502('0x1b'),'interface':_0x2ab887[_0x2502('0x17')],'type':_0x2502('0x1c'),'enterAt':utils['now'](),'role':_0x2502('0x1d')};}break;case'NOT_INUSE':if(!_[_0x2502('0x1e')](members[_0x2ab887[_0x2502('0x17')]])){members[_0x2ab887[_0x2502('0x17')]]['exitAt']=utils['now']();members[_0x2ab887[_0x2502('0x17')]][_0x2502('0x1f')]=utils[_0x2502('0x20')](members[_0x2ab887[_0x2502('0x17')]][_0x2502('0x21')],members[_0x2ab887['device']][_0x2502('0x22')]);if(members[_0x2ab887[_0x2502('0x17')]]['uniqueid']){writeDB(members[_0x2ab887['device']]);}}break;default:break;}}catch(_0x4192cf){utils[_0x2502('0x10')](util[_0x2502('0x11')](_0x2502('0x16'),members[_0x2ab887[_0x2502('0x17')]]?members[_0x2ab887[_0x2502('0x17')]][_0x2502('0x13')]:_0x2ab887[_0x2502('0x17')]),_0x4192cf);}};exports[_0x2502('0x23')]=function(_0x64c383){try{if(!_[_0x2502('0x1e')](members[_0x64c383[_0x2502('0x5')]])){utils[_0x2502('0x24')](util[_0x2502('0x11')](_0x2502('0x25'),_0x64c383[_0x2502('0x13')]),_0x64c383);utils[_0x2502('0x18')](util[_0x2502('0x11')](_0x2502('0x26'),_0x64c383['uniqueid'],_0x64c383[_0x2502('0x5')],_0x64c383[_0x2502('0x27')]));members[_0x64c383[_0x2502('0x5')]]=_['assign'](members[_0x64c383[_0x2502('0x5')]],{'data4':_0x64c383[_0x2502('0x27')],'uniqueid':_0x64c383[_0x2502('0x13')]});}}catch(_0x334427){utils[_0x2502('0x10')](util[_0x2502('0x11')](_0x2502('0x25'),_0x64c383[_0x2502('0x13')]),_0x334427);}};exports[_0x2502('0x28')]=function(_0x5aafed){try{utils[_0x2502('0x24')](util[_0x2502('0x11')](_0x2502('0x29'),_0x5aafed[_0x2502('0x13')]),_0x5aafed);if(_0x5aafed['channel']){var _0x1e26c4=_0x5aafed['channel'][_0x2502('0x2a')]('-')[0x0];if(!_[_0x2502('0x1e')](members[_0x1e26c4])){members[_0x1e26c4]=_[_0x2502('0x2b')](members[_0x1e26c4],{'data1':members[_0x1e26c4][_0x2502('0x2c')]||_0x5aafed[_0x2502('0x8')],'data2':members[_0x1e26c4]['data2']||_0x5aafed['source'],'data3':members[_0x1e26c4][_0x2502('0x2d')]||_0x5aafed[_0x2502('0x2e')],'uniqueid':members[_0x1e26c4]['uniqueid']||_0x5aafed[_0x2502('0x13')]});utils['info'](util[_0x2502('0x11')](_0x2502('0x2f'),_0x5aafed[_0x2502('0x13')],members[_0x1e26c4][_0x2502('0x2c')],members[_0x1e26c4][_0x2502('0x6')],members[_0x1e26c4][_0x2502('0x2d')]));if(members[_0x1e26c4][_0x2502('0x21')]){writeDB(members[_0x1e26c4]);}}}if(_0x5aafed[_0x2502('0x30')]){var _0x14d015=_0x5aafed[_0x2502('0x30')]['split']('-')[0x0];if(!_[_0x2502('0x1e')](members[_0x14d015])){members[_0x14d015]=_[_0x2502('0x2b')](members[_0x14d015],{'data1':members[_0x14d015][_0x2502('0x2c')]||_0x5aafed['type'],'data2':members[_0x14d015][_0x2502('0x6')]||_0x5aafed[_0x2502('0x31')],'data3':members[_0x14d015][_0x2502('0x2d')]||_0x5aafed[_0x2502('0x2e')],'uniqueid':members[_0x14d015]['uniqueid']||_0x5aafed[_0x2502('0x13')]});utils[_0x2502('0x18')](util[_0x2502('0x11')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x5aafed['uniqueid'],members[_0x14d015][_0x2502('0x2c')],members[_0x14d015]['data2'],members[_0x14d015][_0x2502('0x2d')]));if(members[_0x14d015][_0x2502('0x21')]){writeDB(members[_0x14d015]);}}}}catch(_0x352945){utils[_0x2502('0x10')](util[_0x2502('0x11')](_0x2502('0x29'),_0x5aafed[_0x2502('0x13')]),_0x352945);}};
\ No newline at end of file
+var _0x5c88=['state','INUSE','BUSY','voice','TALKING','now','NOT_INUSE','isNil','diffTime','exitAt','enterAt','error','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','membername','type','interface','getUserByInterface','then','name','internal','getUserByName','split','request','catch','[%s][members][writeDB]','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s'];(function(_0x2b737c,_0x274adf){var _0x466ed5=function(_0x593124){while(--_0x593124){_0x2b737c['push'](_0x2b737c['shift']());}};_0x466ed5(++_0x274adf);}(_0x5c88,0x158));var _0x85c8=function(_0x2c799b,_0x1d4876){_0x2c799b=_0x2c799b-0x0;var _0x2db347=_0x5c88[_0x2c799b];return _0x2db347;};'use strict';var _=require(_0x85c8('0x0'));var util=require(_0x85c8('0x1'));var utils=require('./utils');var members={};var exclude=[_0x85c8('0x2'),_0x85c8('0x3')];function writeDB(_0x45f453){utils[_0x85c8('0x4')](util[_0x85c8('0x5')](_0x85c8('0x6'),_0x45f453[_0x85c8('0x7')],_0x45f453['interface'],_0x45f453[_0x85c8('0x8')],_0x45f453['data2'],_0x45f453[_0x85c8('0x9')],_0x45f453[_0x85c8('0xa')]));if(_0x45f453[_0x85c8('0xb')]){utils[_0x85c8('0xc')](_0x45f453[_0x85c8('0xb')])[_0x85c8('0xd')](function(_0x36ad8a){if(_0x36ad8a){_0x45f453['membername']=_0x36ad8a[_0x85c8('0xe')];_0x45f453[_0x85c8('0xf')]=_0x36ad8a[_0x85c8('0xf')];utils['request']('CreateMemberReport',_0x45f453);}else{utils[_0x85c8('0x10')](_0x45f453[_0x85c8('0xb')][_0x85c8('0x11')]('/')[0x1])[_0x85c8('0xd')](function(_0x17b46e){if(_0x17b46e){_0x45f453['membername']=_0x17b46e['name'];_0x45f453[_0x85c8('0xf')]=_0x17b46e['internal'];utils[_0x85c8('0x12')]('CreateMemberReport',_0x45f453);}});}})[_0x85c8('0x13')](function(_0x358dd2){utils['error'](util[_0x85c8('0x5')](_0x85c8('0x14'),_0x45f453[_0x85c8('0x7')]),_0x358dd2);});}delete members[_0x45f453[_0x85c8('0xb')]];}function startsWith(_0x45a5bb,_0x85fd30){return _['some'](_0x45a5bb,function(_0x5589e3){return _[_0x85c8('0x15')](_0x85fd30,_0x5589e3);});}exports[_0x85c8('0x16')]=function(_0x25f7ef){try{utils[_0x85c8('0x17')](util[_0x85c8('0x5')](_0x85c8('0x18'),members[_0x25f7ef[_0x85c8('0x19')]]?members[_0x25f7ef[_0x85c8('0x19')]][_0x85c8('0x7')]:_0x25f7ef['device']),_0x25f7ef);utils[_0x85c8('0x4')](util['format'](_0x85c8('0x1a'),members[_0x25f7ef[_0x85c8('0x19')]]?members[_0x25f7ef[_0x85c8('0x19')]][_0x85c8('0x7')]:_0x25f7ef[_0x85c8('0x19')],_0x25f7ef[_0x85c8('0x1b')],_0x25f7ef[_0x85c8('0x19')]));switch(_0x25f7ef[_0x85c8('0x1b')]){case _0x85c8('0x1c'):case _0x85c8('0x1d'):if(!startsWith(exclude,_0x25f7ef['device'])){members[_0x25f7ef['device']]={'channel':_0x85c8('0x1e'),'interface':_0x25f7ef['device'],'type':_0x85c8('0x1f'),'enterAt':utils[_0x85c8('0x20')](),'role':'agent'};}break;case _0x85c8('0x21'):if(!_[_0x85c8('0x22')](members[_0x25f7ef[_0x85c8('0x19')]])){members[_0x25f7ef['device']]['exitAt']=utils[_0x85c8('0x20')]();members[_0x25f7ef['device']]['duration']=utils[_0x85c8('0x23')](members[_0x25f7ef[_0x85c8('0x19')]][_0x85c8('0x24')],members[_0x25f7ef['device']][_0x85c8('0x25')]);if(members[_0x25f7ef[_0x85c8('0x19')]][_0x85c8('0x7')]){writeDB(members[_0x25f7ef[_0x85c8('0x19')]]);}}break;default:break;}}catch(_0x4040ea){utils[_0x85c8('0x26')](util['format'](_0x85c8('0x18'),members[_0x25f7ef[_0x85c8('0x19')]]?members[_0x25f7ef[_0x85c8('0x19')]][_0x85c8('0x7')]:_0x25f7ef[_0x85c8('0x19')]),_0x4040ea);}};exports[_0x85c8('0x27')]=function(_0x2646e2){try{if(!_[_0x85c8('0x22')](members[_0x2646e2['interface']])){utils[_0x85c8('0x17')](util[_0x85c8('0x5')](_0x85c8('0x28'),_0x2646e2[_0x85c8('0x7')]),_0x2646e2);utils['info'](util[_0x85c8('0x5')](_0x85c8('0x29'),_0x2646e2['uniqueid'],_0x2646e2[_0x85c8('0xb')],_0x2646e2[_0x85c8('0x2a')]));members[_0x2646e2['interface']]=_[_0x85c8('0x2b')](members[_0x2646e2[_0x85c8('0xb')]],{'data4':_0x2646e2['queue'],'uniqueid':_0x2646e2['uniqueid']});}}catch(_0x489039){utils[_0x85c8('0x26')](util['format'](_0x85c8('0x28'),_0x2646e2[_0x85c8('0x7')]),_0x489039);}};exports[_0x85c8('0x2c')]=function(_0x13c3e0){try{utils['debug'](util['format'](_0x85c8('0x2d'),_0x13c3e0[_0x85c8('0x7')]),_0x13c3e0);if(_0x13c3e0[_0x85c8('0x8')]){var _0x121b93=_0x13c3e0[_0x85c8('0x8')][_0x85c8('0x11')]('-')[0x0];if(!_['isNil'](members[_0x121b93])){members[_0x121b93]=_[_0x85c8('0x2b')](members[_0x121b93],{'data1':members[_0x121b93][_0x85c8('0x2e')]||_0x13c3e0['type'],'data2':members[_0x121b93][_0x85c8('0x2f')]||_0x13c3e0[_0x85c8('0x30')],'data3':members[_0x121b93][_0x85c8('0x31')]||_0x13c3e0[_0x85c8('0x32')],'uniqueid':members[_0x121b93][_0x85c8('0x7')]||_0x13c3e0[_0x85c8('0x7')]});utils[_0x85c8('0x4')](util[_0x85c8('0x5')](_0x85c8('0x33'),_0x13c3e0[_0x85c8('0x7')],members[_0x121b93]['data1'],members[_0x121b93][_0x85c8('0x2f')],members[_0x121b93]['data3']));if(members[_0x121b93][_0x85c8('0x24')]){writeDB(members[_0x121b93]);}}}if(_0x13c3e0[_0x85c8('0x34')]){var _0x453631=_0x13c3e0[_0x85c8('0x34')]['split']('-')[0x0];if(!_['isNil'](members[_0x453631])){members[_0x453631]=_[_0x85c8('0x2b')](members[_0x453631],{'data1':members[_0x453631][_0x85c8('0x2e')]||_0x13c3e0[_0x85c8('0xa')],'data2':members[_0x453631][_0x85c8('0x2f')]||_0x13c3e0[_0x85c8('0x30')],'data3':members[_0x453631][_0x85c8('0x31')]||_0x13c3e0[_0x85c8('0x32')],'uniqueid':members[_0x453631][_0x85c8('0x7')]||_0x13c3e0[_0x85c8('0x7')]});utils['info'](util[_0x85c8('0x5')](_0x85c8('0x33'),_0x13c3e0[_0x85c8('0x7')],members[_0x453631]['data1'],members[_0x453631]['data2'],members[_0x453631][_0x85c8('0x31')]));if(members[_0x453631][_0x85c8('0x24')]){writeDB(members[_0x453631]);}}}}catch(_0x30ecb7){utils[_0x85c8('0x26')](util[_0x85c8('0x5')](_0x85c8('0x2d'),_0x13c3e0[_0x85c8('0x7')]),_0x30ecb7);}};
\ No newline at end of file
index 7be8714..3cace25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcdde=['queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','holdtime','count','connectedlinenum','[%s][queues][queuecallerleave]','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','diffTime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','isNil','format','queuecallerleaveAt','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','name','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt'];(function(_0x20229e,_0xa59f8a){var _0x317377=function(_0x290697){while(--_0x290697){_0x20229e['push'](_0x20229e['shift']());}};_0x317377(++_0xa59f8a);}(_0xcdde,0x109));var _0xecdd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcdde[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xecdd('0x0'));var queues={};function writeDB(_0x575160){utils[_0xecdd('0x1')](util['format'](_0xecdd('0x2'),_0x575160[_0xecdd('0x3')],_0x575160['channel'],_0x575160[_0xecdd('0x4')],_0x575160[_0xecdd('0x5')],_0x575160[_0xecdd('0x6')],_0x575160[_0xecdd('0x7')],_0x575160[_0xecdd('0x8')]));if(_0x575160['queue']){utils[_0xecdd('0x9')](_0x575160[_0xecdd('0x4')])[_0xecdd('0xa')](function(_0x414f29){if(_0x414f29){_0x575160[_0xecdd('0xb')]=_0x414f29['type'];}utils[_0xecdd('0xc')](_0xecdd('0xd'),_0x575160);});}else{utils[_0xecdd('0xc')](_0xecdd('0xd'),_0x575160);}if(_0x575160[_0xecdd('0xe')]){delete queues[_0x575160[_0xecdd('0xe')]];}else{delete queues[_0x575160['uniqueid']];}}exports[_0xecdd('0xf')]=function(_0x3cf8fb){try{utils[_0xecdd('0x10')](util['format']('[%s][queues][queuecallerjoin]',_0x3cf8fb[_0xecdd('0x3')]),_0x3cf8fb);utils[_0xecdd('0x1')](util['format'](_0xecdd('0x11'),_0x3cf8fb[_0xecdd('0x3')],_0x3cf8fb[_0xecdd('0x4')],_0x3cf8fb[_0xecdd('0x12')]));queues[_0x3cf8fb[_0xecdd('0x3')]]=_[_0xecdd('0x13')](_0x3cf8fb,{'originalposition':_0x3cf8fb[_0xecdd('0x12')],'queuecallerjoinAt':utils[_0xecdd('0x14')](),'mohtime':0x0});}catch(_0x28cfb1){utils[_0xecdd('0x15')](util['format'](_0xecdd('0x16'),_0x3cf8fb[_0xecdd('0x3')]),_0x28cfb1);}};exports[_0xecdd('0x17')]=function(_0x2f066a){try{if(!_[_0xecdd('0x18')](queues[_0x2f066a[_0xecdd('0x3')]])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')]('[%s][queues][hangup]',_0x2f066a[_0xecdd('0x3')]),_0x2f066a);if(queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0x1a')]){if(!queues[_0x2f066a['uniqueid']]['queuecallerabandon']&&!queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0x1b')]){queues[_0x2f066a['uniqueid']]['queuecallercomplete']=!![];queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0x1c')]=utils['now']();queues[_0x2f066a[_0xecdd('0x3')]]['queuecallerexitreason']=_0xecdd('0x1d');}utils[_0xecdd('0x1')](util[_0xecdd('0x19')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2f066a[_0xecdd('0x3')],queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0x1e')],queues[_0x2f066a['uniqueid']]['queuecallerexitreason']));writeDB(queues[_0x2f066a[_0xecdd('0x3')]]);}else if(queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0xe')]){utils[_0xecdd('0x1')](util[_0xecdd('0x19')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2f066a[_0xecdd('0x3')],queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0x1e')],queues[_0x2f066a[_0xecdd('0x3')]]['transfereduniqueid']));queues[queues[_0x2f066a[_0xecdd('0x3')]]['transfereduniqueid']]=queues[_0x2f066a['uniqueid']];queues[queues[_0x2f066a[_0xecdd('0x3')]][_0xecdd('0xe')]][_0xecdd('0x1f')]=0x2;delete queues[_0x2f066a[_0xecdd('0x3')]];}}}catch(_0x420c78){utils['error'](util['format'](_0xecdd('0x20'),_0x2f066a[_0xecdd('0x3')]),_0x420c78);}};exports['varset']=function(_0x252d2b){try{utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x21'),_0x252d2b[_0xecdd('0x3')]),_0x252d2b);if(!_[_0xecdd('0x18')](_0x252d2b[_0xecdd('0x22')][_0xecdd('0x23')])&&_0x252d2b[_0xecdd('0x24')][_0xecdd('0x25')]()!=='CONTINUE'){if(!_[_0xecdd('0x18')](queues[_0x252d2b[_0xecdd('0x3')]])){queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x26')]=![];queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x27')]=null;queues[_0x252d2b['uniqueid']][_0xecdd('0x1b')]=!![];queues[_0x252d2b['uniqueid']][_0xecdd('0x28')]=utils[_0xecdd('0x14')]();queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x8')]=_0x252d2b[_0xecdd('0x24')][_0xecdd('0x25')]();utils['info'](util[_0xecdd('0x19')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x252d2b[_0xecdd('0x3')],queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x1e')],_0x252d2b[_0xecdd('0x24')],queues[_0x252d2b[_0xecdd('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x252d2b[_0xecdd('0x3')]]);}}else if(!_[_0xecdd('0x18')](_0x252d2b['variable'][_0xecdd('0x29')])){if(!_[_0xecdd('0x18')](queues[_0x252d2b[_0xecdd('0x3')]])&&!queues[_0x252d2b[_0xecdd('0x3')]]['queuecallerabandon']){queues[_0x252d2b[_0xecdd('0x3')]]['queuecallerabandon']=![];queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x27')]=null;queues[_0x252d2b[_0xecdd('0x3')]]['queuecallerexit']=!![];queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x28')]=utils[_0xecdd('0x14')]();queues[_0x252d2b['uniqueid']][_0xecdd('0x8')]=_0xecdd('0x2a');utils['info'](util[_0xecdd('0x19')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x252d2b['uniqueid'],queues[_0x252d2b['uniqueid']][_0xecdd('0x1e')],_0x252d2b[_0xecdd('0x24')],queues[_0x252d2b[_0xecdd('0x3')]][_0xecdd('0x8')]));}}}catch(_0x4eb3e3){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x21'),_0x252d2b[_0xecdd('0x3')]),_0x4eb3e3);}};exports[_0xecdd('0x26')]=function(_0x2be114){try{if(!_[_0xecdd('0x18')](queues[_0x2be114[_0xecdd('0x3')]])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x2b'),_0x2be114[_0xecdd('0x3')]),_0x2be114);queues[_0x2be114['uniqueid']][_0xecdd('0x1b')]=![];queues[_0x2be114[_0xecdd('0x3')]][_0xecdd('0x28')]=null;queues[_0x2be114[_0xecdd('0x3')]][_0xecdd('0x26')]=!![];queues[_0x2be114[_0xecdd('0x3')]][_0xecdd('0x27')]=utils[_0xecdd('0x14')]();queues[_0x2be114[_0xecdd('0x3')]][_0xecdd('0x8')]=_0xecdd('0x2c');utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x2d'),_0x2be114[_0xecdd('0x3')],queues[_0x2be114[_0xecdd('0x3')]]['name'],queues[_0x2be114[_0xecdd('0x3')]][_0xecdd('0x8')]));}}catch(_0xd0a2c1){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x2b'),_0x2be114[_0xecdd('0x3')]),_0xd0a2c1);}};exports['queuecallerleave']=function(_0x5f25e4){try{if(!_['isNil'](queues[_0x5f25e4[_0xecdd('0x3')]])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')]('[%s][queues][queuecallerleave]',_0x5f25e4[_0xecdd('0x3')]),_0x5f25e4);utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x2e'),_0x5f25e4[_0xecdd('0x3')],queues[_0x5f25e4['uniqueid']]['name'],_0x5f25e4['connectedlinenum'],_0x5f25e4[_0xecdd('0x2f')]));queues[_0x5f25e4[_0xecdd('0x3')]]['queuecallerleave']=!![];queues[_0x5f25e4['uniqueid']][_0xecdd('0x1a')]=utils[_0xecdd('0x14')]();queues[_0x5f25e4[_0xecdd('0x3')]][_0xecdd('0x30')]=utils['diffTime'](queues[_0x5f25e4[_0xecdd('0x3')]][_0xecdd('0x1a')],queues[_0x5f25e4[_0xecdd('0x3')]]['queuecallerjoinAt']);queues[_0x5f25e4['uniqueid']]['position']=_0x5f25e4['position'];queues[_0x5f25e4[_0xecdd('0x3')]][_0xecdd('0x31')]=_0x5f25e4['count'];queues[_0x5f25e4['uniqueid']][_0xecdd('0x32')]=_0x5f25e4[_0xecdd('0x32')];queues[_0x5f25e4[_0xecdd('0x3')]][_0xecdd('0x2f')]=_0x5f25e4[_0xecdd('0x2f')];}}catch(_0x406921){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x33'),_0x5f25e4[_0xecdd('0x3')]),_0x406921);}};exports[_0xecdd('0x34')]=function(_0x421343){try{if(!_[_0xecdd('0x18')](queues[_0x421343[_0xecdd('0x3')]])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x35'),_0x421343[_0xecdd('0x3')]),_0x421343);utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x36'),_0x421343['uniqueid'],queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x1e')],_0x421343[_0xecdd('0x37')],_0x421343['destaccountcode']));queues[_0x421343[_0xecdd('0x3')]]['queuecallerabandon']=![];queues[_0x421343['uniqueid']][_0xecdd('0x26')]=![];queues[_0x421343['uniqueid']]['queuecallerabandonAt']=null;queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x1b')]=![];queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x8')]=null;queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x28')]=null;queues[_0x421343['uniqueid']][_0xecdd('0x38')]=!![];queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x7')]=_0x421343['destaccountcode'];queues[_0x421343[_0xecdd('0x3')]][_0xecdd('0x5')]=_0x421343[_0xecdd('0x37')];}}catch(_0x20754b){utils[_0xecdd('0x15')](util[_0xecdd('0x19')](_0xecdd('0x35'),_0x421343[_0xecdd('0x3')]),_0x20754b);}};exports[_0xecdd('0x39')]=function(_0x17d92b){try{if(!_['isNil'](queues[_0x17d92b[_0xecdd('0x3')]])){if(queues[_0x17d92b['uniqueid']]['queuecallerleaveAt']){utils['debug'](util['format'](_0xecdd('0x3a'),_0x17d92b[_0xecdd('0x3')]),_0x17d92b);queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x26')]=![];queues[_0x17d92b['uniqueid']][_0xecdd('0x26')]=![];queues[_0x17d92b['uniqueid']][_0xecdd('0x27')]=null;queues[_0x17d92b[_0xecdd('0x3')]]['queuecallerexit']=![];queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x28')]=null;queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x38')]=!![];queues[_0x17d92b['uniqueid']][_0xecdd('0x5')]=_0x17d92b[_0xecdd('0x37')];queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x3b')]=!![];queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x1c')]=utils['now']();if(_0x17d92b[_0xecdd('0x3c')]==_0xecdd('0x3d')){if(!queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x3d')]){queues[_0x17d92b[_0xecdd('0x3')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x8')]=_0xecdd('0x3e')+_0x17d92b['reason'][_0xecdd('0x25')]();}utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x3f'),_0x17d92b['uniqueid'],queues[_0x17d92b[_0xecdd('0x3')]]['name'],_0x17d92b[_0xecdd('0x37')],queues[_0x17d92b[_0xecdd('0x3')]][_0xecdd('0x8')]));writeDB(queues[_0x17d92b[_0xecdd('0x3')]]);}}}catch(_0x54ce8b){utils[_0xecdd('0x15')](util[_0xecdd('0x19')](_0xecdd('0x3a'),_0x17d92b['uniqueid']),_0x54ce8b);}};exports['blindtransfer']=function(_0x1a3b45){try{if(!_[_0xecdd('0x18')](queues[_0x1a3b45[_0xecdd('0x40')]])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x41'),_0x1a3b45[_0xecdd('0x3')]),_0x1a3b45);queues[_0x1a3b45[_0xecdd('0x40')]][_0xecdd('0x3d')]=!![];queues[_0x1a3b45['transfereeuniqueid']][_0xecdd('0x42')]=_0xecdd('0x43');queues[_0x1a3b45[_0xecdd('0x40')]][_0xecdd('0x44')]=_0x1a3b45[_0xecdd('0x45')];queues[_0x1a3b45['transfereeuniqueid']][_0xecdd('0x46')]=_0x1a3b45[_0xecdd('0x40')];queues[_0x1a3b45[_0xecdd('0x40')]][_0xecdd('0x8')]=_0xecdd('0x47');utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x48'),_0x1a3b45[_0xecdd('0x3')],queues[_0x1a3b45['transfereeuniqueid']][_0xecdd('0x1e')],_0x1a3b45[_0xecdd('0x40')],_0x1a3b45[_0xecdd('0x45')]));}}catch(_0x4b0a6e){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x41'),_0x1a3b45[_0xecdd('0x3')]),_0x4b0a6e);}};exports[_0xecdd('0x49')]=function(_0x13e1df){try{utils[_0xecdd('0x10')](util[_0xecdd('0x19')]('[%s][queues][attendedtransfer]',_0x13e1df[_0xecdd('0x4a')]),_0x13e1df);if(_0x13e1df['origtransfereruniqueid']==_0x13e1df[_0xecdd('0x4b')]){if(!_[_0xecdd('0x18')](queues[_0x13e1df[_0xecdd('0x4c')]])){utils['info'](util[_0xecdd('0x19')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df[_0xecdd('0x4c')]][_0xecdd('0x1e')],_0x13e1df[_0xecdd('0x4d')]));queues[_0x13e1df['secondtransfererlinkedid']]['transfer']=!![];queues[_0x13e1df['secondtransfererlinkedid']][_0xecdd('0x42')]='ATTENDED';queues[_0x13e1df[_0xecdd('0x4c')]][_0xecdd('0x44')]=_0x13e1df['origtransfererexten'];queues[_0x13e1df[_0xecdd('0x4c')]]['transferuniqueid']=_0x13e1df[_0xecdd('0x4a')];queues[_0x13e1df[_0xecdd('0x4c')]]['queuecallerexitreason']='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x13e1df[_0xecdd('0x4b')]])){if(_0x13e1df['transfereelinkedid']&&queues[_0x13e1df['transfereelinkedid']]){queues[_0x13e1df[_0xecdd('0x4e')]][_0xecdd('0x1f')]=0x1;queues[_0x13e1df[_0xecdd('0x40')]]=_[_0xecdd('0x4f')](queues[_0x13e1df[_0xecdd('0x4e')]]);queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0xe')]=_0x13e1df[_0xecdd('0x50')];queues[_0x13e1df[_0xecdd('0x40')]]['queuecallerenterreason']=0x2;queues[_0x13e1df['transfereeuniqueid']][_0xecdd('0x6')]=queues[_0x13e1df[_0xecdd('0x4c')]][_0xecdd('0x6')];queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x51')]=queues[_0x13e1df[_0xecdd('0x4c')]][_0xecdd('0x51')];queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x52')]=utils[_0xecdd('0x14')]();queues[_0x13e1df[_0xecdd('0x40')]]['queuecallerleaveAt']=utils[_0xecdd('0x14')]();queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x30')]=0x0;queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x53')]=0x0;utils['info'](util[_0xecdd('0x19')](_0xecdd('0x54'),_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x1e')],queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x6')],queues[_0x13e1df[_0xecdd('0x40')]][_0xecdd('0x51')]));}else{utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x55'),_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df[_0xecdd('0x4b')]]['name'],_0x13e1df[_0xecdd('0x4c')]));queues[_0x13e1df[_0xecdd('0x4b')]][_0xecdd('0xe')]=_0x13e1df[_0xecdd('0x4c')];}}}else if(_0x13e1df[_0xecdd('0x56')]==_0x13e1df[_0xecdd('0x4c')]){if(!_[_0xecdd('0x18')](queues[_0x13e1df[_0xecdd('0x4b')]])){utils[_0xecdd('0x1')](util[_0xecdd('0x19')](_0xecdd('0x57'),_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df[_0xecdd('0x4b')]][_0xecdd('0x1e')],_0x13e1df[_0xecdd('0x56')],_0x13e1df[_0xecdd('0x58')]));queues[_0x13e1df[_0xecdd('0x4b')]]['transfer']=!![];queues[_0x13e1df[_0xecdd('0x4b')]][_0xecdd('0x42')]=_0xecdd('0x59');queues[_0x13e1df[_0xecdd('0x4b')]]['transferexten']=_0x13e1df['secondtransfererexten'];queues[_0x13e1df[_0xecdd('0x4b')]][_0xecdd('0x46')]=_0x13e1df[_0xecdd('0x56')];queues[_0x13e1df[_0xecdd('0x4b')]][_0xecdd('0x8')]=_0xecdd('0x5a');}if(!_[_0xecdd('0x18')](queues[_0x13e1df[_0xecdd('0x4c')]])){if(_0x13e1df['transfertargetlinkedid']&&queues[_0x13e1df[_0xecdd('0x5b')]]){queues[_0x13e1df[_0xecdd('0x5b')]][_0xecdd('0x1f')]=0x1;queues[_0x13e1df[_0xecdd('0x50')]]=_[_0xecdd('0x4f')](queues[_0x13e1df['transfertargetlinkedid']]);queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0xe')]=_0x13e1df['transfertargetuniqueid'];queues[_0x13e1df['transfertargetuniqueid']][_0xecdd('0x1f')]=0x2;queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0x6')]=queues[_0x13e1df[_0xecdd('0x4b')]]['calleridnum'];queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0x51')]=queues[_0x13e1df['origtransfererlinkedid']][_0xecdd('0x51')];queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0x52')]=utils[_0xecdd('0x14')]();queues[_0x13e1df['transfertargetuniqueid']][_0xecdd('0x1a')]=utils[_0xecdd('0x14')]();queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0x30')]=0x0;queues[_0x13e1df[_0xecdd('0x50')]][_0xecdd('0x53')]=0x0;utils[_0xecdd('0x1')](util['format'](_0xecdd('0x5c'),_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df[_0xecdd('0x50')]]['name'],queues[_0x13e1df['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x13e1df['transfertargetuniqueid']][_0xecdd('0x6')],queues[_0x13e1df['transfertargetuniqueid']][_0xecdd('0x51')]));}else{utils['info'](util[_0xecdd('0x19')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x13e1df[_0xecdd('0x4a')],queues[_0x13e1df['secondtransfererlinkedid']][_0xecdd('0x1e')],_0x13e1df['origtransfererlinkedid']));queues[_0x13e1df[_0xecdd('0x4c')]][_0xecdd('0xe')]=_0x13e1df[_0xecdd('0x4b')];}}}}catch(_0x4b492e){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x5d'),_0x13e1df[_0xecdd('0x4a')]),_0x4b492e);}};exports[_0xecdd('0x5e')]=function(_0x3853b9){try{if(!_[_0xecdd('0x18')](queues[_0x3853b9['uniqueid']])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x5f'),_0x3853b9[_0xecdd('0x3')]),_0x3853b9);queues[_0x3853b9['uniqueid']][_0xecdd('0x60')]=utils['now']();utils['info'](util['format'](_0xecdd('0x61'),_0x3853b9[_0xecdd('0x3')],queues[_0x3853b9[_0xecdd('0x3')]][_0xecdd('0x1e')],queues[_0x3853b9[_0xecdd('0x3')]][_0xecdd('0x60')]));}}catch(_0x427e03){utils[_0xecdd('0x15')](util[_0xecdd('0x19')](_0xecdd('0x5f'),_0x3853b9[_0xecdd('0x3')]),_0x427e03);}};exports[_0xecdd('0x62')]=function(_0x214c44){try{if(!_['isNil'](queues[_0x214c44['uniqueid']])){if(!_[_0xecdd('0x18')](queues[_0x214c44[_0xecdd('0x3')]]['musiconholdstartAt'])){utils[_0xecdd('0x10')](util[_0xecdd('0x19')](_0xecdd('0x63'),_0x214c44['uniqueid']),_0x214c44);queues[_0x214c44[_0xecdd('0x3')]]['mohtime']+=utils[_0xecdd('0x64')](utils[_0xecdd('0x14')](),queues[_0x214c44[_0xecdd('0x3')]]['musiconholdstartAt']);utils[_0xecdd('0x1')](util['format'](_0xecdd('0x65'),_0x214c44[_0xecdd('0x3')],queues[_0x214c44[_0xecdd('0x3')]][_0xecdd('0x1e')],queues[_0x214c44[_0xecdd('0x3')]]['mohtime']));delete queues[_0x214c44['uniqueid']]['musiconholdstartAt'];}}}catch(_0x525e04){utils['error'](util[_0xecdd('0x19')](_0xecdd('0x63'),_0x214c44[_0xecdd('0x3')]),_0x525e04);}};
\ No newline at end of file
+var _0xcab4=['count','[%s][queues][queuecallerleave]','agentconnect','membername','destaccountcode','[%s][queues][agentconnect]','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertype','ATTENDED','transferexten','origtransfererexten','ATTENDEDTRANSFER','clone','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','util','./utils','info','format','channel','queue','lastAssignedTo','calleridnum','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','hangup','debug','[%s][queues][hangup]','queuecallerabandon','queuecallercompleteAt','now','COMPLETEDBYAGENT','name','queuecallerenterreason','varset','isNil','variable','queuestatus','queuecallerabandonAt','queuecallerexitAt','queuecallerexitreason','value','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','queuecallerexit','ABANDONED','[%s][queues][queuecallerabandon]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','queuecallerjoinAt'];(function(_0x4dc575,_0x2cbfd6){var _0x3c0eb4=function(_0xc33cdd){while(--_0xc33cdd){_0x4dc575['push'](_0x4dc575['shift']());}};_0x3c0eb4(++_0x2cbfd6);}(_0xcab4,0xf6));var _0x4cab=function(_0x430fe9,_0x1f70e7){_0x430fe9=_0x430fe9-0x0;var _0x105535=_0xcab4[_0x430fe9];return _0x105535;};'use strict';var _=require('lodash');var util=require(_0x4cab('0x0'));var utils=require(_0x4cab('0x1'));var queues={};function writeDB(_0xa37103){utils[_0x4cab('0x2')](util[_0x4cab('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0xa37103['uniqueid'],_0xa37103[_0x4cab('0x4')],_0xa37103[_0x4cab('0x5')],_0xa37103[_0x4cab('0x6')],_0xa37103[_0x4cab('0x7')],_0xa37103['accountcode'],_0xa37103['queuecallerexitreason']));if(_0xa37103[_0x4cab('0x5')]){utils[_0x4cab('0x8')](_0xa37103[_0x4cab('0x5')])['then'](function(_0x16de98){if(_0x16de98){_0xa37103[_0x4cab('0x9')]=_0x16de98['type'];}utils[_0x4cab('0xa')](_0x4cab('0xb'),_0xa37103);});}else{utils['request']('CreateVoiceQueueReport',_0xa37103);}if(_0xa37103['transfereduniqueid']){delete queues[_0xa37103[_0x4cab('0xc')]];}else{delete queues[_0xa37103['uniqueid']];}}exports[_0x4cab('0xd')]=function(_0x262499){try{utils['debug'](util[_0x4cab('0x3')](_0x4cab('0xe'),_0x262499[_0x4cab('0xf')]),_0x262499);utils[_0x4cab('0x2')](util['format'](_0x4cab('0x10'),_0x262499[_0x4cab('0xf')],_0x262499[_0x4cab('0x5')],_0x262499['position']));queues[_0x262499[_0x4cab('0xf')]]=_['assign'](_0x262499,{'originalposition':_0x262499[_0x4cab('0x11')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x590a7f){utils['error'](util[_0x4cab('0x3')](_0x4cab('0xe'),_0x262499[_0x4cab('0xf')]),_0x590a7f);}};exports[_0x4cab('0x12')]=function(_0x487f7e){try{if(!_['isNil'](queues[_0x487f7e[_0x4cab('0xf')]])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')](_0x4cab('0x14'),_0x487f7e[_0x4cab('0xf')]),_0x487f7e);if(queues[_0x487f7e[_0x4cab('0xf')]]['queuecallerleaveAt']){if(!queues[_0x487f7e[_0x4cab('0xf')]][_0x4cab('0x15')]&&!queues[_0x487f7e[_0x4cab('0xf')]]['queuecallerexit']){queues[_0x487f7e['uniqueid']]['queuecallercomplete']=!![];queues[_0x487f7e[_0x4cab('0xf')]][_0x4cab('0x16')]=utils[_0x4cab('0x17')]();queues[_0x487f7e['uniqueid']]['queuecallerexitreason']=_0x4cab('0x18');}utils[_0x4cab('0x2')](util[_0x4cab('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x487f7e[_0x4cab('0xf')],queues[_0x487f7e[_0x4cab('0xf')]][_0x4cab('0x19')],queues[_0x487f7e[_0x4cab('0xf')]]['queuecallerexitreason']));writeDB(queues[_0x487f7e['uniqueid']]);}else if(queues[_0x487f7e[_0x4cab('0xf')]][_0x4cab('0xc')]){utils[_0x4cab('0x2')](util[_0x4cab('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x487f7e[_0x4cab('0xf')],queues[_0x487f7e[_0x4cab('0xf')]][_0x4cab('0x19')],queues[_0x487f7e[_0x4cab('0xf')]]['transfereduniqueid']));queues[queues[_0x487f7e['uniqueid']][_0x4cab('0xc')]]=queues[_0x487f7e[_0x4cab('0xf')]];queues[queues[_0x487f7e[_0x4cab('0xf')]]['transfereduniqueid']][_0x4cab('0x1a')]=0x2;delete queues[_0x487f7e['uniqueid']];}}}catch(_0x54f4ec){utils['error'](util[_0x4cab('0x3')]('[%s][queues][hangup]',_0x487f7e[_0x4cab('0xf')]),_0x54f4ec);}};exports[_0x4cab('0x1b')]=function(_0xb555e9){try{utils[_0x4cab('0x13')](util[_0x4cab('0x3')]('[%s][queues][varset]',_0xb555e9[_0x4cab('0xf')]),_0xb555e9);if(!_[_0x4cab('0x1c')](_0xb555e9[_0x4cab('0x1d')][_0x4cab('0x1e')])&&_0xb555e9['value']['toUpperCase']()!=='CONTINUE'){if(!_[_0x4cab('0x1c')](queues[_0xb555e9['uniqueid']])){queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x15')]=![];queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x1f')]=null;queues[_0xb555e9['uniqueid']]['queuecallerexit']=!![];queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x20')]=utils[_0x4cab('0x17')]();queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x21')]=_0xb555e9[_0x4cab('0x22')][_0x4cab('0x23')]();utils[_0x4cab('0x2')](util['format'](_0x4cab('0x24'),_0xb555e9[_0x4cab('0xf')],queues[_0xb555e9[_0x4cab('0xf')]]['name'],_0xb555e9['value'],queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x21')]));writeDB(queues[_0xb555e9['uniqueid']]);}}else if(!_[_0x4cab('0x1c')](_0xb555e9[_0x4cab('0x1d')][_0x4cab('0x25')])){if(!_[_0x4cab('0x1c')](queues[_0xb555e9[_0x4cab('0xf')]])&&!queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x15')]){queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x15')]=![];queues[_0xb555e9['uniqueid']][_0x4cab('0x1f')]=null;queues[_0xb555e9['uniqueid']]['queuecallerexit']=!![];queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x20')]=utils[_0x4cab('0x17')]();queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x21')]=_0x4cab('0x26');utils['info'](util[_0x4cab('0x3')](_0x4cab('0x27'),_0xb555e9[_0x4cab('0xf')],queues[_0xb555e9[_0x4cab('0xf')]][_0x4cab('0x19')],_0xb555e9[_0x4cab('0x22')],queues[_0xb555e9['uniqueid']][_0x4cab('0x21')]));}}}catch(_0xe1d9ec){utils[_0x4cab('0x28')](util[_0x4cab('0x3')]('[%s][queues][varset]',_0xb555e9[_0x4cab('0xf')]),_0xe1d9ec);}};exports[_0x4cab('0x15')]=function(_0x13e6fa){try{if(!_[_0x4cab('0x1c')](queues[_0x13e6fa['uniqueid']])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')]('[%s][queues][queuecallerabandon]',_0x13e6fa[_0x4cab('0xf')]),_0x13e6fa);queues[_0x13e6fa['uniqueid']][_0x4cab('0x29')]=![];queues[_0x13e6fa[_0x4cab('0xf')]][_0x4cab('0x20')]=null;queues[_0x13e6fa[_0x4cab('0xf')]][_0x4cab('0x15')]=!![];queues[_0x13e6fa[_0x4cab('0xf')]]['queuecallerabandonAt']=utils['now']();queues[_0x13e6fa['uniqueid']][_0x4cab('0x21')]=_0x4cab('0x2a');utils[_0x4cab('0x2')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x13e6fa[_0x4cab('0xf')],queues[_0x13e6fa[_0x4cab('0xf')]][_0x4cab('0x19')],queues[_0x13e6fa['uniqueid']]['queuecallerexitreason']));}}catch(_0x4a9c98){utils['error'](util[_0x4cab('0x3')](_0x4cab('0x2b'),_0x13e6fa[_0x4cab('0xf')]),_0x4a9c98);}};exports['queuecallerleave']=function(_0x225ae1){try{if(!_[_0x4cab('0x1c')](queues[_0x225ae1[_0x4cab('0xf')]])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')]('[%s][queues][queuecallerleave]',_0x225ae1[_0x4cab('0xf')]),_0x225ae1);utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x2c'),_0x225ae1[_0x4cab('0xf')],queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x19')],_0x225ae1[_0x4cab('0x2d')],_0x225ae1[_0x4cab('0x2e')]));queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x2f')]=!![];queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x30')]=utils['now']();queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x31')]=utils['diffTime'](queues[_0x225ae1['uniqueid']]['queuecallerleaveAt'],queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x32')]);queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x11')]=_0x225ae1[_0x4cab('0x11')];queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x33')]=_0x225ae1[_0x4cab('0x33')];queues[_0x225ae1['uniqueid']][_0x4cab('0x2d')]=_0x225ae1[_0x4cab('0x2d')];queues[_0x225ae1[_0x4cab('0xf')]][_0x4cab('0x2e')]=_0x225ae1[_0x4cab('0x2e')];}}catch(_0x1c8c61){utils['error'](util[_0x4cab('0x3')](_0x4cab('0x34'),_0x225ae1[_0x4cab('0xf')]),_0x1c8c61);}};exports[_0x4cab('0x35')]=function(_0x259ad6){try{if(!_[_0x4cab('0x1c')](queues[_0x259ad6[_0x4cab('0xf')]])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')]('[%s][queues][agentconnect]',_0x259ad6[_0x4cab('0xf')]),_0x259ad6);utils['info'](util[_0x4cab('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x259ad6[_0x4cab('0xf')],queues[_0x259ad6['uniqueid']][_0x4cab('0x19')],_0x259ad6[_0x4cab('0x36')],_0x259ad6[_0x4cab('0x37')]));queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x15')]=![];queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x15')]=![];queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x1f')]=null;queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x29')]=![];queues[_0x259ad6['uniqueid']][_0x4cab('0x21')]=null;queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x20')]=null;queues[_0x259ad6[_0x4cab('0xf')]]['assigned']=!![];queues[_0x259ad6['uniqueid']]['accountcode']=_0x259ad6[_0x4cab('0x37')];queues[_0x259ad6[_0x4cab('0xf')]][_0x4cab('0x6')]=_0x259ad6[_0x4cab('0x36')];}}catch(_0x23bde8){utils[_0x4cab('0x28')](util[_0x4cab('0x3')](_0x4cab('0x38'),_0x259ad6[_0x4cab('0xf')]),_0x23bde8);}};exports[_0x4cab('0x39')]=function(_0x412199){try{if(!_['isNil'](queues[_0x412199['uniqueid']])){if(queues[_0x412199[_0x4cab('0xf')]]['queuecallerleaveAt']){utils[_0x4cab('0x13')](util['format'](_0x4cab('0x3a'),_0x412199[_0x4cab('0xf')]),_0x412199);queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x15')]=![];queues[_0x412199[_0x4cab('0xf')]]['queuecallerabandon']=![];queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x1f')]=null;queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x29')]=![];queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x20')]=null;queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x3b')]=!![];queues[_0x412199[_0x4cab('0xf')]]['lastAssignedTo']=_0x412199['membername'];queues[_0x412199['uniqueid']][_0x4cab('0x3c')]=!![];queues[_0x412199[_0x4cab('0xf')]]['queuecallercompleteAt']=utils[_0x4cab('0x17')]();if(_0x412199[_0x4cab('0x3d')]==_0x4cab('0x3e')){if(!queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x3e')]){queues[_0x412199['uniqueid']][_0x4cab('0x21')]=_0x4cab('0x3f');}}else{queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x21')]='COMPLETEDBY'+_0x412199[_0x4cab('0x3d')][_0x4cab('0x23')]();}utils[_0x4cab('0x2')](util['format'](_0x4cab('0x40'),_0x412199[_0x4cab('0xf')],queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x19')],_0x412199[_0x4cab('0x36')],queues[_0x412199[_0x4cab('0xf')]][_0x4cab('0x21')]));writeDB(queues[_0x412199[_0x4cab('0xf')]]);}}}catch(_0x19bd80){utils[_0x4cab('0x28')](util['format'](_0x4cab('0x3a'),_0x412199[_0x4cab('0xf')]),_0x19bd80);}};exports[_0x4cab('0x41')]=function(_0x3d3f2){try{if(!_[_0x4cab('0x1c')](queues[_0x3d3f2[_0x4cab('0x42')]])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')](_0x4cab('0x43'),_0x3d3f2[_0x4cab('0xf')]),_0x3d3f2);queues[_0x3d3f2[_0x4cab('0x42')]][_0x4cab('0x3e')]=!![];queues[_0x3d3f2[_0x4cab('0x42')]]['transfertype']='BLIND';queues[_0x3d3f2[_0x4cab('0x42')]]['transferexten']=_0x3d3f2[_0x4cab('0x44')];queues[_0x3d3f2[_0x4cab('0x42')]][_0x4cab('0x45')]=_0x3d3f2['transfereeuniqueid'];queues[_0x3d3f2[_0x4cab('0x42')]][_0x4cab('0x21')]='BLINDTRANSFER';utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x46'),_0x3d3f2['uniqueid'],queues[_0x3d3f2['transfereeuniqueid']][_0x4cab('0x19')],_0x3d3f2[_0x4cab('0x42')],_0x3d3f2[_0x4cab('0x44')]));}}catch(_0x3c5897){utils[_0x4cab('0x28')](util[_0x4cab('0x3')](_0x4cab('0x43'),_0x3d3f2['uniqueid']),_0x3c5897);}};exports['attendedtransfer']=function(_0xb8076a){try{utils['debug'](util[_0x4cab('0x3')](_0x4cab('0x47'),_0xb8076a[_0x4cab('0x48')]),_0xb8076a);if(_0xb8076a[_0x4cab('0x48')]==_0xb8076a[_0x4cab('0x49')]){if(!_[_0x4cab('0x1c')](queues[_0xb8076a[_0x4cab('0x4a')]])){utils['info'](util[_0x4cab('0x3')](_0x4cab('0x4b'),_0xb8076a[_0x4cab('0x48')],queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x19')],_0xb8076a['origtransfererexten']));queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x3e')]=!![];queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x4c')]=_0x4cab('0x4d');queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x4e')]=_0xb8076a[_0x4cab('0x4f')];queues[_0xb8076a['secondtransfererlinkedid']][_0x4cab('0x45')]=_0xb8076a[_0x4cab('0x48')];queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x21')]=_0x4cab('0x50');}if(!_[_0x4cab('0x1c')](queues[_0xb8076a[_0x4cab('0x49')]])){if(_0xb8076a['transfereelinkedid']&&queues[_0xb8076a['transfereelinkedid']]){queues[_0xb8076a['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0xb8076a[_0x4cab('0x42')]]=_[_0x4cab('0x51')](queues[_0xb8076a[_0x4cab('0x52')]]);queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0xc')]=_0xb8076a[_0x4cab('0x53')];queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x1a')]=0x2;queues[_0xb8076a[_0x4cab('0x42')]]['calleridnum']=queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x7')];queues[_0xb8076a[_0x4cab('0x42')]]['calleridname']=queues[_0xb8076a['secondtransfererlinkedid']][_0x4cab('0x54')];queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x32')]=utils[_0x4cab('0x17')]();queues[_0xb8076a[_0x4cab('0x42')]]['queuecallerleaveAt']=utils[_0x4cab('0x17')]();queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x31')]=0x0;queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x55')]=0x0;utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x56'),_0xb8076a[_0x4cab('0x48')],queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x19')],queues[_0xb8076a[_0x4cab('0x42')]][_0x4cab('0x7')],queues[_0xb8076a['transfereeuniqueid']][_0x4cab('0x54')]));}else{utils['info'](util[_0x4cab('0x3')](_0x4cab('0x57'),_0xb8076a[_0x4cab('0x48')],queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0x19')],_0xb8076a['secondtransfererlinkedid']));queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0xc')]=_0xb8076a[_0x4cab('0x4a')];}}}else if(_0xb8076a[_0x4cab('0x58')]==_0xb8076a[_0x4cab('0x4a')]){if(!_[_0x4cab('0x1c')](queues[_0xb8076a[_0x4cab('0x49')]])){utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x59'),_0xb8076a['origtransfereruniqueid'],queues[_0xb8076a['origtransfererlinkedid']][_0x4cab('0x19')],_0xb8076a['secondtransfereruniqueid'],_0xb8076a[_0x4cab('0x5a')]));queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0x3e')]=!![];queues[_0xb8076a[_0x4cab('0x49')]]['transfertype']=_0x4cab('0x4d');queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0x4e')]=_0xb8076a[_0x4cab('0x5a')];queues[_0xb8076a[_0x4cab('0x49')]]['transferuniqueid']=_0xb8076a['secondtransfereruniqueid'];queues[_0xb8076a['origtransfererlinkedid']][_0x4cab('0x21')]='ATTENDEDTRANSFER';}if(!_[_0x4cab('0x1c')](queues[_0xb8076a['secondtransfererlinkedid']])){if(_0xb8076a[_0x4cab('0x5b')]&&queues[_0xb8076a['transfertargetlinkedid']]){queues[_0xb8076a[_0x4cab('0x5b')]]['queuecallerenterreason']=0x1;queues[_0xb8076a['transfertargetuniqueid']]=_[_0x4cab('0x51')](queues[_0xb8076a[_0x4cab('0x5b')]]);queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0xc')]=_0xb8076a['transfertargetuniqueid'];queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x1a')]=0x2;queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x7')]=queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0x7')];queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x54')]=queues[_0xb8076a[_0x4cab('0x49')]][_0x4cab('0x54')];queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x32')]=utils[_0x4cab('0x17')]();queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x30')]=utils[_0x4cab('0x17')]();queues[_0xb8076a['transfertargetuniqueid']][_0x4cab('0x31')]=0x0;queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x55')]=0x0;utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x5c'),_0xb8076a[_0x4cab('0x48')],queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x19')],queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0xc')],queues[_0xb8076a[_0x4cab('0x53')]][_0x4cab('0x7')],queues[_0xb8076a['transfertargetuniqueid']][_0x4cab('0x54')]));}else{utils[_0x4cab('0x2')](util[_0x4cab('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xb8076a[_0x4cab('0x48')],queues[_0xb8076a[_0x4cab('0x4a')]][_0x4cab('0x19')],_0xb8076a[_0x4cab('0x49')]));queues[_0xb8076a[_0x4cab('0x4a')]]['transfereduniqueid']=_0xb8076a[_0x4cab('0x49')];}}}}catch(_0x27c36b){utils[_0x4cab('0x28')](util[_0x4cab('0x3')](_0x4cab('0x47'),_0xb8076a[_0x4cab('0x48')]),_0x27c36b);}};exports[_0x4cab('0x5d')]=function(_0x38c6e5){try{if(!_[_0x4cab('0x1c')](queues[_0x38c6e5['uniqueid']])){utils[_0x4cab('0x13')](util[_0x4cab('0x3')](_0x4cab('0x5e'),_0x38c6e5[_0x4cab('0xf')]),_0x38c6e5);queues[_0x38c6e5[_0x4cab('0xf')]][_0x4cab('0x5f')]=utils[_0x4cab('0x17')]();utils['info'](util[_0x4cab('0x3')](_0x4cab('0x60'),_0x38c6e5[_0x4cab('0xf')],queues[_0x38c6e5['uniqueid']]['name'],queues[_0x38c6e5[_0x4cab('0xf')]][_0x4cab('0x5f')]));}}catch(_0xc2905b){utils[_0x4cab('0x28')](util[_0x4cab('0x3')](_0x4cab('0x5e'),_0x38c6e5['uniqueid']),_0xc2905b);}};exports['musiconholdstop']=function(_0x505366){try{if(!_[_0x4cab('0x1c')](queues[_0x505366[_0x4cab('0xf')]])){if(!_[_0x4cab('0x1c')](queues[_0x505366[_0x4cab('0xf')]][_0x4cab('0x5f')])){utils[_0x4cab('0x13')](util['format'](_0x4cab('0x61'),_0x505366[_0x4cab('0xf')]),_0x505366);queues[_0x505366['uniqueid']]['mohtime']+=utils['diffTime'](utils['now'](),queues[_0x505366['uniqueid']][_0x4cab('0x5f')]);utils[_0x4cab('0x2')](util[_0x4cab('0x3')](_0x4cab('0x62'),_0x505366['uniqueid'],queues[_0x505366[_0x4cab('0xf')]][_0x4cab('0x19')],queues[_0x505366[_0x4cab('0xf')]][_0x4cab('0x55')]));delete queues[_0x505366[_0x4cab('0xf')]]['musiconholdstartAt'];}}}catch(_0x3615e1){utils[_0x4cab('0x28')](util[_0x4cab('0x3')](_0x4cab('0x61'),_0x505366[_0x4cab('0xf')]),_0x3615e1);}};
\ No newline at end of file
index fff8cb1..3f61fe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d10=['[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfereecalleridnum','transfereecalleridname','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','uniqueid','blinds','transfereeuniqueid','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','accountcode','channel','error','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','endsWith','value','.WAV','find','monitors','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','forEach','clone'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1d10,0x136));var _0x01d1=function(_0x57456b,_0x216bab){_0x57456b=_0x57456b-0x0;var _0xfca28b=_0x1d10[_0x57456b];return _0xfca28b;};'use strict';var _=require(_0x01d1('0x0'));var util=require('util');var utils=require(_0x01d1('0x1'));var transfers=require(_0x01d1('0x2'));var recordings={};function writeDB(_0x5735ae){var _0x5c2f28;utils[_0x01d1('0x3')](util[_0x01d1('0x4')](_0x01d1('0x5'),_0x5735ae[_0x01d1('0x6')]));if(transfers['blinds'][_0x5735ae[_0x01d1('0x6')]]){_0x5c2f28=_0x5735ae[_0x01d1('0x6')];_0x5735ae[_0x01d1('0x6')]=transfers[_0x01d1('0x7')][_0x5735ae['uniqueid']][_0x01d1('0x8')];}if(_0x5735ae['accountcode']){utils[_0x01d1('0x9')](_0x5735ae['accountcode'])[_0x01d1('0xa')](function(_0x50d657){if(_0x50d657){_0x5735ae[_0x01d1('0xb')]=_0x50d657[_0x01d1('0xc')];_0x5735ae[_0x01d1('0xd')]=_0x50d657['id'];}utils['request'](_0x01d1('0xe'),_0x5735ae);});}else{utils['request']('CreateVoiceRecording',_0x5735ae);}if(_0x5c2f28)delete transfers['blinds'][_0x5c2f28];}exports[_0x01d1('0xf')]=function(_0xb9d9dc){try{utils[_0x01d1('0x10')](util[_0x01d1('0x4')]('[%s][recordings][newchannel]',_0xb9d9dc[_0x01d1('0x6')]),_0xb9d9dc);if(_0xb9d9dc[_0x01d1('0x6')]==_0xb9d9dc[_0x01d1('0x11')]){utils[_0x01d1('0x3')](util['format'](_0x01d1('0x12'),_0xb9d9dc[_0x01d1('0x6')],_0xb9d9dc[_0x01d1('0x13')],_0xb9d9dc[_0x01d1('0x14')]));recordings[_0xb9d9dc[_0x01d1('0x6')]]={'uniqueid':_0xb9d9dc[_0x01d1('0x6')],'accountcode':_0xb9d9dc[_0x01d1('0x15')],'exten':_0xb9d9dc['exten'],'context':_0xb9d9dc['context'],'channel':_0xb9d9dc[_0x01d1('0x16')],'monitors':[]};}}catch(_0x9e8030){utils[_0x01d1('0x17')](util['format'](_0x01d1('0x18'),_0xb9d9dc['uniqueid']),_0x9e8030);}};exports[_0x01d1('0x19')]=function(_0x567ce9){try{utils[_0x01d1('0x10')](util['format'](_0x01d1('0x1a'),_0x567ce9[_0x01d1('0x6')]),_0x567ce9);if(!_[_0x01d1('0x1b')](recordings[_0x567ce9[_0x01d1('0x6')]])&&_0x567ce9[_0x01d1('0x1c')]==0x6){utils[_0x01d1('0x3')](util[_0x01d1('0x4')](_0x01d1('0x1d'),_0x567ce9[_0x01d1('0x6')],_0x567ce9[_0x01d1('0x13')],_0x567ce9[_0x01d1('0x16')]));}else if(!_[_0x01d1('0x1b')](recordings[_0x567ce9[_0x01d1('0x11')]])&&_0x567ce9[_0x01d1('0x1c')]==0x6&&_0x567ce9[_0x01d1('0x13')]!=_0x01d1('0x1e')){utils['info'](util[_0x01d1('0x4')](_0x01d1('0x1f'),_0x567ce9[_0x01d1('0x6')],_0x567ce9[_0x01d1('0x11')],_0x567ce9['context'],_0x567ce9['channel']));recordings[_0x567ce9[_0x01d1('0x11')]][_0x01d1('0x15')]=_0x567ce9[_0x01d1('0x15')];}}catch(_0x39458e){utils['error'](util[_0x01d1('0x4')](_0x01d1('0x1a'),_0x567ce9[_0x01d1('0x6')]),_0x39458e);}};exports[_0x01d1('0x20')]=function(_0x418c07){try{if(!_[_0x01d1('0x1b')](_0x418c07[_0x01d1('0x21')])&&!_[_0x01d1('0x1b')](_0x418c07['variable'][_0x01d1('0x22')])){utils[_0x01d1('0x10')](util['format'](_0x01d1('0x23'),_0x418c07['uniqueid']),_0x418c07);utils['info'](util[_0x01d1('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x418c07[_0x01d1('0x6')],_0x418c07['variable'],_0x418c07['value']));if(_[_0x01d1('0x24')](_0x418c07[_0x01d1('0x25')],'.wav49')){_0x418c07[_0x01d1('0x25')]=_0x418c07['value']['replace']('.wav49',_0x01d1('0x26'));}if(recordings[_0x418c07[_0x01d1('0x11')]]){var _0x128901=_[_0x01d1('0x27')](recordings[_0x418c07[_0x01d1('0x11')]][_0x01d1('0x28')],{'value':_0x418c07[_0x01d1('0x25')]});if(_[_0x01d1('0x1b')](_0x128901)){recordings[_0x418c07[_0x01d1('0x11')]][_0x01d1('0x28')]['push']({'value':_0x418c07[_0x01d1('0x25')]});}}}}catch(_0x29d20f){utils[_0x01d1('0x17')](util['format'](_0x01d1('0x23'),_0x418c07[_0x01d1('0x6')]),_0x29d20f);}};exports['hangup']=function(_0x35eb65){try{if(!_[_0x01d1('0x1b')](recordings[_0x35eb65[_0x01d1('0x6')]])){utils['debug'](util[_0x01d1('0x4')](_0x01d1('0x29'),_0x35eb65[_0x01d1('0x6')]),_0x35eb65);utils[_0x01d1('0x3')](util[_0x01d1('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x35eb65[_0x01d1('0x6')],_0x35eb65[_0x01d1('0x2a')],_0x35eb65[_0x01d1('0x2b')],_0x35eb65[_0x01d1('0x2c')]));recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x2a')]=_0x35eb65[_0x01d1('0x2a')];recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x2b')]=_0x35eb65[_0x01d1('0x2b')];recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x2d')]=_0x35eb65[_0x01d1('0x2d')];recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x2e')]=_0x35eb65[_0x01d1('0x2e')];if(recordings[_0x35eb65['uniqueid']]['type']==_0x01d1('0x2f')&&recordings[_0x35eb65[_0x01d1('0x6')]]['accountcode']){recordings[_0x35eb65['uniqueid']][_0x01d1('0x2d')]=recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x15')];recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x2e')]='';}recordings[_0x35eb65[_0x01d1('0x6')]][_0x01d1('0x28')][_0x01d1('0x30')](function(_0x25ff42){var _0x8da1a1=_[_0x01d1('0x31')](recordings[_0x35eb65['uniqueid']]);_0x8da1a1[_0x01d1('0x25')]=_0x25ff42[_0x01d1('0x25')];writeDB(_0x8da1a1);});delete recordings[_0x35eb65[_0x01d1('0x6')]];}}catch(_0x5e7adb){utils[_0x01d1('0x17')](util[_0x01d1('0x4')](_0x01d1('0x29'),_0x35eb65[_0x01d1('0x6')]),_0x5e7adb);}};exports['newexten']=function(_0x12574a){try{if(!_[_0x01d1('0x1b')](recordings[_0x12574a['uniqueid']])){utils[_0x01d1('0x10')](util[_0x01d1('0x4')](_0x01d1('0x32'),_0x12574a[_0x01d1('0x6')]),_0x12574a);utils[_0x01d1('0x3')](util[_0x01d1('0x4')](_0x01d1('0x33'),_0x12574a[_0x01d1('0x6')],_0x12574a[_0x01d1('0x34')],_0x12574a[_0x01d1('0x35')]));if(_0x12574a[_0x01d1('0x34')][_0x01d1('0x36')]()==_0x01d1('0x37')&&_[_0x01d1('0x38')](_0x12574a['appdata'][_0x01d1('0x36')](),_0x01d1('0x39'))){var _0x41cf4e=_0x12574a[_0x01d1('0x35')][_0x01d1('0x3a')]('=');var _0x3698f5=_0x41cf4e[0x0][_0x01d1('0x3b')](_0x41cf4e[0x0][_0x01d1('0x3c')]('(')+0x1,_0x41cf4e[0x0]['lastIndexOf'](')'));var _0x39330a=_0x41cf4e[0x1];recordings[_0x12574a[_0x01d1('0x6')]][_0x3698f5]=_0x39330a;}}}catch(_0x1b4794){utils[_0x01d1('0x17')](util[_0x01d1('0x4')](_0x01d1('0x32'),_0x12574a[_0x01d1('0x6')]),_0x1b4794);}};exports[_0x01d1('0x3d')]=function(_0xad0ae0){try{if(!_[_0x01d1('0x1b')](recordings[_0xad0ae0['uniqueid']])){utils['debug'](util[_0x01d1('0x4')](_0x01d1('0x3e'),_0xad0ae0[_0x01d1('0x6')]),_0xad0ae0);utils['info'](util['format'](_0x01d1('0x3f'),_0xad0ae0[_0x01d1('0x6')],_0xad0ae0[_0x01d1('0x40')]));recordings[_0xad0ae0[_0x01d1('0x6')]][_0x01d1('0x40')]=_0xad0ae0[_0x01d1('0x40')];}}catch(_0x1e966a){utils[_0x01d1('0x17')](util[_0x01d1('0x4')](_0x01d1('0x3e'),_0xad0ae0[_0x01d1('0x6')]),_0x1e966a);}};exports[_0x01d1('0x41')]=function(_0x149933){try{utils[_0x01d1('0x10')](util['format']('[%s][recordings][blindtransfer]',_0x149933['uniqueid']),_0x149933);utils[_0x01d1('0x3')](util[_0x01d1('0x4')](_0x01d1('0x42'),_0x149933[_0x01d1('0x6')],_0x149933['transferercalleridnum'],_0x149933['transferercalleridname'],_0x149933[_0x01d1('0x43')],_0x149933[_0x01d1('0x44')]));if(recordings[_0x149933[_0x01d1('0x45')]]&&transfers[_0x01d1('0x7')][_0x149933[_0x01d1('0x45')]]){transfers[_0x01d1('0x7')][_0x149933[_0x01d1('0x45')]][_0x01d1('0x46')]=!![];}}catch(_0x598046){utils['error'](util[_0x01d1('0x4')](_0x01d1('0x47'),_0x149933[_0x01d1('0x6')]),_0x598046);}};
\ No newline at end of file
+var _0xf031=['[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','cdr','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','[%s][recordings][blindtransfer]','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','newchannel','debug','format','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','channel','error','[%s][recordings][newstate]','isNil','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten'];(function(_0x484bf4,_0x2b975c){var _0x31c683=function(_0x1cdda2){while(--_0x1cdda2){_0x484bf4['push'](_0x484bf4['shift']());}};_0x31c683(++_0x2b975c);}(_0xf031,0x1bc));var _0x1f03=function(_0x1a2a54,_0x2e389b){_0x1a2a54=_0x1a2a54-0x0;var _0x15c032=_0xf031[_0x1a2a54];return _0x15c032;};'use strict';var _=require(_0x1f03('0x0'));var util=require(_0x1f03('0x1'));var utils=require(_0x1f03('0x2'));var transfers=require(_0x1f03('0x3'));var recordings={};function writeDB(_0x2b4d0b){var _0x372f83;utils[_0x1f03('0x4')](util['format'](_0x1f03('0x5'),_0x2b4d0b['uniqueid']));if(transfers[_0x1f03('0x6')][_0x2b4d0b[_0x1f03('0x7')]]){_0x372f83=_0x2b4d0b[_0x1f03('0x7')];_0x2b4d0b[_0x1f03('0x7')]=transfers[_0x1f03('0x6')][_0x2b4d0b['uniqueid']][_0x1f03('0x8')];}if(_0x2b4d0b[_0x1f03('0x9')]){utils[_0x1f03('0xa')](_0x2b4d0b[_0x1f03('0x9')])[_0x1f03('0xb')](function(_0x3afc09){if(_0x3afc09){_0x2b4d0b[_0x1f03('0xc')]=_0x3afc09[_0x1f03('0xd')];_0x2b4d0b[_0x1f03('0xe')]=_0x3afc09['id'];}utils['request'](_0x1f03('0xf'),_0x2b4d0b);});}else{utils[_0x1f03('0x10')](_0x1f03('0xf'),_0x2b4d0b);}if(_0x372f83)delete transfers[_0x1f03('0x6')][_0x372f83];}exports[_0x1f03('0x11')]=function(_0x47de4e){try{utils[_0x1f03('0x12')](util[_0x1f03('0x13')](_0x1f03('0x14'),_0x47de4e[_0x1f03('0x7')]),_0x47de4e);if(_0x47de4e[_0x1f03('0x7')]==_0x47de4e[_0x1f03('0x15')]){utils['info'](util['format'](_0x1f03('0x16'),_0x47de4e[_0x1f03('0x7')],_0x47de4e[_0x1f03('0x17')],_0x47de4e['exten']));recordings[_0x47de4e[_0x1f03('0x7')]]={'uniqueid':_0x47de4e[_0x1f03('0x7')],'accountcode':_0x47de4e[_0x1f03('0x9')],'exten':_0x47de4e['exten'],'context':_0x47de4e[_0x1f03('0x17')],'channel':_0x47de4e[_0x1f03('0x18')],'monitors':[]};}}catch(_0x90bb15){utils[_0x1f03('0x19')](util[_0x1f03('0x13')](_0x1f03('0x14'),_0x47de4e[_0x1f03('0x7')]),_0x90bb15);}};exports['newstate']=function(_0x462f4a){try{utils['debug'](util['format'](_0x1f03('0x1a'),_0x462f4a[_0x1f03('0x7')]),_0x462f4a);if(!_[_0x1f03('0x1b')](recordings[_0x462f4a[_0x1f03('0x7')]])&&_0x462f4a[_0x1f03('0x1c')]==0x6){utils[_0x1f03('0x4')](util[_0x1f03('0x13')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x462f4a[_0x1f03('0x7')],_0x462f4a[_0x1f03('0x17')],_0x462f4a['channel']));}else if(!_[_0x1f03('0x1b')](recordings[_0x462f4a['linkedid']])&&_0x462f4a[_0x1f03('0x1c')]==0x6&&_0x462f4a['context']!=_0x1f03('0x1d')){utils['info'](util[_0x1f03('0x13')](_0x1f03('0x1e'),_0x462f4a['uniqueid'],_0x462f4a[_0x1f03('0x15')],_0x462f4a[_0x1f03('0x17')],_0x462f4a[_0x1f03('0x18')]));recordings[_0x462f4a[_0x1f03('0x15')]][_0x1f03('0x9')]=_0x462f4a[_0x1f03('0x9')];}}catch(_0xa30a3b){utils['error'](util[_0x1f03('0x13')](_0x1f03('0x1a'),_0x462f4a[_0x1f03('0x7')]),_0xa30a3b);}};exports[_0x1f03('0x1f')]=function(_0x325bc8){try{if(!_[_0x1f03('0x1b')](_0x325bc8[_0x1f03('0x20')])&&!_[_0x1f03('0x1b')](_0x325bc8[_0x1f03('0x20')]['mixmonitor_filename'])){utils[_0x1f03('0x12')](util[_0x1f03('0x13')](_0x1f03('0x21'),_0x325bc8[_0x1f03('0x7')]),_0x325bc8);utils[_0x1f03('0x4')](util[_0x1f03('0x13')](_0x1f03('0x22'),_0x325bc8[_0x1f03('0x7')],_0x325bc8[_0x1f03('0x20')],_0x325bc8[_0x1f03('0x23')]));if(_['endsWith'](_0x325bc8[_0x1f03('0x23')],_0x1f03('0x24'))){_0x325bc8[_0x1f03('0x23')]=_0x325bc8[_0x1f03('0x23')][_0x1f03('0x25')](_0x1f03('0x24'),_0x1f03('0x26'));}if(recordings[_0x325bc8[_0x1f03('0x15')]]){var _0x355b13=_[_0x1f03('0x27')](recordings[_0x325bc8[_0x1f03('0x15')]][_0x1f03('0x28')],{'value':_0x325bc8[_0x1f03('0x23')]});if(_[_0x1f03('0x1b')](_0x355b13)){recordings[_0x325bc8[_0x1f03('0x15')]][_0x1f03('0x28')][_0x1f03('0x29')]({'value':_0x325bc8['value']});}}}}catch(_0x154709){utils[_0x1f03('0x19')](util[_0x1f03('0x13')](_0x1f03('0x21'),_0x325bc8[_0x1f03('0x7')]),_0x154709);}};exports['hangup']=function(_0xdc88eb){try{if(!_[_0x1f03('0x1b')](recordings[_0xdc88eb[_0x1f03('0x7')]])){utils[_0x1f03('0x12')](util['format'](_0x1f03('0x2a'),_0xdc88eb[_0x1f03('0x7')]),_0xdc88eb);utils[_0x1f03('0x4')](util[_0x1f03('0x13')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0xdc88eb[_0x1f03('0x7')],_0xdc88eb['calleridnum'],_0xdc88eb[_0x1f03('0x2b')],_0xdc88eb[_0x1f03('0x2c')]));recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x2d')]=_0xdc88eb[_0x1f03('0x2d')];recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x2b')]=_0xdc88eb[_0x1f03('0x2b')];recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x2e')]=_0xdc88eb[_0x1f03('0x2e')];recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x2f')]=_0xdc88eb[_0x1f03('0x2f')];if(recordings[_0xdc88eb['uniqueid']][_0x1f03('0x30')]==_0x1f03('0x31')&&recordings[_0xdc88eb['uniqueid']][_0x1f03('0x9')]){recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x2e')]=recordings[_0xdc88eb['uniqueid']][_0x1f03('0x9')];recordings[_0xdc88eb[_0x1f03('0x7')]]['connectedlinename']='';}recordings[_0xdc88eb[_0x1f03('0x7')]][_0x1f03('0x28')][_0x1f03('0x32')](function(_0x2307fa){var _0x5adb9e=_[_0x1f03('0x33')](recordings[_0xdc88eb[_0x1f03('0x7')]]);_0x5adb9e['value']=_0x2307fa[_0x1f03('0x23')];writeDB(_0x5adb9e);});delete recordings[_0xdc88eb[_0x1f03('0x7')]];}}catch(_0x11c6cf){utils['error'](util[_0x1f03('0x13')](_0x1f03('0x2a'),_0xdc88eb[_0x1f03('0x7')]),_0x11c6cf);}};exports[_0x1f03('0x34')]=function(_0x4a12f1){try{if(!_['isNil'](recordings[_0x4a12f1[_0x1f03('0x7')]])){utils['debug'](util[_0x1f03('0x13')]('[%s][recordings][newexten]',_0x4a12f1[_0x1f03('0x7')]),_0x4a12f1);utils[_0x1f03('0x4')](util['format'](_0x1f03('0x35'),_0x4a12f1[_0x1f03('0x7')],_0x4a12f1[_0x1f03('0x36')],_0x4a12f1[_0x1f03('0x37')]));if(_0x4a12f1[_0x1f03('0x36')]['toLowerCase']()==_0x1f03('0x38')&&_['startsWith'](_0x4a12f1[_0x1f03('0x37')]['toLowerCase'](),_0x1f03('0x39'))){var _0x47c7f6=_0x4a12f1['appdata']['split']('=');var _0x8ba419=_0x47c7f6[0x0][_0x1f03('0x3a')](_0x47c7f6[0x0][_0x1f03('0x3b')]('(')+0x1,_0x47c7f6[0x0][_0x1f03('0x3b')](')'));var _0x438721=_0x47c7f6[0x1];recordings[_0x4a12f1[_0x1f03('0x7')]][_0x8ba419]=_0x438721;}}}catch(_0x1ab8bb){utils[_0x1f03('0x19')](util[_0x1f03('0x13')](_0x1f03('0x3c'),_0x4a12f1[_0x1f03('0x7')]),_0x1ab8bb);}};exports[_0x1f03('0x3d')]=function(_0x445ad2){try{if(!_['isNil'](recordings[_0x445ad2[_0x1f03('0x7')]])){utils['debug'](util['format'](_0x1f03('0x3e'),_0x445ad2[_0x1f03('0x7')]),_0x445ad2);utils[_0x1f03('0x4')](util[_0x1f03('0x13')](_0x1f03('0x3f'),_0x445ad2[_0x1f03('0x7')],_0x445ad2[_0x1f03('0x40')]));recordings[_0x445ad2[_0x1f03('0x7')]][_0x1f03('0x40')]=_0x445ad2['queue'];}}catch(_0x5aff79){utils[_0x1f03('0x19')](util[_0x1f03('0x13')]('[%s][recordings][queuecallerjoin]',_0x445ad2[_0x1f03('0x7')]),_0x5aff79);}};exports['blindtransfer']=function(_0x8748c){try{utils[_0x1f03('0x12')](util['format']('[%s][recordings][blindtransfer]',_0x8748c[_0x1f03('0x7')]),_0x8748c);utils['info'](util[_0x1f03('0x13')](_0x1f03('0x41'),_0x8748c[_0x1f03('0x7')],_0x8748c['transferercalleridnum'],_0x8748c[_0x1f03('0x42')],_0x8748c[_0x1f03('0x43')],_0x8748c['transfereecalleridname']));if(recordings[_0x8748c[_0x1f03('0x44')]]&&transfers[_0x1f03('0x6')][_0x8748c[_0x1f03('0x44')]]){transfers[_0x1f03('0x6')][_0x8748c[_0x1f03('0x44')]][_0x1f03('0x45')]=!![];}}catch(_0x96850a){utils[_0x1f03('0x19')](util[_0x1f03('0x13')](_0x1f03('0x46'),_0x8748c[_0x1f03('0x7')]),_0x96850a);}};
\ No newline at end of file
index ac617cf..e83f9bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e48=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','[%s][transfers][attendedtransfer]','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','attended','origtransfereruniqueid','uniqueid','type','request','CreateVoiceTransferReport','blinds','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','error','[%s][transfers][blindtransfer]','attendedtransfer','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e48,0x1e3));var _0x82e4=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x2e48[_0x2cfb48];return _0xc4594f;};'use strict';var _=require(_0x82e4('0x0'));var util=require(_0x82e4('0x1'));var utils=require(_0x82e4('0x2'));function writeDB(_0x38face){utils[_0x82e4('0x3')](util[_0x82e4('0x4')](_0x82e4('0x5'),_0x38face['type']===_0x82e4('0x6')?_0x38face[_0x82e4('0x7')]:_0x38face[_0x82e4('0x8')],_0x38face[_0x82e4('0x9')]));utils[_0x82e4('0xa')](_0x82e4('0xb'),_0x38face);}exports[_0x82e4('0xc')]={};exports['blindtransfer']=function(_0x1328e5){try{utils['debug'](util[_0x82e4('0x4')]('[%s][transfers][blindtransfer]',_0x1328e5['uniqueid']),_0x1328e5);utils['info'](util[_0x82e4('0x4')](_0x82e4('0xd'),_0x1328e5['uniqueid'],_0x1328e5[_0x82e4('0xe')],_0x1328e5['transferercalleridname'],_0x1328e5[_0x82e4('0xf')],_0x1328e5[_0x82e4('0x10')]));_0x1328e5[_0x82e4('0x9')]='blind';exports[_0x82e4('0xc')][_0x1328e5['transfereruniqueid']]=_0x1328e5;writeDB(_0x1328e5);}catch(_0x34d700){utils[_0x82e4('0x11')](util['format'](_0x82e4('0x12'),_0x1328e5['uniqueid']),_0x34d700);}};exports[_0x82e4('0x13')]=function(_0x18df98){try{utils[_0x82e4('0x14')](util['format']('[%s][transfers][attendedtransfer]',_0x18df98[_0x82e4('0x7')]),_0x18df98);utils[_0x82e4('0x3')](util[_0x82e4('0x4')](_0x82e4('0x15'),_0x18df98['origtransfereruniqueid'],_0x18df98[_0x82e4('0x16')],_0x18df98[_0x82e4('0x17')],_0x18df98[_0x82e4('0x18')],_0x18df98[_0x82e4('0x19')]));_0x18df98=_[_0x82e4('0x1a')](_0x18df98,{'transfererchannel':_0x18df98['origtransfererchannel'],'transferercalleridnum':_0x18df98['origtransferercalleridnum'],'transferercalleridname':_0x18df98[_0x82e4('0x17')],'transfererconnectedlinenum':_0x18df98['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x18df98['secondtransfererconnectedlinename'],'transfereraccountcode':_0x18df98[_0x82e4('0x1b')],'transferercontext':_0x18df98[_0x82e4('0x1c')],'transfererexten':_0x18df98[_0x82e4('0x1d')],'transfererlinkedid':_0x18df98[_0x82e4('0x1e')],'context':_0x18df98[_0x82e4('0x1f')],'extension':_0x18df98[_0x82e4('0x20')],'type':_0x82e4('0x6')});if(_[_0x82e4('0x21')](_0x18df98[_0x82e4('0x22')])){_0x18df98=_[_0x82e4('0x1a')](_0x18df98,{'transfereechannel':_0x18df98[_0x82e4('0x23')],'transfereecalleridnum':_0x18df98[_0x82e4('0x18')],'transfereecalleridname':_0x18df98[_0x82e4('0x19')],'transfereeconnectedlinenum':_0x18df98[_0x82e4('0x24')],'transfereeconnectedlinename':_0x18df98[_0x82e4('0x25')],'transfereeaccountcode':_0x18df98[_0x82e4('0x26')],'transfereecontext':_0x18df98[_0x82e4('0x27')],'transfereeexten':_0x18df98['transfertargetexten'],'transfereelinkedid':_0x18df98[_0x82e4('0x28')]});}writeDB(_0x18df98);}catch(_0x4b480d){utils['error'](util[_0x82e4('0x4')](_0x82e4('0x29'),_0x18df98['origtransfereruniqueid']),_0x4b480d);}};
\ No newline at end of file
+var _0x485a=['origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum'];(function(_0x1857d0,_0x6eade0){var _0x3e3c46=function(_0x3915b8){while(--_0x3915b8){_0x1857d0['push'](_0x1857d0['shift']());}};_0x3e3c46(++_0x6eade0);}(_0x485a,0x186));var _0xa485=function(_0x21c80a,_0x275d41){_0x21c80a=_0x21c80a-0x0;var _0x4a7719=_0x485a[_0x21c80a];return _0x4a7719;};'use strict';var _=require(_0xa485('0x0'));var util=require(_0xa485('0x1'));var utils=require(_0xa485('0x2'));function writeDB(_0x44c526){utils[_0xa485('0x3')](util[_0xa485('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x44c526[_0xa485('0x5')]===_0xa485('0x6')?_0x44c526[_0xa485('0x7')]:_0x44c526[_0xa485('0x8')],_0x44c526[_0xa485('0x5')]));utils['request'](_0xa485('0x9'),_0x44c526);}exports[_0xa485('0xa')]={};exports[_0xa485('0xb')]=function(_0x57a8f7){try{utils[_0xa485('0xc')](util[_0xa485('0x4')](_0xa485('0xd'),_0x57a8f7[_0xa485('0x8')]),_0x57a8f7);utils[_0xa485('0x3')](util[_0xa485('0x4')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x57a8f7[_0xa485('0x8')],_0x57a8f7[_0xa485('0xe')],_0x57a8f7[_0xa485('0xf')],_0x57a8f7[_0xa485('0x10')],_0x57a8f7[_0xa485('0x11')]));_0x57a8f7[_0xa485('0x5')]=_0xa485('0x12');exports[_0xa485('0xa')][_0x57a8f7[_0xa485('0x13')]]=_0x57a8f7;writeDB(_0x57a8f7);}catch(_0x3a346e){utils[_0xa485('0x14')](util[_0xa485('0x4')]('[%s][transfers][blindtransfer]',_0x57a8f7['uniqueid']),_0x3a346e);}};exports[_0xa485('0x15')]=function(_0x131737){try{utils[_0xa485('0xc')](util[_0xa485('0x4')](_0xa485('0x16'),_0x131737[_0xa485('0x7')]),_0x131737);utils[_0xa485('0x3')](util['format'](_0xa485('0x17'),_0x131737[_0xa485('0x7')],_0x131737[_0xa485('0x18')],_0x131737[_0xa485('0x19')],_0x131737[_0xa485('0x1a')],_0x131737[_0xa485('0x1b')]));_0x131737=_[_0xa485('0x1c')](_0x131737,{'transfererchannel':_0x131737['origtransfererchannel'],'transferercalleridnum':_0x131737[_0xa485('0x18')],'transferercalleridname':_0x131737['origtransferercalleridname'],'transfererconnectedlinenum':_0x131737[_0xa485('0x1d')],'transfererconnectedlinename':_0x131737['secondtransfererconnectedlinename'],'transfereraccountcode':_0x131737[_0xa485('0x1e')],'transferercontext':_0x131737[_0xa485('0x1f')],'transfererexten':_0x131737['secondtransfererexten'],'transfererlinkedid':_0x131737[_0xa485('0x20')],'context':_0x131737[_0xa485('0x21')],'extension':_0x131737[_0xa485('0x22')],'type':_0xa485('0x6')});if(_[_0xa485('0x23')](_0x131737[_0xa485('0x24')])){_0x131737=_[_0xa485('0x1c')](_0x131737,{'transfereechannel':_0x131737[_0xa485('0x25')],'transfereecalleridnum':_0x131737[_0xa485('0x1a')],'transfereecalleridname':_0x131737[_0xa485('0x1b')],'transfereeconnectedlinenum':_0x131737[_0xa485('0x26')],'transfereeconnectedlinename':_0x131737[_0xa485('0x27')],'transfereeaccountcode':_0x131737['transfertargetaccountcode'],'transfereecontext':_0x131737['transfertargetcontext'],'transfereeexten':_0x131737[_0xa485('0x28')],'transfereelinkedid':_0x131737[_0xa485('0x29')]});}writeDB(_0x131737);}catch(_0x20a18b){utils[_0xa485('0x14')](util[_0xa485('0x4')]('[%s][transfers][attendedtransfer]',_0x131737[_0xa485('0x7')]),_0x20a18b);}};
\ No newline at end of file
index eca7d65..18afd9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6565=['[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','interface','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','catch','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x2dc7bc,_0x2cdec5){var _0x547591=function(_0x507d3e){while(--_0x507d3e){_0x2dc7bc['push'](_0x2dc7bc['shift']());}};_0x547591(++_0x2cdec5);}(_0x6565,0x115));var _0x5656=function(_0x3253f3,_0x1c57d8){_0x3253f3=_0x3253f3-0x0;var _0x598c26=_0x6565[_0x3253f3];return _0x598c26;};'use strict';var BPromise=require(_0x5656('0x0'));var jayson=require(_0x5656('0x1'));var moment=require(_0x5656('0x2'));var util=require(_0x5656('0x3'));var client=jayson[_0x5656('0x4')]['http']({'port':0x2329});var logger=require(_0x5656('0x5'))('xdr');exports['info']=function(_0x1644bc,_0x530f5a){logger[_0x5656('0x6')](_0x1644bc,_0x530f5a?util[_0x5656('0x7')](_0x530f5a,{'showHidden':![],'depth':null}):'');};exports[_0x5656('0x8')]=function(_0x486734,_0x167460){logger[_0x5656('0x8')](_0x486734,_0x167460?util['inspect'](_0x167460,{'showHidden':![],'depth':null}):'');};exports[_0x5656('0x9')]=function(_0x21772f,_0x531efe){logger[_0x5656('0x9')](_0x21772f,_0x531efe?util[_0x5656('0x7')](_0x531efe,{'showHidden':![],'depth':null}):'');};exports[_0x5656('0xa')]=function(_0x44a4a9,_0x2345d7){return client[_0x5656('0xa')](_0x44a4a9,{'body':_0x2345d7})[_0x5656('0xb')](function(_0x35e71e){logger['debug'](_0x5656('0xc'),_0x44a4a9,_0x35e71e?util[_0x5656('0x7')](_0x35e71e,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x569095){logger[_0x5656('0x9')](_0x5656('0xc'),_0x44a4a9,_0x569095?util[_0x5656('0x7')](_0x569095,{'showHidden':![],'depth':null}):'');});};function getUser(_0x111fb6){return client[_0x5656('0xa')](_0x5656('0xd'),{'options':{'raw':!![],'attributes':['id','internal','name',_0x5656('0xe')],'where':_0x111fb6,'limit':0x1}})['then'](function(_0x464b0b){logger['debug']('[utils][getUser]\x20where:%s',JSON[_0x5656('0xf')](_0x111fb6),_0x464b0b?util['inspect'](_0x464b0b,{'showHidden':![],'depth':null}):'');return _0x464b0b[_0x5656('0x10')][_0x5656('0x11')]?_0x464b0b[_0x5656('0x10')][0x0]:null;});}exports['getUserByInternal']=function(_0xe98e8e){return new BPromise(function(_0xaeac9b,_0xbb5eba){if(_0xe98e8e){return getUser({'internal':_0xe98e8e})[_0x5656('0xb')](function(_0x1dbb0e){logger['info'](_0x5656('0x12'),_0xe98e8e,_0x1dbb0e?_0x5656('0x13'):_0x5656('0x14'));return _0xaeac9b(_0x1dbb0e);})[_0x5656('0x15')](function(_0x5852f1){logger[_0x5656('0x9')](_0x5656('0x16'),_0x5852f1?util[_0x5656('0x7')](_0x5852f1,{'showHidden':![],'depth':null}):'');return _0xaeac9b(null);});}return _0xaeac9b(null);});};exports['getUserByInterface']=function(_0xf9e498){return new BPromise(function(_0x333e51,_0x49880c){if(_0xf9e498){return getUser({'interface':_0xf9e498})['then'](function(_0xc7bd4e){logger['info'](_0x5656('0x17'),_0xf9e498,_0xc7bd4e?_0x5656('0x13'):_0x5656('0x14'));return _0x333e51(_0xc7bd4e);})['catch'](function(_0x3a6f4a){logger['error'](_0x5656('0x18'),_0x3a6f4a?util[_0x5656('0x7')](_0x3a6f4a,{'showHidden':![],'depth':null}):'');return _0x333e51(null);});}return _0x333e51(null);});};exports['getUserByName']=function(_0xe15812){return new BPromise(function(_0x54ab9b,_0x505114){if(_0xe15812){return getUser({'name':_0xe15812})['then'](function(_0x334fad){logger[_0x5656('0x6')](_0x5656('0x19'),_0xe15812,_0x334fad?_0x5656('0x13'):_0x5656('0x14'));return _0x54ab9b(_0x334fad);})['catch'](function(_0x145f9a){logger[_0x5656('0x9')](_0x5656('0x1a'),_0x145f9a?util[_0x5656('0x7')](_0x145f9a,{'showHidden':![],'depth':null}):'');return _0x54ab9b(null);});}return _0x54ab9b(null);});};exports[_0x5656('0x1b')]=function(_0x4cf30d){return new BPromise(function(_0x1f1842,_0x21d22b){if(_0x4cf30d){return client['request'](_0x5656('0x1c'),{'options':{'raw':!![],'attributes':['id',_0x5656('0x1d'),_0x5656('0x1e'),_0x5656('0x1f'),_0x5656('0x20')],'where':{'name':_0x4cf30d},'limit':0x1}})['then'](function(_0x90888){logger[_0x5656('0x8')](_0x5656('0x21'),_0x4cf30d,_0x90888?util['inspect'](_0x90888,{'showHidden':![],'depth':null}):'');logger['info'](_0x5656('0x22'),_0x4cf30d,_0x90888?_0x5656('0x13'):_0x5656('0x14'));return _0x1f1842(_0x90888[_0x5656('0x10')]['length']?_0x90888[_0x5656('0x10')][0x0]:null);})[_0x5656('0x15')](function(_0x3d64a8){logger[_0x5656('0x9')]('[utils][getVoiceQueueByName]',_0x3d64a8?util[_0x5656('0x7')](_0x3d64a8,{'showHidden':![],'depth':null}):'');return _0x1f1842(null);});}return _0x1f1842(null);});};exports['addTime']=function(_0x373049,_0x1c94a3){return moment(_0x373049)[_0x5656('0x23')](_0x1c94a3,_0x5656('0x24'))[_0x5656('0x25')](_0x5656('0x26'));};exports['subtractTime']=function(_0x461227,_0x10cfd1){return moment(_0x461227)['subtract'](_0x10cfd1,_0x5656('0x24'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['diffTime']=function(_0x12880d,_0x38f57d){return moment(_0x12880d)['diff'](moment(_0x38f57d),'seconds');};exports[_0x5656('0x27')]=function(_0x10fd48,_0xae175e){return parseInt(_0x10fd48,0xa)+parseInt(_0xae175e,0xa);};exports[_0x5656('0x28')]=function(){return moment()['format'](_0x5656('0x26'));};exports['isAfter']=function(_0x2b8774,_0x42add8){if(_0x42add8){return moment(_0x2b8774)[_0x5656('0x29')](_0x42add8);}return!![];};exports[_0x5656('0x2a')]=function(_0x38f4c5,_0x3a5a5f){if(_0x3a5a5f){return moment(_0x38f4c5)['isBefore'](_0x3a5a5f);}else if(_0x38f4c5){return!![];}return![];};
\ No newline at end of file
+var _0x33e6=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','http','../../config/logger','xdr','info','debug','inspect','request','then','[utils][request]\x20name:%s','error','GetUser','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]'];(function(_0xccc32c,_0x19b0c9){var _0x111aaa=function(_0x240840){while(--_0x240840){_0xccc32c['push'](_0xccc32c['shift']());}};_0x111aaa(++_0x19b0c9);}(_0x33e6,0xaa));var _0x633e=function(_0x528bd9,_0x4b82e8){_0x528bd9=_0x528bd9-0x0;var _0x127120=_0x33e6[_0x528bd9];return _0x127120;};'use strict';var BPromise=require(_0x633e('0x0'));var jayson=require('jayson/promise');var moment=require('moment');var util=require('util');var client=jayson['client'][_0x633e('0x1')]({'port':0x2329});var logger=require(_0x633e('0x2'))(_0x633e('0x3'));exports[_0x633e('0x4')]=function(_0x5310bb,_0x41542c){logger[_0x633e('0x4')](_0x5310bb,_0x41542c?util['inspect'](_0x41542c,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x50f9df,_0x2ad9c6){logger[_0x633e('0x5')](_0x50f9df,_0x2ad9c6?util[_0x633e('0x6')](_0x2ad9c6,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x5783f2,_0x2c63d0){logger['error'](_0x5783f2,_0x2c63d0?util[_0x633e('0x6')](_0x2c63d0,{'showHidden':![],'depth':null}):'');};exports[_0x633e('0x7')]=function(_0x15ace2,_0x488bf1){return client[_0x633e('0x7')](_0x15ace2,{'body':_0x488bf1})[_0x633e('0x8')](function(_0x572b3d){logger[_0x633e('0x5')](_0x633e('0x9'),_0x15ace2,_0x572b3d?util[_0x633e('0x6')](_0x572b3d,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x1f6f0d){logger[_0x633e('0xa')](_0x633e('0x9'),_0x15ace2,_0x1f6f0d?util[_0x633e('0x6')](_0x1f6f0d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4892cd){return client[_0x633e('0x7')](_0x633e('0xb'),{'options':{'raw':!![],'attributes':['id',_0x633e('0xc'),_0x633e('0xd'),_0x633e('0xe')],'where':_0x4892cd,'limit':0x1}})[_0x633e('0x8')](function(_0x277c54){logger[_0x633e('0x5')]('[utils][getUser]\x20where:%s',JSON[_0x633e('0xf')](_0x4892cd),_0x277c54?util[_0x633e('0x6')](_0x277c54,{'showHidden':![],'depth':null}):'');return _0x277c54[_0x633e('0x10')][_0x633e('0x11')]?_0x277c54[_0x633e('0x10')][0x0]:null;});}exports[_0x633e('0x12')]=function(_0x71b8fc){return new BPromise(function(_0xac5d45,_0x104066){if(_0x71b8fc){return getUser({'internal':_0x71b8fc})[_0x633e('0x8')](function(_0x1b7e4d){logger[_0x633e('0x4')](_0x633e('0x13'),_0x71b8fc,_0x1b7e4d?_0x633e('0x14'):'notfound');return _0xac5d45(_0x1b7e4d);})[_0x633e('0x15')](function(_0x47d943){logger[_0x633e('0xa')](_0x633e('0x16'),_0x47d943?util[_0x633e('0x6')](_0x47d943,{'showHidden':![],'depth':null}):'');return _0xac5d45(null);});}return _0xac5d45(null);});};exports[_0x633e('0x17')]=function(_0xab8882){return new BPromise(function(_0x219d4d,_0x39aef0){if(_0xab8882){return getUser({'interface':_0xab8882})[_0x633e('0x8')](function(_0x5bf7e7){logger[_0x633e('0x4')](_0x633e('0x18'),_0xab8882,_0x5bf7e7?_0x633e('0x14'):'notfound');return _0x219d4d(_0x5bf7e7);})[_0x633e('0x15')](function(_0xc8a85b){logger[_0x633e('0xa')](_0x633e('0x19'),_0xc8a85b?util[_0x633e('0x6')](_0xc8a85b,{'showHidden':![],'depth':null}):'');return _0x219d4d(null);});}return _0x219d4d(null);});};exports[_0x633e('0x1a')]=function(_0x31e596){return new BPromise(function(_0x49691d,_0x34ab3d){if(_0x31e596){return getUser({'name':_0x31e596})[_0x633e('0x8')](function(_0x442fac){logger[_0x633e('0x4')](_0x633e('0x1b'),_0x31e596,_0x442fac?_0x633e('0x14'):_0x633e('0x1c'));return _0x49691d(_0x442fac);})[_0x633e('0x15')](function(_0x40f2b1){logger['error'](_0x633e('0x1d'),_0x40f2b1?util[_0x633e('0x6')](_0x40f2b1,{'showHidden':![],'depth':null}):'');return _0x49691d(null);});}return _0x49691d(null);});};exports['getVoiceQueueByName']=function(_0xbeda04){return new BPromise(function(_0x697c05,_0x31229f){if(_0xbeda04){return client['request'](_0x633e('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x633e('0xd'),'type',_0x633e('0x1f'),_0x633e('0x20')],'where':{'name':_0xbeda04},'limit':0x1}})[_0x633e('0x8')](function(_0x54c940){logger['debug'](_0x633e('0x21'),_0xbeda04,_0x54c940?util[_0x633e('0x6')](_0x54c940,{'showHidden':![],'depth':null}):'');logger['info'](_0x633e('0x22'),_0xbeda04,_0x54c940?'found':_0x633e('0x1c'));return _0x697c05(_0x54c940['result'][_0x633e('0x11')]?_0x54c940[_0x633e('0x10')][0x0]:null);})[_0x633e('0x15')](function(_0x32a190){logger[_0x633e('0xa')](_0x633e('0x23'),_0x32a190?util[_0x633e('0x6')](_0x32a190,{'showHidden':![],'depth':null}):'');return _0x697c05(null);});}return _0x697c05(null);});};exports[_0x633e('0x24')]=function(_0x1594eb,_0x2e58f3){return moment(_0x1594eb)[_0x633e('0x25')](_0x2e58f3,_0x633e('0x26'))[_0x633e('0x27')](_0x633e('0x28'));};exports[_0x633e('0x29')]=function(_0x376de2,_0xcd354a){return moment(_0x376de2)[_0x633e('0x2a')](_0xcd354a,'seconds')['format'](_0x633e('0x28'));};exports[_0x633e('0x2b')]=function(_0x24edc0,_0x2eb662){return moment(_0x24edc0)[_0x633e('0x2c')](moment(_0x2eb662),_0x633e('0x26'));};exports[_0x633e('0x2d')]=function(_0x44cc86,_0x2574a3){return parseInt(_0x44cc86,0xa)+parseInt(_0x2574a3,0xa);};exports[_0x633e('0x2e')]=function(){return moment()[_0x633e('0x27')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x633e('0x2f')]=function(_0x27ac52,_0x41967c){if(_0x41967c){return moment(_0x27ac52)[_0x633e('0x2f')](_0x41967c);}return!![];};exports[_0x633e('0x30')]=function(_0x190f4a,_0x498234){if(_0x498234){return moment(_0x190f4a)[_0x633e('0x30')](_0x498234);}else if(_0x190f4a){return!![];}return![];};
\ No newline at end of file
index e1b95a6..7c002fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4681=['path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','client','role','name','then','catch','log','user','no-user','data','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','inspect','device','agent_id','responseTime','agent_name','fs-extra','express-winston'];(function(_0x20cece,_0x556680){var _0x163fc1=function(_0x14af6d){while(--_0x14af6d){_0x20cece['push'](_0x20cece['shift']());}};_0x163fc1(++_0x556680);}(_0x4681,0x1d7));var _0x1468=function(_0x1be31d,_0x12b63b){_0x1be31d=_0x1be31d-0x0;var _0x5a1e00=_0x4681[_0x1be31d];return _0x5a1e00;};var fs=require(_0x1468('0x0'));var _=require('lodash');var ewinston=require(_0x1468('0x1'));var path=require(_0x1468('0x2'));var util=require(_0x1468('0x3'));var fileLogger=require(_0x1468('0x4'))[_0x1468('0x5')];var safeTemplate=require(_0x1468('0x6'))[_0x1468('0x7')];var maskSensitiveData=require(_0x1468('0x8'))[_0x1468('0x9')];function ClientSideLogger(){function _0xaf536e(_0x443793){var _0x48ab97=path[_0x1468('0xa')]('/var','log','xcally');var _0x12fe96=path[_0x1468('0xa')](_0x1468('0xb'),_0x443793[_0x1468('0xc')]+'-'+_0x443793[_0x1468('0xd')]);return fs['ensureDir'](path['join'](_0x48ab97,_0x12fe96))[_0x1468('0xe')](function(){var _0x3c436e=fileLogger(_0x1468('0xb'),path['join'](_0x48ab97,_0x12fe96));return _0x3c436e;})[_0x1468('0xf')](function(_0x391f03){throw _0x391f03;});}this[_0x1468('0x10')]=function(_0x9bcc38,_0x56c65d,_0x2fa9cb,_0x4ef953){return _0xaf536e(_0x9bcc38['user'])[_0x1468('0xe')](function(_0x3ecce1){var _0x56af99=_0x3ecce1[_0x56c65d];return _0x56af99;})['then'](function(_0x1ad5a4){var _0x4efad2=_0x9bcc38[_0x1468('0x11')]?_0x9bcc38['user']['id']:_0x1468('0x12');var _0xe87509=_0x4ef953[_0x1468('0x13')];var _0x3053ba=_0x4ef953['timestamp'];var _0x37456b=new Date(Number(_0x3053ba));return _0x1ad5a4(_0x4efad2,_0x37456b,_0x2fa9cb,_0xe87509);})[_0x1468('0xf')](function(_0x3a6f62){fileLogger('client')['error'](_0x3a6f62);});};}function setupLoggers(_0x27d5b7){return new Promise(function(_0x5a7d91){var _0x4f8554=new ClientSideLogger();var _0x32e6f9=fileLogger(_0x1468('0x14'));var _0x59ce53=fileLogger(_0x1468('0x15'));_0x27d5b7[_0x1468('0x16')](_0x1468('0x17'),_0x4f8554);_0x27d5b7[_0x1468('0x18')](ewinston[_0x1468('0x19')]({'winstonInstance':_0x32e6f9,'meta':![],'statusLevels':!![],'msg':function(_0x2eb02d,_0xcbeaaf){var _0x3660ed=_0x1468('0x1a');if(!_[_0x1468('0x1b')](_0x2eb02d[_0x1468('0x1c')])){_0x3660ed+=_0x1468('0x1d');var _0x123205=_0x2eb02d[_0x1468('0x1c')];maskSensitiveData(_0x123205);}return safeTemplate(util[_0x1468('0x1e')](_0x3660ed,_0x2eb02d[_0x1468('0x1f')],_0x2eb02d[_0x1468('0x20')][_0x1468('0x21')]?_0x2eb02d['headers'][_0x1468('0x21')]:_0x2eb02d[_0x1468('0x22')][_0x1468('0x23')]||_0x2eb02d['ip'],_0x2eb02d[_0x1468('0x24')],_0xcbeaaf[_0x1468('0x25')],_0xcbeaaf['responseTime'],_0x2eb02d[_0x1468('0x11')]?_0x2eb02d[_0x1468('0x11')]['id']:null,_0x2eb02d[_0x1468('0x11')]?_0x2eb02d[_0x1468('0x11')][_0x1468('0xd')]:null,_0x2eb02d['user']?_0x2eb02d['user'][_0x1468('0xc')]:null,_0x123205?util[_0x1468('0x26')](_0x123205,![],null):''));}}));_0x27d5b7[_0x1468('0x18')](ewinston['logger']({'winstonInstance':_0x59ce53,'meta':![],'statusLevels':!![],'msg':function(_0x519b13,_0x446019){var _0x345714='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x519b13[_0x1468('0x1c')]&&_0x519b13[_0x1468('0x1c')][_0x1468('0x27')]&&_0x519b13[_0x1468('0x1c')][_0x1468('0x28')]){_0x345714='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x1468('0x1e')](_0x345714,_0x519b13[_0x1468('0x1f')],_0x519b13[_0x1468('0x20')][_0x1468('0x21')]?_0x519b13[_0x1468('0x20')][_0x1468('0x21')]:_0x519b13['connection']['remoteAddress']||_0x519b13['ip'],_0x519b13[_0x1468('0x24')],_0x446019[_0x1468('0x25')],_0x446019[_0x1468('0x29')],_0x519b13[_0x1468('0x11')]?_0x519b13['user']['id']:null,_0x519b13[_0x1468('0x11')]?_0x519b13[_0x1468('0x11')][_0x1468('0xd')]:null,_0x519b13['user']?_0x519b13[_0x1468('0x11')][_0x1468('0xc')]:null,_0x519b13[_0x1468('0x1c')]&&_0x519b13[_0x1468('0x1c')][_0x1468('0x27')]?_0x519b13[_0x1468('0x1c')][_0x1468('0x27')]:'other',_0x519b13[_0x1468('0x1c')]&&_0x519b13[_0x1468('0x1c')][_0x1468('0x28')]?_0x519b13[_0x1468('0x1c')][_0x1468('0x28')]:'',_0x519b13[_0x1468('0x1c')]&&_0x519b13[_0x1468('0x1c')][_0x1468('0x2a')]?_0x519b13[_0x1468('0x1c')][_0x1468('0x2a')]:'');},'ignoreRoute':function(_0x2913f3){var _0x2fa8af=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x2fa8af['test'](_0x2913f3[_0x1468('0x24')]);}}));return _0x5a7d91();});}exports['setupLoggers']=setupLoggers;
\ No newline at end of file
+var _0x7f56=['logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','format','headers','x-forwarded-for','connection','url','statusCode','responseTime','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','method','remoteAddress','device','agent_id','agent_name','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','join','/var','xcally','client','role','then','catch','log','user','no-user','data','error','api','auth','set','use'];(function(_0x38625d,_0x331631){var _0x3775b8=function(_0x452c34){while(--_0x452c34){_0x38625d['push'](_0x38625d['shift']());}};_0x3775b8(++_0x331631);}(_0x7f56,0x1cb));var _0x67f5=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7f56[_0x34bf97];return _0x292719;};var fs=require(_0x67f5('0x0'));var _=require(_0x67f5('0x1'));var ewinston=require('express-winston');var path=require(_0x67f5('0x2'));var util=require(_0x67f5('0x3'));var fileLogger=require(_0x67f5('0x4'))[_0x67f5('0x5')];var safeTemplate=require(_0x67f5('0x6'))[_0x67f5('0x7')];var maskSensitiveData=require(_0x67f5('0x8'))['maskSensitiveData'];function ClientSideLogger(){function _0x1b023f(_0x210bb9){var _0xd73d92=path[_0x67f5('0x9')](_0x67f5('0xa'),'log',_0x67f5('0xb'));var _0x19db29=path[_0x67f5('0x9')](_0x67f5('0xc'),_0x210bb9[_0x67f5('0xd')]+'-'+_0x210bb9['name']);return fs['ensureDir'](path[_0x67f5('0x9')](_0xd73d92,_0x19db29))[_0x67f5('0xe')](function(){var _0x51e608=fileLogger(_0x67f5('0xc'),path[_0x67f5('0x9')](_0xd73d92,_0x19db29));return _0x51e608;})[_0x67f5('0xf')](function(_0x297ce3){throw _0x297ce3;});}this[_0x67f5('0x10')]=function(_0x4533d4,_0x56c88d,_0x1d9413,_0x13f86f){return _0x1b023f(_0x4533d4[_0x67f5('0x11')])['then'](function(_0x756db){var _0x2749ba=_0x756db[_0x56c88d];return _0x2749ba;})['then'](function(_0xc47e8c){var _0x5ca7d3=_0x4533d4[_0x67f5('0x11')]?_0x4533d4[_0x67f5('0x11')]['id']:_0x67f5('0x12');var _0x1ce6d6=_0x13f86f[_0x67f5('0x13')];var _0x46ead4=_0x13f86f['timestamp'];var _0x166f7e=new Date(Number(_0x46ead4));return _0xc47e8c(_0x5ca7d3,_0x166f7e,_0x1d9413,_0x1ce6d6);})[_0x67f5('0xf')](function(_0x56704e){fileLogger(_0x67f5('0xc'))[_0x67f5('0x14')](_0x56704e);});};}function setupLoggers(_0x3ab56e){return new Promise(function(_0x496cc0){var _0x3984bf=new ClientSideLogger();var _0x5cb9d4=fileLogger(_0x67f5('0x15'));var _0x128ca8=fileLogger(_0x67f5('0x16'));_0x3ab56e[_0x67f5('0x17')]('client-side-logger',_0x3984bf);_0x3ab56e[_0x67f5('0x18')](ewinston[_0x67f5('0x19')]({'winstonInstance':_0x5cb9d4,'meta':![],'statusLevels':!![],'msg':function(_0x4459f4,_0x5d472a){var _0x2790cb=_0x67f5('0x1a');if(!_['isEmpty'](_0x4459f4[_0x67f5('0x1b')])){_0x2790cb+=_0x67f5('0x1c');var _0x47a871=_0x4459f4[_0x67f5('0x1b')];maskSensitiveData(_0x47a871);}return safeTemplate(util[_0x67f5('0x1d')](_0x2790cb,_0x4459f4['method'],_0x4459f4[_0x67f5('0x1e')]['x-forwarded-for']?_0x4459f4['headers'][_0x67f5('0x1f')]:_0x4459f4[_0x67f5('0x20')]['remoteAddress']||_0x4459f4['ip'],_0x4459f4[_0x67f5('0x21')],_0x5d472a[_0x67f5('0x22')],_0x5d472a[_0x67f5('0x23')],_0x4459f4['user']?_0x4459f4['user']['id']:null,_0x4459f4[_0x67f5('0x11')]?_0x4459f4[_0x67f5('0x11')][_0x67f5('0x24')]:null,_0x4459f4[_0x67f5('0x11')]?_0x4459f4[_0x67f5('0x11')][_0x67f5('0xd')]:null,_0x47a871?util['inspect'](_0x47a871,![],null):''));}}));_0x3ab56e[_0x67f5('0x18')](ewinston[_0x67f5('0x19')]({'winstonInstance':_0x128ca8,'meta':![],'statusLevels':!![],'msg':function(_0x1ce3ca,_0x325838){var _0x9fa10f=_0x67f5('0x25');if(_0x1ce3ca[_0x67f5('0x1b')]&&_0x1ce3ca['body']['device']&&_0x1ce3ca[_0x67f5('0x1b')]['agent_id']){_0x9fa10f='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x9fa10f,_0x1ce3ca[_0x67f5('0x26')],_0x1ce3ca[_0x67f5('0x1e')][_0x67f5('0x1f')]?_0x1ce3ca[_0x67f5('0x1e')][_0x67f5('0x1f')]:_0x1ce3ca['connection'][_0x67f5('0x27')]||_0x1ce3ca['ip'],_0x1ce3ca[_0x67f5('0x21')],_0x325838[_0x67f5('0x22')],_0x325838['responseTime'],_0x1ce3ca[_0x67f5('0x11')]?_0x1ce3ca[_0x67f5('0x11')]['id']:null,_0x1ce3ca['user']?_0x1ce3ca[_0x67f5('0x11')][_0x67f5('0x24')]:null,_0x1ce3ca[_0x67f5('0x11')]?_0x1ce3ca[_0x67f5('0x11')]['role']:null,_0x1ce3ca[_0x67f5('0x1b')]&&_0x1ce3ca[_0x67f5('0x1b')][_0x67f5('0x28')]?_0x1ce3ca[_0x67f5('0x1b')]['device']:'other',_0x1ce3ca[_0x67f5('0x1b')]&&_0x1ce3ca['body'][_0x67f5('0x29')]?_0x1ce3ca[_0x67f5('0x1b')]['agent_id']:'',_0x1ce3ca[_0x67f5('0x1b')]&&_0x1ce3ca['body'][_0x67f5('0x2a')]?_0x1ce3ca['body']['agent_name']:'');},'ignoreRoute':function(_0x261c93){var _0x1217ca=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x1217ca['test'](_0x261c93[_0x67f5('0x21')]);}}));return _0x496cc0();});}exports[_0x67f5('0x2b')]=setupLoggers;
\ No newline at end of file
index 803701f..fdb98e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4a4=['transports','%s-%s','error','File','warn','consoleLogger','fileLogger','path','util','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','bold\x20white','bold\x20green','gray','bold\x20magenta','bold\x20blue','addColors','/var/log/xcally','format','%s-%s.log','message','replace','level','{{{','}}}','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','Logger','Console'];(function(_0xe75522,_0x9666a9){var _0x3e1bee=function(_0x15510d){while(--_0x15510d){_0xe75522['push'](_0xe75522['shift']());}};_0x3e1bee(++_0x9666a9);}(_0xe4a4,0x97));var _0x4e4a=function(_0x4cda06,_0x3cb29c){_0x4cda06=_0x4cda06-0x0;var _0x48f3fa=_0xe4a4[_0x4cda06];return _0x48f3fa;};'use strict';var path=require(_0x4e4a('0x0'));var util=require(_0x4e4a('0x1'));var moment=require('moment');var winston=require('winston');var config=require(_0x4e4a('0x2'));var debugLevel=config[_0x4e4a('0x3')]?config['debugLevel'][_0x4e4a('0x4')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x4e4a('0x5'),'error':_0x4e4a('0x6'),'warn':_0x4e4a('0x7'),'info':'white','print':_0x4e4a('0x8'),'success':_0x4e4a('0x9'),'http':_0x4e4a('0xa'),'verbose':_0x4e4a('0xb'),'debug':_0x4e4a('0xc'),'silly':'bold\x20cyan'};winston[_0x4e4a('0xd')](XC_LOG_COLORS);function getLogFileName(_0x37f202,_0xa1b6c2,_0x18788b){var _0x4a8fcf=_0x37f202||_0x4e4a('0xe');return path['join'](_0x4a8fcf,util[_0x4e4a('0xf')](_0x4e4a('0x10'),_0xa1b6c2,_0x18788b));}function formatter(_0x3f2674,_0x1cc36a){_0x1cc36a['message']=_0x1cc36a[_0x4e4a('0x11')][_0x4e4a('0x12')](/@@{/g,'{{{')[_0x4e4a('0x12')](/}@@/g,'}}}')[_0x4e4a('0x12')](/@{/g,'{{')[_0x4e4a('0x12')](/}@/g,'}}');return util[_0x4e4a('0xf')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()[_0x4e4a('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),_0x1cc36a[_0x4e4a('0x13')]['toUpperCase'](),_0x3f2674,_0x1cc36a[_0x4e4a('0x11')]);}function fileFormat(_0x3df9db,_0x1a3dd1){_0x1a3dd1[_0x4e4a('0x11')]=_0x1a3dd1[_0x4e4a('0x11')]['replace'](/@@{/g,_0x4e4a('0x14'))[_0x4e4a('0x12')](/}@@/g,_0x4e4a('0x15'))['replace'](/@{/g,'{{')[_0x4e4a('0x12')](/}@/g,'}}');var _0x5883b4=_0x1a3dd1[_0x4e4a('0x16')]&&Object[_0x4e4a('0x17')](_0x1a3dd1[_0x4e4a('0x16')])[_0x4e4a('0x18')]?'\x0a\x09'+JSON['stringify'](_0x1a3dd1[_0x4e4a('0x16')]):'';return util[_0x4e4a('0xf')](_0x4e4a('0x19'),moment()['format'](_0x4e4a('0x1a')),_0x1a3dd1[_0x4e4a('0x13')]['toUpperCase'](),_0x3df9db,_0x1a3dd1[_0x4e4a('0x11')],_0x5883b4);}function consoleLogger(){var _0xb61b7b=new winston[(_0x4e4a('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x4e4a('0x1c'))]({'level':'warn','json':![],'formatter':function(_0x259467){return formatter('',_0x259467);}})]});return _0xb61b7b;}function fileLogger(_0x21bb25,_0x5c81dd){var _0x27cb43=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x4e4a('0x1d'))]['File']({'name':util[_0x4e4a('0xf')](_0x4e4a('0x1e'),_0x21bb25,'error'),'filename':getLogFileName(_0x5c81dd,_0x21bb25,_0x4e4a('0x1f')),'level':_0x4e4a('0x1f'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xb16703){return fileFormat(_0x21bb25,_0xb16703);}}),new winston[(_0x4e4a('0x1d'))][(_0x4e4a('0x20'))]({'name':util[_0x4e4a('0xf')](_0x4e4a('0x1e'),_0x21bb25,debugLevel),'filename':getLogFileName(_0x5c81dd,_0x21bb25,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x184460){return fileFormat(_0x21bb25,_0x184460);}}),new winston[(_0x4e4a('0x1d'))]['Console']({'level':_0x4e4a('0x21'),'json':![],'formatter':function(_0x5d4890){return fileFormat(_0x21bb25,_0x5d4890);}})]});return _0x27cb43;}exports[_0x4e4a('0x22')]=consoleLogger;exports[_0x4e4a('0x23')]=fileLogger;
\ No newline at end of file
+var _0xbd68=['bold\x20blue','bold\x20cyan','addColors','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','Console','warn','File','error','%s-%s','consoleLogger','fileLogger','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white','gray','bold\x20magenta'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0xbd68,0x195));var _0x8bd6=function(_0x5777c5,_0x6e99e6){_0x5777c5=_0x5777c5-0x0;var _0x599c75=_0xbd68[_0x5777c5];return _0x599c75;};'use strict';var path=require('path');var util=require(_0x8bd6('0x0'));var moment=require(_0x8bd6('0x1'));var winston=require(_0x8bd6('0x2'));var config=require(_0x8bd6('0x3'));var debugLevel=config['debugLevel']?config[_0x8bd6('0x4')][_0x8bd6('0x5')]():_0x8bd6('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x8bd6('0x7'),'error':_0x8bd6('0x8'),'warn':_0x8bd6('0x9'),'info':_0x8bd6('0xa'),'print':'bold\x20white','success':'bold\x20green','http':_0x8bd6('0xb'),'verbose':_0x8bd6('0xc'),'debug':_0x8bd6('0xd'),'silly':_0x8bd6('0xe')};winston[_0x8bd6('0xf')](XC_LOG_COLORS);function getLogFileName(_0x334810,_0xffe359,_0x473ed8){var _0x2ba206=_0x334810||'/var/log/xcally';return path['join'](_0x2ba206,util[_0x8bd6('0x10')](_0x8bd6('0x11'),_0xffe359,_0x473ed8));}function formatter(_0x2dd7ba,_0x28688e){_0x28688e[_0x8bd6('0x12')]=_0x28688e[_0x8bd6('0x12')][_0x8bd6('0x13')](/@@{/g,_0x8bd6('0x14'))[_0x8bd6('0x13')](/}@@/g,_0x8bd6('0x15'))['replace'](/@{/g,'{{')[_0x8bd6('0x13')](/}@/g,'}}');return util[_0x8bd6('0x10')](_0x8bd6('0x16'),moment()[_0x8bd6('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),_0x28688e['level'][_0x8bd6('0x17')](),_0x2dd7ba,_0x28688e[_0x8bd6('0x12')]);}function fileFormat(_0x901309,_0x1e54b6){_0x1e54b6['message']=_0x1e54b6[_0x8bd6('0x12')][_0x8bd6('0x13')](/@@{/g,'{{{')[_0x8bd6('0x13')](/}@@/g,_0x8bd6('0x15'))['replace'](/@{/g,'{{')[_0x8bd6('0x13')](/}@/g,'}}');var _0x52827a=_0x1e54b6['meta']&&Object[_0x8bd6('0x18')](_0x1e54b6['meta'])['length']?'\x0a\x09'+JSON[_0x8bd6('0x19')](_0x1e54b6['meta']):'';return util[_0x8bd6('0x10')](_0x8bd6('0x1a'),moment()[_0x8bd6('0x10')](_0x8bd6('0x1b')),_0x1e54b6[_0x8bd6('0x1c')][_0x8bd6('0x17')](),_0x901309,_0x1e54b6['message'],_0x52827a);}function consoleLogger(){var _0x97b14c=new winston[(_0x8bd6('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x8bd6('0x1e'))][(_0x8bd6('0x1f'))]({'level':_0x8bd6('0x20'),'json':![],'formatter':function(_0x4fa8b2){return formatter('',_0x4fa8b2);}})]});return _0x97b14c;}function fileLogger(_0x391bc4,_0x426d45){var _0x58fda1=new winston[(_0x8bd6('0x1d'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x8bd6('0x21'))]({'name':util[_0x8bd6('0x10')]('%s-%s',_0x391bc4,_0x8bd6('0x22')),'filename':getLogFileName(_0x426d45,_0x391bc4,_0x8bd6('0x22')),'level':_0x8bd6('0x22'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x8b6f8d){return fileFormat(_0x391bc4,_0x8b6f8d);}}),new winston[(_0x8bd6('0x1e'))][(_0x8bd6('0x21'))]({'name':util[_0x8bd6('0x10')](_0x8bd6('0x23'),_0x391bc4,debugLevel),'filename':getLogFileName(_0x426d45,_0x391bc4,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x262288){return fileFormat(_0x391bc4,_0x262288);}}),new winston[(_0x8bd6('0x1e'))]['Console']({'level':'warn','json':![],'formatter':function(_0x2f07ed){return fileFormat(_0x391bc4,_0x2f07ed);}})]});return _0x58fda1;}exports[_0x8bd6('0x24')]=consoleLogger;exports[_0x8bd6('0x25')]=fileLogger;
\ No newline at end of file
index fc289b0..7dcfb68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['email','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','dsn','registry','oldPassword','length','isPlainObject','@@{','replace','}@@','includes','exports','maskSensitiveData','lodash','username','password','newPassword','apiKey','firstName','street','phone','fax'];(function(_0x1c3765,_0xc3b431){var _0x3ab003=function(_0x470393){while(--_0x470393){_0x1c3765['push'](_0x1c3765['shift']());}};_0x3ab003(++_0xc3b431);}(_0x2ef3,0xba));var _0x32ef=function(_0x3d4576,_0x3123f2){_0x3d4576=_0x3d4576-0x0;var _0xcd1a42=_0x2ef3[_0x3d4576];return _0xcd1a42;};var _=require(_0x32ef('0x0'));var sensitiveFields=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3'),_0x32ef('0x4'),_0x32ef('0x5'),'lastName',_0x32ef('0x6'),_0x32ef('0x7'),'mobile',_0x32ef('0x8'),_0x32ef('0x9'),'clientId','clientSecret',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'consumerSecret','membername',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'clientEmail',_0x32ef('0x18'),'accesskeyid',_0x32ef('0x19'),'key',_0x32ef('0x1a'),_0x32ef('0x1b'),'accountSid','localstationid',_0x32ef('0x1c'),'secret',_0x32ef('0x1d'),_0x32ef('0x1e')];function maskSensitiveData(_0x93d492){const _0x54c7f5=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x93d492)){for(const _0x55bf0b in _0x93d492){if(_['isArray'](_0x93d492[_0x55bf0b])){for(let _0x13db1a=0x0;_0x13db1a<_0x93d492[_0x55bf0b][_0x32ef('0x1f')];_0x13db1a++){maskSensitiveData(_0x93d492[_0x55bf0b][_0x13db1a]);}}else if(_[_0x32ef('0x20')](_0x93d492[_0x55bf0b])){maskSensitiveData(_0x93d492[_0x55bf0b]);}else if(_['isString'](_0x93d492[_0x55bf0b])){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](/{{{/g,_0x32ef('0x21'))[_0x32ef('0x22')](/}}}/g,_0x32ef('0x23'))['replace'](/{{/g,'@{')[_0x32ef('0x22')](/}}/g,'}@');if(_[_0x32ef('0x24')](sensitiveFields,_0x55bf0b)){_0x93d492[_0x55bf0b]=_0x93d492[_0x55bf0b]['replace'](_0x54c7f5,'*');}}}}}module[_0x32ef('0x25')][_0x32ef('0x26')]=maskSensitiveData;
\ No newline at end of file
+var _0xadb5=['exten','vidaooApiKey','privateKey','secretaccesskey','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length','isString','replace','@@{','}@@','username','newPassword','apiKey','firstName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum'];(function(_0x45dd21,_0x428143){var _0xdf24f=function(_0x15ad1c){while(--_0x15ad1c){_0x45dd21['push'](_0x45dd21['shift']());}};_0xdf24f(++_0x428143);}(_0xadb5,0xad));var _0x5adb=function(_0x4516e3,_0x898004){_0x4516e3=_0x4516e3-0x0;var _0x3334a2=_0xadb5[_0x4516e3];return _0x3334a2;};var _=require('lodash');var sensitiveFields=[_0x5adb('0x0'),'password',_0x5adb('0x1'),_0x5adb('0x2'),_0x5adb('0x3'),'lastName',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6'),'fax',_0x5adb('0x7'),_0x5adb('0x8'),_0x5adb('0x9'),_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc'),_0x5adb('0xd'),_0x5adb('0xe'),_0x5adb('0xf'),_0x5adb('0x10'),_0x5adb('0x11'),_0x5adb('0x12'),_0x5adb('0x13'),_0x5adb('0x14'),'membername','calleridname',_0x5adb('0x15'),_0x5adb('0x16'),_0x5adb('0x17'),'clientEmail',_0x5adb('0x18'),'accesskeyid',_0x5adb('0x19'),'key',_0x5adb('0x1a'),_0x5adb('0x1b'),_0x5adb('0x1c'),'localstationid',_0x5adb('0x1d'),_0x5adb('0x1e'),_0x5adb('0x1f'),'oldPassword'];function maskSensitiveData(_0x2312de){const _0x518823=/(?!^)[\s\S](?!$)/g;if(_[_0x5adb('0x20')](_0x2312de)){for(const _0x42a482 in _0x2312de){if(_[_0x5adb('0x21')](_0x2312de[_0x42a482])){for(let _0x304784=0x0;_0x304784<_0x2312de[_0x42a482][_0x5adb('0x22')];_0x304784++){maskSensitiveData(_0x2312de[_0x42a482][_0x304784]);}}else if(_[_0x5adb('0x20')](_0x2312de[_0x42a482])){maskSensitiveData(_0x2312de[_0x42a482]);}else if(_[_0x5adb('0x23')](_0x2312de[_0x42a482])){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](/{{{/g,_0x5adb('0x25'))['replace'](/}}}/g,_0x5adb('0x26'))['replace'](/{{/g,'@{')[_0x5adb('0x24')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x42a482)){_0x2312de[_0x42a482]=_0x2312de[_0x42a482][_0x5adb('0x24')](_0x518823,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData;
\ No newline at end of file
index df89119..7b65c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['string','replace','isPlainObject','keys','reduce','safeTemplate','{\x20{\x20','\x20}\x20}'];(function(_0x5d7803,_0x30e9aa){var _0x1a43b2=function(_0x1359df){while(--_0x1359df){_0x5d7803['push'](_0x5d7803['shift']());}};_0x1a43b2(++_0x30e9aa);}(_0x34b7,0x196));var _0x734b=function(_0x4651bd,_0x12a42f){_0x4651bd=_0x4651bd-0x0;var _0xdf510d=_0x34b7[_0x4651bd];return _0xdf510d;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x57123d){return _0x57123d==='{{'?_0x734b('0x0'):_0x734b('0x1');}function safeTemplate(_0x6e4318){var _0x354f96=_0x6e4318;if(typeof _0x6e4318===_0x734b('0x2')){_0x354f96=_0x6e4318[_0x734b('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x6e4318)){_0x354f96=_0x6e4318['map'](function(_0x303067){return safeTemplate(_0x303067);});}else if(_[_0x734b('0x4')](_0x6e4318)){_0x354f96=Object[_0x734b('0x5')](_0x6e4318)[_0x734b('0x6')](function(_0x28918a,_0x35d685){_0x28918a[_0x35d685]=safeTemplate(_0x6e4318[_0x35d685]);return _0x28918a;},{});}return _0x354f96;}module['exports'][_0x734b('0x7')]=safeTemplate;
\ No newline at end of file
+var _0x1a85=['{\x20{\x20','\x20}\x20}','replace','isArray','map','isPlainObject','reduce','exports'];(function(_0x7ccfa1,_0x5218d0){var _0x3c5f8c=function(_0xbe437e){while(--_0xbe437e){_0x7ccfa1['push'](_0x7ccfa1['shift']());}};_0x3c5f8c(++_0x5218d0);}(_0x1a85,0x178));var _0x51a8=function(_0x3e798a,_0x1c3f1f){_0x3e798a=_0x3e798a-0x0;var _0x34538f=_0x1a85[_0x3e798a];return _0x34538f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x54a0db){return _0x54a0db==='{{'?_0x51a8('0x0'):_0x51a8('0x1');}function safeTemplate(_0x43e22a){var _0x498466=_0x43e22a;if(typeof _0x43e22a==='string'){_0x498466=_0x43e22a[_0x51a8('0x2')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x51a8('0x3')](_0x43e22a)){_0x498466=_0x43e22a[_0x51a8('0x4')](function(_0x48a21b){return safeTemplate(_0x48a21b);});}else if(_[_0x51a8('0x5')](_0x43e22a)){_0x498466=Object['keys'](_0x43e22a)[_0x51a8('0x6')](function(_0x5cf430,_0x331117){_0x5cf430[_0x331117]=safeTemplate(_0x43e22a[_0x331117]);return _0x5cf430;},{});}return _0x498466;}module[_0x51a8('0x7')]['safeTemplate']=safeTemplate;
\ No newline at end of file